diff -pruN 43.0.0-1/debian/cargo-checksum.json 43.0.0-1ubuntu1/debian/cargo-checksum.json
--- 43.0.0-1/debian/cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/debian/cargo-checksum.json	2025-03-27 14:43:28.000000000 +0000
@@ -0,0 +1 @@
+{}
diff -pruN 43.0.0-1/debian/changelog 43.0.0-1ubuntu1/debian/changelog
--- 43.0.0-1/debian/changelog	2024-09-10 18:55:34.000000000 +0000
+++ 43.0.0-1ubuntu1/debian/changelog	2025-03-27 14:43:53.000000000 +0000
@@ -1,3 +1,17 @@
+python-cryptography (43.0.0-1ubuntu1) plucky; urgency=medium
+
+  * Add a recipe in d/rules to generate the vendor tarball
+  * Add vendored crates
+  * Provide an empty cargo-checksum.json
+  * Don't downgrade deps in rust lockfile
+  * Don't generate lockfile during configure
+  * Remove vcpkg from lockfile
+  * Don't depend on rust -dev distribution packages
+  * Depend on dh-cargo, dh-cargo-tools, pkgconf and setuptools
+  * Configure for cargo
+
+ -- Adrien Nader <adrien.nader@canonical.com>  Thu, 27 Mar 2025 15:43:53 +0100
+
 python-cryptography (43.0.0-1) unstable; urgency=medium
 
   * New upstream version.
diff -pruN 43.0.0-1/debian/control 43.0.0-1ubuntu1/debian/control
--- 43.0.0-1/debian/control	2024-09-10 18:55:34.000000000 +0000
+++ 43.0.0-1ubuntu1/debian/control	2025-03-27 14:43:53.000000000 +0000
@@ -1,25 +1,17 @@
 Source: python-cryptography
-Maintainer: Debian Python Team <team+python@tracker.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian Python Team <team+python@tracker.debian.org>
 Uploaders: Jérémy Lal <kapouer@melix.org>,
            Andrey Rakhmatullin <wrar@debian.org>,
 Section: python
 Priority: optional
 Build-Depends: cargo,
                debhelper-compat (= 13),
+               dh-cargo,
+               dh-cargo-tools,
                dh-sequence-python3,
-               librust-asn1-0.17-dev,
-               librust-cc-1.1-dev,
-               librust-cfg-if-dev,
-               librust-foreign-types-0.3-dev,
-               librust-foreign-types-shared-0.1-dev,
-               librust-once-cell-dev,
-               librust-openssl-dev (>= 0.10.64~),
-               librust-openssl-sys-dev (>= 0.9.101~),
-               librust-pem-3.0-dev,
-               librust-pyo3-0.22+default-dev,
-               librust-pyo3-0.22-dev,
-               librust-self-cell-dev,
                libssl-dev,
+               pkgconf,
                pybuild-plugin-pyproject,
                python3-all-dev,
                python3-bcrypt <!nocheck>,
@@ -31,6 +23,7 @@ Build-Depends: cargo,
                python3-pretend <!nocheck>,
                python3-pytest <!nocheck>,
                python3-pytest-benchmark <!nocheck>,
+               python3-setuptools,
 Build-Depends-Indep: dh-sequence-sphinxdoc <!nodoc>,
                      python3-doc <!nodoc>,
                      python3-sphinx <!nodoc>,
@@ -41,6 +34,7 @@ Vcs-Git: https://salsa.debian.org/python
 Homepage: https://cryptography.io/
 Rules-Requires-Root: no
 Testsuite: autopkgtest-pkg-pybuild
+XS-Vendored-Sources-Rust: asn1@0.16.2, asn1_derive@0.16.2, autocfg@1.3.0, base64@0.22.1, bitflags@2.6.0, cc@1.1.6, cfg-if@1.0.0, foreign-types-shared@0.1.1, foreign-types@0.3.2, heck@0.5.0, indoc@2.0.5, libc@0.2.155, memoffset@0.9.1, once_cell@1.19.0, openssl-macros@0.1.1, openssl-sys@0.9.103, openssl@0.10.65, pem@3.0.4, pkg-config@0.3.30, portable-atomic@1.7.0, proc-macro2@1.0.86, pyo3-build-config@0.22.2, pyo3-ffi@0.22.2, pyo3-macros-backend@0.22.2, pyo3-macros@0.22.2, pyo3@0.22.2, quote@1.0.36, self_cell@1.0.4, syn@2.0.71, target-lexicon@0.12.15, unicode-ident@1.0.12, unindent@0.2.3
 
 Package: python3-cryptography
 Architecture: any
diff -pruN 43.0.0-1/debian/patches/downgrade-deps.patch 43.0.0-1ubuntu1/debian/patches/downgrade-deps.patch
--- 43.0.0-1/debian/patches/downgrade-deps.patch	2024-09-10 18:55:34.000000000 +0000
+++ 43.0.0-1ubuntu1/debian/patches/downgrade-deps.patch	1970-01-01 00:00:00.000000000 +0000
@@ -1,93 +0,0 @@
-Description: Downgrade some requirement versions to sid ones.
-Author: Andrey Rakhmatullin <wrar@debian.org>
-Last-Update: 2024-09-10
-
-Index: python-cryptography/src/rust/Cargo.toml
-===================================================================
---- python-cryptography.orig/src/rust/Cargo.toml
-+++ python-cryptography/src/rust/Cargo.toml
-@@ -18,7 +18,7 @@ rust-version.workspace = true
- once_cell = "1"
- cfg-if = "1"
- pyo3 = { version = "0.22.2", features = ["abi3"] }
--asn1 = { version = "0.16.2", default-features = false }
-+asn1 = { version = "0.17.0", default-features = false }
- cryptography-cffi = { path = "cryptography-cffi" }
- cryptography-keepalive = { path = "cryptography-keepalive" }
- cryptography-key-parsing = { path = "cryptography-key-parsing" }
-@@ -26,8 +26,8 @@ cryptography-x509 = { path = "cryptograp
- cryptography-x509-verification = { path = "cryptography-x509-verification" }
- cryptography-openssl = { path = "cryptography-openssl" }
- pem = { version = "3", default-features = false }
--openssl = "0.10.65"
--openssl-sys = "0.9.103"
-+openssl = "0.10.64"
-+openssl-sys = "0.9.101"
- foreign-types-shared = "0.1"
- self_cell = "1"
- 
-Index: python-cryptography/src/rust/cryptography-cffi/Cargo.toml
-===================================================================
---- python-cryptography.orig/src/rust/cryptography-cffi/Cargo.toml
-+++ python-cryptography/src/rust/cryptography-cffi/Cargo.toml
-@@ -8,7 +8,7 @@ rust-version.workspace = true
- 
- [dependencies]
- pyo3 = { version = "0.22.2", features = ["abi3"] }
--openssl-sys = "0.9.103"
-+openssl-sys = "0.9.101"
- 
- [build-dependencies]
- cc = "1.1.6"
-Index: python-cryptography/src/rust/cryptography-key-parsing/Cargo.toml
-===================================================================
---- python-cryptography.orig/src/rust/cryptography-key-parsing/Cargo.toml
-+++ python-cryptography/src/rust/cryptography-key-parsing/Cargo.toml
-@@ -7,8 +7,8 @@ publish.workspace = true
- rust-version.workspace = true
- 
- [dependencies]
--asn1 = { version = "0.16.2", default-features = false }
-+asn1 = { version = "0.17.0", default-features = false }
- cfg-if = "1"
--openssl = "0.10.65"
--openssl-sys = "0.9.103"
-+openssl = "0.10.64"
-+openssl-sys = "0.9.101"
- cryptography-x509 = { path = "../cryptography-x509" }
-Index: python-cryptography/src/rust/cryptography-openssl/Cargo.toml
-===================================================================
---- python-cryptography.orig/src/rust/cryptography-openssl/Cargo.toml
-+++ python-cryptography/src/rust/cryptography-openssl/Cargo.toml
-@@ -8,7 +8,7 @@ rust-version.workspace = true
- 
- [dependencies]
- cfg-if = "1"
--openssl = "0.10.65"
-+openssl = "0.10.64"
- ffi = { package = "openssl-sys", version = "0.9.101" }
- foreign-types = "0.3"
- foreign-types-shared = "0.1"
-Index: python-cryptography/src/rust/cryptography-x509-verification/Cargo.toml
-===================================================================
---- python-cryptography.orig/src/rust/cryptography-x509-verification/Cargo.toml
-+++ python-cryptography/src/rust/cryptography-x509-verification/Cargo.toml
-@@ -7,7 +7,7 @@ publish.workspace = true
- rust-version.workspace = true
- 
- [dependencies]
--asn1 = { version = "0.16.2", default-features = false }
-+asn1 = { version = "0.17.0", default-features = false }
- cryptography-x509 = { path = "../cryptography-x509" }
- cryptography-key-parsing = { path = "../cryptography-key-parsing" }
- once_cell = "1"
-Index: python-cryptography/src/rust/cryptography-x509/Cargo.toml
-===================================================================
---- python-cryptography.orig/src/rust/cryptography-x509/Cargo.toml
-+++ python-cryptography/src/rust/cryptography-x509/Cargo.toml
-@@ -8,4 +8,4 @@ publish = false
- rust-version = "1.65.0"
- 
- [dependencies]
--asn1 = { version = "0.16.2", default-features = false }
-+asn1 = { version = "0.17.0", default-features = false }
diff -pruN 43.0.0-1/debian/patches/remove-vcpkg-from-lockfile 43.0.0-1ubuntu1/debian/patches/remove-vcpkg-from-lockfile
--- 43.0.0-1/debian/patches/remove-vcpkg-from-lockfile	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/debian/patches/remove-vcpkg-from-lockfile	2025-03-27 14:43:53.000000000 +0000
@@ -0,0 +1,27 @@
+Subject: Remove vcpkg from src/rust/Cargo.lock
+Author: Adrien Nader <adrien.nader@canonical.com>
+Forwarded: not-needed
+Last-Update: 2025-03-27
+
+diff --git a/src/rust/Cargo.lock b/src/rust/Cargo.lock
+index fe3398f..b1d0fc9 100644
+--- a/src/rust/Cargo.lock
++++ b/src/rust/Cargo.lock
+@@ -212,7 +212,6 @@ dependencies = [
+  "cc",
+  "libc",
+  "pkg-config",
+- "vcpkg",
+ ]
+ 
+ [[package]]
+@@ -351,9 +350,3 @@ name = "unindent"
+ version = "0.2.3"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+ checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce"
+-
+-[[package]]
+-name = "vcpkg"
+-version = "0.2.15"
+-source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
diff -pruN 43.0.0-1/debian/patches/series 43.0.0-1ubuntu1/debian/patches/series
--- 43.0.0-1/debian/patches/series	2024-09-10 18:55:34.000000000 +0000
+++ 43.0.0-1ubuntu1/debian/patches/series	2025-03-27 14:43:28.000000000 +0000
@@ -1,3 +1,3 @@
 Use-local-python3-doc-inventory.patch
 drop-cffi-dep.patch
-downgrade-deps.patch
+remove-vcpkg-from-lockfile
diff -pruN 43.0.0-1/debian/rules 43.0.0-1ubuntu1/debian/rules
--- 43.0.0-1/debian/rules	2024-09-10 18:55:34.000000000 +0000
+++ 43.0.0-1ubuntu1/debian/rules	2025-03-27 14:43:53.000000000 +0000
@@ -11,6 +11,7 @@ export DEB_HOST_RUST_TYPE DEB_HOST_GNU_T
 
 export CARGO=/usr/share/cargo/bin/cargo
 export CARGO_HOME=$(shell pwd)/debian/cargo_home
+export CARGO_VENDOR_DIR = rust-vendor
 export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)
 
 export DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow
@@ -20,6 +21,9 @@ export PYBUILD_TEST_PYTEST=1
 # needs newer librust-openssl-dev (#1081226)
 export PYBUILD_TEST_ARGS={dir}/tests/ -k 'not (TestDHPublicKeySerialization and test_public_bytes_match)'
 
+VENDOR_TARBALL = ../$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM).orig-$(CARGO_VENDOR_DIR).tar.xz
+VENDOR_OPENSSL_SYS := $(CARGO_VENDOR_DIR)/openssl-sys
+
 %:
 	dh $@ --buildsystem=pybuild
 
@@ -30,6 +34,20 @@ override_dh_auto_clean:
 	rm -rf src/rust/target
 	rm -rf debian/cargo_registry
 
+# You may have to `dpkg-source --include-binaries -b .` to update
+# `d/source/include-binaries` after updating vendored deps
+vendor-tarball $(VENDOR_TARBALL):
+	cargo vendor --manifest-path src/rust/Cargo.toml "$(CARGO_VENDOR_DIR)"
+	# Remove everything vcpkg because it ships arm64 iOS .a files which trip
+	# further steps and serve no purpose
+	rm -r "$(CARGO_VENDOR_DIR)/vcpkg"
+	jq -r '{ "files": {}, "package": .package }' < "$(VENDOR_OPENSSL_SYS)/.cargo-checksum.json" > "$(VENDOR_OPENSSL_SYS)/.cargo-checksum.json.tmp"
+	mv "$(VENDOR_OPENSSL_SYS)/.cargo-checksum.json.tmp" "$(VENDOR_OPENSSL_SYS)/.cargo-checksum.json"
+	sed -E -i -e '/^\[build-dependencies\.vcpkg\]$$/,+2 d' "$(VENDOR_OPENSSL_SYS)/Cargo.toml"
+	sed -E -i -e '/ +try_vcpkg\(\);/ d' -e '/^fn try_vcpkg\(\) \{$$/,/^\}$$/ d' "$(VENDOR_OPENSSL_SYS)/build/find_normal.rs"
+	sed -E -i -e '/^extern crate vcpkg;$$/ d' "$(VENDOR_OPENSSL_SYS)/build/main.rs"
+	tar --sort=name --mtime=@0 --owner=0 --group=0 --numeric-owner --pax-option='exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime' -caf "$(VENDOR_TARBALL)" "$(CARGO_VENDOR_DIR)"
+	rm -rf "$(CARGO_HOME)"
 
 override_dh_sphinxdoc:
 ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
@@ -40,13 +58,11 @@ endif
 
 
 override_dh_auto_configure:
-	$(CARGO) prepare-debian debian/cargo_registry --link-from-system
-	mkdir -p src/rust/target/release
-	ln -sf ../$(DEB_HOST_RUST_TYPE)/release/libcryptography_rust.so src/rust/target/release/libcryptography_rust.so
-	mv src/rust/Cargo.lock src/rust/Cargo.lock.orig
-	# needed because we patch Cargo.toml
-	cargo generate-lockfile --manifest-path src/rust/Cargo.toml --offline
 	dh_auto_configure
+	# This runs cargo prepare-debian and dh-cargo-vendored-sources when
+	# CARGO_HOME is set, and other prepare-debian debian/cargo_registry
+	# --link-from-system otherwise
+	dh_auto_configure --buildsystem=cargo
 
 
 override_dh_dwz:
@@ -56,3 +72,5 @@ override_dh_dwz:
 override_dh_python3:
 	# We patch it out of .dist-info to avoid pkg_resources complaining (#1026537)
 	dh_python3 --depends=cffi
+
+.PHONY: $(VENDOR_TARBALL)
diff -pruN 43.0.0-1/debian/source/include-binaries 43.0.0-1ubuntu1/debian/source/include-binaries
--- 43.0.0-1/debian/source/include-binaries	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/debian/source/include-binaries	2025-03-27 14:42:29.000000000 +0000
@@ -0,0 +1,11 @@
+debian/rust-vendor/openssl/test/cms.p12
+debian/rust-vendor/openssl/test/cms_pubkey.der
+debian/rust-vendor/openssl/test/identity.p12
+debian/rust-vendor/openssl/test/key.der
+debian/rust-vendor/openssl/test/key.der.pub
+debian/rust-vendor/openssl/test/keystore-empty-chain.p12
+debian/rust-vendor/openssl/test/pkcs8-nocrypt.der
+debian/rust-vendor/openssl/test/pkcs8.der
+debian/rust-vendor/openssl/test/test.crl
+debian/rust-vendor/unicode-ident/tests/fst/xid_continue.fst
+debian/rust-vendor/unicode-ident/tests/fst/xid_start.fst
diff -pruN 43.0.0-1/rust-vendor/asn1/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/asn1/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/asn1/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"Cargo.lock":"00e746ccdc53dd30cd3bd48c1e2f6ed81db265d4bf917958053f0970ff4c348b","Cargo.toml":"9bf686c4a472d8993b41d0ca948bf3ca6d82a9b131244f54d5c61a8ea5146a87","LICENSE":"c6deb2d156619439e147f8b62e1b3928598c8e3652ec8b56cc039490696b3985","README.md":"448f0e32aad34f2e3639af87b1865b50d70170ebf02f2a7a3e576577c399057b","examples/no_std.rs":"fdf03a356e226d2c102bf617f9e7be9329822c8381ae8701e0889302f3817c15","src/base128.rs":"54dea776512f32aa3ac8316d4d5abad87e60efacc27e7752ca28c613b1c9e4d5","src/bit_string.rs":"f3b4ae5d09a73ff31d48ebeff1e6d6747aeeb8e4287b963f67aa8e63d558c8b1","src/lib.rs":"0e1a01e8676cfb4604df1c4304f7fe978e5715049b6eb59e3977a0433a55e3c9","src/object_identifier.rs":"7b49a8f110c4d90409132ee31f3a936be82b9386c8c726ddeb536f3ffce596d8","src/parser.rs":"a6333b8d9c09b2420812b6439426c532949b269493e89702f72acc49b425d180","src/tag.rs":"41b6247a77e1287968ead99222d07b20d8191f4a5277065c6eebcd1f058b126b","src/types.rs":"bea07af84b6040b613bfa867faab4cd374eaf7f2652200abeee0dcc78f149a0f","src/writer.rs":"f1f5f53c4a37270303da2a5d43006d174dbdd2f80cbb8a9823892fb92c347759","tests/derive_test.rs":"31fc881436665a8c5d2538839abf9df44bbe1b4a21fbd434a1165e7537ba54d7","tests/oid_tests.rs":"127ccd4cf03d88f6cff605d157dec2e22589875dd084f5b21e54399df5652aaf","tests/roundtrip_tests.rs":"fb0a4b92ebb9d9f504b8f2f215a2a4d5c83aa38e523b4b210bcdcd368471cd72"},"package":"532ceda058281b62096b2add4ab00ab3a453d30dee28b8890f62461a0109ebbd"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/asn1/Cargo.lock 43.0.0-1ubuntu1/rust-vendor/asn1/Cargo.lock
--- 43.0.0-1/rust-vendor/asn1/Cargo.lock	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1/Cargo.lock	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,63 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "asn1"
+version = "0.16.2"
+dependencies = [
+ "asn1_derive",
+ "libc",
+]
+
+[[package]]
+name = "asn1_derive"
+version = "0.16.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "56e6076d38cc17cc22b0f65f31170a2ee1975e6b07f0012893aefd86ce19c987"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.150"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.69"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.33"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "syn"
+version = "2.0.39"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
diff -pruN 43.0.0-1/rust-vendor/asn1/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/asn1/Cargo.toml
--- 43.0.0-1/rust-vendor/asn1/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,32 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2021"
+rust-version = "1.57.0"
+name = "asn1"
+version = "0.16.2"
+authors = ["Alex Gaynor <alex.gaynor@gmail.com>"]
+description = "ASN.1 (DER) parser and writer for Rust."
+readme = "README.md"
+keywords = ["asn1"]
+license = "BSD-3-Clause"
+repository = "https://github.com/alex/rust-asn1"
+
+[dependencies.asn1_derive]
+version = "0.16.2"
+
+[dev-dependencies.libc]
+version = "0.2.11"
+
+[features]
+default = ["std"]
+std = []
diff -pruN 43.0.0-1/rust-vendor/asn1/LICENSE 43.0.0-1ubuntu1/rust-vendor/asn1/LICENSE
--- 43.0.0-1/rust-vendor/asn1/LICENSE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1/LICENSE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,27 @@
+Copyright (c) Alex Gaynor and individual contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    1. Redistributions of source code must retain the above copyright notice,
+       this list of conditions and the following disclaimer.
+
+    2. Redistributions in binary form must reproduce the above copyright
+       notice, this list of conditions and the following disclaimer in the
+       documentation and/or other materials provided with the distribution.
+
+    3. Neither the name of rust-asn1 nor the names of its contributors may be used
+       to endorse or promote products derived from this software without
+       specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff -pruN 43.0.0-1/rust-vendor/asn1/README.md 43.0.0-1ubuntu1/rust-vendor/asn1/README.md
--- 43.0.0-1/rust-vendor/asn1/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,28 @@
+# rust-asn1
+
+[![Dependency Status][deps-rs-image]][deps-rs-link]
+[![Documentation][docs-rs-image]][docs-rs-link]
+
+This is a Rust library for parsing and generating ASN.1 data (DER only).
+
+## Installation
+
+Add `asn1` to the `[dependencies]` section of your `Cargo.toml`:
+
+```toml
+[dependencies]
+asn1 = "0.16"
+```
+
+Builds on Rust 1.56.0 and newer.
+
+`rust-asn1` is compatible with `#![no_std]` environments:
+
+```toml
+asn1 = { version = "0.16", default-features = false }
+```
+
+[deps-rs-image]: https://deps.rs/repo/github/alex/rust-asn1/status.svg
+[deps-rs-link]: https://deps.rs/repo/github/alex/rust-asn1
+[docs-rs-image]: https://docs.rs/asn1/badge.svg
+[docs-rs-link]: https://docs.rs/asn1/
diff -pruN 43.0.0-1/rust-vendor/asn1/examples/no_std.rs 43.0.0-1ubuntu1/rust-vendor/asn1/examples/no_std.rs
--- 43.0.0-1/rust-vendor/asn1/examples/no_std.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1/examples/no_std.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,34 @@
+#![no_std]
+
+fn main() {
+    let data = b"\x30\x06\x02\x01\x01\x02\x01\x03";
+
+    let result: asn1::ParseResult<_> = asn1::parse(data, |d| {
+        d.read_element::<asn1::Sequence>()?
+            .parse(|d| Ok((d.read_element::<i64>()?, d.read_element::<i64>()?)))
+    });
+
+    // Using libc::printf because println! isn't no_std!
+    match result {
+        Ok((r, s)) => unsafe {
+            libc::printf(b"r=%ld, s=%ld\n\x00".as_ptr() as *const libc::c_char, r, s)
+        },
+        Err(_) => unsafe { libc::printf("Error\n\x00".as_ptr() as *const libc::c_char) },
+    };
+
+    let computed = asn1::write(|w| {
+        w.write_element(&asn1::SequenceWriter::new(&|w: &mut asn1::Writer| {
+            w.write_element(&1i64)?;
+            w.write_element(&3i64)?;
+            Ok(())
+        }))
+    })
+    .unwrap();
+    unsafe {
+        libc::printf(
+            "Original length: %ld\nComputed length: %ld\n\x00".as_ptr() as *const libc::c_char,
+            data.len() as i64,
+            computed.len() as i64,
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/asn1/src/base128.rs 43.0.0-1ubuntu1/rust-vendor/asn1/src/base128.rs
--- 43.0.0-1/rust-vendor/asn1/src/base128.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1/src/base128.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,81 @@
+use crate::parser::{ParseError, ParseErrorKind, ParseResult};
+
+pub(crate) fn read_base128_int(mut data: &[u8]) -> ParseResult<(u32, &[u8])> {
+    let mut ret = 0u32;
+    for i in 0..5 {
+        let b = match data.first() {
+            Some(b) => *b,
+            None => return Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+        };
+        data = &data[1..];
+        if ret > u32::MAX >> 7 {
+            return Err(ParseError::new(ParseErrorKind::InvalidValue));
+        }
+        ret <<= 7;
+        ret |= u32::from(b & 0x7f);
+        // Integers must be minimally encoded. `i == 0 && 0x80` would mean
+        // that the first byte had a value of 0, which is non-minimal.
+        if i == 0 && b == 0x80 {
+            return Err(ParseError::new(ParseErrorKind::InvalidValue));
+        }
+        if b & 0x80 == 0 {
+            return Ok((ret, data));
+        }
+    }
+    Err(ParseError::new(ParseErrorKind::InvalidValue))
+}
+
+pub(crate) fn base128_length(n: u32) -> usize {
+    // Equivalent to: let bits = if n != 0 { 32 - n.leading_zeros() } else { 1 };
+    let bits = u32::BITS - (n | 1).leading_zeros();
+    let bytes = (bits + 6) / 7;
+    bytes as usize
+}
+
+pub(crate) fn write_base128_int(mut data: &mut [u8], n: u32) -> Option<usize> {
+    let length = base128_length(n);
+
+    if data.len() < length {
+        return None;
+    }
+
+    if n == 0 {
+        data[0] = 0;
+        return Some(1);
+    }
+
+    for i in (0..length).rev() {
+        let mut o = (n >> (i * 7)) as u8;
+        o &= 0x7f;
+        if i != 0 {
+            o |= 0x80;
+        }
+        data[0] = o;
+        data = &mut data[1..];
+    }
+
+    Some(length)
+}
+
+#[cfg(test)]
+mod tests {
+    use super::{read_base128_int, write_base128_int};
+
+    #[test]
+    fn test_read_overflow() {
+        let buf = [0x90, 0x80, 0x80, 0x80, 0x0];
+        let result = read_base128_int(&buf);
+        assert!(result.is_err());
+    }
+
+    #[test]
+    fn test_roundtrip() {
+        for i in [0, 10, u32::MAX] {
+            let mut buf = [0; 16];
+            let length = write_base128_int(&mut buf, i).unwrap();
+            let (val, remainder) = read_base128_int(&buf[..length]).unwrap();
+            assert_eq!(i, val);
+            assert!(remainder.is_empty());
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/asn1/src/bit_string.rs 43.0.0-1ubuntu1/rust-vendor/asn1/src/bit_string.rs
--- 43.0.0-1/rust-vendor/asn1/src/bit_string.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1/src/bit_string.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,124 @@
+#[cfg(not(feature = "std"))]
+use alloc::vec::Vec;
+
+/// Represents an ASN.1 `BIT STRING` whose contents is borrowed.
+#[derive(Debug, PartialEq, Clone, Hash, Eq)]
+pub struct BitString<'a> {
+    data: &'a [u8],
+    padding_bits: u8,
+}
+
+impl<'a> BitString<'a> {
+    pub fn new(data: &'a [u8], padding_bits: u8) -> Option<BitString<'a>> {
+        if padding_bits > 7 || (data.is_empty() && padding_bits != 0) {
+            return None;
+        }
+        if padding_bits > 0 && data[data.len() - 1] & ((1 << padding_bits) - 1) != 0 {
+            return None;
+        }
+
+        Some(BitString { data, padding_bits })
+    }
+
+    /// Returns a sequence of bytes representing the data in the `BIT STRING`. Padding bits will
+    /// always be 0.
+    pub fn as_bytes(&self) -> &'a [u8] {
+        self.data
+    }
+
+    /// Returns the number of padding bits. Will always be in [0, 8).
+    pub fn padding_bits(&self) -> u8 {
+        self.padding_bits
+    }
+
+    /// Returns whether the requested bit is set. Padding bits will always return false and
+    /// asking for bits that exceed the length of the bit string will also return false.
+    pub fn has_bit_set(&self, n: usize) -> bool {
+        let idx = n / 8;
+        let v = 1 << (7 - (n & 0x07));
+        if self.data.len() < (idx + 1) {
+            false
+        } else {
+            self.data[idx] & v != 0
+        }
+    }
+}
+
+/// Represents an ASN.1 `BIT STRING` whose contents owned. When used to parse
+/// data this will allocate.
+#[derive(Debug, PartialEq, Clone, Hash, Eq)]
+pub struct OwnedBitString {
+    data: Vec<u8>,
+    padding_bits: u8,
+}
+
+impl OwnedBitString {
+    pub fn new(data: Vec<u8>, padding_bits: u8) -> Option<OwnedBitString> {
+        BitString::new(&data, padding_bits)?;
+        Some(OwnedBitString { data, padding_bits })
+    }
+
+    pub fn as_bitstring(&self) -> BitString<'_> {
+        BitString::new(&self.data, self.padding_bits).unwrap()
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::{BitString, OwnedBitString};
+    use alloc::vec;
+
+    #[test]
+    fn test_bitstring_new() {
+        assert_eq!(BitString::new(b"abc", 8), None);
+        assert_eq!(BitString::new(b"", 2), None);
+        assert_eq!(BitString::new(b"\xff", 1), None);
+
+        assert!(BitString::new(b"\xff", 0).is_some());
+        assert!(BitString::new(b"\xfe", 1).is_some());
+    }
+
+    #[test]
+    fn test_owned_bitstring_new() {
+        assert_eq!(OwnedBitString::new(vec![b'a', b'b', b'c'], 8), None);
+        assert_eq!(OwnedBitString::new(vec![], 2), None);
+        assert_eq!(OwnedBitString::new(vec![0xff], 1), None);
+
+        assert!(OwnedBitString::new(vec![0xff], 0).is_some());
+        assert!(OwnedBitString::new(vec![0xfe], 1).is_some());
+    }
+
+    #[test]
+    fn test_bitstring_as_bytes() {
+        let bs = BitString::new(b"\xfe", 1).unwrap();
+        assert_eq!(bs.as_bytes(), b"\xfe");
+    }
+
+    #[test]
+    fn test_bitstring_padding_bits() {
+        let bs = BitString::new(b"\xfe", 1).unwrap();
+        assert_eq!(bs.padding_bits(), 1);
+        let bs = BitString::new(b"\xe0", 5).unwrap();
+        assert_eq!(bs.padding_bits(), 5);
+    }
+
+    #[test]
+    fn test_bitstring_has_bit_set() {
+        let bs = BitString::new(b"\x80", 0).unwrap();
+        assert!(bs.has_bit_set(0));
+        assert!(!bs.has_bit_set(1));
+        assert!(!bs.has_bit_set(7));
+        // An arbitrary bit much bigger than the underlying size of the bitfield
+        assert!(!bs.has_bit_set(50));
+        let bs = BitString::new(b"\xc0", 4).unwrap();
+        // padding bits should always return false when asking if the bit is set
+        assert!(bs.has_bit_set(0));
+        assert!(bs.has_bit_set(1));
+        assert!(!bs.has_bit_set(2));
+        assert!(!bs.has_bit_set(3));
+        assert!(!bs.has_bit_set(4));
+        assert!(!bs.has_bit_set(5));
+        assert!(!bs.has_bit_set(6));
+        assert!(!bs.has_bit_set(7));
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/asn1/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/asn1/src/lib.rs
--- 43.0.0-1/rust-vendor/asn1/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,233 @@
+#![cfg_attr(not(feature = "std"), no_std)]
+#![forbid(unsafe_code)]
+#![deny(rust_2018_idioms)]
+
+//! This crate provides you with the ability to generate and parse ASN.1
+//! encoded data. More precisely, it provides you with the ability to generate
+//! and parse data encoded with ASN.1's DER (Distinguished Encoding Rules)
+//! encoding. It does not support BER (Basic Encoding Rules), CER (Canonical
+//! Encoding Rules), XER (XML Encoding Rules), CXER (Canonical XML Encoding
+//! Rules), or any other alphabet soup encodings -- and it never will.
+//!
+//! If you wanted to parse an ASN.1 structure like this:
+//! ```text
+//! Signature ::= SEQUENCE {
+//!     r INTEGER,
+//!     s INTEGER
+//! }
+//! ```
+//!
+//! Then you'd write the following code:
+//! ```
+//! # let data = b"";
+//! let result: asn1::ParseResult<_> = asn1::parse(data, |d| {
+//!     return d.read_element::<asn1::Sequence>()?.parse(|d| {
+//!         let r = d.read_element::<u64>()?;
+//!         let s = d.read_element::<u64>()?;
+//!         return Ok((r, s));
+//!     })
+//! });
+//! ```
+//!
+//! In general everything about parsing is driven by providing different type
+//! parameters to `Parser.read_element`. Some types implement the
+//! `Asn1Readable` trait directly on a basic type, as seen with `u64` or
+//! `&[u8]` (`OCTET STRING`), while others use wrapper types which simply
+//! provide ASN.1 encoding and decoding for some other type (`PrintableString`
+//! or `UtcTime`). There are also types such as `Implicit` and `Explicit` for
+//! handling tagged values, `Choice1`, `Choice2`, and `Choice3` available for
+//! choices, and `Option<T>` for handling `OPTIONAL` values.
+//!
+//! To serialize DER for the `Sequence` structure, you'd write the following:
+//! ```
+//! # let r = 0u64;
+//! # let s = 0u64;
+//! let result = asn1::write(|w| {
+//!     w.write_element(&asn1::SequenceWriter::new(&|w| {
+//!         w.write_element(&r)?;
+//!         w.write_element(&s)?;
+//!         Ok(())
+//!     }))
+//! });
+//! ```
+//!
+//! # Derive
+//!
+//! When built with the `derive` feature (enabled by default), these can also
+//! be expressed as Rust structs:
+//! ```
+//! #[derive(asn1::Asn1Read, asn1::Asn1Write)]
+//! struct Signature {
+//!     r: u64,
+//!     s: u64,
+//! }
+//!
+//! # let data = b"";
+//! # let r = 0u64;
+//! # let s = 0u64;
+//! let sig = asn1::parse_single::<Signature>(data);
+//! let result = asn1::write_single(&Signature{r, s});
+//! ```
+//!
+//! Fields may be marked as `EXPLICIT` or `IMPLICIT` either by struct members
+//! having the types [`Explicit`] and [`Implicit`] or via the use of
+//! `#[explicit]` and `#[implicit]` annotations:
+//! ```
+//! #[derive(asn1::Asn1Read, asn1::Asn1Write)]
+//! struct SomeSequence<'a> {
+//!     #[implicit(0)]
+//!     a: Option<&'a [u8]>,
+//!     #[explicit(1)]
+//!     b: Option<u64>,
+//! }
+//! ```
+//!
+//! Fields can also be annotated with `#[default(VALUE)]` to indicate ASN.1
+//! `OPTIONAL DEFAULT` values. In this case, the field's type should be `T`,
+//! and not `Option<T>`.
+//!
+//! These derives may also be used with `enum`s to generate `CHOICE`
+//! implementations.
+//! ```
+//! #[derive(asn1::Asn1Read, asn1::Asn1Write)]
+//! enum Time {
+//!     UTCTime(asn1::UtcTime),
+//!     GeneralizedTime(asn1::GeneralizedTime)
+//! }
+//! ```
+//!
+//! All variants must have a single un-named field.
+//!
+//! ## DEFINED BY
+//!
+//! rust-asn1 also provides utilities for more easily handling the case of
+//! `ANY DEFINED BY` in an ASN.1 structure. For example, given the following
+//! ASN.1;
+//!
+//! ```text
+//! MySequence ::= SEQUENCE {
+//!     contentType OBJECT IDENTIFIER,
+//!     content ANY DEFINED BY contentType
+//! }
+//!```
+//!
+//! This can be represented by:
+//!
+//! ```
+//! # const SOME_OID_CONSTANT: asn1::ObjectIdentifier = asn1::oid!(1, 2, 3);
+//! #[derive(asn1::Asn1Read, asn1::Asn1Write)]
+//! struct MySequence {
+//!     content_type: asn1::DefinedByMarker<asn1::ObjectIdentifier>,
+//!     #[defined_by(content_type)]
+//!     content: Content,
+//! }
+//!
+//! #[derive(asn1::Asn1DefinedByRead, asn1::Asn1DefinedByWrite)]
+//! enum Content {
+//!     #[defined_by(SOME_OID_CONSTANT)]
+//!     SomeVariant(i32),
+//! }
+//! ```
+//!
+//! # Design philosophy
+//!
+//! As we have designed the `asn1` crate, we value the following things, in
+//! this order:
+//!
+//! - **Security**
+//! - **Correctness**
+//! - **Performance**
+//! - **Ergonomics**
+
+extern crate alloc;
+
+mod base128;
+mod bit_string;
+mod object_identifier;
+mod parser;
+mod tag;
+mod types;
+mod writer;
+
+pub use crate::bit_string::{BitString, OwnedBitString};
+pub use crate::object_identifier::ObjectIdentifier;
+pub use crate::parser::{
+    parse, parse_single, strip_tlv, ParseError, ParseErrorKind, ParseLocation, ParseResult, Parser,
+};
+pub use crate::tag::Tag;
+pub use crate::types::{
+    Asn1DefinedByReadable, Asn1DefinedByWritable, Asn1Readable, Asn1Writable, BMPString, BigInt,
+    BigUint, Choice1, Choice2, Choice3, DateTime, DefinedByMarker, Enumerated, Explicit,
+    GeneralizedTime, IA5String, Implicit, Null, OctetStringEncoded, OwnedBigInt, OwnedBigUint,
+    PrintableString, Sequence, SequenceOf, SequenceOfWriter, SequenceWriter, SetOf, SetOfWriter,
+    SimpleAsn1Readable, SimpleAsn1Writable, Tlv, UniversalString, UtcTime, Utf8String,
+    VisibleString,
+};
+pub use crate::writer::{write, write_single, WriteBuf, WriteError, WriteResult, Writer};
+
+pub use asn1_derive::{oid, Asn1DefinedByRead, Asn1DefinedByWrite, Asn1Read, Asn1Write};
+
+/// Decodes an `OPTIONAL` ASN.1 value which has a `DEFAULT`. Generaly called
+/// immediately after [`Parser::read_element`].
+pub fn from_optional_default<T: PartialEq>(v: Option<T>, default: T) -> ParseResult<T> {
+    match v {
+        Some(v) if v == default => Err(ParseError::new(ParseErrorKind::EncodedDefault)),
+        Some(v) => Ok(v),
+        None => Ok(default),
+    }
+}
+
+/// Prepares an `OPTIONAL` ASN.1 value which has a `DEFAULT` for writing.
+/// Generally called immediately before [`Writer::write_element`].
+pub fn to_optional_default<'a, T: PartialEq>(v: &'a T, default: &'a T) -> Option<&'a T> {
+    if v == default {
+        None
+    } else {
+        Some(v)
+    }
+}
+
+/// This API is public so that it may be used from macros, but should not be
+/// considered a part of the supported API surface.
+#[doc(hidden)]
+pub const fn implicit_tag(tag: u32, inner_tag: Tag) -> Tag {
+    Tag::new(
+        tag,
+        tag::TagClass::ContextSpecific,
+        inner_tag.is_constructed(),
+    )
+}
+
+/// This API is public so that it may be used from macros, but should not be
+/// considered a part of the supported API surface.
+#[doc(hidden)]
+pub const fn explicit_tag(tag: u32) -> Tag {
+    Tag::new(tag, tag::TagClass::ContextSpecific, true)
+}
+
+/// This API is public so that it may be used from macros, but should not be
+/// considered a part of the supported API surface.
+#[doc(hidden)]
+pub fn read_defined_by<'a, T: Asn1Readable<'a>, U: Asn1DefinedByReadable<'a, T>>(
+    v: T,
+    p: &mut Parser<'a>,
+) -> ParseResult<U> {
+    U::parse(v, p)
+}
+
+/// This API is public so that it may be used from macros, but should not be
+/// considered a part of the supported API surface.
+#[doc(hidden)]
+pub fn write_defined_by<T: Asn1Writable, U: Asn1DefinedByWritable<T>>(
+    v: &U,
+    w: &mut Writer<'_>,
+) -> WriteResult {
+    v.write(w)
+}
+
+/// This API is public so that it may be used from macros, but should not be
+/// considered a part of the supported API surface.
+#[doc(hidden)]
+pub fn writable_defined_by_item<T: Asn1Writable, U: Asn1DefinedByWritable<T>>(v: &U) -> &T {
+    v.item()
+}
diff -pruN 43.0.0-1/rust-vendor/asn1/src/object_identifier.rs 43.0.0-1ubuntu1/rust-vendor/asn1/src/object_identifier.rs
--- 43.0.0-1/rust-vendor/asn1/src/object_identifier.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1/src/object_identifier.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,212 @@
+use crate::base128;
+use crate::parser::{ParseError, ParseErrorKind, ParseResult};
+use alloc::fmt;
+
+const MAX_OID_LENGTH: usize = 63;
+
+/// Represents an ASN.1 `OBJECT IDENTIFIER`. `ObjectIdentifier`s are opaque,
+/// the only thing may be done with them is test if they are equal to another
+/// `ObjectIdentifier`. The generally recommended practice for handling them
+/// is to create some `ObjectIdentifier` constants with `asn1::oid!()` and
+/// then compare them with `ObjectIdentifier`s you get from parsing.
+///
+/// `asn1::oid!()` takes a series of arcs, for example: `asn1::oid!(1, 2, 3)`.
+///
+/// rust-asn1 stores `ObjectIdentifier`s in a fixed-size buffer, therefore
+/// they are limited to OID values whose DER encoding fits into that buffer.
+/// This buffer is sufficiently large to fit all known publically known OIDs,
+/// so this should not affect most people.
+#[derive(PartialEq, Eq, Clone, Hash)]
+pub struct ObjectIdentifier {
+    // Store the OID as DER encoded.
+    der_encoded: [u8; MAX_OID_LENGTH],
+    der_encoded_len: u8,
+}
+
+impl ObjectIdentifier {
+    /// Parses an OID from a dotted string, e.g. `"1.2.840.113549"`.
+    pub fn from_string(oid: &str) -> Option<ObjectIdentifier> {
+        let mut parts = oid.split('.');
+
+        let first = parts.next()?.parse::<u32>().ok()?;
+        let second = parts.next()?.parse::<u32>().ok()?;
+        if first > 2 || (first < 2 && second >= 40) {
+            return None;
+        }
+
+        let mut der_data = [0; MAX_OID_LENGTH];
+        let mut der_data_len = 0;
+        der_data_len +=
+            base128::write_base128_int(&mut der_data[der_data_len..], 40 * first + second)?;
+        for part in parts {
+            der_data_len += base128::write_base128_int(
+                &mut der_data[der_data_len..],
+                part.parse::<u32>().ok()?,
+            )?;
+        }
+        Some(ObjectIdentifier {
+            der_encoded: der_data,
+            der_encoded_len: der_data_len as u8,
+        })
+    }
+
+    /// Creates an `ObjectIdentifier` from its DER representation. This does
+    /// not perform any allocations or copies.
+    pub fn from_der(data: &[u8]) -> ParseResult<ObjectIdentifier> {
+        if data.is_empty() {
+            return Err(ParseError::new(ParseErrorKind::InvalidValue));
+        } else if data.len() > MAX_OID_LENGTH {
+            return Err(ParseError::new(ParseErrorKind::OidTooLong));
+        }
+
+        let mut parsed = (0, data);
+        while !parsed.1.is_empty() {
+            // `base128::read_base128_int` can return a `ShortData` error, but
+            // in context here that means `InvalidValue`.
+            parsed = base128::read_base128_int(parsed.1)
+                .map_err(|_| ParseError::new(ParseErrorKind::InvalidValue))?;
+        }
+
+        let mut storage = [0; MAX_OID_LENGTH];
+        storage[..data.len()].copy_from_slice(data);
+
+        Ok(ObjectIdentifier {
+            der_encoded: storage,
+            der_encoded_len: data.len() as u8,
+        })
+    }
+
+    /// Creates an `ObjectIdentifier` from its DER representation. Does not
+    /// check that the DER is valid. Intended only for use from the `oid!()`
+    /// macro. Do not use yourself!
+    #[doc(hidden)]
+    pub const fn from_der_unchecked(data: [u8; MAX_OID_LENGTH], data_len: u8) -> ObjectIdentifier {
+        ObjectIdentifier {
+            der_encoded: data,
+            der_encoded_len: data_len,
+        }
+    }
+
+    pub(crate) fn as_der(&self) -> &[u8] {
+        &self.der_encoded[..self.der_encoded_len as usize]
+    }
+}
+
+struct OidFormatter<'a>(&'a ObjectIdentifier);
+
+impl fmt::Debug for OidFormatter<'_> {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        let mut parsed = (0, self.0.as_der());
+
+        parsed = base128::read_base128_int(parsed.1).unwrap();
+        if parsed.0 < 80 {
+            write!(f, "{}.{}", parsed.0 / 40, parsed.0 % 40)?;
+        } else {
+            write!(f, "2.{}", parsed.0 - 80)?;
+        }
+
+        while !parsed.1.is_empty() {
+            parsed = base128::read_base128_int(parsed.1).unwrap();
+            write!(f, ".{}", parsed.0)?;
+        }
+
+        Ok(())
+    }
+}
+
+impl fmt::Debug for ObjectIdentifier {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.debug_struct("ObjectIdentifier")
+            .field("oid", &OidFormatter(self))
+            .finish()
+    }
+}
+
+impl fmt::Display for ObjectIdentifier {
+    /// Converts an `ObjectIdentifier` to a dotted string, e.g.
+    /// "1.2.840.113549".
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        fmt::Debug::fmt(&OidFormatter(self), f)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::MAX_OID_LENGTH;
+    use crate::{ObjectIdentifier, ParseError, ParseErrorKind};
+    use alloc::format;
+    #[cfg(not(feature = "std"))]
+    use alloc::string::ToString;
+
+    #[test]
+    fn test_object_identifier_from_string() {
+        for val in &[
+            "",
+            "1",
+            "3.10",
+            "1.50",
+            "2.12.a3.4",
+            "a.4",
+            "1.a",
+            ".2.5",
+            "2..5",
+            "2.5.",
+            "1.3.6.1.4.1.1248.1.1.2.1.3.21.69.112.115.111.110.32.83.116.121.108.117.115.32.80.114.111.32.52.57.48.48.123.124412.31.213321.123.110.32.83.116.121.108.117.115.32.80.114.111.32.52.57.48.48.123.124412.31.213321.123",
+        ] {
+            assert_eq!(ObjectIdentifier::from_string(val), None);
+        }
+
+        for val in &[
+            "2.5",
+            "2.5.2",
+            "1.2.840.113549",
+            "1.2.3.4",
+            "1.2.840.133549.1.1.5",
+            "2.100.3",
+        ] {
+            assert!(ObjectIdentifier::from_string(val).is_some());
+        }
+    }
+
+    #[test]
+    fn test_from_der() {
+        assert_eq!(ObjectIdentifier::from_der(b"\x06\x40\x2b\x06\x01\x04\x01\x89\x60\x01\x01\x02\x01\x03\x15\x45\x70\x73\x6f\x6e\x20\x53\x74\x79\x6c\x75\x73\x20\x50\x72\x6f\x20\x34\x39\x30\x30\x7b\x87\xcb\x7c\x1f\x8d\x82\x49\x7b\x2b\x06\x01\x04\x01\x89\x60\x01\x01\x02\x01\x03\x15\x45\x70\x73\x6f\x6e\x20"), Err(ParseError::new(ParseErrorKind::OidTooLong)));
+    }
+
+    #[test]
+    fn test_from_der_unchecked() {
+        for (dotted_string, der) in &[("2.5", b"\x55" as &[u8]), ("2.100.3", b"\x81\x34\x03")] {
+            let mut data = [0; MAX_OID_LENGTH];
+            data[..der.len()].copy_from_slice(der);
+            assert_eq!(
+                ObjectIdentifier::from_string(dotted_string).unwrap(),
+                ObjectIdentifier::from_der_unchecked(data, der.len() as u8)
+            );
+        }
+    }
+
+    #[test]
+    fn test_debug() {
+        let oid = ObjectIdentifier::from_string("1.2.3.4").unwrap();
+        assert_eq!(format!("{:?}", oid), "ObjectIdentifier { oid: 1.2.3.4 }");
+    }
+
+    #[test]
+    fn test_to_string() {
+        for val in &[
+            "0.4",
+            "2.5",
+            "2.5.2",
+            "1.2.840.113549",
+            "1.2.3.4",
+            "1.2.840.133549.1.1.5",
+            "2.100.3",
+            "2.1.750304883",
+        ] {
+            assert_eq!(
+                &ObjectIdentifier::from_string(val).unwrap().to_string(),
+                val
+            );
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/asn1/src/parser.rs 43.0.0-1ubuntu1/rust-vendor/asn1/src/parser.rs
--- 43.0.0-1/rust-vendor/asn1/src/parser.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1/src/parser.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1876 @@
+use crate::types::{Asn1Readable, Tlv};
+use crate::Tag;
+use core::fmt;
+
+#[derive(Debug, PartialEq, Eq, Clone, Copy)]
+pub enum ParseErrorKind {
+    /// Something about the value was invalid.
+    InvalidValue,
+    /// Something about the tag was invalid. This refers to a syntax error,
+    /// not a tag's value being unexpected.
+    InvalidTag,
+    /// Something about the length was invalid. This can mean either a invalid
+    /// encoding, or that a TLV was longer than 4GB, which is the maximum
+    /// length that rust-asn1 supports.
+    InvalidLength,
+    /// An unexpected tag was encountered.
+    UnexpectedTag { actual: Tag },
+    /// There was not enough data available to complete parsing. `needed`
+    /// indicates the amount of data required to advance the parse.
+    ///
+    /// Note that providing `needed` additional bytes of data does not ensure
+    /// that `parse` will succeed -- it is the amount of data required to
+    /// satisfy the `read` operation that failed, and there may be subsequent
+    /// `read` operations that require additional data.
+    ShortData { needed: usize },
+    /// An internal computation would have overflowed.
+    IntegerOverflow,
+    /// There was extraneous data in the input.
+    ExtraData,
+    /// Elements of a set were not lexicographically sorted.
+    InvalidSetOrdering,
+    /// An OPTIONAL DEFAULT was written with a default value.
+    EncodedDefault,
+    /// OID value is longer than the maximum size rust-asn1 can store. This is
+    /// a limitation of rust-asn1.
+    OidTooLong,
+    /// A `DEFINED BY` value received an value for which there was no known
+    /// variant.
+    UnknownDefinedBy,
+}
+
+#[derive(Debug, PartialEq, Eq)]
+#[doc(hidden)]
+pub enum ParseLocation {
+    Field(&'static str),
+    Index(usize),
+}
+
+/// `ParseError` are returned when there is an error parsing the ASN.1 data.
+#[derive(PartialEq, Eq)]
+pub struct ParseError {
+    kind: ParseErrorKind,
+    parse_locations: [Option<ParseLocation>; 4],
+    parse_depth: u8,
+}
+
+impl ParseError {
+    pub fn new(kind: ParseErrorKind) -> ParseError {
+        ParseError {
+            kind,
+            parse_locations: [None, None, None, None],
+            parse_depth: 0,
+        }
+    }
+
+    pub fn kind(&self) -> ParseErrorKind {
+        self.kind
+    }
+
+    #[doc(hidden)]
+    #[must_use]
+    pub fn add_location(mut self, loc: ParseLocation) -> Self {
+        if (self.parse_depth as usize) < self.parse_locations.len() {
+            self.parse_locations[self.parse_depth as usize] = Some(loc);
+            self.parse_depth += 1;
+        }
+        self
+    }
+}
+
+#[cfg(feature = "std")]
+impl std::error::Error for ParseError {}
+
+// Wraps an `Option<T>`, but `fmt::Debug` will only render `Some` values and
+// panics on others.
+struct SomeFmtOption<T>(Option<T>);
+
+impl<T: fmt::Debug> fmt::Debug for SomeFmtOption<T> {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        self.0.as_ref().unwrap().fmt(f)
+    }
+}
+
+impl fmt::Debug for ParseError {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        let mut f = f.debug_struct("ParseError");
+        f.field("kind", &self.kind);
+        if self.parse_depth > 0 {
+            let mut locations = [
+                SomeFmtOption(None),
+                SomeFmtOption(None),
+                SomeFmtOption(None),
+                SomeFmtOption(None),
+                SomeFmtOption(None),
+                SomeFmtOption(None),
+                SomeFmtOption(None),
+                SomeFmtOption(None),
+            ];
+            for (i, location) in self.parse_locations[..self.parse_depth as usize]
+                .iter()
+                .rev()
+                .enumerate()
+            {
+                locations[i] = match location.as_ref().unwrap() {
+                    ParseLocation::Field(f) => SomeFmtOption(Some(f as &dyn fmt::Debug)),
+                    ParseLocation::Index(i) => SomeFmtOption(Some(i as &dyn fmt::Debug)),
+                }
+            }
+
+            f.field("location", &&locations[..self.parse_depth as usize]);
+        }
+        f.finish()
+    }
+}
+
+impl fmt::Display for ParseError {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        write!(f, "ASN.1 parsing error: ")?;
+        match self.kind {
+            ParseErrorKind::InvalidValue => write!(f, "invalid value"),
+            ParseErrorKind::InvalidTag => write!(f, "invalid tag"),
+            ParseErrorKind::InvalidLength => write!(f, "invalid length"),
+            ParseErrorKind::UnexpectedTag { actual } => {
+                write!(f, "unexpected tag (got {:?})", actual)
+            }
+            ParseErrorKind::ShortData { needed } => {
+                write!(
+                    f,
+                    "short data (needed at least {} additional bytes)",
+                    needed
+                )
+            }
+            ParseErrorKind::IntegerOverflow => write!(f, "integer overflow"),
+            ParseErrorKind::ExtraData => write!(f, "extra data"),
+            ParseErrorKind::InvalidSetOrdering => write!(f, "SET value was ordered incorrectly"),
+            ParseErrorKind::EncodedDefault => write!(f, "DEFAULT value was explicitly encoded"),
+            ParseErrorKind::OidTooLong => write!(
+                f,
+                "OBJECT IDENTIFIER was too large to be stored in rust-asn1's buffer"
+            ),
+            ParseErrorKind::UnknownDefinedBy => write!(f, "DEFINED BY with unknown value"),
+        }
+    }
+}
+
+/// The result of a `parse`. Either a successful value or a `ParseError`.
+pub type ParseResult<T> = Result<T, ParseError>;
+
+/// Parse takes a sequence of bytes of DER encoded ASN.1 data, constructs a
+/// parser, and invokes a callback to read elements from the ASN.1 parser.
+pub fn parse<'a, T, E: From<ParseError>, F: FnOnce(&mut Parser<'a>) -> Result<T, E>>(
+    data: &'a [u8],
+    f: F,
+) -> Result<T, E> {
+    let mut p = Parser::new(data);
+    let result = f(&mut p)?;
+    p.finish()?;
+    Ok(result)
+}
+
+/// Parses a single top-level ASN.1 element from `data` (does not allow
+/// trailing data). Most often this will be used where `T` is a type with
+/// `#[derive(asn1::Asn1Read)]`.
+pub fn parse_single<'a, T: Asn1Readable<'a>>(data: &'a [u8]) -> ParseResult<T> {
+    parse(data, Parser::read_element::<T>)
+}
+
+/// Attempts to parse the `Tlv` at the start of `data` (allows trailing data).
+/// If successful, the `Tlv` and the trailing data after it are returned, if
+/// unsuccessful a `ParseError` is returned.
+///
+/// This can be useful where you have a file or stream format that relies on
+/// ASN.1 TLVs for framing.
+///
+/// When parsing a stream, if an error is returned, if its `kind` is
+/// `ParseErrorKind::ShortData`, this indicates that `data` did not contain
+/// sufficient data to parse an entire `Tlv`, and thus adding more data may
+/// resolve this. All other errors are "fatal" and cannot be resolved with
+/// additional data.
+pub fn strip_tlv(data: &[u8]) -> ParseResult<(Tlv<'_>, &[u8])> {
+    let mut p = Parser::new(data);
+    let tlv = p.read_element::<Tlv<'_>>()?;
+    Ok((tlv, p.data))
+}
+
+/// Encapsulates an ongoing parse. For almost all use-cases the correct
+/// entry-point is [`parse`] or [`parse_single`].
+pub struct Parser<'a> {
+    data: &'a [u8],
+}
+
+impl<'a> Parser<'a> {
+    #[inline]
+    pub(crate) fn new(data: &'a [u8]) -> Parser<'a> {
+        Parser { data }
+    }
+
+    #[inline]
+    fn finish(self) -> ParseResult<()> {
+        if !self.is_empty() {
+            return Err(ParseError::new(ParseErrorKind::ExtraData));
+        }
+        Ok(())
+    }
+
+    pub(crate) fn clone_internal(&self) -> Parser<'a> {
+        Parser::new(self.data)
+    }
+
+    pub(crate) fn peek_tag(&mut self) -> Option<Tag> {
+        let (tag, _) = Tag::from_bytes(self.data).ok()?;
+        Some(tag)
+    }
+
+    pub(crate) fn read_tag(&mut self) -> ParseResult<Tag> {
+        let (tag, data) = Tag::from_bytes(self.data)?;
+        self.data = data;
+        Ok(tag)
+    }
+
+    #[inline]
+    fn read_u8(&mut self) -> ParseResult<u8> {
+        Ok(self.read_bytes(1)?[0])
+    }
+
+    #[inline]
+    fn read_bytes(&mut self, length: usize) -> ParseResult<&'a [u8]> {
+        if length > self.data.len() {
+            return Err(ParseError::new(ParseErrorKind::ShortData {
+                needed: length - self.data.len(),
+            }));
+        }
+        let (result, data) = self.data.split_at(length);
+        self.data = data;
+        Ok(result)
+    }
+
+    fn read_length(&mut self) -> ParseResult<usize> {
+        match self.read_u8()? {
+            n if (n & 0x80) == 0 => Ok(usize::from(n)),
+            0x81 => {
+                let length = usize::from(self.read_u8()?);
+                // Do not allow values <0x80 to be encoded using the long form
+                if length < 0x80 {
+                    return Err(ParseError::new(ParseErrorKind::InvalidLength));
+                }
+                Ok(length)
+            }
+            0x82 => {
+                let length_bytes = self.read_bytes(2)?;
+                let length = usize::from(length_bytes[0]) << 8 | usize::from(length_bytes[1]);
+                // Enforce that we're not using long form for values <0x80,
+                // and that the first byte of the length is not zero (i.e.
+                // that we're minimally encoded)
+                if length < 0x100 {
+                    return Err(ParseError::new(ParseErrorKind::InvalidLength));
+                }
+                Ok(length)
+            }
+            0x83 => {
+                let length_bytes = self.read_bytes(3)?;
+                let length = usize::from(length_bytes[0]) << 16
+                    | usize::from(length_bytes[1]) << 8
+                    | usize::from(length_bytes[2]);
+                // Same thing as the 0x82 case
+                if length < 0x10000 {
+                    return Err(ParseError::new(ParseErrorKind::InvalidLength));
+                }
+                Ok(length)
+            }
+            0x84 => {
+                let length_bytes = self.read_bytes(4)?;
+                let length = usize::from(length_bytes[0]) << 24
+                    | usize::from(length_bytes[1]) << 16
+                    | usize::from(length_bytes[2]) << 8
+                    | usize::from(length_bytes[3]);
+                // Same thing as the 0x82 case
+                if length < 0x1000000 {
+                    return Err(ParseError::new(ParseErrorKind::InvalidLength));
+                }
+                Ok(length)
+            }
+            // We only support four-byte lengths
+            _ => Err(ParseError::new(ParseErrorKind::InvalidLength)),
+        }
+    }
+
+    #[inline]
+    pub(crate) fn read_tlv(&mut self) -> ParseResult<Tlv<'a>> {
+        let initial_data = self.data;
+
+        let tag = self.read_tag()?;
+        let length = self.read_length()?;
+        let data = self.read_bytes(length)?;
+
+        let full_data = &initial_data[..initial_data.len() - self.data.len()];
+        Ok(Tlv {
+            tag,
+            data,
+            full_data,
+        })
+    }
+
+    /// Tests whether there is any data remaining in the Parser. Generally
+    /// useful when parsing a `SEQUENCE OF`.
+    #[inline]
+    pub fn is_empty(&self) -> bool {
+        self.data.is_empty()
+    }
+
+    /// Reads a single ASN.1 element from the parser. Which type you are reading is determined by
+    /// the type parameter `T`.
+    #[inline]
+    pub fn read_element<T: Asn1Readable<'a>>(&mut self) -> ParseResult<T> {
+        T::parse(self)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::Parser;
+    use crate::tag::TagClass;
+    use crate::types::Asn1Readable;
+    use crate::{
+        BMPString, BigInt, BigUint, BitString, Choice1, Choice2, Choice3, DateTime, Enumerated,
+        Explicit, GeneralizedTime, IA5String, Implicit, ObjectIdentifier, OctetStringEncoded,
+        OwnedBigInt, OwnedBigUint, OwnedBitString, ParseError, ParseErrorKind, ParseLocation,
+        ParseResult, PrintableString, Sequence, SequenceOf, SetOf, Tag, Tlv, UniversalString,
+        UtcTime, Utf8String, VisibleString,
+    };
+    #[cfg(not(feature = "std"))]
+    use alloc::boxed::Box;
+    use alloc::{format, vec};
+    use core::fmt;
+
+    #[test]
+    fn test_lifetimes() {
+        // Explicit 'static OCTET_STRING
+        let result = crate::parse(b"\x04\x01\x00", |p| p.read_element::<&'static [u8]>()).unwrap();
+        assert_eq!(result, b"\x00");
+
+        // Explicit 'static SEQUENCE containing an explicit 'static OCTET_STRING
+        let result = crate::parse(b"\x30\x03\x04\x01\x00", |p| {
+            p.read_element::<Sequence<'static>>()?
+                .parse(|p| p.read_element::<&'static [u8]>())
+        })
+        .unwrap();
+        assert_eq!(result, b"\x00");
+
+        // Automatic 'static OCTET_STRING
+        let result = crate::parse(b"\x04\x01\x00", |p| p.read_element::<&[u8]>()).unwrap();
+        assert_eq!(result, b"\x00");
+
+        // Automatic 'static SEQUENCE containing an automatic 'static
+        // OCTET_STRING
+        let result = crate::parse(b"\x30\x03\x04\x01\x00", |p| {
+            p.read_element::<Sequence<'_>>()?
+                .parse(|p| p.read_element::<&[u8]>())
+        })
+        .unwrap();
+        assert_eq!(result, b"\x00");
+
+        // BIT_STRING
+        let result = crate::parse::<_, ParseError, _>(b"\x03\x02\x00\x00", |p| {
+            Ok(p.read_element::<BitString<'_>>()?.as_bytes())
+        })
+        .unwrap();
+        assert_eq!(result, b"\x00");
+    }
+
+    #[test]
+    fn test_parse_error_debug() {
+        for (e, expected) in &[
+            (
+                ParseError::new(ParseErrorKind::InvalidValue),
+                "ParseError { kind: InvalidValue }",
+            ),
+            (
+                ParseError::new(ParseErrorKind::InvalidValue)
+                    .add_location(ParseLocation::Field("Abc::123")),
+                "ParseError { kind: InvalidValue, location: [\"Abc::123\"] }",
+            ),
+            (
+                ParseError::new(ParseErrorKind::InvalidValue)
+                    .add_location(ParseLocation::Index(12))
+                    .add_location(ParseLocation::Field("Abc::123")),
+                "ParseError { kind: InvalidValue, location: [\"Abc::123\", 12] }",
+            ),
+        ] {
+            assert_eq!(&format!("{:?}", e), expected);
+        }
+    }
+
+    #[test]
+    fn test_parse_error_display() {
+        for (e, expected) in &[
+            (
+                ParseError::new(ParseErrorKind::InvalidValue),
+                "ASN.1 parsing error: invalid value",
+            ),
+            (
+                ParseError::new(ParseErrorKind::InvalidTag),
+                "ASN.1 parsing error: invalid tag"
+            ),
+            (
+                ParseError::new(ParseErrorKind::InvalidLength),
+                "ASN.1 parsing error: invalid length"
+            ),
+            (
+                ParseError::new(ParseErrorKind::IntegerOverflow),
+                "ASN.1 parsing error: integer overflow"
+            ),
+            (
+                ParseError::new(ParseErrorKind::ExtraData),
+                "ASN.1 parsing error: extra data"
+            ),
+            (
+                ParseError::new(ParseErrorKind::InvalidSetOrdering),
+                "ASN.1 parsing error: SET value was ordered incorrectly"
+            ),
+            (
+                ParseError::new(ParseErrorKind::EncodedDefault),
+                "ASN.1 parsing error: DEFAULT value was explicitly encoded"
+            ),
+            (
+                ParseError::new(ParseErrorKind::OidTooLong),
+                "ASN.1 parsing error: OBJECT IDENTIFIER was too large to be stored in rust-asn1's buffer"
+            ),
+            (
+                ParseError::new(ParseErrorKind::UnknownDefinedBy),
+                "ASN.1 parsing error: DEFINED BY with unknown value"
+            ),
+            (
+                ParseError::new(ParseErrorKind::ShortData{needed: 7})
+                    .add_location(ParseLocation::Field("Abc::123")),
+                "ASN.1 parsing error: short data (needed at least 7 additional bytes)",
+            ),
+            (
+                ParseError::new(ParseErrorKind::UnexpectedTag {
+                    actual: Tag::primitive(12),
+                })
+                .add_location(ParseLocation::Index(12))
+                .add_location(ParseLocation::Field("Abc::123")),
+                "ASN.1 parsing error: unexpected tag (got Tag { value: 12, constructed: false, class: Universal })",
+            ),
+        ]
+        {
+            assert_eq!(&format!("{}", e), expected);
+        }
+    }
+
+    #[test]
+    fn test_parse_error_kind() {
+        let e = ParseError::new(ParseErrorKind::EncodedDefault);
+        assert_eq!(e.kind(), ParseErrorKind::EncodedDefault);
+    }
+
+    #[test]
+    fn test_strip_tlv() {
+        for (der_bytes, expected) in [
+            (
+                b"" as &[u8],
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+            ),
+            (
+                b"\x04",
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+            ),
+            (
+                b"\x04\x82",
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 2 })),
+            ),
+            (
+                b"\x04\x03",
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 3 })),
+            ),
+            (
+                b"\x04\x03ab",
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+            ),
+            (
+                b"\x04\x03abc",
+                Ok((
+                    Tlv {
+                        tag: Tag::primitive(0x04),
+                        data: b"abc",
+                        full_data: b"\x04\x03abc",
+                    },
+                    b"" as &[u8],
+                )),
+            ),
+            (
+                b"\x04\x03abc\x00\x00\x00",
+                Ok((
+                    Tlv {
+                        tag: Tag::primitive(0x04),
+                        data: b"abc",
+                        full_data: b"\x04\x03abc",
+                    },
+                    b"\x00\x00\x00",
+                )),
+            ),
+        ] {
+            let result = crate::strip_tlv(der_bytes);
+            assert_eq!(result, expected);
+        }
+    }
+
+    fn assert_parses_cb<
+        'a,
+        T: fmt::Debug + PartialEq,
+        E: From<ParseError> + fmt::Debug + PartialEq,
+        F: Fn(&mut Parser<'a>) -> Result<T, E>,
+    >(
+        data: &[(Result<T, E>, &'a [u8])],
+        f: F,
+    ) {
+        for (expected, der_bytes) in data {
+            let result = crate::parse(der_bytes, &f);
+            assert_eq!(&result, expected);
+        }
+    }
+
+    fn assert_parses<'a, T>(data: &[(ParseResult<T>, &'a [u8])])
+    where
+        T: Asn1Readable<'a> + fmt::Debug + PartialEq,
+    {
+        assert_parses_cb(data, |p| p.read_element::<T>());
+    }
+
+    #[test]
+    fn test_parse_extra_data() {
+        let result = crate::parse(b"\x00", |_| Ok(()));
+        assert_eq!(result, Err(ParseError::new(ParseErrorKind::ExtraData)));
+    }
+
+    #[test]
+    fn test_errors() {
+        #[derive(Debug, PartialEq, Eq)]
+        enum E {
+            X(u64),
+            P(ParseError),
+        }
+
+        impl From<ParseError> for E {
+            fn from(e: ParseError) -> E {
+                E::P(e)
+            }
+        }
+
+        assert_parses_cb(
+            &[
+                (Ok(8), b"\x02\x01\x08"),
+                (
+                    Err(E::P(ParseError::new(ParseErrorKind::ShortData {
+                        needed: 1,
+                    }))),
+                    b"\x02\x01",
+                ),
+                (Err(E::X(7)), b"\x02\x01\x07"),
+            ],
+            |p| {
+                let val = p.read_element::<u64>()?;
+                if val % 2 == 0 {
+                    Ok(val)
+                } else {
+                    Err(E::X(val))
+                }
+            },
+        );
+    }
+
+    #[test]
+    fn test_parse_tlv() {
+        assert_parses::<Tlv<'_>>(&[
+            (
+                Ok(Tlv {
+                    tag: Tag::primitive(0x4),
+                    data: b"abc",
+                    full_data: b"\x04\x03abc",
+                }),
+                b"\x04\x03abc",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 2 })),
+                b"\x04\x03a",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                b"\x04",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                b"",
+            ),
+            // Long form tags
+            (
+                Ok(Tlv {
+                    tag: Tag::new(31, TagClass::Universal, false),
+                    data: b"",
+                    full_data: b"\x1f\x1f\x00",
+                }),
+                b"\x1f\x1f\x00",
+            ),
+            (
+                Ok(Tlv {
+                    tag: Tag::new(128, TagClass::Universal, false),
+                    data: b"",
+                    full_data: b"\x1f\x81\x00\x00",
+                }),
+                b"\x1f\x81\x00\x00",
+            ),
+            (
+                Ok(Tlv {
+                    tag: Tag::new(0x4001, TagClass::Universal, false),
+                    data: b"",
+                    full_data: b"\x1f\x81\x80\x01\x00",
+                }),
+                b"\x1f\x81\x80\x01\x00",
+            ),
+            (
+                Ok(Tlv {
+                    tag: Tag::new(0x01, TagClass::Application, false),
+                    data: b"",
+                    full_data: b"\x41\x00",
+                }),
+                b"\x41\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                b"\x1f",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                b"\xff",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                b"\x1f\x85",
+            ),
+            // Overflow u32 for the tag number.
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidTag)),
+                b"\x1f\x88\x80\x80\x80\x80\x00",
+            ),
+            // Long form tag for value that fits in a short form
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidTag)),
+                b"\x1f\x1e\x00",
+            ),
+            (
+                // base128 integer with leading 0
+                Err(ParseError::new(ParseErrorKind::InvalidTag)),
+                b"\xff\x80\x84\x01\x01\xa9",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_null() {
+        assert_parses::<()>(&[
+            (Ok(()), b"\x05\x00"),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x05\x01\x00",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_bool() {
+        assert_parses::<bool>(&[
+            (Ok(true), b"\x01\x01\xff"),
+            (Ok(false), b"\x01\x01\x00"),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x01\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x01\x01\x01",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x01\x02\x00\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x01\x02\xff\x01",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_octet_string() {
+        let long_value = vec![b'a'; 70_000];
+        let really_long_value = vec![b'a'; 20_000_000];
+
+        assert_parses::<&[u8]>(&[
+            (Ok(b""), b"\x04\x00"),
+            (Ok(b"\x01\x02\x03"), b"\x04\x03\x01\x02\x03"),
+            (
+                Ok(b"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"),
+                b"\x04\x81\x81aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+            ),
+            (
+                Ok(long_value.as_slice()),
+                [b"\x04\x83\x01\x11\x70", long_value.as_slice()].concat().as_slice()
+            ),
+            (
+                Ok(really_long_value.as_slice()),
+                [b"\x04\x84\x01\x31\x2d\x00", really_long_value.as_slice()].concat().as_slice()
+            ),
+            (Err(ParseError::new(ParseErrorKind::InvalidLength)), b"\x04\x80"),
+            (Err(ParseError::new(ParseErrorKind::InvalidLength)), b"\x04\x81\x00"),
+            (Err(ParseError::new(ParseErrorKind::InvalidLength)), b"\x04\x81\x01\x09"),
+            (Err(ParseError::new(ParseErrorKind::InvalidLength)), b"\x04\x82\x00\x80"),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidLength)),
+                b"\x04\x89\x01\x01\x01\x01\x01\x01\x01\x01\x01"
+            ),
+            (Err(ParseError::new(ParseErrorKind::ShortData{needed: 1})), b"\x04\x03\x01\x02"),
+            (Err(ParseError::new(ParseErrorKind::ShortData{needed: 65531})), b"\x04\x82\xff\xff\xff\xff\xff\xff"),
+            // 3 byte length form with leading 0.
+            (Err(ParseError::new(ParseErrorKind::InvalidLength)), b"\x04\x83\x00\xff\xff"),
+            // 4 byte length form with leading 0.
+            (Err(ParseError::new(ParseErrorKind::InvalidLength)), b"\x04\x84\x00\xff\xff\xff"),
+        ]);
+
+        assert_parses::<[u8; 0]>(&[
+            (Ok([]), b"\x04\x00"),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x04\x02\x01\x02",
+            ),
+        ]);
+
+        assert_parses::<[u8; 1]>(&[
+            (Ok([2]), b"\x04\x01\x02"),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x04\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x04\x02\x01\x02",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_octet_string_encoded() {
+        assert_parses::<OctetStringEncoded<bool>>(&[
+            (Ok(OctetStringEncoded::new(true)), b"\x04\x03\x01\x01\xff"),
+            (Ok(OctetStringEncoded::new(false)), b"\x04\x03\x01\x01\x00"),
+            (
+                Err(ParseError::new(ParseErrorKind::UnexpectedTag {
+                    actual: Tag::primitive(0x03),
+                })),
+                b"\x03\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::UnexpectedTag {
+                    actual: Tag::primitive(0x02),
+                })),
+                b"\x04\x02\x02\x00",
+            ),
+        ])
+    }
+
+    #[test]
+    fn test_parse_int_i64() {
+        assert_parses::<i64>(&[
+            (Ok(0), b"\x02\x01\x00"),
+            (Ok(127), b"\x02\x01\x7f"),
+            (Ok(128), b"\x02\x02\x00\x80"),
+            (Ok(256), b"\x02\x02\x01\x00"),
+            (Ok(-128), b"\x02\x01\x80"),
+            (Ok(-129), b"\x02\x02\xff\x7f"),
+            (Ok(-256), b"\x02\x02\xff\x00"),
+            (Ok(i64::MAX), b"\x02\x08\x7f\xff\xff\xff\xff\xff\xff\xff"),
+            (
+                Err(ParseError::new(ParseErrorKind::UnexpectedTag {
+                    actual: Tag::primitive(0x3),
+                })),
+                b"\x03\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                b"\x02\x02\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                b"",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                b"\x02",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::IntegerOverflow)),
+                b"\x02\x09\x02\x00\x00\x00\x00\x00\x00\x00\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x02\x05\x00\x00\x00\x00\x01",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x02\x02\xff\x80",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x02\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::IntegerOverflow)),
+                b"\x02\x09\x00\xD0\x07\x04\x00\x03\x31\x31\x00",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn parse_int_u64() {
+        assert_parses::<u64>(&[
+            (
+                Ok(u64::MAX),
+                b"\x02\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x02\x01\xff",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::IntegerOverflow)),
+                b"\x02\x09\x02\x00\x00\x00\x00\x00\x00\x00\x00",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_int_i32() {
+        assert_parses::<i32>(&[
+            (Ok(0), b"\x02\x01\x00"),
+            (Ok(127), b"\x02\x01\x7f"),
+            (Ok(128), b"\x02\x02\x00\x80"),
+            (Ok(256), b"\x02\x02\x01\x00"),
+            (Ok(-128), b"\x02\x01\x80"),
+            (Ok(-129), b"\x02\x02\xff\x7f"),
+            (Ok(-256), b"\x02\x02\xff\x00"),
+            (Ok(i32::MAX), b"\x02\x04\x7f\xff\xff\xff"),
+            (
+                Err(ParseError::new(ParseErrorKind::UnexpectedTag {
+                    actual: Tag::primitive(0x3),
+                })),
+                b"\x03\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                b"\x02\x02\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                b"",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                b"\x02",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::IntegerOverflow)),
+                b"\x02\x09\x02\x00\x00\x00\x00\x00\x00\x00\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x02\x05\x00\x00\x00\x00\x01",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x02\x02\xff\x80",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x02\x00",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_int_u16() {
+        assert_parses::<u16>(&[
+            (Ok(0), b"\x02\x01\x00"),
+            (Ok(1), b"\x02\x01\x01"),
+            (Ok(256), b"\x02\x02\x01\x00"),
+            (Ok(65535), b"\x02\x03\x00\xff\xff"),
+            (
+                Err(ParseError::new(ParseErrorKind::IntegerOverflow)),
+                b"\x02\x03\x01\x00\x00",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_int_i16() {
+        assert_parses::<i16>(&[
+            (Ok(0), b"\x02\x01\x00"),
+            (Ok(1), b"\x02\x01\x01"),
+            (Ok(-256), b"\x02\x02\xff\x00"),
+            (Ok(-1), b"\x02\x01\xff"),
+            (Ok(-32768), b"\x02\x02\x80\x00"),
+            (Ok(32767), b"\x02\x02\x7f\xff"),
+            (
+                Err(ParseError::new(ParseErrorKind::IntegerOverflow)),
+                b"\x02\x03\x80\x00\x00",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_int_i8() {
+        assert_parses::<i8>(&[
+            (Ok(0i8), b"\x02\x01\x00"),
+            (Ok(127i8), b"\x02\x01\x7f"),
+            (Ok(-128i8), b"\x02\x01\x80"),
+            (
+                Err(ParseError::new(ParseErrorKind::IntegerOverflow)),
+                b"\x02\x02\x02\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x02\x00",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_int_u8() {
+        assert_parses::<u8>(&[
+            (Ok(0u8), b"\x02\x01\x00"),
+            (Ok(127u8), b"\x02\x01\x7f"),
+            (Ok(255u8), b"\x02\x02\x00\xff"),
+            (
+                Err(ParseError::new(ParseErrorKind::IntegerOverflow)),
+                b"\x02\x02\x01\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x02\x01\x80",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_biguint() {
+        assert_parses::<BigUint<'_>>(&[
+            (Ok(BigUint::new(b"\x00").unwrap()), b"\x02\x01\x00"),
+            (Ok(BigUint::new(b"\x00\xff").unwrap()), b"\x02\x02\x00\xff"),
+            (
+                Ok(BigUint::new(b"\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff").unwrap()),
+                b"\x02\x0d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x02\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x02\x01\x80",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x02\x02\xff\x80",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_ownedbiguint() {
+        assert_parses::<OwnedBigUint>(&[
+            (
+                Ok(OwnedBigUint::new(b"\x00".to_vec()).unwrap()),
+                b"\x02\x01\x00",
+            ),
+            (
+                Ok(OwnedBigUint::new(b"\x00\xff".to_vec()).unwrap()),
+                b"\x02\x02\x00\xff",
+            ),
+            (
+                Ok(OwnedBigUint::new(
+                    b"\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff".to_vec(),
+                )
+                .unwrap()),
+                b"\x02\x0d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x02\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x02\x01\x80",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x02\x02\xff\x80",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_bigint() {
+        assert_parses::<BigInt<'_>>(&[
+            (Ok(BigInt::new(b"\x80").unwrap()), b"\x02\x01\x80"),
+            (Ok(BigInt::new(b"\xff").unwrap()), b"\x02\x01\xff"),
+            (
+                Ok(BigInt::new(b"\x00\xff\xff").unwrap()),
+                b"\x02\x03\x00\xff\xff",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x02\x02\xff\xff",
+            ),
+            (
+                Ok(BigInt::new(b"\xff\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff").unwrap()),
+                b"\x02\x0c\xff\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x02\x00",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_owned_bigint() {
+        assert_parses::<OwnedBigInt>(&[
+            (
+                Ok(OwnedBigInt::new(b"\x80".to_vec()).unwrap()),
+                b"\x02\x01\x80",
+            ),
+            (
+                Ok(OwnedBigInt::new(b"\xff".to_vec()).unwrap()),
+                b"\x02\x01\xff",
+            ),
+            (
+                Ok(OwnedBigInt::new(b"\x00\xff\xff".to_vec()).unwrap()),
+                b"\x02\x03\x00\xff\xff",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x02\x02\xff\xff",
+            ),
+            (
+                Ok(
+                    OwnedBigInt::new(b"\xff\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff".to_vec())
+                        .unwrap(),
+                ),
+                b"\x02\x0c\xff\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x02\x00",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_object_identifier() {
+        assert_parses::<ObjectIdentifier>(&[
+            (
+                Ok(ObjectIdentifier::from_string("2.5").unwrap()),
+                b"\x06\x01\x55",
+            ),
+            (
+                Ok(ObjectIdentifier::from_string("2.5.2").unwrap()),
+                b"\x06\x02\x55\x02",
+            ),
+            (
+                Ok(ObjectIdentifier::from_string("1.2.840.113549").unwrap()),
+                b"\x06\x06\x2a\x86\x48\x86\xf7\x0d",
+            ),
+            (
+                Ok(ObjectIdentifier::from_string("1.2.3.4").unwrap()),
+                b"\x06\x03\x2a\x03\x04",
+            ),
+            (
+                Ok(ObjectIdentifier::from_string("1.2.840.133549.1.1.5").unwrap()),
+                b"\x06\x09\x2a\x86\x48\x88\x93\x2d\x01\x01\x05",
+            ),
+            (
+                Ok(ObjectIdentifier::from_string("2.100.3").unwrap()),
+                b"\x06\x03\x81\x34\x03",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x06\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x06\x07\x55\x02\xc0\x80\x80\x80\x80",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x06\x02\x2a\x86",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_bit_string() {
+        assert_parses::<BitString<'_>>(&[
+            (Ok(BitString::new(b"", 0).unwrap()), b"\x03\x01\x00"),
+            (Ok(BitString::new(b"\x00", 7).unwrap()), b"\x03\x02\x07\x00"),
+            (Ok(BitString::new(b"\x80", 7).unwrap()), b"\x03\x02\x07\x80"),
+            (
+                Ok(BitString::new(b"\x81\xf0", 4).unwrap()),
+                b"\x03\x03\x04\x81\xf0",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x03\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x03\x02\x07\x01",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x03\x02\x07\x40",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x03\x02\x08\x00",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_owned_bit_string() {
+        assert_parses::<OwnedBitString>(&[
+            (Ok(OwnedBitString::new(vec![], 0).unwrap()), b"\x03\x01\x00"),
+            (
+                Ok(OwnedBitString::new(vec![0x00], 7).unwrap()),
+                b"\x03\x02\x07\x00",
+            ),
+            (
+                Ok(OwnedBitString::new(vec![0x80], 7).unwrap()),
+                b"\x03\x02\x07\x80",
+            ),
+            (
+                Ok(OwnedBitString::new(vec![0x81, 0xf0], 4).unwrap()),
+                b"\x03\x03\x04\x81\xf0",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x03\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x03\x02\x07\x01",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x03\x02\x07\x40",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x03\x02\x08\x00",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_printable_string() {
+        assert_parses::<PrintableString<'_>>(&[
+            (Ok(PrintableString::new("abc").unwrap()), b"\x13\x03abc"),
+            (Ok(PrintableString::new(")").unwrap()), b"\x13\x01)"),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x13\x03ab\x00",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_ia5string() {
+        assert_parses::<IA5String<'_>>(&[
+            (Ok(IA5String::new("abc").unwrap()), b"\x16\x03abc"),
+            (Ok(IA5String::new(")").unwrap()), b"\x16\x01)"),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x16\x03ab\xff",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_utf8string() {
+        assert_parses::<Utf8String<'_>>(&[
+            (Ok(Utf8String::new("abc")), b"\x0c\x03abc"),
+            (Ok(Utf8String::new(")")), b"\x0c\x01)"),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x0c\x01\xff",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_visiblestring() {
+        assert_parses::<VisibleString<'_>>(&[
+            (Ok(VisibleString::new("abc").unwrap()), b"\x1a\x03abc"),
+            (Ok(VisibleString::new(")").unwrap()), b"\x1a\x01)"),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x1a\x01\n",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_bmpstring() {
+        assert_parses::<BMPString<'_>>(&[
+            (
+                Ok(BMPString::new(b"\x00a\x00b\x00c").unwrap()),
+                b"\x1e\x06\x00a\x00b\x00c",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x1e\x01a",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x1e\x04\xde|X@",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x1e\x02\xdeX",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_universalstring() {
+        assert_parses::<UniversalString<'_>>(&[
+            (
+                Ok(UniversalString::new(b"\x00\x00\x00a\x00\x00\x00b\x00\x00\x00c").unwrap()),
+                b"\x1c\x0c\x00\x00\x00a\x00\x00\x00b\x00\x00\x00c",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x1c\x01a",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x1c\x02ab",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x1c\x03abc",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x1c\x03abc",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x1c\x04\x96\x8c\xeaU",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_utctime() {
+        assert_parses::<UtcTime>(&[
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x11910506164540-0700",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x11910506164540+0730",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0f5105062345+0000",
+            ),
+            (
+                Ok(UtcTime::new(DateTime::new(1991, 5, 6, 23, 45, 40).unwrap()).unwrap()),
+                b"\x17\x0d910506234540Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0b9105062345Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0b5105062345Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0da10506234540Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0d91a506234540Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0d9105a6234540Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0d910506a34540Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0d910506334a40Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0d91050633444aZ",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0d910506334461Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0e910506334400Za",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0d000100000000Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0d101302030405Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0d100002030405Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0d100100030405Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0d100132030405Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0d100231030405Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0d100102240405Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0d100102036005Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0d100102030460Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0e-100102030410Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0e10-0102030410Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0e10-0002030410Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0e1001-02030410Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0e100102-030410Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0e10010203-0410Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0e1001020304-10Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0c18102813516Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x1018102813516+0730",
+            ),
+            (
+                // 2049 year with a negative UTC-offset, so actually a 2050
+                // date. UTCTime doesn't support those.
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x17\x0f4912311047-2026",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_generalizedtime() {
+        assert_parses::<GeneralizedTime>(&[
+            (
+                Ok(GeneralizedTime::new(DateTime::new(2010, 1, 2, 3, 4, 5).unwrap()).unwrap()),
+                b"\x18\x0f20100102030405Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x1320100102030405+0607",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x1320100102030405-0607",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x1320100602030405-0607",
+            ),
+            (
+                // 29th of February (Leap Year)
+                Ok(GeneralizedTime::new(DateTime::new(2000, 2, 29, 3, 4, 5).unwrap()).unwrap()),
+                b"\x18\x0f20000229030405Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x0e20100102030405",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x0e00000100000000Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x0e20101302030405Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x0e20100002030405Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x0e20100100030405Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x0e20100132030405Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x0e20100231030405Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x0e20100102240405Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x0e20100102036005Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x0e20100102030460Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x0f-20100102030410Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x0f2010-0102030410Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x0f2010-0002030410Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x0f201001-02030410Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x0f20100102-030410Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x0f2010010203-0410Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x0f201001020304-10Z",
+            ),
+            (
+                // 31st of June
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x1320100631030405-0607",
+            ),
+            (
+                // 30th of February (Leap Year)
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x1320000230030405-0607",
+            ),
+            (
+                // 29th of February (non-Leap Year)
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x1319000229030405-0607",
+            ),
+            (
+                // Invalid timezone-offset hours
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x1319000228030405-3007",
+            ),
+            (
+                // Invalid timezone-offset minutes
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x1319000228030405-2367",
+            ),
+            (
+                // Trailing data
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x1019000228030405Z ",
+            ),
+            // Tests for fractional seconds, which we currently don't support
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x1620100102030405.123456Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x1520100102030405.123456",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x1020100102030405.Z",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x0f20100102030405.",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x11-1\n110723459+1002",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x18\x0d0 1204000060Z",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_enumerated() {
+        assert_parses::<Enumerated>(&[
+            (Ok(Enumerated::new(12)), b"\x0a\x01\x0c"),
+            (
+                Err(ParseError::new(ParseErrorKind::InvalidValue)),
+                b"\x0a\x09\xff\xff\xff\xff\xff\xff\xff\xff\xff",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_sequence() {
+        assert_parses::<Sequence<'_>>(&[
+            (
+                Ok(Sequence::new(b"\x02\x01\x01\x02\x01\x02")),
+                b"\x30\x06\x02\x01\x01\x02\x01\x02",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                b"\x30\x04\x02\x01\x01",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::ExtraData)),
+                b"\x30\x06\x02\x01\x01\x02\x01\x02\x00",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_sequence_parse() {
+        assert_parses_cb(
+            &[
+                (Ok((1, 2)), b"\x30\x06\x02\x01\x01\x02\x01\x02"),
+                (
+                    Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                    b"\x30\x03\x02\x01\x01",
+                ),
+                (
+                    Err(ParseError::new(ParseErrorKind::ExtraData)),
+                    b"\x30\x07\x02\x01\x01\x02\x01\x02\x00",
+                ),
+            ],
+            |p| {
+                p.read_element::<Sequence<'_>>()?
+                    .parse(|p| Ok((p.read_element::<i64>()?, p.read_element::<i64>()?)))
+            },
+        );
+    }
+
+    #[test]
+    fn test_parse_is_empty() {
+        assert_parses_cb(
+            &[
+                (
+                    Ok(vec![1, 2, 3]),
+                    b"\x30\x09\x02\x01\x01\x02\x01\x02\x02\x01\x03",
+                ),
+                (Ok(vec![]), b"\x30\x00"),
+                (
+                    Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                    b"\x30\x02\x02\x01",
+                ),
+            ],
+            |p| {
+                p.read_element::<Sequence<'_>>()?.parse(|p| {
+                    let mut result = vec![];
+                    while !p.is_empty() {
+                        result.push(p.read_element::<i64>()?);
+                    }
+                    Ok(result)
+                })
+            },
+        );
+    }
+
+    #[test]
+    fn test_parse_sequence_of() {
+        assert_parses_cb(
+            &[
+                (
+                    Ok(vec![1, 2, 3]),
+                    b"\x30\x09\x02\x01\x01\x02\x01\x02\x02\x01\x03",
+                ),
+                (Ok(vec![]), b"\x30\x00"),
+                (
+                    Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })
+                        .add_location(ParseLocation::Index(0))),
+                    b"\x30\x02\x02\x01",
+                ),
+            ],
+            |p| Ok(p.read_element::<SequenceOf<'_, i64>>()?.collect()),
+        );
+    }
+
+    #[test]
+    fn parse_set_of() {
+        assert_parses_cb(
+            &[
+                (
+                    Ok(vec![1, 2, 3]),
+                    b"\x31\x09\x02\x01\x01\x02\x01\x02\x02\x01\x03",
+                ),
+                (Ok(vec![]), b"\x31\x00"),
+                (
+                    Err(ParseError::new(ParseErrorKind::InvalidSetOrdering)
+                        .add_location(ParseLocation::Index(1))),
+                    b"\x31\x06\x02\x01\x03\x02\x01\x01",
+                ),
+                (
+                    Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })
+                        .add_location(ParseLocation::Index(0))),
+                    b"\x31\x01\x02",
+                ),
+                (
+                    Err(ParseError::new(ParseErrorKind::UnexpectedTag {
+                        actual: Tag::primitive(0x1),
+                    })
+                    .add_location(ParseLocation::Index(0))),
+                    b"\x31\x02\x01\x00",
+                ),
+            ],
+            |p| Ok(p.read_element::<SetOf<'_, u64>>()?.collect()),
+        );
+    }
+
+    #[test]
+    fn test_parse_optional() {
+        assert_parses_cb(
+            &[
+                (Ok((Some(true), None)), b"\x01\x01\xff"),
+                (Ok((Some(false), None)), b"\x01\x01\x00"),
+                (Ok((None, Some(18))), b"\x02\x01\x12"),
+                (Ok((Some(true), Some(18))), b"\x01\x01\xff\x02\x01\x12"),
+                (Ok((None, None)), b""),
+                (
+                    Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                    b"\x01",
+                ),
+                (
+                    Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                    b"\x02",
+                ),
+            ],
+            |p| {
+                Ok((
+                    p.read_element::<Option<bool>>()?,
+                    p.read_element::<Option<i64>>()?,
+                ))
+            },
+        );
+
+        assert_parses::<Option<Tlv<'_>>>(&[
+            (
+                Ok(Some(Tlv {
+                    tag: Tag::primitive(0x4),
+                    data: b"abc",
+                    full_data: b"\x04\x03abc",
+                })),
+                b"\x04\x03abc",
+            ),
+            (Ok(None), b""),
+            (
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                b"\x04",
+            ),
+        ]);
+
+        assert_parses::<Option<Choice2<u64, bool>>>(&[
+            (Ok(None), b""),
+            (Ok(Some(Choice2::ChoiceA(17))), b"\x02\x01\x11"),
+            (Ok(Some(Choice2::ChoiceB(true))), b"\x01\x01\xff"),
+            (Err(ParseError::new(ParseErrorKind::ExtraData)), b"\x03\x00"),
+        ]);
+    }
+
+    #[test]
+    fn test_choice1() {
+        assert_parses::<Choice1<bool>>(&[
+            (Ok(Choice1::ChoiceA(true)), b"\x01\x01\xff"),
+            (
+                Err(ParseError::new(ParseErrorKind::UnexpectedTag {
+                    actual: Tag::primitive(0x03),
+                })),
+                b"\x03\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                b"",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_choice2() {
+        assert_parses::<Choice2<bool, i64>>(&[
+            (Ok(Choice2::ChoiceA(true)), b"\x01\x01\xff"),
+            (Ok(Choice2::ChoiceB(18)), b"\x02\x01\x12"),
+            (
+                Err(ParseError::new(ParseErrorKind::UnexpectedTag {
+                    actual: Tag::primitive(0x03),
+                })),
+                b"\x03\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                b"",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_choice3() {
+        assert_parses::<Choice3<bool, i64, ()>>(&[
+            (Ok(Choice3::ChoiceA(true)), b"\x01\x01\xff"),
+            (Ok(Choice3::ChoiceB(18)), b"\x02\x01\x12"),
+            (Ok(Choice3::ChoiceC(())), b"\x05\x00"),
+            (
+                Err(ParseError::new(ParseErrorKind::UnexpectedTag {
+                    actual: Tag::primitive(0x03),
+                })),
+                b"\x03\x00",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                b"",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_implicit() {
+        assert_parses::<Implicit<bool, 2>>(&[
+            (Ok(Implicit::new(true)), b"\x82\x01\xff"),
+            (Ok(Implicit::new(false)), b"\x82\x01\x00"),
+            (
+                Err(ParseError::new(ParseErrorKind::UnexpectedTag {
+                    actual: Tag::primitive(0x01),
+                })),
+                b"\x01\x01\xff",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::UnexpectedTag {
+                    actual: Tag::primitive(0x02),
+                })),
+                b"\x02\x01\xff",
+            ),
+        ]);
+        assert_parses::<Implicit<Sequence<'_>, 2>>(&[
+            (Ok(Implicit::new(Sequence::new(b"abc"))), b"\xa2\x03abc"),
+            (Ok(Implicit::new(Sequence::new(b""))), b"\xa2\x00"),
+            (
+                Err(ParseError::new(ParseErrorKind::UnexpectedTag {
+                    actual: Tag::primitive(0x01),
+                })),
+                b"\x01\x01\xff",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::UnexpectedTag {
+                    actual: Tag::primitive(0x02),
+                })),
+                b"\x02\x01\xff",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+                b"",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_explicit() {
+        assert_parses::<Explicit<bool, 2>>(&[
+            (Ok(Explicit::new(true)), b"\xa2\x03\x01\x01\xff"),
+            (Ok(Explicit::new(false)), b"\xa2\x03\x01\x01\x00"),
+            (
+                Err(ParseError::new(ParseErrorKind::UnexpectedTag {
+                    actual: Tag::primitive(0x01),
+                })),
+                b"\x01\x01\xff",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::UnexpectedTag {
+                    actual: Tag::primitive(0x02),
+                })),
+                b"\x02\x01\xff",
+            ),
+            (
+                Err(ParseError::new(ParseErrorKind::UnexpectedTag {
+                    actual: Tag::primitive(0x03),
+                })),
+                b"\xa2\x03\x03\x01\xff",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_parse_box() {
+        assert_parses::<Box<u8>>(&[
+            (Ok(Box::new(12u8)), b"\x02\x01\x0c"),
+            (Ok(Box::new(0)), b"\x02\x01\x00"),
+        ]);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/asn1/src/tag.rs 43.0.0-1ubuntu1/rust-vendor/asn1/src/tag.rs
--- 43.0.0-1/rust-vendor/asn1/src/tag.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1/src/tag.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,154 @@
+use crate::base128;
+use crate::parser::{ParseError, ParseErrorKind, ParseResult};
+use crate::writer::{WriteBuf, WriteResult};
+
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
+pub(crate) enum TagClass {
+    Universal = 0b00,
+    Application = 0b01,
+    ContextSpecific = 0b10,
+    Private = 0b11,
+}
+
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
+pub struct Tag {
+    value: u32,
+    constructed: bool,
+    class: TagClass,
+}
+
+pub(crate) const CONSTRUCTED: u8 = 0x20;
+
+impl Tag {
+    /// Parses a `Tag` from bytes and returns either the `Tag` and the
+    /// remaining bytes from the input or an error.
+    pub fn from_bytes(mut data: &[u8]) -> ParseResult<(Tag, &[u8])> {
+        let tag = match data.first() {
+            Some(&b) => b,
+            None => return Err(ParseError::new(ParseErrorKind::ShortData { needed: 1 })),
+        };
+        data = &data[1..];
+        let mut value = u32::from(tag & 0x1f);
+        let constructed = tag & CONSTRUCTED == CONSTRUCTED;
+
+        let tag_class_bits = tag >> 6;
+        let class = if tag_class_bits == TagClass::Universal as u8 {
+            TagClass::Universal
+        } else if tag_class_bits == TagClass::Application as u8 {
+            TagClass::Application
+        } else if tag_class_bits == TagClass::ContextSpecific as u8 {
+            TagClass::ContextSpecific
+        } else {
+            assert!(tag_class_bits == TagClass::Private as u8);
+            TagClass::Private
+        };
+
+        // Long form tag
+        if value == 0x1f {
+            let result = base128::read_base128_int(data).map_err(|e| {
+                if matches!(e.kind(), ParseErrorKind::ShortData { .. }) {
+                    e
+                } else {
+                    ParseError::new(ParseErrorKind::InvalidTag)
+                }
+            })?;
+            // MSRV of 1.59 required for `(value, data) = ...;`
+            value = result.0;
+            data = result.1;
+            // Tags must be encoded in minimal form.
+            if value < 0x1f {
+                return Err(ParseError::new(ParseErrorKind::InvalidTag));
+            }
+        }
+
+        Ok((
+            Tag {
+                value,
+                constructed,
+                class,
+            },
+            data,
+        ))
+    }
+
+    pub(crate) const fn new(tag: u32, class: TagClass, constructed: bool) -> Tag {
+        Tag {
+            value: tag,
+            constructed,
+            class,
+        }
+    }
+
+    /// This is `pub` for use in tests but is not considered part of the
+    /// supported API.
+    #[doc(hidden)]
+    pub const fn primitive(tag: u32) -> Tag {
+        Tag::new(tag, TagClass::Universal, false)
+    }
+
+    pub(crate) const fn constructed(tag: u32) -> Tag {
+        Tag::new(tag, TagClass::Universal, true)
+    }
+
+    /// Returns the tag's representation (including tag class and constructed
+    /// bits) as a `u8` if the `value` component fits in a short form
+    /// (value < 31) or `None` if this is a long-form tag.
+    pub fn as_u8(self) -> Option<u8> {
+        if self.value >= 0x1f {
+            return None;
+        }
+        Some(
+            ((self.class as u8) << 6)
+                | if self.constructed { CONSTRUCTED } else { 0 }
+                | (self.value as u8),
+        )
+    }
+
+    pub(crate) fn write_bytes(self, dest: &mut WriteBuf) -> WriteResult {
+        let mut b = ((self.class as u8) << 6) | if self.constructed { CONSTRUCTED } else { 0 };
+        if self.value >= 0x1f {
+            b |= 0x1f;
+            dest.push_byte(b)?;
+            let len = base128::base128_length(self.value);
+            let orig_len = dest.len();
+            for _ in 0..len {
+                dest.push_byte(0)?;
+            }
+            base128::write_base128_int(&mut dest.as_mut_slice()[orig_len..], self.value);
+        } else {
+            b |= self.value as u8;
+            dest.push_byte(b)?;
+        }
+
+        Ok(())
+    }
+
+    pub(crate) const fn is_constructed(self) -> bool {
+        self.constructed
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::{Tag, TagClass, CONSTRUCTED};
+
+    #[test]
+    fn test_constructed() {
+        for i in 0..31 {
+            let tag = Tag::constructed(u32::from(i));
+            assert_eq!(tag.as_u8(), Some(CONSTRUCTED | i));
+            assert!(tag.is_constructed());
+        }
+    }
+
+    #[test]
+    fn test_as_u8() {
+        for (t, expected) in &[
+            (Tag::new(5, TagClass::Application, true), Some(0x65)),
+            (Tag::new(5, TagClass::Universal, false), Some(0x05)),
+            (Tag::new(0x1f, TagClass::Universal, false), None),
+        ] {
+            assert_eq!(&t.as_u8(), expected);
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/asn1/src/types.rs 43.0.0-1ubuntu1/rust-vendor/asn1/src/types.rs
--- 43.0.0-1/rust-vendor/asn1/src/types.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1/src/types.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1988 @@
+#[cfg(not(feature = "std"))]
+use alloc::boxed::Box;
+#[cfg(not(feature = "std"))]
+use alloc::vec;
+#[cfg(not(feature = "std"))]
+use alloc::vec::Vec;
+use core::borrow::Borrow;
+use core::hash::{Hash, Hasher};
+use core::marker::PhantomData;
+use core::mem;
+
+use crate::writer::Writer;
+use crate::{
+    parse, parse_single, BitString, ObjectIdentifier, OwnedBitString, ParseError, ParseErrorKind,
+    ParseLocation, ParseResult, Parser, Tag, WriteBuf, WriteResult,
+};
+
+/// Any type that can be parsed as DER ASN.1.
+pub trait Asn1Readable<'a>: Sized {
+    fn parse(parser: &mut Parser<'a>) -> ParseResult<Self>;
+    fn can_parse(tag: Tag) -> bool;
+}
+
+/// Types with a fixed-tag that can be parsed as DER ASN.1
+pub trait SimpleAsn1Readable<'a>: Sized {
+    const TAG: Tag;
+
+    fn parse_data(data: &'a [u8]) -> ParseResult<Self>;
+}
+
+impl<'a, T: SimpleAsn1Readable<'a>> Asn1Readable<'a> for T {
+    #[inline]
+    fn parse(parser: &mut Parser<'a>) -> ParseResult<Self> {
+        let tlv = parser.read_tlv()?;
+        if !Self::can_parse(tlv.tag) {
+            return Err(ParseError::new(ParseErrorKind::UnexpectedTag {
+                actual: tlv.tag,
+            }));
+        }
+        Self::parse_data(tlv.data)
+    }
+
+    #[inline]
+    fn can_parse(tag: Tag) -> bool {
+        tag == Self::TAG
+    }
+}
+
+impl<'a, T: SimpleAsn1Readable<'a>> SimpleAsn1Readable<'a> for Box<T> {
+    const TAG: Tag = T::TAG;
+
+    fn parse_data(data: &'a [u8]) -> ParseResult<Self> {
+        Ok(Box::new(T::parse_data(data)?))
+    }
+}
+
+/// Any type that can be written as DER ASN.1.
+pub trait Asn1Writable: Sized {
+    fn write(&self, dest: &mut Writer<'_>) -> WriteResult;
+}
+
+// Types with a fixed-tag that can be written as DER ASN.1.
+pub trait SimpleAsn1Writable: Sized {
+    const TAG: Tag;
+
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult;
+}
+
+pub trait Asn1DefinedByReadable<'a, T: Asn1Readable<'a>>: Sized {
+    fn parse(item: T, parser: &mut Parser<'a>) -> ParseResult<Self>;
+}
+
+pub trait Asn1DefinedByWritable<T: Asn1Writable>: Sized {
+    fn item(&self) -> &T;
+    fn write(&self, dest: &mut Writer<'_>) -> WriteResult;
+}
+
+impl<T: SimpleAsn1Writable> Asn1Writable for T {
+    #[inline]
+    fn write(&self, w: &mut Writer<'_>) -> WriteResult {
+        w.write_tlv(Self::TAG, move |dest| self.write_data(dest))
+    }
+}
+
+impl<T: SimpleAsn1Writable> SimpleAsn1Writable for &T {
+    const TAG: Tag = T::TAG;
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        T::write_data(self, dest)
+    }
+}
+
+impl<T: SimpleAsn1Writable> SimpleAsn1Writable for Box<T> {
+    const TAG: Tag = T::TAG;
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        T::write_data(self, dest)
+    }
+}
+
+/// A TLV (type, length, value) represented as the tag and bytes content.
+/// Generally used for parsing ASN.1 `ANY` values.
+#[derive(Debug, PartialEq, Hash, Clone, Copy, Eq)]
+pub struct Tlv<'a> {
+    pub(crate) tag: Tag,
+    // `data` is the value of a TLV
+    pub(crate) data: &'a [u8],
+    // `full_data` contains the encoded type and length, in addition to the
+    // value
+    pub(crate) full_data: &'a [u8],
+}
+
+impl<'a> Tlv<'a> {
+    /// The tag portion of a TLV.
+    pub fn tag(&self) -> Tag {
+        self.tag
+    }
+    /// The value portion of the TLV.
+    pub fn data(&self) -> &'a [u8] {
+        self.data
+    }
+    /// The full DER encoded TLV.
+    pub fn full_data(&self) -> &'a [u8] {
+        self.full_data
+    }
+    /// Parse this TLV as a given type.
+    pub fn parse<T: Asn1Readable<'a>>(&self) -> ParseResult<T> {
+        parse_single::<T>(self.full_data)
+    }
+}
+
+impl<'a> Asn1Readable<'a> for Tlv<'a> {
+    #[inline]
+    fn parse(parser: &mut Parser<'a>) -> ParseResult<Self> {
+        parser.read_tlv()
+    }
+
+    #[inline]
+    fn can_parse(_tag: Tag) -> bool {
+        true
+    }
+}
+impl<'a> Asn1Writable for Tlv<'a> {
+    #[inline]
+    fn write(&self, w: &mut Writer<'_>) -> WriteResult {
+        w.write_tlv(self.tag, move |dest| dest.push_slice(self.data))
+    }
+}
+
+/// The ASN.1 NULL type, for use with `Parser.read_element` and
+/// `Writer.write_element`.
+pub type Null = ();
+
+impl SimpleAsn1Readable<'_> for Null {
+    const TAG: Tag = Tag::primitive(0x05);
+    #[inline]
+    fn parse_data(data: &[u8]) -> ParseResult<Null> {
+        if data.is_empty() {
+            Ok(())
+        } else {
+            Err(ParseError::new(ParseErrorKind::InvalidValue))
+        }
+    }
+}
+
+impl SimpleAsn1Writable for Null {
+    const TAG: Tag = Tag::primitive(0x05);
+    #[inline]
+    fn write_data(&self, _dest: &mut WriteBuf) -> WriteResult {
+        Ok(())
+    }
+}
+
+impl SimpleAsn1Readable<'_> for bool {
+    const TAG: Tag = Tag::primitive(0x1);
+    fn parse_data(data: &[u8]) -> ParseResult<bool> {
+        match data {
+            b"\x00" => Ok(false),
+            b"\xff" => Ok(true),
+            _ => Err(ParseError::new(ParseErrorKind::InvalidValue)),
+        }
+    }
+}
+
+impl SimpleAsn1Writable for bool {
+    const TAG: Tag = Tag::primitive(0x1);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        if *self {
+            dest.push_byte(0xff)
+        } else {
+            dest.push_byte(0x00)
+        }
+    }
+}
+
+impl<'a> SimpleAsn1Readable<'a> for &'a [u8] {
+    const TAG: Tag = Tag::primitive(0x04);
+    fn parse_data(data: &'a [u8]) -> ParseResult<&'a [u8]> {
+        Ok(data)
+    }
+}
+
+impl<'a> SimpleAsn1Writable for &'a [u8] {
+    const TAG: Tag = Tag::primitive(0x04);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        dest.push_slice(self)
+    }
+}
+
+impl<const N: usize> SimpleAsn1Readable<'_> for [u8; N] {
+    const TAG: Tag = Tag::primitive(0x04);
+    fn parse_data(data: &[u8]) -> ParseResult<[u8; N]> {
+        data.try_into()
+            .map_err(|_| ParseError::new(ParseErrorKind::InvalidValue))
+    }
+}
+
+impl<const N: usize> SimpleAsn1Writable for [u8; N] {
+    const TAG: Tag = Tag::primitive(0x04);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        dest.push_slice(self)
+    }
+}
+
+/// Represents values that are encoded as an `OCTET STRING` containing an
+/// encoded TLV, of type `T`.
+#[derive(PartialEq, Eq, Debug)]
+pub struct OctetStringEncoded<T>(T);
+
+impl<T> OctetStringEncoded<T> {
+    pub fn new(v: T) -> OctetStringEncoded<T> {
+        OctetStringEncoded(v)
+    }
+
+    pub fn get(&self) -> &T {
+        &self.0
+    }
+
+    pub fn into_inner(self) -> T {
+        self.0
+    }
+}
+
+impl<'a, T: Asn1Readable<'a>> SimpleAsn1Readable<'a> for OctetStringEncoded<T> {
+    const TAG: Tag = Tag::primitive(0x04);
+    fn parse_data(data: &'a [u8]) -> ParseResult<Self> {
+        Ok(OctetStringEncoded::new(parse_single(data)?))
+    }
+}
+
+impl<T: Asn1Writable> SimpleAsn1Writable for OctetStringEncoded<T> {
+    const TAG: Tag = Tag::primitive(0x04);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        self.0.write(&mut Writer::new(dest))
+    }
+}
+
+/// Type for use with `Parser.read_element` and `Writer.write_element` for
+/// handling ASN.1 `PrintableString`.  A `PrintableString` contains an `&str`
+/// with only valid characers.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct PrintableString<'a>(&'a str);
+
+impl<'a> PrintableString<'a> {
+    pub fn new(s: &'a str) -> Option<PrintableString<'a>> {
+        if PrintableString::verify(s.as_bytes()) {
+            Some(PrintableString(s))
+        } else {
+            None
+        }
+    }
+
+    fn new_from_bytes(s: &'a [u8]) -> Option<PrintableString<'a>> {
+        if PrintableString::verify(s) {
+            // TODO: This value is always valid utf-8 because we just verified
+            // the contents, but I don't want to call an unsafe function, so we
+            // end up validating it twice. If your profile says this is slow,
+            // now you know why.
+            Some(PrintableString(core::str::from_utf8(s).unwrap()))
+        } else {
+            None
+        }
+    }
+
+    pub fn as_str(&self) -> &'a str {
+        self.0
+    }
+
+    fn verify(data: &[u8]) -> bool {
+        for b in data {
+            match b {
+                b'A'..=b'Z'
+                | b'a'..=b'z'
+                | b'0'..=b'9'
+                | b' '
+                | b'\''
+                | b'('
+                | b')'
+                | b'+'
+                | b','
+                | b'-'
+                | b'.'
+                | b'/'
+                | b':'
+                | b'='
+                | b'?' => {}
+                _ => return false,
+            };
+        }
+        true
+    }
+}
+
+impl<'a> SimpleAsn1Readable<'a> for PrintableString<'a> {
+    const TAG: Tag = Tag::primitive(0x13);
+    fn parse_data(data: &'a [u8]) -> ParseResult<Self> {
+        PrintableString::new_from_bytes(data)
+            .ok_or_else(|| ParseError::new(ParseErrorKind::InvalidValue))
+    }
+}
+
+impl<'a> SimpleAsn1Writable for PrintableString<'a> {
+    const TAG: Tag = Tag::primitive(0x13);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        dest.push_slice(self.0.as_bytes())
+    }
+}
+
+/// Type for use with `Parser.read_element` and `Writer.write_element` for
+/// handling ASN.1 `IA5String`.  An `IA5String` contains an `&str`
+/// with only valid characers.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct IA5String<'a>(&'a str);
+
+impl<'a> IA5String<'a> {
+    pub fn new(s: &'a str) -> Option<IA5String<'a>> {
+        if IA5String::verify(s.as_bytes()) {
+            Some(IA5String(s))
+        } else {
+            None
+        }
+    }
+
+    fn new_from_bytes(s: &'a [u8]) -> Option<IA5String<'a>> {
+        if IA5String::verify(s) {
+            // TODO: This value is always valid utf-8 because we just verified
+            // the contents, but I don't want to call an unsafe function, so we
+            // end up validating it twice. If your profile says this is slow,
+            // now you know why.
+            Some(IA5String(core::str::from_utf8(s).unwrap()))
+        } else {
+            None
+        }
+    }
+
+    fn verify(s: &[u8]) -> bool {
+        s.is_ascii()
+    }
+
+    pub fn as_str(&self) -> &'a str {
+        self.0
+    }
+}
+
+impl<'a> SimpleAsn1Readable<'a> for IA5String<'a> {
+    const TAG: Tag = Tag::primitive(0x16);
+    fn parse_data(data: &'a [u8]) -> ParseResult<Self> {
+        IA5String::new_from_bytes(data).ok_or_else(|| ParseError::new(ParseErrorKind::InvalidValue))
+    }
+}
+impl<'a> SimpleAsn1Writable for IA5String<'a> {
+    const TAG: Tag = Tag::primitive(0x16);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        dest.push_slice(self.0.as_bytes())
+    }
+}
+
+/// Type for use with `Parser.read_element` and `Writer.write_element` for
+/// handling ASN.1 `UTF8String`.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct Utf8String<'a>(&'a str);
+
+impl<'a> Utf8String<'a> {
+    pub fn new(s: &'a str) -> Utf8String<'a> {
+        Utf8String(s)
+    }
+
+    fn new_from_bytes(s: &'a [u8]) -> Option<Utf8String<'a>> {
+        Some(Utf8String(core::str::from_utf8(s).ok()?))
+    }
+
+    pub fn as_str(&self) -> &'a str {
+        self.0
+    }
+}
+
+impl<'a> SimpleAsn1Readable<'a> for Utf8String<'a> {
+    const TAG: Tag = Tag::primitive(0x0c);
+    fn parse_data(data: &'a [u8]) -> ParseResult<Self> {
+        Utf8String::new_from_bytes(data)
+            .ok_or_else(|| ParseError::new(ParseErrorKind::InvalidValue))
+    }
+}
+impl<'a> SimpleAsn1Writable for Utf8String<'a> {
+    const TAG: Tag = Tag::primitive(0x0c);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        dest.push_slice(self.0.as_bytes())
+    }
+}
+
+/// Type for use with `Parser.read_element` and `Writer.write_element` for
+/// handling ASN.1 `VisibleString`.  An `VisibleString` contains an `&str`
+/// with only valid characers.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct VisibleString<'a>(&'a str);
+
+impl<'a> VisibleString<'a> {
+    pub fn new(s: &'a str) -> Option<VisibleString<'a>> {
+        if VisibleString::verify(s.as_bytes()) {
+            Some(VisibleString(s))
+        } else {
+            None
+        }
+    }
+
+    fn new_from_bytes(s: &'a [u8]) -> Option<VisibleString<'a>> {
+        if VisibleString::verify(s) {
+            // TODO: This value is always valid utf-8 because we just verified
+            // the contents, but I don't want to call an unsafe function, so we
+            // end up validating it twice. If your profile says this is slow,
+            // now you know why.
+            Some(VisibleString(core::str::from_utf8(s).unwrap()))
+        } else {
+            None
+        }
+    }
+
+    fn verify(s: &[u8]) -> bool {
+        for b in s {
+            if !(b.is_ascii_graphic() || *b == b' ') {
+                return false;
+            }
+        }
+        true
+    }
+
+    pub fn as_str(&self) -> &'a str {
+        self.0
+    }
+}
+
+impl<'a> SimpleAsn1Readable<'a> for VisibleString<'a> {
+    const TAG: Tag = Tag::primitive(0x1a);
+    fn parse_data(data: &'a [u8]) -> ParseResult<Self> {
+        VisibleString::new_from_bytes(data)
+            .ok_or_else(|| ParseError::new(ParseErrorKind::InvalidValue))
+    }
+}
+impl<'a> SimpleAsn1Writable for VisibleString<'a> {
+    const TAG: Tag = Tag::primitive(0x1a);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        dest.push_slice(self.0.as_bytes())
+    }
+}
+
+/// Type for use with `Parser.read_element` and `Writer.write_element` for
+/// handling ASN.1 `BMPString`. A `BMPString` contains encoded (UTF-16-BE)
+/// bytes which are known to be valid.
+#[derive(Debug, PartialEq, Clone, Eq)]
+pub struct BMPString<'a>(&'a [u8]);
+
+impl<'a> BMPString<'a> {
+    pub fn new(b: &'a [u8]) -> Option<BMPString<'a>> {
+        if BMPString::verify(b) {
+            Some(BMPString(b))
+        } else {
+            None
+        }
+    }
+
+    fn verify(b: &[u8]) -> bool {
+        if b.len() % 2 == 1 {
+            return false;
+        }
+
+        for r in core::char::decode_utf16(
+            b.chunks_exact(2)
+                .map(|v| u16::from_be_bytes(v.try_into().unwrap())),
+        ) {
+            if r.is_err() {
+                return false;
+            }
+        }
+
+        true
+    }
+
+    pub fn as_utf16_be_bytes(&self) -> &'a [u8] {
+        self.0
+    }
+}
+
+impl<'a> SimpleAsn1Readable<'a> for BMPString<'a> {
+    const TAG: Tag = Tag::primitive(0x1e);
+    fn parse_data(data: &'a [u8]) -> ParseResult<Self> {
+        BMPString::new(data).ok_or_else(|| ParseError::new(ParseErrorKind::InvalidValue))
+    }
+}
+impl<'a> SimpleAsn1Writable for BMPString<'a> {
+    const TAG: Tag = Tag::primitive(0x1e);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        dest.push_slice(self.as_utf16_be_bytes())
+    }
+}
+
+/// Type for use with `Parser.read_element` and `Writer.write_element` for
+/// handling ASN.1 `UniversalString`. A `UniversalString` contains encoded
+/// (UTF-32-BE) bytes which are known to be valid.
+#[derive(Debug, PartialEq, Clone, Eq)]
+pub struct UniversalString<'a>(&'a [u8]);
+
+impl<'a> UniversalString<'a> {
+    pub fn new(b: &'a [u8]) -> Option<UniversalString<'a>> {
+        if UniversalString::verify(b) {
+            Some(UniversalString(b))
+        } else {
+            None
+        }
+    }
+
+    fn verify(b: &[u8]) -> bool {
+        if b.len() % 4 != 0 {
+            return false;
+        }
+
+        for r in b
+            .chunks_exact(4)
+            .map(|v| u32::from_be_bytes(v.try_into().unwrap()))
+        {
+            if core::char::from_u32(r).is_none() {
+                return false;
+            }
+        }
+
+        true
+    }
+
+    pub fn as_utf32_be_bytes(&self) -> &'a [u8] {
+        self.0
+    }
+}
+
+impl<'a> SimpleAsn1Readable<'a> for UniversalString<'a> {
+    const TAG: Tag = Tag::primitive(0x1c);
+    fn parse_data(data: &'a [u8]) -> ParseResult<Self> {
+        UniversalString::new(data).ok_or_else(|| ParseError::new(ParseErrorKind::InvalidValue))
+    }
+}
+impl<'a> SimpleAsn1Writable for UniversalString<'a> {
+    const TAG: Tag = Tag::primitive(0x1c);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        dest.push_slice(self.as_utf32_be_bytes())
+    }
+}
+
+fn validate_integer(data: &[u8], signed: bool) -> ParseResult<()> {
+    if data.is_empty() {
+        return Err(ParseError::new(ParseErrorKind::InvalidValue));
+    }
+    // Ensure integer is minimally encoded
+    if data.len() > 1
+        && ((data[0] == 0 && data[1] & 0x80 == 0) || (data[0] == 0xff && data[1] & 0x80 == 0x80))
+    {
+        return Err(ParseError::new(ParseErrorKind::InvalidValue));
+    }
+
+    // Reject negatives for unsigned types.
+    if !signed && data[0] & 0x80 == 0x80 {
+        return Err(ParseError::new(ParseErrorKind::InvalidValue));
+    }
+
+    Ok(())
+}
+
+macro_rules! impl_asn1_element_for_int {
+    ($t:ty; $signed:expr) => {
+        impl SimpleAsn1Readable<'_> for $t {
+            const TAG: Tag = Tag::primitive(0x02);
+            #[inline]
+            fn parse_data(mut data: &[u8]) -> ParseResult<Self> {
+                validate_integer(data, $signed)?;
+
+                // If we've got something like \x00\xff trim off the first \x00, since it's just
+                // there to not mark the value as a negative.
+                if !$signed && data.len() == mem::size_of::<Self>() + 1 && data[0] == 0 {
+                    data = &data[1..];
+                }
+                if data.len() > mem::size_of::<Self>() {
+                    return Err(ParseError::new(ParseErrorKind::IntegerOverflow));
+                }
+
+                let mut fixed_data = [0; mem::size_of::<$t>()];
+                fixed_data[mem::size_of::<Self>() - data.len()..].copy_from_slice(data);
+                let mut ret = Self::from_be_bytes(fixed_data);
+                // Shift up and down in order to sign extend the result.
+                ret <<= (8 * mem::size_of::<Self>()) - data.len() * 8;
+                ret >>= (8 * mem::size_of::<Self>()) - data.len() * 8;
+                Ok(ret)
+            }
+        }
+        impl SimpleAsn1Writable for $t {
+            const TAG: Tag = Tag::primitive(0x02);
+            fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+                let mut num_bytes = 1;
+                let mut v: $t = *self;
+                #[allow(unused_comparisons)]
+                while v > 127 || ($signed && v < (-128i64) as $t) {
+                    num_bytes += 1;
+                    v = v.checked_shr(8).unwrap_or(0);
+                }
+
+                for i in (1..=num_bytes).rev() {
+                    let digit = self.checked_shr((i - 1) * 8).unwrap_or(0);
+                    dest.push_byte(digit as u8)?;
+                }
+                Ok(())
+            }
+        }
+    };
+}
+
+impl_asn1_element_for_int!(i8; true);
+impl_asn1_element_for_int!(u8; false);
+impl_asn1_element_for_int!(i16; true);
+impl_asn1_element_for_int!(u16; false);
+impl_asn1_element_for_int!(i32; true);
+impl_asn1_element_for_int!(u32; false);
+impl_asn1_element_for_int!(i64; true);
+impl_asn1_element_for_int!(u64; false);
+
+/// Arbitrary sized unsigned integer. Contents may be accessed as `&[u8]` of
+/// big-endian data. Its contents always match the DER encoding of a value
+/// (i.e. they are minimal)
+#[derive(PartialEq, Clone, Copy, Debug, Hash, Eq)]
+pub struct BigUint<'a> {
+    data: &'a [u8],
+}
+
+impl<'a> BigUint<'a> {
+    /// Create a new `BigUint` from already encoded data. `data` must be encoded
+    /// as required by DER: minimally and if the high bit would be set in the
+    /// first octet, a leading `\x00` should be prepended (to disambiguate from
+    /// negative values).
+    pub fn new(data: &'a [u8]) -> Option<Self> {
+        validate_integer(data, false).ok()?;
+        Some(BigUint { data })
+    }
+
+    /// Returns the contents of the integer as big-endian bytes.
+    pub fn as_bytes(&self) -> &'a [u8] {
+        self.data
+    }
+}
+
+impl<'a> SimpleAsn1Readable<'a> for BigUint<'a> {
+    const TAG: Tag = Tag::primitive(0x02);
+    fn parse_data(data: &'a [u8]) -> ParseResult<Self> {
+        BigUint::new(data).ok_or_else(|| ParseError::new(ParseErrorKind::InvalidValue))
+    }
+}
+impl<'a> SimpleAsn1Writable for BigUint<'a> {
+    const TAG: Tag = Tag::primitive(0x02);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        dest.push_slice(self.as_bytes())
+    }
+}
+
+/// Arbitrary sized unsigned integer which owns its data. Contents may be
+/// accessed as `&[u8]` of big-endian data. Its contents always match the DER
+/// encoding of a value (i.e. they are minimal)
+#[derive(PartialEq, Clone, Debug, Hash, Eq)]
+pub struct OwnedBigUint {
+    data: Vec<u8>,
+}
+
+impl OwnedBigUint {
+    /// Create a new `OwnedBigUint` from already encoded data. `data` must be
+    /// encoded as required by DER: minimally and if the high bit would be set
+    /// in the first octet, a leading `\x00` should be prepended (to
+    /// disambiguate from negative values).
+    pub fn new(data: Vec<u8>) -> Option<Self> {
+        validate_integer(&data, false).ok()?;
+        Some(OwnedBigUint { data })
+    }
+
+    /// Returns the contents of the integer as big-endian bytes.
+    pub fn as_bytes(&self) -> &[u8] {
+        &self.data
+    }
+}
+
+impl SimpleAsn1Readable<'_> for OwnedBigUint {
+    const TAG: Tag = Tag::primitive(0x02);
+    fn parse_data(data: &[u8]) -> ParseResult<Self> {
+        OwnedBigUint::new(data.to_vec())
+            .ok_or_else(|| ParseError::new(ParseErrorKind::InvalidValue))
+    }
+}
+impl SimpleAsn1Writable for OwnedBigUint {
+    const TAG: Tag = Tag::primitive(0x02);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        dest.push_slice(self.as_bytes())
+    }
+}
+
+/// Arbitrary sized signed integer. Contents may be accessed as `&[u8]` of
+/// big-endian data. Its contents always match the DER encoding of a value
+/// (i.e. they are minimal)
+#[derive(PartialEq, Clone, Copy, Debug, Hash, Eq)]
+pub struct BigInt<'a> {
+    data: &'a [u8],
+}
+
+impl<'a> BigInt<'a> {
+    /// Create a new `BigInt` from already encoded data. `data` must be encoded
+    /// as required by DER: minimally and if the high bit would be set in the
+    /// first octet, a leading `\x00` should be prepended (to disambiguate from
+    /// negative values).
+    pub fn new(data: &'a [u8]) -> Option<Self> {
+        validate_integer(data, true).ok()?;
+        Some(BigInt { data })
+    }
+
+    /// Returns the contents of the integer as big-endian bytes.
+    pub fn as_bytes(&self) -> &'a [u8] {
+        self.data
+    }
+
+    /// Returns a boolean indicating whether the integer is negative.
+    pub fn is_negative(&self) -> bool {
+        self.data[0] & 0x80 == 0x80
+    }
+}
+
+impl<'a> SimpleAsn1Readable<'a> for BigInt<'a> {
+    const TAG: Tag = Tag::primitive(0x02);
+    fn parse_data(data: &'a [u8]) -> ParseResult<Self> {
+        BigInt::new(data).ok_or_else(|| ParseError::new(ParseErrorKind::InvalidValue))
+    }
+}
+impl<'a> SimpleAsn1Writable for BigInt<'a> {
+    const TAG: Tag = Tag::primitive(0x02);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        dest.push_slice(self.as_bytes())
+    }
+}
+
+/// Arbitrary sized signed integer which owns its contents. Contents may be
+/// accessed as `&[u8]` of big-endian data. Its contents always match the DER
+/// encoding of a value (i.e. they are minimal)
+#[derive(PartialEq, Clone, Debug, Hash, Eq)]
+pub struct OwnedBigInt {
+    data: Vec<u8>,
+}
+
+impl OwnedBigInt {
+    /// Create a new `OwnedBigInt` from already encoded data. `data` must be
+    /// encoded as required by DER: minimally and if the high bit would be set
+    /// in the first octet, a leading `\x00` should be prepended (to
+    /// disambiguate from negative values).
+    pub fn new(data: Vec<u8>) -> Option<Self> {
+        validate_integer(&data, true).ok()?;
+        Some(OwnedBigInt { data })
+    }
+
+    /// Returns the contents of the integer as big-endian bytes.
+    pub fn as_bytes(&self) -> &[u8] {
+        &self.data
+    }
+
+    /// Returns a boolean indicating whether the integer is negative.
+    pub fn is_negative(&self) -> bool {
+        self.data[0] & 0x80 == 0x80
+    }
+}
+
+impl SimpleAsn1Readable<'_> for OwnedBigInt {
+    const TAG: Tag = Tag::primitive(0x02);
+    fn parse_data(data: &[u8]) -> ParseResult<Self> {
+        OwnedBigInt::new(data.to_vec()).ok_or_else(|| ParseError::new(ParseErrorKind::InvalidValue))
+    }
+}
+impl SimpleAsn1Writable for OwnedBigInt {
+    const TAG: Tag = Tag::primitive(0x02);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        dest.push_slice(self.as_bytes())
+    }
+}
+
+impl<'a> SimpleAsn1Readable<'a> for ObjectIdentifier {
+    const TAG: Tag = Tag::primitive(0x06);
+    fn parse_data(data: &'a [u8]) -> ParseResult<ObjectIdentifier> {
+        ObjectIdentifier::from_der(data)
+    }
+}
+impl SimpleAsn1Writable for ObjectIdentifier {
+    const TAG: Tag = Tag::primitive(0x06);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        dest.push_slice(self.as_der())
+    }
+}
+
+impl<'a> SimpleAsn1Readable<'a> for BitString<'a> {
+    const TAG: Tag = Tag::primitive(0x03);
+    fn parse_data(data: &'a [u8]) -> ParseResult<BitString<'a>> {
+        if data.is_empty() {
+            return Err(ParseError::new(ParseErrorKind::InvalidValue));
+        }
+        BitString::new(&data[1..], data[0])
+            .ok_or_else(|| ParseError::new(ParseErrorKind::InvalidValue))
+    }
+}
+impl<'a> SimpleAsn1Writable for BitString<'a> {
+    const TAG: Tag = Tag::primitive(0x03);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        dest.push_byte(self.padding_bits())?;
+        dest.push_slice(self.as_bytes())
+    }
+}
+impl<'a> SimpleAsn1Readable<'a> for OwnedBitString {
+    const TAG: Tag = Tag::primitive(0x03);
+    fn parse_data(data: &'a [u8]) -> ParseResult<OwnedBitString> {
+        let bs = BitString::parse_data(data)?;
+        Ok(OwnedBitString::new(bs.as_bytes().to_vec(), bs.padding_bits()).unwrap())
+    }
+}
+impl SimpleAsn1Writable for OwnedBitString {
+    const TAG: Tag = Tag::primitive(0x03);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        self.as_bitstring().write_data(dest)
+    }
+}
+
+fn read_byte(data: &mut &[u8]) -> ParseResult<u8> {
+    if data.is_empty() {
+        return Err(ParseError::new(ParseErrorKind::InvalidValue));
+    }
+    let result = Ok(data[0]);
+    *data = &data[1..];
+    result
+}
+
+fn read_digit(data: &mut &[u8]) -> ParseResult<u8> {
+    let b = read_byte(data)?;
+    if !b.is_ascii_digit() {
+        return Err(ParseError::new(ParseErrorKind::InvalidValue));
+    }
+    Ok(b - b'0')
+}
+
+fn read_2_digits(data: &mut &[u8]) -> ParseResult<u8> {
+    Ok(read_digit(data)? * 10 + read_digit(data)?)
+}
+
+fn read_4_digits(data: &mut &[u8]) -> ParseResult<u16> {
+    Ok(u16::from(read_digit(data)?) * 1000
+        + u16::from(read_digit(data)?) * 100
+        + u16::from(read_digit(data)?) * 10
+        + u16::from(read_digit(data)?))
+}
+
+fn validate_date(year: u16, month: u8, day: u8) -> ParseResult<()> {
+    if day < 1 {
+        return Err(ParseError::new(ParseErrorKind::InvalidValue));
+    }
+    let days_in_month = match month {
+        1 | 3 | 5 | 7 | 8 | 10 | 12 => 31,
+        4 | 6 | 9 | 11 => 30,
+        2 => {
+            if (year % 4 == 0 && year % 100 != 0) || year % 400 == 0 {
+                29
+            } else {
+                28
+            }
+        }
+        _ => return Err(ParseError::new(ParseErrorKind::InvalidValue)),
+    };
+    if day > days_in_month {
+        return Err(ParseError::new(ParseErrorKind::InvalidValue));
+    }
+
+    Ok(())
+}
+
+fn read_tz_and_finish(data: &mut &[u8]) -> ParseResult<()> {
+    if read_byte(data)? != b'Z' {
+        return Err(ParseError::new(ParseErrorKind::InvalidValue));
+    }
+
+    if !data.is_empty() {
+        return Err(ParseError::new(ParseErrorKind::InvalidValue));
+    }
+    Ok(())
+}
+
+fn push_two_digits(dest: &mut WriteBuf, val: u8) -> WriteResult {
+    dest.push_byte(b'0' + ((val / 10) % 10))?;
+    dest.push_byte(b'0' + (val % 10))
+}
+
+fn push_four_digits(dest: &mut WriteBuf, val: u16) -> WriteResult {
+    dest.push_byte(b'0' + ((val / 1000) % 10) as u8)?;
+    dest.push_byte(b'0' + ((val / 100) % 10) as u8)?;
+    dest.push_byte(b'0' + ((val / 10) % 10) as u8)?;
+    dest.push_byte(b'0' + (val % 10) as u8)
+}
+
+/// A structure representing a (UTC timezone) date and time.
+/// Wrapped by `UtcTime` and `GeneralizedTime`.
+#[derive(Debug, Clone, PartialEq, Hash, Eq, PartialOrd)]
+pub struct DateTime {
+    year: u16,
+    month: u8,
+    day: u8,
+    hour: u8,
+    minute: u8,
+    second: u8,
+}
+
+impl DateTime {
+    pub fn new(
+        year: u16,
+        month: u8,
+        day: u8,
+        hour: u8,
+        minute: u8,
+        second: u8,
+    ) -> ParseResult<DateTime> {
+        validate_date(year, month, day)?;
+        if hour > 23 || minute > 59 || second > 59 {
+            return Err(ParseError::new(ParseErrorKind::InvalidValue));
+        }
+        Ok(DateTime {
+            year,
+            month,
+            day,
+            hour,
+            minute,
+            second,
+        })
+    }
+
+    /// The calendar year.
+    pub fn year(&self) -> u16 {
+        self.year
+    }
+
+    /// The calendar month (1 to 12).
+    pub fn month(&self) -> u8 {
+        self.month
+    }
+
+    /// The calendar day (1 to 31).
+    pub fn day(&self) -> u8 {
+        self.day
+    }
+
+    /// The clock hour (0 to 23).
+    pub fn hour(&self) -> u8 {
+        self.hour
+    }
+
+    /// The clock minute (0 to 59).
+    pub fn minute(&self) -> u8 {
+        self.minute
+    }
+
+    /// The clock second (0 to 59).
+    pub fn second(&self) -> u8 {
+        self.second
+    }
+}
+
+/// Used for parsing and writing ASN.1 `UTC TIME` values. Wraps a
+/// `DateTime`.
+#[derive(Debug, Clone, PartialEq, Hash, Eq)]
+pub struct UtcTime(DateTime);
+
+impl UtcTime {
+    pub fn new(dt: DateTime) -> ParseResult<UtcTime> {
+        if dt.year() < 1950 || dt.year() >= 2050 {
+            return Err(ParseError::new(ParseErrorKind::InvalidValue));
+        }
+        Ok(UtcTime(dt))
+    }
+
+    pub fn as_datetime(&self) -> &DateTime {
+        &self.0
+    }
+}
+
+impl SimpleAsn1Readable<'_> for UtcTime {
+    const TAG: Tag = Tag::primitive(0x17);
+    fn parse_data(mut data: &[u8]) -> ParseResult<Self> {
+        let year = u16::from(read_2_digits(&mut data)?);
+        let month = read_2_digits(&mut data)?;
+        let day = read_2_digits(&mut data)?;
+        // UTCTime only encodes times prior to 2050. We use the X.509 mapping of two-digit
+        // year ordinals to full year:
+        // https://tools.ietf.org/html/rfc5280#section-4.1.2.5.1
+        let year = if year >= 50 { 1900 + year } else { 2000 + year };
+        let hour = read_2_digits(&mut data)?;
+        let minute = read_2_digits(&mut data)?;
+        let second = read_2_digits(&mut data)?;
+
+        read_tz_and_finish(&mut data)?;
+
+        UtcTime::new(DateTime::new(year, month, day, hour, minute, second)?)
+    }
+}
+
+impl SimpleAsn1Writable for UtcTime {
+    const TAG: Tag = Tag::primitive(0x17);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        let dt = self.as_datetime();
+        let year = if 1950 <= dt.year() && dt.year() < 2000 {
+            dt.year() - 1900
+        } else {
+            assert!(2000 <= dt.year() && dt.year() < 2050);
+            dt.year() - 2000
+        };
+        push_two_digits(dest, year.try_into().unwrap())?;
+        push_two_digits(dest, dt.month())?;
+        push_two_digits(dest, dt.day())?;
+
+        push_two_digits(dest, dt.hour())?;
+        push_two_digits(dest, dt.minute())?;
+        push_two_digits(dest, dt.second())?;
+
+        dest.push_byte(b'Z')
+    }
+}
+
+/// Used for parsing and writing ASN.1 `GENERALIZED TIME` values. Wraps a
+/// `DateTime`.
+#[derive(Debug, Clone, PartialEq, Hash, Eq)]
+pub struct GeneralizedTime(DateTime);
+
+impl GeneralizedTime {
+    pub fn new(dt: DateTime) -> ParseResult<GeneralizedTime> {
+        Ok(GeneralizedTime(dt))
+    }
+
+    pub fn as_datetime(&self) -> &DateTime {
+        &self.0
+    }
+}
+
+impl SimpleAsn1Readable<'_> for GeneralizedTime {
+    const TAG: Tag = Tag::primitive(0x18);
+    fn parse_data(mut data: &[u8]) -> ParseResult<GeneralizedTime> {
+        let year = read_4_digits(&mut data)?;
+        let month = read_2_digits(&mut data)?;
+        let day = read_2_digits(&mut data)?;
+        let hour = read_2_digits(&mut data)?;
+        let minute = read_2_digits(&mut data)?;
+        let second = read_2_digits(&mut data)?;
+
+        read_tz_and_finish(&mut data)?;
+
+        GeneralizedTime::new(DateTime::new(year, month, day, hour, minute, second)?)
+    }
+}
+
+impl SimpleAsn1Writable for GeneralizedTime {
+    const TAG: Tag = Tag::primitive(0x18);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        let dt = self.as_datetime();
+        push_four_digits(dest, dt.year())?;
+        push_two_digits(dest, dt.month())?;
+        push_two_digits(dest, dt.day())?;
+
+        push_two_digits(dest, dt.hour())?;
+        push_two_digits(dest, dt.minute())?;
+        push_two_digits(dest, dt.second())?;
+
+        dest.push_byte(b'Z')
+    }
+}
+
+/// An ASN.1 `ENUMERATED` value.
+#[derive(Debug, PartialEq, Eq)]
+pub struct Enumerated(u32);
+
+impl Enumerated {
+    pub fn new(v: u32) -> Enumerated {
+        Enumerated(v)
+    }
+
+    pub fn value(&self) -> u32 {
+        self.0
+    }
+}
+
+impl<'a> SimpleAsn1Readable<'a> for Enumerated {
+    const TAG: Tag = Tag::primitive(0xa);
+
+    fn parse_data(data: &'a [u8]) -> ParseResult<Enumerated> {
+        Ok(Enumerated::new(u32::parse_data(data)?))
+    }
+}
+
+impl SimpleAsn1Writable for Enumerated {
+    const TAG: Tag = Tag::primitive(0xa);
+
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        u32::write_data(&self.value(), dest)
+    }
+}
+
+impl<'a, T: Asn1Readable<'a>> Asn1Readable<'a> for Option<T> {
+    fn parse(parser: &mut Parser<'a>) -> ParseResult<Self> {
+        match parser.peek_tag() {
+            Some(tag) if Self::can_parse(tag) => Ok(Some(parser.read_element::<T>()?)),
+            Some(_) | None => Ok(None),
+        }
+    }
+
+    #[inline]
+    fn can_parse(tag: Tag) -> bool {
+        T::can_parse(tag)
+    }
+}
+
+impl<T: Asn1Writable> Asn1Writable for Option<T> {
+    #[inline]
+    fn write(&self, w: &mut Writer<'_>) -> WriteResult {
+        if let Some(v) = self {
+            w.write_element(v)
+        } else {
+            Ok(())
+        }
+    }
+}
+
+macro_rules! declare_choice {
+    ($count:ident => $(($number:ident $name:ident)),*) => {
+        /// Represents an ASN.1 `CHOICE` with the provided number of potential types.
+        ///
+        /// If you need more variants than are provided, please file an issue or submit a pull
+        /// request!
+        #[derive(Debug, PartialEq, Eq)]
+        pub enum $count<
+            $($number,)*
+        > {
+            $(
+                $name($number),
+            )*
+        }
+
+        impl<
+            'a,
+            $(
+                $number: Asn1Readable<'a>,
+            )*
+        > Asn1Readable<'a> for $count<$($number,)*> {
+            fn parse(parser: &mut Parser<'a>) -> ParseResult<Self> {
+                let tlv = parser.read_tlv()?;
+                $(
+                    if $number::can_parse(tlv.tag()) {
+                        return Ok($count::$name(tlv.parse::<$number>()?));
+                    }
+                )*
+                Err(ParseError::new(ParseErrorKind::UnexpectedTag{actual: tlv.tag()}))
+            }
+
+            fn can_parse(tag: Tag) -> bool {
+                $(
+                    if $number::can_parse(tag) {
+                        return true;
+                    }
+                )*
+                false
+            }
+        }
+
+        impl<
+            $(
+                $number: Asn1Writable,
+            )*
+        > Asn1Writable for $count<$($number,)*> {
+            fn write(&self, w: &mut Writer<'_>) -> WriteResult {
+                match self {
+                    $(
+                        $count::$name(v) => w.write_element(v),
+                    )*
+                }
+            }
+        }
+    }
+}
+
+declare_choice!(Choice1 => (T1 ChoiceA));
+declare_choice!(Choice2 => (T1 ChoiceA), (T2 ChoiceB));
+declare_choice!(Choice3 => (T1 ChoiceA), (T2 ChoiceB), (T3 ChoiceC));
+
+/// Represents an ASN.1 `SEQUENCE`. By itself, this merely indicates a sequence of bytes that are
+/// claimed to form an ASN1 sequence. In almost any circumstance, you'll want to immediately call
+/// `Sequence.parse` on this value to decode the actual contents therein.
+#[derive(Debug, PartialEq, Hash, Clone, Eq)]
+pub struct Sequence<'a> {
+    data: &'a [u8],
+}
+
+impl<'a> Sequence<'a> {
+    #[inline]
+    pub(crate) fn new(data: &'a [u8]) -> Sequence<'a> {
+        Sequence { data }
+    }
+
+    /// Parses the contents of the `Sequence`. Behaves the same as the module-level `parse`
+    /// function.
+    pub fn parse<T, E: From<ParseError>, F: Fn(&mut Parser<'a>) -> Result<T, E>>(
+        self,
+        f: F,
+    ) -> Result<T, E> {
+        parse(self.data, f)
+    }
+}
+
+impl<'a> SimpleAsn1Readable<'a> for Sequence<'a> {
+    const TAG: Tag = Tag::constructed(0x10);
+    #[inline]
+    fn parse_data(data: &'a [u8]) -> ParseResult<Sequence<'a>> {
+        Ok(Sequence::new(data))
+    }
+}
+impl<'a> SimpleAsn1Writable for Sequence<'a> {
+    const TAG: Tag = Tag::constructed(0x10);
+    #[inline]
+    fn write_data(&self, data: &mut WriteBuf) -> WriteResult {
+        data.push_slice(self.data)
+    }
+}
+
+/// Writes an ASN.1 `SEQUENCE` using a callback that writes the inner
+/// elements.
+pub struct SequenceWriter<'a> {
+    f: &'a dyn Fn(&mut Writer<'_>) -> WriteResult,
+}
+
+impl<'a> SequenceWriter<'a> {
+    #[inline]
+    pub fn new(f: &'a dyn Fn(&mut Writer<'_>) -> WriteResult) -> Self {
+        SequenceWriter { f }
+    }
+}
+
+impl<'a> SimpleAsn1Writable for SequenceWriter<'a> {
+    const TAG: Tag = Tag::constructed(0x10);
+    #[inline]
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        (self.f)(&mut Writer::new(dest))
+    }
+}
+
+/// Represents an ASN.1 `SEQUENCE OF`. This is an `Iterator` over values that
+/// are decoded.
+pub struct SequenceOf<'a, T: Asn1Readable<'a>> {
+    parser: Parser<'a>,
+    length: usize,
+    _phantom: PhantomData<T>,
+}
+
+impl<'a, T: Asn1Readable<'a>> SequenceOf<'a, T> {
+    #[inline]
+    pub(crate) fn new(data: &'a [u8]) -> ParseResult<SequenceOf<'a, T>> {
+        let length = parse(data, |p| {
+            let mut i = 0;
+            while !p.is_empty() {
+                p.read_element::<T>()
+                    .map_err(|e| e.add_location(ParseLocation::Index(i)))?;
+                i += 1;
+            }
+            Ok(i)
+        })?;
+
+        Ok(SequenceOf {
+            length,
+            parser: Parser::new(data),
+            _phantom: PhantomData,
+        })
+    }
+
+    pub fn len(&self) -> usize {
+        self.length
+    }
+
+    pub fn is_empty(&self) -> bool {
+        self.len() == 0
+    }
+}
+
+impl<'a, T: Asn1Readable<'a>> Clone for SequenceOf<'a, T> {
+    fn clone(&self) -> SequenceOf<'a, T> {
+        SequenceOf {
+            parser: self.parser.clone_internal(),
+            length: self.length,
+            _phantom: PhantomData,
+        }
+    }
+}
+
+impl<'a, T: Asn1Readable<'a> + PartialEq> PartialEq for SequenceOf<'a, T> {
+    fn eq(&self, other: &Self) -> bool {
+        let mut it1 = self.clone();
+        let mut it2 = other.clone();
+        loop {
+            match (it1.next(), it2.next()) {
+                (Some(v1), Some(v2)) => {
+                    if v1 != v2 {
+                        return false;
+                    }
+                }
+                (None, None) => return true,
+                _ => return false,
+            }
+        }
+    }
+}
+
+impl<'a, T: Asn1Readable<'a> + Eq> Eq for SequenceOf<'a, T> {}
+
+impl<'a, T: Asn1Readable<'a> + Hash> Hash for SequenceOf<'a, T> {
+    fn hash<H: Hasher>(&self, state: &mut H) {
+        for val in self.clone() {
+            val.hash(state);
+        }
+    }
+}
+
+impl<'a, T: Asn1Readable<'a> + 'a> SimpleAsn1Readable<'a> for SequenceOf<'a, T> {
+    const TAG: Tag = Tag::constructed(0x10);
+    #[inline]
+    fn parse_data(data: &'a [u8]) -> ParseResult<Self> {
+        SequenceOf::new(data)
+    }
+}
+
+impl<'a, T: Asn1Readable<'a>> Iterator for SequenceOf<'a, T> {
+    type Item = T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        if self.parser.is_empty() {
+            return None;
+        }
+        self.length -= 1;
+        Some(
+            self.parser
+                .read_element::<T>()
+                .expect("Should always succeed"),
+        )
+    }
+}
+
+impl<'a, T: Asn1Readable<'a> + Asn1Writable> SimpleAsn1Writable for SequenceOf<'a, T> {
+    const TAG: Tag = Tag::constructed(0x10);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        let mut w = Writer::new(dest);
+        for el in self.clone() {
+            w.write_element(&el)?;
+        }
+
+        Ok(())
+    }
+}
+
+/// Writes a `SEQUENCE OF` ASN.1 structure from a slice of `T`.
+#[derive(Hash, PartialEq, Eq, Clone)]
+pub struct SequenceOfWriter<'a, T: Asn1Writable, V: Borrow<[T]> = &'a [T]> {
+    vals: V,
+    _phantom: PhantomData<&'a T>,
+}
+
+impl<'a, T: Asn1Writable, V: Borrow<[T]>> SequenceOfWriter<'a, T, V> {
+    pub fn new(vals: V) -> Self {
+        SequenceOfWriter {
+            vals,
+            _phantom: PhantomData,
+        }
+    }
+}
+
+impl<'a, T: Asn1Writable, V: Borrow<[T]>> SimpleAsn1Writable for SequenceOfWriter<'a, T, V> {
+    const TAG: Tag = Tag::constructed(0x10);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        let mut w = Writer::new(dest);
+        for el in self.vals.borrow() {
+            w.write_element(el)?;
+        }
+
+        Ok(())
+    }
+}
+
+/// Represents an ASN.1 `SET OF`. This is an `Iterator` over values that
+/// are decoded.
+pub struct SetOf<'a, T: Asn1Readable<'a>> {
+    parser: Parser<'a>,
+    _phantom: PhantomData<T>,
+}
+
+impl<'a, T: Asn1Readable<'a>> SetOf<'a, T> {
+    #[inline]
+    pub(crate) fn new(data: &'a [u8]) -> SetOf<'a, T> {
+        SetOf {
+            parser: Parser::new(data),
+            _phantom: PhantomData,
+        }
+    }
+}
+
+impl<'a, T: Asn1Readable<'a>> Clone for SetOf<'a, T> {
+    fn clone(&self) -> SetOf<'a, T> {
+        SetOf {
+            parser: self.parser.clone_internal(),
+            _phantom: PhantomData,
+        }
+    }
+}
+
+impl<'a, T: Asn1Readable<'a> + PartialEq> PartialEq for SetOf<'a, T> {
+    fn eq(&self, other: &Self) -> bool {
+        let mut it1 = self.clone();
+        let mut it2 = other.clone();
+        loop {
+            match (it1.next(), it2.next()) {
+                (Some(v1), Some(v2)) => {
+                    if v1 != v2 {
+                        return false;
+                    }
+                }
+                (None, None) => return true,
+                _ => return false,
+            }
+        }
+    }
+}
+
+impl<'a, T: Asn1Readable<'a> + Eq> Eq for SetOf<'a, T> {}
+
+impl<'a, T: Asn1Readable<'a> + Hash> Hash for SetOf<'a, T> {
+    fn hash<H: Hasher>(&self, state: &mut H) {
+        for val in self.clone() {
+            val.hash(state);
+        }
+    }
+}
+
+impl<'a, T: Asn1Readable<'a> + 'a> SimpleAsn1Readable<'a> for SetOf<'a, T> {
+    const TAG: Tag = Tag::constructed(0x11);
+
+    #[inline]
+    fn parse_data(data: &'a [u8]) -> ParseResult<Self> {
+        parse(data, |p| {
+            let mut last_element: Option<Tlv<'a>> = None;
+            let mut i = 0;
+            while !p.is_empty() {
+                let el = p
+                    .read_tlv()
+                    .map_err(|e| e.add_location(ParseLocation::Index(i)))?;
+                if let Some(last_el) = last_element {
+                    if el.full_data < last_el.full_data {
+                        return Err(ParseError::new(ParseErrorKind::InvalidSetOrdering)
+                            .add_location(ParseLocation::Index(i)));
+                    }
+                }
+                last_element = Some(el);
+                el.parse::<T>()
+                    .map_err(|e| e.add_location(ParseLocation::Index(i)))?;
+                i += 1;
+            }
+            Ok(())
+        })?;
+        Ok(SetOf::new(data))
+    }
+}
+
+impl<'a, T: Asn1Readable<'a>> Iterator for SetOf<'a, T> {
+    type Item = T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        if self.parser.is_empty() {
+            return None;
+        }
+        Some(
+            self.parser
+                .read_element::<T>()
+                .expect("Should always succeed"),
+        )
+    }
+}
+
+impl<'a, T: Asn1Readable<'a> + Asn1Writable> SimpleAsn1Writable for SetOf<'a, T> {
+    const TAG: Tag = Tag::constructed(0x11);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        let mut w = Writer::new(dest);
+        // We are known to be ordered correctly because that's an invariant for
+        // `self`, so we don't need to sort here.
+        for el in self.clone() {
+            w.write_element(&el)?;
+        }
+
+        Ok(())
+    }
+}
+
+/// Writes an ASN.1 `SET OF` whose contents is a slice of `T`. This type handles
+/// ensuring that the values are properly ordered when written as DER.
+#[derive(Hash, PartialEq, Eq, Clone)]
+pub struct SetOfWriter<'a, T: Asn1Writable, V: Borrow<[T]> = &'a [T]> {
+    vals: V,
+    _phantom: PhantomData<&'a T>,
+}
+
+impl<'a, T: Asn1Writable, V: Borrow<[T]>> SetOfWriter<'a, T, V> {
+    pub fn new(vals: V) -> Self {
+        SetOfWriter {
+            vals,
+            _phantom: PhantomData,
+        }
+    }
+}
+
+impl<'a, T: Asn1Writable, V: Borrow<[T]>> SimpleAsn1Writable for SetOfWriter<'a, T, V> {
+    const TAG: Tag = Tag::constructed(0x11);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        let vals = self.vals.borrow();
+        if vals.is_empty() {
+            return Ok(());
+        } else if vals.len() == 1 {
+            let mut w = Writer::new(dest);
+            w.write_element(&vals[0])?;
+            return Ok(());
+        }
+
+        // Optimization: use the dest storage as scratch, then truncate.
+        let mut data = WriteBuf::new(vec![]);
+        let mut w = Writer::new(&mut data);
+        // Optimization opportunity: use a SmallVec here.
+        let mut spans = vec![];
+
+        let mut pos = 0;
+        for el in vals {
+            w.write_element(el)?;
+            let l = w.buf.len();
+            spans.push(pos..l);
+            pos = l;
+        }
+        let data = data.as_slice();
+        spans.sort_by_key(|v| &data[v.clone()]);
+        for span in spans {
+            dest.push_slice(&data[span])?;
+        }
+
+        Ok(())
+    }
+}
+
+/// `Implicit` is a type which wraps another ASN.1 type, indicating that the tag is an ASN.1
+/// `IMPLICIT`. This will generally be used with `Option` or `Choice`.
+#[derive(PartialEq, Eq, Debug)]
+pub struct Implicit<T, const TAG: u32> {
+    inner: T,
+}
+
+impl<T, const TAG: u32> Implicit<T, { TAG }> {
+    pub fn new(v: T) -> Self {
+        Implicit { inner: v }
+    }
+
+    pub fn as_inner(&self) -> &T {
+        &self.inner
+    }
+
+    pub fn into_inner(self) -> T {
+        self.inner
+    }
+}
+
+impl<T, const TAG: u32> From<T> for Implicit<T, { TAG }> {
+    fn from(v: T) -> Self {
+        Implicit::new(v)
+    }
+}
+
+impl<'a, T: SimpleAsn1Readable<'a>, const TAG: u32> SimpleAsn1Readable<'a>
+    for Implicit<T, { TAG }>
+{
+    const TAG: Tag = crate::implicit_tag(TAG, T::TAG);
+    fn parse_data(data: &'a [u8]) -> ParseResult<Self> {
+        Ok(Implicit::new(T::parse_data(data)?))
+    }
+}
+
+impl<T: SimpleAsn1Writable, const TAG: u32> SimpleAsn1Writable for Implicit<T, { TAG }> {
+    const TAG: Tag = crate::implicit_tag(TAG, T::TAG);
+
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        self.inner.write_data(dest)
+    }
+}
+
+/// `Explicit` is a type which wraps another ASN.1 type, indicating that the tag is an ASN.1
+/// `EXPLICIT`. This will generally be used with `Option` or `Choice`.
+#[derive(PartialEq, Eq, Debug)]
+pub struct Explicit<T, const TAG: u32> {
+    inner: T,
+}
+
+impl<T, const TAG: u32> Explicit<T, { TAG }> {
+    pub fn new(v: T) -> Self {
+        Explicit { inner: v }
+    }
+
+    pub fn as_inner(&self) -> &T {
+        &self.inner
+    }
+
+    pub fn into_inner(self) -> T {
+        self.inner
+    }
+}
+
+impl<T, const TAG: u32> From<T> for Explicit<T, { TAG }> {
+    fn from(v: T) -> Self {
+        Explicit::new(v)
+    }
+}
+
+impl<'a, T: Asn1Readable<'a>, const TAG: u32> SimpleAsn1Readable<'a> for Explicit<T, { TAG }> {
+    const TAG: Tag = crate::explicit_tag(TAG);
+    fn parse_data(data: &'a [u8]) -> ParseResult<Self> {
+        Ok(Explicit::new(parse(data, Parser::read_element::<T>)?))
+    }
+}
+
+impl<T: Asn1Writable, const TAG: u32> SimpleAsn1Writable for Explicit<T, { TAG }> {
+    const TAG: Tag = crate::explicit_tag(TAG);
+    fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
+        Writer::new(dest).write_element(&self.inner)
+    }
+}
+
+impl<'a, T: Asn1Readable<'a>, U: Asn1DefinedByReadable<'a, T>, const TAG: u32>
+    Asn1DefinedByReadable<'a, T> for Explicit<U, { TAG }>
+{
+    fn parse(item: T, parser: &mut Parser<'a>) -> ParseResult<Self> {
+        let tlv = parser.read_element::<Explicit<Tlv<'_>, TAG>>()?;
+        Ok(Explicit::new(parse(tlv.as_inner().full_data(), |p| {
+            U::parse(item, p)
+        })?))
+    }
+}
+
+impl<T: Asn1Writable, U: Asn1DefinedByWritable<T>, const TAG: u32> Asn1DefinedByWritable<T>
+    for Explicit<U, { TAG }>
+{
+    fn item(&self) -> &T {
+        self.as_inner().item()
+    }
+    fn write(&self, dest: &mut Writer<'_>) -> WriteResult {
+        dest.write_tlv(crate::explicit_tag(TAG), |dest| {
+            self.as_inner().write(&mut Writer::new(dest))
+        })
+    }
+}
+
+#[derive(PartialEq, Eq, Debug, Clone, Hash)]
+pub struct DefinedByMarker<T>(core::marker::PhantomData<T>);
+
+impl<T> DefinedByMarker<T> {
+    pub const fn marker() -> DefinedByMarker<T> {
+        DefinedByMarker(core::marker::PhantomData)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::{
+        parse_single, BigInt, BigUint, DateTime, DefinedByMarker, Enumerated, GeneralizedTime,
+        IA5String, ObjectIdentifier, OctetStringEncoded, OwnedBigInt, OwnedBigUint, ParseError,
+        ParseErrorKind, PrintableString, SequenceOf, SequenceOfWriter, SetOf, SetOfWriter, Tag,
+        Tlv, UtcTime, Utf8String, VisibleString,
+    };
+    use crate::{Explicit, Implicit};
+    #[cfg(not(feature = "std"))]
+    use alloc::vec;
+    #[cfg(not(feature = "std"))]
+    use alloc::vec::Vec;
+    #[cfg(feature = "std")]
+    use core::hash::{Hash, Hasher};
+    #[cfg(feature = "std")]
+    use std::collections::hash_map::DefaultHasher;
+
+    #[test]
+    fn test_octet_string_encoded() {
+        assert_eq!(OctetStringEncoded::new(12).get(), &12);
+        assert_eq!(OctetStringEncoded::new(12).into_inner(), 12);
+    }
+
+    #[test]
+    fn test_printable_string_new() {
+        assert!(PrintableString::new("abc").is_some());
+        assert!(PrintableString::new("").is_some());
+        assert!(PrintableString::new(" ").is_some());
+        assert!(PrintableString::new("%").is_none());
+        assert!(PrintableString::new("\x00").is_none());
+    }
+
+    #[test]
+    fn test_printable_string_as_str() {
+        assert_eq!(PrintableString::new("abc").unwrap().as_str(), "abc");
+    }
+
+    #[test]
+    fn test_ia5string_new() {
+        assert!(IA5String::new("abc").is_some());
+        assert!(IA5String::new("").is_some());
+        assert!(IA5String::new(" ").is_some());
+        assert!(IA5String::new("%").is_some());
+        assert!(IA5String::new("😄").is_none());
+    }
+
+    #[test]
+    fn test_ia5string_as_str() {
+        assert_eq!(IA5String::new("abc").unwrap().as_str(), "abc");
+    }
+
+    #[test]
+    fn test_utf8string_as_str() {
+        assert_eq!(Utf8String::new("abc").as_str(), "abc");
+    }
+
+    #[test]
+    fn test_visiblestring_new() {
+        assert!(VisibleString::new("").is_some());
+        assert!(VisibleString::new("abc").is_some());
+        assert!(VisibleString::new("\n").is_none());
+    }
+
+    #[test]
+    fn test_visiblestring_as_str() {
+        assert_eq!(VisibleString::new("abc").unwrap().as_str(), "abc");
+    }
+
+    #[test]
+    fn test_tlv_data() {
+        let tlv = parse_single::<Tlv<'_>>(b"\x01\x03abc").unwrap();
+        assert_eq!(tlv.data(), b"abc");
+    }
+
+    #[test]
+    fn test_tlv_full_data() {
+        let tlv = parse_single::<Tlv<'_>>(b"\x01\x03abc").unwrap();
+        assert_eq!(tlv.full_data(), b"\x01\x03abc");
+    }
+
+    #[test]
+    fn test_tlv_parse() {
+        let tlv = Tlv {
+            tag: Tag::primitive(0x2),
+            data: b"\x03",
+            full_data: b"\x02\x01\x03",
+        };
+        assert_eq!(tlv.parse::<u64>(), Ok(3));
+        assert_eq!(
+            tlv.parse::<&[u8]>(),
+            Err(ParseError::new(ParseErrorKind::UnexpectedTag {
+                actual: Tag::primitive(0x2)
+            }))
+        );
+    }
+
+    #[test]
+    fn test_biguint_as_bytes() {
+        assert_eq!(BigUint::new(b"\x01").unwrap().as_bytes(), b"\x01");
+        assert_eq!(
+            OwnedBigUint::new(b"\x01".to_vec()).unwrap().as_bytes(),
+            b"\x01"
+        );
+    }
+
+    #[test]
+    fn test_bigint_as_bytes() {
+        assert_eq!(BigInt::new(b"\x01").unwrap().as_bytes(), b"\x01");
+        assert_eq!(
+            OwnedBigInt::new(b"\x01".to_vec()).unwrap().as_bytes(),
+            b"\x01"
+        );
+    }
+
+    #[test]
+    fn test_bigint_is_negative() {
+        assert!(!BigInt::new(b"\x01").unwrap().is_negative()); // 1
+        assert!(!BigInt::new(b"\x00").unwrap().is_negative()); // 0
+        assert!(BigInt::new(b"\xff").unwrap().is_negative()); // -1
+
+        assert!(!OwnedBigInt::new(b"\x01".to_vec()).unwrap().is_negative()); // 1
+        assert!(!OwnedBigInt::new(b"\x00".to_vec()).unwrap().is_negative()); // 0
+        assert!(OwnedBigInt::new(b"\xff".to_vec()).unwrap().is_negative()); // -1
+    }
+
+    #[test]
+    fn test_sequence_of_clone() {
+        let mut seq1 =
+            parse_single::<SequenceOf<'_, u64>>(b"\x30\x09\x02\x01\x01\x02\x01\x02\x02\x01\x03")
+                .unwrap();
+        assert_eq!(seq1.next(), Some(1));
+        let seq2 = seq1.clone();
+        assert_eq!(seq1.collect::<Vec<_>>(), vec![2, 3]);
+        assert_eq!(seq2.collect::<Vec<_>>(), vec![2, 3]);
+    }
+
+    #[test]
+    fn test_sequence_of_len() {
+        let mut seq1 =
+            parse_single::<SequenceOf<'_, u64>>(b"\x30\x09\x02\x01\x01\x02\x01\x02\x02\x01\x03")
+                .unwrap();
+        let seq2 = seq1.clone();
+
+        assert_eq!(seq1.len(), 3);
+        assert!(seq1.next().is_some());
+        assert_eq!(seq1.len(), 2);
+        assert_eq!(seq2.len(), 3);
+        assert!(seq1.next().is_some());
+        assert!(seq1.next().is_some());
+        assert_eq!(seq1.len(), 0);
+        assert!(seq1.next().is_none());
+        assert_eq!(seq1.len(), 0);
+        assert!(seq1.is_empty());
+        assert_eq!(seq2.len(), 3);
+        assert!(!seq2.is_empty());
+    }
+
+    #[cfg(feature = "std")]
+    fn hash<T: Hash>(v: &T) -> u64 {
+        let mut h = DefaultHasher::new();
+        v.hash(&mut h);
+        h.finish()
+    }
+
+    #[test]
+    fn test_set_of_eq() {
+        let s1 = SetOf::<bool>::new(b"");
+        let s2 = SetOf::<bool>::new(b"");
+        let s3 = SetOf::<bool>::new(b"\x01\x01\x00");
+        let s4 = SetOf::<bool>::new(b"\x01\x01\xff");
+
+        assert!(s1 == s2);
+
+        assert!(s2 != s3);
+
+        assert!(s3 == s3);
+
+        assert!(s3 != s4);
+    }
+
+    #[cfg(feature = "std")]
+    #[test]
+    fn test_set_of_hash() {
+        let s1 = SetOf::<bool>::new(b"");
+        let s2 = SetOf::<bool>::new(b"");
+        let s3 = SetOf::<bool>::new(b"\x01\x01\x00");
+        let s4 = SetOf::<bool>::new(b"\x01\x01\xff");
+
+        assert_eq!(hash(&s1), hash(&s2));
+
+        assert_ne!(hash(&s2), hash(&s3));
+
+        assert_ne!(hash(&s3), hash(&s4));
+    }
+
+    #[test]
+    fn test_sequence_of_eq() {
+        let s1 = SequenceOf::<bool>::new(b"").unwrap();
+        let s2 = SequenceOf::<bool>::new(b"").unwrap();
+        let s3 = SequenceOf::<bool>::new(b"\x01\x01\x00").unwrap();
+        let s4 = SequenceOf::<bool>::new(b"\x01\x01\xff").unwrap();
+
+        assert!(s1 == s2);
+
+        assert!(s2 != s3);
+
+        assert!(s3 == s3);
+
+        assert!(s3 != s4);
+    }
+
+    #[cfg(feature = "std")]
+    #[test]
+    fn test_sequence_of_hash() {
+        let s1 = SequenceOf::<bool>::new(b"").unwrap();
+        let s2 = SequenceOf::<bool>::new(b"").unwrap();
+        let s3 = SequenceOf::<bool>::new(b"\x01\x01\x00").unwrap();
+        let s4 = SequenceOf::<bool>::new(b"\x01\x01\xff").unwrap();
+
+        assert_eq!(hash(&s1), hash(&s2));
+
+        assert_ne!(hash(&s2), hash(&s3));
+
+        assert_ne!(hash(&s3), hash(&s4));
+    }
+
+    #[test]
+    fn test_sequence_of_writer_clone() {
+        let s1 = SequenceOfWriter::new([1, 2, 3]);
+        let s2 = s1.clone();
+
+        assert!(s1 == s2);
+    }
+
+    #[test]
+    fn test_set_of_writer_clone() {
+        let s1 = SetOfWriter::new([1, 2, 3]);
+        let s2 = s1.clone();
+
+        assert!(s1 == s2);
+    }
+
+    #[test]
+    fn test_datetime_new() {
+        assert!(DateTime::new(2038, 13, 1, 12, 0, 0).is_err());
+        assert!(DateTime::new(2000, 1, 1, 12, 60, 0).is_err());
+        assert!(DateTime::new(2000, 1, 1, 12, 0, 60).is_err());
+        assert!(DateTime::new(2000, 1, 1, 24, 0, 0).is_err());
+    }
+
+    #[test]
+    fn test_datetime_partialord() {
+        let point = DateTime::new(2023, 6, 15, 14, 26, 5).unwrap();
+
+        assert!(point < DateTime::new(2023, 6, 15, 14, 26, 6).unwrap());
+        assert!(point < DateTime::new(2023, 6, 15, 14, 27, 5).unwrap());
+        assert!(point < DateTime::new(2023, 6, 15, 15, 26, 5).unwrap());
+        assert!(point < DateTime::new(2023, 6, 16, 14, 26, 5).unwrap());
+        assert!(point < DateTime::new(2023, 7, 15, 14, 26, 5).unwrap());
+        assert!(point < DateTime::new(2024, 6, 15, 14, 26, 5).unwrap());
+
+        assert!(point > DateTime::new(2023, 6, 15, 14, 26, 4).unwrap());
+        assert!(point > DateTime::new(2023, 6, 15, 14, 25, 5).unwrap());
+        assert!(point > DateTime::new(2023, 6, 15, 13, 26, 5).unwrap());
+        assert!(point > DateTime::new(2023, 6, 14, 14, 26, 5).unwrap());
+        assert!(point > DateTime::new(2023, 5, 15, 14, 26, 5).unwrap());
+        assert!(point > DateTime::new(2022, 6, 15, 14, 26, 5).unwrap());
+    }
+
+    #[test]
+    fn test_utctime_new() {
+        assert!(UtcTime::new(DateTime::new(1950, 1, 1, 12, 0, 0).unwrap()).is_ok());
+        assert!(UtcTime::new(DateTime::new(1949, 1, 1, 12, 0, 0).unwrap()).is_err());
+        assert!(UtcTime::new(DateTime::new(2050, 1, 1, 12, 0, 0).unwrap()).is_err());
+        assert!(UtcTime::new(DateTime::new(2100, 1, 1, 12, 0, 0).unwrap()).is_err());
+    }
+
+    #[test]
+    fn test_generalized_time_new() {
+        assert!(GeneralizedTime::new(DateTime::new(2015, 6, 30, 23, 59, 59).unwrap()).is_ok());
+    }
+
+    #[test]
+    fn test_enumerated_value() {
+        assert_eq!(Enumerated::new(4).value(), 4);
+    }
+
+    #[test]
+    fn test_implicit_as_inner() {
+        assert_eq!(Implicit::<i32, 0>::new(12).as_inner(), &12);
+    }
+
+    #[test]
+    fn test_explicit_as_inner() {
+        assert_eq!(Explicit::<i32, 0>::new(12).as_inner(), &12);
+    }
+
+    #[test]
+    fn test_const() {
+        const _: DefinedByMarker<ObjectIdentifier> = DefinedByMarker::marker();
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/asn1/src/writer.rs 43.0.0-1ubuntu1/rust-vendor/asn1/src/writer.rs
--- 43.0.0-1/rust-vendor/asn1/src/writer.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1/src/writer.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,796 @@
+use crate::types::{Asn1Writable, SimpleAsn1Writable};
+use crate::Tag;
+#[cfg(not(feature = "std"))]
+use alloc::vec::Vec;
+use alloc::{fmt, vec};
+
+/// `WriteError` are returned when there is an error writing the ASN.1 data.
+#[derive(PartialEq, Eq, Debug)]
+pub enum WriteError {
+    AllocationError,
+}
+
+impl fmt::Display for WriteError {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        match self {
+            WriteError::AllocationError => write!(f, "allocation error"),
+        }
+    }
+}
+
+#[cfg(feature = "std")]
+impl std::error::Error for WriteError {}
+
+pub type WriteResult<T = ()> = Result<T, WriteError>;
+
+pub struct WriteBuf(Vec<u8>);
+
+impl WriteBuf {
+    #[inline]
+    pub(crate) fn new(data: Vec<u8>) -> WriteBuf {
+        WriteBuf(data)
+    }
+
+    #[inline]
+    pub(crate) fn len(&self) -> usize {
+        self.0.len()
+    }
+
+    #[inline]
+    pub(crate) fn as_slice(&self) -> &[u8] {
+        self.0.as_slice()
+    }
+
+    #[inline]
+    pub(crate) fn as_mut_slice(&mut self) -> &mut [u8] {
+        self.0.as_mut_slice()
+    }
+
+    #[inline]
+    pub fn push_byte(&mut self, b: u8) -> WriteResult {
+        self.0
+            .try_reserve(1)
+            .map_err(|_| WriteError::AllocationError)?;
+
+        self.0.push(b);
+        Ok(())
+    }
+
+    #[inline]
+    pub fn push_slice(&mut self, data: &[u8]) -> WriteResult {
+        self.0
+            .try_reserve(data.len())
+            .map_err(|_| WriteError::AllocationError)?;
+
+        self.0.extend_from_slice(data);
+        Ok(())
+    }
+}
+
+fn _length_length(length: usize) -> u8 {
+    let mut i = length;
+    let mut num_bytes = 1;
+    while i > 255 {
+        num_bytes += 1;
+        i >>= 8;
+    }
+    num_bytes
+}
+
+fn _insert_at_position(buf: &mut WriteBuf, pos: usize, data: &[u8]) -> WriteResult {
+    for _ in 0..data.len() {
+        buf.push_byte(0)?;
+    }
+    let src_range = pos..buf.len() - data.len();
+    buf.as_mut_slice().copy_within(src_range, pos + data.len());
+    buf.as_mut_slice()[pos..pos + data.len()].copy_from_slice(data);
+
+    Ok(())
+}
+
+/// Encapsulates an ongoing write. For almost all use-cases the correct
+/// entrypoint is [`write()`] or [`write_single()`].
+pub struct Writer<'a> {
+    pub(crate) buf: &'a mut WriteBuf,
+}
+
+impl Writer<'_> {
+    #[inline]
+    #[doc(hidden)]
+    pub fn new(buf: &mut WriteBuf) -> Writer<'_> {
+        Writer { buf }
+    }
+
+    /// Writes a single element to the output.
+    #[inline]
+    pub fn write_element<T: Asn1Writable>(&mut self, val: &T) -> WriteResult {
+        val.write(self)
+    }
+
+    /// This is an alias for `write_element::<Explicit<T, tag>>`.
+    pub fn write_explicit_element<T: Asn1Writable>(&mut self, val: &T, tag: u32) -> WriteResult {
+        let tag = crate::explicit_tag(tag);
+        self.write_tlv(tag, |dest| Writer::new(dest).write_element(val))
+    }
+
+    /// This is an alias for `write_element::<Option<Explicit<T, tag>>>`.
+    pub fn write_optional_explicit_element<T: Asn1Writable>(
+        &mut self,
+        val: &Option<T>,
+        tag: u32,
+    ) -> WriteResult {
+        if let Some(v) = val {
+            let tag = crate::explicit_tag(tag);
+            self.write_tlv(tag, |dest| Writer::new(dest).write_element(v))
+        } else {
+            Ok(())
+        }
+    }
+
+    /// This is an alias for `write_element::<Implicit<T, tag>>`.
+    pub fn write_implicit_element<T: SimpleAsn1Writable>(
+        &mut self,
+        val: &T,
+        tag: u32,
+    ) -> WriteResult {
+        let tag = crate::implicit_tag(tag, T::TAG);
+        self.write_tlv(tag, |dest| val.write_data(dest))
+    }
+
+    /// This is an alias for `write_element::<Option<Implicit<T, tag>>>`.
+    pub fn write_optional_implicit_element<T: SimpleAsn1Writable>(
+        &mut self,
+        val: &Option<T>,
+        tag: u32,
+    ) -> WriteResult {
+        if let Some(v) = val {
+            let tag = crate::implicit_tag(tag, T::TAG);
+            self.write_tlv(tag, |dest| v.write_data(dest))
+        } else {
+            Ok(())
+        }
+    }
+
+    /// Writes a TLV with the specified tag where the value is any bytes
+    /// written to the `Vec` in the callback. The length portion of the
+    /// TLV is automatically computed.
+    #[inline]
+    pub fn write_tlv<F: FnOnce(&mut WriteBuf) -> WriteResult>(
+        &mut self,
+        tag: Tag,
+        body: F,
+    ) -> WriteResult {
+        tag.write_bytes(self.buf)?;
+        // Push a 0-byte placeholder for the length. Needing only a single byte
+        // for the element is probably the most common case.
+        self.buf.push_byte(0)?;
+        let start_len = self.buf.len();
+        body(self.buf)?;
+        self.insert_length(start_len)
+    }
+
+    #[inline]
+    fn insert_length(&mut self, start_len: usize) -> WriteResult {
+        let added_len = self.buf.len() - start_len;
+        if added_len >= 128 {
+            let n = _length_length(added_len);
+            self.buf.as_mut_slice()[start_len - 1] = 0x80 | n;
+            let mut length_buf = [0u8; 8];
+            for (pos, i) in (1..=n).rev().enumerate() {
+                length_buf[pos] = (added_len >> ((i - 1) * 8)) as u8;
+            }
+            _insert_at_position(self.buf, start_len, &length_buf[..n as usize])?;
+        } else {
+            self.buf.as_mut_slice()[start_len - 1] = added_len as u8;
+        }
+
+        Ok(())
+    }
+}
+
+/// Constructs a writer and invokes a callback which writes ASN.1 elements into
+/// the writer, then returns the generated DER bytes.
+#[inline]
+pub fn write<F: Fn(&mut Writer<'_>) -> WriteResult>(f: F) -> WriteResult<Vec<u8>> {
+    let mut v = WriteBuf::new(vec![]);
+    let mut w = Writer::new(&mut v);
+    f(&mut w)?;
+    Ok(v.0)
+}
+
+/// Writes a single top-level ASN.1 element, returning the generated DER bytes.
+/// Most often this will be used where `T` is a type with
+/// `#[derive(asn1::Asn1Write)]`.
+pub fn write_single<T: Asn1Writable>(v: &T) -> WriteResult<Vec<u8>> {
+    write(|w| w.write_element(v))
+}
+
+#[cfg(test)]
+mod tests {
+    #[cfg(not(feature = "std"))]
+    use alloc::boxed::Box;
+    #[cfg(not(feature = "std"))]
+    use alloc::vec;
+
+    use super::{_insert_at_position, write, write_single, WriteBuf, Writer};
+    use crate::types::Asn1Writable;
+    use crate::{
+        parse_single, BMPString, BigInt, BigUint, BitString, Choice1, Choice2, Choice3, DateTime,
+        Enumerated, Explicit, GeneralizedTime, IA5String, Implicit, ObjectIdentifier,
+        OctetStringEncoded, OwnedBigInt, OwnedBigUint, OwnedBitString, PrintableString, Sequence,
+        SequenceOf, SequenceOfWriter, SequenceWriter, SetOf, SetOfWriter, Tlv, UniversalString,
+        UtcTime, Utf8String, VisibleString, WriteError,
+    };
+    #[cfg(not(feature = "std"))]
+    use alloc::vec::Vec;
+
+    fn assert_writes<T>(data: &[(T, &[u8])])
+    where
+        T: Asn1Writable,
+    {
+        for (val, expected) in data {
+            let result = write_single(val).unwrap();
+            assert_eq!(&result, expected);
+        }
+    }
+
+    #[test]
+    fn test_insert_at_position() {
+        let mut v = WriteBuf::new(vec![1, 2, 3, 4]);
+        _insert_at_position(&mut v, 2, &[5, 6]).unwrap();
+        assert_eq!(v.as_slice(), &[1, 2, 5, 6, 3, 4]);
+    }
+
+    #[test]
+    fn test_write_error_eq() {
+        let e1 = WriteError::AllocationError;
+        let e2 = WriteError::AllocationError;
+
+        assert_eq!(e1, e2);
+    }
+
+    #[test]
+    fn test_write_element() {
+        assert_eq!(write(|w| w.write_element(&())).unwrap(), b"\x05\x00");
+    }
+
+    #[test]
+    fn test_write_null() {
+        assert_writes::<()>(&[((), b"\x05\x00")]);
+    }
+
+    #[test]
+    fn test_write_bool() {
+        assert_writes::<bool>(&[(false, b"\x01\x01\x00"), (true, b"\x01\x01\xff")]);
+    }
+
+    #[test]
+    fn test_write_octet_string() {
+        assert_writes::<&[u8]>(&[
+            (b"", b"\x04\x00"),
+            (b"\x01\x02\x03", b"\x04\x03\x01\x02\x03"),
+            (b"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", b"\x04\x81\x81aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"),
+            (b"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", b"\x04\x82\x01\x02aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"),
+        ]);
+
+        assert_writes::<[u8; 0]>(&[([], b"\x04\x00")]);
+        assert_writes::<[u8; 1]>(&[([1], b"\x04\x01\x01")]);
+        assert_writes::<[u8; 2]>(&[([2, 3], b"\x04\x02\x02\x03")]);
+    }
+
+    #[test]
+    fn test_write_octet_string_encoded() {
+        assert_writes::<OctetStringEncoded<bool>>(&[
+            (OctetStringEncoded::new(true), b"\x04\x03\x01\x01\xff"),
+            (OctetStringEncoded::new(false), b"\x04\x03\x01\x01\x00"),
+        ]);
+    }
+
+    #[test]
+    fn test_write_printable_string() {
+        assert_writes::<PrintableString<'_>>(&[
+            (
+                PrintableString::new("Test User 1").unwrap(),
+                b"\x13\x0bTest User 1",
+            ),
+            (
+                PrintableString::new("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx").unwrap(),
+                b"\x13\x81\x80xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_write_ia5string() {
+        assert_writes::<IA5String<'_>>(&[
+            (
+                IA5String::new("Test User 1").unwrap(),
+                b"\x16\x0bTest User 1",
+            ),
+            (
+                IA5String::new("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx").unwrap(),
+                b"\x16\x81\x80xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_write_utf8string() {
+        assert_writes::<Utf8String<'_>>(&[
+            (
+                Utf8String::new("Test User 1"),
+                b"\x0c\x0bTest User 1",
+            ),
+            (
+                Utf8String::new("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"),
+                b"\x0c\x81\x80xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_write_visiblestring() {
+        assert_writes::<VisibleString<'_>>(&[
+            (
+                VisibleString::new("Test User 1").unwrap(),
+                b"\x1a\x0bTest User 1",
+            ),
+            (
+                VisibleString::new("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx").unwrap(),
+                b"\x1a\x81\x80xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_write_bmpstring() {
+        assert_writes::<BMPString<'_>>(&[(
+            BMPString::new(b"\x00a\x00b\x00c").unwrap(),
+            b"\x1e\x06\x00a\x00b\x00c",
+        )]);
+    }
+
+    #[test]
+    fn test_write_universalstring() {
+        assert_writes::<UniversalString<'_>>(&[(
+            UniversalString::new(b"\x00\x00\x00a\x00\x00\x00b\x00\x00\x00c").unwrap(),
+            b"\x1c\x0c\x00\x00\x00a\x00\x00\x00b\x00\x00\x00c",
+        )]);
+    }
+
+    #[test]
+    fn test_write_i64() {
+        assert_writes::<i64>(&[
+            (0, b"\x02\x01\x00"),
+            (127, b"\x02\x01\x7f"),
+            (128, b"\x02\x02\x00\x80"),
+            (255, b"\x02\x02\x00\xff"),
+            (256, b"\x02\x02\x01\x00"),
+            (-1, b"\x02\x01\xff"),
+            (-128, b"\x02\x01\x80"),
+            (-129, b"\x02\x02\xff\x7f"),
+        ]);
+    }
+
+    #[test]
+    fn test_write_u64() {
+        assert_writes::<u64>(&[(
+            12356915591483590945,
+            b"\x02\x09\x00\xab\x7c\x95\x42\xbd\xdd\x89\x21",
+        )]);
+    }
+
+    #[test]
+    fn test_write_i32() {
+        assert_writes::<i32>(&[
+            (0, b"\x02\x01\x00"),
+            (127, b"\x02\x01\x7f"),
+            (128, b"\x02\x02\x00\x80"),
+            (255, b"\x02\x02\x00\xff"),
+            (256, b"\x02\x02\x01\x00"),
+            (-1, b"\x02\x01\xff"),
+            (-128, b"\x02\x01\x80"),
+            (-129, b"\x02\x02\xff\x7f"),
+        ]);
+    }
+
+    #[test]
+    fn test_write_u16() {
+        assert_writes::<u16>(&[
+            (0, b"\x02\x01\x00"),
+            (1, b"\x02\x01\x01"),
+            (256, b"\x02\x02\x01\x00"),
+            (65535, b"\x02\x03\x00\xff\xff"),
+        ]);
+    }
+
+    #[test]
+    fn test_write_i16() {
+        assert_writes::<i16>(&[
+            (0, b"\x02\x01\x00"),
+            (1, b"\x02\x01\x01"),
+            (-256, b"\x02\x02\xff\x00"),
+            (-1, b"\x02\x01\xff"),
+            (-32768, b"\x02\x02\x80\x00"),
+            (32767, b"\x02\x02\x7f\xff"),
+        ]);
+    }
+
+    #[test]
+    fn test_write_u8() {
+        assert_writes::<u8>(&[
+            (0, b"\x02\x01\x00"),
+            (127, b"\x02\x01\x7f"),
+            (128, b"\x02\x02\x00\x80"),
+        ]);
+    }
+
+    #[test]
+    fn test_write_i8() {
+        assert_writes::<i8>(&[
+            (0, b"\x02\x01\x00"),
+            (127, b"\x02\x01\x7f"),
+            (-1, b"\x02\x01\xff"),
+            (-128, b"\x02\x01\x80"),
+        ]);
+    }
+
+    #[test]
+    fn test_write_biguint() {
+        assert_writes::<BigUint<'_>>(&[
+            (BigUint::new(b"\x00\xff").unwrap(), b"\x02\x02\x00\xff"),
+            (
+                BigUint::new(b"\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff").unwrap(),
+                b"\x02\x0d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_write_ownedbiguint() {
+        assert_writes::<OwnedBigUint>(&[
+            (
+                OwnedBigUint::new(b"\x00\xff".to_vec()).unwrap(),
+                b"\x02\x02\x00\xff",
+            ),
+            (
+                OwnedBigUint::new(b"\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff".to_vec())
+                    .unwrap(),
+                b"\x02\x0d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_write_bigint() {
+        assert_writes::<BigInt<'_>>(&[
+            (BigInt::new(b"\xff").unwrap(), b"\x02\x01\xff"),
+            (
+                BigInt::new(b"\xff\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff").unwrap(),
+                b"\x02\x0c\xff\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_write_ownedbigint() {
+        assert_writes::<OwnedBigInt>(&[
+            (OwnedBigInt::new(b"\xff".to_vec()).unwrap(), b"\x02\x01\xff"),
+            (
+                OwnedBigInt::new(b"\xff\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff".to_vec())
+                    .unwrap(),
+                b"\x02\x0c\xff\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_write_object_identifier() {
+        assert_writes::<ObjectIdentifier>(&[
+            (
+                ObjectIdentifier::from_string("1.2.840.113549").unwrap(),
+                b"\x06\x06\x2a\x86\x48\x86\xf7\x0d",
+            ),
+            (
+                ObjectIdentifier::from_string("1.2.3.4").unwrap(),
+                b"\x06\x03\x2a\x03\x04",
+            ),
+            (
+                ObjectIdentifier::from_string("1.2.840.133549.1.1.5").unwrap(),
+                b"\x06\x09\x2a\x86\x48\x88\x93\x2d\x01\x01\x05",
+            ),
+            (
+                ObjectIdentifier::from_string("2.100.3").unwrap(),
+                b"\x06\x03\x81\x34\x03",
+            ),
+            (
+                ObjectIdentifier::from_string("2.4.0").unwrap(),
+                b"\x06\x02\x54\x00",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_write_bit_string() {
+        assert_writes::<BitString<'_>>(&[
+            (BitString::new(b"", 0).unwrap(), b"\x03\x01\x00"),
+            (BitString::new(b"\x80", 7).unwrap(), b"\x03\x02\x07\x80"),
+            (
+                BitString::new(b"\x81\xf0", 4).unwrap(),
+                b"\x03\x03\x04\x81\xf0",
+            ),
+        ]);
+
+        assert_writes::<OwnedBitString>(&[
+            (OwnedBitString::new(vec![], 0).unwrap(), b"\x03\x01\x00"),
+            (
+                OwnedBitString::new(vec![0x80], 7).unwrap(),
+                b"\x03\x02\x07\x80",
+            ),
+            (
+                OwnedBitString::new(vec![0x81, 0xf0], 4).unwrap(),
+                b"\x03\x03\x04\x81\xf0",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_write_utctime() {
+        assert_writes::<UtcTime>(&[
+            (
+                UtcTime::new(DateTime::new(1991, 5, 6, 23, 45, 40).unwrap()).unwrap(),
+                b"\x17\x0d910506234540Z",
+            ),
+            (
+                UtcTime::new(DateTime::new(1970, 1, 1, 0, 0, 0).unwrap()).unwrap(),
+                b"\x17\x0d700101000000Z",
+            ),
+            (
+                UtcTime::new(DateTime::new(2009, 11, 15, 22, 56, 16).unwrap()).unwrap(),
+                b"\x17\x0d091115225616Z",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_write_generalizedtime() {
+        assert_writes(&[
+            (
+                GeneralizedTime::new(DateTime::new(1991, 5, 6, 23, 45, 40).unwrap()).unwrap(),
+                b"\x18\x0f19910506234540Z",
+            ),
+            (
+                GeneralizedTime::new(DateTime::new(1970, 1, 1, 0, 0, 0).unwrap()).unwrap(),
+                b"\x18\x0f19700101000000Z",
+            ),
+            (
+                GeneralizedTime::new(DateTime::new(2009, 11, 15, 22, 56, 16).unwrap()).unwrap(),
+                b"\x18\x0f20091115225616Z",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_write_enumerated() {
+        assert_writes::<Enumerated>(&[
+            (Enumerated::new(0), b"\x0a\x01\x00"),
+            (Enumerated::new(12), b"\x0a\x01\x0c"),
+        ]);
+    }
+
+    #[test]
+    fn test_write_sequence() {
+        assert_eq!(
+            write(|w| {
+                w.write_element(&SequenceWriter::new(&|w: &mut Writer<'_>| {
+                    w.write_element(&())
+                }))
+            })
+            .unwrap(),
+            b"\x30\x02\x05\x00"
+        );
+        assert_eq!(
+            write(|w| {
+                w.write_element(&SequenceWriter::new(&|w: &mut Writer<'_>| {
+                    w.write_element(&true)
+                }))
+            })
+            .unwrap(),
+            b"\x30\x03\x01\x01\xff"
+        );
+
+        assert_writes(&[(
+            parse_single::<Sequence<'_>>(b"\x30\x06\x01\x01\xff\x02\x01\x06").unwrap(),
+            b"\x30\x06\x01\x01\xff\x02\x01\x06",
+        )]);
+    }
+
+    #[test]
+    fn test_write_sequence_of() {
+        assert_writes::<SequenceOfWriter<'_, u8, &[u8]>>(&[
+            (SequenceOfWriter::new(&[]), b"\x30\x00"),
+            (
+                SequenceOfWriter::new(&[1u8, 2, 3]),
+                b"\x30\x09\x02\x01\x01\x02\x01\x02\x02\x01\x03",
+            ),
+        ]);
+        assert_writes::<SequenceOfWriter<'_, u8, Vec<u8>>>(&[
+            (SequenceOfWriter::new(vec![]), b"\x30\x00"),
+            (
+                SequenceOfWriter::new(vec![1u8, 2, 3]),
+                b"\x30\x09\x02\x01\x01\x02\x01\x02\x02\x01\x03",
+            ),
+        ]);
+        assert_writes::<SequenceOfWriter<'_, SequenceWriter<'_>, &[SequenceWriter<'_>]>>(&[
+            (SequenceOfWriter::new(&[]), b"\x30\x00"),
+            (
+                SequenceOfWriter::new(&[SequenceWriter::new(&|_w| Ok(()))]),
+                b"\x30\x02\x30\x00",
+            ),
+            (
+                SequenceOfWriter::new(&[SequenceWriter::new(&|w: &mut Writer<'_>| {
+                    w.write_element(&1u64)
+                })]),
+                b"\x30\x05\x30\x03\x02\x01\x01",
+            ),
+        ]);
+
+        assert_writes(&[(
+            parse_single::<SequenceOf<'_, u64>>(b"\x30\x06\x02\x01\x05\x02\x01\x07").unwrap(),
+            b"\x30\x06\x02\x01\x05\x02\x01\x07",
+        )]);
+    }
+
+    #[test]
+    fn test_write_set_of() {
+        assert_writes::<SetOfWriter<'_, u8, &[u8]>>(&[
+            (SetOfWriter::new(&[]), b"\x31\x00"),
+            (SetOfWriter::new(&[1u8]), b"\x31\x03\x02\x01\x01"),
+            (
+                SetOfWriter::new(&[1, 2, 3]),
+                b"\x31\x09\x02\x01\x01\x02\x01\x02\x02\x01\x03",
+            ),
+            (
+                SetOfWriter::new(&[3, 2, 1]),
+                b"\x31\x09\x02\x01\x01\x02\x01\x02\x02\x01\x03",
+            ),
+        ]);
+        assert_writes(&[
+            (SetOfWriter::new(vec![]), b"\x31\x00"),
+            (SetOfWriter::new(vec![1u8]), b"\x31\x03\x02\x01\x01"),
+            (
+                SetOfWriter::new(vec![1, 2, 3]),
+                b"\x31\x09\x02\x01\x01\x02\x01\x02\x02\x01\x03",
+            ),
+            (
+                SetOfWriter::new(vec![3, 2, 1]),
+                b"\x31\x09\x02\x01\x01\x02\x01\x02\x02\x01\x03",
+            ),
+        ]);
+
+        assert_writes(&[(
+            parse_single::<SetOf<'_, u64>>(b"\x31\x06\x02\x01\x05\x02\x01\x07").unwrap(),
+            b"\x31\x06\x02\x01\x05\x02\x01\x07",
+        )]);
+    }
+
+    #[test]
+    fn test_write_implicit() {
+        assert_writes::<Implicit<bool, 2>>(&[
+            (Implicit::new(true), b"\x82\x01\xff"),
+            (Implicit::new(false), b"\x82\x01\x00"),
+        ]);
+
+        assert_eq!(
+            write(|w| { w.write_optional_implicit_element(&Some(true), 2) }).unwrap(),
+            b"\x82\x01\xff"
+        );
+        assert_eq!(
+            write(|w| { w.write_optional_explicit_element::<u8>(&None, 2) }).unwrap(),
+            b""
+        );
+
+        assert_eq!(
+            write(|w| {
+                w.write_optional_implicit_element(&Some(SequenceWriter::new(&|_w| Ok(()))), 2)
+            })
+            .unwrap(),
+            b"\xa2\x00"
+        );
+        assert_eq!(
+            write(|w| { w.write_optional_explicit_element::<SequenceWriter<'_>>(&None, 2) })
+                .unwrap(),
+            b""
+        );
+
+        assert_eq!(
+            write(|w| { w.write_implicit_element(&true, 2) }).unwrap(),
+            b"\x82\x01\xff"
+        );
+
+        assert_eq!(
+            write(|w| { w.write_implicit_element(&SequenceWriter::new(&|_w| { Ok(()) }), 2) })
+                .unwrap(),
+            b"\xa2\x00"
+        );
+    }
+
+    #[test]
+    fn test_write_explicit() {
+        assert_writes::<Explicit<bool, 2>>(&[
+            (Explicit::new(true), b"\xa2\x03\x01\x01\xff"),
+            (Explicit::new(false), b"\xa2\x03\x01\x01\x00"),
+        ]);
+
+        assert_eq!(
+            write(|w| { w.write_optional_explicit_element(&Some(true), 2) }).unwrap(),
+            b"\xa2\x03\x01\x01\xff"
+        );
+        assert_eq!(
+            write(|w| { w.write_optional_explicit_element::<u8>(&None, 2) }).unwrap(),
+            b""
+        );
+
+        assert_eq!(
+            write(|w| { w.write_explicit_element(&true, 2) }).unwrap(),
+            b"\xa2\x03\x01\x01\xff"
+        );
+    }
+
+    #[test]
+    fn test_write_option() {
+        assert_writes::<Option<bool>>(&[
+            (Some(true), b"\x01\x01\xff"),
+            (Some(false), b"\x01\x01\x00"),
+            (None, b""),
+        ]);
+    }
+
+    #[test]
+    fn test_write_choice() {
+        assert_writes::<Choice1<bool>>(&[(Choice1::ChoiceA(true), b"\x01\x01\xff")]);
+
+        assert_writes::<Choice2<bool, i64>>(&[
+            (Choice2::ChoiceA(true), b"\x01\x01\xff"),
+            (Choice2::ChoiceB(18), b"\x02\x01\x12"),
+        ]);
+
+        assert_writes::<Choice3<bool, i64, ()>>(&[
+            (Choice3::ChoiceA(true), b"\x01\x01\xff"),
+            (Choice3::ChoiceB(18), b"\x02\x01\x12"),
+            (Choice3::ChoiceC(()), b"\x05\x00"),
+        ]);
+    }
+
+    #[test]
+    fn test_write_tlv() {
+        assert_writes(&[
+            (
+                parse_single::<Tlv<'_>>(b"\x01\x01\x00").unwrap(),
+                b"\x01\x01\x00",
+            ),
+            (
+                parse_single::<Tlv<'_>>(b"\x1f\x81\x80\x01\x00").unwrap(),
+                b"\x1f\x81\x80\x01\x00",
+            ),
+            (
+                parse_single::<Tlv<'_>>(b"\x1f\x1f\x00").unwrap(),
+                b"\x1f\x1f\x00",
+            ),
+        ]);
+    }
+
+    #[test]
+    fn test_write_box() {
+        assert_writes(&[
+            (Box::new(12u8), b"\x02\x01\x0c"),
+            (Box::new(0), b"\x02\x01\x00"),
+        ]);
+    }
+
+    #[test]
+    fn test_write_error_display() {
+        use alloc::string::ToString;
+        assert_eq!(&WriteError::AllocationError.to_string(), "allocation error");
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/asn1/tests/derive_test.rs 43.0.0-1ubuntu1/rust-vendor/asn1/tests/derive_test.rs
--- 43.0.0-1/rust-vendor/asn1/tests/derive_test.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1/tests/derive_test.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,703 @@
+use std::fmt;
+
+fn assert_roundtrips<
+    'a,
+    T: asn1::Asn1Readable<'a> + asn1::Asn1Writable + PartialEq + fmt::Debug,
+>(
+    data: &[(asn1::ParseResult<T>, &'a [u8])],
+) {
+    for (value, der_bytes) in data {
+        let parsed = asn1::parse_single::<T>(der_bytes);
+        assert_eq!(value, &parsed);
+        if let Ok(v) = value {
+            let result = asn1::write_single(v).unwrap();
+            assert_eq!(&result, der_bytes);
+        }
+    }
+}
+
+#[test]
+fn test_struct_no_fields() {
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, Debug, PartialEq, Eq)]
+    struct NoFields;
+
+    assert_roundtrips(&[
+        (Ok(NoFields), b"\x30\x00"),
+        (
+            Err(asn1::ParseError::new(asn1::ParseErrorKind::ExtraData)),
+            b"\x30\x01\x00",
+        ),
+    ]);
+}
+
+#[test]
+fn test_struct_simple_fields() {
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, Debug, PartialEq, Eq)]
+    struct SimpleFields {
+        a: u64,
+        b: u64,
+    }
+    assert_roundtrips(&[(
+        Ok(SimpleFields { a: 2, b: 3 }),
+        b"\x30\x06\x02\x01\x02\x02\x01\x03",
+    )]);
+}
+
+#[test]
+fn test_tuple_struct_simple_fields() {
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, Debug, PartialEq, Eq)]
+    struct SimpleFields(u8, u8);
+
+    assert_roundtrips(&[(Ok(SimpleFields(2, 3)), b"\x30\x06\x02\x01\x02\x02\x01\x03")]);
+}
+
+#[test]
+fn test_struct_lifetime() {
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, Debug, PartialEq, Eq)]
+    struct Lifetimes<'a> {
+        a: &'a [u8],
+    }
+
+    assert_roundtrips(&[(Ok(Lifetimes { a: b"abc" }), b"\x30\x05\x04\x03abc")]);
+}
+
+#[test]
+fn test_optional() {
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, Debug, PartialEq, Eq)]
+    struct OptionalFields {
+        zzz: Option<u8>,
+    }
+
+    assert_roundtrips(&[
+        (Ok(OptionalFields { zzz: None }), b"\x30\x00"),
+        (Ok(OptionalFields { zzz: Some(8) }), b"\x30\x03\x02\x01\x08"),
+        (
+            Err(asn1::ParseError::new(asn1::ParseErrorKind::ExtraData)),
+            b"\x30\x03\x04\x00\x00",
+        ),
+    ]);
+}
+
+#[test]
+fn test_explicit() {
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, Debug, PartialEq, Eq)]
+    struct EmptySequence;
+
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, Debug, PartialEq, Eq)]
+    struct ExplicitFields {
+        #[explicit(5)]
+        a: Option<u8>,
+        #[explicit(7)]
+        b: Option<EmptySequence>,
+    }
+
+    assert_roundtrips(&[
+        (
+            Ok(ExplicitFields {
+                a: Some(3),
+                b: Some(EmptySequence),
+            }),
+            b"\x30\x09\xa5\x03\x02\x01\x03\xa7\x02\x30\x00",
+        ),
+        (
+            Ok(ExplicitFields {
+                a: None,
+                b: Some(EmptySequence),
+            }),
+            b"\x30\x04\xa7\x02\x30\x00",
+        ),
+        (
+            Ok(ExplicitFields {
+                a: Some(3),
+                b: None,
+            }),
+            b"\x30\x05\xa5\x03\x02\x01\x03",
+        ),
+        (Ok(ExplicitFields { a: None, b: None }), b"\x30\x00"),
+    ]);
+}
+
+#[test]
+fn test_implicit() {
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, Debug, PartialEq, Eq)]
+    struct EmptySequence;
+
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, Debug, PartialEq, Eq)]
+    struct ImplicitFields {
+        #[implicit(5)]
+        a: Option<u8>,
+        #[implicit(7)]
+        b: Option<EmptySequence>,
+    }
+
+    assert_roundtrips(&[
+        (
+            Ok(ImplicitFields {
+                a: Some(3),
+                b: Some(EmptySequence),
+            }),
+            b"\x30\x05\x85\x01\x03\xa7\x00",
+        ),
+        (
+            Ok(ImplicitFields {
+                a: None,
+                b: Some(EmptySequence),
+            }),
+            b"\x30\x02\xa7\x00",
+        ),
+        (
+            Ok(ImplicitFields {
+                a: Some(3),
+                b: None,
+            }),
+            b"\x30\x03\x85\x01\x03",
+        ),
+        (Ok(ImplicitFields { a: None, b: None }), b"\x30\x00"),
+    ]);
+}
+
+#[test]
+fn test_default() {
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, PartialEq, Debug, Eq)]
+    struct DefaultFields {
+        #[default(13)]
+        a: u8,
+        #[default(15)]
+        #[explicit(1)]
+        b: u8,
+        #[default(17)]
+        #[implicit(5)]
+        c: u8,
+    }
+
+    assert_roundtrips(&[
+        (
+            Ok(DefaultFields {
+                a: 13,
+                b: 15,
+                c: 17,
+            }),
+            b"\x30\x00",
+        ),
+        (
+            Ok(DefaultFields { a: 3, b: 15, c: 17 }),
+            b"\x30\x03\x02\x01\x03",
+        ),
+        (
+            Ok(DefaultFields { a: 13, b: 5, c: 17 }),
+            b"\x30\x05\xa1\x03\x02\x01\x05",
+        ),
+        (
+            Ok(DefaultFields { a: 13, b: 15, c: 7 }),
+            b"\x30\x03\x85\x01\x07",
+        ),
+        (
+            Ok(DefaultFields { a: 3, b: 5, c: 7 }),
+            b"\x30\x0b\x02\x01\x03\xa1\x03\x02\x01\x05\x85\x01\x07",
+        ),
+        (
+            Err(asn1::ParseError::new(asn1::ParseErrorKind::EncodedDefault)
+                .add_location(asn1::ParseLocation::Field("DefaultFields::a"))),
+            b"\x30\x03\x02\x01\x0d",
+        ),
+        (
+            Err(asn1::ParseError::new(asn1::ParseErrorKind::EncodedDefault)
+                .add_location(asn1::ParseLocation::Field("DefaultFields::b"))),
+            b"\x30\x05\xa1\x03\x02\x01\x0f",
+        ),
+        (
+            Err(asn1::ParseError::new(asn1::ParseErrorKind::EncodedDefault)
+                .add_location(asn1::ParseLocation::Field("DefaultFields::c"))),
+            b"\x30\x03\x85\x01\x11",
+        ),
+    ]);
+}
+
+#[test]
+fn test_default_not_literal() {
+    const OID1: asn1::ObjectIdentifier = asn1::oid!(1, 2, 3);
+    const OID2: asn1::ObjectIdentifier = asn1::oid!(1, 2, 3, 4);
+
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, PartialEq, Debug, Eq)]
+    struct DefaultFields {
+        #[default(OID1)]
+        a: asn1::ObjectIdentifier,
+    }
+
+    assert_roundtrips(&[
+        (Ok(DefaultFields { a: OID1 }), b"\x30\x00"),
+        (
+            Ok(DefaultFields { a: OID2 }),
+            b"\x30\x05\x06\x03\x2a\x03\x04",
+        ),
+        (
+            Err(asn1::ParseError::new(asn1::ParseErrorKind::EncodedDefault)
+                .add_location(asn1::ParseLocation::Field("DefaultFields::a"))),
+            b"\x30\x04\x06\x02\x2a\x03",
+        ),
+    ]);
+}
+
+#[test]
+fn test_default_const_generics() {
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, PartialEq, Debug)]
+    struct DefaultFields {
+        #[default(15)]
+        a: asn1::Explicit<u8, 1>,
+        #[default(17)]
+        b: asn1::Implicit<u8, 5>,
+    }
+
+    assert_roundtrips(&[
+        (
+            Ok(DefaultFields {
+                a: asn1::Explicit::new(15),
+                b: asn1::Implicit::new(17),
+            }),
+            b"\x30\x00",
+        ),
+        (
+            Ok(DefaultFields {
+                a: asn1::Explicit::new(5),
+                b: asn1::Implicit::new(17),
+            }),
+            b"\x30\x05\xa1\x03\x02\x01\x05",
+        ),
+        (
+            Ok(DefaultFields {
+                a: asn1::Explicit::new(15),
+                b: asn1::Implicit::new(7),
+            }),
+            b"\x30\x03\x85\x01\x07",
+        ),
+        (
+            Ok(DefaultFields {
+                a: asn1::Explicit::new(5),
+                b: asn1::Implicit::new(7),
+            }),
+            b"\x30\x08\xa1\x03\x02\x01\x05\x85\x01\x07",
+        ),
+        (
+            Err(asn1::ParseError::new(asn1::ParseErrorKind::EncodedDefault)
+                .add_location(asn1::ParseLocation::Field("DefaultFields::a"))),
+            b"\x30\x05\xa1\x03\x02\x01\x0f",
+        ),
+        (
+            Err(asn1::ParseError::new(asn1::ParseErrorKind::EncodedDefault)
+                .add_location(asn1::ParseLocation::Field("DefaultFields::b"))),
+            b"\x30\x03\x85\x01\x11",
+        ),
+    ]);
+}
+
+#[test]
+fn test_default_bool() {
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, PartialEq, Debug, Eq)]
+    struct DefaultField {
+        #[default(false)]
+        a: bool,
+    }
+
+    assert_roundtrips(&[
+        (Ok(DefaultField { a: true }), b"\x30\x03\x01\x01\xff"),
+        (Ok(DefaultField { a: false }), b"\x30\x00"),
+        (
+            Err(asn1::ParseError::new(asn1::ParseErrorKind::EncodedDefault)
+                .add_location(asn1::ParseLocation::Field("DefaultField::a"))),
+            b"\x30\x03\x01\x01\x00",
+        ),
+    ]);
+}
+
+#[test]
+fn test_enum() {
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, PartialEq, Debug, Eq)]
+    enum BasicChoice {
+        A(u64),
+        B(()),
+    }
+
+    assert_roundtrips(&[
+        (Ok(BasicChoice::A(17)), b"\x02\x01\x11"),
+        (Ok(BasicChoice::B(())), b"\x05\x00"),
+        (
+            Err(asn1::ParseError::new(asn1::ParseErrorKind::UnexpectedTag {
+                actual: asn1::Tag::primitive(4),
+            })),
+            b"\x04\x00",
+        ),
+    ]);
+
+    assert_roundtrips(&[
+        (Ok(Some(BasicChoice::A(17))), b"\x02\x01\x11"),
+        (Ok(Some(BasicChoice::B(()))), b"\x05\x00"),
+        (Ok(None), b""),
+    ]);
+}
+
+#[test]
+fn test_enum_lifetimes() {
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, PartialEq, Debug, Eq)]
+    enum LifetimesChoice<'a> {
+        A(u64),
+        B(&'a [u8]),
+    }
+
+    assert_roundtrips(&[
+        (Ok(LifetimesChoice::A(17)), b"\x02\x01\x11"),
+        (Ok(LifetimesChoice::B(b"lol")), b"\x04\x03lol"),
+        (
+            Err(asn1::ParseError::new(asn1::ParseErrorKind::UnexpectedTag {
+                actual: asn1::Tag::primitive(5),
+            })),
+            b"\x05\x00",
+        ),
+    ]);
+
+    assert_roundtrips(&[
+        (Ok(Some(LifetimesChoice::A(17))), b"\x02\x01\x11"),
+        (Ok(Some(LifetimesChoice::B(b"lol"))), b"\x04\x03lol"),
+        (Ok(None), b""),
+    ]);
+}
+
+#[test]
+fn test_enum_explicit() {
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, PartialEq, Debug, Eq)]
+    enum ExplicitChoice<'a> {
+        #[explicit(5)]
+        A(u64),
+        B(&'a [u8]),
+    }
+
+    assert_roundtrips(&[
+        (Ok(ExplicitChoice::A(17)), b"\xa5\x03\x02\x01\x11"),
+        (Ok(ExplicitChoice::B(b"lol")), b"\x04\x03lol"),
+        (
+            Err(asn1::ParseError::new(asn1::ParseErrorKind::UnexpectedTag {
+                actual: asn1::Tag::primitive(5),
+            })),
+            b"\x05\x00",
+        ),
+    ]);
+
+    assert_roundtrips(&[
+        (Ok(Some(ExplicitChoice::A(17))), b"\xa5\x03\x02\x01\x11"),
+        (Ok(Some(ExplicitChoice::B(b"lol"))), b"\x04\x03lol"),
+        (Ok(None), b""),
+    ]);
+}
+
+#[test]
+fn test_enum_implicit() {
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, PartialEq, Debug, Eq)]
+    struct EmptySequence;
+
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, PartialEq, Debug, Eq)]
+    enum ImplicitChoice<'a> {
+        #[implicit(5)]
+        A(u64),
+        #[implicit(7)]
+        B(EmptySequence),
+        C(&'a [u8]),
+    }
+
+    assert_roundtrips(&[
+        (Ok(ImplicitChoice::A(17)), b"\x85\x01\x11"),
+        (Ok(ImplicitChoice::B(EmptySequence)), b"\xa7\x00"),
+        (Ok(ImplicitChoice::C(b"lol")), b"\x04\x03lol"),
+        (
+            Err(asn1::ParseError::new(asn1::ParseErrorKind::UnexpectedTag {
+                actual: asn1::Tag::primitive(5),
+            })),
+            b"\x05\x00",
+        ),
+    ]);
+
+    assert_roundtrips(&[
+        (Ok(Some(ImplicitChoice::A(17))), b"\x85\x01\x11"),
+        (Ok(Some(ImplicitChoice::B(EmptySequence))), b"\xa7\x00"),
+        (Ok(Some(ImplicitChoice::C(b"lol"))), b"\x04\x03lol"),
+        (Ok(None), b""),
+    ]);
+}
+
+#[test]
+fn test_error_parse_location() {
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, PartialEq, Debug, Eq)]
+    struct InnerSeq(u64);
+
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, PartialEq, Debug, Eq)]
+    enum InnerEnum {
+        Int(u64),
+    }
+
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, PartialEq, Debug, Eq)]
+    struct OuterSeq {
+        inner: InnerSeq,
+        inner_enum: Option<InnerEnum>,
+    }
+
+    assert_roundtrips::<OuterSeq>(&[
+        (
+            Err(asn1::ParseError::new(asn1::ParseErrorKind::InvalidValue)
+                .add_location(asn1::ParseLocation::Field("InnerSeq::0"))
+                .add_location(asn1::ParseLocation::Field("OuterSeq::inner"))),
+            b"\x30\x04\x30\x02\x02\x00",
+        ),
+        (
+            Err(asn1::ParseError::new(asn1::ParseErrorKind::InvalidValue)
+                .add_location(asn1::ParseLocation::Field("InnerEnum::Int"))
+                .add_location(asn1::ParseLocation::Field("OuterSeq::inner_enum"))),
+            b"\x30\x07\x30\x03\x02\x01\x01\x02\x00",
+        ),
+    ]);
+}
+
+#[test]
+fn test_required_implicit() {
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, PartialEq, Debug, Eq)]
+    struct RequiredImplicit {
+        #[implicit(0, required)]
+        value: u8,
+    }
+
+    assert_roundtrips::<RequiredImplicit>(&[
+        (Ok(RequiredImplicit { value: 8 }), b"\x30\x03\x80\x01\x08"),
+        (
+            Err(
+                asn1::ParseError::new(asn1::ParseErrorKind::ShortData { needed: 1 })
+                    .add_location(asn1::ParseLocation::Field("RequiredImplicit::value")),
+            ),
+            b"\x30\x00",
+        ),
+        (
+            Err(asn1::ParseError::new(asn1::ParseErrorKind::UnexpectedTag {
+                actual: asn1::Tag::primitive(11),
+            })
+            .add_location(asn1::ParseLocation::Field("RequiredImplicit::value"))),
+            b"\x30\x03\x0b\x01\x00",
+        ),
+    ]);
+}
+
+#[test]
+fn test_required_explicit() {
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, PartialEq, Debug, Eq)]
+    struct RequiredExplicit {
+        #[explicit(0, required)]
+        value: u8,
+    }
+
+    assert_roundtrips::<RequiredExplicit>(&[
+        (
+            Ok(RequiredExplicit { value: 8 }),
+            b"\x30\x05\xa0\x03\x02\x01\x08",
+        ),
+        (
+            Err(
+                asn1::ParseError::new(asn1::ParseErrorKind::ShortData { needed: 1 })
+                    .add_location(asn1::ParseLocation::Field("RequiredExplicit::value")),
+            ),
+            b"\x30\x00",
+        ),
+        (
+            Err(asn1::ParseError::new(asn1::ParseErrorKind::UnexpectedTag {
+                actual: asn1::Tag::primitive(11),
+            })
+            .add_location(asn1::ParseLocation::Field("RequiredExplicit::value"))),
+            b"\x30\x03\x0b\x01\x00",
+        ),
+    ]);
+}
+
+#[test]
+fn test_defined_by() {
+    const OID1: asn1::ObjectIdentifier = asn1::oid!(1, 2, 3);
+    const OID2: asn1::ObjectIdentifier = asn1::oid!(1, 2, 5);
+
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, PartialEq, Debug, Eq)]
+    struct S<'a> {
+        oid: asn1::DefinedByMarker<asn1::ObjectIdentifier>,
+        #[defined_by(oid)]
+        value: Value<'a>,
+    }
+
+    #[derive(asn1::Asn1DefinedByRead, asn1::Asn1DefinedByWrite, PartialEq, Debug, Eq)]
+    enum Value<'a> {
+        #[defined_by(OID1)]
+        OctetString(&'a [u8]),
+        #[defined_by(OID2)]
+        Integer(u32),
+    }
+
+    assert_roundtrips::<S>(&[
+        (
+            Ok(S {
+                oid: asn1::DefinedByMarker::marker(),
+                value: Value::OctetString(b"abc"),
+            }),
+            b"\x30\x09\x06\x02\x2a\x03\x04\x03abc",
+        ),
+        (
+            Ok(S {
+                oid: asn1::DefinedByMarker::marker(),
+                value: Value::Integer(17),
+            }),
+            b"\x30\x07\x06\x02\x2a\x05\x02\x01\x11",
+        ),
+        (
+            Err(
+                asn1::ParseError::new(asn1::ParseErrorKind::UnknownDefinedBy)
+                    .add_location(asn1::ParseLocation::Field("S::value")),
+            ),
+            b"\x30\x04\x06\x02\x2a\x07",
+        ),
+    ]);
+}
+
+#[test]
+fn test_defined_by_default() {
+    const OID1: asn1::ObjectIdentifier = asn1::oid!(1, 2, 3);
+    const OID2: asn1::ObjectIdentifier = asn1::oid!(1, 2, 5);
+
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, PartialEq, Debug, Eq)]
+    struct S<'a> {
+        oid: asn1::DefinedByMarker<asn1::ObjectIdentifier>,
+        #[defined_by(oid)]
+        value: Value<'a>,
+    }
+
+    #[derive(asn1::Asn1DefinedByRead, asn1::Asn1DefinedByWrite, PartialEq, Debug, Eq)]
+    enum Value<'a> {
+        #[defined_by(OID1)]
+        Integer(u32),
+        #[default]
+        Other(asn1::ObjectIdentifier, asn1::Tlv<'a>),
+    }
+
+    assert_roundtrips::<S>(&[
+        (
+            Ok(S {
+                oid: asn1::DefinedByMarker::marker(),
+                value: Value::Integer(7),
+            }),
+            b"\x30\x07\x06\x02\x2a\x03\x02\x01\x07",
+        ),
+        (
+            Ok(S {
+                oid: asn1::DefinedByMarker::marker(),
+                value: Value::Other(OID2, asn1::parse_single(b"\x05\x00").unwrap()),
+            }),
+            b"\x30\x06\x06\x02\x2a\x05\x05\x00",
+        ),
+    ])
+}
+
+#[test]
+fn test_defined_by_optional() {
+    const OID1: asn1::ObjectIdentifier = asn1::oid!(1, 2, 3);
+    const OID2: asn1::ObjectIdentifier = asn1::oid!(1, 2, 5);
+
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, PartialEq, Debug, Eq)]
+    struct S<'a> {
+        oid: asn1::DefinedByMarker<asn1::ObjectIdentifier>,
+        #[defined_by(oid)]
+        value: Value<'a>,
+    }
+
+    #[derive(asn1::Asn1DefinedByRead, asn1::Asn1DefinedByWrite, PartialEq, Debug, Eq)]
+    enum Value<'a> {
+        #[defined_by(OID1)]
+        OctetString(&'a [u8]),
+        #[defined_by(OID2)]
+        Other,
+    }
+
+    assert_roundtrips::<S>(&[
+        (
+            Ok(S {
+                oid: asn1::DefinedByMarker::marker(),
+                value: Value::OctetString(b"abc"),
+            }),
+            b"\x30\x09\x06\x02\x2a\x03\x04\x03abc",
+        ),
+        (
+            Ok(S {
+                oid: asn1::DefinedByMarker::marker(),
+                value: Value::Other,
+            }),
+            b"\x30\x04\x06\x02\x2a\x05",
+        ),
+        (
+            Err(
+                asn1::ParseError::new(asn1::ParseErrorKind::UnknownDefinedBy)
+                    .add_location(asn1::ParseLocation::Field("S::value")),
+            ),
+            b"\x30\x04\x06\x02\x2a\x07",
+        ),
+    ]);
+}
+
+#[test]
+fn test_defined_by_mod() {
+    mod oids {
+        pub const OID1: asn1::ObjectIdentifier = asn1::oid!(1, 2, 3);
+    }
+
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, PartialEq, Debug, Eq)]
+    struct S<'a> {
+        oid: asn1::DefinedByMarker<asn1::ObjectIdentifier>,
+        #[defined_by(oid)]
+        value: Value<'a>,
+    }
+
+    #[derive(asn1::Asn1DefinedByRead, asn1::Asn1DefinedByWrite, PartialEq, Debug, Eq)]
+    enum Value<'a> {
+        #[defined_by(oids::OID1)]
+        OctetString(&'a [u8]),
+    }
+
+    assert_roundtrips::<S>(&[
+        (
+            Ok(S {
+                oid: asn1::DefinedByMarker::marker(),
+                value: Value::OctetString(b"abc"),
+            }),
+            b"\x30\x09\x06\x02\x2a\x03\x04\x03abc",
+        ),
+        (
+            Err(
+                asn1::ParseError::new(asn1::ParseErrorKind::UnknownDefinedBy)
+                    .add_location(asn1::ParseLocation::Field("S::value")),
+            ),
+            b"\x30\x04\x06\x02\x2a\x07",
+        ),
+    ]);
+}
+
+#[test]
+fn test_defined_by_explicit() {
+    pub const OID1: asn1::ObjectIdentifier = asn1::oid!(1, 2, 3);
+
+    #[derive(asn1::Asn1Read, asn1::Asn1Write, PartialEq, Debug, Eq)]
+    struct S<'a> {
+        oid: asn1::DefinedByMarker<asn1::ObjectIdentifier>,
+        #[defined_by(oid)]
+        value: asn1::Explicit<Value<'a>, 1>,
+    }
+
+    #[derive(asn1::Asn1DefinedByRead, asn1::Asn1DefinedByWrite, PartialEq, Debug, Eq)]
+    enum Value<'a> {
+        #[defined_by(OID1)]
+        OctetString(&'a [u8]),
+    }
+
+    assert_roundtrips::<S>(&[(
+        Ok(S {
+            oid: asn1::DefinedByMarker::marker(),
+            value: asn1::Explicit::new(Value::OctetString(b"abc")),
+        }),
+        b"\x30\x0b\x06\x02\x2a\x03\xa1\x05\x04\x03abc",
+    )]);
+}
diff -pruN 43.0.0-1/rust-vendor/asn1/tests/oid_tests.rs 43.0.0-1ubuntu1/rust-vendor/asn1/tests/oid_tests.rs
--- 43.0.0-1/rust-vendor/asn1/tests/oid_tests.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1/tests/oid_tests.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,17 @@
+#[test]
+fn test_oid_value() {
+    assert_eq!(
+        asn1::oid!(1, 2, 3, 4),
+        asn1::ObjectIdentifier::from_string("1.2.3.4").unwrap()
+    );
+}
+
+#[test]
+fn test_match_statement() {
+    const OID1: asn1::ObjectIdentifier = asn1::oid!(1, 2, 3, 4);
+    const OID2: asn1::ObjectIdentifier = asn1::oid!(1, 2, 3, 5);
+
+    let oid = asn1::ObjectIdentifier::from_string("1.2.3.4").unwrap();
+    assert!(matches!(oid, OID1));
+    assert!(!matches!(oid, OID2));
+}
diff -pruN 43.0.0-1/rust-vendor/asn1/tests/roundtrip_tests.rs 43.0.0-1ubuntu1/rust-vendor/asn1/tests/roundtrip_tests.rs
--- 43.0.0-1/rust-vendor/asn1/tests/roundtrip_tests.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1/tests/roundtrip_tests.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,29 @@
+fn assert_roundtrips<T>(i: T)
+where
+    for<'a> T: asn1::Asn1Writable + asn1::Asn1Readable<'a> + std::fmt::Debug + PartialEq,
+{
+    let result = asn1::write_single::<T>(&i).unwrap();
+    let parsed = asn1::parse_single::<T>(&result).unwrap();
+    assert_eq!(parsed, i);
+}
+
+#[test]
+fn test_u8() {
+    for i in u8::MIN..=u8::MAX {
+        assert_roundtrips::<u8>(i);
+    }
+}
+
+#[test]
+fn test_i8() {
+    for i in i8::MIN..=i8::MAX {
+        assert_roundtrips::<i8>(i);
+    }
+}
+
+#[test]
+fn test_u64() {
+    for v in [0, 12356915591483590945, u64::MAX] {
+        assert_roundtrips::<u64>(v);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/asn1_derive/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/asn1_derive/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/asn1_derive/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1_derive/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"Cargo.toml":"3323c9be8132e1912992fce921b38ed387d54e8984129bd2e8d1de4b59ba0b8b","LICENSE":"c6deb2d156619439e147f8b62e1b3928598c8e3652ec8b56cc039490696b3985","src/lib.rs":"09421fa678b0f39e148abeb0233e964e99877fafec32b06c4ffe682ab7e8da57"},"package":"56e6076d38cc17cc22b0f65f31170a2ee1975e6b07f0012893aefd86ce19c987"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/asn1_derive/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/asn1_derive/Cargo.toml
--- 43.0.0-1/rust-vendor/asn1_derive/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1_derive/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,32 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2021"
+rust-version = "1.57.0"
+name = "asn1_derive"
+version = "0.16.2"
+authors = ["Alex Gaynor <alex.gaynor@gmail.com>"]
+description = "#[derive] support for asn1"
+license = "BSD-3-Clause"
+repository = "https://github.com/alex/rust-asn1"
+
+[lib]
+proc-macro = true
+
+[dependencies.proc-macro2]
+version = "1.0.60"
+
+[dependencies.quote]
+version = "1.0"
+
+[dependencies.syn]
+version = "2.0"
diff -pruN 43.0.0-1/rust-vendor/asn1_derive/LICENSE 43.0.0-1ubuntu1/rust-vendor/asn1_derive/LICENSE
--- 43.0.0-1/rust-vendor/asn1_derive/LICENSE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1_derive/LICENSE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,27 @@
+Copyright (c) Alex Gaynor and individual contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    1. Redistributions of source code must retain the above copyright notice,
+       this list of conditions and the following disclaimer.
+
+    2. Redistributions in binary form must reproduce the above copyright
+       notice, this list of conditions and the following disclaimer in the
+       documentation and/or other materials provided with the distribution.
+
+    3. Neither the name of rust-asn1 nor the names of its contributors may be used
+       to endorse or promote products derived from this software without
+       specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff -pruN 43.0.0-1/rust-vendor/asn1_derive/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/asn1_derive/src/lib.rs
--- 43.0.0-1/rust-vendor/asn1_derive/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/asn1_derive/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,728 @@
+extern crate proc_macro;
+
+use syn::parse::Parser;
+use syn::punctuated::Punctuated;
+use syn::spanned::Spanned;
+use syn::token::Comma;
+
+#[proc_macro_derive(Asn1Read, attributes(explicit, implicit, default, defined_by))]
+pub fn derive_asn1_read(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
+    let input = syn::parse_macro_input!(input as syn::DeriveInput);
+
+    let name = input.ident;
+    let (impl_lifetimes, ty_lifetimes, lifetime_name) = add_lifetime_if_none(input.generics);
+
+    let expanded = match input.data {
+        syn::Data::Struct(data) => {
+            let read_block = generate_struct_read_block(&name, &data);
+            quote::quote! {
+                impl<#impl_lifetimes> asn1::SimpleAsn1Readable<#lifetime_name> for #name<#ty_lifetimes> {
+                    const TAG: asn1::Tag = <asn1::Sequence as asn1::SimpleAsn1Readable>::TAG;
+                    fn parse_data(data: &#lifetime_name [u8]) -> asn1::ParseResult<Self> {
+                        asn1::parse(data, |p| { #read_block })
+                    }
+                }
+            }
+        }
+        syn::Data::Enum(data) => {
+            let (read_block, can_parse_block) = generate_enum_read_block(&name, &data);
+            quote::quote! {
+                impl<#impl_lifetimes> asn1::Asn1Readable<#lifetime_name> for #name<#ty_lifetimes> {
+                    fn parse(parser: &mut asn1::Parser<#lifetime_name>) -> asn1::ParseResult<Self> {
+                        let tlv = parser.read_element::<asn1::Tlv>()?;
+                        #read_block
+                        Err(asn1::ParseError::new(asn1::ParseErrorKind::UnexpectedTag{actual: tlv.tag()}))
+                    }
+
+                    fn can_parse(tag: asn1::Tag) -> bool {
+                        #can_parse_block
+                        false
+                    }
+                }
+            }
+        }
+        _ => unimplemented!("Not supported for unions"),
+    };
+
+    proc_macro::TokenStream::from(expanded)
+}
+
+#[proc_macro_derive(Asn1Write, attributes(explicit, implicit, default, defined_by))]
+pub fn derive_asn1_write(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
+    let input = syn::parse_macro_input!(input as syn::DeriveInput);
+
+    let name = input.ident;
+    let lifetimes = find_lifetimes(input.generics);
+
+    let expanded = match input.data {
+        syn::Data::Struct(data) => {
+            let write_block = generate_struct_write_block(&data);
+            quote::quote! {
+                impl<#lifetimes> asn1::SimpleAsn1Writable for #name<#lifetimes> {
+                    const TAG: asn1::Tag = <asn1::SequenceWriter as asn1::SimpleAsn1Writable>::TAG;
+                    fn write_data(&self, dest: &mut asn1::WriteBuf) -> asn1::WriteResult {
+                        #write_block
+
+                        Ok(())
+                    }
+                }
+            }
+        }
+        syn::Data::Enum(data) => {
+            let write_block = generate_enum_write_block(&name, &data);
+            quote::quote! {
+                impl<#lifetimes> asn1::Asn1Writable for #name<#lifetimes> {
+                    fn write(&self, w: &mut asn1::Writer) -> asn1::WriteResult {
+                        #write_block
+                    }
+                }
+            }
+        }
+        _ => unimplemented!("Not supported for unions"),
+    };
+
+    proc_macro::TokenStream::from(expanded)
+}
+
+enum DefinedByVariant {
+    DefinedBy(syn::Path, bool),
+    Default,
+}
+
+fn extract_defined_by_property(variant: &syn::Variant) -> DefinedByVariant {
+    if variant.attrs.iter().any(|a| a.path().is_ident("default")) {
+        return DefinedByVariant::Default;
+    }
+    let has_field = match &variant.fields {
+        syn::Fields::Unnamed(fields) => {
+            assert!(fields.unnamed.len() == 1);
+            true
+        }
+        syn::Fields::Unit => false,
+        _ => panic!("enum elements must have a single field"),
+    };
+
+    DefinedByVariant::DefinedBy(
+        variant
+            .attrs
+            .iter()
+            .find_map(|a| {
+                if a.path().is_ident("defined_by") {
+                    Some(a.parse_args::<syn::Path>().unwrap())
+                } else {
+                    None
+                }
+            })
+            .expect("Variant must have #[defined_by]"),
+        has_field,
+    )
+}
+
+#[proc_macro_derive(Asn1DefinedByRead, attributes(default, defined_by))]
+pub fn derive_asn1_defined_by_read(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
+    let input = syn::parse_macro_input!(input as syn::DeriveInput);
+
+    let name = input.ident;
+    let (impl_lifetimes, ty_lifetimes, lifetime_name) = add_lifetime_if_none(input.generics);
+
+    let mut read_block = vec![];
+    let mut default_ident = None;
+
+    match &input.data {
+        syn::Data::Enum(data) => {
+            for variant in &data.variants {
+                let ident = &variant.ident;
+                match extract_defined_by_property(variant) {
+                    DefinedByVariant::DefinedBy(defined_by, has_field) => {
+                        let read_op = if has_field {
+                            quote::quote! { #name::#ident(parser.read_element()?) }
+                        } else {
+                            quote::quote! { #name::#ident }
+                        };
+
+                        read_block.push(quote::quote! {
+                            if item == #defined_by {
+                                return Ok(#read_op);
+                            }
+                        });
+                    }
+                    DefinedByVariant::Default => {
+                        assert!(default_ident.is_none());
+                        default_ident = Some(ident);
+                    }
+                };
+            }
+        }
+        _ => panic!("Only support for enums"),
+    }
+
+    let fallback_block = if let Some(ident) = default_ident {
+        quote::quote! {
+            Ok(#name::#ident(item, parser.read_element()?))
+        }
+    } else {
+        quote::quote! {
+            Err(asn1::ParseError::new(asn1::ParseErrorKind::UnknownDefinedBy))
+        }
+    };
+    proc_macro::TokenStream::from(quote::quote! {
+        impl<#impl_lifetimes> asn1::Asn1DefinedByReadable<#lifetime_name, asn1::ObjectIdentifier> for #name<#ty_lifetimes> {
+            fn parse(item: asn1::ObjectIdentifier, parser: &mut asn1::Parser<#lifetime_name>) -> asn1::ParseResult<Self> {
+                #(#read_block)*
+
+                #fallback_block
+            }
+        }
+    })
+}
+
+#[proc_macro_derive(Asn1DefinedByWrite, attributes(default, defined_by))]
+pub fn derive_asn1_defined_by_write(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
+    let input = syn::parse_macro_input!(input as syn::DeriveInput);
+
+    let name = input.ident;
+    let lifetimes = find_lifetimes(input.generics);
+
+    let mut write_blocks = vec![];
+    let mut item_blocks = vec![];
+    match &input.data {
+        syn::Data::Enum(data) => {
+            for variant in &data.variants {
+                let ident = &variant.ident;
+                match extract_defined_by_property(variant) {
+                    DefinedByVariant::DefinedBy(defined_by, has_field) => {
+                        if has_field {
+                            write_blocks.push(quote::quote! {
+                                #name::#ident(value) => w.write_element(value),
+                            });
+                            item_blocks.push(quote::quote! {
+                                #name::#ident(..) => &#defined_by,
+                            });
+                        } else {
+                            write_blocks.push(quote::quote! {
+                                #name::#ident => { Ok(()) },
+                            });
+                            item_blocks.push(quote::quote! {
+                                #name::#ident => &#defined_by,
+                            });
+                        }
+                    }
+                    DefinedByVariant::Default => {
+                        write_blocks.push(quote::quote! {
+                            #name::#ident(_, value) => w.write_element(value),
+                        });
+                        item_blocks.push(quote::quote! {
+                            #name::#ident(defined_by, _) => &defined_by,
+                        });
+                    }
+                };
+            }
+        }
+        _ => panic!("Only support for enums"),
+    }
+
+    proc_macro::TokenStream::from(quote::quote! {
+        impl<#lifetimes> asn1::Asn1DefinedByWritable<asn1::ObjectIdentifier> for #name<#lifetimes> {
+            fn item(&self) -> &asn1::ObjectIdentifier {
+                match self {
+                    #(#item_blocks)*
+                }
+            }
+
+            fn write(&self, w: &mut asn1::Writer) -> asn1::WriteResult {
+                match self {
+                    #(#write_blocks)*
+                }
+            }
+        }
+    })
+}
+
+fn find_lifetimes(mut generics: syn::Generics) -> Punctuated<syn::Lifetime, Comma> {
+    let mut lifetimes = Punctuated::new();
+    for param in &mut generics.params {
+        if let syn::GenericParam::Lifetime(lifetime_def) = param {
+            lifetimes.push(lifetime_def.lifetime.clone());
+        }
+    }
+
+    lifetimes
+}
+
+fn add_lifetime_if_none(
+    generics: syn::Generics,
+) -> (
+    Punctuated<syn::Lifetime, Comma>,
+    Punctuated<syn::Lifetime, Comma>,
+    syn::Lifetime,
+) {
+    let mut impl_lifetimes = find_lifetimes(generics);
+    let ty_lifetimes = impl_lifetimes.clone();
+    let lifetime = impl_lifetimes.first().cloned().unwrap_or_else(|| {
+        let lifetime = syn::Lifetime::new("'a", proc_macro2::Span::call_site());
+        impl_lifetimes.push(lifetime.clone());
+        lifetime
+    });
+
+    (impl_lifetimes, ty_lifetimes, lifetime)
+}
+
+enum OpType {
+    Regular,
+    Explicit(OpTypeArgs),
+    Implicit(OpTypeArgs),
+    DefinedBy(syn::Ident),
+}
+
+struct OpTypeArgs {
+    value: proc_macro2::Literal,
+    required: bool,
+}
+
+impl syn::parse::Parse for OpTypeArgs {
+    fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {
+        let value = input.parse::<proc_macro2::Literal>()?;
+        let required = if input.lookahead1().peek(syn::Token![,]) {
+            input.parse::<syn::Token![,]>()?;
+            assert_eq!(input.parse::<syn::Ident>()?, "required");
+            true
+        } else {
+            false
+        };
+        Ok(OpTypeArgs { value, required })
+    }
+}
+
+fn extract_field_properties(attrs: &[syn::Attribute]) -> (OpType, Option<syn::Expr>) {
+    let mut op_type = OpType::Regular;
+    let mut default = None;
+    for attr in attrs {
+        if attr.path().is_ident("explicit") {
+            if let OpType::Regular = op_type {
+                op_type = OpType::Explicit(attr.parse_args::<OpTypeArgs>().unwrap());
+            } else {
+                panic!("Can't specify #[explicit] or #[implicit] more than once")
+            }
+        } else if attr.path().is_ident("implicit") {
+            if let OpType::Regular = op_type {
+                op_type = OpType::Implicit(attr.parse_args::<OpTypeArgs>().unwrap());
+            } else {
+                panic!("Can't specify #[explicit] or #[implicit] more than once")
+            }
+        } else if attr.path().is_ident("default") {
+            assert!(default.is_none(), "Can't specify #[default] more than once");
+            default = Some(attr.parse_args::<syn::Expr>().unwrap());
+        } else if attr.path().is_ident("defined_by") {
+            op_type = OpType::DefinedBy(attr.parse_args::<syn::Ident>().unwrap());
+        }
+    }
+
+    (op_type, default)
+}
+
+fn generate_read_element(
+    struct_name: &syn::Ident,
+    f: &syn::Field,
+    f_name: &str,
+    is_defined_by_marker: bool,
+) -> proc_macro2::TokenStream {
+    let (read_type, default) = extract_field_properties(&f.attrs);
+
+    let error_location = format!("{}::{}", struct_name, f_name);
+    let add_error_location = quote::quote! {
+        .map_err(|e| e.add_location(asn1::ParseLocation::Field(#error_location)))
+    };
+    let mut read_op = match read_type {
+        OpType::Explicit(arg) => {
+            let value = arg.value;
+            if arg.required {
+                quote::quote! {
+                    p.read_element::<asn1::Explicit<_, #value>>()#add_error_location?.into_inner()
+                }
+            } else {
+                quote::quote! {
+                    p.read_element::<Option<asn1::Explicit<_, #value>>>()#add_error_location?.map(asn1::Explicit::into_inner)
+                }
+            }
+        }
+        OpType::Implicit(arg) => {
+            let value = arg.value;
+            if arg.required {
+                quote::quote! {
+                    p.read_element::<asn1::Implicit<_, #value>>()#add_error_location?.into_inner()
+                }
+            } else {
+                quote::quote! {
+                    p.read_element::<Option<asn1::Implicit<_, #value>>>()#add_error_location?.map(asn1::Implicit::into_inner)
+                }
+            }
+        }
+        OpType::Regular => {
+            if is_defined_by_marker {
+                let f = syn::Ident::new(f_name, proc_macro2::Span::call_site());
+                quote::quote! {{
+                    #f = p.read_element()#add_error_location?;
+                    asn1::DefinedByMarker::marker()
+                }}
+            } else {
+                quote::quote! {
+                    p.read_element()#add_error_location?
+                }
+            }
+        }
+        OpType::DefinedBy(ident) => quote::quote! {
+            asn1::read_defined_by(#ident, p)#add_error_location?
+        },
+    };
+    if let Some(default) = default {
+        read_op = quote::quote! {{
+            asn1::from_optional_default(#read_op, #default.into())#add_error_location?
+        }};
+    }
+    read_op
+}
+
+fn generate_struct_read_block(
+    struct_name: &syn::Ident,
+    data: &syn::DataStruct,
+) -> proc_macro2::TokenStream {
+    match data.fields {
+        syn::Fields::Named(ref fields) => {
+            let defined_by_markers = fields
+                .named
+                .iter()
+                .filter_map(|f| {
+                    let (op_type, _) = extract_field_properties(&f.attrs);
+                    match op_type {
+                        OpType::DefinedBy(ident) => Some(ident),
+                        _ => None,
+                    }
+                })
+                .collect::<Vec<_>>();
+
+            let defined_by_markers_definitions = defined_by_markers.iter().map(|f| {
+                quote::quote! {
+                    let #f;
+                }
+            });
+
+            let recurse = fields.named.iter().map(|f| {
+                let name = &f.ident;
+                let is_defined_by_marker = name
+                    .as_ref()
+                    .map_or(false, |n| defined_by_markers.contains(n));
+                let read_op = generate_read_element(
+                    struct_name,
+                    f,
+                    &format!("{}", name.as_ref().unwrap()),
+                    is_defined_by_marker,
+                );
+                quote::quote_spanned! {f.span() =>
+                    #name: #read_op,
+                }
+            });
+
+            quote::quote! {
+                #(#defined_by_markers_definitions)*
+
+                Ok(Self {
+                    #(#recurse)*
+                })
+            }
+        }
+        syn::Fields::Unnamed(ref fields) => {
+            let recurse = fields.unnamed.iter().enumerate().map(|(i, f)| {
+                let read_op = generate_read_element(struct_name, f, &format!("{}", i), false);
+                quote::quote_spanned! {f.span() =>
+                    #read_op,
+                }
+            });
+
+            quote::quote! {
+                Ok(Self(
+                    #(#recurse)*
+                ))
+            }
+        }
+        syn::Fields::Unit => {
+            quote::quote! { Ok(Self) }
+        }
+    }
+}
+
+fn generate_enum_read_block(
+    name: &syn::Ident,
+    data: &syn::DataEnum,
+) -> (proc_macro2::TokenStream, proc_macro2::TokenStream) {
+    let mut read_blocks = vec![];
+    let mut can_parse_blocks = vec![];
+
+    for variant in &data.variants {
+        let field = match &variant.fields {
+            syn::Fields::Unnamed(fields) => {
+                assert_eq!(fields.unnamed.len(), 1);
+                &fields.unnamed[0]
+            }
+            _ => panic!("enum elements must have a single field"),
+        };
+        let (op_type, default) = extract_field_properties(&variant.attrs);
+        assert!(default.is_none());
+
+        let ty = &field.ty;
+        let ident = &variant.ident;
+
+        let error_location = format!("{}::{}", name, ident);
+        let add_error_location = quote::quote! {
+            .map_err(|e| e.add_location(asn1::ParseLocation::Field(#error_location)))
+        };
+        match op_type {
+            OpType::Regular => {
+                read_blocks.push(quote::quote! {
+                    if <#ty>::can_parse(tlv.tag()) {
+                        return Ok(#name::#ident(tlv.parse()#add_error_location?));
+                    }
+                });
+                can_parse_blocks.push(quote::quote! {
+                    if <#ty>::can_parse(tag) {
+                        return true;
+                    }
+                });
+            }
+            OpType::Explicit(arg) => {
+                let tag = arg.value;
+                read_blocks.push(quote::quote! {
+                    if tlv.tag() == asn1::explicit_tag(#tag) {
+                        return Ok(#name::#ident(asn1::parse(
+                            tlv.full_data(),
+                            |p| Ok(p.read_element::<asn1::Explicit<_, #tag>>()#add_error_location?.into_inner())
+                        )?))
+                    }
+                });
+                can_parse_blocks.push(quote::quote! {
+                    if tag == asn1::explicit_tag(#tag) {
+                        return true;
+                    }
+                });
+            }
+            OpType::Implicit(arg) => {
+                let tag = arg.value;
+                read_blocks.push(quote::quote! {
+                    if tlv.tag() == asn1::implicit_tag(#tag, <#ty as asn1::SimpleAsn1Readable>::TAG) {
+                        return Ok(#name::#ident(asn1::parse(
+                            tlv.full_data(),
+                            |p| Ok(p.read_element::<asn1::Implicit<_, #tag>>()#add_error_location?.into_inner())
+                        )?))
+                    }
+                });
+                can_parse_blocks.push(quote::quote! {
+                    if tag == asn1::implicit_tag(#tag, <#ty as asn1::SimpleAsn1Readable>::TAG) {
+                        return true;
+                    }
+                });
+            }
+            OpType::DefinedBy(_) => panic!("Can't use #[defined_by] in an Asn1Read on an enum"),
+        };
+    }
+
+    let read_block = quote::quote! {
+        #(#read_blocks)*
+    };
+    let can_parse_block = quote::quote! {
+        #(#can_parse_blocks)*
+    };
+    (read_block, can_parse_block)
+}
+
+fn generate_write_element(
+    f: &syn::Field,
+    mut field_read: proc_macro2::TokenStream,
+    defined_by_marker_origin: Option<proc_macro2::TokenStream>,
+) -> proc_macro2::TokenStream {
+    let (write_type, default) = extract_field_properties(&f.attrs);
+
+    if let Some(default) = default {
+        field_read = quote::quote! {&{
+            asn1::to_optional_default(#field_read, &(#default).into())
+        }}
+    }
+
+    match write_type {
+        OpType::Explicit(arg) => {
+            let value = arg.value;
+            if arg.required {
+                quote::quote_spanned! {f.span() =>
+                    w.write_explicit_element(#field_read, #value)?;
+                }
+            } else {
+                quote::quote_spanned! {f.span() =>
+                    w.write_optional_explicit_element(#field_read, #value)?;
+                }
+            }
+        }
+        OpType::Implicit(arg) => {
+            let value = arg.value;
+            if arg.required {
+                quote::quote_spanned! {f.span() =>
+                    w.write_implicit_element(#field_read, #value)?;
+                }
+            } else {
+                quote::quote_spanned! {f.span() =>
+                    w.write_optional_implicit_element(#field_read, #value)?;
+                }
+            }
+        }
+        OpType::Regular => {
+            if let Some(defined_by_marker_read) = defined_by_marker_origin {
+                quote::quote! {
+                    w.write_element(asn1::writable_defined_by_item(#defined_by_marker_read))?;
+                }
+            } else {
+                quote::quote! {
+                    w.write_element(#field_read)?;
+                }
+            }
+        }
+        OpType::DefinedBy(_) => quote::quote! {
+            asn1::write_defined_by(#field_read, &mut w)?;
+        },
+    }
+}
+
+fn generate_struct_write_block(data: &syn::DataStruct) -> proc_macro2::TokenStream {
+    match data.fields {
+        syn::Fields::Named(ref fields) => {
+            let defined_by_markers = fields
+                .named
+                .iter()
+                .filter_map(|f| {
+                    let (op_type, _) = extract_field_properties(&f.attrs);
+                    match op_type {
+                        OpType::DefinedBy(ident) => Some((ident, &f.ident)),
+                        _ => None,
+                    }
+                })
+                .collect::<std::collections::hash_map::HashMap<_, _>>();
+
+            let recurse = fields.named.iter().map(|f| {
+                let name = &f.ident;
+                let defined_by_marker_origin = name.as_ref().and_then(|n| {
+                    defined_by_markers.get(n).map(|v| {
+                        quote::quote! { &self.#v }
+                    })
+                });
+                generate_write_element(f, quote::quote! { &self.#name }, defined_by_marker_origin)
+            });
+
+            quote::quote! {
+                let mut w = asn1::Writer::new(dest);
+                #(#recurse)*
+            }
+        }
+        syn::Fields::Unnamed(ref fields) => {
+            let recurse = fields.unnamed.iter().enumerate().map(|(i, f)| {
+                let index = syn::Index::from(i);
+                generate_write_element(f, quote::quote! { &self.#index }, None)
+            });
+
+            quote::quote! {
+                let mut w = asn1::Writer::new(dest);
+                #(#recurse)*
+            }
+        }
+        syn::Fields::Unit => {
+            quote::quote! {}
+        }
+    }
+}
+
+fn generate_enum_write_block(name: &syn::Ident, data: &syn::DataEnum) -> proc_macro2::TokenStream {
+    let write_arms = data.variants.iter().map(|v| {
+        match &v.fields {
+            syn::Fields::Unnamed(fields) => {
+                assert_eq!(fields.unnamed.len(), 1);
+            }
+            _ => panic!("enum elements must have a single field"),
+        };
+        let (op_type, default) = extract_field_properties(&v.attrs);
+        assert!(default.is_none());
+        let ident = &v.ident;
+
+        match op_type {
+            OpType::Regular => {
+                quote::quote! {
+                    #name::#ident(value) => w.write_element(value),
+                }
+            }
+            OpType::Explicit(arg) => {
+                let tag = arg.value;
+                quote::quote! {
+                    #name::#ident(value) => w.write_explicit_element(&value, #tag),
+                }
+            }
+            OpType::Implicit(arg) => {
+                let tag = arg.value;
+                quote::quote! {
+                    #name::#ident(value) => w.write_implicit_element(&value, #tag),
+                }
+            }
+            OpType::DefinedBy(_) => panic!("Can't use #[defined_by] in an Asn1Write on an enum"),
+        }
+    });
+    quote::quote! {
+        match self {
+            #(#write_arms)*
+        }
+    }
+}
+
+// TODO: Duplicate of this function in src/object_identifier.rs, can we
+// de-dupe?
+fn _write_base128_int(data: &mut Vec<u8>, n: u32) {
+    if n == 0 {
+        data.push(0);
+        return;
+    }
+
+    let mut l = 0;
+    let mut i = n;
+    while i > 0 {
+        l += 1;
+        i >>= 7;
+    }
+
+    for i in (0..l).rev() {
+        let mut o = (n >> (i * 7)) as u8;
+        o &= 0x7f;
+        if i != 0 {
+            o |= 0x80;
+        }
+        data.push(o);
+    }
+}
+
+#[proc_macro]
+pub fn oid(item: proc_macro::TokenStream) -> proc_macro::TokenStream {
+    let p_arcs = Punctuated::<syn::LitInt, syn::Token![,]>::parse_terminated
+        .parse(item)
+        .unwrap();
+    let mut arcs = p_arcs.iter();
+
+    let mut der_encoded = vec![];
+    let first = arcs.next().unwrap().base10_parse::<u32>().unwrap();
+    let second = arcs.next().unwrap().base10_parse::<u32>().unwrap();
+    _write_base128_int(&mut der_encoded, 40 * first + second);
+    for arc in arcs {
+        _write_base128_int(&mut der_encoded, arc.base10_parse().unwrap());
+    }
+
+    let der_len = der_encoded.len();
+    // TODO: is there a way to use the `MAX_OID_LENGTH` constant here?
+    assert!(der_len <= 63);
+    der_encoded.resize(63, 0);
+    let der_lit = syn::LitByteStr::new(&der_encoded, proc_macro2::Span::call_site());
+    let expanded = quote::quote! {
+        asn1::ObjectIdentifier::from_der_unchecked(*#der_lit, #der_len as u8)
+    };
+
+    proc_macro::TokenStream::from(expanded)
+}
diff -pruN 43.0.0-1/rust-vendor/autocfg/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/autocfg/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/autocfg/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/autocfg/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"Cargo.lock":"8e60b691c883629c1e19c8dad7c4c18cded1a85c2e8f2e2a77e7a96957f865a7","Cargo.toml":"f8c2d5675773b7ddff8801c3c17ff9d26e9632fe2027a6b81ceb7bda67d71bfd","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"27995d58ad5c1145c1a8cd86244ce844886958a35eb2b78c6b772748669999ac","README.md":"51238410cbbb06b149a794d954ff4d5943da566a97e71dc3aa8b5fa5a9b538b6","examples/integers.rs":"589ff4271566dfa322becddf3e2c7b592e6e0bc97b02892ce75619b7e452e930","examples/nightly.rs":"ac8b5a9aa1e04465e44f5053b3c899b635e07af058c73aa8b45176bf4b5912f9","examples/paths.rs":"1b30e466b824ce8df7ad0a55334424131d9d2573d6cf9f7d5d50c09c8901d526","examples/traits.rs":"cbee6a3e1f7db60b02ae25b714926517144a77cb492021f492774cf0e1865a9e","examples/versions.rs":"38535e6d9f5bfae0de474a3db79a40e8f5da8ba9334c5ff4c363de9bc99d4d12","src/error.rs":"fd8ff67c64f7cd1b9f81325a81de4baa34c39d6ae298bdb33f9829cc91acac39","src/lib.rs":"7b00cd501b52bab797bf047ada2a446e16fc2b8b05567670d8b8b7ada3179f55","src/rustc.rs":"a8a213ddb64a05c1a1af933bcb331a98879e942b167c33d8f94f9f60ebb14e29","src/tests.rs":"594a1cff6fef4a0f8b5f962a668fda4030db5005f37f01eeb06d692fc48a60df","src/version.rs":"4f7d23b36f01c7be1871be86c038d6cb4689e145d67c82d3793690e9aa05b133","tests/no_std.rs":"cc5619466c6e955552f30ed2f80ba8ddf45c3d5d257f628f54dedc0da978f6aa","tests/rustflags.rs":"5c8169b88216055019db61b5d7baf4abdf675e3b14b54f5037bb1e3acd0a5d3f","tests/wrap_ignored":"a9e241edf584a0702066b25bc15c5bbfd8a1019e14fb655fc4f47a67360065ca","tests/wrappers.rs":"e8eb0eb5ac28ecd9e3473b5ddc321b1d4d523a6fb0c072255ac37d40674aa35c"},"package":"0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/autocfg/Cargo.lock 43.0.0-1ubuntu1/rust-vendor/autocfg/Cargo.lock
--- 43.0.0-1/rust-vendor/autocfg/Cargo.lock	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/autocfg/Cargo.lock	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "autocfg"
+version = "1.3.0"
diff -pruN 43.0.0-1/rust-vendor/autocfg/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/autocfg/Cargo.toml
--- 43.0.0-1/rust-vendor/autocfg/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/autocfg/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,30 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+rust-version = "1.0"
+name = "autocfg"
+version = "1.3.0"
+authors = ["Josh Stone <cuviper@gmail.com>"]
+exclude = ["/.github/**"]
+description = "Automatic cfg for Rust compiler features"
+documentation = "https://docs.rs/autocfg/"
+readme = "README.md"
+keywords = [
+    "rustc",
+    "build",
+    "autoconf",
+]
+categories = ["development-tools::build-utils"]
+license = "Apache-2.0 OR MIT"
+repository = "https://github.com/cuviper/autocfg"
+
+[dependencies]
diff -pruN 43.0.0-1/rust-vendor/autocfg/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/autocfg/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/autocfg/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/autocfg/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,201 @@
+                              Apache License
+                        Version 2.0, January 2004
+                     http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+   "License" shall mean the terms and conditions for use, reproduction,
+   and distribution as defined by Sections 1 through 9 of this document.
+
+   "Licensor" shall mean the copyright owner or entity authorized by
+   the copyright owner that is granting the License.
+
+   "Legal Entity" shall mean the union of the acting entity and all
+   other entities that control, are controlled by, or are under common
+   control with that entity. For the purposes of this definition,
+   "control" means (i) the power, direct or indirect, to cause the
+   direction or management of such entity, whether by contract or
+   otherwise, or (ii) ownership of fifty percent (50%) or more of the
+   outstanding shares, or (iii) beneficial ownership of such entity.
+
+   "You" (or "Your") shall mean an individual or Legal Entity
+   exercising permissions granted by this License.
+
+   "Source" form shall mean the preferred form for making modifications,
+   including but not limited to software source code, documentation
+   source, and configuration files.
+
+   "Object" form shall mean any form resulting from mechanical
+   transformation or translation of a Source form, including but
+   not limited to compiled object code, generated documentation,
+   and conversions to other media types.
+
+   "Work" shall mean the work of authorship, whether in Source or
+   Object form, made available under the License, as indicated by a
+   copyright notice that is included in or attached to the work
+   (an example is provided in the Appendix below).
+
+   "Derivative Works" shall mean any work, whether in Source or Object
+   form, that is based on (or derived from) the Work and for which the
+   editorial revisions, annotations, elaborations, or other modifications
+   represent, as a whole, an original work of authorship. For the purposes
+   of this License, Derivative Works shall not include works that remain
+   separable from, or merely link (or bind by name) to the interfaces of,
+   the Work and Derivative Works thereof.
+
+   "Contribution" shall mean any work of authorship, including
+   the original version of the Work and any modifications or additions
+   to that Work or Derivative Works thereof, that is intentionally
+   submitted to Licensor for inclusion in the Work by the copyright owner
+   or by an individual or Legal Entity authorized to submit on behalf of
+   the copyright owner. For the purposes of this definition, "submitted"
+   means any form of electronic, verbal, or written communication sent
+   to the Licensor or its representatives, including but not limited to
+   communication on electronic mailing lists, source code control systems,
+   and issue tracking systems that are managed by, or on behalf of, the
+   Licensor for the purpose of discussing and improving the Work, but
+   excluding communication that is conspicuously marked or otherwise
+   designated in writing by the copyright owner as "Not a Contribution."
+
+   "Contributor" shall mean Licensor and any individual or Legal Entity
+   on behalf of whom a Contribution has been received by Licensor and
+   subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   copyright license to reproduce, prepare Derivative Works of,
+   publicly display, publicly perform, sublicense, and distribute the
+   Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   (except as stated in this section) patent license to make, have made,
+   use, offer to sell, sell, import, and otherwise transfer the Work,
+   where such license applies only to those patent claims licensable
+   by such Contributor that are necessarily infringed by their
+   Contribution(s) alone or by combination of their Contribution(s)
+   with the Work to which such Contribution(s) was submitted. If You
+   institute patent litigation against any entity (including a
+   cross-claim or counterclaim in a lawsuit) alleging that the Work
+   or a Contribution incorporated within the Work constitutes direct
+   or contributory patent infringement, then any patent licenses
+   granted to You under this License for that Work shall terminate
+   as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+   Work or Derivative Works thereof in any medium, with or without
+   modifications, and in Source or Object form, provided that You
+   meet the following conditions:
+
+   (a) You must give any other recipients of the Work or
+       Derivative Works a copy of this License; and
+
+   (b) You must cause any modified files to carry prominent notices
+       stating that You changed the files; and
+
+   (c) You must retain, in the Source form of any Derivative Works
+       that You distribute, all copyright, patent, trademark, and
+       attribution notices from the Source form of the Work,
+       excluding those notices that do not pertain to any part of
+       the Derivative Works; and
+
+   (d) If the Work includes a "NOTICE" text file as part of its
+       distribution, then any Derivative Works that You distribute must
+       include a readable copy of the attribution notices contained
+       within such NOTICE file, excluding those notices that do not
+       pertain to any part of the Derivative Works, in at least one
+       of the following places: within a NOTICE text file distributed
+       as part of the Derivative Works; within the Source form or
+       documentation, if provided along with the Derivative Works; or,
+       within a display generated by the Derivative Works, if and
+       wherever such third-party notices normally appear. The contents
+       of the NOTICE file are for informational purposes only and
+       do not modify the License. You may add Your own attribution
+       notices within Derivative Works that You distribute, alongside
+       or as an addendum to the NOTICE text from the Work, provided
+       that such additional attribution notices cannot be construed
+       as modifying the License.
+
+   You may add Your own copyright statement to Your modifications and
+   may provide additional or different license terms and conditions
+   for use, reproduction, or distribution of Your modifications, or
+   for any such Derivative Works as a whole, provided Your use,
+   reproduction, and distribution of the Work otherwise complies with
+   the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+   any Contribution intentionally submitted for inclusion in the Work
+   by You to the Licensor shall be under the terms and conditions of
+   this License, without any additional terms or conditions.
+   Notwithstanding the above, nothing herein shall supersede or modify
+   the terms of any separate license agreement you may have executed
+   with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+   names, trademarks, service marks, or product names of the Licensor,
+   except as required for reasonable and customary use in describing the
+   origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+   agreed to in writing, Licensor provides the Work (and each
+   Contributor provides its Contributions) on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+   implied, including, without limitation, any warranties or conditions
+   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+   PARTICULAR PURPOSE. You are solely responsible for determining the
+   appropriateness of using or redistributing the Work and assume any
+   risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+   whether in tort (including negligence), contract, or otherwise,
+   unless required by applicable law (such as deliberate and grossly
+   negligent acts) or agreed to in writing, shall any Contributor be
+   liable to You for damages, including any direct, indirect, special,
+   incidental, or consequential damages of any character arising as a
+   result of this License or out of the use or inability to use the
+   Work (including but not limited to damages for loss of goodwill,
+   work stoppage, computer failure or malfunction, or any and all
+   other commercial damages or losses), even if such Contributor
+   has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+   the Work or Derivative Works thereof, You may choose to offer,
+   and charge a fee for, acceptance of support, warranty, indemnity,
+   or other liability obligations and/or rights consistent with this
+   License. However, in accepting such obligations, You may act only
+   on Your own behalf and on Your sole responsibility, not on behalf
+   of any other Contributor, and only if You agree to indemnify,
+   defend, and hold each Contributor harmless for any liability
+   incurred by, or claims asserted against, such Contributor by reason
+   of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+   To apply the Apache License to your work, attach the following
+   boilerplate notice, with the fields enclosed by brackets "[]"
+   replaced with your own identifying information. (Don't include
+   the brackets!)  The text should be enclosed in the appropriate
+   comment syntax for the file format. We also recommend that a
+   file or class name and description of purpose be included on the
+   same "printed page" as the copyright notice for easier
+   identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+	http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff -pruN 43.0.0-1/rust-vendor/autocfg/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/autocfg/LICENSE-MIT
--- 43.0.0-1/rust-vendor/autocfg/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/autocfg/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,25 @@
+Copyright (c) 2018 Josh Stone
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/autocfg/README.md 43.0.0-1ubuntu1/rust-vendor/autocfg/README.md
--- 43.0.0-1/rust-vendor/autocfg/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/autocfg/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,105 @@
+autocfg
+=======
+
+[![autocfg crate](https://img.shields.io/crates/v/autocfg.svg)](https://crates.io/crates/autocfg)
+[![autocfg documentation](https://docs.rs/autocfg/badge.svg)](https://docs.rs/autocfg)
+![minimum rustc 1.0](https://img.shields.io/badge/rustc-1.0+-red.svg)
+![build status](https://github.com/cuviper/autocfg/workflows/master/badge.svg)
+
+A Rust library for build scripts to automatically configure code based on
+compiler support.  Code snippets are dynamically tested to see if the `rustc`
+will accept them, rather than hard-coding specific version support.
+
+
+## Usage
+
+Add this to your `Cargo.toml`:
+
+```toml
+[build-dependencies]
+autocfg = "1"
+```
+
+Then use it in your `build.rs` script to detect compiler features.  For
+example, to test for 128-bit integer support, it might look like:
+
+```rust
+extern crate autocfg;
+
+fn main() {
+    let ac = autocfg::new();
+    ac.emit_has_type("i128");
+
+    // (optional) We don't need to rerun for anything external.
+    autocfg::rerun_path("build.rs");
+}
+```
+
+If the type test succeeds, this will write a `cargo:rustc-cfg=has_i128` line
+for Cargo, which translates to Rust arguments `--cfg has_i128`.  Then in the
+rest of your Rust code, you can add `#[cfg(has_i128)]` conditions on code that
+should only be used when the compiler supports it.
+
+
+## Release Notes
+
+- 1.3.0 (2024-05-03)
+
+  - Add `probe_raw` for direct control of the code that will be test-compiled.
+  - Use wrappers when querying the `rustc` version information too.
+
+- 1.2.0 (2024-03-25)
+
+  - Add `no_std` and `set_no_std` to control the use of `#![no_std]` in probes.
+  - Use `RUSTC_WRAPPER` and `RUSTC_WORKSPACE_WRAPPER` when they are set.
+
+- 1.1.0 (2022-02-07)
+  - Use `CARGO_ENCODED_RUSTFLAGS` when it is set.
+
+- 1.0.1 (2020-08-20)
+  - Apply `RUSTFLAGS` for more `--target` scenarios, by @adamreichold.
+
+- 1.0.0 (2020-01-08)
+  - 🎉 Release 1.0! 🎉 (no breaking changes)
+  - Add `probe_expression` and `emit_expression_cfg` to test arbitrary expressions.
+  - Add `probe_constant` and `emit_constant_cfg` to test arbitrary constant expressions.
+
+- 0.1.7 (2019-10-20)
+  - Apply `RUSTFLAGS` when probing `$TARGET != $HOST`, mainly for sysroot, by @roblabla.
+
+- 0.1.6 (2019-08-19)
+  - Add `probe`/`emit_sysroot_crate`, by @leo60228.
+
+- 0.1.5 (2019-07-16)
+  - Mask some warnings from newer rustc.
+
+- 0.1.4 (2019-05-22)
+  - Relax `std`/`no_std` probing to a warning instead of an error.
+  - Improve `rustc` bootstrap compatibility.
+
+- 0.1.3 (2019-05-21)
+  - Auto-detects if `#![no_std]` is needed for the `$TARGET`.
+
+- 0.1.2 (2019-01-16)
+  - Add `rerun_env(ENV)` to print `cargo:rerun-if-env-changed=ENV`.
+  - Add `rerun_path(PATH)` to print `cargo:rerun-if-changed=PATH`.
+
+
+## Minimum Rust version policy
+
+This crate's minimum supported `rustc` version is `1.0.0`.  Compatibility is
+its entire reason for existence, so this crate will be extremely conservative
+about raising this requirement.  If this is ever deemed necessary, it will be
+treated as a major breaking change for semver purposes.
+
+
+## License
+
+This project is licensed under either of
+
+ * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
+   https://www.apache.org/licenses/LICENSE-2.0)
+ * MIT license ([LICENSE-MIT](LICENSE-MIT) or
+   https://opensource.org/licenses/MIT)
+
+at your option.
diff -pruN 43.0.0-1/rust-vendor/autocfg/examples/integers.rs 43.0.0-1ubuntu1/rust-vendor/autocfg/examples/integers.rs
--- 43.0.0-1/rust-vendor/autocfg/examples/integers.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/autocfg/examples/integers.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,9 @@
+extern crate autocfg;
+
+fn main() {
+    // Normally, cargo will set `OUT_DIR` for build scripts.
+    let ac = autocfg::AutoCfg::with_dir("target").unwrap();
+    for i in 3..8 {
+        ac.emit_has_type(&format!("i{}", 1 << i));
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/autocfg/examples/nightly.rs 43.0.0-1ubuntu1/rust-vendor/autocfg/examples/nightly.rs
--- 43.0.0-1/rust-vendor/autocfg/examples/nightly.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/autocfg/examples/nightly.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,18 @@
+extern crate autocfg;
+
+fn main() {
+    // Normally, cargo will set `OUT_DIR` for build scripts.
+    let ac = autocfg::AutoCfg::with_dir("target").unwrap();
+
+    // When this feature was stabilized, it also renamed the method to
+    // `chunk_by`, so it's important to *use* the feature in your probe.
+    let code = r#"
+        #![feature(slice_group_by)]
+        pub fn probe(slice: &[i32]) -> impl Iterator<Item = &[i32]> {
+            slice.group_by(|a, b| a == b)
+        }
+    "#;
+    if ac.probe_raw(code).is_ok() {
+        autocfg::emit("has_slice_group_by");
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/autocfg/examples/paths.rs 43.0.0-1ubuntu1/rust-vendor/autocfg/examples/paths.rs
--- 43.0.0-1/rust-vendor/autocfg/examples/paths.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/autocfg/examples/paths.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,22 @@
+extern crate autocfg;
+
+fn main() {
+    // Normally, cargo will set `OUT_DIR` for build scripts.
+    let ac = autocfg::AutoCfg::with_dir("target").unwrap();
+
+    // since ancient times...
+    ac.emit_has_path("std::vec::Vec");
+    ac.emit_path_cfg("std::vec::Vec", "has_vec");
+
+    // rustc 1.10.0
+    ac.emit_has_path("std::panic::PanicInfo");
+    ac.emit_path_cfg("std::panic::PanicInfo", "has_panic_info");
+
+    // rustc 1.20.0
+    ac.emit_has_path("std::mem::ManuallyDrop");
+    ac.emit_path_cfg("std::mem::ManuallyDrop", "has_manually_drop");
+
+    // rustc 1.25.0
+    ac.emit_has_path("std::ptr::NonNull");
+    ac.emit_path_cfg("std::ptr::NonNull", "has_non_null");
+}
diff -pruN 43.0.0-1/rust-vendor/autocfg/examples/traits.rs 43.0.0-1ubuntu1/rust-vendor/autocfg/examples/traits.rs
--- 43.0.0-1/rust-vendor/autocfg/examples/traits.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/autocfg/examples/traits.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,26 @@
+extern crate autocfg;
+
+fn main() {
+    // Normally, cargo will set `OUT_DIR` for build scripts.
+    let ac = autocfg::AutoCfg::with_dir("target").unwrap();
+
+    // since ancient times...
+    ac.emit_has_trait("std::ops::Add");
+    ac.emit_trait_cfg("std::ops::Add", "has_ops");
+
+    // trait parameters have to be provided
+    ac.emit_has_trait("std::borrow::Borrow<str>");
+    ac.emit_trait_cfg("std::borrow::Borrow<str>", "has_borrow");
+
+    // rustc 1.8.0
+    ac.emit_has_trait("std::ops::AddAssign");
+    ac.emit_trait_cfg("std::ops::AddAssign", "has_assign_ops");
+
+    // rustc 1.12.0
+    ac.emit_has_trait("std::iter::Sum");
+    ac.emit_trait_cfg("std::iter::Sum", "has_sum");
+
+    // rustc 1.28.0
+    ac.emit_has_trait("std::alloc::GlobalAlloc");
+    ac.emit_trait_cfg("std::alloc::GlobalAlloc", "has_global_alloc");
+}
diff -pruN 43.0.0-1/rust-vendor/autocfg/examples/versions.rs 43.0.0-1ubuntu1/rust-vendor/autocfg/examples/versions.rs
--- 43.0.0-1/rust-vendor/autocfg/examples/versions.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/autocfg/examples/versions.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,9 @@
+extern crate autocfg;
+
+fn main() {
+    // Normally, cargo will set `OUT_DIR` for build scripts.
+    let ac = autocfg::AutoCfg::with_dir("target").unwrap();
+    for i in 0..100 {
+        ac.emit_rustc_version(1, i);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/autocfg/src/error.rs 43.0.0-1ubuntu1/rust-vendor/autocfg/src/error.rs
--- 43.0.0-1/rust-vendor/autocfg/src/error.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/autocfg/src/error.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,81 @@
+use std::error;
+use std::fmt;
+use std::io;
+use std::num;
+use std::process;
+use std::str;
+
+/// A common error type for the `autocfg` crate.
+#[derive(Debug)]
+pub struct Error {
+    kind: ErrorKind,
+}
+
+impl error::Error for Error {
+    fn description(&self) -> &str {
+        "AutoCfg error"
+    }
+
+    fn cause(&self) -> Option<&error::Error> {
+        match self.kind {
+            ErrorKind::Io(ref e) => Some(e),
+            ErrorKind::Num(ref e) => Some(e),
+            ErrorKind::Utf8(ref e) => Some(e),
+            ErrorKind::Process(_) | ErrorKind::Other(_) => None,
+        }
+    }
+}
+
+impl fmt::Display for Error {
+    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+        match self.kind {
+            ErrorKind::Io(ref e) => e.fmt(f),
+            ErrorKind::Num(ref e) => e.fmt(f),
+            ErrorKind::Utf8(ref e) => e.fmt(f),
+            ErrorKind::Process(ref status) => {
+                // Same message as the newer `ExitStatusError`
+                write!(f, "process exited unsuccessfully: {}", status)
+            }
+            ErrorKind::Other(s) => s.fmt(f),
+        }
+    }
+}
+
+#[derive(Debug)]
+enum ErrorKind {
+    Io(io::Error),
+    Num(num::ParseIntError),
+    Process(process::ExitStatus),
+    Utf8(str::Utf8Error),
+    Other(&'static str),
+}
+
+pub fn from_exit(status: process::ExitStatus) -> Error {
+    Error {
+        kind: ErrorKind::Process(status),
+    }
+}
+
+pub fn from_io(e: io::Error) -> Error {
+    Error {
+        kind: ErrorKind::Io(e),
+    }
+}
+
+pub fn from_num(e: num::ParseIntError) -> Error {
+    Error {
+        kind: ErrorKind::Num(e),
+    }
+}
+
+pub fn from_utf8(e: str::Utf8Error) -> Error {
+    Error {
+        kind: ErrorKind::Utf8(e),
+    }
+}
+
+pub fn from_str(s: &'static str) -> Error {
+    Error {
+        kind: ErrorKind::Other(s),
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/autocfg/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/autocfg/src/lib.rs
--- 43.0.0-1/rust-vendor/autocfg/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/autocfg/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,535 @@
+//! A Rust library for build scripts to automatically configure code based on
+//! compiler support.  Code snippets are dynamically tested to see if the `rustc`
+//! will accept them, rather than hard-coding specific version support.
+//!
+//!
+//! ## Usage
+//!
+//! Add this to your `Cargo.toml`:
+//!
+//! ```toml
+//! [build-dependencies]
+//! autocfg = "1"
+//! ```
+//!
+//! Then use it in your `build.rs` script to detect compiler features.  For
+//! example, to test for 128-bit integer support, it might look like:
+//!
+//! ```rust
+//! extern crate autocfg;
+//!
+//! fn main() {
+//! #   // Normally, cargo will set `OUT_DIR` for build scripts.
+//! #   std::env::set_var("OUT_DIR", "target");
+//!     let ac = autocfg::new();
+//!     ac.emit_has_type("i128");
+//!
+//!     // (optional) We don't need to rerun for anything external.
+//!     autocfg::rerun_path("build.rs");
+//! }
+//! ```
+//!
+//! If the type test succeeds, this will write a `cargo:rustc-cfg=has_i128` line
+//! for Cargo, which translates to Rust arguments `--cfg has_i128`.  Then in the
+//! rest of your Rust code, you can add `#[cfg(has_i128)]` conditions on code that
+//! should only be used when the compiler supports it.
+//!
+//! ## Caution
+//!
+//! Many of the probing methods of `AutoCfg` document the particular template they
+//! use, **subject to change**. The inputs are not validated to make sure they are
+//! semantically correct for their expected use, so it's _possible_ to escape and
+//! inject something unintended. However, such abuse is unsupported and will not
+//! be considered when making changes to the templates.
+
+#![deny(missing_debug_implementations)]
+#![deny(missing_docs)]
+// allow future warnings that can't be fixed while keeping 1.0 compatibility
+#![allow(unknown_lints)]
+#![allow(bare_trait_objects)]
+#![allow(ellipsis_inclusive_range_patterns)]
+
+/// Local macro to avoid `std::try!`, deprecated in Rust 1.39.
+macro_rules! try {
+    ($result:expr) => {
+        match $result {
+            Ok(value) => value,
+            Err(error) => return Err(error),
+        }
+    };
+}
+
+use std::env;
+use std::ffi::OsString;
+use std::fmt::Arguments;
+use std::fs;
+use std::io::{stderr, Write};
+use std::path::{Path, PathBuf};
+use std::process::Stdio;
+#[allow(deprecated)]
+use std::sync::atomic::ATOMIC_USIZE_INIT;
+use std::sync::atomic::{AtomicUsize, Ordering};
+
+mod error;
+pub use error::Error;
+
+mod rustc;
+use rustc::Rustc;
+
+mod version;
+use version::Version;
+
+#[cfg(test)]
+mod tests;
+
+/// Helper to detect compiler features for `cfg` output in build scripts.
+#[derive(Clone, Debug)]
+pub struct AutoCfg {
+    out_dir: PathBuf,
+    rustc: Rustc,
+    rustc_version: Version,
+    target: Option<OsString>,
+    no_std: bool,
+    rustflags: Vec<String>,
+}
+
+/// Writes a config flag for rustc on standard out.
+///
+/// This looks like: `cargo:rustc-cfg=CFG`
+///
+/// Cargo will use this in arguments to rustc, like `--cfg CFG`.
+pub fn emit(cfg: &str) {
+    println!("cargo:rustc-cfg={}", cfg);
+}
+
+/// Writes a line telling Cargo to rerun the build script if `path` changes.
+///
+/// This looks like: `cargo:rerun-if-changed=PATH`
+///
+/// This requires at least cargo 0.7.0, corresponding to rustc 1.6.0.  Earlier
+/// versions of cargo will simply ignore the directive.
+pub fn rerun_path(path: &str) {
+    println!("cargo:rerun-if-changed={}", path);
+}
+
+/// Writes a line telling Cargo to rerun the build script if the environment
+/// variable `var` changes.
+///
+/// This looks like: `cargo:rerun-if-env-changed=VAR`
+///
+/// This requires at least cargo 0.21.0, corresponding to rustc 1.20.0.  Earlier
+/// versions of cargo will simply ignore the directive.
+pub fn rerun_env(var: &str) {
+    println!("cargo:rerun-if-env-changed={}", var);
+}
+
+/// Creates a new `AutoCfg` instance.
+///
+/// # Panics
+///
+/// Panics if `AutoCfg::new()` returns an error.
+pub fn new() -> AutoCfg {
+    AutoCfg::new().unwrap()
+}
+
+impl AutoCfg {
+    /// Creates a new `AutoCfg` instance.
+    ///
+    /// # Common errors
+    ///
+    /// - `rustc` can't be executed, from `RUSTC` or in the `PATH`.
+    /// - The version output from `rustc` can't be parsed.
+    /// - `OUT_DIR` is not set in the environment, or is not a writable directory.
+    ///
+    pub fn new() -> Result<Self, Error> {
+        match env::var_os("OUT_DIR") {
+            Some(d) => Self::with_dir(d),
+            None => Err(error::from_str("no OUT_DIR specified!")),
+        }
+    }
+
+    /// Creates a new `AutoCfg` instance with the specified output directory.
+    ///
+    /// # Common errors
+    ///
+    /// - `rustc` can't be executed, from `RUSTC` or in the `PATH`.
+    /// - The version output from `rustc` can't be parsed.
+    /// - `dir` is not a writable directory.
+    ///
+    pub fn with_dir<T: Into<PathBuf>>(dir: T) -> Result<Self, Error> {
+        let rustc = Rustc::new();
+        let rustc_version = try!(rustc.version());
+
+        let target = env::var_os("TARGET");
+
+        // Sanity check the output directory
+        let dir = dir.into();
+        let meta = try!(fs::metadata(&dir).map_err(error::from_io));
+        if !meta.is_dir() || meta.permissions().readonly() {
+            return Err(error::from_str("output path is not a writable directory"));
+        }
+
+        let mut ac = AutoCfg {
+            rustflags: rustflags(&target, &dir),
+            out_dir: dir,
+            rustc: rustc,
+            rustc_version: rustc_version,
+            target: target,
+            no_std: false,
+        };
+
+        // Sanity check with and without `std`.
+        if !ac.probe_raw("").is_ok() {
+            if ac.probe_raw("#![no_std]").is_ok() {
+                ac.no_std = true;
+            } else {
+                // Neither worked, so assume nothing...
+                let warning = b"warning: autocfg could not probe for `std`\n";
+                stderr().write_all(warning).ok();
+            }
+        }
+        Ok(ac)
+    }
+
+    /// Returns whether `AutoCfg` is using `#![no_std]` in its probes.
+    ///
+    /// This is automatically detected during construction -- if an empty probe
+    /// fails while one with `#![no_std]` succeeds, then the attribute will be
+    /// used for all further probes. This is usually only necessary when the
+    /// `TARGET` lacks `std` altogether. If neither succeeds, `no_std` is not
+    /// set, but that `AutoCfg` will probably only work for version checks.
+    ///
+    /// This attribute changes the implicit [prelude] from `std` to `core`,
+    /// which may affect the paths you need to use in other probes. It also
+    /// restricts some types that otherwise get additional methods in `std`,
+    /// like floating-point trigonometry and slice sorting.
+    ///
+    /// See also [`set_no_std`](#method.set_no_std).
+    ///
+    /// [prelude]: https://doc.rust-lang.org/reference/names/preludes.html#the-no_std-attribute
+    pub fn no_std(&self) -> bool {
+        self.no_std
+    }
+
+    /// Sets whether `AutoCfg` should use `#![no_std]` in its probes.
+    ///
+    /// See also [`no_std`](#method.no_std).
+    pub fn set_no_std(&mut self, no_std: bool) {
+        self.no_std = no_std;
+    }
+
+    /// Tests whether the current `rustc` reports a version greater than
+    /// or equal to "`major`.`minor`".
+    pub fn probe_rustc_version(&self, major: usize, minor: usize) -> bool {
+        self.rustc_version >= Version::new(major, minor, 0)
+    }
+
+    /// Sets a `cfg` value of the form `rustc_major_minor`, like `rustc_1_29`,
+    /// if the current `rustc` is at least that version.
+    pub fn emit_rustc_version(&self, major: usize, minor: usize) {
+        if self.probe_rustc_version(major, minor) {
+            emit(&format!("rustc_{}_{}", major, minor));
+        }
+    }
+
+    fn probe_fmt<'a>(&self, source: Arguments<'a>) -> Result<(), Error> {
+        #[allow(deprecated)]
+        static ID: AtomicUsize = ATOMIC_USIZE_INIT;
+
+        let id = ID.fetch_add(1, Ordering::Relaxed);
+
+        let mut command = self.rustc.command();
+        command
+            .arg("--crate-name")
+            .arg(format!("probe{}", id))
+            .arg("--crate-type=lib")
+            .arg("--out-dir")
+            .arg(&self.out_dir)
+            .arg("--emit=llvm-ir");
+
+        if let Some(target) = self.target.as_ref() {
+            command.arg("--target").arg(target);
+        }
+
+        command.args(&self.rustflags);
+
+        command.arg("-").stdin(Stdio::piped());
+        let mut child = try!(command.spawn().map_err(error::from_io));
+        let mut stdin = child.stdin.take().expect("rustc stdin");
+
+        try!(stdin.write_fmt(source).map_err(error::from_io));
+        drop(stdin);
+
+        match child.wait() {
+            Ok(status) if status.success() => Ok(()),
+            Ok(status) => Err(error::from_exit(status)),
+            Err(error) => Err(error::from_io(error)),
+        }
+    }
+
+    fn probe<'a>(&self, code: Arguments<'a>) -> bool {
+        let result = if self.no_std {
+            self.probe_fmt(format_args!("#![no_std]\n{}", code))
+        } else {
+            self.probe_fmt(code)
+        };
+        result.is_ok()
+    }
+
+    /// Tests whether the given code can be compiled as a Rust library.
+    ///
+    /// This will only return `Ok` if the compiler ran and exited successfully,
+    /// per `ExitStatus::success()`.
+    /// The code is passed to the compiler exactly as-is, notably not even
+    /// adding the [`#![no_std]`][Self::no_std] attribute like other probes.
+    ///
+    /// Raw probes are useful for testing functionality that's not yet covered
+    /// by the rest of the `AutoCfg` API. For example, the following attribute
+    /// **must** be used at the crate level, so it wouldn't work within the code
+    /// templates used by other `probe_*` methods.
+    ///
+    /// ```
+    /// # extern crate autocfg;
+    /// # // Normally, cargo will set `OUT_DIR` for build scripts.
+    /// # std::env::set_var("OUT_DIR", "target");
+    /// let ac = autocfg::new();
+    /// assert!(ac.probe_raw("#![no_builtins]").is_ok());
+    /// ```
+    ///
+    /// Rust nightly features could be tested as well -- ideally including a
+    /// code sample to ensure the unstable feature still works as expected.
+    /// For example, `slice::group_by` was renamed to `chunk_by` when it was
+    /// stabilized, even though the feature name was unchanged, so testing the
+    /// `#![feature(..)]` alone wouldn't reveal that. For larger snippets,
+    /// [`include_str!`] may be useful to load them from separate files.
+    ///
+    /// ```
+    /// # extern crate autocfg;
+    /// # // Normally, cargo will set `OUT_DIR` for build scripts.
+    /// # std::env::set_var("OUT_DIR", "target");
+    /// let ac = autocfg::new();
+    /// let code = r#"
+    ///     #![feature(slice_group_by)]
+    ///     pub fn probe(slice: &[i32]) -> impl Iterator<Item = &[i32]> {
+    ///         slice.group_by(|a, b| a == b)
+    ///     }
+    /// "#;
+    /// if ac.probe_raw(code).is_ok() {
+    ///     autocfg::emit("has_slice_group_by");
+    /// }
+    /// ```
+    pub fn probe_raw(&self, code: &str) -> Result<(), Error> {
+        self.probe_fmt(format_args!("{}", code))
+    }
+
+    /// Tests whether the given sysroot crate can be used.
+    ///
+    /// The test code is subject to change, but currently looks like:
+    ///
+    /// ```ignore
+    /// extern crate CRATE as probe;
+    /// ```
+    pub fn probe_sysroot_crate(&self, name: &str) -> bool {
+        // Note: `as _` wasn't stabilized until Rust 1.33
+        self.probe(format_args!("extern crate {} as probe;", name))
+    }
+
+    /// Emits a config value `has_CRATE` if `probe_sysroot_crate` returns true.
+    pub fn emit_sysroot_crate(&self, name: &str) {
+        if self.probe_sysroot_crate(name) {
+            emit(&format!("has_{}", mangle(name)));
+        }
+    }
+
+    /// Tests whether the given path can be used.
+    ///
+    /// The test code is subject to change, but currently looks like:
+    ///
+    /// ```ignore
+    /// pub use PATH;
+    /// ```
+    pub fn probe_path(&self, path: &str) -> bool {
+        self.probe(format_args!("pub use {};", path))
+    }
+
+    /// Emits a config value `has_PATH` if `probe_path` returns true.
+    ///
+    /// Any non-identifier characters in the `path` will be replaced with
+    /// `_` in the generated config value.
+    pub fn emit_has_path(&self, path: &str) {
+        if self.probe_path(path) {
+            emit(&format!("has_{}", mangle(path)));
+        }
+    }
+
+    /// Emits the given `cfg` value if `probe_path` returns true.
+    pub fn emit_path_cfg(&self, path: &str, cfg: &str) {
+        if self.probe_path(path) {
+            emit(cfg);
+        }
+    }
+
+    /// Tests whether the given trait can be used.
+    ///
+    /// The test code is subject to change, but currently looks like:
+    ///
+    /// ```ignore
+    /// pub trait Probe: TRAIT + Sized {}
+    /// ```
+    pub fn probe_trait(&self, name: &str) -> bool {
+        self.probe(format_args!("pub trait Probe: {} + Sized {{}}", name))
+    }
+
+    /// Emits a config value `has_TRAIT` if `probe_trait` returns true.
+    ///
+    /// Any non-identifier characters in the trait `name` will be replaced with
+    /// `_` in the generated config value.
+    pub fn emit_has_trait(&self, name: &str) {
+        if self.probe_trait(name) {
+            emit(&format!("has_{}", mangle(name)));
+        }
+    }
+
+    /// Emits the given `cfg` value if `probe_trait` returns true.
+    pub fn emit_trait_cfg(&self, name: &str, cfg: &str) {
+        if self.probe_trait(name) {
+            emit(cfg);
+        }
+    }
+
+    /// Tests whether the given type can be used.
+    ///
+    /// The test code is subject to change, but currently looks like:
+    ///
+    /// ```ignore
+    /// pub type Probe = TYPE;
+    /// ```
+    pub fn probe_type(&self, name: &str) -> bool {
+        self.probe(format_args!("pub type Probe = {};", name))
+    }
+
+    /// Emits a config value `has_TYPE` if `probe_type` returns true.
+    ///
+    /// Any non-identifier characters in the type `name` will be replaced with
+    /// `_` in the generated config value.
+    pub fn emit_has_type(&self, name: &str) {
+        if self.probe_type(name) {
+            emit(&format!("has_{}", mangle(name)));
+        }
+    }
+
+    /// Emits the given `cfg` value if `probe_type` returns true.
+    pub fn emit_type_cfg(&self, name: &str, cfg: &str) {
+        if self.probe_type(name) {
+            emit(cfg);
+        }
+    }
+
+    /// Tests whether the given expression can be used.
+    ///
+    /// The test code is subject to change, but currently looks like:
+    ///
+    /// ```ignore
+    /// pub fn probe() { let _ = EXPR; }
+    /// ```
+    pub fn probe_expression(&self, expr: &str) -> bool {
+        self.probe(format_args!("pub fn probe() {{ let _ = {}; }}", expr))
+    }
+
+    /// Emits the given `cfg` value if `probe_expression` returns true.
+    pub fn emit_expression_cfg(&self, expr: &str, cfg: &str) {
+        if self.probe_expression(expr) {
+            emit(cfg);
+        }
+    }
+
+    /// Tests whether the given constant expression can be used.
+    ///
+    /// The test code is subject to change, but currently looks like:
+    ///
+    /// ```ignore
+    /// pub const PROBE: () = ((), EXPR).0;
+    /// ```
+    pub fn probe_constant(&self, expr: &str) -> bool {
+        self.probe(format_args!("pub const PROBE: () = ((), {}).0;", expr))
+    }
+
+    /// Emits the given `cfg` value if `probe_constant` returns true.
+    pub fn emit_constant_cfg(&self, expr: &str, cfg: &str) {
+        if self.probe_constant(expr) {
+            emit(cfg);
+        }
+    }
+}
+
+fn mangle(s: &str) -> String {
+    s.chars()
+        .map(|c| match c {
+            'A'...'Z' | 'a'...'z' | '0'...'9' => c,
+            _ => '_',
+        })
+        .collect()
+}
+
+fn dir_contains_target(
+    target: &Option<OsString>,
+    dir: &Path,
+    cargo_target_dir: Option<OsString>,
+) -> bool {
+    target
+        .as_ref()
+        .and_then(|target| {
+            dir.to_str().and_then(|dir| {
+                let mut cargo_target_dir = cargo_target_dir
+                    .map(PathBuf::from)
+                    .unwrap_or_else(|| PathBuf::from("target"));
+                cargo_target_dir.push(target);
+
+                cargo_target_dir
+                    .to_str()
+                    .map(|cargo_target_dir| dir.contains(cargo_target_dir))
+            })
+        })
+        .unwrap_or(false)
+}
+
+fn rustflags(target: &Option<OsString>, dir: &Path) -> Vec<String> {
+    // Starting with rust-lang/cargo#9601, shipped in Rust 1.55, Cargo always sets
+    // CARGO_ENCODED_RUSTFLAGS for any host/target build script invocation. This
+    // includes any source of flags, whether from the environment, toml config, or
+    // whatever may come in the future. The value is either an empty string, or a
+    // list of arguments separated by the ASCII unit separator (US), 0x1f.
+    if let Ok(a) = env::var("CARGO_ENCODED_RUSTFLAGS") {
+        return if a.is_empty() {
+            Vec::new()
+        } else {
+            a.split('\x1f').map(str::to_string).collect()
+        };
+    }
+
+    // Otherwise, we have to take a more heuristic approach, and we don't
+    // support values from toml config at all.
+    //
+    // Cargo only applies RUSTFLAGS for building TARGET artifact in
+    // cross-compilation environment. Sadly, we don't have a way to detect
+    // when we're building HOST artifact in a cross-compilation environment,
+    // so for now we only apply RUSTFLAGS when cross-compiling an artifact.
+    //
+    // See https://github.com/cuviper/autocfg/pull/10#issuecomment-527575030.
+    if *target != env::var_os("HOST")
+        || dir_contains_target(target, dir, env::var_os("CARGO_TARGET_DIR"))
+    {
+        if let Ok(rustflags) = env::var("RUSTFLAGS") {
+            // This is meant to match how cargo handles the RUSTFLAGS environment variable.
+            // See https://github.com/rust-lang/cargo/blob/69aea5b6f69add7c51cca939a79644080c0b0ba0/src/cargo/core/compiler/build_context/target_info.rs#L434-L441
+            return rustflags
+                .split(' ')
+                .map(str::trim)
+                .filter(|s| !s.is_empty())
+                .map(str::to_string)
+                .collect();
+        }
+    }
+
+    Vec::new()
+}
diff -pruN 43.0.0-1/rust-vendor/autocfg/src/rustc.rs 43.0.0-1ubuntu1/rust-vendor/autocfg/src/rustc.rs
--- 43.0.0-1/rust-vendor/autocfg/src/rustc.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/autocfg/src/rustc.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,89 @@
+use std::env;
+use std::ffi::OsString;
+use std::path::PathBuf;
+use std::process::Command;
+
+use super::error::Error;
+use super::version::Version;
+
+#[derive(Clone, Debug)]
+pub struct Rustc {
+    rustc: PathBuf,
+    rustc_wrapper: Option<PathBuf>,
+    rustc_workspace_wrapper: Option<PathBuf>,
+}
+
+impl Rustc {
+    pub fn new() -> Self {
+        Rustc {
+            rustc: env::var_os("RUSTC")
+                .unwrap_or_else(|| "rustc".into())
+                .into(),
+            rustc_wrapper: get_rustc_wrapper(false),
+            rustc_workspace_wrapper: get_rustc_wrapper(true),
+        }
+    }
+
+    /// Build the command with possible wrappers.
+    pub fn command(&self) -> Command {
+        let mut rustc = self
+            .rustc_wrapper
+            .iter()
+            .chain(self.rustc_workspace_wrapper.iter())
+            .chain(Some(&self.rustc));
+        let mut command = Command::new(rustc.next().unwrap());
+        for arg in rustc {
+            command.arg(arg);
+        }
+        command
+    }
+
+    /// Try to get the `rustc` version.
+    pub fn version(&self) -> Result<Version, Error> {
+        // Some wrappers like clippy-driver don't pass through version commands,
+        // so we try to fall back to combinations without each wrapper.
+        macro_rules! try_version {
+            ($command:expr) => {
+                if let Ok(value) = Version::from_command($command) {
+                    return Ok(value);
+                }
+            };
+        }
+
+        let rustc = &self.rustc;
+        if let Some(ref rw) = self.rustc_wrapper {
+            if let Some(ref rww) = self.rustc_workspace_wrapper {
+                try_version!(Command::new(rw).args(&[rww, rustc]));
+            }
+            try_version!(Command::new(rw).arg(rustc));
+        }
+        if let Some(ref rww) = self.rustc_workspace_wrapper {
+            try_version!(Command::new(rww).arg(rustc));
+        }
+        Version::from_command(&mut Command::new(rustc))
+    }
+}
+
+fn get_rustc_wrapper(workspace: bool) -> Option<PathBuf> {
+    // We didn't really know whether the workspace wrapper is applicable until Cargo started
+    // deliberately setting or unsetting it in rust-lang/cargo#9601. We'll use the encoded
+    // rustflags as a proxy for that change for now, but we could instead check version 1.55.
+    if workspace && env::var_os("CARGO_ENCODED_RUSTFLAGS").is_none() {
+        return None;
+    }
+
+    let name = if workspace {
+        "RUSTC_WORKSPACE_WRAPPER"
+    } else {
+        "RUSTC_WRAPPER"
+    };
+
+    if let Some(wrapper) = env::var_os(name) {
+        // NB: `OsStr` didn't get `len` or `is_empty` until 1.9.
+        if wrapper != OsString::new() {
+            return Some(wrapper.into());
+        }
+    }
+
+    None
+}
diff -pruN 43.0.0-1/rust-vendor/autocfg/src/tests.rs 43.0.0-1ubuntu1/rust-vendor/autocfg/src/tests.rs
--- 43.0.0-1/rust-vendor/autocfg/src/tests.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/autocfg/src/tests.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,190 @@
+use super::AutoCfg;
+use std::env;
+use std::path::Path;
+
+impl AutoCfg {
+    fn core_std(&self, path: &str) -> String {
+        let krate = if self.no_std { "core" } else { "std" };
+        format!("{}::{}", krate, path)
+    }
+
+    fn assert_std(&self, probe_result: bool) {
+        assert_eq!(!self.no_std, probe_result);
+    }
+
+    fn assert_min(&self, major: usize, minor: usize, probe_result: bool) {
+        assert_eq!(self.probe_rustc_version(major, minor), probe_result);
+    }
+
+    fn for_test() -> Result<Self, super::error::Error> {
+        match env::var_os("TESTS_TARGET_DIR") {
+            Some(d) => Self::with_dir(d),
+            None => Self::with_dir("target"),
+        }
+    }
+}
+
+#[test]
+fn autocfg_version() {
+    let ac = AutoCfg::for_test().unwrap();
+    println!("version: {:?}", ac.rustc_version);
+    assert!(ac.probe_rustc_version(1, 0));
+}
+
+#[test]
+fn version_cmp() {
+    use super::version::Version;
+    let v123 = Version::new(1, 2, 3);
+
+    assert!(Version::new(1, 0, 0) < v123);
+    assert!(Version::new(1, 2, 2) < v123);
+    assert!(Version::new(1, 2, 3) == v123);
+    assert!(Version::new(1, 2, 4) > v123);
+    assert!(Version::new(1, 10, 0) > v123);
+    assert!(Version::new(2, 0, 0) > v123);
+}
+
+#[test]
+fn probe_add() {
+    let ac = AutoCfg::for_test().unwrap();
+    let add = ac.core_std("ops::Add");
+    let add_rhs = add.clone() + "<i32>";
+    let add_rhs_output = add.clone() + "<i32, Output = i32>";
+    let dyn_add_rhs_output = "dyn ".to_string() + &*add_rhs_output;
+    assert!(ac.probe_path(&add));
+    assert!(ac.probe_trait(&add));
+    assert!(ac.probe_trait(&add_rhs));
+    assert!(ac.probe_trait(&add_rhs_output));
+    ac.assert_min(1, 27, ac.probe_type(&dyn_add_rhs_output));
+}
+
+#[test]
+fn probe_as_ref() {
+    let ac = AutoCfg::for_test().unwrap();
+    let as_ref = ac.core_std("convert::AsRef");
+    let as_ref_str = as_ref.clone() + "<str>";
+    let dyn_as_ref_str = "dyn ".to_string() + &*as_ref_str;
+    assert!(ac.probe_path(&as_ref));
+    assert!(ac.probe_trait(&as_ref_str));
+    assert!(ac.probe_type(&as_ref_str));
+    ac.assert_min(1, 27, ac.probe_type(&dyn_as_ref_str));
+}
+
+#[test]
+fn probe_i128() {
+    let ac = AutoCfg::for_test().unwrap();
+    let i128_path = ac.core_std("i128");
+    ac.assert_min(1, 26, ac.probe_path(&i128_path));
+    ac.assert_min(1, 26, ac.probe_type("i128"));
+}
+
+#[test]
+fn probe_sum() {
+    let ac = AutoCfg::for_test().unwrap();
+    let sum = ac.core_std("iter::Sum");
+    let sum_i32 = sum.clone() + "<i32>";
+    let dyn_sum_i32 = "dyn ".to_string() + &*sum_i32;
+    ac.assert_min(1, 12, ac.probe_path(&sum));
+    ac.assert_min(1, 12, ac.probe_trait(&sum));
+    ac.assert_min(1, 12, ac.probe_trait(&sum_i32));
+    ac.assert_min(1, 12, ac.probe_type(&sum_i32));
+    ac.assert_min(1, 27, ac.probe_type(&dyn_sum_i32));
+}
+
+#[test]
+fn probe_std() {
+    let ac = AutoCfg::for_test().unwrap();
+    ac.assert_std(ac.probe_sysroot_crate("std"));
+}
+
+#[test]
+fn probe_alloc() {
+    let ac = AutoCfg::for_test().unwrap();
+    ac.assert_min(1, 36, ac.probe_sysroot_crate("alloc"));
+}
+
+#[test]
+fn probe_bad_sysroot_crate() {
+    let ac = AutoCfg::for_test().unwrap();
+    assert!(!ac.probe_sysroot_crate("doesnt_exist"));
+}
+
+#[test]
+fn probe_no_std() {
+    let ac = AutoCfg::for_test().unwrap();
+    assert!(ac.probe_type("i32"));
+    assert!(ac.probe_type("[i32]"));
+    ac.assert_std(ac.probe_type("Vec<i32>"));
+}
+
+#[test]
+fn probe_expression() {
+    let ac = AutoCfg::for_test().unwrap();
+    assert!(ac.probe_expression(r#""test".trim_left()"#));
+    ac.assert_min(1, 30, ac.probe_expression(r#""test".trim_start()"#));
+    ac.assert_std(ac.probe_expression("[1, 2, 3].to_vec()"));
+}
+
+#[test]
+fn probe_constant() {
+    let ac = AutoCfg::for_test().unwrap();
+    assert!(ac.probe_constant("1 + 2 + 3"));
+    ac.assert_min(1, 33, ac.probe_constant("{ let x = 1 + 2 + 3; x * x }"));
+    ac.assert_min(1, 39, ac.probe_constant(r#""test".len()"#));
+}
+
+#[test]
+fn probe_raw() {
+    let ac = AutoCfg::for_test().unwrap();
+    let prefix = if ac.no_std { "#![no_std]\n" } else { "" };
+    let f = |s| format!("{}{}", prefix, s);
+
+    // This attribute **must** be used at the crate level.
+    assert!(ac.probe_raw(&f("#![no_builtins]")).is_ok());
+
+    assert!(ac.probe_raw(&f("#![deny(dead_code)] fn x() {}")).is_err());
+    assert!(ac.probe_raw(&f("#![allow(dead_code)] fn x() {}")).is_ok());
+    assert!(ac
+        .probe_raw(&f("#![deny(dead_code)] pub fn x() {}"))
+        .is_ok());
+}
+
+#[test]
+fn dir_does_not_contain_target() {
+    assert!(!super::dir_contains_target(
+        &Some("x86_64-unknown-linux-gnu".into()),
+        Path::new("/project/target/debug/build/project-ea75983148559682/out"),
+        None,
+    ));
+}
+
+#[test]
+fn dir_does_contain_target() {
+    assert!(super::dir_contains_target(
+        &Some("x86_64-unknown-linux-gnu".into()),
+        Path::new(
+            "/project/target/x86_64-unknown-linux-gnu/debug/build/project-0147aca016480b9d/out"
+        ),
+        None,
+    ));
+}
+
+#[test]
+fn dir_does_not_contain_target_with_custom_target_dir() {
+    assert!(!super::dir_contains_target(
+        &Some("x86_64-unknown-linux-gnu".into()),
+        Path::new("/project/custom/debug/build/project-ea75983148559682/out"),
+        Some("custom".into()),
+    ));
+}
+
+#[test]
+fn dir_does_contain_target_with_custom_target_dir() {
+    assert!(super::dir_contains_target(
+        &Some("x86_64-unknown-linux-gnu".into()),
+        Path::new(
+            "/project/custom/x86_64-unknown-linux-gnu/debug/build/project-0147aca016480b9d/out"
+        ),
+        Some("custom".into()),
+    ));
+}
diff -pruN 43.0.0-1/rust-vendor/autocfg/src/version.rs 43.0.0-1ubuntu1/rust-vendor/autocfg/src/version.rs
--- 43.0.0-1/rust-vendor/autocfg/src/version.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/autocfg/src/version.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,65 @@
+use std::process::Command;
+use std::str;
+
+use super::{error, Error};
+
+/// A version structure for making relative comparisons.
+#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
+pub struct Version {
+    major: usize,
+    minor: usize,
+    patch: usize,
+}
+
+impl Version {
+    /// Creates a `Version` instance for a specific `major.minor.patch` version.
+    pub fn new(major: usize, minor: usize, patch: usize) -> Self {
+        Version {
+            major: major,
+            minor: minor,
+            patch: patch,
+        }
+    }
+
+    pub fn from_command(command: &mut Command) -> Result<Self, Error> {
+        // Get rustc's verbose version
+        let output = try!(command
+            .args(&["--version", "--verbose"])
+            .output()
+            .map_err(error::from_io));
+        if !output.status.success() {
+            return Err(error::from_str("could not execute rustc"));
+        }
+        let output = try!(str::from_utf8(&output.stdout).map_err(error::from_utf8));
+
+        // Find the release line in the verbose version output.
+        let release = match output.lines().find(|line| line.starts_with("release: ")) {
+            Some(line) => &line["release: ".len()..],
+            None => return Err(error::from_str("could not find rustc release")),
+        };
+
+        // Strip off any extra channel info, e.g. "-beta.N", "-nightly"
+        let version = match release.find('-') {
+            Some(i) => &release[..i],
+            None => release,
+        };
+
+        // Split the version into semver components.
+        let mut iter = version.splitn(3, '.');
+        let major = try!(iter
+            .next()
+            .ok_or_else(|| error::from_str("missing major version")));
+        let minor = try!(iter
+            .next()
+            .ok_or_else(|| error::from_str("missing minor version")));
+        let patch = try!(iter
+            .next()
+            .ok_or_else(|| error::from_str("missing patch version")));
+
+        Ok(Version::new(
+            try!(major.parse().map_err(error::from_num)),
+            try!(minor.parse().map_err(error::from_num)),
+            try!(patch.parse().map_err(error::from_num)),
+        ))
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/autocfg/tests/no_std.rs 43.0.0-1ubuntu1/rust-vendor/autocfg/tests/no_std.rs
--- 43.0.0-1/rust-vendor/autocfg/tests/no_std.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/autocfg/tests/no_std.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,27 @@
+extern crate autocfg;
+
+use std::env;
+
+/// Tests that we can control the use of `#![no_std]`.
+#[test]
+fn no_std() {
+    // Clear the CI `TARGET`, if any, so we're just dealing with the
+    // host target which always has `std` available.
+    env::remove_var("TARGET");
+
+    // Use the same path as this test binary.
+    let dir = env::current_exe().unwrap().parent().unwrap().to_path_buf();
+    env::set_var("OUT_DIR", &format!("{}", dir.display()));
+
+    let mut ac = autocfg::AutoCfg::new().unwrap();
+    assert!(!ac.no_std());
+    assert!(ac.probe_path("std::mem"));
+
+    // `#![no_std]` was stabilized in Rust 1.6
+    if ac.probe_rustc_version(1, 6) {
+        ac.set_no_std(true);
+        assert!(ac.no_std());
+        assert!(!ac.probe_path("std::mem"));
+        assert!(ac.probe_path("core::mem"));
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/autocfg/tests/rustflags.rs 43.0.0-1ubuntu1/rust-vendor/autocfg/tests/rustflags.rs
--- 43.0.0-1/rust-vendor/autocfg/tests/rustflags.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/autocfg/tests/rustflags.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,33 @@
+extern crate autocfg;
+
+use std::env;
+
+/// Tests that autocfg uses the RUSTFLAGS or CARGO_ENCODED_RUSTFLAGS
+/// environment variables when running rustc.
+#[test]
+fn test_with_sysroot() {
+    // Use the same path as this test binary.
+    let dir = env::current_exe().unwrap().parent().unwrap().to_path_buf();
+    env::set_var("OUT_DIR", &format!("{}", dir.display()));
+
+    // If we have encoded rustflags, they take precedence, even if empty.
+    env::set_var("CARGO_ENCODED_RUSTFLAGS", "");
+    env::set_var("RUSTFLAGS", &format!("-L {}", dir.display()));
+    let ac = autocfg::AutoCfg::new().unwrap();
+    assert!(ac.probe_sysroot_crate("std"));
+    assert!(!ac.probe_sysroot_crate("autocfg"));
+
+    // Now try again with useful encoded args.
+    env::set_var(
+        "CARGO_ENCODED_RUSTFLAGS",
+        &format!("-L\x1f{}", dir.display()),
+    );
+    let ac = autocfg::AutoCfg::new().unwrap();
+    assert!(ac.probe_sysroot_crate("autocfg"));
+
+    // Try the old-style RUSTFLAGS, ensuring HOST != TARGET.
+    env::remove_var("CARGO_ENCODED_RUSTFLAGS");
+    env::set_var("HOST", "lol");
+    let ac = autocfg::AutoCfg::new().unwrap();
+    assert!(ac.probe_sysroot_crate("autocfg"));
+}
diff -pruN 43.0.0-1/rust-vendor/autocfg/tests/wrap_ignored 43.0.0-1ubuntu1/rust-vendor/autocfg/tests/wrap_ignored
--- 43.0.0-1/rust-vendor/autocfg/tests/wrap_ignored	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/autocfg/tests/wrap_ignored	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+for arg in "$@"; do
+  case "$arg" in
+    # Add our own version so we can check that the wrapper is used for that.
+    "--version") echo "release: 12345.6789.0" ;;
+    # Read all input so the writer doesn't get EPIPE when we exit.
+    "-") read -d "" PROBE ;;
+  esac
+done
+
+exit 0
diff -pruN 43.0.0-1/rust-vendor/autocfg/tests/wrappers.rs 43.0.0-1ubuntu1/rust-vendor/autocfg/tests/wrappers.rs
--- 43.0.0-1/rust-vendor/autocfg/tests/wrappers.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/autocfg/tests/wrappers.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,56 @@
+extern crate autocfg;
+
+use std::env;
+
+/// Tests that autocfg uses the RUSTC_WRAPPER and/or RUSTC_WORKSPACE_WRAPPER
+/// environment variables when running rustc.
+#[test]
+#[cfg(unix)] // we're using system binaries as wrappers
+fn test_wrappers() {
+    fn set(name: &str, value: Option<bool>) {
+        match value {
+            Some(true) => env::set_var(name, "/usr/bin/env"),
+            Some(false) => env::set_var(name, "/bin/false"),
+            None => env::remove_var(name),
+        }
+    }
+
+    // Use the same path as this test binary.
+    let dir = env::current_exe().unwrap().parent().unwrap().to_path_buf();
+    env::set_var("OUT_DIR", &format!("{}", dir.display()));
+
+    // This is used as a heuristic to detect rust-lang/cargo#9601.
+    env::set_var("CARGO_ENCODED_RUSTFLAGS", "");
+
+    // No wrapper, a good pass-through wrapper, and a bad wrapper.
+    let variants = [None, Some(true), Some(false)];
+
+    for &workspace in &variants {
+        for &rustc in &variants {
+            set("RUSTC_WRAPPER", rustc);
+            set("RUSTC_WORKSPACE_WRAPPER", workspace);
+
+            let ac = autocfg::AutoCfg::new().unwrap();
+            if rustc == Some(false) || workspace == Some(false) {
+                // Everything should fail with bad wrappers.
+                assert!(!ac.probe_type("usize"));
+            } else {
+                // Try known good and bad types for the wrapped rustc.
+                assert!(ac.probe_type("usize"));
+                assert!(!ac.probe_type("mesize"));
+            }
+            // Either way, we should have found the inner rustc version.
+            assert!(ac.probe_rustc_version(1, 0));
+        }
+    }
+
+    // Finally, make sure that `RUSTC_WRAPPER` is applied outermost
+    // by using something that doesn't pass through at all.
+    env::set_var("RUSTC_WRAPPER", "./tests/wrap_ignored");
+    env::set_var("RUSTC_WORKSPACE_WRAPPER", "/bin/false");
+    let ac = autocfg::AutoCfg::new().unwrap();
+    assert!(ac.probe_type("mesize")); // anything goes!
+
+    // Make sure we also got the version from that wrapper.
+    assert!(ac.probe_rustc_version(12345, 6789));
+}
diff -pruN 43.0.0-1/rust-vendor/base64/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/base64/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/base64/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"Cargo.lock":"cee37732975a1ffc1f956d3d05b6edf1baec72841cfabc384a21b02b3bfa0275","Cargo.toml":"52bee6a418e14918d37058fd15fccfd0f417a06fe4f9668b6f97866bf7f991e3","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0dd882e53de11566d50f8e8e2d5a651bcf3fabee4987d70f306233cf39094ba7","README.md":"df01f5b4317d601e7de86743f9818aec9196abf9e298f5e47679b7a966ecd945","RELEASE-NOTES.md":"997a5193317a8bff266ecfe4f015ba070b782b6df7d3a1738b9b52584d57f9c6","benches/benchmarks.rs":"cebbcc8649e760e569c6be04f5e727aee2c2568ced7faab580fc0aa0d0426d26","clippy.toml":"b26be4d15ed059985ce6994f11817fd7562046f46e460a0dc64dbb71cfc246d1","examples/base64.rs":"b75ead2199a9b4389c69fe6f1ae988176a263b8fc84e7a4fea1d7e5a41592078","icon_CLion.svg":"cffa044ba75cb998ee3306991dc4a3755ec2f39ab95ddd4b74bc21988389020f","src/alphabet.rs":"5de2beb8fcccb078c61cac2c0477ebbde145122d6c10a0f7ea2e57e8159318e0","src/chunked_encoder.rs":"edfdbb9a4329b80fb2c769ada81e234e00839e0fa85faaa70bacf40ce12e951c","src/decode.rs":"b046a72d62eaac58dc42efcf7848d9d96d022f6594e851cf87074b77ce45c04a","src/display.rs":"31bf3e19274a0b80dd8948a81ea535944f756ef5b88736124c940f5fe1e8c71c","src/encode.rs":"44ddcc162f3fe9817b6e857dda0a3b9197b90a657e5f71c44aacabf5431ccf7d","src/engine/general_purpose/decode.rs":"d865b057e5788e7fefd189cf57ec913df263e6a0742dfa52513f587e14fa1a92","src/engine/general_purpose/decode_suffix.rs":"689688f7bf442b232d3b9f56a1b41c56d9393ace88556a165c224b93dd19b74e","src/engine/general_purpose/mod.rs":"901760a7f5721ec3bafad5fea6251f57de0f767ecb2e1e2fdfe64d661404ec34","src/engine/mod.rs":"5e4a6c0e86417f3b62350264ef383f91e9864390f7c315d786ecd8e9c920ee9f","src/engine/naive.rs":"70de29d909c3fe7918d2965782088b05047b8b6e30d1d2bf11ba073d3f8633ff","src/engine/tests.rs":"2cc8d1431f40f5b9c3ad8970e6fb73bba8be3f2317553dd026539f41908aaa19","src/lib.rs":"c4db7bd31ace78aec2ecd151cef3ad90dfdc76097ba12027bde79d3c82612f7c","src/prelude.rs":"c1587138e5301ac797c5c362cb3638649b33f79c20c16db6f38ad44330540752","src/read/decoder.rs":"00aaa0553a54fcf12762658c4e56663a9705cc30c07af30976291e6f69d78c3d","src/read/decoder_tests.rs":"66ec39bf6e86f21f4db1afd6c5cd63d4a4931ab896b9c38de25d99b803804bbf","src/read/mod.rs":"e0b714eda02d16b1ffa6f78fd09b2f963e01c881b1f7c17b39db4e904be5e746","src/tests.rs":"90cb9f8a1ccb7c4ddc4f8618208e0031fc97e0df0e5aa466d6a5cf45d25967d8","src/write/encoder.rs":"c889c853249220fe2ddaeb77ee6e2ee2945f7db88cd6658ef89ff71b81255ea8","src/write/encoder_string_writer.rs":"0326c9d120369b9bbc35697b5b9b141bed24283374c93d5af1052eb042e47799","src/write/encoder_tests.rs":"28695a485b17cf5db73656aae5d90127f726e02c6d70efd83e5ab53a4cc17b38","src/write/mod.rs":"73cd98dadc9d712b3fefd9449d97e825e097397441b90588e0051e4d3b0911b9","tests/encode.rs":"5309f4538b1df611436f7bfba7409c725161b6f841b1bbf8d9890ae185de7d88","tests/tests.rs":"78efcf0dc4bb6ae52f7a91fcad89e44e4dce578224c36b4e6c1c306459be8500"},"package":"72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/base64/Cargo.lock 43.0.0-1ubuntu1/rust-vendor/base64/Cargo.lock
--- 43.0.0-1/rust-vendor/base64/Cargo.lock	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/Cargo.lock	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1515 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "anes"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299"
+
+[[package]]
+name = "async-attributes"
+version = "1.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5"
+dependencies = [
+ "quote",
+ "syn 1.0.109",
+]
+
+[[package]]
+name = "async-channel"
+version = "1.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35"
+dependencies = [
+ "concurrent-queue",
+ "event-listener 2.5.3",
+ "futures-core",
+]
+
+[[package]]
+name = "async-channel"
+version = "2.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3"
+dependencies = [
+ "concurrent-queue",
+ "event-listener 5.2.0",
+ "event-listener-strategy 0.5.0",
+ "futures-core",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "async-executor"
+version = "1.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c"
+dependencies = [
+ "async-lock 3.3.0",
+ "async-task",
+ "concurrent-queue",
+ "fastrand 2.0.1",
+ "futures-lite 2.2.0",
+ "slab",
+]
+
+[[package]]
+name = "async-global-executor"
+version = "2.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c"
+dependencies = [
+ "async-channel 2.2.0",
+ "async-executor",
+ "async-io 2.3.1",
+ "async-lock 3.3.0",
+ "blocking",
+ "futures-lite 2.2.0",
+ "once_cell",
+]
+
+[[package]]
+name = "async-io"
+version = "1.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af"
+dependencies = [
+ "async-lock 2.8.0",
+ "autocfg",
+ "cfg-if",
+ "concurrent-queue",
+ "futures-lite 1.13.0",
+ "log",
+ "parking",
+ "polling 2.8.0",
+ "rustix 0.37.27",
+ "slab",
+ "socket2",
+ "waker-fn",
+]
+
+[[package]]
+name = "async-io"
+version = "2.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65"
+dependencies = [
+ "async-lock 3.3.0",
+ "cfg-if",
+ "concurrent-queue",
+ "futures-io",
+ "futures-lite 2.2.0",
+ "parking",
+ "polling 3.4.0",
+ "rustix 0.38.9",
+ "slab",
+ "tracing",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "async-lock"
+version = "2.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b"
+dependencies = [
+ "event-listener 2.5.3",
+]
+
+[[package]]
+name = "async-lock"
+version = "3.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b"
+dependencies = [
+ "event-listener 4.0.3",
+ "event-listener-strategy 0.4.0",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "async-std"
+version = "1.12.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d"
+dependencies = [
+ "async-attributes",
+ "async-channel 1.9.0",
+ "async-global-executor",
+ "async-io 1.13.0",
+ "async-lock 2.8.0",
+ "crossbeam-utils",
+ "futures-channel",
+ "futures-core",
+ "futures-io",
+ "futures-lite 1.13.0",
+ "gloo-timers",
+ "kv-log-macro",
+ "log",
+ "memchr",
+ "once_cell",
+ "pin-project-lite",
+ "pin-utils",
+ "slab",
+ "wasm-bindgen-futures",
+]
+
+[[package]]
+name = "async-task"
+version = "4.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799"
+
+[[package]]
+name = "atomic-waker"
+version = "1.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
+
+[[package]]
+name = "atty"
+version = "0.2.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
+dependencies = [
+ "hermit-abi 0.1.19",
+ "libc",
+ "winapi",
+]
+
+[[package]]
+name = "autocfg"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
+
+[[package]]
+name = "base64"
+version = "0.22.1"
+dependencies = [
+ "clap",
+ "criterion",
+ "once_cell",
+ "rand",
+ "rstest",
+ "rstest_reuse",
+ "strum",
+]
+
+[[package]]
+name = "bitflags"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+
+[[package]]
+name = "bitflags"
+version = "2.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf"
+
+[[package]]
+name = "blocking"
+version = "1.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118"
+dependencies = [
+ "async-channel 2.2.0",
+ "async-lock 3.3.0",
+ "async-task",
+ "fastrand 2.0.1",
+ "futures-io",
+ "futures-lite 2.2.0",
+ "piper",
+ "tracing",
+]
+
+[[package]]
+name = "bumpalo"
+version = "3.15.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b"
+
+[[package]]
+name = "cast"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
+
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "ciborium"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e"
+dependencies = [
+ "ciborium-io",
+ "ciborium-ll",
+ "serde",
+]
+
+[[package]]
+name = "ciborium-io"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757"
+
+[[package]]
+name = "ciborium-ll"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9"
+dependencies = [
+ "ciborium-io",
+ "half",
+]
+
+[[package]]
+name = "clap"
+version = "3.2.25"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123"
+dependencies = [
+ "atty",
+ "bitflags 1.3.2",
+ "clap_derive",
+ "clap_lex",
+ "indexmap",
+ "once_cell",
+ "strsim",
+ "termcolor",
+ "textwrap",
+]
+
+[[package]]
+name = "clap_derive"
+version = "3.2.25"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008"
+dependencies = [
+ "heck",
+ "proc-macro-error",
+ "proc-macro2",
+ "quote",
+ "syn 1.0.109",
+]
+
+[[package]]
+name = "clap_lex"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5"
+dependencies = [
+ "os_str_bytes",
+]
+
+[[package]]
+name = "concurrent-queue"
+version = "2.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363"
+dependencies = [
+ "crossbeam-utils",
+]
+
+[[package]]
+name = "criterion"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb"
+dependencies = [
+ "anes",
+ "atty",
+ "cast",
+ "ciborium",
+ "clap",
+ "criterion-plot",
+ "itertools",
+ "lazy_static",
+ "num-traits",
+ "oorandom",
+ "plotters",
+ "rayon",
+ "regex",
+ "serde",
+ "serde_derive",
+ "serde_json",
+ "tinytemplate",
+ "walkdir",
+]
+
+[[package]]
+name = "criterion-plot"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1"
+dependencies = [
+ "cast",
+ "itertools",
+]
+
+[[package]]
+name = "crossbeam-deque"
+version = "0.8.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d"
+dependencies = [
+ "crossbeam-epoch",
+ "crossbeam-utils",
+]
+
+[[package]]
+name = "crossbeam-epoch"
+version = "0.9.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
+dependencies = [
+ "crossbeam-utils",
+]
+
+[[package]]
+name = "crossbeam-utils"
+version = "0.8.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345"
+
+[[package]]
+name = "crunchy"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
+
+[[package]]
+name = "ctor"
+version = "0.1.26"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096"
+dependencies = [
+ "quote",
+ "syn 1.0.109",
+]
+
+[[package]]
+name = "either"
+version = "1.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a"
+
+[[package]]
+name = "errno"
+version = "0.3.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245"
+dependencies = [
+ "libc",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "event-listener"
+version = "2.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
+
+[[package]]
+name = "event-listener"
+version = "4.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e"
+dependencies = [
+ "concurrent-queue",
+ "parking",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "event-listener"
+version = "5.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2b5fb89194fa3cad959b833185b3063ba881dbfc7030680b314250779fb4cc91"
+dependencies = [
+ "concurrent-queue",
+ "parking",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "event-listener-strategy"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3"
+dependencies = [
+ "event-listener 4.0.3",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "event-listener-strategy"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291"
+dependencies = [
+ "event-listener 5.2.0",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "fastrand"
+version = "1.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be"
+dependencies = [
+ "instant",
+]
+
+[[package]]
+name = "fastrand"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5"
+
+[[package]]
+name = "futures"
+version = "0.3.30"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0"
+dependencies = [
+ "futures-channel",
+ "futures-core",
+ "futures-executor",
+ "futures-io",
+ "futures-sink",
+ "futures-task",
+ "futures-util",
+]
+
+[[package]]
+name = "futures-channel"
+version = "0.3.30"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78"
+dependencies = [
+ "futures-core",
+ "futures-sink",
+]
+
+[[package]]
+name = "futures-core"
+version = "0.3.30"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d"
+
+[[package]]
+name = "futures-executor"
+version = "0.3.30"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d"
+dependencies = [
+ "futures-core",
+ "futures-task",
+ "futures-util",
+]
+
+[[package]]
+name = "futures-io"
+version = "0.3.30"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1"
+
+[[package]]
+name = "futures-lite"
+version = "1.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce"
+dependencies = [
+ "fastrand 1.9.0",
+ "futures-core",
+ "futures-io",
+ "memchr",
+ "parking",
+ "pin-project-lite",
+ "waker-fn",
+]
+
+[[package]]
+name = "futures-lite"
+version = "2.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba"
+dependencies = [
+ "fastrand 2.0.1",
+ "futures-core",
+ "futures-io",
+ "parking",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "futures-macro"
+version = "0.3.30"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.52",
+]
+
+[[package]]
+name = "futures-sink"
+version = "0.3.30"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5"
+
+[[package]]
+name = "futures-task"
+version = "0.3.30"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004"
+
+[[package]]
+name = "futures-timer"
+version = "3.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24"
+
+[[package]]
+name = "futures-util"
+version = "0.3.30"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"
+dependencies = [
+ "futures-channel",
+ "futures-core",
+ "futures-io",
+ "futures-macro",
+ "futures-sink",
+ "futures-task",
+ "memchr",
+ "pin-project-lite",
+ "pin-utils",
+ "slab",
+]
+
+[[package]]
+name = "getrandom"
+version = "0.2.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "wasi",
+]
+
+[[package]]
+name = "gloo-timers"
+version = "0.2.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c"
+dependencies = [
+ "futures-channel",
+ "futures-core",
+ "js-sys",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "half"
+version = "2.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b5eceaaeec696539ddaf7b333340f1af35a5aa87ae3e4f3ead0532f72affab2e"
+dependencies = [
+ "cfg-if",
+ "crunchy",
+]
+
+[[package]]
+name = "hashbrown"
+version = "0.12.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
+
+[[package]]
+name = "heck"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
+
+[[package]]
+name = "hermit-abi"
+version = "0.1.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "hermit-abi"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024"
+
+[[package]]
+name = "indexmap"
+version = "1.9.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
+dependencies = [
+ "autocfg",
+ "hashbrown",
+]
+
+[[package]]
+name = "instant"
+version = "0.1.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
+dependencies = [
+ "cfg-if",
+]
+
+[[package]]
+name = "io-lifetimes"
+version = "1.0.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2"
+dependencies = [
+ "hermit-abi 0.3.9",
+ "libc",
+ "windows-sys 0.48.0",
+]
+
+[[package]]
+name = "itertools"
+version = "0.10.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
+dependencies = [
+ "either",
+]
+
+[[package]]
+name = "itoa"
+version = "1.0.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"
+
+[[package]]
+name = "js-sys"
+version = "0.3.68"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee"
+dependencies = [
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "kv-log-macro"
+version = "1.0.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f"
+dependencies = [
+ "log",
+]
+
+[[package]]
+name = "lazy_static"
+version = "1.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
+
+[[package]]
+name = "libc"
+version = "0.2.153"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
+
+[[package]]
+name = "linux-raw-sys"
+version = "0.3.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519"
+
+[[package]]
+name = "linux-raw-sys"
+version = "0.4.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c"
+
+[[package]]
+name = "log"
+version = "0.4.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
+dependencies = [
+ "cfg-if",
+ "value-bag",
+]
+
+[[package]]
+name = "memchr"
+version = "2.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
+
+[[package]]
+name = "num-traits"
+version = "0.2.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a"
+dependencies = [
+ "autocfg",
+]
+
+[[package]]
+name = "once_cell"
+version = "1.19.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
+
+[[package]]
+name = "oorandom"
+version = "11.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575"
+
+[[package]]
+name = "os_str_bytes"
+version = "6.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1"
+
+[[package]]
+name = "parking"
+version = "2.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae"
+
+[[package]]
+name = "pin-project-lite"
+version = "0.2.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58"
+
+[[package]]
+name = "pin-utils"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
+
+[[package]]
+name = "piper"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4"
+dependencies = [
+ "atomic-waker",
+ "fastrand 2.0.1",
+ "futures-io",
+]
+
+[[package]]
+name = "plotters"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45"
+dependencies = [
+ "num-traits",
+ "plotters-backend",
+ "plotters-svg",
+ "wasm-bindgen",
+ "web-sys",
+]
+
+[[package]]
+name = "plotters-backend"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609"
+
+[[package]]
+name = "plotters-svg"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab"
+dependencies = [
+ "plotters-backend",
+]
+
+[[package]]
+name = "polling"
+version = "2.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce"
+dependencies = [
+ "autocfg",
+ "bitflags 1.3.2",
+ "cfg-if",
+ "concurrent-queue",
+ "libc",
+ "log",
+ "pin-project-lite",
+ "windows-sys 0.48.0",
+]
+
+[[package]]
+name = "polling"
+version = "3.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "30054e72317ab98eddd8561db0f6524df3367636884b7b21b703e4b280a84a14"
+dependencies = [
+ "cfg-if",
+ "concurrent-queue",
+ "pin-project-lite",
+ "rustix 0.38.9",
+ "tracing",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "ppv-lite86"
+version = "0.2.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
+
+[[package]]
+name = "proc-macro-error"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
+dependencies = [
+ "proc-macro-error-attr",
+ "proc-macro2",
+ "quote",
+ "syn 1.0.109",
+ "version_check",
+]
+
+[[package]]
+name = "proc-macro-error-attr"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "version_check",
+]
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.78"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.35"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "rand"
+version = "0.8.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
+dependencies = [
+ "libc",
+ "rand_chacha",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_chacha"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
+dependencies = [
+ "ppv-lite86",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
+dependencies = [
+ "getrandom",
+]
+
+[[package]]
+name = "rayon"
+version = "1.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd"
+dependencies = [
+ "either",
+ "rayon-core",
+]
+
+[[package]]
+name = "rayon-core"
+version = "1.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
+dependencies = [
+ "crossbeam-deque",
+ "crossbeam-utils",
+]
+
+[[package]]
+name = "regex"
+version = "1.8.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f"
+dependencies = [
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.7.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
+
+[[package]]
+name = "rstest"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b939295f93cb1d12bc1a83cf9ee963199b133fb8a79832dd51b68bb9f59a04dc"
+dependencies = [
+ "async-std",
+ "futures",
+ "futures-timer",
+ "rstest_macros",
+ "rustc_version",
+]
+
+[[package]]
+name = "rstest_macros"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f78aba848123782ba59340928ec7d876ebe745aa0365d6af8a630f19a5c16116"
+dependencies = [
+ "cfg-if",
+ "proc-macro2",
+ "quote",
+ "rustc_version",
+ "syn 1.0.109",
+]
+
+[[package]]
+name = "rstest_reuse"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "88530b681abe67924d42cca181d070e3ac20e0740569441a9e35a7cedd2b34a4"
+dependencies = [
+ "quote",
+ "rand",
+ "rustc_version",
+ "syn 2.0.52",
+]
+
+[[package]]
+name = "rustc_version"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
+dependencies = [
+ "semver",
+]
+
+[[package]]
+name = "rustix"
+version = "0.37.27"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2"
+dependencies = [
+ "bitflags 1.3.2",
+ "errno",
+ "io-lifetimes",
+ "libc",
+ "linux-raw-sys 0.3.8",
+ "windows-sys 0.48.0",
+]
+
+[[package]]
+name = "rustix"
+version = "0.38.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9bfe0f2582b4931a45d1fa608f8a8722e8b3c7ac54dd6d5f3b3212791fedef49"
+dependencies = [
+ "bitflags 2.4.2",
+ "errno",
+ "libc",
+ "linux-raw-sys 0.4.13",
+ "windows-sys 0.48.0",
+]
+
+[[package]]
+name = "rustversion"
+version = "1.0.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4"
+
+[[package]]
+name = "ryu"
+version = "1.0.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1"
+
+[[package]]
+name = "same-file"
+version = "1.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
+dependencies = [
+ "winapi-util",
+]
+
+[[package]]
+name = "semver"
+version = "1.0.22"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca"
+
+[[package]]
+name = "serde"
+version = "1.0.197"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2"
+dependencies = [
+ "serde_derive",
+]
+
+[[package]]
+name = "serde_derive"
+version = "1.0.197"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.52",
+]
+
+[[package]]
+name = "serde_json"
+version = "1.0.114"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0"
+dependencies = [
+ "itoa",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "slab"
+version = "0.4.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67"
+dependencies = [
+ "autocfg",
+]
+
+[[package]]
+name = "socket2"
+version = "0.4.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d"
+dependencies = [
+ "libc",
+ "winapi",
+]
+
+[[package]]
+name = "strsim"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
+
+[[package]]
+name = "strum"
+version = "0.25.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125"
+dependencies = [
+ "strum_macros",
+]
+
+[[package]]
+name = "strum_macros"
+version = "0.25.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0"
+dependencies = [
+ "heck",
+ "proc-macro2",
+ "quote",
+ "rustversion",
+ "syn 2.0.52",
+]
+
+[[package]]
+name = "syn"
+version = "1.0.109"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "syn"
+version = "2.0.52"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "termcolor"
+version = "1.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
+dependencies = [
+ "winapi-util",
+]
+
+[[package]]
+name = "textwrap"
+version = "0.16.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9"
+
+[[package]]
+name = "tinytemplate"
+version = "1.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc"
+dependencies = [
+ "serde",
+ "serde_json",
+]
+
+[[package]]
+name = "tracing"
+version = "0.1.40"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
+dependencies = [
+ "pin-project-lite",
+ "tracing-core",
+]
+
+[[package]]
+name = "tracing-core"
+version = "0.1.32"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54"
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
+
+[[package]]
+name = "value-bag"
+version = "1.0.0-alpha.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55"
+dependencies = [
+ "ctor",
+ "version_check",
+]
+
+[[package]]
+name = "version_check"
+version = "0.9.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
+
+[[package]]
+name = "waker-fn"
+version = "1.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690"
+
+[[package]]
+name = "walkdir"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
+dependencies = [
+ "same-file",
+ "winapi-util",
+]
+
+[[package]]
+name = "wasi"
+version = "0.11.0+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
+
+[[package]]
+name = "wasm-bindgen"
+version = "0.2.91"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f"
+dependencies = [
+ "cfg-if",
+ "wasm-bindgen-macro",
+]
+
+[[package]]
+name = "wasm-bindgen-backend"
+version = "0.2.91"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b"
+dependencies = [
+ "bumpalo",
+ "log",
+ "once_cell",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.52",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-futures"
+version = "0.4.41"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97"
+dependencies = [
+ "cfg-if",
+ "js-sys",
+ "wasm-bindgen",
+ "web-sys",
+]
+
+[[package]]
+name = "wasm-bindgen-macro"
+version = "0.2.91"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed"
+dependencies = [
+ "quote",
+ "wasm-bindgen-macro-support",
+]
+
+[[package]]
+name = "wasm-bindgen-macro-support"
+version = "0.2.91"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.52",
+ "wasm-bindgen-backend",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-shared"
+version = "0.2.91"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838"
+
+[[package]]
+name = "web-sys"
+version = "0.3.68"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446"
+dependencies = [
+ "js-sys",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "winapi"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
+dependencies = [
+ "winapi-i686-pc-windows-gnu",
+ "winapi-x86_64-pc-windows-gnu",
+]
+
+[[package]]
+name = "winapi-i686-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
+
+[[package]]
+name = "winapi-util"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
+name = "winapi-x86_64-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
+
+[[package]]
+name = "windows-sys"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
+dependencies = [
+ "windows-targets 0.48.5",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
+dependencies = [
+ "windows-targets 0.52.4",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
+dependencies = [
+ "windows_aarch64_gnullvm 0.48.5",
+ "windows_aarch64_msvc 0.48.5",
+ "windows_i686_gnu 0.48.5",
+ "windows_i686_msvc 0.48.5",
+ "windows_x86_64_gnu 0.48.5",
+ "windows_x86_64_gnullvm 0.48.5",
+ "windows_x86_64_msvc 0.48.5",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.52.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b"
+dependencies = [
+ "windows_aarch64_gnullvm 0.52.4",
+ "windows_aarch64_msvc 0.52.4",
+ "windows_i686_gnu 0.52.4",
+ "windows_i686_msvc 0.52.4",
+ "windows_x86_64_gnu 0.52.4",
+ "windows_x86_64_gnullvm 0.52.4",
+ "windows_x86_64_msvc 0.52.4",
+]
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.52.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.52.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.52.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.52.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.52.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.52.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.52.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8"
diff -pruN 43.0.0-1/rust-vendor/base64/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/base64/Cargo.toml
--- 43.0.0-1/rust-vendor/base64/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,85 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2018"
+rust-version = "1.48.0"
+name = "base64"
+version = "0.22.1"
+authors = ["Marshall Pierce <marshall@mpierce.org>"]
+description = "encodes and decodes base64 as bytes or utf8"
+documentation = "https://docs.rs/base64"
+readme = "README.md"
+keywords = [
+    "base64",
+    "utf8",
+    "encode",
+    "decode",
+    "no_std",
+]
+categories = ["encoding"]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/marshallpierce/rust-base64"
+
+[package.metadata.docs.rs]
+rustdoc-args = ["--generate-link-to-definition"]
+
+[profile.bench]
+debug = 2
+
+[profile.test]
+opt-level = 3
+
+[[example]]
+name = "base64"
+required-features = ["std"]
+
+[[test]]
+name = "tests"
+required-features = ["alloc"]
+
+[[test]]
+name = "encode"
+required-features = ["alloc"]
+
+[[bench]]
+name = "benchmarks"
+harness = false
+required-features = ["std"]
+
+[dev-dependencies.clap]
+version = "3.2.25"
+features = ["derive"]
+
+[dev-dependencies.criterion]
+version = "0.4.0"
+
+[dev-dependencies.once_cell]
+version = "1"
+
+[dev-dependencies.rand]
+version = "0.8.5"
+features = ["small_rng"]
+
+[dev-dependencies.rstest]
+version = "0.13.0"
+
+[dev-dependencies.rstest_reuse]
+version = "0.6.0"
+
+[dev-dependencies.strum]
+version = "0.25"
+features = ["derive"]
+
+[features]
+alloc = []
+default = ["std"]
+std = ["alloc"]
diff -pruN 43.0.0-1/rust-vendor/base64/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/base64/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/base64/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,201 @@
+                              Apache License
+                        Version 2.0, January 2004
+                     http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+   "License" shall mean the terms and conditions for use, reproduction,
+   and distribution as defined by Sections 1 through 9 of this document.
+
+   "Licensor" shall mean the copyright owner or entity authorized by
+   the copyright owner that is granting the License.
+
+   "Legal Entity" shall mean the union of the acting entity and all
+   other entities that control, are controlled by, or are under common
+   control with that entity. For the purposes of this definition,
+   "control" means (i) the power, direct or indirect, to cause the
+   direction or management of such entity, whether by contract or
+   otherwise, or (ii) ownership of fifty percent (50%) or more of the
+   outstanding shares, or (iii) beneficial ownership of such entity.
+
+   "You" (or "Your") shall mean an individual or Legal Entity
+   exercising permissions granted by this License.
+
+   "Source" form shall mean the preferred form for making modifications,
+   including but not limited to software source code, documentation
+   source, and configuration files.
+
+   "Object" form shall mean any form resulting from mechanical
+   transformation or translation of a Source form, including but
+   not limited to compiled object code, generated documentation,
+   and conversions to other media types.
+
+   "Work" shall mean the work of authorship, whether in Source or
+   Object form, made available under the License, as indicated by a
+   copyright notice that is included in or attached to the work
+   (an example is provided in the Appendix below).
+
+   "Derivative Works" shall mean any work, whether in Source or Object
+   form, that is based on (or derived from) the Work and for which the
+   editorial revisions, annotations, elaborations, or other modifications
+   represent, as a whole, an original work of authorship. For the purposes
+   of this License, Derivative Works shall not include works that remain
+   separable from, or merely link (or bind by name) to the interfaces of,
+   the Work and Derivative Works thereof.
+
+   "Contribution" shall mean any work of authorship, including
+   the original version of the Work and any modifications or additions
+   to that Work or Derivative Works thereof, that is intentionally
+   submitted to Licensor for inclusion in the Work by the copyright owner
+   or by an individual or Legal Entity authorized to submit on behalf of
+   the copyright owner. For the purposes of this definition, "submitted"
+   means any form of electronic, verbal, or written communication sent
+   to the Licensor or its representatives, including but not limited to
+   communication on electronic mailing lists, source code control systems,
+   and issue tracking systems that are managed by, or on behalf of, the
+   Licensor for the purpose of discussing and improving the Work, but
+   excluding communication that is conspicuously marked or otherwise
+   designated in writing by the copyright owner as "Not a Contribution."
+
+   "Contributor" shall mean Licensor and any individual or Legal Entity
+   on behalf of whom a Contribution has been received by Licensor and
+   subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   copyright license to reproduce, prepare Derivative Works of,
+   publicly display, publicly perform, sublicense, and distribute the
+   Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   (except as stated in this section) patent license to make, have made,
+   use, offer to sell, sell, import, and otherwise transfer the Work,
+   where such license applies only to those patent claims licensable
+   by such Contributor that are necessarily infringed by their
+   Contribution(s) alone or by combination of their Contribution(s)
+   with the Work to which such Contribution(s) was submitted. If You
+   institute patent litigation against any entity (including a
+   cross-claim or counterclaim in a lawsuit) alleging that the Work
+   or a Contribution incorporated within the Work constitutes direct
+   or contributory patent infringement, then any patent licenses
+   granted to You under this License for that Work shall terminate
+   as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+   Work or Derivative Works thereof in any medium, with or without
+   modifications, and in Source or Object form, provided that You
+   meet the following conditions:
+
+   (a) You must give any other recipients of the Work or
+       Derivative Works a copy of this License; and
+
+   (b) You must cause any modified files to carry prominent notices
+       stating that You changed the files; and
+
+   (c) You must retain, in the Source form of any Derivative Works
+       that You distribute, all copyright, patent, trademark, and
+       attribution notices from the Source form of the Work,
+       excluding those notices that do not pertain to any part of
+       the Derivative Works; and
+
+   (d) If the Work includes a "NOTICE" text file as part of its
+       distribution, then any Derivative Works that You distribute must
+       include a readable copy of the attribution notices contained
+       within such NOTICE file, excluding those notices that do not
+       pertain to any part of the Derivative Works, in at least one
+       of the following places: within a NOTICE text file distributed
+       as part of the Derivative Works; within the Source form or
+       documentation, if provided along with the Derivative Works; or,
+       within a display generated by the Derivative Works, if and
+       wherever such third-party notices normally appear. The contents
+       of the NOTICE file are for informational purposes only and
+       do not modify the License. You may add Your own attribution
+       notices within Derivative Works that You distribute, alongside
+       or as an addendum to the NOTICE text from the Work, provided
+       that such additional attribution notices cannot be construed
+       as modifying the License.
+
+   You may add Your own copyright statement to Your modifications and
+   may provide additional or different license terms and conditions
+   for use, reproduction, or distribution of Your modifications, or
+   for any such Derivative Works as a whole, provided Your use,
+   reproduction, and distribution of the Work otherwise complies with
+   the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+   any Contribution intentionally submitted for inclusion in the Work
+   by You to the Licensor shall be under the terms and conditions of
+   this License, without any additional terms or conditions.
+   Notwithstanding the above, nothing herein shall supersede or modify
+   the terms of any separate license agreement you may have executed
+   with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+   names, trademarks, service marks, or product names of the Licensor,
+   except as required for reasonable and customary use in describing the
+   origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+   agreed to in writing, Licensor provides the Work (and each
+   Contributor provides its Contributions) on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+   implied, including, without limitation, any warranties or conditions
+   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+   PARTICULAR PURPOSE. You are solely responsible for determining the
+   appropriateness of using or redistributing the Work and assume any
+   risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+   whether in tort (including negligence), contract, or otherwise,
+   unless required by applicable law (such as deliberate and grossly
+   negligent acts) or agreed to in writing, shall any Contributor be
+   liable to You for damages, including any direct, indirect, special,
+   incidental, or consequential damages of any character arising as a
+   result of this License or out of the use or inability to use the
+   Work (including but not limited to damages for loss of goodwill,
+   work stoppage, computer failure or malfunction, or any and all
+   other commercial damages or losses), even if such Contributor
+   has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+   the Work or Derivative Works thereof, You may choose to offer,
+   and charge a fee for, acceptance of support, warranty, indemnity,
+   or other liability obligations and/or rights consistent with this
+   License. However, in accepting such obligations, You may act only
+   on Your own behalf and on Your sole responsibility, not on behalf
+   of any other Contributor, and only if You agree to indemnify,
+   defend, and hold each Contributor harmless for any liability
+   incurred by, or claims asserted against, such Contributor by reason
+   of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+   To apply the Apache License to your work, attach the following
+   boilerplate notice, with the fields enclosed by brackets "[]"
+   replaced with your own identifying information. (Don't include
+   the brackets!)  The text should be enclosed in the appropriate
+   comment syntax for the file format. We also recommend that a
+   file or class name and description of purpose be included on the
+   same "printed page" as the copyright notice for easier
+   identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+	http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff -pruN 43.0.0-1/rust-vendor/base64/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/base64/LICENSE-MIT
--- 43.0.0-1/rust-vendor/base64/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Alice Maz
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/base64/README.md 43.0.0-1ubuntu1/rust-vendor/base64/README.md
--- 43.0.0-1/rust-vendor/base64/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,154 @@
+# [base64](https://crates.io/crates/base64)
+
+[![](https://img.shields.io/crates/v/base64.svg)](https://crates.io/crates/base64) [![Docs](https://docs.rs/base64/badge.svg)](https://docs.rs/base64) [![CircleCI](https://circleci.com/gh/marshallpierce/rust-base64/tree/master.svg?style=shield)](https://circleci.com/gh/marshallpierce/rust-base64/tree/master) [![codecov](https://codecov.io/gh/marshallpierce/rust-base64/branch/master/graph/badge.svg)](https://codecov.io/gh/marshallpierce/rust-base64) [![unsafe forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/)
+
+<a href="https://www.jetbrains.com/?from=rust-base64"><img src="/icon_CLion.svg" height="40px"/></a>
+
+Made with CLion. Thanks to JetBrains for supporting open source!
+
+It's base64. What more could anyone want?
+
+This library's goals are to be *correct* and *fast*. It's thoroughly tested and widely used. It exposes functionality at
+multiple levels of abstraction so you can choose the level of convenience vs performance that you want,
+e.g. `decode_engine_slice` decodes into an existing `&mut [u8]` and is pretty fast (2.6GiB/s for a 3 KiB input),
+whereas `decode_engine` allocates a new `Vec<u8>` and returns it, which might be more convenient in some cases, but is
+slower (although still fast enough for almost any purpose) at 2.1 GiB/s.
+
+See the [docs](https://docs.rs/base64) for all the details.
+
+## FAQ
+
+### I need to decode base64 with whitespace/null bytes/other random things interspersed in it. What should I do?
+
+Remove non-base64 characters from your input before decoding.
+
+If you have a `Vec` of base64, [retain](https://doc.rust-lang.org/std/vec/struct.Vec.html#method.retain) can be used to
+strip out whatever you need removed.
+
+If you have a `Read` (e.g. reading a file or network socket), there are various approaches.
+
+- Use [iter_read](https://crates.io/crates/iter-read) together with `Read`'s `bytes()` to filter out unwanted bytes.
+- Implement `Read` with a `read()` impl that delegates to your actual `Read`, and then drops any bytes you don't want.
+
+### I need to line-wrap base64, e.g. for MIME/PEM.
+
+[line-wrap](https://crates.io/crates/line-wrap) does just that.
+
+### I want canonical base64 encoding/decoding.
+
+First, don't do this. You should no more expect Base64 to be canonical than you should expect compression algorithms to
+produce canonical output across all usage in the wild (hint: they don't).
+However, [people are drawn to their own destruction like moths to a flame](https://eprint.iacr.org/2022/361), so here we
+are.
+
+There are two opportunities for non-canonical encoding (and thus, detection of the same during decoding): the final bits
+of the last encoded token in two or three token suffixes, and the `=` token used to inflate the suffix to a full four
+tokens.
+
+The trailing bits issue is unavoidable: with 6 bits available in each encoded token, 1 input byte takes 2 tokens,
+with the second one having some bits unused. Same for two input bytes: 16 bits, but 3 tokens have 18 bits. Unless we
+decide to stop shipping whole bytes around, we're stuck with those extra bits that a sneaky or buggy encoder might set
+to 1 instead of 0.
+
+The `=` pad bytes, on the other hand, are entirely a self-own by the Base64 standard. They do not affect decoding other
+than to provide an opportunity to say "that padding is incorrect". Exabytes of storage and transfer have no doubt been
+wasted on pointless `=` bytes. Somehow we all seem to be quite comfortable with, say, hex-encoded data just stopping
+when it's done rather than requiring a confirmation that the author of the encoder could count to four. Anyway, there
+are two ways to make pad bytes predictable: require canonical padding to the next multiple of four bytes as per the RFC,
+or, if you control all producers and consumers, save a few bytes by requiring no padding (especially applicable to the
+url-safe alphabet).
+
+All `Engine` implementations must at a minimum support treating non-canonical padding of both types as an error, and
+optionally may allow other behaviors.
+
+## Rust version compatibility
+
+The minimum supported Rust version is 1.48.0.
+
+# Contributing
+
+Contributions are very welcome. However, because this library is used widely, and in security-sensitive contexts, all
+PRs will be carefully scrutinized. Beyond that, this sort of low level library simply needs to be 100% correct. Nobody
+wants to chase bugs in encoding of any sort.
+
+All this means that it takes me a fair amount of time to review each PR, so it might take quite a while to carve out the
+free time to give each PR the attention it deserves. I will get to everyone eventually!
+
+## Developing
+
+Benchmarks are in `benches/`.
+
+```bash
+cargo bench
+```
+
+## no_std
+
+This crate supports no_std. By default the crate targets std via the `std` feature. You can deactivate
+the `default-features` to target `core` instead. In that case you lose out on all the functionality revolving
+around `std::io`, `std::error::Error`, and heap allocations. There is an additional `alloc` feature that you can activate
+to bring back the support for heap allocations.
+
+## Profiling
+
+On Linux, you can use [perf](https://perf.wiki.kernel.org/index.php/Main_Page) for profiling. Then compile the
+benchmarks with `cargo bench --no-run`.
+
+Run the benchmark binary with `perf` (shown here filtering to one particular benchmark, which will make the results
+easier to read). `perf` is only available to the root user on most systems as it fiddles with event counters in your
+CPU, so use `sudo`. We need to run the actual benchmark binary, hence the path into `target`. You can see the actual
+full path with `cargo bench -v`; it will print out the commands it runs. If you use the exact path
+that `bench` outputs, make sure you get the one that's for the benchmarks, not the tests. You may also want
+to `cargo clean` so you have only one `benchmarks-` binary (they tend to accumulate).
+
+```bash
+sudo perf record target/release/deps/benchmarks-* --bench decode_10mib_reuse
+```
+
+Then analyze the results, again with perf:
+
+```bash
+sudo perf annotate -l
+```
+
+You'll see a bunch of interleaved rust source and assembly like this. The section with `lib.rs:327` is telling us that
+4.02% of samples saw the `movzbl` aka bit shift as the active instruction. However, this percentage is not as exact as
+it seems due to a phenomenon called *skid*. Basically, a consequence of how fancy modern CPUs are is that this sort of
+instruction profiling is inherently inaccurate, especially in branch-heavy code.
+
+```text
+ lib.rs:322    0.70 :     10698:       mov    %rdi,%rax
+    2.82 :        1069b:       shr    $0x38,%rax
+         :                  if morsel == decode_tables::INVALID_VALUE {
+         :                      bad_byte_index = input_index;
+         :                      break;
+         :                  };
+         :                  accum = (morsel as u64) << 58;
+ lib.rs:327    4.02 :     1069f:       movzbl (%r9,%rax,1),%r15d
+         :              // fast loop of 8 bytes at a time
+         :              while input_index < length_of_full_chunks {
+         :                  let mut accum: u64;
+         :
+         :                  let input_chunk = BigEndian::read_u64(&input_bytes[input_index..(input_index + 8)]);
+         :                  morsel = decode_table[(input_chunk >> 56) as usize];
+ lib.rs:322    3.68 :     106a4:       cmp    $0xff,%r15
+         :                  if morsel == decode_tables::INVALID_VALUE {
+    0.00 :        106ab:       je     1090e <base64::decode_config_buf::hbf68a45fefa299c1+0x46e>
+```
+
+## Fuzzing
+
+This uses [cargo-fuzz](https://github.com/rust-fuzz/cargo-fuzz). See `fuzz/fuzzers` for the available fuzzing scripts.
+To run, use an invocation like these:
+
+```bash
+cargo +nightly fuzz run roundtrip
+cargo +nightly fuzz run roundtrip_no_pad
+cargo +nightly fuzz run roundtrip_random_config -- -max_len=10240
+cargo +nightly fuzz run decode_random
+```
+
+## License
+
+This project is dual-licensed under MIT and Apache 2.0.
+
diff -pruN 43.0.0-1/rust-vendor/base64/RELEASE-NOTES.md 43.0.0-1ubuntu1/rust-vendor/base64/RELEASE-NOTES.md
--- 43.0.0-1/rust-vendor/base64/RELEASE-NOTES.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/RELEASE-NOTES.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,271 @@
+# 0.22.1
+
+- Correct the symbols used for the predefined `alphabet::BIN_HEX`.
+
+# 0.22.0
+
+- `DecodeSliceError::OutputSliceTooSmall` is now conservative rather than precise. That is, the error will only occur if the decoded output _cannot_ fit, meaning that `Engine::decode_slice` can now be used with exactly-sized output slices. As part of this, `Engine::internal_decode` now returns `DecodeSliceError` instead of `DecodeError`, but that is not expected to affect any external callers.
+- `DecodeError::InvalidLength` now refers specifically to the _number of valid symbols_ being invalid (i.e. `len % 4 == 1`), rather than just the number of input bytes. This avoids confusing scenarios when based on interpretation you could make a case for either `InvalidLength` or `InvalidByte` being appropriate.
+- Decoding is somewhat faster (5-10%)
+
+# 0.21.7
+
+- Support getting an alphabet's contents as a str via `Alphabet::as_str()`
+
+# 0.21.6
+
+- Improved introductory documentation and example
+
+# 0.21.5
+
+- Add `Debug` and `Clone` impls for the general purpose Engine
+
+# 0.21.4
+
+- Make `encoded_len` `const`, allowing the creation of arrays sized to encode compile-time-known data lengths
+
+# 0.21.3
+
+- Implement `source` instead of `cause` on Error types
+- Roll back MSRV to 1.48.0 so Debian can continue to live in a time warp
+- Slightly faster chunked encoding for short inputs
+- Decrease binary size
+
+# 0.21.2
+
+- Rollback MSRV to 1.57.0 -- only dev dependencies need 1.60, not the main code
+
+# 0.21.1
+
+- Remove the possibility of panicking during decoded length calculations
+- `DecoderReader` no longer sometimes erroneously ignores
+  padding  [#226](https://github.com/marshallpierce/rust-base64/issues/226)
+
+## Breaking changes
+
+- `Engine.internal_decode` return type changed
+- Update MSRV to 1.60.0
+
+# 0.21.0
+
+## Migration
+
+### Functions
+
+| < 0.20 function         | 0.21 equivalent                                                                     |
+|-------------------------|-------------------------------------------------------------------------------------|
+| `encode()`              | `engine::general_purpose::STANDARD.encode()` or `prelude::BASE64_STANDARD.encode()` |
+| `encode_config()`       | `engine.encode()`                                                                   |
+| `encode_config_buf()`   | `engine.encode_string()`                                                            |
+| `encode_config_slice()` | `engine.encode_slice()`                                                             |
+| `decode()`              | `engine::general_purpose::STANDARD.decode()` or `prelude::BASE64_STANDARD.decode()` |
+| `decode_config()`       | `engine.decode()`                                                                   |
+| `decode_config_buf()`   | `engine.decode_vec()`                                                               |
+| `decode_config_slice()` | `engine.decode_slice()`                                                             |
+
+The short-lived 0.20 functions were the 0.13 functions with `config` replaced with `engine`.
+
+### Padding
+
+If applicable, use the preset engines `engine::STANDARD`, `engine::STANDARD_NO_PAD`, `engine::URL_SAFE`,
+or `engine::URL_SAFE_NO_PAD`.
+The `NO_PAD` ones require that padding is absent when decoding, and the others require that
+canonical padding is present .
+
+If you need the < 0.20 behavior that did not care about padding, or want to recreate < 0.20.0's predefined `Config`s
+precisely, see the following table.
+
+| 0.13.1 Config   | 0.20.0+ alphabet | `encode_padding` | `decode_padding_mode` |
+|-----------------|------------------|------------------|-----------------------|
+| STANDARD        | STANDARD         | true             | Indifferent           |
+| STANDARD_NO_PAD | STANDARD         | false            | Indifferent           |
+| URL_SAFE        | URL_SAFE         | true             | Indifferent           |
+| URL_SAFE_NO_PAD | URL_SAFE         | false            | Indifferent           |
+
+# 0.21.0-rc.1
+
+- Restore the ability to decode into a slice of precisely the correct length with `Engine.decode_slice_unchecked`.
+- Add `Engine` as a `pub use` in `prelude`.
+
+# 0.21.0-beta.2
+
+## Breaking changes
+
+- Re-exports of preconfigured engines in `engine` are removed in favor of `base64::prelude::...` that are better suited
+  to those who wish to `use` the entire path to a name.
+
+# 0.21.0-beta.1
+
+## Breaking changes
+
+- `FastPortable` was only meant to be an interim name, and shouldn't have shipped in 0.20. It is now `GeneralPurpose` to
+  make its intended usage more clear.
+- `GeneralPurpose` and its config are now `pub use`'d in the `engine` module for convenience.
+- Change a few `from()` functions to be `new()`. `from()` causes confusing compiler errors because of confusion
+  with `From::from`, and is a little misleading because some of those invocations are not very cheap as one would
+  usually expect from a `from` call.
+- `encode*` and `decode*` top level functions are now methods on `Engine`.
+- `DEFAULT_ENGINE` was replaced by `engine::general_purpose::STANDARD`
+- Predefined engine consts `engine::general_purpose::{STANDARD, STANDARD_NO_PAD, URL_SAFE, URL_SAFE_NO_PAD}`
+    - These are `pub use`d into `engine` as well
+- The `*_slice` decode/encode functions now return an error instead of panicking when the output slice is too small
+    - As part of this, there isn't now a public way to decode into a slice _exactly_ the size needed for inputs that
+      aren't multiples of 4 tokens. If adding up to 2 bytes to always be a multiple of 3 bytes for the decode buffer is
+      a problem, file an issue.
+
+## Other changes
+
+- `decoded_len_estimate()` is provided to make it easy to size decode buffers correctly.
+
+# 0.20.0
+
+## Breaking changes
+
+- Update MSRV to 1.57.0
+- Decoding can now either ignore padding, require correct padding, or require no padding. The default is to require
+  correct padding.
+    - The `NO_PAD` config now requires that padding be absent when decoding.
+
+## 0.20.0-alpha.1
+
+### Breaking changes
+
+- Extended the `Config` concept into the `Engine` abstraction, allowing the user to pick different encoding / decoding
+  implementations.
+    - What was formerly the only algorithm is now the `FastPortable` engine, so named because it's portable (works on
+      any CPU) and relatively fast.
+    - This opens the door to a portable constant-time
+      implementation ([#153](https://github.com/marshallpierce/rust-base64/pull/153),
+      presumably `ConstantTimePortable`?) for security-sensitive applications that need side-channel resistance, and
+      CPU-specific SIMD implementations for more speed.
+    - Standard base64 per the RFC is available via `DEFAULT_ENGINE`. To use different alphabets or other settings (
+      padding, etc), create your own engine instance.
+- `CharacterSet` is now `Alphabet` (per the RFC), and allows creating custom alphabets. The corresponding tables that
+  were previously code-generated are now built dynamically.
+- Since there are already multiple breaking changes, various functions are renamed to be more consistent and
+  discoverable.
+- MSRV is now 1.47.0 to allow various things to use `const fn`.
+- `DecoderReader` now owns its inner reader, and can expose it via `into_inner()`. For symmetry, `EncoderWriter` can do
+  the same with its writer.
+- `encoded_len` is now public so you can size encode buffers precisely.
+
+# 0.13.1
+
+- More precise decode buffer sizing, avoiding unnecessary allocation in `decode_config`.
+
+# 0.13.0
+
+- Config methods are const
+- Added `EncoderStringWriter` to allow encoding directly to a String
+- `EncoderWriter` now owns its delegate writer rather than keeping a reference to it (though refs still work)
+    - As a consequence, it is now possible to extract the delegate writer from an `EncoderWriter` via `finish()`, which
+      returns `Result<W>` instead of `Result<()>`. If you were calling `finish()` explicitly, you will now need to
+      use `let _ = foo.finish()` instead of just `foo.finish()` to avoid a warning about the unused value.
+- When decoding input that has both an invalid length and an invalid symbol as the last byte, `InvalidByte` will be
+  emitted instead of `InvalidLength` to make the problem more obvious.
+
+# 0.12.2
+
+- Add `BinHex` alphabet
+
+# 0.12.1
+
+- Add `Bcrypt` alphabet
+
+# 0.12.0
+
+- A `Read` implementation (`DecoderReader`) to let users transparently decoded data from a b64 input source
+- IMAP's modified b64 alphabet
+- Relaxed type restrictions to just `AsRef<[ut8]>` for main `encode*`/`decode*` functions
+- A minor performance improvement in encoding
+
+# 0.11.0
+
+- Minimum rust version 1.34.0
+- `no_std` is now supported via the two new features `alloc` and `std`.
+
+# 0.10.1
+
+- Minimum rust version 1.27.2
+- Fix bug in streaming encoding ([#90](https://github.com/marshallpierce/rust-base64/pull/90)): if the underlying writer
+  didn't write all the bytes given to it, the remaining bytes would not be retried later. See the docs
+  on `EncoderWriter::write`.
+- Make it configurable whether or not to return an error when decoding detects excess trailing bits.
+
+# 0.10.0
+
+- Remove line wrapping. Line wrapping was never a great conceptual fit in this library, and other features (streaming
+  encoding, etc) either couldn't support it or could support only special cases of it with a great increase in
+  complexity. Line wrapping has been pulled out into a [line-wrap](https://crates.io/crates/line-wrap) crate, so it's
+  still available if you need it.
+    - `Base64Display` creation no longer uses a `Result` because it can't fail, which means its helper methods for
+      common
+      configs that `unwrap()` for you are no longer needed
+- Add a streaming encoder `Write` impl to transparently base64 as you write.
+- Remove the remaining `unsafe` code.
+- Remove whitespace stripping to simplify `no_std` support. No out of the box configs use it, and it's trivial to do
+  yourself if needed: `filter(|b| !b" \n\t\r\x0b\x0c".contains(b)`.
+- Detect invalid trailing symbols when decoding and return an error rather than silently ignoring them.
+
+# 0.9.3
+
+- Update safemem
+
+# 0.9.2
+
+- Derive `Clone` for `DecodeError`.
+
+# 0.9.1
+
+- Add support for `crypt(3)`'s base64 variant.
+
+# 0.9.0
+
+- `decode_config_slice` function for no-allocation decoding, analogous to `encode_config_slice`
+- Decode performance optimization
+
+# 0.8.0
+
+- `encode_config_slice` function for no-allocation encoding
+
+# 0.7.0
+
+- `STANDARD_NO_PAD` config
+- `Base64Display` heap-free wrapper for use in format strings, etc
+
+# 0.6.0
+
+- Decode performance improvements
+- Use `unsafe` in fewer places
+- Added fuzzers
+
+# 0.5.2
+
+- Avoid usize overflow when calculating length
+- Better line wrapping performance
+
+# 0.5.1
+
+- Temporarily disable line wrapping
+- Add Apache 2.0 license
+
+# 0.5.0
+
+- MIME support, including configurable line endings and line wrapping
+- Removed `decode_ws`
+- Renamed `Base64Error` to `DecodeError`
+
+# 0.4.1
+
+- Allow decoding a `AsRef<[u8]>` instead of just a `&str`
+
+# 0.4.0
+
+- Configurable padding
+- Encode performance improvements
+
+# 0.3.0
+
+- Added encode/decode functions that do not allocate their own storage
+- Decode performance improvements
+- Extraneous padding bytes are no longer ignored. Now, an error will be returned.
diff -pruN 43.0.0-1/rust-vendor/base64/benches/benchmarks.rs 43.0.0-1ubuntu1/rust-vendor/base64/benches/benchmarks.rs
--- 43.0.0-1/rust-vendor/base64/benches/benchmarks.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/benches/benchmarks.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,238 @@
+#[macro_use]
+extern crate criterion;
+
+use base64::{
+    display,
+    engine::{general_purpose::STANDARD, Engine},
+    write,
+};
+use criterion::{black_box, Bencher, BenchmarkId, Criterion, Throughput};
+use rand::{Rng, SeedableRng};
+use std::io::{self, Read, Write};
+
+fn do_decode_bench(b: &mut Bencher, &size: &usize) {
+    let mut v: Vec<u8> = Vec::with_capacity(size * 3 / 4);
+    fill(&mut v);
+    let encoded = STANDARD.encode(&v);
+
+    b.iter(|| {
+        let orig = STANDARD.decode(&encoded);
+        black_box(&orig);
+    });
+}
+
+fn do_decode_bench_reuse_buf(b: &mut Bencher, &size: &usize) {
+    let mut v: Vec<u8> = Vec::with_capacity(size * 3 / 4);
+    fill(&mut v);
+    let encoded = STANDARD.encode(&v);
+
+    let mut buf = Vec::new();
+    b.iter(|| {
+        STANDARD.decode_vec(&encoded, &mut buf).unwrap();
+        black_box(&buf);
+        buf.clear();
+    });
+}
+
+fn do_decode_bench_slice(b: &mut Bencher, &size: &usize) {
+    let mut v: Vec<u8> = Vec::with_capacity(size * 3 / 4);
+    fill(&mut v);
+    let encoded = STANDARD.encode(&v);
+
+    let mut buf = vec![0; size];
+    b.iter(|| {
+        STANDARD.decode_slice(&encoded, &mut buf).unwrap();
+        black_box(&buf);
+    });
+}
+
+fn do_decode_bench_stream(b: &mut Bencher, &size: &usize) {
+    let mut v: Vec<u8> = Vec::with_capacity(size * 3 / 4);
+    fill(&mut v);
+    let encoded = STANDARD.encode(&v);
+
+    let mut buf = vec![0; size];
+    buf.truncate(0);
+
+    b.iter(|| {
+        let mut cursor = io::Cursor::new(&encoded[..]);
+        let mut decoder = base64::read::DecoderReader::new(&mut cursor, &STANDARD);
+        decoder.read_to_end(&mut buf).unwrap();
+        buf.clear();
+        black_box(&buf);
+    });
+}
+
+fn do_encode_bench(b: &mut Bencher, &size: &usize) {
+    let mut v: Vec<u8> = Vec::with_capacity(size);
+    fill(&mut v);
+    b.iter(|| {
+        let e = STANDARD.encode(&v);
+        black_box(&e);
+    });
+}
+
+fn do_encode_bench_display(b: &mut Bencher, &size: &usize) {
+    let mut v: Vec<u8> = Vec::with_capacity(size);
+    fill(&mut v);
+    b.iter(|| {
+        let e = format!("{}", display::Base64Display::new(&v, &STANDARD));
+        black_box(&e);
+    });
+}
+
+fn do_encode_bench_reuse_buf(b: &mut Bencher, &size: &usize) {
+    let mut v: Vec<u8> = Vec::with_capacity(size);
+    fill(&mut v);
+    let mut buf = String::new();
+    b.iter(|| {
+        STANDARD.encode_string(&v, &mut buf);
+        buf.clear();
+    });
+}
+
+fn do_encode_bench_slice(b: &mut Bencher, &size: &usize) {
+    let mut v: Vec<u8> = Vec::with_capacity(size);
+    fill(&mut v);
+    // conservative estimate of encoded size
+    let mut buf = vec![0; v.len() * 2];
+    b.iter(|| STANDARD.encode_slice(&v, &mut buf).unwrap());
+}
+
+fn do_encode_bench_stream(b: &mut Bencher, &size: &usize) {
+    let mut v: Vec<u8> = Vec::with_capacity(size);
+    fill(&mut v);
+    let mut buf = Vec::with_capacity(size * 2);
+
+    b.iter(|| {
+        buf.clear();
+        let mut stream_enc = write::EncoderWriter::new(&mut buf, &STANDARD);
+        stream_enc.write_all(&v).unwrap();
+        stream_enc.flush().unwrap();
+    });
+}
+
+fn do_encode_bench_string_stream(b: &mut Bencher, &size: &usize) {
+    let mut v: Vec<u8> = Vec::with_capacity(size);
+    fill(&mut v);
+
+    b.iter(|| {
+        let mut stream_enc = write::EncoderStringWriter::new(&STANDARD);
+        stream_enc.write_all(&v).unwrap();
+        stream_enc.flush().unwrap();
+        let _ = stream_enc.into_inner();
+    });
+}
+
+fn do_encode_bench_string_reuse_buf_stream(b: &mut Bencher, &size: &usize) {
+    let mut v: Vec<u8> = Vec::with_capacity(size);
+    fill(&mut v);
+
+    let mut buf = String::new();
+    b.iter(|| {
+        buf.clear();
+        let mut stream_enc = write::EncoderStringWriter::from_consumer(&mut buf, &STANDARD);
+        stream_enc.write_all(&v).unwrap();
+        stream_enc.flush().unwrap();
+        let _ = stream_enc.into_inner();
+    });
+}
+
+fn fill(v: &mut Vec<u8>) {
+    let cap = v.capacity();
+    // weak randomness is plenty; we just want to not be completely friendly to the branch predictor
+    let mut r = rand::rngs::SmallRng::from_entropy();
+    while v.len() < cap {
+        v.push(r.gen::<u8>());
+    }
+}
+
+const BYTE_SIZES: [usize; 5] = [3, 50, 100, 500, 3 * 1024];
+
+// Benchmarks over these byte sizes take longer so we will run fewer samples to
+// keep the benchmark runtime reasonable.
+const LARGE_BYTE_SIZES: [usize; 3] = [3 * 1024 * 1024, 10 * 1024 * 1024, 30 * 1024 * 1024];
+
+fn encode_benchmarks(c: &mut Criterion, label: &str, byte_sizes: &[usize]) {
+    let mut group = c.benchmark_group(label);
+    group
+        .warm_up_time(std::time::Duration::from_millis(500))
+        .measurement_time(std::time::Duration::from_secs(3));
+
+    for size in byte_sizes {
+        group
+            .throughput(Throughput::Bytes(*size as u64))
+            .bench_with_input(BenchmarkId::new("encode", size), size, do_encode_bench)
+            .bench_with_input(
+                BenchmarkId::new("encode_display", size),
+                size,
+                do_encode_bench_display,
+            )
+            .bench_with_input(
+                BenchmarkId::new("encode_reuse_buf", size),
+                size,
+                do_encode_bench_reuse_buf,
+            )
+            .bench_with_input(
+                BenchmarkId::new("encode_slice", size),
+                size,
+                do_encode_bench_slice,
+            )
+            .bench_with_input(
+                BenchmarkId::new("encode_reuse_buf_stream", size),
+                size,
+                do_encode_bench_stream,
+            )
+            .bench_with_input(
+                BenchmarkId::new("encode_string_stream", size),
+                size,
+                do_encode_bench_string_stream,
+            )
+            .bench_with_input(
+                BenchmarkId::new("encode_string_reuse_buf_stream", size),
+                size,
+                do_encode_bench_string_reuse_buf_stream,
+            );
+    }
+
+    group.finish();
+}
+
+fn decode_benchmarks(c: &mut Criterion, label: &str, byte_sizes: &[usize]) {
+    let mut group = c.benchmark_group(label);
+
+    for size in byte_sizes {
+        group
+            .warm_up_time(std::time::Duration::from_millis(500))
+            .measurement_time(std::time::Duration::from_secs(3))
+            .throughput(Throughput::Bytes(*size as u64))
+            .bench_with_input(BenchmarkId::new("decode", size), size, do_decode_bench)
+            .bench_with_input(
+                BenchmarkId::new("decode_reuse_buf", size),
+                size,
+                do_decode_bench_reuse_buf,
+            )
+            .bench_with_input(
+                BenchmarkId::new("decode_slice", size),
+                size,
+                do_decode_bench_slice,
+            )
+            .bench_with_input(
+                BenchmarkId::new("decode_stream", size),
+                size,
+                do_decode_bench_stream,
+            );
+    }
+
+    group.finish();
+}
+
+fn bench(c: &mut Criterion) {
+    encode_benchmarks(c, "encode_small_input", &BYTE_SIZES[..]);
+    encode_benchmarks(c, "encode_large_input", &LARGE_BYTE_SIZES[..]);
+    decode_benchmarks(c, "decode_small_input", &BYTE_SIZES[..]);
+    decode_benchmarks(c, "decode_large_input", &LARGE_BYTE_SIZES[..]);
+}
+
+criterion_group!(benches, bench);
+criterion_main!(benches);
diff -pruN 43.0.0-1/rust-vendor/base64/clippy.toml 43.0.0-1ubuntu1/rust-vendor/base64/clippy.toml
--- 43.0.0-1/rust-vendor/base64/clippy.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/clippy.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+msrv = "1.48.0"
diff -pruN 43.0.0-1/rust-vendor/base64/examples/base64.rs 43.0.0-1ubuntu1/rust-vendor/base64/examples/base64.rs
--- 43.0.0-1/rust-vendor/base64/examples/base64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/examples/base64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,81 @@
+use std::fs::File;
+use std::io::{self, Read};
+use std::path::PathBuf;
+use std::process;
+
+use base64::{alphabet, engine, read, write};
+use clap::Parser;
+
+#[derive(Clone, Debug, Parser, strum::EnumString, Default)]
+#[strum(serialize_all = "kebab-case")]
+enum Alphabet {
+    #[default]
+    Standard,
+    UrlSafe,
+}
+
+/// Base64 encode or decode FILE (or standard input), to standard output.
+#[derive(Debug, Parser)]
+struct Opt {
+    /// Decode the base64-encoded input (default: encode the input as base64).
+    #[structopt(short = 'd', long = "decode")]
+    decode: bool,
+
+    /// The encoding alphabet: "standard" (default) or "url-safe".
+    #[structopt(long = "alphabet")]
+    alphabet: Option<Alphabet>,
+
+    /// Omit padding characters while encoding, and reject them while decoding.
+    #[structopt(short = 'p', long = "no-padding")]
+    no_padding: bool,
+
+    /// The file to encode or decode.
+    #[structopt(name = "FILE", parse(from_os_str))]
+    file: Option<PathBuf>,
+}
+
+fn main() {
+    let opt = Opt::parse();
+    let stdin;
+    let mut input: Box<dyn Read> = match opt.file {
+        None => {
+            stdin = io::stdin();
+            Box::new(stdin.lock())
+        }
+        Some(ref f) if f.as_os_str() == "-" => {
+            stdin = io::stdin();
+            Box::new(stdin.lock())
+        }
+        Some(f) => Box::new(File::open(f).unwrap()),
+    };
+
+    let alphabet = opt.alphabet.unwrap_or_default();
+    let engine = engine::GeneralPurpose::new(
+        &match alphabet {
+            Alphabet::Standard => alphabet::STANDARD,
+            Alphabet::UrlSafe => alphabet::URL_SAFE,
+        },
+        match opt.no_padding {
+            true => engine::general_purpose::NO_PAD,
+            false => engine::general_purpose::PAD,
+        },
+    );
+
+    let stdout = io::stdout();
+    let mut stdout = stdout.lock();
+    let r = if opt.decode {
+        let mut decoder = read::DecoderReader::new(&mut input, &engine);
+        io::copy(&mut decoder, &mut stdout)
+    } else {
+        let mut encoder = write::EncoderWriter::new(&mut stdout, &engine);
+        io::copy(&mut input, &mut encoder)
+    };
+    if let Err(e) = r {
+        eprintln!(
+            "Base64 {} failed with {}",
+            if opt.decode { "decode" } else { "encode" },
+            e
+        );
+        process::exit(1);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/base64/icon_CLion.svg 43.0.0-1ubuntu1/rust-vendor/base64/icon_CLion.svg
--- 43.0.0-1/rust-vendor/base64/icon_CLion.svg	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/icon_CLion.svg	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,34 @@
+<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 128 128">
+  <defs>
+    <linearGradient id="linear-gradient" x1="40.69" y1="-676.56" x2="83.48" y2="-676.56" gradientTransform="matrix(1, 0, 0, -1, 0, -648.86)" gradientUnits="userSpaceOnUse">
+      <stop offset="0" stop-color="#ed358c"/>
+      <stop offset="0.16" stop-color="#e9388c"/>
+      <stop offset="0.3" stop-color="#de418c"/>
+      <stop offset="0.43" stop-color="#cc508c"/>
+      <stop offset="0.57" stop-color="#b2658d"/>
+      <stop offset="0.7" stop-color="#90808d"/>
+      <stop offset="0.83" stop-color="#67a18e"/>
+      <stop offset="0.95" stop-color="#37c78f"/>
+      <stop offset="1" stop-color="#22d88f"/>
+    </linearGradient>
+    <linearGradient id="linear-gradient-2" x1="32.58" y1="-665.27" x2="13.76" y2="-791.59" gradientTransform="matrix(1, 0, 0, -1, 0, -648.86)" gradientUnits="userSpaceOnUse">
+      <stop offset="0.09" stop-color="#22d88f"/>
+      <stop offset="0.9" stop-color="#029de0"/>
+    </linearGradient>
+    <linearGradient id="linear-gradient-3" x1="116.68" y1="-660.66" x2="-12.09" y2="-796.66" xlink:href="#linear-gradient-2"/>
+    <linearGradient id="linear-gradient-4" x1="73.35" y1="-739.1" x2="122.29" y2="-746.06" xlink:href="#linear-gradient-2"/>
+  </defs>
+  <title>icon_CLion</title>
+  <g>
+    <polygon points="49.2 51.8 40.6 55.4 48.4 0 77.8 16.2 49.2 51.8" fill="url(#linear-gradient)"/>
+    <polygon points="44.6 76.8 48.8 0 11.8 23.2 0 94 44.6 76.8" fill="url(#linear-gradient-2)"/>
+    <polygon points="125.4 38.4 109 4.8 77.8 16.2 55 41.4 0 94 41.6 124.4 93.6 77.2 125.4 38.4" fill="url(#linear-gradient-3)"/>
+    <polygon points="53.8 54.6 46.6 98.4 75.8 121 107.8 128 128 82.4 53.8 54.6" fill="url(#linear-gradient-4)"/>
+  </g>
+  <g>
+    <rect x="24" y="24" width="80" height="80"/>
+    <rect x="31.6" y="89" width="30" height="5" fill="#fff"/>
+    <path d="M31,51.2h0A16.83,16.83,0,0,1,48.2,34c6.2,0,10,2,13,5.2l-4.6,5.4c-2.6-2.4-5.2-3.8-8.4-3.8-5.6,0-9.6,4.6-9.6,10.4h0c0,5.6,4,10.4,9.6,10.4,3.8,0,6.2-1.6,8.8-3.8l4.6,4.6c-3.4,3.6-7.2,6-13.6,6A17,17,0,0,1,31,51.2" fill="#fff"/>
+    <path d="M66.6,34.4H74v27H88.4v6.2H66.6V34.4Z" fill="#fff"/>
+  </g>
+</svg>
diff -pruN 43.0.0-1/rust-vendor/base64/src/alphabet.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/alphabet.rs
--- 43.0.0-1/rust-vendor/base64/src/alphabet.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/alphabet.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,285 @@
+//! Provides [Alphabet] and constants for alphabets commonly used in the wild.
+
+use crate::PAD_BYTE;
+use core::{convert, fmt};
+#[cfg(any(feature = "std", test))]
+use std::error;
+
+const ALPHABET_SIZE: usize = 64;
+
+/// An alphabet defines the 64 ASCII characters (symbols) used for base64.
+///
+/// Common alphabets are provided as constants, and custom alphabets
+/// can be made via `from_str` or the `TryFrom<str>` implementation.
+///
+/// # Examples
+///
+/// Building and using a custom Alphabet:
+///
+/// ```
+/// let custom = base64::alphabet::Alphabet::new("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").unwrap();
+///
+/// let engine = base64::engine::GeneralPurpose::new(
+///     &custom,
+///     base64::engine::general_purpose::PAD);
+/// ```
+///
+/// Building a const:
+///
+/// ```
+/// use base64::alphabet::Alphabet;
+///
+/// static CUSTOM: Alphabet = {
+///     // Result::unwrap() isn't const yet, but panic!() is OK
+///     match Alphabet::new("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/") {
+///         Ok(x) => x,
+///         Err(_) => panic!("creation of alphabet failed"),
+///     }
+/// };
+/// ```
+///
+/// Building lazily:
+///
+/// ```
+/// use base64::{
+///     alphabet::Alphabet,
+///     engine::{general_purpose::GeneralPurpose, GeneralPurposeConfig},
+/// };
+/// use once_cell::sync::Lazy;
+///
+/// static CUSTOM: Lazy<Alphabet> = Lazy::new(||
+///     Alphabet::new("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").unwrap()
+/// );
+/// ```
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub struct Alphabet {
+    pub(crate) symbols: [u8; ALPHABET_SIZE],
+}
+
+impl Alphabet {
+    /// Performs no checks so that it can be const.
+    /// Used only for known-valid strings.
+    const fn from_str_unchecked(alphabet: &str) -> Self {
+        let mut symbols = [0_u8; ALPHABET_SIZE];
+        let source_bytes = alphabet.as_bytes();
+
+        // a way to copy that's allowed in const fn
+        let mut index = 0;
+        while index < ALPHABET_SIZE {
+            symbols[index] = source_bytes[index];
+            index += 1;
+        }
+
+        Self { symbols }
+    }
+
+    /// Create an `Alphabet` from a string of 64 unique printable ASCII bytes.
+    ///
+    /// The `=` byte is not allowed as it is used for padding.
+    pub const fn new(alphabet: &str) -> Result<Self, ParseAlphabetError> {
+        let bytes = alphabet.as_bytes();
+        if bytes.len() != ALPHABET_SIZE {
+            return Err(ParseAlphabetError::InvalidLength);
+        }
+
+        {
+            let mut index = 0;
+            while index < ALPHABET_SIZE {
+                let byte = bytes[index];
+
+                // must be ascii printable. 127 (DEL) is commonly considered printable
+                // for some reason but clearly unsuitable for base64.
+                if !(byte >= 32_u8 && byte <= 126_u8) {
+                    return Err(ParseAlphabetError::UnprintableByte(byte));
+                }
+                // = is assumed to be padding, so cannot be used as a symbol
+                if byte == PAD_BYTE {
+                    return Err(ParseAlphabetError::ReservedByte(byte));
+                }
+
+                // Check for duplicates while staying within what const allows.
+                // It's n^2, but only over 64 hot bytes, and only once, so it's likely in the single digit
+                // microsecond range.
+
+                let mut probe_index = 0;
+                while probe_index < ALPHABET_SIZE {
+                    if probe_index == index {
+                        probe_index += 1;
+                        continue;
+                    }
+
+                    let probe_byte = bytes[probe_index];
+
+                    if byte == probe_byte {
+                        return Err(ParseAlphabetError::DuplicatedByte(byte));
+                    }
+
+                    probe_index += 1;
+                }
+
+                index += 1;
+            }
+        }
+
+        Ok(Self::from_str_unchecked(alphabet))
+    }
+
+    /// Create a `&str` from the symbols in the `Alphabet`
+    pub fn as_str(&self) -> &str {
+        core::str::from_utf8(&self.symbols).unwrap()
+    }
+}
+
+impl convert::TryFrom<&str> for Alphabet {
+    type Error = ParseAlphabetError;
+
+    fn try_from(value: &str) -> Result<Self, Self::Error> {
+        Self::new(value)
+    }
+}
+
+/// Possible errors when constructing an [Alphabet] from a `str`.
+#[derive(Debug, Eq, PartialEq)]
+pub enum ParseAlphabetError {
+    /// Alphabets must be 64 ASCII bytes
+    InvalidLength,
+    /// All bytes must be unique
+    DuplicatedByte(u8),
+    /// All bytes must be printable (in the range `[32, 126]`).
+    UnprintableByte(u8),
+    /// `=` cannot be used
+    ReservedByte(u8),
+}
+
+impl fmt::Display for ParseAlphabetError {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        match self {
+            Self::InvalidLength => write!(f, "Invalid length - must be 64 bytes"),
+            Self::DuplicatedByte(b) => write!(f, "Duplicated byte: {:#04x}", b),
+            Self::UnprintableByte(b) => write!(f, "Unprintable byte: {:#04x}", b),
+            Self::ReservedByte(b) => write!(f, "Reserved byte: {:#04x}", b),
+        }
+    }
+}
+
+#[cfg(any(feature = "std", test))]
+impl error::Error for ParseAlphabetError {}
+
+/// The standard alphabet (with `+` and `/`) specified in [RFC 4648][].
+///
+/// [RFC 4648]: https://datatracker.ietf.org/doc/html/rfc4648#section-4
+pub const STANDARD: Alphabet = Alphabet::from_str_unchecked(
+    "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
+);
+
+/// The URL-safe alphabet (with `-` and `_`) specified in [RFC 4648][].
+///
+/// [RFC 4648]: https://datatracker.ietf.org/doc/html/rfc4648#section-5
+pub const URL_SAFE: Alphabet = Alphabet::from_str_unchecked(
+    "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
+);
+
+/// The `crypt(3)` alphabet (with `.` and `/` as the _first_ two characters).
+///
+/// Not standardized, but folk wisdom on the net asserts that this alphabet is what crypt uses.
+pub const CRYPT: Alphabet = Alphabet::from_str_unchecked(
+    "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
+);
+
+/// The bcrypt alphabet.
+pub const BCRYPT: Alphabet = Alphabet::from_str_unchecked(
+    "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
+);
+
+/// The alphabet used in IMAP-modified UTF-7 (with `+` and `,`).
+///
+/// See [RFC 3501](https://tools.ietf.org/html/rfc3501#section-5.1.3)
+pub const IMAP_MUTF7: Alphabet = Alphabet::from_str_unchecked(
+    "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,",
+);
+
+/// The alphabet used in BinHex 4.0 files.
+///
+/// See [BinHex 4.0 Definition](http://files.stairways.com/other/binhex-40-specs-info.txt)
+pub const BIN_HEX: Alphabet = Alphabet::from_str_unchecked(
+    "!\"#$%&'()*+,-012345689@ABCDEFGHIJKLMNPQRSTUVXYZ[`abcdefhijklmpqr",
+);
+
+#[cfg(test)]
+mod tests {
+    use crate::alphabet::*;
+    use core::convert::TryFrom as _;
+
+    #[test]
+    fn detects_duplicate_start() {
+        assert_eq!(
+            ParseAlphabetError::DuplicatedByte(b'A'),
+            Alphabet::new("AACDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")
+                .unwrap_err()
+        );
+    }
+
+    #[test]
+    fn detects_duplicate_end() {
+        assert_eq!(
+            ParseAlphabetError::DuplicatedByte(b'/'),
+            Alphabet::new("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789//")
+                .unwrap_err()
+        );
+    }
+
+    #[test]
+    fn detects_duplicate_middle() {
+        assert_eq!(
+            ParseAlphabetError::DuplicatedByte(b'Z'),
+            Alphabet::new("ABCDEFGHIJKLMNOPQRSTUVWXYZZbcdefghijklmnopqrstuvwxyz0123456789+/")
+                .unwrap_err()
+        );
+    }
+
+    #[test]
+    fn detects_length() {
+        assert_eq!(
+            ParseAlphabetError::InvalidLength,
+            Alphabet::new(
+                "xxxxxxxxxABCDEFGHIJKLMNOPQRSTUVWXYZZbcdefghijklmnopqrstuvwxyz0123456789+/",
+            )
+            .unwrap_err()
+        );
+    }
+
+    #[test]
+    fn detects_padding() {
+        assert_eq!(
+            ParseAlphabetError::ReservedByte(b'='),
+            Alphabet::new("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+=")
+                .unwrap_err()
+        );
+    }
+
+    #[test]
+    fn detects_unprintable() {
+        // form feed
+        assert_eq!(
+            ParseAlphabetError::UnprintableByte(0xc),
+            Alphabet::new("\x0cBCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")
+                .unwrap_err()
+        );
+    }
+
+    #[test]
+    fn same_as_unchecked() {
+        assert_eq!(
+            STANDARD,
+            Alphabet::try_from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")
+                .unwrap()
+        );
+    }
+
+    #[test]
+    fn str_same_as_input() {
+        let alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+        let a = Alphabet::try_from(alphabet).unwrap();
+        assert_eq!(alphabet, a.as_str())
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/base64/src/chunked_encoder.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/chunked_encoder.rs
--- 43.0.0-1/rust-vendor/base64/src/chunked_encoder.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/chunked_encoder.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,172 @@
+use crate::{
+    encode::add_padding,
+    engine::{Config, Engine},
+};
+#[cfg(any(feature = "alloc", test))]
+use alloc::string::String;
+#[cfg(any(feature = "alloc", test))]
+use core::str;
+
+/// The output mechanism for ChunkedEncoder's encoded bytes.
+pub trait Sink {
+    type Error;
+
+    /// Handle a chunk of encoded base64 data (as UTF-8 bytes)
+    fn write_encoded_bytes(&mut self, encoded: &[u8]) -> Result<(), Self::Error>;
+}
+
+/// A base64 encoder that emits encoded bytes in chunks without heap allocation.
+pub struct ChunkedEncoder<'e, E: Engine + ?Sized> {
+    engine: &'e E,
+}
+
+impl<'e, E: Engine + ?Sized> ChunkedEncoder<'e, E> {
+    pub fn new(engine: &'e E) -> ChunkedEncoder<'e, E> {
+        ChunkedEncoder { engine }
+    }
+
+    pub fn encode<S: Sink>(&self, bytes: &[u8], sink: &mut S) -> Result<(), S::Error> {
+        const BUF_SIZE: usize = 1024;
+        const CHUNK_SIZE: usize = BUF_SIZE / 4 * 3;
+
+        let mut buf = [0; BUF_SIZE];
+        for chunk in bytes.chunks(CHUNK_SIZE) {
+            let mut len = self.engine.internal_encode(chunk, &mut buf);
+            if chunk.len() != CHUNK_SIZE && self.engine.config().encode_padding() {
+                // Final, potentially partial, chunk.
+                // Only need to consider if padding is needed on a partial chunk since full chunk
+                // is a multiple of 3, which therefore won't be padded.
+                // Pad output to multiple of four bytes if required by config.
+                len += add_padding(len, &mut buf[len..]);
+            }
+            sink.write_encoded_bytes(&buf[..len])?;
+        }
+
+        Ok(())
+    }
+}
+
+// A really simple sink that just appends to a string
+#[cfg(any(feature = "alloc", test))]
+pub(crate) struct StringSink<'a> {
+    string: &'a mut String,
+}
+
+#[cfg(any(feature = "alloc", test))]
+impl<'a> StringSink<'a> {
+    pub(crate) fn new(s: &mut String) -> StringSink {
+        StringSink { string: s }
+    }
+}
+
+#[cfg(any(feature = "alloc", test))]
+impl<'a> Sink for StringSink<'a> {
+    type Error = ();
+
+    fn write_encoded_bytes(&mut self, s: &[u8]) -> Result<(), Self::Error> {
+        self.string.push_str(str::from_utf8(s).unwrap());
+
+        Ok(())
+    }
+}
+
+#[cfg(test)]
+pub mod tests {
+    use rand::{
+        distributions::{Distribution, Uniform},
+        Rng, SeedableRng,
+    };
+
+    use crate::{
+        alphabet::STANDARD,
+        engine::general_purpose::{GeneralPurpose, GeneralPurposeConfig, PAD},
+        tests::random_engine,
+    };
+
+    use super::*;
+
+    #[test]
+    fn chunked_encode_empty() {
+        assert_eq!("", chunked_encode_str(&[], PAD));
+    }
+
+    #[test]
+    fn chunked_encode_intermediate_fast_loop() {
+        // > 8 bytes input, will enter the pretty fast loop
+        assert_eq!("Zm9vYmFyYmF6cXV4", chunked_encode_str(b"foobarbazqux", PAD));
+    }
+
+    #[test]
+    fn chunked_encode_fast_loop() {
+        // > 32 bytes input, will enter the uber fast loop
+        assert_eq!(
+            "Zm9vYmFyYmF6cXV4cXV1eGNvcmdlZ3JhdWx0Z2FycGx5eg==",
+            chunked_encode_str(b"foobarbazquxquuxcorgegraultgarplyz", PAD)
+        );
+    }
+
+    #[test]
+    fn chunked_encode_slow_loop_only() {
+        // < 8 bytes input, slow loop only
+        assert_eq!("Zm9vYmFy", chunked_encode_str(b"foobar", PAD));
+    }
+
+    #[test]
+    fn chunked_encode_matches_normal_encode_random_string_sink() {
+        let helper = StringSinkTestHelper;
+        chunked_encode_matches_normal_encode_random(&helper);
+    }
+
+    pub fn chunked_encode_matches_normal_encode_random<S: SinkTestHelper>(sink_test_helper: &S) {
+        let mut input_buf: Vec<u8> = Vec::new();
+        let mut output_buf = String::new();
+        let mut rng = rand::rngs::SmallRng::from_entropy();
+        let input_len_range = Uniform::new(1, 10_000);
+
+        for _ in 0..20_000 {
+            input_buf.clear();
+            output_buf.clear();
+
+            let buf_len = input_len_range.sample(&mut rng);
+            for _ in 0..buf_len {
+                input_buf.push(rng.gen());
+            }
+
+            let engine = random_engine(&mut rng);
+
+            let chunk_encoded_string = sink_test_helper.encode_to_string(&engine, &input_buf);
+            engine.encode_string(&input_buf, &mut output_buf);
+
+            assert_eq!(output_buf, chunk_encoded_string, "input len={}", buf_len);
+        }
+    }
+
+    fn chunked_encode_str(bytes: &[u8], config: GeneralPurposeConfig) -> String {
+        let mut s = String::new();
+
+        let mut sink = StringSink::new(&mut s);
+        let engine = GeneralPurpose::new(&STANDARD, config);
+        let encoder = ChunkedEncoder::new(&engine);
+        encoder.encode(bytes, &mut sink).unwrap();
+
+        s
+    }
+
+    // An abstraction around sinks so that we can have tests that easily to any sink implementation
+    pub trait SinkTestHelper {
+        fn encode_to_string<E: Engine>(&self, engine: &E, bytes: &[u8]) -> String;
+    }
+
+    struct StringSinkTestHelper;
+
+    impl SinkTestHelper for StringSinkTestHelper {
+        fn encode_to_string<E: Engine>(&self, engine: &E, bytes: &[u8]) -> String {
+            let encoder = ChunkedEncoder::new(engine);
+            let mut s = String::new();
+            let mut sink = StringSink::new(&mut s);
+            encoder.encode(bytes, &mut sink).unwrap();
+
+            s
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/base64/src/decode.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/decode.rs
--- 43.0.0-1/rust-vendor/base64/src/decode.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/decode.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,386 @@
+use crate::engine::{general_purpose::STANDARD, DecodeEstimate, Engine};
+#[cfg(any(feature = "alloc", test))]
+use alloc::vec::Vec;
+use core::fmt;
+#[cfg(any(feature = "std", test))]
+use std::error;
+
+/// Errors that can occur while decoding.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub enum DecodeError {
+    /// An invalid byte was found in the input. The offset and offending byte are provided.
+    ///
+    /// Padding characters (`=`) interspersed in the encoded form are invalid, as they may only
+    /// be present as the last 0-2 bytes of input.
+    ///
+    /// This error may also indicate that extraneous trailing input bytes are present, causing
+    /// otherwise valid padding to no longer be the last bytes of input.
+    InvalidByte(usize, u8),
+    /// The length of the input, as measured in valid base64 symbols, is invalid.
+    /// There must be 2-4 symbols in the last input quad.
+    InvalidLength(usize),
+    /// The last non-padding input symbol's encoded 6 bits have nonzero bits that will be discarded.
+    /// This is indicative of corrupted or truncated Base64.
+    /// Unlike [DecodeError::InvalidByte], which reports symbols that aren't in the alphabet,
+    /// this error is for symbols that are in the alphabet but represent nonsensical encodings.
+    InvalidLastSymbol(usize, u8),
+    /// The nature of the padding was not as configured: absent or incorrect when it must be
+    /// canonical, or present when it must be absent, etc.
+    InvalidPadding,
+}
+
+impl fmt::Display for DecodeError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match *self {
+            Self::InvalidByte(index, byte) => {
+                write!(f, "Invalid symbol {}, offset {}.", byte, index)
+            }
+            Self::InvalidLength(len) => write!(f, "Invalid input length: {}", len),
+            Self::InvalidLastSymbol(index, byte) => {
+                write!(f, "Invalid last symbol {}, offset {}.", byte, index)
+            }
+            Self::InvalidPadding => write!(f, "Invalid padding"),
+        }
+    }
+}
+
+#[cfg(any(feature = "std", test))]
+impl error::Error for DecodeError {}
+
+/// Errors that can occur while decoding into a slice.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub enum DecodeSliceError {
+    /// A [DecodeError] occurred
+    DecodeError(DecodeError),
+    /// The provided slice is too small.
+    OutputSliceTooSmall,
+}
+
+impl fmt::Display for DecodeSliceError {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        match self {
+            Self::DecodeError(e) => write!(f, "DecodeError: {}", e),
+            Self::OutputSliceTooSmall => write!(f, "Output slice too small"),
+        }
+    }
+}
+
+#[cfg(any(feature = "std", test))]
+impl error::Error for DecodeSliceError {
+    fn source(&self) -> Option<&(dyn error::Error + 'static)> {
+        match self {
+            DecodeSliceError::DecodeError(e) => Some(e),
+            DecodeSliceError::OutputSliceTooSmall => None,
+        }
+    }
+}
+
+impl From<DecodeError> for DecodeSliceError {
+    fn from(e: DecodeError) -> Self {
+        DecodeSliceError::DecodeError(e)
+    }
+}
+
+/// Decode base64 using the [`STANDARD` engine](STANDARD).
+///
+/// See [Engine::decode].
+#[deprecated(since = "0.21.0", note = "Use Engine::decode")]
+#[cfg(any(feature = "alloc", test))]
+pub fn decode<T: AsRef<[u8]>>(input: T) -> Result<Vec<u8>, DecodeError> {
+    STANDARD.decode(input)
+}
+
+/// Decode from string reference as octets using the specified [Engine].
+///
+/// See [Engine::decode].
+///Returns a `Result` containing a `Vec<u8>`.
+#[deprecated(since = "0.21.0", note = "Use Engine::decode")]
+#[cfg(any(feature = "alloc", test))]
+pub fn decode_engine<E: Engine, T: AsRef<[u8]>>(
+    input: T,
+    engine: &E,
+) -> Result<Vec<u8>, DecodeError> {
+    engine.decode(input)
+}
+
+/// Decode from string reference as octets.
+///
+/// See [Engine::decode_vec].
+#[cfg(any(feature = "alloc", test))]
+#[deprecated(since = "0.21.0", note = "Use Engine::decode_vec")]
+pub fn decode_engine_vec<E: Engine, T: AsRef<[u8]>>(
+    input: T,
+    buffer: &mut Vec<u8>,
+    engine: &E,
+) -> Result<(), DecodeError> {
+    engine.decode_vec(input, buffer)
+}
+
+/// Decode the input into the provided output slice.
+///
+/// See [Engine::decode_slice].
+#[deprecated(since = "0.21.0", note = "Use Engine::decode_slice")]
+pub fn decode_engine_slice<E: Engine, T: AsRef<[u8]>>(
+    input: T,
+    output: &mut [u8],
+    engine: &E,
+) -> Result<usize, DecodeSliceError> {
+    engine.decode_slice(input, output)
+}
+
+/// Returns a conservative estimate of the decoded size of `encoded_len` base64 symbols (rounded up
+/// to the next group of 3 decoded bytes).
+///
+/// The resulting length will be a safe choice for the size of a decode buffer, but may have up to
+/// 2 trailing bytes that won't end up being needed.
+///
+/// # Examples
+///
+/// ```
+/// use base64::decoded_len_estimate;
+///
+/// assert_eq!(3, decoded_len_estimate(1));
+/// assert_eq!(3, decoded_len_estimate(2));
+/// assert_eq!(3, decoded_len_estimate(3));
+/// assert_eq!(3, decoded_len_estimate(4));
+/// // start of the next quad of encoded symbols
+/// assert_eq!(6, decoded_len_estimate(5));
+/// ```
+pub fn decoded_len_estimate(encoded_len: usize) -> usize {
+    STANDARD
+        .internal_decoded_len_estimate(encoded_len)
+        .decoded_len_estimate()
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::{
+        alphabet,
+        engine::{general_purpose, Config, GeneralPurpose},
+        tests::{assert_encode_sanity, random_engine},
+    };
+    use rand::{
+        distributions::{Distribution, Uniform},
+        Rng, SeedableRng,
+    };
+
+    #[test]
+    fn decode_into_nonempty_vec_doesnt_clobber_existing_prefix() {
+        let mut orig_data = Vec::new();
+        let mut encoded_data = String::new();
+        let mut decoded_with_prefix = Vec::new();
+        let mut decoded_without_prefix = Vec::new();
+        let mut prefix = Vec::new();
+
+        let prefix_len_range = Uniform::new(0, 1000);
+        let input_len_range = Uniform::new(0, 1000);
+
+        let mut rng = rand::rngs::SmallRng::from_entropy();
+
+        for _ in 0..10_000 {
+            orig_data.clear();
+            encoded_data.clear();
+            decoded_with_prefix.clear();
+            decoded_without_prefix.clear();
+            prefix.clear();
+
+            let input_len = input_len_range.sample(&mut rng);
+
+            for _ in 0..input_len {
+                orig_data.push(rng.gen());
+            }
+
+            let engine = random_engine(&mut rng);
+            engine.encode_string(&orig_data, &mut encoded_data);
+            assert_encode_sanity(&encoded_data, engine.config().encode_padding(), input_len);
+
+            let prefix_len = prefix_len_range.sample(&mut rng);
+
+            // fill the buf with a prefix
+            for _ in 0..prefix_len {
+                prefix.push(rng.gen());
+            }
+
+            decoded_with_prefix.resize(prefix_len, 0);
+            decoded_with_prefix.copy_from_slice(&prefix);
+
+            // decode into the non-empty buf
+            engine
+                .decode_vec(&encoded_data, &mut decoded_with_prefix)
+                .unwrap();
+            // also decode into the empty buf
+            engine
+                .decode_vec(&encoded_data, &mut decoded_without_prefix)
+                .unwrap();
+
+            assert_eq!(
+                prefix_len + decoded_without_prefix.len(),
+                decoded_with_prefix.len()
+            );
+            assert_eq!(orig_data, decoded_without_prefix);
+
+            // append plain decode onto prefix
+            prefix.append(&mut decoded_without_prefix);
+
+            assert_eq!(prefix, decoded_with_prefix);
+        }
+    }
+
+    #[test]
+    fn decode_slice_doesnt_clobber_existing_prefix_or_suffix() {
+        do_decode_slice_doesnt_clobber_existing_prefix_or_suffix(|e, input, output| {
+            e.decode_slice(input, output).unwrap()
+        })
+    }
+
+    #[test]
+    fn decode_slice_unchecked_doesnt_clobber_existing_prefix_or_suffix() {
+        do_decode_slice_doesnt_clobber_existing_prefix_or_suffix(|e, input, output| {
+            e.decode_slice_unchecked(input, output).unwrap()
+        })
+    }
+
+    #[test]
+    fn decode_engine_estimation_works_for_various_lengths() {
+        let engine = GeneralPurpose::new(&alphabet::STANDARD, general_purpose::NO_PAD);
+        for num_prefix_quads in 0..100 {
+            for suffix in &["AA", "AAA", "AAAA"] {
+                let mut prefix = "AAAA".repeat(num_prefix_quads);
+                prefix.push_str(suffix);
+                // make sure no overflow (and thus a panic) occurs
+                let res = engine.decode(prefix);
+                assert!(res.is_ok());
+            }
+        }
+    }
+
+    #[test]
+    fn decode_slice_output_length_errors() {
+        for num_quads in 1..100 {
+            let input = "AAAA".repeat(num_quads);
+            let mut vec = vec![0; (num_quads - 1) * 3];
+            assert_eq!(
+                DecodeSliceError::OutputSliceTooSmall,
+                STANDARD.decode_slice(&input, &mut vec).unwrap_err()
+            );
+            vec.push(0);
+            assert_eq!(
+                DecodeSliceError::OutputSliceTooSmall,
+                STANDARD.decode_slice(&input, &mut vec).unwrap_err()
+            );
+            vec.push(0);
+            assert_eq!(
+                DecodeSliceError::OutputSliceTooSmall,
+                STANDARD.decode_slice(&input, &mut vec).unwrap_err()
+            );
+            vec.push(0);
+            // now it works
+            assert_eq!(
+                num_quads * 3,
+                STANDARD.decode_slice(&input, &mut vec).unwrap()
+            );
+        }
+    }
+
+    fn do_decode_slice_doesnt_clobber_existing_prefix_or_suffix<
+        F: Fn(&GeneralPurpose, &[u8], &mut [u8]) -> usize,
+    >(
+        call_decode: F,
+    ) {
+        let mut orig_data = Vec::new();
+        let mut encoded_data = String::new();
+        let mut decode_buf = Vec::new();
+        let mut decode_buf_copy: Vec<u8> = Vec::new();
+
+        let input_len_range = Uniform::new(0, 1000);
+
+        let mut rng = rand::rngs::SmallRng::from_entropy();
+
+        for _ in 0..10_000 {
+            orig_data.clear();
+            encoded_data.clear();
+            decode_buf.clear();
+            decode_buf_copy.clear();
+
+            let input_len = input_len_range.sample(&mut rng);
+
+            for _ in 0..input_len {
+                orig_data.push(rng.gen());
+            }
+
+            let engine = random_engine(&mut rng);
+            engine.encode_string(&orig_data, &mut encoded_data);
+            assert_encode_sanity(&encoded_data, engine.config().encode_padding(), input_len);
+
+            // fill the buffer with random garbage, long enough to have some room before and after
+            for _ in 0..5000 {
+                decode_buf.push(rng.gen());
+            }
+
+            // keep a copy for later comparison
+            decode_buf_copy.extend(decode_buf.iter());
+
+            let offset = 1000;
+
+            // decode into the non-empty buf
+            let decode_bytes_written =
+                call_decode(&engine, encoded_data.as_bytes(), &mut decode_buf[offset..]);
+
+            assert_eq!(orig_data.len(), decode_bytes_written);
+            assert_eq!(
+                orig_data,
+                &decode_buf[offset..(offset + decode_bytes_written)]
+            );
+            assert_eq!(&decode_buf_copy[0..offset], &decode_buf[0..offset]);
+            assert_eq!(
+                &decode_buf_copy[offset + decode_bytes_written..],
+                &decode_buf[offset + decode_bytes_written..]
+            );
+        }
+    }
+}
+
+#[allow(deprecated)]
+#[cfg(test)]
+mod coverage_gaming {
+    use super::*;
+    use std::error::Error;
+
+    #[test]
+    fn decode_error() {
+        let _ = format!("{:?}", DecodeError::InvalidPadding.clone());
+        let _ = format!(
+            "{} {} {} {}",
+            DecodeError::InvalidByte(0, 0),
+            DecodeError::InvalidLength(0),
+            DecodeError::InvalidLastSymbol(0, 0),
+            DecodeError::InvalidPadding,
+        );
+    }
+
+    #[test]
+    fn decode_slice_error() {
+        let _ = format!("{:?}", DecodeSliceError::OutputSliceTooSmall.clone());
+        let _ = format!(
+            "{} {}",
+            DecodeSliceError::OutputSliceTooSmall,
+            DecodeSliceError::DecodeError(DecodeError::InvalidPadding)
+        );
+        let _ = DecodeSliceError::OutputSliceTooSmall.source();
+        let _ = DecodeSliceError::DecodeError(DecodeError::InvalidPadding).source();
+    }
+
+    #[test]
+    fn deprecated_fns() {
+        let _ = decode("");
+        let _ = decode_engine("", &crate::prelude::BASE64_STANDARD);
+        let _ = decode_engine_vec("", &mut Vec::new(), &crate::prelude::BASE64_STANDARD);
+        let _ = decode_engine_slice("", &mut [], &crate::prelude::BASE64_STANDARD);
+    }
+
+    #[test]
+    fn decoded_len_est() {
+        assert_eq!(3, decoded_len_estimate(4));
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/base64/src/display.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/display.rs
--- 43.0.0-1/rust-vendor/base64/src/display.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/display.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,88 @@
+//! Enables base64'd output anywhere you might use a `Display` implementation, like a format string.
+//!
+//! ```
+//! use base64::{display::Base64Display, engine::general_purpose::STANDARD};
+//!
+//! let data = vec![0x0, 0x1, 0x2, 0x3];
+//! let wrapper = Base64Display::new(&data, &STANDARD);
+//!
+//! assert_eq!("base64: AAECAw==", format!("base64: {}", wrapper));
+//! ```
+
+use super::chunked_encoder::ChunkedEncoder;
+use crate::engine::Engine;
+use core::fmt::{Display, Formatter};
+use core::{fmt, str};
+
+/// A convenience wrapper for base64'ing bytes into a format string without heap allocation.
+pub struct Base64Display<'a, 'e, E: Engine> {
+    bytes: &'a [u8],
+    chunked_encoder: ChunkedEncoder<'e, E>,
+}
+
+impl<'a, 'e, E: Engine> Base64Display<'a, 'e, E> {
+    /// Create a `Base64Display` with the provided engine.
+    pub fn new(bytes: &'a [u8], engine: &'e E) -> Base64Display<'a, 'e, E> {
+        Base64Display {
+            bytes,
+            chunked_encoder: ChunkedEncoder::new(engine),
+        }
+    }
+}
+
+impl<'a, 'e, E: Engine> Display for Base64Display<'a, 'e, E> {
+    fn fmt(&self, formatter: &mut Formatter) -> Result<(), fmt::Error> {
+        let mut sink = FormatterSink { f: formatter };
+        self.chunked_encoder.encode(self.bytes, &mut sink)
+    }
+}
+
+struct FormatterSink<'a, 'b: 'a> {
+    f: &'a mut Formatter<'b>,
+}
+
+impl<'a, 'b: 'a> super::chunked_encoder::Sink for FormatterSink<'a, 'b> {
+    type Error = fmt::Error;
+
+    fn write_encoded_bytes(&mut self, encoded: &[u8]) -> Result<(), Self::Error> {
+        // Avoid unsafe. If max performance is needed, write your own display wrapper that uses
+        // unsafe here to gain about 10-15%.
+        self.f
+            .write_str(str::from_utf8(encoded).expect("base64 data was not utf8"))
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::super::chunked_encoder::tests::{
+        chunked_encode_matches_normal_encode_random, SinkTestHelper,
+    };
+    use super::*;
+    use crate::engine::general_purpose::STANDARD;
+
+    #[test]
+    fn basic_display() {
+        assert_eq!(
+            "~$Zm9vYmFy#*",
+            format!("~${}#*", Base64Display::new(b"foobar", &STANDARD))
+        );
+        assert_eq!(
+            "~$Zm9vYmFyZg==#*",
+            format!("~${}#*", Base64Display::new(b"foobarf", &STANDARD))
+        );
+    }
+
+    #[test]
+    fn display_encode_matches_normal_encode() {
+        let helper = DisplaySinkTestHelper;
+        chunked_encode_matches_normal_encode_random(&helper);
+    }
+
+    struct DisplaySinkTestHelper;
+
+    impl SinkTestHelper for DisplaySinkTestHelper {
+        fn encode_to_string<E: Engine>(&self, engine: &E, bytes: &[u8]) -> String {
+            format!("{}", Base64Display::new(bytes, engine))
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/base64/src/encode.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/encode.rs
--- 43.0.0-1/rust-vendor/base64/src/encode.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/encode.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,492 @@
+#[cfg(any(feature = "alloc", test))]
+use alloc::string::String;
+use core::fmt;
+#[cfg(any(feature = "std", test))]
+use std::error;
+
+#[cfg(any(feature = "alloc", test))]
+use crate::engine::general_purpose::STANDARD;
+use crate::engine::{Config, Engine};
+use crate::PAD_BYTE;
+
+/// Encode arbitrary octets as base64 using the [`STANDARD` engine](STANDARD).
+///
+/// See [Engine::encode].
+#[allow(unused)]
+#[deprecated(since = "0.21.0", note = "Use Engine::encode")]
+#[cfg(any(feature = "alloc", test))]
+pub fn encode<T: AsRef<[u8]>>(input: T) -> String {
+    STANDARD.encode(input)
+}
+
+///Encode arbitrary octets as base64 using the provided `Engine` into a new `String`.
+///
+/// See [Engine::encode].
+#[allow(unused)]
+#[deprecated(since = "0.21.0", note = "Use Engine::encode")]
+#[cfg(any(feature = "alloc", test))]
+pub fn encode_engine<E: Engine, T: AsRef<[u8]>>(input: T, engine: &E) -> String {
+    engine.encode(input)
+}
+
+///Encode arbitrary octets as base64 into a supplied `String`.
+///
+/// See [Engine::encode_string].
+#[allow(unused)]
+#[deprecated(since = "0.21.0", note = "Use Engine::encode_string")]
+#[cfg(any(feature = "alloc", test))]
+pub fn encode_engine_string<E: Engine, T: AsRef<[u8]>>(
+    input: T,
+    output_buf: &mut String,
+    engine: &E,
+) {
+    engine.encode_string(input, output_buf)
+}
+
+/// Encode arbitrary octets as base64 into a supplied slice.
+///
+/// See [Engine::encode_slice].
+#[allow(unused)]
+#[deprecated(since = "0.21.0", note = "Use Engine::encode_slice")]
+pub fn encode_engine_slice<E: Engine, T: AsRef<[u8]>>(
+    input: T,
+    output_buf: &mut [u8],
+    engine: &E,
+) -> Result<usize, EncodeSliceError> {
+    engine.encode_slice(input, output_buf)
+}
+
+/// B64-encode and pad (if configured).
+///
+/// This helper exists to avoid recalculating encoded_size, which is relatively expensive on short
+/// inputs.
+///
+/// `encoded_size` is the encoded size calculated for `input`.
+///
+/// `output` must be of size `encoded_size`.
+///
+/// All bytes in `output` will be written to since it is exactly the size of the output.
+pub(crate) fn encode_with_padding<E: Engine + ?Sized>(
+    input: &[u8],
+    output: &mut [u8],
+    engine: &E,
+    expected_encoded_size: usize,
+) {
+    debug_assert_eq!(expected_encoded_size, output.len());
+
+    let b64_bytes_written = engine.internal_encode(input, output);
+
+    let padding_bytes = if engine.config().encode_padding() {
+        add_padding(b64_bytes_written, &mut output[b64_bytes_written..])
+    } else {
+        0
+    };
+
+    let encoded_bytes = b64_bytes_written
+        .checked_add(padding_bytes)
+        .expect("usize overflow when calculating b64 length");
+
+    debug_assert_eq!(expected_encoded_size, encoded_bytes);
+}
+
+/// Calculate the base64 encoded length for a given input length, optionally including any
+/// appropriate padding bytes.
+///
+/// Returns `None` if the encoded length can't be represented in `usize`. This will happen for
+/// input lengths in approximately the top quarter of the range of `usize`.
+pub const fn encoded_len(bytes_len: usize, padding: bool) -> Option<usize> {
+    let rem = bytes_len % 3;
+
+    let complete_input_chunks = bytes_len / 3;
+    // `?` is disallowed in const, and `let Some(_) = _ else` requires 1.65.0, whereas this
+    // messier syntax works on 1.48
+    let complete_chunk_output =
+        if let Some(complete_chunk_output) = complete_input_chunks.checked_mul(4) {
+            complete_chunk_output
+        } else {
+            return None;
+        };
+
+    if rem > 0 {
+        if padding {
+            complete_chunk_output.checked_add(4)
+        } else {
+            let encoded_rem = match rem {
+                1 => 2,
+                // only other possible remainder is 2
+                // can't use a separate _ => unreachable!() in const fns in ancient rust versions
+                _ => 3,
+            };
+            complete_chunk_output.checked_add(encoded_rem)
+        }
+    } else {
+        Some(complete_chunk_output)
+    }
+}
+
+/// Write padding characters.
+/// `unpadded_output_len` is the size of the unpadded but base64 encoded data.
+/// `output` is the slice where padding should be written, of length at least 2.
+///
+/// Returns the number of padding bytes written.
+pub(crate) fn add_padding(unpadded_output_len: usize, output: &mut [u8]) -> usize {
+    let pad_bytes = (4 - (unpadded_output_len % 4)) % 4;
+    // for just a couple bytes, this has better performance than using
+    // .fill(), or iterating over mutable refs, which call memset()
+    #[allow(clippy::needless_range_loop)]
+    for i in 0..pad_bytes {
+        output[i] = PAD_BYTE;
+    }
+
+    pad_bytes
+}
+
+/// Errors that can occur while encoding into a slice.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub enum EncodeSliceError {
+    /// The provided slice is too small.
+    OutputSliceTooSmall,
+}
+
+impl fmt::Display for EncodeSliceError {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        match self {
+            Self::OutputSliceTooSmall => write!(f, "Output slice too small"),
+        }
+    }
+}
+
+#[cfg(any(feature = "std", test))]
+impl error::Error for EncodeSliceError {}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    use crate::{
+        alphabet,
+        engine::general_purpose::{GeneralPurpose, NO_PAD, STANDARD},
+        tests::{assert_encode_sanity, random_config, random_engine},
+    };
+    use rand::{
+        distributions::{Distribution, Uniform},
+        Rng, SeedableRng,
+    };
+    use std::str;
+
+    const URL_SAFE_NO_PAD_ENGINE: GeneralPurpose = GeneralPurpose::new(&alphabet::URL_SAFE, NO_PAD);
+
+    #[test]
+    fn encoded_size_correct_standard() {
+        assert_encoded_length(0, 0, &STANDARD, true);
+
+        assert_encoded_length(1, 4, &STANDARD, true);
+        assert_encoded_length(2, 4, &STANDARD, true);
+        assert_encoded_length(3, 4, &STANDARD, true);
+
+        assert_encoded_length(4, 8, &STANDARD, true);
+        assert_encoded_length(5, 8, &STANDARD, true);
+        assert_encoded_length(6, 8, &STANDARD, true);
+
+        assert_encoded_length(7, 12, &STANDARD, true);
+        assert_encoded_length(8, 12, &STANDARD, true);
+        assert_encoded_length(9, 12, &STANDARD, true);
+
+        assert_encoded_length(54, 72, &STANDARD, true);
+
+        assert_encoded_length(55, 76, &STANDARD, true);
+        assert_encoded_length(56, 76, &STANDARD, true);
+        assert_encoded_length(57, 76, &STANDARD, true);
+
+        assert_encoded_length(58, 80, &STANDARD, true);
+    }
+
+    #[test]
+    fn encoded_size_correct_no_pad() {
+        assert_encoded_length(0, 0, &URL_SAFE_NO_PAD_ENGINE, false);
+
+        assert_encoded_length(1, 2, &URL_SAFE_NO_PAD_ENGINE, false);
+        assert_encoded_length(2, 3, &URL_SAFE_NO_PAD_ENGINE, false);
+        assert_encoded_length(3, 4, &URL_SAFE_NO_PAD_ENGINE, false);
+
+        assert_encoded_length(4, 6, &URL_SAFE_NO_PAD_ENGINE, false);
+        assert_encoded_length(5, 7, &URL_SAFE_NO_PAD_ENGINE, false);
+        assert_encoded_length(6, 8, &URL_SAFE_NO_PAD_ENGINE, false);
+
+        assert_encoded_length(7, 10, &URL_SAFE_NO_PAD_ENGINE, false);
+        assert_encoded_length(8, 11, &URL_SAFE_NO_PAD_ENGINE, false);
+        assert_encoded_length(9, 12, &URL_SAFE_NO_PAD_ENGINE, false);
+
+        assert_encoded_length(54, 72, &URL_SAFE_NO_PAD_ENGINE, false);
+
+        assert_encoded_length(55, 74, &URL_SAFE_NO_PAD_ENGINE, false);
+        assert_encoded_length(56, 75, &URL_SAFE_NO_PAD_ENGINE, false);
+        assert_encoded_length(57, 76, &URL_SAFE_NO_PAD_ENGINE, false);
+
+        assert_encoded_length(58, 78, &URL_SAFE_NO_PAD_ENGINE, false);
+    }
+
+    #[test]
+    fn encoded_size_overflow() {
+        assert_eq!(None, encoded_len(usize::MAX, true));
+    }
+
+    #[test]
+    fn encode_engine_string_into_nonempty_buffer_doesnt_clobber_prefix() {
+        let mut orig_data = Vec::new();
+        let mut prefix = String::new();
+        let mut encoded_data_no_prefix = String::new();
+        let mut encoded_data_with_prefix = String::new();
+        let mut decoded = Vec::new();
+
+        let prefix_len_range = Uniform::new(0, 1000);
+        let input_len_range = Uniform::new(0, 1000);
+
+        let mut rng = rand::rngs::SmallRng::from_entropy();
+
+        for _ in 0..10_000 {
+            orig_data.clear();
+            prefix.clear();
+            encoded_data_no_prefix.clear();
+            encoded_data_with_prefix.clear();
+            decoded.clear();
+
+            let input_len = input_len_range.sample(&mut rng);
+
+            for _ in 0..input_len {
+                orig_data.push(rng.gen());
+            }
+
+            let prefix_len = prefix_len_range.sample(&mut rng);
+            for _ in 0..prefix_len {
+                // getting convenient random single-byte printable chars that aren't base64 is
+                // annoying
+                prefix.push('#');
+            }
+            encoded_data_with_prefix.push_str(&prefix);
+
+            let engine = random_engine(&mut rng);
+            engine.encode_string(&orig_data, &mut encoded_data_no_prefix);
+            engine.encode_string(&orig_data, &mut encoded_data_with_prefix);
+
+            assert_eq!(
+                encoded_data_no_prefix.len() + prefix_len,
+                encoded_data_with_prefix.len()
+            );
+            assert_encode_sanity(
+                &encoded_data_no_prefix,
+                engine.config().encode_padding(),
+                input_len,
+            );
+            assert_encode_sanity(
+                &encoded_data_with_prefix[prefix_len..],
+                engine.config().encode_padding(),
+                input_len,
+            );
+
+            // append plain encode onto prefix
+            prefix.push_str(&encoded_data_no_prefix);
+
+            assert_eq!(prefix, encoded_data_with_prefix);
+
+            engine
+                .decode_vec(&encoded_data_no_prefix, &mut decoded)
+                .unwrap();
+            assert_eq!(orig_data, decoded);
+        }
+    }
+
+    #[test]
+    fn encode_engine_slice_into_nonempty_buffer_doesnt_clobber_suffix() {
+        let mut orig_data = Vec::new();
+        let mut encoded_data = Vec::new();
+        let mut encoded_data_original_state = Vec::new();
+        let mut decoded = Vec::new();
+
+        let input_len_range = Uniform::new(0, 1000);
+
+        let mut rng = rand::rngs::SmallRng::from_entropy();
+
+        for _ in 0..10_000 {
+            orig_data.clear();
+            encoded_data.clear();
+            encoded_data_original_state.clear();
+            decoded.clear();
+
+            let input_len = input_len_range.sample(&mut rng);
+
+            for _ in 0..input_len {
+                orig_data.push(rng.gen());
+            }
+
+            // plenty of existing garbage in the encoded buffer
+            for _ in 0..10 * input_len {
+                encoded_data.push(rng.gen());
+            }
+
+            encoded_data_original_state.extend_from_slice(&encoded_data);
+
+            let engine = random_engine(&mut rng);
+
+            let encoded_size = encoded_len(input_len, engine.config().encode_padding()).unwrap();
+
+            assert_eq!(
+                encoded_size,
+                engine.encode_slice(&orig_data, &mut encoded_data).unwrap()
+            );
+
+            assert_encode_sanity(
+                str::from_utf8(&encoded_data[0..encoded_size]).unwrap(),
+                engine.config().encode_padding(),
+                input_len,
+            );
+
+            assert_eq!(
+                &encoded_data[encoded_size..],
+                &encoded_data_original_state[encoded_size..]
+            );
+
+            engine
+                .decode_vec(&encoded_data[0..encoded_size], &mut decoded)
+                .unwrap();
+            assert_eq!(orig_data, decoded);
+        }
+    }
+
+    #[test]
+    fn encode_to_slice_random_valid_utf8() {
+        let mut input = Vec::new();
+        let mut output = Vec::new();
+
+        let input_len_range = Uniform::new(0, 1000);
+
+        let mut rng = rand::rngs::SmallRng::from_entropy();
+
+        for _ in 0..10_000 {
+            input.clear();
+            output.clear();
+
+            let input_len = input_len_range.sample(&mut rng);
+
+            for _ in 0..input_len {
+                input.push(rng.gen());
+            }
+
+            let config = random_config(&mut rng);
+            let engine = random_engine(&mut rng);
+
+            // fill up the output buffer with garbage
+            let encoded_size = encoded_len(input_len, config.encode_padding()).unwrap();
+            for _ in 0..encoded_size {
+                output.push(rng.gen());
+            }
+
+            let orig_output_buf = output.clone();
+
+            let bytes_written = engine.internal_encode(&input, &mut output);
+
+            // make sure the part beyond bytes_written is the same garbage it was before
+            assert_eq!(orig_output_buf[bytes_written..], output[bytes_written..]);
+
+            // make sure the encoded bytes are UTF-8
+            let _ = str::from_utf8(&output[0..bytes_written]).unwrap();
+        }
+    }
+
+    #[test]
+    fn encode_with_padding_random_valid_utf8() {
+        let mut input = Vec::new();
+        let mut output = Vec::new();
+
+        let input_len_range = Uniform::new(0, 1000);
+
+        let mut rng = rand::rngs::SmallRng::from_entropy();
+
+        for _ in 0..10_000 {
+            input.clear();
+            output.clear();
+
+            let input_len = input_len_range.sample(&mut rng);
+
+            for _ in 0..input_len {
+                input.push(rng.gen());
+            }
+
+            let engine = random_engine(&mut rng);
+
+            // fill up the output buffer with garbage
+            let encoded_size = encoded_len(input_len, engine.config().encode_padding()).unwrap();
+            for _ in 0..encoded_size + 1000 {
+                output.push(rng.gen());
+            }
+
+            let orig_output_buf = output.clone();
+
+            encode_with_padding(&input, &mut output[0..encoded_size], &engine, encoded_size);
+
+            // make sure the part beyond b64 is the same garbage it was before
+            assert_eq!(orig_output_buf[encoded_size..], output[encoded_size..]);
+
+            // make sure the encoded bytes are UTF-8
+            let _ = str::from_utf8(&output[0..encoded_size]).unwrap();
+        }
+    }
+
+    #[test]
+    fn add_padding_random_valid_utf8() {
+        let mut output = Vec::new();
+
+        let mut rng = rand::rngs::SmallRng::from_entropy();
+
+        // cover our bases for length % 4
+        for unpadded_output_len in 0..20 {
+            output.clear();
+
+            // fill output with random
+            for _ in 0..100 {
+                output.push(rng.gen());
+            }
+
+            let orig_output_buf = output.clone();
+
+            let bytes_written = add_padding(unpadded_output_len, &mut output);
+
+            // make sure the part beyond bytes_written is the same garbage it was before
+            assert_eq!(orig_output_buf[bytes_written..], output[bytes_written..]);
+
+            // make sure the encoded bytes are UTF-8
+            let _ = str::from_utf8(&output[0..bytes_written]).unwrap();
+        }
+    }
+
+    fn assert_encoded_length<E: Engine>(
+        input_len: usize,
+        enc_len: usize,
+        engine: &E,
+        padded: bool,
+    ) {
+        assert_eq!(enc_len, encoded_len(input_len, padded).unwrap());
+
+        let mut bytes: Vec<u8> = Vec::new();
+        let mut rng = rand::rngs::SmallRng::from_entropy();
+
+        for _ in 0..input_len {
+            bytes.push(rng.gen());
+        }
+
+        let encoded = engine.encode(&bytes);
+        assert_encode_sanity(&encoded, padded, input_len);
+
+        assert_eq!(enc_len, encoded.len());
+    }
+
+    #[test]
+    fn encode_imap() {
+        assert_eq!(
+            &GeneralPurpose::new(&alphabet::IMAP_MUTF7, NO_PAD).encode(b"\xFB\xFF"),
+            &GeneralPurpose::new(&alphabet::STANDARD, NO_PAD)
+                .encode(b"\xFB\xFF")
+                .replace('/', ",")
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/base64/src/engine/general_purpose/decode.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/engine/general_purpose/decode.rs
--- 43.0.0-1/rust-vendor/base64/src/engine/general_purpose/decode.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/engine/general_purpose/decode.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,357 @@
+use crate::{
+    engine::{general_purpose::INVALID_VALUE, DecodeEstimate, DecodeMetadata, DecodePaddingMode},
+    DecodeError, DecodeSliceError, PAD_BYTE,
+};
+
+#[doc(hidden)]
+pub struct GeneralPurposeEstimate {
+    /// input len % 4
+    rem: usize,
+    conservative_decoded_len: usize,
+}
+
+impl GeneralPurposeEstimate {
+    pub(crate) fn new(encoded_len: usize) -> Self {
+        let rem = encoded_len % 4;
+        Self {
+            rem,
+            conservative_decoded_len: (encoded_len / 4 + (rem > 0) as usize) * 3,
+        }
+    }
+}
+
+impl DecodeEstimate for GeneralPurposeEstimate {
+    fn decoded_len_estimate(&self) -> usize {
+        self.conservative_decoded_len
+    }
+}
+
+/// Helper to avoid duplicating num_chunks calculation, which is costly on short inputs.
+/// Returns the decode metadata, or an error.
+// We're on the fragile edge of compiler heuristics here. If this is not inlined, slow. If this is
+// inlined(always), a different slow. plain ol' inline makes the benchmarks happiest at the moment,
+// but this is fragile and the best setting changes with only minor code modifications.
+#[inline]
+pub(crate) fn decode_helper(
+    input: &[u8],
+    estimate: GeneralPurposeEstimate,
+    output: &mut [u8],
+    decode_table: &[u8; 256],
+    decode_allow_trailing_bits: bool,
+    padding_mode: DecodePaddingMode,
+) -> Result<DecodeMetadata, DecodeSliceError> {
+    let input_complete_nonterminal_quads_len =
+        complete_quads_len(input, estimate.rem, output.len(), decode_table)?;
+
+    const UNROLLED_INPUT_CHUNK_SIZE: usize = 32;
+    const UNROLLED_OUTPUT_CHUNK_SIZE: usize = UNROLLED_INPUT_CHUNK_SIZE / 4 * 3;
+
+    let input_complete_quads_after_unrolled_chunks_len =
+        input_complete_nonterminal_quads_len % UNROLLED_INPUT_CHUNK_SIZE;
+
+    let input_unrolled_loop_len =
+        input_complete_nonterminal_quads_len - input_complete_quads_after_unrolled_chunks_len;
+
+    // chunks of 32 bytes
+    for (chunk_index, chunk) in input[..input_unrolled_loop_len]
+        .chunks_exact(UNROLLED_INPUT_CHUNK_SIZE)
+        .enumerate()
+    {
+        let input_index = chunk_index * UNROLLED_INPUT_CHUNK_SIZE;
+        let chunk_output = &mut output[chunk_index * UNROLLED_OUTPUT_CHUNK_SIZE
+            ..(chunk_index + 1) * UNROLLED_OUTPUT_CHUNK_SIZE];
+
+        decode_chunk_8(
+            &chunk[0..8],
+            input_index,
+            decode_table,
+            &mut chunk_output[0..6],
+        )?;
+        decode_chunk_8(
+            &chunk[8..16],
+            input_index + 8,
+            decode_table,
+            &mut chunk_output[6..12],
+        )?;
+        decode_chunk_8(
+            &chunk[16..24],
+            input_index + 16,
+            decode_table,
+            &mut chunk_output[12..18],
+        )?;
+        decode_chunk_8(
+            &chunk[24..32],
+            input_index + 24,
+            decode_table,
+            &mut chunk_output[18..24],
+        )?;
+    }
+
+    // remaining quads, except for the last possibly partial one, as it may have padding
+    let output_unrolled_loop_len = input_unrolled_loop_len / 4 * 3;
+    let output_complete_quad_len = input_complete_nonterminal_quads_len / 4 * 3;
+    {
+        let output_after_unroll = &mut output[output_unrolled_loop_len..output_complete_quad_len];
+
+        for (chunk_index, chunk) in input
+            [input_unrolled_loop_len..input_complete_nonterminal_quads_len]
+            .chunks_exact(4)
+            .enumerate()
+        {
+            let chunk_output = &mut output_after_unroll[chunk_index * 3..chunk_index * 3 + 3];
+
+            decode_chunk_4(
+                chunk,
+                input_unrolled_loop_len + chunk_index * 4,
+                decode_table,
+                chunk_output,
+            )?;
+        }
+    }
+
+    super::decode_suffix::decode_suffix(
+        input,
+        input_complete_nonterminal_quads_len,
+        output,
+        output_complete_quad_len,
+        decode_table,
+        decode_allow_trailing_bits,
+        padding_mode,
+    )
+}
+
+/// Returns the length of complete quads, except for the last one, even if it is complete.
+///
+/// Returns an error if the output len is not big enough for decoding those complete quads, or if
+/// the input % 4 == 1, and that last byte is an invalid value other than a pad byte.
+///
+/// - `input` is the base64 input
+/// - `input_len_rem` is input len % 4
+/// - `output_len` is the length of the output slice
+pub(crate) fn complete_quads_len(
+    input: &[u8],
+    input_len_rem: usize,
+    output_len: usize,
+    decode_table: &[u8; 256],
+) -> Result<usize, DecodeSliceError> {
+    debug_assert!(input.len() % 4 == input_len_rem);
+
+    // detect a trailing invalid byte, like a newline, as a user convenience
+    if input_len_rem == 1 {
+        let last_byte = input[input.len() - 1];
+        // exclude pad bytes; might be part of padding that extends from earlier in the input
+        if last_byte != PAD_BYTE && decode_table[usize::from(last_byte)] == INVALID_VALUE {
+            return Err(DecodeError::InvalidByte(input.len() - 1, last_byte).into());
+        }
+    };
+
+    // skip last quad, even if it's complete, as it may have padding
+    let input_complete_nonterminal_quads_len = input
+        .len()
+        .saturating_sub(input_len_rem)
+        // if rem was 0, subtract 4 to avoid padding
+        .saturating_sub((input_len_rem == 0) as usize * 4);
+    debug_assert!(
+        input.is_empty() || (1..=4).contains(&(input.len() - input_complete_nonterminal_quads_len))
+    );
+
+    // check that everything except the last quad handled by decode_suffix will fit
+    if output_len < input_complete_nonterminal_quads_len / 4 * 3 {
+        return Err(DecodeSliceError::OutputSliceTooSmall);
+    };
+    Ok(input_complete_nonterminal_quads_len)
+}
+
+/// Decode 8 bytes of input into 6 bytes of output.
+///
+/// `input` is the 8 bytes to decode.
+/// `index_at_start_of_input` is the offset in the overall input (used for reporting errors
+/// accurately)
+/// `decode_table` is the lookup table for the particular base64 alphabet.
+/// `output` will have its first 6 bytes overwritten
+// yes, really inline (worth 30-50% speedup)
+#[inline(always)]
+fn decode_chunk_8(
+    input: &[u8],
+    index_at_start_of_input: usize,
+    decode_table: &[u8; 256],
+    output: &mut [u8],
+) -> Result<(), DecodeError> {
+    let morsel = decode_table[usize::from(input[0])];
+    if morsel == INVALID_VALUE {
+        return Err(DecodeError::InvalidByte(index_at_start_of_input, input[0]));
+    }
+    let mut accum = u64::from(morsel) << 58;
+
+    let morsel = decode_table[usize::from(input[1])];
+    if morsel == INVALID_VALUE {
+        return Err(DecodeError::InvalidByte(
+            index_at_start_of_input + 1,
+            input[1],
+        ));
+    }
+    accum |= u64::from(morsel) << 52;
+
+    let morsel = decode_table[usize::from(input[2])];
+    if morsel == INVALID_VALUE {
+        return Err(DecodeError::InvalidByte(
+            index_at_start_of_input + 2,
+            input[2],
+        ));
+    }
+    accum |= u64::from(morsel) << 46;
+
+    let morsel = decode_table[usize::from(input[3])];
+    if morsel == INVALID_VALUE {
+        return Err(DecodeError::InvalidByte(
+            index_at_start_of_input + 3,
+            input[3],
+        ));
+    }
+    accum |= u64::from(morsel) << 40;
+
+    let morsel = decode_table[usize::from(input[4])];
+    if morsel == INVALID_VALUE {
+        return Err(DecodeError::InvalidByte(
+            index_at_start_of_input + 4,
+            input[4],
+        ));
+    }
+    accum |= u64::from(morsel) << 34;
+
+    let morsel = decode_table[usize::from(input[5])];
+    if morsel == INVALID_VALUE {
+        return Err(DecodeError::InvalidByte(
+            index_at_start_of_input + 5,
+            input[5],
+        ));
+    }
+    accum |= u64::from(morsel) << 28;
+
+    let morsel = decode_table[usize::from(input[6])];
+    if morsel == INVALID_VALUE {
+        return Err(DecodeError::InvalidByte(
+            index_at_start_of_input + 6,
+            input[6],
+        ));
+    }
+    accum |= u64::from(morsel) << 22;
+
+    let morsel = decode_table[usize::from(input[7])];
+    if morsel == INVALID_VALUE {
+        return Err(DecodeError::InvalidByte(
+            index_at_start_of_input + 7,
+            input[7],
+        ));
+    }
+    accum |= u64::from(morsel) << 16;
+
+    output[..6].copy_from_slice(&accum.to_be_bytes()[..6]);
+
+    Ok(())
+}
+
+/// Like [decode_chunk_8] but for 4 bytes of input and 3 bytes of output.
+#[inline(always)]
+fn decode_chunk_4(
+    input: &[u8],
+    index_at_start_of_input: usize,
+    decode_table: &[u8; 256],
+    output: &mut [u8],
+) -> Result<(), DecodeError> {
+    let morsel = decode_table[usize::from(input[0])];
+    if morsel == INVALID_VALUE {
+        return Err(DecodeError::InvalidByte(index_at_start_of_input, input[0]));
+    }
+    let mut accum = u32::from(morsel) << 26;
+
+    let morsel = decode_table[usize::from(input[1])];
+    if morsel == INVALID_VALUE {
+        return Err(DecodeError::InvalidByte(
+            index_at_start_of_input + 1,
+            input[1],
+        ));
+    }
+    accum |= u32::from(morsel) << 20;
+
+    let morsel = decode_table[usize::from(input[2])];
+    if morsel == INVALID_VALUE {
+        return Err(DecodeError::InvalidByte(
+            index_at_start_of_input + 2,
+            input[2],
+        ));
+    }
+    accum |= u32::from(morsel) << 14;
+
+    let morsel = decode_table[usize::from(input[3])];
+    if morsel == INVALID_VALUE {
+        return Err(DecodeError::InvalidByte(
+            index_at_start_of_input + 3,
+            input[3],
+        ));
+    }
+    accum |= u32::from(morsel) << 8;
+
+    output[..3].copy_from_slice(&accum.to_be_bytes()[..3]);
+
+    Ok(())
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    use crate::engine::general_purpose::STANDARD;
+
+    #[test]
+    fn decode_chunk_8_writes_only_6_bytes() {
+        let input = b"Zm9vYmFy"; // "foobar"
+        let mut output = [0_u8, 1, 2, 3, 4, 5, 6, 7];
+
+        decode_chunk_8(&input[..], 0, &STANDARD.decode_table, &mut output).unwrap();
+        assert_eq!(&vec![b'f', b'o', b'o', b'b', b'a', b'r', 6, 7], &output);
+    }
+
+    #[test]
+    fn decode_chunk_4_writes_only_3_bytes() {
+        let input = b"Zm9v"; // "foobar"
+        let mut output = [0_u8, 1, 2, 3];
+
+        decode_chunk_4(&input[..], 0, &STANDARD.decode_table, &mut output).unwrap();
+        assert_eq!(&vec![b'f', b'o', b'o', 3], &output);
+    }
+
+    #[test]
+    fn estimate_short_lengths() {
+        for (range, decoded_len_estimate) in [
+            (0..=0, 0),
+            (1..=4, 3),
+            (5..=8, 6),
+            (9..=12, 9),
+            (13..=16, 12),
+            (17..=20, 15),
+        ] {
+            for encoded_len in range {
+                let estimate = GeneralPurposeEstimate::new(encoded_len);
+                assert_eq!(decoded_len_estimate, estimate.decoded_len_estimate());
+            }
+        }
+    }
+
+    #[test]
+    fn estimate_via_u128_inflation() {
+        // cover both ends of usize
+        (0..1000)
+            .chain(usize::MAX - 1000..=usize::MAX)
+            .for_each(|encoded_len| {
+                // inflate to 128 bit type to be able to safely use the easy formulas
+                let len_128 = encoded_len as u128;
+
+                let estimate = GeneralPurposeEstimate::new(encoded_len);
+                assert_eq!(
+                    (len_128 + 3) / 4 * 3,
+                    estimate.conservative_decoded_len as u128
+                );
+            })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/base64/src/engine/general_purpose/decode_suffix.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/engine/general_purpose/decode_suffix.rs
--- 43.0.0-1/rust-vendor/base64/src/engine/general_purpose/decode_suffix.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/engine/general_purpose/decode_suffix.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,162 @@
+use crate::{
+    engine::{general_purpose::INVALID_VALUE, DecodeMetadata, DecodePaddingMode},
+    DecodeError, DecodeSliceError, PAD_BYTE,
+};
+
+/// Decode the last 0-4 bytes, checking for trailing set bits and padding per the provided
+/// parameters.
+///
+/// Returns the decode metadata representing the total number of bytes decoded, including the ones
+/// indicated as already written by `output_index`.
+pub(crate) fn decode_suffix(
+    input: &[u8],
+    input_index: usize,
+    output: &mut [u8],
+    mut output_index: usize,
+    decode_table: &[u8; 256],
+    decode_allow_trailing_bits: bool,
+    padding_mode: DecodePaddingMode,
+) -> Result<DecodeMetadata, DecodeSliceError> {
+    debug_assert!((input.len() - input_index) <= 4);
+
+    // Decode any leftovers that might not be a complete input chunk of 4 bytes.
+    // Use a u32 as a stack-resident 4 byte buffer.
+    let mut morsels_in_leftover = 0;
+    let mut padding_bytes_count = 0;
+    // offset from input_index
+    let mut first_padding_offset: usize = 0;
+    let mut last_symbol = 0_u8;
+    let mut morsels = [0_u8; 4];
+
+    for (leftover_index, &b) in input[input_index..].iter().enumerate() {
+        // '=' padding
+        if b == PAD_BYTE {
+            // There can be bad padding bytes in a few ways:
+            // 1 - Padding with non-padding characters after it
+            // 2 - Padding after zero or one characters in the current quad (should only
+            //     be after 2 or 3 chars)
+            // 3 - More than two characters of padding. If 3 or 4 padding chars
+            //     are in the same quad, that implies it will be caught by #2.
+            //     If it spreads from one quad to another, it will be an invalid byte
+            //     in the first quad.
+            // 4 - Non-canonical padding -- 1 byte when it should be 2, etc.
+            //     Per config, non-canonical but still functional non- or partially-padded base64
+            //     may be treated as an error condition.
+
+            if leftover_index < 2 {
+                // Check for error #2.
+                // Either the previous byte was padding, in which case we would have already hit
+                // this case, or it wasn't, in which case this is the first such error.
+                debug_assert!(
+                    leftover_index == 0 || (leftover_index == 1 && padding_bytes_count == 0)
+                );
+                let bad_padding_index = input_index + leftover_index;
+                return Err(DecodeError::InvalidByte(bad_padding_index, b).into());
+            }
+
+            if padding_bytes_count == 0 {
+                first_padding_offset = leftover_index;
+            }
+
+            padding_bytes_count += 1;
+            continue;
+        }
+
+        // Check for case #1.
+        // To make '=' handling consistent with the main loop, don't allow
+        // non-suffix '=' in trailing chunk either. Report error as first
+        // erroneous padding.
+        if padding_bytes_count > 0 {
+            return Err(
+                DecodeError::InvalidByte(input_index + first_padding_offset, PAD_BYTE).into(),
+            );
+        }
+
+        last_symbol = b;
+
+        // can use up to 8 * 6 = 48 bits of the u64, if last chunk has no padding.
+        // Pack the leftovers from left to right.
+        let morsel = decode_table[b as usize];
+        if morsel == INVALID_VALUE {
+            return Err(DecodeError::InvalidByte(input_index + leftover_index, b).into());
+        }
+
+        morsels[morsels_in_leftover] = morsel;
+        morsels_in_leftover += 1;
+    }
+
+    // If there was 1 trailing byte, and it was valid, and we got to this point without hitting
+    // an invalid byte, now we can report invalid length
+    if !input.is_empty() && morsels_in_leftover < 2 {
+        return Err(DecodeError::InvalidLength(input_index + morsels_in_leftover).into());
+    }
+
+    match padding_mode {
+        DecodePaddingMode::Indifferent => { /* everything we care about was already checked */ }
+        DecodePaddingMode::RequireCanonical => {
+            // allow empty input
+            if (padding_bytes_count + morsels_in_leftover) % 4 != 0 {
+                return Err(DecodeError::InvalidPadding.into());
+            }
+        }
+        DecodePaddingMode::RequireNone => {
+            if padding_bytes_count > 0 {
+                // check at the end to make sure we let the cases of padding that should be InvalidByte
+                // get hit
+                return Err(DecodeError::InvalidPadding.into());
+            }
+        }
+    }
+
+    // When encoding 1 trailing byte (e.g. 0xFF), 2 base64 bytes ("/w") are needed.
+    // / is the symbol for 63 (0x3F, bottom 6 bits all set) and w is 48 (0x30, top 2 bits
+    // of bottom 6 bits set).
+    // When decoding two symbols back to one trailing byte, any final symbol higher than
+    // w would still decode to the original byte because we only care about the top two
+    // bits in the bottom 6, but would be a non-canonical encoding. So, we calculate a
+    // mask based on how many bits are used for just the canonical encoding, and optionally
+    // error if any other bits are set. In the example of one encoded byte -> 2 symbols,
+    // 2 symbols can technically encode 12 bits, but the last 4 are non-canonical, and
+    // useless since there are no more symbols to provide the necessary 4 additional bits
+    // to finish the second original byte.
+
+    let leftover_bytes_to_append = morsels_in_leftover * 6 / 8;
+    // Put the up to 6 complete bytes as the high bytes.
+    // Gain a couple percent speedup from nudging these ORs to use more ILP with a two-way split.
+    let mut leftover_num = (u32::from(morsels[0]) << 26)
+        | (u32::from(morsels[1]) << 20)
+        | (u32::from(morsels[2]) << 14)
+        | (u32::from(morsels[3]) << 8);
+
+    // if there are bits set outside the bits we care about, last symbol encodes trailing bits that
+    // will not be included in the output
+    let mask = !0_u32 >> (leftover_bytes_to_append * 8);
+    if !decode_allow_trailing_bits && (leftover_num & mask) != 0 {
+        // last morsel is at `morsels_in_leftover` - 1
+        return Err(DecodeError::InvalidLastSymbol(
+            input_index + morsels_in_leftover - 1,
+            last_symbol,
+        )
+        .into());
+    }
+
+    // Strangely, this approach benchmarks better than writing bytes one at a time,
+    // or copy_from_slice into output.
+    for _ in 0..leftover_bytes_to_append {
+        let hi_byte = (leftover_num >> 24) as u8;
+        leftover_num <<= 8;
+        *output
+            .get_mut(output_index)
+            .ok_or(DecodeSliceError::OutputSliceTooSmall)? = hi_byte;
+        output_index += 1;
+    }
+
+    Ok(DecodeMetadata::new(
+        output_index,
+        if padding_bytes_count > 0 {
+            Some(input_index + first_padding_offset)
+        } else {
+            None
+        },
+    ))
+}
diff -pruN 43.0.0-1/rust-vendor/base64/src/engine/general_purpose/mod.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/engine/general_purpose/mod.rs
--- 43.0.0-1/rust-vendor/base64/src/engine/general_purpose/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/engine/general_purpose/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,352 @@
+//! Provides the [GeneralPurpose] engine and associated config types.
+use crate::{
+    alphabet,
+    alphabet::Alphabet,
+    engine::{Config, DecodeMetadata, DecodePaddingMode},
+    DecodeSliceError,
+};
+use core::convert::TryInto;
+
+pub(crate) mod decode;
+pub(crate) mod decode_suffix;
+
+pub use decode::GeneralPurposeEstimate;
+
+pub(crate) const INVALID_VALUE: u8 = 255;
+
+/// A general-purpose base64 engine.
+///
+/// - It uses no vector CPU instructions, so it will work on any system.
+/// - It is reasonably fast (~2-3GiB/s).
+/// - It is not constant-time, though, so it is vulnerable to timing side-channel attacks. For loading cryptographic keys, etc, it is suggested to use the forthcoming constant-time implementation.
+
+#[derive(Debug, Clone)]
+pub struct GeneralPurpose {
+    encode_table: [u8; 64],
+    decode_table: [u8; 256],
+    config: GeneralPurposeConfig,
+}
+
+impl GeneralPurpose {
+    /// Create a `GeneralPurpose` engine from an [Alphabet].
+    ///
+    /// While not very expensive to initialize, ideally these should be cached
+    /// if the engine will be used repeatedly.
+    pub const fn new(alphabet: &Alphabet, config: GeneralPurposeConfig) -> Self {
+        Self {
+            encode_table: encode_table(alphabet),
+            decode_table: decode_table(alphabet),
+            config,
+        }
+    }
+}
+
+impl super::Engine for GeneralPurpose {
+    type Config = GeneralPurposeConfig;
+    type DecodeEstimate = GeneralPurposeEstimate;
+
+    fn internal_encode(&self, input: &[u8], output: &mut [u8]) -> usize {
+        let mut input_index: usize = 0;
+
+        const BLOCKS_PER_FAST_LOOP: usize = 4;
+        const LOW_SIX_BITS: u64 = 0x3F;
+
+        // we read 8 bytes at a time (u64) but only actually consume 6 of those bytes. Thus, we need
+        // 2 trailing bytes to be available to read..
+        let last_fast_index = input.len().saturating_sub(BLOCKS_PER_FAST_LOOP * 6 + 2);
+        let mut output_index = 0;
+
+        if last_fast_index > 0 {
+            while input_index <= last_fast_index {
+                // Major performance wins from letting the optimizer do the bounds check once, mostly
+                // on the output side
+                let input_chunk =
+                    &input[input_index..(input_index + (BLOCKS_PER_FAST_LOOP * 6 + 2))];
+                let output_chunk =
+                    &mut output[output_index..(output_index + BLOCKS_PER_FAST_LOOP * 8)];
+
+                // Hand-unrolling for 32 vs 16 or 8 bytes produces yields performance about equivalent
+                // to unsafe pointer code on a Xeon E5-1650v3. 64 byte unrolling was slightly better for
+                // large inputs but significantly worse for 50-byte input, unsurprisingly. I suspect
+                // that it's a not uncommon use case to encode smallish chunks of data (e.g. a 64-byte
+                // SHA-512 digest), so it would be nice if that fit in the unrolled loop at least once.
+                // Plus, single-digit percentage performance differences might well be quite different
+                // on different hardware.
+
+                let input_u64 = read_u64(&input_chunk[0..]);
+
+                output_chunk[0] = self.encode_table[((input_u64 >> 58) & LOW_SIX_BITS) as usize];
+                output_chunk[1] = self.encode_table[((input_u64 >> 52) & LOW_SIX_BITS) as usize];
+                output_chunk[2] = self.encode_table[((input_u64 >> 46) & LOW_SIX_BITS) as usize];
+                output_chunk[3] = self.encode_table[((input_u64 >> 40) & LOW_SIX_BITS) as usize];
+                output_chunk[4] = self.encode_table[((input_u64 >> 34) & LOW_SIX_BITS) as usize];
+                output_chunk[5] = self.encode_table[((input_u64 >> 28) & LOW_SIX_BITS) as usize];
+                output_chunk[6] = self.encode_table[((input_u64 >> 22) & LOW_SIX_BITS) as usize];
+                output_chunk[7] = self.encode_table[((input_u64 >> 16) & LOW_SIX_BITS) as usize];
+
+                let input_u64 = read_u64(&input_chunk[6..]);
+
+                output_chunk[8] = self.encode_table[((input_u64 >> 58) & LOW_SIX_BITS) as usize];
+                output_chunk[9] = self.encode_table[((input_u64 >> 52) & LOW_SIX_BITS) as usize];
+                output_chunk[10] = self.encode_table[((input_u64 >> 46) & LOW_SIX_BITS) as usize];
+                output_chunk[11] = self.encode_table[((input_u64 >> 40) & LOW_SIX_BITS) as usize];
+                output_chunk[12] = self.encode_table[((input_u64 >> 34) & LOW_SIX_BITS) as usize];
+                output_chunk[13] = self.encode_table[((input_u64 >> 28) & LOW_SIX_BITS) as usize];
+                output_chunk[14] = self.encode_table[((input_u64 >> 22) & LOW_SIX_BITS) as usize];
+                output_chunk[15] = self.encode_table[((input_u64 >> 16) & LOW_SIX_BITS) as usize];
+
+                let input_u64 = read_u64(&input_chunk[12..]);
+
+                output_chunk[16] = self.encode_table[((input_u64 >> 58) & LOW_SIX_BITS) as usize];
+                output_chunk[17] = self.encode_table[((input_u64 >> 52) & LOW_SIX_BITS) as usize];
+                output_chunk[18] = self.encode_table[((input_u64 >> 46) & LOW_SIX_BITS) as usize];
+                output_chunk[19] = self.encode_table[((input_u64 >> 40) & LOW_SIX_BITS) as usize];
+                output_chunk[20] = self.encode_table[((input_u64 >> 34) & LOW_SIX_BITS) as usize];
+                output_chunk[21] = self.encode_table[((input_u64 >> 28) & LOW_SIX_BITS) as usize];
+                output_chunk[22] = self.encode_table[((input_u64 >> 22) & LOW_SIX_BITS) as usize];
+                output_chunk[23] = self.encode_table[((input_u64 >> 16) & LOW_SIX_BITS) as usize];
+
+                let input_u64 = read_u64(&input_chunk[18..]);
+
+                output_chunk[24] = self.encode_table[((input_u64 >> 58) & LOW_SIX_BITS) as usize];
+                output_chunk[25] = self.encode_table[((input_u64 >> 52) & LOW_SIX_BITS) as usize];
+                output_chunk[26] = self.encode_table[((input_u64 >> 46) & LOW_SIX_BITS) as usize];
+                output_chunk[27] = self.encode_table[((input_u64 >> 40) & LOW_SIX_BITS) as usize];
+                output_chunk[28] = self.encode_table[((input_u64 >> 34) & LOW_SIX_BITS) as usize];
+                output_chunk[29] = self.encode_table[((input_u64 >> 28) & LOW_SIX_BITS) as usize];
+                output_chunk[30] = self.encode_table[((input_u64 >> 22) & LOW_SIX_BITS) as usize];
+                output_chunk[31] = self.encode_table[((input_u64 >> 16) & LOW_SIX_BITS) as usize];
+
+                output_index += BLOCKS_PER_FAST_LOOP * 8;
+                input_index += BLOCKS_PER_FAST_LOOP * 6;
+            }
+        }
+
+        // Encode what's left after the fast loop.
+
+        const LOW_SIX_BITS_U8: u8 = 0x3F;
+
+        let rem = input.len() % 3;
+        let start_of_rem = input.len() - rem;
+
+        // start at the first index not handled by fast loop, which may be 0.
+
+        while input_index < start_of_rem {
+            let input_chunk = &input[input_index..(input_index + 3)];
+            let output_chunk = &mut output[output_index..(output_index + 4)];
+
+            output_chunk[0] = self.encode_table[(input_chunk[0] >> 2) as usize];
+            output_chunk[1] = self.encode_table
+                [((input_chunk[0] << 4 | input_chunk[1] >> 4) & LOW_SIX_BITS_U8) as usize];
+            output_chunk[2] = self.encode_table
+                [((input_chunk[1] << 2 | input_chunk[2] >> 6) & LOW_SIX_BITS_U8) as usize];
+            output_chunk[3] = self.encode_table[(input_chunk[2] & LOW_SIX_BITS_U8) as usize];
+
+            input_index += 3;
+            output_index += 4;
+        }
+
+        if rem == 2 {
+            output[output_index] = self.encode_table[(input[start_of_rem] >> 2) as usize];
+            output[output_index + 1] =
+                self.encode_table[((input[start_of_rem] << 4 | input[start_of_rem + 1] >> 4)
+                    & LOW_SIX_BITS_U8) as usize];
+            output[output_index + 2] =
+                self.encode_table[((input[start_of_rem + 1] << 2) & LOW_SIX_BITS_U8) as usize];
+            output_index += 3;
+        } else if rem == 1 {
+            output[output_index] = self.encode_table[(input[start_of_rem] >> 2) as usize];
+            output[output_index + 1] =
+                self.encode_table[((input[start_of_rem] << 4) & LOW_SIX_BITS_U8) as usize];
+            output_index += 2;
+        }
+
+        output_index
+    }
+
+    fn internal_decoded_len_estimate(&self, input_len: usize) -> Self::DecodeEstimate {
+        GeneralPurposeEstimate::new(input_len)
+    }
+
+    fn internal_decode(
+        &self,
+        input: &[u8],
+        output: &mut [u8],
+        estimate: Self::DecodeEstimate,
+    ) -> Result<DecodeMetadata, DecodeSliceError> {
+        decode::decode_helper(
+            input,
+            estimate,
+            output,
+            &self.decode_table,
+            self.config.decode_allow_trailing_bits,
+            self.config.decode_padding_mode,
+        )
+    }
+
+    fn config(&self) -> &Self::Config {
+        &self.config
+    }
+}
+
+/// Returns a table mapping a 6-bit index to the ASCII byte encoding of the index
+pub(crate) const fn encode_table(alphabet: &Alphabet) -> [u8; 64] {
+    // the encode table is just the alphabet:
+    // 6-bit index lookup -> printable byte
+    let mut encode_table = [0_u8; 64];
+    {
+        let mut index = 0;
+        while index < 64 {
+            encode_table[index] = alphabet.symbols[index];
+            index += 1;
+        }
+    }
+
+    encode_table
+}
+
+/// Returns a table mapping base64 bytes as the lookup index to either:
+/// - [INVALID_VALUE] for bytes that aren't members of the alphabet
+/// - a byte whose lower 6 bits are the value that was encoded into the index byte
+pub(crate) const fn decode_table(alphabet: &Alphabet) -> [u8; 256] {
+    let mut decode_table = [INVALID_VALUE; 256];
+
+    // Since the table is full of `INVALID_VALUE` already, we only need to overwrite
+    // the parts that are valid.
+    let mut index = 0;
+    while index < 64 {
+        // The index in the alphabet is the 6-bit value we care about.
+        // Since the index is in 0-63, it is safe to cast to u8.
+        decode_table[alphabet.symbols[index] as usize] = index as u8;
+        index += 1;
+    }
+
+    decode_table
+}
+
+#[inline]
+fn read_u64(s: &[u8]) -> u64 {
+    u64::from_be_bytes(s[..8].try_into().unwrap())
+}
+
+/// Contains configuration parameters for base64 encoding and decoding.
+///
+/// ```
+/// # use base64::engine::GeneralPurposeConfig;
+/// let config = GeneralPurposeConfig::new()
+///     .with_encode_padding(false);
+///     // further customize using `.with_*` methods as needed
+/// ```
+///
+/// The constants [PAD] and [NO_PAD] cover most use cases.
+///
+/// To specify the characters used, see [Alphabet].
+#[derive(Clone, Copy, Debug)]
+pub struct GeneralPurposeConfig {
+    encode_padding: bool,
+    decode_allow_trailing_bits: bool,
+    decode_padding_mode: DecodePaddingMode,
+}
+
+impl GeneralPurposeConfig {
+    /// Create a new config with `padding` = `true`, `decode_allow_trailing_bits` = `false`, and
+    /// `decode_padding_mode = DecodePaddingMode::RequireCanonicalPadding`.
+    ///
+    /// This probably matches most people's expectations, but consider disabling padding to save
+    /// a few bytes unless you specifically need it for compatibility with some legacy system.
+    pub const fn new() -> Self {
+        Self {
+            // RFC states that padding must be applied by default
+            encode_padding: true,
+            decode_allow_trailing_bits: false,
+            decode_padding_mode: DecodePaddingMode::RequireCanonical,
+        }
+    }
+
+    /// Create a new config based on `self` with an updated `padding` setting.
+    ///
+    /// If `padding` is `true`, encoding will append either 1 or 2 `=` padding characters as needed
+    /// to produce an output whose length is a multiple of 4.
+    ///
+    /// Padding is not needed for correct decoding and only serves to waste bytes, but it's in the
+    /// [spec](https://datatracker.ietf.org/doc/html/rfc4648#section-3.2).
+    ///
+    /// For new applications, consider not using padding if the decoders you're using don't require
+    /// padding to be present.
+    pub const fn with_encode_padding(self, padding: bool) -> Self {
+        Self {
+            encode_padding: padding,
+            ..self
+        }
+    }
+
+    /// Create a new config based on `self` with an updated `decode_allow_trailing_bits` setting.
+    ///
+    /// Most users will not need to configure this. It's useful if you need to decode base64
+    /// produced by a buggy encoder that has bits set in the unused space on the last base64
+    /// character as per [forgiving-base64 decode](https://infra.spec.whatwg.org/#forgiving-base64-decode).
+    /// If invalid trailing bits are present and this is `true`, those bits will
+    /// be silently ignored, else `DecodeError::InvalidLastSymbol` will be emitted.
+    pub const fn with_decode_allow_trailing_bits(self, allow: bool) -> Self {
+        Self {
+            decode_allow_trailing_bits: allow,
+            ..self
+        }
+    }
+
+    /// Create a new config based on `self` with an updated `decode_padding_mode` setting.
+    ///
+    /// Padding is not useful in terms of representing encoded data -- it makes no difference to
+    /// the decoder if padding is present or not, so if you have some un-padded input to decode, it
+    /// is perfectly fine to use `DecodePaddingMode::Indifferent` to prevent errors from being
+    /// emitted.
+    ///
+    /// However, since in practice
+    /// [people who learned nothing from BER vs DER seem to expect base64 to have one canonical encoding](https://eprint.iacr.org/2022/361),
+    /// the default setting is the stricter `DecodePaddingMode::RequireCanonicalPadding`.
+    ///
+    /// Or, if "canonical" in your circumstance means _no_ padding rather than padding to the
+    /// next multiple of four, there's `DecodePaddingMode::RequireNoPadding`.
+    pub const fn with_decode_padding_mode(self, mode: DecodePaddingMode) -> Self {
+        Self {
+            decode_padding_mode: mode,
+            ..self
+        }
+    }
+}
+
+impl Default for GeneralPurposeConfig {
+    /// Delegates to [GeneralPurposeConfig::new].
+    fn default() -> Self {
+        Self::new()
+    }
+}
+
+impl Config for GeneralPurposeConfig {
+    fn encode_padding(&self) -> bool {
+        self.encode_padding
+    }
+}
+
+/// A [GeneralPurpose] engine using the [alphabet::STANDARD] base64 alphabet and [PAD] config.
+pub const STANDARD: GeneralPurpose = GeneralPurpose::new(&alphabet::STANDARD, PAD);
+
+/// A [GeneralPurpose] engine using the [alphabet::STANDARD] base64 alphabet and [NO_PAD] config.
+pub const STANDARD_NO_PAD: GeneralPurpose = GeneralPurpose::new(&alphabet::STANDARD, NO_PAD);
+
+/// A [GeneralPurpose] engine using the [alphabet::URL_SAFE] base64 alphabet and [PAD] config.
+pub const URL_SAFE: GeneralPurpose = GeneralPurpose::new(&alphabet::URL_SAFE, PAD);
+
+/// A [GeneralPurpose] engine using the [alphabet::URL_SAFE] base64 alphabet and [NO_PAD] config.
+pub const URL_SAFE_NO_PAD: GeneralPurpose = GeneralPurpose::new(&alphabet::URL_SAFE, NO_PAD);
+
+/// Include padding bytes when encoding, and require that they be present when decoding.
+///
+/// This is the standard per the base64 RFC, but consider using [NO_PAD] instead as padding serves
+/// little purpose in practice.
+pub const PAD: GeneralPurposeConfig = GeneralPurposeConfig::new();
+
+/// Don't add padding when encoding, and require no padding when decoding.
+pub const NO_PAD: GeneralPurposeConfig = GeneralPurposeConfig::new()
+    .with_encode_padding(false)
+    .with_decode_padding_mode(DecodePaddingMode::RequireNone);
diff -pruN 43.0.0-1/rust-vendor/base64/src/engine/mod.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/engine/mod.rs
--- 43.0.0-1/rust-vendor/base64/src/engine/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/engine/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,478 @@
+//! Provides the [Engine] abstraction and out of the box implementations.
+#[cfg(any(feature = "alloc", test))]
+use crate::chunked_encoder;
+use crate::{
+    encode::{encode_with_padding, EncodeSliceError},
+    encoded_len, DecodeError, DecodeSliceError,
+};
+#[cfg(any(feature = "alloc", test))]
+use alloc::vec::Vec;
+
+#[cfg(any(feature = "alloc", test))]
+use alloc::{string::String, vec};
+
+pub mod general_purpose;
+
+#[cfg(test)]
+mod naive;
+
+#[cfg(test)]
+mod tests;
+
+pub use general_purpose::{GeneralPurpose, GeneralPurposeConfig};
+
+/// An `Engine` provides low-level encoding and decoding operations that all other higher-level parts of the API use. Users of the library will generally not need to implement this.
+///
+/// Different implementations offer different characteristics. The library currently ships with
+/// [GeneralPurpose] that offers good speed and works on any CPU, with more choices
+/// coming later, like a constant-time one when side channel resistance is called for, and vendor-specific vectorized ones for more speed.
+///
+/// See [general_purpose::STANDARD_NO_PAD] if you just want standard base64. Otherwise, when possible, it's
+/// recommended to store the engine in a `const` so that references to it won't pose any lifetime
+/// issues, and to avoid repeating the cost of engine setup.
+///
+/// Since almost nobody will need to implement `Engine`, docs for internal methods are hidden.
+// When adding an implementation of Engine, include them in the engine test suite:
+// - add an implementation of [engine::tests::EngineWrapper]
+// - add the implementation to the `all_engines` macro
+// All tests run on all engines listed in the macro.
+pub trait Engine: Send + Sync {
+    /// The config type used by this engine
+    type Config: Config;
+    /// The decode estimate used by this engine
+    type DecodeEstimate: DecodeEstimate;
+
+    /// This is not meant to be called directly; it is only for `Engine` implementors.
+    /// See the other `encode*` functions on this trait.
+    ///
+    /// Encode the `input` bytes into the `output` buffer based on the mapping in `encode_table`.
+    ///
+    /// `output` will be long enough to hold the encoded data.
+    ///
+    /// Returns the number of bytes written.
+    ///
+    /// No padding should be written; that is handled separately.
+    ///
+    /// Must not write any bytes into the output slice other than the encoded data.
+    #[doc(hidden)]
+    fn internal_encode(&self, input: &[u8], output: &mut [u8]) -> usize;
+
+    /// This is not meant to be called directly; it is only for `Engine` implementors.
+    ///
+    /// As an optimization to prevent the decoded length from being calculated twice, it is
+    /// sometimes helpful to have a conservative estimate of the decoded size before doing the
+    /// decoding, so this calculation is done separately and passed to [Engine::decode()] as needed.
+    #[doc(hidden)]
+    fn internal_decoded_len_estimate(&self, input_len: usize) -> Self::DecodeEstimate;
+
+    /// This is not meant to be called directly; it is only for `Engine` implementors.
+    /// See the other `decode*` functions on this trait.
+    ///
+    /// Decode `input` base64 bytes into the `output` buffer.
+    ///
+    /// `decode_estimate` is the result of [Engine::internal_decoded_len_estimate()], which is passed in to avoid
+    /// calculating it again (expensive on short inputs).`
+    ///
+    /// Each complete 4-byte chunk of encoded data decodes to 3 bytes of decoded data, but this
+    /// function must also handle the final possibly partial chunk.
+    /// If the input length is not a multiple of 4, or uses padding bytes to reach a multiple of 4,
+    /// the trailing 2 or 3 bytes must decode to 1 or 2 bytes, respectively, as per the
+    /// [RFC](https://tools.ietf.org/html/rfc4648#section-3.5).
+    ///
+    /// Decoding must not write any bytes into the output slice other than the decoded data.
+    ///
+    /// Non-canonical trailing bits in the final tokens or non-canonical padding must be reported as
+    /// errors unless the engine is configured otherwise.
+    #[doc(hidden)]
+    fn internal_decode(
+        &self,
+        input: &[u8],
+        output: &mut [u8],
+        decode_estimate: Self::DecodeEstimate,
+    ) -> Result<DecodeMetadata, DecodeSliceError>;
+
+    /// Returns the config for this engine.
+    fn config(&self) -> &Self::Config;
+
+    /// Encode arbitrary octets as base64 using the provided `Engine`.
+    /// Returns a `String`.
+    ///
+    /// # Example
+    ///
+    /// ```rust
+    /// use base64::{Engine as _, engine::{self, general_purpose}, alphabet};
+    ///
+    /// let b64 = general_purpose::STANDARD.encode(b"hello world~");
+    /// println!("{}", b64);
+    ///
+    /// const CUSTOM_ENGINE: engine::GeneralPurpose =
+    ///     engine::GeneralPurpose::new(&alphabet::URL_SAFE, general_purpose::NO_PAD);
+    ///
+    /// let b64_url = CUSTOM_ENGINE.encode(b"hello internet~");
+    /// ```
+    #[cfg(any(feature = "alloc", test))]
+    #[inline]
+    fn encode<T: AsRef<[u8]>>(&self, input: T) -> String {
+        fn inner<E>(engine: &E, input_bytes: &[u8]) -> String
+        where
+            E: Engine + ?Sized,
+        {
+            let encoded_size = encoded_len(input_bytes.len(), engine.config().encode_padding())
+                .expect("integer overflow when calculating buffer size");
+
+            let mut buf = vec![0; encoded_size];
+
+            encode_with_padding(input_bytes, &mut buf[..], engine, encoded_size);
+
+            String::from_utf8(buf).expect("Invalid UTF8")
+        }
+
+        inner(self, input.as_ref())
+    }
+
+    /// Encode arbitrary octets as base64 into a supplied `String`.
+    /// Writes into the supplied `String`, which may allocate if its internal buffer isn't big enough.
+    ///
+    /// # Example
+    ///
+    /// ```rust
+    /// use base64::{Engine as _, engine::{self, general_purpose}, alphabet};
+    /// const CUSTOM_ENGINE: engine::GeneralPurpose =
+    ///     engine::GeneralPurpose::new(&alphabet::URL_SAFE, general_purpose::NO_PAD);
+    ///
+    /// fn main() {
+    ///     let mut buf = String::new();
+    ///     general_purpose::STANDARD.encode_string(b"hello world~", &mut buf);
+    ///     println!("{}", buf);
+    ///
+    ///     buf.clear();
+    ///     CUSTOM_ENGINE.encode_string(b"hello internet~", &mut buf);
+    ///     println!("{}", buf);
+    /// }
+    /// ```
+    #[cfg(any(feature = "alloc", test))]
+    #[inline]
+    fn encode_string<T: AsRef<[u8]>>(&self, input: T, output_buf: &mut String) {
+        fn inner<E>(engine: &E, input_bytes: &[u8], output_buf: &mut String)
+        where
+            E: Engine + ?Sized,
+        {
+            let mut sink = chunked_encoder::StringSink::new(output_buf);
+
+            chunked_encoder::ChunkedEncoder::new(engine)
+                .encode(input_bytes, &mut sink)
+                .expect("Writing to a String shouldn't fail");
+        }
+
+        inner(self, input.as_ref(), output_buf)
+    }
+
+    /// Encode arbitrary octets as base64 into a supplied slice.
+    /// Writes into the supplied output buffer.
+    ///
+    /// This is useful if you wish to avoid allocation entirely (e.g. encoding into a stack-resident
+    /// or statically-allocated buffer).
+    ///
+    /// # Example
+    ///
+    #[cfg_attr(feature = "alloc", doc = "```")]
+    #[cfg_attr(not(feature = "alloc"), doc = "```ignore")]
+    /// use base64::{Engine as _, engine::general_purpose};
+    /// let s = b"hello internet!";
+    /// let mut buf = Vec::new();
+    /// // make sure we'll have a slice big enough for base64 + padding
+    /// buf.resize(s.len() * 4 / 3 + 4, 0);
+    ///
+    /// let bytes_written = general_purpose::STANDARD.encode_slice(s, &mut buf).unwrap();
+    ///
+    /// // shorten our vec down to just what was written
+    /// buf.truncate(bytes_written);
+    ///
+    /// assert_eq!(s, general_purpose::STANDARD.decode(&buf).unwrap().as_slice());
+    /// ```
+    #[inline]
+    fn encode_slice<T: AsRef<[u8]>>(
+        &self,
+        input: T,
+        output_buf: &mut [u8],
+    ) -> Result<usize, EncodeSliceError> {
+        fn inner<E>(
+            engine: &E,
+            input_bytes: &[u8],
+            output_buf: &mut [u8],
+        ) -> Result<usize, EncodeSliceError>
+        where
+            E: Engine + ?Sized,
+        {
+            let encoded_size = encoded_len(input_bytes.len(), engine.config().encode_padding())
+                .expect("usize overflow when calculating buffer size");
+
+            if output_buf.len() < encoded_size {
+                return Err(EncodeSliceError::OutputSliceTooSmall);
+            }
+
+            let b64_output = &mut output_buf[0..encoded_size];
+
+            encode_with_padding(input_bytes, b64_output, engine, encoded_size);
+
+            Ok(encoded_size)
+        }
+
+        inner(self, input.as_ref(), output_buf)
+    }
+
+    /// Decode the input into a new `Vec`.
+    ///
+    /// # Example
+    ///
+    /// ```rust
+    /// use base64::{Engine as _, alphabet, engine::{self, general_purpose}};
+    ///
+    /// let bytes = general_purpose::STANDARD
+    ///     .decode("aGVsbG8gd29ybGR+Cg==").unwrap();
+    /// println!("{:?}", bytes);
+    ///
+    /// // custom engine setup
+    /// let bytes_url = engine::GeneralPurpose::new(
+    ///              &alphabet::URL_SAFE,
+    ///              general_purpose::NO_PAD)
+    ///     .decode("aGVsbG8gaW50ZXJuZXR-Cg").unwrap();
+    /// println!("{:?}", bytes_url);
+    /// ```
+    #[cfg(any(feature = "alloc", test))]
+    #[inline]
+    fn decode<T: AsRef<[u8]>>(&self, input: T) -> Result<Vec<u8>, DecodeError> {
+        fn inner<E>(engine: &E, input_bytes: &[u8]) -> Result<Vec<u8>, DecodeError>
+        where
+            E: Engine + ?Sized,
+        {
+            let estimate = engine.internal_decoded_len_estimate(input_bytes.len());
+            let mut buffer = vec![0; estimate.decoded_len_estimate()];
+
+            let bytes_written = engine
+                .internal_decode(input_bytes, &mut buffer, estimate)
+                .map_err(|e| match e {
+                    DecodeSliceError::DecodeError(e) => e,
+                    DecodeSliceError::OutputSliceTooSmall => {
+                        unreachable!("Vec is sized conservatively")
+                    }
+                })?
+                .decoded_len;
+
+            buffer.truncate(bytes_written);
+
+            Ok(buffer)
+        }
+
+        inner(self, input.as_ref())
+    }
+
+    /// Decode the `input` into the supplied `buffer`.
+    ///
+    /// Writes into the supplied `Vec`, which may allocate if its internal buffer isn't big enough.
+    /// Returns a `Result` containing an empty tuple, aka `()`.
+    ///
+    /// # Example
+    ///
+    /// ```rust
+    /// use base64::{Engine as _, alphabet, engine::{self, general_purpose}};
+    /// const CUSTOM_ENGINE: engine::GeneralPurpose =
+    ///     engine::GeneralPurpose::new(&alphabet::URL_SAFE, general_purpose::PAD);
+    ///
+    /// fn main() {
+    ///     use base64::Engine;
+    ///     let mut buffer = Vec::<u8>::new();
+    ///     // with the default engine
+    ///     general_purpose::STANDARD
+    ///         .decode_vec("aGVsbG8gd29ybGR+Cg==", &mut buffer,).unwrap();
+    ///     println!("{:?}", buffer);
+    ///
+    ///     buffer.clear();
+    ///
+    ///     // with a custom engine
+    ///     CUSTOM_ENGINE.decode_vec(
+    ///         "aGVsbG8gaW50ZXJuZXR-Cg==",
+    ///         &mut buffer,
+    ///     ).unwrap();
+    ///     println!("{:?}", buffer);
+    /// }
+    /// ```
+    #[cfg(any(feature = "alloc", test))]
+    #[inline]
+    fn decode_vec<T: AsRef<[u8]>>(
+        &self,
+        input: T,
+        buffer: &mut Vec<u8>,
+    ) -> Result<(), DecodeError> {
+        fn inner<E>(engine: &E, input_bytes: &[u8], buffer: &mut Vec<u8>) -> Result<(), DecodeError>
+        where
+            E: Engine + ?Sized,
+        {
+            let starting_output_len = buffer.len();
+            let estimate = engine.internal_decoded_len_estimate(input_bytes.len());
+
+            let total_len_estimate = estimate
+                .decoded_len_estimate()
+                .checked_add(starting_output_len)
+                .expect("Overflow when calculating output buffer length");
+
+            buffer.resize(total_len_estimate, 0);
+
+            let buffer_slice = &mut buffer.as_mut_slice()[starting_output_len..];
+
+            let bytes_written = engine
+                .internal_decode(input_bytes, buffer_slice, estimate)
+                .map_err(|e| match e {
+                    DecodeSliceError::DecodeError(e) => e,
+                    DecodeSliceError::OutputSliceTooSmall => {
+                        unreachable!("Vec is sized conservatively")
+                    }
+                })?
+                .decoded_len;
+
+            buffer.truncate(starting_output_len + bytes_written);
+
+            Ok(())
+        }
+
+        inner(self, input.as_ref(), buffer)
+    }
+
+    /// Decode the input into the provided output slice.
+    ///
+    /// Returns the number of bytes written to the slice, or an error if `output` is smaller than
+    /// the estimated decoded length.
+    ///
+    /// This will not write any bytes past exactly what is decoded (no stray garbage bytes at the end).
+    ///
+    /// See [crate::decoded_len_estimate] for calculating buffer sizes.
+    ///
+    /// See [Engine::decode_slice_unchecked] for a version that panics instead of returning an error
+    /// if the output buffer is too small.
+    #[inline]
+    fn decode_slice<T: AsRef<[u8]>>(
+        &self,
+        input: T,
+        output: &mut [u8],
+    ) -> Result<usize, DecodeSliceError> {
+        fn inner<E>(
+            engine: &E,
+            input_bytes: &[u8],
+            output: &mut [u8],
+        ) -> Result<usize, DecodeSliceError>
+        where
+            E: Engine + ?Sized,
+        {
+            engine
+                .internal_decode(
+                    input_bytes,
+                    output,
+                    engine.internal_decoded_len_estimate(input_bytes.len()),
+                )
+                .map(|dm| dm.decoded_len)
+        }
+
+        inner(self, input.as_ref(), output)
+    }
+
+    /// Decode the input into the provided output slice.
+    ///
+    /// Returns the number of bytes written to the slice.
+    ///
+    /// This will not write any bytes past exactly what is decoded (no stray garbage bytes at the end).
+    ///
+    /// See [crate::decoded_len_estimate] for calculating buffer sizes.
+    ///
+    /// See [Engine::decode_slice] for a version that returns an error instead of panicking if the output
+    /// buffer is too small.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the provided output buffer is too small for the decoded data.
+    #[inline]
+    fn decode_slice_unchecked<T: AsRef<[u8]>>(
+        &self,
+        input: T,
+        output: &mut [u8],
+    ) -> Result<usize, DecodeError> {
+        fn inner<E>(engine: &E, input_bytes: &[u8], output: &mut [u8]) -> Result<usize, DecodeError>
+        where
+            E: Engine + ?Sized,
+        {
+            engine
+                .internal_decode(
+                    input_bytes,
+                    output,
+                    engine.internal_decoded_len_estimate(input_bytes.len()),
+                )
+                .map(|dm| dm.decoded_len)
+                .map_err(|e| match e {
+                    DecodeSliceError::DecodeError(e) => e,
+                    DecodeSliceError::OutputSliceTooSmall => {
+                        panic!("Output slice is too small")
+                    }
+                })
+        }
+
+        inner(self, input.as_ref(), output)
+    }
+}
+
+/// The minimal level of configuration that engines must support.
+pub trait Config {
+    /// Returns `true` if padding should be added after the encoded output.
+    ///
+    /// Padding is added outside the engine's encode() since the engine may be used
+    /// to encode only a chunk of the overall output, so it can't always know when
+    /// the output is "done" and would therefore need padding (if configured).
+    // It could be provided as a separate parameter when encoding, but that feels like
+    // leaking an implementation detail to the user, and it's hopefully more convenient
+    // to have to only pass one thing (the engine) to any part of the API.
+    fn encode_padding(&self) -> bool;
+}
+
+/// The decode estimate used by an engine implementation. Users do not need to interact with this;
+/// it is only for engine implementors.
+///
+/// Implementors may store relevant data here when constructing this to avoid having to calculate
+/// them again during actual decoding.
+pub trait DecodeEstimate {
+    /// Returns a conservative (err on the side of too big) estimate of the decoded length to use
+    /// for pre-allocating buffers, etc.
+    ///
+    /// The estimate must be no larger than the next largest complete triple of decoded bytes.
+    /// That is, the final quad of tokens to decode may be assumed to be complete with no padding.
+    fn decoded_len_estimate(&self) -> usize;
+}
+
+/// Controls how pad bytes are handled when decoding.
+///
+/// Each [Engine] must support at least the behavior indicated by
+/// [DecodePaddingMode::RequireCanonical], and may support other modes.
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+pub enum DecodePaddingMode {
+    /// Canonical padding is allowed, but any fewer padding bytes than that is also allowed.
+    Indifferent,
+    /// Padding must be canonical (0, 1, or 2 `=` as needed to produce a 4 byte suffix).
+    RequireCanonical,
+    /// Padding must be absent -- for when you want predictable padding, without any wasted bytes.
+    RequireNone,
+}
+
+/// Metadata about the result of a decode operation
+#[derive(PartialEq, Eq, Debug)]
+pub struct DecodeMetadata {
+    /// Number of decoded bytes output
+    pub(crate) decoded_len: usize,
+    /// Offset of the first padding byte in the input, if any
+    pub(crate) padding_offset: Option<usize>,
+}
+
+impl DecodeMetadata {
+    pub(crate) fn new(decoded_bytes: usize, padding_index: Option<usize>) -> Self {
+        Self {
+            decoded_len: decoded_bytes,
+            padding_offset: padding_index,
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/base64/src/engine/naive.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/engine/naive.rs
--- 43.0.0-1/rust-vendor/base64/src/engine/naive.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/engine/naive.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,195 @@
+use crate::{
+    alphabet::Alphabet,
+    engine::{
+        general_purpose::{self, decode_table, encode_table},
+        Config, DecodeEstimate, DecodeMetadata, DecodePaddingMode, Engine,
+    },
+    DecodeError, DecodeSliceError,
+};
+use std::ops::{BitAnd, BitOr, Shl, Shr};
+
+/// Comparatively simple implementation that can be used as something to compare against in tests
+pub struct Naive {
+    encode_table: [u8; 64],
+    decode_table: [u8; 256],
+    config: NaiveConfig,
+}
+
+impl Naive {
+    const ENCODE_INPUT_CHUNK_SIZE: usize = 3;
+    const DECODE_INPUT_CHUNK_SIZE: usize = 4;
+
+    pub const fn new(alphabet: &Alphabet, config: NaiveConfig) -> Self {
+        Self {
+            encode_table: encode_table(alphabet),
+            decode_table: decode_table(alphabet),
+            config,
+        }
+    }
+
+    fn decode_byte_into_u32(&self, offset: usize, byte: u8) -> Result<u32, DecodeError> {
+        let decoded = self.decode_table[byte as usize];
+
+        if decoded == general_purpose::INVALID_VALUE {
+            return Err(DecodeError::InvalidByte(offset, byte));
+        }
+
+        Ok(decoded as u32)
+    }
+}
+
+impl Engine for Naive {
+    type Config = NaiveConfig;
+    type DecodeEstimate = NaiveEstimate;
+
+    fn internal_encode(&self, input: &[u8], output: &mut [u8]) -> usize {
+        // complete chunks first
+
+        const LOW_SIX_BITS: u32 = 0x3F;
+
+        let rem = input.len() % Self::ENCODE_INPUT_CHUNK_SIZE;
+        // will never underflow
+        let complete_chunk_len = input.len() - rem;
+
+        let mut input_index = 0_usize;
+        let mut output_index = 0_usize;
+        if let Some(last_complete_chunk_index) =
+            complete_chunk_len.checked_sub(Self::ENCODE_INPUT_CHUNK_SIZE)
+        {
+            while input_index <= last_complete_chunk_index {
+                let chunk = &input[input_index..input_index + Self::ENCODE_INPUT_CHUNK_SIZE];
+
+                // populate low 24 bits from 3 bytes
+                let chunk_int: u32 =
+                    (chunk[0] as u32).shl(16) | (chunk[1] as u32).shl(8) | (chunk[2] as u32);
+                // encode 4x 6-bit output bytes
+                output[output_index] = self.encode_table[chunk_int.shr(18) as usize];
+                output[output_index + 1] =
+                    self.encode_table[chunk_int.shr(12_u8).bitand(LOW_SIX_BITS) as usize];
+                output[output_index + 2] =
+                    self.encode_table[chunk_int.shr(6_u8).bitand(LOW_SIX_BITS) as usize];
+                output[output_index + 3] =
+                    self.encode_table[chunk_int.bitand(LOW_SIX_BITS) as usize];
+
+                input_index += Self::ENCODE_INPUT_CHUNK_SIZE;
+                output_index += 4;
+            }
+        }
+
+        // then leftovers
+        if rem == 2 {
+            let chunk = &input[input_index..input_index + 2];
+
+            // high six bits of chunk[0]
+            output[output_index] = self.encode_table[chunk[0].shr(2) as usize];
+            // bottom 2 bits of [0], high 4 bits of [1]
+            output[output_index + 1] =
+                self.encode_table[(chunk[0].shl(4_u8).bitor(chunk[1].shr(4_u8)) as u32)
+                    .bitand(LOW_SIX_BITS) as usize];
+            // bottom 4 bits of [1], with the 2 bottom bits as zero
+            output[output_index + 2] =
+                self.encode_table[(chunk[1].shl(2_u8) as u32).bitand(LOW_SIX_BITS) as usize];
+
+            output_index += 3;
+        } else if rem == 1 {
+            let byte = input[input_index];
+            output[output_index] = self.encode_table[byte.shr(2) as usize];
+            output[output_index + 1] =
+                self.encode_table[(byte.shl(4_u8) as u32).bitand(LOW_SIX_BITS) as usize];
+            output_index += 2;
+        }
+
+        output_index
+    }
+
+    fn internal_decoded_len_estimate(&self, input_len: usize) -> Self::DecodeEstimate {
+        NaiveEstimate::new(input_len)
+    }
+
+    fn internal_decode(
+        &self,
+        input: &[u8],
+        output: &mut [u8],
+        estimate: Self::DecodeEstimate,
+    ) -> Result<DecodeMetadata, DecodeSliceError> {
+        let complete_nonterminal_quads_len = general_purpose::decode::complete_quads_len(
+            input,
+            estimate.rem,
+            output.len(),
+            &self.decode_table,
+        )?;
+
+        const BOTTOM_BYTE: u32 = 0xFF;
+
+        for (chunk_index, chunk) in input[..complete_nonterminal_quads_len]
+            .chunks_exact(4)
+            .enumerate()
+        {
+            let input_index = chunk_index * 4;
+            let output_index = chunk_index * 3;
+
+            let decoded_int: u32 = self.decode_byte_into_u32(input_index, chunk[0])?.shl(18)
+                | self
+                    .decode_byte_into_u32(input_index + 1, chunk[1])?
+                    .shl(12)
+                | self.decode_byte_into_u32(input_index + 2, chunk[2])?.shl(6)
+                | self.decode_byte_into_u32(input_index + 3, chunk[3])?;
+
+            output[output_index] = decoded_int.shr(16_u8).bitand(BOTTOM_BYTE) as u8;
+            output[output_index + 1] = decoded_int.shr(8_u8).bitand(BOTTOM_BYTE) as u8;
+            output[output_index + 2] = decoded_int.bitand(BOTTOM_BYTE) as u8;
+        }
+
+        general_purpose::decode_suffix::decode_suffix(
+            input,
+            complete_nonterminal_quads_len,
+            output,
+            complete_nonterminal_quads_len / 4 * 3,
+            &self.decode_table,
+            self.config.decode_allow_trailing_bits,
+            self.config.decode_padding_mode,
+        )
+    }
+
+    fn config(&self) -> &Self::Config {
+        &self.config
+    }
+}
+
+pub struct NaiveEstimate {
+    /// remainder from dividing input by `Naive::DECODE_CHUNK_SIZE`
+    rem: usize,
+    /// Length of input that is in complete `Naive::DECODE_CHUNK_SIZE`-length chunks
+    complete_chunk_len: usize,
+}
+
+impl NaiveEstimate {
+    fn new(input_len: usize) -> Self {
+        let rem = input_len % Naive::DECODE_INPUT_CHUNK_SIZE;
+        let complete_chunk_len = input_len - rem;
+
+        Self {
+            rem,
+            complete_chunk_len,
+        }
+    }
+}
+
+impl DecodeEstimate for NaiveEstimate {
+    fn decoded_len_estimate(&self) -> usize {
+        ((self.complete_chunk_len / 4) + ((self.rem > 0) as usize)) * 3
+    }
+}
+
+#[derive(Clone, Copy, Debug)]
+pub struct NaiveConfig {
+    pub encode_padding: bool,
+    pub decode_allow_trailing_bits: bool,
+    pub decode_padding_mode: DecodePaddingMode,
+}
+
+impl Config for NaiveConfig {
+    fn encode_padding(&self) -> bool {
+        self.encode_padding
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/base64/src/engine/tests.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/engine/tests.rs
--- 43.0.0-1/rust-vendor/base64/src/engine/tests.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/engine/tests.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1579 @@
+// rstest_reuse template functions have unused variables
+#![allow(unused_variables)]
+
+use rand::{
+    self,
+    distributions::{self, Distribution as _},
+    rngs, Rng as _, SeedableRng as _,
+};
+use rstest::rstest;
+use rstest_reuse::{apply, template};
+use std::{collections, fmt, io::Read as _};
+
+use crate::{
+    alphabet::{Alphabet, STANDARD},
+    encode::add_padding,
+    encoded_len,
+    engine::{
+        general_purpose, naive, Config, DecodeEstimate, DecodeMetadata, DecodePaddingMode, Engine,
+    },
+    read::DecoderReader,
+    tests::{assert_encode_sanity, random_alphabet, random_config},
+    DecodeError, DecodeSliceError, PAD_BYTE,
+};
+
+// the case::foo syntax includes the "foo" in the generated test method names
+#[template]
+#[rstest(engine_wrapper,
+case::general_purpose(GeneralPurposeWrapper {}),
+case::naive(NaiveWrapper {}),
+case::decoder_reader(DecoderReaderEngineWrapper {}),
+)]
+fn all_engines<E: EngineWrapper>(engine_wrapper: E) {}
+
+/// Some decode tests don't make sense for use with `DecoderReader` as they are difficult to
+/// reason about or otherwise inapplicable given how DecoderReader slice up its input along
+/// chunk boundaries.
+#[template]
+#[rstest(engine_wrapper,
+case::general_purpose(GeneralPurposeWrapper {}),
+case::naive(NaiveWrapper {}),
+)]
+fn all_engines_except_decoder_reader<E: EngineWrapper>(engine_wrapper: E) {}
+
+#[apply(all_engines)]
+fn rfc_test_vectors_std_alphabet<E: EngineWrapper>(engine_wrapper: E) {
+    let data = vec![
+        ("", ""),
+        ("f", "Zg=="),
+        ("fo", "Zm8="),
+        ("foo", "Zm9v"),
+        ("foob", "Zm9vYg=="),
+        ("fooba", "Zm9vYmE="),
+        ("foobar", "Zm9vYmFy"),
+    ];
+
+    let engine = E::standard();
+    let engine_no_padding = E::standard_unpadded();
+
+    for (orig, encoded) in &data {
+        let encoded_without_padding = encoded.trim_end_matches('=');
+
+        // unpadded
+        {
+            let mut encode_buf = [0_u8; 8];
+            let mut decode_buf = [0_u8; 6];
+
+            let encode_len =
+                engine_no_padding.internal_encode(orig.as_bytes(), &mut encode_buf[..]);
+            assert_eq!(
+                &encoded_without_padding,
+                &std::str::from_utf8(&encode_buf[0..encode_len]).unwrap()
+            );
+            let decode_len = engine_no_padding
+                .decode_slice_unchecked(encoded_without_padding.as_bytes(), &mut decode_buf[..])
+                .unwrap();
+            assert_eq!(orig.len(), decode_len);
+
+            assert_eq!(
+                orig,
+                &std::str::from_utf8(&decode_buf[0..decode_len]).unwrap()
+            );
+
+            // if there was any padding originally, the no padding engine won't decode it
+            if encoded.as_bytes().contains(&PAD_BYTE) {
+                assert_eq!(
+                    Err(DecodeError::InvalidPadding),
+                    engine_no_padding.decode(encoded)
+                )
+            }
+        }
+
+        // padded
+        {
+            let mut encode_buf = [0_u8; 8];
+            let mut decode_buf = [0_u8; 6];
+
+            let encode_len = engine.internal_encode(orig.as_bytes(), &mut encode_buf[..]);
+            assert_eq!(
+                // doesn't have padding added yet
+                &encoded_without_padding,
+                &std::str::from_utf8(&encode_buf[0..encode_len]).unwrap()
+            );
+            let pad_len = add_padding(encode_len, &mut encode_buf[encode_len..]);
+            assert_eq!(encoded.as_bytes(), &encode_buf[..encode_len + pad_len]);
+
+            let decode_len = engine
+                .decode_slice_unchecked(encoded.as_bytes(), &mut decode_buf[..])
+                .unwrap();
+            assert_eq!(orig.len(), decode_len);
+
+            assert_eq!(
+                orig,
+                &std::str::from_utf8(&decode_buf[0..decode_len]).unwrap()
+            );
+
+            // if there was (canonical) padding, and we remove it, the standard engine won't decode
+            if encoded.as_bytes().contains(&PAD_BYTE) {
+                assert_eq!(
+                    Err(DecodeError::InvalidPadding),
+                    engine.decode(encoded_without_padding)
+                )
+            }
+        }
+    }
+}
+
+#[apply(all_engines)]
+fn roundtrip_random<E: EngineWrapper>(engine_wrapper: E) {
+    let mut rng = seeded_rng();
+
+    let mut orig_data = Vec::<u8>::new();
+    let mut encode_buf = Vec::<u8>::new();
+    let mut decode_buf = Vec::<u8>::new();
+
+    let len_range = distributions::Uniform::new(1, 1_000);
+
+    for _ in 0..10_000 {
+        let engine = E::random(&mut rng);
+
+        orig_data.clear();
+        encode_buf.clear();
+        decode_buf.clear();
+
+        let (orig_len, _, encoded_len) = generate_random_encoded_data(
+            &engine,
+            &mut orig_data,
+            &mut encode_buf,
+            &mut rng,
+            &len_range,
+        );
+
+        // exactly the right size
+        decode_buf.resize(orig_len, 0);
+
+        let dec_len = engine
+            .decode_slice_unchecked(&encode_buf[0..encoded_len], &mut decode_buf[..])
+            .unwrap();
+
+        assert_eq!(orig_len, dec_len);
+        assert_eq!(&orig_data[..], &decode_buf[..dec_len]);
+    }
+}
+
+#[apply(all_engines)]
+fn encode_doesnt_write_extra_bytes<E: EngineWrapper>(engine_wrapper: E) {
+    let mut rng = seeded_rng();
+
+    let mut orig_data = Vec::<u8>::new();
+    let mut encode_buf = Vec::<u8>::new();
+    let mut encode_buf_backup = Vec::<u8>::new();
+
+    let input_len_range = distributions::Uniform::new(0, 1000);
+
+    for _ in 0..10_000 {
+        let engine = E::random(&mut rng);
+        let padded = engine.config().encode_padding();
+
+        orig_data.clear();
+        encode_buf.clear();
+        encode_buf_backup.clear();
+
+        let orig_len = fill_rand(&mut orig_data, &mut rng, &input_len_range);
+
+        let prefix_len = 1024;
+        // plenty of prefix and suffix
+        fill_rand_len(&mut encode_buf, &mut rng, prefix_len * 2 + orig_len * 2);
+        encode_buf_backup.extend_from_slice(&encode_buf[..]);
+
+        let expected_encode_len_no_pad = encoded_len(orig_len, false).unwrap();
+
+        let encoded_len_no_pad =
+            engine.internal_encode(&orig_data[..], &mut encode_buf[prefix_len..]);
+        assert_eq!(expected_encode_len_no_pad, encoded_len_no_pad);
+
+        // no writes past what it claimed to write
+        assert_eq!(&encode_buf_backup[..prefix_len], &encode_buf[..prefix_len]);
+        assert_eq!(
+            &encode_buf_backup[(prefix_len + encoded_len_no_pad)..],
+            &encode_buf[(prefix_len + encoded_len_no_pad)..]
+        );
+
+        let encoded_data = &encode_buf[prefix_len..(prefix_len + encoded_len_no_pad)];
+        assert_encode_sanity(
+            std::str::from_utf8(encoded_data).unwrap(),
+            // engines don't pad
+            false,
+            orig_len,
+        );
+
+        // pad so we can decode it in case our random engine requires padding
+        let pad_len = if padded {
+            add_padding(
+                encoded_len_no_pad,
+                &mut encode_buf[prefix_len + encoded_len_no_pad..],
+            )
+        } else {
+            0
+        };
+
+        assert_eq!(
+            orig_data,
+            engine
+                .decode(&encode_buf[prefix_len..(prefix_len + encoded_len_no_pad + pad_len)],)
+                .unwrap()
+        );
+    }
+}
+
+#[apply(all_engines)]
+fn encode_engine_slice_fits_into_precisely_sized_slice<E: EngineWrapper>(engine_wrapper: E) {
+    let mut orig_data = Vec::new();
+    let mut encoded_data = Vec::new();
+    let mut decoded = Vec::new();
+
+    let input_len_range = distributions::Uniform::new(0, 1000);
+
+    let mut rng = rngs::SmallRng::from_entropy();
+
+    for _ in 0..10_000 {
+        orig_data.clear();
+        encoded_data.clear();
+        decoded.clear();
+
+        let input_len = input_len_range.sample(&mut rng);
+
+        for _ in 0..input_len {
+            orig_data.push(rng.gen());
+        }
+
+        let engine = E::random(&mut rng);
+
+        let encoded_size = encoded_len(input_len, engine.config().encode_padding()).unwrap();
+
+        encoded_data.resize(encoded_size, 0);
+
+        assert_eq!(
+            encoded_size,
+            engine.encode_slice(&orig_data, &mut encoded_data).unwrap()
+        );
+
+        assert_encode_sanity(
+            std::str::from_utf8(&encoded_data[0..encoded_size]).unwrap(),
+            engine.config().encode_padding(),
+            input_len,
+        );
+
+        engine
+            .decode_vec(&encoded_data[0..encoded_size], &mut decoded)
+            .unwrap();
+        assert_eq!(orig_data, decoded);
+    }
+}
+
+#[apply(all_engines)]
+fn decode_doesnt_write_extra_bytes<E>(engine_wrapper: E)
+where
+    E: EngineWrapper,
+    <<E as EngineWrapper>::Engine as Engine>::Config: fmt::Debug,
+{
+    let mut rng = seeded_rng();
+
+    let mut orig_data = Vec::<u8>::new();
+    let mut encode_buf = Vec::<u8>::new();
+    let mut decode_buf = Vec::<u8>::new();
+    let mut decode_buf_backup = Vec::<u8>::new();
+
+    let len_range = distributions::Uniform::new(1, 1_000);
+
+    for _ in 0..10_000 {
+        let engine = E::random(&mut rng);
+
+        orig_data.clear();
+        encode_buf.clear();
+        decode_buf.clear();
+        decode_buf_backup.clear();
+
+        let orig_len = fill_rand(&mut orig_data, &mut rng, &len_range);
+        encode_buf.resize(orig_len * 2 + 100, 0);
+
+        let encoded_len = engine
+            .encode_slice(&orig_data[..], &mut encode_buf[..])
+            .unwrap();
+        encode_buf.truncate(encoded_len);
+
+        // oversize decode buffer so we can easily tell if it writes anything more than
+        // just the decoded data
+        let prefix_len = 1024;
+        // plenty of prefix and suffix
+        fill_rand_len(&mut decode_buf, &mut rng, prefix_len * 2 + orig_len * 2);
+        decode_buf_backup.extend_from_slice(&decode_buf[..]);
+
+        let dec_len = engine
+            .decode_slice_unchecked(&encode_buf, &mut decode_buf[prefix_len..])
+            .unwrap();
+
+        assert_eq!(orig_len, dec_len);
+        assert_eq!(
+            &orig_data[..],
+            &decode_buf[prefix_len..prefix_len + dec_len]
+        );
+        assert_eq!(&decode_buf_backup[..prefix_len], &decode_buf[..prefix_len]);
+        assert_eq!(
+            &decode_buf_backup[prefix_len + dec_len..],
+            &decode_buf[prefix_len + dec_len..]
+        );
+    }
+}
+
+#[apply(all_engines)]
+fn decode_detect_invalid_last_symbol<E: EngineWrapper>(engine_wrapper: E) {
+    // 0xFF -> "/w==", so all letters > w, 0-9, and '+', '/' should get InvalidLastSymbol
+    let engine = E::standard();
+
+    assert_eq!(Ok(vec![0x89, 0x85]), engine.decode("iYU="));
+    assert_eq!(Ok(vec![0xFF]), engine.decode("/w=="));
+
+    for (suffix, offset) in vec![
+        // suffix, offset of bad byte from start of suffix
+        ("/x==", 1_usize),
+        ("/z==", 1_usize),
+        ("/0==", 1_usize),
+        ("/9==", 1_usize),
+        ("/+==", 1_usize),
+        ("//==", 1_usize),
+        // trailing 01
+        ("iYV=", 2_usize),
+        // trailing 10
+        ("iYW=", 2_usize),
+        // trailing 11
+        ("iYX=", 2_usize),
+    ] {
+        for prefix_quads in 0..256 {
+            let mut encoded = "AAAA".repeat(prefix_quads);
+            encoded.push_str(suffix);
+
+            assert_eq!(
+                Err(DecodeError::InvalidLastSymbol(
+                    encoded.len() - 4 + offset,
+                    suffix.as_bytes()[offset],
+                )),
+                engine.decode(encoded.as_str())
+            );
+        }
+    }
+}
+
+#[apply(all_engines)]
+fn decode_detect_1_valid_symbol_in_last_quad_invalid_length<E: EngineWrapper>(engine_wrapper: E) {
+    for len in (0_usize..256).map(|len| len * 4 + 1) {
+        for mode in all_pad_modes() {
+            let mut input = vec![b'A'; len];
+
+            let engine = E::standard_with_pad_mode(true, mode);
+
+            assert_eq!(Err(DecodeError::InvalidLength(len)), engine.decode(&input));
+            // if we add padding, then the first pad byte in the quad is invalid because it should
+            // be the second symbol
+            for _ in 0..3 {
+                input.push(PAD_BYTE);
+                assert_eq!(
+                    Err(DecodeError::InvalidByte(len, PAD_BYTE)),
+                    engine.decode(&input)
+                );
+            }
+        }
+    }
+}
+
+#[apply(all_engines)]
+fn decode_detect_1_invalid_byte_in_last_quad_invalid_byte<E: EngineWrapper>(engine_wrapper: E) {
+    for prefix_len in (0_usize..256).map(|len| len * 4) {
+        for mode in all_pad_modes() {
+            let mut input = vec![b'A'; prefix_len];
+            input.push(b'*');
+
+            let engine = E::standard_with_pad_mode(true, mode);
+
+            assert_eq!(
+                Err(DecodeError::InvalidByte(prefix_len, b'*')),
+                engine.decode(&input)
+            );
+            // adding padding doesn't matter
+            for _ in 0..3 {
+                input.push(PAD_BYTE);
+                assert_eq!(
+                    Err(DecodeError::InvalidByte(prefix_len, b'*')),
+                    engine.decode(&input)
+                );
+            }
+        }
+    }
+}
+
+#[apply(all_engines)]
+fn decode_detect_invalid_last_symbol_every_possible_two_symbols<E: EngineWrapper>(
+    engine_wrapper: E,
+) {
+    let engine = E::standard();
+
+    let mut base64_to_bytes = collections::HashMap::new();
+
+    for b in 0_u8..=255 {
+        let mut b64 = vec![0_u8; 4];
+        assert_eq!(2, engine.internal_encode(&[b], &mut b64[..]));
+        let _ = add_padding(2, &mut b64[2..]);
+
+        assert!(base64_to_bytes.insert(b64, vec![b]).is_none());
+    }
+
+    // every possible combination of trailing symbols must either decode to 1 byte or get InvalidLastSymbol, with or without any leading chunks
+
+    let mut prefix = Vec::new();
+    for _ in 0..256 {
+        let mut clone = prefix.clone();
+
+        let mut symbols = [0_u8; 4];
+        for &s1 in STANDARD.symbols.iter() {
+            symbols[0] = s1;
+            for &s2 in STANDARD.symbols.iter() {
+                symbols[1] = s2;
+                symbols[2] = PAD_BYTE;
+                symbols[3] = PAD_BYTE;
+
+                // chop off previous symbols
+                clone.truncate(prefix.len());
+                clone.extend_from_slice(&symbols[..]);
+                let decoded_prefix_len = prefix.len() / 4 * 3;
+
+                match base64_to_bytes.get(&symbols[..]) {
+                    Some(bytes) => {
+                        let res = engine
+                            .decode(&clone)
+                            // remove prefix
+                            .map(|decoded| decoded[decoded_prefix_len..].to_vec());
+
+                        assert_eq!(Ok(bytes.clone()), res);
+                    }
+                    None => assert_eq!(
+                        Err(DecodeError::InvalidLastSymbol(1, s2)),
+                        engine.decode(&symbols[..])
+                    ),
+                }
+            }
+        }
+
+        prefix.extend_from_slice(b"AAAA");
+    }
+}
+
+#[apply(all_engines)]
+fn decode_detect_invalid_last_symbol_every_possible_three_symbols<E: EngineWrapper>(
+    engine_wrapper: E,
+) {
+    let engine = E::standard();
+
+    let mut base64_to_bytes = collections::HashMap::new();
+
+    let mut bytes = [0_u8; 2];
+    for b1 in 0_u8..=255 {
+        bytes[0] = b1;
+        for b2 in 0_u8..=255 {
+            bytes[1] = b2;
+            let mut b64 = vec![0_u8; 4];
+            assert_eq!(3, engine.internal_encode(&bytes, &mut b64[..]));
+            let _ = add_padding(3, &mut b64[3..]);
+
+            let mut v = Vec::with_capacity(2);
+            v.extend_from_slice(&bytes[..]);
+
+            assert!(base64_to_bytes.insert(b64, v).is_none());
+        }
+    }
+
+    // every possible combination of symbols must either decode to 2 bytes or get InvalidLastSymbol, with or without any leading chunks
+
+    let mut prefix = Vec::new();
+    let mut input = Vec::new();
+    for _ in 0..256 {
+        input.clear();
+        input.extend_from_slice(&prefix);
+
+        let mut symbols = [0_u8; 4];
+        for &s1 in STANDARD.symbols.iter() {
+            symbols[0] = s1;
+            for &s2 in STANDARD.symbols.iter() {
+                symbols[1] = s2;
+                for &s3 in STANDARD.symbols.iter() {
+                    symbols[2] = s3;
+                    symbols[3] = PAD_BYTE;
+
+                    // chop off previous symbols
+                    input.truncate(prefix.len());
+                    input.extend_from_slice(&symbols[..]);
+                    let decoded_prefix_len = prefix.len() / 4 * 3;
+
+                    match base64_to_bytes.get(&symbols[..]) {
+                        Some(bytes) => {
+                            let res = engine
+                                .decode(&input)
+                                // remove prefix
+                                .map(|decoded| decoded[decoded_prefix_len..].to_vec());
+
+                            assert_eq!(Ok(bytes.clone()), res);
+                        }
+                        None => assert_eq!(
+                            Err(DecodeError::InvalidLastSymbol(2, s3)),
+                            engine.decode(&symbols[..])
+                        ),
+                    }
+                }
+            }
+        }
+        prefix.extend_from_slice(b"AAAA");
+    }
+}
+
+#[apply(all_engines)]
+fn decode_invalid_trailing_bits_ignored_when_configured<E: EngineWrapper>(engine_wrapper: E) {
+    let strict = E::standard();
+    let forgiving = E::standard_allow_trailing_bits();
+
+    fn assert_tolerant_decode<E: Engine>(
+        engine: &E,
+        input: &mut String,
+        b64_prefix_len: usize,
+        expected_decode_bytes: Vec<u8>,
+        data: &str,
+    ) {
+        let prefixed = prefixed_data(input, b64_prefix_len, data);
+        let decoded = engine.decode(prefixed);
+        // prefix is always complete chunks
+        let decoded_prefix_len = b64_prefix_len / 4 * 3;
+        assert_eq!(
+            Ok(expected_decode_bytes),
+            decoded.map(|v| v[decoded_prefix_len..].to_vec())
+        );
+    }
+
+    let mut prefix = String::new();
+    for _ in 0..256 {
+        let mut input = prefix.clone();
+
+        // example from https://github.com/marshallpierce/rust-base64/issues/75
+        assert!(strict
+            .decode(prefixed_data(&mut input, prefix.len(), "/w=="))
+            .is_ok());
+        assert!(strict
+            .decode(prefixed_data(&mut input, prefix.len(), "iYU="))
+            .is_ok());
+        // trailing 01
+        assert_tolerant_decode(&forgiving, &mut input, prefix.len(), vec![255], "/x==");
+        assert_tolerant_decode(&forgiving, &mut input, prefix.len(), vec![137, 133], "iYV=");
+        // trailing 10
+        assert_tolerant_decode(&forgiving, &mut input, prefix.len(), vec![255], "/y==");
+        assert_tolerant_decode(&forgiving, &mut input, prefix.len(), vec![137, 133], "iYW=");
+        // trailing 11
+        assert_tolerant_decode(&forgiving, &mut input, prefix.len(), vec![255], "/z==");
+        assert_tolerant_decode(&forgiving, &mut input, prefix.len(), vec![137, 133], "iYX=");
+
+        prefix.push_str("AAAA");
+    }
+}
+
+#[apply(all_engines)]
+fn decode_invalid_byte_error<E: EngineWrapper>(engine_wrapper: E) {
+    let mut rng = seeded_rng();
+
+    let mut orig_data = Vec::<u8>::new();
+    let mut encode_buf = Vec::<u8>::new();
+    let mut decode_buf = Vec::<u8>::new();
+
+    let len_range = distributions::Uniform::new(1, 1_000);
+
+    for _ in 0..100_000 {
+        let alphabet = random_alphabet(&mut rng);
+        let engine = E::random_alphabet(&mut rng, alphabet);
+
+        orig_data.clear();
+        encode_buf.clear();
+        decode_buf.clear();
+
+        let (orig_len, encoded_len_just_data, encoded_len_with_padding) =
+            generate_random_encoded_data(
+                &engine,
+                &mut orig_data,
+                &mut encode_buf,
+                &mut rng,
+                &len_range,
+            );
+
+        // exactly the right size
+        decode_buf.resize(orig_len, 0);
+
+        // replace one encoded byte with an invalid byte
+        let invalid_byte: u8 = loop {
+            let byte: u8 = rng.gen();
+
+            if alphabet.symbols.contains(&byte) || byte == PAD_BYTE {
+                continue;
+            } else {
+                break byte;
+            }
+        };
+
+        let invalid_range = distributions::Uniform::new(0, orig_len);
+        let invalid_index = invalid_range.sample(&mut rng);
+        encode_buf[invalid_index] = invalid_byte;
+
+        assert_eq!(
+            Err(DecodeError::InvalidByte(invalid_index, invalid_byte)),
+            engine.decode_slice_unchecked(
+                &encode_buf[0..encoded_len_with_padding],
+                &mut decode_buf[..],
+            )
+        );
+    }
+}
+
+/// Any amount of padding anywhere before the final non padding character = invalid byte at first
+/// pad byte.
+/// From this and [decode_padding_before_final_non_padding_char_error_invalid_byte_at_first_pad_non_canonical_padding_suffix_all_modes],
+/// we know padding must extend contiguously to the end of the input.
+#[apply(all_engines)]
+fn decode_padding_before_final_non_padding_char_error_invalid_byte_at_first_pad_all_modes<
+    E: EngineWrapper,
+>(
+    engine_wrapper: E,
+) {
+    // Different amounts of padding, w/ offset from end for the last non-padding char.
+    // Only canonical padding, so Canonical mode will work.
+    let suffixes = &[("AA==", 2), ("AAA=", 1), ("AAAA", 0)];
+
+    for mode in pad_modes_allowing_padding() {
+        // We don't encode, so we don't care about encode padding.
+        let engine = E::standard_with_pad_mode(true, mode);
+
+        decode_padding_before_final_non_padding_char_error_invalid_byte_at_first_pad(
+            engine,
+            suffixes.as_slice(),
+        );
+    }
+}
+
+/// See [decode_padding_before_final_non_padding_char_error_invalid_byte_at_first_pad_all_modes]
+#[apply(all_engines)]
+fn decode_padding_before_final_non_padding_char_error_invalid_byte_at_first_pad_non_canonical_padding_suffix<
+    E: EngineWrapper,
+>(
+    engine_wrapper: E,
+) {
+    // Different amounts of padding, w/ offset from end for the last non-padding char, and
+    // non-canonical padding.
+    let suffixes = [
+        ("AA==", 2),
+        ("AA=", 1),
+        ("AA", 0),
+        ("AAA=", 1),
+        ("AAA", 0),
+        ("AAAA", 0),
+    ];
+
+    // We don't encode, so we don't care about encode padding.
+    // Decoding is indifferent so that we don't get caught by missing padding on the last quad
+    let engine = E::standard_with_pad_mode(true, DecodePaddingMode::Indifferent);
+
+    decode_padding_before_final_non_padding_char_error_invalid_byte_at_first_pad(
+        engine,
+        suffixes.as_slice(),
+    )
+}
+
+fn decode_padding_before_final_non_padding_char_error_invalid_byte_at_first_pad(
+    engine: impl Engine,
+    suffixes: &[(&str, usize)],
+) {
+    let mut rng = seeded_rng();
+
+    let prefix_quads_range = distributions::Uniform::from(0..=256);
+
+    for _ in 0..100_000 {
+        for (suffix, suffix_offset) in suffixes.iter() {
+            let mut s = "AAAA".repeat(prefix_quads_range.sample(&mut rng));
+            s.push_str(suffix);
+            let mut encoded = s.into_bytes();
+
+            // calculate a range to write padding into that leaves at least one non padding char
+            let last_non_padding_offset = encoded.len() - 1 - suffix_offset;
+
+            // don't include last non padding char as it must stay not padding
+            let padding_end = rng.gen_range(0..last_non_padding_offset);
+
+            // don't use more than 100 bytes of padding, but also use shorter lengths when
+            // padding_end is near the start of the encoded data to avoid biasing to padding
+            // the entire prefix on short lengths
+            let padding_len = rng.gen_range(1..=usize::min(100, padding_end + 1));
+            let padding_start = padding_end.saturating_sub(padding_len);
+
+            encoded[padding_start..=padding_end].fill(PAD_BYTE);
+
+            // should still have non-padding before any final padding
+            assert_ne!(PAD_BYTE, encoded[last_non_padding_offset]);
+            assert_eq!(
+                Err(DecodeError::InvalidByte(padding_start, PAD_BYTE)),
+                engine.decode(&encoded),
+                "len: {}, input: {}",
+                encoded.len(),
+                String::from_utf8(encoded).unwrap()
+            );
+        }
+    }
+}
+
+/// Any amount of padding before final chunk that crosses over into final chunk with 1-4 bytes =
+/// invalid byte at first pad byte.
+/// From this we know the padding must start in the final chunk.
+#[apply(all_engines)]
+fn decode_padding_starts_before_final_chunk_error_invalid_byte_at_first_pad<E: EngineWrapper>(
+    engine_wrapper: E,
+) {
+    let mut rng = seeded_rng();
+
+    // must have at least one prefix quad
+    let prefix_quads_range = distributions::Uniform::from(1..256);
+    let suffix_pad_len_range = distributions::Uniform::from(1..=4);
+    // don't use no-padding mode, as the reader decode might decode a block that ends with
+    // valid padding, which should then be referenced when encountering the later invalid byte
+    for mode in pad_modes_allowing_padding() {
+        // we don't encode so we don't care about encode padding
+        let engine = E::standard_with_pad_mode(true, mode);
+        for _ in 0..100_000 {
+            let suffix_len = suffix_pad_len_range.sample(&mut rng);
+            // all 0 bits so we don't hit InvalidLastSymbol with the reader decoder
+            let mut encoded = "AAAA"
+                .repeat(prefix_quads_range.sample(&mut rng))
+                .into_bytes();
+            encoded.resize(encoded.len() + suffix_len, PAD_BYTE);
+
+            // amount of padding must be long enough to extend back from suffix into previous
+            // quads
+            let padding_len = rng.gen_range(suffix_len + 1..encoded.len());
+            // no non-padding after padding in this test, so padding goes to the end
+            let padding_start = encoded.len() - padding_len;
+            encoded[padding_start..].fill(PAD_BYTE);
+
+            assert_eq!(
+                Err(DecodeError::InvalidByte(padding_start, PAD_BYTE)),
+                engine.decode(&encoded),
+                "suffix_len: {}, padding_len: {}, b64: {}",
+                suffix_len,
+                padding_len,
+                std::str::from_utf8(&encoded).unwrap()
+            );
+        }
+    }
+}
+
+/// 0-1 bytes of data before any amount of padding in final chunk = invalid byte, since padding
+/// is not valid data (consistent with error for pad bytes in earlier chunks).
+/// From this we know there must be 2-3 bytes of data before padding
+#[apply(all_engines)]
+fn decode_too_little_data_before_padding_error_invalid_byte<E: EngineWrapper>(engine_wrapper: E) {
+    let mut rng = seeded_rng();
+
+    // want to test no prefix quad case, so start at 0
+    let prefix_quads_range = distributions::Uniform::from(0_usize..256);
+    let suffix_data_len_range = distributions::Uniform::from(0_usize..=1);
+    for mode in all_pad_modes() {
+        // we don't encode so we don't care about encode padding
+        let engine = E::standard_with_pad_mode(true, mode);
+        for _ in 0..100_000 {
+            let suffix_data_len = suffix_data_len_range.sample(&mut rng);
+            let prefix_quad_len = prefix_quads_range.sample(&mut rng);
+
+            // for all possible padding lengths
+            for padding_len in 1..=(4 - suffix_data_len) {
+                let mut encoded = "ABCD".repeat(prefix_quad_len).into_bytes();
+                encoded.resize(encoded.len() + suffix_data_len, b'A');
+                encoded.resize(encoded.len() + padding_len, PAD_BYTE);
+
+                assert_eq!(
+                    Err(DecodeError::InvalidByte(
+                        prefix_quad_len * 4 + suffix_data_len,
+                        PAD_BYTE,
+                    )),
+                    engine.decode(&encoded),
+                    "input {} suffix data len {} pad len {}",
+                    String::from_utf8(encoded).unwrap(),
+                    suffix_data_len,
+                    padding_len
+                );
+            }
+        }
+    }
+}
+
+// https://eprint.iacr.org/2022/361.pdf table 2, test 1
+#[apply(all_engines)]
+fn decode_malleability_test_case_3_byte_suffix_valid<E: EngineWrapper>(engine_wrapper: E) {
+    assert_eq!(
+        b"Hello".as_slice(),
+        &E::standard().decode("SGVsbG8=").unwrap()
+    );
+}
+
+// https://eprint.iacr.org/2022/361.pdf table 2, test 2
+#[apply(all_engines)]
+fn decode_malleability_test_case_3_byte_suffix_invalid_trailing_symbol<E: EngineWrapper>(
+    engine_wrapper: E,
+) {
+    assert_eq!(
+        DecodeError::InvalidLastSymbol(6, 0x39),
+        E::standard().decode("SGVsbG9=").unwrap_err()
+    );
+}
+
+// https://eprint.iacr.org/2022/361.pdf table 2, test 3
+#[apply(all_engines)]
+fn decode_malleability_test_case_3_byte_suffix_no_padding<E: EngineWrapper>(engine_wrapper: E) {
+    assert_eq!(
+        DecodeError::InvalidPadding,
+        E::standard().decode("SGVsbG9").unwrap_err()
+    );
+}
+
+// https://eprint.iacr.org/2022/361.pdf table 2, test 4
+#[apply(all_engines)]
+fn decode_malleability_test_case_2_byte_suffix_valid_two_padding_symbols<E: EngineWrapper>(
+    engine_wrapper: E,
+) {
+    assert_eq!(
+        b"Hell".as_slice(),
+        &E::standard().decode("SGVsbA==").unwrap()
+    );
+}
+
+// https://eprint.iacr.org/2022/361.pdf table 2, test 5
+#[apply(all_engines)]
+fn decode_malleability_test_case_2_byte_suffix_short_padding<E: EngineWrapper>(engine_wrapper: E) {
+    assert_eq!(
+        DecodeError::InvalidPadding,
+        E::standard().decode("SGVsbA=").unwrap_err()
+    );
+}
+
+// https://eprint.iacr.org/2022/361.pdf table 2, test 6
+#[apply(all_engines)]
+fn decode_malleability_test_case_2_byte_suffix_no_padding<E: EngineWrapper>(engine_wrapper: E) {
+    assert_eq!(
+        DecodeError::InvalidPadding,
+        E::standard().decode("SGVsbA").unwrap_err()
+    );
+}
+
+// https://eprint.iacr.org/2022/361.pdf table 2, test 7
+// DecoderReader pseudo-engine gets InvalidByte at 8 (extra padding) since it decodes the first
+// two complete quads correctly.
+#[apply(all_engines_except_decoder_reader)]
+fn decode_malleability_test_case_2_byte_suffix_too_much_padding<E: EngineWrapper>(
+    engine_wrapper: E,
+) {
+    assert_eq!(
+        DecodeError::InvalidByte(6, PAD_BYTE),
+        E::standard().decode("SGVsbA====").unwrap_err()
+    );
+}
+
+/// Requires canonical padding -> accepts 2 + 2, 3 + 1, 4 + 0 final quad configurations
+#[apply(all_engines)]
+fn decode_pad_mode_requires_canonical_accepts_canonical<E: EngineWrapper>(engine_wrapper: E) {
+    assert_all_suffixes_ok(
+        E::standard_with_pad_mode(true, DecodePaddingMode::RequireCanonical),
+        vec!["/w==", "iYU=", "AAAA"],
+    );
+}
+
+/// Requires canonical padding -> rejects 2 + 0-1, 3 + 0 final chunk configurations
+#[apply(all_engines)]
+fn decode_pad_mode_requires_canonical_rejects_non_canonical<E: EngineWrapper>(engine_wrapper: E) {
+    let engine = E::standard_with_pad_mode(true, DecodePaddingMode::RequireCanonical);
+
+    let suffixes = ["/w", "/w=", "iYU"];
+    for num_prefix_quads in 0..256 {
+        for &suffix in suffixes.iter() {
+            let mut encoded = "AAAA".repeat(num_prefix_quads);
+            encoded.push_str(suffix);
+
+            let res = engine.decode(&encoded);
+
+            assert_eq!(Err(DecodeError::InvalidPadding), res);
+        }
+    }
+}
+
+/// Requires no padding -> accepts 2 + 0, 3 + 0, 4 + 0 final chunk configuration
+#[apply(all_engines)]
+fn decode_pad_mode_requires_no_padding_accepts_no_padding<E: EngineWrapper>(engine_wrapper: E) {
+    assert_all_suffixes_ok(
+        E::standard_with_pad_mode(true, DecodePaddingMode::RequireNone),
+        vec!["/w", "iYU", "AAAA"],
+    );
+}
+
+/// Requires no padding -> rejects 2 + 1-2, 3 + 1 final chunk configuration
+#[apply(all_engines)]
+fn decode_pad_mode_requires_no_padding_rejects_any_padding<E: EngineWrapper>(engine_wrapper: E) {
+    let engine = E::standard_with_pad_mode(true, DecodePaddingMode::RequireNone);
+
+    let suffixes = ["/w=", "/w==", "iYU="];
+    for num_prefix_quads in 0..256 {
+        for &suffix in suffixes.iter() {
+            let mut encoded = "AAAA".repeat(num_prefix_quads);
+            encoded.push_str(suffix);
+
+            let res = engine.decode(&encoded);
+
+            assert_eq!(Err(DecodeError::InvalidPadding), res);
+        }
+    }
+}
+
+/// Indifferent padding accepts 2 + 0-2, 3 + 0-1, 4 + 0 final chunk configuration
+#[apply(all_engines)]
+fn decode_pad_mode_indifferent_padding_accepts_anything<E: EngineWrapper>(engine_wrapper: E) {
+    assert_all_suffixes_ok(
+        E::standard_with_pad_mode(true, DecodePaddingMode::Indifferent),
+        vec!["/w", "/w=", "/w==", "iYU", "iYU=", "AAAA"],
+    );
+}
+
+/// 1 trailing byte that's not padding is detected as invalid byte even though there's padding
+/// in the middle of the input. This is essentially mandating the eager check for 1 trailing byte
+/// to catch the \n suffix case.
+// DecoderReader pseudo-engine can't handle DecodePaddingMode::RequireNone since it will decode
+// a complete quad with padding in it before encountering the stray byte that makes it an invalid
+// length
+#[apply(all_engines_except_decoder_reader)]
+fn decode_invalid_trailing_bytes_all_pad_modes_invalid_byte<E: EngineWrapper>(engine_wrapper: E) {
+    for mode in all_pad_modes() {
+        do_invalid_trailing_byte(E::standard_with_pad_mode(true, mode), mode);
+    }
+}
+
+#[apply(all_engines)]
+fn decode_invalid_trailing_bytes_invalid_byte<E: EngineWrapper>(engine_wrapper: E) {
+    // excluding no padding mode because the DecoderWrapper pseudo-engine will fail with
+    // InvalidPadding because it will decode the last complete quad with padding first
+    for mode in pad_modes_allowing_padding() {
+        do_invalid_trailing_byte(E::standard_with_pad_mode(true, mode), mode);
+    }
+}
+fn do_invalid_trailing_byte(engine: impl Engine, mode: DecodePaddingMode) {
+    for last_byte in [b'*', b'\n'] {
+        for num_prefix_quads in 0..256 {
+            let mut s: String = "ABCD".repeat(num_prefix_quads);
+            s.push_str("Cg==");
+            let mut input = s.into_bytes();
+            input.push(last_byte);
+
+            // The case of trailing newlines is common enough to warrant a test for a good error
+            // message.
+            assert_eq!(
+                Err(DecodeError::InvalidByte(
+                    num_prefix_quads * 4 + 4,
+                    last_byte
+                )),
+                engine.decode(&input),
+                "mode: {:?}, input: {}",
+                mode,
+                String::from_utf8(input).unwrap()
+            );
+        }
+    }
+}
+
+/// When there's 1 trailing byte, but it's padding, it's only InvalidByte if there isn't padding
+/// earlier.
+#[apply(all_engines)]
+fn decode_invalid_trailing_padding_as_invalid_byte_at_first_pad_byte<E: EngineWrapper>(
+    engine_wrapper: E,
+) {
+    // excluding no padding mode because the DecoderWrapper pseudo-engine will fail with
+    // InvalidPadding because it will decode the last complete quad with padding first
+    for mode in pad_modes_allowing_padding() {
+        do_invalid_trailing_padding_as_invalid_byte_at_first_padding(
+            E::standard_with_pad_mode(true, mode),
+            mode,
+        );
+    }
+}
+
+// DecoderReader pseudo-engine can't handle DecodePaddingMode::RequireNone since it will decode
+// a complete quad with padding in it before encountering the stray byte that makes it an invalid
+// length
+#[apply(all_engines_except_decoder_reader)]
+fn decode_invalid_trailing_padding_as_invalid_byte_at_first_byte_all_modes<E: EngineWrapper>(
+    engine_wrapper: E,
+) {
+    for mode in all_pad_modes() {
+        do_invalid_trailing_padding_as_invalid_byte_at_first_padding(
+            E::standard_with_pad_mode(true, mode),
+            mode,
+        );
+    }
+}
+fn do_invalid_trailing_padding_as_invalid_byte_at_first_padding(
+    engine: impl Engine,
+    mode: DecodePaddingMode,
+) {
+    for num_prefix_quads in 0..256 {
+        for (suffix, pad_offset) in [("AA===", 2), ("AAA==", 3), ("AAAA=", 4)] {
+            let mut s: String = "ABCD".repeat(num_prefix_quads);
+            s.push_str(suffix);
+
+            assert_eq!(
+                // pad after `g`, not the last one
+                Err(DecodeError::InvalidByte(
+                    num_prefix_quads * 4 + pad_offset,
+                    PAD_BYTE
+                )),
+                engine.decode(&s),
+                "mode: {:?}, input: {}",
+                mode,
+                s
+            );
+        }
+    }
+}
+
+#[apply(all_engines)]
+fn decode_into_slice_fits_in_precisely_sized_slice<E: EngineWrapper>(engine_wrapper: E) {
+    let mut orig_data = Vec::new();
+    let mut encoded_data = String::new();
+    let mut decode_buf = Vec::new();
+
+    let input_len_range = distributions::Uniform::new(0, 1000);
+    let mut rng = rngs::SmallRng::from_entropy();
+
+    for _ in 0..10_000 {
+        orig_data.clear();
+        encoded_data.clear();
+        decode_buf.clear();
+
+        let input_len = input_len_range.sample(&mut rng);
+
+        for _ in 0..input_len {
+            orig_data.push(rng.gen());
+        }
+
+        let engine = E::random(&mut rng);
+        engine.encode_string(&orig_data, &mut encoded_data);
+        assert_encode_sanity(&encoded_data, engine.config().encode_padding(), input_len);
+
+        decode_buf.resize(input_len, 0);
+        // decode into the non-empty buf
+        let decode_bytes_written = engine
+            .decode_slice_unchecked(encoded_data.as_bytes(), &mut decode_buf[..])
+            .unwrap();
+        assert_eq!(orig_data.len(), decode_bytes_written);
+        assert_eq!(orig_data, decode_buf);
+
+        // same for checked variant
+        decode_buf.clear();
+        decode_buf.resize(input_len, 0);
+        // decode into the non-empty buf
+        let decode_bytes_written = engine
+            .decode_slice(encoded_data.as_bytes(), &mut decode_buf[..])
+            .unwrap();
+        assert_eq!(orig_data.len(), decode_bytes_written);
+        assert_eq!(orig_data, decode_buf);
+    }
+}
+
+#[apply(all_engines)]
+fn inner_decode_reports_padding_position<E: EngineWrapper>(engine_wrapper: E) {
+    let mut b64 = String::new();
+    let mut decoded = Vec::new();
+    let engine = E::standard();
+
+    for pad_position in 1..10_000 {
+        b64.clear();
+        decoded.clear();
+        // plenty of room for original data
+        decoded.resize(pad_position, 0);
+
+        for _ in 0..pad_position {
+            b64.push('A');
+        }
+        // finish the quad with padding
+        for _ in 0..(4 - (pad_position % 4)) {
+            b64.push('=');
+        }
+
+        let decode_res = engine.internal_decode(
+            b64.as_bytes(),
+            &mut decoded[..],
+            engine.internal_decoded_len_estimate(b64.len()),
+        );
+        if pad_position % 4 < 2 {
+            // impossible padding
+            assert_eq!(
+                Err(DecodeSliceError::DecodeError(DecodeError::InvalidByte(
+                    pad_position,
+                    PAD_BYTE
+                ))),
+                decode_res
+            );
+        } else {
+            let decoded_bytes = pad_position / 4 * 3
+                + match pad_position % 4 {
+                    0 => 0,
+                    2 => 1,
+                    3 => 2,
+                    _ => unreachable!(),
+                };
+            assert_eq!(
+                Ok(DecodeMetadata::new(decoded_bytes, Some(pad_position))),
+                decode_res
+            );
+        }
+    }
+}
+
+#[apply(all_engines)]
+fn decode_length_estimate_delta<E: EngineWrapper>(engine_wrapper: E) {
+    for engine in [E::standard(), E::standard_unpadded()] {
+        for &padding in &[true, false] {
+            for orig_len in 0..1000 {
+                let encoded_len = encoded_len(orig_len, padding).unwrap();
+
+                let decoded_estimate = engine
+                    .internal_decoded_len_estimate(encoded_len)
+                    .decoded_len_estimate();
+                assert!(decoded_estimate >= orig_len);
+                assert!(
+                    decoded_estimate - orig_len < 3,
+                    "estimate: {}, encoded: {}, orig: {}",
+                    decoded_estimate,
+                    encoded_len,
+                    orig_len
+                );
+            }
+        }
+    }
+}
+
+#[apply(all_engines)]
+fn estimate_via_u128_inflation<E: EngineWrapper>(engine_wrapper: E) {
+    // cover both ends of usize
+    (0..1000)
+        .chain(usize::MAX - 1000..=usize::MAX)
+        .for_each(|encoded_len| {
+            // inflate to 128 bit type to be able to safely use the easy formulas
+            let len_128 = encoded_len as u128;
+
+            let estimate = E::standard()
+                .internal_decoded_len_estimate(encoded_len)
+                .decoded_len_estimate();
+
+            // This check is a little too strict: it requires using the (len + 3) / 4 * 3 formula
+            // or equivalent, but until other engines come along that use a different formula
+            // requiring that we think more carefully about what the allowable criteria are, this
+            // will do.
+            assert_eq!(
+                ((len_128 + 3) / 4 * 3) as usize,
+                estimate,
+                "enc len {}",
+                encoded_len
+            );
+        })
+}
+
+#[apply(all_engines)]
+fn decode_slice_checked_fails_gracefully_at_all_output_lengths<E: EngineWrapper>(
+    engine_wrapper: E,
+) {
+    let mut rng = seeded_rng();
+    for original_len in 0..1000 {
+        let mut original = vec![0; original_len];
+        rng.fill(&mut original[..]);
+
+        for mode in all_pad_modes() {
+            let engine = E::standard_with_pad_mode(
+                match mode {
+                    DecodePaddingMode::Indifferent | DecodePaddingMode::RequireCanonical => true,
+                    DecodePaddingMode::RequireNone => false,
+                },
+                mode,
+            );
+
+            let encoded = engine.encode(&original);
+            let mut decode_buf = Vec::with_capacity(original_len);
+            for decode_buf_len in 0..original_len {
+                decode_buf.resize(decode_buf_len, 0);
+                assert_eq!(
+                    DecodeSliceError::OutputSliceTooSmall,
+                    engine
+                        .decode_slice(&encoded, &mut decode_buf[..])
+                        .unwrap_err(),
+                    "original len: {}, encoded len: {}, buf len: {}, mode: {:?}",
+                    original_len,
+                    encoded.len(),
+                    decode_buf_len,
+                    mode
+                );
+                // internal method works the same
+                assert_eq!(
+                    DecodeSliceError::OutputSliceTooSmall,
+                    engine
+                        .internal_decode(
+                            encoded.as_bytes(),
+                            &mut decode_buf[..],
+                            engine.internal_decoded_len_estimate(encoded.len())
+                        )
+                        .unwrap_err()
+                );
+            }
+
+            decode_buf.resize(original_len, 0);
+            rng.fill(&mut decode_buf[..]);
+            assert_eq!(
+                original_len,
+                engine.decode_slice(&encoded, &mut decode_buf[..]).unwrap()
+            );
+            assert_eq!(original, decode_buf);
+        }
+    }
+}
+
+/// Returns a tuple of the original data length, the encoded data length (just data), and the length including padding.
+///
+/// Vecs provided should be empty.
+fn generate_random_encoded_data<E: Engine, R: rand::Rng, D: distributions::Distribution<usize>>(
+    engine: &E,
+    orig_data: &mut Vec<u8>,
+    encode_buf: &mut Vec<u8>,
+    rng: &mut R,
+    length_distribution: &D,
+) -> (usize, usize, usize) {
+    let padding: bool = engine.config().encode_padding();
+
+    let orig_len = fill_rand(orig_data, rng, length_distribution);
+    let expected_encoded_len = encoded_len(orig_len, padding).unwrap();
+    encode_buf.resize(expected_encoded_len, 0);
+
+    let base_encoded_len = engine.internal_encode(&orig_data[..], &mut encode_buf[..]);
+
+    let enc_len_with_padding = if padding {
+        base_encoded_len + add_padding(base_encoded_len, &mut encode_buf[base_encoded_len..])
+    } else {
+        base_encoded_len
+    };
+
+    assert_eq!(expected_encoded_len, enc_len_with_padding);
+
+    (orig_len, base_encoded_len, enc_len_with_padding)
+}
+
+// fill to a random length
+fn fill_rand<R: rand::Rng, D: distributions::Distribution<usize>>(
+    vec: &mut Vec<u8>,
+    rng: &mut R,
+    length_distribution: &D,
+) -> usize {
+    let len = length_distribution.sample(rng);
+    for _ in 0..len {
+        vec.push(rng.gen());
+    }
+
+    len
+}
+
+fn fill_rand_len<R: rand::Rng>(vec: &mut Vec<u8>, rng: &mut R, len: usize) {
+    for _ in 0..len {
+        vec.push(rng.gen());
+    }
+}
+
+fn prefixed_data<'i>(input_with_prefix: &'i mut String, prefix_len: usize, data: &str) -> &'i str {
+    input_with_prefix.truncate(prefix_len);
+    input_with_prefix.push_str(data);
+    input_with_prefix.as_str()
+}
+
+/// A wrapper to make using engines in rstest fixtures easier.
+/// The functions don't need to be instance methods, but rstest does seem
+/// to want an instance, so instances are passed to test functions and then ignored.
+trait EngineWrapper {
+    type Engine: Engine;
+
+    /// Return an engine configured for RFC standard base64
+    fn standard() -> Self::Engine;
+
+    /// Return an engine configured for RFC standard base64, except with no padding appended on
+    /// encode, and required no padding on decode.
+    fn standard_unpadded() -> Self::Engine;
+
+    /// Return an engine configured for RFC standard alphabet with the provided encode and decode
+    /// pad settings
+    fn standard_with_pad_mode(encode_pad: bool, decode_pad_mode: DecodePaddingMode)
+        -> Self::Engine;
+
+    /// Return an engine configured for RFC standard base64 that allows invalid trailing bits
+    fn standard_allow_trailing_bits() -> Self::Engine;
+
+    /// Return an engine configured with a randomized alphabet and config
+    fn random<R: rand::Rng>(rng: &mut R) -> Self::Engine;
+
+    /// Return an engine configured with the specified alphabet and randomized config
+    fn random_alphabet<R: rand::Rng>(rng: &mut R, alphabet: &Alphabet) -> Self::Engine;
+}
+
+struct GeneralPurposeWrapper {}
+
+impl EngineWrapper for GeneralPurposeWrapper {
+    type Engine = general_purpose::GeneralPurpose;
+
+    fn standard() -> Self::Engine {
+        general_purpose::GeneralPurpose::new(&STANDARD, general_purpose::PAD)
+    }
+
+    fn standard_unpadded() -> Self::Engine {
+        general_purpose::GeneralPurpose::new(&STANDARD, general_purpose::NO_PAD)
+    }
+
+    fn standard_with_pad_mode(
+        encode_pad: bool,
+        decode_pad_mode: DecodePaddingMode,
+    ) -> Self::Engine {
+        general_purpose::GeneralPurpose::new(
+            &STANDARD,
+            general_purpose::GeneralPurposeConfig::new()
+                .with_encode_padding(encode_pad)
+                .with_decode_padding_mode(decode_pad_mode),
+        )
+    }
+
+    fn standard_allow_trailing_bits() -> Self::Engine {
+        general_purpose::GeneralPurpose::new(
+            &STANDARD,
+            general_purpose::GeneralPurposeConfig::new().with_decode_allow_trailing_bits(true),
+        )
+    }
+
+    fn random<R: rand::Rng>(rng: &mut R) -> Self::Engine {
+        let alphabet = random_alphabet(rng);
+
+        Self::random_alphabet(rng, alphabet)
+    }
+
+    fn random_alphabet<R: rand::Rng>(rng: &mut R, alphabet: &Alphabet) -> Self::Engine {
+        general_purpose::GeneralPurpose::new(alphabet, random_config(rng))
+    }
+}
+
+struct NaiveWrapper {}
+
+impl EngineWrapper for NaiveWrapper {
+    type Engine = naive::Naive;
+
+    fn standard() -> Self::Engine {
+        naive::Naive::new(
+            &STANDARD,
+            naive::NaiveConfig {
+                encode_padding: true,
+                decode_allow_trailing_bits: false,
+                decode_padding_mode: DecodePaddingMode::RequireCanonical,
+            },
+        )
+    }
+
+    fn standard_unpadded() -> Self::Engine {
+        naive::Naive::new(
+            &STANDARD,
+            naive::NaiveConfig {
+                encode_padding: false,
+                decode_allow_trailing_bits: false,
+                decode_padding_mode: DecodePaddingMode::RequireNone,
+            },
+        )
+    }
+
+    fn standard_with_pad_mode(
+        encode_pad: bool,
+        decode_pad_mode: DecodePaddingMode,
+    ) -> Self::Engine {
+        naive::Naive::new(
+            &STANDARD,
+            naive::NaiveConfig {
+                encode_padding: encode_pad,
+                decode_allow_trailing_bits: false,
+                decode_padding_mode: decode_pad_mode,
+            },
+        )
+    }
+
+    fn standard_allow_trailing_bits() -> Self::Engine {
+        naive::Naive::new(
+            &STANDARD,
+            naive::NaiveConfig {
+                encode_padding: true,
+                decode_allow_trailing_bits: true,
+                decode_padding_mode: DecodePaddingMode::RequireCanonical,
+            },
+        )
+    }
+
+    fn random<R: rand::Rng>(rng: &mut R) -> Self::Engine {
+        let alphabet = random_alphabet(rng);
+
+        Self::random_alphabet(rng, alphabet)
+    }
+
+    fn random_alphabet<R: rand::Rng>(rng: &mut R, alphabet: &Alphabet) -> Self::Engine {
+        let mode = rng.gen();
+
+        let config = naive::NaiveConfig {
+            encode_padding: match mode {
+                DecodePaddingMode::Indifferent => rng.gen(),
+                DecodePaddingMode::RequireCanonical => true,
+                DecodePaddingMode::RequireNone => false,
+            },
+            decode_allow_trailing_bits: rng.gen(),
+            decode_padding_mode: mode,
+        };
+
+        naive::Naive::new(alphabet, config)
+    }
+}
+
+/// A pseudo-Engine that routes all decoding through [DecoderReader]
+struct DecoderReaderEngine<E: Engine> {
+    engine: E,
+}
+
+impl<E: Engine> From<E> for DecoderReaderEngine<E> {
+    fn from(value: E) -> Self {
+        Self { engine: value }
+    }
+}
+
+impl<E: Engine> Engine for DecoderReaderEngine<E> {
+    type Config = E::Config;
+    type DecodeEstimate = E::DecodeEstimate;
+
+    fn internal_encode(&self, input: &[u8], output: &mut [u8]) -> usize {
+        self.engine.internal_encode(input, output)
+    }
+
+    fn internal_decoded_len_estimate(&self, input_len: usize) -> Self::DecodeEstimate {
+        self.engine.internal_decoded_len_estimate(input_len)
+    }
+
+    fn internal_decode(
+        &self,
+        input: &[u8],
+        output: &mut [u8],
+        decode_estimate: Self::DecodeEstimate,
+    ) -> Result<DecodeMetadata, DecodeSliceError> {
+        let mut reader = DecoderReader::new(input, &self.engine);
+        let mut buf = vec![0; input.len()];
+        // to avoid effects like not detecting invalid length due to progressively growing
+        // the output buffer in read_to_end etc, read into a big enough buffer in one go
+        // to make behavior more consistent with normal engines
+        let _ = reader
+            .read(&mut buf)
+            .and_then(|len| {
+                buf.truncate(len);
+                // make sure we got everything
+                reader.read_to_end(&mut buf)
+            })
+            .map_err(|io_error| {
+                *io_error
+                    .into_inner()
+                    .and_then(|inner| inner.downcast::<DecodeError>().ok())
+                    .unwrap()
+            })?;
+        if output.len() < buf.len() {
+            return Err(DecodeSliceError::OutputSliceTooSmall);
+        }
+        output[..buf.len()].copy_from_slice(&buf);
+        Ok(DecodeMetadata::new(
+            buf.len(),
+            input
+                .iter()
+                .enumerate()
+                .filter(|(_offset, byte)| **byte == PAD_BYTE)
+                .map(|(offset, _byte)| offset)
+                .next(),
+        ))
+    }
+
+    fn config(&self) -> &Self::Config {
+        self.engine.config()
+    }
+}
+
+struct DecoderReaderEngineWrapper {}
+
+impl EngineWrapper for DecoderReaderEngineWrapper {
+    type Engine = DecoderReaderEngine<general_purpose::GeneralPurpose>;
+
+    fn standard() -> Self::Engine {
+        GeneralPurposeWrapper::standard().into()
+    }
+
+    fn standard_unpadded() -> Self::Engine {
+        GeneralPurposeWrapper::standard_unpadded().into()
+    }
+
+    fn standard_with_pad_mode(
+        encode_pad: bool,
+        decode_pad_mode: DecodePaddingMode,
+    ) -> Self::Engine {
+        GeneralPurposeWrapper::standard_with_pad_mode(encode_pad, decode_pad_mode).into()
+    }
+
+    fn standard_allow_trailing_bits() -> Self::Engine {
+        GeneralPurposeWrapper::standard_allow_trailing_bits().into()
+    }
+
+    fn random<R: rand::Rng>(rng: &mut R) -> Self::Engine {
+        GeneralPurposeWrapper::random(rng).into()
+    }
+
+    fn random_alphabet<R: rand::Rng>(rng: &mut R, alphabet: &Alphabet) -> Self::Engine {
+        GeneralPurposeWrapper::random_alphabet(rng, alphabet).into()
+    }
+}
+
+fn seeded_rng() -> impl rand::Rng {
+    rngs::SmallRng::from_entropy()
+}
+
+fn all_pad_modes() -> Vec<DecodePaddingMode> {
+    vec![
+        DecodePaddingMode::Indifferent,
+        DecodePaddingMode::RequireCanonical,
+        DecodePaddingMode::RequireNone,
+    ]
+}
+
+fn pad_modes_allowing_padding() -> Vec<DecodePaddingMode> {
+    vec![
+        DecodePaddingMode::Indifferent,
+        DecodePaddingMode::RequireCanonical,
+    ]
+}
+
+fn assert_all_suffixes_ok<E: Engine>(engine: E, suffixes: Vec<&str>) {
+    for num_prefix_quads in 0..256 {
+        for &suffix in suffixes.iter() {
+            let mut encoded = "AAAA".repeat(num_prefix_quads);
+            encoded.push_str(suffix);
+
+            let res = &engine.decode(&encoded);
+            assert!(res.is_ok());
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/base64/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/lib.rs
--- 43.0.0-1/rust-vendor/base64/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,277 @@
+//! Correct, fast, and configurable [base64][] decoding and encoding. Base64
+//! transports binary data efficiently in contexts where only plain text is
+//! allowed.
+//!
+//! [base64]: https://developer.mozilla.org/en-US/docs/Glossary/Base64
+//!
+//! # Usage
+//!
+//! Use an [`Engine`] to decode or encode base64, configured with the base64
+//! alphabet and padding behavior best suited to your application.
+//!
+//! ## Engine setup
+//!
+//! There is more than one way to encode a stream of bytes as “base64”.
+//! Different applications use different encoding
+//! [alphabets][alphabet::Alphabet] and
+//! [padding behaviors][engine::general_purpose::GeneralPurposeConfig].
+//!
+//! ### Encoding alphabet
+//!
+//! Almost all base64 [alphabets][alphabet::Alphabet] use `A-Z`, `a-z`, and
+//! `0-9`, which gives nearly 64 characters (26 + 26 + 10 = 62), but they differ
+//! in their choice of their final 2.
+//!
+//! Most applications use the [standard][alphabet::STANDARD] alphabet specified
+//! in [RFC 4648][rfc-alphabet].  If that’s all you need, you can get started
+//! quickly by using the pre-configured
+//! [`STANDARD`][engine::general_purpose::STANDARD] engine, which is also available
+//! in the [`prelude`] module as shown here, if you prefer a minimal `use`
+//! footprint.
+//!
+#![cfg_attr(feature = "alloc", doc = "```")]
+#![cfg_attr(not(feature = "alloc"), doc = "```ignore")]
+//! use base64::prelude::*;
+//!
+//! # fn main() -> Result<(), base64::DecodeError> {
+//! assert_eq!(BASE64_STANDARD.decode(b"+uwgVQA=")?, b"\xFA\xEC\x20\x55\0");
+//! assert_eq!(BASE64_STANDARD.encode(b"\xFF\xEC\x20\x55\0"), "/+wgVQA=");
+//! # Ok(())
+//! # }
+//! ```
+//!
+//! [rfc-alphabet]: https://datatracker.ietf.org/doc/html/rfc4648#section-4
+//!
+//! Other common alphabets are available in the [`alphabet`] module.
+//!
+//! #### URL-safe alphabet
+//!
+//! The standard alphabet uses `+` and `/` as its two non-alphanumeric tokens,
+//! which cannot be safely used in URL’s without encoding them as `%2B` and
+//! `%2F`.
+//!
+//! To avoid that, some applications use a [“URL-safe” alphabet][alphabet::URL_SAFE],
+//! which uses `-` and `_` instead. To use that alternative alphabet, use the
+//! [`URL_SAFE`][engine::general_purpose::URL_SAFE] engine. This example doesn't
+//! use [`prelude`] to show what a more explicit `use` would look like.
+//!
+#![cfg_attr(feature = "alloc", doc = "```")]
+#![cfg_attr(not(feature = "alloc"), doc = "```ignore")]
+//! use base64::{engine::general_purpose::URL_SAFE, Engine as _};
+//!
+//! # fn main() -> Result<(), base64::DecodeError> {
+//! assert_eq!(URL_SAFE.decode(b"-uwgVQA=")?, b"\xFA\xEC\x20\x55\0");
+//! assert_eq!(URL_SAFE.encode(b"\xFF\xEC\x20\x55\0"), "_-wgVQA=");
+//! # Ok(())
+//! # }
+//! ```
+//!
+//! ### Padding characters
+//!
+//! Each base64 character represents 6 bits (2⁶ = 64) of the original binary
+//! data, and every 3 bytes of input binary data will encode to 4 base64
+//! characters (8 bits × 3 = 6 bits × 4 = 24 bits).
+//!
+//! When the input is not an even multiple of 3 bytes in length, [canonical][]
+//! base64 encoders insert padding characters at the end, so that the output
+//! length is always a multiple of 4:
+//!
+//! [canonical]: https://datatracker.ietf.org/doc/html/rfc4648#section-3.5
+//!
+#![cfg_attr(feature = "alloc", doc = "```")]
+#![cfg_attr(not(feature = "alloc"), doc = "```ignore")]
+//! use base64::{engine::general_purpose::STANDARD, Engine as _};
+//!
+//! assert_eq!(STANDARD.encode(b""),    "");
+//! assert_eq!(STANDARD.encode(b"f"),   "Zg==");
+//! assert_eq!(STANDARD.encode(b"fo"),  "Zm8=");
+//! assert_eq!(STANDARD.encode(b"foo"), "Zm9v");
+//! ```
+//!
+//! Canonical encoding ensures that base64 encodings will be exactly the same,
+//! byte-for-byte, regardless of input length. But the `=` padding characters
+//! aren’t necessary for decoding, and they may be omitted by using a
+//! [`NO_PAD`][engine::general_purpose::NO_PAD] configuration:
+//!
+#![cfg_attr(feature = "alloc", doc = "```")]
+#![cfg_attr(not(feature = "alloc"), doc = "```ignore")]
+//! use base64::{engine::general_purpose::STANDARD_NO_PAD, Engine as _};
+//!
+//! assert_eq!(STANDARD_NO_PAD.encode(b""),    "");
+//! assert_eq!(STANDARD_NO_PAD.encode(b"f"),   "Zg");
+//! assert_eq!(STANDARD_NO_PAD.encode(b"fo"),  "Zm8");
+//! assert_eq!(STANDARD_NO_PAD.encode(b"foo"), "Zm9v");
+//! ```
+//!
+//! The pre-configured `NO_PAD` engines will reject inputs containing padding
+//! `=` characters. To encode without padding and still accept padding while
+//! decoding, create an [engine][engine::general_purpose::GeneralPurpose] with
+//! that [padding mode][engine::DecodePaddingMode].
+//!
+#![cfg_attr(feature = "alloc", doc = "```")]
+#![cfg_attr(not(feature = "alloc"), doc = "```ignore")]
+//! # use base64::{engine::general_purpose::STANDARD_NO_PAD, Engine as _};
+//! assert_eq!(STANDARD_NO_PAD.decode(b"Zm8="), Err(base64::DecodeError::InvalidPadding));
+//! ```
+//!
+//! ### Further customization
+//!
+//! Decoding and encoding behavior can be customized by creating an
+//! [engine][engine::GeneralPurpose] with an [alphabet][alphabet::Alphabet] and
+//! [padding configuration][engine::GeneralPurposeConfig]:
+//!
+#![cfg_attr(feature = "alloc", doc = "```")]
+#![cfg_attr(not(feature = "alloc"), doc = "```ignore")]
+//! use base64::{engine, alphabet, Engine as _};
+//!
+//! // bizarro-world base64: +/ as the first symbols instead of the last
+//! let alphabet =
+//!     alphabet::Alphabet::new("+/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")
+//!     .unwrap();
+//!
+//! // a very weird config that encodes with padding but requires no padding when decoding...?
+//! let crazy_config = engine::GeneralPurposeConfig::new()
+//!     .with_decode_allow_trailing_bits(true)
+//!     .with_encode_padding(true)
+//!     .with_decode_padding_mode(engine::DecodePaddingMode::RequireNone);
+//!
+//! let crazy_engine = engine::GeneralPurpose::new(&alphabet, crazy_config);
+//!
+//! let encoded = crazy_engine.encode(b"abc 123");
+//!
+//! ```
+//!
+//! ## Memory allocation
+//!
+//! The [decode][Engine::decode()] and [encode][Engine::encode()] engine methods
+//! allocate memory for their results – `decode` returns a `Vec<u8>` and
+//! `encode` returns a `String`. To instead decode or encode into a buffer that
+//! you allocated, use one of the alternative methods:
+//!
+//! #### Decoding
+//!
+//! | Method                     | Output                        | Allocates memory              |
+//! | -------------------------- | ----------------------------- | ----------------------------- |
+//! | [`Engine::decode`]         | returns a new `Vec<u8>`       | always                        |
+//! | [`Engine::decode_vec`]     | appends to provided `Vec<u8>` | if `Vec` lacks capacity       |
+//! | [`Engine::decode_slice`]   | writes to provided `&[u8]`    | never
+//!
+//! #### Encoding
+//!
+//! | Method                     | Output                       | Allocates memory               |
+//! | -------------------------- | ---------------------------- | ------------------------------ |
+//! | [`Engine::encode`]         | returns a new `String`       | always                         |
+//! | [`Engine::encode_string`]  | appends to provided `String` | if `String` lacks capacity     |
+//! | [`Engine::encode_slice`]   | writes to provided `&[u8]`   | never                          |
+//!
+//! ## Input and output
+//!
+//! The `base64` crate can [decode][Engine::decode()] and
+//! [encode][Engine::encode()] values in memory, or
+//! [`DecoderReader`][read::DecoderReader] and
+//! [`EncoderWriter`][write::EncoderWriter] provide streaming decoding and
+//! encoding for any [readable][std::io::Read] or [writable][std::io::Write]
+//! byte stream.
+//!
+//! #### Decoding
+//!
+#![cfg_attr(feature = "std", doc = "```")]
+#![cfg_attr(not(feature = "std"), doc = "```ignore")]
+//! # use std::io;
+//! use base64::{engine::general_purpose::STANDARD, read::DecoderReader};
+//!
+//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
+//! let mut input = io::stdin();
+//! let mut decoder = DecoderReader::new(&mut input, &STANDARD);
+//! io::copy(&mut decoder, &mut io::stdout())?;
+//! # Ok(())
+//! # }
+//! ```
+//!
+//! #### Encoding
+//!
+#![cfg_attr(feature = "std", doc = "```")]
+#![cfg_attr(not(feature = "std"), doc = "```ignore")]
+//! # use std::io;
+//! use base64::{engine::general_purpose::STANDARD, write::EncoderWriter};
+//!
+//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
+//! let mut output = io::stdout();
+//! let mut encoder = EncoderWriter::new(&mut output, &STANDARD);
+//! io::copy(&mut io::stdin(), &mut encoder)?;
+//! # Ok(())
+//! # }
+//! ```
+//!
+//! #### Display
+//!
+//! If you only need a base64 representation for implementing the
+//! [`Display`][std::fmt::Display] trait, use
+//! [`Base64Display`][display::Base64Display]:
+//!
+//! ```
+//! use base64::{display::Base64Display, engine::general_purpose::STANDARD};
+//!
+//! let value = Base64Display::new(b"\0\x01\x02\x03", &STANDARD);
+//! assert_eq!("base64: AAECAw==", format!("base64: {}", value));
+//! ```
+//!
+//! # Panics
+//!
+//! If length calculations result in overflowing `usize`, a panic will result.
+
+#![cfg_attr(feature = "cargo-clippy", allow(clippy::cast_lossless))]
+#![deny(
+    missing_docs,
+    trivial_casts,
+    trivial_numeric_casts,
+    unused_extern_crates,
+    unused_import_braces,
+    unused_results,
+    variant_size_differences
+)]
+#![forbid(unsafe_code)]
+// Allow globally until https://github.com/rust-lang/rust-clippy/issues/8768 is resolved.
+// The desired state is to allow it only for the rstest_reuse import.
+#![allow(clippy::single_component_path_imports)]
+#![cfg_attr(not(any(feature = "std", test)), no_std)]
+
+#[cfg(any(feature = "alloc", test))]
+extern crate alloc;
+
+// has to be included at top level because of the way rstest_reuse defines its macros
+#[cfg(test)]
+use rstest_reuse;
+
+mod chunked_encoder;
+pub mod display;
+#[cfg(any(feature = "std", test))]
+pub mod read;
+#[cfg(any(feature = "std", test))]
+pub mod write;
+
+pub mod engine;
+pub use engine::Engine;
+
+pub mod alphabet;
+
+mod encode;
+#[allow(deprecated)]
+#[cfg(any(feature = "alloc", test))]
+pub use crate::encode::{encode, encode_engine, encode_engine_string};
+#[allow(deprecated)]
+pub use crate::encode::{encode_engine_slice, encoded_len, EncodeSliceError};
+
+mod decode;
+#[allow(deprecated)]
+#[cfg(any(feature = "alloc", test))]
+pub use crate::decode::{decode, decode_engine, decode_engine_vec};
+#[allow(deprecated)]
+pub use crate::decode::{decode_engine_slice, decoded_len_estimate, DecodeError, DecodeSliceError};
+
+pub mod prelude;
+
+#[cfg(test)]
+mod tests;
+
+const PAD_BYTE: u8 = b'=';
diff -pruN 43.0.0-1/rust-vendor/base64/src/prelude.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/prelude.rs
--- 43.0.0-1/rust-vendor/base64/src/prelude.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/prelude.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,20 @@
+//! Preconfigured engines for common use cases.
+//!
+//! These are re-exports of `const` engines in [crate::engine::general_purpose], renamed with a `BASE64_`
+//! prefix for those who prefer to `use` the entire path to a name.
+//!
+//! # Examples
+//!
+#![cfg_attr(feature = "alloc", doc = "```")]
+#![cfg_attr(not(feature = "alloc"), doc = "```ignore")]
+//! use base64::prelude::{Engine as _, BASE64_STANDARD_NO_PAD};
+//!
+//! assert_eq!("c29tZSBieXRlcw", &BASE64_STANDARD_NO_PAD.encode(b"some bytes"));
+//! ```
+
+pub use crate::engine::Engine;
+
+pub use crate::engine::general_purpose::STANDARD as BASE64_STANDARD;
+pub use crate::engine::general_purpose::STANDARD_NO_PAD as BASE64_STANDARD_NO_PAD;
+pub use crate::engine::general_purpose::URL_SAFE as BASE64_URL_SAFE;
+pub use crate::engine::general_purpose::URL_SAFE_NO_PAD as BASE64_URL_SAFE_NO_PAD;
diff -pruN 43.0.0-1/rust-vendor/base64/src/read/decoder.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/read/decoder.rs
--- 43.0.0-1/rust-vendor/base64/src/read/decoder.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/read/decoder.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,335 @@
+use crate::{engine::Engine, DecodeError, DecodeSliceError, PAD_BYTE};
+use std::{cmp, fmt, io};
+
+// This should be large, but it has to fit on the stack.
+pub(crate) const BUF_SIZE: usize = 1024;
+
+// 4 bytes of base64 data encode 3 bytes of raw data (modulo padding).
+const BASE64_CHUNK_SIZE: usize = 4;
+const DECODED_CHUNK_SIZE: usize = 3;
+
+/// A `Read` implementation that decodes base64 data read from an underlying reader.
+///
+/// # Examples
+///
+/// ```
+/// use std::io::Read;
+/// use std::io::Cursor;
+/// use base64::engine::general_purpose;
+///
+/// // use a cursor as the simplest possible `Read` -- in real code this is probably a file, etc.
+/// let mut wrapped_reader = Cursor::new(b"YXNkZg==");
+/// let mut decoder = base64::read::DecoderReader::new(
+///     &mut wrapped_reader,
+///     &general_purpose::STANDARD);
+///
+/// // handle errors as you normally would
+/// let mut result = Vec::new();
+/// decoder.read_to_end(&mut result).unwrap();
+///
+/// assert_eq!(b"asdf", &result[..]);
+///
+/// ```
+pub struct DecoderReader<'e, E: Engine, R: io::Read> {
+    engine: &'e E,
+    /// Where b64 data is read from
+    inner: R,
+
+    /// Holds b64 data read from the delegate reader.
+    b64_buffer: [u8; BUF_SIZE],
+    /// The start of the pending buffered data in `b64_buffer`.
+    b64_offset: usize,
+    /// The amount of buffered b64 data after `b64_offset` in `b64_len`.
+    b64_len: usize,
+    /// Since the caller may provide us with a buffer of size 1 or 2 that's too small to copy a
+    /// decoded chunk in to, we have to be able to hang on to a few decoded bytes.
+    /// Technically we only need to hold 2 bytes, but then we'd need a separate temporary buffer to
+    /// decode 3 bytes into and then juggle copying one byte into the provided read buf and the rest
+    /// into here, which seems like a lot of complexity for 1 extra byte of storage.
+    decoded_chunk_buffer: [u8; DECODED_CHUNK_SIZE],
+    /// Index of start of decoded data in `decoded_chunk_buffer`
+    decoded_offset: usize,
+    /// Length of decoded data after `decoded_offset` in `decoded_chunk_buffer`
+    decoded_len: usize,
+    /// Input length consumed so far.
+    /// Used to provide accurate offsets in errors
+    input_consumed_len: usize,
+    /// offset of previously seen padding, if any
+    padding_offset: Option<usize>,
+}
+
+// exclude b64_buffer as it's uselessly large
+impl<'e, E: Engine, R: io::Read> fmt::Debug for DecoderReader<'e, E, R> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("DecoderReader")
+            .field("b64_offset", &self.b64_offset)
+            .field("b64_len", &self.b64_len)
+            .field("decoded_chunk_buffer", &self.decoded_chunk_buffer)
+            .field("decoded_offset", &self.decoded_offset)
+            .field("decoded_len", &self.decoded_len)
+            .field("input_consumed_len", &self.input_consumed_len)
+            .field("padding_offset", &self.padding_offset)
+            .finish()
+    }
+}
+
+impl<'e, E: Engine, R: io::Read> DecoderReader<'e, E, R> {
+    /// Create a new decoder that will read from the provided reader `r`.
+    pub fn new(reader: R, engine: &'e E) -> Self {
+        DecoderReader {
+            engine,
+            inner: reader,
+            b64_buffer: [0; BUF_SIZE],
+            b64_offset: 0,
+            b64_len: 0,
+            decoded_chunk_buffer: [0; DECODED_CHUNK_SIZE],
+            decoded_offset: 0,
+            decoded_len: 0,
+            input_consumed_len: 0,
+            padding_offset: None,
+        }
+    }
+
+    /// Write as much as possible of the decoded buffer into the target buffer.
+    /// Must only be called when there is something to write and space to write into.
+    /// Returns a Result with the number of (decoded) bytes copied.
+    fn flush_decoded_buf(&mut self, buf: &mut [u8]) -> io::Result<usize> {
+        debug_assert!(self.decoded_len > 0);
+        debug_assert!(!buf.is_empty());
+
+        let copy_len = cmp::min(self.decoded_len, buf.len());
+        debug_assert!(copy_len > 0);
+        debug_assert!(copy_len <= self.decoded_len);
+
+        buf[..copy_len].copy_from_slice(
+            &self.decoded_chunk_buffer[self.decoded_offset..self.decoded_offset + copy_len],
+        );
+
+        self.decoded_offset += copy_len;
+        self.decoded_len -= copy_len;
+
+        debug_assert!(self.decoded_len < DECODED_CHUNK_SIZE);
+
+        Ok(copy_len)
+    }
+
+    /// Read into the remaining space in the buffer after the current contents.
+    /// Must only be called when there is space to read into in the buffer.
+    /// Returns the number of bytes read.
+    fn read_from_delegate(&mut self) -> io::Result<usize> {
+        debug_assert!(self.b64_offset + self.b64_len < BUF_SIZE);
+
+        let read = self
+            .inner
+            .read(&mut self.b64_buffer[self.b64_offset + self.b64_len..])?;
+        self.b64_len += read;
+
+        debug_assert!(self.b64_offset + self.b64_len <= BUF_SIZE);
+
+        Ok(read)
+    }
+
+    /// Decode the requested number of bytes from the b64 buffer into the provided buffer. It's the
+    /// caller's responsibility to choose the number of b64 bytes to decode correctly.
+    ///
+    /// Returns a Result with the number of decoded bytes written to `buf`.
+    ///
+    /// # Panics
+    ///
+    /// panics if `buf` is too small
+    fn decode_to_buf(&mut self, b64_len_to_decode: usize, buf: &mut [u8]) -> io::Result<usize> {
+        debug_assert!(self.b64_len >= b64_len_to_decode);
+        debug_assert!(self.b64_offset + self.b64_len <= BUF_SIZE);
+        debug_assert!(!buf.is_empty());
+
+        let b64_to_decode = &self.b64_buffer[self.b64_offset..self.b64_offset + b64_len_to_decode];
+        let decode_metadata = self
+            .engine
+            .internal_decode(
+                b64_to_decode,
+                buf,
+                self.engine.internal_decoded_len_estimate(b64_len_to_decode),
+            )
+            .map_err(|dse| match dse {
+                DecodeSliceError::DecodeError(de) => {
+                    match de {
+                        DecodeError::InvalidByte(offset, byte) => {
+                            match (byte, self.padding_offset) {
+                                // if there was padding in a previous block of decoding that happened to
+                                // be correct, and we now find more padding that happens to be incorrect,
+                                // to be consistent with non-reader decodes, record the error at the first
+                                // padding
+                                (PAD_BYTE, Some(first_pad_offset)) => {
+                                    DecodeError::InvalidByte(first_pad_offset, PAD_BYTE)
+                                }
+                                _ => {
+                                    DecodeError::InvalidByte(self.input_consumed_len + offset, byte)
+                                }
+                            }
+                        }
+                        DecodeError::InvalidLength(len) => {
+                            DecodeError::InvalidLength(self.input_consumed_len + len)
+                        }
+                        DecodeError::InvalidLastSymbol(offset, byte) => {
+                            DecodeError::InvalidLastSymbol(self.input_consumed_len + offset, byte)
+                        }
+                        DecodeError::InvalidPadding => DecodeError::InvalidPadding,
+                    }
+                }
+                DecodeSliceError::OutputSliceTooSmall => {
+                    unreachable!("buf is sized correctly in calling code")
+                }
+            })
+            .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?;
+
+        if let Some(offset) = self.padding_offset {
+            // we've already seen padding
+            if decode_metadata.decoded_len > 0 {
+                // we read more after already finding padding; report error at first padding byte
+                return Err(io::Error::new(
+                    io::ErrorKind::InvalidData,
+                    DecodeError::InvalidByte(offset, PAD_BYTE),
+                ));
+            }
+        }
+
+        self.padding_offset = self.padding_offset.or(decode_metadata
+            .padding_offset
+            .map(|offset| self.input_consumed_len + offset));
+        self.input_consumed_len += b64_len_to_decode;
+        self.b64_offset += b64_len_to_decode;
+        self.b64_len -= b64_len_to_decode;
+
+        debug_assert!(self.b64_offset + self.b64_len <= BUF_SIZE);
+
+        Ok(decode_metadata.decoded_len)
+    }
+
+    /// Unwraps this `DecoderReader`, returning the base reader which it reads base64 encoded
+    /// input from.
+    ///
+    /// Because `DecoderReader` performs internal buffering, the state of the inner reader is
+    /// unspecified. This function is mainly provided because the inner reader type may provide
+    /// additional functionality beyond the `Read` implementation which may still be useful.
+    pub fn into_inner(self) -> R {
+        self.inner
+    }
+}
+
+impl<'e, E: Engine, R: io::Read> io::Read for DecoderReader<'e, E, R> {
+    /// Decode input from the wrapped reader.
+    ///
+    /// Under non-error circumstances, this returns `Ok` with the value being the number of bytes
+    /// written in `buf`.
+    ///
+    /// Where possible, this function buffers base64 to minimize the number of read() calls to the
+    /// delegate reader.
+    ///
+    /// # Errors
+    ///
+    /// Any errors emitted by the delegate reader are returned. Decoding errors due to invalid
+    /// base64 are also possible, and will have `io::ErrorKind::InvalidData`.
+    fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
+        if buf.is_empty() {
+            return Ok(0);
+        }
+
+        // offset == BUF_SIZE when we copied it all last time
+        debug_assert!(self.b64_offset <= BUF_SIZE);
+        debug_assert!(self.b64_offset + self.b64_len <= BUF_SIZE);
+        debug_assert!(if self.b64_offset == BUF_SIZE {
+            self.b64_len == 0
+        } else {
+            self.b64_len <= BUF_SIZE
+        });
+
+        debug_assert!(if self.decoded_len == 0 {
+            // can be = when we were able to copy the complete chunk
+            self.decoded_offset <= DECODED_CHUNK_SIZE
+        } else {
+            self.decoded_offset < DECODED_CHUNK_SIZE
+        });
+
+        // We shouldn't ever decode into decoded_buffer when we can't immediately write at least one
+        // byte into the provided buf, so the effective length should only be 3 momentarily between
+        // when we decode and when we copy into the target buffer.
+        debug_assert!(self.decoded_len < DECODED_CHUNK_SIZE);
+        debug_assert!(self.decoded_len + self.decoded_offset <= DECODED_CHUNK_SIZE);
+
+        if self.decoded_len > 0 {
+            // we have a few leftover decoded bytes; flush that rather than pull in more b64
+            self.flush_decoded_buf(buf)
+        } else {
+            let mut at_eof = false;
+            while self.b64_len < BASE64_CHUNK_SIZE {
+                // Copy any bytes we have to the start of the buffer.
+                self.b64_buffer
+                    .copy_within(self.b64_offset..self.b64_offset + self.b64_len, 0);
+                self.b64_offset = 0;
+
+                // then fill in more data
+                let read = self.read_from_delegate()?;
+                if read == 0 {
+                    // we never read into an empty buf, so 0 => we've hit EOF
+                    at_eof = true;
+                    break;
+                }
+            }
+
+            if self.b64_len == 0 {
+                debug_assert!(at_eof);
+                // we must be at EOF, and we have no data left to decode
+                return Ok(0);
+            };
+
+            debug_assert!(if at_eof {
+                // if we are at eof, we may not have a complete chunk
+                self.b64_len > 0
+            } else {
+                // otherwise, we must have at least one chunk
+                self.b64_len >= BASE64_CHUNK_SIZE
+            });
+
+            debug_assert_eq!(0, self.decoded_len);
+
+            if buf.len() < DECODED_CHUNK_SIZE {
+                // caller requested an annoyingly short read
+                // have to write to a tmp buf first to avoid double mutable borrow
+                let mut decoded_chunk = [0_u8; DECODED_CHUNK_SIZE];
+                // if we are at eof, could have less than BASE64_CHUNK_SIZE, in which case we have
+                // to assume that these last few tokens are, in fact, valid (i.e. must be 2-4 b64
+                // tokens, not 1, since 1 token can't decode to 1 byte).
+                let to_decode = cmp::min(self.b64_len, BASE64_CHUNK_SIZE);
+
+                let decoded = self.decode_to_buf(to_decode, &mut decoded_chunk[..])?;
+                self.decoded_chunk_buffer[..decoded].copy_from_slice(&decoded_chunk[..decoded]);
+
+                self.decoded_offset = 0;
+                self.decoded_len = decoded;
+
+                // can be less than 3 on last block due to padding
+                debug_assert!(decoded <= 3);
+
+                self.flush_decoded_buf(buf)
+            } else {
+                let b64_bytes_that_can_decode_into_buf = (buf.len() / DECODED_CHUNK_SIZE)
+                    .checked_mul(BASE64_CHUNK_SIZE)
+                    .expect("too many chunks");
+                debug_assert!(b64_bytes_that_can_decode_into_buf >= BASE64_CHUNK_SIZE);
+
+                let b64_bytes_available_to_decode = if at_eof {
+                    self.b64_len
+                } else {
+                    // only use complete chunks
+                    self.b64_len - self.b64_len % 4
+                };
+
+                let actual_decode_len = cmp::min(
+                    b64_bytes_that_can_decode_into_buf,
+                    b64_bytes_available_to_decode,
+                );
+                self.decode_to_buf(actual_decode_len, buf)
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/base64/src/read/decoder_tests.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/read/decoder_tests.rs
--- 43.0.0-1/rust-vendor/base64/src/read/decoder_tests.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/read/decoder_tests.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,487 @@
+use std::{
+    cmp,
+    io::{self, Read as _},
+    iter,
+};
+
+use rand::{Rng as _, RngCore as _};
+
+use super::decoder::{DecoderReader, BUF_SIZE};
+use crate::{
+    alphabet,
+    engine::{general_purpose::STANDARD, Engine, GeneralPurpose},
+    tests::{random_alphabet, random_config, random_engine},
+    DecodeError, PAD_BYTE,
+};
+
+#[test]
+fn simple() {
+    let tests: &[(&[u8], &[u8])] = &[
+        (&b"0"[..], &b"MA=="[..]),
+        (b"01", b"MDE="),
+        (b"012", b"MDEy"),
+        (b"0123", b"MDEyMw=="),
+        (b"01234", b"MDEyMzQ="),
+        (b"012345", b"MDEyMzQ1"),
+        (b"0123456", b"MDEyMzQ1Ng=="),
+        (b"01234567", b"MDEyMzQ1Njc="),
+        (b"012345678", b"MDEyMzQ1Njc4"),
+        (b"0123456789", b"MDEyMzQ1Njc4OQ=="),
+    ][..];
+
+    for (text_expected, base64data) in tests.iter() {
+        // Read n bytes at a time.
+        for n in 1..base64data.len() + 1 {
+            let mut wrapped_reader = io::Cursor::new(base64data);
+            let mut decoder = DecoderReader::new(&mut wrapped_reader, &STANDARD);
+
+            // handle errors as you normally would
+            let mut text_got = Vec::new();
+            let mut buffer = vec![0u8; n];
+            while let Ok(read) = decoder.read(&mut buffer[..]) {
+                if read == 0 {
+                    break;
+                }
+                text_got.extend_from_slice(&buffer[..read]);
+            }
+
+            assert_eq!(
+                text_got,
+                *text_expected,
+                "\nGot: {}\nExpected: {}",
+                String::from_utf8_lossy(&text_got[..]),
+                String::from_utf8_lossy(text_expected)
+            );
+        }
+    }
+}
+
+// Make sure we error out on trailing junk.
+#[test]
+fn trailing_junk() {
+    let tests: &[&[u8]] = &[&b"MDEyMzQ1Njc4*!@#$%^&"[..], b"MDEyMzQ1Njc4OQ== "][..];
+
+    for base64data in tests.iter() {
+        // Read n bytes at a time.
+        for n in 1..base64data.len() + 1 {
+            let mut wrapped_reader = io::Cursor::new(base64data);
+            let mut decoder = DecoderReader::new(&mut wrapped_reader, &STANDARD);
+
+            // handle errors as you normally would
+            let mut buffer = vec![0u8; n];
+            let mut saw_error = false;
+            loop {
+                match decoder.read(&mut buffer[..]) {
+                    Err(_) => {
+                        saw_error = true;
+                        break;
+                    }
+                    Ok(0) => break,
+                    Ok(_len) => (),
+                }
+            }
+
+            assert!(saw_error);
+        }
+    }
+}
+
+#[test]
+fn handles_short_read_from_delegate() {
+    let mut rng = rand::thread_rng();
+    let mut bytes = Vec::new();
+    let mut b64 = String::new();
+    let mut decoded = Vec::new();
+
+    for _ in 0..10_000 {
+        bytes.clear();
+        b64.clear();
+        decoded.clear();
+
+        let size = rng.gen_range(0..(10 * BUF_SIZE));
+        bytes.extend(iter::repeat(0).take(size));
+        bytes.truncate(size);
+        rng.fill_bytes(&mut bytes[..size]);
+        assert_eq!(size, bytes.len());
+
+        let engine = random_engine(&mut rng);
+        engine.encode_string(&bytes[..], &mut b64);
+
+        let mut wrapped_reader = io::Cursor::new(b64.as_bytes());
+        let mut short_reader = RandomShortRead {
+            delegate: &mut wrapped_reader,
+            rng: &mut rng,
+        };
+
+        let mut decoder = DecoderReader::new(&mut short_reader, &engine);
+
+        let decoded_len = decoder.read_to_end(&mut decoded).unwrap();
+        assert_eq!(size, decoded_len);
+        assert_eq!(&bytes[..], &decoded[..]);
+    }
+}
+
+#[test]
+fn read_in_short_increments() {
+    let mut rng = rand::thread_rng();
+    let mut bytes = Vec::new();
+    let mut b64 = String::new();
+    let mut decoded = Vec::new();
+
+    for _ in 0..10_000 {
+        bytes.clear();
+        b64.clear();
+        decoded.clear();
+
+        let size = rng.gen_range(0..(10 * BUF_SIZE));
+        bytes.extend(iter::repeat(0).take(size));
+        // leave room to play around with larger buffers
+        decoded.extend(iter::repeat(0).take(size * 3));
+
+        rng.fill_bytes(&mut bytes[..]);
+        assert_eq!(size, bytes.len());
+
+        let engine = random_engine(&mut rng);
+
+        engine.encode_string(&bytes[..], &mut b64);
+
+        let mut wrapped_reader = io::Cursor::new(&b64[..]);
+        let mut decoder = DecoderReader::new(&mut wrapped_reader, &engine);
+
+        consume_with_short_reads_and_validate(&mut rng, &bytes[..], &mut decoded, &mut decoder);
+    }
+}
+
+#[test]
+fn read_in_short_increments_with_short_delegate_reads() {
+    let mut rng = rand::thread_rng();
+    let mut bytes = Vec::new();
+    let mut b64 = String::new();
+    let mut decoded = Vec::new();
+
+    for _ in 0..10_000 {
+        bytes.clear();
+        b64.clear();
+        decoded.clear();
+
+        let size = rng.gen_range(0..(10 * BUF_SIZE));
+        bytes.extend(iter::repeat(0).take(size));
+        // leave room to play around with larger buffers
+        decoded.extend(iter::repeat(0).take(size * 3));
+
+        rng.fill_bytes(&mut bytes[..]);
+        assert_eq!(size, bytes.len());
+
+        let engine = random_engine(&mut rng);
+
+        engine.encode_string(&bytes[..], &mut b64);
+
+        let mut base_reader = io::Cursor::new(&b64[..]);
+        let mut decoder = DecoderReader::new(&mut base_reader, &engine);
+        let mut short_reader = RandomShortRead {
+            delegate: &mut decoder,
+            rng: &mut rand::thread_rng(),
+        };
+
+        consume_with_short_reads_and_validate(
+            &mut rng,
+            &bytes[..],
+            &mut decoded,
+            &mut short_reader,
+        );
+    }
+}
+
+#[test]
+fn reports_invalid_last_symbol_correctly() {
+    let mut rng = rand::thread_rng();
+    let mut bytes = Vec::new();
+    let mut b64 = String::new();
+    let mut b64_bytes = Vec::new();
+    let mut decoded = Vec::new();
+    let mut bulk_decoded = Vec::new();
+
+    for _ in 0..1_000 {
+        bytes.clear();
+        b64.clear();
+        b64_bytes.clear();
+
+        let size = rng.gen_range(1..(10 * BUF_SIZE));
+        bytes.extend(iter::repeat(0).take(size));
+        decoded.extend(iter::repeat(0).take(size));
+        rng.fill_bytes(&mut bytes[..]);
+        assert_eq!(size, bytes.len());
+
+        let config = random_config(&mut rng);
+        let alphabet = random_alphabet(&mut rng);
+        // changing padding will cause invalid padding errors when we twiddle the last byte
+        let engine = GeneralPurpose::new(alphabet, config.with_encode_padding(false));
+        engine.encode_string(&bytes[..], &mut b64);
+        b64_bytes.extend(b64.bytes());
+        assert_eq!(b64_bytes.len(), b64.len());
+
+        // change the last character to every possible symbol. Should behave the same as bulk
+        // decoding whether invalid or valid.
+        for &s1 in alphabet.symbols.iter() {
+            decoded.clear();
+            bulk_decoded.clear();
+
+            // replace the last
+            *b64_bytes.last_mut().unwrap() = s1;
+            let bulk_res = engine.decode_vec(&b64_bytes[..], &mut bulk_decoded);
+
+            let mut wrapped_reader = io::Cursor::new(&b64_bytes[..]);
+            let mut decoder = DecoderReader::new(&mut wrapped_reader, &engine);
+
+            let stream_res = decoder.read_to_end(&mut decoded).map(|_| ()).map_err(|e| {
+                e.into_inner()
+                    .and_then(|e| e.downcast::<DecodeError>().ok())
+            });
+
+            assert_eq!(bulk_res.map_err(|e| Some(Box::new(e))), stream_res);
+        }
+    }
+}
+
+#[test]
+fn reports_invalid_byte_correctly() {
+    let mut rng = rand::thread_rng();
+    let mut bytes = Vec::new();
+    let mut b64 = String::new();
+    let mut stream_decoded = Vec::new();
+    let mut bulk_decoded = Vec::new();
+
+    for _ in 0..10_000 {
+        bytes.clear();
+        b64.clear();
+        stream_decoded.clear();
+        bulk_decoded.clear();
+
+        let size = rng.gen_range(1..(10 * BUF_SIZE));
+        bytes.extend(iter::repeat(0).take(size));
+        rng.fill_bytes(&mut bytes[..size]);
+        assert_eq!(size, bytes.len());
+
+        let engine = GeneralPurpose::new(&alphabet::STANDARD, random_config(&mut rng));
+
+        engine.encode_string(&bytes[..], &mut b64);
+        // replace one byte, somewhere, with '*', which is invalid
+        let bad_byte_pos = rng.gen_range(0..b64.len());
+        let mut b64_bytes = b64.bytes().collect::<Vec<u8>>();
+        b64_bytes[bad_byte_pos] = b'*';
+
+        let mut wrapped_reader = io::Cursor::new(b64_bytes.clone());
+        let mut decoder = DecoderReader::new(&mut wrapped_reader, &engine);
+
+        let read_decode_err = decoder
+            .read_to_end(&mut stream_decoded)
+            .map_err(|e| {
+                let kind = e.kind();
+                let inner = e
+                    .into_inner()
+                    .and_then(|e| e.downcast::<DecodeError>().ok());
+                inner.map(|i| (*i, kind))
+            })
+            .err()
+            .and_then(|o| o);
+
+        let bulk_decode_err = engine.decode_vec(&b64_bytes[..], &mut bulk_decoded).err();
+
+        // it's tricky to predict where the invalid data's offset will be since if it's in the last
+        // chunk it will be reported at the first padding location because it's treated as invalid
+        // padding. So, we just check that it's the same as it is for decoding all at once.
+        assert_eq!(
+            bulk_decode_err.map(|e| (e, io::ErrorKind::InvalidData)),
+            read_decode_err
+        );
+    }
+}
+
+#[test]
+fn internal_padding_error_with_short_read_concatenated_texts_invalid_byte_error() {
+    let mut rng = rand::thread_rng();
+    let mut bytes = Vec::new();
+    let mut b64 = String::new();
+    let mut reader_decoded = Vec::new();
+    let mut bulk_decoded = Vec::new();
+
+    // encodes with padding, requires that padding be present so we don't get InvalidPadding
+    // just because padding is there at all
+    let engine = STANDARD;
+
+    for _ in 0..10_000 {
+        bytes.clear();
+        b64.clear();
+        reader_decoded.clear();
+        bulk_decoded.clear();
+
+        // at least 2 bytes so there can be a split point between bytes
+        let size = rng.gen_range(2..(10 * BUF_SIZE));
+        bytes.resize(size, 0);
+        rng.fill_bytes(&mut bytes[..size]);
+
+        // Concatenate two valid b64s, yielding padding in the middle.
+        // This avoids scenarios that are challenging to assert on, like random padding location
+        // that might be InvalidLastSymbol when decoded at certain buffer sizes but InvalidByte
+        // when done all at once.
+        let split = loop {
+            // find a split point that will produce padding on the first part
+            let s = rng.gen_range(1..size);
+            if s % 3 != 0 {
+                // short enough to need padding
+                break s;
+            };
+        };
+
+        engine.encode_string(&bytes[..split], &mut b64);
+        assert!(b64.contains('='), "split: {}, b64: {}", split, b64);
+        let bad_byte_pos = b64.find('=').unwrap();
+        engine.encode_string(&bytes[split..], &mut b64);
+        let b64_bytes = b64.as_bytes();
+
+        // short read to make it plausible for padding to happen on a read boundary
+        let read_len = rng.gen_range(1..10);
+        let mut wrapped_reader = ShortRead {
+            max_read_len: read_len,
+            delegate: io::Cursor::new(&b64_bytes),
+        };
+
+        let mut decoder = DecoderReader::new(&mut wrapped_reader, &engine);
+
+        let read_decode_err = decoder
+            .read_to_end(&mut reader_decoded)
+            .map_err(|e| {
+                *e.into_inner()
+                    .and_then(|e| e.downcast::<DecodeError>().ok())
+                    .unwrap()
+            })
+            .unwrap_err();
+
+        let bulk_decode_err = engine.decode_vec(b64_bytes, &mut bulk_decoded).unwrap_err();
+
+        assert_eq!(
+            bulk_decode_err,
+            read_decode_err,
+            "read len: {}, bad byte pos: {}, b64: {}",
+            read_len,
+            bad_byte_pos,
+            std::str::from_utf8(b64_bytes).unwrap()
+        );
+        assert_eq!(
+            DecodeError::InvalidByte(
+                split / 3 * 4
+                    + match split % 3 {
+                        1 => 2,
+                        2 => 3,
+                        _ => unreachable!(),
+                    },
+                PAD_BYTE
+            ),
+            read_decode_err
+        );
+    }
+}
+
+#[test]
+fn internal_padding_anywhere_error() {
+    let mut rng = rand::thread_rng();
+    let mut bytes = Vec::new();
+    let mut b64 = String::new();
+    let mut reader_decoded = Vec::new();
+
+    // encodes with padding, requires that padding be present so we don't get InvalidPadding
+    // just because padding is there at all
+    let engine = STANDARD;
+
+    for _ in 0..10_000 {
+        bytes.clear();
+        b64.clear();
+        reader_decoded.clear();
+
+        bytes.resize(10 * BUF_SIZE, 0);
+        rng.fill_bytes(&mut bytes[..]);
+
+        // Just shove a padding byte in there somewhere.
+        // The specific error to expect is challenging to predict precisely because it
+        // will vary based on the position of the padding in the quad and the read buffer
+        // length, but SOMETHING should go wrong.
+
+        engine.encode_string(&bytes[..], &mut b64);
+        let mut b64_bytes = b64.as_bytes().to_vec();
+        // put padding somewhere other than the last quad
+        b64_bytes[rng.gen_range(0..bytes.len() - 4)] = PAD_BYTE;
+
+        // short read to make it plausible for padding to happen on a read boundary
+        let read_len = rng.gen_range(1..10);
+        let mut wrapped_reader = ShortRead {
+            max_read_len: read_len,
+            delegate: io::Cursor::new(&b64_bytes),
+        };
+
+        let mut decoder = DecoderReader::new(&mut wrapped_reader, &engine);
+
+        let result = decoder.read_to_end(&mut reader_decoded);
+        assert!(result.is_err());
+    }
+}
+
+fn consume_with_short_reads_and_validate<R: io::Read>(
+    rng: &mut rand::rngs::ThreadRng,
+    expected_bytes: &[u8],
+    decoded: &mut [u8],
+    short_reader: &mut R,
+) {
+    let mut total_read = 0_usize;
+    loop {
+        assert!(
+            total_read <= expected_bytes.len(),
+            "tr {} size {}",
+            total_read,
+            expected_bytes.len()
+        );
+        if total_read == expected_bytes.len() {
+            assert_eq!(expected_bytes, &decoded[..total_read]);
+            // should be done
+            assert_eq!(0, short_reader.read(&mut *decoded).unwrap());
+            // didn't write anything
+            assert_eq!(expected_bytes, &decoded[..total_read]);
+
+            break;
+        }
+        let decode_len = rng.gen_range(1..cmp::max(2, expected_bytes.len() * 2));
+
+        let read = short_reader
+            .read(&mut decoded[total_read..total_read + decode_len])
+            .unwrap();
+        total_read += read;
+    }
+}
+
+/// Limits how many bytes a reader will provide in each read call.
+/// Useful for shaking out code that may work fine only with typical input sources that always fill
+/// the buffer.
+struct RandomShortRead<'a, 'b, R: io::Read, N: rand::Rng> {
+    delegate: &'b mut R,
+    rng: &'a mut N,
+}
+
+impl<'a, 'b, R: io::Read, N: rand::Rng> io::Read for RandomShortRead<'a, 'b, R, N> {
+    fn read(&mut self, buf: &mut [u8]) -> Result<usize, io::Error> {
+        // avoid 0 since it means EOF for non-empty buffers
+        let effective_len = cmp::min(self.rng.gen_range(1..20), buf.len());
+
+        self.delegate.read(&mut buf[..effective_len])
+    }
+}
+
+struct ShortRead<R: io::Read> {
+    delegate: R,
+    max_read_len: usize,
+}
+
+impl<R: io::Read> io::Read for ShortRead<R> {
+    fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
+        let len = self.max_read_len.max(buf.len());
+        self.delegate.read(&mut buf[..len])
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/base64/src/read/mod.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/read/mod.rs
--- 43.0.0-1/rust-vendor/base64/src/read/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/read/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,6 @@
+//! Implementations of `io::Read` to transparently decode base64.
+mod decoder;
+pub use self::decoder::DecoderReader;
+
+#[cfg(test)]
+mod decoder_tests;
diff -pruN 43.0.0-1/rust-vendor/base64/src/tests.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/tests.rs
--- 43.0.0-1/rust-vendor/base64/src/tests.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/tests.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,117 @@
+use std::str;
+
+use rand::{
+    distributions,
+    distributions::{Distribution as _, Uniform},
+    seq::SliceRandom,
+    Rng, SeedableRng,
+};
+
+use crate::{
+    alphabet,
+    encode::encoded_len,
+    engine::{
+        general_purpose::{GeneralPurpose, GeneralPurposeConfig},
+        Config, DecodePaddingMode, Engine,
+    },
+};
+
+#[test]
+fn roundtrip_random_config_short() {
+    // exercise the slower encode/decode routines that operate on shorter buffers more vigorously
+    roundtrip_random_config(Uniform::new(0, 50), 10_000);
+}
+
+#[test]
+fn roundtrip_random_config_long() {
+    roundtrip_random_config(Uniform::new(0, 1000), 10_000);
+}
+
+pub fn assert_encode_sanity(encoded: &str, padded: bool, input_len: usize) {
+    let input_rem = input_len % 3;
+    let expected_padding_len = if input_rem > 0 {
+        if padded {
+            3 - input_rem
+        } else {
+            0
+        }
+    } else {
+        0
+    };
+
+    let expected_encoded_len = encoded_len(input_len, padded).unwrap();
+
+    assert_eq!(expected_encoded_len, encoded.len());
+
+    let padding_len = encoded.chars().filter(|&c| c == '=').count();
+
+    assert_eq!(expected_padding_len, padding_len);
+
+    let _ = str::from_utf8(encoded.as_bytes()).expect("Base64 should be valid utf8");
+}
+
+fn roundtrip_random_config(input_len_range: Uniform<usize>, iterations: u32) {
+    let mut input_buf: Vec<u8> = Vec::new();
+    let mut encoded_buf = String::new();
+    let mut rng = rand::rngs::SmallRng::from_entropy();
+
+    for _ in 0..iterations {
+        input_buf.clear();
+        encoded_buf.clear();
+
+        let input_len = input_len_range.sample(&mut rng);
+
+        let engine = random_engine(&mut rng);
+
+        for _ in 0..input_len {
+            input_buf.push(rng.gen());
+        }
+
+        engine.encode_string(&input_buf, &mut encoded_buf);
+
+        assert_encode_sanity(&encoded_buf, engine.config().encode_padding(), input_len);
+
+        assert_eq!(input_buf, engine.decode(&encoded_buf).unwrap());
+    }
+}
+
+pub fn random_config<R: Rng>(rng: &mut R) -> GeneralPurposeConfig {
+    let mode = rng.gen();
+    GeneralPurposeConfig::new()
+        .with_encode_padding(match mode {
+            DecodePaddingMode::Indifferent => rng.gen(),
+            DecodePaddingMode::RequireCanonical => true,
+            DecodePaddingMode::RequireNone => false,
+        })
+        .with_decode_padding_mode(mode)
+        .with_decode_allow_trailing_bits(rng.gen())
+}
+
+impl distributions::Distribution<DecodePaddingMode> for distributions::Standard {
+    fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> DecodePaddingMode {
+        match rng.gen_range(0..=2) {
+            0 => DecodePaddingMode::Indifferent,
+            1 => DecodePaddingMode::RequireCanonical,
+            _ => DecodePaddingMode::RequireNone,
+        }
+    }
+}
+
+pub fn random_alphabet<R: Rng>(rng: &mut R) -> &'static alphabet::Alphabet {
+    ALPHABETS.choose(rng).unwrap()
+}
+
+pub fn random_engine<R: Rng>(rng: &mut R) -> GeneralPurpose {
+    let alphabet = random_alphabet(rng);
+    let config = random_config(rng);
+    GeneralPurpose::new(alphabet, config)
+}
+
+const ALPHABETS: &[alphabet::Alphabet] = &[
+    alphabet::URL_SAFE,
+    alphabet::STANDARD,
+    alphabet::CRYPT,
+    alphabet::BCRYPT,
+    alphabet::IMAP_MUTF7,
+    alphabet::BIN_HEX,
+];
diff -pruN 43.0.0-1/rust-vendor/base64/src/write/encoder.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/write/encoder.rs
--- 43.0.0-1/rust-vendor/base64/src/write/encoder.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/write/encoder.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,407 @@
+use crate::engine::Engine;
+use std::{
+    cmp, fmt, io,
+    io::{ErrorKind, Result},
+};
+
+pub(crate) const BUF_SIZE: usize = 1024;
+/// The most bytes whose encoding will fit in `BUF_SIZE`
+const MAX_INPUT_LEN: usize = BUF_SIZE / 4 * 3;
+// 3 bytes of input = 4 bytes of base64, always (because we don't allow line wrapping)
+const MIN_ENCODE_CHUNK_SIZE: usize = 3;
+
+/// A `Write` implementation that base64 encodes data before delegating to the wrapped writer.
+///
+/// Because base64 has special handling for the end of the input data (padding, etc), there's a
+/// `finish()` method on this type that encodes any leftover input bytes and adds padding if
+/// appropriate. It's called automatically when deallocated (see the `Drop` implementation), but
+/// any error that occurs when invoking the underlying writer will be suppressed. If you want to
+/// handle such errors, call `finish()` yourself.
+///
+/// # Examples
+///
+/// ```
+/// use std::io::Write;
+/// use base64::engine::general_purpose;
+///
+/// // use a vec as the simplest possible `Write` -- in real code this is probably a file, etc.
+/// let mut enc = base64::write::EncoderWriter::new(Vec::new(), &general_purpose::STANDARD);
+///
+/// // handle errors as you normally would
+/// enc.write_all(b"asdf").unwrap();
+///
+/// // could leave this out to be called by Drop, if you don't care
+/// // about handling errors or getting the delegate writer back
+/// let delegate = enc.finish().unwrap();
+///
+/// // base64 was written to the writer
+/// assert_eq!(b"YXNkZg==", &delegate[..]);
+///
+/// ```
+///
+/// # Panics
+///
+/// Calling `write()` (or related methods) or `finish()` after `finish()` has completed without
+/// error is invalid and will panic.
+///
+/// # Errors
+///
+/// Base64 encoding itself does not generate errors, but errors from the wrapped writer will be
+/// returned as per the contract of `Write`.
+///
+/// # Performance
+///
+/// It has some minor performance loss compared to encoding slices (a couple percent).
+/// It does not do any heap allocation.
+///
+/// # Limitations
+///
+/// Owing to the specification of the `write` and `flush` methods on the `Write` trait and their
+/// implications for a buffering implementation, these methods may not behave as expected. In
+/// particular, calling `write_all` on this interface may fail with `io::ErrorKind::WriteZero`.
+/// See the documentation of the `Write` trait implementation for further details.
+pub struct EncoderWriter<'e, E: Engine, W: io::Write> {
+    engine: &'e E,
+    /// Where encoded data is written to. It's an Option as it's None immediately before Drop is
+    /// called so that finish() can return the underlying writer. None implies that finish() has
+    /// been called successfully.
+    delegate: Option<W>,
+    /// Holds a partial chunk, if any, after the last `write()`, so that we may then fill the chunk
+    /// with the next `write()`, encode it, then proceed with the rest of the input normally.
+    extra_input: [u8; MIN_ENCODE_CHUNK_SIZE],
+    /// How much of `extra` is occupied, in `[0, MIN_ENCODE_CHUNK_SIZE]`.
+    extra_input_occupied_len: usize,
+    /// Buffer to encode into. May hold leftover encoded bytes from a previous write call that the underlying writer
+    /// did not write last time.
+    output: [u8; BUF_SIZE],
+    /// How much of `output` is occupied with encoded data that couldn't be written last time
+    output_occupied_len: usize,
+    /// panic safety: don't write again in destructor if writer panicked while we were writing to it
+    panicked: bool,
+}
+
+impl<'e, E: Engine, W: io::Write> fmt::Debug for EncoderWriter<'e, E, W> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(
+            f,
+            "extra_input: {:?} extra_input_occupied_len:{:?} output[..5]: {:?} output_occupied_len: {:?}",
+            self.extra_input,
+            self.extra_input_occupied_len,
+            &self.output[0..5],
+            self.output_occupied_len
+        )
+    }
+}
+
+impl<'e, E: Engine, W: io::Write> EncoderWriter<'e, E, W> {
+    /// Create a new encoder that will write to the provided delegate writer.
+    pub fn new(delegate: W, engine: &'e E) -> EncoderWriter<'e, E, W> {
+        EncoderWriter {
+            engine,
+            delegate: Some(delegate),
+            extra_input: [0u8; MIN_ENCODE_CHUNK_SIZE],
+            extra_input_occupied_len: 0,
+            output: [0u8; BUF_SIZE],
+            output_occupied_len: 0,
+            panicked: false,
+        }
+    }
+
+    /// Encode all remaining buffered data and write it, including any trailing incomplete input
+    /// triples and associated padding.
+    ///
+    /// Once this succeeds, no further writes or calls to this method are allowed.
+    ///
+    /// This may write to the delegate writer multiple times if the delegate writer does not accept
+    /// all input provided to its `write` each invocation.
+    ///
+    /// If you don't care about error handling, it is not necessary to call this function, as the
+    /// equivalent finalization is done by the Drop impl.
+    ///
+    /// Returns the writer that this was constructed around.
+    ///
+    /// # Errors
+    ///
+    /// The first error that is not of `ErrorKind::Interrupted` will be returned.
+    pub fn finish(&mut self) -> Result<W> {
+        // If we could consume self in finish(), we wouldn't have to worry about this case, but
+        // finish() is retryable in the face of I/O errors, so we can't consume here.
+        if self.delegate.is_none() {
+            panic!("Encoder has already had finish() called");
+        };
+
+        self.write_final_leftovers()?;
+
+        let writer = self.delegate.take().expect("Writer must be present");
+
+        Ok(writer)
+    }
+
+    /// Write any remaining buffered data to the delegate writer.
+    fn write_final_leftovers(&mut self) -> Result<()> {
+        if self.delegate.is_none() {
+            // finish() has already successfully called this, and we are now in drop() with a None
+            // writer, so just no-op
+            return Ok(());
+        }
+
+        self.write_all_encoded_output()?;
+
+        if self.extra_input_occupied_len > 0 {
+            let encoded_len = self
+                .engine
+                .encode_slice(
+                    &self.extra_input[..self.extra_input_occupied_len],
+                    &mut self.output[..],
+                )
+                .expect("buffer is large enough");
+
+            self.output_occupied_len = encoded_len;
+
+            self.write_all_encoded_output()?;
+
+            // write succeeded, do not write the encoding of extra again if finish() is retried
+            self.extra_input_occupied_len = 0;
+        }
+
+        Ok(())
+    }
+
+    /// Write as much of the encoded output to the delegate writer as it will accept, and store the
+    /// leftovers to be attempted at the next write() call. Updates `self.output_occupied_len`.
+    ///
+    /// # Errors
+    ///
+    /// Errors from the delegate writer are returned. In the case of an error,
+    /// `self.output_occupied_len` will not be updated, as errors from `write` are specified to mean
+    /// that no write took place.
+    fn write_to_delegate(&mut self, current_output_len: usize) -> Result<()> {
+        self.panicked = true;
+        let res = self
+            .delegate
+            .as_mut()
+            .expect("Writer must be present")
+            .write(&self.output[..current_output_len]);
+        self.panicked = false;
+
+        res.map(|consumed| {
+            debug_assert!(consumed <= current_output_len);
+
+            if consumed < current_output_len {
+                self.output_occupied_len = current_output_len.checked_sub(consumed).unwrap();
+                // If we're blocking on I/O, the minor inefficiency of copying bytes to the
+                // start of the buffer is the least of our concerns...
+                // TODO Rotate moves more than we need to; copy_within now stable.
+                self.output.rotate_left(consumed);
+            } else {
+                self.output_occupied_len = 0;
+            }
+        })
+    }
+
+    /// Write all buffered encoded output. If this returns `Ok`, `self.output_occupied_len` is `0`.
+    ///
+    /// This is basically write_all for the remaining buffered data but without the undesirable
+    /// abort-on-`Ok(0)` behavior.
+    ///
+    /// # Errors
+    ///
+    /// Any error emitted by the delegate writer abort the write loop and is returned, unless it's
+    /// `Interrupted`, in which case the error is ignored and writes will continue.
+    fn write_all_encoded_output(&mut self) -> Result<()> {
+        while self.output_occupied_len > 0 {
+            let remaining_len = self.output_occupied_len;
+            match self.write_to_delegate(remaining_len) {
+                // try again on interrupts ala write_all
+                Err(ref e) if e.kind() == ErrorKind::Interrupted => {}
+                // other errors return
+                Err(e) => return Err(e),
+                // success no-ops because remaining length is already updated
+                Ok(_) => {}
+            };
+        }
+
+        debug_assert_eq!(0, self.output_occupied_len);
+        Ok(())
+    }
+
+    /// Unwraps this `EncoderWriter`, returning the base writer it writes base64 encoded output
+    /// to.
+    ///
+    /// Normally this method should not be needed, since `finish()` returns the inner writer if
+    /// it completes successfully. That will also ensure all data has been flushed, which the
+    /// `into_inner()` function does *not* do.
+    ///
+    /// Calling this method after `finish()` has completed successfully will panic, since the
+    /// writer has already been returned.
+    ///
+    /// This method may be useful if the writer implements additional APIs beyond the `Write`
+    /// trait. Note that the inner writer might be in an error state or have an incomplete
+    /// base64 string written to it.
+    pub fn into_inner(mut self) -> W {
+        self.delegate
+            .take()
+            .expect("Encoder has already had finish() called")
+    }
+}
+
+impl<'e, E: Engine, W: io::Write> io::Write for EncoderWriter<'e, E, W> {
+    /// Encode input and then write to the delegate writer.
+    ///
+    /// Under non-error circumstances, this returns `Ok` with the value being the number of bytes
+    /// of `input` consumed. The value may be `0`, which interacts poorly with `write_all`, which
+    /// interprets `Ok(0)` as an error, despite it being allowed by the contract of `write`. See
+    /// <https://github.com/rust-lang/rust/issues/56889> for more on that.
+    ///
+    /// If the previous call to `write` provided more (encoded) data than the delegate writer could
+    /// accept in a single call to its `write`, the remaining data is buffered. As long as buffered
+    /// data is present, subsequent calls to `write` will try to write the remaining buffered data
+    /// to the delegate and return either `Ok(0)` -- and therefore not consume any of `input` -- or
+    /// an error.
+    ///
+    /// # Errors
+    ///
+    /// Any errors emitted by the delegate writer are returned.
+    fn write(&mut self, input: &[u8]) -> Result<usize> {
+        if self.delegate.is_none() {
+            panic!("Cannot write more after calling finish()");
+        }
+
+        if input.is_empty() {
+            return Ok(0);
+        }
+
+        // The contract of `Write::write` places some constraints on this implementation:
+        // - a call to `write()` represents at most one call to a wrapped `Write`, so we can't
+        // iterate over the input and encode multiple chunks.
+        // - Errors mean that "no bytes were written to this writer", so we need to reset the
+        // internal state to what it was before the error occurred
+
+        // before reading any input, write any leftover encoded output from last time
+        if self.output_occupied_len > 0 {
+            let current_len = self.output_occupied_len;
+            return self
+                .write_to_delegate(current_len)
+                // did not read any input
+                .map(|_| 0);
+        }
+
+        debug_assert_eq!(0, self.output_occupied_len);
+
+        // how many bytes, if any, were read into `extra` to create a triple to encode
+        let mut extra_input_read_len = 0;
+        let mut input = input;
+
+        let orig_extra_len = self.extra_input_occupied_len;
+
+        let mut encoded_size = 0;
+        // always a multiple of MIN_ENCODE_CHUNK_SIZE
+        let mut max_input_len = MAX_INPUT_LEN;
+
+        // process leftover un-encoded input from last write
+        if self.extra_input_occupied_len > 0 {
+            debug_assert!(self.extra_input_occupied_len < 3);
+            if input.len() + self.extra_input_occupied_len >= MIN_ENCODE_CHUNK_SIZE {
+                // Fill up `extra`, encode that into `output`, and consume as much of the rest of
+                // `input` as possible.
+                // We could write just the encoding of `extra` by itself but then we'd have to
+                // return after writing only 4 bytes, which is inefficient if the underlying writer
+                // would make a syscall.
+                extra_input_read_len = MIN_ENCODE_CHUNK_SIZE - self.extra_input_occupied_len;
+                debug_assert!(extra_input_read_len > 0);
+                // overwrite only bytes that weren't already used. If we need to rollback extra_len
+                // (when the subsequent write errors), the old leading bytes will still be there.
+                self.extra_input[self.extra_input_occupied_len..MIN_ENCODE_CHUNK_SIZE]
+                    .copy_from_slice(&input[0..extra_input_read_len]);
+
+                let len = self.engine.internal_encode(
+                    &self.extra_input[0..MIN_ENCODE_CHUNK_SIZE],
+                    &mut self.output[..],
+                );
+                debug_assert_eq!(4, len);
+
+                input = &input[extra_input_read_len..];
+
+                // consider extra to be used up, since we encoded it
+                self.extra_input_occupied_len = 0;
+                // don't clobber where we just encoded to
+                encoded_size = 4;
+                // and don't read more than can be encoded
+                max_input_len = MAX_INPUT_LEN - MIN_ENCODE_CHUNK_SIZE;
+
+            // fall through to normal encoding
+            } else {
+                // `extra` and `input` are non empty, but `|extra| + |input| < 3`, so there must be
+                // 1 byte in each.
+                debug_assert_eq!(1, input.len());
+                debug_assert_eq!(1, self.extra_input_occupied_len);
+
+                self.extra_input[self.extra_input_occupied_len] = input[0];
+                self.extra_input_occupied_len += 1;
+                return Ok(1);
+            };
+        } else if input.len() < MIN_ENCODE_CHUNK_SIZE {
+            // `extra` is empty, and `input` fits inside it
+            self.extra_input[0..input.len()].copy_from_slice(input);
+            self.extra_input_occupied_len = input.len();
+            return Ok(input.len());
+        };
+
+        // either 0 or 1 complete chunks encoded from extra
+        debug_assert!(encoded_size == 0 || encoded_size == 4);
+        debug_assert!(
+            // didn't encode extra input
+            MAX_INPUT_LEN == max_input_len
+                // encoded one triple
+                || MAX_INPUT_LEN == max_input_len + MIN_ENCODE_CHUNK_SIZE
+        );
+
+        // encode complete triples only
+        let input_complete_chunks_len = input.len() - (input.len() % MIN_ENCODE_CHUNK_SIZE);
+        let input_chunks_to_encode_len = cmp::min(input_complete_chunks_len, max_input_len);
+        debug_assert_eq!(0, max_input_len % MIN_ENCODE_CHUNK_SIZE);
+        debug_assert_eq!(0, input_chunks_to_encode_len % MIN_ENCODE_CHUNK_SIZE);
+
+        encoded_size += self.engine.internal_encode(
+            &input[..(input_chunks_to_encode_len)],
+            &mut self.output[encoded_size..],
+        );
+
+        // not updating `self.output_occupied_len` here because if the below write fails, it should
+        // "never take place" -- the buffer contents we encoded are ignored and perhaps retried
+        // later, if the consumer chooses.
+
+        self.write_to_delegate(encoded_size)
+            // no matter whether we wrote the full encoded buffer or not, we consumed the same
+            // input
+            .map(|_| extra_input_read_len + input_chunks_to_encode_len)
+            .map_err(|e| {
+                // in case we filled and encoded `extra`, reset extra_len
+                self.extra_input_occupied_len = orig_extra_len;
+
+                e
+            })
+    }
+
+    /// Because this is usually treated as OK to call multiple times, it will *not* flush any
+    /// incomplete chunks of input or write padding.
+    /// # Errors
+    ///
+    /// The first error that is not of [`ErrorKind::Interrupted`] will be returned.
+    fn flush(&mut self) -> Result<()> {
+        self.write_all_encoded_output()?;
+        self.delegate
+            .as_mut()
+            .expect("Writer must be present")
+            .flush()
+    }
+}
+
+impl<'e, E: Engine, W: io::Write> Drop for EncoderWriter<'e, E, W> {
+    fn drop(&mut self) {
+        if !self.panicked {
+            // like `BufWriter`, ignore errors during drop
+            let _ = self.write_final_leftovers();
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/base64/src/write/encoder_string_writer.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/write/encoder_string_writer.rs
--- 43.0.0-1/rust-vendor/base64/src/write/encoder_string_writer.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/write/encoder_string_writer.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,207 @@
+use super::encoder::EncoderWriter;
+use crate::engine::Engine;
+use std::io;
+
+/// A `Write` implementation that base64-encodes data using the provided config and accumulates the
+/// resulting base64 utf8 `&str` in a [StrConsumer] implementation (typically `String`), which is
+/// then exposed via `into_inner()`.
+///
+/// # Examples
+///
+/// Buffer base64 in a new String:
+///
+/// ```
+/// use std::io::Write;
+/// use base64::engine::general_purpose;
+///
+/// let mut enc = base64::write::EncoderStringWriter::new(&general_purpose::STANDARD);
+///
+/// enc.write_all(b"asdf").unwrap();
+///
+/// // get the resulting String
+/// let b64_string = enc.into_inner();
+///
+/// assert_eq!("YXNkZg==", &b64_string);
+/// ```
+///
+/// Or, append to an existing `String`, which implements `StrConsumer`:
+///
+/// ```
+/// use std::io::Write;
+/// use base64::engine::general_purpose;
+///
+/// let mut buf = String::from("base64: ");
+///
+/// let mut enc = base64::write::EncoderStringWriter::from_consumer(
+///     &mut buf,
+///     &general_purpose::STANDARD);
+///
+/// enc.write_all(b"asdf").unwrap();
+///
+/// // release the &mut reference on buf
+/// let _ = enc.into_inner();
+///
+/// assert_eq!("base64: YXNkZg==", &buf);
+/// ```
+///
+/// # Performance
+///
+/// Because it has to validate that the base64 is UTF-8, it is about 80% as fast as writing plain
+/// bytes to a `io::Write`.
+pub struct EncoderStringWriter<'e, E: Engine, S: StrConsumer> {
+    encoder: EncoderWriter<'e, E, Utf8SingleCodeUnitWriter<S>>,
+}
+
+impl<'e, E: Engine, S: StrConsumer> EncoderStringWriter<'e, E, S> {
+    /// Create a EncoderStringWriter that will append to the provided `StrConsumer`.
+    pub fn from_consumer(str_consumer: S, engine: &'e E) -> Self {
+        EncoderStringWriter {
+            encoder: EncoderWriter::new(Utf8SingleCodeUnitWriter { str_consumer }, engine),
+        }
+    }
+
+    /// Encode all remaining buffered data, including any trailing incomplete input triples and
+    /// associated padding.
+    ///
+    /// Returns the base64-encoded form of the accumulated written data.
+    pub fn into_inner(mut self) -> S {
+        self.encoder
+            .finish()
+            .expect("Writing to a consumer should never fail")
+            .str_consumer
+    }
+}
+
+impl<'e, E: Engine> EncoderStringWriter<'e, E, String> {
+    /// Create a EncoderStringWriter that will encode into a new `String` with the provided config.
+    pub fn new(engine: &'e E) -> Self {
+        EncoderStringWriter::from_consumer(String::new(), engine)
+    }
+}
+
+impl<'e, E: Engine, S: StrConsumer> io::Write for EncoderStringWriter<'e, E, S> {
+    fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
+        self.encoder.write(buf)
+    }
+
+    fn flush(&mut self) -> io::Result<()> {
+        self.encoder.flush()
+    }
+}
+
+/// An abstraction around consuming `str`s produced by base64 encoding.
+pub trait StrConsumer {
+    /// Consume the base64 encoded data in `buf`
+    fn consume(&mut self, buf: &str);
+}
+
+/// As for io::Write, `StrConsumer` is implemented automatically for `&mut S`.
+impl<S: StrConsumer + ?Sized> StrConsumer for &mut S {
+    fn consume(&mut self, buf: &str) {
+        (**self).consume(buf);
+    }
+}
+
+/// Pushes the str onto the end of the String
+impl StrConsumer for String {
+    fn consume(&mut self, buf: &str) {
+        self.push_str(buf);
+    }
+}
+
+/// A `Write` that only can handle bytes that are valid single-byte UTF-8 code units.
+///
+/// This is safe because we only use it when writing base64, which is always valid UTF-8.
+struct Utf8SingleCodeUnitWriter<S: StrConsumer> {
+    str_consumer: S,
+}
+
+impl<S: StrConsumer> io::Write for Utf8SingleCodeUnitWriter<S> {
+    fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
+        // Because we expect all input to be valid utf-8 individual bytes, we can encode any buffer
+        // length
+        let s = std::str::from_utf8(buf).expect("Input must be valid UTF-8");
+
+        self.str_consumer.consume(s);
+
+        Ok(buf.len())
+    }
+
+    fn flush(&mut self) -> io::Result<()> {
+        // no op
+        Ok(())
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::{
+        engine::Engine, tests::random_engine, write::encoder_string_writer::EncoderStringWriter,
+    };
+    use rand::Rng;
+    use std::cmp;
+    use std::io::Write;
+
+    #[test]
+    fn every_possible_split_of_input() {
+        let mut rng = rand::thread_rng();
+        let mut orig_data = Vec::<u8>::new();
+        let mut normal_encoded = String::new();
+
+        let size = 5_000;
+
+        for i in 0..size {
+            orig_data.clear();
+            normal_encoded.clear();
+
+            orig_data.resize(size, 0);
+            rng.fill(&mut orig_data[..]);
+
+            let engine = random_engine(&mut rng);
+            engine.encode_string(&orig_data, &mut normal_encoded);
+
+            let mut stream_encoder = EncoderStringWriter::new(&engine);
+            // Write the first i bytes, then the rest
+            stream_encoder.write_all(&orig_data[0..i]).unwrap();
+            stream_encoder.write_all(&orig_data[i..]).unwrap();
+
+            let stream_encoded = stream_encoder.into_inner();
+
+            assert_eq!(normal_encoded, stream_encoded);
+        }
+    }
+    #[test]
+    fn incremental_writes() {
+        let mut rng = rand::thread_rng();
+        let mut orig_data = Vec::<u8>::new();
+        let mut normal_encoded = String::new();
+
+        let size = 5_000;
+
+        for _ in 0..size {
+            orig_data.clear();
+            normal_encoded.clear();
+
+            orig_data.resize(size, 0);
+            rng.fill(&mut orig_data[..]);
+
+            let engine = random_engine(&mut rng);
+            engine.encode_string(&orig_data, &mut normal_encoded);
+
+            let mut stream_encoder = EncoderStringWriter::new(&engine);
+            // write small nibbles of data
+            let mut offset = 0;
+            while offset < size {
+                let nibble_size = cmp::min(rng.gen_range(0..=64), size - offset);
+                let len = stream_encoder
+                    .write(&orig_data[offset..offset + nibble_size])
+                    .unwrap();
+                offset += len;
+            }
+
+            let stream_encoded = stream_encoder.into_inner();
+
+            assert_eq!(normal_encoded, stream_encoded);
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/base64/src/write/encoder_tests.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/write/encoder_tests.rs
--- 43.0.0-1/rust-vendor/base64/src/write/encoder_tests.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/write/encoder_tests.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,554 @@
+use std::io::{Cursor, Write};
+use std::{cmp, io, str};
+
+use rand::Rng;
+
+use crate::{
+    alphabet::{STANDARD, URL_SAFE},
+    engine::{
+        general_purpose::{GeneralPurpose, NO_PAD, PAD},
+        Engine,
+    },
+    tests::random_engine,
+};
+
+use super::EncoderWriter;
+
+const URL_SAFE_ENGINE: GeneralPurpose = GeneralPurpose::new(&URL_SAFE, PAD);
+const NO_PAD_ENGINE: GeneralPurpose = GeneralPurpose::new(&STANDARD, NO_PAD);
+
+#[test]
+fn encode_three_bytes() {
+    let mut c = Cursor::new(Vec::new());
+    {
+        let mut enc = EncoderWriter::new(&mut c, &URL_SAFE_ENGINE);
+
+        let sz = enc.write(b"abc").unwrap();
+        assert_eq!(sz, 3);
+    }
+    assert_eq!(&c.get_ref()[..], URL_SAFE_ENGINE.encode("abc").as_bytes());
+}
+
+#[test]
+fn encode_nine_bytes_two_writes() {
+    let mut c = Cursor::new(Vec::new());
+    {
+        let mut enc = EncoderWriter::new(&mut c, &URL_SAFE_ENGINE);
+
+        let sz = enc.write(b"abcdef").unwrap();
+        assert_eq!(sz, 6);
+        let sz = enc.write(b"ghi").unwrap();
+        assert_eq!(sz, 3);
+    }
+    assert_eq!(
+        &c.get_ref()[..],
+        URL_SAFE_ENGINE.encode("abcdefghi").as_bytes()
+    );
+}
+
+#[test]
+fn encode_one_then_two_bytes() {
+    let mut c = Cursor::new(Vec::new());
+    {
+        let mut enc = EncoderWriter::new(&mut c, &URL_SAFE_ENGINE);
+
+        let sz = enc.write(b"a").unwrap();
+        assert_eq!(sz, 1);
+        let sz = enc.write(b"bc").unwrap();
+        assert_eq!(sz, 2);
+    }
+    assert_eq!(&c.get_ref()[..], URL_SAFE_ENGINE.encode("abc").as_bytes());
+}
+
+#[test]
+fn encode_one_then_five_bytes() {
+    let mut c = Cursor::new(Vec::new());
+    {
+        let mut enc = EncoderWriter::new(&mut c, &URL_SAFE_ENGINE);
+
+        let sz = enc.write(b"a").unwrap();
+        assert_eq!(sz, 1);
+        let sz = enc.write(b"bcdef").unwrap();
+        assert_eq!(sz, 5);
+    }
+    assert_eq!(
+        &c.get_ref()[..],
+        URL_SAFE_ENGINE.encode("abcdef").as_bytes()
+    );
+}
+
+#[test]
+fn encode_1_2_3_bytes() {
+    let mut c = Cursor::new(Vec::new());
+    {
+        let mut enc = EncoderWriter::new(&mut c, &URL_SAFE_ENGINE);
+
+        let sz = enc.write(b"a").unwrap();
+        assert_eq!(sz, 1);
+        let sz = enc.write(b"bc").unwrap();
+        assert_eq!(sz, 2);
+        let sz = enc.write(b"def").unwrap();
+        assert_eq!(sz, 3);
+    }
+    assert_eq!(
+        &c.get_ref()[..],
+        URL_SAFE_ENGINE.encode("abcdef").as_bytes()
+    );
+}
+
+#[test]
+fn encode_with_padding() {
+    let mut c = Cursor::new(Vec::new());
+    {
+        let mut enc = EncoderWriter::new(&mut c, &URL_SAFE_ENGINE);
+
+        enc.write_all(b"abcd").unwrap();
+
+        enc.flush().unwrap();
+    }
+    assert_eq!(&c.get_ref()[..], URL_SAFE_ENGINE.encode("abcd").as_bytes());
+}
+
+#[test]
+fn encode_with_padding_multiple_writes() {
+    let mut c = Cursor::new(Vec::new());
+    {
+        let mut enc = EncoderWriter::new(&mut c, &URL_SAFE_ENGINE);
+
+        assert_eq!(1, enc.write(b"a").unwrap());
+        assert_eq!(2, enc.write(b"bc").unwrap());
+        assert_eq!(3, enc.write(b"def").unwrap());
+        assert_eq!(1, enc.write(b"g").unwrap());
+
+        enc.flush().unwrap();
+    }
+    assert_eq!(
+        &c.get_ref()[..],
+        URL_SAFE_ENGINE.encode("abcdefg").as_bytes()
+    );
+}
+
+#[test]
+fn finish_writes_extra_byte() {
+    let mut c = Cursor::new(Vec::new());
+    {
+        let mut enc = EncoderWriter::new(&mut c, &URL_SAFE_ENGINE);
+
+        assert_eq!(6, enc.write(b"abcdef").unwrap());
+
+        // will be in extra
+        assert_eq!(1, enc.write(b"g").unwrap());
+
+        // 1 trailing byte = 2 encoded chars
+        let _ = enc.finish().unwrap();
+    }
+    assert_eq!(
+        &c.get_ref()[..],
+        URL_SAFE_ENGINE.encode("abcdefg").as_bytes()
+    );
+}
+
+#[test]
+fn write_partial_chunk_encodes_partial_chunk() {
+    let mut c = Cursor::new(Vec::new());
+    {
+        let mut enc = EncoderWriter::new(&mut c, &NO_PAD_ENGINE);
+
+        // nothing encoded yet
+        assert_eq!(2, enc.write(b"ab").unwrap());
+        // encoded here
+        let _ = enc.finish().unwrap();
+    }
+    assert_eq!(&c.get_ref()[..], NO_PAD_ENGINE.encode("ab").as_bytes());
+    assert_eq!(3, c.get_ref().len());
+}
+
+#[test]
+fn write_1_chunk_encodes_complete_chunk() {
+    let mut c = Cursor::new(Vec::new());
+    {
+        let mut enc = EncoderWriter::new(&mut c, &NO_PAD_ENGINE);
+
+        assert_eq!(3, enc.write(b"abc").unwrap());
+        let _ = enc.finish().unwrap();
+    }
+    assert_eq!(&c.get_ref()[..], NO_PAD_ENGINE.encode("abc").as_bytes());
+    assert_eq!(4, c.get_ref().len());
+}
+
+#[test]
+fn write_1_chunk_and_partial_encodes_only_complete_chunk() {
+    let mut c = Cursor::new(Vec::new());
+    {
+        let mut enc = EncoderWriter::new(&mut c, &NO_PAD_ENGINE);
+
+        // "d" not consumed since it's not a full chunk
+        assert_eq!(3, enc.write(b"abcd").unwrap());
+        let _ = enc.finish().unwrap();
+    }
+    assert_eq!(&c.get_ref()[..], NO_PAD_ENGINE.encode("abc").as_bytes());
+    assert_eq!(4, c.get_ref().len());
+}
+
+#[test]
+fn write_2_partials_to_exactly_complete_chunk_encodes_complete_chunk() {
+    let mut c = Cursor::new(Vec::new());
+    {
+        let mut enc = EncoderWriter::new(&mut c, &NO_PAD_ENGINE);
+
+        assert_eq!(1, enc.write(b"a").unwrap());
+        assert_eq!(2, enc.write(b"bc").unwrap());
+        let _ = enc.finish().unwrap();
+    }
+    assert_eq!(&c.get_ref()[..], NO_PAD_ENGINE.encode("abc").as_bytes());
+    assert_eq!(4, c.get_ref().len());
+}
+
+#[test]
+fn write_partial_then_enough_to_complete_chunk_but_not_complete_another_chunk_encodes_complete_chunk_without_consuming_remaining(
+) {
+    let mut c = Cursor::new(Vec::new());
+    {
+        let mut enc = EncoderWriter::new(&mut c, &NO_PAD_ENGINE);
+
+        assert_eq!(1, enc.write(b"a").unwrap());
+        // doesn't consume "d"
+        assert_eq!(2, enc.write(b"bcd").unwrap());
+        let _ = enc.finish().unwrap();
+    }
+    assert_eq!(&c.get_ref()[..], NO_PAD_ENGINE.encode("abc").as_bytes());
+    assert_eq!(4, c.get_ref().len());
+}
+
+#[test]
+fn write_partial_then_enough_to_complete_chunk_and_another_chunk_encodes_complete_chunks() {
+    let mut c = Cursor::new(Vec::new());
+    {
+        let mut enc = EncoderWriter::new(&mut c, &NO_PAD_ENGINE);
+
+        assert_eq!(1, enc.write(b"a").unwrap());
+        // completes partial chunk, and another chunk
+        assert_eq!(5, enc.write(b"bcdef").unwrap());
+        let _ = enc.finish().unwrap();
+    }
+    assert_eq!(&c.get_ref()[..], NO_PAD_ENGINE.encode("abcdef").as_bytes());
+    assert_eq!(8, c.get_ref().len());
+}
+
+#[test]
+fn write_partial_then_enough_to_complete_chunk_and_another_chunk_and_another_partial_chunk_encodes_only_complete_chunks(
+) {
+    let mut c = Cursor::new(Vec::new());
+    {
+        let mut enc = EncoderWriter::new(&mut c, &NO_PAD_ENGINE);
+
+        assert_eq!(1, enc.write(b"a").unwrap());
+        // completes partial chunk, and another chunk, with one more partial chunk that's not
+        // consumed
+        assert_eq!(5, enc.write(b"bcdefe").unwrap());
+        let _ = enc.finish().unwrap();
+    }
+    assert_eq!(&c.get_ref()[..], NO_PAD_ENGINE.encode("abcdef").as_bytes());
+    assert_eq!(8, c.get_ref().len());
+}
+
+#[test]
+fn drop_calls_finish_for_you() {
+    let mut c = Cursor::new(Vec::new());
+    {
+        let mut enc = EncoderWriter::new(&mut c, &NO_PAD_ENGINE);
+        assert_eq!(1, enc.write(b"a").unwrap());
+    }
+    assert_eq!(&c.get_ref()[..], NO_PAD_ENGINE.encode("a").as_bytes());
+    assert_eq!(2, c.get_ref().len());
+}
+
+#[test]
+fn every_possible_split_of_input() {
+    let mut rng = rand::thread_rng();
+    let mut orig_data = Vec::<u8>::new();
+    let mut stream_encoded = Vec::<u8>::new();
+    let mut normal_encoded = String::new();
+
+    let size = 5_000;
+
+    for i in 0..size {
+        orig_data.clear();
+        stream_encoded.clear();
+        normal_encoded.clear();
+
+        for _ in 0..size {
+            orig_data.push(rng.gen());
+        }
+
+        let engine = random_engine(&mut rng);
+        engine.encode_string(&orig_data, &mut normal_encoded);
+
+        {
+            let mut stream_encoder = EncoderWriter::new(&mut stream_encoded, &engine);
+            // Write the first i bytes, then the rest
+            stream_encoder.write_all(&orig_data[0..i]).unwrap();
+            stream_encoder.write_all(&orig_data[i..]).unwrap();
+        }
+
+        assert_eq!(normal_encoded, str::from_utf8(&stream_encoded).unwrap());
+    }
+}
+
+#[test]
+fn encode_random_config_matches_normal_encode_reasonable_input_len() {
+    // choose up to 2 * buf size, so ~half the time it'll use a full buffer
+    do_encode_random_config_matches_normal_encode(super::encoder::BUF_SIZE * 2);
+}
+
+#[test]
+fn encode_random_config_matches_normal_encode_tiny_input_len() {
+    do_encode_random_config_matches_normal_encode(10);
+}
+
+#[test]
+fn retrying_writes_that_error_with_interrupted_works() {
+    let mut rng = rand::thread_rng();
+    let mut orig_data = Vec::<u8>::new();
+    let mut stream_encoded = Vec::<u8>::new();
+    let mut normal_encoded = String::new();
+
+    for _ in 0..1_000 {
+        orig_data.clear();
+        stream_encoded.clear();
+        normal_encoded.clear();
+
+        let orig_len: usize = rng.gen_range(100..20_000);
+        for _ in 0..orig_len {
+            orig_data.push(rng.gen());
+        }
+
+        // encode the normal way
+        let engine = random_engine(&mut rng);
+        engine.encode_string(&orig_data, &mut normal_encoded);
+
+        // encode via the stream encoder
+        {
+            let mut interrupt_rng = rand::thread_rng();
+            let mut interrupting_writer = InterruptingWriter {
+                w: &mut stream_encoded,
+                rng: &mut interrupt_rng,
+                fraction: 0.8,
+            };
+
+            let mut stream_encoder = EncoderWriter::new(&mut interrupting_writer, &engine);
+            let mut bytes_consumed = 0;
+            while bytes_consumed < orig_len {
+                // use short inputs since we want to use `extra` a lot as that's what needs rollback
+                // when errors occur
+                let input_len: usize = cmp::min(rng.gen_range(0..10), orig_len - bytes_consumed);
+
+                retry_interrupted_write_all(
+                    &mut stream_encoder,
+                    &orig_data[bytes_consumed..bytes_consumed + input_len],
+                )
+                .unwrap();
+
+                bytes_consumed += input_len;
+            }
+
+            loop {
+                let res = stream_encoder.finish();
+                match res {
+                    Ok(_) => break,
+                    Err(e) => match e.kind() {
+                        io::ErrorKind::Interrupted => continue,
+                        _ => panic!("{:?}", e), // bail
+                    },
+                }
+            }
+
+            assert_eq!(orig_len, bytes_consumed);
+        }
+
+        assert_eq!(normal_encoded, str::from_utf8(&stream_encoded).unwrap());
+    }
+}
+
+#[test]
+fn writes_that_only_write_part_of_input_and_sometimes_interrupt_produce_correct_encoded_data() {
+    let mut rng = rand::thread_rng();
+    let mut orig_data = Vec::<u8>::new();
+    let mut stream_encoded = Vec::<u8>::new();
+    let mut normal_encoded = String::new();
+
+    for _ in 0..1_000 {
+        orig_data.clear();
+        stream_encoded.clear();
+        normal_encoded.clear();
+
+        let orig_len: usize = rng.gen_range(100..20_000);
+        for _ in 0..orig_len {
+            orig_data.push(rng.gen());
+        }
+
+        // encode the normal way
+        let engine = random_engine(&mut rng);
+        engine.encode_string(&orig_data, &mut normal_encoded);
+
+        // encode via the stream encoder
+        {
+            let mut partial_rng = rand::thread_rng();
+            let mut partial_writer = PartialInterruptingWriter {
+                w: &mut stream_encoded,
+                rng: &mut partial_rng,
+                full_input_fraction: 0.1,
+                no_interrupt_fraction: 0.1,
+            };
+
+            let mut stream_encoder = EncoderWriter::new(&mut partial_writer, &engine);
+            let mut bytes_consumed = 0;
+            while bytes_consumed < orig_len {
+                // use at most medium-length inputs to exercise retry logic more aggressively
+                let input_len: usize = cmp::min(rng.gen_range(0..100), orig_len - bytes_consumed);
+
+                let res =
+                    stream_encoder.write(&orig_data[bytes_consumed..bytes_consumed + input_len]);
+
+                // retry on interrupt
+                match res {
+                    Ok(len) => bytes_consumed += len,
+                    Err(e) => match e.kind() {
+                        io::ErrorKind::Interrupted => continue,
+                        _ => {
+                            panic!("should not see other errors");
+                        }
+                    },
+                }
+            }
+
+            let _ = stream_encoder.finish().unwrap();
+
+            assert_eq!(orig_len, bytes_consumed);
+        }
+
+        assert_eq!(normal_encoded, str::from_utf8(&stream_encoded).unwrap());
+    }
+}
+
+/// Retry writes until all the data is written or an error that isn't Interrupted is returned.
+fn retry_interrupted_write_all<W: Write>(w: &mut W, buf: &[u8]) -> io::Result<()> {
+    let mut bytes_consumed = 0;
+
+    while bytes_consumed < buf.len() {
+        let res = w.write(&buf[bytes_consumed..]);
+
+        match res {
+            Ok(len) => bytes_consumed += len,
+            Err(e) => match e.kind() {
+                io::ErrorKind::Interrupted => continue,
+                _ => return Err(e),
+            },
+        }
+    }
+
+    Ok(())
+}
+
+fn do_encode_random_config_matches_normal_encode(max_input_len: usize) {
+    let mut rng = rand::thread_rng();
+    let mut orig_data = Vec::<u8>::new();
+    let mut stream_encoded = Vec::<u8>::new();
+    let mut normal_encoded = String::new();
+
+    for _ in 0..1_000 {
+        orig_data.clear();
+        stream_encoded.clear();
+        normal_encoded.clear();
+
+        let orig_len: usize = rng.gen_range(100..20_000);
+        for _ in 0..orig_len {
+            orig_data.push(rng.gen());
+        }
+
+        // encode the normal way
+        let engine = random_engine(&mut rng);
+        engine.encode_string(&orig_data, &mut normal_encoded);
+
+        // encode via the stream encoder
+        {
+            let mut stream_encoder = EncoderWriter::new(&mut stream_encoded, &engine);
+            let mut bytes_consumed = 0;
+            while bytes_consumed < orig_len {
+                let input_len: usize =
+                    cmp::min(rng.gen_range(0..max_input_len), orig_len - bytes_consumed);
+
+                // write a little bit of the data
+                stream_encoder
+                    .write_all(&orig_data[bytes_consumed..bytes_consumed + input_len])
+                    .unwrap();
+
+                bytes_consumed += input_len;
+            }
+
+            let _ = stream_encoder.finish().unwrap();
+
+            assert_eq!(orig_len, bytes_consumed);
+        }
+
+        assert_eq!(normal_encoded, str::from_utf8(&stream_encoded).unwrap());
+    }
+}
+
+/// A `Write` implementation that returns Interrupted some fraction of the time, randomly.
+struct InterruptingWriter<'a, W: 'a + Write, R: 'a + Rng> {
+    w: &'a mut W,
+    rng: &'a mut R,
+    /// In [0, 1]. If a random number in [0, 1] is  `<= threshold`, `Write` methods will return
+    /// an `Interrupted` error
+    fraction: f64,
+}
+
+impl<'a, W: Write, R: Rng> Write for InterruptingWriter<'a, W, R> {
+    fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
+        if self.rng.gen_range(0.0..1.0) <= self.fraction {
+            return Err(io::Error::new(io::ErrorKind::Interrupted, "interrupted"));
+        }
+
+        self.w.write(buf)
+    }
+
+    fn flush(&mut self) -> io::Result<()> {
+        if self.rng.gen_range(0.0..1.0) <= self.fraction {
+            return Err(io::Error::new(io::ErrorKind::Interrupted, "interrupted"));
+        }
+
+        self.w.flush()
+    }
+}
+
+/// A `Write` implementation that sometimes will only write part of its input.
+struct PartialInterruptingWriter<'a, W: 'a + Write, R: 'a + Rng> {
+    w: &'a mut W,
+    rng: &'a mut R,
+    /// In [0, 1]. If a random number in [0, 1] is  `<= threshold`, `write()` will write all its
+    /// input. Otherwise, it will write a random substring
+    full_input_fraction: f64,
+    no_interrupt_fraction: f64,
+}
+
+impl<'a, W: Write, R: Rng> Write for PartialInterruptingWriter<'a, W, R> {
+    fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
+        if self.rng.gen_range(0.0..1.0) > self.no_interrupt_fraction {
+            return Err(io::Error::new(io::ErrorKind::Interrupted, "interrupted"));
+        }
+
+        if self.rng.gen_range(0.0..1.0) <= self.full_input_fraction || buf.is_empty() {
+            // pass through the buf untouched
+            self.w.write(buf)
+        } else {
+            // only use a prefix of it
+            self.w
+                .write(&buf[0..(self.rng.gen_range(0..(buf.len() - 1)))])
+        }
+    }
+
+    fn flush(&mut self) -> io::Result<()> {
+        self.w.flush()
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/base64/src/write/mod.rs 43.0.0-1ubuntu1/rust-vendor/base64/src/write/mod.rs
--- 43.0.0-1/rust-vendor/base64/src/write/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/src/write/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,11 @@
+//! Implementations of `io::Write` to transparently handle base64.
+mod encoder;
+mod encoder_string_writer;
+
+pub use self::{
+    encoder::EncoderWriter,
+    encoder_string_writer::{EncoderStringWriter, StrConsumer},
+};
+
+#[cfg(test)]
+mod encoder_tests;
diff -pruN 43.0.0-1/rust-vendor/base64/tests/encode.rs 43.0.0-1ubuntu1/rust-vendor/base64/tests/encode.rs
--- 43.0.0-1/rust-vendor/base64/tests/encode.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/tests/encode.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,77 @@
+use base64::{
+    alphabet::URL_SAFE, engine::general_purpose::PAD, engine::general_purpose::STANDARD, *,
+};
+
+fn compare_encode(expected: &str, target: &[u8]) {
+    assert_eq!(expected, STANDARD.encode(target));
+}
+
+#[test]
+fn encode_all_ascii() {
+    let ascii: Vec<u8> = (0..=127).collect();
+
+    compare_encode(
+        "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7P\
+         D0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn8\
+         =",
+        &ascii,
+    );
+}
+
+#[test]
+fn encode_all_bytes() {
+    let bytes: Vec<u8> = (0..=255).collect();
+
+    compare_encode(
+        "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7P\
+         D0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn\
+         +AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6\
+         /wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w==",
+        &bytes,
+    );
+}
+
+#[test]
+fn encode_all_bytes_url() {
+    let bytes: Vec<u8> = (0..=255).collect();
+
+    assert_eq!(
+        "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0\
+         -P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn\
+         -AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq\
+         -wsbKztLW2t7i5uru8vb6_wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t_g4eLj5OXm5-jp6uvs7e7v8PHy\
+         8_T19vf4-fr7_P3-_w==",
+        &engine::GeneralPurpose::new(&URL_SAFE, PAD).encode(bytes)
+    );
+}
+
+#[test]
+fn encoded_len_unpadded() {
+    assert_eq!(0, encoded_len(0, false).unwrap());
+    assert_eq!(2, encoded_len(1, false).unwrap());
+    assert_eq!(3, encoded_len(2, false).unwrap());
+    assert_eq!(4, encoded_len(3, false).unwrap());
+    assert_eq!(6, encoded_len(4, false).unwrap());
+    assert_eq!(7, encoded_len(5, false).unwrap());
+    assert_eq!(8, encoded_len(6, false).unwrap());
+    assert_eq!(10, encoded_len(7, false).unwrap());
+}
+
+#[test]
+fn encoded_len_padded() {
+    assert_eq!(0, encoded_len(0, true).unwrap());
+    assert_eq!(4, encoded_len(1, true).unwrap());
+    assert_eq!(4, encoded_len(2, true).unwrap());
+    assert_eq!(4, encoded_len(3, true).unwrap());
+    assert_eq!(8, encoded_len(4, true).unwrap());
+    assert_eq!(8, encoded_len(5, true).unwrap());
+    assert_eq!(8, encoded_len(6, true).unwrap());
+    assert_eq!(12, encoded_len(7, true).unwrap());
+}
+#[test]
+fn encoded_len_overflow() {
+    let max_size = usize::MAX / 4 * 3 + 2;
+    assert_eq!(2, max_size % 3);
+    assert_eq!(Some(usize::MAX), encoded_len(max_size, false));
+    assert_eq!(None, encoded_len(max_size + 1, false));
+}
diff -pruN 43.0.0-1/rust-vendor/base64/tests/tests.rs 43.0.0-1ubuntu1/rust-vendor/base64/tests/tests.rs
--- 43.0.0-1/rust-vendor/base64/tests/tests.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/base64/tests/tests.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,161 @@
+use rand::{Rng, SeedableRng};
+
+use base64::engine::{general_purpose::STANDARD, Engine};
+use base64::*;
+
+use base64::engine::general_purpose::{GeneralPurpose, NO_PAD};
+
+// generate random contents of the specified length and test encode/decode roundtrip
+fn roundtrip_random<E: Engine>(
+    byte_buf: &mut Vec<u8>,
+    str_buf: &mut String,
+    engine: &E,
+    byte_len: usize,
+    approx_values_per_byte: u8,
+    max_rounds: u64,
+) {
+    // let the short ones be short but don't let it get too crazy large
+    let num_rounds = calculate_number_of_rounds(byte_len, approx_values_per_byte, max_rounds);
+    let mut r = rand::rngs::SmallRng::from_entropy();
+    let mut decode_buf = Vec::new();
+
+    for _ in 0..num_rounds {
+        byte_buf.clear();
+        str_buf.clear();
+        decode_buf.clear();
+        while byte_buf.len() < byte_len {
+            byte_buf.push(r.gen::<u8>());
+        }
+
+        engine.encode_string(&byte_buf, str_buf);
+        engine.decode_vec(&str_buf, &mut decode_buf).unwrap();
+
+        assert_eq!(byte_buf, &decode_buf);
+    }
+}
+
+fn calculate_number_of_rounds(byte_len: usize, approx_values_per_byte: u8, max: u64) -> u64 {
+    // don't overflow
+    let mut prod = approx_values_per_byte as u64;
+
+    for _ in 0..byte_len {
+        if prod > max {
+            return max;
+        }
+
+        prod = prod.saturating_mul(prod);
+    }
+
+    prod
+}
+
+#[test]
+fn roundtrip_random_short_standard() {
+    let mut byte_buf: Vec<u8> = Vec::new();
+    let mut str_buf = String::new();
+
+    for input_len in 0..40 {
+        roundtrip_random(&mut byte_buf, &mut str_buf, &STANDARD, input_len, 4, 10000);
+    }
+}
+
+#[test]
+fn roundtrip_random_with_fast_loop_standard() {
+    let mut byte_buf: Vec<u8> = Vec::new();
+    let mut str_buf = String::new();
+
+    for input_len in 40..100 {
+        roundtrip_random(&mut byte_buf, &mut str_buf, &STANDARD, input_len, 4, 1000);
+    }
+}
+
+#[test]
+fn roundtrip_random_short_no_padding() {
+    let mut byte_buf: Vec<u8> = Vec::new();
+    let mut str_buf = String::new();
+
+    let engine = GeneralPurpose::new(&alphabet::STANDARD, NO_PAD);
+    for input_len in 0..40 {
+        roundtrip_random(&mut byte_buf, &mut str_buf, &engine, input_len, 4, 10000);
+    }
+}
+
+#[test]
+fn roundtrip_random_no_padding() {
+    let mut byte_buf: Vec<u8> = Vec::new();
+    let mut str_buf = String::new();
+
+    let engine = GeneralPurpose::new(&alphabet::STANDARD, NO_PAD);
+
+    for input_len in 40..100 {
+        roundtrip_random(&mut byte_buf, &mut str_buf, &engine, input_len, 4, 1000);
+    }
+}
+
+#[test]
+fn roundtrip_decode_trailing_10_bytes() {
+    // This is a special case because we decode 8 byte blocks of input at a time as much as we can,
+    // ideally unrolled to 32 bytes at a time, in stages 1 and 2. Since we also write a u64's worth
+    // of bytes (8) to the output, we always write 2 garbage bytes that then will be overwritten by
+    // the NEXT block. However, if the next block only contains 2 bytes, it will decode to 1 byte,
+    // and therefore be too short to cover up the trailing 2 garbage bytes. Thus, we have stage 3
+    // to handle that case.
+
+    for num_quads in 0..25 {
+        let mut s: String = "ABCD".repeat(num_quads);
+        s.push_str("EFGHIJKLZg");
+
+        let engine = GeneralPurpose::new(&alphabet::STANDARD, NO_PAD);
+        let decoded = engine.decode(&s).unwrap();
+        assert_eq!(num_quads * 3 + 7, decoded.len());
+
+        assert_eq!(s, engine.encode(&decoded));
+    }
+}
+
+#[test]
+fn display_wrapper_matches_normal_encode() {
+    let mut bytes = Vec::<u8>::with_capacity(256);
+
+    for i in 0..255 {
+        bytes.push(i);
+    }
+    bytes.push(255);
+
+    assert_eq!(
+        STANDARD.encode(&bytes),
+        format!("{}", display::Base64Display::new(&bytes, &STANDARD))
+    );
+}
+
+#[test]
+fn encode_engine_slice_error_when_buffer_too_small() {
+    for num_triples in 1..100 {
+        let input = "AAA".repeat(num_triples);
+        let mut vec = vec![0; (num_triples - 1) * 4];
+        assert_eq!(
+            EncodeSliceError::OutputSliceTooSmall,
+            STANDARD.encode_slice(&input, &mut vec).unwrap_err()
+        );
+        vec.push(0);
+        assert_eq!(
+            EncodeSliceError::OutputSliceTooSmall,
+            STANDARD.encode_slice(&input, &mut vec).unwrap_err()
+        );
+        vec.push(0);
+        assert_eq!(
+            EncodeSliceError::OutputSliceTooSmall,
+            STANDARD.encode_slice(&input, &mut vec).unwrap_err()
+        );
+        vec.push(0);
+        assert_eq!(
+            EncodeSliceError::OutputSliceTooSmall,
+            STANDARD.encode_slice(&input, &mut vec).unwrap_err()
+        );
+        vec.push(0);
+        assert_eq!(
+            num_triples * 4,
+            STANDARD.encode_slice(&input, &mut vec).unwrap()
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/bitflags/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/bitflags/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"CHANGELOG.md":"c98723b209ac4c66625e034b113a55a43a5c1c9e49c0e3b86123d0cd62bae573","CODE_OF_CONDUCT.md":"42634d0f6d922f49857175af991802822f7f920487aefa2ee250a50d12251a66","CONTRIBUTING.md":"6c9f96eacb20af877ae2d16f024904f3038b93448a8488e9dbcac0df7f6439a5","Cargo.lock":"d3e3bce47b94298f2de893a7d91035f2b73a887905a7ffd4ddb668efdd0aee20","Cargo.toml":"92e110c36340bda13f3b329a2aa24aede8bdcb7fa035806926f7ce438dde87f2","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"e9b1329fee85868f1aa674d0505cd95b86a259e2a1762347e5af4a5abedd61d4","SECURITY.md":"68704c8128fa2e776ed7cbda741fbf61ad52f998a96350ee7ee4dbf64c6573bc","benches/parse.rs":"f1390d62322c6880d65bd931e183d49b313f287879a6bfaa36b1cb1921090b51","examples/custom_bits_type.rs":"e53b32051adc5d97860e0b48c8f3a301a041d73b4939c0d7caa5f0cfcc0b9739","examples/custom_derive.rs":"a404e8f606efdd1b43e0c365e4142ccc3dc3ba230127ddeea89cd8784bb55a1e","examples/fmt.rs":"87ba37a1fb8528570c74ea26d8e8948e1179c3d867b928bea1080880258e0a99","examples/macro_free.rs":"69e7f284b53b5214d51228a686e87f127b52a3b74711e45537ebfa5583a180e5","examples/serde.rs":"08b21b35d5c10fdca132fe0f36c8067bb44f559e96617a9257ab6316a20cbc75","spec.md":"fcdd939df30c59b0643be09027df664b71cbea9b9989185441482c5576160fed","src/example_generated.rs":"d018caf059f6ffc4c2403b771a6d76679fa5af03c329a91bd9252957df695e7f","src/external.rs":"734d3f470e6a669297d2df421ce3976fe613d8aa9c071d5ce6fe3ca890e5b815","src/external/arbitrary.rs":"fa8c9187028b9bc54856977b0914676f62101010e7a9450abd577fd78c89552f","src/external/bytemuck.rs":"3afcef382122867040fddd5e4153d633d1ed5596fe5d7dfac66a8e61c2513df5","src/external/serde.rs":"4a09db12534a20fe554a08dc5f1c8124b379292d41fa75628abcd2ca21587573","src/internal.rs":"645b13af0c7302258df61239073a4b8203d09f27b6c17f8a6f1f8c3e427f5334","src/iter.rs":"dbaa6437c1c044f689185ce3fafe43df8796bed19bbdd2c20334a52de5eeee73","src/lib.rs":"1feb0eea02f88491c99c7962b0ce6e66bdedea0ab0cac375d4c9c2d879248dc7","src/parser.rs":"4e788b29f5d0542c409a8b43c703bcb4a6c2a57c181cadd17f565f0abb39681e","src/public.rs":"78ba06e1a5830b36960adf9bd79aaf47d783b9b8a0f1fa33b0d7a340c15fd1d1","src/tests.rs":"b120c27ff0c67a819527de9d8171f1f4c5d37ba4009c54abeb869c70e6035f14","src/tests/all.rs":"e99a865cd4271a524c2fe95503e96d851b35990570aed6fb2e9dac7a14da31b6","src/tests/bits.rs":"3840c34b2ea5d1802404b9ce5bcc1d3fa6ccd8dfba2e29e6d07c605f817d90df","src/tests/complement.rs":"d0e6d4c3daf49e0a7438c9f1c1ac91fad1b37f258c03593f6cd6a695ee626f5e","src/tests/contains.rs":"58bb3cb8c86550e775d11134da1d4aca85c83f943ea454e3a5f222772c674a24","src/tests/difference.rs":"d0d2b96bb52658b8ac019210da74ca75a53e76622f668855142ea6e97c28cb0e","src/tests/empty.rs":"817d6e93ced7cb7576ff0e334aa1a44703f3f96871ff2c6bdcb8f207e6551f67","src/tests/eq.rs":"b816767680a029e9c163e37af074dd4e604c4a3e4936f829f0ca3774fd5f0e37","src/tests/extend.rs":"5fabb9fd0254c64da019149c24063fceff72da3eb4ad73b57c1cc4c04b008364","src/tests/flags.rs":"2f48d3a25db1cf66fe98c9959abc70875deb9f7b38b2c278dc70c46e0d4ec277","src/tests/fmt.rs":"a2d4148491f3202f030f63633eee941b741e3be29a68cf376f008dbe5cb11e5c","src/tests/from_bits.rs":"d94c65b88bf89961d0cfc1b3152a7f1acc285bae160a1628438effda11b8e2c1","src/tests/from_bits_retain.rs":"980591dfaf91e940f42d9a1ce890f237514dd59d458fc264abcf9ceabbc40677","src/tests/from_bits_truncate.rs":"d3406b5e107ebb6449b98a59eee6cc5d84f947d4aaee1ee7e80dc7202de179f0","src/tests/from_name.rs":"f4a055d1f3c86decef70ef8f3020cef5c4e229718c20b3d59d5a3abc3a8b1298","src/tests/insert.rs":"3fab5da800a6fc0654dfb5f859f95da65a507eb9fda8695083c2712266dff0b9","src/tests/intersection.rs":"baf1454c9e4eba552264870a556ee0032d9f2bb8cac361833d571235e0b52221","src/tests/intersects.rs":"c55e36179fd8bc636f04ea9bbce346dcaafe57915d13f1df28c5b83117dbd08e","src/tests/is_all.rs":"b2f11faa7c954bd85c8fb39999e0c37d983cf7895152bc13c7ddde106aa33b6d","src/tests/is_empty.rs":"11f21323cdca7ff92dd89e09de667dba69e8dce88e2d3e27ea68ace91d15d070","src/tests/iter.rs":"4ba121932b527e787b82745405c7c65c1084c242e2dda3290d475ec160d265e4","src/tests/parser.rs":"fa2fb8dedcf16601af609a5e21d9c5840c7f96a1e3a587f7f2ea3dc8387f7628","src/tests/remove.rs":"6e75f8508d2dc1a2cba89ef691f4387a665a4fd13853bb1dd0fd80c783b89947","src/tests/symmetric_difference.rs":"0a89f084f9de1dd5b1932fe72c3b10a3c93cbaa16832b3a31b6a85e3bbd3ba6e","src/tests/union.rs":"88f398ee4600bb1e59bf6d02d1f6ff33f5f853eab5a6c700bd8a683c6ee4651a","src/traits.rs":"b79d008daec546136fae4497966fc85a33663d86ea2d9213fd23b412d4d77b66"},"package":"b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/bitflags/CHANGELOG.md 43.0.0-1ubuntu1/rust-vendor/bitflags/CHANGELOG.md
--- 43.0.0-1/rust-vendor/bitflags/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,553 @@
+# 2.6.0
+
+## What's Changed
+* Sync CHANGELOG.md with github release notes by @dextero in https://github.com/bitflags/bitflags/pull/402
+* Update error messages and zerocopy by @KodrAus in https://github.com/bitflags/bitflags/pull/403
+* Bump minimum declared versions of dependencies by @dextero in https://github.com/bitflags/bitflags/pull/404
+* chore(deps): bump serde_derive and bytemuck versions by @joshka in https://github.com/bitflags/bitflags/pull/405
+* add OSFF Scorecard workflow by @KodrAus in https://github.com/bitflags/bitflags/pull/396
+* Update stderr messages by @KodrAus in https://github.com/bitflags/bitflags/pull/408
+* Fix typo by @waywardmonkeys in https://github.com/bitflags/bitflags/pull/410
+* Allow specifying outer attributes in impl mode by @KodrAus in https://github.com/bitflags/bitflags/pull/411
+
+## New Contributors
+* @dextero made their first contribution in https://github.com/bitflags/bitflags/pull/402
+* @joshka made their first contribution in https://github.com/bitflags/bitflags/pull/405
+* @waywardmonkeys made their first contribution in https://github.com/bitflags/bitflags/pull/410
+
+**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.5.0...2.6.0
+
+# 2.5.0
+
+## What's Changed
+* Derive `Debug` for `Flag<B>` by @tgross35 in https://github.com/bitflags/bitflags/pull/398
+* Support truncating or strict-named variants of parsing and formatting by @KodrAus in https://github.com/bitflags/bitflags/pull/400
+
+## New Contributors
+* @tgross35 made their first contribution in https://github.com/bitflags/bitflags/pull/398
+
+**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.4.2...2.5.0
+
+# 2.4.2
+
+## What's Changed
+* Cargo.toml: Anchor excludes to root of the package by @jamessan in https://github.com/bitflags/bitflags/pull/387
+* Update error messages by @KodrAus in https://github.com/bitflags/bitflags/pull/390
+* Add support for impl mode structs to be repr(packed) by @GnomedDev in https://github.com/bitflags/bitflags/pull/388
+* Remove old `unused_tuple_struct_fields` lint by @dtolnay in https://github.com/bitflags/bitflags/pull/393
+* Delete use of `local_inner_macros` by @dtolnay in https://github.com/bitflags/bitflags/pull/392
+
+## New Contributors
+* @jamessan made their first contribution in https://github.com/bitflags/bitflags/pull/387
+* @GnomedDev made their first contribution in https://github.com/bitflags/bitflags/pull/388
+
+**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.4.1...2.4.2
+
+# 2.4.1
+
+## What's Changed
+* Allow some new pedantic clippy lints by @KodrAus in https://github.com/bitflags/bitflags/pull/380
+
+**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.4.0...2.4.1
+
+# 2.4.0
+
+## What's Changed
+* Remove html_root_url by @eldruin in https://github.com/bitflags/bitflags/pull/368
+* Support unnamed flags by @KodrAus in https://github.com/bitflags/bitflags/pull/371
+* Update smoke test to verify all Clippy and rustc lints by @MitMaro in https://github.com/bitflags/bitflags/pull/374
+* Specify the behavior of bitflags by @KodrAus in https://github.com/bitflags/bitflags/pull/369
+
+## New Contributors
+* @eldruin made their first contribution in https://github.com/bitflags/bitflags/pull/368
+* @MitMaro made their first contribution in https://github.com/bitflags/bitflags/pull/374
+
+**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.3.3...2.4.0
+
+# 2.3.3
+
+## Changes to `-=`
+
+The `-=` operator was incorrectly changed to truncate bits that didn't correspond to valid flags in `2.3.0`. This has
+been fixed up so it once again behaves the same as `-` and `difference`.
+
+## Changes to `!`
+
+The `!` operator previously called `Self::from_bits_truncate`, which would truncate any bits that only partially
+overlapped with a valid flag. It will now use `bits & Self::all().bits()`, so any bits that overlap any bits
+specified by any flag will be respected. This is unlikely to have any practical implications, but enables defining
+a flag like `const ALL = !0` as a way to signal that any bit pattern is a known set of flags.
+
+## Changes to formatting
+
+Zero-valued flags will never be printed. You'll either get `0x0` for empty flags using debug formatting, or the
+set of flags with zero-valued flags omitted for others.
+
+Composite flags will no longer be redundantly printed if there are extra bits to print at the end that don't correspond
+to a valid flag.
+
+## What's Changed
+* Fix up incorrect sub assign behavior and other cleanups by @KodrAus in https://github.com/bitflags/bitflags/pull/366
+
+**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.3.2...2.3.3
+
+# 2.3.2
+
+## What's Changed
+* [doc] [src/lib.rs]  delete redundant path prefix by @OccupyMars2025 in https://github.com/bitflags/bitflags/pull/361
+
+## New Contributors
+* @OccupyMars2025 made their first contribution in https://github.com/bitflags/bitflags/pull/361
+
+**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.3.1...2.3.2
+
+# 2.3.1
+
+## What's Changed
+* Fix Self in flags value expressions by @KodrAus in https://github.com/bitflags/bitflags/pull/355
+
+**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.3.0...2.3.1
+
+# 2.3.0
+
+## Major changes
+
+### `BitFlags` trait deprecated in favor of `Flags` trait
+
+This release introduces the `Flags` trait and deprecates the `BitFlags` trait. These two traits are semver compatible so if you have public API code depending on `BitFlags` you can move to `Flags` without breaking end-users. This is possible because the `BitFlags` trait was never publicly implementable, so it now carries `Flags` as a supertrait. All implementations of `Flags` additionally implement `BitFlags`.
+
+The `Flags` trait is a publicly implementable version of the old `BitFlags` trait. The original `BitFlags` trait carried some macro baggage that made it difficult to implement, so a new `Flags` trait has been introduced as the _One True Trait_ for interacting with flags types generically. See the the `macro_free` and `custom_derive` examples for more details.
+
+### `Bits` trait publicly exposed
+
+The `Bits` trait for the underlying storage of flags values is also now publicly implementable. This lets you define your own exotic backing storage for flags. See the `custom_bits_type` example for more details.
+
+## What's Changed
+* Use explicit hashes for actions steps by @KodrAus in https://github.com/bitflags/bitflags/pull/350
+* Support ejecting flags types from the bitflags macro by @KodrAus in https://github.com/bitflags/bitflags/pull/351
+
+**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.2.1...2.3.0
+
+# 2.2.1
+
+## What's Changed
+* Refactor attribute filtering to apply per-flag by @KodrAus in https://github.com/bitflags/bitflags/pull/345
+
+**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.2.0...2.2.1
+
+# 2.2.0
+
+## What's Changed
+* Create SECURITY.md by @KodrAus in https://github.com/bitflags/bitflags/pull/338
+* add docs to describe the behavior of multi-bit flags by @nicholasbishop in https://github.com/bitflags/bitflags/pull/340
+* Add support for bytemuck by @KodrAus in https://github.com/bitflags/bitflags/pull/336
+* Add a top-level macro for filtering attributes by @KodrAus in https://github.com/bitflags/bitflags/pull/341
+
+## New Contributors
+* @nicholasbishop made their first contribution in https://github.com/bitflags/bitflags/pull/340
+
+**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.1.0...2.2.0
+
+# 2.1.0
+
+## What's Changed
+* Add docs for the internal Field0 and examples of formatting/parsing by @KodrAus in https://github.com/bitflags/bitflags/pull/328
+* Add support for arbitrary by @KodrAus in https://github.com/bitflags/bitflags/pull/324
+* Fix up missing docs for consts within consts by @KodrAus in https://github.com/bitflags/bitflags/pull/330
+* Ignore clippy lint in generated code by @Jake-Shadle in https://github.com/bitflags/bitflags/pull/331
+
+## New Contributors
+* @Jake-Shadle made their first contribution in https://github.com/bitflags/bitflags/pull/331
+
+**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.0.2...2.1.0
+
+# 2.0.2
+
+## What's Changed
+* Fix up missing isize and usize Bits impls by @KodrAus in https://github.com/bitflags/bitflags/pull/321
+
+**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.0.1...2.0.2
+
+# 2.0.1
+
+## What's Changed
+* Fix up some docs issues by @KodrAus in https://github.com/bitflags/bitflags/pull/309
+* Make empty_flag() const. by @tormeh in https://github.com/bitflags/bitflags/pull/313
+* Fix formatting of multi-bit flags with partial overlap by @KodrAus in https://github.com/bitflags/bitflags/pull/316
+
+## New Contributors
+* @tormeh made their first contribution in https://github.com/bitflags/bitflags/pull/313
+
+**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.0.0...2.0.1
+
+# 2.0.0
+
+## Major changes
+
+This release includes some major changes over `1.x`. If you use `bitflags!` types in your public API then upgrading this library may cause breakage in your downstream users.
+
+### ⚠️ Serialization
+
+You'll need to add the `serde` Cargo feature in order to `#[derive(Serialize, Deserialize)]` on your generated flags types:
+
+```rust
+bitflags! {
+    #[derive(Serialize, Deserialize)]
+    #[serde(transparent)]
+    pub struct Flags: T {
+        ..
+    }
+}
+```
+
+where `T` is the underlying bits type you're using, such as `u32`.
+
+The default serialization format with `serde` **has changed** if you `#[derive(Serialize, Deserialize)]` on your generated flags types. It will now use a formatted string for human-readable formats and the underlying bits type for compact formats.
+
+To keep the old format, see the https://github.com/KodrAus/bitflags-serde-legacy library.
+
+### ⚠️ Traits
+
+Generated flags types now derive fewer traits. If you need to maintain backwards compatibility, you can derive the following yourself:
+
+```rust
+#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
+```
+
+### ⚠️ Methods
+
+The unsafe `from_bits_unchecked` method is now a safe `from_bits_retain` method.
+
+You can add the following method to your generated types to keep them compatible:
+
+```rust
+#[deprecated = "use the safe `from_bits_retain` method instead"]
+pub unsafe fn from_bits_unchecked(bits: T) -> Self {
+    Self::from_bits_retain(bits)
+}
+```
+
+where `T` is the underlying bits type you're using, such as `u32`.
+
+### ⚠️ `.bits` field
+
+You can now use the `.bits()` method instead of the old `.bits`.
+
+The representation of generated flags types has changed from a struct with the single field `bits` to a newtype.
+
+## What's Changed
+* Fix a typo and call out MSRV bump by @KodrAus in https://github.com/bitflags/bitflags/pull/259
+* BitFlags trait by @arturoc in https://github.com/bitflags/bitflags/pull/220
+* Add a hidden trait to discourage manual impls of BitFlags by @KodrAus in https://github.com/bitflags/bitflags/pull/261
+* Sanitize `Ok` by @konsumlamm in https://github.com/bitflags/bitflags/pull/266
+* Fix bug in `Debug` implementation by @konsumlamm in https://github.com/bitflags/bitflags/pull/268
+* Fix a typo in the generated documentation by @wackbyte in https://github.com/bitflags/bitflags/pull/271
+* Use SPDX license format by @atouchet in https://github.com/bitflags/bitflags/pull/272
+* serde tests fail in CI by @arturoc in https://github.com/bitflags/bitflags/pull/277
+* Fix beta test output by @KodrAus in https://github.com/bitflags/bitflags/pull/279
+* Add example to the README.md file by @tiaanl in https://github.com/bitflags/bitflags/pull/270
+* Iterator over all the enabled options by @arturoc in https://github.com/bitflags/bitflags/pull/278
+* from_bits_(truncate) fail with composite flags by @arturoc in https://github.com/bitflags/bitflags/pull/276
+* Add more platform coverage to CI by @KodrAus in https://github.com/bitflags/bitflags/pull/280
+* rework the way cfgs are handled by @KodrAus in https://github.com/bitflags/bitflags/pull/281
+* Split generated code into two types by @KodrAus in https://github.com/bitflags/bitflags/pull/282
+* expose bitflags iters using nameable types by @KodrAus in https://github.com/bitflags/bitflags/pull/286
+* Support creating flags from their names by @KodrAus in https://github.com/bitflags/bitflags/pull/287
+* Update README.md by @KodrAus in https://github.com/bitflags/bitflags/pull/288
+* Prepare for 2.0.0-rc.1 release by @KodrAus in https://github.com/bitflags/bitflags/pull/289
+* Add missing "if" to contains doc-comment in traits.rs by @rusty-snake in https://github.com/bitflags/bitflags/pull/291
+* Forbid unsafe_code by @fintelia in https://github.com/bitflags/bitflags/pull/294
+* serde: enable no-std support by @nim65s in https://github.com/bitflags/bitflags/pull/296
+* Add a parser for flags formatted as bar-separated-values by @KodrAus in https://github.com/bitflags/bitflags/pull/297
+* Prepare for 2.0.0-rc.2 release by @KodrAus in https://github.com/bitflags/bitflags/pull/299
+* Use strip_prefix instead of starts_with + slice by @QuinnPainter in https://github.com/bitflags/bitflags/pull/301
+* Fix up some clippy lints by @KodrAus in https://github.com/bitflags/bitflags/pull/302
+* Prepare for 2.0.0-rc.3 release by @KodrAus in https://github.com/bitflags/bitflags/pull/303
+* feat: Add minimum permissions to rust.yml workflow by @gabibguti in https://github.com/bitflags/bitflags/pull/305
+
+## New Contributors
+* @wackbyte made their first contribution in https://github.com/bitflags/bitflags/pull/271
+* @atouchet made their first contribution in https://github.com/bitflags/bitflags/pull/272
+* @tiaanl made their first contribution in https://github.com/bitflags/bitflags/pull/270
+* @rusty-snake made their first contribution in https://github.com/bitflags/bitflags/pull/291
+* @fintelia made their first contribution in https://github.com/bitflags/bitflags/pull/294
+* @nim65s made their first contribution in https://github.com/bitflags/bitflags/pull/296
+* @QuinnPainter made their first contribution in https://github.com/bitflags/bitflags/pull/301
+* @gabibguti made their first contribution in https://github.com/bitflags/bitflags/pull/305
+
+**Full Changelog**: https://github.com/bitflags/bitflags/compare/1.3.2...2.0.0
+
+# 2.0.0-rc.3
+
+## What's Changed
+* Use strip_prefix instead of starts_with + slice by @QuinnPainter in https://github.com/bitflags/bitflags/pull/301
+* Fix up some clippy lints by @KodrAus in https://github.com/bitflags/bitflags/pull/302
+
+## New Contributors
+* @QuinnPainter made their first contribution in https://github.com/bitflags/bitflags/pull/301
+
+**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.0.0-rc.2...2.0.0-rc.3
+
+# 2.0.0-rc.2
+
+## Changes to `serde` serialization
+
+**⚠️ NOTE ⚠️** This release changes the default serialization you'll get if you `#[derive(Serialize, Deserialize)]`
+on your generated flags types. It will now use a formatted string for human-readable formats and the underlying bits
+type for compact formats.
+
+To keep the old behavior, see the [`bitflags-serde-legacy`](https://github.com/KodrAus/bitflags-serde-legacy) library.
+
+## What's Changed
+
+* Add missing "if" to contains doc-comment in traits.rs by @rusty-snake in https://github.com/bitflags/bitflags/pull/291
+* Forbid unsafe_code by @fintelia in https://github.com/bitflags/bitflags/pull/294
+* serde: enable no-std support by @nim65s in https://github.com/bitflags/bitflags/pull/296
+* Add a parser for flags formatted as bar-separated-values by @KodrAus in https://github.com/bitflags/bitflags/pull/297
+
+## New Contributors
+* @rusty-snake made their first contribution in https://github.com/bitflags/bitflags/pull/291
+* @fintelia made their first contribution in https://github.com/bitflags/bitflags/pull/294
+* @nim65s made their first contribution in https://github.com/bitflags/bitflags/pull/296
+
+**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.0.0-rc.1...2.0.0-rc.2
+
+# 2.0.0-rc.1
+
+This is a big release including a few years worth of work on a new `BitFlags` trait, iteration, and better macro organization for future extensibility.
+
+## What's Changed
+* Fix a typo and call out MSRV bump by @KodrAus in https://github.com/bitflags/bitflags/pull/259
+* BitFlags trait by @arturoc in https://github.com/bitflags/bitflags/pull/220
+* Add a hidden trait to discourage manual impls of BitFlags by @KodrAus in https://github.com/bitflags/bitflags/pull/261
+* Sanitize `Ok` by @konsumlamm in https://github.com/bitflags/bitflags/pull/266
+* Fix bug in `Debug` implementation by @konsumlamm in https://github.com/bitflags/bitflags/pull/268
+* Fix a typo in the generated documentation by @wackbyte in https://github.com/bitflags/bitflags/pull/271
+* Use SPDX license format by @atouchet in https://github.com/bitflags/bitflags/pull/272
+* serde tests fail in CI by @arturoc in https://github.com/bitflags/bitflags/pull/277
+* Fix beta test output by @KodrAus in https://github.com/bitflags/bitflags/pull/279
+* Add example to the README.md file by @tiaanl in https://github.com/bitflags/bitflags/pull/270
+* Iterator over all the enabled options by @arturoc in https://github.com/bitflags/bitflags/pull/278
+* from_bits_(truncate) fail with composite flags by @arturoc in https://github.com/bitflags/bitflags/pull/276
+* Add more platform coverage to CI by @KodrAus in https://github.com/bitflags/bitflags/pull/280
+* rework the way cfgs are handled by @KodrAus in https://github.com/bitflags/bitflags/pull/281
+* Split generated code into two types by @KodrAus in https://github.com/bitflags/bitflags/pull/282
+* expose bitflags iters using nameable types by @KodrAus in https://github.com/bitflags/bitflags/pull/286
+* Support creating flags from their names by @KodrAus in https://github.com/bitflags/bitflags/pull/287
+* Update README.md by @KodrAus in https://github.com/bitflags/bitflags/pull/288
+
+## New Contributors
+* @wackbyte made their first contribution in https://github.com/bitflags/bitflags/pull/271
+* @atouchet made their first contribution in https://github.com/bitflags/bitflags/pull/272
+* @tiaanl made their first contribution in https://github.com/bitflags/bitflags/pull/270
+
+**Full Changelog**: https://github.com/bitflags/bitflags/compare/1.3.2...2.0.0-rc.1
+
+# 1.3.2
+
+- Allow `non_snake_case` in generated flags types ([#256])
+
+[#256]: https://github.com/bitflags/bitflags/pull/256
+
+# 1.3.1
+
+- Revert unconditional `#[repr(transparent)]` ([#252])
+
+[#252]: https://github.com/bitflags/bitflags/pull/252
+
+# 1.3.0 (yanked)
+
+**This release bumps the Minimum Supported Rust Version to `1.46.0`**
+
+- Add `#[repr(transparent)]` ([#187])
+
+- End `empty` doc comment with full stop ([#202])
+
+- Fix typo in crate root docs ([#206])
+
+- Document from_bits_unchecked unsafety ([#207])
+
+- Let `is_all` ignore extra bits ([#211])
+
+- Allows empty flag definition ([#225])
+
+- Making crate accessible from std ([#227])
+
+- Make `from_bits` a const fn ([#229])
+
+- Allow multiple bitflags structs in one macro invocation ([#235])
+
+- Add named functions to perform set operations ([#244])
+
+- Fix typos in method docs ([#245])
+
+- Modernization of the `bitflags` macro to take advantage of newer features and 2018 idioms ([#246])
+
+- Fix regression (in an unreleased feature) and simplify tests ([#247])
+
+- Use `Self` and fix bug when overriding `stringify!` ([#249])
+
+[#187]: https://github.com/bitflags/bitflags/pull/187
+[#202]: https://github.com/bitflags/bitflags/pull/202
+[#206]: https://github.com/bitflags/bitflags/pull/206
+[#207]: https://github.com/bitflags/bitflags/pull/207
+[#211]: https://github.com/bitflags/bitflags/pull/211
+[#225]: https://github.com/bitflags/bitflags/pull/225
+[#227]: https://github.com/bitflags/bitflags/pull/227
+[#229]: https://github.com/bitflags/bitflags/pull/229
+[#235]: https://github.com/bitflags/bitflags/pull/235
+[#244]: https://github.com/bitflags/bitflags/pull/244
+[#245]: https://github.com/bitflags/bitflags/pull/245
+[#246]: https://github.com/bitflags/bitflags/pull/246
+[#247]: https://github.com/bitflags/bitflags/pull/247
+[#249]: https://github.com/bitflags/bitflags/pull/249
+
+# 1.2.1
+
+- Remove extraneous `#[inline]` attributes ([#194])
+
+[#194]: https://github.com/bitflags/bitflags/pull/194
+
+# 1.2.0
+
+- Fix typo: {Lower, Upper}Exp - {Lower, Upper}Hex ([#183])
+
+- Add support for "unknown" bits ([#188])
+
+[#183]: https://github.com/rust-lang-nursery/bitflags/pull/183
+[#188]: https://github.com/rust-lang-nursery/bitflags/pull/188
+
+# 1.1.0
+
+This is a re-release of `1.0.5`, which was yanked due to a bug in the RLS.
+
+# 1.0.5
+
+- Use compiletest_rs flags supported by stable toolchain ([#171])
+
+- Put the user provided attributes first ([#173])
+
+- Make bitflags methods `const` on newer compilers ([#175])
+
+[#171]: https://github.com/rust-lang-nursery/bitflags/pull/171
+[#173]: https://github.com/rust-lang-nursery/bitflags/pull/173
+[#175]: https://github.com/rust-lang-nursery/bitflags/pull/175
+
+# 1.0.4
+
+- Support Rust 2018 style macro imports ([#165])
+
+  ```rust
+  use bitflags::bitflags;
+  ```
+
+[#165]: https://github.com/rust-lang-nursery/bitflags/pull/165
+
+# 1.0.3
+
+- Improve zero value flag handling and documentation ([#157])
+
+[#157]: https://github.com/rust-lang-nursery/bitflags/pull/157
+
+# 1.0.2
+
+- 30% improvement in compile time of bitflags crate ([#156])
+
+- Documentation improvements ([#153])
+
+- Implementation cleanup ([#149])
+
+[#156]: https://github.com/rust-lang-nursery/bitflags/pull/156
+[#153]: https://github.com/rust-lang-nursery/bitflags/pull/153
+[#149]: https://github.com/rust-lang-nursery/bitflags/pull/149
+
+# 1.0.1
+- Add support for `pub(restricted)` specifier on the bitflags struct ([#135])
+- Optimize performance of `all()` when called from a separate crate ([#136])
+
+[#135]: https://github.com/rust-lang-nursery/bitflags/pull/135
+[#136]: https://github.com/rust-lang-nursery/bitflags/pull/136
+
+# 1.0.0
+- **[breaking change]** Macro now generates [associated constants](https://doc.rust-lang.org/reference/items.html#associated-constants) ([#24])
+
+- **[breaking change]** Minimum supported version is Rust **1.20**, due to usage of associated constants
+
+- After being broken in 0.9, the `#[deprecated]` attribute is now supported again ([#112])
+
+- Other improvements to unit tests and documentation ([#106] and [#115])
+
+[#24]: https://github.com/rust-lang-nursery/bitflags/pull/24
+[#106]: https://github.com/rust-lang-nursery/bitflags/pull/106
+[#112]: https://github.com/rust-lang-nursery/bitflags/pull/112
+[#115]: https://github.com/rust-lang-nursery/bitflags/pull/115
+
+## How to update your code to use associated constants
+Assuming the following structure definition:
+```rust
+bitflags! {
+  struct Something: u8 {
+     const FOO = 0b01,
+     const BAR = 0b10
+  }
+}
+```
+In 0.9 and older you could do:
+```rust
+let x = FOO.bits | BAR.bits;
+```
+Now you must use:
+```rust
+let x = Something::FOO.bits | Something::BAR.bits;
+```
+
+# 0.9.1
+- Fix the implementation of `Formatting` traits when other formatting traits were present in scope ([#105])
+
+[#105]: https://github.com/rust-lang-nursery/bitflags/pull/105
+
+# 0.9.0
+- **[breaking change]** Use struct keyword instead of flags to define bitflag types ([#84])
+
+- **[breaking change]** Terminate const items with semicolons instead of commas ([#87])
+
+- Implement the `Hex`, `Octal`, and `Binary` formatting traits ([#86])
+
+- Printing an empty flag value with the `Debug` trait now prints "(empty)" instead of nothing ([#85])
+
+- The `bitflags!` macro can now be used inside of a fn body, to define a type local to that function ([#74])
+
+[#74]: https://github.com/rust-lang-nursery/bitflags/pull/74
+[#84]: https://github.com/rust-lang-nursery/bitflags/pull/84
+[#85]: https://github.com/rust-lang-nursery/bitflags/pull/85
+[#86]: https://github.com/rust-lang-nursery/bitflags/pull/86
+[#87]: https://github.com/rust-lang-nursery/bitflags/pull/87
+
+# 0.8.2
+- Update feature flag used when building bitflags as a dependency of the Rust toolchain
+
+# 0.8.1
+- Allow bitflags to be used as a dependency of the Rust toolchain
+
+# 0.8.0
+- Add support for the experimental `i128` and `u128` integer types ([#57])
+- Add set method: `flags.set(SOME_FLAG, true)` or `flags.set(SOME_FLAG, false)` ([#55])
+  This may break code that defines its own set method
+
+[#55]: https://github.com/rust-lang-nursery/bitflags/pull/55
+[#57]: https://github.com/rust-lang-nursery/bitflags/pull/57
+
+# 0.7.1
+*(yanked)*
+
+# 0.7.0
+- Implement the Extend trait ([#49])
+- Allow definitions inside the `bitflags!` macro to refer to items imported from other modules ([#51])
+
+[#49]: https://github.com/rust-lang-nursery/bitflags/pull/49
+[#51]: https://github.com/rust-lang-nursery/bitflags/pull/51
+
+# 0.6.0
+- The `no_std` feature was removed as it is now the default
+- The `assignment_operators` feature was remove as it is now enabled by default
+- Some clippy suggestions have been applied
diff -pruN 43.0.0-1/rust-vendor/bitflags/CODE_OF_CONDUCT.md 43.0.0-1ubuntu1/rust-vendor/bitflags/CODE_OF_CONDUCT.md
--- 43.0.0-1/rust-vendor/bitflags/CODE_OF_CONDUCT.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/CODE_OF_CONDUCT.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,73 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as
+contributors and maintainers pledge to making participation in our project and
+our community a harassment-free experience for everyone, regardless of age, body
+size, disability, ethnicity, gender identity and expression, level of experience,
+education, socio-economic status, nationality, personal appearance, race,
+religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment
+include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or
+  advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic
+  address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+  professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable
+behavior and are expected to take appropriate and fair corrective action in
+response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or
+reject comments, commits, code, wiki edits, issues, and other contributions
+that are not aligned to this Code of Conduct, or to ban temporarily or
+permanently any contributor for other behaviors that they deem inappropriate,
+threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces
+when an individual is representing the project or its community. Examples of
+representing a project or community include using an official project e-mail
+address, posting via an official social media account, or acting as an appointed
+representative at an online or offline event. Representation of a project may be
+further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported by contacting the project team at coc@senaite.org. All
+complaints will be reviewed and investigated and will result in a response that
+is deemed necessary and appropriate to the circumstances. The project team is
+obligated to maintain confidentiality with regard to the reporter of an incident.
+Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good
+faith may face temporary or permanent repercussions as determined by other
+members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
+available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
+
+[homepage]: https://www.contributor-covenant.org
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/bitflags/CONTRIBUTING.md 43.0.0-1ubuntu1/rust-vendor/bitflags/CONTRIBUTING.md
--- 43.0.0-1/rust-vendor/bitflags/CONTRIBUTING.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/CONTRIBUTING.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,9 @@
+# Updating compile-fail test outputs
+
+`bitflags` uses the `trybuild` crate to integration test its macros. Since Rust error messages change frequently enough that `nightly` builds produce spurious failures, we only check the compiler output in `beta` builds. If you run:
+
+```
+TRYBUILD=overwrite cargo +beta test --all
+```
+
+it will run the tests and update the `trybuild` output files.
diff -pruN 43.0.0-1/rust-vendor/bitflags/Cargo.lock 43.0.0-1ubuntu1/rust-vendor/bitflags/Cargo.lock
--- 43.0.0-1/rust-vendor/bitflags/Cargo.lock	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/Cargo.lock	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,383 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "arbitrary"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110"
+dependencies = [
+ "derive_arbitrary",
+]
+
+[[package]]
+name = "bitflags"
+version = "2.6.0"
+dependencies = [
+ "arbitrary",
+ "bytemuck",
+ "compiler_builtins",
+ "rustc-std-workspace-core",
+ "rustversion",
+ "serde",
+ "serde_derive",
+ "serde_json",
+ "serde_test",
+ "trybuild",
+ "zerocopy",
+]
+
+[[package]]
+name = "bytemuck"
+version = "1.16.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e"
+dependencies = [
+ "bytemuck_derive",
+]
+
+[[package]]
+name = "bytemuck_derive"
+version = "1.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "byteorder"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
+
+[[package]]
+name = "compiler_builtins"
+version = "0.1.112"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b15acab2bb4fe4dad1f1e31f3d9e714f50ef561a0f87dd8a9da004f14d455e1a"
+
+[[package]]
+name = "derive_arbitrary"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "equivalent"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
+
+[[package]]
+name = "glob"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
+
+[[package]]
+name = "hashbrown"
+version = "0.14.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
+
+[[package]]
+name = "indexmap"
+version = "2.2.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
+dependencies = [
+ "equivalent",
+ "hashbrown",
+]
+
+[[package]]
+name = "itoa"
+version = "1.0.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
+
+[[package]]
+name = "memchr"
+version = "2.7.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.86"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.36"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "rustc-std-workspace-core"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1956f5517128a2b6f23ab2dadf1a976f4f5b27962e7724c2bf3d45e539ec098c"
+
+[[package]]
+name = "rustversion"
+version = "1.0.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6"
+
+[[package]]
+name = "ryu"
+version = "1.0.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
+
+[[package]]
+name = "serde"
+version = "1.0.203"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094"
+dependencies = [
+ "serde_derive",
+]
+
+[[package]]
+name = "serde_derive"
+version = "1.0.203"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "serde_json"
+version = "1.0.117"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3"
+dependencies = [
+ "itoa",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "serde_spanned"
+version = "0.6.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "serde_test"
+version = "1.0.176"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a2f49ace1498612d14f7e0b8245519584db8299541dfe31a06374a828d620ab"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "syn"
+version = "2.0.68"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "termcolor"
+version = "1.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
+dependencies = [
+ "winapi-util",
+]
+
+[[package]]
+name = "toml"
+version = "0.8.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335"
+dependencies = [
+ "serde",
+ "serde_spanned",
+ "toml_datetime",
+ "toml_edit",
+]
+
+[[package]]
+name = "toml_datetime"
+version = "0.6.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "toml_edit"
+version = "0.22.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38"
+dependencies = [
+ "indexmap",
+ "serde",
+ "serde_spanned",
+ "toml_datetime",
+ "winnow",
+]
+
+[[package]]
+name = "trybuild"
+version = "1.0.96"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "33a5f13f11071020bb12de7a16b925d2d58636175c20c11dc5f96cb64bb6c9b3"
+dependencies = [
+ "glob",
+ "serde",
+ "serde_derive",
+ "serde_json",
+ "termcolor",
+ "toml",
+]
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
+
+[[package]]
+name = "winapi-util"
+version = "0.1.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b"
+dependencies = [
+ "windows-sys",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
+dependencies = [
+ "windows-targets",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
+dependencies = [
+ "windows_aarch64_gnullvm",
+ "windows_aarch64_msvc",
+ "windows_i686_gnu",
+ "windows_i686_gnullvm",
+ "windows_i686_msvc",
+ "windows_x86_64_gnu",
+ "windows_x86_64_gnullvm",
+ "windows_x86_64_msvc",
+]
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
+
+[[package]]
+name = "windows_i686_gnullvm"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
+
+[[package]]
+name = "winnow"
+version = "0.6.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "zerocopy"
+version = "0.7.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087"
+dependencies = [
+ "byteorder",
+ "zerocopy-derive",
+]
+
+[[package]]
+name = "zerocopy-derive"
+version = "0.7.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
diff -pruN 43.0.0-1/rust-vendor/bitflags/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/bitflags/Cargo.toml
--- 43.0.0-1/rust-vendor/bitflags/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,96 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2021"
+rust-version = "1.56.0"
+name = "bitflags"
+version = "2.6.0"
+authors = ["The Rust Project Developers"]
+exclude = [
+    "/tests",
+    "/.github",
+]
+description = """
+A macro to generate structures which behave like bitflags.
+"""
+homepage = "https://github.com/bitflags/bitflags"
+documentation = "https://docs.rs/bitflags"
+readme = "README.md"
+keywords = [
+    "bit",
+    "bitmask",
+    "bitflags",
+    "flags",
+]
+categories = ["no-std"]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/bitflags/bitflags"
+
+[package.metadata.docs.rs]
+features = ["example_generated"]
+
+[dependencies.arbitrary]
+version = "1.0"
+optional = true
+
+[dependencies.bytemuck]
+version = "1.12"
+optional = true
+
+[dependencies.compiler_builtins]
+version = "0.1.2"
+optional = true
+
+[dependencies.core]
+version = "1.0.0"
+optional = true
+package = "rustc-std-workspace-core"
+
+[dependencies.serde]
+version = "1.0.103"
+optional = true
+default-features = false
+
+[dev-dependencies.arbitrary]
+version = "1.0"
+features = ["derive"]
+
+[dev-dependencies.bytemuck]
+version = "1.12.2"
+features = ["derive"]
+
+[dev-dependencies.rustversion]
+version = "1.0"
+
+[dev-dependencies.serde_derive]
+version = "1.0.103"
+
+[dev-dependencies.serde_json]
+version = "1.0"
+
+[dev-dependencies.serde_test]
+version = "1.0.19"
+
+[dev-dependencies.trybuild]
+version = "1.0.18"
+
+[dev-dependencies.zerocopy]
+version = "0.7"
+features = ["derive"]
+
+[features]
+example_generated = []
+rustc-dep-of-std = [
+    "core",
+    "compiler_builtins",
+]
+std = []
diff -pruN 43.0.0-1/rust-vendor/bitflags/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/bitflags/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/bitflags/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,201 @@
+                              Apache License
+                        Version 2.0, January 2004
+                     http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+   "License" shall mean the terms and conditions for use, reproduction,
+   and distribution as defined by Sections 1 through 9 of this document.
+
+   "Licensor" shall mean the copyright owner or entity authorized by
+   the copyright owner that is granting the License.
+
+   "Legal Entity" shall mean the union of the acting entity and all
+   other entities that control, are controlled by, or are under common
+   control with that entity. For the purposes of this definition,
+   "control" means (i) the power, direct or indirect, to cause the
+   direction or management of such entity, whether by contract or
+   otherwise, or (ii) ownership of fifty percent (50%) or more of the
+   outstanding shares, or (iii) beneficial ownership of such entity.
+
+   "You" (or "Your") shall mean an individual or Legal Entity
+   exercising permissions granted by this License.
+
+   "Source" form shall mean the preferred form for making modifications,
+   including but not limited to software source code, documentation
+   source, and configuration files.
+
+   "Object" form shall mean any form resulting from mechanical
+   transformation or translation of a Source form, including but
+   not limited to compiled object code, generated documentation,
+   and conversions to other media types.
+
+   "Work" shall mean the work of authorship, whether in Source or
+   Object form, made available under the License, as indicated by a
+   copyright notice that is included in or attached to the work
+   (an example is provided in the Appendix below).
+
+   "Derivative Works" shall mean any work, whether in Source or Object
+   form, that is based on (or derived from) the Work and for which the
+   editorial revisions, annotations, elaborations, or other modifications
+   represent, as a whole, an original work of authorship. For the purposes
+   of this License, Derivative Works shall not include works that remain
+   separable from, or merely link (or bind by name) to the interfaces of,
+   the Work and Derivative Works thereof.
+
+   "Contribution" shall mean any work of authorship, including
+   the original version of the Work and any modifications or additions
+   to that Work or Derivative Works thereof, that is intentionally
+   submitted to Licensor for inclusion in the Work by the copyright owner
+   or by an individual or Legal Entity authorized to submit on behalf of
+   the copyright owner. For the purposes of this definition, "submitted"
+   means any form of electronic, verbal, or written communication sent
+   to the Licensor or its representatives, including but not limited to
+   communication on electronic mailing lists, source code control systems,
+   and issue tracking systems that are managed by, or on behalf of, the
+   Licensor for the purpose of discussing and improving the Work, but
+   excluding communication that is conspicuously marked or otherwise
+   designated in writing by the copyright owner as "Not a Contribution."
+
+   "Contributor" shall mean Licensor and any individual or Legal Entity
+   on behalf of whom a Contribution has been received by Licensor and
+   subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   copyright license to reproduce, prepare Derivative Works of,
+   publicly display, publicly perform, sublicense, and distribute the
+   Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   (except as stated in this section) patent license to make, have made,
+   use, offer to sell, sell, import, and otherwise transfer the Work,
+   where such license applies only to those patent claims licensable
+   by such Contributor that are necessarily infringed by their
+   Contribution(s) alone or by combination of their Contribution(s)
+   with the Work to which such Contribution(s) was submitted. If You
+   institute patent litigation against any entity (including a
+   cross-claim or counterclaim in a lawsuit) alleging that the Work
+   or a Contribution incorporated within the Work constitutes direct
+   or contributory patent infringement, then any patent licenses
+   granted to You under this License for that Work shall terminate
+   as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+   Work or Derivative Works thereof in any medium, with or without
+   modifications, and in Source or Object form, provided that You
+   meet the following conditions:
+
+   (a) You must give any other recipients of the Work or
+       Derivative Works a copy of this License; and
+
+   (b) You must cause any modified files to carry prominent notices
+       stating that You changed the files; and
+
+   (c) You must retain, in the Source form of any Derivative Works
+       that You distribute, all copyright, patent, trademark, and
+       attribution notices from the Source form of the Work,
+       excluding those notices that do not pertain to any part of
+       the Derivative Works; and
+
+   (d) If the Work includes a "NOTICE" text file as part of its
+       distribution, then any Derivative Works that You distribute must
+       include a readable copy of the attribution notices contained
+       within such NOTICE file, excluding those notices that do not
+       pertain to any part of the Derivative Works, in at least one
+       of the following places: within a NOTICE text file distributed
+       as part of the Derivative Works; within the Source form or
+       documentation, if provided along with the Derivative Works; or,
+       within a display generated by the Derivative Works, if and
+       wherever such third-party notices normally appear. The contents
+       of the NOTICE file are for informational purposes only and
+       do not modify the License. You may add Your own attribution
+       notices within Derivative Works that You distribute, alongside
+       or as an addendum to the NOTICE text from the Work, provided
+       that such additional attribution notices cannot be construed
+       as modifying the License.
+
+   You may add Your own copyright statement to Your modifications and
+   may provide additional or different license terms and conditions
+   for use, reproduction, or distribution of Your modifications, or
+   for any such Derivative Works as a whole, provided Your use,
+   reproduction, and distribution of the Work otherwise complies with
+   the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+   any Contribution intentionally submitted for inclusion in the Work
+   by You to the Licensor shall be under the terms and conditions of
+   this License, without any additional terms or conditions.
+   Notwithstanding the above, nothing herein shall supersede or modify
+   the terms of any separate license agreement you may have executed
+   with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+   names, trademarks, service marks, or product names of the Licensor,
+   except as required for reasonable and customary use in describing the
+   origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+   agreed to in writing, Licensor provides the Work (and each
+   Contributor provides its Contributions) on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+   implied, including, without limitation, any warranties or conditions
+   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+   PARTICULAR PURPOSE. You are solely responsible for determining the
+   appropriateness of using or redistributing the Work and assume any
+   risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+   whether in tort (including negligence), contract, or otherwise,
+   unless required by applicable law (such as deliberate and grossly
+   negligent acts) or agreed to in writing, shall any Contributor be
+   liable to You for damages, including any direct, indirect, special,
+   incidental, or consequential damages of any character arising as a
+   result of this License or out of the use or inability to use the
+   Work (including but not limited to damages for loss of goodwill,
+   work stoppage, computer failure or malfunction, or any and all
+   other commercial damages or losses), even if such Contributor
+   has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+   the Work or Derivative Works thereof, You may choose to offer,
+   and charge a fee for, acceptance of support, warranty, indemnity,
+   or other liability obligations and/or rights consistent with this
+   License. However, in accepting such obligations, You may act only
+   on Your own behalf and on Your sole responsibility, not on behalf
+   of any other Contributor, and only if You agree to indemnify,
+   defend, and hold each Contributor harmless for any liability
+   incurred by, or claims asserted against, such Contributor by reason
+   of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+   To apply the Apache License to your work, attach the following
+   boilerplate notice, with the fields enclosed by brackets "[]"
+   replaced with your own identifying information. (Don't include
+   the brackets!)  The text should be enclosed in the appropriate
+   comment syntax for the file format. We also recommend that a
+   file or class name and description of purpose be included on the
+   same "printed page" as the copyright notice for easier
+   identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+	http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff -pruN 43.0.0-1/rust-vendor/bitflags/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/bitflags/LICENSE-MIT
--- 43.0.0-1/rust-vendor/bitflags/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,25 @@
+Copyright (c) 2014 The Rust Project Developers
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/bitflags/README.md 43.0.0-1ubuntu1/rust-vendor/bitflags/README.md
--- 43.0.0-1/rust-vendor/bitflags/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,77 @@
+bitflags
+========
+
+[![Rust](https://github.com/bitflags/bitflags/workflows/Rust/badge.svg)](https://github.com/bitflags/bitflags/actions)
+[![Latest version](https://img.shields.io/crates/v/bitflags.svg)](https://crates.io/crates/bitflags)
+[![Documentation](https://docs.rs/bitflags/badge.svg)](https://docs.rs/bitflags)
+![License](https://img.shields.io/crates/l/bitflags.svg)
+
+`bitflags` generates flags enums with well-defined semantics and ergonomic end-user APIs.
+
+You can use `bitflags` to:
+
+- provide more user-friendly bindings to C APIs where flags may or may not be fully known in advance.
+- generate efficient options types with string parsing and formatting support.
+
+You can't use `bitflags` to:
+
+- guarantee only bits corresponding to defined flags will ever be set. `bitflags` allows access to the underlying bits type so arbitrary bits may be set.
+- define bitfields. `bitflags` only generates types where set bits denote the presence of some combination of flags.
+
+- [Documentation](https://docs.rs/bitflags)
+- [Specification](https://github.com/bitflags/bitflags/blob/main/spec.md)
+- [Release notes](https://github.com/bitflags/bitflags/releases)
+
+## Usage
+
+Add this to your `Cargo.toml`:
+
+```toml
+[dependencies]
+bitflags = "2.6.0"
+```
+
+and this to your source code:
+
+```rust
+use bitflags::bitflags;
+```
+
+## Example
+
+Generate a flags structure:
+
+```rust
+use bitflags::bitflags;
+
+// The `bitflags!` macro generates `struct`s that manage a set of flags.
+bitflags! {
+    /// Represents a set of flags.
+    #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
+    struct Flags: u32 {
+        /// The value `A`, at bit position `0`.
+        const A = 0b00000001;
+        /// The value `B`, at bit position `1`.
+        const B = 0b00000010;
+        /// The value `C`, at bit position `2`.
+        const C = 0b00000100;
+
+        /// The combination of `A`, `B`, and `C`.
+        const ABC = Self::A.bits() | Self::B.bits() | Self::C.bits();
+    }
+}
+
+fn main() {
+    let e1 = Flags::A | Flags::C;
+    let e2 = Flags::B | Flags::C;
+    assert_eq!((e1 | e2), Flags::ABC);   // union
+    assert_eq!((e1 & e2), Flags::C);     // intersection
+    assert_eq!((e1 - e2), Flags::A);     // set difference
+    assert_eq!(!e2, Flags::A);           // set complement
+}
+```
+
+## Rust Version Support
+
+The minimum supported Rust version is documented in the `Cargo.toml` file.
+This may be bumped in minor releases as necessary.
diff -pruN 43.0.0-1/rust-vendor/bitflags/SECURITY.md 43.0.0-1ubuntu1/rust-vendor/bitflags/SECURITY.md
--- 43.0.0-1/rust-vendor/bitflags/SECURITY.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/SECURITY.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,13 @@
+# Security Policy
+
+## Supported Versions
+
+Security updates are applied only to the latest release.
+
+## Reporting a Vulnerability
+
+If you have discovered a security vulnerability in this project, please report it privately. **Do not disclose it as a public issue.** This gives us time to work with you to fix the issue before public exposure, reducing the chance that the exploit will be used before a patch is released.
+
+Please disclose it at [security advisory](https://github.com/bitflags/bitflags/security/advisories/new).
+
+This project is maintained by a team of volunteers on a reasonable-effort basis. As such, please give us at least 90 days to work on a fix before public exposure.
diff -pruN 43.0.0-1/rust-vendor/bitflags/benches/parse.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/benches/parse.rs
--- 43.0.0-1/rust-vendor/bitflags/benches/parse.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/benches/parse.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,96 @@
+#![feature(test)]
+
+extern crate test;
+
+use std::{
+    fmt::{self, Display},
+    str::FromStr,
+};
+
+bitflags::bitflags! {
+    struct Flags10: u32 {
+        const A = 0b0000_0000_0000_0001;
+        const B = 0b0000_0000_0000_0010;
+        const C = 0b0000_0000_0000_0100;
+        const D = 0b0000_0000_0000_1000;
+        const E = 0b0000_0000_0001_0000;
+        const F = 0b0000_0000_0010_0000;
+        const G = 0b0000_0000_0100_0000;
+        const H = 0b0000_0000_1000_0000;
+        const I = 0b0000_0001_0000_0000;
+        const J = 0b0000_0010_0000_0000;
+    }
+}
+
+impl FromStr for Flags10 {
+    type Err = bitflags::parser::ParseError;
+
+    fn from_str(flags: &str) -> Result<Self, Self::Err> {
+        Ok(Flags10(flags.parse()?))
+    }
+}
+
+impl Display for Flags10 {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.0, f)
+    }
+}
+
+#[bench]
+fn format_flags_1_present(b: &mut test::Bencher) {
+    b.iter(|| Flags10::J.to_string())
+}
+
+#[bench]
+fn format_flags_5_present(b: &mut test::Bencher) {
+    b.iter(|| (Flags10::F | Flags10::G | Flags10::H | Flags10::I | Flags10::J).to_string())
+}
+
+#[bench]
+fn format_flags_10_present(b: &mut test::Bencher) {
+    b.iter(|| {
+        (Flags10::A
+            | Flags10::B
+            | Flags10::C
+            | Flags10::D
+            | Flags10::E
+            | Flags10::F
+            | Flags10::G
+            | Flags10::H
+            | Flags10::I
+            | Flags10::J)
+            .to_string()
+    })
+}
+
+#[bench]
+fn parse_flags_1_10(b: &mut test::Bencher) {
+    b.iter(|| {
+        let flags: Flags10 = "J".parse().unwrap();
+        flags
+    })
+}
+
+#[bench]
+fn parse_flags_5_10(b: &mut test::Bencher) {
+    b.iter(|| {
+        let flags: Flags10 = "F | G | H | I | J".parse().unwrap();
+        flags
+    })
+}
+
+#[bench]
+fn parse_flags_10_10(b: &mut test::Bencher) {
+    b.iter(|| {
+        let flags: Flags10 = "A | B | C | D | E | F | G | H | I | J".parse().unwrap();
+        flags
+    })
+}
+
+#[bench]
+fn parse_flags_1_10_hex(b: &mut test::Bencher) {
+    b.iter(|| {
+        let flags: Flags10 = "0xFF".parse().unwrap();
+        flags
+    })
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/examples/custom_bits_type.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/examples/custom_bits_type.rs
--- 43.0.0-1/rust-vendor/bitflags/examples/custom_bits_type.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/examples/custom_bits_type.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,97 @@
+use std::ops::{BitAnd, BitOr, BitXor, Not};
+
+use bitflags::{Bits, Flag, Flags};
+
+// Define a custom container that can be used in flags types
+// Note custom bits types can't be used in `bitflags!`
+// without making the trait impls `const`. This is currently
+// unstable
+#[derive(Clone, Copy, Debug)]
+pub struct CustomBits([bool; 3]);
+
+impl Bits for CustomBits {
+    const EMPTY: Self = CustomBits([false; 3]);
+
+    const ALL: Self = CustomBits([true; 3]);
+}
+
+impl PartialEq for CustomBits {
+    fn eq(&self, other: &Self) -> bool {
+        self.0 == other.0
+    }
+}
+
+impl BitAnd for CustomBits {
+    type Output = Self;
+
+    fn bitand(self, other: Self) -> Self {
+        CustomBits([
+            self.0[0] & other.0[0],
+            self.0[1] & other.0[1],
+            self.0[2] & other.0[2],
+        ])
+    }
+}
+
+impl BitOr for CustomBits {
+    type Output = Self;
+
+    fn bitor(self, other: Self) -> Self {
+        CustomBits([
+            self.0[0] | other.0[0],
+            self.0[1] | other.0[1],
+            self.0[2] | other.0[2],
+        ])
+    }
+}
+
+impl BitXor for CustomBits {
+    type Output = Self;
+
+    fn bitxor(self, other: Self) -> Self {
+        CustomBits([
+            self.0[0] & other.0[0],
+            self.0[1] & other.0[1],
+            self.0[2] & other.0[2],
+        ])
+    }
+}
+
+impl Not for CustomBits {
+    type Output = Self;
+
+    fn not(self) -> Self {
+        CustomBits([!self.0[0], !self.0[1], !self.0[2]])
+    }
+}
+
+#[derive(Clone, Copy, Debug)]
+pub struct CustomFlags(CustomBits);
+
+impl CustomFlags {
+    pub const A: Self = CustomFlags(CustomBits([true, false, false]));
+    pub const B: Self = CustomFlags(CustomBits([false, true, false]));
+    pub const C: Self = CustomFlags(CustomBits([false, false, true]));
+}
+
+impl Flags for CustomFlags {
+    const FLAGS: &'static [Flag<Self>] = &[
+        Flag::new("A", Self::A),
+        Flag::new("B", Self::B),
+        Flag::new("C", Self::C),
+    ];
+
+    type Bits = CustomBits;
+
+    fn bits(&self) -> Self::Bits {
+        self.0
+    }
+
+    fn from_bits_retain(bits: Self::Bits) -> Self {
+        CustomFlags(bits)
+    }
+}
+
+fn main() {
+    println!("{:?}", CustomFlags::A.union(CustomFlags::C));
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/examples/custom_derive.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/examples/custom_derive.rs
--- 43.0.0-1/rust-vendor/bitflags/examples/custom_derive.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/examples/custom_derive.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,23 @@
+//! An example of implementing the `BitFlags` trait manually for a flags type.
+
+use std::str;
+
+use bitflags::bitflags;
+
+// Define a flags type outside of the `bitflags` macro as a newtype
+// It can accept custom derives for libraries `bitflags` doesn't support natively
+#[derive(zerocopy::AsBytes, zerocopy::FromBytes, zerocopy::FromZeroes)]
+#[repr(transparent)]
+pub struct ManualFlags(u32);
+
+// Next: use `impl Flags` instead of `struct Flags`
+bitflags! {
+    impl ManualFlags: u32 {
+        const A = 0b00000001;
+        const B = 0b00000010;
+        const C = 0b00000100;
+        const ABC = Self::A.bits() | Self::B.bits() | Self::C.bits();
+    }
+}
+
+fn main() {}
diff -pruN 43.0.0-1/rust-vendor/bitflags/examples/fmt.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/examples/fmt.rs
--- 43.0.0-1/rust-vendor/bitflags/examples/fmt.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/examples/fmt.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,49 @@
+//! An example of implementing Rust's standard formatting and parsing traits for flags types.
+
+use core::{fmt, str};
+
+bitflags::bitflags! {
+    // You can `#[derive]` the `Debug` trait, but implementing it manually
+    // can produce output like `A | B` instead of `Flags(A | B)`.
+    // #[derive(Debug)]
+    #[derive(PartialEq, Eq)]
+    pub struct Flags: u32 {
+        const A = 1;
+        const B = 2;
+        const C = 4;
+        const D = 8;
+    }
+}
+
+impl fmt::Debug for Flags {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        bitflags::parser::to_writer(self, f)
+    }
+}
+
+impl fmt::Display for Flags {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        bitflags::parser::to_writer(self, f)
+    }
+}
+
+impl str::FromStr for Flags {
+    type Err = bitflags::parser::ParseError;
+
+    fn from_str(flags: &str) -> Result<Self, Self::Err> {
+        bitflags::parser::from_str(flags)
+    }
+}
+
+fn main() -> Result<(), bitflags::parser::ParseError> {
+    let flags = Flags::A | Flags::B;
+
+    println!("{}", flags);
+
+    let formatted = flags.to_string();
+    let parsed: Flags = formatted.parse()?;
+
+    assert_eq!(flags, parsed);
+
+    Ok(())
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/examples/macro_free.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/examples/macro_free.rs
--- 43.0.0-1/rust-vendor/bitflags/examples/macro_free.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/examples/macro_free.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,61 @@
+//! An example of implementing the `BitFlags` trait manually for a flags type.
+//!
+//! This example doesn't use any macros.
+
+use std::{fmt, str};
+
+use bitflags::{Flag, Flags};
+
+// First: Define your flags type. It just needs to be `Sized + 'static`.
+pub struct ManualFlags(u32);
+
+// Not required: Define some constants for valid flags
+impl ManualFlags {
+    pub const A: ManualFlags = ManualFlags(0b00000001);
+    pub const B: ManualFlags = ManualFlags(0b00000010);
+    pub const C: ManualFlags = ManualFlags(0b00000100);
+    pub const ABC: ManualFlags = ManualFlags(0b00000111);
+}
+
+// Next: Implement the `BitFlags` trait, specifying your set of valid flags
+// and iterators
+impl Flags for ManualFlags {
+    const FLAGS: &'static [Flag<Self>] = &[
+        Flag::new("A", Self::A),
+        Flag::new("B", Self::B),
+        Flag::new("C", Self::C),
+    ];
+
+    type Bits = u32;
+
+    fn bits(&self) -> u32 {
+        self.0
+    }
+
+    fn from_bits_retain(bits: u32) -> Self {
+        Self(bits)
+    }
+}
+
+// Not required: Add parsing support
+impl str::FromStr for ManualFlags {
+    type Err = bitflags::parser::ParseError;
+
+    fn from_str(input: &str) -> Result<Self, Self::Err> {
+        bitflags::parser::from_str(input)
+    }
+}
+
+// Not required: Add formatting support
+impl fmt::Display for ManualFlags {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        bitflags::parser::to_writer(self, f)
+    }
+}
+
+fn main() {
+    println!(
+        "{}",
+        ManualFlags::A.union(ManualFlags::B).union(ManualFlags::C)
+    );
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/examples/serde.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/examples/serde.rs
--- 43.0.0-1/rust-vendor/bitflags/examples/serde.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/examples/serde.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,36 @@
+//! An example of implementing `serde::Serialize` and `serde::Deserialize`.
+//! The `#[serde(transparent)]` attribute is recommended to serialize directly
+//! to the underlying bits type without wrapping it in a `serde` newtype.
+
+#[cfg(feature = "serde")]
+fn main() {
+    use serde_derive::*;
+
+    bitflags::bitflags! {
+        #[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]
+        #[serde(transparent)]
+        pub struct Flags: u32 {
+            const A = 1;
+            const B = 2;
+            const C = 4;
+            const D = 8;
+        }
+    }
+
+    let flags = Flags::A | Flags::B;
+
+    let serialized = serde_json::to_string(&flags).unwrap();
+
+    println!("{:?} -> {}", flags, serialized);
+
+    assert_eq!(serialized, r#""A | B""#);
+
+    let deserialized: Flags = serde_json::from_str(&serialized).unwrap();
+
+    println!("{} -> {:?}", serialized, flags);
+
+    assert_eq!(deserialized, flags);
+}
+
+#[cfg(not(feature = "serde"))]
+fn main() {}
diff -pruN 43.0.0-1/rust-vendor/bitflags/spec.md 43.0.0-1ubuntu1/rust-vendor/bitflags/spec.md
--- 43.0.0-1/rust-vendor/bitflags/spec.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/spec.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,552 @@
+# Bitflags
+
+`bitflags` generates flags enums with well-defined semantics and ergonomic end-user APIs.
+
+You can use `bitflags` to:
+
+- provide more user-friendly bindings to C APIs where flags may or may not be fully known in advance.
+- generate efficient options types with string parsing and formatting support.
+
+You can't use `bitflags` to:
+
+- guarantee only bits corresponding to defined flags will ever be set. `bitflags` allows access to the underlying bits type so arbitrary bits may be set.
+- define bitfields. `bitflags` only generates types where set bits denote the presence of some combination of flags.
+
+## Definitions
+
+This section formally defines the terminology and semantics of `bitflags`. It's organized so more fundamental concepts are introduced before those that build on them. It may be helpful to start from the bottom of the section and refer back up to concepts defined earlier.
+
+Examples use `bitflags` syntax with `u8` as the bits type.
+
+### Bits type
+
+A type that defines a fixed number of bits at specific locations.
+
+----
+
+Bits types are typically fixed-width unsigned integers. For example, `u8` is a bits type that defines 8 bits; bit-0 through bit-7.
+
+### Bits value
+
+An instance of a bits type where each bit may be set (`1`) or unset (`0`).
+
+----
+
+Some examples of bits values for the bits type `u8` are:
+
+```rust
+0b0000_0000
+0b1111_1111
+0b1010_0101
+```
+
+#### Equality
+
+Two bits values are equal if their bits are in the same configuration; set bits in one are set in the other, and unset bits in one are unset in the other.
+
+#### Operations
+
+Bits values define the bitwise operators and (`&`), or (`|`), exclusive-or (`^`), and negation (`!`) that apply to each of their bits.
+
+### Flag
+
+A set of bits in a bits type that may have a unique name.
+
+----
+
+Bits are not required to be exclusive to a flag. Bits are not required to be contiguous.
+
+The following is a flag for `u8` with the name `A` that includes bit-0:
+
+```rust
+const A = 0b0000_0001;
+```
+
+The following is a flag for `u8` with the name `B` that includes bit-0, and bit-5:
+
+```rust
+const B = 0b0010_0001;
+```
+
+#### Named flag
+
+A flag with a name.
+
+----
+
+The following is a named flag, where the name is `A`:
+
+```rust
+const A = 0b0000_0001;
+```
+
+#### Unnamed flag
+
+A flag without a name.
+
+----
+
+The following is an unnamed flag:
+
+```rust
+const _ = 0b0000_0001;
+```
+
+#### Zero-bit flag
+
+A flag with a set of zero bits.
+
+----
+
+The following is a zero-bit flag:
+
+```rust
+const ZERO = 0b0000_0000;
+```
+
+#### Single-bit flag
+
+A flag with a set of one bit.
+
+----
+
+The following are single-bit flags:
+
+```rust
+const A = 0b0000_0001;
+const B = 0b0000_0010;
+```
+
+#### Multi-bit flag
+
+A flag with a set of more than one bit.
+
+----
+
+The following are multi-bit flags:
+
+```rust
+const A = 0b0000_0011;
+const B = 0b1111_1111;
+```
+
+### Flags type
+
+A set of defined flags over a specific bits type.
+
+#### Known bit
+
+A bit in any defined flag.
+
+----
+
+In the following flags type:
+
+```rust
+struct Flags {
+    const A = 0b0000_0001;
+    const B = 0b0000_0010;
+    const C = 0b0000_0100;
+}
+```
+
+the known bits are:
+
+```rust
+0b0000_0111
+```
+
+#### Unknown bit
+
+A bit not in any defined flag.
+
+----
+
+In the following flags type:
+
+```rust
+struct Flags {
+    const A = 0b0000_0001;
+    const B = 0b0000_0010;
+    const C = 0b0000_0100;
+}
+```
+
+the unknown bits are:
+
+```rust
+0b1111_1000
+```
+
+### Flags value
+
+An instance of a flags type using its specific bits value for storage.
+
+The flags value of a flag is one where each of its bits is set, and all others are unset.
+
+#### Contains
+
+Whether all set bits in a source flags value are also set in a target flags value.
+
+----
+
+Given the flags value:
+
+```rust
+0b0000_0011
+```
+
+the following flags values are contained:
+
+```rust
+0b0000_0000
+0b0000_0010
+0b0000_0001
+0b0000_0011
+```
+
+but the following flags values are not contained:
+
+```rust
+0b0000_1000
+0b0000_0110
+```
+
+#### Intersects
+
+Whether any set bits in a source flags value are also set in a target flags value.
+
+----
+
+Given the flags value:
+
+```rust
+0b0000_0011
+```
+
+the following flags intersect:
+
+```rust
+0b0000_0010
+0b0000_0001
+0b1111_1111
+```
+
+but the following flags values do not intersect:
+
+```rust
+0b0000_0000
+0b1111_0000
+```
+
+#### Empty
+
+Whether all bits in a flags value are unset.
+
+----
+
+The following flags value is empty:
+
+```rust
+0b0000_0000
+```
+
+The following flags values are not empty:
+
+```rust
+0b0000_0001
+0b0110_0000
+```
+
+#### All
+
+Whether all defined flags are contained in a flags value.
+
+----
+
+Given a flags type:
+
+```rust
+struct Flags {
+    const A   = 0b0000_0001;
+    const B   = 0b0000_0010;
+}
+```
+
+the following flags values all satisfy all:
+
+```rust
+0b0000_0011
+0b1000_0011
+0b1111_1111
+```
+
+### Operations
+
+Examples in this section all use the given flags type:
+
+```rust
+struct Flags {
+    const A = 0b0000_0001;
+    const B = 0b0000_0010;
+    const C = 0b0000_1100;
+}
+```
+
+#### Truncate
+
+Unset all unknown bits in a flags value.
+
+----
+
+Given the flags value:
+
+```rust
+0b1111_1111
+```
+
+the result of truncation will be:
+
+```rust
+0b0000_1111
+```
+
+----
+
+Truncating doesn't guarantee that a non-empty result will contain any defined flags. Given the following flags type:
+
+```rust
+struct Flags {
+    const A = 0b0000_0101;
+}
+```
+
+and the following flags value:
+
+```rust
+0b0000_1110;
+```
+
+The result of truncation will be:
+
+```rust
+0b0000_0100;
+```
+
+which intersects the flag `A`, but doesn't contain it.
+
+This behavior is possible even when only operating with flags values containing defined flags. Given the following flags type:
+
+```rust
+struct Flags {
+    const A = 0b0000_0101;
+    const B = 0b0000_0001;
+}
+```
+
+The result of `A ^ B` is `0b0000_0100`, which also doesn't contain any defined flag.
+
+----
+
+If all known bits are in the set of at least one defined single-bit flag, then all operations that produce non-empty results will always contain defined flags.
+
+#### Union
+
+The bitwise or (`|`) of the bits in two flags values.
+
+----
+
+The following are examples of the result of unioning flags values:
+
+```rust
+0b0000_0001 | 0b0000_0010 = 0b0000_0011
+0b0000_0000 | 0b1111_1111 = 0b1111_1111
+```
+
+#### Intersection
+
+The bitwise and (`&`) of the bits in two flags values.
+
+----
+
+The following are examples of the result of intersecting flags values:
+
+```rust
+0b0000_0001 & 0b0000_0010 = 0b0000_0000
+0b1111_1100 & 0b1111_0111 = 0b1111_0100
+0b1111_1111 & 0b1111_1111 = 0b1111_1111
+```
+
+#### Symmetric difference
+
+The bitwise exclusive-or (`^`) of the bits in two flags values.
+
+----
+
+The following are examples of the symmetric difference between two flags values:
+
+```rust
+0b0000_0001 ^ 0b0000_0010 = 0b0000_0011
+0b0000_1111 ^ 0b0000_0011 = 0b0000_1100
+0b1100_0000 ^ 0b0011_0000 = 0b1111_0000
+```
+
+#### Complement
+
+The bitwise negation (`!`) of the bits in a flags value, truncating the result.
+
+----
+
+The following are examples of the complement of a flags value:
+
+```rust
+!0b0000_0000 = 0b0000_1111
+!0b0000_1111 = 0b0000_0000
+!0b1111_1000 = 0b0000_0111
+```
+
+#### Difference
+
+The bitwise union (`|`) of the bits in one flags value and the bitwise negation (`!`) of the bits in another.
+
+----
+
+This operation is not equivalent to the intersection of one flags value with the complement of another (`&!`).
+The former will truncate the result, where difference will not.
+
+----
+
+The following are examples of the difference between two flags values:
+
+```rust
+0b0000_0001 & !0b0000_0010 = 0b0000_0001
+0b0000_1101 & !0b0000_0011 = 0b0000_1100
+0b1111_1111 & !0b0000_0001 = 0b1111_1110
+```
+
+### Iteration
+
+Yield the bits of a source flags value in a set of contained flags values.
+
+----
+
+To be most useful, each yielded flags value should set exactly the bits of a defined flag contained in the source. Any known bits that aren't in the set of any contained flag should be yielded together as a final flags value.
+
+----
+
+Given the following flags type:
+
+```rust
+struct Flags {
+    const A  = 0b0000_0001;
+    const B  = 0b0000_0010;
+    const AB = 0b0000_0011;
+}
+```
+
+and the following flags value:
+
+```rust
+0b0000_1111
+```
+
+When iterated it may yield a flags value for `A` and `B`, then a final flag with the unknown bits:
+
+```rust
+0b0000_0001
+0b0000_0010
+0b0000_1100
+```
+
+It may also yield a flags value for `AB`, then a final flag with the unknown bits:
+
+```rust
+0b0000_0011
+0b0000_1100
+```
+
+----
+
+Given the following flags type:
+
+```rust
+struct Flags {
+    const A = 0b0000_0011;
+}
+```
+
+and the following flags value:
+
+```rust
+0b0000_0001
+```
+
+When iterated it will still yield a flags value for the known bit `0b0000_0001` even though it doesn't contain a flag.
+
+### Formatting
+
+Format and parse a flags value as text using the following grammar:
+
+- _Flags:_ (_Whitespace_ _Flag_ _Whitespace_)`|`*
+- _Flag:_ _Name_ | _Hex Number_
+- _Name:_ The name of any defined flag
+- _Hex Number_: `0x`([0-9a-fA-F])*
+- _Whitespace_: (\s)*
+
+Flags values can be formatted as _Flags_ by iterating over them, formatting each yielded flags value as a _Flag_. Any yielded flags value that sets exactly the bits of a defined flag with a name should be formatted as a _Name_. Otherwise it must be formatted as a _Hex Number_.
+
+Formatting and parsing supports three modes:
+
+- **Retain**: Formatting and parsing roundtrips exactly the bits of the source flags value. This is the default behavior.
+- **Truncate**: Flags values are truncated before formatting, and truncated after parsing.
+- **Strict**: A _Flag_ may only be formatted and parsed as a _Name_. _Hex numbers_ are not allowed. A consequence of this is that unknown bits and any bits that aren't in a contained named flag will be ignored. This is recommended for flags values serialized across API boundaries, like web services.
+
+Text that is empty or whitespace is an empty flags value.
+
+----
+
+Given the following flags type:
+
+```rust
+struct Flags {
+    const A  = 0b0000_0001;
+    const B  = 0b0000_0010;
+    const AB = 0b0000_0011;
+    const C  = 0b0000_1100;
+}
+```
+
+The following are examples of how flags values can be formatted using any mode:
+
+```rust
+0b0000_0000 = ""
+0b0000_0001 = "A"
+0b0000_0010 = "B"
+0b0000_0011 = "A | B"
+0b0000_0011 = "AB"
+0b0000_1111 = "A | B | C"
+```
+
+Truncate mode will unset any unknown bits:
+
+```rust
+0b1000_0000 = ""
+0b1111_1111 = "A | B | C"
+0b0000_1000 = "0x8"
+```
+
+Retain mode will include any unknown bits as a final _Flag_:
+
+```rust
+0b1000_0000 = "0x80"
+0b1111_1111 = "A | B | C | 0xf0"
+0b0000_1000 = "0x8"
+```
+
+Strict mode will unset any unknown bits, as well as bits not contained in any defined named flags:
+
+```rust
+0b1000_0000 = ""
+0b1111_1111 = "A | B | C"
+0b0000_1000 = ""
+```
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/example_generated.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/example_generated.rs
--- 43.0.0-1/rust-vendor/bitflags/src/example_generated.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/example_generated.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,65 @@
+//! This module shows an example of code generated by the macro. **IT MUST NOT BE USED OUTSIDE THIS
+//! CRATE**.
+//!
+//! Usually, when you call the `bitflags!` macro, only the `Flags` type would be visible. In this
+//! example, the `Field0`, `Iter`, and `IterRaw` types are also exposed so that you can explore
+//! their APIs. The `Field0` type can be accessed as `self.0` on an instance of `Flags`.
+
+__declare_public_bitflags! {
+    /// This is the same `Flags` struct defined in the [crate level example](../index.html#example).
+    /// Note that this struct is just for documentation purposes only, it must not be used outside
+    /// this crate.
+    pub struct Flags
+}
+
+__declare_internal_bitflags! {
+    pub struct Field0: u32
+}
+
+__impl_internal_bitflags! {
+    Field0: u32, Flags {
+        // Field `A`.
+        ///
+        /// This flag has the value `0b00000001`.
+        const A = 0b00000001;
+        /// Field `B`.
+        ///
+        /// This flag has the value `0b00000010`.
+        const B = 0b00000010;
+        /// Field `C`.
+        ///
+        /// This flag has the value `0b00000100`.
+        const C = 0b00000100;
+        const ABC = Self::A.bits() | Self::B.bits() | Self::C.bits();
+    }
+}
+
+__impl_public_bitflags_forward! {
+    Flags: u32, Field0
+}
+
+__impl_public_bitflags_ops! {
+    Flags
+}
+
+__impl_public_bitflags_iter! {
+    Flags: u32, Flags
+}
+
+__impl_public_bitflags_consts! {
+    Flags: u32 {
+        /// Field `A`.
+        ///
+        /// This flag has the value `0b00000001`.
+        const A = 0b00000001;
+        /// Field `B`.
+        ///
+        /// This flag has the value `0b00000010`.
+        const B = 0b00000010;
+        /// Field `C`.
+        ///
+        /// This flag has the value `0b00000100`.
+        const C = 0b00000100;
+        const ABC = Self::A.bits() | Self::B.bits() | Self::C.bits();
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/external/arbitrary.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/external/arbitrary.rs
--- 43.0.0-1/rust-vendor/bitflags/src/external/arbitrary.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/external/arbitrary.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,33 @@
+//! Specialized fuzzing for flags types using `arbitrary`.
+
+use crate::Flags;
+
+/**
+Generate some arbitrary flags value with only known bits set.
+*/
+pub fn arbitrary<'a, B: Flags>(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result<B>
+where
+    B::Bits: arbitrary::Arbitrary<'a>,
+{
+    B::from_bits(u.arbitrary()?).ok_or_else(|| arbitrary::Error::IncorrectFormat)
+}
+
+#[cfg(test)]
+mod tests {
+    use arbitrary::Arbitrary;
+
+    bitflags! {
+        #[derive(Arbitrary)]
+        struct Color: u32 {
+            const RED = 0x1;
+            const GREEN = 0x2;
+            const BLUE = 0x4;
+        }
+    }
+
+    #[test]
+    fn test_arbitrary() {
+        let mut unstructured = arbitrary::Unstructured::new(&[0_u8; 256]);
+        let _color = Color::arbitrary(&mut unstructured);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/external/bytemuck.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/external/bytemuck.rs
--- 43.0.0-1/rust-vendor/bitflags/src/external/bytemuck.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/external/bytemuck.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,19 @@
+#[cfg(test)]
+mod tests {
+    use bytemuck::{Pod, Zeroable};
+
+    bitflags! {
+        #[derive(Pod, Zeroable, Clone, Copy)]
+        #[repr(transparent)]
+        struct Color: u32 {
+            const RED = 0x1;
+            const GREEN = 0x2;
+            const BLUE = 0x4;
+        }
+    }
+
+    #[test]
+    fn test_bytemuck() {
+        assert_eq!(0x1, bytemuck::cast::<Color, u32>(Color::RED));
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/external/serde.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/external/serde.rs
--- 43.0.0-1/rust-vendor/bitflags/src/external/serde.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/external/serde.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,93 @@
+//! Specialized serialization for flags types using `serde`.
+
+use crate::{
+    parser::{self, ParseHex, WriteHex},
+    Flags,
+};
+use core::{fmt, str};
+use serde::{
+    de::{Error, Visitor},
+    Deserialize, Deserializer, Serialize, Serializer,
+};
+
+/**
+Serialize a set of flags as a human-readable string or their underlying bits.
+
+Any unknown bits will be retained.
+*/
+pub fn serialize<B: Flags, S: Serializer>(flags: &B, serializer: S) -> Result<S::Ok, S::Error>
+where
+    B::Bits: WriteHex + Serialize,
+{
+    // Serialize human-readable flags as a string like `"A | B"`
+    if serializer.is_human_readable() {
+        serializer.collect_str(&parser::AsDisplay(flags))
+    }
+    // Serialize non-human-readable flags directly as the underlying bits
+    else {
+        flags.bits().serialize(serializer)
+    }
+}
+
+/**
+Deserialize a set of flags from a human-readable string or their underlying bits.
+
+Any unknown bits will be retained.
+*/
+pub fn deserialize<'de, B: Flags, D: Deserializer<'de>>(deserializer: D) -> Result<B, D::Error>
+where
+    B::Bits: ParseHex + Deserialize<'de>,
+{
+    if deserializer.is_human_readable() {
+        // Deserialize human-readable flags by parsing them from strings like `"A | B"`
+        struct FlagsVisitor<B>(core::marker::PhantomData<B>);
+
+        impl<'de, B: Flags> Visitor<'de> for FlagsVisitor<B>
+        where
+            B::Bits: ParseHex,
+        {
+            type Value = B;
+
+            fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
+                formatter.write_str("a string value of `|` separated flags")
+            }
+
+            fn visit_str<E: Error>(self, flags: &str) -> Result<Self::Value, E> {
+                parser::from_str(flags).map_err(|e| E::custom(e))
+            }
+        }
+
+        deserializer.deserialize_str(FlagsVisitor(Default::default()))
+    } else {
+        // Deserialize non-human-readable flags directly from the underlying bits
+        let bits = B::Bits::deserialize(deserializer)?;
+
+        Ok(B::from_bits_retain(bits))
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use serde_test::{assert_tokens, Configure, Token::*};
+    bitflags! {
+        #[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug, PartialEq, Eq)]
+        #[serde(transparent)]
+        struct SerdeFlags: u32 {
+            const A = 1;
+            const B = 2;
+            const C = 4;
+            const D = 8;
+        }
+    }
+
+    #[test]
+    fn test_serde_bitflags_default() {
+        assert_tokens(&SerdeFlags::empty().readable(), &[Str("")]);
+
+        assert_tokens(&SerdeFlags::empty().compact(), &[U32(0)]);
+
+        assert_tokens(&(SerdeFlags::A | SerdeFlags::B).readable(), &[Str("A | B")]);
+
+        assert_tokens(&(SerdeFlags::A | SerdeFlags::B).compact(), &[U32(1 | 2)]);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/external.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/external.rs
--- 43.0.0-1/rust-vendor/bitflags/src/external.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/external.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,262 @@
+//! Conditional trait implementations for external libraries.
+
+/*
+How do I support a new external library?
+
+Let's say we want to add support for `my_library`.
+
+First, we create a module under `external`, like `serde` with any specialized code.
+Ideally, any utilities in here should just work off the `Flags` trait and maybe a
+few other assumed bounds.
+
+Next, re-export the library from the `__private` module here.
+
+Next, define a macro like so:
+
+```rust
+#[macro_export]
+#[doc(hidden)]
+#[cfg(feature = "serde")]
+macro_rules! __impl_external_bitflags_my_library {
+    (
+        $InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident {
+            $(
+                $(#[$inner:ident $($args:tt)*])*
+                const $Flag:tt;
+            )*
+        }
+    ) => {
+        // Implementation goes here
+    };
+}
+
+#[macro_export]
+#[doc(hidden)]
+#[cfg(not(feature = "my_library"))]
+macro_rules! __impl_external_bitflags_my_library {
+    (
+        $InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident {
+            $(
+                $(#[$inner:ident $($args:tt)*])*
+                const $Flag:tt;
+            )*
+        }
+    ) => {};
+}
+```
+
+Note that the macro is actually defined twice; once for when the `my_library` feature
+is available, and once for when it's not. This is because the `__impl_external_bitflags_my_library`
+macro is called in an end-user's library, not in `bitflags`. In an end-user's library we don't
+know whether or not a particular feature of `bitflags` is enabled, so we unconditionally call
+the macro, where the body of that macro depends on the feature flag.
+
+Now, we add our macro call to the `__impl_external_bitflags` macro body:
+
+```rust
+__impl_external_bitflags_my_library! {
+    $InternalBitFlags: $T, $PublicBitFlags {
+        $(
+            $(#[$inner $($args)*])*
+            const $Flag;
+        )*
+    }
+}
+```
+*/
+
+pub(crate) mod __private {
+    #[cfg(feature = "serde")]
+    pub use serde;
+
+    #[cfg(feature = "arbitrary")]
+    pub use arbitrary;
+
+    #[cfg(feature = "bytemuck")]
+    pub use bytemuck;
+}
+
+/// Implements traits from external libraries for the internal bitflags type.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! __impl_external_bitflags {
+    (
+        $InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident {
+            $(
+                $(#[$inner:ident $($args:tt)*])*
+                const $Flag:tt;
+            )*
+        }
+    ) => {
+        // Any new library traits impls should be added here
+        // Use `serde` as an example: generate code when the feature is available,
+        // and a no-op when it isn't
+
+        $crate::__impl_external_bitflags_serde! {
+            $InternalBitFlags: $T, $PublicBitFlags {
+                $(
+                    $(#[$inner $($args)*])*
+                    const $Flag;
+                )*
+            }
+        }
+
+        $crate::__impl_external_bitflags_arbitrary! {
+            $InternalBitFlags: $T, $PublicBitFlags {
+                $(
+                    $(#[$inner $($args)*])*
+                    const $Flag;
+                )*
+            }
+        }
+
+        $crate::__impl_external_bitflags_bytemuck! {
+            $InternalBitFlags: $T, $PublicBitFlags {
+                $(
+                    $(#[$inner $($args)*])*
+                    const $Flag;
+                )*
+            }
+        }
+    };
+}
+
+#[cfg(feature = "serde")]
+pub mod serde;
+
+/// Implement `Serialize` and `Deserialize` for the internal bitflags type.
+#[macro_export]
+#[doc(hidden)]
+#[cfg(feature = "serde")]
+macro_rules! __impl_external_bitflags_serde {
+    (
+        $InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident {
+            $(
+                $(#[$inner:ident $($args:tt)*])*
+                const $Flag:tt;
+            )*
+        }
+    ) => {
+        impl $crate::__private::serde::Serialize for $InternalBitFlags {
+            fn serialize<S: $crate::__private::serde::Serializer>(
+                &self,
+                serializer: S,
+            ) -> $crate::__private::core::result::Result<S::Ok, S::Error> {
+                $crate::serde::serialize(
+                    &$PublicBitFlags::from_bits_retain(self.bits()),
+                    serializer,
+                )
+            }
+        }
+
+        impl<'de> $crate::__private::serde::Deserialize<'de> for $InternalBitFlags {
+            fn deserialize<D: $crate::__private::serde::Deserializer<'de>>(
+                deserializer: D,
+            ) -> $crate::__private::core::result::Result<Self, D::Error> {
+                let flags: $PublicBitFlags = $crate::serde::deserialize(deserializer)?;
+
+                Ok(flags.0)
+            }
+        }
+    };
+}
+
+#[macro_export]
+#[doc(hidden)]
+#[cfg(not(feature = "serde"))]
+macro_rules! __impl_external_bitflags_serde {
+    (
+        $InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident {
+            $(
+                $(#[$inner:ident $($args:tt)*])*
+                const $Flag:tt;
+            )*
+        }
+    ) => {};
+}
+
+#[cfg(feature = "arbitrary")]
+pub mod arbitrary;
+
+#[cfg(feature = "bytemuck")]
+mod bytemuck;
+
+/// Implement `Arbitrary` for the internal bitflags type.
+#[macro_export]
+#[doc(hidden)]
+#[cfg(feature = "arbitrary")]
+macro_rules! __impl_external_bitflags_arbitrary {
+    (
+            $InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident {
+                $(
+                    $(#[$inner:ident $($args:tt)*])*
+                    const $Flag:tt;
+                )*
+            }
+    ) => {
+        impl<'a> $crate::__private::arbitrary::Arbitrary<'a> for $InternalBitFlags {
+            fn arbitrary(
+                u: &mut $crate::__private::arbitrary::Unstructured<'a>,
+            ) -> $crate::__private::arbitrary::Result<Self> {
+                $crate::arbitrary::arbitrary::<$PublicBitFlags>(u).map(|flags| flags.0)
+            }
+        }
+    };
+}
+
+#[macro_export]
+#[doc(hidden)]
+#[cfg(not(feature = "arbitrary"))]
+macro_rules! __impl_external_bitflags_arbitrary {
+    (
+        $InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident {
+            $(
+                $(#[$inner:ident $($args:tt)*])*
+                const $Flag:tt;
+            )*
+        }
+    ) => {};
+}
+
+/// Implement `Pod` and `Zeroable` for the internal bitflags type.
+#[macro_export]
+#[doc(hidden)]
+#[cfg(feature = "bytemuck")]
+macro_rules! __impl_external_bitflags_bytemuck {
+    (
+        $InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident {
+            $(
+                $(#[$inner:ident $($args:tt)*])*
+                const $Flag:tt;
+            )*
+        }
+    ) => {
+        // SAFETY: $InternalBitFlags is guaranteed to have the same ABI as $T,
+        // and $T implements Pod
+        unsafe impl $crate::__private::bytemuck::Pod for $InternalBitFlags where
+            $T: $crate::__private::bytemuck::Pod
+        {
+        }
+
+        // SAFETY: $InternalBitFlags is guaranteed to have the same ABI as $T,
+        // and $T implements Zeroable
+        unsafe impl $crate::__private::bytemuck::Zeroable for $InternalBitFlags where
+            $T: $crate::__private::bytemuck::Zeroable
+        {
+        }
+    };
+}
+
+#[macro_export]
+#[doc(hidden)]
+#[cfg(not(feature = "bytemuck"))]
+macro_rules! __impl_external_bitflags_bytemuck {
+    (
+        $InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident {
+            $(
+                $(#[$inner:ident $($args:tt)*])*
+                const $Flag:tt;
+            )*
+        }
+    ) => {};
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/internal.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/internal.rs
--- 43.0.0-1/rust-vendor/bitflags/src/internal.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/internal.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,125 @@
+//! Generate the internal `bitflags`-facing flags type.
+//!
+//! The code generated here is owned by `bitflags`, but still part of its public API.
+//! Changes to the types generated here need to be considered like any other public API change.
+
+/// Declare the `bitflags`-facing bitflags struct.
+///
+/// This type is part of the `bitflags` crate's public API, but not part of the user's.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! __declare_internal_bitflags {
+    (
+        $vis:vis struct $InternalBitFlags:ident: $T:ty
+    ) => {
+        // NOTE: The ABI of this type is _guaranteed_ to be the same as `T`
+        // This is relied on by some external libraries like `bytemuck` to make
+        // its `unsafe` trait impls sound.
+        #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
+        #[repr(transparent)]
+        $vis struct $InternalBitFlags($T);
+    };
+}
+
+/// Implement functions on the private (bitflags-facing) bitflags type.
+///
+/// Methods and trait implementations can be freely added here without breaking end-users.
+/// If we want to expose new functionality to `#[derive]`, this is the place to do it.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! __impl_internal_bitflags {
+    (
+        $InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident {
+            $(
+                $(#[$inner:ident $($args:tt)*])*
+                const $Flag:tt = $value:expr;
+            )*
+        }
+    ) => {
+        // NOTE: This impl is also used to prevent using bits types from non-primitive types
+        // in the `bitflags` macro. If this approach is changed, this guard will need to be
+        // retained somehow
+        impl $crate::__private::PublicFlags for $PublicBitFlags {
+            type Primitive = $T;
+            type Internal = $InternalBitFlags;
+        }
+
+        impl $crate::__private::core::default::Default for $InternalBitFlags {
+            #[inline]
+            fn default() -> Self {
+                $InternalBitFlags::empty()
+            }
+        }
+
+        impl $crate::__private::core::fmt::Debug for $InternalBitFlags {
+            fn fmt(&self, f: &mut $crate::__private::core::fmt::Formatter<'_>) -> $crate::__private::core::fmt::Result {
+                if self.is_empty() {
+                    // If no flags are set then write an empty hex flag to avoid
+                    // writing an empty string. In some contexts, like serialization,
+                    // an empty string is preferable, but it may be unexpected in
+                    // others for a format not to produce any output.
+                    //
+                    // We can remove this `0x0` and remain compatible with `FromStr`,
+                    // because an empty string will still parse to an empty set of flags,
+                    // just like `0x0` does.
+                    $crate::__private::core::write!(f, "{:#x}", <$T as $crate::Bits>::EMPTY)
+                } else {
+                    $crate::__private::core::fmt::Display::fmt(self, f)
+                }
+            }
+        }
+
+        impl $crate::__private::core::fmt::Display for $InternalBitFlags {
+            fn fmt(&self, f: &mut $crate::__private::core::fmt::Formatter<'_>) -> $crate::__private::core::fmt::Result {
+                $crate::parser::to_writer(&$PublicBitFlags(*self), f)
+            }
+        }
+
+        impl $crate::__private::core::str::FromStr for $InternalBitFlags {
+            type Err = $crate::parser::ParseError;
+
+            fn from_str(s: &str) -> $crate::__private::core::result::Result<Self, Self::Err> {
+                $crate::parser::from_str::<$PublicBitFlags>(s).map(|flags| flags.0)
+            }
+        }
+
+        impl $crate::__private::core::convert::AsRef<$T> for $InternalBitFlags {
+            fn as_ref(&self) -> &$T {
+                &self.0
+            }
+        }
+
+        impl $crate::__private::core::convert::From<$T> for $InternalBitFlags {
+            fn from(bits: $T) -> Self {
+                Self::from_bits_retain(bits)
+            }
+        }
+
+        // The internal flags type offers a similar API to the public one
+
+        $crate::__impl_public_bitflags! {
+            $InternalBitFlags: $T, $PublicBitFlags {
+                $(
+                    $(#[$inner $($args)*])*
+                    const $Flag = $value;
+                )*
+            }
+        }
+
+        $crate::__impl_public_bitflags_ops! {
+            $InternalBitFlags
+        }
+
+        $crate::__impl_public_bitflags_iter! {
+            $InternalBitFlags: $T, $PublicBitFlags
+        }
+
+        impl $InternalBitFlags {
+            /// Returns a mutable reference to the raw value of the flags currently stored.
+            #[inline]
+            pub fn bits_mut(&mut self) -> &mut $T {
+                &mut self.0
+            }
+        }
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/iter.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/iter.rs
--- 43.0.0-1/rust-vendor/bitflags/src/iter.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/iter.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,145 @@
+/*!
+Yield the bits of a source flags value in a set of contained flags values.
+*/
+
+use crate::{Flag, Flags};
+
+/**
+An iterator over flags values.
+
+This iterator will yield flags values for contained, defined flags first, with any remaining bits yielded
+as a final flags value.
+*/
+pub struct Iter<B: 'static> {
+    inner: IterNames<B>,
+    done: bool,
+}
+
+impl<B: Flags> Iter<B> {
+    pub(crate) fn new(flags: &B) -> Self {
+        Iter {
+            inner: IterNames::new(flags),
+            done: false,
+        }
+    }
+}
+
+impl<B: 'static> Iter<B> {
+    // Used by the `bitflags` macro
+    #[doc(hidden)]
+    pub const fn __private_const_new(flags: &'static [Flag<B>], source: B, remaining: B) -> Self {
+        Iter {
+            inner: IterNames::__private_const_new(flags, source, remaining),
+            done: false,
+        }
+    }
+}
+
+impl<B: Flags> Iterator for Iter<B> {
+    type Item = B;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        match self.inner.next() {
+            Some((_, flag)) => Some(flag),
+            None if !self.done => {
+                self.done = true;
+
+                // After iterating through valid names, if there are any bits left over
+                // then return one final value that includes them. This makes `into_iter`
+                // and `from_iter` roundtrip
+                if !self.inner.remaining().is_empty() {
+                    Some(B::from_bits_retain(self.inner.remaining.bits()))
+                } else {
+                    None
+                }
+            }
+            None => None,
+        }
+    }
+}
+
+/**
+An iterator over flags values.
+
+This iterator only yields flags values for contained, defined, named flags. Any remaining bits
+won't be yielded, but can be found with the [`IterNames::remaining`] method.
+*/
+pub struct IterNames<B: 'static> {
+    flags: &'static [Flag<B>],
+    idx: usize,
+    source: B,
+    remaining: B,
+}
+
+impl<B: Flags> IterNames<B> {
+    pub(crate) fn new(flags: &B) -> Self {
+        IterNames {
+            flags: B::FLAGS,
+            idx: 0,
+            remaining: B::from_bits_retain(flags.bits()),
+            source: B::from_bits_retain(flags.bits()),
+        }
+    }
+}
+
+impl<B: 'static> IterNames<B> {
+    // Used by the bitflags macro
+    #[doc(hidden)]
+    pub const fn __private_const_new(flags: &'static [Flag<B>], source: B, remaining: B) -> Self {
+        IterNames {
+            flags,
+            idx: 0,
+            remaining,
+            source,
+        }
+    }
+
+    /// Get a flags value of any remaining bits that haven't been yielded yet.
+    ///
+    /// Once the iterator has finished, this method can be used to
+    /// check whether or not there are any bits that didn't correspond
+    /// to a contained, defined, named flag remaining.
+    pub fn remaining(&self) -> &B {
+        &self.remaining
+    }
+}
+
+impl<B: Flags> Iterator for IterNames<B> {
+    type Item = (&'static str, B);
+
+    fn next(&mut self) -> Option<Self::Item> {
+        while let Some(flag) = self.flags.get(self.idx) {
+            // Short-circuit if our state is empty
+            if self.remaining.is_empty() {
+                return None;
+            }
+
+            self.idx += 1;
+
+            // Skip unnamed flags
+            if flag.name().is_empty() {
+                continue;
+            }
+
+            let bits = flag.value().bits();
+
+            // If the flag is set in the original source _and_ it has bits that haven't
+            // been covered by a previous flag yet then yield it. These conditions cover
+            // two cases for multi-bit flags:
+            //
+            // 1. When flags partially overlap, such as `0b00000001` and `0b00000101`, we'll
+            // yield both flags.
+            // 2. When flags fully overlap, such as in convenience flags that are a shorthand for others,
+            // we won't yield both flags.
+            if self.source.contains(B::from_bits_retain(bits))
+                && self.remaining.intersects(B::from_bits_retain(bits))
+            {
+                self.remaining.remove(B::from_bits_retain(bits));
+
+                return Some((flag.name(), B::from_bits_retain(bits)));
+            }
+        }
+
+        None
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/lib.rs
--- 43.0.0-1/rust-vendor/bitflags/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,927 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+/*!
+Generate types for C-style flags with ergonomic APIs.
+
+# Getting started
+
+Add `bitflags` to your `Cargo.toml`:
+
+```toml
+[dependencies.bitflags]
+version = "2.6.0"
+```
+
+## Generating flags types
+
+Use the [`bitflags`] macro to generate flags types:
+
+```rust
+use bitflags::bitflags;
+
+bitflags! {
+    pub struct Flags: u32 {
+        const A = 0b00000001;
+        const B = 0b00000010;
+        const C = 0b00000100;
+    }
+}
+```
+
+See the docs for the `bitflags` macro for the full syntax.
+
+Also see the [`example_generated`](./example_generated/index.html) module for an example of what the `bitflags` macro generates for a flags type.
+
+### Externally defined flags
+
+If you're generating flags types for an external source, such as a C API, you can define
+an extra unnamed flag as a mask of all bits the external source may ever set. Usually this would be all bits (`!0`):
+
+```rust
+# use bitflags::bitflags;
+bitflags! {
+    pub struct Flags: u32 {
+        const A = 0b00000001;
+        const B = 0b00000010;
+        const C = 0b00000100;
+
+        // The source may set any bits
+        const _ = !0;
+    }
+}
+```
+
+Why should you do this? Generated methods like `all` and truncating operators like `!` only consider
+bits in defined flags. Adding an unnamed flag makes those methods consider additional bits,
+without generating additional constants for them. It helps compatibility when the external source
+may start setting additional bits at any time. The [known and unknown bits](#known-and-unknown-bits)
+section has more details on this behavior.
+
+### Custom derives
+
+You can derive some traits on generated flags types if you enable Cargo features. The following
+libraries are currently supported:
+
+- `serde`: Support `#[derive(Serialize, Deserialize)]`, using text for human-readable formats,
+and a raw number for binary formats.
+- `arbitrary`: Support `#[derive(Arbitrary)]`, only generating flags values with known bits.
+- `bytemuck`: Support `#[derive(Pod, Zeroable)]`, for casting between flags values and their
+underlying bits values.
+
+You can also define your own flags type outside of the [`bitflags`] macro and then use it to generate methods.
+This can be useful if you need a custom `#[derive]` attribute for a library that `bitflags` doesn't
+natively support:
+
+```rust
+# use std::fmt::Debug as SomeTrait;
+# use bitflags::bitflags;
+#[derive(SomeTrait)]
+pub struct Flags(u32);
+
+bitflags! {
+    impl Flags: u32 {
+        const A = 0b00000001;
+        const B = 0b00000010;
+        const C = 0b00000100;
+    }
+}
+```
+
+### Adding custom methods
+
+The [`bitflags`] macro supports attributes on generated flags types within the macro itself, while
+`impl` blocks can be added outside of it:
+
+```rust
+# use bitflags::bitflags;
+bitflags! {
+    // Attributes can be applied to flags types
+    #[repr(transparent)]
+    #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
+    pub struct Flags: u32 {
+        const A = 0b00000001;
+        const B = 0b00000010;
+        const C = 0b00000100;
+    }
+}
+
+// Impl blocks can be added to flags types
+impl Flags {
+    pub fn as_u64(&self) -> u64 {
+        self.bits() as u64
+    }
+}
+```
+
+## Working with flags values
+
+Use generated constants and standard bitwise operators to interact with flags values:
+
+```rust
+# use bitflags::bitflags;
+# bitflags! {
+#     #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
+#     pub struct Flags: u32 {
+#         const A = 0b00000001;
+#         const B = 0b00000010;
+#         const C = 0b00000100;
+#     }
+# }
+// union
+let ab = Flags::A | Flags::B;
+
+// intersection
+let a = ab & Flags::A;
+
+// difference
+let b = ab - Flags::A;
+
+// complement
+let c = !ab;
+```
+
+See the docs for the [`Flags`] trait for more details on operators and how they behave.
+
+# Formatting and parsing
+
+`bitflags` defines a text format that can be used to convert any flags value to and from strings.
+
+See the [`parser`] module for more details.
+
+# Specification
+
+The terminology and behavior of generated flags types is
+[specified in the source repository](https://github.com/bitflags/bitflags/blob/main/spec.md).
+Details are repeated in these docs where appropriate, but is exhaustively listed in the spec. Some
+things are worth calling out explicitly here.
+
+## Flags types, flags values, flags
+
+The spec and these docs use consistent terminology to refer to things in the bitflags domain:
+
+- **Bits type**: A type that defines a fixed number of bits at specific locations.
+- **Flag**: A set of bits in a bits type that may have a unique name.
+- **Flags type**: A set of defined flags over a specific bits type.
+- **Flags value**: An instance of a flags type using its specific bits value for storage.
+
+```
+# use bitflags::bitflags;
+bitflags! {
+    struct FlagsType: u8 {
+//                    -- Bits type
+//         --------- Flags type
+        const A = 1;
+//            ----- Flag
+    }
+}
+
+let flag = FlagsType::A;
+//  ---- Flags value
+```
+
+## Known and unknown bits
+
+Any bits in a flag you define are called _known bits_. Any other bits are _unknown bits_.
+In the following flags type:
+
+```
+# use bitflags::bitflags;
+bitflags! {
+    struct Flags: u8 {
+        const A = 1;
+        const B = 1 << 1;
+        const C = 1 << 2;
+    }
+}
+```
+
+The known bits are `0b0000_0111` and the unknown bits are `0b1111_1000`.
+
+`bitflags` doesn't guarantee that a flags value will only ever have known bits set, but some operators
+will unset any unknown bits they encounter. In a future version of `bitflags`, all operators will
+unset unknown bits.
+
+If you're using `bitflags` for flags types defined externally, such as from C, you probably want all
+bits to be considered known, in case that external source changes. You can do this using an unnamed
+flag, as described in [externally defined flags](#externally-defined-flags).
+
+## Zero-bit flags
+
+Flags with no bits set should be avoided because they interact strangely with [`Flags::contains`]
+and [`Flags::intersects`]. A zero-bit flag is always contained, but is never intersected. The
+names of zero-bit flags can be parsed, but are never formatted.
+
+## Multi-bit flags
+
+Flags that set multiple bits should be avoided unless each bit is also in a single-bit flag.
+Take the following flags type as an example:
+
+```
+# use bitflags::bitflags;
+bitflags! {
+    struct Flags: u8 {
+        const A = 1;
+        const B = 1 | 1 << 1;
+    }
+}
+```
+
+The result of `Flags::A ^ Flags::B` is `0b0000_0010`, which doesn't correspond to either
+`Flags::A` or `Flags::B` even though it's still a known bit.
+*/
+
+#![cfg_attr(not(any(feature = "std", test)), no_std)]
+#![cfg_attr(not(test), forbid(unsafe_code))]
+#![cfg_attr(test, allow(mixed_script_confusables))]
+
+#[doc(inline)]
+pub use traits::{Bits, Flag, Flags};
+
+pub mod iter;
+pub mod parser;
+
+mod traits;
+
+#[doc(hidden)]
+pub mod __private {
+    #[allow(unused_imports)]
+    // Easier than conditionally checking any optional external dependencies
+    pub use crate::{external::__private::*, traits::__private::*};
+
+    pub use core;
+}
+
+#[allow(unused_imports)]
+pub use external::*;
+
+#[allow(deprecated)]
+pub use traits::BitFlags;
+
+/*
+How does the bitflags crate work?
+
+This library generates a `struct` in the end-user's crate with a bunch of constants on it that represent flags.
+The difference between `bitflags` and a lot of other libraries is that we don't actually control the generated `struct` in the end.
+It's part of the end-user's crate, so it belongs to them. That makes it difficult to extend `bitflags` with new functionality
+because we could end up breaking valid code that was already written.
+
+Our solution is to split the type we generate into two: the public struct owned by the end-user, and an internal struct owned by `bitflags` (us).
+To give you an example, let's say we had a crate that called `bitflags!`:
+
+```rust
+bitflags! {
+    pub struct MyFlags: u32 {
+        const A = 1;
+        const B = 2;
+    }
+}
+```
+
+What they'd end up with looks something like this:
+
+```rust
+pub struct MyFlags(<MyFlags as PublicFlags>::InternalBitFlags);
+
+const _: () = {
+    #[repr(transparent)]
+    #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
+    pub struct MyInternalBitFlags {
+        bits: u32,
+    }
+
+    impl PublicFlags for MyFlags {
+        type Internal = InternalBitFlags;
+    }
+};
+```
+
+If we want to expose something like a new trait impl for generated flags types, we add it to our generated `MyInternalBitFlags`,
+and let `#[derive]` on `MyFlags` pick up that implementation, if an end-user chooses to add one.
+
+The public API is generated in the `__impl_public_flags!` macro, and the internal API is generated in
+the `__impl_internal_flags!` macro.
+
+The macros are split into 3 modules:
+
+- `public`: where the user-facing flags types are generated.
+- `internal`: where the `bitflags`-facing flags types are generated.
+- `external`: where external library traits are implemented conditionally.
+*/
+
+/**
+Generate a flags type.
+
+# `struct` mode
+
+A declaration that begins with `$vis struct` will generate a `struct` for a flags type, along with
+methods and trait implementations for it. The body of the declaration defines flags as constants,
+where each constant is a flags value of the generated flags type.
+
+## Examples
+
+Generate a flags type using `u8` as the bits type:
+
+```
+# use bitflags::bitflags;
+bitflags! {
+    struct Flags: u8 {
+        const A = 1;
+        const B = 1 << 1;
+        const C = 0b0000_0100;
+    }
+}
+```
+
+Flags types are private by default and accept standard visibility modifiers. Flags themselves
+are always public:
+
+```
+# use bitflags::bitflags;
+bitflags! {
+    pub struct Flags: u8 {
+        // Constants are always `pub`
+        const A = 1;
+    }
+}
+```
+
+Flags may refer to other flags using their [`Flags::bits`] value:
+
+```
+# use bitflags::bitflags;
+bitflags! {
+    struct Flags: u8 {
+        const A = 1;
+        const B = 1 << 1;
+        const AB = Flags::A.bits() | Flags::B.bits();
+    }
+}
+```
+
+A single `bitflags` invocation may include zero or more flags type declarations:
+
+```
+# use bitflags::bitflags;
+bitflags! {}
+
+bitflags! {
+    struct Flags1: u8 {
+        const A = 1;
+    }
+
+    struct Flags2: u8 {
+        const A = 1;
+    }
+}
+```
+
+# `impl` mode
+
+A declaration that begins with `impl` will only generate methods and trait implementations for the
+`struct` defined outside of the `bitflags` macro.
+
+The struct itself must be a newtype using the bits type as its field.
+
+The syntax for `impl` mode is identical to `struct` mode besides the starting token.
+
+## Examples
+
+Implement flags methods and traits for a custom flags type using `u8` as its underlying bits type:
+
+```
+# use bitflags::bitflags;
+struct Flags(u8);
+
+bitflags! {
+    impl Flags: u8 {
+        const A = 1;
+        const B = 1 << 1;
+        const C = 0b0000_0100;
+    }
+}
+```
+
+# Named and unnamed flags
+
+Constants in the body of a declaration are flags. The identifier of the constant is the name of
+the flag. If the identifier is `_`, then the flag is unnamed. Unnamed flags don't appear in the
+generated API, but affect how bits are truncated.
+
+## Examples
+
+Adding an unnamed flag that makes all bits known:
+
+```
+# use bitflags::bitflags;
+bitflags! {
+    struct Flags: u8 {
+        const A = 1;
+        const B = 1 << 1;
+
+        const _ = !0;
+    }
+}
+```
+
+Flags types may define multiple unnamed flags:
+
+```
+# use bitflags::bitflags;
+bitflags! {
+    struct Flags: u8 {
+        const _ = 1;
+        const _ = 1 << 1;
+    }
+}
+```
+*/
+#[macro_export]
+macro_rules! bitflags {
+    (
+        $(#[$outer:meta])*
+        $vis:vis struct $BitFlags:ident: $T:ty {
+            $(
+                $(#[$inner:ident $($args:tt)*])*
+                const $Flag:tt = $value:expr;
+            )*
+        }
+
+        $($t:tt)*
+    ) => {
+        // Declared in the scope of the `bitflags!` call
+        // This type appears in the end-user's API
+        $crate::__declare_public_bitflags! {
+            $(#[$outer])*
+            $vis struct $BitFlags
+        }
+
+        // Workaround for: https://github.com/bitflags/bitflags/issues/320
+        $crate::__impl_public_bitflags_consts! {
+            $BitFlags: $T {
+                $(
+                    $(#[$inner $($args)*])*
+                    const $Flag = $value;
+                )*
+            }
+        }
+
+        #[allow(
+            dead_code,
+            deprecated,
+            unused_doc_comments,
+            unused_attributes,
+            unused_mut,
+            unused_imports,
+            non_upper_case_globals,
+            clippy::assign_op_pattern,
+            clippy::indexing_slicing,
+            clippy::same_name_method,
+            clippy::iter_without_into_iter,
+        )]
+        const _: () = {
+            // Declared in a "hidden" scope that can't be reached directly
+            // These types don't appear in the end-user's API
+            $crate::__declare_internal_bitflags! {
+                $vis struct InternalBitFlags: $T
+            }
+
+            $crate::__impl_internal_bitflags! {
+                InternalBitFlags: $T, $BitFlags {
+                    $(
+                        $(#[$inner $($args)*])*
+                        const $Flag = $value;
+                    )*
+                }
+            }
+
+            // This is where new library trait implementations can be added
+            $crate::__impl_external_bitflags! {
+                InternalBitFlags: $T, $BitFlags {
+                    $(
+                        $(#[$inner $($args)*])*
+                        const $Flag;
+                    )*
+                }
+            }
+
+            $crate::__impl_public_bitflags_forward! {
+                $BitFlags: $T, InternalBitFlags
+            }
+
+            $crate::__impl_public_bitflags_ops! {
+                $BitFlags
+            }
+
+            $crate::__impl_public_bitflags_iter! {
+                $BitFlags: $T, $BitFlags
+            }
+        };
+
+        $crate::bitflags! {
+            $($t)*
+        }
+    };
+    (
+        $(#[$outer:meta])*
+        impl $BitFlags:ident: $T:ty {
+            $(
+                $(#[$inner:ident $($args:tt)*])*
+                const $Flag:tt = $value:expr;
+            )*
+        }
+
+        $($t:tt)*
+    ) => {
+        $crate::__impl_public_bitflags_consts! {
+            $BitFlags: $T {
+                $(
+                    $(#[$inner $($args)*])*
+                    const $Flag = $value;
+                )*
+            }
+        }
+
+        #[allow(
+            dead_code,
+            deprecated,
+            unused_doc_comments,
+            unused_attributes,
+            unused_mut,
+            unused_imports,
+            non_upper_case_globals,
+            clippy::assign_op_pattern,
+            clippy::iter_without_into_iter,
+        )]
+        const _: () = {
+            $crate::__impl_public_bitflags! {
+                $(#[$outer])*
+                $BitFlags: $T, $BitFlags {
+                    $(
+                        $(#[$inner $($args)*])*
+                        const $Flag = $value;
+                    )*
+                }
+            }
+
+            $crate::__impl_public_bitflags_ops! {
+                $BitFlags
+            }
+
+            $crate::__impl_public_bitflags_iter! {
+                $BitFlags: $T, $BitFlags
+            }
+        };
+
+        $crate::bitflags! {
+            $($t)*
+        }
+    };
+    () => {};
+}
+
+/// Implement functions on bitflags types.
+///
+/// We need to be careful about adding new methods and trait implementations here because they
+/// could conflict with items added by the end-user.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! __impl_bitflags {
+    (
+        $(#[$outer:meta])*
+        $PublicBitFlags:ident: $T:ty {
+            fn empty() $empty:block
+            fn all() $all:block
+            fn bits($bits0:ident) $bits:block
+            fn from_bits($from_bits0:ident) $from_bits:block
+            fn from_bits_truncate($from_bits_truncate0:ident) $from_bits_truncate:block
+            fn from_bits_retain($from_bits_retain0:ident) $from_bits_retain:block
+            fn from_name($from_name0:ident) $from_name:block
+            fn is_empty($is_empty0:ident) $is_empty:block
+            fn is_all($is_all0:ident) $is_all:block
+            fn intersects($intersects0:ident, $intersects1:ident) $intersects:block
+            fn contains($contains0:ident, $contains1:ident) $contains:block
+            fn insert($insert0:ident, $insert1:ident) $insert:block
+            fn remove($remove0:ident, $remove1:ident) $remove:block
+            fn toggle($toggle0:ident, $toggle1:ident) $toggle:block
+            fn set($set0:ident, $set1:ident, $set2:ident) $set:block
+            fn intersection($intersection0:ident, $intersection1:ident) $intersection:block
+            fn union($union0:ident, $union1:ident) $union:block
+            fn difference($difference0:ident, $difference1:ident) $difference:block
+            fn symmetric_difference($symmetric_difference0:ident, $symmetric_difference1:ident) $symmetric_difference:block
+            fn complement($complement0:ident) $complement:block
+        }
+    ) => {
+        #[allow(dead_code, deprecated, unused_attributes)]
+        $(#[$outer])*
+        impl $PublicBitFlags {
+            /// Get a flags value with all bits unset.
+            #[inline]
+            pub const fn empty() -> Self {
+                $empty
+            }
+
+            /// Get a flags value with all known bits set.
+            #[inline]
+            pub const fn all() -> Self {
+                $all
+            }
+
+            /// Get the underlying bits value.
+            ///
+            /// The returned value is exactly the bits set in this flags value.
+            #[inline]
+            pub const fn bits(&self) -> $T {
+                let $bits0 = self;
+                $bits
+            }
+
+            /// Convert from a bits value.
+            ///
+            /// This method will return `None` if any unknown bits are set.
+            #[inline]
+            pub const fn from_bits(bits: $T) -> $crate::__private::core::option::Option<Self> {
+                let $from_bits0 = bits;
+                $from_bits
+            }
+
+            /// Convert from a bits value, unsetting any unknown bits.
+            #[inline]
+            pub const fn from_bits_truncate(bits: $T) -> Self {
+                let $from_bits_truncate0 = bits;
+                $from_bits_truncate
+            }
+
+            /// Convert from a bits value exactly.
+            #[inline]
+            pub const fn from_bits_retain(bits: $T) -> Self {
+                let $from_bits_retain0 = bits;
+                $from_bits_retain
+            }
+
+            /// Get a flags value with the bits of a flag with the given name set.
+            ///
+            /// This method will return `None` if `name` is empty or doesn't
+            /// correspond to any named flag.
+            #[inline]
+            pub fn from_name(name: &str) -> $crate::__private::core::option::Option<Self> {
+                let $from_name0 = name;
+                $from_name
+            }
+
+            /// Whether all bits in this flags value are unset.
+            #[inline]
+            pub const fn is_empty(&self) -> bool {
+                let $is_empty0 = self;
+                $is_empty
+            }
+
+            /// Whether all known bits in this flags value are set.
+            #[inline]
+            pub const fn is_all(&self) -> bool {
+                let $is_all0 = self;
+                $is_all
+            }
+
+            /// Whether any set bits in a source flags value are also set in a target flags value.
+            #[inline]
+            pub const fn intersects(&self, other: Self) -> bool {
+                let $intersects0 = self;
+                let $intersects1 = other;
+                $intersects
+            }
+
+            /// Whether all set bits in a source flags value are also set in a target flags value.
+            #[inline]
+            pub const fn contains(&self, other: Self) -> bool {
+                let $contains0 = self;
+                let $contains1 = other;
+                $contains
+            }
+
+            /// The bitwise or (`|`) of the bits in two flags values.
+            #[inline]
+            pub fn insert(&mut self, other: Self) {
+                let $insert0 = self;
+                let $insert1 = other;
+                $insert
+            }
+
+            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
+            ///
+            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
+            /// `remove` won't truncate `other`, but the `!` operator will.
+            #[inline]
+            pub fn remove(&mut self, other: Self) {
+                let $remove0 = self;
+                let $remove1 = other;
+                $remove
+            }
+
+            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
+            #[inline]
+            pub fn toggle(&mut self, other: Self) {
+                let $toggle0 = self;
+                let $toggle1 = other;
+                $toggle
+            }
+
+            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
+            #[inline]
+            pub fn set(&mut self, other: Self, value: bool) {
+                let $set0 = self;
+                let $set1 = other;
+                let $set2 = value;
+                $set
+            }
+
+            /// The bitwise and (`&`) of the bits in two flags values.
+            #[inline]
+            #[must_use]
+            pub const fn intersection(self, other: Self) -> Self {
+                let $intersection0 = self;
+                let $intersection1 = other;
+                $intersection
+            }
+
+            /// The bitwise or (`|`) of the bits in two flags values.
+            #[inline]
+            #[must_use]
+            pub const fn union(self, other: Self) -> Self {
+                let $union0 = self;
+                let $union1 = other;
+                $union
+            }
+
+            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
+            ///
+            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
+            /// `difference` won't truncate `other`, but the `!` operator will.
+            #[inline]
+            #[must_use]
+            pub const fn difference(self, other: Self) -> Self {
+                let $difference0 = self;
+                let $difference1 = other;
+                $difference
+            }
+
+            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
+            #[inline]
+            #[must_use]
+            pub const fn symmetric_difference(self, other: Self) -> Self {
+                let $symmetric_difference0 = self;
+                let $symmetric_difference1 = other;
+                $symmetric_difference
+            }
+
+            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
+            #[inline]
+            #[must_use]
+            pub const fn complement(self) -> Self {
+                let $complement0 = self;
+                $complement
+            }
+        }
+    };
+}
+
+/// A macro that processed the input to `bitflags!` and shuffles attributes around
+/// based on whether or not they're "expression-safe".
+///
+/// This macro is a token-tree muncher that works on 2 levels:
+///
+/// For each attribute, we explicitly match on its identifier, like `cfg` to determine
+/// whether or not it should be considered expression-safe.
+///
+/// If you find yourself with an attribute that should be considered expression-safe
+/// and isn't, it can be added here.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! __bitflags_expr_safe_attrs {
+    // Entrypoint: Move all flags and all attributes into `unprocessed` lists
+    // where they'll be munched one-at-a-time
+    (
+        $(#[$inner:ident $($args:tt)*])*
+        { $e:expr }
+    ) => {
+        $crate::__bitflags_expr_safe_attrs! {
+            expr: { $e },
+            attrs: {
+                // All attributes start here
+                unprocessed: [$(#[$inner $($args)*])*],
+                // Attributes that are safe on expressions go here
+                processed: [],
+            },
+        }
+    };
+    // Process the next attribute on the current flag
+    // `cfg`: The next flag should be propagated to expressions
+    // NOTE: You can copy this rules block and replace `cfg` with
+    // your attribute name that should be considered expression-safe
+    (
+        expr: { $e:expr },
+            attrs: {
+            unprocessed: [
+                // cfg matched here
+                #[cfg $($args:tt)*]
+                $($attrs_rest:tt)*
+            ],
+            processed: [$($expr:tt)*],
+        },
+    ) => {
+        $crate::__bitflags_expr_safe_attrs! {
+            expr: { $e },
+            attrs: {
+                unprocessed: [
+                    $($attrs_rest)*
+                ],
+                processed: [
+                    $($expr)*
+                    // cfg added here
+                    #[cfg $($args)*]
+                ],
+            },
+        }
+    };
+    // Process the next attribute on the current flag
+    // `$other`: The next flag should not be propagated to expressions
+    (
+        expr: { $e:expr },
+            attrs: {
+            unprocessed: [
+                // $other matched here
+                #[$other:ident $($args:tt)*]
+                $($attrs_rest:tt)*
+            ],
+            processed: [$($expr:tt)*],
+        },
+    ) => {
+        $crate::__bitflags_expr_safe_attrs! {
+            expr: { $e },
+                attrs: {
+                unprocessed: [
+                    $($attrs_rest)*
+                ],
+                processed: [
+                    // $other not added here
+                    $($expr)*
+                ],
+            },
+        }
+    };
+    // Once all attributes on all flags are processed, generate the actual code
+    (
+        expr: { $e:expr },
+        attrs: {
+            unprocessed: [],
+            processed: [$(#[$expr:ident $($exprargs:tt)*])*],
+        },
+    ) => {
+        $(#[$expr $($exprargs)*])*
+        { $e }
+    }
+}
+
+/// Implement a flag, which may be a wildcard `_`.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! __bitflags_flag {
+    (
+        {
+            name: _,
+            named: { $($named:tt)* },
+            unnamed: { $($unnamed:tt)* },
+        }
+    ) => {
+        $($unnamed)*
+    };
+    (
+        {
+            name: $Flag:ident,
+            named: { $($named:tt)* },
+            unnamed: { $($unnamed:tt)* },
+        }
+    ) => {
+        $($named)*
+    };
+}
+
+#[macro_use]
+mod public;
+#[macro_use]
+mod internal;
+#[macro_use]
+mod external;
+
+#[cfg(feature = "example_generated")]
+pub mod example_generated;
+
+#[cfg(test)]
+mod tests;
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/parser.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/parser.rs
--- 43.0.0-1/rust-vendor/bitflags/src/parser.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/parser.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,332 @@
+/*!
+Parsing flags from text.
+
+Format and parse a flags value as text using the following grammar:
+
+- _Flags:_ (_Whitespace_ _Flag_ _Whitespace_)`|`*
+- _Flag:_ _Name_ | _Hex Number_
+- _Name:_ The name of any defined flag
+- _Hex Number_: `0x`([0-9a-fA-F])*
+- _Whitespace_: (\s)*
+
+As an example, this is how `Flags::A | Flags::B | 0x0c` can be represented as text:
+
+```text
+A | B | 0x0c
+```
+
+Alternatively, it could be represented without whitespace:
+
+```text
+A|B|0x0C
+```
+
+Note that identifiers are *case-sensitive*, so the following is *not equivalent*:
+
+```text
+a|b|0x0C
+```
+*/
+
+#![allow(clippy::let_unit_value)]
+
+use core::fmt::{self, Write};
+
+use crate::{Bits, Flags};
+
+/**
+Write a flags value as text.
+
+Any bits that aren't part of a contained flag will be formatted as a hex number.
+*/
+pub fn to_writer<B: Flags>(flags: &B, mut writer: impl Write) -> Result<(), fmt::Error>
+where
+    B::Bits: WriteHex,
+{
+    // A formatter for bitflags that produces text output like:
+    //
+    // A | B | 0xf6
+    //
+    // The names of set flags are written in a bar-separated-format,
+    // followed by a hex number of any remaining bits that are set
+    // but don't correspond to any flags.
+
+    // Iterate over known flag values
+    let mut first = true;
+    let mut iter = flags.iter_names();
+    for (name, _) in &mut iter {
+        if !first {
+            writer.write_str(" | ")?;
+        }
+
+        first = false;
+        writer.write_str(name)?;
+    }
+
+    // Append any extra bits that correspond to flags to the end of the format
+    let remaining = iter.remaining().bits();
+    if remaining != B::Bits::EMPTY {
+        if !first {
+            writer.write_str(" | ")?;
+        }
+
+        writer.write_str("0x")?;
+        remaining.write_hex(writer)?;
+    }
+
+    fmt::Result::Ok(())
+}
+
+#[cfg(feature = "serde")]
+pub(crate) struct AsDisplay<'a, B>(pub(crate) &'a B);
+
+#[cfg(feature = "serde")]
+impl<'a, B: Flags> fmt::Display for AsDisplay<'a, B>
+where
+    B::Bits: WriteHex,
+{
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        to_writer(self.0, f)
+    }
+}
+
+/**
+Parse a flags value from text.
+
+This function will fail on any names that don't correspond to defined flags.
+Unknown bits will be retained.
+*/
+pub fn from_str<B: Flags>(input: &str) -> Result<B, ParseError>
+where
+    B::Bits: ParseHex,
+{
+    let mut parsed_flags = B::empty();
+
+    // If the input is empty then return an empty set of flags
+    if input.trim().is_empty() {
+        return Ok(parsed_flags);
+    }
+
+    for flag in input.split('|') {
+        let flag = flag.trim();
+
+        // If the flag is empty then we've got missing input
+        if flag.is_empty() {
+            return Err(ParseError::empty_flag());
+        }
+
+        // If the flag starts with `0x` then it's a hex number
+        // Parse it directly to the underlying bits type
+        let parsed_flag = if let Some(flag) = flag.strip_prefix("0x") {
+            let bits =
+                <B::Bits>::parse_hex(flag).map_err(|_| ParseError::invalid_hex_flag(flag))?;
+
+            B::from_bits_retain(bits)
+        }
+        // Otherwise the flag is a name
+        // The generated flags type will determine whether
+        // or not it's a valid identifier
+        else {
+            B::from_name(flag).ok_or_else(|| ParseError::invalid_named_flag(flag))?
+        };
+
+        parsed_flags.insert(parsed_flag);
+    }
+
+    Ok(parsed_flags)
+}
+
+/**
+Write a flags value as text, ignoring any unknown bits.
+*/
+pub fn to_writer_truncate<B: Flags>(flags: &B, writer: impl Write) -> Result<(), fmt::Error>
+where
+    B::Bits: WriteHex,
+{
+    to_writer(&B::from_bits_truncate(flags.bits()), writer)
+}
+
+/**
+Parse a flags value from text.
+
+This function will fail on any names that don't correspond to defined flags.
+Unknown bits will be ignored.
+*/
+pub fn from_str_truncate<B: Flags>(input: &str) -> Result<B, ParseError>
+where
+    B::Bits: ParseHex,
+{
+    Ok(B::from_bits_truncate(from_str::<B>(input)?.bits()))
+}
+
+/**
+Write only the contained, defined, named flags in a flags value as text.
+*/
+pub fn to_writer_strict<B: Flags>(flags: &B, mut writer: impl Write) -> Result<(), fmt::Error> {
+    // This is a simplified version of `to_writer` that ignores
+    // any bits not corresponding to a named flag
+
+    let mut first = true;
+    let mut iter = flags.iter_names();
+    for (name, _) in &mut iter {
+        if !first {
+            writer.write_str(" | ")?;
+        }
+
+        first = false;
+        writer.write_str(name)?;
+    }
+
+    fmt::Result::Ok(())
+}
+
+/**
+Parse a flags value from text.
+
+This function will fail on any names that don't correspond to defined flags.
+This function will fail to parse hex values.
+*/
+pub fn from_str_strict<B: Flags>(input: &str) -> Result<B, ParseError> {
+    // This is a simplified version of `from_str` that ignores
+    // any bits not corresponding to a named flag
+
+    let mut parsed_flags = B::empty();
+
+    // If the input is empty then return an empty set of flags
+    if input.trim().is_empty() {
+        return Ok(parsed_flags);
+    }
+
+    for flag in input.split('|') {
+        let flag = flag.trim();
+
+        // If the flag is empty then we've got missing input
+        if flag.is_empty() {
+            return Err(ParseError::empty_flag());
+        }
+
+        // If the flag starts with `0x` then it's a hex number
+        // These aren't supported in the strict parser
+        if flag.starts_with("0x") {
+            return Err(ParseError::invalid_hex_flag("unsupported hex flag value"));
+        }
+
+        let parsed_flag = B::from_name(flag).ok_or_else(|| ParseError::invalid_named_flag(flag))?;
+
+        parsed_flags.insert(parsed_flag);
+    }
+
+    Ok(parsed_flags)
+}
+
+/**
+Encode a value as a hex string.
+
+Implementors of this trait should not write the `0x` prefix.
+*/
+pub trait WriteHex {
+    /// Write the value as hex.
+    fn write_hex<W: fmt::Write>(&self, writer: W) -> fmt::Result;
+}
+
+/**
+Parse a value from a hex string.
+*/
+pub trait ParseHex {
+    /// Parse the value from hex.
+    fn parse_hex(input: &str) -> Result<Self, ParseError>
+    where
+        Self: Sized;
+}
+
+/// An error encountered while parsing flags from text.
+#[derive(Debug)]
+pub struct ParseError(ParseErrorKind);
+
+#[derive(Debug)]
+#[allow(clippy::enum_variant_names)]
+enum ParseErrorKind {
+    EmptyFlag,
+    InvalidNamedFlag {
+        #[cfg(not(feature = "std"))]
+        got: (),
+        #[cfg(feature = "std")]
+        got: String,
+    },
+    InvalidHexFlag {
+        #[cfg(not(feature = "std"))]
+        got: (),
+        #[cfg(feature = "std")]
+        got: String,
+    },
+}
+
+impl ParseError {
+    /// An invalid hex flag was encountered.
+    pub fn invalid_hex_flag(flag: impl fmt::Display) -> Self {
+        let _flag = flag;
+
+        let got = {
+            #[cfg(feature = "std")]
+            {
+                _flag.to_string()
+            }
+        };
+
+        ParseError(ParseErrorKind::InvalidHexFlag { got })
+    }
+
+    /// A named flag that doesn't correspond to any on the flags type was encountered.
+    pub fn invalid_named_flag(flag: impl fmt::Display) -> Self {
+        let _flag = flag;
+
+        let got = {
+            #[cfg(feature = "std")]
+            {
+                _flag.to_string()
+            }
+        };
+
+        ParseError(ParseErrorKind::InvalidNamedFlag { got })
+    }
+
+    /// A hex or named flag wasn't found between separators.
+    pub const fn empty_flag() -> Self {
+        ParseError(ParseErrorKind::EmptyFlag)
+    }
+}
+
+impl fmt::Display for ParseError {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        match &self.0 {
+            ParseErrorKind::InvalidNamedFlag { got } => {
+                let _got = got;
+
+                write!(f, "unrecognized named flag")?;
+
+                #[cfg(feature = "std")]
+                {
+                    write!(f, " `{}`", _got)?;
+                }
+            }
+            ParseErrorKind::InvalidHexFlag { got } => {
+                let _got = got;
+
+                write!(f, "invalid hex flag")?;
+
+                #[cfg(feature = "std")]
+                {
+                    write!(f, " `{}`", _got)?;
+                }
+            }
+            ParseErrorKind::EmptyFlag => {
+                write!(f, "encountered empty flag")?;
+            }
+        }
+
+        Ok(())
+    }
+}
+
+#[cfg(feature = "std")]
+impl std::error::Error for ParseError {}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/public.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/public.rs
--- 43.0.0-1/rust-vendor/bitflags/src/public.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/public.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,578 @@
+//! Generate the user-facing flags type.
+//!
+//! The code here belongs to the end-user, so new trait implementations and methods can't be
+//! added without potentially breaking users.
+
+/// Declare the user-facing bitflags struct.
+///
+/// This type is guaranteed to be a newtype with a `bitflags`-facing type as its single field.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! __declare_public_bitflags {
+    (
+        $(#[$outer:meta])*
+        $vis:vis struct $PublicBitFlags:ident
+    ) => {
+        $(#[$outer])*
+        $vis struct $PublicBitFlags(<$PublicBitFlags as $crate::__private::PublicFlags>::Internal);
+    };
+}
+
+/// Implement functions on the public (user-facing) bitflags type.
+///
+/// We need to be careful about adding new methods and trait implementations here because they
+/// could conflict with items added by the end-user.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! __impl_public_bitflags_forward {
+    (
+        $(#[$outer:meta])*
+        $PublicBitFlags:ident: $T:ty, $InternalBitFlags:ident
+    ) => {
+        $crate::__impl_bitflags! {
+            $(#[$outer])*
+            $PublicBitFlags: $T {
+                fn empty() {
+                    Self($InternalBitFlags::empty())
+                }
+
+                fn all() {
+                    Self($InternalBitFlags::all())
+                }
+
+                fn bits(f) {
+                    f.0.bits()
+                }
+
+                fn from_bits(bits) {
+                    match $InternalBitFlags::from_bits(bits) {
+                        $crate::__private::core::option::Option::Some(bits) => $crate::__private::core::option::Option::Some(Self(bits)),
+                        $crate::__private::core::option::Option::None => $crate::__private::core::option::Option::None,
+                    }
+                }
+
+                fn from_bits_truncate(bits) {
+                    Self($InternalBitFlags::from_bits_truncate(bits))
+                }
+
+                fn from_bits_retain(bits) {
+                    Self($InternalBitFlags::from_bits_retain(bits))
+                }
+
+                fn from_name(name) {
+                    match $InternalBitFlags::from_name(name) {
+                        $crate::__private::core::option::Option::Some(bits) => $crate::__private::core::option::Option::Some(Self(bits)),
+                        $crate::__private::core::option::Option::None => $crate::__private::core::option::Option::None,
+                    }
+                }
+
+                fn is_empty(f) {
+                    f.0.is_empty()
+                }
+
+                fn is_all(f) {
+                    f.0.is_all()
+                }
+
+                fn intersects(f, other) {
+                    f.0.intersects(other.0)
+                }
+
+                fn contains(f, other) {
+                    f.0.contains(other.0)
+                }
+
+                fn insert(f, other) {
+                    f.0.insert(other.0)
+                }
+
+                fn remove(f, other) {
+                    f.0.remove(other.0)
+                }
+
+                fn toggle(f, other) {
+                    f.0.toggle(other.0)
+                }
+
+                fn set(f, other, value) {
+                    f.0.set(other.0, value)
+                }
+
+                fn intersection(f, other) {
+                    Self(f.0.intersection(other.0))
+                }
+
+                fn union(f, other) {
+                    Self(f.0.union(other.0))
+                }
+
+                fn difference(f, other) {
+                    Self(f.0.difference(other.0))
+                }
+
+                fn symmetric_difference(f, other) {
+                    Self(f.0.symmetric_difference(other.0))
+                }
+
+                fn complement(f) {
+                    Self(f.0.complement())
+                }
+            }
+        }
+    };
+}
+
+/// Implement functions on the public (user-facing) bitflags type.
+///
+/// We need to be careful about adding new methods and trait implementations here because they
+/// could conflict with items added by the end-user.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! __impl_public_bitflags {
+    (
+        $(#[$outer:meta])*
+        $BitFlags:ident: $T:ty, $PublicBitFlags:ident {
+            $(
+                $(#[$inner:ident $($args:tt)*])*
+                const $Flag:tt = $value:expr;
+            )*
+        }
+    ) => {
+        $crate::__impl_bitflags! {
+            $(#[$outer])*
+            $BitFlags: $T {
+                fn empty() {
+                    Self(<$T as $crate::Bits>::EMPTY)
+                }
+
+                fn all() {
+                    let mut truncated = <$T as $crate::Bits>::EMPTY;
+                    let mut i = 0;
+
+                    $(
+                        $crate::__bitflags_expr_safe_attrs!(
+                            $(#[$inner $($args)*])*
+                            {{
+                                let flag = <$PublicBitFlags as $crate::Flags>::FLAGS[i].value().bits();
+
+                                truncated = truncated | flag;
+                                i += 1;
+                            }}
+                        );
+                    )*
+
+                    let _ = i;
+                    Self::from_bits_retain(truncated)
+                }
+
+                fn bits(f) {
+                    f.0
+                }
+
+                fn from_bits(bits) {
+                    let truncated = Self::from_bits_truncate(bits).0;
+
+                    if truncated == bits {
+                        $crate::__private::core::option::Option::Some(Self(bits))
+                    } else {
+                        $crate::__private::core::option::Option::None
+                    }
+                }
+
+                fn from_bits_truncate(bits) {
+                    Self(bits & Self::all().bits())
+                }
+
+                fn from_bits_retain(bits) {
+                    Self(bits)
+                }
+
+                fn from_name(name) {
+                    $(
+                        $crate::__bitflags_flag!({
+                            name: $Flag,
+                            named: {
+                                $crate::__bitflags_expr_safe_attrs!(
+                                    $(#[$inner $($args)*])*
+                                    {
+                                        if name == $crate::__private::core::stringify!($Flag) {
+                                            return $crate::__private::core::option::Option::Some(Self($PublicBitFlags::$Flag.bits()));
+                                        }
+                                    }
+                                );
+                            },
+                            unnamed: {},
+                        });
+                    )*
+
+                    let _ = name;
+                    $crate::__private::core::option::Option::None
+                }
+
+                fn is_empty(f) {
+                    f.bits() == <$T as $crate::Bits>::EMPTY
+                }
+
+                fn is_all(f) {
+                    // NOTE: We check against `Self::all` here, not `Self::Bits::ALL`
+                    // because the set of all flags may not use all bits
+                    Self::all().bits() | f.bits() == f.bits()
+                }
+
+                fn intersects(f, other) {
+                    f.bits() & other.bits() != <$T as $crate::Bits>::EMPTY
+                }
+
+                fn contains(f, other) {
+                    f.bits() & other.bits() == other.bits()
+                }
+
+                fn insert(f, other) {
+                    *f = Self::from_bits_retain(f.bits()).union(other);
+                }
+
+                fn remove(f, other) {
+                    *f = Self::from_bits_retain(f.bits()).difference(other);
+                }
+
+                fn toggle(f, other) {
+                    *f = Self::from_bits_retain(f.bits()).symmetric_difference(other);
+                }
+
+                fn set(f, other, value) {
+                    if value {
+                        f.insert(other);
+                    } else {
+                        f.remove(other);
+                    }
+                }
+
+                fn intersection(f, other) {
+                    Self::from_bits_retain(f.bits() & other.bits())
+                }
+
+                fn union(f, other) {
+                    Self::from_bits_retain(f.bits() | other.bits())
+                }
+
+                fn difference(f, other) {
+                    Self::from_bits_retain(f.bits() & !other.bits())
+                }
+
+                fn symmetric_difference(f, other) {
+                    Self::from_bits_retain(f.bits() ^ other.bits())
+                }
+
+                fn complement(f) {
+                    Self::from_bits_truncate(!f.bits())
+                }
+            }
+        }
+    };
+}
+
+/// Implement iterators on the public (user-facing) bitflags type.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! __impl_public_bitflags_iter {
+    (
+        $(#[$outer:meta])*
+        $BitFlags:ident: $T:ty, $PublicBitFlags:ident
+    ) => {
+        $(#[$outer])*
+        impl $BitFlags {
+            /// Yield a set of contained flags values.
+            ///
+            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
+            /// will be yielded together as a final flags value.
+            #[inline]
+            pub const fn iter(&self) -> $crate::iter::Iter<$PublicBitFlags> {
+                $crate::iter::Iter::__private_const_new(
+                    <$PublicBitFlags as $crate::Flags>::FLAGS,
+                    $PublicBitFlags::from_bits_retain(self.bits()),
+                    $PublicBitFlags::from_bits_retain(self.bits()),
+                )
+            }
+
+            /// Yield a set of contained named flags values.
+            ///
+            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
+            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
+            #[inline]
+            pub const fn iter_names(&self) -> $crate::iter::IterNames<$PublicBitFlags> {
+                $crate::iter::IterNames::__private_const_new(
+                    <$PublicBitFlags as $crate::Flags>::FLAGS,
+                    $PublicBitFlags::from_bits_retain(self.bits()),
+                    $PublicBitFlags::from_bits_retain(self.bits()),
+                )
+            }
+        }
+
+        $(#[$outer:meta])*
+        impl $crate::__private::core::iter::IntoIterator for $BitFlags {
+            type Item = $PublicBitFlags;
+            type IntoIter = $crate::iter::Iter<$PublicBitFlags>;
+
+            fn into_iter(self) -> Self::IntoIter {
+                self.iter()
+            }
+        }
+    };
+}
+
+/// Implement traits on the public (user-facing) bitflags type.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! __impl_public_bitflags_ops {
+    (
+        $(#[$outer:meta])*
+        $PublicBitFlags:ident
+    ) => {
+
+        $(#[$outer])*
+        impl $crate::__private::core::fmt::Binary for $PublicBitFlags {
+            fn fmt(
+                &self,
+                f: &mut $crate::__private::core::fmt::Formatter,
+            ) -> $crate::__private::core::fmt::Result {
+                let inner = self.0;
+                $crate::__private::core::fmt::Binary::fmt(&inner, f)
+            }
+        }
+
+        $(#[$outer])*
+        impl $crate::__private::core::fmt::Octal for $PublicBitFlags {
+            fn fmt(
+                &self,
+                f: &mut $crate::__private::core::fmt::Formatter,
+            ) -> $crate::__private::core::fmt::Result {
+                let inner = self.0;
+                $crate::__private::core::fmt::Octal::fmt(&inner, f)
+            }
+        }
+
+        $(#[$outer])*
+        impl $crate::__private::core::fmt::LowerHex for $PublicBitFlags {
+            fn fmt(
+                &self,
+                f: &mut $crate::__private::core::fmt::Formatter,
+            ) -> $crate::__private::core::fmt::Result {
+                let inner = self.0;
+                $crate::__private::core::fmt::LowerHex::fmt(&inner, f)
+            }
+        }
+
+        $(#[$outer])*
+        impl $crate::__private::core::fmt::UpperHex for $PublicBitFlags {
+            fn fmt(
+                &self,
+                f: &mut $crate::__private::core::fmt::Formatter,
+            ) -> $crate::__private::core::fmt::Result {
+                let inner = self.0;
+                $crate::__private::core::fmt::UpperHex::fmt(&inner, f)
+            }
+        }
+
+        $(#[$outer])*
+        impl $crate::__private::core::ops::BitOr for $PublicBitFlags {
+            type Output = Self;
+
+            /// The bitwise or (`|`) of the bits in two flags values.
+            #[inline]
+            fn bitor(self, other: $PublicBitFlags) -> Self {
+                self.union(other)
+            }
+        }
+
+        $(#[$outer])*
+        impl $crate::__private::core::ops::BitOrAssign for $PublicBitFlags {
+            /// The bitwise or (`|`) of the bits in two flags values.
+            #[inline]
+            fn bitor_assign(&mut self, other: Self) {
+                self.insert(other);
+            }
+        }
+
+        $(#[$outer])*
+        impl $crate::__private::core::ops::BitXor for $PublicBitFlags {
+            type Output = Self;
+
+            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
+            #[inline]
+            fn bitxor(self, other: Self) -> Self {
+                self.symmetric_difference(other)
+            }
+        }
+
+        $(#[$outer])*
+        impl $crate::__private::core::ops::BitXorAssign for $PublicBitFlags {
+            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
+            #[inline]
+            fn bitxor_assign(&mut self, other: Self) {
+                self.toggle(other);
+            }
+        }
+
+        $(#[$outer])*
+        impl $crate::__private::core::ops::BitAnd for $PublicBitFlags {
+            type Output = Self;
+
+            /// The bitwise and (`&`) of the bits in two flags values.
+            #[inline]
+            fn bitand(self, other: Self) -> Self {
+                self.intersection(other)
+            }
+        }
+
+        $(#[$outer])*
+        impl $crate::__private::core::ops::BitAndAssign for $PublicBitFlags {
+            /// The bitwise and (`&`) of the bits in two flags values.
+            #[inline]
+            fn bitand_assign(&mut self, other: Self) {
+                *self = Self::from_bits_retain(self.bits()).intersection(other);
+            }
+        }
+
+        $(#[$outer])*
+        impl $crate::__private::core::ops::Sub for $PublicBitFlags {
+            type Output = Self;
+
+            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
+            ///
+            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
+            /// `difference` won't truncate `other`, but the `!` operator will.
+            #[inline]
+            fn sub(self, other: Self) -> Self {
+                self.difference(other)
+            }
+        }
+
+        $(#[$outer])*
+        impl $crate::__private::core::ops::SubAssign for $PublicBitFlags {
+            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
+            ///
+            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
+            /// `difference` won't truncate `other`, but the `!` operator will.
+            #[inline]
+            fn sub_assign(&mut self, other: Self) {
+                self.remove(other);
+            }
+        }
+
+        $(#[$outer])*
+        impl $crate::__private::core::ops::Not for $PublicBitFlags {
+            type Output = Self;
+
+            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
+            #[inline]
+            fn not(self) -> Self {
+                self.complement()
+            }
+        }
+
+        $(#[$outer])*
+        impl $crate::__private::core::iter::Extend<$PublicBitFlags> for $PublicBitFlags {
+            /// The bitwise or (`|`) of the bits in each flags value.
+            fn extend<T: $crate::__private::core::iter::IntoIterator<Item = Self>>(
+                &mut self,
+                iterator: T,
+            ) {
+                for item in iterator {
+                    self.insert(item)
+                }
+            }
+        }
+
+        $(#[$outer])*
+        impl $crate::__private::core::iter::FromIterator<$PublicBitFlags> for $PublicBitFlags {
+            /// The bitwise or (`|`) of the bits in each flags value.
+            fn from_iter<T: $crate::__private::core::iter::IntoIterator<Item = Self>>(
+                iterator: T,
+            ) -> Self {
+                use $crate::__private::core::iter::Extend;
+
+                let mut result = Self::empty();
+                result.extend(iterator);
+                result
+            }
+        }
+    };
+}
+
+/// Implement constants on the public (user-facing) bitflags type.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! __impl_public_bitflags_consts {
+    (
+        $(#[$outer:meta])*
+        $PublicBitFlags:ident: $T:ty {
+            $(
+                $(#[$inner:ident $($args:tt)*])*
+                const $Flag:tt = $value:expr;
+            )*
+        }
+    ) => {
+        $(#[$outer])*
+        impl $PublicBitFlags {
+            $(
+                $crate::__bitflags_flag!({
+                    name: $Flag,
+                    named: {
+                        $(#[$inner $($args)*])*
+                        #[allow(
+                            deprecated,
+                            non_upper_case_globals,
+                        )]
+                        pub const $Flag: Self = Self::from_bits_retain($value);
+                    },
+                    unnamed: {},
+                });
+            )*
+        }
+
+        $(#[$outer])*
+        impl $crate::Flags for $PublicBitFlags {
+            const FLAGS: &'static [$crate::Flag<$PublicBitFlags>] = &[
+                $(
+                    $crate::__bitflags_flag!({
+                        name: $Flag,
+                        named: {
+                            $crate::__bitflags_expr_safe_attrs!(
+                                $(#[$inner $($args)*])*
+                                {
+                                    #[allow(
+                                        deprecated,
+                                        non_upper_case_globals,
+                                    )]
+                                    $crate::Flag::new($crate::__private::core::stringify!($Flag), $PublicBitFlags::$Flag)
+                                }
+                            )
+                        },
+                        unnamed: {
+                            $crate::__bitflags_expr_safe_attrs!(
+                                $(#[$inner $($args)*])*
+                                {
+                                    #[allow(
+                                        deprecated,
+                                        non_upper_case_globals,
+                                    )]
+                                    $crate::Flag::new("", $PublicBitFlags::from_bits_retain($value))
+                                }
+                            )
+                        },
+                    }),
+                )*
+            ];
+
+            type Bits = $T;
+
+            fn bits(&self) -> $T {
+                $PublicBitFlags::bits(self)
+            }
+
+            fn from_bits_retain(bits: $T) -> $PublicBitFlags {
+                $PublicBitFlags::from_bits_retain(bits)
+            }
+        }
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/all.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/all.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/all.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/all.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,23 @@
+use super::*;
+
+use crate::Flags;
+
+#[test]
+fn cases() {
+    case(1 | 1 << 1 | 1 << 2, TestFlags::all);
+
+    case(0, TestZero::all);
+
+    case(0, TestEmpty::all);
+
+    case(!0, TestExternal::all);
+}
+
+#[track_caller]
+fn case<T: Flags>(expected: T::Bits, inherent: impl FnOnce() -> T)
+where
+    <T as Flags>::Bits: std::fmt::Debug + PartialEq,
+{
+    assert_eq!(expected, inherent().bits(), "T::all()");
+    assert_eq!(expected, T::all().bits(), "Flags::all()");
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/bits.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/bits.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/bits.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/bits.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,36 @@
+use super::*;
+
+use crate::Flags;
+
+#[test]
+fn cases() {
+    case(0, TestFlags::empty(), TestFlags::bits);
+
+    case(1, TestFlags::A, TestFlags::bits);
+    case(1 | 1 << 1 | 1 << 2, TestFlags::ABC, TestFlags::bits);
+
+    case(!0, TestFlags::from_bits_retain(u8::MAX), TestFlags::bits);
+    case(1 << 3, TestFlags::from_bits_retain(1 << 3), TestFlags::bits);
+
+    case(1 << 3, TestZero::from_bits_retain(1 << 3), TestZero::bits);
+
+    case(1 << 3, TestEmpty::from_bits_retain(1 << 3), TestEmpty::bits);
+
+    case(
+        1 << 4 | 1 << 6,
+        TestExternal::from_bits_retain(1 << 4 | 1 << 6),
+        TestExternal::bits,
+    );
+}
+
+#[track_caller]
+fn case<T: Flags + std::fmt::Debug>(
+    expected: T::Bits,
+    value: T,
+    inherent: impl FnOnce(&T) -> T::Bits,
+) where
+    T::Bits: std::fmt::Debug + PartialEq,
+{
+    assert_eq!(expected, inherent(&value), "{:?}.bits()", value);
+    assert_eq!(expected, Flags::bits(&value), "Flags::bits({:?})", value);
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/complement.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/complement.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/complement.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/complement.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,53 @@
+use super::*;
+
+use crate::Flags;
+
+#[test]
+fn cases() {
+    case(0, TestFlags::all(), TestFlags::complement);
+    case(0, TestFlags::from_bits_retain(!0), TestFlags::complement);
+
+    case(1 | 1 << 1, TestFlags::C, TestFlags::complement);
+    case(
+        1 | 1 << 1,
+        TestFlags::C | TestFlags::from_bits_retain(1 << 3),
+        TestFlags::complement,
+    );
+
+    case(
+        1 | 1 << 1 | 1 << 2,
+        TestFlags::empty(),
+        TestFlags::complement,
+    );
+    case(
+        1 | 1 << 1 | 1 << 2,
+        TestFlags::from_bits_retain(1 << 3),
+        TestFlags::complement,
+    );
+
+    case(0, TestZero::empty(), TestZero::complement);
+
+    case(0, TestEmpty::empty(), TestEmpty::complement);
+
+    case(1 << 2, TestOverlapping::AB, TestOverlapping::complement);
+
+    case(!0, TestExternal::empty(), TestExternal::complement);
+}
+
+#[track_caller]
+fn case<T: Flags + std::fmt::Debug + std::ops::Not<Output = T> + Copy>(
+    expected: T::Bits,
+    value: T,
+    inherent: impl FnOnce(T) -> T,
+) where
+    T::Bits: std::fmt::Debug + PartialEq,
+{
+    assert_eq!(expected, inherent(value).bits(), "{:?}.complement()", value);
+    assert_eq!(
+        expected,
+        Flags::complement(value).bits(),
+        "Flags::complement({:?})",
+        value
+    );
+    assert_eq!(expected, (!value).bits(), "!{:?}", value);
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/contains.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/contains.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/contains.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/contains.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,108 @@
+use super::*;
+
+use crate::Flags;
+
+#[test]
+fn cases() {
+    case(
+        TestFlags::empty(),
+        &[
+            (TestFlags::empty(), true),
+            (TestFlags::A, false),
+            (TestFlags::B, false),
+            (TestFlags::C, false),
+            (TestFlags::from_bits_retain(1 << 3), false),
+        ],
+        TestFlags::contains,
+    );
+
+    case(
+        TestFlags::A,
+        &[
+            (TestFlags::empty(), true),
+            (TestFlags::A, true),
+            (TestFlags::B, false),
+            (TestFlags::C, false),
+            (TestFlags::ABC, false),
+            (TestFlags::from_bits_retain(1 << 3), false),
+            (TestFlags::from_bits_retain(1 | (1 << 3)), false),
+        ],
+        TestFlags::contains,
+    );
+
+    case(
+        TestFlags::ABC,
+        &[
+            (TestFlags::empty(), true),
+            (TestFlags::A, true),
+            (TestFlags::B, true),
+            (TestFlags::C, true),
+            (TestFlags::ABC, true),
+            (TestFlags::from_bits_retain(1 << 3), false),
+        ],
+        TestFlags::contains,
+    );
+
+    case(
+        TestFlags::from_bits_retain(1 << 3),
+        &[
+            (TestFlags::empty(), true),
+            (TestFlags::A, false),
+            (TestFlags::B, false),
+            (TestFlags::C, false),
+            (TestFlags::from_bits_retain(1 << 3), true),
+        ],
+        TestFlags::contains,
+    );
+
+    case(
+        TestZero::ZERO,
+        &[(TestZero::ZERO, true)],
+        TestZero::contains,
+    );
+
+    case(
+        TestOverlapping::AB,
+        &[
+            (TestOverlapping::AB, true),
+            (TestOverlapping::BC, false),
+            (TestOverlapping::from_bits_retain(1 << 1), true),
+        ],
+        TestOverlapping::contains,
+    );
+
+    case(
+        TestExternal::all(),
+        &[
+            (TestExternal::A, true),
+            (TestExternal::B, true),
+            (TestExternal::C, true),
+            (TestExternal::from_bits_retain(1 << 5 | 1 << 7), true),
+        ],
+        TestExternal::contains,
+    );
+}
+
+#[track_caller]
+fn case<T: Flags + std::fmt::Debug + Copy>(
+    value: T,
+    inputs: &[(T, bool)],
+    mut inherent: impl FnMut(&T, T) -> bool,
+) {
+    for (input, expected) in inputs {
+        assert_eq!(
+            *expected,
+            inherent(&value, *input),
+            "{:?}.contains({:?})",
+            value,
+            input
+        );
+        assert_eq!(
+            *expected,
+            Flags::contains(&value, *input),
+            "Flags::contains({:?}, {:?})",
+            value,
+            input
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/difference.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/difference.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/difference.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/difference.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,92 @@
+use super::*;
+
+use crate::Flags;
+
+#[test]
+fn cases() {
+    case(
+        TestFlags::A | TestFlags::B,
+        &[
+            (TestFlags::A, 1 << 1),
+            (TestFlags::B, 1),
+            (TestFlags::from_bits_retain(1 << 3), 1 | 1 << 1),
+        ],
+        TestFlags::difference,
+    );
+
+    case(
+        TestFlags::from_bits_retain(1 | 1 << 3),
+        &[
+            (TestFlags::A, 1 << 3),
+            (TestFlags::from_bits_retain(1 << 3), 1),
+        ],
+        TestFlags::difference,
+    );
+
+    case(
+        TestExternal::from_bits_retain(!0),
+        &[(TestExternal::A, 0b1111_1110)],
+        TestExternal::difference,
+    );
+
+    assert_eq!(
+        0b1111_1110,
+        (TestExternal::from_bits_retain(!0) & !TestExternal::A).bits()
+    );
+
+    assert_eq!(
+        0b1111_1110,
+        (TestFlags::from_bits_retain(!0).difference(TestFlags::A)).bits()
+    );
+
+    // The `!` operator unsets bits that don't correspond to known flags
+    assert_eq!(
+        1 << 1 | 1 << 2,
+        (TestFlags::from_bits_retain(!0) & !TestFlags::A).bits()
+    );
+}
+
+#[track_caller]
+fn case<T: Flags + std::fmt::Debug + std::ops::Sub<Output = T> + std::ops::SubAssign + Copy>(
+    value: T,
+    inputs: &[(T, T::Bits)],
+    mut inherent: impl FnMut(T, T) -> T,
+) where
+    T::Bits: std::fmt::Debug + PartialEq + Copy,
+{
+    for (input, expected) in inputs {
+        assert_eq!(
+            *expected,
+            inherent(value, *input).bits(),
+            "{:?}.difference({:?})",
+            value,
+            input
+        );
+        assert_eq!(
+            *expected,
+            Flags::difference(value, *input).bits(),
+            "Flags::difference({:?}, {:?})",
+            value,
+            input
+        );
+        assert_eq!(
+            *expected,
+            (value - *input).bits(),
+            "{:?} - {:?}",
+            value,
+            input
+        );
+        assert_eq!(
+            *expected,
+            {
+                let mut value = value;
+                value -= *input;
+                value
+            }
+            .bits(),
+            "{:?} -= {:?}",
+            value,
+            input,
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/empty.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/empty.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/empty.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/empty.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,23 @@
+use super::*;
+
+use crate::Flags;
+
+#[test]
+fn cases() {
+    case(0, TestFlags::empty);
+
+    case(0, TestZero::empty);
+
+    case(0, TestEmpty::empty);
+
+    case(0, TestExternal::empty);
+}
+
+#[track_caller]
+fn case<T: Flags>(expected: T::Bits, inherent: impl FnOnce() -> T)
+where
+    <T as Flags>::Bits: std::fmt::Debug + PartialEq,
+{
+    assert_eq!(expected, inherent().bits(), "T::empty()");
+    assert_eq!(expected, T::empty().bits(), "Flags::empty()");
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/eq.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/eq.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/eq.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/eq.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,10 @@
+use super::*;
+
+#[test]
+fn cases() {
+    assert_eq!(TestFlags::empty(), TestFlags::empty());
+    assert_eq!(TestFlags::all(), TestFlags::all());
+
+    assert!(TestFlags::from_bits_retain(1) < TestFlags::from_bits_retain(2));
+    assert!(TestFlags::from_bits_retain(2) > TestFlags::from_bits_retain(1));
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/extend.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/extend.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/extend.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/extend.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,42 @@
+use super::*;
+
+#[test]
+fn cases() {
+    let mut flags = TestFlags::empty();
+
+    flags.extend(TestFlags::A);
+
+    assert_eq!(TestFlags::A, flags);
+
+    flags.extend(TestFlags::A | TestFlags::B | TestFlags::C);
+
+    assert_eq!(TestFlags::ABC, flags);
+
+    flags.extend(TestFlags::from_bits_retain(1 << 5));
+
+    assert_eq!(TestFlags::ABC | TestFlags::from_bits_retain(1 << 5), flags);
+}
+
+mod external {
+    use super::*;
+
+    #[test]
+    fn cases() {
+        let mut flags = TestExternal::empty();
+
+        flags.extend(TestExternal::A);
+
+        assert_eq!(TestExternal::A, flags);
+
+        flags.extend(TestExternal::A | TestExternal::B | TestExternal::C);
+
+        assert_eq!(TestExternal::ABC, flags);
+
+        flags.extend(TestExternal::from_bits_retain(1 << 5));
+
+        assert_eq!(
+            TestExternal::ABC | TestExternal::from_bits_retain(1 << 5),
+            flags
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/flags.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/flags.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/flags.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/flags.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,46 @@
+use super::*;
+
+use crate::Flags;
+
+#[test]
+fn cases() {
+    let flags = TestFlags::FLAGS
+        .iter()
+        .map(|flag| (flag.name(), flag.value().bits()))
+        .collect::<Vec<_>>();
+
+    assert_eq!(
+        vec![
+            ("A", 1u8),
+            ("B", 1 << 1),
+            ("C", 1 << 2),
+            ("ABC", 1 | 1 << 1 | 1 << 2),
+        ],
+        flags,
+    );
+
+    assert_eq!(0, TestEmpty::FLAGS.iter().count());
+}
+
+mod external {
+    use super::*;
+
+    #[test]
+    fn cases() {
+        let flags = TestExternal::FLAGS
+            .iter()
+            .map(|flag| (flag.name(), flag.value().bits()))
+            .collect::<Vec<_>>();
+
+        assert_eq!(
+            vec![
+                ("A", 1u8),
+                ("B", 1 << 1),
+                ("C", 1 << 2),
+                ("ABC", 1 | 1 << 1 | 1 << 2),
+                ("", !0),
+            ],
+            flags,
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/fmt.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/fmt.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/fmt.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/fmt.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,97 @@
+use super::*;
+
+#[test]
+fn cases() {
+    case(TestFlags::empty(), "TestFlags(0x0)", "0", "0", "0", "0");
+    case(TestFlags::A, "TestFlags(A)", "1", "1", "1", "1");
+    case(
+        TestFlags::all(),
+        "TestFlags(A | B | C)",
+        "7",
+        "7",
+        "7",
+        "111",
+    );
+    case(
+        TestFlags::from_bits_retain(1 << 3),
+        "TestFlags(0x8)",
+        "8",
+        "8",
+        "10",
+        "1000",
+    );
+    case(
+        TestFlags::A | TestFlags::from_bits_retain(1 << 3),
+        "TestFlags(A | 0x8)",
+        "9",
+        "9",
+        "11",
+        "1001",
+    );
+
+    case(TestZero::ZERO, "TestZero(0x0)", "0", "0", "0", "0");
+    case(
+        TestZero::ZERO | TestZero::from_bits_retain(1),
+        "TestZero(0x1)",
+        "1",
+        "1",
+        "1",
+        "1",
+    );
+
+    case(TestZeroOne::ONE, "TestZeroOne(ONE)", "1", "1", "1", "1");
+
+    case(
+        TestOverlapping::from_bits_retain(1 << 1),
+        "TestOverlapping(0x2)",
+        "2",
+        "2",
+        "2",
+        "10",
+    );
+
+    case(
+        TestExternal::from_bits_retain(1 | 1 << 1 | 1 << 3),
+        "TestExternal(A | B | 0x8)",
+        "B",
+        "b",
+        "13",
+        "1011",
+    );
+
+    case(
+        TestExternal::all(),
+        "TestExternal(A | B | C | 0xf8)",
+        "FF",
+        "ff",
+        "377",
+        "11111111",
+    );
+
+    case(
+        TestExternalFull::all(),
+        "TestExternalFull(0xff)",
+        "FF",
+        "ff",
+        "377",
+        "11111111",
+    );
+}
+
+#[track_caller]
+fn case<
+    T: std::fmt::Debug + std::fmt::UpperHex + std::fmt::LowerHex + std::fmt::Octal + std::fmt::Binary,
+>(
+    value: T,
+    debug: &str,
+    uhex: &str,
+    lhex: &str,
+    oct: &str,
+    bin: &str,
+) {
+    assert_eq!(debug, format!("{:?}", value));
+    assert_eq!(uhex, format!("{:X}", value));
+    assert_eq!(lhex, format!("{:x}", value));
+    assert_eq!(oct, format!("{:o}", value));
+    assert_eq!(bin, format!("{:b}", value));
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/from_bits.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/from_bits.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/from_bits.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/from_bits.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,45 @@
+use super::*;
+
+use crate::Flags;
+
+#[test]
+fn cases() {
+    case(Some(0), 0, TestFlags::from_bits);
+    case(Some(1), 1, TestFlags::from_bits);
+    case(
+        Some(1 | 1 << 1 | 1 << 2),
+        1 | 1 << 1 | 1 << 2,
+        TestFlags::from_bits,
+    );
+
+    case(None, 1 << 3, TestFlags::from_bits);
+    case(None, 1 | 1 << 3, TestFlags::from_bits);
+
+    case(Some(1 | 1 << 1), 1 | 1 << 1, TestOverlapping::from_bits);
+
+    case(Some(1 << 1), 1 << 1, TestOverlapping::from_bits);
+
+    case(Some(1 << 5), 1 << 5, TestExternal::from_bits);
+}
+
+#[track_caller]
+fn case<T: Flags>(
+    expected: Option<T::Bits>,
+    input: T::Bits,
+    inherent: impl FnOnce(T::Bits) -> Option<T>,
+) where
+    <T as Flags>::Bits: std::fmt::Debug + PartialEq,
+{
+    assert_eq!(
+        expected,
+        inherent(input).map(|f| f.bits()),
+        "T::from_bits({:?})",
+        input
+    );
+    assert_eq!(
+        expected,
+        T::from_bits(input).map(|f| f.bits()),
+        "Flags::from_bits({:?})",
+        input
+    );
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/from_bits_retain.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/from_bits_retain.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/from_bits_retain.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/from_bits_retain.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,38 @@
+use super::*;
+
+use crate::Flags;
+
+#[test]
+fn cases() {
+    case(0, TestFlags::from_bits_retain);
+    case(1, TestFlags::from_bits_retain);
+    case(1 | 1 << 1 | 1 << 2, TestFlags::from_bits_retain);
+
+    case(1 << 3, TestFlags::from_bits_retain);
+    case(1 | 1 << 3, TestFlags::from_bits_retain);
+
+    case(1 | 1 << 1, TestOverlapping::from_bits_retain);
+
+    case(1 << 1, TestOverlapping::from_bits_retain);
+
+    case(1 << 5, TestExternal::from_bits_retain);
+}
+
+#[track_caller]
+fn case<T: Flags>(input: T::Bits, inherent: impl FnOnce(T::Bits) -> T)
+where
+    <T as Flags>::Bits: std::fmt::Debug + PartialEq,
+{
+    assert_eq!(
+        input,
+        inherent(input).bits(),
+        "T::from_bits_retain({:?})",
+        input
+    );
+    assert_eq!(
+        input,
+        T::from_bits_retain(input).bits(),
+        "Flags::from_bits_retain({:?})",
+        input
+    );
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/from_bits_truncate.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/from_bits_truncate.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/from_bits_truncate.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/from_bits_truncate.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,42 @@
+use super::*;
+
+use crate::Flags;
+
+#[test]
+fn cases() {
+    case(0, 0, TestFlags::from_bits_truncate);
+    case(1, 1, TestFlags::from_bits_truncate);
+    case(
+        1 | 1 << 1 | 1 << 2,
+        1 | 1 << 1 | 1 << 2,
+        TestFlags::from_bits_truncate,
+    );
+
+    case(0, 1 << 3, TestFlags::from_bits_truncate);
+    case(1, 1 | 1 << 3, TestFlags::from_bits_truncate);
+
+    case(1 | 1 << 1, 1 | 1 << 1, TestOverlapping::from_bits_truncate);
+
+    case(1 << 1, 1 << 1, TestOverlapping::from_bits_truncate);
+
+    case(1 << 5, 1 << 5, TestExternal::from_bits_truncate);
+}
+
+#[track_caller]
+fn case<T: Flags>(expected: T::Bits, input: T::Bits, inherent: impl FnOnce(T::Bits) -> T)
+where
+    <T as Flags>::Bits: std::fmt::Debug + PartialEq,
+{
+    assert_eq!(
+        expected,
+        inherent(input).bits(),
+        "T::from_bits_truncate({:?})",
+        input
+    );
+    assert_eq!(
+        expected,
+        T::from_bits_truncate(input).bits(),
+        "Flags::from_bits_truncate({:?})",
+        input
+    );
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/from_name.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/from_name.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/from_name.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/from_name.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,42 @@
+use super::*;
+
+use crate::Flags;
+
+#[test]
+fn cases() {
+    case(Some(1), "A", TestFlags::from_name);
+    case(Some(1 << 1), "B", TestFlags::from_name);
+    case(Some(1 | 1 << 1 | 1 << 2), "ABC", TestFlags::from_name);
+
+    case(None, "", TestFlags::from_name);
+    case(None, "a", TestFlags::from_name);
+    case(None, "0x1", TestFlags::from_name);
+    case(None, "A | B", TestFlags::from_name);
+
+    case(Some(0), "ZERO", TestZero::from_name);
+
+    case(Some(2), "二", TestUnicode::from_name);
+
+    case(None, "_", TestExternal::from_name);
+
+    case(None, "", TestExternal::from_name);
+}
+
+#[track_caller]
+fn case<T: Flags>(expected: Option<T::Bits>, input: &str, inherent: impl FnOnce(&str) -> Option<T>)
+where
+    <T as Flags>::Bits: std::fmt::Debug + PartialEq,
+{
+    assert_eq!(
+        expected,
+        inherent(input).map(|f| f.bits()),
+        "T::from_name({:?})",
+        input
+    );
+    assert_eq!(
+        expected,
+        T::from_name(input).map(|f| f.bits()),
+        "Flags::from_name({:?})",
+        input
+    );
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/insert.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/insert.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/insert.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/insert.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,91 @@
+use super::*;
+
+use crate::Flags;
+
+#[test]
+fn cases() {
+    case(
+        TestFlags::empty(),
+        &[
+            (TestFlags::A, 1),
+            (TestFlags::A | TestFlags::B, 1 | 1 << 1),
+            (TestFlags::empty(), 0),
+            (TestFlags::from_bits_retain(1 << 3), 1 << 3),
+        ],
+        TestFlags::insert,
+        TestFlags::set,
+    );
+
+    case(
+        TestFlags::A,
+        &[
+            (TestFlags::A, 1),
+            (TestFlags::empty(), 1),
+            (TestFlags::B, 1 | 1 << 1),
+        ],
+        TestFlags::insert,
+        TestFlags::set,
+    );
+}
+
+#[track_caller]
+fn case<T: Flags + std::fmt::Debug + Copy>(
+    value: T,
+    inputs: &[(T, T::Bits)],
+    mut inherent_insert: impl FnMut(&mut T, T),
+    mut inherent_set: impl FnMut(&mut T, T, bool),
+) where
+    T::Bits: std::fmt::Debug + PartialEq + Copy,
+{
+    for (input, expected) in inputs {
+        assert_eq!(
+            *expected,
+            {
+                let mut value = value;
+                inherent_insert(&mut value, *input);
+                value
+            }
+            .bits(),
+            "{:?}.insert({:?})",
+            value,
+            input
+        );
+        assert_eq!(
+            *expected,
+            {
+                let mut value = value;
+                Flags::insert(&mut value, *input);
+                value
+            }
+            .bits(),
+            "Flags::insert({:?}, {:?})",
+            value,
+            input
+        );
+
+        assert_eq!(
+            *expected,
+            {
+                let mut value = value;
+                inherent_set(&mut value, *input, true);
+                value
+            }
+            .bits(),
+            "{:?}.set({:?}, true)",
+            value,
+            input
+        );
+        assert_eq!(
+            *expected,
+            {
+                let mut value = value;
+                Flags::set(&mut value, *input, true);
+                value
+            }
+            .bits(),
+            "Flags::set({:?}, {:?}, true)",
+            value,
+            input
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/intersection.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/intersection.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/intersection.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/intersection.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,79 @@
+use super::*;
+
+use crate::Flags;
+
+#[test]
+fn cases() {
+    case(
+        TestFlags::empty(),
+        &[(TestFlags::empty(), 0), (TestFlags::all(), 0)],
+        TestFlags::intersection,
+    );
+
+    case(
+        TestFlags::all(),
+        &[
+            (TestFlags::all(), 1 | 1 << 1 | 1 << 2),
+            (TestFlags::A, 1),
+            (TestFlags::from_bits_retain(1 << 3), 0),
+        ],
+        TestFlags::intersection,
+    );
+
+    case(
+        TestFlags::from_bits_retain(1 << 3),
+        &[(TestFlags::from_bits_retain(1 << 3), 1 << 3)],
+        TestFlags::intersection,
+    );
+
+    case(
+        TestOverlapping::AB,
+        &[(TestOverlapping::BC, 1 << 1)],
+        TestOverlapping::intersection,
+    );
+}
+
+#[track_caller]
+fn case<T: Flags + std::fmt::Debug + std::ops::BitAnd<Output = T> + std::ops::BitAndAssign + Copy>(
+    value: T,
+    inputs: &[(T, T::Bits)],
+    mut inherent: impl FnMut(T, T) -> T,
+) where
+    T::Bits: std::fmt::Debug + PartialEq + Copy,
+{
+    for (input, expected) in inputs {
+        assert_eq!(
+            *expected,
+            inherent(value, *input).bits(),
+            "{:?}.intersection({:?})",
+            value,
+            input
+        );
+        assert_eq!(
+            *expected,
+            Flags::intersection(value, *input).bits(),
+            "Flags::intersection({:?}, {:?})",
+            value,
+            input
+        );
+        assert_eq!(
+            *expected,
+            (value & *input).bits(),
+            "{:?} & {:?}",
+            value,
+            input
+        );
+        assert_eq!(
+            *expected,
+            {
+                let mut value = value;
+                value &= *input;
+                value
+            }
+            .bits(),
+            "{:?} &= {:?}",
+            value,
+            input,
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/intersects.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/intersects.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/intersects.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/intersects.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,91 @@
+use super::*;
+
+use crate::Flags;
+
+#[test]
+fn cases() {
+    case(
+        TestFlags::empty(),
+        &[
+            (TestFlags::empty(), false),
+            (TestFlags::A, false),
+            (TestFlags::B, false),
+            (TestFlags::C, false),
+            (TestFlags::from_bits_retain(1 << 3), false),
+        ],
+        TestFlags::intersects,
+    );
+
+    case(
+        TestFlags::A,
+        &[
+            (TestFlags::empty(), false),
+            (TestFlags::A, true),
+            (TestFlags::B, false),
+            (TestFlags::C, false),
+            (TestFlags::ABC, true),
+            (TestFlags::from_bits_retain(1 << 3), false),
+            (TestFlags::from_bits_retain(1 | (1 << 3)), true),
+        ],
+        TestFlags::intersects,
+    );
+
+    case(
+        TestFlags::ABC,
+        &[
+            (TestFlags::empty(), false),
+            (TestFlags::A, true),
+            (TestFlags::B, true),
+            (TestFlags::C, true),
+            (TestFlags::ABC, true),
+            (TestFlags::from_bits_retain(1 << 3), false),
+        ],
+        TestFlags::intersects,
+    );
+
+    case(
+        TestFlags::from_bits_retain(1 << 3),
+        &[
+            (TestFlags::empty(), false),
+            (TestFlags::A, false),
+            (TestFlags::B, false),
+            (TestFlags::C, false),
+            (TestFlags::from_bits_retain(1 << 3), true),
+        ],
+        TestFlags::intersects,
+    );
+
+    case(
+        TestOverlapping::AB,
+        &[
+            (TestOverlapping::AB, true),
+            (TestOverlapping::BC, true),
+            (TestOverlapping::from_bits_retain(1 << 1), true),
+        ],
+        TestOverlapping::intersects,
+    );
+}
+
+#[track_caller]
+fn case<T: Flags + std::fmt::Debug + Copy>(
+    value: T,
+    inputs: &[(T, bool)],
+    mut inherent: impl FnMut(&T, T) -> bool,
+) {
+    for (input, expected) in inputs {
+        assert_eq!(
+            *expected,
+            inherent(&value, *input),
+            "{:?}.intersects({:?})",
+            value,
+            input
+        );
+        assert_eq!(
+            *expected,
+            Flags::intersects(&value, *input),
+            "Flags::intersects({:?}, {:?})",
+            value,
+            input
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/is_all.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/is_all.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/is_all.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/is_all.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,32 @@
+use super::*;
+
+use crate::Flags;
+
+#[test]
+fn cases() {
+    case(false, TestFlags::empty(), TestFlags::is_all);
+    case(false, TestFlags::A, TestFlags::is_all);
+
+    case(true, TestFlags::ABC, TestFlags::is_all);
+
+    case(
+        true,
+        TestFlags::ABC | TestFlags::from_bits_retain(1 << 3),
+        TestFlags::is_all,
+    );
+
+    case(true, TestZero::empty(), TestZero::is_all);
+
+    case(true, TestEmpty::empty(), TestEmpty::is_all);
+}
+
+#[track_caller]
+fn case<T: Flags + std::fmt::Debug>(expected: bool, value: T, inherent: impl FnOnce(&T) -> bool) {
+    assert_eq!(expected, inherent(&value), "{:?}.is_all()", value);
+    assert_eq!(
+        expected,
+        Flags::is_all(&value),
+        "Flags::is_all({:?})",
+        value
+    );
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/is_empty.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/is_empty.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/is_empty.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/is_empty.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,31 @@
+use super::*;
+
+use crate::Flags;
+
+#[test]
+fn cases() {
+    case(true, TestFlags::empty(), TestFlags::is_empty);
+
+    case(false, TestFlags::A, TestFlags::is_empty);
+    case(false, TestFlags::ABC, TestFlags::is_empty);
+    case(
+        false,
+        TestFlags::from_bits_retain(1 << 3),
+        TestFlags::is_empty,
+    );
+
+    case(true, TestZero::empty(), TestZero::is_empty);
+
+    case(true, TestEmpty::empty(), TestEmpty::is_empty);
+}
+
+#[track_caller]
+fn case<T: Flags + std::fmt::Debug>(expected: bool, value: T, inherent: impl FnOnce(&T) -> bool) {
+    assert_eq!(expected, inherent(&value), "{:?}.is_empty()", value);
+    assert_eq!(
+        expected,
+        Flags::is_empty(&value),
+        "Flags::is_empty({:?})",
+        value
+    );
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/iter.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/iter.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/iter.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/iter.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,209 @@
+use super::*;
+
+use crate::Flags;
+
+#[test]
+#[cfg(not(miri))] // Very slow in miri
+fn roundtrip() {
+    for a in 0u8..=255 {
+        for b in 0u8..=255 {
+            let f = TestFlags::from_bits_retain(a | b);
+
+            assert_eq!(f, f.iter().collect::<TestFlags>());
+            assert_eq!(
+                TestFlags::from_bits_truncate(f.bits()),
+                f.iter_names().map(|(_, f)| f).collect::<TestFlags>()
+            );
+
+            let f = TestExternal::from_bits_retain(a | b);
+
+            assert_eq!(f, f.iter().collect::<TestExternal>());
+        }
+    }
+}
+
+mod collect {
+    use super::*;
+
+    #[test]
+    fn cases() {
+        assert_eq!(0, [].into_iter().collect::<TestFlags>().bits());
+
+        assert_eq!(1, [TestFlags::A,].into_iter().collect::<TestFlags>().bits());
+
+        assert_eq!(
+            1 | 1 << 1 | 1 << 2,
+            [TestFlags::A, TestFlags::B | TestFlags::C,]
+                .into_iter()
+                .collect::<TestFlags>()
+                .bits()
+        );
+
+        assert_eq!(
+            1 | 1 << 3,
+            [
+                TestFlags::from_bits_retain(1 << 3),
+                TestFlags::empty(),
+                TestFlags::A,
+            ]
+            .into_iter()
+            .collect::<TestFlags>()
+            .bits()
+        );
+
+        assert_eq!(
+            1 << 5 | 1 << 7,
+            [
+                TestExternal::empty(),
+                TestExternal::from_bits_retain(1 << 5),
+                TestExternal::from_bits_retain(1 << 7),
+            ]
+            .into_iter()
+            .collect::<TestExternal>()
+            .bits()
+        );
+    }
+}
+
+mod iter {
+    use super::*;
+
+    #[test]
+    fn cases() {
+        case(&[], TestFlags::empty(), TestFlags::iter);
+
+        case(&[1], TestFlags::A, TestFlags::iter);
+        case(&[1, 1 << 1], TestFlags::A | TestFlags::B, TestFlags::iter);
+        case(
+            &[1, 1 << 1, 1 << 3],
+            TestFlags::A | TestFlags::B | TestFlags::from_bits_retain(1 << 3),
+            TestFlags::iter,
+        );
+
+        case(&[1, 1 << 1, 1 << 2], TestFlags::ABC, TestFlags::iter);
+        case(
+            &[1, 1 << 1, 1 << 2, 1 << 3],
+            TestFlags::ABC | TestFlags::from_bits_retain(1 << 3),
+            TestFlags::iter,
+        );
+
+        case(
+            &[1 | 1 << 1 | 1 << 2],
+            TestFlagsInvert::ABC,
+            TestFlagsInvert::iter,
+        );
+
+        case(&[], TestZero::ZERO, TestZero::iter);
+
+        case(
+            &[1, 1 << 1, 1 << 2, 0b1111_1000],
+            TestExternal::all(),
+            TestExternal::iter,
+        );
+    }
+
+    #[track_caller]
+    fn case<T: Flags + std::fmt::Debug + IntoIterator<Item = T> + Copy>(
+        expected: &[T::Bits],
+        value: T,
+        inherent: impl FnOnce(&T) -> crate::iter::Iter<T>,
+    ) where
+        T::Bits: std::fmt::Debug + PartialEq,
+    {
+        assert_eq!(
+            expected,
+            inherent(&value).map(|f| f.bits()).collect::<Vec<_>>(),
+            "{:?}.iter()",
+            value
+        );
+        assert_eq!(
+            expected,
+            Flags::iter(&value).map(|f| f.bits()).collect::<Vec<_>>(),
+            "Flags::iter({:?})",
+            value
+        );
+        assert_eq!(
+            expected,
+            value.into_iter().map(|f| f.bits()).collect::<Vec<_>>(),
+            "{:?}.into_iter()",
+            value
+        );
+    }
+}
+
+mod iter_names {
+    use super::*;
+
+    #[test]
+    fn cases() {
+        case(&[], TestFlags::empty(), TestFlags::iter_names);
+
+        case(&[("A", 1)], TestFlags::A, TestFlags::iter_names);
+        case(
+            &[("A", 1), ("B", 1 << 1)],
+            TestFlags::A | TestFlags::B,
+            TestFlags::iter_names,
+        );
+        case(
+            &[("A", 1), ("B", 1 << 1)],
+            TestFlags::A | TestFlags::B | TestFlags::from_bits_retain(1 << 3),
+            TestFlags::iter_names,
+        );
+
+        case(
+            &[("A", 1), ("B", 1 << 1), ("C", 1 << 2)],
+            TestFlags::ABC,
+            TestFlags::iter_names,
+        );
+        case(
+            &[("A", 1), ("B", 1 << 1), ("C", 1 << 2)],
+            TestFlags::ABC | TestFlags::from_bits_retain(1 << 3),
+            TestFlags::iter_names,
+        );
+
+        case(
+            &[("ABC", 1 | 1 << 1 | 1 << 2)],
+            TestFlagsInvert::ABC,
+            TestFlagsInvert::iter_names,
+        );
+
+        case(&[], TestZero::ZERO, TestZero::iter_names);
+
+        case(
+            &[("A", 1)],
+            TestOverlappingFull::A,
+            TestOverlappingFull::iter_names,
+        );
+        case(
+            &[("A", 1), ("D", 1 << 1)],
+            TestOverlappingFull::A | TestOverlappingFull::D,
+            TestOverlappingFull::iter_names,
+        );
+    }
+
+    #[track_caller]
+    fn case<T: Flags + std::fmt::Debug>(
+        expected: &[(&'static str, T::Bits)],
+        value: T,
+        inherent: impl FnOnce(&T) -> crate::iter::IterNames<T>,
+    ) where
+        T::Bits: std::fmt::Debug + PartialEq,
+    {
+        assert_eq!(
+            expected,
+            inherent(&value)
+                .map(|(n, f)| (n, f.bits()))
+                .collect::<Vec<_>>(),
+            "{:?}.iter_names()",
+            value
+        );
+        assert_eq!(
+            expected,
+            Flags::iter_names(&value)
+                .map(|(n, f)| (n, f.bits()))
+                .collect::<Vec<_>>(),
+            "Flags::iter_names({:?})",
+            value
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/parser.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/parser.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/parser.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/parser.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,332 @@
+use super::*;
+
+use crate::{parser::*, Flags};
+
+#[test]
+#[cfg(not(miri))] // Very slow in miri
+fn roundtrip() {
+    let mut s = String::new();
+
+    for a in 0u8..=255 {
+        for b in 0u8..=255 {
+            let f = TestFlags::from_bits_retain(a | b);
+
+            s.clear();
+            to_writer(&f, &mut s).unwrap();
+
+            assert_eq!(f, from_str::<TestFlags>(&s).unwrap());
+        }
+    }
+}
+
+#[test]
+#[cfg(not(miri))] // Very slow in miri
+fn roundtrip_truncate() {
+    let mut s = String::new();
+
+    for a in 0u8..=255 {
+        for b in 0u8..=255 {
+            let f = TestFlags::from_bits_retain(a | b);
+
+            s.clear();
+            to_writer_truncate(&f, &mut s).unwrap();
+
+            assert_eq!(
+                TestFlags::from_bits_truncate(f.bits()),
+                from_str_truncate::<TestFlags>(&s).unwrap()
+            );
+        }
+    }
+}
+
+#[test]
+#[cfg(not(miri))] // Very slow in miri
+fn roundtrip_strict() {
+    let mut s = String::new();
+
+    for a in 0u8..=255 {
+        for b in 0u8..=255 {
+            let f = TestFlags::from_bits_retain(a | b);
+
+            s.clear();
+            to_writer_strict(&f, &mut s).unwrap();
+
+            let mut strict = TestFlags::empty();
+            for (_, flag) in f.iter_names() {
+                strict |= flag;
+            }
+            let f = strict;
+
+            if let Ok(s) = from_str_strict::<TestFlags>(&s) {
+                assert_eq!(f, s);
+            }
+        }
+    }
+}
+
+mod from_str {
+    use super::*;
+
+    #[test]
+    fn valid() {
+        assert_eq!(0, from_str::<TestFlags>("").unwrap().bits());
+
+        assert_eq!(1, from_str::<TestFlags>("A").unwrap().bits());
+        assert_eq!(1, from_str::<TestFlags>(" A ").unwrap().bits());
+        assert_eq!(
+            1 | 1 << 1 | 1 << 2,
+            from_str::<TestFlags>("A | B | C").unwrap().bits()
+        );
+        assert_eq!(
+            1 | 1 << 1 | 1 << 2,
+            from_str::<TestFlags>("A\n|\tB\r\n|   C ").unwrap().bits()
+        );
+        assert_eq!(
+            1 | 1 << 1 | 1 << 2,
+            from_str::<TestFlags>("A|B|C").unwrap().bits()
+        );
+
+        assert_eq!(1 << 3, from_str::<TestFlags>("0x8").unwrap().bits());
+        assert_eq!(1 | 1 << 3, from_str::<TestFlags>("A | 0x8").unwrap().bits());
+        assert_eq!(
+            1 | 1 << 1 | 1 << 3,
+            from_str::<TestFlags>("0x1 | 0x8 | B").unwrap().bits()
+        );
+
+        assert_eq!(
+            1 | 1 << 1,
+            from_str::<TestUnicode>("一 | 二").unwrap().bits()
+        );
+    }
+
+    #[test]
+    fn invalid() {
+        assert!(from_str::<TestFlags>("a")
+            .unwrap_err()
+            .to_string()
+            .starts_with("unrecognized named flag"));
+        assert!(from_str::<TestFlags>("A & B")
+            .unwrap_err()
+            .to_string()
+            .starts_with("unrecognized named flag"));
+
+        assert!(from_str::<TestFlags>("0xg")
+            .unwrap_err()
+            .to_string()
+            .starts_with("invalid hex flag"));
+        assert!(from_str::<TestFlags>("0xffffffffffff")
+            .unwrap_err()
+            .to_string()
+            .starts_with("invalid hex flag"));
+    }
+}
+
+mod to_writer {
+    use super::*;
+
+    #[test]
+    fn cases() {
+        assert_eq!("", write(TestFlags::empty()));
+        assert_eq!("A", write(TestFlags::A));
+        assert_eq!("A | B | C", write(TestFlags::all()));
+        assert_eq!("0x8", write(TestFlags::from_bits_retain(1 << 3)));
+        assert_eq!(
+            "A | 0x8",
+            write(TestFlags::A | TestFlags::from_bits_retain(1 << 3))
+        );
+
+        assert_eq!("", write(TestZero::ZERO));
+
+        assert_eq!("ABC", write(TestFlagsInvert::all()));
+
+        assert_eq!("0x1", write(TestOverlapping::from_bits_retain(1)));
+
+        assert_eq!("A", write(TestOverlappingFull::C));
+        assert_eq!(
+            "A | D",
+            write(TestOverlappingFull::C | TestOverlappingFull::D)
+        );
+    }
+
+    fn write<F: Flags>(value: F) -> String
+    where
+        F::Bits: crate::parser::WriteHex,
+    {
+        let mut s = String::new();
+
+        to_writer(&value, &mut s).unwrap();
+        s
+    }
+}
+
+mod from_str_truncate {
+    use super::*;
+
+    #[test]
+    fn valid() {
+        assert_eq!(0, from_str_truncate::<TestFlags>("").unwrap().bits());
+
+        assert_eq!(1, from_str_truncate::<TestFlags>("A").unwrap().bits());
+        assert_eq!(1, from_str_truncate::<TestFlags>(" A ").unwrap().bits());
+        assert_eq!(
+            1 | 1 << 1 | 1 << 2,
+            from_str_truncate::<TestFlags>("A | B | C").unwrap().bits()
+        );
+        assert_eq!(
+            1 | 1 << 1 | 1 << 2,
+            from_str_truncate::<TestFlags>("A\n|\tB\r\n|   C ")
+                .unwrap()
+                .bits()
+        );
+        assert_eq!(
+            1 | 1 << 1 | 1 << 2,
+            from_str_truncate::<TestFlags>("A|B|C").unwrap().bits()
+        );
+
+        assert_eq!(0, from_str_truncate::<TestFlags>("0x8").unwrap().bits());
+        assert_eq!(1, from_str_truncate::<TestFlags>("A | 0x8").unwrap().bits());
+        assert_eq!(
+            1 | 1 << 1,
+            from_str_truncate::<TestFlags>("0x1 | 0x8 | B")
+                .unwrap()
+                .bits()
+        );
+
+        assert_eq!(
+            1 | 1 << 1,
+            from_str_truncate::<TestUnicode>("一 | 二").unwrap().bits()
+        );
+    }
+}
+
+mod to_writer_truncate {
+    use super::*;
+
+    #[test]
+    fn cases() {
+        assert_eq!("", write(TestFlags::empty()));
+        assert_eq!("A", write(TestFlags::A));
+        assert_eq!("A | B | C", write(TestFlags::all()));
+        assert_eq!("", write(TestFlags::from_bits_retain(1 << 3)));
+        assert_eq!(
+            "A",
+            write(TestFlags::A | TestFlags::from_bits_retain(1 << 3))
+        );
+
+        assert_eq!("", write(TestZero::ZERO));
+
+        assert_eq!("ABC", write(TestFlagsInvert::all()));
+
+        assert_eq!("0x1", write(TestOverlapping::from_bits_retain(1)));
+
+        assert_eq!("A", write(TestOverlappingFull::C));
+        assert_eq!(
+            "A | D",
+            write(TestOverlappingFull::C | TestOverlappingFull::D)
+        );
+    }
+
+    fn write<F: Flags>(value: F) -> String
+    where
+        F::Bits: crate::parser::WriteHex,
+    {
+        let mut s = String::new();
+
+        to_writer_truncate(&value, &mut s).unwrap();
+        s
+    }
+}
+
+mod from_str_strict {
+    use super::*;
+
+    #[test]
+    fn valid() {
+        assert_eq!(0, from_str_strict::<TestFlags>("").unwrap().bits());
+
+        assert_eq!(1, from_str_strict::<TestFlags>("A").unwrap().bits());
+        assert_eq!(1, from_str_strict::<TestFlags>(" A ").unwrap().bits());
+        assert_eq!(
+            1 | 1 << 1 | 1 << 2,
+            from_str_strict::<TestFlags>("A | B | C").unwrap().bits()
+        );
+        assert_eq!(
+            1 | 1 << 1 | 1 << 2,
+            from_str_strict::<TestFlags>("A\n|\tB\r\n|   C ")
+                .unwrap()
+                .bits()
+        );
+        assert_eq!(
+            1 | 1 << 1 | 1 << 2,
+            from_str_strict::<TestFlags>("A|B|C").unwrap().bits()
+        );
+
+        assert_eq!(
+            1 | 1 << 1,
+            from_str_strict::<TestUnicode>("一 | 二").unwrap().bits()
+        );
+    }
+
+    #[test]
+    fn invalid() {
+        assert!(from_str_strict::<TestFlags>("a")
+            .unwrap_err()
+            .to_string()
+            .starts_with("unrecognized named flag"));
+        assert!(from_str_strict::<TestFlags>("A & B")
+            .unwrap_err()
+            .to_string()
+            .starts_with("unrecognized named flag"));
+
+        assert!(from_str_strict::<TestFlags>("0x1")
+            .unwrap_err()
+            .to_string()
+            .starts_with("invalid hex flag"));
+        assert!(from_str_strict::<TestFlags>("0xg")
+            .unwrap_err()
+            .to_string()
+            .starts_with("invalid hex flag"));
+        assert!(from_str_strict::<TestFlags>("0xffffffffffff")
+            .unwrap_err()
+            .to_string()
+            .starts_with("invalid hex flag"));
+    }
+}
+
+mod to_writer_strict {
+    use super::*;
+
+    #[test]
+    fn cases() {
+        assert_eq!("", write(TestFlags::empty()));
+        assert_eq!("A", write(TestFlags::A));
+        assert_eq!("A | B | C", write(TestFlags::all()));
+        assert_eq!("", write(TestFlags::from_bits_retain(1 << 3)));
+        assert_eq!(
+            "A",
+            write(TestFlags::A | TestFlags::from_bits_retain(1 << 3))
+        );
+
+        assert_eq!("", write(TestZero::ZERO));
+
+        assert_eq!("ABC", write(TestFlagsInvert::all()));
+
+        assert_eq!("", write(TestOverlapping::from_bits_retain(1)));
+
+        assert_eq!("A", write(TestOverlappingFull::C));
+        assert_eq!(
+            "A | D",
+            write(TestOverlappingFull::C | TestOverlappingFull::D)
+        );
+    }
+
+    fn write<F: Flags>(value: F) -> String
+    where
+        F::Bits: crate::parser::WriteHex,
+    {
+        let mut s = String::new();
+
+        to_writer_strict(&value, &mut s).unwrap();
+        s
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/remove.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/remove.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/remove.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/remove.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,100 @@
+use super::*;
+
+use crate::Flags;
+
+#[test]
+fn cases() {
+    case(
+        TestFlags::empty(),
+        &[
+            (TestFlags::A, 0),
+            (TestFlags::empty(), 0),
+            (TestFlags::from_bits_retain(1 << 3), 0),
+        ],
+        TestFlags::remove,
+        TestFlags::set,
+    );
+
+    case(
+        TestFlags::A,
+        &[
+            (TestFlags::A, 0),
+            (TestFlags::empty(), 1),
+            (TestFlags::B, 1),
+        ],
+        TestFlags::remove,
+        TestFlags::set,
+    );
+
+    case(
+        TestFlags::ABC,
+        &[
+            (TestFlags::A, 1 << 1 | 1 << 2),
+            (TestFlags::A | TestFlags::C, 1 << 1),
+        ],
+        TestFlags::remove,
+        TestFlags::set,
+    );
+}
+
+#[track_caller]
+fn case<T: Flags + std::fmt::Debug + Copy>(
+    value: T,
+    inputs: &[(T, T::Bits)],
+    mut inherent_remove: impl FnMut(&mut T, T),
+    mut inherent_set: impl FnMut(&mut T, T, bool),
+) where
+    T::Bits: std::fmt::Debug + PartialEq + Copy,
+{
+    for (input, expected) in inputs {
+        assert_eq!(
+            *expected,
+            {
+                let mut value = value;
+                inherent_remove(&mut value, *input);
+                value
+            }
+            .bits(),
+            "{:?}.remove({:?})",
+            value,
+            input
+        );
+        assert_eq!(
+            *expected,
+            {
+                let mut value = value;
+                Flags::remove(&mut value, *input);
+                value
+            }
+            .bits(),
+            "Flags::remove({:?}, {:?})",
+            value,
+            input
+        );
+
+        assert_eq!(
+            *expected,
+            {
+                let mut value = value;
+                inherent_set(&mut value, *input, false);
+                value
+            }
+            .bits(),
+            "{:?}.set({:?}, false)",
+            value,
+            input
+        );
+        assert_eq!(
+            *expected,
+            {
+                let mut value = value;
+                Flags::set(&mut value, *input, false);
+                value
+            }
+            .bits(),
+            "Flags::set({:?}, {:?}, false)",
+            value,
+            input
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/symmetric_difference.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/symmetric_difference.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/symmetric_difference.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/symmetric_difference.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,110 @@
+use super::*;
+
+use crate::Flags;
+
+#[test]
+fn cases() {
+    case(
+        TestFlags::empty(),
+        &[
+            (TestFlags::empty(), 0),
+            (TestFlags::all(), 1 | 1 << 1 | 1 << 2),
+            (TestFlags::from_bits_retain(1 << 3), 1 << 3),
+        ],
+        TestFlags::symmetric_difference,
+        TestFlags::toggle,
+    );
+
+    case(
+        TestFlags::A,
+        &[
+            (TestFlags::empty(), 1),
+            (TestFlags::A, 0),
+            (TestFlags::all(), 1 << 1 | 1 << 2),
+        ],
+        TestFlags::symmetric_difference,
+        TestFlags::toggle,
+    );
+
+    case(
+        TestFlags::A | TestFlags::B | TestFlags::from_bits_retain(1 << 3),
+        &[
+            (TestFlags::ABC, 1 << 2 | 1 << 3),
+            (TestFlags::from_bits_retain(1 << 3), 1 | 1 << 1),
+        ],
+        TestFlags::symmetric_difference,
+        TestFlags::toggle,
+    );
+}
+
+#[track_caller]
+fn case<T: Flags + std::fmt::Debug + std::ops::BitXor<Output = T> + std::ops::BitXorAssign + Copy>(
+    value: T,
+    inputs: &[(T, T::Bits)],
+    mut inherent_sym_diff: impl FnMut(T, T) -> T,
+    mut inherent_toggle: impl FnMut(&mut T, T),
+) where
+    T::Bits: std::fmt::Debug + PartialEq + Copy,
+{
+    for (input, expected) in inputs {
+        assert_eq!(
+            *expected,
+            inherent_sym_diff(value, *input).bits(),
+            "{:?}.symmetric_difference({:?})",
+            value,
+            input
+        );
+        assert_eq!(
+            *expected,
+            Flags::symmetric_difference(value, *input).bits(),
+            "Flags::symmetric_difference({:?}, {:?})",
+            value,
+            input
+        );
+        assert_eq!(
+            *expected,
+            (value ^ *input).bits(),
+            "{:?} ^ {:?}",
+            value,
+            input
+        );
+        assert_eq!(
+            *expected,
+            {
+                let mut value = value;
+                value ^= *input;
+                value
+            }
+            .bits(),
+            "{:?} ^= {:?}",
+            value,
+            input,
+        );
+
+        assert_eq!(
+            *expected,
+            {
+                let mut value = value;
+                inherent_toggle(&mut value, *input);
+                value
+            }
+            .bits(),
+            "{:?}.toggle({:?})",
+            value,
+            input,
+        );
+
+        assert_eq!(
+            *expected,
+            {
+                let mut value = value;
+                Flags::toggle(&mut value, *input);
+                value
+            }
+            .bits(),
+            "{:?}.toggle({:?})",
+            value,
+            input,
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests/union.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/union.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests/union.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests/union.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,71 @@
+use super::*;
+
+use crate::Flags;
+
+#[test]
+fn cases() {
+    case(
+        TestFlags::empty(),
+        &[
+            (TestFlags::A, 1),
+            (TestFlags::all(), 1 | 1 << 1 | 1 << 2),
+            (TestFlags::empty(), 0),
+            (TestFlags::from_bits_retain(1 << 3), 1 << 3),
+        ],
+        TestFlags::union,
+    );
+
+    case(
+        TestFlags::A | TestFlags::C,
+        &[
+            (TestFlags::A | TestFlags::B, 1 | 1 << 1 | 1 << 2),
+            (TestFlags::A, 1 | 1 << 2),
+        ],
+        TestFlags::union,
+    );
+}
+
+#[track_caller]
+fn case<T: Flags + std::fmt::Debug + std::ops::BitOr<Output = T> + std::ops::BitOrAssign + Copy>(
+    value: T,
+    inputs: &[(T, T::Bits)],
+    mut inherent: impl FnMut(T, T) -> T,
+) where
+    T::Bits: std::fmt::Debug + PartialEq + Copy,
+{
+    for (input, expected) in inputs {
+        assert_eq!(
+            *expected,
+            inherent(value, *input).bits(),
+            "{:?}.union({:?})",
+            value,
+            input
+        );
+        assert_eq!(
+            *expected,
+            Flags::union(value, *input).bits(),
+            "Flags::union({:?}, {:?})",
+            value,
+            input
+        );
+        assert_eq!(
+            *expected,
+            (value | *input).bits(),
+            "{:?} | {:?}",
+            value,
+            input
+        );
+        assert_eq!(
+            *expected,
+            {
+                let mut value = value;
+                value |= *input;
+                value
+            }
+            .bits(),
+            "{:?} |= {:?}",
+            value,
+            input,
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/tests.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests.rs
--- 43.0.0-1/rust-vendor/bitflags/src/tests.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/tests.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,131 @@
+mod all;
+mod bits;
+mod complement;
+mod contains;
+mod difference;
+mod empty;
+mod eq;
+mod extend;
+mod flags;
+mod fmt;
+mod from_bits;
+mod from_bits_retain;
+mod from_bits_truncate;
+mod from_name;
+mod insert;
+mod intersection;
+mod intersects;
+mod is_all;
+mod is_empty;
+mod iter;
+mod parser;
+mod remove;
+mod symmetric_difference;
+mod union;
+
+bitflags! {
+    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
+    pub struct TestFlags: u8 {
+        /// 1
+        const A = 1;
+
+        /// 1 << 1
+        const B = 1 << 1;
+
+        /// 1 << 2
+        const C = 1 << 2;
+
+        /// 1 | (1 << 1) | (1 << 2)
+        const ABC = Self::A.bits() | Self::B.bits() | Self::C.bits();
+    }
+
+    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
+    pub struct TestFlagsInvert: u8 {
+        /// 1 | (1 << 1) | (1 << 2)
+        const ABC = Self::A.bits() | Self::B.bits() | Self::C.bits();
+
+        /// 1
+        const A = 1;
+
+        /// 1 << 1
+        const B = 1 << 1;
+
+        /// 1 << 2
+        const C = 1 << 2;
+    }
+
+    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
+    pub struct TestZero: u8 {
+        /// 0
+        const ZERO = 0;
+    }
+
+    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
+    pub struct TestZeroOne: u8 {
+        /// 0
+        const ZERO = 0;
+
+        /// 1
+        const ONE = 1;
+    }
+
+    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
+    pub struct TestUnicode: u8 {
+        /// 1
+        const 一 = 1;
+
+        /// 2
+        const 二 = 1 << 1;
+    }
+
+    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
+    pub struct TestEmpty: u8 {}
+
+    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
+    pub struct TestOverlapping: u8 {
+        /// 1 | (1 << 1)
+        const AB = 1 | (1 << 1);
+
+        /// (1 << 1) | (1 << 2)
+        const BC = (1 << 1) | (1 << 2);
+    }
+
+    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
+    pub struct TestOverlappingFull: u8 {
+        /// 1
+        const A = 1;
+
+        /// 1
+        const B = 1;
+
+        /// 1
+        const C = 1;
+
+        /// 2
+        const D = 1 << 1;
+    }
+
+    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
+    pub struct TestExternal: u8 {
+        /// 1
+        const A = 1;
+
+        /// 1 << 1
+        const B = 1 << 1;
+
+        /// 1 << 2
+        const C = 1 << 2;
+
+        /// 1 | (1 << 1) | (1 << 2)
+        const ABC = Self::A.bits() | Self::B.bits() | Self::C.bits();
+
+        /// External
+        const _ = !0;
+    }
+
+    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
+    pub struct TestExternalFull: u8 {
+        /// External
+        const _ = !0;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/bitflags/src/traits.rs 43.0.0-1ubuntu1/rust-vendor/bitflags/src/traits.rs
--- 43.0.0-1/rust-vendor/bitflags/src/traits.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/bitflags/src/traits.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,431 @@
+use core::{
+    fmt,
+    ops::{BitAnd, BitOr, BitXor, Not},
+};
+
+use crate::{
+    iter,
+    parser::{ParseError, ParseHex, WriteHex},
+};
+
+/**
+A defined flags value that may be named or unnamed.
+*/
+#[derive(Debug)]
+pub struct Flag<B> {
+    name: &'static str,
+    value: B,
+}
+
+impl<B> Flag<B> {
+    /**
+    Define a flag.
+
+    If `name` is non-empty then the flag is named, otherwise it's unnamed.
+    */
+    pub const fn new(name: &'static str, value: B) -> Self {
+        Flag { name, value }
+    }
+
+    /**
+    Get the name of this flag.
+
+    If the flag is unnamed then the returned string will be empty.
+    */
+    pub const fn name(&self) -> &'static str {
+        self.name
+    }
+
+    /**
+    Get the flags value of this flag.
+    */
+    pub const fn value(&self) -> &B {
+        &self.value
+    }
+
+    /**
+    Whether the flag is named.
+
+    If [`Flag::name`] returns a non-empty string then this method will return `true`.
+    */
+    pub const fn is_named(&self) -> bool {
+        !self.name.is_empty()
+    }
+
+    /**
+    Whether the flag is unnamed.
+
+    If [`Flag::name`] returns a non-empty string then this method will return `false`.
+    */
+    pub const fn is_unnamed(&self) -> bool {
+        self.name.is_empty()
+    }
+}
+
+/**
+A set of defined flags using a bits type as storage.
+
+## Implementing `Flags`
+
+This trait is implemented by the [`bitflags`](macro.bitflags.html) macro:
+
+```
+use bitflags::bitflags;
+
+bitflags! {
+    struct MyFlags: u8 {
+        const A = 1;
+        const B = 1 << 1;
+    }
+}
+```
+
+It can also be implemented manually:
+
+```
+use bitflags::{Flag, Flags};
+
+struct MyFlags(u8);
+
+impl Flags for MyFlags {
+    const FLAGS: &'static [Flag<Self>] = &[
+        Flag::new("A", MyFlags(1)),
+        Flag::new("B", MyFlags(1 << 1)),
+    ];
+
+    type Bits = u8;
+
+    fn from_bits_retain(bits: Self::Bits) -> Self {
+        MyFlags(bits)
+    }
+
+    fn bits(&self) -> Self::Bits {
+        self.0
+    }
+}
+```
+
+## Using `Flags`
+
+The `Flags` trait can be used generically to work with any flags types. In this example,
+we can count the number of defined named flags:
+
+```
+# use bitflags::{bitflags, Flags};
+fn defined_flags<F: Flags>() -> usize {
+    F::FLAGS.iter().filter(|f| f.is_named()).count()
+}
+
+bitflags! {
+    struct MyFlags: u8 {
+        const A = 1;
+        const B = 1 << 1;
+        const C = 1 << 2;
+
+        const _ = !0;
+    }
+}
+
+assert_eq!(3, defined_flags::<MyFlags>());
+```
+*/
+pub trait Flags: Sized + 'static {
+    /// The set of defined flags.
+    const FLAGS: &'static [Flag<Self>];
+
+    /// The underlying bits type.
+    type Bits: Bits;
+
+    /// Get a flags value with all bits unset.
+    fn empty() -> Self {
+        Self::from_bits_retain(Self::Bits::EMPTY)
+    }
+
+    /// Get a flags value with all known bits set.
+    fn all() -> Self {
+        let mut truncated = Self::Bits::EMPTY;
+
+        for flag in Self::FLAGS.iter() {
+            truncated = truncated | flag.value().bits();
+        }
+
+        Self::from_bits_retain(truncated)
+    }
+
+    /// Get the underlying bits value.
+    ///
+    /// The returned value is exactly the bits set in this flags value.
+    fn bits(&self) -> Self::Bits;
+
+    /// Convert from a bits value.
+    ///
+    /// This method will return `None` if any unknown bits are set.
+    fn from_bits(bits: Self::Bits) -> Option<Self> {
+        let truncated = Self::from_bits_truncate(bits);
+
+        if truncated.bits() == bits {
+            Some(truncated)
+        } else {
+            None
+        }
+    }
+
+    /// Convert from a bits value, unsetting any unknown bits.
+    fn from_bits_truncate(bits: Self::Bits) -> Self {
+        Self::from_bits_retain(bits & Self::all().bits())
+    }
+
+    /// Convert from a bits value exactly.
+    fn from_bits_retain(bits: Self::Bits) -> Self;
+
+    /// Get a flags value with the bits of a flag with the given name set.
+    ///
+    /// This method will return `None` if `name` is empty or doesn't
+    /// correspond to any named flag.
+    fn from_name(name: &str) -> Option<Self> {
+        // Don't parse empty names as empty flags
+        if name.is_empty() {
+            return None;
+        }
+
+        for flag in Self::FLAGS {
+            if flag.name() == name {
+                return Some(Self::from_bits_retain(flag.value().bits()));
+            }
+        }
+
+        None
+    }
+
+    /// Yield a set of contained flags values.
+    ///
+    /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
+    /// will be yielded together as a final flags value.
+    fn iter(&self) -> iter::Iter<Self> {
+        iter::Iter::new(self)
+    }
+
+    /// Yield a set of contained named flags values.
+    ///
+    /// This method is like [`Flags::iter`], except only yields bits in contained named flags.
+    /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
+    fn iter_names(&self) -> iter::IterNames<Self> {
+        iter::IterNames::new(self)
+    }
+
+    /// Whether all bits in this flags value are unset.
+    fn is_empty(&self) -> bool {
+        self.bits() == Self::Bits::EMPTY
+    }
+
+    /// Whether all known bits in this flags value are set.
+    fn is_all(&self) -> bool {
+        // NOTE: We check against `Self::all` here, not `Self::Bits::ALL`
+        // because the set of all flags may not use all bits
+        Self::all().bits() | self.bits() == self.bits()
+    }
+
+    /// Whether any set bits in a source flags value are also set in a target flags value.
+    fn intersects(&self, other: Self) -> bool
+    where
+        Self: Sized,
+    {
+        self.bits() & other.bits() != Self::Bits::EMPTY
+    }
+
+    /// Whether all set bits in a source flags value are also set in a target flags value.
+    fn contains(&self, other: Self) -> bool
+    where
+        Self: Sized,
+    {
+        self.bits() & other.bits() == other.bits()
+    }
+
+    /// The bitwise or (`|`) of the bits in two flags values.
+    fn insert(&mut self, other: Self)
+    where
+        Self: Sized,
+    {
+        *self = Self::from_bits_retain(self.bits()).union(other);
+    }
+
+    /// The intersection of a source flags value with the complement of a target flags value (`&!`).
+    ///
+    /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
+    /// `remove` won't truncate `other`, but the `!` operator will.
+    fn remove(&mut self, other: Self)
+    where
+        Self: Sized,
+    {
+        *self = Self::from_bits_retain(self.bits()).difference(other);
+    }
+
+    /// The bitwise exclusive-or (`^`) of the bits in two flags values.
+    fn toggle(&mut self, other: Self)
+    where
+        Self: Sized,
+    {
+        *self = Self::from_bits_retain(self.bits()).symmetric_difference(other);
+    }
+
+    /// Call [`Flags::insert`] when `value` is `true` or [`Flags::remove`] when `value` is `false`.
+    fn set(&mut self, other: Self, value: bool)
+    where
+        Self: Sized,
+    {
+        if value {
+            self.insert(other);
+        } else {
+            self.remove(other);
+        }
+    }
+
+    /// The bitwise and (`&`) of the bits in two flags values.
+    #[must_use]
+    fn intersection(self, other: Self) -> Self {
+        Self::from_bits_retain(self.bits() & other.bits())
+    }
+
+    /// The bitwise or (`|`) of the bits in two flags values.
+    #[must_use]
+    fn union(self, other: Self) -> Self {
+        Self::from_bits_retain(self.bits() | other.bits())
+    }
+
+    /// The intersection of a source flags value with the complement of a target flags value (`&!`).
+    ///
+    /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
+    /// `difference` won't truncate `other`, but the `!` operator will.
+    #[must_use]
+    fn difference(self, other: Self) -> Self {
+        Self::from_bits_retain(self.bits() & !other.bits())
+    }
+
+    /// The bitwise exclusive-or (`^`) of the bits in two flags values.
+    #[must_use]
+    fn symmetric_difference(self, other: Self) -> Self {
+        Self::from_bits_retain(self.bits() ^ other.bits())
+    }
+
+    /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
+    #[must_use]
+    fn complement(self) -> Self {
+        Self::from_bits_truncate(!self.bits())
+    }
+}
+
+/**
+A bits type that can be used as storage for a flags type.
+*/
+pub trait Bits:
+    Clone
+    + Copy
+    + PartialEq
+    + BitAnd<Output = Self>
+    + BitOr<Output = Self>
+    + BitXor<Output = Self>
+    + Not<Output = Self>
+    + Sized
+    + 'static
+{
+    /// A value with all bits unset.
+    const EMPTY: Self;
+
+    /// A value with all bits set.
+    const ALL: Self;
+}
+
+// Not re-exported: prevent custom `Bits` impls being used in the `bitflags!` macro,
+// or they may fail to compile based on crate features
+pub trait Primitive {}
+
+macro_rules! impl_bits {
+    ($($u:ty, $i:ty,)*) => {
+        $(
+            impl Bits for $u {
+                const EMPTY: $u = 0;
+                const ALL: $u = <$u>::MAX;
+            }
+
+            impl Bits for $i {
+                const EMPTY: $i = 0;
+                const ALL: $i = <$u>::MAX as $i;
+            }
+
+            impl ParseHex for $u {
+                fn parse_hex(input: &str) -> Result<Self, ParseError> {
+                    <$u>::from_str_radix(input, 16).map_err(|_| ParseError::invalid_hex_flag(input))
+                }
+            }
+
+            impl ParseHex for $i {
+                fn parse_hex(input: &str) -> Result<Self, ParseError> {
+                    <$i>::from_str_radix(input, 16).map_err(|_| ParseError::invalid_hex_flag(input))
+                }
+            }
+
+            impl WriteHex for $u {
+                fn write_hex<W: fmt::Write>(&self, mut writer: W) -> fmt::Result {
+                    write!(writer, "{:x}", self)
+                }
+            }
+
+            impl WriteHex for $i {
+                fn write_hex<W: fmt::Write>(&self, mut writer: W) -> fmt::Result {
+                    write!(writer, "{:x}", self)
+                }
+            }
+
+            impl Primitive for $i {}
+            impl Primitive for $u {}
+        )*
+    }
+}
+
+impl_bits! {
+    u8, i8,
+    u16, i16,
+    u32, i32,
+    u64, i64,
+    u128, i128,
+    usize, isize,
+}
+
+/// A trait for referencing the `bitflags`-owned internal type
+/// without exposing it publicly.
+pub trait PublicFlags {
+    /// The type of the underlying storage.
+    type Primitive: Primitive;
+
+    /// The type of the internal field on the generated flags type.
+    type Internal;
+}
+
+#[doc(hidden)]
+#[deprecated(note = "use the `Flags` trait instead")]
+pub trait BitFlags: ImplementedByBitFlagsMacro + Flags {
+    /// An iterator over enabled flags in an instance of the type.
+    type Iter: Iterator<Item = Self>;
+
+    /// An iterator over the raw names and bits for enabled flags in an instance of the type.
+    type IterNames: Iterator<Item = (&'static str, Self)>;
+}
+
+#[allow(deprecated)]
+impl<B: Flags> BitFlags for B {
+    type Iter = iter::Iter<Self>;
+    type IterNames = iter::IterNames<Self>;
+}
+
+impl<B: Flags> ImplementedByBitFlagsMacro for B {}
+
+/// A marker trait that signals that an implementation of `BitFlags` came from the `bitflags!` macro.
+///
+/// There's nothing stopping an end-user from implementing this trait, but we don't guarantee their
+/// manual implementations won't break between non-breaking releases.
+#[doc(hidden)]
+pub trait ImplementedByBitFlagsMacro {}
+
+pub(crate) mod __private {
+    pub use super::{ImplementedByBitFlagsMacro, PublicFlags};
+}
diff -pruN 43.0.0-1/rust-vendor/cc/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/cc/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/cc/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"CHANGELOG.md":"27c152bba5a9e4aa5f8075f618fec105590804ba75dd4581bb54cdcf3d719e91","Cargo.toml":"a772649c4058df65a5977d7c2d37afdbb7bcf68f3b47428acef6502158c0f1c4","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"f1ddbede208a5b78333a25dac0a7598e678e9b601a7d99a791069bddaf180dfe","clippy.toml":"aa7850db4350883c8f373bd0d6b4d19bf3b75f13c1c238e24368c109cb52fb1d","src/command_helpers.rs":"5b765fc5bf3ff7367aa6acf67be465bdc776b22c090d3bbfe11816bd023c7a18","src/detect_compiler_family.c":"72903b91d7a28f49b39e7d730f4c9c4bb39fb901948fa1279cd08abf392f5a29","src/lib.rs":"2f6d061032899f2e60e3932041c353d327ba6f27c7eb747fd37f8d18a750e6a0","src/parallel/async_executor.rs":"4ce24435fff6b6555b43fee042c16bd65d4150d0346567f246b9190d85b45983","src/parallel/job_token.rs":"f4ed0a03d89a42bfd5527133d12b267af519b745f3f2b997ed293df15a2641b8","src/parallel/mod.rs":"55fb4c2d15e66677b2ed5ffa6d65ea161bcf1a1e1dc7910ee3bde06f2f67ab14","src/parallel/once_lock.rs":"d13e4cb82d6bca3297ca8671d83a40dd5affd7ac89191d733dd451867181bb02","src/parallel/stderr.rs":"74384d41198740a6fce0877f144262db09fb091225fa8fbfa771314bb11487c6","src/target_info.rs":"342be00f6215e161d8163e272a2945bb9f52f171648e15e11d46800a73186955","src/tempfile.rs":"ebafb5b0e5d08b0706916ed911d4245240e60c3e2d0c9a1630c520842988a2b3","src/tool.rs":"f5d8d343be6db681605ad5e9adab9f10c19b9d772af241da285ddbe54740486d","src/utilities.rs":"a13bb0a351fcef72823485b1b5dc4f514c533fa4feac95deb66ed9e5fbfe7b53","src/windows/com.rs":"a2800ddb81215fff2bf618336f5c4ff8e8bdb746dd18b795873c7304b3f2a5e3","src/windows/find_tools.rs":"a03cd94d7a36deb0e4490d9ce070624a0e79f082cdfc4c32f52a8cbe557fd0b5","src/windows/mod.rs":"34cfa201cfbcac7ccaa3ea5295d3e4200439af3cc5c6433baf81502596040a89","src/windows/registry.rs":"c521b72c825e8095843e73482ffa810ed066ad8bb9f86e6db0c5c143c171aba1","src/windows/setup_config.rs":"754439cbab492afd44c9755abcbec1a41c9b2c358131cee2df13c0e996dbbec8","src/windows/vs_instances.rs":"946527cf8fd32c3472f6a2884dcdec290763101097334c7478f9c24c3950db6b","src/windows/winapi.rs":"250d51c1826d1a2329e9889dd9f058cfce253dbf2a678b076147c6cdb5db046c","src/windows/windows_sys.rs":"e2714c8307bfa083b9745eb0e46cadd7f98d7b88abf45a7637172019324e34b8","src/windows/windows_targets.rs":"5b4648ebc22b028caca9f4b4bf8881fe2d094b7bec217264ba2e6e2c49d1ccee"},"package":"2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/cc/CHANGELOG.md 43.0.0-1ubuntu1/rust-vendor/cc/CHANGELOG.md
--- 43.0.0-1/rust-vendor/cc/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,102 @@
+# Changelog
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [Unreleased]
+
+## [1.1.6](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.5...cc-v1.1.6) - 2024-07-19
+
+### Other
+- Clippy fixes ([#1163](https://github.com/rust-lang/cc-rs/pull/1163))
+
+## [1.1.5](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.4...cc-v1.1.5) - 2024-07-15
+
+### Other
+- Fix cyclic compilation: Use vendored once_cell ([#1154](https://github.com/rust-lang/cc-rs/pull/1154))
+
+## [1.1.4](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.3...cc-v1.1.4) - 2024-07-14
+
+### Other
+- Support compiling on wasm targets (Supersede [#1068](https://github.com/rust-lang/cc-rs/pull/1068)) ([#1160](https://github.com/rust-lang/cc-rs/pull/1160))
+
+## [1.1.3](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.2...cc-v1.1.3) - 2024-07-14
+
+### Other
+- Reduce msrv to 1.63 ([#1158](https://github.com/rust-lang/cc-rs/pull/1158))
+- Revert "Use raw-dylib for windows-sys ([#1137](https://github.com/rust-lang/cc-rs/pull/1137))" ([#1157](https://github.com/rust-lang/cc-rs/pull/1157))
+- Fix typos ([#1152](https://github.com/rust-lang/cc-rs/pull/1152))
+- Fix `doc_lazy_continuation` lints ([#1153](https://github.com/rust-lang/cc-rs/pull/1153))
+
+## [1.1.2](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.1...cc-v1.1.2) - 2024-07-12
+
+### Other
+- Add empty `jobserver` feature. ([#1150](https://github.com/rust-lang/cc-rs/pull/1150))
+
+## [1.1.1](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.0...cc-v1.1.1) - 2024-07-12
+
+### Other
+- Fix is_flag_supported not respecting emit_rerun_if_env_changed ([#1147](https://github.com/rust-lang/cc-rs/pull/1147)) ([#1148](https://github.com/rust-lang/cc-rs/pull/1148))
+
+## [1.1.0](https://github.com/rust-lang/cc-rs/compare/cc-v1.0.106...cc-v1.1.0) - 2024-07-08
+
+### Added
+- add cargo_output to eliminate last vestiges of stdout pollution ([#1141](https://github.com/rust-lang/cc-rs/pull/1141))
+
+## [1.0.106](https://github.com/rust-lang/cc-rs/compare/cc-v1.0.105...cc-v1.0.106) - 2024-07-08
+
+### Other
+- Drop support for Visual Studio 12 (2013) ([#1046](https://github.com/rust-lang/cc-rs/pull/1046))
+- Use raw-dylib for windows-sys ([#1137](https://github.com/rust-lang/cc-rs/pull/1137))
+- Bump msrv to 1.67 ([#1143](https://github.com/rust-lang/cc-rs/pull/1143))
+- Bump msrv to 1.65 ([#1140](https://github.com/rust-lang/cc-rs/pull/1140))
+- Fix clippy warnings ([#1138](https://github.com/rust-lang/cc-rs/pull/1138))
+
+## [1.0.105](https://github.com/rust-lang/cc-rs/compare/cc-v1.0.104...cc-v1.0.105) - 2024-07-07
+
+### Other
+- Regenerate windows sys bindings ([#1132](https://github.com/rust-lang/cc-rs/pull/1132))
+- Fix generate-windows-sys-bindings ([#1133](https://github.com/rust-lang/cc-rs/pull/1133))
+- Fix gen-windows-sys-binding ([#1130](https://github.com/rust-lang/cc-rs/pull/1130))
+- Fix gen-windows-sys-binding ([#1127](https://github.com/rust-lang/cc-rs/pull/1127))
+- Update windows-bindgen requirement from 0.57 to 0.58 ([#1123](https://github.com/rust-lang/cc-rs/pull/1123))
+
+## [1.0.104](https://github.com/rust-lang/cc-rs/compare/cc-v1.0.103...cc-v1.0.104) - 2024-07-01
+
+### Other
+- Fixed link break about compile-time-requirements ([#1118](https://github.com/rust-lang/cc-rs/pull/1118))
+
+## [1.0.103](https://github.com/rust-lang/cc-rs/compare/cc-v1.0.102...cc-v1.0.103) - 2024-06-30
+
+### Other
+- Fix compilation for wasm: env WASI_SYSROOT should be optional ([#1114](https://github.com/rust-lang/cc-rs/pull/1114))
+
+## [1.0.102](https://github.com/rust-lang/cc-rs/compare/cc-v1.0.101...cc-v1.0.102) - 2024-06-29
+
+### Other
+- Fix invalid wasi targets compatibility ([#1105](https://github.com/rust-lang/cc-rs/pull/1105))
+- Speedup regenerate-target-info and regenerate-windows-sys ([#1110](https://github.com/rust-lang/cc-rs/pull/1110))
+
+## [1.0.101](https://github.com/rust-lang/cc-rs/compare/cc-v1.0.100...cc-v1.0.101) - 2024-06-25
+
+### Other
+- Use `Build::getenv` instead of `env::var*` in anywhere that makes sense ([#1103](https://github.com/rust-lang/cc-rs/pull/1103))
+
+## [1.0.100](https://github.com/rust-lang/cc-rs/compare/cc-v1.0.99...cc-v1.0.100) - 2024-06-23
+
+### Other
+- Update publish.yml to use release-plz ([#1101](https://github.com/rust-lang/cc-rs/pull/1101))
+- Accept `OsStr` instead of `str` for flags ([#1100](https://github.com/rust-lang/cc-rs/pull/1100))
+- Use `dep:` syntax to avoid implicit features. ([#1099](https://github.com/rust-lang/cc-rs/pull/1099))
+- Minor clippy fixes. ([#1098](https://github.com/rust-lang/cc-rs/pull/1098))
+- Fix WASI compilation for C++ ([#1083](https://github.com/rust-lang/cc-rs/pull/1083))
+- Regenerate windows sys bindings ([#1096](https://github.com/rust-lang/cc-rs/pull/1096))
+- Rename regenerate-windows-sys to regenerate-windows-sys.yml ([#1095](https://github.com/rust-lang/cc-rs/pull/1095))
+- Create regenerate-windows-sys.yml ([#1094](https://github.com/rust-lang/cc-rs/pull/1094))
+- Update windows-bindgen requirement from 0.56 to 0.57 ([#1091](https://github.com/rust-lang/cc-rs/pull/1091))
+- Eagerly close tempfile to fix [#1082](https://github.com/rust-lang/cc-rs/pull/1082) ([#1087](https://github.com/rust-lang/cc-rs/pull/1087))
+- Output msvc.exe in the output directory ([#1090](https://github.com/rust-lang/cc-rs/pull/1090))
+- Fix clippy warnings on Windows ([#1088](https://github.com/rust-lang/cc-rs/pull/1088))
+- Don't try to free DLL on drop ([#1089](https://github.com/rust-lang/cc-rs/pull/1089))
+- Fix panic safety issue in StderrForwarder ([#1079](https://github.com/rust-lang/cc-rs/pull/1079))
diff -pruN 43.0.0-1/rust-vendor/cc/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/cc/Cargo.toml
--- 43.0.0-1/rust-vendor/cc/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,54 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2018"
+rust-version = "1.63"
+name = "cc"
+version = "1.1.6"
+authors = ["Alex Crichton <alex@alexcrichton.com>"]
+exclude = [
+    "/.github",
+    "tests",
+    "src/bin",
+]
+description = """
+A build-time dependency for Cargo build scripts to assist in invoking the native
+C compiler to compile native C code into a static archive to be linked into Rust
+code.
+"""
+homepage = "https://github.com/rust-lang/cc-rs"
+documentation = "https://docs.rs/cc"
+readme = "README.md"
+keywords = ["build-dependencies"]
+categories = ["development-tools::build-utils"]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/rust-lang/cc-rs"
+
+[dependencies.jobserver]
+version = "0.1.30"
+optional = true
+default-features = false
+
+[dev-dependencies.tempfile]
+version = "3"
+
+[features]
+jobserver = []
+parallel = [
+    "dep:libc",
+    "dep:jobserver",
+]
+
+[target."cfg(unix)".dependencies.libc]
+version = "0.2.62"
+optional = true
+default-features = false
diff -pruN 43.0.0-1/rust-vendor/cc/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/cc/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/cc/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,201 @@
+                              Apache License
+                        Version 2.0, January 2004
+                     http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+   "License" shall mean the terms and conditions for use, reproduction,
+   and distribution as defined by Sections 1 through 9 of this document.
+
+   "Licensor" shall mean the copyright owner or entity authorized by
+   the copyright owner that is granting the License.
+
+   "Legal Entity" shall mean the union of the acting entity and all
+   other entities that control, are controlled by, or are under common
+   control with that entity. For the purposes of this definition,
+   "control" means (i) the power, direct or indirect, to cause the
+   direction or management of such entity, whether by contract or
+   otherwise, or (ii) ownership of fifty percent (50%) or more of the
+   outstanding shares, or (iii) beneficial ownership of such entity.
+
+   "You" (or "Your") shall mean an individual or Legal Entity
+   exercising permissions granted by this License.
+
+   "Source" form shall mean the preferred form for making modifications,
+   including but not limited to software source code, documentation
+   source, and configuration files.
+
+   "Object" form shall mean any form resulting from mechanical
+   transformation or translation of a Source form, including but
+   not limited to compiled object code, generated documentation,
+   and conversions to other media types.
+
+   "Work" shall mean the work of authorship, whether in Source or
+   Object form, made available under the License, as indicated by a
+   copyright notice that is included in or attached to the work
+   (an example is provided in the Appendix below).
+
+   "Derivative Works" shall mean any work, whether in Source or Object
+   form, that is based on (or derived from) the Work and for which the
+   editorial revisions, annotations, elaborations, or other modifications
+   represent, as a whole, an original work of authorship. For the purposes
+   of this License, Derivative Works shall not include works that remain
+   separable from, or merely link (or bind by name) to the interfaces of,
+   the Work and Derivative Works thereof.
+
+   "Contribution" shall mean any work of authorship, including
+   the original version of the Work and any modifications or additions
+   to that Work or Derivative Works thereof, that is intentionally
+   submitted to Licensor for inclusion in the Work by the copyright owner
+   or by an individual or Legal Entity authorized to submit on behalf of
+   the copyright owner. For the purposes of this definition, "submitted"
+   means any form of electronic, verbal, or written communication sent
+   to the Licensor or its representatives, including but not limited to
+   communication on electronic mailing lists, source code control systems,
+   and issue tracking systems that are managed by, or on behalf of, the
+   Licensor for the purpose of discussing and improving the Work, but
+   excluding communication that is conspicuously marked or otherwise
+   designated in writing by the copyright owner as "Not a Contribution."
+
+   "Contributor" shall mean Licensor and any individual or Legal Entity
+   on behalf of whom a Contribution has been received by Licensor and
+   subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   copyright license to reproduce, prepare Derivative Works of,
+   publicly display, publicly perform, sublicense, and distribute the
+   Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   (except as stated in this section) patent license to make, have made,
+   use, offer to sell, sell, import, and otherwise transfer the Work,
+   where such license applies only to those patent claims licensable
+   by such Contributor that are necessarily infringed by their
+   Contribution(s) alone or by combination of their Contribution(s)
+   with the Work to which such Contribution(s) was submitted. If You
+   institute patent litigation against any entity (including a
+   cross-claim or counterclaim in a lawsuit) alleging that the Work
+   or a Contribution incorporated within the Work constitutes direct
+   or contributory patent infringement, then any patent licenses
+   granted to You under this License for that Work shall terminate
+   as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+   Work or Derivative Works thereof in any medium, with or without
+   modifications, and in Source or Object form, provided that You
+   meet the following conditions:
+
+   (a) You must give any other recipients of the Work or
+       Derivative Works a copy of this License; and
+
+   (b) You must cause any modified files to carry prominent notices
+       stating that You changed the files; and
+
+   (c) You must retain, in the Source form of any Derivative Works
+       that You distribute, all copyright, patent, trademark, and
+       attribution notices from the Source form of the Work,
+       excluding those notices that do not pertain to any part of
+       the Derivative Works; and
+
+   (d) If the Work includes a "NOTICE" text file as part of its
+       distribution, then any Derivative Works that You distribute must
+       include a readable copy of the attribution notices contained
+       within such NOTICE file, excluding those notices that do not
+       pertain to any part of the Derivative Works, in at least one
+       of the following places: within a NOTICE text file distributed
+       as part of the Derivative Works; within the Source form or
+       documentation, if provided along with the Derivative Works; or,
+       within a display generated by the Derivative Works, if and
+       wherever such third-party notices normally appear. The contents
+       of the NOTICE file are for informational purposes only and
+       do not modify the License. You may add Your own attribution
+       notices within Derivative Works that You distribute, alongside
+       or as an addendum to the NOTICE text from the Work, provided
+       that such additional attribution notices cannot be construed
+       as modifying the License.
+
+   You may add Your own copyright statement to Your modifications and
+   may provide additional or different license terms and conditions
+   for use, reproduction, or distribution of Your modifications, or
+   for any such Derivative Works as a whole, provided Your use,
+   reproduction, and distribution of the Work otherwise complies with
+   the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+   any Contribution intentionally submitted for inclusion in the Work
+   by You to the Licensor shall be under the terms and conditions of
+   this License, without any additional terms or conditions.
+   Notwithstanding the above, nothing herein shall supersede or modify
+   the terms of any separate license agreement you may have executed
+   with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+   names, trademarks, service marks, or product names of the Licensor,
+   except as required for reasonable and customary use in describing the
+   origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+   agreed to in writing, Licensor provides the Work (and each
+   Contributor provides its Contributions) on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+   implied, including, without limitation, any warranties or conditions
+   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+   PARTICULAR PURPOSE. You are solely responsible for determining the
+   appropriateness of using or redistributing the Work and assume any
+   risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+   whether in tort (including negligence), contract, or otherwise,
+   unless required by applicable law (such as deliberate and grossly
+   negligent acts) or agreed to in writing, shall any Contributor be
+   liable to You for damages, including any direct, indirect, special,
+   incidental, or consequential damages of any character arising as a
+   result of this License or out of the use or inability to use the
+   Work (including but not limited to damages for loss of goodwill,
+   work stoppage, computer failure or malfunction, or any and all
+   other commercial damages or losses), even if such Contributor
+   has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+   the Work or Derivative Works thereof, You may choose to offer,
+   and charge a fee for, acceptance of support, warranty, indemnity,
+   or other liability obligations and/or rights consistent with this
+   License. However, in accepting such obligations, You may act only
+   on Your own behalf and on Your sole responsibility, not on behalf
+   of any other Contributor, and only if You agree to indemnify,
+   defend, and hold each Contributor harmless for any liability
+   incurred by, or claims asserted against, such Contributor by reason
+   of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+   To apply the Apache License to your work, attach the following
+   boilerplate notice, with the fields enclosed by brackets "[]"
+   replaced with your own identifying information. (Don't include
+   the brackets!)  The text should be enclosed in the appropriate
+   comment syntax for the file format. We also recommend that a
+   file or class name and description of purpose be included on the
+   same "printed page" as the copyright notice for easier
+   identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+	http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff -pruN 43.0.0-1/rust-vendor/cc/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/cc/LICENSE-MIT
--- 43.0.0-1/rust-vendor/cc/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,25 @@
+Copyright (c) 2014 Alex Crichton
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/cc/README.md 43.0.0-1ubuntu1/rust-vendor/cc/README.md
--- 43.0.0-1/rust-vendor/cc/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,27 @@
+# cc-rs
+
+A library for [Cargo build scripts](https://doc.rust-lang.org/cargo/reference/build-scripts.html)
+to compile a set of C/C++/assembly/CUDA files into a static archive for Cargo
+to link into the crate being built. This crate does not compile code itself;
+it calls out to the default compiler for the platform. This crate will
+automatically detect situations such as cross compilation and
+various environment variables and will build code appropriately.
+
+Refer to the [documentation](https://docs.rs/cc) for detailed usage instructions.
+
+## License
+
+This project is licensed under either of
+
+ * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
+   https://www.apache.org/licenses/LICENSE-2.0)
+ * MIT license ([LICENSE-MIT](LICENSE-MIT) or
+   https://opensource.org/licenses/MIT)
+
+at your option.
+
+### Contribution
+
+Unless you explicitly state otherwise, any contribution intentionally submitted
+for inclusion in cc-rs by you, as defined in the Apache-2.0 license, shall be
+dual licensed as above, without any additional terms or conditions.
diff -pruN 43.0.0-1/rust-vendor/cc/clippy.toml 43.0.0-1ubuntu1/rust-vendor/cc/clippy.toml
--- 43.0.0-1/rust-vendor/cc/clippy.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/clippy.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+disallowed-methods = [
+    { path = "std::env::var_os", reason = "Please use Build::getenv" },
+    { path = "std::env::var", reason = "Please use Build::getenv" },
+]
+doc-valid-idents = ["AppleClang", "OpenBSD", ".."]
diff -pruN 43.0.0-1/rust-vendor/cc/src/command_helpers.rs 43.0.0-1ubuntu1/rust-vendor/cc/src/command_helpers.rs
--- 43.0.0-1/rust-vendor/cc/src/command_helpers.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/command_helpers.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,485 @@
+//! Miscellaneous helpers for running commands
+
+use std::{
+    collections::hash_map,
+    ffi::OsString,
+    fmt::Display,
+    fs,
+    hash::Hasher,
+    io::{self, Read, Write},
+    path::Path,
+    process::{Child, ChildStderr, Command, Stdio},
+    sync::{
+        atomic::{AtomicBool, Ordering},
+        Arc,
+    },
+};
+
+use crate::{Error, ErrorKind, Object};
+
+#[derive(Clone, Debug)]
+pub(crate) struct CargoOutput {
+    pub(crate) metadata: bool,
+    pub(crate) warnings: bool,
+    pub(crate) debug: bool,
+    pub(crate) output: OutputKind,
+    checked_dbg_var: Arc<AtomicBool>,
+}
+
+/// Different strategies for handling compiler output (to stdout)
+#[derive(Clone, Debug)]
+pub(crate) enum OutputKind {
+    /// Forward the output to this process' stdout ([`Stdio::inherit()`])
+    Forward,
+    /// Discard the output ([`Stdio::null()`])
+    Discard,
+    /// Capture the result (`[Stdio::piped()`])
+    Capture,
+}
+
+impl CargoOutput {
+    pub(crate) fn new() -> Self {
+        #[allow(clippy::disallowed_methods)]
+        Self {
+            metadata: true,
+            warnings: true,
+            output: OutputKind::Forward,
+            debug: std::env::var_os("CC_ENABLE_DEBUG_OUTPUT").is_some(),
+            checked_dbg_var: Arc::new(AtomicBool::new(false)),
+        }
+    }
+
+    pub(crate) fn print_metadata(&self, s: &dyn Display) {
+        if self.metadata {
+            println!("{}", s);
+        }
+    }
+
+    pub(crate) fn print_warning(&self, arg: &dyn Display) {
+        if self.warnings {
+            println!("cargo:warning={}", arg);
+        }
+    }
+
+    pub(crate) fn print_debug(&self, arg: &dyn Display) {
+        if self.metadata && !self.checked_dbg_var.load(Ordering::Relaxed) {
+            self.checked_dbg_var.store(true, Ordering::Relaxed);
+            println!("cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT");
+        }
+        if self.debug {
+            println!("{}", arg);
+        }
+    }
+
+    fn stdio_for_warnings(&self) -> Stdio {
+        if self.warnings {
+            Stdio::piped()
+        } else {
+            Stdio::null()
+        }
+    }
+
+    fn stdio_for_output(&self) -> Stdio {
+        match self.output {
+            OutputKind::Capture => Stdio::piped(),
+            OutputKind::Forward => Stdio::inherit(),
+            OutputKind::Discard => Stdio::null(),
+        }
+    }
+}
+
+pub(crate) struct StderrForwarder {
+    inner: Option<(ChildStderr, Vec<u8>)>,
+    #[cfg(feature = "parallel")]
+    is_non_blocking: bool,
+    #[cfg(feature = "parallel")]
+    bytes_available_failed: bool,
+}
+
+const MIN_BUFFER_CAPACITY: usize = 100;
+
+impl StderrForwarder {
+    pub(crate) fn new(child: &mut Child) -> Self {
+        Self {
+            inner: child
+                .stderr
+                .take()
+                .map(|stderr| (stderr, Vec::with_capacity(MIN_BUFFER_CAPACITY))),
+            #[cfg(feature = "parallel")]
+            is_non_blocking: false,
+            #[cfg(feature = "parallel")]
+            bytes_available_failed: false,
+        }
+    }
+
+    fn forward_available(&mut self) -> bool {
+        if let Some((stderr, buffer)) = self.inner.as_mut() {
+            loop {
+                let old_data_end = buffer.len();
+
+                // For non-blocking we check to see if there is data available, so we should try to
+                // read at least that much. For blocking, always read at least the minimum amount.
+                #[cfg(not(feature = "parallel"))]
+                let to_reserve = MIN_BUFFER_CAPACITY;
+                #[cfg(feature = "parallel")]
+                let to_reserve = if self.is_non_blocking && !self.bytes_available_failed {
+                    match crate::parallel::stderr::bytes_available(stderr) {
+                        #[cfg(windows)]
+                        Ok(0) => break false,
+                        #[cfg(unix)]
+                        Ok(0) => {
+                            // On Unix, depending on the implementation, we may sometimes get 0 in a
+                            // loop (either there is data available or the pipe is broken), so
+                            // continue with the non-blocking read anyway.
+                            MIN_BUFFER_CAPACITY
+                        }
+                        #[cfg(windows)]
+                        Err(_) => {
+                            // On Windows, if we get an error then the pipe is broken, so flush
+                            // the buffer and bail.
+                            if !buffer.is_empty() {
+                                write_warning(&buffer[..]);
+                            }
+                            self.inner = None;
+                            break true;
+                        }
+                        #[cfg(unix)]
+                        Err(_) => {
+                            // On Unix, depending on the implementation, we may get spurious
+                            // errors so make a note not to use bytes_available again and try
+                            // the non-blocking read anyway.
+                            self.bytes_available_failed = true;
+                            MIN_BUFFER_CAPACITY
+                        }
+                        #[cfg(target_family = "wasm")]
+                        Err(_) => panic!("bytes_available should always succeed on wasm"),
+                        Ok(bytes_available) => MIN_BUFFER_CAPACITY.max(bytes_available),
+                    }
+                } else {
+                    MIN_BUFFER_CAPACITY
+                };
+                buffer.reserve(to_reserve);
+
+                // Safety: stderr.read only writes to the spare part of the buffer, it never reads from it
+                match stderr
+                    .read(unsafe { &mut *(buffer.spare_capacity_mut() as *mut _ as *mut [u8]) })
+                {
+                    Err(err) if err.kind() == std::io::ErrorKind::WouldBlock => {
+                        // No data currently, yield back.
+                        break false;
+                    }
+                    Err(err) if err.kind() == std::io::ErrorKind::Interrupted => {
+                        // Interrupted, try again.
+                        continue;
+                    }
+                    Ok(bytes_read) if bytes_read != 0 => {
+                        // Safety: bytes_read bytes is written to spare part of the buffer
+                        unsafe { buffer.set_len(old_data_end + bytes_read) };
+                        let mut consumed = 0;
+                        for line in buffer.split_inclusive(|&b| b == b'\n') {
+                            // Only forward complete lines, leave the rest in the buffer.
+                            if let Some((b'\n', line)) = line.split_last() {
+                                consumed += line.len() + 1;
+                                write_warning(line);
+                            }
+                        }
+                        buffer.drain(..consumed);
+                    }
+                    res => {
+                        // End of stream: flush remaining data and bail.
+                        if old_data_end > 0 {
+                            write_warning(&buffer[..old_data_end]);
+                        }
+                        if let Err(err) = res {
+                            write_warning(
+                                format!("Failed to read from child stderr: {err}").as_bytes(),
+                            );
+                        }
+                        self.inner.take();
+                        break true;
+                    }
+                }
+            }
+        } else {
+            true
+        }
+    }
+
+    #[cfg(feature = "parallel")]
+    pub(crate) fn set_non_blocking(&mut self) -> Result<(), Error> {
+        assert!(!self.is_non_blocking);
+
+        #[cfg(unix)]
+        if let Some((stderr, _)) = self.inner.as_ref() {
+            crate::parallel::stderr::set_non_blocking(stderr)?;
+        }
+
+        self.is_non_blocking = true;
+        Ok(())
+    }
+
+    #[cfg(feature = "parallel")]
+    fn forward_all(&mut self) {
+        while !self.forward_available() {}
+    }
+
+    #[cfg(not(feature = "parallel"))]
+    fn forward_all(&mut self) {
+        let forward_result = self.forward_available();
+        assert!(forward_result, "Should have consumed all data");
+    }
+}
+
+fn write_warning(line: &[u8]) {
+    let stdout = io::stdout();
+    let mut stdout = stdout.lock();
+    stdout.write_all(b"cargo:warning=").unwrap();
+    stdout.write_all(line).unwrap();
+    stdout.write_all(b"\n").unwrap();
+}
+
+fn wait_on_child(
+    cmd: &Command,
+    program: &Path,
+    child: &mut Child,
+    cargo_output: &CargoOutput,
+) -> Result<(), Error> {
+    StderrForwarder::new(child).forward_all();
+
+    let status = match child.wait() {
+        Ok(s) => s,
+        Err(e) => {
+            return Err(Error::new(
+                ErrorKind::ToolExecError,
+                format!(
+                    "Failed to wait on spawned child process, command {:?} with args {}: {}.",
+                    cmd,
+                    program.display(),
+                    e
+                ),
+            ));
+        }
+    };
+
+    cargo_output.print_debug(&status);
+
+    if status.success() {
+        Ok(())
+    } else {
+        Err(Error::new(
+            ErrorKind::ToolExecError,
+            format!(
+                "Command {:?} with args {} did not execute successfully (status code {}).",
+                cmd,
+                program.display(),
+                status
+            ),
+        ))
+    }
+}
+
+/// Find the destination object path for each file in the input source files,
+/// and store them in the output Object.
+pub(crate) fn objects_from_files(files: &[Arc<Path>], dst: &Path) -> Result<Vec<Object>, Error> {
+    let mut objects = Vec::with_capacity(files.len());
+    for file in files {
+        let basename = file
+            .file_name()
+            .ok_or_else(|| {
+                Error::new(
+                    ErrorKind::InvalidArgument,
+                    "No file_name for object file path!",
+                )
+            })?
+            .to_string_lossy();
+        let dirname = file
+            .parent()
+            .ok_or_else(|| {
+                Error::new(
+                    ErrorKind::InvalidArgument,
+                    "No parent for object file path!",
+                )
+            })?
+            .to_string_lossy();
+
+        // Hash the dirname. This should prevent conflicts if we have multiple
+        // object files with the same filename in different subfolders.
+        let mut hasher = hash_map::DefaultHasher::new();
+        hasher.write(dirname.to_string().as_bytes());
+        let obj = dst
+            .join(format!("{:016x}-{}", hasher.finish(), basename))
+            .with_extension("o");
+
+        match obj.parent() {
+            Some(s) => fs::create_dir_all(s)?,
+            None => {
+                return Err(Error::new(
+                    ErrorKind::InvalidArgument,
+                    "dst is an invalid path with no parent",
+                ));
+            }
+        };
+
+        objects.push(Object::new(file.to_path_buf(), obj));
+    }
+
+    Ok(objects)
+}
+
+pub(crate) fn run(
+    cmd: &mut Command,
+    program: impl AsRef<Path>,
+    cargo_output: &CargoOutput,
+) -> Result<(), Error> {
+    let program = program.as_ref();
+
+    let mut child = spawn(cmd, program, cargo_output)?;
+    wait_on_child(cmd, program, &mut child, cargo_output)
+}
+
+pub(crate) fn run_output(
+    cmd: &mut Command,
+    program: impl AsRef<Path>,
+    cargo_output: &CargoOutput,
+) -> Result<Vec<u8>, Error> {
+    let program = program.as_ref();
+
+    // We specifically need the output to be captured, so override default
+    let mut captured_cargo_output = cargo_output.clone();
+    captured_cargo_output.output = OutputKind::Capture;
+    let mut child = spawn(cmd, program, &captured_cargo_output)?;
+
+    let mut stdout = vec![];
+    child
+        .stdout
+        .take()
+        .unwrap()
+        .read_to_end(&mut stdout)
+        .unwrap();
+
+    // Don't care about this output, use the normal settings
+    wait_on_child(cmd, program, &mut child, cargo_output)?;
+
+    Ok(stdout)
+}
+
+pub(crate) fn spawn(
+    cmd: &mut Command,
+    program: &Path,
+    cargo_output: &CargoOutput,
+) -> Result<Child, Error> {
+    struct ResetStderr<'cmd>(&'cmd mut Command);
+
+    impl Drop for ResetStderr<'_> {
+        fn drop(&mut self) {
+            // Reset stderr to default to release pipe_writer so that print thread will
+            // not block forever.
+            self.0.stderr(Stdio::inherit());
+        }
+    }
+
+    cargo_output.print_debug(&format_args!("running: {:?}", cmd));
+
+    let cmd = ResetStderr(cmd);
+    let child = cmd
+        .0
+        .stderr(cargo_output.stdio_for_warnings())
+        .stdout(cargo_output.stdio_for_output())
+        .spawn();
+    match child {
+        Ok(child) => Ok(child),
+        Err(ref e) if e.kind() == io::ErrorKind::NotFound => {
+            let extra = if cfg!(windows) {
+                " (see https://docs.rs/cc/latest/cc/#compile-time-requirements \
+for help)"
+            } else {
+                ""
+            };
+            Err(Error::new(
+                ErrorKind::ToolNotFound,
+                format!(
+                    "Failed to find tool. Is `{}` installed?{}",
+                    program.display(),
+                    extra
+                ),
+            ))
+        }
+        Err(e) => Err(Error::new(
+            ErrorKind::ToolExecError,
+            format!(
+                "Command {:?} with args {} failed to start: {:?}",
+                cmd.0,
+                program.display(),
+                e
+            ),
+        )),
+    }
+}
+
+pub(crate) struct CmdAddOutputFileArgs {
+    pub(crate) cuda: bool,
+    pub(crate) is_assembler_msvc: bool,
+    pub(crate) msvc: bool,
+    pub(crate) clang: bool,
+    pub(crate) gnu: bool,
+    pub(crate) is_asm: bool,
+    pub(crate) is_arm: bool,
+}
+
+pub(crate) fn command_add_output_file(cmd: &mut Command, dst: &Path, args: CmdAddOutputFileArgs) {
+    if args.is_assembler_msvc
+        || !(!args.msvc || args.clang || args.gnu || args.cuda || (args.is_asm && args.is_arm))
+    {
+        let mut s = OsString::from("-Fo");
+        s.push(dst);
+        cmd.arg(s);
+    } else {
+        cmd.arg("-o").arg(dst);
+    }
+}
+
+#[cfg(feature = "parallel")]
+pub(crate) fn try_wait_on_child(
+    cmd: &Command,
+    program: &Path,
+    child: &mut Child,
+    stdout: &mut dyn io::Write,
+    stderr_forwarder: &mut StderrForwarder,
+) -> Result<Option<()>, Error> {
+    stderr_forwarder.forward_available();
+
+    match child.try_wait() {
+        Ok(Some(status)) => {
+            stderr_forwarder.forward_all();
+
+            let _ = writeln!(stdout, "{}", status);
+
+            if status.success() {
+                Ok(Some(()))
+            } else {
+                Err(Error::new(
+                    ErrorKind::ToolExecError,
+                    format!(
+                        "Command {:?} with args {} did not execute successfully (status code {}).",
+                        cmd,
+                        program.display(),
+                        status
+                    ),
+                ))
+            }
+        }
+        Ok(None) => Ok(None),
+        Err(e) => {
+            stderr_forwarder.forward_all();
+            Err(Error::new(
+                ErrorKind::ToolExecError,
+                format!(
+                    "Failed to wait on spawned child process, command {:?} with args {}: {}.",
+                    cmd,
+                    program.display(),
+                    e
+                ),
+            ))
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/cc/src/detect_compiler_family.c 43.0.0-1ubuntu1/rust-vendor/cc/src/detect_compiler_family.c
--- 43.0.0-1/rust-vendor/cc/src/detect_compiler_family.c	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/detect_compiler_family.c	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+#ifdef __clang__
+#pragma message "clang"
+#endif
+
+#ifdef __GNUC__
+#pragma message "gcc"
+#endif
diff -pruN 43.0.0-1/rust-vendor/cc/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/cc/src/lib.rs
--- 43.0.0-1/rust-vendor/cc/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4262 @@
+//! A library for [Cargo build scripts](https://doc.rust-lang.org/cargo/reference/build-scripts.html)
+//! to compile a set of C/C++/assembly/CUDA files into a static archive for Cargo
+//! to link into the crate being built. This crate does not compile code itself;
+//! it calls out to the default compiler for the platform. This crate will
+//! automatically detect situations such as cross compilation and
+//! [various environment variables](#external-configuration-via-environment-variables) and will build code appropriately.
+//!
+//! # Example
+//!
+//! First, you'll want to both add a build script for your crate (`build.rs`) and
+//! also add this crate to your `Cargo.toml` via:
+//!
+//! ```toml
+//! [build-dependencies]
+//! cc = "1.0"
+//! ```
+//!
+//! Next up, you'll want to write a build script like so:
+//!
+//! ```rust,no_run
+//! // build.rs
+//! cc::Build::new()
+//!     .file("foo.c")
+//!     .file("bar.c")
+//!     .compile("foo");
+//! ```
+//!
+//! And that's it! Running `cargo build` should take care of the rest and your Rust
+//! application will now have the C files `foo.c` and `bar.c` compiled into a file
+//! named `libfoo.a`. If the C files contain
+//!
+//! ```c
+//! void foo_function(void) { ... }
+//! ```
+//!
+//! and
+//!
+//! ```c
+//! int32_t bar_function(int32_t x) { ... }
+//! ```
+//!
+//! you can call them from Rust by declaring them in
+//! your Rust code like so:
+//!
+//! ```rust,no_run
+//! extern "C" {
+//!     fn foo_function();
+//!     fn bar_function(x: i32) -> i32;
+//! }
+//!
+//! pub fn call() {
+//!     unsafe {
+//!         foo_function();
+//!         bar_function(42);
+//!     }
+//! }
+//!
+//! fn main() {
+//!     call();
+//! }
+//! ```
+//!
+//! See [the Rustonomicon](https://doc.rust-lang.org/nomicon/ffi.html) for more details.
+//!
+//! # External configuration via environment variables
+//!
+//! To control the programs and flags used for building, the builder can set a
+//! number of different environment variables.
+//!
+//! * `CFLAGS` - a series of space separated flags passed to compilers. Note that
+//!   individual flags cannot currently contain spaces, so doing
+//!   something like: `-L=foo\ bar` is not possible.
+//! * `CC` - the actual C compiler used. Note that this is used as an exact
+//!   executable name, so (for example) no extra flags can be passed inside
+//!   this variable, and the builder must ensure that there aren't any
+//!   trailing spaces. This compiler must understand the `-c` flag. For
+//!   certain `TARGET`s, it also is assumed to know about other flags (most
+//!   common is `-fPIC`).
+//! * `AR` - the `ar` (archiver) executable to use to build the static library.
+//! * `CRATE_CC_NO_DEFAULTS` - the default compiler flags may cause conflicts in
+//!   some cross compiling scenarios. Setting this variable
+//!   will disable the generation of default compiler
+//!   flags.
+//! * `CC_ENABLE_DEBUG_OUTPUT` - if set, compiler command invocations and exit codes will
+//!   be logged to stdout. This is useful for debugging build script issues, but can be
+//!   overly verbose for normal use.
+//! * `CXX...` - see [C++ Support](#c-support).
+//!
+//! Furthermore, projects using this crate may specify custom environment variables
+//! to be inspected, for example via the `Build::try_flags_from_environment`
+//! function. Consult the project’s own documentation or its use of the `cc` crate
+//! for any additional variables it may use.
+//!
+//! Each of these variables can also be supplied with certain prefixes and suffixes,
+//! in the following prioritized order:
+//!
+//!   1. `<var>_<target>` - for example, `CC_x86_64-unknown-linux-gnu`
+//!   2. `<var>_<target_with_underscores>` - for example, `CC_x86_64_unknown_linux_gnu`
+//!   3. `<build-kind>_<var>` - for example, `HOST_CC` or `TARGET_CFLAGS`
+//!   4. `<var>` - a plain `CC`, `AR` as above.
+//!
+//! If none of these variables exist, cc-rs uses built-in defaults.
+//!
+//! In addition to the above optional environment variables, `cc-rs` has some
+//! functions with hard requirements on some variables supplied by [cargo's
+//! build-script driver][cargo] that it has the `TARGET`, `OUT_DIR`, `OPT_LEVEL`,
+//! and `HOST` variables.
+//!
+//! [cargo]: https://doc.rust-lang.org/cargo/reference/build-scripts.html#inputs-to-the-build-script
+//!
+//! # Optional features
+//!
+//! ## Parallel
+//!
+//! Currently cc-rs supports parallel compilation (think `make -jN`) but this
+//! feature is turned off by default. To enable cc-rs to compile C/C++ in parallel,
+//! you can change your dependency to:
+//!
+//! ```toml
+//! [build-dependencies]
+//! cc = { version = "1.0", features = ["parallel"] }
+//! ```
+//!
+//! By default cc-rs will limit parallelism to `$NUM_JOBS`, or if not present it
+//! will limit it to the number of cpus on the machine. If you are using cargo,
+//! use `-jN` option of `build`, `test` and `run` commands as `$NUM_JOBS`
+//! is supplied by cargo.
+//!
+//! # Compile-time Requirements
+//!
+//! To work properly this crate needs access to a C compiler when the build script
+//! is being run. This crate does not ship a C compiler with it. The compiler
+//! required varies per platform, but there are three broad categories:
+//!
+//! * Unix platforms require `cc` to be the C compiler. This can be found by
+//!   installing cc/clang on Linux distributions and Xcode on macOS, for example.
+//! * Windows platforms targeting MSVC (e.g. your target triple ends in `-msvc`)
+//!   require Visual Studio to be installed. `cc-rs` attempts to locate it, and
+//!   if it fails, `cl.exe` is expected to be available in `PATH`. This can be
+//!   set up by running the appropriate developer tools shell.
+//! * Windows platforms targeting MinGW (e.g. your target triple ends in `-gnu`)
+//!   require `cc` to be available in `PATH`. We recommend the
+//!   [MinGW-w64](https://www.mingw-w64.org/) distribution, which is using the
+//!   [Win-builds](http://win-builds.org/) installation system.
+//!   You may also acquire it via
+//!   [MSYS2](https://www.msys2.org/), as explained [here][msys2-help].  Make sure
+//!   to install the appropriate architecture corresponding to your installation of
+//!   rustc. GCC from older [MinGW](http://www.mingw.org/) project is compatible
+//!   only with 32-bit rust compiler.
+//!
+//! [msys2-help]: https://github.com/rust-lang/rust#building-on-windows
+//!
+//! # C++ support
+//!
+//! `cc-rs` supports C++ libraries compilation by using the `cpp` method on
+//! `Build`:
+//!
+//! ```rust,no_run
+//! cc::Build::new()
+//!     .cpp(true) // Switch to C++ library compilation.
+//!     .file("foo.cpp")
+//!     .compile("foo");
+//! ```
+//!
+//! For C++ libraries, the `CXX` and `CXXFLAGS` environment variables are used instead of `CC` and `CFLAGS`.
+//!
+//! The C++ standard library may be linked to the crate target. By default it's `libc++` for macOS, FreeBSD, and OpenBSD, `libc++_shared` for Android, nothing for MSVC, and `libstdc++` for anything else. It can be changed in one of two ways:
+//!
+//! 1. by using the `cpp_link_stdlib` method on `Build`:
+//! ```rust,no_run
+//! cc::Build::new()
+//!     .cpp(true)
+//!     .file("foo.cpp")
+//!     .cpp_link_stdlib("stdc++") // use libstdc++
+//!     .compile("foo");
+//! ```
+//! 2. by setting the `CXXSTDLIB` environment variable.
+//!
+//! In particular, for Android you may want to [use `c++_static` if you have at most one shared library](https://developer.android.com/ndk/guides/cpp-support).
+//!
+//! Remember that C++ does name mangling so `extern "C"` might be required to enable Rust linker to find your functions.
+//!
+//! # CUDA C++ support
+//!
+//! `cc-rs` also supports compiling CUDA C++ libraries by using the `cuda` method
+//! on `Build`:
+//!
+//! ```rust,no_run
+//! cc::Build::new()
+//!     // Switch to CUDA C++ library compilation using NVCC.
+//!     .cuda(true)
+//!     .cudart("static")
+//!     // Generate code for Maxwell (GTX 970, 980, 980 Ti, Titan X).
+//!     .flag("-gencode").flag("arch=compute_52,code=sm_52")
+//!     // Generate code for Maxwell (Jetson TX1).
+//!     .flag("-gencode").flag("arch=compute_53,code=sm_53")
+//!     // Generate code for Pascal (GTX 1070, 1080, 1080 Ti, Titan Xp).
+//!     .flag("-gencode").flag("arch=compute_61,code=sm_61")
+//!     // Generate code for Pascal (Tesla P100).
+//!     .flag("-gencode").flag("arch=compute_60,code=sm_60")
+//!     // Generate code for Pascal (Jetson TX2).
+//!     .flag("-gencode").flag("arch=compute_62,code=sm_62")
+//!     // Generate code in parallel
+//!     .flag("-t0")
+//!     .file("bar.cu")
+//!     .compile("bar");
+//! ```
+
+#![doc(html_root_url = "https://docs.rs/cc/1.0")]
+#![deny(warnings)]
+#![deny(missing_docs)]
+#![deny(clippy::disallowed_methods)]
+#![warn(clippy::doc_markdown)]
+
+use std::borrow::Cow;
+use std::collections::HashMap;
+use std::env;
+use std::ffi::{OsStr, OsString};
+use std::fmt::{self, Display, Formatter};
+use std::fs;
+use std::io::{self, Write};
+use std::path::{Component, Path, PathBuf};
+#[cfg(feature = "parallel")]
+use std::process::Child;
+use std::process::Command;
+use std::sync::{Arc, RwLock};
+
+#[cfg(feature = "parallel")]
+mod parallel;
+mod windows;
+// Regardless of whether this should be in this crate's public API,
+// it has been since 2015, so don't break it.
+pub use windows::find_tools as windows_registry;
+
+mod command_helpers;
+use command_helpers::*;
+
+mod tool;
+pub use tool::Tool;
+use tool::ToolFamily;
+
+mod target_info;
+mod tempfile;
+
+mod utilities;
+use utilities::*;
+
+#[derive(Debug, Eq, PartialEq, Hash)]
+struct CompilerFlag {
+    compiler: Box<Path>,
+    flag: Box<OsStr>,
+}
+
+type Env = Option<Arc<OsStr>>;
+
+/// A builder for compilation of a native library.
+///
+/// A `Build` is the main type of the `cc` crate and is used to control all the
+/// various configuration options and such of a compile. You'll find more
+/// documentation on each method itself.
+#[derive(Clone, Debug)]
+pub struct Build {
+    include_directories: Vec<Arc<Path>>,
+    definitions: Vec<(Arc<str>, Option<Arc<str>>)>,
+    objects: Vec<Arc<Path>>,
+    flags: Vec<Arc<OsStr>>,
+    flags_supported: Vec<Arc<OsStr>>,
+    known_flag_support_status_cache: Arc<RwLock<HashMap<CompilerFlag, bool>>>,
+    ar_flags: Vec<Arc<OsStr>>,
+    asm_flags: Vec<Arc<OsStr>>,
+    no_default_flags: bool,
+    files: Vec<Arc<Path>>,
+    cpp: bool,
+    cpp_link_stdlib: Option<Option<Arc<str>>>,
+    cpp_set_stdlib: Option<Arc<str>>,
+    cuda: bool,
+    cudart: Option<Arc<str>>,
+    ccbin: bool,
+    std: Option<Arc<str>>,
+    target: Option<Arc<str>>,
+    host: Option<Arc<str>>,
+    out_dir: Option<Arc<Path>>,
+    opt_level: Option<Arc<str>>,
+    debug: Option<bool>,
+    force_frame_pointer: Option<bool>,
+    env: Vec<(Arc<OsStr>, Arc<OsStr>)>,
+    compiler: Option<Arc<Path>>,
+    archiver: Option<Arc<Path>>,
+    ranlib: Option<Arc<Path>>,
+    cargo_output: CargoOutput,
+    link_lib_modifiers: Vec<Arc<OsStr>>,
+    pic: Option<bool>,
+    use_plt: Option<bool>,
+    static_crt: Option<bool>,
+    shared_flag: Option<bool>,
+    static_flag: Option<bool>,
+    warnings_into_errors: bool,
+    warnings: Option<bool>,
+    extra_warnings: Option<bool>,
+    env_cache: Arc<RwLock<HashMap<Box<str>, Env>>>,
+    apple_sdk_root_cache: Arc<RwLock<HashMap<Box<str>, Arc<OsStr>>>>,
+    apple_versions_cache: Arc<RwLock<HashMap<Box<str>, Arc<str>>>>,
+    emit_rerun_if_env_changed: bool,
+    cached_compiler_family: Arc<RwLock<HashMap<Box<Path>, ToolFamily>>>,
+}
+
+/// Represents the types of errors that may occur while using cc-rs.
+#[derive(Clone, Debug)]
+enum ErrorKind {
+    /// Error occurred while performing I/O.
+    IOError,
+    /// Invalid architecture supplied.
+    ArchitectureInvalid,
+    /// Environment variable not found, with the var in question as extra info.
+    EnvVarNotFound,
+    /// Error occurred while using external tools (ie: invocation of compiler).
+    ToolExecError,
+    /// Error occurred due to missing external tools.
+    ToolNotFound,
+    /// One of the function arguments failed validation.
+    InvalidArgument,
+    /// No known macro is defined for the compiler when discovering tool family
+    ToolFamilyMacroNotFound,
+    /// Invalid target
+    InvalidTarget,
+    #[cfg(feature = "parallel")]
+    /// jobserver helpthread failure
+    JobserverHelpThreadError,
+}
+
+/// Represents an internal error that occurred, with an explanation.
+#[derive(Clone, Debug)]
+pub struct Error {
+    /// Describes the kind of error that occurred.
+    kind: ErrorKind,
+    /// More explanation of error that occurred.
+    message: Cow<'static, str>,
+}
+
+impl Error {
+    fn new(kind: ErrorKind, message: impl Into<Cow<'static, str>>) -> Error {
+        Error {
+            kind,
+            message: message.into(),
+        }
+    }
+}
+
+impl From<io::Error> for Error {
+    fn from(e: io::Error) -> Error {
+        Error::new(ErrorKind::IOError, format!("{}", e))
+    }
+}
+
+impl Display for Error {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        write!(f, "{:?}: {}", self.kind, self.message)
+    }
+}
+
+impl std::error::Error for Error {}
+
+/// Represents an object.
+///
+/// This is a source file -> object file pair.
+#[derive(Clone, Debug)]
+struct Object {
+    src: PathBuf,
+    dst: PathBuf,
+}
+
+impl Object {
+    /// Create a new source file -> object file pair.
+    fn new(src: PathBuf, dst: PathBuf) -> Object {
+        Object { src, dst }
+    }
+}
+
+impl Build {
+    /// Construct a new instance of a blank set of configuration.
+    ///
+    /// This builder is finished with the [`compile`] function.
+    ///
+    /// [`compile`]: struct.Build.html#method.compile
+    pub fn new() -> Build {
+        Build {
+            include_directories: Vec::new(),
+            definitions: Vec::new(),
+            objects: Vec::new(),
+            flags: Vec::new(),
+            flags_supported: Vec::new(),
+            known_flag_support_status_cache: Arc::new(RwLock::new(HashMap::new())),
+            ar_flags: Vec::new(),
+            asm_flags: Vec::new(),
+            no_default_flags: false,
+            files: Vec::new(),
+            shared_flag: None,
+            static_flag: None,
+            cpp: false,
+            cpp_link_stdlib: None,
+            cpp_set_stdlib: None,
+            cuda: false,
+            cudart: None,
+            ccbin: true,
+            std: None,
+            target: None,
+            host: None,
+            out_dir: None,
+            opt_level: None,
+            debug: None,
+            force_frame_pointer: None,
+            env: Vec::new(),
+            compiler: None,
+            archiver: None,
+            ranlib: None,
+            cargo_output: CargoOutput::new(),
+            link_lib_modifiers: Vec::new(),
+            pic: None,
+            use_plt: None,
+            static_crt: None,
+            warnings: None,
+            extra_warnings: None,
+            warnings_into_errors: false,
+            env_cache: Arc::new(RwLock::new(HashMap::new())),
+            apple_sdk_root_cache: Arc::new(RwLock::new(HashMap::new())),
+            apple_versions_cache: Arc::new(RwLock::new(HashMap::new())),
+            emit_rerun_if_env_changed: true,
+            cached_compiler_family: Arc::default(),
+        }
+    }
+
+    /// Add a directory to the `-I` or include path for headers
+    ///
+    /// # Example
+    ///
+    /// ```no_run
+    /// use std::path::Path;
+    ///
+    /// let library_path = Path::new("/path/to/library");
+    ///
+    /// cc::Build::new()
+    ///     .file("src/foo.c")
+    ///     .include(library_path)
+    ///     .include("src")
+    ///     .compile("foo");
+    /// ```
+    pub fn include<P: AsRef<Path>>(&mut self, dir: P) -> &mut Build {
+        self.include_directories.push(dir.as_ref().into());
+        self
+    }
+
+    /// Add multiple directories to the `-I` include path.
+    ///
+    /// # Example
+    ///
+    /// ```no_run
+    /// # use std::path::Path;
+    /// # let condition = true;
+    /// #
+    /// let mut extra_dir = None;
+    /// if condition {
+    ///     extra_dir = Some(Path::new("/path/to"));
+    /// }
+    ///
+    /// cc::Build::new()
+    ///     .file("src/foo.c")
+    ///     .includes(extra_dir)
+    ///     .compile("foo");
+    /// ```
+    pub fn includes<P>(&mut self, dirs: P) -> &mut Build
+    where
+        P: IntoIterator,
+        P::Item: AsRef<Path>,
+    {
+        for dir in dirs {
+            self.include(dir);
+        }
+        self
+    }
+
+    /// Specify a `-D` variable with an optional value.
+    ///
+    /// # Example
+    ///
+    /// ```no_run
+    /// cc::Build::new()
+    ///     .file("src/foo.c")
+    ///     .define("FOO", "BAR")
+    ///     .define("BAZ", None)
+    ///     .compile("foo");
+    /// ```
+    pub fn define<'a, V: Into<Option<&'a str>>>(&mut self, var: &str, val: V) -> &mut Build {
+        self.definitions
+            .push((var.into(), val.into().map(Into::into)));
+        self
+    }
+
+    /// Add an arbitrary object file to link in
+    pub fn object<P: AsRef<Path>>(&mut self, obj: P) -> &mut Build {
+        self.objects.push(obj.as_ref().into());
+        self
+    }
+
+    /// Add an arbitrary flag to the invocation of the compiler
+    ///
+    /// # Example
+    ///
+    /// ```no_run
+    /// cc::Build::new()
+    ///     .file("src/foo.c")
+    ///     .flag("-ffunction-sections")
+    ///     .compile("foo");
+    /// ```
+    pub fn flag(&mut self, flag: impl AsRef<OsStr>) -> &mut Build {
+        self.flags.push(flag.as_ref().into());
+        self
+    }
+
+    /// Removes a compiler flag that was added by [`Build::flag`].
+    ///
+    /// Will not remove flags added by other means (default flags,
+    /// flags from env, and so on).
+    ///
+    /// # Example
+    /// ```
+    /// cc::Build::new()
+    ///     .file("src/foo.c")
+    ///     .flag("unwanted_flag")
+    ///     .remove_flag("unwanted_flag");
+    /// ```
+
+    pub fn remove_flag(&mut self, flag: &str) -> &mut Build {
+        self.flags.retain(|other_flag| &**other_flag != flag);
+        self
+    }
+
+    /// Add a flag to the invocation of the ar
+    ///
+    /// # Example
+    ///
+    /// ```no_run
+    /// cc::Build::new()
+    ///     .file("src/foo.c")
+    ///     .file("src/bar.c")
+    ///     .ar_flag("/NODEFAULTLIB:libc.dll")
+    ///     .compile("foo");
+    /// ```
+    pub fn ar_flag(&mut self, flag: impl AsRef<OsStr>) -> &mut Build {
+        self.ar_flags.push(flag.as_ref().into());
+        self
+    }
+
+    /// Add a flag that will only be used with assembly files.
+    ///
+    /// The flag will be applied to input files with either a `.s` or
+    /// `.asm` extension (case insensitive).
+    ///
+    /// # Example
+    ///
+    /// ```no_run
+    /// cc::Build::new()
+    ///     .asm_flag("-Wa,-defsym,abc=1")
+    ///     .file("src/foo.S")  // The asm flag will be applied here
+    ///     .file("src/bar.c")  // The asm flag will not be applied here
+    ///     .compile("foo");
+    /// ```
+    pub fn asm_flag(&mut self, flag: impl AsRef<OsStr>) -> &mut Build {
+        self.asm_flags.push(flag.as_ref().into());
+        self
+    }
+
+    fn ensure_check_file(&self) -> Result<PathBuf, Error> {
+        let out_dir = self.get_out_dir()?;
+        let src = if self.cuda {
+            assert!(self.cpp);
+            out_dir.join("flag_check.cu")
+        } else if self.cpp {
+            out_dir.join("flag_check.cpp")
+        } else {
+            out_dir.join("flag_check.c")
+        };
+
+        if !src.exists() {
+            let mut f = fs::File::create(&src)?;
+            write!(f, "int main(void) {{ return 0; }}")?;
+        }
+
+        Ok(src)
+    }
+
+    /// Run the compiler to test if it accepts the given flag.
+    ///
+    /// For a convenience method for setting flags conditionally,
+    /// see `flag_if_supported()`.
+    ///
+    /// It may return error if it's unable to run the compiler with a test file
+    /// (e.g. the compiler is missing or a write to the `out_dir` failed).
+    ///
+    /// Note: Once computed, the result of this call is stored in the
+    /// `known_flag_support` field. If `is_flag_supported(flag)`
+    /// is called again, the result will be read from the hash table.
+    pub fn is_flag_supported(&self, flag: impl AsRef<OsStr>) -> Result<bool, Error> {
+        self.is_flag_supported_inner(
+            flag.as_ref(),
+            self.get_base_compiler()?.path(),
+            &self.get_target()?,
+        )
+    }
+
+    fn is_flag_supported_inner(
+        &self,
+        flag: &OsStr,
+        compiler_path: &Path,
+        target: &str,
+    ) -> Result<bool, Error> {
+        let compiler_flag = CompilerFlag {
+            compiler: compiler_path.into(),
+            flag: flag.into(),
+        };
+
+        if let Some(is_supported) = self
+            .known_flag_support_status_cache
+            .read()
+            .unwrap()
+            .get(&compiler_flag)
+            .cloned()
+        {
+            return Ok(is_supported);
+        }
+
+        let out_dir = self.get_out_dir()?;
+        let src = self.ensure_check_file()?;
+        let obj = out_dir.join("flag_check");
+
+        let mut compiler = {
+            let mut cfg = Build::new();
+            cfg.flag(flag)
+                .compiler(compiler_path)
+                .cargo_metadata(self.cargo_output.metadata)
+                .target(target)
+                .opt_level(0)
+                .host(&self.get_host()?)
+                .debug(false)
+                .cpp(self.cpp)
+                .cuda(self.cuda)
+                .emit_rerun_if_env_changed(self.emit_rerun_if_env_changed);
+            cfg.try_get_compiler()?
+        };
+
+        // Clang uses stderr for verbose output, which yields a false positive
+        // result if the CFLAGS/CXXFLAGS include -v to aid in debugging.
+        if compiler.family.verbose_stderr() {
+            compiler.remove_arg("-v".into());
+        }
+        if compiler.is_like_clang() {
+            // Avoid reporting that the arg is unsupported just because the
+            // compiler complains that it wasn't used.
+            compiler.push_cc_arg("-Wno-unused-command-line-argument".into());
+        }
+
+        let mut cmd = compiler.to_command();
+        let is_arm = target.contains("aarch64") || target.contains("arm");
+        let clang = compiler.is_like_clang();
+        let gnu = compiler.family == ToolFamily::Gnu;
+        command_add_output_file(
+            &mut cmd,
+            &obj,
+            CmdAddOutputFileArgs {
+                cuda: self.cuda,
+                is_assembler_msvc: false,
+                msvc: compiler.is_like_msvc(),
+                clang,
+                gnu,
+                is_asm: false,
+                is_arm,
+            },
+        );
+
+        // Checking for compiler flags does not require linking
+        cmd.arg("-c");
+
+        cmd.arg(&src);
+
+        let output = cmd.output()?;
+        let is_supported = output.status.success() && output.stderr.is_empty();
+
+        self.known_flag_support_status_cache
+            .write()
+            .unwrap()
+            .insert(compiler_flag, is_supported);
+
+        Ok(is_supported)
+    }
+
+    /// Add an arbitrary flag to the invocation of the compiler if it supports it
+    ///
+    /// # Example
+    ///
+    /// ```no_run
+    /// cc::Build::new()
+    ///     .file("src/foo.c")
+    ///     .flag_if_supported("-Wlogical-op") // only supported by GCC
+    ///     .flag_if_supported("-Wunreachable-code") // only supported by clang
+    ///     .compile("foo");
+    /// ```
+    pub fn flag_if_supported(&mut self, flag: impl AsRef<OsStr>) -> &mut Build {
+        self.flags_supported.push(flag.as_ref().into());
+        self
+    }
+
+    /// Add flags from the specified environment variable.
+    ///
+    /// Normally the `cc` crate will consult with the standard set of environment
+    /// variables (such as `CFLAGS` and `CXXFLAGS`) to construct the compiler invocation. Use of
+    /// this method provides additional levers for the end user to use when configuring the build
+    /// process.
+    ///
+    /// Just like the standard variables, this method will search for an environment variable with
+    /// appropriate target prefixes, when appropriate.
+    ///
+    /// # Examples
+    ///
+    /// This method is particularly beneficial in introducing the ability to specify crate-specific
+    /// flags.
+    ///
+    /// ```no_run
+    /// cc::Build::new()
+    ///     .file("src/foo.c")
+    ///     .try_flags_from_environment(concat!(env!("CARGO_PKG_NAME"), "_CFLAGS"))
+    ///     .expect("the environment variable must be specified and UTF-8")
+    ///     .compile("foo");
+    /// ```
+    ///
+    pub fn try_flags_from_environment(&mut self, environ_key: &str) -> Result<&mut Build, Error> {
+        let flags = self.envflags(environ_key)?;
+        self.flags.extend(
+            flags
+                .into_iter()
+                .map(|flag| Arc::from(OsString::from(flag).as_os_str())),
+        );
+        Ok(self)
+    }
+
+    /// Set the `-shared` flag.
+    ///
+    /// When enabled, the compiler will produce a shared object which can
+    /// then be linked with other objects to form an executable.
+    ///
+    /// # Example
+    ///
+    /// ```no_run
+    /// cc::Build::new()
+    ///     .file("src/foo.c")
+    ///     .shared_flag(true)
+    ///     .compile("libfoo.so");
+    /// ```
+    pub fn shared_flag(&mut self, shared_flag: bool) -> &mut Build {
+        self.shared_flag = Some(shared_flag);
+        self
+    }
+
+    /// Set the `-static` flag.
+    ///
+    /// When enabled on systems that support dynamic linking, this prevents
+    /// linking with the shared libraries.
+    ///
+    /// # Example
+    ///
+    /// ```no_run
+    /// cc::Build::new()
+    ///     .file("src/foo.c")
+    ///     .shared_flag(true)
+    ///     .static_flag(true)
+    ///     .compile("foo");
+    /// ```
+    pub fn static_flag(&mut self, static_flag: bool) -> &mut Build {
+        self.static_flag = Some(static_flag);
+        self
+    }
+
+    /// Disables the generation of default compiler flags. The default compiler
+    /// flags may cause conflicts in some cross compiling scenarios.
+    ///
+    /// Setting the `CRATE_CC_NO_DEFAULTS` environment variable has the same
+    /// effect as setting this to `true`. The presence of the environment
+    /// variable and the value of `no_default_flags` will be OR'd together.
+    pub fn no_default_flags(&mut self, no_default_flags: bool) -> &mut Build {
+        self.no_default_flags = no_default_flags;
+        self
+    }
+
+    /// Add a file which will be compiled
+    pub fn file<P: AsRef<Path>>(&mut self, p: P) -> &mut Build {
+        self.files.push(p.as_ref().into());
+        self
+    }
+
+    /// Add files which will be compiled
+    pub fn files<P>(&mut self, p: P) -> &mut Build
+    where
+        P: IntoIterator,
+        P::Item: AsRef<Path>,
+    {
+        for file in p.into_iter() {
+            self.file(file);
+        }
+        self
+    }
+
+    /// Get the files which will be compiled
+    pub fn get_files(&self) -> impl Iterator<Item = &Path> {
+        self.files.iter().map(AsRef::as_ref)
+    }
+
+    /// Set C++ support.
+    ///
+    /// The other `cpp_*` options will only become active if this is set to
+    /// `true`.
+    ///
+    /// The name of the C++ standard library to link is decided by:
+    /// 1. If [`cpp_link_stdlib`](Build::cpp_link_stdlib) is set, use its value.
+    /// 2. Else if the `CXXSTDLIB` environment variable is set, use its value.
+    /// 3. Else the default is `libc++` for OS X and BSDs, `libc++_shared` for Android,
+    ///    `None` for MSVC and `libstdc++` for anything else.
+    pub fn cpp(&mut self, cpp: bool) -> &mut Build {
+        self.cpp = cpp;
+        self
+    }
+
+    /// Set CUDA C++ support.
+    ///
+    /// Enabling CUDA will invoke the CUDA compiler, NVCC. While NVCC accepts
+    /// the most common compiler flags, e.g. `-std=c++17`, some project-specific
+    /// flags might have to be prefixed with "-Xcompiler" flag, for example as
+    /// `.flag("-Xcompiler").flag("-fpermissive")`. See the documentation for
+    /// `nvcc`, the CUDA compiler driver, at <https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/>
+    /// for more information.
+    ///
+    /// If enabled, this also implicitly enables C++ support.
+    pub fn cuda(&mut self, cuda: bool) -> &mut Build {
+        self.cuda = cuda;
+        if cuda {
+            self.cpp = true;
+            self.cudart = Some("static".into());
+        }
+        self
+    }
+
+    /// Link CUDA run-time.
+    ///
+    /// This option mimics the `--cudart` NVCC command-line option. Just like
+    /// the original it accepts `{none|shared|static}`, with default being
+    /// `static`. The method has to be invoked after `.cuda(true)`, or not
+    /// at all, if the default is right for the project.
+    pub fn cudart(&mut self, cudart: &str) -> &mut Build {
+        if self.cuda {
+            self.cudart = Some(cudart.into());
+        }
+        self
+    }
+
+    /// Set CUDA host compiler.
+    ///
+    /// By default, a `-ccbin` flag will be passed to NVCC to specify the
+    /// underlying host compiler. The value of `-ccbin` is the same as the
+    /// chosen C++ compiler. This is not always desired, because NVCC might
+    /// not support that compiler. In this case, you can remove the `-ccbin`
+    /// flag so that NVCC will choose the host compiler by itself.
+    pub fn ccbin(&mut self, ccbin: bool) -> &mut Build {
+        self.ccbin = ccbin;
+        self
+    }
+
+    /// Specify the C or C++ language standard version.
+    ///
+    /// These values are common to modern versions of GCC, Clang and MSVC:
+    /// - `c11` for ISO/IEC 9899:2011
+    /// - `c17` for ISO/IEC 9899:2018
+    /// - `c++14` for ISO/IEC 14882:2014
+    /// - `c++17` for ISO/IEC 14882:2017
+    /// - `c++20` for ISO/IEC 14882:2020
+    ///
+    /// Other values have less broad support, e.g. MSVC does not support `c++11`
+    /// (`c++14` is the minimum), `c89` (omit the flag instead) or `c99`.
+    ///
+    /// For compiling C++ code, you should also set `.cpp(true)`.
+    ///
+    /// The default is that no standard flag is passed to the compiler, so the
+    /// language version will be the compiler's default.
+    ///
+    /// # Example
+    ///
+    /// ```no_run
+    /// cc::Build::new()
+    ///     .file("src/modern.cpp")
+    ///     .cpp(true)
+    ///     .std("c++17")
+    ///     .compile("modern");
+    /// ```
+    pub fn std(&mut self, std: &str) -> &mut Build {
+        self.std = Some(std.into());
+        self
+    }
+
+    /// Set warnings into errors flag.
+    ///
+    /// Disabled by default.
+    ///
+    /// Warning: turning warnings into errors only make sense
+    /// if you are a developer of the crate using cc-rs.
+    /// Some warnings only appear on some architecture or
+    /// specific version of the compiler. Any user of this crate,
+    /// or any other crate depending on it, could fail during
+    /// compile time.
+    ///
+    /// # Example
+    ///
+    /// ```no_run
+    /// cc::Build::new()
+    ///     .file("src/foo.c")
+    ///     .warnings_into_errors(true)
+    ///     .compile("libfoo.a");
+    /// ```
+    pub fn warnings_into_errors(&mut self, warnings_into_errors: bool) -> &mut Build {
+        self.warnings_into_errors = warnings_into_errors;
+        self
+    }
+
+    /// Set warnings flags.
+    ///
+    /// Adds some flags:
+    /// - "-Wall" for MSVC.
+    /// - "-Wall", "-Wextra" for GNU and Clang.
+    ///
+    /// Enabled by default.
+    ///
+    /// # Example
+    ///
+    /// ```no_run
+    /// cc::Build::new()
+    ///     .file("src/foo.c")
+    ///     .warnings(false)
+    ///     .compile("libfoo.a");
+    /// ```
+    pub fn warnings(&mut self, warnings: bool) -> &mut Build {
+        self.warnings = Some(warnings);
+        self.extra_warnings = Some(warnings);
+        self
+    }
+
+    /// Set extra warnings flags.
+    ///
+    /// Adds some flags:
+    /// - nothing for MSVC.
+    /// - "-Wextra" for GNU and Clang.
+    ///
+    /// Enabled by default.
+    ///
+    /// # Example
+    ///
+    /// ```no_run
+    /// // Disables -Wextra, -Wall remains enabled:
+    /// cc::Build::new()
+    ///     .file("src/foo.c")
+    ///     .extra_warnings(false)
+    ///     .compile("libfoo.a");
+    /// ```
+    pub fn extra_warnings(&mut self, warnings: bool) -> &mut Build {
+        self.extra_warnings = Some(warnings);
+        self
+    }
+
+    /// Set the standard library to link against when compiling with C++
+    /// support.
+    ///
+    /// If the `CXXSTDLIB` environment variable is set, its value will
+    /// override the default value, but not the value explicitly set by calling
+    /// this function.
+    ///
+    /// A value of `None` indicates that no automatic linking should happen,
+    /// otherwise cargo will link against the specified library.
+    ///
+    /// The given library name must not contain the `lib` prefix.
+    ///
+    /// Common values:
+    /// - `stdc++` for GNU
+    /// - `c++` for Clang
+    /// - `c++_shared` or `c++_static` for Android
+    ///
+    /// # Example
+    ///
+    /// ```no_run
+    /// cc::Build::new()
+    ///     .file("src/foo.c")
+    ///     .shared_flag(true)
+    ///     .cpp_link_stdlib("stdc++")
+    ///     .compile("libfoo.so");
+    /// ```
+    pub fn cpp_link_stdlib<'a, V: Into<Option<&'a str>>>(
+        &mut self,
+        cpp_link_stdlib: V,
+    ) -> &mut Build {
+        self.cpp_link_stdlib = Some(cpp_link_stdlib.into().map(Arc::from));
+        self
+    }
+
+    /// Force the C++ compiler to use the specified standard library.
+    ///
+    /// Setting this option will automatically set `cpp_link_stdlib` to the same
+    /// value.
+    ///
+    /// The default value of this option is always `None`.
+    ///
+    /// This option has no effect when compiling for a Visual Studio based
+    /// target.
+    ///
+    /// This option sets the `-stdlib` flag, which is only supported by some
+    /// compilers (clang, icc) but not by others (gcc). The library will not
+    /// detect which compiler is used, as such it is the responsibility of the
+    /// caller to ensure that this option is only used in conjunction with a
+    /// compiler which supports the `-stdlib` flag.
+    ///
+    /// A value of `None` indicates that no specific C++ standard library should
+    /// be used, otherwise `-stdlib` is added to the compile invocation.
+    ///
+    /// The given library name must not contain the `lib` prefix.
+    ///
+    /// Common values:
+    /// - `stdc++` for GNU
+    /// - `c++` for Clang
+    ///
+    /// # Example
+    ///
+    /// ```no_run
+    /// cc::Build::new()
+    ///     .file("src/foo.c")
+    ///     .cpp_set_stdlib("c++")
+    ///     .compile("libfoo.a");
+    /// ```
+    pub fn cpp_set_stdlib<'a, V: Into<Option<&'a str>>>(
+        &mut self,
+        cpp_set_stdlib: V,
+    ) -> &mut Build {
+        let cpp_set_stdlib = cpp_set_stdlib.into().map(Arc::from);
+        self.cpp_set_stdlib.clone_from(&cpp_set_stdlib);
+        self.cpp_link_stdlib = Some(cpp_set_stdlib);
+        self
+    }
+
+    /// Configures the target this configuration will be compiling for.
+    ///
+    /// This option is automatically scraped from the `TARGET` environment
+    /// variable by build scripts, so it's not required to call this function.
+    ///
+    /// # Example
+    ///
+    /// ```no_run
+    /// cc::Build::new()
+    ///     .file("src/foo.c")
+    ///     .target("aarch64-linux-android")
+    ///     .compile("foo");
+    /// ```
+    pub fn target(&mut self, target: &str) -> &mut Build {
+        self.target = Some(target.into());
+        self
+    }
+
+    /// Configures the host assumed by this configuration.
+    ///
+    /// This option is automatically scraped from the `HOST` environment
+    /// variable by build scripts, so it's not required to call this function.
+    ///
+    /// # Example
+    ///
+    /// ```no_run
+    /// cc::Build::new()
+    ///     .file("src/foo.c")
+    ///     .host("arm-linux-gnueabihf")
+    ///     .compile("foo");
+    /// ```
+    pub fn host(&mut self, host: &str) -> &mut Build {
+        self.host = Some(host.into());
+        self
+    }
+
+    /// Configures the optimization level of the generated object files.
+    ///
+    /// This option is automatically scraped from the `OPT_LEVEL` environment
+    /// variable by build scripts, so it's not required to call this function.
+    pub fn opt_level(&mut self, opt_level: u32) -> &mut Build {
+        self.opt_level = Some(opt_level.to_string().into());
+        self
+    }
+
+    /// Configures the optimization level of the generated object files.
+    ///
+    /// This option is automatically scraped from the `OPT_LEVEL` environment
+    /// variable by build scripts, so it's not required to call this function.
+    pub fn opt_level_str(&mut self, opt_level: &str) -> &mut Build {
+        self.opt_level = Some(opt_level.into());
+        self
+    }
+
+    /// Configures whether the compiler will emit debug information when
+    /// generating object files.
+    ///
+    /// This option is automatically scraped from the `DEBUG` environment
+    /// variable by build scripts, so it's not required to call this function.
+    pub fn debug(&mut self, debug: bool) -> &mut Build {
+        self.debug = Some(debug);
+        self
+    }
+
+    /// Configures whether the compiler will emit instructions to store
+    /// frame pointers during codegen.
+    ///
+    /// This option is automatically enabled when debug information is emitted.
+    /// Otherwise the target platform compiler's default will be used.
+    /// You can use this option to force a specific setting.
+    pub fn force_frame_pointer(&mut self, force: bool) -> &mut Build {
+        self.force_frame_pointer = Some(force);
+        self
+    }
+
+    /// Configures the output directory where all object files and static
+    /// libraries will be located.
+    ///
+    /// This option is automatically scraped from the `OUT_DIR` environment
+    /// variable by build scripts, so it's not required to call this function.
+    pub fn out_dir<P: AsRef<Path>>(&mut self, out_dir: P) -> &mut Build {
+        self.out_dir = Some(out_dir.as_ref().into());
+        self
+    }
+
+    /// Configures the compiler to be used to produce output.
+    ///
+    /// This option is automatically determined from the target platform or a
+    /// number of environment variables, so it's not required to call this
+    /// function.
+    pub fn compiler<P: AsRef<Path>>(&mut self, compiler: P) -> &mut Build {
+        self.compiler = Some(compiler.as_ref().into());
+        self
+    }
+
+    /// Configures the tool used to assemble archives.
+    ///
+    /// This option is automatically determined from the target platform or a
+    /// number of environment variables, so it's not required to call this
+    /// function.
+    pub fn archiver<P: AsRef<Path>>(&mut self, archiver: P) -> &mut Build {
+        self.archiver = Some(archiver.as_ref().into());
+        self
+    }
+
+    /// Configures the tool used to index archives.
+    ///
+    /// This option is automatically determined from the target platform or a
+    /// number of environment variables, so it's not required to call this
+    /// function.
+    pub fn ranlib<P: AsRef<Path>>(&mut self, ranlib: P) -> &mut Build {
+        self.ranlib = Some(ranlib.as_ref().into());
+        self
+    }
+
+    /// Define whether metadata should be emitted for cargo allowing it to
+    /// automatically link the binary. Defaults to `true`.
+    ///
+    /// The emitted metadata is:
+    ///
+    ///  - `rustc-link-lib=static=`*compiled lib*
+    ///  - `rustc-link-search=native=`*target folder*
+    ///  - When target is MSVC, the ATL-MFC libs are added via `rustc-link-search=native=`
+    ///  - When C++ is enabled, the C++ stdlib is added via `rustc-link-lib`
+    ///  - If `emit_rerun_if_env_changed` is not `false`, `rerun-if-env-changed=`*env*
+    ///
+    pub fn cargo_metadata(&mut self, cargo_metadata: bool) -> &mut Build {
+        self.cargo_output.metadata = cargo_metadata;
+        self
+    }
+
+    /// Define whether compile warnings should be emitted for cargo. Defaults to
+    /// `true`.
+    ///
+    /// If disabled, compiler messages will not be printed.
+    /// Issues unrelated to the compilation will always produce cargo warnings regardless of this setting.
+    pub fn cargo_warnings(&mut self, cargo_warnings: bool) -> &mut Build {
+        self.cargo_output.warnings = cargo_warnings;
+        self
+    }
+
+    /// Define whether debug information should be emitted for cargo. Defaults to whether
+    /// or not the environment variable `CC_ENABLE_DEBUG_OUTPUT` is set.
+    ///
+    /// If enabled, the compiler will emit debug information when generating object files,
+    /// such as the command invoked and the exit status.
+    pub fn cargo_debug(&mut self, cargo_debug: bool) -> &mut Build {
+        self.cargo_output.debug = cargo_debug;
+        self
+    }
+
+    /// Define whether compiler output (to stdout) should be emitted. Defaults to `true`
+    /// (forward compiler stdout to this process' stdout)
+    ///
+    /// Some compilers emit errors to stdout, so if you *really* need stdout to be clean
+    /// you should also set this to `false`.
+    pub fn cargo_output(&mut self, cargo_output: bool) -> &mut Build {
+        self.cargo_output.output = if cargo_output {
+            OutputKind::Forward
+        } else {
+            OutputKind::Discard
+        };
+        self
+    }
+
+    /// Adds a native library modifier that will be added to the
+    /// `rustc-link-lib=static:MODIFIERS=LIBRARY_NAME` metadata line
+    /// emitted for cargo if `cargo_metadata` is enabled.
+    /// See <https://doc.rust-lang.org/rustc/command-line-arguments.html#-l-link-the-generated-crate-to-a-native-library>
+    /// for the list of modifiers accepted by rustc.
+    pub fn link_lib_modifier(&mut self, link_lib_modifier: impl AsRef<OsStr>) -> &mut Build {
+        self.link_lib_modifiers
+            .push(link_lib_modifier.as_ref().into());
+        self
+    }
+
+    /// Configures whether the compiler will emit position independent code.
+    ///
+    /// This option defaults to `false` for `windows-gnu` and bare metal targets and
+    /// to `true` for all other targets.
+    pub fn pic(&mut self, pic: bool) -> &mut Build {
+        self.pic = Some(pic);
+        self
+    }
+
+    /// Configures whether the Procedure Linkage Table is used for indirect
+    /// calls into shared libraries.
+    ///
+    /// The PLT is used to provide features like lazy binding, but introduces
+    /// a small performance loss due to extra pointer indirection. Setting
+    /// `use_plt` to `false` can provide a small performance increase.
+    ///
+    /// Note that skipping the PLT requires a recent version of GCC/Clang.
+    ///
+    /// This only applies to ELF targets. It has no effect on other platforms.
+    pub fn use_plt(&mut self, use_plt: bool) -> &mut Build {
+        self.use_plt = Some(use_plt);
+        self
+    }
+
+    /// Define whether metadata should be emitted for cargo to detect environment
+    /// changes that should trigger a rebuild.
+    ///
+    /// This has no effect if the `cargo_metadata` option is `false`.
+    ///
+    /// This option defaults to `true`.
+    pub fn emit_rerun_if_env_changed(&mut self, emit_rerun_if_env_changed: bool) -> &mut Build {
+        self.emit_rerun_if_env_changed = emit_rerun_if_env_changed;
+        self
+    }
+
+    /// Configures whether the /MT flag or the /MD flag will be passed to msvc build tools.
+    ///
+    /// This option defaults to `false`, and affect only msvc targets.
+    pub fn static_crt(&mut self, static_crt: bool) -> &mut Build {
+        self.static_crt = Some(static_crt);
+        self
+    }
+
+    #[doc(hidden)]
+    pub fn __set_env<A, B>(&mut self, a: A, b: B) -> &mut Build
+    where
+        A: AsRef<OsStr>,
+        B: AsRef<OsStr>,
+    {
+        self.env.push((a.as_ref().into(), b.as_ref().into()));
+        self
+    }
+
+    /// Run the compiler, generating the file `output`
+    ///
+    /// This will return a result instead of panicking; see [`Self::compile()`] for
+    /// the complete description.
+    pub fn try_compile(&self, output: &str) -> Result<(), Error> {
+        let mut output_components = Path::new(output).components();
+        match (output_components.next(), output_components.next()) {
+            (Some(Component::Normal(_)), None) => {}
+            _ => {
+                return Err(Error::new(
+                    ErrorKind::InvalidArgument,
+                    "argument of `compile` must be a single normal path component",
+                ));
+            }
+        }
+
+        let (lib_name, gnu_lib_name) = if output.starts_with("lib") && output.ends_with(".a") {
+            (&output[3..output.len() - 2], output.to_owned())
+        } else {
+            let mut gnu = String::with_capacity(5 + output.len());
+            gnu.push_str("lib");
+            gnu.push_str(output);
+            gnu.push_str(".a");
+            (output, gnu)
+        };
+        let dst = self.get_out_dir()?;
+
+        let objects = objects_from_files(&self.files, &dst)?;
+
+        self.compile_objects(&objects)?;
+        self.assemble(lib_name, &dst.join(gnu_lib_name), &objects)?;
+
+        let target = self.get_target()?;
+        if target.contains("msvc") {
+            let compiler = self.get_base_compiler()?;
+            let atlmfc_lib = compiler
+                .env()
+                .iter()
+                .find(|&(var, _)| var.as_os_str() == OsStr::new("LIB"))
+                .and_then(|(_, lib_paths)| {
+                    env::split_paths(lib_paths).find(|path| {
+                        let sub = Path::new("atlmfc/lib");
+                        path.ends_with(sub) || path.parent().map_or(false, |p| p.ends_with(sub))
+                    })
+                });
+
+            if let Some(atlmfc_lib) = atlmfc_lib {
+                self.cargo_output.print_metadata(&format_args!(
+                    "cargo:rustc-link-search=native={}",
+                    atlmfc_lib.display()
+                ));
+            }
+        }
+
+        if self.link_lib_modifiers.is_empty() {
+            self.cargo_output
+                .print_metadata(&format_args!("cargo:rustc-link-lib=static={}", lib_name));
+        } else {
+            self.cargo_output.print_metadata(&format_args!(
+                "cargo:rustc-link-lib=static:{}={}",
+                JoinOsStrs {
+                    slice: &self.link_lib_modifiers,
+                    delimiter: ','
+                },
+                lib_name
+            ));
+        }
+        self.cargo_output.print_metadata(&format_args!(
+            "cargo:rustc-link-search=native={}",
+            dst.display()
+        ));
+
+        // Add specific C++ libraries, if enabled.
+        if self.cpp {
+            if let Some(stdlib) = self.get_cpp_link_stdlib()? {
+                self.cargo_output
+                    .print_metadata(&format_args!("cargo:rustc-link-lib={}", stdlib.display()));
+            }
+            // Link c++ lib from WASI sysroot
+            if Build::is_wasi_target(target.as_ref()) {
+                if let Ok(wasi_sysroot) = self.wasi_sysroot() {
+                    self.cargo_output.print_metadata(&format_args!(
+                        "cargo:rustc-flags=-L {}/lib/{} -lstatic=c++ -lstatic=c++abi",
+                        Path::new(&wasi_sysroot).display(),
+                        target
+                    ));
+                }
+            }
+        }
+
+        let cudart = match &self.cudart {
+            Some(opt) => opt, // {none|shared|static}
+            None => "none",
+        };
+        if cudart != "none" {
+            if let Some(nvcc) = self.which(&self.get_compiler().path, None) {
+                // Try to figure out the -L search path. If it fails,
+                // it's on user to specify one by passing it through
+                // RUSTFLAGS environment variable.
+                let mut libtst = false;
+                let mut libdir = nvcc;
+                libdir.pop(); // remove 'nvcc'
+                libdir.push("..");
+                let target_arch = self.getenv_unwrap_str("CARGO_CFG_TARGET_ARCH")?;
+                if cfg!(target_os = "linux") {
+                    libdir.push("targets");
+                    libdir.push(target_arch.to_owned() + "-linux");
+                    libdir.push("lib");
+                    libtst = true;
+                } else if cfg!(target_env = "msvc") {
+                    libdir.push("lib");
+                    match target_arch.as_str() {
+                        "x86_64" => {
+                            libdir.push("x64");
+                            libtst = true;
+                        }
+                        "x86" => {
+                            libdir.push("Win32");
+                            libtst = true;
+                        }
+                        _ => libtst = false,
+                    }
+                }
+                if libtst && libdir.is_dir() {
+                    self.cargo_output.print_metadata(&format_args!(
+                        "cargo:rustc-link-search=native={}",
+                        libdir.to_str().unwrap()
+                    ));
+                }
+
+                // And now the -l flag.
+                let lib = match cudart {
+                    "shared" => "cudart",
+                    "static" => "cudart_static",
+                    bad => panic!("unsupported cudart option: {}", bad),
+                };
+                self.cargo_output
+                    .print_metadata(&format_args!("cargo:rustc-link-lib={}", lib));
+            }
+        }
+
+        Ok(())
+    }
+
+    /// Run the compiler, generating the file `output`
+    ///
+    /// # Library name
+    ///
+    /// The `output` string argument determines the file name for the compiled
+    /// library. The Rust compiler will create an assembly named "lib"+output+".a".
+    /// MSVC will create a file named output+".lib".
+    ///
+    /// The choice of `output` is close to arbitrary, but:
+    ///
+    /// - must be nonempty,
+    /// - must not contain a path separator (`/`),
+    /// - must be unique across all `compile` invocations made by the same build
+    ///   script.
+    ///
+    /// If your build script compiles a single source file, the base name of
+    /// that source file would usually be reasonable:
+    ///
+    /// ```no_run
+    /// cc::Build::new().file("blobstore.c").compile("blobstore");
+    /// ```
+    ///
+    /// Compiling multiple source files, some people use their crate's name, or
+    /// their crate's name + "-cc".
+    ///
+    /// Otherwise, please use your imagination.
+    ///
+    /// For backwards compatibility, if `output` starts with "lib" *and* ends
+    /// with ".a", a second "lib" prefix and ".a" suffix do not get added on,
+    /// but this usage is deprecated; please omit `lib` and `.a` in the argument
+    /// that you pass.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `output` is not formatted correctly or if one of the underlying
+    /// compiler commands fails. It can also panic if it fails reading file names
+    /// or creating directories.
+    pub fn compile(&self, output: &str) {
+        if let Err(e) = self.try_compile(output) {
+            fail(&e.message);
+        }
+    }
+
+    /// Run the compiler, generating intermediate files, but without linking
+    /// them into an archive file.
+    ///
+    /// This will return a list of compiled object files, in the same order
+    /// as they were passed in as `file`/`files` methods.
+    pub fn compile_intermediates(&self) -> Vec<PathBuf> {
+        match self.try_compile_intermediates() {
+            Ok(v) => v,
+            Err(e) => fail(&e.message),
+        }
+    }
+
+    /// Run the compiler, generating intermediate files, but without linking
+    /// them into an archive file.
+    ///
+    /// This will return a result instead of panicking; see `compile_intermediates()` for the complete description.
+    pub fn try_compile_intermediates(&self) -> Result<Vec<PathBuf>, Error> {
+        let dst = self.get_out_dir()?;
+        let objects = objects_from_files(&self.files, &dst)?;
+
+        self.compile_objects(&objects)?;
+
+        Ok(objects.into_iter().map(|v| v.dst).collect())
+    }
+
+    #[cfg(feature = "parallel")]
+    fn compile_objects(&self, objs: &[Object]) -> Result<(), Error> {
+        use std::cell::Cell;
+
+        use parallel::async_executor::{block_on, YieldOnce};
+
+        if objs.len() <= 1 {
+            for obj in objs {
+                let (mut cmd, name) = self.create_compile_object_cmd(obj)?;
+                run(&mut cmd, &name, &self.cargo_output)?;
+            }
+
+            return Ok(());
+        }
+
+        // Limit our parallelism globally with a jobserver.
+        let mut tokens = parallel::job_token::ActiveJobTokenServer::new();
+
+        // When compiling objects in parallel we do a few dirty tricks to speed
+        // things up:
+        //
+        // * First is that we use the `jobserver` crate to limit the parallelism
+        //   of this build script. The `jobserver` crate will use a jobserver
+        //   configured by Cargo for build scripts to ensure that parallelism is
+        //   coordinated across C compilations and Rust compilations. Before we
+        //   compile anything we make sure to wait until we acquire a token.
+        //
+        //   Note that this jobserver is cached globally so we only used one per
+        //   process and only worry about creating it once.
+        //
+        // * Next we use spawn the process to actually compile objects in
+        //   parallel after we've acquired a token to perform some work
+        //
+        // With all that in mind we compile all objects in a loop here, after we
+        // acquire the appropriate tokens, Once all objects have been compiled
+        // we wait on all the processes and propagate the results of compilation.
+
+        let pendings = Cell::new(Vec::<(
+            Command,
+            Cow<'static, Path>,
+            KillOnDrop,
+            parallel::job_token::JobToken,
+        )>::new());
+        let is_disconnected = Cell::new(false);
+        let has_made_progress = Cell::new(false);
+
+        let wait_future = async {
+            let mut error = None;
+            // Buffer the stdout
+            let mut stdout = io::BufWriter::with_capacity(128, io::stdout());
+
+            loop {
+                // If the other end of the pipe is already disconnected, then we're not gonna get any new jobs,
+                // so it doesn't make sense to reuse the tokens; in fact,
+                // releasing them as soon as possible (once we know that the other end is disconnected) is beneficial.
+                // Imagine that the last file built takes an hour to finish; in this scenario,
+                // by not releasing the tokens before that last file is done we would effectively block other processes from
+                // starting sooner - even though we only need one token for that last file, not N others that were acquired.
+
+                let mut pendings_is_empty = false;
+
+                cell_update(&pendings, |mut pendings| {
+                    // Try waiting on them.
+                    pendings.retain_mut(|(cmd, program, child, _token)| {
+                        match try_wait_on_child(
+                            cmd,
+                            program,
+                            &mut child.0,
+                            &mut stdout,
+                            &mut child.1,
+                        ) {
+                            Ok(Some(())) => {
+                                // Task done, remove the entry
+                                has_made_progress.set(true);
+                                false
+                            }
+                            Ok(None) => true, // Task still not finished, keep the entry
+                            Err(err) => {
+                                // Task fail, remove the entry.
+                                // Since we can only return one error, log the error to make
+                                // sure users always see all the compilation failures.
+                                has_made_progress.set(true);
+
+                                if self.cargo_output.warnings {
+                                    let _ = writeln!(stdout, "cargo:warning={}", err);
+                                }
+                                error = Some(err);
+
+                                false
+                            }
+                        }
+                    });
+                    pendings_is_empty = pendings.is_empty();
+                    pendings
+                });
+
+                if pendings_is_empty && is_disconnected.get() {
+                    break if let Some(err) = error {
+                        Err(err)
+                    } else {
+                        Ok(())
+                    };
+                }
+
+                YieldOnce::default().await;
+            }
+        };
+        let spawn_future = async {
+            for obj in objs {
+                let (mut cmd, program) = self.create_compile_object_cmd(obj)?;
+                let token = tokens.acquire().await?;
+                let mut child = spawn(&mut cmd, &program, &self.cargo_output)?;
+                let mut stderr_forwarder = StderrForwarder::new(&mut child);
+                stderr_forwarder.set_non_blocking()?;
+
+                cell_update(&pendings, |mut pendings| {
+                    pendings.push((cmd, program, KillOnDrop(child, stderr_forwarder), token));
+                    pendings
+                });
+
+                has_made_progress.set(true);
+            }
+            is_disconnected.set(true);
+
+            Ok::<_, Error>(())
+        };
+
+        return block_on(wait_future, spawn_future, &has_made_progress);
+
+        struct KillOnDrop(Child, StderrForwarder);
+
+        impl Drop for KillOnDrop {
+            fn drop(&mut self) {
+                let child = &mut self.0;
+
+                child.kill().ok();
+            }
+        }
+
+        fn cell_update<T, F>(cell: &Cell<T>, f: F)
+        where
+            T: Default,
+            F: FnOnce(T) -> T,
+        {
+            let old = cell.take();
+            let new = f(old);
+            cell.set(new);
+        }
+    }
+
+    #[cfg(not(feature = "parallel"))]
+    fn compile_objects(&self, objs: &[Object]) -> Result<(), Error> {
+        for obj in objs {
+            let (mut cmd, name) = self.create_compile_object_cmd(obj)?;
+            run(&mut cmd, &name, &self.cargo_output)?;
+        }
+
+        Ok(())
+    }
+
+    fn create_compile_object_cmd(
+        &self,
+        obj: &Object,
+    ) -> Result<(Command, Cow<'static, Path>), Error> {
+        let asm_ext = AsmFileExt::from_path(&obj.src);
+        let is_asm = asm_ext.is_some();
+        let target = self.get_target()?;
+        let msvc = target.contains("msvc");
+        let compiler = self.try_get_compiler()?;
+        let clang = compiler.is_like_clang();
+        let gnu = compiler.family == ToolFamily::Gnu;
+
+        let is_assembler_msvc = msvc && asm_ext == Some(AsmFileExt::DotAsm);
+        let (mut cmd, name) = if is_assembler_msvc {
+            let (cmd, name) = self.msvc_macro_assembler()?;
+            (cmd, Cow::Borrowed(Path::new(name)))
+        } else {
+            let mut cmd = compiler.to_command();
+            for (a, b) in self.env.iter() {
+                cmd.env(a, b);
+            }
+            (
+                cmd,
+                compiler
+                    .path
+                    .file_name()
+                    .ok_or_else(|| Error::new(ErrorKind::IOError, "Failed to get compiler path."))
+                    .map(PathBuf::from)
+                    .map(Cow::Owned)?,
+            )
+        };
+        let is_arm = target.contains("aarch64") || target.contains("arm");
+        command_add_output_file(
+            &mut cmd,
+            &obj.dst,
+            CmdAddOutputFileArgs {
+                cuda: self.cuda,
+                is_assembler_msvc,
+                msvc: compiler.is_like_msvc(),
+                clang,
+                gnu,
+                is_asm,
+                is_arm,
+            },
+        );
+        // armasm and armasm64 don't requrie -c option
+        if !is_assembler_msvc || !is_arm {
+            cmd.arg("-c");
+        }
+        if self.cuda && self.cuda_file_count() > 1 {
+            cmd.arg("--device-c");
+        }
+        if is_asm {
+            cmd.args(self.asm_flags.iter().map(std::ops::Deref::deref));
+        }
+        if compiler.family == (ToolFamily::Msvc { clang_cl: true }) && !is_assembler_msvc {
+            // #513: For `clang-cl`, separate flags/options from the input file.
+            // When cross-compiling macOS -> Windows, this avoids interpreting
+            // common `/Users/...` paths as the `/U` flag and triggering
+            // `-Wslash-u-filename` warning.
+            cmd.arg("--");
+        }
+        cmd.arg(&obj.src);
+        if cfg!(target_os = "macos") {
+            self.fix_env_for_apple_os(&mut cmd)?;
+        }
+
+        Ok((cmd, name))
+    }
+
+    /// This will return a result instead of panicking; see [`Self::expand()`] for
+    /// the complete description.
+    pub fn try_expand(&self) -> Result<Vec<u8>, Error> {
+        let compiler = self.try_get_compiler()?;
+        let mut cmd = compiler.to_command();
+        for (a, b) in self.env.iter() {
+            cmd.env(a, b);
+        }
+        cmd.arg("-E");
+
+        assert!(
+            self.files.len() <= 1,
+            "Expand may only be called for a single file"
+        );
+
+        let is_asm = self
+            .files
+            .iter()
+            .map(std::ops::Deref::deref)
+            .find_map(AsmFileExt::from_path)
+            .is_some();
+
+        if compiler.family == (ToolFamily::Msvc { clang_cl: true }) && !is_asm {
+            // #513: For `clang-cl`, separate flags/options from the input file.
+            // When cross-compiling macOS -> Windows, this avoids interpreting
+            // common `/Users/...` paths as the `/U` flag and triggering
+            // `-Wslash-u-filename` warning.
+            cmd.arg("--");
+        }
+
+        cmd.args(self.files.iter().map(std::ops::Deref::deref));
+
+        let name = compiler
+            .path
+            .file_name()
+            .ok_or_else(|| Error::new(ErrorKind::IOError, "Failed to get compiler path."))?;
+
+        run_output(&mut cmd, name, &self.cargo_output)
+    }
+
+    /// Run the compiler, returning the macro-expanded version of the input files.
+    ///
+    /// This is only relevant for C and C++ files.
+    ///
+    /// # Panics
+    /// Panics if more than one file is present in the config, or if compiler
+    /// path has an invalid file name.
+    ///
+    /// # Example
+    /// ```no_run
+    /// let out = cc::Build::new().file("src/foo.c").expand();
+    /// ```
+    pub fn expand(&self) -> Vec<u8> {
+        match self.try_expand() {
+            Err(e) => fail(&e.message),
+            Ok(v) => v,
+        }
+    }
+
+    /// Get the compiler that's in use for this configuration.
+    ///
+    /// This function will return a `Tool` which represents the culmination
+    /// of this configuration at a snapshot in time. The returned compiler can
+    /// be inspected (e.g. the path, arguments, environment) to forward along to
+    /// other tools, or the `to_command` method can be used to invoke the
+    /// compiler itself.
+    ///
+    /// This method will take into account all configuration such as debug
+    /// information, optimization level, include directories, defines, etc.
+    /// Additionally, the compiler binary in use follows the standard
+    /// conventions for this path, e.g. looking at the explicitly set compiler,
+    /// environment variables (a number of which are inspected here), and then
+    /// falling back to the default configuration.
+    ///
+    /// # Panics
+    ///
+    /// Panics if an error occurred while determining the architecture.
+    pub fn get_compiler(&self) -> Tool {
+        match self.try_get_compiler() {
+            Ok(tool) => tool,
+            Err(e) => fail(&e.message),
+        }
+    }
+
+    /// Get the compiler that's in use for this configuration.
+    ///
+    /// This will return a result instead of panicking; see
+    /// [`get_compiler()`](Self::get_compiler) for the complete description.
+    pub fn try_get_compiler(&self) -> Result<Tool, Error> {
+        let opt_level = self.get_opt_level()?;
+        let target = self.get_target()?;
+
+        let mut cmd = self.get_base_compiler()?;
+
+        // Disable default flag generation via `no_default_flags` or environment variable
+        let no_defaults = self.no_default_flags || self.getenv("CRATE_CC_NO_DEFAULTS").is_some();
+
+        if !no_defaults {
+            self.add_default_flags(&mut cmd, &target, &opt_level)?;
+        }
+
+        if let Some(ref std) = self.std {
+            let separator = match cmd.family {
+                ToolFamily::Msvc { .. } => ':',
+                ToolFamily::Gnu | ToolFamily::Clang { .. } => '=',
+            };
+            cmd.push_cc_arg(format!("-std{}{}", separator, std).into());
+        }
+
+        for directory in self.include_directories.iter() {
+            cmd.args.push("-I".into());
+            cmd.args.push(directory.as_os_str().into());
+        }
+
+        if let Ok(flags) = self.envflags(if self.cpp { "CXXFLAGS" } else { "CFLAGS" }) {
+            for arg in flags {
+                cmd.push_cc_arg(arg.into());
+            }
+        }
+
+        // If warnings and/or extra_warnings haven't been explicitly set,
+        // then we set them only if the environment doesn't already have
+        // CFLAGS/CXXFLAGS, since those variables presumably already contain
+        // the desired set of warnings flags.
+
+        if self.warnings.unwrap_or(!self.has_flags()) {
+            let wflags = cmd.family.warnings_flags().into();
+            cmd.push_cc_arg(wflags);
+        }
+
+        if self.extra_warnings.unwrap_or(!self.has_flags()) {
+            if let Some(wflags) = cmd.family.extra_warnings_flags() {
+                cmd.push_cc_arg(wflags.into());
+            }
+        }
+
+        for flag in self.flags.iter() {
+            cmd.args.push((**flag).into());
+        }
+
+        for flag in self.flags_supported.iter() {
+            if self
+                .is_flag_supported_inner(flag, &cmd.path, &target)
+                .unwrap_or(false)
+            {
+                cmd.push_cc_arg((**flag).into());
+            }
+        }
+
+        for (key, value) in self.definitions.iter() {
+            if let Some(ref value) = *value {
+                cmd.args.push(format!("-D{}={}", key, value).into());
+            } else {
+                cmd.args.push(format!("-D{}", key).into());
+            }
+        }
+
+        if self.warnings_into_errors {
+            let warnings_to_errors_flag = cmd.family.warnings_to_errors_flag().into();
+            cmd.push_cc_arg(warnings_to_errors_flag);
+        }
+
+        Ok(cmd)
+    }
+
+    fn add_default_flags(
+        &self,
+        cmd: &mut Tool,
+        target: &str,
+        opt_level: &str,
+    ) -> Result<(), Error> {
+        // Non-target flags
+        // If the flag is not conditioned on target variable, it belongs here :)
+        match cmd.family {
+            ToolFamily::Msvc { .. } => {
+                cmd.push_cc_arg("-nologo".into());
+
+                let crt_flag = match self.static_crt {
+                    Some(true) => "-MT",
+                    Some(false) => "-MD",
+                    None => {
+                        let features = self.getenv("CARGO_CFG_TARGET_FEATURE");
+                        let features = features.as_deref().unwrap_or_default();
+                        if features.to_string_lossy().contains("crt-static") {
+                            "-MT"
+                        } else {
+                            "-MD"
+                        }
+                    }
+                };
+                cmd.push_cc_arg(crt_flag.into());
+
+                match opt_level {
+                    // Msvc uses /O1 to enable all optimizations that minimize code size.
+                    "z" | "s" | "1" => cmd.push_opt_unless_duplicate("-O1".into()),
+                    // -O3 is a valid value for gcc and clang compilers, but not msvc. Cap to /O2.
+                    "2" | "3" => cmd.push_opt_unless_duplicate("-O2".into()),
+                    _ => {}
+                }
+            }
+            ToolFamily::Gnu | ToolFamily::Clang { .. } => {
+                // arm-linux-androideabi-gcc 4.8 shipped with Android NDK does
+                // not support '-Oz'
+                if opt_level == "z" && !cmd.is_like_clang() {
+                    cmd.push_opt_unless_duplicate("-Os".into());
+                } else {
+                    cmd.push_opt_unless_duplicate(format!("-O{}", opt_level).into());
+                }
+
+                if cmd.is_like_clang() && target.contains("windows") {
+                    // Disambiguate mingw and msvc on Windows. Problem is that
+                    // depending on the origin clang can default to a mismatchig
+                    // run-time.
+                    cmd.push_cc_arg(format!("--target={}", target).into());
+                }
+
+                if cmd.is_like_clang() && target.contains("android") {
+                    // For compatibility with code that doesn't use pre-defined `__ANDROID__` macro.
+                    // If compiler used via ndk-build or cmake (officially supported build methods)
+                    // this macros is defined.
+                    // See https://android.googlesource.com/platform/ndk/+/refs/heads/ndk-release-r21/build/cmake/android.toolchain.cmake#456
+                    // https://android.googlesource.com/platform/ndk/+/refs/heads/ndk-release-r21/build/core/build-binary.mk#141
+                    cmd.push_opt_unless_duplicate("-DANDROID".into());
+                }
+
+                if !target.contains("apple-ios")
+                    && !target.contains("apple-watchos")
+                    && !target.contains("apple-tvos")
+                    && !target.contains("apple-visionos")
+                {
+                    cmd.push_cc_arg("-ffunction-sections".into());
+                    cmd.push_cc_arg("-fdata-sections".into());
+                }
+                // Disable generation of PIC on bare-metal for now: rust-lld doesn't support this yet
+                if self.pic.unwrap_or(
+                    !target.contains("windows")
+                        && !target.contains("-none-")
+                        && !target.contains("uefi"),
+                ) {
+                    cmd.push_cc_arg("-fPIC".into());
+                    // PLT only applies if code is compiled with PIC support,
+                    // and only for ELF targets.
+                    if target.contains("linux") && !self.use_plt.unwrap_or(true) {
+                        cmd.push_cc_arg("-fno-plt".into());
+                    }
+                }
+                if Build::is_wasi_target(target) {
+                    // WASI does not support exceptions yet.
+                    // https://github.com/WebAssembly/exception-handling
+                    cmd.push_cc_arg("-fno-exceptions".into());
+                    // Link clang sysroot
+                    if let Ok(wasi_sysroot) = self.wasi_sysroot() {
+                        cmd.push_cc_arg(
+                            format!("--sysroot={}", Path::new(&wasi_sysroot).display()).into(),
+                        );
+                    }
+                }
+            }
+        }
+
+        if self.get_debug() {
+            if self.cuda {
+                // NVCC debug flag
+                cmd.args.push("-G".into());
+            }
+            let family = cmd.family;
+            family.add_debug_flags(cmd, self.get_dwarf_version());
+        }
+
+        if self.get_force_frame_pointer() {
+            let family = cmd.family;
+            family.add_force_frame_pointer(cmd);
+        }
+
+        if !cmd.is_like_msvc() {
+            if target.contains("i686") || target.contains("i586") {
+                cmd.args.push("-m32".into());
+            } else if target == "x86_64-unknown-linux-gnux32" {
+                cmd.args.push("-mx32".into());
+            } else if target.contains("x86_64") || target.contains("powerpc64") {
+                cmd.args.push("-m64".into());
+            }
+        }
+
+        // Target flags
+        match cmd.family {
+            ToolFamily::Clang { .. } => {
+                if !(cmd.has_internal_target_arg
+                    || (target.contains("android")
+                        && android_clang_compiler_uses_target_arg_internally(&cmd.path)))
+                {
+                    let (arch, rest) = target.split_once('-').ok_or_else(|| {
+                        Error::new(
+                            ErrorKind::InvalidTarget,
+                            format!("Invalid target `{}`: no `-` in it", target),
+                        )
+                    })?;
+
+                    if target.contains("darwin") {
+                        if let Some(arch) =
+                            map_darwin_target_from_rust_to_compiler_architecture(target)
+                        {
+                            cmd.args
+                                .push(format!("--target={}-apple-darwin", arch).into());
+                        }
+                    } else if target.contains("macabi") {
+                        if let Some(arch) =
+                            map_darwin_target_from_rust_to_compiler_architecture(target)
+                        {
+                            cmd.args
+                                .push(format!("--target={}-apple-ios-macabi", arch).into());
+                        }
+                    } else if target.contains("ios-sim") {
+                        if let Some(arch) =
+                            map_darwin_target_from_rust_to_compiler_architecture(target)
+                        {
+                            let sdk_details =
+                                apple_os_sdk_parts(AppleOs::Ios, &AppleArchSpec::Simulator(""));
+                            let deployment_target =
+                                self.apple_deployment_version(AppleOs::Ios, None, &sdk_details.sdk);
+                            cmd.args.push(
+                                format!(
+                                    "--target={}-apple-ios{}-simulator",
+                                    arch, deployment_target
+                                )
+                                .into(),
+                            );
+                        }
+                    } else if target.contains("watchos-sim") {
+                        if let Some(arch) =
+                            map_darwin_target_from_rust_to_compiler_architecture(target)
+                        {
+                            let sdk_details =
+                                apple_os_sdk_parts(AppleOs::WatchOs, &AppleArchSpec::Simulator(""));
+                            let deployment_target = self.apple_deployment_version(
+                                AppleOs::WatchOs,
+                                None,
+                                &sdk_details.sdk,
+                            );
+                            cmd.args.push(
+                                format!(
+                                    "--target={}-apple-watchos{}-simulator",
+                                    arch, deployment_target
+                                )
+                                .into(),
+                            );
+                        }
+                    } else if target.contains("tvos-sim") || target.contains("x86_64-apple-tvos") {
+                        if let Some(arch) =
+                            map_darwin_target_from_rust_to_compiler_architecture(target)
+                        {
+                            let sdk_details =
+                                apple_os_sdk_parts(AppleOs::TvOs, &AppleArchSpec::Simulator(""));
+                            let deployment_target = self.apple_deployment_version(
+                                AppleOs::TvOs,
+                                None,
+                                &sdk_details.sdk,
+                            );
+                            cmd.args.push(
+                                format!(
+                                    "--target={}-apple-tvos{}-simulator",
+                                    arch, deployment_target
+                                )
+                                .into(),
+                            );
+                        }
+                    } else if target.contains("aarch64-apple-tvos") {
+                        if let Some(arch) =
+                            map_darwin_target_from_rust_to_compiler_architecture(target)
+                        {
+                            let sdk_details =
+                                apple_os_sdk_parts(AppleOs::TvOs, &AppleArchSpec::Device(""));
+                            let deployment_target = self.apple_deployment_version(
+                                AppleOs::TvOs,
+                                None,
+                                &sdk_details.sdk,
+                            );
+                            cmd.args.push(
+                                format!("--target={}-apple-tvos{}", arch, deployment_target).into(),
+                            );
+                        }
+                    } else if target.contains("visionos-sim") {
+                        if let Some(arch) =
+                            map_darwin_target_from_rust_to_compiler_architecture(target)
+                        {
+                            let sdk_details = apple_os_sdk_parts(
+                                AppleOs::VisionOS,
+                                &AppleArchSpec::Simulator(""),
+                            );
+                            let deployment_target = self.apple_deployment_version(
+                                AppleOs::VisionOS,
+                                None,
+                                &sdk_details.sdk,
+                            );
+                            cmd.args.push(
+                                format!(
+                                    "--target={}-apple-xros{}-simulator",
+                                    arch, deployment_target
+                                )
+                                .into(),
+                            );
+                        }
+                    } else if target.contains("visionos") {
+                        if let Some(arch) =
+                            map_darwin_target_from_rust_to_compiler_architecture(target)
+                        {
+                            let sdk_details =
+                                apple_os_sdk_parts(AppleOs::VisionOS, &AppleArchSpec::Device(""));
+                            let deployment_target = self.apple_deployment_version(
+                                AppleOs::VisionOS,
+                                None,
+                                &sdk_details.sdk,
+                            );
+                            cmd.args.push(
+                                format!("--target={}-apple-xros{}", arch, deployment_target).into(),
+                            );
+                        }
+                    } else if let Ok(index) = target_info::RISCV_ARCH_MAPPING
+                        .binary_search_by_key(&arch, |(arch, _)| arch)
+                    {
+                        cmd.args.push(
+                            format!(
+                                "--target={}-{}",
+                                target_info::RISCV_ARCH_MAPPING[index].1,
+                                rest
+                            )
+                            .into(),
+                        );
+                    } else if target.contains("uefi") {
+                        if target.contains("x86_64") {
+                            cmd.args.push("--target=x86_64-unknown-windows-gnu".into());
+                        } else if target.contains("i686") {
+                            cmd.args.push("--target=i686-unknown-windows-gnu".into())
+                        } else if target.contains("aarch64") {
+                            cmd.args.push("--target=aarch64-unknown-windows-gnu".into())
+                        }
+                    } else if target.ends_with("-freebsd") {
+                        // FreeBSD only supports C++11 and above when compiling against libc++
+                        // (available from FreeBSD 10 onwards). Under FreeBSD, clang uses libc++ by
+                        // default on FreeBSD 10 and newer unless `--target` is manually passed to
+                        // the compiler, in which case its default behavior differs:
+                        // * If --target=xxx-unknown-freebsdX(.Y) is specified and X is greater than
+                        //   or equal to 10, clang++ uses libc++
+                        // * If --target=xxx-unknown-freebsd is specified (without a version),
+                        //   clang++ cannot assume libc++ is available and reverts to a default of
+                        //   libstdc++ (this behavior was changed in llvm 14).
+                        //
+                        // This breaks C++11 (or greater) builds if targeting FreeBSD with the
+                        // generic xxx-unknown-freebsd triple on clang 13 or below *without*
+                        // explicitly specifying that libc++ should be used.
+                        // When cross-compiling, we can't infer from the rust/cargo target triple
+                        // which major version of FreeBSD we are targeting, so we need to make sure
+                        // that libc++ is used (unless the user has explicitly specified otherwise).
+                        // There's no compelling reason to use a different approach when compiling
+                        // natively.
+                        if self.cpp && self.cpp_set_stdlib.is_none() {
+                            cmd.push_cc_arg("-stdlib=libc++".into());
+                        }
+
+                        cmd.push_cc_arg(format!("--target={}", target).into());
+                    } else {
+                        cmd.push_cc_arg(format!("--target={}", target).into());
+                    }
+                }
+            }
+            ToolFamily::Msvc { clang_cl } => {
+                // This is an undocumented flag from MSVC but helps with making
+                // builds more reproducible by avoiding putting timestamps into
+                // files.
+                cmd.push_cc_arg("-Brepro".into());
+
+                if clang_cl {
+                    if target.contains("x86_64") {
+                        cmd.push_cc_arg("-m64".into());
+                    } else if target.contains("86") {
+                        cmd.push_cc_arg("-m32".into());
+                        cmd.push_cc_arg("-arch:IA32".into());
+                    } else {
+                        cmd.push_cc_arg(format!("--target={}", target).into());
+                    }
+                } else if target.contains("i586") {
+                    cmd.push_cc_arg("-arch:IA32".into());
+                } else if target.contains("arm64ec") {
+                    cmd.push_cc_arg("-arm64EC".into());
+                }
+                // There is a check in corecrt.h that will generate a
+                // compilation error if
+                // _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE is
+                // not defined to 1. The check was added in Windows
+                // 8 days because only store apps were allowed on ARM.
+                // This changed with the release of Windows 10 IoT Core.
+                // The check will be going away in future versions of
+                // the SDK, but for all released versions of the
+                // Windows SDK it is required.
+                if target.contains("arm") || target.contains("thumb") {
+                    cmd.args
+                        .push("-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1".into());
+                }
+            }
+            ToolFamily::Gnu => {
+                if target.contains("darwin") {
+                    if let Some(arch) = map_darwin_target_from_rust_to_compiler_architecture(target)
+                    {
+                        cmd.args.push("-arch".into());
+                        cmd.args.push(arch.into());
+                    }
+                }
+
+                if target.contains("-kmc-solid_") {
+                    cmd.args.push("-finput-charset=utf-8".into());
+                }
+
+                if self.static_flag.is_none() {
+                    let features = self.getenv("CARGO_CFG_TARGET_FEATURE");
+                    let features = features.as_deref().unwrap_or_default();
+                    if features.to_string_lossy().contains("crt-static") {
+                        cmd.args.push("-static".into());
+                    }
+                }
+
+                // armv7 targets get to use armv7 instructions
+                if (target.starts_with("armv7") || target.starts_with("thumbv7"))
+                    && (target.contains("-linux-") || target.contains("-kmc-solid_"))
+                {
+                    cmd.args.push("-march=armv7-a".into());
+
+                    if target.ends_with("eabihf") {
+                        // lowest common denominator FPU
+                        cmd.args.push("-mfpu=vfpv3-d16".into());
+                    }
+                }
+
+                // (x86 Android doesn't say "eabi")
+                if target.contains("-androideabi") && target.contains("v7") {
+                    // -march=armv7-a handled above
+                    cmd.args.push("-mthumb".into());
+                    if !target.contains("neon") {
+                        // On android we can guarantee some extra float instructions
+                        // (specified in the android spec online)
+                        // NEON guarantees even more; see below.
+                        cmd.args.push("-mfpu=vfpv3-d16".into());
+                    }
+                    cmd.args.push("-mfloat-abi=softfp".into());
+                }
+
+                if target.contains("neon") {
+                    cmd.args.push("-mfpu=neon-vfpv4".into());
+                }
+
+                if target.starts_with("armv4t-unknown-linux-") {
+                    cmd.args.push("-march=armv4t".into());
+                    cmd.args.push("-marm".into());
+                    cmd.args.push("-mfloat-abi=soft".into());
+                }
+
+                if target.starts_with("armv5te-unknown-linux-") {
+                    cmd.args.push("-march=armv5te".into());
+                    cmd.args.push("-marm".into());
+                    cmd.args.push("-mfloat-abi=soft".into());
+                }
+
+                // For us arm == armv6 by default
+                if target.starts_with("arm-unknown-linux-") {
+                    cmd.args.push("-march=armv6".into());
+                    cmd.args.push("-marm".into());
+                    if target.ends_with("hf") {
+                        cmd.args.push("-mfpu=vfp".into());
+                    } else {
+                        cmd.args.push("-mfloat-abi=soft".into());
+                    }
+                }
+
+                // We can guarantee some settings for FRC
+                if target.starts_with("arm-frc-") {
+                    cmd.args.push("-march=armv7-a".into());
+                    cmd.args.push("-mcpu=cortex-a9".into());
+                    cmd.args.push("-mfpu=vfpv3".into());
+                    cmd.args.push("-mfloat-abi=softfp".into());
+                    cmd.args.push("-marm".into());
+                }
+
+                // Turn codegen down on i586 to avoid some instructions.
+                if target.starts_with("i586-unknown-linux-") {
+                    cmd.args.push("-march=pentium".into());
+                }
+
+                // Set codegen level for i686 correctly
+                if target.starts_with("i686-unknown-linux-") {
+                    cmd.args.push("-march=i686".into());
+                }
+
+                // Looks like `musl-gcc` makes it hard for `-m32` to make its way
+                // all the way to the linker, so we need to actually instruct the
+                // linker that we're generating 32-bit executables as well. This'll
+                // typically only be used for build scripts which transitively use
+                // these flags that try to compile executables.
+                if target == "i686-unknown-linux-musl" || target == "i586-unknown-linux-musl" {
+                    cmd.args.push("-Wl,-melf_i386".into());
+                }
+
+                if target.starts_with("thumb") {
+                    cmd.args.push("-mthumb".into());
+
+                    if target.ends_with("eabihf") {
+                        cmd.args.push("-mfloat-abi=hard".into())
+                    }
+                }
+                if target.starts_with("thumbv6m") {
+                    cmd.args.push("-march=armv6s-m".into());
+                }
+                if target.starts_with("thumbv7em") {
+                    cmd.args.push("-march=armv7e-m".into());
+
+                    if target.ends_with("eabihf") {
+                        cmd.args.push("-mfpu=fpv4-sp-d16".into())
+                    }
+                }
+                if target.starts_with("thumbv7m") {
+                    cmd.args.push("-march=armv7-m".into());
+                }
+                if target.starts_with("thumbv8m.base") {
+                    cmd.args.push("-march=armv8-m.base".into());
+                }
+                if target.starts_with("thumbv8m.main") {
+                    cmd.args.push("-march=armv8-m.main".into());
+
+                    if target.ends_with("eabihf") {
+                        cmd.args.push("-mfpu=fpv5-sp-d16".into())
+                    }
+                }
+                if target.starts_with("armebv7r") | target.starts_with("armv7r") {
+                    if target.starts_with("armeb") {
+                        cmd.args.push("-mbig-endian".into());
+                    } else {
+                        cmd.args.push("-mlittle-endian".into());
+                    }
+
+                    // ARM mode
+                    cmd.args.push("-marm".into());
+
+                    // R Profile
+                    cmd.args.push("-march=armv7-r".into());
+
+                    if target.ends_with("eabihf") {
+                        // Calling convention
+                        cmd.args.push("-mfloat-abi=hard".into());
+
+                        // lowest common denominator FPU
+                        // (see Cortex-R4 technical reference manual)
+                        cmd.args.push("-mfpu=vfpv3-d16".into())
+                    } else {
+                        // Calling convention
+                        cmd.args.push("-mfloat-abi=soft".into());
+                    }
+                }
+                if target.starts_with("armv7a") {
+                    cmd.args.push("-march=armv7-a".into());
+
+                    if target.ends_with("eabihf") {
+                        // lowest common denominator FPU
+                        cmd.args.push("-mfpu=vfpv3-d16".into());
+                    }
+                }
+                if target.starts_with("riscv32") || target.starts_with("riscv64") {
+                    // get the 32i/32imac/32imc/64gc/64imac/... part
+                    let mut parts = target.split('-');
+                    if let Some(arch) = parts.next() {
+                        let arch = &arch[5..];
+                        if arch.starts_with("64") {
+                            if target.contains("linux")
+                                | target.contains("freebsd")
+                                | target.contains("netbsd")
+                                | target.contains("linux")
+                            {
+                                cmd.args.push(("-march=rv64gc").into());
+                                cmd.args.push("-mabi=lp64d".into());
+                            } else {
+                                cmd.args.push(("-march=rv".to_owned() + arch).into());
+                                cmd.args.push("-mabi=lp64".into());
+                            }
+                        } else if arch.starts_with("32") {
+                            if target.contains("linux") {
+                                cmd.args.push(("-march=rv32gc").into());
+                                cmd.args.push("-mabi=ilp32d".into());
+                            } else {
+                                cmd.args.push(("-march=rv".to_owned() + arch).into());
+                                cmd.args.push("-mabi=ilp32".into());
+                            }
+                        } else {
+                            cmd.args.push("-mcmodel=medany".into());
+                        }
+                    }
+                }
+            }
+        }
+
+        if target.contains("-apple-") {
+            self.apple_flags(cmd)?;
+        }
+
+        if self.static_flag.unwrap_or(false) {
+            cmd.args.push("-static".into());
+        }
+        if self.shared_flag.unwrap_or(false) {
+            cmd.args.push("-shared".into());
+        }
+
+        if self.cpp {
+            match (self.cpp_set_stdlib.as_ref(), cmd.family) {
+                (None, _) => {}
+                (Some(stdlib), ToolFamily::Gnu) | (Some(stdlib), ToolFamily::Clang { .. }) => {
+                    cmd.push_cc_arg(format!("-stdlib=lib{}", stdlib).into());
+                }
+                _ => {
+                    self.cargo_output.print_warning(&format_args!("cpp_set_stdlib is specified, but the {:?} compiler does not support this option, ignored", cmd.family));
+                }
+            }
+        }
+
+        Ok(())
+    }
+
+    fn has_flags(&self) -> bool {
+        let flags_env_var_name = if self.cpp { "CXXFLAGS" } else { "CFLAGS" };
+        let flags_env_var_value = self.getenv_with_target_prefixes(flags_env_var_name);
+        flags_env_var_value.is_ok()
+    }
+
+    fn msvc_macro_assembler(&self) -> Result<(Command, &'static str), Error> {
+        let target = self.get_target()?;
+        let tool = if target.contains("x86_64") {
+            "ml64.exe"
+        } else if target.contains("arm") {
+            "armasm.exe"
+        } else if target.contains("aarch64") {
+            "armasm64.exe"
+        } else {
+            "ml.exe"
+        };
+        let mut cmd = self
+            .windows_registry_find(&target, tool)
+            .unwrap_or_else(|| self.cmd(tool));
+        cmd.arg("-nologo"); // undocumented, yet working with armasm[64]
+        for directory in self.include_directories.iter() {
+            cmd.arg("-I").arg(&**directory);
+        }
+        if target.contains("aarch64") || target.contains("arm") {
+            if self.get_debug() {
+                cmd.arg("-g");
+            }
+
+            for (key, value) in self.definitions.iter() {
+                cmd.arg("-PreDefine");
+                if let Some(ref value) = *value {
+                    if let Ok(i) = value.parse::<i32>() {
+                        cmd.arg(format!("{} SETA {}", key, i));
+                    } else if value.starts_with('"') && value.ends_with('"') {
+                        cmd.arg(format!("{} SETS {}", key, value));
+                    } else {
+                        cmd.arg(format!("{} SETS \"{}\"", key, value));
+                    }
+                } else {
+                    cmd.arg(format!("{} SETL {}", key, "{TRUE}"));
+                }
+            }
+        } else {
+            if self.get_debug() {
+                cmd.arg("-Zi");
+            }
+
+            for (key, value) in self.definitions.iter() {
+                if let Some(ref value) = *value {
+                    cmd.arg(format!("-D{}={}", key, value));
+                } else {
+                    cmd.arg(format!("-D{}", key));
+                }
+            }
+        }
+
+        if target.contains("i686") || target.contains("i586") {
+            cmd.arg("-safeseh");
+        }
+
+        Ok((cmd, tool))
+    }
+
+    fn assemble(&self, lib_name: &str, dst: &Path, objs: &[Object]) -> Result<(), Error> {
+        // Delete the destination if it exists as we want to
+        // create on the first iteration instead of appending.
+        let _ = fs::remove_file(dst);
+
+        // Add objects to the archive in limited-length batches. This helps keep
+        // the length of the command line within a reasonable length to avoid
+        // blowing system limits on limiting platforms like Windows.
+        let objs: Vec<_> = objs
+            .iter()
+            .map(|o| o.dst.as_path())
+            .chain(self.objects.iter().map(std::ops::Deref::deref))
+            .collect();
+        for chunk in objs.chunks(100) {
+            self.assemble_progressive(dst, chunk)?;
+        }
+
+        if self.cuda && self.cuda_file_count() > 0 {
+            // Link the device-side code and add it to the target library,
+            // so that non-CUDA linker can link the final binary.
+
+            let out_dir = self.get_out_dir()?;
+            let dlink = out_dir.join(lib_name.to_owned() + "_dlink.o");
+            let mut nvcc = self.get_compiler().to_command();
+            nvcc.arg("--device-link").arg("-o").arg(&dlink).arg(dst);
+            run(&mut nvcc, "nvcc", &self.cargo_output)?;
+            self.assemble_progressive(dst, &[dlink.as_path()])?;
+        }
+
+        let target = self.get_target()?;
+        if target.contains("msvc") {
+            // The Rust compiler will look for libfoo.a and foo.lib, but the
+            // MSVC linker will also be passed foo.lib, so be sure that both
+            // exist for now.
+
+            let lib_dst = dst.with_file_name(format!("{}.lib", lib_name));
+            let _ = fs::remove_file(&lib_dst);
+            match fs::hard_link(dst, &lib_dst).or_else(|_| {
+                // if hard-link fails, just copy (ignoring the number of bytes written)
+                fs::copy(dst, &lib_dst).map(|_| ())
+            }) {
+                Ok(_) => (),
+                Err(_) => {
+                    return Err(Error::new(
+                        ErrorKind::IOError,
+                        "Could not copy or create a hard-link to the generated lib file.",
+                    ));
+                }
+            };
+        } else {
+            // Non-msvc targets (those using `ar`) need a separate step to add
+            // the symbol table to archives since our construction command of
+            // `cq` doesn't add it for us.
+            let (mut ar, cmd, _any_flags) = self.get_ar()?;
+
+            // NOTE: We add `s` even if flags were passed using $ARFLAGS/ar_flag, because `s`
+            // here represents a _mode_, not an arbitrary flag. Further discussion of this choice
+            // can be seen in https://github.com/rust-lang/cc-rs/pull/763.
+            run(ar.arg("s").arg(dst), &cmd, &self.cargo_output)?;
+        }
+
+        Ok(())
+    }
+
+    fn assemble_progressive(&self, dst: &Path, objs: &[&Path]) -> Result<(), Error> {
+        let target = self.get_target()?;
+
+        let (mut cmd, program, any_flags) = self.get_ar()?;
+        if target.contains("msvc") && !program.to_string_lossy().contains("llvm-ar") {
+            // NOTE: -out: here is an I/O flag, and so must be included even if $ARFLAGS/ar_flag is
+            // in use. -nologo on the other hand is just a regular flag, and one that we'll skip if
+            // the caller has explicitly dictated the flags they want. See
+            // https://github.com/rust-lang/cc-rs/pull/763 for further discussion.
+            let mut out = OsString::from("-out:");
+            out.push(dst);
+            cmd.arg(out);
+            if !any_flags {
+                cmd.arg("-nologo");
+            }
+            // If the library file already exists, add the library name
+            // as an argument to let lib.exe know we are appending the objs.
+            if dst.exists() {
+                cmd.arg(dst);
+            }
+            cmd.args(objs);
+            run(&mut cmd, &program, &self.cargo_output)?;
+        } else {
+            // Set an environment variable to tell the OSX archiver to ensure
+            // that all dates listed in the archive are zero, improving
+            // determinism of builds. AFAIK there's not really official
+            // documentation of this but there's a lot of references to it if
+            // you search google.
+            //
+            // You can reproduce this locally on a mac with:
+            //
+            //      $ touch foo.c
+            //      $ cc -c foo.c -o foo.o
+            //
+            //      # Notice that these two checksums are different
+            //      $ ar crus libfoo1.a foo.o && sleep 2 && ar crus libfoo2.a foo.o
+            //      $ md5sum libfoo*.a
+            //
+            //      # Notice that these two checksums are the same
+            //      $ export ZERO_AR_DATE=1
+            //      $ ar crus libfoo1.a foo.o && sleep 2 && touch foo.o && ar crus libfoo2.a foo.o
+            //      $ md5sum libfoo*.a
+            //
+            // In any case if this doesn't end up getting read, it shouldn't
+            // cause that many issues!
+            cmd.env("ZERO_AR_DATE", "1");
+
+            // NOTE: We add cq here regardless of whether $ARFLAGS/ar_flag have been used because
+            // it dictates the _mode_ ar runs in, which the setter of $ARFLAGS/ar_flag can't
+            // dictate. See https://github.com/rust-lang/cc-rs/pull/763 for further discussion.
+            run(
+                cmd.arg("cq").arg(dst).args(objs),
+                &program,
+                &self.cargo_output,
+            )?;
+        }
+
+        Ok(())
+    }
+
+    fn apple_flags(&self, cmd: &mut Tool) -> Result<(), Error> {
+        let target = self.get_target()?;
+        let os = if target.contains("-darwin") {
+            AppleOs::MacOs
+        } else if target.contains("-watchos") {
+            AppleOs::WatchOs
+        } else if target.contains("-tvos") {
+            AppleOs::TvOs
+        } else if target.contains("-visionos") {
+            AppleOs::VisionOS
+        } else {
+            AppleOs::Ios
+        };
+        let is_mac = matches!(os, AppleOs::MacOs);
+
+        let arch_str = target.split('-').nth(0).ok_or_else(|| {
+            Error::new(
+                ErrorKind::ArchitectureInvalid,
+                format!("Unknown architecture for {:?} target.", os),
+            )
+        })?;
+
+        let is_catalyst = match target.split('-').nth(3) {
+            Some(v) => v == "macabi",
+            None => false,
+        };
+
+        let is_arm_sim = match target.split('-').nth(3) {
+            Some(v) => v == "sim",
+            None => false,
+        };
+
+        let arch = if is_mac {
+            match arch_str {
+                "i686" => AppleArchSpec::Device("-m32"),
+                "x86_64" | "x86_64h" | "aarch64" => AppleArchSpec::Device("-m64"),
+                _ => {
+                    return Err(Error::new(
+                        ErrorKind::ArchitectureInvalid,
+                        "Unknown architecture for macOS target.",
+                    ));
+                }
+            }
+        } else if is_catalyst {
+            match arch_str {
+                "arm64e" => AppleArchSpec::Catalyst("arm64e"),
+                "arm64" | "aarch64" => AppleArchSpec::Catalyst("arm64"),
+                "x86_64" | "x86_64h" => AppleArchSpec::Catalyst("-m64"),
+                _ => {
+                    return Err(Error::new(
+                        ErrorKind::ArchitectureInvalid,
+                        "Unknown architecture for iOS target.",
+                    ));
+                }
+            }
+        } else if is_arm_sim {
+            match arch_str {
+                "arm64" | "aarch64" => AppleArchSpec::Simulator("arm64"),
+                "x86_64" | "x86_64h" => AppleArchSpec::Simulator("-m64"),
+                _ => {
+                    return Err(Error::new(
+                        ErrorKind::ArchitectureInvalid,
+                        "Unknown architecture for simulator target.",
+                    ));
+                }
+            }
+        } else {
+            match arch_str {
+                "arm" | "armv7" | "thumbv7" => AppleArchSpec::Device("armv7"),
+                "armv7k" => AppleArchSpec::Device("armv7k"),
+                "armv7s" | "thumbv7s" => AppleArchSpec::Device("armv7s"),
+                "arm64e" => AppleArchSpec::Device("arm64e"),
+                "arm64" | "aarch64" => AppleArchSpec::Device("arm64"),
+                "arm64_32" => AppleArchSpec::Device("arm64_32"),
+                "i386" | "i686" => AppleArchSpec::Simulator("-m32"),
+                "x86_64" | "x86_64h" => AppleArchSpec::Simulator("-m64"),
+                _ => {
+                    return Err(Error::new(
+                        ErrorKind::ArchitectureInvalid,
+                        format!("Unknown architecture for {:?} target.", os),
+                    ));
+                }
+            }
+        };
+
+        let sdk_details = apple_os_sdk_parts(os, &arch);
+        let min_version = self.apple_deployment_version(os, Some(arch_str), &sdk_details.sdk);
+
+        match arch {
+            AppleArchSpec::Device(_) if is_mac => {
+                cmd.args
+                    .push(format!("-mmacosx-version-min={}", min_version).into());
+            }
+            AppleArchSpec::Device(arch) => {
+                cmd.args.push("-arch".into());
+                cmd.args.push(arch.into());
+                // `-mxros-version-min` does not exist
+                // https://github.com/llvm/llvm-project/issues/88271
+                if os != AppleOs::VisionOS {
+                    cmd.args.push(
+                        format!("-m{}os-version-min={}", sdk_details.sdk_prefix, min_version)
+                            .into(),
+                    );
+                }
+            }
+            AppleArchSpec::Simulator(arch) => {
+                if arch.starts_with('-') {
+                    // -m32 or -m64
+                    cmd.args.push(arch.into());
+                } else {
+                    cmd.args.push("-arch".into());
+                    cmd.args.push(arch.into());
+                }
+                if os != AppleOs::VisionOS {
+                    cmd.args.push(
+                        format!(
+                            "-m{}simulator-version-min={}",
+                            sdk_details.sim_prefix, min_version
+                        )
+                        .into(),
+                    );
+                }
+            }
+            AppleArchSpec::Catalyst(_) => {}
+        };
+
+        // AppleClang sometimes requires sysroot even for darwin
+        if cmd.is_xctoolchain_clang() || !target.ends_with("-darwin") {
+            self.cargo_output.print_metadata(&format_args!(
+                "Detecting {:?} SDK path for {}",
+                os, sdk_details.sdk
+            ));
+            let sdk_path = self.apple_sdk_root(&sdk_details.sdk)?;
+
+            cmd.args.push("-isysroot".into());
+            cmd.args.push(OsStr::new(&sdk_path).to_owned());
+
+            if let AppleArchSpec::Catalyst(_) = arch {
+                // Mac Catalyst uses the macOS SDK, but to compile against and
+                // link to iOS-specific frameworks, we should have the support
+                // library stubs in the include and library search path.
+                let ios_support = Path::new(&sdk_path).join("System/iOSSupport");
+
+                cmd.args.extend([
+                    // Header search path
+                    OsString::from("-isystem"),
+                    ios_support.join("usr/include").into(),
+                    // Framework header search path
+                    OsString::from("-iframework"),
+                    ios_support.join("System/Library/Frameworks").into(),
+                    // Library search path
+                    {
+                        let mut s = OsString::from("-L");
+                        s.push(ios_support.join("usr/lib"));
+                        s
+                    },
+                    // Framework linker search path
+                    {
+                        // Technically, we _could_ avoid emitting `-F`, as
+                        // `-iframework` implies it, but let's keep it in for
+                        // clarity.
+                        let mut s = OsString::from("-F");
+                        s.push(ios_support.join("System/Library/Frameworks"));
+                        s
+                    },
+                ]);
+            }
+        }
+
+        Ok(())
+    }
+
+    fn cmd<P: AsRef<OsStr>>(&self, prog: P) -> Command {
+        let mut cmd = Command::new(prog);
+        for (a, b) in self.env.iter() {
+            cmd.env(a, b);
+        }
+        cmd
+    }
+
+    fn get_base_compiler(&self) -> Result<Tool, Error> {
+        let out_dir = self.get_out_dir().ok();
+        let out_dir = out_dir.as_deref();
+
+        if let Some(c) = &self.compiler {
+            return Ok(Tool::new(
+                (**c).to_owned(),
+                &self.cached_compiler_family,
+                &self.cargo_output,
+                out_dir,
+            ));
+        }
+        let host = self.get_host()?;
+        let target = self.get_target()?;
+        let target = &*target;
+        let (env, msvc, gnu, traditional, clang) = if self.cpp {
+            ("CXX", "cl.exe", "g++", "c++", "clang++")
+        } else {
+            ("CC", "cl.exe", "gcc", "cc", "clang")
+        };
+
+        // On historical Solaris systems, "cc" may have been Sun Studio, which
+        // is not flag-compatible with "gcc".  This history casts a long shadow,
+        // and many modern illumos distributions today ship GCC as "gcc" without
+        // also making it available as "cc".
+        let default = if host.contains("solaris") || host.contains("illumos") {
+            gnu
+        } else {
+            traditional
+        };
+
+        let cl_exe = self.windows_registry_find_tool(target, "cl.exe");
+
+        let tool_opt: Option<Tool> = self
+            .env_tool(env)
+            .map(|(tool, wrapper, args)| {
+                // find the driver mode, if any
+                const DRIVER_MODE: &str = "--driver-mode=";
+                let driver_mode = args
+                    .iter()
+                    .find(|a| a.starts_with(DRIVER_MODE))
+                    .map(|a| &a[DRIVER_MODE.len()..]);
+                // Chop off leading/trailing whitespace to work around
+                // semi-buggy build scripts which are shared in
+                // makefiles/configure scripts (where spaces are far more
+                // lenient)
+                let mut t = Tool::with_clang_driver(
+                    tool,
+                    driver_mode,
+                    &self.cached_compiler_family,
+                    &self.cargo_output,
+                    out_dir,
+                );
+                if let Some(cc_wrapper) = wrapper {
+                    t.cc_wrapper_path = Some(Path::new(&cc_wrapper).to_owned());
+                }
+                for arg in args {
+                    t.cc_wrapper_args.push(arg.into());
+                }
+                t
+            })
+            .or_else(|| {
+                if target.contains("emscripten") {
+                    let tool = if self.cpp { "em++" } else { "emcc" };
+                    // Windows uses bat file so we have to be a bit more specific
+                    if cfg!(windows) {
+                        let mut t = Tool::with_family(
+                            PathBuf::from("cmd"),
+                            ToolFamily::Clang { zig_cc: false },
+                        );
+                        t.args.push("/c".into());
+                        t.args.push(format!("{}.bat", tool).into());
+                        Some(t)
+                    } else {
+                        Some(Tool::new(
+                            PathBuf::from(tool),
+                            &self.cached_compiler_family,
+                            &self.cargo_output,
+                            out_dir,
+                        ))
+                    }
+                } else {
+                    None
+                }
+            })
+            .or_else(|| cl_exe.clone());
+
+        let tool = match tool_opt {
+            Some(t) => t,
+            None => {
+                let compiler = if host.contains("windows") && target.contains("windows") {
+                    if target.contains("msvc") {
+                        msvc.to_string()
+                    } else {
+                        let cc = if target.contains("llvm") { clang } else { gnu };
+                        format!("{}.exe", cc)
+                    }
+                } else if target.contains("apple-ios")
+                    | target.contains("apple-watchos")
+                    | target.contains("apple-tvos")
+                    | target.contains("apple-visionos")
+                {
+                    clang.to_string()
+                } else if target.contains("android") {
+                    autodetect_android_compiler(target, &host, gnu, clang)
+                } else if target.contains("cloudabi") {
+                    format!("{}-{}", target, traditional)
+                } else if Build::is_wasi_target(target) {
+                    if self.cpp {
+                        "clang++".to_string()
+                    } else {
+                        "clang".to_string()
+                    }
+                } else if target.contains("vxworks") {
+                    if self.cpp {
+                        "wr-c++".to_string()
+                    } else {
+                        "wr-cc".to_string()
+                    }
+                } else if target.starts_with("armv7a-kmc-solid_") {
+                    format!("arm-kmc-eabi-{}", gnu)
+                } else if target.starts_with("aarch64-kmc-solid_") {
+                    format!("aarch64-kmc-elf-{}", gnu)
+                } else if &*self.get_host()? != target {
+                    let prefix = self.prefix_for_target(target);
+                    match prefix {
+                        Some(prefix) => {
+                            let cc = if target.contains("llvm") { clang } else { gnu };
+                            format!("{}-{}", prefix, cc)
+                        }
+                        None => default.to_string(),
+                    }
+                } else {
+                    default.to_string()
+                };
+
+                let mut t = Tool::new(
+                    PathBuf::from(compiler),
+                    &self.cached_compiler_family,
+                    &self.cargo_output,
+                    out_dir,
+                );
+                if let Some(cc_wrapper) = self.rustc_wrapper_fallback() {
+                    t.cc_wrapper_path = Some(Path::new(&cc_wrapper).to_owned());
+                }
+                t
+            }
+        };
+
+        let mut tool = if self.cuda {
+            assert!(
+                tool.args.is_empty(),
+                "CUDA compilation currently assumes empty pre-existing args"
+            );
+            let nvcc = match self.getenv_with_target_prefixes("NVCC") {
+                Err(_) => PathBuf::from("nvcc"),
+                Ok(nvcc) => PathBuf::from(&*nvcc),
+            };
+            let mut nvcc_tool = Tool::with_features(
+                nvcc,
+                None,
+                self.cuda,
+                &self.cached_compiler_family,
+                &self.cargo_output,
+                out_dir,
+            );
+            if self.ccbin {
+                nvcc_tool
+                    .args
+                    .push(format!("-ccbin={}", tool.path.display()).into());
+            }
+            nvcc_tool.family = tool.family;
+            nvcc_tool
+        } else {
+            tool
+        };
+
+        // New "standalone" C/C++ cross-compiler executables from recent Android NDK
+        // are just shell scripts that call main clang binary (from Android NDK) with
+        // proper `--target` argument.
+        //
+        // For example, armv7a-linux-androideabi16-clang passes
+        // `--target=armv7a-linux-androideabi16` to clang.
+        //
+        // As the shell script calls the main clang binary, the command line limit length
+        // on Windows is restricted to around 8k characters instead of around 32k characters.
+        // To remove this limit, we call the main clang binary directly and construct the
+        // `--target=` ourselves.
+        if host.contains("windows") && android_clang_compiler_uses_target_arg_internally(&tool.path)
+        {
+            if let Some(path) = tool.path.file_name() {
+                let file_name = path.to_str().unwrap().to_owned();
+                let (target, clang) = file_name.split_at(file_name.rfind('-').unwrap());
+
+                tool.has_internal_target_arg = true;
+                tool.path.set_file_name(clang.trim_start_matches('-'));
+                tool.path.set_extension("exe");
+                tool.args.push(format!("--target={}", target).into());
+
+                // Additionally, shell scripts for target i686-linux-android versions 16 to 24
+                // pass the `mstackrealign` option so we do that here as well.
+                if target.contains("i686-linux-android") {
+                    let (_, version) = target.split_at(target.rfind('d').unwrap() + 1);
+                    if let Ok(version) = version.parse::<u32>() {
+                        if version > 15 && version < 25 {
+                            tool.args.push("-mstackrealign".into());
+                        }
+                    }
+                }
+            };
+        }
+
+        // If we found `cl.exe` in our environment, the tool we're returning is
+        // an MSVC-like tool, *and* no env vars were set then set env vars for
+        // the tool that we're returning.
+        //
+        // Env vars are needed for things like `link.exe` being put into PATH as
+        // well as header include paths sometimes. These paths are automatically
+        // included by default but if the `CC` or `CXX` env vars are set these
+        // won't be used. This'll ensure that when the env vars are used to
+        // configure for invocations like `clang-cl` we still get a "works out
+        // of the box" experience.
+        if let Some(cl_exe) = cl_exe {
+            if tool.family == (ToolFamily::Msvc { clang_cl: true })
+                && tool.env.is_empty()
+                && target.contains("msvc")
+            {
+                for (k, v) in cl_exe.env.iter() {
+                    tool.env.push((k.to_owned(), v.to_owned()));
+                }
+            }
+        }
+
+        if target.contains("msvc") && tool.family == ToolFamily::Gnu {
+            self.cargo_output
+                .print_warning(&"GNU compiler is not supported for this target");
+        }
+
+        Ok(tool)
+    }
+
+    /// Returns a fallback `cc_compiler_wrapper` by introspecting `RUSTC_WRAPPER`
+    fn rustc_wrapper_fallback(&self) -> Option<Arc<OsStr>> {
+        // No explicit CC wrapper was detected, but check if RUSTC_WRAPPER
+        // is defined and is a build accelerator that is compatible with
+        // C/C++ compilers (e.g. sccache)
+        const VALID_WRAPPERS: &[&str] = &["sccache", "cachepot"];
+
+        let rustc_wrapper = self.getenv("RUSTC_WRAPPER")?;
+        let wrapper_path = Path::new(&rustc_wrapper);
+        let wrapper_stem = wrapper_path.file_stem()?;
+
+        if VALID_WRAPPERS.contains(&wrapper_stem.to_str()?) {
+            Some(rustc_wrapper)
+        } else {
+            None
+        }
+    }
+
+    /// Returns compiler path, optional modifier name from whitelist, and arguments vec
+    fn env_tool(&self, name: &str) -> Option<(PathBuf, Option<Arc<OsStr>>, Vec<String>)> {
+        let tool = self.getenv_with_target_prefixes(name).ok()?;
+        let tool = tool.to_string_lossy();
+        let tool = tool.trim();
+
+        if tool.is_empty() {
+            return None;
+        }
+
+        // If this is an exact path on the filesystem we don't want to do any
+        // interpretation at all, just pass it on through. This'll hopefully get
+        // us to support spaces-in-paths.
+        if Path::new(tool).exists() {
+            return Some((
+                PathBuf::from(tool),
+                self.rustc_wrapper_fallback(),
+                Vec::new(),
+            ));
+        }
+
+        // Ok now we want to handle a couple of scenarios. We'll assume from
+        // here on out that spaces are splitting separate arguments. Two major
+        // features we want to support are:
+        //
+        //      CC='sccache cc'
+        //
+        // aka using `sccache` or any other wrapper/caching-like-thing for
+        // compilations. We want to know what the actual compiler is still,
+        // though, because our `Tool` API support introspection of it to see
+        // what compiler is in use.
+        //
+        // additionally we want to support
+        //
+        //      CC='cc -flag'
+        //
+        // where the CC env var is used to also pass default flags to the C
+        // compiler.
+        //
+        // It's true that everything here is a bit of a pain, but apparently if
+        // you're not literally make or bash then you get a lot of bug reports.
+        let known_wrappers = ["ccache", "distcc", "sccache", "icecc", "cachepot"];
+
+        let mut parts = tool.split_whitespace();
+        let maybe_wrapper = match parts.next() {
+            Some(s) => s,
+            None => return None,
+        };
+
+        let file_stem = Path::new(maybe_wrapper).file_stem()?.to_str()?;
+        if known_wrappers.contains(&file_stem) {
+            if let Some(compiler) = parts.next() {
+                return Some((
+                    compiler.into(),
+                    Some(Arc::<OsStr>::from(OsStr::new(&maybe_wrapper))),
+                    parts.map(|s| s.to_string()).collect(),
+                ));
+            }
+        }
+
+        Some((
+            maybe_wrapper.into(),
+            self.rustc_wrapper_fallback(),
+            parts.map(|s| s.to_string()).collect(),
+        ))
+    }
+
+    /// Returns the C++ standard library:
+    /// 1. If [`cpp_link_stdlib`](cc::Build::cpp_link_stdlib) is set, uses its value.
+    /// 2. Else if the `CXXSTDLIB` environment variable is set, uses its value.
+    /// 3. Else the default is `libc++` for OS X and BSDs, `libc++_shared` for Android,
+    ///    `None` for MSVC and `libstdc++` for anything else.
+    fn get_cpp_link_stdlib(&self) -> Result<Option<Cow<'_, Path>>, Error> {
+        match &self.cpp_link_stdlib {
+            Some(s) => Ok(s.as_deref().map(Path::new).map(Cow::Borrowed)),
+            None => {
+                if let Ok(stdlib) = self.getenv_with_target_prefixes("CXXSTDLIB") {
+                    if stdlib.is_empty() {
+                        Ok(None)
+                    } else {
+                        Ok(Some(Cow::Owned(Path::new(&stdlib).to_owned())))
+                    }
+                } else {
+                    let target = self.get_target()?;
+                    if target.contains("msvc") {
+                        Ok(None)
+                    } else if target.contains("apple")
+                        | target.contains("freebsd")
+                        | target.contains("openbsd")
+                        | target.contains("aix")
+                        | target.contains("linux-ohos")
+                        | target.contains("-wasi")
+                    {
+                        Ok(Some(Cow::Borrowed(Path::new("c++"))))
+                    } else if target.contains("android") {
+                        Ok(Some(Cow::Borrowed(Path::new("c++_shared"))))
+                    } else {
+                        Ok(Some(Cow::Borrowed(Path::new("stdc++"))))
+                    }
+                }
+            }
+        }
+    }
+
+    fn get_ar(&self) -> Result<(Command, PathBuf, bool), Error> {
+        self.try_get_archiver_and_flags()
+    }
+
+    /// Get the archiver (ar) that's in use for this configuration.
+    ///
+    /// You can use [`Command::get_program`] to get just the path to the command.
+    ///
+    /// This method will take into account all configuration such as debug
+    /// information, optimization level, include directories, defines, etc.
+    /// Additionally, the compiler binary in use follows the standard
+    /// conventions for this path, e.g. looking at the explicitly set compiler,
+    /// environment variables (a number of which are inspected here), and then
+    /// falling back to the default configuration.
+    ///
+    /// # Panics
+    ///
+    /// Panics if an error occurred while determining the architecture.
+    pub fn get_archiver(&self) -> Command {
+        match self.try_get_archiver() {
+            Ok(tool) => tool,
+            Err(e) => fail(&e.message),
+        }
+    }
+
+    /// Get the archiver that's in use for this configuration.
+    ///
+    /// This will return a result instead of panicking;
+    /// see [`Self::get_archiver`] for the complete description.
+    pub fn try_get_archiver(&self) -> Result<Command, Error> {
+        Ok(self.try_get_archiver_and_flags()?.0)
+    }
+
+    fn try_get_archiver_and_flags(&self) -> Result<(Command, PathBuf, bool), Error> {
+        let (mut cmd, name) = self.get_base_archiver()?;
+        let mut any_flags = false;
+        if let Ok(flags) = self.envflags("ARFLAGS") {
+            any_flags |= !flags.is_empty();
+            cmd.args(flags);
+        }
+        for flag in &self.ar_flags {
+            any_flags = true;
+            cmd.arg(&**flag);
+        }
+        Ok((cmd, name, any_flags))
+    }
+
+    fn get_base_archiver(&self) -> Result<(Command, PathBuf), Error> {
+        if let Some(ref a) = self.archiver {
+            let archiver = &**a;
+            return Ok((self.cmd(archiver), archiver.into()));
+        }
+
+        self.get_base_archiver_variant("AR", "ar")
+    }
+
+    /// Get the ranlib that's in use for this configuration.
+    ///
+    /// You can use [`Command::get_program`] to get just the path to the command.
+    ///
+    /// This method will take into account all configuration such as debug
+    /// information, optimization level, include directories, defines, etc.
+    /// Additionally, the compiler binary in use follows the standard
+    /// conventions for this path, e.g. looking at the explicitly set compiler,
+    /// environment variables (a number of which are inspected here), and then
+    /// falling back to the default configuration.
+    ///
+    /// # Panics
+    ///
+    /// Panics if an error occurred while determining the architecture.
+    pub fn get_ranlib(&self) -> Command {
+        match self.try_get_ranlib() {
+            Ok(tool) => tool,
+            Err(e) => fail(&e.message),
+        }
+    }
+
+    /// Get the ranlib that's in use for this configuration.
+    ///
+    /// This will return a result instead of panicking;
+    /// see [`Self::get_ranlib`] for the complete description.
+    pub fn try_get_ranlib(&self) -> Result<Command, Error> {
+        let mut cmd = self.get_base_ranlib()?;
+        if let Ok(flags) = self.envflags("RANLIBFLAGS") {
+            cmd.args(flags);
+        }
+        Ok(cmd)
+    }
+
+    fn get_base_ranlib(&self) -> Result<Command, Error> {
+        if let Some(ref r) = self.ranlib {
+            return Ok(self.cmd(&**r));
+        }
+
+        Ok(self.get_base_archiver_variant("RANLIB", "ranlib")?.0)
+    }
+
+    fn get_base_archiver_variant(
+        &self,
+        env: &str,
+        tool: &str,
+    ) -> Result<(Command, PathBuf), Error> {
+        let target = self.get_target()?;
+        let mut name = PathBuf::new();
+        let tool_opt: Option<Command> = self
+            .env_tool(env)
+            .map(|(tool, _wrapper, args)| {
+                name.clone_from(&tool);
+                let mut cmd = self.cmd(tool);
+                cmd.args(args);
+                cmd
+            })
+            .or_else(|| {
+                if target.contains("emscripten") {
+                    // Windows use bat files so we have to be a bit more specific
+                    if cfg!(windows) {
+                        let mut cmd = self.cmd("cmd");
+                        name = format!("em{}.bat", tool).into();
+                        cmd.arg("/c").arg(&name);
+                        Some(cmd)
+                    } else {
+                        name = format!("em{}", tool).into();
+                        Some(self.cmd(&name))
+                    }
+                } else if target.starts_with("wasm32") {
+                    // Formally speaking one should be able to use this approach,
+                    // parsing -print-search-dirs output, to cover all clang targets,
+                    // including Android SDKs and other cross-compilation scenarios...
+                    // And even extend it to gcc targets by searching for "ar" instead
+                    // of "llvm-ar"...
+                    let compiler = self.get_base_compiler().ok()?;
+                    if compiler.is_like_clang() {
+                        name = format!("llvm-{}", tool).into();
+                        self.search_programs(
+                            &mut self.cmd(&compiler.path),
+                            &name,
+                            &self.cargo_output,
+                        )
+                        .map(|name| self.cmd(name))
+                    } else {
+                        None
+                    }
+                } else {
+                    None
+                }
+            });
+
+        let default = tool.to_string();
+        let tool = match tool_opt {
+            Some(t) => t,
+            None => {
+                if target.contains("android") {
+                    name = format!("llvm-{}", tool).into();
+                    match Command::new(&name).arg("--version").status() {
+                        Ok(status) if status.success() => (),
+                        _ => name = format!("{}-{}", target.replace("armv7", "arm"), tool).into(),
+                    }
+                    self.cmd(&name)
+                } else if target.contains("msvc") {
+                    // NOTE: There isn't really a ranlib on msvc, so arguably we should return
+                    // `None` somehow here. But in general, callers will already have to be aware
+                    // of not running ranlib on Windows anyway, so it feels okay to return lib.exe
+                    // here.
+
+                    let compiler = self.get_base_compiler()?;
+                    let mut lib = String::new();
+                    if compiler.family == (ToolFamily::Msvc { clang_cl: true }) {
+                        // See if there is 'llvm-lib' next to 'clang-cl'
+                        // Another possibility could be to see if there is 'clang'
+                        // next to 'clang-cl' and use 'search_programs()' to locate
+                        // 'llvm-lib'. This is because 'clang-cl' doesn't support
+                        // the -print-search-dirs option.
+                        if let Some(mut cmd) = self.which(&compiler.path, None) {
+                            cmd.pop();
+                            cmd.push("llvm-lib.exe");
+                            if let Some(llvm_lib) = self.which(&cmd, None) {
+                                llvm_lib.to_str().unwrap().clone_into(&mut lib);
+                            }
+                        }
+                    }
+
+                    if lib.is_empty() {
+                        name = PathBuf::from("lib.exe");
+                        let mut cmd = match self.windows_registry_find(&target, "lib.exe") {
+                            Some(t) => t,
+                            None => self.cmd("lib.exe"),
+                        };
+                        if target.contains("arm64ec") {
+                            cmd.arg("/machine:arm64ec");
+                        }
+                        cmd
+                    } else {
+                        name = lib.into();
+                        self.cmd(&name)
+                    }
+                } else if target.contains("illumos") {
+                    // The default 'ar' on illumos uses a non-standard flags,
+                    // but the OS comes bundled with a GNU-compatible variant.
+                    //
+                    // Use the GNU-variant to match other Unix systems.
+                    name = format!("g{}", tool).into();
+                    self.cmd(&name)
+                } else if self.get_host()? != target {
+                    match self.prefix_for_target(&target) {
+                        Some(p) => {
+                            // GCC uses $target-gcc-ar, whereas binutils uses $target-ar -- try both.
+                            // Prefer -ar if it exists, as builds of `-gcc-ar` have been observed to be
+                            // outright broken (such as when targeting freebsd with `--disable-lto`
+                            // toolchain where the archiver attempts to load the LTO plugin anyway but
+                            // fails to find one).
+                            //
+                            // The same applies to ranlib.
+                            let mut chosen = default;
+                            for &infix in &["", "-gcc"] {
+                                let target_p = format!("{}{}-{}", p, infix, tool);
+                                if Command::new(&target_p).output().is_ok() {
+                                    chosen = target_p;
+                                    break;
+                                }
+                            }
+                            name = chosen.into();
+                            self.cmd(&name)
+                        }
+                        None => {
+                            name = default.into();
+                            self.cmd(&name)
+                        }
+                    }
+                } else {
+                    name = default.into();
+                    self.cmd(&name)
+                }
+            }
+        };
+
+        Ok((tool, name))
+    }
+
+    fn prefix_for_target(&self, target: &str) -> Option<Cow<'static, str>> {
+        // CROSS_COMPILE is of the form: "arm-linux-gnueabi-"
+        self.getenv("CROSS_COMPILE")
+            .as_deref()
+            .map(|s| s.to_string_lossy().trim_end_matches('-').to_owned())
+            .map(Cow::Owned)
+            .or_else(|| {
+                // Put aside RUSTC_LINKER's prefix to be used as second choice, after CROSS_COMPILE
+                self.getenv("RUSTC_LINKER").and_then(|var| {
+                    var.to_string_lossy()
+                        .strip_suffix("-gcc")
+                        .map(str::to_string)
+                        .map(Cow::Owned)
+                })
+            })
+            .or_else(|| {
+                match target {
+                    // Note: there is no `aarch64-pc-windows-gnu` target, only `-gnullvm`
+                    "aarch64-pc-windows-gnullvm" => Some("aarch64-w64-mingw32"),
+                    "aarch64-uwp-windows-gnu" => Some("aarch64-w64-mingw32"),
+                    "aarch64-unknown-linux-gnu" => Some("aarch64-linux-gnu"),
+                    "aarch64-unknown-linux-musl" => Some("aarch64-linux-musl"),
+                    "aarch64-unknown-netbsd" => Some("aarch64--netbsd"),
+                    "arm-unknown-linux-gnueabi" => Some("arm-linux-gnueabi"),
+                    "armv4t-unknown-linux-gnueabi" => Some("arm-linux-gnueabi"),
+                    "armv5te-unknown-linux-gnueabi" => Some("arm-linux-gnueabi"),
+                    "armv5te-unknown-linux-musleabi" => Some("arm-linux-gnueabi"),
+                    "arm-frc-linux-gnueabi" => Some("arm-frc-linux-gnueabi"),
+                    "arm-unknown-linux-gnueabihf" => Some("arm-linux-gnueabihf"),
+                    "arm-unknown-linux-musleabi" => Some("arm-linux-musleabi"),
+                    "arm-unknown-linux-musleabihf" => Some("arm-linux-musleabihf"),
+                    "arm-unknown-netbsd-eabi" => Some("arm--netbsdelf-eabi"),
+                    "armv6-unknown-netbsd-eabihf" => Some("armv6--netbsdelf-eabihf"),
+                    "armv7-unknown-linux-gnueabi" => Some("arm-linux-gnueabi"),
+                    "armv7-unknown-linux-gnueabihf" => Some("arm-linux-gnueabihf"),
+                    "armv7-unknown-linux-musleabihf" => Some("arm-linux-musleabihf"),
+                    "armv7neon-unknown-linux-gnueabihf" => Some("arm-linux-gnueabihf"),
+                    "armv7neon-unknown-linux-musleabihf" => Some("arm-linux-musleabihf"),
+                    "thumbv7-unknown-linux-gnueabihf" => Some("arm-linux-gnueabihf"),
+                    "thumbv7-unknown-linux-musleabihf" => Some("arm-linux-musleabihf"),
+                    "thumbv7neon-unknown-linux-gnueabihf" => Some("arm-linux-gnueabihf"),
+                    "thumbv7neon-unknown-linux-musleabihf" => Some("arm-linux-musleabihf"),
+                    "armv7-unknown-netbsd-eabihf" => Some("armv7--netbsdelf-eabihf"),
+                    "hexagon-unknown-linux-musl" => Some("hexagon-linux-musl"),
+                    "i586-unknown-linux-musl" => Some("musl"),
+                    "i686-pc-windows-gnu" => Some("i686-w64-mingw32"),
+                    "i686-uwp-windows-gnu" => Some("i686-w64-mingw32"),
+                    "i686-unknown-linux-gnu" => self.find_working_gnu_prefix(&[
+                        "i686-linux-gnu",
+                        "x86_64-linux-gnu", // transparently support gcc-multilib
+                    ]), // explicit None if not found, so caller knows to fall back
+                    "i686-unknown-linux-musl" => Some("musl"),
+                    "i686-unknown-netbsd" => Some("i486--netbsdelf"),
+                    "loongarch64-unknown-linux-gnu" => Some("loongarch64-linux-gnu"),
+                    "mips-unknown-linux-gnu" => Some("mips-linux-gnu"),
+                    "mips-unknown-linux-musl" => Some("mips-linux-musl"),
+                    "mipsel-unknown-linux-gnu" => Some("mipsel-linux-gnu"),
+                    "mipsel-unknown-linux-musl" => Some("mipsel-linux-musl"),
+                    "mips64-unknown-linux-gnuabi64" => Some("mips64-linux-gnuabi64"),
+                    "mips64el-unknown-linux-gnuabi64" => Some("mips64el-linux-gnuabi64"),
+                    "mipsisa32r6-unknown-linux-gnu" => Some("mipsisa32r6-linux-gnu"),
+                    "mipsisa32r6el-unknown-linux-gnu" => Some("mipsisa32r6el-linux-gnu"),
+                    "mipsisa64r6-unknown-linux-gnuabi64" => Some("mipsisa64r6-linux-gnuabi64"),
+                    "mipsisa64r6el-unknown-linux-gnuabi64" => Some("mipsisa64r6el-linux-gnuabi64"),
+                    "powerpc-unknown-linux-gnu" => Some("powerpc-linux-gnu"),
+                    "powerpc-unknown-linux-gnuspe" => Some("powerpc-linux-gnuspe"),
+                    "powerpc-unknown-netbsd" => Some("powerpc--netbsd"),
+                    "powerpc64-unknown-linux-gnu" => Some("powerpc-linux-gnu"),
+                    "powerpc64le-unknown-linux-gnu" => Some("powerpc64le-linux-gnu"),
+                    "riscv32i-unknown-none-elf" => self.find_working_gnu_prefix(&[
+                        "riscv32-unknown-elf",
+                        "riscv64-unknown-elf",
+                        "riscv-none-embed",
+                    ]),
+                    "riscv32imac-esp-espidf" => Some("riscv32-esp-elf"),
+                    "riscv32imac-unknown-none-elf" => self.find_working_gnu_prefix(&[
+                        "riscv32-unknown-elf",
+                        "riscv64-unknown-elf",
+                        "riscv-none-embed",
+                    ]),
+                    "riscv32imac-unknown-xous-elf" => self.find_working_gnu_prefix(&[
+                        "riscv32-unknown-elf",
+                        "riscv64-unknown-elf",
+                        "riscv-none-embed",
+                    ]),
+                    "riscv32imc-esp-espidf" => Some("riscv32-esp-elf"),
+                    "riscv32imc-unknown-none-elf" => self.find_working_gnu_prefix(&[
+                        "riscv32-unknown-elf",
+                        "riscv64-unknown-elf",
+                        "riscv-none-embed",
+                    ]),
+                    "riscv64gc-unknown-none-elf" => self.find_working_gnu_prefix(&[
+                        "riscv64-unknown-elf",
+                        "riscv32-unknown-elf",
+                        "riscv-none-embed",
+                    ]),
+                    "riscv64imac-unknown-none-elf" => self.find_working_gnu_prefix(&[
+                        "riscv64-unknown-elf",
+                        "riscv32-unknown-elf",
+                        "riscv-none-embed",
+                    ]),
+                    "riscv64gc-unknown-linux-gnu" => Some("riscv64-linux-gnu"),
+                    "riscv32gc-unknown-linux-gnu" => Some("riscv32-linux-gnu"),
+                    "riscv64gc-unknown-linux-musl" => Some("riscv64-linux-musl"),
+                    "riscv32gc-unknown-linux-musl" => Some("riscv32-linux-musl"),
+                    "riscv64gc-unknown-netbsd" => Some("riscv64--netbsd"),
+                    "s390x-unknown-linux-gnu" => Some("s390x-linux-gnu"),
+                    "sparc-unknown-linux-gnu" => Some("sparc-linux-gnu"),
+                    "sparc64-unknown-linux-gnu" => Some("sparc64-linux-gnu"),
+                    "sparc64-unknown-netbsd" => Some("sparc64--netbsd"),
+                    "sparcv9-sun-solaris" => Some("sparcv9-sun-solaris"),
+                    "armv7a-none-eabi" => Some("arm-none-eabi"),
+                    "armv7a-none-eabihf" => Some("arm-none-eabi"),
+                    "armebv7r-none-eabi" => Some("arm-none-eabi"),
+                    "armebv7r-none-eabihf" => Some("arm-none-eabi"),
+                    "armv7r-none-eabi" => Some("arm-none-eabi"),
+                    "armv7r-none-eabihf" => Some("arm-none-eabi"),
+                    "armv8r-none-eabihf" => Some("arm-none-eabi"),
+                    "thumbv6m-none-eabi" => Some("arm-none-eabi"),
+                    "thumbv7em-none-eabi" => Some("arm-none-eabi"),
+                    "thumbv7em-none-eabihf" => Some("arm-none-eabi"),
+                    "thumbv7m-none-eabi" => Some("arm-none-eabi"),
+                    "thumbv8m.base-none-eabi" => Some("arm-none-eabi"),
+                    "thumbv8m.main-none-eabi" => Some("arm-none-eabi"),
+                    "thumbv8m.main-none-eabihf" => Some("arm-none-eabi"),
+                    "x86_64-pc-windows-gnu" => Some("x86_64-w64-mingw32"),
+                    "x86_64-pc-windows-gnullvm" => Some("x86_64-w64-mingw32"),
+                    "x86_64-uwp-windows-gnu" => Some("x86_64-w64-mingw32"),
+                    "x86_64-rumprun-netbsd" => Some("x86_64-rumprun-netbsd"),
+                    "x86_64-unknown-linux-gnu" => self.find_working_gnu_prefix(&[
+                        "x86_64-linux-gnu", // rustfmt wrap
+                    ]), // explicit None if not found, so caller knows to fall back
+                    "x86_64-unknown-linux-musl" => Some("musl"),
+                    "x86_64-unknown-netbsd" => Some("x86_64--netbsd"),
+                    _ => None,
+                }
+                .map(Cow::Borrowed)
+            })
+    }
+
+    /// Some platforms have multiple, compatible, canonical prefixes. Look through
+    /// each possible prefix for a compiler that exists and return it. The prefixes
+    /// should be ordered from most-likely to least-likely.
+    fn find_working_gnu_prefix(&self, prefixes: &[&'static str]) -> Option<&'static str> {
+        let suffix = if self.cpp { "-g++" } else { "-gcc" };
+        let extension = std::env::consts::EXE_SUFFIX;
+
+        // Loop through PATH entries searching for each toolchain. This ensures that we
+        // are more likely to discover the toolchain early on, because chances are good
+        // that the desired toolchain is in one of the higher-priority paths.
+        self.getenv("PATH")
+            .as_ref()
+            .and_then(|path_entries| {
+                env::split_paths(path_entries).find_map(|path_entry| {
+                    for prefix in prefixes {
+                        let target_compiler = format!("{}{}{}", prefix, suffix, extension);
+                        if path_entry.join(&target_compiler).exists() {
+                            return Some(prefix);
+                        }
+                    }
+                    None
+                })
+            })
+            .copied()
+            // If no toolchain was found, provide the first toolchain that was passed in.
+            // This toolchain has been shown not to exist, however it will appear in the
+            // error that is shown to the user which should make it easier to search for
+            // where it should be obtained.
+            .or_else(|| prefixes.first().copied())
+    }
+
+    fn get_target(&self) -> Result<Cow<'_, str>, Error> {
+        match &self.target {
+            Some(t) => Ok(Cow::Borrowed(t)),
+            None => self.getenv_unwrap_str("TARGET").map(Cow::Owned),
+        }
+    }
+
+    fn get_host(&self) -> Result<Cow<'_, str>, Error> {
+        match &self.host {
+            Some(h) => Ok(Cow::Borrowed(h)),
+            None => self.getenv_unwrap_str("HOST").map(Cow::Owned),
+        }
+    }
+
+    fn get_opt_level(&self) -> Result<Cow<'_, str>, Error> {
+        match &self.opt_level {
+            Some(ol) => Ok(Cow::Borrowed(ol)),
+            None => self.getenv_unwrap_str("OPT_LEVEL").map(Cow::Owned),
+        }
+    }
+
+    fn get_debug(&self) -> bool {
+        self.debug.unwrap_or_else(|| match self.getenv("DEBUG") {
+            Some(s) => &*s != "false",
+            None => false,
+        })
+    }
+
+    fn get_dwarf_version(&self) -> Option<u32> {
+        // Tentatively matches the DWARF version defaults as of rustc 1.62.
+        let target = self.get_target().ok()?;
+        if target.contains("android")
+            || target.contains("apple")
+            || target.contains("dragonfly")
+            || target.contains("freebsd")
+            || target.contains("netbsd")
+            || target.contains("openbsd")
+            || target.contains("windows-gnu")
+        {
+            Some(2)
+        } else if target.contains("linux") {
+            Some(4)
+        } else {
+            None
+        }
+    }
+
+    fn get_force_frame_pointer(&self) -> bool {
+        self.force_frame_pointer.unwrap_or_else(|| self.get_debug())
+    }
+
+    fn get_out_dir(&self) -> Result<Cow<'_, Path>, Error> {
+        match &self.out_dir {
+            Some(p) => Ok(Cow::Borrowed(&**p)),
+            None => self
+                .getenv("OUT_DIR")
+                .as_deref()
+                .map(PathBuf::from)
+                .map(Cow::Owned)
+                .ok_or_else(|| {
+                    Error::new(
+                        ErrorKind::EnvVarNotFound,
+                        "Environment variable OUT_DIR not defined.",
+                    )
+                }),
+        }
+    }
+
+    #[allow(clippy::disallowed_methods)]
+    fn getenv(&self, v: &str) -> Option<Arc<OsStr>> {
+        // Returns true for environment variables cargo sets for build scripts:
+        // https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts
+        //
+        // This handles more of the vars than we actually use (it tries to check
+        // complete-ish set), just to avoid needing maintenance if/when new
+        // calls to `getenv`/`getenv_unwrap` are added.
+        fn provided_by_cargo(envvar: &str) -> bool {
+            match envvar {
+                v if v.starts_with("CARGO") || v.starts_with("RUSTC") => true,
+                "HOST" | "TARGET" | "RUSTDOC" | "OUT_DIR" | "OPT_LEVEL" | "DEBUG" | "PROFILE"
+                | "NUM_JOBS" | "RUSTFLAGS" => true,
+                _ => false,
+            }
+        }
+        if let Some(val) = self.env_cache.read().unwrap().get(v).cloned() {
+            return val;
+        }
+        if self.emit_rerun_if_env_changed && !provided_by_cargo(v) {
+            self.cargo_output
+                .print_metadata(&format_args!("cargo:rerun-if-env-changed={}", v));
+        }
+        let r = env::var_os(v).map(Arc::from);
+        self.cargo_output.print_metadata(&format_args!(
+            "{} = {}",
+            v,
+            OptionOsStrDisplay(r.as_deref())
+        ));
+        self.env_cache.write().unwrap().insert(v.into(), r.clone());
+        r
+    }
+
+    fn getenv_unwrap(&self, v: &str) -> Result<Arc<OsStr>, Error> {
+        match self.getenv(v) {
+            Some(s) => Ok(s),
+            None => Err(Error::new(
+                ErrorKind::EnvVarNotFound,
+                format!("Environment variable {} not defined.", v),
+            )),
+        }
+    }
+
+    fn getenv_unwrap_str(&self, v: &str) -> Result<String, Error> {
+        let env = self.getenv_unwrap(v)?;
+        env.to_str().map(String::from).ok_or_else(|| {
+            Error::new(
+                ErrorKind::EnvVarNotFound,
+                format!("Environment variable {} is not valid utf-8.", v),
+            )
+        })
+    }
+
+    fn getenv_with_target_prefixes(&self, var_base: &str) -> Result<Arc<OsStr>, Error> {
+        let target = self.get_target()?;
+        let host = self.get_host()?;
+        let kind = if host == target { "HOST" } else { "TARGET" };
+        let target_u = target.replace('-', "_");
+        let res = self
+            .getenv(&format!("{}_{}", var_base, target))
+            .or_else(|| self.getenv(&format!("{}_{}", var_base, target_u)))
+            .or_else(|| self.getenv(&format!("{}_{}", kind, var_base)))
+            .or_else(|| self.getenv(var_base));
+
+        match res {
+            Some(res) => Ok(res),
+            None => Err(Error::new(
+                ErrorKind::EnvVarNotFound,
+                format!("Could not find environment variable {}.", var_base),
+            )),
+        }
+    }
+
+    fn envflags(&self, name: &str) -> Result<Vec<String>, Error> {
+        Ok(self
+            .getenv_with_target_prefixes(name)?
+            .to_string_lossy()
+            .split_ascii_whitespace()
+            .map(ToString::to_string)
+            .collect())
+    }
+
+    fn fix_env_for_apple_os(&self, cmd: &mut Command) -> Result<(), Error> {
+        let target = self.get_target()?;
+        let host = self.get_host()?;
+        if host.contains("apple-darwin") && target.contains("apple-darwin") {
+            // Additionally, `IPHONEOS_DEPLOYMENT_TARGET` must not be set when using the Xcode linker at
+            // "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld",
+            // although this is apparently ignored when using the linker at "/usr/bin/ld".
+            cmd.env_remove("IPHONEOS_DEPLOYMENT_TARGET");
+        }
+        Ok(())
+    }
+
+    fn apple_sdk_root_inner(&self, sdk: &str) -> Result<Arc<OsStr>, Error> {
+        // Code copied from rustc's compiler/rustc_codegen_ssa/src/back/link.rs.
+        if let Some(sdkroot) = self.getenv("SDKROOT") {
+            let p = Path::new(&sdkroot);
+            let does_sdkroot_contain = |strings: &[&str]| {
+                let sdkroot_str = p.to_string_lossy();
+                strings.iter().any(|s| sdkroot_str.contains(s))
+            };
+            match sdk {
+                // Ignore `SDKROOT` if it's clearly set for the wrong platform.
+                "appletvos"
+                    if does_sdkroot_contain(&["TVSimulator.platform", "MacOSX.platform"]) => {}
+                "appletvsimulator"
+                    if does_sdkroot_contain(&["TVOS.platform", "MacOSX.platform"]) => {}
+                "iphoneos"
+                    if does_sdkroot_contain(&["iPhoneSimulator.platform", "MacOSX.platform"]) => {}
+                "iphonesimulator"
+                    if does_sdkroot_contain(&["iPhoneOS.platform", "MacOSX.platform"]) => {}
+                "macosx10.15"
+                    if does_sdkroot_contain(&["iPhoneOS.platform", "iPhoneSimulator.platform"]) => {
+                }
+                "watchos"
+                    if does_sdkroot_contain(&["WatchSimulator.platform", "MacOSX.platform"]) => {}
+                "watchsimulator"
+                    if does_sdkroot_contain(&["WatchOS.platform", "MacOSX.platform"]) => {}
+                "xros" if does_sdkroot_contain(&["XRSimulator.platform", "MacOSX.platform"]) => {}
+                "xrsimulator" if does_sdkroot_contain(&["XROS.platform", "MacOSX.platform"]) => {}
+                // Ignore `SDKROOT` if it's not a valid path.
+                _ if !p.is_absolute() || p == Path::new("/") || !p.exists() => {}
+                _ => return Ok(sdkroot),
+            }
+        }
+
+        let sdk_path = run_output(
+            self.cmd("xcrun")
+                .arg("--show-sdk-path")
+                .arg("--sdk")
+                .arg(sdk),
+            "xcrun",
+            &self.cargo_output,
+        )?;
+
+        let sdk_path = match String::from_utf8(sdk_path) {
+            Ok(p) => p,
+            Err(_) => {
+                return Err(Error::new(
+                    ErrorKind::IOError,
+                    "Unable to determine Apple SDK path.",
+                ));
+            }
+        };
+        Ok(Arc::from(OsStr::new(sdk_path.trim())))
+    }
+
+    fn apple_sdk_root(&self, sdk: &str) -> Result<Arc<OsStr>, Error> {
+        if let Some(ret) = self
+            .apple_sdk_root_cache
+            .read()
+            .expect("apple_sdk_root_cache lock failed")
+            .get(sdk)
+            .cloned()
+        {
+            return Ok(ret);
+        }
+        let sdk_path = self.apple_sdk_root_inner(sdk)?;
+        self.apple_sdk_root_cache
+            .write()
+            .expect("apple_sdk_root_cache lock failed")
+            .insert(sdk.into(), sdk_path.clone());
+        Ok(sdk_path)
+    }
+
+    fn apple_deployment_version(&self, os: AppleOs, arch_str: Option<&str>, sdk: &str) -> Arc<str> {
+        if let Some(ret) = self
+            .apple_versions_cache
+            .read()
+            .expect("apple_versions_cache lock failed")
+            .get(sdk)
+            .cloned()
+        {
+            return ret;
+        }
+
+        let default_deployment_from_sdk = || -> Option<Arc<str>> {
+            let version = run_output(
+                self.cmd("xcrun")
+                    .arg("--show-sdk-version")
+                    .arg("--sdk")
+                    .arg(sdk),
+                "xcrun",
+                &self.cargo_output,
+            )
+            .ok()?;
+
+            Some(Arc::from(std::str::from_utf8(&version).ok()?.trim()))
+        };
+
+        let deployment_from_env = |name: &str| -> Option<Arc<str>> {
+            // note that self.env isn't hit in production codepaths, its mostly just for tests which don't
+            // set the real env
+            self.env
+                .iter()
+                .find(|(k, _)| &**k == OsStr::new(name))
+                .map(|(_, v)| v)
+                .cloned()
+                .or_else(|| self.getenv(name))?
+                .to_str()
+                .map(Arc::from)
+        };
+
+        // Determines if the acquired deployment target is too low to support modern C++ on some Apple platform.
+        //
+        // A long time ago they used libstdc++, but since macOS 10.9 and iOS 7 libc++ has been the library the SDKs provide to link against.
+        // If a `cc`` config wants to use C++, we round up to these versions as the baseline.
+        let maybe_cpp_version_baseline = |deployment_target_ver: Arc<str>| -> Option<Arc<str>> {
+            if !self.cpp {
+                return Some(deployment_target_ver);
+            }
+
+            let mut deployment_target = deployment_target_ver
+                .split('.')
+                .map(|v| v.parse::<u32>().expect("integer version"));
+
+            match os {
+                AppleOs::MacOs => {
+                    let major = deployment_target.next().unwrap_or(0);
+                    let minor = deployment_target.next().unwrap_or(0);
+
+                    // If below 10.9, we ignore it and let the SDK's target definitions handle it.
+                    if major == 10 && minor < 9 {
+                        self.cargo_output.print_warning(&format_args!(
+                            "macOS deployment target ({}) too low, it will be increased",
+                            deployment_target_ver
+                        ));
+                        return None;
+                    }
+                }
+                AppleOs::Ios => {
+                    let major = deployment_target.next().unwrap_or(0);
+
+                    // If below 10.7, we ignore it and let the SDK's target definitions handle it.
+                    if major < 7 {
+                        self.cargo_output.print_warning(&format_args!(
+                            "iOS deployment target ({}) too low, it will be increased",
+                            deployment_target_ver
+                        ));
+                        return None;
+                    }
+                }
+                // watchOS, tvOS, visionOS, and others are all new enough that libc++ is their baseline.
+                _ => {}
+            }
+
+            // If the deployment target met or exceeded the C++ baseline
+            Some(deployment_target_ver)
+        };
+
+        // The hardcoded minimums here are subject to change in a future compiler release,
+        // and only exist as last resort fallbacks. Don't consider them stable.
+        // `cc` doesn't use rustc's `--print deployment-target`` because the compiler's defaults
+        // don't align well with Apple's SDKs and other third-party libraries that require ~generally~ higher
+        // deployment targets. rustc isn't interested in those by default though so its fine to be different here.
+        //
+        // If no explicit target is passed, `cc` defaults to the current Xcode SDK's `DefaultDeploymentTarget` for better
+        // compatibility. This is also the crate's historical behavior and what has become a relied-on value.
+        //
+        // The ordering of env -> XCode SDK -> old rustc defaults is intentional for performance when using
+        // an explicit target.
+        let version: Arc<str> = match os {
+            AppleOs::MacOs => deployment_from_env("MACOSX_DEPLOYMENT_TARGET")
+                .and_then(maybe_cpp_version_baseline)
+                .or_else(default_deployment_from_sdk)
+                .unwrap_or_else(|| {
+                    if arch_str == Some("aarch64") {
+                        "11.0".into()
+                    } else {
+                        let default: Arc<str> = Arc::from("10.7");
+                        maybe_cpp_version_baseline(default.clone()).unwrap_or(default)
+                    }
+                }),
+
+            AppleOs::Ios => deployment_from_env("IPHONEOS_DEPLOYMENT_TARGET")
+                .and_then(maybe_cpp_version_baseline)
+                .or_else(default_deployment_from_sdk)
+                .unwrap_or_else(|| "7.0".into()),
+
+            AppleOs::WatchOs => deployment_from_env("WATCHOS_DEPLOYMENT_TARGET")
+                .or_else(default_deployment_from_sdk)
+                .unwrap_or_else(|| "5.0".into()),
+
+            AppleOs::TvOs => deployment_from_env("TVOS_DEPLOYMENT_TARGET")
+                .or_else(default_deployment_from_sdk)
+                .unwrap_or_else(|| "9.0".into()),
+
+            AppleOs::VisionOS => deployment_from_env("XROS_DEPLOYMENT_TARGET")
+                .or_else(default_deployment_from_sdk)
+                .unwrap_or_else(|| "1.0".into()),
+        };
+
+        self.apple_versions_cache
+            .write()
+            .expect("apple_versions_cache lock failed")
+            .insert(sdk.into(), version.clone());
+
+        version
+    }
+
+    fn wasi_sysroot(&self) -> Result<Arc<OsStr>, Error> {
+        if let Some(wasi_sysroot_path) = self.getenv("WASI_SYSROOT") {
+            Ok(wasi_sysroot_path)
+        } else {
+            Err(Error::new(
+                ErrorKind::EnvVarNotFound,
+                "Environment variable WASI_SYSROOT not defined. Download sysroot from GitHub & setup environment variable WASI_SYSROOT targeting the folder.",
+            ))
+        }
+    }
+    fn is_wasi_target(target: &str) -> bool {
+        const TARGETS: [&str; 7] = [
+            "wasm32-wasi",
+            "wasm32-wasip1",
+            "wasm32-wasip1-threads",
+            "wasm32-wasip2",
+            "wasm32-wasi-threads",
+            "wasm32-unknown-wasi",
+            "wasm32-unknown-unknown",
+        ];
+        TARGETS.contains(&target)
+    }
+
+    fn cuda_file_count(&self) -> usize {
+        self.files
+            .iter()
+            .filter(|file| file.extension() == Some(OsStr::new("cu")))
+            .count()
+    }
+
+    fn which(&self, tool: &Path, path_entries: Option<&OsStr>) -> Option<PathBuf> {
+        fn check_exe(mut exe: PathBuf) -> Option<PathBuf> {
+            let exe_ext = std::env::consts::EXE_EXTENSION;
+            let check =
+                exe.exists() || (!exe_ext.is_empty() && exe.set_extension(exe_ext) && exe.exists());
+            check.then_some(exe)
+        }
+
+        // Loop through PATH entries searching for the |tool|.
+        let find_exe_in_path = |path_entries: &OsStr| -> Option<PathBuf> {
+            env::split_paths(path_entries).find_map(|path_entry| check_exe(path_entry.join(tool)))
+        };
+
+        // If |tool| is not just one "word," assume it's an actual path...
+        if tool.components().count() > 1 {
+            check_exe(PathBuf::from(tool))
+        } else {
+            path_entries
+                .and_then(find_exe_in_path)
+                .or_else(|| find_exe_in_path(&self.getenv("PATH")?))
+        }
+    }
+
+    /// search for |prog| on 'programs' path in '|cc| -print-search-dirs' output
+    fn search_programs(
+        &self,
+        cc: &mut Command,
+        prog: &Path,
+        cargo_output: &CargoOutput,
+    ) -> Option<PathBuf> {
+        let search_dirs = run_output(
+            cc.arg("-print-search-dirs"),
+            "cc",
+            // this doesn't concern the compilation so we always want to show warnings.
+            cargo_output,
+        )
+        .ok()?;
+        // clang driver appears to be forcing UTF-8 output even on Windows,
+        // hence from_utf8 is assumed to be usable in all cases.
+        let search_dirs = std::str::from_utf8(&search_dirs).ok()?;
+        for dirs in search_dirs.split(['\r', '\n']) {
+            if let Some(path) = dirs.strip_prefix("programs: =") {
+                return self.which(prog, Some(OsStr::new(path)));
+            }
+        }
+        None
+    }
+
+    fn windows_registry_find(&self, target: &str, tool: &str) -> Option<Command> {
+        self.windows_registry_find_tool(target, tool)
+            .map(|c| c.to_command())
+    }
+
+    fn windows_registry_find_tool(&self, target: &str, tool: &str) -> Option<Tool> {
+        struct BuildEnvGetter<'s>(&'s Build);
+
+        impl windows_registry::EnvGetter for BuildEnvGetter<'_> {
+            fn get_env(&self, name: &str) -> Option<windows_registry::Env> {
+                self.0.getenv(name).map(windows_registry::Env::Arced)
+            }
+        }
+
+        windows_registry::find_tool_inner(target, tool, &BuildEnvGetter(self))
+    }
+}
+
+impl Default for Build {
+    fn default() -> Build {
+        Build::new()
+    }
+}
+
+fn fail(s: &str) -> ! {
+    eprintln!("\n\nerror occurred: {}\n\n", s);
+    std::process::exit(1);
+}
+
+#[derive(Clone, Copy, PartialEq)]
+enum AppleOs {
+    MacOs,
+    Ios,
+    WatchOs,
+    TvOs,
+    VisionOS,
+}
+
+impl std::fmt::Debug for AppleOs {
+    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
+        match self {
+            AppleOs::MacOs => f.write_str("macOS"),
+            AppleOs::Ios => f.write_str("iOS"),
+            AppleOs::WatchOs => f.write_str("WatchOS"),
+            AppleOs::TvOs => f.write_str("AppleTVOS"),
+            AppleOs::VisionOS => f.write_str("visionOS"),
+        }
+    }
+}
+
+struct AppleSdkTargetParts {
+    sdk_prefix: &'static str,
+    sim_prefix: &'static str,
+    sdk: Cow<'static, str>,
+}
+
+fn apple_os_sdk_parts(os: AppleOs, arch: &AppleArchSpec) -> AppleSdkTargetParts {
+    let (sdk_prefix, sim_prefix) = match os {
+        AppleOs::MacOs => ("macosx", ""),
+        AppleOs::Ios => ("iphone", "ios-"),
+        AppleOs::WatchOs => ("watch", "watch"),
+        AppleOs::TvOs => ("appletv", "appletv"),
+        AppleOs::VisionOS => ("xr", "xr"),
+    };
+    let sdk = match arch {
+        AppleArchSpec::Device(_) if os == AppleOs::MacOs => Cow::Borrowed("macosx"),
+        AppleArchSpec::Device(_) => format!("{}os", sdk_prefix).into(),
+        AppleArchSpec::Simulator(_) => format!("{}simulator", sdk_prefix).into(),
+        AppleArchSpec::Catalyst(_) => Cow::Borrowed("macosx"),
+    };
+
+    AppleSdkTargetParts {
+        sdk_prefix,
+        sim_prefix,
+        sdk,
+    }
+}
+
+#[allow(dead_code)]
+enum AppleArchSpec {
+    Device(&'static str),
+    Simulator(&'static str),
+    #[allow(dead_code)]
+    Catalyst(&'static str),
+}
+
+// Use by default minimum available API level
+// See note about naming here
+// https://android.googlesource.com/platform/ndk/+/refs/heads/ndk-release-r21/docs/BuildSystemMaintainers.md#Clang
+static NEW_STANDALONE_ANDROID_COMPILERS: [&str; 4] = [
+    "aarch64-linux-android21-clang",
+    "armv7a-linux-androideabi16-clang",
+    "i686-linux-android16-clang",
+    "x86_64-linux-android21-clang",
+];
+
+// New "standalone" C/C++ cross-compiler executables from recent Android NDK
+// are just shell scripts that call main clang binary (from Android NDK) with
+// proper `--target` argument.
+//
+// For example, armv7a-linux-androideabi16-clang passes
+// `--target=armv7a-linux-androideabi16` to clang.
+// So to construct proper command line check if
+// `--target` argument would be passed or not to clang
+fn android_clang_compiler_uses_target_arg_internally(clang_path: &Path) -> bool {
+    if let Some(filename) = clang_path.file_name() {
+        if let Some(filename_str) = filename.to_str() {
+            if let Some(idx) = filename_str.rfind('-') {
+                return filename_str.split_at(idx).0.contains("android");
+            }
+        }
+    }
+    false
+}
+
+fn autodetect_android_compiler(target: &str, host: &str, gnu: &str, clang: &str) -> String {
+    let new_clang_key = match target {
+        "aarch64-linux-android" => Some("aarch64"),
+        "armv7-linux-androideabi" => Some("armv7a"),
+        "i686-linux-android" => Some("i686"),
+        "x86_64-linux-android" => Some("x86_64"),
+        _ => None,
+    };
+
+    let new_clang = new_clang_key
+        .map(|key| {
+            NEW_STANDALONE_ANDROID_COMPILERS
+                .iter()
+                .find(|x| x.starts_with(key))
+        })
+        .unwrap_or(None);
+
+    if let Some(new_clang) = new_clang {
+        if Command::new(new_clang).output().is_ok() {
+            return (*new_clang).into();
+        }
+    }
+
+    let target = target
+        .replace("armv7neon", "arm")
+        .replace("armv7", "arm")
+        .replace("thumbv7neon", "arm")
+        .replace("thumbv7", "arm");
+    let gnu_compiler = format!("{}-{}", target, gnu);
+    let clang_compiler = format!("{}-{}", target, clang);
+
+    // On Windows, the Android clang compiler is provided as a `.cmd` file instead
+    // of a `.exe` file. `std::process::Command` won't run `.cmd` files unless the
+    // `.cmd` is explicitly appended to the command name, so we do that here.
+    let clang_compiler_cmd = format!("{}-{}.cmd", target, clang);
+
+    // Check if gnu compiler is present
+    // if not, use clang
+    if Command::new(&gnu_compiler).output().is_ok() {
+        gnu_compiler
+    } else if host.contains("windows") && Command::new(&clang_compiler_cmd).output().is_ok() {
+        clang_compiler_cmd
+    } else {
+        clang_compiler
+    }
+}
+
+// Rust and clang/cc don't agree on how to name the target.
+fn map_darwin_target_from_rust_to_compiler_architecture(target: &str) -> Option<&'static str> {
+    if target.contains("x86_64h") {
+        Some("x86_64h")
+    } else if target.contains("x86_64") {
+        Some("x86_64")
+    } else if target.contains("arm64e") {
+        Some("arm64e")
+    } else if target.contains("aarch64") {
+        Some("arm64")
+    } else if target.contains("i686") {
+        Some("i386")
+    } else if target.contains("powerpc") {
+        Some("ppc")
+    } else if target.contains("powerpc64") {
+        Some("ppc64")
+    } else {
+        None
+    }
+}
+
+#[derive(Clone, Copy, PartialEq)]
+enum AsmFileExt {
+    /// `.asm` files. On MSVC targets, we assume these should be passed to MASM
+    /// (`ml{,64}.exe`).
+    DotAsm,
+    /// `.s` or `.S` files, which do not have the special handling on MSVC targets.
+    DotS,
+}
+
+impl AsmFileExt {
+    fn from_path(file: &Path) -> Option<Self> {
+        if let Some(ext) = file.extension() {
+            if let Some(ext) = ext.to_str() {
+                let ext = ext.to_lowercase();
+                match &*ext {
+                    "asm" => return Some(AsmFileExt::DotAsm),
+                    "s" => return Some(AsmFileExt::DotS),
+                    _ => return None,
+                }
+            }
+        }
+        None
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test_android_clang_compiler_uses_target_arg_internally() {
+        for version in 16..21 {
+            assert!(android_clang_compiler_uses_target_arg_internally(
+                &PathBuf::from(format!("armv7a-linux-androideabi{}-clang", version))
+            ));
+            assert!(android_clang_compiler_uses_target_arg_internally(
+                &PathBuf::from(format!("armv7a-linux-androideabi{}-clang++", version))
+            ));
+        }
+        assert!(!android_clang_compiler_uses_target_arg_internally(
+            &PathBuf::from("clang-i686-linux-android")
+        ));
+        assert!(!android_clang_compiler_uses_target_arg_internally(
+            &PathBuf::from("clang")
+        ));
+        assert!(!android_clang_compiler_uses_target_arg_internally(
+            &PathBuf::from("clang++")
+        ));
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/cc/src/parallel/async_executor.rs 43.0.0-1ubuntu1/rust-vendor/cc/src/parallel/async_executor.rs
--- 43.0.0-1/rust-vendor/cc/src/parallel/async_executor.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/parallel/async_executor.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,118 @@
+use std::{
+    cell::Cell,
+    future::Future,
+    pin::Pin,
+    ptr,
+    task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
+    thread,
+    time::Duration,
+};
+
+use crate::Error;
+
+const NOOP_WAKER_VTABLE: RawWakerVTable = RawWakerVTable::new(
+    // Cloning just returns a new no-op raw waker
+    |_| NOOP_RAW_WAKER,
+    // `wake` does nothing
+    |_| {},
+    // `wake_by_ref` does nothing
+    |_| {},
+    // Dropping does nothing as we don't allocate anything
+    |_| {},
+);
+const NOOP_RAW_WAKER: RawWaker = RawWaker::new(ptr::null(), &NOOP_WAKER_VTABLE);
+
+#[derive(Default)]
+pub(crate) struct YieldOnce(bool);
+
+impl Future for YieldOnce {
+    type Output = ();
+
+    fn poll(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<()> {
+        let flag = &mut std::pin::Pin::into_inner(self).0;
+        if !*flag {
+            *flag = true;
+            Poll::Pending
+        } else {
+            Poll::Ready(())
+        }
+    }
+}
+
+/// Execute the futures and return when they are all done.
+///
+/// Here we use our own homebrew async executor since cc is used in the build
+/// script of many popular projects, pulling in additional dependencies would
+/// significantly slow down its compilation.
+pub(crate) fn block_on<Fut1, Fut2>(
+    mut fut1: Fut1,
+    mut fut2: Fut2,
+    has_made_progress: &Cell<bool>,
+) -> Result<(), Error>
+where
+    Fut1: Future<Output = Result<(), Error>>,
+    Fut2: Future<Output = Result<(), Error>>,
+{
+    // Shadows the future so that it can never be moved and is guaranteed
+    // to be pinned.
+    //
+    // The same trick used in `pin!` macro.
+    //
+    // TODO: Once MSRV is bumped to 1.68, replace this with `std::pin::pin!`
+    let mut fut1 = Some(unsafe { Pin::new_unchecked(&mut fut1) });
+    let mut fut2 = Some(unsafe { Pin::new_unchecked(&mut fut2) });
+
+    // TODO: Once `Waker::noop` stablised and our MSRV is bumped to the version
+    // which it is stablised, replace this with `Waker::noop`.
+    let waker = unsafe { Waker::from_raw(NOOP_RAW_WAKER) };
+    let mut context = Context::from_waker(&waker);
+
+    let mut backoff_cnt = 0;
+
+    loop {
+        has_made_progress.set(false);
+
+        if let Some(fut) = fut2.as_mut() {
+            if let Poll::Ready(res) = fut.as_mut().poll(&mut context) {
+                fut2 = None;
+                res?;
+            }
+        }
+
+        if let Some(fut) = fut1.as_mut() {
+            if let Poll::Ready(res) = fut.as_mut().poll(&mut context) {
+                fut1 = None;
+                res?;
+            }
+        }
+
+        if fut1.is_none() && fut2.is_none() {
+            return Ok(());
+        }
+
+        if !has_made_progress.get() {
+            if backoff_cnt > 3 {
+                // We have yielded at least three times without making'
+                // any progress, so we will sleep for a while.
+                let duration = Duration::from_millis(100 * (backoff_cnt - 3).min(10));
+                thread::sleep(duration);
+            } else {
+                // Given that we spawned a lot of compilation tasks, it is unlikely
+                // that OS cannot find other ready task to execute.
+                //
+                // If all of them are done, then we will yield them and spawn more,
+                // or simply return.
+                //
+                // Thus this will not be turned into a busy-wait loop and it will not
+                // waste CPU resource.
+                thread::yield_now();
+            }
+        }
+
+        backoff_cnt = if has_made_progress.get() {
+            0
+        } else {
+            backoff_cnt + 1
+        };
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/cc/src/parallel/job_token.rs 43.0.0-1ubuntu1/rust-vendor/cc/src/parallel/job_token.rs
--- 43.0.0-1/rust-vendor/cc/src/parallel/job_token.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/parallel/job_token.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,273 @@
+use std::marker::PhantomData;
+
+use crate::Error;
+
+use super::once_lock::OnceLock;
+
+pub(crate) struct JobToken(PhantomData<()>);
+
+impl JobToken {
+    fn new() -> Self {
+        Self(PhantomData)
+    }
+}
+
+impl Drop for JobToken {
+    fn drop(&mut self) {
+        match JobTokenServer::new() {
+            JobTokenServer::Inherited(jobserver) => jobserver.release_token_raw(),
+            JobTokenServer::InProcess(jobserver) => jobserver.release_token_raw(),
+        }
+    }
+}
+
+enum JobTokenServer {
+    Inherited(inherited_jobserver::JobServer),
+    InProcess(inprocess_jobserver::JobServer),
+}
+
+impl JobTokenServer {
+    /// This function returns a static reference to the jobserver because
+    ///  - creating a jobserver from env is a bit fd-unsafe (e.g. the fd might
+    ///    be closed by other jobserver users in the process) and better do it
+    ///    at the start of the program.
+    ///  - in case a jobserver cannot be created from env (e.g. it's not
+    ///    present), we will create a global in-process only jobserver
+    ///    that has to be static so that it will be shared by all cc
+    ///    compilation.
+    fn new() -> &'static Self {
+        // TODO: Replace with a OnceLock once MSRV is 1.70
+        static JOBSERVER: OnceLock<JobTokenServer> = OnceLock::new();
+
+        JOBSERVER.get_or_init(|| {
+            unsafe { inherited_jobserver::JobServer::from_env() }
+                .map(Self::Inherited)
+                .unwrap_or_else(|| Self::InProcess(inprocess_jobserver::JobServer::new()))
+        })
+    }
+}
+
+pub(crate) enum ActiveJobTokenServer {
+    Inherited(inherited_jobserver::ActiveJobServer<'static>),
+    InProcess(&'static inprocess_jobserver::JobServer),
+}
+
+impl ActiveJobTokenServer {
+    pub(crate) fn new() -> Self {
+        match JobTokenServer::new() {
+            JobTokenServer::Inherited(inherited_jobserver) => {
+                Self::Inherited(inherited_jobserver.enter_active())
+            }
+            JobTokenServer::InProcess(inprocess_jobserver) => Self::InProcess(inprocess_jobserver),
+        }
+    }
+
+    pub(crate) async fn acquire(&mut self) -> Result<JobToken, Error> {
+        match self {
+            Self::Inherited(jobserver) => jobserver.acquire().await,
+            Self::InProcess(jobserver) => Ok(jobserver.acquire().await),
+        }
+    }
+}
+
+mod inherited_jobserver {
+    use super::JobToken;
+
+    use crate::{parallel::async_executor::YieldOnce, Error, ErrorKind};
+
+    use std::{
+        io, mem,
+        sync::{mpsc, Mutex, MutexGuard, PoisonError},
+    };
+
+    pub(super) struct JobServer {
+        /// Implicit token for this process which is obtained and will be
+        /// released in parent. Since JobTokens only give back what they got,
+        /// there should be at most one global implicit token in the wild.
+        ///
+        /// Since Rust does not execute any `Drop` for global variables,
+        /// we can't just put it back to jobserver and then re-acquire it at
+        /// the end of the process.
+        ///
+        /// Use `Mutex` to avoid race between acquire and release.
+        /// If an `AtomicBool` is used, then it's possible for:
+        ///  - `release_token_raw`: Tries to set `global_implicit_token` to true, but it is already
+        ///    set  to `true`, continue to release it to jobserver
+        ///  - `acquire` takes the global implicit token, set `global_implicit_token` to false
+        ///  - `release_token_raw` now writes the token back into the jobserver, while
+        ///    `global_implicit_token` is `false`
+        ///
+        /// If the program exits here, then cc effectively increases parallelism by one, which is
+        /// incorrect, hence we use a `Mutex` here.
+        global_implicit_token: Mutex<bool>,
+        inner: jobserver::Client,
+    }
+
+    impl JobServer {
+        pub(super) unsafe fn from_env() -> Option<Self> {
+            jobserver::Client::from_env().map(|inner| Self {
+                inner,
+                global_implicit_token: Mutex::new(true),
+            })
+        }
+
+        fn get_global_implicit_token(&self) -> MutexGuard<'_, bool> {
+            self.global_implicit_token
+                .lock()
+                .unwrap_or_else(PoisonError::into_inner)
+        }
+
+        /// All tokens except for the global implicit token will be put back into the jobserver
+        /// immediately and they cannot be cached, since Rust does not call `Drop::drop` on
+        /// global variables.
+        pub(super) fn release_token_raw(&self) {
+            let mut global_implicit_token = self.get_global_implicit_token();
+
+            if *global_implicit_token {
+                // There's already a global implicit token, so this token must
+                // be released back into jobserver.
+                //
+                // `release_raw` should not block
+                let _ = self.inner.release_raw();
+            } else {
+                *global_implicit_token = true;
+            }
+        }
+
+        pub(super) fn enter_active(&self) -> ActiveJobServer<'_> {
+            ActiveJobServer {
+                jobserver: self,
+                helper_thread: None,
+            }
+        }
+    }
+
+    struct HelperThread {
+        inner: jobserver::HelperThread,
+        /// When rx is dropped, all the token stored within it will be dropped.
+        rx: mpsc::Receiver<io::Result<jobserver::Acquired>>,
+    }
+
+    impl HelperThread {
+        fn new(jobserver: &JobServer) -> Result<Self, Error> {
+            let (tx, rx) = mpsc::channel();
+
+            Ok(Self {
+                rx,
+                inner: jobserver.inner.clone().into_helper_thread(move |res| {
+                    let _ = tx.send(res);
+                })?,
+            })
+        }
+    }
+
+    pub(crate) struct ActiveJobServer<'a> {
+        jobserver: &'a JobServer,
+        helper_thread: Option<HelperThread>,
+    }
+
+    impl<'a> ActiveJobServer<'a> {
+        pub(super) async fn acquire(&mut self) -> Result<JobToken, Error> {
+            let mut has_requested_token = false;
+
+            loop {
+                // Fast path
+                if mem::replace(&mut *self.jobserver.get_global_implicit_token(), false) {
+                    break Ok(JobToken::new());
+                }
+
+                match self.jobserver.inner.try_acquire() {
+                    Ok(Some(acquired)) => {
+                        acquired.drop_without_releasing();
+                        break Ok(JobToken::new());
+                    }
+                    Ok(None) => YieldOnce::default().await,
+                    Err(err) if err.kind() == io::ErrorKind::Unsupported => {
+                        // Fallback to creating a help thread with blocking acquire
+                        let helper_thread = if let Some(thread) = self.helper_thread.as_ref() {
+                            thread
+                        } else {
+                            self.helper_thread
+                                .insert(HelperThread::new(self.jobserver)?)
+                        };
+
+                        match helper_thread.rx.try_recv() {
+                            Ok(res) => {
+                                let acquired = res?;
+                                acquired.drop_without_releasing();
+                                break Ok(JobToken::new());
+                            }
+                            Err(mpsc::TryRecvError::Disconnected) => break Err(Error::new(
+                                ErrorKind::JobserverHelpThreadError,
+                                "jobserver help thread has returned before ActiveJobServer is dropped",
+                            )),
+                            Err(mpsc::TryRecvError::Empty) => {
+                                if !has_requested_token {
+                                    helper_thread.inner.request_token();
+                                    has_requested_token = true;
+                                }
+                                YieldOnce::default().await
+                            }
+                        }
+                    }
+                    Err(err) => break Err(err.into()),
+                }
+            }
+        }
+    }
+}
+
+mod inprocess_jobserver {
+    use super::JobToken;
+
+    use crate::parallel::async_executor::YieldOnce;
+
+    use std::{
+        env::var,
+        sync::atomic::{
+            AtomicU32,
+            Ordering::{AcqRel, Acquire},
+        },
+    };
+
+    pub(crate) struct JobServer(AtomicU32);
+
+    impl JobServer {
+        pub(super) fn new() -> Self {
+            // Use `NUM_JOBS` if set (it's configured by Cargo) and otherwise
+            // just fall back to a semi-reasonable number.
+            //
+            // Note that we could use `num_cpus` here but it's an extra
+            // dependency that will almost never be used, so
+            // it's generally not too worth it.
+            let mut parallelism = 4;
+            // TODO: Use std::thread::available_parallelism as an upper bound
+            // when MSRV is bumped.
+            if let Ok(amt) = var("NUM_JOBS") {
+                if let Ok(amt) = amt.parse() {
+                    parallelism = amt;
+                }
+            }
+
+            Self(AtomicU32::new(parallelism))
+        }
+
+        pub(super) async fn acquire(&self) -> JobToken {
+            loop {
+                let res = self
+                    .0
+                    .fetch_update(AcqRel, Acquire, |tokens| tokens.checked_sub(1));
+
+                if res.is_ok() {
+                    break JobToken::new();
+                }
+
+                YieldOnce::default().await
+            }
+        }
+
+        pub(super) fn release_token_raw(&self) {
+            self.0.fetch_add(1, AcqRel);
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/cc/src/parallel/mod.rs 43.0.0-1ubuntu1/rust-vendor/cc/src/parallel/mod.rs
--- 43.0.0-1/rust-vendor/cc/src/parallel/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/parallel/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4 @@
+pub(crate) mod async_executor;
+pub(crate) mod job_token;
+pub(crate) mod once_lock;
+pub(crate) mod stderr;
diff -pruN 43.0.0-1/rust-vendor/cc/src/parallel/once_lock.rs 43.0.0-1ubuntu1/rust-vendor/cc/src/parallel/once_lock.rs
--- 43.0.0-1/rust-vendor/cc/src/parallel/once_lock.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/parallel/once_lock.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,47 @@
+use std::{
+    cell::UnsafeCell,
+    marker::PhantomData,
+    mem::MaybeUninit,
+    panic::{RefUnwindSafe, UnwindSafe},
+    sync::Once,
+};
+
+pub(crate) struct OnceLock<T> {
+    once: Once,
+    value: UnsafeCell<MaybeUninit<T>>,
+    _marker: PhantomData<T>,
+}
+
+impl<T> OnceLock<T> {
+    pub(crate) const fn new() -> Self {
+        Self {
+            once: Once::new(),
+            value: UnsafeCell::new(MaybeUninit::uninit()),
+            _marker: PhantomData,
+        }
+    }
+
+    pub(crate) fn get_or_init(&self, f: impl FnOnce() -> T) -> &T {
+        self.once.call_once(|| {
+            unsafe { &mut *self.value.get() }.write(f());
+        });
+        unsafe { (&*self.value.get()).assume_init_ref() }
+    }
+}
+
+unsafe impl<T: Sync + Send> Sync for OnceLock<T> {}
+unsafe impl<T: Send> Send for OnceLock<T> {}
+
+impl<T: RefUnwindSafe + UnwindSafe> RefUnwindSafe for OnceLock<T> {}
+impl<T: UnwindSafe> UnwindSafe for OnceLock<T> {}
+
+impl<T> Drop for OnceLock<T> {
+    #[inline]
+    fn drop(&mut self) {
+        if self.once.is_completed() {
+            // SAFETY: The cell is initialized and being dropped, so it can't
+            // be accessed again.
+            unsafe { self.value.get_mut().assume_init_drop() };
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/cc/src/parallel/stderr.rs 43.0.0-1ubuntu1/rust-vendor/cc/src/parallel/stderr.rs
--- 43.0.0-1/rust-vendor/cc/src/parallel/stderr.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/parallel/stderr.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,91 @@
+#![cfg_attr(target_family = "wasm", allow(unused))]
+/// Helpers functions for [ChildStderr].
+use std::{convert::TryInto, process::ChildStderr};
+
+use crate::{Error, ErrorKind};
+
+#[cfg(all(not(unix), not(windows), not(target_family = "wasm")))]
+compile_error!("Only unix and windows support non-blocking pipes! For other OSes, disable the parallel feature.");
+
+#[cfg(unix)]
+fn get_flags(fd: std::os::unix::io::RawFd) -> Result<i32, Error> {
+    let flags = unsafe { libc::fcntl(fd, libc::F_GETFL, 0) };
+    if flags == -1 {
+        Err(Error::new(
+            ErrorKind::IOError,
+            format!(
+                "Failed to get flags for pipe {}: {}",
+                fd,
+                std::io::Error::last_os_error()
+            ),
+        ))
+    } else {
+        Ok(flags)
+    }
+}
+
+#[cfg(unix)]
+fn set_flags(fd: std::os::unix::io::RawFd, flags: std::os::raw::c_int) -> Result<(), Error> {
+    if unsafe { libc::fcntl(fd, libc::F_SETFL, flags) } == -1 {
+        Err(Error::new(
+            ErrorKind::IOError,
+            format!(
+                "Failed to set flags for pipe {}: {}",
+                fd,
+                std::io::Error::last_os_error()
+            ),
+        ))
+    } else {
+        Ok(())
+    }
+}
+
+#[cfg(unix)]
+pub fn set_non_blocking(pipe: &impl std::os::unix::io::AsRawFd) -> Result<(), Error> {
+    // On Unix, switch the pipe to non-blocking mode.
+    // On Windows, we have a different way to be non-blocking.
+    let fd = pipe.as_raw_fd();
+
+    let flags = get_flags(fd)?;
+    set_flags(fd, flags | libc::O_NONBLOCK)
+}
+
+pub fn bytes_available(stderr: &mut ChildStderr) -> Result<usize, Error> {
+    let mut bytes_available = 0;
+    #[cfg(windows)]
+    {
+        use crate::windows::windows_sys::PeekNamedPipe;
+        use std::os::windows::io::AsRawHandle;
+        use std::ptr::null_mut;
+        if unsafe {
+            PeekNamedPipe(
+                stderr.as_raw_handle(),
+                null_mut(),
+                0,
+                null_mut(),
+                &mut bytes_available,
+                null_mut(),
+            )
+        } == 0
+        {
+            return Err(Error::new(
+                ErrorKind::IOError,
+                format!(
+                    "PeekNamedPipe failed with {}",
+                    std::io::Error::last_os_error()
+                ),
+            ));
+        }
+    }
+    #[cfg(unix)]
+    {
+        use std::os::unix::io::AsRawFd;
+        if unsafe { libc::ioctl(stderr.as_raw_fd(), libc::FIONREAD, &mut bytes_available) } != 0 {
+            return Err(Error::new(
+                ErrorKind::IOError,
+                format!("ioctl failed with {}", std::io::Error::last_os_error()),
+            ));
+        }
+    }
+    Ok(bytes_available.try_into().unwrap())
+}
diff -pruN 43.0.0-1/rust-vendor/cc/src/target_info.rs 43.0.0-1ubuntu1/rust-vendor/cc/src/target_info.rs
--- 43.0.0-1/rust-vendor/cc/src/target_info.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/target_info.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,14 @@
+//! This file is generated code. Please edit the generator
+//! in dev-tools/gen-target-info if you need to make changes.
+
+pub const RISCV_ARCH_MAPPING: &[(&str, &str)] = &[
+    ("riscv32gc", "riscv32"),
+    ("riscv32i", "riscv32"),
+    ("riscv32im", "riscv32"),
+    ("riscv32ima", "riscv32"),
+    ("riscv32imac", "riscv32"),
+    ("riscv32imafc", "riscv32"),
+    ("riscv32imc", "riscv32"),
+    ("riscv64gc", "riscv64"),
+    ("riscv64imac", "riscv64"),
+];
diff -pruN 43.0.0-1/rust-vendor/cc/src/tempfile.rs 43.0.0-1ubuntu1/rust-vendor/cc/src/tempfile.rs
--- 43.0.0-1/rust-vendor/cc/src/tempfile.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/tempfile.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,86 @@
+#![cfg_attr(target_family = "wasm", allow(unused))]
+
+use std::{
+    collections::hash_map::RandomState,
+    fs::{remove_file, File, OpenOptions},
+    hash::{BuildHasher, Hasher},
+    io, os,
+    path::{Path, PathBuf},
+};
+
+#[cfg(not(any(unix, target_family = "wasm", windows)))]
+compile_error!("Your system is not supported since cc cannot create named tempfile");
+
+fn rand() -> u64 {
+    RandomState::new().build_hasher().finish()
+}
+
+fn tmpname(suffix: &str) -> String {
+    format!("{}{}", rand(), suffix)
+}
+
+fn create_named(path: &Path) -> io::Result<File> {
+    let mut open_options = OpenOptions::new();
+
+    open_options.read(true).write(true).create_new(true);
+
+    #[cfg(all(unix, not(target_os = "wasi")))]
+    <OpenOptions as os::unix::fs::OpenOptionsExt>::mode(&mut open_options, 0o600);
+
+    #[cfg(windows)]
+    <OpenOptions as os::windows::fs::OpenOptionsExt>::custom_flags(
+        &mut open_options,
+        crate::windows::windows_sys::FILE_ATTRIBUTE_TEMPORARY,
+    );
+
+    open_options.open(path)
+}
+
+pub(super) struct NamedTempfile {
+    path: PathBuf,
+    file: Option<File>,
+}
+
+impl NamedTempfile {
+    pub(super) fn new(base: &Path, suffix: &str) -> io::Result<Self> {
+        for _ in 0..10 {
+            let path = base.join(tmpname(suffix));
+            match create_named(&path) {
+                Ok(file) => {
+                    return Ok(Self {
+                        file: Some(file),
+                        path,
+                    })
+                }
+                Err(e) if e.kind() == io::ErrorKind::AlreadyExists => continue,
+                Err(e) => return Err(e),
+            };
+        }
+
+        Err(io::Error::new(
+            io::ErrorKind::AlreadyExists,
+            format!(
+                "too many temporary files exist in base `{}` with suffix `{}`",
+                base.display(),
+                suffix
+            ),
+        ))
+    }
+
+    pub(super) fn path(&self) -> &Path {
+        &self.path
+    }
+
+    pub(super) fn take_file(&mut self) -> Option<File> {
+        self.file.take()
+    }
+}
+
+impl Drop for NamedTempfile {
+    fn drop(&mut self) {
+        // On Windows you have to close all handle to it before
+        // removing the file.
+        self.file.take();
+        let _ = remove_file(&self.path);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/cc/src/tool.rs 43.0.0-1ubuntu1/rust-vendor/cc/src/tool.rs
--- 43.0.0-1/rust-vendor/cc/src/tool.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/tool.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,474 @@
+use std::{
+    borrow::Cow,
+    collections::HashMap,
+    env,
+    ffi::{OsStr, OsString},
+    io::Write,
+    path::{Path, PathBuf},
+    process::Command,
+    sync::RwLock,
+};
+
+use crate::{
+    command_helpers::{run_output, CargoOutput},
+    run,
+    tempfile::NamedTempfile,
+    Error, ErrorKind, OutputKind,
+};
+
+/// Configuration used to represent an invocation of a C compiler.
+///
+/// This can be used to figure out what compiler is in use, what the arguments
+/// to it are, and what the environment variables look like for the compiler.
+/// This can be used to further configure other build systems (e.g. forward
+/// along CC and/or CFLAGS) or the `to_command` method can be used to run the
+/// compiler itself.
+#[derive(Clone, Debug)]
+#[allow(missing_docs)]
+pub struct Tool {
+    pub(crate) path: PathBuf,
+    pub(crate) cc_wrapper_path: Option<PathBuf>,
+    pub(crate) cc_wrapper_args: Vec<OsString>,
+    pub(crate) args: Vec<OsString>,
+    pub(crate) env: Vec<(OsString, OsString)>,
+    pub(crate) family: ToolFamily,
+    pub(crate) cuda: bool,
+    pub(crate) removed_args: Vec<OsString>,
+    pub(crate) has_internal_target_arg: bool,
+}
+
+impl Tool {
+    pub(crate) fn new(
+        path: PathBuf,
+        cached_compiler_family: &RwLock<HashMap<Box<Path>, ToolFamily>>,
+        cargo_output: &CargoOutput,
+        out_dir: Option<&Path>,
+    ) -> Self {
+        Self::with_features(
+            path,
+            None,
+            false,
+            cached_compiler_family,
+            cargo_output,
+            out_dir,
+        )
+    }
+
+    pub(crate) fn with_clang_driver(
+        path: PathBuf,
+        clang_driver: Option<&str>,
+        cached_compiler_family: &RwLock<HashMap<Box<Path>, ToolFamily>>,
+        cargo_output: &CargoOutput,
+        out_dir: Option<&Path>,
+    ) -> Self {
+        Self::with_features(
+            path,
+            clang_driver,
+            false,
+            cached_compiler_family,
+            cargo_output,
+            out_dir,
+        )
+    }
+
+    /// Explicitly set the `ToolFamily`, skipping name-based detection.
+    pub(crate) fn with_family(path: PathBuf, family: ToolFamily) -> Self {
+        Self {
+            path,
+            cc_wrapper_path: None,
+            cc_wrapper_args: Vec::new(),
+            args: Vec::new(),
+            env: Vec::new(),
+            family,
+            cuda: false,
+            removed_args: Vec::new(),
+            has_internal_target_arg: false,
+        }
+    }
+
+    pub(crate) fn with_features(
+        path: PathBuf,
+        clang_driver: Option<&str>,
+        cuda: bool,
+        cached_compiler_family: &RwLock<HashMap<Box<Path>, ToolFamily>>,
+        cargo_output: &CargoOutput,
+        out_dir: Option<&Path>,
+    ) -> Self {
+        fn is_zig_cc(path: &Path, cargo_output: &CargoOutput) -> bool {
+            run_output(
+                Command::new(path).arg("--version"),
+                path,
+                // tool detection issues should always be shown as warnings
+                cargo_output,
+            )
+            .map(|o| String::from_utf8_lossy(&o).contains("ziglang"))
+            .unwrap_or_default()
+        }
+
+        fn detect_family_inner(
+            path: &Path,
+            cargo_output: &CargoOutput,
+            out_dir: Option<&Path>,
+        ) -> Result<ToolFamily, Error> {
+            let out_dir = out_dir
+                .map(Cow::Borrowed)
+                .unwrap_or_else(|| Cow::Owned(env::temp_dir()));
+
+            // Ensure all the parent directories exist otherwise temp file creation
+            // will fail
+            std::fs::create_dir_all(&out_dir).map_err(|err| Error {
+                kind: ErrorKind::IOError,
+                message: format!("failed to create OUT_DIR '{}': {}", out_dir.display(), err)
+                    .into(),
+            })?;
+
+            let mut tmp =
+                NamedTempfile::new(&out_dir, "detect_compiler_family.c").map_err(|err| Error {
+                    kind: ErrorKind::IOError,
+                    message: format!(
+                        "failed to create detect_compiler_family.c temp file in '{}': {}",
+                        out_dir.display(),
+                        err
+                    )
+                    .into(),
+                })?;
+            let mut tmp_file = tmp.take_file().unwrap();
+            tmp_file.write_all(include_bytes!("detect_compiler_family.c"))?;
+            // Close the file handle *now*, otherwise the compiler may fail to open it on Windows
+            // (#1082). The file stays on disk and its path remains valid until `tmp` is dropped.
+            tmp_file.flush()?;
+            tmp_file.sync_data()?;
+            drop(tmp_file);
+
+            let stdout = run_output(
+                Command::new(path).arg("-E").arg(tmp.path()),
+                path,
+                // When expanding the file, the compiler prints a lot of information to stderr
+                // that it is not an error, but related to expanding itself.
+                //
+                // cc would have to disable warning here to prevent generation of too many warnings.
+                &{
+                    let mut cargo_output = cargo_output.clone();
+                    cargo_output.warnings = cargo_output.debug;
+                    cargo_output
+                },
+            )?;
+            let stdout = String::from_utf8_lossy(&stdout);
+
+            cargo_output.print_debug(&stdout);
+
+            // https://gitlab.kitware.com/cmake/cmake/-/blob/69a2eeb9dff5b60f2f1e5b425002a0fd45b7cadb/Modules/CMakeDetermineCompilerId.cmake#L267-271
+            let accepts_cl_style_flags = run(Command::new(path).arg("-?"), path, &{
+                // the errors are not errors!
+                let mut cargo_output = cargo_output.clone();
+                cargo_output.warnings = cargo_output.debug;
+                cargo_output.output = OutputKind::Discard;
+                cargo_output
+            })
+            .is_ok();
+
+            let clang = stdout.contains(r#""clang""#);
+            let gcc = stdout.contains(r#""gcc""#);
+
+            match (clang, accepts_cl_style_flags, gcc) {
+                (clang_cl, true, _) => Ok(ToolFamily::Msvc { clang_cl }),
+                (true, false, _) => Ok(ToolFamily::Clang {
+                    zig_cc: is_zig_cc(path, cargo_output),
+                }),
+                (false, false, true) => Ok(ToolFamily::Gnu),
+                (false, false, false) => {
+                    cargo_output.print_warning(&"Compiler family detection failed since it does not define `__clang__`, `__GNUC__` or `_MSC_VER`, fallback to treating it as GNU");
+                    Err(Error::new(
+                        ErrorKind::ToolFamilyMacroNotFound,
+                        "Expects macro `__clang__`, `__GNUC__` or `_MSC_VER`, but found none",
+                    ))
+                }
+            }
+        }
+        let detect_family = |path: &Path| -> Result<ToolFamily, Error> {
+            if let Some(family) = cached_compiler_family.read().unwrap().get(path) {
+                return Ok(*family);
+            }
+
+            let family = detect_family_inner(path, cargo_output, out_dir)?;
+            cached_compiler_family
+                .write()
+                .unwrap()
+                .insert(path.into(), family);
+            Ok(family)
+        };
+
+        let family = detect_family(&path).unwrap_or_else(|e| {
+            cargo_output.print_warning(&format_args!(
+                "Compiler family detection failed due to error: {}",
+                e
+            ));
+            match path.file_name().map(OsStr::to_string_lossy) {
+                Some(fname) if fname.contains("clang-cl") => ToolFamily::Msvc { clang_cl: true },
+                Some(fname) if fname.ends_with("cl") || fname == "cl.exe" => {
+                    ToolFamily::Msvc { clang_cl: false }
+                }
+                Some(fname) if fname.contains("clang") => match clang_driver {
+                    Some("cl") => ToolFamily::Msvc { clang_cl: true },
+                    _ => ToolFamily::Clang {
+                        zig_cc: is_zig_cc(&path, cargo_output),
+                    },
+                },
+                Some(fname) if fname.contains("zig") => ToolFamily::Clang { zig_cc: true },
+                _ => ToolFamily::Gnu,
+            }
+        });
+
+        Tool {
+            path,
+            cc_wrapper_path: None,
+            cc_wrapper_args: Vec::new(),
+            args: Vec::new(),
+            env: Vec::new(),
+            family,
+            cuda,
+            removed_args: Vec::new(),
+            has_internal_target_arg: false,
+        }
+    }
+
+    /// Add an argument to be stripped from the final command arguments.
+    pub(crate) fn remove_arg(&mut self, flag: OsString) {
+        self.removed_args.push(flag);
+    }
+
+    /// Push an "exotic" flag to the end of the compiler's arguments list.
+    ///
+    /// Nvidia compiler accepts only the most common compiler flags like `-D`,
+    /// `-I`, `-c`, etc. Options meant specifically for the underlying
+    /// host C++ compiler have to be prefixed with `-Xcompiler`.
+    /// [Another possible future application for this function is passing
+    /// clang-specific flags to clang-cl, which otherwise accepts only
+    /// MSVC-specific options.]
+    pub(crate) fn push_cc_arg(&mut self, flag: OsString) {
+        if self.cuda {
+            self.args.push("-Xcompiler".into());
+        }
+        self.args.push(flag);
+    }
+
+    /// Checks if an argument or flag has already been specified or conflicts.
+    ///
+    /// Currently only checks optimization flags.
+    pub(crate) fn is_duplicate_opt_arg(&self, flag: &OsString) -> bool {
+        let flag = flag.to_str().unwrap();
+        let mut chars = flag.chars();
+
+        // Only duplicate check compiler flags
+        if self.is_like_msvc() {
+            if chars.next() != Some('/') {
+                return false;
+            }
+        } else if (self.is_like_gnu() || self.is_like_clang()) && chars.next() != Some('-') {
+            return false;
+        }
+
+        // Check for existing optimization flags (-O, /O)
+        if chars.next() == Some('O') {
+            return self
+                .args()
+                .iter()
+                .any(|a| a.to_str().unwrap_or("").chars().nth(1) == Some('O'));
+        }
+
+        // TODO Check for existing -m..., -m...=..., /arch:... flags
+        false
+    }
+
+    /// Don't push optimization arg if it conflicts with existing args.
+    pub(crate) fn push_opt_unless_duplicate(&mut self, flag: OsString) {
+        if self.is_duplicate_opt_arg(&flag) {
+            eprintln!("Info: Ignoring duplicate arg {:?}", &flag);
+        } else {
+            self.push_cc_arg(flag);
+        }
+    }
+
+    /// Converts this compiler into a `Command` that's ready to be run.
+    ///
+    /// This is useful for when the compiler needs to be executed and the
+    /// command returned will already have the initial arguments and environment
+    /// variables configured.
+    pub fn to_command(&self) -> Command {
+        let mut cmd = match self.cc_wrapper_path {
+            Some(ref cc_wrapper_path) => {
+                let mut cmd = Command::new(cc_wrapper_path);
+                cmd.arg(&self.path);
+                cmd
+            }
+            None => Command::new(&self.path),
+        };
+        cmd.args(&self.cc_wrapper_args);
+
+        let value = self
+            .args
+            .iter()
+            .filter(|a| !self.removed_args.contains(a))
+            .collect::<Vec<_>>();
+        cmd.args(&value);
+
+        for (k, v) in self.env.iter() {
+            cmd.env(k, v);
+        }
+        cmd
+    }
+
+    /// Returns the path for this compiler.
+    ///
+    /// Note that this may not be a path to a file on the filesystem, e.g. "cc",
+    /// but rather something which will be resolved when a process is spawned.
+    pub fn path(&self) -> &Path {
+        &self.path
+    }
+
+    /// Returns the default set of arguments to the compiler needed to produce
+    /// executables for the target this compiler generates.
+    pub fn args(&self) -> &[OsString] {
+        &self.args
+    }
+
+    /// Returns the set of environment variables needed for this compiler to
+    /// operate.
+    ///
+    /// This is typically only used for MSVC compilers currently.
+    pub fn env(&self) -> &[(OsString, OsString)] {
+        &self.env
+    }
+
+    /// Returns the compiler command in format of CC environment variable.
+    /// Or empty string if CC env was not present
+    ///
+    /// This is typically used by configure script
+    pub fn cc_env(&self) -> OsString {
+        match self.cc_wrapper_path {
+            Some(ref cc_wrapper_path) => {
+                let mut cc_env = cc_wrapper_path.as_os_str().to_owned();
+                cc_env.push(" ");
+                cc_env.push(self.path.to_path_buf().into_os_string());
+                for arg in self.cc_wrapper_args.iter() {
+                    cc_env.push(" ");
+                    cc_env.push(arg);
+                }
+                cc_env
+            }
+            None => OsString::from(""),
+        }
+    }
+
+    /// Returns the compiler flags in format of CFLAGS environment variable.
+    /// Important here - this will not be CFLAGS from env, its internal gcc's flags to use as CFLAGS
+    /// This is typically used by configure script
+    pub fn cflags_env(&self) -> OsString {
+        let mut flags = OsString::new();
+        for (i, arg) in self.args.iter().enumerate() {
+            if i > 0 {
+                flags.push(" ");
+            }
+            flags.push(arg);
+        }
+        flags
+    }
+
+    /// Whether the tool is GNU Compiler Collection-like.
+    pub fn is_like_gnu(&self) -> bool {
+        self.family == ToolFamily::Gnu
+    }
+
+    /// Whether the tool is Clang-like.
+    pub fn is_like_clang(&self) -> bool {
+        matches!(self.family, ToolFamily::Clang { .. })
+    }
+
+    /// Whether the tool is AppleClang under .xctoolchain
+    #[cfg(target_vendor = "apple")]
+    pub(crate) fn is_xctoolchain_clang(&self) -> bool {
+        let path = self.path.to_string_lossy();
+        path.contains(".xctoolchain/")
+    }
+    #[cfg(not(target_vendor = "apple"))]
+    pub(crate) fn is_xctoolchain_clang(&self) -> bool {
+        false
+    }
+
+    /// Whether the tool is MSVC-like.
+    pub fn is_like_msvc(&self) -> bool {
+        matches!(self.family, ToolFamily::Msvc { .. })
+    }
+}
+
+/// Represents the family of tools this tool belongs to.
+///
+/// Each family of tools differs in how and what arguments they accept.
+///
+/// Detection of a family is done on best-effort basis and may not accurately reflect the tool.
+#[derive(Copy, Clone, Debug, PartialEq)]
+pub enum ToolFamily {
+    /// Tool is GNU Compiler Collection-like.
+    Gnu,
+    /// Tool is Clang-like. It differs from the GCC in a sense that it accepts superset of flags
+    /// and its cross-compilation approach is different.
+    Clang { zig_cc: bool },
+    /// Tool is the MSVC cl.exe.
+    Msvc { clang_cl: bool },
+}
+
+impl ToolFamily {
+    /// What the flag to request debug info for this family of tools look like
+    pub(crate) fn add_debug_flags(&self, cmd: &mut Tool, dwarf_version: Option<u32>) {
+        match *self {
+            ToolFamily::Msvc { .. } => {
+                cmd.push_cc_arg("-Z7".into());
+            }
+            ToolFamily::Gnu | ToolFamily::Clang { .. } => {
+                cmd.push_cc_arg(
+                    dwarf_version
+                        .map_or_else(|| "-g".into(), |v| format!("-gdwarf-{}", v))
+                        .into(),
+                );
+            }
+        }
+    }
+
+    /// What the flag to force frame pointers.
+    pub(crate) fn add_force_frame_pointer(&self, cmd: &mut Tool) {
+        match *self {
+            ToolFamily::Gnu | ToolFamily::Clang { .. } => {
+                cmd.push_cc_arg("-fno-omit-frame-pointer".into());
+            }
+            _ => (),
+        }
+    }
+
+    /// What the flags to enable all warnings
+    pub(crate) fn warnings_flags(&self) -> &'static str {
+        match *self {
+            ToolFamily::Msvc { .. } => "-W4",
+            ToolFamily::Gnu | ToolFamily::Clang { .. } => "-Wall",
+        }
+    }
+
+    /// What the flags to enable extra warnings
+    pub(crate) fn extra_warnings_flags(&self) -> Option<&'static str> {
+        match *self {
+            ToolFamily::Msvc { .. } => None,
+            ToolFamily::Gnu | ToolFamily::Clang { .. } => Some("-Wextra"),
+        }
+    }
+
+    /// What the flag to turn warning into errors
+    pub(crate) fn warnings_to_errors_flag(&self) -> &'static str {
+        match *self {
+            ToolFamily::Msvc { .. } => "-WX",
+            ToolFamily::Gnu | ToolFamily::Clang { .. } => "-Werror",
+        }
+    }
+
+    pub(crate) fn verbose_stderr(&self) -> bool {
+        matches!(*self, ToolFamily::Clang { .. })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/cc/src/utilities.rs 43.0.0-1ubuntu1/rust-vendor/cc/src/utilities.rs
--- 43.0.0-1/rust-vendor/cc/src/utilities.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/utilities.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,45 @@
+use std::{
+    ffi::OsStr,
+    fmt::{self, Write},
+    path::Path,
+};
+
+pub(super) struct JoinOsStrs<'a, T> {
+    pub(super) slice: &'a [T],
+    pub(super) delimiter: char,
+}
+
+impl<T> fmt::Display for JoinOsStrs<'_, T>
+where
+    T: AsRef<OsStr>,
+{
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        let len = self.slice.len();
+        for (index, os_str) in self.slice.iter().enumerate() {
+            // TODO: Use OsStr::display once it is stablised,
+            // Path and OsStr has the same `Display` impl
+            write!(f, "{}", Path::new(os_str).display())?;
+            if index + 1 < len {
+                f.write_char(self.delimiter)?;
+            }
+        }
+        Ok(())
+    }
+}
+
+pub(super) struct OptionOsStrDisplay<T>(pub(super) Option<T>);
+
+impl<T> fmt::Display for OptionOsStrDisplay<T>
+where
+    T: AsRef<OsStr>,
+{
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        // TODO: Use OsStr::display once it is stablised
+        // Path and OsStr has the same `Display` impl
+        if let Some(os_str) = self.0.as_ref() {
+            write!(f, "Some({})", Path::new(os_str).display())
+        } else {
+            f.write_str("None")
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/cc/src/windows/com.rs 43.0.0-1ubuntu1/rust-vendor/cc/src/windows/com.rs
--- 43.0.0-1/rust-vendor/cc/src/windows/com.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/windows/com.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,110 @@
+// Copyright © 2017 winapi-rs developers
+// Licensed under the Apache License, Version 2.0
+// <LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option.
+// All files in the project carrying such notice may not be copied, modified, or distributed
+// except according to those terms.
+
+use crate::windows::{
+    winapi::{IUnknown, Interface},
+    windows_sys::{
+        CoInitializeEx, SysFreeString, SysStringLen, BSTR, COINIT_MULTITHREADED, HRESULT, S_FALSE,
+        S_OK,
+    },
+};
+use std::{
+    convert::TryInto,
+    ffi::OsString,
+    ops::Deref,
+    os::windows::ffi::OsStringExt,
+    ptr::{null, null_mut},
+    slice::from_raw_parts,
+};
+
+pub fn initialize() -> Result<(), HRESULT> {
+    let err = unsafe { CoInitializeEx(null(), COINIT_MULTITHREADED.try_into().unwrap()) };
+    if err != S_OK && err != S_FALSE {
+        // S_FALSE just means COM is already initialized
+        Err(err)
+    } else {
+        Ok(())
+    }
+}
+
+pub struct ComPtr<T>(*mut T)
+where
+    T: Interface;
+impl<T> ComPtr<T>
+where
+    T: Interface,
+{
+    /// Creates a `ComPtr` to wrap a raw pointer.
+    /// It takes ownership over the pointer which means it does __not__ call `AddRef`.
+    /// `T` __must__ be a COM interface that inherits from `IUnknown`.
+    pub unsafe fn from_raw(ptr: *mut T) -> ComPtr<T> {
+        assert!(!ptr.is_null());
+        ComPtr(ptr)
+    }
+    /// For internal use only.
+    fn as_unknown(&self) -> &IUnknown {
+        unsafe { &*(self.0 as *mut IUnknown) }
+    }
+    /// Performs `QueryInterface` fun.
+    pub fn cast<U>(&self) -> Result<ComPtr<U>, i32>
+    where
+        U: Interface,
+    {
+        let mut obj = null_mut();
+        let err = unsafe { self.as_unknown().QueryInterface(&U::uuidof(), &mut obj) };
+        if err < 0 {
+            return Err(err);
+        }
+        Ok(unsafe { ComPtr::from_raw(obj as *mut U) })
+    }
+}
+impl<T> Deref for ComPtr<T>
+where
+    T: Interface,
+{
+    type Target = T;
+    fn deref(&self) -> &T {
+        unsafe { &*self.0 }
+    }
+}
+impl<T> Clone for ComPtr<T>
+where
+    T: Interface,
+{
+    fn clone(&self) -> Self {
+        unsafe {
+            self.as_unknown().AddRef();
+            ComPtr::from_raw(self.0)
+        }
+    }
+}
+impl<T> Drop for ComPtr<T>
+where
+    T: Interface,
+{
+    fn drop(&mut self) {
+        unsafe {
+            self.as_unknown().Release();
+        }
+    }
+}
+pub struct BStr(BSTR);
+impl BStr {
+    pub unsafe fn from_raw(s: BSTR) -> BStr {
+        BStr(s)
+    }
+    pub fn to_osstring(&self) -> OsString {
+        let len = unsafe { SysStringLen(self.0) };
+        let slice = unsafe { from_raw_parts(self.0, len as usize) };
+        OsStringExt::from_wide(slice)
+    }
+}
+impl Drop for BStr {
+    fn drop(&mut self) {
+        unsafe { SysFreeString(self.0) };
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/cc/src/windows/find_tools.rs 43.0.0-1ubuntu1/rust-vendor/cc/src/windows/find_tools.rs
--- 43.0.0-1/rust-vendor/cc/src/windows/find_tools.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/windows/find_tools.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1184 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! A helper module to looking for windows-specific tools:
+//! 1. On Windows host, probe the Windows Registry if needed;
+//! 2. On non-Windows host, check specified environment variables.
+
+#![allow(clippy::upper_case_acronyms)]
+
+use std::{
+    env,
+    ffi::{OsStr, OsString},
+    ops::Deref,
+    path::PathBuf,
+    process::Command,
+    sync::Arc,
+};
+
+use crate::Tool;
+use crate::ToolFamily;
+
+const MSVC_FAMILY: ToolFamily = ToolFamily::Msvc { clang_cl: false };
+
+#[derive(Copy, Clone)]
+struct TargetArch<'a>(pub &'a str);
+
+impl PartialEq<&str> for TargetArch<'_> {
+    fn eq(&self, other: &&str) -> bool {
+        self.0 == *other
+    }
+}
+
+impl<'a> From<TargetArch<'a>> for &'a str {
+    fn from(target: TargetArch<'a>) -> Self {
+        target.0
+    }
+}
+
+pub(crate) enum Env {
+    Owned(OsString),
+    Arced(Arc<OsStr>),
+}
+
+impl AsRef<OsStr> for Env {
+    fn as_ref(&self) -> &OsStr {
+        self.deref()
+    }
+}
+
+impl Deref for Env {
+    type Target = OsStr;
+
+    fn deref(&self) -> &Self::Target {
+        match self {
+            Env::Owned(os_str) => os_str,
+            Env::Arced(os_str) => os_str,
+        }
+    }
+}
+
+impl From<Env> for PathBuf {
+    fn from(env: Env) -> Self {
+        match env {
+            Env::Owned(os_str) => PathBuf::from(os_str),
+            Env::Arced(os_str) => PathBuf::from(os_str.deref()),
+        }
+    }
+}
+
+pub(crate) trait EnvGetter {
+    fn get_env(&self, name: &'static str) -> Option<Env>;
+}
+
+struct StdEnvGetter;
+
+impl EnvGetter for StdEnvGetter {
+    #[allow(clippy::disallowed_methods)]
+    fn get_env(&self, name: &'static str) -> Option<Env> {
+        env::var_os(name).map(Env::Owned)
+    }
+}
+
+/// Attempts to find a tool within an MSVC installation using the Windows
+/// registry as a point to search from.
+///
+/// The `target` argument is the target that the tool should work for (e.g.
+/// compile or link for) and the `tool` argument is the tool to find (e.g.
+/// `cl.exe` or `link.exe`).
+///
+/// This function will return `None` if the tool could not be found, or it will
+/// return `Some(cmd)` which represents a command that's ready to execute the
+/// tool with the appropriate environment variables set.
+///
+/// Note that this function always returns `None` for non-MSVC targets.
+pub fn find(target: &str, tool: &str) -> Option<Command> {
+    find_tool(target, tool).map(|c| c.to_command())
+}
+
+/// Similar to the `find` function above, this function will attempt the same
+/// operation (finding a MSVC tool in a local install) but instead returns a
+/// `Tool` which may be introspected.
+pub fn find_tool(target: &str, tool: &str) -> Option<Tool> {
+    find_tool_inner(target, tool, &StdEnvGetter)
+}
+
+pub(crate) fn find_tool_inner(
+    target: &str,
+    tool: &str,
+    env_getter: &dyn EnvGetter,
+) -> Option<Tool> {
+    // This logic is all tailored for MSVC, if we're not that then bail out
+    // early.
+    if !target.contains("msvc") {
+        return None;
+    }
+
+    // Split the target to get the arch.
+    let target = TargetArch(target.split_once('-')?.0);
+
+    // Looks like msbuild isn't located in the same location as other tools like
+    // cl.exe and lib.exe.
+    if tool.contains("msbuild") {
+        return impl_::find_msbuild(target, env_getter);
+    }
+
+    // Looks like devenv isn't located in the same location as other tools like
+    // cl.exe and lib.exe.
+    if tool.contains("devenv") {
+        return impl_::find_devenv(target, env_getter);
+    }
+
+    // Ok, if we're here, now comes the fun part of the probing. Default shells
+    // or shells like MSYS aren't really configured to execute `cl.exe` and the
+    // various compiler tools shipped as part of Visual Studio. Here we try to
+    // first find the relevant tool, then we also have to be sure to fill in
+    // environment variables like `LIB`, `INCLUDE`, and `PATH` to ensure that
+    // the tool is actually usable.
+
+    impl_::find_msvc_environment(tool, target, env_getter)
+        .or_else(|| impl_::find_msvc_15plus(tool, target, env_getter))
+        .or_else(|| impl_::find_msvc_14(tool, target, env_getter))
+}
+
+/// A version of Visual Studio
+#[derive(Debug, PartialEq, Eq, Copy, Clone)]
+#[non_exhaustive]
+pub enum VsVers {
+    /// Visual Studio 12 (2013)
+    #[deprecated(
+        note = "Visual Studio 12 is no longer supported. cc will never return this value."
+    )]
+    Vs12,
+    /// Visual Studio 14 (2015)
+    Vs14,
+    /// Visual Studio 15 (2017)
+    Vs15,
+    /// Visual Studio 16 (2019)
+    Vs16,
+    /// Visual Studio 17 (2022)
+    Vs17,
+}
+
+/// Find the most recent installed version of Visual Studio
+///
+/// This is used by the cmake crate to figure out the correct
+/// generator.
+#[allow(clippy::disallowed_methods)]
+pub fn find_vs_version() -> Result<VsVers, String> {
+    fn has_msbuild_version(version: &str) -> bool {
+        impl_::has_msbuild_version(version, &StdEnvGetter)
+    }
+
+    match std::env::var("VisualStudioVersion") {
+        Ok(version) => match &version[..] {
+            "17.0" => Ok(VsVers::Vs17),
+            "16.0" => Ok(VsVers::Vs16),
+            "15.0" => Ok(VsVers::Vs15),
+            "14.0" => Ok(VsVers::Vs14),
+            vers => Err(format!(
+                "\n\n\
+                 unsupported or unknown VisualStudio version: {}\n\
+                 if another version is installed consider running \
+                 the appropriate vcvars script before building this \
+                 crate\n\
+                 ",
+                vers
+            )),
+        },
+        _ => {
+            // Check for the presence of a specific registry key
+            // that indicates visual studio is installed.
+            if has_msbuild_version("17.0") {
+                Ok(VsVers::Vs17)
+            } else if has_msbuild_version("16.0") {
+                Ok(VsVers::Vs16)
+            } else if has_msbuild_version("15.0") {
+                Ok(VsVers::Vs15)
+            } else if has_msbuild_version("14.0") {
+                Ok(VsVers::Vs14)
+            } else {
+                Err("\n\n\
+                     couldn't determine visual studio generator\n\
+                     if VisualStudio is installed, however, consider \
+                     running the appropriate vcvars script before building \
+                     this crate\n\
+                     "
+                .to_string())
+            }
+        }
+    }
+}
+
+/// Windows Implementation.
+#[cfg(windows)]
+mod impl_ {
+    use crate::windows::com;
+    use crate::windows::registry::{RegistryKey, LOCAL_MACHINE};
+    use crate::windows::setup_config::SetupConfiguration;
+    use crate::windows::vs_instances::{VsInstances, VswhereInstance};
+    use crate::windows::windows_sys::{
+        GetMachineTypeAttributes, GetProcAddress, LoadLibraryA, UserEnabled, HMODULE,
+        IMAGE_FILE_MACHINE_AMD64, MACHINE_ATTRIBUTES, S_OK,
+    };
+    use std::convert::TryFrom;
+    use std::env;
+    use std::ffi::OsString;
+    use std::fs::File;
+    use std::io::Read;
+    use std::iter;
+    use std::mem;
+    use std::path::{Path, PathBuf};
+    use std::process::Command;
+    use std::str::FromStr;
+    use std::sync::atomic::{AtomicBool, Ordering};
+    use std::sync::Once;
+
+    use super::{EnvGetter, TargetArch, MSVC_FAMILY};
+    use crate::Tool;
+
+    struct MsvcTool {
+        tool: PathBuf,
+        libs: Vec<PathBuf>,
+        path: Vec<PathBuf>,
+        include: Vec<PathBuf>,
+    }
+
+    struct LibraryHandle(HMODULE);
+
+    impl LibraryHandle {
+        fn new(name: &[u8]) -> Option<Self> {
+            let handle = unsafe { LoadLibraryA(name.as_ptr() as _) };
+            (!handle.is_null()).then_some(Self(handle))
+        }
+
+        /// Get a function pointer to a function in the library.
+        /// # SAFETY
+        ///
+        /// The caller must ensure that the function signature matches the actual function.
+        /// The easiest way to do this is to add an entry to windows_sys_no_link.list and use the
+        /// generated function for `func_signature`.
+        ///
+        /// The function returned cannot be used after the handle is dropped.
+        unsafe fn get_proc_address<F>(&self, name: &[u8]) -> Option<F> {
+            let symbol = GetProcAddress(self.0, name.as_ptr() as _);
+            symbol.map(|symbol| mem::transmute_copy(&symbol))
+        }
+    }
+
+    type GetMachineTypeAttributesFuncType =
+        unsafe extern "system" fn(u16, *mut MACHINE_ATTRIBUTES) -> i32;
+    const _: () = {
+        // Ensure that our hand-written signature matches the actual function signature.
+        // We can't use `GetMachineTypeAttributes` outside of a const scope otherwise we'll end up statically linking to
+        // it, which will fail to load on older versions of Windows.
+        let _: GetMachineTypeAttributesFuncType = GetMachineTypeAttributes;
+    };
+
+    fn is_amd64_emulation_supported_inner() -> Option<bool> {
+        // GetMachineTypeAttributes is only available on Win11 22000+, so dynamically load it.
+        let kernel32 = LibraryHandle::new(b"kernel32.dll\0")?;
+        // SAFETY: GetMachineTypeAttributesFuncType is checked to match the real function signature.
+        let get_machine_type_attributes = unsafe {
+            kernel32
+                .get_proc_address::<GetMachineTypeAttributesFuncType>(b"GetMachineTypeAttributes\0")
+        }?;
+        let mut attributes = Default::default();
+        if unsafe { get_machine_type_attributes(IMAGE_FILE_MACHINE_AMD64, &mut attributes) } == S_OK
+        {
+            Some((attributes & UserEnabled) != 0)
+        } else {
+            Some(false)
+        }
+    }
+
+    fn is_amd64_emulation_supported() -> bool {
+        // TODO: Replace with a OnceLock once MSRV is 1.70.
+        static LOAD_VALUE: Once = Once::new();
+        static IS_SUPPORTED: AtomicBool = AtomicBool::new(false);
+
+        // Using Relaxed ordering since the Once is providing synchronization.
+        LOAD_VALUE.call_once(|| {
+            IS_SUPPORTED.store(
+                is_amd64_emulation_supported_inner().unwrap_or(false),
+                Ordering::Relaxed,
+            );
+        });
+        IS_SUPPORTED.load(Ordering::Relaxed)
+    }
+
+    impl MsvcTool {
+        fn new(tool: PathBuf) -> MsvcTool {
+            MsvcTool {
+                tool,
+                libs: Vec::new(),
+                path: Vec::new(),
+                include: Vec::new(),
+            }
+        }
+
+        fn into_tool(self, env_getter: &dyn EnvGetter) -> Tool {
+            let MsvcTool {
+                tool,
+                libs,
+                path,
+                include,
+            } = self;
+            let mut tool = Tool::with_family(tool, MSVC_FAMILY);
+            add_env(&mut tool, "LIB", libs, env_getter);
+            add_env(&mut tool, "PATH", path, env_getter);
+            add_env(&mut tool, "INCLUDE", include, env_getter);
+            tool
+        }
+    }
+
+    /// Checks to see if the `VSCMD_ARG_TGT_ARCH` environment variable matches the
+    /// given target's arch. Returns `None` if the variable does not exist.
+    fn is_vscmd_target(target: TargetArch<'_>, env_getter: &dyn EnvGetter) -> Option<bool> {
+        let vscmd_arch = env_getter.get_env("VSCMD_ARG_TGT_ARCH")?;
+        // Convert the Rust target arch to its VS arch equivalent.
+        let arch = match target.into() {
+            "x86_64" => "x64",
+            "aarch64" | "arm64ec" => "arm64",
+            "i686" | "i586" => "x86",
+            "thumbv7a" => "arm",
+            // An unrecognized arch.
+            _ => return Some(false),
+        };
+        Some(vscmd_arch.as_ref() == arch)
+    }
+
+    /// Attempt to find the tool using environment variables set by vcvars.
+    pub(super) fn find_msvc_environment(
+        tool: &str,
+        target: TargetArch<'_>,
+        env_getter: &dyn EnvGetter,
+    ) -> Option<Tool> {
+        // Early return if the environment doesn't contain a VC install.
+        env_getter.get_env("VCINSTALLDIR")?;
+        let vs_install_dir: PathBuf = env_getter.get_env("VSINSTALLDIR")?.into();
+
+        // If the vscmd target differs from the requested target then
+        // attempt to get the tool using the VS install directory.
+        if is_vscmd_target(target, env_getter) == Some(false) {
+            // We will only get here with versions 15+.
+            tool_from_vs15plus_instance(tool, target, &vs_install_dir, env_getter)
+        } else {
+            // Fallback to simply using the current environment.
+            env_getter
+                .get_env("PATH")
+                .and_then(|path| {
+                    env::split_paths(&path)
+                        .map(|p| p.join(tool))
+                        .find(|p| p.exists())
+                })
+                .map(|path| Tool::with_family(path, MSVC_FAMILY))
+        }
+    }
+
+    fn find_msbuild_vs17(target: TargetArch<'_>, env_getter: &dyn EnvGetter) -> Option<Tool> {
+        find_tool_in_vs16plus_path(r"MSBuild\Current\Bin\MSBuild.exe", target, "17", env_getter)
+    }
+
+    #[allow(bare_trait_objects)]
+    fn vs16plus_instances(
+        target: TargetArch<'_>,
+        version: &'static str,
+        env_getter: &dyn EnvGetter,
+    ) -> Box<Iterator<Item = PathBuf>> {
+        let instances = if let Some(instances) = vs15plus_instances(target, env_getter) {
+            instances
+        } else {
+            return Box::new(iter::empty());
+        };
+        Box::new(instances.into_iter().filter_map(move |instance| {
+            let installation_name = instance.installation_name()?;
+            if installation_name.starts_with(&format!("VisualStudio/{}.", version))
+                || installation_name.starts_with(&format!("VisualStudioPreview/{}.", version))
+            {
+                Some(instance.installation_path()?)
+            } else {
+                None
+            }
+        }))
+    }
+
+    fn find_tool_in_vs16plus_path(
+        tool: &str,
+        target: TargetArch<'_>,
+        version: &'static str,
+        env_getter: &dyn EnvGetter,
+    ) -> Option<Tool> {
+        vs16plus_instances(target, version, env_getter)
+            .filter_map(|path| {
+                let path = path.join(tool);
+                if !path.is_file() {
+                    return None;
+                }
+                let mut tool = Tool::with_family(path, MSVC_FAMILY);
+                if target == "x86_64" {
+                    tool.env.push(("Platform".into(), "X64".into()));
+                }
+                if target == "aarch64" || target == "arm64ec" {
+                    tool.env.push(("Platform".into(), "ARM64".into()));
+                }
+                Some(tool)
+            })
+            .next()
+    }
+
+    fn find_msbuild_vs16(target: TargetArch<'_>, env_getter: &dyn EnvGetter) -> Option<Tool> {
+        find_tool_in_vs16plus_path(r"MSBuild\Current\Bin\MSBuild.exe", target, "16", env_getter)
+    }
+
+    // In MSVC 15 (2017) MS once again changed the scheme for locating
+    // the tooling.  Now we must go through some COM interfaces, which
+    // is super fun for Rust.
+    //
+    // Note that much of this logic can be found [online] wrt paths, COM, etc.
+    //
+    // [online]: https://blogs.msdn.microsoft.com/vcblog/2017/03/06/finding-the-visual-c-compiler-tools-in-visual-studio-2017/
+    //
+    // Returns MSVC 15+ instances (15, 16 right now), the order should be consider undefined.
+    //
+    // However, on ARM64 this method doesn't work because VS Installer fails to register COM component on ARM64.
+    // Hence, as the last resort we try to use vswhere.exe to list available instances.
+    fn vs15plus_instances(
+        target: TargetArch<'_>,
+        env_getter: &dyn EnvGetter,
+    ) -> Option<VsInstances> {
+        vs15plus_instances_using_com()
+            .or_else(|| vs15plus_instances_using_vswhere(target, env_getter))
+    }
+
+    fn vs15plus_instances_using_com() -> Option<VsInstances> {
+        com::initialize().ok()?;
+
+        let config = SetupConfiguration::new().ok()?;
+        let enum_setup_instances = config.enum_all_instances().ok()?;
+
+        Some(VsInstances::ComBased(enum_setup_instances))
+    }
+
+    fn vs15plus_instances_using_vswhere(
+        target: TargetArch<'_>,
+        env_getter: &dyn EnvGetter,
+    ) -> Option<VsInstances> {
+        let program_files_path = env_getter
+            .get_env("ProgramFiles(x86)")
+            .or_else(|| env_getter.get_env("ProgramFiles"))?;
+
+        let program_files_path = Path::new(program_files_path.as_ref());
+
+        let vswhere_path =
+            program_files_path.join(r"Microsoft Visual Studio\Installer\vswhere.exe");
+
+        if !vswhere_path.exists() {
+            return None;
+        }
+
+        let tools_arch = match target.into() {
+            "i586" | "i686" | "x86_64" => Some("x86.x64"),
+            "arm" | "thumbv7a" => Some("ARM"),
+            "aarch64" | "arm64ec" => Some("ARM64"),
+            _ => None,
+        };
+
+        let vswhere_output = Command::new(vswhere_path)
+            .args([
+                "-latest",
+                "-products",
+                "*",
+                "-requires",
+                &format!("Microsoft.VisualStudio.Component.VC.Tools.{}", tools_arch?),
+                "-format",
+                "text",
+                "-nologo",
+            ])
+            .stderr(std::process::Stdio::inherit())
+            .output()
+            .ok()?;
+
+        let vs_instances =
+            VsInstances::VswhereBased(VswhereInstance::try_from(&vswhere_output.stdout).ok()?);
+
+        Some(vs_instances)
+    }
+
+    // Inspired from official microsoft/vswhere ParseVersionString
+    // i.e. at most four u16 numbers separated by '.'
+    fn parse_version(version: &str) -> Option<Vec<u16>> {
+        version
+            .split('.')
+            .map(|chunk| u16::from_str(chunk).ok())
+            .collect()
+    }
+
+    pub(super) fn find_msvc_15plus(
+        tool: &str,
+        target: TargetArch<'_>,
+        env_getter: &dyn EnvGetter,
+    ) -> Option<Tool> {
+        let iter = vs15plus_instances(target, env_getter)?;
+        iter.into_iter()
+            .filter_map(|instance| {
+                let version = parse_version(&instance.installation_version()?)?;
+                let instance_path = instance.installation_path()?;
+                let tool = tool_from_vs15plus_instance(tool, target, &instance_path, env_getter)?;
+                Some((version, tool))
+            })
+            .max_by(|(a_version, _), (b_version, _)| a_version.cmp(b_version))
+            .map(|(_version, tool)| tool)
+    }
+
+    // While the paths to Visual Studio 2017's devenv and MSBuild could
+    // potentially be retrieved from the registry, finding them via
+    // SetupConfiguration has shown to be [more reliable], and is preferred
+    // according to Microsoft. To help head off potential regressions though,
+    // we keep the registry method as a fallback option.
+    //
+    // [more reliable]: https://github.com/rust-lang/cc-rs/pull/331
+    fn find_tool_in_vs15_path(
+        tool: &str,
+        target: TargetArch<'_>,
+        env_getter: &dyn EnvGetter,
+    ) -> Option<Tool> {
+        let mut path = match vs15plus_instances(target, env_getter) {
+            Some(instances) => instances
+                .into_iter()
+                .filter_map(|instance| instance.installation_path())
+                .map(|path| path.join(tool))
+                .find(|path| path.is_file()),
+            None => None,
+        };
+
+        if path.is_none() {
+            let key = r"SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7";
+            path = LOCAL_MACHINE
+                .open(key.as_ref())
+                .ok()
+                .and_then(|key| key.query_str("15.0").ok())
+                .map(|path| PathBuf::from(path).join(tool))
+                .and_then(|path| if path.is_file() { Some(path) } else { None });
+        }
+
+        path.map(|path| {
+            let mut tool = Tool::with_family(path, MSVC_FAMILY);
+            if target == "x86_64" {
+                tool.env.push(("Platform".into(), "X64".into()));
+            } else if target == "aarch64" {
+                tool.env.push(("Platform".into(), "ARM64".into()));
+            }
+            tool
+        })
+    }
+
+    fn tool_from_vs15plus_instance(
+        tool: &str,
+        target: TargetArch<'_>,
+        instance_path: &Path,
+        env_getter: &dyn EnvGetter,
+    ) -> Option<Tool> {
+        let (root_path, bin_path, host_dylib_path, lib_path, alt_lib_path, include_path) =
+            vs15plus_vc_paths(target, instance_path, env_getter)?;
+        let tool_path = bin_path.join(tool);
+        if !tool_path.exists() {
+            return None;
+        };
+
+        let mut tool = MsvcTool::new(tool_path);
+        tool.path.push(bin_path.clone());
+        tool.path.push(host_dylib_path);
+        if let Some(alt_lib_path) = alt_lib_path {
+            tool.libs.push(alt_lib_path);
+        }
+        tool.libs.push(lib_path);
+        tool.include.push(include_path);
+
+        if let Some((atl_lib_path, atl_include_path)) = atl_paths(target, &root_path) {
+            tool.libs.push(atl_lib_path);
+            tool.include.push(atl_include_path);
+        }
+
+        add_sdks(&mut tool, target, env_getter)?;
+
+        Some(tool.into_tool(env_getter))
+    }
+
+    fn vs15plus_vc_paths(
+        target: TargetArch<'_>,
+        instance_path: &Path,
+        env_getter: &dyn EnvGetter,
+    ) -> Option<(PathBuf, PathBuf, PathBuf, PathBuf, Option<PathBuf>, PathBuf)> {
+        let version = vs15plus_vc_read_version(instance_path)?;
+
+        let hosts = match host_arch() {
+            X86 => &["X86"],
+            X86_64 => &["X64"],
+            // Starting with VS 17.4, there is a natively hosted compiler on ARM64:
+            // https://devblogs.microsoft.com/visualstudio/arm64-visual-studio-is-officially-here/
+            // On older versions of VS, we use x64 if running under emulation is supported,
+            // otherwise use x86.
+            AARCH64 => {
+                if is_amd64_emulation_supported() {
+                    &["ARM64", "X64", "X86"][..]
+                } else {
+                    &["ARM64", "X86"]
+                }
+            }
+            _ => return None,
+        };
+        let target = lib_subdir(target)?;
+        // The directory layout here is MSVC/bin/Host$host/$target/
+        let path = instance_path.join(r"VC\Tools\MSVC").join(version);
+        // We use the first available host architecture that can build for the target
+        let (host_path, host) = hosts.iter().find_map(|&x| {
+            let candidate = path.join("bin").join(format!("Host{}", x));
+            if candidate.join(target).exists() {
+                Some((candidate, x))
+            } else {
+                None
+            }
+        })?;
+        // This is the path to the toolchain for a particular target, running
+        // on a given host
+        let bin_path = host_path.join(target);
+        // But! we also need PATH to contain the target directory for the host
+        // architecture, because it contains dlls like mspdb140.dll compiled for
+        // the host architecture.
+        let host_dylib_path = host_path.join(host.to_lowercase());
+        let lib_fragment = if use_spectre_mitigated_libs(env_getter) {
+            r"lib\spectre"
+        } else {
+            "lib"
+        };
+        let lib_path = path.join(lib_fragment).join(target);
+        let alt_lib_path = (target == "arm64ec").then(|| path.join(lib_fragment).join("arm64ec"));
+        let include_path = path.join("include");
+        Some((
+            path,
+            bin_path,
+            host_dylib_path,
+            lib_path,
+            alt_lib_path,
+            include_path,
+        ))
+    }
+
+    fn vs15plus_vc_read_version(dir: &Path) -> Option<String> {
+        // Try to open the default version file.
+        let mut version_path: PathBuf =
+            dir.join(r"VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt");
+        let mut version_file = if let Ok(f) = File::open(&version_path) {
+            f
+        } else {
+            // If the default doesn't exist, search for other version files.
+            // These are in the form Microsoft.VCToolsVersion.v143.default.txt
+            // where `143` is any three decimal digit version number.
+            // This sorts versions by lexical order and selects the highest version.
+            let mut version_file = String::new();
+            version_path.pop();
+            for file in version_path.read_dir().ok()? {
+                let name = file.ok()?.file_name();
+                let name = name.to_str()?;
+                if name.starts_with("Microsoft.VCToolsVersion.v")
+                    && name.ends_with(".default.txt")
+                    && name > &version_file
+                {
+                    version_file.replace_range(.., name);
+                }
+            }
+            if version_file.is_empty() {
+                return None;
+            }
+            version_path.push(version_file);
+            File::open(version_path).ok()?
+        };
+
+        // Get the version string from the file we found.
+        let mut version = String::new();
+        version_file.read_to_string(&mut version).ok()?;
+        version.truncate(version.trim_end().len());
+        Some(version)
+    }
+
+    fn use_spectre_mitigated_libs(env_getter: &dyn EnvGetter) -> bool {
+        env_getter
+            .get_env("VSCMD_ARG_VCVARS_SPECTRE")
+            .map(|env| env.as_ref() == "spectre")
+            .unwrap_or_default()
+    }
+
+    fn atl_paths(target: TargetArch<'_>, path: &Path) -> Option<(PathBuf, PathBuf)> {
+        let atl_path = path.join("atlmfc");
+        let sub = lib_subdir(target)?;
+        if atl_path.exists() {
+            Some((atl_path.join("lib").join(sub), atl_path.join("include")))
+        } else {
+            None
+        }
+    }
+
+    // For MSVC 14 we need to find the Universal CRT as well as either
+    // the Windows 10 SDK or Windows 8.1 SDK.
+    pub(super) fn find_msvc_14(
+        tool: &str,
+        target: TargetArch<'_>,
+        env_getter: &dyn EnvGetter,
+    ) -> Option<Tool> {
+        let vcdir = get_vc_dir("14.0")?;
+        let mut tool = get_tool(tool, &vcdir, target)?;
+        add_sdks(&mut tool, target, env_getter)?;
+        Some(tool.into_tool(env_getter))
+    }
+
+    fn add_sdks(
+        tool: &mut MsvcTool,
+        target: TargetArch<'_>,
+        env_getter: &dyn EnvGetter,
+    ) -> Option<()> {
+        let sub = lib_subdir(target)?;
+        let (ucrt, ucrt_version) = get_ucrt_dir()?;
+
+        let host = match host_arch() {
+            X86 => "x86",
+            X86_64 => "x64",
+            AARCH64 => "arm64",
+            _ => return None,
+        };
+
+        tool.path
+            .push(ucrt.join("bin").join(&ucrt_version).join(host));
+
+        let ucrt_include = ucrt.join("include").join(&ucrt_version);
+        tool.include.push(ucrt_include.join("ucrt"));
+
+        let ucrt_lib = ucrt.join("lib").join(&ucrt_version);
+        tool.libs.push(ucrt_lib.join("ucrt").join(sub));
+
+        if let Some((sdk, version)) = get_sdk10_dir(env_getter) {
+            tool.path.push(sdk.join("bin").join(host));
+            let sdk_lib = sdk.join("lib").join(&version);
+            tool.libs.push(sdk_lib.join("um").join(sub));
+            let sdk_include = sdk.join("include").join(&version);
+            tool.include.push(sdk_include.join("um"));
+            tool.include.push(sdk_include.join("cppwinrt"));
+            tool.include.push(sdk_include.join("winrt"));
+            tool.include.push(sdk_include.join("shared"));
+        } else if let Some(sdk) = get_sdk81_dir() {
+            tool.path.push(sdk.join("bin").join(host));
+            let sdk_lib = sdk.join("lib").join("winv6.3");
+            tool.libs.push(sdk_lib.join("um").join(sub));
+            let sdk_include = sdk.join("include");
+            tool.include.push(sdk_include.join("um"));
+            tool.include.push(sdk_include.join("winrt"));
+            tool.include.push(sdk_include.join("shared"));
+        }
+
+        Some(())
+    }
+
+    fn add_env(
+        tool: &mut Tool,
+        env: &'static str,
+        paths: Vec<PathBuf>,
+        env_getter: &dyn EnvGetter,
+    ) {
+        let prev = env_getter.get_env(env);
+        let prev = prev.as_ref().map(AsRef::as_ref).unwrap_or_default();
+        let prev = env::split_paths(&prev);
+        let new = paths.into_iter().chain(prev);
+        tool.env
+            .push((env.to_string().into(), env::join_paths(new).unwrap()));
+    }
+
+    // Given a possible MSVC installation directory, we look for the linker and
+    // then add the MSVC library path.
+    fn get_tool(tool: &str, path: &Path, target: TargetArch<'_>) -> Option<MsvcTool> {
+        bin_subdir(target)
+            .into_iter()
+            .map(|(sub, host)| {
+                (
+                    path.join("bin").join(sub).join(tool),
+                    path.join("bin").join(host),
+                )
+            })
+            .filter(|(path, _)| path.is_file())
+            .map(|(path, host)| {
+                let mut tool = MsvcTool::new(path);
+                tool.path.push(host);
+                tool
+            })
+            .filter_map(|mut tool| {
+                let sub = vc_lib_subdir(target)?;
+                tool.libs.push(path.join("lib").join(sub));
+                tool.include.push(path.join("include"));
+                let atlmfc_path = path.join("atlmfc");
+                if atlmfc_path.exists() {
+                    tool.libs.push(atlmfc_path.join("lib").join(sub));
+                    tool.include.push(atlmfc_path.join("include"));
+                }
+                Some(tool)
+            })
+            .next()
+    }
+
+    // To find MSVC we look in a specific registry key for the version we are
+    // trying to find.
+    fn get_vc_dir(ver: &str) -> Option<PathBuf> {
+        let key = r"SOFTWARE\Microsoft\VisualStudio\SxS\VC7";
+        let key = LOCAL_MACHINE.open(key.as_ref()).ok()?;
+        let path = key.query_str(ver).ok()?;
+        Some(path.into())
+    }
+
+    // To find the Universal CRT we look in a specific registry key for where
+    // all the Universal CRTs are located and then sort them asciibetically to
+    // find the newest version. While this sort of sorting isn't ideal,  it is
+    // what vcvars does so that's good enough for us.
+    //
+    // Returns a pair of (root, version) for the ucrt dir if found
+    fn get_ucrt_dir() -> Option<(PathBuf, String)> {
+        let key = r"SOFTWARE\Microsoft\Windows Kits\Installed Roots";
+        let key = LOCAL_MACHINE.open(key.as_ref()).ok()?;
+        let root = key.query_str("KitsRoot10").ok()?;
+        let readdir = Path::new(&root).join("lib").read_dir().ok()?;
+        let max_libdir = readdir
+            .filter_map(|dir| dir.ok())
+            .map(|dir| dir.path())
+            .filter(|dir| {
+                dir.components()
+                    .last()
+                    .and_then(|c| c.as_os_str().to_str())
+                    .map(|c| c.starts_with("10.") && dir.join("ucrt").is_dir())
+                    .unwrap_or(false)
+            })
+            .max()?;
+        let version = max_libdir.components().last().unwrap();
+        let version = version.as_os_str().to_str().unwrap().to_string();
+        Some((root.into(), version))
+    }
+
+    // Vcvars finds the correct version of the Windows 10 SDK by looking
+    // for the include `um\Windows.h` because sometimes a given version will
+    // only have UCRT bits without the rest of the SDK. Since we only care about
+    // libraries and not includes, we instead look for `um\x64\kernel32.lib`.
+    // Since the 32-bit and 64-bit libraries are always installed together we
+    // only need to bother checking x64, making this code a tiny bit simpler.
+    // Like we do for the Universal CRT, we sort the possibilities
+    // asciibetically to find the newest one as that is what vcvars does.
+    // Before doing that, we check the "WindowsSdkDir" and "WindowsSDKVersion"
+    // environment variables set by vcvars to use the environment sdk version
+    // if one is already configured.
+    fn get_sdk10_dir(env_getter: &dyn EnvGetter) -> Option<(PathBuf, String)> {
+        if let (Some(root), Some(version)) = (
+            env_getter.get_env("WindowsSdkDir"),
+            env_getter
+                .get_env("WindowsSDKVersion")
+                .as_ref()
+                .and_then(|version| version.as_ref().to_str()),
+        ) {
+            return Some((
+                PathBuf::from(root),
+                version.trim_end_matches('\\').to_string(),
+            ));
+        }
+
+        let key = r"SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0";
+        let key = LOCAL_MACHINE.open(key.as_ref()).ok()?;
+        let root = key.query_str("InstallationFolder").ok()?;
+        let readdir = Path::new(&root).join("lib").read_dir().ok()?;
+        let mut dirs = readdir
+            .filter_map(|dir| dir.ok())
+            .map(|dir| dir.path())
+            .collect::<Vec<_>>();
+        dirs.sort();
+        let dir = dirs
+            .into_iter()
+            .rev()
+            .find(|dir| dir.join("um").join("x64").join("kernel32.lib").is_file())?;
+        let version = dir.components().last().unwrap();
+        let version = version.as_os_str().to_str().unwrap().to_string();
+        Some((root.into(), version))
+    }
+
+    // Interestingly there are several subdirectories, `win7` `win8` and
+    // `winv6.3`. Vcvars seems to only care about `winv6.3` though, so the same
+    // applies to us. Note that if we were targeting kernel mode drivers
+    // instead of user mode applications, we would care.
+    fn get_sdk81_dir() -> Option<PathBuf> {
+        let key = r"SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1";
+        let key = LOCAL_MACHINE.open(key.as_ref()).ok()?;
+        let root = key.query_str("InstallationFolder").ok()?;
+        Some(root.into())
+    }
+
+    const PROCESSOR_ARCHITECTURE_INTEL: u16 = 0;
+    const PROCESSOR_ARCHITECTURE_AMD64: u16 = 9;
+    const PROCESSOR_ARCHITECTURE_ARM64: u16 = 12;
+    const X86: u16 = PROCESSOR_ARCHITECTURE_INTEL;
+    const X86_64: u16 = PROCESSOR_ARCHITECTURE_AMD64;
+    const AARCH64: u16 = PROCESSOR_ARCHITECTURE_ARM64;
+
+    // When choosing the tool to use, we have to choose the one which matches
+    // the target architecture. Otherwise we end up in situations where someone
+    // on 32-bit Windows is trying to cross compile to 64-bit and it tries to
+    // invoke the native 64-bit compiler which won't work.
+    //
+    // For the return value of this function, the first member of the tuple is
+    // the folder of the tool we will be invoking, while the second member is
+    // the folder of the host toolchain for that tool which is essential when
+    // using a cross linker. We return a Vec since on x64 there are often two
+    // linkers that can target the architecture we desire. The 64-bit host
+    // linker is preferred, and hence first, due to 64-bit allowing it more
+    // address space to work with and potentially being faster.
+    fn bin_subdir(target: TargetArch<'_>) -> Vec<(&'static str, &'static str)> {
+        match (target.into(), host_arch()) {
+            ("i586", X86) | ("i686", X86) => vec![("", "")],
+            ("i586", X86_64) | ("i686", X86_64) => vec![("amd64_x86", "amd64"), ("", "")],
+            ("x86_64", X86) => vec![("x86_amd64", "")],
+            ("x86_64", X86_64) => vec![("amd64", "amd64"), ("x86_amd64", "")],
+            ("arm", X86) | ("thumbv7a", X86) => vec![("x86_arm", "")],
+            ("arm", X86_64) | ("thumbv7a", X86_64) => vec![("amd64_arm", "amd64"), ("x86_arm", "")],
+            _ => vec![],
+        }
+    }
+
+    fn lib_subdir(target: TargetArch<'_>) -> Option<&'static str> {
+        match target.into() {
+            "i586" | "i686" => Some("x86"),
+            "x86_64" => Some("x64"),
+            "arm" | "thumbv7a" => Some("arm"),
+            "aarch64" | "arm64ec" => Some("arm64"),
+            _ => None,
+        }
+    }
+
+    // MSVC's x86 libraries are not in a subfolder
+    fn vc_lib_subdir(target: TargetArch<'_>) -> Option<&'static str> {
+        match target.into() {
+            "i586" | "i686" => Some(""),
+            "x86_64" => Some("amd64"),
+            "arm" | "thumbv7a" => Some("arm"),
+            "aarch64" => Some("arm64"),
+            _ => None,
+        }
+    }
+
+    #[allow(bad_style)]
+    fn host_arch() -> u16 {
+        type DWORD = u32;
+        type WORD = u16;
+        type LPVOID = *mut u8;
+        type DWORD_PTR = usize;
+
+        #[repr(C)]
+        struct SYSTEM_INFO {
+            wProcessorArchitecture: WORD,
+            _wReserved: WORD,
+            _dwPageSize: DWORD,
+            _lpMinimumApplicationAddress: LPVOID,
+            _lpMaximumApplicationAddress: LPVOID,
+            _dwActiveProcessorMask: DWORD_PTR,
+            _dwNumberOfProcessors: DWORD,
+            _dwProcessorType: DWORD,
+            _dwAllocationGranularity: DWORD,
+            _wProcessorLevel: WORD,
+            _wProcessorRevision: WORD,
+        }
+
+        extern "system" {
+            fn GetNativeSystemInfo(lpSystemInfo: *mut SYSTEM_INFO);
+        }
+
+        unsafe {
+            let mut info = mem::zeroed();
+            GetNativeSystemInfo(&mut info);
+            info.wProcessorArchitecture
+        }
+    }
+
+    // Given a registry key, look at all the sub keys and find the one which has
+    // the maximal numeric value.
+    //
+    // Returns the name of the maximal key as well as the opened maximal key.
+    fn max_version(key: &RegistryKey) -> Option<(OsString, RegistryKey)> {
+        let mut max_vers = 0;
+        let mut max_key = None;
+        for subkey in key.iter().filter_map(|k| k.ok()) {
+            let val = subkey
+                .to_str()
+                .and_then(|s| s.trim_start_matches('v').replace('.', "").parse().ok());
+            let val = match val {
+                Some(s) => s,
+                None => continue,
+            };
+            if val > max_vers {
+                if let Ok(k) = key.open(&subkey) {
+                    max_vers = val;
+                    max_key = Some((subkey, k));
+                }
+            }
+        }
+        max_key
+    }
+
+    #[inline(always)]
+    pub(super) fn has_msbuild_version(version: &str, env_getter: &dyn EnvGetter) -> bool {
+        match version {
+            "17.0" => {
+                find_msbuild_vs17(TargetArch("x86_64"), env_getter).is_some()
+                    || find_msbuild_vs17(TargetArch("i686"), env_getter).is_some()
+                    || find_msbuild_vs17(TargetArch("aarch64"), env_getter).is_some()
+            }
+            "16.0" => {
+                find_msbuild_vs16(TargetArch("x86_64"), env_getter).is_some()
+                    || find_msbuild_vs16(TargetArch("i686"), env_getter).is_some()
+                    || find_msbuild_vs16(TargetArch("aarch64"), env_getter).is_some()
+            }
+            "15.0" => {
+                find_msbuild_vs15(TargetArch("x86_64"), env_getter).is_some()
+                    || find_msbuild_vs15(TargetArch("i686"), env_getter).is_some()
+                    || find_msbuild_vs15(TargetArch("aarch64"), env_getter).is_some()
+            }
+            "14.0" => LOCAL_MACHINE
+                .open(&OsString::from(format!(
+                    "SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\{}",
+                    version
+                )))
+                .is_ok(),
+            _ => false,
+        }
+    }
+
+    pub(super) fn find_devenv(target: TargetArch<'_>, env_getter: &dyn EnvGetter) -> Option<Tool> {
+        find_devenv_vs15(target, env_getter)
+    }
+
+    fn find_devenv_vs15(target: TargetArch<'_>, env_getter: &dyn EnvGetter) -> Option<Tool> {
+        find_tool_in_vs15_path(r"Common7\IDE\devenv.exe", target, env_getter)
+    }
+
+    // see http://stackoverflow.com/questions/328017/path-to-msbuild
+    pub(super) fn find_msbuild(target: TargetArch<'_>, env_getter: &dyn EnvGetter) -> Option<Tool> {
+        // VS 15 (2017) changed how to locate msbuild
+        if let Some(r) = find_msbuild_vs17(target, env_getter) {
+            Some(r)
+        } else if let Some(r) = find_msbuild_vs16(target, env_getter) {
+            return Some(r);
+        } else if let Some(r) = find_msbuild_vs15(target, env_getter) {
+            return Some(r);
+        } else {
+            find_old_msbuild(target)
+        }
+    }
+
+    fn find_msbuild_vs15(target: TargetArch<'_>, env_getter: &dyn EnvGetter) -> Option<Tool> {
+        find_tool_in_vs15_path(r"MSBuild\15.0\Bin\MSBuild.exe", target, env_getter)
+    }
+
+    fn find_old_msbuild(target: TargetArch<'_>) -> Option<Tool> {
+        let key = r"SOFTWARE\Microsoft\MSBuild\ToolsVersions";
+        LOCAL_MACHINE
+            .open(key.as_ref())
+            .ok()
+            .and_then(|key| {
+                max_version(&key).and_then(|(_vers, key)| key.query_str("MSBuildToolsPath").ok())
+            })
+            .map(|path| {
+                let mut path = PathBuf::from(path);
+                path.push("MSBuild.exe");
+                let mut tool = Tool::with_family(path, MSVC_FAMILY);
+                if target == "x86_64" {
+                    tool.env.push(("Platform".into(), "X64".into()));
+                }
+                tool
+            })
+    }
+}
+
+/// Non-Windows Implementation.
+#[cfg(not(windows))]
+mod impl_ {
+    use std::{env, ffi::OsStr};
+
+    use super::{EnvGetter, TargetArch, MSVC_FAMILY};
+    use crate::Tool;
+
+    /// Finding msbuild.exe tool under unix system is not currently supported.
+    /// Maybe can check it using an environment variable looks like `MSBUILD_BIN`.
+    #[inline(always)]
+    pub(super) fn find_msbuild(_target: TargetArch<'_>, _: &dyn EnvGetter) -> Option<Tool> {
+        None
+    }
+
+    // Finding devenv.exe tool under unix system is not currently supported.
+    // Maybe can check it using an environment variable looks like `DEVENV_BIN`.
+    #[inline(always)]
+    pub(super) fn find_devenv(_target: TargetArch<'_>, _: &dyn EnvGetter) -> Option<Tool> {
+        None
+    }
+
+    /// Attempt to find the tool using environment variables set by vcvars.
+    pub(super) fn find_msvc_environment(
+        tool: &str,
+        _target: TargetArch<'_>,
+        env_getter: &dyn EnvGetter,
+    ) -> Option<Tool> {
+        // Early return if the environment doesn't contain a VC install.
+        let vc_install_dir = env_getter.get_env("VCINSTALLDIR")?;
+        let vs_install_dir = env_getter.get_env("VSINSTALLDIR")?;
+
+        let get_tool = |install_dir: &OsStr| {
+            env::split_paths(install_dir)
+                .map(|p| p.join(tool))
+                .find(|p| p.exists())
+                .map(|path| Tool::with_family(path, MSVC_FAMILY))
+        };
+
+        // Take the path of tool for the vc install directory.
+        get_tool(vc_install_dir.as_ref())
+            // Take the path of tool for the vs install directory.
+            .or_else(|| get_tool(vs_install_dir.as_ref()))
+            // Take the path of tool for the current path environment.
+            .or_else(|| {
+                env_getter
+                    .get_env("PATH")
+                    .as_ref()
+                    .map(|path| path.as_ref())
+                    .and_then(get_tool)
+            })
+    }
+
+    #[inline(always)]
+    pub(super) fn find_msvc_15plus(
+        _tool: &str,
+        _target: TargetArch<'_>,
+        _: &dyn EnvGetter,
+    ) -> Option<Tool> {
+        None
+    }
+
+    // For MSVC 14 we need to find the Universal CRT as well as either
+    // the Windows 10 SDK or Windows 8.1 SDK.
+    #[inline(always)]
+    pub(super) fn find_msvc_14(
+        _tool: &str,
+        _target: TargetArch<'_>,
+        _: &dyn EnvGetter,
+    ) -> Option<Tool> {
+        None
+    }
+
+    #[inline(always)]
+    pub(super) fn has_msbuild_version(_version: &str, _: &dyn EnvGetter) -> bool {
+        false
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/cc/src/windows/mod.rs 43.0.0-1ubuntu1/rust-vendor/cc/src/windows/mod.rs
--- 43.0.0-1/rust-vendor/cc/src/windows/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/windows/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,22 @@
+//! These modules are all glue to support reading the MSVC version from
+//! the registry and from COM interfaces.
+
+// This is used in the crate's public API, so don't use #[cfg(windows)]
+pub mod find_tools;
+
+#[cfg(windows)]
+pub(crate) mod windows_sys;
+#[cfg(windows)]
+mod windows_targets;
+
+#[cfg(windows)]
+mod registry;
+#[cfg(windows)]
+#[macro_use]
+mod winapi;
+#[cfg(windows)]
+mod com;
+#[cfg(windows)]
+mod setup_config;
+#[cfg(windows)]
+mod vs_instances;
diff -pruN 43.0.0-1/rust-vendor/cc/src/windows/registry.rs 43.0.0-1ubuntu1/rust-vendor/cc/src/windows/registry.rs
--- 43.0.0-1/rust-vendor/cc/src/windows/registry.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/windows/registry.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,191 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use crate::windows::windows_sys::{
+    RegCloseKey, RegEnumKeyExW, RegOpenKeyExW, RegQueryValueExW, ERROR_NO_MORE_ITEMS,
+    ERROR_SUCCESS, HKEY, HKEY_LOCAL_MACHINE, KEY_READ, KEY_WOW64_32KEY, REG_SZ,
+};
+use std::{
+    ffi::{OsStr, OsString},
+    io,
+    ops::RangeFrom,
+    os::windows::prelude::*,
+    ptr::null_mut,
+};
+
+/// Must never be `HKEY_PERFORMANCE_DATA`.
+pub(crate) struct RegistryKey(Repr);
+
+#[allow(clippy::upper_case_acronyms)]
+type DWORD = u32;
+
+struct OwnedKey(HKEY);
+
+/// Note: must not encode `HKEY_PERFORMANCE_DATA` or one of its subkeys.
+enum Repr {
+    /// `HKEY_LOCAL_MACHINE`.
+    LocalMachine,
+    /// A subkey of `HKEY_LOCAL_MACHINE`.
+    Owned(OwnedKey),
+}
+
+pub struct Iter<'a> {
+    idx: RangeFrom<DWORD>,
+    key: &'a RegistryKey,
+}
+
+unsafe impl Sync for Repr {}
+unsafe impl Send for Repr {}
+
+pub(crate) const LOCAL_MACHINE: RegistryKey = RegistryKey(Repr::LocalMachine);
+
+impl RegistryKey {
+    fn raw(&self) -> HKEY {
+        match self.0 {
+            Repr::LocalMachine => HKEY_LOCAL_MACHINE,
+            Repr::Owned(ref val) => val.0,
+        }
+    }
+
+    /// Open a sub-key of `self`.
+    pub fn open(&self, key: &OsStr) -> io::Result<RegistryKey> {
+        let key = key.encode_wide().chain(Some(0)).collect::<Vec<_>>();
+        let mut ret = null_mut();
+        let err = unsafe {
+            RegOpenKeyExW(
+                self.raw(),
+                key.as_ptr(),
+                0,
+                KEY_READ | KEY_WOW64_32KEY,
+                &mut ret,
+            )
+        };
+        if err == ERROR_SUCCESS {
+            Ok(RegistryKey(Repr::Owned(OwnedKey(ret))))
+        } else {
+            Err(io::Error::from_raw_os_error(err as i32))
+        }
+    }
+
+    pub fn iter(&self) -> Iter {
+        Iter {
+            idx: 0..,
+            key: self,
+        }
+    }
+
+    pub fn query_str(&self, name: &str) -> io::Result<OsString> {
+        let name: &OsStr = name.as_ref();
+        let name = name.encode_wide().chain(Some(0)).collect::<Vec<_>>();
+        let mut len = 0;
+        let mut kind = 0;
+        unsafe {
+            let err = RegQueryValueExW(
+                self.raw(),
+                name.as_ptr(),
+                null_mut(),
+                &mut kind,
+                null_mut(),
+                &mut len,
+            );
+            if err != ERROR_SUCCESS {
+                return Err(io::Error::from_raw_os_error(err as i32));
+            }
+            if kind != REG_SZ {
+                return Err(io::Error::new(
+                    io::ErrorKind::Other,
+                    "registry key wasn't a string",
+                ));
+            }
+
+            // The length here is the length in bytes, but we're using wide
+            // characters so we need to be sure to halve it for the length
+            // passed in.
+            assert!(len % 2 == 0, "impossible wide string size: {} bytes", len);
+            let vlen = len as usize / 2;
+            // Defensively initialized, see comment about
+            // `HKEY_PERFORMANCE_DATA` below.
+            let mut v = vec![0u16; vlen];
+            let err = RegQueryValueExW(
+                self.raw(),
+                name.as_ptr(),
+                null_mut(),
+                null_mut(),
+                v.as_mut_ptr() as *mut _,
+                &mut len,
+            );
+            // We don't check for `ERROR_MORE_DATA` (which would if the value
+            // grew between the first and second call to `RegQueryValueExW`),
+            // both because it's extremely unlikely, and this is a bit more
+            // defensive more defensive against weird types of registry keys.
+            if err != ERROR_SUCCESS {
+                return Err(io::Error::from_raw_os_error(err as i32));
+            }
+            // The length is allowed to change, but should still be even, as
+            // well as smaller.
+            assert!(len % 2 == 0, "impossible wide string size: {} bytes", len);
+            // If the length grew but returned a success code, it *probably*
+            // indicates we're `HKEY_PERFORMANCE_DATA` or a subkey(?). We
+            // consider this UB, since those keys write "undefined" or
+            // "unpredictable" values to len, and need to use a completely
+            // different loop structure. This should be impossible (and enforce
+            // it in the API to the best of our ability), but to mitigate the
+            // damage we do some smoke-checks on the len, and ensure `v` has
+            // been fully initialized (rather than trusting the result of
+            // `RegQueryValueExW`).
+            let actual_len = len as usize / 2;
+            assert!(actual_len <= v.len());
+            v.truncate(actual_len);
+            // Some registry keys may have a terminating nul character, but
+            // we're not interested in that, so chop it off if it's there.
+            if !v.is_empty() && v[v.len() - 1] == 0 {
+                v.pop();
+            }
+            Ok(OsString::from_wide(&v))
+        }
+    }
+}
+
+impl Drop for OwnedKey {
+    fn drop(&mut self) {
+        unsafe {
+            RegCloseKey(self.0);
+        }
+    }
+}
+
+impl<'a> Iterator for Iter<'a> {
+    type Item = io::Result<OsString>;
+
+    fn next(&mut self) -> Option<io::Result<OsString>> {
+        self.idx.next().and_then(|i| unsafe {
+            let mut v = Vec::with_capacity(256);
+            let mut len = v.capacity() as DWORD;
+            let ret = RegEnumKeyExW(
+                self.key.raw(),
+                i,
+                v.as_mut_ptr(),
+                &mut len,
+                null_mut(),
+                null_mut(),
+                null_mut(),
+                null_mut(),
+            );
+            if ret == ERROR_NO_MORE_ITEMS {
+                None
+            } else if ret != ERROR_SUCCESS {
+                Some(Err(io::Error::from_raw_os_error(ret as i32)))
+            } else {
+                v.set_len(len as usize);
+                Some(Ok(OsString::from_wide(&v)))
+            }
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/cc/src/windows/setup_config.rs 43.0.0-1ubuntu1/rust-vendor/cc/src/windows/setup_config.rs
--- 43.0.0-1/rust-vendor/cc/src/windows/setup_config.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/windows/setup_config.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,283 @@
+// Copyright © 2017 winapi-rs developers
+// Licensed under the Apache License, Version 2.0
+// <LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option.
+// All files in the project carrying such notice may not be copied, modified, or distributed
+// except according to those terms.
+
+#![allow(bad_style)]
+#![allow(unused)]
+
+use crate::windows::{
+    com::{BStr, ComPtr},
+    winapi::{
+        IUnknown, IUnknownVtbl, Interface, LCID, LPCOLESTR, LPCWSTR, LPFILETIME, LPSAFEARRAY,
+        PULONGLONG, ULONG,
+    },
+    windows_sys::{CoCreateInstance, BSTR, CLSCTX_ALL, HRESULT, S_FALSE},
+};
+
+use std::{
+    ffi::OsString,
+    ptr::{null, null_mut},
+};
+
+// Bindings to the Setup.Configuration stuff
+pub type InstanceState = u32;
+
+pub const eNone: InstanceState = 0;
+pub const eLocal: InstanceState = 1;
+pub const eRegistered: InstanceState = 2;
+pub const eNoRebootRequired: InstanceState = 4;
+pub const eComplete: InstanceState = -1i32 as u32;
+
+RIDL! {#[uuid(0xb41463c3, 0x8866, 0x43b5, 0xbc, 0x33, 0x2b, 0x06, 0x76, 0xf7, 0xf4, 0x2e)]
+interface ISetupInstance(ISetupInstanceVtbl): IUnknown(IUnknownVtbl) {
+    fn GetInstanceId(
+        pbstrInstanceId: *mut BSTR,
+    ) -> HRESULT,
+    fn GetInstallDate(
+        pInstallDate: LPFILETIME,
+    ) -> HRESULT,
+    fn GetInstallationName(
+        pbstrInstallationName: *mut BSTR,
+    ) -> HRESULT,
+    fn GetInstallationPath(
+        pbstrInstallationPath: *mut BSTR,
+    ) -> HRESULT,
+    fn GetInstallationVersion(
+        pbstrInstallationVersion: *mut BSTR,
+    ) -> HRESULT,
+    fn GetDisplayName(
+        lcid: LCID,
+        pbstrDisplayName: *mut BSTR,
+    ) -> HRESULT,
+    fn GetDescription(
+        lcid: LCID,
+        pbstrDescription: *mut BSTR,
+    ) -> HRESULT,
+    fn ResolvePath(
+        pwszRelativePath: LPCOLESTR,
+        pbstrAbsolutePath: *mut BSTR,
+    ) -> HRESULT,
+}}
+
+RIDL! {#[uuid(0x89143c9a, 0x05af, 0x49b0, 0xb7, 0x17, 0x72, 0xe2, 0x18, 0xa2, 0x18, 0x5c)]
+interface ISetupInstance2(ISetupInstance2Vtbl): ISetupInstance(ISetupInstanceVtbl) {
+    fn GetState(
+        pState: *mut InstanceState,
+    ) -> HRESULT,
+    fn GetPackages(
+        ppsaPackages: *mut LPSAFEARRAY,
+    ) -> HRESULT,
+    fn GetProduct(
+        ppPackage: *mut *mut ISetupPackageReference,
+    ) -> HRESULT,
+    fn GetProductPath(
+        pbstrProductPath: *mut BSTR,
+    ) -> HRESULT,
+}}
+
+RIDL! {#[uuid(0x6380bcff, 0x41d3, 0x4b2e, 0x8b, 0x2e, 0xbf, 0x8a, 0x68, 0x10, 0xc8, 0x48)]
+interface IEnumSetupInstances(IEnumSetupInstancesVtbl): IUnknown(IUnknownVtbl) {
+    fn Next(
+        celt: ULONG,
+        rgelt: *mut *mut ISetupInstance,
+        pceltFetched: *mut ULONG,
+    ) -> HRESULT,
+    fn Skip(
+        celt: ULONG,
+    ) -> HRESULT,
+    fn Reset() -> HRESULT,
+    fn Clone(
+        ppenum: *mut *mut IEnumSetupInstances,
+    ) -> HRESULT,
+}}
+
+RIDL! {#[uuid(0x42843719, 0xdb4c, 0x46c2, 0x8e, 0x7c, 0x64, 0xf1, 0x81, 0x6e, 0xfd, 0x5b)]
+interface ISetupConfiguration(ISetupConfigurationVtbl): IUnknown(IUnknownVtbl) {
+    fn EnumInstances(
+        ppEnumInstances: *mut *mut IEnumSetupInstances,
+    ) -> HRESULT,
+    fn GetInstanceForCurrentProcess(
+        ppInstance: *mut *mut ISetupInstance,
+    ) -> HRESULT,
+    fn GetInstanceForPath(
+        wzPath: LPCWSTR,
+        ppInstance: *mut *mut ISetupInstance,
+    ) -> HRESULT,
+}}
+
+RIDL! {#[uuid(0x26aab78c, 0x4a60, 0x49d6, 0xaf, 0x3b, 0x3c, 0x35, 0xbc, 0x93, 0x36, 0x5d)]
+interface ISetupConfiguration2(ISetupConfiguration2Vtbl):
+    ISetupConfiguration(ISetupConfigurationVtbl) {
+    fn EnumAllInstances(
+        ppEnumInstances: *mut *mut IEnumSetupInstances,
+    ) -> HRESULT,
+}}
+
+RIDL! {#[uuid(0xda8d8a16, 0xb2b6, 0x4487, 0xa2, 0xf1, 0x59, 0x4c, 0xcc, 0xcd, 0x6b, 0xf5)]
+interface ISetupPackageReference(ISetupPackageReferenceVtbl): IUnknown(IUnknownVtbl) {
+    fn GetId(
+        pbstrId: *mut BSTR,
+    ) -> HRESULT,
+    fn GetVersion(
+        pbstrVersion: *mut BSTR,
+    ) -> HRESULT,
+    fn GetChip(
+        pbstrChip: *mut BSTR,
+    ) -> HRESULT,
+    fn GetLanguage(
+        pbstrLanguage: *mut BSTR,
+    ) -> HRESULT,
+    fn GetBranch(
+        pbstrBranch: *mut BSTR,
+    ) -> HRESULT,
+    fn GetType(
+        pbstrType: *mut BSTR,
+    ) -> HRESULT,
+    fn GetUniqueId(
+        pbstrUniqueId: *mut BSTR,
+    ) -> HRESULT,
+}}
+
+RIDL! {#[uuid(0x42b21b78, 0x6192, 0x463e, 0x87, 0xbf, 0xd5, 0x77, 0x83, 0x8f, 0x1d, 0x5c)]
+interface ISetupHelper(ISetupHelperVtbl): IUnknown(IUnknownVtbl) {
+    fn ParseVersion(
+        pwszVersion: LPCOLESTR,
+        pullVersion: PULONGLONG,
+    ) -> HRESULT,
+    fn ParseVersionRange(
+        pwszVersionRange: LPCOLESTR,
+        pullMinVersion: PULONGLONG,
+        pullMaxVersion: PULONGLONG,
+    ) -> HRESULT,
+}}
+
+DEFINE_GUID! {CLSID_SetupConfiguration,
+0x177f0c4a, 0x1cd3, 0x4de7, 0xa3, 0x2c, 0x71, 0xdb, 0xbb, 0x9f, 0xa3, 0x6d}
+
+// Safe wrapper around the COM interfaces
+pub struct SetupConfiguration(ComPtr<ISetupConfiguration>);
+
+impl SetupConfiguration {
+    pub fn new() -> Result<SetupConfiguration, i32> {
+        let mut obj = null_mut();
+        let err = unsafe {
+            CoCreateInstance(
+                &CLSID_SetupConfiguration,
+                null_mut(),
+                CLSCTX_ALL,
+                &ISetupConfiguration::uuidof(),
+                &mut obj,
+            )
+        };
+        if err < 0 {
+            return Err(err);
+        }
+        let obj = unsafe { ComPtr::from_raw(obj as *mut ISetupConfiguration) };
+        Ok(SetupConfiguration(obj))
+    }
+    pub fn get_instance_for_current_process(&self) -> Result<SetupInstance, i32> {
+        let mut obj = null_mut();
+        let err = unsafe { self.0.GetInstanceForCurrentProcess(&mut obj) };
+        if err < 0 {
+            return Err(err);
+        }
+        Ok(unsafe { SetupInstance::from_raw(obj) })
+    }
+    pub fn enum_instances(&self) -> Result<EnumSetupInstances, i32> {
+        let mut obj = null_mut();
+        let err = unsafe { self.0.EnumInstances(&mut obj) };
+        if err < 0 {
+            return Err(err);
+        }
+        Ok(unsafe { EnumSetupInstances::from_raw(obj) })
+    }
+    pub fn enum_all_instances(&self) -> Result<EnumSetupInstances, i32> {
+        let mut obj = null_mut();
+        let this = self.0.cast::<ISetupConfiguration2>()?;
+        let err = unsafe { this.EnumAllInstances(&mut obj) };
+        if err < 0 {
+            return Err(err);
+        }
+        Ok(unsafe { EnumSetupInstances::from_raw(obj) })
+    }
+}
+
+pub struct SetupInstance(ComPtr<ISetupInstance>);
+
+impl SetupInstance {
+    pub unsafe fn from_raw(obj: *mut ISetupInstance) -> SetupInstance {
+        SetupInstance(ComPtr::from_raw(obj))
+    }
+    pub fn instance_id(&self) -> Result<OsString, i32> {
+        let mut s = null();
+        let err = unsafe { self.0.GetInstanceId(&mut s) };
+        let bstr = unsafe { BStr::from_raw(s) };
+        if err < 0 {
+            return Err(err);
+        }
+        Ok(bstr.to_osstring())
+    }
+    pub fn installation_name(&self) -> Result<OsString, i32> {
+        let mut s = null();
+        let err = unsafe { self.0.GetInstallationName(&mut s) };
+        let bstr = unsafe { BStr::from_raw(s) };
+        if err < 0 {
+            return Err(err);
+        }
+        Ok(bstr.to_osstring())
+    }
+    pub fn installation_path(&self) -> Result<OsString, i32> {
+        let mut s = null();
+        let err = unsafe { self.0.GetInstallationPath(&mut s) };
+        let bstr = unsafe { BStr::from_raw(s) };
+        if err < 0 {
+            return Err(err);
+        }
+        Ok(bstr.to_osstring())
+    }
+    pub fn installation_version(&self) -> Result<OsString, i32> {
+        let mut s = null();
+        let err = unsafe { self.0.GetInstallationVersion(&mut s) };
+        let bstr = unsafe { BStr::from_raw(s) };
+        if err < 0 {
+            return Err(err);
+        }
+        Ok(bstr.to_osstring())
+    }
+    pub fn product_path(&self) -> Result<OsString, i32> {
+        let mut s = null();
+        let this = self.0.cast::<ISetupInstance2>()?;
+        let err = unsafe { this.GetProductPath(&mut s) };
+        let bstr = unsafe { BStr::from_raw(s) };
+        if err < 0 {
+            return Err(err);
+        }
+        Ok(bstr.to_osstring())
+    }
+}
+
+pub struct EnumSetupInstances(ComPtr<IEnumSetupInstances>);
+
+impl EnumSetupInstances {
+    pub unsafe fn from_raw(obj: *mut IEnumSetupInstances) -> EnumSetupInstances {
+        EnumSetupInstances(ComPtr::from_raw(obj))
+    }
+}
+
+impl Iterator for EnumSetupInstances {
+    type Item = Result<SetupInstance, i32>;
+    fn next(&mut self) -> Option<Result<SetupInstance, i32>> {
+        let mut obj = null_mut();
+        let err = unsafe { self.0.Next(1, &mut obj, null_mut()) };
+        if err < 0 {
+            return Some(Err(err));
+        }
+        if err == S_FALSE {
+            return None;
+        }
+        Some(Ok(unsafe { SetupInstance::from_raw(obj) }))
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/cc/src/windows/vs_instances.rs 43.0.0-1ubuntu1/rust-vendor/cc/src/windows/vs_instances.rs
--- 43.0.0-1/rust-vendor/cc/src/windows/vs_instances.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/windows/vs_instances.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,199 @@
+use std::borrow::Cow;
+use std::collections::HashMap;
+use std::convert::TryFrom;
+use std::io::BufRead;
+use std::path::PathBuf;
+
+use crate::windows::setup_config::{EnumSetupInstances, SetupInstance};
+
+pub enum VsInstance {
+    Com(SetupInstance),
+    Vswhere(VswhereInstance),
+}
+
+impl VsInstance {
+    pub fn installation_name(&self) -> Option<Cow<str>> {
+        match self {
+            VsInstance::Com(s) => s
+                .installation_name()
+                .ok()
+                .and_then(|s| s.into_string().ok())
+                .map(Cow::from),
+            VsInstance::Vswhere(v) => v.map.get("installationName").map(Cow::from),
+        }
+    }
+
+    pub fn installation_path(&self) -> Option<PathBuf> {
+        match self {
+            VsInstance::Com(s) => s.installation_path().ok().map(PathBuf::from),
+            VsInstance::Vswhere(v) => v.map.get("installationPath").map(PathBuf::from),
+        }
+    }
+
+    pub fn installation_version(&self) -> Option<Cow<str>> {
+        match self {
+            VsInstance::Com(s) => s
+                .installation_version()
+                .ok()
+                .and_then(|s| s.into_string().ok())
+                .map(Cow::from),
+            VsInstance::Vswhere(v) => v.map.get("installationVersion").map(Cow::from),
+        }
+    }
+}
+
+pub enum VsInstances {
+    ComBased(EnumSetupInstances),
+    VswhereBased(VswhereInstance),
+}
+
+impl IntoIterator for VsInstances {
+    type Item = VsInstance;
+    #[allow(bare_trait_objects)]
+    type IntoIter = Box<Iterator<Item = Self::Item>>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        match self {
+            VsInstances::ComBased(e) => {
+                Box::new(e.into_iter().filter_map(Result::ok).map(VsInstance::Com))
+            }
+            VsInstances::VswhereBased(v) => Box::new(std::iter::once(VsInstance::Vswhere(v))),
+        }
+    }
+}
+
+#[derive(Debug)]
+pub struct VswhereInstance {
+    map: HashMap<String, String>,
+}
+
+impl TryFrom<&Vec<u8>> for VswhereInstance {
+    type Error = &'static str;
+
+    fn try_from(output: &Vec<u8>) -> Result<Self, Self::Error> {
+        let map: HashMap<_, _> = output
+            .lines()
+            .map_while(Result::ok)
+            .filter_map(|s| {
+                let mut splitn = s.splitn(2, ": ");
+                Some((splitn.next()?.to_owned(), splitn.next()?.to_owned()))
+            })
+            .collect();
+
+        if !map.contains_key("installationName")
+            || !map.contains_key("installationPath")
+            || !map.contains_key("installationVersion")
+        {
+            return Err("required properties not found");
+        }
+
+        Ok(Self { map })
+    }
+}
+
+#[cfg(test)]
+mod tests_ {
+    use std::borrow::Cow;
+    use std::convert::TryFrom;
+    use std::path::PathBuf;
+
+    #[test]
+    fn it_parses_vswhere_output_correctly() {
+        let output = br"instanceId: 58104422
+installDate: 21/02/2021 21:50:33
+installationName: VisualStudio/16.9.2+31112.23
+installationPath: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
+installationVersion: 16.9.31112.23
+productId: Microsoft.VisualStudio.Product.BuildTools
+productPath: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\LaunchDevCmd.bat
+state: 4294967295
+isComplete: 1
+isLaunchable: 1
+isPrerelease: 0
+isRebootRequired: 0
+displayName: Visual Studio Build Tools 2019
+description: The Visual Studio Build Tools allows you to build native and managed MSBuild-based applications without requiring the Visual Studio IDE. There are options to install the Visual C++ compilers and libraries, MFC, ATL, and C++/CLI support.
+channelId: VisualStudio.16.Release
+channelUri: https://aka.ms/vs/16/release/channel
+enginePath: C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service
+releaseNotes: https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes-v16.9#16.9.2
+thirdPartyNotices: https://go.microsoft.com/fwlink/?LinkId=660909
+updateDate: 2021-03-17T21:16:46.5963702Z
+catalog_buildBranch: d16.9
+catalog_buildVersion: 16.9.31112.23
+catalog_id: VisualStudio/16.9.2+31112.23
+catalog_localBuild: build-lab
+catalog_manifestName: VisualStudio
+catalog_manifestType: installer
+catalog_productDisplayVersion: 16.9.2
+catalog_productLine: Dev16
+catalog_productLineVersion: 2019
+catalog_productMilestone: RTW
+catalog_productMilestoneIsPreRelease: False
+catalog_productName: Visual Studio
+catalog_productPatchVersion: 2
+catalog_productPreReleaseMilestoneSuffix: 1.0
+catalog_productSemanticVersion: 16.9.2+31112.23
+catalog_requiredEngineVersion: 2.9.3365.38425
+properties_campaignId: 156063665.1613940062
+properties_channelManifestId: VisualStudio.16.Release/16.9.2+31112.23
+properties_nickname: 
+properties_setupEngineFilePath: C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installershell.exe
+"
+        .to_vec();
+
+        let vswhere_instance = super::VswhereInstance::try_from(&output);
+        assert!(vswhere_instance.is_ok());
+
+        let vs_instance = super::VsInstance::Vswhere(vswhere_instance.unwrap());
+        assert_eq!(
+            vs_instance.installation_name(),
+            Some(Cow::from("VisualStudio/16.9.2+31112.23"))
+        );
+        assert_eq!(
+            vs_instance.installation_path(),
+            Some(PathBuf::from(
+                r"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
+            ))
+        );
+        assert_eq!(
+            vs_instance.installation_version(),
+            Some(Cow::from("16.9.31112.23"))
+        );
+    }
+
+    #[test]
+    fn it_returns_an_error_for_empty_output() {
+        let output = b"".to_vec();
+
+        let vswhere_instance = super::VswhereInstance::try_from(&output);
+
+        assert!(vswhere_instance.is_err());
+    }
+
+    #[test]
+    fn it_returns_an_error_for_output_consisting_of_empty_lines() {
+        let output = br"
+
+"
+        .to_vec();
+
+        let vswhere_instance = super::VswhereInstance::try_from(&output);
+
+        assert!(vswhere_instance.is_err());
+    }
+
+    #[test]
+    fn it_returns_an_error_for_output_without_required_properties() {
+        let output = br"instanceId: 58104422
+installDate: 21/02/2021 21:50:33
+productId: Microsoft.VisualStudio.Product.BuildTools
+productPath: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\LaunchDevCmd.bat
+"
+        .to_vec();
+
+        let vswhere_instance = super::VswhereInstance::try_from(&output);
+
+        assert!(vswhere_instance.is_err());
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/cc/src/windows/winapi.rs 43.0.0-1ubuntu1/rust-vendor/cc/src/windows/winapi.rs
--- 43.0.0-1/rust-vendor/cc/src/windows/winapi.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/windows/winapi.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,146 @@
+// Copyright © 2015-2017 winapi-rs developers
+// Licensed under the Apache License, Version 2.0
+// <LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option.
+// All files in the project carrying such notice may not be copied, modified, or distributed
+// except according to those terms.
+
+#![allow(bad_style, clippy::upper_case_acronyms)]
+
+use std::os::raw;
+
+pub type wchar_t = u16;
+
+pub use crate::windows::windows_sys::{FILETIME, GUID, HRESULT, SAFEARRAY};
+
+pub type REFIID = *const IID;
+pub type IID = GUID;
+pub type ULONG = raw::c_ulong;
+pub type DWORD = u32;
+pub type LPFILETIME = *mut FILETIME;
+pub type OLECHAR = WCHAR;
+pub type WCHAR = wchar_t;
+pub type LPCOLESTR = *const OLECHAR;
+pub type LCID = DWORD;
+pub type LPCWSTR = *const WCHAR;
+pub type PULONGLONG = *mut ULONGLONG;
+pub type ULONGLONG = u64;
+
+pub trait Interface {
+    fn uuidof() -> GUID;
+}
+
+pub type LPSAFEARRAY = *mut SAFEARRAY;
+
+macro_rules! DEFINE_GUID {
+    (
+        $name:ident, $l:expr, $w1:expr, $w2:expr,
+        $b1:expr, $b2:expr, $b3:expr, $b4:expr, $b5:expr, $b6:expr, $b7:expr, $b8:expr
+    ) => {
+        pub const $name: $crate::windows::winapi::GUID = $crate::windows::winapi::GUID {
+            data1: $l,
+            data2: $w1,
+            data3: $w2,
+            data4: [$b1, $b2, $b3, $b4, $b5, $b6, $b7, $b8],
+        };
+    };
+}
+
+macro_rules! RIDL {
+    (#[uuid($($uuid:expr),+)]
+    interface $interface:ident ($vtbl:ident) {$(
+        fn $method:ident($($p:ident : $t:ty,)*) -> $rtr:ty,
+    )+}) => (
+        #[repr(C)]
+        pub struct $vtbl {
+            $(pub $method: unsafe extern "system" fn(
+                This: *mut $interface,
+                $($p: $t),*
+            ) -> $rtr,)+
+        }
+        #[repr(C)]
+        pub struct $interface {
+            pub lpVtbl: *const $vtbl,
+        }
+        RIDL!{@impl $interface {$(fn $method($($p: $t,)*) -> $rtr,)+}}
+        RIDL!{@uuid $interface $($uuid),+}
+    );
+    (#[uuid($($uuid:expr),+)]
+    interface $interface:ident ($vtbl:ident) : $pinterface:ident ($pvtbl:ident) {
+    }) => (
+        #[repr(C)]
+        pub struct $vtbl {
+            pub parent: $pvtbl,
+        }
+        #[repr(C)]
+        pub struct $interface {
+            pub lpVtbl: *const $vtbl,
+        }
+        RIDL!{@deref $interface $pinterface}
+        RIDL!{@uuid $interface $($uuid),+}
+    );
+    (#[uuid($($uuid:expr),+)]
+    interface $interface:ident ($vtbl:ident) : $pinterface:ident ($pvtbl:ident) {$(
+        fn $method:ident($($p:ident : $t:ty,)*) -> $rtr:ty,
+    )+}) => (
+        #[repr(C)]
+        pub struct $vtbl {
+            pub parent: $pvtbl,
+            $(pub $method: unsafe extern "system" fn(
+                This: *mut $interface,
+                $($p: $t,)*
+            ) -> $rtr,)+
+        }
+        #[repr(C)]
+        pub struct $interface {
+            pub lpVtbl: *const $vtbl,
+        }
+        RIDL!{@impl $interface {$(fn $method($($p: $t,)*) -> $rtr,)+}}
+        RIDL!{@deref $interface $pinterface}
+        RIDL!{@uuid $interface $($uuid),+}
+    );
+    (@deref $interface:ident $pinterface:ident) => (
+        impl ::std::ops::Deref for $interface {
+            type Target = $pinterface;
+            #[inline]
+            fn deref(&self) -> &$pinterface {
+                unsafe { &*(self as *const $interface as *const $pinterface) }
+            }
+        }
+    );
+    (@impl $interface:ident {$(
+        fn $method:ident($($p:ident : $t:ty,)*) -> $rtr:ty,
+    )+}) => (
+        impl $interface {
+            $(#[inline] pub unsafe fn $method(&self, $($p: $t,)*) -> $rtr {
+                ((*self.lpVtbl).$method)(self as *const _ as *mut _, $($p,)*)
+            })+
+        }
+    );
+    (@uuid $interface:ident
+        $l:expr, $w1:expr, $w2:expr,
+        $b1:expr, $b2:expr, $b3:expr, $b4:expr, $b5:expr, $b6:expr, $b7:expr, $b8:expr
+    ) => (
+        impl $crate::windows::winapi::Interface for $interface {
+            #[inline]
+            fn uuidof() -> $crate::windows::winapi::GUID {
+                $crate::windows::winapi::GUID {
+                    data1: $l,
+                    data2: $w1,
+                    data3: $w2,
+                    data4: [$b1, $b2, $b3, $b4, $b5, $b6, $b7, $b8],
+                }
+            }
+        }
+    );
+}
+
+RIDL! {#[uuid(0x00000000, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)]
+interface IUnknown(IUnknownVtbl) {
+    fn QueryInterface(
+        riid: REFIID,
+        ppvObject: *mut *mut raw::c_void,
+    ) -> HRESULT,
+    fn AddRef() -> ULONG,
+    fn Release() -> ULONG,
+}}
diff -pruN 43.0.0-1/rust-vendor/cc/src/windows/windows_sys.rs 43.0.0-1ubuntu1/rust-vendor/cc/src/windows/windows_sys.rs
--- 43.0.0-1/rust-vendor/cc/src/windows/windows_sys.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/windows/windows_sys.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,121 @@
+// This file is autogenerated.
+//
+// To add bindings, edit windows_sys.lst then run:
+//
+// ```
+// cd generate-windows-sys/
+// cargo run
+// ```
+// Bindings generated by `windows-bindgen` 0.58.0
+
+#![allow(
+    non_snake_case,
+    non_upper_case_globals,
+    non_camel_case_types,
+    dead_code,
+    clippy::all
+)]
+windows_targets::link!("advapi32.dll" "system" fn RegCloseKey(hkey : HKEY) -> WIN32_ERROR);
+windows_targets::link!("advapi32.dll" "system" fn RegEnumKeyExW(hkey : HKEY, dwindex : u32, lpname : PWSTR, lpcchname : *mut u32, lpreserved : *const u32, lpclass : PWSTR, lpcchclass : *mut u32, lpftlastwritetime : *mut FILETIME) -> WIN32_ERROR);
+windows_targets::link!("advapi32.dll" "system" fn RegOpenKeyExW(hkey : HKEY, lpsubkey : PCWSTR, uloptions : u32, samdesired : REG_SAM_FLAGS, phkresult : *mut HKEY) -> WIN32_ERROR);
+windows_targets::link!("advapi32.dll" "system" fn RegQueryValueExW(hkey : HKEY, lpvaluename : PCWSTR, lpreserved : *const u32, lptype : *mut REG_VALUE_TYPE, lpdata : *mut u8, lpcbdata : *mut u32) -> WIN32_ERROR);
+windows_targets::link!("kernel32.dll" "system" fn FreeLibrary(hlibmodule : HMODULE) -> BOOL);
+windows_targets::link!("kernel32.dll" "system" fn GetMachineTypeAttributes(machine : u16, machinetypeattributes : *mut MACHINE_ATTRIBUTES) -> HRESULT);
+windows_targets::link!("kernel32.dll" "system" fn GetProcAddress(hmodule : HMODULE, lpprocname : PCSTR) -> FARPROC);
+windows_targets::link!("kernel32.dll" "system" fn LoadLibraryA(lplibfilename : PCSTR) -> HMODULE);
+windows_targets::link!("kernel32.dll" "system" fn OpenSemaphoreA(dwdesiredaccess : u32, binherithandle : BOOL, lpname : PCSTR) -> HANDLE);
+windows_targets::link!("kernel32.dll" "system" fn PeekNamedPipe(hnamedpipe : HANDLE, lpbuffer : *mut core::ffi::c_void, nbuffersize : u32, lpbytesread : *mut u32, lptotalbytesavail : *mut u32, lpbytesleftthismessage : *mut u32) -> BOOL);
+windows_targets::link!("kernel32.dll" "system" fn ReleaseSemaphore(hsemaphore : HANDLE, lreleasecount : i32, lppreviouscount : *mut i32) -> BOOL);
+windows_targets::link!("kernel32.dll" "system" fn WaitForSingleObject(hhandle : HANDLE, dwmilliseconds : u32) -> WAIT_EVENT);
+windows_targets::link!("ole32.dll" "system" fn CoCreateInstance(rclsid : *const GUID, punkouter : * mut core::ffi::c_void, dwclscontext : CLSCTX, riid : *const GUID, ppv : *mut *mut core::ffi::c_void) -> HRESULT);
+windows_targets::link!("ole32.dll" "system" fn CoInitializeEx(pvreserved : *const core::ffi::c_void, dwcoinit : u32) -> HRESULT);
+windows_targets::link!("oleaut32.dll" "system" fn SysFreeString(bstrstring : BSTR));
+windows_targets::link!("oleaut32.dll" "system" fn SysStringLen(pbstr : BSTR) -> u32);
+pub type ADVANCED_FEATURE_FLAGS = u16;
+pub type BOOL = i32;
+pub type BSTR = *const u16;
+pub type CLSCTX = u32;
+pub const CLSCTX_ALL: CLSCTX = 23u32;
+pub type COINIT = i32;
+pub const COINIT_MULTITHREADED: COINIT = 0i32;
+pub const ERROR_NO_MORE_ITEMS: WIN32_ERROR = 259u32;
+pub const ERROR_SUCCESS: WIN32_ERROR = 0u32;
+pub const FALSE: BOOL = 0i32;
+pub type FARPROC = Option<unsafe extern "system" fn() -> isize>;
+#[repr(C)]
+#[derive(Clone, Copy)]
+pub struct FILETIME {
+    pub dwLowDateTime: u32,
+    pub dwHighDateTime: u32,
+}
+pub const FILE_ATTRIBUTE_TEMPORARY: FILE_FLAGS_AND_ATTRIBUTES = 256u32;
+pub type FILE_FLAGS_AND_ATTRIBUTES = u32;
+#[repr(C)]
+#[derive(Clone, Copy)]
+pub struct GUID {
+    pub data1: u32,
+    pub data2: u16,
+    pub data3: u16,
+    pub data4: [u8; 8],
+}
+impl GUID {
+    pub const fn from_u128(uuid: u128) -> Self {
+        Self {
+            data1: (uuid >> 96) as u32,
+            data2: (uuid >> 80 & 0xffff) as u16,
+            data3: (uuid >> 64 & 0xffff) as u16,
+            data4: (uuid as u64).to_be_bytes(),
+        }
+    }
+}
+pub type HANDLE = *mut core::ffi::c_void;
+pub type HKEY = *mut core::ffi::c_void;
+pub const HKEY_LOCAL_MACHINE: HKEY = -2147483646i32 as _;
+pub type HMODULE = *mut core::ffi::c_void;
+pub type HRESULT = i32;
+pub type IMAGE_FILE_MACHINE = u16;
+pub const IMAGE_FILE_MACHINE_AMD64: IMAGE_FILE_MACHINE = 34404u16;
+pub const KEY_READ: REG_SAM_FLAGS = 131097u32;
+pub const KEY_WOW64_32KEY: REG_SAM_FLAGS = 512u32;
+pub type MACHINE_ATTRIBUTES = i32;
+pub type PCSTR = *const u8;
+pub type PCWSTR = *const u16;
+pub type PWSTR = *mut u16;
+pub type REG_SAM_FLAGS = u32;
+pub const REG_SZ: REG_VALUE_TYPE = 1u32;
+pub type REG_VALUE_TYPE = u32;
+#[repr(C)]
+#[derive(Clone, Copy)]
+pub struct SAFEARRAY {
+    pub cDims: u16,
+    pub fFeatures: ADVANCED_FEATURE_FLAGS,
+    pub cbElements: u32,
+    pub cLocks: u32,
+    pub pvData: *mut core::ffi::c_void,
+    pub rgsabound: [SAFEARRAYBOUND; 1],
+}
+#[repr(C)]
+#[derive(Clone, Copy)]
+pub struct SAFEARRAYBOUND {
+    pub cElements: u32,
+    pub lLbound: i32,
+}
+pub const SEMAPHORE_MODIFY_STATE: SYNCHRONIZATION_ACCESS_RIGHTS = 2u32;
+pub type SYNCHRONIZATION_ACCESS_RIGHTS = u32;
+pub const S_FALSE: HRESULT = 0x1_u32 as _;
+pub const S_OK: HRESULT = 0x0_u32 as _;
+pub type THREAD_ACCESS_RIGHTS = u32;
+pub const THREAD_SYNCHRONIZE: THREAD_ACCESS_RIGHTS = 1048576u32;
+pub const UserEnabled: MACHINE_ATTRIBUTES = 1i32;
+pub const WAIT_ABANDONED: WAIT_EVENT = 128u32;
+pub type WAIT_EVENT = u32;
+pub const WAIT_FAILED: WAIT_EVENT = 4294967295u32;
+pub const WAIT_OBJECT_0: WAIT_EVENT = 0u32;
+pub const WAIT_TIMEOUT: WAIT_EVENT = 258u32;
+pub type WIN32_ERROR = u32;
+
+#[link(name = "advapi32")]
+#[link(name = "ole32")]
+#[link(name = "oleaut32")]
+extern "C" {}
+use super::windows_targets;
diff -pruN 43.0.0-1/rust-vendor/cc/src/windows/windows_targets.rs 43.0.0-1ubuntu1/rust-vendor/cc/src/windows/windows_targets.rs
--- 43.0.0-1/rust-vendor/cc/src/windows/windows_targets.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cc/src/windows/windows_targets.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,19 @@
+//! Provides the `link!` macro used by the generated windows bindings.
+//!
+//! This is a simple wrapper around an `extern` block with a `#[link]` attribute.
+//! It's very roughly equivalent to the windows-targets crate.
+
+macro_rules! link_macro {
+    ($library:literal $abi:literal $($link_name:literal)? $(#[$doc:meta])? fn $($function:tt)*) => (
+        // Note: the windows-targets crate uses a pre-built Windows.lib import library which we don't
+        // have in this repo. So instead we always link kernel32.lib and add the rest of the import
+        // libraries below by using an empty extern block. This works because extern blocks are not
+        // connected to the library given in the #[link] attribute.
+        #[link(name = "kernel32")]
+        extern $abi {
+            $(#[link_name=$link_name])?
+            pub fn $($function)*;
+        }
+    )
+}
+pub(crate) use link_macro as link;
diff -pruN 43.0.0-1/rust-vendor/cfg-if/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/cfg-if/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/cfg-if/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cfg-if/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"Cargo.toml":"5b2a8f6e5256957c029cf3a8912d51438e7faa5891c5c102c312f6d4599c1f00","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"2406e83ee174e30aa67f8ab266836fa78545012b196395aff37c152321e2c713","src/lib.rs":"54b0f108b0dc48a077c52c0bcd22b64ef4de083e5e2b7d405e50ae4d78224f1b","tests/xcrate.rs":"c0734dae6e63beafcd60bf53546115a2320735b51035c9e2387fdf9301580934"},"package":"baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/cfg-if/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/cfg-if/Cargo.toml
--- 43.0.0-1/rust-vendor/cfg-if/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cfg-if/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,36 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies
+#
+# If you believe there's an error in this file please file an
+# issue against the rust-lang/cargo repository. If you're
+# editing this file be aware that the upstream Cargo.toml
+# will likely look very different (and much more reasonable)
+
+[package]
+edition = "2018"
+name = "cfg-if"
+version = "1.0.0"
+authors = ["Alex Crichton <alex@alexcrichton.com>"]
+description = "A macro to ergonomically define an item depending on a large number of #[cfg]\nparameters. Structured like an if-else chain, the first matching branch is the\nitem that gets emitted.\n"
+homepage = "https://github.com/alexcrichton/cfg-if"
+documentation = "https://docs.rs/cfg-if"
+readme = "README.md"
+license = "MIT/Apache-2.0"
+repository = "https://github.com/alexcrichton/cfg-if"
+[dependencies.compiler_builtins]
+version = "0.1.2"
+optional = true
+
+[dependencies.core]
+version = "1.0.0"
+optional = true
+package = "rustc-std-workspace-core"
+
+[features]
+rustc-dep-of-std = ["core", "compiler_builtins"]
+[badges.travis-ci]
+repository = "alexcrichton/cfg-if"
diff -pruN 43.0.0-1/rust-vendor/cfg-if/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/cfg-if/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/cfg-if/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cfg-if/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,201 @@
+                              Apache License
+                        Version 2.0, January 2004
+                     http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+   "License" shall mean the terms and conditions for use, reproduction,
+   and distribution as defined by Sections 1 through 9 of this document.
+
+   "Licensor" shall mean the copyright owner or entity authorized by
+   the copyright owner that is granting the License.
+
+   "Legal Entity" shall mean the union of the acting entity and all
+   other entities that control, are controlled by, or are under common
+   control with that entity. For the purposes of this definition,
+   "control" means (i) the power, direct or indirect, to cause the
+   direction or management of such entity, whether by contract or
+   otherwise, or (ii) ownership of fifty percent (50%) or more of the
+   outstanding shares, or (iii) beneficial ownership of such entity.
+
+   "You" (or "Your") shall mean an individual or Legal Entity
+   exercising permissions granted by this License.
+
+   "Source" form shall mean the preferred form for making modifications,
+   including but not limited to software source code, documentation
+   source, and configuration files.
+
+   "Object" form shall mean any form resulting from mechanical
+   transformation or translation of a Source form, including but
+   not limited to compiled object code, generated documentation,
+   and conversions to other media types.
+
+   "Work" shall mean the work of authorship, whether in Source or
+   Object form, made available under the License, as indicated by a
+   copyright notice that is included in or attached to the work
+   (an example is provided in the Appendix below).
+
+   "Derivative Works" shall mean any work, whether in Source or Object
+   form, that is based on (or derived from) the Work and for which the
+   editorial revisions, annotations, elaborations, or other modifications
+   represent, as a whole, an original work of authorship. For the purposes
+   of this License, Derivative Works shall not include works that remain
+   separable from, or merely link (or bind by name) to the interfaces of,
+   the Work and Derivative Works thereof.
+
+   "Contribution" shall mean any work of authorship, including
+   the original version of the Work and any modifications or additions
+   to that Work or Derivative Works thereof, that is intentionally
+   submitted to Licensor for inclusion in the Work by the copyright owner
+   or by an individual or Legal Entity authorized to submit on behalf of
+   the copyright owner. For the purposes of this definition, "submitted"
+   means any form of electronic, verbal, or written communication sent
+   to the Licensor or its representatives, including but not limited to
+   communication on electronic mailing lists, source code control systems,
+   and issue tracking systems that are managed by, or on behalf of, the
+   Licensor for the purpose of discussing and improving the Work, but
+   excluding communication that is conspicuously marked or otherwise
+   designated in writing by the copyright owner as "Not a Contribution."
+
+   "Contributor" shall mean Licensor and any individual or Legal Entity
+   on behalf of whom a Contribution has been received by Licensor and
+   subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   copyright license to reproduce, prepare Derivative Works of,
+   publicly display, publicly perform, sublicense, and distribute the
+   Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   (except as stated in this section) patent license to make, have made,
+   use, offer to sell, sell, import, and otherwise transfer the Work,
+   where such license applies only to those patent claims licensable
+   by such Contributor that are necessarily infringed by their
+   Contribution(s) alone or by combination of their Contribution(s)
+   with the Work to which such Contribution(s) was submitted. If You
+   institute patent litigation against any entity (including a
+   cross-claim or counterclaim in a lawsuit) alleging that the Work
+   or a Contribution incorporated within the Work constitutes direct
+   or contributory patent infringement, then any patent licenses
+   granted to You under this License for that Work shall terminate
+   as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+   Work or Derivative Works thereof in any medium, with or without
+   modifications, and in Source or Object form, provided that You
+   meet the following conditions:
+
+   (a) You must give any other recipients of the Work or
+       Derivative Works a copy of this License; and
+
+   (b) You must cause any modified files to carry prominent notices
+       stating that You changed the files; and
+
+   (c) You must retain, in the Source form of any Derivative Works
+       that You distribute, all copyright, patent, trademark, and
+       attribution notices from the Source form of the Work,
+       excluding those notices that do not pertain to any part of
+       the Derivative Works; and
+
+   (d) If the Work includes a "NOTICE" text file as part of its
+       distribution, then any Derivative Works that You distribute must
+       include a readable copy of the attribution notices contained
+       within such NOTICE file, excluding those notices that do not
+       pertain to any part of the Derivative Works, in at least one
+       of the following places: within a NOTICE text file distributed
+       as part of the Derivative Works; within the Source form or
+       documentation, if provided along with the Derivative Works; or,
+       within a display generated by the Derivative Works, if and
+       wherever such third-party notices normally appear. The contents
+       of the NOTICE file are for informational purposes only and
+       do not modify the License. You may add Your own attribution
+       notices within Derivative Works that You distribute, alongside
+       or as an addendum to the NOTICE text from the Work, provided
+       that such additional attribution notices cannot be construed
+       as modifying the License.
+
+   You may add Your own copyright statement to Your modifications and
+   may provide additional or different license terms and conditions
+   for use, reproduction, or distribution of Your modifications, or
+   for any such Derivative Works as a whole, provided Your use,
+   reproduction, and distribution of the Work otherwise complies with
+   the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+   any Contribution intentionally submitted for inclusion in the Work
+   by You to the Licensor shall be under the terms and conditions of
+   this License, without any additional terms or conditions.
+   Notwithstanding the above, nothing herein shall supersede or modify
+   the terms of any separate license agreement you may have executed
+   with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+   names, trademarks, service marks, or product names of the Licensor,
+   except as required for reasonable and customary use in describing the
+   origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+   agreed to in writing, Licensor provides the Work (and each
+   Contributor provides its Contributions) on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+   implied, including, without limitation, any warranties or conditions
+   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+   PARTICULAR PURPOSE. You are solely responsible for determining the
+   appropriateness of using or redistributing the Work and assume any
+   risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+   whether in tort (including negligence), contract, or otherwise,
+   unless required by applicable law (such as deliberate and grossly
+   negligent acts) or agreed to in writing, shall any Contributor be
+   liable to You for damages, including any direct, indirect, special,
+   incidental, or consequential damages of any character arising as a
+   result of this License or out of the use or inability to use the
+   Work (including but not limited to damages for loss of goodwill,
+   work stoppage, computer failure or malfunction, or any and all
+   other commercial damages or losses), even if such Contributor
+   has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+   the Work or Derivative Works thereof, You may choose to offer,
+   and charge a fee for, acceptance of support, warranty, indemnity,
+   or other liability obligations and/or rights consistent with this
+   License. However, in accepting such obligations, You may act only
+   on Your own behalf and on Your sole responsibility, not on behalf
+   of any other Contributor, and only if You agree to indemnify,
+   defend, and hold each Contributor harmless for any liability
+   incurred by, or claims asserted against, such Contributor by reason
+   of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+   To apply the Apache License to your work, attach the following
+   boilerplate notice, with the fields enclosed by brackets "[]"
+   replaced with your own identifying information. (Don't include
+   the brackets!)  The text should be enclosed in the appropriate
+   comment syntax for the file format. We also recommend that a
+   file or class name and description of purpose be included on the
+   same "printed page" as the copyright notice for easier
+   identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+	http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff -pruN 43.0.0-1/rust-vendor/cfg-if/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/cfg-if/LICENSE-MIT
--- 43.0.0-1/rust-vendor/cfg-if/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cfg-if/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,25 @@
+Copyright (c) 2014 Alex Crichton
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/cfg-if/README.md 43.0.0-1ubuntu1/rust-vendor/cfg-if/README.md
--- 43.0.0-1/rust-vendor/cfg-if/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cfg-if/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,47 @@
+# cfg-if
+
+[Documentation](https://docs.rs/cfg-if)
+
+A macro to ergonomically define an item depending on a large number of #[cfg]
+parameters. Structured like an if-else chain, the first matching branch is the
+item that gets emitted.
+
+```toml
+[dependencies]
+cfg-if = "0.1"
+```
+
+## Example
+
+```rust
+cfg_if::cfg_if! {
+    if #[cfg(unix)] {
+        fn foo() { /* unix specific functionality */ }
+    } else if #[cfg(target_pointer_width = "32")] {
+        fn foo() { /* non-unix, 32-bit functionality */ }
+    } else {
+        fn foo() { /* fallback implementation */ }
+    }
+}
+
+fn main() {
+    foo();
+}
+```
+
+# License
+
+This project is licensed under either of
+
+ * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
+   http://www.apache.org/licenses/LICENSE-2.0)
+ * MIT license ([LICENSE-MIT](LICENSE-MIT) or
+   http://opensource.org/licenses/MIT)
+
+at your option.
+
+### Contribution
+
+Unless you explicitly state otherwise, any contribution intentionally submitted
+for inclusion in `cfg-if` by you, as defined in the Apache-2.0 license, shall be
+dual licensed as above, without any additional terms or conditions.
diff -pruN 43.0.0-1/rust-vendor/cfg-if/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/cfg-if/src/lib.rs
--- 43.0.0-1/rust-vendor/cfg-if/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cfg-if/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,176 @@
+//! A macro for defining `#[cfg]` if-else statements.
+//!
+//! The macro provided by this crate, `cfg_if`, is similar to the `if/elif` C
+//! preprocessor macro by allowing definition of a cascade of `#[cfg]` cases,
+//! emitting the implementation which matches first.
+//!
+//! This allows you to conveniently provide a long list `#[cfg]`'d blocks of code
+//! without having to rewrite each clause multiple times.
+//!
+//! # Example
+//!
+//! ```
+//! cfg_if::cfg_if! {
+//!     if #[cfg(unix)] {
+//!         fn foo() { /* unix specific functionality */ }
+//!     } else if #[cfg(target_pointer_width = "32")] {
+//!         fn foo() { /* non-unix, 32-bit functionality */ }
+//!     } else {
+//!         fn foo() { /* fallback implementation */ }
+//!     }
+//! }
+//!
+//! # fn main() {}
+//! ```
+
+#![no_std]
+#![doc(html_root_url = "https://docs.rs/cfg-if")]
+#![deny(missing_docs)]
+#![cfg_attr(test, deny(warnings))]
+
+/// The main macro provided by this crate. See crate documentation for more
+/// information.
+#[macro_export]
+macro_rules! cfg_if {
+    // match if/else chains with a final `else`
+    ($(
+        if #[cfg($meta:meta)] { $($tokens:tt)* }
+    ) else * else {
+        $($tokens2:tt)*
+    }) => {
+        $crate::cfg_if! {
+            @__items
+            () ;
+            $( ( ($meta) ($($tokens)*) ), )*
+            ( () ($($tokens2)*) ),
+        }
+    };
+
+    // match if/else chains lacking a final `else`
+    (
+        if #[cfg($i_met:meta)] { $($i_tokens:tt)* }
+        $(
+            else if #[cfg($e_met:meta)] { $($e_tokens:tt)* }
+        )*
+    ) => {
+        $crate::cfg_if! {
+            @__items
+            () ;
+            ( ($i_met) ($($i_tokens)*) ),
+            $( ( ($e_met) ($($e_tokens)*) ), )*
+            ( () () ),
+        }
+    };
+
+    // Internal and recursive macro to emit all the items
+    //
+    // Collects all the negated cfgs in a list at the beginning and after the
+    // semicolon is all the remaining items
+    (@__items ($($not:meta,)*) ; ) => {};
+    (@__items ($($not:meta,)*) ; ( ($($m:meta),*) ($($tokens:tt)*) ), $($rest:tt)*) => {
+        // Emit all items within one block, applying an appropriate #[cfg]. The
+        // #[cfg] will require all `$m` matchers specified and must also negate
+        // all previous matchers.
+        #[cfg(all($($m,)* not(any($($not),*))))] $crate::cfg_if! { @__identity $($tokens)* }
+
+        // Recurse to emit all other items in `$rest`, and when we do so add all
+        // our `$m` matchers to the list of `$not` matchers as future emissions
+        // will have to negate everything we just matched as well.
+        $crate::cfg_if! { @__items ($($not,)* $($m,)*) ; $($rest)* }
+    };
+
+    // Internal macro to make __apply work out right for different match types,
+    // because of how macros matching/expand stuff.
+    (@__identity $($tokens:tt)*) => {
+        $($tokens)*
+    };
+}
+
+#[cfg(test)]
+mod tests {
+    cfg_if! {
+        if #[cfg(test)] {
+            use core::option::Option as Option2;
+            fn works1() -> Option2<u32> { Some(1) }
+        } else {
+            fn works1() -> Option<u32> { None }
+        }
+    }
+
+    cfg_if! {
+        if #[cfg(foo)] {
+            fn works2() -> bool { false }
+        } else if #[cfg(test)] {
+            fn works2() -> bool { true }
+        } else {
+            fn works2() -> bool { false }
+        }
+    }
+
+    cfg_if! {
+        if #[cfg(foo)] {
+            fn works3() -> bool { false }
+        } else {
+            fn works3() -> bool { true }
+        }
+    }
+
+    cfg_if! {
+        if #[cfg(test)] {
+            use core::option::Option as Option3;
+            fn works4() -> Option3<u32> { Some(1) }
+        }
+    }
+
+    cfg_if! {
+        if #[cfg(foo)] {
+            fn works5() -> bool { false }
+        } else if #[cfg(test)] {
+            fn works5() -> bool { true }
+        }
+    }
+
+    #[test]
+    fn it_works() {
+        assert!(works1().is_some());
+        assert!(works2());
+        assert!(works3());
+        assert!(works4().is_some());
+        assert!(works5());
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_constants)]
+    fn test_usage_within_a_function() {
+        cfg_if! {if #[cfg(debug_assertions)] {
+            // we want to put more than one thing here to make sure that they
+            // all get configured properly.
+            assert!(cfg!(debug_assertions));
+            assert_eq!(4, 2+2);
+        } else {
+            assert!(works1().is_some());
+            assert_eq!(10, 5+5);
+        }}
+    }
+
+    trait Trait {
+        fn blah(&self);
+    }
+
+    #[allow(dead_code)]
+    struct Struct;
+
+    impl Trait for Struct {
+        cfg_if! {
+            if #[cfg(feature = "blah")] {
+                fn blah(&self) {
+                    unimplemented!();
+                }
+            } else {
+                fn blah(&self) {
+                    unimplemented!();
+                }
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/cfg-if/tests/xcrate.rs 43.0.0-1ubuntu1/rust-vendor/cfg-if/tests/xcrate.rs
--- 43.0.0-1/rust-vendor/cfg-if/tests/xcrate.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/cfg-if/tests/xcrate.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,14 @@
+cfg_if::cfg_if! {
+    if #[cfg(foo)] {
+        fn works() -> bool { false }
+    } else if #[cfg(test)] {
+        fn works() -> bool { true }
+    } else {
+        fn works() -> bool { false }
+    }
+}
+
+#[test]
+fn smoke() {
+    assert!(works());
+}
diff -pruN 43.0.0-1/rust-vendor/foreign-types/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/foreign-types/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/foreign-types/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/foreign-types/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"Cargo.toml":"1a667c28f60115423b68fea369255c2dcb129b8dce10f30e0e1da73d05f9adab","LICENSE-APACHE":"c6596eb7be8581c18be736c846fb9173b69eccf6ef94c5135893ec56bd92ba08","LICENSE-MIT":"333ea3aaa3cadb819f4acd9f9153f9feee060a995ca8710f32bc5bd9a4b91734","README.md":"6f3f1429f2724a481df811842f318d0d3b83160ada953fd869d4b685f7fd72e4","src/lib.rs":"4f0a33bf8ec94a57d1b71e50f1af8ca410985e447f69fdc9c680545b03ea4566"},"package":"f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/foreign-types/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/foreign-types/Cargo.toml
--- 43.0.0-1/rust-vendor/foreign-types/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/foreign-types/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,22 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g. crates.io) dependencies
+#
+# If you believe there's an error in this file please file an
+# issue against the rust-lang/cargo repository. If you're
+# editing this file be aware that the upstream Cargo.toml
+# will likely look very different (and much more reasonable)
+
+[package]
+name = "foreign-types"
+version = "0.3.2"
+authors = ["Steven Fackler <sfackler@gmail.com>"]
+description = "A framework for Rust wrappers over C APIs"
+readme = "README.md"
+license = "MIT/Apache-2.0"
+repository = "https://github.com/sfackler/foreign-types"
+[dependencies.foreign-types-shared]
+version = "0.1"
diff -pruN 43.0.0-1/rust-vendor/foreign-types/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/foreign-types/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/foreign-types/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/foreign-types/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,202 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "{}"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright {yyyy} {name of copyright owner}
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
diff -pruN 43.0.0-1/rust-vendor/foreign-types/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/foreign-types/LICENSE-MIT
--- 43.0.0-1/rust-vendor/foreign-types/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/foreign-types/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,19 @@
+Copyright (c) 2017 The foreign-types Developers
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/foreign-types/README.md 43.0.0-1ubuntu1/rust-vendor/foreign-types/README.md
--- 43.0.0-1/rust-vendor/foreign-types/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/foreign-types/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,23 @@
+# foreign-types
+
+[![CircleCI](https://circleci.com/gh/sfackler/foreign-types.svg?style=shield)](https://circleci.com/gh/sfackler/foreign-types)
+
+[Documentation](https://docs.rs/foreign-types)
+
+A framework for Rust wrappers over C APIs.
+
+## License
+
+Licensed under either of
+
+ * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
+ * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
+
+at your option.
+
+### Contribution
+
+Unless you explicitly state otherwise, any contribution intentionally
+submitted for inclusion in the work by you, as defined in the Apache-2.0
+license, shall be dual licensed as above, without any additional terms or
+conditions.
diff -pruN 43.0.0-1/rust-vendor/foreign-types/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/foreign-types/src/lib.rs
--- 43.0.0-1/rust-vendor/foreign-types/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/foreign-types/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,306 @@
+//! A framework for Rust wrappers over C APIs.
+//!
+//! Ownership is as important in C as it is in Rust, but the semantics are often implicit. In
+//! particular, pointer-to-value is commonly used to pass C values both when transferring ownership
+//! or a borrow.
+//!
+//! This crate provides a framework to define a Rust wrapper over these kinds of raw C APIs in a way
+//! that allows ownership semantics to be expressed in an ergonomic manner. The framework takes a
+//! dual-type approach similar to APIs in the standard library such as `PathBuf`/`Path` or `String`/
+//! `str`. One type represents an owned value and references to the other represent borrowed
+//! values.
+//!
+//! # Examples
+//!
+//! ```
+//! use foreign_types::{ForeignType, ForeignTypeRef, Opaque};
+//! use std::ops::{Deref, DerefMut};
+//!
+//! mod foo_sys {
+//!     pub enum FOO {}
+//!
+//!     extern {
+//!         pub fn FOO_free(foo: *mut FOO);
+//!     }
+//! }
+//!
+//! // The borrowed type is a newtype wrapper around an `Opaque` value.
+//! //
+//! // `FooRef` values never exist; we instead create references to `FooRef`s
+//! // from raw C pointers.
+//! pub struct FooRef(Opaque);
+//!
+//! impl ForeignTypeRef for FooRef {
+//!     type CType = foo_sys::FOO;
+//! }
+//!
+//! // The owned type is simply a newtype wrapper around the raw C type.
+//! //
+//! // It dereferences to `FooRef`, so methods that do not require ownership
+//! // should be defined there.
+//! pub struct Foo(*mut foo_sys::FOO);
+//!
+//! impl Drop for Foo {
+//!     fn drop(&mut self) {
+//!         unsafe { foo_sys::FOO_free(self.0) }
+//!     }
+//! }
+//!
+//! impl ForeignType for Foo {
+//!     type CType = foo_sys::FOO;
+//!     type Ref = FooRef;
+//!
+//!     unsafe fn from_ptr(ptr: *mut foo_sys::FOO) -> Foo {
+//!         Foo(ptr)
+//!     }
+//!
+//!     fn as_ptr(&self) -> *mut foo_sys::FOO {
+//!         self.0
+//!     }
+//! }
+//!
+//! impl Deref for Foo {
+//!     type Target = FooRef;
+//!
+//!     fn deref(&self) -> &FooRef {
+//!         unsafe { FooRef::from_ptr(self.0) }
+//!     }
+//! }
+//!
+//! impl DerefMut for Foo {
+//!     fn deref_mut(&mut self) -> &mut FooRef {
+//!         unsafe { FooRef::from_ptr_mut(self.0) }
+//!     }
+//! }
+//! ```
+//!
+//! The `foreign_type!` macro can generate this boilerplate for you:
+//!
+//! ```
+//! #[macro_use]
+//! extern crate foreign_types;
+//!
+//! mod foo_sys {
+//!     pub enum FOO {}
+//!
+//!     extern {
+//!         pub fn FOO_free(foo: *mut FOO);
+//!         pub fn FOO_duplicate(foo: *mut FOO) -> *mut FOO; // Optional
+//!     }
+//! }
+//!
+//! foreign_type! {
+//!     type CType = foo_sys::FOO;
+//!     fn drop = foo_sys::FOO_free;
+//!     fn clone = foo_sys::FOO_duplicate; // Optional
+//!     /// A Foo.
+//!     pub struct Foo;
+//!     /// A borrowed Foo.
+//!     pub struct FooRef;
+//! }
+//!
+//! # fn main() {}
+//! ```
+//!
+//! If `fn clone` is specified, then it must take `CType` as an argument and return a copy of it as `CType`.
+//! It will be used to implement `ToOwned` and `Clone`.
+//!
+//! `#[derive(…)] is permitted before the lines with `pub struct`.
+//! `#[doc(hidden)]` before the `type CType` line will hide the `foreign_type!` implementations from documentation.
+//!
+//! Say we then have a separate type in our C API that contains a `FOO`:
+//!
+//! ```
+//! mod foo_sys {
+//!     pub enum FOO {}
+//!     pub enum BAR {}
+//!
+//!     extern {
+//!         pub fn FOO_free(foo: *mut FOO);
+//!         pub fn BAR_free(bar: *mut BAR);
+//!         pub fn BAR_get_foo(bar: *mut BAR) -> *mut FOO;
+//!     }
+//! }
+//! ```
+//!
+//! The documentation for the C library states that `BAR_get_foo` returns a reference into the `BAR`
+//! passed to it, which translates into a reference in Rust. It also says that we're allowed to
+//! modify the `FOO`, so we'll define a pair of accessor methods, one immutable and one mutable:
+//!
+//! ```
+//! #[macro_use]
+//! extern crate foreign_types;
+//!
+//! use foreign_types::ForeignTypeRef;
+//!
+//! mod foo_sys {
+//!     pub enum FOO {}
+//!     pub enum BAR {}
+//!
+//!     extern {
+//!         pub fn FOO_free(foo: *mut FOO);
+//!         pub fn BAR_free(bar: *mut BAR);
+//!         pub fn BAR_get_foo(bar: *mut BAR) -> *mut FOO;
+//!     }
+//! }
+//!
+//! foreign_type! {
+//!     #[doc(hidden)]
+//!     type CType = foo_sys::FOO;
+//!     fn drop = foo_sys::FOO_free;
+//!     /// A Foo.
+//!     pub struct Foo;
+//!     /// A borrowed Foo.
+//!     pub struct FooRef;
+//! }
+//!
+//! foreign_type! {
+//!     type CType = foo_sys::BAR;
+//!     fn drop = foo_sys::BAR_free;
+//!     /// A Foo.
+//!     pub struct Bar;
+//!     /// A borrowed Bar.
+//!     pub struct BarRef;
+//! }
+//!
+//! impl BarRef {
+//!     fn foo(&self) -> &FooRef {
+//!         unsafe { FooRef::from_ptr(foo_sys::BAR_get_foo(self.as_ptr())) }
+//!     }
+//!
+//!     fn foo_mut(&mut self) -> &mut FooRef {
+//!         unsafe { FooRef::from_ptr_mut(foo_sys::BAR_get_foo(self.as_ptr())) }
+//!     }
+//! }
+//!
+//! # fn main() {}
+//! ```
+#![no_std]
+#![warn(missing_docs)]
+#![doc(html_root_url="https://docs.rs/foreign-types/0.3")]
+extern crate foreign_types_shared;
+
+#[doc(inline)]
+pub use foreign_types_shared::*;
+
+/// A macro to easily define wrappers for foreign types.
+///
+/// # Examples
+///
+/// ```
+/// #[macro_use]
+/// extern crate foreign_types;
+///
+/// # mod openssl_sys { pub type SSL = (); pub unsafe fn SSL_free(_: *mut SSL) {} pub unsafe fn SSL_dup(x: *mut SSL) -> *mut SSL {x} }
+/// foreign_type! {
+///     type CType = openssl_sys::SSL;
+///     fn drop = openssl_sys::SSL_free;
+///     fn clone = openssl_sys::SSL_dup;
+///     /// Documentation for the owned type.
+///     pub struct Ssl;
+///     /// Documentation for the borrowed type.
+///     pub struct SslRef;
+/// }
+///
+/// # fn main() {}
+/// ```
+#[macro_export]
+macro_rules! foreign_type {
+    (
+        $(#[$impl_attr:meta])*
+        type CType = $ctype:ty;
+        fn drop = $drop:expr;
+        $(fn clone = $clone:expr;)*
+        $(#[$owned_attr:meta])*
+        pub struct $owned:ident;
+        $(#[$borrowed_attr:meta])*
+        pub struct $borrowed:ident;
+    ) => {
+        $(#[$owned_attr])*
+        pub struct $owned(*mut $ctype);
+
+        $(#[$impl_attr])*
+        impl $crate::ForeignType for $owned {
+            type CType = $ctype;
+            type Ref = $borrowed;
+
+            #[inline]
+            unsafe fn from_ptr(ptr: *mut $ctype) -> $owned {
+                $owned(ptr)
+            }
+
+            #[inline]
+            fn as_ptr(&self) -> *mut $ctype {
+                self.0
+            }
+        }
+
+        impl Drop for $owned {
+            #[inline]
+            fn drop(&mut self) {
+                unsafe { $drop(self.0) }
+            }
+        }
+
+        $(
+            impl Clone for $owned {
+                #[inline]
+                fn clone(&self) -> $owned {
+                    unsafe {
+                        let handle: *mut $ctype = $clone(self.0);
+                        $crate::ForeignType::from_ptr(handle)
+                    }
+                }
+            }
+
+            impl ::std::borrow::ToOwned for $borrowed {
+                type Owned = $owned;
+                #[inline]
+                fn to_owned(&self) -> $owned {
+                    unsafe {
+                        let handle: *mut $ctype = $clone($crate::ForeignTypeRef::as_ptr(self));
+                        $crate::ForeignType::from_ptr(handle)
+                    }
+                }
+            }
+        )*
+
+        impl ::std::ops::Deref for $owned {
+            type Target = $borrowed;
+
+            #[inline]
+            fn deref(&self) -> &$borrowed {
+                unsafe { $crate::ForeignTypeRef::from_ptr(self.0) }
+            }
+        }
+
+        impl ::std::ops::DerefMut for $owned {
+            #[inline]
+            fn deref_mut(&mut self) -> &mut $borrowed {
+                unsafe { $crate::ForeignTypeRef::from_ptr_mut(self.0) }
+            }
+        }
+
+        impl ::std::borrow::Borrow<$borrowed> for $owned {
+            #[inline]
+            fn borrow(&self) -> &$borrowed {
+                &**self
+            }
+        }
+
+        impl ::std::convert::AsRef<$borrowed> for $owned {
+            #[inline]
+            fn as_ref(&self) -> &$borrowed {
+                &**self
+            }
+        }
+
+        $(#[$borrowed_attr])*
+        pub struct $borrowed($crate::Opaque);
+
+        $(#[$impl_attr])*
+        impl $crate::ForeignTypeRef for $borrowed {
+            type CType = $ctype;
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/foreign-types-shared/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/foreign-types-shared/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/foreign-types-shared/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/foreign-types-shared/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"Cargo.toml":"6b91ae600fe7b521537096b2269ab7bfd606f8a1fcd97749634dd03ba18daf53","LICENSE-APACHE":"c6596eb7be8581c18be736c846fb9173b69eccf6ef94c5135893ec56bd92ba08","LICENSE-MIT":"333ea3aaa3cadb819f4acd9f9153f9feee060a995ca8710f32bc5bd9a4b91734","src/lib.rs":"77aed289fd36258c273f033e766e572ee05330249083c017d045f0a75662f5df"},"package":"00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/foreign-types-shared/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/foreign-types-shared/Cargo.toml
--- 43.0.0-1/rust-vendor/foreign-types-shared/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/foreign-types-shared/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,21 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g. crates.io) dependencies
+#
+# If you believe there's an error in this file please file an
+# issue against the rust-lang/cargo repository. If you're
+# editing this file be aware that the upstream Cargo.toml
+# will likely look very different (and much more reasonable)
+
+[package]
+name = "foreign-types-shared"
+version = "0.1.1"
+authors = ["Steven Fackler <sfackler@gmail.com>"]
+description = "An internal crate used by foreign-types"
+license = "MIT/Apache-2.0"
+repository = "https://github.com/sfackler/foreign-types"
+
+[dependencies]
diff -pruN 43.0.0-1/rust-vendor/foreign-types-shared/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/foreign-types-shared/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/foreign-types-shared/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/foreign-types-shared/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,202 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "{}"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright {yyyy} {name of copyright owner}
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
diff -pruN 43.0.0-1/rust-vendor/foreign-types-shared/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/foreign-types-shared/LICENSE-MIT
--- 43.0.0-1/rust-vendor/foreign-types-shared/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/foreign-types-shared/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,19 @@
+Copyright (c) 2017 The foreign-types Developers
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/foreign-types-shared/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/foreign-types-shared/src/lib.rs
--- 43.0.0-1/rust-vendor/foreign-types-shared/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/foreign-types-shared/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,51 @@
+//! Internal crate used by foreign-types
+
+#![no_std]
+#![warn(missing_docs)]
+#![doc(html_root_url="https://docs.rs/foreign-types-shared/0.1")]
+
+use core::cell::UnsafeCell;
+
+/// An opaque type used to define `ForeignTypeRef` types.
+///
+/// A type implementing `ForeignTypeRef` should simply be a newtype wrapper around this type.
+pub struct Opaque(UnsafeCell<()>);
+
+/// A type implemented by wrappers over foreign types.
+pub trait ForeignType: Sized {
+    /// The raw C type.
+    type CType;
+
+    /// The type representing a reference to this type.
+    type Ref: ForeignTypeRef<CType = Self::CType>;
+
+    /// Constructs an instance of this type from its raw type.
+    unsafe fn from_ptr(ptr: *mut Self::CType) -> Self;
+
+    /// Returns a raw pointer to the wrapped value.
+    fn as_ptr(&self) -> *mut Self::CType;
+}
+
+/// A trait implemented by types which reference borrowed foreign types.
+pub trait ForeignTypeRef: Sized {
+    /// The raw C type.
+    type CType;
+
+    /// Constructs a shared instance of this type from its raw type.
+    #[inline]
+    unsafe fn from_ptr<'a>(ptr: *mut Self::CType) -> &'a Self {
+        &*(ptr as *mut _)
+    }
+
+    /// Constructs a mutable reference of this type from its raw type.
+    #[inline]
+    unsafe fn from_ptr_mut<'a>(ptr: *mut Self::CType) -> &'a mut Self {
+        &mut *(ptr as *mut _)
+    }
+
+    /// Returns a raw pointer to the wrapped value.
+    #[inline]
+    fn as_ptr(&self) -> *mut Self::CType {
+        self as *const _ as *mut _
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/heck/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/heck/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/heck/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/heck/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"CHANGELOG.md":"972078362c7c30856e5ef46aa52c1c0ec3de40f417544566e225204b4cd4982a","Cargo.toml":"db0e63b72de157a2f5194458b73b6542c3f4e17e33ab34a71d0260bfc035467e","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0","README.md":"c3c627aa49e64826aaf4914e5a3bd0aa2d1b304464c3e99cb6507190d3620a85","src/kebab.rs":"3075cf72c95404e6b5800494a5d8a3c5f6dd5066593ddb249cefcb376e30b450","src/lib.rs":"bffcc5144da472d2f915696d4654f7608e60861d168d3dd07b5dcb8f14211153","src/lower_camel.rs":"3b1e367db1ae22aa8c49b6800abf5e23e6befadf7cc89a252534f7286676e11f","src/shouty_kebab.rs":"8539eeddd4d78c10a8d0df3e19ad171409e95429debcdc6b7dbefd82d37b6928","src/shouty_snake.rs":"e8b6dcb77de87e2355067d5d47037537b68fa51c2601924a6acfae409c6d9920","src/snake.rs":"e13e8a4373e9388044bd91edff496362a1e7f6bd52f5f6be14a043878035245d","src/title.rs":"a12abc5057b48b8d5922d2a11b6029b230e13ae9a04109a40407d19505c2521b","src/train.rs":"0cbe348135852c12e9c56ab93233ca5c044218bc1b8818b620c3e80cd19973c2","src/upper_camel.rs":"9036542a600fd261b046ac4574622f831335abcf1366665aab56f4045fceb0d5"},"package":"2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/heck/CHANGELOG.md 43.0.0-1ubuntu1/rust-vendor/heck/CHANGELOG.md
--- 43.0.0-1/rust-vendor/heck/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/heck/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,25 @@
+# unreleased
+
+# 0.5.0
+
+- Add `no_std` support.
+- Remove non-additive `unicode` feature. The library now uses `char::is_alphanumeric`
+  instead of the `unicode-segmentation` library to determine word boundaries in all cases.
+
+# 0.4.1
+
+Improvements:
+
+- Add Train-Case support
+
+# 0.4.0
+
+Breaking changes:
+
+* Make unicode support optional (off by default). Enable the `unicode` crate
+  feature if you need unicode support.
+* Rename all traits from `SomeCase` to `ToSomeCase`, matching `std`s convention
+  of beginning trait names with a verb (`ToOwned`, `AsRef`, …)
+* Rename `ToMixedCase` to `ToLowerCamelCase`
+* Rename `ToCamelCase` to `ToUpperCamelCase`
+* Add `ToPascalCase` as an alias to `ToUpperCamelCase`
diff -pruN 43.0.0-1/rust-vendor/heck/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/heck/Cargo.toml
--- 43.0.0-1/rust-vendor/heck/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/heck/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,34 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2021"
+rust-version = "1.56"
+name = "heck"
+version = "0.5.0"
+include = [
+    "src/**/*",
+    "LICENSE-*",
+    "README.md",
+    "CHANGELOG.md",
+]
+description = "heck is a case conversion library."
+readme = "README.md"
+keywords = [
+    "string",
+    "case",
+    "camel",
+    "snake",
+    "unicode",
+]
+categories = ["no-std"]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/withoutboats/heck"
diff -pruN 43.0.0-1/rust-vendor/heck/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/heck/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/heck/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/heck/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,201 @@
+                              Apache License
+                        Version 2.0, January 2004
+                     http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+   "License" shall mean the terms and conditions for use, reproduction,
+   and distribution as defined by Sections 1 through 9 of this document.
+
+   "Licensor" shall mean the copyright owner or entity authorized by
+   the copyright owner that is granting the License.
+
+   "Legal Entity" shall mean the union of the acting entity and all
+   other entities that control, are controlled by, or are under common
+   control with that entity. For the purposes of this definition,
+   "control" means (i) the power, direct or indirect, to cause the
+   direction or management of such entity, whether by contract or
+   otherwise, or (ii) ownership of fifty percent (50%) or more of the
+   outstanding shares, or (iii) beneficial ownership of such entity.
+
+   "You" (or "Your") shall mean an individual or Legal Entity
+   exercising permissions granted by this License.
+
+   "Source" form shall mean the preferred form for making modifications,
+   including but not limited to software source code, documentation
+   source, and configuration files.
+
+   "Object" form shall mean any form resulting from mechanical
+   transformation or translation of a Source form, including but
+   not limited to compiled object code, generated documentation,
+   and conversions to other media types.
+
+   "Work" shall mean the work of authorship, whether in Source or
+   Object form, made available under the License, as indicated by a
+   copyright notice that is included in or attached to the work
+   (an example is provided in the Appendix below).
+
+   "Derivative Works" shall mean any work, whether in Source or Object
+   form, that is based on (or derived from) the Work and for which the
+   editorial revisions, annotations, elaborations, or other modifications
+   represent, as a whole, an original work of authorship. For the purposes
+   of this License, Derivative Works shall not include works that remain
+   separable from, or merely link (or bind by name) to the interfaces of,
+   the Work and Derivative Works thereof.
+
+   "Contribution" shall mean any work of authorship, including
+   the original version of the Work and any modifications or additions
+   to that Work or Derivative Works thereof, that is intentionally
+   submitted to Licensor for inclusion in the Work by the copyright owner
+   or by an individual or Legal Entity authorized to submit on behalf of
+   the copyright owner. For the purposes of this definition, "submitted"
+   means any form of electronic, verbal, or written communication sent
+   to the Licensor or its representatives, including but not limited to
+   communication on electronic mailing lists, source code control systems,
+   and issue tracking systems that are managed by, or on behalf of, the
+   Licensor for the purpose of discussing and improving the Work, but
+   excluding communication that is conspicuously marked or otherwise
+   designated in writing by the copyright owner as "Not a Contribution."
+
+   "Contributor" shall mean Licensor and any individual or Legal Entity
+   on behalf of whom a Contribution has been received by Licensor and
+   subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   copyright license to reproduce, prepare Derivative Works of,
+   publicly display, publicly perform, sublicense, and distribute the
+   Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   (except as stated in this section) patent license to make, have made,
+   use, offer to sell, sell, import, and otherwise transfer the Work,
+   where such license applies only to those patent claims licensable
+   by such Contributor that are necessarily infringed by their
+   Contribution(s) alone or by combination of their Contribution(s)
+   with the Work to which such Contribution(s) was submitted. If You
+   institute patent litigation against any entity (including a
+   cross-claim or counterclaim in a lawsuit) alleging that the Work
+   or a Contribution incorporated within the Work constitutes direct
+   or contributory patent infringement, then any patent licenses
+   granted to You under this License for that Work shall terminate
+   as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+   Work or Derivative Works thereof in any medium, with or without
+   modifications, and in Source or Object form, provided that You
+   meet the following conditions:
+
+   (a) You must give any other recipients of the Work or
+       Derivative Works a copy of this License; and
+
+   (b) You must cause any modified files to carry prominent notices
+       stating that You changed the files; and
+
+   (c) You must retain, in the Source form of any Derivative Works
+       that You distribute, all copyright, patent, trademark, and
+       attribution notices from the Source form of the Work,
+       excluding those notices that do not pertain to any part of
+       the Derivative Works; and
+
+   (d) If the Work includes a "NOTICE" text file as part of its
+       distribution, then any Derivative Works that You distribute must
+       include a readable copy of the attribution notices contained
+       within such NOTICE file, excluding those notices that do not
+       pertain to any part of the Derivative Works, in at least one
+       of the following places: within a NOTICE text file distributed
+       as part of the Derivative Works; within the Source form or
+       documentation, if provided along with the Derivative Works; or,
+       within a display generated by the Derivative Works, if and
+       wherever such third-party notices normally appear. The contents
+       of the NOTICE file are for informational purposes only and
+       do not modify the License. You may add Your own attribution
+       notices within Derivative Works that You distribute, alongside
+       or as an addendum to the NOTICE text from the Work, provided
+       that such additional attribution notices cannot be construed
+       as modifying the License.
+
+   You may add Your own copyright statement to Your modifications and
+   may provide additional or different license terms and conditions
+   for use, reproduction, or distribution of Your modifications, or
+   for any such Derivative Works as a whole, provided Your use,
+   reproduction, and distribution of the Work otherwise complies with
+   the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+   any Contribution intentionally submitted for inclusion in the Work
+   by You to the Licensor shall be under the terms and conditions of
+   this License, without any additional terms or conditions.
+   Notwithstanding the above, nothing herein shall supersede or modify
+   the terms of any separate license agreement you may have executed
+   with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+   names, trademarks, service marks, or product names of the Licensor,
+   except as required for reasonable and customary use in describing the
+   origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+   agreed to in writing, Licensor provides the Work (and each
+   Contributor provides its Contributions) on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+   implied, including, without limitation, any warranties or conditions
+   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+   PARTICULAR PURPOSE. You are solely responsible for determining the
+   appropriateness of using or redistributing the Work and assume any
+   risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+   whether in tort (including negligence), contract, or otherwise,
+   unless required by applicable law (such as deliberate and grossly
+   negligent acts) or agreed to in writing, shall any Contributor be
+   liable to You for damages, including any direct, indirect, special,
+   incidental, or consequential damages of any character arising as a
+   result of this License or out of the use or inability to use the
+   Work (including but not limited to damages for loss of goodwill,
+   work stoppage, computer failure or malfunction, or any and all
+   other commercial damages or losses), even if such Contributor
+   has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+   the Work or Derivative Works thereof, You may choose to offer,
+   and charge a fee for, acceptance of support, warranty, indemnity,
+   or other liability obligations and/or rights consistent with this
+   License. However, in accepting such obligations, You may act only
+   on Your own behalf and on Your sole responsibility, not on behalf
+   of any other Contributor, and only if You agree to indemnify,
+   defend, and hold each Contributor harmless for any liability
+   incurred by, or claims asserted against, such Contributor by reason
+   of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+   To apply the Apache License to your work, attach the following
+   boilerplate notice, with the fields enclosed by brackets "[]"
+   replaced with your own identifying information. (Don't include
+   the brackets!)  The text should be enclosed in the appropriate
+   comment syntax for the file format. We also recommend that a
+   file or class name and description of purpose be included on the
+   same "printed page" as the copyright notice for easier
+   identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+	http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff -pruN 43.0.0-1/rust-vendor/heck/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/heck/LICENSE-MIT
--- 43.0.0-1/rust-vendor/heck/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/heck/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,25 @@
+Copyright (c) 2015 The Rust Project Developers
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/heck/README.md 43.0.0-1ubuntu1/rust-vendor/heck/README.md
--- 43.0.0-1/rust-vendor/heck/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/heck/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,53 @@
+# **heck** is a case conversion library
+
+!["I specifically requested the opposite of this."](./no_step_on_snek.png)
+
+This library exists to provide case conversion between common cases like
+CamelCase and snake_case. It is intended to be unicode aware, internally
+consistent, and reasonably well performing.
+
+## Definition of a word boundary
+
+Word boundaries are defined by non-alphanumeric characters, as well as
+within those words in this manner:
+
+1. If an uppercase character is followed by lowercase letters, a word
+boundary is considered to be just prior to that uppercase character.
+2. If multiple uppercase characters are consecutive, they are considered to
+be within a single word, except that the last will be part of the next word
+if it is followed by lowercase characters (see rule 1).
+
+That is, "HelloWorld" is segmented `Hello|World` whereas "XMLHttpRequest" is
+segmented `XML|Http|Request`.
+
+Characters not within words (such as spaces, punctuations, and underscores)
+are not included in the output string except as they are a part of the case
+being converted to. Multiple adjacent word boundaries (such as a series of
+underscores) are folded into one. ("hello__world" in snake case is therefore
+"hello_world", not the exact same string). Leading or trailing word boundary
+indicators are dropped, except insofar as CamelCase capitalizes the first word.
+
+## Cases contained in this library:
+
+1. UpperCamelCase
+2. lowerCamelCase
+3. snake_case
+4. kebab-case
+5. SHOUTY_SNAKE_CASE
+6. Title Case
+7. SHOUTY-KEBAB-CASE
+8. Train-Case
+
+## MSRV
+
+The minimum supported Rust version for this crate is 1.56.0. This may change in
+minor or patch releases, but we probably won't ever require a very recent
+version. If you would like to have a stronger guarantee than that, please open
+an issue.
+
+## License
+
+heck is distributed under the terms of both the MIT license and the
+Apache License (Version 2.0).
+
+See LICENSE-APACHE and LICENSE-MIT for details.
diff -pruN 43.0.0-1/rust-vendor/heck/src/kebab.rs 43.0.0-1ubuntu1/rust-vendor/heck/src/kebab.rs
--- 43.0.0-1/rust-vendor/heck/src/kebab.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/heck/src/kebab.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,75 @@
+use core::fmt;
+
+use alloc::{borrow::ToOwned, string::ToString};
+
+use crate::{lowercase, transform};
+
+/// This trait defines a kebab case conversion.
+///
+/// In kebab-case, word boundaries are indicated by hyphens.
+///
+/// ## Example:
+///
+/// ```rust
+/// use heck::ToKebabCase;
+///
+/// let sentence = "We are going to inherit the earth.";
+/// assert_eq!(sentence.to_kebab_case(), "we-are-going-to-inherit-the-earth");
+/// ```
+pub trait ToKebabCase: ToOwned {
+    /// Convert this type to kebab case.
+    fn to_kebab_case(&self) -> Self::Owned;
+}
+
+impl ToKebabCase for str {
+    fn to_kebab_case(&self) -> Self::Owned {
+        AsKebabCase(self).to_string()
+    }
+}
+
+/// This wrapper performs a kebab case conversion in [`fmt::Display`].
+///
+/// ## Example:
+///
+/// ```
+/// use heck::AsKebabCase;
+///
+/// let sentence = "We are going to inherit the earth.";
+/// assert_eq!(format!("{}", AsKebabCase(sentence)), "we-are-going-to-inherit-the-earth");
+/// ```
+pub struct AsKebabCase<T: AsRef<str>>(pub T);
+
+impl<T: AsRef<str>> fmt::Display for AsKebabCase<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        transform(self.0.as_ref(), lowercase, |f| write!(f, "-"), f)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::ToKebabCase;
+
+    macro_rules! t {
+        ($t:ident : $s1:expr => $s2:expr) => {
+            #[test]
+            fn $t() {
+                assert_eq!($s1.to_kebab_case(), $s2)
+            }
+        };
+    }
+
+    t!(test1: "CamelCase" => "camel-case");
+    t!(test2: "This is Human case." => "this-is-human-case");
+    t!(test3: "MixedUP CamelCase, with some Spaces" => "mixed-up-camel-case-with-some-spaces");
+    t!(test4: "mixed_up_ snake_case with some _spaces" => "mixed-up-snake-case-with-some-spaces");
+    t!(test5: "kebab-case" => "kebab-case");
+    t!(test6: "SHOUTY_SNAKE_CASE" => "shouty-snake-case");
+    t!(test7: "snake_case" => "snake-case");
+    t!(test8: "this-contains_ ALLKinds OfWord_Boundaries" => "this-contains-all-kinds-of-word-boundaries");
+    t!(test9: "XΣXΣ baﬄe" => "xσxς-baﬄe");
+    t!(test10: "XMLHttpRequest" => "xml-http-request");
+    t!(test11: "لِنَذْهَبْ إِلَى السِّيْنَمَا" => "لِنَذْهَبْ-إِلَى-السِّيْنَمَا");
+    // Japanese and Chinese do not have word separation.
+    t!(test12: "ファイルを読み込み" => "ファイルを読み込み");
+    t!(test13: "祝你一天过得愉快" => "祝你一天过得愉快");
+}
diff -pruN 43.0.0-1/rust-vendor/heck/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/heck/src/lib.rs
--- 43.0.0-1/rust-vendor/heck/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/heck/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,192 @@
+//! **heck** is a case conversion library.
+//!
+//! This library exists to provide case conversion between common cases like
+//! CamelCase and snake_case. It is intended to be unicode aware, internally
+//! consistent, and reasonably well performing.
+//!
+//! ## Definition of a word boundary
+//!
+//! Word boundaries are defined by non-alphanumeric characters, as well as
+//! within those words in this manner:
+//!
+//! 1. If an uppercase character is followed by lowercase letters, a word
+//! boundary is considered to be just prior to that uppercase character.
+//! 2. If multiple uppercase characters are consecutive, they are considered to
+//! be within a single word, except that the last will be part of the next word
+//! if it is followed by lowercase characters (see rule 1).
+//!
+//! That is, "HelloWorld" is segmented `Hello|World` whereas "XMLHttpRequest" is
+//! segmented `XML|Http|Request`.
+//!
+//! Characters not within words (such as spaces, punctuations, and underscores)
+//! are not included in the output string except as they are a part of the case
+//! being converted to. Multiple adjacent word boundaries (such as a series of
+//! underscores) are folded into one. ("hello__world" in snake case is therefore
+//! "hello_world", not the exact same string). Leading or trailing word boundary
+//! indicators are dropped, except insofar as CamelCase capitalizes the first
+//! word.
+//!
+//! ### Cases contained in this library:
+//!
+//! 1. UpperCamelCase
+//! 2. lowerCamelCase
+//! 3. snake_case
+//! 4. kebab-case
+//! 5. SHOUTY_SNAKE_CASE
+//! 6. Title Case
+//! 7. SHOUTY-KEBAB-CASE
+//! 8. Train-Case
+#![deny(missing_docs)]
+#![forbid(unsafe_code)]
+#![no_std]
+
+extern crate alloc;
+
+mod kebab;
+mod lower_camel;
+mod shouty_kebab;
+mod shouty_snake;
+mod snake;
+mod title;
+mod train;
+mod upper_camel;
+
+pub use kebab::{AsKebabCase, ToKebabCase};
+pub use lower_camel::{AsLowerCamelCase, ToLowerCamelCase};
+pub use shouty_kebab::{AsShoutyKebabCase, ToShoutyKebabCase};
+pub use shouty_snake::{
+    AsShoutySnakeCase, AsShoutySnakeCase as AsShoutySnekCase, ToShoutySnakeCase, ToShoutySnekCase,
+};
+pub use snake::{AsSnakeCase, AsSnakeCase as AsSnekCase, ToSnakeCase, ToSnekCase};
+pub use title::{AsTitleCase, ToTitleCase};
+pub use train::{AsTrainCase, ToTrainCase};
+pub use upper_camel::{
+    AsUpperCamelCase, AsUpperCamelCase as AsPascalCase, ToPascalCase, ToUpperCamelCase,
+};
+
+use core::fmt;
+
+fn transform<F, G>(
+    s: &str,
+    mut with_word: F,
+    mut boundary: G,
+    f: &mut fmt::Formatter,
+) -> fmt::Result
+where
+    F: FnMut(&str, &mut fmt::Formatter) -> fmt::Result,
+    G: FnMut(&mut fmt::Formatter) -> fmt::Result,
+{
+    /// Tracks the current 'mode' of the transformation algorithm as it scans
+    /// the input string.
+    ///
+    /// The mode is a tri-state which tracks the case of the last cased
+    /// character of the current word. If there is no cased character
+    /// (either lowercase or uppercase) since the previous word boundary,
+    /// than the mode is `Boundary`. If the last cased character is lowercase,
+    /// then the mode is `Lowercase`. Othertherwise, the mode is
+    /// `Uppercase`.
+    #[derive(Clone, Copy, PartialEq)]
+    enum WordMode {
+        /// There have been no lowercase or uppercase characters in the current
+        /// word.
+        Boundary,
+        /// The previous cased character in the current word is lowercase.
+        Lowercase,
+        /// The previous cased character in the current word is uppercase.
+        Uppercase,
+    }
+
+    let mut first_word = true;
+
+    for word in s.split(|c: char| !c.is_alphanumeric()) {
+        let mut char_indices = word.char_indices().peekable();
+        let mut init = 0;
+        let mut mode = WordMode::Boundary;
+
+        while let Some((i, c)) = char_indices.next() {
+            if let Some(&(next_i, next)) = char_indices.peek() {
+                // The mode including the current character, assuming the
+                // current character does not result in a word boundary.
+                let next_mode = if c.is_lowercase() {
+                    WordMode::Lowercase
+                } else if c.is_uppercase() {
+                    WordMode::Uppercase
+                } else {
+                    mode
+                };
+
+                // Word boundary after if current is not uppercase and next
+                // is uppercase
+                if next_mode == WordMode::Lowercase && next.is_uppercase() {
+                    if !first_word {
+                        boundary(f)?;
+                    }
+                    with_word(&word[init..next_i], f)?;
+                    first_word = false;
+                    init = next_i;
+                    mode = WordMode::Boundary;
+
+                // Otherwise if current and previous are uppercase and next
+                // is lowercase, word boundary before
+                } else if mode == WordMode::Uppercase && c.is_uppercase() && next.is_lowercase() {
+                    if !first_word {
+                        boundary(f)?;
+                    } else {
+                        first_word = false;
+                    }
+                    with_word(&word[init..i], f)?;
+                    init = i;
+                    mode = WordMode::Boundary;
+
+                // Otherwise no word boundary, just update the mode
+                } else {
+                    mode = next_mode;
+                }
+            } else {
+                // Collect trailing characters as a word
+                if !first_word {
+                    boundary(f)?;
+                } else {
+                    first_word = false;
+                }
+                with_word(&word[init..], f)?;
+                break;
+            }
+        }
+    }
+
+    Ok(())
+}
+
+fn lowercase(s: &str, f: &mut fmt::Formatter) -> fmt::Result {
+    let mut chars = s.chars().peekable();
+    while let Some(c) = chars.next() {
+        if c == 'Σ' && chars.peek().is_none() {
+            write!(f, "ς")?;
+        } else {
+            write!(f, "{}", c.to_lowercase())?;
+        }
+    }
+
+    Ok(())
+}
+
+fn uppercase(s: &str, f: &mut fmt::Formatter) -> fmt::Result {
+    for c in s.chars() {
+        write!(f, "{}", c.to_uppercase())?;
+    }
+
+    Ok(())
+}
+
+fn capitalize(s: &str, f: &mut fmt::Formatter) -> fmt::Result {
+    let mut char_indices = s.char_indices();
+    if let Some((_, c)) = char_indices.next() {
+        write!(f, "{}", c.to_uppercase())?;
+        if let Some((i, _)) = char_indices.next() {
+            lowercase(&s[i..], f)?;
+        }
+    }
+
+    Ok(())
+}
diff -pruN 43.0.0-1/rust-vendor/heck/src/lower_camel.rs 43.0.0-1ubuntu1/rust-vendor/heck/src/lower_camel.rs
--- 43.0.0-1/rust-vendor/heck/src/lower_camel.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/heck/src/lower_camel.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,88 @@
+use core::fmt;
+
+use alloc::{
+    borrow::ToOwned,
+    string::{String, ToString},
+};
+
+use crate::{capitalize, lowercase, transform};
+
+/// This trait defines a lower camel case conversion.
+///
+/// In lowerCamelCase, word boundaries are indicated by capital letters,
+/// excepting the first word.
+///
+/// ## Example:
+///
+/// ```rust
+/// use heck::ToLowerCamelCase;
+///
+/// let sentence = "It is we who built these palaces and cities.";
+/// assert_eq!(sentence.to_lower_camel_case(), "itIsWeWhoBuiltThesePalacesAndCities");
+/// ```
+pub trait ToLowerCamelCase: ToOwned {
+    /// Convert this type to lower camel case.
+    fn to_lower_camel_case(&self) -> Self::Owned;
+}
+
+impl ToLowerCamelCase for str {
+    fn to_lower_camel_case(&self) -> String {
+        AsLowerCamelCase(self).to_string()
+    }
+}
+
+/// This wrapper performs a lower camel case conversion in [`fmt::Display`].
+///
+/// ## Example:
+///
+/// ```
+/// use heck::AsLowerCamelCase;
+///
+/// let sentence = "It is we who built these palaces and cities.";
+/// assert_eq!(format!("{}", AsLowerCamelCase(sentence)), "itIsWeWhoBuiltThesePalacesAndCities");
+/// ```
+pub struct AsLowerCamelCase<T: AsRef<str>>(pub T);
+
+impl<T: AsRef<str>> fmt::Display for AsLowerCamelCase<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let mut first = true;
+        transform(
+            self.0.as_ref(),
+            |s, f| {
+                if first {
+                    first = false;
+                    lowercase(s, f)
+                } else {
+                    capitalize(s, f)
+                }
+            },
+            |_| Ok(()),
+            f,
+        )
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::ToLowerCamelCase;
+
+    macro_rules! t {
+        ($t:ident : $s1:expr => $s2:expr) => {
+            #[test]
+            fn $t() {
+                assert_eq!($s1.to_lower_camel_case(), $s2)
+            }
+        };
+    }
+
+    t!(test1: "CamelCase" => "camelCase");
+    t!(test2: "This is Human case." => "thisIsHumanCase");
+    t!(test3: "MixedUP CamelCase, with some Spaces" => "mixedUpCamelCaseWithSomeSpaces");
+    t!(test4: "mixed_up_ snake_case, with some _spaces" => "mixedUpSnakeCaseWithSomeSpaces");
+    t!(test5: "kebab-case" => "kebabCase");
+    t!(test6: "SHOUTY_SNAKE_CASE" => "shoutySnakeCase");
+    t!(test7: "snake_case" => "snakeCase");
+    t!(test8: "this-contains_ ALLKinds OfWord_Boundaries" => "thisContainsAllKindsOfWordBoundaries");
+    t!(test9: "XΣXΣ baﬄe" => "xσxςBaﬄe");
+    t!(test10: "XMLHttpRequest" => "xmlHttpRequest");
+}
diff -pruN 43.0.0-1/rust-vendor/heck/src/shouty_kebab.rs 43.0.0-1ubuntu1/rust-vendor/heck/src/shouty_kebab.rs
--- 43.0.0-1/rust-vendor/heck/src/shouty_kebab.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/heck/src/shouty_kebab.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,73 @@
+use core::fmt;
+
+use alloc::{borrow::ToOwned, string::ToString};
+
+use crate::{transform, uppercase};
+
+/// This trait defines a shouty kebab case conversion.
+///
+/// In SHOUTY-KEBAB-CASE, word boundaries are indicated by hyphens and all
+/// words are in uppercase.
+///
+/// ## Example:
+///
+/// ```rust
+/// use heck::ToShoutyKebabCase;
+///
+/// let sentence = "We are going to inherit the earth.";
+/// assert_eq!(sentence.to_shouty_kebab_case(), "WE-ARE-GOING-TO-INHERIT-THE-EARTH");
+/// ```
+pub trait ToShoutyKebabCase: ToOwned {
+    /// Convert this type to shouty kebab case.
+    fn to_shouty_kebab_case(&self) -> Self::Owned;
+}
+
+impl ToShoutyKebabCase for str {
+    fn to_shouty_kebab_case(&self) -> Self::Owned {
+        AsShoutyKebabCase(self).to_string()
+    }
+}
+
+/// This wrapper performs a kebab case conversion in [`fmt::Display`].
+///
+/// ## Example:
+///
+/// ```
+/// use heck::AsShoutyKebabCase;
+///
+/// let sentence = "We are going to inherit the earth.";
+/// assert_eq!(format!("{}", AsShoutyKebabCase(sentence)), "WE-ARE-GOING-TO-INHERIT-THE-EARTH");
+/// ```
+pub struct AsShoutyKebabCase<T: AsRef<str>>(pub T);
+
+impl<T: AsRef<str>> fmt::Display for AsShoutyKebabCase<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        transform(self.0.as_ref(), uppercase, |f| write!(f, "-"), f)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::ToShoutyKebabCase;
+
+    macro_rules! t {
+        ($t:ident : $s1:expr => $s2:expr) => {
+            #[test]
+            fn $t() {
+                assert_eq!($s1.to_shouty_kebab_case(), $s2)
+            }
+        };
+    }
+
+    t!(test1: "CamelCase" => "CAMEL-CASE");
+    t!(test2: "This is Human case." => "THIS-IS-HUMAN-CASE");
+    t!(test3: "MixedUP CamelCase, with some Spaces" => "MIXED-UP-CAMEL-CASE-WITH-SOME-SPACES");
+    t!(test4: "mixed_up_ snake_case with some _spaces" => "MIXED-UP-SNAKE-CASE-WITH-SOME-SPACES");
+    t!(test5: "kebab-case" => "KEBAB-CASE");
+    t!(test6: "SHOUTY_SNAKE_CASE" => "SHOUTY-SNAKE-CASE");
+    t!(test7: "snake_case" => "SNAKE-CASE");
+    t!(test8: "this-contains_ ALLKinds OfWord_Boundaries" => "THIS-CONTAINS-ALL-KINDS-OF-WORD-BOUNDARIES");
+    t!(test9: "XΣXΣ baﬄe" => "XΣXΣ-BAFFLE");
+    t!(test10: "XMLHttpRequest" => "XML-HTTP-REQUEST");
+    t!(test11: "SHOUTY-KEBAB-CASE" => "SHOUTY-KEBAB-CASE");
+}
diff -pruN 43.0.0-1/rust-vendor/heck/src/shouty_snake.rs 43.0.0-1ubuntu1/rust-vendor/heck/src/shouty_snake.rs
--- 43.0.0-1/rust-vendor/heck/src/shouty_snake.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/heck/src/shouty_snake.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,86 @@
+use core::fmt;
+
+use alloc::{borrow::ToOwned, string::ToString};
+
+use crate::{transform, uppercase};
+
+/// This trait defines a shouty snake case conversion.
+///
+/// In SHOUTY_SNAKE_CASE, word boundaries are indicated by underscores and all
+/// words are in uppercase.
+///
+/// ## Example:
+///
+/// ```rust
+/// use heck::ToShoutySnakeCase;
+///
+/// let sentence = "That world is growing in this minute.";
+/// assert_eq!(sentence.to_shouty_snake_case(), "THAT_WORLD_IS_GROWING_IN_THIS_MINUTE");
+/// ```
+pub trait ToShoutySnakeCase: ToOwned {
+    /// Convert this type to shouty snake case.
+    fn to_shouty_snake_case(&self) -> Self::Owned;
+}
+
+/// Oh heck, `ToShoutySnekCase` is an alias for [`ToShoutySnakeCase`]. See
+/// ToShoutySnakeCase for more documentation.
+pub trait ToShoutySnekCase: ToOwned {
+    /// CONVERT THIS TYPE TO SNEK CASE.
+    #[allow(non_snake_case)]
+    fn TO_SHOUTY_SNEK_CASE(&self) -> Self::Owned;
+}
+
+impl<T: ?Sized + ToShoutySnakeCase> ToShoutySnekCase for T {
+    fn TO_SHOUTY_SNEK_CASE(&self) -> Self::Owned {
+        self.to_shouty_snake_case()
+    }
+}
+
+impl ToShoutySnakeCase for str {
+    fn to_shouty_snake_case(&self) -> Self::Owned {
+        AsShoutySnakeCase(self).to_string()
+    }
+}
+
+/// This wrapper performs a shouty snake  case conversion in [`fmt::Display`].
+///
+/// ## Example:
+///
+/// ```
+/// use heck::AsShoutySnakeCase;
+///
+/// let sentence = "That world is growing in this minute.";
+/// assert_eq!(format!("{}", AsShoutySnakeCase(sentence)), "THAT_WORLD_IS_GROWING_IN_THIS_MINUTE");
+/// ```
+pub struct AsShoutySnakeCase<T: AsRef<str>>(pub T);
+
+impl<T: AsRef<str>> fmt::Display for AsShoutySnakeCase<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        transform(self.0.as_ref(), uppercase, |f| write!(f, "_"), f)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::ToShoutySnakeCase;
+
+    macro_rules! t {
+        ($t:ident : $s1:expr => $s2:expr) => {
+            #[test]
+            fn $t() {
+                assert_eq!($s1.to_shouty_snake_case(), $s2)
+            }
+        };
+    }
+
+    t!(test1: "CamelCase" => "CAMEL_CASE");
+    t!(test2: "This is Human case." => "THIS_IS_HUMAN_CASE");
+    t!(test3: "MixedUP CamelCase, with some Spaces" => "MIXED_UP_CAMEL_CASE_WITH_SOME_SPACES");
+    t!(test4: "mixed_up_snake_case with some _spaces" => "MIXED_UP_SNAKE_CASE_WITH_SOME_SPACES");
+    t!(test5: "kebab-case" => "KEBAB_CASE");
+    t!(test6: "SHOUTY_SNAKE_CASE" => "SHOUTY_SNAKE_CASE");
+    t!(test7: "snake_case" => "SNAKE_CASE");
+    t!(test8: "this-contains_ ALLKinds OfWord_Boundaries" => "THIS_CONTAINS_ALL_KINDS_OF_WORD_BOUNDARIES");
+    t!(test9: "XΣXΣ baﬄe" => "XΣXΣ_BAFFLE");
+    t!(test10: "XMLHttpRequest" => "XML_HTTP_REQUEST");
+}
diff -pruN 43.0.0-1/rust-vendor/heck/src/snake.rs 43.0.0-1ubuntu1/rust-vendor/heck/src/snake.rs
--- 43.0.0-1/rust-vendor/heck/src/snake.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/heck/src/snake.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,100 @@
+use alloc::{
+    borrow::ToOwned,
+    fmt,
+    string::{String, ToString},
+};
+
+use crate::{lowercase, transform};
+
+/// This trait defines a snake case conversion.
+///
+/// In snake_case, word boundaries are indicated by underscores.
+///
+/// ## Example:
+///
+/// ```rust
+/// use heck::ToSnakeCase;
+///
+/// let sentence = "We carry a new world here, in our hearts.";
+/// assert_eq!(sentence.to_snake_case(), "we_carry_a_new_world_here_in_our_hearts");
+/// ```
+pub trait ToSnakeCase: ToOwned {
+    /// Convert this type to snake case.
+    fn to_snake_case(&self) -> Self::Owned;
+}
+
+/// Oh heck, `SnekCase` is an alias for [`ToSnakeCase`]. See ToSnakeCase for
+/// more documentation.
+pub trait ToSnekCase: ToOwned {
+    /// Convert this type to snek case.
+    fn to_snek_case(&self) -> Self::Owned;
+}
+
+impl<T: ?Sized + ToSnakeCase> ToSnekCase for T {
+    fn to_snek_case(&self) -> Self::Owned {
+        self.to_snake_case()
+    }
+}
+
+impl ToSnakeCase for str {
+    fn to_snake_case(&self) -> String {
+        AsSnakeCase(self).to_string()
+    }
+}
+
+/// This wrapper performs a snake case conversion in [`fmt::Display`].
+///
+/// ## Example:
+///
+/// ```
+/// use heck::AsSnakeCase;
+///
+/// let sentence = "We carry a new world here, in our hearts.";
+/// assert_eq!(format!("{}", AsSnakeCase(sentence)), "we_carry_a_new_world_here_in_our_hearts");
+/// ```
+pub struct AsSnakeCase<T: AsRef<str>>(pub T);
+
+impl<T: AsRef<str>> fmt::Display for AsSnakeCase<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        transform(self.0.as_ref(), lowercase, |f| write!(f, "_"), f)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::ToSnakeCase;
+
+    macro_rules! t {
+        ($t:ident : $s1:expr => $s2:expr) => {
+            #[test]
+            fn $t() {
+                assert_eq!($s1.to_snake_case(), $s2)
+            }
+        };
+    }
+
+    t!(test1: "CamelCase" => "camel_case");
+    t!(test2: "This is Human case." => "this_is_human_case");
+    t!(test3: "MixedUP CamelCase, with some Spaces" => "mixed_up_camel_case_with_some_spaces");
+    t!(test4: "mixed_up_ snake_case with some _spaces" => "mixed_up_snake_case_with_some_spaces");
+    t!(test5: "kebab-case" => "kebab_case");
+    t!(test6: "SHOUTY_SNAKE_CASE" => "shouty_snake_case");
+    t!(test7: "snake_case" => "snake_case");
+    t!(test8: "this-contains_ ALLKinds OfWord_Boundaries" => "this_contains_all_kinds_of_word_boundaries");
+    t!(test9: "XΣXΣ baﬄe" => "xσxς_baﬄe");
+    t!(test10: "XMLHttpRequest" => "xml_http_request");
+    t!(test11: "FIELD_NAME11" => "field_name11");
+    t!(test12: "99BOTTLES" => "99bottles");
+    t!(test13: "FieldNamE11" => "field_nam_e11");
+    t!(test14: "abc123def456" => "abc123def456");
+    t!(test16: "abc123DEF456" => "abc123_def456");
+    t!(test17: "abc123Def456" => "abc123_def456");
+    t!(test18: "abc123DEf456" => "abc123_d_ef456");
+    t!(test19: "ABC123def456" => "abc123def456");
+    t!(test20: "ABC123DEF456" => "abc123def456");
+    t!(test21: "ABC123Def456" => "abc123_def456");
+    t!(test22: "ABC123DEf456" => "abc123d_ef456");
+    t!(test23: "ABC123dEEf456FOO" => "abc123d_e_ef456_foo");
+    t!(test24: "abcDEF" => "abc_def");
+    t!(test25: "ABcDE" => "a_bc_de");
+}
diff -pruN 43.0.0-1/rust-vendor/heck/src/title.rs 43.0.0-1ubuntu1/rust-vendor/heck/src/title.rs
--- 43.0.0-1/rust-vendor/heck/src/title.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/heck/src/title.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,75 @@
+use core::fmt;
+
+use alloc::{
+    borrow::ToOwned,
+    string::{String, ToString},
+};
+
+use crate::{capitalize, transform};
+
+/// This trait defines a title case conversion.
+///
+/// In Title Case, word boundaries are indicated by spaces, and every word is
+/// capitalized.
+///
+/// ## Example:
+///
+/// ```rust
+/// use heck::ToTitleCase;
+///
+/// let sentence = "We have always lived in slums and holes in the wall.";
+/// assert_eq!(sentence.to_title_case(), "We Have Always Lived In Slums And Holes In The Wall");
+/// ```
+pub trait ToTitleCase: ToOwned {
+    /// Convert this type to title case.
+    fn to_title_case(&self) -> Self::Owned;
+}
+
+impl ToTitleCase for str {
+    fn to_title_case(&self) -> String {
+        AsTitleCase(self).to_string()
+    }
+}
+
+/// This wrapper performs a title case conversion in [`fmt::Display`].
+///
+/// ## Example:
+///
+/// ```
+/// use heck::AsTitleCase;
+///
+/// let sentence = "We have always lived in slums and holes in the wall.";
+/// assert_eq!(format!("{}", AsTitleCase(sentence)), "We Have Always Lived In Slums And Holes In The Wall");
+/// ```
+pub struct AsTitleCase<T: AsRef<str>>(pub T);
+
+impl<T: AsRef<str>> fmt::Display for AsTitleCase<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        transform(self.0.as_ref(), capitalize, |f| write!(f, " "), f)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::ToTitleCase;
+
+    macro_rules! t {
+        ($t:ident : $s1:expr => $s2:expr) => {
+            #[test]
+            fn $t() {
+                assert_eq!($s1.to_title_case(), $s2)
+            }
+        };
+    }
+
+    t!(test1: "CamelCase" => "Camel Case");
+    t!(test2: "This is Human case." => "This Is Human Case");
+    t!(test3: "MixedUP CamelCase, with some Spaces" => "Mixed Up Camel Case With Some Spaces");
+    t!(test4: "mixed_up_ snake_case, with some _spaces" => "Mixed Up Snake Case With Some Spaces");
+    t!(test5: "kebab-case" => "Kebab Case");
+    t!(test6: "SHOUTY_SNAKE_CASE" => "Shouty Snake Case");
+    t!(test7: "snake_case" => "Snake Case");
+    t!(test8: "this-contains_ ALLKinds OfWord_Boundaries" => "This Contains All Kinds Of Word Boundaries");
+    t!(test9: "XΣXΣ baﬄe" => "Xσxς Baﬄe");
+    t!(test10: "XMLHttpRequest" => "Xml Http Request");
+}
diff -pruN 43.0.0-1/rust-vendor/heck/src/train.rs 43.0.0-1ubuntu1/rust-vendor/heck/src/train.rs
--- 43.0.0-1/rust-vendor/heck/src/train.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/heck/src/train.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,87 @@
+use core::fmt;
+
+use alloc::{borrow::ToOwned, string::ToString};
+
+use crate::{capitalize, transform};
+
+/// This trait defines a train case conversion.
+///
+/// In Train-Case, word boundaries are indicated by hyphens and words start
+/// with Capital Letters.
+///
+/// ## Example:
+///
+/// ```rust
+/// use heck::ToTrainCase;
+///
+/// let sentence = "We are going to inherit the earth.";
+/// assert_eq!(sentence.to_train_case(), "We-Are-Going-To-Inherit-The-Earth");
+/// ```
+pub trait ToTrainCase: ToOwned {
+    /// Convert this type to Train-Case.
+    fn to_train_case(&self) -> Self::Owned;
+}
+
+impl ToTrainCase for str {
+    fn to_train_case(&self) -> Self::Owned {
+        AsTrainCase(self).to_string()
+    }
+}
+
+/// This wrapper performs a train case conversion in [`fmt::Display`].
+///
+/// ## Example:
+///
+/// ```
+/// use heck::AsTrainCase;
+///
+/// let sentence = "We are going to inherit the earth.";
+/// assert_eq!(format!("{}", AsTrainCase(sentence)), "We-Are-Going-To-Inherit-The-Earth");
+/// ```
+pub struct AsTrainCase<T: AsRef<str>>(pub T);
+
+impl<T: AsRef<str>> fmt::Display for AsTrainCase<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        transform(self.0.as_ref(), capitalize, |f| write!(f, "-"), f)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::ToTrainCase;
+
+    macro_rules! t {
+        ($t:ident : $s1:expr => $s2:expr) => {
+            #[test]
+            fn $t() {
+                assert_eq!($s1.to_train_case(), $s2)
+            }
+        };
+    }
+
+    t!(test1: "CamelCase" => "Camel-Case");
+    t!(test2: "This is Human case." => "This-Is-Human-Case");
+    t!(test3: "MixedUP CamelCase, with some Spaces" => "Mixed-Up-Camel-Case-With-Some-Spaces");
+    t!(test4: "mixed_up_ snake_case with some _spaces" => "Mixed-Up-Snake-Case-With-Some-Spaces");
+    t!(test5: "kebab-case" => "Kebab-Case");
+    t!(test6: "SHOUTY_SNAKE_CASE" => "Shouty-Snake-Case");
+    t!(test7: "snake_case" => "Snake-Case");
+    t!(test8: "this-contains_ ALLKinds OfWord_Boundaries" => "This-Contains-All-Kinds-Of-Word-Boundaries");
+    #[cfg(feature = "unicode")]
+    t!(test9: "XΣXΣ baﬄe" => "Xσxς-Baﬄe");
+    t!(test10: "XMLHttpRequest" => "Xml-Http-Request");
+    t!(test11: "FIELD_NAME11" => "Field-Name11");
+    t!(test12: "99BOTTLES" => "99bottles");
+    t!(test13: "FieldNamE11" => "Field-Nam-E11");
+    t!(test14: "abc123def456" => "Abc123def456");
+    t!(test16: "abc123DEF456" => "Abc123-Def456");
+    t!(test17: "abc123Def456" => "Abc123-Def456");
+    t!(test18: "abc123DEf456" => "Abc123-D-Ef456");
+    t!(test19: "ABC123def456" => "Abc123def456");
+    t!(test20: "ABC123DEF456" => "Abc123def456");
+    t!(test21: "ABC123Def456" => "Abc123-Def456");
+    t!(test22: "ABC123DEf456" => "Abc123d-Ef456");
+    t!(test23: "ABC123dEEf456FOO" => "Abc123d-E-Ef456-Foo");
+    t!(test24: "abcDEF" => "Abc-Def");
+    t!(test25: "ABcDE" => "A-Bc-De");
+}
diff -pruN 43.0.0-1/rust-vendor/heck/src/upper_camel.rs 43.0.0-1ubuntu1/rust-vendor/heck/src/upper_camel.rs
--- 43.0.0-1/rust-vendor/heck/src/upper_camel.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/heck/src/upper_camel.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,88 @@
+use core::fmt;
+
+use alloc::{
+    borrow::ToOwned,
+    string::{String, ToString},
+};
+
+use crate::{capitalize, transform};
+
+/// This trait defines an upper camel case conversion.
+///
+/// In UpperCamelCase, word boundaries are indicated by capital letters,
+/// including the first word.
+///
+/// ## Example:
+///
+/// ```rust
+/// use heck::ToUpperCamelCase;
+///
+/// let sentence = "We are not in the least afraid of ruins.";
+/// assert_eq!(sentence.to_upper_camel_case(), "WeAreNotInTheLeastAfraidOfRuins");
+/// ```
+pub trait ToUpperCamelCase: ToOwned {
+    /// Convert this type to upper camel case.
+    fn to_upper_camel_case(&self) -> Self::Owned;
+}
+
+impl ToUpperCamelCase for str {
+    fn to_upper_camel_case(&self) -> String {
+        AsUpperCamelCase(self).to_string()
+    }
+}
+
+/// `ToPascalCase` is an alias for [`ToUpperCamelCase`]. See ToUpperCamelCase for more
+/// documentation.
+pub trait ToPascalCase: ToOwned {
+    /// Convert this type to upper camel case.
+    fn to_pascal_case(&self) -> Self::Owned;
+}
+
+impl<T: ?Sized + ToUpperCamelCase> ToPascalCase for T {
+    fn to_pascal_case(&self) -> Self::Owned {
+        self.to_upper_camel_case()
+    }
+}
+
+/// This wrapper performs a upper camel case conversion in [`fmt::Display`].
+///
+/// ## Example:
+///
+/// ```
+/// use heck::AsUpperCamelCase;
+///
+/// let sentence = "We are not in the least afraid of ruins.";
+/// assert_eq!(format!("{}", AsUpperCamelCase(sentence)), "WeAreNotInTheLeastAfraidOfRuins");
+/// ```
+pub struct AsUpperCamelCase<T: AsRef<str>>(pub T);
+
+impl<T: AsRef<str>> fmt::Display for AsUpperCamelCase<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        transform(self.0.as_ref(), capitalize, |_| Ok(()), f)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::ToUpperCamelCase;
+
+    macro_rules! t {
+        ($t:ident : $s1:expr => $s2:expr) => {
+            #[test]
+            fn $t() {
+                assert_eq!($s1.to_upper_camel_case(), $s2)
+            }
+        };
+    }
+
+    t!(test1: "CamelCase" => "CamelCase");
+    t!(test2: "This is Human case." => "ThisIsHumanCase");
+    t!(test3: "MixedUP_CamelCase, with some Spaces" => "MixedUpCamelCaseWithSomeSpaces");
+    t!(test4: "mixed_up_ snake_case, with some _spaces" => "MixedUpSnakeCaseWithSomeSpaces");
+    t!(test5: "kebab-case" => "KebabCase");
+    t!(test6: "SHOUTY_SNAKE_CASE" => "ShoutySnakeCase");
+    t!(test7: "snake_case" => "SnakeCase");
+    t!(test8: "this-contains_ ALLKinds OfWord_Boundaries" => "ThisContainsAllKindsOfWordBoundaries");
+    t!(test9: "XΣXΣ baﬄe" => "XσxςBaﬄe");
+    t!(test10: "XMLHttpRequest" => "XmlHttpRequest");
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/indoc/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/indoc/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"Cargo.toml":"abb758eba00c9acd0c028496de6c9b16d89047f46ef60c102dc1f6de5aa429e0","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"aa314ca47369e660f3ab12d1756e0c341e0de3903c8721d56815c1ebe6e9e4ab","src/error.rs":"82954a85793ea0648ccf640da5565be9599a761532d28b1da5471d0d378fee9c","src/expr.rs":"ea811c5c8f7aa699f8b96f5655e2921225aad9373a2355906702ca978935cb84","src/lib.rs":"a8180487806c28053ddcb4a6feeed81e41e72c33d68aec411af26c1e5e679754","src/unindent.rs":"988a92e473e8f033882e7236bab6d38ece304116f6ac9f6aaf6f25b4bb9f6d27","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/test_concat.rs":"8065592ad2fc58c51855af3f6213fed426e508963de24e6b48319906fc901ee1","tests/test_formatdoc.rs":"8b341b13758b6d55cdaedad16049369d9bd907fb1fbccb3a236e6024401b47fd","tests/test_indoc.rs":"bf0ff4dd0de04604d308c88ea31321e5cd666431a8b09628f0bcd820b9600832","tests/test_unindent.rs":"57ce28df0e6055b661097cb4dca3efa949e15535aa28d1bc8da6932d4cc1ed15","tests/test_writedoc.rs":"e313e4f49faec67b4b2cb3a69b468bd95e7d941f3686ee2193a8d6626cf48c49","tests/ui/capture-var-nested.rs":"01597020d34975817a627c213e1e35e58bd1809f3174a26d9c2795efba677297","tests/ui/capture-var-nested.stderr":"99d385c115680bb6d923e9dc30c9e2fcaa346fa0679931e1df20b998a5fb6682","tests/ui/no-arguments.rs":"d544b1a510efbef42a1fb7b7b40009da2d9be815a55ef76dd2362c8c7754734e","tests/ui/no-arguments.stderr":"50adb9ca3a1b1661ef7dbd9e9a74804353d18c294d2a28498f50ef91676f13d6","tests/ui/non-lit.rs":"3e7d7b4b5e141b5eb4c76d64b47f7a5f60325091a8e4d8cc2d97b7d590dd2857","tests/ui/non-lit.stderr":"f7ea54b55db14f756254e013150a3a45d3045cef4419e8a512cfd70ec29b858e","tests/ui/non-string.rs":"0b56f281761edaee1c7341c9ba231371c86752456179d84777c62f03f52ce173","tests/ui/non-string.stderr":"6a65eb94f57ef6733da6a1d855194708e124dd8dac424d3eebde6e79b966f9ad","tests/ui/printdoc-binary.rs":"0122fd6b783cb9c25c8aede8f0cc69c1c3ffcef656bf7d9ee476e8e0ff49e59f","tests/ui/printdoc-binary.stderr":"4b745df236fbca6ac1f314e6b1c26c069fc4d108edad84a8a69b7dcc2e6ca4ea","tests/ui/printdoc-extra-arg.rs":"fa31182019534b5b258f8335799c8ba53a7715c1d9e6fc9d25fbc0952d28bd7a","tests/ui/printdoc-extra-arg.stderr":"aebd5360f0a1b4e4faba9defc91d186a992248c00808e198ad31ae2110ab86ed","tests/ui/printdoc-no-arg.rs":"087d8e5295f7809abf596a076743401f6ba019fd5b3b2e290bfd6551b4bdcdf3","tests/ui/printdoc-no-arg.stderr":"a5e5d79415ef3fc357403c38b486acbb6ba3e5e565c358265694902afd476b9d","tests/ui/printdoc-no-display.rs":"afeafb1f41a6f7aa68bd5da14c2057e54f2756c1726098ac8be9ab0517a85879","tests/ui/printdoc-no-display.stderr":"0cd64b7e07571dd6c77dde0c2202a2a1b611222db0f1a7607b6d7c3988d5daf0","tests/ui/printdoc-no-named-arg.rs":"beeb8447ab95a0e0a21aec78872be79ad1b2a8fe1be4a276fe191f47f3b8082b","tests/ui/printdoc-no-named-arg.stderr":"c5e2f35a4c960e0ae86c2c3481645da90bf86b8f8ae8b6f8c8954d8c9917a44d","tests/ui/three-arguments.rs":"47b74a9918de87bad00cdd94dc7091a499a586edcfbc05035ef79ce0d52dbe27","tests/ui/three-arguments.stderr":"f3649c03bf13c18b863f0ee0986154c4530601138c574e30cf05f7916eb85c39","tests/ui/two-arguments.rs":"1607e7c149cc0ed5e3fb5984ac1d39d8dff0bd8325911518b02d05daa95b06b0","tests/ui/two-arguments.stderr":"a446346d0cb74e791174b22eed874130387d21038cfdb809b80eb068b4f24b92"},"package":"b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/indoc/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/indoc/Cargo.toml
--- 43.0.0-1/rust-vendor/indoc/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,53 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2021"
+rust-version = "1.56"
+name = "indoc"
+version = "2.0.5"
+authors = ["David Tolnay <dtolnay@gmail.com>"]
+description = "Indented document literals"
+documentation = "https://docs.rs/indoc"
+readme = "README.md"
+keywords = [
+    "heredoc",
+    "nowdoc",
+    "multiline",
+    "string",
+    "literal",
+]
+categories = [
+    "rust-patterns",
+    "text-processing",
+    "no-std",
+    "no-std::no-alloc",
+]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/dtolnay/indoc"
+
+[package.metadata.docs.rs]
+rustdoc-args = ["--generate-link-to-definition"]
+targets = ["x86_64-unknown-linux-gnu"]
+
+[lib]
+doc-scrape-examples = false
+proc-macro = true
+
+[dev-dependencies.rustversion]
+version = "1.0"
+
+[dev-dependencies.trybuild]
+version = "1.0.49"
+features = ["diff"]
+
+[dev-dependencies.unindent]
+version = "0.2.3"
diff -pruN 43.0.0-1/rust-vendor/indoc/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/indoc/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/indoc/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,176 @@
+                              Apache License
+                        Version 2.0, January 2004
+                     http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+   "License" shall mean the terms and conditions for use, reproduction,
+   and distribution as defined by Sections 1 through 9 of this document.
+
+   "Licensor" shall mean the copyright owner or entity authorized by
+   the copyright owner that is granting the License.
+
+   "Legal Entity" shall mean the union of the acting entity and all
+   other entities that control, are controlled by, or are under common
+   control with that entity. For the purposes of this definition,
+   "control" means (i) the power, direct or indirect, to cause the
+   direction or management of such entity, whether by contract or
+   otherwise, or (ii) ownership of fifty percent (50%) or more of the
+   outstanding shares, or (iii) beneficial ownership of such entity.
+
+   "You" (or "Your") shall mean an individual or Legal Entity
+   exercising permissions granted by this License.
+
+   "Source" form shall mean the preferred form for making modifications,
+   including but not limited to software source code, documentation
+   source, and configuration files.
+
+   "Object" form shall mean any form resulting from mechanical
+   transformation or translation of a Source form, including but
+   not limited to compiled object code, generated documentation,
+   and conversions to other media types.
+
+   "Work" shall mean the work of authorship, whether in Source or
+   Object form, made available under the License, as indicated by a
+   copyright notice that is included in or attached to the work
+   (an example is provided in the Appendix below).
+
+   "Derivative Works" shall mean any work, whether in Source or Object
+   form, that is based on (or derived from) the Work and for which the
+   editorial revisions, annotations, elaborations, or other modifications
+   represent, as a whole, an original work of authorship. For the purposes
+   of this License, Derivative Works shall not include works that remain
+   separable from, or merely link (or bind by name) to the interfaces of,
+   the Work and Derivative Works thereof.
+
+   "Contribution" shall mean any work of authorship, including
+   the original version of the Work and any modifications or additions
+   to that Work or Derivative Works thereof, that is intentionally
+   submitted to Licensor for inclusion in the Work by the copyright owner
+   or by an individual or Legal Entity authorized to submit on behalf of
+   the copyright owner. For the purposes of this definition, "submitted"
+   means any form of electronic, verbal, or written communication sent
+   to the Licensor or its representatives, including but not limited to
+   communication on electronic mailing lists, source code control systems,
+   and issue tracking systems that are managed by, or on behalf of, the
+   Licensor for the purpose of discussing and improving the Work, but
+   excluding communication that is conspicuously marked or otherwise
+   designated in writing by the copyright owner as "Not a Contribution."
+
+   "Contributor" shall mean Licensor and any individual or Legal Entity
+   on behalf of whom a Contribution has been received by Licensor and
+   subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   copyright license to reproduce, prepare Derivative Works of,
+   publicly display, publicly perform, sublicense, and distribute the
+   Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   (except as stated in this section) patent license to make, have made,
+   use, offer to sell, sell, import, and otherwise transfer the Work,
+   where such license applies only to those patent claims licensable
+   by such Contributor that are necessarily infringed by their
+   Contribution(s) alone or by combination of their Contribution(s)
+   with the Work to which such Contribution(s) was submitted. If You
+   institute patent litigation against any entity (including a
+   cross-claim or counterclaim in a lawsuit) alleging that the Work
+   or a Contribution incorporated within the Work constitutes direct
+   or contributory patent infringement, then any patent licenses
+   granted to You under this License for that Work shall terminate
+   as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+   Work or Derivative Works thereof in any medium, with or without
+   modifications, and in Source or Object form, provided that You
+   meet the following conditions:
+
+   (a) You must give any other recipients of the Work or
+       Derivative Works a copy of this License; and
+
+   (b) You must cause any modified files to carry prominent notices
+       stating that You changed the files; and
+
+   (c) You must retain, in the Source form of any Derivative Works
+       that You distribute, all copyright, patent, trademark, and
+       attribution notices from the Source form of the Work,
+       excluding those notices that do not pertain to any part of
+       the Derivative Works; and
+
+   (d) If the Work includes a "NOTICE" text file as part of its
+       distribution, then any Derivative Works that You distribute must
+       include a readable copy of the attribution notices contained
+       within such NOTICE file, excluding those notices that do not
+       pertain to any part of the Derivative Works, in at least one
+       of the following places: within a NOTICE text file distributed
+       as part of the Derivative Works; within the Source form or
+       documentation, if provided along with the Derivative Works; or,
+       within a display generated by the Derivative Works, if and
+       wherever such third-party notices normally appear. The contents
+       of the NOTICE file are for informational purposes only and
+       do not modify the License. You may add Your own attribution
+       notices within Derivative Works that You distribute, alongside
+       or as an addendum to the NOTICE text from the Work, provided
+       that such additional attribution notices cannot be construed
+       as modifying the License.
+
+   You may add Your own copyright statement to Your modifications and
+   may provide additional or different license terms and conditions
+   for use, reproduction, or distribution of Your modifications, or
+   for any such Derivative Works as a whole, provided Your use,
+   reproduction, and distribution of the Work otherwise complies with
+   the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+   any Contribution intentionally submitted for inclusion in the Work
+   by You to the Licensor shall be under the terms and conditions of
+   this License, without any additional terms or conditions.
+   Notwithstanding the above, nothing herein shall supersede or modify
+   the terms of any separate license agreement you may have executed
+   with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+   names, trademarks, service marks, or product names of the Licensor,
+   except as required for reasonable and customary use in describing the
+   origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+   agreed to in writing, Licensor provides the Work (and each
+   Contributor provides its Contributions) on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+   implied, including, without limitation, any warranties or conditions
+   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+   PARTICULAR PURPOSE. You are solely responsible for determining the
+   appropriateness of using or redistributing the Work and assume any
+   risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+   whether in tort (including negligence), contract, or otherwise,
+   unless required by applicable law (such as deliberate and grossly
+   negligent acts) or agreed to in writing, shall any Contributor be
+   liable to You for damages, including any direct, indirect, special,
+   incidental, or consequential damages of any character arising as a
+   result of this License or out of the use or inability to use the
+   Work (including but not limited to damages for loss of goodwill,
+   work stoppage, computer failure or malfunction, or any and all
+   other commercial damages or losses), even if such Contributor
+   has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+   the Work or Derivative Works thereof, You may choose to offer,
+   and charge a fee for, acceptance of support, warranty, indemnity,
+   or other liability obligations and/or rights consistent with this
+   License. However, in accepting such obligations, You may act only
+   on Your own behalf and on Your sole responsibility, not on behalf
+   of any other Contributor, and only if You agree to indemnify,
+   defend, and hold each Contributor harmless for any liability
+   incurred by, or claims asserted against, such Contributor by reason
+   of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
diff -pruN 43.0.0-1/rust-vendor/indoc/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/indoc/LICENSE-MIT
--- 43.0.0-1/rust-vendor/indoc/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,23 @@
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/indoc/README.md 43.0.0-1ubuntu1/rust-vendor/indoc/README.md
--- 43.0.0-1/rust-vendor/indoc/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,158 @@
+Indented Documents (indoc)
+==========================
+
+[<img alt="github" src="https://img.shields.io/badge/github-dtolnay/indoc-8da0cb?style=for-the-badge&labelColor=555555&logo=github" height="20">](https://github.com/dtolnay/indoc)
+[<img alt="crates.io" src="https://img.shields.io/crates/v/indoc.svg?style=for-the-badge&color=fc8d62&logo=rust" height="20">](https://crates.io/crates/indoc)
+[<img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-indoc-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs" height="20">](https://docs.rs/indoc)
+[<img alt="build status" src="https://img.shields.io/github/actions/workflow/status/dtolnay/indoc/ci.yml?branch=master&style=for-the-badge" height="20">](https://github.com/dtolnay/indoc/actions?query=branch%3Amaster)
+
+This crate provides a procedural macro for indented string literals. The
+`indoc!()` macro takes a multiline string literal and un-indents it at compile
+time so the leftmost non-space character is in the first column.
+
+```toml
+[dependencies]
+indoc = "2"
+```
+
+*Compiler requirement: rustc 1.56 or greater.*
+
+<br>
+
+## Using indoc
+
+```rust
+use indoc::indoc;
+
+fn main() {
+    let testing = indoc! {"
+        def hello():
+            print('Hello, world!')
+
+        hello()
+    "};
+    let expected = "def hello():\n    print('Hello, world!')\n\nhello()\n";
+    assert_eq!(testing, expected);
+}
+```
+
+Indoc also works with raw string literals:
+
+```rust
+use indoc::indoc;
+
+fn main() {
+    let testing = indoc! {r#"
+        def hello():
+            print("Hello, world!")
+
+        hello()
+    "#};
+    let expected = "def hello():\n    print(\"Hello, world!\")\n\nhello()\n";
+    assert_eq!(testing, expected);
+}
+```
+
+And byte string literals:
+
+```rust
+use indoc::indoc;
+
+fn main() {
+    let testing = indoc! {b"
+        def hello():
+            print('Hello, world!')
+
+        hello()
+    "};
+    let expected = b"def hello():\n    print('Hello, world!')\n\nhello()\n";
+    assert_eq!(testing[..], expected[..]);
+}
+```
+
+<br>
+
+## Formatting macros
+
+The indoc crate exports five additional macros to substitute conveniently for
+the standard library's formatting macros:
+
+- `formatdoc!($fmt, ...)`&ensp;&mdash;&ensp;equivalent to `format!(indoc!($fmt), ...)`
+- `printdoc!($fmt, ...)`&ensp;&mdash;&ensp;equivalent to `print!(indoc!($fmt), ...)`
+- `eprintdoc!($fmt, ...)`&ensp;&mdash;&ensp;equivalent to `eprint!(indoc!($fmt), ...)`
+- `writedoc!($dest, $fmt, ...)`&ensp;&mdash;&ensp;equivalent to `write!($dest, indoc!($fmt), ...)`
+- `concatdoc!(...)`&ensp;&mdash;&ensp;equivalent to `concat!(...)` with each string literal wrapped in `indoc!`
+
+```rust
+use indoc::{concatdoc, printdoc};
+
+const HELP: &str = concatdoc! {"
+    Usage: ", env!("CARGO_BIN_NAME"), " [options]
+
+    Options:
+        -h, --help
+"};
+
+fn main() {
+    printdoc! {"
+        GET {url}
+        Accept: {mime}
+        ",
+        url = "http://localhost:8080",
+        mime = "application/json",
+    }
+}
+```
+
+<br>
+
+## Explanation
+
+The following rules characterize the behavior of the `indoc!()` macro:
+
+1. Count the leading spaces of each line, ignoring the first line and any lines
+   that are empty or contain spaces only.
+2. Take the minimum.
+3. If the first line is empty i.e. the string begins with a newline, remove the
+   first line.
+4. Remove the computed number of spaces from the beginning of each line.
+
+<br>
+
+## Unindent
+
+Indoc's indentation logic is available in the `unindent` crate. This may be
+useful for processing strings that are not statically known at compile time.
+
+The crate exposes two functions:
+
+- `unindent(&str) -> String`
+- `unindent_bytes(&[u8]) -> Vec<u8>`
+
+```rust
+use unindent::unindent;
+
+fn main() {
+    let indented = "
+            line one
+            line two";
+    assert_eq!("line one\nline two", unindent(indented));
+}
+```
+
+<br>
+
+#### License
+
+<sup>
+Licensed under either of <a href="LICENSE-APACHE">Apache License, Version
+2.0</a> or <a href="LICENSE-MIT">MIT license</a> at your option.
+</sup>
+
+<br>
+
+<sub>
+Unless you explicitly state otherwise, any contribution intentionally submitted
+for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
+be dual licensed as above, without any additional terms or conditions.
+</sub>
diff -pruN 43.0.0-1/rust-vendor/indoc/src/error.rs 43.0.0-1ubuntu1/rust-vendor/indoc/src/error.rs
--- 43.0.0-1/rust-vendor/indoc/src/error.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/src/error.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,46 @@
+use proc_macro::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree};
+
+pub type Result<T> = std::result::Result<T, Error>;
+
+pub struct Error {
+    begin: Span,
+    end: Span,
+    msg: String,
+}
+
+impl Error {
+    pub fn new(span: Span, msg: &str) -> Self {
+        Self::new2(span, span, msg)
+    }
+
+    pub fn new2(begin: Span, end: Span, msg: &str) -> Self {
+        Error {
+            begin,
+            end,
+            msg: msg.to_owned(),
+        }
+    }
+
+    pub fn to_compile_error(&self) -> TokenStream {
+        // compile_error! { $msg }
+        TokenStream::from_iter(vec![
+            TokenTree::Ident(Ident::new("compile_error", self.begin)),
+            TokenTree::Punct({
+                let mut punct = Punct::new('!', Spacing::Alone);
+                punct.set_span(self.begin);
+                punct
+            }),
+            TokenTree::Group({
+                let mut group = Group::new(Delimiter::Brace, {
+                    TokenStream::from_iter(vec![TokenTree::Literal({
+                        let mut string = Literal::string(&self.msg);
+                        string.set_span(self.end);
+                        string
+                    })])
+                });
+                group.set_span(self.end);
+                group
+            }),
+        ])
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/src/expr.rs 43.0.0-1ubuntu1/rust-vendor/indoc/src/expr.rs
--- 43.0.0-1/rust-vendor/indoc/src/expr.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/src/expr.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,61 @@
+use crate::error::{Error, Result};
+use proc_macro::token_stream::IntoIter as TokenIter;
+use proc_macro::{Spacing, Span, TokenStream, TokenTree};
+use std::iter::{self, Peekable};
+
+pub fn parse(input: &mut Peekable<TokenIter>, require_comma: bool) -> Result<TokenStream> {
+    #[derive(PartialEq)]
+    enum Lookbehind {
+        JointColon,
+        DoubleColon,
+        JointHyphen,
+        Other,
+    }
+
+    let mut expr = TokenStream::new();
+    let mut lookbehind = Lookbehind::Other;
+    let mut angle_bracket_depth = 0;
+
+    loop {
+        if angle_bracket_depth == 0 {
+            match input.peek() {
+                Some(TokenTree::Punct(punct)) if punct.as_char() == ',' => {
+                    return Ok(expr);
+                }
+                _ => {}
+            }
+        }
+        match input.next() {
+            Some(TokenTree::Punct(punct)) => {
+                let ch = punct.as_char();
+                let spacing = punct.spacing();
+                expr.extend(iter::once(TokenTree::Punct(punct)));
+                lookbehind = match ch {
+                    ':' if lookbehind == Lookbehind::JointColon => Lookbehind::DoubleColon,
+                    ':' if spacing == Spacing::Joint => Lookbehind::JointColon,
+                    '<' if lookbehind == Lookbehind::DoubleColon => {
+                        angle_bracket_depth += 1;
+                        Lookbehind::Other
+                    }
+                    '>' if angle_bracket_depth > 0 && lookbehind != Lookbehind::JointHyphen => {
+                        angle_bracket_depth -= 1;
+                        Lookbehind::Other
+                    }
+                    '-' if spacing == Spacing::Joint => Lookbehind::JointHyphen,
+                    _ => Lookbehind::Other,
+                };
+            }
+            Some(token) => expr.extend(iter::once(token)),
+            None => {
+                return if require_comma {
+                    Err(Error::new(
+                        Span::call_site(),
+                        "unexpected end of macro input",
+                    ))
+                } else {
+                    Ok(expr)
+                };
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/indoc/src/lib.rs
--- 43.0.0-1/rust-vendor/indoc/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,501 @@
+//! [![github]](https://github.com/dtolnay/indoc)&ensp;[![crates-io]](https://crates.io/crates/indoc)&ensp;[![docs-rs]](https://docs.rs/indoc)
+//!
+//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
+//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust
+//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs
+//!
+//! <br>
+//!
+//! This crate provides a procedural macro for indented string literals. The
+//! `indoc!()` macro takes a multiline string literal and un-indents it at
+//! compile time so the leftmost non-space character is in the first column.
+//!
+//! ```toml
+//! [dependencies]
+//! indoc = "2"
+//! ```
+//!
+//! <br>
+//!
+//! # Using indoc
+//!
+//! ```
+//! use indoc::indoc;
+//!
+//! fn main() {
+//!     let testing = indoc! {"
+//!         def hello():
+//!             print('Hello, world!')
+//!
+//!         hello()
+//!     "};
+//!     let expected = "def hello():\n    print('Hello, world!')\n\nhello()\n";
+//!     assert_eq!(testing, expected);
+//! }
+//! ```
+//!
+//! Indoc also works with raw string literals:
+//!
+//! ```
+//! use indoc::indoc;
+//!
+//! fn main() {
+//!     let testing = indoc! {r#"
+//!         def hello():
+//!             print("Hello, world!")
+//!
+//!         hello()
+//!     "#};
+//!     let expected = "def hello():\n    print(\"Hello, world!\")\n\nhello()\n";
+//!     assert_eq!(testing, expected);
+//! }
+//! ```
+//!
+//! And byte string literals:
+//!
+//! ```
+//! use indoc::indoc;
+//!
+//! fn main() {
+//!     let testing = indoc! {b"
+//!         def hello():
+//!             print('Hello, world!')
+//!
+//!         hello()
+//!     "};
+//!     let expected = b"def hello():\n    print('Hello, world!')\n\nhello()\n";
+//!     assert_eq!(testing[..], expected[..]);
+//! }
+//! ```
+//!
+//! <br><br>
+//!
+//! # Formatting macros
+//!
+//! The indoc crate exports five additional macros to substitute conveniently
+//! for the standard library's formatting macros:
+//!
+//! - `formatdoc!($fmt, ...)`&ensp;&mdash;&ensp;equivalent to `format!(indoc!($fmt), ...)`
+//! - `printdoc!($fmt, ...)`&ensp;&mdash;&ensp;equivalent to `print!(indoc!($fmt), ...)`
+//! - `eprintdoc!($fmt, ...)`&ensp;&mdash;&ensp;equivalent to `eprint!(indoc!($fmt), ...)`
+//! - `writedoc!($dest, $fmt, ...)`&ensp;&mdash;&ensp;equivalent to `write!($dest, indoc!($fmt), ...)`
+//! - `concatdoc!(...)`&ensp;&mdash;&ensp;equivalent to `concat!(...)` with each string literal wrapped in `indoc!`
+//!
+//! ```
+//! # macro_rules! env {
+//! #     ($var:literal) => {
+//! #         "example"
+//! #     };
+//! # }
+//! #
+//! use indoc::{concatdoc, printdoc};
+//!
+//! const HELP: &str = concatdoc! {"
+//!     Usage: ", env!("CARGO_BIN_NAME"), " [options]
+//!
+//!     Options:
+//!         -h, --help
+//! "};
+//!
+//! fn main() {
+//!     printdoc! {"
+//!         GET {url}
+//!         Accept: {mime}
+//!         ",
+//!         url = "http://localhost:8080",
+//!         mime = "application/json",
+//!     }
+//! }
+//! ```
+//!
+//! <br><br>
+//!
+//! # Explanation
+//!
+//! The following rules characterize the behavior of the `indoc!()` macro:
+//!
+//! 1. Count the leading spaces of each line, ignoring the first line and any
+//!    lines that are empty or contain spaces only.
+//! 2. Take the minimum.
+//! 3. If the first line is empty i.e. the string begins with a newline, remove
+//!    the first line.
+//! 4. Remove the computed number of spaces from the beginning of each line.
+
+#![doc(html_root_url = "https://docs.rs/indoc/2.0.5")]
+#![allow(
+    clippy::derive_partial_eq_without_eq,
+    clippy::from_iter_instead_of_collect,
+    clippy::module_name_repetitions,
+    clippy::needless_doctest_main,
+    clippy::needless_pass_by_value,
+    clippy::trivially_copy_pass_by_ref,
+    clippy::type_complexity
+)]
+
+mod error;
+mod expr;
+mod unindent;
+
+use crate::error::{Error, Result};
+use crate::unindent::do_unindent;
+use proc_macro::token_stream::IntoIter as TokenIter;
+use proc_macro::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree};
+use std::iter::{self, Peekable};
+use std::str::FromStr;
+
+#[derive(Copy, Clone, PartialEq)]
+enum Macro {
+    Indoc,
+    Format,
+    Print,
+    Eprint,
+    Write,
+    Concat,
+}
+
+/// Unindent and produce `&'static str` or `&'static [u8]`.
+///
+/// Supports normal strings, raw strings, bytestrings, and raw bytestrings.
+///
+/// # Example
+///
+/// ```
+/// # use indoc::indoc;
+/// #
+/// // The type of `program` is &'static str
+/// let program = indoc! {"
+///     def hello():
+///         print('Hello, world!')
+///
+///     hello()
+/// "};
+/// print!("{}", program);
+/// ```
+///
+/// ```text
+/// def hello():
+///     print('Hello, world!')
+///
+/// hello()
+/// ```
+#[proc_macro]
+pub fn indoc(input: TokenStream) -> TokenStream {
+    expand(input, Macro::Indoc)
+}
+
+/// Unindent and call `format!`.
+///
+/// Argument syntax is the same as for [`std::format!`].
+///
+/// # Example
+///
+/// ```
+/// # use indoc::formatdoc;
+/// #
+/// let request = formatdoc! {"
+///     GET {url}
+///     Accept: {mime}
+///     ",
+///     url = "http://localhost:8080",
+///     mime = "application/json",
+/// };
+/// println!("{}", request);
+/// ```
+///
+/// ```text
+/// GET http://localhost:8080
+/// Accept: application/json
+/// ```
+#[proc_macro]
+pub fn formatdoc(input: TokenStream) -> TokenStream {
+    expand(input, Macro::Format)
+}
+
+/// Unindent and call `print!`.
+///
+/// Argument syntax is the same as for [`std::print!`].
+///
+/// # Example
+///
+/// ```
+/// # use indoc::printdoc;
+/// #
+/// printdoc! {"
+///     GET {url}
+///     Accept: {mime}
+///     ",
+///     url = "http://localhost:8080",
+///     mime = "application/json",
+/// }
+/// ```
+///
+/// ```text
+/// GET http://localhost:8080
+/// Accept: application/json
+/// ```
+#[proc_macro]
+pub fn printdoc(input: TokenStream) -> TokenStream {
+    expand(input, Macro::Print)
+}
+
+/// Unindent and call `eprint!`.
+///
+/// Argument syntax is the same as for [`std::eprint!`].
+///
+/// # Example
+///
+/// ```
+/// # use indoc::eprintdoc;
+/// #
+/// eprintdoc! {"
+///     GET {url}
+///     Accept: {mime}
+///     ",
+///     url = "http://localhost:8080",
+///     mime = "application/json",
+/// }
+/// ```
+///
+/// ```text
+/// GET http://localhost:8080
+/// Accept: application/json
+/// ```
+#[proc_macro]
+pub fn eprintdoc(input: TokenStream) -> TokenStream {
+    expand(input, Macro::Eprint)
+}
+
+/// Unindent and call `write!`.
+///
+/// Argument syntax is the same as for [`std::write!`].
+///
+/// # Example
+///
+/// ```
+/// # use indoc::writedoc;
+/// # use std::io::Write;
+/// #
+/// let _ = writedoc!(
+///     std::io::stdout(),
+///     "
+///         GET {url}
+///         Accept: {mime}
+///     ",
+///     url = "http://localhost:8080",
+///     mime = "application/json",
+/// );
+/// ```
+///
+/// ```text
+/// GET http://localhost:8080
+/// Accept: application/json
+/// ```
+#[proc_macro]
+pub fn writedoc(input: TokenStream) -> TokenStream {
+    expand(input, Macro::Write)
+}
+
+/// Unindent and call `concat!`.
+///
+/// Argument syntax is the same as for [`std::concat!`].
+///
+/// # Example
+///
+/// ```
+/// # use indoc::concatdoc;
+/// #
+/// # macro_rules! env {
+/// #     ($var:literal) => {
+/// #         "example"
+/// #     };
+/// # }
+/// #
+/// const HELP: &str = concatdoc! {"
+///     Usage: ", env!("CARGO_BIN_NAME"), " [options]
+///
+///     Options:
+///         -h, --help
+/// "};
+///
+/// print!("{}", HELP);
+/// ```
+///
+/// ```text
+/// Usage: example [options]
+///
+/// Options:
+///     -h, --help
+/// ```
+#[proc_macro]
+pub fn concatdoc(input: TokenStream) -> TokenStream {
+    expand(input, Macro::Concat)
+}
+
+fn expand(input: TokenStream, mode: Macro) -> TokenStream {
+    match try_expand(input, mode) {
+        Ok(tokens) => tokens,
+        Err(err) => err.to_compile_error(),
+    }
+}
+
+fn try_expand(input: TokenStream, mode: Macro) -> Result<TokenStream> {
+    let mut input = input.into_iter().peekable();
+
+    let prefix = match mode {
+        Macro::Indoc | Macro::Format | Macro::Print | Macro::Eprint => None,
+        Macro::Write => {
+            let require_comma = true;
+            let mut expr = expr::parse(&mut input, require_comma)?;
+            expr.extend(iter::once(input.next().unwrap())); // add comma
+            Some(expr)
+        }
+        Macro::Concat => return do_concat(input),
+    };
+
+    let first = input.next().ok_or_else(|| {
+        Error::new(
+            Span::call_site(),
+            "unexpected end of macro invocation, expected format string",
+        )
+    })?;
+
+    let preserve_empty_first_line = false;
+    let unindented_lit = lit_indoc(first, mode, preserve_empty_first_line)?;
+
+    let macro_name = match mode {
+        Macro::Indoc => {
+            require_empty_or_trailing_comma(&mut input)?;
+            return Ok(TokenStream::from(TokenTree::Literal(unindented_lit)));
+        }
+        Macro::Format => "format",
+        Macro::Print => "print",
+        Macro::Eprint => "eprint",
+        Macro::Write => "write",
+        Macro::Concat => unreachable!(),
+    };
+
+    // #macro_name! { #unindented_lit #args }
+    Ok(TokenStream::from_iter(vec![
+        TokenTree::Ident(Ident::new(macro_name, Span::call_site())),
+        TokenTree::Punct(Punct::new('!', Spacing::Alone)),
+        TokenTree::Group(Group::new(
+            Delimiter::Brace,
+            prefix
+                .unwrap_or_else(TokenStream::new)
+                .into_iter()
+                .chain(iter::once(TokenTree::Literal(unindented_lit)))
+                .chain(input)
+                .collect(),
+        )),
+    ]))
+}
+
+fn do_concat(mut input: Peekable<TokenIter>) -> Result<TokenStream> {
+    let mut result = TokenStream::new();
+    let mut first = true;
+
+    while input.peek().is_some() {
+        let require_comma = false;
+        let mut expr = expr::parse(&mut input, require_comma)?;
+        let mut expr_tokens = expr.clone().into_iter();
+        if let Some(token) = expr_tokens.next() {
+            if expr_tokens.next().is_none() {
+                let preserve_empty_first_line = !first;
+                if let Ok(literal) = lit_indoc(token, Macro::Concat, preserve_empty_first_line) {
+                    result.extend(iter::once(TokenTree::Literal(literal)));
+                    expr = TokenStream::new();
+                }
+            }
+        }
+        result.extend(expr);
+        if let Some(comma) = input.next() {
+            result.extend(iter::once(comma));
+        } else {
+            break;
+        }
+        first = false;
+    }
+
+    // concat! { #result }
+    Ok(TokenStream::from_iter(vec![
+        TokenTree::Ident(Ident::new("concat", Span::call_site())),
+        TokenTree::Punct(Punct::new('!', Spacing::Alone)),
+        TokenTree::Group(Group::new(Delimiter::Brace, result)),
+    ]))
+}
+
+fn lit_indoc(token: TokenTree, mode: Macro, preserve_empty_first_line: bool) -> Result<Literal> {
+    let span = token.span();
+    let mut single_token = Some(token);
+
+    while let Some(TokenTree::Group(group)) = single_token {
+        single_token = if group.delimiter() == Delimiter::None {
+            let mut token_iter = group.stream().into_iter();
+            token_iter.next().xor(token_iter.next())
+        } else {
+            None
+        };
+    }
+
+    let single_token =
+        single_token.ok_or_else(|| Error::new(span, "argument must be a single string literal"))?;
+
+    let repr = single_token.to_string();
+    let is_string = repr.starts_with('"') || repr.starts_with('r');
+    let is_byte_string = repr.starts_with("b\"") || repr.starts_with("br");
+
+    if !is_string && !is_byte_string {
+        return Err(Error::new(span, "argument must be a single string literal"));
+    }
+
+    if is_byte_string {
+        match mode {
+            Macro::Indoc => {}
+            Macro::Format | Macro::Print | Macro::Eprint | Macro::Write => {
+                return Err(Error::new(
+                    span,
+                    "byte strings are not supported in formatting macros",
+                ));
+            }
+            Macro::Concat => {
+                return Err(Error::new(
+                    span,
+                    "byte strings are not supported in concat macro",
+                ));
+            }
+        }
+    }
+
+    let begin = repr.find('"').unwrap() + 1;
+    let end = repr.rfind('"').unwrap();
+    let repr = format!(
+        "{open}{content}{close}",
+        open = &repr[..begin],
+        content = do_unindent(&repr[begin..end], preserve_empty_first_line),
+        close = &repr[end..],
+    );
+
+    let mut lit = Literal::from_str(&repr).unwrap();
+    lit.set_span(span);
+    Ok(lit)
+}
+
+fn require_empty_or_trailing_comma(input: &mut Peekable<TokenIter>) -> Result<()> {
+    let first = match input.next() {
+        Some(TokenTree::Punct(punct)) if punct.as_char() == ',' => match input.next() {
+            Some(second) => second,
+            None => return Ok(()),
+        },
+        Some(first) => first,
+        None => return Ok(()),
+    };
+    let last = input.last();
+
+    let begin_span = first.span();
+    let end_span = last.as_ref().map_or(begin_span, TokenTree::span);
+    let msg = format!(
+        "unexpected {token} in macro invocation; indoc argument must be a single string literal",
+        token = if last.is_some() { "tokens" } else { "token" }
+    );
+    Err(Error::new2(begin_span, end_span, &msg))
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/src/unindent.rs 43.0.0-1ubuntu1/rust-vendor/indoc/src/unindent.rs
--- 43.0.0-1/rust-vendor/indoc/src/unindent.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/src/unindent.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,118 @@
+use std::slice::Split;
+
+pub fn unindent(s: &str) -> String {
+    let preserve_empty_first_line = false;
+    do_unindent(s, preserve_empty_first_line)
+}
+
+// Compute the maximal number of spaces that can be removed from every line, and
+// remove them.
+pub fn unindent_bytes(s: &[u8]) -> Vec<u8> {
+    let preserve_empty_first_line = false;
+    do_unindent_bytes(s, preserve_empty_first_line)
+}
+
+pub(crate) fn do_unindent(s: &str, preserve_empty_first_line: bool) -> String {
+    let bytes = s.as_bytes();
+    let unindented = do_unindent_bytes(bytes, preserve_empty_first_line);
+    String::from_utf8(unindented).unwrap()
+}
+
+fn do_unindent_bytes(s: &[u8], preserve_empty_first_line: bool) -> Vec<u8> {
+    // Document may start either on the same line as opening quote or
+    // on the next line
+    let ignore_first_line =
+        !preserve_empty_first_line && (s.starts_with(b"\n") || s.starts_with(b"\r\n"));
+
+    // Largest number of spaces that can be removed from every
+    // non-whitespace-only line after the first
+    let spaces = s
+        .lines()
+        .skip(1)
+        .filter_map(count_spaces)
+        .min()
+        .unwrap_or(0);
+
+    let mut result = Vec::with_capacity(s.len());
+    for (i, line) in s.lines().enumerate() {
+        if i > 1 || (i == 1 && !ignore_first_line) {
+            result.push(b'\n');
+        }
+        if i == 0 {
+            // Do not un-indent anything on same line as opening quote
+            result.extend_from_slice(line);
+        } else if line.len() > spaces {
+            // Whitespace-only lines may have fewer than the number of spaces
+            // being removed
+            result.extend_from_slice(&line[spaces..]);
+        }
+    }
+    result
+}
+
+pub trait Unindent {
+    type Output;
+
+    fn unindent(&self) -> Self::Output;
+}
+
+impl Unindent for str {
+    type Output = String;
+
+    fn unindent(&self) -> Self::Output {
+        unindent(self)
+    }
+}
+
+impl Unindent for String {
+    type Output = String;
+
+    fn unindent(&self) -> Self::Output {
+        unindent(self)
+    }
+}
+
+impl Unindent for [u8] {
+    type Output = Vec<u8>;
+
+    fn unindent(&self) -> Self::Output {
+        unindent_bytes(self)
+    }
+}
+
+impl<'a, T: ?Sized + Unindent> Unindent for &'a T {
+    type Output = T::Output;
+
+    fn unindent(&self) -> Self::Output {
+        (**self).unindent()
+    }
+}
+
+// Number of leading spaces in the line, or None if the line is entirely spaces.
+fn count_spaces(line: &[u8]) -> Option<usize> {
+    for (i, ch) in line.iter().enumerate() {
+        if *ch != b' ' && *ch != b'\t' {
+            return Some(i);
+        }
+    }
+    None
+}
+
+// Based on core::str::StrExt.
+trait BytesExt {
+    fn lines(&self) -> Split<u8, fn(&u8) -> bool>;
+}
+
+impl BytesExt for [u8] {
+    fn lines(&self) -> Split<u8, fn(&u8) -> bool> {
+        fn is_newline(b: &u8) -> bool {
+            *b == b'\n'
+        }
+        let bytestring = if self.starts_with(b"\r\n") {
+            &self[1..]
+        } else {
+            self
+        };
+        bytestring.split(is_newline as fn(&u8) -> bool)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/compiletest.rs 43.0.0-1ubuntu1/rust-vendor/indoc/tests/compiletest.rs
--- 43.0.0-1/rust-vendor/indoc/tests/compiletest.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/compiletest.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+#[rustversion::attr(not(nightly), ignore)]
+#[cfg_attr(miri, ignore)]
+#[test]
+fn ui() {
+    let t = trybuild::TestCases::new();
+    t.compile_fail("tests/ui/*.rs");
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/test_concat.rs 43.0.0-1ubuntu1/rust-vendor/indoc/tests/test_concat.rs
--- 43.0.0-1/rust-vendor/indoc/tests/test_concat.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/test_concat.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,20 @@
+use indoc::concatdoc;
+
+macro_rules! env {
+    ($var:literal) => {
+        "test"
+    };
+}
+
+static HELP: &str = concatdoc! {"
+    Usage: ", env!("CARGO_BIN_NAME"), " [options]
+
+    Options:
+        -h, --help
+"};
+
+#[test]
+fn test_help() {
+    let expected = "Usage: test [options]\n\nOptions:\n    -h, --help\n";
+    assert_eq!(HELP, expected);
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/test_formatdoc.rs 43.0.0-1ubuntu1/rust-vendor/indoc/tests/test_formatdoc.rs
--- 43.0.0-1/rust-vendor/indoc/tests/test_formatdoc.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/test_formatdoc.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,117 @@
+use indoc::formatdoc;
+
+#[test]
+fn carriage_return() {
+    // Every line in the string ends with \r\n
+    let indoc = formatdoc! {"
+        {}
+
+            \\{}
+        {}",
+        'a', 'b', 'c'
+    };
+    let expected = "a\n\n    \\b\nc";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn empty_string() {
+    let indoc = formatdoc! {""};
+    let expected = "";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn joined_first_line() {
+    let indoc = formatdoc! {"\
+        {}", 'a'
+    };
+    let expected = "a";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn joined_lines() {
+    let indoc = formatdoc! {"
+        {}\
+        {}
+        {}\
+          {}
+        {}",
+        'a', 'b', 'c', 'd', 'e'
+    };
+    let expected = "ab\ncd\ne";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn no_leading_newline() {
+    let indoc = formatdoc! {"{}
+                             {}
+                             {}", 'a', 'b', 'c'};
+    let expected = "a\nb\nc";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn one_line() {
+    let indoc = formatdoc! {"a"};
+    let expected = "a";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn raw_string() {
+    let indoc = formatdoc! {r#"
+        {:?}
+
+            \\{}
+        {}"#,
+        "a", 'b', 'c'
+    };
+    let expected = "\"a\"\n\n    \\\\b\nc";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn string() {
+    let indoc = formatdoc! {"
+        {}
+
+            \\{}
+        {}",
+        'a', 'b', 'c'
+    };
+    let expected = "a\n\n    \\b\nc";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn string_trailing_newline() {
+    let indoc = formatdoc! {"
+        {}
+
+            \\{}
+        {}
+    ",
+        'a', 'b', 'c'
+    };
+    let expected = "a\n\n    \\b\nc\n";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn trailing_whitespace() {
+    let indoc = formatdoc! {"
+        {} {below}
+          
+        {} {below}
+        
+        {} {below}
+      
+        end",
+        2, 0, -2, below = "below"
+    };
+    let expected = "2 below\n  \n0 below\n\n-2 below\n\nend";
+    assert_eq!(indoc, expected);
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/test_indoc.rs 43.0.0-1ubuntu1/rust-vendor/indoc/tests/test_indoc.rs
--- 43.0.0-1/rust-vendor/indoc/tests/test_indoc.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/test_indoc.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,176 @@
+use indoc::indoc;
+
+const HELP: &str = indoc! {"
+    Usage: ./foo
+"};
+
+#[test]
+fn test_global() {
+    let expected = "Usage: ./foo\n";
+    assert_eq!(HELP, expected);
+}
+
+#[test]
+fn byte_string() {
+    let indoc = indoc! {b"
+        a
+
+            \\b
+        c"
+    };
+    let expected = b"a\n\n    \\b\nc";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn carriage_return() {
+    // Every line in the string ends with \r\n
+    let indoc = indoc! {"
+        a
+
+            \\b
+        c"
+    };
+    let expected = "a\n\n    \\b\nc";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn trailing_comma() {
+    let indoc = indoc! {
+        "
+        test
+        ",
+    };
+    let expected = "test\n";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn empty_string() {
+    let indoc = indoc! {""};
+    let expected = "";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn joined_first_line() {
+    let indoc = indoc! {"\
+        a"
+    };
+    let expected = "a";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn joined_lines() {
+    let indoc = indoc! {"
+        a\
+        b
+        c\
+          d
+        e"
+    };
+    let expected = "ab\ncd\ne";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn no_leading_newline() {
+    let indoc = indoc! {"a
+                         b
+                         c"};
+    let expected = "a\nb\nc";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn one_line() {
+    let indoc = indoc! {"a"};
+    let expected = "a";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn raw_byte_string() {
+    let indoc = indoc! {br#"
+        "a"
+
+            \\b
+        c"#
+    };
+    let expected = b"\"a\"\n\n    \\\\b\nc";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn raw_string() {
+    let indoc = indoc! {r#"
+        "a"
+
+            \\b
+        c"#
+    };
+    let expected = "\"a\"\n\n    \\\\b\nc";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn string() {
+    let indoc = indoc! {"
+        a
+
+            \\b
+        c"
+    };
+    let expected = "a\n\n    \\b\nc";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn string_trailing_newline() {
+    let indoc = indoc! {"
+        a
+
+            \\b
+        c
+    "};
+    let expected = "a\n\n    \\b\nc\n";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn trailing_whitespace() {
+    let indoc = indoc! {"
+        2 below
+          
+        0 below
+        
+        -2 below
+      
+        end"
+    };
+    let expected = "2 below\n  \n0 below\n\n-2 below\n\nend";
+    assert_eq!(indoc, expected);
+}
+
+#[test]
+fn indoc_as_format_string() {
+    let s = format!(indoc! {"{}"}, true);
+    assert_eq!(s, "true");
+}
+
+#[test]
+fn test_metavariable() {
+    macro_rules! indoc_wrapper {
+        ($e:expr) => {
+            indoc!($e)
+        };
+    }
+
+    let indoc = indoc_wrapper! {"
+        macros, how do they work
+    "};
+    let expected = "macros, how do they work\n";
+    assert_eq!(indoc, expected);
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/test_unindent.rs 43.0.0-1ubuntu1/rust-vendor/indoc/tests/test_unindent.rs
--- 43.0.0-1/rust-vendor/indoc/tests/test_unindent.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/test_unindent.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,53 @@
+#![allow(clippy::shadow_unrelated)]
+
+use unindent::{unindent, unindent_bytes, Unindent};
+
+#[test]
+fn fn_unindent_str() {
+    let s = "
+        line one
+        line two";
+    assert_eq!(unindent(s), "line one\nline two");
+
+    let s = "\n\t\t\tline one\n\t\t\tline two";
+    assert_eq!(unindent(s), "line one\nline two");
+}
+
+#[test]
+fn fn_unindent_bytes() {
+    let b = b"
+        line one
+        line two";
+    assert_eq!(unindent_bytes(b), b"line one\nline two");
+
+    let b = b"\n\t\t\tline one\n\t\t\tline two";
+    assert_eq!(unindent_bytes(b), b"line one\nline two");
+}
+
+#[test]
+fn trait_unindent_str() {
+    let s = "
+        line one
+        line two";
+    assert_eq!(s.unindent(), "line one\nline two");
+
+    let s = "\n\t\t\tline one\n\t\t\tline two";
+    assert_eq!(s.unindent(), "line one\nline two");
+}
+
+#[test]
+fn trait_unindent_bytes() {
+    let b = b"
+        line one
+        line two";
+    assert_eq!(b.unindent(), b"line one\nline two");
+
+    let b = b"\n\t\t\tline one\n\t\t\tline two";
+    assert_eq!(b.unindent(), b"line one\nline two");
+}
+
+#[test]
+fn carriage_returns() {
+    let s = "\r\n\tline one\r\n\tline two";
+    assert_eq!(unindent(s), "line one\r\nline two");
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/test_writedoc.rs 43.0.0-1ubuntu1/rust-vendor/indoc/tests/test_writedoc.rs
--- 43.0.0-1/rust-vendor/indoc/tests/test_writedoc.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/test_writedoc.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,57 @@
+#![allow(clippy::if_same_then_else, clippy::let_underscore_untyped)]
+
+use indoc::writedoc;
+use std::fmt::Write as _;
+
+#[test]
+fn test_write_to_string() {
+    let mut s = String::new();
+    writedoc!(
+        s,
+        "
+        one
+        two
+        ",
+    )
+    .unwrap();
+
+    let expected = "one\ntwo\n";
+    assert_eq!(s, expected);
+}
+
+#[test]
+fn test_format_args() {
+    let mut s = String::new();
+    writedoc!(
+        s,
+        "
+        {}
+        {}
+        ",
+        0,
+        0,
+    )
+    .unwrap();
+
+    let expected = "0\n0\n";
+    assert_eq!(s, expected);
+}
+
+#[test]
+fn test_angle_bracket_parsing() {
+    const ZERO: usize = 0;
+
+    struct Pair<A, B>(A, B);
+    impl<A, B> Pair<A, B> {
+        const ONE: usize = 1;
+    }
+
+    let mut s = String::new();
+    let _ = writedoc! {
+        if ZERO < Pair::<fn() -> (), ()>::ONE { &mut s } else { &mut s },
+        "writedoc",
+    };
+
+    let expected = "writedoc";
+    assert_eq!(s, expected);
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/capture-var-nested.rs 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/capture-var-nested.rs
--- 43.0.0-1/rust-vendor/indoc/tests/ui/capture-var-nested.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/capture-var-nested.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,6 @@
+use indoc::indoc;
+
+fn main() {
+    let world = "world";
+    println!(indoc!("Hello {world}"));
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/capture-var-nested.stderr 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/capture-var-nested.stderr
--- 43.0.0-1/rust-vendor/indoc/tests/ui/capture-var-nested.stderr	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/capture-var-nested.stderr	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,8 @@
+error: there is no argument named `world`
+ --> tests/ui/capture-var-nested.rs:5:21
+  |
+5 |     println!(indoc!("Hello {world}"));
+  |                     ^^^^^^^^^^^^^^^
+  |
+  = note: did you intend to capture a variable `world` from the surrounding scope?
+  = note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/no-arguments.rs 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/no-arguments.rs
--- 43.0.0-1/rust-vendor/indoc/tests/ui/no-arguments.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/no-arguments.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+use indoc::indoc;
+
+fn main() {
+    indoc!();
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/no-arguments.stderr 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/no-arguments.stderr
--- 43.0.0-1/rust-vendor/indoc/tests/ui/no-arguments.stderr	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/no-arguments.stderr	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+error: unexpected end of macro invocation, expected format string
+ --> tests/ui/no-arguments.rs:4:5
+  |
+4 |     indoc!();
+  |     ^^^^^^^^
+  |
+  = note: this error originates in the macro `indoc` (in Nightly builds, run with -Z macro-backtrace for more info)
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/non-lit.rs 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/non-lit.rs
--- 43.0.0-1/rust-vendor/indoc/tests/ui/non-lit.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/non-lit.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+use indoc::indoc;
+
+fn main() {
+    indoc!(fail);
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/non-lit.stderr 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/non-lit.stderr
--- 43.0.0-1/rust-vendor/indoc/tests/ui/non-lit.stderr	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/non-lit.stderr	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+error: argument must be a single string literal
+ --> tests/ui/non-lit.rs:4:12
+  |
+4 |     indoc!(fail);
+  |            ^^^^
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/non-string.rs 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/non-string.rs
--- 43.0.0-1/rust-vendor/indoc/tests/ui/non-string.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/non-string.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+use indoc::indoc;
+
+fn main() {
+    indoc!(64);
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/non-string.stderr 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/non-string.stderr
--- 43.0.0-1/rust-vendor/indoc/tests/ui/non-string.stderr	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/non-string.stderr	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+error: argument must be a single string literal
+ --> tests/ui/non-string.rs:4:12
+  |
+4 |     indoc!(64);
+  |            ^^
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/printdoc-binary.rs 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/printdoc-binary.rs
--- 43.0.0-1/rust-vendor/indoc/tests/ui/printdoc-binary.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/printdoc-binary.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+use indoc::printdoc;
+
+fn main() {
+    printdoc!(b"");
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/printdoc-binary.stderr 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/printdoc-binary.stderr
--- 43.0.0-1/rust-vendor/indoc/tests/ui/printdoc-binary.stderr	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/printdoc-binary.stderr	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+error: byte strings are not supported in formatting macros
+ --> tests/ui/printdoc-binary.rs:4:15
+  |
+4 |     printdoc!(b"");
+  |               ^^^
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/printdoc-extra-arg.rs 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/printdoc-extra-arg.rs
--- 43.0.0-1/rust-vendor/indoc/tests/ui/printdoc-extra-arg.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/printdoc-extra-arg.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+use indoc::printdoc;
+
+fn main() {
+    printdoc!("", 0);
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/printdoc-extra-arg.stderr 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/printdoc-extra-arg.stderr
--- 43.0.0-1/rust-vendor/indoc/tests/ui/printdoc-extra-arg.stderr	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/printdoc-extra-arg.stderr	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+error: argument never used
+ --> tests/ui/printdoc-extra-arg.rs:4:19
+  |
+4 |     printdoc!("", 0);
+  |               --  ^ argument never used
+  |               |
+  |               formatting specifier missing
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/printdoc-no-arg.rs 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/printdoc-no-arg.rs
--- 43.0.0-1/rust-vendor/indoc/tests/ui/printdoc-no-arg.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/printdoc-no-arg.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+use indoc::printdoc;
+
+fn main() {
+    printdoc!("{}");
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/printdoc-no-arg.stderr 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/printdoc-no-arg.stderr
--- 43.0.0-1/rust-vendor/indoc/tests/ui/printdoc-no-arg.stderr	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/printdoc-no-arg.stderr	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+error: 1 positional argument in format string, but no arguments were given
+ --> tests/ui/printdoc-no-arg.rs:4:16
+  |
+4 |     printdoc!("{}");
+  |                ^^
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/printdoc-no-display.rs 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/printdoc-no-display.rs
--- 43.0.0-1/rust-vendor/indoc/tests/ui/printdoc-no-display.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/printdoc-no-display.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+use indoc::printdoc;
+
+struct NoDisplay;
+
+fn main() {
+    printdoc!("{}", NoDisplay);
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/printdoc-no-display.stderr 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/printdoc-no-display.stderr
--- 43.0.0-1/rust-vendor/indoc/tests/ui/printdoc-no-display.stderr	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/printdoc-no-display.stderr	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,9 @@
+error[E0277]: `NoDisplay` doesn't implement `std::fmt::Display`
+ --> tests/ui/printdoc-no-display.rs:6:21
+  |
+6 |     printdoc!("{}", NoDisplay);
+  |                     ^^^^^^^^^ `NoDisplay` cannot be formatted with the default formatter
+  |
+  = help: the trait `std::fmt::Display` is not implemented for `NoDisplay`
+  = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
+  = note: this error originates in the macro `$crate::format_args` which comes from the expansion of the macro `printdoc` (in Nightly builds, run with -Z macro-backtrace for more info)
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/printdoc-no-named-arg.rs 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/printdoc-no-named-arg.rs
--- 43.0.0-1/rust-vendor/indoc/tests/ui/printdoc-no-named-arg.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/printdoc-no-named-arg.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+use indoc::printdoc;
+
+fn main() {
+    printdoc!("{named}");
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/printdoc-no-named-arg.stderr 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/printdoc-no-named-arg.stderr
--- 43.0.0-1/rust-vendor/indoc/tests/ui/printdoc-no-named-arg.stderr	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/printdoc-no-named-arg.stderr	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+error[E0425]: cannot find value `named` in this scope
+ --> tests/ui/printdoc-no-named-arg.rs:4:17
+  |
+4 |     printdoc!("{named}");
+  |                 ^^^^^ not found in this scope
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/three-arguments.rs 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/three-arguments.rs
--- 43.0.0-1/rust-vendor/indoc/tests/ui/three-arguments.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/three-arguments.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,9 @@
+use indoc::indoc;
+
+fn main() {
+    indoc!("
+        a
+        b
+        c
+        " 64 128);
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/three-arguments.stderr 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/three-arguments.stderr
--- 43.0.0-1/rust-vendor/indoc/tests/ui/three-arguments.stderr	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/three-arguments.stderr	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+error: unexpected tokens in macro invocation; indoc argument must be a single string literal
+ --> tests/ui/three-arguments.rs:8:11
+  |
+8 |         " 64 128);
+  |           ^^^^^^
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/two-arguments.rs 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/two-arguments.rs
--- 43.0.0-1/rust-vendor/indoc/tests/ui/two-arguments.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/two-arguments.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,9 @@
+use indoc::indoc;
+
+fn main() {
+    indoc!("
+        a
+        b
+        c
+        " 64);
+}
diff -pruN 43.0.0-1/rust-vendor/indoc/tests/ui/two-arguments.stderr 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/two-arguments.stderr
--- 43.0.0-1/rust-vendor/indoc/tests/ui/two-arguments.stderr	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/indoc/tests/ui/two-arguments.stderr	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+error: unexpected token in macro invocation; indoc argument must be a single string literal
+ --> tests/ui/two-arguments.rs:8:11
+  |
+8 |         " 64);
+  |           ^^
diff -pruN 43.0.0-1/rust-vendor/libc/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/libc/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/libc/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"CONTRIBUTING.md":"a93fcda0a76e1975fcfb0aa2ba00c9b1864f9ae6062704a294d81a3688898e10","Cargo.toml":"a4fd0b57f9e9365869b9c6030ffa4ca30d84c43deda5883aa5a58d8775877ff9","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"a8d47ff51ca256f56a8932dba07660672dbfe3004257ca8de708aac1415937a1","README.md":"4da2919bb509f3f06163778478494f780ca6627cb79ccab5d2c828c8d88dc133","build.rs":"c26a84b1e50468025002c5e7201b9c104e7e7aec167def54f811b68c0e94a644","rustfmt.toml":"eaa2ea84fc1ba0359b77680804903e07bb38d257ab11986b95b158e460f787b2","src/fixed_width_ints.rs":"7f986e5f5e68d25ef04d386fd2f640e8be8f15427a8d4a458ea01d26b8dca0ca","src/fuchsia/aarch64.rs":"893fcec48142d273063ffd814dca33fbec92205fd39ada97075f85201d803996","src/fuchsia/align.rs":"ae1cf8f011a99737eabeb14ffff768e60f13b13363d7646744dbb0f443dab3d6","src/fuchsia/mod.rs":"07410f511835da540e5bdc55f7384c71cd7836fe63bbca6be547de825f823c03","src/fuchsia/no_align.rs":"303f3f1b255e0088b5715094353cf00476131d8e94e6aebb3f469557771c8b8a","src/fuchsia/riscv64.rs":"617cd75e79e0e20f664db764a4dc2a396d9fd11a4d95371acd91ed4811293b11","src/fuchsia/x86_64.rs":"93a3632b5cf67d2a6bcb7dc0a558605252d5fe689e0f38d8aa2ec5852255ac87","src/hermit/aarch64.rs":"86048676e335944c37a63d0083d0f368ae10ceccefeed9debb3bbe08777fc682","src/hermit/mod.rs":"2d04cfa0d55dc0a2e36fdc4a45819b9d3722af19bb1932778b44feb4c2f81036","src/hermit/x86_64.rs":"ab832b7524e5fb15c49ff7431165ab1a37dc4667ae0b58e8306f4c539bfa110c","src/lib.rs":"9d7030ba3e21064a0f3a8e79927c70d5a95a0026be61be084f3ab021e243e503","src/macros.rs":"5f985b3de7b18833f866bf832b8ffb0430f0f70aa9a468b6a2c855c1bf9d33e4","src/psp.rs":"0a7d5121a8cc2903009f586c00e4ae2d6126d24eb90531dafaba6f59823aa6b2","src/sgx.rs":"16a95cdefc81c5ee00d8353a60db363c4cc3e0f75abcd5d0144723f2a306ed1b","src/solid/aarch64.rs":"a726e47f324adf73a4a0b67a2c183408d0cad105ae66acf36db37a42ab7f8707","src/solid/arm.rs":"e39a4f74ebbef3b97b8c95758ad741123d84ed3eb48d9cf4f1f4872097fc27fe","src/solid/mod.rs":"5f4151dca5132e4b4e4c23ab9737e12856dddbdc0ca3f7dbc004328ef3c8acde","src/switch.rs":"9da3dd39b3de45a7928789926e8572d00e1e11a39e6f7289a1349aadce90edba","src/teeos/mod.rs":"eb664b3e94bcd44d8c8147b56c2187139d01bf8402ee0bb81967a5a50a3e927f","src/unix/aix/mod.rs":"a1ed0ae0164eb783297e185908f6c61c67d5ac82d4f6ab9c559c4d7e0fea51c3","src/unix/aix/powerpc64.rs":"cf374d81139d45f9d77c6a764f640bfbf7e0a5903689652c8296f8e10d55169b","src/unix/align.rs":"2cdc7c826ef7ae61f5171c5ae8c445a743d86f1a7f2d9d7e4ceeec56d6874f65","src/unix/bsd/apple/b32/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b32/mod.rs":"2546ad3eb6aecb95f916648bc63264117c92b4b4859532b34cb011e4c75a5a72","src/unix/bsd/apple/b64/aarch64/align.rs":"2eaf0f561a32bdcbf4e0477c8895d5e7bcb5cdebd5fef7b4df2ca8e38e144d94","src/unix/bsd/apple/b64/aarch64/mod.rs":"44c217a4f263afe7a97435de9323d20a96c37836f899ca0925306d4b7e073c27","src/unix/bsd/apple/b64/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b64/mod.rs":"f5e278a1af7fb358891d1c9be4eb7e815aaca0c5cb738d0c3604ba2208a856f7","src/unix/bsd/apple/b64/x86_64/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b64/x86_64/mod.rs":"8c87c5855038aae5d433c8f5eb3b29b0a175879a0245342b3bfd83bdf4cfd936","src/unix/bsd/apple/long_array.rs":"3cf1f19b812e6d093c819dc65ce55b13491963e0780eda0d0bd1577603e81948","src/unix/bsd/apple/mod.rs":"e8ed82a15cc3a21337894a123bf8d3cbc9b176224a6709bf6b602a266ff97651","src/unix/bsd/freebsdlike/dragonfly/errno.rs":"8295b8bb0dfd38d2cdb4d9192cdeeb534cc6c3b208170e64615fa3e0edb3e578","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"2777f94909a798df1b8030fb86d02e2118d0ac3e49e9a542df54a569ca5ae2f9","src/unix/bsd/freebsdlike/freebsd/aarch64.rs":"6c8e216385f53a4bf5f171749b57602fc34a4e4b160a44ca31c058cb0c8a2126","src/unix/bsd/freebsdlike/freebsd/arm.rs":"59d6a670eea562fb87686e243e0a84603d29a2028a3d4b3f99ccc01bd04d2f47","src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs":"9808d152c1196aa647f1b0f0cf84dac8c930da7d7f897a44975545e3d9d17681","src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs":"e243ae0e89623d4fa9f85afe14369cc5fd5f2028ea715773dbec722ba80dac1f","src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs":"bef9fae288a4f29e941ea369be1cd20b170040e60665a4d49a4a9e79009b72d8","src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs":"2df36a7f122f6d6e5753cfb4d22e915cc80f6bc91c0161b3daae55a481bfd052","src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs":"88be47524b28b6635ccb1e85ea511bf17337be0af7e9baa740c341ac9e83a6f7","src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs":"2df36a7f122f6d6e5753cfb4d22e915cc80f6bc91c0161b3daae55a481bfd052","src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs":"6ddc6abf6d5ccaea0d8cccf521e8ca6457efcad3086af4155628d5d06d672346","src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs":"e7b5863e222d6cc416b6b0fbe71690fad909e899b4c4ae810bbca117e4fcb650","src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs":"93115c1a9faa43ebf58b7dee3582aed5a54291b284764e370e7f649b2e6a9565","src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs":"e7b5863e222d6cc416b6b0fbe71690fad909e899b4c4ae810bbca117e4fcb650","src/unix/bsd/freebsdlike/freebsd/mod.rs":"9fb4dd76676d9a91cf1e10e48dad2f010c03bb40ee3c1da863a98b7a2245d4cb","src/unix/bsd/freebsdlike/freebsd/powerpc.rs":"9ca3f82f88974e6db5569f2d76a5a3749b248a31747a6c0da5820492bdfeca42","src/unix/bsd/freebsdlike/freebsd/powerpc64.rs":"2dae3ecc87eac3b11657aa98915def55fc4b5c0de11fe26aae23329a54628a9a","src/unix/bsd/freebsdlike/freebsd/riscv64.rs":"fa4bed4c58cad24ba3395941c7fa6b11e089551a04714f9561078e400f5b2b62","src/unix/bsd/freebsdlike/freebsd/x86.rs":"6766e2ce85e187b306cd3b0b8d7e15b8f4042c5cff81d89b3af69ecc99c70ab0","src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs":"0e1f69a88fca1c32874b1daf5db3d446fefbe518dca497f096cc9168c39dde70","src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs":"51e4dd0c8ae247bb652feda5adad9333ea3bb30c750c3a3935e0b0e47d7803eb","src/unix/bsd/freebsdlike/mod.rs":"dca41da072ffb96ba9fd96cefdf629937284a850dd933949cb7f7c5930f3ac54","src/unix/bsd/mod.rs":"1cd730c416c4a00457e5e159ef7d3631966ac5326e15c7a853e03c7d66a90307","src/unix/bsd/netbsdlike/mod.rs":"ea60540aa4edd4e43136749d5df497b1dc072b9912b6030dd1ab794a6d1c3c3c","src/unix/bsd/netbsdlike/netbsd/aarch64.rs":"057ee877db7193ba0dc10801b9a6563ac6dbdb78376d6851a84cb12b30841759","src/unix/bsd/netbsdlike/netbsd/arm.rs":"949b55e4dee1c8c511f4f061a6a57ac876a6c0eabfaf5cc20e9ab40d8f41b2e0","src/unix/bsd/netbsdlike/netbsd/mips.rs":"88be18ac43ba224c77e78e4179b6761debc5e6c30a258fac56263809c7af4fbc","src/unix/bsd/netbsdlike/netbsd/mod.rs":"b8d6f089fc8eb2cb59e45335a26c9ce871b846216c9859b553c6b91982f8de33","src/unix/bsd/netbsdlike/netbsd/powerpc.rs":"ee7ff5d89d0ed22f531237b5059aa669df93a3b5c489fa641465ace8d405bf41","src/unix/bsd/netbsdlike/netbsd/riscv64.rs":"1cbe2e5ed681cb1054b699da37daaf6c714267df7d332c90fc2a589b11579625","src/unix/bsd/netbsdlike/netbsd/sparc64.rs":"9489f4b3e4566f43bb12dfb92238960613dac7f6a45cc13068a8d152b902d7d9","src/unix/bsd/netbsdlike/netbsd/x86.rs":"20692320e36bfe028d1a34d16fe12ca77aa909cb02bda167376f98f1a09aefe7","src/unix/bsd/netbsdlike/netbsd/x86_64.rs":"532b76199d6c71ff996eade9f906c55a72c9aff489595d25a21e21878cfd740b","src/unix/bsd/netbsdlike/openbsd/aarch64.rs":"dd91931d373b7ecaf6e2de25adadee10d16fa9b12c2cbacdff3eb291e1ba36af","src/unix/bsd/netbsdlike/openbsd/arm.rs":"01580d261bc6447bb327a0d982181b7bdabfa066cee65a30373d3ced729ad307","src/unix/bsd/netbsdlike/openbsd/mips64.rs":"8532a189ae10c7d668d9d4065da8b05d124e09bd39442c9f74a7f231c43eca48","src/unix/bsd/netbsdlike/openbsd/mod.rs":"7b93b5b24b3c72a79b2de19b47ac2f56b29d87e9fc8f4c721a63d1e87ec83fcc","src/unix/bsd/netbsdlike/openbsd/powerpc.rs":"01580d261bc6447bb327a0d982181b7bdabfa066cee65a30373d3ced729ad307","src/unix/bsd/netbsdlike/openbsd/powerpc64.rs":"1dd5449dd1fd3d51e30ffdeeaece91d0aaf05c710e0ac699fecc5461cfa2c28e","src/unix/bsd/netbsdlike/openbsd/riscv64.rs":"1fe3332dc705a13e6242219970f5449d6d7a73e2e6c8537ab8e421d8a6f2e3ff","src/unix/bsd/netbsdlike/openbsd/sparc64.rs":"d04fd287afbaa2c5df9d48c94e8374a532a3ba491b424ddf018270c7312f4085","src/unix/bsd/netbsdlike/openbsd/x86.rs":"6f7f5c4fde2a2259eb547890cbd86570cea04ef85347d7569e94e679448bec87","src/unix/bsd/netbsdlike/openbsd/x86_64.rs":"d31db31630289c85af3339dbe357998a21ca584cbae31607448fe2cf7675a4e1","src/unix/haiku/b32.rs":"a2efdbf7158a6da341e1db9176b0ab193ba88b449616239ed95dced11f54d87b","src/unix/haiku/b64.rs":"ff8115367d3d7d354f792d6176dfaaa26353f57056197b563bf4681f91ff7985","src/unix/haiku/mod.rs":"a97c51465d706e0dea8a7e2850d927c4ed78a7aa6603468d8b8df59ae1f2d296","src/unix/haiku/native.rs":"3bbf42c3e3e437e8b626be67c72b6adcec60646eb5dd4bf8471a603cbbb5e5a4","src/unix/haiku/x86_64.rs":"3ec3aeeb7ed208b8916f3e32d42bfd085ff5e16936a1a35d9a52789f043b7237","src/unix/hurd/align.rs":"03c79b2cd8270ebd0cf93cb475a8f1ff85b28175ea0de007ede17cad94a89b03","src/unix/hurd/b32.rs":"2ba90ed973f90366c36a6387833a3df42abfee9622d4a0352635937d4a89eaf4","src/unix/hurd/b64.rs":"d919b4aec9b3080ad24c125c57b2c8b2e483d72045f1554c429d14560355846f","src/unix/hurd/mod.rs":"6a2f0db80a3cd34b55ef82e357da4d453d5d190a2dd4501bfa5d0bb9bca0de4f","src/unix/hurd/no_align.rs":"03c79b2cd8270ebd0cf93cb475a8f1ff85b28175ea0de007ede17cad94a89b03","src/unix/linux_like/android/b32/arm.rs":"ce582de7e983a33d3bfad13075c53aac9016cee35f06ad8653ee9072c3ec2564","src/unix/linux_like/android/b32/mod.rs":"7c173e0375119bf06a3081652faede95e5bcd6858e7576b7533d037978737c8f","src/unix/linux_like/android/b32/x86/align.rs":"812914e4241df82e32b12375ca3374615dc3a4bdd4cf31f0423c5815320c0dab","src/unix/linux_like/android/b32/x86/mod.rs":"e6d107efbcd37b5b85dfa18f683300cbf768ffa0237997a9fa52b184a53323ac","src/unix/linux_like/android/b64/aarch64/align.rs":"2179c3b1608fa4bf68840482bfc2b2fa3ee2faf6fcae3770f9e505cddca35c7b","src/unix/linux_like/android/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/android/b64/aarch64/mod.rs":"873af67c4a9757ead56bc797d04efcecd311ecbf0084ebdd198fb690463ef299","src/unix/linux_like/android/b64/mod.rs":"71e4fcbe952bfa4a5f9022f3972e906917b38f729b9d8ef57cd5d179104894ac","src/unix/linux_like/android/b64/riscv64/align.rs":"0bf138f84e5327d8339bcd4adf071a6832b516445e597552c82bbd881095e3a8","src/unix/linux_like/android/b64/riscv64/mod.rs":"19d4bf2237c47127eba9144e0b82e995bc079315e719179a91813b0ae7b0e49d","src/unix/linux_like/android/b64/x86_64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/android/b64/x86_64/mod.rs":"4ec2de11a9b65c4325b7b991f0b99a414975e0e61ba8668caca5d921e9b314d1","src/unix/linux_like/android/mod.rs":"d68feed235b945ff6e32a8d5c8b659b04966f42a7a77722b454dce2b54561cbd","src/unix/linux_like/emscripten/align.rs":"86c95cbed7a7161b1f23ee06843e7b0e2340ad92b2cb86fe2a8ef3e0e8c36216","src/unix/linux_like/emscripten/lfs64.rs":"3776af30a758d765a88920ec4fde442ab89040da13d3b3625c7fbcb8a958559f","src/unix/linux_like/emscripten/mod.rs":"70d4591730a731ee32788a9d8d2de379592844ec36b7d1723514179605587713","src/unix/linux_like/emscripten/no_align.rs":"0128e4aa721a9902754828b61b5ec7d8a86619983ed1e0544a85d35b1051fad6","src/unix/linux_like/linux/align.rs":"bc5abcd38e2320171e0981e773c9c5fe3e0d5a66fdff049228f6a1acad80ef8b","src/unix/linux_like/linux/arch/generic/mod.rs":"3ab533349696d24505adb6bb9183d73fd5e3b17e2f90dd21478af2a47b4d6fa8","src/unix/linux_like/linux/arch/mips/mod.rs":"ca3db0e3ae852abf18f3588e40d5d64707fcc1829e08ddc5da1080e1a92c8851","src/unix/linux_like/linux/arch/mod.rs":"5bd5361f8a6ab4e18bbba6da9f92c164ae252b15a0ed10064812544aa1fdf198","src/unix/linux_like/linux/arch/powerpc/mod.rs":"0bc2d2667a00eca81f4abeb6d613a90848a947f51224103f83268928b8197629","src/unix/linux_like/linux/arch/sparc/mod.rs":"5e6777863e74a9e2aa9dc487f1059783dd211babc2b32d6bf676f311e49c55d6","src/unix/linux_like/linux/gnu/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/gnu/b32/arm/align.rs":"6ec0eb3ee93f7ae99fd714b4deabfb5e97fbcefd8c26f5a45fb8e7150899cdeb","src/unix/linux_like/linux/gnu/b32/arm/mod.rs":"f68ec59b6407f9d4e326f3e71a41ec21f19ecfc703edf9a93e496f661fed5506","src/unix/linux_like/linux/gnu/b32/csky/align.rs":"3fed009dc9af3cc81be7087da9d2d7d1f39845e4497e290259c5cdbae25f039d","src/unix/linux_like/linux/gnu/b32/csky/mod.rs":"8729b68e433e94c2128e51a7db4fd555938e4be4dc64584c352b24a20d9c8e91","src/unix/linux_like/linux/gnu/b32/m68k/align.rs":"8faa92f77a9232c035418d45331774e64a9a841d99c91791570a203bf2b45bcb","src/unix/linux_like/linux/gnu/b32/m68k/mod.rs":"80956d3fef163ecf248828a6f38782dd8ae856d86b1bb5aac2de36032dbd8ea0","src/unix/linux_like/linux/gnu/b32/mips/align.rs":"429fb5e005cb7143602d430098b6ebfb7d360685b194f333dfd587472ae954ee","src/unix/linux_like/linux/gnu/b32/mips/mod.rs":"96e22350d5d132d917c743d6560464500652c67b52c3d0e8474494487df3365d","src/unix/linux_like/linux/gnu/b32/mod.rs":"b56625dd20dd48a8699034d349ef089c540c0ddcbf8a3481d598d101f8b40b78","src/unix/linux_like/linux/gnu/b32/powerpc.rs":"20fc3cc4fe1ef6617b63b61b897f782ceb9c2842fc718f504a1840537229bf47","src/unix/linux_like/linux/gnu/b32/riscv32/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs":"887288a0a1cfff319d0e15edcdc4fcb31fd643ff41715ec5244c8f2413624169","src/unix/linux_like/linux/gnu/b32/sparc/align.rs":"21adbed27df73e2d1ed934aaf733a643003d7baf2bde9c48ea440895bcca6d41","src/unix/linux_like/linux/gnu/b32/sparc/mod.rs":"cc4342b949e4d796f304acd9dfe3f721a1c2f37fec16b42d3bb27dc94723af37","src/unix/linux_like/linux/gnu/b32/x86/align.rs":"e4bafdc4a519a7922a81b37a62bbfd1177a2f620890eef8f1fbc47162e9eb413","src/unix/linux_like/linux/gnu/b32/x86/mod.rs":"06d4db4ee8352f62a0a5ead0c4d6ea0a78feff522f19b9bc5772f6dd920ffd80","src/unix/linux_like/linux/gnu/b64/aarch64/align.rs":"fdf1c72375a2167699157e0dd825422690bb6719f7bc69515a2e5846d0431d7c","src/unix/linux_like/linux/gnu/b64/aarch64/fallback.rs":"832e7487249c1c0bb6e9911ce3f7d32ca22378e42392ab83c56915cbc59d8be3","src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs":"bf4611b737813deef6787babf6c01698605f3b75482269b8546318667bc68e29","src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs":"11a950697fdda0258c6e37c6b13993348c8de4134105ed4faa79358e53175072","src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs":"8202614484da36c388d2ffdd2554c56bb4f9db8e5bd621f8c36114cdcfeec644","src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs":"060aa33cc737966c691aab8511c5c5729e551458ce18d0e284e0d45f39beeb60","src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs":"10f025edecebc6e0ed8fdae4736ebe7564189741d5b910433f07c21fc12a94d8","src/unix/linux_like/linux/gnu/b64/mips64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/gnu/b64/mips64/mod.rs":"73532be4b5775acf9524c77feeefe1f6d1936ceffef908d01dd2586986520f2d","src/unix/linux_like/linux/gnu/b64/mod.rs":"6a160ef25439c4fecdb0e3bd0b818742263c791364da874d4febd3aa644ec8e2","src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs":"e29c4868bbecfa4a6cd8a2ad06193f3bbc78a468cc1dc9df83f002f1268130d9","src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs":"a90c2641616c620e9d1fea87695ce046e14f9da2282bb93f761eeb4077c74741","src/unix/linux_like/linux/gnu/b64/riscv64/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs":"dec86883731f7b8419bff35b125b40eefc927090c1510f6daf931726f7965c0b","src/unix/linux_like/linux/gnu/b64/s390x.rs":"1ea9e39432ce6bf68779d33546dacd7d39477a9f8fc3da4f4f339e4538cb74c3","src/unix/linux_like/linux/gnu/b64/sparc64/align.rs":"e29c4868bbecfa4a6cd8a2ad06193f3bbc78a468cc1dc9df83f002f1268130d9","src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs":"bed381c44cec2a5b50125f7e548ab487d4c829006c971d152a611b7141760052","src/unix/linux_like/linux/gnu/b64/x86_64/align.rs":"62e822478356db4a73b6bbd1b36d825b893939ab4b308ec11b0578bcc4b49769","src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs":"332846e4a5920d7e6b05df0448a2333c5dd00fb27cb33654648f507ee89dbec5","src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs":"38f74ce15d9662ce4818815a2b87be1618d5e45f190f7e4db84ff3285b4421fb","src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs":"b20218a11364a6dec87f96d6c0d8b19e660697ab09ad5ee0e9b3a9dafedaaebb","src/unix/linux_like/linux/gnu/mod.rs":"78ce3d4fe6dcb9dc90210526023a1421502e341a7c39d769fd385001c1eb3b8d","src/unix/linux_like/linux/gnu/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/mod.rs":"efdc36b0e95a87b45093756e766cded003bac6fbd9493cd1af158f7476b2d3e2","src/unix/linux_like/linux/musl/b32/arm/align.rs":"3e8ac052c1043764776b54c93ba4260e061df998631737a897d9d47d54f7b80c","src/unix/linux_like/linux/musl/b32/arm/mod.rs":"af10147d7c3661751750a58ffad089d5d18d180cd18303c653aef126c07ccd91","src/unix/linux_like/linux/musl/b32/hexagon.rs":"d079cab42529f7dab699334d43168c74ff4aa0282f11040a8b7d274b65767a7a","src/unix/linux_like/linux/musl/b32/mips/align.rs":"429fb5e005cb7143602d430098b6ebfb7d360685b194f333dfd587472ae954ee","src/unix/linux_like/linux/musl/b32/mips/mod.rs":"e44043766f7cd26de7ffa4232654afb6feb03e58dbd5890717970887bd003151","src/unix/linux_like/linux/musl/b32/mod.rs":"31677597fd9544c4b1ec1477628288f6273fabbc06e38f33da862ad55f019ce1","src/unix/linux_like/linux/musl/b32/powerpc.rs":"3dae56a4e7789bcc5314e419fea5e4b2495367b4f1a49d1c9477c60225d65eef","src/unix/linux_like/linux/musl/b32/riscv32/align.rs":"efd2accf33b87de7c7547903359a5da896edc33cd6c719552c7474b60d4a5d48","src/unix/linux_like/linux/musl/b32/riscv32/mod.rs":"3ee845d272f91a1908d5f421d7c353e1f14681bbdfef64410e408f4c14365a91","src/unix/linux_like/linux/musl/b32/x86/align.rs":"08e77fbd7435d7dec2ff56932433bece3f02e47ce810f89004a275a86d39cbe1","src/unix/linux_like/linux/musl/b32/x86/mod.rs":"f2b53ae0034c833244b7cdb8c670349bf8272a03abf04152eba65cf62810484d","src/unix/linux_like/linux/musl/b64/aarch64/align.rs":"6ba32725d24d7d8e6aa111f3b57aafa318f83b606abe96561329151829821133","src/unix/linux_like/linux/musl/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/linux/musl/b64/aarch64/mod.rs":"45ce6897afcc960267bb7505702b639daf94dc69428a213bf1aefd367ca32adc","src/unix/linux_like/linux/musl/b64/loongarch64/align.rs":"060aa33cc737966c691aab8511c5c5729e551458ce18d0e284e0d45f39beeb60","src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs":"3d9ef92e682a1789544a2bd20cad5a5623db9d7d9f5d0a3692bb0230af034165","src/unix/linux_like/linux/musl/b64/mips64.rs":"a968ef9c54fa22293085f318c8472c1754482df92cc500568dc33bd807d71ea6","src/unix/linux_like/linux/musl/b64/mod.rs":"20ceaf90a03c24a2eb154a5dffbfc9a538348404db5b554a3d8126021ba45509","src/unix/linux_like/linux/musl/b64/powerpc64.rs":"140e579800a67315f4cb8a42b22aa8157eae34ffe626e77e421b43c53c23b34d","src/unix/linux_like/linux/musl/b64/riscv64/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/musl/b64/riscv64/mod.rs":"c5944526d7e19cd43e9d14d119a1d98f8780db7ecbcc79e69d7b9348e596b520","src/unix/linux_like/linux/musl/b64/s390x.rs":"8557b3477ca8cefef7fce764a3c25441929a54e50ead4091f6f7823c427cd728","src/unix/linux_like/linux/musl/b64/x86_64/align.rs":"77309276ad7a42cbe59ca381f23590b7a143aded05555b34a5b307b808cbca6e","src/unix/linux_like/linux/musl/b64/x86_64/mod.rs":"a91c4f18027c9958037f78ae48f6352d23cb4e6f2995b2cc8de7dce0e5759470","src/unix/linux_like/linux/musl/lfs64.rs":"3e4fb381f3a0756520bde0f1692d4fa45e4ae8133bf7d7c64b0e3fdd512f235f","src/unix/linux_like/linux/musl/mod.rs":"ac8ccdb25116ecdfa44eacaffefb21329aa286713c44a12dbe2c1614f2a2748a","src/unix/linux_like/linux/no_align.rs":"62cdca0e011937aaf09a51ca86d9f0ee0fdb05f61ec3c058e6a5d5fa6357d784","src/unix/linux_like/linux/non_exhaustive.rs":"181a05bf94fdb911db83ce793b993bd6548a4115b306a7ef3c10f745a8fea3e9","src/unix/linux_like/linux/uclibc/align.rs":"9ed16138d8e439bd90930845a65eafa7ebd67366e6bf633936d44014f6e4c959","src/unix/linux_like/linux/uclibc/arm/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/uclibc/arm/mod.rs":"50288ff9e411ab0966da24838f2c2a5618021bc19c422a04f577b2979ef4081e","src/unix/linux_like/linux/uclibc/arm/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/uclibc/mips/mips32/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs":"d0c4434e2bf813372c418a8f516c706cdccc9f7be2f0921b2207b0afdb66fe81","src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/uclibc/mips/mips64/align.rs":"a7bdcb18a37a2d91e64d5fad83ea3edc78f5412adb28f77ab077dbb26dd08b2d","src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs":"3f38ee6a4690b9d7594be20d216467a34d955f7653c2c8ce1e6147daeb53f1e0","src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs":"4a18e3875698c85229599225ac3401a2a40da87e77b2ad4ef47c6fcd5a24ed30","src/unix/linux_like/linux/uclibc/mips/mod.rs":"a048fce1c2d9b1ad57305642e8ad05ca0f0c7e4753267a2e2d6b4fee5db3b072","src/unix/linux_like/linux/uclibc/mod.rs":"193a03fa4aa5345394e39d2115c9427e806c9f28b0fde685719119e1c90ca08a","src/unix/linux_like/linux/uclibc/no_align.rs":"3f28637046524618adaa1012e26cb7ffe94b9396e6b518cccdc69d59f274d709","src/unix/linux_like/linux/uclibc/x86_64/l4re.rs":"8485b9182b7c67f7344fab377e7cc2a72afefd9ab63837c860514abba9728d76","src/unix/linux_like/linux/uclibc/x86_64/mod.rs":"196d03affbefb85716937c15904831e731eb222ee906e05e42102d639a8152ea","src/unix/linux_like/linux/uclibc/x86_64/other.rs":"42c3f71e58cabba373f6a55a623f3c31b85049eb64824c09c2b082b3b2d6a0a8","src/unix/linux_like/mod.rs":"863f628cbaa864911ffebc58e9fb788b6c6a9651955fc401ac1f40f20eb62505","src/unix/mod.rs":"e3a98b62b83a1e42675e968c05b2281d612a66cdc09c4e3b4c16921c31a9e254","src/unix/newlib/aarch64/mod.rs":"964c096288da836b53c0c71d7f3a97048d177da220a69314c5ce93ba330d72af","src/unix/newlib/align.rs":"28aaf87fafbc6b312622719d472d8cf65f9e5467d15339df5f73e66d8502b28a","src/unix/newlib/arm/mod.rs":"cf754f8b1197489fca01e881a4b4b146e814998e4b365f116fa1a102c00e6a4e","src/unix/newlib/espidf/mod.rs":"689e29a9fff5a263e5ab8410d0a8919f77fa64aa12f4d71f71085a6f07f19f67","src/unix/newlib/generic.rs":"5f0b5d07ddb5a5d60580f9561fdb05e9218d9751d4068c4aadad2ba6b950aabf","src/unix/newlib/horizon/mod.rs":"3a521d22bf932fc01c1d26d1f9bff20f11b1855b03c8236a8eb18310f6cab5a8","src/unix/newlib/mod.rs":"e5d5faf27a6336b9f1c02b8726427801d906a14dae766852b4e85c1a92df06c8","src/unix/newlib/no_align.rs":"e0743b2179495a9514bc3a4d1781e492878c4ec834ee0085d0891dd1712e82fb","src/unix/newlib/powerpc/mod.rs":"cc9e188711b9bf614323ad6c48e0d2e1a1ecc5d3bc64961ba451f29c6c22d2d8","src/unix/newlib/vita/mod.rs":"ff1caf74bb0696fe15d60dbac598db4520cd538aa0f5989713d97d008eee6ad8","src/unix/no_align.rs":"c06e95373b9088266e0b14bba0954eef95f93fb2b01d951855e382d22de78e53","src/unix/nto/aarch64.rs":"4709c9afdc8d583be876598e7c238499ee3e8da5bd2baa614d9c7dd414851555","src/unix/nto/mod.rs":"07268897fc8810f2fed22ab56f87757f71c73ba401abd848bccca6b183a13b02","src/unix/nto/neutrino.rs":"799bff4ab01a6424db6c5a2b76aa5679826d41495f9d13c63485bf13bc80026b","src/unix/nto/x86_64.rs":"a3e18e93c2999da1cd7a6f748a4b60c07aefb73d8ea2aafec19a84cfb040bc8e","src/unix/redox/mod.rs":"e75a319975472fe9e0873244fb07c5d2004672b7a4cf7a3cb01532d6d394cb8a","src/unix/solarish/compat.rs":"00f1ee3faec9da69204e42f025f6735dd13d894071a154425dcc43ecbdd06e7f","src/unix/solarish/illumos.rs":"cd93c2d84722bbf9933a92842a8998eb0b2afc962f50bc2546ad127b82809fa7","src/unix/solarish/mod.rs":"3e550d95419169febf094c425451ca86b12821fa17839b4b0ba7520b145a5820","src/unix/solarish/solaris.rs":"41b350a89ddf01cd12a10f93640f92be53be0b0d976021cdc08da17bf3e72edf","src/unix/solarish/x86.rs":"e86e806df0caed72765040eaa2f3c883198d1aa91508540adf9b7008c77f522e","src/unix/solarish/x86_64.rs":"ec2b01f194eb8a6a27133c57681da195a949e03098f3ea1e847227a9c09ef5fc","src/unix/solarish/x86_common.rs":"ac869d9c3c95645c22460468391eb1982023c3a8e02b9e06a72e3aef3d5f1eac","src/vxworks/aarch64.rs":"98f0afdc511cd02557e506c21fed6737585490a1dce7a9d4941d08c437762b99","src/vxworks/arm.rs":"acb7968ce99fe3f4abdf39d98f8133d21a4fba435b8ef7084777cb181d788e88","src/vxworks/mod.rs":"4105a2e6a6c9908fc1f2a770ede052bb0d6a5d9d49e32d815f557081efc49860","src/vxworks/powerpc.rs":"acb7968ce99fe3f4abdf39d98f8133d21a4fba435b8ef7084777cb181d788e88","src/vxworks/powerpc64.rs":"98f0afdc511cd02557e506c21fed6737585490a1dce7a9d4941d08c437762b99","src/vxworks/x86.rs":"552f007f38317620b23889cb7c49d1d115841252439060122f52f434fbc6e5ba","src/vxworks/x86_64.rs":"018d92be3ad628a129eff9f2f5dfbc0883d8b8e5f2fa917b900a7f98ed6b514a","src/wasi.rs":"d4147353537d7556076ff1a1c4cb96cc2dae9416a5d176ba8a077ad55ab7ec18","src/windows/gnu/align.rs":"b2c13ec1b9f3b39a75c452c80c951dff9d0215e31d77e883b4502afb31794647","src/windows/gnu/mod.rs":"3c8c7edb7cdf5d0c44af936db2a94869585c69dfabeef30571b4f4e38375767a","src/windows/mod.rs":"9fdc5e1c62c441abef7bc62a7343efb2041edc24db9ac0efc0f74df55b69e249","src/windows/msvc/mod.rs":"c068271e00fca6b62bc4bf44bcf142cfc38caeded9b6c4e01d1ceef3ccf986f4","src/xous.rs":"eb0675f25ba01f73072d2b70907fb8abb1148facefe5a20756c49250f3d65fae","tests/const_fn.rs":"cb75a1f0864f926aebe79118fc34d51a0d1ade2c20a394e7774c7e545f21f1f4"},"package":"97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/libc/CONTRIBUTING.md 43.0.0-1ubuntu1/rust-vendor/libc/CONTRIBUTING.md
--- 43.0.0-1/rust-vendor/libc/CONTRIBUTING.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/CONTRIBUTING.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,100 @@
+# Contributing to `libc`
+
+Welcome! If you are reading this document, it means you are interested in contributing
+to the `libc` crate.
+
+## v0.2 changes
+
+If you want to add your changes to v0.2, please submit them to the `libc-0.2` branch.
+If you want to add any breaking changes, it should be submitted to the main branch,
+which has changes for v0.3.
+We will support and make a new release for v0.2 until we make the first release of v0.3.
+
+## Adding an API
+
+Want to use an API which currently isn't bound in `libc`? It's quite easy to add
+one!
+
+The internal structure of this crate is designed to minimize the number of
+`#[cfg]` attributes in order to easily be able to add new items which apply
+to all platforms in the future. As a result, the crate is organized
+hierarchically based on platform. Each module has a number of `#[cfg]`'d
+children, but only one is ever actually compiled. Each module then reexports all
+the contents of its children.
+
+This means that for each platform that libc supports, the path from a
+leaf module to the root will contain all bindings for the platform in question.
+Consequently, this indicates where an API should be added! Adding an API at a
+particular level in the hierarchy means that it is supported on all the child
+platforms of that level. For example, when adding a Unix API it should be added
+to `src/unix/mod.rs`, but when adding a Linux-only API it should be added to
+`src/unix/linux_like/linux/mod.rs`.
+
+If you're not 100% sure at what level of the hierarchy an API should be added
+at, fear not! This crate has CI support which tests any binding against all
+platforms supported, so you'll see failures if an API is added at the wrong
+level or has different signatures across platforms.
+
+New symbol(s) (i.e. functions, constants etc.) should also be added to the
+symbols list(s) found in the `libc-test/semver` directory. These lists keep
+track of what symbols are public in the libc crate and ensures they remain
+available between changes to the crate. If the new symbol(s) are available on
+all supported Unixes it should be added to `unix.txt` list<sup>1</sup>,
+otherwise they should be added to the OS specific list(s).
+
+With that in mind, the steps for adding a new API are:
+
+1. Determine where in the module hierarchy your API should be added.
+2. Add the API, including adding new symbol(s) to the semver lists.
+3. Send a PR to this repo.
+4. Wait for CI to pass, fixing errors.
+5. Wait for a merge!
+
+<sup>1</sup>: Note that this list has nothing to do with any Unix or Posix
+standard, it's just a list shared between all OSs that declare `#[cfg(unix)]`.
+
+## Test before you commit
+
+We have two automated tests running on [GitHub Actions](https://github.com/rust-lang/libc/actions):
+
+1. [`libc-test`](https://github.com/gnzlbg/ctest)
+  - `cd libc-test && cargo test`
+  - Use the `skip_*()` functions in `build.rs` if you really need a workaround.
+2. Style checker
+  - [`sh ci/style.sh`](https://github.com/rust-lang/libc/blob/main/ci/style.sh)
+
+## Breaking change policy
+
+Sometimes an upstream adds a breaking change to their API e.g. removing outdated items,
+changing the type signature, etc. And we probably should follow that change to build the
+`libc` crate successfully. It's annoying to do the equivalent of semver-major versioning
+for each such change. Instead, we mark the item as deprecated and do the actual change
+after a certain period. The steps are:
+
+1. Add `#[deprecated(since = "", note="")]` attribute to the item.
+  - The `since` field should have a next version of `libc`
+    (e.g., if the current version is `0.2.1`, it should be `0.2.2`).
+  - The `note` field should have a reason to deprecate and a tracking issue to call for comments
+    (e.g., "We consider removing this as the upstream removed it.
+    If you're using it, please comment on #XXX").
+2. If we don't see any concerns for a while, do the change actually.
+
+## Supported target policy
+
+When Rust removes a support for a target, the libc crate also may remove the support anytime.
+
+## Releasing your change to crates.io
+
+Now that you've done the amazing job of landing your new API or your new
+platform in this crate, the next step is to get that sweet, sweet usage from
+crates.io! The only next step is to bump the version of libc and then publish
+it. If you'd like to get a release out ASAP you can follow these steps:
+
+1. Increment the patch version number in `Cargo.toml` and `libc-test/Cargo.toml`.
+1. Send a PR to this repository. It should [look like this][example-pr], but it'd
+   also be nice to fill out the description with a small rationale for the
+   release (any rationale is ok though!).
+1. Once merged, the release will be tagged and published by one of the libc crate
+   maintainers.
+
+[example-pr]: https://github.com/rust-lang/libc/pull/2120
diff -pruN 43.0.0-1/rust-vendor/libc/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/libc/Cargo.toml
--- 43.0.0-1/rust-vendor/libc/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,187 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+name = "libc"
+version = "0.2.155"
+authors = ["The Rust Project Developers"]
+build = "build.rs"
+exclude = [
+    "/ci/*",
+    "/.github/*",
+    "/.cirrus.yml",
+    "/triagebot.toml",
+]
+autobins = false
+autoexamples = false
+autotests = false
+autobenches = false
+description = """
+Raw FFI bindings to platform libraries like libc.
+"""
+homepage = "https://github.com/rust-lang/libc"
+documentation = "https://docs.rs/libc/"
+readme = "README.md"
+keywords = [
+    "libc",
+    "ffi",
+    "bindings",
+    "operating",
+    "system",
+]
+categories = [
+    "external-ffi-bindings",
+    "no-std",
+    "os",
+]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/rust-lang/libc"
+
+[package.metadata.docs.rs]
+cargo-args = ["-Zbuild-std=core"]
+default-target = "x86_64-unknown-linux-gnu"
+features = [
+    "const-extern-fn",
+    "extra_traits",
+]
+targets = [
+    "aarch64-apple-darwin",
+    "aarch64-apple-ios",
+    "aarch64-linux-android",
+    "aarch64-pc-windows-msvc",
+    "aarch64-unknown-freebsd",
+    "aarch64-unknown-fuchsia",
+    "aarch64-unknown-hermit",
+    "aarch64-unknown-linux-gnu",
+    "aarch64-unknown-linux-musl",
+    "aarch64-unknown-netbsd",
+    "aarch64-unknown-openbsd",
+    "aarch64-wrs-vxworks",
+    "arm-linux-androideabi",
+    "arm-unknown-linux-gnueabi",
+    "arm-unknown-linux-gnueabihf",
+    "arm-unknown-linux-musleabi",
+    "arm-unknown-linux-musleabihf",
+    "armebv7r-none-eabi",
+    "armebv7r-none-eabihf",
+    "armv5te-unknown-linux-gnueabi",
+    "armv5te-unknown-linux-musleabi",
+    "armv7-linux-androideabi",
+    "armv7-unknown-linux-gnueabihf",
+    "armv7-unknown-linux-musleabihf",
+    "armv7-wrs-vxworks-eabihf",
+    "armv7r-none-eabi",
+    "armv7r-none-eabihf",
+    "hexagon-unknown-linux-musl",
+    "i586-pc-windows-msvc",
+    "i586-unknown-linux-gnu",
+    "i586-unknown-linux-musl",
+    "i686-linux-android",
+    "i686-pc-windows-gnu",
+    "i686-pc-windows-msvc",
+    "i686-pc-windows-msvc",
+    "i686-unknown-freebsd",
+    "i686-unknown-haiku",
+    "i686-unknown-linux-gnu",
+    "i686-unknown-linux-musl",
+    "i686-unknown-netbsd",
+    "i686-unknown-openbsd",
+    "i686-wrs-vxworks",
+    "mips-unknown-linux-gnu",
+    "mips-unknown-linux-musl",
+    "mips64-unknown-linux-gnuabi64",
+    "mips64-unknown-linux-muslabi64",
+    "mips64el-unknown-linux-gnuabi64",
+    "mips64el-unknown-linux-muslabi64",
+    "mipsel-sony-psp",
+    "mipsel-unknown-linux-gnu",
+    "mipsel-unknown-linux-musl",
+    "nvptx64-nvidia-cuda",
+    "powerpc-unknown-linux-gnu",
+    "powerpc-unknown-linux-gnuspe",
+    "powerpc-unknown-netbsd",
+    "powerpc-wrs-vxworks",
+    "powerpc-wrs-vxworks-spe",
+    "powerpc64-unknown-freebsd",
+    "powerpc64-unknown-linux-gnu",
+    "powerpc64-wrs-vxworks",
+    "powerpc64le-unknown-linux-gnu",
+    "riscv32gc-unknown-linux-gnu",
+    "riscv32i-unknown-none-elf",
+    "riscv32imac-unknown-none-elf",
+    "riscv32imc-unknown-none-elf",
+    "riscv64gc-unknown-freebsd",
+    "riscv64gc-unknown-hermit",
+    "riscv64gc-unknown-linux-gnu",
+    "riscv64gc-unknown-linux-musl",
+    "riscv64gc-unknown-none-elf",
+    "riscv64imac-unknown-none-elf",
+    "s390x-unknown-linux-gnu",
+    "s390x-unknown-linux-musl",
+    "sparc-unknown-linux-gnu",
+    "sparc64-unknown-linux-gnu",
+    "sparc64-unknown-netbsd",
+    "sparcv9-sun-solaris",
+    "thumbv6m-none-eabi",
+    "thumbv7em-none-eabi",
+    "thumbv7em-none-eabihf",
+    "thumbv7m-none-eabi",
+    "thumbv7neon-linux-androideabi",
+    "thumbv7neon-unknown-linux-gnueabihf",
+    "wasm32-unknown-emscripten",
+    "wasm32-unknown-unknown",
+    "wasm32-wasi",
+    "x86_64-apple-darwin",
+    "x86_64-apple-ios",
+    "x86_64-fortanix-unknown-sgx",
+    "x86_64-linux-android",
+    "x86_64-pc-solaris",
+    "x86_64-pc-windows-gnu",
+    "x86_64-pc-windows-msvc",
+    "x86_64-unknown-dragonfly",
+    "x86_64-unknown-freebsd",
+    "x86_64-unknown-fuchsia",
+    "x86_64-unknown-haiku",
+    "x86_64-unknown-hermit",
+    "x86_64-unknown-illumos",
+    "x86_64-unknown-l4re-uclibc",
+    "x86_64-unknown-linux-gnu",
+    "x86_64-unknown-linux-gnux32",
+    "x86_64-unknown-linux-musl",
+    "x86_64-unknown-netbsd",
+    "x86_64-unknown-openbsd",
+    "x86_64-unknown-redox",
+    "x86_64-wrs-vxworks",
+]
+
+[lib]
+name = "libc"
+path = "src/lib.rs"
+
+[[test]]
+name = "const_fn"
+path = "tests/const_fn.rs"
+
+[dependencies.rustc-std-workspace-core]
+version = "1.0.0"
+optional = true
+
+[features]
+align = []
+const-extern-fn = []
+default = ["std"]
+extra_traits = []
+rustc-dep-of-std = [
+    "align",
+    "rustc-std-workspace-core",
+]
+std = []
+use_std = ["std"]
diff -pruN 43.0.0-1/rust-vendor/libc/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/libc/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/libc/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,176 @@
+                              Apache License
+                        Version 2.0, January 2004
+                     http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+   "License" shall mean the terms and conditions for use, reproduction,
+   and distribution as defined by Sections 1 through 9 of this document.
+
+   "Licensor" shall mean the copyright owner or entity authorized by
+   the copyright owner that is granting the License.
+
+   "Legal Entity" shall mean the union of the acting entity and all
+   other entities that control, are controlled by, or are under common
+   control with that entity. For the purposes of this definition,
+   "control" means (i) the power, direct or indirect, to cause the
+   direction or management of such entity, whether by contract or
+   otherwise, or (ii) ownership of fifty percent (50%) or more of the
+   outstanding shares, or (iii) beneficial ownership of such entity.
+
+   "You" (or "Your") shall mean an individual or Legal Entity
+   exercising permissions granted by this License.
+
+   "Source" form shall mean the preferred form for making modifications,
+   including but not limited to software source code, documentation
+   source, and configuration files.
+
+   "Object" form shall mean any form resulting from mechanical
+   transformation or translation of a Source form, including but
+   not limited to compiled object code, generated documentation,
+   and conversions to other media types.
+
+   "Work" shall mean the work of authorship, whether in Source or
+   Object form, made available under the License, as indicated by a
+   copyright notice that is included in or attached to the work
+   (an example is provided in the Appendix below).
+
+   "Derivative Works" shall mean any work, whether in Source or Object
+   form, that is based on (or derived from) the Work and for which the
+   editorial revisions, annotations, elaborations, or other modifications
+   represent, as a whole, an original work of authorship. For the purposes
+   of this License, Derivative Works shall not include works that remain
+   separable from, or merely link (or bind by name) to the interfaces of,
+   the Work and Derivative Works thereof.
+
+   "Contribution" shall mean any work of authorship, including
+   the original version of the Work and any modifications or additions
+   to that Work or Derivative Works thereof, that is intentionally
+   submitted to Licensor for inclusion in the Work by the copyright owner
+   or by an individual or Legal Entity authorized to submit on behalf of
+   the copyright owner. For the purposes of this definition, "submitted"
+   means any form of electronic, verbal, or written communication sent
+   to the Licensor or its representatives, including but not limited to
+   communication on electronic mailing lists, source code control systems,
+   and issue tracking systems that are managed by, or on behalf of, the
+   Licensor for the purpose of discussing and improving the Work, but
+   excluding communication that is conspicuously marked or otherwise
+   designated in writing by the copyright owner as "Not a Contribution."
+
+   "Contributor" shall mean Licensor and any individual or Legal Entity
+   on behalf of whom a Contribution has been received by Licensor and
+   subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   copyright license to reproduce, prepare Derivative Works of,
+   publicly display, publicly perform, sublicense, and distribute the
+   Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   (except as stated in this section) patent license to make, have made,
+   use, offer to sell, sell, import, and otherwise transfer the Work,
+   where such license applies only to those patent claims licensable
+   by such Contributor that are necessarily infringed by their
+   Contribution(s) alone or by combination of their Contribution(s)
+   with the Work to which such Contribution(s) was submitted. If You
+   institute patent litigation against any entity (including a
+   cross-claim or counterclaim in a lawsuit) alleging that the Work
+   or a Contribution incorporated within the Work constitutes direct
+   or contributory patent infringement, then any patent licenses
+   granted to You under this License for that Work shall terminate
+   as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+   Work or Derivative Works thereof in any medium, with or without
+   modifications, and in Source or Object form, provided that You
+   meet the following conditions:
+
+   (a) You must give any other recipients of the Work or
+       Derivative Works a copy of this License; and
+
+   (b) You must cause any modified files to carry prominent notices
+       stating that You changed the files; and
+
+   (c) You must retain, in the Source form of any Derivative Works
+       that You distribute, all copyright, patent, trademark, and
+       attribution notices from the Source form of the Work,
+       excluding those notices that do not pertain to any part of
+       the Derivative Works; and
+
+   (d) If the Work includes a "NOTICE" text file as part of its
+       distribution, then any Derivative Works that You distribute must
+       include a readable copy of the attribution notices contained
+       within such NOTICE file, excluding those notices that do not
+       pertain to any part of the Derivative Works, in at least one
+       of the following places: within a NOTICE text file distributed
+       as part of the Derivative Works; within the Source form or
+       documentation, if provided along with the Derivative Works; or,
+       within a display generated by the Derivative Works, if and
+       wherever such third-party notices normally appear. The contents
+       of the NOTICE file are for informational purposes only and
+       do not modify the License. You may add Your own attribution
+       notices within Derivative Works that You distribute, alongside
+       or as an addendum to the NOTICE text from the Work, provided
+       that such additional attribution notices cannot be construed
+       as modifying the License.
+
+   You may add Your own copyright statement to Your modifications and
+   may provide additional or different license terms and conditions
+   for use, reproduction, or distribution of Your modifications, or
+   for any such Derivative Works as a whole, provided Your use,
+   reproduction, and distribution of the Work otherwise complies with
+   the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+   any Contribution intentionally submitted for inclusion in the Work
+   by You to the Licensor shall be under the terms and conditions of
+   this License, without any additional terms or conditions.
+   Notwithstanding the above, nothing herein shall supersede or modify
+   the terms of any separate license agreement you may have executed
+   with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+   names, trademarks, service marks, or product names of the Licensor,
+   except as required for reasonable and customary use in describing the
+   origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+   agreed to in writing, Licensor provides the Work (and each
+   Contributor provides its Contributions) on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+   implied, including, without limitation, any warranties or conditions
+   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+   PARTICULAR PURPOSE. You are solely responsible for determining the
+   appropriateness of using or redistributing the Work and assume any
+   risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+   whether in tort (including negligence), contract, or otherwise,
+   unless required by applicable law (such as deliberate and grossly
+   negligent acts) or agreed to in writing, shall any Contributor be
+   liable to You for damages, including any direct, indirect, special,
+   incidental, or consequential damages of any character arising as a
+   result of this License or out of the use or inability to use the
+   Work (including but not limited to damages for loss of goodwill,
+   work stoppage, computer failure or malfunction, or any and all
+   other commercial damages or losses), even if such Contributor
+   has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+   the Work or Derivative Works thereof, You may choose to offer,
+   and charge a fee for, acceptance of support, warranty, indemnity,
+   or other liability obligations and/or rights consistent with this
+   License. However, in accepting such obligations, You may act only
+   on Your own behalf and on Your sole responsibility, not on behalf
+   of any other Contributor, and only if You agree to indemnify,
+   defend, and hold each Contributor harmless for any liability
+   incurred by, or claims asserted against, such Contributor by reason
+   of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
diff -pruN 43.0.0-1/rust-vendor/libc/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/libc/LICENSE-MIT
--- 43.0.0-1/rust-vendor/libc/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,25 @@
+Copyright (c) 2014-2020 The Rust Project Developers
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/libc/README.md 43.0.0-1ubuntu1/rust-vendor/libc/README.md
--- 43.0.0-1/rust-vendor/libc/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,118 @@
+# libc - Raw FFI bindings to platforms' system libraries
+
+[![GHA Status]][GitHub Actions] [![Cirrus CI Status]][Cirrus CI] [![Latest Version]][crates.io] [![Documentation]][docs.rs] ![License]
+
+`libc` provides all of the definitions necessary to easily interoperate with C
+code (or "C-like" code) on each of the platforms that Rust supports. This
+includes type definitions (e.g. `c_int`), constants (e.g. `EINVAL`) as well as
+function headers (e.g. `malloc`).
+
+This crate exports all underlying platform types, functions, and constants under
+the crate root, so all items are accessible as `libc::foo`. The types and values
+of all the exported APIs match the platform that libc is compiled for.
+
+More detailed information about the design of this library can be found in its
+[associated RFC][rfc].
+
+[rfc]: https://github.com/rust-lang/rfcs/blob/HEAD/text/1291-promote-libc.md
+
+## v0.3 Roadmap
+
+The main branch is now for v0.3 which has some breaking changes.
+
+For v0.2, please submit PRs to the `libc-0.2` branch instead.
+We will stop making new v0.2 releases once we release v0.3 on crates.io.
+
+See the [tracking issue](https://github.com/rust-lang/libc/issues/3248) for details.
+
+## Usage
+
+Add the following to your `Cargo.toml`:
+
+```toml
+[dependencies]
+libc = "0.2"
+```
+
+## Features
+
+* `std`: by default `libc` links to the standard library. Disable this
+  feature to remove this dependency and be able to use `libc` in `#![no_std]`
+  crates.
+
+* `extra_traits`: all `struct`s implemented in `libc` are `Copy` and `Clone`.
+  This feature derives `Debug`, `Eq`, `Hash`, and `PartialEq`.
+
+* `const-extern-fn`: Changes some `extern fn`s into `const extern fn`s.
+  If you use Rust >= 1.62, this feature is implicitly enabled.
+  Otherwise it requires a nightly rustc.
+
+* **deprecated**: `use_std` is deprecated, and is equivalent to `std`.
+
+## Rust version support
+
+The minimum supported Rust toolchain version is currently **Rust 1.13.0**.
+(libc does not currently have any policy regarding changes to the minimum
+supported Rust version; such policy is a work in progress.) APIs requiring
+newer Rust features are only available on newer Rust toolchains:
+
+| Feature              | Version |
+|----------------------|---------|
+| `union`              |  1.19.0 |
+| `const mem::size_of` |  1.24.0 |
+| `repr(align)`        |  1.25.0 |
+| `extra_traits`       |  1.25.0 |
+| `core::ffi::c_void`  |  1.30.0 |
+| `repr(packed(N))`    |  1.33.0 |
+| `cfg(target_vendor)` |  1.33.0 |
+| `const-extern-fn`    |  1.62.0 |
+
+## Platform support
+
+You can see the platform(target)-specific docs on [docs.rs], select a platform you want to see.
+
+See
+[`ci/build.sh`](https://github.com/rust-lang/libc/blob/HEAD/ci/build.sh)
+for the platforms on which `libc` is guaranteed to build for each Rust
+toolchain. The test-matrix at [GitHub Actions] and [Cirrus CI] show the
+platforms in which `libc` tests are run.
+
+<div class="platform_docs"></div>
+
+## License
+
+This project is licensed under either of
+
+* [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
+  ([LICENSE-APACHE](https://github.com/rust-lang/libc/blob/HEAD/LICENSE-APACHE))
+
+* [MIT License](https://opensource.org/licenses/MIT)
+  ([LICENSE-MIT](https://github.com/rust-lang/libc/blob/HEAD/LICENSE-MIT))
+
+at your option.
+
+## Contributing
+
+We welcome all people who want to contribute. Please see the [contributing
+instructions] for more information.
+
+[contributing instructions]: https://github.com/rust-lang/libc/blob/HEAD/CONTRIBUTING.md
+
+Contributions in any form (issues, pull requests, etc.) to this project
+must adhere to Rust's [Code of Conduct].
+
+[Code of Conduct]: https://www.rust-lang.org/policies/code-of-conduct
+
+Unless you explicitly state otherwise, any contribution intentionally submitted
+for inclusion in `libc` by you, as defined in the Apache-2.0 license, shall be
+dual licensed as above, without any additional terms or conditions.
+
+[GitHub Actions]: https://github.com/rust-lang/libc/actions
+[GHA Status]: https://github.com/rust-lang/libc/workflows/CI/badge.svg
+[Cirrus CI]: https://cirrus-ci.com/github/rust-lang/libc
+[Cirrus CI Status]: https://api.cirrus-ci.com/github/rust-lang/libc.svg
+[crates.io]: https://crates.io/crates/libc
+[Latest Version]: https://img.shields.io/crates/v/libc.svg
+[Documentation]: https://docs.rs/libc/badge.svg
+[docs.rs]: https://docs.rs/libc
+[License]: https://img.shields.io/crates/l/libc.svg
diff -pruN 43.0.0-1/rust-vendor/libc/build.rs 43.0.0-1ubuntu1/rust-vendor/libc/build.rs
--- 43.0.0-1/rust-vendor/libc/build.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/build.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,298 @@
+use std::env;
+use std::process::Command;
+use std::str;
+use std::string::String;
+
+// List of cfgs this build script is allowed to set. The list is needed to support check-cfg, as we
+// need to know all the possible cfgs that this script will set. If you need to set another cfg
+// make sure to add it to this list as well.
+const ALLOWED_CFGS: &'static [&'static str] = &[
+    "emscripten_new_stat_abi",
+    "espidf_time64",
+    "freebsd10",
+    "freebsd11",
+    "freebsd12",
+    "freebsd13",
+    "freebsd14",
+    "freebsd15",
+    "libc_align",
+    "libc_cfg_target_vendor",
+    "libc_const_extern_fn",
+    "libc_const_extern_fn_unstable",
+    "libc_const_size_of",
+    "libc_core_cvoid",
+    "libc_deny_warnings",
+    "libc_int128",
+    "libc_long_array",
+    "libc_non_exhaustive",
+    "libc_packedN",
+    "libc_priv_mod_use",
+    "libc_ptr_addr_of",
+    "libc_thread_local",
+    "libc_underscore_const_names",
+    "libc_union",
+];
+
+// Extra values to allow for check-cfg.
+const CHECK_CFG_EXTRA: &'static [(&'static str, &'static [&'static str])] = &[
+    ("target_os", &["switch", "aix", "ohos", "hurd", "visionos"]),
+    ("target_env", &["illumos", "wasi", "aix", "ohos"]),
+    (
+        "target_arch",
+        &["loongarch64", "mips32r6", "mips64r6", "csky"],
+    ),
+];
+
+fn main() {
+    // Avoid unnecessary re-building.
+    println!("cargo:rerun-if-changed=build.rs");
+
+    let (rustc_minor_ver, is_nightly) = rustc_minor_nightly();
+    let rustc_dep_of_std = env::var("CARGO_FEATURE_RUSTC_DEP_OF_STD").is_ok();
+    let align_cargo_feature = env::var("CARGO_FEATURE_ALIGN").is_ok();
+    let const_extern_fn_cargo_feature = env::var("CARGO_FEATURE_CONST_EXTERN_FN").is_ok();
+    let libc_ci = env::var("LIBC_CI").is_ok();
+    let libc_check_cfg = env::var("LIBC_CHECK_CFG").is_ok() || rustc_minor_ver >= 80;
+
+    if env::var("CARGO_FEATURE_USE_STD").is_ok() {
+        println!(
+            "cargo:warning=\"libc's use_std cargo feature is deprecated since libc 0.2.55; \
+             please consider using the `std` cargo feature instead\""
+        );
+    }
+
+    // The ABI of libc used by std is backward compatible with FreeBSD 12.
+    // The ABI of libc from crates.io is backward compatible with FreeBSD 11.
+    //
+    // On CI, we detect the actual FreeBSD version and match its ABI exactly,
+    // running tests to ensure that the ABI is correct.
+    match which_freebsd() {
+        Some(10) if libc_ci => set_cfg("freebsd10"),
+        Some(11) if libc_ci => set_cfg("freebsd11"),
+        Some(12) if libc_ci || rustc_dep_of_std => set_cfg("freebsd12"),
+        Some(13) if libc_ci => set_cfg("freebsd13"),
+        Some(14) if libc_ci => set_cfg("freebsd14"),
+        Some(15) if libc_ci => set_cfg("freebsd15"),
+        Some(_) | None => set_cfg("freebsd11"),
+    }
+
+    match emcc_version_code() {
+        Some(v) if (v >= 30142) => set_cfg("emscripten_new_stat_abi"),
+        // Non-Emscripten or version < 3.1.42.
+        Some(_) | None => (),
+    }
+
+    // On CI: deny all warnings
+    if libc_ci {
+        set_cfg("libc_deny_warnings");
+    }
+
+    // Rust >= 1.15 supports private module use:
+    if rustc_minor_ver >= 15 || rustc_dep_of_std {
+        set_cfg("libc_priv_mod_use");
+    }
+
+    // Rust >= 1.19 supports unions:
+    if rustc_minor_ver >= 19 || rustc_dep_of_std {
+        set_cfg("libc_union");
+    }
+
+    // Rust >= 1.24 supports const mem::size_of:
+    if rustc_minor_ver >= 24 || rustc_dep_of_std {
+        set_cfg("libc_const_size_of");
+    }
+
+    // Rust >= 1.25 supports repr(align):
+    if rustc_minor_ver >= 25 || rustc_dep_of_std || align_cargo_feature {
+        set_cfg("libc_align");
+    }
+
+    // Rust >= 1.26 supports i128 and u128:
+    if rustc_minor_ver >= 26 || rustc_dep_of_std {
+        set_cfg("libc_int128");
+    }
+
+    // Rust >= 1.30 supports `core::ffi::c_void`, so libc can just re-export it.
+    // Otherwise, it defines an incompatible type to retaining
+    // backwards-compatibility.
+    if rustc_minor_ver >= 30 || rustc_dep_of_std {
+        set_cfg("libc_core_cvoid");
+    }
+
+    // Rust >= 1.33 supports repr(packed(N)) and cfg(target_vendor).
+    if rustc_minor_ver >= 33 || rustc_dep_of_std {
+        set_cfg("libc_packedN");
+        set_cfg("libc_cfg_target_vendor");
+    }
+
+    // Rust >= 1.40 supports #[non_exhaustive].
+    if rustc_minor_ver >= 40 || rustc_dep_of_std {
+        set_cfg("libc_non_exhaustive");
+    }
+
+    // Rust >= 1.47 supports long array:
+    if rustc_minor_ver >= 47 || rustc_dep_of_std {
+        set_cfg("libc_long_array");
+    }
+
+    if rustc_minor_ver >= 51 || rustc_dep_of_std {
+        set_cfg("libc_ptr_addr_of");
+    }
+
+    // Rust >= 1.37.0 allows underscores as anonymous constant names.
+    if rustc_minor_ver >= 37 || rustc_dep_of_std {
+        set_cfg("libc_underscore_const_names");
+    }
+
+    // #[thread_local] is currently unstable
+    if rustc_dep_of_std {
+        set_cfg("libc_thread_local");
+    }
+
+    // Rust >= 1.62.0 allows to use `const_extern_fn` for "Rust" and "C".
+    if rustc_minor_ver >= 62 {
+        set_cfg("libc_const_extern_fn");
+    } else {
+        // Rust < 1.62.0 requires a crate feature and feature gate.
+        if const_extern_fn_cargo_feature {
+            if !is_nightly || rustc_minor_ver < 40 {
+                panic!("const-extern-fn requires a nightly compiler >= 1.40");
+            }
+            set_cfg("libc_const_extern_fn_unstable");
+            set_cfg("libc_const_extern_fn");
+        }
+    }
+
+    // check-cfg is a nightly cargo/rustc feature to warn when unknown cfgs are used across the
+    // codebase. libc can configure it if the appropriate environment variable is passed. Since
+    // rust-lang/rust enforces it, this is useful when using a custom libc fork there.
+    //
+    // https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg
+    if libc_check_cfg {
+        for cfg in ALLOWED_CFGS {
+            if rustc_minor_ver >= 75 {
+                println!("cargo:rustc-check-cfg=cfg({})", cfg);
+            } else {
+                println!("cargo:rustc-check-cfg=values({})", cfg);
+            }
+        }
+        for &(name, values) in CHECK_CFG_EXTRA {
+            let values = values.join("\",\"");
+            if rustc_minor_ver >= 75 {
+                println!("cargo:rustc-check-cfg=cfg({},values(\"{}\"))", name, values);
+            } else {
+                println!("cargo:rustc-check-cfg=values({},\"{}\")", name, values);
+            }
+        }
+    }
+}
+
+fn rustc_minor_nightly() -> (u32, bool) {
+    macro_rules! otry {
+        ($e:expr) => {
+            match $e {
+                Some(e) => e,
+                None => panic!("Failed to get rustc version"),
+            }
+        };
+    }
+
+    let rustc = otry!(env::var_os("RUSTC"));
+    let output = Command::new(rustc)
+        .arg("--version")
+        .output()
+        .ok()
+        .expect("Failed to get rustc version");
+    if !output.status.success() {
+        panic!(
+            "failed to run rustc: {}",
+            String::from_utf8_lossy(output.stderr.as_slice())
+        );
+    }
+
+    let version = otry!(str::from_utf8(&output.stdout).ok());
+    let mut pieces = version.split('.');
+
+    if pieces.next() != Some("rustc 1") {
+        panic!("Failed to get rustc version");
+    }
+
+    let minor = pieces.next();
+
+    // If `rustc` was built from a tarball, its version string
+    // will have neither a git hash nor a commit date
+    // (e.g. "rustc 1.39.0"). Treat this case as non-nightly,
+    // since a nightly build should either come from CI
+    // or a git checkout
+    let nightly_raw = otry!(pieces.next()).split('-').nth(1);
+    let nightly = nightly_raw
+        .map(|raw| raw.starts_with("dev") || raw.starts_with("nightly"))
+        .unwrap_or(false);
+    let minor = otry!(otry!(minor).parse().ok());
+
+    (minor, nightly)
+}
+
+fn which_freebsd() -> Option<i32> {
+    let output = std::process::Command::new("freebsd-version").output().ok();
+    if output.is_none() {
+        return None;
+    }
+    let output = output.unwrap();
+    if !output.status.success() {
+        return None;
+    }
+
+    let stdout = String::from_utf8(output.stdout).ok();
+    if stdout.is_none() {
+        return None;
+    }
+    let stdout = stdout.unwrap();
+
+    match &stdout {
+        s if s.starts_with("10") => Some(10),
+        s if s.starts_with("11") => Some(11),
+        s if s.starts_with("12") => Some(12),
+        s if s.starts_with("13") => Some(13),
+        s if s.starts_with("14") => Some(14),
+        s if s.starts_with("15") => Some(15),
+        _ => None,
+    }
+}
+
+fn emcc_version_code() -> Option<u64> {
+    let output = std::process::Command::new("emcc")
+        .arg("-dumpversion")
+        .output()
+        .ok();
+    if output.is_none() {
+        return None;
+    }
+    let output = output.unwrap();
+    if !output.status.success() {
+        return None;
+    }
+
+    let stdout = String::from_utf8(output.stdout).ok();
+    if stdout.is_none() {
+        return None;
+    }
+    let version = stdout.unwrap();
+
+    // Some Emscripten versions come with `-git` attached, so split the
+    // version string also on the `-` char.
+    let mut pieces = version.trim().split(|c| c == '.' || c == '-');
+
+    let major = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0);
+    let minor = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0);
+    let patch = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0);
+
+    Some(major * 10000 + minor * 100 + patch)
+}
+
+fn set_cfg(cfg: &str) {
+    if !ALLOWED_CFGS.contains(&cfg) {
+        panic!("trying to set cfg {}, but it is not in ALLOWED_CFGS", cfg);
+    }
+    println!("cargo:rustc-cfg={}", cfg);
+}
diff -pruN 43.0.0-1/rust-vendor/libc/rustfmt.toml 43.0.0-1ubuntu1/rust-vendor/libc/rustfmt.toml
--- 43.0.0-1/rust-vendor/libc/rustfmt.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/rustfmt.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+error_on_line_overflow = true
diff -pruN 43.0.0-1/rust-vendor/libc/src/fixed_width_ints.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/fixed_width_ints.rs
--- 43.0.0-1/rust-vendor/libc/src/fixed_width_ints.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/fixed_width_ints.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,99 @@
+//! This module contains type aliases for C's fixed-width integer types .
+//!
+//! These aliases are deprecated: use the Rust types instead.
+
+#[deprecated(since = "0.2.55", note = "Use i8 instead.")]
+pub type int8_t = i8;
+#[deprecated(since = "0.2.55", note = "Use i16 instead.")]
+pub type int16_t = i16;
+#[deprecated(since = "0.2.55", note = "Use i32 instead.")]
+pub type int32_t = i32;
+#[deprecated(since = "0.2.55", note = "Use i64 instead.")]
+pub type int64_t = i64;
+#[deprecated(since = "0.2.55", note = "Use u8 instead.")]
+pub type uint8_t = u8;
+#[deprecated(since = "0.2.55", note = "Use u16 instead.")]
+pub type uint16_t = u16;
+#[deprecated(since = "0.2.55", note = "Use u32 instead.")]
+pub type uint32_t = u32;
+#[deprecated(since = "0.2.55", note = "Use u64 instead.")]
+pub type uint64_t = u64;
+
+cfg_if! {
+    if #[cfg(all(libc_int128, target_arch = "aarch64", not(target_os = "windows")))] {
+        // This introduces partial support for FFI with __int128 and
+        // equivalent types on platforms where Rust's definition is validated
+        // to match the standard C ABI of that platform.
+        //
+        // Rust does not guarantee u128/i128 are sound for FFI, and its
+        // definitions are in fact known to be incompatible. [0]
+        //
+        // However these problems aren't fundamental, and are just platform
+        // inconsistencies. Specifically at the time of this writing:
+        //
+        // * For x64 SysV ABIs (everything but Windows), the types are underaligned.
+        // * For all Windows ABIs, Microsoft doesn't actually officially define __int128,
+        //   and as a result different implementations don't actually agree on its ABI.
+        //
+        // But on the other major aarch64 platforms (android, linux, ios, macos) we have
+        // validated that rustc has the right ABI for these types. This is important because
+        // aarch64 uses these types in some fundamental OS types like user_fpsimd_struct,
+        // which represents saved simd registers.
+        //
+        // Any API which uses these types will need to `#[ignore(improper_ctypes)]`
+        // until the upstream rust issue is resolved, but this at least lets us make
+        // progress on platforms where this type is important.
+        //
+        // The list of supported architectures and OSes is intentionally very restricted,
+        // as careful work needs to be done to verify that a particular platform
+        // has a conformant ABI.
+        //
+        // [0]: https://github.com/rust-lang/rust/issues/54341
+
+        /// C `__int128` (a GCC extension that's part of many ABIs)
+        pub type __int128 = i128;
+        /// C `unsigned __int128` (a GCC extension that's part of many ABIs)
+        pub type __uint128 = u128;
+        /// C __int128_t (alternate name for [__int128][])
+        pub type __int128_t = i128;
+        /// C __uint128_t (alternate name for [__uint128][])
+        pub type __uint128_t = u128;
+
+        cfg_if! {
+            if #[cfg(libc_underscore_const_names)] {
+                macro_rules! static_assert_eq {
+                    ($a:expr, $b:expr) => {
+                        const _: [(); $a] = [(); $b];
+                    };
+                }
+
+                // NOTE: if you add more platforms to here, you may need to cfg
+                // these consts. They should always match the platform's values
+                // for `sizeof(__int128)` and `_Alignof(__int128)`.
+                const _SIZE_128: usize = 16;
+                const _ALIGN_128: usize = 16;
+
+                // Since Rust doesn't officially guarantee that these types
+                // have compatible ABIs, we const assert that these values have the
+                // known size/align of the target platform's libc. If rustc ever
+                // tries to regress things, it will cause a compilation error.
+                //
+                // This isn't a bullet-proof solution because e.g. it doesn't
+                // catch the fact that llvm and gcc disagree on how x64 __int128
+                // is actually *passed* on the stack (clang underaligns it for
+                // the same reason that rustc *never* properly aligns it).
+                static_assert_eq!(core::mem::size_of::<__int128>(), _SIZE_128);
+                static_assert_eq!(core::mem::align_of::<__int128>(), _ALIGN_128);
+
+                static_assert_eq!(core::mem::size_of::<__uint128>(), _SIZE_128);
+                static_assert_eq!(core::mem::align_of::<__uint128>(), _ALIGN_128);
+
+                static_assert_eq!(core::mem::size_of::<__int128_t>(), _SIZE_128);
+                static_assert_eq!(core::mem::align_of::<__int128_t>(), _ALIGN_128);
+
+                static_assert_eq!(core::mem::size_of::<__uint128_t>(), _SIZE_128);
+                static_assert_eq!(core::mem::align_of::<__uint128_t>(), _ALIGN_128);
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/fuchsia/aarch64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/fuchsia/aarch64.rs
--- 43.0.0-1/rust-vendor/libc/src/fuchsia/aarch64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/fuchsia/aarch64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,67 @@
+pub type c_char = u8;
+pub type __u64 = ::c_ulonglong;
+pub type wchar_t = u32;
+pub type nlink_t = ::c_ulong;
+pub type blksize_t = ::c_long;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad0: ::c_ulong,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        __pad1: ::c_int,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_uint; 2],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad0: ::c_ulong,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        __pad1: ::c_int,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_uint; 2],
+    }
+
+    pub struct ipc_perm {
+        pub __ipc_perm_key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong,
+    }
+}
+
+// From https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/third_party/ulib/musl/include/bits/signal.h;l=20-21;drc=0827b18ab9540c46f8037f407d17ea15a79e9ba7
+pub const MINSIGSTKSZ: ::size_t = 6144;
+pub const SIGSTKSZ: ::size_t = 12288;
diff -pruN 43.0.0-1/rust-vendor/libc/src/fuchsia/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/fuchsia/align.rs
--- 43.0.0-1/rust-vendor/libc/src/fuchsia/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/fuchsia/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,142 @@
+macro_rules! expand_align {
+    () => {
+        s! {
+            #[cfg_attr(
+                any(
+                    target_pointer_width = "32",
+                    target_arch = "x86_64"
+                ),
+                repr(align(4)))]
+            #[cfg_attr(
+                not(any(
+                    target_pointer_width = "32",
+                    target_arch = "x86_64"
+                )),
+                repr(align(8)))]
+            pub struct pthread_mutexattr_t {
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
+            }
+
+            #[cfg_attr(target_pointer_width = "32",
+                       repr(align(4)))]
+            #[cfg_attr(target_pointer_width = "64",
+                       repr(align(8)))]
+            pub struct pthread_rwlockattr_t {
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
+            }
+
+            #[repr(align(4))]
+            pub struct pthread_condattr_t {
+                size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
+            }
+        }
+
+        s_no_extra_traits! {
+            #[cfg_attr(all(target_pointer_width = "32",
+                           any(target_arch = "arm",
+                               target_arch = "x86_64")),
+                       repr(align(4)))]
+            #[cfg_attr(any(target_pointer_width = "64",
+                           not(any(target_arch = "arm",
+                                   target_arch = "x86_64"))),
+                       repr(align(8)))]
+            pub struct pthread_mutex_t {
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
+            }
+
+            #[cfg_attr(all(target_pointer_width = "32",
+                           any(target_arch = "arm",
+                               target_arch = "x86_64")),
+                       repr(align(4)))]
+            #[cfg_attr(any(target_pointer_width = "64",
+                           not(any(target_arch = "arm",
+                                   target_arch = "x86_64"))),
+                       repr(align(8)))]
+            pub struct pthread_rwlock_t {
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
+            }
+
+            #[cfg_attr(target_pointer_width = "32",
+                       repr(align(4)))]
+            #[cfg_attr(target_pointer_width = "64",
+                       repr(align(8)))]
+            #[cfg_attr(target_arch = "x86",
+                       repr(align(4)))]
+            #[cfg_attr(not(target_arch = "x86"),
+                       repr(align(8)))]
+            pub struct pthread_cond_t {
+                size: [u8; ::__SIZEOF_PTHREAD_COND_T],
+            }
+        }
+
+        cfg_if! {
+            if #[cfg(feature = "extra_traits")] {
+                impl PartialEq for pthread_cond_t {
+                    fn eq(&self, other: &pthread_cond_t) -> bool {
+                        self.size
+                            .iter()
+                            .zip(other.size.iter())
+                            .all(|(a,b)| a == b)
+                    }
+                }
+                impl Eq for pthread_cond_t {}
+                impl ::fmt::Debug for pthread_cond_t {
+                    fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                        f.debug_struct("pthread_cond_t")
+                            // FIXME: .field("size", &self.size)
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for pthread_cond_t {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        self.size.hash(state);
+                    }
+                }
+
+                impl PartialEq for pthread_mutex_t {
+                    fn eq(&self, other: &pthread_mutex_t) -> bool {
+                        self.size
+                            .iter()
+                            .zip(other.size.iter())
+                            .all(|(a,b)| a == b)
+                    }
+                }
+                impl Eq for pthread_mutex_t {}
+                impl ::fmt::Debug for pthread_mutex_t {
+                    fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                        f.debug_struct("pthread_mutex_t")
+                            // FIXME: .field("size", &self.size)
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for pthread_mutex_t {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        self.size.hash(state);
+                    }
+                }
+
+                impl PartialEq for pthread_rwlock_t {
+                    fn eq(&self, other: &pthread_rwlock_t) -> bool {
+                        self.size
+                            .iter()
+                            .zip(other.size.iter())
+                            .all(|(a,b)| a == b)
+                    }
+                }
+                impl Eq for pthread_rwlock_t {}
+                impl ::fmt::Debug for pthread_rwlock_t {
+                    fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                        f.debug_struct("pthread_rwlock_t")
+                            // FIXME: .field("size", &self.size)
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for pthread_rwlock_t {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        self.size.hash(state);
+                    }
+                }
+            }
+        }
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/fuchsia/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/fuchsia/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/fuchsia/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/fuchsia/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4393 @@
+//! Definitions found commonly among almost all Unix derivatives
+//!
+//! More functions and definitions can be found in the more specific modules
+//! according to the platform in question.
+
+// PUB_TYPE
+
+pub type c_schar = i8;
+pub type c_uchar = u8;
+pub type c_short = i16;
+pub type c_ushort = u16;
+pub type c_int = i32;
+pub type c_uint = u32;
+pub type c_float = f32;
+pub type c_double = f64;
+pub type c_longlong = i64;
+pub type c_ulonglong = u64;
+pub type intmax_t = i64;
+pub type uintmax_t = u64;
+
+pub type locale_t = *mut ::c_void;
+
+pub type size_t = usize;
+pub type ptrdiff_t = isize;
+pub type intptr_t = isize;
+pub type uintptr_t = usize;
+pub type ssize_t = isize;
+
+pub type pid_t = i32;
+pub type uid_t = u32;
+pub type gid_t = u32;
+pub type in_addr_t = u32;
+pub type in_port_t = u16;
+pub type sighandler_t = ::size_t;
+pub type cc_t = ::c_uchar;
+pub type sa_family_t = u16;
+pub type pthread_key_t = ::c_uint;
+pub type speed_t = ::c_uint;
+pub type tcflag_t = ::c_uint;
+pub type clockid_t = ::c_int;
+pub type key_t = ::c_int;
+pub type id_t = ::c_uint;
+pub type useconds_t = u32;
+pub type dev_t = u64;
+pub type socklen_t = u32;
+pub type pthread_t = c_ulong;
+pub type mode_t = u32;
+pub type ino64_t = u64;
+pub type off64_t = i64;
+pub type blkcnt64_t = i64;
+pub type rlim64_t = u64;
+pub type mqd_t = ::c_int;
+pub type nfds_t = ::c_ulong;
+pub type nl_item = ::c_int;
+pub type idtype_t = ::c_uint;
+pub type loff_t = ::c_longlong;
+
+pub type __u8 = ::c_uchar;
+pub type __u16 = ::c_ushort;
+pub type __s16 = ::c_short;
+pub type __u32 = ::c_uint;
+pub type __s32 = ::c_int;
+
+pub type Elf32_Half = u16;
+pub type Elf32_Word = u32;
+pub type Elf32_Off = u32;
+pub type Elf32_Addr = u32;
+
+pub type Elf64_Half = u16;
+pub type Elf64_Word = u32;
+pub type Elf64_Off = u64;
+pub type Elf64_Addr = u64;
+pub type Elf64_Xword = u64;
+
+pub type clock_t = c_long;
+pub type time_t = c_long;
+pub type suseconds_t = c_long;
+pub type ino_t = u64;
+pub type off_t = i64;
+pub type blkcnt_t = i64;
+
+pub type shmatt_t = ::c_ulong;
+pub type msgqnum_t = ::c_ulong;
+pub type msglen_t = ::c_ulong;
+pub type fsblkcnt_t = ::c_ulonglong;
+pub type fsfilcnt_t = ::c_ulonglong;
+pub type rlim_t = ::c_ulonglong;
+
+pub type c_long = i64;
+pub type c_ulong = u64;
+
+// FIXME: why are these uninhabited types? that seems... wrong?
+// Presumably these should be `()` or an `extern type` (when that stabilizes).
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum timezone {}
+impl ::Copy for timezone {}
+impl ::Clone for timezone {
+    fn clone(&self) -> timezone {
+        *self
+    }
+}
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum DIR {}
+impl ::Copy for DIR {}
+impl ::Clone for DIR {
+    fn clone(&self) -> DIR {
+        *self
+    }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum fpos64_t {} // FIXME: fill this out with a struct
+impl ::Copy for fpos64_t {}
+impl ::Clone for fpos64_t {
+    fn clone(&self) -> fpos64_t {
+        *self
+    }
+}
+
+// PUB_STRUCT
+
+s! {
+    pub struct group {
+        pub gr_name: *mut ::c_char,
+        pub gr_passwd: *mut ::c_char,
+        pub gr_gid: ::gid_t,
+        pub gr_mem: *mut *mut ::c_char,
+    }
+
+    pub struct utimbuf {
+        pub actime: time_t,
+        pub modtime: time_t,
+    }
+
+    pub struct timeval {
+        pub tv_sec: time_t,
+        pub tv_usec: suseconds_t,
+    }
+
+    pub struct timespec {
+        pub tv_sec: time_t,
+        pub tv_nsec: ::c_long,
+    }
+
+    // FIXME: the rlimit and rusage related functions and types don't exist
+    // within zircon. Are there reasons for keeping them around?
+    pub struct rlimit {
+        pub rlim_cur: rlim_t,
+        pub rlim_max: rlim_t,
+    }
+
+    pub struct rusage {
+        pub ru_utime: timeval,
+        pub ru_stime: timeval,
+        pub ru_maxrss: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad1: u32,
+        pub ru_ixrss: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad2: u32,
+        pub ru_idrss: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad3: u32,
+        pub ru_isrss: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad4: u32,
+        pub ru_minflt: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad5: u32,
+        pub ru_majflt: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad6: u32,
+        pub ru_nswap: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad7: u32,
+        pub ru_inblock: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad8: u32,
+        pub ru_oublock: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad9: u32,
+        pub ru_msgsnd: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad10: u32,
+        pub ru_msgrcv: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad11: u32,
+        pub ru_nsignals: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad12: u32,
+        pub ru_nvcsw: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad13: u32,
+        pub ru_nivcsw: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad14: u32,
+    }
+
+    pub struct in_addr {
+        pub s_addr: in_addr_t,
+    }
+
+    pub struct in6_addr {
+        pub s6_addr: [u8; 16],
+    }
+
+    pub struct ip_mreq {
+        pub imr_multiaddr: in_addr,
+        pub imr_interface: in_addr,
+    }
+
+    pub struct ip_mreqn {
+        pub imr_multiaddr: in_addr,
+        pub imr_address: in_addr,
+        pub imr_ifindex: ::c_int,
+    }
+
+    pub struct ipv6_mreq {
+        pub ipv6mr_multiaddr: in6_addr,
+        pub ipv6mr_interface: ::c_uint,
+    }
+
+    pub struct hostent {
+        pub h_name: *mut ::c_char,
+        pub h_aliases: *mut *mut ::c_char,
+        pub h_addrtype: ::c_int,
+        pub h_length: ::c_int,
+        pub h_addr_list: *mut *mut ::c_char,
+    }
+
+    pub struct iovec {
+        pub iov_base: *mut ::c_void,
+        pub iov_len: ::size_t,
+    }
+
+    pub struct pollfd {
+        pub fd: ::c_int,
+        pub events: ::c_short,
+        pub revents: ::c_short,
+    }
+
+    pub struct winsize {
+        pub ws_row: ::c_ushort,
+        pub ws_col: ::c_ushort,
+        pub ws_xpixel: ::c_ushort,
+        pub ws_ypixel: ::c_ushort,
+    }
+
+    pub struct linger {
+        pub l_onoff: ::c_int,
+        pub l_linger: ::c_int,
+    }
+
+    pub struct sigval {
+        // Actually a union of an int and a void*
+        pub sival_ptr: *mut ::c_void
+    }
+
+    // <sys/time.h>
+    pub struct itimerval {
+        pub it_interval: ::timeval,
+        pub it_value: ::timeval,
+    }
+
+    // <sys/times.h>
+    pub struct tms {
+        pub tms_utime: ::clock_t,
+        pub tms_stime: ::clock_t,
+        pub tms_cutime: ::clock_t,
+        pub tms_cstime: ::clock_t,
+    }
+
+    pub struct servent {
+        pub s_name: *mut ::c_char,
+        pub s_aliases: *mut *mut ::c_char,
+        pub s_port: ::c_int,
+        pub s_proto: *mut ::c_char,
+    }
+
+    pub struct protoent {
+        pub p_name: *mut ::c_char,
+        pub p_aliases: *mut *mut ::c_char,
+        pub p_proto: ::c_int,
+    }
+
+    pub struct aiocb {
+        pub aio_fildes: ::c_int,
+        pub aio_lio_opcode: ::c_int,
+        pub aio_reqprio: ::c_int,
+        pub aio_buf: *mut ::c_void,
+        pub aio_nbytes: ::size_t,
+        pub aio_sigevent: ::sigevent,
+        __td: *mut ::c_void,
+        __lock: [::c_int; 2],
+        __err: ::c_int,
+        __ret: ::ssize_t,
+        pub aio_offset: off_t,
+        __next: *mut ::c_void,
+        __prev: *mut ::c_void,
+        #[cfg(target_pointer_width = "32")]
+        __dummy4: [::c_char; 24],
+        #[cfg(target_pointer_width = "64")]
+        __dummy4: [::c_char; 16],
+    }
+
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::NCCS],
+        pub __c_ispeed: ::speed_t,
+        pub __c_ospeed: ::speed_t,
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct ucred {
+        pub pid: ::pid_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+    }
+
+    pub struct sockaddr {
+        pub sa_family: sa_family_t,
+        pub sa_data: [::c_char; 14],
+    }
+
+    pub struct sockaddr_in {
+        pub sin_family: sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [u8; 8],
+    }
+
+    pub struct sockaddr_in6 {
+        pub sin6_family: sa_family_t,
+        pub sin6_port: ::in_port_t,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_scope_id: u32,
+    }
+
+    pub struct addrinfo {
+        pub ai_flags: ::c_int,
+        pub ai_family: ::c_int,
+        pub ai_socktype: ::c_int,
+        pub ai_protocol: ::c_int,
+        pub ai_addrlen: socklen_t,
+
+        pub ai_addr: *mut ::sockaddr,
+
+        pub ai_canonname: *mut c_char,
+
+        pub ai_next: *mut addrinfo,
+    }
+
+    pub struct sockaddr_ll {
+        pub sll_family: ::c_ushort,
+        pub sll_protocol: ::c_ushort,
+        pub sll_ifindex: ::c_int,
+        pub sll_hatype: ::c_ushort,
+        pub sll_pkttype: ::c_uchar,
+        pub sll_halen: ::c_uchar,
+        pub sll_addr: [::c_uchar; 8]
+    }
+
+    pub struct fd_set {
+        fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE],
+    }
+
+    pub struct tm {
+        pub tm_sec: ::c_int,
+        pub tm_min: ::c_int,
+        pub tm_hour: ::c_int,
+        pub tm_mday: ::c_int,
+        pub tm_mon: ::c_int,
+        pub tm_year: ::c_int,
+        pub tm_wday: ::c_int,
+        pub tm_yday: ::c_int,
+        pub tm_isdst: ::c_int,
+        pub tm_gmtoff: ::c_long,
+        pub tm_zone: *const ::c_char,
+    }
+
+    pub struct sched_param {
+        pub sched_priority: ::c_int,
+        pub sched_ss_low_priority: ::c_int,
+        pub sched_ss_repl_period: ::timespec,
+        pub sched_ss_init_budget: ::timespec,
+        pub sched_ss_max_repl: ::c_int,
+    }
+
+    pub struct Dl_info {
+        pub dli_fname: *const ::c_char,
+        pub dli_fbase: *mut ::c_void,
+        pub dli_sname: *const ::c_char,
+        pub dli_saddr: *mut ::c_void,
+    }
+
+    pub struct epoll_event {
+        pub events: u32,
+        pub u64: u64,
+    }
+
+    pub struct lconv {
+        pub decimal_point: *mut ::c_char,
+        pub thousands_sep: *mut ::c_char,
+        pub grouping: *mut ::c_char,
+        pub int_curr_symbol: *mut ::c_char,
+        pub currency_symbol: *mut ::c_char,
+        pub mon_decimal_point: *mut ::c_char,
+        pub mon_thousands_sep: *mut ::c_char,
+        pub mon_grouping: *mut ::c_char,
+        pub positive_sign: *mut ::c_char,
+        pub negative_sign: *mut ::c_char,
+        pub int_frac_digits: ::c_char,
+        pub frac_digits: ::c_char,
+        pub p_cs_precedes: ::c_char,
+        pub p_sep_by_space: ::c_char,
+        pub n_cs_precedes: ::c_char,
+        pub n_sep_by_space: ::c_char,
+        pub p_sign_posn: ::c_char,
+        pub n_sign_posn: ::c_char,
+        pub int_p_cs_precedes: ::c_char,
+        pub int_p_sep_by_space: ::c_char,
+        pub int_n_cs_precedes: ::c_char,
+        pub int_n_sep_by_space: ::c_char,
+        pub int_p_sign_posn: ::c_char,
+        pub int_n_sign_posn: ::c_char,
+    }
+
+    pub struct rlimit64 {
+        pub rlim_cur: rlim64_t,
+        pub rlim_max: rlim64_t,
+    }
+
+    pub struct glob_t {
+        pub gl_pathc: ::size_t,
+        pub gl_pathv: *mut *mut c_char,
+        pub gl_offs: ::size_t,
+        pub gl_flags: ::c_int,
+
+        __unused1: *mut ::c_void,
+        __unused2: *mut ::c_void,
+        __unused3: *mut ::c_void,
+        __unused4: *mut ::c_void,
+        __unused5: *mut ::c_void,
+    }
+
+    pub struct ifaddrs {
+        pub ifa_next: *mut ifaddrs,
+        pub ifa_name: *mut c_char,
+        pub ifa_flags: ::c_uint,
+        pub ifa_addr: *mut ::sockaddr,
+        pub ifa_netmask: *mut ::sockaddr,
+        pub ifa_ifu: *mut ::sockaddr, // FIXME This should be a union
+        pub ifa_data: *mut ::c_void
+    }
+
+    pub struct passwd {
+        pub pw_name: *mut ::c_char,
+        pub pw_passwd: *mut ::c_char,
+        pub pw_uid: ::uid_t,
+        pub pw_gid: ::gid_t,
+        pub pw_gecos: *mut ::c_char,
+        pub pw_dir: *mut ::c_char,
+        pub pw_shell: *mut ::c_char,
+    }
+
+    pub struct spwd {
+        pub sp_namp: *mut ::c_char,
+        pub sp_pwdp: *mut ::c_char,
+        pub sp_lstchg: ::c_long,
+        pub sp_min: ::c_long,
+        pub sp_max: ::c_long,
+        pub sp_warn: ::c_long,
+        pub sp_inact: ::c_long,
+        pub sp_expire: ::c_long,
+        pub sp_flag: ::c_ulong,
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        #[cfg(target_endian = "little")]
+        pub f_fsid: ::c_ulong,
+        #[cfg(all(target_pointer_width = "32", not(target_arch = "x86_64")))]
+        __f_unused: ::c_int,
+        #[cfg(target_endian = "big")]
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct dqblk {
+        pub dqb_bhardlimit: u64,
+        pub dqb_bsoftlimit: u64,
+        pub dqb_curspace: u64,
+        pub dqb_ihardlimit: u64,
+        pub dqb_isoftlimit: u64,
+        pub dqb_curinodes: u64,
+        pub dqb_btime: u64,
+        pub dqb_itime: u64,
+        pub dqb_valid: u32,
+    }
+
+    pub struct signalfd_siginfo {
+        pub ssi_signo: u32,
+        pub ssi_errno: i32,
+        pub ssi_code: i32,
+        pub ssi_pid: u32,
+        pub ssi_uid: u32,
+        pub ssi_fd: i32,
+        pub ssi_tid: u32,
+        pub ssi_band: u32,
+        pub ssi_overrun: u32,
+        pub ssi_trapno: u32,
+        pub ssi_status: i32,
+        pub ssi_int: i32,
+        pub ssi_ptr: u64,
+        pub ssi_utime: u64,
+        pub ssi_stime: u64,
+        pub ssi_addr: u64,
+        pub ssi_addr_lsb: u16,
+        _pad2: u16,
+        pub ssi_syscall: i32,
+        pub ssi_call_addr: u64,
+        pub ssi_arch: u32,
+        _pad: [u8; 28],
+    }
+
+    pub struct itimerspec {
+        pub it_interval: ::timespec,
+        pub it_value: ::timespec,
+    }
+
+    pub struct fsid_t {
+        __val: [::c_int; 2],
+    }
+
+    pub struct cpu_set_t {
+        #[cfg(all(target_pointer_width = "32",
+                  not(target_arch = "x86_64")))]
+        bits: [u32; 32],
+        #[cfg(not(all(target_pointer_width = "32",
+                      not(target_arch = "x86_64"))))]
+        bits: [u64; 16],
+    }
+
+    pub struct if_nameindex {
+        pub if_index: ::c_uint,
+        pub if_name: *mut ::c_char,
+    }
+
+    // System V IPC
+    pub struct msginfo {
+        pub msgpool: ::c_int,
+        pub msgmap: ::c_int,
+        pub msgmax: ::c_int,
+        pub msgmnb: ::c_int,
+        pub msgmni: ::c_int,
+        pub msgssz: ::c_int,
+        pub msgtql: ::c_int,
+        pub msgseg: ::c_ushort,
+    }
+
+    pub struct mmsghdr {
+        pub msg_hdr: ::msghdr,
+        pub msg_len: ::c_uint,
+    }
+
+    pub struct sembuf {
+        pub sem_num: ::c_ushort,
+        pub sem_op: ::c_short,
+        pub sem_flg: ::c_short,
+    }
+
+    pub struct input_event {
+        pub time: ::timeval,
+        pub type_: ::__u16,
+        pub code: ::__u16,
+        pub value: ::__s32,
+    }
+
+    pub struct input_id {
+        pub bustype: ::__u16,
+        pub vendor: ::__u16,
+        pub product: ::__u16,
+        pub version: ::__u16,
+    }
+
+    pub struct input_absinfo {
+        pub value: ::__s32,
+        pub minimum: ::__s32,
+        pub maximum: ::__s32,
+        pub fuzz: ::__s32,
+        pub flat: ::__s32,
+        pub resolution: ::__s32,
+    }
+
+    pub struct input_keymap_entry {
+        pub flags: ::__u8,
+        pub len: ::__u8,
+        pub index: ::__u16,
+        pub keycode: ::__u32,
+        pub scancode: [::__u8; 32],
+    }
+
+    pub struct input_mask {
+        pub type_: ::__u32,
+        pub codes_size: ::__u32,
+        pub codes_ptr: ::__u64,
+    }
+
+    pub struct ff_replay {
+        pub length: ::__u16,
+        pub delay: ::__u16,
+    }
+
+    pub struct ff_trigger {
+        pub button: ::__u16,
+        pub interval: ::__u16,
+    }
+
+    pub struct ff_envelope {
+        pub attack_length: ::__u16,
+        pub attack_level: ::__u16,
+        pub fade_length: ::__u16,
+        pub fade_level: ::__u16,
+    }
+
+    pub struct ff_constant_effect {
+        pub level: ::__s16,
+        pub envelope: ff_envelope,
+    }
+
+    pub struct ff_ramp_effect {
+        pub start_level: ::__s16,
+        pub end_level: ::__s16,
+        pub envelope: ff_envelope,
+    }
+
+    pub struct ff_condition_effect {
+        pub right_saturation: ::__u16,
+        pub left_saturation: ::__u16,
+
+        pub right_coeff: ::__s16,
+        pub left_coeff: ::__s16,
+
+        pub deadband: ::__u16,
+        pub center: ::__s16,
+    }
+
+    pub struct ff_periodic_effect {
+        pub waveform: ::__u16,
+        pub period: ::__u16,
+        pub magnitude: ::__s16,
+        pub offset: ::__s16,
+        pub phase: ::__u16,
+
+        pub envelope: ff_envelope,
+
+        pub custom_len: ::__u32,
+        pub custom_data: *mut ::__s16,
+    }
+
+    pub struct ff_rumble_effect {
+        pub strong_magnitude: ::__u16,
+        pub weak_magnitude: ::__u16,
+    }
+
+    pub struct ff_effect {
+        pub type_: ::__u16,
+        pub id: ::__s16,
+        pub direction: ::__u16,
+        pub trigger: ff_trigger,
+        pub replay: ff_replay,
+        // FIXME this is actually a union
+        #[cfg(target_pointer_width = "64")]
+        pub u: [u64; 4],
+        #[cfg(target_pointer_width = "32")]
+        pub u: [u32; 7],
+    }
+
+    pub struct dl_phdr_info {
+        #[cfg(target_pointer_width = "64")]
+        pub dlpi_addr: Elf64_Addr,
+        #[cfg(target_pointer_width = "32")]
+        pub dlpi_addr: Elf32_Addr,
+
+        pub dlpi_name: *const ::c_char,
+
+        #[cfg(target_pointer_width = "64")]
+        pub dlpi_phdr: *const Elf64_Phdr,
+        #[cfg(target_pointer_width = "32")]
+        pub dlpi_phdr: *const Elf32_Phdr,
+
+        #[cfg(target_pointer_width = "64")]
+        pub dlpi_phnum: Elf64_Half,
+        #[cfg(target_pointer_width = "32")]
+        pub dlpi_phnum: Elf32_Half,
+
+        pub dlpi_adds: ::c_ulonglong,
+        pub dlpi_subs: ::c_ulonglong,
+        pub dlpi_tls_modid: ::size_t,
+        pub dlpi_tls_data: *mut ::c_void,
+    }
+
+    pub struct Elf32_Phdr {
+        pub p_type: Elf32_Word,
+        pub p_offset: Elf32_Off,
+        pub p_vaddr: Elf32_Addr,
+        pub p_paddr: Elf32_Addr,
+        pub p_filesz: Elf32_Word,
+        pub p_memsz: Elf32_Word,
+        pub p_flags: Elf32_Word,
+        pub p_align: Elf32_Word,
+    }
+
+    pub struct Elf64_Phdr {
+        pub p_type: Elf64_Word,
+        pub p_flags: Elf64_Word,
+        pub p_offset: Elf64_Off,
+        pub p_vaddr: Elf64_Addr,
+        pub p_paddr: Elf64_Addr,
+        pub p_filesz: Elf64_Xword,
+        pub p_memsz: Elf64_Xword,
+        pub p_align: Elf64_Xword,
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 4],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t
+    }
+
+    pub struct pthread_attr_t {
+        __size: [u64; 7]
+    }
+
+    pub struct sigset_t {
+        __val: [::c_ulong; 16],
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::c_ulong,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 4],
+    }
+
+    pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: ::socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::c_int,
+        __pad1: ::c_int,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: ::socklen_t,
+        __pad2: ::socklen_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct cmsghdr {
+        pub cmsg_len: ::socklen_t,
+        pub __pad1: ::c_int,
+        pub cmsg_level: ::c_int,
+        pub cmsg_type: ::c_int,
+    }
+
+    pub struct sem_t {
+        __val: [::c_int; 8],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        pub _pad: [::c_int; 29],
+        _align: [usize; 0],
+    }
+
+    pub struct termios2 {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; 19],
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::speed_t,
+    }
+
+    pub struct in6_pktinfo {
+        pub ipi6_addr: ::in6_addr,
+        pub ipi6_ifindex: ::c_uint,
+    }
+}
+
+s_no_extra_traits! {
+    pub struct sysinfo {
+        pub uptime: ::c_ulong,
+        pub loads: [::c_ulong; 3],
+        pub totalram: ::c_ulong,
+        pub freeram: ::c_ulong,
+        pub sharedram: ::c_ulong,
+        pub bufferram: ::c_ulong,
+        pub totalswap: ::c_ulong,
+        pub freeswap: ::c_ulong,
+        pub procs: ::c_ushort,
+        pub pad: ::c_ushort,
+        pub totalhigh: ::c_ulong,
+        pub freehigh: ::c_ulong,
+        pub mem_unit: ::c_uint,
+        pub __reserved: [::c_char; 256],
+    }
+
+    pub struct sockaddr_un {
+        pub sun_family: sa_family_t,
+        pub sun_path: [::c_char; 108]
+    }
+
+    pub struct sockaddr_storage {
+        pub ss_family: sa_family_t,
+        __ss_pad2: [u8; 128 - 2 - 8],
+        __ss_align: ::size_t,
+    }
+
+    pub struct utsname {
+        pub sysname: [::c_char; 65],
+        pub nodename: [::c_char; 65],
+        pub release: [::c_char; 65],
+        pub version: [::c_char; 65],
+        pub machine: [::c_char; 65],
+        pub domainname: [::c_char; 65]
+    }
+
+    pub struct dirent {
+        pub d_ino: ::ino_t,
+        pub d_off: ::off_t,
+        pub d_reclen: ::c_ushort,
+        pub d_type: ::c_uchar,
+        pub d_name: [::c_char; 256],
+    }
+
+    pub struct dirent64 {
+        pub d_ino: ::ino64_t,
+        pub d_off: ::off64_t,
+        pub d_reclen: ::c_ushort,
+        pub d_type: ::c_uchar,
+        pub d_name: [::c_char; 256],
+    }
+
+    // x32 compatibility
+    // See https://sourceware.org/bugzilla/show_bug.cgi?id=21279
+    pub struct mq_attr {
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub mq_flags: i64,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub mq_maxmsg: i64,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub mq_msgsize: i64,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub mq_curmsgs: i64,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pad: [i64; 4],
+
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub mq_flags: ::c_long,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub mq_maxmsg: ::c_long,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub mq_msgsize: ::c_long,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub mq_curmsgs: ::c_long,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pad: [::c_long; 4],
+    }
+
+    pub struct sockaddr_nl {
+        pub nl_family: ::sa_family_t,
+        nl_pad: ::c_ushort,
+        pub nl_pid: u32,
+        pub nl_groups: u32
+    }
+
+    pub struct sigevent {
+        pub sigev_value: ::sigval,
+        pub sigev_signo: ::c_int,
+        pub sigev_notify: ::c_int,
+        pub sigev_notify_function: fn(::sigval),
+        pub sigev_notify_attributes: *mut pthread_attr_t,
+        pub __pad: [::c_char; 56 - 3 * 8 /* 8 == sizeof(long) */],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for sysinfo {
+            fn eq(&self, other: &sysinfo) -> bool {
+                self.uptime == other.uptime
+                    && self.loads == other.loads
+                    && self.totalram == other.totalram
+                    && self.freeram == other.freeram
+                    && self.sharedram == other.sharedram
+                    && self.bufferram == other.bufferram
+                    && self.totalswap == other.totalswap
+                    && self.freeswap == other.freeswap
+                    && self.procs == other.procs
+                    && self.pad == other.pad
+                    && self.totalhigh == other.totalhigh
+                    && self.freehigh == other.freehigh
+                    && self.mem_unit == other.mem_unit
+                    && self
+                        .__reserved
+                        .iter()
+                        .zip(other.__reserved.iter())
+                        .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for sysinfo {}
+        impl ::fmt::Debug for sysinfo {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sysinfo")
+                    .field("uptime", &self.uptime)
+                    .field("loads", &self.loads)
+                    .field("totalram", &self.totalram)
+                    .field("freeram", &self.freeram)
+                    .field("sharedram", &self.sharedram)
+                    .field("bufferram", &self.bufferram)
+                    .field("totalswap", &self.totalswap)
+                    .field("freeswap", &self.freeswap)
+                    .field("procs", &self.procs)
+                    .field("pad", &self.pad)
+                    .field("totalhigh", &self.totalhigh)
+                    .field("freehigh", &self.freehigh)
+                    .field("mem_unit", &self.mem_unit)
+                    // FIXME: .field("__reserved", &self.__reserved)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sysinfo {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.uptime.hash(state);
+                self.loads.hash(state);
+                self.totalram.hash(state);
+                self.freeram.hash(state);
+                self.sharedram.hash(state);
+                self.bufferram.hash(state);
+                self.totalswap.hash(state);
+                self.freeswap.hash(state);
+                self.procs.hash(state);
+                self.pad.hash(state);
+                self.totalhigh.hash(state);
+                self.freehigh.hash(state);
+                self.mem_unit.hash(state);
+                self.__reserved.hash(state);
+            }
+        }
+
+        impl PartialEq for sockaddr_un {
+            fn eq(&self, other: &sockaddr_un) -> bool {
+                self.sun_family == other.sun_family
+                    && self
+                    .sun_path
+                    .iter()
+                    .zip(other.sun_path.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for sockaddr_un {}
+        impl ::fmt::Debug for sockaddr_un {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_un")
+                    .field("sun_family", &self.sun_family)
+                    // FIXME: .field("sun_path", &self.sun_path)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sockaddr_un {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sun_family.hash(state);
+                self.sun_path.hash(state);
+            }
+        }
+
+        impl PartialEq for sockaddr_storage {
+            fn eq(&self, other: &sockaddr_storage) -> bool {
+                self.ss_family == other.ss_family
+                    && self.__ss_align == other.__ss_align
+                    && self
+                    .__ss_pad2
+                    .iter()
+                    .zip(other.__ss_pad2.iter())
+                    .all(|(a, b)| a == b)
+            }
+        }
+        impl Eq for sockaddr_storage {}
+        impl ::fmt::Debug for sockaddr_storage {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_storage")
+                    .field("ss_family", &self.ss_family)
+                    .field("__ss_align", &self.__ss_align)
+                    // FIXME: .field("__ss_pad2", &self.__ss_pad2)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sockaddr_storage {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ss_family.hash(state);
+                self.__ss_align.hash(state);
+                self.__ss_pad2.hash(state);
+            }
+        }
+
+        impl PartialEq for utsname {
+            fn eq(&self, other: &utsname) -> bool {
+                self.sysname
+                    .iter()
+                    .zip(other.sysname.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .nodename
+                    .iter()
+                    .zip(other.nodename.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .release
+                    .iter()
+                    .zip(other.release.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .version
+                    .iter()
+                    .zip(other.version.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .machine
+                    .iter()
+                    .zip(other.machine.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for utsname {}
+        impl ::fmt::Debug for utsname {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("utsname")
+                    // FIXME: .field("sysname", &self.sysname)
+                    // FIXME: .field("nodename", &self.nodename)
+                    // FIXME: .field("release", &self.release)
+                    // FIXME: .field("version", &self.version)
+                    // FIXME: .field("machine", &self.machine)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for utsname {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sysname.hash(state);
+                self.nodename.hash(state);
+                self.release.hash(state);
+                self.version.hash(state);
+                self.machine.hash(state);
+            }
+        }
+
+        impl PartialEq for dirent {
+            fn eq(&self, other: &dirent) -> bool {
+                self.d_ino == other.d_ino
+                    && self.d_off == other.d_off
+                    && self.d_reclen == other.d_reclen
+                    && self.d_type == other.d_type
+                    && self
+                    .d_name
+                    .iter()
+                    .zip(other.d_name.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for dirent {}
+        impl ::fmt::Debug for dirent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("dirent")
+                    .field("d_ino", &self.d_ino)
+                    .field("d_off", &self.d_off)
+                    .field("d_reclen", &self.d_reclen)
+                    .field("d_type", &self.d_type)
+                    // FIXME: .field("d_name", &self.d_name)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for dirent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.d_ino.hash(state);
+                self.d_off.hash(state);
+                self.d_reclen.hash(state);
+                self.d_type.hash(state);
+                self.d_name.hash(state);
+            }
+        }
+
+        impl PartialEq for dirent64 {
+            fn eq(&self, other: &dirent64) -> bool {
+                self.d_ino == other.d_ino
+                    && self.d_off == other.d_off
+                    && self.d_reclen == other.d_reclen
+                    && self.d_type == other.d_type
+                    && self
+                    .d_name
+                    .iter()
+                    .zip(other.d_name.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for dirent64 {}
+        impl ::fmt::Debug for dirent64 {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("dirent64")
+                    .field("d_ino", &self.d_ino)
+                    .field("d_off", &self.d_off)
+                    .field("d_reclen", &self.d_reclen)
+                    .field("d_type", &self.d_type)
+                    // FIXME: .field("d_name", &self.d_name)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for dirent64 {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.d_ino.hash(state);
+                self.d_off.hash(state);
+                self.d_reclen.hash(state);
+                self.d_type.hash(state);
+                self.d_name.hash(state);
+            }
+        }
+
+        impl PartialEq for mq_attr {
+            fn eq(&self, other: &mq_attr) -> bool {
+                self.mq_flags == other.mq_flags &&
+                self.mq_maxmsg == other.mq_maxmsg &&
+                self.mq_msgsize == other.mq_msgsize &&
+                self.mq_curmsgs == other.mq_curmsgs
+            }
+        }
+        impl Eq for mq_attr {}
+        impl ::fmt::Debug for mq_attr {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("mq_attr")
+                    .field("mq_flags", &self.mq_flags)
+                    .field("mq_maxmsg", &self.mq_maxmsg)
+                    .field("mq_msgsize", &self.mq_msgsize)
+                    .field("mq_curmsgs", &self.mq_curmsgs)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for mq_attr {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.mq_flags.hash(state);
+                self.mq_maxmsg.hash(state);
+                self.mq_msgsize.hash(state);
+                self.mq_curmsgs.hash(state);
+            }
+        }
+
+        impl PartialEq for sockaddr_nl {
+            fn eq(&self, other: &sockaddr_nl) -> bool {
+                self.nl_family == other.nl_family &&
+                self.nl_pid == other.nl_pid &&
+                self.nl_groups == other.nl_groups
+            }
+        }
+        impl Eq for sockaddr_nl {}
+        impl ::fmt::Debug for sockaddr_nl {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_nl")
+                    .field("nl_family", &self.nl_family)
+                    .field("nl_pid", &self.nl_pid)
+                    .field("nl_groups", &self.nl_groups)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sockaddr_nl {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.nl_family.hash(state);
+                self.nl_pid.hash(state);
+                self.nl_groups.hash(state);
+            }
+        }
+
+        impl PartialEq for sigevent {
+            fn eq(&self, other: &sigevent) -> bool {
+                self.sigev_value == other.sigev_value
+                    && self.sigev_signo == other.sigev_signo
+                    && self.sigev_notify == other.sigev_notify
+                    && self.sigev_notify_function
+                        == other.sigev_notify_function
+                    && self.sigev_notify_attributes
+                        == other.sigev_notify_attributes
+            }
+        }
+        impl Eq for sigevent {}
+        impl ::fmt::Debug for sigevent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sigevent")
+                    .field("sigev_value", &self.sigev_value)
+                    .field("sigev_signo", &self.sigev_signo)
+                    .field("sigev_notify", &self.sigev_notify)
+                    .field("sigev_notify_function", &self.sigev_notify_function)
+                    .field("sigev_notify_attributes",
+                           &self.sigev_notify_attributes)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sigevent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sigev_value.hash(state);
+                self.sigev_signo.hash(state);
+                self.sigev_notify.hash(state);
+                self.sigev_notify_function.hash(state);
+                self.sigev_notify_attributes.hash(state);
+            }
+        }
+    }
+}
+
+// PUB_CONST
+
+pub const INT_MIN: c_int = -2147483648;
+pub const INT_MAX: c_int = 2147483647;
+
+pub const SIG_DFL: sighandler_t = 0 as sighandler_t;
+pub const SIG_IGN: sighandler_t = 1 as sighandler_t;
+pub const SIG_ERR: sighandler_t = !0 as sighandler_t;
+
+pub const DT_UNKNOWN: u8 = 0;
+pub const DT_FIFO: u8 = 1;
+pub const DT_CHR: u8 = 2;
+pub const DT_DIR: u8 = 4;
+pub const DT_BLK: u8 = 6;
+pub const DT_REG: u8 = 8;
+pub const DT_LNK: u8 = 10;
+pub const DT_SOCK: u8 = 12;
+
+pub const FD_CLOEXEC: ::c_int = 0x1;
+
+pub const USRQUOTA: ::c_int = 0;
+pub const GRPQUOTA: ::c_int = 1;
+
+pub const SIGIOT: ::c_int = 6;
+
+pub const S_ISUID: ::c_int = 0x800;
+pub const S_ISGID: ::c_int = 0x400;
+pub const S_ISVTX: ::c_int = 0x200;
+
+pub const IF_NAMESIZE: ::size_t = 16;
+pub const IFNAMSIZ: ::size_t = IF_NAMESIZE;
+
+pub const LOG_EMERG: ::c_int = 0;
+pub const LOG_ALERT: ::c_int = 1;
+pub const LOG_CRIT: ::c_int = 2;
+pub const LOG_ERR: ::c_int = 3;
+pub const LOG_WARNING: ::c_int = 4;
+pub const LOG_NOTICE: ::c_int = 5;
+pub const LOG_INFO: ::c_int = 6;
+pub const LOG_DEBUG: ::c_int = 7;
+
+pub const LOG_KERN: ::c_int = 0;
+pub const LOG_USER: ::c_int = 1 << 3;
+pub const LOG_MAIL: ::c_int = 2 << 3;
+pub const LOG_DAEMON: ::c_int = 3 << 3;
+pub const LOG_AUTH: ::c_int = 4 << 3;
+pub const LOG_SYSLOG: ::c_int = 5 << 3;
+pub const LOG_LPR: ::c_int = 6 << 3;
+pub const LOG_NEWS: ::c_int = 7 << 3;
+pub const LOG_UUCP: ::c_int = 8 << 3;
+pub const LOG_LOCAL0: ::c_int = 16 << 3;
+pub const LOG_LOCAL1: ::c_int = 17 << 3;
+pub const LOG_LOCAL2: ::c_int = 18 << 3;
+pub const LOG_LOCAL3: ::c_int = 19 << 3;
+pub const LOG_LOCAL4: ::c_int = 20 << 3;
+pub const LOG_LOCAL5: ::c_int = 21 << 3;
+pub const LOG_LOCAL6: ::c_int = 22 << 3;
+pub const LOG_LOCAL7: ::c_int = 23 << 3;
+
+pub const LOG_PID: ::c_int = 0x01;
+pub const LOG_CONS: ::c_int = 0x02;
+pub const LOG_ODELAY: ::c_int = 0x04;
+pub const LOG_NDELAY: ::c_int = 0x08;
+pub const LOG_NOWAIT: ::c_int = 0x10;
+
+pub const LOG_PRIMASK: ::c_int = 7;
+pub const LOG_FACMASK: ::c_int = 0x3f8;
+
+pub const PRIO_PROCESS: ::c_int = 0;
+pub const PRIO_PGRP: ::c_int = 1;
+pub const PRIO_USER: ::c_int = 2;
+
+pub const PRIO_MIN: ::c_int = -20;
+pub const PRIO_MAX: ::c_int = 20;
+
+pub const IPPROTO_ICMP: ::c_int = 1;
+pub const IPPROTO_ICMPV6: ::c_int = 58;
+pub const IPPROTO_TCP: ::c_int = 6;
+pub const IPPROTO_UDP: ::c_int = 17;
+pub const IPPROTO_IP: ::c_int = 0;
+pub const IPPROTO_IPV6: ::c_int = 41;
+
+pub const INADDR_LOOPBACK: in_addr_t = 2130706433;
+pub const INADDR_ANY: in_addr_t = 0;
+pub const INADDR_BROADCAST: in_addr_t = 4294967295;
+pub const INADDR_NONE: in_addr_t = 4294967295;
+
+pub const EXIT_FAILURE: ::c_int = 1;
+pub const EXIT_SUCCESS: ::c_int = 0;
+pub const RAND_MAX: ::c_int = 2147483647;
+pub const EOF: ::c_int = -1;
+pub const SEEK_SET: ::c_int = 0;
+pub const SEEK_CUR: ::c_int = 1;
+pub const SEEK_END: ::c_int = 2;
+pub const _IOFBF: ::c_int = 0;
+pub const _IONBF: ::c_int = 2;
+pub const _IOLBF: ::c_int = 1;
+
+pub const F_DUPFD: ::c_int = 0;
+pub const F_GETFD: ::c_int = 1;
+pub const F_SETFD: ::c_int = 2;
+pub const F_GETFL: ::c_int = 3;
+pub const F_SETFL: ::c_int = 4;
+
+// Linux-specific fcntls
+pub const F_SETLEASE: ::c_int = 1024;
+pub const F_GETLEASE: ::c_int = 1025;
+pub const F_NOTIFY: ::c_int = 1026;
+pub const F_CANCELLK: ::c_int = 1029;
+pub const F_DUPFD_CLOEXEC: ::c_int = 1030;
+pub const F_SETPIPE_SZ: ::c_int = 1031;
+pub const F_GETPIPE_SZ: ::c_int = 1032;
+pub const F_ADD_SEALS: ::c_int = 1033;
+pub const F_GET_SEALS: ::c_int = 1034;
+
+pub const F_SEAL_SEAL: ::c_int = 0x0001;
+pub const F_SEAL_SHRINK: ::c_int = 0x0002;
+pub const F_SEAL_GROW: ::c_int = 0x0004;
+pub const F_SEAL_WRITE: ::c_int = 0x0008;
+
+// FIXME(#235): Include file sealing fcntls once we have a way to verify them.
+
+pub const SIGTRAP: ::c_int = 5;
+
+pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
+pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
+
+pub const CLOCK_REALTIME: ::clockid_t = 0;
+pub const CLOCK_MONOTONIC: ::clockid_t = 1;
+pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
+pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 3;
+pub const CLOCK_MONOTONIC_RAW: ::clockid_t = 4;
+pub const CLOCK_REALTIME_COARSE: ::clockid_t = 5;
+pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = 6;
+pub const CLOCK_BOOTTIME: ::clockid_t = 7;
+pub const CLOCK_REALTIME_ALARM: ::clockid_t = 8;
+pub const CLOCK_BOOTTIME_ALARM: ::clockid_t = 9;
+pub const CLOCK_SGI_CYCLE: ::clockid_t = 10;
+pub const CLOCK_TAI: ::clockid_t = 11;
+pub const TIMER_ABSTIME: ::c_int = 1;
+
+pub const RLIMIT_CPU: ::c_int = 0;
+pub const RLIMIT_FSIZE: ::c_int = 1;
+pub const RLIMIT_DATA: ::c_int = 2;
+pub const RLIMIT_STACK: ::c_int = 3;
+pub const RLIMIT_CORE: ::c_int = 4;
+pub const RLIMIT_LOCKS: ::c_int = 10;
+pub const RLIMIT_SIGPENDING: ::c_int = 11;
+pub const RLIMIT_MSGQUEUE: ::c_int = 12;
+pub const RLIMIT_NICE: ::c_int = 13;
+pub const RLIMIT_RTPRIO: ::c_int = 14;
+
+pub const RUSAGE_SELF: ::c_int = 0;
+
+pub const O_RDONLY: ::c_int = 0;
+pub const O_WRONLY: ::c_int = 1;
+pub const O_RDWR: ::c_int = 2;
+
+pub const S_IFIFO: ::mode_t = 4096;
+pub const S_IFCHR: ::mode_t = 8192;
+pub const S_IFBLK: ::mode_t = 24576;
+pub const S_IFDIR: ::mode_t = 16384;
+pub const S_IFREG: ::mode_t = 32768;
+pub const S_IFLNK: ::mode_t = 40960;
+pub const S_IFSOCK: ::mode_t = 49152;
+pub const S_IFMT: ::mode_t = 61440;
+pub const S_IRWXU: ::mode_t = 448;
+pub const S_IXUSR: ::mode_t = 64;
+pub const S_IWUSR: ::mode_t = 128;
+pub const S_IRUSR: ::mode_t = 256;
+pub const S_IRWXG: ::mode_t = 56;
+pub const S_IXGRP: ::mode_t = 8;
+pub const S_IWGRP: ::mode_t = 16;
+pub const S_IRGRP: ::mode_t = 32;
+pub const S_IRWXO: ::mode_t = 7;
+pub const S_IXOTH: ::mode_t = 1;
+pub const S_IWOTH: ::mode_t = 2;
+pub const S_IROTH: ::mode_t = 4;
+pub const F_OK: ::c_int = 0;
+pub const R_OK: ::c_int = 4;
+pub const W_OK: ::c_int = 2;
+pub const X_OK: ::c_int = 1;
+pub const STDIN_FILENO: ::c_int = 0;
+pub const STDOUT_FILENO: ::c_int = 1;
+pub const STDERR_FILENO: ::c_int = 2;
+pub const SIGHUP: ::c_int = 1;
+pub const SIGINT: ::c_int = 2;
+pub const SIGQUIT: ::c_int = 3;
+pub const SIGILL: ::c_int = 4;
+pub const SIGABRT: ::c_int = 6;
+pub const SIGFPE: ::c_int = 8;
+pub const SIGKILL: ::c_int = 9;
+pub const SIGSEGV: ::c_int = 11;
+pub const SIGPIPE: ::c_int = 13;
+pub const SIGALRM: ::c_int = 14;
+pub const SIGTERM: ::c_int = 15;
+
+pub const PROT_NONE: ::c_int = 0;
+pub const PROT_READ: ::c_int = 1;
+pub const PROT_WRITE: ::c_int = 2;
+pub const PROT_EXEC: ::c_int = 4;
+
+pub const LC_CTYPE: ::c_int = 0;
+pub const LC_NUMERIC: ::c_int = 1;
+pub const LC_TIME: ::c_int = 2;
+pub const LC_COLLATE: ::c_int = 3;
+pub const LC_MONETARY: ::c_int = 4;
+pub const LC_MESSAGES: ::c_int = 5;
+pub const LC_ALL: ::c_int = 6;
+pub const LC_CTYPE_MASK: ::c_int = 1 << LC_CTYPE;
+pub const LC_NUMERIC_MASK: ::c_int = 1 << LC_NUMERIC;
+pub const LC_TIME_MASK: ::c_int = 1 << LC_TIME;
+pub const LC_COLLATE_MASK: ::c_int = 1 << LC_COLLATE;
+pub const LC_MONETARY_MASK: ::c_int = 1 << LC_MONETARY;
+pub const LC_MESSAGES_MASK: ::c_int = 1 << LC_MESSAGES;
+// LC_ALL_MASK defined per platform
+
+pub const MAP_FILE: ::c_int = 0x0000;
+pub const MAP_SHARED: ::c_int = 0x0001;
+pub const MAP_PRIVATE: ::c_int = 0x0002;
+pub const MAP_FIXED: ::c_int = 0x0010;
+
+pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
+
+// MS_ flags for msync(2)
+pub const MS_ASYNC: ::c_int = 0x0001;
+pub const MS_INVALIDATE: ::c_int = 0x0002;
+pub const MS_SYNC: ::c_int = 0x0004;
+
+// MS_ flags for mount(2)
+pub const MS_RDONLY: ::c_ulong = 0x01;
+pub const MS_NOSUID: ::c_ulong = 0x02;
+pub const MS_NODEV: ::c_ulong = 0x04;
+pub const MS_NOEXEC: ::c_ulong = 0x08;
+pub const MS_SYNCHRONOUS: ::c_ulong = 0x10;
+pub const MS_REMOUNT: ::c_ulong = 0x20;
+pub const MS_MANDLOCK: ::c_ulong = 0x40;
+pub const MS_DIRSYNC: ::c_ulong = 0x80;
+pub const MS_NOATIME: ::c_ulong = 0x0400;
+pub const MS_NODIRATIME: ::c_ulong = 0x0800;
+pub const MS_BIND: ::c_ulong = 0x1000;
+pub const MS_MOVE: ::c_ulong = 0x2000;
+pub const MS_REC: ::c_ulong = 0x4000;
+pub const MS_SILENT: ::c_ulong = 0x8000;
+pub const MS_POSIXACL: ::c_ulong = 0x010000;
+pub const MS_UNBINDABLE: ::c_ulong = 0x020000;
+pub const MS_PRIVATE: ::c_ulong = 0x040000;
+pub const MS_SLAVE: ::c_ulong = 0x080000;
+pub const MS_SHARED: ::c_ulong = 0x100000;
+pub const MS_RELATIME: ::c_ulong = 0x200000;
+pub const MS_KERNMOUNT: ::c_ulong = 0x400000;
+pub const MS_I_VERSION: ::c_ulong = 0x800000;
+pub const MS_STRICTATIME: ::c_ulong = 0x1000000;
+pub const MS_ACTIVE: ::c_ulong = 0x40000000;
+pub const MS_NOUSER: ::c_ulong = 0x80000000;
+pub const MS_MGC_VAL: ::c_ulong = 0xc0ed0000;
+pub const MS_MGC_MSK: ::c_ulong = 0xffff0000;
+pub const MS_RMT_MASK: ::c_ulong = 0x800051;
+
+pub const EPERM: ::c_int = 1;
+pub const ENOENT: ::c_int = 2;
+pub const ESRCH: ::c_int = 3;
+pub const EINTR: ::c_int = 4;
+pub const EIO: ::c_int = 5;
+pub const ENXIO: ::c_int = 6;
+pub const E2BIG: ::c_int = 7;
+pub const ENOEXEC: ::c_int = 8;
+pub const EBADF: ::c_int = 9;
+pub const ECHILD: ::c_int = 10;
+pub const EAGAIN: ::c_int = 11;
+pub const ENOMEM: ::c_int = 12;
+pub const EACCES: ::c_int = 13;
+pub const EFAULT: ::c_int = 14;
+pub const ENOTBLK: ::c_int = 15;
+pub const EBUSY: ::c_int = 16;
+pub const EEXIST: ::c_int = 17;
+pub const EXDEV: ::c_int = 18;
+pub const ENODEV: ::c_int = 19;
+pub const ENOTDIR: ::c_int = 20;
+pub const EISDIR: ::c_int = 21;
+pub const EINVAL: ::c_int = 22;
+pub const ENFILE: ::c_int = 23;
+pub const EMFILE: ::c_int = 24;
+pub const ENOTTY: ::c_int = 25;
+pub const ETXTBSY: ::c_int = 26;
+pub const EFBIG: ::c_int = 27;
+pub const ENOSPC: ::c_int = 28;
+pub const ESPIPE: ::c_int = 29;
+pub const EROFS: ::c_int = 30;
+pub const EMLINK: ::c_int = 31;
+pub const EPIPE: ::c_int = 32;
+pub const EDOM: ::c_int = 33;
+pub const ERANGE: ::c_int = 34;
+pub const EWOULDBLOCK: ::c_int = EAGAIN;
+
+pub const SCM_RIGHTS: ::c_int = 0x01;
+pub const SCM_CREDENTIALS: ::c_int = 0x02;
+
+pub const PROT_GROWSDOWN: ::c_int = 0x1000000;
+pub const PROT_GROWSUP: ::c_int = 0x2000000;
+
+pub const MAP_TYPE: ::c_int = 0x000f;
+
+pub const MADV_NORMAL: ::c_int = 0;
+pub const MADV_RANDOM: ::c_int = 1;
+pub const MADV_SEQUENTIAL: ::c_int = 2;
+pub const MADV_WILLNEED: ::c_int = 3;
+pub const MADV_DONTNEED: ::c_int = 4;
+pub const MADV_FREE: ::c_int = 8;
+pub const MADV_REMOVE: ::c_int = 9;
+pub const MADV_DONTFORK: ::c_int = 10;
+pub const MADV_DOFORK: ::c_int = 11;
+pub const MADV_MERGEABLE: ::c_int = 12;
+pub const MADV_UNMERGEABLE: ::c_int = 13;
+pub const MADV_HUGEPAGE: ::c_int = 14;
+pub const MADV_NOHUGEPAGE: ::c_int = 15;
+pub const MADV_DONTDUMP: ::c_int = 16;
+pub const MADV_DODUMP: ::c_int = 17;
+pub const MADV_HWPOISON: ::c_int = 100;
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+
+pub const IFF_UP: ::c_int = 0x1;
+pub const IFF_BROADCAST: ::c_int = 0x2;
+pub const IFF_DEBUG: ::c_int = 0x4;
+pub const IFF_LOOPBACK: ::c_int = 0x8;
+pub const IFF_POINTOPOINT: ::c_int = 0x10;
+pub const IFF_NOTRAILERS: ::c_int = 0x20;
+pub const IFF_RUNNING: ::c_int = 0x40;
+pub const IFF_NOARP: ::c_int = 0x80;
+pub const IFF_PROMISC: ::c_int = 0x100;
+pub const IFF_ALLMULTI: ::c_int = 0x200;
+pub const IFF_MASTER: ::c_int = 0x400;
+pub const IFF_SLAVE: ::c_int = 0x800;
+pub const IFF_MULTICAST: ::c_int = 0x1000;
+pub const IFF_PORTSEL: ::c_int = 0x2000;
+pub const IFF_AUTOMEDIA: ::c_int = 0x4000;
+pub const IFF_DYNAMIC: ::c_int = 0x8000;
+pub const IFF_TUN: ::c_int = 0x0001;
+pub const IFF_TAP: ::c_int = 0x0002;
+pub const IFF_NO_PI: ::c_int = 0x1000;
+
+pub const SOL_IP: ::c_int = 0;
+pub const SOL_TCP: ::c_int = 6;
+pub const SOL_UDP: ::c_int = 17;
+pub const SOL_IPV6: ::c_int = 41;
+pub const SOL_ICMPV6: ::c_int = 58;
+pub const SOL_RAW: ::c_int = 255;
+pub const SOL_DECNET: ::c_int = 261;
+pub const SOL_X25: ::c_int = 262;
+pub const SOL_PACKET: ::c_int = 263;
+pub const SOL_ATM: ::c_int = 264;
+pub const SOL_AAL: ::c_int = 265;
+pub const SOL_IRDA: ::c_int = 266;
+pub const SOL_NETBEUI: ::c_int = 267;
+pub const SOL_LLC: ::c_int = 268;
+pub const SOL_DCCP: ::c_int = 269;
+pub const SOL_NETLINK: ::c_int = 270;
+pub const SOL_TIPC: ::c_int = 271;
+
+pub const AF_UNSPEC: ::c_int = 0;
+pub const AF_UNIX: ::c_int = 1;
+pub const AF_LOCAL: ::c_int = 1;
+pub const AF_INET: ::c_int = 2;
+pub const AF_AX25: ::c_int = 3;
+pub const AF_IPX: ::c_int = 4;
+pub const AF_APPLETALK: ::c_int = 5;
+pub const AF_NETROM: ::c_int = 6;
+pub const AF_BRIDGE: ::c_int = 7;
+pub const AF_ATMPVC: ::c_int = 8;
+pub const AF_X25: ::c_int = 9;
+pub const AF_INET6: ::c_int = 10;
+pub const AF_ROSE: ::c_int = 11;
+pub const AF_DECnet: ::c_int = 12;
+pub const AF_NETBEUI: ::c_int = 13;
+pub const AF_SECURITY: ::c_int = 14;
+pub const AF_KEY: ::c_int = 15;
+pub const AF_NETLINK: ::c_int = 16;
+pub const AF_ROUTE: ::c_int = AF_NETLINK;
+pub const AF_PACKET: ::c_int = 17;
+pub const AF_ASH: ::c_int = 18;
+pub const AF_ECONET: ::c_int = 19;
+pub const AF_ATMSVC: ::c_int = 20;
+pub const AF_RDS: ::c_int = 21;
+pub const AF_SNA: ::c_int = 22;
+pub const AF_IRDA: ::c_int = 23;
+pub const AF_PPPOX: ::c_int = 24;
+pub const AF_WANPIPE: ::c_int = 25;
+pub const AF_LLC: ::c_int = 26;
+pub const AF_CAN: ::c_int = 29;
+pub const AF_TIPC: ::c_int = 30;
+pub const AF_BLUETOOTH: ::c_int = 31;
+pub const AF_IUCV: ::c_int = 32;
+pub const AF_RXRPC: ::c_int = 33;
+pub const AF_ISDN: ::c_int = 34;
+pub const AF_PHONET: ::c_int = 35;
+pub const AF_IEEE802154: ::c_int = 36;
+pub const AF_CAIF: ::c_int = 37;
+pub const AF_ALG: ::c_int = 38;
+
+pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
+pub const PF_UNIX: ::c_int = AF_UNIX;
+pub const PF_LOCAL: ::c_int = AF_LOCAL;
+pub const PF_INET: ::c_int = AF_INET;
+pub const PF_AX25: ::c_int = AF_AX25;
+pub const PF_IPX: ::c_int = AF_IPX;
+pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
+pub const PF_NETROM: ::c_int = AF_NETROM;
+pub const PF_BRIDGE: ::c_int = AF_BRIDGE;
+pub const PF_ATMPVC: ::c_int = AF_ATMPVC;
+pub const PF_X25: ::c_int = AF_X25;
+pub const PF_INET6: ::c_int = AF_INET6;
+pub const PF_ROSE: ::c_int = AF_ROSE;
+pub const PF_DECnet: ::c_int = AF_DECnet;
+pub const PF_NETBEUI: ::c_int = AF_NETBEUI;
+pub const PF_SECURITY: ::c_int = AF_SECURITY;
+pub const PF_KEY: ::c_int = AF_KEY;
+pub const PF_NETLINK: ::c_int = AF_NETLINK;
+pub const PF_ROUTE: ::c_int = AF_ROUTE;
+pub const PF_PACKET: ::c_int = AF_PACKET;
+pub const PF_ASH: ::c_int = AF_ASH;
+pub const PF_ECONET: ::c_int = AF_ECONET;
+pub const PF_ATMSVC: ::c_int = AF_ATMSVC;
+pub const PF_RDS: ::c_int = AF_RDS;
+pub const PF_SNA: ::c_int = AF_SNA;
+pub const PF_IRDA: ::c_int = AF_IRDA;
+pub const PF_PPPOX: ::c_int = AF_PPPOX;
+pub const PF_WANPIPE: ::c_int = AF_WANPIPE;
+pub const PF_LLC: ::c_int = AF_LLC;
+pub const PF_CAN: ::c_int = AF_CAN;
+pub const PF_TIPC: ::c_int = AF_TIPC;
+pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
+pub const PF_IUCV: ::c_int = AF_IUCV;
+pub const PF_RXRPC: ::c_int = AF_RXRPC;
+pub const PF_ISDN: ::c_int = AF_ISDN;
+pub const PF_PHONET: ::c_int = AF_PHONET;
+pub const PF_IEEE802154: ::c_int = AF_IEEE802154;
+pub const PF_CAIF: ::c_int = AF_CAIF;
+pub const PF_ALG: ::c_int = AF_ALG;
+
+pub const SOMAXCONN: ::c_int = 128;
+
+pub const MSG_OOB: ::c_int = 1;
+pub const MSG_PEEK: ::c_int = 2;
+pub const MSG_DONTROUTE: ::c_int = 4;
+pub const MSG_CTRUNC: ::c_int = 8;
+pub const MSG_TRUNC: ::c_int = 0x20;
+pub const MSG_DONTWAIT: ::c_int = 0x40;
+pub const MSG_EOR: ::c_int = 0x80;
+pub const MSG_WAITALL: ::c_int = 0x100;
+pub const MSG_FIN: ::c_int = 0x200;
+pub const MSG_SYN: ::c_int = 0x400;
+pub const MSG_CONFIRM: ::c_int = 0x800;
+pub const MSG_RST: ::c_int = 0x1000;
+pub const MSG_ERRQUEUE: ::c_int = 0x2000;
+pub const MSG_NOSIGNAL: ::c_int = 0x4000;
+pub const MSG_MORE: ::c_int = 0x8000;
+pub const MSG_WAITFORONE: ::c_int = 0x10000;
+pub const MSG_FASTOPEN: ::c_int = 0x20000000;
+pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000;
+
+pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
+
+pub const SOCK_RAW: ::c_int = 3;
+pub const SOCK_RDM: ::c_int = 4;
+
+pub const IP_TOS: ::c_int = 1;
+pub const IP_TTL: ::c_int = 2;
+pub const IP_HDRINCL: ::c_int = 3;
+pub const IP_RECVTOS: ::c_int = 13;
+pub const IP_FREEBIND: ::c_int = 15;
+pub const IP_TRANSPARENT: ::c_int = 19;
+pub const IP_MULTICAST_IF: ::c_int = 32;
+pub const IP_MULTICAST_TTL: ::c_int = 33;
+pub const IP_MULTICAST_LOOP: ::c_int = 34;
+pub const IP_ADD_MEMBERSHIP: ::c_int = 35;
+pub const IP_DROP_MEMBERSHIP: ::c_int = 36;
+
+pub const IPV6_UNICAST_HOPS: ::c_int = 16;
+pub const IPV6_MULTICAST_IF: ::c_int = 17;
+pub const IPV6_MULTICAST_HOPS: ::c_int = 18;
+pub const IPV6_MULTICAST_LOOP: ::c_int = 19;
+pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20;
+pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21;
+pub const IPV6_V6ONLY: ::c_int = 26;
+pub const IPV6_RECVPKTINFO: ::c_int = 49;
+pub const IPV6_RECVTCLASS: ::c_int = 66;
+pub const IPV6_TCLASS: ::c_int = 67;
+
+pub const TCP_NODELAY: ::c_int = 1;
+pub const TCP_MAXSEG: ::c_int = 2;
+pub const TCP_CORK: ::c_int = 3;
+pub const TCP_KEEPIDLE: ::c_int = 4;
+pub const TCP_KEEPINTVL: ::c_int = 5;
+pub const TCP_KEEPCNT: ::c_int = 6;
+pub const TCP_SYNCNT: ::c_int = 7;
+pub const TCP_LINGER2: ::c_int = 8;
+pub const TCP_DEFER_ACCEPT: ::c_int = 9;
+pub const TCP_WINDOW_CLAMP: ::c_int = 10;
+pub const TCP_INFO: ::c_int = 11;
+pub const TCP_QUICKACK: ::c_int = 12;
+pub const TCP_CONGESTION: ::c_int = 13;
+
+pub const SO_DEBUG: ::c_int = 1;
+
+pub const SHUT_RD: ::c_int = 0;
+pub const SHUT_WR: ::c_int = 1;
+pub const SHUT_RDWR: ::c_int = 2;
+
+pub const LOCK_SH: ::c_int = 1;
+pub const LOCK_EX: ::c_int = 2;
+pub const LOCK_NB: ::c_int = 4;
+pub const LOCK_UN: ::c_int = 8;
+
+pub const SS_ONSTACK: ::c_int = 1;
+pub const SS_DISABLE: ::c_int = 2;
+
+pub const PATH_MAX: ::c_int = 4096;
+
+pub const FD_SETSIZE: usize = 1024;
+
+pub const EPOLLIN: ::c_int = 0x1;
+pub const EPOLLPRI: ::c_int = 0x2;
+pub const EPOLLOUT: ::c_int = 0x4;
+pub const EPOLLRDNORM: ::c_int = 0x40;
+pub const EPOLLRDBAND: ::c_int = 0x80;
+pub const EPOLLWRNORM: ::c_int = 0x100;
+pub const EPOLLWRBAND: ::c_int = 0x200;
+pub const EPOLLMSG: ::c_int = 0x400;
+pub const EPOLLERR: ::c_int = 0x8;
+pub const EPOLLHUP: ::c_int = 0x10;
+pub const EPOLLET: ::c_int = 0x80000000;
+
+pub const EPOLL_CTL_ADD: ::c_int = 1;
+pub const EPOLL_CTL_MOD: ::c_int = 3;
+pub const EPOLL_CTL_DEL: ::c_int = 2;
+
+pub const MNT_DETACH: ::c_int = 0x2;
+pub const MNT_EXPIRE: ::c_int = 0x4;
+
+pub const Q_GETFMT: ::c_int = 0x800004;
+pub const Q_GETINFO: ::c_int = 0x800005;
+pub const Q_SETINFO: ::c_int = 0x800006;
+pub const QIF_BLIMITS: u32 = 1;
+pub const QIF_SPACE: u32 = 2;
+pub const QIF_ILIMITS: u32 = 4;
+pub const QIF_INODES: u32 = 8;
+pub const QIF_BTIME: u32 = 16;
+pub const QIF_ITIME: u32 = 32;
+pub const QIF_LIMITS: u32 = 5;
+pub const QIF_USAGE: u32 = 10;
+pub const QIF_TIMES: u32 = 48;
+pub const QIF_ALL: u32 = 63;
+
+pub const MNT_FORCE: ::c_int = 0x1;
+
+pub const Q_SYNC: ::c_int = 0x800001;
+pub const Q_QUOTAON: ::c_int = 0x800002;
+pub const Q_QUOTAOFF: ::c_int = 0x800003;
+pub const Q_GETQUOTA: ::c_int = 0x800007;
+pub const Q_SETQUOTA: ::c_int = 0x800008;
+
+pub const TCIOFF: ::c_int = 2;
+pub const TCION: ::c_int = 3;
+pub const TCOOFF: ::c_int = 0;
+pub const TCOON: ::c_int = 1;
+pub const TCIFLUSH: ::c_int = 0;
+pub const TCOFLUSH: ::c_int = 1;
+pub const TCIOFLUSH: ::c_int = 2;
+pub const NL0: ::c_int = 0x00000000;
+pub const NL1: ::c_int = 0x00000100;
+pub const TAB0: ::c_int = 0x00000000;
+pub const CR0: ::c_int = 0x00000000;
+pub const FF0: ::c_int = 0x00000000;
+pub const BS0: ::c_int = 0x00000000;
+pub const VT0: ::c_int = 0x00000000;
+pub const VERASE: usize = 2;
+pub const VKILL: usize = 3;
+pub const VINTR: usize = 0;
+pub const VQUIT: usize = 1;
+pub const VLNEXT: usize = 15;
+pub const IGNBRK: ::tcflag_t = 0x00000001;
+pub const BRKINT: ::tcflag_t = 0x00000002;
+pub const IGNPAR: ::tcflag_t = 0x00000004;
+pub const PARMRK: ::tcflag_t = 0x00000008;
+pub const INPCK: ::tcflag_t = 0x00000010;
+pub const ISTRIP: ::tcflag_t = 0x00000020;
+pub const INLCR: ::tcflag_t = 0x00000040;
+pub const IGNCR: ::tcflag_t = 0x00000080;
+pub const ICRNL: ::tcflag_t = 0x00000100;
+pub const IXANY: ::tcflag_t = 0x00000800;
+pub const IMAXBEL: ::tcflag_t = 0x00002000;
+pub const OPOST: ::tcflag_t = 0x1;
+pub const CS5: ::tcflag_t = 0x00000000;
+pub const CRTSCTS: ::tcflag_t = 0x80000000;
+pub const ECHO: ::tcflag_t = 0x00000008;
+pub const OCRNL: ::tcflag_t = 0o000010;
+pub const ONOCR: ::tcflag_t = 0o000020;
+pub const ONLRET: ::tcflag_t = 0o000040;
+pub const OFILL: ::tcflag_t = 0o000100;
+pub const OFDEL: ::tcflag_t = 0o000200;
+
+pub const CLONE_VM: ::c_int = 0x100;
+pub const CLONE_FS: ::c_int = 0x200;
+pub const CLONE_FILES: ::c_int = 0x400;
+pub const CLONE_SIGHAND: ::c_int = 0x800;
+pub const CLONE_PTRACE: ::c_int = 0x2000;
+pub const CLONE_VFORK: ::c_int = 0x4000;
+pub const CLONE_PARENT: ::c_int = 0x8000;
+pub const CLONE_THREAD: ::c_int = 0x10000;
+pub const CLONE_NEWNS: ::c_int = 0x20000;
+pub const CLONE_SYSVSEM: ::c_int = 0x40000;
+pub const CLONE_SETTLS: ::c_int = 0x80000;
+pub const CLONE_PARENT_SETTID: ::c_int = 0x100000;
+pub const CLONE_CHILD_CLEARTID: ::c_int = 0x200000;
+pub const CLONE_DETACHED: ::c_int = 0x400000;
+pub const CLONE_UNTRACED: ::c_int = 0x800000;
+pub const CLONE_CHILD_SETTID: ::c_int = 0x01000000;
+pub const CLONE_NEWUTS: ::c_int = 0x04000000;
+pub const CLONE_NEWIPC: ::c_int = 0x08000000;
+pub const CLONE_NEWUSER: ::c_int = 0x10000000;
+pub const CLONE_NEWPID: ::c_int = 0x20000000;
+pub const CLONE_NEWNET: ::c_int = 0x40000000;
+pub const CLONE_IO: ::c_int = 0x80000000;
+pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
+
+pub const WNOHANG: ::c_int = 0x00000001;
+pub const WUNTRACED: ::c_int = 0x00000002;
+pub const WSTOPPED: ::c_int = WUNTRACED;
+pub const WEXITED: ::c_int = 0x00000004;
+pub const WCONTINUED: ::c_int = 0x00000008;
+pub const WNOWAIT: ::c_int = 0x01000000;
+
+// ::Options set using PTRACE_SETOPTIONS.
+pub const PTRACE_O_TRACESYSGOOD: ::c_int = 0x00000001;
+pub const PTRACE_O_TRACEFORK: ::c_int = 0x00000002;
+pub const PTRACE_O_TRACEVFORK: ::c_int = 0x00000004;
+pub const PTRACE_O_TRACECLONE: ::c_int = 0x00000008;
+pub const PTRACE_O_TRACEEXEC: ::c_int = 0x00000010;
+pub const PTRACE_O_TRACEVFORKDONE: ::c_int = 0x00000020;
+pub const PTRACE_O_TRACEEXIT: ::c_int = 0x00000040;
+pub const PTRACE_O_TRACESECCOMP: ::c_int = 0x00000080;
+pub const PTRACE_O_EXITKILL: ::c_int = 0x00100000;
+pub const PTRACE_O_SUSPEND_SECCOMP: ::c_int = 0x00200000;
+pub const PTRACE_O_MASK: ::c_int = 0x003000ff;
+
+// Wait extended result codes for the above trace options.
+pub const PTRACE_EVENT_FORK: ::c_int = 1;
+pub const PTRACE_EVENT_VFORK: ::c_int = 2;
+pub const PTRACE_EVENT_CLONE: ::c_int = 3;
+pub const PTRACE_EVENT_EXEC: ::c_int = 4;
+pub const PTRACE_EVENT_VFORK_DONE: ::c_int = 5;
+pub const PTRACE_EVENT_EXIT: ::c_int = 6;
+pub const PTRACE_EVENT_SECCOMP: ::c_int = 7;
+// PTRACE_EVENT_STOP was added to glibc in 2.26
+// pub const PTRACE_EVENT_STOP: ::c_int = 128;
+
+pub const __WNOTHREAD: ::c_int = 0x20000000;
+pub const __WALL: ::c_int = 0x40000000;
+pub const __WCLONE: ::c_int = 0x80000000;
+
+pub const SPLICE_F_MOVE: ::c_uint = 0x01;
+pub const SPLICE_F_NONBLOCK: ::c_uint = 0x02;
+pub const SPLICE_F_MORE: ::c_uint = 0x04;
+pub const SPLICE_F_GIFT: ::c_uint = 0x08;
+
+pub const RTLD_LOCAL: ::c_int = 0;
+pub const RTLD_LAZY: ::c_int = 1;
+
+pub const POSIX_FADV_NORMAL: ::c_int = 0;
+pub const POSIX_FADV_RANDOM: ::c_int = 1;
+pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
+pub const POSIX_FADV_WILLNEED: ::c_int = 3;
+
+pub const AT_FDCWD: ::c_int = -100;
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x100;
+pub const AT_REMOVEDIR: ::c_int = 0x200;
+pub const AT_EACCESS: ::c_int = 0x200;
+pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
+pub const AT_NO_AUTOMOUNT: ::c_int = 0x800;
+pub const AT_EMPTY_PATH: ::c_int = 0x1000;
+
+pub const LOG_CRON: ::c_int = 9 << 3;
+pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
+pub const LOG_FTP: ::c_int = 11 << 3;
+pub const LOG_PERROR: ::c_int = 0x20;
+
+pub const PIPE_BUF: usize = 4096;
+
+pub const SI_LOAD_SHIFT: ::c_uint = 16;
+
+pub const CLD_EXITED: ::c_int = 1;
+pub const CLD_KILLED: ::c_int = 2;
+pub const CLD_DUMPED: ::c_int = 3;
+pub const CLD_TRAPPED: ::c_int = 4;
+pub const CLD_STOPPED: ::c_int = 5;
+pub const CLD_CONTINUED: ::c_int = 6;
+
+pub const SIGEV_SIGNAL: ::c_int = 0;
+pub const SIGEV_NONE: ::c_int = 1;
+pub const SIGEV_THREAD: ::c_int = 2;
+
+pub const P_ALL: idtype_t = 0;
+pub const P_PID: idtype_t = 1;
+pub const P_PGID: idtype_t = 2;
+
+pub const UTIME_OMIT: c_long = 1073741822;
+pub const UTIME_NOW: c_long = 1073741823;
+
+pub const POLLIN: ::c_short = 0x1;
+pub const POLLPRI: ::c_short = 0x2;
+pub const POLLOUT: ::c_short = 0x4;
+pub const POLLERR: ::c_short = 0x8;
+pub const POLLHUP: ::c_short = 0x10;
+pub const POLLNVAL: ::c_short = 0x20;
+pub const POLLRDNORM: ::c_short = 0x040;
+pub const POLLRDBAND: ::c_short = 0x080;
+
+pub const ABDAY_1: ::nl_item = 0x20000;
+pub const ABDAY_2: ::nl_item = 0x20001;
+pub const ABDAY_3: ::nl_item = 0x20002;
+pub const ABDAY_4: ::nl_item = 0x20003;
+pub const ABDAY_5: ::nl_item = 0x20004;
+pub const ABDAY_6: ::nl_item = 0x20005;
+pub const ABDAY_7: ::nl_item = 0x20006;
+
+pub const DAY_1: ::nl_item = 0x20007;
+pub const DAY_2: ::nl_item = 0x20008;
+pub const DAY_3: ::nl_item = 0x20009;
+pub const DAY_4: ::nl_item = 0x2000A;
+pub const DAY_5: ::nl_item = 0x2000B;
+pub const DAY_6: ::nl_item = 0x2000C;
+pub const DAY_7: ::nl_item = 0x2000D;
+
+pub const ABMON_1: ::nl_item = 0x2000E;
+pub const ABMON_2: ::nl_item = 0x2000F;
+pub const ABMON_3: ::nl_item = 0x20010;
+pub const ABMON_4: ::nl_item = 0x20011;
+pub const ABMON_5: ::nl_item = 0x20012;
+pub const ABMON_6: ::nl_item = 0x20013;
+pub const ABMON_7: ::nl_item = 0x20014;
+pub const ABMON_8: ::nl_item = 0x20015;
+pub const ABMON_9: ::nl_item = 0x20016;
+pub const ABMON_10: ::nl_item = 0x20017;
+pub const ABMON_11: ::nl_item = 0x20018;
+pub const ABMON_12: ::nl_item = 0x20019;
+
+pub const MON_1: ::nl_item = 0x2001A;
+pub const MON_2: ::nl_item = 0x2001B;
+pub const MON_3: ::nl_item = 0x2001C;
+pub const MON_4: ::nl_item = 0x2001D;
+pub const MON_5: ::nl_item = 0x2001E;
+pub const MON_6: ::nl_item = 0x2001F;
+pub const MON_7: ::nl_item = 0x20020;
+pub const MON_8: ::nl_item = 0x20021;
+pub const MON_9: ::nl_item = 0x20022;
+pub const MON_10: ::nl_item = 0x20023;
+pub const MON_11: ::nl_item = 0x20024;
+pub const MON_12: ::nl_item = 0x20025;
+
+pub const AM_STR: ::nl_item = 0x20026;
+pub const PM_STR: ::nl_item = 0x20027;
+
+pub const D_T_FMT: ::nl_item = 0x20028;
+pub const D_FMT: ::nl_item = 0x20029;
+pub const T_FMT: ::nl_item = 0x2002A;
+pub const T_FMT_AMPM: ::nl_item = 0x2002B;
+
+pub const ERA: ::nl_item = 0x2002C;
+pub const ERA_D_FMT: ::nl_item = 0x2002E;
+pub const ALT_DIGITS: ::nl_item = 0x2002F;
+pub const ERA_D_T_FMT: ::nl_item = 0x20030;
+pub const ERA_T_FMT: ::nl_item = 0x20031;
+
+pub const CODESET: ::nl_item = 14;
+
+pub const CRNCYSTR: ::nl_item = 0x4000F;
+
+pub const RUSAGE_THREAD: ::c_int = 1;
+pub const RUSAGE_CHILDREN: ::c_int = -1;
+
+pub const RADIXCHAR: ::nl_item = 0x10000;
+pub const THOUSEP: ::nl_item = 0x10001;
+
+pub const YESEXPR: ::nl_item = 0x50000;
+pub const NOEXPR: ::nl_item = 0x50001;
+pub const YESSTR: ::nl_item = 0x50002;
+pub const NOSTR: ::nl_item = 0x50003;
+
+pub const FILENAME_MAX: ::c_uint = 4096;
+pub const L_tmpnam: ::c_uint = 20;
+pub const _PC_LINK_MAX: ::c_int = 0;
+pub const _PC_MAX_CANON: ::c_int = 1;
+pub const _PC_MAX_INPUT: ::c_int = 2;
+pub const _PC_NAME_MAX: ::c_int = 3;
+pub const _PC_PATH_MAX: ::c_int = 4;
+pub const _PC_PIPE_BUF: ::c_int = 5;
+pub const _PC_CHOWN_RESTRICTED: ::c_int = 6;
+pub const _PC_NO_TRUNC: ::c_int = 7;
+pub const _PC_VDISABLE: ::c_int = 8;
+pub const _PC_SYNC_IO: ::c_int = 9;
+pub const _PC_ASYNC_IO: ::c_int = 10;
+pub const _PC_PRIO_IO: ::c_int = 11;
+pub const _PC_SOCK_MAXBUF: ::c_int = 12;
+pub const _PC_FILESIZEBITS: ::c_int = 13;
+pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14;
+pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15;
+pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16;
+pub const _PC_REC_XFER_ALIGN: ::c_int = 17;
+pub const _PC_ALLOC_SIZE_MIN: ::c_int = 18;
+pub const _PC_SYMLINK_MAX: ::c_int = 19;
+pub const _PC_2_SYMLINKS: ::c_int = 20;
+
+pub const _SC_ARG_MAX: ::c_int = 0;
+pub const _SC_CHILD_MAX: ::c_int = 1;
+pub const _SC_CLK_TCK: ::c_int = 2;
+pub const _SC_NGROUPS_MAX: ::c_int = 3;
+pub const _SC_OPEN_MAX: ::c_int = 4;
+pub const _SC_STREAM_MAX: ::c_int = 5;
+pub const _SC_TZNAME_MAX: ::c_int = 6;
+pub const _SC_JOB_CONTROL: ::c_int = 7;
+pub const _SC_SAVED_IDS: ::c_int = 8;
+pub const _SC_REALTIME_SIGNALS: ::c_int = 9;
+pub const _SC_PRIORITY_SCHEDULING: ::c_int = 10;
+pub const _SC_TIMERS: ::c_int = 11;
+pub const _SC_ASYNCHRONOUS_IO: ::c_int = 12;
+pub const _SC_PRIORITIZED_IO: ::c_int = 13;
+pub const _SC_SYNCHRONIZED_IO: ::c_int = 14;
+pub const _SC_FSYNC: ::c_int = 15;
+pub const _SC_MAPPED_FILES: ::c_int = 16;
+pub const _SC_MEMLOCK: ::c_int = 17;
+pub const _SC_MEMLOCK_RANGE: ::c_int = 18;
+pub const _SC_MEMORY_PROTECTION: ::c_int = 19;
+pub const _SC_MESSAGE_PASSING: ::c_int = 20;
+pub const _SC_SEMAPHORES: ::c_int = 21;
+pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 22;
+pub const _SC_AIO_LISTIO_MAX: ::c_int = 23;
+pub const _SC_AIO_MAX: ::c_int = 24;
+pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 25;
+pub const _SC_DELAYTIMER_MAX: ::c_int = 26;
+pub const _SC_MQ_OPEN_MAX: ::c_int = 27;
+pub const _SC_MQ_PRIO_MAX: ::c_int = 28;
+pub const _SC_VERSION: ::c_int = 29;
+pub const _SC_PAGESIZE: ::c_int = 30;
+pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
+pub const _SC_RTSIG_MAX: ::c_int = 31;
+pub const _SC_SEM_NSEMS_MAX: ::c_int = 32;
+pub const _SC_SEM_VALUE_MAX: ::c_int = 33;
+pub const _SC_SIGQUEUE_MAX: ::c_int = 34;
+pub const _SC_TIMER_MAX: ::c_int = 35;
+pub const _SC_BC_BASE_MAX: ::c_int = 36;
+pub const _SC_BC_DIM_MAX: ::c_int = 37;
+pub const _SC_BC_SCALE_MAX: ::c_int = 38;
+pub const _SC_BC_STRING_MAX: ::c_int = 39;
+pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 40;
+pub const _SC_EXPR_NEST_MAX: ::c_int = 42;
+pub const _SC_LINE_MAX: ::c_int = 43;
+pub const _SC_RE_DUP_MAX: ::c_int = 44;
+pub const _SC_2_VERSION: ::c_int = 46;
+pub const _SC_2_C_BIND: ::c_int = 47;
+pub const _SC_2_C_DEV: ::c_int = 48;
+pub const _SC_2_FORT_DEV: ::c_int = 49;
+pub const _SC_2_FORT_RUN: ::c_int = 50;
+pub const _SC_2_SW_DEV: ::c_int = 51;
+pub const _SC_2_LOCALEDEF: ::c_int = 52;
+pub const _SC_UIO_MAXIOV: ::c_int = 60;
+pub const _SC_IOV_MAX: ::c_int = 60;
+pub const _SC_THREADS: ::c_int = 67;
+pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 68;
+pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 69;
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 70;
+pub const _SC_LOGIN_NAME_MAX: ::c_int = 71;
+pub const _SC_TTY_NAME_MAX: ::c_int = 72;
+pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 73;
+pub const _SC_THREAD_KEYS_MAX: ::c_int = 74;
+pub const _SC_THREAD_STACK_MIN: ::c_int = 75;
+pub const _SC_THREAD_THREADS_MAX: ::c_int = 76;
+pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77;
+pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78;
+pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 79;
+pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 80;
+pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 81;
+pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 82;
+pub const _SC_NPROCESSORS_CONF: ::c_int = 83;
+pub const _SC_NPROCESSORS_ONLN: ::c_int = 84;
+pub const _SC_PHYS_PAGES: ::c_int = 85;
+pub const _SC_AVPHYS_PAGES: ::c_int = 86;
+pub const _SC_ATEXIT_MAX: ::c_int = 87;
+pub const _SC_PASS_MAX: ::c_int = 88;
+pub const _SC_XOPEN_VERSION: ::c_int = 89;
+pub const _SC_XOPEN_XCU_VERSION: ::c_int = 90;
+pub const _SC_XOPEN_UNIX: ::c_int = 91;
+pub const _SC_XOPEN_CRYPT: ::c_int = 92;
+pub const _SC_XOPEN_ENH_I18N: ::c_int = 93;
+pub const _SC_XOPEN_SHM: ::c_int = 94;
+pub const _SC_2_CHAR_TERM: ::c_int = 95;
+pub const _SC_2_UPE: ::c_int = 97;
+pub const _SC_XOPEN_XPG2: ::c_int = 98;
+pub const _SC_XOPEN_XPG3: ::c_int = 99;
+pub const _SC_XOPEN_XPG4: ::c_int = 100;
+pub const _SC_NZERO: ::c_int = 109;
+pub const _SC_XBS5_ILP32_OFF32: ::c_int = 125;
+pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 126;
+pub const _SC_XBS5_LP64_OFF64: ::c_int = 127;
+pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 128;
+pub const _SC_XOPEN_LEGACY: ::c_int = 129;
+pub const _SC_XOPEN_REALTIME: ::c_int = 130;
+pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 131;
+pub const _SC_ADVISORY_INFO: ::c_int = 132;
+pub const _SC_BARRIERS: ::c_int = 133;
+pub const _SC_CLOCK_SELECTION: ::c_int = 137;
+pub const _SC_CPUTIME: ::c_int = 138;
+pub const _SC_THREAD_CPUTIME: ::c_int = 139;
+pub const _SC_MONOTONIC_CLOCK: ::c_int = 149;
+pub const _SC_READER_WRITER_LOCKS: ::c_int = 153;
+pub const _SC_SPIN_LOCKS: ::c_int = 154;
+pub const _SC_REGEXP: ::c_int = 155;
+pub const _SC_SHELL: ::c_int = 157;
+pub const _SC_SPAWN: ::c_int = 159;
+pub const _SC_SPORADIC_SERVER: ::c_int = 160;
+pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 161;
+pub const _SC_TIMEOUTS: ::c_int = 164;
+pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 165;
+pub const _SC_2_PBS: ::c_int = 168;
+pub const _SC_2_PBS_ACCOUNTING: ::c_int = 169;
+pub const _SC_2_PBS_LOCATE: ::c_int = 170;
+pub const _SC_2_PBS_MESSAGE: ::c_int = 171;
+pub const _SC_2_PBS_TRACK: ::c_int = 172;
+pub const _SC_SYMLOOP_MAX: ::c_int = 173;
+pub const _SC_STREAMS: ::c_int = 174;
+pub const _SC_2_PBS_CHECKPOINT: ::c_int = 175;
+pub const _SC_V6_ILP32_OFF32: ::c_int = 176;
+pub const _SC_V6_ILP32_OFFBIG: ::c_int = 177;
+pub const _SC_V6_LP64_OFF64: ::c_int = 178;
+pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 179;
+pub const _SC_HOST_NAME_MAX: ::c_int = 180;
+pub const _SC_TRACE: ::c_int = 181;
+pub const _SC_TRACE_EVENT_FILTER: ::c_int = 182;
+pub const _SC_TRACE_INHERIT: ::c_int = 183;
+pub const _SC_TRACE_LOG: ::c_int = 184;
+pub const _SC_IPV6: ::c_int = 235;
+pub const _SC_RAW_SOCKETS: ::c_int = 236;
+pub const _SC_V7_ILP32_OFF32: ::c_int = 237;
+pub const _SC_V7_ILP32_OFFBIG: ::c_int = 238;
+pub const _SC_V7_LP64_OFF64: ::c_int = 239;
+pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 240;
+pub const _SC_SS_REPL_MAX: ::c_int = 241;
+pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 242;
+pub const _SC_TRACE_NAME_MAX: ::c_int = 243;
+pub const _SC_TRACE_SYS_MAX: ::c_int = 244;
+pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 245;
+pub const _SC_XOPEN_STREAMS: ::c_int = 246;
+pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 247;
+pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 248;
+
+pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY;
+pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY;
+
+pub const GLOB_ERR: ::c_int = 1 << 0;
+pub const GLOB_MARK: ::c_int = 1 << 1;
+pub const GLOB_NOSORT: ::c_int = 1 << 2;
+pub const GLOB_DOOFFS: ::c_int = 1 << 3;
+pub const GLOB_NOCHECK: ::c_int = 1 << 4;
+pub const GLOB_APPEND: ::c_int = 1 << 5;
+pub const GLOB_NOESCAPE: ::c_int = 1 << 6;
+
+pub const GLOB_NOSPACE: ::c_int = 1;
+pub const GLOB_ABORTED: ::c_int = 2;
+pub const GLOB_NOMATCH: ::c_int = 3;
+
+pub const POSIX_MADV_NORMAL: ::c_int = 0;
+pub const POSIX_MADV_RANDOM: ::c_int = 1;
+pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
+pub const POSIX_MADV_WILLNEED: ::c_int = 3;
+
+pub const S_IEXEC: mode_t = 64;
+pub const S_IWRITE: mode_t = 128;
+pub const S_IREAD: mode_t = 256;
+
+pub const F_LOCK: ::c_int = 1;
+pub const F_TEST: ::c_int = 3;
+pub const F_TLOCK: ::c_int = 2;
+pub const F_ULOCK: ::c_int = 0;
+
+pub const IFF_LOWER_UP: ::c_int = 0x10000;
+pub const IFF_DORMANT: ::c_int = 0x20000;
+pub const IFF_ECHO: ::c_int = 0x40000;
+
+pub const ST_RDONLY: ::c_ulong = 1;
+pub const ST_NOSUID: ::c_ulong = 2;
+pub const ST_NODEV: ::c_ulong = 4;
+pub const ST_NOEXEC: ::c_ulong = 8;
+pub const ST_SYNCHRONOUS: ::c_ulong = 16;
+pub const ST_MANDLOCK: ::c_ulong = 64;
+pub const ST_WRITE: ::c_ulong = 128;
+pub const ST_APPEND: ::c_ulong = 256;
+pub const ST_IMMUTABLE: ::c_ulong = 512;
+pub const ST_NOATIME: ::c_ulong = 1024;
+pub const ST_NODIRATIME: ::c_ulong = 2048;
+
+pub const RTLD_NEXT: *mut ::c_void = -1i64 as *mut ::c_void;
+pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
+pub const RTLD_NODELETE: ::c_int = 0x1000;
+pub const RTLD_NOW: ::c_int = 0x2;
+
+pub const TCP_MD5SIG: ::c_int = 14;
+
+align_const! {
+    pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+        size: [0; __SIZEOF_PTHREAD_MUTEX_T],
+    };
+    pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+        size: [0; __SIZEOF_PTHREAD_COND_T],
+    };
+    pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+        size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
+    };
+}
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
+pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
+pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
+pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
+pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
+pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
+
+pub const RENAME_NOREPLACE: ::c_int = 1;
+pub const RENAME_EXCHANGE: ::c_int = 2;
+pub const RENAME_WHITEOUT: ::c_int = 4;
+
+pub const SCHED_OTHER: ::c_int = 0;
+pub const SCHED_FIFO: ::c_int = 1;
+pub const SCHED_RR: ::c_int = 2;
+pub const SCHED_BATCH: ::c_int = 3;
+pub const SCHED_IDLE: ::c_int = 5;
+
+// netinet/in.h
+// NOTE: These are in addition to the constants defined in src/unix/mod.rs
+
+// IPPROTO_IP defined in src/unix/mod.rs
+/// Hop-by-hop option header
+pub const IPPROTO_HOPOPTS: ::c_int = 0;
+// IPPROTO_ICMP defined in src/unix/mod.rs
+/// group mgmt protocol
+pub const IPPROTO_IGMP: ::c_int = 2;
+/// for compatibility
+pub const IPPROTO_IPIP: ::c_int = 4;
+// IPPROTO_TCP defined in src/unix/mod.rs
+/// exterior gateway protocol
+pub const IPPROTO_EGP: ::c_int = 8;
+/// pup
+pub const IPPROTO_PUP: ::c_int = 12;
+// IPPROTO_UDP defined in src/unix/mod.rs
+/// xns idp
+pub const IPPROTO_IDP: ::c_int = 22;
+/// tp-4 w/ class negotiation
+pub const IPPROTO_TP: ::c_int = 29;
+/// DCCP
+pub const IPPROTO_DCCP: ::c_int = 33;
+// IPPROTO_IPV6 defined in src/unix/mod.rs
+/// IP6 routing header
+pub const IPPROTO_ROUTING: ::c_int = 43;
+/// IP6 fragmentation header
+pub const IPPROTO_FRAGMENT: ::c_int = 44;
+/// resource reservation
+pub const IPPROTO_RSVP: ::c_int = 46;
+/// General Routing Encap.
+pub const IPPROTO_GRE: ::c_int = 47;
+/// IP6 Encap Sec. Payload
+pub const IPPROTO_ESP: ::c_int = 50;
+/// IP6 Auth Header
+pub const IPPROTO_AH: ::c_int = 51;
+// IPPROTO_ICMPV6 defined in src/unix/mod.rs
+/// IP6 no next header
+pub const IPPROTO_NONE: ::c_int = 59;
+/// IP6 destination option
+pub const IPPROTO_DSTOPTS: ::c_int = 60;
+pub const IPPROTO_MTP: ::c_int = 92;
+pub const IPPROTO_BEETPH: ::c_int = 94;
+/// encapsulation header
+pub const IPPROTO_ENCAP: ::c_int = 98;
+/// Protocol indep. multicast
+pub const IPPROTO_PIM: ::c_int = 103;
+/// IP Payload Comp. Protocol
+pub const IPPROTO_COMP: ::c_int = 108;
+/// SCTP
+pub const IPPROTO_SCTP: ::c_int = 132;
+pub const IPPROTO_MH: ::c_int = 135;
+pub const IPPROTO_UDPLITE: ::c_int = 136;
+pub const IPPROTO_MPLS: ::c_int = 137;
+/// raw IP packet
+pub const IPPROTO_RAW: ::c_int = 255;
+pub const IPPROTO_MAX: ::c_int = 256;
+
+pub const AF_IB: ::c_int = 27;
+pub const AF_MPLS: ::c_int = 28;
+pub const AF_NFC: ::c_int = 39;
+pub const AF_VSOCK: ::c_int = 40;
+pub const PF_IB: ::c_int = AF_IB;
+pub const PF_MPLS: ::c_int = AF_MPLS;
+pub const PF_NFC: ::c_int = AF_NFC;
+pub const PF_VSOCK: ::c_int = AF_VSOCK;
+
+// System V IPC
+pub const IPC_PRIVATE: ::key_t = 0;
+
+pub const IPC_CREAT: ::c_int = 0o1000;
+pub const IPC_EXCL: ::c_int = 0o2000;
+pub const IPC_NOWAIT: ::c_int = 0o4000;
+
+pub const IPC_RMID: ::c_int = 0;
+pub const IPC_SET: ::c_int = 1;
+pub const IPC_STAT: ::c_int = 2;
+pub const IPC_INFO: ::c_int = 3;
+pub const MSG_STAT: ::c_int = 11;
+pub const MSG_INFO: ::c_int = 12;
+
+pub const MSG_NOERROR: ::c_int = 0o10000;
+pub const MSG_EXCEPT: ::c_int = 0o20000;
+pub const MSG_COPY: ::c_int = 0o40000;
+
+pub const SHM_R: ::c_int = 0o400;
+pub const SHM_W: ::c_int = 0o200;
+
+pub const SHM_RDONLY: ::c_int = 0o10000;
+pub const SHM_RND: ::c_int = 0o20000;
+pub const SHM_REMAP: ::c_int = 0o40000;
+pub const SHM_EXEC: ::c_int = 0o100000;
+
+pub const SHM_LOCK: ::c_int = 11;
+pub const SHM_UNLOCK: ::c_int = 12;
+
+pub const SHM_HUGETLB: ::c_int = 0o4000;
+pub const SHM_NORESERVE: ::c_int = 0o10000;
+
+pub const EPOLLRDHUP: ::c_int = 0x2000;
+pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000;
+pub const EPOLLONESHOT: ::c_int = 0x40000000;
+
+pub const QFMT_VFS_OLD: ::c_int = 1;
+pub const QFMT_VFS_V0: ::c_int = 2;
+pub const QFMT_VFS_V1: ::c_int = 4;
+
+pub const EFD_SEMAPHORE: ::c_int = 0x1;
+
+pub const LOG_NFACILITIES: ::c_int = 24;
+
+pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t;
+
+pub const RB_AUTOBOOT: ::c_int = 0x01234567u32 as i32;
+pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123u32 as i32;
+pub const RB_ENABLE_CAD: ::c_int = 0x89abcdefu32 as i32;
+pub const RB_DISABLE_CAD: ::c_int = 0x00000000u32 as i32;
+pub const RB_POWER_OFF: ::c_int = 0x4321fedcu32 as i32;
+pub const RB_SW_SUSPEND: ::c_int = 0xd000fce2u32 as i32;
+pub const RB_KEXEC: ::c_int = 0x45584543u32 as i32;
+
+pub const AI_PASSIVE: ::c_int = 0x0001;
+pub const AI_CANONNAME: ::c_int = 0x0002;
+pub const AI_NUMERICHOST: ::c_int = 0x0004;
+pub const AI_V4MAPPED: ::c_int = 0x0008;
+pub const AI_ALL: ::c_int = 0x0010;
+pub const AI_ADDRCONFIG: ::c_int = 0x0020;
+
+pub const AI_NUMERICSERV: ::c_int = 0x0400;
+
+pub const EAI_BADFLAGS: ::c_int = -1;
+pub const EAI_NONAME: ::c_int = -2;
+pub const EAI_AGAIN: ::c_int = -3;
+pub const EAI_FAIL: ::c_int = -4;
+pub const EAI_FAMILY: ::c_int = -6;
+pub const EAI_SOCKTYPE: ::c_int = -7;
+pub const EAI_SERVICE: ::c_int = -8;
+pub const EAI_MEMORY: ::c_int = -10;
+pub const EAI_OVERFLOW: ::c_int = -12;
+
+pub const NI_NUMERICHOST: ::c_int = 1;
+pub const NI_NUMERICSERV: ::c_int = 2;
+pub const NI_NOFQDN: ::c_int = 4;
+pub const NI_NAMEREQD: ::c_int = 8;
+pub const NI_DGRAM: ::c_int = 16;
+
+pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1;
+pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2;
+pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4;
+
+pub const EAI_SYSTEM: ::c_int = -11;
+
+pub const AIO_CANCELED: ::c_int = 0;
+pub const AIO_NOTCANCELED: ::c_int = 1;
+pub const AIO_ALLDONE: ::c_int = 2;
+pub const LIO_READ: ::c_int = 0;
+pub const LIO_WRITE: ::c_int = 1;
+pub const LIO_NOP: ::c_int = 2;
+pub const LIO_WAIT: ::c_int = 0;
+pub const LIO_NOWAIT: ::c_int = 1;
+
+pub const MREMAP_MAYMOVE: ::c_int = 1;
+pub const MREMAP_FIXED: ::c_int = 2;
+
+pub const PR_SET_PDEATHSIG: ::c_int = 1;
+pub const PR_GET_PDEATHSIG: ::c_int = 2;
+
+pub const PR_GET_DUMPABLE: ::c_int = 3;
+pub const PR_SET_DUMPABLE: ::c_int = 4;
+
+pub const PR_GET_UNALIGN: ::c_int = 5;
+pub const PR_SET_UNALIGN: ::c_int = 6;
+pub const PR_UNALIGN_NOPRINT: ::c_int = 1;
+pub const PR_UNALIGN_SIGBUS: ::c_int = 2;
+
+pub const PR_GET_KEEPCAPS: ::c_int = 7;
+pub const PR_SET_KEEPCAPS: ::c_int = 8;
+
+pub const PR_GET_FPEMU: ::c_int = 9;
+pub const PR_SET_FPEMU: ::c_int = 10;
+pub const PR_FPEMU_NOPRINT: ::c_int = 1;
+pub const PR_FPEMU_SIGFPE: ::c_int = 2;
+
+pub const PR_GET_FPEXC: ::c_int = 11;
+pub const PR_SET_FPEXC: ::c_int = 12;
+pub const PR_FP_EXC_SW_ENABLE: ::c_int = 0x80;
+pub const PR_FP_EXC_DIV: ::c_int = 0x010000;
+pub const PR_FP_EXC_OVF: ::c_int = 0x020000;
+pub const PR_FP_EXC_UND: ::c_int = 0x040000;
+pub const PR_FP_EXC_RES: ::c_int = 0x080000;
+pub const PR_FP_EXC_INV: ::c_int = 0x100000;
+pub const PR_FP_EXC_DISABLED: ::c_int = 0;
+pub const PR_FP_EXC_NONRECOV: ::c_int = 1;
+pub const PR_FP_EXC_ASYNC: ::c_int = 2;
+pub const PR_FP_EXC_PRECISE: ::c_int = 3;
+
+pub const PR_GET_TIMING: ::c_int = 13;
+pub const PR_SET_TIMING: ::c_int = 14;
+pub const PR_TIMING_STATISTICAL: ::c_int = 0;
+pub const PR_TIMING_TIMESTAMP: ::c_int = 1;
+
+pub const PR_SET_NAME: ::c_int = 15;
+pub const PR_GET_NAME: ::c_int = 16;
+
+pub const PR_GET_ENDIAN: ::c_int = 19;
+pub const PR_SET_ENDIAN: ::c_int = 20;
+pub const PR_ENDIAN_BIG: ::c_int = 0;
+pub const PR_ENDIAN_LITTLE: ::c_int = 1;
+pub const PR_ENDIAN_PPC_LITTLE: ::c_int = 2;
+
+pub const PR_GET_SECCOMP: ::c_int = 21;
+pub const PR_SET_SECCOMP: ::c_int = 22;
+
+pub const PR_CAPBSET_READ: ::c_int = 23;
+pub const PR_CAPBSET_DROP: ::c_int = 24;
+
+pub const PR_GET_TSC: ::c_int = 25;
+pub const PR_SET_TSC: ::c_int = 26;
+pub const PR_TSC_ENABLE: ::c_int = 1;
+pub const PR_TSC_SIGSEGV: ::c_int = 2;
+
+pub const PR_GET_SECUREBITS: ::c_int = 27;
+pub const PR_SET_SECUREBITS: ::c_int = 28;
+
+pub const PR_SET_TIMERSLACK: ::c_int = 29;
+pub const PR_GET_TIMERSLACK: ::c_int = 30;
+
+pub const PR_TASK_PERF_EVENTS_DISABLE: ::c_int = 31;
+pub const PR_TASK_PERF_EVENTS_ENABLE: ::c_int = 32;
+
+pub const PR_MCE_KILL: ::c_int = 33;
+pub const PR_MCE_KILL_CLEAR: ::c_int = 0;
+pub const PR_MCE_KILL_SET: ::c_int = 1;
+
+pub const PR_MCE_KILL_LATE: ::c_int = 0;
+pub const PR_MCE_KILL_EARLY: ::c_int = 1;
+pub const PR_MCE_KILL_DEFAULT: ::c_int = 2;
+
+pub const PR_MCE_KILL_GET: ::c_int = 34;
+
+pub const PR_SET_MM: ::c_int = 35;
+pub const PR_SET_MM_START_CODE: ::c_int = 1;
+pub const PR_SET_MM_END_CODE: ::c_int = 2;
+pub const PR_SET_MM_START_DATA: ::c_int = 3;
+pub const PR_SET_MM_END_DATA: ::c_int = 4;
+pub const PR_SET_MM_START_STACK: ::c_int = 5;
+pub const PR_SET_MM_START_BRK: ::c_int = 6;
+pub const PR_SET_MM_BRK: ::c_int = 7;
+pub const PR_SET_MM_ARG_START: ::c_int = 8;
+pub const PR_SET_MM_ARG_END: ::c_int = 9;
+pub const PR_SET_MM_ENV_START: ::c_int = 10;
+pub const PR_SET_MM_ENV_END: ::c_int = 11;
+pub const PR_SET_MM_AUXV: ::c_int = 12;
+pub const PR_SET_MM_EXE_FILE: ::c_int = 13;
+pub const PR_SET_MM_MAP: ::c_int = 14;
+pub const PR_SET_MM_MAP_SIZE: ::c_int = 15;
+
+pub const PR_SET_PTRACER: ::c_int = 0x59616d61;
+pub const PR_SET_PTRACER_ANY: ::c_ulong = 0xffffffffffffffff;
+
+pub const PR_SET_CHILD_SUBREAPER: ::c_int = 36;
+pub const PR_GET_CHILD_SUBREAPER: ::c_int = 37;
+
+pub const PR_SET_NO_NEW_PRIVS: ::c_int = 38;
+pub const PR_GET_NO_NEW_PRIVS: ::c_int = 39;
+
+pub const PR_GET_TID_ADDRESS: ::c_int = 40;
+
+pub const PR_SET_THP_DISABLE: ::c_int = 41;
+pub const PR_GET_THP_DISABLE: ::c_int = 42;
+
+pub const PR_MPX_ENABLE_MANAGEMENT: ::c_int = 43;
+pub const PR_MPX_DISABLE_MANAGEMENT: ::c_int = 44;
+
+pub const PR_SET_FP_MODE: ::c_int = 45;
+pub const PR_GET_FP_MODE: ::c_int = 46;
+pub const PR_FP_MODE_FR: ::c_int = 1 << 0;
+pub const PR_FP_MODE_FRE: ::c_int = 1 << 1;
+
+pub const PR_CAP_AMBIENT: ::c_int = 47;
+pub const PR_CAP_AMBIENT_IS_SET: ::c_int = 1;
+pub const PR_CAP_AMBIENT_RAISE: ::c_int = 2;
+pub const PR_CAP_AMBIENT_LOWER: ::c_int = 3;
+pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4;
+
+pub const ITIMER_REAL: ::c_int = 0;
+pub const ITIMER_VIRTUAL: ::c_int = 1;
+pub const ITIMER_PROF: ::c_int = 2;
+
+pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC;
+pub const TFD_NONBLOCK: ::c_int = O_NONBLOCK;
+pub const TFD_TIMER_ABSTIME: ::c_int = 1;
+
+pub const XATTR_CREATE: ::c_int = 0x1;
+pub const XATTR_REPLACE: ::c_int = 0x2;
+
+pub const _POSIX_VDISABLE: ::cc_t = 0;
+
+pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01;
+pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02;
+pub const FALLOC_FL_COLLAPSE_RANGE: ::c_int = 0x08;
+pub const FALLOC_FL_ZERO_RANGE: ::c_int = 0x10;
+pub const FALLOC_FL_INSERT_RANGE: ::c_int = 0x20;
+pub const FALLOC_FL_UNSHARE_RANGE: ::c_int = 0x40;
+
+// On Linux, libc doesn't define this constant, libattr does instead.
+// We still define it for Linux as it's defined by libc on other platforms,
+// and it's mentioned in the man pages for getxattr and setxattr.
+pub const ENOATTR: ::c_int = ::ENODATA;
+
+pub const SO_ORIGINAL_DST: ::c_int = 80;
+pub const IUTF8: ::tcflag_t = 0x00004000;
+pub const CMSPAR: ::tcflag_t = 0o10000000000;
+
+pub const MFD_CLOEXEC: ::c_uint = 0x0001;
+pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
+
+// these are used in the p_type field of Elf32_Phdr and Elf64_Phdr, which has
+// the type Elf32Word and Elf64Word respectively. Luckily, both of those are u32
+// so we can use that type here to avoid having to cast.
+pub const PT_NULL: u32 = 0;
+pub const PT_LOAD: u32 = 1;
+pub const PT_DYNAMIC: u32 = 2;
+pub const PT_INTERP: u32 = 3;
+pub const PT_NOTE: u32 = 4;
+pub const PT_SHLIB: u32 = 5;
+pub const PT_PHDR: u32 = 6;
+pub const PT_TLS: u32 = 7;
+pub const PT_NUM: u32 = 8;
+pub const PT_LOOS: u32 = 0x60000000;
+pub const PT_GNU_EH_FRAME: u32 = 0x6474e550;
+pub const PT_GNU_STACK: u32 = 0x6474e551;
+pub const PT_GNU_RELRO: u32 = 0x6474e552;
+
+// Ethernet protocol IDs.
+pub const ETH_P_LOOP: ::c_int = 0x0060;
+pub const ETH_P_PUP: ::c_int = 0x0200;
+pub const ETH_P_PUPAT: ::c_int = 0x0201;
+pub const ETH_P_IP: ::c_int = 0x0800;
+pub const ETH_P_X25: ::c_int = 0x0805;
+pub const ETH_P_ARP: ::c_int = 0x0806;
+pub const ETH_P_BPQ: ::c_int = 0x08FF;
+pub const ETH_P_IEEEPUP: ::c_int = 0x0a00;
+pub const ETH_P_IEEEPUPAT: ::c_int = 0x0a01;
+pub const ETH_P_BATMAN: ::c_int = 0x4305;
+pub const ETH_P_DEC: ::c_int = 0x6000;
+pub const ETH_P_DNA_DL: ::c_int = 0x6001;
+pub const ETH_P_DNA_RC: ::c_int = 0x6002;
+pub const ETH_P_DNA_RT: ::c_int = 0x6003;
+pub const ETH_P_LAT: ::c_int = 0x6004;
+pub const ETH_P_DIAG: ::c_int = 0x6005;
+pub const ETH_P_CUST: ::c_int = 0x6006;
+pub const ETH_P_SCA: ::c_int = 0x6007;
+pub const ETH_P_TEB: ::c_int = 0x6558;
+pub const ETH_P_RARP: ::c_int = 0x8035;
+pub const ETH_P_ATALK: ::c_int = 0x809B;
+pub const ETH_P_AARP: ::c_int = 0x80F3;
+pub const ETH_P_8021Q: ::c_int = 0x8100;
+pub const ETH_P_IPX: ::c_int = 0x8137;
+pub const ETH_P_IPV6: ::c_int = 0x86DD;
+pub const ETH_P_PAUSE: ::c_int = 0x8808;
+pub const ETH_P_SLOW: ::c_int = 0x8809;
+pub const ETH_P_WCCP: ::c_int = 0x883E;
+pub const ETH_P_MPLS_UC: ::c_int = 0x8847;
+pub const ETH_P_MPLS_MC: ::c_int = 0x8848;
+pub const ETH_P_ATMMPOA: ::c_int = 0x884c;
+pub const ETH_P_PPP_DISC: ::c_int = 0x8863;
+pub const ETH_P_PPP_SES: ::c_int = 0x8864;
+pub const ETH_P_LINK_CTL: ::c_int = 0x886c;
+pub const ETH_P_ATMFATE: ::c_int = 0x8884;
+pub const ETH_P_PAE: ::c_int = 0x888E;
+pub const ETH_P_AOE: ::c_int = 0x88A2;
+pub const ETH_P_8021AD: ::c_int = 0x88A8;
+pub const ETH_P_802_EX1: ::c_int = 0x88B5;
+pub const ETH_P_TIPC: ::c_int = 0x88CA;
+pub const ETH_P_8021AH: ::c_int = 0x88E7;
+pub const ETH_P_MVRP: ::c_int = 0x88F5;
+pub const ETH_P_1588: ::c_int = 0x88F7;
+pub const ETH_P_PRP: ::c_int = 0x88FB;
+pub const ETH_P_FCOE: ::c_int = 0x8906;
+pub const ETH_P_TDLS: ::c_int = 0x890D;
+pub const ETH_P_FIP: ::c_int = 0x8914;
+pub const ETH_P_80221: ::c_int = 0x8917;
+pub const ETH_P_LOOPBACK: ::c_int = 0x9000;
+pub const ETH_P_QINQ1: ::c_int = 0x9100;
+pub const ETH_P_QINQ2: ::c_int = 0x9200;
+pub const ETH_P_QINQ3: ::c_int = 0x9300;
+pub const ETH_P_EDSA: ::c_int = 0xDADA;
+pub const ETH_P_AF_IUCV: ::c_int = 0xFBFB;
+
+pub const ETH_P_802_3_MIN: ::c_int = 0x0600;
+
+pub const ETH_P_802_3: ::c_int = 0x0001;
+pub const ETH_P_AX25: ::c_int = 0x0002;
+pub const ETH_P_ALL: ::c_int = 0x0003;
+pub const ETH_P_802_2: ::c_int = 0x0004;
+pub const ETH_P_SNAP: ::c_int = 0x0005;
+pub const ETH_P_DDCMP: ::c_int = 0x0006;
+pub const ETH_P_WAN_PPP: ::c_int = 0x0007;
+pub const ETH_P_PPP_MP: ::c_int = 0x0008;
+pub const ETH_P_LOCALTALK: ::c_int = 0x0009;
+pub const ETH_P_CAN: ::c_int = 0x000C;
+pub const ETH_P_CANFD: ::c_int = 0x000D;
+pub const ETH_P_PPPTALK: ::c_int = 0x0010;
+pub const ETH_P_TR_802_2: ::c_int = 0x0011;
+pub const ETH_P_MOBITEX: ::c_int = 0x0015;
+pub const ETH_P_CONTROL: ::c_int = 0x0016;
+pub const ETH_P_IRDA: ::c_int = 0x0017;
+pub const ETH_P_ECONET: ::c_int = 0x0018;
+pub const ETH_P_HDLC: ::c_int = 0x0019;
+pub const ETH_P_ARCNET: ::c_int = 0x001A;
+pub const ETH_P_DSA: ::c_int = 0x001B;
+pub const ETH_P_TRAILER: ::c_int = 0x001C;
+pub const ETH_P_PHONET: ::c_int = 0x00F5;
+pub const ETH_P_IEEE802154: ::c_int = 0x00F6;
+pub const ETH_P_CAIF: ::c_int = 0x00F7;
+
+pub const SFD_CLOEXEC: ::c_int = 0x080000;
+
+pub const NCCS: usize = 32;
+
+pub const O_TRUNC: ::c_int = 0x00040000;
+pub const O_NOATIME: ::c_int = 0x00002000;
+pub const O_CLOEXEC: ::c_int = 0x00000100;
+pub const O_TMPFILE: ::c_int = 0x00004000;
+
+pub const EBFONT: ::c_int = 59;
+pub const ENOSTR: ::c_int = 60;
+pub const ENODATA: ::c_int = 61;
+pub const ETIME: ::c_int = 62;
+pub const ENOSR: ::c_int = 63;
+pub const ENONET: ::c_int = 64;
+pub const ENOPKG: ::c_int = 65;
+pub const EREMOTE: ::c_int = 66;
+pub const ENOLINK: ::c_int = 67;
+pub const EADV: ::c_int = 68;
+pub const ESRMNT: ::c_int = 69;
+pub const ECOMM: ::c_int = 70;
+pub const EPROTO: ::c_int = 71;
+pub const EDOTDOT: ::c_int = 73;
+
+pub const SA_NODEFER: ::c_int = 0x40000000;
+pub const SA_RESETHAND: ::c_int = 0x80000000;
+pub const SA_RESTART: ::c_int = 0x10000000;
+pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
+
+pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
+
+pub const EFD_CLOEXEC: ::c_int = 0x80000;
+
+pub const BUFSIZ: ::c_uint = 1024;
+pub const TMP_MAX: ::c_uint = 10000;
+pub const FOPEN_MAX: ::c_uint = 1000;
+pub const O_PATH: ::c_int = 0x00400000;
+pub const O_EXEC: ::c_int = O_PATH;
+pub const O_SEARCH: ::c_int = O_PATH;
+pub const O_ACCMODE: ::c_int = 03 | O_SEARCH;
+pub const O_NDELAY: ::c_int = O_NONBLOCK;
+pub const NI_MAXHOST: ::socklen_t = 255;
+pub const PTHREAD_STACK_MIN: ::size_t = 2048;
+pub const POSIX_FADV_DONTNEED: ::c_int = 4;
+pub const POSIX_FADV_NOREUSE: ::c_int = 5;
+
+pub const POSIX_MADV_DONTNEED: ::c_int = 4;
+
+pub const RLIM_INFINITY: ::rlim_t = !0;
+pub const RLIMIT_RTTIME: ::c_int = 15;
+#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+pub const RLIMIT_NLIMITS: ::c_int = 16;
+#[allow(deprecated)]
+#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+pub const RLIM_NLIMITS: ::c_int = RLIMIT_NLIMITS;
+
+pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
+
+pub const SOCK_DCCP: ::c_int = 6;
+pub const SOCK_PACKET: ::c_int = 10;
+
+pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
+pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
+pub const TCP_THIN_DUPACK: ::c_int = 17;
+pub const TCP_USER_TIMEOUT: ::c_int = 18;
+pub const TCP_REPAIR: ::c_int = 19;
+pub const TCP_REPAIR_QUEUE: ::c_int = 20;
+pub const TCP_QUEUE_SEQ: ::c_int = 21;
+pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
+pub const TCP_FASTOPEN: ::c_int = 23;
+pub const TCP_TIMESTAMP: ::c_int = 24;
+
+pub const SIGUNUSED: ::c_int = ::SIGSYS;
+
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
+
+pub const CPU_SETSIZE: ::c_int = 128;
+
+pub const PTRACE_TRACEME: ::c_int = 0;
+pub const PTRACE_PEEKTEXT: ::c_int = 1;
+pub const PTRACE_PEEKDATA: ::c_int = 2;
+pub const PTRACE_PEEKUSER: ::c_int = 3;
+pub const PTRACE_POKETEXT: ::c_int = 4;
+pub const PTRACE_POKEDATA: ::c_int = 5;
+pub const PTRACE_POKEUSER: ::c_int = 6;
+pub const PTRACE_CONT: ::c_int = 7;
+pub const PTRACE_KILL: ::c_int = 8;
+pub const PTRACE_SINGLESTEP: ::c_int = 9;
+pub const PTRACE_GETREGS: ::c_int = 12;
+pub const PTRACE_SETREGS: ::c_int = 13;
+pub const PTRACE_GETFPREGS: ::c_int = 14;
+pub const PTRACE_SETFPREGS: ::c_int = 15;
+pub const PTRACE_ATTACH: ::c_int = 16;
+pub const PTRACE_DETACH: ::c_int = 17;
+pub const PTRACE_GETFPXREGS: ::c_int = 18;
+pub const PTRACE_SETFPXREGS: ::c_int = 19;
+pub const PTRACE_SYSCALL: ::c_int = 24;
+pub const PTRACE_SETOPTIONS: ::c_int = 0x4200;
+pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201;
+pub const PTRACE_GETSIGINFO: ::c_int = 0x4202;
+pub const PTRACE_SETSIGINFO: ::c_int = 0x4203;
+pub const PTRACE_GETREGSET: ::c_int = 0x4204;
+pub const PTRACE_SETREGSET: ::c_int = 0x4205;
+pub const PTRACE_SEIZE: ::c_int = 0x4206;
+pub const PTRACE_INTERRUPT: ::c_int = 0x4207;
+pub const PTRACE_LISTEN: ::c_int = 0x4208;
+pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
+
+pub const EPOLLWAKEUP: ::c_int = 0x20000000;
+
+pub const EFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
+
+pub const SFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
+
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+
+pub const TIOCINQ: ::c_int = ::FIONREAD;
+
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::c_int = 0x00000800;
+pub const TAB2: ::c_int = 0x00001000;
+pub const TAB3: ::c_int = 0x00001800;
+pub const CR1: ::c_int = 0x00000200;
+pub const CR2: ::c_int = 0x00000400;
+pub const CR3: ::c_int = 0x00000600;
+pub const FF1: ::c_int = 0x00008000;
+pub const BS1: ::c_int = 0x00002000;
+pub const VT1: ::c_int = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const SO_BINDTODEVICE: ::c_int = 25;
+pub const SO_TIMESTAMP: ::c_int = 29;
+pub const SO_MARK: ::c_int = 36;
+pub const SO_RXQ_OVFL: ::c_int = 40;
+pub const SO_PEEK_OFF: ::c_int = 42;
+pub const SO_BUSY_POLL: ::c_int = 46;
+
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+
+pub const O_ASYNC: ::c_int = 0x00000400;
+
+pub const FIOCLEX: ::c_int = 0x5451;
+pub const FIONBIO: ::c_int = 0x5421;
+
+pub const RLIMIT_RSS: ::c_int = 5;
+pub const RLIMIT_NOFILE: ::c_int = 7;
+pub const RLIMIT_AS: ::c_int = 9;
+pub const RLIMIT_NPROC: ::c_int = 6;
+pub const RLIMIT_MEMLOCK: ::c_int = 8;
+
+pub const O_APPEND: ::c_int = 0x00100000;
+pub const O_CREAT: ::c_int = 0x00010000;
+pub const O_EXCL: ::c_int = 0x00020000;
+pub const O_NOCTTY: ::c_int = 0x00000200;
+pub const O_NONBLOCK: ::c_int = 0x00000010;
+pub const O_SYNC: ::c_int = 0x00000040 | O_DSYNC;
+pub const O_RSYNC: ::c_int = O_SYNC;
+pub const O_DSYNC: ::c_int = 0x00000020;
+
+pub const SOCK_CLOEXEC: ::c_int = 0o2000000;
+pub const SOCK_NONBLOCK: ::c_int = 0o4000;
+
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_LOCKED: ::c_int = 0x02000;
+pub const MAP_NORESERVE: ::c_int = 0x04000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+pub const SOCK_SEQPACKET: ::c_int = 5;
+
+pub const SOL_SOCKET: ::c_int = 1;
+
+pub const EDEADLK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EDEADLOCK: ::c_int = EDEADLK;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EBADMSG: ::c_int = 74;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const ERFKILL: ::c_int = 132;
+pub const EHWPOISON: ::c_int = 133;
+
+pub const SO_REUSEADDR: ::c_int = 2;
+pub const SO_TYPE: ::c_int = 3;
+pub const SO_ERROR: ::c_int = 4;
+pub const SO_DONTROUTE: ::c_int = 5;
+pub const SO_BROADCAST: ::c_int = 6;
+pub const SO_SNDBUF: ::c_int = 7;
+pub const SO_RCVBUF: ::c_int = 8;
+pub const SO_KEEPALIVE: ::c_int = 9;
+pub const SO_OOBINLINE: ::c_int = 10;
+pub const SO_NO_CHECK: ::c_int = 11;
+pub const SO_PRIORITY: ::c_int = 12;
+pub const SO_LINGER: ::c_int = 13;
+pub const SO_BSDCOMPAT: ::c_int = 14;
+pub const SO_REUSEPORT: ::c_int = 15;
+pub const SO_PASSCRED: ::c_int = 16;
+pub const SO_PEERCRED: ::c_int = 17;
+pub const SO_RCVLOWAT: ::c_int = 18;
+pub const SO_SNDLOWAT: ::c_int = 19;
+pub const SO_RCVTIMEO: ::c_int = 20;
+pub const SO_SNDTIMEO: ::c_int = 21;
+pub const SO_ACCEPTCONN: ::c_int = 30;
+pub const SO_SNDBUFFORCE: ::c_int = 32;
+pub const SO_RCVBUFFORCE: ::c_int = 33;
+pub const SO_PROTOCOL: ::c_int = 38;
+pub const SO_DOMAIN: ::c_int = 39;
+
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+pub const F_SETOWN: ::c_int = 8;
+
+pub const VEOF: usize = 4;
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+
+pub const TCGETS: ::c_int = 0x5401;
+pub const TCSETS: ::c_int = 0x5402;
+pub const TCSETSW: ::c_int = 0x5403;
+pub const TCSETSF: ::c_int = 0x5404;
+pub const TCGETA: ::c_int = 0x5405;
+pub const TCSETA: ::c_int = 0x5406;
+pub const TCSETAW: ::c_int = 0x5407;
+pub const TCSETAF: ::c_int = 0x5408;
+pub const TCSBRK: ::c_int = 0x5409;
+pub const TCXONC: ::c_int = 0x540A;
+pub const TCFLSH: ::c_int = 0x540B;
+pub const TIOCGSOFTCAR: ::c_int = 0x5419;
+pub const TIOCSSOFTCAR: ::c_int = 0x541A;
+pub const TIOCLINUX: ::c_int = 0x541C;
+pub const TIOCGSERIAL: ::c_int = 0x541E;
+pub const TIOCEXCL: ::c_int = 0x540C;
+pub const TIOCNXCL: ::c_int = 0x540D;
+pub const TIOCSCTTY: ::c_int = 0x540E;
+pub const TIOCGPGRP: ::c_int = 0x540F;
+pub const TIOCSPGRP: ::c_int = 0x5410;
+pub const TIOCOUTQ: ::c_int = 0x5411;
+pub const TIOCSTI: ::c_int = 0x5412;
+pub const TIOCGWINSZ: ::c_int = 0x5413;
+pub const TIOCSWINSZ: ::c_int = 0x5414;
+pub const TIOCMGET: ::c_int = 0x5415;
+pub const TIOCMBIS: ::c_int = 0x5416;
+pub const TIOCMBIC: ::c_int = 0x5417;
+pub const TIOCMSET: ::c_int = 0x5418;
+pub const FIONREAD: ::c_int = 0x541B;
+pub const TIOCCONS: ::c_int = 0x541D;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const TIOCM_LE: ::c_int = 0x001;
+pub const TIOCM_DTR: ::c_int = 0x002;
+pub const TIOCM_RTS: ::c_int = 0x004;
+pub const TIOCM_ST: ::c_int = 0x008;
+pub const TIOCM_SR: ::c_int = 0x010;
+pub const TIOCM_CTS: ::c_int = 0x020;
+pub const TIOCM_CAR: ::c_int = 0x040;
+pub const TIOCM_RNG: ::c_int = 0x080;
+pub const TIOCM_DSR: ::c_int = 0x100;
+pub const TIOCM_CD: ::c_int = TIOCM_CAR;
+pub const TIOCM_RI: ::c_int = TIOCM_RNG;
+
+pub const O_DIRECTORY: ::c_int = 0x00080000;
+pub const O_DIRECT: ::c_int = 0x00000800;
+pub const O_LARGEFILE: ::c_int = 0x00001000;
+pub const O_NOFOLLOW: ::c_int = 0x00000080;
+
+pub const HUGETLB_FLAG_ENCODE_SHIFT: u32 = 26;
+pub const MAP_HUGE_SHIFT: u32 = 26;
+
+// intentionally not public, only used for fd_set
+cfg_if! {
+    if #[cfg(target_pointer_width = "32")] {
+        const ULONG_SIZE: usize = 32;
+    } else if #[cfg(target_pointer_width = "64")] {
+        const ULONG_SIZE: usize = 64;
+    } else {
+        // Unknown target_pointer_width
+    }
+}
+
+// END_PUB_CONST
+
+f! {
+    pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
+        let fd = fd as usize;
+        let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        (*set).fds_bits[fd / size] &= !(1 << (fd % size));
+        return
+    }
+
+    pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
+        let fd = fd as usize;
+        let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0
+    }
+
+    pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
+        let fd = fd as usize;
+        let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        (*set).fds_bits[fd / size] |= 1 << (fd % size);
+        return
+    }
+
+    pub fn FD_ZERO(set: *mut fd_set) -> () {
+        for slot in (*set).fds_bits.iter_mut() {
+            *slot = 0;
+        }
+    }
+
+    pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
+        for slot in cpuset.bits.iter_mut() {
+            *slot = 0;
+        }
+    }
+
+    pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
+        let size_in_bits
+            = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
+        let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
+        cpuset.bits[idx] |= 1 << offset;
+        ()
+    }
+
+    pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
+        let size_in_bits
+            = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
+        let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
+        cpuset.bits[idx] &= !(1 << offset);
+        ()
+    }
+
+    pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {
+        let size_in_bits = 8 * ::mem::size_of_val(&cpuset.bits[0]);
+        let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
+        0 != (cpuset.bits[idx] & (1 << offset))
+    }
+
+    pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
+        set1.bits == set2.bits
+    }
+
+    pub fn major(dev: ::dev_t) -> ::c_uint {
+        let mut major = 0;
+        major |= (dev & 0x00000000000fff00) >> 8;
+        major |= (dev & 0xfffff00000000000) >> 32;
+        major as ::c_uint
+    }
+
+    pub fn minor(dev: ::dev_t) -> ::c_uint {
+        let mut minor = 0;
+        minor |= (dev & 0x00000000000000ff) >> 0;
+        minor |= (dev & 0x00000ffffff00000) >> 12;
+        minor as ::c_uint
+    }
+
+    pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar {
+        cmsg.offset(1) as *mut c_uchar
+    }
+
+    pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr)
+        -> *mut cmsghdr
+    {
+        if ((*cmsg).cmsg_len as ::size_t) < ::mem::size_of::<cmsghdr>() {
+            0 as *mut cmsghdr
+        } else if __CMSG_NEXT(cmsg).add(::mem::size_of::<cmsghdr>())
+            >= __MHDR_END(mhdr) {
+            0 as *mut cmsghdr
+        } else {
+            __CMSG_NEXT(cmsg).cast()
+        }
+    }
+
+    pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
+        if (*mhdr).msg_controllen as ::size_t >= ::mem::size_of::<cmsghdr>() {
+            (*mhdr).msg_control.cast()
+        } else {
+            0 as *mut cmsghdr
+        }
+    }
+
+    pub {const} fn CMSG_ALIGN(len: ::size_t) -> ::size_t {
+        (len + ::mem::size_of::<::size_t>() - 1)
+            & !(::mem::size_of::<::size_t>() - 1)
+    }
+
+    pub {const} fn CMSG_SPACE(len: ::c_uint) -> ::c_uint {
+        (CMSG_ALIGN(len as ::size_t) + CMSG_ALIGN(::mem::size_of::<cmsghdr>()))
+            as ::c_uint
+    }
+
+    pub {const} fn CMSG_LEN(len: ::c_uint) -> ::c_uint {
+        (CMSG_ALIGN(::mem::size_of::<cmsghdr>()) + len as ::size_t) as ::c_uint
+    }
+}
+
+safe_f! {
+    pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
+        (status & 0xff) == 0x7f
+    }
+
+    pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
+        (status >> 8) & 0xff
+    }
+
+    pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
+        status == 0xffff
+    }
+
+    pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
+        ((status & 0x7f) + 1) as i8 >= 2
+    }
+
+    pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int {
+        status & 0x7f
+    }
+
+    pub {const} fn WIFEXITED(status: ::c_int) -> bool {
+        (status & 0x7f) == 0
+    }
+
+    pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int {
+        (status >> 8) & 0xff
+    }
+
+    pub {const} fn WCOREDUMP(status: ::c_int) -> bool {
+        (status & 0x80) != 0
+    }
+
+    pub {const} fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int {
+        (cmd << 8) | (type_ & 0x00ff)
+    }
+
+    pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::dev_t;
+        let mut dev = 0;
+        dev |= (major & 0x00000fff) << 8;
+        dev |= (major & 0xfffff000) << 32;
+        dev |= (minor & 0x000000ff) << 0;
+        dev |= (minor & 0xffffff00) << 12;
+        dev
+    }
+}
+
+fn __CMSG_LEN(cmsg: *const cmsghdr) -> ::ssize_t {
+    ((unsafe { (*cmsg).cmsg_len as ::size_t } + ::mem::size_of::<::c_long>() - 1)
+        & !(::mem::size_of::<::c_long>() - 1)) as ::ssize_t
+}
+
+fn __CMSG_NEXT(cmsg: *const cmsghdr) -> *mut c_uchar {
+    (unsafe { cmsg.offset(__CMSG_LEN(cmsg)) }) as *mut c_uchar
+}
+
+fn __MHDR_END(mhdr: *const msghdr) -> *mut c_uchar {
+    unsafe { (*mhdr).msg_control.offset((*mhdr).msg_controllen as isize) }.cast()
+}
+
+// EXTERN_FN
+
+#[link(name = "c")]
+#[link(name = "fdio")]
+extern "C" {}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum FILE {}
+impl ::Copy for FILE {}
+impl ::Clone for FILE {
+    fn clone(&self) -> FILE {
+        *self
+    }
+}
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum fpos_t {} // FIXME: fill this out with a struct
+impl ::Copy for fpos_t {}
+impl ::Clone for fpos_t {
+    fn clone(&self) -> fpos_t {
+        *self
+    }
+}
+
+extern "C" {
+    pub fn isalnum(c: c_int) -> c_int;
+    pub fn isalpha(c: c_int) -> c_int;
+    pub fn iscntrl(c: c_int) -> c_int;
+    pub fn isdigit(c: c_int) -> c_int;
+    pub fn isgraph(c: c_int) -> c_int;
+    pub fn islower(c: c_int) -> c_int;
+    pub fn isprint(c: c_int) -> c_int;
+    pub fn ispunct(c: c_int) -> c_int;
+    pub fn isspace(c: c_int) -> c_int;
+    pub fn isupper(c: c_int) -> c_int;
+    pub fn isxdigit(c: c_int) -> c_int;
+    pub fn isblank(c: c_int) -> c_int;
+    pub fn tolower(c: c_int) -> c_int;
+    pub fn toupper(c: c_int) -> c_int;
+    pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE;
+    pub fn freopen(filename: *const c_char, mode: *const c_char, file: *mut FILE) -> *mut FILE;
+    pub fn fflush(file: *mut FILE) -> c_int;
+    pub fn fclose(file: *mut FILE) -> c_int;
+    pub fn remove(filename: *const c_char) -> c_int;
+    pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int;
+    pub fn tmpfile() -> *mut FILE;
+    pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int;
+    pub fn setbuf(stream: *mut FILE, buf: *mut c_char);
+    pub fn getchar() -> c_int;
+    pub fn putchar(c: c_int) -> c_int;
+    pub fn fgetc(stream: *mut FILE) -> c_int;
+    pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char;
+    pub fn fputc(c: c_int, stream: *mut FILE) -> c_int;
+    pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int;
+    pub fn puts(s: *const c_char) -> c_int;
+    pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int;
+    pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
+    pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
+    pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int;
+    pub fn ftell(stream: *mut FILE) -> c_long;
+    pub fn rewind(stream: *mut FILE);
+    pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int;
+    pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int;
+    pub fn feof(stream: *mut FILE) -> c_int;
+    pub fn ferror(stream: *mut FILE) -> c_int;
+    pub fn perror(s: *const c_char);
+    pub fn atof(s: *const c_char) -> c_double;
+    pub fn atoi(s: *const c_char) -> c_int;
+    pub fn atol(s: *const c_char) -> c_long;
+    pub fn atoll(s: *const c_char) -> c_longlong;
+    pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
+    pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
+    pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
+    pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
+    pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
+    pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
+    pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
+    pub fn malloc(size: size_t) -> *mut c_void;
+    pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
+    pub fn free(p: *mut c_void);
+    pub fn abort() -> !;
+    pub fn exit(status: c_int) -> !;
+    pub fn _exit(status: c_int) -> !;
+    pub fn atexit(cb: extern "C" fn()) -> c_int;
+    pub fn system(s: *const c_char) -> c_int;
+    pub fn getenv(s: *const c_char) -> *mut c_char;
+
+    pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char;
+    pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
+    pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char;
+    pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char;
+    pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int;
+    pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int;
+    pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int;
+    pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char;
+    pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char;
+    pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t;
+    pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t;
+    pub fn strdup(cs: *const c_char) -> *mut c_char;
+    pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char;
+    pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
+    pub fn strlen(cs: *const c_char) -> size_t;
+    pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t;
+    pub fn strerror(n: c_int) -> *mut c_char;
+    pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char;
+    pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t;
+    pub fn wcslen(buf: *const wchar_t) -> size_t;
+    pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> ::size_t;
+
+    pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
+    pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t;
+    pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
+    pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
+    pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
+    pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
+
+    pub fn abs(i: c_int) -> c_int;
+    pub fn labs(i: c_long) -> c_long;
+    pub fn rand() -> c_int;
+    pub fn srand(seed: c_uint);
+
+    pub fn getpwnam(name: *const ::c_char) -> *mut passwd;
+    pub fn getpwuid(uid: ::uid_t) -> *mut passwd;
+
+    pub fn fprintf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
+    pub fn printf(format: *const ::c_char, ...) -> ::c_int;
+    pub fn snprintf(s: *mut ::c_char, n: ::size_t, format: *const ::c_char, ...) -> ::c_int;
+    pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int;
+    pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
+    pub fn scanf(format: *const ::c_char, ...) -> ::c_int;
+    pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int;
+    pub fn getchar_unlocked() -> ::c_int;
+    pub fn putchar_unlocked(c: ::c_int) -> ::c_int;
+
+    pub fn socket(domain: ::c_int, ty: ::c_int, protocol: ::c_int) -> ::c_int;
+    pub fn connect(socket: ::c_int, address: *const sockaddr, len: socklen_t) -> ::c_int;
+    pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int;
+    pub fn accept(socket: ::c_int, address: *mut sockaddr, address_len: *mut socklen_t) -> ::c_int;
+    pub fn getpeername(
+        socket: ::c_int,
+        address: *mut sockaddr,
+        address_len: *mut socklen_t,
+    ) -> ::c_int;
+    pub fn getsockname(
+        socket: ::c_int,
+        address: *mut sockaddr,
+        address_len: *mut socklen_t,
+    ) -> ::c_int;
+    pub fn setsockopt(
+        socket: ::c_int,
+        level: ::c_int,
+        name: ::c_int,
+        value: *const ::c_void,
+        option_len: socklen_t,
+    ) -> ::c_int;
+    pub fn socketpair(
+        domain: ::c_int,
+        type_: ::c_int,
+        protocol: ::c_int,
+        socket_vector: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn sendto(
+        socket: ::c_int,
+        buf: *const ::c_void,
+        len: ::size_t,
+        flags: ::c_int,
+        addr: *const sockaddr,
+        addrlen: socklen_t,
+    ) -> ::ssize_t;
+    pub fn shutdown(socket: ::c_int, how: ::c_int) -> ::c_int;
+
+    pub fn chmod(path: *const c_char, mode: mode_t) -> ::c_int;
+    pub fn fchmod(fd: ::c_int, mode: mode_t) -> ::c_int;
+
+    pub fn fstat(fildes: ::c_int, buf: *mut stat) -> ::c_int;
+
+    pub fn mkdir(path: *const c_char, mode: mode_t) -> ::c_int;
+
+    pub fn stat(path: *const c_char, buf: *mut stat) -> ::c_int;
+
+    pub fn pclose(stream: *mut ::FILE) -> ::c_int;
+    pub fn fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE;
+    pub fn fileno(stream: *mut ::FILE) -> ::c_int;
+
+    pub fn open(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
+    pub fn creat(path: *const c_char, mode: mode_t) -> ::c_int;
+    pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int;
+
+    pub fn opendir(dirname: *const c_char) -> *mut ::DIR;
+    pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent;
+    pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent, result: *mut *mut ::dirent)
+        -> ::c_int;
+    pub fn closedir(dirp: *mut ::DIR) -> ::c_int;
+    pub fn rewinddir(dirp: *mut ::DIR);
+
+    pub fn openat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int, ...) -> ::c_int;
+    pub fn fchmodat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::mode_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn fchown(fd: ::c_int, owner: ::uid_t, group: ::gid_t) -> ::c_int;
+    pub fn fchownat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        owner: ::uid_t,
+        group: ::gid_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn fstatat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        buf: *mut stat,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn linkat(
+        olddirfd: ::c_int,
+        oldpath: *const ::c_char,
+        newdirfd: ::c_int,
+        newpath: *const ::c_char,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
+    pub fn readlinkat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        buf: *mut ::c_char,
+        bufsiz: ::size_t,
+    ) -> ::ssize_t;
+    pub fn renameat(
+        olddirfd: ::c_int,
+        oldpath: *const ::c_char,
+        newdirfd: ::c_int,
+        newpath: *const ::c_char,
+    ) -> ::c_int;
+    pub fn symlinkat(
+        target: *const ::c_char,
+        newdirfd: ::c_int,
+        linkpath: *const ::c_char,
+    ) -> ::c_int;
+    pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int) -> ::c_int;
+
+    pub fn access(path: *const c_char, amode: ::c_int) -> ::c_int;
+    pub fn alarm(seconds: ::c_uint) -> ::c_uint;
+    pub fn chdir(dir: *const c_char) -> ::c_int;
+    pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int;
+    pub fn lchown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int;
+    pub fn close(fd: ::c_int) -> ::c_int;
+    pub fn dup(fd: ::c_int) -> ::c_int;
+    pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int;
+    pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> ::c_int;
+    pub fn execle(path: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int;
+    pub fn execlp(file: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int;
+    pub fn execv(prog: *const c_char, argv: *const *const c_char) -> ::c_int;
+    pub fn execve(
+        prog: *const c_char,
+        argv: *const *const c_char,
+        envp: *const *const c_char,
+    ) -> ::c_int;
+    pub fn execvp(c: *const c_char, argv: *const *const c_char) -> ::c_int;
+    pub fn fork() -> pid_t;
+    pub fn fpathconf(filedes: ::c_int, name: ::c_int) -> c_long;
+    pub fn getcwd(buf: *mut c_char, size: ::size_t) -> *mut c_char;
+    pub fn getegid() -> gid_t;
+    pub fn geteuid() -> uid_t;
+    pub fn getgid() -> gid_t;
+    pub fn getgroups(ngroups_max: ::c_int, groups: *mut gid_t) -> ::c_int;
+    pub fn getlogin() -> *mut c_char;
+    pub fn getopt(argc: ::c_int, argv: *const *mut c_char, optstr: *const c_char) -> ::c_int;
+    pub fn getpgid(pid: pid_t) -> pid_t;
+    pub fn getpgrp() -> pid_t;
+    pub fn getpid() -> pid_t;
+    pub fn getppid() -> pid_t;
+    pub fn getuid() -> uid_t;
+    pub fn isatty(fd: ::c_int) -> ::c_int;
+    pub fn link(src: *const c_char, dst: *const c_char) -> ::c_int;
+    pub fn lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t;
+    pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long;
+    pub fn pause() -> ::c_int;
+    pub fn pipe(fds: *mut ::c_int) -> ::c_int;
+    pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int;
+    pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) -> ::ssize_t;
+    pub fn rmdir(path: *const c_char) -> ::c_int;
+    pub fn seteuid(uid: uid_t) -> ::c_int;
+    pub fn setegid(gid: gid_t) -> ::c_int;
+    pub fn setgid(gid: gid_t) -> ::c_int;
+    pub fn setpgid(pid: pid_t, pgid: pid_t) -> ::c_int;
+    pub fn setsid() -> pid_t;
+    pub fn setuid(uid: uid_t) -> ::c_int;
+    pub fn sleep(secs: ::c_uint) -> ::c_uint;
+    pub fn nanosleep(rqtp: *const timespec, rmtp: *mut timespec) -> ::c_int;
+    pub fn tcgetpgrp(fd: ::c_int) -> pid_t;
+    pub fn tcsetpgrp(fd: ::c_int, pgrp: ::pid_t) -> ::c_int;
+    pub fn ttyname(fd: ::c_int) -> *mut c_char;
+    pub fn unlink(c: *const c_char) -> ::c_int;
+    pub fn wait(status: *mut ::c_int) -> pid_t;
+    pub fn waitpid(pid: pid_t, status: *mut ::c_int, options: ::c_int) -> pid_t;
+    pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) -> ::ssize_t;
+    pub fn pread(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
+    pub fn pwrite(fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
+    pub fn umask(mask: mode_t) -> mode_t;
+
+    pub fn utime(file: *const c_char, buf: *const utimbuf) -> ::c_int;
+
+    pub fn kill(pid: pid_t, sig: ::c_int) -> ::c_int;
+
+    pub fn mlock(addr: *const ::c_void, len: ::size_t) -> ::c_int;
+    pub fn munlock(addr: *const ::c_void, len: ::size_t) -> ::c_int;
+    pub fn mlockall(flags: ::c_int) -> ::c_int;
+    pub fn munlockall() -> ::c_int;
+
+    pub fn mmap(
+        addr: *mut ::c_void,
+        len: ::size_t,
+        prot: ::c_int,
+        flags: ::c_int,
+        fd: ::c_int,
+        offset: off_t,
+    ) -> *mut ::c_void;
+    pub fn munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int;
+
+    pub fn if_nametoindex(ifname: *const c_char) -> ::c_uint;
+    pub fn if_indextoname(ifindex: ::c_uint, ifname: *mut ::c_char) -> *mut ::c_char;
+
+    pub fn lstat(path: *const c_char, buf: *mut stat) -> ::c_int;
+
+    pub fn fsync(fd: ::c_int) -> ::c_int;
+
+    pub fn setenv(name: *const c_char, val: *const c_char, overwrite: ::c_int) -> ::c_int;
+    pub fn unsetenv(name: *const c_char) -> ::c_int;
+
+    pub fn symlink(path1: *const c_char, path2: *const c_char) -> ::c_int;
+
+    pub fn ftruncate(fd: ::c_int, length: off_t) -> ::c_int;
+
+    pub fn signal(signum: ::c_int, handler: sighandler_t) -> sighandler_t;
+
+    pub fn realpath(pathname: *const ::c_char, resolved: *mut ::c_char) -> *mut ::c_char;
+
+    pub fn flock(fd: ::c_int, operation: ::c_int) -> ::c_int;
+
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
+    pub fn times(buf: *mut ::tms) -> ::clock_t;
+
+    pub fn pthread_self() -> ::pthread_t;
+    pub fn pthread_join(native: ::pthread_t, value: *mut *mut ::c_void) -> ::c_int;
+    pub fn pthread_exit(value: *mut ::c_void) -> !;
+    pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int;
+    pub fn pthread_attr_destroy(attr: *mut ::pthread_attr_t) -> ::c_int;
+    pub fn pthread_attr_getstacksize(
+        attr: *const ::pthread_attr_t,
+        stacksize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_attr_setstacksize(attr: *mut ::pthread_attr_t, stack_size: ::size_t) -> ::c_int;
+    pub fn pthread_attr_setdetachstate(attr: *mut ::pthread_attr_t, state: ::c_int) -> ::c_int;
+    pub fn pthread_detach(thread: ::pthread_t) -> ::c_int;
+    pub fn sched_yield() -> ::c_int;
+    pub fn pthread_key_create(
+        key: *mut pthread_key_t,
+        dtor: ::Option<unsafe extern "C" fn(*mut ::c_void)>,
+    ) -> ::c_int;
+    pub fn pthread_key_delete(key: pthread_key_t) -> ::c_int;
+    pub fn pthread_getspecific(key: pthread_key_t) -> *mut ::c_void;
+    pub fn pthread_setspecific(key: pthread_key_t, value: *const ::c_void) -> ::c_int;
+    pub fn pthread_mutex_init(
+        lock: *mut pthread_mutex_t,
+        attr: *const pthread_mutexattr_t,
+    ) -> ::c_int;
+    pub fn pthread_mutex_destroy(lock: *mut pthread_mutex_t) -> ::c_int;
+    pub fn pthread_mutex_lock(lock: *mut pthread_mutex_t) -> ::c_int;
+    pub fn pthread_mutex_trylock(lock: *mut pthread_mutex_t) -> ::c_int;
+    pub fn pthread_mutex_unlock(lock: *mut pthread_mutex_t) -> ::c_int;
+
+    pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> ::c_int;
+    pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> ::c_int;
+    pub fn pthread_mutexattr_settype(attr: *mut pthread_mutexattr_t, _type: ::c_int) -> ::c_int;
+
+    pub fn pthread_cond_init(cond: *mut pthread_cond_t, attr: *const pthread_condattr_t)
+        -> ::c_int;
+    pub fn pthread_cond_wait(cond: *mut pthread_cond_t, lock: *mut pthread_mutex_t) -> ::c_int;
+    pub fn pthread_cond_timedwait(
+        cond: *mut pthread_cond_t,
+        lock: *mut pthread_mutex_t,
+        abstime: *const ::timespec,
+    ) -> ::c_int;
+    pub fn pthread_cond_signal(cond: *mut pthread_cond_t) -> ::c_int;
+    pub fn pthread_cond_broadcast(cond: *mut pthread_cond_t) -> ::c_int;
+    pub fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> ::c_int;
+    pub fn pthread_condattr_init(attr: *mut pthread_condattr_t) -> ::c_int;
+    pub fn pthread_condattr_destroy(attr: *mut pthread_condattr_t) -> ::c_int;
+    pub fn pthread_rwlock_init(
+        lock: *mut pthread_rwlock_t,
+        attr: *const pthread_rwlockattr_t,
+    ) -> ::c_int;
+    pub fn pthread_rwlock_destroy(lock: *mut pthread_rwlock_t) -> ::c_int;
+    pub fn pthread_rwlock_rdlock(lock: *mut pthread_rwlock_t) -> ::c_int;
+    pub fn pthread_rwlock_tryrdlock(lock: *mut pthread_rwlock_t) -> ::c_int;
+    pub fn pthread_rwlock_wrlock(lock: *mut pthread_rwlock_t) -> ::c_int;
+    pub fn pthread_rwlock_trywrlock(lock: *mut pthread_rwlock_t) -> ::c_int;
+    pub fn pthread_rwlock_unlock(lock: *mut pthread_rwlock_t) -> ::c_int;
+    pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t) -> ::c_int;
+    pub fn pthread_rwlockattr_destroy(attr: *mut pthread_rwlockattr_t) -> ::c_int;
+    pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
+    pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
+    pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
+
+    pub fn getsockopt(
+        sockfd: ::c_int,
+        level: ::c_int,
+        optname: ::c_int,
+        optval: *mut ::c_void,
+        optlen: *mut ::socklen_t,
+    ) -> ::c_int;
+    pub fn raise(signum: ::c_int) -> ::c_int;
+    pub fn sigaction(signum: ::c_int, act: *const sigaction, oldact: *mut sigaction) -> ::c_int;
+
+    pub fn utimes(filename: *const ::c_char, times: *const ::timeval) -> ::c_int;
+    pub fn dlopen(filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void;
+    pub fn dlerror() -> *mut ::c_char;
+    pub fn dlsym(handle: *mut ::c_void, symbol: *const ::c_char) -> *mut ::c_void;
+    pub fn dlclose(handle: *mut ::c_void) -> ::c_int;
+    pub fn dladdr(addr: *const ::c_void, info: *mut Dl_info) -> ::c_int;
+
+    pub fn getaddrinfo(
+        node: *const c_char,
+        service: *const c_char,
+        hints: *const addrinfo,
+        res: *mut *mut addrinfo,
+    ) -> ::c_int;
+    pub fn freeaddrinfo(res: *mut addrinfo);
+    pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char;
+    pub fn res_init() -> ::c_int;
+
+    pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
+    pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
+    pub fn mktime(tm: *mut tm) -> time_t;
+    pub fn time(time: *mut time_t) -> time_t;
+    pub fn gmtime(time_p: *const time_t) -> *mut tm;
+    pub fn localtime(time_p: *const time_t) -> *mut tm;
+
+    pub fn mknod(pathname: *const ::c_char, mode: ::mode_t, dev: ::dev_t) -> ::c_int;
+    pub fn uname(buf: *mut ::utsname) -> ::c_int;
+    pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
+    pub fn getservbyname(name: *const ::c_char, proto: *const ::c_char) -> *mut servent;
+    pub fn getprotobyname(name: *const ::c_char) -> *mut protoent;
+    pub fn getprotobynumber(proto: ::c_int) -> *mut protoent;
+    pub fn usleep(secs: ::c_uint) -> ::c_int;
+    pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
+    pub fn recv(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
+    pub fn putenv(string: *mut c_char) -> ::c_int;
+    pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int;
+    pub fn select(
+        nfds: ::c_int,
+        readfds: *mut fd_set,
+        writefds: *mut fd_set,
+        errorfds: *mut fd_set,
+        timeout: *mut timeval,
+    ) -> ::c_int;
+    pub fn setlocale(category: ::c_int, locale: *const ::c_char) -> *mut ::c_char;
+    pub fn localeconv() -> *mut lconv;
+
+    pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
+    pub fn sem_wait(sem: *mut sem_t) -> ::c_int;
+    pub fn sem_trywait(sem: *mut sem_t) -> ::c_int;
+    pub fn sem_post(sem: *mut sem_t) -> ::c_int;
+    pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
+    pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> ::c_int;
+    pub fn fstatvfs(fd: ::c_int, buf: *mut statvfs) -> ::c_int;
+
+    pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::ssize_t;
+
+    pub fn sigemptyset(set: *mut sigset_t) -> ::c_int;
+    pub fn sigaddset(set: *mut sigset_t, signum: ::c_int) -> ::c_int;
+    pub fn sigfillset(set: *mut sigset_t) -> ::c_int;
+    pub fn sigdelset(set: *mut sigset_t, signum: ::c_int) -> ::c_int;
+    pub fn sigismember(set: *const sigset_t, signum: ::c_int) -> ::c_int;
+
+    pub fn sigprocmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
+    pub fn sigpending(set: *mut sigset_t) -> ::c_int;
+
+    pub fn timegm(tm: *mut ::tm) -> time_t;
+
+    pub fn getsid(pid: pid_t) -> pid_t;
+
+    pub fn sysconf(name: ::c_int) -> ::c_long;
+
+    pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int;
+
+    pub fn pselect(
+        nfds: ::c_int,
+        readfds: *mut fd_set,
+        writefds: *mut fd_set,
+        errorfds: *mut fd_set,
+        timeout: *const timespec,
+        sigmask: *const sigset_t,
+    ) -> ::c_int;
+    pub fn fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int;
+    pub fn ftello(stream: *mut ::FILE) -> ::off_t;
+    pub fn tcdrain(fd: ::c_int) -> ::c_int;
+    pub fn cfgetispeed(termios: *const ::termios) -> ::speed_t;
+    pub fn cfgetospeed(termios: *const ::termios) -> ::speed_t;
+    pub fn cfmakeraw(termios: *mut ::termios);
+    pub fn cfsetispeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
+    pub fn cfsetospeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
+    pub fn cfsetspeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
+    pub fn tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int;
+    pub fn tcsetattr(fd: ::c_int, optional_actions: ::c_int, termios: *const ::termios) -> ::c_int;
+    pub fn tcflow(fd: ::c_int, action: ::c_int) -> ::c_int;
+    pub fn tcflush(fd: ::c_int, action: ::c_int) -> ::c_int;
+    pub fn tcgetsid(fd: ::c_int) -> ::pid_t;
+    pub fn tcsendbreak(fd: ::c_int, duration: ::c_int) -> ::c_int;
+    pub fn mkstemp(template: *mut ::c_char) -> ::c_int;
+    pub fn mkdtemp(template: *mut ::c_char) -> *mut ::c_char;
+
+    pub fn tmpnam(ptr: *mut ::c_char) -> *mut ::c_char;
+
+    pub fn openlog(ident: *const ::c_char, logopt: ::c_int, facility: ::c_int);
+    pub fn closelog();
+    pub fn setlogmask(maskpri: ::c_int) -> ::c_int;
+    pub fn syslog(priority: ::c_int, message: *const ::c_char, ...);
+
+    pub fn grantpt(fd: ::c_int) -> ::c_int;
+    pub fn posix_openpt(flags: ::c_int) -> ::c_int;
+    pub fn ptsname(fd: ::c_int) -> *mut ::c_char;
+    pub fn unlockpt(fd: ::c_int) -> ::c_int;
+
+    pub fn fdatasync(fd: ::c_int) -> ::c_int;
+    pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
+
+    pub fn pthread_getattr_np(native: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
+    pub fn pthread_attr_getstack(
+        attr: *const ::pthread_attr_t,
+        stackaddr: *mut *mut ::c_void,
+        stacksize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
+    pub fn setgroups(ngroups: ::size_t, ptr: *const ::gid_t) -> ::c_int;
+    pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
+    pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
+    pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
+
+    pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
+    pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
+    pub fn utimensat(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::timespec,
+        flag: ::c_int,
+    ) -> ::c_int;
+    pub fn duplocale(base: ::locale_t) -> ::locale_t;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+    pub fn uselocale(loc: ::locale_t) -> ::locale_t;
+
+    pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
+
+    pub fn mknodat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::mode_t,
+        dev: dev_t,
+    ) -> ::c_int;
+    pub fn pthread_condattr_getclock(
+        attr: *const pthread_condattr_t,
+        clock_id: *mut clockid_t,
+    ) -> ::c_int;
+    pub fn pthread_condattr_setclock(
+        attr: *mut pthread_condattr_t,
+        clock_id: ::clockid_t,
+    ) -> ::c_int;
+    pub fn accept4(
+        fd: ::c_int,
+        addr: *mut ::sockaddr,
+        len: *mut ::socklen_t,
+        flg: ::c_int,
+    ) -> ::c_int;
+    pub fn ptsname_r(fd: ::c_int, buf: *mut ::c_char, buflen: ::size_t) -> ::c_int;
+    pub fn clearenv() -> ::c_int;
+    pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
+        -> ::c_int;
+    pub fn setreuid(ruid: ::uid_t, euid: ::uid_t) -> ::c_int;
+    pub fn setregid(rgid: ::gid_t, egid: ::gid_t) -> ::c_int;
+    pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int;
+    pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int;
+    pub fn acct(filename: *const ::c_char) -> ::c_int;
+    pub fn brk(addr: *mut ::c_void) -> ::c_int;
+    pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
+    pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
+    pub fn openpty(
+        amaster: *mut ::c_int,
+        aslave: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *const termios,
+        winp: *const ::winsize,
+    ) -> ::c_int;
+    pub fn execvpe(
+        file: *const ::c_char,
+        argv: *const *const ::c_char,
+        envp: *const *const ::c_char,
+    ) -> ::c_int;
+    pub fn fexecve(
+        fd: ::c_int,
+        argv: *const *const ::c_char,
+        envp: *const *const ::c_char,
+    ) -> ::c_int;
+
+    pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
+
+    pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
+
+    pub fn setpwent();
+    pub fn endpwent();
+    pub fn getpwent() -> *mut passwd;
+
+    pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int;
+
+    // System V IPC
+    pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
+    pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
+    pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
+    pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
+    pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
+    pub fn semget(key: ::key_t, nsems: ::c_int, semflag: ::c_int) -> ::c_int;
+    pub fn semop(semid: ::c_int, sops: *mut ::sembuf, nsops: ::size_t) -> ::c_int;
+    pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
+    pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int;
+    pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
+    pub fn msgrcv(
+        msqid: ::c_int,
+        msgp: *mut ::c_void,
+        msgsz: ::size_t,
+        msgtyp: ::c_long,
+        msgflg: ::c_int,
+    ) -> ::ssize_t;
+    pub fn msgsnd(
+        msqid: ::c_int,
+        msgp: *const ::c_void,
+        msgsz: ::size_t,
+        msgflg: ::c_int,
+    ) -> ::c_int;
+
+    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+    pub fn __errno_location() -> *mut ::c_int;
+
+    pub fn fallocate(fd: ::c_int, mode: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+    pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+    pub fn readahead(fd: ::c_int, offset: ::off64_t, count: ::size_t) -> ::ssize_t;
+    pub fn signalfd(fd: ::c_int, mask: *const ::sigset_t, flags: ::c_int) -> ::c_int;
+    pub fn timerfd_create(clockid: ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn timerfd_gettime(fd: ::c_int, curr_value: *mut itimerspec) -> ::c_int;
+    pub fn timerfd_settime(
+        fd: ::c_int,
+        flags: ::c_int,
+        new_value: *const itimerspec,
+        old_value: *mut itimerspec,
+    ) -> ::c_int;
+    pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
+        -> ::ssize_t;
+    pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
+    pub fn quotactl(
+        cmd: ::c_int,
+        special: *const ::c_char,
+        id: ::c_int,
+        data: *mut ::c_char,
+    ) -> ::c_int;
+    pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
+    pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn sigtimedwait(
+        set: *const sigset_t,
+        info: *mut siginfo_t,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
+    pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
+    pub fn getnameinfo(
+        sa: *const ::sockaddr,
+        salen: ::socklen_t,
+        host: *mut ::c_char,
+        hostlen: ::socklen_t,
+        serv: *mut ::c_char,
+        servlen: ::socklen_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn reboot(how_to: ::c_int) -> ::c_int;
+    pub fn setfsgid(gid: ::gid_t) -> ::c_int;
+    pub fn setfsuid(uid: ::uid_t) -> ::c_int;
+
+    // Not available now on Android
+    pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
+    pub fn if_nameindex() -> *mut if_nameindex;
+    pub fn if_freenameindex(ptr: *mut if_nameindex);
+    pub fn sync_file_range(
+        fd: ::c_int,
+        offset: ::off64_t,
+        nbytes: ::off64_t,
+        flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
+    pub fn freeifaddrs(ifa: *mut ::ifaddrs);
+
+    pub fn glob(
+        pattern: *const c_char,
+        flags: ::c_int,
+        errfunc: ::Option<extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut ::glob_t,
+    ) -> ::c_int;
+    pub fn globfree(pglob: *mut ::glob_t);
+
+    pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+
+    pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
+
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+
+    pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
+    pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+
+    pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+
+    pub fn recvfrom(
+        socket: ::c_int,
+        buf: *mut ::c_void,
+        len: ::size_t,
+        flags: ::c_int,
+        addr: *mut ::sockaddr,
+        addrlen: *mut ::socklen_t,
+    ) -> ::ssize_t;
+    pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
+    pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
+
+    pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+
+    pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+    pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
+    pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
+    pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int;
+    pub fn vhangup() -> ::c_int;
+    pub fn sendmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn recvmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_int,
+        timeout: *mut ::timespec,
+    ) -> ::c_int;
+    pub fn sync();
+    pub fn syscall(num: ::c_long, ...) -> ::c_long;
+    pub fn sched_getaffinity(pid: ::pid_t, cpusetsize: ::size_t, cpuset: *mut cpu_set_t)
+        -> ::c_int;
+    pub fn sched_setaffinity(
+        pid: ::pid_t,
+        cpusetsize: ::size_t,
+        cpuset: *const cpu_set_t,
+    ) -> ::c_int;
+    pub fn umount(target: *const ::c_char) -> ::c_int;
+    pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
+    pub fn tee(fd_in: ::c_int, fd_out: ::c_int, len: ::size_t, flags: ::c_uint) -> ::ssize_t;
+    pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
+    pub fn splice(
+        fd_in: ::c_int,
+        off_in: *mut ::loff_t,
+        fd_out: ::c_int,
+        off_out: *mut ::loff_t,
+        len: ::size_t,
+        flags: ::c_uint,
+    ) -> ::ssize_t;
+    pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
+    pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
+    pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
+    pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
+    pub fn swapoff(puath: *const ::c_char) -> ::c_int;
+    pub fn vmsplice(
+        fd: ::c_int,
+        iov: *const ::iovec,
+        nr_segs: ::size_t,
+        flags: ::c_uint,
+    ) -> ::ssize_t;
+    pub fn mount(
+        src: *const ::c_char,
+        target: *const ::c_char,
+        fstype: *const ::c_char,
+        flags: ::c_ulong,
+        data: *const ::c_void,
+    ) -> ::c_int;
+    pub fn personality(persona: ::c_ulong) -> ::c_int;
+    pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int;
+    pub fn ppoll(
+        fds: *mut ::pollfd,
+        nfds: nfds_t,
+        timeout: *const ::timespec,
+        sigmask: *const sigset_t,
+    ) -> ::c_int;
+    pub fn pthread_mutex_timedlock(
+        lock: *mut pthread_mutex_t,
+        abstime: *const ::timespec,
+    ) -> ::c_int;
+    pub fn clone(
+        cb: extern "C" fn(*mut ::c_void) -> ::c_int,
+        child_stack: *mut ::c_void,
+        flags: ::c_int,
+        arg: *mut ::c_void,
+        ...
+    ) -> ::c_int;
+    pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
+    pub fn clock_nanosleep(
+        clk_id: ::clockid_t,
+        flags: ::c_int,
+        rqtp: *const ::timespec,
+        rmtp: *mut ::timespec,
+    ) -> ::c_int;
+    pub fn pthread_attr_getguardsize(
+        attr: *const ::pthread_attr_t,
+        guardsize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
+    pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
+    pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
+    pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int;
+    pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int;
+    pub fn sched_setscheduler(
+        pid: ::pid_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
+    pub fn sem_close(sem: *mut sem_t) -> ::c_int;
+    pub fn getdtablesize() -> ::c_int;
+    pub fn getgrnam_r(
+        name: *const ::c_char,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int;
+    pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
+    pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
+    pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
+    pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
+    pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
+    pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
+    pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
+    pub fn getpwnam_r(
+        name: *const ::c_char,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+    pub fn getpwuid_r(
+        uid: ::uid_t,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+    pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
+    pub fn pthread_atfork(
+        prepare: ::Option<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+
+    pub fn setgrent();
+    pub fn endgrent();
+    pub fn getgrent() -> *mut ::group;
+
+    pub fn getgrouplist(
+        user: *const ::c_char,
+        group: ::gid_t,
+        groups: *mut ::gid_t,
+        ngroups: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
+    pub fn faccessat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::c_int,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_create(
+        native: *mut ::pthread_t,
+        attr: *const ::pthread_attr_t,
+        f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
+        value: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn dl_iterate_phdr(
+        callback: ::Option<
+            unsafe extern "C" fn(
+                info: *mut ::dl_phdr_info,
+                size: ::size_t,
+                data: *mut ::c_void,
+            ) -> ::c_int,
+        >,
+        data: *mut ::c_void,
+    ) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "aarch64")] {
+        mod aarch64;
+        pub use self::aarch64::*;
+    } else if #[cfg(any(target_arch = "x86_64"))] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    } else if #[cfg(any(target_arch = "riscv64"))] {
+        mod riscv64;
+        pub use self::riscv64::*;
+    } else {
+        // Unknown target_arch
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        #[macro_use]
+        mod align;
+    } else {
+        #[macro_use]
+        mod no_align;
+    }
+}
+expand_align!();
+
+cfg_if! {
+    if #[cfg(libc_core_cvoid)] {
+        pub use ::ffi::c_void;
+    } else {
+        // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
+        // enable more optimization opportunities around it recognizing things
+        // like malloc/free.
+        #[repr(u8)]
+        #[allow(missing_copy_implementations)]
+        #[allow(missing_debug_implementations)]
+        pub enum c_void {
+            // Two dummy variants so the #[repr] attribute can be used.
+            #[doc(hidden)]
+            __variant1,
+            #[doc(hidden)]
+            __variant2,
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/fuchsia/no_align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/fuchsia/no_align.rs
--- 43.0.0-1/rust-vendor/libc/src/fuchsia/no_align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/fuchsia/no_align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,129 @@
+macro_rules! expand_align {
+    () => {
+        s! {
+            pub struct pthread_mutexattr_t {
+                #[cfg(target_arch = "x86_64")]
+                __align: [::c_int; 0],
+                #[cfg(not(target_arch = "x86_64"))]
+                __align: [::c_long; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
+            }
+
+            pub struct pthread_rwlockattr_t {
+                __align: [::c_long; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
+            }
+
+            pub struct pthread_condattr_t {
+                __align: [::c_int; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
+            }
+        }
+
+        s_no_extra_traits! {
+            pub struct pthread_mutex_t {
+                #[cfg(any(target_arch = "arm",
+                          all(target_arch = "x86_64",
+                              target_pointer_width = "32")))]
+                __align: [::c_long; 0],
+                #[cfg(not(any(target_arch = "arm",
+                              all(target_arch = "x86_64",
+                                  target_pointer_width = "32"))))]
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
+            }
+
+            pub struct pthread_rwlock_t {
+                __align: [::c_long; 0],
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
+            }
+
+            pub struct pthread_cond_t {
+                __align: [*const ::c_void; 0],
+                #[cfg(not(target_env = "musl"))]
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_COND_T],
+            }
+        }
+
+        cfg_if! {
+            if #[cfg(feature = "extra_traits")] {
+                impl PartialEq for pthread_cond_t {
+                    fn eq(&self, other: &pthread_cond_t) -> bool {
+                        // Ignore __align field
+                        self.size
+                            .iter()
+                            .zip(other.size.iter())
+                            .all(|(a,b)| a == b)
+                    }
+                }
+                impl Eq for pthread_cond_t {}
+                impl ::fmt::Debug for pthread_cond_t {
+                    fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                        f.debug_struct("pthread_cond_t")
+                            // Ignore __align field
+                            // FIXME: .field("size", &self.size)
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for pthread_cond_t {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        // Ignore __align field
+                        self.size.hash(state);
+                    }
+                }
+
+                impl PartialEq for pthread_mutex_t {
+                    fn eq(&self, other: &pthread_mutex_t) -> bool {
+                        // Ignore __align field
+                        self.size
+                            .iter()
+                            .zip(other.size.iter())
+                            .all(|(a,b)| a == b)
+                    }
+                }
+                impl Eq for pthread_mutex_t {}
+                impl ::fmt::Debug for pthread_mutex_t {
+                    fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                        f.debug_struct("pthread_mutex_t")
+                            // Ignore __align field
+                            // FIXME: .field("size", &self.size)
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for pthread_mutex_t {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        // Ignore __align field
+                        self.size.hash(state);
+                    }
+                }
+
+                impl PartialEq for pthread_rwlock_t {
+                    fn eq(&self, other: &pthread_rwlock_t) -> bool {
+                        // Ignore __align field
+                        self.size
+                            .iter()
+                            .zip(other.size.iter())
+                            .all(|(a,b)| a == b)
+                    }
+                }
+                impl Eq for pthread_rwlock_t {}
+                impl ::fmt::Debug for pthread_rwlock_t {
+                    fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                        f.debug_struct("pthread_rwlock_t")
+                            // Ignore __align field
+                            // FIXME: .field("size", &self.size)
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for pthread_rwlock_t {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        // Ignore __align field
+                        self.size.hash(state);
+                    }
+                }
+            }
+        }
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/fuchsia/riscv64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/fuchsia/riscv64.rs
--- 43.0.0-1/rust-vendor/libc/src/fuchsia/riscv64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/fuchsia/riscv64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,44 @@
+// From psABI Calling Convention for RV64
+pub type c_char = u8;
+pub type __u64 = ::c_ulonglong;
+pub type wchar_t = i32;
+
+pub type nlink_t = ::c_ulong;
+pub type blksize_t = ::c_long;
+
+pub type stat64 = stat;
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        __pad0: ::c_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_long; 3],
+    }
+
+    // Not actually used, IPC calls just return ENOSYS
+    pub struct ipc_perm {
+        pub __ipc_perm_key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong,
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/fuchsia/x86_64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/fuchsia/x86_64.rs
--- 43.0.0-1/rust-vendor/libc/src/fuchsia/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/fuchsia/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,152 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
+pub type nlink_t = u64;
+pub type blksize_t = ::c_long;
+pub type __u64 = ::c_ulonglong;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        __pad0: ::c_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_long; 3],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        __pad0: ::c_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __reserved: [::c_long; 3],
+    }
+
+    pub struct mcontext_t {
+        __private: [u64; 32],
+    }
+
+    pub struct ipc_perm {
+        pub __ipc_perm_key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_int,
+        __unused1: ::c_long,
+        __unused2: ::c_long
+    }
+}
+
+s_no_extra_traits! {
+    pub struct ucontext_t {
+        pub uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_mcontext: mcontext_t,
+        pub uc_sigmask: ::sigset_t,
+        __private: [u8; 512],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for ucontext_t {
+            fn eq(&self, other: &ucontext_t) -> bool {
+                self.uc_flags == other.uc_flags
+                    && self.uc_link == other.uc_link
+                    && self.uc_stack == other.uc_stack
+                    && self.uc_mcontext == other.uc_mcontext
+                    && self.uc_sigmask == other.uc_sigmask
+                    && self
+                    .__private
+                    .iter()
+                    .zip(other.__private.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for ucontext_t {}
+        impl ::fmt::Debug for ucontext_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ucontext_t")
+                    .field("uc_flags", &self.uc_flags)
+                    .field("uc_link", &self.uc_link)
+                    .field("uc_stack", &self.uc_stack)
+                    .field("uc_mcontext", &self.uc_mcontext)
+                    .field("uc_sigmask", &self.uc_sigmask)
+                    // FIXME: .field("__private", &self.__private)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for ucontext_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.uc_flags.hash(state);
+                self.uc_link.hash(state);
+                self.uc_stack.hash(state);
+                self.uc_mcontext.hash(state);
+                self.uc_sigmask.hash(state);
+                self.__private.hash(state);
+            }
+        }
+    }
+}
+
+// offsets in user_regs_structs, from sys/reg.h
+pub const R15: ::c_int = 0;
+pub const R14: ::c_int = 1;
+pub const R13: ::c_int = 2;
+pub const R12: ::c_int = 3;
+pub const RBP: ::c_int = 4;
+pub const RBX: ::c_int = 5;
+pub const R11: ::c_int = 6;
+pub const R10: ::c_int = 7;
+pub const R9: ::c_int = 8;
+pub const R8: ::c_int = 9;
+pub const RAX: ::c_int = 10;
+pub const RCX: ::c_int = 11;
+pub const RDX: ::c_int = 12;
+pub const RSI: ::c_int = 13;
+pub const RDI: ::c_int = 14;
+pub const ORIG_RAX: ::c_int = 15;
+pub const RIP: ::c_int = 16;
+pub const CS: ::c_int = 17;
+pub const EFLAGS: ::c_int = 18;
+pub const RSP: ::c_int = 19;
+pub const SS: ::c_int = 20;
+pub const FS_BASE: ::c_int = 21;
+pub const GS_BASE: ::c_int = 22;
+pub const DS: ::c_int = 23;
+pub const ES: ::c_int = 24;
+pub const FS: ::c_int = 25;
+pub const GS: ::c_int = 26;
+
+pub const MAP_32BIT: ::c_int = 0x0040;
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
diff -pruN 43.0.0-1/rust-vendor/libc/src/hermit/aarch64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/hermit/aarch64.rs
--- 43.0.0-1/rust-vendor/libc/src/hermit/aarch64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/hermit/aarch64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,2 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
diff -pruN 43.0.0-1/rust-vendor/libc/src/hermit/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/hermit/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/hermit/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/hermit/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,61 @@
+//! Hermit C types definition
+
+pub type c_schar = i8;
+pub type c_uchar = u8;
+pub type c_short = i16;
+pub type c_ushort = u16;
+pub type c_int = i32;
+pub type c_uint = u32;
+pub type c_float = f32;
+pub type c_double = f64;
+pub type c_longlong = i64;
+pub type c_ulonglong = u64;
+pub type intmax_t = i64;
+pub type uintmax_t = u64;
+
+pub type size_t = usize;
+pub type ptrdiff_t = isize;
+pub type intptr_t = isize;
+pub type uintptr_t = usize;
+pub type ssize_t = isize;
+
+pub type c_long = i64;
+pub type c_ulong = u64;
+
+pub type wint_t = u32;
+pub type wctype_t = i64;
+
+pub type regoff_t = size_t;
+pub type off_t = c_long;
+
+cfg_if! {
+    if #[cfg(target_arch = "aarch64")] {
+        mod aarch64;
+        pub use self::aarch64::*;
+    } else if #[cfg(target_arch = "x86_64")] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    } else {
+        // Unknown target_arch
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_core_cvoid)] {
+        pub use ::ffi::c_void;
+    } else {
+        // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
+        // enable more optimization opportunities around it recognizing things
+        // like malloc/free.
+        #[repr(u8)]
+        #[allow(missing_copy_implementations)]
+        #[allow(missing_debug_implementations)]
+        pub enum c_void {
+            // Two dummy variants so the #[repr] attribute can be used.
+            #[doc(hidden)]
+            __variant1,
+            #[doc(hidden)]
+            __variant2,
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/hermit/x86_64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/hermit/x86_64.rs
--- 43.0.0-1/rust-vendor/libc/src/hermit/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/hermit/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,2 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
diff -pruN 43.0.0-1/rust-vendor/libc/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/lib.rs
--- 43.0.0-1/rust-vendor/libc/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,165 @@
+//! libc - Raw FFI bindings to platforms' system libraries
+#![crate_name = "libc"]
+#![crate_type = "rlib"]
+#![allow(
+    renamed_and_removed_lints, // Keep this order.
+    unknown_lints, // Keep this order.
+    bad_style,
+    overflowing_literals,
+    improper_ctypes,
+    // This lint is renamed but we run CI for old stable rustc so should be here.
+    redundant_semicolon,
+    redundant_semicolons,
+    unused_macros,
+    unused_macro_rules,
+)]
+#![cfg_attr(libc_deny_warnings, deny(warnings))]
+// Attributes needed when building as part of the standard library
+#![cfg_attr(feature = "rustc-dep-of-std", feature(link_cfg, no_core))]
+#![cfg_attr(libc_thread_local, feature(thread_local))]
+// Enable extra lints:
+#![cfg_attr(feature = "extra_traits", deny(missing_debug_implementations))]
+#![deny(missing_copy_implementations, safe_packed_borrows)]
+#![cfg_attr(not(feature = "rustc-dep-of-std"), no_std)]
+#![cfg_attr(feature = "rustc-dep-of-std", no_core)]
+#![cfg_attr(libc_const_extern_fn_unstable, feature(const_extern_fn))]
+
+#[macro_use]
+mod macros;
+
+cfg_if! {
+    if #[cfg(feature = "rustc-dep-of-std")] {
+        extern crate rustc_std_workspace_core as core;
+        #[allow(unused_imports)]
+        use core::iter;
+        #[allow(unused_imports)]
+        use core::ops;
+        #[allow(unused_imports)]
+        use core::option;
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_priv_mod_use)] {
+        #[cfg(libc_core_cvoid)]
+        #[allow(unused_imports)]
+        use core::ffi;
+        #[allow(unused_imports)]
+        use core::fmt;
+        #[allow(unused_imports)]
+        use core::hash;
+        #[allow(unused_imports)]
+        use core::num;
+        #[allow(unused_imports)]
+        use core::mem;
+        #[doc(hidden)]
+        #[allow(unused_imports)]
+        use core::clone::Clone;
+        #[doc(hidden)]
+        #[allow(unused_imports)]
+        use core::marker::{Copy, Send, Sync};
+        #[doc(hidden)]
+        #[allow(unused_imports)]
+        use core::option::Option;
+    } else {
+        #[doc(hidden)]
+        #[allow(unused_imports)]
+        pub use core::fmt;
+        #[doc(hidden)]
+        #[allow(unused_imports)]
+        pub use core::hash;
+        #[doc(hidden)]
+        #[allow(unused_imports)]
+        pub use core::num;
+        #[doc(hidden)]
+        #[allow(unused_imports)]
+        pub use core::mem;
+        #[doc(hidden)]
+        #[allow(unused_imports)]
+        pub use core::clone::Clone;
+        #[doc(hidden)]
+        #[allow(unused_imports)]
+        pub use core::marker::{Copy, Send, Sync};
+        #[doc(hidden)]
+        #[allow(unused_imports)]
+        pub use core::option::Option;
+    }
+}
+
+cfg_if! {
+    if #[cfg(windows)] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod windows;
+        pub use windows::*;
+    } else if #[cfg(target_os = "fuchsia")] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod fuchsia;
+        pub use fuchsia::*;
+    } else if #[cfg(target_os = "switch")] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod switch;
+        pub use switch::*;
+    } else if #[cfg(target_os = "psp")] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod psp;
+        pub use psp::*;
+    } else if #[cfg(target_os = "vxworks")] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod vxworks;
+        pub use vxworks::*;
+    } else if #[cfg(target_os = "solid_asp3")] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod solid;
+        pub use solid::*;
+    } else if #[cfg(unix)] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod unix;
+        pub use unix::*;
+    } else if #[cfg(target_os = "hermit")] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod hermit;
+        pub use hermit::*;
+    } else if #[cfg(target_os = "teeos")] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod teeos;
+        pub use teeos::*;
+    } else if #[cfg(all(target_env = "sgx", target_vendor = "fortanix"))] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod sgx;
+        pub use sgx::*;
+    } else if #[cfg(any(target_env = "wasi", target_os = "wasi"))] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod wasi;
+        pub use wasi::*;
+    } else if #[cfg(target_os = "xous")] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod xous;
+        pub use xous::*;
+    } else {
+        // non-supported targets: empty...
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/macros.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/macros.rs
--- 43.0.0-1/rust-vendor/libc/src/macros.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/macros.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,349 @@
+/// A macro for defining #[cfg] if-else statements.
+///
+/// This is similar to the `if/elif` C preprocessor macro by allowing definition
+/// of a cascade of `#[cfg]` cases, emitting the implementation which matches
+/// first.
+///
+/// This allows you to conveniently provide a long list #[cfg]'d blocks of code
+/// without having to rewrite each clause multiple times.
+macro_rules! cfg_if {
+    // match if/else chains with a final `else`
+    ($(
+        if #[cfg($($meta:meta),*)] { $($it:item)* }
+    ) else * else {
+        $($it2:item)*
+    }) => {
+        cfg_if! {
+            @__items
+            () ;
+            $( ( ($($meta),*) ($($it)*) ), )*
+            ( () ($($it2)*) ),
+        }
+    };
+
+    // match if/else chains lacking a final `else`
+    (
+        if #[cfg($($i_met:meta),*)] { $($i_it:item)* }
+        $(
+            else if #[cfg($($e_met:meta),*)] { $($e_it:item)* }
+        )*
+    ) => {
+        cfg_if! {
+            @__items
+            () ;
+            ( ($($i_met),*) ($($i_it)*) ),
+            $( ( ($($e_met),*) ($($e_it)*) ), )*
+            ( () () ),
+        }
+    };
+
+    // Internal and recursive macro to emit all the items
+    //
+    // Collects all the negated `cfg`s in a list at the beginning and after the
+    // semicolon is all the remaining items
+    (@__items ($($not:meta,)*) ; ) => {};
+    (@__items ($($not:meta,)*) ; ( ($($m:meta),*) ($($it:item)*) ),
+     $($rest:tt)*) => {
+        // Emit all items within one block, applying an appropriate #[cfg]. The
+        // #[cfg] will require all `$m` matchers specified and must also negate
+        // all previous matchers.
+        cfg_if! { @__apply cfg(all($($m,)* not(any($($not),*)))), $($it)* }
+
+        // Recurse to emit all other items in `$rest`, and when we do so add all
+        // our `$m` matchers to the list of `$not` matchers as future emissions
+        // will have to negate everything we just matched as well.
+        cfg_if! { @__items ($($not,)* $($m,)*) ; $($rest)* }
+    };
+
+    // Internal macro to Apply a cfg attribute to a list of items
+    (@__apply $m:meta, $($it:item)*) => {
+        $(#[$m] $it)*
+    };
+}
+
+macro_rules! s {
+    ($($(#[$attr:meta])* pub $t:ident $i:ident { $($field:tt)* })*) => ($(
+        s!(it: $(#[$attr])* pub $t $i { $($field)* });
+    )*);
+    (it: $(#[$attr:meta])* pub union $i:ident { $($field:tt)* }) => (
+        compile_error!("unions cannot derive extra traits, use s_no_extra_traits instead");
+    );
+    (it: $(#[$attr:meta])* pub struct $i:ident { $($field:tt)* }) => (
+        __item! {
+            #[repr(C)]
+            #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
+            #[allow(deprecated)]
+            $(#[$attr])*
+            pub struct $i { $($field)* }
+        }
+        #[allow(deprecated)]
+        impl ::Copy for $i {}
+        #[allow(deprecated)]
+        impl ::Clone for $i {
+            fn clone(&self) -> $i { *self }
+        }
+    );
+}
+
+macro_rules! s_no_extra_traits {
+    ($($(#[$attr:meta])* pub $t:ident $i:ident { $($field:tt)* })*) => ($(
+        s_no_extra_traits!(it: $(#[$attr])* pub $t $i { $($field)* });
+    )*);
+    (it: $(#[$attr:meta])* pub union $i:ident { $($field:tt)* }) => (
+        cfg_if! {
+            if #[cfg(libc_union)] {
+                __item! {
+                    #[repr(C)]
+                    $(#[$attr])*
+                    pub union $i { $($field)* }
+                }
+
+                impl ::Copy for $i {}
+                impl ::Clone for $i {
+                    fn clone(&self) -> $i { *self }
+                }
+            }
+        }
+    );
+    (it: $(#[$attr:meta])* pub struct $i:ident { $($field:tt)* }) => (
+        __item! {
+            #[repr(C)]
+            $(#[$attr])*
+            pub struct $i { $($field)* }
+        }
+        #[allow(deprecated)]
+        impl ::Copy for $i {}
+        #[allow(deprecated)]
+        impl ::Clone for $i {
+            fn clone(&self) -> $i { *self }
+        }
+    );
+}
+
+macro_rules! missing {
+    ($($(#[$attr:meta])* pub enum $i:ident {})*) => ($(
+        $(#[$attr])* #[allow(missing_copy_implementations)] pub enum $i { }
+    )*);
+}
+
+macro_rules! e {
+    ($($(#[$attr:meta])* pub enum $i:ident { $($field:tt)* })*) => ($(
+        __item! {
+            #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
+            $(#[$attr])*
+            pub enum $i { $($field)* }
+        }
+        impl ::Copy for $i {}
+        impl ::Clone for $i {
+            fn clone(&self) -> $i { *self }
+        }
+    )*);
+}
+
+macro_rules! s_paren {
+    ($($(#[$attr:meta])* pub struct $i:ident ( $($field:tt)* ); )* ) => ($(
+        __item! {
+            #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
+            $(#[$attr])*
+            pub struct $i ( $($field)* );
+        }
+        impl ::Copy for $i {}
+        impl ::Clone for $i {
+            fn clone(&self) -> $i { *self }
+        }
+    )*);
+}
+
+// This is a pretty horrible hack to allow us to conditionally mark
+// some functions as 'const', without requiring users of this macro
+// to care about the "const-extern-fn" feature.
+//
+// When 'const-extern-fn' is enabled, we emit the captured 'const' keyword
+// in the expanded function.
+//
+// When 'const-extern-fn' is disabled, we always emit a plain 'pub unsafe extern fn'.
+// Note that the expression matched by the macro is exactly the same - this allows
+// users of this macro to work whether or not 'const-extern-fn' is enabled
+//
+// Unfortunately, we need to duplicate most of this macro between the 'cfg_if' blocks.
+// This is because 'const unsafe extern fn' won't even parse on older compilers,
+// so we need to avoid emitting it at all of 'const-extern-fn'.
+//
+// Specifically, moving the 'cfg_if' into the macro body will *not* work.
+// Doing so would cause the '#[cfg(feature = "const-extern-fn")]' to be emitted
+// into user code. The 'cfg' gate will not stop Rust from trying to parse the
+// 'pub const unsafe extern fn', so users would get a compiler error even when
+// the 'const-extern-fn' feature is disabled
+//
+// Note that users of this macro need to place 'const' in a weird position
+// (after the closing ')' for the arguments, but before the return type).
+// This was the only way I could satisfy the following two requirements:
+// 1. Avoid ambiguity errors from 'macro_rules!' (which happen when writing '$foo:ident fn'
+// 2. Allow users of this macro to mix 'pub fn foo' and 'pub const fn bar' within the same
+// 'f!' block
+cfg_if! {
+    if #[cfg(libc_const_extern_fn)] {
+        macro_rules! f {
+            ($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident(
+                        $($arg:ident: $argty:ty),*
+            ) -> $ret:ty {
+                $($body:stmt);*
+            })*) => ($(
+                #[inline]
+                $(#[$attr])*
+                pub $($constness)* unsafe extern fn $i($($arg: $argty),*
+                ) -> $ret {
+                    $($body);*
+                }
+            )*)
+        }
+
+        macro_rules! safe_f {
+            ($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident(
+                        $($arg:ident: $argty:ty),*
+            ) -> $ret:ty {
+                $($body:stmt);*
+            })*) => ($(
+                #[inline]
+                $(#[$attr])*
+                pub $($constness)* extern fn $i($($arg: $argty),*
+                ) -> $ret {
+                    $($body);*
+                }
+            )*)
+        }
+
+        macro_rules! const_fn {
+            ($($(#[$attr:meta])* $({$constness:ident})* fn $i:ident(
+                        $($arg:ident: $argty:ty),*
+            ) -> $ret:ty {
+                $($body:stmt);*
+            })*) => ($(
+                #[inline]
+                $(#[$attr])*
+                $($constness)* fn $i($($arg: $argty),*
+                ) -> $ret {
+                    $($body);*
+                }
+            )*)
+        }
+
+    } else {
+        macro_rules! f {
+            ($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident(
+                        $($arg:ident: $argty:ty),*
+            ) -> $ret:ty {
+                $($body:stmt);*
+            })*) => ($(
+                #[inline]
+                $(#[$attr])*
+                pub unsafe extern fn $i($($arg: $argty),*
+                ) -> $ret {
+                    $($body);*
+                }
+            )*)
+        }
+
+        macro_rules! safe_f {
+            ($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident(
+                        $($arg:ident: $argty:ty),*
+            ) -> $ret:ty {
+                $($body:stmt);*
+            })*) => ($(
+                #[inline]
+                $(#[$attr])*
+                pub extern fn $i($($arg: $argty),*
+                ) -> $ret {
+                    $($body);*
+                }
+            )*)
+        }
+
+        macro_rules! const_fn {
+            ($($(#[$attr:meta])* $({$constness:ident})* fn $i:ident(
+                        $($arg:ident: $argty:ty),*
+            ) -> $ret:ty {
+                $($body:stmt);*
+            })*) => ($(
+                #[inline]
+                $(#[$attr])*
+                fn $i($($arg: $argty),*
+                ) -> $ret {
+                    $($body);*
+                }
+            )*)
+        }
+    }
+}
+
+macro_rules! __item {
+    ($i:item) => {
+        $i
+    };
+}
+
+macro_rules! align_const {
+    ($($(#[$attr:meta])*
+       pub const $name:ident : $t1:ty
+       = $t2:ident { $($field:tt)* };)*) => ($(
+        #[cfg(libc_align)]
+        $(#[$attr])*
+        pub const $name : $t1 = $t2 {
+            $($field)*
+        };
+        #[cfg(not(libc_align))]
+        $(#[$attr])*
+        pub const $name : $t1 = $t2 {
+            $($field)*
+            __align: [],
+        };
+    )*)
+}
+
+// This macro is used to deprecate items that should be accessed via the mach2 crate
+macro_rules! deprecated_mach {
+    (pub const $id:ident: $ty:ty = $expr:expr;) => {
+        #[deprecated(
+            since = "0.2.55",
+            note = "Use the `mach2` crate instead",
+        )]
+        #[allow(deprecated)]
+        pub const $id: $ty = $expr;
+    };
+    ($(pub const $id:ident: $ty:ty = $expr:expr;)*) => {
+        $(
+            deprecated_mach!(
+                pub const $id: $ty = $expr;
+            );
+        )*
+    };
+    (pub type $id:ident = $ty:ty;) => {
+        #[deprecated(
+            since = "0.2.55",
+            note = "Use the `mach2` crate instead",
+        )]
+        #[allow(deprecated)]
+        pub type $id = $ty;
+    };
+    ($(pub type $id:ident = $ty:ty;)*) => {
+        $(
+            deprecated_mach!(
+                pub type $id = $ty;
+            );
+        )*
+    }
+}
+
+#[cfg(not(libc_ptr_addr_of))]
+macro_rules! ptr_addr_of {
+    ($place:expr) => {
+        &$place
+    };
+}
+
+#[cfg(libc_ptr_addr_of)]
+macro_rules! ptr_addr_of {
+    ($place:expr) => {
+        ::core::ptr::addr_of!($place)
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/psp.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/psp.rs
--- 43.0.0-1/rust-vendor/libc/src/psp.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/psp.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4177 @@
+//! PSP C type definitions
+//!
+//! These type declarations are not enough, as they must be ultimately resolved
+//! by the linker. Crates that use these definitions must, somewhere in the
+//! crate graph, include a stub provider crate such as the `psp` crate.
+
+pub type c_schar = i8;
+pub type c_uchar = u8;
+pub type c_short = i16;
+pub type c_ushort = u16;
+pub type c_int = i32;
+pub type c_uint = u32;
+pub type c_float = f32;
+pub type c_double = f64;
+pub type c_longlong = i64;
+pub type c_ulonglong = u64;
+pub type intmax_t = i64;
+pub type uintmax_t = u64;
+
+pub type size_t = usize;
+pub type ptrdiff_t = isize;
+pub type intptr_t = isize;
+pub type uintptr_t = usize;
+pub type ssize_t = isize;
+
+pub type c_char = u8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+
+cfg_if! {
+    if #[cfg(libc_core_cvoid)] {
+        pub use ::ffi::c_void;
+    } else {
+        // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
+        // enable more optimization opportunities around it recognizing things
+        // like malloc/free.
+        #[repr(u8)]
+        #[allow(missing_copy_implementations)]
+        #[allow(missing_debug_implementations)]
+        pub enum c_void {
+            // Two dummy variants so the #[repr] attribute can be used.
+            #[doc(hidden)]
+            __variant1,
+            #[doc(hidden)]
+            __variant2,
+        }
+    }
+}
+
+pub type SceKernelVTimerHandler = unsafe extern "C" fn(
+    uid: SceUid,
+    arg1: *mut SceKernelSysClock,
+    arg2: *mut SceKernelSysClock,
+    arg3: *mut c_void,
+) -> u32;
+
+pub type SceKernelVTimerHandlerWide =
+    unsafe extern "C" fn(uid: SceUid, arg1: i64, arg2: i64, arg3: *mut c_void) -> u32;
+
+pub type SceKernelThreadEventHandler =
+    unsafe extern "C" fn(mask: i32, thid: SceUid, common: *mut c_void) -> i32;
+
+pub type SceKernelAlarmHandler = unsafe extern "C" fn(common: *mut c_void) -> u32;
+
+pub type SceKernelCallbackFunction =
+    unsafe extern "C" fn(arg1: i32, arg2: i32, arg: *mut c_void) -> i32;
+
+pub type SceKernelThreadEntry = unsafe extern "C" fn(args: usize, argp: *mut c_void) -> i32;
+
+pub type PowerCallback = extern "C" fn(unknown: i32, power_info: i32);
+
+pub type IoPermissions = i32;
+
+pub type UmdCallback = fn(unknown: i32, event: i32) -> i32;
+
+pub type SceMpegRingbufferCb =
+    ::Option<unsafe extern "C" fn(data: *mut c_void, num_packets: i32, param: *mut c_void) -> i32>;
+
+pub type GuCallback = ::Option<extern "C" fn(id: i32, arg: *mut c_void)>;
+pub type GuSwapBuffersCallback =
+    ::Option<extern "C" fn(display: *mut *mut c_void, render: *mut *mut c_void)>;
+
+pub type SceNetAdhocctlHandler =
+    ::Option<unsafe extern "C" fn(flag: i32, error: i32, unknown: *mut c_void)>;
+
+pub type AdhocMatchingCallback = ::Option<
+    unsafe extern "C" fn(
+        matching_id: i32,
+        event: i32,
+        mac: *mut u8,
+        opt_len: i32,
+        opt_data: *mut c_void,
+    ),
+>;
+
+pub type SceNetApctlHandler = ::Option<
+    unsafe extern "C" fn(oldState: i32, newState: i32, event: i32, error: i32, pArg: *mut c_void),
+>;
+
+pub type HttpMallocFunction = ::Option<unsafe extern "C" fn(size: usize) -> *mut c_void>;
+pub type HttpReallocFunction =
+    ::Option<unsafe extern "C" fn(p: *mut c_void, size: usize) -> *mut c_void>;
+pub type HttpFreeFunction = ::Option<unsafe extern "C" fn(p: *mut c_void)>;
+pub type HttpPasswordCB = ::Option<
+    unsafe extern "C" fn(
+        request: i32,
+        auth_type: HttpAuthType,
+        realm: *const u8,
+        username: *mut u8,
+        password: *mut u8,
+        need_entity: i32,
+        entity_body: *mut *mut u8,
+        entity_size: *mut usize,
+        save: *mut i32,
+    ) -> i32,
+>;
+
+pub type socklen_t = u32;
+
+e! {
+    #[repr(u32)]
+    pub enum AudioFormat {
+        Stereo = 0,
+        Mono = 0x10,
+    }
+
+    #[repr(u32)]
+    pub enum DisplayMode {
+        Lcd = 0,
+    }
+
+    #[repr(u32)]
+    pub enum DisplayPixelFormat {
+        Psm5650 = 0,
+        Psm5551 = 1,
+        Psm4444 = 2,
+        Psm8888 = 3,
+    }
+
+    #[repr(u32)]
+    pub enum DisplaySetBufSync {
+        Immediate = 0,
+        NextFrame = 1,
+    }
+
+    #[repr(i32)]
+    pub enum AudioOutputFrequency {
+        Khz48 = 48000,
+        Khz44_1 = 44100,
+        Khz32 = 32000,
+        Khz24 = 24000,
+        Khz22_05 = 22050,
+        Khz16 = 16000,
+        Khz12 = 12000,
+        Khz11_025 = 11025,
+        Khz8 = 8000,
+    }
+
+    #[repr(i32)]
+    pub enum AudioInputFrequency {
+        Khz44_1 = 44100,
+        Khz22_05 = 22050,
+        Khz11_025 = 11025,
+    }
+
+    #[repr(u32)]
+    pub enum CtrlMode {
+        Digital = 0,
+        Analog,
+    }
+
+    #[repr(i32)]
+    pub enum GeMatrixType {
+        Bone0 = 0,
+        Bone1,
+        Bone2,
+        Bone3,
+        Bone4,
+        Bone5,
+        Bone6,
+        Bone7,
+        World,
+        View,
+        Projection,
+        TexGen,
+    }
+
+    #[repr(i32)]
+    pub enum GeListState {
+        Done = 0,
+        Queued,
+        DrawingDone,
+        StallReached,
+        CancelDone,
+    }
+
+    #[repr(u8)]
+    pub enum GeCommand {
+        Nop = 0,
+        Vaddr = 0x1,
+        Iaddr = 0x2,
+        Prim = 0x4,
+        Bezier = 0x5,
+        Spline = 0x6,
+        BoundingBox = 0x7,
+        Jump = 0x8,
+        BJump = 0x9,
+        Call = 0xa,
+        Ret = 0xb,
+        End = 0xc,
+        Signal = 0xe,
+        Finish = 0xf,
+        Base = 0x10,
+        VertexType = 0x12,
+        OffsetAddr = 0x13,
+        Origin = 0x14,
+        Region1 = 0x15,
+        Region2 = 0x16,
+        LightingEnable = 0x17,
+        LightEnable0 = 0x18,
+        LightEnable1 = 0x19,
+        LightEnable2 = 0x1a,
+        LightEnable3 = 0x1b,
+        DepthClampEnable = 0x1c,
+        CullFaceEnable = 0x1d,
+        TextureMapEnable = 0x1e,
+        FogEnable = 0x1f,
+        DitherEnable = 0x20,
+        AlphaBlendEnable = 0x21,
+        AlphaTestEnable = 0x22,
+        ZTestEnable = 0x23,
+        StencilTestEnable = 0x24,
+        AntiAliasEnable = 0x25,
+        PatchCullEnable = 0x26,
+        ColorTestEnable = 0x27,
+        LogicOpEnable = 0x28,
+        BoneMatrixNumber = 0x2a,
+        BoneMatrixData = 0x2b,
+        MorphWeight0 = 0x2c,
+        MorphWeight1 = 0x2d,
+        MorphWeight2 = 0x2e,
+        MorphWeight3 = 0x2f,
+        MorphWeight4 = 0x30,
+        MorphWeight5 = 0x31,
+        MorphWeight6 = 0x32,
+        MorphWeight7 = 0x33,
+        PatchDivision = 0x36,
+        PatchPrimitive = 0x37,
+        PatchFacing = 0x38,
+        WorldMatrixNumber = 0x3a,
+        WorldMatrixData = 0x3b,
+        ViewMatrixNumber = 0x3c,
+        ViewMatrixData = 0x3d,
+        ProjMatrixNumber = 0x3e,
+        ProjMatrixData = 0x3f,
+        TGenMatrixNumber = 0x40,
+        TGenMatrixData = 0x41,
+        ViewportXScale = 0x42,
+        ViewportYScale = 0x43,
+        ViewportZScale = 0x44,
+        ViewportXCenter = 0x45,
+        ViewportYCenter = 0x46,
+        ViewportZCenter = 0x47,
+        TexScaleU = 0x48,
+        TexScaleV = 0x49,
+        TexOffsetU = 0x4a,
+        TexOffsetV = 0x4b,
+        OffsetX = 0x4c,
+        OffsetY = 0x4d,
+        ShadeMode = 0x50,
+        ReverseNormal = 0x51,
+        MaterialUpdate = 0x53,
+        MaterialEmissive = 0x54,
+        MaterialAmbient = 0x55,
+        MaterialDiffuse = 0x56,
+        MaterialSpecular = 0x57,
+        MaterialAlpha = 0x58,
+        MaterialSpecularCoef = 0x5b,
+        AmbientColor = 0x5c,
+        AmbientAlpha = 0x5d,
+        LightMode = 0x5e,
+        LightType0 = 0x5f,
+        LightType1 = 0x60,
+        LightType2 = 0x61,
+        LightType3 = 0x62,
+        Light0X = 0x63,
+        Light0Y,
+        Light0Z,
+        Light1X,
+        Light1Y,
+        Light1Z,
+        Light2X,
+        Light2Y,
+        Light2Z,
+        Light3X,
+        Light3Y,
+        Light3Z,
+        Light0DirectionX = 0x6f,
+        Light0DirectionY,
+        Light0DirectionZ,
+        Light1DirectionX,
+        Light1DirectionY,
+        Light1DirectionZ,
+        Light2DirectionX,
+        Light2DirectionY,
+        Light2DirectionZ,
+        Light3DirectionX,
+        Light3DirectionY,
+        Light3DirectionZ,
+        Light0ConstantAtten = 0x7b,
+        Light0LinearAtten,
+        Light0QuadtraticAtten,
+        Light1ConstantAtten,
+        Light1LinearAtten,
+        Light1QuadtraticAtten,
+        Light2ConstantAtten,
+        Light2LinearAtten,
+        Light2QuadtraticAtten,
+        Light3ConstantAtten,
+        Light3LinearAtten,
+        Light3QuadtraticAtten,
+        Light0ExponentAtten = 0x87,
+        Light1ExponentAtten,
+        Light2ExponentAtten,
+        Light3ExponentAtten,
+        Light0CutoffAtten = 0x8b,
+        Light1CutoffAtten,
+        Light2CutoffAtten,
+        Light3CutoffAtten,
+        Light0Ambient = 0x8f,
+        Light0Diffuse,
+        Light0Specular,
+        Light1Ambient,
+        Light1Diffuse,
+        Light1Specular,
+        Light2Ambient,
+        Light2Diffuse,
+        Light2Specular,
+        Light3Ambient,
+        Light3Diffuse,
+        Light3Specular,
+        Cull = 0x9b,
+        FrameBufPtr = 0x9c,
+        FrameBufWidth = 0x9d,
+        ZBufPtr = 0x9e,
+        ZBufWidth = 0x9f,
+        TexAddr0 = 0xa0,
+        TexAddr1,
+        TexAddr2,
+        TexAddr3,
+        TexAddr4,
+        TexAddr5,
+        TexAddr6,
+        TexAddr7,
+        TexBufWidth0 = 0xa8,
+        TexBufWidth1,
+        TexBufWidth2,
+        TexBufWidth3,
+        TexBufWidth4,
+        TexBufWidth5,
+        TexBufWidth6,
+        TexBufWidth7,
+        ClutAddr = 0xb0,
+        ClutAddrUpper = 0xb1,
+        TransferSrc,
+        TransferSrcW,
+        TransferDst,
+        TransferDstW,
+        TexSize0 = 0xb8,
+        TexSize1,
+        TexSize2,
+        TexSize3,
+        TexSize4,
+        TexSize5,
+        TexSize6,
+        TexSize7,
+        TexMapMode = 0xc0,
+        TexShadeLs = 0xc1,
+        TexMode = 0xc2,
+        TexFormat = 0xc3,
+        LoadClut = 0xc4,
+        ClutFormat = 0xc5,
+        TexFilter = 0xc6,
+        TexWrap = 0xc7,
+        TexLevel = 0xc8,
+        TexFunc = 0xc9,
+        TexEnvColor = 0xca,
+        TexFlush = 0xcb,
+        TexSync = 0xcc,
+        Fog1 = 0xcd,
+        Fog2 = 0xce,
+        FogColor = 0xcf,
+        TexLodSlope = 0xd0,
+        FramebufPixFormat = 0xd2,
+        ClearMode = 0xd3,
+        Scissor1 = 0xd4,
+        Scissor2 = 0xd5,
+        MinZ = 0xd6,
+        MaxZ = 0xd7,
+        ColorTest = 0xd8,
+        ColorRef = 0xd9,
+        ColorTestmask = 0xda,
+        AlphaTest = 0xdb,
+        StencilTest = 0xdc,
+        StencilOp = 0xdd,
+        ZTest = 0xde,
+        BlendMode = 0xdf,
+        BlendFixedA = 0xe0,
+        BlendFixedB = 0xe1,
+        Dith0 = 0xe2,
+        Dith1,
+        Dith2,
+        Dith3,
+        LogicOp = 0xe6,
+        ZWriteDisable = 0xe7,
+        MaskRgb = 0xe8,
+        MaskAlpha = 0xe9,
+        TransferStart = 0xea,
+        TransferSrcPos = 0xeb,
+        TransferDstPos = 0xec,
+        TransferSize = 0xee,
+        Vscx = 0xf0,
+        Vscy = 0xf1,
+        Vscz = 0xf2,
+        Vtcs = 0xf3,
+        Vtct = 0xf4,
+        Vtcq = 0xf5,
+        Vcv = 0xf6,
+        Vap = 0xf7,
+        Vfc = 0xf8,
+        Vscv = 0xf9,
+
+        Unknown03 = 0x03,
+        Unknown0D = 0x0d,
+        Unknown11 = 0x11,
+        Unknown29 = 0x29,
+        Unknown34 = 0x34,
+        Unknown35 = 0x35,
+        Unknown39 = 0x39,
+        Unknown4E = 0x4e,
+        Unknown4F = 0x4f,
+        Unknown52 = 0x52,
+        Unknown59 = 0x59,
+        Unknown5A = 0x5a,
+        UnknownB6 = 0xb6,
+        UnknownB7 = 0xb7,
+        UnknownD1 = 0xd1,
+        UnknownED = 0xed,
+        UnknownEF = 0xef,
+        UnknownFA = 0xfa,
+        UnknownFB = 0xfb,
+        UnknownFC = 0xfc,
+        UnknownFD = 0xfd,
+        UnknownFE = 0xfe,
+        NopFF = 0xff,
+    }
+
+    #[repr(i32)]
+    pub enum SceSysMemPartitionId {
+        SceKernelUnknownPartition = 0,
+        SceKernelPrimaryKernelPartition = 1,
+        SceKernelPrimaryUserPartition = 2,
+        SceKernelOtherKernelPartition1 = 3,
+        SceKernelOtherKernelPartition2 = 4,
+        SceKernelVshellPARTITION = 5,
+        SceKernelScUserPartition = 6,
+        SceKernelMeUserPartition = 7,
+        SceKernelExtendedScKernelPartition = 8,
+        SceKernelExtendedSc2KernelPartition = 9,
+        SceKernelExtendedMeKernelPartition = 10,
+        SceKernelVshellKernelPartition = 11,
+        SceKernelExtendedKernelPartition = 12,
+    }
+
+    #[repr(i32)]
+    pub enum SceSysMemBlockTypes {
+        Low = 0,
+        High,
+        Addr,
+    }
+
+    #[repr(u32)]
+    pub enum Interrupt {
+        Gpio = 4,
+        Ata = 5,
+        Umd = 6,
+        Mscm0 = 7,
+        Wlan = 8,
+        Audio = 10,
+        I2c = 12,
+        Sircs = 14,
+        Systimer0 = 15,
+        Systimer1 = 16,
+        Systimer2 = 17,
+        Systimer3 = 18,
+        Thread0 = 19,
+        Nand = 20,
+        Dmacplus = 21,
+        Dma0 = 22,
+        Dma1 = 23,
+        Memlmd = 24,
+        Ge = 25,
+        Vblank = 30,
+        Mecodec = 31,
+        Hpremote = 36,
+        Mscm1 = 60,
+        Mscm2 = 61,
+        Thread1 = 65,
+        Interrupt = 66,
+    }
+
+    #[repr(u32)]
+    pub enum SubInterrupt {
+        Gpio = Interrupt::Gpio as u32,
+        Ata = Interrupt::Ata as u32,
+        Umd = Interrupt::Umd as u32,
+        Dmacplus = Interrupt::Dmacplus as u32,
+        Ge = Interrupt::Ge as u32,
+        Display = Interrupt::Vblank as u32,
+    }
+
+    #[repr(u32)]
+    pub enum SceKernelIdListType {
+        Thread = 1,
+        Semaphore = 2,
+        EventFlag = 3,
+        Mbox = 4,
+        Vpl = 5,
+        Fpl = 6,
+        Mpipe = 7,
+        Callback = 8,
+        ThreadEventHandler = 9,
+        Alarm = 10,
+        VTimer = 11,
+        SleepThread = 64,
+        DelayThread = 65,
+        SuspendThread = 66,
+        DormantThread = 67,
+    }
+
+    #[repr(i32)]
+    pub enum UsbCamResolution {
+        Px160_120 = 0,
+        Px176_144 = 1,
+        Px320_240 = 2,
+        Px352_288 = 3,
+        Px640_480 = 4,
+        Px1024_768 = 5,
+        Px1280_960 = 6,
+        Px480_272 = 7,
+        Px360_272 = 8,
+    }
+
+    #[repr(i32)]
+    pub enum UsbCamResolutionEx {
+        Px160_120 = 0,
+        Px176_144 = 1,
+        Px320_240 = 2,
+        Px352_288 = 3,
+        Px360_272 = 4,
+        Px480_272 = 5,
+        Px640_480 = 6,
+        Px1024_768 = 7,
+        Px1280_960 = 8,
+    }
+
+    #[repr(i32)]
+    pub enum UsbCamDelay {
+        NoDelay = 0,
+        Delay10Sec = 1,
+        Delay20Sec = 2,
+        Delay30Sec = 3,
+    }
+
+    #[repr(i32)]
+    pub enum UsbCamFrameRate {
+        Fps3_75 = 0,
+        Fps5 = 1,
+        Fps7_5 = 2,
+        Fps10 = 3,
+        Fps15 = 4,
+        Fps20 = 5,
+        Fps30 = 6,
+        Fps60 = 7,
+    }
+
+    #[repr(i32)]
+    pub enum UsbCamWb {
+        Auto = 0,
+        Daylight = 1,
+        Fluorescent = 2,
+        Incadescent = 3,
+    }
+
+    #[repr(i32)]
+    pub enum UsbCamEffectMode {
+        Normal = 0,
+        Negative = 1,
+        Blackwhite = 2,
+        Sepia = 3,
+        Blue = 4,
+        Red = 5,
+        Green = 6,
+    }
+
+    #[repr(i32)]
+    pub enum UsbCamEvLevel {
+        Pos2_0 = 0,
+        Pos1_7 = 1,
+        Pos1_5 = 2,
+        Pos1_3 = 3,
+        Pos1_0 = 4,
+        Pos0_7 = 5,
+        Pos0_5 = 6,
+        Pos0_3 = 7,
+        Zero = 8,
+        Neg0_3,
+        Neg0_5,
+        Neg0_7,
+        Neg1_0,
+        Neg1_3,
+        Neg1_5,
+        Neg1_7,
+        Neg2_0,
+    }
+
+    #[repr(i32)]
+    pub enum RtcCheckValidError {
+        InvalidYear = -1,
+        InvalidMonth = -2,
+        InvalidDay = -3,
+        InvalidHour = -4,
+        InvalidMinutes = -5,
+        InvalidSeconds = -6,
+        InvalidMicroseconds = -7,
+    }
+
+    #[repr(u32)]
+    pub enum PowerTick {
+        All = 0,
+        Suspend = 1,
+        Display = 6,
+    }
+
+    #[repr(u32)]
+    pub enum IoAssignPerms {
+        RdWr = 0,
+        RdOnly = 1,
+    }
+
+    #[repr(u32)]
+    pub enum IoWhence {
+        Set = 0,
+        Cur = 1,
+        End = 2,
+    }
+
+    #[repr(u32)]
+    pub enum UmdType {
+        Game = 0x10,
+        Video = 0x20,
+        Audio = 0x40,
+    }
+
+    #[repr(u32)]
+    pub enum GuPrimitive {
+        Points = 0,
+        Lines = 1,
+        LineStrip = 2,
+        Triangles = 3,
+        TriangleStrip = 4,
+        TriangleFan = 5,
+        Sprites = 6,
+    }
+
+    #[repr(u32)]
+    pub enum PatchPrimitive {
+        Points = 0,
+        LineStrip = 2,
+        TriangleStrip = 4,
+    }
+
+    #[repr(u32)]
+    pub enum GuState {
+        AlphaTest = 0,
+        DepthTest = 1,
+        ScissorTest = 2,
+        StencilTest = 3,
+        Blend = 4,
+        CullFace = 5,
+        Dither = 6,
+        Fog = 7,
+        ClipPlanes = 8,
+        Texture2D = 9,
+        Lighting = 10,
+        Light0 = 11,
+        Light1 = 12,
+        Light2 = 13,
+        Light3 = 14,
+        LineSmooth = 15,
+        PatchCullFace = 16,
+        ColorTest = 17,
+        ColorLogicOp = 18,
+        FaceNormalReverse = 19,
+        PatchFace = 20,
+        Fragment2X = 21,
+    }
+
+    #[repr(u32)]
+    pub enum MatrixMode {
+        Projection = 0,
+        View = 1,
+        Model = 2,
+        Texture = 3,
+    }
+
+    #[repr(u32)]
+    pub enum TexturePixelFormat {
+        Psm5650 = 0,
+        Psm5551 = 1,
+        Psm4444 = 2,
+        Psm8888 = 3,
+        PsmT4 = 4,
+        PsmT8 = 5,
+        PsmT16 = 6,
+        PsmT32 = 7,
+        PsmDxt1 = 8,
+        PsmDxt3 = 9,
+        PsmDxt5 = 10,
+    }
+
+    #[repr(u32)]
+    pub enum SplineMode {
+        FillFill = 0,
+        OpenFill = 1,
+        FillOpen = 2,
+        OpenOpen = 3,
+    }
+
+    #[repr(u32)]
+    pub enum ShadingModel {
+        Flat = 0,
+        Smooth = 1,
+    }
+
+    #[repr(u32)]
+    pub enum LogicalOperation {
+        Clear = 0,
+        And = 1,
+        AndReverse = 2,
+        Copy = 3,
+        AndInverted = 4,
+        Noop = 5,
+        Xor = 6,
+        Or = 7,
+        Nor = 8,
+        Equiv = 9,
+        Inverted = 10,
+        OrReverse = 11,
+        CopyInverted = 12,
+        OrInverted = 13,
+        Nand = 14,
+        Set = 15,
+    }
+
+    #[repr(u32)]
+    pub enum TextureFilter {
+        Nearest = 0,
+        Linear = 1,
+        NearestMipmapNearest = 4,
+        LinearMipmapNearest = 5,
+        NearestMipmapLinear = 6,
+        LinearMipmapLinear = 7,
+    }
+
+    #[repr(u32)]
+    pub enum TextureMapMode {
+        TextureCoords = 0,
+        TextureMatrix = 1,
+        EnvironmentMap = 2,
+    }
+
+    #[repr(u32)]
+    pub enum TextureLevelMode {
+        Auto = 0,
+        Const = 1,
+        Slope = 2,
+    }
+
+    #[repr(u32)]
+    pub enum TextureProjectionMapMode {
+        Position = 0,
+        Uv = 1,
+        NormalizedNormal = 2,
+        Normal = 3,
+    }
+
+    #[repr(u32)]
+    pub enum GuTexWrapMode {
+        Repeat = 0,
+        Clamp = 1,
+    }
+
+    #[repr(u32)]
+    pub enum FrontFaceDirection {
+        Clockwise = 0,
+        CounterClockwise = 1,
+    }
+
+    #[repr(u32)]
+    pub enum AlphaFunc {
+        Never = 0,
+        Always,
+        Equal,
+        NotEqual,
+        Less,
+        LessOrEqual,
+        Greater,
+        GreaterOrEqual,
+    }
+
+    #[repr(u32)]
+    pub enum StencilFunc {
+        Never = 0,
+        Always,
+        Equal,
+        NotEqual,
+        Less,
+        LessOrEqual,
+        Greater,
+        GreaterOrEqual,
+    }
+
+    #[repr(u32)]
+    pub enum ColorFunc {
+        Never = 0,
+        Always,
+        Equal,
+        NotEqual,
+    }
+
+    #[repr(u32)]
+    pub enum DepthFunc {
+        Never = 0,
+        Always,
+        Equal,
+        NotEqual,
+        Less,
+        LessOrEqual,
+        Greater,
+        GreaterOrEqual,
+    }
+
+    #[repr(u32)]
+    pub enum TextureEffect {
+        Modulate = 0,
+        Decal = 1,
+        Blend = 2,
+        Replace = 3,
+        Add = 4,
+    }
+
+    #[repr(u32)]
+    pub enum TextureColorComponent {
+        Rgb = 0,
+        Rgba = 1,
+    }
+
+    #[repr(u32)]
+    pub enum MipmapLevel {
+        None = 0,
+        Level1,
+        Level2,
+        Level3,
+        Level4,
+        Level5,
+        Level6,
+        Level7,
+    }
+
+    #[repr(u32)]
+    pub enum BlendOp {
+        Add = 0,
+        Subtract = 1,
+        ReverseSubtract = 2,
+        Min = 3,
+        Max = 4,
+        Abs = 5,
+    }
+
+    #[repr(u32)]
+    pub enum BlendSrc {
+        SrcColor = 0,
+        OneMinusSrcColor = 1,
+        SrcAlpha = 2,
+        OneMinusSrcAlpha = 3,
+        Fix = 10,
+    }
+
+    #[repr(u32)]
+    pub enum BlendDst {
+        DstColor = 0,
+        OneMinusDstColor = 1,
+        DstAlpha = 4,
+        OneMinusDstAlpha = 5,
+        Fix = 10,
+    }
+
+    #[repr(u32)]
+    pub enum StencilOperation {
+        Keep = 0,
+        Zero = 1,
+        Replace = 2,
+        Invert = 3,
+        Incr = 4,
+        Decr = 5,
+    }
+
+    #[repr(u32)]
+    pub enum LightMode {
+        SingleColor = 0,
+        SeparateSpecularColor = 1,
+    }
+
+    #[repr(u32)]
+    pub enum LightType {
+        Directional = 0,
+        Pointlight = 1,
+        Spotlight = 2,
+    }
+
+    #[repr(u32)]
+    pub enum GuContextType {
+        Direct = 0,
+        Call = 1,
+        Send = 2,
+    }
+
+    #[repr(u32)]
+    pub enum GuQueueMode {
+        Tail = 0,
+        Head = 1,
+    }
+
+    #[repr(u32)]
+    pub enum GuSyncMode {
+        Finish = 0,
+        Signal = 1,
+        Done = 2,
+        List = 3,
+        Send = 4,
+    }
+
+    #[repr(u32)]
+    pub enum GuSyncBehavior {
+        Wait = 0,
+        NoWait = 1,
+    }
+
+    #[repr(u32)]
+    pub enum GuCallbackId {
+        Signal = 1,
+        Finish = 4,
+    }
+
+    #[repr(u32)]
+    pub enum SignalBehavior {
+        Suspend = 1,
+        Continue = 2,
+    }
+
+    #[repr(u32)]
+    pub enum ClutPixelFormat {
+        Psm5650 = 0,
+        Psm5551 = 1,
+        Psm4444 = 2,
+        Psm8888 = 3,
+    }
+
+    #[repr(C)]
+    pub enum KeyType {
+        Directory = 1,
+        Integer = 2,
+        String = 3,
+        Bytes = 4,
+    }
+
+    #[repr(u32)]
+    pub enum UtilityMsgDialogMode {
+        Error,
+        Text,
+    }
+
+    #[repr(u32)]
+    pub enum UtilityMsgDialogPressed {
+        Unknown1,
+        Yes,
+        No,
+        Back,
+    }
+
+    #[repr(u32)]
+    pub enum UtilityDialogButtonAccept {
+        Circle,
+        Cross,
+    }
+
+    #[repr(u32)]
+    pub enum SceUtilityOskInputLanguage {
+        Default,
+        Japanese,
+        English,
+        French,
+        Spanish,
+        German,
+        Italian,
+        Dutch,
+        Portugese,
+        Russian,
+        Korean,
+    }
+
+    #[repr(u32)]
+    pub enum SceUtilityOskInputType {
+        All,
+        LatinDigit,
+        LatinSymbol,
+        LatinLowercase = 4,
+        LatinUppercase = 8,
+        JapaneseDigit = 0x100,
+        JapaneseSymbol = 0x200,
+        JapaneseLowercase = 0x400,
+        JapaneseUppercase = 0x800,
+        JapaneseHiragana = 0x1000,
+        JapaneseHalfWidthKatakana = 0x2000,
+        JapaneseKatakana = 0x4000,
+        JapaneseKanji = 0x8000,
+        RussianLowercase = 0x10000,
+        RussianUppercase = 0x20000,
+        Korean = 0x40000,
+        Url = 0x80000,
+    }
+
+    #[repr(u32)]
+    pub enum SceUtilityOskState {
+        None,
+        Initializing,
+        Initialized,
+        Visible,
+        Quit,
+        Finished,
+    }
+
+    #[repr(u32)]
+    pub enum SceUtilityOskResult {
+        Unchanged,
+        Cancelled,
+        Changed,
+    }
+
+    #[repr(u32)]
+    pub enum SystemParamLanguage {
+        Japanese,
+        English,
+        French,
+        Spanish,
+        German,
+        Italian,
+        Dutch,
+        Portugese,
+        Russian,
+        Korean,
+        ChineseTraditional,
+        ChineseSimplified,
+    }
+
+    #[repr(u32)]
+    pub enum SystemParamId {
+        StringNickname = 1,
+        AdhocChannel,
+        WlanPowerSave,
+        DateFormat,
+        TimeFormat,
+        Timezone,
+        DaylightSavings,
+        Language,
+        Unknown,
+    }
+
+    #[repr(u32)]
+    pub enum SystemParamAdhocChannel {
+        ChannelAutomatic = 0,
+        Channel1 = 1,
+        Channel6 = 6,
+        Channel11 = 11,
+    }
+
+    #[repr(u32)]
+    pub enum SystemParamWlanPowerSaveState {
+        Off,
+        On,
+    }
+
+    #[repr(u32)]
+    pub enum SystemParamDateFormat {
+        YYYYMMDD,
+        MMDDYYYY,
+        DDMMYYYY,
+    }
+
+    #[repr(u32)]
+    pub enum SystemParamTimeFormat {
+        Hour24,
+        Hour12,
+    }
+
+    #[repr(u32)]
+    pub enum SystemParamDaylightSavings {
+        Std,
+        Dst,
+    }
+
+    #[repr(u32)]
+    pub enum AvModule {
+        AvCodec,
+        SasCore,
+        Atrac3Plus,
+        MpegBase,
+        Mp3,
+        Vaudio,
+        Aac,
+        G729,
+    }
+
+    #[repr(u32)]
+    pub enum Module {
+        NetCommon = 0x100,
+        NetAdhoc,
+        NetInet,
+        NetParseUri,
+        NetHttp,
+        NetSsl,
+
+        UsbPspCm = 0x200,
+        UsbMic,
+        UsbCam,
+        UsbGps,
+
+        AvCodec = 0x300,
+        AvSascore,
+        AvAtrac3Plus,
+        AvMpegBase,
+        AvMp3,
+        AvVaudio,
+        AvAac,
+        AvG729,
+
+        NpCommon = 0x400,
+        NpService,
+        NpMatching2,
+        NpDrm = 0x500,
+
+        Irda = 0x600,
+    }
+
+    #[repr(u32)]
+    pub enum NetModule {
+        NetCommon = 1,
+        NetAdhoc,
+        NetInet,
+        NetParseUri,
+        NetHttp,
+        NetSsl,
+    }
+
+    #[repr(u32)]
+    pub enum UsbModule {
+        UsbPspCm = 1,
+        UsbAcc,
+        UsbMic,
+        UsbCam,
+        UsbGps,
+    }
+
+    #[repr(u32)]
+    pub enum NetParam {
+        Name,
+        Ssid,
+        Secure,
+        WepKey,
+        IsStaticIp,
+        Ip,
+        NetMask,
+        Route,
+        ManualDns,
+        PrimaryDns,
+        SecondaryDns,
+        ProxyUser,
+        ProxyPass,
+        UseProxy,
+        ProxyServer,
+        ProxyPort,
+        Unknown1,
+        Unknown2,
+    }
+
+    #[repr(u32)]
+    pub enum UtilityNetconfAction {
+        ConnectAP,
+        DisplayStatus,
+        ConnectAdhoc,
+    }
+
+    #[repr(u32)]
+    pub enum UtilitySavedataMode {
+        AutoLoad,
+        AutoSave,
+        Load,
+        Save,
+        ListLoad,
+        ListSave,
+        ListDelete,
+        Delete,
+    }
+
+    #[repr(u32)]
+    pub enum UtilitySavedataFocus {
+        Unknown1,
+        FirstList,
+        LastList,
+        Latest,
+        Oldest,
+        Unknown2,
+        Unknown3,
+        FirstEmpty,
+        LastEmpty,
+    }
+
+    #[repr(u32)]
+    pub enum UtilityGameSharingMode {
+        Single = 1,
+        Multiple,
+    }
+
+    #[repr(u32)]
+    pub enum UtilityGameSharingDataType {
+        File = 1,
+        Memory,
+    }
+
+    #[repr(u32)]
+    pub enum UtilityHtmlViewerInterfaceMode {
+        Full,
+        Limited,
+        None,
+    }
+
+    #[repr(u32)]
+    pub enum UtilityHtmlViewerCookieMode {
+        Disabled = 0,
+        Enabled,
+        Confirm,
+        Default,
+    }
+
+    #[repr(u32)]
+    pub enum UtilityHtmlViewerTextSize {
+        Large,
+        Normal,
+        Small,
+    }
+
+    #[repr(u32)]
+    pub enum UtilityHtmlViewerDisplayMode {
+        Normal,
+        Fit,
+        SmartFit,
+    }
+
+    #[repr(u32)]
+    pub enum UtilityHtmlViewerConnectMode {
+        Last,
+        ManualOnce,
+        ManualAll,
+    }
+
+    #[repr(u32)]
+    pub enum UtilityHtmlViewerDisconnectMode {
+        Enable,
+        Disable,
+        Confirm,
+    }
+
+    #[repr(u32)]
+    pub enum ScePspnetAdhocPtpState {
+        Closed,
+        Listen,
+        SynSent,
+        SynReceived,
+        Established,
+    }
+
+    #[repr(u32)]
+    pub enum AdhocMatchingMode {
+        Host = 1,
+        Client,
+        Ptp,
+    }
+
+    #[repr(u32)]
+    pub enum ApctlState {
+        Disconnected,
+        Scanning,
+        Joining,
+        GettingIp,
+        GotIp,
+        EapAuth,
+        KeyExchange,
+    }
+
+    #[repr(u32)]
+    pub enum ApctlEvent {
+        ConnectRequest,
+        ScanRequest,
+        ScanComplete,
+        Established,
+        GetIp,
+        DisconnectRequest,
+        Error,
+        Info,
+        EapAuth,
+        KeyExchange,
+        Reconnect,
+    }
+
+    #[repr(u32)]
+    pub enum ApctlInfo {
+        ProfileName,
+        Bssid,
+        Ssid,
+        SsidLength,
+        SecurityType,
+        Strength,
+        Channel,
+        PowerSave,
+        Ip,
+        SubnetMask,
+        Gateway,
+        PrimaryDns,
+        SecondaryDns,
+        UseProxy,
+        ProxyUrl,
+        ProxyPort,
+        EapType,
+        StartBrowser,
+        Wifisp,
+    }
+
+    #[repr(u32)]
+    pub enum ApctlInfoSecurityType {
+        None,
+        Wep,
+        Wpa,
+    }
+
+    #[repr(u32)]
+    pub enum HttpMethod {
+        Get,
+        Post,
+        Head,
+    }
+
+    #[repr(u32)]
+    pub enum HttpAuthType {
+        Basic,
+        Digest,
+    }
+}
+
+s_paren! {
+    #[repr(transparent)]
+    pub struct SceUid(pub i32);
+
+    #[repr(transparent)]
+    #[allow(dead_code)]
+    pub struct SceMpeg(*mut *mut c_void);
+
+    #[repr(transparent)]
+    #[allow(dead_code)]
+    pub struct SceMpegStream(*mut c_void);
+
+    #[repr(transparent)]
+    pub struct Mp3Handle(pub i32);
+
+    #[repr(transparent)]
+    #[allow(dead_code)]
+    pub struct RegHandle(u32);
+}
+
+s! {
+    pub struct sockaddr {
+        pub sa_len: u8,
+        pub sa_family: u8,
+        pub sa_data: [u8;14],
+    }
+
+    pub struct in_addr {
+        pub s_addr: u32,
+    }
+
+    pub struct AudioInputParams {
+        pub unknown1: i32,
+        pub gain: i32,
+        pub unknown2: i32,
+        pub unknown3: i32,
+        pub unknown4: i32,
+        pub unknown5: i32,
+    }
+
+    pub struct Atrac3BufferInfo {
+        pub puc_write_position_first_buf: *mut u8,
+        pub ui_writable_byte_first_buf: u32,
+        pub ui_min_write_byte_first_buf: u32,
+        pub ui_read_position_first_buf: u32,
+        pub puc_write_position_second_buf: *mut u8,
+        pub ui_writable_byte_second_buf: u32,
+        pub ui_min_write_byte_second_buf: u32,
+        pub ui_read_position_second_buf: u32,
+    }
+
+    pub struct SceCtrlData {
+        pub timestamp: u32,
+        pub buttons: i32,
+        pub lx: u8,
+        pub ly: u8,
+        pub rsrv: [u8; 6],
+    }
+
+    pub struct SceCtrlLatch {
+        pub ui_make: u32,
+        pub ui_break: u32,
+        pub ui_press: u32,
+        pub ui_release: u32,
+    }
+
+    pub struct GeStack {
+        pub stack: [u32; 8],
+    }
+
+    pub struct GeCallbackData {
+        pub signal_func: ::Option<extern "C" fn(id: i32, arg: *mut c_void)>,
+        pub signal_arg: *mut c_void,
+        pub finish_func: ::Option<extern "C" fn(id: i32, arg: *mut c_void)>,
+        pub finish_arg: *mut c_void,
+    }
+
+    pub struct GeListArgs {
+        pub size: u32,
+        pub context: *mut GeContext,
+        pub num_stacks: u32,
+        pub stacks: *mut GeStack,
+    }
+
+    pub struct GeBreakParam {
+        pub buf: [u32; 4],
+    }
+
+    pub struct SceKernelLoadExecParam {
+        pub size: usize,
+        pub args: usize,
+        pub argp: *mut c_void,
+        pub key: *const u8,
+    }
+
+    pub struct timeval {
+        pub tv_sec: i32,
+        pub tv_usec: i32,
+    }
+
+    pub struct timezone {
+        pub tz_minutes_west: i32,
+        pub tz_dst_time: i32,
+    }
+
+    pub struct IntrHandlerOptionParam {
+        size: i32,
+        entry: u32,
+        common: u32,
+        gp: u32,
+        intr_code: u16,
+        sub_count: u16,
+        intr_level: u16,
+        enabled: u16,
+        calls: u32,
+        field_1c: u32,
+        total_clock_lo: u32,
+        total_clock_hi: u32,
+        min_clock_lo: u32,
+        min_clock_hi: u32,
+        max_clock_lo: u32,
+        max_clock_hi: u32,
+    }
+
+    pub struct SceKernelLMOption {
+        pub size: usize,
+        pub m_pid_text: SceUid,
+        pub m_pid_data: SceUid,
+        pub flags: u32,
+        pub position: u8,
+        pub access: u8,
+        pub c_reserved: [u8; 2usize],
+    }
+
+    pub struct SceKernelSMOption {
+        pub size: usize,
+        pub m_pid_stack: SceUid,
+        pub stack_size: usize,
+        pub priority: i32,
+        pub attribute: u32,
+    }
+
+    pub struct SceKernelModuleInfo {
+        pub size: usize,
+        pub n_segment: u8,
+        pub reserved: [u8; 3usize],
+        pub segment_addr: [i32; 4usize],
+        pub segment_size: [i32; 4usize],
+        pub entry_addr: u32,
+        pub gp_value: u32,
+        pub text_addr: u32,
+        pub text_size: u32,
+        pub data_size: u32,
+        pub bss_size: u32,
+        pub attribute: u16,
+        pub version: [u8; 2usize],
+        pub name: [u8; 28usize],
+    }
+
+    pub struct DebugProfilerRegs {
+        pub enable: u32,
+        pub systemck: u32,
+        pub cpuck: u32,
+        pub internal: u32,
+        pub memory: u32,
+        pub copz: u32,
+        pub vfpu: u32,
+        pub sleep: u32,
+        pub bus_access: u32,
+        pub uncached_load: u32,
+        pub uncached_store: u32,
+        pub cached_load: u32,
+        pub cached_store: u32,
+        pub i_miss: u32,
+        pub d_miss: u32,
+        pub d_writeback: u32,
+        pub cop0_inst: u32,
+        pub fpu_inst: u32,
+        pub vfpu_inst: u32,
+        pub local_bus: u32,
+    }
+
+    pub struct SceKernelSysClock {
+        pub low: u32,
+        pub hi: u32,
+    }
+
+    pub struct SceKernelThreadOptParam {
+        pub size: usize,
+        pub stack_mpid: SceUid,
+    }
+
+    pub struct SceKernelThreadInfo {
+        pub size: usize,
+        pub name: [u8; 32],
+        pub attr: u32,
+        pub status: i32,
+        pub entry: SceKernelThreadEntry,
+        pub stack: *mut c_void,
+        pub stack_size: i32,
+        pub gp_reg: *mut c_void,
+        pub init_priority: i32,
+        pub current_priority: i32,
+        pub wait_type: i32,
+        pub wait_id: SceUid,
+        pub wakeup_count: i32,
+        pub exit_status: i32,
+        pub run_clocks: SceKernelSysClock,
+        pub intr_preempt_count: u32,
+        pub thread_preempt_count: u32,
+        pub release_count: u32,
+    }
+
+    pub struct SceKernelThreadRunStatus {
+        pub size: usize,
+        pub status: i32,
+        pub current_priority: i32,
+        pub wait_type: i32,
+        pub wait_id: i32,
+        pub wakeup_count: i32,
+        pub run_clocks: SceKernelSysClock,
+        pub intr_preempt_count: u32,
+        pub thread_preempt_count: u32,
+        pub release_count: u32,
+    }
+
+    pub struct SceKernelSemaOptParam {
+        pub size: usize,
+    }
+
+    pub struct SceKernelSemaInfo {
+        pub size: usize,
+        pub name: [u8; 32],
+        pub attr: u32,
+        pub init_count: i32,
+        pub current_count: i32,
+        pub max_count: i32,
+        pub num_wait_threads: i32,
+    }
+
+    pub struct SceKernelEventFlagInfo {
+        pub size: usize,
+        pub name: [u8; 32],
+        pub attr: u32,
+        pub init_pattern: u32,
+        pub current_pattern: u32,
+        pub num_wait_threads: i32,
+    }
+
+    pub struct SceKernelEventFlagOptParam {
+        pub size: usize,
+    }
+
+    pub struct SceKernelMbxOptParam {
+        pub size: usize,
+    }
+
+    pub struct SceKernelMbxInfo {
+        pub size: usize,
+        pub name: [u8; 32usize],
+        pub attr: u32,
+        pub num_wait_threads: i32,
+        pub num_messages: i32,
+        pub first_message: *mut c_void,
+    }
+
+    pub struct SceKernelVTimerInfo {
+        pub size: usize,
+        pub name: [u8; 32],
+        pub active: i32,
+        pub base: SceKernelSysClock,
+        pub current: SceKernelSysClock,
+        pub schedule: SceKernelSysClock,
+        pub handler: SceKernelVTimerHandler,
+        pub common: *mut c_void,
+    }
+
+    pub struct SceKernelThreadEventHandlerInfo {
+        pub size: usize,
+        pub name: [u8; 32],
+        pub thread_id: SceUid,
+        pub mask: i32,
+        pub handler: SceKernelThreadEventHandler,
+        pub common: *mut c_void,
+    }
+
+    pub struct SceKernelAlarmInfo {
+        pub size: usize,
+        pub schedule: SceKernelSysClock,
+        pub handler: SceKernelAlarmHandler,
+        pub common: *mut c_void,
+    }
+
+    pub struct SceKernelSystemStatus {
+        pub size: usize,
+        pub status: u32,
+        pub idle_clocks: SceKernelSysClock,
+        pub comes_out_of_idle_count: u32,
+        pub thread_switch_count: u32,
+        pub vfpu_switch_count: u32,
+    }
+
+    pub struct SceKernelMppInfo {
+        pub size: usize,
+        pub name: [u8; 32],
+        pub attr: u32,
+        pub buf_size: i32,
+        pub free_size: i32,
+        pub num_send_wait_threads: i32,
+        pub num_receive_wait_threads: i32,
+    }
+
+    pub struct SceKernelVplOptParam {
+        pub size: usize,
+    }
+
+    pub struct SceKernelVplInfo {
+        pub size: usize,
+        pub name: [u8; 32],
+        pub attr: u32,
+        pub pool_size: i32,
+        pub free_size: i32,
+        pub num_wait_threads: i32,
+    }
+
+    pub struct SceKernelFplOptParam {
+        pub size: usize,
+    }
+
+    pub struct SceKernelFplInfo {
+        pub size: usize,
+        pub name: [u8; 32usize],
+        pub attr: u32,
+        pub block_size: i32,
+        pub num_blocks: i32,
+        pub free_blocks: i32,
+        pub num_wait_threads: i32,
+    }
+
+    pub struct SceKernelVTimerOptParam {
+        pub size: usize,
+    }
+
+    pub struct SceKernelCallbackInfo {
+        pub size: usize,
+        pub name: [u8; 32usize],
+        pub thread_id: SceUid,
+        pub callback: SceKernelCallbackFunction,
+        pub common: *mut c_void,
+        pub notify_count: i32,
+        pub notify_arg: i32,
+    }
+
+    pub struct UsbCamSetupStillParam {
+        pub size: i32,
+        pub resolution: UsbCamResolution,
+        pub jpeg_size: i32,
+        pub reverse_flags: i32,
+        pub delay: UsbCamDelay,
+        pub comp_level: i32,
+    }
+
+    pub struct UsbCamSetupStillExParam {
+        pub size: i32,
+        pub unk: u32,
+        pub resolution: UsbCamResolutionEx,
+        pub jpeg_size: i32,
+        pub comp_level: i32,
+        pub unk2: u32,
+        pub unk3: u32,
+        pub flip: i32,
+        pub mirror: i32,
+        pub delay: UsbCamDelay,
+        pub unk4: [u32; 5usize],
+    }
+
+    pub struct UsbCamSetupVideoParam {
+        pub size: i32,
+        pub resolution: UsbCamResolution,
+        pub framerate: UsbCamFrameRate,
+        pub white_balance: UsbCamWb,
+        pub saturation: i32,
+        pub brightness: i32,
+        pub contrast: i32,
+        pub sharpness: i32,
+        pub effect_mode: UsbCamEffectMode,
+        pub frame_size: i32,
+        pub unk: u32,
+        pub evl_evel: UsbCamEvLevel,
+    }
+
+    pub struct UsbCamSetupVideoExParam {
+        pub size: i32,
+        pub unk: u32,
+        pub resolution: UsbCamResolutionEx,
+        pub framerate: UsbCamFrameRate,
+        pub unk2: u32,
+        pub unk3: u32,
+        pub white_balance: UsbCamWb,
+        pub saturation: i32,
+        pub brightness: i32,
+        pub contrast: i32,
+        pub sharpness: i32,
+        pub unk4: u32,
+        pub unk5: u32,
+        pub unk6: [u32; 3usize],
+        pub effect_mode: UsbCamEffectMode,
+        pub unk7: u32,
+        pub unk8: u32,
+        pub unk9: u32,
+        pub unk10: u32,
+        pub unk11: u32,
+        pub frame_size: i32,
+        pub unk12: u32,
+        pub ev_level: UsbCamEvLevel,
+    }
+
+    pub struct ScePspDateTime {
+        pub year: u16,
+        pub month: u16,
+        pub day: u16,
+        pub hour: u16,
+        pub minutes: u16,
+        pub seconds: u16,
+        pub microseconds: u32,
+    }
+
+    pub struct SceIoStat {
+        pub st_mode: i32,
+        pub st_attr: i32,
+        pub st_size: i64,
+        pub st_ctime: ScePspDateTime,
+        pub st_atime: ScePspDateTime,
+        pub st_mtime: ScePspDateTime,
+        pub st_private: [u32; 6usize],
+    }
+
+    pub struct UmdInfo {
+        pub size: u32,
+        pub type_: UmdType,
+    }
+
+    pub struct SceMpegRingbuffer {
+        pub packets: i32,
+        pub unk0: u32,
+        pub unk1: u32,
+        pub unk2: u32,
+        pub unk3: u32,
+        pub data: *mut c_void,
+        pub callback: SceMpegRingbufferCb,
+        pub cb_param: *mut c_void,
+        pub unk4: u32,
+        pub unk5: u32,
+        pub sce_mpeg: *mut c_void,
+    }
+
+    pub struct SceMpegAu {
+        pub pts_msb: u32,
+        pub pts: u32,
+        pub dts_msb: u32,
+        pub dts: u32,
+        pub es_buffer: u32,
+        pub au_size: u32,
+    }
+
+    pub struct SceMpegAvcMode {
+        pub unk0: i32,
+        pub pixel_format: super::DisplayPixelFormat,
+    }
+
+    #[repr(align(64))]
+    pub struct SceMpegLLI {
+        pub src: *mut c_void,
+        pub dst: *mut c_void,
+        pub next: *mut c_void,
+        pub size: i32,
+    }
+
+    #[repr(align(64))]
+    pub struct SceMpegYCrCbBuffer {
+        pub frame_buffer_height16: i32,
+        pub frame_buffer_width16: i32,
+        pub unknown: i32,
+        pub unknown2: i32,
+        pub y_buffer: *mut c_void,
+        pub y_buffer2: *mut c_void,
+        pub cr_buffer: *mut c_void,
+        pub cb_buffer: *mut c_void,
+        pub cr_buffer2: *mut c_void,
+        pub cb_buffer2: *mut c_void,
+
+        pub frame_height: i32,
+        pub frame_width: i32,
+        pub frame_buffer_width: i32,
+        pub unknown3: [i32; 11usize],
+    }
+
+    pub struct ScePspSRect {
+        pub x: i16,
+        pub y: i16,
+        pub w: i16,
+        pub h: i16,
+    }
+
+    pub struct ScePspIRect {
+        pub x: i32,
+        pub y: i32,
+        pub w: i32,
+        pub h: i32,
+    }
+
+    pub struct ScePspL64Rect {
+        pub x: u64,
+        pub y: u64,
+        pub w: u64,
+        pub h: u64,
+    }
+
+    pub struct ScePspSVector2 {
+        pub x: i16,
+        pub y: i16,
+    }
+
+    pub struct ScePspIVector2 {
+        pub x: i32,
+        pub y: i32,
+    }
+
+    pub struct ScePspL64Vector2 {
+        pub x: u64,
+        pub y: u64,
+    }
+
+    pub struct ScePspSVector3 {
+        pub x: i16,
+        pub y: i16,
+        pub z: i16,
+    }
+
+    pub struct ScePspIVector3 {
+        pub x: i32,
+        pub y: i32,
+        pub z: i32,
+    }
+
+    pub struct ScePspL64Vector3 {
+        pub x: u64,
+        pub y: u64,
+        pub z: u64,
+    }
+
+    pub struct ScePspSVector4 {
+        pub x: i16,
+        pub y: i16,
+        pub z: i16,
+        pub w: i16,
+    }
+
+    pub struct ScePspIVector4 {
+        pub x: i32,
+        pub y: i32,
+        pub z: i32,
+        pub w: i32,
+    }
+
+    pub struct ScePspL64Vector4 {
+        pub x: u64,
+        pub y: u64,
+        pub z: u64,
+        pub w: u64,
+    }
+
+    pub struct ScePspIMatrix2 {
+        pub x: ScePspIVector2,
+        pub y: ScePspIVector2,
+    }
+
+    pub struct ScePspIMatrix3 {
+        pub x: ScePspIVector3,
+        pub y: ScePspIVector3,
+        pub z: ScePspIVector3,
+    }
+
+    #[repr(align(16))]
+    pub struct ScePspIMatrix4 {
+        pub x: ScePspIVector4,
+        pub y: ScePspIVector4,
+        pub z: ScePspIVector4,
+        pub w: ScePspIVector4,
+    }
+
+    pub struct ScePspIMatrix4Unaligned {
+        pub x: ScePspIVector4,
+        pub y: ScePspIVector4,
+        pub z: ScePspIVector4,
+        pub w: ScePspIVector4,
+    }
+
+    pub struct SceMp3InitArg {
+        pub mp3_stream_start: u32,
+        pub unk1: u32,
+        pub mp3_stream_end: u32,
+        pub unk2: u32,
+        pub mp3_buf: *mut c_void,
+        pub mp3_buf_size: i32,
+        pub pcm_buf: *mut c_void,
+        pub pcm_buf_size: i32,
+    }
+
+    pub struct OpenPSID {
+        pub data: [u8; 16usize],
+    }
+
+    pub struct UtilityDialogCommon {
+        pub size: u32,
+        pub language: SystemParamLanguage,
+        pub button_accept: UtilityDialogButtonAccept,
+        pub graphics_thread: i32,
+        pub access_thread: i32,
+        pub font_thread: i32,
+        pub sound_thread: i32,
+        pub result: i32,
+        pub reserved: [i32; 4usize],
+    }
+
+    pub struct UtilityNetconfAdhoc {
+        pub name: [u8; 8usize],
+        pub timeout: u32,
+    }
+
+    pub struct UtilityNetconfData {
+        pub base: UtilityDialogCommon,
+        pub action: UtilityNetconfAction,
+        pub adhocparam: *mut UtilityNetconfAdhoc,
+        pub hotspot: i32,
+        pub hotspot_connected: i32,
+        pub wifisp: i32,
+    }
+
+    pub struct UtilitySavedataFileData {
+        pub buf: *mut c_void,
+        pub buf_size: usize,
+        pub size: usize,
+        pub unknown: i32,
+    }
+
+    pub struct UtilitySavedataListSaveNewData {
+        pub icon0: UtilitySavedataFileData,
+        pub title: *mut u8,
+    }
+
+    pub struct UtilityGameSharingParams {
+        pub base: UtilityDialogCommon,
+        pub unknown1: i32,
+        pub unknown2: i32,
+        pub name: [u8; 8usize],
+        pub unknown3: i32,
+        pub unknown4: i32,
+        pub unknown5: i32,
+        pub result: i32,
+        pub filepath: *mut u8,
+        pub mode: UtilityGameSharingMode,
+        pub datatype: UtilityGameSharingDataType,
+        pub data: *mut c_void,
+        pub datasize: u32,
+    }
+
+    pub struct UtilityHtmlViewerParam {
+        pub base: UtilityDialogCommon,
+        pub memaddr: *mut c_void,
+        pub memsize: u32,
+        pub unknown1: i32,
+        pub unknown2: i32,
+        pub initialurl: *mut u8,
+        pub numtabs: u32,
+        pub interfacemode: UtilityHtmlViewerInterfaceMode,
+        pub options: i32,
+        pub dldirname: *mut u8,
+        pub dlfilename: *mut u8,
+        pub uldirname: *mut u8,
+        pub ulfilename: *mut u8,
+        pub cookiemode: UtilityHtmlViewerCookieMode,
+        pub unknown3: u32,
+        pub homeurl: *mut u8,
+        pub textsize: UtilityHtmlViewerTextSize,
+        pub displaymode: UtilityHtmlViewerDisplayMode,
+        pub connectmode: UtilityHtmlViewerConnectMode,
+        pub disconnectmode: UtilityHtmlViewerDisconnectMode,
+        pub memused: u32,
+        pub unknown4: [i32; 10usize],
+    }
+
+    pub struct SceUtilityOskData {
+        pub unk_00: i32,
+        pub unk_04: i32,
+        pub language: SceUtilityOskInputLanguage,
+        pub unk_12: i32,
+        pub inputtype: SceUtilityOskInputType,
+        pub lines: i32,
+        pub unk_24: i32,
+        pub desc: *mut u16,
+        pub intext: *mut u16,
+        pub outtextlength: i32,
+        pub outtext: *mut u16,
+        pub result: SceUtilityOskResult,
+        pub outtextlimit: i32,
+    }
+
+    pub struct SceUtilityOskParams {
+        pub base: UtilityDialogCommon,
+        pub datacount: i32,
+        pub data: *mut SceUtilityOskData,
+        pub state: SceUtilityOskState,
+        pub unk_60: i32,
+    }
+
+    pub struct SceNetMallocStat {
+        pub pool: i32,
+        pub maximum: i32,
+        pub free: i32,
+    }
+
+    pub struct SceNetAdhocctlAdhocId {
+        pub unknown: i32,
+        pub adhoc_id: [u8; 9usize],
+        pub unk: [u8; 3usize],
+    }
+
+    pub struct SceNetAdhocctlScanInfo {
+        pub next: *mut SceNetAdhocctlScanInfo,
+        pub channel: i32,
+        pub name: [u8; 8usize],
+        pub bssid: [u8; 6usize],
+        pub unknown: [u8; 2usize],
+        pub unknown2: i32,
+    }
+
+    pub struct SceNetAdhocctlGameModeInfo {
+        pub count: i32,
+        pub macs: [[u8; 6usize]; 16usize],
+    }
+
+    pub struct SceNetAdhocPtpStat {
+        pub next: *mut SceNetAdhocPtpStat,
+        pub ptp_id: i32,
+        pub mac: [u8; 6usize],
+        pub peermac: [u8; 6usize],
+        pub port: u16,
+        pub peerport: u16,
+        pub sent_data: u32,
+        pub rcvd_data: u32,
+        pub state: ScePspnetAdhocPtpState,
+    }
+
+    pub struct SceNetAdhocPdpStat {
+        pub next: *mut SceNetAdhocPdpStat,
+        pub pdp_id: i32,
+        pub mac: [u8; 6usize],
+        pub port: u16,
+        pub rcvd_data: u32,
+    }
+
+    pub struct AdhocPoolStat {
+        pub size: i32,
+        pub maxsize: i32,
+        pub freesize: i32,
+    }
+}
+
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    pub struct GeContext {
+        pub context: [u32; 512],
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub struct SceKernelUtilsSha1Context {
+        pub h: [u32; 5usize],
+        pub us_remains: u16,
+        pub us_computed: u16,
+        pub ull_total_len: u64,
+        pub buf: [u8; 64usize],
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub struct SceKernelUtilsMt19937Context {
+        pub count: u32,
+        pub state: [u32; 624usize],
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub struct SceKernelUtilsMd5Context {
+        pub h: [u32; 4usize],
+        pub pad: u32,
+        pub us_remains: u16,
+        pub us_computed: u16,
+        pub ull_total_len: u64,
+        pub buf: [u8; 64usize],
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub struct SceIoDirent {
+        pub d_stat: SceIoStat,
+        pub d_name: [u8; 256usize],
+        pub d_private: *mut c_void,
+        pub dummy: i32,
+    }
+
+    #[cfg_attr(feature = "extra_traits", derive(Debug))]
+    pub struct ScePspFRect {
+        pub x: f32,
+        pub y: f32,
+        pub w: f32,
+        pub h: f32,
+    }
+
+    #[repr(align(16))]
+    #[cfg_attr(feature = "extra_traits", derive(Debug))]
+    pub struct ScePspFVector3 {
+        pub x: f32,
+        pub y: f32,
+        pub z: f32,
+    }
+
+    #[repr(align(16))]
+    #[cfg_attr(feature = "extra_traits", derive(Debug))]
+    pub struct ScePspFVector4 {
+        pub x: f32,
+        pub y: f32,
+        pub z: f32,
+        pub w: f32,
+    }
+
+    #[cfg_attr(feature = "extra_traits", derive(Debug))]
+    pub struct ScePspFVector4Unaligned {
+        pub x: f32,
+        pub y: f32,
+        pub z: f32,
+        pub w: f32,
+    }
+
+    #[cfg_attr(feature = "extra_traits", derive(Debug))]
+    pub struct ScePspFVector2 {
+        pub x: f32,
+        pub y: f32,
+    }
+
+    #[cfg_attr(feature = "extra_traits", derive(Debug))]
+    pub struct ScePspFMatrix2 {
+        pub x: ScePspFVector2,
+        pub y: ScePspFVector2,
+    }
+
+    #[cfg_attr(feature = "extra_traits", derive(Debug))]
+    pub struct ScePspFMatrix3 {
+        pub x: ScePspFVector3,
+        pub y: ScePspFVector3,
+        pub z: ScePspFVector3,
+    }
+
+    #[cfg_attr(feature = "extra_traits", derive(Debug))]
+    #[repr(align(16))]
+    pub struct ScePspFMatrix4 {
+        pub x: ScePspFVector4,
+        pub y: ScePspFVector4,
+        pub z: ScePspFVector4,
+        pub w: ScePspFVector4,
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub struct ScePspFMatrix4Unaligned {
+        pub x: ScePspFVector4,
+        pub y: ScePspFVector4,
+        pub z: ScePspFVector4,
+        pub w: ScePspFVector4,
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub union ScePspVector3 {
+        pub fv: ScePspFVector3,
+        pub iv: ScePspIVector3,
+        pub f: [f32; 3usize],
+        pub i: [i32; 3usize],
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub union ScePspVector4 {
+        pub fv: ScePspFVector4,
+        pub iv: ScePspIVector4,
+        pub qw: u128,
+        pub f: [f32; 4usize],
+        pub i: [i32; 4usize],
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub union ScePspMatrix2 {
+        pub fm: ScePspFMatrix2,
+        pub im: ScePspIMatrix2,
+        pub fv: [ScePspFVector2; 2usize],
+        pub iv: [ScePspIVector2; 2usize],
+        pub v: [ScePspVector2; 2usize],
+        pub f: [[f32; 2usize]; 2usize],
+        pub i: [[i32; 2usize]; 2usize],
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub union ScePspMatrix3 {
+        pub fm: ScePspFMatrix3,
+        pub im: ScePspIMatrix3,
+        pub fv: [ScePspFVector3; 3usize],
+        pub iv: [ScePspIVector3; 3usize],
+        pub v: [ScePspVector3; 3usize],
+        pub f: [[f32; 3usize]; 3usize],
+        pub i: [[i32; 3usize]; 3usize],
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub union ScePspVector2 {
+        pub fv: ScePspFVector2,
+        pub iv: ScePspIVector2,
+        pub f: [f32; 2usize],
+        pub i: [i32; 2usize],
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub union ScePspMatrix4 {
+        pub fm: ScePspFMatrix4,
+        pub im: ScePspIMatrix4,
+        pub fv: [ScePspFVector4; 4usize],
+        pub iv: [ScePspIVector4; 4usize],
+        pub v: [ScePspVector4; 4usize],
+        pub f: [[f32; 4usize]; 4usize],
+        pub i: [[i32; 4usize]; 4usize],
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub struct Key {
+        pub key_type: KeyType,
+        pub name: [u8; 256usize],
+        pub name_len: u32,
+        pub unk2: u32,
+        pub unk3: u32,
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub struct UtilityMsgDialogParams {
+        pub base: UtilityDialogCommon,
+        pub unknown: i32,
+        pub mode: UtilityMsgDialogMode,
+        pub error_value: u32,
+        pub message: [u8; 512usize],
+        pub options: i32,
+        pub button_pressed: UtilityMsgDialogPressed,
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub union UtilityNetData {
+        pub as_uint: u32,
+        pub as_string: [u8; 128usize],
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub struct UtilitySavedataSFOParam {
+        pub title: [u8; 128usize],
+        pub savedata_title: [u8; 128usize],
+        pub detail: [u8; 1024usize],
+        pub parental_level: u8,
+        pub unknown: [u8; 3usize],
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub struct SceUtilitySavedataParam {
+        pub base: UtilityDialogCommon,
+        pub mode: UtilitySavedataMode,
+        pub unknown1: i32,
+        pub overwrite: i32,
+        pub game_name: [u8; 13usize],
+        pub reserved: [u8; 3usize],
+        pub save_name: [u8; 20usize],
+        pub save_name_list: *mut [u8; 20usize],
+        pub file_name: [u8; 13usize],
+        pub reserved1: [u8; 3usize],
+        pub data_buf: *mut c_void,
+        pub data_buf_size: usize,
+        pub data_size: usize,
+        pub sfo_param: UtilitySavedataSFOParam,
+        pub icon0_file_data: UtilitySavedataFileData,
+        pub icon1_file_data: UtilitySavedataFileData,
+        pub pic1_file_data: UtilitySavedataFileData,
+        pub snd0_file_data: UtilitySavedataFileData,
+        pub new_data: *mut UtilitySavedataListSaveNewData,
+        pub focus: UtilitySavedataFocus,
+        pub unknown2: [i32; 4usize],
+        pub key: [u8; 16],
+        pub unknown3: [u8; 20],
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub struct SceNetAdhocctlPeerInfo {
+        pub next: *mut SceNetAdhocctlPeerInfo,
+        pub nickname: [u8; 128usize],
+        pub mac: [u8; 6usize],
+        pub unknown: [u8; 6usize],
+        pub timestamp: u32,
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub struct SceNetAdhocctlParams {
+        pub channel: i32,
+        pub name: [u8; 8usize],
+        pub bssid: [u8; 6usize],
+        pub nickname: [u8; 128usize],
+    }
+
+    #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
+    pub union SceNetApctlInfo {
+        pub name: [u8; 64usize],
+        pub bssid: [u8; 6usize],
+        pub ssid: [u8; 32usize],
+        pub ssid_length: u32,
+        pub security_type: u32,
+        pub strength: u8,
+        pub channel: u8,
+        pub power_save: u8,
+        pub ip: [u8; 16usize],
+        pub sub_net_mask: [u8; 16usize],
+        pub gateway: [u8; 16usize],
+        pub primary_dns: [u8; 16usize],
+        pub secondary_dns: [u8; 16usize],
+        pub use_proxy: u32,
+        pub proxy_url: [u8; 128usize],
+        pub proxy_port: u16,
+        pub eap_type: u32,
+        pub start_browser: u32,
+        pub wifisp: u32,
+    }
+}
+
+pub const INT_MIN: c_int = -2147483648;
+pub const INT_MAX: c_int = 2147483647;
+
+pub const AUDIO_VOLUME_MAX: u32 = 0x8000;
+pub const AUDIO_CHANNEL_MAX: u32 = 8;
+pub const AUDIO_NEXT_CHANNEL: i32 = -1;
+pub const AUDIO_SAMPLE_MIN: u32 = 64;
+pub const AUDIO_SAMPLE_MAX: u32 = 65472;
+
+pub const PSP_CTRL_SELECT: i32 = 0x000001;
+pub const PSP_CTRL_START: i32 = 0x000008;
+pub const PSP_CTRL_UP: i32 = 0x000010;
+pub const PSP_CTRL_RIGHT: i32 = 0x000020;
+pub const PSP_CTRL_DOWN: i32 = 0x000040;
+pub const PSP_CTRL_LEFT: i32 = 0x000080;
+pub const PSP_CTRL_LTRIGGER: i32 = 0x000100;
+pub const PSP_CTRL_RTRIGGER: i32 = 0x000200;
+pub const PSP_CTRL_TRIANGLE: i32 = 0x001000;
+pub const PSP_CTRL_CIRCLE: i32 = 0x002000;
+pub const PSP_CTRL_CROSS: i32 = 0x004000;
+pub const PSP_CTRL_SQUARE: i32 = 0x008000;
+pub const PSP_CTRL_HOME: i32 = 0x010000;
+pub const PSP_CTRL_HOLD: i32 = 0x020000;
+pub const PSP_CTRL_NOTE: i32 = 0x800000;
+pub const PSP_CTRL_SCREEN: i32 = 0x400000;
+pub const PSP_CTRL_VOLUP: i32 = 0x100000;
+pub const PSP_CTRL_VOLDOWN: i32 = 0x200000;
+pub const PSP_CTRL_WLAN_UP: i32 = 0x040000;
+pub const PSP_CTRL_REMOTE: i32 = 0x080000;
+pub const PSP_CTRL_DISC: i32 = 0x1000000;
+pub const PSP_CTRL_MS: i32 = 0x2000000;
+
+pub const USB_CAM_PID: i32 = 0x282;
+pub const USB_BUS_DRIVER_NAME: &str = "USBBusDriver";
+pub const USB_CAM_DRIVER_NAME: &str = "USBCamDriver";
+pub const USB_CAM_MIC_DRIVER_NAME: &str = "USBCamMicDriver";
+pub const USB_STOR_DRIVER_NAME: &str = "USBStor_Driver";
+
+pub const ACTIVATED: i32 = 0x200;
+pub const CONNECTED: i32 = 0x020;
+pub const ESTABLISHED: i32 = 0x002;
+
+pub const USB_CAM_FLIP: i32 = 1;
+pub const USB_CAM_MIRROR: i32 = 0x100;
+
+pub const THREAD_ATTR_VFPU: i32 = 0x00004000;
+pub const THREAD_ATTR_USER: i32 = 0x80000000;
+pub const THREAD_ATTR_USBWLAN: i32 = 0xa0000000;
+pub const THREAD_ATTR_VSH: i32 = 0xc0000000;
+pub const THREAD_ATTR_SCRATCH_SRAM: i32 = 0x00008000;
+pub const THREAD_ATTR_NO_FILLSTACK: i32 = 0x00100000;
+pub const THREAD_ATTR_CLEAR_STACK: i32 = 0x00200000;
+
+pub const EVENT_WAIT_MULTIPLE: i32 = 0x200;
+
+pub const EVENT_WAIT_AND: i32 = 0;
+pub const EVENT_WAIT_OR: i32 = 1;
+pub const EVENT_WAIT_CLEAR: i32 = 0x20;
+
+pub const POWER_INFO_POWER_SWITCH: i32 = 0x80000000;
+pub const POWER_INFO_HOLD_SWITCH: i32 = 0x40000000;
+pub const POWER_INFO_STANDBY: i32 = 0x00080000;
+pub const POWER_INFO_RESUME_COMPLETE: i32 = 0x00040000;
+pub const POWER_INFO_RESUMING: i32 = 0x00020000;
+pub const POWER_INFO_SUSPENDING: i32 = 0x00010000;
+pub const POWER_INFO_AC_POWER: i32 = 0x00001000;
+pub const POWER_INFO_BATTERY_LOW: i32 = 0x00000100;
+pub const POWER_INFO_BATTERY_EXIST: i32 = 0x00000080;
+pub const POWER_INFO_BATTERY_POWER: i32 = 0x0000007;
+
+pub const FIO_S_IFLNK: i32 = 0x4000;
+pub const FIO_S_IFDIR: i32 = 0x1000;
+pub const FIO_S_IFREG: i32 = 0x2000;
+pub const FIO_S_ISUID: i32 = 0x0800;
+pub const FIO_S_ISGID: i32 = 0x0400;
+pub const FIO_S_ISVTX: i32 = 0x0200;
+pub const FIO_S_IRUSR: i32 = 0x0100;
+pub const FIO_S_IWUSR: i32 = 0x0080;
+pub const FIO_S_IXUSR: i32 = 0x0040;
+pub const FIO_S_IRGRP: i32 = 0x0020;
+pub const FIO_S_IWGRP: i32 = 0x0010;
+pub const FIO_S_IXGRP: i32 = 0x0008;
+pub const FIO_S_IROTH: i32 = 0x0004;
+pub const FIO_S_IWOTH: i32 = 0x0002;
+pub const FIO_S_IXOTH: i32 = 0x0001;
+
+pub const FIO_SO_IFLNK: i32 = 0x0008;
+pub const FIO_SO_IFDIR: i32 = 0x0010;
+pub const FIO_SO_IFREG: i32 = 0x0020;
+pub const FIO_SO_IROTH: i32 = 0x0004;
+pub const FIO_SO_IWOTH: i32 = 0x0002;
+pub const FIO_SO_IXOTH: i32 = 0x0001;
+
+pub const PSP_O_RD_ONLY: i32 = 0x0001;
+pub const PSP_O_WR_ONLY: i32 = 0x0002;
+pub const PSP_O_RD_WR: i32 = 0x0003;
+pub const PSP_O_NBLOCK: i32 = 0x0004;
+pub const PSP_O_DIR: i32 = 0x0008;
+pub const PSP_O_APPEND: i32 = 0x0100;
+pub const PSP_O_CREAT: i32 = 0x0200;
+pub const PSP_O_TRUNC: i32 = 0x0400;
+pub const PSP_O_EXCL: i32 = 0x0800;
+pub const PSP_O_NO_WAIT: i32 = 0x8000;
+
+pub const UMD_NOT_PRESENT: i32 = 0x01;
+pub const UMD_PRESENT: i32 = 0x02;
+pub const UMD_CHANGED: i32 = 0x04;
+pub const UMD_INITING: i32 = 0x08;
+pub const UMD_INITED: i32 = 0x10;
+pub const UMD_READY: i32 = 0x20;
+
+pub const PLAY_PAUSE: i32 = 0x1;
+pub const FORWARD: i32 = 0x4;
+pub const BACK: i32 = 0x8;
+pub const VOL_UP: i32 = 0x10;
+pub const VOL_DOWN: i32 = 0x20;
+pub const HOLD: i32 = 0x80;
+
+pub const GU_PI: f32 = 3.141593;
+
+pub const GU_TEXTURE_8BIT: i32 = 1;
+pub const GU_TEXTURE_16BIT: i32 = 2;
+pub const GU_TEXTURE_32BITF: i32 = 3;
+pub const GU_COLOR_5650: i32 = 4 << 2;
+pub const GU_COLOR_5551: i32 = 5 << 2;
+pub const GU_COLOR_4444: i32 = 6 << 2;
+pub const GU_COLOR_8888: i32 = 7 << 2;
+pub const GU_NORMAL_8BIT: i32 = 1 << 5;
+pub const GU_NORMAL_16BIT: i32 = 2 << 5;
+pub const GU_NORMAL_32BITF: i32 = 3 << 5;
+pub const GU_VERTEX_8BIT: i32 = 1 << 7;
+pub const GU_VERTEX_16BIT: i32 = 2 << 7;
+pub const GU_VERTEX_32BITF: i32 = 3 << 7;
+pub const GU_WEIGHT_8BIT: i32 = 1 << 9;
+pub const GU_WEIGHT_16BIT: i32 = 2 << 9;
+pub const GU_WEIGHT_32BITF: i32 = 3 << 9;
+pub const GU_INDEX_8BIT: i32 = 1 << 11;
+pub const GU_INDEX_16BIT: i32 = 2 << 11;
+pub const GU_WEIGHTS1: i32 = (((1 - 1) & 7) << 14) as i32;
+pub const GU_WEIGHTS2: i32 = (((2 - 1) & 7) << 14) as i32;
+pub const GU_WEIGHTS3: i32 = (((3 - 1) & 7) << 14) as i32;
+pub const GU_WEIGHTS4: i32 = (((4 - 1) & 7) << 14) as i32;
+pub const GU_WEIGHTS5: i32 = (((5 - 1) & 7) << 14) as i32;
+pub const GU_WEIGHTS6: i32 = (((6 - 1) & 7) << 14) as i32;
+pub const GU_WEIGHTS7: i32 = (((7 - 1) & 7) << 14) as i32;
+pub const GU_WEIGHTS8: i32 = (((8 - 1) & 7) << 14) as i32;
+pub const GU_VERTICES1: i32 = (((1 - 1) & 7) << 18) as i32;
+pub const GU_VERTICES2: i32 = (((2 - 1) & 7) << 18) as i32;
+pub const GU_VERTICES3: i32 = (((3 - 1) & 7) << 18) as i32;
+pub const GU_VERTICES4: i32 = (((4 - 1) & 7) << 18) as i32;
+pub const GU_VERTICES5: i32 = (((5 - 1) & 7) << 18) as i32;
+pub const GU_VERTICES6: i32 = (((6 - 1) & 7) << 18) as i32;
+pub const GU_VERTICES7: i32 = (((7 - 1) & 7) << 18) as i32;
+pub const GU_VERTICES8: i32 = (((8 - 1) & 7) << 18) as i32;
+pub const GU_TRANSFORM_2D: i32 = 1 << 23;
+pub const GU_TRANSFORM_3D: i32 = 0;
+
+pub const GU_COLOR_BUFFER_BIT: i32 = 1;
+pub const GU_STENCIL_BUFFER_BIT: i32 = 2;
+pub const GU_DEPTH_BUFFER_BIT: i32 = 4;
+pub const GU_FAST_CLEAR_BIT: i32 = 16;
+
+pub const GU_AMBIENT: i32 = 1;
+pub const GU_DIFFUSE: i32 = 2;
+pub const GU_SPECULAR: i32 = 4;
+pub const GU_UNKNOWN_LIGHT_COMPONENT: i32 = 8;
+
+pub const SYSTEM_REGISTRY: [u8; 7] = *b"/system";
+pub const REG_KEYNAME_SIZE: u32 = 27;
+
+pub const UTILITY_MSGDIALOG_ERROR: i32 = 0;
+pub const UTILITY_MSGDIALOG_TEXT: i32 = 1;
+pub const UTILITY_MSGDIALOG_YES_NO_BUTTONS: i32 = 0x10;
+pub const UTILITY_MSGDIALOG_DEFAULT_NO: i32 = 0x100;
+
+pub const UTILITY_HTMLVIEWER_OPEN_SCE_START_PAGE: i32 = 0x000001;
+pub const UTILITY_HTMLVIEWER_DISABLE_STARTUP_LIMITS: i32 = 0x000002;
+pub const UTILITY_HTMLVIEWER_DISABLE_EXIT_DIALOG: i32 = 0x000004;
+pub const UTILITY_HTMLVIEWER_DISABLE_CURSOR: i32 = 0x000008;
+pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_COMPLETE_DIALOG: i32 = 0x000010;
+pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_START_DIALOG: i32 = 0x000020;
+pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_DESTINATION_DIALOG: i32 = 0x000040;
+pub const UTILITY_HTMLVIEWER_LOCK_DOWNLOAD_DESTINATION_DIALOG: i32 = 0x000080;
+pub const UTILITY_HTMLVIEWER_DISABLE_TAB_DISPLAY: i32 = 0x000100;
+pub const UTILITY_HTMLVIEWER_ENABLE_ANALOG_HOLD: i32 = 0x000200;
+pub const UTILITY_HTMLVIEWER_ENABLE_FLASH: i32 = 0x000400;
+pub const UTILITY_HTMLVIEWER_DISABLE_LRTRIGGER: i32 = 0x000800;
+
+extern "C" {
+    pub fn sceAudioChReserve(channel: i32, sample_count: i32, format: AudioFormat) -> i32;
+    pub fn sceAudioChRelease(channel: i32) -> i32;
+    pub fn sceAudioOutput(channel: i32, vol: i32, buf: *mut c_void) -> i32;
+    pub fn sceAudioOutputBlocking(channel: i32, vol: i32, buf: *mut c_void) -> i32;
+    pub fn sceAudioOutputPanned(
+        channel: i32,
+        left_vol: i32,
+        right_vol: i32,
+        buf: *mut c_void,
+    ) -> i32;
+    pub fn sceAudioOutputPannedBlocking(
+        channel: i32,
+        left_vol: i32,
+        right_vol: i32,
+        buf: *mut c_void,
+    ) -> i32;
+    pub fn sceAudioGetChannelRestLen(channel: i32) -> i32;
+    pub fn sceAudioGetChannelRestLength(channel: i32) -> i32;
+    pub fn sceAudioSetChannelDataLen(channel: i32, sample_count: i32) -> i32;
+    pub fn sceAudioChangeChannelConfig(channel: i32, format: AudioFormat) -> i32;
+    pub fn sceAudioChangeChannelVolume(channel: i32, left_vol: i32, right_vol: i32) -> i32;
+    pub fn sceAudioOutput2Reserve(sample_count: i32) -> i32;
+    pub fn sceAudioOutput2Release() -> i32;
+    pub fn sceAudioOutput2ChangeLength(sample_count: i32) -> i32;
+    pub fn sceAudioOutput2OutputBlocking(vol: i32, buf: *mut c_void) -> i32;
+    pub fn sceAudioOutput2GetRestSample() -> i32;
+    pub fn sceAudioSRCChReserve(
+        sample_count: i32,
+        freq: AudioOutputFrequency,
+        channels: i32,
+    ) -> i32;
+    pub fn sceAudioSRCChRelease() -> i32;
+    pub fn sceAudioSRCOutputBlocking(vol: i32, buf: *mut c_void) -> i32;
+    pub fn sceAudioInputInit(unknown1: i32, gain: i32, unknown2: i32) -> i32;
+    pub fn sceAudioInputInitEx(params: *mut AudioInputParams) -> i32;
+    pub fn sceAudioInputBlocking(sample_count: i32, freq: AudioInputFrequency, buf: *mut c_void);
+    pub fn sceAudioInput(sample_count: i32, freq: AudioInputFrequency, buf: *mut c_void);
+    pub fn sceAudioGetInputLength() -> i32;
+    pub fn sceAudioWaitInputEnd() -> i32;
+    pub fn sceAudioPollInputEnd() -> i32;
+
+    pub fn sceAtracGetAtracID(ui_codec_type: u32) -> i32;
+    pub fn sceAtracSetDataAndGetID(buf: *mut c_void, bufsize: usize) -> i32;
+    pub fn sceAtracDecodeData(
+        atrac_id: i32,
+        out_samples: *mut u16,
+        out_n: *mut i32,
+        out_end: *mut i32,
+        out_remain_frame: *mut i32,
+    ) -> i32;
+    pub fn sceAtracGetRemainFrame(atrac_id: i32, out_remain_frame: *mut i32) -> i32;
+    pub fn sceAtracGetStreamDataInfo(
+        atrac_id: i32,
+        write_pointer: *mut *mut u8,
+        available_bytes: *mut u32,
+        read_offset: *mut u32,
+    ) -> i32;
+    pub fn sceAtracAddStreamData(atrac_id: i32, bytes_to_add: u32) -> i32;
+    pub fn sceAtracGetBitrate(atrac_id: i32, out_bitrate: *mut i32) -> i32;
+    pub fn sceAtracSetLoopNum(atrac_id: i32, nloops: i32) -> i32;
+    pub fn sceAtracReleaseAtracID(atrac_id: i32) -> i32;
+    pub fn sceAtracGetNextSample(atrac_id: i32, out_n: *mut i32) -> i32;
+    pub fn sceAtracGetMaxSample(atrac_id: i32, out_max: *mut i32) -> i32;
+    pub fn sceAtracGetBufferInfoForReseting(
+        atrac_id: i32,
+        ui_sample: u32,
+        pbuffer_info: *mut Atrac3BufferInfo,
+    ) -> i32;
+    pub fn sceAtracGetChannel(atrac_id: i32, pui_channel: *mut u32) -> i32;
+    pub fn sceAtracGetInternalErrorInfo(atrac_id: i32, pi_result: *mut i32) -> i32;
+    pub fn sceAtracGetLoopStatus(
+        atrac_id: i32,
+        pi_loop_num: *mut i32,
+        pui_loop_status: *mut u32,
+    ) -> i32;
+    pub fn sceAtracGetNextDecodePosition(atrac_id: i32, pui_sample_position: *mut u32) -> i32;
+    pub fn sceAtracGetSecondBufferInfo(
+        atrac_id: i32,
+        pui_position: *mut u32,
+        pui_data_byte: *mut u32,
+    ) -> i32;
+    pub fn sceAtracGetSoundSample(
+        atrac_id: i32,
+        pi_end_sample: *mut i32,
+        pi_loop_start_sample: *mut i32,
+        pi_loop_end_sample: *mut i32,
+    ) -> i32;
+    pub fn sceAtracResetPlayPosition(
+        atrac_id: i32,
+        ui_sample: u32,
+        ui_write_byte_first_buf: u32,
+        ui_write_byte_second_buf: u32,
+    ) -> i32;
+    pub fn sceAtracSetData(atrac_id: i32, puc_buffer_addr: *mut u8, ui_buffer_byte: u32) -> i32;
+    pub fn sceAtracSetHalfwayBuffer(
+        atrac_id: i32,
+        puc_buffer_addr: *mut u8,
+        ui_read_byte: u32,
+        ui_buffer_byte: u32,
+    ) -> i32;
+    pub fn sceAtracSetHalfwayBufferAndGetID(
+        puc_buffer_addr: *mut u8,
+        ui_read_byte: u32,
+        ui_buffer_byte: u32,
+    ) -> i32;
+    pub fn sceAtracSetSecondBuffer(
+        atrac_id: i32,
+        puc_second_buffer_addr: *mut u8,
+        ui_second_buffer_byte: u32,
+    ) -> i32;
+
+    pub fn sceCtrlSetSamplingCycle(cycle: i32) -> i32;
+    pub fn sceCtrlGetSamplingCycle(pcycle: *mut i32) -> i32;
+    pub fn sceCtrlSetSamplingMode(mode: CtrlMode) -> i32;
+    pub fn sceCtrlGetSamplingMode(pmode: *mut i32) -> i32;
+    pub fn sceCtrlPeekBufferPositive(pad_data: *mut SceCtrlData, count: i32) -> i32;
+    pub fn sceCtrlPeekBufferNegative(pad_data: *mut SceCtrlData, count: i32) -> i32;
+    pub fn sceCtrlReadBufferPositive(pad_data: *mut SceCtrlData, count: i32) -> i32;
+    pub fn sceCtrlReadBufferNegative(pad_data: *mut SceCtrlData, count: i32) -> i32;
+    pub fn sceCtrlPeekLatch(latch_data: *mut SceCtrlLatch) -> i32;
+    pub fn sceCtrlReadLatch(latch_data: *mut SceCtrlLatch) -> i32;
+    pub fn sceCtrlSetIdleCancelThreshold(idlereset: i32, idleback: i32) -> i32;
+    pub fn sceCtrlGetIdleCancelThreshold(idlereset: *mut i32, idleback: *mut i32) -> i32;
+
+    pub fn sceDisplaySetMode(mode: DisplayMode, width: usize, height: usize) -> u32;
+    pub fn sceDisplayGetMode(pmode: *mut i32, pwidth: *mut i32, pheight: *mut i32) -> i32;
+    pub fn sceDisplaySetFrameBuf(
+        top_addr: *const u8,
+        buffer_width: usize,
+        pixel_format: DisplayPixelFormat,
+        sync: DisplaySetBufSync,
+    ) -> u32;
+    pub fn sceDisplayGetFrameBuf(
+        top_addr: *mut *mut c_void,
+        buffer_width: *mut usize,
+        pixel_format: *mut DisplayPixelFormat,
+        sync: DisplaySetBufSync,
+    ) -> i32;
+    pub fn sceDisplayGetVcount() -> u32;
+    pub fn sceDisplayWaitVblank() -> i32;
+    pub fn sceDisplayWaitVblankCB() -> i32;
+    pub fn sceDisplayWaitVblankStart() -> i32;
+    pub fn sceDisplayWaitVblankStartCB() -> i32;
+    pub fn sceDisplayGetAccumulatedHcount() -> i32;
+    pub fn sceDisplayGetCurrentHcount() -> i32;
+    pub fn sceDisplayGetFramePerSec() -> f32;
+    pub fn sceDisplayIsForeground() -> i32;
+    pub fn sceDisplayIsVblank() -> i32;
+
+    pub fn sceGeEdramGetSize() -> u32;
+    pub fn sceGeEdramGetAddr() -> *mut u8;
+    pub fn sceGeEdramSetAddrTranslation(width: i32) -> i32;
+    pub fn sceGeGetCmd(cmd: i32) -> u32;
+    pub fn sceGeGetMtx(type_: GeMatrixType, matrix: *mut c_void) -> i32;
+    pub fn sceGeGetStack(stack_id: i32, stack: *mut GeStack) -> i32;
+    pub fn sceGeSaveContext(context: *mut GeContext) -> i32;
+    pub fn sceGeRestoreContext(context: *const GeContext) -> i32;
+    pub fn sceGeListEnQueue(
+        list: *const c_void,
+        stall: *mut c_void,
+        cbid: i32,
+        arg: *mut GeListArgs,
+    ) -> i32;
+    pub fn sceGeListEnQueueHead(
+        list: *const c_void,
+        stall: *mut c_void,
+        cbid: i32,
+        arg: *mut GeListArgs,
+    ) -> i32;
+    pub fn sceGeListDeQueue(qid: i32) -> i32;
+    pub fn sceGeListUpdateStallAddr(qid: i32, stall: *mut c_void) -> i32;
+    pub fn sceGeListSync(qid: i32, sync_type: i32) -> GeListState;
+    pub fn sceGeDrawSync(sync_type: i32) -> GeListState;
+    pub fn sceGeBreak(mode: i32, p_param: *mut GeBreakParam) -> i32;
+    pub fn sceGeContinue() -> i32;
+    pub fn sceGeSetCallback(cb: *mut GeCallbackData) -> i32;
+    pub fn sceGeUnsetCallback(cbid: i32) -> i32;
+
+    pub fn sceKernelExitGame();
+    pub fn sceKernelRegisterExitCallback(id: SceUid) -> i32;
+    pub fn sceKernelLoadExec(file: *const u8, param: *mut SceKernelLoadExecParam) -> i32;
+
+    pub fn sceKernelAllocPartitionMemory(
+        partition: SceSysMemPartitionId,
+        name: *const u8,
+        type_: SceSysMemBlockTypes,
+        size: u32,
+        addr: *mut c_void,
+    ) -> SceUid;
+    pub fn sceKernelGetBlockHeadAddr(blockid: SceUid) -> *mut c_void;
+    pub fn sceKernelFreePartitionMemory(blockid: SceUid) -> i32;
+    pub fn sceKernelTotalFreeMemSize() -> usize;
+    pub fn sceKernelMaxFreeMemSize() -> usize;
+    pub fn sceKernelDevkitVersion() -> u32;
+    pub fn sceKernelSetCompiledSdkVersion(version: u32) -> i32;
+    pub fn sceKernelGetCompiledSdkVersion() -> u32;
+
+    pub fn sceKernelLibcTime(t: *mut i32) -> i32;
+    pub fn sceKernelLibcClock() -> u32;
+    pub fn sceKernelLibcGettimeofday(tp: *mut timeval, tzp: *mut timezone) -> i32;
+    pub fn sceKernelDcacheWritebackAll();
+    pub fn sceKernelDcacheWritebackInvalidateAll();
+    pub fn sceKernelDcacheWritebackRange(p: *const c_void, size: u32);
+    pub fn sceKernelDcacheWritebackInvalidateRange(p: *const c_void, size: u32);
+    pub fn sceKernelDcacheInvalidateRange(p: *const c_void, size: u32);
+    pub fn sceKernelIcacheInvalidateAll();
+    pub fn sceKernelIcacheInvalidateRange(p: *const c_void, size: u32);
+    pub fn sceKernelUtilsMt19937Init(ctx: *mut SceKernelUtilsMt19937Context, seed: u32) -> i32;
+    pub fn sceKernelUtilsMt19937UInt(ctx: *mut SceKernelUtilsMt19937Context) -> u32;
+    pub fn sceKernelUtilsMd5Digest(data: *mut u8, size: u32, digest: *mut u8) -> i32;
+    pub fn sceKernelUtilsMd5BlockInit(ctx: *mut SceKernelUtilsMd5Context) -> i32;
+    pub fn sceKernelUtilsMd5BlockUpdate(
+        ctx: *mut SceKernelUtilsMd5Context,
+        data: *mut u8,
+        size: u32,
+    ) -> i32;
+    pub fn sceKernelUtilsMd5BlockResult(ctx: *mut SceKernelUtilsMd5Context, digest: *mut u8)
+        -> i32;
+    pub fn sceKernelUtilsSha1Digest(data: *mut u8, size: u32, digest: *mut u8) -> i32;
+    pub fn sceKernelUtilsSha1BlockInit(ctx: *mut SceKernelUtilsSha1Context) -> i32;
+    pub fn sceKernelUtilsSha1BlockUpdate(
+        ctx: *mut SceKernelUtilsSha1Context,
+        data: *mut u8,
+        size: u32,
+    ) -> i32;
+    pub fn sceKernelUtilsSha1BlockResult(
+        ctx: *mut SceKernelUtilsSha1Context,
+        digest: *mut u8,
+    ) -> i32;
+
+    pub fn sceKernelRegisterSubIntrHandler(
+        int_no: i32,
+        no: i32,
+        handler: *mut c_void,
+        arg: *mut c_void,
+    ) -> i32;
+    pub fn sceKernelReleaseSubIntrHandler(int_no: i32, no: i32) -> i32;
+    pub fn sceKernelEnableSubIntr(int_no: i32, no: i32) -> i32;
+    pub fn sceKernelDisableSubIntr(int_no: i32, no: i32) -> i32;
+    pub fn QueryIntrHandlerInfo(
+        intr_code: SceUid,
+        sub_intr_code: SceUid,
+        data: *mut IntrHandlerOptionParam,
+    ) -> i32;
+
+    pub fn sceKernelCpuSuspendIntr() -> u32;
+    pub fn sceKernelCpuResumeIntr(flags: u32);
+    pub fn sceKernelCpuResumeIntrWithSync(flags: u32);
+    pub fn sceKernelIsCpuIntrSuspended(flags: u32) -> i32;
+    pub fn sceKernelIsCpuIntrEnable() -> i32;
+
+    pub fn sceKernelLoadModule(
+        path: *const u8,
+        flags: i32,
+        option: *mut SceKernelLMOption,
+    ) -> SceUid;
+    pub fn sceKernelLoadModuleMs(
+        path: *const u8,
+        flags: i32,
+        option: *mut SceKernelLMOption,
+    ) -> SceUid;
+    pub fn sceKernelLoadModuleByID(
+        fid: SceUid,
+        flags: i32,
+        option: *mut SceKernelLMOption,
+    ) -> SceUid;
+    pub fn sceKernelLoadModuleBufferUsbWlan(
+        buf_size: usize,
+        buf: *mut c_void,
+        flags: i32,
+        option: *mut SceKernelLMOption,
+    ) -> SceUid;
+    pub fn sceKernelStartModule(
+        mod_id: SceUid,
+        arg_size: usize,
+        argp: *mut c_void,
+        status: *mut i32,
+        option: *mut SceKernelSMOption,
+    ) -> i32;
+    pub fn sceKernelStopModule(
+        mod_id: SceUid,
+        arg_size: usize,
+        argp: *mut c_void,
+        status: *mut i32,
+        option: *mut SceKernelSMOption,
+    ) -> i32;
+    pub fn sceKernelUnloadModule(mod_id: SceUid) -> i32;
+    pub fn sceKernelSelfStopUnloadModule(unknown: i32, arg_size: usize, argp: *mut c_void) -> i32;
+    pub fn sceKernelStopUnloadSelfModule(
+        arg_size: usize,
+        argp: *mut c_void,
+        status: *mut i32,
+        option: *mut SceKernelSMOption,
+    ) -> i32;
+    pub fn sceKernelQueryModuleInfo(mod_id: SceUid, info: *mut SceKernelModuleInfo) -> i32;
+    pub fn sceKernelGetModuleIdList(
+        read_buf: *mut SceUid,
+        read_buf_size: i32,
+        id_count: *mut i32,
+    ) -> i32;
+
+    pub fn sceKernelVolatileMemLock(unk: i32, ptr: *mut *mut c_void, size: *mut i32) -> i32;
+    pub fn sceKernelVolatileMemTryLock(unk: i32, ptr: *mut *mut c_void, size: *mut i32) -> i32;
+    pub fn sceKernelVolatileMemUnlock(unk: i32) -> i32;
+
+    pub fn sceKernelStdin() -> SceUid;
+    pub fn sceKernelStdout() -> SceUid;
+    pub fn sceKernelStderr() -> SceUid;
+
+    pub fn sceKernelGetThreadmanIdType(uid: SceUid) -> SceKernelIdListType;
+    pub fn sceKernelCreateThread(
+        name: *const u8,
+        entry: SceKernelThreadEntry,
+        init_priority: i32,
+        stack_size: i32,
+        attr: i32,
+        option: *mut SceKernelThreadOptParam,
+    ) -> SceUid;
+    pub fn sceKernelDeleteThread(thid: SceUid) -> i32;
+    pub fn sceKernelStartThread(id: SceUid, arg_len: usize, arg_p: *mut c_void) -> i32;
+    pub fn sceKernelExitThread(status: i32) -> i32;
+    pub fn sceKernelExitDeleteThread(status: i32) -> i32;
+    pub fn sceKernelTerminateThread(thid: SceUid) -> i32;
+    pub fn sceKernelTerminateDeleteThread(thid: SceUid) -> i32;
+    pub fn sceKernelSuspendDispatchThread() -> i32;
+    pub fn sceKernelResumeDispatchThread(state: i32) -> i32;
+    pub fn sceKernelSleepThread() -> i32;
+    pub fn sceKernelSleepThreadCB() -> i32;
+    pub fn sceKernelWakeupThread(thid: SceUid) -> i32;
+    pub fn sceKernelCancelWakeupThread(thid: SceUid) -> i32;
+    pub fn sceKernelSuspendThread(thid: SceUid) -> i32;
+    pub fn sceKernelResumeThread(thid: SceUid) -> i32;
+    pub fn sceKernelWaitThreadEnd(thid: SceUid, timeout: *mut u32) -> i32;
+    pub fn sceKernelWaitThreadEndCB(thid: SceUid, timeout: *mut u32) -> i32;
+    pub fn sceKernelDelayThread(delay: u32) -> i32;
+    pub fn sceKernelDelayThreadCB(delay: u32) -> i32;
+    pub fn sceKernelDelaySysClockThread(delay: *mut SceKernelSysClock) -> i32;
+    pub fn sceKernelDelaySysClockThreadCB(delay: *mut SceKernelSysClock) -> i32;
+    pub fn sceKernelChangeCurrentThreadAttr(unknown: i32, attr: i32) -> i32;
+    pub fn sceKernelChangeThreadPriority(thid: SceUid, priority: i32) -> i32;
+    pub fn sceKernelRotateThreadReadyQueue(priority: i32) -> i32;
+    pub fn sceKernelReleaseWaitThread(thid: SceUid) -> i32;
+    pub fn sceKernelGetThreadId() -> i32;
+    pub fn sceKernelGetThreadCurrentPriority() -> i32;
+    pub fn sceKernelGetThreadExitStatus(thid: SceUid) -> i32;
+    pub fn sceKernelCheckThreadStack() -> i32;
+    pub fn sceKernelGetThreadStackFreeSize(thid: SceUid) -> i32;
+    pub fn sceKernelReferThreadStatus(thid: SceUid, info: *mut SceKernelThreadInfo) -> i32;
+    pub fn sceKernelReferThreadRunStatus(
+        thid: SceUid,
+        status: *mut SceKernelThreadRunStatus,
+    ) -> i32;
+    pub fn sceKernelCreateSema(
+        name: *const u8,
+        attr: u32,
+        init_val: i32,
+        max_val: i32,
+        option: *mut SceKernelSemaOptParam,
+    ) -> SceUid;
+    pub fn sceKernelDeleteSema(sema_id: SceUid) -> i32;
+    pub fn sceKernelSignalSema(sema_id: SceUid, signal: i32) -> i32;
+    pub fn sceKernelWaitSema(sema_id: SceUid, signal: i32, timeout: *mut u32) -> i32;
+    pub fn sceKernelWaitSemaCB(sema_id: SceUid, signal: i32, timeout: *mut u32) -> i32;
+    pub fn sceKernelPollSema(sema_id: SceUid, signal: i32) -> i32;
+    pub fn sceKernelReferSemaStatus(sema_id: SceUid, info: *mut SceKernelSemaInfo) -> i32;
+    pub fn sceKernelCreateEventFlag(
+        name: *const u8,
+        attr: i32,
+        bits: i32,
+        opt: *mut SceKernelEventFlagOptParam,
+    ) -> SceUid;
+    pub fn sceKernelSetEventFlag(ev_id: SceUid, bits: u32) -> i32;
+    pub fn sceKernelClearEventFlag(ev_id: SceUid, bits: u32) -> i32;
+    pub fn sceKernelPollEventFlag(ev_id: SceUid, bits: u32, wait: i32, out_bits: *mut u32) -> i32;
+    pub fn sceKernelWaitEventFlag(
+        ev_id: SceUid,
+        bits: u32,
+        wait: i32,
+        out_bits: *mut u32,
+        timeout: *mut u32,
+    ) -> i32;
+    pub fn sceKernelWaitEventFlagCB(
+        ev_id: SceUid,
+        bits: u32,
+        wait: i32,
+        out_bits: *mut u32,
+        timeout: *mut u32,
+    ) -> i32;
+    pub fn sceKernelDeleteEventFlag(ev_id: SceUid) -> i32;
+    pub fn sceKernelReferEventFlagStatus(event: SceUid, status: *mut SceKernelEventFlagInfo)
+        -> i32;
+    pub fn sceKernelCreateMbx(
+        name: *const u8,
+        attr: u32,
+        option: *mut SceKernelMbxOptParam,
+    ) -> SceUid;
+    pub fn sceKernelDeleteMbx(mbx_id: SceUid) -> i32;
+    pub fn sceKernelSendMbx(mbx_id: SceUid, message: *mut c_void) -> i32;
+    pub fn sceKernelReceiveMbx(mbx_id: SceUid, message: *mut *mut c_void, timeout: *mut u32)
+        -> i32;
+    pub fn sceKernelReceiveMbxCB(
+        mbx_id: SceUid,
+        message: *mut *mut c_void,
+        timeout: *mut u32,
+    ) -> i32;
+    pub fn sceKernelPollMbx(mbx_id: SceUid, pmessage: *mut *mut c_void) -> i32;
+    pub fn sceKernelCancelReceiveMbx(mbx_id: SceUid, num: *mut i32) -> i32;
+    pub fn sceKernelReferMbxStatus(mbx_id: SceUid, info: *mut SceKernelMbxInfo) -> i32;
+    pub fn sceKernelSetAlarm(
+        clock: u32,
+        handler: SceKernelAlarmHandler,
+        common: *mut c_void,
+    ) -> SceUid;
+    pub fn sceKernelSetSysClockAlarm(
+        clock: *mut SceKernelSysClock,
+        handler: *mut SceKernelAlarmHandler,
+        common: *mut c_void,
+    ) -> SceUid;
+    pub fn sceKernelCancelAlarm(alarm_id: SceUid) -> i32;
+    pub fn sceKernelReferAlarmStatus(alarm_id: SceUid, info: *mut SceKernelAlarmInfo) -> i32;
+    pub fn sceKernelCreateCallback(
+        name: *const u8,
+        func: SceKernelCallbackFunction,
+        arg: *mut c_void,
+    ) -> SceUid;
+    pub fn sceKernelReferCallbackStatus(cb: SceUid, status: *mut SceKernelCallbackInfo) -> i32;
+    pub fn sceKernelDeleteCallback(cb: SceUid) -> i32;
+    pub fn sceKernelNotifyCallback(cb: SceUid, arg2: i32) -> i32;
+    pub fn sceKernelCancelCallback(cb: SceUid) -> i32;
+    pub fn sceKernelGetCallbackCount(cb: SceUid) -> i32;
+    pub fn sceKernelCheckCallback() -> i32;
+    pub fn sceKernelGetThreadmanIdList(
+        type_: SceKernelIdListType,
+        read_buf: *mut SceUid,
+        read_buf_size: i32,
+        id_count: *mut i32,
+    ) -> i32;
+    pub fn sceKernelReferSystemStatus(status: *mut SceKernelSystemStatus) -> i32;
+    pub fn sceKernelCreateMsgPipe(
+        name: *const u8,
+        part: i32,
+        attr: i32,
+        unk1: *mut c_void,
+        opt: *mut c_void,
+    ) -> SceUid;
+    pub fn sceKernelDeleteMsgPipe(uid: SceUid) -> i32;
+    pub fn sceKernelSendMsgPipe(
+        uid: SceUid,
+        message: *mut c_void,
+        size: u32,
+        unk1: i32,
+        unk2: *mut c_void,
+        timeout: *mut u32,
+    ) -> i32;
+    pub fn sceKernelSendMsgPipeCB(
+        uid: SceUid,
+        message: *mut c_void,
+        size: u32,
+        unk1: i32,
+        unk2: *mut c_void,
+        timeout: *mut u32,
+    ) -> i32;
+    pub fn sceKernelTrySendMsgPipe(
+        uid: SceUid,
+        message: *mut c_void,
+        size: u32,
+        unk1: i32,
+        unk2: *mut c_void,
+    ) -> i32;
+    pub fn sceKernelReceiveMsgPipe(
+        uid: SceUid,
+        message: *mut c_void,
+        size: u32,
+        unk1: i32,
+        unk2: *mut c_void,
+        timeout: *mut u32,
+    ) -> i32;
+    pub fn sceKernelReceiveMsgPipeCB(
+        uid: SceUid,
+        message: *mut c_void,
+        size: u32,
+        unk1: i32,
+        unk2: *mut c_void,
+        timeout: *mut u32,
+    ) -> i32;
+    pub fn sceKernelTryReceiveMsgPipe(
+        uid: SceUid,
+        message: *mut c_void,
+        size: u32,
+        unk1: i32,
+        unk2: *mut c_void,
+    ) -> i32;
+    pub fn sceKernelCancelMsgPipe(uid: SceUid, send: *mut i32, recv: *mut i32) -> i32;
+    pub fn sceKernelReferMsgPipeStatus(uid: SceUid, info: *mut SceKernelMppInfo) -> i32;
+    pub fn sceKernelCreateVpl(
+        name: *const u8,
+        part: i32,
+        attr: i32,
+        size: u32,
+        opt: *mut SceKernelVplOptParam,
+    ) -> SceUid;
+    pub fn sceKernelDeleteVpl(uid: SceUid) -> i32;
+    pub fn sceKernelAllocateVpl(
+        uid: SceUid,
+        size: u32,
+        data: *mut *mut c_void,
+        timeout: *mut u32,
+    ) -> i32;
+    pub fn sceKernelAllocateVplCB(
+        uid: SceUid,
+        size: u32,
+        data: *mut *mut c_void,
+        timeout: *mut u32,
+    ) -> i32;
+    pub fn sceKernelTryAllocateVpl(uid: SceUid, size: u32, data: *mut *mut c_void) -> i32;
+    pub fn sceKernelFreeVpl(uid: SceUid, data: *mut c_void) -> i32;
+    pub fn sceKernelCancelVpl(uid: SceUid, num: *mut i32) -> i32;
+    pub fn sceKernelReferVplStatus(uid: SceUid, info: *mut SceKernelVplInfo) -> i32;
+    pub fn sceKernelCreateFpl(
+        name: *const u8,
+        part: i32,
+        attr: i32,
+        size: u32,
+        blocks: u32,
+        opt: *mut SceKernelFplOptParam,
+    ) -> i32;
+    pub fn sceKernelDeleteFpl(uid: SceUid) -> i32;
+    pub fn sceKernelAllocateFpl(uid: SceUid, data: *mut *mut c_void, timeout: *mut u32) -> i32;
+    pub fn sceKernelAllocateFplCB(uid: SceUid, data: *mut *mut c_void, timeout: *mut u32) -> i32;
+    pub fn sceKernelTryAllocateFpl(uid: SceUid, data: *mut *mut c_void) -> i32;
+    pub fn sceKernelFreeFpl(uid: SceUid, data: *mut c_void) -> i32;
+    pub fn sceKernelCancelFpl(uid: SceUid, pnum: *mut i32) -> i32;
+    pub fn sceKernelReferFplStatus(uid: SceUid, info: *mut SceKernelFplInfo) -> i32;
+    pub fn sceKernelUSec2SysClock(usec: u32, clock: *mut SceKernelSysClock) -> i32;
+    pub fn sceKernelUSec2SysClockWide(usec: u32) -> i64;
+    pub fn sceKernelSysClock2USec(
+        clock: *mut SceKernelSysClock,
+        low: *mut u32,
+        high: *mut u32,
+    ) -> i32;
+    pub fn sceKernelSysClock2USecWide(clock: i64, low: *mut u32, high: *mut u32) -> i32;
+    pub fn sceKernelGetSystemTime(time: *mut SceKernelSysClock) -> i32;
+    pub fn sceKernelGetSystemTimeWide() -> i64;
+    pub fn sceKernelGetSystemTimeLow() -> u32;
+    pub fn sceKernelCreateVTimer(name: *const u8, opt: *mut SceKernelVTimerOptParam) -> SceUid;
+    pub fn sceKernelDeleteVTimer(uid: SceUid) -> i32;
+    pub fn sceKernelGetVTimerBase(uid: SceUid, base: *mut SceKernelSysClock) -> i32;
+    pub fn sceKernelGetVTimerBaseWide(uid: SceUid) -> i64;
+    pub fn sceKernelGetVTimerTime(uid: SceUid, time: *mut SceKernelSysClock) -> i32;
+    pub fn sceKernelGetVTimerTimeWide(uid: SceUid) -> i64;
+    pub fn sceKernelSetVTimerTime(uid: SceUid, time: *mut SceKernelSysClock) -> i32;
+    pub fn sceKernelSetVTimerTimeWide(uid: SceUid, time: i64) -> i64;
+    pub fn sceKernelStartVTimer(uid: SceUid) -> i32;
+    pub fn sceKernelStopVTimer(uid: SceUid) -> i32;
+    pub fn sceKernelSetVTimerHandler(
+        uid: SceUid,
+        time: *mut SceKernelSysClock,
+        handler: SceKernelVTimerHandler,
+        common: *mut c_void,
+    ) -> i32;
+    pub fn sceKernelSetVTimerHandlerWide(
+        uid: SceUid,
+        time: i64,
+        handler: SceKernelVTimerHandlerWide,
+        common: *mut c_void,
+    ) -> i32;
+    pub fn sceKernelCancelVTimerHandler(uid: SceUid) -> i32;
+    pub fn sceKernelReferVTimerStatus(uid: SceUid, info: *mut SceKernelVTimerInfo) -> i32;
+    pub fn sceKernelRegisterThreadEventHandler(
+        name: *const u8,
+        thread_id: SceUid,
+        mask: i32,
+        handler: SceKernelThreadEventHandler,
+        common: *mut c_void,
+    ) -> SceUid;
+    pub fn sceKernelReleaseThreadEventHandler(uid: SceUid) -> i32;
+    pub fn sceKernelReferThreadEventHandlerStatus(
+        uid: SceUid,
+        info: *mut SceKernelThreadEventHandlerInfo,
+    ) -> i32;
+    pub fn sceKernelReferThreadProfiler() -> *mut DebugProfilerRegs;
+    pub fn sceKernelReferGlobalProfiler() -> *mut DebugProfilerRegs;
+
+    pub fn sceUsbStart(driver_name: *const u8, size: i32, args: *mut c_void) -> i32;
+    pub fn sceUsbStop(driver_name: *const u8, size: i32, args: *mut c_void) -> i32;
+    pub fn sceUsbActivate(pid: u32) -> i32;
+    pub fn sceUsbDeactivate(pid: u32) -> i32;
+    pub fn sceUsbGetState() -> i32;
+    pub fn sceUsbGetDrvState(driver_name: *const u8) -> i32;
+}
+
+extern "C" {
+    pub fn sceUsbCamSetupStill(param: *mut UsbCamSetupStillParam) -> i32;
+    pub fn sceUsbCamSetupStillEx(param: *mut UsbCamSetupStillExParam) -> i32;
+    pub fn sceUsbCamStillInputBlocking(buf: *mut u8, size: usize) -> i32;
+    pub fn sceUsbCamStillInput(buf: *mut u8, size: usize) -> i32;
+    pub fn sceUsbCamStillWaitInputEnd() -> i32;
+    pub fn sceUsbCamStillPollInputEnd() -> i32;
+    pub fn sceUsbCamStillCancelInput() -> i32;
+    pub fn sceUsbCamStillGetInputLength() -> i32;
+    pub fn sceUsbCamSetupVideo(
+        param: *mut UsbCamSetupVideoParam,
+        work_area: *mut c_void,
+        work_area_size: i32,
+    ) -> i32;
+    pub fn sceUsbCamSetupVideoEx(
+        param: *mut UsbCamSetupVideoExParam,
+        work_area: *mut c_void,
+        work_area_size: i32,
+    ) -> i32;
+    pub fn sceUsbCamStartVideo() -> i32;
+    pub fn sceUsbCamStopVideo() -> i32;
+    pub fn sceUsbCamReadVideoFrameBlocking(buf: *mut u8, size: usize) -> i32;
+    pub fn sceUsbCamReadVideoFrame(buf: *mut u8, size: usize) -> i32;
+    pub fn sceUsbCamWaitReadVideoFrameEnd() -> i32;
+    pub fn sceUsbCamPollReadVideoFrameEnd() -> i32;
+    pub fn sceUsbCamGetReadVideoFrameSize() -> i32;
+    pub fn sceUsbCamSetSaturation(saturation: i32) -> i32;
+    pub fn sceUsbCamSetBrightness(brightness: i32) -> i32;
+    pub fn sceUsbCamSetContrast(contrast: i32) -> i32;
+    pub fn sceUsbCamSetSharpness(sharpness: i32) -> i32;
+    pub fn sceUsbCamSetImageEffectMode(effect_mode: UsbCamEffectMode) -> i32;
+    pub fn sceUsbCamSetEvLevel(exposure_level: UsbCamEvLevel) -> i32;
+    pub fn sceUsbCamSetReverseMode(reverse_flags: i32) -> i32;
+    pub fn sceUsbCamSetZoom(zoom: i32) -> i32;
+    pub fn sceUsbCamGetSaturation(saturation: *mut i32) -> i32;
+    pub fn sceUsbCamGetBrightness(brightness: *mut i32) -> i32;
+    pub fn sceUsbCamGetContrast(contrast: *mut i32) -> i32;
+    pub fn sceUsbCamGetSharpness(sharpness: *mut i32) -> i32;
+    pub fn sceUsbCamGetImageEffectMode(effect_mode: *mut UsbCamEffectMode) -> i32;
+    pub fn sceUsbCamGetEvLevel(exposure_level: *mut UsbCamEvLevel) -> i32;
+    pub fn sceUsbCamGetReverseMode(reverse_flags: *mut i32) -> i32;
+    pub fn sceUsbCamGetZoom(zoom: *mut i32) -> i32;
+    pub fn sceUsbCamAutoImageReverseSW(on: i32) -> i32;
+    pub fn sceUsbCamGetAutoImageReverseState() -> i32;
+    pub fn sceUsbCamGetLensDirection() -> i32;
+
+    pub fn sceUsbstorBootRegisterNotify(event_flag: SceUid) -> i32;
+    pub fn sceUsbstorBootUnregisterNotify(event_flag: u32) -> i32;
+    pub fn sceUsbstorBootSetCapacity(size: u32) -> i32;
+
+    pub fn scePowerRegisterCallback(slot: i32, cbid: SceUid) -> i32;
+    pub fn scePowerUnregisterCallback(slot: i32) -> i32;
+    pub fn scePowerIsPowerOnline() -> i32;
+    pub fn scePowerIsBatteryExist() -> i32;
+    pub fn scePowerIsBatteryCharging() -> i32;
+    pub fn scePowerGetBatteryChargingStatus() -> i32;
+    pub fn scePowerIsLowBattery() -> i32;
+    pub fn scePowerGetBatteryLifePercent() -> i32;
+    pub fn scePowerGetBatteryLifeTime() -> i32;
+    pub fn scePowerGetBatteryTemp() -> i32;
+    pub fn scePowerGetBatteryElec() -> i32;
+    pub fn scePowerGetBatteryVolt() -> i32;
+    pub fn scePowerSetCpuClockFrequency(cpufreq: i32) -> i32;
+    pub fn scePowerSetBusClockFrequency(busfreq: i32) -> i32;
+    pub fn scePowerGetCpuClockFrequency() -> i32;
+    pub fn scePowerGetCpuClockFrequencyInt() -> i32;
+    pub fn scePowerGetCpuClockFrequencyFloat() -> f32;
+    pub fn scePowerGetBusClockFrequency() -> i32;
+    pub fn scePowerGetBusClockFrequencyInt() -> i32;
+    pub fn scePowerGetBusClockFrequencyFloat() -> f32;
+    pub fn scePowerSetClockFrequency(pllfreq: i32, cpufreq: i32, busfreq: i32) -> i32;
+    pub fn scePowerLock(unknown: i32) -> i32;
+    pub fn scePowerUnlock(unknown: i32) -> i32;
+    pub fn scePowerTick(t: PowerTick) -> i32;
+    pub fn scePowerGetIdleTimer() -> i32;
+    pub fn scePowerIdleTimerEnable(unknown: i32) -> i32;
+    pub fn scePowerIdleTimerDisable(unknown: i32) -> i32;
+    pub fn scePowerRequestStandby() -> i32;
+    pub fn scePowerRequestSuspend() -> i32;
+
+    pub fn sceWlanDevIsPowerOn() -> i32;
+    pub fn sceWlanGetSwitchState() -> i32;
+    pub fn sceWlanGetEtherAddr(ether_addr: *mut u8) -> i32;
+
+    pub fn sceWlanDevAttach() -> i32;
+    pub fn sceWlanDevDetach() -> i32;
+
+    pub fn sceRtcGetTickResolution() -> u32;
+    pub fn sceRtcGetCurrentTick(tick: *mut u64) -> i32;
+    pub fn sceRtcGetCurrentClock(tm: *mut ScePspDateTime, tz: i32) -> i32;
+    pub fn sceRtcGetCurrentClockLocalTime(tm: *mut ScePspDateTime) -> i32;
+    pub fn sceRtcConvertUtcToLocalTime(tick_utc: *const u64, tick_local: *mut u64) -> i32;
+    pub fn sceRtcConvertLocalTimeToUTC(tick_local: *const u64, tick_utc: *mut u64) -> i32;
+    pub fn sceRtcIsLeapYear(year: i32) -> i32;
+    pub fn sceRtcGetDaysInMonth(year: i32, month: i32) -> i32;
+    pub fn sceRtcGetDayOfWeek(year: i32, month: i32, day: i32) -> i32;
+    pub fn sceRtcCheckValid(date: *const ScePspDateTime) -> i32;
+    pub fn sceRtcSetTick(date: *mut ScePspDateTime, tick: *const u64) -> i32;
+    pub fn sceRtcGetTick(date: *const ScePspDateTime, tick: *mut u64) -> i32;
+    pub fn sceRtcCompareTick(tick1: *const u64, tick2: *const u64) -> i32;
+    pub fn sceRtcTickAddTicks(dest_tick: *mut u64, src_tick: *const u64, num_ticks: u64) -> i32;
+    pub fn sceRtcTickAddMicroseconds(dest_tick: *mut u64, src_tick: *const u64, num_ms: u64)
+        -> i32;
+    pub fn sceRtcTickAddSeconds(dest_tick: *mut u64, src_tick: *const u64, num_seconds: u64)
+        -> i32;
+    pub fn sceRtcTickAddMinutes(dest_tick: *mut u64, src_tick: *const u64, num_minutes: u64)
+        -> i32;
+    pub fn sceRtcTickAddHours(dest_tick: *mut u64, src_tick: *const u64, num_hours: u64) -> i32;
+    pub fn sceRtcTickAddDays(dest_tick: *mut u64, src_tick: *const u64, num_days: u64) -> i32;
+    pub fn sceRtcTickAddWeeks(dest_tick: *mut u64, src_tick: *const u64, num_weeks: u64) -> i32;
+    pub fn sceRtcTickAddMonths(dest_tick: *mut u64, src_tick: *const u64, num_months: u64) -> i32;
+    pub fn sceRtcTickAddYears(dest_tick: *mut u64, src_tick: *const u64, num_years: u64) -> i32;
+    pub fn sceRtcSetTime_t(date: *mut ScePspDateTime, time: u32) -> i32;
+    pub fn sceRtcGetTime_t(date: *const ScePspDateTime, time: *mut u32) -> i32;
+    pub fn sceRtcSetTime64_t(date: *mut ScePspDateTime, time: u64) -> i32;
+    pub fn sceRtcGetTime64_t(date: *const ScePspDateTime, time: *mut u64) -> i32;
+    pub fn sceRtcSetDosTime(date: *mut ScePspDateTime, dos_time: u32) -> i32;
+    pub fn sceRtcGetDosTime(date: *mut ScePspDateTime, dos_time: u32) -> i32;
+    pub fn sceRtcSetWin32FileTime(date: *mut ScePspDateTime, time: *mut u64) -> i32;
+    pub fn sceRtcGetWin32FileTime(date: *mut ScePspDateTime, time: *mut u64) -> i32;
+    pub fn sceRtcParseDateTime(dest_tick: *mut u64, date_string: *const u8) -> i32;
+    pub fn sceRtcFormatRFC3339(
+        psz_date_time: *mut char,
+        p_utc: *const u64,
+        time_zone_minutes: i32,
+    ) -> i32;
+    pub fn sceRtcFormatRFC3339LocalTime(psz_date_time: *mut char, p_utc: *const u64) -> i32;
+    pub fn sceRtcParseRFC3339(p_utc: *mut u64, psz_date_time: *const u8) -> i32;
+    pub fn sceRtcFormatRFC2822(
+        psz_date_time: *mut char,
+        p_utc: *const u64,
+        time_zone_minutes: i32,
+    ) -> i32;
+    pub fn sceRtcFormatRFC2822LocalTime(psz_date_time: *mut char, p_utc: *const u64) -> i32;
+
+    pub fn sceIoOpen(file: *const u8, flags: i32, permissions: IoPermissions) -> SceUid;
+    pub fn sceIoOpenAsync(file: *const u8, flags: i32, permissions: IoPermissions) -> SceUid;
+    pub fn sceIoClose(fd: SceUid) -> i32;
+    pub fn sceIoCloseAsync(fd: SceUid) -> i32;
+    pub fn sceIoRead(fd: SceUid, data: *mut c_void, size: u32) -> i32;
+    pub fn sceIoReadAsync(fd: SceUid, data: *mut c_void, size: u32) -> i32;
+    pub fn sceIoWrite(fd: SceUid, data: *const c_void, size: usize) -> i32;
+    pub fn sceIoWriteAsync(fd: SceUid, data: *const c_void, size: u32) -> i32;
+    pub fn sceIoLseek(fd: SceUid, offset: i64, whence: IoWhence) -> i64;
+    pub fn sceIoLseekAsync(fd: SceUid, offset: i64, whence: IoWhence) -> i32;
+    pub fn sceIoLseek32(fd: SceUid, offset: i32, whence: IoWhence) -> i32;
+    pub fn sceIoLseek32Async(fd: SceUid, offset: i32, whence: IoWhence) -> i32;
+    pub fn sceIoRemove(file: *const u8) -> i32;
+    pub fn sceIoMkdir(dir: *const u8, mode: IoPermissions) -> i32;
+    pub fn sceIoRmdir(path: *const u8) -> i32;
+    pub fn sceIoChdir(path: *const u8) -> i32;
+    pub fn sceIoRename(oldname: *const u8, newname: *const u8) -> i32;
+    pub fn sceIoDopen(dirname: *const u8) -> SceUid;
+    pub fn sceIoDread(fd: SceUid, dir: *mut SceIoDirent) -> i32;
+    pub fn sceIoDclose(fd: SceUid) -> i32;
+    pub fn sceIoDevctl(
+        dev: *const u8,
+        cmd: u32,
+        indata: *mut c_void,
+        inlen: i32,
+        outdata: *mut c_void,
+        outlen: i32,
+    ) -> i32;
+    pub fn sceIoAssign(
+        dev1: *const u8,
+        dev2: *const u8,
+        dev3: *const u8,
+        mode: IoAssignPerms,
+        unk1: *mut c_void,
+        unk2: i32,
+    ) -> i32;
+    pub fn sceIoUnassign(dev: *const u8) -> i32;
+    pub fn sceIoGetstat(file: *const u8, stat: *mut SceIoStat) -> i32;
+    pub fn sceIoChstat(file: *const u8, stat: *mut SceIoStat, bits: i32) -> i32;
+    pub fn sceIoIoctl(
+        fd: SceUid,
+        cmd: u32,
+        indata: *mut c_void,
+        inlen: i32,
+        outdata: *mut c_void,
+        outlen: i32,
+    ) -> i32;
+    pub fn sceIoIoctlAsync(
+        fd: SceUid,
+        cmd: u32,
+        indata: *mut c_void,
+        inlen: i32,
+        outdata: *mut c_void,
+        outlen: i32,
+    ) -> i32;
+    pub fn sceIoSync(device: *const u8, unk: u32) -> i32;
+    pub fn sceIoWaitAsync(fd: SceUid, res: *mut i64) -> i32;
+    pub fn sceIoWaitAsyncCB(fd: SceUid, res: *mut i64) -> i32;
+    pub fn sceIoPollAsync(fd: SceUid, res: *mut i64) -> i32;
+    pub fn sceIoGetAsyncStat(fd: SceUid, poll: i32, res: *mut i64) -> i32;
+    pub fn sceIoCancel(fd: SceUid) -> i32;
+    pub fn sceIoGetDevType(fd: SceUid) -> i32;
+    pub fn sceIoChangeAsyncPriority(fd: SceUid, pri: i32) -> i32;
+    pub fn sceIoSetAsyncCallback(fd: SceUid, cb: SceUid, argp: *mut c_void) -> i32;
+
+    pub fn sceJpegInitMJpeg() -> i32;
+    pub fn sceJpegFinishMJpeg() -> i32;
+    pub fn sceJpegCreateMJpeg(width: i32, height: i32) -> i32;
+    pub fn sceJpegDeleteMJpeg() -> i32;
+    pub fn sceJpegDecodeMJpeg(jpeg_buf: *mut u8, size: usize, rgba: *mut c_void, unk: u32) -> i32;
+
+    pub fn sceUmdCheckMedium() -> i32;
+    pub fn sceUmdGetDiscInfo(info: *mut UmdInfo) -> i32;
+    pub fn sceUmdActivate(unit: i32, drive: *const u8) -> i32;
+    pub fn sceUmdDeactivate(unit: i32, drive: *const u8) -> i32;
+    pub fn sceUmdWaitDriveStat(state: i32) -> i32;
+    pub fn sceUmdWaitDriveStatWithTimer(state: i32, timeout: u32) -> i32;
+    pub fn sceUmdWaitDriveStatCB(state: i32, timeout: u32) -> i32;
+    pub fn sceUmdCancelWaitDriveStat() -> i32;
+    pub fn sceUmdGetDriveStat() -> i32;
+    pub fn sceUmdGetErrorStat() -> i32;
+    pub fn sceUmdRegisterUMDCallBack(cbid: i32) -> i32;
+    pub fn sceUmdUnRegisterUMDCallBack(cbid: i32) -> i32;
+    pub fn sceUmdReplacePermit() -> i32;
+    pub fn sceUmdReplaceProhibit() -> i32;
+
+    pub fn sceMpegInit() -> i32;
+    pub fn sceMpegFinish();
+    pub fn sceMpegRingbufferQueryMemSize(packets: i32) -> i32;
+    pub fn sceMpegRingbufferConstruct(
+        ringbuffer: *mut SceMpegRingbuffer,
+        packets: i32,
+        data: *mut c_void,
+        size: i32,
+        callback: SceMpegRingbufferCb,
+        cb_param: *mut c_void,
+    ) -> i32;
+    pub fn sceMpegRingbufferDestruct(ringbuffer: *mut SceMpegRingbuffer);
+    pub fn sceMpegRingbufferAvailableSize(ringbuffer: *mut SceMpegRingbuffer) -> i32;
+    pub fn sceMpegRingbufferPut(
+        ringbuffer: *mut SceMpegRingbuffer,
+        num_packets: i32,
+        available: i32,
+    ) -> i32;
+    pub fn sceMpegQueryMemSize(unk: i32) -> i32;
+    pub fn sceMpegCreate(
+        handle: SceMpeg,
+        data: *mut c_void,
+        size: i32,
+        ringbuffer: *mut SceMpegRingbuffer,
+        frame_width: i32,
+        unk1: i32,
+        unk2: i32,
+    ) -> i32;
+    pub fn sceMpegDelete(handle: SceMpeg);
+    pub fn sceMpegQueryStreamOffset(handle: SceMpeg, buffer: *mut c_void, offset: *mut i32) -> i32;
+    pub fn sceMpegQueryStreamSize(buffer: *mut c_void, size: *mut i32) -> i32;
+    pub fn sceMpegRegistStream(handle: SceMpeg, stream_id: i32, unk: i32) -> SceMpegStream;
+    pub fn sceMpegUnRegistStream(handle: SceMpeg, stream: SceMpegStream);
+    pub fn sceMpegFlushAllStream(handle: SceMpeg) -> i32;
+    pub fn sceMpegMallocAvcEsBuf(handle: SceMpeg) -> *mut c_void;
+    pub fn sceMpegFreeAvcEsBuf(handle: SceMpeg, buf: *mut c_void);
+    pub fn sceMpegQueryAtracEsSize(handle: SceMpeg, es_size: *mut i32, out_size: *mut i32) -> i32;
+    pub fn sceMpegInitAu(handle: SceMpeg, es_buffer: *mut c_void, au: *mut SceMpegAu) -> i32;
+    pub fn sceMpegGetAvcAu(
+        handle: SceMpeg,
+        stream: SceMpegStream,
+        au: *mut SceMpegAu,
+        unk: *mut i32,
+    ) -> i32;
+    pub fn sceMpegAvcDecodeMode(handle: SceMpeg, mode: *mut SceMpegAvcMode) -> i32;
+    pub fn sceMpegAvcDecode(
+        handle: SceMpeg,
+        au: *mut SceMpegAu,
+        iframe_width: i32,
+        buffer: *mut c_void,
+        init: *mut i32,
+    ) -> i32;
+    pub fn sceMpegAvcDecodeStop(
+        handle: SceMpeg,
+        frame_width: i32,
+        buffer: *mut c_void,
+        status: *mut i32,
+    ) -> i32;
+    pub fn sceMpegGetAtracAu(
+        handle: SceMpeg,
+        stream: SceMpegStream,
+        au: *mut SceMpegAu,
+        unk: *mut c_void,
+    ) -> i32;
+    pub fn sceMpegAtracDecode(
+        handle: SceMpeg,
+        au: *mut SceMpegAu,
+        buffer: *mut c_void,
+        init: i32,
+    ) -> i32;
+
+    pub fn sceMpegBaseYCrCbCopyVme(yuv_buffer: *mut c_void, buffer: *mut i32, type_: i32) -> i32;
+    pub fn sceMpegBaseCscInit(width: i32) -> i32;
+    pub fn sceMpegBaseCscVme(
+        rgb_buffer: *mut c_void,
+        rgb_buffer2: *mut c_void,
+        width: i32,
+        y_cr_cb_buffer: *mut SceMpegYCrCbBuffer,
+    ) -> i32;
+    pub fn sceMpegbase_BEA18F91(lli: *mut SceMpegLLI) -> i32;
+
+    pub fn sceHprmPeekCurrentKey(key: *mut i32) -> i32;
+    pub fn sceHprmPeekLatch(latch: *mut [u32; 4]) -> i32;
+    pub fn sceHprmReadLatch(latch: *mut [u32; 4]) -> i32;
+    pub fn sceHprmIsHeadphoneExist() -> i32;
+    pub fn sceHprmIsRemoteExist() -> i32;
+    pub fn sceHprmIsMicrophoneExist() -> i32;
+
+    pub fn sceGuDepthBuffer(zbp: *mut c_void, zbw: i32);
+    pub fn sceGuDispBuffer(width: i32, height: i32, dispbp: *mut c_void, dispbw: i32);
+    pub fn sceGuDrawBuffer(psm: DisplayPixelFormat, fbp: *mut c_void, fbw: i32);
+    pub fn sceGuDrawBufferList(psm: DisplayPixelFormat, fbp: *mut c_void, fbw: i32);
+    pub fn sceGuDisplay(state: bool) -> bool;
+    pub fn sceGuDepthFunc(function: DepthFunc);
+    pub fn sceGuDepthMask(mask: i32);
+    pub fn sceGuDepthOffset(offset: i32);
+    pub fn sceGuDepthRange(near: i32, far: i32);
+    pub fn sceGuFog(near: f32, far: f32, color: u32);
+    pub fn sceGuInit();
+    pub fn sceGuTerm();
+    pub fn sceGuBreak(mode: i32);
+    pub fn sceGuContinue();
+    pub fn sceGuSetCallback(signal: GuCallbackId, callback: GuCallback) -> GuCallback;
+    pub fn sceGuSignal(behavior: SignalBehavior, signal: i32);
+    pub fn sceGuSendCommandf(cmd: GeCommand, argument: f32);
+    pub fn sceGuSendCommandi(cmd: GeCommand, argument: i32);
+    pub fn sceGuGetMemory(size: i32) -> *mut c_void;
+    pub fn sceGuStart(context_type: GuContextType, list: *mut c_void);
+    pub fn sceGuFinish() -> i32;
+    pub fn sceGuFinishId(id: u32) -> i32;
+    pub fn sceGuCallList(list: *const c_void);
+    pub fn sceGuCallMode(mode: i32);
+    pub fn sceGuCheckList() -> i32;
+    pub fn sceGuSendList(mode: GuQueueMode, list: *const c_void, context: *mut GeContext);
+    pub fn sceGuSwapBuffers() -> *mut c_void;
+    pub fn sceGuSync(mode: GuSyncMode, behavior: GuSyncBehavior) -> GeListState;
+    pub fn sceGuDrawArray(
+        prim: GuPrimitive,
+        vtype: i32,
+        count: i32,
+        indices: *const c_void,
+        vertices: *const c_void,
+    );
+    pub fn sceGuBeginObject(
+        vtype: i32,
+        count: i32,
+        indices: *const c_void,
+        vertices: *const c_void,
+    );
+    pub fn sceGuEndObject();
+    pub fn sceGuSetStatus(state: GuState, status: i32);
+    pub fn sceGuGetStatus(state: GuState) -> bool;
+    pub fn sceGuSetAllStatus(status: i32);
+    pub fn sceGuGetAllStatus() -> i32;
+    pub fn sceGuEnable(state: GuState);
+    pub fn sceGuDisable(state: GuState);
+    pub fn sceGuLight(light: i32, type_: LightType, components: i32, position: &ScePspFVector3);
+    pub fn sceGuLightAtt(light: i32, atten0: f32, atten1: f32, atten2: f32);
+    pub fn sceGuLightColor(light: i32, component: i32, color: u32);
+    pub fn sceGuLightMode(mode: LightMode);
+    pub fn sceGuLightSpot(light: i32, direction: &ScePspFVector3, exponent: f32, cutoff: f32);
+    pub fn sceGuClear(flags: i32);
+    pub fn sceGuClearColor(color: u32);
+    pub fn sceGuClearDepth(depth: u32);
+    pub fn sceGuClearStencil(stencil: u32);
+    pub fn sceGuPixelMask(mask: u32);
+    pub fn sceGuColor(color: u32);
+    pub fn sceGuColorFunc(func: ColorFunc, color: u32, mask: u32);
+    pub fn sceGuColorMaterial(components: i32);
+    pub fn sceGuAlphaFunc(func: AlphaFunc, value: i32, mask: i32);
+    pub fn sceGuAmbient(color: u32);
+    pub fn sceGuAmbientColor(color: u32);
+    pub fn sceGuBlendFunc(op: BlendOp, src: BlendSrc, dest: BlendDst, src_fix: u32, dest_fix: u32);
+    pub fn sceGuMaterial(components: i32, color: u32);
+    pub fn sceGuModelColor(emissive: u32, ambient: u32, diffuse: u32, specular: u32);
+    pub fn sceGuStencilFunc(func: StencilFunc, ref_: i32, mask: i32);
+    pub fn sceGuStencilOp(fail: StencilOperation, zfail: StencilOperation, zpass: StencilOperation);
+    pub fn sceGuSpecular(power: f32);
+    pub fn sceGuFrontFace(order: FrontFaceDirection);
+    pub fn sceGuLogicalOp(op: LogicalOperation);
+    pub fn sceGuSetDither(matrix: &ScePspIMatrix4);
+    pub fn sceGuShadeModel(mode: ShadingModel);
+    pub fn sceGuCopyImage(
+        psm: DisplayPixelFormat,
+        sx: i32,
+        sy: i32,
+        width: i32,
+        height: i32,
+        srcw: i32,
+        src: *mut c_void,
+        dx: i32,
+        dy: i32,
+        destw: i32,
+        dest: *mut c_void,
+    );
+    pub fn sceGuTexEnvColor(color: u32);
+    pub fn sceGuTexFilter(min: TextureFilter, mag: TextureFilter);
+    pub fn sceGuTexFlush();
+    pub fn sceGuTexFunc(tfx: TextureEffect, tcc: TextureColorComponent);
+    pub fn sceGuTexImage(
+        mipmap: MipmapLevel,
+        width: i32,
+        height: i32,
+        tbw: i32,
+        tbp: *const c_void,
+    );
+    pub fn sceGuTexLevelMode(mode: TextureLevelMode, bias: f32);
+    pub fn sceGuTexMapMode(mode: TextureMapMode, a1: u32, a2: u32);
+    pub fn sceGuTexMode(tpsm: TexturePixelFormat, maxmips: i32, a2: i32, swizzle: i32);
+    pub fn sceGuTexOffset(u: f32, v: f32);
+    pub fn sceGuTexProjMapMode(mode: TextureProjectionMapMode);
+    pub fn sceGuTexScale(u: f32, v: f32);
+    pub fn sceGuTexSlope(slope: f32);
+    pub fn sceGuTexSync();
+    pub fn sceGuTexWrap(u: GuTexWrapMode, v: GuTexWrapMode);
+    pub fn sceGuClutLoad(num_blocks: i32, cbp: *const c_void);
+    pub fn sceGuClutMode(cpsm: ClutPixelFormat, shift: u32, mask: u32, a3: u32);
+    pub fn sceGuOffset(x: u32, y: u32);
+    pub fn sceGuScissor(x: i32, y: i32, w: i32, h: i32);
+    pub fn sceGuViewport(cx: i32, cy: i32, width: i32, height: i32);
+    pub fn sceGuDrawBezier(
+        v_type: i32,
+        u_count: i32,
+        v_count: i32,
+        indices: *const c_void,
+        vertices: *const c_void,
+    );
+    pub fn sceGuPatchDivide(ulevel: u32, vlevel: u32);
+    pub fn sceGuPatchFrontFace(a0: u32);
+    pub fn sceGuPatchPrim(prim: PatchPrimitive);
+    pub fn sceGuDrawSpline(
+        v_type: i32,
+        u_count: i32,
+        v_count: i32,
+        u_edge: i32,
+        v_edge: i32,
+        indices: *const c_void,
+        vertices: *const c_void,
+    );
+    pub fn sceGuSetMatrix(type_: MatrixMode, matrix: &ScePspFMatrix4);
+    pub fn sceGuBoneMatrix(index: u32, matrix: &ScePspFMatrix4);
+    pub fn sceGuMorphWeight(index: i32, weight: f32);
+    pub fn sceGuDrawArrayN(
+        primitive_type: GuPrimitive,
+        v_type: i32,
+        count: i32,
+        a3: i32,
+        indices: *const c_void,
+        vertices: *const c_void,
+    );
+
+    pub fn sceGumDrawArray(
+        prim: GuPrimitive,
+        v_type: i32,
+        count: i32,
+        indices: *const c_void,
+        vertices: *const c_void,
+    );
+    pub fn sceGumDrawArrayN(
+        prim: GuPrimitive,
+        v_type: i32,
+        count: i32,
+        a3: i32,
+        indices: *const c_void,
+        vertices: *const c_void,
+    );
+    pub fn sceGumDrawBezier(
+        v_type: i32,
+        u_count: i32,
+        v_count: i32,
+        indices: *const c_void,
+        vertices: *const c_void,
+    );
+    pub fn sceGumDrawSpline(
+        v_type: i32,
+        u_count: i32,
+        v_count: i32,
+        u_edge: i32,
+        v_edge: i32,
+        indices: *const c_void,
+        vertices: *const c_void,
+    );
+    pub fn sceGumFastInverse();
+    pub fn sceGumFullInverse();
+    pub fn sceGumLoadIdentity();
+    pub fn sceGumLoadMatrix(m: &ScePspFMatrix4);
+    pub fn sceGumLookAt(eye: &ScePspFVector3, center: &ScePspFVector3, up: &ScePspFVector3);
+    pub fn sceGumMatrixMode(mode: MatrixMode);
+    pub fn sceGumMultMatrix(m: &ScePspFMatrix4);
+    pub fn sceGumOrtho(left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32);
+    pub fn sceGumPerspective(fovy: f32, aspect: f32, near: f32, far: f32);
+    pub fn sceGumPopMatrix();
+    pub fn sceGumPushMatrix();
+    pub fn sceGumRotateX(angle: f32);
+    pub fn sceGumRotateY(angle: f32);
+    pub fn sceGumRotateZ(angle: f32);
+    pub fn sceGumRotateXYZ(v: &ScePspFVector3);
+    pub fn sceGumRotateZYX(v: &ScePspFVector3);
+    pub fn sceGumScale(v: &ScePspFVector3);
+    pub fn sceGumStoreMatrix(m: &mut ScePspFMatrix4);
+    pub fn sceGumTranslate(v: &ScePspFVector3);
+    pub fn sceGumUpdateMatrix();
+
+    pub fn sceMp3ReserveMp3Handle(args: *mut SceMp3InitArg) -> i32;
+    pub fn sceMp3ReleaseMp3Handle(handle: Mp3Handle) -> i32;
+    pub fn sceMp3InitResource() -> i32;
+    pub fn sceMp3TermResource() -> i32;
+    pub fn sceMp3Init(handle: Mp3Handle) -> i32;
+    pub fn sceMp3Decode(handle: Mp3Handle, dst: *mut *mut i16) -> i32;
+    pub fn sceMp3GetInfoToAddStreamData(
+        handle: Mp3Handle,
+        dst: *mut *mut u8,
+        to_write: *mut i32,
+        src_pos: *mut i32,
+    ) -> i32;
+    pub fn sceMp3NotifyAddStreamData(handle: Mp3Handle, size: i32) -> i32;
+    pub fn sceMp3CheckStreamDataNeeded(handle: Mp3Handle) -> i32;
+    pub fn sceMp3SetLoopNum(handle: Mp3Handle, loop_: i32) -> i32;
+    pub fn sceMp3GetLoopNum(handle: Mp3Handle) -> i32;
+    pub fn sceMp3GetSumDecodedSample(handle: Mp3Handle) -> i32;
+    pub fn sceMp3GetMaxOutputSample(handle: Mp3Handle) -> i32;
+    pub fn sceMp3GetSamplingRate(handle: Mp3Handle) -> i32;
+    pub fn sceMp3GetBitRate(handle: Mp3Handle) -> i32;
+    pub fn sceMp3GetMp3ChannelNum(handle: Mp3Handle) -> i32;
+    pub fn sceMp3ResetPlayPosition(handle: Mp3Handle) -> i32;
+
+    pub fn sceRegOpenRegistry(reg: *mut Key, mode: i32, handle: *mut RegHandle) -> i32;
+    pub fn sceRegFlushRegistry(handle: RegHandle) -> i32;
+    pub fn sceRegCloseRegistry(handle: RegHandle) -> i32;
+    pub fn sceRegOpenCategory(
+        handle: RegHandle,
+        name: *const u8,
+        mode: i32,
+        dir_handle: *mut RegHandle,
+    ) -> i32;
+    pub fn sceRegRemoveCategory(handle: RegHandle, name: *const u8) -> i32;
+    pub fn sceRegCloseCategory(dir_handle: RegHandle) -> i32;
+    pub fn sceRegFlushCategory(dir_handle: RegHandle) -> i32;
+    pub fn sceRegGetKeyInfo(
+        dir_handle: RegHandle,
+        name: *const u8,
+        key_handle: *mut RegHandle,
+        type_: *mut KeyType,
+        size: *mut usize,
+    ) -> i32;
+    pub fn sceRegGetKeyInfoByName(
+        dir_handle: RegHandle,
+        name: *const u8,
+        type_: *mut KeyType,
+        size: *mut usize,
+    ) -> i32;
+    pub fn sceRegGetKeyValue(
+        dir_handle: RegHandle,
+        key_handle: RegHandle,
+        buf: *mut c_void,
+        size: usize,
+    ) -> i32;
+    pub fn sceRegGetKeyValueByName(
+        dir_handle: RegHandle,
+        name: *const u8,
+        buf: *mut c_void,
+        size: usize,
+    ) -> i32;
+    pub fn sceRegSetKeyValue(
+        dir_handle: RegHandle,
+        name: *const u8,
+        buf: *const c_void,
+        size: usize,
+    ) -> i32;
+    pub fn sceRegGetKeysNum(dir_handle: RegHandle, num: *mut i32) -> i32;
+    pub fn sceRegGetKeys(dir_handle: RegHandle, buf: *mut u8, num: i32) -> i32;
+    pub fn sceRegCreateKey(dir_handle: RegHandle, name: *const u8, type_: i32, size: usize) -> i32;
+    pub fn sceRegRemoveRegistry(key: *mut Key) -> i32;
+
+    pub fn sceOpenPSIDGetOpenPSID(openpsid: *mut OpenPSID) -> i32;
+
+    pub fn sceUtilityMsgDialogInitStart(params: *mut UtilityMsgDialogParams) -> i32;
+    pub fn sceUtilityMsgDialogShutdownStart();
+    pub fn sceUtilityMsgDialogGetStatus() -> i32;
+    pub fn sceUtilityMsgDialogUpdate(n: i32);
+    pub fn sceUtilityMsgDialogAbort() -> i32;
+    pub fn sceUtilityNetconfInitStart(data: *mut UtilityNetconfData) -> i32;
+    pub fn sceUtilityNetconfShutdownStart() -> i32;
+    pub fn sceUtilityNetconfUpdate(unknown: i32) -> i32;
+    pub fn sceUtilityNetconfGetStatus() -> i32;
+    pub fn sceUtilityCheckNetParam(id: i32) -> i32;
+    pub fn sceUtilityGetNetParam(conf: i32, param: NetParam, data: *mut UtilityNetData) -> i32;
+    pub fn sceUtilitySavedataInitStart(params: *mut SceUtilitySavedataParam) -> i32;
+    pub fn sceUtilitySavedataGetStatus() -> i32;
+    pub fn sceUtilitySavedataShutdownStart() -> i32;
+    pub fn sceUtilitySavedataUpdate(unknown: i32);
+    pub fn sceUtilityGameSharingInitStart(params: *mut UtilityGameSharingParams) -> i32;
+    pub fn sceUtilityGameSharingShutdownStart();
+    pub fn sceUtilityGameSharingGetStatus() -> i32;
+    pub fn sceUtilityGameSharingUpdate(n: i32);
+    pub fn sceUtilityHtmlViewerInitStart(params: *mut UtilityHtmlViewerParam) -> i32;
+    pub fn sceUtilityHtmlViewerShutdownStart() -> i32;
+    pub fn sceUtilityHtmlViewerUpdate(n: i32) -> i32;
+    pub fn sceUtilityHtmlViewerGetStatus() -> i32;
+    pub fn sceUtilitySetSystemParamInt(id: SystemParamId, value: i32) -> i32;
+    pub fn sceUtilitySetSystemParamString(id: SystemParamId, str: *const u8) -> i32;
+    pub fn sceUtilityGetSystemParamInt(id: SystemParamId, value: *mut i32) -> i32;
+    pub fn sceUtilityGetSystemParamString(id: SystemParamId, str: *mut u8, len: i32) -> i32;
+    pub fn sceUtilityOskInitStart(params: *mut SceUtilityOskParams) -> i32;
+    pub fn sceUtilityOskShutdownStart() -> i32;
+    pub fn sceUtilityOskUpdate(n: i32) -> i32;
+    pub fn sceUtilityOskGetStatus() -> i32;
+    pub fn sceUtilityLoadNetModule(module: NetModule) -> i32;
+    pub fn sceUtilityUnloadNetModule(module: NetModule) -> i32;
+    pub fn sceUtilityLoadAvModule(module: AvModule) -> i32;
+    pub fn sceUtilityUnloadAvModule(module: AvModule) -> i32;
+    pub fn sceUtilityLoadUsbModule(module: UsbModule) -> i32;
+    pub fn sceUtilityUnloadUsbModule(module: UsbModule) -> i32;
+    pub fn sceUtilityLoadModule(module: Module) -> i32;
+    pub fn sceUtilityUnloadModule(module: Module) -> i32;
+    pub fn sceUtilityCreateNetParam(conf: i32) -> i32;
+    pub fn sceUtilitySetNetParam(param: NetParam, val: *const c_void) -> i32;
+    pub fn sceUtilityCopyNetParam(src: i32, dest: i32) -> i32;
+    pub fn sceUtilityDeleteNetParam(conf: i32) -> i32;
+
+    pub fn sceNetInit(
+        poolsize: i32,
+        calloutprio: i32,
+        calloutstack: i32,
+        netintrprio: i32,
+        netintrstack: i32,
+    ) -> i32;
+    pub fn sceNetTerm() -> i32;
+    pub fn sceNetFreeThreadinfo(thid: i32) -> i32;
+    pub fn sceNetThreadAbort(thid: i32) -> i32;
+    pub fn sceNetEtherStrton(name: *mut u8, mac: *mut u8);
+    pub fn sceNetEtherNtostr(mac: *mut u8, name: *mut u8);
+    pub fn sceNetGetLocalEtherAddr(mac: *mut u8) -> i32;
+    pub fn sceNetGetMallocStat(stat: *mut SceNetMallocStat) -> i32;
+
+    pub fn sceNetAdhocctlInit(
+        stacksize: i32,
+        priority: i32,
+        adhoc_id: *mut SceNetAdhocctlAdhocId,
+    ) -> i32;
+    pub fn sceNetAdhocctlTerm() -> i32;
+    pub fn sceNetAdhocctlConnect(name: *const u8) -> i32;
+    pub fn sceNetAdhocctlDisconnect() -> i32;
+    pub fn sceNetAdhocctlGetState(event: *mut i32) -> i32;
+    pub fn sceNetAdhocctlCreate(name: *const u8) -> i32;
+    pub fn sceNetAdhocctlJoin(scaninfo: *mut SceNetAdhocctlScanInfo) -> i32;
+    pub fn sceNetAdhocctlGetAdhocId(id: *mut SceNetAdhocctlAdhocId) -> i32;
+    pub fn sceNetAdhocctlCreateEnterGameMode(
+        name: *const u8,
+        unknown: i32,
+        num: i32,
+        macs: *mut u8,
+        timeout: u32,
+        unknown2: i32,
+    ) -> i32;
+    pub fn sceNetAdhocctlJoinEnterGameMode(
+        name: *const u8,
+        hostmac: *mut u8,
+        timeout: u32,
+        unknown: i32,
+    ) -> i32;
+    pub fn sceNetAdhocctlGetGameModeInfo(gamemodeinfo: *mut SceNetAdhocctlGameModeInfo) -> i32;
+    pub fn sceNetAdhocctlExitGameMode() -> i32;
+    pub fn sceNetAdhocctlGetPeerList(length: *mut i32, buf: *mut c_void) -> i32;
+    pub fn sceNetAdhocctlGetPeerInfo(
+        mac: *mut u8,
+        size: i32,
+        peerinfo: *mut SceNetAdhocctlPeerInfo,
+    ) -> i32;
+    pub fn sceNetAdhocctlScan() -> i32;
+    pub fn sceNetAdhocctlGetScanInfo(length: *mut i32, buf: *mut c_void) -> i32;
+    pub fn sceNetAdhocctlAddHandler(handler: SceNetAdhocctlHandler, unknown: *mut c_void) -> i32;
+    pub fn sceNetAdhocctlDelHandler(id: i32) -> i32;
+    pub fn sceNetAdhocctlGetNameByAddr(mac: *mut u8, nickname: *mut u8) -> i32;
+    pub fn sceNetAdhocctlGetAddrByName(
+        nickname: *mut u8,
+        length: *mut i32,
+        buf: *mut c_void,
+    ) -> i32;
+    pub fn sceNetAdhocctlGetParameter(params: *mut SceNetAdhocctlParams) -> i32;
+
+    pub fn sceNetAdhocInit() -> i32;
+    pub fn sceNetAdhocTerm() -> i32;
+    pub fn sceNetAdhocPdpCreate(mac: *mut u8, port: u16, buf_size: u32, unk1: i32) -> i32;
+    pub fn sceNetAdhocPdpDelete(id: i32, unk1: i32) -> i32;
+    pub fn sceNetAdhocPdpSend(
+        id: i32,
+        dest_mac_addr: *mut u8,
+        port: u16,
+        data: *mut c_void,
+        len: u32,
+        timeout: u32,
+        nonblock: i32,
+    ) -> i32;
+    pub fn sceNetAdhocPdpRecv(
+        id: i32,
+        src_mac_addr: *mut u8,
+        port: *mut u16,
+        data: *mut c_void,
+        data_length: *mut c_void,
+        timeout: u32,
+        nonblock: i32,
+    ) -> i32;
+    pub fn sceNetAdhocGetPdpStat(size: *mut i32, stat: *mut SceNetAdhocPdpStat) -> i32;
+    pub fn sceNetAdhocGameModeCreateMaster(data: *mut c_void, size: i32) -> i32;
+    pub fn sceNetAdhocGameModeCreateReplica(mac: *mut u8, data: *mut c_void, size: i32) -> i32;
+    pub fn sceNetAdhocGameModeUpdateMaster() -> i32;
+    pub fn sceNetAdhocGameModeUpdateReplica(id: i32, unk1: i32) -> i32;
+    pub fn sceNetAdhocGameModeDeleteMaster() -> i32;
+    pub fn sceNetAdhocGameModeDeleteReplica(id: i32) -> i32;
+    pub fn sceNetAdhocPtpOpen(
+        srcmac: *mut u8,
+        srcport: u16,
+        destmac: *mut u8,
+        destport: u16,
+        buf_size: u32,
+        delay: u32,
+        count: i32,
+        unk1: i32,
+    ) -> i32;
+    pub fn sceNetAdhocPtpConnect(id: i32, timeout: u32, nonblock: i32) -> i32;
+    pub fn sceNetAdhocPtpListen(
+        srcmac: *mut u8,
+        srcport: u16,
+        buf_size: u32,
+        delay: u32,
+        count: i32,
+        queue: i32,
+        unk1: i32,
+    ) -> i32;
+    pub fn sceNetAdhocPtpAccept(
+        id: i32,
+        mac: *mut u8,
+        port: *mut u16,
+        timeout: u32,
+        nonblock: i32,
+    ) -> i32;
+    pub fn sceNetAdhocPtpSend(
+        id: i32,
+        data: *mut c_void,
+        data_size: *mut i32,
+        timeout: u32,
+        nonblock: i32,
+    ) -> i32;
+    pub fn sceNetAdhocPtpRecv(
+        id: i32,
+        data: *mut c_void,
+        data_size: *mut i32,
+        timeout: u32,
+        nonblock: i32,
+    ) -> i32;
+    pub fn sceNetAdhocPtpFlush(id: i32, timeout: u32, nonblock: i32) -> i32;
+    pub fn sceNetAdhocPtpClose(id: i32, unk1: i32) -> i32;
+    pub fn sceNetAdhocGetPtpStat(size: *mut i32, stat: *mut SceNetAdhocPtpStat) -> i32;
+}
+
+extern "C" {
+    pub fn sceNetAdhocMatchingInit(memsize: i32) -> i32;
+    pub fn sceNetAdhocMatchingTerm() -> i32;
+    pub fn sceNetAdhocMatchingCreate(
+        mode: AdhocMatchingMode,
+        max_peers: i32,
+        port: u16,
+        buf_size: i32,
+        hello_delay: u32,
+        ping_delay: u32,
+        init_count: i32,
+        msg_delay: u32,
+        callback: AdhocMatchingCallback,
+    ) -> i32;
+    pub fn sceNetAdhocMatchingDelete(matching_id: i32) -> i32;
+    pub fn sceNetAdhocMatchingStart(
+        matching_id: i32,
+        evth_pri: i32,
+        evth_stack: i32,
+        inth_pri: i32,
+        inth_stack: i32,
+        opt_len: i32,
+        opt_data: *mut c_void,
+    ) -> i32;
+    pub fn sceNetAdhocMatchingStop(matching_id: i32) -> i32;
+    pub fn sceNetAdhocMatchingSelectTarget(
+        matching_id: i32,
+        mac: *mut u8,
+        opt_len: i32,
+        opt_data: *mut c_void,
+    ) -> i32;
+    pub fn sceNetAdhocMatchingCancelTarget(matching_id: i32, mac: *mut u8) -> i32;
+    pub fn sceNetAdhocMatchingCancelTargetWithOpt(
+        matching_id: i32,
+        mac: *mut u8,
+        opt_len: i32,
+        opt_data: *mut c_void,
+    ) -> i32;
+    pub fn sceNetAdhocMatchingSendData(
+        matching_id: i32,
+        mac: *mut u8,
+        data_len: i32,
+        data: *mut c_void,
+    ) -> i32;
+    pub fn sceNetAdhocMatchingAbortSendData(matching_id: i32, mac: *mut u8) -> i32;
+    pub fn sceNetAdhocMatchingSetHelloOpt(
+        matching_id: i32,
+        opt_len: i32,
+        opt_data: *mut c_void,
+    ) -> i32;
+    pub fn sceNetAdhocMatchingGetHelloOpt(
+        matching_id: i32,
+        opt_len: *mut i32,
+        opt_data: *mut c_void,
+    ) -> i32;
+    pub fn sceNetAdhocMatchingGetMembers(
+        matching_id: i32,
+        length: *mut i32,
+        buf: *mut c_void,
+    ) -> i32;
+    pub fn sceNetAdhocMatchingGetPoolMaxAlloc() -> i32;
+    pub fn sceNetAdhocMatchingGetPoolStat(poolstat: *mut AdhocPoolStat) -> i32;
+}
+
+extern "C" {
+    pub fn sceNetApctlInit(stack_size: i32, init_priority: i32) -> i32;
+    pub fn sceNetApctlTerm() -> i32;
+    pub fn sceNetApctlGetInfo(code: ApctlInfo, pinfo: *mut SceNetApctlInfo) -> i32;
+    pub fn sceNetApctlAddHandler(handler: SceNetApctlHandler, parg: *mut c_void) -> i32;
+    pub fn sceNetApctlDelHandler(handler_id: i32) -> i32;
+    pub fn sceNetApctlConnect(conn_index: i32) -> i32;
+    pub fn sceNetApctlDisconnect() -> i32;
+    pub fn sceNetApctlGetState(pstate: *mut ApctlState) -> i32;
+
+    pub fn sceNetInetInit() -> i32;
+    pub fn sceNetInetTerm() -> i32;
+    pub fn sceNetInetAccept(s: i32, addr: *mut sockaddr, addr_len: *mut socklen_t) -> i32;
+    pub fn sceNetInetBind(s: i32, my_addr: *const sockaddr, addr_len: socklen_t) -> i32;
+    pub fn sceNetInetConnect(s: i32, serv_addr: *const sockaddr, addr_len: socklen_t) -> i32;
+    pub fn sceNetInetGetsockopt(
+        s: i32,
+        level: i32,
+        opt_name: i32,
+        opt_val: *mut c_void,
+        optl_en: *mut socklen_t,
+    ) -> i32;
+    pub fn sceNetInetListen(s: i32, backlog: i32) -> i32;
+    pub fn sceNetInetRecv(s: i32, buf: *mut c_void, len: usize, flags: i32) -> usize;
+    pub fn sceNetInetRecvfrom(
+        s: i32,
+        buf: *mut c_void,
+        flags: usize,
+        arg1: i32,
+        from: *mut sockaddr,
+        from_len: *mut socklen_t,
+    ) -> usize;
+    pub fn sceNetInetSend(s: i32, buf: *const c_void, len: usize, flags: i32) -> usize;
+    pub fn sceNetInetSendto(
+        s: i32,
+        buf: *const c_void,
+        len: usize,
+        flags: i32,
+        to: *const sockaddr,
+        to_len: socklen_t,
+    ) -> usize;
+    pub fn sceNetInetSetsockopt(
+        s: i32,
+        level: i32,
+        opt_name: i32,
+        opt_val: *const c_void,
+        opt_len: socklen_t,
+    ) -> i32;
+    pub fn sceNetInetShutdown(s: i32, how: i32) -> i32;
+    pub fn sceNetInetSocket(domain: i32, type_: i32, protocol: i32) -> i32;
+    pub fn sceNetInetClose(s: i32) -> i32;
+    pub fn sceNetInetGetErrno() -> i32;
+
+    pub fn sceSslInit(unknown1: i32) -> i32;
+    pub fn sceSslEnd() -> i32;
+    pub fn sceSslGetUsedMemoryMax(memory: *mut u32) -> i32;
+    pub fn sceSslGetUsedMemoryCurrent(memory: *mut u32) -> i32;
+
+    pub fn sceHttpInit(unknown1: u32) -> i32;
+    pub fn sceHttpEnd() -> i32;
+    pub fn sceHttpCreateTemplate(agent: *mut u8, unknown1: i32, unknown2: i32) -> i32;
+    pub fn sceHttpDeleteTemplate(templateid: i32) -> i32;
+    pub fn sceHttpCreateConnection(
+        templateid: i32,
+        host: *mut u8,
+        unknown1: *mut u8,
+        port: u16,
+        unknown2: i32,
+    ) -> i32;
+    pub fn sceHttpCreateConnectionWithURL(templateid: i32, url: *const u8, unknown1: i32) -> i32;
+    pub fn sceHttpDeleteConnection(connection_id: i32) -> i32;
+    pub fn sceHttpCreateRequest(
+        connection_id: i32,
+        method: HttpMethod,
+        path: *mut u8,
+        content_length: u64,
+    ) -> i32;
+    pub fn sceHttpCreateRequestWithURL(
+        connection_id: i32,
+        method: HttpMethod,
+        url: *mut u8,
+        content_length: u64,
+    ) -> i32;
+    pub fn sceHttpDeleteRequest(request_id: i32) -> i32;
+    pub fn sceHttpSendRequest(request_id: i32, data: *mut c_void, data_size: u32) -> i32;
+    pub fn sceHttpAbortRequest(request_id: i32) -> i32;
+    pub fn sceHttpReadData(request_id: i32, data: *mut c_void, data_size: u32) -> i32;
+    pub fn sceHttpGetContentLength(request_id: i32, content_length: *mut u64) -> i32;
+    pub fn sceHttpGetStatusCode(request_id: i32, status_code: *mut i32) -> i32;
+    pub fn sceHttpSetResolveTimeOut(id: i32, timeout: u32) -> i32;
+    pub fn sceHttpSetResolveRetry(id: i32, count: i32) -> i32;
+    pub fn sceHttpSetConnectTimeOut(id: i32, timeout: u32) -> i32;
+    pub fn sceHttpSetSendTimeOut(id: i32, timeout: u32) -> i32;
+    pub fn sceHttpSetRecvTimeOut(id: i32, timeout: u32) -> i32;
+    pub fn sceHttpEnableKeepAlive(id: i32) -> i32;
+    pub fn sceHttpDisableKeepAlive(id: i32) -> i32;
+    pub fn sceHttpEnableRedirect(id: i32) -> i32;
+    pub fn sceHttpDisableRedirect(id: i32) -> i32;
+    pub fn sceHttpEnableCookie(id: i32) -> i32;
+    pub fn sceHttpDisableCookie(id: i32) -> i32;
+    pub fn sceHttpSaveSystemCookie() -> i32;
+    pub fn sceHttpLoadSystemCookie() -> i32;
+    pub fn sceHttpAddExtraHeader(id: i32, name: *mut u8, value: *mut u8, unknown1: i32) -> i32;
+    pub fn sceHttpDeleteHeader(id: i32, name: *const u8) -> i32;
+    pub fn sceHttpsInit(unknown1: i32, unknown2: i32, unknown3: i32, unknown4: i32) -> i32;
+    pub fn sceHttpsEnd() -> i32;
+    pub fn sceHttpsLoadDefaultCert(unknown1: i32, unknown2: i32) -> i32;
+    pub fn sceHttpDisableAuth(id: i32) -> i32;
+    pub fn sceHttpDisableCache(id: i32) -> i32;
+    pub fn sceHttpEnableAuth(id: i32) -> i32;
+    pub fn sceHttpEnableCache(id: i32) -> i32;
+    pub fn sceHttpEndCache() -> i32;
+    pub fn sceHttpGetAllHeader(request: i32, header: *mut *mut u8, header_size: *mut u32) -> i32;
+    pub fn sceHttpGetNetworkErrno(request: i32, err_num: *mut i32) -> i32;
+    pub fn sceHttpGetProxy(
+        id: i32,
+        activate_flag: *mut i32,
+        mode: *mut i32,
+        proxy_host: *mut u8,
+        len: usize,
+        proxy_port: *mut u16,
+    ) -> i32;
+    pub fn sceHttpInitCache(max_size: usize) -> i32;
+    pub fn sceHttpSetAuthInfoCB(id: i32, cbfunc: HttpPasswordCB) -> i32;
+    pub fn sceHttpSetProxy(
+        id: i32,
+        activate_flag: i32,
+        mode: i32,
+        new_proxy_host: *const u8,
+        new_proxy_port: u16,
+    ) -> i32;
+    pub fn sceHttpSetResHeaderMaxSize(id: i32, header_size: u32) -> i32;
+    pub fn sceHttpSetMallocFunction(
+        malloc_func: HttpMallocFunction,
+        free_func: HttpFreeFunction,
+        realloc_func: HttpReallocFunction,
+    ) -> i32;
+
+    pub fn sceNetResolverInit() -> i32;
+    pub fn sceNetResolverCreate(rid: *mut i32, buf: *mut c_void, buf_length: u32) -> i32;
+    pub fn sceNetResolverDelete(rid: i32) -> i32;
+    pub fn sceNetResolverStartNtoA(
+        rid: i32,
+        hostname: *const u8,
+        addr: *mut in_addr,
+        timeout: u32,
+        retry: i32,
+    ) -> i32;
+    pub fn sceNetResolverStartAtoN(
+        rid: i32,
+        addr: *const in_addr,
+        hostname: *mut u8,
+        hostname_len: u32,
+        timeout: u32,
+        retry: i32,
+    ) -> i32;
+    pub fn sceNetResolverStop(rid: i32) -> i32;
+    pub fn sceNetResolverTerm() -> i32;
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/sgx.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/sgx.rs
--- 43.0.0-1/rust-vendor/libc/src/sgx.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/sgx.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,47 @@
+//! SGX C types definition
+
+pub type c_schar = i8;
+pub type c_uchar = u8;
+pub type c_short = i16;
+pub type c_ushort = u16;
+pub type c_int = i32;
+pub type c_uint = u32;
+pub type c_float = f32;
+pub type c_double = f64;
+pub type c_longlong = i64;
+pub type c_ulonglong = u64;
+pub type intmax_t = i64;
+pub type uintmax_t = u64;
+
+pub type size_t = usize;
+pub type ptrdiff_t = isize;
+pub type intptr_t = isize;
+pub type uintptr_t = usize;
+pub type ssize_t = isize;
+
+pub type c_char = i8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+
+pub const INT_MIN: c_int = -2147483648;
+pub const INT_MAX: c_int = 2147483647;
+
+cfg_if! {
+    if #[cfg(libc_core_cvoid)] {
+        pub use ::ffi::c_void;
+    } else {
+        // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
+        // enable more optimization opportunities around it recognizing things
+        // like malloc/free.
+        #[repr(u8)]
+        #[allow(missing_copy_implementations)]
+        #[allow(missing_debug_implementations)]
+        pub enum c_void {
+            // Two dummy variants so the #[repr] attribute can be used.
+            #[doc(hidden)]
+            __variant1,
+            #[doc(hidden)]
+            __variant2,
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/solid/aarch64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/solid/aarch64.rs
--- 43.0.0-1/rust-vendor/libc/src/solid/aarch64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/solid/aarch64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4 @@
+pub type c_char = i8;
+pub type wchar_t = u32;
+pub type c_long = i64;
+pub type c_ulong = u64;
diff -pruN 43.0.0-1/rust-vendor/libc/src/solid/arm.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/solid/arm.rs
--- 43.0.0-1/rust-vendor/libc/src/solid/arm.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/solid/arm.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4 @@
+pub type c_char = i8;
+pub type wchar_t = u32;
+pub type c_long = i32;
+pub type c_ulong = u32;
diff -pruN 43.0.0-1/rust-vendor/libc/src/solid/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/solid/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/solid/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/solid/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,904 @@
+//! Interface to the [SOLID] C library
+//!
+//! [SOLID]: https://solid.kmckk.com/
+
+pub type c_schar = i8;
+pub type c_uchar = u8;
+pub type c_short = i16;
+pub type c_ushort = u16;
+pub type c_int = i32;
+pub type c_uint = u32;
+pub type c_float = f32;
+pub type c_double = f64;
+pub type c_longlong = i64;
+pub type c_ulonglong = u64;
+pub type intmax_t = i64;
+pub type uintmax_t = u64;
+
+pub type uintptr_t = usize;
+pub type intptr_t = isize;
+pub type ptrdiff_t = isize;
+pub type size_t = ::uintptr_t;
+pub type ssize_t = ::intptr_t;
+
+pub type clock_t = c_uint;
+pub type time_t = i64;
+pub type clockid_t = c_int;
+pub type timer_t = c_int;
+pub type suseconds_t = c_int;
+pub type useconds_t = c_uint;
+
+pub type sighandler_t = size_t;
+
+// sys/ansi.h
+pub type __caddr_t = *mut c_char;
+pub type __gid_t = u32;
+pub type __in_addr_t = u32;
+pub type __in_port_t = u16;
+pub type __mode_t = u32;
+pub type __off_t = i64;
+pub type __pid_t = i32;
+pub type __sa_family_t = u8;
+pub type __socklen_t = c_uint;
+pub type __uid_t = u32;
+pub type __fsblkcnt_t = u64;
+pub type __fsfilcnt_t = u64;
+
+// locale.h
+pub type locale_t = usize;
+
+// nl_types.h
+pub type nl_item = c_long;
+
+// sys/types.h
+pub type __va_list = *mut c_char;
+pub type u_int8_t = u8;
+pub type u_int16_t = u16;
+pub type u_int32_t = u32;
+pub type u_int64_t = u64;
+pub type u_char = c_uchar;
+pub type u_short = c_ushort;
+pub type u_int = c_uint;
+pub type u_long = c_ulong;
+pub type unchar = c_uchar;
+pub type ushort = c_ushort;
+pub type uint = c_uint;
+pub type ulong = c_ulong;
+pub type u_quad_t = u64;
+pub type quad_t = i64;
+pub type qaddr_t = *mut quad_t;
+pub type longlong_t = i64;
+pub type u_longlong_t = u64;
+pub type blkcnt_t = i64;
+pub type blksize_t = i32;
+pub type fsblkcnt_t = __fsblkcnt_t;
+pub type fsfilcnt_t = __fsfilcnt_t;
+pub type caddr_t = __caddr_t;
+pub type daddr_t = i64;
+pub type dev_t = u64;
+pub type fixpt_t = u32;
+pub type gid_t = __gid_t;
+pub type idtype_t = c_int;
+pub type id_t = u32;
+pub type ino_t = u64;
+pub type key_t = c_long;
+pub type mode_t = __mode_t;
+pub type nlink_t = u32;
+pub type off_t = __off_t;
+pub type pid_t = __pid_t;
+pub type lwpid_t = i32;
+pub type rlim_t = u64;
+pub type segsz_t = i32;
+pub type swblk_t = i32;
+pub type mqd_t = c_int;
+pub type cpuid_t = c_ulong;
+pub type psetid_t = c_int;
+
+s! {
+    // stat.h
+    pub struct stat {
+        pub st_dev: dev_t,
+        pub st_ino: ino_t,
+        pub st_mode: c_short,
+        pub st_nlink: c_short,
+        pub st_uid: c_short,
+        pub st_gid: c_short,
+        pub st_rdev: dev_t,
+        pub st_size: off_t,
+        pub st_atime: time_t,
+        pub st_mtime: time_t,
+        pub st_ctime: time_t,
+        pub st_blksize: blksize_t,
+    }
+
+    // time.h
+    pub struct tm {
+        pub tm_sec: c_int,
+        pub tm_min: c_int,
+        pub tm_hour: c_int,
+        pub tm_mday: c_int,
+        pub tm_mon: c_int,
+        pub tm_year: c_int,
+        pub tm_wday: c_int,
+        pub tm_yday: c_int,
+        pub tm_isdst: c_int,
+        pub tm_gmtoff: c_long,
+        pub tm_zone: *mut c_char,
+    }
+
+    // stdlib.h
+    pub struct qdiv_t {
+        pub quot: quad_t,
+        pub rem: quad_t,
+    }
+    pub struct lldiv_t {
+        pub quot: c_longlong,
+        pub rem: c_longlong,
+    }
+    pub struct div_t {
+        pub quot: c_int,
+        pub rem: c_int,
+    }
+    pub struct ldiv_t {
+        pub quot: c_long,
+        pub rem: c_long,
+    }
+
+    // locale.h
+    pub struct lconv {
+        pub decimal_point: *mut c_char,
+        pub thousands_sep: *mut c_char,
+        pub grouping: *mut c_char,
+        pub int_curr_symbol: *mut c_char,
+        pub currency_symbol: *mut c_char,
+        pub mon_decimal_point: *mut c_char,
+        pub mon_thousands_sep: *mut c_char,
+        pub mon_grouping: *mut c_char,
+        pub positive_sign: *mut c_char,
+        pub negative_sign: *mut c_char,
+        pub int_frac_digits: c_char,
+        pub frac_digits: c_char,
+        pub p_cs_precedes: c_char,
+        pub p_sep_by_space: c_char,
+        pub n_cs_precedes: c_char,
+        pub n_sep_by_space: c_char,
+        pub p_sign_posn: c_char,
+        pub n_sign_posn: c_char,
+        pub int_p_cs_precedes: c_char,
+        pub int_n_cs_precedes: c_char,
+        pub int_p_sep_by_space: c_char,
+        pub int_n_sep_by_space: c_char,
+        pub int_p_sign_posn: c_char,
+        pub int_n_sign_posn: c_char,
+    }
+
+    pub struct iovec {
+        pub iov_base: *mut c_void,
+        pub iov_len: size_t,
+    }
+
+    pub struct timeval {
+        pub tv_sec: c_long,
+        pub tv_usec: c_long,
+    }
+}
+
+pub const INT_MIN: c_int = -2147483648;
+pub const INT_MAX: c_int = 2147483647;
+
+pub const EXIT_FAILURE: c_int = 1;
+pub const EXIT_SUCCESS: c_int = 0;
+pub const RAND_MAX: c_int = 0x7fffffff;
+pub const EOF: c_int = -1;
+pub const SEEK_SET: c_int = 0;
+pub const SEEK_CUR: c_int = 1;
+pub const SEEK_END: c_int = 2;
+pub const _IOFBF: c_int = 0;
+pub const _IONBF: c_int = 2;
+pub const _IOLBF: c_int = 1;
+pub const BUFSIZ: c_uint = 1024;
+pub const FOPEN_MAX: c_uint = 20;
+pub const FILENAME_MAX: c_uint = 1024;
+
+pub const O_RDONLY: c_int = 1;
+pub const O_WRONLY: c_int = 2;
+pub const O_RDWR: c_int = 4;
+pub const O_APPEND: c_int = 8;
+pub const O_CREAT: c_int = 0x10;
+pub const O_EXCL: c_int = 0x400;
+pub const O_TEXT: c_int = 0x100;
+pub const O_BINARY: c_int = 0x200;
+pub const O_TRUNC: c_int = 0x20;
+pub const S_IEXEC: c_short = 0x0040;
+pub const S_IWRITE: c_short = 0x0080;
+pub const S_IREAD: c_short = 0x0100;
+pub const S_IFCHR: c_short = 0x2000;
+pub const S_IFDIR: c_short = 0x4000;
+pub const S_IFMT: c_short = 0o160000;
+pub const S_IFIFO: c_short = 0o0010000;
+pub const S_IFBLK: c_short = 0o0060000;
+pub const S_IFREG: c_short = 0o0100000;
+
+pub const LC_ALL: c_int = 0;
+pub const LC_COLLATE: c_int = 1;
+pub const LC_CTYPE: c_int = 2;
+pub const LC_MONETARY: c_int = 3;
+pub const LC_NUMERIC: c_int = 4;
+pub const LC_TIME: c_int = 5;
+pub const LC_MESSAGES: c_int = 6;
+pub const _LC_LAST: c_int = 7;
+
+pub const EPERM: c_int = 1;
+pub const ENOENT: c_int = 2;
+pub const ESRCH: c_int = 3;
+pub const EINTR: c_int = 4;
+pub const EIO: c_int = 5;
+pub const ENXIO: c_int = 6;
+pub const E2BIG: c_int = 7;
+pub const ENOEXEC: c_int = 8;
+pub const EBADF: c_int = 9;
+pub const ECHILD: c_int = 10;
+pub const EAGAIN: c_int = 11;
+pub const ENOMEM: c_int = 12;
+pub const EACCES: c_int = 13;
+pub const EFAULT: c_int = 14;
+pub const ENOTBLK: c_int = 15;
+pub const EBUSY: c_int = 16;
+pub const EEXIST: c_int = 17;
+pub const EXDEV: c_int = 18;
+pub const ENODEV: c_int = 19;
+pub const ENOTDIR: c_int = 20;
+pub const EISDIR: c_int = 21;
+pub const EINVAL: c_int = 22;
+pub const ENFILE: c_int = 23;
+pub const EMFILE: c_int = 24;
+pub const ENOTTY: c_int = 25;
+pub const ETXTBSY: c_int = 26;
+pub const EFBIG: c_int = 27;
+pub const ENOSPC: c_int = 28;
+pub const ESPIPE: c_int = 29;
+pub const EROFS: c_int = 30;
+pub const EMLINK: c_int = 31;
+pub const EPIPE: c_int = 32;
+pub const EDOM: c_int = 33;
+pub const ERANGE: c_int = 34;
+
+pub const EDEADLK: c_int = 35;
+pub const ENAMETOOLONG: c_int = 36;
+pub const ENOLCK: c_int = 37;
+pub const ENOSYS: c_int = 38;
+pub const ENOTEMPTY: c_int = 39;
+pub const ELOOP: c_int = 40;
+pub const EWOULDBLOCK: c_int = EAGAIN;
+pub const ENOMSG: c_int = 42;
+pub const EIDRM: c_int = 43;
+pub const ECHRNG: c_int = 44;
+pub const EL2NSYNC: c_int = 45;
+pub const EL3HLT: c_int = 46;
+pub const EL3RST: c_int = 47;
+pub const ELNRNG: c_int = 48;
+pub const EUNATCH: c_int = 49;
+pub const ENOCSI: c_int = 50;
+pub const EL2HLT: c_int = 51;
+pub const EBADE: c_int = 52;
+pub const EBADR: c_int = 53;
+pub const EXFULL: c_int = 54;
+pub const ENOANO: c_int = 55;
+pub const EBADRQC: c_int = 56;
+pub const EBADSLT: c_int = 57;
+
+pub const EDEADLOCK: c_int = EDEADLK;
+
+pub const EBFONT: c_int = 59;
+pub const ENOSTR: c_int = 60;
+pub const ENODATA: c_int = 61;
+pub const ETIME: c_int = 62;
+pub const ENOSR: c_int = 63;
+pub const ENONET: c_int = 64;
+pub const ENOPKG: c_int = 65;
+pub const EREMOTE: c_int = 66;
+pub const ENOLINK: c_int = 67;
+pub const EADV: c_int = 68;
+pub const ESRMNT: c_int = 69;
+pub const ECOMM: c_int = 70;
+pub const EPROTO: c_int = 71;
+pub const EMULTIHOP: c_int = 72;
+pub const EDOTDOT: c_int = 73;
+pub const EBADMSG: c_int = 74;
+pub const EOVERFLOW: c_int = 75;
+pub const ENOTUNIQ: c_int = 76;
+pub const EBADFD: c_int = 77;
+pub const EREMCHG: c_int = 78;
+pub const ELIBACC: c_int = 79;
+pub const ELIBBAD: c_int = 80;
+pub const ELIBSCN: c_int = 81;
+pub const ELIBMAX: c_int = 82;
+pub const ELIBEXEC: c_int = 83;
+pub const EILSEQ: c_int = 84;
+pub const ERESTART: c_int = 85;
+pub const ESTRPIPE: c_int = 86;
+pub const EUSERS: c_int = 87;
+pub const ENOTSOCK: c_int = 88;
+pub const EDESTADDRREQ: c_int = 89;
+pub const EMSGSIZE: c_int = 90;
+pub const EPROTOTYPE: c_int = 91;
+pub const ENOPROTOOPT: c_int = 92;
+pub const EPROTONOSUPPORT: c_int = 93;
+pub const ESOCKTNOSUPPORT: c_int = 94;
+pub const EOPNOTSUPP: c_int = 95;
+pub const EPFNOSUPPORT: c_int = 96;
+pub const EAFNOSUPPORT: c_int = 97;
+pub const EADDRINUSE: c_int = 98;
+pub const EADDRNOTAVAIL: c_int = 99;
+pub const ENETDOWN: c_int = 100;
+pub const ENETUNREACH: c_int = 101;
+pub const ENETRESET: c_int = 102;
+pub const ECONNABORTED: c_int = 103;
+pub const ECONNRESET: c_int = 104;
+pub const ENOBUFS: c_int = 105;
+pub const EISCONN: c_int = 106;
+pub const ENOTCONN: c_int = 107;
+pub const ESHUTDOWN: c_int = 108;
+pub const ETOOMANYREFS: c_int = 109;
+pub const ETIMEDOUT: c_int = 110;
+pub const ECONNREFUSED: c_int = 111;
+pub const EHOSTDOWN: c_int = 112;
+pub const EHOSTUNREACH: c_int = 113;
+pub const EALREADY: c_int = 114;
+pub const EINPROGRESS: c_int = 115;
+pub const ESTALE: c_int = 116;
+pub const EUCLEAN: c_int = 117;
+pub const ENOTNAM: c_int = 118;
+pub const ENAVAIL: c_int = 119;
+pub const EISNAM: c_int = 120;
+pub const EREMOTEIO: c_int = 121;
+pub const EDQUOT: c_int = 122;
+
+pub const ENOMEDIUM: c_int = 123;
+pub const EMEDIUMTYPE: c_int = 124;
+pub const ECANCELED: c_int = 125;
+pub const ENOKEY: c_int = 126;
+pub const EKEYEXPIRED: c_int = 127;
+pub const EKEYREVOKED: c_int = 128;
+pub const EKEYREJECTED: c_int = 129;
+
+pub const EOWNERDEAD: c_int = 130;
+pub const ENOTRECOVERABLE: c_int = 131;
+
+pub const ENOTSUP: c_int = 132;
+pub const EFTYPE: c_int = 133;
+
+// signal codes
+pub const SIGHUP: c_int = 1;
+pub const SIGINT: c_int = 2;
+pub const SIGQUIT: c_int = 3;
+pub const SIGILL: c_int = 4;
+pub const SIGTRAP: c_int = 5;
+pub const SIGABRT: c_int = 6;
+pub const SIGIOT: c_int = SIGABRT;
+pub const SIGEMT: c_int = 7;
+pub const SIGFPE: c_int = 8;
+pub const SIGKILL: c_int = 9;
+pub const SIGBUS: c_int = 10;
+pub const SIGSEGV: c_int = 11;
+pub const SIGSYS: c_int = 12;
+pub const SIGPIPE: c_int = 13;
+pub const SIGALRM: c_int = 14;
+pub const SIGTERM: c_int = 15;
+pub const SIGURG: c_int = 16;
+pub const SIGSTOP: c_int = 17;
+pub const SIGTSTP: c_int = 18;
+pub const SIGCONT: c_int = 19;
+pub const SIGCHLD: c_int = 20;
+pub const SIGTTIN: c_int = 21;
+pub const SIGTTOU: c_int = 22;
+pub const SIGIO: c_int = 23;
+pub const SIGXCPU: c_int = 24;
+pub const SIGXFSZ: c_int = 25;
+pub const SIGVTALRM: c_int = 26;
+pub const SIGPROF: c_int = 27;
+pub const SIGWINCH: c_int = 28;
+pub const SIGINFO: c_int = 29;
+pub const SIGUSR1: c_int = 30;
+pub const SIGUSR2: c_int = 31;
+pub const SIGPWR: c_int = 32;
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum FILE {}
+impl ::Copy for FILE {}
+impl ::Clone for FILE {
+    fn clone(&self) -> FILE {
+        *self
+    }
+}
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum fpos_t {}
+impl ::Copy for fpos_t {}
+impl ::Clone for fpos_t {
+    fn clone(&self) -> fpos_t {
+        *self
+    }
+}
+
+extern "C" {
+    // ctype.h
+    pub fn isalnum(c: c_int) -> c_int;
+    pub fn isalpha(c: c_int) -> c_int;
+    pub fn iscntrl(c: c_int) -> c_int;
+    pub fn isdigit(c: c_int) -> c_int;
+    pub fn isgraph(c: c_int) -> c_int;
+    pub fn islower(c: c_int) -> c_int;
+    pub fn isprint(c: c_int) -> c_int;
+    pub fn ispunct(c: c_int) -> c_int;
+    pub fn isspace(c: c_int) -> c_int;
+    pub fn isupper(c: c_int) -> c_int;
+    pub fn isxdigit(c: c_int) -> c_int;
+    pub fn isblank(c: c_int) -> c_int;
+    pub fn tolower(c: c_int) -> c_int;
+    pub fn toupper(c: c_int) -> c_int;
+
+    // stdio.h
+    pub fn __get_stdio_file(fileno: c_int) -> *mut FILE;
+    pub fn clearerr(arg1: *mut FILE);
+    pub fn fclose(arg1: *mut FILE) -> c_int;
+    pub fn feof(arg1: *mut FILE) -> c_int;
+    pub fn ferror(arg1: *mut FILE) -> c_int;
+    pub fn fflush(arg1: *mut FILE) -> c_int;
+    pub fn fgetc(arg1: *mut FILE) -> c_int;
+    pub fn fgets(arg1: *mut c_char, arg2: c_int, arg3: *mut FILE) -> *mut c_char;
+    pub fn fopen(arg1: *const c_char, arg2: *const c_char) -> *mut FILE;
+    pub fn fprintf(arg1: *mut FILE, arg2: *const c_char, ...) -> c_int;
+    pub fn fputc(arg1: c_int, arg2: *mut FILE) -> c_int;
+    pub fn fputs(arg1: *const c_char, arg2: *mut FILE) -> c_int;
+    pub fn fread(arg1: *mut c_void, arg2: size_t, arg3: size_t, arg4: *mut FILE) -> size_t;
+    pub fn freopen(arg1: *const c_char, arg2: *const c_char, arg3: *mut FILE) -> *mut FILE;
+    pub fn fscanf(arg1: *mut FILE, arg2: *const c_char, ...) -> c_int;
+    pub fn fseek(arg1: *mut FILE, arg2: c_long, arg3: c_int) -> c_int;
+    pub fn ftell(arg1: *mut FILE) -> c_long;
+    pub fn fwrite(arg1: *const c_void, arg2: size_t, arg3: size_t, arg4: *mut FILE) -> size_t;
+    pub fn getc(arg1: *mut FILE) -> c_int;
+    pub fn getchar() -> c_int;
+    pub fn perror(arg1: *const c_char);
+    pub fn printf(arg1: *const c_char, ...) -> c_int;
+    pub fn putc(arg1: c_int, arg2: *mut FILE) -> c_int;
+    pub fn putchar(arg1: c_int) -> c_int;
+    pub fn puts(arg1: *const c_char) -> c_int;
+    pub fn remove(arg1: *const c_char) -> c_int;
+    pub fn rewind(arg1: *mut FILE);
+    pub fn scanf(arg1: *const c_char, ...) -> c_int;
+    pub fn setbuf(arg1: *mut FILE, arg2: *mut c_char);
+    pub fn setvbuf(arg1: *mut FILE, arg2: *mut c_char, arg3: c_int, arg4: size_t) -> c_int;
+    pub fn sscanf(arg1: *const c_char, arg2: *const c_char, ...) -> c_int;
+    pub fn tmpfile() -> *mut FILE;
+    pub fn ungetc(arg1: c_int, arg2: *mut FILE) -> c_int;
+    pub fn vfprintf(arg1: *mut FILE, arg2: *const c_char, arg3: __va_list) -> c_int;
+    pub fn vprintf(arg1: *const c_char, arg2: __va_list) -> c_int;
+    pub fn gets(arg1: *mut c_char) -> *mut c_char;
+    pub fn sprintf(arg1: *mut c_char, arg2: *const c_char, ...) -> c_int;
+    pub fn tmpnam(arg1: *const c_char) -> *mut c_char;
+    pub fn vsprintf(arg1: *mut c_char, arg2: *const c_char, arg3: __va_list) -> c_int;
+    pub fn rename(arg1: *const c_char, arg2: *const c_char) -> c_int;
+    pub fn asiprintf(arg1: *mut *mut c_char, arg2: *const c_char, ...) -> c_int;
+    pub fn fiprintf(arg1: *mut FILE, arg2: *const c_char, ...) -> c_int;
+    pub fn fiscanf(arg1: *mut FILE, arg2: *const c_char, ...) -> c_int;
+    pub fn iprintf(arg1: *const c_char, ...) -> c_int;
+    pub fn iscanf(arg1: *const c_char, ...) -> c_int;
+    pub fn siprintf(arg1: *mut c_char, arg2: *const c_char, ...) -> c_int;
+    pub fn siscanf(arg1: *mut c_char, arg2: *const c_char, ...) -> c_int;
+    pub fn sniprintf(arg1: *mut c_char, arg2: size_t, arg3: *const c_char, ...) -> c_int;
+    pub fn vasiprintf(arg1: *mut *mut c_char, arg2: *const c_char, arg3: __va_list) -> c_int;
+    pub fn vfiprintf(arg1: *mut FILE, arg2: *const c_char, arg3: __va_list) -> c_int;
+    pub fn vfiscanf(arg1: *mut FILE, arg2: *const c_char, arg3: __va_list) -> c_int;
+    pub fn viprintf(arg1: *const c_char, arg2: __va_list) -> c_int;
+    pub fn viscanf(arg1: *const c_char, arg2: __va_list) -> c_int;
+    pub fn vsiprintf(arg1: *mut c_char, arg2: *const c_char, arg3: __va_list) -> c_int;
+    pub fn vsiscanf(arg1: *const c_char, arg2: *const c_char, arg3: __va_list) -> c_int;
+    pub fn vsniprintf(
+        arg1: *mut c_char,
+        arg2: size_t,
+        arg3: *const c_char,
+        arg4: __va_list,
+    ) -> c_int;
+    pub fn vdiprintf(arg1: c_int, arg2: *const c_char, arg3: __va_list) -> c_int;
+    pub fn diprintf(arg1: c_int, arg2: *const c_char, ...) -> c_int;
+    pub fn fgetpos(arg1: *mut FILE, arg2: *mut fpos_t) -> c_int;
+    pub fn fsetpos(arg1: *mut FILE, arg2: *const fpos_t) -> c_int;
+    pub fn fdopen(arg1: c_int, arg2: *const c_char) -> *mut FILE;
+    pub fn fileno(arg1: *mut FILE) -> c_int;
+    pub fn flockfile(arg1: *mut FILE);
+    pub fn ftrylockfile(arg1: *mut FILE) -> c_int;
+    pub fn funlockfile(arg1: *mut FILE);
+    pub fn getc_unlocked(arg1: *mut FILE) -> c_int;
+    pub fn getchar_unlocked() -> c_int;
+    pub fn putc_unlocked(arg1: c_int, arg2: *mut FILE) -> c_int;
+    pub fn putchar_unlocked(arg1: c_int) -> c_int;
+    pub fn snprintf(arg1: *mut c_char, arg2: size_t, arg3: *const c_char, ...) -> c_int;
+    pub fn vsnprintf(
+        arg1: *mut c_char,
+        arg2: size_t,
+        arg3: *const c_char,
+        arg4: __va_list,
+    ) -> c_int;
+    pub fn getw(arg1: *mut FILE) -> c_int;
+    pub fn putw(arg1: c_int, arg2: *mut FILE) -> c_int;
+    pub fn tempnam(arg1: *const c_char, arg2: *const c_char) -> *mut c_char;
+    pub fn fseeko(stream: *mut FILE, offset: off_t, whence: c_int) -> c_int;
+    pub fn ftello(stream: *mut FILE) -> off_t;
+
+    // stdlib.h
+    pub fn atof(arg1: *const c_char) -> f64;
+    pub fn strtod(arg1: *const c_char, arg2: *mut *mut c_char) -> f64;
+    pub fn drand48() -> f64;
+    pub fn erand48(arg1: *mut c_ushort) -> f64;
+    pub fn strtof(arg1: *const c_char, arg2: *mut *mut c_char) -> f32;
+    pub fn strtold(arg1: *const c_char, arg2: *mut *mut c_char) -> f64;
+    pub fn strtod_l(arg1: *const c_char, arg2: *mut *mut c_char, arg3: locale_t) -> f64;
+    pub fn strtof_l(arg1: *const c_char, arg2: *mut *mut c_char, arg3: locale_t) -> f32;
+    pub fn strtold_l(arg1: *const c_char, arg2: *mut *mut c_char, arg3: locale_t) -> f64;
+    pub fn _Exit(arg1: c_int) -> !;
+    pub fn abort() -> !;
+    pub fn abs(arg1: c_int) -> c_int;
+    pub fn atexit(arg1: ::Option<unsafe extern "C" fn()>) -> c_int;
+    pub fn atoi(arg1: *const c_char) -> c_int;
+    pub fn atol(arg1: *const c_char) -> c_long;
+    pub fn itoa(arg1: c_int, arg2: *mut c_char, arg3: c_int) -> *mut c_char;
+    pub fn ltoa(arg1: c_long, arg2: *mut c_char, arg3: c_int) -> *mut c_char;
+    pub fn ultoa(arg1: c_ulong, arg2: *mut c_char, arg3: c_int) -> *mut c_char;
+    pub fn bsearch(
+        arg1: *const c_void,
+        arg2: *const c_void,
+        arg3: size_t,
+        arg4: size_t,
+        arg5: ::Option<unsafe extern "C" fn(arg1: *const c_void, arg2: *const c_void) -> c_int>,
+    ) -> *mut c_void;
+    pub fn calloc(arg1: size_t, arg2: size_t) -> *mut c_void;
+    pub fn div(arg1: c_int, arg2: c_int) -> div_t;
+    pub fn exit(arg1: c_int) -> !;
+    pub fn free(arg1: *mut c_void);
+    pub fn getenv(arg1: *const c_char) -> *mut c_char;
+    pub fn labs(arg1: c_long) -> c_long;
+    pub fn ldiv(arg1: c_long, arg2: c_long) -> ldiv_t;
+    pub fn malloc(arg1: size_t) -> *mut c_void;
+    pub fn qsort(
+        arg1: *mut c_void,
+        arg2: size_t,
+        arg3: size_t,
+        arg4: ::Option<unsafe extern "C" fn(arg1: *const c_void, arg2: *const c_void) -> c_int>,
+    );
+    pub fn rand() -> c_int;
+    pub fn realloc(arg1: *mut c_void, arg2: size_t) -> *mut c_void;
+    pub fn srand(arg1: c_uint);
+    pub fn strtol(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_long;
+    pub fn strtoul(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_ulong;
+    pub fn mblen(arg1: *const c_char, arg2: size_t) -> c_int;
+    pub fn mbstowcs(arg1: *mut wchar_t, arg2: *const c_char, arg3: size_t) -> size_t;
+    pub fn wctomb(arg1: *mut c_char, arg2: wchar_t) -> c_int;
+    pub fn mbtowc(arg1: *mut wchar_t, arg2: *const c_char, arg3: size_t) -> c_int;
+    pub fn wcstombs(arg1: *mut c_char, arg2: *const wchar_t, arg3: size_t) -> size_t;
+    pub fn rand_r(arg1: *mut c_uint) -> c_int;
+    pub fn jrand48(arg1: *mut c_ushort) -> c_long;
+    pub fn lcong48(arg1: *mut c_ushort);
+    pub fn lrand48() -> c_long;
+    pub fn mrand48() -> c_long;
+    pub fn nrand48(arg1: *mut c_ushort) -> c_long;
+    pub fn seed48(arg1: *mut c_ushort) -> *mut c_ushort;
+    pub fn srand48(arg1: c_long);
+    pub fn putenv(arg1: *mut c_char) -> c_int;
+    pub fn a64l(arg1: *const c_char) -> c_long;
+    pub fn l64a(arg1: c_long) -> *mut c_char;
+    pub fn random() -> c_long;
+    pub fn setstate(arg1: *mut c_char) -> *mut c_char;
+    pub fn initstate(arg1: c_uint, arg2: *mut c_char, arg3: size_t) -> *mut c_char;
+    pub fn srandom(arg1: c_uint);
+    pub fn mkostemp(arg1: *mut c_char, arg2: c_int) -> c_int;
+    pub fn mkostemps(arg1: *mut c_char, arg2: c_int, arg3: c_int) -> c_int;
+    pub fn mkdtemp(arg1: *mut c_char) -> *mut c_char;
+    pub fn mkstemp(arg1: *mut c_char) -> c_int;
+    pub fn mktemp(arg1: *mut c_char) -> *mut c_char;
+    pub fn atoll(arg1: *const c_char) -> c_longlong;
+    pub fn llabs(arg1: c_longlong) -> c_longlong;
+    pub fn lldiv(arg1: c_longlong, arg2: c_longlong) -> lldiv_t;
+    pub fn strtoll(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_longlong;
+    pub fn strtoull(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_ulonglong;
+    pub fn aligned_alloc(arg1: size_t, arg2: size_t) -> *mut c_void;
+    pub fn at_quick_exit(arg1: ::Option<unsafe extern "C" fn()>) -> c_int;
+    pub fn quick_exit(arg1: c_int);
+    pub fn setenv(arg1: *const c_char, arg2: *const c_char, arg3: c_int) -> c_int;
+    pub fn unsetenv(arg1: *const c_char) -> c_int;
+    pub fn humanize_number(
+        arg1: *mut c_char,
+        arg2: size_t,
+        arg3: i64,
+        arg4: *const c_char,
+        arg5: c_int,
+        arg6: c_int,
+    ) -> c_int;
+    pub fn dehumanize_number(arg1: *const c_char, arg2: *mut i64) -> c_int;
+    pub fn getenv_r(arg1: *const c_char, arg2: *mut c_char, arg3: size_t) -> c_int;
+    pub fn heapsort(
+        arg1: *mut c_void,
+        arg2: size_t,
+        arg3: size_t,
+        arg4: ::Option<unsafe extern "C" fn(arg1: *const c_void, arg2: *const c_void) -> c_int>,
+    ) -> c_int;
+    pub fn mergesort(
+        arg1: *mut c_void,
+        arg2: size_t,
+        arg3: size_t,
+        arg4: ::Option<unsafe extern "C" fn(arg1: *const c_void, arg2: *const c_void) -> c_int>,
+    ) -> c_int;
+    pub fn radixsort(
+        arg1: *mut *const c_uchar,
+        arg2: c_int,
+        arg3: *const c_uchar,
+        arg4: c_uint,
+    ) -> c_int;
+    pub fn sradixsort(
+        arg1: *mut *const c_uchar,
+        arg2: c_int,
+        arg3: *const c_uchar,
+        arg4: c_uint,
+    ) -> c_int;
+    pub fn getprogname() -> *const c_char;
+    pub fn setprogname(arg1: *const c_char);
+    pub fn qabs(arg1: quad_t) -> quad_t;
+    pub fn strtoq(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> quad_t;
+    pub fn strtouq(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> u_quad_t;
+    pub fn strsuftoll(
+        arg1: *const c_char,
+        arg2: *const c_char,
+        arg3: c_longlong,
+        arg4: c_longlong,
+    ) -> c_longlong;
+    pub fn strsuftollx(
+        arg1: *const c_char,
+        arg2: *const c_char,
+        arg3: c_longlong,
+        arg4: c_longlong,
+        arg5: *mut c_char,
+        arg6: size_t,
+    ) -> c_longlong;
+    pub fn l64a_r(arg1: c_long, arg2: *mut c_char, arg3: c_int) -> c_int;
+    pub fn qdiv(arg1: quad_t, arg2: quad_t) -> qdiv_t;
+    pub fn strtol_l(
+        arg1: *const c_char,
+        arg2: *mut *mut c_char,
+        arg3: c_int,
+        arg4: locale_t,
+    ) -> c_long;
+    pub fn strtoul_l(
+        arg1: *const c_char,
+        arg2: *mut *mut c_char,
+        arg3: c_int,
+        arg4: locale_t,
+    ) -> c_ulong;
+    pub fn strtoll_l(
+        arg1: *const c_char,
+        arg2: *mut *mut c_char,
+        arg3: c_int,
+        arg4: locale_t,
+    ) -> c_longlong;
+    pub fn strtoull_l(
+        arg1: *const c_char,
+        arg2: *mut *mut c_char,
+        arg3: c_int,
+        arg4: locale_t,
+    ) -> c_ulonglong;
+    pub fn strtoq_l(
+        arg1: *const c_char,
+        arg2: *mut *mut c_char,
+        arg3: c_int,
+        arg4: locale_t,
+    ) -> quad_t;
+    pub fn strtouq_l(
+        arg1: *const c_char,
+        arg2: *mut *mut c_char,
+        arg3: c_int,
+        arg4: locale_t,
+    ) -> u_quad_t;
+    pub fn _mb_cur_max_l(arg1: locale_t) -> size_t;
+    pub fn mblen_l(arg1: *const c_char, arg2: size_t, arg3: locale_t) -> c_int;
+    pub fn mbstowcs_l(
+        arg1: *mut wchar_t,
+        arg2: *const c_char,
+        arg3: size_t,
+        arg4: locale_t,
+    ) -> size_t;
+    pub fn wctomb_l(arg1: *mut c_char, arg2: wchar_t, arg3: locale_t) -> c_int;
+    pub fn mbtowc_l(arg1: *mut wchar_t, arg2: *const c_char, arg3: size_t, arg4: locale_t)
+        -> c_int;
+    pub fn wcstombs_l(
+        arg1: *mut c_char,
+        arg2: *const wchar_t,
+        arg3: size_t,
+        arg4: locale_t,
+    ) -> size_t;
+
+    // string.h
+    pub fn memchr(arg1: *const c_void, arg2: c_int, arg3: size_t) -> *mut c_void;
+    pub fn memcmp(arg1: *const c_void, arg2: *const c_void, arg3: size_t) -> c_int;
+    pub fn memcpy(arg1: *mut c_void, arg2: *const c_void, arg3: size_t) -> *mut c_void;
+    pub fn memmove(arg1: *mut c_void, arg2: *const c_void, arg3: size_t) -> *mut c_void;
+    pub fn memset(arg1: *mut c_void, arg2: c_int, arg3: size_t) -> *mut c_void;
+    pub fn strcat(arg1: *mut c_char, arg2: *const c_char) -> *mut c_char;
+    pub fn strchr(arg1: *const c_char, arg2: c_int) -> *mut c_char;
+    pub fn strcmp(arg1: *const c_char, arg2: *const c_char) -> c_int;
+    pub fn strcoll(arg1: *const c_char, arg2: *const c_char) -> c_int;
+    pub fn strcpy(arg1: *mut c_char, arg2: *const c_char) -> *mut c_char;
+    pub fn strcspn(arg1: *const c_char, arg2: *const c_char) -> size_t;
+    pub fn strerror(arg1: c_int) -> *mut c_char;
+    pub fn strlen(arg1: *const c_char) -> size_t;
+    pub fn strncat(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> *mut c_char;
+    pub fn strncmp(arg1: *const c_char, arg2: *const c_char, arg3: size_t) -> c_int;
+    pub fn strncpy(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> *mut c_char;
+    pub fn strpbrk(arg1: *const c_char, arg2: *const c_char) -> *mut c_char;
+    pub fn strrchr(arg1: *const c_char, arg2: c_int) -> *mut c_char;
+    pub fn strspn(arg1: *const c_char, arg2: *const c_char) -> size_t;
+    pub fn strstr(arg1: *const c_char, arg2: *const c_char) -> *mut c_char;
+    pub fn strtok(arg1: *mut c_char, arg2: *const c_char) -> *mut c_char;
+    pub fn strtok_r(arg1: *mut c_char, arg2: *const c_char, arg3: *mut *mut c_char) -> *mut c_char;
+    pub fn strerror_r(arg1: c_int, arg2: *mut c_char, arg3: size_t) -> c_int;
+    pub fn strxfrm(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> size_t;
+    pub fn memccpy(
+        arg1: *mut c_void,
+        arg2: *const c_void,
+        arg3: c_int,
+        arg4: size_t,
+    ) -> *mut c_void;
+    pub fn strdup(arg1: *const c_char) -> *mut c_char;
+    pub fn stpcpy(arg1: *mut c_char, arg2: *const c_char) -> *mut c_char;
+    pub fn stpncpy(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> *mut c_char;
+    pub fn strnlen(arg1: *const c_char, arg2: size_t) -> size_t;
+    pub fn memmem(
+        arg1: *const c_void,
+        arg2: size_t,
+        arg3: *const c_void,
+        arg4: size_t,
+    ) -> *mut c_void;
+    pub fn strcasestr(arg1: *const c_char, arg2: *const c_char) -> *mut c_char;
+    pub fn strlcat(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> size_t;
+    pub fn strlcpy(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> size_t;
+    pub fn strsep(arg1: *mut *mut c_char, arg2: *const c_char) -> *mut c_char;
+    pub fn stresep(arg1: *mut *mut c_char, arg2: *const c_char, arg3: c_int) -> *mut c_char;
+    pub fn strndup(arg1: *const c_char, arg2: size_t) -> *mut c_char;
+    pub fn memrchr(arg1: *const c_void, arg2: c_int, arg3: size_t) -> *mut c_void;
+    pub fn explicit_memset(arg1: *mut c_void, arg2: c_int, arg3: size_t) -> *mut c_void;
+    pub fn consttime_memequal(arg1: *const c_void, arg2: *const c_void, arg3: size_t) -> c_int;
+    pub fn strcoll_l(arg1: *const c_char, arg2: *const c_char, arg3: locale_t) -> c_int;
+    pub fn strxfrm_l(
+        arg1: *mut c_char,
+        arg2: *const c_char,
+        arg3: size_t,
+        arg4: locale_t,
+    ) -> size_t;
+    pub fn strerror_l(arg1: c_int, arg2: locale_t) -> *mut c_char;
+
+    // strings.h
+    pub fn bcmp(arg1: *const c_void, arg2: *const c_void, arg3: size_t) -> c_int;
+    pub fn bcopy(arg1: *const c_void, arg2: *mut c_void, arg3: size_t);
+    pub fn bzero(arg1: *mut c_void, arg2: size_t);
+    pub fn ffs(arg1: c_int) -> c_int;
+    pub fn popcount(arg1: c_uint) -> c_uint;
+    pub fn popcountl(arg1: c_ulong) -> c_uint;
+    pub fn popcountll(arg1: c_ulonglong) -> c_uint;
+    pub fn popcount32(arg1: u32) -> c_uint;
+    pub fn popcount64(arg1: u64) -> c_uint;
+    pub fn rindex(arg1: *const c_char, arg2: c_int) -> *mut c_char;
+    pub fn strcasecmp(arg1: *const c_char, arg2: *const c_char) -> c_int;
+    pub fn strncasecmp(arg1: *const c_char, arg2: *const c_char, arg3: size_t) -> c_int;
+
+    // signal.h
+    pub fn signal(arg1: c_int, arg2: sighandler_t) -> sighandler_t;
+    pub fn raise(arg1: c_int) -> c_int;
+
+    // time.h
+    pub fn asctime(arg1: *const tm) -> *mut c_char;
+    pub fn clock() -> clock_t;
+    pub fn ctime(arg1: *const time_t) -> *mut c_char;
+    pub fn difftime(arg1: time_t, arg2: time_t) -> f64;
+    pub fn gmtime(arg1: *const time_t) -> *mut tm;
+    pub fn localtime(arg1: *const time_t) -> *mut tm;
+    pub fn time(arg1: *mut time_t) -> time_t;
+    pub fn mktime(arg1: *mut tm) -> time_t;
+    pub fn strftime(
+        arg1: *mut c_char,
+        arg2: size_t,
+        arg3: *const c_char,
+        arg4: *const tm,
+    ) -> size_t;
+    pub fn utime(arg1: *const c_char, arg2: *mut time_t) -> c_int;
+    pub fn asctime_r(arg1: *const tm, arg2: *mut c_char) -> *mut c_char;
+    pub fn ctime_r(arg1: *const time_t, arg2: *mut c_char) -> *mut c_char;
+    pub fn gmtime_r(arg1: *const time_t, arg2: *mut tm) -> *mut tm;
+    pub fn localtime_r(arg1: *const time_t, arg2: *mut tm) -> *mut tm;
+
+    // sys/stat.h
+    pub fn stat(arg1: *const c_char, arg2: *mut stat) -> c_int;
+    pub fn lstat(arg1: *const c_char, arg2: *mut stat) -> c_int;
+    pub fn fstat(arg1: c_int, arg2: *mut stat) -> c_int;
+    pub fn chmod(arg1: *const c_char, arg2: __mode_t) -> c_int;
+    pub fn mkdir(arg1: *const c_char, arg2: __mode_t) -> c_int;
+
+    // fcntl.h
+    pub fn open(arg1: *const c_char, arg2: c_int, ...) -> c_int;
+    pub fn creat(arg1: *const c_char, arg2: c_int) -> c_int;
+    pub fn close(arg1: c_int) -> c_int;
+    pub fn read(arg1: c_int, arg2: *mut c_void, arg3: c_int) -> c_int;
+    pub fn write(arg1: c_int, arg2: *const c_void, arg3: c_int) -> c_int;
+    pub fn unlink(arg1: *const c_char) -> c_int;
+    pub fn tell(arg1: c_int) -> c_long;
+    pub fn dup(arg1: c_int) -> c_int;
+    pub fn dup2(arg1: c_int, arg2: c_int) -> c_int;
+    pub fn access(arg1: *const c_char, arg2: c_int) -> c_int;
+    pub fn rmdir(arg1: *const c_char) -> c_int;
+    pub fn chdir(arg1: *const c_char) -> c_int;
+    pub fn _exit(arg1: c_int);
+    pub fn getwd(arg1: *mut c_char) -> *mut c_char;
+    pub fn getcwd(arg1: *mut c_char, arg2: size_t) -> *mut c_char;
+    pub static mut optarg: *mut c_char;
+    pub static mut opterr: c_int;
+    pub static mut optind: c_int;
+    pub static mut optopt: c_int;
+    pub static mut optreset: c_int;
+    pub fn getopt(arg1: c_int, arg2: *mut *mut c_char, arg3: *const c_char) -> c_int;
+    pub static mut suboptarg: *mut c_char;
+    pub fn getsubopt(
+        arg1: *mut *mut c_char,
+        arg2: *const *mut c_char,
+        arg3: *mut *mut c_char,
+    ) -> c_int;
+    pub fn fcntl(arg1: c_int, arg2: c_int, ...) -> c_int;
+    pub fn getpid() -> pid_t;
+    pub fn sleep(arg1: c_uint) -> c_uint;
+    pub fn usleep(arg1: useconds_t) -> c_int;
+
+    // locale.h
+    pub fn localeconv() -> *mut lconv;
+    pub fn setlocale(arg1: c_int, arg2: *const c_char) -> *mut c_char;
+    pub fn duplocale(arg1: locale_t) -> locale_t;
+    pub fn freelocale(arg1: locale_t);
+    pub fn localeconv_l(arg1: locale_t) -> *mut lconv;
+    pub fn newlocale(arg1: c_int, arg2: *const c_char, arg3: locale_t) -> locale_t;
+
+    // langinfo.h
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+    pub fn nl_langinfo_l(item: ::nl_item, locale: locale_t) -> *mut ::c_char;
+
+    // malloc.h
+    pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
+
+    // sys/types.h
+    pub fn lseek(arg1: c_int, arg2: __off_t, arg3: c_int) -> __off_t;
+}
+
+cfg_if! {
+    if #[cfg(libc_core_cvoid)] {
+        pub use ::ffi::c_void;
+    } else {
+        // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
+        // enable more optimization opportunities around it recognizing things
+        // like malloc/free.
+        #[repr(u8)]
+        #[allow(missing_copy_implementations)]
+        #[allow(missing_debug_implementations)]
+        pub enum c_void {
+            // Two dummy variants so the #[repr] attribute can be used.
+            #[doc(hidden)]
+            __variant1,
+            #[doc(hidden)]
+            __variant2,
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "aarch64")] {
+        mod aarch64;
+        pub use self::aarch64::*;
+    } else if #[cfg(any(target_arch = "arm"))] {
+        mod arm;
+        pub use self::arm::*;
+    } else {
+        // Unknown target_arch
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/switch.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/switch.rs
--- 43.0.0-1/rust-vendor/libc/src/switch.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/switch.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,49 @@
+//! Switch C type definitions
+
+pub type c_schar = i8;
+pub type c_uchar = u8;
+pub type c_short = i16;
+pub type c_ushort = u16;
+pub type c_int = i32;
+pub type c_uint = u32;
+pub type c_float = f32;
+pub type c_double = f64;
+pub type c_longlong = i64;
+pub type c_ulonglong = u64;
+pub type intmax_t = i64;
+pub type uintmax_t = u64;
+
+pub type size_t = usize;
+pub type ptrdiff_t = isize;
+pub type intptr_t = isize;
+pub type uintptr_t = usize;
+pub type ssize_t = isize;
+
+pub type off_t = i64;
+pub type c_char = u8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type wchar_t = u32;
+
+pub const INT_MIN: c_int = -2147483648;
+pub const INT_MAX: c_int = 2147483647;
+
+cfg_if! {
+    if #[cfg(libc_core_cvoid)] {
+        pub use ::ffi::c_void;
+    } else {
+        // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
+        // enable more optimization opportunities around it recognizing things
+        // like malloc/free.
+        #[repr(u8)]
+        #[allow(missing_copy_implementations)]
+        #[allow(missing_debug_implementations)]
+        pub enum c_void {
+            // Two dummy variants so the #[repr] attribute can be used.
+            #[doc(hidden)]
+            __variant1,
+            #[doc(hidden)]
+            __variant2,
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/teeos/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/teeos/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/teeos/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/teeos/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1385 @@
+//! Libc bindings for teeos
+//!
+//! Apparently the loader just dynamically links it anyway, but fails
+//! when linking is explicitly requested.
+#![allow(non_camel_case_types)]
+#![allow(non_snake_case)]
+
+// only supported on Rust > 1.59, so we can directly reexport c_void from core.
+pub use core::ffi::c_void;
+
+use Option;
+
+pub type c_schar = i8;
+
+pub type c_uchar = u8;
+
+pub type c_short = i16;
+
+pub type c_ushort = u16;
+
+pub type c_int = i32;
+
+pub type c_uint = u32;
+
+pub type c_bool = i32;
+
+pub type c_float = f32;
+
+pub type c_double = f64;
+
+pub type c_longlong = i64;
+
+pub type c_ulonglong = u64;
+
+pub type intmax_t = i64;
+
+pub type uintmax_t = u64;
+
+pub type size_t = usize;
+
+pub type ptrdiff_t = isize;
+
+pub type intptr_t = isize;
+
+pub type uintptr_t = usize;
+
+pub type ssize_t = isize;
+
+pub type pid_t = c_int;
+
+// aarch64 specifc
+pub type c_char = u8;
+
+pub type wchar_t = u32;
+
+pub type c_long = i64;
+
+pub type c_ulong = u64;
+
+#[repr(align(16))]
+pub struct _CLongDouble(pub u128);
+
+// long double in C means A float point value, which has 128bit length.
+// but some bit maybe not used, so the really length of long double could be 80(x86) or 128(power pc/IEEE)
+// this is different from f128(not stable and not included default) in Rust, so we use u128 for FFI(Rust to C).
+// this is unstable and will couse to memfault/data abort.
+pub type c_longdouble = _CLongDouble;
+
+pub type pthread_t = c_ulong;
+
+pub type pthread_key_t = c_uint;
+
+pub type pthread_spinlock_t = c_int;
+
+pub type off_t = i64;
+
+pub type time_t = c_long;
+
+pub type clock_t = c_long;
+
+pub type clockid_t = c_int;
+
+pub type suseconds_t = c_long;
+
+pub type once_fn = extern "C" fn() -> c_void;
+
+pub type pthread_once_t = c_int;
+
+pub type va_list = *mut c_char;
+
+pub type wint_t = c_uint;
+
+pub type wctype_t = c_ulong;
+
+pub type cmpfunc = extern "C" fn(x: *const c_void, y: *const c_void) -> c_int;
+
+#[repr(align(8))]
+#[repr(C)]
+pub struct pthread_cond_t {
+    #[doc(hidden)]
+    size: [u8; __SIZEOF_PTHREAD_COND_T],
+}
+
+#[repr(align(8))]
+#[repr(C)]
+pub struct pthread_mutex_t {
+    #[doc(hidden)]
+    size: [u8; __SIZEOF_PTHREAD_MUTEX_T],
+}
+
+#[repr(align(4))]
+#[repr(C)]
+pub struct pthread_mutexattr_t {
+    #[doc(hidden)]
+    size: [u8; __SIZEOF_PTHREAD_MUTEXATTR_T],
+}
+
+#[repr(align(4))]
+#[repr(C)]
+pub struct pthread_condattr_t {
+    #[doc(hidden)]
+    size: [u8; __SIZEOF_PTHREAD_CONDATTR_T],
+}
+
+#[repr(C)]
+pub struct pthread_attr_t {
+    __size: [u64; 7],
+}
+
+#[repr(C)]
+pub struct cpu_set_t {
+    bits: [c_ulong; 128 / core::mem::size_of::<c_ulong>()],
+}
+
+#[repr(C)]
+pub struct timespec {
+    pub tv_sec: time_t,
+    pub tv_nsec: c_long,
+}
+
+#[repr(C)]
+pub struct timeval {
+    pub tv_sec: time_t,
+    pub tv_usec: suseconds_t,
+}
+
+#[repr(C)]
+pub struct tm {
+    pub tm_sec: c_int,
+    pub tm_min: c_int,
+    pub tm_hour: c_int,
+    pub tm_mday: c_int,
+    pub tm_mon: c_int,
+    pub tm_year: c_int,
+    pub tm_wday: c_int,
+    pub tm_yday: c_int,
+    pub tm_isdst: c_int,
+    pub __tm_gmtoff: c_long,
+    pub __tm_zone: *const c_char,
+}
+
+#[repr(C)]
+pub struct mbstate_t {
+    pub __opaque1: c_uint,
+    pub __opaque2: c_uint,
+}
+
+#[repr(C)]
+pub struct sem_t {
+    pub __val: [c_int; 4 * core::mem::size_of::<c_long>() / core::mem::size_of::<c_int>()],
+}
+
+#[repr(C)]
+pub struct div_t {
+    pub quot: c_int,
+    pub rem: c_int,
+}
+
+// fcntl
+pub const O_CREAT: u32 = 0100;
+
+pub const O_EXCL: u32 = 0200;
+
+pub const O_NOCTTY: u32 = 0400;
+
+pub const O_TRUNC: u32 = 01000;
+
+pub const O_APPEND: u32 = 02000;
+
+pub const O_NONBLOCK: u32 = 04000;
+
+pub const O_DSYNC: u32 = 010000;
+
+pub const O_SYNC: u32 = 04010000;
+
+pub const O_RSYNC: u32 = 04010000;
+
+pub const O_DIRECTORY: u32 = 0200000;
+
+pub const O_NOFOLLOW: u32 = 0400000;
+
+pub const O_CLOEXEC: u32 = 02000000;
+
+pub const O_ASYNC: u32 = 020000;
+
+pub const O_DIRECT: u32 = 040000;
+
+pub const O_LARGEFILE: u32 = 0100000;
+
+pub const O_NOATIME: u32 = 01000000;
+
+pub const O_PATH: u32 = 010000000;
+
+pub const O_TMPFILE: u32 = 020200000;
+
+pub const O_NDELAY: u32 = O_NONBLOCK;
+
+pub const F_DUPFD: u32 = 0;
+
+pub const F_GETFD: u32 = 1;
+
+pub const F_SETFD: u32 = 2;
+
+pub const F_GETFL: u32 = 3;
+
+pub const F_SETFL: u32 = 4;
+
+pub const F_SETOWN: u32 = 8;
+
+pub const F_GETOWN: u32 = 9;
+
+pub const F_SETSIG: u32 = 10;
+
+pub const F_GETSIG: u32 = 11;
+
+pub const F_GETLK: u32 = 12;
+
+pub const F_SETLK: u32 = 13;
+
+pub const F_SETLKW: u32 = 14;
+
+pub const F_SETOWN_EX: u32 = 15;
+
+pub const F_GETOWN_EX: u32 = 16;
+
+pub const F_GETOWNER_UIDS: u32 = 17;
+
+// mman
+pub const MAP_FAILED: u64 = 0xffffffffffffffff;
+
+pub const MAP_FIXED_NOREPLACE: u32 = 0x100000;
+
+pub const MAP_SHARED_VALIDATE: u32 = 0x03;
+
+pub const MAP_SHARED: u32 = 0x01;
+
+pub const MAP_PRIVATE: u32 = 0x02;
+
+pub const MAP_TYPE: u32 = 0x0f;
+
+pub const MAP_FIXED: u32 = 0x10;
+
+pub const MAP_ANON: u32 = 0x20;
+
+pub const MAP_ANONYMOUS: u32 = MAP_ANON;
+
+pub const MAP_NORESERVE: u32 = 0x4000;
+
+pub const MAP_GROWSDOWN: u32 = 0x0100;
+
+pub const MAP_DENYWRITE: u32 = 0x0800;
+
+pub const MAP_EXECUTABLE: u32 = 0x1000;
+
+pub const MAP_LOCKED: u32 = 0x2000;
+
+pub const MAP_POPULATE: u32 = 0x8000;
+
+pub const MAP_NONBLOCK: u32 = 0x10000;
+
+pub const MAP_STACK: u32 = 0x20000;
+
+pub const MAP_HUGETLB: u32 = 0x40000;
+
+pub const MAP_SYNC: u32 = 0x80000;
+
+pub const MAP_FILE: u32 = 0;
+
+pub const MAP_HUGE_SHIFT: u32 = 26;
+
+pub const MAP_HUGE_MASK: u32 = 0x3f;
+
+pub const MAP_HUGE_16KB: u32 = 14 << 26;
+
+pub const MAP_HUGE_64KB: u32 = 16 << 26;
+
+pub const MAP_HUGE_512KB: u32 = 19 << 26;
+
+pub const MAP_HUGE_1MB: u32 = 20 << 26;
+
+pub const MAP_HUGE_2MB: u32 = 21 << 26;
+
+pub const MAP_HUGE_8MB: u32 = 23 << 26;
+
+pub const MAP_HUGE_16MB: u32 = 24 << 26;
+
+pub const MAP_HUGE_32MB: u32 = 25 << 26;
+
+pub const MAP_HUGE_256MB: u32 = 28 << 26;
+
+pub const MAP_HUGE_512MB: u32 = 29 << 26;
+
+pub const MAP_HUGE_1GB: u32 = 30 << 26;
+
+pub const MAP_HUGE_2GB: u32 = 31 << 26;
+
+pub const MAP_HUGE_16GB: u32 = 34u32 << 26;
+
+pub const PROT_NONE: u32 = 0;
+
+pub const PROT_READ: u32 = 1;
+
+pub const PROT_WRITE: u32 = 2;
+
+pub const PROT_EXEC: u32 = 4;
+
+pub const PROT_GROWSDOWN: u32 = 0x01000000;
+
+pub const PROT_GROWSUP: u32 = 0x02000000;
+
+pub const MS_ASYNC: u32 = 1;
+
+pub const MS_INVALIDATE: u32 = 2;
+
+pub const MS_SYNC: u32 = 4;
+
+pub const MCL_CURRENT: u32 = 1;
+
+pub const MCL_FUTURE: u32 = 2;
+
+pub const MCL_ONFAULT: u32 = 4;
+
+pub const POSIX_MADV_NORMAL: u32 = 0;
+
+pub const POSIX_MADV_RANDOM: u32 = 1;
+
+pub const POSIX_MADV_SEQUENTIAL: u32 = 2;
+
+pub const POSIX_MADV_WILLNEED: u32 = 3;
+
+pub const POSIX_MADV_DONTNEED: u32 = 4;
+
+// wctype
+pub const WCTYPE_ALNUM: u64 = 1;
+
+pub const WCTYPE_ALPHA: u64 = 2;
+
+pub const WCTYPE_BLANK: u64 = 3;
+
+pub const WCTYPE_CNTRL: u64 = 4;
+
+pub const WCTYPE_DIGIT: u64 = 5;
+
+pub const WCTYPE_GRAPH: u64 = 6;
+
+pub const WCTYPE_LOWER: u64 = 7;
+
+pub const WCTYPE_PRINT: u64 = 8;
+
+pub const WCTYPE_PUNCT: u64 = 9;
+
+pub const WCTYPE_SPACE: u64 = 10;
+
+pub const WCTYPE_UPPER: u64 = 11;
+
+pub const WCTYPE_XDIGIT: u64 = 12;
+
+// locale
+pub const LC_CTYPE: i32 = 0;
+
+pub const LC_NUMERIC: i32 = 1;
+
+pub const LC_TIME: i32 = 2;
+
+pub const LC_COLLATE: i32 = 3;
+
+pub const LC_MONETARY: i32 = 4;
+
+pub const LC_MESSAGES: i32 = 5;
+
+pub const LC_ALL: i32 = 6;
+
+// pthread
+pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
+
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+
+// errno.h
+pub const EPERM: c_int = 1;
+
+pub const ENOENT: c_int = 2;
+
+pub const ESRCH: c_int = 3;
+
+pub const EINTR: c_int = 4;
+
+pub const EIO: c_int = 5;
+
+pub const ENXIO: c_int = 6;
+
+pub const E2BIG: c_int = 7;
+
+pub const ENOEXEC: c_int = 8;
+
+pub const EBADF: c_int = 9;
+
+pub const ECHILD: c_int = 10;
+
+pub const EAGAIN: c_int = 11;
+
+pub const ENOMEM: c_int = 12;
+
+pub const EACCES: c_int = 13;
+
+pub const EFAULT: c_int = 14;
+
+pub const ENOTBLK: c_int = 15;
+
+pub const EBUSY: c_int = 16;
+
+pub const EEXIST: c_int = 17;
+
+pub const EXDEV: c_int = 18;
+
+pub const ENODEV: c_int = 19;
+
+pub const ENOTDIR: c_int = 20;
+
+pub const EISDIR: c_int = 21;
+
+pub const EINVAL: c_int = 22;
+
+pub const ENFILE: c_int = 23;
+
+pub const EMFILE: c_int = 24;
+
+pub const ENOTTY: c_int = 25;
+
+pub const ETXTBSY: c_int = 26;
+
+pub const EFBIG: c_int = 27;
+
+pub const ENOSPC: c_int = 28;
+
+pub const ESPIPE: c_int = 29;
+
+pub const EROFS: c_int = 30;
+
+pub const EMLINK: c_int = 31;
+
+pub const EPIPE: c_int = 32;
+
+pub const EDOM: c_int = 33;
+
+pub const ERANGE: c_int = 34;
+
+pub const EDEADLK: c_int = 35;
+
+pub const ENAMETOOLONG: c_int = 36;
+
+pub const ENOLCK: c_int = 37;
+
+pub const ENOSYS: c_int = 38;
+
+pub const ENOTEMPTY: c_int = 39;
+
+pub const ELOOP: c_int = 40;
+
+pub const EWOULDBLOCK: c_int = EAGAIN;
+
+pub const ENOMSG: c_int = 42;
+
+pub const EIDRM: c_int = 43;
+
+pub const ECHRNG: c_int = 44;
+
+pub const EL2NSYNC: c_int = 45;
+
+pub const EL3HLT: c_int = 46;
+
+pub const EL3RST: c_int = 47;
+
+pub const ELNRNG: c_int = 48;
+
+pub const EUNATCH: c_int = 49;
+
+pub const ENOCSI: c_int = 50;
+
+pub const EL2HLT: c_int = 51;
+
+pub const EBADE: c_int = 52;
+
+pub const EBADR: c_int = 53;
+
+pub const EXFULL: c_int = 54;
+
+pub const ENOANO: c_int = 55;
+
+pub const EBADRQC: c_int = 56;
+
+pub const EBADSLT: c_int = 57;
+
+pub const EDEADLOCK: c_int = EDEADLK;
+
+pub const EBFONT: c_int = 59;
+
+pub const ENOSTR: c_int = 60;
+
+pub const ENODATA: c_int = 61;
+
+pub const ETIME: c_int = 62;
+
+pub const ENOSR: c_int = 63;
+
+pub const ENONET: c_int = 64;
+
+pub const ENOPKG: c_int = 65;
+
+pub const EREMOTE: c_int = 66;
+
+pub const ENOLINK: c_int = 67;
+
+pub const EADV: c_int = 68;
+
+pub const ESRMNT: c_int = 69;
+
+pub const ECOMM: c_int = 70;
+
+pub const EPROTO: c_int = 71;
+
+pub const EMULTIHOP: c_int = 72;
+
+pub const EDOTDOT: c_int = 73;
+
+pub const EBADMSG: c_int = 74;
+
+pub const EOVERFLOW: c_int = 75;
+
+pub const ENOTUNIQ: c_int = 76;
+
+pub const EBADFD: c_int = 77;
+
+pub const EREMCHG: c_int = 78;
+
+pub const ELIBACC: c_int = 79;
+
+pub const ELIBBAD: c_int = 80;
+
+pub const ELIBSCN: c_int = 81;
+
+pub const ELIBMAX: c_int = 82;
+
+pub const ELIBEXEC: c_int = 83;
+
+pub const EILSEQ: c_int = 84;
+
+pub const ERESTART: c_int = 85;
+
+pub const ESTRPIPE: c_int = 86;
+
+pub const EUSERS: c_int = 87;
+
+pub const ENOTSOCK: c_int = 88;
+
+pub const EDESTADDRREQ: c_int = 89;
+
+pub const EMSGSIZE: c_int = 90;
+
+pub const EPROTOTYPE: c_int = 91;
+
+pub const ENOPROTOOPT: c_int = 92;
+
+pub const EPROTONOSUPPOR: c_int = 93;
+
+pub const ESOCKTNOSUPPOR: c_int = 94;
+
+pub const EOPNOTSUPP: c_int = 95;
+
+pub const ENOTSUP: c_int = EOPNOTSUPP;
+
+pub const EPFNOSUPPORT: c_int = 96;
+
+pub const EAFNOSUPPORT: c_int = 97;
+
+pub const EADDRINUSE: c_int = 98;
+
+pub const EADDRNOTAVAIL: c_int = 99;
+
+pub const ENETDOWN: c_int = 100;
+
+pub const ENETUNREACH: c_int = 101;
+
+pub const ENETRESET: c_int = 102;
+
+pub const ECONNABORTED: c_int = 103;
+
+pub const ECONNRESET: c_int = 104;
+
+pub const ENOBUFS: c_int = 105;
+
+pub const EISCONN: c_int = 106;
+
+pub const ENOTCONN: c_int = 107;
+
+pub const ESHUTDOWN: c_int = 108;
+
+pub const ETOOMANYREFS: c_int = 109;
+
+pub const ETIMEDOUT: c_int = 110;
+
+pub const ECONNREFUSED: c_int = 111;
+
+pub const EHOSTDOWN: c_int = 112;
+
+pub const EHOSTUNREACH: c_int = 113;
+
+pub const EALREADY: c_int = 114;
+
+pub const EINPROGRESS: c_int = 115;
+
+pub const ESTALE: c_int = 116;
+
+pub const EUCLEAN: c_int = 117;
+
+pub const ENOTNAM: c_int = 118;
+
+pub const ENAVAIL: c_int = 119;
+
+pub const EISNAM: c_int = 120;
+
+pub const EREMOTEIO: c_int = 121;
+
+pub const EDQUOT: c_int = 122;
+
+pub const ENOMEDIUM: c_int = 123;
+
+pub const EMEDIUMTYPE: c_int = 124;
+
+pub const ECANCELED: c_int = 125;
+
+pub const ENOKEY: c_int = 126;
+
+pub const EKEYEXPIRED: c_int = 127;
+
+pub const EKEYREVOKED: c_int = 128;
+
+pub const EKEYREJECTED: c_int = 129;
+
+pub const EOWNERDEAD: c_int = 130;
+
+pub const ENOTRECOVERABLE: c_int = 131;
+
+pub const ERFKILL: c_int = 132;
+
+pub const EHWPOISON: c_int = 133;
+
+// pthread_attr.h
+pub const TEESMP_THREAD_ATTR_CA_WILDCARD: c_int = 0;
+
+pub const TEESMP_THREAD_ATTR_CA_INHERIT: c_int = -1;
+
+pub const TEESMP_THREAD_ATTR_TASK_ID_INHERIT: c_int = -1;
+
+pub const TEESMP_THREAD_ATTR_HAS_SHADOW: c_int = 0x1;
+
+pub const TEESMP_THREAD_ATTR_NO_SHADOW: c_int = 0x0;
+
+// unistd.h
+pub const _SC_ARG_MAX: c_int = 0;
+
+pub const _SC_CHILD_MAX: c_int = 1;
+
+pub const _SC_CLK_TCK: c_int = 2;
+
+pub const _SC_NGROUPS_MAX: c_int = 3;
+
+pub const _SC_OPEN_MAX: c_int = 4;
+
+pub const _SC_STREAM_MAX: c_int = 5;
+
+pub const _SC_TZNAME_MAX: c_int = 6;
+
+pub const _SC_JOB_CONTROL: c_int = 7;
+
+pub const _SC_SAVED_IDS: c_int = 8;
+
+pub const _SC_REALTIME_SIGNALS: c_int = 9;
+
+pub const _SC_PRIORITY_SCHEDULING: c_int = 10;
+
+pub const _SC_TIMERS: c_int = 11;
+
+pub const _SC_ASYNCHRONOUS_IO: c_int = 12;
+
+pub const _SC_PRIORITIZED_IO: c_int = 13;
+
+pub const _SC_SYNCHRONIZED_IO: c_int = 14;
+
+pub const _SC_FSYNC: c_int = 15;
+
+pub const _SC_MAPPED_FILES: c_int = 16;
+
+pub const _SC_MEMLOCK: c_int = 17;
+
+pub const _SC_MEMLOCK_RANGE: c_int = 18;
+
+pub const _SC_MEMORY_PROTECTION: c_int = 19;
+
+pub const _SC_MESSAGE_PASSING: c_int = 20;
+
+pub const _SC_SEMAPHORES: c_int = 21;
+
+pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 22;
+
+pub const _SC_AIO_LISTIO_MAX: c_int = 23;
+
+pub const _SC_AIO_MAX: c_int = 24;
+
+pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 25;
+
+pub const _SC_DELAYTIMER_MAX: c_int = 26;
+
+pub const _SC_MQ_OPEN_MAX: c_int = 27;
+
+pub const _SC_MQ_PRIO_MAX: c_int = 28;
+
+pub const _SC_VERSION: c_int = 29;
+
+pub const _SC_PAGE_SIZE: c_int = 30;
+
+pub const _SC_PAGESIZE: c_int = 30; /* !! */
+
+pub const _SC_RTSIG_MAX: c_int = 31;
+
+pub const _SC_SEM_NSEMS_MAX: c_int = 32;
+
+pub const _SC_SEM_VALUE_MAX: c_int = 33;
+
+pub const _SC_SIGQUEUE_MAX: c_int = 34;
+
+pub const _SC_TIMER_MAX: c_int = 35;
+
+pub const _SC_BC_BASE_MAX: c_int = 36;
+
+pub const _SC_BC_DIM_MAX: c_int = 37;
+
+pub const _SC_BC_SCALE_MAX: c_int = 38;
+
+pub const _SC_BC_STRING_MAX: c_int = 39;
+
+pub const _SC_COLL_WEIGHTS_MAX: c_int = 40;
+
+pub const _SC_EXPR_NEST_MAX: c_int = 42;
+
+pub const _SC_LINE_MAX: c_int = 43;
+
+pub const _SC_RE_DUP_MAX: c_int = 44;
+
+pub const _SC_2_VERSION: c_int = 46;
+
+pub const _SC_2_C_BIND: c_int = 47;
+
+pub const _SC_2_C_DEV: c_int = 48;
+
+pub const _SC_2_FORT_DEV: c_int = 49;
+
+pub const _SC_2_FORT_RUN: c_int = 50;
+
+pub const _SC_2_SW_DEV: c_int = 51;
+
+pub const _SC_2_LOCALEDEF: c_int = 52;
+
+pub const _SC_UIO_MAXIOV: c_int = 60; /* !! */
+
+pub const _SC_IOV_MAX: c_int = 60;
+
+pub const _SC_THREADS: c_int = 67;
+
+pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 68;
+
+pub const _SC_GETGR_R_SIZE_MAX: c_int = 69;
+
+pub const _SC_GETPW_R_SIZE_MAX: c_int = 70;
+
+pub const _SC_LOGIN_NAME_MAX: c_int = 71;
+
+pub const _SC_TTY_NAME_MAX: c_int = 72;
+
+pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 73;
+
+pub const _SC_THREAD_KEYS_MAX: c_int = 74;
+
+pub const _SC_THREAD_STACK_MIN: c_int = 75;
+
+pub const _SC_THREAD_THREADS_MAX: c_int = 76;
+
+pub const _SC_THREAD_ATTR_STACKADDR: c_int = 77;
+
+pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 78;
+
+pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 79;
+
+pub const _SC_THREAD_PRIO_INHERIT: c_int = 80;
+
+pub const _SC_THREAD_PRIO_PROTECT: c_int = 81;
+
+pub const _SC_THREAD_PROCESS_SHARED: c_int = 82;
+
+pub const _SC_NPROCESSORS_CONF: c_int = 83;
+
+pub const _SC_NPROCESSORS_ONLN: c_int = 84;
+
+pub const _SC_PHYS_PAGES: c_int = 85;
+
+pub const _SC_AVPHYS_PAGES: c_int = 86;
+
+pub const _SC_ATEXIT_MAX: c_int = 87;
+
+pub const _SC_PASS_MAX: c_int = 88;
+
+pub const _SC_XOPEN_VERSION: c_int = 89;
+
+pub const _SC_XOPEN_XCU_VERSION: c_int = 90;
+
+pub const _SC_XOPEN_UNIX: c_int = 91;
+
+pub const _SC_XOPEN_CRYPT: c_int = 92;
+
+pub const _SC_XOPEN_ENH_I18N: c_int = 93;
+
+pub const _SC_XOPEN_SHM: c_int = 94;
+
+pub const _SC_2_CHAR_TERM: c_int = 95;
+
+pub const _SC_2_UPE: c_int = 97;
+
+pub const _SC_XOPEN_XPG2: c_int = 98;
+
+pub const _SC_XOPEN_XPG3: c_int = 99;
+
+pub const _SC_XOPEN_XPG4: c_int = 100;
+
+pub const _SC_NZERO: c_int = 109;
+
+pub const _SC_XBS5_ILP32_OFF32: c_int = 125;
+
+pub const _SC_XBS5_ILP32_OFFBIG: c_int = 126;
+
+pub const _SC_XBS5_LP64_OFF64: c_int = 127;
+
+pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 128;
+
+pub const _SC_XOPEN_LEGACY: c_int = 129;
+
+pub const _SC_XOPEN_REALTIME: c_int = 130;
+
+pub const _SC_XOPEN_REALTIME_THREADS: c_int = 131;
+
+pub const _SC_ADVISORY_INFO: c_int = 132;
+
+pub const _SC_BARRIERS: c_int = 133;
+
+pub const _SC_CLOCK_SELECTION: c_int = 137;
+
+pub const _SC_CPUTIME: c_int = 138;
+
+pub const _SC_THREAD_CPUTIME: c_int = 139;
+
+pub const _SC_MONOTONIC_CLOCK: c_int = 149;
+
+pub const _SC_READER_WRITER_LOCKS: c_int = 153;
+
+pub const _SC_SPIN_LOCKS: c_int = 154;
+
+pub const _SC_REGEXP: c_int = 155;
+
+pub const _SC_SHELL: c_int = 157;
+
+pub const _SC_SPAWN: c_int = 159;
+
+pub const _SC_SPORADIC_SERVER: c_int = 160;
+
+pub const _SC_THREAD_SPORADIC_SERVER: c_int = 161;
+
+pub const _SC_TIMEOUTS: c_int = 164;
+
+pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 165;
+
+pub const _SC_2_PBS: c_int = 168;
+
+pub const _SC_2_PBS_ACCOUNTING: c_int = 169;
+
+pub const _SC_2_PBS_LOCATE: c_int = 170;
+
+pub const _SC_2_PBS_MESSAGE: c_int = 171;
+
+pub const _SC_2_PBS_TRACK: c_int = 172;
+
+pub const _SC_SYMLOOP_MAX: c_int = 173;
+
+pub const _SC_STREAMS: c_int = 174;
+
+pub const _SC_2_PBS_CHECKPOINT: c_int = 175;
+
+pub const _SC_V6_ILP32_OFF32: c_int = 176;
+
+pub const _SC_V6_ILP32_OFFBIG: c_int = 177;
+
+pub const _SC_V6_LP64_OFF64: c_int = 178;
+
+pub const _SC_V6_LPBIG_OFFBIG: c_int = 179;
+
+pub const _SC_HOST_NAME_MAX: c_int = 180;
+
+pub const _SC_TRACE: c_int = 181;
+
+pub const _SC_TRACE_EVENT_FILTER: c_int = 182;
+
+pub const _SC_TRACE_INHERIT: c_int = 183;
+
+pub const _SC_TRACE_LOG: c_int = 184;
+
+pub const _SC_IPV6: c_int = 235;
+
+pub const _SC_RAW_SOCKETS: c_int = 236;
+
+pub const _SC_V7_ILP32_OFF32: c_int = 237;
+
+pub const _SC_V7_ILP32_OFFBIG: c_int = 238;
+
+pub const _SC_V7_LP64_OFF64: c_int = 239;
+
+pub const _SC_V7_LPBIG_OFFBIG: c_int = 240;
+
+pub const _SC_SS_REPL_MAX: c_int = 241;
+
+pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 242;
+
+pub const _SC_TRACE_NAME_MAX: c_int = 243;
+
+pub const _SC_TRACE_SYS_MAX: c_int = 244;
+
+pub const _SC_TRACE_USER_EVENT_MAX: c_int = 245;
+
+pub const _SC_XOPEN_STREAMS: c_int = 246;
+
+pub const _SC_THREAD_ROBUST_PRIO_INHERIT: c_int = 247;
+
+pub const _SC_THREAD_ROBUST_PRIO_PROTECT: c_int = 248;
+
+// limits.h
+pub const PTHREAD_KEYS_MAX: c_int = 128;
+
+pub const PTHREAD_STACK_MIN: c_int = 2048;
+
+pub const PTHREAD_DESTRUCTOR_ITERATIONS: c_int = 4;
+
+pub const SEM_VALUE_MAX: c_int = 0x7fffffff;
+
+pub const SEM_NSEMS_MAX: c_int = 256;
+
+pub const DELAYTIMER_MAX: c_int = 0x7fffffff;
+
+pub const MQ_PRIO_MAX: c_int = 32768;
+
+pub const LOGIN_NAME_MAX: c_int = 256;
+
+// time.h
+pub const CLOCK_REALTIME: clockid_t = 0;
+
+pub const CLOCK_MONOTONIC: clockid_t = 1;
+
+pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+    size: [0; __SIZEOF_PTHREAD_MUTEX_T],
+};
+
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+    size: [0; __SIZEOF_PTHREAD_COND_T],
+};
+
+pub const PTHREAD_MUTEX_NORMAL: c_int = 0;
+
+pub const PTHREAD_MUTEX_RECURSIVE: c_int = 1;
+
+pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 2;
+
+pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_NORMAL;
+
+pub const PTHREAD_MUTEX_STALLED: c_int = 0;
+
+pub const PTHREAD_MUTEX_ROBUST: c_int = 1;
+
+extern "C" {
+    // ---- ALLOC -----------------------------------------------------------------------------
+    pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
+
+    pub fn malloc(size: size_t) -> *mut c_void;
+
+    pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
+
+    pub fn aligned_alloc(align: size_t, len: size_t) -> *mut c_void;
+
+    pub fn free(p: *mut c_void);
+
+    pub fn posix_memalign(memptr: *mut *mut c_void, align: size_t, size: size_t) -> c_int;
+
+    pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
+
+    pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t;
+
+    pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
+
+    pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
+
+    pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
+
+    pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
+
+    // ----- PTHREAD ---------------------------------------------------------------------------
+    pub fn pthread_self() -> pthread_t;
+
+    pub fn pthread_join(native: pthread_t, value: *mut *mut c_void) -> c_int;
+
+    // detach or pthread_attr_setdetachstate must not be called!
+    //pub fn pthread_detach(thread: pthread_t) -> c_int;
+
+    pub fn pthread_exit(value: *mut c_void) -> !;
+
+    pub fn pthread_attr_init(attr: *mut pthread_attr_t) -> c_int;
+
+    pub fn pthread_attr_destroy(attr: *mut pthread_attr_t) -> c_int;
+
+    pub fn pthread_attr_getstack(
+        attr: *const pthread_attr_t,
+        stackaddr: *mut *mut c_void,
+        stacksize: *mut size_t,
+    ) -> c_int;
+
+    pub fn pthread_attr_setstacksize(attr: *mut pthread_attr_t, stack_size: size_t) -> c_int;
+
+    pub fn pthread_attr_getstacksize(attr: *const pthread_attr_t, size: *mut size_t) -> c_int;
+
+    pub fn pthread_attr_settee(
+        attr: *mut pthread_attr_t,
+        ca: c_int,
+        task_id: c_int,
+        shadow: c_int,
+    ) -> c_int;
+
+    // C-TA API do not include this interface, but TA can use.
+    pub fn sched_yield() -> c_int;
+
+    pub fn pthread_key_create(
+        key: *mut pthread_key_t,
+        dtor: Option<unsafe extern "C" fn(*mut c_void)>,
+    ) -> c_int;
+
+    pub fn pthread_key_delete(key: pthread_key_t) -> c_int;
+
+    pub fn pthread_getspecific(key: pthread_key_t) -> *mut c_void;
+
+    pub fn pthread_setspecific(key: pthread_key_t, value: *const c_void) -> c_int;
+
+    pub fn pthread_mutex_destroy(lock: *mut pthread_mutex_t) -> c_int;
+
+    pub fn pthread_mutex_init(
+        lock: *mut pthread_mutex_t,
+        attr: *const pthread_mutexattr_t,
+    ) -> c_int;
+
+    pub fn pthread_mutex_lock(lock: *mut pthread_mutex_t) -> c_int;
+
+    pub fn pthread_mutex_trylock(lock: *mut pthread_mutex_t) -> c_int;
+
+    pub fn pthread_mutex_unlock(lock: *mut pthread_mutex_t) -> c_int;
+
+    pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> c_int;
+
+    pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> c_int;
+
+    pub fn pthread_mutexattr_settype(attr: *mut pthread_mutexattr_t, _type: c_int) -> c_int;
+
+    pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, pshared: c_int) -> c_int;
+
+    pub fn pthread_cond_broadcast(cond: *mut pthread_cond_t) -> c_int;
+
+    pub fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> c_int;
+
+    pub fn pthread_cond_init(cond: *mut pthread_cond_t, attr: *const pthread_condattr_t) -> c_int;
+
+    pub fn pthread_cond_signal(cond: *mut pthread_cond_t) -> c_int;
+
+    pub fn pthread_cond_wait(cond: *mut pthread_cond_t, lock: *mut pthread_mutex_t) -> c_int;
+
+    pub fn pthread_cond_timedwait(
+        cond: *mut pthread_cond_t,
+        lock: *mut pthread_mutex_t,
+        abstime: *const ::timespec,
+    ) -> ::c_int;
+
+    pub fn pthread_mutexattr_setrobust(attr: *mut pthread_mutexattr_t, robustness: c_int) -> c_int;
+
+    pub fn pthread_create(
+        native: *mut pthread_t,
+        attr: *const pthread_attr_t,
+        f: extern "C" fn(*mut c_void) -> *mut c_void,
+        value: *mut c_void,
+    ) -> c_int;
+
+    pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: c_int) -> c_int;
+
+    pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> c_int;
+
+    pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> c_int;
+
+    pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> c_int;
+
+    pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> c_int;
+
+    pub fn pthread_setschedprio(native: pthread_t, priority: c_int) -> c_int;
+
+    pub fn pthread_once(pot: *mut pthread_once_t, f: Option<once_fn>) -> c_int;
+
+    pub fn pthread_equal(p1: pthread_t, p2: pthread_t) -> c_int;
+
+    pub fn pthread_mutexattr_setprotocol(a: *mut pthread_mutexattr_t, protocol: c_int) -> c_int;
+
+    pub fn pthread_attr_setstack(
+        attr: *mut pthread_attr_t,
+        stack: *mut c_void,
+        size: size_t,
+    ) -> c_int;
+
+    pub fn pthread_setaffinity_np(td: pthread_t, size: size_t, set: *const cpu_set_t) -> c_int;
+
+    pub fn pthread_getaffinity_np(td: pthread_t, size: size_t, set: *mut cpu_set_t) -> c_int;
+
+    // stdio.h
+    pub fn printf(fmt: *const c_char, ...) -> c_int;
+
+    pub fn scanf(fmt: *const c_char, ...) -> c_int;
+
+    pub fn snprintf(s: *mut c_char, n: size_t, fmt: *const c_char, ...) -> c_int;
+
+    pub fn sprintf(s: *mut c_char, fmt: *const c_char, ...) -> c_int;
+
+    pub fn vsnprintf(s: *mut c_char, n: size_t, fmt: *const c_char, ap: va_list) -> c_int;
+
+    pub fn vsprintf(s: *mut c_char, fmt: *const c_char, ap: va_list) -> c_int;
+
+    // Not available.
+    //pub fn pthread_setname_np(thread: pthread_t, name: *const c_char) -> c_int;
+
+    pub fn abort() -> !;
+
+    // Not available.
+    //pub fn prctl(op: c_int, ...) -> c_int;
+
+    pub fn sched_getaffinity(pid: pid_t, cpusetsize: size_t, cpuset: *mut cpu_set_t) -> c_int;
+
+    pub fn sched_setaffinity(pid: pid_t, cpusetsize: size_t, cpuset: *const cpu_set_t) -> c_int;
+
+    // sysconf is currently only implemented as a stub.
+    pub fn sysconf(name: c_int) -> c_long;
+
+    // mman.h
+    pub fn mmap(
+        addr: *mut c_void,
+        len: size_t,
+        prot: c_int,
+        flags: c_int,
+        fd: c_int,
+        offset: off_t,
+    ) -> *mut c_void;
+    pub fn munmap(addr: *mut c_void, len: size_t) -> c_int;
+
+    // errno.h
+    pub fn __errno_location() -> *mut c_int;
+
+    pub fn strerror(e: c_int) -> *mut c_char;
+
+    // time.h
+    pub fn clock_gettime(clock_id: clockid_t, tp: *mut timespec) -> c_int;
+
+    // unistd
+    pub fn getpid() -> pid_t;
+
+    // time
+    pub fn gettimeofday(tv: *mut timeval, tz: *mut c_void) -> c_int;
+
+    pub fn strftime(
+        restrict: *mut c_char,
+        sz: size_t,
+        _restrict: *const c_char,
+        __restrict: *const tm,
+    ) -> size_t;
+
+    pub fn time(t: *mut time_t) -> time_t;
+
+    // sem
+    pub fn sem_close(sem: *mut sem_t) -> c_int;
+
+    pub fn sem_destroy(sem: *mut sem_t) -> c_int;
+
+    pub fn sem_getvalue(sem: *mut sem_t, valp: *mut c_int) -> c_int;
+
+    pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int;
+
+    pub fn sem_open(name: *const c_char, flags: c_int, ...) -> *mut sem_t;
+
+    pub fn sem_post(sem: *mut sem_t) -> c_int;
+
+    pub fn sem_unlink(name: *const c_char) -> c_int;
+
+    pub fn sem_wait(sem: *mut sem_t) -> c_int;
+
+    // locale
+    pub fn setlocale(cat: c_int, name: *const c_char) -> *mut c_char;
+
+    pub fn strcoll(l: *const c_char, r: *const c_char) -> c_int;
+
+    pub fn strxfrm(dest: *mut c_char, src: *const c_char, n: size_t) -> size_t;
+
+    pub fn strtod(s: *const c_char, p: *mut *mut c_char) -> c_double;
+
+    // multibyte
+    pub fn mbrtowc(wc: *mut wchar_t, src: *const c_char, n: size_t, st: *mut mbstate_t) -> size_t;
+
+    pub fn wcrtomb(s: *mut c_char, wc: wchar_t, st: *mut mbstate_t) -> size_t;
+
+    pub fn wctob(c: wint_t) -> c_int;
+
+    // prng
+    pub fn srandom(seed: c_uint);
+
+    pub fn initstate(seed: c_uint, state: *mut c_char, size: size_t) -> *mut c_char;
+
+    pub fn setstate(state: *mut c_char) -> *mut c_char;
+
+    pub fn random() -> c_long;
+
+    // string
+    pub fn strchr(s: *const c_char, c: c_int) -> *mut c_char;
+
+    pub fn strlen(cs: *const c_char) -> size_t;
+
+    pub fn strcmp(l: *const c_char, r: *const c_char) -> c_int;
+
+    pub fn strcpy(dest: *mut c_char, src: *const c_char) -> *mut c_char;
+
+    pub fn strncmp(_l: *const c_char, r: *const c_char, n: size_t) -> c_int;
+
+    pub fn strncpy(dest: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
+
+    pub fn strnlen(cs: *const c_char, n: size_t) -> size_t;
+
+    pub fn strrchr(s: *const c_char, c: c_int) -> *mut c_char;
+
+    pub fn strstr(h: *const c_char, n: *const c_char) -> *mut c_char;
+
+    pub fn wcschr(s: *const wchar_t, c: wchar_t) -> *mut wchar_t;
+
+    pub fn wcslen(s: *const wchar_t) -> size_t;
+
+    // ctype
+    pub fn isalpha(c: c_int) -> c_int;
+
+    pub fn isascii(c: c_int) -> c_int;
+
+    pub fn isdigit(c: c_int) -> c_int;
+
+    pub fn islower(c: c_int) -> c_int;
+
+    pub fn isprint(c: c_int) -> c_int;
+
+    pub fn isspace(c: c_int) -> c_int;
+
+    pub fn iswctype(wc: wint_t, ttype: wctype_t) -> c_int;
+
+    pub fn iswdigit(wc: wint_t) -> c_int;
+
+    pub fn iswlower(wc: wint_t) -> c_int;
+
+    pub fn iswspace(wc: wint_t) -> c_int;
+
+    pub fn iswupper(wc: wint_t) -> c_int;
+
+    pub fn towupper(wc: wint_t) -> wint_t;
+
+    pub fn towlower(wc: wint_t) -> wint_t;
+
+    // cmath
+    pub fn atan(x: c_double) -> c_double;
+
+    pub fn ceil(x: c_double) -> c_double;
+
+    pub fn ceilf(x: c_float) -> c_float;
+
+    pub fn exp(x: c_double) -> c_double;
+
+    pub fn fabs(x: c_double) -> c_double;
+
+    pub fn floor(x: c_double) -> c_double;
+
+    pub fn frexp(x: c_double, e: *mut c_int) -> c_double;
+
+    pub fn log(x: c_double) -> c_double;
+
+    pub fn log2(x: c_double) -> c_double;
+
+    pub fn pow(x: c_double, y: c_double) -> c_double;
+
+    pub fn roundf(x: c_float) -> c_float;
+
+    pub fn scalbn(x: c_double, n: c_int) -> c_double;
+
+    pub fn sqrt(x: c_double) -> c_double;
+
+    // stdlib
+    pub fn abs(x: c_int) -> c_int;
+
+    pub fn atof(s: *const c_char) -> c_double;
+
+    pub fn atoi(s: *const c_char) -> c_int;
+
+    pub fn atol(s: *const c_char) -> c_long;
+
+    pub fn atoll(s: *const c_char) -> c_longlong;
+
+    pub fn bsearch(
+        key: *const c_void,
+        base: *const c_void,
+        nel: size_t,
+        width: size_t,
+        cmp: cmpfunc,
+    ) -> *mut c_void;
+
+    pub fn div(num: c_int, den: c_int) -> div_t;
+
+    pub fn ecvt(x: c_double, n: c_int, dp: *mut c_int, sign: *mut c_int) -> *mut c_char;
+
+    pub fn imaxabs(a: intmax_t) -> intmax_t;
+
+    pub fn llabs(a: c_longlong) -> c_longlong;
+
+    pub fn qsort(base: *mut c_void, nel: size_t, width: size_t, cmp: cmpfunc);
+
+    pub fn strtoul(s: *const c_char, p: *mut *mut c_char, base: c_int) -> c_ulong;
+
+    pub fn strtol(s: *const c_char, p: *mut *mut c_char, base: c_int) -> c_long;
+
+    pub fn wcstod(s: *const wchar_t, p: *mut *mut wchar_t) -> c_double;
+}
+
+pub fn errno() -> c_int {
+    unsafe { *__errno_location() }
+}
+
+pub fn CPU_COUNT_S(size: usize, cpuset: &cpu_set_t) -> c_int {
+    let mut s: u32 = 0;
+    let size_of_mask = core::mem::size_of_val(&cpuset.bits[0]);
+
+    for i in cpuset.bits[..(size / size_of_mask)].iter() {
+        s += i.count_ones();
+    }
+    s as c_int
+}
+
+pub fn CPU_COUNT(cpuset: &cpu_set_t) -> c_int {
+    CPU_COUNT_S(core::mem::size_of::<cpu_set_t>(), cpuset)
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/aix/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/aix/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/aix/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/aix/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,3362 @@
+pub type c_char = u8;
+pub type caddr_t = *mut ::c_char;
+pub type clockid_t = ::c_longlong;
+pub type blkcnt_t = ::c_long;
+pub type clock_t = ::c_int;
+pub type daddr_t = ::c_long;
+pub type dev_t = ::c_ulong;
+pub type fpos64_t = ::c_longlong;
+pub type fsblkcnt_t = ::c_ulong;
+pub type fsfilcnt_t = ::c_ulong;
+pub type idtype_t = ::c_int;
+pub type ino_t = ::c_ulong;
+pub type key_t = ::c_int;
+pub type mode_t = ::c_uint;
+pub type nlink_t = ::c_short;
+pub type rlim_t = ::c_ulong;
+pub type speed_t = ::c_uint;
+pub type tcflag_t = ::c_uint;
+pub type time_t = ::c_long;
+pub type time64_t = ::int64_t;
+pub type timer_t = ::c_long;
+pub type wchar_t = ::c_uint;
+pub type nfds_t = ::c_int;
+pub type projid_t = ::c_int;
+pub type id_t = ::c_uint;
+pub type blksize64_t = ::c_ulonglong;
+pub type blkcnt64_t = ::c_ulonglong;
+pub type sctp_assoc_t = ::uint32_t;
+
+pub type suseconds_t = ::c_int;
+pub type useconds_t = ::c_uint;
+pub type off_t = ::c_long;
+pub type off64_t = ::c_longlong;
+
+pub type socklen_t = ::c_uint;
+pub type sa_family_t = ::c_uchar;
+pub type in_port_t = ::c_ushort;
+pub type in_addr_t = ::c_uint;
+
+pub type signal_t = ::c_int;
+pub type pthread_t = ::c_uint;
+pub type pthread_key_t = ::c_uint;
+pub type thread_t = pthread_t;
+pub type blksize_t = ::c_long;
+pub type nl_item = ::c_int;
+pub type mqd_t = ::c_int;
+pub type shmatt_t = ::c_ulong;
+pub type regoff_t = ::c_long;
+pub type rlim64_t = ::c_ulonglong;
+
+pub type sem_t = ::c_int;
+pub type pollset_t = ::c_int;
+
+pub type pthread_rwlockattr_t = *mut ::c_void;
+pub type pthread_condattr_t = *mut ::c_void;
+pub type pthread_mutexattr_t = *mut ::c_void;
+pub type pthread_attr_t = *mut ::c_void;
+pub type pthread_barrierattr_t = *mut ::c_void;
+pub type posix_spawn_file_actions_t = *mut ::c_char;
+pub type iconv_t = *mut ::c_void;
+
+e! {
+    pub enum uio_rw {
+        UIO_READ = 0,
+        UIO_WRITE,
+        UIO_READ_NO_MOVE,
+        UIO_WRITE_NO_MOVE,
+        UIO_PWRITE,
+    }
+}
+
+s! {
+    pub struct fsid_t {
+        pub val: [::c_uint; 2],
+    }
+
+    pub struct fsid64_t {
+        pub val: [::uint64_t; 2],
+    }
+
+    pub struct timezone {
+        pub tz_minuteswest: ::c_int,
+        pub tz_dsttime: ::c_int,
+    }
+
+    pub struct ip_mreq {
+        pub imr_multiaddr: in_addr,
+        pub imr_interface: in_addr,
+    }
+
+    pub struct dirent {
+        pub d_offset: ::c_ulong,
+        pub d_ino: ::ino_t,
+        pub d_reclen: ::c_ushort,
+        pub d_namlen: ::c_ushort,
+        pub d_name: [::c_char; 256]
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_cc: [::cc_t; ::NCCS]
+    }
+
+    pub struct flock64 {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_sysid: ::c_uint,
+        pub l_pid: ::pid_t,
+        pub l_vfs: ::c_int,
+        pub l_start: ::off64_t,
+        pub l_len: ::off64_t,
+    }
+
+    pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: ::socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::c_int,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: socklen_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::blksize64_t,
+        pub f_frsize: ::blksize64_t,
+        pub f_blocks: ::blkcnt64_t,
+        pub f_bfree: ::blkcnt64_t,
+        pub f_bavail: ::blkcnt64_t,
+        pub f_files: ::blkcnt64_t,
+        pub f_ffree: ::blkcnt64_t,
+        pub f_favail: ::blkcnt64_t,
+        pub f_fsid: fsid64_t,
+        pub f_basetype: [::c_char; 16],
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        pub f_fstr: [::c_char; 32],
+        pub f_filler: [::c_ulong; 16]
+    }
+
+    pub struct lconv {
+        pub decimal_point: *mut ::c_char,
+        pub thousands_sep: *mut ::c_char,
+        pub grouping: *mut ::c_char,
+        pub int_curr_symbol: *mut ::c_char,
+        pub currency_symbol: *mut ::c_char,
+        pub mon_decimal_point: *mut ::c_char,
+        pub mon_thousands_sep: *mut ::c_char,
+        pub mon_grouping: *mut ::c_char,
+        pub positive_sign: *mut ::c_char,
+        pub negative_sign: *mut ::c_char,
+        pub int_frac_digits: ::c_char,
+        pub frac_digits: ::c_char,
+        pub p_cs_precedes: ::c_char,
+        pub p_sep_by_space: ::c_char,
+        pub n_cs_precedes: ::c_char,
+        pub n_sep_by_space: ::c_char,
+        pub p_sign_posn: ::c_char,
+        pub n_sign_posn: ::c_char,
+        pub left_parenthesis: *mut ::c_char,
+        pub right_parenthesis: *mut ::c_char,
+        pub int_p_cs_precedes: ::c_char,
+        pub int_p_sep_by_space: ::c_char,
+        pub int_n_cs_precedes: ::c_char,
+        pub int_n_sep_by_space: ::c_char,
+        pub int_p_sign_posn: ::c_char,
+        pub int_n_sign_posn: ::c_char,
+    }
+
+    pub struct tm {
+        pub tm_sec: ::c_int,
+        pub tm_min: ::c_int,
+        pub tm_hour: ::c_int,
+        pub tm_mday: ::c_int,
+        pub tm_mon: ::c_int,
+        pub tm_year: ::c_int,
+        pub tm_wday: ::c_int,
+        pub tm_yday: ::c_int,
+        pub tm_isdst: ::c_int
+    }
+
+    pub struct addrinfo {
+        pub ai_flags: ::c_int,
+        pub ai_family: ::c_int,
+        pub ai_socktype: ::c_int,
+        pub ai_protocol: ::c_int,
+        pub ai_addrlen: ::c_ulong,
+        pub ai_canonname: *mut ::c_char,
+        pub ai_addr: *mut ::sockaddr,
+        pub ai_next: *mut addrinfo,
+        pub ai_eflags: ::c_int,
+    }
+
+    pub struct in_addr {
+        pub s_addr: in_addr_t
+    }
+
+    pub struct ip_mreq_source {
+        pub imr_multiaddr: in_addr,
+        pub imr_sourceaddr: in_addr,
+        pub imr_interface: in_addr,
+    }
+
+    pub struct sockaddr {
+        pub sa_len: ::c_uchar,
+        pub sa_family: sa_family_t,
+        pub sa_data: [::c_char; 14],
+    }
+
+    pub struct sockaddr_dl {
+        pub sdl_len: ::c_uchar,
+        pub sdl_family: ::c_uchar,
+        pub sdl_index: ::c_ushort,
+        pub sdl_type: ::c_uchar,
+        pub sdl_nlen: ::c_uchar,
+        pub sdl_alen: ::c_uchar,
+        pub sdl_slen: ::c_uchar,
+        pub sdl_data: [::c_char; 120],
+    }
+
+    pub struct sockaddr_in {
+        pub sin_len: ::c_uchar,
+        pub sin_family: sa_family_t,
+        pub sin_port: in_port_t,
+        pub sin_addr: in_addr,
+        pub sin_zero: [::c_char; 8]
+    }
+
+    pub struct sockaddr_in6 {
+        pub sin6_len: ::c_uchar,
+        pub sin6_family: ::c_uchar,
+        pub sin6_port: ::uint16_t,
+        pub sin6_flowinfo: ::uint32_t,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_scope_id: ::uint32_t
+    }
+
+    pub struct sockaddr_storage {
+        pub __ss_len: ::c_uchar,
+        pub ss_family: sa_family_t,
+        __ss_pad1: [::c_char; 6],
+        __ss_align: ::int64_t,
+        __ss_pad2: [::c_char; 1265],
+    }
+
+    pub struct sockaddr_un {
+        pub sun_len: ::c_uchar,
+        pub sun_family: sa_family_t,
+        pub sun_path: [::c_char; 1023]
+    }
+
+    pub struct st_timespec {
+        pub tv_sec: ::time_t,
+        pub tv_nsec: ::c_int,
+    }
+
+    pub struct statfs64 {
+        pub f_version: ::c_int,
+        pub f_type: ::c_int,
+        pub f_bsize: blksize64_t,
+        pub f_blocks: blkcnt64_t,
+        pub f_bfree: blkcnt64_t,
+        pub f_bavail: blkcnt64_t,
+        pub f_files: ::uint64_t,
+        pub f_ffree: ::uint64_t,
+        pub f_fsid: fsid64_t,
+        pub f_vfstype: ::c_int,
+        pub f_fsize: blksize64_t,
+        pub f_vfsnumber: ::c_int,
+        pub f_vfsoff: ::c_int,
+        pub f_vfslen: ::c_int,
+        pub f_vfsvers: ::c_int,
+        pub f_fname: [::c_char; 32],
+        pub f_fpack: [::c_char; 32],
+        pub f_name_max: ::c_int,
+    }
+
+    pub struct passwd {
+        pub pw_name: *mut ::c_char,
+        pub pw_passwd: *mut ::c_char,
+        pub pw_uid: ::uid_t,
+        pub pw_gid: ::gid_t,
+        pub pw_gecos: *mut ::c_char,
+        pub pw_dir: *mut ::c_char,
+        pub pw_shell: *mut ::c_char
+    }
+
+    pub struct utsname {
+        pub sysname: [::c_char; 32],
+        pub nodename: [::c_char; 32],
+        pub release: [::c_char; 32],
+        pub version: [::c_char; 32],
+        pub machine: [::c_char; 32],
+    }
+
+    pub struct xutsname {
+        pub nid: ::c_uint,
+        pub reserved: ::c_int,
+        pub longnid: ::c_ulonglong,
+    }
+
+    pub struct cmsghdr {
+        pub cmsg_len: ::socklen_t,
+        pub cmsg_level: ::c_int,
+        pub cmsg_type: ::c_int,
+    }
+
+    pub struct sigevent {
+        pub sigev_value: ::sigval,
+        pub sigev_signo: ::c_int,
+        pub sigev_notify: ::c_int,
+        pub sigev_notify_function: extern fn(val: ::sigval),
+        pub sigev_notify_attributes: *mut pthread_attr_t,
+    }
+
+    // Should be union with another 'sival_int'
+    pub struct sigval64 {
+        pub sival_ptr: ::c_ulonglong,
+    }
+
+    pub struct sigevent64 {
+        pub sigev_value: sigval64,
+        pub sigev_signo: ::c_int,
+        pub sigev_notify: ::c_int,
+        pub sigev_notify_function: ::c_ulonglong,
+        pub sigev_notify_attributes: ::c_ulonglong,
+    }
+
+    pub struct osigevent {
+        pub sevt_value: *mut ::c_void,
+        pub sevt_signo: signal_t,
+    }
+
+    pub struct poll_ctl {
+        pub cmd: ::c_short,
+        pub events: ::c_short,
+        pub fd: ::c_int,
+    }
+
+    pub struct sf_parms {
+        pub header_data: *mut ::c_void,
+        pub header_length: ::c_uint,
+        pub file_descriptor: ::c_int,
+        pub file_size: ::uint64_t,
+        pub file_offset: ::uint64_t,
+        pub file_bytes: ::int64_t,
+        pub trailer_data: *mut ::c_void,
+        pub trailer_length: ::c_uint,
+        pub bytes_sent: ::uint64_t,
+    }
+
+    pub struct mmsghdr {
+        pub msg_hdr: ::msghdr,
+        pub msg_len: ::c_uint,
+    }
+
+    pub struct sched_param {
+        pub sched_priority: ::c_int,
+        pub sched_policy: ::c_int,
+        pub sched_reserved: [::c_int; 6],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_size: ::size_t,
+        pub ss_flags: ::c_int,
+        pub __pad: [::c_int; 4],
+    }
+
+    pub struct posix_spawnattr_t {
+        pub posix_attr_flags: ::c_short,
+        pub posix_attr_pgroup: ::pid_t,
+        pub posix_attr_sigmask: ::sigset_t,
+        pub posix_attr_sigdefault: ::sigset_t,
+        pub posix_attr_schedpolicy: ::c_int,
+        pub posix_attr_schedparam: sched_param,
+    }
+
+    pub struct glob_t {
+        pub gl_pathc: ::size_t,
+        pub gl_pathv: *mut *mut c_char,
+        pub gl_offs: ::size_t,
+        pub gl_padr: *mut ::c_void,
+        pub gl_ptx: *mut ::c_void,
+    }
+
+    pub struct mallinfo {
+        pub arena: ::c_ulong,
+        pub ordblks: ::c_int,
+        pub smblks: ::c_int,
+        pub hblks: ::c_int,
+        pub hblkhd: ::c_int,
+        pub usmblks: ::c_ulong,
+        pub fsmblks: ::c_ulong,
+        pub uordblks: ::c_ulong,
+        pub fordblks: ::c_ulong,
+        pub keepcost: ::c_int,
+    }
+
+    pub struct utmp_exit_status {
+        pub e_termination: ::c_short,
+        pub e_exit: ::c_short,
+    }
+
+    pub struct utmp {
+        pub ut_user: [::c_char; 256],
+        pub ut_id: [::c_char; 14],
+        pub ut_line: [::c_char; 64],
+        pub ut_pid: ::pid_t,
+        pub ut_type: ::c_short,
+        pub ut_time: time64_t,
+        pub ut_exit: utmp_exit_status,
+        pub ut_host: [::c_char; 256],
+        pub __dbl_word_pad: ::c_int,
+        pub __reservedA: [::c_int; 2],
+        pub __reservedV: [::c_int; 6],
+    }
+
+    pub struct regmatch_t {
+        pub rm_so: regoff_t,
+        pub rm_eo: regoff_t,
+    }
+
+    pub struct regex_t {
+        pub re_nsub: ::size_t,
+        pub re_comp: *mut ::c_void,
+        pub re_cflags: ::c_int,
+        pub re_erroff: ::size_t,
+        pub re_len: ::size_t,
+        pub re_ucoll: [::wchar_t; 2],
+        pub re_lsub: [*mut ::c_void; 24],
+        pub re_esub: [*mut ::c_void; 24],
+        pub re_map: *mut ::c_uchar,
+        pub __maxsub: ::c_int,
+        pub __unused: [*mut ::c_void; 34],
+    }
+
+    pub struct rlimit64 {
+        pub rlim_cur: rlim64_t,
+        pub rlim_max: rlim64_t,
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: shmatt_t,
+        pub shm_cnattch: shmatt_t,
+        pub shm_atime: time_t,
+        pub shm_dtime: time_t,
+        pub shm_ctime: time_t,
+        pub shm_handle: ::uint32_t,
+        pub shm_extshm: ::c_int,
+        pub shm_pagesize: ::int64_t,
+        pub shm_lba: ::uint64_t,
+        pub shm_reserved: ::int64_t,
+        pub shm_reserved1: ::int64_t,
+    }
+
+    pub struct stat64 {
+        pub st_dev: dev_t,
+        pub st_ino: ino_t,
+        pub st_mode: mode_t,
+        pub st_nlink: nlink_t,
+        pub st_flag: ::c_ushort,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: dev_t,
+        pub st_ssize: ::c_int,
+        pub st_atim: st_timespec,
+        pub st_mtim: st_timespec,
+        pub st_ctim: st_timespec,
+        pub st_blksize: blksize_t,
+        pub st_blocks: blkcnt_t,
+        pub st_vfstype: ::c_int,
+        pub st_vfs: ::c_uint,
+        pub st_type: ::c_uint,
+        pub st_gen: ::c_uint,
+        pub st_reserved: [::c_uint; 10],
+        pub st_size: off64_t,
+    }
+
+    pub struct mntent {
+        pub mnt_fsname: *mut ::c_char,
+        pub mnt_dir: *mut ::c_char,
+        pub mnt_type: *mut ::c_char,
+        pub mnt_opts: *mut ::c_char,
+        pub mnt_freq: ::c_int,
+        pub mnt_passno: ::c_int,
+    }
+
+    pub struct ipc_perm {
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: mode_t,
+        pub seq: ::c_ushort,
+        pub __reserved: ::c_ushort,
+        pub key: key_t,
+    }
+
+    pub struct entry {
+        pub key: *mut ::c_char,
+        pub data: *mut ::c_void,
+    }
+
+    pub struct mq_attr {
+        pub mq_flags: ::c_long,
+        pub mq_maxmsg: ::c_long,
+        pub mq_msgsize: ::c_long,
+        pub mq_curmsgs: ::c_long,
+    }
+
+    pub struct sembuf {
+        pub sem_num: ::c_ushort,
+        pub sem_op: ::c_short,
+        pub sem_flg: ::c_short,
+    }
+
+    pub struct if_nameindex {
+        pub if_index: ::c_uint,
+        pub if_name: *mut ::c_char,
+    }
+
+    pub struct itimerspec {
+        pub it_interval: ::timespec,
+        pub it_value: ::timespec,
+    }
+}
+
+s_no_extra_traits! {
+    #[cfg(libc_union)]
+    pub union __sigaction_sa_union {
+        pub __su_handler: extern fn(c: ::c_int),
+        pub __su_sigaction: extern fn(c: ::c_int, info: *mut siginfo_t, ptr: *mut ::c_void),
+    }
+
+    pub struct sigaction {
+        #[cfg(libc_union)]
+        pub sa_union: __sigaction_sa_union,
+        pub sa_mask: sigset_t,
+        pub sa_flags: ::c_int,
+    }
+
+    #[cfg(libc_union)]
+    pub union __poll_ctl_ext_u {
+        pub addr: *mut ::c_void,
+        pub data32: u32,
+        pub data: u64,
+    }
+
+    pub struct poll_ctl_ext {
+        pub version: u8,
+        pub command: u8,
+        pub events: ::c_short,
+        pub fd: ::c_int,
+        #[cfg(libc_union)]
+        pub u: __poll_ctl_ext_u,
+        pub reversed64: [u64; 6],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        #[cfg(libc_union)]
+        impl PartialEq for __sigaction_sa_union {
+            fn eq(&self, other: &__sigaction_sa_union) -> bool {
+                unsafe {
+                    self.__su_handler == other.__su_handler
+                        && self.__su_sigaction == other.__su_sigaction
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __sigaction_sa_union {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __sigaction_sa_union {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("__sigaction_sa_union")
+                    .field("__su_handler", unsafe { &self.__su_handler })
+                    .field("__su_sigaction", unsafe { &self.__su_sigaction })
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __sigaction_sa_union {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                    self.__su_handler.hash(state);
+                    self.__su_sigaction.hash(state);
+                }
+            }
+        }
+
+        impl PartialEq for sigaction {
+            fn eq(&self, other: &sigaction) -> bool {
+                #[cfg(libc_union)]
+                let union_eq = self.sa_union == other.sa_union;
+                #[cfg(not(libc_union))]
+                let union_eq = true;
+                self.sa_mask == other.sa_mask
+                    && self.sa_flags == other.sa_flags
+                    && union_eq
+            }
+        }
+        impl Eq for sigaction {}
+        impl ::fmt::Debug for sigaction {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let mut struct_formatter = f.debug_struct("sigaction");
+                #[cfg(libc_union)]
+                struct_formatter.field("sa_union", &self.sa_union);
+                struct_formatter.field("sa_mask", &self.sa_mask);
+                struct_formatter.field("sa_flags", &self.sa_flags);
+                struct_formatter.finish()
+            }
+        }
+        impl ::hash::Hash for sigaction {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                #[cfg(libc_union)]
+                self.sa_union.hash(state);
+                self.sa_mask.hash(state);
+                self.sa_flags.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl PartialEq for __poll_ctl_ext_u {
+            fn eq(&self, other: &__poll_ctl_ext_u) -> bool {
+                unsafe {
+                    self.addr == other.addr
+                        && self.data32 == other.data32
+                        && self.data == other.data
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __poll_ctl_ext_u {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __poll_ctl_ext_u {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("__poll_ctl_ext_u")
+                    .field("addr", unsafe { &self.addr })
+                    .field("data32", unsafe { &self.data32 })
+                    .field("data", unsafe { &self.data })
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __poll_ctl_ext_u {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                    self.addr.hash(state);
+                    self.data32.hash(state);
+                    self.data.hash(state);
+                }
+            }
+        }
+
+        impl PartialEq for poll_ctl_ext {
+            fn eq(&self, other: &poll_ctl_ext) -> bool {
+                #[cfg(libc_union)]
+                let union_eq = self.u == other.u;
+                #[cfg(not(libc_union))]
+                let union_eq = true;
+                self.version == other.version
+                    && self.command == other.command
+                    && self.events == other.events
+                    && self.fd == other.fd
+                    && self.reversed64 == other.reversed64
+                    && union_eq
+            }
+        }
+        impl Eq for poll_ctl_ext {}
+        impl ::fmt::Debug for poll_ctl_ext {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let mut struct_formatter = f.debug_struct("poll_ctl_ext");
+                struct_formatter.field("version", &self.version);
+                struct_formatter.field("command", &self.command);
+                struct_formatter.field("events", &self.events);
+                struct_formatter.field("fd", &self.fd);
+                #[cfg(libc_union)]
+                struct_formatter.field("u", &self.u);
+                struct_formatter.field("reversed64", &self.reversed64);
+                struct_formatter.finish()
+            }
+        }
+        impl ::hash::Hash for poll_ctl_ext {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.version.hash(state);
+                self.command.hash(state);
+                self.events.hash(state);
+                self.fd.hash(state);
+                #[cfg(libc_union)]
+                self.u.hash(state);
+                self.reversed64.hash(state);
+            }
+        }
+    }
+}
+
+// dlfcn.h
+pub const RTLD_LAZY: ::c_int = 0x4;
+pub const RTLD_NOW: ::c_int = 0x2;
+pub const RTLD_GLOBAL: ::c_int = 0x10000;
+pub const RTLD_LOCAL: ::c_int = 0x80000;
+pub const RTLD_DEFAULT: *mut ::c_void = -1isize as *mut ::c_void;
+pub const RTLD_MYSELF: *mut ::c_void = -2isize as *mut ::c_void;
+pub const RTLD_NEXT: *mut ::c_void = -3isize as *mut ::c_void;
+
+// fcntl.h
+pub const O_RDONLY: ::c_int = 0x0;
+pub const O_WRONLY: ::c_int = 0x1;
+pub const O_RDWR: ::c_int = 0x2;
+pub const O_NDELAY: ::c_int = 0x8000;
+pub const O_APPEND: ::c_int = 0x8;
+pub const O_DSYNC: ::c_int = 0x400000;
+pub const O_CREAT: ::c_int = 0x100;
+pub const O_EXCL: ::c_int = 0x400;
+pub const O_NOCTTY: ::c_int = 0x800;
+pub const O_TRUNC: ::c_int = 0x200;
+pub const O_NOFOLLOW: ::c_int = 0x1000000;
+pub const O_DIRECTORY: ::c_int = 0x80000;
+pub const O_SEARCH: ::c_int = 0x20;
+pub const O_EXEC: ::c_int = 0x20;
+pub const O_CLOEXEC: ::c_int = 0x800000;
+pub const O_ACCMODE: ::c_int = O_RDONLY | O_WRONLY | O_RDWR;
+pub const O_DIRECT: ::c_int = 0x8000000;
+pub const O_TTY_INIT: ::c_int = 0;
+pub const O_RSYNC: ::c_int = 0x200000;
+pub const O_LARGEFILE: ::c_int = 0x4000000;
+pub const F_CLOSEM: ::c_int = 10;
+pub const F_DUPFD_CLOEXEC: ::c_int = 16;
+pub const F_GETLK64: ::c_int = 11;
+pub const F_SETLK64: ::c_int = 12;
+pub const F_SETLKW64: ::c_int = 13;
+pub const F_DUP2FD: ::c_int = 14;
+pub const F_TSTLK: ::c_int = 15;
+pub const F_GETLK: ::c_int = F_GETLK64;
+pub const F_SETLK: ::c_int = F_SETLK64;
+pub const F_SETLKW: ::c_int = F_SETLKW64;
+pub const F_GETOWN: ::c_int = 8;
+pub const F_SETOWN: ::c_int = 9;
+pub const AT_FDCWD: ::c_int = -2;
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 1;
+pub const AT_SYMLINK_FOLLOW: ::c_int = 2;
+pub const AT_REMOVEDIR: ::c_int = 1;
+pub const AT_EACCESS: ::c_int = 1;
+pub const F_DUPFD: ::c_int = 0;
+pub const F_GETFD: ::c_int = 1;
+pub const F_SETFD: ::c_int = 2;
+pub const F_GETFL: ::c_int = 3;
+pub const F_SETFL: ::c_int = 4;
+pub const O_SYNC: ::c_int = 16;
+pub const O_NONBLOCK: ::c_int = 4;
+pub const FASYNC: ::c_int = 0x20000;
+pub const POSIX_FADV_NORMAL: ::c_int = 1;
+pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
+pub const POSIX_FADV_RANDOM: ::c_int = 3;
+pub const POSIX_FADV_WILLNEED: ::c_int = 4;
+pub const POSIX_FADV_DONTNEED: ::c_int = 5;
+pub const POSIX_FADV_NOREUSE: ::c_int = 6;
+
+// glob.h
+pub const GLOB_APPEND: ::c_int = 0x1;
+pub const GLOB_DOOFFS: ::c_int = 0x2;
+pub const GLOB_ERR: ::c_int = 0x4;
+pub const GLOB_MARK: ::c_int = 0x8;
+pub const GLOB_NOCHECK: ::c_int = 0x10;
+pub const GLOB_NOSORT: ::c_int = 0x20;
+pub const GLOB_NOESCAPE: ::c_int = 0x80;
+pub const GLOB_NOSPACE: ::c_int = 0x2000;
+pub const GLOB_ABORTED: ::c_int = 0x1000;
+pub const GLOB_NOMATCH: ::c_int = 0x4000;
+pub const GLOB_NOSYS: ::c_int = 0x8000;
+
+// langinfo.h
+pub const DAY_1: ::nl_item = 13;
+pub const DAY_2: ::nl_item = 14;
+pub const DAY_3: ::nl_item = 15;
+pub const DAY_4: ::nl_item = 16;
+pub const DAY_5: ::nl_item = 17;
+pub const DAY_6: ::nl_item = 18;
+pub const DAY_7: ::nl_item = 19;
+pub const ABDAY_1: ::nl_item = 6;
+pub const ABDAY_2: ::nl_item = 7;
+pub const ABDAY_3: ::nl_item = 8;
+pub const ABDAY_4: ::nl_item = 9;
+pub const ABDAY_5: ::nl_item = 10;
+pub const ABDAY_6: ::nl_item = 11;
+pub const ABDAY_7: ::nl_item = 12;
+pub const MON_1: ::nl_item = 32;
+pub const MON_2: ::nl_item = 33;
+pub const MON_3: ::nl_item = 34;
+pub const MON_4: ::nl_item = 35;
+pub const MON_5: ::nl_item = 36;
+pub const MON_6: ::nl_item = 37;
+pub const MON_7: ::nl_item = 38;
+pub const MON_8: ::nl_item = 39;
+pub const MON_9: ::nl_item = 40;
+pub const MON_10: ::nl_item = 41;
+pub const MON_11: ::nl_item = 42;
+pub const MON_12: ::nl_item = 43;
+pub const ABMON_1: ::nl_item = 20;
+pub const ABMON_2: ::nl_item = 21;
+pub const ABMON_3: ::nl_item = 22;
+pub const ABMON_4: ::nl_item = 23;
+pub const ABMON_5: ::nl_item = 24;
+pub const ABMON_6: ::nl_item = 25;
+pub const ABMON_7: ::nl_item = 26;
+pub const ABMON_8: ::nl_item = 27;
+pub const ABMON_9: ::nl_item = 28;
+pub const ABMON_10: ::nl_item = 29;
+pub const ABMON_11: ::nl_item = 30;
+pub const ABMON_12: ::nl_item = 31;
+pub const RADIXCHAR: ::nl_item = 44;
+pub const THOUSEP: ::nl_item = 45;
+pub const YESSTR: ::nl_item = 46;
+pub const NOSTR: ::nl_item = 47;
+pub const CRNCYSTR: ::nl_item = 48;
+pub const D_T_FMT: ::nl_item = 1;
+pub const D_FMT: ::nl_item = 2;
+pub const T_FMT: ::nl_item = 3;
+pub const AM_STR: ::nl_item = 4;
+pub const PM_STR: ::nl_item = 5;
+pub const CODESET: ::nl_item = 49;
+pub const T_FMT_AMPM: ::nl_item = 55;
+pub const ERA: ::nl_item = 56;
+pub const ERA_D_FMT: ::nl_item = 57;
+pub const ERA_D_T_FMT: ::nl_item = 58;
+pub const ERA_T_FMT: ::nl_item = 59;
+pub const ALT_DIGITS: ::nl_item = 60;
+pub const YESEXPR: ::nl_item = 61;
+pub const NOEXPR: ::nl_item = 62;
+
+// locale.h
+pub const LC_GLOBAL_LOCALE: ::locale_t = -1isize as ::locale_t;
+pub const LC_CTYPE: ::c_int = 1;
+pub const LC_NUMERIC: ::c_int = 3;
+pub const LC_TIME: ::c_int = 4;
+pub const LC_COLLATE: ::c_int = 0;
+pub const LC_MONETARY: ::c_int = 2;
+pub const LC_MESSAGES: ::c_int = 4;
+pub const LC_ALL: ::c_int = -1;
+pub const LC_CTYPE_MASK: ::c_int = 2;
+pub const LC_NUMERIC_MASK: ::c_int = 16;
+pub const LC_TIME_MASK: ::c_int = 32;
+pub const LC_COLLATE_MASK: ::c_int = 1;
+pub const LC_MONETARY_MASK: ::c_int = 8;
+pub const LC_MESSAGES_MASK: ::c_int = 4;
+pub const LC_ALL_MASK: ::c_int = LC_CTYPE_MASK
+    | LC_NUMERIC_MASK
+    | LC_TIME_MASK
+    | LC_COLLATE_MASK
+    | LC_MONETARY_MASK
+    | LC_MESSAGES_MASK;
+
+// netdb.h
+pub const NI_MAXHOST: ::socklen_t = 1025;
+pub const NI_MAXSERV: ::socklen_t = 32;
+pub const NI_NOFQDN: ::socklen_t = 0x1;
+pub const NI_NUMERICHOST: ::socklen_t = 0x2;
+pub const NI_NAMEREQD: ::socklen_t = 0x4;
+pub const NI_NUMERICSERV: ::socklen_t = 0x8;
+pub const NI_DGRAM: ::socklen_t = 0x10;
+pub const NI_NUMERICSCOPE: ::socklen_t = 0x40;
+pub const EAI_AGAIN: ::c_int = 2;
+pub const EAI_BADFLAGS: ::c_int = 3;
+pub const EAI_FAIL: ::c_int = 4;
+pub const EAI_FAMILY: ::c_int = 5;
+pub const EAI_MEMORY: ::c_int = 6;
+pub const EAI_NODATA: ::c_int = 7;
+pub const EAI_NONAME: ::c_int = 8;
+pub const EAI_SERVICE: ::c_int = 9;
+pub const EAI_SOCKTYPE: ::c_int = 10;
+pub const EAI_SYSTEM: ::c_int = 11;
+pub const EAI_OVERFLOW: ::c_int = 13;
+pub const AI_CANONNAME: ::c_int = 0x01;
+pub const AI_PASSIVE: ::c_int = 0x02;
+pub const AI_NUMERICHOST: ::c_int = 0x04;
+pub const AI_ADDRCONFIG: ::c_int = 0x08;
+pub const AI_V4MAPPED: ::c_int = 0x10;
+pub const AI_ALL: ::c_int = 0x20;
+pub const AI_NUMERICSERV: ::c_int = 0x40;
+pub const AI_EXTFLAGS: ::c_int = 0x80;
+pub const AI_DEFAULT: ::c_int = AI_V4MAPPED | AI_ADDRCONFIG;
+pub const IPV6_ADDRFORM: ::c_int = 22;
+pub const IPV6_ADDR_PREFERENCES: ::c_int = 74;
+pub const IPV6_CHECKSUM: ::c_int = 39;
+pub const IPV6_DONTFRAG: ::c_int = 45;
+pub const IPV6_DSTOPTS: ::c_int = 54;
+pub const IPV6_FLOWINFO_FLOWLABEL: ::c_int = 16777215;
+pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 251658240;
+pub const IPV6_HOPLIMIT: ::c_int = 40;
+pub const IPV6_HOPOPTS: ::c_int = 52;
+pub const IPV6_NEXTHOP: ::c_int = 48;
+pub const IPV6_PATHMTU: ::c_int = 46;
+pub const IPV6_PKTINFO: ::c_int = 33;
+pub const IPV6_PREFER_SRC_CGA: ::c_int = 16;
+pub const IPV6_PREFER_SRC_COA: ::c_int = 2;
+pub const IPV6_PREFER_SRC_HOME: ::c_int = 1;
+pub const IPV6_PREFER_SRC_NONCGA: ::c_int = 32;
+pub const IPV6_PREFER_SRC_PUBLIC: ::c_int = 4;
+pub const IPV6_PREFER_SRC_TMP: ::c_int = 8;
+pub const IPV6_RECVDSTOPTS: ::c_int = 56;
+pub const IPV6_RECVHOPLIMIT: ::c_int = 41;
+pub const IPV6_RECVHOPOPTS: ::c_int = 53;
+pub const IPV6_RECVPATHMTU: ::c_int = 47;
+pub const IPV6_RECVRTHDR: ::c_int = 51;
+pub const IPV6_RECVTCLASS: ::c_int = 42;
+pub const IPV6_RTHDR: ::c_int = 50;
+pub const IPV6_RTHDRDSTOPTS: ::c_int = 55;
+pub const IPV6_TCLASS: ::c_int = 43;
+
+// net/bpf.h
+pub const DLT_NULL: ::c_int = 0x18;
+pub const DLT_EN10MB: ::c_int = 0x6;
+pub const DLT_EN3MB: ::c_int = 0x1a;
+pub const DLT_AX25: ::c_int = 0x5;
+pub const DLT_PRONET: ::c_int = 0xd;
+pub const DLT_IEEE802: ::c_int = 0x7;
+pub const DLT_ARCNET: ::c_int = 0x23;
+pub const DLT_SLIP: ::c_int = 0x1c;
+pub const DLT_PPP: ::c_int = 0x17;
+pub const DLT_FDDI: ::c_int = 0xf;
+pub const DLT_ATM: ::c_int = 0x25;
+pub const DLT_IPOIB: ::c_int = 0xc7;
+pub const BIOCSETF: ::c_ulong = 0x80104267;
+pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
+pub const BIOCGBLEN: ::c_int = 0x40044266;
+pub const BIOCSBLEN: ::c_int = 0xc0044266;
+pub const BIOCFLUSH: ::c_int = 0x20004268;
+pub const BIOCPROMISC: ::c_int = 0x20004269;
+pub const BIOCGDLT: ::c_int = 0x4004426a;
+pub const BIOCSRTIMEOUT: ::c_int = 0x8010426d;
+pub const BIOCGSTATS: ::c_int = 0x4008426f;
+pub const BIOCIMMEDIATE: ::c_int = 0x80044270;
+pub const BIOCVERSION: ::c_int = 0x40044271;
+pub const BIOCSDEVNO: ::c_int = 0x20004272;
+pub const BIOCGETIF: ::c_ulong = 0x4020426b;
+pub const BIOCSETIF: ::c_ulong = 0xffffffff8020426c;
+pub const BPF_ABS: ::c_int = 32;
+pub const BPF_ADD: ::c_int = 0;
+pub const BPF_ALIGNMENT: ::c_ulong = 4;
+pub const BPF_ALU: ::c_int = 4;
+pub const BPF_AND: ::c_int = 80;
+pub const BPF_B: ::c_int = 16;
+pub const BPF_DIV: ::c_int = 48;
+pub const BPF_H: ::c_int = 8;
+pub const BPF_IMM: ::c_int = 0;
+pub const BPF_IND: ::c_int = 64;
+pub const BPF_JA: ::c_int = 0;
+pub const BPF_JEQ: ::c_int = 16;
+pub const BPF_JGE: ::c_int = 48;
+pub const BPF_JGT: ::c_int = 32;
+pub const BPF_JMP: ::c_int = 5;
+pub const BPF_JSET: ::c_int = 64;
+pub const BPF_K: ::c_int = 0;
+pub const BPF_LD: ::c_int = 0;
+pub const BPF_LDX: ::c_int = 1;
+pub const BPF_LEN: ::c_int = 128;
+pub const BPF_LSH: ::c_int = 96;
+pub const BPF_MAXINSNS: ::c_int = 512;
+pub const BPF_MEM: ::c_int = 96;
+pub const BPF_MEMWORDS: ::c_int = 16;
+pub const BPF_MISC: ::c_int = 7;
+pub const BPF_MSH: ::c_int = 160;
+pub const BPF_MUL: ::c_int = 32;
+pub const BPF_NEG: ::c_int = 128;
+pub const BPF_OR: ::c_int = 64;
+pub const BPF_RET: ::c_int = 6;
+pub const BPF_RSH: ::c_int = 112;
+pub const BPF_ST: ::c_int = 2;
+pub const BPF_STX: ::c_int = 3;
+pub const BPF_SUB: ::c_int = 16;
+pub const BPF_W: ::c_int = 0;
+pub const BPF_X: ::c_int = 8;
+
+// net/if.h
+pub const IFNET_SLOWHZ: ::c_int = 1;
+pub const IFQ_MAXLEN: ::c_int = 50;
+pub const IF_NAMESIZE: ::c_int = 16;
+pub const IFNAMSIZ: ::c_int = 16;
+pub const IFF_UP: ::c_int = 0x1;
+pub const IFF_BROADCAST: ::c_int = 0x2;
+pub const IFF_DEBUG: ::c_int = 0x4;
+pub const IFF_LOOPBACK: ::c_int = 0x8;
+pub const IFF_POINTOPOINT: ::c_int = 0x10;
+pub const IFF_NOTRAILERS: ::c_int = 0x20;
+pub const IFF_RUNNING: ::c_int = 0x40;
+pub const IFF_NOARP: ::c_int = 0x80;
+pub const IFF_PROMISC: ::c_int = 0x100;
+pub const IFF_ALLMULTI: ::c_int = 0x200;
+pub const IFF_MULTICAST: ::c_int = 0x80000;
+pub const IFF_LINK0: ::c_int = 0x100000;
+pub const IFF_LINK1: ::c_int = 0x200000;
+pub const IFF_LINK2: ::c_int = 0x400000;
+pub const IFF_OACTIVE: ::c_int = 0x400;
+pub const IFF_SIMPLEX: ::c_int = 0x800;
+
+// net/if_arp.h
+pub const ARPHRD_ETHER: ::c_int = 1;
+pub const ARPHRD_802_5: ::c_int = 6;
+pub const ARPHRD_802_3: ::c_int = 6;
+pub const ARPHRD_FDDI: ::c_int = 1;
+pub const ARPOP_REQUEST: ::c_int = 1;
+pub const ARPOP_REPLY: ::c_int = 2;
+
+// net/route.h
+pub const RTM_ADD: ::c_int = 0x1;
+pub const RTM_DELETE: ::c_int = 0x2;
+pub const RTM_CHANGE: ::c_int = 0x3;
+pub const RTM_GET: ::c_int = 0x4;
+pub const RTM_LOSING: ::c_int = 0x5;
+pub const RTM_REDIRECT: ::c_int = 0x6;
+pub const RTM_MISS: ::c_int = 0x7;
+pub const RTM_LOCK: ::c_int = 0x8;
+pub const RTM_OLDADD: ::c_int = 0x9;
+pub const RTM_OLDDEL: ::c_int = 0xa;
+pub const RTM_RESOLVE: ::c_int = 0xb;
+pub const RTM_NEWADDR: ::c_int = 0xc;
+pub const RTM_DELADDR: ::c_int = 0xd;
+pub const RTM_IFINFO: ::c_int = 0xe;
+pub const RTM_EXPIRE: ::c_int = 0xf;
+pub const RTM_RTLOST: ::c_int = 0x10;
+pub const RTM_GETNEXT: ::c_int = 0x11;
+pub const RTM_SAMEADDR: ::c_int = 0x12;
+pub const RTM_SET: ::c_int = 0x13;
+pub const RTV_MTU: ::c_int = 0x1;
+pub const RTV_HOPCOUNT: ::c_int = 0x2;
+pub const RTV_EXPIRE: ::c_int = 0x4;
+pub const RTV_RPIPE: ::c_int = 0x8;
+pub const RTV_SPIPE: ::c_int = 0x10;
+pub const RTV_SSTHRESH: ::c_int = 0x20;
+pub const RTV_RTT: ::c_int = 0x40;
+pub const RTV_RTTVAR: ::c_int = 0x80;
+pub const RTA_DST: ::c_int = 0x1;
+pub const RTA_GATEWAY: ::c_int = 0x2;
+pub const RTA_NETMASK: ::c_int = 0x4;
+pub const RTA_GENMASK: ::c_int = 0x8;
+pub const RTA_IFP: ::c_int = 0x10;
+pub const RTA_IFA: ::c_int = 0x20;
+pub const RTA_AUTHOR: ::c_int = 0x40;
+pub const RTA_BRD: ::c_int = 0x80;
+pub const RTA_DOWNSTREAM: ::c_int = 0x100;
+pub const RTAX_DST: ::c_int = 0;
+pub const RTAX_GATEWAY: ::c_int = 1;
+pub const RTAX_NETMASK: ::c_int = 2;
+pub const RTAX_GENMASK: ::c_int = 3;
+pub const RTAX_IFP: ::c_int = 4;
+pub const RTAX_IFA: ::c_int = 5;
+pub const RTAX_AUTHOR: ::c_int = 6;
+pub const RTAX_BRD: ::c_int = 7;
+pub const RTAX_MAX: ::c_int = 8;
+pub const RTF_UP: ::c_int = 0x1;
+pub const RTF_GATEWAY: ::c_int = 0x2;
+pub const RTF_HOST: ::c_int = 0x4;
+pub const RTF_REJECT: ::c_int = 0x8;
+pub const RTF_DYNAMIC: ::c_int = 0x10;
+pub const RTF_MODIFIED: ::c_int = 0x20;
+pub const RTF_DONE: ::c_int = 0x40;
+pub const RTF_MASK: ::c_int = 0x80;
+pub const RTF_CLONING: ::c_int = 0x100;
+pub const RTF_XRESOLVE: ::c_int = 0x200;
+pub const RTF_LLINFO: ::c_int = 0x400;
+pub const RTF_STATIC: ::c_int = 0x800;
+pub const RTF_BLACKHOLE: ::c_int = 0x1000;
+pub const RTF_BUL: ::c_int = 0x2000;
+pub const RTF_PROTO2: ::c_int = 0x4000;
+pub const RTF_PROTO1: ::c_int = 0x8000;
+pub const RTF_CLONE: ::c_int = 0x10000;
+pub const RTF_CLONED: ::c_int = 0x20000;
+pub const RTF_PROTO3: ::c_int = 0x40000;
+pub const RTF_BCE: ::c_int = 0x80000;
+pub const RTF_PINNED: ::c_int = 0x100000;
+pub const RTF_LOCAL: ::c_int = 0x200000;
+pub const RTF_BROADCAST: ::c_int = 0x400000;
+pub const RTF_MULTICAST: ::c_int = 0x800000;
+pub const RTF_ACTIVE_DGD: ::c_int = 0x1000000;
+pub const RTF_STOPSRCH: ::c_int = 0x2000000;
+pub const RTF_FREE_IN_PROG: ::c_int = 0x4000000;
+pub const RTF_PERMANENT6: ::c_int = 0x8000000;
+pub const RTF_UNREACHABLE: ::c_int = 0x10000000;
+pub const RTF_CACHED: ::c_int = 0x20000000;
+pub const RTF_SMALLMTU: ::c_int = 0x40000;
+
+// netinet/in.h
+pub const IPPROTO_HOPOPTS: ::c_int = 0;
+pub const IPPROTO_IGMP: ::c_int = 2;
+pub const IPPROTO_GGP: ::c_int = 3;
+pub const IPPROTO_IPIP: ::c_int = 4;
+pub const IPPROTO_EGP: ::c_int = 8;
+pub const IPPROTO_PUP: ::c_int = 12;
+pub const IPPROTO_IDP: ::c_int = 22;
+pub const IPPROTO_TP: ::c_int = 29;
+pub const IPPROTO_ROUTING: ::c_int = 43;
+pub const IPPROTO_FRAGMENT: ::c_int = 44;
+pub const IPPROTO_QOS: ::c_int = 45;
+pub const IPPROTO_RSVP: ::c_int = 46;
+pub const IPPROTO_GRE: ::c_int = 47;
+pub const IPPROTO_ESP: ::c_int = 50;
+pub const IPPROTO_AH: ::c_int = 51;
+pub const IPPROTO_NONE: ::c_int = 59;
+pub const IPPROTO_DSTOPTS: ::c_int = 60;
+pub const IPPROTO_LOCAL: ::c_int = 63;
+pub const IPPROTO_EON: ::c_int = 80;
+pub const IPPROTO_BIP: ::c_int = 0x53;
+pub const IPPROTO_SCTP: ::c_int = 132;
+pub const IPPROTO_MH: ::c_int = 135;
+pub const IPPROTO_GIF: ::c_int = 140;
+pub const IPPROTO_RAW: ::c_int = 255;
+pub const IPPROTO_MAX: ::c_int = 256;
+pub const IP_OPTIONS: ::c_int = 1;
+pub const IP_HDRINCL: ::c_int = 2;
+pub const IP_TOS: ::c_int = 3;
+pub const IP_TTL: ::c_int = 4;
+pub const IP_UNICAST_HOPS: ::c_int = 4;
+pub const IP_RECVOPTS: ::c_int = 5;
+pub const IP_RECVRETOPTS: ::c_int = 6;
+pub const IP_RECVDSTADDR: ::c_int = 7;
+pub const IP_RETOPTS: ::c_int = 8;
+pub const IP_MULTICAST_IF: ::c_int = 9;
+pub const IP_MULTICAST_TTL: ::c_int = 10;
+pub const IP_MULTICAST_HOPS: ::c_int = 10;
+pub const IP_MULTICAST_LOOP: ::c_int = 11;
+pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
+pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
+pub const IP_RECVMACHDR: ::c_int = 14;
+pub const IP_RECVIFINFO: ::c_int = 15;
+pub const IP_BROADCAST_IF: ::c_int = 16;
+pub const IP_DHCPMODE: ::c_int = 17;
+pub const IP_RECVIF: ::c_int = 20;
+pub const IP_ADDRFORM: ::c_int = 22;
+pub const IP_DONTFRAG: ::c_int = 25;
+pub const IP_FINDPMTU: ::c_int = 26;
+pub const IP_PMTUAGE: ::c_int = 27;
+pub const IP_RECVINTERFACE: ::c_int = 32;
+pub const IP_RECVTTL: ::c_int = 34;
+pub const IP_BLOCK_SOURCE: ::c_int = 58;
+pub const IP_UNBLOCK_SOURCE: ::c_int = 59;
+pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 60;
+pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 61;
+pub const IP_DEFAULT_MULTICAST_TTL: ::c_int = 1;
+pub const IP_DEFAULT_MULTICAST_LOOP: ::c_int = 1;
+pub const IP_INC_MEMBERSHIPS: ::c_int = 20;
+pub const IP_INIT_MEMBERSHIP: ::c_int = 20;
+pub const IPV6_UNICAST_HOPS: ::c_int = IP_TTL;
+pub const IPV6_MULTICAST_IF: ::c_int = IP_MULTICAST_IF;
+pub const IPV6_MULTICAST_HOPS: ::c_int = IP_MULTICAST_TTL;
+pub const IPV6_MULTICAST_LOOP: ::c_int = IP_MULTICAST_LOOP;
+pub const IPV6_RECVPKTINFO: ::c_int = 35;
+pub const IPV6_V6ONLY: ::c_int = 37;
+pub const IPV6_ADD_MEMBERSHIP: ::c_int = IP_ADD_MEMBERSHIP;
+pub const IPV6_DROP_MEMBERSHIP: ::c_int = IP_DROP_MEMBERSHIP;
+pub const IPV6_JOIN_GROUP: ::c_int = IP_ADD_MEMBERSHIP;
+pub const IPV6_LEAVE_GROUP: ::c_int = IP_DROP_MEMBERSHIP;
+pub const MCAST_BLOCK_SOURCE: ::c_int = 64;
+pub const MCAST_EXCLUDE: ::c_int = 2;
+pub const MCAST_INCLUDE: ::c_int = 1;
+pub const MCAST_JOIN_GROUP: ::c_int = 62;
+pub const MCAST_JOIN_SOURCE_GROUP: ::c_int = 66;
+pub const MCAST_LEAVE_GROUP: ::c_int = 63;
+pub const MCAST_LEAVE_SOURCE_GROUP: ::c_int = 67;
+pub const MCAST_UNBLOCK_SOURCE: ::c_int = 65;
+
+// netinet/ip.h
+pub const MAXTTL: ::c_int = 255;
+pub const IPDEFTTL: ::c_int = 64;
+pub const IPOPT_CONTROL: ::c_int = 0;
+pub const IPOPT_EOL: ::c_int = 0;
+pub const IPOPT_LSRR: ::c_int = 131;
+pub const IPOPT_MINOFF: ::c_int = 4;
+pub const IPOPT_NOP: ::c_int = 1;
+pub const IPOPT_OFFSET: ::c_int = 2;
+pub const IPOPT_OLEN: ::c_int = 1;
+pub const IPOPT_OPTVAL: ::c_int = 0;
+pub const IPOPT_RESERVED1: ::c_int = 0x20;
+pub const IPOPT_RESERVED2: ::c_int = 0x60;
+pub const IPOPT_RR: ::c_int = 7;
+pub const IPOPT_SSRR: ::c_int = 137;
+pub const IPOPT_TS: ::c_int = 68;
+pub const IPOPT_TS_PRESPEC: ::c_int = 3;
+pub const IPOPT_TS_TSANDADDR: ::c_int = 1;
+pub const IPOPT_TS_TSONLY: ::c_int = 0;
+pub const IPTOS_LOWDELAY: ::c_int = 16;
+pub const IPTOS_PREC_CRITIC_ECP: ::c_int = 160;
+pub const IPTOS_PREC_FLASH: ::c_int = 96;
+pub const IPTOS_PREC_FLASHOVERRIDE: ::c_int = 128;
+pub const IPTOS_PREC_IMMEDIATE: ::c_int = 64;
+pub const IPTOS_PREC_INTERNETCONTROL: ::c_int = 192;
+pub const IPTOS_PREC_NETCONTROL: ::c_int = 224;
+pub const IPTOS_PREC_PRIORITY: ::c_int = 32;
+pub const IPTOS_PREC_ROUTINE: ::c_int = 16;
+pub const IPTOS_RELIABILITY: ::c_int = 4;
+pub const IPTOS_THROUGHPUT: ::c_int = 8;
+pub const IPVERSION: ::c_int = 4;
+
+// netinet/tcp.h
+pub const TCP_NODELAY: ::c_int = 0x1;
+pub const TCP_MAXSEG: ::c_int = 0x2;
+pub const TCP_RFC1323: ::c_int = 0x4;
+pub const TCP_KEEPALIVE: ::c_int = 0x8;
+pub const TCP_KEEPIDLE: ::c_int = 0x11;
+pub const TCP_KEEPINTVL: ::c_int = 0x12;
+pub const TCP_KEEPCNT: ::c_int = 0x13;
+pub const TCP_NODELAYACK: ::c_int = 0x14;
+
+// pthread.h
+pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
+pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
+pub const PTHREAD_PROCESS_SHARED: ::c_int = 0;
+pub const PTHREAD_PROCESS_PRIVATE: ::c_ushort = 1;
+pub const PTHREAD_STACK_MIN: ::size_t = PAGESIZE as ::size_t * 4;
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 5;
+pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 3;
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 4;
+pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
+pub const PTHREAD_MUTEX_ROBUST: ::c_int = 1;
+pub const PTHREAD_MUTEX_STALLED: ::c_int = 0;
+pub const PTHREAD_PRIO_INHERIT: ::c_int = 3;
+pub const PTHREAD_PRIO_NONE: ::c_int = 1;
+pub const PTHREAD_PRIO_PROTECT: ::c_int = 2;
+
+// regex.h
+pub const REG_EXTENDED: ::c_int = 1;
+pub const REG_ICASE: ::c_int = 2;
+pub const REG_NEWLINE: ::c_int = 4;
+pub const REG_NOSUB: ::c_int = 8;
+pub const REG_NOTBOL: ::c_int = 0x100;
+pub const REG_NOTEOL: ::c_int = 0x200;
+pub const REG_NOMATCH: ::c_int = 1;
+pub const REG_BADPAT: ::c_int = 2;
+pub const REG_ECOLLATE: ::c_int = 3;
+pub const REG_ECTYPE: ::c_int = 4;
+pub const REG_EESCAPE: ::c_int = 5;
+pub const REG_ESUBREG: ::c_int = 6;
+pub const REG_EBRACK: ::c_int = 7;
+pub const REG_EPAREN: ::c_int = 8;
+pub const REG_EBRACE: ::c_int = 9;
+pub const REG_BADBR: ::c_int = 10;
+pub const REG_ERANGE: ::c_int = 11;
+pub const REG_ESPACE: ::c_int = 12;
+pub const REG_BADRPT: ::c_int = 13;
+pub const REG_ECHAR: ::c_int = 14;
+pub const REG_EBOL: ::c_int = 15;
+pub const REG_EEOL: ::c_int = 16;
+pub const REG_ENOSYS: ::c_int = 17;
+
+// rpcsvc/mount.h
+pub const NFSMNT_ACDIRMAX: ::c_int = 2048;
+pub const NFSMNT_ACDIRMIN: ::c_int = 1024;
+pub const NFSMNT_ACREGMAX: ::c_int = 512;
+pub const NFSMNT_ACREGMIN: ::c_int = 256;
+pub const NFSMNT_INT: ::c_int = 64;
+pub const NFSMNT_NOAC: ::c_int = 128;
+pub const NFSMNT_RETRANS: ::c_int = 16;
+pub const NFSMNT_RSIZE: ::c_int = 4;
+pub const NFSMNT_SOFT: ::c_int = 1;
+pub const NFSMNT_TIMEO: ::c_int = 8;
+pub const NFSMNT_WSIZE: ::c_int = 2;
+
+// rpcsvc/rstat.h
+pub const CPUSTATES: ::c_int = 4;
+
+// search.h
+pub const FIND: ::c_int = 0;
+pub const ENTER: ::c_int = 1;
+
+// semaphore.h
+pub const SEM_FAILED: *mut sem_t = -1isize as *mut ::sem_t;
+
+// spawn.h
+pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x1;
+pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x2;
+pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x4;
+pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x8;
+pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x10;
+pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x20;
+pub const POSIX_SPAWN_FORK_HANDLERS: ::c_int = 0x1000;
+
+// stdio.h
+pub const EOF: ::c_int = -1;
+pub const SEEK_SET: ::c_int = 0;
+pub const SEEK_CUR: ::c_int = 1;
+pub const SEEK_END: ::c_int = 2;
+pub const _IOFBF: ::c_int = 0o000;
+pub const _IONBF: ::c_int = 0o004;
+pub const _IOLBF: ::c_int = 0o100;
+pub const BUFSIZ: ::c_uint = 4096;
+pub const FOPEN_MAX: ::c_uint = 32767;
+pub const FILENAME_MAX: ::c_uint = 255;
+pub const L_tmpnam: ::c_uint = 21;
+pub const TMP_MAX: ::c_uint = 16384;
+
+// stdlib.h
+pub const EXIT_FAILURE: ::c_int = 1;
+pub const EXIT_SUCCESS: ::c_int = 0;
+pub const RAND_MAX: ::c_int = 32767;
+
+// sys/access.h
+pub const F_OK: ::c_int = 0;
+pub const R_OK: ::c_int = 4;
+pub const W_OK: ::c_int = 2;
+pub const X_OK: ::c_int = 1;
+
+// sys/aio.h
+pub const LIO_NOP: ::c_int = 0;
+pub const LIO_READ: ::c_int = 1;
+pub const LIO_WRITE: ::c_int = 2;
+pub const LIO_NOWAIT: ::c_int = 0;
+pub const LIO_WAIT: ::c_int = 1;
+pub const AIO_ALLDONE: ::c_int = 2;
+pub const AIO_CANCELED: ::c_int = 0;
+pub const AIO_NOTCANCELED: ::c_int = 1;
+
+// sys/errno.h
+pub const EPERM: ::c_int = 1;
+pub const ENOENT: ::c_int = 2;
+pub const ESRCH: ::c_int = 3;
+pub const EINTR: ::c_int = 4;
+pub const EIO: ::c_int = 5;
+pub const ENXIO: ::c_int = 6;
+pub const E2BIG: ::c_int = 7;
+pub const ENOEXEC: ::c_int = 8;
+pub const EBADF: ::c_int = 9;
+pub const ECHILD: ::c_int = 10;
+pub const EAGAIN: ::c_int = 11;
+pub const ENOMEM: ::c_int = 12;
+pub const EACCES: ::c_int = 13;
+pub const EFAULT: ::c_int = 14;
+pub const ENOTBLK: ::c_int = 15;
+pub const EBUSY: ::c_int = 16;
+pub const EEXIST: ::c_int = 17;
+pub const EXDEV: ::c_int = 18;
+pub const ENODEV: ::c_int = 19;
+pub const ENOTDIR: ::c_int = 20;
+pub const EISDIR: ::c_int = 21;
+pub const EINVAL: ::c_int = 22;
+pub const ENFILE: ::c_int = 23;
+pub const EMFILE: ::c_int = 24;
+pub const ENOTTY: ::c_int = 25;
+pub const ETXTBSY: ::c_int = 26;
+pub const EFBIG: ::c_int = 27;
+pub const ENOSPC: ::c_int = 28;
+pub const ESPIPE: ::c_int = 29;
+pub const EROFS: ::c_int = 30;
+pub const EMLINK: ::c_int = 31;
+pub const EPIPE: ::c_int = 32;
+pub const EDOM: ::c_int = 33;
+pub const ERANGE: ::c_int = 34;
+pub const ENOMSG: ::c_int = 35;
+pub const EIDRM: ::c_int = 36;
+pub const ECHRNG: ::c_int = 37;
+pub const EL2NSYNC: ::c_int = 38;
+pub const EL3HLT: ::c_int = 39;
+pub const EL3RST: ::c_int = 40;
+pub const ELNRNG: ::c_int = 41;
+pub const EUNATCH: ::c_int = 42;
+pub const ENOCSI: ::c_int = 43;
+pub const EL2HLT: ::c_int = 44;
+pub const EDEADLK: ::c_int = 45;
+pub const ENOLCK: ::c_int = 49;
+pub const ECANCELED: ::c_int = 117;
+pub const ENOTSUP: ::c_int = 124;
+pub const EPROCLIM: ::c_int = 83;
+pub const EDQUOT: ::c_int = 88;
+pub const EOWNERDEAD: ::c_int = 95;
+pub const ENOTRECOVERABLE: ::c_int = 94;
+pub const ENOSTR: ::c_int = 123;
+pub const ENODATA: ::c_int = 122;
+pub const ETIME: ::c_int = 119;
+pub const ENOSR: ::c_int = 118;
+pub const EREMOTE: ::c_int = 93;
+pub const ENOATTR: ::c_int = 112;
+pub const ESAD: ::c_int = 113;
+pub const ENOTRUST: ::c_int = 114;
+pub const ENOLINK: ::c_int = 126;
+pub const EPROTO: ::c_int = 121;
+pub const EMULTIHOP: ::c_int = 125;
+pub const EBADMSG: ::c_int = 120;
+pub const ENAMETOOLONG: ::c_int = 86;
+pub const EOVERFLOW: ::c_int = 127;
+pub const EILSEQ: ::c_int = 116;
+pub const ENOSYS: ::c_int = 109;
+pub const ELOOP: ::c_int = 85;
+pub const ERESTART: ::c_int = 82;
+pub const ENOTEMPTY: ::c_int = 87;
+pub const EUSERS: ::c_int = 84;
+pub const ENOTSOCK: ::c_int = 57;
+pub const EDESTADDRREQ: ::c_int = 58;
+pub const EMSGSIZE: ::c_int = 59;
+pub const EPROTOTYPE: ::c_int = 60;
+pub const ENOPROTOOPT: ::c_int = 61;
+pub const EPROTONOSUPPORT: ::c_int = 62;
+pub const ESOCKTNOSUPPORT: ::c_int = 63;
+pub const EOPNOTSUPP: ::c_int = 64;
+pub const EPFNOSUPPORT: ::c_int = 65;
+pub const EAFNOSUPPORT: ::c_int = 66;
+pub const EADDRINUSE: ::c_int = 67;
+pub const EADDRNOTAVAIL: ::c_int = 68;
+pub const ENETDOWN: ::c_int = 69;
+pub const ENETUNREACH: ::c_int = 70;
+pub const ENETRESET: ::c_int = 71;
+pub const ECONNABORTED: ::c_int = 72;
+pub const ECONNRESET: ::c_int = 73;
+pub const ENOBUFS: ::c_int = 74;
+pub const EISCONN: ::c_int = 75;
+pub const ENOTCONN: ::c_int = 76;
+pub const ESHUTDOWN: ::c_int = 77;
+pub const ETOOMANYREFS: ::c_int = 115;
+pub const ETIMEDOUT: ::c_int = 78;
+pub const ECONNREFUSED: ::c_int = 79;
+pub const EHOSTDOWN: ::c_int = 80;
+pub const EHOSTUNREACH: ::c_int = 81;
+pub const EWOULDBLOCK: ::c_int = EAGAIN;
+pub const EALREADY: ::c_int = 56;
+pub const EINPROGRESS: ::c_int = 55;
+pub const ESTALE: ::c_int = 52;
+
+// sys/dr.h
+pub const LPAR_INFO_FORMAT1: ::c_int = 1;
+pub const LPAR_INFO_FORMAT2: ::c_int = 2;
+pub const WPAR_INFO_FORMAT: ::c_int = 3;
+pub const PROC_MODULE_INFO: ::c_int = 4;
+pub const NUM_PROC_MODULE_TYPES: ::c_int = 5;
+pub const LPAR_INFO_VRME_NUM_POOLS: ::c_int = 6;
+pub const LPAR_INFO_VRME_POOLS: ::c_int = 7;
+pub const LPAR_INFO_VRME_LPAR: ::c_int = 8;
+pub const LPAR_INFO_VRME_RESET_HWMARKS: ::c_int = 9;
+pub const LPAR_INFO_VRME_ALLOW_DESIRED: ::c_int = 10;
+pub const EMTP_INFO_FORMAT: ::c_int = 11;
+pub const LPAR_INFO_LPM_CAPABILITY: ::c_int = 12;
+pub const ENERGYSCALE_INFO: ::c_int = 13;
+
+// sys/file.h
+pub const LOCK_SH: ::c_int = 1;
+pub const LOCK_EX: ::c_int = 2;
+pub const LOCK_NB: ::c_int = 4;
+pub const LOCK_UN: ::c_int = 8;
+
+// sys/flock.h
+pub const F_RDLCK: ::c_short = 0o01;
+pub const F_WRLCK: ::c_short = 0o02;
+pub const F_UNLCK: ::c_short = 0o03;
+
+// sys/fs/quota_common.h
+pub const Q_QUOTAON: ::c_int = 0x100;
+pub const Q_QUOTAOFF: ::c_int = 0x200;
+pub const Q_SETUSE: ::c_int = 0x500;
+pub const Q_SYNC: ::c_int = 0x600;
+pub const Q_GETQUOTA: ::c_int = 0x300;
+pub const Q_SETQLIM: ::c_int = 0x400;
+pub const Q_SETQUOTA: ::c_int = 0x400;
+
+// sys/ioctl.h
+pub const IOCPARM_MASK: ::c_int = 0x7f;
+pub const IOC_VOID: ::c_int = 0x20000000;
+pub const IOC_OUT: ::c_int = 0x40000000;
+pub const IOC_IN: ::c_int = 0x40000000 << 1;
+pub const IOC_INOUT: ::c_int = IOC_IN | IOC_OUT;
+pub const FIOCLEX: ::c_int = 536897025;
+pub const FIONCLEX: ::c_int = 536897026;
+pub const FIONREAD: ::c_int = 1074030207;
+pub const FIONBIO: ::c_int = -2147195266;
+pub const FIOASYNC: ::c_int = -2147195267;
+pub const FIOSETOWN: ::c_int = -2147195268;
+pub const FIOGETOWN: ::c_int = 1074030203;
+pub const TIOCGETD: ::c_int = 0x40047400;
+pub const TIOCSETD: ::c_int = 0x80047401;
+pub const TIOCHPCL: ::c_int = 0x20007402;
+pub const TIOCMODG: ::c_int = 0x40047403;
+pub const TIOCMODS: ::c_int = 0x80047404;
+pub const TIOCM_LE: ::c_int = 0x1;
+pub const TIOCM_DTR: ::c_int = 0x2;
+pub const TIOCM_RTS: ::c_int = 0x4;
+pub const TIOCM_ST: ::c_int = 0x8;
+pub const TIOCM_SR: ::c_int = 0x10;
+pub const TIOCM_CTS: ::c_int = 0x20;
+pub const TIOCM_CAR: ::c_int = 0x40;
+pub const TIOCM_CD: ::c_int = 0x40;
+pub const TIOCM_RNG: ::c_int = 0x80;
+pub const TIOCM_RI: ::c_int = 0x80;
+pub const TIOCM_DSR: ::c_int = 0x100;
+pub const TIOCGETP: ::c_int = 0x40067408;
+pub const TIOCSETP: ::c_int = 0x80067409;
+pub const TIOCSETN: ::c_int = 0x8006740a;
+pub const TIOCEXCL: ::c_int = 0x2000740d;
+pub const TIOCNXCL: ::c_int = 0x2000740e;
+pub const TIOCFLUSH: ::c_int = 0x80047410;
+pub const TIOCSETC: ::c_int = 0x80067411;
+pub const TIOCGETC: ::c_int = 0x40067412;
+pub const TANDEM: ::c_int = 0x1;
+pub const CBREAK: ::c_int = 0x2;
+pub const LCASE: ::c_int = 0x4;
+pub const MDMBUF: ::c_int = 0x800000;
+pub const XTABS: ::c_int = 0xc00;
+pub const SIOCADDMULTI: ::c_int = -2145359567;
+pub const SIOCADDRT: ::c_int = -2143784438;
+pub const SIOCDARP: ::c_int = -2142476000;
+pub const SIOCDELMULTI: ::c_int = -2145359566;
+pub const SIOCDELRT: ::c_int = -2143784437;
+pub const SIOCDIFADDR: ::c_int = -2144835303;
+pub const SIOCGARP: ::c_int = -1068734170;
+pub const SIOCGIFADDR: ::c_int = -1071093471;
+pub const SIOCGIFBRDADDR: ::c_int = -1071093469;
+pub const SIOCGIFCONF: ::c_int = -1072666299;
+pub const SIOCGIFDSTADDR: ::c_int = -1071093470;
+pub const SIOCGIFFLAGS: ::c_int = -1071093487;
+pub const SIOCGIFHWADDR: ::c_int = -1068209771;
+pub const SIOCGIFMETRIC: ::c_int = -1071093481;
+pub const SIOCGIFMTU: ::c_int = -1071093418;
+pub const SIOCGIFNETMASK: ::c_int = -1071093467;
+pub const SIOCSARP: ::c_int = -2142476002;
+pub const SIOCSIFADDR: ::c_int = -2144835316;
+pub const SIOCSIFBRDADDR: ::c_int = -2144835309;
+pub const SIOCSIFDSTADDR: ::c_int = -2144835314;
+pub const SIOCSIFFLAGS: ::c_int = -2144835312;
+pub const SIOCSIFMETRIC: ::c_int = -2144835304;
+pub const SIOCSIFMTU: ::c_int = -2144835240;
+pub const SIOCSIFNETMASK: ::c_int = -2144835306;
+pub const TIOCUCNTL: ::c_int = -2147191706;
+pub const TIOCCONS: ::c_int = -2147191710;
+pub const TIOCPKT: ::c_int = -2147191696;
+pub const TIOCPKT_DATA: ::c_int = 0;
+pub const TIOCPKT_FLUSHREAD: ::c_int = 1;
+pub const TIOCPKT_FLUSHWRITE: ::c_int = 2;
+pub const TIOCPKT_NOSTOP: ::c_int = 0x10;
+pub const TIOCPKT_DOSTOP: ::c_int = 0x20;
+pub const TIOCPKT_START: ::c_int = 8;
+pub const TIOCPKT_STOP: ::c_int = 4;
+
+// sys/ipc.h
+pub const IPC_ALLOC: ::c_int = 0o100000;
+pub const IPC_CREAT: ::c_int = 0o020000;
+pub const IPC_EXCL: ::c_int = 0o002000;
+pub const IPC_NOWAIT: ::c_int = 0o004000;
+pub const IPC_RMID: ::c_int = 0;
+pub const IPC_SET: ::c_int = 101;
+pub const IPC_R: ::c_int = 0o0400;
+pub const IPC_W: ::c_int = 0o0200;
+pub const IPC_O: ::c_int = 0o1000;
+pub const IPC_NOERROR: ::c_int = 0o10000;
+pub const IPC_STAT: ::c_int = 102;
+pub const IPC_PRIVATE: ::key_t = -1;
+pub const SHM_LOCK: ::c_int = 201;
+pub const SHM_UNLOCK: ::c_int = 202;
+
+// sys/ldr.h
+pub const L_GETINFO: ::c_int = 2;
+pub const L_GETMESSAGE: ::c_int = 1;
+pub const L_GETLIBPATH: ::c_int = 3;
+pub const L_GETXINFO: ::c_int = 8;
+
+// sys/limits.h
+pub const PATH_MAX: ::c_int = 1023;
+pub const PAGESIZE: ::c_int = 4096;
+pub const IOV_MAX: ::c_int = 16;
+pub const AIO_LISTIO_MAX: ::c_int = 4096;
+pub const PIPE_BUF: usize = 32768;
+pub const OPEN_MAX: ::c_int = 65534;
+pub const MAX_INPUT: ::c_int = 512;
+pub const MAX_CANON: ::c_int = 256;
+pub const ARG_MAX: ::c_int = 1048576;
+pub const BC_BASE_MAX: ::c_int = 99;
+pub const BC_DIM_MAX: ::c_int = 0x800;
+pub const BC_SCALE_MAX: ::c_int = 99;
+pub const BC_STRING_MAX: ::c_int = 0x800;
+pub const CHARCLASS_NAME_MAX: ::c_int = 14;
+pub const CHILD_MAX: ::c_int = 128;
+pub const COLL_WEIGHTS_MAX: ::c_int = 4;
+pub const EXPR_NEST_MAX: ::c_int = 32;
+pub const NZERO: ::c_int = 20;
+
+// sys/lockf.h
+pub const F_LOCK: ::c_int = 1;
+pub const F_TEST: ::c_int = 3;
+pub const F_TLOCK: ::c_int = 2;
+pub const F_ULOCK: ::c_int = 0;
+
+// sys/machine.h
+pub const BIG_ENDIAN: ::c_int = 4321;
+pub const LITTLE_ENDIAN: ::c_int = 1234;
+pub const PDP_ENDIAN: ::c_int = 3412;
+
+// sys/mman.h
+pub const PROT_NONE: ::c_int = 0;
+pub const PROT_READ: ::c_int = 1;
+pub const PROT_WRITE: ::c_int = 2;
+pub const PROT_EXEC: ::c_int = 4;
+pub const MAP_FILE: ::c_int = 0;
+pub const MAP_SHARED: ::c_int = 1;
+pub const MAP_PRIVATE: ::c_int = 2;
+pub const MAP_FIXED: ::c_int = 0x100;
+pub const MAP_ANON: ::c_int = 0x10;
+pub const MAP_ANONYMOUS: ::c_int = 0x10;
+pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
+pub const MAP_TYPE: ::c_int = 0xf0;
+pub const MCL_CURRENT: ::c_int = 0x100;
+pub const MCL_FUTURE: ::c_int = 0x200;
+pub const MS_SYNC: ::c_int = 0x20;
+pub const MS_ASYNC: ::c_int = 0x10;
+pub const MS_INVALIDATE: ::c_int = 0x40;
+pub const POSIX_MADV_NORMAL: ::c_int = 1;
+pub const POSIX_MADV_RANDOM: ::c_int = 3;
+pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
+pub const POSIX_MADV_WILLNEED: ::c_int = 4;
+pub const POSIX_MADV_DONTNEED: ::c_int = 5;
+pub const MADV_NORMAL: ::c_int = 0;
+pub const MADV_RANDOM: ::c_int = 1;
+pub const MADV_SEQUENTIAL: ::c_int = 2;
+pub const MADV_WILLNEED: ::c_int = 3;
+pub const MADV_DONTNEED: ::c_int = 4;
+
+// sys/mode.h
+pub const S_IFMT: mode_t = 0o170000;
+pub const S_IFREG: mode_t = 0o100000;
+pub const S_IFDIR: mode_t = 0o40000;
+pub const S_IFBLK: mode_t = 0o60000;
+pub const S_IFCHR: mode_t = 0o20000;
+pub const S_IFIFO: mode_t = 0o10000;
+pub const S_IRWXU: mode_t = 0o700;
+pub const S_IRUSR: mode_t = 0o400;
+pub const S_IWUSR: mode_t = 0o200;
+pub const S_IXUSR: mode_t = 0o100;
+pub const S_IRWXG: mode_t = 0o70;
+pub const S_IRGRP: mode_t = 0o40;
+pub const S_IWGRP: mode_t = 0o20;
+pub const S_IXGRP: mode_t = 0o10;
+pub const S_IRWXO: mode_t = 7;
+pub const S_IROTH: mode_t = 4;
+pub const S_IWOTH: mode_t = 2;
+pub const S_IXOTH: mode_t = 1;
+pub const S_IFLNK: mode_t = 0o120000;
+pub const S_IFSOCK: mode_t = 0o140000;
+pub const S_IEXEC: mode_t = 0o100;
+pub const S_IWRITE: mode_t = 0o200;
+pub const S_IREAD: mode_t = 0o400;
+
+// sys/msg.h
+pub const MSG_NOERROR: ::c_int = 0o10000;
+
+// sys/m_signal.h
+pub const SIGSTKSZ: ::size_t = 4096;
+pub const MINSIGSTKSZ: ::size_t = 1200;
+
+// sys/params.h
+pub const MAXPATHLEN: ::c_int = PATH_MAX + 1;
+pub const MAXSYMLINKS: ::c_int = 20;
+pub const MAXHOSTNAMELEN: ::c_int = 256;
+pub const MAXUPRC: ::c_int = 128;
+pub const NGROUPS_MAX: ::c_ulong = 2048;
+pub const NGROUPS: ::c_ulong = NGROUPS_MAX;
+pub const NOFILE: ::c_int = OPEN_MAX;
+
+// sys/poll.h
+pub const POLLIN: ::c_short = 0x0001;
+pub const POLLPRI: ::c_short = 0x0004;
+pub const POLLOUT: ::c_short = 0x0002;
+pub const POLLERR: ::c_short = 0x4000;
+pub const POLLHUP: ::c_short = 0x2000;
+pub const POLLMSG: ::c_short = 0x0080;
+pub const POLLSYNC: ::c_short = 0x8000;
+pub const POLLNVAL: ::c_short = POLLSYNC;
+pub const POLLNORM: ::c_short = POLLIN;
+pub const POLLRDNORM: ::c_short = 0x0010;
+pub const POLLWRNORM: ::c_short = POLLOUT;
+pub const POLLRDBAND: ::c_short = 0x0020;
+pub const POLLWRBAND: ::c_short = 0x0040;
+
+// sys/pollset.h
+pub const PS_ADD: ::c_uchar = 0;
+pub const PS_MOD: ::c_uchar = 1;
+pub const PS_DELETE: ::c_uchar = 2;
+pub const PS_REPLACE: ::c_uchar = 3;
+
+// sys/ptrace.h
+pub const PT_TRACE_ME: ::c_int = 0;
+pub const PT_READ_I: ::c_int = 1;
+pub const PT_READ_D: ::c_int = 2;
+pub const PT_WRITE_I: ::c_int = 4;
+pub const PT_WRITE_D: ::c_int = 5;
+pub const PT_CONTINUE: ::c_int = 7;
+pub const PT_KILL: ::c_int = 8;
+pub const PT_STEP: ::c_int = 9;
+pub const PT_READ_GPR: ::c_int = 11;
+pub const PT_READ_FPR: ::c_int = 12;
+pub const PT_WRITE_GPR: ::c_int = 14;
+pub const PT_WRITE_FPR: ::c_int = 15;
+pub const PT_READ_BLOCK: ::c_int = 17;
+pub const PT_WRITE_BLOCK: ::c_int = 19;
+pub const PT_ATTACH: ::c_int = 30;
+pub const PT_DETACH: ::c_int = 31;
+pub const PT_REGSET: ::c_int = 32;
+pub const PT_REATT: ::c_int = 33;
+pub const PT_LDINFO: ::c_int = 34;
+pub const PT_MULTI: ::c_int = 35;
+pub const PT_NEXT: ::c_int = 36;
+pub const PT_SET: ::c_int = 37;
+pub const PT_CLEAR: ::c_int = 38;
+pub const PT_LDXINFO: ::c_int = 39;
+pub const PT_QUERY: ::c_int = 40;
+pub const PT_WATCH: ::c_int = 41;
+pub const PTT_CONTINUE: ::c_int = 50;
+pub const PTT_STEP: ::c_int = 51;
+pub const PTT_READ_SPRS: ::c_int = 52;
+pub const PTT_WRITE_SPRS: ::c_int = 53;
+pub const PTT_READ_GPRS: ::c_int = 54;
+pub const PTT_WRITE_GPRS: ::c_int = 55;
+pub const PTT_READ_FPRS: ::c_int = 56;
+pub const PTT_WRITE_FPRS: ::c_int = 57;
+pub const PTT_READ_VEC: ::c_int = 58;
+pub const PTT_WRITE_VEC: ::c_int = 59;
+pub const PTT_WATCH: ::c_int = 60;
+pub const PTT_SET_TRAP: ::c_int = 61;
+pub const PTT_CLEAR_TRAP: ::c_int = 62;
+pub const PTT_READ_UKEYSET: ::c_int = 63;
+pub const PT_GET_UKEY: ::c_int = 64;
+pub const PTT_READ_FPSCR_HI: ::c_int = 65;
+pub const PTT_WRITE_FPSCR_HI: ::c_int = 66;
+pub const PTT_READ_VSX: ::c_int = 67;
+pub const PTT_WRITE_VSX: ::c_int = 68;
+pub const PTT_READ_TM: ::c_int = 69;
+pub const PTRACE_ATTACH: ::c_int = 14;
+pub const PTRACE_CONT: ::c_int = 7;
+pub const PTRACE_DETACH: ::c_int = 15;
+pub const PTRACE_GETFPREGS: ::c_int = 12;
+pub const PTRACE_GETREGS: ::c_int = 10;
+pub const PTRACE_KILL: ::c_int = 8;
+pub const PTRACE_PEEKDATA: ::c_int = 2;
+pub const PTRACE_PEEKTEXT: ::c_int = 1;
+pub const PTRACE_PEEKUSER: ::c_int = 3;
+pub const PTRACE_POKEDATA: ::c_int = 5;
+pub const PTRACE_POKETEXT: ::c_int = 4;
+pub const PTRACE_POKEUSER: ::c_int = 6;
+pub const PTRACE_SETFPREGS: ::c_int = 13;
+pub const PTRACE_SETREGS: ::c_int = 11;
+pub const PTRACE_SINGLESTEP: ::c_int = 9;
+pub const PTRACE_SYSCALL: ::c_int = 16;
+pub const PTRACE_TRACEME: ::c_int = 0;
+
+// sys/resource.h
+pub const RLIMIT_CPU: ::c_int = 0;
+pub const RLIMIT_FSIZE: ::c_int = 1;
+pub const RLIMIT_DATA: ::c_int = 2;
+pub const RLIMIT_STACK: ::c_int = 3;
+pub const RLIMIT_CORE: ::c_int = 4;
+pub const RLIMIT_RSS: ::c_int = 5;
+pub const RLIMIT_AS: ::c_int = 6;
+pub const RLIMIT_NOFILE: ::c_int = 7;
+pub const RLIMIT_THREADS: ::c_int = 8;
+pub const RLIMIT_NPROC: ::c_int = 9;
+pub const RUSAGE_SELF: ::c_int = 0;
+pub const RUSAGE_CHILDREN: ::c_int = -1;
+pub const PRIO_PROCESS: ::c_int = 0;
+pub const PRIO_PGRP: ::c_int = 1;
+pub const PRIO_USER: ::c_int = 2;
+pub const RUSAGE_THREAD: ::c_int = 1;
+pub const RLIM_SAVED_MAX: ::c_ulong = RLIM_INFINITY - 1;
+pub const RLIM_SAVED_CUR: ::c_ulong = RLIM_INFINITY - 2;
+#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+pub const RLIM_NLIMITS: ::c_int = 10;
+
+// sys/sched.h
+pub const SCHED_OTHER: ::c_int = 0;
+pub const SCHED_FIFO: ::c_int = 1;
+pub const SCHED_RR: ::c_int = 2;
+pub const SCHED_LOCAL: ::c_int = 3;
+pub const SCHED_GLOBAL: ::c_int = 4;
+pub const SCHED_FIFO2: ::c_int = 5;
+pub const SCHED_FIFO3: ::c_int = 6;
+pub const SCHED_FIFO4: ::c_int = 7;
+
+// sys/sem.h
+pub const SEM_UNDO: ::c_int = 0o10000;
+pub const GETNCNT: ::c_int = 3;
+pub const GETPID: ::c_int = 4;
+pub const GETVAL: ::c_int = 5;
+pub const GETALL: ::c_int = 6;
+pub const GETZCNT: ::c_int = 7;
+pub const SETVAL: ::c_int = 8;
+pub const SETALL: ::c_int = 9;
+
+// sys/shm.h
+pub const SHMLBA: ::c_int = 0x10000000;
+pub const SHMLBA_EXTSHM: ::c_int = 0x1000;
+pub const SHM_SHMAT: ::c_int = 0x80000000;
+pub const SHM_RDONLY: ::c_int = 0o10000;
+pub const SHM_RND: ::c_int = 0o20000;
+pub const SHM_PIN: ::c_int = 0o4000;
+pub const SHM_LGPAGE: ::c_int = 0o20000000000;
+pub const SHM_MAP: ::c_int = 0o4000;
+pub const SHM_FMAP: ::c_int = 0o2000;
+pub const SHM_COPY: ::c_int = 0o40000;
+pub const SHM_CLEAR: ::c_int = 0;
+pub const SHM_HGSEG: ::c_int = 0o10000000000;
+pub const SHM_R: ::c_int = IPC_R;
+pub const SHM_W: ::c_int = IPC_W;
+pub const SHM_DEST: ::c_int = 0o2000;
+
+// sys/signal.h
+pub const SA_ONSTACK: ::c_int = 0x00000001;
+pub const SA_RESETHAND: ::c_int = 0x00000002;
+pub const SA_RESTART: ::c_int = 0x00000008;
+pub const SA_SIGINFO: ::c_int = 0x00000100;
+pub const SA_NODEFER: ::c_int = 0x00000200;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000400;
+pub const SA_NOCLDSTOP: ::c_int = 0x00000004;
+pub const SS_ONSTACK: ::c_int = 0x00000001;
+pub const SS_DISABLE: ::c_int = 0x00000002;
+pub const SIGCHLD: ::c_int = 20;
+pub const SIGBUS: ::c_int = 10;
+pub const SIG_BLOCK: ::c_int = 0;
+pub const SIG_UNBLOCK: ::c_int = 1;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIGEV_NONE: ::c_int = 1;
+pub const SIGEV_SIGNAL: ::c_int = 2;
+pub const SIGEV_THREAD: ::c_int = 3;
+pub const SIGHUP: ::c_int = 1;
+pub const SIGINT: ::c_int = 2;
+pub const SIGQUIT: ::c_int = 3;
+pub const SIGILL: ::c_int = 4;
+pub const SIGABRT: ::c_int = 6;
+pub const SIGEMT: ::c_int = 7;
+pub const SIGFPE: ::c_int = 8;
+pub const SIGKILL: ::c_int = 9;
+pub const SIGSEGV: ::c_int = 11;
+pub const SIGSYS: ::c_int = 12;
+pub const SIGPIPE: ::c_int = 13;
+pub const SIGALRM: ::c_int = 14;
+pub const SIGTERM: ::c_int = 15;
+pub const SIGUSR1: ::c_int = 30;
+pub const SIGUSR2: ::c_int = 31;
+pub const SIGPWR: ::c_int = 29;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGURG: ::c_int = 16;
+pub const SIGPOLL: ::c_int = SIGIO;
+pub const SIGIO: ::c_int = 23;
+pub const SIGSTOP: ::c_int = 17;
+pub const SIGTSTP: ::c_int = 18;
+pub const SIGCONT: ::c_int = 19;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGVTALRM: ::c_int = 34;
+pub const SIGPROF: ::c_int = 32;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGTRAP: ::c_int = 5;
+pub const SIGCLD: ::c_int = 20;
+pub const SIGRTMAX: ::c_int = 57;
+pub const SIGRTMIN: ::c_int = 50;
+pub const SI_USER: ::c_int = 0;
+pub const SI_UNDEFINED: ::c_int = 8;
+pub const SI_EMPTY: ::c_int = 9;
+pub const BUS_ADRALN: ::c_int = 1;
+pub const BUS_ADRERR: ::c_int = 2;
+pub const BUS_OBJERR: ::c_int = 3;
+pub const BUS_UEGARD: ::c_int = 4;
+pub const CLD_EXITED: ::c_int = 10;
+pub const CLD_KILLED: ::c_int = 11;
+pub const CLD_DUMPED: ::c_int = 12;
+pub const CLD_TRAPPED: ::c_int = 13;
+pub const CLD_STOPPED: ::c_int = 14;
+pub const CLD_CONTINUED: ::c_int = 15;
+pub const FPE_INTDIV: ::c_int = 20;
+pub const FPE_INTOVF: ::c_int = 21;
+pub const FPE_FLTDIV: ::c_int = 22;
+pub const FPE_FLTOVF: ::c_int = 23;
+pub const FPE_FLTUND: ::c_int = 24;
+pub const FPE_FLTRES: ::c_int = 25;
+pub const FPE_FLTINV: ::c_int = 26;
+pub const FPE_FLTSUB: ::c_int = 27;
+pub const ILL_ILLOPC: ::c_int = 30;
+pub const ILL_ILLOPN: ::c_int = 31;
+pub const ILL_ILLADR: ::c_int = 32;
+pub const ILL_ILLTRP: ::c_int = 33;
+pub const ILL_PRVOPC: ::c_int = 34;
+pub const ILL_PRVREG: ::c_int = 35;
+pub const ILL_COPROC: ::c_int = 36;
+pub const ILL_BADSTK: ::c_int = 37;
+pub const ILL_TMBADTHING: ::c_int = 38;
+pub const POLL_IN: ::c_int = 40;
+pub const POLL_OUT: ::c_int = 41;
+pub const POLL_MSG: ::c_int = -3;
+pub const POLL_ERR: ::c_int = 43;
+pub const POLL_PRI: ::c_int = 44;
+pub const POLL_HUP: ::c_int = 45;
+pub const SEGV_MAPERR: ::c_int = 50;
+pub const SEGV_ACCERR: ::c_int = 51;
+pub const SEGV_KEYERR: ::c_int = 52;
+pub const TRAP_BRKPT: ::c_int = 60;
+pub const TRAP_TRACE: ::c_int = 61;
+pub const SI_QUEUE: ::c_int = 71;
+pub const SI_TIMER: ::c_int = 72;
+pub const SI_ASYNCIO: ::c_int = 73;
+pub const SI_MESGQ: ::c_int = 74;
+
+// sys/socket.h
+pub const AF_UNSPEC: ::c_int = 0;
+pub const AF_UNIX: ::c_int = 1;
+pub const AF_INET: ::c_int = 2;
+pub const AF_IMPLINK: ::c_int = 3;
+pub const AF_PUP: ::c_int = 4;
+pub const AF_CHAOS: ::c_int = 5;
+pub const AF_NS: ::c_int = 6;
+pub const AF_ECMA: ::c_int = 8;
+pub const AF_DATAKIT: ::c_int = 9;
+pub const AF_CCITT: ::c_int = 10;
+pub const AF_SNA: ::c_int = 11;
+pub const AF_DECnet: ::c_int = 12;
+pub const AF_DLI: ::c_int = 13;
+pub const AF_LAT: ::c_int = 14;
+pub const SO_TIMESTAMPNS: ::c_int = 0x100a;
+pub const SOMAXCONN: ::c_int = 1024;
+pub const AF_LOCAL: ::c_int = AF_UNIX;
+pub const UIO_MAXIOV: ::c_int = 1024;
+pub const pseudo_AF_XTP: ::c_int = 19;
+pub const AF_HYLINK: ::c_int = 15;
+pub const AF_APPLETALK: ::c_int = 16;
+pub const AF_ISO: ::c_int = 7;
+pub const AF_OSI: ::c_int = AF_ISO;
+pub const AF_ROUTE: ::c_int = 17;
+pub const AF_LINK: ::c_int = 18;
+pub const AF_INET6: ::c_int = 24;
+pub const AF_INTF: ::c_int = 20;
+pub const AF_RIF: ::c_int = 21;
+pub const AF_NDD: ::c_int = 23;
+pub const AF_MAX: ::c_int = 30;
+pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
+pub const PF_UNIX: ::c_int = AF_UNIX;
+pub const PF_INET: ::c_int = AF_INET;
+pub const PF_IMPLINK: ::c_int = AF_IMPLINK;
+pub const PF_PUP: ::c_int = AF_PUP;
+pub const PF_CHAOS: ::c_int = AF_CHAOS;
+pub const PF_NS: ::c_int = AF_NS;
+pub const PF_ISO: ::c_int = AF_ISO;
+pub const PF_OSI: ::c_int = AF_ISO;
+pub const PF_ECMA: ::c_int = AF_ECMA;
+pub const PF_DATAKIT: ::c_int = AF_DATAKIT;
+pub const PF_CCITT: ::c_int = AF_CCITT;
+pub const PF_SNA: ::c_int = AF_SNA;
+pub const PF_DECnet: ::c_int = AF_DECnet;
+pub const PF_DLI: ::c_int = AF_DLI;
+pub const PF_LAT: ::c_int = AF_LAT;
+pub const PF_HYLINK: ::c_int = AF_HYLINK;
+pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
+pub const PF_ROUTE: ::c_int = AF_ROUTE;
+pub const PF_LINK: ::c_int = AF_LINK;
+pub const PF_XTP: ::c_int = 19;
+pub const PF_RIF: ::c_int = AF_RIF;
+pub const PF_INTF: ::c_int = AF_INTF;
+pub const PF_NDD: ::c_int = AF_NDD;
+pub const PF_INET6: ::c_int = AF_INET6;
+pub const PF_MAX: ::c_int = AF_MAX;
+pub const SF_CLOSE: ::c_int = 1;
+pub const SF_REUSE: ::c_int = 2;
+pub const SF_DONT_CACHE: ::c_int = 4;
+pub const SF_SYNC_CACHE: ::c_int = 8;
+pub const SOCK_DGRAM: ::c_int = 2;
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_RAW: ::c_int = 3;
+pub const SOCK_RDM: ::c_int = 4;
+pub const SOCK_SEQPACKET: ::c_int = 5;
+pub const SOL_SOCKET: ::c_int = 0xffff;
+pub const SO_DEBUG: ::c_int = 0x0001;
+pub const SO_ACCEPTCONN: ::c_int = 0x0002;
+pub const SO_REUSEADDR: ::c_int = 0x0004;
+pub const SO_KEEPALIVE: ::c_int = 0x0008;
+pub const SO_DONTROUTE: ::c_int = 0x0010;
+pub const SO_BROADCAST: ::c_int = 0x0020;
+pub const SO_USELOOPBACK: ::c_int = 0x0040;
+pub const SO_LINGER: ::c_int = 0x0080;
+pub const SO_OOBINLINE: ::c_int = 0x0100;
+pub const SO_REUSEPORT: ::c_int = 0x0200;
+pub const SO_USE_IFBUFS: ::c_int = 0x0400;
+pub const SO_CKSUMRECV: ::c_int = 0x0800;
+pub const SO_NOREUSEADDR: ::c_int = 0x1000;
+pub const SO_KERNACCEPT: ::c_int = 0x2000;
+pub const SO_NOMULTIPATH: ::c_int = 0x4000;
+pub const SO_AUDIT: ::c_int = 0x8000;
+pub const SO_SNDBUF: ::c_int = 0x1001;
+pub const SO_RCVBUF: ::c_int = 0x1002;
+pub const SO_SNDLOWAT: ::c_int = 0x1003;
+pub const SO_RCVLOWAT: ::c_int = 0x1004;
+pub const SO_SNDTIMEO: ::c_int = 0x1005;
+pub const SO_RCVTIMEO: ::c_int = 0x1006;
+pub const SO_ERROR: ::c_int = 0x1007;
+pub const SO_TYPE: ::c_int = 0x1008;
+pub const SCM_RIGHTS: ::c_int = 0x01;
+pub const MSG_OOB: ::c_int = 0x1;
+pub const MSG_PEEK: ::c_int = 0x2;
+pub const MSG_DONTROUTE: ::c_int = 0x4;
+pub const MSG_EOR: ::c_int = 0x8;
+pub const MSG_TRUNC: ::c_int = 0x10;
+pub const MSG_CTRUNC: ::c_int = 0x20;
+pub const MSG_WAITALL: ::c_int = 0x40;
+pub const MSG_MPEG2: ::c_int = 0x80;
+pub const MSG_NOSIGNAL: ::c_int = 0x100;
+pub const MSG_WAITFORONE: ::c_int = 0x200;
+pub const MSG_ARGEXT: ::c_int = 0x400;
+pub const MSG_NONBLOCK: ::c_int = 0x4000;
+pub const MSG_COMPAT: ::c_int = 0x8000;
+pub const MSG_MAXIOVLEN: ::c_int = 16;
+pub const SHUT_RD: ::c_int = 0;
+pub const SHUT_WR: ::c_int = 1;
+pub const SHUT_RDWR: ::c_int = 2;
+
+// sys/stat.h
+pub const UTIME_NOW: ::c_int = -2;
+pub const UTIME_OMIT: ::c_int = -3;
+
+// sys/statvfs.h
+pub const ST_RDONLY: ::c_ulong = 0x0001;
+pub const ST_NOSUID: ::c_ulong = 0x0040;
+pub const ST_NODEV: ::c_ulong = 0x0080;
+
+// sys/stropts.h
+pub const I_NREAD: ::c_int = 0x20005301;
+pub const I_PUSH: ::c_int = 0x20005302;
+pub const I_POP: ::c_int = 0x20005303;
+pub const I_LOOK: ::c_int = 0x20005304;
+pub const I_FLUSH: ::c_int = 0x20005305;
+pub const I_SRDOPT: ::c_int = 0x20005306;
+pub const I_GRDOPT: ::c_int = 0x20005307;
+pub const I_STR: ::c_int = 0x20005308;
+pub const I_SETSIG: ::c_int = 0x20005309;
+pub const I_GETSIG: ::c_int = 0x2000530a;
+pub const I_FIND: ::c_int = 0x2000530b;
+pub const I_LINK: ::c_int = 0x2000530c;
+pub const I_UNLINK: ::c_int = 0x2000530d;
+pub const I_PEEK: ::c_int = 0x2000530f;
+pub const I_FDINSERT: ::c_int = 0x20005310;
+pub const I_SENDFD: ::c_int = 0x20005311;
+pub const I_RECVFD: ::c_int = 0x20005312;
+pub const I_SWROPT: ::c_int = 0x20005314;
+pub const I_GWROPT: ::c_int = 0x20005315;
+pub const I_LIST: ::c_int = 0x20005316;
+pub const I_PLINK: ::c_int = 0x2000531d;
+pub const I_PUNLINK: ::c_int = 0x2000531e;
+pub const I_FLUSHBAND: ::c_int = 0x20005313;
+pub const I_CKBAND: ::c_int = 0x20005318;
+pub const I_GETBAND: ::c_int = 0x20005319;
+pub const I_ATMARK: ::c_int = 0x20005317;
+pub const I_SETCLTIME: ::c_int = 0x2000531b;
+pub const I_GETCLTIME: ::c_int = 0x2000531c;
+pub const I_CANPUT: ::c_int = 0x2000531a;
+
+// sys/syslog.h
+pub const LOG_CRON: ::c_int = 9 << 3;
+pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
+pub const LOG_NFACILITIES: ::c_int = 24;
+pub const LOG_PERROR: ::c_int = 0x20;
+
+// sys/systemcfg.h
+pub const SC_ARCH: ::c_int = 1;
+pub const SC_IMPL: ::c_int = 2;
+pub const SC_VERS: ::c_int = 3;
+pub const SC_WIDTH: ::c_int = 4;
+pub const SC_NCPUS: ::c_int = 5;
+pub const SC_L1C_ATTR: ::c_int = 6;
+pub const SC_L1C_ISZ: ::c_int = 7;
+pub const SC_L1C_DSZ: ::c_int = 8;
+pub const SC_L1C_ICA: ::c_int = 9;
+pub const SC_L1C_DCA: ::c_int = 10;
+pub const SC_L1C_IBS: ::c_int = 11;
+pub const SC_L1C_DBS: ::c_int = 12;
+pub const SC_L1C_ILS: ::c_int = 13;
+pub const SC_L1C_DLS: ::c_int = 14;
+pub const SC_L2C_SZ: ::c_int = 15;
+pub const SC_L2C_AS: ::c_int = 16;
+pub const SC_TLB_ATTR: ::c_int = 17;
+pub const SC_ITLB_SZ: ::c_int = 18;
+pub const SC_DTLB_SZ: ::c_int = 19;
+pub const SC_ITLB_ATT: ::c_int = 20;
+pub const SC_DTLB_ATT: ::c_int = 21;
+pub const SC_RESRV_SZ: ::c_int = 22;
+pub const SC_PRI_LC: ::c_int = 23;
+pub const SC_PRO_LC: ::c_int = 24;
+pub const SC_RTC_TYPE: ::c_int = 25;
+pub const SC_VIRT_AL: ::c_int = 26;
+pub const SC_CAC_CONG: ::c_int = 27;
+pub const SC_MOD_ARCH: ::c_int = 28;
+pub const SC_MOD_IMPL: ::c_int = 29;
+pub const SC_XINT: ::c_int = 30;
+pub const SC_XFRAC: ::c_int = 31;
+pub const SC_KRN_ATTR: ::c_int = 32;
+pub const SC_PHYSMEM: ::c_int = 33;
+pub const SC_SLB_ATTR: ::c_int = 34;
+pub const SC_SLB_SZ: ::c_int = 35;
+pub const SC_MAX_NCPUS: ::c_int = 37;
+pub const SC_MAX_REALADDR: ::c_int = 38;
+pub const SC_ORIG_ENT_CAP: ::c_int = 39;
+pub const SC_ENT_CAP: ::c_int = 40;
+pub const SC_DISP_WHE: ::c_int = 41;
+pub const SC_CAPINC: ::c_int = 42;
+pub const SC_VCAPW: ::c_int = 43;
+pub const SC_SPLP_STAT: ::c_int = 44;
+pub const SC_SMT_STAT: ::c_int = 45;
+pub const SC_SMT_TC: ::c_int = 46;
+pub const SC_VMX_VER: ::c_int = 47;
+pub const SC_LMB_SZ: ::c_int = 48;
+pub const SC_MAX_XCPU: ::c_int = 49;
+pub const SC_EC_LVL: ::c_int = 50;
+pub const SC_AME_STAT: ::c_int = 51;
+pub const SC_ECO_STAT: ::c_int = 52;
+pub const SC_DFP_VER: ::c_int = 53;
+pub const SC_VRM_STAT: ::c_int = 54;
+pub const SC_PHYS_IMP: ::c_int = 55;
+pub const SC_PHYS_VER: ::c_int = 56;
+pub const SC_SPCM_STATUS: ::c_int = 57;
+pub const SC_SPCM_MAX: ::c_int = 58;
+pub const SC_TM_VER: ::c_int = 59;
+pub const SC_NX_CAP: ::c_int = 60;
+pub const SC_PKS_STATE: ::c_int = 61;
+pub const SC_MMA_VER: ::c_int = 62;
+pub const POWER_RS: ::c_int = 1;
+pub const POWER_PC: ::c_int = 2;
+pub const IA64: ::c_int = 3;
+pub const POWER_RS1: ::c_int = 0x1;
+pub const POWER_RSC: ::c_int = 0x2;
+pub const POWER_RS2: ::c_int = 0x4;
+pub const POWER_601: ::c_int = 0x8;
+pub const POWER_604: ::c_int = 0x10;
+pub const POWER_603: ::c_int = 0x20;
+pub const POWER_620: ::c_int = 0x40;
+pub const POWER_630: ::c_int = 0x80;
+pub const POWER_A35: ::c_int = 0x100;
+pub const POWER_RS64II: ::c_int = 0x200;
+pub const POWER_RS64III: ::c_int = 0x400;
+pub const POWER_4: ::c_int = 0x800;
+pub const POWER_RS64IV: ::c_int = POWER_4;
+pub const POWER_MPC7450: ::c_int = 0x1000;
+pub const POWER_5: ::c_int = 0x2000;
+pub const POWER_6: ::c_int = 0x4000;
+pub const POWER_7: ::c_int = 0x8000;
+pub const POWER_8: ::c_int = 0x10000;
+pub const POWER_9: ::c_int = 0x20000;
+
+// sys/time.h
+pub const FD_SETSIZE: usize = 65534;
+pub const TIMEOFDAY: ::c_int = 9;
+pub const CLOCK_REALTIME: ::clockid_t = TIMEOFDAY as clockid_t;
+pub const CLOCK_MONOTONIC: ::clockid_t = 10;
+pub const TIMER_ABSTIME: ::c_int = 999;
+pub const ITIMER_REAL: ::c_int = 0;
+pub const ITIMER_VIRTUAL: ::c_int = 1;
+pub const ITIMER_PROF: ::c_int = 2;
+pub const ITIMER_VIRT: ::c_int = 3;
+pub const ITIMER_REAL1: ::c_int = 20;
+pub const ITIMER_REAL_TH: ::c_int = ITIMER_REAL1;
+pub const DST_AUST: ::c_int = 2;
+pub const DST_CAN: ::c_int = 6;
+pub const DST_EET: ::c_int = 5;
+pub const DST_MET: ::c_int = 4;
+pub const DST_NONE: ::c_int = 0;
+pub const DST_USA: ::c_int = 1;
+pub const DST_WET: ::c_int = 3;
+
+// sys/termio.h
+pub const CSTART: ::tcflag_t = 0o21;
+pub const CSTOP: ::tcflag_t = 0o23;
+pub const TCGETA: ::c_int = TIOC | 5;
+pub const TCSETA: ::c_int = TIOC | 6;
+pub const TCSETAW: ::c_int = TIOC | 7;
+pub const TCSETAF: ::c_int = TIOC | 8;
+pub const TCSBRK: ::c_int = TIOC | 9;
+pub const TCXONC: ::c_int = TIOC | 11;
+pub const TCFLSH: ::c_int = TIOC | 12;
+pub const TCGETS: ::c_int = TIOC | 1;
+pub const TCSETS: ::c_int = TIOC | 2;
+pub const TCSANOW: ::c_int = 0;
+pub const TCSETSW: ::c_int = TIOC | 3;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSETSF: ::c_int = TIOC | 4;
+pub const TCSAFLUSH: ::c_int = 2;
+pub const TCIFLUSH: ::c_int = 0;
+pub const TCOFLUSH: ::c_int = 1;
+pub const TCIOFLUSH: ::c_int = 2;
+pub const TCOOFF: ::c_int = 0;
+pub const TCOON: ::c_int = 1;
+pub const TCIOFF: ::c_int = 2;
+pub const TCION: ::c_int = 3;
+pub const TIOC: ::c_int = 0x5400;
+pub const TIOCGWINSZ: ::c_int = 0x40087468;
+pub const TIOCSWINSZ: ::c_int = 0x80087467;
+pub const TIOCLBIS: ::c_int = 0x8004747f;
+pub const TIOCLBIC: ::c_int = 0x8004747e;
+pub const TIOCLSET: ::c_int = 0x8004747d;
+pub const TIOCLGET: ::c_int = 0x4004747c;
+pub const TIOCSBRK: ::c_int = 0x2000747b;
+pub const TIOCCBRK: ::c_int = 0x2000747a;
+pub const TIOCSDTR: ::c_int = 0x20007479;
+pub const TIOCCDTR: ::c_int = 0x20007478;
+pub const TIOCSLTC: ::c_int = 0x80067475;
+pub const TIOCGLTC: ::c_int = 0x40067474;
+pub const TIOCOUTQ: ::c_int = 0x40047473;
+pub const TIOCNOTTY: ::c_int = 0x20007471;
+pub const TIOCSTOP: ::c_int = 0x2000746f;
+pub const TIOCSTART: ::c_int = 0x2000746e;
+pub const TIOCGPGRP: ::c_int = 0x40047477;
+pub const TIOCSPGRP: ::c_int = 0x80047476;
+pub const TIOCGSID: ::c_int = 0x40047448;
+pub const TIOCSTI: ::c_int = 0x80017472;
+pub const TIOCMSET: ::c_int = 0x8004746d;
+pub const TIOCMBIS: ::c_int = 0x8004746c;
+pub const TIOCMBIC: ::c_int = 0x8004746b;
+pub const TIOCMGET: ::c_int = 0x4004746a;
+pub const TIOCREMOTE: ::c_int = 0x80047469;
+
+// sys/user.h
+pub const MAXCOMLEN: ::c_int = 32;
+pub const UF_SYSTEM: ::c_int = 0x1000;
+
+// sys/vattr.h
+pub const AT_FLAGS: ::c_int = 0x80;
+pub const AT_GID: ::c_int = 8;
+pub const AT_UID: ::c_int = 4;
+
+// sys/wait.h
+pub const P_ALL: ::c_int = 0;
+pub const P_PID: ::c_int = 1;
+pub const P_PGID: ::c_int = 2;
+pub const WNOHANG: ::c_int = 0x1;
+pub const WUNTRACED: ::c_int = 0x2;
+pub const WEXITED: ::c_int = 0x04;
+pub const WCONTINUED: ::c_int = 0x01000000;
+pub const WNOWAIT: ::c_int = 0x10;
+pub const WSTOPPED: ::c_int = _W_STOPPED;
+pub const _W_STOPPED: ::c_int = 0x00000040;
+pub const _W_SLWTED: ::c_int = 0x0000007c;
+pub const _W_SEWTED: ::c_int = 0x0000007d;
+pub const _W_SFWTED: ::c_int = 0x0000007e;
+pub const _W_STRC: ::c_int = 0x0000007f;
+
+// termios.h
+pub const NCCS: usize = 16;
+pub const OLCUC: ::tcflag_t = 2;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS5: ::tcflag_t = 0x00000000;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const ECHO: ::tcflag_t = 0x20000;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOCTL: ::tcflag_t = 0x00020000;
+pub const ECHOPRT: ::tcflag_t = 0x00040000;
+pub const ECHOKE: ::tcflag_t = 0x00080000;
+pub const IGNBRK: ::tcflag_t = 0x00000001;
+pub const BRKINT: ::tcflag_t = 0x00000002;
+pub const IGNPAR: ::tcflag_t = 0x00000004;
+pub const PARMRK: ::tcflag_t = 0x00000008;
+pub const INPCK: ::tcflag_t = 0x00000010;
+pub const ISTRIP: ::tcflag_t = 0x00000020;
+pub const INLCR: ::tcflag_t = 0x00000040;
+pub const IGNCR: ::tcflag_t = 0x00000080;
+pub const ICRNL: ::tcflag_t = 0x00000100;
+pub const IXON: ::tcflag_t = 0x0001;
+pub const IXOFF: ::tcflag_t = 0x00000400;
+pub const IXANY: ::tcflag_t = 0x00001000;
+pub const IMAXBEL: ::tcflag_t = 0x00010000;
+pub const OPOST: ::tcflag_t = 0x00000001;
+pub const ONLCR: ::tcflag_t = 0x00000004;
+pub const OCRNL: ::tcflag_t = 0x00000008;
+pub const ONOCR: ::tcflag_t = 0x00000010;
+pub const ONLRET: ::tcflag_t = 0x00000020;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const IEXTEN: ::tcflag_t = 0x00200000;
+pub const TOSTOP: ::tcflag_t = 0x00010000;
+pub const FLUSHO: ::tcflag_t = 0x00100000;
+pub const PENDIN: ::tcflag_t = 0x20000000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const VINTR: usize = 0;
+pub const VQUIT: usize = 1;
+pub const VERASE: usize = 2;
+pub const VKILL: usize = 3;
+pub const VEOF: usize = 4;
+pub const VEOL: usize = 5;
+pub const VSTART: usize = 7;
+pub const VSTOP: usize = 8;
+pub const VSUSP: usize = 9;
+pub const VMIN: usize = 4;
+pub const VTIME: usize = 5;
+pub const VEOL2: usize = 6;
+pub const VDSUSP: usize = 10;
+pub const VREPRINT: usize = 11;
+pub const VDISCRD: usize = 12;
+pub const VWERSE: usize = 13;
+pub const VLNEXT: usize = 14;
+pub const B0: ::speed_t = 0x0;
+pub const B50: ::speed_t = 0x1;
+pub const B75: ::speed_t = 0x2;
+pub const B110: ::speed_t = 0x3;
+pub const B134: ::speed_t = 0x4;
+pub const B150: ::speed_t = 0x5;
+pub const B200: ::speed_t = 0x6;
+pub const B300: ::speed_t = 0x7;
+pub const B600: ::speed_t = 0x8;
+pub const B1200: ::speed_t = 0x9;
+pub const B1800: ::speed_t = 0xa;
+pub const B2400: ::speed_t = 0xb;
+pub const B4800: ::speed_t = 0xc;
+pub const B9600: ::speed_t = 0xd;
+pub const B19200: ::speed_t = 0xe;
+pub const B38400: ::speed_t = 0xf;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const IUCLC: ::tcflag_t = 0x00000800;
+pub const OFILL: ::tcflag_t = 0x00000040;
+pub const OFDEL: ::tcflag_t = 0x00000080;
+pub const CRDLY: ::tcflag_t = 0x00000300;
+pub const CR0: ::tcflag_t = 0x00000000;
+pub const CR1: ::tcflag_t = 0x00000100;
+pub const CR2: ::tcflag_t = 0x00000200;
+pub const CR3: ::tcflag_t = 0x00000300;
+pub const TABDLY: ::tcflag_t = 0x00000c00;
+pub const TAB0: ::tcflag_t = 0x00000000;
+pub const TAB1: ::tcflag_t = 0x00000400;
+pub const TAB2: ::tcflag_t = 0x00000800;
+pub const TAB3: ::tcflag_t = 0x00000c00;
+pub const BSDLY: ::tcflag_t = 0x00001000;
+pub const BS0: ::tcflag_t = 0x00000000;
+pub const BS1: ::tcflag_t = 0x00001000;
+pub const FFDLY: ::tcflag_t = 0x00002000;
+pub const FF0: ::tcflag_t = 0x00000000;
+pub const FF1: ::tcflag_t = 0x00002000;
+pub const NLDLY: ::tcflag_t = 0x00004000;
+pub const NL0: ::tcflag_t = 0x00000000;
+pub const NL1: ::tcflag_t = 0x00004000;
+pub const VTDLY: ::tcflag_t = 0x00008000;
+pub const VT0: ::tcflag_t = 0x00000000;
+pub const VT1: ::tcflag_t = 0x00008000;
+pub const OXTABS: ::tcflag_t = 0x00040000;
+pub const ONOEOT: ::tcflag_t = 0x00080000;
+pub const CBAUD: ::tcflag_t = 0x0000000f;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const CIBAUD: ::tcflag_t = 0x000f0000;
+pub const IBSHIFT: ::tcflag_t = 16;
+pub const PAREXT: ::tcflag_t = 0x00100000;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const XCASE: ::tcflag_t = 0x00000004;
+pub const ALTWERASE: ::tcflag_t = 0x00400000;
+
+// time.h
+pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 11;
+pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 12;
+
+// unistd.h
+pub const STDIN_FILENO: ::c_int = 0;
+pub const STDOUT_FILENO: ::c_int = 1;
+pub const STDERR_FILENO: ::c_int = 2;
+pub const _POSIX_VDISABLE: ::c_int = 0xff;
+pub const _PC_LINK_MAX: ::c_int = 11;
+pub const _PC_MAX_CANON: ::c_int = 12;
+pub const _PC_MAX_INPUT: ::c_int = 13;
+pub const _PC_NAME_MAX: ::c_int = 14;
+pub const _PC_PATH_MAX: ::c_int = 16;
+pub const _PC_PIPE_BUF: ::c_int = 17;
+pub const _PC_NO_TRUNC: ::c_int = 15;
+pub const _PC_VDISABLE: ::c_int = 18;
+pub const _PC_CHOWN_RESTRICTED: ::c_int = 10;
+pub const _PC_ASYNC_IO: ::c_int = 19;
+pub const _PC_PRIO_IO: ::c_int = 21;
+pub const _PC_SYNC_IO: ::c_int = 20;
+pub const _PC_ALLOC_SIZE_MIN: ::c_int = 26;
+pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 27;
+pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 28;
+pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 29;
+pub const _PC_REC_XFER_ALIGN: ::c_int = 30;
+pub const _PC_SYMLINK_MAX: ::c_int = 25;
+pub const _PC_2_SYMLINKS: ::c_int = 31;
+pub const _PC_TIMESTAMP_RESOLUTION: ::c_int = 32;
+pub const _PC_FILESIZEBITS: ::c_int = 22;
+pub const _SC_ARG_MAX: ::c_int = 0;
+pub const _SC_CHILD_MAX: ::c_int = 1;
+pub const _SC_CLK_TCK: ::c_int = 2;
+pub const _SC_NGROUPS_MAX: ::c_int = 3;
+pub const _SC_OPEN_MAX: ::c_int = 4;
+pub const _SC_JOB_CONTROL: ::c_int = 7;
+pub const _SC_SAVED_IDS: ::c_int = 8;
+pub const _SC_VERSION: ::c_int = 9;
+pub const _SC_PASS_MAX: ::c_int = 45;
+pub const _SC_PAGESIZE: ::c_int = _SC_PAGE_SIZE;
+pub const _SC_PAGE_SIZE: ::c_int = 48;
+pub const _SC_XOPEN_VERSION: ::c_int = 46;
+pub const _SC_NPROCESSORS_CONF: ::c_int = 71;
+pub const _SC_NPROCESSORS_ONLN: ::c_int = 72;
+pub const _SC_STREAM_MAX: ::c_int = 5;
+pub const _SC_TZNAME_MAX: ::c_int = 6;
+pub const _SC_AIO_LISTIO_MAX: ::c_int = 75;
+pub const _SC_AIO_MAX: ::c_int = 76;
+pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 77;
+pub const _SC_ASYNCHRONOUS_IO: ::c_int = 78;
+pub const _SC_DELAYTIMER_MAX: ::c_int = 79;
+pub const _SC_FSYNC: ::c_int = 80;
+pub const _SC_MAPPED_FILES: ::c_int = 84;
+pub const _SC_MEMLOCK: ::c_int = 85;
+pub const _SC_MEMLOCK_RANGE: ::c_int = 86;
+pub const _SC_MEMORY_PROTECTION: ::c_int = 87;
+pub const _SC_MESSAGE_PASSING: ::c_int = 88;
+pub const _SC_MQ_OPEN_MAX: ::c_int = 89;
+pub const _SC_MQ_PRIO_MAX: ::c_int = 90;
+pub const _SC_PRIORITIZED_IO: ::c_int = 91;
+pub const _SC_PRIORITY_SCHEDULING: ::c_int = 92;
+pub const _SC_REALTIME_SIGNALS: ::c_int = 93;
+pub const _SC_RTSIG_MAX: ::c_int = 94;
+pub const _SC_SEMAPHORES: ::c_int = 95;
+pub const _SC_SEM_NSEMS_MAX: ::c_int = 96;
+pub const _SC_SEM_VALUE_MAX: ::c_int = 97;
+pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 98;
+pub const _SC_SIGQUEUE_MAX: ::c_int = 99;
+pub const _SC_SYNCHRONIZED_IO: ::c_int = 100;
+pub const _SC_TIMERS: ::c_int = 102;
+pub const _SC_TIMER_MAX: ::c_int = 103;
+pub const _SC_2_C_BIND: ::c_int = 51;
+pub const _SC_2_C_DEV: ::c_int = 32;
+pub const _SC_2_C_VERSION: ::c_int = 52;
+pub const _SC_2_FORT_DEV: ::c_int = 33;
+pub const _SC_2_FORT_RUN: ::c_int = 34;
+pub const _SC_2_LOCALEDEF: ::c_int = 35;
+pub const _SC_2_SW_DEV: ::c_int = 36;
+pub const _SC_2_UPE: ::c_int = 53;
+pub const _SC_2_VERSION: ::c_int = 31;
+pub const _SC_BC_BASE_MAX: ::c_int = 23;
+pub const _SC_BC_DIM_MAX: ::c_int = 24;
+pub const _SC_BC_SCALE_MAX: ::c_int = 25;
+pub const _SC_BC_STRING_MAX: ::c_int = 26;
+pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 50;
+pub const _SC_EXPR_NEST_MAX: ::c_int = 28;
+pub const _SC_LINE_MAX: ::c_int = 29;
+pub const _SC_RE_DUP_MAX: ::c_int = 30;
+pub const _SC_XOPEN_CRYPT: ::c_int = 56;
+pub const _SC_XOPEN_ENH_I18N: ::c_int = 57;
+pub const _SC_XOPEN_SHM: ::c_int = 55;
+pub const _SC_2_CHAR_TERM: ::c_int = 54;
+pub const _SC_XOPEN_XCU_VERSION: ::c_int = 109;
+pub const _SC_ATEXIT_MAX: ::c_int = 47;
+pub const _SC_IOV_MAX: ::c_int = 58;
+pub const _SC_XOPEN_UNIX: ::c_int = 73;
+pub const _SC_T_IOV_MAX: ::c_int = 0;
+pub const _SC_PHYS_PAGES: ::c_int = 113;
+pub const _SC_AVPHYS_PAGES: ::c_int = 114;
+pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 101;
+pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 81;
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 82;
+pub const _SC_LOGIN_NAME_MAX: ::c_int = 83;
+pub const _SC_THREAD_KEYS_MAX: ::c_int = 68;
+pub const _SC_THREAD_STACK_MIN: ::c_int = 69;
+pub const _SC_THREAD_THREADS_MAX: ::c_int = 70;
+pub const _SC_TTY_NAME_MAX: ::c_int = 104;
+pub const _SC_THREADS: ::c_int = 60;
+pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 61;
+pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 62;
+pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 64;
+pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 65;
+pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 66;
+pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 67;
+pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 59;
+pub const _SC_XOPEN_LEGACY: ::c_int = 112;
+pub const _SC_XOPEN_REALTIME: ::c_int = 110;
+pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 111;
+pub const _SC_XBS5_ILP32_OFF32: ::c_int = 105;
+pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 106;
+pub const _SC_XBS5_LP64_OFF64: ::c_int = 107;
+pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 108;
+pub const _SC_2_PBS: ::c_int = 132;
+pub const _SC_2_PBS_ACCOUNTING: ::c_int = 133;
+pub const _SC_2_PBS_CHECKPOINT: ::c_int = 134;
+pub const _SC_2_PBS_LOCATE: ::c_int = 135;
+pub const _SC_2_PBS_MESSAGE: ::c_int = 136;
+pub const _SC_2_PBS_TRACK: ::c_int = 137;
+pub const _SC_ADVISORY_INFO: ::c_int = 130;
+pub const _SC_BARRIERS: ::c_int = 138;
+pub const _SC_CLOCK_SELECTION: ::c_int = 139;
+pub const _SC_CPUTIME: ::c_int = 140;
+pub const _SC_HOST_NAME_MAX: ::c_int = 126;
+pub const _SC_MONOTONIC_CLOCK: ::c_int = 141;
+pub const _SC_READER_WRITER_LOCKS: ::c_int = 142;
+pub const _SC_REGEXP: ::c_int = 127;
+pub const _SC_SHELL: ::c_int = 128;
+pub const _SC_SPAWN: ::c_int = 143;
+pub const _SC_SPIN_LOCKS: ::c_int = 144;
+pub const _SC_SPORADIC_SERVER: ::c_int = 145;
+pub const _SC_SS_REPL_MAX: ::c_int = 156;
+pub const _SC_SYMLOOP_MAX: ::c_int = 129;
+pub const _SC_THREAD_CPUTIME: ::c_int = 146;
+pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 147;
+pub const _SC_TIMEOUTS: ::c_int = 148;
+pub const _SC_TRACE: ::c_int = 149;
+pub const _SC_TRACE_EVENT_FILTER: ::c_int = 150;
+pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 157;
+pub const _SC_TRACE_INHERIT: ::c_int = 151;
+pub const _SC_TRACE_LOG: ::c_int = 152;
+pub const _SC_TRACE_NAME_MAX: ::c_int = 158;
+pub const _SC_TRACE_SYS_MAX: ::c_int = 159;
+pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 160;
+pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 153;
+pub const _SC_V6_ILP32_OFF32: ::c_int = 121;
+pub const _SC_V6_ILP32_OFFBIG: ::c_int = 122;
+pub const _SC_V6_LP64_OFF64: ::c_int = 123;
+pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 124;
+pub const _SC_XOPEN_STREAMS: ::c_int = 125;
+pub const _SC_IPV6: ::c_int = 154;
+pub const _SC_RAW_SOCKETS: ::c_int = 155;
+
+// utmp.h
+pub const EMPTY: ::c_short = -1;
+pub const RUN_LVL: ::c_short = 1;
+pub const BOOT_TIME: ::c_short = 2;
+pub const OLD_TIME: ::c_short = 3;
+pub const NEW_TIME: ::c_short = 4;
+pub const INIT_PROCESS: ::c_short = 5;
+pub const LOGIN_PROCESS: ::c_short = 6;
+pub const USER_PROCESS: ::c_short = 7;
+pub const DEAD_PROCESS: ::c_short = 8;
+pub const ACCOUNTING: ::c_short = 9;
+
+f! {
+    pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
+        if (*mhdr).msg_controllen as usize >= ::mem::size_of::<cmsghdr>() {
+            (*mhdr).msg_control as *mut cmsghdr
+        } else {
+            0 as *mut cmsghdr
+        }
+    }
+
+    pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr {
+        if cmsg.is_null() {
+            CMSG_FIRSTHDR(mhdr)
+        } else {
+            if (cmsg as usize + (*cmsg).cmsg_len as usize + ::mem::size_of::<::cmsghdr>()) >
+                ((*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize) {
+                0 as *mut ::cmsghdr
+            } else {
+                // AIX does not have any alignment/padding for ancillary data, so we don't need _CMSG_ALIGN here.
+                (cmsg as usize + (*cmsg).cmsg_len as usize) as *mut cmsghdr
+            }
+        }
+    }
+
+    pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
+        (cmsg as *mut ::c_uchar).offset(::mem::size_of::<::cmsghdr>() as isize)
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        ::mem::size_of::<::cmsghdr>() as ::c_uint + length
+    }
+
+    pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
+        ::mem::size_of::<::cmsghdr>() as ::c_uint + length
+    }
+
+    pub fn FD_ZERO(set: *mut fd_set) -> () {
+        for slot in (*set).fds_bits.iter_mut() {
+            *slot = 0;
+        }
+    }
+
+    pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
+        let bits = ::mem::size_of::<::c_long>() * 8;
+        let fd = fd as usize;
+        (*set).fds_bits[fd / bits] |= 1 << (fd % bits);
+        return
+    }
+
+    pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
+        let bits = ::mem::size_of::<::c_long>() * 8;
+        let fd = fd as usize;
+        (*set).fds_bits[fd / bits] &= !(1 << (fd % bits));
+        return
+    }
+
+    pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
+        let bits = ::mem::size_of::<::c_long>() * 8;
+        let fd = fd as usize;
+        return ((*set).fds_bits[fd / bits] & (1 << (fd % bits))) != 0
+    }
+
+    pub fn major(dev: ::dev_t) -> ::c_uint {
+        let x = dev >> 16;
+        x as ::c_uint
+    }
+
+    pub fn minor(dev: ::dev_t) -> ::c_uint {
+        let y = dev & 0xFFFF;
+        y as ::c_uint
+    }
+
+    pub fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::dev_t;
+        let mut dev = 0;
+        dev |= major << 16;
+        dev |= minor;
+        dev
+    }
+}
+
+safe_f! {
+    pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
+        (status & _W_STOPPED) != 0
+    }
+
+    pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
+        if WIFSTOPPED(status) {
+            (((status as ::c_uint) >> 8) & 0xff) as ::c_int
+        } else {
+            -1
+        }
+    }
+
+    pub {const} fn WIFEXITED(status: ::c_int) -> bool {
+        (status & 0xFF) == 0
+    }
+
+    pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int {
+        if WIFEXITED(status) {
+            (((status as ::c_uint) >> 8) & 0xff) as ::c_int
+        } else {
+            -1
+        }
+    }
+
+    pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
+        !WIFEXITED(status) && !WIFSTOPPED(status)
+    }
+
+    pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int {
+        if WIFSIGNALED(status) {
+            (((status as ::c_uint) >> 16) & 0xff) as ::c_int
+        } else {
+            -1
+        }
+    }
+
+    pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
+        (status & WCONTINUED) != 0
+    }
+
+    // AIX doesn't have native WCOREDUMP.
+    pub {const} fn WCOREDUMP(_status: ::c_int) -> bool {
+        false
+    }
+}
+
+#[link(name = "thread")]
+extern "C" {
+    pub fn thr_kill(id: thread_t, sig: ::c_int) -> ::c_int;
+    pub fn thr_self() -> thread_t;
+}
+
+#[link(name = "pthread")]
+extern "C" {
+    pub fn pthread_atfork(
+        prepare: ::Option<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+    pub fn pthread_attr_getguardsize(
+        attr: *const ::pthread_attr_t,
+        guardsize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
+    pub fn pthread_attr_getschedparam(
+        attr: *const ::pthread_attr_t,
+        param: *mut sched_param,
+    ) -> ::c_int;
+    pub fn pthread_attr_getstack(
+        attr: *const ::pthread_attr_t,
+        stackaddr: *mut *mut ::c_void,
+        stacksize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_attr_setschedparam(
+        attr: *mut ::pthread_attr_t,
+        param: *const sched_param,
+    ) -> ::c_int;
+    pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> ::c_int;
+    pub fn pthread_barrier_init(
+        barrier: *mut pthread_barrier_t,
+        attr: *const ::pthread_barrierattr_t,
+        count: ::c_uint,
+    ) -> ::c_int;
+    pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> ::c_int;
+    pub fn pthread_barrierattr_destroy(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_getpshared(
+        attr: *const ::pthread_barrierattr_t,
+        shared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrierattr_init(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_setpshared(
+        attr: *mut ::pthread_barrierattr_t,
+        shared: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
+    pub fn pthread_condattr_getclock(
+        attr: *const pthread_condattr_t,
+        clock_id: *mut clockid_t,
+    ) -> ::c_int;
+    pub fn pthread_condattr_getpshared(
+        attr: *const pthread_condattr_t,
+        pshared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_condattr_setclock(
+        attr: *mut pthread_condattr_t,
+        clock_id: ::clockid_t,
+    ) -> ::c_int;
+    pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int;
+    pub fn pthread_create(
+        native: *mut ::pthread_t,
+        attr: *const ::pthread_attr_t,
+        f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
+        value: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn pthread_getattr_np(native: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
+    pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int;
+    pub fn pthread_getschedparam(
+        thread: ::pthread_t,
+        policy: *mut ::c_int,
+        param: *mut sched_param,
+    ) -> ::c_int;
+    pub fn pthread_kill(thread: ::pthread_t, signal: ::c_int) -> ::c_int;
+    pub fn pthread_mutex_consistent(mutex: *mut ::pthread_mutex_t) -> ::c_int;
+    pub fn pthread_mutex_timedlock(
+        lock: *mut pthread_mutex_t,
+        abstime: *const ::timespec,
+    ) -> ::c_int;
+    pub fn pthread_mutexattr_getprotocol(
+        attr: *const pthread_mutexattr_t,
+        protocol: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_mutexattr_getpshared(
+        attr: *const pthread_mutexattr_t,
+        pshared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_mutexattr_getrobust(
+        attr: *mut ::pthread_mutexattr_t,
+        robust: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_mutexattr_setprotocol(
+        attr: *mut pthread_mutexattr_t,
+        protocol: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_mutexattr_setpshared(
+        attr: *mut pthread_mutexattr_t,
+        pshared: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_mutexattr_setrobust(
+        attr: *mut ::pthread_mutexattr_t,
+        robust: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_rwlockattr_getpshared(
+        attr: *const pthread_rwlockattr_t,
+        val: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int;
+    pub fn pthread_setschedparam(
+        thread: ::pthread_t,
+        policy: ::c_int,
+        param: *const sched_param,
+    ) -> ::c_int;
+    pub fn pthread_setschedprio(native: ::pthread_t, priority: ::c_int) -> ::c_int;
+    pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
+    pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
+    pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int;
+}
+
+#[link(name = "iconv")]
+extern "C" {
+    pub fn iconv(
+        cd: iconv_t,
+        inbuf: *mut *mut ::c_char,
+        inbytesleft: *mut ::size_t,
+        outbuf: *mut *mut ::c_char,
+        outbytesleft: *mut ::size_t,
+    ) -> ::size_t;
+    pub fn iconv_close(cd: iconv_t) -> ::c_int;
+    pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
+}
+
+extern "C" {
+    pub fn acct(filename: *const ::c_char) -> ::c_int;
+    pub fn aio_cancel(fildes: ::c_int, aiocbp: *mut ::aiocb) -> ::c_int;
+    pub fn aio_error(aiocbp: *mut ::aiocb) -> ::c_int;
+    #[link_name = "_posix_aio_fsync"]
+    pub fn aio_fsync(op: ::c_int, aiocbp: *mut ::aiocb) -> ::c_int;
+    pub fn aio_read(aiocbp: *mut ::aiocb) -> ::c_int;
+    // pub fn aio_suspend
+    // pub fn aio_write
+    pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
+    pub fn brk(addr: *mut ::c_void) -> ::c_int;
+    pub fn clearenv() -> ::c_int;
+    pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int;
+    pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_nanosleep(
+        clk_id: ::clockid_t,
+        flags: ::c_int,
+        rqtp: *const ::timespec,
+        rmtp: *mut ::timespec,
+    ) -> ::c_int;
+    pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+    pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int;
+    pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char;
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
+    pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+    pub fn drand48() -> ::c_double;
+    pub fn duplocale(arg1: ::locale_t) -> ::locale_t;
+    pub fn endgrent();
+    pub fn endmntent(streamp: *mut ::FILE) -> ::c_int;
+    pub fn endpwent();
+    pub fn endutent();
+    pub fn endutxent();
+    pub fn erand48(xseed: *mut ::c_ushort) -> ::c_double;
+    pub fn faccessat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::c_int,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn fattach(fildes: ::c_int, path: *const ::c_char) -> ::c_int;
+    pub fn fdatasync(fd: ::c_int) -> ::c_int;
+    pub fn fexecve(
+        fd: ::c_int,
+        argv: *const *const ::c_char,
+        envp: *const *const ::c_char,
+    ) -> ::c_int;
+    pub fn ffs(value: ::c_int) -> ::c_int;
+    pub fn ffsl(value: ::c_long) -> ::c_int;
+    pub fn ffsll(value: ::c_longlong) -> ::c_int;
+    pub fn fgetgrent(file: *mut ::FILE) -> *mut ::group;
+    pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int;
+    pub fn fgetpwent(file: *mut ::FILE) -> *mut ::passwd;
+    pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut ::FILE;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn freopen64(
+        filename: *const c_char,
+        mode: *const c_char,
+        file: *mut ::FILE,
+    ) -> *mut ::FILE;
+    pub fn fseeko64(stream: *mut ::FILE, offset: ::off64_t, whence: ::c_int) -> ::c_int;
+    pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int;
+    pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int;
+    pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
+    pub fn fstatfs64(fd: ::c_int, buf: *mut statfs64) -> ::c_int;
+    pub fn fstatvfs64(fd: ::c_int, buf: *mut statvfs64) -> ::c_int;
+    pub fn ftello64(stream: *mut ::FILE) -> ::off64_t;
+    pub fn ftok(path: *const ::c_char, id: ::c_int) -> ::key_t;
+    pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int;
+    pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
+    pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int;
+    pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int;
+    pub fn getdtablesize() -> ::c_int;
+    pub fn getgrent() -> *mut ::group;
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
+    pub fn getgrnam_r(
+        name: *const ::c_char,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn getgrset(user: *mut ::c_char) -> *mut ::c_char;
+    pub fn gethostid() -> ::c_long;
+    pub fn getmntent(stream: *mut ::FILE) -> *mut ::mntent;
+    pub fn getnameinfo(
+        sa: *const ::sockaddr,
+        salen: ::size_t,
+        host: *mut ::c_char,
+        hostlen: ::size_t,
+        serv: *mut ::c_char,
+        servlen: ::size_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn getpagesize() -> ::c_int;
+    pub fn getpeereid(socket: ::c_int, euid: *mut ::uid_t, egid: *mut ::gid_t) -> ::c_int;
+    pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
+    pub fn getpwent() -> *mut ::passwd;
+    pub fn getpwnam_r(
+        name: *const ::c_char,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+    pub fn getpwuid_r(
+        uid: ::uid_t,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+    pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
+    pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int;
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
+    pub fn getitimer(which: ::c_int, curr_value: *mut ::itimerval) -> ::c_int;
+    pub fn getutent() -> *mut utmp;
+    pub fn getutid(u: *const utmp) -> *mut utmp;
+    pub fn getutline(u: *const utmp) -> *mut utmp;
+    pub fn getutxent() -> *mut utmpx;
+    pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
+    pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
+    pub fn glob(
+        pattern: *const ::c_char,
+        flags: ::c_int,
+        errfunc: ::Option<extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut ::glob_t,
+    ) -> ::c_int;
+    pub fn globfree(pglob: *mut ::glob_t);
+    pub fn hasmntopt(mnt: *const ::mntent, opt: *const ::c_char) -> *mut ::c_char;
+    pub fn hcreate(nelt: ::size_t) -> ::c_int;
+    pub fn hdestroy();
+    pub fn hsearch(entry: entry, action: ::c_int) -> *mut entry;
+    pub fn if_freenameindex(ptr: *mut if_nameindex);
+    pub fn if_nameindex() -> *mut if_nameindex;
+    pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
+    pub fn ioctl(fildes: ::c_int, request: ::c_int, ...) -> ::c_int;
+    pub fn jrand48(xseed: *mut ::c_ushort) -> ::c_long;
+    pub fn lcong48(p: *mut ::c_ushort);
+    pub fn lfind(
+        key: *const ::c_void,
+        base: *const ::c_void,
+        nelp: *mut ::size_t,
+        width: ::size_t,
+        compar: ::Option<unsafe extern "C" fn(*const ::c_void, *const ::c_void) -> ::c_int>,
+    ) -> *mut ::c_void;
+    pub fn lio_listio(
+        mode: ::c_int,
+        aiocb_list: *const *mut aiocb,
+        nitems: ::c_int,
+        sevp: *mut sigevent,
+    ) -> ::c_int;
+    pub fn loadquery(flags: ::c_int, buf: *mut ::c_char, buflen: ::c_uint) -> ::c_int;
+    pub fn lpar_get_info(command: ::c_int, buf: *mut ::c_void, bufsize: ::size_t) -> ::c_int;
+    pub fn lpar_set_resources(id: ::c_int, resource: *mut ::c_void) -> ::c_int;
+    pub fn lrand48() -> c_long;
+    pub fn lsearch(
+        key: *const ::c_void,
+        base: *mut ::c_void,
+        nelp: *mut ::size_t,
+        width: ::size_t,
+        compar: ::Option<unsafe extern "C" fn(*const ::c_void, *const ::c_void) -> ::c_int>,
+    ) -> *mut ::c_void;
+    pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t;
+    pub fn lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
+    pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+    pub fn makecontext(ucp: *mut ::ucontext_t, func: extern "C" fn(), argc: ::c_int, ...);
+    pub fn mallinfo() -> ::mallinfo;
+    pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int;
+    pub fn memmem(
+        haystack: *const ::c_void,
+        haystacklen: ::size_t,
+        needle: *const ::c_void,
+        needlelen: ::size_t,
+    ) -> *mut ::c_void;
+    pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
+    pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
+    pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
+    pub fn mknodat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::mode_t,
+        dev: dev_t,
+    ) -> ::c_int;
+    pub fn mount(device: *const ::c_char, path: *const ::c_char, flags: ::c_int) -> ::c_int;
+    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+    pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
+    pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
+    pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int;
+    pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
+    pub fn mq_receive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+    ) -> ::ssize_t;
+    pub fn mq_send(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+    ) -> ::c_int;
+    pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
+    pub fn mq_timedreceive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::ssize_t;
+    pub fn mq_timedsend(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
+    pub fn mrand48() -> c_long;
+    pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int;
+    pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
+    pub fn msgrcv(
+        msqid: ::c_int,
+        msgp: *mut ::c_void,
+        msgsz: ::size_t,
+        msgtyp: ::c_long,
+        msgflg: ::c_int,
+    ) -> ::ssize_t;
+    pub fn msgsnd(
+        msqid: ::c_int,
+        msgp: *const ::c_void,
+        msgsz: ::size_t,
+        msgflg: ::c_int,
+    ) -> ::c_int;
+    pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+    pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+    pub fn nl_langinfo_l(item: ::nl_item, loc: ::locale_t) -> *mut ::c_char;
+    pub fn nrand48(xseed: *mut ::c_ushort) -> ::c_long;
+    pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
+    pub fn pollset_create(maxfd: ::c_int) -> pollset_t;
+    pub fn pollset_ctl(
+        ps: pollset_t,
+        pollctl_array: *mut poll_ctl,
+        array_length: ::c_int,
+    ) -> ::c_int;
+    pub fn pollset_destroy(ps: pollset_t) -> ::c_int;
+    pub fn pollset_poll(
+        ps: pollset_t,
+        polldata_array: *mut ::pollfd,
+        array_length: ::c_int,
+        timeout: ::c_int,
+    ) -> ::c_int;
+    pub fn pollset_query(ps: pollset_t, pollfd_query: *mut ::pollfd) -> ::c_int;
+    pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
+    pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
+    pub fn posix_fadvise64(
+        fd: ::c_int,
+        offset: ::off64_t,
+        len: ::off64_t,
+        advise: ::c_int,
+    ) -> ::c_int;
+    pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+    pub fn posix_fallocate64(fd: ::c_int, offset: ::off64_t, len: ::off64_t) -> ::c_int;
+    pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+    pub fn posix_spawn(
+        pid: *mut ::pid_t,
+        path: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_addclose(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_adddup2(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+        newfd: ::c_int,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_addopen(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+        path: *const ::c_char,
+        oflag: ::c_int,
+        mode: ::mode_t,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+    pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+    pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
+    pub fn posix_spawnattr_getflags(
+        attr: *const posix_spawnattr_t,
+        flags: *mut ::c_short,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getpgroup(
+        attr: *const posix_spawnattr_t,
+        flags: *mut ::pid_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getschedparam(
+        attr: *const posix_spawnattr_t,
+        param: *mut ::sched_param,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getschedpolicy(
+        attr: *const posix_spawnattr_t,
+        flags: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getsigdefault(
+        attr: *const posix_spawnattr_t,
+        default: *mut sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getsigmask(
+        attr: *const posix_spawnattr_t,
+        default: *mut sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
+    pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int;
+    pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
+    pub fn posix_spawnattr_setschedparam(
+        attr: *mut posix_spawnattr_t,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int;
+    pub fn posix_spawnattr_setsigdefault(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigmask(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnp(
+        pid: *mut ::pid_t,
+        file: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn pread64(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off64_t) -> ::ssize_t;
+    pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
+    pub fn ptrace64(
+        request: ::c_int,
+        id: ::c_longlong,
+        addr: ::c_longlong,
+        data: ::c_int,
+        buff: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pututline(u: *const utmp) -> *mut utmp;
+    pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
+    pub fn pwrite64(
+        fd: ::c_int,
+        buf: *const ::c_void,
+        count: ::size_t,
+        offset: off64_t,
+    ) -> ::ssize_t;
+    pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
+        -> ::ssize_t;
+    #[link_name = "__linux_quotactl"]
+    pub fn quotactl(
+        cmd: ::c_int,
+        special: *const ::c_char,
+        id: ::c_int,
+        data: *mut ::c_char,
+    ) -> ::c_int;
+    pub fn rand() -> ::c_int;
+    pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    pub fn recvfrom(
+        socket: ::c_int,
+        buf: *mut ::c_void,
+        len: ::size_t,
+        flags: ::c_int,
+        addr: *mut ::sockaddr,
+        addrlen: *mut ::socklen_t,
+    ) -> ::ssize_t;
+    pub fn recvmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_int,
+        timeout: *mut ::timespec,
+    ) -> ::c_int;
+    pub fn recvmsg(sockfd: ::c_int, msg: *mut msghdr, flags: ::c_int) -> ::ssize_t;
+    pub fn regcomp(preg: *mut regex_t, pattern: *const ::c_char, cflags: ::c_int) -> ::c_int;
+    pub fn regerror(
+        errcode: ::c_int,
+        preg: *const ::regex_t,
+        errbuf: *mut ::c_char,
+        errbuf_size: ::size_t,
+    ) -> ::size_t;
+    pub fn regexec(
+        preg: *const regex_t,
+        input: *const ::c_char,
+        nmatch: ::size_t,
+        pmatch: *mut regmatch_t,
+        eflags: ::c_int,
+    ) -> ::c_int;
+    pub fn regfree(preg: *mut regex_t);
+    pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
+    pub fn sched_getparam(pid: ::pid_t, param: *mut sched_param) -> ::c_int;
+    pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
+    pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
+    pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
+    pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
+    pub fn sched_setscheduler(
+        pid: ::pid_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn sctp_opt_info(
+        sd: ::c_int,
+        id: ::sctp_assoc_t,
+        opt: ::c_int,
+        arg_size: *mut ::c_void,
+        size: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn sctp_peeloff(s: ::c_int, id: ::sctp_assoc_t) -> ::c_int;
+    pub fn seed48(xseed: *mut ::c_ushort) -> *mut ::c_ushort;
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+    pub fn sem_close(sem: *mut sem_t) -> ::c_int;
+    pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
+    pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
+    pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
+    pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
+    pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
+    pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
+    pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
+    pub fn semget(key: ::key_t, nsems: ::c_int, semflag: ::c_int) -> ::c_int;
+    pub fn semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int;
+    pub fn send_file(socket: *mut ::c_int, iobuf: *mut sf_parms, flags: ::c_uint) -> ::ssize_t;
+    pub fn sendmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn sendmsg(sockfd: ::c_int, msg: *const msghdr, flags: ::c_int) -> ::ssize_t;
+    pub fn setcontext(ucp: *const ucontext_t) -> ::c_int;
+    pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int;
+    pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int;
+    pub fn setgrent();
+    pub fn sethostid(hostid: ::c_int) -> ::c_int;
+    pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int;
+    pub fn setmntent(filename: *const ::c_char, ty: *const ::c_char) -> *mut ::FILE;
+    pub fn setpriority(which: ::c_int, who: id_t, priority: ::c_int) -> ::c_int;
+    pub fn setpwent();
+    pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
+    pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int;
+    pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
+    pub fn setitimer(
+        which: ::c_int,
+        new_value: *const ::itimerval,
+        old_value: *mut ::itimerval,
+    ) -> ::c_int;
+    pub fn setutent();
+    pub fn setutxent();
+    pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
+    pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
+    pub fn sigtimedwait(
+        set: *const sigset_t,
+        info: *mut siginfo_t,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
+    pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
+    pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
+    pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
+    pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
+    pub fn shmget(key: key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
+    pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int;
+    pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
+    pub fn splice(socket1: ::c_int, socket2: ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn srand(seed: ::c_uint);
+    pub fn srand48(seed: ::c_long);
+    pub fn stat64(path: *const ::c_char, buf: *mut stat64) -> ::c_int;
+    pub fn stat64at(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        buf: *mut stat64,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
+    pub fn statfs64(path: *const ::c_char, buf: *mut statfs64) -> ::c_int;
+    pub fn statvfs64(path: *const ::c_char, buf: *mut statvfs64) -> ::c_int;
+    pub fn statx(
+        path: *const ::c_char,
+        buf: *mut stat,
+        length: ::c_int,
+        command: ::c_int,
+    ) -> ::c_int;
+    pub fn strcasecmp_l(
+        string1: *const ::c_char,
+        string2: *const ::c_char,
+        locale: ::locale_t,
+    ) -> ::c_int;
+    pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
+    pub fn strftime(
+        arg1: *mut c_char,
+        arg2: ::size_t,
+        arg3: *const c_char,
+        arg4: *const tm,
+    ) -> ::size_t;
+    pub fn strncasecmp_l(
+        string1: *const ::c_char,
+        string2: *const ::c_char,
+        length: ::size_t,
+        locale: ::locale_t,
+    ) -> ::c_int;
+    pub fn strptime(s: *const ::c_char, format: *const ::c_char, tm: *mut ::tm) -> *mut ::c_char;
+    pub fn strsep(string: *mut *mut ::c_char, delim: *const ::c_char) -> *mut ::c_char;
+    pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> ::c_int;
+    pub fn swapoff(puath: *const ::c_char) -> ::c_int;
+    pub fn swapon(path: *const ::c_char) -> ::c_int;
+    pub fn sync();
+    pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
+    pub fn timer_create(
+        clockid: ::clockid_t,
+        sevp: *mut ::sigevent,
+        timerid: *mut ::timer_t,
+    ) -> ::c_int;
+    pub fn timer_delete(timerid: timer_t) -> ::c_int;
+    pub fn timer_getoverrun(timerid: timer_t) -> ::c_int;
+    pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> ::c_int;
+    pub fn timer_settime(
+        timerid: ::timer_t,
+        flags: ::c_int,
+        new_value: *const ::itimerspec,
+        old_value: *mut ::itimerspec,
+    ) -> ::c_int;
+    pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int;
+    pub fn uname(buf: *mut ::utsname) -> ::c_int;
+    pub fn updwtmp(file: *const ::c_char, u: *mut utmp);
+    pub fn uselocale(loc: ::locale_t) -> ::locale_t;
+    pub fn utmpname(file: *const ::c_char) -> ::c_int;
+    pub fn utimensat(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::timespec,
+        flag: ::c_int,
+    ) -> ::c_int;
+    pub fn wait4(
+        pid: ::pid_t,
+        status: *mut ::c_int,
+        options: ::c_int,
+        rusage: *mut ::rusage,
+    ) -> ::pid_t;
+    pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
+        -> ::c_int;
+    pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+
+    // Use AIX thread-safe version errno.
+    pub fn _Errno() -> *mut ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "powerpc64")] {
+        mod powerpc64;
+        pub use self::powerpc64::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/aix/powerpc64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/aix/powerpc64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/aix/powerpc64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/aix/powerpc64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,644 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
+
+s! {
+    pub struct sigset_t {
+        pub ss_set: [c_ulong; 4],
+    }
+
+    pub struct fd_set {
+        pub fds_bits: [c_long; 1024],
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_sysid: ::c_uint,
+        pub l_pid: ::pid_t,
+        pub l_vfs: ::c_int,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_basetype: [::c_char; 16],
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        pub f_fstr: [::c_char; 32],
+        pub f_filler: [::c_ulong; 16]
+    }
+
+    pub struct pthread_rwlock_t {
+        __rw_word: [::c_long; 10],
+    }
+
+    pub struct pthread_cond_t {
+        __cv_word: [::c_long; 6],
+    }
+
+    pub struct pthread_mutex_t {
+        __mt_word: [::c_long; 8],
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_flag: ::c_ushort,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_ssize: ::c_int,
+        pub st_atime: ::st_timespec,
+        pub st_mtime: ::st_timespec,
+        pub st_ctime: ::st_timespec,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_vfstype: ::c_int,
+        pub st_vfs: ::c_uint,
+        pub st_type: ::c_uint,
+        pub st_gen: ::c_uint,
+        pub st_reserved: [::c_uint; 9],
+        pub st_padto_ll: ::c_uint,
+        pub st_size: ::off_t,
+    }
+
+    pub struct statfs {
+        pub f_version: ::c_int,
+        pub f_type: ::c_int,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsblkcnt_t,
+        pub f_ffree: ::fsblkcnt_t,
+        pub f_fsid: ::fsid64_t,
+        pub f_vfstype: ::c_int,
+        pub f_fsize: ::c_ulong,
+        pub f_vfsnumber: ::c_int,
+        pub f_vfsoff: ::c_int,
+        pub f_vfslen: ::c_int,
+        pub f_vfsvers: ::c_int,
+        pub f_fname: [::c_char; 32],
+        pub f_fpack: [::c_char; 32],
+        pub f_name_max: ::c_int,
+    }
+
+    pub struct aiocb {
+        pub aio_lio_opcode: ::c_int,
+        pub aio_fildes: ::c_int,
+        pub aio_word1: ::c_int,
+        pub aio_offset: ::off_t,
+        pub aio_buf: *mut ::c_void,
+        pub aio_return: ::ssize_t,
+        pub aio_errno: ::c_int,
+        pub aio_nbytes: ::size_t,
+        pub aio_reqprio: ::c_int,
+        pub aio_sigevent: ::sigevent,
+        pub aio_word2: ::c_int,
+        pub aio_fp: ::c_int,
+        pub aio_handle: *mut aiocb,
+        pub aio_reserved: [::c_uint; 2],
+        pub aio_sigev_tid: c_long,
+    }
+
+    pub struct ucontext_t {
+        pub __sc_onstack: ::c_int,
+        pub uc_sigmask: ::sigset_t,
+        pub __sc_uerror: ::c_int,
+        pub uc_mcontext: ::mcontext_t,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        // Should be pointer to __extctx_t
+        pub __extctx: *mut ::c_void,
+        pub __extctx_magic: ::c_int,
+        pub __pad: [::c_int; 1],
+    }
+
+    pub struct mcontext_t {
+        pub gpr: [::c_ulonglong; 32],
+        pub msr: ::c_ulonglong,
+        pub iar: ::c_ulonglong,
+        pub lr: ::c_ulonglong,
+        pub ctr: ::c_ulonglong,
+        pub cr: ::c_uint,
+        pub xer: ::c_uint,
+        pub fpscr: ::c_uint,
+        pub fpscrx: ::c_uint,
+        pub except: [::c_ulonglong; 1],
+        // Should be array of double type
+        pub fpr: [::uint64_t; 32],
+        pub fpeu: ::c_char,
+        pub fpinfo: ::c_char,
+        pub fpscr24_31: ::c_char,
+        pub pad: [::c_char; 1],
+        pub excp_type: ::c_int,
+    }
+
+    pub struct utmpx {
+        pub ut_user: [::c_char; 256],
+        pub ut_id: [::c_char; 14],
+        pub ut_line: [::c_char; 64],
+        pub ut_pid: ::pid_t,
+        pub ut_type: ::c_short,
+        pub ut_tv: ::timeval,
+        pub ut_host: [::c_char; 256],
+        pub __dbl_word_pad: ::c_int,
+        pub __reservedA: [::c_int; 2],
+        pub __reservedV: [::c_int; 6],
+    }
+
+    pub struct pthread_spinlock_t {
+        pub __sp_word: [::c_long; 3],
+    }
+
+    pub struct pthread_barrier_t {
+        pub __br_word: [::c_long; 5],
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_first: ::c_uint,
+        pub msg_last: ::c_uint,
+        pub msg_cbytes: ::c_uint,
+        pub msg_qnum: ::c_uint,
+        pub msg_qbytes: ::c_ulong,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::time_t,
+        pub msg_rwait: ::c_int,
+        pub msg_wwait: ::c_int,
+        pub msg_reqevents: ::c_ushort,
+    }
+}
+
+s_no_extra_traits! {
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        pub si_pid: ::pid_t,
+        pub si_uid: ::uid_t,
+        pub si_status: ::c_int,
+        pub si_addr: *mut ::c_void,
+        pub si_band: ::c_long,
+        pub si_value: ::sigval,
+        pub __si_flags: ::c_int,
+        pub __pad: [::c_int; 3],
+    }
+
+    #[cfg(libc_union)]
+    pub union _kernel_simple_lock {
+        pub _slock: ::c_long,
+        // Should be pointer to 'lock_data_instrumented'
+        pub _slockp: *mut ::c_void,
+    }
+
+    pub struct fileops_t {
+        pub fo_rw: extern fn(file: *mut file, rw: ::uio_rw, io: *mut ::c_void, ext: ::c_long,
+                             secattr: *mut ::c_void) -> ::c_int,
+        pub fo_ioctl: extern fn(file: *mut file, a: ::c_long, b: ::caddr_t, c: ::c_long,
+                                d: ::c_long) -> ::c_int,
+        pub fo_select: extern fn(file: *mut file, a: ::c_int, b: *mut ::c_ushort,
+                                 c: extern fn()) -> ::c_int,
+        pub fo_close: extern fn(file: *mut file) -> ::c_int,
+        pub fo_fstat: extern fn(file: *mut file, sstat: *mut ::stat) -> ::c_int,
+    }
+
+    pub struct file {
+        pub f_flag: ::c_long,
+        pub f_count: ::c_int,
+        pub f_options: ::c_short,
+        pub f_type: ::c_short,
+        // Should be pointer to 'vnode'
+        pub f_data: *mut ::c_void,
+        pub f_offset: ::c_longlong,
+        pub f_dir_off: ::c_long,
+        // Should be pointer to 'cred'
+        pub f_cred: *mut ::c_void,
+        #[cfg(libc_union)]
+        pub f_lock: _kernel_simple_lock,
+        #[cfg(libc_union)]
+        pub f_offset_lock: _kernel_simple_lock,
+        pub f_vinfo: ::caddr_t,
+        pub f_ops: *mut fileops_t,
+        pub f_parentp: ::caddr_t,
+        pub f_fnamep: ::caddr_t,
+        pub f_fdata: [::c_char; 160],
+    }
+
+    #[cfg(libc_union)]
+    pub union __ld_info_file {
+        pub _ldinfo_fd: ::c_int,
+        pub _ldinfo_fp: *mut file,
+        pub _core_offset: ::c_long,
+    }
+
+    pub struct ld_info {
+        pub ldinfo_next: ::c_uint,
+        pub ldinfo_flags: ::c_uint,
+        #[cfg(libc_union)]
+        pub _file: __ld_info_file,
+        pub ldinfo_textorg: *mut ::c_void,
+        pub ldinfo_textsize: ::c_ulong,
+        pub ldinfo_dataorg: *mut ::c_void,
+        pub ldinfo_datasize: ::c_ulong,
+        pub ldinfo_filename: [::c_char; 2],
+    }
+
+    #[cfg(libc_union)]
+    pub union __pollfd_ext_u {
+        pub addr: *mut ::c_void,
+        pub data32: u32,
+        pub data: u64,
+    }
+
+    pub struct pollfd_ext {
+        pub fd: ::c_int,
+        pub events: ::c_ushort,
+        pub revents: ::c_ushort,
+        #[cfg(libc_union)]
+        pub data: __pollfd_ext_u,
+    }
+}
+
+impl siginfo_t {
+    pub unsafe fn si_addr(&self) -> *mut ::c_void {
+        self.si_addr
+    }
+
+    pub unsafe fn si_value(&self) -> ::sigval {
+        self.si_value
+    }
+
+    pub unsafe fn si_pid(&self) -> ::pid_t {
+        self.si_pid
+    }
+
+    pub unsafe fn si_uid(&self) -> ::uid_t {
+        self.si_uid
+    }
+
+    pub unsafe fn si_status(&self) -> ::c_int {
+        self.si_status
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for siginfo_t {
+            fn eq(&self, other: &siginfo_t) -> bool {
+                #[cfg(libc_union)]
+                let value_eq = self.si_value == other.si_value;
+                #[cfg(not(libc_union))]
+                let value_eq = true;
+                self.si_signo == other.si_signo
+                    && self.si_errno == other.si_errno
+                    && self.si_code == other.si_code
+                    && self.si_pid == other.si_pid
+                    && self.si_uid == other.si_uid
+                    && self.si_status == other.si_status
+                    && self.si_addr == other.si_addr
+                    && self.si_band == other.si_band
+                    && self.__si_flags == other.__si_flags
+                    && value_eq
+            }
+        }
+        impl Eq for siginfo_t {}
+        impl ::fmt::Debug for siginfo_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let mut struct_formatter = f.debug_struct("siginfo_t");
+                struct_formatter.field("si_signo", &self.si_signo);
+                struct_formatter.field("si_errno", &self.si_errno);
+                struct_formatter.field("si_code", &self.si_code);
+                struct_formatter.field("si_pid", &self.si_pid);
+                struct_formatter.field("si_uid", &self.si_uid);
+                struct_formatter.field("si_status", &self.si_status);
+                struct_formatter.field("si_addr", &self.si_addr);
+                struct_formatter.field("si_band", &self.si_band);
+                #[cfg(libc_union)]
+                struct_formatter.field("si_value", &self.si_value);
+                struct_formatter.field("__si_flags", &self.__si_flags);
+                struct_formatter.finish()
+            }
+        }
+        impl ::hash::Hash for siginfo_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.si_signo.hash(state);
+                self.si_errno.hash(state);
+                self.si_code.hash(state);
+                self.si_pid.hash(state);
+                self.si_uid.hash(state);
+                self.si_status.hash(state);
+                self.si_addr.hash(state);
+                self.si_band.hash(state);
+                #[cfg(libc_union)]
+                self.si_value.hash(state);
+                self.__si_flags.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl PartialEq for _kernel_simple_lock {
+            fn eq(&self, other: &_kernel_simple_lock) -> bool {
+                unsafe {
+                    self._slock == other._slock
+                        && self._slockp == other._slockp
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for _kernel_simple_lock {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for _kernel_simple_lock {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("_kernel_simple_lock")
+                    .field("_slock", unsafe { &self._slock })
+                    .field("_slockp", unsafe { &self._slockp })
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for _kernel_simple_lock {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                    self._slock.hash(state);
+                    self._slockp.hash(state);
+                }
+            }
+        }
+
+        impl PartialEq for fileops_t {
+            fn eq(&self, other: &fileops_t) -> bool {
+                self.fo_rw == other.fo_rw
+                    && self.fo_ioctl == other.fo_ioctl
+                    && self.fo_select == other.fo_select
+                    && self.fo_close == other.fo_close
+                    && self.fo_fstat == other.fo_fstat
+            }
+        }
+        impl Eq for fileops_t {}
+        impl ::fmt::Debug for fileops_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let mut struct_formatter = f.debug_struct("fileops_t");
+                struct_formatter.field("fo_rw", &self.fo_rw);
+                struct_formatter.field("fo_ioctl", &self.fo_ioctl);
+                struct_formatter.field("fo_select", &self.fo_select);
+                struct_formatter.field("fo_close", &self.fo_close);
+                struct_formatter.field("fo_fstat", &self.fo_fstat);
+                struct_formatter.finish()
+            }
+        }
+        impl ::hash::Hash for fileops_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.fo_rw.hash(state);
+                self.fo_ioctl.hash(state);
+                self.fo_select.hash(state);
+                self.fo_close.hash(state);
+                self.fo_fstat.hash(state);
+            }
+        }
+
+        impl PartialEq for file {
+            fn eq(&self, other: &file) -> bool {
+                #[cfg(libc_union)]
+                let lock_eq = self.f_lock == other.f_lock
+                    && self.f_offset_lock == other.f_offset_lock;
+                #[cfg(not(libc_union))]
+                let lock_eq = true;
+                self.f_flag == other.f_flag
+                    && self.f_count == other.f_count
+                    && self.f_options == other.f_options
+                    && self.f_type == other.f_type
+                    && self.f_data == other.f_data
+                    && self.f_offset == other.f_offset
+                    && self.f_dir_off == other.f_dir_off
+                    && self.f_cred == other.f_cred
+                    && self.f_vinfo == other.f_vinfo
+                    && self.f_ops == other.f_ops
+                    && self.f_parentp == other.f_parentp
+                    && self.f_fnamep == other.f_fnamep
+                    && self.f_fdata == other.f_fdata
+                    && lock_eq
+            }
+        }
+        impl Eq for file {}
+        impl ::fmt::Debug for file {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let mut struct_formatter = f.debug_struct("file");
+                struct_formatter.field("f_flag", &self.f_flag);
+                struct_formatter.field("f_count", &self.f_count);
+                struct_formatter.field("f_options", &self.f_options);
+                struct_formatter.field("f_type", &self.f_type);
+                struct_formatter.field("f_data", &self.f_data);
+                struct_formatter.field("f_offset", &self.f_offset);
+                struct_formatter.field("f_dir_off", &self.f_dir_off);
+                struct_formatter.field("f_cred", &self.f_cred);
+                #[cfg(libc_union)]
+                struct_formatter.field("f_lock", &self.f_lock);
+                #[cfg(libc_union)]
+                struct_formatter.field("f_offset_lock", &self.f_offset_lock);
+                struct_formatter.field("f_vinfo", &self.f_vinfo);
+                struct_formatter.field("f_ops", &self.f_ops);
+                struct_formatter.field("f_parentp", &self.f_parentp);
+                struct_formatter.field("f_fnamep", &self.f_fnamep);
+                struct_formatter.field("f_fdata", &self.f_fdata);
+                struct_formatter.finish()
+            }
+        }
+        impl ::hash::Hash for file {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.f_flag.hash(state);
+                self.f_count.hash(state);
+                self.f_options.hash(state);
+                self.f_type.hash(state);
+                self.f_data.hash(state);
+                self.f_offset.hash(state);
+                self.f_dir_off.hash(state);
+                self.f_cred.hash(state);
+                #[cfg(libc_union)]
+                self.f_lock.hash(state);
+                #[cfg(libc_union)]
+                self.f_offset_lock.hash(state);
+                self.f_vinfo.hash(state);
+                self.f_ops.hash(state);
+                self.f_parentp.hash(state);
+                self.f_fnamep.hash(state);
+                self.f_fdata.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl PartialEq for __ld_info_file {
+            fn eq(&self, other: &__ld_info_file) -> bool {
+                unsafe {
+                    self._ldinfo_fd == other._ldinfo_fd
+                        && self._ldinfo_fp == other._ldinfo_fp
+                        && self._core_offset == other._core_offset
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __ld_info_file {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __ld_info_file {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("__ld_info_file")
+                    .field("_ldinfo_fd", unsafe { &self._ldinfo_fd })
+                    .field("_ldinfo_fp", unsafe { &self._ldinfo_fp })
+                    .field("_core_offset", unsafe { &self._core_offset })
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __ld_info_file {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                    self._ldinfo_fd.hash(state);
+                    self._ldinfo_fp.hash(state);
+                    self._core_offset.hash(state);
+                }
+            }
+        }
+
+        impl PartialEq for ld_info {
+            fn eq(&self, other: &ld_info) -> bool {
+                #[cfg(libc_union)]
+                let file_eq = self._file == other._file;
+                #[cfg(not(libc_union))]
+                let file_eq = true;
+                self.ldinfo_next == other.ldinfo_next
+                    && self.ldinfo_flags == other.ldinfo_flags
+                    && self.ldinfo_textorg == other.ldinfo_textorg
+                    && self.ldinfo_textsize == other.ldinfo_textsize
+                    && self.ldinfo_dataorg == other.ldinfo_dataorg
+                    && self.ldinfo_datasize == other.ldinfo_datasize
+                    && self.ldinfo_filename == other.ldinfo_filename
+                    && file_eq
+            }
+        }
+        impl Eq for ld_info {}
+        impl ::fmt::Debug for ld_info {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let mut struct_formatter = f.debug_struct("ld_info");
+                struct_formatter.field("ldinfo_next", &self.ldinfo_next);
+                struct_formatter.field("ldinfo_flags", &self.ldinfo_flags);
+                struct_formatter.field("ldinfo_textorg", &self.ldinfo_textorg);
+                struct_formatter.field("ldinfo_textsize", &self.ldinfo_textsize);
+                struct_formatter.field("ldinfo_dataorg", &self.ldinfo_dataorg);
+                struct_formatter.field("ldinfo_datasize", &self.ldinfo_datasize);
+                struct_formatter.field("ldinfo_filename", &self.ldinfo_filename);
+                #[cfg(libc_union)]
+                struct_formatter.field("_file", &self._file);
+                struct_formatter.finish()
+            }
+        }
+        impl ::hash::Hash for ld_info {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ldinfo_next.hash(state);
+                self.ldinfo_flags.hash(state);
+                self.ldinfo_textorg.hash(state);
+                self.ldinfo_textsize.hash(state);
+                self.ldinfo_dataorg.hash(state);
+                self.ldinfo_datasize.hash(state);
+                self.ldinfo_filename.hash(state);
+                #[cfg(libc_union)]
+                self._file.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl PartialEq for __pollfd_ext_u {
+            fn eq(&self, other: &__pollfd_ext_u) -> bool {
+                unsafe {
+                    self.addr == other.addr
+                        && self.data32 == other.data32
+                        && self.data == other.data
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __pollfd_ext_u {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __pollfd_ext_u {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("__pollfd_ext_u")
+                    .field("addr", unsafe { &self.addr })
+                    .field("data32", unsafe { &self.data32 })
+                    .field("data", unsafe { &self.data })
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __pollfd_ext_u {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                    self.addr.hash(state);
+                    self.data.hash(state);
+                    self.data32.hash(state);
+                }
+            }
+        }
+
+        impl PartialEq for pollfd_ext {
+            fn eq(&self, other: &pollfd_ext) -> bool {
+                #[cfg(libc_union)]
+                let data_eq = self.data == other.data;
+                #[cfg(not(libc_union))]
+                let data_eq = true;
+                self.fd == other.fd
+                    && self.events == other.events
+                    && self.revents == other.revents
+                    && data_eq
+            }
+        }
+        impl Eq for pollfd_ext {}
+        impl ::fmt::Debug for pollfd_ext {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let mut struct_formatter = f.debug_struct("pollfd_ext");
+                struct_formatter.field("fd", &self.fd);
+                struct_formatter.field("events", &self.events);
+                struct_formatter.field("revents", &self.revents);
+                #[cfg(libc_union)]
+                struct_formatter.field("data", &self.data);
+                struct_formatter.finish()
+            }
+        }
+        impl ::hash::Hash for pollfd_ext {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.fd.hash(state);
+                self.events.hash(state);
+                self.revents.hash(state);
+                #[cfg(libc_union)]
+                self.data.hash(state);
+            }
+        }
+    }
+}
+
+pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+    __mt_word: [0, 2, 0, 0, 0, 0, 0, 0],
+};
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+    __cv_word: [0, 0, 0, 0, 2, 0],
+};
+pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+    __rw_word: [2, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+};
+pub const RLIM_INFINITY: ::c_ulong = 0x7fffffffffffffff;
+
+extern "C" {
+    pub fn getsystemcfg(label: ::c_int) -> ::c_ulong;
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,6 @@
+s! {
+    #[repr(align(4))]
+    pub struct in6_addr {
+        pub s6_addr: [u8; 16],
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/apple/b32/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/apple/b32/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/apple/b32/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/apple/b32/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f64; 2]
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/apple/b32/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/apple/b32/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/apple/b32/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/apple/b32/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,119 @@
+//! 32-bit specific Apple (ios/darwin) definitions
+
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type boolean_t = ::c_int;
+
+s! {
+    pub struct if_data {
+        pub ifi_type: ::c_uchar,
+        pub ifi_typelen: ::c_uchar,
+        pub ifi_physical: ::c_uchar,
+        pub ifi_addrlen: ::c_uchar,
+        pub ifi_hdrlen: ::c_uchar,
+        pub ifi_recvquota: ::c_uchar,
+        pub ifi_xmitquota: ::c_uchar,
+        pub ifi_unused1: ::c_uchar,
+        pub ifi_mtu: u32,
+        pub ifi_metric: u32,
+        pub ifi_baudrate: u32,
+        pub ifi_ipackets: u32,
+        pub ifi_ierrors: u32,
+        pub ifi_opackets: u32,
+        pub ifi_oerrors: u32,
+        pub ifi_collisions: u32,
+        pub ifi_ibytes: u32,
+        pub ifi_obytes: u32,
+        pub ifi_imcasts: u32,
+        pub ifi_omcasts: u32,
+        pub ifi_iqdrops: u32,
+        pub ifi_noproto: u32,
+        pub ifi_recvtiming: u32,
+        pub ifi_xmittiming: u32,
+        pub ifi_lastchange: ::timeval,
+        pub ifi_unused2: u32,
+        pub ifi_hwassist: u32,
+        pub ifi_reserved1: u32,
+        pub ifi_reserved2: u32,
+    }
+
+    pub struct bpf_hdr {
+        pub bh_tstamp: ::timeval,
+        pub bh_caplen: u32,
+        pub bh_datalen: u32,
+        pub bh_hdrlen: ::c_ushort,
+    }
+
+    pub struct malloc_zone_t {
+        __private: [::uintptr_t; 18], // FIXME: keeping private for now
+    }
+}
+
+s_no_extra_traits! {
+    pub struct pthread_attr_t {
+        __sig: c_long,
+        __opaque: [::c_char; 36]
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for pthread_attr_t {
+            fn eq(&self, other: &pthread_attr_t) -> bool {
+                self.__sig == other.__sig
+                    && self.__opaque
+                    .iter()
+                    .zip(other.__opaque.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for pthread_attr_t {}
+        impl ::fmt::Debug for pthread_attr_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("pthread_attr_t")
+                    .field("__sig", &self.__sig)
+                // FIXME: .field("__opaque", &self.__opaque)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for pthread_attr_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.__sig.hash(state);
+                self.__opaque.hash(state);
+            }
+        }
+    }
+}
+
+#[doc(hidden)]
+#[deprecated(since = "0.2.55")]
+pub const NET_RT_MAXID: ::c_int = 10;
+
+pub const __PTHREAD_MUTEX_SIZE__: usize = 40;
+pub const __PTHREAD_COND_SIZE__: usize = 24;
+pub const __PTHREAD_CONDATTR_SIZE__: usize = 4;
+pub const __PTHREAD_RWLOCK_SIZE__: usize = 124;
+pub const __PTHREAD_RWLOCKATTR_SIZE__: usize = 12;
+
+pub const TIOCTIMESTAMP: ::c_ulong = 0x40087459;
+pub const TIOCDCDTIMESTAMP: ::c_ulong = 0x40087458;
+
+pub const BIOCSETF: ::c_ulong = 0x80084267;
+pub const BIOCSRTIMEOUT: ::c_ulong = 0x8008426d;
+pub const BIOCGRTIMEOUT: ::c_ulong = 0x4008426e;
+pub const BIOCSETFNR: ::c_ulong = 0x8008427e;
+
+extern "C" {
+    pub fn exchangedata(
+        path1: *const ::c_char,
+        path2: *const ::c_char,
+        options: ::c_ulong,
+    ) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,55 @@
+pub type mcontext_t = *mut __darwin_mcontext64;
+
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    pub struct max_align_t {
+        priv_: f64
+    }
+}
+
+s! {
+    pub struct ucontext_t {
+        pub uc_onstack: ::c_int,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_stack: ::stack_t,
+        pub uc_link: *mut ::ucontext_t,
+        pub uc_mcsize: usize,
+        pub uc_mcontext: mcontext_t,
+    }
+
+    pub struct __darwin_mcontext64 {
+        pub __es: __darwin_arm_exception_state64,
+        pub __ss: __darwin_arm_thread_state64,
+        pub __ns: __darwin_arm_neon_state64,
+    }
+
+    pub struct __darwin_arm_exception_state64 {
+        pub __far: u64,
+        pub __esr: u32,
+        pub __exception: u32,
+    }
+
+    pub struct __darwin_arm_thread_state64 {
+        pub __x: [u64; 29],
+        pub __fp: u64,
+        pub __lr: u64,
+        pub __sp: u64,
+        pub __pc: u64,
+        pub __cpsr: u32,
+        pub __pad: u32,
+    }
+
+    // This type natively uses a uint128, but for a while we hacked
+    // it in with repr(align) and `[u64; 2]`. uint128 isn't available
+    // all the way back to our earliest supported versions so we
+    // preserver the old shim.
+    #[cfg_attr(not(libc_int128), repr(align(16)))]
+    pub struct __darwin_arm_neon_state64 {
+        #[cfg(libc_int128)]
+        pub __v: [::__uint128_t; 32],
+        #[cfg(not(libc_int128))]
+        pub __v: [[u64; 2]; 32],
+        pub __fpsr: u32,
+        pub __fpcr: u32,
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/apple/b64/aarch64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/apple/b64/aarch64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/apple/b64/aarch64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/apple/b64/aarch64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,14 @@
+pub type boolean_t = ::c_int;
+
+s! {
+    pub struct malloc_zone_t {
+        __private: [::uintptr_t; 18], // FIXME: needs arm64 auth pointers support
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/apple/b64/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/apple/b64/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/apple/b64/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/apple/b64/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f64; 2]
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/apple/b64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/apple/b64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/apple/b64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/apple/b64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,124 @@
+//! 64-bit specific Apple (ios/darwin) definitions
+
+pub type c_long = i64;
+pub type c_ulong = u64;
+
+s! {
+    pub struct timeval32 {
+        pub tv_sec: i32,
+        pub tv_usec: i32,
+    }
+
+    pub struct if_data {
+        pub ifi_type: ::c_uchar,
+        pub ifi_typelen: ::c_uchar,
+        pub ifi_physical: ::c_uchar,
+        pub ifi_addrlen: ::c_uchar,
+        pub ifi_hdrlen: ::c_uchar,
+        pub ifi_recvquota: ::c_uchar,
+        pub ifi_xmitquota: ::c_uchar,
+        pub ifi_unused1: ::c_uchar,
+        pub ifi_mtu: u32,
+        pub ifi_metric: u32,
+        pub ifi_baudrate: u32,
+        pub ifi_ipackets: u32,
+        pub ifi_ierrors: u32,
+        pub ifi_opackets: u32,
+        pub ifi_oerrors: u32,
+        pub ifi_collisions: u32,
+        pub ifi_ibytes: u32,
+        pub ifi_obytes: u32,
+        pub ifi_imcasts: u32,
+        pub ifi_omcasts: u32,
+        pub ifi_iqdrops: u32,
+        pub ifi_noproto: u32,
+        pub ifi_recvtiming: u32,
+        pub ifi_xmittiming: u32,
+        pub ifi_lastchange: timeval32,
+        pub ifi_unused2: u32,
+        pub ifi_hwassist: u32,
+        pub ifi_reserved1: u32,
+        pub ifi_reserved2: u32,
+    }
+
+    pub struct bpf_hdr {
+        pub bh_tstamp: ::timeval32,
+        pub bh_caplen: u32,
+        pub bh_datalen: u32,
+        pub bh_hdrlen: ::c_ushort,
+    }
+}
+
+s_no_extra_traits! {
+    pub struct pthread_attr_t {
+        __sig: c_long,
+        __opaque: [::c_char; 56]
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for pthread_attr_t {
+            fn eq(&self, other: &pthread_attr_t) -> bool {
+                self.__sig == other.__sig
+                    && self.__opaque
+                    .iter()
+                    .zip(other.__opaque.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for pthread_attr_t {}
+        impl ::fmt::Debug for pthread_attr_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("pthread_attr_t")
+                    .field("__sig", &self.__sig)
+                // FIXME: .field("__opaque", &self.__opaque)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for pthread_attr_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.__sig.hash(state);
+                self.__opaque.hash(state);
+            }
+        }
+    }
+}
+
+#[doc(hidden)]
+#[deprecated(since = "0.2.55")]
+pub const NET_RT_MAXID: ::c_int = 11;
+
+pub const __PTHREAD_MUTEX_SIZE__: usize = 56;
+pub const __PTHREAD_COND_SIZE__: usize = 40;
+pub const __PTHREAD_CONDATTR_SIZE__: usize = 8;
+pub const __PTHREAD_RWLOCK_SIZE__: usize = 192;
+pub const __PTHREAD_RWLOCKATTR_SIZE__: usize = 16;
+
+pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;
+pub const TIOCDCDTIMESTAMP: ::c_ulong = 0x40107458;
+
+pub const BIOCSETF: ::c_ulong = 0x80104267;
+pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
+pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
+pub const BIOCSETFNR: ::c_ulong = 0x8010427e;
+
+extern "C" {
+    pub fn exchangedata(
+        path1: *const ::c_char,
+        path2: *const ::c_char,
+        options: ::c_uint,
+    ) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "x86_64")] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    } else if #[cfg(target_arch = "aarch64")] {
+        mod aarch64;
+        pub use self::aarch64::*;
+    } else {
+        // Unknown target_arch
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/apple/b64/x86_64/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/apple/b64/x86_64/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/apple/b64/x86_64/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/apple/b64/x86_64/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f64; 2]
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/apple/b64/x86_64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/apple/b64/x86_64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/apple/b64/x86_64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/apple/b64/x86_64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,180 @@
+pub type boolean_t = ::c_uint;
+pub type mcontext_t = *mut __darwin_mcontext64;
+
+s! {
+    pub struct ucontext_t {
+        pub uc_onstack: ::c_int,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_stack: ::stack_t,
+        pub uc_link: *mut ::ucontext_t,
+        pub uc_mcsize: usize,
+        pub uc_mcontext: mcontext_t,
+    }
+
+    pub struct __darwin_mcontext64 {
+        pub __es: __darwin_x86_exception_state64,
+        pub __ss: __darwin_x86_thread_state64,
+        pub __fs: __darwin_x86_float_state64,
+    }
+
+    pub struct __darwin_x86_exception_state64 {
+        pub __trapno: u16,
+        pub __cpu: u16,
+        pub __err: u32,
+        pub __faultvaddr: u64,
+    }
+
+    pub struct __darwin_x86_thread_state64 {
+        pub __rax: u64,
+        pub __rbx: u64,
+        pub __rcx: u64,
+        pub __rdx: u64,
+        pub __rdi: u64,
+        pub __rsi: u64,
+        pub __rbp: u64,
+        pub __rsp: u64,
+        pub __r8: u64,
+        pub __r9: u64,
+        pub __r10: u64,
+        pub __r11: u64,
+        pub __r12: u64,
+        pub __r13: u64,
+        pub __r14: u64,
+        pub __r15: u64,
+        pub __rip: u64,
+        pub __rflags: u64,
+        pub __cs: u64,
+        pub __fs: u64,
+        pub __gs: u64,
+    }
+
+    pub struct __darwin_x86_float_state64 {
+        pub __fpu_reserved: [::c_int; 2],
+        __fpu_fcw: ::c_short,
+        __fpu_fsw: ::c_short,
+        pub __fpu_ftw: u8,
+        pub __fpu_rsrv1: u8,
+        pub __fpu_fop: u16,
+        pub __fpu_ip: u32,
+        pub __fpu_cs: u16,
+        pub __fpu_rsrv2: u16,
+        pub __fpu_dp: u32,
+        pub __fpu_ds: u16,
+        pub __fpu_rsrv3: u16,
+        pub __fpu_mxcsr: u32,
+        pub __fpu_mxcsrmask: u32,
+        pub __fpu_stmm0: __darwin_mmst_reg,
+        pub __fpu_stmm1: __darwin_mmst_reg,
+        pub __fpu_stmm2: __darwin_mmst_reg,
+        pub __fpu_stmm3: __darwin_mmst_reg,
+        pub __fpu_stmm4: __darwin_mmst_reg,
+        pub __fpu_stmm5: __darwin_mmst_reg,
+        pub __fpu_stmm6: __darwin_mmst_reg,
+        pub __fpu_stmm7: __darwin_mmst_reg,
+        pub __fpu_xmm0: __darwin_xmm_reg,
+        pub __fpu_xmm1: __darwin_xmm_reg,
+        pub __fpu_xmm2: __darwin_xmm_reg,
+        pub __fpu_xmm3: __darwin_xmm_reg,
+        pub __fpu_xmm4: __darwin_xmm_reg,
+        pub __fpu_xmm5: __darwin_xmm_reg,
+        pub __fpu_xmm6: __darwin_xmm_reg,
+        pub __fpu_xmm7: __darwin_xmm_reg,
+        pub __fpu_xmm8: __darwin_xmm_reg,
+        pub __fpu_xmm9: __darwin_xmm_reg,
+        pub __fpu_xmm10: __darwin_xmm_reg,
+        pub __fpu_xmm11: __darwin_xmm_reg,
+        pub __fpu_xmm12: __darwin_xmm_reg,
+        pub __fpu_xmm13: __darwin_xmm_reg,
+        pub __fpu_xmm14: __darwin_xmm_reg,
+        pub __fpu_xmm15: __darwin_xmm_reg,
+        // this field is actually [u8; 96], but defining it with a bigger type
+        // allows us to auto-implement traits for it since the length of the
+        // array is less than 32
+        __fpu_rsrv4: [u32; 24],
+        pub __fpu_reserved1: ::c_int,
+    }
+
+    pub struct __darwin_mmst_reg {
+        pub __mmst_reg: [::c_char; 10],
+        pub __mmst_rsrv: [::c_char; 6],
+    }
+
+    pub struct __darwin_xmm_reg {
+        pub __xmm_reg: [::c_char; 16],
+    }
+
+    pub struct malloc_introspection_t {
+        _private: [::uintptr_t; 16], // FIXME: keeping private for now
+    }
+
+    pub struct malloc_zone_t {
+        _reserved1: *mut ::c_void,
+        _reserved2: *mut ::c_void,
+        pub size: ::Option<unsafe extern "C" fn(
+            zone: *mut malloc_zone_t,
+            ptr: *const ::c_void,
+        ) -> ::size_t>,
+        pub malloc: ::Option<unsafe extern "C" fn(
+            zone: *mut malloc_zone_t,
+            size: ::size_t,
+        ) -> *mut ::c_void>,
+        pub calloc: ::Option<unsafe extern "C" fn(
+            zone: *mut malloc_zone_t,
+            num_items: ::size_t,
+            size: ::size_t,
+        ) -> *mut ::c_void>,
+        pub valloc: ::Option<unsafe extern "C" fn(
+            zone: *mut malloc_zone_t,
+            size: ::size_t
+        ) -> *mut ::c_void>,
+        pub free: ::Option<unsafe extern "C" fn(
+            zone: *mut malloc_zone_t,
+            ptr: *mut ::c_void
+        )>,
+        pub realloc: ::Option<unsafe extern "C" fn(
+            zone: *mut malloc_zone_t,
+            ptr: *mut ::c_void,
+            size: ::size_t,
+        ) -> *mut ::c_void>,
+        pub destroy: ::Option<unsafe extern "C" fn(zone: *mut malloc_zone_t)>,
+        pub zone_name: *const ::c_char,
+        pub batch_malloc: ::Option<unsafe extern "C" fn(
+            zone: *mut malloc_zone_t,
+            size: ::size_t,
+            results: *mut *mut ::c_void,
+            num_requested: ::c_uint,
+        ) -> ::c_uint>,
+        pub batch_free: ::Option<unsafe extern "C" fn(
+            zone: *mut malloc_zone_t,
+            to_be_freed: *mut *mut ::c_void,
+            num_to_be_freed: ::c_uint,
+        )>,
+        pub introspect: *mut malloc_introspection_t,
+        pub version: ::c_uint,
+        pub memalign: ::Option<unsafe extern "C" fn(
+            zone: *mut malloc_zone_t,
+            alignment: ::size_t,
+            size: ::size_t,
+        ) -> *mut ::c_void>,
+        pub free_definite_size: ::Option<unsafe extern "C" fn(
+            zone: *mut malloc_zone_t,
+            ptr: *mut ::c_void,
+            size: ::size_t
+        )>,
+        pub pressure_relief: ::Option<unsafe extern "C" fn(
+            zone: *mut malloc_zone_t,
+            goal: ::size_t,
+        ) -> ::size_t>,
+        pub claimed_address: ::Option<unsafe extern "C" fn(
+            zone: *mut malloc_zone_t,
+            ptr: *mut ::c_void,
+        ) -> ::boolean_t>,
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/apple/long_array.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/apple/long_array.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/apple/long_array.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/apple/long_array.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,8 @@
+s! {
+    pub struct ctl_info {
+        pub ctl_id: u32,
+        pub ctl_name: [::c_char; MAX_KCTL_NAME],
+    }
+}
+
+pub const MAX_KCTL_NAME: usize = 96;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/apple/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/apple/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/apple/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/apple/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,6548 @@
+//! Apple (ios/darwin)-specific definitions
+//!
+//! This covers *-apple-* triples currently
+pub type c_char = i8;
+pub type wchar_t = i32;
+pub type clock_t = c_ulong;
+pub type time_t = c_long;
+pub type suseconds_t = i32;
+pub type dev_t = i32;
+pub type ino_t = u64;
+pub type mode_t = u16;
+pub type nlink_t = u16;
+pub type blksize_t = i32;
+pub type rlim_t = u64;
+pub type pthread_key_t = c_ulong;
+pub type sigset_t = u32;
+pub type clockid_t = ::c_uint;
+pub type fsblkcnt_t = ::c_uint;
+pub type fsfilcnt_t = ::c_uint;
+pub type speed_t = ::c_ulong;
+pub type tcflag_t = ::c_ulong;
+pub type nl_item = ::c_int;
+pub type id_t = ::c_uint;
+pub type sem_t = ::c_int;
+pub type idtype_t = ::c_uint;
+pub type integer_t = ::c_int;
+pub type cpu_type_t = integer_t;
+pub type cpu_subtype_t = integer_t;
+pub type natural_t = u32;
+pub type mach_msg_type_number_t = natural_t;
+pub type kern_return_t = ::c_int;
+pub type uuid_t = [u8; 16];
+pub type task_info_t = *mut integer_t;
+pub type host_info_t = *mut integer_t;
+pub type task_flavor_t = natural_t;
+pub type rusage_info_t = *mut ::c_void;
+pub type vm_offset_t = ::uintptr_t;
+pub type vm_size_t = ::uintptr_t;
+pub type vm_address_t = vm_offset_t;
+
+pub type posix_spawnattr_t = *mut ::c_void;
+pub type posix_spawn_file_actions_t = *mut ::c_void;
+pub type key_t = ::c_int;
+pub type shmatt_t = ::c_ushort;
+
+pub type sae_associd_t = u32;
+pub type sae_connid_t = u32;
+
+pub type mach_port_t = ::c_uint;
+pub type host_t = ::c_uint;
+pub type host_flavor_t = integer_t;
+pub type host_info64_t = *mut integer_t;
+pub type processor_flavor_t = ::c_int;
+pub type thread_flavor_t = natural_t;
+pub type thread_inspect_t = ::mach_port_t;
+pub type thread_act_t = ::mach_port_t;
+pub type thread_act_array_t = *mut ::thread_act_t;
+pub type policy_t = ::c_int;
+pub type mach_vm_address_t = u64;
+pub type mach_vm_offset_t = u64;
+pub type mach_vm_size_t = u64;
+pub type vm_map_t = ::mach_port_t;
+pub type mem_entry_name_port_t = ::mach_port_t;
+pub type memory_object_t = ::mach_port_t;
+pub type memory_object_offset_t = ::c_ulonglong;
+pub type vm_inherit_t = ::c_uint;
+pub type vm_prot_t = ::c_int;
+
+pub type ledger_t = ::mach_port_t;
+pub type ledger_array_t = *mut ::ledger_t;
+
+pub type iconv_t = *mut ::c_void;
+
+pub type processor_cpu_load_info_t = *mut processor_cpu_load_info;
+pub type processor_cpu_load_info_data_t = processor_cpu_load_info;
+pub type processor_basic_info_t = *mut processor_basic_info;
+pub type processor_basic_info_data_t = processor_basic_info;
+pub type processor_set_basic_info_data_t = processor_set_basic_info;
+pub type processor_set_basic_info_t = *mut processor_set_basic_info;
+pub type processor_set_load_info_data_t = processor_set_load_info;
+pub type processor_set_load_info_t = *mut processor_set_load_info;
+pub type processor_info_t = *mut integer_t;
+pub type processor_info_array_t = *mut integer_t;
+
+pub type mach_task_basic_info_data_t = mach_task_basic_info;
+pub type mach_task_basic_info_t = *mut mach_task_basic_info;
+pub type task_thread_times_info_data_t = task_thread_times_info;
+pub type task_thread_times_info_t = *mut task_thread_times_info;
+
+pub type thread_info_t = *mut integer_t;
+pub type thread_basic_info_t = *mut thread_basic_info;
+pub type thread_basic_info_data_t = thread_basic_info;
+pub type thread_identifier_info_t = *mut thread_identifier_info;
+pub type thread_identifier_info_data_t = thread_identifier_info;
+pub type thread_extended_info_t = *mut thread_extended_info;
+pub type thread_extended_info_data_t = thread_extended_info;
+
+pub type thread_t = ::mach_port_t;
+pub type thread_policy_flavor_t = natural_t;
+pub type thread_policy_t = *mut integer_t;
+pub type thread_latency_qos_t = integer_t;
+pub type thread_throughput_qos_t = integer_t;
+pub type thread_standard_policy_data_t = thread_standard_policy;
+pub type thread_standard_policy_t = *mut thread_standard_policy;
+pub type thread_extended_policy_data_t = thread_extended_policy;
+pub type thread_extended_policy_t = *mut thread_extended_policy;
+pub type thread_time_constraint_policy_data_t = thread_time_constraint_policy;
+pub type thread_time_constraint_policy_t = *mut thread_time_constraint_policy;
+pub type thread_precedence_policy_data_t = thread_precedence_policy;
+pub type thread_precedence_policy_t = *mut thread_precedence_policy;
+pub type thread_affinity_policy_data_t = thread_affinity_policy;
+pub type thread_affinity_policy_t = *mut thread_affinity_policy;
+pub type thread_background_policy_data_t = thread_background_policy;
+pub type thread_background_policy_t = *mut thread_background_policy;
+pub type thread_latency_qos_policy_data_t = thread_latency_qos_policy;
+pub type thread_latency_qos_policy_t = *mut thread_latency_qos_policy;
+pub type thread_throughput_qos_policy_data_t = thread_throughput_qos_policy;
+pub type thread_throughput_qos_policy_t = *mut thread_throughput_qos_policy;
+
+pub type pthread_introspection_hook_t =
+    extern "C" fn(event: ::c_uint, thread: ::pthread_t, addr: *mut ::c_void, size: ::size_t);
+pub type pthread_jit_write_callback_t = ::Option<extern "C" fn(ctx: *mut ::c_void) -> ::c_int>;
+
+pub type os_unfair_lock = os_unfair_lock_s;
+pub type os_unfair_lock_t = *mut os_unfair_lock;
+
+pub type os_log_t = *mut ::c_void;
+pub type os_log_type_t = u8;
+pub type os_signpost_id_t = u64;
+pub type os_signpost_type_t = u8;
+
+pub type vm_statistics_t = *mut vm_statistics;
+pub type vm_statistics_data_t = vm_statistics;
+pub type vm_statistics64_t = *mut vm_statistics64;
+pub type vm_statistics64_data_t = vm_statistics64;
+
+pub type task_t = ::mach_port_t;
+pub type task_inspect_t = ::mach_port_t;
+
+pub type sysdir_search_path_enumeration_state = ::c_uint;
+
+pub type CCStatus = i32;
+pub type CCCryptorStatus = i32;
+pub type CCRNGStatus = ::CCCryptorStatus;
+
+pub type copyfile_state_t = *mut ::c_void;
+pub type copyfile_flags_t = u32;
+pub type copyfile_callback_t = ::Option<
+    extern "C" fn(
+        ::c_int,
+        ::c_int,
+        copyfile_state_t,
+        *const ::c_char,
+        *const ::c_char,
+        *mut ::c_void,
+    ) -> ::c_int,
+>;
+
+pub type attrgroup_t = u32;
+pub type vol_capabilities_set_t = [u32; 4];
+
+deprecated_mach! {
+    pub type mach_timebase_info_data_t = mach_timebase_info;
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum timezone {}
+impl ::Copy for timezone {}
+impl ::Clone for timezone {
+    fn clone(&self) -> timezone {
+        *self
+    }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+#[repr(u32)]
+pub enum qos_class_t {
+    QOS_CLASS_USER_INTERACTIVE = 0x21,
+    QOS_CLASS_USER_INITIATED = 0x19,
+    QOS_CLASS_DEFAULT = 0x15,
+    QOS_CLASS_UTILITY = 0x11,
+    QOS_CLASS_BACKGROUND = 0x09,
+    QOS_CLASS_UNSPECIFIED = 0x00,
+}
+impl ::Copy for qos_class_t {}
+impl ::Clone for qos_class_t {
+    fn clone(&self) -> qos_class_t {
+        *self
+    }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+#[repr(u32)]
+pub enum sysdir_search_path_directory_t {
+    SYSDIR_DIRECTORY_APPLICATION = 1,
+    SYSDIR_DIRECTORY_DEMO_APPLICATION = 2,
+    SYSDIR_DIRECTORY_DEVELOPER_APPLICATION = 3,
+    SYSDIR_DIRECTORY_ADMIN_APPLICATION = 4,
+    SYSDIR_DIRECTORY_LIBRARY = 5,
+    SYSDIR_DIRECTORY_DEVELOPER = 6,
+    SYSDIR_DIRECTORY_USER = 7,
+    SYSDIR_DIRECTORY_DOCUMENTATION = 8,
+    SYSDIR_DIRECTORY_DOCUMENT = 9,
+    SYSDIR_DIRECTORY_CORESERVICE = 10,
+    SYSDIR_DIRECTORY_AUTOSAVED_INFORMATION = 11,
+    SYSDIR_DIRECTORY_DESKTOP = 12,
+    SYSDIR_DIRECTORY_CACHES = 13,
+    SYSDIR_DIRECTORY_APPLICATION_SUPPORT = 14,
+    SYSDIR_DIRECTORY_DOWNLOADS = 15,
+    SYSDIR_DIRECTORY_INPUT_METHODS = 16,
+    SYSDIR_DIRECTORY_MOVIES = 17,
+    SYSDIR_DIRECTORY_MUSIC = 18,
+    SYSDIR_DIRECTORY_PICTURES = 19,
+    SYSDIR_DIRECTORY_PRINTER_DESCRIPTION = 20,
+    SYSDIR_DIRECTORY_SHARED_PUBLIC = 21,
+    SYSDIR_DIRECTORY_PREFERENCE_PANES = 22,
+    SYSDIR_DIRECTORY_ALL_APPLICATIONS = 100,
+    SYSDIR_DIRECTORY_ALL_LIBRARIES = 101,
+}
+impl ::Copy for sysdir_search_path_directory_t {}
+impl ::Clone for sysdir_search_path_directory_t {
+    fn clone(&self) -> sysdir_search_path_directory_t {
+        *self
+    }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+#[repr(u32)]
+pub enum sysdir_search_path_domain_mask_t {
+    SYSDIR_DOMAIN_MASK_USER = (1 << 0),
+    SYSDIR_DOMAIN_MASK_LOCAL = (1 << 1),
+    SYSDIR_DOMAIN_MASK_NETWORK = (1 << 2),
+    SYSDIR_DOMAIN_MASK_SYSTEM = (1 << 3),
+    SYSDIR_DOMAIN_MASK_ALL = 0x0ffff,
+}
+impl ::Copy for sysdir_search_path_domain_mask_t {}
+impl ::Clone for sysdir_search_path_domain_mask_t {
+    fn clone(&self) -> sysdir_search_path_domain_mask_t {
+        *self
+    }
+}
+
+s! {
+    pub struct ip_mreq {
+        pub imr_multiaddr: in_addr,
+        pub imr_interface: in_addr,
+    }
+
+    pub struct ip_mreqn {
+        pub imr_multiaddr: in_addr,
+        pub imr_address: in_addr,
+        pub imr_ifindex: ::c_int,
+    }
+
+    pub struct ip_mreq_source {
+        pub imr_multiaddr: in_addr,
+        pub imr_sourceaddr: in_addr,
+        pub imr_interface: in_addr,
+    }
+
+    pub struct aiocb {
+        pub aio_fildes: ::c_int,
+        pub aio_offset: ::off_t,
+        pub aio_buf: *mut ::c_void,
+        pub aio_nbytes: ::size_t,
+        pub aio_reqprio: ::c_int,
+        pub aio_sigevent: sigevent,
+        pub aio_lio_opcode: ::c_int
+    }
+
+    pub struct glob_t {
+        pub gl_pathc:  ::size_t,
+        __unused1: ::c_int,
+        pub gl_offs:   ::size_t,
+        __unused2: ::c_int,
+        pub gl_pathv:  *mut *mut ::c_char,
+
+        __unused3: *mut ::c_void,
+
+        __unused4: *mut ::c_void,
+        __unused5: *mut ::c_void,
+        __unused6: *mut ::c_void,
+        __unused7: *mut ::c_void,
+        __unused8: *mut ::c_void,
+    }
+
+    pub struct addrinfo {
+        pub ai_flags: ::c_int,
+        pub ai_family: ::c_int,
+        pub ai_socktype: ::c_int,
+        pub ai_protocol: ::c_int,
+        pub ai_addrlen: ::socklen_t,
+        pub ai_canonname: *mut ::c_char,
+        pub ai_addr: *mut ::sockaddr,
+        pub ai_next: *mut addrinfo,
+    }
+
+    #[deprecated(
+        since = "0.2.55",
+        note = "Use the `mach2` crate instead",
+    )]
+    pub struct mach_timebase_info {
+        pub numer: u32,
+        pub denom: u32,
+    }
+
+    pub struct stat {
+        pub st_dev: dev_t,
+        pub st_mode: mode_t,
+        pub st_nlink: nlink_t,
+        pub st_ino: ino_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: dev_t,
+        pub st_atime: time_t,
+        pub st_atime_nsec: c_long,
+        pub st_mtime: time_t,
+        pub st_mtime_nsec: c_long,
+        pub st_ctime: time_t,
+        pub st_ctime_nsec: c_long,
+        pub st_birthtime: time_t,
+        pub st_birthtime_nsec: c_long,
+        pub st_size: ::off_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_blksize: blksize_t,
+        pub st_flags: u32,
+        pub st_gen: u32,
+        pub st_lspare: i32,
+        pub st_qspare: [i64; 2],
+    }
+
+    pub struct pthread_mutexattr_t {
+        __sig: ::c_long,
+        __opaque: [u8; 8],
+    }
+
+    pub struct pthread_condattr_t {
+        __sig: ::c_long,
+        __opaque: [u8; __PTHREAD_CONDATTR_SIZE__],
+    }
+
+    pub struct pthread_rwlockattr_t {
+        __sig: ::c_long,
+        __opaque: [u8; __PTHREAD_RWLOCKATTR_SIZE__],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        pub si_pid: ::pid_t,
+        pub si_uid: ::uid_t,
+        pub si_status: ::c_int,
+        pub si_addr: *mut ::c_void,
+        //Requires it to be union for tests
+        //pub si_value: ::sigval,
+        _pad: [usize; 9],
+    }
+
+    pub struct sigaction {
+        // FIXME: this field is actually a union
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: sigset_t,
+        pub sa_flags: ::c_int,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_size: ::size_t,
+        pub ss_flags: ::c_int,
+    }
+
+    pub struct fstore_t {
+        pub fst_flags: ::c_uint,
+        pub fst_posmode: ::c_int,
+        pub fst_offset: ::off_t,
+        pub fst_length: ::off_t,
+        pub fst_bytesalloc: ::off_t,
+    }
+
+    pub struct fpunchhole_t {
+        pub fp_flags: ::c_uint, /* unused */
+        pub reserved: ::c_uint, /* (to maintain 8-byte alignment) */
+        pub fp_offset: ::off_t, /* IN: start of the region */
+        pub fp_length: ::off_t, /* IN: size of the region */
+    }
+
+    pub struct ftrimactivefile_t {
+        pub fta_offset: ::off_t,
+        pub fta_length: ::off_t,
+    }
+
+    pub struct fspecread_t {
+        pub fsr_flags: ::c_uint,
+        pub reserved: ::c_uint,
+        pub fsr_offset: ::off_t,
+        pub fsr_length: ::off_t,
+    }
+
+    pub struct radvisory {
+        pub ra_offset: ::off_t,
+        pub ra_count: ::c_int,
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+    }
+
+    pub struct Dl_info {
+        pub dli_fname: *const ::c_char,
+        pub dli_fbase: *mut ::c_void,
+        pub dli_sname: *const ::c_char,
+        pub dli_saddr: *mut ::c_void,
+    }
+
+    pub struct sockaddr_in {
+        pub sin_len: u8,
+        pub sin_family: ::sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [::c_char; 8],
+    }
+
+    pub struct kevent64_s {
+        pub ident: u64,
+        pub filter: i16,
+        pub flags: u16,
+        pub fflags: u32,
+        pub data: i64,
+        pub udata: u64,
+        pub ext: [u64; 2],
+    }
+
+    pub struct dqblk {
+        pub dqb_bhardlimit: u64,
+        pub dqb_bsoftlimit: u64,
+        pub dqb_curbytes: u64,
+        pub dqb_ihardlimit: u32,
+        pub dqb_isoftlimit: u32,
+        pub dqb_curinodes: u32,
+        pub dqb_btime: u32,
+        pub dqb_itime: u32,
+        pub dqb_id: u32,
+        pub dqb_spare: [u32; 4],
+    }
+
+    pub struct if_msghdr {
+        pub ifm_msglen: ::c_ushort,
+        pub ifm_version: ::c_uchar,
+        pub ifm_type: ::c_uchar,
+        pub ifm_addrs: ::c_int,
+        pub ifm_flags: ::c_int,
+        pub ifm_index: ::c_ushort,
+        pub ifm_data: if_data,
+    }
+
+    pub struct ifa_msghdr {
+        pub ifam_msglen: ::c_ushort,
+        pub ifam_version: ::c_uchar,
+        pub ifam_type: ::c_uchar,
+        pub ifam_addrs: ::c_int,
+        pub ifam_flags: ::c_int,
+        pub ifam_index: ::c_ushort,
+        pub ifam_metric: ::c_int,
+    }
+
+    pub struct ifma_msghdr {
+        pub ifmam_msglen: ::c_ushort,
+        pub ifmam_version: ::c_uchar,
+        pub ifmam_type: ::c_uchar,
+        pub ifmam_addrs: ::c_int,
+        pub ifmam_flags: ::c_int,
+        pub ifmam_index: ::c_ushort,
+    }
+
+    pub struct ifma_msghdr2 {
+        pub ifmam_msglen: ::c_ushort,
+        pub ifmam_version: ::c_uchar,
+        pub ifmam_type: ::c_uchar,
+        pub ifmam_addrs: ::c_int,
+        pub ifmam_flags: ::c_int,
+        pub ifmam_index: ::c_ushort,
+        pub ifmam_refcount: i32,
+    }
+
+    pub struct rt_metrics {
+        pub rmx_locks: u32,
+        pub rmx_mtu: u32,
+        pub rmx_hopcount: u32,
+        pub rmx_expire: i32,
+        pub rmx_recvpipe: u32,
+        pub rmx_sendpipe: u32,
+        pub rmx_ssthresh: u32,
+        pub rmx_rtt: u32,
+        pub rmx_rttvar: u32,
+        pub rmx_pksent: u32,
+        pub rmx_state: u32,
+        pub rmx_filler: [u32; 3],
+    }
+
+    pub struct rt_msghdr {
+        pub rtm_msglen: ::c_ushort,
+        pub rtm_version: ::c_uchar,
+        pub rtm_type: ::c_uchar,
+        pub rtm_index: ::c_ushort,
+        pub rtm_flags: ::c_int,
+        pub rtm_addrs: ::c_int,
+        pub rtm_pid: ::pid_t,
+        pub rtm_seq: ::c_int,
+        pub rtm_errno: ::c_int,
+        pub rtm_use: ::c_int,
+        pub rtm_inits: u32,
+        pub rtm_rmx: rt_metrics,
+    }
+
+    pub struct rt_msghdr2 {
+        pub rtm_msglen: ::c_ushort,
+        pub rtm_version: ::c_uchar,
+        pub rtm_type: ::c_uchar,
+        pub rtm_index: ::c_ushort,
+        pub rtm_flags: ::c_int,
+        pub rtm_addrs: ::c_int,
+        pub rtm_refcnt: i32,
+        pub rtm_parentflags: ::c_int,
+        pub rtm_reserved: ::c_int,
+        pub rtm_use: ::c_int,
+        pub rtm_inits: u32,
+        pub rtm_rmx: rt_metrics,
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_cc: [::cc_t; ::NCCS],
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::speed_t,
+    }
+
+    pub struct flock {
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+    }
+
+    pub struct sf_hdtr {
+        pub headers: *mut ::iovec,
+        pub hdr_cnt: ::c_int,
+        pub trailers: *mut ::iovec,
+        pub trl_cnt: ::c_int,
+    }
+
+    pub struct lconv {
+        pub decimal_point: *mut ::c_char,
+        pub thousands_sep: *mut ::c_char,
+        pub grouping: *mut ::c_char,
+        pub int_curr_symbol: *mut ::c_char,
+        pub currency_symbol: *mut ::c_char,
+        pub mon_decimal_point: *mut ::c_char,
+        pub mon_thousands_sep: *mut ::c_char,
+        pub mon_grouping: *mut ::c_char,
+        pub positive_sign: *mut ::c_char,
+        pub negative_sign: *mut ::c_char,
+        pub int_frac_digits: ::c_char,
+        pub frac_digits: ::c_char,
+        pub p_cs_precedes: ::c_char,
+        pub p_sep_by_space: ::c_char,
+        pub n_cs_precedes: ::c_char,
+        pub n_sep_by_space: ::c_char,
+        pub p_sign_posn: ::c_char,
+        pub n_sign_posn: ::c_char,
+        pub int_p_cs_precedes: ::c_char,
+        pub int_n_cs_precedes: ::c_char,
+        pub int_p_sep_by_space: ::c_char,
+        pub int_n_sep_by_space: ::c_char,
+        pub int_p_sign_posn: ::c_char,
+        pub int_n_sign_posn: ::c_char,
+    }
+
+    pub struct proc_taskinfo {
+        pub pti_virtual_size: u64,
+        pub pti_resident_size: u64,
+        pub pti_total_user: u64,
+        pub pti_total_system: u64,
+        pub pti_threads_user: u64,
+        pub pti_threads_system: u64,
+        pub pti_policy: i32,
+        pub pti_faults: i32,
+        pub pti_pageins: i32,
+        pub pti_cow_faults: i32,
+        pub pti_messages_sent: i32,
+        pub pti_messages_received: i32,
+        pub pti_syscalls_mach: i32,
+        pub pti_syscalls_unix: i32,
+        pub pti_csw: i32,
+        pub pti_threadnum: i32,
+        pub pti_numrunning: i32,
+        pub pti_priority: i32,
+    }
+
+    pub struct proc_bsdinfo {
+        pub pbi_flags: u32,
+        pub pbi_status: u32,
+        pub pbi_xstatus: u32,
+        pub pbi_pid: u32,
+        pub pbi_ppid: u32,
+        pub pbi_uid: ::uid_t,
+        pub pbi_gid: ::gid_t,
+        pub pbi_ruid: ::uid_t,
+        pub pbi_rgid: ::gid_t,
+        pub pbi_svuid: ::uid_t,
+        pub pbi_svgid: ::gid_t,
+        pub rfu_1: u32,
+        pub pbi_comm: [::c_char; MAXCOMLEN],
+        pub pbi_name: [::c_char; 32], // MAXCOMLEN * 2, but macro isn't happy...
+        pub pbi_nfiles: u32,
+        pub pbi_pgid: u32,
+        pub pbi_pjobc: u32,
+        pub e_tdev: u32,
+        pub e_tpgid: u32,
+        pub pbi_nice: i32,
+        pub pbi_start_tvsec: u64,
+        pub pbi_start_tvusec: u64,
+    }
+
+    pub struct proc_taskallinfo {
+        pub pbsd: proc_bsdinfo,
+        pub ptinfo: proc_taskinfo,
+    }
+
+    pub struct xsw_usage {
+        pub xsu_total: u64,
+        pub xsu_avail: u64,
+        pub xsu_used: u64,
+        pub xsu_pagesize: u32,
+        pub xsu_encrypted: ::boolean_t,
+    }
+
+    pub struct xucred {
+        pub cr_version: ::c_uint,
+        pub cr_uid: ::uid_t,
+        pub cr_ngroups: ::c_short,
+        pub cr_groups: [::gid_t;16]
+    }
+
+    #[deprecated(
+        since = "0.2.55",
+        note = "Use the `mach2` crate instead",
+    )]
+    pub struct mach_header {
+        pub magic: u32,
+        pub cputype: cpu_type_t,
+        pub cpusubtype: cpu_subtype_t,
+        pub filetype: u32,
+        pub ncmds: u32,
+        pub sizeofcmds: u32,
+        pub flags: u32,
+    }
+
+    #[deprecated(
+        since = "0.2.55",
+        note = "Use the `mach2` crate instead",
+    )]
+    pub struct mach_header_64 {
+        pub magic: u32,
+        pub cputype: cpu_type_t,
+        pub cpusubtype: cpu_subtype_t,
+        pub filetype: u32,
+        pub ncmds: u32,
+        pub sizeofcmds: u32,
+        pub flags: u32,
+        pub reserved: u32,
+    }
+
+    pub struct segment_command {
+        pub cmd: u32,
+        pub cmdsize: u32,
+        pub segname: [::c_char; 16],
+        pub vmaddr: u32,
+        pub vmsize: u32,
+        pub fileoff: u32,
+        pub filesize: u32,
+        pub maxprot: vm_prot_t,
+        pub initprot: vm_prot_t,
+        pub nsects: u32,
+        pub flags: u32,
+    }
+
+    pub struct segment_command_64 {
+        pub cmd: u32,
+        pub cmdsize: u32,
+        pub segname: [::c_char; 16],
+        pub vmaddr: u64,
+        pub vmsize: u64,
+        pub fileoff: u64,
+        pub filesize: u64,
+        pub maxprot: vm_prot_t,
+        pub initprot: vm_prot_t,
+        pub nsects: u32,
+        pub flags: u32,
+    }
+
+    pub struct load_command {
+        pub cmd: u32,
+        pub cmdsize: u32,
+    }
+
+    pub struct sockaddr_dl {
+        pub sdl_len: ::c_uchar,
+        pub sdl_family: ::c_uchar,
+        pub sdl_index: ::c_ushort,
+        pub sdl_type: ::c_uchar,
+        pub sdl_nlen: ::c_uchar,
+        pub sdl_alen: ::c_uchar,
+        pub sdl_slen: ::c_uchar,
+        pub sdl_data: [::c_char; 12],
+    }
+
+    pub struct sockaddr_inarp {
+        pub sin_len: ::c_uchar,
+        pub sin_family: ::c_uchar,
+        pub sin_port: ::c_ushort,
+        pub sin_addr: ::in_addr,
+        pub sin_srcaddr: ::in_addr,
+        pub sin_tos: ::c_ushort,
+        pub sin_other: ::c_ushort,
+    }
+
+    pub struct sockaddr_ctl {
+        pub sc_len: ::c_uchar,
+        pub sc_family: ::c_uchar,
+        pub ss_sysaddr: u16,
+        pub sc_id: u32,
+        pub sc_unit: u32,
+        pub sc_reserved: [u32; 5],
+    }
+
+    pub struct in_pktinfo {
+        pub ipi_ifindex: ::c_uint,
+        pub ipi_spec_dst: ::in_addr,
+        pub ipi_addr: ::in_addr,
+    }
+
+    pub struct in6_pktinfo {
+        pub ipi6_addr: ::in6_addr,
+        pub ipi6_ifindex: ::c_uint,
+    }
+
+    // sys/ipc.h:
+
+    pub struct ipc_perm {
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub _seq: ::c_ushort,
+        pub _key: ::key_t,
+    }
+
+    // sys/sem.h
+
+    pub struct sembuf {
+        pub sem_num: ::c_ushort,
+        pub sem_op: ::c_short,
+        pub sem_flg: ::c_short,
+    }
+
+    // sys/shm.h
+
+    pub struct arphdr {
+        pub ar_hrd: u16,
+        pub ar_pro: u16,
+        pub ar_hln: u8,
+        pub ar_pln: u8,
+        pub ar_op: u16,
+    }
+
+    pub struct in_addr {
+        pub s_addr: ::in_addr_t,
+    }
+
+    // net/ndrv.h
+    pub struct sockaddr_ndrv {
+        pub snd_len: ::c_uchar,
+        pub snd_family: ::c_uchar,
+        pub snd_name: [::c_uchar; ::IFNAMSIZ],
+    }
+
+    // sys/socket.h
+
+    pub struct sa_endpoints_t {
+        pub sae_srcif: ::c_uint, // optional source interface
+        pub sae_srcaddr: *const ::sockaddr, // optional source address
+        pub sae_srcaddrlen: ::socklen_t, // size of source address
+        pub sae_dstaddr: *const ::sockaddr, // destination address
+        pub sae_dstaddrlen: ::socklen_t, // size of destination address
+    }
+
+    pub struct timex {
+        pub modes: ::c_uint,
+        pub offset: ::c_long,
+        pub freq: ::c_long,
+        pub maxerror: ::c_long,
+        pub esterror: ::c_long,
+        pub status: ::c_int,
+        pub constant: ::c_long,
+        pub precision: ::c_long,
+        pub tolerance: ::c_long,
+        pub ppsfreq: ::c_long,
+        pub jitter: ::c_long,
+        pub shift: ::c_int,
+        pub stabil: ::c_long,
+        pub jitcnt: ::c_long,
+        pub calcnt: ::c_long,
+        pub errcnt: ::c_long,
+        pub stbcnt: ::c_long,
+    }
+
+    pub struct ntptimeval {
+        pub time: ::timespec,
+        pub maxerror: ::c_long,
+        pub esterror: ::c_long,
+        pub tai: ::c_long,
+        pub time_state: ::c_int,
+    }
+
+    pub struct thread_standard_policy {
+        pub no_data: natural_t,
+    }
+
+    pub struct thread_extended_policy {
+        pub timeshare: boolean_t,
+    }
+
+    pub struct thread_time_constraint_policy {
+        pub period: u32,
+        pub computation: u32,
+        pub constraint: u32,
+        pub preemptible: boolean_t,
+    }
+
+    pub struct thread_precedence_policy {
+        pub importance: integer_t,
+    }
+
+    pub struct thread_affinity_policy {
+        pub affinity_tag: integer_t,
+    }
+
+    pub struct thread_background_policy {
+        pub priority: integer_t,
+    }
+
+    pub struct thread_latency_qos_policy {
+        pub thread_latency_qos_tier: thread_latency_qos_t,
+    }
+
+    pub struct thread_throughput_qos_policy {
+        pub thread_throughput_qos_tier: thread_throughput_qos_t,
+    }
+
+    // malloc/malloc.h
+    pub struct malloc_statistics_t {
+        pub blocks_in_use: ::c_uint,
+        pub size_in_use: ::size_t,
+        pub max_size_in_use: ::size_t,
+        pub size_allocated: ::size_t,
+    }
+
+    pub struct mstats {
+        pub bytes_total: ::size_t,
+        pub chunks_used: ::size_t,
+        pub bytes_used: ::size_t,
+        pub chunks_free: ::size_t,
+        pub bytes_free: ::size_t,
+    }
+
+    pub struct vm_range_t {
+        pub address: ::vm_address_t,
+        pub size: ::vm_size_t,
+    }
+
+    // sched.h
+    pub struct sched_param {
+        pub sched_priority: ::c_int,
+        __opaque: [::c_char; 4],
+    }
+
+    pub struct vinfo_stat {
+        pub vst_dev: u32,
+        pub vst_mode: u16,
+        pub vst_nlink: u16,
+        pub vst_ino: u64,
+        pub vst_uid: ::uid_t,
+        pub vst_gid: ::gid_t,
+        pub vst_atime: i64,
+        pub vst_atimensec: i64,
+        pub vst_mtime: i64,
+        pub vst_mtimensec: i64,
+        pub vst_ctime: i64,
+        pub vst_ctimensec: i64,
+        pub vst_birthtime: i64,
+        pub vst_birthtimensec: i64,
+        pub vst_size: ::off_t,
+        pub vst_blocks: i64,
+        pub vst_blksize: i32,
+        pub vst_flags: u32,
+        pub vst_gen: u32,
+        pub vst_rdev: u32,
+        pub vst_qspare: [i64; 2],
+    }
+
+    pub struct vnode_info {
+        pub vi_stat: vinfo_stat,
+        pub vi_type: ::c_int,
+        pub vi_pad: ::c_int,
+        pub vi_fsid: ::fsid_t,
+    }
+
+    pub struct vnode_info_path {
+        pub vip_vi: vnode_info,
+        // Normally it's `vip_path: [::c_char; MAXPATHLEN]` but because libc supports an old rustc
+        // version, we go around this limitation like this.
+        pub vip_path: [[::c_char; 32]; 32],
+    }
+
+    pub struct proc_vnodepathinfo {
+        pub pvi_cdir: vnode_info_path,
+        pub pvi_rdir: vnode_info_path,
+    }
+
+    pub struct vm_statistics {
+        pub free_count: natural_t,
+        pub active_count: natural_t,
+        pub inactive_count: natural_t,
+        pub wire_count: natural_t,
+        pub zero_fill_count: natural_t,
+        pub reactivations: natural_t,
+        pub pageins: natural_t,
+        pub pageouts: natural_t,
+        pub faults: natural_t,
+        pub cow_faults: natural_t,
+        pub lookups: natural_t,
+        pub hits: natural_t,
+        pub purgeable_count: natural_t,
+        pub purges: natural_t,
+        pub speculative_count: natural_t,
+    }
+
+    pub struct task_thread_times_info {
+        pub user_time: time_value_t,
+        pub system_time: time_value_t,
+    }
+
+    pub struct rusage_info_v0 {
+        pub ri_uuid: [u8; 16],
+        pub ri_user_time: u64,
+        pub ri_system_time: u64,
+        pub ri_pkg_idle_wkups: u64,
+        pub ri_interrupt_wkups: u64,
+        pub ri_pageins: u64,
+        pub ri_wired_size: u64,
+        pub ri_resident_size: u64,
+        pub ri_phys_footprint: u64,
+        pub ri_proc_start_abstime: u64,
+        pub ri_proc_exit_abstime: u64,
+    }
+
+    pub struct rusage_info_v1 {
+        pub ri_uuid: [u8; 16],
+        pub ri_user_time: u64,
+        pub ri_system_time: u64,
+        pub ri_pkg_idle_wkups: u64,
+        pub ri_interrupt_wkups: u64,
+        pub ri_pageins: u64,
+        pub ri_wired_size: u64,
+        pub ri_resident_size: u64,
+        pub ri_phys_footprint: u64,
+        pub ri_proc_start_abstime: u64,
+        pub ri_proc_exit_abstime: u64,
+        pub ri_child_user_time: u64,
+        pub ri_child_system_time: u64,
+        pub ri_child_pkg_idle_wkups: u64,
+        pub ri_child_interrupt_wkups: u64,
+        pub ri_child_pageins: u64,
+        pub ri_child_elapsed_abstime: u64,
+    }
+
+    pub struct rusage_info_v2 {
+        pub ri_uuid: [u8; 16],
+        pub ri_user_time: u64,
+        pub ri_system_time: u64,
+        pub ri_pkg_idle_wkups: u64,
+        pub ri_interrupt_wkups: u64,
+        pub ri_pageins: u64,
+        pub ri_wired_size: u64,
+        pub ri_resident_size: u64,
+        pub ri_phys_footprint: u64,
+        pub ri_proc_start_abstime: u64,
+        pub ri_proc_exit_abstime: u64,
+        pub ri_child_user_time: u64,
+        pub ri_child_system_time: u64,
+        pub ri_child_pkg_idle_wkups: u64,
+        pub ri_child_interrupt_wkups: u64,
+        pub ri_child_pageins: u64,
+        pub ri_child_elapsed_abstime: u64,
+        pub ri_diskio_bytesread: u64,
+        pub ri_diskio_byteswritten: u64,
+    }
+
+    pub struct rusage_info_v3 {
+        pub ri_uuid: [u8; 16],
+        pub ri_user_time: u64,
+        pub ri_system_time: u64,
+        pub ri_pkg_idle_wkups: u64,
+        pub ri_interrupt_wkups: u64,
+        pub ri_pageins: u64,
+        pub ri_wired_size: u64,
+        pub ri_resident_size: u64,
+        pub ri_phys_footprint: u64,
+        pub ri_proc_start_abstime: u64,
+        pub ri_proc_exit_abstime: u64,
+        pub ri_child_user_time: u64,
+        pub ri_child_system_time: u64,
+        pub ri_child_pkg_idle_wkups: u64,
+        pub ri_child_interrupt_wkups: u64,
+        pub ri_child_pageins: u64,
+        pub ri_child_elapsed_abstime: u64,
+        pub ri_diskio_bytesread: u64,
+        pub ri_diskio_byteswritten: u64,
+        pub ri_cpu_time_qos_default: u64,
+        pub ri_cpu_time_qos_maintenance: u64,
+        pub ri_cpu_time_qos_background: u64,
+        pub ri_cpu_time_qos_utility: u64,
+        pub ri_cpu_time_qos_legacy: u64,
+        pub ri_cpu_time_qos_user_initiated: u64,
+        pub ri_cpu_time_qos_user_interactive: u64,
+        pub ri_billed_system_time: u64,
+        pub ri_serviced_system_time: u64,
+    }
+
+    pub struct rusage_info_v4 {
+        pub ri_uuid: [u8; 16],
+        pub ri_user_time: u64,
+        pub ri_system_time: u64,
+        pub ri_pkg_idle_wkups: u64,
+        pub ri_interrupt_wkups: u64,
+        pub ri_pageins: u64,
+        pub ri_wired_size: u64,
+        pub ri_resident_size: u64,
+        pub ri_phys_footprint: u64,
+        pub ri_proc_start_abstime: u64,
+        pub ri_proc_exit_abstime: u64,
+        pub ri_child_user_time: u64,
+        pub ri_child_system_time: u64,
+        pub ri_child_pkg_idle_wkups: u64,
+        pub ri_child_interrupt_wkups: u64,
+        pub ri_child_pageins: u64,
+        pub ri_child_elapsed_abstime: u64,
+        pub ri_diskio_bytesread: u64,
+        pub ri_diskio_byteswritten: u64,
+        pub ri_cpu_time_qos_default: u64,
+        pub ri_cpu_time_qos_maintenance: u64,
+        pub ri_cpu_time_qos_background: u64,
+        pub ri_cpu_time_qos_utility: u64,
+        pub ri_cpu_time_qos_legacy: u64,
+        pub ri_cpu_time_qos_user_initiated: u64,
+        pub ri_cpu_time_qos_user_interactive: u64,
+        pub ri_billed_system_time: u64,
+        pub ri_serviced_system_time: u64,
+        pub ri_logical_writes: u64,
+        pub ri_lifetime_max_phys_footprint: u64,
+        pub ri_instructions: u64,
+        pub ri_cycles: u64,
+        pub ri_billed_energy: u64,
+        pub ri_serviced_energy: u64,
+        pub ri_interval_max_phys_footprint: u64,
+        pub ri_runnable_time: u64,
+    }
+
+    pub struct image_offset {
+        pub uuid: ::uuid_t,
+        pub offset: u32,
+    }
+
+    pub struct attrlist {
+        pub bitmapcount: ::c_ushort,
+        pub reserved: u16,
+        pub commonattr: attrgroup_t,
+        pub volattr: attrgroup_t,
+        pub dirattr: attrgroup_t,
+        pub fileattr: attrgroup_t,
+        pub forkattr: attrgroup_t,
+    }
+
+    pub struct attrreference_t {
+        pub attr_dataoffset: i32,
+        pub attr_length: u32,
+    }
+
+    pub struct vol_capabilities_attr_t {
+        pub capabilities: vol_capabilities_set_t,
+        pub valid: vol_capabilities_set_t,
+    }
+
+    pub struct attribute_set_t {
+        pub commonattr: attrgroup_t,
+        pub volattr: attrgroup_t,
+        pub dirattr: attrgroup_t,
+        pub fileattr: attrgroup_t,
+        pub forkattr: attrgroup_t,
+    }
+
+    pub struct vol_attributes_attr_t {
+        pub validattr: attribute_set_t,
+        pub nativeattr: attribute_set_t,
+    }
+
+    #[cfg_attr(libc_packedN, repr(packed(4)))]
+    pub struct ifconf {
+        pub ifc_len: ::c_int,
+        #[cfg(libc_union)]
+        pub ifc_ifcu: __c_anonymous_ifc_ifcu,
+        #[cfg(not(libc_union))]
+        pub ifc_ifcu: *mut ifreq,
+    }
+
+    #[cfg_attr(libc_align, repr(align(8)))]
+    pub struct tcp_connection_info {
+        pub tcpi_state: u8,
+        pub tcpi_snd_wscale: u8,
+        pub tcpi_rcv_wscale: u8,
+        __pad1: u8,
+        pub tcpi_options: u32,
+        pub tcpi_flags: u32,
+        pub tcpi_rto: u32,
+        pub tcpi_maxseg: u32,
+        pub tcpi_snd_ssthresh: u32,
+        pub tcpi_snd_cwnd: u32,
+        pub tcpi_snd_wnd: u32,
+        pub tcpi_snd_sbbytes: u32,
+        pub tcpi_rcv_wnd: u32,
+        pub tcpi_rttcur: u32,
+        pub tcpi_srtt: u32,
+        pub tcpi_rttvar: u32,
+        pub tcpi_tfo_cookie_req: u32,
+        pub tcpi_tfo_cookie_rcv: u32,
+        pub tcpi_tfo_syn_loss: u32,
+        pub tcpi_tfo_syn_data_sent: u32,
+        pub tcpi_tfo_syn_data_acked: u32,
+        pub tcpi_tfo_syn_data_rcv: u32,
+        pub tcpi_tfo_cookie_req_rcv: u32,
+        pub tcpi_tfo_cookie_sent: u32,
+        pub tcpi_tfo_cookie_invalid: u32,
+        pub tcpi_tfo_cookie_wrong: u32,
+        pub tcpi_tfo_no_cookie_rcv: u32,
+        pub tcpi_tfo_heuristics_disable: u32,
+        pub tcpi_tfo_send_blackhole: u32,
+        pub tcpi_tfo_recv_blackhole: u32,
+        pub tcpi_tfo_onebyte_proxy: u32,
+        __pad2: u32,
+        pub tcpi_txpackets: u64,
+        pub tcpi_txbytes: u64,
+        pub tcpi_txretransmitbytes: u64,
+        pub tcpi_rxpackets: u64,
+        pub tcpi_rxbytes: u64,
+        pub tcpi_rxoutoforderbytes: u64,
+        pub tcpi_rxretransmitpackets: u64,
+    }
+}
+
+s_no_extra_traits! {
+    #[cfg_attr(libc_packedN, repr(packed(4)))]
+    pub struct kevent {
+        pub ident: ::uintptr_t,
+        pub filter: i16,
+        pub flags: u16,
+        pub fflags: u32,
+        pub data: ::intptr_t,
+        pub udata: *mut ::c_void,
+    }
+
+    #[cfg_attr(libc_packedN, repr(packed(4)))]
+    pub struct semid_ds {
+        // Note the manpage shows different types than the system header.
+        pub sem_perm: ipc_perm,
+        pub sem_base: i32,
+        pub sem_nsems: ::c_ushort,
+        pub sem_otime: ::time_t,
+        pub sem_pad1: i32,
+        pub sem_ctime: ::time_t,
+        pub sem_pad2: i32,
+        pub sem_pad3: [i32; 4],
+    }
+
+    #[cfg_attr(libc_packedN, repr(packed(4)))]
+    pub struct shmid_ds {
+        pub shm_perm: ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        pub shm_atime: ::time_t,  // FIXME: 64-bit wrong align => wrong offset
+        pub shm_dtime: ::time_t,  // FIXME: 64-bit wrong align => wrong offset
+        pub shm_ctime: ::time_t,  // FIXME: 64-bit wrong align => wrong offset
+        // FIXME: 64-bit wrong align => wrong offset:
+        pub shm_internal: *mut ::c_void,
+    }
+
+    pub struct proc_threadinfo {
+        pub pth_user_time: u64,
+        pub pth_system_time: u64,
+        pub pth_cpu_usage: i32,
+        pub pth_policy: i32,
+        pub pth_run_state: i32,
+        pub pth_flags: i32,
+        pub pth_sleep_time: i32,
+        pub pth_curpri: i32,
+        pub pth_priority: i32,
+        pub pth_maxpriority: i32,
+        pub pth_name: [::c_char; MAXTHREADNAMESIZE],
+    }
+
+    pub struct statfs {
+        pub f_bsize: u32,
+        pub f_iosize: i32,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_fsid: ::fsid_t,
+        pub f_owner: ::uid_t,
+        pub f_type: u32,
+        pub f_flags: u32,
+        pub f_fssubtype: u32,
+        pub f_fstypename: [::c_char; 16],
+        pub f_mntonname: [::c_char; 1024],
+        pub f_mntfromname: [::c_char; 1024],
+        pub f_flags_ext: u32,
+        pub f_reserved: [u32; 7],
+    }
+
+    pub struct dirent {
+        pub d_ino: u64,
+        pub d_seekoff: u64,
+        pub d_reclen: u16,
+        pub d_namlen: u16,
+        pub d_type: u8,
+        pub d_name: [::c_char; 1024],
+    }
+
+    pub struct pthread_rwlock_t {
+        __sig: ::c_long,
+        __opaque: [u8; __PTHREAD_RWLOCK_SIZE__],
+    }
+
+    pub struct pthread_mutex_t {
+        __sig: ::c_long,
+        __opaque: [u8; __PTHREAD_MUTEX_SIZE__],
+    }
+
+    pub struct pthread_cond_t {
+        __sig: ::c_long,
+        __opaque: [u8; __PTHREAD_COND_SIZE__],
+    }
+
+    pub struct sockaddr_storage {
+        pub ss_len: u8,
+        pub ss_family: ::sa_family_t,
+        __ss_pad1: [u8; 6],
+        __ss_align: i64,
+        __ss_pad2: [u8; 112],
+    }
+
+    pub struct utmpx {
+        pub ut_user: [::c_char; _UTX_USERSIZE],
+        pub ut_id: [::c_char; _UTX_IDSIZE],
+        pub ut_line: [::c_char; _UTX_LINESIZE],
+        pub ut_pid: ::pid_t,
+        pub ut_type: ::c_short,
+        pub ut_tv: ::timeval,
+        pub ut_host: [::c_char; _UTX_HOSTSIZE],
+        ut_pad: [u32; 16],
+    }
+
+    pub struct sigevent {
+        pub sigev_notify: ::c_int,
+        pub sigev_signo: ::c_int,
+        pub sigev_value: ::sigval,
+        __unused1: *mut ::c_void,       //actually a function pointer
+        pub sigev_notify_attributes: *mut ::pthread_attr_t
+    }
+
+    pub struct processor_cpu_load_info {
+        pub cpu_ticks: [::c_uint; CPU_STATE_MAX as usize],
+    }
+
+    pub struct processor_basic_info {
+        pub cpu_type: cpu_type_t,
+        pub cpu_subtype: cpu_subtype_t,
+        pub running: ::boolean_t,
+        pub slot_num: ::c_int,
+        pub is_master: ::boolean_t,
+    }
+
+    pub struct processor_set_basic_info {
+        pub processor_count: ::c_int,
+        pub default_policy: ::c_int,
+    }
+
+    pub struct processor_set_load_info {
+        pub task_count: ::c_int,
+        pub thread_count: ::c_int,
+        pub load_average: integer_t,
+        pub mach_factor: integer_t,
+    }
+
+    pub struct time_value_t {
+        pub seconds: integer_t,
+        pub microseconds: integer_t,
+    }
+
+    pub struct thread_basic_info {
+        pub user_time: time_value_t,
+        pub system_time: time_value_t,
+        pub cpu_usage: ::integer_t,
+        pub policy: ::policy_t,
+        pub run_state: ::integer_t,
+        pub flags: ::integer_t,
+        pub suspend_count: ::integer_t,
+        pub sleep_time: ::integer_t,
+    }
+
+    pub struct thread_identifier_info {
+        pub thread_id: u64,
+        pub thread_handle: u64,
+        pub dispatch_qaddr: u64,
+    }
+
+    pub struct thread_extended_info {
+        pub pth_user_time: u64,
+        pub pth_system_time: u64,
+        pub pth_cpu_usage: i32,
+        pub pth_policy: i32,
+        pub pth_run_state: i32,
+        pub pth_flags: i32,
+        pub pth_sleep_time: i32,
+        pub pth_curpri: i32,
+        pub pth_priority: i32,
+        pub pth_maxpriority: i32,
+        pub pth_name: [::c_char; MAXTHREADNAMESIZE],
+    }
+
+    #[cfg_attr(libc_packedN, repr(packed(4)))]
+    pub struct if_data64 {
+        pub ifi_type: ::c_uchar,
+        pub ifi_typelen: ::c_uchar,
+        pub ifi_physical: ::c_uchar,
+        pub ifi_addrlen: ::c_uchar,
+        pub ifi_hdrlen: ::c_uchar,
+        pub ifi_recvquota: ::c_uchar,
+        pub ifi_xmitquota: ::c_uchar,
+        pub ifi_unused1: ::c_uchar,
+        pub ifi_mtu: u32,
+        pub ifi_metric: u32,
+        pub ifi_baudrate: u64,
+        pub ifi_ipackets: u64,
+        pub ifi_ierrors: u64,
+        pub ifi_opackets: u64,
+        pub ifi_oerrors: u64,
+        pub ifi_collisions: u64,
+        pub ifi_ibytes: u64,
+        pub ifi_obytes: u64,
+        pub ifi_imcasts: u64,
+        pub ifi_omcasts: u64,
+        pub ifi_iqdrops: u64,
+        pub ifi_noproto: u64,
+        pub ifi_recvtiming: u32,
+        pub ifi_xmittiming: u32,
+        #[cfg(target_pointer_width = "32")]
+        pub ifi_lastchange: ::timeval,
+        #[cfg(not(target_pointer_width = "32"))]
+        pub ifi_lastchange: timeval32,
+    }
+
+    #[cfg_attr(libc_packedN, repr(packed(4)))]
+    pub struct if_msghdr2 {
+        pub ifm_msglen: ::c_ushort,
+        pub ifm_version: ::c_uchar,
+        pub ifm_type: ::c_uchar,
+        pub ifm_addrs: ::c_int,
+        pub ifm_flags: ::c_int,
+        pub ifm_index: ::c_ushort,
+        pub ifm_snd_len: ::c_int,
+        pub ifm_snd_maxlen: ::c_int,
+        pub ifm_snd_drops: ::c_int,
+        pub ifm_timer: ::c_int,
+        pub ifm_data: if_data64,
+    }
+
+    #[cfg_attr(libc_packedN, repr(packed(8)))]
+    pub struct vm_statistics64 {
+        pub free_count: natural_t,
+        pub active_count: natural_t,
+        pub inactive_count: natural_t,
+        pub wire_count: natural_t,
+        pub zero_fill_count: u64,
+        pub reactivations: u64,
+        pub pageins: u64,
+        pub pageouts: u64,
+        pub faults: u64,
+        pub cow_faults: u64,
+        pub lookups: u64,
+        pub hits: u64,
+        pub purges: u64,
+        pub purgeable_count: natural_t,
+        pub speculative_count: natural_t,
+        pub decompressions: u64,
+        pub compressions: u64,
+        pub swapins: u64,
+        pub swapouts: u64,
+        pub compressor_page_count: natural_t,
+        pub throttled_count: natural_t,
+        pub external_page_count: natural_t,
+        pub internal_page_count: natural_t,
+        pub total_uncompressed_pages_in_compressor: u64,
+    }
+
+    #[cfg_attr(libc_packedN, repr(packed(4)))]
+    pub struct mach_task_basic_info {
+        pub virtual_size: mach_vm_size_t,
+        pub resident_size: mach_vm_size_t,
+        pub resident_size_max: mach_vm_size_t,
+        pub user_time: time_value_t,
+        pub system_time: time_value_t,
+        pub policy: ::policy_t,
+        pub suspend_count: integer_t,
+    }
+
+    #[cfg_attr(libc_packedN, repr(packed(4)))]
+    pub struct log2phys {
+        pub l2p_flags: ::c_uint,
+        pub l2p_contigbytes: ::off_t,
+        pub l2p_devoffset: ::off_t,
+    }
+
+    pub struct os_unfair_lock_s {
+        _os_unfair_lock_opaque: u32,
+    }
+
+   #[cfg_attr(libc_packedN, repr(packed(1)))]
+    pub struct sockaddr_vm {
+        pub svm_len: ::c_uchar,
+        pub svm_family: ::sa_family_t,
+        pub svm_reserved1: ::c_ushort,
+        pub svm_port: ::c_uint,
+        pub svm_cid: ::c_uint,
+    }
+
+    pub struct ifdevmtu {
+        pub ifdm_current: ::c_int,
+        pub ifdm_min: ::c_int,
+        pub ifdm_max: ::c_int,
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifk_data {
+        pub ifk_ptr: *mut ::c_void,
+        pub ifk_value: ::c_int,
+    }
+
+    #[cfg_attr(libc_packedN, repr(packed(4)))]
+    pub struct ifkpi {
+        pub ifk_module_id: ::c_uint,
+        pub ifk_type: ::c_uint,
+        #[cfg(libc_union)]
+        pub ifk_data: __c_anonymous_ifk_data,
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifr_ifru {
+        pub ifru_addr: ::sockaddr,
+        pub ifru_dstaddr: ::sockaddr,
+        pub ifru_broadaddr: ::sockaddr,
+        pub ifru_flags: ::c_short,
+        pub ifru_metrics: ::c_int,
+        pub ifru_mtu: ::c_int,
+        pub ifru_phys: ::c_int,
+        pub ifru_media: ::c_int,
+        pub ifru_intval: ::c_int,
+        pub ifru_data: *mut ::c_char,
+        pub ifru_devmtu: ifdevmtu,
+        pub ifru_kpi: ifkpi,
+        pub ifru_wake_flags: u32,
+        pub ifru_route_refcnt: u32,
+        pub ifru_cap: [::c_int; 2],
+        pub ifru_functional_type: u32,
+    }
+
+    pub struct ifreq {
+        pub ifr_name: [::c_char; ::IFNAMSIZ],
+        #[cfg(libc_union)]
+        pub ifr_ifru: __c_anonymous_ifr_ifru,
+        #[cfg(not(libc_union))]
+        pub ifr_ifru: ::sockaddr,
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifc_ifcu {
+        pub ifcu_buf: *mut ::c_char,
+        pub ifcu_req: *mut ifreq,
+    }
+}
+
+impl siginfo_t {
+    pub unsafe fn si_addr(&self) -> *mut ::c_void {
+        self.si_addr
+    }
+
+    pub unsafe fn si_value(&self) -> ::sigval {
+        #[repr(C)]
+        struct siginfo_timer {
+            _si_signo: ::c_int,
+            _si_errno: ::c_int,
+            _si_code: ::c_int,
+            _si_pid: ::pid_t,
+            _si_uid: ::uid_t,
+            _si_status: ::c_int,
+            _si_addr: *mut ::c_void,
+            si_value: ::sigval,
+        }
+
+        (*(self as *const siginfo_t as *const siginfo_timer)).si_value
+    }
+
+    pub unsafe fn si_pid(&self) -> ::pid_t {
+        self.si_pid
+    }
+
+    pub unsafe fn si_uid(&self) -> ::uid_t {
+        self.si_uid
+    }
+
+    pub unsafe fn si_status(&self) -> ::c_int {
+        self.si_status
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        s_no_extra_traits! {
+            pub union semun {
+                pub val: ::c_int,
+                pub buf: *mut semid_ds,
+                pub array: *mut ::c_ushort,
+            }
+        }
+
+        cfg_if! {
+            if #[cfg(feature = "extra_traits")] {
+                impl PartialEq for semun {
+                    fn eq(&self, other: &semun) -> bool {
+                        unsafe { self.val == other.val }
+                    }
+                }
+                impl Eq for semun {}
+                impl ::fmt::Debug for semun {
+                    fn fmt(&self, f: &mut ::fmt::Formatter)
+                           -> ::fmt::Result {
+                        f.debug_struct("semun")
+                            .field("val", unsafe { &self.val })
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for semun {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        unsafe { self.val.hash(state) };
+                    }
+                }
+            }
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for kevent {
+            fn eq(&self, other: &kevent) -> bool {
+                self.ident == other.ident
+                    && self.filter == other.filter
+                    && self.flags == other.flags
+                    && self.fflags == other.fflags
+                    && self.data == other.data
+                    && self.udata == other.udata
+            }
+        }
+        impl Eq for kevent {}
+        impl ::fmt::Debug for kevent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let ident = self.ident;
+                let filter = self.filter;
+                let flags = self.flags;
+                let fflags = self.fflags;
+                let data = self.data;
+                let udata = self.udata;
+                f.debug_struct("kevent")
+                    .field("ident", &ident)
+                    .field("filter", &filter)
+                    .field("flags", &flags)
+                    .field("fflags", &fflags)
+                    .field("data", &data)
+                    .field("udata", &udata)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for kevent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let ident = self.ident;
+                let filter = self.filter;
+                let flags = self.flags;
+                let fflags = self.fflags;
+                let data = self.data;
+                let udata = self.udata;
+                ident.hash(state);
+                filter.hash(state);
+                flags.hash(state);
+                fflags.hash(state);
+                data.hash(state);
+                udata.hash(state);
+            }
+        }
+
+        impl PartialEq for semid_ds {
+            fn eq(&self, other: &semid_ds) -> bool {
+                let sem_perm = self.sem_perm;
+                let sem_pad3 = self.sem_pad3;
+                let other_sem_perm = other.sem_perm;
+                let other_sem_pad3 = other.sem_pad3;
+                sem_perm == other_sem_perm
+                    && self.sem_base == other.sem_base
+                    && self.sem_nsems == other.sem_nsems
+                    && self.sem_otime == other.sem_otime
+                    && self.sem_pad1 == other.sem_pad1
+                    && self.sem_ctime == other.sem_ctime
+                    && self.sem_pad2 == other.sem_pad2
+                    && sem_pad3 == other_sem_pad3
+            }
+        }
+        impl Eq for semid_ds {}
+        impl ::fmt::Debug for semid_ds {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let sem_perm = self.sem_perm;
+                let sem_base = self.sem_base;
+                let sem_nsems = self.sem_nsems;
+                let sem_otime = self.sem_otime;
+                let sem_pad1 = self.sem_pad1;
+                let sem_ctime = self.sem_ctime;
+                let sem_pad2 = self.sem_pad2;
+                let sem_pad3 = self.sem_pad3;
+                f.debug_struct("semid_ds")
+                    .field("sem_perm", &sem_perm)
+                    .field("sem_base", &sem_base)
+                    .field("sem_nsems", &sem_nsems)
+                    .field("sem_otime", &sem_otime)
+                    .field("sem_pad1", &sem_pad1)
+                    .field("sem_ctime", &sem_ctime)
+                    .field("sem_pad2", &sem_pad2)
+                    .field("sem_pad3", &sem_pad3)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for semid_ds {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let sem_perm = self.sem_perm;
+                let sem_base = self.sem_base;
+                let sem_nsems = self.sem_nsems;
+                let sem_otime = self.sem_otime;
+                let sem_pad1 = self.sem_pad1;
+                let sem_ctime = self.sem_ctime;
+                let sem_pad2 = self.sem_pad2;
+                let sem_pad3 = self.sem_pad3;
+                sem_perm.hash(state);
+                sem_base.hash(state);
+                sem_nsems.hash(state);
+                sem_otime.hash(state);
+                sem_pad1.hash(state);
+                sem_ctime.hash(state);
+                sem_pad2.hash(state);
+                sem_pad3.hash(state);
+            }
+        }
+
+        impl PartialEq for shmid_ds {
+            fn eq(&self, other: &shmid_ds) -> bool {
+                let shm_perm = self.shm_perm;
+                let other_shm_perm = other.shm_perm;
+                shm_perm == other_shm_perm
+                    && self.shm_segsz == other.shm_segsz
+                    && self.shm_lpid == other.shm_lpid
+                    && self.shm_cpid == other.shm_cpid
+                    && self.shm_nattch == other.shm_nattch
+                    && self.shm_atime == other.shm_atime
+                    && self.shm_dtime == other.shm_dtime
+                    && self.shm_ctime == other.shm_ctime
+                    && self.shm_internal == other.shm_internal
+            }
+        }
+        impl Eq for shmid_ds {}
+        impl ::fmt::Debug for shmid_ds {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let shm_perm = self.shm_perm;
+                let shm_segsz = self.shm_segsz;
+                let shm_lpid = self.shm_lpid;
+                let shm_cpid = self.shm_cpid;
+                let shm_nattch = self.shm_nattch;
+                let shm_atime = self.shm_atime;
+                let shm_dtime = self.shm_dtime;
+                let shm_ctime = self.shm_ctime;
+                let shm_internal = self.shm_internal;
+                f.debug_struct("shmid_ds")
+                    .field("shm_perm", &shm_perm)
+                    .field("shm_segsz", &shm_segsz)
+                    .field("shm_lpid", &shm_lpid)
+                    .field("shm_cpid", &shm_cpid)
+                    .field("shm_nattch", &shm_nattch)
+                    .field("shm_atime", &shm_atime)
+                    .field("shm_dtime", &shm_dtime)
+                    .field("shm_ctime", &shm_ctime)
+                    .field("shm_internal", &shm_internal)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for shmid_ds {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let shm_perm = self.shm_perm;
+                let shm_segsz = self.shm_segsz;
+                let shm_lpid = self.shm_lpid;
+                let shm_cpid = self.shm_cpid;
+                let shm_nattch = self.shm_nattch;
+                let shm_atime = self.shm_atime;
+                let shm_dtime = self.shm_dtime;
+                let shm_ctime = self.shm_ctime;
+                let shm_internal = self.shm_internal;
+                shm_perm.hash(state);
+                shm_segsz.hash(state);
+                shm_lpid.hash(state);
+                shm_cpid.hash(state);
+                shm_nattch.hash(state);
+                shm_atime.hash(state);
+                shm_dtime.hash(state);
+                shm_ctime.hash(state);
+                shm_internal.hash(state);
+            }
+        }
+
+        impl PartialEq for proc_threadinfo {
+            fn eq(&self, other: &proc_threadinfo) -> bool {
+                self.pth_user_time == other.pth_user_time
+                    && self.pth_system_time == other.pth_system_time
+                    && self.pth_cpu_usage == other.pth_cpu_usage
+                    && self.pth_policy == other.pth_policy
+                    && self.pth_run_state == other.pth_run_state
+                    && self.pth_flags == other.pth_flags
+                    && self.pth_sleep_time == other.pth_sleep_time
+                    && self.pth_curpri == other.pth_curpri
+                    && self.pth_priority == other.pth_priority
+                    && self.pth_maxpriority == other.pth_maxpriority
+                    && self.pth_name
+                           .iter()
+                           .zip(other.pth_name.iter())
+                           .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for proc_threadinfo {}
+        impl ::fmt::Debug for proc_threadinfo {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("proc_threadinfo")
+                    .field("pth_user_time", &self.pth_user_time)
+                    .field("pth_system_time", &self.pth_system_time)
+                    .field("pth_cpu_usage", &self.pth_cpu_usage)
+                    .field("pth_policy", &self.pth_policy)
+                    .field("pth_run_state", &self.pth_run_state)
+                    .field("pth_flags", &self.pth_flags)
+                    .field("pth_sleep_time", &self.pth_sleep_time)
+                    .field("pth_curpri", &self.pth_curpri)
+                    .field("pth_priority", &self.pth_priority)
+                    .field("pth_maxpriority", &self.pth_maxpriority)
+                      // FIXME: .field("pth_name", &self.pth_name)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for proc_threadinfo {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.pth_user_time.hash(state);
+                self.pth_system_time.hash(state);
+                self.pth_cpu_usage.hash(state);
+                self.pth_policy.hash(state);
+                self.pth_run_state.hash(state);
+                self.pth_flags.hash(state);
+                self.pth_sleep_time.hash(state);
+                self.pth_curpri.hash(state);
+                self.pth_priority.hash(state);
+                self.pth_maxpriority.hash(state);
+                self.pth_name.hash(state);
+            }
+        }
+
+        impl PartialEq for statfs {
+            fn eq(&self, other: &statfs) -> bool {
+                self.f_bsize == other.f_bsize
+                    && self.f_iosize == other.f_iosize
+                    && self.f_blocks == other.f_blocks
+                    && self.f_bfree == other.f_bfree
+                    && self.f_bavail == other.f_bavail
+                    && self.f_files == other.f_files
+                    && self.f_ffree == other.f_ffree
+                    && self.f_fsid == other.f_fsid
+                    && self.f_owner == other.f_owner
+                    && self.f_flags == other.f_flags
+                    && self.f_fssubtype == other.f_fssubtype
+                    && self.f_fstypename == other.f_fstypename
+                    && self.f_type == other.f_type
+                    && self
+                    .f_mntonname
+                    .iter()
+                    .zip(other.f_mntonname.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .f_mntfromname
+                    .iter()
+                    .zip(other.f_mntfromname.iter())
+                    .all(|(a,b)| a == b)
+                    && self.f_reserved == other.f_reserved
+            }
+        }
+
+        impl Eq for statfs {}
+        impl ::fmt::Debug for statfs {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("statfs")
+                    .field("f_bsize", &self.f_bsize)
+                    .field("f_iosize", &self.f_iosize)
+                    .field("f_blocks", &self.f_blocks)
+                    .field("f_bfree", &self.f_bfree)
+                    .field("f_bavail", &self.f_bavail)
+                    .field("f_files", &self.f_files)
+                    .field("f_ffree", &self.f_ffree)
+                    .field("f_fsid", &self.f_fsid)
+                    .field("f_owner", &self.f_owner)
+                    .field("f_flags", &self.f_flags)
+                    .field("f_fssubtype", &self.f_fssubtype)
+                    .field("f_fstypename", &self.f_fstypename)
+                    .field("f_type", &self.f_type)
+                // FIXME: .field("f_mntonname", &self.f_mntonname)
+                // FIXME: .field("f_mntfromname", &self.f_mntfromname)
+                    .field("f_reserved", &self.f_reserved)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for statfs {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.f_bsize.hash(state);
+                self.f_iosize.hash(state);
+                self.f_blocks.hash(state);
+                self.f_bfree.hash(state);
+                self.f_bavail.hash(state);
+                self.f_files.hash(state);
+                self.f_ffree.hash(state);
+                self.f_fsid.hash(state);
+                self.f_owner.hash(state);
+                self.f_flags.hash(state);
+                self.f_fssubtype.hash(state);
+                self.f_fstypename.hash(state);
+                self.f_type.hash(state);
+                self.f_mntonname.hash(state);
+                self.f_mntfromname.hash(state);
+                self.f_reserved.hash(state);
+            }
+        }
+
+        impl PartialEq for dirent {
+            fn eq(&self, other: &dirent) -> bool {
+                self.d_ino == other.d_ino
+                    && self.d_seekoff == other.d_seekoff
+                    && self.d_reclen == other.d_reclen
+                    && self.d_namlen == other.d_namlen
+                    && self.d_type == other.d_type
+                    && self
+                    .d_name
+                    .iter()
+                    .zip(other.d_name.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for dirent {}
+        impl ::fmt::Debug for dirent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("dirent")
+                    .field("d_ino", &self.d_ino)
+                    .field("d_seekoff", &self.d_seekoff)
+                    .field("d_reclen", &self.d_reclen)
+                    .field("d_namlen", &self.d_namlen)
+                    .field("d_type", &self.d_type)
+                    // FIXME: .field("d_name", &self.d_name)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for dirent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.d_ino.hash(state);
+                self.d_seekoff.hash(state);
+                self.d_reclen.hash(state);
+                self.d_namlen.hash(state);
+                self.d_type.hash(state);
+                self.d_name.hash(state);
+            }
+        }
+        impl PartialEq for pthread_rwlock_t {
+            fn eq(&self, other: &pthread_rwlock_t) -> bool {
+                self.__sig == other.__sig
+                    && self.
+                    __opaque
+                    .iter()
+                    .zip(other.__opaque.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for pthread_rwlock_t {}
+        impl ::fmt::Debug for pthread_rwlock_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("pthread_rwlock_t")
+                    .field("__sig", &self.__sig)
+                    // FIXME: .field("__opaque", &self.__opaque)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for pthread_rwlock_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.__sig.hash(state);
+                self.__opaque.hash(state);
+            }
+        }
+
+        impl PartialEq for pthread_mutex_t {
+            fn eq(&self, other: &pthread_mutex_t) -> bool {
+                self.__sig == other.__sig
+                    && self.
+                    __opaque
+                    .iter()
+                    .zip(other.__opaque.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for pthread_mutex_t {}
+
+        impl ::fmt::Debug for pthread_mutex_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("pthread_mutex_t")
+                    .field("__sig", &self.__sig)
+                    // FIXME: .field("__opaque", &self.__opaque)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for pthread_mutex_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.__sig.hash(state);
+                self.__opaque.hash(state);
+            }
+        }
+
+        impl PartialEq for pthread_cond_t {
+            fn eq(&self, other: &pthread_cond_t) -> bool {
+                self.__sig == other.__sig
+                    && self.
+                    __opaque
+                    .iter()
+                    .zip(other.__opaque.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for pthread_cond_t {}
+
+        impl ::fmt::Debug for pthread_cond_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("pthread_cond_t")
+                    .field("__sig", &self.__sig)
+                    // FIXME: .field("__opaque", &self.__opaque)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for pthread_cond_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.__sig.hash(state);
+                self.__opaque.hash(state);
+            }
+        }
+
+        impl PartialEq for sockaddr_storage {
+            fn eq(&self, other: &sockaddr_storage) -> bool {
+                self.ss_len == other.ss_len
+                    && self.ss_family == other.ss_family
+                    && self
+                    .__ss_pad1
+                    .iter()
+                    .zip(other.__ss_pad1.iter())
+                    .all(|(a, b)| a == b)
+                    && self.__ss_align == other.__ss_align
+                    && self
+                    .__ss_pad2
+                    .iter()
+                    .zip(other.__ss_pad2.iter())
+                    .all(|(a, b)| a == b)
+            }
+        }
+
+        impl Eq for sockaddr_storage {}
+
+        impl ::fmt::Debug for sockaddr_storage {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_storage")
+                    .field("ss_len", &self.ss_len)
+                    .field("ss_family", &self.ss_family)
+                    .field("__ss_pad1", &self.__ss_pad1)
+                    .field("__ss_align", &self.__ss_align)
+                    // FIXME: .field("__ss_pad2", &self.__ss_pad2)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for sockaddr_storage {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ss_len.hash(state);
+                self.ss_family.hash(state);
+                self.__ss_pad1.hash(state);
+                self.__ss_align.hash(state);
+                self.__ss_pad2.hash(state);
+            }
+        }
+
+        impl PartialEq for utmpx {
+            fn eq(&self, other: &utmpx) -> bool {
+                self.ut_user
+                    .iter()
+                    .zip(other.ut_user.iter())
+                    .all(|(a,b)| a == b)
+                    && self.ut_id == other.ut_id
+                    && self.ut_line == other.ut_line
+                    && self.ut_pid == other.ut_pid
+                    && self.ut_type == other.ut_type
+                    && self.ut_tv == other.ut_tv
+                    && self
+                    .ut_host
+                    .iter()
+                    .zip(other.ut_host.iter())
+                    .all(|(a,b)| a == b)
+                    && self.ut_pad == other.ut_pad
+            }
+        }
+
+        impl Eq for utmpx {}
+
+        impl ::fmt::Debug for utmpx {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("utmpx")
+                    // FIXME: .field("ut_user", &self.ut_user)
+                    .field("ut_id", &self.ut_id)
+                    .field("ut_line", &self.ut_line)
+                    .field("ut_pid", &self.ut_pid)
+                    .field("ut_type", &self.ut_type)
+                    .field("ut_tv", &self.ut_tv)
+                    // FIXME: .field("ut_host", &self.ut_host)
+                    .field("ut_pad", &self.ut_pad)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for utmpx {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ut_user.hash(state);
+                self.ut_id.hash(state);
+                self.ut_line.hash(state);
+                self.ut_pid.hash(state);
+                self.ut_type.hash(state);
+                self.ut_tv.hash(state);
+                self.ut_host.hash(state);
+                self.ut_pad.hash(state);
+            }
+        }
+
+        impl PartialEq for sigevent {
+            fn eq(&self, other: &sigevent) -> bool {
+                self.sigev_notify == other.sigev_notify
+                    && self.sigev_signo == other.sigev_signo
+                    && self.sigev_value == other.sigev_value
+                    && self.sigev_notify_attributes
+                        == other.sigev_notify_attributes
+            }
+        }
+
+        impl Eq for sigevent {}
+
+        impl ::fmt::Debug for sigevent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sigevent")
+                    .field("sigev_notify", &self.sigev_notify)
+                    .field("sigev_signo", &self.sigev_signo)
+                    .field("sigev_value", &self.sigev_value)
+                    .field("sigev_notify_attributes",
+                           &self.sigev_notify_attributes)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for sigevent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sigev_notify.hash(state);
+                self.sigev_signo.hash(state);
+                self.sigev_value.hash(state);
+                self.sigev_notify_attributes.hash(state);
+            }
+        }
+
+        impl PartialEq for processor_cpu_load_info {
+            fn eq(&self, other: &processor_cpu_load_info) -> bool {
+                self.cpu_ticks == other.cpu_ticks
+            }
+        }
+        impl Eq for processor_cpu_load_info {}
+        impl ::fmt::Debug for processor_cpu_load_info {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("processor_cpu_load_info")
+                    .field("cpu_ticks", &self.cpu_ticks)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for processor_cpu_load_info {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.cpu_ticks.hash(state);
+            }
+        }
+
+        impl PartialEq for processor_basic_info {
+            fn eq(&self, other: &processor_basic_info) -> bool {
+                self.cpu_type == other.cpu_type
+                    && self.cpu_subtype == other.cpu_subtype
+                    && self.running == other.running
+                    && self.slot_num == other.slot_num
+                    && self.is_master == other.is_master
+            }
+        }
+        impl Eq for processor_basic_info {}
+        impl ::fmt::Debug for processor_basic_info {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("processor_basic_info")
+                    .field("cpu_type", &self.cpu_type)
+                    .field("cpu_subtype", &self.cpu_subtype)
+                    .field("running", &self.running)
+                    .field("slot_num", &self.slot_num)
+                    .field("is_master", &self.is_master)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for processor_basic_info {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.cpu_type.hash(state);
+                self.cpu_subtype.hash(state);
+                self.running.hash(state);
+                self.slot_num.hash(state);
+                self.is_master.hash(state);
+            }
+        }
+
+        impl PartialEq for processor_set_basic_info {
+            fn eq(&self, other: &processor_set_basic_info) -> bool {
+                self.processor_count == other.processor_count
+                    && self.default_policy == other.default_policy
+            }
+        }
+        impl Eq for processor_set_basic_info {}
+        impl ::fmt::Debug for processor_set_basic_info {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("processor_set_basic_info")
+                    .field("processor_count", &self.processor_count)
+                    .field("default_policy", &self.default_policy)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for processor_set_basic_info {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.processor_count.hash(state);
+                self.default_policy.hash(state);
+            }
+        }
+
+        impl PartialEq for processor_set_load_info {
+            fn eq(&self, other: &processor_set_load_info) -> bool {
+                self.task_count == other.task_count
+                    && self.thread_count == other.thread_count
+                    && self.load_average == other.load_average
+                    && self.mach_factor == other.mach_factor
+            }
+        }
+        impl Eq for processor_set_load_info {}
+        impl ::fmt::Debug for processor_set_load_info {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("processor_set_load_info")
+                    .field("task_count", &self.task_count)
+                    .field("thread_count", &self.thread_count)
+                    .field("load_average", &self.load_average)
+                    .field("mach_factor", &self.mach_factor)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for processor_set_load_info {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.task_count.hash(state);
+                self.thread_count.hash(state);
+                self.load_average.hash(state);
+                self.mach_factor.hash(state);
+            }
+        }
+
+        impl PartialEq for time_value_t {
+            fn eq(&self, other: &time_value_t) -> bool {
+                self.seconds == other.seconds
+                    && self.microseconds == other.microseconds
+            }
+        }
+        impl Eq for time_value_t {}
+        impl ::fmt::Debug for time_value_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("time_value_t")
+                    .field("seconds", &self.seconds)
+                    .field("microseconds", &self.microseconds)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for time_value_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.seconds.hash(state);
+                self.microseconds.hash(state);
+            }
+        }
+        impl PartialEq for thread_basic_info {
+            fn eq(&self, other: &thread_basic_info) -> bool {
+                self.user_time == other.user_time
+                    && self.system_time == other.system_time
+                    && self.cpu_usage == other.cpu_usage
+                    && self.policy == other.policy
+                    && self.run_state == other.run_state
+                    && self.flags == other.flags
+                    && self.suspend_count == other.suspend_count
+                    && self.sleep_time == other.sleep_time
+            }
+        }
+        impl Eq for thread_basic_info {}
+        impl ::fmt::Debug for thread_basic_info {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("thread_basic_info")
+                    .field("user_time", &self.user_time)
+                    .field("system_time", &self.system_time)
+                    .field("cpu_usage", &self.cpu_usage)
+                    .field("policy", &self.policy)
+                    .field("run_state", &self.run_state)
+                    .field("flags", &self.flags)
+                    .field("suspend_count", &self.suspend_count)
+                    .field("sleep_time", &self.sleep_time)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for thread_basic_info {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.user_time.hash(state);
+                self.system_time.hash(state);
+                self.cpu_usage.hash(state);
+                self.policy.hash(state);
+                self.run_state.hash(state);
+                self.flags.hash(state);
+                self.suspend_count.hash(state);
+                self.sleep_time.hash(state);
+            }
+        }
+        impl PartialEq for thread_extended_info {
+            fn eq(&self, other: &thread_extended_info) -> bool {
+                self.pth_user_time == other.pth_user_time
+                    && self.pth_system_time == other.pth_system_time
+                    && self.pth_cpu_usage == other.pth_cpu_usage
+                    && self.pth_policy == other.pth_policy
+                    && self.pth_run_state == other.pth_run_state
+                    && self.pth_flags == other.pth_flags
+                    && self.pth_sleep_time == other.pth_sleep_time
+                    && self.pth_curpri == other.pth_curpri
+                    && self.pth_priority == other.pth_priority
+                    && self.pth_maxpriority == other.pth_maxpriority
+                    && self.pth_name
+                           .iter()
+                           .zip(other.pth_name.iter())
+                           .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for thread_extended_info {}
+        impl ::fmt::Debug for thread_extended_info {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("proc_threadinfo")
+                    .field("pth_user_time", &self.pth_user_time)
+                    .field("pth_system_time", &self.pth_system_time)
+                    .field("pth_cpu_usage", &self.pth_cpu_usage)
+                    .field("pth_policy", &self.pth_policy)
+                    .field("pth_run_state", &self.pth_run_state)
+                    .field("pth_flags", &self.pth_flags)
+                    .field("pth_sleep_time", &self.pth_sleep_time)
+                    .field("pth_curpri", &self.pth_curpri)
+                    .field("pth_priority", &self.pth_priority)
+                    .field("pth_maxpriority", &self.pth_maxpriority)
+                      // FIXME: .field("pth_name", &self.pth_name)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for thread_extended_info {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.pth_user_time.hash(state);
+                self.pth_system_time.hash(state);
+                self.pth_cpu_usage.hash(state);
+                self.pth_policy.hash(state);
+                self.pth_run_state.hash(state);
+                self.pth_flags.hash(state);
+                self.pth_sleep_time.hash(state);
+                self.pth_curpri.hash(state);
+                self.pth_priority.hash(state);
+                self.pth_maxpriority.hash(state);
+                self.pth_name.hash(state);
+            }
+        }
+        impl PartialEq for thread_identifier_info {
+            fn eq(&self, other: &thread_identifier_info) -> bool {
+                self.thread_id == other.thread_id
+                    && self.thread_handle == other.thread_handle
+                    && self.dispatch_qaddr == other.dispatch_qaddr
+            }
+        }
+        impl Eq for thread_identifier_info {}
+        impl ::fmt::Debug for thread_identifier_info {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("thread_identifier_info")
+                    .field("thread_id", &self.thread_id)
+                    .field("thread_handle", &self.thread_handle)
+                    .field("dispatch_qaddr", &self.dispatch_qaddr)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for thread_identifier_info {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.thread_id.hash(state);
+                self.thread_handle.hash(state);
+                self.dispatch_qaddr.hash(state);
+            }
+        }
+        impl PartialEq for if_data64 {
+            fn eq(&self, other: &if_data64) -> bool {
+                self.ifi_type == other.ifi_type &&
+                self.ifi_typelen == other.ifi_typelen &&
+                self.ifi_physical == other.ifi_physical &&
+                self.ifi_addrlen == other.ifi_addrlen &&
+                self.ifi_hdrlen == other.ifi_hdrlen &&
+                self.ifi_recvquota == other.ifi_recvquota &&
+                self.ifi_xmitquota == other.ifi_xmitquota &&
+                self.ifi_unused1 == other.ifi_unused1 &&
+                self.ifi_mtu == other.ifi_mtu &&
+                self.ifi_metric == other.ifi_metric &&
+                self.ifi_baudrate == other.ifi_baudrate &&
+                self.ifi_ipackets == other.ifi_ipackets &&
+                self.ifi_ierrors == other.ifi_ierrors &&
+                self.ifi_opackets == other.ifi_opackets &&
+                self.ifi_oerrors == other.ifi_oerrors &&
+                self.ifi_collisions == other.ifi_collisions &&
+                self.ifi_ibytes == other.ifi_ibytes &&
+                self.ifi_obytes == other.ifi_obytes &&
+                self.ifi_imcasts == other.ifi_imcasts &&
+                self.ifi_omcasts == other.ifi_omcasts &&
+                self.ifi_iqdrops == other.ifi_iqdrops &&
+                self.ifi_noproto == other.ifi_noproto &&
+                self.ifi_recvtiming == other.ifi_recvtiming &&
+                self.ifi_xmittiming == other.ifi_xmittiming &&
+                self.ifi_lastchange == other.ifi_lastchange
+            }
+        }
+        impl Eq for if_data64 {}
+        impl ::fmt::Debug for if_data64 {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let ifi_type = self.ifi_type;
+                let ifi_typelen = self.ifi_typelen;
+                let ifi_physical = self.ifi_physical;
+                let ifi_addrlen = self.ifi_addrlen;
+                let ifi_hdrlen = self.ifi_hdrlen;
+                let ifi_recvquota = self.ifi_recvquota;
+                let ifi_xmitquota = self.ifi_xmitquota;
+                let ifi_unused1 = self.ifi_unused1;
+                let ifi_mtu = self.ifi_mtu;
+                let ifi_metric = self.ifi_metric;
+                let ifi_baudrate = self.ifi_baudrate;
+                let ifi_ipackets = self.ifi_ipackets;
+                let ifi_ierrors = self.ifi_ierrors;
+                let ifi_opackets = self.ifi_opackets;
+                let ifi_oerrors = self.ifi_oerrors;
+                let ifi_collisions = self.ifi_collisions;
+                let ifi_ibytes = self.ifi_ibytes;
+                let ifi_obytes = self.ifi_obytes;
+                let ifi_imcasts = self.ifi_imcasts;
+                let ifi_omcasts = self.ifi_omcasts;
+                let ifi_iqdrops = self.ifi_iqdrops;
+                let ifi_noproto = self.ifi_noproto;
+                let ifi_recvtiming = self.ifi_recvtiming;
+                let ifi_xmittiming = self.ifi_xmittiming;
+                let ifi_lastchange = self.ifi_lastchange;
+                f.debug_struct("if_data64")
+                    .field("ifi_type", &ifi_type)
+                    .field("ifi_typelen", &ifi_typelen)
+                    .field("ifi_physical", &ifi_physical)
+                    .field("ifi_addrlen", &ifi_addrlen)
+                    .field("ifi_hdrlen", &ifi_hdrlen)
+                    .field("ifi_recvquota", &ifi_recvquota)
+                    .field("ifi_xmitquota", &ifi_xmitquota)
+                    .field("ifi_unused1", &ifi_unused1)
+                    .field("ifi_mtu", &ifi_mtu)
+                    .field("ifi_metric", &ifi_metric)
+                    .field("ifi_baudrate", &ifi_baudrate)
+                    .field("ifi_ipackets", &ifi_ipackets)
+                    .field("ifi_ierrors", &ifi_ierrors)
+                    .field("ifi_opackets", &ifi_opackets)
+                    .field("ifi_oerrors", &ifi_oerrors)
+                    .field("ifi_collisions", &ifi_collisions)
+                    .field("ifi_ibytes", &ifi_ibytes)
+                    .field("ifi_obytes", &ifi_obytes)
+                    .field("ifi_imcasts", &ifi_imcasts)
+                    .field("ifi_omcasts", &ifi_omcasts)
+                    .field("ifi_iqdrops", &ifi_iqdrops)
+                    .field("ifi_noproto", &ifi_noproto)
+                    .field("ifi_recvtiming", &ifi_recvtiming)
+                    .field("ifi_xmittiming", &ifi_xmittiming)
+                    .field("ifi_lastchange", &ifi_lastchange)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for if_data64 {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let ifi_type = self.ifi_type;
+                let ifi_typelen = self.ifi_typelen;
+                let ifi_physical = self.ifi_physical;
+                let ifi_addrlen = self.ifi_addrlen;
+                let ifi_hdrlen = self.ifi_hdrlen;
+                let ifi_recvquota = self.ifi_recvquota;
+                let ifi_xmitquota = self.ifi_xmitquota;
+                let ifi_unused1 = self.ifi_unused1;
+                let ifi_mtu = self.ifi_mtu;
+                let ifi_metric = self.ifi_metric;
+                let ifi_baudrate = self.ifi_baudrate;
+                let ifi_ipackets = self.ifi_ipackets;
+                let ifi_ierrors = self.ifi_ierrors;
+                let ifi_opackets = self.ifi_opackets;
+                let ifi_oerrors = self.ifi_oerrors;
+                let ifi_collisions = self.ifi_collisions;
+                let ifi_ibytes = self.ifi_ibytes;
+                let ifi_obytes = self.ifi_obytes;
+                let ifi_imcasts = self.ifi_imcasts;
+                let ifi_omcasts = self.ifi_omcasts;
+                let ifi_iqdrops = self.ifi_iqdrops;
+                let ifi_noproto = self.ifi_noproto;
+                let ifi_recvtiming = self.ifi_recvtiming;
+                let ifi_xmittiming = self.ifi_xmittiming;
+                let ifi_lastchange = self.ifi_lastchange;
+                ifi_type.hash(state);
+                ifi_typelen.hash(state);
+                ifi_physical.hash(state);
+                ifi_addrlen.hash(state);
+                ifi_hdrlen.hash(state);
+                ifi_recvquota.hash(state);
+                ifi_xmitquota.hash(state);
+                ifi_unused1.hash(state);
+                ifi_mtu.hash(state);
+                ifi_metric.hash(state);
+                ifi_baudrate.hash(state);
+                ifi_ipackets.hash(state);
+                ifi_ierrors.hash(state);
+                ifi_opackets.hash(state);
+                ifi_oerrors.hash(state);
+                ifi_collisions.hash(state);
+                ifi_ibytes.hash(state);
+                ifi_obytes.hash(state);
+                ifi_imcasts.hash(state);
+                ifi_omcasts.hash(state);
+                ifi_iqdrops.hash(state);
+                ifi_noproto.hash(state);
+                ifi_recvtiming.hash(state);
+                ifi_xmittiming.hash(state);
+                ifi_lastchange.hash(state);
+            }
+        }
+        impl PartialEq for if_msghdr2 {
+            fn eq(&self, other: &if_msghdr2) -> bool {
+                self.ifm_msglen == other.ifm_msglen &&
+                self.ifm_version == other.ifm_version &&
+                self.ifm_type == other.ifm_type &&
+                self.ifm_addrs == other.ifm_addrs &&
+                self.ifm_flags == other.ifm_flags &&
+                self.ifm_index == other.ifm_index &&
+                self.ifm_snd_len == other.ifm_snd_len &&
+                self.ifm_snd_maxlen == other.ifm_snd_maxlen &&
+                self.ifm_snd_drops == other.ifm_snd_drops &&
+                self.ifm_timer == other.ifm_timer &&
+                self.ifm_data == other.ifm_data
+            }
+        }
+        impl Eq for if_msghdr2 {}
+        impl ::fmt::Debug for if_msghdr2 {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let ifm_msglen = self.ifm_msglen;
+                let ifm_version = self.ifm_version;
+                let ifm_type = self.ifm_type;
+                let ifm_addrs = self.ifm_addrs;
+                let ifm_flags = self.ifm_flags;
+                let ifm_index = self.ifm_index;
+                let ifm_snd_len = self.ifm_snd_len;
+                let ifm_snd_maxlen = self.ifm_snd_maxlen;
+                let ifm_snd_drops = self.ifm_snd_drops;
+                let ifm_timer = self.ifm_timer;
+                let ifm_data = self.ifm_data;
+                f.debug_struct("if_msghdr2")
+                    .field("ifm_msglen", &ifm_msglen)
+                    .field("ifm_version", &ifm_version)
+                    .field("ifm_type", &ifm_type)
+                    .field("ifm_addrs", &ifm_addrs)
+                    .field("ifm_flags", &ifm_flags)
+                    .field("ifm_index", &ifm_index)
+                    .field("ifm_snd_len", &ifm_snd_len)
+                    .field("ifm_snd_maxlen", &ifm_snd_maxlen)
+                    .field("ifm_snd_drops", &ifm_snd_drops)
+                    .field("ifm_timer", &ifm_timer)
+                    .field("ifm_data", &ifm_data)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for if_msghdr2 {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let ifm_msglen = self.ifm_msglen;
+                let ifm_version = self.ifm_version;
+                let ifm_type = self.ifm_type;
+                let ifm_addrs = self.ifm_addrs;
+                let ifm_flags = self.ifm_flags;
+                let ifm_index = self.ifm_index;
+                let ifm_snd_len = self.ifm_snd_len;
+                let ifm_snd_maxlen = self.ifm_snd_maxlen;
+                let ifm_snd_drops = self.ifm_snd_drops;
+                let ifm_timer = self.ifm_timer;
+                let ifm_data = self.ifm_data;
+                ifm_msglen.hash(state);
+                ifm_version.hash(state);
+                ifm_type.hash(state);
+                ifm_addrs.hash(state);
+                ifm_flags.hash(state);
+                ifm_index.hash(state);
+                ifm_snd_len.hash(state);
+                ifm_snd_maxlen.hash(state);
+                ifm_snd_drops.hash(state);
+                ifm_timer.hash(state);
+                ifm_data.hash(state);
+            }
+        }
+        impl PartialEq for vm_statistics64 {
+            fn eq(&self, other: &vm_statistics64) -> bool {
+                // Otherwise rustfmt crashes...
+                let total_uncompressed = self.total_uncompressed_pages_in_compressor;
+                self.free_count == other.free_count &&
+                self.active_count == other.active_count &&
+                self.inactive_count == other.inactive_count &&
+                self.wire_count == other.wire_count &&
+                self.zero_fill_count == other.zero_fill_count &&
+                self.reactivations == other.reactivations &&
+                self.pageins == other.pageins &&
+                self.pageouts == other.pageouts &&
+                self.faults == other.faults &&
+                self.cow_faults == other.cow_faults &&
+                self.lookups == other.lookups &&
+                self.hits == other.hits &&
+                self.purges == other.purges &&
+                self.purgeable_count == other.purgeable_count &&
+                self.speculative_count == other.speculative_count &&
+                self.decompressions == other.decompressions &&
+                self.compressions == other.compressions &&
+                self.swapins == other.swapins &&
+                self.swapouts == other.swapouts &&
+                self.compressor_page_count == other.compressor_page_count &&
+                self.throttled_count == other.throttled_count &&
+                self.external_page_count == other.external_page_count &&
+                self.internal_page_count == other.internal_page_count &&
+                total_uncompressed == other.total_uncompressed_pages_in_compressor
+            }
+        }
+        impl Eq for vm_statistics64 {}
+        impl ::fmt::Debug for vm_statistics64 {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let free_count = self.free_count;
+                let active_count = self.active_count;
+                let inactive_count = self.inactive_count;
+                let wire_count = self.wire_count;
+                let zero_fill_count = self.zero_fill_count;
+                let reactivations = self.reactivations;
+                let pageins = self.pageins;
+                let pageouts = self.pageouts;
+                let faults = self.faults;
+                let cow_faults = self.cow_faults;
+                let lookups = self.lookups;
+                let hits = self.hits;
+                let purges = self.purges;
+                let purgeable_count = self.purgeable_count;
+                let speculative_count = self.speculative_count;
+                let decompressions = self.decompressions;
+                let compressions = self.compressions;
+                let swapins = self.swapins;
+                let swapouts = self.swapouts;
+                let compressor_page_count = self.compressor_page_count;
+                let throttled_count = self.throttled_count;
+                let external_page_count = self.external_page_count;
+                let internal_page_count = self.internal_page_count;
+                // Otherwise rustfmt crashes...
+                let total_uncompressed = self.total_uncompressed_pages_in_compressor;
+                f.debug_struct("vm_statistics64")
+                    .field("free_count", &free_count)
+                    .field("active_count", &active_count)
+                    .field("inactive_count", &inactive_count)
+                    .field("wire_count", &wire_count)
+                    .field("zero_fill_count", &zero_fill_count)
+                    .field("reactivations", &reactivations)
+                    .field("pageins", &pageins)
+                    .field("pageouts", &pageouts)
+                    .field("faults", &faults)
+                    .field("cow_faults", &cow_faults)
+                    .field("lookups", &lookups)
+                    .field("hits", &hits)
+                    .field("purges", &purges)
+                    .field("purgeable_count", &purgeable_count)
+                    .field("speculative_count", &speculative_count)
+                    .field("decompressions", &decompressions)
+                    .field("compressions", &compressions)
+                    .field("swapins", &swapins)
+                    .field("swapouts", &swapouts)
+                    .field("compressor_page_count", &compressor_page_count)
+                    .field("throttled_count", &throttled_count)
+                    .field("external_page_count", &external_page_count)
+                    .field("internal_page_count", &internal_page_count)
+                    .field("total_uncompressed_pages_in_compressor", &total_uncompressed)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for vm_statistics64 {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let free_count = self.free_count;
+                let active_count = self.active_count;
+                let inactive_count = self.inactive_count;
+                let wire_count = self.wire_count;
+                let zero_fill_count = self.zero_fill_count;
+                let reactivations = self.reactivations;
+                let pageins = self.pageins;
+                let pageouts = self.pageouts;
+                let faults = self.faults;
+                let cow_faults = self.cow_faults;
+                let lookups = self.lookups;
+                let hits = self.hits;
+                let purges = self.purges;
+                let purgeable_count = self.purgeable_count;
+                let speculative_count = self.speculative_count;
+                let decompressions = self.decompressions;
+                let compressions = self.compressions;
+                let swapins = self.swapins;
+                let swapouts = self.swapouts;
+                let compressor_page_count = self.compressor_page_count;
+                let throttled_count = self.throttled_count;
+                let external_page_count = self.external_page_count;
+                let internal_page_count = self.internal_page_count;
+                // Otherwise rustfmt crashes...
+                let total_uncompressed = self.total_uncompressed_pages_in_compressor;
+                free_count.hash(state);
+                active_count.hash(state);
+                inactive_count.hash(state);
+                wire_count.hash(state);
+                zero_fill_count.hash(state);
+                reactivations.hash(state);
+                pageins.hash(state);
+                pageouts.hash(state);
+                faults.hash(state);
+                cow_faults.hash(state);
+                lookups.hash(state);
+                hits.hash(state);
+                purges.hash(state);
+                purgeable_count.hash(state);
+                speculative_count.hash(state);
+                decompressions.hash(state);
+                compressions.hash(state);
+                swapins.hash(state);
+                swapouts.hash(state);
+                compressor_page_count.hash(state);
+                throttled_count.hash(state);
+                external_page_count.hash(state);
+                internal_page_count.hash(state);
+                total_uncompressed.hash(state);
+            }
+        }
+
+        impl PartialEq for mach_task_basic_info {
+            fn eq(&self, other: &mach_task_basic_info) -> bool {
+                self.virtual_size == other.virtual_size
+                    && self.resident_size == other.resident_size
+                    && self.resident_size_max == other.resident_size_max
+                    && self.user_time == other.user_time
+                    && self.system_time == other.system_time
+                    && self.policy == other.policy
+                    && self.suspend_count == other.suspend_count
+            }
+        }
+        impl Eq for mach_task_basic_info {}
+        impl ::fmt::Debug for mach_task_basic_info {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let virtual_size = self.virtual_size;
+                let resident_size = self.resident_size;
+                let resident_size_max = self.resident_size_max;
+                let user_time = self.user_time;
+                let system_time = self.system_time;
+                let policy = self.policy;
+                let suspend_count = self.suspend_count;
+                f.debug_struct("mach_task_basic_info")
+                    .field("virtual_size", &virtual_size)
+                    .field("resident_size", &resident_size)
+                    .field("resident_size_max", &resident_size_max)
+                    .field("user_time", &user_time)
+                    .field("system_time", &system_time)
+                    .field("policy", &policy)
+                    .field("suspend_count", &suspend_count)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for mach_task_basic_info {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let virtual_size = self.virtual_size;
+                let resident_size = self.resident_size;
+                let resident_size_max = self.resident_size_max;
+                let user_time = self.user_time;
+                let system_time = self.system_time;
+                let policy = self.policy;
+                let suspend_count = self.suspend_count;
+                virtual_size.hash(state);
+                resident_size.hash(state);
+                resident_size_max.hash(state);
+                user_time.hash(state);
+                system_time.hash(state);
+                policy.hash(state);
+                suspend_count.hash(state);
+            }
+        }
+
+        impl PartialEq for log2phys {
+            fn eq(&self, other: &log2phys) -> bool {
+                self.l2p_flags == other.l2p_flags
+                    && self.l2p_contigbytes == other.l2p_contigbytes
+                    && self.l2p_devoffset == other.l2p_devoffset
+            }
+        }
+        impl Eq for log2phys {}
+        impl ::fmt::Debug for log2phys {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let l2p_flags = self.l2p_flags;
+                let l2p_contigbytes = self.l2p_contigbytes;
+                let l2p_devoffset = self.l2p_devoffset;
+                f.debug_struct("log2phys")
+                    .field("l2p_flags", &l2p_flags)
+                    .field("l2p_contigbytes", &l2p_contigbytes)
+                    .field("l2p_devoffset", &l2p_devoffset)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for log2phys {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let l2p_flags = self.l2p_flags;
+                let l2p_contigbytes = self.l2p_contigbytes;
+                let l2p_devoffset = self.l2p_devoffset;
+                l2p_flags.hash(state);
+                l2p_contigbytes.hash(state);
+                l2p_devoffset.hash(state);
+            }
+        }
+        impl PartialEq for os_unfair_lock {
+            fn eq(&self, other: &os_unfair_lock) -> bool {
+                self._os_unfair_lock_opaque == other._os_unfair_lock_opaque
+            }
+        }
+
+        impl Eq for os_unfair_lock {}
+
+        impl ::fmt::Debug for os_unfair_lock {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("os_unfair_lock")
+                    .field("_os_unfair_lock_opaque", &self._os_unfair_lock_opaque)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for os_unfair_lock {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self._os_unfair_lock_opaque.hash(state);
+            }
+        }
+
+        impl PartialEq for sockaddr_vm {
+            fn eq(&self, other: &sockaddr_vm) -> bool {
+                self.svm_len == other.svm_len
+                    && self.svm_family == other.svm_family
+                    && self.svm_reserved1 == other.svm_reserved1
+                    && self.svm_port == other.svm_port
+                    && self.svm_cid == other.svm_cid
+            }
+        }
+
+        impl Eq for sockaddr_vm {}
+
+        impl ::fmt::Debug for sockaddr_vm {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let svm_len = self.svm_len;
+                let svm_family = self.svm_family;
+                let svm_reserved1 = self.svm_reserved1;
+                let svm_port = self.svm_port;
+                let svm_cid = self.svm_cid;
+
+                f.debug_struct("sockaddr_vm")
+                    .field("svm_len",&svm_len)
+                    .field("svm_family",&svm_family)
+                    .field("svm_reserved1",&svm_reserved1)
+                    .field("svm_port",&svm_port)
+                    .field("svm_cid",&svm_cid)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for sockaddr_vm {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let svm_len = self.svm_len;
+                let svm_family = self.svm_family;
+                let svm_reserved1 = self.svm_reserved1;
+                let svm_port = self.svm_port;
+                let svm_cid = self.svm_cid;
+
+                svm_len.hash(state);
+                svm_family.hash(state);
+                svm_reserved1.hash(state);
+                svm_port.hash(state);
+                svm_cid.hash(state);
+            }
+        }
+
+        impl PartialEq for ifdevmtu {
+            fn eq(&self, other: &ifdevmtu) -> bool {
+                self.ifdm_current == other.ifdm_current
+                    && self.ifdm_min == other.ifdm_min
+                    && self.ifdm_max == other.ifdm_max
+            }
+        }
+
+        impl Eq for ifdevmtu {}
+
+        impl ::fmt::Debug for ifdevmtu {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifdevmtu")
+                    .field("ifdm_current", &self.ifdm_current)
+                    .field("ifdm_min", &self.ifdm_min)
+                    .field("ifdm_max", &self.ifdm_max)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for ifdevmtu {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ifdm_current.hash(state);
+                self.ifdm_min.hash(state);
+                self.ifdm_max.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl PartialEq for __c_anonymous_ifk_data {
+            fn eq(&self, other: &__c_anonymous_ifk_data) -> bool {
+                unsafe {
+                    self.ifk_ptr == other.ifk_ptr
+                        && self.ifk_value == other.ifk_value
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_ifk_data {}
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifk_data {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("__c_anonymous_ifk_data")
+                    .field("ifk_ptr", unsafe { &self.ifk_ptr })
+                    .field("ifk_value", unsafe { &self.ifk_value })
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_ifk_data {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                    self.ifk_ptr.hash(state);
+                    self.ifk_value.hash(state);
+                }
+            }
+        }
+
+        impl PartialEq for ifkpi {
+            fn eq(&self, other: &ifkpi) -> bool {
+                self.ifk_module_id == other.ifk_module_id
+                    && self.ifk_type == other.ifk_type
+            }
+        }
+
+        impl Eq for ifkpi {}
+
+        impl ::fmt::Debug for ifkpi {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifkpi")
+                    .field("ifk_module_id", &self.ifk_module_id)
+                    .field("ifk_type", &self.ifk_type)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for ifkpi {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ifk_module_id.hash(state);
+                self.ifk_type.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl PartialEq for __c_anonymous_ifr_ifru {
+            fn eq(&self, other: &__c_anonymous_ifr_ifru) -> bool {
+                unsafe {
+                    self.ifru_addr == other.ifru_addr
+                        && self.ifru_dstaddr == other.ifru_dstaddr
+                        && self.ifru_broadaddr == other.ifru_broadaddr
+                        && self.ifru_flags == other.ifru_flags
+                        && self.ifru_metrics == other.ifru_metrics
+                        && self.ifru_mtu == other.ifru_mtu
+                        && self.ifru_phys == other.ifru_phys
+                        && self.ifru_media == other.ifru_media
+                        && self.ifru_intval == other.ifru_intval
+                        && self.ifru_data == other.ifru_data
+                        && self.ifru_devmtu == other.ifru_devmtu
+                        && self.ifru_kpi == other.ifru_kpi
+                        && self.ifru_wake_flags == other.ifru_wake_flags
+                        && self.ifru_route_refcnt == other.ifru_route_refcnt
+                        && self.ifru_cap.iter().zip(other.ifru_cap.iter()).all(|(a,b)| a == b)
+                        && self.ifru_functional_type == other.ifru_functional_type
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_ifr_ifru {}
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifr_ifru {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("__c_anonymous_ifr_ifru")
+                    .field("ifru_addr", unsafe { &self.ifru_addr })
+                    .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr })
+                    .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr })
+                    .field("ifru_flags", unsafe { &self.ifru_flags })
+                    .field("ifru_metrics", unsafe { &self.ifru_metrics })
+                    .field("ifru_mtu", unsafe { &self.ifru_mtu })
+                    .field("ifru_phys", unsafe { &self.ifru_phys })
+                    .field("ifru_media", unsafe { &self.ifru_media })
+                    .field("ifru_intval", unsafe { &self.ifru_intval })
+                    .field("ifru_data", unsafe { &self.ifru_data })
+                    .field("ifru_devmtu", unsafe { &self.ifru_devmtu })
+                    .field("ifru_kpi", unsafe { &self.ifru_kpi })
+                    .field("ifru_wake_flags", unsafe { &self.ifru_wake_flags })
+                    .field("ifru_route_refcnt", unsafe { &self.ifru_route_refcnt })
+                    .field("ifru_cap", unsafe { &self.ifru_cap })
+                    .field("ifru_functional_type", unsafe { &self.ifru_functional_type })
+                    .finish()
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_ifr_ifru {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                    self.ifru_addr.hash(state);
+                    self.ifru_dstaddr.hash(state);
+                    self.ifru_broadaddr.hash(state);
+                    self.ifru_flags.hash(state);
+                    self.ifru_metrics.hash(state);
+                    self.ifru_mtu.hash(state);
+                    self.ifru_phys.hash(state);
+                    self.ifru_media.hash(state);
+                    self.ifru_intval.hash(state);
+                    self.ifru_data.hash(state);
+                    self.ifru_devmtu.hash(state);
+                    self.ifru_kpi.hash(state);
+                    self.ifru_wake_flags.hash(state);
+                    self.ifru_route_refcnt.hash(state);
+                    self.ifru_cap.hash(state);
+                    self.ifru_functional_type.hash(state);
+                }
+            }
+        }
+
+        impl PartialEq for ifreq {
+            fn eq(&self, other: &ifreq) -> bool {
+                self.ifr_name == other.ifr_name
+                    && self.ifr_ifru == other.ifr_ifru
+            }
+        }
+
+        impl Eq for ifreq {}
+
+        impl ::fmt::Debug for ifreq {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifreq")
+                    .field("ifr_name", &self.ifr_name)
+                    .field("ifr_ifru", &self.ifr_ifru)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for ifreq {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ifr_name.hash(state);
+                self.ifr_ifru.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_ifc_ifcu {}
+
+        #[cfg(libc_union)]
+        impl PartialEq for __c_anonymous_ifc_ifcu {
+            fn eq(&self, other: &__c_anonymous_ifc_ifcu) -> bool {
+                unsafe {
+                    self.ifcu_buf == other.ifcu_buf &&
+                    self.ifcu_req == other.ifcu_req
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifc_ifcu {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifc_ifcu")
+                    .field("ifcu_buf", unsafe { &self.ifcu_buf })
+                    .field("ifcu_req", unsafe { &self.ifcu_req })
+                    .finish()
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_ifc_ifcu {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe { self.ifcu_buf.hash(state) };
+                unsafe { self.ifcu_req.hash(state) };
+            }
+        }
+    }
+}
+
+pub const _UTX_USERSIZE: usize = 256;
+pub const _UTX_LINESIZE: usize = 32;
+pub const _UTX_IDSIZE: usize = 4;
+pub const _UTX_HOSTSIZE: usize = 256;
+
+pub const EMPTY: ::c_short = 0;
+pub const RUN_LVL: ::c_short = 1;
+pub const BOOT_TIME: ::c_short = 2;
+pub const OLD_TIME: ::c_short = 3;
+pub const NEW_TIME: ::c_short = 4;
+pub const INIT_PROCESS: ::c_short = 5;
+pub const LOGIN_PROCESS: ::c_short = 6;
+pub const USER_PROCESS: ::c_short = 7;
+pub const DEAD_PROCESS: ::c_short = 8;
+pub const ACCOUNTING: ::c_short = 9;
+pub const SIGNATURE: ::c_short = 10;
+pub const SHUTDOWN_TIME: ::c_short = 11;
+
+pub const LC_COLLATE_MASK: ::c_int = 1 << 0;
+pub const LC_CTYPE_MASK: ::c_int = 1 << 1;
+pub const LC_MESSAGES_MASK: ::c_int = 1 << 2;
+pub const LC_MONETARY_MASK: ::c_int = 1 << 3;
+pub const LC_NUMERIC_MASK: ::c_int = 1 << 4;
+pub const LC_TIME_MASK: ::c_int = 1 << 5;
+pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
+    | LC_CTYPE_MASK
+    | LC_MESSAGES_MASK
+    | LC_MONETARY_MASK
+    | LC_NUMERIC_MASK
+    | LC_TIME_MASK;
+
+pub const CODESET: ::nl_item = 0;
+pub const D_T_FMT: ::nl_item = 1;
+pub const D_FMT: ::nl_item = 2;
+pub const T_FMT: ::nl_item = 3;
+pub const T_FMT_AMPM: ::nl_item = 4;
+pub const AM_STR: ::nl_item = 5;
+pub const PM_STR: ::nl_item = 6;
+
+pub const DAY_1: ::nl_item = 7;
+pub const DAY_2: ::nl_item = 8;
+pub const DAY_3: ::nl_item = 9;
+pub const DAY_4: ::nl_item = 10;
+pub const DAY_5: ::nl_item = 11;
+pub const DAY_6: ::nl_item = 12;
+pub const DAY_7: ::nl_item = 13;
+
+pub const ABDAY_1: ::nl_item = 14;
+pub const ABDAY_2: ::nl_item = 15;
+pub const ABDAY_3: ::nl_item = 16;
+pub const ABDAY_4: ::nl_item = 17;
+pub const ABDAY_5: ::nl_item = 18;
+pub const ABDAY_6: ::nl_item = 19;
+pub const ABDAY_7: ::nl_item = 20;
+
+pub const MON_1: ::nl_item = 21;
+pub const MON_2: ::nl_item = 22;
+pub const MON_3: ::nl_item = 23;
+pub const MON_4: ::nl_item = 24;
+pub const MON_5: ::nl_item = 25;
+pub const MON_6: ::nl_item = 26;
+pub const MON_7: ::nl_item = 27;
+pub const MON_8: ::nl_item = 28;
+pub const MON_9: ::nl_item = 29;
+pub const MON_10: ::nl_item = 30;
+pub const MON_11: ::nl_item = 31;
+pub const MON_12: ::nl_item = 32;
+
+pub const ABMON_1: ::nl_item = 33;
+pub const ABMON_2: ::nl_item = 34;
+pub const ABMON_3: ::nl_item = 35;
+pub const ABMON_4: ::nl_item = 36;
+pub const ABMON_5: ::nl_item = 37;
+pub const ABMON_6: ::nl_item = 38;
+pub const ABMON_7: ::nl_item = 39;
+pub const ABMON_8: ::nl_item = 40;
+pub const ABMON_9: ::nl_item = 41;
+pub const ABMON_10: ::nl_item = 42;
+pub const ABMON_11: ::nl_item = 43;
+pub const ABMON_12: ::nl_item = 44;
+
+pub const CLOCK_REALTIME: ::clockid_t = 0;
+pub const CLOCK_MONOTONIC_RAW: ::clockid_t = 4;
+pub const CLOCK_MONOTONIC_RAW_APPROX: ::clockid_t = 5;
+pub const CLOCK_MONOTONIC: ::clockid_t = 6;
+pub const CLOCK_UPTIME_RAW: ::clockid_t = 8;
+pub const CLOCK_UPTIME_RAW_APPROX: ::clockid_t = 9;
+pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 12;
+pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 16;
+
+pub const ERA: ::nl_item = 45;
+pub const ERA_D_FMT: ::nl_item = 46;
+pub const ERA_D_T_FMT: ::nl_item = 47;
+pub const ERA_T_FMT: ::nl_item = 48;
+pub const ALT_DIGITS: ::nl_item = 49;
+
+pub const RADIXCHAR: ::nl_item = 50;
+pub const THOUSEP: ::nl_item = 51;
+
+pub const YESEXPR: ::nl_item = 52;
+pub const NOEXPR: ::nl_item = 53;
+
+pub const YESSTR: ::nl_item = 54;
+pub const NOSTR: ::nl_item = 55;
+
+pub const CRNCYSTR: ::nl_item = 56;
+
+pub const D_MD_ORDER: ::nl_item = 57;
+
+pub const EXIT_FAILURE: ::c_int = 1;
+pub const EXIT_SUCCESS: ::c_int = 0;
+pub const RAND_MAX: ::c_int = 2147483647;
+pub const EOF: ::c_int = -1;
+pub const SEEK_SET: ::c_int = 0;
+pub const SEEK_CUR: ::c_int = 1;
+pub const SEEK_END: ::c_int = 2;
+pub const SEEK_HOLE: ::c_int = 3;
+pub const SEEK_DATA: ::c_int = 4;
+pub const _IOFBF: ::c_int = 0;
+pub const _IONBF: ::c_int = 2;
+pub const _IOLBF: ::c_int = 1;
+pub const BUFSIZ: ::c_uint = 1024;
+pub const FOPEN_MAX: ::c_uint = 20;
+pub const FILENAME_MAX: ::c_uint = 1024;
+pub const L_tmpnam: ::c_uint = 1024;
+pub const TMP_MAX: ::c_uint = 308915776;
+pub const _PC_LINK_MAX: ::c_int = 1;
+pub const _PC_MAX_CANON: ::c_int = 2;
+pub const _PC_MAX_INPUT: ::c_int = 3;
+pub const _PC_NAME_MAX: ::c_int = 4;
+pub const _PC_PATH_MAX: ::c_int = 5;
+pub const _PC_PIPE_BUF: ::c_int = 6;
+pub const _PC_CHOWN_RESTRICTED: ::c_int = 7;
+pub const _PC_NO_TRUNC: ::c_int = 8;
+pub const _PC_VDISABLE: ::c_int = 9;
+pub const _PC_NAME_CHARS_MAX: ::c_int = 10;
+pub const _PC_CASE_SENSITIVE: ::c_int = 11;
+pub const _PC_CASE_PRESERVING: ::c_int = 12;
+pub const _PC_EXTENDED_SECURITY_NP: ::c_int = 13;
+pub const _PC_AUTH_OPAQUE_NP: ::c_int = 14;
+pub const _PC_2_SYMLINKS: ::c_int = 15;
+pub const _PC_ALLOC_SIZE_MIN: ::c_int = 16;
+pub const _PC_ASYNC_IO: ::c_int = 17;
+pub const _PC_FILESIZEBITS: ::c_int = 18;
+pub const _PC_PRIO_IO: ::c_int = 19;
+pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 20;
+pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 21;
+pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 22;
+pub const _PC_REC_XFER_ALIGN: ::c_int = 23;
+pub const _PC_SYMLINK_MAX: ::c_int = 24;
+pub const _PC_SYNC_IO: ::c_int = 25;
+pub const _PC_XATTR_SIZE_BITS: ::c_int = 26;
+pub const _PC_MIN_HOLE_SIZE: ::c_int = 27;
+pub const O_EVTONLY: ::c_int = 0x00008000;
+pub const O_NOCTTY: ::c_int = 0x00020000;
+pub const O_DIRECTORY: ::c_int = 0x00100000;
+pub const O_SYMLINK: ::c_int = 0x00200000;
+pub const O_DSYNC: ::c_int = 0x00400000;
+pub const O_CLOEXEC: ::c_int = 0x01000000;
+pub const O_NOFOLLOW_ANY: ::c_int = 0x20000000;
+pub const O_EXEC: ::c_int = 0x40000000;
+pub const O_SEARCH: ::c_int = O_EXEC | O_DIRECTORY;
+pub const S_IFIFO: mode_t = 4096;
+pub const S_IFCHR: mode_t = 8192;
+pub const S_IFBLK: mode_t = 24576;
+pub const S_IFDIR: mode_t = 16384;
+pub const S_IFREG: mode_t = 32768;
+pub const S_IFLNK: mode_t = 40960;
+pub const S_IFSOCK: mode_t = 49152;
+pub const S_IFMT: mode_t = 61440;
+pub const S_IEXEC: mode_t = 64;
+pub const S_IWRITE: mode_t = 128;
+pub const S_IREAD: mode_t = 256;
+pub const S_IRWXU: mode_t = 448;
+pub const S_IXUSR: mode_t = 64;
+pub const S_IWUSR: mode_t = 128;
+pub const S_IRUSR: mode_t = 256;
+pub const S_IRWXG: mode_t = 56;
+pub const S_IXGRP: mode_t = 8;
+pub const S_IWGRP: mode_t = 16;
+pub const S_IRGRP: mode_t = 32;
+pub const S_IRWXO: mode_t = 7;
+pub const S_IXOTH: mode_t = 1;
+pub const S_IWOTH: mode_t = 2;
+pub const S_IROTH: mode_t = 4;
+pub const F_OK: ::c_int = 0;
+pub const R_OK: ::c_int = 4;
+pub const W_OK: ::c_int = 2;
+pub const X_OK: ::c_int = 1;
+pub const STDIN_FILENO: ::c_int = 0;
+pub const STDOUT_FILENO: ::c_int = 1;
+pub const STDERR_FILENO: ::c_int = 2;
+pub const F_LOCK: ::c_int = 1;
+pub const F_TEST: ::c_int = 3;
+pub const F_TLOCK: ::c_int = 2;
+pub const F_ULOCK: ::c_int = 0;
+pub const F_GETLK: ::c_int = 7;
+pub const F_SETLK: ::c_int = 8;
+pub const F_SETLKW: ::c_int = 9;
+pub const SIGHUP: ::c_int = 1;
+pub const SIGINT: ::c_int = 2;
+pub const SIGQUIT: ::c_int = 3;
+pub const SIGILL: ::c_int = 4;
+pub const SIGABRT: ::c_int = 6;
+pub const SIGEMT: ::c_int = 7;
+pub const SIGFPE: ::c_int = 8;
+pub const SIGKILL: ::c_int = 9;
+pub const SIGSEGV: ::c_int = 11;
+pub const SIGPIPE: ::c_int = 13;
+pub const SIGALRM: ::c_int = 14;
+pub const SIGTERM: ::c_int = 15;
+
+pub const PROT_NONE: ::c_int = 0;
+pub const PROT_READ: ::c_int = 1;
+pub const PROT_WRITE: ::c_int = 2;
+pub const PROT_EXEC: ::c_int = 4;
+
+pub const PT_TRACE_ME: ::c_int = 0;
+pub const PT_READ_I: ::c_int = 1;
+pub const PT_READ_D: ::c_int = 2;
+pub const PT_READ_U: ::c_int = 3;
+pub const PT_WRITE_I: ::c_int = 4;
+pub const PT_WRITE_D: ::c_int = 5;
+pub const PT_WRITE_U: ::c_int = 6;
+pub const PT_CONTINUE: ::c_int = 7;
+pub const PT_KILL: ::c_int = 8;
+pub const PT_STEP: ::c_int = 9;
+pub const PT_ATTACH: ::c_int = 10;
+pub const PT_DETACH: ::c_int = 11;
+pub const PT_SIGEXC: ::c_int = 12;
+pub const PT_THUPDATE: ::c_int = 13;
+pub const PT_ATTACHEXC: ::c_int = 14;
+
+pub const PT_FORCEQUOTA: ::c_int = 30;
+pub const PT_DENY_ATTACH: ::c_int = 31;
+pub const PT_FIRSTMACH: ::c_int = 32;
+
+pub const MAP_FILE: ::c_int = 0x0000;
+pub const MAP_SHARED: ::c_int = 0x0001;
+pub const MAP_PRIVATE: ::c_int = 0x0002;
+pub const MAP_FIXED: ::c_int = 0x0010;
+pub const MAP_ANON: ::c_int = 0x1000;
+pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
+
+pub const CPU_STATE_USER: ::c_int = 0;
+pub const CPU_STATE_SYSTEM: ::c_int = 1;
+pub const CPU_STATE_IDLE: ::c_int = 2;
+pub const CPU_STATE_NICE: ::c_int = 3;
+pub const CPU_STATE_MAX: ::c_int = 4;
+
+pub const PROCESSOR_BASIC_INFO: ::c_int = 1;
+pub const PROCESSOR_CPU_LOAD_INFO: ::c_int = 2;
+pub const PROCESSOR_PM_REGS_INFO: ::c_int = 0x10000001;
+pub const PROCESSOR_TEMPERATURE: ::c_int = 0x10000002;
+pub const PROCESSOR_SET_LOAD_INFO: ::c_int = 4;
+pub const PROCESSOR_SET_BASIC_INFO: ::c_int = 5;
+
+deprecated_mach! {
+    pub const VM_FLAGS_FIXED: ::c_int = 0x0000;
+    pub const VM_FLAGS_ANYWHERE: ::c_int = 0x0001;
+    pub const VM_FLAGS_PURGABLE: ::c_int = 0x0002;
+    pub const VM_FLAGS_RANDOM_ADDR: ::c_int = 0x0008;
+    pub const VM_FLAGS_NO_CACHE: ::c_int = 0x0010;
+    pub const VM_FLAGS_RESILIENT_CODESIGN: ::c_int = 0x0020;
+    pub const VM_FLAGS_RESILIENT_MEDIA: ::c_int = 0x0040;
+    pub const VM_FLAGS_OVERWRITE: ::c_int = 0x4000;
+    pub const VM_FLAGS_SUPERPAGE_MASK: ::c_int = 0x70000;
+    pub const VM_FLAGS_RETURN_DATA_ADDR: ::c_int = 0x100000;
+    pub const VM_FLAGS_RETURN_4K_DATA_ADDR: ::c_int = 0x800000;
+    pub const VM_FLAGS_ALIAS_MASK: ::c_int = 0xFF000000;
+    pub const VM_FLAGS_USER_ALLOCATE: ::c_int = 0xff07401f;
+    pub const VM_FLAGS_USER_MAP: ::c_int = 0xff97401f;
+    pub const VM_FLAGS_USER_REMAP: ::c_int = VM_FLAGS_FIXED |
+                                             VM_FLAGS_ANYWHERE |
+                                             VM_FLAGS_RANDOM_ADDR |
+                                             VM_FLAGS_OVERWRITE |
+                                             VM_FLAGS_RETURN_DATA_ADDR |
+                                             VM_FLAGS_RESILIENT_CODESIGN;
+
+    pub const VM_FLAGS_SUPERPAGE_SHIFT: ::c_int = 16;
+    pub const SUPERPAGE_NONE: ::c_int = 0;
+    pub const SUPERPAGE_SIZE_ANY: ::c_int = 1;
+    pub const VM_FLAGS_SUPERPAGE_NONE: ::c_int = SUPERPAGE_NONE <<
+                                                 VM_FLAGS_SUPERPAGE_SHIFT;
+    pub const VM_FLAGS_SUPERPAGE_SIZE_ANY: ::c_int = SUPERPAGE_SIZE_ANY <<
+                                                     VM_FLAGS_SUPERPAGE_SHIFT;
+    pub const SUPERPAGE_SIZE_2MB: ::c_int = 2;
+    pub const VM_FLAGS_SUPERPAGE_SIZE_2MB: ::c_int = SUPERPAGE_SIZE_2MB <<
+                                                     VM_FLAGS_SUPERPAGE_SHIFT;
+
+    pub const VM_MEMORY_MALLOC: ::c_int = 1;
+    pub const VM_MEMORY_MALLOC_SMALL: ::c_int = 2;
+    pub const VM_MEMORY_MALLOC_LARGE: ::c_int = 3;
+    pub const VM_MEMORY_MALLOC_HUGE: ::c_int = 4;
+    pub const VM_MEMORY_SBRK: ::c_int = 5;
+    pub const VM_MEMORY_REALLOC: ::c_int = 6;
+    pub const VM_MEMORY_MALLOC_TINY: ::c_int = 7;
+    pub const VM_MEMORY_MALLOC_LARGE_REUSABLE: ::c_int = 8;
+    pub const VM_MEMORY_MALLOC_LARGE_REUSED: ::c_int = 9;
+    pub const VM_MEMORY_ANALYSIS_TOOL: ::c_int = 10;
+    pub const VM_MEMORY_MALLOC_NANO: ::c_int = 11;
+    pub const VM_MEMORY_MACH_MSG: ::c_int = 20;
+    pub const VM_MEMORY_IOKIT: ::c_int = 21;
+    pub const VM_MEMORY_STACK: ::c_int = 30;
+    pub const VM_MEMORY_GUARD: ::c_int = 31;
+    pub const VM_MEMORY_SHARED_PMAP: ::c_int = 32;
+    pub const VM_MEMORY_DYLIB: ::c_int = 33;
+    pub const VM_MEMORY_OBJC_DISPATCHERS: ::c_int = 34;
+    pub const VM_MEMORY_UNSHARED_PMAP: ::c_int = 35;
+    pub const VM_MEMORY_APPKIT: ::c_int = 40;
+    pub const VM_MEMORY_FOUNDATION: ::c_int = 41;
+    pub const VM_MEMORY_COREGRAPHICS: ::c_int = 42;
+    pub const VM_MEMORY_CORESERVICES: ::c_int = 43;
+    pub const VM_MEMORY_CARBON: ::c_int = VM_MEMORY_CORESERVICES;
+    pub const VM_MEMORY_JAVA: ::c_int = 44;
+    pub const VM_MEMORY_COREDATA: ::c_int = 45;
+    pub const VM_MEMORY_COREDATA_OBJECTIDS: ::c_int = 46;
+    pub const VM_MEMORY_ATS: ::c_int = 50;
+    pub const VM_MEMORY_LAYERKIT: ::c_int = 51;
+    pub const VM_MEMORY_CGIMAGE: ::c_int = 52;
+    pub const VM_MEMORY_TCMALLOC: ::c_int = 53;
+    pub const VM_MEMORY_COREGRAPHICS_DATA: ::c_int = 54;
+    pub const VM_MEMORY_COREGRAPHICS_SHARED: ::c_int = 55;
+    pub const VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS: ::c_int = 56;
+    pub const VM_MEMORY_COREGRAPHICS_BACKINGSTORES: ::c_int = 57;
+    pub const VM_MEMORY_COREGRAPHICS_XALLOC: ::c_int = 58;
+    pub const VM_MEMORY_COREGRAPHICS_MISC: ::c_int = VM_MEMORY_COREGRAPHICS;
+    pub const VM_MEMORY_DYLD: ::c_int = 60;
+    pub const VM_MEMORY_DYLD_MALLOC: ::c_int = 61;
+    pub const VM_MEMORY_SQLITE: ::c_int = 62;
+    pub const VM_MEMORY_JAVASCRIPT_CORE: ::c_int = 63;
+    pub const VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR: ::c_int = 64;
+    pub const VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE: ::c_int = 65;
+    pub const VM_MEMORY_GLSL: ::c_int = 66;
+    pub const VM_MEMORY_OPENCL: ::c_int = 67;
+    pub const VM_MEMORY_COREIMAGE: ::c_int = 68;
+    pub const VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS: ::c_int = 69;
+    pub const VM_MEMORY_IMAGEIO: ::c_int = 70;
+    pub const VM_MEMORY_COREPROFILE: ::c_int = 71;
+    pub const VM_MEMORY_ASSETSD: ::c_int = 72;
+    pub const VM_MEMORY_OS_ALLOC_ONCE: ::c_int = 73;
+    pub const VM_MEMORY_LIBDISPATCH: ::c_int = 74;
+    pub const VM_MEMORY_ACCELERATE: ::c_int = 75;
+    pub const VM_MEMORY_COREUI: ::c_int = 76;
+    pub const VM_MEMORY_COREUIFILE: ::c_int = 77;
+    pub const VM_MEMORY_GENEALOGY: ::c_int = 78;
+    pub const VM_MEMORY_RAWCAMERA: ::c_int = 79;
+    pub const VM_MEMORY_CORPSEINFO: ::c_int = 80;
+    pub const VM_MEMORY_ASL: ::c_int = 81;
+    pub const VM_MEMORY_SWIFT_RUNTIME: ::c_int = 82;
+    pub const VM_MEMORY_SWIFT_METADATA: ::c_int = 83;
+    pub const VM_MEMORY_DHMM: ::c_int = 84;
+    pub const VM_MEMORY_SCENEKIT: ::c_int = 86;
+    pub const VM_MEMORY_SKYWALK: ::c_int = 87;
+    pub const VM_MEMORY_APPLICATION_SPECIFIC_1: ::c_int = 240;
+    pub const VM_MEMORY_APPLICATION_SPECIFIC_16: ::c_int = 255;
+}
+
+pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+
+pub const MS_ASYNC: ::c_int = 0x0001;
+pub const MS_INVALIDATE: ::c_int = 0x0002;
+pub const MS_SYNC: ::c_int = 0x0010;
+
+pub const MS_KILLPAGES: ::c_int = 0x0004;
+pub const MS_DEACTIVATE: ::c_int = 0x0008;
+
+pub const EPERM: ::c_int = 1;
+pub const ENOENT: ::c_int = 2;
+pub const ESRCH: ::c_int = 3;
+pub const EINTR: ::c_int = 4;
+pub const EIO: ::c_int = 5;
+pub const ENXIO: ::c_int = 6;
+pub const E2BIG: ::c_int = 7;
+pub const ENOEXEC: ::c_int = 8;
+pub const EBADF: ::c_int = 9;
+pub const ECHILD: ::c_int = 10;
+pub const EDEADLK: ::c_int = 11;
+pub const ENOMEM: ::c_int = 12;
+pub const EACCES: ::c_int = 13;
+pub const EFAULT: ::c_int = 14;
+pub const ENOTBLK: ::c_int = 15;
+pub const EBUSY: ::c_int = 16;
+pub const EEXIST: ::c_int = 17;
+pub const EXDEV: ::c_int = 18;
+pub const ENODEV: ::c_int = 19;
+pub const ENOTDIR: ::c_int = 20;
+pub const EISDIR: ::c_int = 21;
+pub const EINVAL: ::c_int = 22;
+pub const ENFILE: ::c_int = 23;
+pub const EMFILE: ::c_int = 24;
+pub const ENOTTY: ::c_int = 25;
+pub const ETXTBSY: ::c_int = 26;
+pub const EFBIG: ::c_int = 27;
+pub const ENOSPC: ::c_int = 28;
+pub const ESPIPE: ::c_int = 29;
+pub const EROFS: ::c_int = 30;
+pub const EMLINK: ::c_int = 31;
+pub const EPIPE: ::c_int = 32;
+pub const EDOM: ::c_int = 33;
+pub const ERANGE: ::c_int = 34;
+pub const EAGAIN: ::c_int = 35;
+pub const EWOULDBLOCK: ::c_int = EAGAIN;
+pub const EINPROGRESS: ::c_int = 36;
+pub const EALREADY: ::c_int = 37;
+pub const ENOTSOCK: ::c_int = 38;
+pub const EDESTADDRREQ: ::c_int = 39;
+pub const EMSGSIZE: ::c_int = 40;
+pub const EPROTOTYPE: ::c_int = 41;
+pub const ENOPROTOOPT: ::c_int = 42;
+pub const EPROTONOSUPPORT: ::c_int = 43;
+pub const ESOCKTNOSUPPORT: ::c_int = 44;
+pub const ENOTSUP: ::c_int = 45;
+pub const EPFNOSUPPORT: ::c_int = 46;
+pub const EAFNOSUPPORT: ::c_int = 47;
+pub const EADDRINUSE: ::c_int = 48;
+pub const EADDRNOTAVAIL: ::c_int = 49;
+pub const ENETDOWN: ::c_int = 50;
+pub const ENETUNREACH: ::c_int = 51;
+pub const ENETRESET: ::c_int = 52;
+pub const ECONNABORTED: ::c_int = 53;
+pub const ECONNRESET: ::c_int = 54;
+pub const ENOBUFS: ::c_int = 55;
+pub const EISCONN: ::c_int = 56;
+pub const ENOTCONN: ::c_int = 57;
+pub const ESHUTDOWN: ::c_int = 58;
+pub const ETOOMANYREFS: ::c_int = 59;
+pub const ETIMEDOUT: ::c_int = 60;
+pub const ECONNREFUSED: ::c_int = 61;
+pub const ELOOP: ::c_int = 62;
+pub const ENAMETOOLONG: ::c_int = 63;
+pub const EHOSTDOWN: ::c_int = 64;
+pub const EHOSTUNREACH: ::c_int = 65;
+pub const ENOTEMPTY: ::c_int = 66;
+pub const EPROCLIM: ::c_int = 67;
+pub const EUSERS: ::c_int = 68;
+pub const EDQUOT: ::c_int = 69;
+pub const ESTALE: ::c_int = 70;
+pub const EREMOTE: ::c_int = 71;
+pub const EBADRPC: ::c_int = 72;
+pub const ERPCMISMATCH: ::c_int = 73;
+pub const EPROGUNAVAIL: ::c_int = 74;
+pub const EPROGMISMATCH: ::c_int = 75;
+pub const EPROCUNAVAIL: ::c_int = 76;
+pub const ENOLCK: ::c_int = 77;
+pub const ENOSYS: ::c_int = 78;
+pub const EFTYPE: ::c_int = 79;
+pub const EAUTH: ::c_int = 80;
+pub const ENEEDAUTH: ::c_int = 81;
+pub const EPWROFF: ::c_int = 82;
+pub const EDEVERR: ::c_int = 83;
+pub const EOVERFLOW: ::c_int = 84;
+pub const EBADEXEC: ::c_int = 85;
+pub const EBADARCH: ::c_int = 86;
+pub const ESHLIBVERS: ::c_int = 87;
+pub const EBADMACHO: ::c_int = 88;
+pub const ECANCELED: ::c_int = 89;
+pub const EIDRM: ::c_int = 90;
+pub const ENOMSG: ::c_int = 91;
+pub const EILSEQ: ::c_int = 92;
+pub const ENOATTR: ::c_int = 93;
+pub const EBADMSG: ::c_int = 94;
+pub const EMULTIHOP: ::c_int = 95;
+pub const ENODATA: ::c_int = 96;
+pub const ENOLINK: ::c_int = 97;
+pub const ENOSR: ::c_int = 98;
+pub const ENOSTR: ::c_int = 99;
+pub const EPROTO: ::c_int = 100;
+pub const ETIME: ::c_int = 101;
+pub const EOPNOTSUPP: ::c_int = 102;
+pub const ENOPOLICY: ::c_int = 103;
+pub const ENOTRECOVERABLE: ::c_int = 104;
+pub const EOWNERDEAD: ::c_int = 105;
+pub const EQFULL: ::c_int = 106;
+pub const ELAST: ::c_int = 106;
+
+pub const EAI_AGAIN: ::c_int = 2;
+pub const EAI_BADFLAGS: ::c_int = 3;
+pub const EAI_FAIL: ::c_int = 4;
+pub const EAI_FAMILY: ::c_int = 5;
+pub const EAI_MEMORY: ::c_int = 6;
+pub const EAI_NODATA: ::c_int = 7;
+pub const EAI_NONAME: ::c_int = 8;
+pub const EAI_SERVICE: ::c_int = 9;
+pub const EAI_SOCKTYPE: ::c_int = 10;
+pub const EAI_SYSTEM: ::c_int = 11;
+pub const EAI_OVERFLOW: ::c_int = 14;
+
+pub const F_DUPFD: ::c_int = 0;
+pub const F_DUPFD_CLOEXEC: ::c_int = 67;
+pub const F_GETFD: ::c_int = 1;
+pub const F_SETFD: ::c_int = 2;
+pub const F_GETFL: ::c_int = 3;
+pub const F_SETFL: ::c_int = 4;
+pub const F_PREALLOCATE: ::c_int = 42;
+pub const F_RDADVISE: ::c_int = 44;
+pub const F_RDAHEAD: ::c_int = 45;
+pub const F_NOCACHE: ::c_int = 48;
+pub const F_LOG2PHYS: ::c_int = 49;
+pub const F_GETPATH: ::c_int = 50;
+pub const F_FULLFSYNC: ::c_int = 51;
+pub const F_FREEZE_FS: ::c_int = 53;
+pub const F_THAW_FS: ::c_int = 54;
+pub const F_GLOBAL_NOCACHE: ::c_int = 55;
+pub const F_NODIRECT: ::c_int = 62;
+pub const F_LOG2PHYS_EXT: ::c_int = 65;
+pub const F_BARRIERFSYNC: ::c_int = 85;
+pub const F_PUNCHHOLE: ::c_int = 99;
+pub const F_TRIM_ACTIVE_FILE: ::c_int = 100;
+pub const F_SPECULATIVE_READ: ::c_int = 101;
+pub const F_GETPATH_NOFIRMLINK: ::c_int = 102;
+
+pub const F_ALLOCATECONTIG: ::c_uint = 0x02;
+pub const F_ALLOCATEALL: ::c_uint = 0x04;
+
+pub const F_PEOFPOSMODE: ::c_int = 3;
+pub const F_VOLPOSMODE: ::c_int = 4;
+
+pub const AT_FDCWD: ::c_int = -2;
+pub const AT_EACCESS: ::c_int = 0x0010;
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x0020;
+pub const AT_SYMLINK_FOLLOW: ::c_int = 0x0040;
+pub const AT_REMOVEDIR: ::c_int = 0x0080;
+
+pub const PTHREAD_INTROSPECTION_THREAD_CREATE: ::c_uint = 1;
+pub const PTHREAD_INTROSPECTION_THREAD_START: ::c_uint = 2;
+pub const PTHREAD_INTROSPECTION_THREAD_TERMINATE: ::c_uint = 3;
+pub const PTHREAD_INTROSPECTION_THREAD_DESTROY: ::c_uint = 4;
+
+pub const TIOCMODG: ::c_ulong = 0x40047403;
+pub const TIOCMODS: ::c_ulong = 0x80047404;
+pub const TIOCM_LE: ::c_int = 0x1;
+pub const TIOCM_DTR: ::c_int = 0x2;
+pub const TIOCM_RTS: ::c_int = 0x4;
+pub const TIOCM_ST: ::c_int = 0x8;
+pub const TIOCM_SR: ::c_int = 0x10;
+pub const TIOCM_CTS: ::c_int = 0x20;
+pub const TIOCM_CAR: ::c_int = 0x40;
+pub const TIOCM_CD: ::c_int = 0x40;
+pub const TIOCM_RNG: ::c_int = 0x80;
+pub const TIOCM_RI: ::c_int = 0x80;
+pub const TIOCM_DSR: ::c_int = 0x100;
+pub const TIOCEXCL: ::c_int = 0x2000740d;
+pub const TIOCNXCL: ::c_int = 0x2000740e;
+pub const TIOCFLUSH: ::c_ulong = 0x80047410;
+pub const TIOCGETD: ::c_ulong = 0x4004741a;
+pub const TIOCSETD: ::c_ulong = 0x8004741b;
+pub const TIOCIXON: ::c_uint = 0x20007481;
+pub const TIOCIXOFF: ::c_uint = 0x20007480;
+pub const TIOCSDTR: ::c_uint = 0x20007479;
+pub const TIOCCDTR: ::c_uint = 0x20007478;
+pub const TIOCGPGRP: ::c_ulong = 0x40047477;
+pub const TIOCSPGRP: ::c_ulong = 0x80047476;
+pub const TIOCOUTQ: ::c_ulong = 0x40047473;
+pub const TIOCSTI: ::c_ulong = 0x80017472;
+pub const TIOCNOTTY: ::c_uint = 0x20007471;
+pub const TIOCPKT: ::c_ulong = 0x80047470;
+pub const TIOCPKT_DATA: ::c_int = 0x0;
+pub const TIOCPKT_FLUSHREAD: ::c_int = 0x1;
+pub const TIOCPKT_FLUSHWRITE: ::c_int = 0x2;
+pub const TIOCPKT_STOP: ::c_int = 0x4;
+pub const TIOCPKT_START: ::c_int = 0x8;
+pub const TIOCPKT_NOSTOP: ::c_int = 0x10;
+pub const TIOCPKT_DOSTOP: ::c_int = 0x20;
+pub const TIOCPKT_IOCTL: ::c_int = 0x40;
+pub const TIOCSTOP: ::c_uint = 0x2000746f;
+pub const TIOCSTART: ::c_uint = 0x2000746e;
+pub const TIOCMSET: ::c_ulong = 0x8004746d;
+pub const TIOCMBIS: ::c_ulong = 0x8004746c;
+pub const TIOCMBIC: ::c_ulong = 0x8004746b;
+pub const TIOCMGET: ::c_ulong = 0x4004746a;
+pub const TIOCREMOTE: ::c_ulong = 0x80047469;
+pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
+pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
+pub const TIOCUCNTL: ::c_ulong = 0x80047466;
+pub const TIOCSTAT: ::c_uint = 0x20007465;
+pub const TIOCSCONS: ::c_uint = 0x20007463;
+pub const TIOCCONS: ::c_ulong = 0x80047462;
+pub const TIOCSCTTY: ::c_uint = 0x20007461;
+pub const TIOCEXT: ::c_ulong = 0x80047460;
+pub const TIOCSIG: ::c_uint = 0x2000745f;
+pub const TIOCDRAIN: ::c_uint = 0x2000745e;
+pub const TIOCMSDTRWAIT: ::c_ulong = 0x8004745b;
+pub const TIOCMGDTRWAIT: ::c_ulong = 0x4004745a;
+pub const TIOCSDRAINWAIT: ::c_ulong = 0x80047457;
+pub const TIOCGDRAINWAIT: ::c_ulong = 0x40047456;
+pub const TIOCDSIMICROCODE: ::c_uint = 0x20007455;
+pub const TIOCPTYGRANT: ::c_uint = 0x20007454;
+pub const TIOCPTYGNAME: ::c_uint = 0x40807453;
+pub const TIOCPTYUNLK: ::c_uint = 0x20007452;
+
+pub const BIOCGRSIG: ::c_ulong = 0x40044272;
+pub const BIOCSRSIG: ::c_ulong = 0x80044273;
+pub const BIOCSDLT: ::c_ulong = 0x80044278;
+pub const BIOCGSEESENT: ::c_ulong = 0x40044276;
+pub const BIOCSSEESENT: ::c_ulong = 0x80044277;
+pub const BIOCGDLTLIST: ::c_ulong = 0xc00c4279;
+
+pub const FIODTYPE: ::c_ulong = 0x4004667a;
+
+pub const B0: speed_t = 0;
+pub const B50: speed_t = 50;
+pub const B75: speed_t = 75;
+pub const B110: speed_t = 110;
+pub const B134: speed_t = 134;
+pub const B150: speed_t = 150;
+pub const B200: speed_t = 200;
+pub const B300: speed_t = 300;
+pub const B600: speed_t = 600;
+pub const B1200: speed_t = 1200;
+pub const B1800: speed_t = 1800;
+pub const B2400: speed_t = 2400;
+pub const B4800: speed_t = 4800;
+pub const B9600: speed_t = 9600;
+pub const B19200: speed_t = 19200;
+pub const B38400: speed_t = 38400;
+pub const B7200: speed_t = 7200;
+pub const B14400: speed_t = 14400;
+pub const B28800: speed_t = 28800;
+pub const B57600: speed_t = 57600;
+pub const B76800: speed_t = 76800;
+pub const B115200: speed_t = 115200;
+pub const B230400: speed_t = 230400;
+pub const EXTA: speed_t = 19200;
+pub const EXTB: speed_t = 38400;
+
+pub const SIGTRAP: ::c_int = 5;
+
+pub const GLOB_APPEND: ::c_int = 0x0001;
+pub const GLOB_DOOFFS: ::c_int = 0x0002;
+pub const GLOB_ERR: ::c_int = 0x0004;
+pub const GLOB_MARK: ::c_int = 0x0008;
+pub const GLOB_NOCHECK: ::c_int = 0x0010;
+pub const GLOB_NOSORT: ::c_int = 0x0020;
+pub const GLOB_NOESCAPE: ::c_int = 0x2000;
+
+pub const GLOB_NOSPACE: ::c_int = -1;
+pub const GLOB_ABORTED: ::c_int = -2;
+pub const GLOB_NOMATCH: ::c_int = -3;
+
+pub const POSIX_MADV_NORMAL: ::c_int = 0;
+pub const POSIX_MADV_RANDOM: ::c_int = 1;
+pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
+pub const POSIX_MADV_WILLNEED: ::c_int = 3;
+pub const POSIX_MADV_DONTNEED: ::c_int = 4;
+
+pub const _SC_IOV_MAX: ::c_int = 56;
+pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 70;
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 71;
+pub const _SC_LOGIN_NAME_MAX: ::c_int = 73;
+pub const _SC_MQ_PRIO_MAX: ::c_int = 75;
+pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 82;
+pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 83;
+pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 85;
+pub const _SC_THREAD_KEYS_MAX: ::c_int = 86;
+pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 87;
+pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 88;
+pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 89;
+pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 90;
+pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 91;
+pub const _SC_THREAD_STACK_MIN: ::c_int = 93;
+pub const _SC_THREAD_THREADS_MAX: ::c_int = 94;
+pub const _SC_THREADS: ::c_int = 96;
+pub const _SC_TTY_NAME_MAX: ::c_int = 101;
+pub const _SC_ATEXIT_MAX: ::c_int = 107;
+pub const _SC_XOPEN_CRYPT: ::c_int = 108;
+pub const _SC_XOPEN_ENH_I18N: ::c_int = 109;
+pub const _SC_XOPEN_LEGACY: ::c_int = 110;
+pub const _SC_XOPEN_REALTIME: ::c_int = 111;
+pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 112;
+pub const _SC_XOPEN_SHM: ::c_int = 113;
+pub const _SC_XOPEN_UNIX: ::c_int = 115;
+pub const _SC_XOPEN_VERSION: ::c_int = 116;
+pub const _SC_XOPEN_XCU_VERSION: ::c_int = 121;
+pub const _SC_PHYS_PAGES: ::c_int = 200;
+
+pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 2;
+pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
+pub const PTHREAD_CREATE_JOINABLE: ::c_int = 1;
+pub const PTHREAD_CREATE_DETACHED: ::c_int = 2;
+#[cfg(target_arch = "aarch64")]
+pub const PTHREAD_STACK_MIN: ::size_t = 16384;
+#[cfg(not(target_arch = "aarch64"))]
+pub const PTHREAD_STACK_MIN: ::size_t = 8192;
+
+pub const RLIMIT_CPU: ::c_int = 0;
+pub const RLIMIT_FSIZE: ::c_int = 1;
+pub const RLIMIT_DATA: ::c_int = 2;
+pub const RLIMIT_STACK: ::c_int = 3;
+pub const RLIMIT_CORE: ::c_int = 4;
+pub const RLIMIT_AS: ::c_int = 5;
+pub const RLIMIT_RSS: ::c_int = RLIMIT_AS;
+pub const RLIMIT_MEMLOCK: ::c_int = 6;
+pub const RLIMIT_NPROC: ::c_int = 7;
+pub const RLIMIT_NOFILE: ::c_int = 8;
+#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+pub const RLIM_NLIMITS: ::c_int = 9;
+pub const _RLIMIT_POSIX_FLAG: ::c_int = 0x1000;
+
+pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff;
+
+pub const RUSAGE_SELF: ::c_int = 0;
+pub const RUSAGE_CHILDREN: ::c_int = -1;
+
+pub const MADV_NORMAL: ::c_int = 0;
+pub const MADV_RANDOM: ::c_int = 1;
+pub const MADV_SEQUENTIAL: ::c_int = 2;
+pub const MADV_WILLNEED: ::c_int = 3;
+pub const MADV_DONTNEED: ::c_int = 4;
+pub const MADV_FREE: ::c_int = 5;
+pub const MADV_ZERO_WIRED_PAGES: ::c_int = 6;
+pub const MADV_FREE_REUSABLE: ::c_int = 7;
+pub const MADV_FREE_REUSE: ::c_int = 8;
+pub const MADV_CAN_REUSE: ::c_int = 9;
+
+pub const MINCORE_INCORE: ::c_int = 0x1;
+pub const MINCORE_REFERENCED: ::c_int = 0x2;
+pub const MINCORE_MODIFIED: ::c_int = 0x4;
+pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8;
+pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10;
+
+pub const CTLIOCGINFO: c_ulong = 0xc0644e03;
+
+//
+// sys/netinet/in.h
+// Protocols (RFC 1700)
+// NOTE: These are in addition to the constants defined in src/unix/mod.rs
+
+// IPPROTO_IP defined in src/unix/mod.rs
+/// IP6 hop-by-hop options
+pub const IPPROTO_HOPOPTS: ::c_int = 0;
+// IPPROTO_ICMP defined in src/unix/mod.rs
+/// group mgmt protocol
+pub const IPPROTO_IGMP: ::c_int = 2;
+/// gateway<sup>2</sup> (deprecated)
+pub const IPPROTO_GGP: ::c_int = 3;
+/// for compatibility
+pub const IPPROTO_IPIP: ::c_int = 4;
+// IPPROTO_TCP defined in src/unix/mod.rs
+/// Stream protocol II.
+pub const IPPROTO_ST: ::c_int = 7;
+/// exterior gateway protocol
+pub const IPPROTO_EGP: ::c_int = 8;
+/// private interior gateway
+pub const IPPROTO_PIGP: ::c_int = 9;
+/// BBN RCC Monitoring
+pub const IPPROTO_RCCMON: ::c_int = 10;
+/// network voice protocol
+pub const IPPROTO_NVPII: ::c_int = 11;
+/// pup
+pub const IPPROTO_PUP: ::c_int = 12;
+/// Argus
+pub const IPPROTO_ARGUS: ::c_int = 13;
+/// EMCON
+pub const IPPROTO_EMCON: ::c_int = 14;
+/// Cross Net Debugger
+pub const IPPROTO_XNET: ::c_int = 15;
+/// Chaos
+pub const IPPROTO_CHAOS: ::c_int = 16;
+// IPPROTO_UDP defined in src/unix/mod.rs
+/// Multiplexing
+pub const IPPROTO_MUX: ::c_int = 18;
+/// DCN Measurement Subsystems
+pub const IPPROTO_MEAS: ::c_int = 19;
+/// Host Monitoring
+pub const IPPROTO_HMP: ::c_int = 20;
+/// Packet Radio Measurement
+pub const IPPROTO_PRM: ::c_int = 21;
+/// xns idp
+pub const IPPROTO_IDP: ::c_int = 22;
+/// Trunk-1
+pub const IPPROTO_TRUNK1: ::c_int = 23;
+/// Trunk-2
+pub const IPPROTO_TRUNK2: ::c_int = 24;
+/// Leaf-1
+pub const IPPROTO_LEAF1: ::c_int = 25;
+/// Leaf-2
+pub const IPPROTO_LEAF2: ::c_int = 26;
+/// Reliable Data
+pub const IPPROTO_RDP: ::c_int = 27;
+/// Reliable Transaction
+pub const IPPROTO_IRTP: ::c_int = 28;
+/// tp-4 w/ class negotiation
+pub const IPPROTO_TP: ::c_int = 29;
+/// Bulk Data Transfer
+pub const IPPROTO_BLT: ::c_int = 30;
+/// Network Services
+pub const IPPROTO_NSP: ::c_int = 31;
+/// Merit Internodal
+pub const IPPROTO_INP: ::c_int = 32;
+/// Sequential Exchange
+pub const IPPROTO_SEP: ::c_int = 33;
+/// Third Party Connect
+pub const IPPROTO_3PC: ::c_int = 34;
+/// InterDomain Policy Routing
+pub const IPPROTO_IDPR: ::c_int = 35;
+/// XTP
+pub const IPPROTO_XTP: ::c_int = 36;
+/// Datagram Delivery
+pub const IPPROTO_DDP: ::c_int = 37;
+/// Control Message Transport
+pub const IPPROTO_CMTP: ::c_int = 38;
+/// TP++ Transport
+pub const IPPROTO_TPXX: ::c_int = 39;
+/// IL transport protocol
+pub const IPPROTO_IL: ::c_int = 40;
+// IPPROTO_IPV6 defined in src/unix/mod.rs
+/// Source Demand Routing
+pub const IPPROTO_SDRP: ::c_int = 42;
+/// IP6 routing header
+pub const IPPROTO_ROUTING: ::c_int = 43;
+/// IP6 fragmentation header
+pub const IPPROTO_FRAGMENT: ::c_int = 44;
+/// InterDomain Routing
+pub const IPPROTO_IDRP: ::c_int = 45;
+/// resource reservation
+pub const IPPROTO_RSVP: ::c_int = 46;
+/// General Routing Encap.
+pub const IPPROTO_GRE: ::c_int = 47;
+/// Mobile Host Routing
+pub const IPPROTO_MHRP: ::c_int = 48;
+/// BHA
+pub const IPPROTO_BHA: ::c_int = 49;
+/// IP6 Encap Sec. Payload
+pub const IPPROTO_ESP: ::c_int = 50;
+/// IP6 Auth Header
+pub const IPPROTO_AH: ::c_int = 51;
+/// Integ. Net Layer Security
+pub const IPPROTO_INLSP: ::c_int = 52;
+/// IP with encryption
+pub const IPPROTO_SWIPE: ::c_int = 53;
+/// Next Hop Resolution
+pub const IPPROTO_NHRP: ::c_int = 54;
+/* 55-57: Unassigned */
+// IPPROTO_ICMPV6 defined in src/unix/mod.rs
+/// IP6 no next header
+pub const IPPROTO_NONE: ::c_int = 59;
+/// IP6 destination option
+pub const IPPROTO_DSTOPTS: ::c_int = 60;
+/// any host internal protocol
+pub const IPPROTO_AHIP: ::c_int = 61;
+/// CFTP
+pub const IPPROTO_CFTP: ::c_int = 62;
+/// "hello" routing protocol
+pub const IPPROTO_HELLO: ::c_int = 63;
+/// SATNET/Backroom EXPAK
+pub const IPPROTO_SATEXPAK: ::c_int = 64;
+/// Kryptolan
+pub const IPPROTO_KRYPTOLAN: ::c_int = 65;
+/// Remote Virtual Disk
+pub const IPPROTO_RVD: ::c_int = 66;
+/// Pluribus Packet Core
+pub const IPPROTO_IPPC: ::c_int = 67;
+/// Any distributed FS
+pub const IPPROTO_ADFS: ::c_int = 68;
+/// Satnet Monitoring
+pub const IPPROTO_SATMON: ::c_int = 69;
+/// VISA Protocol
+pub const IPPROTO_VISA: ::c_int = 70;
+/// Packet Core Utility
+pub const IPPROTO_IPCV: ::c_int = 71;
+/// Comp. Prot. Net. Executive
+pub const IPPROTO_CPNX: ::c_int = 72;
+/// Comp. Prot. HeartBeat
+pub const IPPROTO_CPHB: ::c_int = 73;
+/// Wang Span Network
+pub const IPPROTO_WSN: ::c_int = 74;
+/// Packet Video Protocol
+pub const IPPROTO_PVP: ::c_int = 75;
+/// BackRoom SATNET Monitoring
+pub const IPPROTO_BRSATMON: ::c_int = 76;
+/// Sun net disk proto (temp.)
+pub const IPPROTO_ND: ::c_int = 77;
+/// WIDEBAND Monitoring
+pub const IPPROTO_WBMON: ::c_int = 78;
+/// WIDEBAND EXPAK
+pub const IPPROTO_WBEXPAK: ::c_int = 79;
+/// ISO cnlp
+pub const IPPROTO_EON: ::c_int = 80;
+/// VMTP
+pub const IPPROTO_VMTP: ::c_int = 81;
+/// Secure VMTP
+pub const IPPROTO_SVMTP: ::c_int = 82;
+/// Banyon VINES
+pub const IPPROTO_VINES: ::c_int = 83;
+/// TTP
+pub const IPPROTO_TTP: ::c_int = 84;
+/// NSFNET-IGP
+pub const IPPROTO_IGP: ::c_int = 85;
+/// dissimilar gateway prot.
+pub const IPPROTO_DGP: ::c_int = 86;
+/// TCF
+pub const IPPROTO_TCF: ::c_int = 87;
+/// Cisco/GXS IGRP
+pub const IPPROTO_IGRP: ::c_int = 88;
+/// OSPFIGP
+pub const IPPROTO_OSPFIGP: ::c_int = 89;
+/// Strite RPC protocol
+pub const IPPROTO_SRPC: ::c_int = 90;
+/// Locus Address Resoloution
+pub const IPPROTO_LARP: ::c_int = 91;
+/// Multicast Transport
+pub const IPPROTO_MTP: ::c_int = 92;
+/// AX.25 Frames
+pub const IPPROTO_AX25: ::c_int = 93;
+/// IP encapsulated in IP
+pub const IPPROTO_IPEIP: ::c_int = 94;
+/// Mobile Int.ing control
+pub const IPPROTO_MICP: ::c_int = 95;
+/// Semaphore Comm. security
+pub const IPPROTO_SCCSP: ::c_int = 96;
+/// Ethernet IP encapsulation
+pub const IPPROTO_ETHERIP: ::c_int = 97;
+/// encapsulation header
+pub const IPPROTO_ENCAP: ::c_int = 98;
+/// any private encr. scheme
+pub const IPPROTO_APES: ::c_int = 99;
+/// GMTP
+pub const IPPROTO_GMTP: ::c_int = 100;
+
+/* 101-254: Partly Unassigned */
+/// Protocol Independent Mcast
+pub const IPPROTO_PIM: ::c_int = 103;
+/// payload compression (IPComp)
+pub const IPPROTO_IPCOMP: ::c_int = 108;
+/// PGM
+pub const IPPROTO_PGM: ::c_int = 113;
+/// SCTP
+pub const IPPROTO_SCTP: ::c_int = 132;
+
+/* 255: Reserved */
+/* BSD Private, local use, namespace incursion */
+/// divert pseudo-protocol
+pub const IPPROTO_DIVERT: ::c_int = 254;
+/// raw IP packet
+pub const IPPROTO_RAW: ::c_int = 255;
+pub const IPPROTO_MAX: ::c_int = 256;
+/// last return value of *_input(), meaning "all job for this pkt is done".
+pub const IPPROTO_DONE: ::c_int = 257;
+
+pub const AF_UNSPEC: ::c_int = 0;
+pub const AF_LOCAL: ::c_int = 1;
+pub const AF_UNIX: ::c_int = AF_LOCAL;
+pub const AF_INET: ::c_int = 2;
+pub const AF_IMPLINK: ::c_int = 3;
+pub const AF_PUP: ::c_int = 4;
+pub const AF_CHAOS: ::c_int = 5;
+pub const AF_NS: ::c_int = 6;
+pub const AF_ISO: ::c_int = 7;
+pub const AF_OSI: ::c_int = AF_ISO;
+pub const AF_ECMA: ::c_int = 8;
+pub const AF_DATAKIT: ::c_int = 9;
+pub const AF_CCITT: ::c_int = 10;
+pub const AF_SNA: ::c_int = 11;
+pub const AF_DECnet: ::c_int = 12;
+pub const AF_DLI: ::c_int = 13;
+pub const AF_LAT: ::c_int = 14;
+pub const AF_HYLINK: ::c_int = 15;
+pub const AF_APPLETALK: ::c_int = 16;
+pub const AF_ROUTE: ::c_int = 17;
+pub const AF_LINK: ::c_int = 18;
+pub const pseudo_AF_XTP: ::c_int = 19;
+pub const AF_COIP: ::c_int = 20;
+pub const AF_CNT: ::c_int = 21;
+pub const pseudo_AF_RTIP: ::c_int = 22;
+pub const AF_IPX: ::c_int = 23;
+pub const AF_SIP: ::c_int = 24;
+pub const pseudo_AF_PIP: ::c_int = 25;
+pub const AF_NDRV: ::c_int = 27;
+pub const AF_ISDN: ::c_int = 28;
+pub const AF_E164: ::c_int = AF_ISDN;
+pub const pseudo_AF_KEY: ::c_int = 29;
+pub const AF_INET6: ::c_int = 30;
+pub const AF_NATM: ::c_int = 31;
+pub const AF_SYSTEM: ::c_int = 32;
+pub const AF_NETBIOS: ::c_int = 33;
+pub const AF_PPP: ::c_int = 34;
+pub const pseudo_AF_HDRCMPLT: ::c_int = 35;
+pub const AF_IEEE80211: ::c_int = 37;
+pub const AF_UTUN: ::c_int = 38;
+pub const AF_VSOCK: ::c_int = 40;
+pub const AF_SYS_CONTROL: ::c_int = 2;
+
+pub const SYSPROTO_EVENT: ::c_int = 1;
+pub const SYSPROTO_CONTROL: ::c_int = 2;
+
+pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
+pub const PF_LOCAL: ::c_int = AF_LOCAL;
+pub const PF_UNIX: ::c_int = PF_LOCAL;
+pub const PF_INET: ::c_int = AF_INET;
+pub const PF_IMPLINK: ::c_int = AF_IMPLINK;
+pub const PF_PUP: ::c_int = AF_PUP;
+pub const PF_CHAOS: ::c_int = AF_CHAOS;
+pub const PF_NS: ::c_int = AF_NS;
+pub const PF_ISO: ::c_int = AF_ISO;
+pub const PF_OSI: ::c_int = AF_ISO;
+pub const PF_ECMA: ::c_int = AF_ECMA;
+pub const PF_DATAKIT: ::c_int = AF_DATAKIT;
+pub const PF_CCITT: ::c_int = AF_CCITT;
+pub const PF_SNA: ::c_int = AF_SNA;
+pub const PF_DECnet: ::c_int = AF_DECnet;
+pub const PF_DLI: ::c_int = AF_DLI;
+pub const PF_LAT: ::c_int = AF_LAT;
+pub const PF_HYLINK: ::c_int = AF_HYLINK;
+pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
+pub const PF_ROUTE: ::c_int = AF_ROUTE;
+pub const PF_LINK: ::c_int = AF_LINK;
+pub const PF_XTP: ::c_int = pseudo_AF_XTP;
+pub const PF_COIP: ::c_int = AF_COIP;
+pub const PF_CNT: ::c_int = AF_CNT;
+pub const PF_SIP: ::c_int = AF_SIP;
+pub const PF_IPX: ::c_int = AF_IPX;
+pub const PF_RTIP: ::c_int = pseudo_AF_RTIP;
+pub const PF_PIP: ::c_int = pseudo_AF_PIP;
+pub const PF_NDRV: ::c_int = AF_NDRV;
+pub const PF_ISDN: ::c_int = AF_ISDN;
+pub const PF_KEY: ::c_int = pseudo_AF_KEY;
+pub const PF_INET6: ::c_int = AF_INET6;
+pub const PF_NATM: ::c_int = AF_NATM;
+pub const PF_SYSTEM: ::c_int = AF_SYSTEM;
+pub const PF_NETBIOS: ::c_int = AF_NETBIOS;
+pub const PF_PPP: ::c_int = AF_PPP;
+pub const PF_VSOCK: ::c_int = AF_VSOCK;
+
+pub const NET_RT_DUMP: ::c_int = 1;
+pub const NET_RT_FLAGS: ::c_int = 2;
+pub const NET_RT_IFLIST: ::c_int = 3;
+
+pub const SOMAXCONN: ::c_int = 128;
+
+pub const SOCK_MAXADDRLEN: ::c_int = 255;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+pub const SOCK_RAW: ::c_int = 3;
+pub const SOCK_RDM: ::c_int = 4;
+pub const SOCK_SEQPACKET: ::c_int = 5;
+pub const IP_TTL: ::c_int = 4;
+pub const IP_HDRINCL: ::c_int = 2;
+pub const IP_RECVDSTADDR: ::c_int = 7;
+pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
+pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
+pub const IP_RECVIF: ::c_int = 20;
+pub const IP_RECVTTL: ::c_int = 24;
+pub const IP_BOUND_IF: ::c_int = 25;
+pub const IP_PKTINFO: ::c_int = 26;
+pub const IP_RECVTOS: ::c_int = 27;
+pub const IP_DONTFRAG: ::c_int = 28;
+pub const IPV6_JOIN_GROUP: ::c_int = 12;
+pub const IPV6_LEAVE_GROUP: ::c_int = 13;
+pub const IPV6_CHECKSUM: ::c_int = 26;
+pub const IPV6_RECVTCLASS: ::c_int = 35;
+pub const IPV6_TCLASS: ::c_int = 36;
+pub const IPV6_RECVHOPLIMIT: ::c_int = 37;
+pub const IPV6_PKTINFO: ::c_int = 46;
+pub const IPV6_HOPLIMIT: ::c_int = 47;
+pub const IPV6_RECVPKTINFO: ::c_int = 61;
+pub const IPV6_DONTFRAG: ::c_int = 62;
+pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 70;
+pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 71;
+pub const IP_BLOCK_SOURCE: ::c_int = 72;
+pub const IP_UNBLOCK_SOURCE: ::c_int = 73;
+pub const IPV6_BOUND_IF: ::c_int = 125;
+
+pub const TCP_NOPUSH: ::c_int = 4;
+pub const TCP_NOOPT: ::c_int = 8;
+pub const TCP_KEEPALIVE: ::c_int = 0x10;
+pub const TCP_KEEPINTVL: ::c_int = 0x101;
+pub const TCP_KEEPCNT: ::c_int = 0x102;
+/// Enable/Disable TCP Fastopen on this socket
+pub const TCP_FASTOPEN: ::c_int = 0x105;
+pub const TCP_CONNECTION_INFO: ::c_int = 0x106;
+
+pub const SOL_LOCAL: ::c_int = 0;
+
+pub const LOCAL_PEERCRED: ::c_int = 0x001;
+pub const LOCAL_PEERPID: ::c_int = 0x002;
+pub const LOCAL_PEEREPID: ::c_int = 0x003;
+pub const LOCAL_PEERUUID: ::c_int = 0x004;
+pub const LOCAL_PEEREUUID: ::c_int = 0x005;
+
+pub const SOL_SOCKET: ::c_int = 0xffff;
+
+pub const SO_DEBUG: ::c_int = 0x01;
+pub const SO_ACCEPTCONN: ::c_int = 0x0002;
+pub const SO_REUSEADDR: ::c_int = 0x0004;
+pub const SO_KEEPALIVE: ::c_int = 0x0008;
+pub const SO_DONTROUTE: ::c_int = 0x0010;
+pub const SO_BROADCAST: ::c_int = 0x0020;
+pub const SO_USELOOPBACK: ::c_int = 0x0040;
+pub const SO_LINGER: ::c_int = 0x0080;
+pub const SO_OOBINLINE: ::c_int = 0x0100;
+pub const SO_REUSEPORT: ::c_int = 0x0200;
+pub const SO_TIMESTAMP: ::c_int = 0x0400;
+pub const SO_TIMESTAMP_MONOTONIC: ::c_int = 0x0800;
+pub const SO_DONTTRUNC: ::c_int = 0x2000;
+pub const SO_WANTMORE: ::c_int = 0x4000;
+pub const SO_WANTOOBFLAG: ::c_int = 0x8000;
+pub const SO_SNDBUF: ::c_int = 0x1001;
+pub const SO_RCVBUF: ::c_int = 0x1002;
+pub const SO_SNDLOWAT: ::c_int = 0x1003;
+pub const SO_RCVLOWAT: ::c_int = 0x1004;
+pub const SO_SNDTIMEO: ::c_int = 0x1005;
+pub const SO_RCVTIMEO: ::c_int = 0x1006;
+pub const SO_ERROR: ::c_int = 0x1007;
+pub const SO_TYPE: ::c_int = 0x1008;
+pub const SO_LABEL: ::c_int = 0x1010;
+pub const SO_PEERLABEL: ::c_int = 0x1011;
+pub const SO_NREAD: ::c_int = 0x1020;
+pub const SO_NKE: ::c_int = 0x1021;
+pub const SO_NOSIGPIPE: ::c_int = 0x1022;
+pub const SO_NOADDRERR: ::c_int = 0x1023;
+pub const SO_NWRITE: ::c_int = 0x1024;
+pub const SO_REUSESHAREUID: ::c_int = 0x1025;
+pub const SO_NOTIFYCONFLICT: ::c_int = 0x1026;
+pub const SO_LINGER_SEC: ::c_int = 0x1080;
+pub const SO_RANDOMPORT: ::c_int = 0x1082;
+pub const SO_NP_EXTENSIONS: ::c_int = 0x1083;
+
+pub const MSG_OOB: ::c_int = 0x1;
+pub const MSG_PEEK: ::c_int = 0x2;
+pub const MSG_DONTROUTE: ::c_int = 0x4;
+pub const MSG_EOR: ::c_int = 0x8;
+pub const MSG_TRUNC: ::c_int = 0x10;
+pub const MSG_CTRUNC: ::c_int = 0x20;
+pub const MSG_WAITALL: ::c_int = 0x40;
+pub const MSG_DONTWAIT: ::c_int = 0x80;
+pub const MSG_EOF: ::c_int = 0x100;
+pub const MSG_FLUSH: ::c_int = 0x400;
+pub const MSG_HOLD: ::c_int = 0x800;
+pub const MSG_SEND: ::c_int = 0x1000;
+pub const MSG_HAVEMORE: ::c_int = 0x2000;
+pub const MSG_RCVMORE: ::c_int = 0x4000;
+pub const MSG_NEEDSA: ::c_int = 0x10000;
+pub const MSG_NOSIGNAL: ::c_int = 0x80000;
+
+pub const SCM_TIMESTAMP: ::c_int = 0x02;
+pub const SCM_CREDS: ::c_int = 0x03;
+
+// https://github.com/aosm/xnu/blob/HEAD/bsd/net/if.h#L140-L156
+pub const IFF_UP: ::c_int = 0x1; // interface is up
+pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid
+pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging
+pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net
+pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link
+pub const IFF_NOTRAILERS: ::c_int = 0x20; // obsolete: avoid use of trailers
+pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated
+pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol
+pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets
+pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets
+pub const IFF_OACTIVE: ::c_int = 0x400; // transmission in progress
+pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions
+pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
+pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
+pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
+pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection
+pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
+
+pub const SHUT_RD: ::c_int = 0;
+pub const SHUT_WR: ::c_int = 1;
+pub const SHUT_RDWR: ::c_int = 2;
+
+pub const SAE_ASSOCID_ANY: ::sae_associd_t = 0;
+/// ((sae_associd_t)(-1ULL))
+pub const SAE_ASSOCID_ALL: ::sae_associd_t = 0xffffffff;
+
+pub const SAE_CONNID_ANY: ::sae_connid_t = 0;
+/// ((sae_connid_t)(-1ULL))
+pub const SAE_CONNID_ALL: ::sae_connid_t = 0xffffffff;
+
+// connectx() flag parameters
+
+/// resume connect() on read/write
+pub const CONNECT_RESUME_ON_READ_WRITE: ::c_uint = 0x1;
+/// data is idempotent
+pub const CONNECT_DATA_IDEMPOTENT: ::c_uint = 0x2;
+/// data includes security that replaces the TFO-cookie
+pub const CONNECT_DATA_AUTHENTICATED: ::c_uint = 0x4;
+
+pub const LOCK_SH: ::c_int = 1;
+pub const LOCK_EX: ::c_int = 2;
+pub const LOCK_NB: ::c_int = 4;
+pub const LOCK_UN: ::c_int = 8;
+
+pub const MAP_COPY: ::c_int = 0x0002;
+pub const MAP_RENAME: ::c_int = 0x0020;
+pub const MAP_NORESERVE: ::c_int = 0x0040;
+pub const MAP_NOEXTEND: ::c_int = 0x0100;
+pub const MAP_HASSEMAPHORE: ::c_int = 0x0200;
+pub const MAP_NOCACHE: ::c_int = 0x0400;
+pub const MAP_JIT: ::c_int = 0x0800;
+
+pub const _SC_ARG_MAX: ::c_int = 1;
+pub const _SC_CHILD_MAX: ::c_int = 2;
+pub const _SC_CLK_TCK: ::c_int = 3;
+pub const _SC_NGROUPS_MAX: ::c_int = 4;
+pub const _SC_OPEN_MAX: ::c_int = 5;
+pub const _SC_JOB_CONTROL: ::c_int = 6;
+pub const _SC_SAVED_IDS: ::c_int = 7;
+pub const _SC_VERSION: ::c_int = 8;
+pub const _SC_BC_BASE_MAX: ::c_int = 9;
+pub const _SC_BC_DIM_MAX: ::c_int = 10;
+pub const _SC_BC_SCALE_MAX: ::c_int = 11;
+pub const _SC_BC_STRING_MAX: ::c_int = 12;
+pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13;
+pub const _SC_EXPR_NEST_MAX: ::c_int = 14;
+pub const _SC_LINE_MAX: ::c_int = 15;
+pub const _SC_RE_DUP_MAX: ::c_int = 16;
+pub const _SC_2_VERSION: ::c_int = 17;
+pub const _SC_2_C_BIND: ::c_int = 18;
+pub const _SC_2_C_DEV: ::c_int = 19;
+pub const _SC_2_CHAR_TERM: ::c_int = 20;
+pub const _SC_2_FORT_DEV: ::c_int = 21;
+pub const _SC_2_FORT_RUN: ::c_int = 22;
+pub const _SC_2_LOCALEDEF: ::c_int = 23;
+pub const _SC_2_SW_DEV: ::c_int = 24;
+pub const _SC_2_UPE: ::c_int = 25;
+pub const _SC_STREAM_MAX: ::c_int = 26;
+pub const _SC_TZNAME_MAX: ::c_int = 27;
+pub const _SC_ASYNCHRONOUS_IO: ::c_int = 28;
+pub const _SC_PAGESIZE: ::c_int = 29;
+pub const _SC_MEMLOCK: ::c_int = 30;
+pub const _SC_MEMLOCK_RANGE: ::c_int = 31;
+pub const _SC_MEMORY_PROTECTION: ::c_int = 32;
+pub const _SC_MESSAGE_PASSING: ::c_int = 33;
+pub const _SC_PRIORITIZED_IO: ::c_int = 34;
+pub const _SC_PRIORITY_SCHEDULING: ::c_int = 35;
+pub const _SC_REALTIME_SIGNALS: ::c_int = 36;
+pub const _SC_SEMAPHORES: ::c_int = 37;
+pub const _SC_FSYNC: ::c_int = 38;
+pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 39;
+pub const _SC_SYNCHRONIZED_IO: ::c_int = 40;
+pub const _SC_TIMERS: ::c_int = 41;
+pub const _SC_AIO_LISTIO_MAX: ::c_int = 42;
+pub const _SC_AIO_MAX: ::c_int = 43;
+pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44;
+pub const _SC_DELAYTIMER_MAX: ::c_int = 45;
+pub const _SC_MQ_OPEN_MAX: ::c_int = 46;
+pub const _SC_MAPPED_FILES: ::c_int = 47;
+pub const _SC_RTSIG_MAX: ::c_int = 48;
+pub const _SC_SEM_NSEMS_MAX: ::c_int = 49;
+pub const _SC_SEM_VALUE_MAX: ::c_int = 50;
+pub const _SC_SIGQUEUE_MAX: ::c_int = 51;
+pub const _SC_TIMER_MAX: ::c_int = 52;
+pub const _SC_NPROCESSORS_CONF: ::c_int = 57;
+pub const _SC_NPROCESSORS_ONLN: ::c_int = 58;
+pub const _SC_2_PBS: ::c_int = 59;
+pub const _SC_2_PBS_ACCOUNTING: ::c_int = 60;
+pub const _SC_2_PBS_CHECKPOINT: ::c_int = 61;
+pub const _SC_2_PBS_LOCATE: ::c_int = 62;
+pub const _SC_2_PBS_MESSAGE: ::c_int = 63;
+pub const _SC_2_PBS_TRACK: ::c_int = 64;
+pub const _SC_ADVISORY_INFO: ::c_int = 65;
+pub const _SC_BARRIERS: ::c_int = 66;
+pub const _SC_CLOCK_SELECTION: ::c_int = 67;
+pub const _SC_CPUTIME: ::c_int = 68;
+pub const _SC_FILE_LOCKING: ::c_int = 69;
+pub const _SC_HOST_NAME_MAX: ::c_int = 72;
+pub const _SC_MONOTONIC_CLOCK: ::c_int = 74;
+pub const _SC_READER_WRITER_LOCKS: ::c_int = 76;
+pub const _SC_REGEXP: ::c_int = 77;
+pub const _SC_SHELL: ::c_int = 78;
+pub const _SC_SPAWN: ::c_int = 79;
+pub const _SC_SPIN_LOCKS: ::c_int = 80;
+pub const _SC_SPORADIC_SERVER: ::c_int = 81;
+pub const _SC_THREAD_CPUTIME: ::c_int = 84;
+pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 92;
+pub const _SC_TIMEOUTS: ::c_int = 95;
+pub const _SC_TRACE: ::c_int = 97;
+pub const _SC_TRACE_EVENT_FILTER: ::c_int = 98;
+pub const _SC_TRACE_INHERIT: ::c_int = 99;
+pub const _SC_TRACE_LOG: ::c_int = 100;
+pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 102;
+pub const _SC_V6_ILP32_OFF32: ::c_int = 103;
+pub const _SC_V6_ILP32_OFFBIG: ::c_int = 104;
+pub const _SC_V6_LP64_OFF64: ::c_int = 105;
+pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 106;
+pub const _SC_IPV6: ::c_int = 118;
+pub const _SC_RAW_SOCKETS: ::c_int = 119;
+pub const _SC_SYMLOOP_MAX: ::c_int = 120;
+pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
+pub const _SC_XOPEN_STREAMS: ::c_int = 114;
+pub const _SC_XBS5_ILP32_OFF32: ::c_int = 122;
+pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 123;
+pub const _SC_XBS5_LP64_OFF64: ::c_int = 124;
+pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 125;
+pub const _SC_SS_REPL_MAX: ::c_int = 126;
+pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 127;
+pub const _SC_TRACE_NAME_MAX: ::c_int = 128;
+pub const _SC_TRACE_SYS_MAX: ::c_int = 129;
+pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 130;
+pub const _SC_PASS_MAX: ::c_int = 131;
+// `confstr` keys (only the values guaranteed by `man confstr`).
+pub const _CS_PATH: ::c_int = 1;
+pub const _CS_DARWIN_USER_DIR: ::c_int = 65536;
+pub const _CS_DARWIN_USER_TEMP_DIR: ::c_int = 65537;
+pub const _CS_DARWIN_USER_CACHE_DIR: ::c_int = 65538;
+
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
+pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
+pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
+pub const _PTHREAD_MUTEX_SIG_init: ::c_long = 0x32AAABA7;
+pub const _PTHREAD_COND_SIG_init: ::c_long = 0x3CB0B1BB;
+pub const _PTHREAD_RWLOCK_SIG_init: ::c_long = 0x2DA8B3B4;
+pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+    __sig: _PTHREAD_MUTEX_SIG_init,
+    __opaque: [0; __PTHREAD_MUTEX_SIZE__],
+};
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+    __sig: _PTHREAD_COND_SIG_init,
+    __opaque: [0; __PTHREAD_COND_SIZE__],
+};
+pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+    __sig: _PTHREAD_RWLOCK_SIG_init,
+    __opaque: [0; __PTHREAD_RWLOCK_SIZE__],
+};
+
+pub const OS_UNFAIR_LOCK_INIT: os_unfair_lock = os_unfair_lock {
+    _os_unfair_lock_opaque: 0,
+};
+
+pub const OS_LOG_TYPE_DEFAULT: ::os_log_type_t = 0x00;
+pub const OS_LOG_TYPE_INFO: ::os_log_type_t = 0x01;
+pub const OS_LOG_TYPE_DEBUG: ::os_log_type_t = 0x02;
+pub const OS_LOG_TYPE_ERROR: ::os_log_type_t = 0x10;
+pub const OS_LOG_TYPE_FAULT: ::os_log_type_t = 0x11;
+
+pub const OS_SIGNPOST_EVENT: ::os_signpost_type_t = 0x00;
+pub const OS_SIGNPOST_INTERVAL_BEGIN: ::os_signpost_type_t = 0x01;
+pub const OS_SIGNPOST_INTERVAL_END: ::os_signpost_type_t = 0x02;
+
+pub const MINSIGSTKSZ: ::size_t = 32768;
+pub const SIGSTKSZ: ::size_t = 131072;
+
+pub const FD_SETSIZE: usize = 1024;
+
+pub const ST_NOSUID: ::c_ulong = 2;
+
+pub const SCHED_OTHER: ::c_int = 1;
+pub const SCHED_FIFO: ::c_int = 4;
+pub const SCHED_RR: ::c_int = 2;
+
+pub const EVFILT_READ: i16 = -1;
+pub const EVFILT_WRITE: i16 = -2;
+pub const EVFILT_AIO: i16 = -3;
+pub const EVFILT_VNODE: i16 = -4;
+pub const EVFILT_PROC: i16 = -5;
+pub const EVFILT_SIGNAL: i16 = -6;
+pub const EVFILT_TIMER: i16 = -7;
+pub const EVFILT_MACHPORT: i16 = -8;
+pub const EVFILT_FS: i16 = -9;
+pub const EVFILT_USER: i16 = -10;
+pub const EVFILT_VM: i16 = -12;
+
+pub const EV_ADD: u16 = 0x1;
+pub const EV_DELETE: u16 = 0x2;
+pub const EV_ENABLE: u16 = 0x4;
+pub const EV_DISABLE: u16 = 0x8;
+pub const EV_ONESHOT: u16 = 0x10;
+pub const EV_CLEAR: u16 = 0x20;
+pub const EV_RECEIPT: u16 = 0x40;
+pub const EV_DISPATCH: u16 = 0x80;
+pub const EV_FLAG0: u16 = 0x1000;
+pub const EV_POLL: u16 = 0x1000;
+pub const EV_FLAG1: u16 = 0x2000;
+pub const EV_OOBAND: u16 = 0x2000;
+pub const EV_ERROR: u16 = 0x4000;
+pub const EV_EOF: u16 = 0x8000;
+pub const EV_SYSFLAGS: u16 = 0xf000;
+
+pub const NOTE_TRIGGER: u32 = 0x01000000;
+pub const NOTE_FFNOP: u32 = 0x00000000;
+pub const NOTE_FFAND: u32 = 0x40000000;
+pub const NOTE_FFOR: u32 = 0x80000000;
+pub const NOTE_FFCOPY: u32 = 0xc0000000;
+pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
+pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
+pub const NOTE_LOWAT: u32 = 0x00000001;
+pub const NOTE_DELETE: u32 = 0x00000001;
+pub const NOTE_WRITE: u32 = 0x00000002;
+pub const NOTE_EXTEND: u32 = 0x00000004;
+pub const NOTE_ATTRIB: u32 = 0x00000008;
+pub const NOTE_LINK: u32 = 0x00000010;
+pub const NOTE_RENAME: u32 = 0x00000020;
+pub const NOTE_REVOKE: u32 = 0x00000040;
+pub const NOTE_NONE: u32 = 0x00000080;
+pub const NOTE_EXIT: u32 = 0x80000000;
+pub const NOTE_FORK: u32 = 0x40000000;
+pub const NOTE_EXEC: u32 = 0x20000000;
+#[doc(hidden)]
+#[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")]
+pub const NOTE_REAP: u32 = 0x10000000;
+pub const NOTE_SIGNAL: u32 = 0x08000000;
+pub const NOTE_EXITSTATUS: u32 = 0x04000000;
+pub const NOTE_EXIT_DETAIL: u32 = 0x02000000;
+pub const NOTE_PDATAMASK: u32 = 0x000fffff;
+pub const NOTE_PCTRLMASK: u32 = 0xfff00000;
+#[doc(hidden)]
+#[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")]
+pub const NOTE_EXIT_REPARENTED: u32 = 0x00080000;
+pub const NOTE_EXIT_DETAIL_MASK: u32 = 0x00070000;
+pub const NOTE_EXIT_DECRYPTFAIL: u32 = 0x00010000;
+pub const NOTE_EXIT_MEMORY: u32 = 0x00020000;
+pub const NOTE_EXIT_CSERROR: u32 = 0x00040000;
+pub const NOTE_VM_PRESSURE: u32 = 0x80000000;
+pub const NOTE_VM_PRESSURE_TERMINATE: u32 = 0x40000000;
+pub const NOTE_VM_PRESSURE_SUDDEN_TERMINATE: u32 = 0x20000000;
+pub const NOTE_VM_ERROR: u32 = 0x10000000;
+pub const NOTE_SECONDS: u32 = 0x00000001;
+pub const NOTE_USECONDS: u32 = 0x00000002;
+pub const NOTE_NSECONDS: u32 = 0x00000004;
+pub const NOTE_ABSOLUTE: u32 = 0x00000008;
+pub const NOTE_LEEWAY: u32 = 0x00000010;
+pub const NOTE_CRITICAL: u32 = 0x00000020;
+pub const NOTE_BACKGROUND: u32 = 0x00000040;
+pub const NOTE_TRACK: u32 = 0x00000001;
+pub const NOTE_TRACKERR: u32 = 0x00000002;
+pub const NOTE_CHILD: u32 = 0x00000004;
+
+pub const OCRNL: ::tcflag_t = 0x00000010;
+pub const ONOCR: ::tcflag_t = 0x00000020;
+pub const ONLRET: ::tcflag_t = 0x00000040;
+pub const OFILL: ::tcflag_t = 0x00000080;
+pub const NLDLY: ::tcflag_t = 0x00000300;
+pub const TABDLY: ::tcflag_t = 0x00000c04;
+pub const CRDLY: ::tcflag_t = 0x00003000;
+pub const FFDLY: ::tcflag_t = 0x00004000;
+pub const BSDLY: ::tcflag_t = 0x00008000;
+pub const VTDLY: ::tcflag_t = 0x00010000;
+pub const OFDEL: ::tcflag_t = 0x00020000;
+
+pub const NL0: ::tcflag_t = 0x00000000;
+pub const NL1: ::tcflag_t = 0x00000100;
+pub const TAB0: ::tcflag_t = 0x00000000;
+pub const TAB1: ::tcflag_t = 0x00000400;
+pub const TAB2: ::tcflag_t = 0x00000800;
+pub const CR0: ::tcflag_t = 0x00000000;
+pub const CR1: ::tcflag_t = 0x00001000;
+pub const CR2: ::tcflag_t = 0x00002000;
+pub const CR3: ::tcflag_t = 0x00003000;
+pub const FF0: ::tcflag_t = 0x00000000;
+pub const FF1: ::tcflag_t = 0x00004000;
+pub const BS0: ::tcflag_t = 0x00000000;
+pub const BS1: ::tcflag_t = 0x00008000;
+pub const TAB3: ::tcflag_t = 0x00000004;
+pub const VT0: ::tcflag_t = 0x00000000;
+pub const VT1: ::tcflag_t = 0x00010000;
+pub const IUTF8: ::tcflag_t = 0x00004000;
+pub const CRTSCTS: ::tcflag_t = 0x00030000;
+
+pub const NI_MAXHOST: ::socklen_t = 1025;
+pub const NI_MAXSERV: ::socklen_t = 32;
+pub const NI_NOFQDN: ::c_int = 0x00000001;
+pub const NI_NUMERICHOST: ::c_int = 0x00000002;
+pub const NI_NAMEREQD: ::c_int = 0x00000004;
+pub const NI_NUMERICSERV: ::c_int = 0x00000008;
+pub const NI_NUMERICSCOPE: ::c_int = 0x00000100;
+pub const NI_DGRAM: ::c_int = 0x00000010;
+
+pub const Q_GETQUOTA: ::c_int = 0x300;
+pub const Q_SETQUOTA: ::c_int = 0x400;
+
+pub const RENAME_SWAP: ::c_uint = 0x00000002;
+pub const RENAME_EXCL: ::c_uint = 0x00000004;
+
+pub const RTLD_LOCAL: ::c_int = 0x4;
+pub const RTLD_FIRST: ::c_int = 0x100;
+pub const RTLD_NODELETE: ::c_int = 0x80;
+pub const RTLD_NOLOAD: ::c_int = 0x10;
+pub const RTLD_GLOBAL: ::c_int = 0x8;
+pub const RTLD_MAIN_ONLY: *mut ::c_void = -5isize as *mut ::c_void;
+
+pub const _WSTOPPED: ::c_int = 0o177;
+
+pub const LOG_NETINFO: ::c_int = 12 << 3;
+pub const LOG_REMOTEAUTH: ::c_int = 13 << 3;
+pub const LOG_INSTALL: ::c_int = 14 << 3;
+pub const LOG_RAS: ::c_int = 15 << 3;
+pub const LOG_LAUNCHD: ::c_int = 24 << 3;
+pub const LOG_NFACILITIES: ::c_int = 25;
+
+pub const CTLTYPE: ::c_int = 0xf;
+pub const CTLTYPE_NODE: ::c_int = 1;
+pub const CTLTYPE_INT: ::c_int = 2;
+pub const CTLTYPE_STRING: ::c_int = 3;
+pub const CTLTYPE_QUAD: ::c_int = 4;
+pub const CTLTYPE_OPAQUE: ::c_int = 5;
+pub const CTLTYPE_STRUCT: ::c_int = CTLTYPE_OPAQUE;
+pub const CTLFLAG_RD: ::c_int = 0x80000000;
+pub const CTLFLAG_WR: ::c_int = 0x40000000;
+pub const CTLFLAG_RW: ::c_int = CTLFLAG_RD | CTLFLAG_WR;
+pub const CTLFLAG_NOLOCK: ::c_int = 0x20000000;
+pub const CTLFLAG_ANYBODY: ::c_int = 0x10000000;
+pub const CTLFLAG_SECURE: ::c_int = 0x08000000;
+pub const CTLFLAG_MASKED: ::c_int = 0x04000000;
+pub const CTLFLAG_NOAUTO: ::c_int = 0x02000000;
+pub const CTLFLAG_KERN: ::c_int = 0x01000000;
+pub const CTLFLAG_LOCKED: ::c_int = 0x00800000;
+pub const CTLFLAG_OID2: ::c_int = 0x00400000;
+pub const CTL_UNSPEC: ::c_int = 0;
+pub const CTL_KERN: ::c_int = 1;
+pub const CTL_VM: ::c_int = 2;
+pub const CTL_VFS: ::c_int = 3;
+pub const CTL_NET: ::c_int = 4;
+pub const CTL_DEBUG: ::c_int = 5;
+pub const CTL_HW: ::c_int = 6;
+pub const CTL_MACHDEP: ::c_int = 7;
+pub const CTL_USER: ::c_int = 8;
+pub const CTL_MAXID: ::c_int = 9;
+pub const KERN_OSTYPE: ::c_int = 1;
+pub const KERN_OSRELEASE: ::c_int = 2;
+pub const KERN_OSREV: ::c_int = 3;
+pub const KERN_VERSION: ::c_int = 4;
+pub const KERN_MAXVNODES: ::c_int = 5;
+pub const KERN_MAXPROC: ::c_int = 6;
+pub const KERN_MAXFILES: ::c_int = 7;
+pub const KERN_ARGMAX: ::c_int = 8;
+pub const KERN_SECURELVL: ::c_int = 9;
+pub const KERN_HOSTNAME: ::c_int = 10;
+pub const KERN_HOSTID: ::c_int = 11;
+pub const KERN_CLOCKRATE: ::c_int = 12;
+pub const KERN_VNODE: ::c_int = 13;
+pub const KERN_PROC: ::c_int = 14;
+pub const KERN_FILE: ::c_int = 15;
+pub const KERN_PROF: ::c_int = 16;
+pub const KERN_POSIX1: ::c_int = 17;
+pub const KERN_NGROUPS: ::c_int = 18;
+pub const KERN_JOB_CONTROL: ::c_int = 19;
+pub const KERN_SAVED_IDS: ::c_int = 20;
+pub const KERN_BOOTTIME: ::c_int = 21;
+pub const KERN_NISDOMAINNAME: ::c_int = 22;
+pub const KERN_DOMAINNAME: ::c_int = KERN_NISDOMAINNAME;
+pub const KERN_MAXPARTITIONS: ::c_int = 23;
+pub const KERN_KDEBUG: ::c_int = 24;
+pub const KERN_UPDATEINTERVAL: ::c_int = 25;
+pub const KERN_OSRELDATE: ::c_int = 26;
+pub const KERN_NTP_PLL: ::c_int = 27;
+pub const KERN_BOOTFILE: ::c_int = 28;
+pub const KERN_MAXFILESPERPROC: ::c_int = 29;
+pub const KERN_MAXPROCPERUID: ::c_int = 30;
+pub const KERN_DUMPDEV: ::c_int = 31;
+pub const KERN_IPC: ::c_int = 32;
+pub const KERN_DUMMY: ::c_int = 33;
+pub const KERN_PS_STRINGS: ::c_int = 34;
+pub const KERN_USRSTACK32: ::c_int = 35;
+pub const KERN_LOGSIGEXIT: ::c_int = 36;
+pub const KERN_SYMFILE: ::c_int = 37;
+pub const KERN_PROCARGS: ::c_int = 38;
+pub const KERN_NETBOOT: ::c_int = 40;
+pub const KERN_SYSV: ::c_int = 42;
+pub const KERN_AFFINITY: ::c_int = 43;
+pub const KERN_TRANSLATE: ::c_int = 44;
+pub const KERN_CLASSIC: ::c_int = KERN_TRANSLATE;
+pub const KERN_EXEC: ::c_int = 45;
+pub const KERN_CLASSICHANDLER: ::c_int = KERN_EXEC;
+pub const KERN_AIOMAX: ::c_int = 46;
+pub const KERN_AIOPROCMAX: ::c_int = 47;
+pub const KERN_AIOTHREADS: ::c_int = 48;
+pub const KERN_COREFILE: ::c_int = 50;
+pub const KERN_COREDUMP: ::c_int = 51;
+pub const KERN_SUGID_COREDUMP: ::c_int = 52;
+pub const KERN_PROCDELAYTERM: ::c_int = 53;
+pub const KERN_SHREG_PRIVATIZABLE: ::c_int = 54;
+pub const KERN_LOW_PRI_WINDOW: ::c_int = 56;
+pub const KERN_LOW_PRI_DELAY: ::c_int = 57;
+pub const KERN_POSIX: ::c_int = 58;
+pub const KERN_USRSTACK64: ::c_int = 59;
+pub const KERN_NX_PROTECTION: ::c_int = 60;
+pub const KERN_TFP: ::c_int = 61;
+pub const KERN_PROCNAME: ::c_int = 62;
+pub const KERN_THALTSTACK: ::c_int = 63;
+pub const KERN_SPECULATIVE_READS: ::c_int = 64;
+pub const KERN_OSVERSION: ::c_int = 65;
+pub const KERN_SAFEBOOT: ::c_int = 66;
+pub const KERN_RAGEVNODE: ::c_int = 68;
+pub const KERN_TTY: ::c_int = 69;
+pub const KERN_CHECKOPENEVT: ::c_int = 70;
+pub const KERN_THREADNAME: ::c_int = 71;
+pub const KERN_MAXID: ::c_int = 72;
+pub const KERN_RAGE_PROC: ::c_int = 1;
+pub const KERN_RAGE_THREAD: ::c_int = 2;
+pub const KERN_UNRAGE_PROC: ::c_int = 3;
+pub const KERN_UNRAGE_THREAD: ::c_int = 4;
+pub const KERN_OPENEVT_PROC: ::c_int = 1;
+pub const KERN_UNOPENEVT_PROC: ::c_int = 2;
+pub const KERN_TFP_POLICY: ::c_int = 1;
+pub const KERN_TFP_POLICY_DENY: ::c_int = 0;
+pub const KERN_TFP_POLICY_DEFAULT: ::c_int = 2;
+pub const KERN_KDEFLAGS: ::c_int = 1;
+pub const KERN_KDDFLAGS: ::c_int = 2;
+pub const KERN_KDENABLE: ::c_int = 3;
+pub const KERN_KDSETBUF: ::c_int = 4;
+pub const KERN_KDGETBUF: ::c_int = 5;
+pub const KERN_KDSETUP: ::c_int = 6;
+pub const KERN_KDREMOVE: ::c_int = 7;
+pub const KERN_KDSETREG: ::c_int = 8;
+pub const KERN_KDGETREG: ::c_int = 9;
+pub const KERN_KDREADTR: ::c_int = 10;
+pub const KERN_KDPIDTR: ::c_int = 11;
+pub const KERN_KDTHRMAP: ::c_int = 12;
+pub const KERN_KDPIDEX: ::c_int = 14;
+pub const KERN_KDSETRTCDEC: ::c_int = 15;
+pub const KERN_KDGETENTROPY: ::c_int = 16;
+pub const KERN_KDWRITETR: ::c_int = 17;
+pub const KERN_KDWRITEMAP: ::c_int = 18;
+#[doc(hidden)]
+#[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")]
+pub const KERN_KDENABLE_BG_TRACE: ::c_int = 19;
+#[doc(hidden)]
+#[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")]
+pub const KERN_KDDISABLE_BG_TRACE: ::c_int = 20;
+pub const KERN_KDREADCURTHRMAP: ::c_int = 21;
+pub const KERN_KDSET_TYPEFILTER: ::c_int = 22;
+pub const KERN_KDBUFWAIT: ::c_int = 23;
+pub const KERN_KDCPUMAP: ::c_int = 24;
+pub const KERN_PROC_ALL: ::c_int = 0;
+pub const KERN_PROC_PID: ::c_int = 1;
+pub const KERN_PROC_PGRP: ::c_int = 2;
+pub const KERN_PROC_SESSION: ::c_int = 3;
+pub const KERN_PROC_TTY: ::c_int = 4;
+pub const KERN_PROC_UID: ::c_int = 5;
+pub const KERN_PROC_RUID: ::c_int = 6;
+pub const KERN_PROC_LCID: ::c_int = 7;
+pub const KERN_SUCCESS: ::c_int = 0;
+pub const KERN_INVALID_ADDRESS: ::c_int = 1;
+pub const KERN_PROTECTION_FAILURE: ::c_int = 2;
+pub const KERN_NO_SPACE: ::c_int = 3;
+pub const KERN_INVALID_ARGUMENT: ::c_int = 4;
+pub const KERN_FAILURE: ::c_int = 5;
+pub const KERN_RESOURCE_SHORTAGE: ::c_int = 6;
+pub const KERN_NOT_RECEIVER: ::c_int = 7;
+pub const KERN_NO_ACCESS: ::c_int = 8;
+pub const KERN_MEMORY_FAILURE: ::c_int = 9;
+pub const KERN_MEMORY_ERROR: ::c_int = 10;
+pub const KERN_ALREADY_IN_SET: ::c_int = 11;
+pub const KERN_NOT_IN_SET: ::c_int = 12;
+pub const KERN_NAME_EXISTS: ::c_int = 13;
+pub const KERN_ABORTED: ::c_int = 14;
+pub const KERN_INVALID_NAME: ::c_int = 15;
+pub const KERN_INVALID_TASK: ::c_int = 16;
+pub const KERN_INVALID_RIGHT: ::c_int = 17;
+pub const KERN_INVALID_VALUE: ::c_int = 18;
+pub const KERN_UREFS_OVERFLOW: ::c_int = 19;
+pub const KERN_INVALID_CAPABILITY: ::c_int = 20;
+pub const KERN_RIGHT_EXISTS: ::c_int = 21;
+pub const KERN_INVALID_HOST: ::c_int = 22;
+pub const KERN_MEMORY_PRESENT: ::c_int = 23;
+pub const KERN_MEMORY_DATA_MOVED: ::c_int = 24;
+pub const KERN_MEMORY_RESTART_COPY: ::c_int = 25;
+pub const KERN_INVALID_PROCESSOR_SET: ::c_int = 26;
+pub const KERN_POLICY_LIMIT: ::c_int = 27;
+pub const KERN_INVALID_POLICY: ::c_int = 28;
+pub const KERN_INVALID_OBJECT: ::c_int = 29;
+pub const KERN_ALREADY_WAITING: ::c_int = 30;
+pub const KERN_DEFAULT_SET: ::c_int = 31;
+pub const KERN_EXCEPTION_PROTECTED: ::c_int = 32;
+pub const KERN_INVALID_LEDGER: ::c_int = 33;
+pub const KERN_INVALID_MEMORY_CONTROL: ::c_int = 34;
+pub const KERN_INVALID_SECURITY: ::c_int = 35;
+pub const KERN_NOT_DEPRESSED: ::c_int = 36;
+pub const KERN_TERMINATED: ::c_int = 37;
+pub const KERN_LOCK_SET_DESTROYED: ::c_int = 38;
+pub const KERN_LOCK_UNSTABLE: ::c_int = 39;
+pub const KERN_LOCK_OWNED: ::c_int = 40;
+pub const KERN_LOCK_OWNED_SELF: ::c_int = 41;
+pub const KERN_SEMAPHORE_DESTROYED: ::c_int = 42;
+pub const KERN_RPC_SERVER_TERMINATED: ::c_int = 43;
+pub const KERN_RPC_TERMINATE_ORPHAN: ::c_int = 44;
+pub const KERN_RPC_CONTINUE_ORPHAN: ::c_int = 45;
+pub const KERN_NOT_SUPPORTED: ::c_int = 46;
+pub const KERN_NODE_DOWN: ::c_int = 47;
+pub const KERN_NOT_WAITING: ::c_int = 48;
+pub const KERN_OPERATION_TIMED_OUT: ::c_int = 49;
+pub const KERN_CODESIGN_ERROR: ::c_int = 50;
+pub const KERN_POLICY_STATIC: ::c_int = 51;
+pub const KERN_INSUFFICIENT_BUFFER_SIZE: ::c_int = 52;
+pub const KIPC_MAXSOCKBUF: ::c_int = 1;
+pub const KIPC_SOCKBUF_WASTE: ::c_int = 2;
+pub const KIPC_SOMAXCONN: ::c_int = 3;
+pub const KIPC_MAX_LINKHDR: ::c_int = 4;
+pub const KIPC_MAX_PROTOHDR: ::c_int = 5;
+pub const KIPC_MAX_HDR: ::c_int = 6;
+pub const KIPC_MAX_DATALEN: ::c_int = 7;
+pub const KIPC_MBSTAT: ::c_int = 8;
+pub const KIPC_NMBCLUSTERS: ::c_int = 9;
+pub const KIPC_SOQLIMITCOMPAT: ::c_int = 10;
+pub const VM_METER: ::c_int = 1;
+pub const VM_LOADAVG: ::c_int = 2;
+pub const VM_MACHFACTOR: ::c_int = 4;
+pub const VM_SWAPUSAGE: ::c_int = 5;
+pub const VM_MAXID: ::c_int = 6;
+pub const VM_PROT_NONE: ::vm_prot_t = 0x00;
+pub const VM_PROT_READ: ::vm_prot_t = 0x01;
+pub const VM_PROT_WRITE: ::vm_prot_t = 0x02;
+pub const VM_PROT_EXECUTE: ::vm_prot_t = 0x04;
+pub const MEMORY_OBJECT_NULL: ::memory_object_t = 0;
+pub const HW_MACHINE: ::c_int = 1;
+pub const HW_MODEL: ::c_int = 2;
+pub const HW_NCPU: ::c_int = 3;
+pub const HW_BYTEORDER: ::c_int = 4;
+pub const HW_PHYSMEM: ::c_int = 5;
+pub const HW_USERMEM: ::c_int = 6;
+pub const HW_PAGESIZE: ::c_int = 7;
+pub const HW_DISKNAMES: ::c_int = 8;
+pub const HW_DISKSTATS: ::c_int = 9;
+pub const HW_EPOCH: ::c_int = 10;
+pub const HW_FLOATINGPT: ::c_int = 11;
+pub const HW_MACHINE_ARCH: ::c_int = 12;
+pub const HW_VECTORUNIT: ::c_int = 13;
+pub const HW_BUS_FREQ: ::c_int = 14;
+pub const HW_CPU_FREQ: ::c_int = 15;
+pub const HW_CACHELINE: ::c_int = 16;
+pub const HW_L1ICACHESIZE: ::c_int = 17;
+pub const HW_L1DCACHESIZE: ::c_int = 18;
+pub const HW_L2SETTINGS: ::c_int = 19;
+pub const HW_L2CACHESIZE: ::c_int = 20;
+pub const HW_L3SETTINGS: ::c_int = 21;
+pub const HW_L3CACHESIZE: ::c_int = 22;
+pub const HW_TB_FREQ: ::c_int = 23;
+pub const HW_MEMSIZE: ::c_int = 24;
+pub const HW_AVAILCPU: ::c_int = 25;
+pub const HW_TARGET: ::c_int = 26;
+pub const HW_PRODUCT: ::c_int = 27;
+pub const HW_MAXID: ::c_int = 28;
+pub const USER_CS_PATH: ::c_int = 1;
+pub const USER_BC_BASE_MAX: ::c_int = 2;
+pub const USER_BC_DIM_MAX: ::c_int = 3;
+pub const USER_BC_SCALE_MAX: ::c_int = 4;
+pub const USER_BC_STRING_MAX: ::c_int = 5;
+pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6;
+pub const USER_EXPR_NEST_MAX: ::c_int = 7;
+pub const USER_LINE_MAX: ::c_int = 8;
+pub const USER_RE_DUP_MAX: ::c_int = 9;
+pub const USER_POSIX2_VERSION: ::c_int = 10;
+pub const USER_POSIX2_C_BIND: ::c_int = 11;
+pub const USER_POSIX2_C_DEV: ::c_int = 12;
+pub const USER_POSIX2_CHAR_TERM: ::c_int = 13;
+pub const USER_POSIX2_FORT_DEV: ::c_int = 14;
+pub const USER_POSIX2_FORT_RUN: ::c_int = 15;
+pub const USER_POSIX2_LOCALEDEF: ::c_int = 16;
+pub const USER_POSIX2_SW_DEV: ::c_int = 17;
+pub const USER_POSIX2_UPE: ::c_int = 18;
+pub const USER_STREAM_MAX: ::c_int = 19;
+pub const USER_TZNAME_MAX: ::c_int = 20;
+pub const USER_MAXID: ::c_int = 21;
+pub const CTL_DEBUG_NAME: ::c_int = 0;
+pub const CTL_DEBUG_VALUE: ::c_int = 1;
+pub const CTL_DEBUG_MAXID: ::c_int = 20;
+
+pub const PRIO_DARWIN_THREAD: ::c_int = 3;
+pub const PRIO_DARWIN_PROCESS: ::c_int = 4;
+pub const PRIO_DARWIN_BG: ::c_int = 0x1000;
+pub const PRIO_DARWIN_NONUI: ::c_int = 0x1001;
+
+pub const SEM_FAILED: *mut sem_t = -1isize as *mut ::sem_t;
+
+pub const AI_PASSIVE: ::c_int = 0x00000001;
+pub const AI_CANONNAME: ::c_int = 0x00000002;
+pub const AI_NUMERICHOST: ::c_int = 0x00000004;
+pub const AI_NUMERICSERV: ::c_int = 0x00001000;
+pub const AI_MASK: ::c_int =
+    AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | AI_ADDRCONFIG;
+pub const AI_ALL: ::c_int = 0x00000100;
+pub const AI_V4MAPPED_CFG: ::c_int = 0x00000200;
+pub const AI_ADDRCONFIG: ::c_int = 0x00000400;
+pub const AI_V4MAPPED: ::c_int = 0x00000800;
+pub const AI_DEFAULT: ::c_int = AI_V4MAPPED_CFG | AI_ADDRCONFIG;
+pub const AI_UNUSABLE: ::c_int = 0x10000000;
+
+pub const SIGEV_NONE: ::c_int = 0;
+pub const SIGEV_SIGNAL: ::c_int = 1;
+pub const SIGEV_THREAD: ::c_int = 3;
+
+pub const AIO_CANCELED: ::c_int = 2;
+pub const AIO_NOTCANCELED: ::c_int = 4;
+pub const AIO_ALLDONE: ::c_int = 1;
+#[deprecated(
+    since = "0.2.64",
+    note = "Can vary at runtime.  Use sysconf(3) instead"
+)]
+pub const AIO_LISTIO_MAX: ::c_int = 16;
+pub const LIO_NOP: ::c_int = 0;
+pub const LIO_WRITE: ::c_int = 2;
+pub const LIO_READ: ::c_int = 1;
+pub const LIO_WAIT: ::c_int = 2;
+pub const LIO_NOWAIT: ::c_int = 1;
+
+pub const WEXITED: ::c_int = 0x00000004;
+pub const WSTOPPED: ::c_int = 0x00000008;
+pub const WCONTINUED: ::c_int = 0x00000010;
+pub const WNOWAIT: ::c_int = 0x00000020;
+
+pub const P_ALL: idtype_t = 0;
+pub const P_PID: idtype_t = 1;
+pub const P_PGID: idtype_t = 2;
+
+pub const UTIME_OMIT: c_long = -2;
+pub const UTIME_NOW: c_long = -1;
+
+pub const XATTR_NOFOLLOW: ::c_int = 0x0001;
+pub const XATTR_CREATE: ::c_int = 0x0002;
+pub const XATTR_REPLACE: ::c_int = 0x0004;
+pub const XATTR_NOSECURITY: ::c_int = 0x0008;
+pub const XATTR_NODEFAULT: ::c_int = 0x0010;
+pub const XATTR_SHOWCOMPRESSION: ::c_int = 0x0020;
+
+pub const NET_RT_IFLIST2: ::c_int = 0x0006;
+
+// net/route.h
+pub const RTF_UP: ::c_int = 0x1;
+pub const RTF_GATEWAY: ::c_int = 0x2;
+pub const RTF_HOST: ::c_int = 0x4;
+pub const RTF_REJECT: ::c_int = 0x8;
+pub const RTF_DYNAMIC: ::c_int = 0x10;
+pub const RTF_MODIFIED: ::c_int = 0x20;
+pub const RTF_DONE: ::c_int = 0x40;
+pub const RTF_DELCLONE: ::c_int = 0x80;
+pub const RTF_CLONING: ::c_int = 0x100;
+pub const RTF_XRESOLVE: ::c_int = 0x200;
+pub const RTF_LLINFO: ::c_int = 0x400;
+pub const RTF_STATIC: ::c_int = 0x800;
+pub const RTF_BLACKHOLE: ::c_int = 0x1000;
+pub const RTF_NOIFREF: ::c_int = 0x2000;
+pub const RTF_PROTO2: ::c_int = 0x4000;
+pub const RTF_PROTO1: ::c_int = 0x8000;
+pub const RTF_PRCLONING: ::c_int = 0x10000;
+pub const RTF_WASCLONED: ::c_int = 0x20000;
+pub const RTF_PROTO3: ::c_int = 0x40000;
+pub const RTF_PINNED: ::c_int = 0x100000;
+pub const RTF_LOCAL: ::c_int = 0x200000;
+pub const RTF_BROADCAST: ::c_int = 0x400000;
+pub const RTF_MULTICAST: ::c_int = 0x800000;
+pub const RTF_IFSCOPE: ::c_int = 0x1000000;
+pub const RTF_CONDEMNED: ::c_int = 0x2000000;
+pub const RTF_IFREF: ::c_int = 0x4000000;
+pub const RTF_PROXY: ::c_int = 0x8000000;
+pub const RTF_ROUTER: ::c_int = 0x10000000;
+pub const RTF_DEAD: ::c_int = 0x20000000;
+pub const RTF_GLOBAL: ::c_int = 0x40000000;
+
+pub const RTM_VERSION: ::c_int = 5;
+
+// Message types
+pub const RTM_ADD: ::c_int = 0x1;
+pub const RTM_DELETE: ::c_int = 0x2;
+pub const RTM_CHANGE: ::c_int = 0x3;
+pub const RTM_GET: ::c_int = 0x4;
+pub const RTM_LOSING: ::c_int = 0x5;
+pub const RTM_REDIRECT: ::c_int = 0x6;
+pub const RTM_MISS: ::c_int = 0x7;
+pub const RTM_LOCK: ::c_int = 0x8;
+pub const RTM_OLDADD: ::c_int = 0x9;
+pub const RTM_OLDDEL: ::c_int = 0xa;
+pub const RTM_RESOLVE: ::c_int = 0xb;
+pub const RTM_NEWADDR: ::c_int = 0xc;
+pub const RTM_DELADDR: ::c_int = 0xd;
+pub const RTM_IFINFO: ::c_int = 0xe;
+pub const RTM_NEWMADDR: ::c_int = 0xf;
+pub const RTM_DELMADDR: ::c_int = 0x10;
+pub const RTM_IFINFO2: ::c_int = 0x12;
+pub const RTM_NEWMADDR2: ::c_int = 0x13;
+pub const RTM_GET2: ::c_int = 0x14;
+
+// Bitmask values for rtm_inits and rmx_locks.
+pub const RTV_MTU: ::c_int = 0x1;
+pub const RTV_HOPCOUNT: ::c_int = 0x2;
+pub const RTV_EXPIRE: ::c_int = 0x4;
+pub const RTV_RPIPE: ::c_int = 0x8;
+pub const RTV_SPIPE: ::c_int = 0x10;
+pub const RTV_SSTHRESH: ::c_int = 0x20;
+pub const RTV_RTT: ::c_int = 0x40;
+pub const RTV_RTTVAR: ::c_int = 0x80;
+
+// Bitmask values for rtm_addrs.
+pub const RTA_DST: ::c_int = 0x1;
+pub const RTA_GATEWAY: ::c_int = 0x2;
+pub const RTA_NETMASK: ::c_int = 0x4;
+pub const RTA_GENMASK: ::c_int = 0x8;
+pub const RTA_IFP: ::c_int = 0x10;
+pub const RTA_IFA: ::c_int = 0x20;
+pub const RTA_AUTHOR: ::c_int = 0x40;
+pub const RTA_BRD: ::c_int = 0x80;
+
+// Index offsets for sockaddr array for alternate internal encoding.
+pub const RTAX_DST: ::c_int = 0;
+pub const RTAX_GATEWAY: ::c_int = 1;
+pub const RTAX_NETMASK: ::c_int = 2;
+pub const RTAX_GENMASK: ::c_int = 3;
+pub const RTAX_IFP: ::c_int = 4;
+pub const RTAX_IFA: ::c_int = 5;
+pub const RTAX_AUTHOR: ::c_int = 6;
+pub const RTAX_BRD: ::c_int = 7;
+pub const RTAX_MAX: ::c_int = 8;
+
+pub const KERN_PROCARGS2: ::c_int = 49;
+
+pub const PROC_PIDTASKALLINFO: ::c_int = 2;
+pub const PROC_PIDTBSDINFO: ::c_int = 3;
+pub const PROC_PIDTASKINFO: ::c_int = 4;
+pub const PROC_PIDTHREADINFO: ::c_int = 5;
+pub const PROC_PIDVNODEPATHINFO: ::c_int = 9;
+pub const PROC_PIDPATHINFO_MAXSIZE: ::c_int = 4096;
+pub const PROC_CSM_ALL: ::c_uint = 0x0001;
+pub const PROC_CSM_NOSMT: ::c_uint = 0x0002;
+pub const PROC_CSM_TECS: ::c_uint = 0x0004;
+pub const MAXCOMLEN: usize = 16;
+pub const MAXTHREADNAMESIZE: usize = 64;
+
+pub const XUCRED_VERSION: ::c_uint = 0;
+
+pub const LC_SEGMENT: u32 = 0x1;
+pub const LC_SEGMENT_64: u32 = 0x19;
+
+pub const MH_MAGIC: u32 = 0xfeedface;
+pub const MH_MAGIC_64: u32 = 0xfeedfacf;
+
+// net/if_utun.h
+pub const UTUN_OPT_FLAGS: ::c_int = 1;
+pub const UTUN_OPT_IFNAME: ::c_int = 2;
+
+// net/bpf.h
+pub const DLT_NULL: ::c_uint = 0; // no link-layer encapsulation
+pub const DLT_EN10MB: ::c_uint = 1; // Ethernet (10Mb)
+pub const DLT_EN3MB: ::c_uint = 2; // Experimental Ethernet (3Mb)
+pub const DLT_AX25: ::c_uint = 3; // Amateur Radio AX.25
+pub const DLT_PRONET: ::c_uint = 4; // Proteon ProNET Token Ring
+pub const DLT_CHAOS: ::c_uint = 5; // Chaos
+pub const DLT_IEEE802: ::c_uint = 6; // IEEE 802 Networks
+pub const DLT_ARCNET: ::c_uint = 7; // ARCNET
+pub const DLT_SLIP: ::c_uint = 8; // Serial Line IP
+pub const DLT_PPP: ::c_uint = 9; // Point-to-point Protocol
+pub const DLT_FDDI: ::c_uint = 10; // FDDI
+pub const DLT_ATM_RFC1483: ::c_uint = 11; // LLC/SNAP encapsulated atm
+pub const DLT_RAW: ::c_uint = 12; // raw IP
+pub const DLT_LOOP: ::c_uint = 108;
+
+// https://github.com/apple/darwin-xnu/blob/HEAD/bsd/net/bpf.h#L100
+// sizeof(i32)
+pub const BPF_ALIGNMENT: ::c_int = 4;
+
+// sys/mount.h
+pub const MNT_NODEV: ::c_int = 0x00000010;
+pub const MNT_UNION: ::c_int = 0x00000020;
+pub const MNT_CPROTECT: ::c_int = 0x00000080;
+
+// MAC labeled / "quarantined" flag
+pub const MNT_QUARANTINE: ::c_int = 0x00000400;
+
+// Flags set by internal operations.
+pub const MNT_LOCAL: ::c_int = 0x00001000;
+pub const MNT_QUOTA: ::c_int = 0x00002000;
+pub const MNT_ROOTFS: ::c_int = 0x00004000;
+pub const MNT_DOVOLFS: ::c_int = 0x00008000;
+
+pub const MNT_DONTBROWSE: ::c_int = 0x00100000;
+pub const MNT_IGNORE_OWNERSHIP: ::c_int = 0x00200000;
+pub const MNT_AUTOMOUNTED: ::c_int = 0x00400000;
+pub const MNT_JOURNALED: ::c_int = 0x00800000;
+pub const MNT_NOUSERXATTR: ::c_int = 0x01000000;
+pub const MNT_DEFWRITE: ::c_int = 0x02000000;
+pub const MNT_MULTILABEL: ::c_int = 0x04000000;
+pub const MNT_NOATIME: ::c_int = 0x10000000;
+pub const MNT_SNAPSHOT: ::c_int = 0x40000000;
+
+// External filesystem command modifier flags.
+pub const MNT_NOBLOCK: ::c_int = 0x00020000;
+
+// sys/spawn.h:
+pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x0001;
+pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x0002;
+pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x0004;
+pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x0008;
+pub const POSIX_SPAWN_SETEXEC: ::c_int = 0x0040;
+pub const POSIX_SPAWN_START_SUSPENDED: ::c_int = 0x0080;
+pub const POSIX_SPAWN_CLOEXEC_DEFAULT: ::c_int = 0x4000;
+
+// sys/ipc.h:
+pub const IPC_CREAT: ::c_int = 0x200;
+pub const IPC_EXCL: ::c_int = 0x400;
+pub const IPC_NOWAIT: ::c_int = 0x800;
+pub const IPC_PRIVATE: key_t = 0;
+
+pub const IPC_RMID: ::c_int = 0;
+pub const IPC_SET: ::c_int = 1;
+pub const IPC_STAT: ::c_int = 2;
+
+pub const IPC_R: ::c_int = 0x100;
+pub const IPC_W: ::c_int = 0x80;
+pub const IPC_M: ::c_int = 0x1000;
+
+// sys/sem.h
+pub const SEM_UNDO: ::c_int = 0o10000;
+
+pub const GETNCNT: ::c_int = 3;
+pub const GETPID: ::c_int = 4;
+pub const GETVAL: ::c_int = 5;
+pub const GETALL: ::c_int = 6;
+pub const GETZCNT: ::c_int = 7;
+pub const SETVAL: ::c_int = 8;
+pub const SETALL: ::c_int = 9;
+
+// sys/shm.h
+pub const SHM_RDONLY: ::c_int = 0x1000;
+pub const SHM_RND: ::c_int = 0x2000;
+#[cfg(target_arch = "aarch64")]
+pub const SHMLBA: ::c_int = 16 * 1024;
+#[cfg(not(target_arch = "aarch64"))]
+pub const SHMLBA: ::c_int = 4096;
+pub const SHM_R: ::c_int = IPC_R;
+pub const SHM_W: ::c_int = IPC_W;
+
+// Flags for chflags(2)
+pub const UF_SETTABLE: ::c_uint = 0x0000ffff;
+pub const UF_NODUMP: ::c_uint = 0x00000001;
+pub const UF_IMMUTABLE: ::c_uint = 0x00000002;
+pub const UF_APPEND: ::c_uint = 0x00000004;
+pub const UF_OPAQUE: ::c_uint = 0x00000008;
+pub const UF_COMPRESSED: ::c_uint = 0x00000020;
+pub const UF_TRACKED: ::c_uint = 0x00000040;
+pub const SF_SETTABLE: ::c_uint = 0xffff0000;
+pub const SF_ARCHIVED: ::c_uint = 0x00010000;
+pub const SF_IMMUTABLE: ::c_uint = 0x00020000;
+pub const SF_APPEND: ::c_uint = 0x00040000;
+pub const UF_HIDDEN: ::c_uint = 0x00008000;
+
+//<sys/timex.h>
+pub const NTP_API: ::c_int = 4;
+pub const MAXPHASE: ::c_long = 500000000;
+pub const MAXFREQ: ::c_long = 500000;
+pub const MINSEC: ::c_int = 256;
+pub const MAXSEC: ::c_int = 2048;
+pub const NANOSECOND: ::c_long = 1000000000;
+pub const SCALE_PPM: ::c_int = 65;
+pub const MAXTC: ::c_int = 10;
+pub const MOD_OFFSET: ::c_uint = 0x0001;
+pub const MOD_FREQUENCY: ::c_uint = 0x0002;
+pub const MOD_MAXERROR: ::c_uint = 0x0004;
+pub const MOD_ESTERROR: ::c_uint = 0x0008;
+pub const MOD_STATUS: ::c_uint = 0x0010;
+pub const MOD_TIMECONST: ::c_uint = 0x0020;
+pub const MOD_PPSMAX: ::c_uint = 0x0040;
+pub const MOD_TAI: ::c_uint = 0x0080;
+pub const MOD_MICRO: ::c_uint = 0x1000;
+pub const MOD_NANO: ::c_uint = 0x2000;
+pub const MOD_CLKB: ::c_uint = 0x4000;
+pub const MOD_CLKA: ::c_uint = 0x8000;
+pub const STA_PLL: ::c_int = 0x0001;
+pub const STA_PPSFREQ: ::c_int = 0x0002;
+pub const STA_PPSTIME: ::c_int = 0x0004;
+pub const STA_FLL: ::c_int = 0x0008;
+pub const STA_INS: ::c_int = 0x0010;
+pub const STA_DEL: ::c_int = 0x0020;
+pub const STA_UNSYNC: ::c_int = 0x0040;
+pub const STA_FREQHOLD: ::c_int = 0x0080;
+pub const STA_PPSSIGNAL: ::c_int = 0x0100;
+pub const STA_PPSJITTER: ::c_int = 0x0200;
+pub const STA_PPSWANDER: ::c_int = 0x0400;
+pub const STA_PPSERROR: ::c_int = 0x0800;
+pub const STA_CLOCKERR: ::c_int = 0x1000;
+pub const STA_NANO: ::c_int = 0x2000;
+pub const STA_MODE: ::c_int = 0x4000;
+pub const STA_CLK: ::c_int = 0x8000;
+pub const STA_RONLY: ::c_int = STA_PPSSIGNAL
+    | STA_PPSJITTER
+    | STA_PPSWANDER
+    | STA_PPSERROR
+    | STA_CLOCKERR
+    | STA_NANO
+    | STA_MODE
+    | STA_CLK;
+pub const TIME_OK: ::c_int = 0;
+pub const TIME_INS: ::c_int = 1;
+pub const TIME_DEL: ::c_int = 2;
+pub const TIME_OOP: ::c_int = 3;
+pub const TIME_WAIT: ::c_int = 4;
+pub const TIME_ERROR: ::c_int = 5;
+
+// <sys/mount.h>
+pub const MNT_WAIT: ::c_int = 1;
+pub const MNT_NOWAIT: ::c_int = 2;
+
+// <mach/thread_policy.h>
+pub const THREAD_STANDARD_POLICY: ::c_int = 1;
+pub const THREAD_STANDARD_POLICY_COUNT: ::c_int = 0;
+pub const THREAD_EXTENDED_POLICY: ::c_int = 1;
+pub const THREAD_TIME_CONSTRAINT_POLICY: ::c_int = 2;
+pub const THREAD_PRECEDENCE_POLICY: ::c_int = 3;
+pub const THREAD_AFFINITY_POLICY: ::c_int = 4;
+pub const THREAD_AFFINITY_TAG_NULL: ::c_int = 0;
+pub const THREAD_BACKGROUND_POLICY: ::c_int = 5;
+pub const THREAD_BACKGROUND_POLICY_DARWIN_BG: ::c_int = 0x1000;
+pub const THREAD_LATENCY_QOS_POLICY: ::c_int = 7;
+pub const THREAD_THROUGHPUT_QOS_POLICY: ::c_int = 8;
+
+// <mach/thread_info.h>
+pub const TH_STATE_RUNNING: ::c_int = 1;
+pub const TH_STATE_STOPPED: ::c_int = 2;
+pub const TH_STATE_WAITING: ::c_int = 3;
+pub const TH_STATE_UNINTERRUPTIBLE: ::c_int = 4;
+pub const TH_STATE_HALTED: ::c_int = 5;
+pub const TH_FLAGS_SWAPPED: ::c_int = 0x1;
+pub const TH_FLAGS_IDLE: ::c_int = 0x2;
+pub const TH_FLAGS_GLOBAL_FORCED_IDLE: ::c_int = 0x4;
+pub const THREAD_BASIC_INFO: ::c_int = 3;
+pub const THREAD_IDENTIFIER_INFO: ::c_int = 4;
+pub const THREAD_EXTENDED_INFO: ::c_int = 5;
+
+// CommonCrypto/CommonCryptoError.h
+pub const kCCSuccess: i32 = 0;
+pub const kCCParamError: i32 = -4300;
+pub const kCCBufferTooSmall: i32 = -4301;
+pub const kCCMemoryFailure: i32 = -4302;
+pub const kCCAlignmentError: i32 = -4303;
+pub const kCCDecodeError: i32 = -4304;
+pub const kCCUnimplemented: i32 = -4305;
+pub const kCCOverflow: i32 = -4306;
+pub const kCCRNGFailure: i32 = -4307;
+pub const kCCUnspecifiedError: i32 = -4308;
+pub const kCCCallSequenceError: i32 = -4309;
+pub const kCCKeySizeError: i32 = -4310;
+pub const kCCInvalidKey: i32 = -4311;
+
+// mach/host_info.h
+pub const HOST_LOAD_INFO: i32 = 1;
+pub const HOST_VM_INFO: i32 = 2;
+pub const HOST_CPU_LOAD_INFO: i32 = 3;
+pub const HOST_VM_INFO64: i32 = 4;
+pub const HOST_EXTMOD_INFO64: i32 = 5;
+pub const HOST_EXPIRED_TASK_INFO: i32 = 6;
+
+// mach/vm_statistics.h
+pub const VM_PAGE_QUERY_PAGE_PRESENT: i32 = 0x1;
+pub const VM_PAGE_QUERY_PAGE_FICTITIOUS: i32 = 0x2;
+pub const VM_PAGE_QUERY_PAGE_REF: i32 = 0x4;
+pub const VM_PAGE_QUERY_PAGE_DIRTY: i32 = 0x8;
+pub const VM_PAGE_QUERY_PAGE_PAGED_OUT: i32 = 0x10;
+pub const VM_PAGE_QUERY_PAGE_COPIED: i32 = 0x20;
+pub const VM_PAGE_QUERY_PAGE_SPECULATIVE: i32 = 0x40;
+pub const VM_PAGE_QUERY_PAGE_EXTERNAL: i32 = 0x80;
+pub const VM_PAGE_QUERY_PAGE_CS_VALIDATED: i32 = 0x100;
+pub const VM_PAGE_QUERY_PAGE_CS_TAINTED: i32 = 0x200;
+pub const VM_PAGE_QUERY_PAGE_CS_NX: i32 = 0x400;
+
+// mach/task_info.h
+pub const TASK_THREAD_TIMES_INFO: u32 = 3;
+pub const HOST_CPU_LOAD_INFO_COUNT: u32 = 4;
+pub const MACH_TASK_BASIC_INFO: u32 = 20;
+
+pub const MACH_PORT_NULL: i32 = 0;
+
+pub const RUSAGE_INFO_V0: ::c_int = 0;
+pub const RUSAGE_INFO_V1: ::c_int = 1;
+pub const RUSAGE_INFO_V2: ::c_int = 2;
+pub const RUSAGE_INFO_V3: ::c_int = 3;
+pub const RUSAGE_INFO_V4: ::c_int = 4;
+
+// copyfile.h
+pub const COPYFILE_ACL: ::copyfile_flags_t = 1 << 0;
+pub const COPYFILE_STAT: ::copyfile_flags_t = 1 << 1;
+pub const COPYFILE_XATTR: ::copyfile_flags_t = 1 << 2;
+pub const COPYFILE_DATA: ::copyfile_flags_t = 1 << 3;
+pub const COPYFILE_SECURITY: ::copyfile_flags_t = COPYFILE_STAT | COPYFILE_ACL;
+pub const COPYFILE_METADATA: ::copyfile_flags_t = COPYFILE_SECURITY | COPYFILE_XATTR;
+pub const COPYFILE_RECURSIVE: ::copyfile_flags_t = 1 << 15;
+pub const COPYFILE_CHECK: ::copyfile_flags_t = 1 << 16;
+pub const COPYFILE_EXCL: ::copyfile_flags_t = 1 << 17;
+pub const COPYFILE_NOFOLLOW_SRC: ::copyfile_flags_t = 1 << 18;
+pub const COPYFILE_NOFOLLOW_DST: ::copyfile_flags_t = 1 << 19;
+pub const COPYFILE_MOVE: ::copyfile_flags_t = 1 << 20;
+pub const COPYFILE_UNLINK: ::copyfile_flags_t = 1 << 21;
+pub const COPYFILE_NOFOLLOW: ::copyfile_flags_t = COPYFILE_NOFOLLOW_SRC | COPYFILE_NOFOLLOW_DST;
+pub const COPYFILE_PACK: ::copyfile_flags_t = 1 << 22;
+pub const COPYFILE_UNPACK: ::copyfile_flags_t = 1 << 23;
+pub const COPYFILE_CLONE: ::copyfile_flags_t = 1 << 24;
+pub const COPYFILE_CLONE_FORCE: ::copyfile_flags_t = 1 << 25;
+pub const COPYFILE_RUN_IN_PLACE: ::copyfile_flags_t = 1 << 26;
+pub const COPYFILE_DATA_SPARSE: ::copyfile_flags_t = 1 << 27;
+pub const COPYFILE_PRESERVE_DST_TRACKED: ::copyfile_flags_t = 1 << 28;
+pub const COPYFILE_VERBOSE: ::copyfile_flags_t = 1 << 30;
+pub const COPYFILE_RECURSE_ERROR: ::c_int = 0;
+pub const COPYFILE_RECURSE_FILE: ::c_int = 1;
+pub const COPYFILE_RECURSE_DIR: ::c_int = 2;
+pub const COPYFILE_RECURSE_DIR_CLEANUP: ::c_int = 3;
+pub const COPYFILE_COPY_DATA: ::c_int = 4;
+pub const COPYFILE_COPY_XATTR: ::c_int = 5;
+pub const COPYFILE_START: ::c_int = 1;
+pub const COPYFILE_FINISH: ::c_int = 2;
+pub const COPYFILE_ERR: ::c_int = 3;
+pub const COPYFILE_PROGRESS: ::c_int = 4;
+pub const COPYFILE_CONTINUE: ::c_int = 0;
+pub const COPYFILE_SKIP: ::c_int = 1;
+pub const COPYFILE_QUIT: ::c_int = 2;
+pub const COPYFILE_STATE_SRC_FD: ::c_int = 1;
+pub const COPYFILE_STATE_SRC_FILENAME: ::c_int = 2;
+pub const COPYFILE_STATE_DST_FD: ::c_int = 3;
+pub const COPYFILE_STATE_DST_FILENAME: ::c_int = 4;
+pub const COPYFILE_STATE_QUARANTINE: ::c_int = 5;
+pub const COPYFILE_STATE_STATUS_CB: ::c_int = 6;
+pub const COPYFILE_STATE_STATUS_CTX: ::c_int = 7;
+pub const COPYFILE_STATE_COPIED: ::c_int = 8;
+pub const COPYFILE_STATE_XATTRNAME: ::c_int = 9;
+pub const COPYFILE_STATE_WAS_CLONED: ::c_int = 10;
+pub const COPYFILE_STATE_SRC_BSIZE: ::c_int = 11;
+pub const COPYFILE_STATE_DST_BSIZE: ::c_int = 12;
+pub const COPYFILE_STATE_BSIZE: ::c_int = 13;
+
+// <sys/attr.h>
+pub const ATTR_BIT_MAP_COUNT: ::c_ushort = 5;
+pub const FSOPT_NOFOLLOW: u32 = 0x1;
+pub const FSOPT_NOFOLLOW_ANY: u32 = 0x800;
+pub const FSOPT_REPORT_FULLSIZE: u32 = 0x4;
+pub const FSOPT_PACK_INVAL_ATTRS: u32 = 0x8;
+pub const FSOPT_ATTR_CMN_EXTENDED: u32 = 0x20;
+pub const FSOPT_RETURN_REALDEV: u32 = 0x200;
+pub const ATTR_CMN_NAME: attrgroup_t = 0x00000001;
+pub const ATTR_CMN_DEVID: attrgroup_t = 0x00000002;
+pub const ATTR_CMN_FSID: attrgroup_t = 0x00000004;
+pub const ATTR_CMN_OBJTYPE: attrgroup_t = 0x00000008;
+pub const ATTR_CMN_OBJTAG: attrgroup_t = 0x00000010;
+pub const ATTR_CMN_OBJID: attrgroup_t = 0x00000020;
+pub const ATTR_CMN_OBJPERMANENTID: attrgroup_t = 0x00000040;
+pub const ATTR_CMN_PAROBJID: attrgroup_t = 0x00000080;
+pub const ATTR_CMN_SCRIPT: attrgroup_t = 0x00000100;
+pub const ATTR_CMN_CRTIME: attrgroup_t = 0x00000200;
+pub const ATTR_CMN_MODTIME: attrgroup_t = 0x00000400;
+pub const ATTR_CMN_CHGTIME: attrgroup_t = 0x00000800;
+pub const ATTR_CMN_ACCTIME: attrgroup_t = 0x00001000;
+pub const ATTR_CMN_BKUPTIME: attrgroup_t = 0x00002000;
+pub const ATTR_CMN_FNDRINFO: attrgroup_t = 0x00004000;
+pub const ATTR_CMN_OWNERID: attrgroup_t = 0x00008000;
+pub const ATTR_CMN_GRPID: attrgroup_t = 0x00010000;
+pub const ATTR_CMN_ACCESSMASK: attrgroup_t = 0x00020000;
+pub const ATTR_CMN_FLAGS: attrgroup_t = 0x00040000;
+pub const ATTR_CMN_GEN_COUNT: attrgroup_t = 0x00080000;
+pub const ATTR_CMN_DOCUMENT_ID: attrgroup_t = 0x00100000;
+pub const ATTR_CMN_USERACCESS: attrgroup_t = 0x00200000;
+pub const ATTR_CMN_EXTENDED_SECURITY: attrgroup_t = 0x00400000;
+pub const ATTR_CMN_UUID: attrgroup_t = 0x00800000;
+pub const ATTR_CMN_GRPUUID: attrgroup_t = 0x01000000;
+pub const ATTR_CMN_FILEID: attrgroup_t = 0x02000000;
+pub const ATTR_CMN_PARENTID: attrgroup_t = 0x04000000;
+pub const ATTR_CMN_FULLPATH: attrgroup_t = 0x08000000;
+pub const ATTR_CMN_ADDEDTIME: attrgroup_t = 0x10000000;
+pub const ATTR_CMN_DATA_PROTECT_FLAGS: attrgroup_t = 0x40000000;
+pub const ATTR_CMN_RETURNED_ATTRS: attrgroup_t = 0x80000000;
+pub const ATTR_VOL_FSTYPE: attrgroup_t = 0x00000001;
+pub const ATTR_VOL_SIGNATURE: attrgroup_t = 0x00000002;
+pub const ATTR_VOL_SIZE: attrgroup_t = 0x00000004;
+pub const ATTR_VOL_SPACEFREE: attrgroup_t = 0x00000008;
+pub const ATTR_VOL_SPACEAVAIL: attrgroup_t = 0x00000010;
+pub const ATTR_VOL_MINALLOCATION: attrgroup_t = 0x00000020;
+pub const ATTR_VOL_ALLOCATIONCLUMP: attrgroup_t = 0x00000040;
+pub const ATTR_VOL_IOBLOCKSIZE: attrgroup_t = 0x00000080;
+pub const ATTR_VOL_OBJCOUNT: attrgroup_t = 0x00000100;
+pub const ATTR_VOL_FILECOUNT: attrgroup_t = 0x00000200;
+pub const ATTR_VOL_DIRCOUNT: attrgroup_t = 0x00000400;
+pub const ATTR_VOL_MAXOBJCOUNT: attrgroup_t = 0x00000800;
+pub const ATTR_VOL_MOUNTPOINT: attrgroup_t = 0x00001000;
+pub const ATTR_VOL_NAME: attrgroup_t = 0x00002000;
+pub const ATTR_VOL_MOUNTFLAGS: attrgroup_t = 0x00004000;
+pub const ATTR_VOL_MOUNTEDDEVICE: attrgroup_t = 0x00008000;
+pub const ATTR_VOL_ENCODINGSUSED: attrgroup_t = 0x00010000;
+pub const ATTR_VOL_CAPABILITIES: attrgroup_t = 0x00020000;
+pub const ATTR_VOL_UUID: attrgroup_t = 0x00040000;
+pub const ATTR_VOL_SPACEUSED: attrgroup_t = 0x00800000;
+pub const ATTR_VOL_QUOTA_SIZE: attrgroup_t = 0x10000000;
+pub const ATTR_VOL_RESERVED_SIZE: attrgroup_t = 0x20000000;
+pub const ATTR_VOL_ATTRIBUTES: attrgroup_t = 0x40000000;
+pub const ATTR_VOL_INFO: attrgroup_t = 0x80000000;
+pub const ATTR_DIR_LINKCOUNT: attrgroup_t = 0x00000001;
+pub const ATTR_DIR_ENTRYCOUNT: attrgroup_t = 0x00000002;
+pub const ATTR_DIR_MOUNTSTATUS: attrgroup_t = 0x00000004;
+pub const ATTR_DIR_ALLOCSIZE: attrgroup_t = 0x00000008;
+pub const ATTR_DIR_IOBLOCKSIZE: attrgroup_t = 0x00000010;
+pub const ATTR_DIR_DATALENGTH: attrgroup_t = 0x00000020;
+pub const ATTR_FILE_LINKCOUNT: attrgroup_t = 0x00000001;
+pub const ATTR_FILE_TOTALSIZE: attrgroup_t = 0x00000002;
+pub const ATTR_FILE_ALLOCSIZE: attrgroup_t = 0x00000004;
+pub const ATTR_FILE_IOBLOCKSIZE: attrgroup_t = 0x00000008;
+pub const ATTR_FILE_DEVTYPE: attrgroup_t = 0x00000020;
+pub const ATTR_FILE_FORKCOUNT: attrgroup_t = 0x00000080;
+pub const ATTR_FILE_FORKLIST: attrgroup_t = 0x00000100;
+pub const ATTR_FILE_DATALENGTH: attrgroup_t = 0x00000200;
+pub const ATTR_FILE_DATAALLOCSIZE: attrgroup_t = 0x00000400;
+pub const ATTR_FILE_RSRCLENGTH: attrgroup_t = 0x00001000;
+pub const ATTR_FILE_RSRCALLOCSIZE: attrgroup_t = 0x00002000;
+pub const ATTR_CMNEXT_RELPATH: attrgroup_t = 0x00000004;
+pub const ATTR_CMNEXT_PRIVATESIZE: attrgroup_t = 0x00000008;
+pub const ATTR_CMNEXT_LINKID: attrgroup_t = 0x00000010;
+pub const ATTR_CMNEXT_NOFIRMLINKPATH: attrgroup_t = 0x00000020;
+pub const ATTR_CMNEXT_REALDEVID: attrgroup_t = 0x00000040;
+pub const ATTR_CMNEXT_REALFSID: attrgroup_t = 0x00000080;
+pub const ATTR_CMNEXT_CLONEID: attrgroup_t = 0x00000100;
+pub const ATTR_CMNEXT_EXT_FLAGS: attrgroup_t = 0x00000200;
+pub const ATTR_CMNEXT_RECURSIVE_GENCOUNT: attrgroup_t = 0x00000400;
+pub const DIR_MNTSTATUS_MNTPOINT: u32 = 0x1;
+pub const VOL_CAPABILITIES_FORMAT: usize = 0;
+pub const VOL_CAPABILITIES_INTERFACES: usize = 1;
+pub const VOL_CAP_FMT_PERSISTENTOBJECTIDS: attrgroup_t = 0x00000001;
+pub const VOL_CAP_FMT_SYMBOLICLINKS: attrgroup_t = 0x00000002;
+pub const VOL_CAP_FMT_HARDLINKS: attrgroup_t = 0x00000004;
+pub const VOL_CAP_FMT_JOURNAL: attrgroup_t = 0x00000008;
+pub const VOL_CAP_FMT_JOURNAL_ACTIVE: attrgroup_t = 0x00000010;
+pub const VOL_CAP_FMT_NO_ROOT_TIMES: attrgroup_t = 0x00000020;
+pub const VOL_CAP_FMT_SPARSE_FILES: attrgroup_t = 0x00000040;
+pub const VOL_CAP_FMT_ZERO_RUNS: attrgroup_t = 0x00000080;
+pub const VOL_CAP_FMT_CASE_SENSITIVE: attrgroup_t = 0x00000100;
+pub const VOL_CAP_FMT_CASE_PRESERVING: attrgroup_t = 0x00000200;
+pub const VOL_CAP_FMT_FAST_STATFS: attrgroup_t = 0x00000400;
+pub const VOL_CAP_FMT_2TB_FILESIZE: attrgroup_t = 0x00000800;
+pub const VOL_CAP_FMT_OPENDENYMODES: attrgroup_t = 0x00001000;
+pub const VOL_CAP_FMT_HIDDEN_FILES: attrgroup_t = 0x00002000;
+pub const VOL_CAP_FMT_PATH_FROM_ID: attrgroup_t = 0x00004000;
+pub const VOL_CAP_FMT_NO_VOLUME_SIZES: attrgroup_t = 0x00008000;
+pub const VOL_CAP_FMT_DECMPFS_COMPRESSION: attrgroup_t = 0x00010000;
+pub const VOL_CAP_FMT_64BIT_OBJECT_IDS: attrgroup_t = 0x00020000;
+pub const VOL_CAP_FMT_DIR_HARDLINKS: attrgroup_t = 0x00040000;
+pub const VOL_CAP_FMT_DOCUMENT_ID: attrgroup_t = 0x00080000;
+pub const VOL_CAP_FMT_WRITE_GENERATION_COUNT: attrgroup_t = 0x00100000;
+pub const VOL_CAP_FMT_NO_IMMUTABLE_FILES: attrgroup_t = 0x00200000;
+pub const VOL_CAP_FMT_NO_PERMISSIONS: attrgroup_t = 0x00400000;
+pub const VOL_CAP_FMT_SHARED_SPACE: attrgroup_t = 0x00800000;
+pub const VOL_CAP_FMT_VOL_GROUPS: attrgroup_t = 0x01000000;
+pub const VOL_CAP_FMT_SEALED: attrgroup_t = 0x02000000;
+pub const VOL_CAP_INT_SEARCHFS: attrgroup_t = 0x00000001;
+pub const VOL_CAP_INT_ATTRLIST: attrgroup_t = 0x00000002;
+pub const VOL_CAP_INT_NFSEXPORT: attrgroup_t = 0x00000004;
+pub const VOL_CAP_INT_READDIRATTR: attrgroup_t = 0x00000008;
+pub const VOL_CAP_INT_EXCHANGEDATA: attrgroup_t = 0x00000010;
+pub const VOL_CAP_INT_COPYFILE: attrgroup_t = 0x00000020;
+pub const VOL_CAP_INT_ALLOCATE: attrgroup_t = 0x00000040;
+pub const VOL_CAP_INT_VOL_RENAME: attrgroup_t = 0x00000080;
+pub const VOL_CAP_INT_ADVLOCK: attrgroup_t = 0x00000100;
+pub const VOL_CAP_INT_FLOCK: attrgroup_t = 0x00000200;
+pub const VOL_CAP_INT_EXTENDED_SECURITY: attrgroup_t = 0x00000400;
+pub const VOL_CAP_INT_USERACCESS: attrgroup_t = 0x00000800;
+pub const VOL_CAP_INT_MANLOCK: attrgroup_t = 0x00001000;
+pub const VOL_CAP_INT_NAMEDSTREAMS: attrgroup_t = 0x00002000;
+pub const VOL_CAP_INT_EXTENDED_ATTR: attrgroup_t = 0x00004000;
+pub const VOL_CAP_INT_CLONE: attrgroup_t = 0x00010000;
+pub const VOL_CAP_INT_SNAPSHOT: attrgroup_t = 0x00020000;
+pub const VOL_CAP_INT_RENAME_SWAP: attrgroup_t = 0x00040000;
+pub const VOL_CAP_INT_RENAME_EXCL: attrgroup_t = 0x00080000;
+pub const VOL_CAP_INT_RENAME_OPENFAIL: attrgroup_t = 0x00100000;
+
+// <proc.h>
+/// Process being created by fork.
+pub const SIDL: u32 = 1;
+/// Currently runnable.
+pub const SRUN: u32 = 2;
+/// Sleeping on an address.
+pub const SSLEEP: u32 = 3;
+/// Process debugging or suspension.
+pub const SSTOP: u32 = 4;
+/// Awaiting collection by parent.
+pub const SZOMB: u32 = 5;
+
+// sys/vsock.h
+pub const VMADDR_CID_ANY: ::c_uint = 0xFFFFFFFF;
+pub const VMADDR_CID_HYPERVISOR: ::c_uint = 0;
+pub const VMADDR_CID_RESERVED: ::c_uint = 1;
+pub const VMADDR_CID_HOST: ::c_uint = 2;
+pub const VMADDR_PORT_ANY: ::c_uint = 0xFFFFFFFF;
+
+cfg_if! {
+    if #[cfg(libc_const_extern_fn)] {
+        const fn __DARWIN_ALIGN32(p: usize) -> usize {
+            const __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::<u32>() - 1;
+            p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32
+        }
+    } else if #[cfg(libc_const_size_of)] {
+        fn __DARWIN_ALIGN32(p: usize) -> usize {
+            const __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::<u32>() - 1;
+            p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32
+        }
+    } else {
+        fn __DARWIN_ALIGN32(p: usize) -> usize {
+            let __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::<u32>() - 1;
+            p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<thread_extended_policy_data_t>() / ::mem::size_of::<integer_t>())
+            as mach_msg_type_number_t;
+        pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<thread_time_constraint_policy_data_t>() /
+             ::mem::size_of::<integer_t>()) as mach_msg_type_number_t;
+        pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<thread_precedence_policy_data_t>() / ::mem::size_of::<integer_t>())
+            as mach_msg_type_number_t;
+        pub const THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<thread_affinity_policy_data_t>() / ::mem::size_of::<integer_t>())
+            as mach_msg_type_number_t;
+        pub const THREAD_BACKGROUND_POLICY_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<thread_background_policy_data_t>() / ::mem::size_of::<integer_t>())
+            as mach_msg_type_number_t;
+        pub const THREAD_LATENCY_QOS_POLICY_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<thread_latency_qos_policy_data_t>() / ::mem::size_of::<integer_t>())
+            as mach_msg_type_number_t;
+        pub const THREAD_THROUGHPUT_QOS_POLICY_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<thread_throughput_qos_policy_data_t>() /
+             ::mem::size_of::<integer_t>()) as mach_msg_type_number_t;
+        pub const THREAD_BASIC_INFO_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<thread_basic_info_data_t>() / ::mem::size_of::<integer_t>())
+            as mach_msg_type_number_t;
+        pub const THREAD_IDENTIFIER_INFO_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<thread_identifier_info_data_t>() / ::mem::size_of::<integer_t>())
+            as mach_msg_type_number_t;
+        pub const THREAD_EXTENDED_INFO_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<thread_extended_info_data_t>() / ::mem::size_of::<integer_t>())
+            as mach_msg_type_number_t;
+
+        pub const TASK_THREAD_TIMES_INFO_COUNT: u32 =
+            (::mem::size_of::<task_thread_times_info_data_t>()
+            / ::mem::size_of::<natural_t>()) as u32;
+        pub const MACH_TASK_BASIC_INFO_COUNT: u32 = (::mem::size_of::<mach_task_basic_info_data_t>()
+            / ::mem::size_of::<natural_t>()) as u32;
+        pub const HOST_VM_INFO64_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<vm_statistics64_data_t>() / ::mem::size_of::<integer_t>())
+            as mach_msg_type_number_t;
+    } else {
+        pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t = 1;
+        pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t = 4;
+        pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t = 1;
+        pub const THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_number_t = 1;
+        pub const THREAD_BACKGROUND_POLICY_COUNT: mach_msg_type_number_t = 1;
+        pub const THREAD_LATENCY_QOS_POLICY_COUNT: mach_msg_type_number_t = 1;
+        pub const THREAD_THROUGHPUT_QOS_POLICY_COUNT: mach_msg_type_number_t = 1;
+        pub const THREAD_BASIC_INFO_COUNT: mach_msg_type_number_t = 10;
+        pub const THREAD_IDENTIFIER_INFO_COUNT: mach_msg_type_number_t = 6;
+        pub const THREAD_EXTENDED_INFO_COUNT: mach_msg_type_number_t = 28;
+        pub const TASK_THREAD_TIMES_INFO_COUNT: u32 = 4;
+        pub const MACH_TASK_BASIC_INFO_COUNT: u32 = 12;
+        pub const HOST_VM_INFO64_COUNT: mach_msg_type_number_t = 38;
+    }
+}
+
+f! {
+    pub fn CMSG_NXTHDR(mhdr: *const ::msghdr,
+                       cmsg: *const ::cmsghdr) -> *mut ::cmsghdr {
+        if cmsg.is_null() {
+            return ::CMSG_FIRSTHDR(mhdr);
+        };
+        let cmsg_len = (*cmsg).cmsg_len as usize;
+        let next = cmsg as usize + __DARWIN_ALIGN32(cmsg_len as usize);
+        let max = (*mhdr).msg_control as usize
+                    + (*mhdr).msg_controllen as usize;
+        if next + __DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) > max {
+            0 as *mut ::cmsghdr
+        } else {
+            next as *mut ::cmsghdr
+        }
+    }
+
+    pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
+        (cmsg as *mut ::c_uchar)
+            .offset(__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) as isize)
+    }
+
+    pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
+        (__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>())
+            + __DARWIN_ALIGN32(length as usize))
+            as ::c_uint
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        (__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) + length as usize)
+            as ::c_uint
+    }
+
+    pub {const} fn VM_MAKE_TAG(id: u8) -> u32 {
+        (id as u32) << 24u32
+    }
+
+    pub fn major(dev: dev_t) -> i32 {
+        (dev >> 24) & 0xff
+    }
+
+    pub fn minor(dev: dev_t) -> i32 {
+        dev & 0xffffff
+    }
+
+    pub fn makedev(major: i32, minor: i32) -> dev_t {
+        (major << 24) | minor
+    }
+}
+
+safe_f! {
+    pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
+        status >> 8
+    }
+
+    pub {const} fn _WSTATUS(status: ::c_int) -> ::c_int {
+        status & 0x7f
+    }
+
+    pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
+        _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) == 0x13
+    }
+
+    pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
+        _WSTATUS(status) != _WSTOPPED && _WSTATUS(status) != 0
+    }
+
+    pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
+        _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) != 0x13
+    }
+}
+
+extern "C" {
+    pub fn setgrent();
+    #[doc(hidden)]
+    #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.5")]
+    #[cfg_attr(not(target_arch = "aarch64"), link_name = "daemon$1050")]
+    pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
+    #[doc(hidden)]
+    #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")]
+    pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
+    #[doc(hidden)]
+    #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")]
+    pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
+    pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
+    pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "aio_suspend$UNIX2003"
+    )]
+    pub fn aio_suspend(
+        aiocb_list: *const *const aiocb,
+        nitems: ::c_int,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+    pub fn chflags(path: *const ::c_char, flags: ::c_uint) -> ::c_int;
+    pub fn fchflags(fd: ::c_int, flags: ::c_uint) -> ::c_int;
+    pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "confstr$UNIX2003"
+    )]
+    pub fn confstr(name: ::c_int, buf: *mut ::c_char, len: ::size_t) -> ::size_t;
+    pub fn lio_listio(
+        mode: ::c_int,
+        aiocb_list: *const *mut aiocb,
+        nitems: ::c_int,
+        sevp: *mut sigevent,
+    ) -> ::c_int;
+
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
+
+    pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
+
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
+    pub fn getutxent() -> *mut utmpx;
+    pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
+    pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
+    pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
+    pub fn setutxent();
+    pub fn endutxent();
+    pub fn utmpxname(file: *const ::c_char) -> ::c_int;
+
+    pub fn asctime(tm: *const ::tm) -> *mut ::c_char;
+    pub fn ctime(clock: *const time_t) -> *mut ::c_char;
+    pub fn getdate(datestr: *const ::c_char) -> *mut ::tm;
+    pub fn strptime(
+        buf: *const ::c_char,
+        format: *const ::c_char,
+        timeptr: *mut ::tm,
+    ) -> *mut ::c_char;
+    pub fn asctime_r(tm: *const ::tm, result: *mut ::c_char) -> *mut ::c_char;
+    pub fn ctime_r(clock: *const time_t, result: *mut ::c_char) -> *mut ::c_char;
+
+    pub fn getnameinfo(
+        sa: *const ::sockaddr,
+        salen: ::socklen_t,
+        host: *mut ::c_char,
+        hostlen: ::socklen_t,
+        serv: *mut ::c_char,
+        servlen: ::socklen_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
+    pub fn sysctlnametomib(
+        name: *const ::c_char,
+        mibp: *mut ::c_int,
+        sizep: *mut ::size_t,
+    ) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "mprotect$UNIX2003"
+    )]
+    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+    pub fn semget(key: key_t, nsems: ::c_int, semflg: ::c_int) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "semctl$UNIX2003"
+    )]
+    pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
+    pub fn semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int;
+    pub fn shm_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::c_int;
+    pub fn ftok(pathname: *const c_char, proj_id: ::c_int) -> key_t;
+    pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
+    pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "shmctl$UNIX2003"
+    )]
+    pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
+    pub fn shmget(key: key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
+    pub fn sysctl(
+        name: *mut ::c_int,
+        namelen: ::c_uint,
+        oldp: *mut ::c_void,
+        oldlenp: *mut ::size_t,
+        newp: *mut ::c_void,
+        newlen: ::size_t,
+    ) -> ::c_int;
+    pub fn sysctlbyname(
+        name: *const ::c_char,
+        oldp: *mut ::c_void,
+        oldlenp: *mut ::size_t,
+        newp: *mut ::c_void,
+        newlen: ::size_t,
+    ) -> ::c_int;
+    #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
+    pub fn mach_absolute_time() -> u64;
+    #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
+    #[allow(deprecated)]
+    pub fn mach_timebase_info(info: *mut ::mach_timebase_info) -> ::c_int;
+    pub fn mach_host_self() -> mach_port_t;
+    pub fn mach_thread_self() -> mach_port_t;
+    pub fn pthread_setname_np(name: *const ::c_char) -> ::c_int;
+    pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
+    pub fn pthread_mach_thread_np(thread: ::pthread_t) -> ::mach_port_t;
+    pub fn pthread_from_mach_thread_np(port: ::mach_port_t) -> ::pthread_t;
+    pub fn pthread_create_from_mach_thread(
+        thread: *mut ::pthread_t,
+        attr: *const ::pthread_attr_t,
+        f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
+        value: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn pthread_stack_frame_decode_np(
+        frame_addr: ::uintptr_t,
+        return_addr: *mut ::uintptr_t,
+    ) -> ::uintptr_t;
+    pub fn pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void;
+    pub fn pthread_get_stacksize_np(thread: ::pthread_t) -> ::size_t;
+    pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int;
+    pub fn pthread_condattr_getpshared(
+        attr: *const pthread_condattr_t,
+        pshared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_main_np() -> ::c_int;
+    pub fn pthread_mutexattr_setpshared(
+        attr: *mut pthread_mutexattr_t,
+        pshared: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_mutexattr_getpshared(
+        attr: *const pthread_mutexattr_t,
+        pshared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_rwlockattr_getpshared(
+        attr: *const pthread_rwlockattr_t,
+        val: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int;
+    pub fn pthread_threadid_np(thread: ::pthread_t, thread_id: *mut u64) -> ::c_int;
+    pub fn pthread_attr_set_qos_class_np(
+        attr: *mut pthread_attr_t,
+        class: qos_class_t,
+        priority: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_attr_get_qos_class_np(
+        attr: *mut pthread_attr_t,
+        class: *mut qos_class_t,
+        priority: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_set_qos_class_self_np(class: qos_class_t, priority: ::c_int) -> ::c_int;
+    pub fn pthread_get_qos_class_np(
+        thread: ::pthread_t,
+        class: *mut qos_class_t,
+        priority: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_attr_getschedparam(
+        attr: *const ::pthread_attr_t,
+        param: *mut sched_param,
+    ) -> ::c_int;
+    pub fn pthread_attr_setschedparam(
+        attr: *mut ::pthread_attr_t,
+        param: *const sched_param,
+    ) -> ::c_int;
+    pub fn pthread_getschedparam(
+        thread: ::pthread_t,
+        policy: *mut ::c_int,
+        param: *mut sched_param,
+    ) -> ::c_int;
+    pub fn pthread_setschedparam(
+        thread: ::pthread_t,
+        policy: ::c_int,
+        param: *const sched_param,
+    ) -> ::c_int;
+
+    // Available from Big Sur
+    pub fn pthread_introspection_hook_install(
+        hook: ::pthread_introspection_hook_t,
+    ) -> ::pthread_introspection_hook_t;
+    pub fn pthread_introspection_setspecific_np(
+        thread: ::pthread_t,
+        key: ::pthread_key_t,
+        value: *const ::c_void,
+    ) -> ::c_int;
+    pub fn pthread_introspection_getspecific_np(
+        thread: ::pthread_t,
+        key: ::pthread_key_t,
+    ) -> *mut ::c_void;
+    pub fn pthread_jit_write_protect_np(enabled: ::c_int);
+    pub fn pthread_jit_write_protect_supported_np() -> ::c_int;
+    // An array of pthread_jit_write_with_callback_np must declare
+    // the list of callbacks e.g.
+    // #[link_section = "__DATA_CONST,__pth_jit_func"]
+    // static callbacks: [libc::pthread_jit_write_callback_t; 2] = [native_jit_write_cb,
+    // std::mem::transmute::<libc::pthread_jit_write_callback_t>(std::ptr::null())];
+    // (a handy PTHREAD_JIT_WRITE_CALLBACK_NP macro for other languages).
+    pub fn pthread_jit_write_with_callback_np(
+        callback: ::pthread_jit_write_callback_t,
+        ctx: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn pthread_jit_write_freeze_callbacks_np();
+    pub fn pthread_cpu_number_np(cpu_number_out: *mut ::size_t) -> ::c_int;
+
+    pub fn os_unfair_lock_lock(lock: os_unfair_lock_t);
+    pub fn os_unfair_lock_trylock(lock: os_unfair_lock_t) -> bool;
+    pub fn os_unfair_lock_unlock(lock: os_unfair_lock_t);
+    pub fn os_unfair_lock_assert_owner(lock: os_unfair_lock_t);
+    pub fn os_unfair_lock_assert_not_owner(lock: os_unfair_lock_t);
+
+    pub fn os_log_create(subsystem: *const ::c_char, category: *const ::c_char) -> ::os_log_t;
+    pub fn os_log_type_enabled(oslog: ::os_log_t, tpe: ::os_log_type_t) -> bool;
+    pub fn os_signpost_id_make_with_pointer(
+        log: ::os_log_t,
+        ptr: *const ::c_void,
+    ) -> ::os_signpost_id_t;
+    pub fn os_signpost_id_generate(log: ::os_log_t) -> ::os_signpost_id_t;
+    pub fn os_signpost_enabled(log: ::os_log_t) -> bool;
+
+    pub fn thread_policy_set(
+        thread: thread_t,
+        flavor: thread_policy_flavor_t,
+        policy_info: thread_policy_t,
+        count: mach_msg_type_number_t,
+    ) -> kern_return_t;
+    pub fn thread_policy_get(
+        thread: thread_t,
+        flavor: thread_policy_flavor_t,
+        policy_info: thread_policy_t,
+        count: *mut mach_msg_type_number_t,
+        get_default: *mut boolean_t,
+    ) -> kern_return_t;
+    pub fn thread_info(
+        target_act: thread_inspect_t,
+        flavor: thread_flavor_t,
+        thread_info_out: thread_info_t,
+        thread_info_outCnt: *mut mach_msg_type_number_t,
+    ) -> kern_return_t;
+    #[cfg_attr(doc, doc(alias = "__errno_location"))]
+    #[cfg_attr(doc, doc(alias = "errno"))]
+    pub fn __error() -> *mut ::c_int;
+    pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int;
+    pub fn backtrace_symbols(addrs: *const *mut ::c_void, sz: ::c_int) -> *mut *mut ::c_char;
+    pub fn backtrace_symbols_fd(addrs: *const *mut ::c_void, sz: ::c_int, fd: ::c_int);
+    pub fn backtrace_from_fp(
+        startfp: *mut ::c_void,
+        array: *mut *mut ::c_void,
+        size: ::c_int,
+    ) -> ::c_int;
+    pub fn backtrace_image_offsets(
+        array: *const *mut ::c_void,
+        image_offsets: *mut image_offset,
+        size: ::c_int,
+    );
+    pub fn backtrace_async(
+        array: *mut *mut ::c_void,
+        length: ::size_t,
+        task_id: *mut u32,
+    ) -> ::size_t;
+    #[cfg_attr(
+        all(target_os = "macos", not(target_arch = "aarch64")),
+        link_name = "statfs$INODE64"
+    )]
+    pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", not(target_arch = "aarch64")),
+        link_name = "fstatfs$INODE64"
+    )]
+    pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
+    pub fn kevent(
+        kq: ::c_int,
+        changelist: *const ::kevent,
+        nchanges: ::c_int,
+        eventlist: *mut ::kevent,
+        nevents: ::c_int,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn kevent64(
+        kq: ::c_int,
+        changelist: *const ::kevent64_s,
+        nchanges: ::c_int,
+        eventlist: *mut ::kevent64_s,
+        nevents: ::c_int,
+        flags: ::c_uint,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn mount(
+        src: *const ::c_char,
+        target: *const ::c_char,
+        flags: ::c_int,
+        data: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn fmount(
+        src: *const ::c_char,
+        fd: ::c_int,
+        flags: ::c_int,
+        data: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_char, data: ::c_int) -> ::c_int;
+    pub fn quotactl(
+        special: *const ::c_char,
+        cmd: ::c_int,
+        id: ::c_int,
+        data: *mut ::c_char,
+    ) -> ::c_int;
+    pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int;
+    pub fn sendfile(
+        fd: ::c_int,
+        s: ::c_int,
+        offset: ::off_t,
+        len: *mut ::off_t,
+        hdtr: *mut ::sf_hdtr,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
+    pub fn utimensat(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::timespec,
+        flag: ::c_int,
+    ) -> ::c_int;
+    pub fn openpty(
+        amaster: *mut ::c_int,
+        aslave: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *mut termios,
+        winp: *mut ::winsize,
+    ) -> ::c_int;
+    pub fn forkpty(
+        amaster: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *mut termios,
+        winp: *mut ::winsize,
+    ) -> ::pid_t;
+    pub fn login_tty(fd: ::c_int) -> ::c_int;
+    pub fn duplocale(base: ::locale_t) -> ::locale_t;
+    pub fn freelocale(loc: ::locale_t) -> ::c_int;
+    pub fn localeconv_l(loc: ::locale_t) -> *mut lconv;
+    pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+    pub fn uselocale(loc: ::locale_t) -> ::locale_t;
+    pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
+    pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
+    pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int;
+    pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int;
+    pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
+    pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
+        -> ::ssize_t;
+    pub fn getxattr(
+        path: *const ::c_char,
+        name: *const ::c_char,
+        value: *mut ::c_void,
+        size: ::size_t,
+        position: u32,
+        flags: ::c_int,
+    ) -> ::ssize_t;
+    pub fn fgetxattr(
+        filedes: ::c_int,
+        name: *const ::c_char,
+        value: *mut ::c_void,
+        size: ::size_t,
+        position: u32,
+        flags: ::c_int,
+    ) -> ::ssize_t;
+    pub fn setxattr(
+        path: *const ::c_char,
+        name: *const ::c_char,
+        value: *const ::c_void,
+        size: ::size_t,
+        position: u32,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn fsetxattr(
+        filedes: ::c_int,
+        name: *const ::c_char,
+        value: *const ::c_void,
+        size: ::size_t,
+        position: u32,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn listxattr(
+        path: *const ::c_char,
+        list: *mut ::c_char,
+        size: ::size_t,
+        flags: ::c_int,
+    ) -> ::ssize_t;
+    pub fn flistxattr(
+        filedes: ::c_int,
+        list: *mut ::c_char,
+        size: ::size_t,
+        flags: ::c_int,
+    ) -> ::ssize_t;
+    pub fn removexattr(path: *const ::c_char, name: *const ::c_char, flags: ::c_int) -> ::c_int;
+    pub fn renamex_np(from: *const ::c_char, to: *const ::c_char, flags: ::c_uint) -> ::c_int;
+    pub fn renameatx_np(
+        fromfd: ::c_int,
+        from: *const ::c_char,
+        tofd: ::c_int,
+        to: *const ::c_char,
+        flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn fremovexattr(filedes: ::c_int, name: *const ::c_char, flags: ::c_int) -> ::c_int;
+
+    pub fn getgrouplist(
+        name: *const ::c_char,
+        basegid: ::c_int,
+        groups: *mut ::c_int,
+        ngroups: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn initgroups(user: *const ::c_char, basegroup: ::c_int) -> ::c_int;
+
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "waitid$UNIX2003"
+    )]
+    pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
+        -> ::c_int;
+    pub fn brk(addr: *const ::c_void) -> *mut ::c_void;
+    pub fn sbrk(increment: ::c_int) -> *mut ::c_void;
+    pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
+    #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
+    pub fn _dyld_image_count() -> u32;
+    #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
+    #[allow(deprecated)]
+    pub fn _dyld_get_image_header(image_index: u32) -> *const mach_header;
+    #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
+    pub fn _dyld_get_image_vmaddr_slide(image_index: u32) -> ::intptr_t;
+    #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
+    pub fn _dyld_get_image_name(image_index: u32) -> *const ::c_char;
+
+    pub fn posix_spawn(
+        pid: *mut ::pid_t,
+        path: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawnp(
+        pid: *mut ::pid_t,
+        file: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
+    pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
+    pub fn posix_spawnattr_getsigdefault(
+        attr: *const posix_spawnattr_t,
+        default: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigdefault(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getsigmask(
+        attr: *const posix_spawnattr_t,
+        default: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigmask(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getflags(
+        attr: *const posix_spawnattr_t,
+        flags: *mut ::c_short,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int;
+    pub fn posix_spawnattr_getpgroup(
+        attr: *const posix_spawnattr_t,
+        flags: *mut ::pid_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
+    pub fn posix_spawnattr_setarchpref_np(
+        attr: *mut posix_spawnattr_t,
+        count: ::size_t,
+        pref: *mut ::cpu_type_t,
+        subpref: *mut ::cpu_subtype_t,
+        ocount: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getarchpref_np(
+        attr: *const posix_spawnattr_t,
+        count: ::size_t,
+        pref: *mut ::cpu_type_t,
+        subpref: *mut ::cpu_subtype_t,
+        ocount: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getbinpref_np(
+        attr: *const posix_spawnattr_t,
+        count: ::size_t,
+        pref: *mut ::cpu_type_t,
+        ocount: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setbinpref_np(
+        attr: *mut posix_spawnattr_t,
+        count: ::size_t,
+        pref: *mut ::cpu_type_t,
+        ocount: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_set_qos_class_np(
+        attr: *mut posix_spawnattr_t,
+        qos_class: ::qos_class_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_get_qos_class_np(
+        attr: *const posix_spawnattr_t,
+        qos_class: *mut ::qos_class_t,
+    ) -> ::c_int;
+
+    pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+    pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+    pub fn posix_spawn_file_actions_addopen(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+        path: *const ::c_char,
+        oflag: ::c_int,
+        mode: ::mode_t,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_addclose(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_adddup2(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+        newfd: ::c_int,
+    ) -> ::c_int;
+    pub fn uname(buf: *mut ::utsname) -> ::c_int;
+
+    pub fn connectx(
+        socket: ::c_int,
+        endpoints: *const sa_endpoints_t,
+        associd: sae_associd_t,
+        flags: ::c_uint,
+        iov: *const ::iovec,
+        iovcnt: ::c_uint,
+        len: *mut ::size_t,
+        connid: *mut sae_connid_t,
+    ) -> ::c_int;
+    pub fn disconnectx(socket: ::c_int, associd: sae_associd_t, connid: sae_connid_t) -> ::c_int;
+
+    pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
+    pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
+
+    #[cfg_attr(
+        all(target_os = "macos", not(target_arch = "aarch64")),
+        link_name = "getmntinfo$INODE64"
+    )]
+    pub fn getmntinfo(mntbufp: *mut *mut statfs, flags: ::c_int) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", not(target_arch = "aarch64")),
+        link_name = "getfsstat$INODE64"
+    )]
+    pub fn getfsstat(mntbufp: *mut statfs, bufsize: ::c_int, flags: ::c_int) -> ::c_int;
+
+    // Copy-on-write functions.
+    // According to the man page `flags` is an `int` but in the header
+    // this is a `uint32_t`.
+    pub fn clonefile(src: *const ::c_char, dst: *const ::c_char, flags: u32) -> ::c_int;
+    pub fn clonefileat(
+        src_dirfd: ::c_int,
+        src: *const ::c_char,
+        dst_dirfd: ::c_int,
+        dst: *const ::c_char,
+        flags: u32,
+    ) -> ::c_int;
+    pub fn fclonefileat(
+        srcfd: ::c_int,
+        dst_dirfd: ::c_int,
+        dst: *const ::c_char,
+        flags: u32,
+    ) -> ::c_int;
+
+    pub fn copyfile(
+        from: *const ::c_char,
+        to: *const ::c_char,
+        state: copyfile_state_t,
+        flags: copyfile_flags_t,
+    ) -> ::c_int;
+    pub fn fcopyfile(
+        from: ::c_int,
+        to: ::c_int,
+        state: copyfile_state_t,
+        flags: copyfile_flags_t,
+    ) -> ::c_int;
+    pub fn copyfile_state_free(s: copyfile_state_t) -> ::c_int;
+    pub fn copyfile_state_alloc() -> copyfile_state_t;
+    pub fn copyfile_state_get(s: copyfile_state_t, flags: u32, dst: *mut ::c_void) -> ::c_int;
+    pub fn copyfile_state_set(s: copyfile_state_t, flags: u32, src: *const ::c_void) -> ::c_int;
+
+    // Added in macOS 10.13
+    // ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1
+    pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
+    // Added in macOS 10.5
+    pub fn memset_pattern4(b: *mut ::c_void, pattern4: *const ::c_void, len: ::size_t);
+    pub fn memset_pattern8(b: *mut ::c_void, pattern8: *const ::c_void, len: ::size_t);
+    pub fn memset_pattern16(b: *mut ::c_void, pattern16: *const ::c_void, len: ::size_t);
+
+    // Inherited from BSD but available from Big Sur only
+    pub fn strtonum(
+        __numstr: *const ::c_char,
+        __minval: ::c_longlong,
+        __maxval: ::c_longlong,
+        errstrp: *mut *const ::c_char,
+    ) -> ::c_longlong;
+
+    pub fn mstats() -> mstats;
+    pub fn malloc_printf(format: *const ::c_char, ...);
+    pub fn malloc_zone_check(zone: *mut ::malloc_zone_t) -> ::boolean_t;
+    pub fn malloc_zone_print(zone: *mut ::malloc_zone_t, verbose: ::boolean_t);
+    pub fn malloc_zone_statistics(zone: *mut ::malloc_zone_t, stats: *mut malloc_statistics_t);
+    pub fn malloc_zone_log(zone: *mut ::malloc_zone_t, address: *mut ::c_void);
+    pub fn malloc_zone_print_ptr_info(ptr: *mut ::c_void);
+    pub fn malloc_default_zone() -> *mut ::malloc_zone_t;
+    pub fn malloc_zone_from_ptr(ptr: *const ::c_void) -> *mut ::malloc_zone_t;
+    pub fn malloc_zone_malloc(zone: *mut ::malloc_zone_t, size: ::size_t) -> *mut ::c_void;
+    pub fn malloc_zone_valloc(zone: *mut ::malloc_zone_t, size: ::size_t) -> *mut ::c_void;
+    pub fn malloc_zone_calloc(
+        zone: *mut ::malloc_zone_t,
+        num_items: ::size_t,
+        size: ::size_t,
+    ) -> *mut ::c_void;
+    pub fn malloc_zone_realloc(
+        zone: *mut ::malloc_zone_t,
+        ptr: *mut ::c_void,
+        size: ::size_t,
+    ) -> *mut ::c_void;
+    pub fn malloc_zone_free(zone: *mut ::malloc_zone_t, ptr: *mut ::c_void);
+
+    pub fn proc_listpids(
+        t: u32,
+        typeinfo: u32,
+        buffer: *mut ::c_void,
+        buffersize: ::c_int,
+    ) -> ::c_int;
+    pub fn proc_listallpids(buffer: *mut ::c_void, buffersize: ::c_int) -> ::c_int;
+    pub fn proc_listpgrppids(
+        pgrpid: ::pid_t,
+        buffer: *mut ::c_void,
+        buffersize: ::c_int,
+    ) -> ::c_int;
+    pub fn proc_listchildpids(ppid: ::pid_t, buffer: *mut ::c_void, buffersize: ::c_int)
+        -> ::c_int;
+    pub fn proc_pidinfo(
+        pid: ::c_int,
+        flavor: ::c_int,
+        arg: u64,
+        buffer: *mut ::c_void,
+        buffersize: ::c_int,
+    ) -> ::c_int;
+    pub fn proc_pidfdinfo(
+        pid: ::c_int,
+        fd: ::c_int,
+        flavor: ::c_int,
+        buffer: *mut ::c_void,
+        buffersize: ::c_int,
+    ) -> ::c_int;
+    pub fn proc_pidfileportinfo(
+        pid: ::c_int,
+        fileport: u32,
+        flavor: ::c_int,
+        buffer: *mut ::c_void,
+        buffersize: ::c_int,
+    ) -> ::c_int;
+    pub fn proc_pidpath(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int;
+    pub fn proc_name(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int;
+    pub fn proc_regionfilename(
+        pid: ::c_int,
+        address: u64,
+        buffer: *mut ::c_void,
+        buffersize: u32,
+    ) -> ::c_int;
+    pub fn proc_kmsgbuf(buffer: *mut ::c_void, buffersize: u32) -> ::c_int;
+    pub fn proc_libversion(major: *mut ::c_int, minor: *mut ::c_int) -> ::c_int;
+    pub fn proc_pid_rusage(pid: ::c_int, flavor: ::c_int, buffer: *mut rusage_info_t) -> ::c_int;
+
+    // Available from Big Sur
+    pub fn proc_set_no_smt() -> ::c_int;
+    pub fn proc_setthread_no_smt() -> ::c_int;
+    pub fn proc_set_csm(flags: u32) -> ::c_int;
+    pub fn proc_setthread_csm(flags: u32) -> ::c_int;
+    /// # Notes
+    ///
+    /// `id` is of type [`uuid_t`].
+    pub fn gethostuuid(id: *mut u8, timeout: *const ::timespec) -> ::c_int;
+
+    pub fn gethostid() -> ::c_long;
+    pub fn sethostid(hostid: ::c_long);
+
+    pub fn CCRandomGenerateBytes(bytes: *mut ::c_void, size: ::size_t) -> ::CCRNGStatus;
+    pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
+
+    pub fn _NSGetExecutablePath(buf: *mut ::c_char, bufsize: *mut u32) -> ::c_int;
+    pub fn _NSGetEnviron() -> *mut *mut *mut ::c_char;
+
+    pub fn mach_vm_map(
+        target_task: ::vm_map_t,
+        address: *mut ::mach_vm_address_t,
+        size: ::mach_vm_size_t,
+        mask: ::mach_vm_offset_t,
+        flags: ::c_int,
+        object: ::mem_entry_name_port_t,
+        offset: ::memory_object_offset_t,
+        copy: ::boolean_t,
+        cur_protection: ::vm_prot_t,
+        max_protection: ::vm_prot_t,
+        inheritance: ::vm_inherit_t,
+    ) -> ::kern_return_t;
+
+    pub fn vm_allocate(
+        target_task: vm_map_t,
+        address: *mut vm_address_t,
+        size: vm_size_t,
+        flags: ::c_int,
+    ) -> ::kern_return_t;
+
+    pub fn vm_deallocate(
+        target_task: vm_map_t,
+        address: vm_address_t,
+        size: vm_size_t,
+    ) -> ::kern_return_t;
+
+    pub fn host_statistics64(
+        host_priv: host_t,
+        flavor: host_flavor_t,
+        host_info64_out: host_info64_t,
+        host_info64_outCnt: *mut mach_msg_type_number_t,
+    ) -> ::kern_return_t;
+    pub fn host_processor_info(
+        host: host_t,
+        flavor: processor_flavor_t,
+        out_processor_count: *mut natural_t,
+        out_processor_info: *mut processor_info_array_t,
+        out_processor_infoCnt: *mut mach_msg_type_number_t,
+    ) -> ::kern_return_t;
+
+    pub static mut mach_task_self_: ::mach_port_t;
+    pub fn task_for_pid(
+        host: ::mach_port_t,
+        pid: ::pid_t,
+        task: *mut ::mach_port_t,
+    ) -> ::kern_return_t;
+    pub fn task_info(
+        host: ::mach_port_t,
+        flavor: task_flavor_t,
+        task_info_out: task_info_t,
+        task_info_count: *mut mach_msg_type_number_t,
+    ) -> ::kern_return_t;
+    pub fn task_create(
+        target_task: ::task_t,
+        ledgers: ::ledger_array_t,
+        ledgersCnt: ::mach_msg_type_number_t,
+        inherit_memory: ::boolean_t,
+        child_task: *mut ::task_t,
+    ) -> ::kern_return_t;
+    pub fn task_terminate(target_task: ::task_t) -> ::kern_return_t;
+    pub fn task_threads(
+        target_task: ::task_inspect_t,
+        act_list: *mut ::thread_act_array_t,
+        act_listCnt: *mut ::mach_msg_type_number_t,
+    ) -> ::kern_return_t;
+    pub fn host_statistics(
+        host_priv: host_t,
+        flavor: host_flavor_t,
+        host_info_out: host_info_t,
+        host_info_outCnt: *mut mach_msg_type_number_t,
+    ) -> ::kern_return_t;
+
+    // sysdir.h
+    pub fn sysdir_start_search_path_enumeration(
+        dir: sysdir_search_path_directory_t,
+        domainMask: sysdir_search_path_domain_mask_t,
+    ) -> ::sysdir_search_path_enumeration_state;
+    pub fn sysdir_get_next_search_path_enumeration(
+        state: ::sysdir_search_path_enumeration_state,
+        path: *mut ::c_char,
+    ) -> ::sysdir_search_path_enumeration_state;
+
+    pub static vm_page_size: vm_size_t;
+
+    pub fn getattrlist(
+        path: *const ::c_char,
+        attrList: *mut ::c_void,
+        attrBuf: *mut ::c_void,
+        attrBufSize: ::size_t,
+        options: u32,
+    ) -> ::c_int;
+    pub fn fgetattrlist(
+        fd: ::c_int,
+        attrList: *mut ::c_void,
+        attrBuf: *mut ::c_void,
+        attrBufSize: ::size_t,
+        options: u32,
+    ) -> ::c_int;
+    pub fn getattrlistat(
+        fd: ::c_int,
+        path: *const ::c_char,
+        attrList: *mut ::c_void,
+        attrBuf: *mut ::c_void,
+        attrBufSize: ::size_t,
+        options: ::c_ulong,
+    ) -> ::c_int;
+    pub fn setattrlist(
+        path: *const ::c_char,
+        attrList: *mut ::c_void,
+        attrBuf: *mut ::c_void,
+        attrBufSize: ::size_t,
+        options: u32,
+    ) -> ::c_int;
+    pub fn fsetattrlist(
+        fd: ::c_int,
+        attrList: *mut ::c_void,
+        attrBuf: *mut ::c_void,
+        attrBufSize: ::size_t,
+        options: u32,
+    ) -> ::c_int;
+    pub fn setattrlistat(
+        dir_fd: ::c_int,
+        path: *const ::c_char,
+        attrList: *mut ::c_void,
+        attrBuf: *mut ::c_void,
+        attrBufSize: ::size_t,
+        options: u32,
+    ) -> ::c_int;
+    pub fn getattrlistbulk(
+        dirfd: ::c_int,
+        attrList: *mut ::c_void,
+        attrBuf: *mut ::c_void,
+        attrBufSize: ::size_t,
+        options: u64,
+    ) -> ::c_int;
+
+    pub fn malloc_size(ptr: *const ::c_void) -> ::size_t;
+    pub fn malloc_good_size(size: ::size_t) -> ::size_t;
+
+    pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+    pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
+
+    pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
+    pub fn mknodat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::mode_t,
+        dev: dev_t,
+    ) -> ::c_int;
+    pub fn freadlink(fd: ::c_int, buf: *mut ::c_char, size: ::size_t) -> ::c_int;
+    pub fn execvP(
+        file: *const ::c_char,
+        search_path: *const ::c_char,
+        argv: *const *mut ::c_char,
+    ) -> ::c_int;
+}
+
+pub unsafe fn mach_task_self() -> ::mach_port_t {
+    mach_task_self_
+}
+
+cfg_if! {
+    if #[cfg(target_os = "macos")] {
+        extern "C" {
+            pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+        }
+    }
+}
+cfg_if! {
+    if #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "visionos"))] {
+        extern "C" {
+            pub fn memmem(
+                haystack: *const ::c_void,
+                haystacklen: ::size_t,
+                needle: *const ::c_void,
+                needlelen: ::size_t,
+            ) -> *mut ::c_void;
+            pub fn task_set_info(target_task: ::task_t,
+                                 flavor: ::task_flavor_t,
+                                 task_info_in: ::task_info_t,
+                                 task_info_inCnt: ::mach_msg_type_number_t
+            ) -> ::kern_return_t;
+        }
+    }
+}
+
+// These require a dependency on `libiconv`, and including this when built as
+// part of `std` means every Rust program gets it. Ideally we would have a link
+// modifier to only include these if they are used, but we do not.
+#[cfg_attr(not(feature = "rustc-dep-of-std"), link(name = "iconv"))]
+extern "C" {
+    pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
+    pub fn iconv(
+        cd: iconv_t,
+        inbuf: *mut *mut ::c_char,
+        inbytesleft: *mut ::size_t,
+        outbuf: *mut *mut ::c_char,
+        outbytesleft: *mut ::size_t,
+    ) -> ::size_t;
+    pub fn iconv_close(cd: iconv_t) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(target_pointer_width = "32")] {
+        mod b32;
+        pub use self::b32::*;
+    } else if #[cfg(target_pointer_width = "64")] {
+        mod b64;
+        pub use self::b64::*;
+    } else {
+        // Unknown target_arch
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_long_array)] {
+        mod long_array;
+        pub use self::long_array::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/dragonfly/errno.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/dragonfly/errno.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/dragonfly/errno.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/dragonfly/errno.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,13 @@
+// DragonFlyBSD's __error function is declared with "static inline", so it must
+// be implemented in the libc crate, as a pointer to a static thread_local.
+f! {
+    #[deprecated(since = "0.2.77", note = "Use `__errno_location()` instead")]
+    pub fn __error() -> *mut ::c_int {
+        &mut errno
+    }
+}
+
+extern "C" {
+    #[thread_local]
+    pub static mut errno: ::c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1732 @@
+pub type dev_t = u32;
+pub type c_char = i8;
+pub type wchar_t = i32;
+pub type clock_t = u64;
+pub type ino_t = u64;
+pub type lwpid_t = i32;
+pub type nlink_t = u32;
+pub type blksize_t = i64;
+pub type clockid_t = ::c_ulong;
+
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type time_t = i64;
+pub type suseconds_t = i64;
+
+pub type uuid_t = ::uuid;
+
+pub type fsblkcnt_t = u64;
+pub type fsfilcnt_t = u64;
+pub type idtype_t = ::c_uint;
+pub type shmatt_t = ::c_uint;
+
+pub type mqd_t = ::c_int;
+pub type sem_t = *mut sem;
+
+pub type cpuset_t = cpumask_t;
+pub type cpu_set_t = cpumask_t;
+
+pub type register_t = ::c_long;
+pub type umtx_t = ::c_int;
+pub type pthread_barrierattr_t = ::c_int;
+pub type pthread_barrier_t = ::uintptr_t;
+pub type pthread_spinlock_t = ::uintptr_t;
+
+pub type segsz_t = usize;
+
+pub type vm_prot_t = u8;
+pub type vm_maptype_t = u8;
+pub type vm_inherit_t = i8;
+pub type vm_subsys_t = ::c_int;
+pub type vm_eflags_t = ::c_uint;
+
+pub type vm_map_t = *mut __c_anonymous_vm_map;
+pub type vm_map_entry_t = *mut vm_map_entry;
+
+pub type pmap = __c_anonymous_pmap;
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum sem {}
+impl ::Copy for sem {}
+impl ::Clone for sem {
+    fn clone(&self) -> sem {
+        *self
+    }
+}
+
+e! {
+    #[repr(u32)]
+    pub enum lwpstat {
+        LSRUN = 1,
+        LSSTOP = 2,
+        LSSLEEP = 3,
+    }
+
+    #[repr(u32)]
+    pub enum procstat {
+        SIDL = 1,
+        SACTIVE = 2,
+        SSTOP = 3,
+        SZOMB = 4,
+        SCORE = 5,
+    }
+}
+
+s! {
+    pub struct kevent {
+        pub ident: ::uintptr_t,
+        pub filter: ::c_short,
+        pub flags: ::c_ushort,
+        pub fflags: ::c_uint,
+        pub data: ::intptr_t,
+        pub udata: *mut ::c_void,
+    }
+
+    pub struct exit_status {
+        pub e_termination: u16,
+        pub e_exit: u16
+    }
+
+    pub struct aiocb {
+        pub aio_fildes: ::c_int,
+        pub aio_offset: ::off_t,
+        pub aio_buf: *mut ::c_void,
+        pub aio_nbytes: ::size_t,
+        pub aio_sigevent: sigevent,
+        pub aio_lio_opcode: ::c_int,
+        pub aio_reqprio: ::c_int,
+        _aio_val: ::c_int,
+        _aio_err: ::c_int
+    }
+
+    pub struct uuid {
+        pub time_low: u32,
+        pub time_mid: u16,
+        pub time_hi_and_version: u16,
+        pub clock_seq_hi_and_reserved: u8,
+        pub clock_seq_low: u8,
+        pub node: [u8; 6],
+    }
+
+    pub struct mq_attr {
+        pub mq_flags: ::c_long,
+        pub mq_maxmsg: ::c_long,
+        pub mq_msgsize: ::c_long,
+        pub mq_curmsgs: ::c_long,
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        pub f_owner: ::uid_t,
+        pub f_type: ::c_uint,
+        pub f_syncreads: u64,
+        pub f_syncwrites: u64,
+        pub f_asyncreads: u64,
+        pub f_asyncwrites: u64,
+        pub f_fsid_uuid: ::uuid_t,
+        pub f_uid_uuid: ::uuid_t,
+    }
+
+    pub struct stat {
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_dev: ::dev_t,
+        pub st_mode: ::mode_t,
+        pub st_padding1: u16,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_size: ::off_t,
+        pub st_blocks: i64,
+        pub __old_st_blksize: u32,
+        pub st_flags: u32,
+        pub st_gen: u32,
+        pub st_lspare: i32,
+        pub st_blksize: i64,
+        pub st_qspare2: i64,
+    }
+
+    pub struct if_data {
+        pub ifi_type: ::c_uchar,
+        pub ifi_physical: ::c_uchar,
+        pub ifi_addrlen: ::c_uchar,
+        pub ifi_hdrlen: ::c_uchar,
+        pub ifi_recvquota: ::c_uchar,
+        pub ifi_xmitquota: ::c_uchar,
+        pub ifi_mtu: ::c_ulong,
+        pub ifi_metric: ::c_ulong,
+        pub ifi_link_state: ::c_ulong,
+        pub ifi_baudrate: u64,
+        pub ifi_ipackets: ::c_ulong,
+        pub ifi_ierrors: ::c_ulong,
+        pub ifi_opackets: ::c_ulong,
+        pub ifi_oerrors: ::c_ulong,
+        pub ifi_collisions: ::c_ulong,
+        pub ifi_ibytes: ::c_ulong,
+        pub ifi_obytes: ::c_ulong,
+        pub ifi_imcasts: ::c_ulong,
+        pub ifi_omcasts: ::c_ulong,
+        pub ifi_iqdrops: ::c_ulong,
+        pub ifi_noproto: ::c_ulong,
+        pub ifi_hwassist: ::c_ulong,
+        pub ifi_oqdrops: ::c_ulong,
+        pub ifi_lastchange: ::timeval,
+    }
+
+    pub struct if_msghdr {
+        pub ifm_msglen: ::c_ushort,
+        pub ifm_version: ::c_uchar,
+        pub ifm_type: ::c_uchar,
+        pub ifm_addrs: ::c_int,
+        pub ifm_flags: ::c_int,
+        pub ifm_index: ::c_ushort,
+        pub ifm_data: if_data,
+    }
+
+    pub struct sockaddr_dl {
+        pub sdl_len: ::c_uchar,
+        pub sdl_family: ::c_uchar,
+        pub sdl_index: ::c_ushort,
+        pub sdl_type: ::c_uchar,
+        pub sdl_nlen: ::c_uchar,
+        pub sdl_alen: ::c_uchar,
+        pub sdl_slen: ::c_uchar,
+        pub sdl_data: [::c_char; 12],
+        pub sdl_rcf: ::c_ushort,
+        pub sdl_route: [::c_ushort; 16],
+    }
+
+    pub struct xucred {
+        pub cr_version: ::c_uint,
+        pub cr_uid: ::uid_t,
+        pub cr_ngroups: ::c_short,
+        pub cr_groups: [::gid_t; 16],
+        __cr_unused1: *mut ::c_void,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_size: ::size_t,
+        pub ss_flags: ::c_int,
+    }
+
+    pub struct cpumask_t {
+        ary: [u64; 4],
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        shm_internal: *mut ::c_void,
+    }
+
+    pub struct kinfo_file {
+        pub f_size: ::size_t,
+        pub f_pid: ::pid_t,
+        pub f_uid: ::uid_t,
+        pub f_fd: ::c_int,
+        pub f_file: *mut ::c_void,
+        pub f_type: ::c_short,
+        pub f_count: ::c_int,
+        pub f_msgcount: ::c_int,
+        pub f_offset: ::off_t,
+        pub f_data: *mut ::c_void,
+        pub f_flag: ::c_uint,
+    }
+
+    pub struct kinfo_cputime {
+        pub cp_user: u64,
+        pub cp_nice: u64,
+        pub cp_sys: u64,
+        pub cp_intr: u64,
+        pub cp_idel: u64,
+        cp_unused01: u64,
+        cp_unused02: u64,
+        pub cp_sample_pc: u64,
+        pub cp_sample_sp: u64,
+        pub cp_msg: [::c_char; 32],
+    }
+
+    pub struct kinfo_lwp {
+        pub kl_pid: ::pid_t,
+        pub kl_tid: ::lwpid_t,
+        pub kl_flags: ::c_int,
+        pub kl_stat: ::lwpstat,
+        pub kl_lock: ::c_int,
+        pub kl_tdflags: ::c_int,
+        pub kl_mpcount: ::c_int,
+        pub kl_prio: ::c_int,
+        pub kl_tdprio: ::c_int,
+        pub kl_rtprio: ::rtprio,
+        pub kl_uticks: u64,
+        pub kl_sticks: u64,
+        pub kl_iticks: u64,
+        pub kl_cpticks: u64,
+        pub kl_pctcpu: ::c_uint,
+        pub kl_slptime: ::c_uint,
+        pub kl_origcpu: ::c_int,
+        pub kl_estcpu: ::c_int,
+        pub kl_cpuid: ::c_int,
+        pub kl_ru: ::rusage,
+        pub kl_siglist: ::sigset_t,
+        pub kl_sigmask: ::sigset_t,
+        pub kl_wchan: ::uintptr_t,
+        pub kl_wmesg: [::c_char; 9],
+        pub kl_comm: [::c_char; MAXCOMLEN+1],
+    }
+
+    pub struct kinfo_proc {
+        pub kp_paddr: ::uintptr_t,
+        pub kp_flags: ::c_int,
+        pub kp_stat: ::procstat,
+        pub kp_lock: ::c_int,
+        pub kp_acflag: ::c_int,
+        pub kp_traceflag: ::c_int,
+        pub kp_fd: ::uintptr_t,
+        pub kp_siglist: ::sigset_t,
+        pub kp_sigignore: ::sigset_t,
+        pub kp_sigcatch: ::sigset_t,
+        pub kp_sigflag: ::c_int,
+        pub kp_start: ::timeval,
+        pub kp_comm: [::c_char; MAXCOMLEN+1],
+        pub kp_uid: ::uid_t,
+        pub kp_ngroups: ::c_short,
+        pub kp_groups: [::gid_t; NGROUPS],
+        pub kp_ruid: ::uid_t,
+        pub kp_svuid: ::uid_t,
+        pub kp_rgid: ::gid_t,
+        pub kp_svgid: ::gid_t,
+        pub kp_pid: ::pid_t,
+        pub kp_ppid: ::pid_t,
+        pub kp_pgid: ::pid_t,
+        pub kp_jobc: ::c_int,
+        pub kp_sid: ::pid_t,
+        pub kp_login: [::c_char; 40], // MAXNAMELEN rounded up to the nearest sizeof(long)
+        pub kp_tdev: ::dev_t,
+        pub kp_tpgid: ::pid_t,
+        pub kp_tsid: ::pid_t,
+        pub kp_exitstat: ::c_ushort,
+        pub kp_nthreads: ::c_int,
+        pub kp_nice: ::c_int,
+        pub kp_swtime: ::c_uint,
+        pub kp_vm_map_size: ::size_t,
+        pub kp_vm_rssize: ::segsz_t,
+        pub kp_vm_swrss: ::segsz_t,
+        pub kp_vm_tsize: ::segsz_t,
+        pub kp_vm_dsize: ::segsz_t,
+        pub kp_vm_ssize: ::segsz_t,
+        pub kp_vm_prssize: ::c_uint,
+        pub kp_jailid: ::c_int,
+        pub kp_ru: ::rusage,
+        pub kp_cru: ::rusage,
+        pub kp_auxflags: ::c_int,
+        pub kp_lwp: ::kinfo_lwp,
+        pub kp_ktaddr: ::uintptr_t,
+        kp_spare: [::c_int; 2],
+    }
+
+    pub struct __c_anonymous_vm_map {
+        _priv: [::uintptr_t; 36],
+    }
+
+    pub struct vm_map_entry {
+        _priv: [::uintptr_t; 15],
+        pub eflags: ::vm_eflags_t,
+        pub maptype: ::vm_maptype_t,
+        pub protection: ::vm_prot_t,
+        pub max_protection: ::vm_prot_t,
+        pub inheritance: ::vm_inherit_t,
+        pub wired_count: ::c_int,
+        pub id: ::vm_subsys_t,
+    }
+
+    pub struct __c_anonymous_pmap {
+        _priv1: [::uintptr_t; 32],
+        _priv2: [::uintptr_t; 32],
+        _priv3: [::uintptr_t; 32],
+        _priv4: [::uintptr_t; 32],
+        _priv5: [::uintptr_t; 8],
+    }
+
+    pub struct vmspace {
+        vm_map: __c_anonymous_vm_map,
+        vm_pmap: __c_anonymous_pmap,
+        pub vm_flags: ::c_int,
+        pub vm_shm: *mut ::c_char,
+        pub vm_rssize: ::segsz_t,
+        pub vm_swrss: ::segsz_t,
+        pub vm_tsize: ::segsz_t,
+        pub vm_dsize: ::segsz_t,
+        pub vm_ssize: ::segsz_t,
+        pub vm_taddr: *mut ::c_char,
+        pub vm_daddr: *mut ::c_char,
+        pub vm_maxsaddr: *mut ::c_char,
+        pub vm_minsaddr: *mut ::c_char,
+        _unused1: ::c_int,
+        _unused2: ::c_int,
+        pub vm_pagesupply: ::c_int,
+        pub vm_holdcnt: ::c_uint,
+        pub vm_refcnt: ::c_uint,
+    }
+
+    pub struct cpuctl_msr_args_t {
+        pub msr: ::c_int,
+        pub data: u64,
+    }
+
+    pub struct cpuctl_cpuid_args_t {
+        pub level: ::c_int,
+        pub data: [u32; 4],
+    }
+
+    pub struct cpuctl_cpuid_count_args_t {
+        pub level: ::c_int,
+        pub level_type: ::c_int,
+        pub data: [u32; 4],
+    }
+
+    pub struct cpuctl_update_args_t {
+        pub data: *mut ::c_void,
+        pub size: ::size_t,
+    }
+}
+
+s_no_extra_traits! {
+    pub struct utmpx {
+        pub ut_name: [::c_char; 32],
+        pub ut_id: [::c_char; 4],
+
+        pub ut_line: [::c_char; 32],
+        pub ut_host: [::c_char; 256],
+
+        pub ut_unused: [u8; 16],
+        pub ut_session: u16,
+        pub ut_type: u16,
+        pub ut_pid: ::pid_t,
+        ut_exit: exit_status,
+        ut_ss: ::sockaddr_storage,
+        pub ut_tv: ::timeval,
+        pub ut_unused2: [u8; 16],
+    }
+
+    pub struct lastlogx {
+        pub ll_tv: ::timeval,
+        pub ll_line: [::c_char; _UTX_LINESIZE],
+        pub ll_host: [::c_char; _UTX_HOSTSIZE],
+        pub ll_ss: ::sockaddr_storage,
+    }
+
+    pub struct dirent {
+        pub d_fileno: ::ino_t,
+        pub d_namlen: u16,
+        pub d_type: u8,
+        __unused1: u8,
+        __unused2: u32,
+        pub d_name: [::c_char; 256],
+    }
+
+    pub struct statfs {
+        __spare2: ::c_long,
+        pub f_bsize: ::c_long,
+        pub f_iosize: ::c_long,
+        pub f_blocks: ::c_long,
+        pub f_bfree: ::c_long,
+        pub f_bavail: ::c_long,
+        pub f_files: ::c_long,
+        pub f_ffree: ::c_long,
+        pub f_fsid: ::fsid_t,
+        pub f_owner: ::uid_t,
+        pub f_type: ::c_int,
+        pub f_flags: ::c_int,
+        pub f_syncwrites: ::c_long,
+        pub f_asyncwrites: ::c_long,
+        pub f_fstypename: [::c_char; 16],
+        pub f_mntonname: [::c_char; 80],
+        pub f_syncreads: ::c_long,
+        pub f_asyncreads: ::c_long,
+        __spares1: ::c_short,
+        pub f_mntfromname: [::c_char; 80],
+        __spares2: ::c_short,
+        __spare: [::c_long; 2],
+    }
+
+    pub struct sigevent {
+        pub sigev_notify: ::c_int,
+        // The union is 8-byte in size, so it is aligned at a 8-byte offset.
+        #[cfg(target_pointer_width = "64")]
+        __unused1: ::c_int,
+        pub sigev_signo: ::c_int,       //actually a union
+        // pad the union
+        #[cfg(target_pointer_width = "64")]
+        __unused2: ::c_int,
+        pub sigev_value: ::sigval,
+        __unused3: *mut ::c_void        //actually a function pointer
+    }
+
+    pub struct mcontext_t {
+        pub mc_onstack: register_t,
+        pub mc_rdi: register_t,
+        pub mc_rsi: register_t,
+        pub mc_rdx: register_t,
+        pub mc_rcx: register_t,
+        pub mc_r8: register_t,
+        pub mc_r9: register_t,
+        pub mc_rax: register_t,
+        pub mc_rbx: register_t,
+        pub mc_rbp: register_t,
+        pub mc_r10: register_t,
+        pub mc_r11: register_t,
+        pub mc_r12: register_t,
+        pub mc_r13: register_t,
+        pub mc_r14: register_t,
+        pub mc_r15: register_t,
+        pub mc_xflags: register_t,
+        pub mc_trapno: register_t,
+        pub mc_addr: register_t,
+        pub mc_flags: register_t,
+        pub mc_err: register_t,
+        pub mc_rip: register_t,
+        pub mc_cs: register_t,
+        pub mc_rflags: register_t,
+        pub mc_rsp: register_t,
+        pub mc_ss: register_t,
+        pub mc_len: ::c_uint,
+        pub mc_fpformat: ::c_uint,
+        pub mc_ownedfp: ::c_uint,
+        __reserved: ::c_uint,
+        __unused: [::c_uint; 8],
+        pub mc_fpregs: [[::c_uint; 8]; 32],
+    }
+
+    pub struct ucontext_t {
+        pub uc_sigmask: ::sigset_t,
+        pub uc_mcontext: mcontext_t,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: stack_t,
+        pub uc_cofunc: ::Option<unsafe extern "C" fn(uc: *mut ucontext_t, arg: *mut ::c_void)>,
+        pub uc_arg: *mut ::c_void,
+        __pad: [::c_int; 4],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for utmpx {
+            fn eq(&self, other: &utmpx) -> bool {
+                self.ut_name == other.ut_name
+                    && self.ut_id == other.ut_id
+                    && self.ut_line == other.ut_line
+                    && self
+                    .ut_host
+                    .iter()
+                    .zip(other.ut_host.iter())
+                    .all(|(a,b)| a == b)
+                    && self.ut_unused == other.ut_unused
+                    && self.ut_session == other.ut_session
+                    && self.ut_type == other.ut_type
+                    && self.ut_pid == other.ut_pid
+                    && self.ut_exit == other.ut_exit
+                    && self.ut_ss == other.ut_ss
+                    && self.ut_tv == other.ut_tv
+                    && self.ut_unused2 == other.ut_unused2
+            }
+        }
+        impl Eq for utmpx {}
+        impl ::fmt::Debug for utmpx {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("utmpx")
+                    .field("ut_name", &self.ut_name)
+                    .field("ut_id", &self.ut_id)
+                    .field("ut_line", &self.ut_line)
+                    // FIXME: .field("ut_host", &self.ut_host)
+                    .field("ut_unused", &self.ut_unused)
+                    .field("ut_session", &self.ut_session)
+                    .field("ut_type", &self.ut_type)
+                    .field("ut_pid", &self.ut_pid)
+                    .field("ut_exit", &self.ut_exit)
+                    .field("ut_ss", &self.ut_ss)
+                    .field("ut_tv", &self.ut_tv)
+                    .field("ut_unused2", &self.ut_unused2)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for utmpx {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ut_name.hash(state);
+                self.ut_id.hash(state);
+                self.ut_line.hash(state);
+                self.ut_host.hash(state);
+                self.ut_unused.hash(state);
+                self.ut_session.hash(state);
+                self.ut_type.hash(state);
+                self.ut_pid.hash(state);
+                self.ut_exit.hash(state);
+                self.ut_ss.hash(state);
+                self.ut_tv.hash(state);
+                self.ut_unused2.hash(state);
+            }
+        }
+        impl PartialEq for lastlogx {
+            fn eq(&self, other: &lastlogx) -> bool {
+                self.ll_tv == other.ll_tv
+                    && self.ll_line == other.ll_line
+                    && self.ll_host == other.ll_host
+                    && self.ll_ss == other.ll_ss
+            }
+        }
+        impl Eq for lastlogx {}
+        impl ::fmt::Debug for lastlogx {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("lastlogx")
+                    .field("ll_tv", &self.ll_tv)
+                    .field("ll_line", &self.ll_line)
+                    .field("ll_host", &self.ll_host)
+                    .field("ll_ss", &self.ll_ss)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for lastlogx {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ll_tv.hash(state);
+                self.ll_line.hash(state);
+                self.ll_host.hash(state);
+                self.ll_ss.hash(state);
+            }
+        }
+
+        impl PartialEq for dirent {
+            fn eq(&self, other: &dirent) -> bool {
+                self.d_fileno == other.d_fileno
+                    && self.d_namlen == other.d_namlen
+                    && self.d_type == other.d_type
+                    // Ignore __unused1
+                    // Ignore __unused2
+                    && self
+                    .d_name
+                    .iter()
+                    .zip(other.d_name.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for dirent {}
+        impl ::fmt::Debug for dirent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("dirent")
+                    .field("d_fileno", &self.d_fileno)
+                    .field("d_namlen", &self.d_namlen)
+                    .field("d_type", &self.d_type)
+                    // Ignore __unused1
+                    // Ignore __unused2
+                    // FIXME: .field("d_name", &self.d_name)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for dirent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.d_fileno.hash(state);
+                self.d_namlen.hash(state);
+                self.d_type.hash(state);
+                    // Ignore __unused1
+                    // Ignore __unused2
+                self.d_name.hash(state);
+            }
+        }
+
+        impl PartialEq for statfs {
+            fn eq(&self, other: &statfs) -> bool {
+                self.f_bsize == other.f_bsize
+                    && self.f_iosize == other.f_iosize
+                    && self.f_blocks == other.f_blocks
+                    && self.f_bfree == other.f_bfree
+                    && self.f_bavail == other.f_bavail
+                    && self.f_files == other.f_files
+                    && self.f_ffree == other.f_ffree
+                    && self.f_fsid == other.f_fsid
+                    && self.f_owner == other.f_owner
+                    && self.f_type == other.f_type
+                    && self.f_flags == other.f_flags
+                    && self.f_syncwrites == other.f_syncwrites
+                    && self.f_asyncwrites == other.f_asyncwrites
+                    && self.f_fstypename == other.f_fstypename
+                    && self
+                    .f_mntonname
+                    .iter()
+                    .zip(other.f_mntonname.iter())
+                    .all(|(a,b)| a == b)
+                    && self.f_syncreads == other.f_syncreads
+                    && self.f_asyncreads == other.f_asyncreads
+                    && self
+                    .f_mntfromname
+                    .iter()
+                    .zip(other.f_mntfromname.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for statfs {}
+        impl ::fmt::Debug for statfs {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("statfs")
+                    .field("f_bsize", &self.f_bsize)
+                    .field("f_iosize", &self.f_iosize)
+                    .field("f_blocks", &self.f_blocks)
+                    .field("f_bfree", &self.f_bfree)
+                    .field("f_bavail", &self.f_bavail)
+                    .field("f_files", &self.f_files)
+                    .field("f_ffree", &self.f_ffree)
+                    .field("f_fsid", &self.f_fsid)
+                    .field("f_owner", &self.f_owner)
+                    .field("f_type", &self.f_type)
+                    .field("f_flags", &self.f_flags)
+                    .field("f_syncwrites", &self.f_syncwrites)
+                    .field("f_asyncwrites", &self.f_asyncwrites)
+                    // FIXME: .field("f_mntonname", &self.f_mntonname)
+                    .field("f_syncreads", &self.f_syncreads)
+                    .field("f_asyncreads", &self.f_asyncreads)
+                    // FIXME: .field("f_mntfromname", &self.f_mntfromname)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for statfs {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.f_bsize.hash(state);
+                self.f_iosize.hash(state);
+                self.f_blocks.hash(state);
+                self.f_bfree.hash(state);
+                self.f_bavail.hash(state);
+                self.f_files.hash(state);
+                self.f_ffree.hash(state);
+                self.f_fsid.hash(state);
+                self.f_owner.hash(state);
+                self.f_type.hash(state);
+                self.f_flags.hash(state);
+                self.f_syncwrites.hash(state);
+                self.f_asyncwrites.hash(state);
+                self.f_fstypename.hash(state);
+                self.f_mntonname.hash(state);
+                self.f_syncreads.hash(state);
+                self.f_asyncreads.hash(state);
+                self.f_mntfromname.hash(state);
+            }
+        }
+
+        impl PartialEq for sigevent {
+            fn eq(&self, other: &sigevent) -> bool {
+                self.sigev_notify == other.sigev_notify
+                    && self.sigev_signo == other.sigev_signo
+                    && self.sigev_value == other.sigev_value
+            }
+        }
+        impl Eq for sigevent {}
+        impl ::fmt::Debug for sigevent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sigevent")
+                    .field("sigev_notify", &self.sigev_notify)
+                    .field("sigev_signo", &self.sigev_signo)
+                    .field("sigev_value", &self.sigev_value)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sigevent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sigev_notify.hash(state);
+                self.sigev_signo.hash(state);
+                self.sigev_value.hash(state);
+            }
+        }
+        impl PartialEq for mcontext_t {
+            fn eq(&self, other: &mcontext_t) -> bool {
+                self.mc_onstack == other.mc_onstack &&
+                self.mc_rdi == other.mc_rdi &&
+                self.mc_rsi == other.mc_rsi &&
+                self.mc_rdx == other.mc_rdx &&
+                self.mc_rcx == other.mc_rcx &&
+                self.mc_r8 == other.mc_r8 &&
+                self.mc_r9 == other.mc_r9 &&
+                self.mc_rax == other.mc_rax &&
+                self.mc_rbx == other.mc_rbx &&
+                self.mc_rbp == other.mc_rbp &&
+                self.mc_r10 == other.mc_r10 &&
+                self.mc_r11 == other.mc_r11 &&
+                self.mc_r12 == other.mc_r12 &&
+                self.mc_r13 == other.mc_r13 &&
+                self.mc_r14 == other.mc_r14 &&
+                self.mc_r15 == other.mc_r15 &&
+                self.mc_xflags == other.mc_xflags &&
+                self.mc_trapno == other.mc_trapno &&
+                self.mc_addr == other.mc_addr &&
+                self.mc_flags == other.mc_flags &&
+                self.mc_err == other.mc_err &&
+                self.mc_rip == other.mc_rip &&
+                self.mc_cs == other.mc_cs &&
+                self.mc_rflags == other.mc_rflags &&
+                self.mc_rsp == other.mc_rsp &&
+                self.mc_ss == other.mc_ss &&
+                self.mc_len == other.mc_len &&
+                self.mc_fpformat == other.mc_fpformat &&
+                self.mc_ownedfp == other.mc_ownedfp &&
+                self.mc_fpregs.iter().zip(other.mc_fpregs.iter()).
+                all(|(a, b)| a == b)
+            }
+        }
+        impl Eq for mcontext_t {}
+        impl ::fmt::Debug for mcontext_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("mcontext_t")
+                    .field("mc_onstack", &self.mc_onstack)
+                    .field("mc_rdi", &self.mc_rdi)
+                    .field("mc_rsi", &self.mc_rsi)
+                    .field("mc_rdx", &self.mc_rdx)
+                    .field("mc_rcx", &self.mc_rcx)
+                    .field("mc_r8", &self.mc_r8)
+                    .field("mc_r9", &self.mc_r9)
+                    .field("mc_rax", &self.mc_rax)
+                    .field("mc_rbx", &self.mc_rbx)
+                    .field("mc_rbp", &self.mc_rbp)
+                    .field("mc_r10", &self.mc_r10)
+                    .field("mc_r11", &self.mc_r11)
+                    .field("mc_r12", &self.mc_r12)
+                    .field("mc_r13", &self.mc_r13)
+                    .field("mc_r14", &self.mc_r14)
+                    .field("mc_r15", &self.mc_r15)
+                    .field("mc_xflags", &self.mc_xflags)
+                    .field("mc_trapno", &self.mc_trapno)
+                    .field("mc_addr", &self.mc_addr)
+                    .field("mc_flags", &self.mc_flags)
+                    .field("mc_err", &self.mc_err)
+                    .field("mc_rip", &self.mc_rip)
+                    .field("mc_cs", &self.mc_cs)
+                    .field("mc_rflags", &self.mc_rflags)
+                    .field("mc_rsp", &self.mc_rsp)
+                    .field("mc_ss", &self.mc_ss)
+                    .field("mc_len", &self.mc_len)
+                    .field("mc_fpformat", &self.mc_fpformat)
+                    .field("mc_ownedfp", &self.mc_ownedfp)
+                    .field("mc_fpregs", &self.mc_fpregs)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for mcontext_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.mc_onstack.hash(state);
+                self.mc_rdi.hash(state);
+                self.mc_rsi.hash(state);
+                self.mc_rdx.hash(state);
+                self.mc_rcx.hash(state);
+                self.mc_r8.hash(state);
+                self.mc_r9.hash(state);
+                self.mc_rax.hash(state);
+                self.mc_rbx.hash(state);
+                self.mc_rbp.hash(state);
+                self.mc_r10.hash(state);
+                self.mc_r11.hash(state);
+                self.mc_r10.hash(state);
+                self.mc_r11.hash(state);
+                self.mc_r12.hash(state);
+                self.mc_r13.hash(state);
+                self.mc_r14.hash(state);
+                self.mc_r15.hash(state);
+                self.mc_xflags.hash(state);
+                self.mc_trapno.hash(state);
+                self.mc_addr.hash(state);
+                self.mc_flags.hash(state);
+                self.mc_err.hash(state);
+                self.mc_rip.hash(state);
+                self.mc_cs.hash(state);
+                self.mc_rflags.hash(state);
+                self.mc_rsp.hash(state);
+                self.mc_ss.hash(state);
+                self.mc_len.hash(state);
+                self.mc_fpformat.hash(state);
+                self.mc_ownedfp.hash(state);
+                self.mc_fpregs.hash(state);
+            }
+        }
+        impl PartialEq for ucontext_t {
+            fn eq(&self, other: &ucontext_t) -> bool {
+                self.uc_sigmask == other.uc_sigmask
+                    && self.uc_mcontext == other.uc_mcontext
+                    && self.uc_link == other.uc_link
+                    && self.uc_stack == other.uc_stack
+                    && self.uc_cofunc == other.uc_cofunc
+                    && self.uc_arg == other.uc_arg
+            }
+        }
+        impl Eq for ucontext_t {}
+        impl ::fmt::Debug for ucontext_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ucontext_t")
+                    .field("uc_sigmask", &self.uc_sigmask)
+                    .field("uc_mcontext", &self.uc_mcontext)
+                    .field("uc_link", &self.uc_link)
+                    .field("uc_stack", &self.uc_stack)
+                    .field("uc_cofunc", &self.uc_cofunc)
+                    .field("uc_arg", &self.uc_arg)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for ucontext_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.uc_sigmask.hash(state);
+                self.uc_mcontext.hash(state);
+                self.uc_link.hash(state);
+                self.uc_stack.hash(state);
+                self.uc_cofunc.hash(state);
+                self.uc_arg.hash(state);
+            }
+        }
+    }
+}
+
+pub const RAND_MAX: ::c_int = 0x7fff_ffff;
+pub const PTHREAD_STACK_MIN: ::size_t = 16384;
+pub const SIGSTKSZ: ::size_t = 40960;
+pub const SIGCKPT: ::c_int = 33;
+pub const SIGCKPTEXIT: ::c_int = 34;
+pub const CKPT_FREEZE: ::c_int = 0x1;
+pub const CKPT_THAW: ::c_int = 0x2;
+pub const MADV_INVAL: ::c_int = 10;
+pub const MADV_SETMAP: ::c_int = 11;
+pub const O_CLOEXEC: ::c_int = 0x00020000;
+pub const O_DIRECTORY: ::c_int = 0x08000000;
+pub const F_GETLK: ::c_int = 7;
+pub const F_SETLK: ::c_int = 8;
+pub const F_SETLKW: ::c_int = 9;
+pub const F_GETPATH: ::c_int = 19;
+pub const ENOMEDIUM: ::c_int = 93;
+pub const ENOTRECOVERABLE: ::c_int = 94;
+pub const EOWNERDEAD: ::c_int = 95;
+pub const EASYNC: ::c_int = 99;
+pub const ELAST: ::c_int = 99;
+pub const RLIMIT_POSIXLOCKS: ::c_int = 11;
+#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+pub const RLIM_NLIMITS: ::rlim_t = 12;
+
+pub const Q_GETQUOTA: ::c_int = 0x300;
+pub const Q_SETQUOTA: ::c_int = 0x400;
+
+pub const CTL_UNSPEC: ::c_int = 0;
+pub const CTL_KERN: ::c_int = 1;
+pub const CTL_VM: ::c_int = 2;
+pub const CTL_VFS: ::c_int = 3;
+pub const CTL_NET: ::c_int = 4;
+pub const CTL_DEBUG: ::c_int = 5;
+pub const CTL_HW: ::c_int = 6;
+pub const CTL_MACHDEP: ::c_int = 7;
+pub const CTL_USER: ::c_int = 8;
+pub const CTL_P1003_1B: ::c_int = 9;
+pub const CTL_LWKT: ::c_int = 10;
+pub const CTL_MAXID: ::c_int = 11;
+pub const KERN_OSTYPE: ::c_int = 1;
+pub const KERN_OSRELEASE: ::c_int = 2;
+pub const KERN_OSREV: ::c_int = 3;
+pub const KERN_VERSION: ::c_int = 4;
+pub const KERN_MAXVNODES: ::c_int = 5;
+pub const KERN_MAXPROC: ::c_int = 6;
+pub const KERN_MAXFILES: ::c_int = 7;
+pub const KERN_ARGMAX: ::c_int = 8;
+pub const KERN_SECURELVL: ::c_int = 9;
+pub const KERN_HOSTNAME: ::c_int = 10;
+pub const KERN_HOSTID: ::c_int = 11;
+pub const KERN_CLOCKRATE: ::c_int = 12;
+pub const KERN_VNODE: ::c_int = 13;
+pub const KERN_PROC: ::c_int = 14;
+pub const KERN_FILE: ::c_int = 15;
+pub const KERN_PROF: ::c_int = 16;
+pub const KERN_POSIX1: ::c_int = 17;
+pub const KERN_NGROUPS: ::c_int = 18;
+pub const KERN_JOB_CONTROL: ::c_int = 19;
+pub const KERN_SAVED_IDS: ::c_int = 20;
+pub const KERN_BOOTTIME: ::c_int = 21;
+pub const KERN_NISDOMAINNAME: ::c_int = 22;
+pub const KERN_UPDATEINTERVAL: ::c_int = 23;
+pub const KERN_OSRELDATE: ::c_int = 24;
+pub const KERN_NTP_PLL: ::c_int = 25;
+pub const KERN_BOOTFILE: ::c_int = 26;
+pub const KERN_MAXFILESPERPROC: ::c_int = 27;
+pub const KERN_MAXPROCPERUID: ::c_int = 28;
+pub const KERN_DUMPDEV: ::c_int = 29;
+pub const KERN_IPC: ::c_int = 30;
+pub const KERN_DUMMY: ::c_int = 31;
+pub const KERN_PS_STRINGS: ::c_int = 32;
+pub const KERN_USRSTACK: ::c_int = 33;
+pub const KERN_LOGSIGEXIT: ::c_int = 34;
+pub const KERN_IOV_MAX: ::c_int = 35;
+pub const KERN_MAXPOSIXLOCKSPERUID: ::c_int = 36;
+pub const KERN_MAXID: ::c_int = 37;
+pub const KERN_PROC_ALL: ::c_int = 0;
+pub const KERN_PROC_PID: ::c_int = 1;
+pub const KERN_PROC_PGRP: ::c_int = 2;
+pub const KERN_PROC_SESSION: ::c_int = 3;
+pub const KERN_PROC_TTY: ::c_int = 4;
+pub const KERN_PROC_UID: ::c_int = 5;
+pub const KERN_PROC_RUID: ::c_int = 6;
+pub const KERN_PROC_ARGS: ::c_int = 7;
+pub const KERN_PROC_CWD: ::c_int = 8;
+pub const KERN_PROC_PATHNAME: ::c_int = 9;
+pub const KERN_PROC_FLAGMASK: ::c_int = 0x10;
+pub const KERN_PROC_FLAG_LWP: ::c_int = 0x10;
+pub const KIPC_MAXSOCKBUF: ::c_int = 1;
+pub const KIPC_SOCKBUF_WASTE: ::c_int = 2;
+pub const KIPC_SOMAXCONN: ::c_int = 3;
+pub const KIPC_MAX_LINKHDR: ::c_int = 4;
+pub const KIPC_MAX_PROTOHDR: ::c_int = 5;
+pub const KIPC_MAX_HDR: ::c_int = 6;
+pub const KIPC_MAX_DATALEN: ::c_int = 7;
+pub const KIPC_MBSTAT: ::c_int = 8;
+pub const KIPC_NMBCLUSTERS: ::c_int = 9;
+pub const HW_MACHINE: ::c_int = 1;
+pub const HW_MODEL: ::c_int = 2;
+pub const HW_NCPU: ::c_int = 3;
+pub const HW_BYTEORDER: ::c_int = 4;
+pub const HW_PHYSMEM: ::c_int = 5;
+pub const HW_USERMEM: ::c_int = 6;
+pub const HW_PAGESIZE: ::c_int = 7;
+pub const HW_DISKNAMES: ::c_int = 8;
+pub const HW_DISKSTATS: ::c_int = 9;
+pub const HW_FLOATINGPT: ::c_int = 10;
+pub const HW_MACHINE_ARCH: ::c_int = 11;
+pub const HW_MACHINE_PLATFORM: ::c_int = 12;
+pub const HW_SENSORS: ::c_int = 13;
+pub const HW_MAXID: ::c_int = 14;
+pub const USER_CS_PATH: ::c_int = 1;
+pub const USER_BC_BASE_MAX: ::c_int = 2;
+pub const USER_BC_DIM_MAX: ::c_int = 3;
+pub const USER_BC_SCALE_MAX: ::c_int = 4;
+pub const USER_BC_STRING_MAX: ::c_int = 5;
+pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6;
+pub const USER_EXPR_NEST_MAX: ::c_int = 7;
+pub const USER_LINE_MAX: ::c_int = 8;
+pub const USER_RE_DUP_MAX: ::c_int = 9;
+pub const USER_POSIX2_VERSION: ::c_int = 10;
+pub const USER_POSIX2_C_BIND: ::c_int = 11;
+pub const USER_POSIX2_C_DEV: ::c_int = 12;
+pub const USER_POSIX2_CHAR_TERM: ::c_int = 13;
+pub const USER_POSIX2_FORT_DEV: ::c_int = 14;
+pub const USER_POSIX2_FORT_RUN: ::c_int = 15;
+pub const USER_POSIX2_LOCALEDEF: ::c_int = 16;
+pub const USER_POSIX2_SW_DEV: ::c_int = 17;
+pub const USER_POSIX2_UPE: ::c_int = 18;
+pub const USER_STREAM_MAX: ::c_int = 19;
+pub const USER_TZNAME_MAX: ::c_int = 20;
+pub const USER_MAXID: ::c_int = 21;
+pub const CTL_P1003_1B_ASYNCHRONOUS_IO: ::c_int = 1;
+pub const CTL_P1003_1B_MAPPED_FILES: ::c_int = 2;
+pub const CTL_P1003_1B_MEMLOCK: ::c_int = 3;
+pub const CTL_P1003_1B_MEMLOCK_RANGE: ::c_int = 4;
+pub const CTL_P1003_1B_MEMORY_PROTECTION: ::c_int = 5;
+pub const CTL_P1003_1B_MESSAGE_PASSING: ::c_int = 6;
+pub const CTL_P1003_1B_PRIORITIZED_IO: ::c_int = 7;
+pub const CTL_P1003_1B_PRIORITY_SCHEDULING: ::c_int = 8;
+pub const CTL_P1003_1B_REALTIME_SIGNALS: ::c_int = 9;
+pub const CTL_P1003_1B_SEMAPHORES: ::c_int = 10;
+pub const CTL_P1003_1B_FSYNC: ::c_int = 11;
+pub const CTL_P1003_1B_SHARED_MEMORY_OBJECTS: ::c_int = 12;
+pub const CTL_P1003_1B_SYNCHRONIZED_IO: ::c_int = 13;
+pub const CTL_P1003_1B_TIMERS: ::c_int = 14;
+pub const CTL_P1003_1B_AIO_LISTIO_MAX: ::c_int = 15;
+pub const CTL_P1003_1B_AIO_MAX: ::c_int = 16;
+pub const CTL_P1003_1B_AIO_PRIO_DELTA_MAX: ::c_int = 17;
+pub const CTL_P1003_1B_DELAYTIMER_MAX: ::c_int = 18;
+pub const CTL_P1003_1B_UNUSED1: ::c_int = 19;
+pub const CTL_P1003_1B_PAGESIZE: ::c_int = 20;
+pub const CTL_P1003_1B_RTSIG_MAX: ::c_int = 21;
+pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22;
+pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23;
+pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24;
+pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25;
+pub const CTL_P1003_1B_MAXID: ::c_int = 26;
+
+pub const CPUCTL_RSMSR: ::c_int = 0xc0106301;
+pub const CPUCTL_WRMSR: ::c_int = 0xc0106302;
+pub const CPUCTL_CPUID: ::c_int = 0xc0106303;
+pub const CPUCTL_UPDATE: ::c_int = 0xc0106304;
+pub const CPUCTL_MSRSBIT: ::c_int = 0xc0106305;
+pub const CPUCTL_MSRCBIT: ::c_int = 0xc0106306;
+pub const CPUCTL_CPUID_COUNT: ::c_int = 0xc0106307;
+
+pub const CPU_SETSIZE: ::size_t = ::mem::size_of::<::cpumask_t>() * 8;
+
+pub const EVFILT_READ: i16 = -1;
+pub const EVFILT_WRITE: i16 = -2;
+pub const EVFILT_AIO: i16 = -3;
+pub const EVFILT_VNODE: i16 = -4;
+pub const EVFILT_PROC: i16 = -5;
+pub const EVFILT_SIGNAL: i16 = -6;
+pub const EVFILT_TIMER: i16 = -7;
+pub const EVFILT_EXCEPT: i16 = -8;
+pub const EVFILT_USER: i16 = -9;
+pub const EVFILT_FS: i16 = -10;
+
+pub const EV_ADD: u16 = 0x1;
+pub const EV_DELETE: u16 = 0x2;
+pub const EV_ENABLE: u16 = 0x4;
+pub const EV_DISABLE: u16 = 0x8;
+pub const EV_ONESHOT: u16 = 0x10;
+pub const EV_CLEAR: u16 = 0x20;
+pub const EV_RECEIPT: u16 = 0x40;
+pub const EV_DISPATCH: u16 = 0x80;
+pub const EV_NODATA: u16 = 0x1000;
+pub const EV_FLAG1: u16 = 0x2000;
+pub const EV_ERROR: u16 = 0x4000;
+pub const EV_EOF: u16 = 0x8000;
+pub const EV_HUP: u16 = 0x8000;
+pub const EV_SYSFLAGS: u16 = 0xf000;
+
+pub const FIODNAME: ::c_ulong = 0x80106678;
+
+pub const NOTE_TRIGGER: u32 = 0x01000000;
+pub const NOTE_FFNOP: u32 = 0x00000000;
+pub const NOTE_FFAND: u32 = 0x40000000;
+pub const NOTE_FFOR: u32 = 0x80000000;
+pub const NOTE_FFCOPY: u32 = 0xc0000000;
+pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
+pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
+pub const NOTE_LOWAT: u32 = 0x00000001;
+pub const NOTE_OOB: u32 = 0x00000002;
+pub const NOTE_DELETE: u32 = 0x00000001;
+pub const NOTE_WRITE: u32 = 0x00000002;
+pub const NOTE_EXTEND: u32 = 0x00000004;
+pub const NOTE_ATTRIB: u32 = 0x00000008;
+pub const NOTE_LINK: u32 = 0x00000010;
+pub const NOTE_RENAME: u32 = 0x00000020;
+pub const NOTE_REVOKE: u32 = 0x00000040;
+pub const NOTE_EXIT: u32 = 0x80000000;
+pub const NOTE_FORK: u32 = 0x40000000;
+pub const NOTE_EXEC: u32 = 0x20000000;
+pub const NOTE_PDATAMASK: u32 = 0x000fffff;
+pub const NOTE_PCTRLMASK: u32 = 0xf0000000;
+pub const NOTE_TRACK: u32 = 0x00000001;
+pub const NOTE_TRACKERR: u32 = 0x00000002;
+pub const NOTE_CHILD: u32 = 0x00000004;
+
+pub const SO_SNDSPACE: ::c_int = 0x100a;
+pub const SO_CPUHINT: ::c_int = 0x1030;
+pub const SO_PASSCRED: ::c_int = 0x4000;
+
+pub const PT_FIRSTMACH: ::c_int = 32;
+
+pub const PROC_REAP_ACQUIRE: ::c_int = 0x0001;
+pub const PROC_REAP_RELEASE: ::c_int = 0x0002;
+pub const PROC_REAP_STATUS: ::c_int = 0x0003;
+pub const PROC_PDEATHSIG_CTL: ::c_int = 0x0004;
+pub const PROC_PDEATHSIG_STATUS: ::c_int = 0x0005;
+
+// https://github.com/DragonFlyBSD/DragonFlyBSD/blob/HEAD/sys/net/if.h#L101
+pub const IFF_UP: ::c_int = 0x1; // interface is up
+pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid
+pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging
+pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net
+pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link
+pub const IFF_SMART: ::c_int = 0x20; // interface manages own routes
+pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated
+pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol
+pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets
+pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets
+pub const IFF_OACTIVE_COMPAT: ::c_int = 0x400; // was transmission in progress
+pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions
+pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
+pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
+pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
+pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection
+pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
+                                           // was interface is in polling mode
+pub const IFF_POLLING_COMPAT: ::c_int = 0x10000;
+pub const IFF_PPROMISC: ::c_int = 0x20000; // user-requested promisc mode
+pub const IFF_MONITOR: ::c_int = 0x40000; // user-requested monitor mode
+pub const IFF_STATICARP: ::c_int = 0x80000; // static ARP
+pub const IFF_NPOLLING: ::c_int = 0x100000; // interface is in polling mode
+pub const IFF_IDIRECT: ::c_int = 0x200000; // direct input
+
+//
+// sys/netinet/in.h
+// Protocols (RFC 1700)
+// NOTE: These are in addition to the constants defined in src/unix/mod.rs
+
+// IPPROTO_IP defined in src/unix/mod.rs
+/// IP6 hop-by-hop options
+pub const IPPROTO_HOPOPTS: ::c_int = 0;
+// IPPROTO_ICMP defined in src/unix/mod.rs
+/// group mgmt protocol
+pub const IPPROTO_IGMP: ::c_int = 2;
+/// gateway^2 (deprecated)
+pub const IPPROTO_GGP: ::c_int = 3;
+/// for compatibility
+pub const IPPROTO_IPIP: ::c_int = 4;
+// IPPROTO_TCP defined in src/unix/mod.rs
+/// Stream protocol II.
+pub const IPPROTO_ST: ::c_int = 7;
+/// exterior gateway protocol
+pub const IPPROTO_EGP: ::c_int = 8;
+/// private interior gateway
+pub const IPPROTO_PIGP: ::c_int = 9;
+/// BBN RCC Monitoring
+pub const IPPROTO_RCCMON: ::c_int = 10;
+/// network voice protocol
+pub const IPPROTO_NVPII: ::c_int = 11;
+/// pup
+pub const IPPROTO_PUP: ::c_int = 12;
+/// Argus
+pub const IPPROTO_ARGUS: ::c_int = 13;
+/// EMCON
+pub const IPPROTO_EMCON: ::c_int = 14;
+/// Cross Net Debugger
+pub const IPPROTO_XNET: ::c_int = 15;
+/// Chaos
+pub const IPPROTO_CHAOS: ::c_int = 16;
+// IPPROTO_UDP defined in src/unix/mod.rs
+/// Multiplexing
+pub const IPPROTO_MUX: ::c_int = 18;
+/// DCN Measurement Subsystems
+pub const IPPROTO_MEAS: ::c_int = 19;
+/// Host Monitoring
+pub const IPPROTO_HMP: ::c_int = 20;
+/// Packet Radio Measurement
+pub const IPPROTO_PRM: ::c_int = 21;
+/// xns idp
+pub const IPPROTO_IDP: ::c_int = 22;
+/// Trunk-1
+pub const IPPROTO_TRUNK1: ::c_int = 23;
+/// Trunk-2
+pub const IPPROTO_TRUNK2: ::c_int = 24;
+/// Leaf-1
+pub const IPPROTO_LEAF1: ::c_int = 25;
+/// Leaf-2
+pub const IPPROTO_LEAF2: ::c_int = 26;
+/// Reliable Data
+pub const IPPROTO_RDP: ::c_int = 27;
+/// Reliable Transaction
+pub const IPPROTO_IRTP: ::c_int = 28;
+/// tp-4 w/ class negotiation
+pub const IPPROTO_TP: ::c_int = 29;
+/// Bulk Data Transfer
+pub const IPPROTO_BLT: ::c_int = 30;
+/// Network Services
+pub const IPPROTO_NSP: ::c_int = 31;
+/// Merit Internodal
+pub const IPPROTO_INP: ::c_int = 32;
+/// Sequential Exchange
+pub const IPPROTO_SEP: ::c_int = 33;
+/// Third Party Connect
+pub const IPPROTO_3PC: ::c_int = 34;
+/// InterDomain Policy Routing
+pub const IPPROTO_IDPR: ::c_int = 35;
+/// XTP
+pub const IPPROTO_XTP: ::c_int = 36;
+/// Datagram Delivery
+pub const IPPROTO_DDP: ::c_int = 37;
+/// Control Message Transport
+pub const IPPROTO_CMTP: ::c_int = 38;
+/// TP++ Transport
+pub const IPPROTO_TPXX: ::c_int = 39;
+/// IL transport protocol
+pub const IPPROTO_IL: ::c_int = 40;
+// IPPROTO_IPV6 defined in src/unix/mod.rs
+/// Source Demand Routing
+pub const IPPROTO_SDRP: ::c_int = 42;
+/// IP6 routing header
+pub const IPPROTO_ROUTING: ::c_int = 43;
+/// IP6 fragmentation header
+pub const IPPROTO_FRAGMENT: ::c_int = 44;
+/// InterDomain Routing
+pub const IPPROTO_IDRP: ::c_int = 45;
+/// resource reservation
+pub const IPPROTO_RSVP: ::c_int = 46;
+/// General Routing Encap.
+pub const IPPROTO_GRE: ::c_int = 47;
+/// Mobile Host Routing
+pub const IPPROTO_MHRP: ::c_int = 48;
+/// BHA
+pub const IPPROTO_BHA: ::c_int = 49;
+/// IP6 Encap Sec. Payload
+pub const IPPROTO_ESP: ::c_int = 50;
+/// IP6 Auth Header
+pub const IPPROTO_AH: ::c_int = 51;
+/// Integ. Net Layer Security
+pub const IPPROTO_INLSP: ::c_int = 52;
+/// IP with encryption
+pub const IPPROTO_SWIPE: ::c_int = 53;
+/// Next Hop Resolution
+pub const IPPROTO_NHRP: ::c_int = 54;
+/// IP Mobility
+pub const IPPROTO_MOBILE: ::c_int = 55;
+/// Transport Layer Security
+pub const IPPROTO_TLSP: ::c_int = 56;
+/// SKIP
+pub const IPPROTO_SKIP: ::c_int = 57;
+// IPPROTO_ICMPV6 defined in src/unix/mod.rs
+/// IP6 no next header
+pub const IPPROTO_NONE: ::c_int = 59;
+/// IP6 destination option
+pub const IPPROTO_DSTOPTS: ::c_int = 60;
+/// any host internal protocol
+pub const IPPROTO_AHIP: ::c_int = 61;
+/// CFTP
+pub const IPPROTO_CFTP: ::c_int = 62;
+/// "hello" routing protocol
+pub const IPPROTO_HELLO: ::c_int = 63;
+/// SATNET/Backroom EXPAK
+pub const IPPROTO_SATEXPAK: ::c_int = 64;
+/// Kryptolan
+pub const IPPROTO_KRYPTOLAN: ::c_int = 65;
+/// Remote Virtual Disk
+pub const IPPROTO_RVD: ::c_int = 66;
+/// Pluribus Packet Core
+pub const IPPROTO_IPPC: ::c_int = 67;
+/// Any distributed FS
+pub const IPPROTO_ADFS: ::c_int = 68;
+/// Satnet Monitoring
+pub const IPPROTO_SATMON: ::c_int = 69;
+/// VISA Protocol
+pub const IPPROTO_VISA: ::c_int = 70;
+/// Packet Core Utility
+pub const IPPROTO_IPCV: ::c_int = 71;
+/// Comp. Prot. Net. Executive
+pub const IPPROTO_CPNX: ::c_int = 72;
+/// Comp. Prot. HeartBeat
+pub const IPPROTO_CPHB: ::c_int = 73;
+/// Wang Span Network
+pub const IPPROTO_WSN: ::c_int = 74;
+/// Packet Video Protocol
+pub const IPPROTO_PVP: ::c_int = 75;
+/// BackRoom SATNET Monitoring
+pub const IPPROTO_BRSATMON: ::c_int = 76;
+/// Sun net disk proto (temp.)
+pub const IPPROTO_ND: ::c_int = 77;
+/// WIDEBAND Monitoring
+pub const IPPROTO_WBMON: ::c_int = 78;
+/// WIDEBAND EXPAK
+pub const IPPROTO_WBEXPAK: ::c_int = 79;
+/// ISO cnlp
+pub const IPPROTO_EON: ::c_int = 80;
+/// VMTP
+pub const IPPROTO_VMTP: ::c_int = 81;
+/// Secure VMTP
+pub const IPPROTO_SVMTP: ::c_int = 82;
+/// Banyon VINES
+pub const IPPROTO_VINES: ::c_int = 83;
+/// TTP
+pub const IPPROTO_TTP: ::c_int = 84;
+/// NSFNET-IGP
+pub const IPPROTO_IGP: ::c_int = 85;
+/// dissimilar gateway prot.
+pub const IPPROTO_DGP: ::c_int = 86;
+/// TCF
+pub const IPPROTO_TCF: ::c_int = 87;
+/// Cisco/GXS IGRP
+pub const IPPROTO_IGRP: ::c_int = 88;
+/// OSPFIGP
+pub const IPPROTO_OSPFIGP: ::c_int = 89;
+/// Strite RPC protocol
+pub const IPPROTO_SRPC: ::c_int = 90;
+/// Locus Address Resoloution
+pub const IPPROTO_LARP: ::c_int = 91;
+/// Multicast Transport
+pub const IPPROTO_MTP: ::c_int = 92;
+/// AX.25 Frames
+pub const IPPROTO_AX25: ::c_int = 93;
+/// IP encapsulated in IP
+pub const IPPROTO_IPEIP: ::c_int = 94;
+/// Mobile Int.ing control
+pub const IPPROTO_MICP: ::c_int = 95;
+/// Semaphore Comm. security
+pub const IPPROTO_SCCSP: ::c_int = 96;
+/// Ethernet IP encapsulation
+pub const IPPROTO_ETHERIP: ::c_int = 97;
+/// encapsulation header
+pub const IPPROTO_ENCAP: ::c_int = 98;
+/// any private encr. scheme
+pub const IPPROTO_APES: ::c_int = 99;
+/// GMTP
+pub const IPPROTO_GMTP: ::c_int = 100;
+/// payload compression (IPComp)
+pub const IPPROTO_IPCOMP: ::c_int = 108;
+
+/* 101-254: Partly Unassigned */
+/// Protocol Independent Mcast
+pub const IPPROTO_PIM: ::c_int = 103;
+/// CARP
+pub const IPPROTO_CARP: ::c_int = 112;
+/// PGM
+pub const IPPROTO_PGM: ::c_int = 113;
+/// PFSYNC
+pub const IPPROTO_PFSYNC: ::c_int = 240;
+
+/* 255: Reserved */
+/* BSD Private, local use, namespace incursion, no longer used */
+/// divert pseudo-protocol
+pub const IPPROTO_DIVERT: ::c_int = 254;
+pub const IPPROTO_MAX: ::c_int = 256;
+/// last return value of *_input(), meaning "all job for this pkt is done".
+pub const IPPROTO_DONE: ::c_int = 257;
+
+/// Used by RSS: the layer3 protocol is unknown
+pub const IPPROTO_UNKNOWN: ::c_int = 258;
+
+// sys/netinet/tcp.h
+pub const TCP_SIGNATURE_ENABLE: ::c_int = 16;
+pub const TCP_KEEPINIT: ::c_int = 32;
+pub const TCP_FASTKEEP: ::c_int = 128;
+
+pub const AF_BLUETOOTH: ::c_int = 33;
+pub const AF_MPLS: ::c_int = 34;
+pub const AF_IEEE80211: ::c_int = 35;
+
+pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
+
+pub const NET_RT_DUMP: ::c_int = 1;
+pub const NET_RT_FLAGS: ::c_int = 2;
+pub const NET_RT_IFLIST: ::c_int = 3;
+pub const NET_RT_MAXID: ::c_int = 4;
+
+pub const SOMAXOPT_SIZE: ::c_int = 65536;
+
+pub const MSG_UNUSED09: ::c_int = 0x00000200;
+pub const MSG_NOSIGNAL: ::c_int = 0x00000400;
+pub const MSG_SYNC: ::c_int = 0x00000800;
+pub const MSG_CMSG_CLOEXEC: ::c_int = 0x00001000;
+pub const MSG_FBLOCKING: ::c_int = 0x00010000;
+pub const MSG_FNONBLOCKING: ::c_int = 0x00020000;
+pub const MSG_FMASK: ::c_int = 0xFFFF0000;
+
+// sys/mount.h
+pub const MNT_NODEV: ::c_int = 0x00000010;
+pub const MNT_AUTOMOUNTED: ::c_int = 0x00000020;
+pub const MNT_TRIM: ::c_int = 0x01000000;
+pub const MNT_LOCAL: ::c_int = 0x00001000;
+pub const MNT_QUOTA: ::c_int = 0x00002000;
+pub const MNT_ROOTFS: ::c_int = 0x00004000;
+pub const MNT_USER: ::c_int = 0x00008000;
+pub const MNT_IGNORE: ::c_int = 0x00800000;
+
+// utmpx entry types
+pub const EMPTY: ::c_short = 0;
+pub const RUN_LVL: ::c_short = 1;
+pub const BOOT_TIME: ::c_short = 2;
+pub const OLD_TIME: ::c_short = 3;
+pub const NEW_TIME: ::c_short = 4;
+pub const INIT_PROCESS: ::c_short = 5;
+pub const LOGIN_PROCESS: ::c_short = 6;
+pub const USER_PROCESS: ::c_short = 7;
+pub const DEAD_PROCESS: ::c_short = 8;
+pub const ACCOUNTING: ::c_short = 9;
+pub const SIGNATURE: ::c_short = 10;
+pub const DOWNTIME: ::c_short = 11;
+// utmpx database types
+pub const UTX_DB_UTMPX: ::c_uint = 0;
+pub const UTX_DB_WTMPX: ::c_uint = 1;
+pub const UTX_DB_LASTLOG: ::c_uint = 2;
+pub const _UTX_LINESIZE: usize = 32;
+pub const _UTX_USERSIZE: usize = 32;
+pub const _UTX_IDSIZE: usize = 4;
+pub const _UTX_HOSTSIZE: usize = 256;
+
+pub const LC_COLLATE_MASK: ::c_int = 1 << 0;
+pub const LC_CTYPE_MASK: ::c_int = 1 << 1;
+pub const LC_MONETARY_MASK: ::c_int = 1 << 2;
+pub const LC_NUMERIC_MASK: ::c_int = 1 << 3;
+pub const LC_TIME_MASK: ::c_int = 1 << 4;
+pub const LC_MESSAGES_MASK: ::c_int = 1 << 5;
+pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
+    | LC_CTYPE_MASK
+    | LC_MESSAGES_MASK
+    | LC_MONETARY_MASK
+    | LC_NUMERIC_MASK
+    | LC_TIME_MASK;
+
+pub const TIOCSIG: ::c_ulong = 0x2000745f;
+pub const BTUARTDISC: ::c_int = 0x7;
+pub const TIOCDCDTIMESTAMP: ::c_ulong = 0x40107458;
+pub const TIOCISPTMASTER: ::c_ulong = 0x20007455;
+pub const TIOCMODG: ::c_ulong = 0x40047403;
+pub const TIOCMODS: ::c_ulong = 0x80047404;
+pub const TIOCREMOTE: ::c_ulong = 0x80047469;
+
+// Constants used by "at" family of system calls.
+pub const AT_FDCWD: ::c_int = 0xFFFAFDCD; // invalid file descriptor
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 1;
+pub const AT_REMOVEDIR: ::c_int = 2;
+pub const AT_EACCESS: ::c_int = 4;
+pub const AT_SYMLINK_FOLLOW: ::c_int = 8;
+
+pub const VCHECKPT: usize = 19;
+
+pub const _PC_2_SYMLINKS: ::c_int = 22;
+pub const _PC_TIMESTAMP_RESOLUTION: ::c_int = 23;
+
+pub const _SC_V7_ILP32_OFF32: ::c_int = 122;
+pub const _SC_V7_ILP32_OFFBIG: ::c_int = 123;
+pub const _SC_V7_LP64_OFF64: ::c_int = 124;
+pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 125;
+pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 126;
+pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 127;
+
+pub const WCONTINUED: ::c_int = 0x4;
+pub const WSTOPPED: ::c_int = 0x2;
+pub const WNOWAIT: ::c_int = 0x8;
+pub const WEXITED: ::c_int = 0x10;
+pub const WTRAPPED: ::c_int = 0x20;
+
+// Similar to FreeBSD, only the standardized ones are exposed.
+// There are more.
+pub const P_PID: idtype_t = 0;
+pub const P_PGID: idtype_t = 2;
+pub const P_ALL: idtype_t = 7;
+
+// Values for struct rtprio (type_ field)
+pub const RTP_PRIO_REALTIME: ::c_ushort = 0;
+pub const RTP_PRIO_NORMAL: ::c_ushort = 1;
+pub const RTP_PRIO_IDLE: ::c_ushort = 2;
+pub const RTP_PRIO_THREAD: ::c_ushort = 3;
+
+// Flags for chflags(2)
+pub const UF_NOHISTORY: ::c_ulong = 0x00000040;
+pub const UF_CACHE: ::c_ulong = 0x00000080;
+pub const UF_XLINK: ::c_ulong = 0x00000100;
+pub const SF_NOHISTORY: ::c_ulong = 0x00400000;
+pub const SF_CACHE: ::c_ulong = 0x00800000;
+pub const SF_XLINK: ::c_ulong = 0x01000000;
+
+// timespec constants
+pub const UTIME_OMIT: c_long = -2;
+pub const UTIME_NOW: c_long = -1;
+
+pub const MINCORE_SUPER: ::c_int = 0x20;
+
+// kinfo_proc constants
+pub const MAXCOMLEN: usize = 16;
+pub const MAXLOGNAME: usize = 33;
+pub const NGROUPS: usize = 16;
+
+pub const RB_PAUSE: ::c_int = 0x40000;
+pub const RB_VIDEO: ::c_int = 0x20000000;
+
+const_fn! {
+    {const} fn _CMSG_ALIGN(n: usize) -> usize {
+        (n + (::mem::size_of::<::c_long>() - 1)) & !(::mem::size_of::<::c_long>() - 1)
+    }
+}
+
+f! {
+    pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
+        (cmsg as *mut ::c_uchar)
+            .offset(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        (_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) + length as usize)
+            as ::c_uint
+    }
+
+    pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
+        -> *mut ::cmsghdr
+    {
+        let next = cmsg as usize + _CMSG_ALIGN((*cmsg).cmsg_len as usize)
+            + _CMSG_ALIGN(::mem::size_of::<::cmsghdr>());
+        let max = (*mhdr).msg_control as usize
+            + (*mhdr).msg_controllen as usize;
+        if next <= max {
+            (cmsg as usize + _CMSG_ALIGN((*cmsg).cmsg_len as usize))
+                as *mut ::cmsghdr
+        } else {
+            0 as *mut ::cmsghdr
+        }
+    }
+
+    pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
+        (_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) +
+            _CMSG_ALIGN(length as usize)) as ::c_uint
+    }
+
+    pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
+        for slot in cpuset.ary.iter_mut() {
+            *slot = 0;
+        }
+    }
+
+    pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
+        let (idx, offset) = ((cpu >> 6) & 3, cpu & 63);
+        cpuset.ary[idx] |= 1 << offset;
+        ()
+    }
+
+    pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
+        let (idx, offset) = ((cpu >> 6) & 3, cpu & 63);
+        cpuset.ary[idx] &= !(1 << offset);
+        ()
+    }
+
+    pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {
+        let (idx, offset) = ((cpu >> 6) & 3, cpu & 63);
+        0 != cpuset.ary[idx] & (1 << offset)
+    }
+
+    pub fn major(dev: ::dev_t) -> ::c_int {
+         ((dev >> 8) & 0xff) as ::c_int
+    }
+
+    pub fn minor(dev: ::dev_t) -> ::c_int {
+        (dev & 0xffff00ff) as ::c_int
+    }
+}
+
+safe_f! {
+    pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
+        (status & 0o177) != 0o177 && (status & 0o177) != 0
+    }
+
+    pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::dev_t;
+        let mut dev = 0;
+        dev |= major << 8;
+        dev |= minor;
+        dev
+    }
+}
+
+extern "C" {
+    pub fn __errno_location() -> *mut ::c_int;
+    pub fn setgrent();
+    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+
+    pub fn setutxdb(_type: ::c_uint, file: *mut ::c_char) -> ::c_int;
+
+    pub fn aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::c_int;
+
+    pub fn devname_r(
+        dev: ::dev_t,
+        mode: ::mode_t,
+        buf: *mut ::c_char,
+        len: ::size_t,
+    ) -> *mut ::c_char;
+
+    pub fn waitid(
+        idtype: idtype_t,
+        id: ::id_t,
+        infop: *mut ::siginfo_t,
+        options: ::c_int,
+    ) -> ::c_int;
+
+    pub fn freelocale(loc: ::locale_t);
+
+    pub fn lwp_rtprio(
+        function: ::c_int,
+        pid: ::pid_t,
+        lwpid: lwpid_t,
+        rtp: *mut super::rtprio,
+    ) -> ::c_int;
+
+    pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
+    pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
+    pub fn uname(buf: *mut ::utsname) -> ::c_int;
+    pub fn memmem(
+        haystack: *const ::c_void,
+        haystacklen: ::size_t,
+        needle: *const ::c_void,
+        needlelen: ::size_t,
+    ) -> *mut ::c_void;
+    pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
+    pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int;
+
+    pub fn sched_getaffinity(pid: ::pid_t, cpusetsize: ::size_t, mask: *mut cpu_set_t) -> ::c_int;
+    pub fn sched_setaffinity(pid: ::pid_t, cpusetsize: ::size_t, mask: *const cpu_set_t)
+        -> ::c_int;
+    pub fn sched_getcpu() -> ::c_int;
+    pub fn setproctitle(fmt: *const ::c_char, ...);
+
+    pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
+    pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
+    pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
+    pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
+    pub fn procctl(idtype: ::idtype_t, id: ::id_t, cmd: ::c_int, data: *mut ::c_void) -> ::c_int;
+
+    pub fn updwtmpx(file: *const ::c_char, ut: *const utmpx) -> ::c_int;
+    pub fn getlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> *mut lastlogx;
+    pub fn updlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> ::c_int;
+    pub fn getutxuser(name: *const ::c_char) -> utmpx;
+    pub fn utmpxname(file: *const ::c_char) -> ::c_int;
+
+    pub fn sys_checkpoint(tpe: ::c_int, fd: ::c_int, pid: ::pid_t, retval: ::c_int) -> ::c_int;
+
+    pub fn umtx_sleep(ptr: *const ::c_int, value: ::c_int, timeout: ::c_int) -> ::c_int;
+    pub fn umtx_wakeup(ptr: *const ::c_int, count: ::c_int) -> ::c_int;
+
+    pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+    pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
+    pub fn getmntinfo(mntbufp: *mut *mut ::statfs, flags: ::c_int) -> ::c_int;
+    pub fn getmntvinfo(
+        mntbufp: *mut *mut ::statfs,
+        mntvbufp: *mut *mut ::statvfs,
+        flags: ::c_int,
+    ) -> ::c_int;
+}
+
+#[link(name = "rt")]
+extern "C" {
+    pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
+    pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
+    pub fn aio_suspend(
+        aiocb_list: *const *const aiocb,
+        nitems: ::c_int,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
+    pub fn lio_listio(
+        mode: ::c_int,
+        aiocb_list: *const *mut aiocb,
+        nitems: ::c_int,
+        sevp: *mut sigevent,
+    ) -> ::c_int;
+
+    pub fn reallocf(ptr: *mut ::c_void, size: ::size_t) -> *mut ::c_void;
+    pub fn freezero(ptr: *mut ::c_void, size: ::size_t);
+}
+
+#[link(name = "kvm")]
+extern "C" {
+    pub fn kvm_vm_map_entry_first(
+        kvm: *mut ::kvm_t,
+        map: vm_map_t,
+        entry: vm_map_entry_t,
+    ) -> vm_map_entry_t;
+    pub fn kvm_vm_map_entry_next(
+        kvm: *mut ::kvm_t,
+        map: vm_map_entry_t,
+        entry: vm_map_entry_t,
+    ) -> vm_map_entry_t;
+}
+
+cfg_if! {
+    if #[cfg(libc_thread_local)] {
+        mod errno;
+        pub use self::errno::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,146 @@
+pub type c_char = u8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type wchar_t = u32;
+pub type time_t = i64;
+pub type suseconds_t = i64;
+pub type register_t = i64;
+
+s_no_extra_traits! {
+    pub struct gpregs {
+        pub gp_x: [::register_t; 30],
+        pub gp_lr: ::register_t,
+        pub gp_sp: ::register_t,
+        pub gp_elr: ::register_t,
+        pub gp_spsr: u32,
+        pub gp_pad: ::c_int,
+    }
+
+    pub struct fpregs {
+        pub fp_q: u128,
+        pub fp_sr: u32,
+        pub fp_cr: u32,
+        pub fp_flags: ::c_int,
+        pub fp_pad: ::c_int,
+    }
+
+    pub struct mcontext_t {
+        pub mc_gpregs: gpregs,
+        pub mc_fpregs: fpregs,
+        pub mc_flags: ::c_int,
+        pub mc_pad: ::c_int,
+        pub mc_spare: [u64; 8],
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for gpregs {
+            fn eq(&self, other: &gpregs) -> bool {
+                self.gp_x.iter().zip(other.gp_x.iter()).all(|(a, b)| a == b) &&
+                self.gp_lr == other.gp_lr &&
+                self.gp_sp == other.gp_sp &&
+                self.gp_elr == other.gp_elr &&
+                self.gp_spsr == other.gp_spsr &&
+                self.gp_pad == other.gp_pad
+            }
+        }
+        impl Eq for gpregs {}
+        impl ::fmt::Debug for gpregs {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("gpregs")
+                    .field("gp_x", &self.gp_x)
+                    .field("gp_lr", &self.gp_lr)
+                    .field("gp_sp", &self.gp_sp)
+                    .field("gp_elr", &self.gp_elr)
+                    .field("gp_spsr", &self.gp_spsr)
+                    .field("gp_pad", &self.gp_pad)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for gpregs {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.gp_x.hash(state);
+                self.gp_lr.hash(state);
+                self.gp_sp.hash(state);
+                self.gp_elr.hash(state);
+                self.gp_spsr.hash(state);
+                self.gp_pad.hash(state);
+            }
+        }
+        impl PartialEq for fpregs {
+            fn eq(&self, other: &fpregs) -> bool {
+                self.fp_q == other.fp_q &&
+                self.fp_sr == other.fp_sr &&
+                self.fp_cr == other.fp_cr &&
+                self.fp_flags == other.fp_flags &&
+                self.fp_pad == other.fp_pad
+            }
+        }
+        impl Eq for fpregs {}
+        impl ::fmt::Debug for fpregs {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("fpregs")
+                    .field("fp_q", &self.fp_q)
+                    .field("fp_sr", &self.fp_sr)
+                    .field("fp_cr", &self.fp_cr)
+                    .field("fp_flags", &self.fp_flags)
+                    .field("fp_pad", &self.fp_pad)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for fpregs {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.fp_q.hash(state);
+                self.fp_sr.hash(state);
+                self.fp_cr.hash(state);
+                self.fp_flags.hash(state);
+                self.fp_pad.hash(state);
+            }
+        }
+        impl PartialEq for mcontext_t {
+            fn eq(&self, other: &mcontext_t) -> bool {
+                self.mc_gpregs == other.mc_gpregs &&
+                self.mc_fpregs == other.mc_fpregs &&
+                self.mc_flags == other.mc_flags &&
+                self.mc_pad == other.mc_pad &&
+                self.mc_spare.iter().zip(other.mc_spare.iter()).all(|(a, b)| a == b)
+            }
+        }
+        impl Eq for mcontext_t {}
+        impl ::fmt::Debug for mcontext_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("mcontext_t")
+                    .field("mc_gpregs", &self.mc_gpregs)
+                    .field("mc_fpregs", &self.mc_fpregs)
+                    .field("mc_flags", &self.mc_flags)
+                    .field("mc_pad", &self.mc_pad)
+                    .field("mc_spare", &self.mc_spare)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for mcontext_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.mc_gpregs.hash(state);
+                self.mc_fpregs.hash(state);
+                self.mc_flags.hash(state);
+                self.mc_pad.hash(state);
+                self.mc_spare.hash(state);
+            }
+        }
+    }
+}
+
+pub const MAP_32BIT: ::c_int = 0x00080000;
+pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/arm.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/arm.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/arm.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/arm.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,50 @@
+pub type c_char = u8;
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type wchar_t = u32;
+pub type time_t = i64;
+pub type suseconds_t = i32;
+pub type register_t = i32;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_atime_pad: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_mtime_pad: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_ctime_pad: ::c_long,
+        pub st_size: ::off_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_blksize: ::blksize_t,
+        pub st_flags: ::fflags_t,
+        pub st_gen: u32,
+        pub st_lspare: i32,
+        pub st_birthtime: ::time_t,
+        pub st_birthtime_nsec: ::c_long,
+        pub st_birthtime_pad: ::c_long,
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 4 - 1;
+    }
+}
+pub const MAP_32BIT: ::c_int = 0x00080000;
+pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,32 @@
+#[repr(C)]
+#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
+pub struct stat {
+    pub st_dev: ::dev_t,
+    pub st_ino: ::ino_t,
+    pub st_mode: ::mode_t,
+    pub st_nlink: ::nlink_t,
+    pub st_uid: ::uid_t,
+    pub st_gid: ::gid_t,
+    pub st_rdev: ::dev_t,
+    pub st_atime: ::time_t,
+    pub st_atime_nsec: ::c_long,
+    pub st_mtime: ::time_t,
+    pub st_mtime_nsec: ::c_long,
+    pub st_ctime: ::time_t,
+    pub st_ctime_nsec: ::c_long,
+    pub st_size: ::off_t,
+    pub st_blocks: ::blkcnt_t,
+    pub st_blksize: ::blksize_t,
+    pub st_flags: ::fflags_t,
+    pub st_gen: u32,
+    pub st_lspare: i32,
+    pub st_birthtime: ::time_t,
+    pub st_birthtime_nsec: ::c_long,
+}
+
+impl ::Copy for ::stat {}
+impl ::Clone for ::stat {
+    fn clone(&self) -> ::stat {
+        *self
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,488 @@
+// APIs that were changed after FreeBSD 11
+
+// The type of `nlink_t` changed from `u16` to `u64` in FreeBSD 12:
+pub type nlink_t = u16;
+// Type of `dev_t` changed from `u32` to `u64` in FreeBSD 12:
+pub type dev_t = u32;
+// Type of `ino_t` changed from `unsigned int` to `unsigned long` in FreeBSD 12:
+pub type ino_t = u32;
+
+s! {
+    pub struct kevent {
+        pub ident: ::uintptr_t,
+        pub filter: ::c_short,
+        pub flags: ::c_ushort,
+        pub fflags: ::c_uint,
+        pub data: ::intptr_t,
+        pub udata: *mut ::c_void,
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        // Type of shm_nattc changed from `int` to `shmatt_t` (aka `unsigned
+        // int`) in FreeBSD 12:
+        pub shm_nattch: ::c_int,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+    }
+
+    pub struct kinfo_proc {
+        /// Size of this structure.
+        pub ki_structsize: ::c_int,
+        /// Reserved: layout identifier.
+        pub ki_layout: ::c_int,
+        /// Address of command arguments.
+        pub ki_args: *mut ::pargs,
+        // This is normally "struct proc".
+        /// Address of proc.
+        pub ki_paddr: *mut ::c_void,
+        // This is normally "struct user".
+        /// Kernel virtual address of u-area.
+        pub ki_addr: *mut ::c_void,
+        // This is normally "struct vnode".
+        /// Pointer to trace file.
+        pub ki_tracep: *mut ::c_void,
+        // This is normally "struct vnode".
+        /// Pointer to executable file.
+        pub ki_textvp: *mut ::c_void,
+        // This is normally "struct filedesc".
+        /// Pointer to open file info.
+        pub ki_fd: *mut ::c_void,
+        // This is normally "struct vmspace".
+        /// Pointer to kernel vmspace struct.
+        pub ki_vmspace: *mut ::c_void,
+        /// Sleep address.
+        pub ki_wchan: *mut ::c_void,
+        /// Process identifier.
+        pub ki_pid: ::pid_t,
+        /// Parent process ID.
+        pub ki_ppid: ::pid_t,
+        /// Process group ID.
+        pub ki_pgid: ::pid_t,
+        /// tty process group ID.
+        pub ki_tpgid: ::pid_t,
+        /// Process session ID.
+        pub ki_sid: ::pid_t,
+        /// Terminal session ID.
+        pub ki_tsid: ::pid_t,
+        /// Job control counter.
+        pub ki_jobc: ::c_short,
+        /// Unused (just here for alignment).
+        pub ki_spare_short1: ::c_short,
+        /// Controlling tty dev.
+        pub ki_tdev: ::dev_t,
+        /// Signals arrived but not delivered.
+        pub ki_siglist: ::sigset_t,
+        /// Current signal mask.
+        pub ki_sigmask: ::sigset_t,
+        /// Signals being ignored.
+        pub ki_sigignore: ::sigset_t,
+        /// Signals being caught by user.
+        pub ki_sigcatch: ::sigset_t,
+        /// Effective user ID.
+        pub ki_uid: ::uid_t,
+        /// Real user ID.
+        pub ki_ruid: ::uid_t,
+        /// Saved effective user ID.
+        pub ki_svuid: ::uid_t,
+        /// Real group ID.
+        pub ki_rgid: ::gid_t,
+        /// Saved effective group ID.
+        pub ki_svgid: ::gid_t,
+        /// Number of groups.
+        pub ki_ngroups: ::c_short,
+        /// Unused (just here for alignment).
+        pub ki_spare_short2: ::c_short,
+        /// Groups.
+        pub ki_groups: [::gid_t; ::KI_NGROUPS],
+        /// Virtual size.
+        pub ki_size: ::vm_size_t,
+        /// Current resident set size in pages.
+        pub ki_rssize: ::segsz_t,
+        /// Resident set size before last swap.
+        pub ki_swrss: ::segsz_t,
+        /// Text size (pages) XXX.
+        pub ki_tsize: ::segsz_t,
+        /// Data size (pages) XXX.
+        pub ki_dsize: ::segsz_t,
+        /// Stack size (pages).
+        pub ki_ssize: ::segsz_t,
+        /// Exit status for wait & stop signal.
+        pub ki_xstat: ::u_short,
+        /// Accounting flags.
+        pub ki_acflag: ::u_short,
+        /// %cpu for process during `ki_swtime`.
+        pub ki_pctcpu: ::fixpt_t,
+        /// Time averaged value of `ki_cpticks`.
+        pub ki_estcpu: ::u_int,
+        /// Time since last blocked.
+        pub ki_slptime: ::u_int,
+        /// Time swapped in or out.
+        pub ki_swtime: ::u_int,
+        /// Number of copy-on-write faults.
+        pub ki_cow: ::u_int,
+        /// Real time in microsec.
+        pub ki_runtime: u64,
+        /// Starting time.
+        pub ki_start: ::timeval,
+        /// Time used by process children.
+        pub ki_childtime: ::timeval,
+        /// P_* flags.
+        pub ki_flag: ::c_long,
+        /// KI_* flags (below).
+        pub ki_kiflag: ::c_long,
+        /// Kernel trace points.
+        pub ki_traceflag: ::c_int,
+        /// S* process status.
+        pub ki_stat: ::c_char,
+        /// Process "nice" value.
+        pub ki_nice: i8, // signed char
+        /// Process lock (prevent swap) count.
+        pub ki_lock: ::c_char,
+        /// Run queue index.
+        pub ki_rqindex: ::c_char,
+        /// Which cpu we are on.
+        pub ki_oncpu_old: ::c_uchar,
+        /// Last cpu we were on.
+        pub ki_lastcpu_old: ::c_uchar,
+        /// Thread name.
+        pub ki_tdname: [::c_char; ::TDNAMLEN + 1],
+        /// Wchan message.
+        pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
+        /// Setlogin name.
+        pub ki_login: [::c_char; ::LOGNAMELEN + 1],
+        /// Lock name.
+        pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
+        /// Command name.
+        pub ki_comm: [::c_char; ::COMMLEN + 1],
+        /// Emulation name.
+        pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
+        /// Login class.
+        pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
+        /// More thread name.
+        pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1],
+        /// Spare string space.
+        pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
+        /// Spare room for growth.
+        pub ki_spareints: [::c_int; ::KI_NSPARE_INT],
+        /// Which cpu we are on.
+        pub ki_oncpu: ::c_int,
+        /// Last cpu we were on.
+        pub ki_lastcpu: ::c_int,
+        /// PID of tracing process.
+        pub ki_tracer: ::c_int,
+        /// P2_* flags.
+        pub ki_flag2: ::c_int,
+        /// Default FIB number.
+        pub ki_fibnum: ::c_int,
+        /// Credential flags.
+        pub ki_cr_flags: ::u_int,
+        /// Process jail ID.
+        pub ki_jid: ::c_int,
+        /// Number of threads in total.
+        pub ki_numthreads: ::c_int,
+        /// Thread ID.
+        pub ki_tid: ::lwpid_t,
+        /// Process priority.
+        pub ki_pri: ::priority,
+        /// Process rusage statistics.
+        pub ki_rusage: ::rusage,
+        /// rusage of children processes.
+        pub ki_rusage_ch: ::rusage,
+        // This is normally "struct pcb".
+        /// Kernel virtual addr of pcb.
+        pub ki_pcb: *mut ::c_void,
+        /// Kernel virtual addr of stack.
+        pub ki_kstack: *mut ::c_void,
+        /// User convenience pointer.
+        pub ki_udata: *mut ::c_void,
+        // This is normally "struct thread".
+        pub ki_tdaddr: *mut ::c_void,
+        pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR],
+        pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG],
+        /// PS_* flags.
+        pub ki_sflag: ::c_long,
+        /// kthread flag.
+        pub ki_tdflags: ::c_long,
+    }
+}
+
+s_no_extra_traits! {
+    pub struct dirent {
+        pub d_fileno: ::ino_t,
+        pub d_reclen: u16,
+        pub d_type: u8,
+        // Type of `d_namlen` changed from `char` to `u16` in FreeBSD 12:
+        pub d_namlen: u8,
+        pub d_name: [::c_char; 256],
+    }
+
+    pub struct statfs {
+        pub f_version: u32,
+        pub f_type: u32,
+        pub f_flags: u64,
+        pub f_bsize: u64,
+        pub f_iosize: u64,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: i64,
+        pub f_files: u64,
+        pub f_ffree: i64,
+        pub f_syncwrites: u64,
+        pub f_asyncwrites: u64,
+        pub f_syncreads: u64,
+        pub f_asyncreads: u64,
+        f_spare: [u64; 10],
+        pub f_namemax: u32,
+        pub f_owner: ::uid_t,
+        pub f_fsid: ::fsid_t,
+        f_charspare: [::c_char; 80],
+        pub f_fstypename: [::c_char; 16],
+        // Array length changed from 88 to 1024 in FreeBSD 12:
+        pub f_mntfromname: [::c_char; 88],
+        // Array length changed from 88 to 1024 in FreeBSD 12:
+        pub f_mntonname: [::c_char; 88],
+    }
+
+    pub struct vnstat {
+        pub vn_fileid: u64,
+        pub vn_size: u64,
+        pub vn_mntdir: *mut ::c_char,
+        pub vn_dev: u32,
+        pub vn_fsid: u32,
+        pub vn_type: ::c_int,
+        pub vn_mode: u16,
+        pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for statfs {
+            fn eq(&self, other: &statfs) -> bool {
+                self.f_version == other.f_version
+                    && self.f_type == other.f_type
+                    && self.f_flags == other.f_flags
+                    && self.f_bsize == other.f_bsize
+                    && self.f_iosize == other.f_iosize
+                    && self.f_blocks == other.f_blocks
+                    && self.f_bfree == other.f_bfree
+                    && self.f_bavail == other.f_bavail
+                    && self.f_files == other.f_files
+                    && self.f_ffree == other.f_ffree
+                    && self.f_syncwrites == other.f_syncwrites
+                    && self.f_asyncwrites == other.f_asyncwrites
+                    && self.f_syncreads == other.f_syncreads
+                    && self.f_asyncreads == other.f_asyncreads
+                    && self.f_namemax == other.f_namemax
+                    && self.f_owner == other.f_owner
+                    && self.f_fsid == other.f_fsid
+                    && self.f_fstypename == other.f_fstypename
+                    && self
+                    .f_mntfromname
+                    .iter()
+                    .zip(other.f_mntfromname.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .f_mntonname
+                    .iter()
+                    .zip(other.f_mntonname.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for statfs {}
+        impl ::fmt::Debug for statfs {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("statfs")
+                    .field("f_bsize", &self.f_bsize)
+                    .field("f_iosize", &self.f_iosize)
+                    .field("f_blocks", &self.f_blocks)
+                    .field("f_bfree", &self.f_bfree)
+                    .field("f_bavail", &self.f_bavail)
+                    .field("f_files", &self.f_files)
+                    .field("f_ffree", &self.f_ffree)
+                    .field("f_syncwrites", &self.f_syncwrites)
+                    .field("f_asyncwrites", &self.f_asyncwrites)
+                    .field("f_syncreads", &self.f_syncreads)
+                    .field("f_asyncreads", &self.f_asyncreads)
+                    .field("f_namemax", &self.f_namemax)
+                    .field("f_owner", &self.f_owner)
+                    .field("f_fsid", &self.f_fsid)
+                    .field("f_fstypename", &self.f_fstypename)
+                    .field("f_mntfromname", &&self.f_mntfromname[..])
+                    .field("f_mntonname", &&self.f_mntonname[..])
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for statfs {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.f_version.hash(state);
+                self.f_type.hash(state);
+                self.f_flags.hash(state);
+                self.f_bsize.hash(state);
+                self.f_iosize.hash(state);
+                self.f_blocks.hash(state);
+                self.f_bfree.hash(state);
+                self.f_bavail.hash(state);
+                self.f_files.hash(state);
+                self.f_ffree.hash(state);
+                self.f_syncwrites.hash(state);
+                self.f_asyncwrites.hash(state);
+                self.f_syncreads.hash(state);
+                self.f_asyncreads.hash(state);
+                self.f_namemax.hash(state);
+                self.f_owner.hash(state);
+                self.f_fsid.hash(state);
+                self.f_fstypename.hash(state);
+                self.f_mntfromname.hash(state);
+                self.f_mntonname.hash(state);
+            }
+        }
+
+        impl PartialEq for dirent {
+            fn eq(&self, other: &dirent) -> bool {
+                self.d_fileno == other.d_fileno
+                    && self.d_reclen == other.d_reclen
+                    && self.d_type == other.d_type
+                    && self.d_namlen == other.d_namlen
+                    && self
+                    .d_name[..self.d_namlen as _]
+                    .iter()
+                    .zip(other.d_name.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for dirent {}
+        impl ::fmt::Debug for dirent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("dirent")
+                    .field("d_fileno", &self.d_fileno)
+                    .field("d_reclen", &self.d_reclen)
+                    .field("d_type", &self.d_type)
+                    .field("d_namlen", &self.d_namlen)
+                    .field("d_name", &&self.d_name[..self.d_namlen as _])
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for dirent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.d_fileno.hash(state);
+                self.d_reclen.hash(state);
+                self.d_type.hash(state);
+                self.d_namlen.hash(state);
+                self.d_name[..self.d_namlen as _].hash(state);
+            }
+        }
+
+        impl PartialEq for vnstat {
+            fn eq(&self, other: &vnstat) -> bool {
+                let self_vn_devname: &[::c_char] = &self.vn_devname;
+                let other_vn_devname: &[::c_char] = &other.vn_devname;
+
+                self.vn_fileid == other.vn_fileid &&
+                self.vn_size == other.vn_size &&
+                self.vn_mntdir == other.vn_mntdir &&
+                self.vn_dev == other.vn_dev &&
+                self.vn_fsid == other.vn_fsid &&
+                self.vn_type == other.vn_type &&
+                self.vn_mode == other.vn_mode &&
+                self_vn_devname == other_vn_devname
+            }
+        }
+        impl Eq for vnstat {}
+        impl ::fmt::Debug for vnstat {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let self_vn_devname: &[::c_char] = &self.vn_devname;
+
+                f.debug_struct("vnstat")
+                    .field("vn_fileid", &self.vn_fileid)
+                    .field("vn_size", &self.vn_size)
+                    .field("vn_mntdir", &self.vn_mntdir)
+                    .field("vn_dev", &self.vn_dev)
+                    .field("vn_fsid", &self.vn_fsid)
+                    .field("vn_type", &self.vn_type)
+                    .field("vn_mode", &self.vn_mode)
+                    .field("vn_devname", &self_vn_devname)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for vnstat {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let self_vn_devname: &[::c_char] = &self.vn_devname;
+
+                self.vn_fileid.hash(state);
+                self.vn_size.hash(state);
+                self.vn_mntdir.hash(state);
+                self.vn_dev.hash(state);
+                self.vn_fsid.hash(state);
+                self.vn_type.hash(state);
+                self.vn_mode.hash(state);
+                self_vn_devname.hash(state);
+            }
+        }
+    }
+}
+
+pub const ELAST: ::c_int = 96;
+pub const RAND_MAX: ::c_int = 0x7fff_fffd;
+pub const KI_NSPARE_PTR: usize = 6;
+pub const MINCORE_SUPER: ::c_int = 0x20;
+/// max length of devicename
+pub const SPECNAMELEN: ::c_int = 63;
+
+safe_f! {
+    pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::dev_t;
+        (major << 8) | minor
+    }
+}
+
+f! {
+    pub fn major(dev: ::dev_t) -> ::c_int {
+         ((dev >> 8) & 0xff) as ::c_int
+    }
+
+    pub fn minor(dev: ::dev_t) -> ::c_int {
+        (dev & 0xffff00ff) as ::c_int
+    }
+}
+
+extern "C" {
+    // Return type ::c_int was removed in FreeBSD 12
+    pub fn setgrent() -> ::c_int;
+
+    // Type of `addr` argument changed from `const void*` to `void*`
+    // in FreeBSD 12
+    pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+
+    // Return type ::c_int was removed in FreeBSD 12
+    pub fn freelocale(loc: ::locale_t) -> ::c_int;
+
+    // Return type ::c_int changed to ::ssize_t in FreeBSD 12:
+    pub fn msgrcv(
+        msqid: ::c_int,
+        msgp: *mut ::c_void,
+        msgsz: ::size_t,
+        msgtyp: ::c_long,
+        msgflg: ::c_int,
+    ) -> ::c_int;
+
+    // Type of `path` argument changed from `const void*` to `void*`
+    // in FreeBSD 12
+    pub fn dirname(path: *const ::c_char) -> *mut ::c_char;
+    pub fn basename(path: *const ::c_char) -> *mut ::c_char;
+}
+
+cfg_if! {
+    if #[cfg(any(target_arch = "x86_64",
+                 target_arch = "aarch64",
+                 target_arch = "riscv64"))] {
+        mod b64;
+        pub use self::b64::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,34 @@
+#[repr(C)]
+#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
+pub struct stat {
+    pub st_dev: ::dev_t,
+    pub st_ino: ::ino_t,
+    pub st_nlink: ::nlink_t,
+    pub st_mode: ::mode_t,
+    st_padding0: i16,
+    pub st_uid: ::uid_t,
+    pub st_gid: ::gid_t,
+    st_padding1: i32,
+    pub st_rdev: ::dev_t,
+    pub st_atime: ::time_t,
+    pub st_atime_nsec: ::c_long,
+    pub st_mtime: ::time_t,
+    pub st_mtime_nsec: ::c_long,
+    pub st_ctime: ::time_t,
+    pub st_ctime_nsec: ::c_long,
+    pub st_birthtime: ::time_t,
+    pub st_birthtime_nsec: ::c_long,
+    pub st_size: ::off_t,
+    pub st_blocks: ::blkcnt_t,
+    pub st_blksize: ::blksize_t,
+    pub st_flags: ::fflags_t,
+    pub st_gen: u64,
+    pub st_spare: [u64; 10],
+}
+
+impl ::Copy for ::stat {}
+impl ::Clone for ::stat {
+    fn clone(&self) -> ::stat {
+        *self
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,505 @@
+// APIs in FreeBSD 12 that have changed since 11.
+
+pub type nlink_t = u64;
+pub type dev_t = u64;
+pub type ino_t = ::c_ulong;
+pub type shmatt_t = ::c_uint;
+
+s! {
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+    }
+
+    pub struct kevent {
+        pub ident: ::uintptr_t,
+        pub filter: ::c_short,
+        pub flags: ::c_ushort,
+        pub fflags: ::c_uint,
+        pub data: i64,
+        pub udata: *mut ::c_void,
+        pub ext: [u64; 4],
+    }
+
+    pub struct kvm_page {
+        pub version: ::c_uint,
+        pub paddr: ::c_ulong,
+        pub kmap_vaddr: ::c_ulong,
+        pub dmap_vaddr: ::c_ulong,
+        pub prot: ::vm_prot_t,
+        pub offset: ::u_long,
+        pub len: ::size_t,
+    }
+
+    pub struct kinfo_proc {
+        /// Size of this structure.
+        pub ki_structsize: ::c_int,
+        /// Reserved: layout identifier.
+        pub ki_layout: ::c_int,
+        /// Address of command arguments.
+        pub ki_args: *mut ::pargs,
+        // This is normally "struct proc".
+        /// Address of proc.
+        pub ki_paddr: *mut ::c_void,
+        // This is normally "struct user".
+        /// Kernel virtual address of u-area.
+        pub ki_addr: *mut ::c_void,
+        // This is normally "struct vnode".
+        /// Pointer to trace file.
+        pub ki_tracep: *mut ::c_void,
+        // This is normally "struct vnode".
+        /// Pointer to executable file.
+        pub ki_textvp: *mut ::c_void,
+        // This is normally "struct filedesc".
+        /// Pointer to open file info.
+        pub ki_fd: *mut ::c_void,
+        // This is normally "struct vmspace".
+        /// Pointer to kernel vmspace struct.
+        pub ki_vmspace: *mut ::c_void,
+        /// Sleep address.
+        pub ki_wchan: *mut ::c_void,
+        /// Process identifier.
+        pub ki_pid: ::pid_t,
+        /// Parent process ID.
+        pub ki_ppid: ::pid_t,
+        /// Process group ID.
+        pub ki_pgid: ::pid_t,
+        /// tty process group ID.
+        pub ki_tpgid: ::pid_t,
+        /// Process session ID.
+        pub ki_sid: ::pid_t,
+        /// Terminal session ID.
+        pub ki_tsid: ::pid_t,
+        /// Job control counter.
+        pub ki_jobc: ::c_short,
+        /// Unused (just here for alignment).
+        pub ki_spare_short1: ::c_short,
+        /// Controlling tty dev.
+        pub ki_tdev_freebsd11: u32,
+        /// Signals arrived but not delivered.
+        pub ki_siglist: ::sigset_t,
+        /// Current signal mask.
+        pub ki_sigmask: ::sigset_t,
+        /// Signals being ignored.
+        pub ki_sigignore: ::sigset_t,
+        /// Signals being caught by user.
+        pub ki_sigcatch: ::sigset_t,
+        /// Effective user ID.
+        pub ki_uid: ::uid_t,
+        /// Real user ID.
+        pub ki_ruid: ::uid_t,
+        /// Saved effective user ID.
+        pub ki_svuid: ::uid_t,
+        /// Real group ID.
+        pub ki_rgid: ::gid_t,
+        /// Saved effective group ID.
+        pub ki_svgid: ::gid_t,
+        /// Number of groups.
+        pub ki_ngroups: ::c_short,
+        /// Unused (just here for alignment).
+        pub ki_spare_short2: ::c_short,
+        /// Groups.
+        pub ki_groups: [::gid_t; ::KI_NGROUPS],
+        /// Virtual size.
+        pub ki_size: ::vm_size_t,
+        /// Current resident set size in pages.
+        pub ki_rssize: ::segsz_t,
+        /// Resident set size before last swap.
+        pub ki_swrss: ::segsz_t,
+        /// Text size (pages) XXX.
+        pub ki_tsize: ::segsz_t,
+        /// Data size (pages) XXX.
+        pub ki_dsize: ::segsz_t,
+        /// Stack size (pages).
+        pub ki_ssize: ::segsz_t,
+        /// Exit status for wait & stop signal.
+        pub ki_xstat: ::u_short,
+        /// Accounting flags.
+        pub ki_acflag: ::u_short,
+        /// %cpu for process during `ki_swtime`.
+        pub ki_pctcpu: ::fixpt_t,
+        /// Time averaged value of `ki_cpticks`.
+        pub ki_estcpu: ::u_int,
+        /// Time since last blocked.
+        pub ki_slptime: ::u_int,
+        /// Time swapped in or out.
+        pub ki_swtime: ::u_int,
+        /// Number of copy-on-write faults.
+        pub ki_cow: ::u_int,
+        /// Real time in microsec.
+        pub ki_runtime: u64,
+        /// Starting time.
+        pub ki_start: ::timeval,
+        /// Time used by process children.
+        pub ki_childtime: ::timeval,
+        /// P_* flags.
+        pub ki_flag: ::c_long,
+        /// KI_* flags (below).
+        pub ki_kiflag: ::c_long,
+        /// Kernel trace points.
+        pub ki_traceflag: ::c_int,
+        /// S* process status.
+        pub ki_stat: ::c_char,
+        /// Process "nice" value.
+        pub ki_nice: i8, // signed char
+        /// Process lock (prevent swap) count.
+        pub ki_lock: ::c_char,
+        /// Run queue index.
+        pub ki_rqindex: ::c_char,
+        /// Which cpu we are on.
+        pub ki_oncpu_old: ::c_uchar,
+        /// Last cpu we were on.
+        pub ki_lastcpu_old: ::c_uchar,
+        /// Thread name.
+        pub ki_tdname: [::c_char; ::TDNAMLEN + 1],
+        /// Wchan message.
+        pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
+        /// Setlogin name.
+        pub ki_login: [::c_char; ::LOGNAMELEN + 1],
+        /// Lock name.
+        pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
+        /// Command name.
+        pub ki_comm: [::c_char; ::COMMLEN + 1],
+        /// Emulation name.
+        pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
+        /// Login class.
+        pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
+        /// More thread name.
+        pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1],
+        /// Spare string space.
+        pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
+        /// Spare room for growth.
+        pub ki_spareints: [::c_int; ::KI_NSPARE_INT],
+        /// Controlling tty dev.
+        pub ki_tdev: ::dev_t,
+        /// Which cpu we are on.
+        pub ki_oncpu: ::c_int,
+        /// Last cpu we were on.
+        pub ki_lastcpu: ::c_int,
+        /// PID of tracing process.
+        pub ki_tracer: ::c_int,
+        /// P2_* flags.
+        pub ki_flag2: ::c_int,
+        /// Default FIB number.
+        pub ki_fibnum: ::c_int,
+        /// Credential flags.
+        pub ki_cr_flags: ::u_int,
+        /// Process jail ID.
+        pub ki_jid: ::c_int,
+        /// Number of threads in total.
+        pub ki_numthreads: ::c_int,
+        /// Thread ID.
+        pub ki_tid: ::lwpid_t,
+        /// Process priority.
+        pub ki_pri: ::priority,
+        /// Process rusage statistics.
+        pub ki_rusage: ::rusage,
+        /// rusage of children processes.
+        pub ki_rusage_ch: ::rusage,
+        // This is normally "struct pcb".
+        /// Kernel virtual addr of pcb.
+        pub ki_pcb: *mut ::c_void,
+        /// Kernel virtual addr of stack.
+        pub ki_kstack: *mut ::c_void,
+        /// User convenience pointer.
+        pub ki_udata: *mut ::c_void,
+        // This is normally "struct thread".
+        pub ki_tdaddr: *mut ::c_void,
+        pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR],
+        pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG],
+        /// PS_* flags.
+        pub ki_sflag: ::c_long,
+        /// kthread flag.
+        pub ki_tdflags: ::c_long,
+    }
+}
+
+s_no_extra_traits! {
+    pub struct dirent {
+        pub d_fileno: ::ino_t,
+        pub d_off: ::off_t,
+        pub d_reclen: u16,
+        pub d_type: u8,
+        d_pad0: u8,
+        pub d_namlen: u16,
+        d_pad1: u16,
+        pub d_name: [::c_char; 256],
+    }
+
+    pub struct statfs {
+        pub f_version: u32,
+        pub f_type: u32,
+        pub f_flags: u64,
+        pub f_bsize: u64,
+        pub f_iosize: u64,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: i64,
+        pub f_files: u64,
+        pub f_ffree: i64,
+        pub f_syncwrites: u64,
+        pub f_asyncwrites: u64,
+        pub f_syncreads: u64,
+        pub f_asyncreads: u64,
+        f_spare: [u64; 10],
+        pub f_namemax: u32,
+        pub f_owner: ::uid_t,
+        pub f_fsid: ::fsid_t,
+        f_charspare: [::c_char; 80],
+        pub f_fstypename: [::c_char; 16],
+        pub f_mntfromname: [::c_char; 1024],
+        pub f_mntonname: [::c_char; 1024],
+    }
+
+    pub struct vnstat {
+        pub vn_fileid: u64,
+        pub vn_size: u64,
+        pub vn_dev: u64,
+        pub vn_fsid: u64,
+        pub vn_mntdir: *mut ::c_char,
+        pub vn_type: ::c_int,
+        pub vn_mode: u16,
+        pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for statfs {
+            fn eq(&self, other: &statfs) -> bool {
+                self.f_version == other.f_version
+                    && self.f_type == other.f_type
+                    && self.f_flags == other.f_flags
+                    && self.f_bsize == other.f_bsize
+                    && self.f_iosize == other.f_iosize
+                    && self.f_blocks == other.f_blocks
+                    && self.f_bfree == other.f_bfree
+                    && self.f_bavail == other.f_bavail
+                    && self.f_files == other.f_files
+                    && self.f_ffree == other.f_ffree
+                    && self.f_syncwrites == other.f_syncwrites
+                    && self.f_asyncwrites == other.f_asyncwrites
+                    && self.f_syncreads == other.f_syncreads
+                    && self.f_asyncreads == other.f_asyncreads
+                    && self.f_namemax == other.f_namemax
+                    && self.f_owner == other.f_owner
+                    && self.f_fsid == other.f_fsid
+                    && self.f_fstypename == other.f_fstypename
+                    && self
+                    .f_mntfromname
+                    .iter()
+                    .zip(other.f_mntfromname.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .f_mntonname
+                    .iter()
+                    .zip(other.f_mntonname.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for statfs {}
+        impl ::fmt::Debug for statfs {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("statfs")
+                    .field("f_bsize", &self.f_bsize)
+                    .field("f_iosize", &self.f_iosize)
+                    .field("f_blocks", &self.f_blocks)
+                    .field("f_bfree", &self.f_bfree)
+                    .field("f_bavail", &self.f_bavail)
+                    .field("f_files", &self.f_files)
+                    .field("f_ffree", &self.f_ffree)
+                    .field("f_syncwrites", &self.f_syncwrites)
+                    .field("f_asyncwrites", &self.f_asyncwrites)
+                    .field("f_syncreads", &self.f_syncreads)
+                    .field("f_asyncreads", &self.f_asyncreads)
+                    .field("f_namemax", &self.f_namemax)
+                    .field("f_owner", &self.f_owner)
+                    .field("f_fsid", &self.f_fsid)
+                    .field("f_fstypename", &self.f_fstypename)
+                    .field("f_mntfromname", &&self.f_mntfromname[..])
+                    .field("f_mntonname", &&self.f_mntonname[..])
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for statfs {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.f_version.hash(state);
+                self.f_type.hash(state);
+                self.f_flags.hash(state);
+                self.f_bsize.hash(state);
+                self.f_iosize.hash(state);
+                self.f_blocks.hash(state);
+                self.f_bfree.hash(state);
+                self.f_bavail.hash(state);
+                self.f_files.hash(state);
+                self.f_ffree.hash(state);
+                self.f_syncwrites.hash(state);
+                self.f_asyncwrites.hash(state);
+                self.f_syncreads.hash(state);
+                self.f_asyncreads.hash(state);
+                self.f_namemax.hash(state);
+                self.f_owner.hash(state);
+                self.f_fsid.hash(state);
+                self.f_charspare.hash(state);
+                self.f_fstypename.hash(state);
+                self.f_mntfromname.hash(state);
+                self.f_mntonname.hash(state);
+            }
+        }
+
+        impl PartialEq for dirent {
+            fn eq(&self, other: &dirent) -> bool {
+                self.d_fileno == other.d_fileno
+                    && self.d_off == other.d_off
+                    && self.d_reclen == other.d_reclen
+                    && self.d_type == other.d_type
+                    && self.d_namlen == other.d_namlen
+                    && self
+                    .d_name[..self.d_namlen as _]
+                    .iter()
+                    .zip(other.d_name.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for dirent {}
+        impl ::fmt::Debug for dirent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("dirent")
+                    .field("d_fileno", &self.d_fileno)
+                    .field("d_off", &self.d_off)
+                    .field("d_reclen", &self.d_reclen)
+                    .field("d_type", &self.d_type)
+                    .field("d_namlen", &self.d_namlen)
+                    .field("d_name", &&self.d_name[..self.d_namlen as _])
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for dirent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.d_fileno.hash(state);
+                self.d_off.hash(state);
+                self.d_reclen.hash(state);
+                self.d_type.hash(state);
+                self.d_namlen.hash(state);
+                self.d_name[..self.d_namlen as _].hash(state);
+            }
+        }
+
+        impl PartialEq for vnstat {
+            fn eq(&self, other: &vnstat) -> bool {
+                let self_vn_devname: &[::c_char] = &self.vn_devname;
+                let other_vn_devname: &[::c_char] = &other.vn_devname;
+
+                self.vn_fileid == other.vn_fileid &&
+                self.vn_size == other.vn_size &&
+                self.vn_dev == other.vn_dev &&
+                self.vn_fsid == other.vn_fsid &&
+                self.vn_mntdir == other.vn_mntdir &&
+                self.vn_type == other.vn_type &&
+                self.vn_mode == other.vn_mode &&
+                self_vn_devname == other_vn_devname
+            }
+        }
+        impl Eq for vnstat {}
+        impl ::fmt::Debug for vnstat {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let self_vn_devname: &[::c_char] = &self.vn_devname;
+
+                f.debug_struct("vnstat")
+                    .field("vn_fileid", &self.vn_fileid)
+                    .field("vn_size", &self.vn_size)
+                    .field("vn_dev", &self.vn_dev)
+                    .field("vn_fsid", &self.vn_fsid)
+                    .field("vn_mntdir", &self.vn_mntdir)
+                    .field("vn_type", &self.vn_type)
+                    .field("vn_mode", &self.vn_mode)
+                    .field("vn_devname", &self_vn_devname)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for vnstat {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let self_vn_devname: &[::c_char] = &self.vn_devname;
+
+                self.vn_fileid.hash(state);
+                self.vn_size.hash(state);
+                self.vn_dev.hash(state);
+                self.vn_fsid.hash(state);
+                self.vn_mntdir.hash(state);
+                self.vn_type.hash(state);
+                self.vn_mode.hash(state);
+                self_vn_devname.hash(state);
+            }
+        }
+    }
+}
+
+pub const RAND_MAX: ::c_int = 0x7fff_fffd;
+pub const ELAST: ::c_int = 97;
+
+/// max length of devicename
+pub const SPECNAMELEN: ::c_int = 63;
+pub const KI_NSPARE_PTR: usize = 6;
+
+pub const MINCORE_SUPER: ::c_int = 0x20;
+
+safe_f! {
+    pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::dev_t;
+        let mut dev = 0;
+        dev |= ((major & 0xffffff00) as dev_t) << 32;
+        dev |= ((major & 0x000000ff) as dev_t) << 8;
+        dev |= ((minor & 0x0000ff00) as dev_t) << 24;
+        dev |= ((minor & 0xffff00ff) as dev_t) << 0;
+        dev
+    }
+}
+
+f! {
+    pub fn major(dev: ::dev_t) -> ::c_int {
+        (((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as ::c_int
+    }
+
+    pub fn minor(dev: ::dev_t) -> ::c_int {
+        (((dev >> 24) & 0xff00) | (dev & 0xffff00ff)) as ::c_int
+    }
+}
+
+extern "C" {
+    pub fn setgrent();
+    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn msgrcv(
+        msqid: ::c_int,
+        msgp: *mut ::c_void,
+        msgsz: ::size_t,
+        msgtyp: ::c_long,
+        msgflg: ::c_int,
+    ) -> ::ssize_t;
+
+    pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+    pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
+}
+
+cfg_if! {
+    if #[cfg(any(target_arch = "x86_64",
+                 target_arch = "aarch64",
+                 target_arch = "riscv64"))] {
+        mod b64;
+        pub use self::b64::*;
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "x86_64")] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN;
+pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1;
+pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2;
+pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1;
+pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,34 @@
+#[repr(C)]
+#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
+pub struct stat {
+    pub st_dev: ::dev_t,
+    pub st_ino: ::ino_t,
+    pub st_nlink: ::nlink_t,
+    pub st_mode: ::mode_t,
+    st_padding0: i16,
+    pub st_uid: ::uid_t,
+    pub st_gid: ::gid_t,
+    st_padding1: i32,
+    pub st_rdev: ::dev_t,
+    pub st_atime: ::time_t,
+    pub st_atime_nsec: ::c_long,
+    pub st_mtime: ::time_t,
+    pub st_mtime_nsec: ::c_long,
+    pub st_ctime: ::time_t,
+    pub st_ctime_nsec: ::c_long,
+    pub st_birthtime: ::time_t,
+    pub st_birthtime_nsec: ::c_long,
+    pub st_size: ::off_t,
+    pub st_blocks: ::blkcnt_t,
+    pub st_blksize: ::blksize_t,
+    pub st_flags: ::fflags_t,
+    pub st_gen: u64,
+    pub st_spare: [u64; 10],
+}
+
+impl ::Copy for ::stat {}
+impl ::Clone for ::stat {
+    fn clone(&self) -> ::stat {
+        *self
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,546 @@
+// APIs in FreeBSD 13 that have changed since 11.
+
+pub type nlink_t = u64;
+pub type dev_t = u64;
+pub type ino_t = ::c_ulong;
+pub type shmatt_t = ::c_uint;
+pub type kpaddr_t = u64;
+pub type kssize_t = i64;
+pub type domainset_t = __c_anonymous_domainset;
+
+s! {
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+    }
+
+    pub struct kevent {
+        pub ident: ::uintptr_t,
+        pub filter: ::c_short,
+        pub flags: ::c_ushort,
+        pub fflags: ::c_uint,
+        pub data: i64,
+        pub udata: *mut ::c_void,
+        pub ext: [u64; 4],
+    }
+
+    pub struct kvm_page {
+        pub kp_version: ::u_int,
+        pub kp_paddr: ::kpaddr_t,
+        pub kp_kmap_vaddr: ::kvaddr_t,
+        pub kp_dmap_vaddr: ::kvaddr_t,
+        pub kp_prot: ::vm_prot_t,
+        pub kp_offset: ::off_t,
+        pub kp_len: ::size_t,
+    }
+
+    pub struct __c_anonymous_domainset {
+        _priv: [::uintptr_t; 4],
+    }
+
+    pub struct kinfo_proc {
+        /// Size of this structure.
+        pub ki_structsize: ::c_int,
+        /// Reserved: layout identifier.
+        pub ki_layout: ::c_int,
+        /// Address of command arguments.
+        pub ki_args: *mut ::pargs,
+        // This is normally "struct proc".
+        /// Address of proc.
+        pub ki_paddr: *mut ::c_void,
+        // This is normally "struct user".
+        /// Kernel virtual address of u-area.
+        pub ki_addr: *mut ::c_void,
+        // This is normally "struct vnode".
+        /// Pointer to trace file.
+        pub ki_tracep: *mut ::c_void,
+        // This is normally "struct vnode".
+        /// Pointer to executable file.
+        pub ki_textvp: *mut ::c_void,
+        // This is normally "struct filedesc".
+        /// Pointer to open file info.
+        pub ki_fd: *mut ::c_void,
+        // This is normally "struct vmspace".
+        /// Pointer to kernel vmspace struct.
+        pub ki_vmspace: *mut ::c_void,
+        /// Sleep address.
+        pub ki_wchan: *const ::c_void,
+        /// Process identifier.
+        pub ki_pid: ::pid_t,
+        /// Parent process ID.
+        pub ki_ppid: ::pid_t,
+        /// Process group ID.
+        pub ki_pgid: ::pid_t,
+        /// tty process group ID.
+        pub ki_tpgid: ::pid_t,
+        /// Process session ID.
+        pub ki_sid: ::pid_t,
+        /// Terminal session ID.
+        pub ki_tsid: ::pid_t,
+        /// Job control counter.
+        pub ki_jobc: ::c_short,
+        /// Unused (just here for alignment).
+        pub ki_spare_short1: ::c_short,
+        /// Controlling tty dev.
+        pub ki_tdev_freebsd11: u32,
+        /// Signals arrived but not delivered.
+        pub ki_siglist: ::sigset_t,
+        /// Current signal mask.
+        pub ki_sigmask: ::sigset_t,
+        /// Signals being ignored.
+        pub ki_sigignore: ::sigset_t,
+        /// Signals being caught by user.
+        pub ki_sigcatch: ::sigset_t,
+        /// Effective user ID.
+        pub ki_uid: ::uid_t,
+        /// Real user ID.
+        pub ki_ruid: ::uid_t,
+        /// Saved effective user ID.
+        pub ki_svuid: ::uid_t,
+        /// Real group ID.
+        pub ki_rgid: ::gid_t,
+        /// Saved effective group ID.
+        pub ki_svgid: ::gid_t,
+        /// Number of groups.
+        pub ki_ngroups: ::c_short,
+        /// Unused (just here for alignment).
+        pub ki_spare_short2: ::c_short,
+        /// Groups.
+        pub ki_groups: [::gid_t; ::KI_NGROUPS],
+        /// Virtual size.
+        pub ki_size: ::vm_size_t,
+        /// Current resident set size in pages.
+        pub ki_rssize: ::segsz_t,
+        /// Resident set size before last swap.
+        pub ki_swrss: ::segsz_t,
+        /// Text size (pages) XXX.
+        pub ki_tsize: ::segsz_t,
+        /// Data size (pages) XXX.
+        pub ki_dsize: ::segsz_t,
+        /// Stack size (pages).
+        pub ki_ssize: ::segsz_t,
+        /// Exit status for wait & stop signal.
+        pub ki_xstat: ::u_short,
+        /// Accounting flags.
+        pub ki_acflag: ::u_short,
+        /// %cpu for process during `ki_swtime`.
+        pub ki_pctcpu: ::fixpt_t,
+        /// Time averaged value of `ki_cpticks`.
+        pub ki_estcpu: ::u_int,
+        /// Time since last blocked.
+        pub ki_slptime: ::u_int,
+        /// Time swapped in or out.
+        pub ki_swtime: ::u_int,
+        /// Number of copy-on-write faults.
+        pub ki_cow: ::u_int,
+        /// Real time in microsec.
+        pub ki_runtime: u64,
+        /// Starting time.
+        pub ki_start: ::timeval,
+        /// Time used by process children.
+        pub ki_childtime: ::timeval,
+        /// P_* flags.
+        pub ki_flag: ::c_long,
+        /// KI_* flags (below).
+        pub ki_kiflag: ::c_long,
+        /// Kernel trace points.
+        pub ki_traceflag: ::c_int,
+        /// S* process status.
+        pub ki_stat: ::c_char,
+        /// Process "nice" value.
+        pub ki_nice: i8, // signed char
+        /// Process lock (prevent swap) count.
+        pub ki_lock: ::c_char,
+        /// Run queue index.
+        pub ki_rqindex: ::c_char,
+        /// Which cpu we are on.
+        pub ki_oncpu_old: ::c_uchar,
+        /// Last cpu we were on.
+        pub ki_lastcpu_old: ::c_uchar,
+        /// Thread name.
+        pub ki_tdname: [::c_char; ::TDNAMLEN + 1],
+        /// Wchan message.
+        pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
+        /// Setlogin name.
+        pub ki_login: [::c_char; ::LOGNAMELEN + 1],
+        /// Lock name.
+        pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
+        /// Command name.
+        pub ki_comm: [::c_char; ::COMMLEN + 1],
+        /// Emulation name.
+        pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
+        /// Login class.
+        pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
+        /// More thread name.
+        pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1],
+        /// Spare string space.
+        pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
+        /// Spare room for growth.
+        pub ki_spareints: [::c_int; ::KI_NSPARE_INT],
+        /// Controlling tty dev.
+        pub ki_tdev: u64,
+        /// Which cpu we are on.
+        pub ki_oncpu: ::c_int,
+        /// Last cpu we were on.
+        pub ki_lastcpu: ::c_int,
+        /// PID of tracing process.
+        pub ki_tracer: ::c_int,
+        /// P2_* flags.
+        pub ki_flag2: ::c_int,
+        /// Default FIB number.
+        pub ki_fibnum: ::c_int,
+        /// Credential flags.
+        pub ki_cr_flags: ::u_int,
+        /// Process jail ID.
+        pub ki_jid: ::c_int,
+        /// Number of threads in total.
+        pub ki_numthreads: ::c_int,
+        /// Thread ID.
+        pub ki_tid: ::lwpid_t,
+        /// Process priority.
+        pub ki_pri: ::priority,
+        /// Process rusage statistics.
+        pub ki_rusage: ::rusage,
+        /// rusage of children processes.
+        pub ki_rusage_ch: ::rusage,
+        // This is normally "struct pcb".
+        /// Kernel virtual addr of pcb.
+        pub ki_pcb: *mut ::c_void,
+        /// Kernel virtual addr of stack.
+        pub ki_kstack: *mut ::c_void,
+        /// User convenience pointer.
+        pub ki_udata: *mut ::c_void,
+        // This is normally "struct thread".
+        pub ki_tdaddr: *mut ::c_void,
+        // This is normally "struct pwddesc".
+        /// Pointer to process paths info.
+        pub ki_pd: *mut ::c_void,
+        pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR],
+        pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG],
+        /// PS_* flags.
+        pub ki_sflag: ::c_long,
+        /// kthread flag.
+        pub ki_tdflags: ::c_long,
+    }
+}
+
+s_no_extra_traits! {
+    pub struct dirent {
+        pub d_fileno: ::ino_t,
+        pub d_off: ::off_t,
+        pub d_reclen: u16,
+        pub d_type: u8,
+        d_pad0: u8,
+        pub d_namlen: u16,
+        d_pad1: u16,
+        pub d_name: [::c_char; 256],
+    }
+
+    pub struct statfs {
+        pub f_version: u32,
+        pub f_type: u32,
+        pub f_flags: u64,
+        pub f_bsize: u64,
+        pub f_iosize: u64,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: i64,
+        pub f_files: u64,
+        pub f_ffree: i64,
+        pub f_syncwrites: u64,
+        pub f_asyncwrites: u64,
+        pub f_syncreads: u64,
+        pub f_asyncreads: u64,
+        f_spare: [u64; 10],
+        pub f_namemax: u32,
+        pub f_owner: ::uid_t,
+        pub f_fsid: ::fsid_t,
+        f_charspare: [::c_char; 80],
+        pub f_fstypename: [::c_char; 16],
+        pub f_mntfromname: [::c_char; 1024],
+        pub f_mntonname: [::c_char; 1024],
+    }
+
+    pub struct vnstat {
+        pub vn_fileid: u64,
+        pub vn_size: u64,
+        pub vn_dev: u64,
+        pub vn_fsid: u64,
+        pub vn_mntdir: *mut ::c_char,
+        pub vn_type: ::c_int,
+        pub vn_mode: u16,
+        pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for statfs {
+            fn eq(&self, other: &statfs) -> bool {
+                self.f_version == other.f_version
+                    && self.f_type == other.f_type
+                    && self.f_flags == other.f_flags
+                    && self.f_bsize == other.f_bsize
+                    && self.f_iosize == other.f_iosize
+                    && self.f_blocks == other.f_blocks
+                    && self.f_bfree == other.f_bfree
+                    && self.f_bavail == other.f_bavail
+                    && self.f_files == other.f_files
+                    && self.f_ffree == other.f_ffree
+                    && self.f_syncwrites == other.f_syncwrites
+                    && self.f_asyncwrites == other.f_asyncwrites
+                    && self.f_syncreads == other.f_syncreads
+                    && self.f_asyncreads == other.f_asyncreads
+                    && self.f_namemax == other.f_namemax
+                    && self.f_owner == other.f_owner
+                    && self.f_fsid == other.f_fsid
+                    && self.f_fstypename == other.f_fstypename
+                    && self
+                    .f_mntfromname
+                    .iter()
+                    .zip(other.f_mntfromname.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .f_mntonname
+                    .iter()
+                    .zip(other.f_mntonname.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for statfs {}
+        impl ::fmt::Debug for statfs {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("statfs")
+                    .field("f_bsize", &self.f_bsize)
+                    .field("f_iosize", &self.f_iosize)
+                    .field("f_blocks", &self.f_blocks)
+                    .field("f_bfree", &self.f_bfree)
+                    .field("f_bavail", &self.f_bavail)
+                    .field("f_files", &self.f_files)
+                    .field("f_ffree", &self.f_ffree)
+                    .field("f_syncwrites", &self.f_syncwrites)
+                    .field("f_asyncwrites", &self.f_asyncwrites)
+                    .field("f_syncreads", &self.f_syncreads)
+                    .field("f_asyncreads", &self.f_asyncreads)
+                    .field("f_namemax", &self.f_namemax)
+                    .field("f_owner", &self.f_owner)
+                    .field("f_fsid", &self.f_fsid)
+                    .field("f_fstypename", &self.f_fstypename)
+                    .field("f_mntfromname", &&self.f_mntfromname[..])
+                    .field("f_mntonname", &&self.f_mntonname[..])
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for statfs {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.f_version.hash(state);
+                self.f_type.hash(state);
+                self.f_flags.hash(state);
+                self.f_bsize.hash(state);
+                self.f_iosize.hash(state);
+                self.f_blocks.hash(state);
+                self.f_bfree.hash(state);
+                self.f_bavail.hash(state);
+                self.f_files.hash(state);
+                self.f_ffree.hash(state);
+                self.f_syncwrites.hash(state);
+                self.f_asyncwrites.hash(state);
+                self.f_syncreads.hash(state);
+                self.f_asyncreads.hash(state);
+                self.f_namemax.hash(state);
+                self.f_owner.hash(state);
+                self.f_fsid.hash(state);
+                self.f_charspare.hash(state);
+                self.f_fstypename.hash(state);
+                self.f_mntfromname.hash(state);
+                self.f_mntonname.hash(state);
+            }
+        }
+
+        impl PartialEq for dirent {
+            fn eq(&self, other: &dirent) -> bool {
+                self.d_fileno == other.d_fileno
+                    && self.d_off == other.d_off
+                    && self.d_reclen == other.d_reclen
+                    && self.d_type == other.d_type
+                    && self.d_namlen == other.d_namlen
+                    && self
+                    .d_name[..self.d_namlen as _]
+                    .iter()
+                    .zip(other.d_name.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for dirent {}
+        impl ::fmt::Debug for dirent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("dirent")
+                    .field("d_fileno", &self.d_fileno)
+                    .field("d_off", &self.d_off)
+                    .field("d_reclen", &self.d_reclen)
+                    .field("d_type", &self.d_type)
+                    .field("d_namlen", &self.d_namlen)
+                    .field("d_name", &&self.d_name[..self.d_namlen as _])
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for dirent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.d_fileno.hash(state);
+                self.d_off.hash(state);
+                self.d_reclen.hash(state);
+                self.d_type.hash(state);
+                self.d_namlen.hash(state);
+                self.d_name[..self.d_namlen as _].hash(state);
+            }
+        }
+
+        impl PartialEq for vnstat {
+            fn eq(&self, other: &vnstat) -> bool {
+                let self_vn_devname: &[::c_char] = &self.vn_devname;
+                let other_vn_devname: &[::c_char] = &other.vn_devname;
+
+                self.vn_fileid == other.vn_fileid &&
+                self.vn_size == other.vn_size &&
+                self.vn_dev == other.vn_dev &&
+                self.vn_fsid == other.vn_fsid &&
+                self.vn_mntdir == other.vn_mntdir &&
+                self.vn_type == other.vn_type &&
+                self.vn_mode == other.vn_mode &&
+                self_vn_devname == other_vn_devname
+            }
+        }
+        impl Eq for vnstat {}
+        impl ::fmt::Debug for vnstat {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let self_vn_devname: &[::c_char] = &self.vn_devname;
+
+                f.debug_struct("vnstat")
+                    .field("vn_fileid", &self.vn_fileid)
+                    .field("vn_size", &self.vn_size)
+                    .field("vn_dev", &self.vn_dev)
+                    .field("vn_fsid", &self.vn_fsid)
+                    .field("vn_mntdir", &self.vn_mntdir)
+                    .field("vn_type", &self.vn_type)
+                    .field("vn_mode", &self.vn_mode)
+                    .field("vn_devname", &self_vn_devname)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for vnstat {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let self_vn_devname: &[::c_char] = &self.vn_devname;
+
+                self.vn_fileid.hash(state);
+                self.vn_size.hash(state);
+                self.vn_dev.hash(state);
+                self.vn_fsid.hash(state);
+                self.vn_mntdir.hash(state);
+                self.vn_type.hash(state);
+                self.vn_mode.hash(state);
+                self_vn_devname.hash(state);
+            }
+        }
+    }
+}
+
+pub const RAND_MAX: ::c_int = 0x7fff_ffff;
+pub const ELAST: ::c_int = 97;
+
+pub const KF_TYPE_EVENTFD: ::c_int = 13;
+
+/// max length of devicename
+pub const SPECNAMELEN: ::c_int = 255;
+pub const KI_NSPARE_PTR: usize = 5;
+
+/// domainset policies
+pub const DOMAINSET_POLICY_INVALID: ::c_int = 0;
+pub const DOMAINSET_POLICY_ROUNDROBIN: ::c_int = 1;
+pub const DOMAINSET_POLICY_FIRSTTOUCH: ::c_int = 2;
+pub const DOMAINSET_POLICY_PREFER: ::c_int = 3;
+pub const DOMAINSET_POLICY_INTERLEAVE: ::c_int = 4;
+
+pub const MINCORE_SUPER: ::c_int = 0x20;
+
+safe_f! {
+    pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::dev_t;
+        let mut dev = 0;
+        dev |= ((major & 0xffffff00) as dev_t) << 32;
+        dev |= ((major & 0x000000ff) as dev_t) << 8;
+        dev |= ((minor & 0x0000ff00) as dev_t) << 24;
+        dev |= ((minor & 0xffff00ff) as dev_t) << 0;
+        dev
+    }
+}
+
+f! {
+    pub fn major(dev: ::dev_t) -> ::c_int {
+        (((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as ::c_int
+    }
+
+    pub fn minor(dev: ::dev_t) -> ::c_int {
+        (((dev >> 24) & 0xff00) | (dev & 0xffff00ff)) as ::c_int
+    }
+}
+
+extern "C" {
+    pub fn setgrent();
+    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn msgrcv(
+        msqid: ::c_int,
+        msgp: *mut ::c_void,
+        msgsz: ::size_t,
+        msgtyp: ::c_long,
+        msgflg: ::c_int,
+    ) -> ::ssize_t;
+
+    pub fn cpuset_getdomain(
+        level: ::cpulevel_t,
+        which: ::cpuwhich_t,
+        id: ::id_t,
+        setsize: ::size_t,
+        mask: *mut ::domainset_t,
+        policy: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn cpuset_setdomain(
+        level: ::cpulevel_t,
+        which: ::cpuwhich_t,
+        id: ::id_t,
+        setsize: ::size_t,
+        mask: *const ::domainset_t,
+        policy: ::c_int,
+    ) -> ::c_int;
+
+    pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+    pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
+}
+
+#[link(name = "kvm")]
+extern "C" {
+    pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t;
+}
+
+cfg_if! {
+    if #[cfg(any(target_arch = "x86_64",
+                 target_arch = "aarch64",
+                 target_arch = "riscv64"))] {
+        mod b64;
+        pub use self::b64::*;
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "x86_64")] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN;
+pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1;
+pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2;
+pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1;
+pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,34 @@
+#[repr(C)]
+#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
+pub struct stat {
+    pub st_dev: ::dev_t,
+    pub st_ino: ::ino_t,
+    pub st_nlink: ::nlink_t,
+    pub st_mode: ::mode_t,
+    st_padding0: i16,
+    pub st_uid: ::uid_t,
+    pub st_gid: ::gid_t,
+    st_padding1: i32,
+    pub st_rdev: ::dev_t,
+    pub st_atime: ::time_t,
+    pub st_atime_nsec: ::c_long,
+    pub st_mtime: ::time_t,
+    pub st_mtime_nsec: ::c_long,
+    pub st_ctime: ::time_t,
+    pub st_ctime_nsec: ::c_long,
+    pub st_birthtime: ::time_t,
+    pub st_birthtime_nsec: ::c_long,
+    pub st_size: ::off_t,
+    pub st_blocks: ::blkcnt_t,
+    pub st_blksize: ::blksize_t,
+    pub st_flags: ::fflags_t,
+    pub st_gen: u64,
+    pub st_spare: [u64; 10],
+}
+
+impl ::Copy for ::stat {}
+impl ::Clone for ::stat {
+    fn clone(&self) -> ::stat {
+        *self
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,546 @@
+// APIs in FreeBSD 14 that have changed since 11.
+
+pub type nlink_t = u64;
+pub type dev_t = u64;
+pub type ino_t = ::c_ulong;
+pub type shmatt_t = ::c_uint;
+pub type kpaddr_t = u64;
+pub type kssize_t = i64;
+pub type domainset_t = __c_anonymous_domainset;
+
+s! {
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+    }
+
+    pub struct kevent {
+        pub ident: ::uintptr_t,
+        pub filter: ::c_short,
+        pub flags: ::c_ushort,
+        pub fflags: ::c_uint,
+        pub data: i64,
+        pub udata: *mut ::c_void,
+        pub ext: [u64; 4],
+    }
+
+    pub struct kvm_page {
+        pub kp_version: ::u_int,
+        pub kp_paddr: ::kpaddr_t,
+        pub kp_kmap_vaddr: ::kvaddr_t,
+        pub kp_dmap_vaddr: ::kvaddr_t,
+        pub kp_prot: ::vm_prot_t,
+        pub kp_offset: ::off_t,
+        pub kp_len: ::size_t,
+    }
+
+    pub struct __c_anonymous_domainset {
+        _priv: [::uintptr_t; 4],
+    }
+
+    pub struct kinfo_proc {
+        /// Size of this structure.
+        pub ki_structsize: ::c_int,
+        /// Reserved: layout identifier.
+        pub ki_layout: ::c_int,
+        /// Address of command arguments.
+        pub ki_args: *mut ::pargs,
+        // This is normally "struct proc".
+        /// Address of proc.
+        pub ki_paddr: *mut ::c_void,
+        // This is normally "struct user".
+        /// Kernel virtual address of u-area.
+        pub ki_addr: *mut ::c_void,
+        // This is normally "struct vnode".
+        /// Pointer to trace file.
+        pub ki_tracep: *mut ::c_void,
+        // This is normally "struct vnode".
+        /// Pointer to executable file.
+        pub ki_textvp: *mut ::c_void,
+        // This is normally "struct filedesc".
+        /// Pointer to open file info.
+        pub ki_fd: *mut ::c_void,
+        // This is normally "struct vmspace".
+        /// Pointer to kernel vmspace struct.
+        pub ki_vmspace: *mut ::c_void,
+        /// Sleep address.
+        pub ki_wchan: *const ::c_void,
+        /// Process identifier.
+        pub ki_pid: ::pid_t,
+        /// Parent process ID.
+        pub ki_ppid: ::pid_t,
+        /// Process group ID.
+        pub ki_pgid: ::pid_t,
+        /// tty process group ID.
+        pub ki_tpgid: ::pid_t,
+        /// Process session ID.
+        pub ki_sid: ::pid_t,
+        /// Terminal session ID.
+        pub ki_tsid: ::pid_t,
+        /// Job control counter.
+        pub ki_jobc: ::c_short,
+        /// Unused (just here for alignment).
+        pub ki_spare_short1: ::c_short,
+        /// Controlling tty dev.
+        pub ki_tdev_freebsd11: u32,
+        /// Signals arrived but not delivered.
+        pub ki_siglist: ::sigset_t,
+        /// Current signal mask.
+        pub ki_sigmask: ::sigset_t,
+        /// Signals being ignored.
+        pub ki_sigignore: ::sigset_t,
+        /// Signals being caught by user.
+        pub ki_sigcatch: ::sigset_t,
+        /// Effective user ID.
+        pub ki_uid: ::uid_t,
+        /// Real user ID.
+        pub ki_ruid: ::uid_t,
+        /// Saved effective user ID.
+        pub ki_svuid: ::uid_t,
+        /// Real group ID.
+        pub ki_rgid: ::gid_t,
+        /// Saved effective group ID.
+        pub ki_svgid: ::gid_t,
+        /// Number of groups.
+        pub ki_ngroups: ::c_short,
+        /// Unused (just here for alignment).
+        pub ki_spare_short2: ::c_short,
+        /// Groups.
+        pub ki_groups: [::gid_t; ::KI_NGROUPS],
+        /// Virtual size.
+        pub ki_size: ::vm_size_t,
+        /// Current resident set size in pages.
+        pub ki_rssize: ::segsz_t,
+        /// Resident set size before last swap.
+        pub ki_swrss: ::segsz_t,
+        /// Text size (pages) XXX.
+        pub ki_tsize: ::segsz_t,
+        /// Data size (pages) XXX.
+        pub ki_dsize: ::segsz_t,
+        /// Stack size (pages).
+        pub ki_ssize: ::segsz_t,
+        /// Exit status for wait & stop signal.
+        pub ki_xstat: ::u_short,
+        /// Accounting flags.
+        pub ki_acflag: ::u_short,
+        /// %cpu for process during `ki_swtime`.
+        pub ki_pctcpu: ::fixpt_t,
+        /// Time averaged value of `ki_cpticks`.
+        pub ki_estcpu: ::u_int,
+        /// Time since last blocked.
+        pub ki_slptime: ::u_int,
+        /// Time swapped in or out.
+        pub ki_swtime: ::u_int,
+        /// Number of copy-on-write faults.
+        pub ki_cow: ::u_int,
+        /// Real time in microsec.
+        pub ki_runtime: u64,
+        /// Starting time.
+        pub ki_start: ::timeval,
+        /// Time used by process children.
+        pub ki_childtime: ::timeval,
+        /// P_* flags.
+        pub ki_flag: ::c_long,
+        /// KI_* flags (below).
+        pub ki_kiflag: ::c_long,
+        /// Kernel trace points.
+        pub ki_traceflag: ::c_int,
+        /// S* process status.
+        pub ki_stat: ::c_char,
+        /// Process "nice" value.
+        pub ki_nice: i8, // signed char
+        /// Process lock (prevent swap) count.
+        pub ki_lock: ::c_char,
+        /// Run queue index.
+        pub ki_rqindex: ::c_char,
+        /// Which cpu we are on.
+        pub ki_oncpu_old: ::c_uchar,
+        /// Last cpu we were on.
+        pub ki_lastcpu_old: ::c_uchar,
+        /// Thread name.
+        pub ki_tdname: [::c_char; ::TDNAMLEN + 1],
+        /// Wchan message.
+        pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
+        /// Setlogin name.
+        pub ki_login: [::c_char; ::LOGNAMELEN + 1],
+        /// Lock name.
+        pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
+        /// Command name.
+        pub ki_comm: [::c_char; ::COMMLEN + 1],
+        /// Emulation name.
+        pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
+        /// Login class.
+        pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
+        /// More thread name.
+        pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1],
+        /// Spare string space.
+        pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
+        /// Spare room for growth.
+        pub ki_spareints: [::c_int; ::KI_NSPARE_INT],
+        /// Controlling tty dev.
+        pub ki_tdev: u64,
+        /// Which cpu we are on.
+        pub ki_oncpu: ::c_int,
+        /// Last cpu we were on.
+        pub ki_lastcpu: ::c_int,
+        /// PID of tracing process.
+        pub ki_tracer: ::c_int,
+        /// P2_* flags.
+        pub ki_flag2: ::c_int,
+        /// Default FIB number.
+        pub ki_fibnum: ::c_int,
+        /// Credential flags.
+        pub ki_cr_flags: ::u_int,
+        /// Process jail ID.
+        pub ki_jid: ::c_int,
+        /// Number of threads in total.
+        pub ki_numthreads: ::c_int,
+        /// Thread ID.
+        pub ki_tid: ::lwpid_t,
+        /// Process priority.
+        pub ki_pri: ::priority,
+        /// Process rusage statistics.
+        pub ki_rusage: ::rusage,
+        /// rusage of children processes.
+        pub ki_rusage_ch: ::rusage,
+        // This is normally "struct pcb".
+        /// Kernel virtual addr of pcb.
+        pub ki_pcb: *mut ::c_void,
+        /// Kernel virtual addr of stack.
+        pub ki_kstack: *mut ::c_void,
+        /// User convenience pointer.
+        pub ki_udata: *mut ::c_void,
+        // This is normally "struct thread".
+        pub ki_tdaddr: *mut ::c_void,
+        // This is normally "struct pwddesc".
+        /// Pointer to process paths info.
+        pub ki_pd: *mut ::c_void,
+        pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR],
+        pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG],
+        /// PS_* flags.
+        pub ki_sflag: ::c_long,
+        /// kthread flag.
+        pub ki_tdflags: ::c_long,
+    }
+}
+
+s_no_extra_traits! {
+    pub struct dirent {
+        pub d_fileno: ::ino_t,
+        pub d_off: ::off_t,
+        pub d_reclen: u16,
+        pub d_type: u8,
+        d_pad0: u8,
+        pub d_namlen: u16,
+        d_pad1: u16,
+        pub d_name: [::c_char; 256],
+    }
+
+    pub struct statfs {
+        pub f_version: u32,
+        pub f_type: u32,
+        pub f_flags: u64,
+        pub f_bsize: u64,
+        pub f_iosize: u64,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: i64,
+        pub f_files: u64,
+        pub f_ffree: i64,
+        pub f_syncwrites: u64,
+        pub f_asyncwrites: u64,
+        pub f_syncreads: u64,
+        pub f_asyncreads: u64,
+        f_spare: [u64; 10],
+        pub f_namemax: u32,
+        pub f_owner: ::uid_t,
+        pub f_fsid: ::fsid_t,
+        f_charspare: [::c_char; 80],
+        pub f_fstypename: [::c_char; 16],
+        pub f_mntfromname: [::c_char; 1024],
+        pub f_mntonname: [::c_char; 1024],
+    }
+
+    pub struct vnstat {
+        pub vn_fileid: u64,
+        pub vn_size: u64,
+        pub vn_dev: u64,
+        pub vn_fsid: u64,
+        pub vn_mntdir: *mut ::c_char,
+        pub vn_type: ::c_int,
+        pub vn_mode: u16,
+        pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for statfs {
+            fn eq(&self, other: &statfs) -> bool {
+                self.f_version == other.f_version
+                    && self.f_type == other.f_type
+                    && self.f_flags == other.f_flags
+                    && self.f_bsize == other.f_bsize
+                    && self.f_iosize == other.f_iosize
+                    && self.f_blocks == other.f_blocks
+                    && self.f_bfree == other.f_bfree
+                    && self.f_bavail == other.f_bavail
+                    && self.f_files == other.f_files
+                    && self.f_ffree == other.f_ffree
+                    && self.f_syncwrites == other.f_syncwrites
+                    && self.f_asyncwrites == other.f_asyncwrites
+                    && self.f_syncreads == other.f_syncreads
+                    && self.f_asyncreads == other.f_asyncreads
+                    && self.f_namemax == other.f_namemax
+                    && self.f_owner == other.f_owner
+                    && self.f_fsid == other.f_fsid
+                    && self.f_fstypename == other.f_fstypename
+                    && self
+                    .f_mntfromname
+                    .iter()
+                    .zip(other.f_mntfromname.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .f_mntonname
+                    .iter()
+                    .zip(other.f_mntonname.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for statfs {}
+        impl ::fmt::Debug for statfs {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("statfs")
+                    .field("f_bsize", &self.f_bsize)
+                    .field("f_iosize", &self.f_iosize)
+                    .field("f_blocks", &self.f_blocks)
+                    .field("f_bfree", &self.f_bfree)
+                    .field("f_bavail", &self.f_bavail)
+                    .field("f_files", &self.f_files)
+                    .field("f_ffree", &self.f_ffree)
+                    .field("f_syncwrites", &self.f_syncwrites)
+                    .field("f_asyncwrites", &self.f_asyncwrites)
+                    .field("f_syncreads", &self.f_syncreads)
+                    .field("f_asyncreads", &self.f_asyncreads)
+                    .field("f_namemax", &self.f_namemax)
+                    .field("f_owner", &self.f_owner)
+                    .field("f_fsid", &self.f_fsid)
+                    .field("f_fstypename", &self.f_fstypename)
+                    .field("f_mntfromname", &&self.f_mntfromname[..])
+                    .field("f_mntonname", &&self.f_mntonname[..])
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for statfs {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.f_version.hash(state);
+                self.f_type.hash(state);
+                self.f_flags.hash(state);
+                self.f_bsize.hash(state);
+                self.f_iosize.hash(state);
+                self.f_blocks.hash(state);
+                self.f_bfree.hash(state);
+                self.f_bavail.hash(state);
+                self.f_files.hash(state);
+                self.f_ffree.hash(state);
+                self.f_syncwrites.hash(state);
+                self.f_asyncwrites.hash(state);
+                self.f_syncreads.hash(state);
+                self.f_asyncreads.hash(state);
+                self.f_namemax.hash(state);
+                self.f_owner.hash(state);
+                self.f_fsid.hash(state);
+                self.f_charspare.hash(state);
+                self.f_fstypename.hash(state);
+                self.f_mntfromname.hash(state);
+                self.f_mntonname.hash(state);
+            }
+        }
+
+        impl PartialEq for dirent {
+            fn eq(&self, other: &dirent) -> bool {
+                self.d_fileno == other.d_fileno
+                    && self.d_off == other.d_off
+                    && self.d_reclen == other.d_reclen
+                    && self.d_type == other.d_type
+                    && self.d_namlen == other.d_namlen
+                    && self
+                    .d_name[..self.d_namlen as _]
+                    .iter()
+                    .zip(other.d_name.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for dirent {}
+        impl ::fmt::Debug for dirent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("dirent")
+                    .field("d_fileno", &self.d_fileno)
+                    .field("d_off", &self.d_off)
+                    .field("d_reclen", &self.d_reclen)
+                    .field("d_type", &self.d_type)
+                    .field("d_namlen", &self.d_namlen)
+                    .field("d_name", &&self.d_name[..self.d_namlen as _])
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for dirent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.d_fileno.hash(state);
+                self.d_off.hash(state);
+                self.d_reclen.hash(state);
+                self.d_type.hash(state);
+                self.d_namlen.hash(state);
+                self.d_name[..self.d_namlen as _].hash(state);
+            }
+        }
+
+        impl PartialEq for vnstat {
+            fn eq(&self, other: &vnstat) -> bool {
+                let self_vn_devname: &[::c_char] = &self.vn_devname;
+                let other_vn_devname: &[::c_char] = &other.vn_devname;
+
+                self.vn_fileid == other.vn_fileid &&
+                self.vn_size == other.vn_size &&
+                self.vn_dev == other.vn_dev &&
+                self.vn_fsid == other.vn_fsid &&
+                self.vn_mntdir == other.vn_mntdir &&
+                self.vn_type == other.vn_type &&
+                self.vn_mode == other.vn_mode &&
+                self_vn_devname == other_vn_devname
+            }
+        }
+        impl Eq for vnstat {}
+        impl ::fmt::Debug for vnstat {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let self_vn_devname: &[::c_char] = &self.vn_devname;
+
+                f.debug_struct("vnstat")
+                    .field("vn_fileid", &self.vn_fileid)
+                    .field("vn_size", &self.vn_size)
+                    .field("vn_dev", &self.vn_dev)
+                    .field("vn_fsid", &self.vn_fsid)
+                    .field("vn_mntdir", &self.vn_mntdir)
+                    .field("vn_type", &self.vn_type)
+                    .field("vn_mode", &self.vn_mode)
+                    .field("vn_devname", &self_vn_devname)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for vnstat {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let self_vn_devname: &[::c_char] = &self.vn_devname;
+
+                self.vn_fileid.hash(state);
+                self.vn_size.hash(state);
+                self.vn_dev.hash(state);
+                self.vn_fsid.hash(state);
+                self.vn_mntdir.hash(state);
+                self.vn_type.hash(state);
+                self.vn_mode.hash(state);
+                self_vn_devname.hash(state);
+            }
+        }
+    }
+}
+
+pub const RAND_MAX: ::c_int = 0x7fff_ffff;
+pub const ELAST: ::c_int = 97;
+
+pub const KF_TYPE_EVENTFD: ::c_int = 13;
+
+/// max length of devicename
+pub const SPECNAMELEN: ::c_int = 255;
+pub const KI_NSPARE_PTR: usize = 5;
+
+/// domainset policies
+pub const DOMAINSET_POLICY_INVALID: ::c_int = 0;
+pub const DOMAINSET_POLICY_ROUNDROBIN: ::c_int = 1;
+pub const DOMAINSET_POLICY_FIRSTTOUCH: ::c_int = 2;
+pub const DOMAINSET_POLICY_PREFER: ::c_int = 3;
+pub const DOMAINSET_POLICY_INTERLEAVE: ::c_int = 4;
+
+pub const MINCORE_SUPER: ::c_int = 0x60;
+
+safe_f! {
+    pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::dev_t;
+        let mut dev = 0;
+        dev |= ((major & 0xffffff00) as dev_t) << 32;
+        dev |= ((major & 0x000000ff) as dev_t) << 8;
+        dev |= ((minor & 0x0000ff00) as dev_t) << 24;
+        dev |= ((minor & 0xffff00ff) as dev_t) << 0;
+        dev
+    }
+}
+
+f! {
+    pub fn major(dev: ::dev_t) -> ::c_int {
+        (((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as ::c_int
+    }
+
+    pub fn minor(dev: ::dev_t) -> ::c_int {
+        (((dev >> 24) & 0xff00) | (dev & 0xffff00ff)) as ::c_int
+    }
+}
+
+extern "C" {
+    pub fn setgrent();
+    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn msgrcv(
+        msqid: ::c_int,
+        msgp: *mut ::c_void,
+        msgsz: ::size_t,
+        msgtyp: ::c_long,
+        msgflg: ::c_int,
+    ) -> ::ssize_t;
+
+    pub fn cpuset_getdomain(
+        level: ::cpulevel_t,
+        which: ::cpuwhich_t,
+        id: ::id_t,
+        setsize: ::size_t,
+        mask: *mut ::domainset_t,
+        policy: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn cpuset_setdomain(
+        level: ::cpulevel_t,
+        which: ::cpuwhich_t,
+        id: ::id_t,
+        setsize: ::size_t,
+        mask: *const ::domainset_t,
+        policy: ::c_int,
+    ) -> ::c_int;
+
+    pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+    pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
+}
+
+#[link(name = "kvm")]
+extern "C" {
+    pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t;
+}
+
+cfg_if! {
+    if #[cfg(any(target_arch = "x86_64",
+                 target_arch = "aarch64",
+                 target_arch = "riscv64"))] {
+        mod b64;
+        pub use self::b64::*;
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "x86_64")] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,12 @@
+pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN;
+pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1;
+pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2;
+pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1;
+pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000;
+pub const PROC_LA_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN + 2;
+pub const PROC_LA_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 3;
+pub const PROC_LA_CTL_LA48_ON_EXEC: ::c_int = 1;
+pub const PROC_LA_CTL_LA57_ON_EXEC: ::c_int = 2;
+pub const PROC_LA_CTL_DEFAULT_ON_EXEC: ::c_int = 3;
+pub const PROC_LA_STATUS_LA48: ::c_int = 0x01000000;
+pub const PROC_LA_STATUS_LA57: ::c_int = 0x02000000;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,34 @@
+#[repr(C)]
+#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
+pub struct stat {
+    pub st_dev: ::dev_t,
+    pub st_ino: ::ino_t,
+    pub st_nlink: ::nlink_t,
+    pub st_mode: ::mode_t,
+    st_padding0: i16,
+    pub st_uid: ::uid_t,
+    pub st_gid: ::gid_t,
+    st_padding1: i32,
+    pub st_rdev: ::dev_t,
+    pub st_atime: ::time_t,
+    pub st_atime_nsec: ::c_long,
+    pub st_mtime: ::time_t,
+    pub st_mtime_nsec: ::c_long,
+    pub st_ctime: ::time_t,
+    pub st_ctime_nsec: ::c_long,
+    pub st_birthtime: ::time_t,
+    pub st_birthtime_nsec: ::c_long,
+    pub st_size: ::off_t,
+    pub st_blocks: ::blkcnt_t,
+    pub st_blksize: ::blksize_t,
+    pub st_flags: ::fflags_t,
+    pub st_gen: u64,
+    pub st_spare: [u64; 10],
+}
+
+impl ::Copy for ::stat {}
+impl ::Clone for ::stat {
+    fn clone(&self) -> ::stat {
+        *self
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,546 @@
+// APIs in FreeBSD 15 that have changed since 11.
+
+pub type nlink_t = u64;
+pub type dev_t = u64;
+pub type ino_t = ::c_ulong;
+pub type shmatt_t = ::c_uint;
+pub type kpaddr_t = u64;
+pub type kssize_t = i64;
+pub type domainset_t = __c_anonymous_domainset;
+
+s! {
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+    }
+
+    pub struct kevent {
+        pub ident: ::uintptr_t,
+        pub filter: ::c_short,
+        pub flags: ::c_ushort,
+        pub fflags: ::c_uint,
+        pub data: i64,
+        pub udata: *mut ::c_void,
+        pub ext: [u64; 4],
+    }
+
+    pub struct kvm_page {
+        pub kp_version: ::u_int,
+        pub kp_paddr: ::kpaddr_t,
+        pub kp_kmap_vaddr: ::kvaddr_t,
+        pub kp_dmap_vaddr: ::kvaddr_t,
+        pub kp_prot: ::vm_prot_t,
+        pub kp_offset: ::off_t,
+        pub kp_len: ::size_t,
+    }
+
+    pub struct __c_anonymous_domainset {
+        _priv: [::uintptr_t; 4],
+    }
+
+    pub struct kinfo_proc {
+        /// Size of this structure.
+        pub ki_structsize: ::c_int,
+        /// Reserved: layout identifier.
+        pub ki_layout: ::c_int,
+        /// Address of command arguments.
+        pub ki_args: *mut ::pargs,
+        // This is normally "struct proc".
+        /// Address of proc.
+        pub ki_paddr: *mut ::c_void,
+        // This is normally "struct user".
+        /// Kernel virtual address of u-area.
+        pub ki_addr: *mut ::c_void,
+        // This is normally "struct vnode".
+        /// Pointer to trace file.
+        pub ki_tracep: *mut ::c_void,
+        // This is normally "struct vnode".
+        /// Pointer to executable file.
+        pub ki_textvp: *mut ::c_void,
+        // This is normally "struct filedesc".
+        /// Pointer to open file info.
+        pub ki_fd: *mut ::c_void,
+        // This is normally "struct vmspace".
+        /// Pointer to kernel vmspace struct.
+        pub ki_vmspace: *mut ::c_void,
+        /// Sleep address.
+        pub ki_wchan: *const ::c_void,
+        /// Process identifier.
+        pub ki_pid: ::pid_t,
+        /// Parent process ID.
+        pub ki_ppid: ::pid_t,
+        /// Process group ID.
+        pub ki_pgid: ::pid_t,
+        /// tty process group ID.
+        pub ki_tpgid: ::pid_t,
+        /// Process session ID.
+        pub ki_sid: ::pid_t,
+        /// Terminal session ID.
+        pub ki_tsid: ::pid_t,
+        /// Job control counter.
+        pub ki_jobc: ::c_short,
+        /// Unused (just here for alignment).
+        pub ki_spare_short1: ::c_short,
+        /// Controlling tty dev.
+        pub ki_tdev_freebsd11: u32,
+        /// Signals arrived but not delivered.
+        pub ki_siglist: ::sigset_t,
+        /// Current signal mask.
+        pub ki_sigmask: ::sigset_t,
+        /// Signals being ignored.
+        pub ki_sigignore: ::sigset_t,
+        /// Signals being caught by user.
+        pub ki_sigcatch: ::sigset_t,
+        /// Effective user ID.
+        pub ki_uid: ::uid_t,
+        /// Real user ID.
+        pub ki_ruid: ::uid_t,
+        /// Saved effective user ID.
+        pub ki_svuid: ::uid_t,
+        /// Real group ID.
+        pub ki_rgid: ::gid_t,
+        /// Saved effective group ID.
+        pub ki_svgid: ::gid_t,
+        /// Number of groups.
+        pub ki_ngroups: ::c_short,
+        /// Unused (just here for alignment).
+        pub ki_spare_short2: ::c_short,
+        /// Groups.
+        pub ki_groups: [::gid_t; ::KI_NGROUPS],
+        /// Virtual size.
+        pub ki_size: ::vm_size_t,
+        /// Current resident set size in pages.
+        pub ki_rssize: ::segsz_t,
+        /// Resident set size before last swap.
+        pub ki_swrss: ::segsz_t,
+        /// Text size (pages) XXX.
+        pub ki_tsize: ::segsz_t,
+        /// Data size (pages) XXX.
+        pub ki_dsize: ::segsz_t,
+        /// Stack size (pages).
+        pub ki_ssize: ::segsz_t,
+        /// Exit status for wait & stop signal.
+        pub ki_xstat: ::u_short,
+        /// Accounting flags.
+        pub ki_acflag: ::u_short,
+        /// %cpu for process during `ki_swtime`.
+        pub ki_pctcpu: ::fixpt_t,
+        /// Time averaged value of `ki_cpticks`.
+        pub ki_estcpu: ::u_int,
+        /// Time since last blocked.
+        pub ki_slptime: ::u_int,
+        /// Time swapped in or out.
+        pub ki_swtime: ::u_int,
+        /// Number of copy-on-write faults.
+        pub ki_cow: ::u_int,
+        /// Real time in microsec.
+        pub ki_runtime: u64,
+        /// Starting time.
+        pub ki_start: ::timeval,
+        /// Time used by process children.
+        pub ki_childtime: ::timeval,
+        /// P_* flags.
+        pub ki_flag: ::c_long,
+        /// KI_* flags (below).
+        pub ki_kiflag: ::c_long,
+        /// Kernel trace points.
+        pub ki_traceflag: ::c_int,
+        /// S* process status.
+        pub ki_stat: ::c_char,
+        /// Process "nice" value.
+        pub ki_nice: i8, // signed char
+        /// Process lock (prevent swap) count.
+        pub ki_lock: ::c_char,
+        /// Run queue index.
+        pub ki_rqindex: ::c_char,
+        /// Which cpu we are on.
+        pub ki_oncpu_old: ::c_uchar,
+        /// Last cpu we were on.
+        pub ki_lastcpu_old: ::c_uchar,
+        /// Thread name.
+        pub ki_tdname: [::c_char; ::TDNAMLEN + 1],
+        /// Wchan message.
+        pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
+        /// Setlogin name.
+        pub ki_login: [::c_char; ::LOGNAMELEN + 1],
+        /// Lock name.
+        pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
+        /// Command name.
+        pub ki_comm: [::c_char; ::COMMLEN + 1],
+        /// Emulation name.
+        pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
+        /// Login class.
+        pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
+        /// More thread name.
+        pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1],
+        /// Spare string space.
+        pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
+        /// Spare room for growth.
+        pub ki_spareints: [::c_int; ::KI_NSPARE_INT],
+        /// Controlling tty dev.
+        pub ki_tdev: u64,
+        /// Which cpu we are on.
+        pub ki_oncpu: ::c_int,
+        /// Last cpu we were on.
+        pub ki_lastcpu: ::c_int,
+        /// PID of tracing process.
+        pub ki_tracer: ::c_int,
+        /// P2_* flags.
+        pub ki_flag2: ::c_int,
+        /// Default FIB number.
+        pub ki_fibnum: ::c_int,
+        /// Credential flags.
+        pub ki_cr_flags: ::u_int,
+        /// Process jail ID.
+        pub ki_jid: ::c_int,
+        /// Number of threads in total.
+        pub ki_numthreads: ::c_int,
+        /// Thread ID.
+        pub ki_tid: ::lwpid_t,
+        /// Process priority.
+        pub ki_pri: ::priority,
+        /// Process rusage statistics.
+        pub ki_rusage: ::rusage,
+        /// rusage of children processes.
+        pub ki_rusage_ch: ::rusage,
+        // This is normally "struct pcb".
+        /// Kernel virtual addr of pcb.
+        pub ki_pcb: *mut ::c_void,
+        /// Kernel virtual addr of stack.
+        pub ki_kstack: *mut ::c_void,
+        /// User convenience pointer.
+        pub ki_udata: *mut ::c_void,
+        // This is normally "struct thread".
+        pub ki_tdaddr: *mut ::c_void,
+        // This is normally "struct pwddesc".
+        /// Pointer to process paths info.
+        pub ki_pd: *mut ::c_void,
+        pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR],
+        pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG],
+        /// PS_* flags.
+        pub ki_sflag: ::c_long,
+        /// kthread flag.
+        pub ki_tdflags: ::c_long,
+    }
+}
+
+s_no_extra_traits! {
+    pub struct dirent {
+        pub d_fileno: ::ino_t,
+        pub d_off: ::off_t,
+        pub d_reclen: u16,
+        pub d_type: u8,
+        d_pad0: u8,
+        pub d_namlen: u16,
+        d_pad1: u16,
+        pub d_name: [::c_char; 256],
+    }
+
+    pub struct statfs {
+        pub f_version: u32,
+        pub f_type: u32,
+        pub f_flags: u64,
+        pub f_bsize: u64,
+        pub f_iosize: u64,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: i64,
+        pub f_files: u64,
+        pub f_ffree: i64,
+        pub f_syncwrites: u64,
+        pub f_asyncwrites: u64,
+        pub f_syncreads: u64,
+        pub f_asyncreads: u64,
+        f_spare: [u64; 10],
+        pub f_namemax: u32,
+        pub f_owner: ::uid_t,
+        pub f_fsid: ::fsid_t,
+        f_charspare: [::c_char; 80],
+        pub f_fstypename: [::c_char; 16],
+        pub f_mntfromname: [::c_char; 1024],
+        pub f_mntonname: [::c_char; 1024],
+    }
+
+    pub struct vnstat {
+        pub vn_fileid: u64,
+        pub vn_size: u64,
+        pub vn_dev: u64,
+        pub vn_fsid: u64,
+        pub vn_mntdir: *mut ::c_char,
+        pub vn_type: ::c_int,
+        pub vn_mode: u16,
+        pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for statfs {
+            fn eq(&self, other: &statfs) -> bool {
+                self.f_version == other.f_version
+                    && self.f_type == other.f_type
+                    && self.f_flags == other.f_flags
+                    && self.f_bsize == other.f_bsize
+                    && self.f_iosize == other.f_iosize
+                    && self.f_blocks == other.f_blocks
+                    && self.f_bfree == other.f_bfree
+                    && self.f_bavail == other.f_bavail
+                    && self.f_files == other.f_files
+                    && self.f_ffree == other.f_ffree
+                    && self.f_syncwrites == other.f_syncwrites
+                    && self.f_asyncwrites == other.f_asyncwrites
+                    && self.f_syncreads == other.f_syncreads
+                    && self.f_asyncreads == other.f_asyncreads
+                    && self.f_namemax == other.f_namemax
+                    && self.f_owner == other.f_owner
+                    && self.f_fsid == other.f_fsid
+                    && self.f_fstypename == other.f_fstypename
+                    && self
+                    .f_mntfromname
+                    .iter()
+                    .zip(other.f_mntfromname.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .f_mntonname
+                    .iter()
+                    .zip(other.f_mntonname.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for statfs {}
+        impl ::fmt::Debug for statfs {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("statfs")
+                    .field("f_bsize", &self.f_bsize)
+                    .field("f_iosize", &self.f_iosize)
+                    .field("f_blocks", &self.f_blocks)
+                    .field("f_bfree", &self.f_bfree)
+                    .field("f_bavail", &self.f_bavail)
+                    .field("f_files", &self.f_files)
+                    .field("f_ffree", &self.f_ffree)
+                    .field("f_syncwrites", &self.f_syncwrites)
+                    .field("f_asyncwrites", &self.f_asyncwrites)
+                    .field("f_syncreads", &self.f_syncreads)
+                    .field("f_asyncreads", &self.f_asyncreads)
+                    .field("f_namemax", &self.f_namemax)
+                    .field("f_owner", &self.f_owner)
+                    .field("f_fsid", &self.f_fsid)
+                    .field("f_fstypename", &self.f_fstypename)
+                    .field("f_mntfromname", &&self.f_mntfromname[..])
+                    .field("f_mntonname", &&self.f_mntonname[..])
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for statfs {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.f_version.hash(state);
+                self.f_type.hash(state);
+                self.f_flags.hash(state);
+                self.f_bsize.hash(state);
+                self.f_iosize.hash(state);
+                self.f_blocks.hash(state);
+                self.f_bfree.hash(state);
+                self.f_bavail.hash(state);
+                self.f_files.hash(state);
+                self.f_ffree.hash(state);
+                self.f_syncwrites.hash(state);
+                self.f_asyncwrites.hash(state);
+                self.f_syncreads.hash(state);
+                self.f_asyncreads.hash(state);
+                self.f_namemax.hash(state);
+                self.f_owner.hash(state);
+                self.f_fsid.hash(state);
+                self.f_charspare.hash(state);
+                self.f_fstypename.hash(state);
+                self.f_mntfromname.hash(state);
+                self.f_mntonname.hash(state);
+            }
+        }
+
+        impl PartialEq for dirent {
+            fn eq(&self, other: &dirent) -> bool {
+                self.d_fileno == other.d_fileno
+                    && self.d_off == other.d_off
+                    && self.d_reclen == other.d_reclen
+                    && self.d_type == other.d_type
+                    && self.d_namlen == other.d_namlen
+                    && self
+                    .d_name[..self.d_namlen as _]
+                    .iter()
+                    .zip(other.d_name.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for dirent {}
+        impl ::fmt::Debug for dirent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("dirent")
+                    .field("d_fileno", &self.d_fileno)
+                    .field("d_off", &self.d_off)
+                    .field("d_reclen", &self.d_reclen)
+                    .field("d_type", &self.d_type)
+                    .field("d_namlen", &self.d_namlen)
+                    .field("d_name", &&self.d_name[..self.d_namlen as _])
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for dirent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.d_fileno.hash(state);
+                self.d_off.hash(state);
+                self.d_reclen.hash(state);
+                self.d_type.hash(state);
+                self.d_namlen.hash(state);
+                self.d_name[..self.d_namlen as _].hash(state);
+            }
+        }
+
+        impl PartialEq for vnstat {
+            fn eq(&self, other: &vnstat) -> bool {
+                let self_vn_devname: &[::c_char] = &self.vn_devname;
+                let other_vn_devname: &[::c_char] = &other.vn_devname;
+
+                self.vn_fileid == other.vn_fileid &&
+                self.vn_size == other.vn_size &&
+                self.vn_dev == other.vn_dev &&
+                self.vn_fsid == other.vn_fsid &&
+                self.vn_mntdir == other.vn_mntdir &&
+                self.vn_type == other.vn_type &&
+                self.vn_mode == other.vn_mode &&
+                self_vn_devname == other_vn_devname
+            }
+        }
+        impl Eq for vnstat {}
+        impl ::fmt::Debug for vnstat {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let self_vn_devname: &[::c_char] = &self.vn_devname;
+
+                f.debug_struct("vnstat")
+                    .field("vn_fileid", &self.vn_fileid)
+                    .field("vn_size", &self.vn_size)
+                    .field("vn_dev", &self.vn_dev)
+                    .field("vn_fsid", &self.vn_fsid)
+                    .field("vn_mntdir", &self.vn_mntdir)
+                    .field("vn_type", &self.vn_type)
+                    .field("vn_mode", &self.vn_mode)
+                    .field("vn_devname", &self_vn_devname)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for vnstat {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let self_vn_devname: &[::c_char] = &self.vn_devname;
+
+                self.vn_fileid.hash(state);
+                self.vn_size.hash(state);
+                self.vn_dev.hash(state);
+                self.vn_fsid.hash(state);
+                self.vn_mntdir.hash(state);
+                self.vn_type.hash(state);
+                self.vn_mode.hash(state);
+                self_vn_devname.hash(state);
+            }
+        }
+    }
+}
+
+pub const RAND_MAX: ::c_int = 0x7fff_ffff;
+pub const ELAST: ::c_int = 97;
+
+pub const KF_TYPE_EVENTFD: ::c_int = 13;
+
+/// max length of devicename
+pub const SPECNAMELEN: ::c_int = 255;
+pub const KI_NSPARE_PTR: usize = 5;
+
+/// domainset policies
+pub const DOMAINSET_POLICY_INVALID: ::c_int = 0;
+pub const DOMAINSET_POLICY_ROUNDROBIN: ::c_int = 1;
+pub const DOMAINSET_POLICY_FIRSTTOUCH: ::c_int = 2;
+pub const DOMAINSET_POLICY_PREFER: ::c_int = 3;
+pub const DOMAINSET_POLICY_INTERLEAVE: ::c_int = 4;
+
+pub const MINCORE_SUPER: ::c_int = 0x60;
+
+safe_f! {
+    pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::dev_t;
+        let mut dev = 0;
+        dev |= ((major & 0xffffff00) as dev_t) << 32;
+        dev |= ((major & 0x000000ff) as dev_t) << 8;
+        dev |= ((minor & 0x0000ff00) as dev_t) << 24;
+        dev |= ((minor & 0xffff00ff) as dev_t) << 0;
+        dev
+    }
+}
+
+f! {
+    pub fn major(dev: ::dev_t) -> ::c_int {
+        (((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as ::c_int
+    }
+
+    pub fn minor(dev: ::dev_t) -> ::c_int {
+        (((dev >> 24) & 0xff00) | (dev & 0xffff00ff)) as ::c_int
+    }
+}
+
+extern "C" {
+    pub fn setgrent();
+    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn msgrcv(
+        msqid: ::c_int,
+        msgp: *mut ::c_void,
+        msgsz: ::size_t,
+        msgtyp: ::c_long,
+        msgflg: ::c_int,
+    ) -> ::ssize_t;
+
+    pub fn cpuset_getdomain(
+        level: ::cpulevel_t,
+        which: ::cpuwhich_t,
+        id: ::id_t,
+        setsize: ::size_t,
+        mask: *mut ::domainset_t,
+        policy: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn cpuset_setdomain(
+        level: ::cpulevel_t,
+        which: ::cpuwhich_t,
+        id: ::id_t,
+        setsize: ::size_t,
+        mask: *const ::domainset_t,
+        policy: ::c_int,
+    ) -> ::c_int;
+
+    pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+    pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
+}
+
+#[link(name = "kvm")]
+extern "C" {
+    pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t;
+}
+
+cfg_if! {
+    if #[cfg(any(target_arch = "x86_64",
+                 target_arch = "aarch64",
+                 target_arch = "riscv64"))] {
+        mod b64;
+        pub use self::b64::*;
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "x86_64")] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,12 @@
+pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN;
+pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1;
+pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2;
+pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1;
+pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000;
+pub const PROC_LA_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN + 2;
+pub const PROC_LA_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 3;
+pub const PROC_LA_CTL_LA48_ON_EXEC: ::c_int = 1;
+pub const PROC_LA_CTL_LA57_ON_EXEC: ::c_int = 2;
+pub const PROC_LA_CTL_DEFAULT_ON_EXEC: ::c_int = 3;
+pub const PROC_LA_STATUS_LA48: ::c_int = 0x01000000;
+pub const PROC_LA_STATUS_LA57: ::c_int = 0x02000000;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5751 @@
+pub type fflags_t = u32;
+pub type clock_t = i32;
+
+pub type vm_prot_t = u_char;
+pub type kvaddr_t = u64;
+pub type segsz_t = isize;
+pub type __fixpt_t = u32;
+pub type fixpt_t = __fixpt_t;
+pub type __lwpid_t = i32;
+pub type lwpid_t = __lwpid_t;
+pub type blksize_t = i32;
+pub type clockid_t = ::c_int;
+pub type sem_t = _sem;
+pub type timer_t = *mut __c_anonymous__timer;
+
+pub type fsblkcnt_t = u64;
+pub type fsfilcnt_t = u64;
+pub type idtype_t = ::c_uint;
+
+pub type msglen_t = ::c_ulong;
+pub type msgqnum_t = ::c_ulong;
+
+pub type cpulevel_t = ::c_int;
+pub type cpuwhich_t = ::c_int;
+
+pub type mqd_t = *mut ::c_void;
+pub type posix_spawnattr_t = *mut ::c_void;
+pub type posix_spawn_file_actions_t = *mut ::c_void;
+
+pub type pthread_spinlock_t = *mut __c_anonymous_pthread_spinlock;
+pub type pthread_barrierattr_t = *mut __c_anonymous_pthread_barrierattr;
+pub type pthread_barrier_t = *mut __c_anonymous_pthread_barrier;
+
+pub type uuid_t = ::uuid;
+pub type u_int = ::c_uint;
+pub type u_char = ::c_uchar;
+pub type u_long = ::c_ulong;
+pub type u_short = ::c_ushort;
+
+pub type caddr_t = *mut ::c_char;
+
+pub type fhandle_t = fhandle;
+
+pub type au_id_t = ::uid_t;
+pub type au_asid_t = ::pid_t;
+
+pub type cpusetid_t = ::c_int;
+
+pub type sctp_assoc_t = u32;
+
+pub type eventfd_t = u64;
+
+#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
+#[repr(u32)]
+pub enum devstat_support_flags {
+    DEVSTAT_ALL_SUPPORTED = 0x00,
+    DEVSTAT_NO_BLOCKSIZE = 0x01,
+    DEVSTAT_NO_ORDERED_TAGS = 0x02,
+    DEVSTAT_BS_UNAVAILABLE = 0x04,
+}
+impl ::Copy for devstat_support_flags {}
+impl ::Clone for devstat_support_flags {
+    fn clone(&self) -> devstat_support_flags {
+        *self
+    }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
+#[repr(u32)]
+pub enum devstat_trans_flags {
+    DEVSTAT_NO_DATA = 0x00,
+    DEVSTAT_READ = 0x01,
+    DEVSTAT_WRITE = 0x02,
+    DEVSTAT_FREE = 0x03,
+}
+
+impl ::Copy for devstat_trans_flags {}
+impl ::Clone for devstat_trans_flags {
+    fn clone(&self) -> devstat_trans_flags {
+        *self
+    }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
+#[repr(u32)]
+pub enum devstat_tag_type {
+    DEVSTAT_TAG_SIMPLE = 0x00,
+    DEVSTAT_TAG_HEAD = 0x01,
+    DEVSTAT_TAG_ORDERED = 0x02,
+    DEVSTAT_TAG_NONE = 0x03,
+}
+impl ::Copy for devstat_tag_type {}
+impl ::Clone for devstat_tag_type {
+    fn clone(&self) -> devstat_tag_type {
+        *self
+    }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
+#[repr(u32)]
+pub enum devstat_match_flags {
+    DEVSTAT_MATCH_NONE = 0x00,
+    DEVSTAT_MATCH_TYPE = 0x01,
+    DEVSTAT_MATCH_IF = 0x02,
+    DEVSTAT_MATCH_PASS = 0x04,
+}
+impl ::Copy for devstat_match_flags {}
+impl ::Clone for devstat_match_flags {
+    fn clone(&self) -> devstat_match_flags {
+        *self
+    }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
+#[repr(u32)]
+pub enum devstat_priority {
+    DEVSTAT_PRIORITY_MIN = 0x000,
+    DEVSTAT_PRIORITY_OTHER = 0x020,
+    DEVSTAT_PRIORITY_PASS = 0x030,
+    DEVSTAT_PRIORITY_FD = 0x040,
+    DEVSTAT_PRIORITY_WFD = 0x050,
+    DEVSTAT_PRIORITY_TAPE = 0x060,
+    DEVSTAT_PRIORITY_CD = 0x090,
+    DEVSTAT_PRIORITY_DISK = 0x110,
+    DEVSTAT_PRIORITY_ARRAY = 0x120,
+    DEVSTAT_PRIORITY_MAX = 0xfff,
+}
+impl ::Copy for devstat_priority {}
+impl ::Clone for devstat_priority {
+    fn clone(&self) -> devstat_priority {
+        *self
+    }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
+#[repr(u32)]
+pub enum devstat_type_flags {
+    DEVSTAT_TYPE_DIRECT = 0x000,
+    DEVSTAT_TYPE_SEQUENTIAL = 0x001,
+    DEVSTAT_TYPE_PRINTER = 0x002,
+    DEVSTAT_TYPE_PROCESSOR = 0x003,
+    DEVSTAT_TYPE_WORM = 0x004,
+    DEVSTAT_TYPE_CDROM = 0x005,
+    DEVSTAT_TYPE_SCANNER = 0x006,
+    DEVSTAT_TYPE_OPTICAL = 0x007,
+    DEVSTAT_TYPE_CHANGER = 0x008,
+    DEVSTAT_TYPE_COMM = 0x009,
+    DEVSTAT_TYPE_ASC0 = 0x00a,
+    DEVSTAT_TYPE_ASC1 = 0x00b,
+    DEVSTAT_TYPE_STORARRAY = 0x00c,
+    DEVSTAT_TYPE_ENCLOSURE = 0x00d,
+    DEVSTAT_TYPE_FLOPPY = 0x00e,
+    DEVSTAT_TYPE_MASK = 0x00f,
+    DEVSTAT_TYPE_IF_SCSI = 0x010,
+    DEVSTAT_TYPE_IF_IDE = 0x020,
+    DEVSTAT_TYPE_IF_OTHER = 0x030,
+    DEVSTAT_TYPE_IF_MASK = 0x0f0,
+    DEVSTAT_TYPE_PASS = 0x100,
+}
+impl ::Copy for devstat_type_flags {}
+impl ::Clone for devstat_type_flags {
+    fn clone(&self) -> devstat_type_flags {
+        *self
+    }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
+#[repr(u32)]
+pub enum devstat_metric {
+    DSM_NONE,
+    DSM_TOTAL_BYTES,
+    DSM_TOTAL_BYTES_READ,
+    DSM_TOTAL_BYTES_WRITE,
+    DSM_TOTAL_TRANSFERS,
+    DSM_TOTAL_TRANSFERS_READ,
+    DSM_TOTAL_TRANSFERS_WRITE,
+    DSM_TOTAL_TRANSFERS_OTHER,
+    DSM_TOTAL_BLOCKS,
+    DSM_TOTAL_BLOCKS_READ,
+    DSM_TOTAL_BLOCKS_WRITE,
+    DSM_KB_PER_TRANSFER,
+    DSM_KB_PER_TRANSFER_READ,
+    DSM_KB_PER_TRANSFER_WRITE,
+    DSM_TRANSFERS_PER_SECOND,
+    DSM_TRANSFERS_PER_SECOND_READ,
+    DSM_TRANSFERS_PER_SECOND_WRITE,
+    DSM_TRANSFERS_PER_SECOND_OTHER,
+    DSM_MB_PER_SECOND,
+    DSM_MB_PER_SECOND_READ,
+    DSM_MB_PER_SECOND_WRITE,
+    DSM_BLOCKS_PER_SECOND,
+    DSM_BLOCKS_PER_SECOND_READ,
+    DSM_BLOCKS_PER_SECOND_WRITE,
+    DSM_MS_PER_TRANSACTION,
+    DSM_MS_PER_TRANSACTION_READ,
+    DSM_MS_PER_TRANSACTION_WRITE,
+    DSM_SKIP,
+    DSM_TOTAL_BYTES_FREE,
+    DSM_TOTAL_TRANSFERS_FREE,
+    DSM_TOTAL_BLOCKS_FREE,
+    DSM_KB_PER_TRANSFER_FREE,
+    DSM_MB_PER_SECOND_FREE,
+    DSM_TRANSFERS_PER_SECOND_FREE,
+    DSM_BLOCKS_PER_SECOND_FREE,
+    DSM_MS_PER_TRANSACTION_OTHER,
+    DSM_MS_PER_TRANSACTION_FREE,
+    DSM_BUSY_PCT,
+    DSM_QUEUE_LENGTH,
+    DSM_TOTAL_DURATION,
+    DSM_TOTAL_DURATION_READ,
+    DSM_TOTAL_DURATION_WRITE,
+    DSM_TOTAL_DURATION_FREE,
+    DSM_TOTAL_DURATION_OTHER,
+    DSM_TOTAL_BUSY_TIME,
+    DSM_MAX,
+}
+impl ::Copy for devstat_metric {}
+impl ::Clone for devstat_metric {
+    fn clone(&self) -> devstat_metric {
+        *self
+    }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
+#[repr(u32)]
+pub enum devstat_select_mode {
+    DS_SELECT_ADD,
+    DS_SELECT_ONLY,
+    DS_SELECT_REMOVE,
+    DS_SELECT_ADDONLY,
+}
+impl ::Copy for devstat_select_mode {}
+impl ::Clone for devstat_select_mode {
+    fn clone(&self) -> devstat_select_mode {
+        *self
+    }
+}
+
+s! {
+    pub struct aiocb {
+        pub aio_fildes: ::c_int,
+        pub aio_offset: ::off_t,
+        pub aio_buf: *mut ::c_void,
+        pub aio_nbytes: ::size_t,
+        __unused1: [::c_int; 2],
+        __unused2: *mut ::c_void,
+        pub aio_lio_opcode: ::c_int,
+        pub aio_reqprio: ::c_int,
+        // unused 3 through 5 are the __aiocb_private structure
+        __unused3: ::c_long,
+        __unused4: ::c_long,
+        __unused5: *mut ::c_void,
+        pub aio_sigevent: sigevent
+    }
+
+    pub struct jail {
+        pub version: u32,
+        pub path: *mut ::c_char,
+        pub hostname: *mut ::c_char,
+        pub jailname: *mut ::c_char,
+        pub ip4s: ::c_uint,
+        pub ip6s: ::c_uint,
+        pub ip4: *mut ::in_addr,
+        pub ip6: *mut ::in6_addr,
+    }
+
+    pub struct statvfs {
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_bsize: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_fsid: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+    }
+
+    // internal structure has changed over time
+    pub struct _sem {
+        data: [u32; 4],
+    }
+    pub struct sembuf {
+        pub sem_num: ::c_ushort,
+        pub sem_op: ::c_short,
+        pub sem_flg: ::c_short,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        __unused1: *mut ::c_void,
+        __unused2: *mut ::c_void,
+        pub msg_cbytes: ::msglen_t,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::time_t,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_size: ::size_t,
+        pub ss_flags: ::c_int,
+    }
+
+    pub struct mmsghdr {
+        pub msg_hdr: ::msghdr,
+        pub msg_len: ::ssize_t,
+    }
+
+    pub struct sockcred {
+        pub sc_uid: ::uid_t,
+        pub sc_euid: ::uid_t,
+        pub sc_gid: ::gid_t,
+        pub sc_egid: ::gid_t,
+        pub sc_ngroups: ::c_int,
+        pub sc_groups: [::gid_t; 1],
+    }
+
+    pub struct ptrace_vm_entry {
+        pub pve_entry: ::c_int,
+        pub pve_timestamp: ::c_int,
+        pub pve_start: ::c_ulong,
+        pub pve_end: ::c_ulong,
+        pub pve_offset: ::c_ulong,
+        pub pve_prot: ::c_uint,
+        pub pve_pathlen: ::c_uint,
+        pub pve_fileid: ::c_long,
+        pub pve_fsid: u32,
+        pub pve_path: *mut ::c_char,
+    }
+
+    pub struct ptrace_lwpinfo {
+        pub pl_lwpid: lwpid_t,
+        pub pl_event: ::c_int,
+        pub pl_flags: ::c_int,
+        pub pl_sigmask: ::sigset_t,
+        pub pl_siglist: ::sigset_t,
+        pub pl_siginfo: ::siginfo_t,
+        pub pl_tdname: [::c_char; ::MAXCOMLEN as usize + 1],
+        pub pl_child_pid: ::pid_t,
+        pub pl_syscall_code: ::c_uint,
+        pub pl_syscall_narg: ::c_uint,
+    }
+
+    pub struct ptrace_sc_ret {
+        pub sr_retval: [::register_t; 2],
+        pub sr_error: ::c_int,
+    }
+
+    pub struct ptrace_coredump {
+        pub pc_fd: ::c_int,
+        pub pc_flags: u32,
+        pub pc_limit: ::off_t,
+    }
+
+    pub struct ptrace_sc_remote {
+        pub pscr_ret: ptrace_sc_ret,
+        pub pscr_syscall: ::c_uint,
+        pub pscr_nargs: ::c_uint,
+        pub pscr_args: *mut ::register_t,
+    }
+
+    pub struct cpuset_t {
+        #[cfg(all(any(freebsd15, freebsd14), target_pointer_width = "64"))]
+        __bits: [::c_long; 16],
+        #[cfg(all(any(freebsd15, freebsd14), target_pointer_width = "32"))]
+        __bits: [::c_long; 32],
+        #[cfg(all(not(any(freebsd15, freebsd14)), target_pointer_width = "64"))]
+        __bits: [::c_long; 4],
+        #[cfg(all(not(any(freebsd15, freebsd14)), target_pointer_width = "32"))]
+        __bits: [::c_long; 8],
+    }
+
+    pub struct cap_rights_t {
+        cr_rights: [u64; 2],
+    }
+
+    pub struct umutex {
+        m_owner: ::lwpid_t,
+        m_flags: u32,
+        m_ceilings: [u32; 2],
+        m_rb_link: ::uintptr_t,
+        #[cfg(target_pointer_width = "32")]
+        m_pad: u32,
+        m_spare: [u32; 2],
+
+    }
+
+    pub struct ucond {
+        c_has_waiters: u32,
+        c_flags: u32,
+        c_clockid: u32,
+        c_spare: [u32; 1],
+    }
+
+    pub struct uuid {
+        pub time_low: u32,
+        pub time_mid: u16,
+        pub time_hi_and_version: u16,
+        pub clock_seq_hi_and_reserved: u8,
+        pub clock_seq_low: u8,
+        pub node: [u8; _UUID_NODE_LEN],
+    }
+
+    pub struct __c_anonymous_pthread_spinlock {
+        s_clock: umutex,
+    }
+
+    pub struct __c_anonymous_pthread_barrierattr {
+        pshared: ::c_int,
+    }
+
+    pub struct __c_anonymous_pthread_barrier {
+        b_lock: umutex,
+        b_cv: ucond,
+        b_cycle: i64,
+        b_count: ::c_int,
+        b_waiters: ::c_int,
+        b_refcount: ::c_int,
+        b_destroying: ::c_int,
+    }
+
+    pub struct kinfo_vmentry {
+        pub kve_structsize: ::c_int,
+        pub kve_type: ::c_int,
+        pub kve_start: u64,
+        pub kve_end: u64,
+        pub kve_offset: u64,
+        pub kve_vn_fileid: u64,
+        #[cfg(not(freebsd11))]
+        pub kve_vn_fsid_freebsd11: u32,
+        #[cfg(freebsd11)]
+        pub kve_vn_fsid: u32,
+        pub kve_flags: ::c_int,
+        pub kve_resident: ::c_int,
+        pub kve_private_resident: ::c_int,
+        pub kve_protection: ::c_int,
+        pub kve_ref_count: ::c_int,
+        pub kve_shadow_count: ::c_int,
+        pub kve_vn_type: ::c_int,
+        pub kve_vn_size: u64,
+        #[cfg(not(freebsd11))]
+        pub kve_vn_rdev_freebsd11: u32,
+        #[cfg(freebsd11)]
+        pub kve_vn_rdev: u32,
+        pub kve_vn_mode: u16,
+        pub kve_status: u16,
+        #[cfg(not(freebsd11))]
+        pub kve_vn_fsid: u64,
+        #[cfg(not(freebsd11))]
+        pub kve_vn_rdev: u64,
+        #[cfg(not(freebsd11))]
+        _kve_is_spare: [::c_int; 8],
+        #[cfg(freebsd11)]
+        _kve_is_spare: [::c_int; 12],
+        pub kve_path: [[::c_char; 32]; 32],
+    }
+
+    pub struct __c_anonymous_filestat {
+        pub stqe_next: *mut filestat,
+    }
+
+    pub struct filestat {
+        pub fs_type: ::c_int,
+        pub fs_flags: ::c_int,
+        pub fs_fflags: ::c_int,
+        pub fs_uflags: ::c_int,
+        pub fs_fd: ::c_int,
+        pub fs_ref_count: ::c_int,
+        pub fs_offset: ::off_t,
+        pub fs_typedep: *mut ::c_void,
+        pub fs_path: *mut ::c_char,
+        pub next: __c_anonymous_filestat,
+        pub fs_cap_rights: cap_rights_t,
+    }
+
+    pub struct filestat_list {
+        pub stqh_first: *mut filestat,
+        pub stqh_last: *mut *mut filestat,
+    }
+
+    pub struct procstat {
+        pub tpe: ::c_int,
+        pub kd: ::uintptr_t,
+        pub vmentries: *mut ::c_void,
+        pub files: *mut ::c_void,
+        pub argv: *mut ::c_void,
+        pub envv: *mut ::c_void,
+        pub core: ::uintptr_t,
+    }
+
+    pub struct itimerspec {
+        pub it_interval: ::timespec,
+        pub it_value: ::timespec,
+    }
+
+    pub struct __c_anonymous__timer {
+        _priv: [::c_int; 3],
+    }
+
+    /// Used to hold a copy of the command line, if it had a sane length.
+    pub struct pargs {
+        /// Reference count.
+        pub ar_ref: u_int,
+        /// Length.
+        pub ar_length: u_int,
+        /// Arguments.
+        pub ar_args: [::c_uchar; 1],
+    }
+
+    pub struct priority {
+        /// Scheduling class.
+        pub pri_class: u_char,
+        /// Normal priority level.
+        pub pri_level: u_char,
+        /// Priority before propagation.
+        pub pri_native: u_char,
+        /// User priority based on p_cpu and p_nice.
+        pub pri_user: u_char,
+    }
+
+    pub struct kvm_swap {
+        pub ksw_devname: [::c_char; 32],
+        pub ksw_used: u_int,
+        pub ksw_total: u_int,
+        pub ksw_flags: ::c_int,
+        pub ksw_reserved1: u_int,
+        pub ksw_reserved2: u_int,
+    }
+
+    pub struct nlist {
+        /// symbol name (in memory)
+        pub n_name: *const ::c_char,
+        /// type defines
+        pub n_type: ::c_uchar,
+        /// "type" and binding information
+        pub n_other: ::c_char,
+        /// used by stab entries
+        pub n_desc: ::c_short,
+        pub n_value: ::c_ulong,
+    }
+
+    pub struct kvm_nlist {
+        pub n_name: *const ::c_char,
+        pub n_type: ::c_uchar,
+        pub n_value: ::kvaddr_t,
+    }
+
+    pub struct __c_anonymous_sem {
+        _priv: ::uintptr_t,
+    }
+
+    pub struct semid_ds {
+        pub sem_perm: ::ipc_perm,
+        pub __sem_base: *mut __c_anonymous_sem,
+        pub sem_nsems: ::c_ushort,
+        pub sem_otime: ::time_t,
+        pub sem_ctime: ::time_t,
+    }
+
+    pub struct vmtotal {
+        pub t_vm: u64,
+        pub t_avm: u64,
+        pub t_rm: u64,
+        pub t_arm: u64,
+        pub t_vmshr: u64,
+        pub t_avmshr: u64,
+        pub t_rmshr: u64,
+        pub t_armshr: u64,
+        pub t_free: u64,
+        pub t_rq: i16,
+        pub t_dw: i16,
+        pub t_pw: i16,
+        pub t_sl: i16,
+        pub t_sw: i16,
+        pub t_pad: [u16; 3],
+    }
+
+    pub struct sockstat {
+        pub inp_ppcb: u64,
+        pub so_addr: u64,
+        pub so_pcb: u64,
+        pub unp_conn: u64,
+        pub dom_family: ::c_int,
+        pub proto: ::c_int,
+        pub so_rcv_sb_state: ::c_int,
+        pub so_snd_sb_state: ::c_int,
+        /// Socket address.
+        pub sa_local: ::sockaddr_storage,
+        /// Peer address.
+        pub sa_peer: ::sockaddr_storage,
+        pub type_: ::c_int,
+        pub dname: [::c_char; 32],
+        #[cfg(any(freebsd12, freebsd13, freebsd14, freebsd15))]
+        pub sendq: ::c_uint,
+        #[cfg(any(freebsd12, freebsd13, freebsd14, freebsd15))]
+        pub recvq: ::c_uint,
+    }
+
+    pub struct shmstat {
+        pub size: u64,
+        pub mode: u16,
+    }
+
+    pub struct spacectl_range {
+        pub r_offset: ::off_t,
+        pub r_len: ::off_t
+    }
+
+    pub struct rusage_ext {
+        pub rux_runtime: u64,
+        pub rux_uticks: u64,
+        pub rux_sticks: u64,
+        pub rux_iticks: u64,
+        pub rux_uu: u64,
+        pub rux_su: u64,
+        pub rux_tu: u64,
+    }
+
+    pub struct if_clonereq {
+        pub ifcr_total: ::c_int,
+        pub ifcr_count: ::c_int,
+        pub ifcr_buffer: *mut ::c_char,
+    }
+
+    pub struct if_msghdr {
+        /// to skip over non-understood messages
+        pub ifm_msglen: ::c_ushort,
+        /// future binary compatibility
+        pub ifm_version: ::c_uchar,
+        /// message type
+        pub ifm_type: ::c_uchar,
+        /// like rtm_addrs
+        pub ifm_addrs: ::c_int,
+        /// value of if_flags
+        pub ifm_flags: ::c_int,
+        /// index for associated ifp
+        pub ifm_index: ::c_ushort,
+        pub _ifm_spare1: ::c_ushort,
+        /// statistics and other data about if
+        pub ifm_data: if_data,
+    }
+
+    pub struct if_msghdrl {
+        /// to skip over non-understood messages
+        pub ifm_msglen: ::c_ushort,
+        /// future binary compatibility
+        pub ifm_version: ::c_uchar,
+        /// message type
+        pub ifm_type: ::c_uchar,
+        /// like rtm_addrs
+        pub ifm_addrs: ::c_int,
+        /// value of if_flags
+        pub ifm_flags: ::c_int,
+        /// index for associated ifp
+        pub ifm_index: ::c_ushort,
+        /// spare space to grow if_index, see if_var.h
+        pub _ifm_spare1: ::c_ushort,
+        /// length of if_msghdrl incl. if_data
+        pub ifm_len: ::c_ushort,
+        /// offset of if_data from beginning
+        pub ifm_data_off: ::c_ushort,
+        pub _ifm_spare2: ::c_int,
+        /// statistics and other data about if
+        pub ifm_data: if_data,
+    }
+
+    pub struct ifa_msghdr {
+        /// to skip over non-understood messages
+        pub ifam_msglen: ::c_ushort,
+        /// future binary compatibility
+        pub ifam_version: ::c_uchar,
+        /// message type
+        pub ifam_type: ::c_uchar,
+        /// like rtm_addrs
+        pub ifam_addrs: ::c_int,
+        /// value of ifa_flags
+        pub ifam_flags: ::c_int,
+        /// index for associated ifp
+        pub ifam_index: ::c_ushort,
+        pub _ifam_spare1: ::c_ushort,
+        /// value of ifa_ifp->if_metric
+        pub ifam_metric: ::c_int,
+    }
+
+    pub struct ifa_msghdrl {
+        /// to skip over non-understood messages
+        pub ifam_msglen: ::c_ushort,
+        /// future binary compatibility
+        pub ifam_version: ::c_uchar,
+        /// message type
+        pub ifam_type: ::c_uchar,
+        /// like rtm_addrs
+        pub ifam_addrs: ::c_int,
+        /// value of ifa_flags
+        pub ifam_flags: ::c_int,
+        /// index for associated ifp
+        pub ifam_index: ::c_ushort,
+        /// spare space to grow if_index, see if_var.h
+        pub _ifam_spare1: ::c_ushort,
+        /// length of ifa_msghdrl incl. if_data
+        pub ifam_len: ::c_ushort,
+        /// offset of if_data from beginning
+        pub ifam_data_off: ::c_ushort,
+        /// value of ifa_ifp->if_metric
+        pub ifam_metric: ::c_int,
+        /// statistics and other data about if or address
+        pub ifam_data: if_data,
+    }
+
+    pub struct ifma_msghdr {
+        /// to skip over non-understood messages
+        pub ifmam_msglen: ::c_ushort,
+        /// future binary compatibility
+        pub ifmam_version: ::c_uchar,
+        /// message type
+        pub ifmam_type: ::c_uchar,
+        /// like rtm_addrs
+        pub ifmam_addrs: ::c_int,
+        /// value of ifa_flags
+        pub ifmam_flags: ::c_int,
+        /// index for associated ifp
+        pub ifmam_index: ::c_ushort,
+        pub _ifmam_spare1: ::c_ushort,
+    }
+
+    pub struct if_announcemsghdr {
+        /// to skip over non-understood messages
+        pub ifan_msglen: ::c_ushort,
+        /// future binary compatibility
+        pub ifan_version: ::c_uchar,
+        /// message type
+        pub ifan_type: ::c_uchar,
+        /// index for associated ifp
+        pub ifan_index: ::c_ushort,
+        /// if name, e.g. "en0"
+        pub ifan_name: [::c_char; ::IFNAMSIZ as usize],
+        /// what type of announcement
+        pub ifan_what: ::c_ushort,
+    }
+
+    pub struct ifreq_buffer {
+        pub length: ::size_t,
+        pub buffer: *mut ::c_void,
+    }
+
+    pub struct ifaliasreq {
+        /// if name, e.g. "en0"
+        pub ifra_name: [::c_char; ::IFNAMSIZ as usize],
+        pub ifra_addr: ::sockaddr,
+        pub ifra_broadaddr: ::sockaddr,
+        pub ifra_mask: ::sockaddr,
+        pub ifra_vhid: ::c_int,
+    }
+
+    /// 9.x compat
+    pub struct oifaliasreq {
+        /// if name, e.g. "en0"
+        pub ifra_name: [::c_char; ::IFNAMSIZ as usize],
+        pub ifra_addr: ::sockaddr,
+        pub ifra_broadaddr: ::sockaddr,
+        pub ifra_mask: ::sockaddr,
+    }
+
+    pub struct ifmediareq {
+        /// if name, e.g. "en0"
+        pub ifm_name: [::c_char; ::IFNAMSIZ as usize],
+        /// current media options
+        pub ifm_current: ::c_int,
+        /// don't care mask
+        pub ifm_mask: ::c_int,
+        /// media status
+        pub ifm_status: ::c_int,
+        /// active options
+        pub ifm_active: ::c_int,
+        /// # entries in ifm_ulist array
+        pub ifm_count: ::c_int,
+        /// media words
+        pub ifm_ulist: *mut ::c_int,
+    }
+
+    pub struct ifdrv {
+        /// if name, e.g. "en0"
+        pub ifd_name: [::c_char; ::IFNAMSIZ as usize],
+        pub ifd_cmd: ::c_ulong,
+        pub ifd_len: ::size_t,
+        pub ifd_data: *mut ::c_void,
+    }
+
+    pub struct ifi2creq {
+        /// i2c address (0xA0, 0xA2)
+        pub dev_addr: u8,
+        /// read offset
+        pub offset: u8,
+        /// read length
+        pub len: u8,
+        pub spare0: u8,
+        pub spare1: u32,
+        /// read buffer
+        pub data: [u8; 8],
+    }
+
+    pub struct ifrsshash {
+        /// if name, e.g. "en0"
+        pub ifrh_name: [::c_char; ::IFNAMSIZ as usize],
+        /// RSS_FUNC_
+        pub ifrh_func: u8,
+        pub ifrh_spare0: u8,
+        pub ifrh_spare1: u16,
+        /// RSS_TYPE_
+        pub ifrh_types: u32,
+    }
+
+    pub struct ifmibdata {
+        /// name of interface
+        pub ifmd_name: [::c_char; ::IFNAMSIZ as usize],
+        /// number of promiscuous listeners
+        pub ifmd_pcount: ::c_int,
+        /// interface flags
+        pub ifmd_flags: ::c_int,
+        /// instantaneous length of send queue
+        pub ifmd_snd_len: ::c_int,
+        /// maximum length of send queue
+        pub ifmd_snd_maxlen: ::c_int,
+        /// number of drops in send queue
+        pub ifmd_snd_drops: ::c_int,
+        /// for future expansion
+        pub ifmd_filler: [::c_int; 4],
+        /// generic information and statistics
+        pub ifmd_data: if_data,
+    }
+
+    pub struct ifmib_iso_8802_3 {
+        pub dot3StatsAlignmentErrors: u32,
+        pub dot3StatsFCSErrors: u32,
+        pub dot3StatsSingleCollisionFrames: u32,
+        pub dot3StatsMultipleCollisionFrames: u32,
+        pub dot3StatsSQETestErrors: u32,
+        pub dot3StatsDeferredTransmissions: u32,
+        pub dot3StatsLateCollisions: u32,
+        pub dot3StatsExcessiveCollisions: u32,
+        pub dot3StatsInternalMacTransmitErrors: u32,
+        pub dot3StatsCarrierSenseErrors: u32,
+        pub dot3StatsFrameTooLongs: u32,
+        pub dot3StatsInternalMacReceiveErrors: u32,
+        pub dot3StatsEtherChipSet: u32,
+        pub dot3StatsMissedFrames: u32,
+        pub dot3StatsCollFrequencies: [u32; 16],
+        pub dot3Compliance: u32,
+    }
+
+    pub struct __c_anonymous_ph {
+        pub ph1: u64,
+        pub ph2: u64,
+    }
+
+    pub struct fid {
+        pub fid_len: ::c_ushort,
+        pub fid_data0: ::c_ushort,
+        pub fid_data: [::c_char; ::MAXFIDSZ as usize],
+    }
+
+    pub struct fhandle {
+        pub fh_fsid: ::fsid_t,
+        pub fh_fid: fid,
+    }
+
+    pub struct bintime {
+        pub sec: ::time_t,
+        pub frac: u64,
+    }
+
+    pub struct clockinfo {
+        /// clock frequency
+        pub hz: ::c_int,
+        /// micro-seconds per hz tick
+        pub tick: ::c_int,
+        pub spare: ::c_int,
+        /// statistics clock frequency
+        pub stathz: ::c_int,
+        /// profiling clock frequency
+        pub profhz: ::c_int,
+    }
+
+    pub struct __c_anonymous_stailq_entry_devstat {
+        pub stqe_next: *mut devstat,
+    }
+
+    pub struct devstat {
+        /// Update sequence
+        pub sequence0: ::u_int,
+        /// Allocated entry
+        pub allocated: ::c_int,
+        /// started ops
+        pub start_count: ::u_int,
+        /// completed ops
+        pub end_count: ::u_int,
+        /// busy time unaccounted for since this time
+        pub busy_from: bintime,
+        pub dev_links: __c_anonymous_stailq_entry_devstat,
+        /// Devstat device number.
+        pub device_number: u32,
+        pub device_name: [::c_char; DEVSTAT_NAME_LEN as usize],
+        pub unit_number: ::c_int,
+        pub bytes: [u64; DEVSTAT_N_TRANS_FLAGS as usize],
+        pub operations: [u64; DEVSTAT_N_TRANS_FLAGS as usize],
+        pub duration: [bintime; DEVSTAT_N_TRANS_FLAGS as usize],
+        pub busy_time: bintime,
+        /// Time the device was created.
+        pub creation_time: bintime,
+        /// Block size, bytes
+        pub block_size: u32,
+        /// The number of simple, ordered, and head of queue tags sent.
+        pub tag_types: [u64; 3],
+        /// Which statistics are supported by a given device.
+        pub flags: devstat_support_flags,
+        /// Device type
+        pub device_type: devstat_type_flags,
+        /// Controls list pos.
+        pub priority: devstat_priority,
+        /// Identification for GEOM nodes
+        pub id: *const ::c_void,
+        /// Update sequence
+        pub sequence1: ::u_int,
+    }
+
+    pub struct devstat_match {
+        pub match_fields: devstat_match_flags,
+        pub device_type: devstat_type_flags,
+        pub num_match_categories: ::c_int,
+    }
+
+    pub struct devstat_match_table {
+        pub match_str: *const ::c_char,
+        pub type_: devstat_type_flags,
+        pub match_field: devstat_match_flags,
+    }
+
+    pub struct device_selection {
+        pub device_number: u32,
+        pub device_name: [::c_char; DEVSTAT_NAME_LEN as usize],
+        pub unit_number: ::c_int,
+        pub selected: ::c_int,
+        pub bytes: u64,
+        pub position: ::c_int,
+    }
+
+    pub struct devinfo {
+        pub devices: *mut devstat,
+        pub mem_ptr: *mut u8,
+        pub generation: ::c_long,
+        pub numdevs: ::c_int,
+    }
+
+    pub struct sockcred2 {
+        pub sc_version: ::c_int,
+        pub sc_pid: ::pid_t,
+        pub sc_uid: ::uid_t,
+        pub sc_euid: ::uid_t,
+        pub sc_gid: ::gid_t,
+        pub sc_egid: ::gid_t,
+        pub sc_ngroups: ::c_int,
+        pub sc_groups: [::gid_t; 1],
+    }
+
+    pub struct ifconf {
+        pub ifc_len: ::c_int,
+        #[cfg(libc_union)]
+        pub ifc_ifcu: __c_anonymous_ifc_ifcu,
+        #[cfg(not(libc_union))]
+        pub ifc_ifcu: *mut ifreq,
+    }
+
+    pub struct au_mask_t {
+        pub am_success: ::c_uint,
+        pub am_failure: ::c_uint,
+    }
+
+    pub struct au_tid_t {
+        pub port: u32,
+        pub machine: u32,
+    }
+
+    pub struct auditinfo_t {
+        pub ai_auid: ::au_id_t,
+        pub ai_mask: ::au_mask_t,
+        pub ai_termid: au_tid_t,
+        pub ai_asid: ::au_asid_t,
+    }
+
+    pub struct tcp_fastopen {
+        pub enable: ::c_int,
+        pub psk: [u8; ::TCP_FASTOPEN_PSK_LEN as usize],
+    }
+
+    pub struct tcp_function_set {
+        pub function_set_name: [::c_char; ::TCP_FUNCTION_NAME_LEN_MAX as usize],
+        pub pcbcnt: u32,
+    }
+
+    // Note: this structure will change in a backwards-incompatible way in
+    // FreeBSD 15.
+    pub struct tcp_info {
+        pub tcpi_state: u8,
+        pub __tcpi_ca_state: u8,
+        pub __tcpi_retransmits: u8,
+        pub __tcpi_probes: u8,
+        pub __tcpi_backoff: u8,
+        pub tcpi_options: u8,
+        pub tcp_snd_wscale: u8,
+        pub tcp_rcv_wscale: u8,
+        pub tcpi_rto: u32,
+        pub __tcpi_ato: u32,
+        pub tcpi_snd_mss: u32,
+        pub tcpi_rcv_mss: u32,
+        pub __tcpi_unacked: u32,
+        pub __tcpi_sacked: u32,
+        pub __tcpi_lost: u32,
+        pub __tcpi_retrans: u32,
+        pub __tcpi_fackets: u32,
+        pub __tcpi_last_data_sent: u32,
+        pub __tcpi_last_ack_sent: u32,
+        pub tcpi_last_data_recv: u32,
+        pub __tcpi_last_ack_recv: u32,
+        pub __tcpi_pmtu: u32,
+        pub __tcpi_rcv_ssthresh: u32,
+        pub tcpi_rtt: u32,
+        pub tcpi_rttvar: u32,
+        pub tcpi_snd_ssthresh: u32,
+        pub tcpi_snd_cwnd: u32,
+        pub __tcpi_advmss: u32,
+        pub __tcpi_reordering: u32,
+        pub __tcpi_rcv_rtt: u32,
+        pub tcpi_rcv_space: u32,
+        pub tcpi_snd_wnd: u32,
+        pub tcpi_snd_bwnd: u32,
+        pub tcpi_snd_nxt: u32,
+        pub tcpi_rcv_nxt: u32,
+        pub tcpi_toe_tid: u32,
+        pub tcpi_snd_rexmitpack: u32,
+        pub tcpi_rcv_ooopack: u32,
+        pub tcpi_snd_zerowin: u32,
+        #[cfg(any(freebsd15, freebsd14))]
+        pub tcpi_delivered_ce: u32,
+        #[cfg(any(freebsd15, freebsd14))]
+        pub tcpi_received_ce: u32,
+        #[cfg(any(freebsd15, freebsd14))]
+        pub __tcpi_delivered_e1_bytes: u32,
+        #[cfg(any(freebsd15, freebsd14))]
+        pub __tcpi_delivered_e0_bytes: u32,
+        #[cfg(any(freebsd15, freebsd14))]
+        pub __tcpi_delivered_ce_bytes: u32,
+        #[cfg(any(freebsd15, freebsd14))]
+        pub __tcpi_received_e1_bytes: u32,
+        #[cfg(any(freebsd15, freebsd14))]
+        pub __tcpi_received_e0_bytes: u32,
+        #[cfg(any(freebsd15, freebsd14))]
+        pub __tcpi_received_ce_bytes: u32,
+        #[cfg(any(freebsd15, freebsd14))]
+        pub tcpi_total_tlp: u32,
+        #[cfg(any(freebsd15, freebsd14))]
+        pub tcpi_total_tlp_bytes: u64,
+        #[cfg(any(freebsd15, freebsd14))]
+        pub tcpi_snd_una: u32,
+        #[cfg(any(freebsd15, freebsd14))]
+        pub tcpi_snd_max: u32,
+        #[cfg(any(freebsd15, freebsd14))]
+        pub tcpi_rcv_numsacks: u32,
+        #[cfg(any(freebsd15, freebsd14))]
+        pub tcpi_rcv_adv: u32,
+        #[cfg(any(freebsd15, freebsd14))]
+        pub tcpi_dupacks: u32,
+        #[cfg(freebsd14)]
+        pub __tcpi_pad: [u32; 10],
+        #[cfg(freebsd15)]
+        pub __tcpi_pad: [u32; 14],
+        #[cfg(not(any(freebsd15, freebsd14)))]
+        pub __tcpi_pad: [u32; 26],
+    }
+
+    pub struct _umtx_time {
+        pub _timeout: ::timespec,
+        pub _flags: u32,
+        pub _clockid: u32,
+    }
+
+    pub struct shm_largepage_conf {
+        pub psind: ::c_int,
+        pub alloc_policy: ::c_int,
+        __pad: [::c_int; 10],
+    }
+
+    pub struct memory_type {
+        __priva: [::uintptr_t; 32],
+        __privb: [::uintptr_t; 26],
+    }
+
+    pub struct memory_type_list {
+        __priv: [::uintptr_t; 2],
+    }
+
+    pub struct pidfh {
+        __priva: [[::uintptr_t; 32]; 8],
+        __privb: [::uintptr_t; 2],
+    }
+
+    pub struct sctp_event {
+        pub se_assoc_id: ::sctp_assoc_t,
+        pub se_type: u16,
+        pub se_on: u8,
+    }
+
+    pub struct sctp_event_subscribe {
+        pub sctp_data_io_event: u8,
+        pub sctp_association_event: u8,
+        pub sctp_address_event: u8,
+        pub sctp_send_failure_event: u8,
+        pub sctp_peer_error_event: u8,
+        pub sctp_shutdown_event: u8,
+        pub sctp_partial_delivery_event: u8,
+        pub sctp_adaptation_layer_event: u8,
+        pub sctp_authentication_event: u8,
+        pub sctp_sender_dry_event: u8,
+        pub sctp_stream_reset_event: u8,
+    }
+
+    pub struct sctp_initmsg {
+        pub sinit_num_ostreams: u16,
+        pub sinit_max_instreams: u16,
+        pub sinit_max_attempts: u16,
+        pub sinit_max_init_timeo: u16,
+    }
+
+    pub struct sctp_sndrcvinfo {
+        pub sinfo_stream: u16,
+        pub sinfo_ssn: u16,
+        pub sinfo_flags: u16,
+        pub sinfo_ppid: u32,
+        pub sinfo_context: u32,
+        pub sinfo_timetolive: u32,
+        pub sinfo_tsn: u32,
+        pub sinfo_cumtsn: u32,
+        pub sinfo_assoc_id: ::sctp_assoc_t,
+        pub sinfo_keynumber: u16,
+        pub sinfo_keynumber_valid: u16,
+        pub __reserve_pad: [[u8; 23]; 4],
+    }
+
+    pub struct sctp_extrcvinfo {
+        pub sinfo_stream: u16,
+        pub sinfo_ssn: u16,
+        pub sinfo_flags: u16,
+        pub sinfo_ppid: u32,
+        pub sinfo_context: u32,
+        pub sinfo_timetolive: u32,
+        pub sinfo_tsn: u32,
+        pub sinfo_cumtsn: u32,
+        pub sinfo_assoc_id: ::sctp_assoc_t,
+        pub serinfo_next_flags: u16,
+        pub serinfo_next_stream: u16,
+        pub serinfo_next_aid: u32,
+        pub serinfo_next_length: u32,
+        pub serinfo_next_ppid: u32,
+        pub sinfo_keynumber: u16,
+        pub sinfo_keynumber_valid: u16,
+        pub __reserve_pad: [[u8; 19]; 4],
+    }
+
+    pub struct sctp_sndinfo {
+        pub snd_sid: u16,
+        pub snd_flags: u16,
+        pub snd_ppid: u32,
+        pub snd_context: u32,
+        pub snd_assoc_id: ::sctp_assoc_t,
+    }
+
+    pub struct sctp_prinfo {
+        pub pr_policy: u16,
+        pub pr_value: u32,
+    }
+
+    pub struct sctp_default_prinfo {
+        pub pr_policy: u16,
+        pub pr_value: u32,
+        pub pr_assoc_id: ::sctp_assoc_t,
+    }
+
+    pub struct sctp_authinfo {
+        pub auth_keynumber: u16,
+    }
+
+    pub struct sctp_rcvinfo {
+        pub rcv_sid: u16,
+        pub rcv_ssn: u16,
+        pub rcv_flags: u16,
+        pub rcv_ppid: u32,
+        pub rcv_tsn: u32,
+        pub rcv_cumtsn: u32,
+        pub rcv_context: u32,
+        pub rcv_assoc_id: ::sctp_assoc_t,
+    }
+
+    pub struct sctp_nxtinfo {
+        pub nxt_sid: u16,
+        pub nxt_flags: u16,
+        pub nxt_ppid: u32,
+        pub nxt_length: u32,
+        pub nxt_assoc_id: ::sctp_assoc_t,
+    }
+
+    pub struct sctp_recvv_rn {
+        pub recvv_rcvinfo: sctp_rcvinfo,
+        pub recvv_nxtinfo: sctp_nxtinfo,
+    }
+
+    pub struct sctp_sendv_spa {
+        pub sendv_flags: u32,
+        pub sendv_sndinfo: sctp_sndinfo,
+        pub sendv_prinfo: sctp_prinfo,
+        pub sendv_authinfo: sctp_authinfo,
+    }
+
+    pub struct sctp_snd_all_completes {
+        pub sall_stream: u16,
+        pub sall_flags: u16,
+        pub sall_ppid: u32,
+        pub sall_context: u32,
+        pub sall_num_sent: u32,
+        pub sall_num_failed: u32,
+    }
+
+    pub struct sctp_pcbinfo {
+        pub ep_count: u32,
+        pub asoc_count: u32,
+        pub laddr_count: u32,
+        pub raddr_count: u32,
+        pub chk_count: u32,
+        pub readq_count: u32,
+        pub free_chunks: u32,
+        pub stream_oque: u32,
+    }
+
+    pub struct sctp_sockstat {
+        pub ss_assoc_id: ::sctp_assoc_t,
+        pub ss_total_sndbuf: u32,
+        pub ss_total_recv_buf: u32,
+    }
+
+    pub struct sctp_assoc_change {
+        pub sac_type: u16,
+        pub sac_flags: u16,
+        pub sac_length: u32,
+        pub sac_state: u16,
+        pub sac_error: u16,
+        pub sac_outbound_streams: u16,
+        pub sac_inbound_streams: u16,
+        pub sac_assoc_id: ::sctp_assoc_t,
+        pub sac_info: [u8; 0],
+    }
+
+    pub struct sctp_paddr_change {
+        pub spc_type: u16,
+        pub spc_flags: u16,
+        pub spc_length: u32,
+        pub spc_aaddr: ::sockaddr_storage,
+        pub spc_state: u32,
+        pub spc_error: u32,
+        pub spc_assoc_id: ::sctp_assoc_t,
+    }
+
+    pub struct sctp_remote_error {
+        pub sre_type: u16,
+        pub sre_flags: u16,
+        pub sre_length: u32,
+        pub sre_error: u16,
+        pub sre_assoc_id: ::sctp_assoc_t,
+        pub sre_data: [u8; 0],
+    }
+
+    pub struct sctp_send_failed_event {
+        pub ssfe_type: u16,
+        pub ssfe_flags: u16,
+        pub ssfe_length: u32,
+        pub ssfe_error: u32,
+        pub ssfe_info: sctp_sndinfo,
+        pub ssfe_assoc_id: ::sctp_assoc_t,
+        pub ssfe_data: [u8; 0],
+    }
+
+    pub struct sctp_shutdown_event {
+        pub sse_type: u16,
+        pub sse_flags: u16,
+        pub sse_length: u32,
+        pub sse_assoc_id: ::sctp_assoc_t,
+    }
+
+    pub struct sctp_adaptation_event {
+        pub sai_type: u16,
+        pub sai_flags: u16,
+        pub sai_length: u32,
+        pub sai_adaptation_ind: u32,
+        pub sai_assoc_id: ::sctp_assoc_t,
+    }
+
+    pub struct sctp_setadaptation {
+        pub ssb_adaptation_ind: u32,
+    }
+
+    pub struct sctp_pdapi_event {
+        pub pdapi_type: u16,
+        pub pdapi_flags: u16,
+        pub pdapi_length: u32,
+        pub pdapi_indication: u32,
+        pub pdapi_stream: u16,
+        pub pdapi_seq: u16,
+        pub pdapi_assoc_id: ::sctp_assoc_t,
+    }
+
+    pub struct sctp_sender_dry_event {
+        pub sender_dry_type: u16,
+        pub sender_dry_flags: u16,
+        pub sender_dry_length: u32,
+        pub sender_dry_assoc_id: ::sctp_assoc_t,
+    }
+
+    pub struct sctp_stream_reset_event {
+        pub strreset_type: u16,
+        pub strreset_flags: u16,
+        pub strreset_length: u32,
+        pub strreset_assoc_id: ::sctp_assoc_t,
+        pub strreset_stream_list: [u16; 0],
+    }
+
+    pub struct sctp_stream_change_event {
+        pub strchange_type: u16,
+        pub strchange_flags: u16,
+        pub strchange_length: u32,
+        pub strchange_assoc_id: ::sctp_assoc_t,
+        pub strchange_instrms: u16,
+        pub strchange_outstrms: u16,
+    }
+}
+
+s_no_extra_traits! {
+    pub struct utmpx {
+        pub ut_type: ::c_short,
+        pub ut_tv: ::timeval,
+        pub ut_id: [::c_char; 8],
+        pub ut_pid: ::pid_t,
+        pub ut_user: [::c_char; 32],
+        pub ut_line: [::c_char; 16],
+        pub ut_host: [::c_char; 128],
+        pub __ut_spare: [::c_char; 64],
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_cr_pid {
+        __cr_unused: *mut ::c_void,
+        pub cr_pid: ::pid_t,
+    }
+
+    pub struct xucred {
+        pub cr_version: ::c_uint,
+        pub cr_uid: ::uid_t,
+        pub cr_ngroups: ::c_short,
+        pub cr_groups: [::gid_t; 16],
+        #[cfg(libc_union)]
+        pub cr_pid__c_anonymous_union: __c_anonymous_cr_pid,
+        #[cfg(not(libc_union))]
+        __cr_unused1: *mut ::c_void,
+    }
+
+    pub struct sockaddr_dl {
+        pub sdl_len: ::c_uchar,
+        pub sdl_family: ::c_uchar,
+        pub sdl_index: ::c_ushort,
+        pub sdl_type: ::c_uchar,
+        pub sdl_nlen: ::c_uchar,
+        pub sdl_alen: ::c_uchar,
+        pub sdl_slen: ::c_uchar,
+        pub sdl_data: [::c_char; 46],
+    }
+
+    pub struct mq_attr {
+        pub mq_flags: ::c_long,
+        pub mq_maxmsg: ::c_long,
+        pub mq_msgsize: ::c_long,
+        pub mq_curmsgs: ::c_long,
+        __reserved: [::c_long; 4]
+    }
+
+    pub struct sigevent {
+        pub sigev_notify: ::c_int,
+        pub sigev_signo: ::c_int,
+        pub sigev_value: ::sigval,
+        //The rest of the structure is actually a union.  We expose only
+        //sigev_notify_thread_id because it's the most useful union member.
+        pub sigev_notify_thread_id: ::lwpid_t,
+        #[cfg(target_pointer_width = "64")]
+        __unused1: ::c_int,
+        __unused2: [::c_long; 7]
+    }
+
+    pub struct ptsstat {
+        #[cfg(any(freebsd12, freebsd13, freebsd14, freebsd15))]
+        pub dev: u64,
+        #[cfg(not(any(freebsd12, freebsd13, freebsd14, freebsd15)))]
+        pub dev: u32,
+        pub devname: [::c_char; SPECNAMELEN as usize + 1],
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_elf32_auxv_union {
+        pub a_val: ::c_int,
+    }
+
+    pub struct Elf32_Auxinfo {
+        pub a_type: ::c_int,
+        #[cfg(libc_union)]
+        pub a_un: __c_anonymous_elf32_auxv_union,
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifi_epoch {
+        pub tt: ::time_t,
+        pub ph: u64,
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifi_lastchange {
+        pub tv: ::timeval,
+        pub ph: __c_anonymous_ph,
+    }
+
+    pub struct if_data {
+        /// ethernet, tokenring, etc
+        pub ifi_type: u8,
+        /// e.g., AUI, Thinnet, 10base-T, etc
+        pub ifi_physical: u8,
+        /// media address length
+        pub ifi_addrlen: u8,
+        /// media header length
+        pub ifi_hdrlen: u8,
+        /// current link state
+        pub ifi_link_state: u8,
+        /// carp vhid
+        pub ifi_vhid: u8,
+        /// length of this data struct
+        pub ifi_datalen: u16,
+        /// maximum transmission unit
+        pub ifi_mtu: u32,
+        /// routing metric (external only)
+        pub ifi_metric: u32,
+        /// linespeed
+        pub ifi_baudrate: u64,
+        /// packets received on interface
+        pub ifi_ipackets: u64,
+        /// input errors on interface
+        pub ifi_ierrors: u64,
+        /// packets sent on interface
+        pub ifi_opackets: u64,
+        /// output errors on interface
+        pub ifi_oerrors: u64,
+        /// collisions on csma interfaces
+        pub ifi_collisions: u64,
+        /// total number of octets received
+        pub ifi_ibytes: u64,
+        /// total number of octets sent
+        pub ifi_obytes: u64,
+        /// packets received via multicast
+        pub ifi_imcasts: u64,
+        /// packets sent via multicast
+        pub ifi_omcasts: u64,
+        /// dropped on input
+        pub ifi_iqdrops: u64,
+        /// dropped on output
+        pub ifi_oqdrops: u64,
+        /// destined for unsupported protocol
+        pub ifi_noproto: u64,
+        /// HW offload capabilities, see IFCAP
+        pub ifi_hwassist: u64,
+        /// uptime at attach or stat reset
+        #[cfg(libc_union)]
+        pub __ifi_epoch: __c_anonymous_ifi_epoch,
+        /// uptime at attach or stat reset
+        #[cfg(not(libc_union))]
+        pub __ifi_epoch: u64,
+        /// time of last administrative change
+        #[cfg(libc_union)]
+        pub __ifi_lastchange: __c_anonymous_ifi_lastchange,
+        /// time of last administrative change
+        #[cfg(not(libc_union))]
+        pub __ifi_lastchange: ::timeval,
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifr_ifru {
+        pub ifru_addr: ::sockaddr,
+        pub ifru_dstaddr: ::sockaddr,
+        pub ifru_broadaddr: ::sockaddr,
+        pub ifru_buffer: ifreq_buffer,
+        pub ifru_flags: [::c_short; 2],
+        pub ifru_index: ::c_short,
+        pub ifru_jid: ::c_int,
+        pub ifru_metric: ::c_int,
+        pub ifru_mtu: ::c_int,
+        pub ifru_phys: ::c_int,
+        pub ifru_media: ::c_int,
+        pub ifru_data: ::caddr_t,
+        pub ifru_cap: [::c_int; 2],
+        pub ifru_fib: ::c_uint,
+        pub ifru_vlan_pcp: ::c_uchar,
+    }
+
+    pub struct ifreq {
+        /// if name, e.g. "en0"
+        pub ifr_name: [::c_char; ::IFNAMSIZ],
+        #[cfg(libc_union)]
+        pub ifr_ifru: __c_anonymous_ifr_ifru,
+        #[cfg(not(libc_union))]
+        pub ifr_ifru: ::sockaddr,
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifc_ifcu {
+        pub ifcu_buf: ::caddr_t,
+        pub ifcu_req: *mut ifreq,
+    }
+
+    pub struct ifstat {
+        /// if name, e.g. "en0"
+        pub ifs_name: [::c_char; ::IFNAMSIZ as usize],
+        pub ascii: [::c_char; ::IFSTATMAX as usize + 1],
+    }
+
+    pub struct ifrsskey {
+        /// if name, e.g. "en0"
+        pub ifrk_name: [::c_char; ::IFNAMSIZ as usize],
+        /// RSS_FUNC_
+        pub ifrk_func: u8,
+        pub ifrk_spare0: u8,
+        pub ifrk_keylen: u16,
+        pub ifrk_key: [u8; ::RSS_KEYLEN as usize],
+    }
+
+    pub struct ifdownreason {
+        pub ifdr_name: [::c_char; ::IFNAMSIZ as usize],
+        pub ifdr_reason: u32,
+        pub ifdr_vendor: u32,
+        pub ifdr_msg: [::c_char; ::IFDR_MSG_SIZE as usize],
+    }
+
+    #[repr(packed)]
+    pub struct sctphdr {
+        pub src_port: u16,
+        pub dest_port: u16,
+        pub v_tag: u32,
+        pub checksum: u32,
+    }
+
+    #[repr(packed)]
+    pub struct sctp_chunkhdr {
+        pub chunk_type: u8,
+        pub chunk_flags: u8,
+        pub chunk_length: u16,
+    }
+
+    #[repr(packed)]
+    pub struct sctp_paramhdr {
+        pub param_type: u16,
+        pub param_length: u16,
+    }
+
+    #[repr(packed)]
+    pub struct sctp_gen_error_cause {
+        pub code: u16,
+        pub length: u16,
+        pub info: [u8; 0],
+    }
+
+    #[repr(packed)]
+    pub struct sctp_error_cause {
+        pub code: u16,
+        pub length: u16,
+    }
+
+    #[repr(packed)]
+    pub struct sctp_error_invalid_stream {
+        pub cause: sctp_error_cause,
+        pub stream_id: u16,
+        __reserved: u16,
+    }
+
+    #[repr(packed)]
+    pub struct sctp_error_missing_param {
+        pub cause: sctp_error_cause,
+        pub num_missing_params: u32,
+        pub tpe: [u8; 0],
+    }
+
+    #[repr(packed)]
+    pub struct sctp_error_stale_cookie {
+        pub cause: sctp_error_cause,
+        pub stale_time: u32,
+    }
+
+    #[repr(packed)]
+    pub struct sctp_error_out_of_resource {
+        pub cause: sctp_error_cause,
+    }
+
+    #[repr(packed)]
+    pub struct sctp_error_unresolv_addr {
+        pub cause: sctp_error_cause,
+    }
+
+    #[repr(packed)]
+    pub struct sctp_error_unrecognized_chunk {
+        pub cause: sctp_error_cause,
+        pub ch: sctp_chunkhdr,
+    }
+
+    #[repr(packed)]
+    pub struct sctp_error_no_user_data {
+        pub cause: sctp_error_cause,
+        pub tsn: u32,
+    }
+
+    #[repr(packed)]
+    pub struct sctp_error_auth_invalid_hmac {
+        pub cause: sctp_error_cause,
+        pub hmac_id: u16,
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for utmpx {
+            fn eq(&self, other: &utmpx) -> bool {
+                self.ut_type == other.ut_type
+                    && self.ut_tv == other.ut_tv
+                    && self.ut_id == other.ut_id
+                    && self.ut_pid == other.ut_pid
+                    && self.ut_user == other.ut_user
+                    && self.ut_line == other.ut_line
+                    && self
+                    .ut_host
+                    .iter()
+                    .zip(other.ut_host.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .__ut_spare
+                    .iter()
+                    .zip(other.__ut_spare.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for utmpx {}
+        impl ::fmt::Debug for utmpx {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("utmpx")
+                    .field("ut_type", &self.ut_type)
+                    .field("ut_tv", &self.ut_tv)
+                    .field("ut_id", &self.ut_id)
+                    .field("ut_pid", &self.ut_pid)
+                    .field("ut_user", &self.ut_user)
+                    .field("ut_line", &self.ut_line)
+                    // FIXME: .field("ut_host", &self.ut_host)
+                    // FIXME: .field("__ut_spare", &self.__ut_spare)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for utmpx {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ut_type.hash(state);
+                self.ut_tv.hash(state);
+                self.ut_id.hash(state);
+                self.ut_pid.hash(state);
+                self.ut_user.hash(state);
+                self.ut_line.hash(state);
+                self.ut_host.hash(state);
+                self.__ut_spare.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl PartialEq for __c_anonymous_cr_pid {
+            fn eq(&self, other: &__c_anonymous_cr_pid) -> bool {
+                unsafe { self.cr_pid == other.cr_pid}
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_cr_pid {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_cr_pid {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("cr_pid")
+                    .field("cr_pid", unsafe { &self.cr_pid })
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_cr_pid {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe { self.cr_pid.hash(state) };
+            }
+        }
+
+        impl PartialEq for xucred {
+            fn eq(&self, other: &xucred) -> bool {
+                #[cfg(libc_union)]
+                let equal_cr_pid = self.cr_pid__c_anonymous_union
+                    == other.cr_pid__c_anonymous_union;
+                #[cfg(not(libc_union))]
+                let equal_cr_pid = self.__cr_unused1 == other.__cr_unused1;
+
+                self.cr_version == other.cr_version
+                    && self.cr_uid == other.cr_uid
+                    && self.cr_ngroups == other.cr_ngroups
+                    && self.cr_groups == other.cr_groups
+                    && equal_cr_pid
+            }
+        }
+        impl Eq for xucred {}
+        impl ::fmt::Debug for xucred {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let mut struct_formatter = f.debug_struct("xucred");
+                struct_formatter.field("cr_version", &self.cr_version);
+                struct_formatter.field("cr_uid", &self.cr_uid);
+                struct_formatter.field("cr_ngroups", &self.cr_ngroups);
+                struct_formatter.field("cr_groups", &self.cr_groups);
+                #[cfg(libc_union)]
+                struct_formatter.field(
+                    "cr_pid__c_anonymous_union",
+                    &self.cr_pid__c_anonymous_union
+                );
+                struct_formatter.finish()
+            }
+        }
+        impl ::hash::Hash for xucred {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.cr_version.hash(state);
+                self.cr_uid.hash(state);
+                self.cr_ngroups.hash(state);
+                self.cr_groups.hash(state);
+                #[cfg(libc_union)]
+                self.cr_pid__c_anonymous_union.hash(state);
+                #[cfg(not(libc_union))]
+                self.__cr_unused1.hash(state);
+            }
+        }
+
+        impl PartialEq for sockaddr_dl {
+            fn eq(&self, other: &sockaddr_dl) -> bool {
+                self.sdl_len == other.sdl_len
+                    && self.sdl_family == other.sdl_family
+                    && self.sdl_index == other.sdl_index
+                    && self.sdl_type == other.sdl_type
+                    && self.sdl_nlen == other.sdl_nlen
+                    && self.sdl_alen == other.sdl_alen
+                    && self.sdl_slen == other.sdl_slen
+                    && self
+                    .sdl_data
+                    .iter()
+                    .zip(other.sdl_data.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for sockaddr_dl {}
+        impl ::fmt::Debug for sockaddr_dl {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_dl")
+                    .field("sdl_len", &self.sdl_len)
+                    .field("sdl_family", &self.sdl_family)
+                    .field("sdl_index", &self.sdl_index)
+                    .field("sdl_type", &self.sdl_type)
+                    .field("sdl_nlen", &self.sdl_nlen)
+                    .field("sdl_alen", &self.sdl_alen)
+                    .field("sdl_slen", &self.sdl_slen)
+                    // FIXME: .field("sdl_data", &self.sdl_data)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sockaddr_dl {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sdl_len.hash(state);
+                self.sdl_family.hash(state);
+                self.sdl_index.hash(state);
+                self.sdl_type.hash(state);
+                self.sdl_nlen.hash(state);
+                self.sdl_alen.hash(state);
+                self.sdl_slen.hash(state);
+                self.sdl_data.hash(state);
+            }
+        }
+
+        impl PartialEq for mq_attr {
+            fn eq(&self, other: &mq_attr) -> bool {
+                self.mq_flags == other.mq_flags &&
+                self.mq_maxmsg == other.mq_maxmsg &&
+                self.mq_msgsize == other.mq_msgsize &&
+                self.mq_curmsgs == other.mq_curmsgs
+            }
+        }
+        impl Eq for mq_attr {}
+        impl ::fmt::Debug for mq_attr {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("mq_attr")
+                    .field("mq_flags", &self.mq_flags)
+                    .field("mq_maxmsg", &self.mq_maxmsg)
+                    .field("mq_msgsize", &self.mq_msgsize)
+                    .field("mq_curmsgs", &self.mq_curmsgs)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for mq_attr {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.mq_flags.hash(state);
+                self.mq_maxmsg.hash(state);
+                self.mq_msgsize.hash(state);
+                self.mq_curmsgs.hash(state);
+            }
+        }
+
+        impl PartialEq for sigevent {
+            fn eq(&self, other: &sigevent) -> bool {
+                self.sigev_notify == other.sigev_notify
+                    && self.sigev_signo == other.sigev_signo
+                    && self.sigev_value == other.sigev_value
+                    && self.sigev_notify_thread_id
+                        == other.sigev_notify_thread_id
+            }
+        }
+        impl Eq for sigevent {}
+        impl ::fmt::Debug for sigevent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sigevent")
+                    .field("sigev_notify", &self.sigev_notify)
+                    .field("sigev_signo", &self.sigev_signo)
+                    .field("sigev_value", &self.sigev_value)
+                    .field("sigev_notify_thread_id",
+                           &self.sigev_notify_thread_id)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sigevent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sigev_notify.hash(state);
+                self.sigev_signo.hash(state);
+                self.sigev_value.hash(state);
+                self.sigev_notify_thread_id.hash(state);
+            }
+        }
+
+        impl PartialEq for ptsstat {
+            fn eq(&self, other: &ptsstat) -> bool {
+                let self_devname: &[::c_char] = &self.devname;
+                let other_devname: &[::c_char] = &other.devname;
+
+                self.dev == other.dev && self_devname == other_devname
+            }
+        }
+        impl Eq for ptsstat {}
+        impl ::fmt::Debug for ptsstat {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let self_devname: &[::c_char] = &self.devname;
+
+                f.debug_struct("ptsstat")
+                    .field("dev", &self.dev)
+                    .field("devname", &self_devname)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for ptsstat {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let self_devname: &[::c_char] = &self.devname;
+
+                self.dev.hash(state);
+                self_devname.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl PartialEq for __c_anonymous_elf32_auxv_union {
+            fn eq(&self, other: &__c_anonymous_elf32_auxv_union) -> bool {
+                unsafe { self.a_val == other.a_val}
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_elf32_auxv_union {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_elf32_auxv_union {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("a_val")
+                    .field("a_val", unsafe { &self.a_val })
+                    .finish()
+            }
+        }
+        #[cfg(not(libc_union))]
+        impl PartialEq for Elf32_Auxinfo {
+            fn eq(&self, other: &Elf32_Auxinfo) -> bool {
+                self.a_type == other.a_type
+            }
+        }
+        #[cfg(libc_union)]
+        impl PartialEq for Elf32_Auxinfo {
+            fn eq(&self, other: &Elf32_Auxinfo) -> bool {
+                self.a_type == other.a_type
+                    && self.a_un == other.a_un
+            }
+        }
+        impl Eq for Elf32_Auxinfo {}
+        #[cfg(not(libc_union))]
+        impl ::fmt::Debug for Elf32_Auxinfo {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("Elf32_Auxinfo")
+                    .field("a_type", &self.a_type)
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for Elf32_Auxinfo {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("Elf32_Auxinfo")
+                    .field("a_type", &self.a_type)
+                    .field("a_un", &self.a_un)
+                    .finish()
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl PartialEq for __c_anonymous_ifr_ifru {
+            fn eq(&self, other: &__c_anonymous_ifr_ifru) -> bool {
+                unsafe {
+                    self.ifru_addr == other.ifru_addr &&
+                    self.ifru_dstaddr == other.ifru_dstaddr &&
+                    self.ifru_broadaddr == other.ifru_broadaddr &&
+                    self.ifru_buffer == other.ifru_buffer &&
+                    self.ifru_flags == other.ifru_flags &&
+                    self.ifru_index == other.ifru_index &&
+                    self.ifru_jid == other.ifru_jid &&
+                    self.ifru_metric == other.ifru_metric &&
+                    self.ifru_mtu == other.ifru_mtu &&
+                    self.ifru_phys == other.ifru_phys &&
+                    self.ifru_media == other.ifru_media &&
+                    self.ifru_data == other.ifru_data &&
+                    self.ifru_cap == other.ifru_cap &&
+                    self.ifru_fib == other.ifru_fib &&
+                    self.ifru_vlan_pcp == other.ifru_vlan_pcp
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_ifr_ifru {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifr_ifru {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifr_ifru")
+                    .field("ifru_addr", unsafe { &self.ifru_addr })
+                    .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr })
+                    .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr })
+                    .field("ifru_buffer", unsafe { &self.ifru_buffer })
+                    .field("ifru_flags", unsafe { &self.ifru_flags })
+                    .field("ifru_index", unsafe { &self.ifru_index })
+                    .field("ifru_jid", unsafe { &self.ifru_jid })
+                    .field("ifru_metric", unsafe { &self.ifru_metric })
+                    .field("ifru_mtu", unsafe { &self.ifru_mtu })
+                    .field("ifru_phys", unsafe { &self.ifru_phys })
+                    .field("ifru_media", unsafe { &self.ifru_media })
+                    .field("ifru_data", unsafe { &self.ifru_data })
+                    .field("ifru_cap", unsafe { &self.ifru_cap })
+                    .field("ifru_fib", unsafe { &self.ifru_fib })
+                    .field("ifru_vlan_pcp", unsafe { &self.ifru_vlan_pcp })
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_ifr_ifru {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe { self.ifru_addr.hash(state) };
+                unsafe { self.ifru_dstaddr.hash(state) };
+                unsafe { self.ifru_broadaddr.hash(state) };
+                unsafe { self.ifru_buffer.hash(state) };
+                unsafe { self.ifru_flags.hash(state) };
+                unsafe { self.ifru_index.hash(state) };
+                unsafe { self.ifru_jid.hash(state) };
+                unsafe { self.ifru_metric.hash(state) };
+                unsafe { self.ifru_mtu.hash(state) };
+                unsafe { self.ifru_phys.hash(state) };
+                unsafe { self.ifru_media.hash(state) };
+                unsafe { self.ifru_data.hash(state) };
+                unsafe { self.ifru_cap.hash(state) };
+                unsafe { self.ifru_fib.hash(state) };
+                unsafe { self.ifru_vlan_pcp.hash(state) };
+            }
+        }
+
+        impl PartialEq for ifreq {
+            fn eq(&self, other: &ifreq) -> bool {
+                self.ifr_name == other.ifr_name && self.ifr_ifru == other.ifr_ifru
+            }
+        }
+        impl Eq for ifreq {}
+        impl ::fmt::Debug for ifreq {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifreq")
+                    .field("ifr_name", &self.ifr_name)
+                    .field("ifr_ifru", &self.ifr_ifru)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for ifreq {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ifr_name.hash(state);
+                self.ifr_ifru.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_ifc_ifcu {}
+
+        #[cfg(libc_union)]
+        impl PartialEq for __c_anonymous_ifc_ifcu {
+            fn eq(&self, other: &__c_anonymous_ifc_ifcu) -> bool {
+                unsafe {
+                    self.ifcu_buf == other.ifcu_buf &&
+                    self.ifcu_req == other.ifcu_req
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifc_ifcu {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifc_ifcu")
+                    .field("ifcu_buf", unsafe { &self.ifcu_buf })
+                    .field("ifcu_req", unsafe { &self.ifcu_req })
+                    .finish()
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_ifc_ifcu {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe { self.ifcu_buf.hash(state) };
+                unsafe { self.ifcu_req.hash(state) };
+            }
+        }
+
+        impl PartialEq for ifstat {
+            fn eq(&self, other: &ifstat) -> bool {
+                let self_ascii: &[::c_char] = &self.ascii;
+                let other_ascii: &[::c_char] = &other.ascii;
+
+                self.ifs_name == other.ifs_name && self_ascii == other_ascii
+            }
+        }
+        impl Eq for ifstat {}
+        impl ::fmt::Debug for ifstat {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let ascii: &[::c_char] = &self.ascii;
+
+                f.debug_struct("ifstat")
+                    .field("ifs_name", &self.ifs_name)
+                    .field("ascii", &ascii)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for ifstat {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ifs_name.hash(state);
+                self.ascii.hash(state);
+            }
+        }
+
+        impl PartialEq for ifrsskey {
+            fn eq(&self, other: &ifrsskey) -> bool {
+                let self_ifrk_key: &[u8] = &self.ifrk_key;
+                let other_ifrk_key: &[u8] = &other.ifrk_key;
+
+                self.ifrk_name == other.ifrk_name &&
+                self.ifrk_func == other.ifrk_func &&
+                self.ifrk_spare0 == other.ifrk_spare0 &&
+                self.ifrk_keylen == other.ifrk_keylen &&
+                self_ifrk_key == other_ifrk_key
+            }
+        }
+        impl Eq for ifrsskey {}
+        impl ::fmt::Debug for ifrsskey {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let ifrk_key: &[u8] = &self.ifrk_key;
+
+                f.debug_struct("ifrsskey")
+                    .field("ifrk_name", &self.ifrk_name)
+                    .field("ifrk_func", &self.ifrk_func)
+                    .field("ifrk_spare0", &self.ifrk_spare0)
+                    .field("ifrk_keylen", &self.ifrk_keylen)
+                    .field("ifrk_key", &ifrk_key)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for ifrsskey {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ifrk_name.hash(state);
+                self.ifrk_func.hash(state);
+                self.ifrk_spare0.hash(state);
+                self.ifrk_keylen.hash(state);
+                self.ifrk_key.hash(state);
+            }
+        }
+
+        impl PartialEq for ifdownreason {
+            fn eq(&self, other: &ifdownreason) -> bool {
+                let self_ifdr_msg: &[::c_char] = &self.ifdr_msg;
+                let other_ifdr_msg: &[::c_char] = &other.ifdr_msg;
+
+                self.ifdr_name == other.ifdr_name &&
+                self.ifdr_reason == other.ifdr_reason &&
+                self.ifdr_vendor == other.ifdr_vendor &&
+                self_ifdr_msg == other_ifdr_msg
+            }
+        }
+        impl Eq for ifdownreason {}
+        impl ::fmt::Debug for ifdownreason {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let ifdr_msg: &[::c_char] = &self.ifdr_msg;
+
+                f.debug_struct("ifdownreason")
+                    .field("ifdr_name", &self.ifdr_name)
+                    .field("ifdr_reason", &self.ifdr_reason)
+                    .field("ifdr_vendor", &self.ifdr_vendor)
+                    .field("ifdr_msg", &ifdr_msg)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for ifdownreason {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ifdr_name.hash(state);
+                self.ifdr_reason.hash(state);
+                self.ifdr_vendor.hash(state);
+                self.ifdr_msg.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl PartialEq for __c_anonymous_ifi_epoch {
+            fn eq(&self, other: &__c_anonymous_ifi_epoch) -> bool {
+                unsafe {
+                    self.tt == other.tt &&
+                    self.ph == other.ph
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_ifi_epoch {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifi_epoch {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("__c_anonymous_ifi_epoch")
+                    .field("tt", unsafe { &self.tt })
+                    .field("ph", unsafe { &self.ph })
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_ifi_epoch {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                    self.tt.hash(state);
+                    self.ph.hash(state);
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl PartialEq for __c_anonymous_ifi_lastchange {
+            fn eq(&self, other: &__c_anonymous_ifi_lastchange) -> bool {
+                unsafe {
+                    self.tv == other.tv &&
+                    self.ph == other.ph
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_ifi_lastchange {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifi_lastchange {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("__c_anonymous_ifi_lastchange")
+                    .field("tv", unsafe { &self.tv })
+                    .field("ph", unsafe { &self.ph })
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_ifi_lastchange {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                    self.tv.hash(state);
+                    self.ph.hash(state);
+                }
+            }
+        }
+
+        impl PartialEq for if_data {
+            fn eq(&self, other: &if_data) -> bool {
+                self.ifi_type == other.ifi_type &&
+                self.ifi_physical == other.ifi_physical &&
+                self.ifi_addrlen == other.ifi_addrlen &&
+                self.ifi_hdrlen == other.ifi_hdrlen &&
+                self.ifi_link_state == other.ifi_link_state &&
+                self.ifi_vhid == other.ifi_vhid &&
+                self.ifi_datalen == other.ifi_datalen &&
+                self.ifi_mtu == other.ifi_mtu &&
+                self.ifi_metric == other.ifi_metric &&
+                self.ifi_baudrate == other.ifi_baudrate &&
+                self.ifi_ipackets == other.ifi_ipackets &&
+                self.ifi_ierrors == other.ifi_ierrors &&
+                self.ifi_opackets == other.ifi_opackets &&
+                self.ifi_oerrors == other.ifi_oerrors &&
+                self.ifi_collisions == other.ifi_collisions &&
+                self.ifi_ibytes == other.ifi_ibytes &&
+                self.ifi_obytes == other.ifi_obytes &&
+                self.ifi_imcasts == other.ifi_imcasts &&
+                self.ifi_omcasts == other.ifi_omcasts &&
+                self.ifi_iqdrops == other.ifi_iqdrops &&
+                self.ifi_oqdrops == other.ifi_oqdrops &&
+                self.ifi_noproto == other.ifi_noproto &&
+                self.ifi_hwassist == other.ifi_hwassist &&
+                self.__ifi_epoch == other.__ifi_epoch &&
+                self.__ifi_lastchange == other.__ifi_lastchange
+            }
+        }
+        impl Eq for if_data {}
+        impl ::fmt::Debug for if_data {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("if_data")
+                    .field("ifi_type", &self.ifi_type)
+                    .field("ifi_physical", &self.ifi_physical)
+                    .field("ifi_addrlen", &self.ifi_addrlen)
+                    .field("ifi_hdrlen", &self.ifi_hdrlen)
+                    .field("ifi_link_state", &self.ifi_link_state)
+                    .field("ifi_vhid", &self.ifi_vhid)
+                    .field("ifi_datalen", &self.ifi_datalen)
+                    .field("ifi_mtu", &self.ifi_mtu)
+                    .field("ifi_metric", &self.ifi_metric)
+                    .field("ifi_baudrate", &self.ifi_baudrate)
+                    .field("ifi_ipackets", &self.ifi_ipackets)
+                    .field("ifi_ierrors", &self.ifi_ierrors)
+                    .field("ifi_opackets", &self.ifi_opackets)
+                    .field("ifi_oerrors", &self.ifi_oerrors)
+                    .field("ifi_collisions", &self.ifi_collisions)
+                    .field("ifi_ibytes", &self.ifi_ibytes)
+                    .field("ifi_obytes", &self.ifi_obytes)
+                    .field("ifi_imcasts", &self.ifi_imcasts)
+                    .field("ifi_omcasts", &self.ifi_omcasts)
+                    .field("ifi_iqdrops", &self.ifi_iqdrops)
+                    .field("ifi_oqdrops", &self.ifi_oqdrops)
+                    .field("ifi_noproto", &self.ifi_noproto)
+                    .field("ifi_hwassist", &self.ifi_hwassist)
+                    .field("__ifi_epoch", &self.__ifi_epoch)
+                    .field("__ifi_lastchange", &self.__ifi_lastchange)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for if_data {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ifi_type.hash(state);
+                self.ifi_physical.hash(state);
+                self.ifi_addrlen.hash(state);
+                self.ifi_hdrlen.hash(state);
+                self.ifi_link_state.hash(state);
+                self.ifi_vhid.hash(state);
+                self.ifi_datalen.hash(state);
+                self.ifi_mtu.hash(state);
+                self.ifi_metric.hash(state);
+                self.ifi_baudrate.hash(state);
+                self.ifi_ipackets.hash(state);
+                self.ifi_ierrors.hash(state);
+                self.ifi_opackets.hash(state);
+                self.ifi_oerrors.hash(state);
+                self.ifi_collisions.hash(state);
+                self.ifi_ibytes.hash(state);
+                self.ifi_obytes.hash(state);
+                self.ifi_imcasts.hash(state);
+                self.ifi_omcasts.hash(state);
+                self.ifi_iqdrops.hash(state);
+                self.ifi_oqdrops.hash(state);
+                self.ifi_noproto.hash(state);
+                self.ifi_hwassist.hash(state);
+                self.__ifi_epoch.hash(state);
+                self.__ifi_lastchange.hash(state);
+            }
+        }
+
+        impl PartialEq for sctphdr {
+            fn eq(&self, other: &sctphdr) -> bool {
+                return {self.src_port} == {other.src_port} &&
+                {self.dest_port} == {other.dest_port} &&
+                {self.v_tag} == {other.v_tag} &&
+                {self.checksum} == {other.checksum}
+            }
+        }
+        impl Eq for sctphdr {}
+        impl ::fmt::Debug for sctphdr {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sctphdr")
+                    .field("src_port", &{self.src_port})
+                    .field("dest_port", &{self.dest_port})
+                    .field("v_tag", &{self.v_tag})
+                    .field("checksum", &{self.checksum})
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sctphdr {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                {self.src_port}.hash(state);
+                {self.dest_port}.hash(state);
+                {self.v_tag}.hash(state);
+                {self.checksum}.hash(state);
+            }
+        }
+
+        impl PartialEq for sctp_chunkhdr {
+            fn eq(&self, other: &sctp_chunkhdr) -> bool {
+                return {self.chunk_type} == {other.chunk_type} &&
+                {self.chunk_flags} == {other.chunk_flags} &&
+                {self.chunk_length} == {other.chunk_length}
+            }
+        }
+        impl Eq for sctp_chunkhdr {}
+        impl ::fmt::Debug for sctp_chunkhdr {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sctp_chunkhdr")
+                    .field("chunk_type", &{self.chunk_type})
+                    .field("chunk_flags", &{self.chunk_flags})
+                    .field("chunk_length", &{self.chunk_length})
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sctp_chunkhdr {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                {self.chunk_type}.hash(state);
+                {self.chunk_flags}.hash(state);
+                {self.chunk_length}.hash(state);
+            }
+        }
+
+        impl PartialEq for sctp_paramhdr {
+            fn eq(&self, other: &sctp_paramhdr) -> bool {
+                return {self.param_type} == {other.param_type} &&
+                {self.param_length} == {other.param_length}
+            }
+        }
+        impl Eq for sctp_paramhdr {}
+        impl ::fmt::Debug for sctp_paramhdr {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sctp_paramhdr")
+                    .field("param_type", &{self.param_type})
+                    .field("param_length", &{self.param_length})
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sctp_paramhdr {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                {self.param_type}.hash(state);
+                {self.param_length}.hash(state);
+            }
+        }
+
+        impl PartialEq for sctp_gen_error_cause {
+            fn eq(&self, other: &sctp_gen_error_cause) -> bool {
+                return {self.code} == {other.code} &&
+                {self.length} == {other.length} &&
+                {self.info}.iter().zip({other.info}.iter()).all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for sctp_gen_error_cause {}
+        impl ::fmt::Debug for sctp_gen_error_cause {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sctp_gen_error_cause")
+                    .field("code", &{self.code})
+                    .field("length", &{self.length})
+                    // FIXME: .field("info", &{self.info})
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sctp_gen_error_cause {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                {self.code}.hash(state);
+                {self.length}.hash(state);
+                {self.info}.hash(state);
+            }
+        }
+
+        impl PartialEq for sctp_error_cause {
+            fn eq(&self, other: &sctp_error_cause) -> bool {
+                return {self.code} == {other.code} &&
+                {self.length} == {other.length}
+            }
+        }
+        impl Eq for sctp_error_cause {}
+        impl ::fmt::Debug for sctp_error_cause {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sctp_error_cause")
+                    .field("code", &{self.code})
+                    .field("length", &{self.length})
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sctp_error_cause {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                {self.code}.hash(state);
+                {self.length}.hash(state);
+            }
+        }
+
+        impl PartialEq for sctp_error_invalid_stream {
+            fn eq(&self, other: &sctp_error_invalid_stream) -> bool {
+                return {self.cause} == {other.cause} &&
+                {self.stream_id} == {other.stream_id}
+            }
+        }
+        impl Eq for sctp_error_invalid_stream {}
+        impl ::fmt::Debug for sctp_error_invalid_stream {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sctp_error_invalid_stream")
+                    .field("cause", &{self.cause})
+                    .field("stream_id", &{self.stream_id})
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sctp_error_invalid_stream {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                {self.cause}.hash(state);
+                {self.stream_id}.hash(state);
+            }
+        }
+
+        impl PartialEq for sctp_error_missing_param {
+            fn eq(&self, other: &sctp_error_missing_param) -> bool {
+                return {self.cause} == {other.cause} &&
+                {self.num_missing_params} == {other.num_missing_params} &&
+                {self.tpe}.iter().zip({other.tpe}.iter()).all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for sctp_error_missing_param {}
+        impl ::fmt::Debug for sctp_error_missing_param {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sctp_error_missing_param")
+                    .field("cause", &{self.cause})
+                    .field("num_missing_params", &{self.num_missing_params})
+                    // FIXME: .field("tpe", &{self.tpe})
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sctp_error_missing_param {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                {self.cause}.hash(state);
+                {self.num_missing_params}.hash(state);
+                {self.tpe}.hash(state);
+            }
+        }
+
+        impl PartialEq for sctp_error_stale_cookie {
+            fn eq(&self, other: &sctp_error_stale_cookie) -> bool {
+                return {self.cause} == {other.cause} &&
+                {self.stale_time} == {other.stale_time}
+            }
+        }
+        impl Eq for sctp_error_stale_cookie {}
+        impl ::fmt::Debug for sctp_error_stale_cookie {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sctp_error_stale_cookie")
+                    .field("cause", &{self.cause})
+                    .field("stale_time", &{self.stale_time})
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sctp_error_stale_cookie {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                {self.cause}.hash(state);
+                {self.stale_time}.hash(state);
+            }
+        }
+
+        impl PartialEq for sctp_error_out_of_resource {
+            fn eq(&self, other: &sctp_error_out_of_resource) -> bool {
+                return {self.cause} == {other.cause}
+            }
+        }
+        impl Eq for sctp_error_out_of_resource {}
+        impl ::fmt::Debug for sctp_error_out_of_resource {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sctp_error_out_of_resource")
+                    .field("cause", &{self.cause})
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sctp_error_out_of_resource {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                {self.cause}.hash(state);
+            }
+        }
+
+        impl PartialEq for sctp_error_unresolv_addr {
+            fn eq(&self, other: &sctp_error_unresolv_addr) -> bool {
+                return {self.cause} == {other.cause}
+            }
+        }
+        impl Eq for sctp_error_unresolv_addr {}
+        impl ::fmt::Debug for sctp_error_unresolv_addr {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sctp_error_unresolv_addr")
+                    .field("cause", &{self.cause})
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sctp_error_unresolv_addr {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                {self.cause}.hash(state);
+            }
+        }
+
+        impl PartialEq for sctp_error_unrecognized_chunk {
+            fn eq(&self, other: &sctp_error_unrecognized_chunk) -> bool {
+                return {self.cause} == {other.cause} &&
+                {self.ch} == {other.ch}
+            }
+        }
+        impl Eq for sctp_error_unrecognized_chunk {}
+        impl ::fmt::Debug for sctp_error_unrecognized_chunk {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sctp_error_unrecognized_chunk")
+                    .field("cause", &{self.cause})
+                    .field("ch", &{self.ch})
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sctp_error_unrecognized_chunk {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                {self.cause}.hash(state);
+                {self.ch}.hash(state);
+            }
+        }
+
+        impl PartialEq for sctp_error_no_user_data {
+            fn eq(&self, other: &sctp_error_no_user_data) -> bool {
+                return {self.cause} == {other.cause} &&
+                {self.tsn} == {other.tsn}
+            }
+        }
+        impl Eq for sctp_error_no_user_data {}
+        impl ::fmt::Debug for sctp_error_no_user_data {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sctp_error_no_user_data")
+                    .field("cause", &{self.cause})
+                    .field("tsn", &{self.tsn})
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sctp_error_no_user_data {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                {self.cause}.hash(state);
+                {self.tsn}.hash(state);
+            }
+        }
+
+        impl PartialEq for sctp_error_auth_invalid_hmac {
+            fn eq(&self, other: &sctp_error_auth_invalid_hmac) -> bool {
+                return {self.cause} == {other.cause} &&
+                {self.hmac_id} == {other.hmac_id}
+            }
+        }
+        impl Eq for sctp_error_auth_invalid_hmac {}
+        impl ::fmt::Debug for sctp_error_auth_invalid_hmac {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sctp_error_invalid_hmac")
+                    .field("cause", &{self.cause})
+                    .field("hmac_id", &{self.hmac_id})
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sctp_error_auth_invalid_hmac {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                {self.cause}.hash(state);
+                {self.hmac_id}.hash(state);
+            }
+        }
+    }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+#[repr(u32)]
+pub enum dot3Vendors {
+    dot3VendorAMD = 1,
+    dot3VendorIntel = 2,
+    dot3VendorNational = 4,
+    dot3VendorFujitsu = 5,
+    dot3VendorDigital = 6,
+    dot3VendorWesternDigital = 7,
+}
+impl ::Copy for dot3Vendors {}
+impl ::Clone for dot3Vendors {
+    fn clone(&self) -> dot3Vendors {
+        *self
+    }
+}
+
+// aio.h
+pub const LIO_VECTORED: ::c_int = 4;
+pub const LIO_WRITEV: ::c_int = 5;
+pub const LIO_READV: ::c_int = 6;
+
+// sys/devicestat.h
+pub const DEVSTAT_N_TRANS_FLAGS: ::c_int = 4;
+pub const DEVSTAT_NAME_LEN: ::c_int = 16;
+
+// sys/cpuset.h
+cfg_if! {
+    if #[cfg(any(freebsd15, freebsd14))] {
+        pub const CPU_SETSIZE: ::c_int = 1024;
+    } else {
+        pub const CPU_SETSIZE: ::c_int = 256;
+    }
+}
+
+pub const SIGEV_THREAD_ID: ::c_int = 4;
+
+pub const EXTATTR_NAMESPACE_EMPTY: ::c_int = 0;
+pub const EXTATTR_NAMESPACE_USER: ::c_int = 1;
+pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2;
+
+pub const PTHREAD_STACK_MIN: ::size_t = MINSIGSTKSZ;
+pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 4;
+pub const PTHREAD_MUTEX_STALLED: ::c_int = 0;
+pub const PTHREAD_MUTEX_ROBUST: ::c_int = 1;
+pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + 32768;
+pub const SF_NODISKIO: ::c_int = 0x00000001;
+pub const SF_MNOWAIT: ::c_int = 0x00000002;
+pub const SF_SYNC: ::c_int = 0x00000004;
+pub const SF_USER_READAHEAD: ::c_int = 0x00000008;
+pub const SF_NOCACHE: ::c_int = 0x00000010;
+pub const O_CLOEXEC: ::c_int = 0x00100000;
+pub const O_DIRECTORY: ::c_int = 0x00020000;
+pub const O_DSYNC: ::c_int = 0x01000000;
+pub const O_EMPTY_PATH: ::c_int = 0x02000000;
+pub const O_EXEC: ::c_int = 0x00040000;
+pub const O_PATH: ::c_int = 0x00400000;
+pub const O_RESOLVE_BENEATH: ::c_int = 0x00800000;
+pub const O_SEARCH: ::c_int = O_EXEC;
+pub const O_TTY_INIT: ::c_int = 0x00080000;
+pub const O_VERIFY: ::c_int = 0x00200000;
+pub const F_GETLK: ::c_int = 11;
+pub const F_SETLK: ::c_int = 12;
+pub const F_SETLKW: ::c_int = 13;
+pub const ENOTCAPABLE: ::c_int = 93;
+pub const ECAPMODE: ::c_int = 94;
+pub const ENOTRECOVERABLE: ::c_int = 95;
+pub const EOWNERDEAD: ::c_int = 96;
+pub const EINTEGRITY: ::c_int = 97;
+pub const RLIMIT_NPTS: ::c_int = 11;
+pub const RLIMIT_SWAP: ::c_int = 12;
+pub const RLIMIT_KQUEUES: ::c_int = 13;
+pub const RLIMIT_UMTXP: ::c_int = 14;
+#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+pub const RLIM_NLIMITS: ::rlim_t = 15;
+pub const RLIM_SAVED_MAX: ::rlim_t = ::RLIM_INFINITY;
+pub const RLIM_SAVED_CUR: ::rlim_t = ::RLIM_INFINITY;
+
+pub const CP_USER: ::c_int = 0;
+pub const CP_NICE: ::c_int = 1;
+pub const CP_SYS: ::c_int = 2;
+pub const CP_INTR: ::c_int = 3;
+pub const CP_IDLE: ::c_int = 4;
+pub const CPUSTATES: ::c_int = 5;
+
+pub const NI_NOFQDN: ::c_int = 0x00000001;
+pub const NI_NUMERICHOST: ::c_int = 0x00000002;
+pub const NI_NAMEREQD: ::c_int = 0x00000004;
+pub const NI_NUMERICSERV: ::c_int = 0x00000008;
+pub const NI_DGRAM: ::c_int = 0x00000010;
+pub const NI_NUMERICSCOPE: ::c_int = 0x00000020;
+
+pub const XU_NGROUPS: ::c_int = 16;
+
+pub const Q_GETQUOTA: ::c_int = 0x700;
+pub const Q_SETQUOTA: ::c_int = 0x800;
+
+pub const MAP_GUARD: ::c_int = 0x00002000;
+pub const MAP_EXCL: ::c_int = 0x00004000;
+pub const MAP_PREFAULT_READ: ::c_int = 0x00040000;
+pub const MAP_ALIGNMENT_SHIFT: ::c_int = 24;
+pub const MAP_ALIGNMENT_MASK: ::c_int = 0xff << MAP_ALIGNMENT_SHIFT;
+pub const MAP_ALIGNED_SUPER: ::c_int = 1 << MAP_ALIGNMENT_SHIFT;
+
+pub const POSIX_FADV_NORMAL: ::c_int = 0;
+pub const POSIX_FADV_RANDOM: ::c_int = 1;
+pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
+pub const POSIX_FADV_WILLNEED: ::c_int = 3;
+pub const POSIX_FADV_DONTNEED: ::c_int = 4;
+pub const POSIX_FADV_NOREUSE: ::c_int = 5;
+
+pub const POLLINIGNEOF: ::c_short = 0x2000;
+
+pub const EVFILT_READ: i16 = -1;
+pub const EVFILT_WRITE: i16 = -2;
+pub const EVFILT_AIO: i16 = -3;
+pub const EVFILT_VNODE: i16 = -4;
+pub const EVFILT_PROC: i16 = -5;
+pub const EVFILT_SIGNAL: i16 = -6;
+pub const EVFILT_TIMER: i16 = -7;
+pub const EVFILT_PROCDESC: i16 = -8;
+pub const EVFILT_FS: i16 = -9;
+pub const EVFILT_LIO: i16 = -10;
+pub const EVFILT_USER: i16 = -11;
+pub const EVFILT_SENDFILE: i16 = -12;
+pub const EVFILT_EMPTY: i16 = -13;
+
+pub const EV_ADD: u16 = 0x1;
+pub const EV_DELETE: u16 = 0x2;
+pub const EV_ENABLE: u16 = 0x4;
+pub const EV_DISABLE: u16 = 0x8;
+pub const EV_FORCEONESHOT: u16 = 0x100;
+pub const EV_KEEPUDATA: u16 = 0x200;
+
+pub const EV_ONESHOT: u16 = 0x10;
+pub const EV_CLEAR: u16 = 0x20;
+pub const EV_RECEIPT: u16 = 0x40;
+pub const EV_DISPATCH: u16 = 0x80;
+pub const EV_SYSFLAGS: u16 = 0xf000;
+pub const EV_DROP: u16 = 0x1000;
+pub const EV_FLAG1: u16 = 0x2000;
+pub const EV_FLAG2: u16 = 0x4000;
+
+pub const EV_EOF: u16 = 0x8000;
+pub const EV_ERROR: u16 = 0x4000;
+
+pub const NOTE_TRIGGER: u32 = 0x01000000;
+pub const NOTE_FFNOP: u32 = 0x00000000;
+pub const NOTE_FFAND: u32 = 0x40000000;
+pub const NOTE_FFOR: u32 = 0x80000000;
+pub const NOTE_FFCOPY: u32 = 0xc0000000;
+pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
+pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
+pub const NOTE_LOWAT: u32 = 0x00000001;
+pub const NOTE_FILE_POLL: u32 = 0x00000002;
+pub const NOTE_DELETE: u32 = 0x00000001;
+pub const NOTE_WRITE: u32 = 0x00000002;
+pub const NOTE_EXTEND: u32 = 0x00000004;
+pub const NOTE_ATTRIB: u32 = 0x00000008;
+pub const NOTE_LINK: u32 = 0x00000010;
+pub const NOTE_RENAME: u32 = 0x00000020;
+pub const NOTE_REVOKE: u32 = 0x00000040;
+pub const NOTE_OPEN: u32 = 0x00000080;
+pub const NOTE_CLOSE: u32 = 0x00000100;
+pub const NOTE_CLOSE_WRITE: u32 = 0x00000200;
+pub const NOTE_READ: u32 = 0x00000400;
+pub const NOTE_EXIT: u32 = 0x80000000;
+pub const NOTE_FORK: u32 = 0x40000000;
+pub const NOTE_EXEC: u32 = 0x20000000;
+pub const NOTE_PDATAMASK: u32 = 0x000fffff;
+pub const NOTE_PCTRLMASK: u32 = 0xf0000000;
+pub const NOTE_TRACK: u32 = 0x00000001;
+pub const NOTE_TRACKERR: u32 = 0x00000002;
+pub const NOTE_CHILD: u32 = 0x00000004;
+pub const NOTE_SECONDS: u32 = 0x00000001;
+pub const NOTE_MSECONDS: u32 = 0x00000002;
+pub const NOTE_USECONDS: u32 = 0x00000004;
+pub const NOTE_NSECONDS: u32 = 0x00000008;
+pub const NOTE_ABSTIME: u32 = 0x00000010;
+
+pub const MADV_PROTECT: ::c_int = 10;
+
+#[doc(hidden)]
+#[deprecated(
+    since = "0.2.72",
+    note = "CTL_UNSPEC is deprecated. Use CTL_SYSCTL instead"
+)]
+pub const CTL_UNSPEC: ::c_int = 0;
+pub const CTL_SYSCTL: ::c_int = 0;
+pub const CTL_KERN: ::c_int = 1;
+pub const CTL_VM: ::c_int = 2;
+pub const CTL_VFS: ::c_int = 3;
+pub const CTL_NET: ::c_int = 4;
+pub const CTL_DEBUG: ::c_int = 5;
+pub const CTL_HW: ::c_int = 6;
+pub const CTL_MACHDEP: ::c_int = 7;
+pub const CTL_USER: ::c_int = 8;
+pub const CTL_P1003_1B: ::c_int = 9;
+
+// sys/sysctl.h
+pub const CTL_MAXNAME: ::c_int = 24;
+
+pub const CTLTYPE: ::c_int = 0xf;
+pub const CTLTYPE_NODE: ::c_int = 1;
+pub const CTLTYPE_INT: ::c_int = 2;
+pub const CTLTYPE_STRING: ::c_int = 3;
+pub const CTLTYPE_S64: ::c_int = 4;
+pub const CTLTYPE_OPAQUE: ::c_int = 5;
+pub const CTLTYPE_STRUCT: ::c_int = CTLTYPE_OPAQUE;
+pub const CTLTYPE_UINT: ::c_int = 6;
+pub const CTLTYPE_LONG: ::c_int = 7;
+pub const CTLTYPE_ULONG: ::c_int = 8;
+pub const CTLTYPE_U64: ::c_int = 9;
+pub const CTLTYPE_U8: ::c_int = 0xa;
+pub const CTLTYPE_U16: ::c_int = 0xb;
+pub const CTLTYPE_S8: ::c_int = 0xc;
+pub const CTLTYPE_S16: ::c_int = 0xd;
+pub const CTLTYPE_S32: ::c_int = 0xe;
+pub const CTLTYPE_U32: ::c_int = 0xf;
+
+pub const CTLFLAG_RD: ::c_int = 0x80000000;
+pub const CTLFLAG_WR: ::c_int = 0x40000000;
+pub const CTLFLAG_RW: ::c_int = CTLFLAG_RD | CTLFLAG_WR;
+pub const CTLFLAG_DORMANT: ::c_int = 0x20000000;
+pub const CTLFLAG_ANYBODY: ::c_int = 0x10000000;
+pub const CTLFLAG_SECURE: ::c_int = 0x08000000;
+pub const CTLFLAG_PRISON: ::c_int = 0x04000000;
+pub const CTLFLAG_DYN: ::c_int = 0x02000000;
+pub const CTLFLAG_SKIP: ::c_int = 0x01000000;
+pub const CTLMASK_SECURE: ::c_int = 0x00F00000;
+pub const CTLFLAG_TUN: ::c_int = 0x00080000;
+pub const CTLFLAG_RDTUN: ::c_int = CTLFLAG_RD | CTLFLAG_TUN;
+pub const CTLFLAG_RWTUN: ::c_int = CTLFLAG_RW | CTLFLAG_TUN;
+pub const CTLFLAG_MPSAFE: ::c_int = 0x00040000;
+pub const CTLFLAG_VNET: ::c_int = 0x00020000;
+pub const CTLFLAG_DYING: ::c_int = 0x00010000;
+pub const CTLFLAG_CAPRD: ::c_int = 0x00008000;
+pub const CTLFLAG_CAPWR: ::c_int = 0x00004000;
+pub const CTLFLAG_STATS: ::c_int = 0x00002000;
+pub const CTLFLAG_NOFETCH: ::c_int = 0x00001000;
+pub const CTLFLAG_CAPRW: ::c_int = CTLFLAG_CAPRD | CTLFLAG_CAPWR;
+pub const CTLFLAG_NEEDGIANT: ::c_int = 0x00000800;
+
+pub const CTLSHIFT_SECURE: ::c_int = 20;
+pub const CTLFLAG_SECURE1: ::c_int = CTLFLAG_SECURE | (0 << CTLSHIFT_SECURE);
+pub const CTLFLAG_SECURE2: ::c_int = CTLFLAG_SECURE | (1 << CTLSHIFT_SECURE);
+pub const CTLFLAG_SECURE3: ::c_int = CTLFLAG_SECURE | (2 << CTLSHIFT_SECURE);
+
+pub const OID_AUTO: ::c_int = -1;
+
+pub const CTL_SYSCTL_DEBUG: ::c_int = 0;
+pub const CTL_SYSCTL_NAME: ::c_int = 1;
+pub const CTL_SYSCTL_NEXT: ::c_int = 2;
+pub const CTL_SYSCTL_NAME2OID: ::c_int = 3;
+pub const CTL_SYSCTL_OIDFMT: ::c_int = 4;
+pub const CTL_SYSCTL_OIDDESCR: ::c_int = 5;
+pub const CTL_SYSCTL_OIDLABEL: ::c_int = 6;
+pub const CTL_SYSCTL_NEXTNOSKIP: ::c_int = 7;
+
+pub const KERN_OSTYPE: ::c_int = 1;
+pub const KERN_OSRELEASE: ::c_int = 2;
+pub const KERN_OSREV: ::c_int = 3;
+pub const KERN_VERSION: ::c_int = 4;
+pub const KERN_MAXVNODES: ::c_int = 5;
+pub const KERN_MAXPROC: ::c_int = 6;
+pub const KERN_MAXFILES: ::c_int = 7;
+pub const KERN_ARGMAX: ::c_int = 8;
+pub const KERN_SECURELVL: ::c_int = 9;
+pub const KERN_HOSTNAME: ::c_int = 10;
+pub const KERN_HOSTID: ::c_int = 11;
+pub const KERN_CLOCKRATE: ::c_int = 12;
+pub const KERN_VNODE: ::c_int = 13;
+pub const KERN_PROC: ::c_int = 14;
+pub const KERN_FILE: ::c_int = 15;
+pub const KERN_PROF: ::c_int = 16;
+pub const KERN_POSIX1: ::c_int = 17;
+pub const KERN_NGROUPS: ::c_int = 18;
+pub const KERN_JOB_CONTROL: ::c_int = 19;
+pub const KERN_SAVED_IDS: ::c_int = 20;
+pub const KERN_BOOTTIME: ::c_int = 21;
+pub const KERN_NISDOMAINNAME: ::c_int = 22;
+pub const KERN_UPDATEINTERVAL: ::c_int = 23;
+pub const KERN_OSRELDATE: ::c_int = 24;
+pub const KERN_NTP_PLL: ::c_int = 25;
+pub const KERN_BOOTFILE: ::c_int = 26;
+pub const KERN_MAXFILESPERPROC: ::c_int = 27;
+pub const KERN_MAXPROCPERUID: ::c_int = 28;
+pub const KERN_DUMPDEV: ::c_int = 29;
+pub const KERN_IPC: ::c_int = 30;
+pub const KERN_DUMMY: ::c_int = 31;
+pub const KERN_PS_STRINGS: ::c_int = 32;
+pub const KERN_USRSTACK: ::c_int = 33;
+pub const KERN_LOGSIGEXIT: ::c_int = 34;
+pub const KERN_IOV_MAX: ::c_int = 35;
+pub const KERN_HOSTUUID: ::c_int = 36;
+pub const KERN_ARND: ::c_int = 37;
+pub const KERN_MAXPHYS: ::c_int = 38;
+
+pub const KERN_PROC_ALL: ::c_int = 0;
+pub const KERN_PROC_PID: ::c_int = 1;
+pub const KERN_PROC_PGRP: ::c_int = 2;
+pub const KERN_PROC_SESSION: ::c_int = 3;
+pub const KERN_PROC_TTY: ::c_int = 4;
+pub const KERN_PROC_UID: ::c_int = 5;
+pub const KERN_PROC_RUID: ::c_int = 6;
+pub const KERN_PROC_ARGS: ::c_int = 7;
+pub const KERN_PROC_PROC: ::c_int = 8;
+pub const KERN_PROC_SV_NAME: ::c_int = 9;
+pub const KERN_PROC_RGID: ::c_int = 10;
+pub const KERN_PROC_GID: ::c_int = 11;
+pub const KERN_PROC_PATHNAME: ::c_int = 12;
+pub const KERN_PROC_OVMMAP: ::c_int = 13;
+pub const KERN_PROC_OFILEDESC: ::c_int = 14;
+pub const KERN_PROC_KSTACK: ::c_int = 15;
+pub const KERN_PROC_INC_THREAD: ::c_int = 0x10;
+pub const KERN_PROC_VMMAP: ::c_int = 32;
+pub const KERN_PROC_FILEDESC: ::c_int = 33;
+pub const KERN_PROC_GROUPS: ::c_int = 34;
+pub const KERN_PROC_ENV: ::c_int = 35;
+pub const KERN_PROC_AUXV: ::c_int = 36;
+pub const KERN_PROC_RLIMIT: ::c_int = 37;
+pub const KERN_PROC_PS_STRINGS: ::c_int = 38;
+pub const KERN_PROC_UMASK: ::c_int = 39;
+pub const KERN_PROC_OSREL: ::c_int = 40;
+pub const KERN_PROC_SIGTRAMP: ::c_int = 41;
+pub const KERN_PROC_CWD: ::c_int = 42;
+pub const KERN_PROC_NFDS: ::c_int = 43;
+pub const KERN_PROC_SIGFASTBLK: ::c_int = 44;
+
+pub const KIPC_MAXSOCKBUF: ::c_int = 1;
+pub const KIPC_SOCKBUF_WASTE: ::c_int = 2;
+pub const KIPC_SOMAXCONN: ::c_int = 3;
+pub const KIPC_MAX_LINKHDR: ::c_int = 4;
+pub const KIPC_MAX_PROTOHDR: ::c_int = 5;
+pub const KIPC_MAX_HDR: ::c_int = 6;
+pub const KIPC_MAX_DATALEN: ::c_int = 7;
+
+pub const HW_MACHINE: ::c_int = 1;
+pub const HW_MODEL: ::c_int = 2;
+pub const HW_NCPU: ::c_int = 3;
+pub const HW_BYTEORDER: ::c_int = 4;
+pub const HW_PHYSMEM: ::c_int = 5;
+pub const HW_USERMEM: ::c_int = 6;
+pub const HW_PAGESIZE: ::c_int = 7;
+pub const HW_DISKNAMES: ::c_int = 8;
+pub const HW_DISKSTATS: ::c_int = 9;
+pub const HW_FLOATINGPT: ::c_int = 10;
+pub const HW_MACHINE_ARCH: ::c_int = 11;
+pub const HW_REALMEM: ::c_int = 12;
+
+pub const USER_CS_PATH: ::c_int = 1;
+pub const USER_BC_BASE_MAX: ::c_int = 2;
+pub const USER_BC_DIM_MAX: ::c_int = 3;
+pub const USER_BC_SCALE_MAX: ::c_int = 4;
+pub const USER_BC_STRING_MAX: ::c_int = 5;
+pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6;
+pub const USER_EXPR_NEST_MAX: ::c_int = 7;
+pub const USER_LINE_MAX: ::c_int = 8;
+pub const USER_RE_DUP_MAX: ::c_int = 9;
+pub const USER_POSIX2_VERSION: ::c_int = 10;
+pub const USER_POSIX2_C_BIND: ::c_int = 11;
+pub const USER_POSIX2_C_DEV: ::c_int = 12;
+pub const USER_POSIX2_CHAR_TERM: ::c_int = 13;
+pub const USER_POSIX2_FORT_DEV: ::c_int = 14;
+pub const USER_POSIX2_FORT_RUN: ::c_int = 15;
+pub const USER_POSIX2_LOCALEDEF: ::c_int = 16;
+pub const USER_POSIX2_SW_DEV: ::c_int = 17;
+pub const USER_POSIX2_UPE: ::c_int = 18;
+pub const USER_STREAM_MAX: ::c_int = 19;
+pub const USER_TZNAME_MAX: ::c_int = 20;
+pub const USER_LOCALBASE: ::c_int = 21;
+
+pub const CTL_P1003_1B_ASYNCHRONOUS_IO: ::c_int = 1;
+pub const CTL_P1003_1B_MAPPED_FILES: ::c_int = 2;
+pub const CTL_P1003_1B_MEMLOCK: ::c_int = 3;
+pub const CTL_P1003_1B_MEMLOCK_RANGE: ::c_int = 4;
+pub const CTL_P1003_1B_MEMORY_PROTECTION: ::c_int = 5;
+pub const CTL_P1003_1B_MESSAGE_PASSING: ::c_int = 6;
+pub const CTL_P1003_1B_PRIORITIZED_IO: ::c_int = 7;
+pub const CTL_P1003_1B_PRIORITY_SCHEDULING: ::c_int = 8;
+pub const CTL_P1003_1B_REALTIME_SIGNALS: ::c_int = 9;
+pub const CTL_P1003_1B_SEMAPHORES: ::c_int = 10;
+pub const CTL_P1003_1B_FSYNC: ::c_int = 11;
+pub const CTL_P1003_1B_SHARED_MEMORY_OBJECTS: ::c_int = 12;
+pub const CTL_P1003_1B_SYNCHRONIZED_IO: ::c_int = 13;
+pub const CTL_P1003_1B_TIMERS: ::c_int = 14;
+pub const CTL_P1003_1B_AIO_LISTIO_MAX: ::c_int = 15;
+pub const CTL_P1003_1B_AIO_MAX: ::c_int = 16;
+pub const CTL_P1003_1B_AIO_PRIO_DELTA_MAX: ::c_int = 17;
+pub const CTL_P1003_1B_DELAYTIMER_MAX: ::c_int = 18;
+pub const CTL_P1003_1B_MQ_OPEN_MAX: ::c_int = 19;
+pub const CTL_P1003_1B_PAGESIZE: ::c_int = 20;
+pub const CTL_P1003_1B_RTSIG_MAX: ::c_int = 21;
+pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22;
+pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23;
+pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24;
+pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25;
+
+pub const TIOCGPTN: ::c_ulong = 0x4004740f;
+pub const TIOCPTMASTER: ::c_ulong = 0x2000741c;
+pub const TIOCSIG: ::c_ulong = 0x2004745f;
+pub const TIOCM_DCD: ::c_int = 0x40;
+pub const H4DISC: ::c_int = 0x7;
+
+pub const VM_TOTAL: ::c_int = 1;
+
+pub const BIOCSETFNR: ::c_ulong = 0x80104282;
+
+pub const FIODGNAME: ::c_ulong = 0x80106678;
+pub const FIONWRITE: ::c_ulong = 0x40046677;
+pub const FIONSPACE: ::c_ulong = 0x40046676;
+pub const FIOSEEKDATA: ::c_ulong = 0xc0086661;
+pub const FIOSEEKHOLE: ::c_ulong = 0xc0086662;
+pub const FIOSSHMLPGCNF: ::c_ulong = 0x80306664;
+
+pub const JAIL_API_VERSION: u32 = 2;
+pub const JAIL_CREATE: ::c_int = 0x01;
+pub const JAIL_UPDATE: ::c_int = 0x02;
+pub const JAIL_ATTACH: ::c_int = 0x04;
+pub const JAIL_DYING: ::c_int = 0x08;
+pub const JAIL_SET_MASK: ::c_int = 0x0f;
+pub const JAIL_GET_MASK: ::c_int = 0x08;
+pub const JAIL_SYS_DISABLE: ::c_int = 0;
+pub const JAIL_SYS_NEW: ::c_int = 1;
+pub const JAIL_SYS_INHERIT: ::c_int = 2;
+
+pub const MNT_ACLS: ::c_int = 0x08000000;
+pub const MNT_BYFSID: ::c_int = 0x08000000;
+pub const MNT_GJOURNAL: ::c_int = 0x02000000;
+pub const MNT_MULTILABEL: ::c_int = 0x04000000;
+pub const MNT_NFS4ACLS: ::c_int = 0x00000010;
+pub const MNT_SNAPSHOT: ::c_int = 0x01000000;
+pub const MNT_UNION: ::c_int = 0x00000020;
+pub const MNT_NONBUSY: ::c_int = 0x04000000;
+
+pub const SCM_BINTIME: ::c_int = 0x04;
+pub const SCM_REALTIME: ::c_int = 0x05;
+pub const SCM_MONOTONIC: ::c_int = 0x06;
+pub const SCM_TIME_INFO: ::c_int = 0x07;
+pub const SCM_CREDS2: ::c_int = 0x08;
+
+pub const SO_BINTIME: ::c_int = 0x2000;
+pub const SO_NO_OFFLOAD: ::c_int = 0x4000;
+pub const SO_NO_DDP: ::c_int = 0x8000;
+pub const SO_REUSEPORT_LB: ::c_int = 0x10000;
+pub const SO_LABEL: ::c_int = 0x1009;
+pub const SO_PEERLABEL: ::c_int = 0x1010;
+pub const SO_LISTENQLIMIT: ::c_int = 0x1011;
+pub const SO_LISTENQLEN: ::c_int = 0x1012;
+pub const SO_LISTENINCQLEN: ::c_int = 0x1013;
+pub const SO_SETFIB: ::c_int = 0x1014;
+pub const SO_USER_COOKIE: ::c_int = 0x1015;
+pub const SO_PROTOCOL: ::c_int = 0x1016;
+pub const SO_PROTOTYPE: ::c_int = SO_PROTOCOL;
+pub const SO_TS_CLOCK: ::c_int = 0x1017;
+pub const SO_DOMAIN: ::c_int = 0x1019;
+pub const SO_VENDOR: ::c_int = 0x80000000;
+
+pub const SO_TS_REALTIME_MICRO: ::c_int = 0;
+pub const SO_TS_BINTIME: ::c_int = 1;
+pub const SO_TS_REALTIME: ::c_int = 2;
+pub const SO_TS_MONOTONIC: ::c_int = 3;
+pub const SO_TS_DEFAULT: ::c_int = SO_TS_REALTIME_MICRO;
+pub const SO_TS_CLOCK_MAX: ::c_int = SO_TS_MONOTONIC;
+
+pub const LOCAL_CREDS: ::c_int = 2;
+pub const LOCAL_CREDS_PERSISTENT: ::c_int = 3;
+pub const LOCAL_CONNWAIT: ::c_int = 4;
+pub const LOCAL_VENDOR: ::c_int = SO_VENDOR;
+
+pub const PL_EVENT_NONE: ::c_int = 0;
+pub const PL_EVENT_SIGNAL: ::c_int = 1;
+pub const PL_FLAG_SA: ::c_int = 0x01;
+pub const PL_FLAG_BOUND: ::c_int = 0x02;
+pub const PL_FLAG_SCE: ::c_int = 0x04;
+pub const PL_FLAG_SCX: ::c_int = 0x08;
+pub const PL_FLAG_EXEC: ::c_int = 0x10;
+pub const PL_FLAG_SI: ::c_int = 0x20;
+pub const PL_FLAG_FORKED: ::c_int = 0x40;
+pub const PL_FLAG_CHILD: ::c_int = 0x80;
+pub const PL_FLAG_BORN: ::c_int = 0x100;
+pub const PL_FLAG_EXITED: ::c_int = 0x200;
+pub const PL_FLAG_VFORKED: ::c_int = 0x400;
+pub const PL_FLAG_VFORK_DONE: ::c_int = 0x800;
+
+pub const PT_LWPINFO: ::c_int = 13;
+pub const PT_GETNUMLWPS: ::c_int = 14;
+pub const PT_GETLWPLIST: ::c_int = 15;
+pub const PT_CLEARSTEP: ::c_int = 16;
+pub const PT_SETSTEP: ::c_int = 17;
+pub const PT_SUSPEND: ::c_int = 18;
+pub const PT_RESUME: ::c_int = 19;
+pub const PT_TO_SCE: ::c_int = 20;
+pub const PT_TO_SCX: ::c_int = 21;
+pub const PT_SYSCALL: ::c_int = 22;
+pub const PT_FOLLOW_FORK: ::c_int = 23;
+pub const PT_LWP_EVENTS: ::c_int = 24;
+pub const PT_GET_EVENT_MASK: ::c_int = 25;
+pub const PT_SET_EVENT_MASK: ::c_int = 26;
+pub const PT_GET_SC_ARGS: ::c_int = 27;
+pub const PT_GET_SC_RET: ::c_int = 28;
+pub const PT_COREDUMP: ::c_int = 29;
+pub const PT_GETREGS: ::c_int = 33;
+pub const PT_SETREGS: ::c_int = 34;
+pub const PT_GETFPREGS: ::c_int = 35;
+pub const PT_SETFPREGS: ::c_int = 36;
+pub const PT_GETDBREGS: ::c_int = 37;
+pub const PT_SETDBREGS: ::c_int = 38;
+pub const PT_VM_TIMESTAMP: ::c_int = 40;
+pub const PT_VM_ENTRY: ::c_int = 41;
+pub const PT_GETREGSET: ::c_int = 42;
+pub const PT_SETREGSET: ::c_int = 43;
+pub const PT_SC_REMOTE: ::c_int = 44;
+pub const PT_FIRSTMACH: ::c_int = 64;
+
+pub const PTRACE_EXEC: ::c_int = 0x0001;
+pub const PTRACE_SCE: ::c_int = 0x0002;
+pub const PTRACE_SCX: ::c_int = 0x0004;
+pub const PTRACE_SYSCALL: ::c_int = PTRACE_SCE | PTRACE_SCX;
+pub const PTRACE_FORK: ::c_int = 0x0008;
+pub const PTRACE_LWP: ::c_int = 0x0010;
+pub const PTRACE_VFORK: ::c_int = 0x0020;
+pub const PTRACE_DEFAULT: ::c_int = PTRACE_EXEC;
+
+pub const PC_COMPRESS: u32 = 0x00000001;
+pub const PC_ALL: u32 = 0x00000002;
+
+pub const PROC_SPROTECT: ::c_int = 1;
+pub const PROC_REAP_ACQUIRE: ::c_int = 2;
+pub const PROC_REAP_RELEASE: ::c_int = 3;
+pub const PROC_REAP_STATUS: ::c_int = 4;
+pub const PROC_REAP_GETPIDS: ::c_int = 5;
+pub const PROC_REAP_KILL: ::c_int = 6;
+pub const PROC_TRACE_CTL: ::c_int = 7;
+pub const PROC_TRACE_STATUS: ::c_int = 8;
+pub const PROC_TRAPCAP_CTL: ::c_int = 9;
+pub const PROC_TRAPCAP_STATUS: ::c_int = 10;
+pub const PROC_PDEATHSIG_CTL: ::c_int = 11;
+pub const PROC_PDEATHSIG_STATUS: ::c_int = 12;
+pub const PROC_ASLR_CTL: ::c_int = 13;
+pub const PROC_ASLR_STATUS: ::c_int = 14;
+pub const PROC_PROTMAX_CTL: ::c_int = 15;
+pub const PROC_PROTMAX_STATUS: ::c_int = 16;
+pub const PROC_STACKGAP_CTL: ::c_int = 17;
+pub const PROC_STACKGAP_STATUS: ::c_int = 18;
+pub const PROC_NO_NEW_PRIVS_CTL: ::c_int = 19;
+pub const PROC_NO_NEW_PRIVS_STATUS: ::c_int = 20;
+pub const PROC_WXMAP_CTL: ::c_int = 21;
+pub const PROC_WXMAP_STATUS: ::c_int = 22;
+pub const PROC_PROCCTL_MD_MIN: ::c_int = 0x10000000;
+
+pub const PPROT_SET: ::c_int = 1;
+pub const PPROT_CLEAR: ::c_int = 2;
+pub const PPROT_DESCEND: ::c_int = 0x10;
+pub const PPROT_INHERIT: ::c_int = 0x20;
+
+pub const PROC_TRACE_CTL_ENABLE: ::c_int = 1;
+pub const PROC_TRACE_CTL_DISABLE: ::c_int = 2;
+pub const PROC_TRACE_CTL_DISABLE_EXEC: ::c_int = 3;
+
+pub const PROC_TRAPCAP_CTL_ENABLE: ::c_int = 1;
+pub const PROC_TRAPCAP_CTL_DISABLE: ::c_int = 2;
+
+pub const PROC_ASLR_FORCE_ENABLE: ::c_int = 1;
+pub const PROC_ASLR_FORCE_DISABLE: ::c_int = 2;
+pub const PROC_ASLR_NOFORCE: ::c_int = 3;
+pub const PROC_ASLR_ACTIVE: ::c_int = 0x80000000;
+
+pub const PROC_PROTMAX_FORCE_ENABLE: ::c_int = 1;
+pub const PROC_PROTMAX_FORCE_DISABLE: ::c_int = 2;
+pub const PROC_PROTMAX_NOFORCE: ::c_int = 3;
+pub const PROC_PROTMAX_ACTIVE: ::c_int = 0x80000000;
+
+pub const PROC_STACKGAP_ENABLE: ::c_int = 0x0001;
+pub const PROC_STACKGAP_DISABLE: ::c_int = 0x0002;
+pub const PROC_STACKGAP_ENABLE_EXEC: ::c_int = 0x0004;
+pub const PROC_STACKGAP_DISABLE_EXEC: ::c_int = 0x0008;
+
+pub const PROC_NO_NEW_PRIVS_ENABLE: ::c_int = 1;
+pub const PROC_NO_NEW_PRIVS_DISABLE: ::c_int = 2;
+
+pub const PROC_WX_MAPPINGS_PERMIT: ::c_int = 0x0001;
+pub const PROC_WX_MAPPINGS_DISALLOW_EXEC: ::c_int = 0x0002;
+pub const PROC_WXORX_ENFORCE: ::c_int = 0x80000000;
+
+pub const AF_SLOW: ::c_int = 33;
+pub const AF_SCLUSTER: ::c_int = 34;
+pub const AF_ARP: ::c_int = 35;
+pub const AF_BLUETOOTH: ::c_int = 36;
+pub const AF_IEEE80211: ::c_int = 37;
+pub const AF_INET_SDP: ::c_int = 40;
+pub const AF_INET6_SDP: ::c_int = 42;
+
+// sys/net/if.h
+pub const IF_MAXUNIT: ::c_int = 0x7fff;
+/// (n) interface is up
+pub const IFF_UP: ::c_int = 0x1;
+/// (i) broadcast address valid
+pub const IFF_BROADCAST: ::c_int = 0x2;
+/// (n) turn on debugging
+pub const IFF_DEBUG: ::c_int = 0x4;
+/// (i) is a loopback net
+pub const IFF_LOOPBACK: ::c_int = 0x8;
+/// (i) is a point-to-point link
+pub const IFF_POINTOPOINT: ::c_int = 0x10;
+/// (i) calls if_input in net epoch
+#[deprecated(since = "0.2.149", note = "Removed in FreeBSD 14")]
+pub const IFF_KNOWSEPOCH: ::c_int = 0x20;
+/// (d) resources allocated
+pub const IFF_RUNNING: ::c_int = 0x40;
+#[doc(hidden)]
+#[deprecated(
+    since = "0.2.54",
+    note = "IFF_DRV_RUNNING is deprecated. Use the portable IFF_RUNNING instead"
+)]
+/// (d) resources allocate
+pub const IFF_DRV_RUNNING: ::c_int = 0x40;
+/// (n) no address resolution protocol
+pub const IFF_NOARP: ::c_int = 0x80;
+/// (n) receive all packets
+pub const IFF_PROMISC: ::c_int = 0x100;
+/// (n) receive all multicast packets
+pub const IFF_ALLMULTI: ::c_int = 0x200;
+/// (d) tx hardware queue is full
+pub const IFF_OACTIVE: ::c_int = 0x400;
+#[doc(hidden)]
+#[deprecated(since = "0.2.54", note = "Use the portable `IFF_OACTIVE` instead")]
+/// (d) tx hardware queue is full
+pub const IFF_DRV_OACTIVE: ::c_int = 0x400;
+/// (i) can't hear own transmissions
+pub const IFF_SIMPLEX: ::c_int = 0x800;
+/// per link layer defined bit
+pub const IFF_LINK0: ::c_int = 0x1000;
+/// per link layer defined bit
+pub const IFF_LINK1: ::c_int = 0x2000;
+/// per link layer defined bit
+pub const IFF_LINK2: ::c_int = 0x4000;
+/// use alternate physical connection
+pub const IFF_ALTPHYS: ::c_int = IFF_LINK2;
+/// (i) supports multicast
+pub const IFF_MULTICAST: ::c_int = 0x8000;
+/// (i) unconfigurable using ioctl(2)
+pub const IFF_CANTCONFIG: ::c_int = 0x10000;
+/// (n) user-requested promisc mode
+pub const IFF_PPROMISC: ::c_int = 0x20000;
+/// (n) user-requested monitor mode
+pub const IFF_MONITOR: ::c_int = 0x40000;
+/// (n) static ARP
+pub const IFF_STATICARP: ::c_int = 0x80000;
+/// (n) interface is winding down
+pub const IFF_DYING: ::c_int = 0x200000;
+/// (n) interface is being renamed
+pub const IFF_RENAMING: ::c_int = 0x400000;
+/// interface is not part of any groups
+#[deprecated(since = "0.2.149", note = "Removed in FreeBSD 14")]
+pub const IFF_NOGROUP: ::c_int = 0x800000;
+
+/// link invalid/unknown
+pub const LINK_STATE_UNKNOWN: ::c_int = 0;
+/// link is down
+pub const LINK_STATE_DOWN: ::c_int = 1;
+/// link is up
+pub const LINK_STATE_UP: ::c_int = 2;
+
+/// can offload checksum on RX
+pub const IFCAP_RXCSUM: ::c_int = 0x00001;
+/// can offload checksum on TX
+pub const IFCAP_TXCSUM: ::c_int = 0x00002;
+/// can be a network console
+pub const IFCAP_NETCONS: ::c_int = 0x00004;
+/// VLAN-compatible MTU
+pub const IFCAP_VLAN_MTU: ::c_int = 0x00008;
+/// hardware VLAN tag support
+pub const IFCAP_VLAN_HWTAGGING: ::c_int = 0x00010;
+/// 9000 byte MTU supported
+pub const IFCAP_JUMBO_MTU: ::c_int = 0x00020;
+/// driver supports polling
+pub const IFCAP_POLLING: ::c_int = 0x00040;
+/// can do IFCAP_HWCSUM on VLANs
+pub const IFCAP_VLAN_HWCSUM: ::c_int = 0x00080;
+/// can do TCP Segmentation Offload
+pub const IFCAP_TSO4: ::c_int = 0x00100;
+/// can do TCP6 Segmentation Offload
+pub const IFCAP_TSO6: ::c_int = 0x00200;
+/// can do Large Receive Offload
+pub const IFCAP_LRO: ::c_int = 0x00400;
+/// wake on any unicast frame
+pub const IFCAP_WOL_UCAST: ::c_int = 0x00800;
+/// wake on any multicast frame
+pub const IFCAP_WOL_MCAST: ::c_int = 0x01000;
+/// wake on any Magic Packet
+pub const IFCAP_WOL_MAGIC: ::c_int = 0x02000;
+/// interface can offload TCP
+pub const IFCAP_TOE4: ::c_int = 0x04000;
+/// interface can offload TCP6
+pub const IFCAP_TOE6: ::c_int = 0x08000;
+/// interface hw can filter vlan tag
+pub const IFCAP_VLAN_HWFILTER: ::c_int = 0x10000;
+/// can do SIOCGIFCAPNV/SIOCSIFCAPNV
+pub const IFCAP_NV: ::c_int = 0x20000;
+/// can do IFCAP_TSO on VLANs
+pub const IFCAP_VLAN_HWTSO: ::c_int = 0x40000;
+/// the runtime link state is dynamic
+pub const IFCAP_LINKSTATE: ::c_int = 0x80000;
+/// netmap mode supported/enabled
+pub const IFCAP_NETMAP: ::c_int = 0x100000;
+/// can offload checksum on IPv6 RX
+pub const IFCAP_RXCSUM_IPV6: ::c_int = 0x200000;
+/// can offload checksum on IPv6 TX
+pub const IFCAP_TXCSUM_IPV6: ::c_int = 0x400000;
+/// manages counters internally
+pub const IFCAP_HWSTATS: ::c_int = 0x800000;
+/// hardware supports TX rate limiting
+pub const IFCAP_TXRTLMT: ::c_int = 0x1000000;
+/// hardware rx timestamping
+pub const IFCAP_HWRXTSTMP: ::c_int = 0x2000000;
+/// understands M_EXTPG mbufs
+pub const IFCAP_MEXTPG: ::c_int = 0x4000000;
+/// can do TLS encryption and segmentation for TCP
+pub const IFCAP_TXTLS4: ::c_int = 0x8000000;
+/// can do TLS encryption and segmentation for TCP6
+pub const IFCAP_TXTLS6: ::c_int = 0x10000000;
+/// can do IFCAN_HWCSUM on VXLANs
+pub const IFCAP_VXLAN_HWCSUM: ::c_int = 0x20000000;
+/// can do IFCAP_TSO on VXLANs
+pub const IFCAP_VXLAN_HWTSO: ::c_int = 0x40000000;
+/// can do TLS with rate limiting
+pub const IFCAP_TXTLS_RTLMT: ::c_int = 0x80000000;
+
+pub const IFCAP_HWCSUM_IPV6: ::c_int = IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6;
+pub const IFCAP_HWCSUM: ::c_int = IFCAP_RXCSUM | IFCAP_TXCSUM;
+pub const IFCAP_TSO: ::c_int = IFCAP_TSO4 | IFCAP_TSO6;
+pub const IFCAP_WOL: ::c_int = IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC;
+pub const IFCAP_TOE: ::c_int = IFCAP_TOE4 | IFCAP_TOE6;
+pub const IFCAP_TXTLS: ::c_int = IFCAP_TXTLS4 | IFCAP_TXTLS6;
+pub const IFCAP_CANTCHANGE: ::c_int = IFCAP_NETMAP | IFCAP_NV;
+
+pub const IFQ_MAXLEN: ::c_int = 50;
+pub const IFNET_SLOWHZ: ::c_int = 1;
+
+pub const IFAN_ARRIVAL: ::c_int = 0;
+pub const IFAN_DEPARTURE: ::c_int = 1;
+
+pub const IFSTATMAX: ::c_int = 800;
+
+pub const RSS_FUNC_NONE: ::c_int = 0;
+pub const RSS_FUNC_PRIVATE: ::c_int = 1;
+pub const RSS_FUNC_TOEPLITZ: ::c_int = 2;
+
+pub const RSS_TYPE_IPV4: ::c_int = 0x00000001;
+pub const RSS_TYPE_TCP_IPV4: ::c_int = 0x00000002;
+pub const RSS_TYPE_IPV6: ::c_int = 0x00000004;
+pub const RSS_TYPE_IPV6_EX: ::c_int = 0x00000008;
+pub const RSS_TYPE_TCP_IPV6: ::c_int = 0x00000010;
+pub const RSS_TYPE_TCP_IPV6_EX: ::c_int = 0x00000020;
+pub const RSS_TYPE_UDP_IPV4: ::c_int = 0x00000040;
+pub const RSS_TYPE_UDP_IPV6: ::c_int = 0x00000080;
+pub const RSS_TYPE_UDP_IPV6_EX: ::c_int = 0x00000100;
+pub const RSS_KEYLEN: ::c_int = 128;
+
+pub const IFNET_PCP_NONE: ::c_int = 0xff;
+pub const IFDR_MSG_SIZE: ::c_int = 64;
+pub const IFDR_REASON_MSG: ::c_int = 1;
+pub const IFDR_REASON_VENDOR: ::c_int = 2;
+
+// sys/net/if_mib.h
+
+/// non-interface-specific
+pub const IFMIB_SYSTEM: ::c_int = 1;
+/// per-interface data table
+pub const IFMIB_IFDATA: ::c_int = 2;
+
+/// generic stats for all kinds of ifaces
+pub const IFDATA_GENERAL: ::c_int = 1;
+/// specific to the type of interface
+pub const IFDATA_LINKSPECIFIC: ::c_int = 2;
+/// driver name and unit
+pub const IFDATA_DRIVERNAME: ::c_int = 3;
+
+/// number of interfaces configured
+pub const IFMIB_IFCOUNT: ::c_int = 1;
+
+/// functions not specific to a type of iface
+pub const NETLINK_GENERIC: ::c_int = 0;
+
+pub const DOT3COMPLIANCE_STATS: ::c_int = 1;
+pub const DOT3COMPLIANCE_COLLS: ::c_int = 2;
+
+pub const dot3ChipSetAMD7990: ::c_int = 1;
+pub const dot3ChipSetAMD79900: ::c_int = 2;
+pub const dot3ChipSetAMD79C940: ::c_int = 3;
+
+pub const dot3ChipSetIntel82586: ::c_int = 1;
+pub const dot3ChipSetIntel82596: ::c_int = 2;
+pub const dot3ChipSetIntel82557: ::c_int = 3;
+
+pub const dot3ChipSetNational8390: ::c_int = 1;
+pub const dot3ChipSetNationalSonic: ::c_int = 2;
+
+pub const dot3ChipSetFujitsu86950: ::c_int = 1;
+
+pub const dot3ChipSetDigitalDC21040: ::c_int = 1;
+pub const dot3ChipSetDigitalDC21140: ::c_int = 2;
+pub const dot3ChipSetDigitalDC21041: ::c_int = 3;
+pub const dot3ChipSetDigitalDC21140A: ::c_int = 4;
+pub const dot3ChipSetDigitalDC21142: ::c_int = 5;
+
+pub const dot3ChipSetWesternDigital83C690: ::c_int = 1;
+pub const dot3ChipSetWesternDigital83C790: ::c_int = 2;
+
+// sys/netinet/in.h
+// Protocols (RFC 1700)
+// NOTE: These are in addition to the constants defined in src/unix/mod.rs
+
+// IPPROTO_IP defined in src/unix/mod.rs
+/// IP6 hop-by-hop options
+pub const IPPROTO_HOPOPTS: ::c_int = 0;
+// IPPROTO_ICMP defined in src/unix/mod.rs
+/// group mgmt protocol
+pub const IPPROTO_IGMP: ::c_int = 2;
+/// gateway^2 (deprecated)
+pub const IPPROTO_GGP: ::c_int = 3;
+/// for compatibility
+pub const IPPROTO_IPIP: ::c_int = 4;
+// IPPROTO_TCP defined in src/unix/mod.rs
+/// Stream protocol II.
+pub const IPPROTO_ST: ::c_int = 7;
+/// exterior gateway protocol
+pub const IPPROTO_EGP: ::c_int = 8;
+/// private interior gateway
+pub const IPPROTO_PIGP: ::c_int = 9;
+/// BBN RCC Monitoring
+pub const IPPROTO_RCCMON: ::c_int = 10;
+/// network voice protocol
+pub const IPPROTO_NVPII: ::c_int = 11;
+/// pup
+pub const IPPROTO_PUP: ::c_int = 12;
+/// Argus
+pub const IPPROTO_ARGUS: ::c_int = 13;
+/// EMCON
+pub const IPPROTO_EMCON: ::c_int = 14;
+/// Cross Net Debugger
+pub const IPPROTO_XNET: ::c_int = 15;
+/// Chaos
+pub const IPPROTO_CHAOS: ::c_int = 16;
+// IPPROTO_UDP defined in src/unix/mod.rs
+/// Multiplexing
+pub const IPPROTO_MUX: ::c_int = 18;
+/// DCN Measurement Subsystems
+pub const IPPROTO_MEAS: ::c_int = 19;
+/// Host Monitoring
+pub const IPPROTO_HMP: ::c_int = 20;
+/// Packet Radio Measurement
+pub const IPPROTO_PRM: ::c_int = 21;
+/// xns idp
+pub const IPPROTO_IDP: ::c_int = 22;
+/// Trunk-1
+pub const IPPROTO_TRUNK1: ::c_int = 23;
+/// Trunk-2
+pub const IPPROTO_TRUNK2: ::c_int = 24;
+/// Leaf-1
+pub const IPPROTO_LEAF1: ::c_int = 25;
+/// Leaf-2
+pub const IPPROTO_LEAF2: ::c_int = 26;
+/// Reliable Data
+pub const IPPROTO_RDP: ::c_int = 27;
+/// Reliable Transaction
+pub const IPPROTO_IRTP: ::c_int = 28;
+/// tp-4 w/ class negotiation
+pub const IPPROTO_TP: ::c_int = 29;
+/// Bulk Data Transfer
+pub const IPPROTO_BLT: ::c_int = 30;
+/// Network Services
+pub const IPPROTO_NSP: ::c_int = 31;
+/// Merit Internodal
+pub const IPPROTO_INP: ::c_int = 32;
+#[doc(hidden)]
+#[deprecated(
+    since = "0.2.72",
+    note = "IPPROTO_SEP is deprecated. Use IPPROTO_DCCP instead"
+)]
+pub const IPPROTO_SEP: ::c_int = 33;
+/// Datagram Congestion Control Protocol
+pub const IPPROTO_DCCP: ::c_int = 33;
+/// Third Party Connect
+pub const IPPROTO_3PC: ::c_int = 34;
+/// InterDomain Policy Routing
+pub const IPPROTO_IDPR: ::c_int = 35;
+/// XTP
+pub const IPPROTO_XTP: ::c_int = 36;
+/// Datagram Delivery
+pub const IPPROTO_DDP: ::c_int = 37;
+/// Control Message Transport
+pub const IPPROTO_CMTP: ::c_int = 38;
+/// TP++ Transport
+pub const IPPROTO_TPXX: ::c_int = 39;
+/// IL transport protocol
+pub const IPPROTO_IL: ::c_int = 40;
+// IPPROTO_IPV6 defined in src/unix/mod.rs
+/// Source Demand Routing
+pub const IPPROTO_SDRP: ::c_int = 42;
+/// IP6 routing header
+pub const IPPROTO_ROUTING: ::c_int = 43;
+/// IP6 fragmentation header
+pub const IPPROTO_FRAGMENT: ::c_int = 44;
+/// InterDomain Routing
+pub const IPPROTO_IDRP: ::c_int = 45;
+/// resource reservation
+pub const IPPROTO_RSVP: ::c_int = 46;
+/// General Routing Encap.
+pub const IPPROTO_GRE: ::c_int = 47;
+/// Mobile Host Routing
+pub const IPPROTO_MHRP: ::c_int = 48;
+/// BHA
+pub const IPPROTO_BHA: ::c_int = 49;
+/// IP6 Encap Sec. Payload
+pub const IPPROTO_ESP: ::c_int = 50;
+/// IP6 Auth Header
+pub const IPPROTO_AH: ::c_int = 51;
+/// Integ. Net Layer Security
+pub const IPPROTO_INLSP: ::c_int = 52;
+/// IP with encryption
+pub const IPPROTO_SWIPE: ::c_int = 53;
+/// Next Hop Resolution
+pub const IPPROTO_NHRP: ::c_int = 54;
+/// IP Mobility
+pub const IPPROTO_MOBILE: ::c_int = 55;
+/// Transport Layer Security
+pub const IPPROTO_TLSP: ::c_int = 56;
+/// SKIP
+pub const IPPROTO_SKIP: ::c_int = 57;
+// IPPROTO_ICMPV6 defined in src/unix/mod.rs
+/// IP6 no next header
+pub const IPPROTO_NONE: ::c_int = 59;
+/// IP6 destination option
+pub const IPPROTO_DSTOPTS: ::c_int = 60;
+/// any host internal protocol
+pub const IPPROTO_AHIP: ::c_int = 61;
+/// CFTP
+pub const IPPROTO_CFTP: ::c_int = 62;
+/// "hello" routing protocol
+pub const IPPROTO_HELLO: ::c_int = 63;
+/// SATNET/Backroom EXPAK
+pub const IPPROTO_SATEXPAK: ::c_int = 64;
+/// Kryptolan
+pub const IPPROTO_KRYPTOLAN: ::c_int = 65;
+/// Remote Virtual Disk
+pub const IPPROTO_RVD: ::c_int = 66;
+/// Pluribus Packet Core
+pub const IPPROTO_IPPC: ::c_int = 67;
+/// Any distributed FS
+pub const IPPROTO_ADFS: ::c_int = 68;
+/// Satnet Monitoring
+pub const IPPROTO_SATMON: ::c_int = 69;
+/// VISA Protocol
+pub const IPPROTO_VISA: ::c_int = 70;
+/// Packet Core Utility
+pub const IPPROTO_IPCV: ::c_int = 71;
+/// Comp. Prot. Net. Executive
+pub const IPPROTO_CPNX: ::c_int = 72;
+/// Comp. Prot. HeartBeat
+pub const IPPROTO_CPHB: ::c_int = 73;
+/// Wang Span Network
+pub const IPPROTO_WSN: ::c_int = 74;
+/// Packet Video Protocol
+pub const IPPROTO_PVP: ::c_int = 75;
+/// BackRoom SATNET Monitoring
+pub const IPPROTO_BRSATMON: ::c_int = 76;
+/// Sun net disk proto (temp.)
+pub const IPPROTO_ND: ::c_int = 77;
+/// WIDEBAND Monitoring
+pub const IPPROTO_WBMON: ::c_int = 78;
+/// WIDEBAND EXPAK
+pub const IPPROTO_WBEXPAK: ::c_int = 79;
+/// ISO cnlp
+pub const IPPROTO_EON: ::c_int = 80;
+/// VMTP
+pub const IPPROTO_VMTP: ::c_int = 81;
+/// Secure VMTP
+pub const IPPROTO_SVMTP: ::c_int = 82;
+/// Banyon VINES
+pub const IPPROTO_VINES: ::c_int = 83;
+/// TTP
+pub const IPPROTO_TTP: ::c_int = 84;
+/// NSFNET-IGP
+pub const IPPROTO_IGP: ::c_int = 85;
+/// dissimilar gateway prot.
+pub const IPPROTO_DGP: ::c_int = 86;
+/// TCF
+pub const IPPROTO_TCF: ::c_int = 87;
+/// Cisco/GXS IGRP
+pub const IPPROTO_IGRP: ::c_int = 88;
+/// OSPFIGP
+pub const IPPROTO_OSPFIGP: ::c_int = 89;
+/// Strite RPC protocol
+pub const IPPROTO_SRPC: ::c_int = 90;
+/// Locus Address Resoloution
+pub const IPPROTO_LARP: ::c_int = 91;
+/// Multicast Transport
+pub const IPPROTO_MTP: ::c_int = 92;
+/// AX.25 Frames
+pub const IPPROTO_AX25: ::c_int = 93;
+/// IP encapsulated in IP
+pub const IPPROTO_IPEIP: ::c_int = 94;
+/// Mobile Int.ing control
+pub const IPPROTO_MICP: ::c_int = 95;
+/// Semaphore Comm. security
+pub const IPPROTO_SCCSP: ::c_int = 96;
+/// Ethernet IP encapsulation
+pub const IPPROTO_ETHERIP: ::c_int = 97;
+/// encapsulation header
+pub const IPPROTO_ENCAP: ::c_int = 98;
+/// any private encr. scheme
+pub const IPPROTO_APES: ::c_int = 99;
+/// GMTP
+pub const IPPROTO_GMTP: ::c_int = 100;
+/// payload compression (IPComp)
+pub const IPPROTO_IPCOMP: ::c_int = 108;
+/// SCTP
+pub const IPPROTO_SCTP: ::c_int = 132;
+/// IPv6 Mobility Header
+pub const IPPROTO_MH: ::c_int = 135;
+/// UDP-Lite
+pub const IPPROTO_UDPLITE: ::c_int = 136;
+/// IP6 Host Identity Protocol
+pub const IPPROTO_HIP: ::c_int = 139;
+/// IP6 Shim6 Protocol
+pub const IPPROTO_SHIM6: ::c_int = 140;
+
+/* 101-254: Partly Unassigned */
+/// Protocol Independent Mcast
+pub const IPPROTO_PIM: ::c_int = 103;
+/// CARP
+pub const IPPROTO_CARP: ::c_int = 112;
+/// PGM
+pub const IPPROTO_PGM: ::c_int = 113;
+/// MPLS-in-IP
+pub const IPPROTO_MPLS: ::c_int = 137;
+/// PFSYNC
+pub const IPPROTO_PFSYNC: ::c_int = 240;
+
+/* 255: Reserved */
+/* BSD Private, local use, namespace incursion, no longer used */
+/// OLD divert pseudo-proto
+pub const IPPROTO_OLD_DIVERT: ::c_int = 254;
+pub const IPPROTO_MAX: ::c_int = 256;
+/// last return value of *_input(), meaning "all job for this pkt is done".
+pub const IPPROTO_DONE: ::c_int = 257;
+
+/* Only used internally, so can be outside the range of valid IP protocols. */
+/// divert pseudo-protocol
+pub const IPPROTO_DIVERT: ::c_int = 258;
+/// SeND pseudo-protocol
+pub const IPPROTO_SEND: ::c_int = 259;
+
+// sys/netinet/TCP.h
+pub const TCP_MD5SIG: ::c_int = 16;
+pub const TCP_INFO: ::c_int = 32;
+pub const TCP_CONGESTION: ::c_int = 64;
+pub const TCP_CCALGOOPT: ::c_int = 65;
+pub const TCP_MAXUNACKTIME: ::c_int = 68;
+pub const TCP_MAXPEAKRATE: ::c_int = 69;
+pub const TCP_IDLE_REDUCE: ::c_int = 70;
+pub const TCP_REMOTE_UDP_ENCAPS_PORT: ::c_int = 71;
+pub const TCP_DELACK: ::c_int = 72;
+pub const TCP_FIN_IS_RST: ::c_int = 73;
+pub const TCP_LOG_LIMIT: ::c_int = 74;
+pub const TCP_SHARED_CWND_ALLOWED: ::c_int = 75;
+pub const TCP_PROC_ACCOUNTING: ::c_int = 76;
+pub const TCP_USE_CMP_ACKS: ::c_int = 77;
+pub const TCP_PERF_INFO: ::c_int = 78;
+pub const TCP_LRD: ::c_int = 79;
+pub const TCP_KEEPINIT: ::c_int = 128;
+pub const TCP_FASTOPEN: ::c_int = 1025;
+pub const TCP_PCAP_OUT: ::c_int = 2048;
+pub const TCP_PCAP_IN: ::c_int = 4096;
+pub const TCP_FASTOPEN_PSK_LEN: ::c_int = 16;
+pub const TCP_FUNCTION_NAME_LEN_MAX: ::c_int = 32;
+
+pub const IP_BINDANY: ::c_int = 24;
+pub const IP_BINDMULTI: ::c_int = 25;
+pub const IP_RSS_LISTEN_BUCKET: ::c_int = 26;
+pub const IP_ORIGDSTADDR: ::c_int = 27;
+pub const IP_RECVORIGDSTADDR: ::c_int = IP_ORIGDSTADDR;
+
+pub const IP_DONTFRAG: ::c_int = 67;
+pub const IP_RECVTOS: ::c_int = 68;
+
+pub const IPV6_BINDANY: ::c_int = 64;
+pub const IPV6_ORIGDSTADDR: ::c_int = 72;
+pub const IPV6_RECVORIGDSTADDR: ::c_int = IPV6_ORIGDSTADDR;
+
+pub const PF_SLOW: ::c_int = AF_SLOW;
+pub const PF_SCLUSTER: ::c_int = AF_SCLUSTER;
+pub const PF_ARP: ::c_int = AF_ARP;
+pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
+pub const PF_IEEE80211: ::c_int = AF_IEEE80211;
+pub const PF_INET_SDP: ::c_int = AF_INET_SDP;
+pub const PF_INET6_SDP: ::c_int = AF_INET6_SDP;
+
+pub const NET_RT_DUMP: ::c_int = 1;
+pub const NET_RT_FLAGS: ::c_int = 2;
+pub const NET_RT_IFLIST: ::c_int = 3;
+pub const NET_RT_IFMALIST: ::c_int = 4;
+pub const NET_RT_IFLISTL: ::c_int = 5;
+
+// System V IPC
+pub const IPC_INFO: ::c_int = 3;
+pub const MSG_NOERROR: ::c_int = 0o10000;
+pub const SHM_LOCK: ::c_int = 11;
+pub const SHM_UNLOCK: ::c_int = 12;
+pub const SHM_STAT: ::c_int = 13;
+pub const SHM_INFO: ::c_int = 14;
+pub const SHM_ANON: *mut ::c_char = 1 as *mut ::c_char;
+
+// The *_MAXID constants never should've been used outside of the
+// FreeBSD base system.  And with the exception of CTL_P1003_1B_MAXID,
+// they were all removed in svn r262489.  They remain here for backwards
+// compatibility only, and are scheduled to be removed in libc 1.0.0.
+#[doc(hidden)]
+#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
+pub const CTL_MAXID: ::c_int = 10;
+#[doc(hidden)]
+#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
+pub const KERN_MAXID: ::c_int = 38;
+#[doc(hidden)]
+#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
+pub const HW_MAXID: ::c_int = 13;
+#[doc(hidden)]
+#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
+pub const USER_MAXID: ::c_int = 21;
+#[doc(hidden)]
+#[deprecated(since = "0.2.74", note = "Removed in FreeBSD 13")]
+pub const CTL_P1003_1B_MAXID: ::c_int = 26;
+
+pub const MSG_NOTIFICATION: ::c_int = 0x00002000;
+pub const MSG_NBIO: ::c_int = 0x00004000;
+pub const MSG_COMPAT: ::c_int = 0x00008000;
+pub const MSG_CMSG_CLOEXEC: ::c_int = 0x00040000;
+pub const MSG_NOSIGNAL: ::c_int = 0x20000;
+pub const MSG_WAITFORONE: ::c_int = 0x00080000;
+
+// utmpx entry types
+pub const EMPTY: ::c_short = 0;
+pub const BOOT_TIME: ::c_short = 1;
+pub const OLD_TIME: ::c_short = 2;
+pub const NEW_TIME: ::c_short = 3;
+pub const USER_PROCESS: ::c_short = 4;
+pub const INIT_PROCESS: ::c_short = 5;
+pub const LOGIN_PROCESS: ::c_short = 6;
+pub const DEAD_PROCESS: ::c_short = 7;
+pub const SHUTDOWN_TIME: ::c_short = 8;
+// utmp database types
+pub const UTXDB_ACTIVE: ::c_int = 0;
+pub const UTXDB_LASTLOGIN: ::c_int = 1;
+pub const UTXDB_LOG: ::c_int = 2;
+
+pub const LC_COLLATE_MASK: ::c_int = 1 << 0;
+pub const LC_CTYPE_MASK: ::c_int = 1 << 1;
+pub const LC_MONETARY_MASK: ::c_int = 1 << 2;
+pub const LC_NUMERIC_MASK: ::c_int = 1 << 3;
+pub const LC_TIME_MASK: ::c_int = 1 << 4;
+pub const LC_MESSAGES_MASK: ::c_int = 1 << 5;
+pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
+    | LC_CTYPE_MASK
+    | LC_MESSAGES_MASK
+    | LC_MONETARY_MASK
+    | LC_NUMERIC_MASK
+    | LC_TIME_MASK;
+
+pub const WSTOPPED: ::c_int = 2; // same as WUNTRACED
+pub const WCONTINUED: ::c_int = 4;
+pub const WNOWAIT: ::c_int = 8;
+pub const WEXITED: ::c_int = 16;
+pub const WTRAPPED: ::c_int = 32;
+
+// FreeBSD defines a great many more of these, we only expose the
+// standardized ones.
+pub const P_PID: idtype_t = 0;
+pub const P_PGID: idtype_t = 2;
+pub const P_ALL: idtype_t = 7;
+
+pub const UTIME_OMIT: c_long = -2;
+pub const UTIME_NOW: c_long = -1;
+
+pub const B460800: ::speed_t = 460800;
+pub const B921600: ::speed_t = 921600;
+
+pub const AT_FDCWD: ::c_int = -100;
+pub const AT_EACCESS: ::c_int = 0x100;
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200;
+pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
+pub const AT_REMOVEDIR: ::c_int = 0x800;
+pub const AT_RESOLVE_BENEATH: ::c_int = 0x2000;
+pub const AT_EMPTY_PATH: ::c_int = 0x4000;
+
+pub const AT_NULL: ::c_int = 0;
+pub const AT_IGNORE: ::c_int = 1;
+pub const AT_EXECFD: ::c_int = 2;
+pub const AT_PHDR: ::c_int = 3;
+pub const AT_PHENT: ::c_int = 4;
+pub const AT_PHNUM: ::c_int = 5;
+pub const AT_PAGESZ: ::c_int = 6;
+pub const AT_BASE: ::c_int = 7;
+pub const AT_FLAGS: ::c_int = 8;
+pub const AT_ENTRY: ::c_int = 9;
+pub const AT_NOTELF: ::c_int = 10;
+pub const AT_UID: ::c_int = 11;
+pub const AT_EUID: ::c_int = 12;
+pub const AT_GID: ::c_int = 13;
+pub const AT_EGID: ::c_int = 14;
+pub const AT_EXECPATH: ::c_int = 15;
+pub const AT_CANARY: ::c_int = 16;
+pub const AT_OSRELDATE: ::c_int = 18;
+pub const AT_NCPUS: ::c_int = 19;
+pub const AT_PAGESIZES: ::c_int = 20;
+pub const AT_TIMEKEEP: ::c_int = 22;
+pub const AT_HWCAP: ::c_int = 25;
+pub const AT_HWCAP2: ::c_int = 26;
+pub const AT_USRSTACKBASE: ::c_int = 35;
+pub const AT_USRSTACKLIM: ::c_int = 36;
+
+pub const TABDLY: ::tcflag_t = 0x00000004;
+pub const TAB0: ::tcflag_t = 0x00000000;
+pub const TAB3: ::tcflag_t = 0x00000004;
+
+pub const _PC_ACL_NFS4: ::c_int = 64;
+
+pub const _SC_CPUSET_SIZE: ::c_int = 122;
+
+pub const _UUID_NODE_LEN: usize = 6;
+
+// Flags which can be passed to pdfork(2)
+pub const PD_DAEMON: ::c_int = 0x00000001;
+pub const PD_CLOEXEC: ::c_int = 0x00000002;
+pub const PD_ALLOWED_AT_FORK: ::c_int = PD_DAEMON | PD_CLOEXEC;
+
+// Values for struct rtprio (type_ field)
+pub const RTP_PRIO_REALTIME: ::c_ushort = 2;
+pub const RTP_PRIO_NORMAL: ::c_ushort = 3;
+pub const RTP_PRIO_IDLE: ::c_ushort = 4;
+
+pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
+pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02;
+pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x04;
+pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x08;
+pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10;
+pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20;
+
+// Flags for chflags(2)
+pub const UF_SYSTEM: ::c_ulong = 0x00000080;
+pub const UF_SPARSE: ::c_ulong = 0x00000100;
+pub const UF_OFFLINE: ::c_ulong = 0x00000200;
+pub const UF_REPARSE: ::c_ulong = 0x00000400;
+pub const UF_ARCHIVE: ::c_ulong = 0x00000800;
+pub const UF_READONLY: ::c_ulong = 0x00001000;
+pub const UF_HIDDEN: ::c_ulong = 0x00008000;
+pub const SF_SNAPSHOT: ::c_ulong = 0x00200000;
+
+// fcntl commands
+pub const F_ADD_SEALS: ::c_int = 19;
+pub const F_GET_SEALS: ::c_int = 20;
+pub const F_OGETLK: ::c_int = 7;
+pub const F_OSETLK: ::c_int = 8;
+pub const F_OSETLKW: ::c_int = 9;
+pub const F_RDAHEAD: ::c_int = 16;
+pub const F_READAHEAD: ::c_int = 15;
+pub const F_SETLK_REMOTE: ::c_int = 14;
+pub const F_KINFO: ::c_int = 22;
+
+// for use with F_ADD_SEALS
+pub const F_SEAL_GROW: ::c_int = 4;
+pub const F_SEAL_SEAL: ::c_int = 1;
+pub const F_SEAL_SHRINK: ::c_int = 2;
+pub const F_SEAL_WRITE: ::c_int = 8;
+
+// for use with fspacectl
+pub const SPACECTL_DEALLOC: ::c_int = 1;
+
+// For realhostname* api
+pub const HOSTNAME_FOUND: ::c_int = 0;
+pub const HOSTNAME_INCORRECTNAME: ::c_int = 1;
+pub const HOSTNAME_INVALIDADDR: ::c_int = 2;
+pub const HOSTNAME_INVALIDNAME: ::c_int = 3;
+
+// For rfork
+pub const RFFDG: ::c_int = 4;
+pub const RFPROC: ::c_int = 16;
+pub const RFMEM: ::c_int = 32;
+pub const RFNOWAIT: ::c_int = 64;
+pub const RFCFDG: ::c_int = 4096;
+pub const RFTHREAD: ::c_int = 8192;
+pub const RFSIGSHARE: ::c_int = 16384;
+pub const RFLINUXTHPN: ::c_int = 65536;
+pub const RFTSIGZMB: ::c_int = 524288;
+pub const RFSPAWN: ::c_int = 2147483648;
+
+// For eventfd
+pub const EFD_SEMAPHORE: ::c_int = 0x1;
+pub const EFD_NONBLOCK: ::c_int = 0x4;
+pub const EFD_CLOEXEC: ::c_int = 0x100000;
+
+pub const MALLOCX_ZERO: ::c_int = 0x40;
+
+/// size of returned wchan message
+pub const WMESGLEN: usize = 8;
+/// size of returned lock name
+pub const LOCKNAMELEN: usize = 8;
+/// size of returned thread name
+pub const TDNAMLEN: usize = 16;
+/// size of returned ki_comm name
+pub const COMMLEN: usize = 19;
+/// size of returned ki_emul
+pub const KI_EMULNAMELEN: usize = 16;
+/// number of groups in ki_groups
+pub const KI_NGROUPS: usize = 16;
+cfg_if! {
+    if #[cfg(freebsd11)] {
+        pub const KI_NSPARE_INT: usize = 4;
+    } else {
+        pub const KI_NSPARE_INT: usize = 2;
+    }
+}
+pub const KI_NSPARE_LONG: usize = 12;
+/// Flags for the process credential.
+pub const KI_CRF_CAPABILITY_MODE: usize = 0x00000001;
+/// Steal a bit from ki_cr_flags to indicate that the cred had more than
+/// KI_NGROUPS groups.
+pub const KI_CRF_GRP_OVERFLOW: usize = 0x80000000;
+/// controlling tty vnode active
+pub const KI_CTTY: usize = 0x00000001;
+/// session leader
+pub const KI_SLEADER: usize = 0x00000002;
+/// proc blocked on lock ki_lockname
+pub const KI_LOCKBLOCK: usize = 0x00000004;
+/// size of returned ki_login
+pub const LOGNAMELEN: usize = 17;
+/// size of returned ki_loginclass
+pub const LOGINCLASSLEN: usize = 17;
+
+pub const KF_ATTR_VALID: ::c_int = 0x0001;
+pub const KF_TYPE_NONE: ::c_int = 0;
+pub const KF_TYPE_VNODE: ::c_int = 1;
+pub const KF_TYPE_SOCKET: ::c_int = 2;
+pub const KF_TYPE_PIPE: ::c_int = 3;
+pub const KF_TYPE_FIFO: ::c_int = 4;
+pub const KF_TYPE_KQUEUE: ::c_int = 5;
+pub const KF_TYPE_MQUEUE: ::c_int = 7;
+pub const KF_TYPE_SHM: ::c_int = 8;
+pub const KF_TYPE_SEM: ::c_int = 9;
+pub const KF_TYPE_PTS: ::c_int = 10;
+pub const KF_TYPE_PROCDESC: ::c_int = 11;
+pub const KF_TYPE_DEV: ::c_int = 12;
+pub const KF_TYPE_UNKNOWN: ::c_int = 255;
+
+pub const KF_VTYPE_VNON: ::c_int = 0;
+pub const KF_VTYPE_VREG: ::c_int = 1;
+pub const KF_VTYPE_VDIR: ::c_int = 2;
+pub const KF_VTYPE_VBLK: ::c_int = 3;
+pub const KF_VTYPE_VCHR: ::c_int = 4;
+pub const KF_VTYPE_VLNK: ::c_int = 5;
+pub const KF_VTYPE_VSOCK: ::c_int = 6;
+pub const KF_VTYPE_VFIFO: ::c_int = 7;
+pub const KF_VTYPE_VBAD: ::c_int = 8;
+pub const KF_VTYPE_UNKNOWN: ::c_int = 255;
+
+/// Current working directory
+pub const KF_FD_TYPE_CWD: ::c_int = -1;
+/// Root directory
+pub const KF_FD_TYPE_ROOT: ::c_int = -2;
+/// Jail directory
+pub const KF_FD_TYPE_JAIL: ::c_int = -3;
+/// Ktrace vnode
+pub const KF_FD_TYPE_TRACE: ::c_int = -4;
+pub const KF_FD_TYPE_TEXT: ::c_int = -5;
+/// Controlling terminal
+pub const KF_FD_TYPE_CTTY: ::c_int = -6;
+pub const KF_FLAG_READ: ::c_int = 0x00000001;
+pub const KF_FLAG_WRITE: ::c_int = 0x00000002;
+pub const KF_FLAG_APPEND: ::c_int = 0x00000004;
+pub const KF_FLAG_ASYNC: ::c_int = 0x00000008;
+pub const KF_FLAG_FSYNC: ::c_int = 0x00000010;
+pub const KF_FLAG_NONBLOCK: ::c_int = 0x00000020;
+pub const KF_FLAG_DIRECT: ::c_int = 0x00000040;
+pub const KF_FLAG_HASLOCK: ::c_int = 0x00000080;
+pub const KF_FLAG_SHLOCK: ::c_int = 0x00000100;
+pub const KF_FLAG_EXLOCK: ::c_int = 0x00000200;
+pub const KF_FLAG_NOFOLLOW: ::c_int = 0x00000400;
+pub const KF_FLAG_CREAT: ::c_int = 0x00000800;
+pub const KF_FLAG_TRUNC: ::c_int = 0x00001000;
+pub const KF_FLAG_EXCL: ::c_int = 0x00002000;
+pub const KF_FLAG_EXEC: ::c_int = 0x00004000;
+
+pub const KVME_TYPE_NONE: ::c_int = 0;
+pub const KVME_TYPE_DEFAULT: ::c_int = 1;
+pub const KVME_TYPE_VNODE: ::c_int = 2;
+pub const KVME_TYPE_SWAP: ::c_int = 3;
+pub const KVME_TYPE_DEVICE: ::c_int = 4;
+pub const KVME_TYPE_PHYS: ::c_int = 5;
+pub const KVME_TYPE_DEAD: ::c_int = 6;
+pub const KVME_TYPE_SG: ::c_int = 7;
+pub const KVME_TYPE_MGTDEVICE: ::c_int = 8;
+// Present in `sys/user.h` but is undefined for whatever reason...
+// pub const KVME_TYPE_GUARD: ::c_int = 9;
+pub const KVME_TYPE_UNKNOWN: ::c_int = 255;
+pub const KVME_PROT_READ: ::c_int = 0x00000001;
+pub const KVME_PROT_WRITE: ::c_int = 0x00000002;
+pub const KVME_PROT_EXEC: ::c_int = 0x00000004;
+pub const KVME_FLAG_COW: ::c_int = 0x00000001;
+pub const KVME_FLAG_NEEDS_COPY: ::c_int = 0x00000002;
+pub const KVME_FLAG_NOCOREDUMP: ::c_int = 0x00000004;
+pub const KVME_FLAG_SUPER: ::c_int = 0x00000008;
+pub const KVME_FLAG_GROWS_UP: ::c_int = 0x00000010;
+pub const KVME_FLAG_GROWS_DOWN: ::c_int = 0x00000020;
+pub const KVME_FLAG_USER_WIRED: ::c_int = 0x00000040;
+
+pub const KKST_MAXLEN: ::c_int = 1024;
+/// Stack is valid.
+pub const KKST_STATE_STACKOK: ::c_int = 0;
+/// Stack swapped out.
+pub const KKST_STATE_SWAPPED: ::c_int = 1;
+pub const KKST_STATE_RUNNING: ::c_int = 2;
+
+// Constants about priority.
+pub const PRI_MIN: ::c_int = 0;
+pub const PRI_MAX: ::c_int = 255;
+pub const PRI_MIN_ITHD: ::c_int = PRI_MIN;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PRI_MAX_ITHD: ::c_int = PRI_MIN_REALTIME - 1;
+pub const PI_REALTIME: ::c_int = PRI_MIN_ITHD + 0;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const PI_AV: ::c_int = PRI_MIN_ITHD + 4;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const PI_NET: ::c_int = PRI_MIN_ITHD + 8;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const PI_DISK: ::c_int = PRI_MIN_ITHD + 12;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const PI_TTY: ::c_int = PRI_MIN_ITHD + 16;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const PI_DULL: ::c_int = PRI_MIN_ITHD + 20;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const PI_SOFT: ::c_int = PRI_MIN_ITHD + 24;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const PRI_MIN_REALTIME: ::c_int = 48;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PRI_MAX_REALTIME: ::c_int = PRI_MIN_KERN - 1;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const PRI_MIN_KERN: ::c_int = 80;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PRI_MAX_KERN: ::c_int = PRI_MIN_TIMESHARE - 1;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PSWP: ::c_int = PRI_MIN_KERN + 0;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PVM: ::c_int = PRI_MIN_KERN + 4;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PINOD: ::c_int = PRI_MIN_KERN + 8;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PRIBIO: ::c_int = PRI_MIN_KERN + 12;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PVFS: ::c_int = PRI_MIN_KERN + 16;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PZERO: ::c_int = PRI_MIN_KERN + 20;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PSOCK: ::c_int = PRI_MIN_KERN + 24;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PWAIT: ::c_int = PRI_MIN_KERN + 28;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PLOCK: ::c_int = PRI_MIN_KERN + 32;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PPAUSE: ::c_int = PRI_MIN_KERN + 36;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const PRI_MIN_TIMESHARE: ::c_int = 120;
+pub const PRI_MAX_TIMESHARE: ::c_int = PRI_MIN_IDLE - 1;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+#[allow(deprecated)]
+pub const PUSER: ::c_int = PRI_MIN_TIMESHARE;
+pub const PRI_MIN_IDLE: ::c_int = 224;
+pub const PRI_MAX_IDLE: ::c_int = PRI_MAX;
+
+pub const NZERO: ::c_int = 0;
+
+// Resource utilization information.
+pub const RUSAGE_THREAD: ::c_int = 1;
+
+cfg_if! {
+    if #[cfg(any(freebsd11, target_pointer_width = "32"))] {
+        pub const ARG_MAX: ::c_int = 256 * 1024;
+    } else {
+        pub const ARG_MAX: ::c_int = 2 * 256 * 1024;
+    }
+}
+pub const CHILD_MAX: ::c_int = 40;
+/// max command name remembered
+pub const MAXCOMLEN: usize = 19;
+/// max interpreter file name length
+pub const MAXINTERP: ::c_int = ::PATH_MAX;
+/// max login name length (incl. NUL)
+pub const MAXLOGNAME: ::c_int = 33;
+/// max simultaneous processes
+pub const MAXUPRC: ::c_int = CHILD_MAX;
+/// max bytes for an exec function
+pub const NCARGS: ::c_int = ARG_MAX;
+///  /* max number groups
+pub const NGROUPS: ::c_int = NGROUPS_MAX + 1;
+/// max open files per process
+pub const NOFILE: ::c_int = OPEN_MAX;
+/// marker for empty group set member
+pub const NOGROUP: ::c_int = 65535;
+/// max hostname size
+pub const MAXHOSTNAMELEN: ::c_int = 256;
+/// max bytes in term canon input line
+pub const MAX_CANON: ::c_int = 255;
+/// max bytes in terminal input
+pub const MAX_INPUT: ::c_int = 255;
+/// max bytes in a file name
+pub const NAME_MAX: ::c_int = 255;
+pub const MAXSYMLINKS: ::c_int = 32;
+/// max supplemental group id's
+pub const NGROUPS_MAX: ::c_int = 1023;
+/// max open files per process
+pub const OPEN_MAX: ::c_int = 64;
+
+pub const _POSIX_ARG_MAX: ::c_int = 4096;
+pub const _POSIX_LINK_MAX: ::c_int = 8;
+pub const _POSIX_MAX_CANON: ::c_int = 255;
+pub const _POSIX_MAX_INPUT: ::c_int = 255;
+pub const _POSIX_NAME_MAX: ::c_int = 14;
+pub const _POSIX_PIPE_BUF: ::c_int = 512;
+pub const _POSIX_SSIZE_MAX: ::c_int = 32767;
+pub const _POSIX_STREAM_MAX: ::c_int = 8;
+
+/// max ibase/obase values in bc(1)
+pub const BC_BASE_MAX: ::c_int = 99;
+/// max array elements in bc(1)
+pub const BC_DIM_MAX: ::c_int = 2048;
+/// max scale value in bc(1)
+pub const BC_SCALE_MAX: ::c_int = 99;
+/// max const string length in bc(1)
+pub const BC_STRING_MAX: ::c_int = 1000;
+/// max character class name size
+pub const CHARCLASS_NAME_MAX: ::c_int = 14;
+/// max weights for order keyword
+pub const COLL_WEIGHTS_MAX: ::c_int = 10;
+/// max expressions nested in expr(1)
+pub const EXPR_NEST_MAX: ::c_int = 32;
+/// max bytes in an input line
+pub const LINE_MAX: ::c_int = 2048;
+/// max RE's in interval notation
+pub const RE_DUP_MAX: ::c_int = 255;
+
+pub const _POSIX2_BC_BASE_MAX: ::c_int = 99;
+pub const _POSIX2_BC_DIM_MAX: ::c_int = 2048;
+pub const _POSIX2_BC_SCALE_MAX: ::c_int = 99;
+pub const _POSIX2_BC_STRING_MAX: ::c_int = 1000;
+pub const _POSIX2_CHARCLASS_NAME_MAX: ::c_int = 14;
+pub const _POSIX2_COLL_WEIGHTS_MAX: ::c_int = 2;
+pub const _POSIX2_EQUIV_CLASS_MAX: ::c_int = 2;
+pub const _POSIX2_EXPR_NEST_MAX: ::c_int = 32;
+pub const _POSIX2_LINE_MAX: ::c_int = 2048;
+pub const _POSIX2_RE_DUP_MAX: ::c_int = 255;
+
+// sys/proc.h
+pub const TDF_BORROWING: ::c_int = 0x00000001;
+pub const TDF_INPANIC: ::c_int = 0x00000002;
+pub const TDF_INMEM: ::c_int = 0x00000004;
+pub const TDF_SINTR: ::c_int = 0x00000008;
+pub const TDF_TIMEOUT: ::c_int = 0x00000010;
+pub const TDF_IDLETD: ::c_int = 0x00000020;
+pub const TDF_CANSWAP: ::c_int = 0x00000040;
+pub const TDF_KTH_SUSP: ::c_int = 0x00000100;
+pub const TDF_ALLPROCSUSP: ::c_int = 0x00000200;
+pub const TDF_BOUNDARY: ::c_int = 0x00000400;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const TDF_ASTPENDING: ::c_int = 0x00000800;
+pub const TDF_SBDRY: ::c_int = 0x00002000;
+pub const TDF_UPIBLOCKED: ::c_int = 0x00004000;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const TDF_NEEDSUSPCHK: ::c_int = 0x00008000;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const TDF_NEEDRESCHED: ::c_int = 0x00010000;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const TDF_NEEDSIGCHK: ::c_int = 0x00020000;
+pub const TDF_NOLOAD: ::c_int = 0x00040000;
+pub const TDF_SERESTART: ::c_int = 0x00080000;
+pub const TDF_THRWAKEUP: ::c_int = 0x00100000;
+pub const TDF_SEINTR: ::c_int = 0x00200000;
+pub const TDF_SWAPINREQ: ::c_int = 0x00400000;
+#[deprecated(since = "0.2.133", note = "Removed in FreeBSD 14")]
+pub const TDF_UNUSED23: ::c_int = 0x00800000;
+pub const TDF_SCHED0: ::c_int = 0x01000000;
+pub const TDF_SCHED1: ::c_int = 0x02000000;
+pub const TDF_SCHED2: ::c_int = 0x04000000;
+pub const TDF_SCHED3: ::c_int = 0x08000000;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const TDF_ALRMPEND: ::c_int = 0x10000000;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const TDF_PROFPEND: ::c_int = 0x20000000;
+#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
+pub const TDF_MACPEND: ::c_int = 0x40000000;
+
+pub const TDB_SUSPEND: ::c_int = 0x00000001;
+pub const TDB_XSIG: ::c_int = 0x00000002;
+pub const TDB_USERWR: ::c_int = 0x00000004;
+pub const TDB_SCE: ::c_int = 0x00000008;
+pub const TDB_SCX: ::c_int = 0x00000010;
+pub const TDB_EXEC: ::c_int = 0x00000020;
+pub const TDB_FORK: ::c_int = 0x00000040;
+pub const TDB_STOPATFORK: ::c_int = 0x00000080;
+pub const TDB_CHILD: ::c_int = 0x00000100;
+pub const TDB_BORN: ::c_int = 0x00000200;
+pub const TDB_EXIT: ::c_int = 0x00000400;
+pub const TDB_VFORK: ::c_int = 0x00000800;
+pub const TDB_FSTP: ::c_int = 0x00001000;
+pub const TDB_STEP: ::c_int = 0x00002000;
+
+pub const TDP_OLDMASK: ::c_int = 0x00000001;
+pub const TDP_INKTR: ::c_int = 0x00000002;
+pub const TDP_INKTRACE: ::c_int = 0x00000004;
+pub const TDP_BUFNEED: ::c_int = 0x00000008;
+pub const TDP_COWINPROGRESS: ::c_int = 0x00000010;
+pub const TDP_ALTSTACK: ::c_int = 0x00000020;
+pub const TDP_DEADLKTREAT: ::c_int = 0x00000040;
+pub const TDP_NOFAULTING: ::c_int = 0x00000080;
+pub const TDP_OWEUPC: ::c_int = 0x00000200;
+pub const TDP_ITHREAD: ::c_int = 0x00000400;
+pub const TDP_SYNCIO: ::c_int = 0x00000800;
+pub const TDP_SCHED1: ::c_int = 0x00001000;
+pub const TDP_SCHED2: ::c_int = 0x00002000;
+pub const TDP_SCHED3: ::c_int = 0x00004000;
+pub const TDP_SCHED4: ::c_int = 0x00008000;
+pub const TDP_GEOM: ::c_int = 0x00010000;
+pub const TDP_SOFTDEP: ::c_int = 0x00020000;
+pub const TDP_NORUNNINGBUF: ::c_int = 0x00040000;
+pub const TDP_WAKEUP: ::c_int = 0x00080000;
+pub const TDP_INBDFLUSH: ::c_int = 0x00100000;
+pub const TDP_KTHREAD: ::c_int = 0x00200000;
+pub const TDP_CALLCHAIN: ::c_int = 0x00400000;
+pub const TDP_IGNSUSP: ::c_int = 0x00800000;
+pub const TDP_AUDITREC: ::c_int = 0x01000000;
+pub const TDP_RFPPWAIT: ::c_int = 0x02000000;
+pub const TDP_RESETSPUR: ::c_int = 0x04000000;
+pub const TDP_NERRNO: ::c_int = 0x08000000;
+pub const TDP_EXECVMSPC: ::c_int = 0x40000000;
+
+pub const TDI_SUSPENDED: ::c_int = 0x0001;
+pub const TDI_SLEEPING: ::c_int = 0x0002;
+pub const TDI_SWAPPED: ::c_int = 0x0004;
+pub const TDI_LOCK: ::c_int = 0x0008;
+pub const TDI_IWAIT: ::c_int = 0x0010;
+
+pub const P_ADVLOCK: ::c_int = 0x00000001;
+pub const P_CONTROLT: ::c_int = 0x00000002;
+pub const P_KPROC: ::c_int = 0x00000004;
+pub const P_UNUSED3: ::c_int = 0x00000008;
+pub const P_PPWAIT: ::c_int = 0x00000010;
+pub const P_PROFIL: ::c_int = 0x00000020;
+pub const P_STOPPROF: ::c_int = 0x00000040;
+pub const P_HADTHREADS: ::c_int = 0x00000080;
+pub const P_SUGID: ::c_int = 0x00000100;
+pub const P_SYSTEM: ::c_int = 0x00000200;
+pub const P_SINGLE_EXIT: ::c_int = 0x00000400;
+pub const P_TRACED: ::c_int = 0x00000800;
+pub const P_WAITED: ::c_int = 0x00001000;
+pub const P_WEXIT: ::c_int = 0x00002000;
+pub const P_EXEC: ::c_int = 0x00004000;
+pub const P_WKILLED: ::c_int = 0x00008000;
+pub const P_CONTINUED: ::c_int = 0x00010000;
+pub const P_STOPPED_SIG: ::c_int = 0x00020000;
+pub const P_STOPPED_TRACE: ::c_int = 0x00040000;
+pub const P_STOPPED_SINGLE: ::c_int = 0x00080000;
+pub const P_PROTECTED: ::c_int = 0x00100000;
+pub const P_SIGEVENT: ::c_int = 0x00200000;
+pub const P_SINGLE_BOUNDARY: ::c_int = 0x00400000;
+pub const P_HWPMC: ::c_int = 0x00800000;
+pub const P_JAILED: ::c_int = 0x01000000;
+pub const P_TOTAL_STOP: ::c_int = 0x02000000;
+pub const P_INEXEC: ::c_int = 0x04000000;
+pub const P_STATCHILD: ::c_int = 0x08000000;
+pub const P_INMEM: ::c_int = 0x10000000;
+pub const P_SWAPPINGOUT: ::c_int = 0x20000000;
+pub const P_SWAPPINGIN: ::c_int = 0x40000000;
+pub const P_PPTRACE: ::c_int = 0x80000000;
+pub const P_STOPPED: ::c_int = P_STOPPED_SIG | P_STOPPED_SINGLE | P_STOPPED_TRACE;
+
+pub const P2_INHERIT_PROTECTED: ::c_int = 0x00000001;
+pub const P2_NOTRACE: ::c_int = 0x00000002;
+pub const P2_NOTRACE_EXEC: ::c_int = 0x00000004;
+pub const P2_AST_SU: ::c_int = 0x00000008;
+pub const P2_PTRACE_FSTP: ::c_int = 0x00000010;
+pub const P2_TRAPCAP: ::c_int = 0x00000020;
+pub const P2_STKGAP_DISABLE: ::c_int = 0x00000800;
+pub const P2_STKGAP_DISABLE_EXEC: ::c_int = 0x00001000;
+
+pub const P_TREE_ORPHANED: ::c_int = 0x00000001;
+pub const P_TREE_FIRST_ORPHAN: ::c_int = 0x00000002;
+pub const P_TREE_REAPER: ::c_int = 0x00000004;
+
+pub const SIDL: ::c_char = 1;
+pub const SRUN: ::c_char = 2;
+pub const SSLEEP: ::c_char = 3;
+pub const SSTOP: ::c_char = 4;
+pub const SZOMB: ::c_char = 5;
+pub const SWAIT: ::c_char = 6;
+pub const SLOCK: ::c_char = 7;
+
+pub const P_MAGIC: ::c_int = 0xbeefface;
+
+pub const TDP_SIGFASTBLOCK: ::c_int = 0x00000100;
+pub const TDP_UIOHELD: ::c_int = 0x10000000;
+pub const TDP_SIGFASTPENDING: ::c_int = 0x80000000;
+pub const TDP2_COMPAT32RB: ::c_int = 0x00000002;
+pub const P2_PROTMAX_ENABLE: ::c_int = 0x00000200;
+pub const P2_PROTMAX_DISABLE: ::c_int = 0x00000400;
+pub const TDP2_SBPAGES: ::c_int = 0x00000001;
+pub const P2_ASLR_ENABLE: ::c_int = 0x00000040;
+pub const P2_ASLR_DISABLE: ::c_int = 0x00000080;
+pub const P2_ASLR_IGNSTART: ::c_int = 0x00000100;
+pub const P_TREE_GRPEXITED: ::c_int = 0x00000008;
+
+// libprocstat.h
+pub const PS_FST_VTYPE_VNON: ::c_int = 1;
+pub const PS_FST_VTYPE_VREG: ::c_int = 2;
+pub const PS_FST_VTYPE_VDIR: ::c_int = 3;
+pub const PS_FST_VTYPE_VBLK: ::c_int = 4;
+pub const PS_FST_VTYPE_VCHR: ::c_int = 5;
+pub const PS_FST_VTYPE_VLNK: ::c_int = 6;
+pub const PS_FST_VTYPE_VSOCK: ::c_int = 7;
+pub const PS_FST_VTYPE_VFIFO: ::c_int = 8;
+pub const PS_FST_VTYPE_VBAD: ::c_int = 9;
+pub const PS_FST_VTYPE_UNKNOWN: ::c_int = 255;
+
+pub const PS_FST_TYPE_VNODE: ::c_int = 1;
+pub const PS_FST_TYPE_FIFO: ::c_int = 2;
+pub const PS_FST_TYPE_SOCKET: ::c_int = 3;
+pub const PS_FST_TYPE_PIPE: ::c_int = 4;
+pub const PS_FST_TYPE_PTS: ::c_int = 5;
+pub const PS_FST_TYPE_KQUEUE: ::c_int = 6;
+pub const PS_FST_TYPE_MQUEUE: ::c_int = 8;
+pub const PS_FST_TYPE_SHM: ::c_int = 9;
+pub const PS_FST_TYPE_SEM: ::c_int = 10;
+pub const PS_FST_TYPE_UNKNOWN: ::c_int = 11;
+pub const PS_FST_TYPE_NONE: ::c_int = 12;
+pub const PS_FST_TYPE_PROCDESC: ::c_int = 13;
+pub const PS_FST_TYPE_DEV: ::c_int = 14;
+pub const PS_FST_TYPE_EVENTFD: ::c_int = 15;
+
+pub const PS_FST_UFLAG_RDIR: ::c_int = 0x0001;
+pub const PS_FST_UFLAG_CDIR: ::c_int = 0x0002;
+pub const PS_FST_UFLAG_JAIL: ::c_int = 0x0004;
+pub const PS_FST_UFLAG_TRACE: ::c_int = 0x0008;
+pub const PS_FST_UFLAG_TEXT: ::c_int = 0x0010;
+pub const PS_FST_UFLAG_MMAP: ::c_int = 0x0020;
+pub const PS_FST_UFLAG_CTTY: ::c_int = 0x0040;
+
+pub const PS_FST_FFLAG_READ: ::c_int = 0x0001;
+pub const PS_FST_FFLAG_WRITE: ::c_int = 0x0002;
+pub const PS_FST_FFLAG_NONBLOCK: ::c_int = 0x0004;
+pub const PS_FST_FFLAG_APPEND: ::c_int = 0x0008;
+pub const PS_FST_FFLAG_SHLOCK: ::c_int = 0x0010;
+pub const PS_FST_FFLAG_EXLOCK: ::c_int = 0x0020;
+pub const PS_FST_FFLAG_ASYNC: ::c_int = 0x0040;
+pub const PS_FST_FFLAG_SYNC: ::c_int = 0x0080;
+pub const PS_FST_FFLAG_NOFOLLOW: ::c_int = 0x0100;
+pub const PS_FST_FFLAG_CREAT: ::c_int = 0x0200;
+pub const PS_FST_FFLAG_TRUNC: ::c_int = 0x0400;
+pub const PS_FST_FFLAG_EXCL: ::c_int = 0x0800;
+pub const PS_FST_FFLAG_DIRECT: ::c_int = 0x1000;
+pub const PS_FST_FFLAG_EXEC: ::c_int = 0x2000;
+pub const PS_FST_FFLAG_HASLOCK: ::c_int = 0x4000;
+
+// sys/mount.h
+
+/// File identifier.
+/// These are unique per filesystem on a single machine.
+///
+/// Note that the offset of fid_data is 4 bytes, so care must be taken to avoid
+/// undefined behavior accessing unaligned fields within an embedded struct.
+pub const MAXFIDSZ: ::c_int = 16;
+/// Length of type name including null.
+pub const MFSNAMELEN: ::c_int = 16;
+cfg_if! {
+    if #[cfg(any(freebsd10, freebsd11))] {
+        /// Size of on/from name bufs.
+        pub const MNAMELEN: ::c_int = 88;
+    } else {
+        /// Size of on/from name bufs.
+        pub const MNAMELEN: ::c_int = 1024;
+    }
+}
+
+/// Using journaled soft updates.
+pub const MNT_SUJ: u64 = 0x100000000;
+/// Mounted by automountd(8).
+pub const MNT_AUTOMOUNTED: u64 = 0x200000000;
+/// Filesys metadata untrusted.
+pub const MNT_UNTRUSTED: u64 = 0x800000000;
+
+/// Require TLS.
+pub const MNT_EXTLS: u64 = 0x4000000000;
+/// Require TLS with client cert.
+pub const MNT_EXTLSCERT: u64 = 0x8000000000;
+/// Require TLS with user cert.
+pub const MNT_EXTLSCERTUSER: u64 = 0x10000000000;
+
+/// Filesystem is stored locally.
+pub const MNT_LOCAL: u64 = 0x000001000;
+/// Quotas are enabled on fs.
+pub const MNT_QUOTA: u64 = 0x000002000;
+/// Identifies the root fs.
+pub const MNT_ROOTFS: u64 = 0x000004000;
+/// Mounted by a user.
+pub const MNT_USER: u64 = 0x000008000;
+/// Do not show entry in df.
+pub const MNT_IGNORE: u64 = 0x000800000;
+/// Filesystem is verified.
+pub const MNT_VERIFIED: u64 = 0x400000000;
+
+/// Do not cover a mount point.
+pub const MNT_NOCOVER: u64 = 0x001000000000;
+/// Only mount on empty dir.
+pub const MNT_EMPTYDIR: u64 = 0x002000000000;
+/// Recursively unmount uppers.
+pub const MNT_RECURSE: u64 = 0x100000000000;
+/// Unmount in async context.
+pub const MNT_DEFERRED: u64 = 0x200000000000;
+
+/// Get configured filesystems.
+pub const VFS_VFSCONF: ::c_int = 0;
+/// Generic filesystem information.
+pub const VFS_GENERIC: ::c_int = 0;
+
+/// int: highest defined filesystem type.
+pub const VFS_MAXTYPENUM: ::c_int = 1;
+/// struct: vfsconf for filesystem given as next argument.
+pub const VFS_CONF: ::c_int = 2;
+
+/// Synchronously wait for I/O to complete.
+pub const MNT_WAIT: ::c_int = 1;
+/// Start all I/O, but do not wait for it.
+pub const MNT_NOWAIT: ::c_int = 2;
+/// Push data not written by filesystem syncer.
+pub const MNT_LAZY: ::c_int = 3;
+/// Suspend file system after sync.
+pub const MNT_SUSPEND: ::c_int = 4;
+
+pub const MAXSECFLAVORS: ::c_int = 5;
+
+/// Statically compiled into kernel.
+pub const VFCF_STATIC: ::c_int = 0x00010000;
+/// May get data over the network.
+pub const VFCF_NETWORK: ::c_int = 0x00020000;
+/// Writes are not implemented.
+pub const VFCF_READONLY: ::c_int = 0x00040000;
+/// Data does not represent real files.
+pub const VFCF_SYNTHETIC: ::c_int = 0x00080000;
+/// Aliases some other mounted FS.
+pub const VFCF_LOOPBACK: ::c_int = 0x00100000;
+/// Stores file names as Unicode.
+pub const VFCF_UNICODE: ::c_int = 0x00200000;
+/// Can be mounted from within a jail.
+pub const VFCF_JAIL: ::c_int = 0x00400000;
+/// Supports delegated administration.
+pub const VFCF_DELEGADMIN: ::c_int = 0x00800000;
+/// Stop at Boundary: defer stop requests to kernel->user (AST) transition.
+pub const VFCF_SBDRY: ::c_int = 0x01000000;
+
+// time.h
+
+/// not on dst
+pub const DST_NONE: ::c_int = 0;
+/// USA style dst
+pub const DST_USA: ::c_int = 1;
+/// Australian style dst
+pub const DST_AUST: ::c_int = 2;
+/// Western European dst
+pub const DST_WET: ::c_int = 3;
+/// Middle European dst
+pub const DST_MET: ::c_int = 4;
+/// Eastern European dst
+pub const DST_EET: ::c_int = 5;
+/// Canada
+pub const DST_CAN: ::c_int = 6;
+
+pub const CPUCLOCK_WHICH_PID: ::c_int = 0;
+pub const CPUCLOCK_WHICH_TID: ::c_int = 1;
+
+pub const MFD_CLOEXEC: ::c_uint = 0x00000001;
+pub const MFD_ALLOW_SEALING: ::c_uint = 0x00000002;
+pub const MFD_HUGETLB: ::c_uint = 0x00000004;
+pub const MFD_HUGE_MASK: ::c_uint = 0xFC000000;
+pub const MFD_HUGE_64KB: ::c_uint = 16 << 26;
+pub const MFD_HUGE_512KB: ::c_uint = 19 << 26;
+pub const MFD_HUGE_1MB: ::c_uint = 20 << 26;
+pub const MFD_HUGE_2MB: ::c_uint = 21 << 26;
+pub const MFD_HUGE_8MB: ::c_uint = 23 << 26;
+pub const MFD_HUGE_16MB: ::c_uint = 24 << 26;
+pub const MFD_HUGE_32MB: ::c_uint = 25 << 26;
+pub const MFD_HUGE_256MB: ::c_uint = 28 << 26;
+pub const MFD_HUGE_512MB: ::c_uint = 29 << 26;
+pub const MFD_HUGE_1GB: ::c_uint = 30 << 26;
+pub const MFD_HUGE_2GB: ::c_uint = 31 << 26;
+pub const MFD_HUGE_16GB: ::c_uint = 34 << 26;
+
+pub const SHM_LARGEPAGE_ALLOC_DEFAULT: ::c_int = 0;
+pub const SHM_LARGEPAGE_ALLOC_NOWAIT: ::c_int = 1;
+pub const SHM_LARGEPAGE_ALLOC_HARD: ::c_int = 2;
+pub const SHM_RENAME_NOREPLACE: ::c_int = 1 << 0;
+pub const SHM_RENAME_EXCHANGE: ::c_int = 1 << 1;
+
+// sys/umtx.h
+
+pub const UMTX_OP_WAIT: ::c_int = 2;
+pub const UMTX_OP_WAKE: ::c_int = 3;
+pub const UMTX_OP_MUTEX_TRYLOCK: ::c_int = 4;
+pub const UMTX_OP_MUTEX_LOCK: ::c_int = 5;
+pub const UMTX_OP_MUTEX_UNLOCK: ::c_int = 6;
+pub const UMTX_OP_SET_CEILING: ::c_int = 7;
+pub const UMTX_OP_CV_WAIT: ::c_int = 8;
+pub const UMTX_OP_CV_SIGNAL: ::c_int = 9;
+pub const UMTX_OP_CV_BROADCAST: ::c_int = 10;
+pub const UMTX_OP_WAIT_UINT: ::c_int = 11;
+pub const UMTX_OP_RW_RDLOCK: ::c_int = 12;
+pub const UMTX_OP_RW_WRLOCK: ::c_int = 13;
+pub const UMTX_OP_RW_UNLOCK: ::c_int = 14;
+pub const UMTX_OP_WAIT_UINT_PRIVATE: ::c_int = 15;
+pub const UMTX_OP_WAKE_PRIVATE: ::c_int = 16;
+pub const UMTX_OP_MUTEX_WAIT: ::c_int = 17;
+pub const UMTX_OP_NWAKE_PRIVATE: ::c_int = 21;
+pub const UMTX_OP_MUTEX_WAKE2: ::c_int = 22;
+pub const UMTX_OP_SEM2_WAIT: ::c_int = 23;
+pub const UMTX_OP_SEM2_WAKE: ::c_int = 24;
+pub const UMTX_OP_SHM: ::c_int = 25;
+pub const UMTX_OP_ROBUST_LISTS: ::c_int = 26;
+
+pub const UMTX_ABSTIME: u32 = 1;
+
+pub const CPU_LEVEL_ROOT: ::c_int = 1;
+pub const CPU_LEVEL_CPUSET: ::c_int = 2;
+pub const CPU_LEVEL_WHICH: ::c_int = 3;
+
+pub const CPU_WHICH_TID: ::c_int = 1;
+pub const CPU_WHICH_PID: ::c_int = 2;
+pub const CPU_WHICH_CPUSET: ::c_int = 3;
+pub const CPU_WHICH_IRQ: ::c_int = 4;
+pub const CPU_WHICH_JAIL: ::c_int = 5;
+
+// sys/signal.h
+pub const SIGTHR: ::c_int = 32;
+pub const SIGLWP: ::c_int = SIGTHR;
+pub const SIGLIBRT: ::c_int = 33;
+
+// netinet/sctp.h
+pub const SCTP_FUTURE_ASSOC: ::c_int = 0;
+pub const SCTP_CURRENT_ASSOC: ::c_int = 1;
+pub const SCTP_ALL_ASSOC: ::c_int = 2;
+
+pub const SCTP_NO_NEXT_MSG: ::c_int = 0x0000;
+pub const SCTP_NEXT_MSG_AVAIL: ::c_int = 0x0001;
+pub const SCTP_NEXT_MSG_ISCOMPLETE: ::c_int = 0x0002;
+pub const SCTP_NEXT_MSG_IS_UNORDERED: ::c_int = 0x0004;
+pub const SCTP_NEXT_MSG_IS_NOTIFICATION: ::c_int = 0x0008;
+
+pub const SCTP_RECVV_NOINFO: ::c_int = 0;
+pub const SCTP_RECVV_RCVINFO: ::c_int = 1;
+pub const SCTP_RECVV_NXTINFO: ::c_int = 2;
+pub const SCTP_RECVV_RN: ::c_int = 3;
+
+pub const SCTP_SENDV_NOINFO: ::c_int = 0;
+pub const SCTP_SENDV_SNDINFO: ::c_int = 1;
+pub const SCTP_SENDV_PRINFO: ::c_int = 2;
+pub const SCTP_SENDV_AUTHINFO: ::c_int = 3;
+pub const SCTP_SENDV_SPA: ::c_int = 4;
+
+pub const SCTP_SEND_SNDINFO_VALID: ::c_int = 0x00000001;
+pub const SCTP_SEND_PRINFO_VALID: ::c_int = 0x00000002;
+pub const SCTP_SEND_AUTHINFO_VALID: ::c_int = 0x00000004;
+
+pub const SCTP_NOTIFICATION: ::c_int = 0x0010;
+pub const SCTP_COMPLETE: ::c_int = 0x0020;
+pub const SCTP_EOF: ::c_int = 0x0100;
+pub const SCTP_ABORT: ::c_int = 0x0200;
+pub const SCTP_UNORDERED: ::c_int = 0x0400;
+pub const SCTP_ADDR_OVER: ::c_int = 0x0800;
+pub const SCTP_SENDALL: ::c_int = 0x1000;
+pub const SCTP_EOR: ::c_int = 0x2000;
+pub const SCTP_SACK_IMMEDIATELY: ::c_int = 0x4000;
+pub const SCTP_PR_SCTP_NONE: ::c_int = 0x0000;
+pub const SCTP_PR_SCTP_TTL: ::c_int = 0x0001;
+pub const SCTP_PR_SCTP_PRIO: ::c_int = 0x0002;
+pub const SCTP_PR_SCTP_BUF: ::c_int = SCTP_PR_SCTP_PRIO;
+pub const SCTP_PR_SCTP_RTX: ::c_int = 0x0003;
+pub const SCTP_PR_SCTP_MAX: ::c_int = SCTP_PR_SCTP_RTX;
+pub const SCTP_PR_SCTP_ALL: ::c_int = 0x000f;
+
+pub const SCTP_INIT: ::c_int = 0x0001;
+pub const SCTP_SNDRCV: ::c_int = 0x0002;
+pub const SCTP_EXTRCV: ::c_int = 0x0003;
+pub const SCTP_SNDINFO: ::c_int = 0x0004;
+pub const SCTP_RCVINFO: ::c_int = 0x0005;
+pub const SCTP_NXTINFO: ::c_int = 0x0006;
+pub const SCTP_PRINFO: ::c_int = 0x0007;
+pub const SCTP_AUTHINFO: ::c_int = 0x0008;
+pub const SCTP_DSTADDRV4: ::c_int = 0x0009;
+pub const SCTP_DSTADDRV6: ::c_int = 0x000a;
+
+pub const SCTP_RTOINFO: ::c_int = 0x00000001;
+pub const SCTP_ASSOCINFO: ::c_int = 0x00000002;
+pub const SCTP_INITMSG: ::c_int = 0x00000003;
+pub const SCTP_NODELAY: ::c_int = 0x00000004;
+pub const SCTP_AUTOCLOSE: ::c_int = 0x00000005;
+pub const SCTP_SET_PEER_PRIMARY_ADDR: ::c_int = 0x00000006;
+pub const SCTP_PRIMARY_ADDR: ::c_int = 0x00000007;
+pub const SCTP_ADAPTATION_LAYER: ::c_int = 0x00000008;
+pub const SCTP_ADAPTION_LAYER: ::c_int = 0x00000008;
+pub const SCTP_DISABLE_FRAGMENTS: ::c_int = 0x00000009;
+pub const SCTP_PEER_ADDR_PARAMS: ::c_int = 0x0000000a;
+pub const SCTP_DEFAULT_SEND_PARAM: ::c_int = 0x0000000b;
+pub const SCTP_EVENTS: ::c_int = 0x0000000c;
+pub const SCTP_I_WANT_MAPPED_V4_ADDR: ::c_int = 0x0000000d;
+pub const SCTP_MAXSEG: ::c_int = 0x0000000e;
+pub const SCTP_DELAYED_SACK: ::c_int = 0x0000000f;
+pub const SCTP_FRAGMENT_INTERLEAVE: ::c_int = 0x00000010;
+pub const SCTP_PARTIAL_DELIVERY_POINT: ::c_int = 0x00000011;
+pub const SCTP_AUTH_CHUNK: ::c_int = 0x00000012;
+pub const SCTP_AUTH_KEY: ::c_int = 0x00000013;
+pub const SCTP_HMAC_IDENT: ::c_int = 0x00000014;
+pub const SCTP_AUTH_ACTIVE_KEY: ::c_int = 0x00000015;
+pub const SCTP_AUTH_DELETE_KEY: ::c_int = 0x00000016;
+pub const SCTP_USE_EXT_RCVINFO: ::c_int = 0x00000017;
+pub const SCTP_AUTO_ASCONF: ::c_int = 0x00000018;
+pub const SCTP_MAXBURST: ::c_int = 0x00000019;
+pub const SCTP_MAX_BURST: ::c_int = 0x00000019;
+pub const SCTP_CONTEXT: ::c_int = 0x0000001a;
+pub const SCTP_EXPLICIT_EOR: ::c_int = 0x00000001b;
+pub const SCTP_REUSE_PORT: ::c_int = 0x00000001c;
+pub const SCTP_AUTH_DEACTIVATE_KEY: ::c_int = 0x00000001d;
+pub const SCTP_EVENT: ::c_int = 0x0000001e;
+pub const SCTP_RECVRCVINFO: ::c_int = 0x0000001f;
+pub const SCTP_RECVNXTINFO: ::c_int = 0x00000020;
+pub const SCTP_DEFAULT_SNDINFO: ::c_int = 0x00000021;
+pub const SCTP_DEFAULT_PRINFO: ::c_int = 0x00000022;
+pub const SCTP_PEER_ADDR_THLDS: ::c_int = 0x00000023;
+pub const SCTP_REMOTE_UDP_ENCAPS_PORT: ::c_int = 0x00000024;
+pub const SCTP_ECN_SUPPORTED: ::c_int = 0x00000025;
+pub const SCTP_AUTH_SUPPORTED: ::c_int = 0x00000027;
+pub const SCTP_ASCONF_SUPPORTED: ::c_int = 0x00000028;
+pub const SCTP_RECONFIG_SUPPORTED: ::c_int = 0x00000029;
+pub const SCTP_NRSACK_SUPPORTED: ::c_int = 0x00000030;
+pub const SCTP_PKTDROP_SUPPORTED: ::c_int = 0x00000031;
+pub const SCTP_MAX_CWND: ::c_int = 0x00000032;
+
+pub const SCTP_STATUS: ::c_int = 0x00000100;
+pub const SCTP_GET_PEER_ADDR_INFO: ::c_int = 0x00000101;
+pub const SCTP_PEER_AUTH_CHUNKS: ::c_int = 0x00000102;
+pub const SCTP_LOCAL_AUTH_CHUNKS: ::c_int = 0x00000103;
+pub const SCTP_GET_ASSOC_NUMBER: ::c_int = 0x00000104;
+pub const SCTP_GET_ASSOC_ID_LIST: ::c_int = 0x00000105;
+pub const SCTP_TIMEOUTS: ::c_int = 0x00000106;
+pub const SCTP_PR_STREAM_STATUS: ::c_int = 0x00000107;
+pub const SCTP_PR_ASSOC_STATUS: ::c_int = 0x00000108;
+
+pub const SCTP_COMM_UP: ::c_int = 0x0001;
+pub const SCTP_COMM_LOST: ::c_int = 0x0002;
+pub const SCTP_RESTART: ::c_int = 0x0003;
+pub const SCTP_SHUTDOWN_COMP: ::c_int = 0x0004;
+pub const SCTP_CANT_STR_ASSOC: ::c_int = 0x0005;
+
+pub const SCTP_ASSOC_SUPPORTS_PR: ::c_int = 0x01;
+pub const SCTP_ASSOC_SUPPORTS_AUTH: ::c_int = 0x02;
+pub const SCTP_ASSOC_SUPPORTS_ASCONF: ::c_int = 0x03;
+pub const SCTP_ASSOC_SUPPORTS_MULTIBUF: ::c_int = 0x04;
+pub const SCTP_ASSOC_SUPPORTS_RE_CONFIG: ::c_int = 0x05;
+pub const SCTP_ASSOC_SUPPORTS_INTERLEAVING: ::c_int = 0x06;
+pub const SCTP_ASSOC_SUPPORTS_MAX: ::c_int = 0x06;
+
+pub const SCTP_ADDR_AVAILABLE: ::c_int = 0x0001;
+pub const SCTP_ADDR_UNREACHABLE: ::c_int = 0x0002;
+pub const SCTP_ADDR_REMOVED: ::c_int = 0x0003;
+pub const SCTP_ADDR_ADDED: ::c_int = 0x0004;
+pub const SCTP_ADDR_MADE_PRIM: ::c_int = 0x0005;
+pub const SCTP_ADDR_CONFIRMED: ::c_int = 0x0006;
+
+pub const SCTP_ACTIVE: ::c_int = 0x0001;
+pub const SCTP_INACTIVE: ::c_int = 0x0002;
+pub const SCTP_UNCONFIRMED: ::c_int = 0x0200;
+
+pub const SCTP_DATA_UNSENT: ::c_int = 0x0001;
+pub const SCTP_DATA_SENT: ::c_int = 0x0002;
+
+pub const SCTP_PARTIAL_DELIVERY_ABORTED: ::c_int = 0x0001;
+
+pub const SCTP_AUTH_NEW_KEY: ::c_int = 0x0001;
+pub const SCTP_AUTH_NEWKEY: ::c_int = SCTP_AUTH_NEW_KEY;
+pub const SCTP_AUTH_NO_AUTH: ::c_int = 0x0002;
+pub const SCTP_AUTH_FREE_KEY: ::c_int = 0x0003;
+
+pub const SCTP_STREAM_RESET_INCOMING_SSN: ::c_int = 0x0001;
+pub const SCTP_STREAM_RESET_OUTGOING_SSN: ::c_int = 0x0002;
+pub const SCTP_STREAM_RESET_DENIED: ::c_int = 0x0004;
+pub const SCTP_STREAM_RESET_FAILED: ::c_int = 0x0008;
+
+pub const SCTP_ASSOC_RESET_DENIED: ::c_int = 0x0004;
+pub const SCTP_ASSOC_RESET_FAILED: ::c_int = 0x0008;
+
+pub const SCTP_STREAM_CHANGE_DENIED: ::c_int = 0x0004;
+pub const SCTP_STREAM_CHANGE_FAILED: ::c_int = 0x0008;
+
+pub const KENV_DUMP_LOADER: ::c_int = 4;
+pub const KENV_DUMP_STATIC: ::c_int = 5;
+
+pub const RB_PAUSE: ::c_int = 0x100000;
+pub const RB_REROOT: ::c_int = 0x200000;
+pub const RB_POWERCYCLE: ::c_int = 0x400000;
+pub const RB_PROBE: ::c_int = 0x10000000;
+pub const RB_MULTIPLE: ::c_int = 0x20000000;
+
+// sys/time.h
+pub const CLOCK_BOOTTIME: ::clockid_t = ::CLOCK_UPTIME;
+pub const CLOCK_REALTIME_COARSE: ::clockid_t = ::CLOCK_REALTIME_FAST;
+pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = ::CLOCK_MONOTONIC_FAST;
+
+// sys/timerfd.h
+
+pub const TFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
+pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC;
+pub const TFD_TIMER_ABSTIME: ::c_int = 0x01;
+pub const TFD_TIMER_CANCEL_ON_SET: ::c_int = 0x02;
+
+cfg_if! {
+    if #[cfg(libc_const_extern_fn)] {
+        pub const fn MAP_ALIGNED(a: ::c_int) -> ::c_int {
+            a << 24
+        }
+    } else {
+        pub fn MAP_ALIGNED(a: ::c_int) -> ::c_int {
+            a << 24
+        }
+    }
+}
+
+const_fn! {
+    {const} fn _ALIGN(p: usize) -> usize {
+        (p + _ALIGNBYTES) & !_ALIGNBYTES
+    }
+}
+
+f! {
+    pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
+        (cmsg as *mut ::c_uchar)
+            .offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        _ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
+    }
+
+    pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
+        -> *mut ::cmsghdr
+    {
+        if cmsg.is_null() {
+            return ::CMSG_FIRSTHDR(mhdr);
+        };
+        let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)
+            + _ALIGN(::mem::size_of::<::cmsghdr>());
+        let max = (*mhdr).msg_control as usize
+            + (*mhdr).msg_controllen as usize;
+        if next > max {
+            0 as *mut ::cmsghdr
+        } else {
+            (cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize))
+                as *mut ::cmsghdr
+        }
+    }
+
+    pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
+        (_ALIGN(::mem::size_of::<::cmsghdr>()) + _ALIGN(length as usize))
+            as ::c_uint
+    }
+
+    pub fn MALLOCX_ALIGN(lg: ::c_uint) -> ::c_int {
+        ffsl(lg as ::c_long - 1)
+    }
+
+    pub {const} fn MALLOCX_TCACHE(tc: ::c_int) -> ::c_int {
+        (tc + 2) << 8 as ::c_int
+    }
+
+    pub {const} fn MALLOCX_ARENA(a: ::c_int) -> ::c_int {
+        (a + 1) << 20 as ::c_int
+    }
+
+    pub fn SOCKCREDSIZE(ngrps: usize) -> usize {
+        let ngrps = if ngrps > 0 {
+            ngrps - 1
+        } else {
+            0
+        };
+        ::mem::size_of::<sockcred>() + ::mem::size_of::<::gid_t>() * ngrps
+    }
+
+    pub fn uname(buf: *mut ::utsname) -> ::c_int {
+        __xuname(256, buf as *mut ::c_void)
+    }
+
+    pub fn CPU_ZERO(cpuset: &mut cpuset_t) -> () {
+        for slot in cpuset.__bits.iter_mut() {
+            *slot = 0;
+        }
+    }
+
+    pub fn CPU_FILL(cpuset: &mut cpuset_t) -> () {
+        for slot in cpuset.__bits.iter_mut() {
+            *slot = !0;
+        }
+    }
+
+    pub fn CPU_SET(cpu: usize, cpuset: &mut cpuset_t) -> () {
+        let bitset_bits = 8 * ::mem::size_of::<::c_long>();
+        let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits);
+        cpuset.__bits[idx] |= 1 << offset;
+        ()
+    }
+
+    pub fn CPU_CLR(cpu: usize, cpuset: &mut cpuset_t) -> () {
+        let bitset_bits = 8 * ::mem::size_of::<::c_long>();
+        let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits);
+        cpuset.__bits[idx] &= !(1 << offset);
+        ()
+    }
+
+    pub fn CPU_ISSET(cpu: usize, cpuset: &cpuset_t) -> bool {
+        let bitset_bits = 8 * ::mem::size_of::<::c_long>();
+        let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits);
+        0 != cpuset.__bits[idx] & (1 << offset)
+    }
+
+    pub fn CPU_COUNT(cpuset: &cpuset_t) -> ::c_int {
+        let mut s: u32 = 0;
+        let cpuset_size = ::mem::size_of::<cpuset_t>();
+        let bitset_size = ::mem::size_of::<::c_long>();
+
+        for i in cpuset.__bits[..(cpuset_size / bitset_size)].iter() {
+            s += i.count_ones();
+        };
+        s as ::c_int
+    }
+
+    pub fn SOCKCRED2SIZE(ngrps: usize) -> usize {
+        let ngrps = if ngrps > 0 {
+            ngrps - 1
+        } else {
+            0
+        };
+        ::mem::size_of::<sockcred2>() + ::mem::size_of::<::gid_t>() * ngrps
+    }
+
+    pub fn PROT_MAX(x: ::c_int) -> ::c_int {
+        x << 16
+    }
+
+    pub fn PROT_MAX_EXTRACT(x: ::c_int) -> ::c_int {
+        (x >> 16) & (::PROT_READ | ::PROT_WRITE | ::PROT_EXEC)
+    }
+}
+
+safe_f! {
+    pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
+        (status & 0o177) != 0o177 && (status & 0o177) != 0 && status != 0x13
+    }
+
+    pub {const} fn INVALID_SINFO_FLAG(x: ::c_int) -> bool {
+        (x) & 0xfffffff0 & !(SCTP_EOF | SCTP_ABORT | SCTP_UNORDERED |
+        SCTP_ADDR_OVER | SCTP_SENDALL | SCTP_EOR | SCTP_SACK_IMMEDIATELY) != 0
+    }
+
+    pub {const} fn PR_SCTP_POLICY(x: ::c_int) -> ::c_int {
+        x & 0x0f
+    }
+
+    pub {const} fn PR_SCTP_ENABLED(x: ::c_int) -> bool {
+        PR_SCTP_POLICY(x) != SCTP_PR_SCTP_NONE && PR_SCTP_POLICY(x) != SCTP_PR_SCTP_ALL
+    }
+
+    pub {const} fn PR_SCTP_TTL_ENABLED(x: ::c_int) -> bool {
+        PR_SCTP_POLICY(x) == SCTP_PR_SCTP_TTL
+    }
+
+    pub {const} fn PR_SCTP_BUF_ENABLED(x: ::c_int) -> bool {
+        PR_SCTP_POLICY(x) == SCTP_PR_SCTP_BUF
+    }
+
+    pub {const} fn PR_SCTP_RTX_ENABLED(x: ::c_int) -> bool {
+        PR_SCTP_POLICY(x) == SCTP_PR_SCTP_RTX
+    }
+
+    pub {const} fn PR_SCTP_INVALID_POLICY(x: ::c_int) -> bool {
+        PR_SCTP_POLICY(x) > SCTP_PR_SCTP_MAX
+    }
+
+    pub {const} fn PR_SCTP_VALID_POLICY(x: ::c_int) -> bool {
+        PR_SCTP_POLICY(x) <= SCTP_PR_SCTP_MAX
+    }
+}
+
+cfg_if! {
+    if #[cfg(not(any(freebsd10, freebsd11)))] {
+        extern "C" {
+            pub fn fhlink(fhp: *mut fhandle_t, to: *const ::c_char) -> ::c_int;
+            pub fn fhlinkat(fhp: *mut fhandle_t, tofd: ::c_int, to: *const ::c_char) -> ::c_int;
+            pub fn fhreadlink(
+                fhp: *mut fhandle_t,
+                buf: *mut ::c_char,
+                bufsize: ::size_t,
+            ) -> ::c_int;
+            pub fn getfhat(
+                fd: ::c_int,
+                path: *mut ::c_char,
+                fhp: *mut fhandle,
+                flag: ::c_int,
+            ) -> ::c_int;
+        }
+    }
+}
+
+extern "C" {
+    #[cfg_attr(doc, doc(alias = "__errno_location"))]
+    #[cfg_attr(doc, doc(alias = "errno"))]
+    pub fn __error() -> *mut ::c_int;
+
+    pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
+    pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_readv(aiocbp: *mut ::aiocb) -> ::c_int;
+    pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
+    pub fn aio_suspend(
+        aiocb_list: *const *const aiocb,
+        nitems: ::c_int,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_writev(aiocbp: *mut ::aiocb) -> ::c_int;
+
+    pub fn copy_file_range(
+        infd: ::c_int,
+        inoffp: *mut ::off_t,
+        outfd: ::c_int,
+        outoffp: *mut ::off_t,
+        len: ::size_t,
+        flags: ::c_uint,
+    ) -> ::ssize_t;
+
+    pub fn devname_r(
+        dev: ::dev_t,
+        mode: ::mode_t,
+        buf: *mut ::c_char,
+        len: ::c_int,
+    ) -> *mut ::c_char;
+
+    pub fn extattr_delete_fd(
+        fd: ::c_int,
+        attrnamespace: ::c_int,
+        attrname: *const ::c_char,
+    ) -> ::c_int;
+    pub fn extattr_delete_file(
+        path: *const ::c_char,
+        attrnamespace: ::c_int,
+        attrname: *const ::c_char,
+    ) -> ::c_int;
+    pub fn extattr_delete_link(
+        path: *const ::c_char,
+        attrnamespace: ::c_int,
+        attrname: *const ::c_char,
+    ) -> ::c_int;
+    pub fn extattr_get_fd(
+        fd: ::c_int,
+        attrnamespace: ::c_int,
+        attrname: *const ::c_char,
+        data: *mut ::c_void,
+        nbytes: ::size_t,
+    ) -> ::ssize_t;
+    pub fn extattr_get_file(
+        path: *const ::c_char,
+        attrnamespace: ::c_int,
+        attrname: *const ::c_char,
+        data: *mut ::c_void,
+        nbytes: ::size_t,
+    ) -> ::ssize_t;
+    pub fn extattr_get_link(
+        path: *const ::c_char,
+        attrnamespace: ::c_int,
+        attrname: *const ::c_char,
+        data: *mut ::c_void,
+        nbytes: ::size_t,
+    ) -> ::ssize_t;
+    pub fn extattr_list_fd(
+        fd: ::c_int,
+        attrnamespace: ::c_int,
+        data: *mut ::c_void,
+        nbytes: ::size_t,
+    ) -> ::ssize_t;
+    pub fn extattr_list_file(
+        path: *const ::c_char,
+        attrnamespace: ::c_int,
+        data: *mut ::c_void,
+        nbytes: ::size_t,
+    ) -> ::ssize_t;
+    pub fn extattr_list_link(
+        path: *const ::c_char,
+        attrnamespace: ::c_int,
+        data: *mut ::c_void,
+        nbytes: ::size_t,
+    ) -> ::ssize_t;
+    pub fn extattr_set_fd(
+        fd: ::c_int,
+        attrnamespace: ::c_int,
+        attrname: *const ::c_char,
+        data: *const ::c_void,
+        nbytes: ::size_t,
+    ) -> ::ssize_t;
+    pub fn extattr_set_file(
+        path: *const ::c_char,
+        attrnamespace: ::c_int,
+        attrname: *const ::c_char,
+        data: *const ::c_void,
+        nbytes: ::size_t,
+    ) -> ::ssize_t;
+    pub fn extattr_set_link(
+        path: *const ::c_char,
+        attrnamespace: ::c_int,
+        attrname: *const ::c_char,
+        data: *const ::c_void,
+        nbytes: ::size_t,
+    ) -> ::ssize_t;
+
+    pub fn fspacectl(
+        fd: ::c_int,
+        cmd: ::c_int,
+        rqsr: *const spacectl_range,
+        flags: ::c_int,
+        rmsr: *mut spacectl_range,
+    ) -> ::c_int;
+
+    pub fn jail(jail: *mut ::jail) -> ::c_int;
+    pub fn jail_attach(jid: ::c_int) -> ::c_int;
+    pub fn jail_remove(jid: ::c_int) -> ::c_int;
+    pub fn jail_get(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
+    pub fn jail_set(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
+
+    pub fn lio_listio(
+        mode: ::c_int,
+        aiocb_list: *const *mut aiocb,
+        nitems: ::c_int,
+        sevp: *mut sigevent,
+    ) -> ::c_int;
+
+    pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
+    pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
+
+    pub fn getutxuser(user: *const ::c_char) -> *mut utmpx;
+    pub fn setutxdb(_type: ::c_int, file: *const ::c_char) -> ::c_int;
+
+    pub fn aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::ssize_t;
+    pub fn mq_getfd_np(mqd: ::mqd_t) -> ::c_int;
+
+    pub fn waitid(
+        idtype: idtype_t,
+        id: ::id_t,
+        infop: *mut ::siginfo_t,
+        options: ::c_int,
+    ) -> ::c_int;
+    pub fn ptsname_r(fd: ::c_int, buf: *mut ::c_char, buflen: ::size_t) -> ::c_int;
+
+    pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
+    pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
+    pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
+    pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
+    pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
+    pub fn semget(key: ::key_t, nsems: ::c_int, semflg: ::c_int) -> ::c_int;
+    pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
+    pub fn semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int;
+    pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut ::msqid_ds) -> ::c_int;
+    pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
+    pub fn msgsnd(
+        msqid: ::c_int,
+        msgp: *const ::c_void,
+        msgsz: ::size_t,
+        msgflg: ::c_int,
+    ) -> ::c_int;
+    pub fn cfmakesane(termios: *mut ::termios);
+
+    pub fn pdfork(fdp: *mut ::c_int, flags: ::c_int) -> ::pid_t;
+    pub fn pdgetpid(fd: ::c_int, pidp: *mut ::pid_t) -> ::c_int;
+    pub fn pdkill(fd: ::c_int, signum: ::c_int) -> ::c_int;
+
+    pub fn rtprio_thread(function: ::c_int, lwpid: ::lwpid_t, rtp: *mut super::rtprio) -> ::c_int;
+
+    pub fn posix_spawn(
+        pid: *mut ::pid_t,
+        path: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawnp(
+        pid: *mut ::pid_t,
+        file: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
+    pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
+    pub fn posix_spawnattr_getsigdefault(
+        attr: *const posix_spawnattr_t,
+        default: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigdefault(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getsigmask(
+        attr: *const posix_spawnattr_t,
+        default: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigmask(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getflags(
+        attr: *const posix_spawnattr_t,
+        flags: *mut ::c_short,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int;
+    pub fn posix_spawnattr_getpgroup(
+        attr: *const posix_spawnattr_t,
+        flags: *mut ::pid_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
+    pub fn posix_spawnattr_getschedpolicy(
+        attr: *const posix_spawnattr_t,
+        flags: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int;
+    pub fn posix_spawnattr_getschedparam(
+        attr: *const posix_spawnattr_t,
+        param: *mut ::sched_param,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setschedparam(
+        attr: *mut posix_spawnattr_t,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+
+    pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+    pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+    pub fn posix_spawn_file_actions_addopen(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+        path: *const ::c_char,
+        oflag: ::c_int,
+        mode: ::mode_t,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_addclose(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_adddup2(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+        newfd: ::c_int,
+    ) -> ::c_int;
+
+    pub fn uuidgen(store: *mut uuid, count: ::c_int) -> ::c_int;
+
+    pub fn thr_kill(id: ::c_long, sig: ::c_int) -> ::c_int;
+    pub fn thr_kill2(pid: ::pid_t, id: ::c_long, sig: ::c_int) -> ::c_int;
+    pub fn thr_self(tid: *mut ::c_long) -> ::c_int;
+    pub fn pthread_getthreadid_np() -> ::c_int;
+    pub fn pthread_getaffinity_np(
+        td: ::pthread_t,
+        cpusetsize: ::size_t,
+        cpusetp: *mut cpuset_t,
+    ) -> ::c_int;
+    pub fn pthread_setaffinity_np(
+        td: ::pthread_t,
+        cpusetsize: ::size_t,
+        cpusetp: *const cpuset_t,
+    ) -> ::c_int;
+
+    // sched.h linux compatibility api
+    pub fn sched_getaffinity(pid: ::pid_t, cpusetsz: ::size_t, cpuset: *mut ::cpuset_t) -> ::c_int;
+    pub fn sched_setaffinity(
+        pid: ::pid_t,
+        cpusetsz: ::size_t,
+        cpuset: *const ::cpuset_t,
+    ) -> ::c_int;
+    pub fn sched_getcpu() -> ::c_int;
+
+    pub fn pthread_mutex_consistent(mutex: *mut ::pthread_mutex_t) -> ::c_int;
+
+    pub fn pthread_mutexattr_getrobust(
+        attr: *mut ::pthread_mutexattr_t,
+        robust: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_mutexattr_setrobust(
+        attr: *mut ::pthread_mutexattr_t,
+        robust: ::c_int,
+    ) -> ::c_int;
+
+    pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
+    pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int;
+
+    #[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = "statfs@FBSD_1.0")]
+    pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
+    #[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = "fstatfs@FBSD_1.0")]
+    pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
+
+    pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn __xuname(nmln: ::c_int, buf: *mut ::c_void) -> ::c_int;
+
+    pub fn sendmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::size_t,
+        flags: ::c_int,
+    ) -> ::ssize_t;
+    pub fn recvmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::size_t,
+        flags: ::c_int,
+        timeout: *const ::timespec,
+    ) -> ::ssize_t;
+    pub fn memmem(
+        haystack: *const ::c_void,
+        haystacklen: ::size_t,
+        needle: *const ::c_void,
+        needlelen: ::size_t,
+    ) -> *mut ::c_void;
+
+    pub fn fhopen(fhp: *const fhandle_t, flags: ::c_int) -> ::c_int;
+    pub fn fhstat(fhp: *const fhandle, buf: *mut ::stat) -> ::c_int;
+    pub fn fhstatfs(fhp: *const fhandle_t, buf: *mut ::statfs) -> ::c_int;
+    pub fn getfh(path: *const ::c_char, fhp: *mut fhandle_t) -> ::c_int;
+    pub fn lgetfh(path: *const ::c_char, fhp: *mut fhandle_t) -> ::c_int;
+    pub fn getfsstat(buf: *mut ::statfs, bufsize: ::c_long, mode: ::c_int) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "freebsd", freebsd11),
+        link_name = "getmntinfo@FBSD_1.0"
+    )]
+    pub fn getmntinfo(mntbufp: *mut *mut ::statfs, mode: ::c_int) -> ::c_int;
+    pub fn mount(
+        type_: *const ::c_char,
+        dir: *const ::c_char,
+        flags: ::c_int,
+        data: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn nmount(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
+
+    pub fn setproctitle(fmt: *const ::c_char, ...);
+    pub fn rfork(flags: ::c_int) -> ::c_int;
+    pub fn cpuset_getaffinity(
+        level: cpulevel_t,
+        which: cpuwhich_t,
+        id: ::id_t,
+        setsize: ::size_t,
+        mask: *mut cpuset_t,
+    ) -> ::c_int;
+    pub fn cpuset_setaffinity(
+        level: cpulevel_t,
+        which: cpuwhich_t,
+        id: ::id_t,
+        setsize: ::size_t,
+        mask: *const cpuset_t,
+    ) -> ::c_int;
+    pub fn cpuset(setid: *mut ::cpusetid_t) -> ::c_int;
+    pub fn cpuset_getid(
+        level: cpulevel_t,
+        which: cpuwhich_t,
+        id: ::id_t,
+        setid: *mut ::cpusetid_t,
+    ) -> ::c_int;
+    pub fn cpuset_setid(which: cpuwhich_t, id: ::id_t, setid: ::cpusetid_t) -> ::c_int;
+    pub fn cap_enter() -> ::c_int;
+    pub fn cap_getmode(modep: *mut ::c_uint) -> ::c_int;
+    pub fn cap_fcntls_get(fd: ::c_int, fcntlrightsp: *mut u32) -> ::c_int;
+    pub fn cap_fcntls_limit(fd: ::c_int, fcntlrights: u32) -> ::c_int;
+    pub fn cap_ioctls_get(fd: ::c_int, cmds: *mut u_long, maxcmds: usize) -> isize;
+    pub fn cap_ioctls_limit(fd: ::c_int, cmds: *const u_long, ncmds: usize) -> ::c_int;
+    pub fn __cap_rights_init(version: ::c_int, rights: *mut cap_rights_t, ...)
+        -> *mut cap_rights_t;
+    pub fn __cap_rights_get(version: ::c_int, fd: ::c_int, rightsp: *mut cap_rights_t) -> ::c_int;
+    pub fn __cap_rights_set(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t;
+    pub fn __cap_rights_clear(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t;
+    pub fn __cap_rights_is_set(rights: *const cap_rights_t, ...) -> bool;
+    pub fn cap_rights_is_valid(rights: *const cap_rights_t) -> bool;
+    pub fn cap_rights_limit(fd: ::c_int, rights: *const cap_rights_t) -> ::c_int;
+    pub fn cap_rights_merge(dst: *mut cap_rights_t, src: *const cap_rights_t) -> *mut cap_rights_t;
+    pub fn cap_rights_remove(dst: *mut cap_rights_t, src: *const cap_rights_t)
+        -> *mut cap_rights_t;
+    pub fn cap_rights_contains(big: *const cap_rights_t, little: *const cap_rights_t) -> bool;
+    pub fn cap_sandboxed() -> bool;
+
+    pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
+
+    pub fn ffs(value: ::c_int) -> ::c_int;
+    pub fn ffsl(value: ::c_long) -> ::c_int;
+    pub fn ffsll(value: ::c_longlong) -> ::c_int;
+    pub fn fls(value: ::c_int) -> ::c_int;
+    pub fn flsl(value: ::c_long) -> ::c_int;
+    pub fn flsll(value: ::c_longlong) -> ::c_int;
+    pub fn malloc_stats_print(
+        write_cb: unsafe extern "C" fn(*mut ::c_void, *const ::c_char),
+        cbopaque: *mut ::c_void,
+        opt: *const ::c_char,
+    );
+    pub fn mallctl(
+        name: *const ::c_char,
+        oldp: *mut ::c_void,
+        oldlenp: *mut ::size_t,
+        newp: *mut ::c_void,
+        newlen: ::size_t,
+    ) -> ::c_int;
+    pub fn mallctlnametomib(
+        name: *const ::c_char,
+        mibp: *mut ::size_t,
+        miplen: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn mallctlbymib(
+        mib: *const ::size_t,
+        mible: ::size_t,
+        oldp: *mut ::c_void,
+        oldlenp: *mut ::size_t,
+        newp: *mut ::c_void,
+        newlen: ::size_t,
+    ) -> ::c_int;
+    pub fn mallocx(size: ::size_t, flags: ::c_int) -> *mut ::c_void;
+    pub fn rallocx(ptr: *mut ::c_void, size: ::size_t, flags: ::c_int) -> *mut ::c_void;
+    pub fn xallocx(ptr: *mut ::c_void, size: ::size_t, extra: ::size_t, flags: ::c_int)
+        -> ::size_t;
+    pub fn sallocx(ptr: *const ::c_void, flags: ::c_int) -> ::size_t;
+    pub fn dallocx(ptr: *mut ::c_void, flags: ::c_int);
+    pub fn sdallocx(ptr: *mut ::c_void, size: ::size_t, flags: ::c_int);
+    pub fn nallocx(size: ::size_t, flags: ::c_int) -> ::size_t;
+
+    pub fn procctl(idtype: ::idtype_t, id: ::id_t, cmd: ::c_int, data: *mut ::c_void) -> ::c_int;
+
+    pub fn getpagesize() -> ::c_int;
+    pub fn getpagesizes(pagesize: *mut ::size_t, nelem: ::c_int) -> ::c_int;
+
+    pub fn clock_getcpuclockid2(arg1: ::id_t, arg2: ::c_int, arg3: *mut clockid_t) -> ::c_int;
+    pub fn strchrnul(s: *const ::c_char, c: ::c_int) -> *mut ::c_char;
+
+    pub fn shm_create_largepage(
+        path: *const ::c_char,
+        flags: ::c_int,
+        psind: ::c_int,
+        alloc_policy: ::c_int,
+        mode: ::mode_t,
+    ) -> ::c_int;
+    pub fn shm_rename(
+        path_from: *const ::c_char,
+        path_to: *const ::c_char,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
+    pub fn setaudit(auditinfo: *const auditinfo_t) -> ::c_int;
+
+    pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
+    pub fn eventfd_read(fd: ::c_int, value: *mut eventfd_t) -> ::c_int;
+    pub fn eventfd_write(fd: ::c_int, value: eventfd_t) -> ::c_int;
+
+    pub fn fdatasync(fd: ::c_int) -> ::c_int;
+
+    pub fn elf_aux_info(aux: ::c_int, buf: *mut ::c_void, buflen: ::c_int) -> ::c_int;
+    pub fn setproctitle_fast(fmt: *const ::c_char, ...);
+    pub fn timingsafe_bcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int;
+    pub fn timingsafe_memcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int;
+
+    pub fn _umtx_op(
+        obj: *mut ::c_void,
+        op: ::c_int,
+        val: ::c_ulong,
+        uaddr: *mut ::c_void,
+        uaddr2: *mut ::c_void,
+    ) -> ::c_int;
+
+    pub fn sctp_peeloff(s: ::c_int, id: ::sctp_assoc_t) -> ::c_int;
+    pub fn sctp_bindx(s: ::c_int, addrs: *mut ::sockaddr, num: ::c_int, tpe: ::c_int) -> ::c_int;
+    pub fn sctp_connectx(
+        s: ::c_int,
+        addrs: *const ::sockaddr,
+        addrcnt: ::c_int,
+        id: *mut ::sctp_assoc_t,
+    ) -> ::c_int;
+    pub fn sctp_getaddrlen(family: ::sa_family_t) -> ::c_int;
+    pub fn sctp_getpaddrs(
+        s: ::c_int,
+        asocid: ::sctp_assoc_t,
+        addrs: *mut *mut ::sockaddr,
+    ) -> ::c_int;
+    pub fn sctp_freepaddrs(addrs: *mut ::sockaddr);
+    pub fn sctp_getladdrs(
+        s: ::c_int,
+        asocid: ::sctp_assoc_t,
+        addrs: *mut *mut ::sockaddr,
+    ) -> ::c_int;
+    pub fn sctp_freeladdrs(addrs: *mut ::sockaddr);
+    pub fn sctp_opt_info(
+        s: ::c_int,
+        id: ::sctp_assoc_t,
+        opt: ::c_int,
+        arg: *mut ::c_void,
+        size: *mut ::socklen_t,
+    ) -> ::c_int;
+    pub fn sctp_sendv(
+        sd: ::c_int,
+        iov: *const ::iovec,
+        iovcnt: ::c_int,
+        addrs: *mut ::sockaddr,
+        addrcnt: ::c_int,
+        info: *mut ::c_void,
+        infolen: ::socklen_t,
+        infotype: ::c_uint,
+        flags: ::c_int,
+    ) -> ::ssize_t;
+    pub fn sctp_recvv(
+        sd: ::c_int,
+        iov: *const ::iovec,
+        iovcnt: ::c_int,
+        from: *mut ::sockaddr,
+        fromlen: *mut ::socklen_t,
+        info: *mut ::c_void,
+        infolen: *mut ::socklen_t,
+        infotype: *mut ::c_uint,
+        flags: *mut ::c_int,
+    ) -> ::ssize_t;
+
+    pub fn timerfd_create(clockid: ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn timerfd_gettime(fd: ::c_int, curr_value: *mut itimerspec) -> ::c_int;
+    pub fn timerfd_settime(
+        fd: ::c_int,
+        flags: ::c_int,
+        new_value: *const itimerspec,
+        old_value: *mut itimerspec,
+    ) -> ::c_int;
+    pub fn closefrom(lowfd: ::c_int);
+    pub fn close_range(lowfd: ::c_uint, highfd: ::c_uint, flags: ::c_int) -> ::c_int;
+}
+
+#[link(name = "memstat")]
+extern "C" {
+    pub fn memstat_strerror(error: ::c_int) -> *const ::c_char;
+    pub fn memstat_mtl_alloc() -> *mut memory_type_list;
+    pub fn memstat_mtl_first(list: *mut memory_type_list) -> *mut memory_type;
+    pub fn memstat_mtl_next(mtp: *mut memory_type) -> *mut memory_type;
+    pub fn memstat_mtl_find(
+        list: *mut memory_type_list,
+        allocator: ::c_int,
+        name: *const ::c_char,
+    ) -> *mut memory_type;
+    pub fn memstat_mtl_free(list: *mut memory_type_list);
+    pub fn memstat_mtl_geterror(list: *mut memory_type_list) -> ::c_int;
+    pub fn memstat_get_name(mtp: *const memory_type) -> *const ::c_char;
+}
+
+#[link(name = "kvm")]
+extern "C" {
+    pub fn kvm_dpcpu_setcpu(kd: *mut ::kvm_t, cpu: ::c_uint) -> ::c_int;
+    pub fn kvm_getargv(kd: *mut ::kvm_t, p: *const kinfo_proc, nchr: ::c_int)
+        -> *mut *mut ::c_char;
+    pub fn kvm_getcptime(kd: *mut ::kvm_t, cp_time: *mut ::c_long) -> ::c_int;
+    pub fn kvm_getenvv(kd: *mut ::kvm_t, p: *const kinfo_proc, nchr: ::c_int)
+        -> *mut *mut ::c_char;
+    pub fn kvm_geterr(kd: *mut ::kvm_t) -> *mut ::c_char;
+    pub fn kvm_getmaxcpu(kd: *mut ::kvm_t) -> ::c_int;
+    pub fn kvm_getncpus(kd: *mut ::kvm_t) -> ::c_int;
+    pub fn kvm_getpcpu(kd: *mut ::kvm_t, cpu: ::c_int) -> *mut ::c_void;
+    pub fn kvm_counter_u64_fetch(kd: *mut ::kvm_t, base: ::c_ulong) -> u64;
+    pub fn kvm_getswapinfo(
+        kd: *mut ::kvm_t,
+        info: *mut kvm_swap,
+        maxswap: ::c_int,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn kvm_native(kd: *mut ::kvm_t) -> ::c_int;
+    pub fn kvm_nlist(kd: *mut ::kvm_t, nl: *mut nlist) -> ::c_int;
+    pub fn kvm_nlist2(kd: *mut ::kvm_t, nl: *mut kvm_nlist) -> ::c_int;
+    pub fn kvm_read_zpcpu(
+        kd: *mut ::kvm_t,
+        base: ::c_ulong,
+        buf: *mut ::c_void,
+        size: ::size_t,
+        cpu: ::c_int,
+    ) -> ::ssize_t;
+    pub fn kvm_read2(
+        kd: *mut ::kvm_t,
+        addr: kvaddr_t,
+        buf: *mut ::c_void,
+        nbytes: ::size_t,
+    ) -> ::ssize_t;
+}
+
+#[link(name = "util")]
+extern "C" {
+    pub fn extattr_namespace_to_string(
+        attrnamespace: ::c_int,
+        string: *mut *mut ::c_char,
+    ) -> ::c_int;
+    pub fn extattr_string_to_namespace(
+        string: *const ::c_char,
+        attrnamespace: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn realhostname(host: *mut ::c_char, hsize: ::size_t, ip: *const ::in_addr) -> ::c_int;
+    pub fn realhostname_sa(
+        host: *mut ::c_char,
+        hsize: ::size_t,
+        addr: *mut ::sockaddr,
+        addrlen: ::c_int,
+    ) -> ::c_int;
+
+    pub fn kld_isloaded(name: *const ::c_char) -> ::c_int;
+    pub fn kld_load(name: *const ::c_char) -> ::c_int;
+
+    pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::c_int) -> *mut kinfo_vmentry;
+
+    pub fn hexdump(ptr: *const ::c_void, length: ::c_int, hdr: *const ::c_char, flags: ::c_int);
+    pub fn humanize_number(
+        buf: *mut ::c_char,
+        len: ::size_t,
+        number: i64,
+        suffix: *const ::c_char,
+        scale: ::c_int,
+        flags: ::c_int,
+    ) -> ::c_int;
+
+    pub fn flopen(path: *const ::c_char, flags: ::c_int, ...) -> ::c_int;
+    pub fn flopenat(fd: ::c_int, path: *const ::c_char, flags: ::c_int, ...) -> ::c_int;
+
+    pub fn getlocalbase() -> *const ::c_char;
+
+    pub fn pidfile_open(
+        path: *const ::c_char,
+        mode: ::mode_t,
+        pidptr: *mut ::pid_t,
+    ) -> *mut ::pidfh;
+    pub fn pidfile_write(path: *mut ::pidfh) -> ::c_int;
+    pub fn pidfile_close(path: *mut ::pidfh) -> ::c_int;
+    pub fn pidfile_remove(path: *mut ::pidfh) -> ::c_int;
+    pub fn pidfile_fileno(path: *const ::pidfh) -> ::c_int;
+    // FIXME: pidfile_signal in due time (both manpage present and updated image snapshot)
+}
+
+#[link(name = "procstat")]
+extern "C" {
+    pub fn procstat_open_sysctl() -> *mut procstat;
+    pub fn procstat_getfiles(
+        procstat: *mut procstat,
+        kp: *mut kinfo_proc,
+        mmapped: ::c_int,
+    ) -> *mut filestat_list;
+    pub fn procstat_freefiles(procstat: *mut procstat, head: *mut filestat_list);
+    pub fn procstat_getprocs(
+        procstat: *mut procstat,
+        what: ::c_int,
+        arg: ::c_int,
+        count: *mut ::c_uint,
+    ) -> *mut kinfo_proc;
+    pub fn procstat_freeprocs(procstat: *mut procstat, p: *mut kinfo_proc);
+    pub fn procstat_getvmmap(
+        procstat: *mut procstat,
+        kp: *mut kinfo_proc,
+        count: *mut ::c_uint,
+    ) -> *mut kinfo_vmentry;
+    pub fn procstat_freevmmap(procstat: *mut procstat, vmmap: *mut kinfo_vmentry);
+    pub fn procstat_close(procstat: *mut procstat);
+    pub fn procstat_freeargv(procstat: *mut procstat);
+    pub fn procstat_freeenvv(procstat: *mut procstat);
+    pub fn procstat_freegroups(procstat: *mut procstat, groups: *mut ::gid_t);
+    pub fn procstat_freeptlwpinfo(procstat: *mut procstat, pl: *mut ptrace_lwpinfo);
+    pub fn procstat_getargv(
+        procstat: *mut procstat,
+        kp: *mut kinfo_proc,
+        nchr: ::size_t,
+    ) -> *mut *mut ::c_char;
+    pub fn procstat_getenvv(
+        procstat: *mut procstat,
+        kp: *mut kinfo_proc,
+        nchr: ::size_t,
+    ) -> *mut *mut ::c_char;
+    pub fn procstat_getgroups(
+        procstat: *mut procstat,
+        kp: *mut kinfo_proc,
+        count: *mut ::c_uint,
+    ) -> *mut ::gid_t;
+    pub fn procstat_getosrel(
+        procstat: *mut procstat,
+        kp: *mut kinfo_proc,
+        osrelp: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn procstat_getpathname(
+        procstat: *mut procstat,
+        kp: *mut kinfo_proc,
+        pathname: *mut ::c_char,
+        maxlen: ::size_t,
+    ) -> ::c_int;
+    pub fn procstat_getrlimit(
+        procstat: *mut procstat,
+        kp: *mut kinfo_proc,
+        which: ::c_int,
+        rlimit: *mut ::rlimit,
+    ) -> ::c_int;
+    pub fn procstat_getumask(
+        procstat: *mut procstat,
+        kp: *mut kinfo_proc,
+        maskp: *mut ::c_ushort,
+    ) -> ::c_int;
+    pub fn procstat_open_core(filename: *const ::c_char) -> *mut procstat;
+    pub fn procstat_open_kvm(nlistf: *const ::c_char, memf: *const ::c_char) -> *mut procstat;
+    pub fn procstat_get_socket_info(
+        proc_: *mut procstat,
+        fst: *mut filestat,
+        sock: *mut sockstat,
+        errbuf: *mut ::c_char,
+    ) -> ::c_int;
+    pub fn procstat_get_vnode_info(
+        proc_: *mut procstat,
+        fst: *mut filestat,
+        vn: *mut vnstat,
+        errbuf: *mut ::c_char,
+    ) -> ::c_int;
+    pub fn procstat_get_pts_info(
+        proc_: *mut procstat,
+        fst: *mut filestat,
+        pts: *mut ptsstat,
+        errbuf: *mut ::c_char,
+    ) -> ::c_int;
+    pub fn procstat_get_shm_info(
+        proc_: *mut procstat,
+        fst: *mut filestat,
+        shm: *mut shmstat,
+        errbuf: *mut ::c_char,
+    ) -> ::c_int;
+}
+
+#[link(name = "rt")]
+extern "C" {
+    pub fn timer_create(clock_id: clockid_t, evp: *mut sigevent, timerid: *mut timer_t) -> ::c_int;
+    pub fn timer_delete(timerid: timer_t) -> ::c_int;
+    pub fn timer_getoverrun(timerid: timer_t) -> ::c_int;
+    pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> ::c_int;
+    pub fn timer_settime(
+        timerid: timer_t,
+        flags: ::c_int,
+        value: *const itimerspec,
+        ovalue: *mut itimerspec,
+    ) -> ::c_int;
+}
+
+#[link(name = "devstat")]
+extern "C" {
+    pub fn devstat_getnumdevs(kd: *mut ::kvm_t) -> ::c_int;
+    pub fn devstat_getgeneration(kd: *mut ::kvm_t) -> ::c_long;
+    pub fn devstat_getversion(kd: *mut ::kvm_t) -> ::c_int;
+    pub fn devstat_checkversion(kd: *mut ::kvm_t) -> ::c_int;
+    pub fn devstat_selectdevs(
+        dev_select: *mut *mut device_selection,
+        num_selected: *mut ::c_int,
+        num_selections: *mut ::c_int,
+        select_generation: *mut ::c_long,
+        current_generation: ::c_long,
+        devices: *mut devstat,
+        numdevs: ::c_int,
+        matches: *mut devstat_match,
+        num_matches: ::c_int,
+        dev_selections: *mut *mut ::c_char,
+        num_dev_selections: ::c_int,
+        select_mode: devstat_select_mode,
+        maxshowdevs: ::c_int,
+        perf_select: ::c_int,
+    ) -> ::c_int;
+    pub fn devstat_buildmatch(
+        match_str: *mut ::c_char,
+        matches: *mut *mut devstat_match,
+        num_matches: *mut ::c_int,
+    ) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(freebsd15)] {
+        mod freebsd15;
+        pub use self::freebsd15::*;
+    } else if #[cfg(freebsd14)] {
+        mod freebsd14;
+        pub use self::freebsd14::*;
+    } else if #[cfg(freebsd13)] {
+        mod freebsd13;
+        pub use self::freebsd13::*;
+    } else if #[cfg(freebsd12)] {
+        mod freebsd12;
+        pub use self::freebsd12::*;
+    } else if #[cfg(any(freebsd10, freebsd11))] {
+        mod freebsd11;
+        pub use self::freebsd11::*;
+    } else {
+        // Unknown freebsd version
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "x86")] {
+        mod x86;
+        pub use self::x86::*;
+    } else if #[cfg(target_arch = "x86_64")] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    } else if #[cfg(target_arch = "aarch64")] {
+        mod aarch64;
+        pub use self::aarch64::*;
+    } else if #[cfg(target_arch = "arm")] {
+        mod arm;
+        pub use self::arm::*;
+    } else if #[cfg(target_arch = "powerpc64")] {
+        mod powerpc64;
+        pub use self::powerpc64::*;
+    } else if #[cfg(target_arch = "powerpc")] {
+        mod powerpc;
+        pub use self::powerpc::*;
+    } else if #[cfg(target_arch = "riscv64")] {
+        mod riscv64;
+        pub use self::riscv64::*;
+    } else {
+        // Unknown target_arch
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,47 @@
+pub type c_char = u8;
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type wchar_t = i32;
+pub type time_t = i64;
+pub type suseconds_t = i32;
+pub type register_t = i32;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_size: ::off_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_blksize: ::blksize_t,
+        pub st_flags: ::fflags_t,
+        pub st_gen: u32,
+        pub st_lspare: i32,
+        pub st_birthtime: ::time_t,
+        pub st_birthtime_nsec: ::c_long,
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 4 - 1;
+    }
+}
+
+pub const MAP_32BIT: ::c_int = 0x00080000;
+pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,47 @@
+pub type c_char = u8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type wchar_t = i32;
+pub type time_t = i64;
+pub type suseconds_t = i64;
+pub type register_t = i64;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_size: ::off_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_blksize: ::blksize_t,
+        pub st_flags: ::fflags_t,
+        pub st_gen: u32,
+        pub st_lspare: i32,
+        pub st_birthtime: ::time_t,
+        pub st_birthtime_nsec: ::c_long,
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+pub const MAP_32BIT: ::c_int = 0x00080000;
+pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/riscv64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/riscv64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/riscv64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/riscv64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,154 @@
+pub type c_char = u8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type wchar_t = ::c_int;
+pub type time_t = i64;
+pub type suseconds_t = ::c_long;
+pub type register_t = i64;
+
+s_no_extra_traits! {
+    pub struct gpregs {
+        pub gp_ra: ::register_t,
+        pub gp_sp: ::register_t,
+        pub gp_gp: ::register_t,
+        pub gp_tp: ::register_t,
+        pub gp_t: [::register_t; 7],
+        pub gp_s: [::register_t; 12],
+        pub gp_a: [::register_t; 8],
+        pub gp_sepc: ::register_t,
+        pub gp_sstatus: ::register_t,
+    }
+
+    pub struct fpregs {
+        pub fp_x: [[::register_t; 2]; 32],
+        pub fp_fcsr: ::register_t,
+        pub fp_flags: ::c_int,
+        pub fp_pad: ::c_int,
+    }
+
+    pub struct mcontext_t {
+        pub mc_gpregs: gpregs,
+        pub mc_fpregs: fpregs,
+        pub mc_flags: ::c_int,
+        pub mc_pad: ::c_int,
+        pub mc_spare: [u64; 8],
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for gpregs {
+            fn eq(&self, other: &gpregs) -> bool {
+                self.gp_ra == other.gp_ra &&
+                self.gp_sp == other.gp_sp &&
+                self.gp_gp == other.gp_gp &&
+                self.gp_tp == other.gp_tp &&
+                self.gp_t.iter().zip(other.gp_t.iter()).all(|(a, b)| a == b) &&
+                self.gp_s.iter().zip(other.gp_s.iter()).all(|(a, b)| a == b) &&
+                self.gp_a.iter().zip(other.gp_a.iter()).all(|(a, b)| a == b) &&
+                self.gp_sepc == other.gp_sepc &&
+                self.gp_sstatus == other.gp_sstatus
+            }
+        }
+        impl Eq for gpregs {}
+        impl ::fmt::Debug for gpregs {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("gpregs")
+                    .field("gp_ra", &self.gp_ra)
+                    .field("gp_sp", &self.gp_sp)
+                    .field("gp_gp", &self.gp_gp)
+                    .field("gp_tp", &self.gp_tp)
+                    .field("gp_t", &self.gp_t)
+                    .field("gp_s", &self.gp_s)
+                    .field("gp_a", &self.gp_a)
+                    .field("gp_sepc", &self.gp_sepc)
+                    .field("gp_sstatus", &self.gp_sstatus)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for gpregs {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.gp_ra.hash(state);
+                self.gp_sp.hash(state);
+                self.gp_gp.hash(state);
+                self.gp_tp.hash(state);
+                self.gp_t.hash(state);
+                self.gp_s.hash(state);
+                self.gp_a.hash(state);
+                self.gp_sepc.hash(state);
+                self.gp_sstatus.hash(state);
+            }
+        }
+        impl PartialEq for fpregs {
+            fn eq(&self, other: &fpregs) -> bool {
+                self.fp_x == other.fp_x &&
+                self.fp_fcsr == other.fp_fcsr &&
+                self.fp_flags == other.fp_flags &&
+                self.fp_pad == other.fp_pad
+            }
+        }
+        impl Eq for fpregs {}
+        impl ::fmt::Debug for fpregs {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("fpregs")
+                    .field("fp_x", &self.fp_x)
+                    .field("fp_fcsr", &self.fp_fcsr)
+                    .field("fp_flags", &self.fp_flags)
+                    .field("fp_pad", &self.fp_pad)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for fpregs {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.fp_x.hash(state);
+                self.fp_fcsr.hash(state);
+                self.fp_flags.hash(state);
+                self.fp_pad.hash(state);
+            }
+        }
+        impl PartialEq for mcontext_t {
+            fn eq(&self, other: &mcontext_t) -> bool {
+                self.mc_gpregs == other.mc_gpregs &&
+                self.mc_fpregs == other.mc_fpregs &&
+                self.mc_flags == other.mc_flags &&
+                self.mc_pad == other.mc_pad &&
+                self.mc_spare.iter().zip(other.mc_spare.iter()).all(|(a, b)| a == b)
+            }
+        }
+        impl Eq for mcontext_t {}
+        impl ::fmt::Debug for mcontext_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("mcontext_t")
+                    .field("mc_gpregs", &self.mc_gpregs)
+                    .field("mc_fpregs", &self.mc_fpregs)
+                    .field("mc_flags", &self.mc_flags)
+                    .field("mc_pad", &self.mc_pad)
+                    .field("mc_spare", &self.mc_spare)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for mcontext_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.mc_gpregs.hash(state);
+                self.mc_fpregs.hash(state);
+                self.mc_flags.hash(state);
+                self.mc_pad.hash(state);
+                self.mc_spare.hash(state);
+            }
+        }
+    }
+}
+
+pub const MAP_32BIT: ::c_int = 0x00080000;
+pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,201 @@
+pub type c_char = i8;
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type wchar_t = i32;
+pub type time_t = i32;
+pub type suseconds_t = i32;
+pub type register_t = i32;
+
+s_no_extra_traits! {
+    pub struct mcontext_t {
+        pub mc_onstack: register_t,
+        pub mc_gs: register_t,
+        pub mc_fs: register_t,
+        pub mc_es: register_t,
+        pub mc_ds: register_t,
+        pub mc_edi: register_t,
+        pub mc_esi: register_t,
+        pub mc_ebp: register_t,
+        pub mc_isp: register_t,
+        pub mc_ebx: register_t,
+        pub mc_edx: register_t,
+        pub mc_ecx: register_t,
+        pub mc_eax: register_t,
+        pub mc_trapno: register_t,
+        pub mc_err: register_t,
+        pub mc_eip: register_t,
+        pub mc_cs: register_t,
+        pub mc_eflags: register_t,
+        pub mc_esp: register_t,
+        pub mc_ss: register_t,
+        pub mc_len: ::c_int,
+        pub mc_fpformat: ::c_int,
+        pub mc_ownedfp: ::c_int,
+        pub mc_flags: register_t,
+        pub mc_fpstate: [[::c_int; 32]; 4],
+        pub mc_fsbase: register_t,
+        pub mc_gsbase: register_t,
+        pub mc_xfpustate: register_t,
+        pub mc_xfpustate_len: register_t,
+        pub mc_spare2: [::c_int; 4],
+    }
+}
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_size: ::off_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_blksize: ::blksize_t,
+        pub st_flags: ::fflags_t,
+        pub st_gen: u32,
+        pub st_lspare: i32,
+        pub st_birthtime: ::time_t,
+        pub st_birthtime_nsec: ::c_long,
+        __unused: [u8; 8],
+    }
+
+    pub struct ucontext_t {
+        pub uc_sigmask: ::sigset_t,
+        pub uc_mcontext: ::mcontext_t,
+        pub uc_link: *mut ::ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_flags: ::c_int,
+        __spare__: [::c_int; 4],
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 4 - 1;
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for mcontext_t {
+            fn eq(&self, other: &mcontext_t) -> bool {
+                self.mc_onstack == other.mc_onstack &&
+                self.mc_gs == other.mc_gs &&
+                self.mc_fs == other.mc_fs &&
+                self.mc_es == other.mc_es &&
+                self.mc_ds == other.mc_ds &&
+                self.mc_edi == other.mc_edi &&
+                self.mc_esi == other.mc_esi &&
+                self.mc_ebp == other.mc_ebp &&
+                self.mc_isp == other.mc_isp &&
+                self.mc_ebx == other.mc_ebx &&
+                self.mc_edx == other.mc_edx &&
+                self.mc_ecx == other.mc_ecx &&
+                self.mc_eax == other.mc_eax &&
+                self.mc_trapno == other.mc_trapno &&
+                self.mc_err == other.mc_err &&
+                self.mc_eip == other.mc_eip &&
+                self.mc_cs == other.mc_cs &&
+                self.mc_eflags == other.mc_eflags &&
+                self.mc_esp == other.mc_esp &&
+                self.mc_ss == other.mc_ss &&
+                self.mc_len == other.mc_len &&
+                self.mc_fpformat == other.mc_fpformat &&
+                self.mc_ownedfp == other.mc_ownedfp &&
+                self.mc_flags == other.mc_flags &&
+                self.mc_fpstate.iter().zip(other.mc_fpstate.iter()).all(|(a, b)| a == b) &&
+                self.mc_fsbase == other.mc_fsbase &&
+                self.mc_gsbase == other.mc_gsbase &&
+                self.mc_xfpustate == other.mc_xfpustate &&
+                self.mc_xfpustate_len == other.mc_xfpustate_len &&
+                self.mc_spare2.iter().zip(other.mc_spare2.iter()).all(|(a, b)| a == b)
+            }
+        }
+        impl Eq for mcontext_t {}
+        impl ::fmt::Debug for mcontext_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("mcontext_t")
+                    .field("mc_onstack", &self.mc_onstack)
+                    .field("mc_gs", &self.mc_gs)
+                    .field("mc_fs", &self.mc_fs)
+                    .field("mc_es", &self.mc_es)
+                    .field("mc_ds", &self.mc_ds)
+                    .field("mc_edi", &self.mc_edi)
+                    .field("mc_esi", &self.mc_esi)
+                    .field("mc_ebp", &self.mc_ebp)
+                    .field("mc_isp", &self.mc_isp)
+                    .field("mc_ebx", &self.mc_ebx)
+                    .field("mc_edx", &self.mc_edx)
+                    .field("mc_ecx", &self.mc_ecx)
+                    .field("mc_eax", &self.mc_eax)
+                    .field("mc_trapno", &self.mc_trapno)
+                    .field("mc_err", &self.mc_err)
+                    .field("mc_eip", &self.mc_eip)
+                    .field("mc_cs", &self.mc_cs)
+                    .field("mc_eflags", &self.mc_eflags)
+                    .field("mc_esp", &self.mc_esp)
+                    .field("mc_ss", &self.mc_ss)
+                    .field("mc_len", &self.mc_len)
+                    .field("mc_fpformat", &self.mc_fpformat)
+                    .field("mc_ownedfp", &self.mc_ownedfp)
+                    .field("mc_flags", &self.mc_flags)
+                    .field("mc_fpstate", &self.mc_fpstate)
+                    .field("mc_fsbase", &self.mc_fsbase)
+                    .field("mc_gsbase", &self.mc_gsbase)
+                    .field("mc_xfpustate", &self.mc_xfpustate)
+                    .field("mc_xfpustate_len", &self.mc_xfpustate_len)
+                    .field("mc_spare2", &self.mc_spare2)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for mcontext_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.mc_onstack.hash(state);
+                self.mc_gs.hash(state);
+                self.mc_fs.hash(state);
+                self.mc_es.hash(state);
+                self.mc_ds.hash(state);
+                self.mc_edi.hash(state);
+                self.mc_esi.hash(state);
+                self.mc_ebp.hash(state);
+                self.mc_isp.hash(state);
+                self.mc_ebx.hash(state);
+                self.mc_edx.hash(state);
+                self.mc_ecx.hash(state);
+                self.mc_eax.hash(state);
+                self.mc_trapno.hash(state);
+                self.mc_err.hash(state);
+                self.mc_eip.hash(state);
+                self.mc_cs.hash(state);
+                self.mc_eflags.hash(state);
+                self.mc_esp.hash(state);
+                self.mc_ss.hash(state);
+                self.mc_len.hash(state);
+                self.mc_fpformat.hash(state);
+                self.mc_ownedfp.hash(state);
+                self.mc_flags.hash(state);
+                self.mc_fpstate.hash(state);
+                self.mc_fsbase.hash(state);
+                self.mc_gsbase.hash(state);
+                self.mc_xfpustate.hash(state);
+                self.mc_xfpustate_len.hash(state);
+                self.mc_spare2.hash(state);
+            }
+        }
+    }
+}
+
+pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,197 @@
+use {c_long, register_t};
+
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f64; 4]
+    }
+
+    #[repr(align(16))]
+    pub struct mcontext_t {
+        pub mc_onstack: register_t,
+        pub mc_rdi: register_t,
+        pub mc_rsi: register_t,
+        pub mc_rdx: register_t,
+        pub mc_rcx: register_t,
+        pub mc_r8: register_t,
+        pub mc_r9: register_t,
+        pub mc_rax: register_t,
+        pub mc_rbx: register_t,
+        pub mc_rbp: register_t,
+        pub mc_r10: register_t,
+        pub mc_r11: register_t,
+        pub mc_r12: register_t,
+        pub mc_r13: register_t,
+        pub mc_r14: register_t,
+        pub mc_r15: register_t,
+        pub mc_trapno: u32,
+        pub mc_fs: u16,
+        pub mc_gs: u16,
+        pub mc_addr: register_t,
+        pub mc_flags: u32,
+        pub mc_es: u16,
+        pub mc_ds: u16,
+        pub mc_err: register_t,
+        pub mc_rip: register_t,
+        pub mc_cs: register_t,
+        pub mc_rflags: register_t,
+        pub mc_rsp: register_t,
+        pub mc_ss: register_t,
+        pub mc_len: c_long,
+        pub mc_fpformat: c_long,
+        pub mc_ownedfp: c_long,
+        pub mc_fpstate: [c_long; 64],
+        pub mc_fsbase: register_t,
+        pub mc_gsbase: register_t,
+        pub mc_xfpustate: register_t,
+        pub mc_xfpustate_len: register_t,
+        pub mc_spare: [c_long; 4],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for mcontext_t {
+            fn eq(&self, other: &mcontext_t) -> bool {
+                self.mc_onstack == other.mc_onstack &&
+                self.mc_rdi == other.mc_rdi &&
+                self.mc_rsi == other.mc_rsi &&
+                self.mc_rdx == other.mc_rdx &&
+                self.mc_rcx == other.mc_rcx &&
+                self.mc_r8 == other.mc_r8 &&
+                self.mc_r9 == other.mc_r9 &&
+                self.mc_rax == other.mc_rax &&
+                self.mc_rbx == other.mc_rbx &&
+                self.mc_rbp == other.mc_rbp &&
+                self.mc_r10 == other.mc_r10 &&
+                self.mc_r11 == other.mc_r11 &&
+                self.mc_r12 == other.mc_r12 &&
+                self.mc_r13 == other.mc_r13 &&
+                self.mc_r14 == other.mc_r14 &&
+                self.mc_r15 == other.mc_r15 &&
+                self.mc_trapno == other.mc_trapno &&
+                self.mc_fs == other.mc_fs &&
+                self.mc_gs == other.mc_gs &&
+                self.mc_addr == other.mc_addr &&
+                self.mc_flags == other.mc_flags &&
+                self.mc_es == other.mc_es &&
+                self.mc_ds == other.mc_ds &&
+                self.mc_err == other.mc_err &&
+                self.mc_rip == other.mc_rip &&
+                self.mc_cs == other.mc_cs &&
+                self.mc_rflags == other.mc_rflags &&
+                self.mc_rsp == other.mc_rsp &&
+                self.mc_ss == other.mc_ss &&
+                self.mc_len == other.mc_len &&
+                self.mc_fpformat == other.mc_fpformat &&
+                self.mc_ownedfp == other.mc_ownedfp &&
+                self.mc_fpstate.iter().zip(other.mc_fpstate.iter())
+                .all(|(a, b)| a == b) &&
+                self.mc_fsbase == other.mc_fsbase &&
+                self.mc_gsbase == other.mc_gsbase &&
+                self.mc_xfpustate == other.mc_xfpustate &&
+                self.mc_xfpustate_len == other.mc_xfpustate_len &&
+                self.mc_spare == other.mc_spare
+            }
+        }
+        impl Eq for mcontext_t {}
+        impl ::fmt::Debug for mcontext_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("mcontext_t")
+                    .field("mc_onstack", &self.mc_onstack)
+                    .field("mc_rdi", &self.mc_rdi)
+                    .field("mc_rsi", &self.mc_rsi)
+                    .field("mc_rdx", &self.mc_rdx)
+                    .field("mc_rcx", &self.mc_rcx)
+                    .field("mc_r8", &self.mc_r8)
+                    .field("mc_r9", &self.mc_r9)
+                    .field("mc_rax", &self.mc_rax)
+                    .field("mc_rbx", &self.mc_rbx)
+                    .field("mc_rbp", &self.mc_rbp)
+                    .field("mc_r10", &self.mc_r10)
+                    .field("mc_r11", &self.mc_r11)
+                    .field("mc_r12", &self.mc_r12)
+                    .field("mc_r13", &self.mc_r13)
+                    .field("mc_r14", &self.mc_r14)
+                    .field("mc_r15", &self.mc_r15)
+                    .field("mc_trapno", &self.mc_trapno)
+                    .field("mc_fs", &self.mc_fs)
+                    .field("mc_gs", &self.mc_gs)
+                    .field("mc_addr", &self.mc_addr)
+                    .field("mc_flags", &self.mc_flags)
+                    .field("mc_es", &self.mc_es)
+                    .field("mc_ds", &self.mc_ds)
+                    .field("mc_err", &self.mc_err)
+                    .field("mc_rip", &self.mc_rip)
+                    .field("mc_cs", &self.mc_cs)
+                    .field("mc_rflags", &self.mc_rflags)
+                    .field("mc_rsp", &self.mc_rsp)
+                    .field("mc_ss", &self.mc_ss)
+                    .field("mc_len", &self.mc_len)
+                    .field("mc_fpformat", &self.mc_fpformat)
+                    .field("mc_ownedfp", &self.mc_ownedfp)
+                    // FIXME: .field("mc_fpstate", &self.mc_fpstate)
+                    .field("mc_fsbase", &self.mc_fsbase)
+                    .field("mc_gsbase", &self.mc_gsbase)
+                    .field("mc_xfpustate", &self.mc_xfpustate)
+                    .field("mc_xfpustate_len", &self.mc_xfpustate_len)
+                    .field("mc_spare", &self.mc_spare)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for mcontext_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.mc_onstack.hash(state);
+                self.mc_rdi.hash(state);
+                self.mc_rsi.hash(state);
+                self.mc_rdx.hash(state);
+                self.mc_rcx.hash(state);
+                self.mc_r8.hash(state);
+                self.mc_r9.hash(state);
+                self.mc_rax.hash(state);
+                self.mc_rbx.hash(state);
+                self.mc_rbp.hash(state);
+                self.mc_r10.hash(state);
+                self.mc_r11.hash(state);
+                self.mc_r12.hash(state);
+                self.mc_r13.hash(state);
+                self.mc_r14.hash(state);
+                self.mc_r15.hash(state);
+                self.mc_trapno.hash(state);
+                self.mc_fs.hash(state);
+                self.mc_gs.hash(state);
+                self.mc_addr.hash(state);
+                self.mc_flags.hash(state);
+                self.mc_es.hash(state);
+                self.mc_ds.hash(state);
+                self.mc_err.hash(state);
+                self.mc_rip.hash(state);
+                self.mc_cs.hash(state);
+                self.mc_rflags.hash(state);
+                self.mc_rsp.hash(state);
+                self.mc_ss.hash(state);
+                self.mc_len.hash(state);
+                self.mc_fpformat.hash(state);
+                self.mc_ownedfp.hash(state);
+                self.mc_fpstate.hash(state);
+                self.mc_fsbase.hash(state);
+                self.mc_gsbase.hash(state);
+                self.mc_xfpustate.hash(state);
+                self.mc_xfpustate_len.hash(state);
+                self.mc_spare.hash(state);
+            }
+        }
+    }
+}
+
+s! {
+    pub struct ucontext_t {
+        pub uc_sigmask: ::sigset_t,
+        pub uc_mcontext: ::mcontext_t,
+        pub uc_link: *mut ::ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_flags: ::c_int,
+        __spare__: [::c_int; 4],
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,334 @@
+pub type c_char = i8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type wchar_t = i32;
+pub type time_t = i64;
+pub type suseconds_t = i64;
+pub type register_t = i64;
+
+s! {
+    pub struct reg32 {
+        pub r_fs: u32,
+        pub r_es: u32,
+        pub r_ds: u32,
+        pub r_edi: u32,
+        pub r_esi: u32,
+        pub r_ebp: u32,
+        pub r_isp: u32,
+        pub r_ebx: u32,
+        pub r_edx: u32,
+        pub r_ecx: u32,
+        pub r_eax: u32,
+        pub r_trapno: u32,
+        pub r_err: u32,
+        pub r_eip: u32,
+        pub r_cs: u32,
+        pub r_eflags: u32,
+        pub r_esp: u32,
+        pub r_ss: u32,
+        pub r_gs: u32,
+    }
+
+    pub struct reg {
+        pub r_r15: i64,
+        pub r_r14: i64,
+        pub r_r13: i64,
+        pub r_r12: i64,
+        pub r_r11: i64,
+        pub r_r10: i64,
+        pub r_r9: i64,
+        pub r_r8: i64,
+        pub r_rdi: i64,
+        pub r_rsi: i64,
+        pub r_rbp: i64,
+        pub r_rbx: i64,
+        pub r_rdx: i64,
+        pub r_rcx: i64,
+        pub r_rax: i64,
+        pub r_trapno: u32,
+        pub r_fs: u16,
+        pub r_gs: u16,
+        pub r_err: u32,
+        pub r_es: u16,
+        pub r_ds: u16,
+        pub r_rip: i64,
+        pub r_cs: i64,
+        pub r_rflags: i64,
+        pub r_rsp: i64,
+        pub r_ss: i64,
+    }
+}
+
+s_no_extra_traits! {
+    pub struct fpreg32 {
+        pub fpr_env: [u32; 7],
+        pub fpr_acc: [[u8; 10]; 8],
+        pub fpr_ex_sw: u32,
+        pub fpr_pad: [u8; 64],
+    }
+
+    pub struct fpreg {
+        pub fpr_env: [u64; 4],
+        pub fpr_acc: [[u8; 16]; 8],
+        pub fpr_xacc: [[u8; 16]; 16],
+        pub fpr_spare: [u64; 12],
+    }
+
+    pub struct xmmreg {
+        pub xmm_env: [u32; 8],
+        pub xmm_acc: [[u8; 16]; 8],
+        pub xmm_reg: [[u8; 16]; 8],
+        pub xmm_pad: [u8; 224],
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_elf64_auxv_union {
+        pub a_val: ::c_long,
+        pub a_ptr: *mut ::c_void,
+        pub a_fcn: extern "C" fn(),
+    }
+
+    pub struct Elf64_Auxinfo {
+        pub a_type: ::c_long,
+        #[cfg(libc_union)]
+        pub a_un: __c_anonymous_elf64_auxv_union,
+    }
+
+    pub struct kinfo_file {
+        pub kf_structsize: ::c_int,
+        pub kf_type: ::c_int,
+        pub kf_fd: ::c_int,
+        pub kf_ref_count: ::c_int,
+        pub kf_flags: ::c_int,
+        _kf_pad0: ::c_int,
+        pub kf_offset: i64,
+        _priv: [::uintptr_t; 38], // FIXME if needed
+        pub kf_status: u16,
+        _kf_pad1: u16,
+        _kf_ispare0: ::c_int,
+        pub kf_cap_rights: ::cap_rights_t,
+        _kf_cap_spare: u64,
+        pub kf_path: [::c_char; ::PATH_MAX as usize],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for fpreg32 {
+            fn eq(&self, other: &fpreg32) -> bool {
+                self.fpr_env == other.fpr_env &&
+                    self.fpr_acc == other.fpr_acc &&
+                    self.fpr_ex_sw == other.fpr_ex_sw &&
+                    self.fpr_pad
+                        .iter()
+                        .zip(other.fpr_pad.iter())
+                        .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for fpreg32 {}
+        impl ::fmt::Debug for fpreg32 {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("fpreg32")
+                    .field("fpr_env", &&self.fpr_env[..])
+                    .field("fpr_acc", &self.fpr_acc)
+                    .field("fpr_ex_sw", &self.fpr_ex_sw)
+                    .field("fpr_pad", &&self.fpr_pad[..])
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for fpreg32 {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.fpr_env.hash(state);
+                self.fpr_acc.hash(state);
+                self.fpr_ex_sw.hash(state);
+                self.fpr_pad.hash(state);
+            }
+        }
+
+        impl PartialEq for fpreg {
+            fn eq(&self, other: &fpreg) -> bool {
+                self.fpr_env == other.fpr_env &&
+                    self.fpr_acc == other.fpr_acc &&
+                    self.fpr_xacc == other.fpr_xacc &&
+                    self.fpr_spare == other.fpr_spare
+            }
+        }
+        impl Eq for fpreg {}
+        impl ::fmt::Debug for fpreg {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("fpreg")
+                    .field("fpr_env", &self.fpr_env)
+                    .field("fpr_acc", &self.fpr_acc)
+                    .field("fpr_xacc", &self.fpr_xacc)
+                    .field("fpr_spare", &self.fpr_spare)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for fpreg {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.fpr_env.hash(state);
+                self.fpr_acc.hash(state);
+                self.fpr_xacc.hash(state);
+                self.fpr_spare.hash(state);
+            }
+        }
+
+        impl PartialEq for xmmreg {
+            fn eq(&self, other: &xmmreg) -> bool {
+                self.xmm_env == other.xmm_env &&
+                    self.xmm_acc == other.xmm_acc &&
+                    self.xmm_reg == other.xmm_reg &&
+                    self.xmm_pad
+                        .iter()
+                        .zip(other.xmm_pad.iter())
+                        .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for xmmreg {}
+        impl ::fmt::Debug for xmmreg {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("xmmreg")
+                    .field("xmm_env", &self.xmm_env)
+                    .field("xmm_acc", &self.xmm_acc)
+                    .field("xmm_reg", &self.xmm_reg)
+                    .field("xmm_pad", &&self.xmm_pad[..])
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for xmmreg {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.xmm_env.hash(state);
+                self.xmm_acc.hash(state);
+                self.xmm_reg.hash(state);
+                self.xmm_pad.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl PartialEq for __c_anonymous_elf64_auxv_union {
+            fn eq(&self, other: &__c_anonymous_elf64_auxv_union) -> bool {
+                unsafe { self.a_val == other.a_val
+                        || self.a_ptr == other.a_ptr
+                        || self.a_fcn == other.a_fcn }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_elf64_auxv_union {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_elf64_auxv_union {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("a_val")
+                    .field("a_val", unsafe { &self.a_val })
+                    .finish()
+            }
+        }
+        #[cfg(not(libc_union))]
+        impl PartialEq for Elf64_Auxinfo {
+            fn eq(&self, other: &Elf64_Auxinfo) -> bool {
+                self.a_type == other.a_type
+            }
+        }
+        #[cfg(libc_union)]
+        impl PartialEq for Elf64_Auxinfo {
+            fn eq(&self, other: &Elf64_Auxinfo) -> bool {
+                self.a_type == other.a_type
+                    && self.a_un == other.a_un
+            }
+        }
+        impl Eq for Elf64_Auxinfo {}
+        #[cfg(not(libc_union))]
+        impl ::fmt::Debug for Elf64_Auxinfo {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("Elf64_Auxinfo")
+                    .field("a_type", &self.a_type)
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for Elf64_Auxinfo {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("Elf64_Auxinfo")
+                    .field("a_type", &self.a_type)
+                    .field("a_un", &self.a_un)
+                    .finish()
+            }
+        }
+
+        impl PartialEq for kinfo_file {
+            fn eq(&self, other: &kinfo_file) -> bool {
+                self.kf_structsize == other.kf_structsize &&
+                    self.kf_type == other.kf_type &&
+                    self.kf_fd == other.kf_fd &&
+                    self.kf_ref_count == other.kf_ref_count &&
+                    self.kf_flags == other.kf_flags &&
+                    self.kf_offset == other.kf_offset &&
+                    self.kf_status == other.kf_status &&
+                    self.kf_cap_rights == other.kf_cap_rights &&
+                    self.kf_path
+                        .iter()
+                        .zip(other.kf_path.iter())
+                        .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for kinfo_file {}
+        impl ::fmt::Debug for kinfo_file {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("kinfo_file")
+                    .field("kf_structsize", &self.kf_structsize)
+                    .field("kf_type", &self.kf_type)
+                    .field("kf_fd", &self.kf_fd)
+                    .field("kf_ref_count", &self.kf_ref_count)
+                    .field("kf_flags", &self.kf_flags)
+                    .field("kf_offset", &self.kf_offset)
+                    .field("kf_status", &self.kf_status)
+                    .field("kf_cap_rights", &self.kf_cap_rights)
+                    .field("kf_path", &&self.kf_path[..])
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for kinfo_file {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.kf_structsize.hash(state);
+                self.kf_type.hash(state);
+                self.kf_fd.hash(state);
+                self.kf_ref_count.hash(state);
+                self.kf_flags.hash(state);
+                self.kf_offset.hash(state);
+                self.kf_status.hash(state);
+                self.kf_cap_rights.hash(state);
+                self.kf_path.hash(state);
+            }
+        }
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+pub const MAP_32BIT: ::c_int = 0x00080000;
+pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
+
+pub const _MC_HASSEGS: u32 = 0x1;
+pub const _MC_HASBASES: u32 = 0x2;
+pub const _MC_HASFPXSTATE: u32 = 0x4;
+pub const _MC_FLAG_MASK: u32 = _MC_HASSEGS | _MC_HASBASES | _MC_HASFPXSTATE;
+
+pub const _MC_FPFMT_NODEV: c_long = 0x10000;
+pub const _MC_FPFMT_XMM: c_long = 0x10002;
+pub const _MC_FPOWNED_NONE: c_long = 0x20000;
+pub const _MC_FPOWNED_FPU: c_long = 0x20001;
+pub const _MC_FPOWNED_PCB: c_long = 0x20002;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/freebsdlike/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/freebsdlike/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1926 @@
+pub type mode_t = u16;
+pub type pthread_attr_t = *mut ::c_void;
+pub type rlim_t = i64;
+pub type pthread_mutex_t = *mut ::c_void;
+pub type pthread_mutexattr_t = *mut ::c_void;
+pub type pthread_cond_t = *mut ::c_void;
+pub type pthread_condattr_t = *mut ::c_void;
+pub type pthread_rwlock_t = *mut ::c_void;
+pub type pthread_rwlockattr_t = *mut ::c_void;
+pub type pthread_key_t = ::c_int;
+pub type tcflag_t = ::c_uint;
+pub type speed_t = ::c_uint;
+pub type nl_item = ::c_int;
+pub type id_t = i64;
+pub type vm_size_t = ::uintptr_t;
+pub type key_t = ::c_long;
+
+// elf.h
+
+pub type Elf32_Addr = u32;
+pub type Elf32_Half = u16;
+pub type Elf32_Lword = u64;
+pub type Elf32_Off = u32;
+pub type Elf32_Sword = i32;
+pub type Elf32_Word = u32;
+
+pub type Elf64_Addr = u64;
+pub type Elf64_Half = u16;
+pub type Elf64_Lword = u64;
+pub type Elf64_Off = u64;
+pub type Elf64_Sword = i32;
+pub type Elf64_Sxword = i64;
+pub type Elf64_Word = u32;
+pub type Elf64_Xword = u64;
+
+pub type iconv_t = *mut ::c_void;
+
+// It's an alias over "struct __kvm_t". However, its fields aren't supposed to be used directly,
+// making the type definition system dependent. Better not bind it exactly.
+pub type kvm_t = ::c_void;
+
+cfg_if! {
+    if #[cfg(target_pointer_width = "64")] {
+        type Elf_Addr = Elf64_Addr;
+        type Elf_Half = Elf64_Half;
+        type Elf_Phdr = Elf64_Phdr;
+    } else if #[cfg(target_pointer_width = "32")] {
+        type Elf_Addr = Elf32_Addr;
+        type Elf_Half = Elf32_Half;
+        type Elf_Phdr = Elf32_Phdr;
+    }
+}
+
+// link.h
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum timezone {}
+impl ::Copy for timezone {}
+impl ::Clone for timezone {
+    fn clone(&self) -> timezone {
+        *self
+    }
+}
+
+impl siginfo_t {
+    pub unsafe fn si_addr(&self) -> *mut ::c_void {
+        self.si_addr
+    }
+
+    pub unsafe fn si_value(&self) -> ::sigval {
+        self.si_value
+    }
+
+    pub unsafe fn si_pid(&self) -> ::pid_t {
+        self.si_pid
+    }
+
+    pub unsafe fn si_uid(&self) -> ::uid_t {
+        self.si_uid
+    }
+
+    pub unsafe fn si_status(&self) -> ::c_int {
+        self.si_status
+    }
+}
+
+s! {
+    pub struct in_addr {
+        pub s_addr: ::in_addr_t,
+    }
+
+    pub struct ip_mreq {
+        pub imr_multiaddr: in_addr,
+        pub imr_interface: in_addr,
+    }
+
+    pub struct ip_mreqn {
+        pub imr_multiaddr: in_addr,
+        pub imr_address: in_addr,
+        pub imr_ifindex: ::c_int,
+    }
+
+    pub struct ip_mreq_source {
+        pub imr_multiaddr: in_addr,
+        pub imr_sourceaddr: in_addr,
+        pub imr_interface: in_addr,
+    }
+
+    pub struct glob_t {
+        pub gl_pathc:  ::size_t,
+        pub gl_matchc: ::size_t,
+        pub gl_offs:   ::size_t,
+        pub gl_flags:  ::c_int,
+        pub gl_pathv:  *mut *mut ::c_char,
+        __unused3: *mut ::c_void,
+        __unused4: *mut ::c_void,
+        __unused5: *mut ::c_void,
+        __unused6: *mut ::c_void,
+        __unused7: *mut ::c_void,
+        __unused8: *mut ::c_void,
+    }
+
+    pub struct addrinfo {
+        pub ai_flags: ::c_int,
+        pub ai_family: ::c_int,
+        pub ai_socktype: ::c_int,
+        pub ai_protocol: ::c_int,
+        pub ai_addrlen: ::socklen_t,
+        pub ai_canonname: *mut ::c_char,
+        pub ai_addr: *mut ::sockaddr,
+        pub ai_next: *mut addrinfo,
+    }
+
+    pub struct sigset_t {
+        bits: [u32; 4],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        pub si_pid: ::pid_t,
+        pub si_uid: ::uid_t,
+        pub si_status: ::c_int,
+        pub si_addr: *mut ::c_void,
+        pub si_value: ::sigval,
+        _pad1: ::c_long,
+        _pad2: [::c_int; 7],
+    }
+
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_flags: ::c_int,
+        pub sa_mask: sigset_t,
+    }
+
+    pub struct sched_param {
+        pub sched_priority: ::c_int,
+    }
+
+    pub struct Dl_info {
+        pub dli_fname: *const ::c_char,
+        pub dli_fbase: *mut ::c_void,
+        pub dli_sname: *const ::c_char,
+        pub dli_saddr: *mut ::c_void,
+    }
+
+    pub struct sockaddr_in {
+        pub sin_len: u8,
+        pub sin_family: ::sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [::c_char; 8],
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_cc: [::cc_t; ::NCCS],
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::speed_t,
+    }
+
+    pub struct flock {
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        #[cfg(not(target_os = "dragonfly"))]
+        pub l_sysid: ::c_int,
+    }
+
+    pub struct sf_hdtr {
+        pub headers: *mut ::iovec,
+        pub hdr_cnt: ::c_int,
+        pub trailers: *mut ::iovec,
+        pub trl_cnt: ::c_int,
+    }
+
+    pub struct lconv {
+        pub decimal_point: *mut ::c_char,
+        pub thousands_sep: *mut ::c_char,
+        pub grouping: *mut ::c_char,
+        pub int_curr_symbol: *mut ::c_char,
+        pub currency_symbol: *mut ::c_char,
+        pub mon_decimal_point: *mut ::c_char,
+        pub mon_thousands_sep: *mut ::c_char,
+        pub mon_grouping: *mut ::c_char,
+        pub positive_sign: *mut ::c_char,
+        pub negative_sign: *mut ::c_char,
+        pub int_frac_digits: ::c_char,
+        pub frac_digits: ::c_char,
+        pub p_cs_precedes: ::c_char,
+        pub p_sep_by_space: ::c_char,
+        pub n_cs_precedes: ::c_char,
+        pub n_sep_by_space: ::c_char,
+        pub p_sign_posn: ::c_char,
+        pub n_sign_posn: ::c_char,
+        pub int_p_cs_precedes: ::c_char,
+        pub int_n_cs_precedes: ::c_char,
+        pub int_p_sep_by_space: ::c_char,
+        pub int_n_sep_by_space: ::c_char,
+        pub int_p_sign_posn: ::c_char,
+        pub int_n_sign_posn: ::c_char,
+    }
+
+    pub struct cmsgcred {
+        pub cmcred_pid: ::pid_t,
+        pub cmcred_uid: ::uid_t,
+        pub cmcred_euid: ::uid_t,
+        pub cmcred_gid: ::gid_t,
+        pub cmcred_ngroups: ::c_short,
+        pub cmcred_groups: [::gid_t; CMGROUP_MAX],
+    }
+
+    pub struct rtprio {
+        pub type_: ::c_ushort,
+        pub prio: ::c_ushort,
+    }
+
+    pub struct in6_pktinfo {
+        pub ipi6_addr: ::in6_addr,
+        pub ipi6_ifindex: ::c_uint,
+    }
+
+    pub struct arphdr {
+        pub ar_hrd: u16,
+        pub ar_pro: u16,
+        pub ar_hln: u8,
+        pub ar_pln: u8,
+        pub ar_op: u16,
+    }
+
+    pub struct timex {
+        pub modes: ::c_uint,
+        pub offset: ::c_long,
+        pub freq: ::c_long,
+        pub maxerror: ::c_long,
+        pub esterror: ::c_long,
+        pub status: ::c_int,
+        pub constant: ::c_long,
+        pub precision: ::c_long,
+        pub tolerance: ::c_long,
+        pub ppsfreq: ::c_long,
+        pub jitter: ::c_long,
+        pub shift: ::c_int,
+        pub stabil: ::c_long,
+        pub jitcnt: ::c_long,
+        pub calcnt: ::c_long,
+        pub errcnt: ::c_long,
+        pub stbcnt: ::c_long,
+    }
+
+    pub struct ntptimeval {
+        pub time: ::timespec,
+        pub maxerror: ::c_long,
+        pub esterror: ::c_long,
+        pub tai: ::c_long,
+        pub time_state: ::c_int,
+    }
+
+    pub struct accept_filter_arg {
+        pub af_name: [::c_char; 16],
+        af_arg: [[::c_char; 10]; 24],
+    }
+
+    pub struct ptrace_io_desc {
+        pub piod_op: ::c_int,
+        pub piod_offs: *mut ::c_void,
+        pub piod_addr: *mut ::c_void,
+        pub piod_len: ::size_t,
+    }
+
+    // bpf.h
+
+    pub struct bpf_program {
+        pub bf_len: ::c_uint,
+        pub bf_insns: *mut bpf_insn,
+    }
+
+    pub struct bpf_stat {
+        pub bs_recv: ::c_uint,
+        pub bs_drop: ::c_uint,
+    }
+
+    pub struct bpf_version {
+        pub bv_major: ::c_ushort,
+        pub bv_minor: ::c_ushort,
+    }
+
+    pub struct bpf_hdr {
+        pub bh_tstamp: ::timeval,
+        pub bh_caplen: u32,
+        pub bh_datalen: u32,
+        pub bh_hdrlen: ::c_ushort,
+    }
+
+    pub struct bpf_insn {
+        pub code: ::c_ushort,
+        pub jt: ::c_uchar,
+        pub jf: ::c_uchar,
+        pub k: u32,
+    }
+
+    pub struct bpf_dltlist {
+        bfl_len: ::c_uint,
+        bfl_list: *mut ::c_uint,
+    }
+
+    // elf.h
+
+    pub struct Elf32_Phdr {
+        pub p_type: Elf32_Word,
+        pub p_offset: Elf32_Off,
+        pub p_vaddr: Elf32_Addr,
+        pub p_paddr: Elf32_Addr,
+        pub p_filesz: Elf32_Word,
+        pub p_memsz: Elf32_Word,
+        pub p_flags: Elf32_Word,
+        pub p_align: Elf32_Word,
+    }
+
+    pub struct Elf64_Phdr {
+        pub p_type: Elf64_Word,
+        pub p_flags: Elf64_Word,
+        pub p_offset: Elf64_Off,
+        pub p_vaddr: Elf64_Addr,
+        pub p_paddr: Elf64_Addr,
+        pub p_filesz: Elf64_Xword,
+        pub p_memsz: Elf64_Xword,
+        pub p_align: Elf64_Xword,
+    }
+
+    // link.h
+
+    pub struct dl_phdr_info {
+        pub dlpi_addr: Elf_Addr,
+        pub dlpi_name: *const ::c_char,
+        pub dlpi_phdr: *const Elf_Phdr,
+        pub dlpi_phnum: Elf_Half,
+        pub dlpi_adds: ::c_ulonglong,
+        pub dlpi_subs: ::c_ulonglong,
+        pub dlpi_tls_modid: usize,
+        pub dlpi_tls_data: *mut ::c_void,
+    }
+
+    pub struct ipc_perm {
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub mode: ::mode_t,
+        pub seq: ::c_ushort,
+        pub key: ::key_t,
+    }
+
+    pub struct eui64 {
+        pub octet: [u8; EUI64_LEN],
+    }
+}
+
+s_no_extra_traits! {
+    pub struct sockaddr_storage {
+        pub ss_len: u8,
+        pub ss_family: ::sa_family_t,
+        __ss_pad1: [u8; 6],
+        __ss_align: i64,
+        __ss_pad2: [u8; 112],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for sockaddr_storage {
+            fn eq(&self, other: &sockaddr_storage) -> bool {
+                self.ss_len == other.ss_len
+                    && self.ss_family == other.ss_family
+                    && self.__ss_pad1 == other.__ss_pad1
+                    && self.__ss_align == other.__ss_align
+                    && self
+                    .__ss_pad2
+                    .iter()
+                    .zip(other.__ss_pad2.iter())
+                    .all(|(a, b)| a == b)
+            }
+        }
+        impl Eq for sockaddr_storage {}
+        impl ::fmt::Debug for sockaddr_storage {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_storage")
+                    .field("ss_len", &self.ss_len)
+                    .field("ss_family", &self.ss_family)
+                    .field("__ss_pad1", &self.__ss_pad1)
+                    .field("__ss_align", &self.__ss_align)
+                    // FIXME: .field("__ss_pad2", &self.__ss_pad2)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sockaddr_storage {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ss_len.hash(state);
+                self.ss_family.hash(state);
+                self.__ss_pad1.hash(state);
+                self.__ss_align.hash(state);
+                self.__ss_pad2.hash(state);
+            }
+        }
+    }
+}
+
+// Non-public helper constant
+cfg_if! {
+    if #[cfg(all(not(libc_const_size_of), target_pointer_width = "32"))] {
+        const SIZEOF_LONG: usize = 4;
+    } else if #[cfg(all(not(libc_const_size_of), target_pointer_width = "64"))] {
+        const SIZEOF_LONG: usize = 8;
+    } else if #[cfg(libc_const_size_of)] {
+        const SIZEOF_LONG: usize = ::mem::size_of::<::c_long>();
+    }
+}
+
+#[deprecated(
+    since = "0.2.64",
+    note = "Can vary at runtime.  Use sysconf(3) instead"
+)]
+pub const AIO_LISTIO_MAX: ::c_int = 16;
+pub const AIO_CANCELED: ::c_int = 1;
+pub const AIO_NOTCANCELED: ::c_int = 2;
+pub const AIO_ALLDONE: ::c_int = 3;
+pub const LIO_NOP: ::c_int = 0;
+pub const LIO_WRITE: ::c_int = 1;
+pub const LIO_READ: ::c_int = 2;
+pub const LIO_WAIT: ::c_int = 1;
+pub const LIO_NOWAIT: ::c_int = 0;
+
+pub const SIGEV_NONE: ::c_int = 0;
+pub const SIGEV_SIGNAL: ::c_int = 1;
+pub const SIGEV_THREAD: ::c_int = 2;
+pub const SIGEV_KEVENT: ::c_int = 3;
+
+pub const CODESET: ::nl_item = 0;
+pub const D_T_FMT: ::nl_item = 1;
+pub const D_FMT: ::nl_item = 2;
+pub const T_FMT: ::nl_item = 3;
+pub const T_FMT_AMPM: ::nl_item = 4;
+pub const AM_STR: ::nl_item = 5;
+pub const PM_STR: ::nl_item = 6;
+
+pub const DAY_1: ::nl_item = 7;
+pub const DAY_2: ::nl_item = 8;
+pub const DAY_3: ::nl_item = 9;
+pub const DAY_4: ::nl_item = 10;
+pub const DAY_5: ::nl_item = 11;
+pub const DAY_6: ::nl_item = 12;
+pub const DAY_7: ::nl_item = 13;
+
+pub const ABDAY_1: ::nl_item = 14;
+pub const ABDAY_2: ::nl_item = 15;
+pub const ABDAY_3: ::nl_item = 16;
+pub const ABDAY_4: ::nl_item = 17;
+pub const ABDAY_5: ::nl_item = 18;
+pub const ABDAY_6: ::nl_item = 19;
+pub const ABDAY_7: ::nl_item = 20;
+
+pub const MON_1: ::nl_item = 21;
+pub const MON_2: ::nl_item = 22;
+pub const MON_3: ::nl_item = 23;
+pub const MON_4: ::nl_item = 24;
+pub const MON_5: ::nl_item = 25;
+pub const MON_6: ::nl_item = 26;
+pub const MON_7: ::nl_item = 27;
+pub const MON_8: ::nl_item = 28;
+pub const MON_9: ::nl_item = 29;
+pub const MON_10: ::nl_item = 30;
+pub const MON_11: ::nl_item = 31;
+pub const MON_12: ::nl_item = 32;
+
+pub const ABMON_1: ::nl_item = 33;
+pub const ABMON_2: ::nl_item = 34;
+pub const ABMON_3: ::nl_item = 35;
+pub const ABMON_4: ::nl_item = 36;
+pub const ABMON_5: ::nl_item = 37;
+pub const ABMON_6: ::nl_item = 38;
+pub const ABMON_7: ::nl_item = 39;
+pub const ABMON_8: ::nl_item = 40;
+pub const ABMON_9: ::nl_item = 41;
+pub const ABMON_10: ::nl_item = 42;
+pub const ABMON_11: ::nl_item = 43;
+pub const ABMON_12: ::nl_item = 44;
+
+pub const ERA: ::nl_item = 45;
+pub const ERA_D_FMT: ::nl_item = 46;
+pub const ERA_D_T_FMT: ::nl_item = 47;
+pub const ERA_T_FMT: ::nl_item = 48;
+pub const ALT_DIGITS: ::nl_item = 49;
+
+pub const RADIXCHAR: ::nl_item = 50;
+pub const THOUSEP: ::nl_item = 51;
+
+pub const YESEXPR: ::nl_item = 52;
+pub const NOEXPR: ::nl_item = 53;
+
+pub const YESSTR: ::nl_item = 54;
+pub const NOSTR: ::nl_item = 55;
+
+pub const CRNCYSTR: ::nl_item = 56;
+
+pub const D_MD_ORDER: ::nl_item = 57;
+
+pub const ALTMON_1: ::nl_item = 58;
+pub const ALTMON_2: ::nl_item = 59;
+pub const ALTMON_3: ::nl_item = 60;
+pub const ALTMON_4: ::nl_item = 61;
+pub const ALTMON_5: ::nl_item = 62;
+pub const ALTMON_6: ::nl_item = 63;
+pub const ALTMON_7: ::nl_item = 64;
+pub const ALTMON_8: ::nl_item = 65;
+pub const ALTMON_9: ::nl_item = 66;
+pub const ALTMON_10: ::nl_item = 67;
+pub const ALTMON_11: ::nl_item = 68;
+pub const ALTMON_12: ::nl_item = 69;
+
+pub const EXIT_FAILURE: ::c_int = 1;
+pub const EXIT_SUCCESS: ::c_int = 0;
+pub const EOF: ::c_int = -1;
+pub const SEEK_SET: ::c_int = 0;
+pub const SEEK_CUR: ::c_int = 1;
+pub const SEEK_END: ::c_int = 2;
+pub const SEEK_DATA: ::c_int = 3;
+pub const SEEK_HOLE: ::c_int = 4;
+pub const _IOFBF: ::c_int = 0;
+pub const _IONBF: ::c_int = 2;
+pub const _IOLBF: ::c_int = 1;
+pub const BUFSIZ: ::c_uint = 1024;
+pub const FOPEN_MAX: ::c_uint = 20;
+pub const FILENAME_MAX: ::c_uint = 1024;
+pub const L_tmpnam: ::c_uint = 1024;
+pub const TMP_MAX: ::c_uint = 308915776;
+
+pub const O_NOCTTY: ::c_int = 32768;
+pub const O_DIRECT: ::c_int = 0x00010000;
+
+pub const S_IFIFO: mode_t = 4096;
+pub const S_IFCHR: mode_t = 8192;
+pub const S_IFBLK: mode_t = 24576;
+pub const S_IFDIR: mode_t = 16384;
+pub const S_IFREG: mode_t = 32768;
+pub const S_IFLNK: mode_t = 40960;
+pub const S_IFSOCK: mode_t = 49152;
+pub const S_IFMT: mode_t = 61440;
+pub const S_IEXEC: mode_t = 64;
+pub const S_IWRITE: mode_t = 128;
+pub const S_IREAD: mode_t = 256;
+pub const S_IRWXU: mode_t = 448;
+pub const S_IXUSR: mode_t = 64;
+pub const S_IWUSR: mode_t = 128;
+pub const S_IRUSR: mode_t = 256;
+pub const S_IRWXG: mode_t = 56;
+pub const S_IXGRP: mode_t = 8;
+pub const S_IWGRP: mode_t = 16;
+pub const S_IRGRP: mode_t = 32;
+pub const S_IRWXO: mode_t = 7;
+pub const S_IXOTH: mode_t = 1;
+pub const S_IWOTH: mode_t = 2;
+pub const S_IROTH: mode_t = 4;
+pub const F_OK: ::c_int = 0;
+pub const R_OK: ::c_int = 4;
+pub const W_OK: ::c_int = 2;
+pub const X_OK: ::c_int = 1;
+pub const STDIN_FILENO: ::c_int = 0;
+pub const STDOUT_FILENO: ::c_int = 1;
+pub const STDERR_FILENO: ::c_int = 2;
+pub const F_LOCK: ::c_int = 1;
+pub const F_TEST: ::c_int = 3;
+pub const F_TLOCK: ::c_int = 2;
+pub const F_ULOCK: ::c_int = 0;
+pub const F_DUPFD_CLOEXEC: ::c_int = 17;
+pub const F_DUP2FD: ::c_int = 10;
+pub const F_DUP2FD_CLOEXEC: ::c_int = 18;
+pub const SIGHUP: ::c_int = 1;
+pub const SIGINT: ::c_int = 2;
+pub const SIGQUIT: ::c_int = 3;
+pub const SIGILL: ::c_int = 4;
+pub const SIGABRT: ::c_int = 6;
+pub const SIGEMT: ::c_int = 7;
+pub const SIGFPE: ::c_int = 8;
+pub const SIGKILL: ::c_int = 9;
+pub const SIGSEGV: ::c_int = 11;
+pub const SIGPIPE: ::c_int = 13;
+pub const SIGALRM: ::c_int = 14;
+pub const SIGTERM: ::c_int = 15;
+
+pub const PROT_NONE: ::c_int = 0;
+pub const PROT_READ: ::c_int = 1;
+pub const PROT_WRITE: ::c_int = 2;
+pub const PROT_EXEC: ::c_int = 4;
+
+pub const MAP_FILE: ::c_int = 0x0000;
+pub const MAP_SHARED: ::c_int = 0x0001;
+pub const MAP_PRIVATE: ::c_int = 0x0002;
+pub const MAP_FIXED: ::c_int = 0x0010;
+pub const MAP_ANON: ::c_int = 0x1000;
+pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
+
+pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+
+pub const MNT_EXPUBLIC: ::c_int = 0x20000000;
+pub const MNT_NOATIME: ::c_int = 0x10000000;
+pub const MNT_NOCLUSTERR: ::c_int = 0x40000000;
+pub const MNT_NOCLUSTERW: ::c_int = 0x80000000;
+pub const MNT_NOSYMFOLLOW: ::c_int = 0x00400000;
+pub const MNT_SOFTDEP: ::c_int = 0x00200000;
+pub const MNT_SUIDDIR: ::c_int = 0x00100000;
+pub const MNT_EXRDONLY: ::c_int = 0x00000080;
+pub const MNT_DEFEXPORTED: ::c_int = 0x00000200;
+pub const MNT_EXPORTANON: ::c_int = 0x00000400;
+pub const MNT_EXKERB: ::c_int = 0x00000800;
+pub const MNT_DELEXPORT: ::c_int = 0x00020000;
+
+pub const MS_SYNC: ::c_int = 0x0000;
+pub const MS_ASYNC: ::c_int = 0x0001;
+pub const MS_INVALIDATE: ::c_int = 0x0002;
+
+pub const EPERM: ::c_int = 1;
+pub const ENOENT: ::c_int = 2;
+pub const ESRCH: ::c_int = 3;
+pub const EINTR: ::c_int = 4;
+pub const EIO: ::c_int = 5;
+pub const ENXIO: ::c_int = 6;
+pub const E2BIG: ::c_int = 7;
+pub const ENOEXEC: ::c_int = 8;
+pub const EBADF: ::c_int = 9;
+pub const ECHILD: ::c_int = 10;
+pub const EDEADLK: ::c_int = 11;
+pub const ENOMEM: ::c_int = 12;
+pub const EACCES: ::c_int = 13;
+pub const EFAULT: ::c_int = 14;
+pub const ENOTBLK: ::c_int = 15;
+pub const EBUSY: ::c_int = 16;
+pub const EEXIST: ::c_int = 17;
+pub const EXDEV: ::c_int = 18;
+pub const ENODEV: ::c_int = 19;
+pub const ENOTDIR: ::c_int = 20;
+pub const EISDIR: ::c_int = 21;
+pub const EINVAL: ::c_int = 22;
+pub const ENFILE: ::c_int = 23;
+pub const EMFILE: ::c_int = 24;
+pub const ENOTTY: ::c_int = 25;
+pub const ETXTBSY: ::c_int = 26;
+pub const EFBIG: ::c_int = 27;
+pub const ENOSPC: ::c_int = 28;
+pub const ESPIPE: ::c_int = 29;
+pub const EROFS: ::c_int = 30;
+pub const EMLINK: ::c_int = 31;
+pub const EPIPE: ::c_int = 32;
+pub const EDOM: ::c_int = 33;
+pub const ERANGE: ::c_int = 34;
+pub const EAGAIN: ::c_int = 35;
+pub const EWOULDBLOCK: ::c_int = 35;
+pub const EINPROGRESS: ::c_int = 36;
+pub const EALREADY: ::c_int = 37;
+pub const ENOTSOCK: ::c_int = 38;
+pub const EDESTADDRREQ: ::c_int = 39;
+pub const EMSGSIZE: ::c_int = 40;
+pub const EPROTOTYPE: ::c_int = 41;
+pub const ENOPROTOOPT: ::c_int = 42;
+pub const EPROTONOSUPPORT: ::c_int = 43;
+pub const ESOCKTNOSUPPORT: ::c_int = 44;
+pub const EOPNOTSUPP: ::c_int = 45;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 46;
+pub const EAFNOSUPPORT: ::c_int = 47;
+pub const EADDRINUSE: ::c_int = 48;
+pub const EADDRNOTAVAIL: ::c_int = 49;
+pub const ENETDOWN: ::c_int = 50;
+pub const ENETUNREACH: ::c_int = 51;
+pub const ENETRESET: ::c_int = 52;
+pub const ECONNABORTED: ::c_int = 53;
+pub const ECONNRESET: ::c_int = 54;
+pub const ENOBUFS: ::c_int = 55;
+pub const EISCONN: ::c_int = 56;
+pub const ENOTCONN: ::c_int = 57;
+pub const ESHUTDOWN: ::c_int = 58;
+pub const ETOOMANYREFS: ::c_int = 59;
+pub const ETIMEDOUT: ::c_int = 60;
+pub const ECONNREFUSED: ::c_int = 61;
+pub const ELOOP: ::c_int = 62;
+pub const ENAMETOOLONG: ::c_int = 63;
+pub const EHOSTDOWN: ::c_int = 64;
+pub const EHOSTUNREACH: ::c_int = 65;
+pub const ENOTEMPTY: ::c_int = 66;
+pub const EPROCLIM: ::c_int = 67;
+pub const EUSERS: ::c_int = 68;
+pub const EDQUOT: ::c_int = 69;
+pub const ESTALE: ::c_int = 70;
+pub const EREMOTE: ::c_int = 71;
+pub const EBADRPC: ::c_int = 72;
+pub const ERPCMISMATCH: ::c_int = 73;
+pub const EPROGUNAVAIL: ::c_int = 74;
+pub const EPROGMISMATCH: ::c_int = 75;
+pub const EPROCUNAVAIL: ::c_int = 76;
+pub const ENOLCK: ::c_int = 77;
+pub const ENOSYS: ::c_int = 78;
+pub const EFTYPE: ::c_int = 79;
+pub const EAUTH: ::c_int = 80;
+pub const ENEEDAUTH: ::c_int = 81;
+pub const EIDRM: ::c_int = 82;
+pub const ENOMSG: ::c_int = 83;
+pub const EOVERFLOW: ::c_int = 84;
+pub const ECANCELED: ::c_int = 85;
+pub const EILSEQ: ::c_int = 86;
+pub const ENOATTR: ::c_int = 87;
+pub const EDOOFUS: ::c_int = 88;
+pub const EBADMSG: ::c_int = 89;
+pub const EMULTIHOP: ::c_int = 90;
+pub const ENOLINK: ::c_int = 91;
+pub const EPROTO: ::c_int = 92;
+
+pub const POLLSTANDARD: ::c_short = ::POLLIN
+    | ::POLLPRI
+    | ::POLLOUT
+    | ::POLLRDNORM
+    | ::POLLRDBAND
+    | ::POLLWRBAND
+    | ::POLLERR
+    | ::POLLHUP
+    | ::POLLNVAL;
+
+pub const AI_PASSIVE: ::c_int = 0x00000001;
+pub const AI_CANONNAME: ::c_int = 0x00000002;
+pub const AI_NUMERICHOST: ::c_int = 0x00000004;
+pub const AI_NUMERICSERV: ::c_int = 0x00000008;
+pub const AI_ALL: ::c_int = 0x00000100;
+pub const AI_ADDRCONFIG: ::c_int = 0x00000400;
+pub const AI_V4MAPPED: ::c_int = 0x00000800;
+
+pub const EAI_AGAIN: ::c_int = 2;
+pub const EAI_BADFLAGS: ::c_int = 3;
+pub const EAI_FAIL: ::c_int = 4;
+pub const EAI_FAMILY: ::c_int = 5;
+pub const EAI_MEMORY: ::c_int = 6;
+pub const EAI_NONAME: ::c_int = 8;
+pub const EAI_SERVICE: ::c_int = 9;
+pub const EAI_SOCKTYPE: ::c_int = 10;
+pub const EAI_SYSTEM: ::c_int = 11;
+pub const EAI_OVERFLOW: ::c_int = 14;
+
+pub const F_DUPFD: ::c_int = 0;
+pub const F_GETFD: ::c_int = 1;
+pub const F_SETFD: ::c_int = 2;
+pub const F_GETFL: ::c_int = 3;
+pub const F_SETFL: ::c_int = 4;
+
+pub const SIGTRAP: ::c_int = 5;
+
+pub const GLOB_APPEND: ::c_int = 0x0001;
+pub const GLOB_DOOFFS: ::c_int = 0x0002;
+pub const GLOB_ERR: ::c_int = 0x0004;
+pub const GLOB_MARK: ::c_int = 0x0008;
+pub const GLOB_NOCHECK: ::c_int = 0x0010;
+pub const GLOB_NOSORT: ::c_int = 0x0020;
+pub const GLOB_NOESCAPE: ::c_int = 0x2000;
+
+pub const GLOB_NOSPACE: ::c_int = -1;
+pub const GLOB_ABORTED: ::c_int = -2;
+pub const GLOB_NOMATCH: ::c_int = -3;
+
+pub const POSIX_MADV_NORMAL: ::c_int = 0;
+pub const POSIX_MADV_RANDOM: ::c_int = 1;
+pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
+pub const POSIX_MADV_WILLNEED: ::c_int = 3;
+pub const POSIX_MADV_DONTNEED: ::c_int = 4;
+
+pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
+pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
+pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
+pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
+
+pub const RLIMIT_CPU: ::c_int = 0;
+pub const RLIMIT_FSIZE: ::c_int = 1;
+pub const RLIMIT_DATA: ::c_int = 2;
+pub const RLIMIT_STACK: ::c_int = 3;
+pub const RLIMIT_CORE: ::c_int = 4;
+pub const RLIMIT_RSS: ::c_int = 5;
+pub const RLIMIT_MEMLOCK: ::c_int = 6;
+pub const RLIMIT_NPROC: ::c_int = 7;
+pub const RLIMIT_NOFILE: ::c_int = 8;
+pub const RLIMIT_SBSIZE: ::c_int = 9;
+pub const RLIMIT_VMEM: ::c_int = 10;
+pub const RLIMIT_AS: ::c_int = RLIMIT_VMEM;
+pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff;
+
+pub const RUSAGE_SELF: ::c_int = 0;
+pub const RUSAGE_CHILDREN: ::c_int = -1;
+
+pub const CLOCK_REALTIME: ::clockid_t = 0;
+pub const CLOCK_VIRTUAL: ::clockid_t = 1;
+pub const CLOCK_PROF: ::clockid_t = 2;
+pub const CLOCK_MONOTONIC: ::clockid_t = 4;
+pub const CLOCK_UPTIME: ::clockid_t = 5;
+pub const CLOCK_UPTIME_PRECISE: ::clockid_t = 7;
+pub const CLOCK_UPTIME_FAST: ::clockid_t = 8;
+pub const CLOCK_REALTIME_PRECISE: ::clockid_t = 9;
+pub const CLOCK_REALTIME_FAST: ::clockid_t = 10;
+pub const CLOCK_MONOTONIC_PRECISE: ::clockid_t = 11;
+pub const CLOCK_MONOTONIC_FAST: ::clockid_t = 12;
+pub const CLOCK_SECOND: ::clockid_t = 13;
+pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 14;
+pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 15;
+
+pub const MADV_NORMAL: ::c_int = 0;
+pub const MADV_RANDOM: ::c_int = 1;
+pub const MADV_SEQUENTIAL: ::c_int = 2;
+pub const MADV_WILLNEED: ::c_int = 3;
+pub const MADV_DONTNEED: ::c_int = 4;
+pub const MADV_FREE: ::c_int = 5;
+pub const MADV_NOSYNC: ::c_int = 6;
+pub const MADV_AUTOSYNC: ::c_int = 7;
+pub const MADV_NOCORE: ::c_int = 8;
+pub const MADV_CORE: ::c_int = 9;
+
+pub const MINCORE_INCORE: ::c_int = 0x1;
+pub const MINCORE_REFERENCED: ::c_int = 0x2;
+pub const MINCORE_MODIFIED: ::c_int = 0x4;
+pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8;
+pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10;
+
+pub const AF_UNSPEC: ::c_int = 0;
+pub const AF_LOCAL: ::c_int = 1;
+pub const AF_UNIX: ::c_int = AF_LOCAL;
+pub const AF_INET: ::c_int = 2;
+pub const AF_IMPLINK: ::c_int = 3;
+pub const AF_PUP: ::c_int = 4;
+pub const AF_CHAOS: ::c_int = 5;
+pub const AF_NETBIOS: ::c_int = 6;
+pub const AF_ISO: ::c_int = 7;
+pub const AF_OSI: ::c_int = AF_ISO;
+pub const AF_ECMA: ::c_int = 8;
+pub const AF_DATAKIT: ::c_int = 9;
+pub const AF_CCITT: ::c_int = 10;
+pub const AF_SNA: ::c_int = 11;
+pub const AF_DECnet: ::c_int = 12;
+pub const AF_DLI: ::c_int = 13;
+pub const AF_LAT: ::c_int = 14;
+pub const AF_HYLINK: ::c_int = 15;
+pub const AF_APPLETALK: ::c_int = 16;
+pub const AF_ROUTE: ::c_int = 17;
+pub const AF_LINK: ::c_int = 18;
+pub const pseudo_AF_XTP: ::c_int = 19;
+pub const AF_COIP: ::c_int = 20;
+pub const AF_CNT: ::c_int = 21;
+pub const pseudo_AF_RTIP: ::c_int = 22;
+pub const AF_IPX: ::c_int = 23;
+pub const AF_SIP: ::c_int = 24;
+pub const pseudo_AF_PIP: ::c_int = 25;
+pub const AF_ISDN: ::c_int = 26;
+pub const AF_E164: ::c_int = AF_ISDN;
+pub const pseudo_AF_KEY: ::c_int = 27;
+pub const AF_INET6: ::c_int = 28;
+pub const AF_NATM: ::c_int = 29;
+pub const AF_ATM: ::c_int = 30;
+pub const pseudo_AF_HDRCMPLT: ::c_int = 31;
+pub const AF_NETGRAPH: ::c_int = 32;
+
+pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
+pub const PF_LOCAL: ::c_int = AF_LOCAL;
+pub const PF_UNIX: ::c_int = PF_LOCAL;
+pub const PF_INET: ::c_int = AF_INET;
+pub const PF_IMPLINK: ::c_int = AF_IMPLINK;
+pub const PF_PUP: ::c_int = AF_PUP;
+pub const PF_CHAOS: ::c_int = AF_CHAOS;
+pub const PF_NETBIOS: ::c_int = AF_NETBIOS;
+pub const PF_ISO: ::c_int = AF_ISO;
+pub const PF_OSI: ::c_int = AF_ISO;
+pub const PF_ECMA: ::c_int = AF_ECMA;
+pub const PF_DATAKIT: ::c_int = AF_DATAKIT;
+pub const PF_CCITT: ::c_int = AF_CCITT;
+pub const PF_SNA: ::c_int = AF_SNA;
+pub const PF_DECnet: ::c_int = AF_DECnet;
+pub const PF_DLI: ::c_int = AF_DLI;
+pub const PF_LAT: ::c_int = AF_LAT;
+pub const PF_HYLINK: ::c_int = AF_HYLINK;
+pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
+pub const PF_ROUTE: ::c_int = AF_ROUTE;
+pub const PF_LINK: ::c_int = AF_LINK;
+pub const PF_XTP: ::c_int = pseudo_AF_XTP;
+pub const PF_COIP: ::c_int = AF_COIP;
+pub const PF_CNT: ::c_int = AF_CNT;
+pub const PF_SIP: ::c_int = AF_SIP;
+pub const PF_IPX: ::c_int = AF_IPX;
+pub const PF_RTIP: ::c_int = pseudo_AF_RTIP;
+pub const PF_PIP: ::c_int = pseudo_AF_PIP;
+pub const PF_ISDN: ::c_int = AF_ISDN;
+pub const PF_KEY: ::c_int = pseudo_AF_KEY;
+pub const PF_INET6: ::c_int = AF_INET6;
+pub const PF_NATM: ::c_int = AF_NATM;
+pub const PF_ATM: ::c_int = AF_ATM;
+pub const PF_NETGRAPH: ::c_int = AF_NETGRAPH;
+
+pub const PIOD_READ_D: ::c_int = 1;
+pub const PIOD_WRITE_D: ::c_int = 2;
+pub const PIOD_READ_I: ::c_int = 3;
+pub const PIOD_WRITE_I: ::c_int = 4;
+
+pub const PT_TRACE_ME: ::c_int = 0;
+pub const PT_READ_I: ::c_int = 1;
+pub const PT_READ_D: ::c_int = 2;
+pub const PT_WRITE_I: ::c_int = 4;
+pub const PT_WRITE_D: ::c_int = 5;
+pub const PT_CONTINUE: ::c_int = 7;
+pub const PT_KILL: ::c_int = 8;
+pub const PT_STEP: ::c_int = 9;
+pub const PT_ATTACH: ::c_int = 10;
+pub const PT_DETACH: ::c_int = 11;
+pub const PT_IO: ::c_int = 12;
+
+pub const SOMAXCONN: ::c_int = 128;
+
+pub const MSG_OOB: ::c_int = 0x00000001;
+pub const MSG_PEEK: ::c_int = 0x00000002;
+pub const MSG_DONTROUTE: ::c_int = 0x00000004;
+pub const MSG_EOR: ::c_int = 0x00000008;
+pub const MSG_TRUNC: ::c_int = 0x00000010;
+pub const MSG_CTRUNC: ::c_int = 0x00000020;
+pub const MSG_WAITALL: ::c_int = 0x00000040;
+pub const MSG_DONTWAIT: ::c_int = 0x00000080;
+pub const MSG_EOF: ::c_int = 0x00000100;
+
+pub const SCM_TIMESTAMP: ::c_int = 0x02;
+pub const SCM_CREDS: ::c_int = 0x03;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+pub const SOCK_RAW: ::c_int = 3;
+pub const SOCK_RDM: ::c_int = 4;
+pub const SOCK_SEQPACKET: ::c_int = 5;
+pub const SOCK_CLOEXEC: ::c_int = 0x10000000;
+pub const SOCK_NONBLOCK: ::c_int = 0x20000000;
+pub const SOCK_MAXADDRLEN: ::c_int = 255;
+pub const IP_TTL: ::c_int = 4;
+pub const IP_HDRINCL: ::c_int = 2;
+pub const IP_RECVDSTADDR: ::c_int = 7;
+pub const IP_SENDSRCADDR: ::c_int = IP_RECVDSTADDR;
+pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
+pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
+pub const IP_RECVIF: ::c_int = 20;
+pub const IPV6_JOIN_GROUP: ::c_int = 12;
+pub const IPV6_LEAVE_GROUP: ::c_int = 13;
+pub const IPV6_CHECKSUM: ::c_int = 26;
+pub const IPV6_RECVPKTINFO: ::c_int = 36;
+pub const IPV6_PKTINFO: ::c_int = 46;
+pub const IPV6_HOPLIMIT: ::c_int = 47;
+pub const IPV6_RECVTCLASS: ::c_int = 57;
+pub const IPV6_TCLASS: ::c_int = 61;
+pub const IPV6_DONTFRAG: ::c_int = 62;
+pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 70;
+pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 71;
+pub const IP_BLOCK_SOURCE: ::c_int = 72;
+pub const IP_UNBLOCK_SOURCE: ::c_int = 73;
+
+pub const TCP_NOPUSH: ::c_int = 4;
+pub const TCP_NOOPT: ::c_int = 8;
+pub const TCP_KEEPIDLE: ::c_int = 256;
+pub const TCP_KEEPINTVL: ::c_int = 512;
+pub const TCP_KEEPCNT: ::c_int = 1024;
+
+pub const SOL_SOCKET: ::c_int = 0xffff;
+pub const SO_DEBUG: ::c_int = 0x01;
+pub const SO_ACCEPTCONN: ::c_int = 0x0002;
+pub const SO_REUSEADDR: ::c_int = 0x0004;
+pub const SO_KEEPALIVE: ::c_int = 0x0008;
+pub const SO_DONTROUTE: ::c_int = 0x0010;
+pub const SO_BROADCAST: ::c_int = 0x0020;
+pub const SO_USELOOPBACK: ::c_int = 0x0040;
+pub const SO_LINGER: ::c_int = 0x0080;
+pub const SO_OOBINLINE: ::c_int = 0x0100;
+pub const SO_REUSEPORT: ::c_int = 0x0200;
+pub const SO_TIMESTAMP: ::c_int = 0x0400;
+pub const SO_NOSIGPIPE: ::c_int = 0x0800;
+pub const SO_ACCEPTFILTER: ::c_int = 0x1000;
+pub const SO_SNDBUF: ::c_int = 0x1001;
+pub const SO_RCVBUF: ::c_int = 0x1002;
+pub const SO_SNDLOWAT: ::c_int = 0x1003;
+pub const SO_RCVLOWAT: ::c_int = 0x1004;
+pub const SO_SNDTIMEO: ::c_int = 0x1005;
+pub const SO_RCVTIMEO: ::c_int = 0x1006;
+pub const SO_ERROR: ::c_int = 0x1007;
+pub const SO_TYPE: ::c_int = 0x1008;
+
+pub const LOCAL_PEERCRED: ::c_int = 1;
+
+pub const SHUT_RD: ::c_int = 0;
+pub const SHUT_WR: ::c_int = 1;
+pub const SHUT_RDWR: ::c_int = 2;
+
+pub const LOCK_SH: ::c_int = 1;
+pub const LOCK_EX: ::c_int = 2;
+pub const LOCK_NB: ::c_int = 4;
+pub const LOCK_UN: ::c_int = 8;
+
+pub const MAP_COPY: ::c_int = 0x0002;
+#[doc(hidden)]
+#[deprecated(
+    since = "0.2.54",
+    note = "Removed in FreeBSD 11, unused in DragonFlyBSD"
+)]
+pub const MAP_RENAME: ::c_int = 0x0020;
+#[doc(hidden)]
+#[deprecated(
+    since = "0.2.54",
+    note = "Removed in FreeBSD 11, unused in DragonFlyBSD"
+)]
+pub const MAP_NORESERVE: ::c_int = 0x0040;
+pub const MAP_HASSEMAPHORE: ::c_int = 0x0200;
+pub const MAP_STACK: ::c_int = 0x0400;
+pub const MAP_NOSYNC: ::c_int = 0x0800;
+pub const MAP_NOCORE: ::c_int = 0x020000;
+
+pub const IPPROTO_RAW: ::c_int = 255;
+
+pub const _PC_LINK_MAX: ::c_int = 1;
+pub const _PC_MAX_CANON: ::c_int = 2;
+pub const _PC_MAX_INPUT: ::c_int = 3;
+pub const _PC_NAME_MAX: ::c_int = 4;
+pub const _PC_PATH_MAX: ::c_int = 5;
+pub const _PC_PIPE_BUF: ::c_int = 6;
+pub const _PC_CHOWN_RESTRICTED: ::c_int = 7;
+pub const _PC_NO_TRUNC: ::c_int = 8;
+pub const _PC_VDISABLE: ::c_int = 9;
+pub const _PC_ALLOC_SIZE_MIN: ::c_int = 10;
+pub const _PC_FILESIZEBITS: ::c_int = 12;
+pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14;
+pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15;
+pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16;
+pub const _PC_REC_XFER_ALIGN: ::c_int = 17;
+pub const _PC_SYMLINK_MAX: ::c_int = 18;
+pub const _PC_MIN_HOLE_SIZE: ::c_int = 21;
+pub const _PC_ASYNC_IO: ::c_int = 53;
+pub const _PC_PRIO_IO: ::c_int = 54;
+pub const _PC_SYNC_IO: ::c_int = 55;
+pub const _PC_ACL_EXTENDED: ::c_int = 59;
+pub const _PC_ACL_PATH_MAX: ::c_int = 60;
+pub const _PC_CAP_PRESENT: ::c_int = 61;
+pub const _PC_INF_PRESENT: ::c_int = 62;
+pub const _PC_MAC_PRESENT: ::c_int = 63;
+
+pub const _SC_ARG_MAX: ::c_int = 1;
+pub const _SC_CHILD_MAX: ::c_int = 2;
+pub const _SC_CLK_TCK: ::c_int = 3;
+pub const _SC_NGROUPS_MAX: ::c_int = 4;
+pub const _SC_OPEN_MAX: ::c_int = 5;
+pub const _SC_JOB_CONTROL: ::c_int = 6;
+pub const _SC_SAVED_IDS: ::c_int = 7;
+pub const _SC_VERSION: ::c_int = 8;
+pub const _SC_BC_BASE_MAX: ::c_int = 9;
+pub const _SC_BC_DIM_MAX: ::c_int = 10;
+pub const _SC_BC_SCALE_MAX: ::c_int = 11;
+pub const _SC_BC_STRING_MAX: ::c_int = 12;
+pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13;
+pub const _SC_EXPR_NEST_MAX: ::c_int = 14;
+pub const _SC_LINE_MAX: ::c_int = 15;
+pub const _SC_RE_DUP_MAX: ::c_int = 16;
+pub const _SC_2_VERSION: ::c_int = 17;
+pub const _SC_2_C_BIND: ::c_int = 18;
+pub const _SC_2_C_DEV: ::c_int = 19;
+pub const _SC_2_CHAR_TERM: ::c_int = 20;
+pub const _SC_2_FORT_DEV: ::c_int = 21;
+pub const _SC_2_FORT_RUN: ::c_int = 22;
+pub const _SC_2_LOCALEDEF: ::c_int = 23;
+pub const _SC_2_SW_DEV: ::c_int = 24;
+pub const _SC_2_UPE: ::c_int = 25;
+pub const _SC_STREAM_MAX: ::c_int = 26;
+pub const _SC_TZNAME_MAX: ::c_int = 27;
+pub const _SC_ASYNCHRONOUS_IO: ::c_int = 28;
+pub const _SC_MAPPED_FILES: ::c_int = 29;
+pub const _SC_MEMLOCK: ::c_int = 30;
+pub const _SC_MEMLOCK_RANGE: ::c_int = 31;
+pub const _SC_MEMORY_PROTECTION: ::c_int = 32;
+pub const _SC_MESSAGE_PASSING: ::c_int = 33;
+pub const _SC_PRIORITIZED_IO: ::c_int = 34;
+pub const _SC_PRIORITY_SCHEDULING: ::c_int = 35;
+pub const _SC_REALTIME_SIGNALS: ::c_int = 36;
+pub const _SC_SEMAPHORES: ::c_int = 37;
+pub const _SC_FSYNC: ::c_int = 38;
+pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 39;
+pub const _SC_SYNCHRONIZED_IO: ::c_int = 40;
+pub const _SC_TIMERS: ::c_int = 41;
+pub const _SC_AIO_LISTIO_MAX: ::c_int = 42;
+pub const _SC_AIO_MAX: ::c_int = 43;
+pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44;
+pub const _SC_DELAYTIMER_MAX: ::c_int = 45;
+pub const _SC_MQ_OPEN_MAX: ::c_int = 46;
+pub const _SC_PAGESIZE: ::c_int = 47;
+pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
+pub const _SC_RTSIG_MAX: ::c_int = 48;
+pub const _SC_SEM_NSEMS_MAX: ::c_int = 49;
+pub const _SC_SEM_VALUE_MAX: ::c_int = 50;
+pub const _SC_SIGQUEUE_MAX: ::c_int = 51;
+pub const _SC_TIMER_MAX: ::c_int = 52;
+pub const _SC_IOV_MAX: ::c_int = 56;
+pub const _SC_NPROCESSORS_CONF: ::c_int = 57;
+pub const _SC_2_PBS: ::c_int = 59;
+pub const _SC_2_PBS_ACCOUNTING: ::c_int = 60;
+pub const _SC_2_PBS_CHECKPOINT: ::c_int = 61;
+pub const _SC_2_PBS_LOCATE: ::c_int = 62;
+pub const _SC_2_PBS_MESSAGE: ::c_int = 63;
+pub const _SC_2_PBS_TRACK: ::c_int = 64;
+pub const _SC_ADVISORY_INFO: ::c_int = 65;
+pub const _SC_BARRIERS: ::c_int = 66;
+pub const _SC_CLOCK_SELECTION: ::c_int = 67;
+pub const _SC_CPUTIME: ::c_int = 68;
+pub const _SC_FILE_LOCKING: ::c_int = 69;
+pub const _SC_NPROCESSORS_ONLN: ::c_int = 58;
+pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 70;
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 71;
+pub const _SC_HOST_NAME_MAX: ::c_int = 72;
+pub const _SC_LOGIN_NAME_MAX: ::c_int = 73;
+pub const _SC_MONOTONIC_CLOCK: ::c_int = 74;
+pub const _SC_MQ_PRIO_MAX: ::c_int = 75;
+pub const _SC_READER_WRITER_LOCKS: ::c_int = 76;
+pub const _SC_REGEXP: ::c_int = 77;
+pub const _SC_SHELL: ::c_int = 78;
+pub const _SC_SPAWN: ::c_int = 79;
+pub const _SC_SPIN_LOCKS: ::c_int = 80;
+pub const _SC_SPORADIC_SERVER: ::c_int = 81;
+pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 82;
+pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 83;
+pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 85;
+pub const _SC_THREAD_KEYS_MAX: ::c_int = 86;
+pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 87;
+pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 88;
+pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 89;
+pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 90;
+pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 91;
+pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 92;
+pub const _SC_THREAD_STACK_MIN: ::c_int = 93;
+pub const _SC_THREAD_THREADS_MAX: ::c_int = 94;
+pub const _SC_TIMEOUTS: ::c_int = 95;
+pub const _SC_THREADS: ::c_int = 96;
+pub const _SC_TRACE: ::c_int = 97;
+pub const _SC_TRACE_EVENT_FILTER: ::c_int = 98;
+pub const _SC_TRACE_INHERIT: ::c_int = 99;
+pub const _SC_TRACE_LOG: ::c_int = 100;
+pub const _SC_TTY_NAME_MAX: ::c_int = 101;
+pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 102;
+pub const _SC_V6_ILP32_OFF32: ::c_int = 103;
+pub const _SC_V6_ILP32_OFFBIG: ::c_int = 104;
+pub const _SC_V6_LP64_OFF64: ::c_int = 105;
+pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 106;
+pub const _SC_ATEXIT_MAX: ::c_int = 107;
+pub const _SC_XOPEN_CRYPT: ::c_int = 108;
+pub const _SC_XOPEN_ENH_I18N: ::c_int = 109;
+pub const _SC_XOPEN_LEGACY: ::c_int = 110;
+pub const _SC_XOPEN_REALTIME: ::c_int = 111;
+pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 112;
+pub const _SC_XOPEN_SHM: ::c_int = 113;
+pub const _SC_XOPEN_STREAMS: ::c_int = 114;
+pub const _SC_XOPEN_UNIX: ::c_int = 115;
+pub const _SC_XOPEN_VERSION: ::c_int = 116;
+pub const _SC_XOPEN_XCU_VERSION: ::c_int = 117;
+pub const _SC_IPV6: ::c_int = 118;
+pub const _SC_RAW_SOCKETS: ::c_int = 119;
+pub const _SC_SYMLOOP_MAX: ::c_int = 120;
+pub const _SC_PHYS_PAGES: ::c_int = 121;
+
+pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0 as *mut _;
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = 0 as *mut _;
+pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = 0 as *mut _;
+pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 3;
+pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_ERRORCHECK;
+
+pub const SCHED_FIFO: ::c_int = 1;
+pub const SCHED_OTHER: ::c_int = 2;
+pub const SCHED_RR: ::c_int = 3;
+
+pub const FD_SETSIZE: usize = 1024;
+
+pub const ST_NOSUID: ::c_ulong = 2;
+
+pub const NI_MAXHOST: ::size_t = 1025;
+
+pub const XUCRED_VERSION: ::c_uint = 0;
+
+pub const RTLD_LOCAL: ::c_int = 0;
+pub const RTLD_NODELETE: ::c_int = 0x1000;
+pub const RTLD_NOLOAD: ::c_int = 0x2000;
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+
+pub const LOG_NTP: ::c_int = 12 << 3;
+pub const LOG_SECURITY: ::c_int = 13 << 3;
+pub const LOG_CONSOLE: ::c_int = 14 << 3;
+pub const LOG_NFACILITIES: ::c_int = 24;
+
+pub const TIOCEXCL: ::c_ulong = 0x2000740d;
+pub const TIOCNXCL: ::c_ulong = 0x2000740e;
+pub const TIOCFLUSH: ::c_ulong = 0x80047410;
+pub const TIOCGETA: ::c_ulong = 0x402c7413;
+pub const TIOCSETA: ::c_ulong = 0x802c7414;
+pub const TIOCSETAW: ::c_ulong = 0x802c7415;
+pub const TIOCSETAF: ::c_ulong = 0x802c7416;
+pub const TIOCGETD: ::c_ulong = 0x4004741a;
+pub const TIOCSETD: ::c_ulong = 0x8004741b;
+pub const TIOCGDRAINWAIT: ::c_ulong = 0x40047456;
+pub const TIOCSDRAINWAIT: ::c_ulong = 0x80047457;
+pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;
+pub const TIOCMGDTRWAIT: ::c_ulong = 0x4004745a;
+pub const TIOCMSDTRWAIT: ::c_ulong = 0x8004745b;
+pub const TIOCDRAIN: ::c_ulong = 0x2000745e;
+pub const TIOCEXT: ::c_ulong = 0x80047460;
+pub const TIOCSCTTY: ::c_ulong = 0x20007461;
+pub const TIOCCONS: ::c_ulong = 0x80047462;
+pub const TIOCGSID: ::c_ulong = 0x40047463;
+pub const TIOCSTAT: ::c_ulong = 0x20007465;
+pub const TIOCUCNTL: ::c_ulong = 0x80047466;
+pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
+pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
+pub const TIOCMGET: ::c_ulong = 0x4004746a;
+pub const TIOCM_LE: ::c_int = 0x1;
+pub const TIOCM_DTR: ::c_int = 0x2;
+pub const TIOCM_RTS: ::c_int = 0x4;
+pub const TIOCM_ST: ::c_int = 0x8;
+pub const TIOCM_SR: ::c_int = 0x10;
+pub const TIOCM_CTS: ::c_int = 0x20;
+pub const TIOCM_RI: ::c_int = 0x80;
+pub const TIOCM_DSR: ::c_int = 0x100;
+pub const TIOCM_CD: ::c_int = 0x40;
+pub const TIOCM_CAR: ::c_int = 0x40;
+pub const TIOCM_RNG: ::c_int = 0x80;
+pub const TIOCMBIC: ::c_ulong = 0x8004746b;
+pub const TIOCMBIS: ::c_ulong = 0x8004746c;
+pub const TIOCMSET: ::c_ulong = 0x8004746d;
+pub const TIOCSTART: ::c_ulong = 0x2000746e;
+pub const TIOCSTOP: ::c_ulong = 0x2000746f;
+pub const TIOCPKT: ::c_ulong = 0x80047470;
+pub const TIOCPKT_DATA: ::c_int = 0x0;
+pub const TIOCPKT_FLUSHREAD: ::c_int = 0x1;
+pub const TIOCPKT_FLUSHWRITE: ::c_int = 0x2;
+pub const TIOCPKT_STOP: ::c_int = 0x4;
+pub const TIOCPKT_START: ::c_int = 0x8;
+pub const TIOCPKT_NOSTOP: ::c_int = 0x10;
+pub const TIOCPKT_DOSTOP: ::c_int = 0x20;
+pub const TIOCPKT_IOCTL: ::c_int = 0x40;
+pub const TIOCNOTTY: ::c_ulong = 0x20007471;
+pub const TIOCSTI: ::c_ulong = 0x80017472;
+pub const TIOCOUTQ: ::c_ulong = 0x40047473;
+pub const TIOCSPGRP: ::c_ulong = 0x80047476;
+pub const TIOCGPGRP: ::c_ulong = 0x40047477;
+pub const TIOCCDTR: ::c_ulong = 0x20007478;
+pub const TIOCSDTR: ::c_ulong = 0x20007479;
+pub const TTYDISC: ::c_int = 0x0;
+pub const SLIPDISC: ::c_int = 0x4;
+pub const PPPDISC: ::c_int = 0x5;
+pub const NETGRAPHDISC: ::c_int = 0x6;
+
+pub const BIOCGRSIG: ::c_ulong = 0x40044272;
+pub const BIOCSRSIG: ::c_ulong = 0x80044273;
+pub const BIOCSDLT: ::c_ulong = 0x80044278;
+pub const BIOCGSEESENT: ::c_ulong = 0x40044276;
+pub const BIOCSSEESENT: ::c_ulong = 0x80044277;
+pub const BIOCSETF: ::c_ulong = 0x80104267;
+pub const BIOCGDLTLIST: ::c_ulong = 0xc0104279;
+pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
+pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
+
+pub const FIODTYPE: ::c_ulong = 0x4004667a;
+pub const FIOGETLBA: ::c_ulong = 0x40046679;
+
+pub const B0: speed_t = 0;
+pub const B50: speed_t = 50;
+pub const B75: speed_t = 75;
+pub const B110: speed_t = 110;
+pub const B134: speed_t = 134;
+pub const B150: speed_t = 150;
+pub const B200: speed_t = 200;
+pub const B300: speed_t = 300;
+pub const B600: speed_t = 600;
+pub const B1200: speed_t = 1200;
+pub const B1800: speed_t = 1800;
+pub const B2400: speed_t = 2400;
+pub const B4800: speed_t = 4800;
+pub const B9600: speed_t = 9600;
+pub const B19200: speed_t = 19200;
+pub const B38400: speed_t = 38400;
+pub const B7200: speed_t = 7200;
+pub const B14400: speed_t = 14400;
+pub const B28800: speed_t = 28800;
+pub const B57600: speed_t = 57600;
+pub const B76800: speed_t = 76800;
+pub const B115200: speed_t = 115200;
+pub const B230400: speed_t = 230400;
+pub const EXTA: speed_t = 19200;
+pub const EXTB: speed_t = 38400;
+
+pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
+
+pub const CRTSCTS: ::tcflag_t = 0x00030000;
+pub const CCTS_OFLOW: ::tcflag_t = 0x00010000;
+pub const CRTS_IFLOW: ::tcflag_t = 0x00020000;
+pub const CDTR_IFLOW: ::tcflag_t = 0x00040000;
+pub const CDSR_OFLOW: ::tcflag_t = 0x00080000;
+pub const CCAR_OFLOW: ::tcflag_t = 0x00100000;
+pub const VERASE2: usize = 7;
+pub const OCRNL: ::tcflag_t = 0x10;
+pub const ONOCR: ::tcflag_t = 0x20;
+pub const ONLRET: ::tcflag_t = 0x40;
+
+pub const CMGROUP_MAX: usize = 16;
+
+pub const EUI64_LEN: usize = 8;
+
+// https://github.com/freebsd/freebsd/blob/HEAD/sys/net/bpf.h
+pub const BPF_ALIGNMENT: usize = SIZEOF_LONG;
+
+// Values for rtprio struct (prio field) and syscall (function argument)
+pub const RTP_PRIO_MIN: ::c_ushort = 0;
+pub const RTP_PRIO_MAX: ::c_ushort = 31;
+pub const RTP_LOOKUP: ::c_int = 0;
+pub const RTP_SET: ::c_int = 1;
+
+// Flags for chflags(2)
+pub const UF_SETTABLE: ::c_ulong = 0x0000ffff;
+pub const UF_NODUMP: ::c_ulong = 0x00000001;
+pub const UF_IMMUTABLE: ::c_ulong = 0x00000002;
+pub const UF_APPEND: ::c_ulong = 0x00000004;
+pub const UF_OPAQUE: ::c_ulong = 0x00000008;
+pub const UF_NOUNLINK: ::c_ulong = 0x00000010;
+pub const SF_SETTABLE: ::c_ulong = 0xffff0000;
+pub const SF_ARCHIVED: ::c_ulong = 0x00010000;
+pub const SF_IMMUTABLE: ::c_ulong = 0x00020000;
+pub const SF_APPEND: ::c_ulong = 0x00040000;
+pub const SF_NOUNLINK: ::c_ulong = 0x00100000;
+
+pub const TIMER_ABSTIME: ::c_int = 1;
+
+//<sys/timex.h>
+pub const NTP_API: ::c_int = 4;
+pub const MAXPHASE: ::c_long = 500000000;
+pub const MAXFREQ: ::c_long = 500000;
+pub const MINSEC: ::c_int = 256;
+pub const MAXSEC: ::c_int = 2048;
+pub const NANOSECOND: ::c_long = 1000000000;
+pub const SCALE_PPM: ::c_int = 65;
+pub const MAXTC: ::c_int = 10;
+pub const MOD_OFFSET: ::c_uint = 0x0001;
+pub const MOD_FREQUENCY: ::c_uint = 0x0002;
+pub const MOD_MAXERROR: ::c_uint = 0x0004;
+pub const MOD_ESTERROR: ::c_uint = 0x0008;
+pub const MOD_STATUS: ::c_uint = 0x0010;
+pub const MOD_TIMECONST: ::c_uint = 0x0020;
+pub const MOD_PPSMAX: ::c_uint = 0x0040;
+pub const MOD_TAI: ::c_uint = 0x0080;
+pub const MOD_MICRO: ::c_uint = 0x1000;
+pub const MOD_NANO: ::c_uint = 0x2000;
+pub const MOD_CLKB: ::c_uint = 0x4000;
+pub const MOD_CLKA: ::c_uint = 0x8000;
+pub const STA_PLL: ::c_int = 0x0001;
+pub const STA_PPSFREQ: ::c_int = 0x0002;
+pub const STA_PPSTIME: ::c_int = 0x0004;
+pub const STA_FLL: ::c_int = 0x0008;
+pub const STA_INS: ::c_int = 0x0010;
+pub const STA_DEL: ::c_int = 0x0020;
+pub const STA_UNSYNC: ::c_int = 0x0040;
+pub const STA_FREQHOLD: ::c_int = 0x0080;
+pub const STA_PPSSIGNAL: ::c_int = 0x0100;
+pub const STA_PPSJITTER: ::c_int = 0x0200;
+pub const STA_PPSWANDER: ::c_int = 0x0400;
+pub const STA_PPSERROR: ::c_int = 0x0800;
+pub const STA_CLOCKERR: ::c_int = 0x1000;
+pub const STA_NANO: ::c_int = 0x2000;
+pub const STA_MODE: ::c_int = 0x4000;
+pub const STA_CLK: ::c_int = 0x8000;
+pub const STA_RONLY: ::c_int = STA_PPSSIGNAL
+    | STA_PPSJITTER
+    | STA_PPSWANDER
+    | STA_PPSERROR
+    | STA_CLOCKERR
+    | STA_NANO
+    | STA_MODE
+    | STA_CLK;
+pub const TIME_OK: ::c_int = 0;
+pub const TIME_INS: ::c_int = 1;
+pub const TIME_DEL: ::c_int = 2;
+pub const TIME_OOP: ::c_int = 3;
+pub const TIME_WAIT: ::c_int = 4;
+pub const TIME_ERROR: ::c_int = 5;
+
+pub const REG_ENOSYS: ::c_int = -1;
+pub const REG_ILLSEQ: ::c_int = 17;
+
+pub const IPC_PRIVATE: ::key_t = 0;
+pub const IPC_CREAT: ::c_int = 0o1000;
+pub const IPC_EXCL: ::c_int = 0o2000;
+pub const IPC_NOWAIT: ::c_int = 0o4000;
+pub const IPC_RMID: ::c_int = 0;
+pub const IPC_SET: ::c_int = 1;
+pub const IPC_STAT: ::c_int = 2;
+pub const IPC_R: ::c_int = 0o400;
+pub const IPC_W: ::c_int = 0o200;
+pub const IPC_M: ::c_int = 0o10000;
+
+pub const SHM_RDONLY: ::c_int = 0o10000;
+pub const SHM_RND: ::c_int = 0o20000;
+pub const SHM_R: ::c_int = 0o400;
+pub const SHM_W: ::c_int = 0o200;
+
+pub const KENV_GET: ::c_int = 0;
+pub const KENV_SET: ::c_int = 1;
+pub const KENV_UNSET: ::c_int = 2;
+pub const KENV_DUMP: ::c_int = 3;
+pub const KENV_MNAMELEN: ::c_int = 128;
+pub const KENV_MVALLEN: ::c_int = 128;
+
+pub const RB_ASKNAME: ::c_int = 0x001;
+pub const RB_SINGLE: ::c_int = 0x002;
+pub const RB_NOSYNC: ::c_int = 0x004;
+pub const RB_HALT: ::c_int = 0x008;
+pub const RB_INITNAME: ::c_int = 0x010;
+pub const RB_DFLTROOT: ::c_int = 0x020;
+pub const RB_KDB: ::c_int = 0x040;
+pub const RB_RDONLY: ::c_int = 0x080;
+pub const RB_DUMP: ::c_int = 0x100;
+pub const RB_MINIROOT: ::c_int = 0x200;
+pub const RB_VERBOSE: ::c_int = 0x800;
+pub const RB_SERIAL: ::c_int = 0x1000;
+pub const RB_CDROM: ::c_int = 0x2000;
+pub const RB_POWEROFF: ::c_int = 0x4000;
+pub const RB_GDB: ::c_int = 0x8000;
+pub const RB_MUTE: ::c_int = 0x10000;
+pub const RB_SELFTEST: ::c_int = 0x20000;
+
+// For getrandom()
+pub const GRND_NONBLOCK: ::c_uint = 0x1;
+pub const GRND_RANDOM: ::c_uint = 0x2;
+pub const GRND_INSECURE: ::c_uint = 0x4;
+
+safe_f! {
+    pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
+        status == 0x13
+    }
+
+    pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
+        status >> 8
+    }
+
+    pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
+        (status & 0o177) == 0o177
+    }
+}
+
+extern "C" {
+    pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
+    pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
+
+    pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
+    pub fn accept4(
+        s: ::c_int,
+        addr: *mut ::sockaddr,
+        addrlen: *mut ::socklen_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn chflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int;
+    pub fn chflagsat(
+        fd: ::c_int,
+        path: *const ::c_char,
+        flags: ::c_ulong,
+        atflag: ::c_int,
+    ) -> ::c_int;
+
+    pub fn clock_nanosleep(
+        clk_id: ::clockid_t,
+        flags: ::c_int,
+        rqtp: *const ::timespec,
+        rmtp: *mut ::timespec,
+    ) -> ::c_int;
+
+    pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+    pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int;
+
+    pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int;
+
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
+    pub fn duplocale(base: ::locale_t) -> ::locale_t;
+    pub fn endutxent();
+    pub fn fchflags(fd: ::c_int, flags: ::c_ulong) -> ::c_int;
+    pub fn fexecve(
+        fd: ::c_int,
+        argv: *const *const ::c_char,
+        envp: *const *const ::c_char,
+    ) -> ::c_int;
+    pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
+    pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int;
+    pub fn getgrent_r(
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn getpwent_r(
+        pwd: *mut ::passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::passwd,
+    ) -> ::c_int;
+    pub fn getgrouplist(
+        name: *const ::c_char,
+        basegid: ::gid_t,
+        groups: *mut ::gid_t,
+        ngroups: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn getnameinfo(
+        sa: *const ::sockaddr,
+        salen: ::socklen_t,
+        host: *mut ::c_char,
+        hostlen: ::size_t,
+        serv: *mut ::c_char,
+        servlen: ::size_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn getpriority(which: ::c_int, who: ::c_int) -> ::c_int;
+    pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int;
+    pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int;
+    pub fn getutxent() -> *mut utmpx;
+    pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
+    pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
+    pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "freebsd", any(freebsd11, freebsd10)),
+        link_name = "kevent@FBSD_1.0"
+    )]
+    pub fn kevent(
+        kq: ::c_int,
+        changelist: *const ::kevent,
+        nchanges: ::c_int,
+        eventlist: *mut ::kevent,
+        nevents: ::c_int,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn lchflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int;
+    pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
+    pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
+    pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "freebsd", any(freebsd11, freebsd10)),
+        link_name = "mknodat@FBSD_1.1"
+    )]
+    pub fn mknodat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::mode_t,
+        dev: dev_t,
+    ) -> ::c_int;
+    pub fn malloc_usable_size(ptr: *const ::c_void) -> ::size_t;
+    pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
+    pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+    pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
+    pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+    pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
+    pub fn ppoll(
+        fds: *mut ::pollfd,
+        nfds: ::nfds_t,
+        timeout: *const ::timespec,
+        sigmask: *const sigset_t,
+    ) -> ::c_int;
+    pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
+    pub fn pthread_attr_get_np(tid: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
+    pub fn pthread_attr_getguardsize(
+        attr: *const ::pthread_attr_t,
+        guardsize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
+    pub fn pthread_attr_getstack(
+        attr: *const ::pthread_attr_t,
+        stackaddr: *mut *mut ::c_void,
+        stacksize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_condattr_getclock(
+        attr: *const pthread_condattr_t,
+        clock_id: *mut clockid_t,
+    ) -> ::c_int;
+    pub fn pthread_condattr_getpshared(
+        attr: *const pthread_condattr_t,
+        pshared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_condattr_setclock(
+        attr: *mut pthread_condattr_t,
+        clock_id: ::clockid_t,
+    ) -> ::c_int;
+    pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int;
+    pub fn pthread_main_np() -> ::c_int;
+    pub fn pthread_mutex_timedlock(
+        lock: *mut pthread_mutex_t,
+        abstime: *const ::timespec,
+    ) -> ::c_int;
+    pub fn pthread_mutexattr_getpshared(
+        attr: *const pthread_mutexattr_t,
+        pshared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_mutexattr_setpshared(
+        attr: *mut pthread_mutexattr_t,
+        pshared: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_rwlockattr_getpshared(
+        attr: *const pthread_rwlockattr_t,
+        val: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int;
+    pub fn pthread_barrierattr_init(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_destroy(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_getpshared(
+        attr: *const ::pthread_barrierattr_t,
+        shared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrierattr_setpshared(
+        attr: *mut ::pthread_barrierattr_t,
+        shared: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrier_init(
+        barrier: *mut pthread_barrier_t,
+        attr: *const ::pthread_barrierattr_t,
+        count: ::c_uint,
+    ) -> ::c_int;
+    pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> ::c_int;
+    pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> ::c_int;
+    pub fn pthread_get_name_np(tid: ::pthread_t, name: *mut ::c_char, len: ::size_t);
+    pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
+    pub fn pthread_getname_np(
+        thread: ::pthread_t,
+        buffer: *mut ::c_char,
+        length: ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
+    pub fn pthread_setschedparam(
+        native: ::pthread_t,
+        policy: ::c_int,
+        param: *const sched_param,
+    ) -> ::c_int;
+    pub fn pthread_getschedparam(
+        native: ::pthread_t,
+        policy: *mut ::c_int,
+        param: *mut sched_param,
+    ) -> ::c_int;
+    pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_char, data: ::c_int) -> ::c_int;
+    pub fn utrace(addr: *const ::c_void, len: ::size_t) -> ::c_int;
+    pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
+    pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
+        -> ::ssize_t;
+    pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
+    pub fn rtprio(function: ::c_int, pid: ::pid_t, rtp: *mut rtprio) -> ::c_int;
+    pub fn sched_rr_get_interval(pid: ::pid_t, t: *mut ::timespec) -> ::c_int;
+    pub fn sched_getparam(pid: ::pid_t, param: *mut sched_param) -> ::c_int;
+    pub fn sched_setparam(pid: ::pid_t, param: *const sched_param) -> ::c_int;
+    pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
+    pub fn sched_setscheduler(
+        pid: ::pid_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
+    pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
+    pub fn sendfile(
+        fd: ::c_int,
+        s: ::c_int,
+        offset: ::off_t,
+        nbytes: ::size_t,
+        hdtr: *mut ::sf_hdtr,
+        sbytes: *mut ::off_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int;
+    pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int;
+    pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int;
+    pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
+    pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
+    pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
+    pub fn setutxent();
+    pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int;
+    pub fn sigtimedwait(
+        set: *const sigset_t,
+        info: *mut siginfo_t,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
+    pub fn sysctl(
+        name: *const ::c_int,
+        namelen: ::c_uint,
+        oldp: *mut ::c_void,
+        oldlenp: *mut ::size_t,
+        newp: *const ::c_void,
+        newlen: ::size_t,
+    ) -> ::c_int;
+    pub fn sysctlbyname(
+        name: *const ::c_char,
+        oldp: *mut ::c_void,
+        oldlenp: *mut ::size_t,
+        newp: *const ::c_void,
+        newlen: ::size_t,
+    ) -> ::c_int;
+    pub fn sysctlnametomib(
+        name: *const ::c_char,
+        mibp: *mut ::c_int,
+        sizep: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn uselocale(loc: ::locale_t) -> ::locale_t;
+    pub fn utimensat(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::timespec,
+        flag: ::c_int,
+    ) -> ::c_int;
+
+    pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
+    pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
+
+    // #include <link.h>
+    pub fn dl_iterate_phdr(
+        callback: ::Option<
+            unsafe extern "C" fn(
+                info: *mut dl_phdr_info,
+                size: usize,
+                data: *mut ::c_void,
+            ) -> ::c_int,
+        >,
+        data: *mut ::c_void,
+    ) -> ::c_int;
+
+    pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
+    pub fn iconv(
+        cd: iconv_t,
+        inbuf: *mut *mut ::c_char,
+        inbytesleft: *mut ::size_t,
+        outbuf: *mut *mut ::c_char,
+        outbytesleft: *mut ::size_t,
+    ) -> ::size_t;
+    pub fn iconv_close(cd: iconv_t) -> ::c_int;
+
+    // Added in `FreeBSD` 11.0
+    // Added in `DragonFly BSD` 5.4
+    pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t);
+    // ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1
+    pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
+    pub fn gethostid() -> ::c_long;
+    pub fn sethostid(hostid: ::c_long);
+
+    pub fn eui64_aton(a: *const ::c_char, e: *mut eui64) -> ::c_int;
+    pub fn eui64_ntoa(id: *const eui64, a: *mut ::c_char, len: ::size_t) -> ::c_int;
+    pub fn eui64_ntohost(hostname: *mut ::c_char, len: ::size_t, id: *const eui64) -> ::c_int;
+    pub fn eui64_hostton(hostname: *const ::c_char, id: *mut eui64) -> ::c_int;
+
+    pub fn eaccess(path: *const ::c_char, mode: ::c_int) -> ::c_int;
+
+    pub fn kenv(
+        action: ::c_int,
+        name: *const ::c_char,
+        value: *mut ::c_char,
+        len: ::c_int,
+    ) -> ::c_int;
+    pub fn reboot(howto: ::c_int) -> ::c_int;
+
+    pub fn exect(
+        path: *const ::c_char,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn execvP(
+        file: *const ::c_char,
+        search_path: *const ::c_char,
+        argv: *const *mut ::c_char,
+    ) -> ::c_int;
+}
+
+#[link(name = "rt")]
+extern "C" {
+    pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
+    pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
+    pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int;
+    pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
+    pub fn mq_receive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+    ) -> ::ssize_t;
+    pub fn mq_send(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+    ) -> ::c_int;
+    pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
+    pub fn mq_timedreceive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::ssize_t;
+    pub fn mq_timedsend(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
+
+    pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+    pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
+}
+
+#[link(name = "util")]
+extern "C" {
+    pub fn openpty(
+        amaster: *mut ::c_int,
+        aslave: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *mut termios,
+        winp: *mut ::winsize,
+    ) -> ::c_int;
+    pub fn forkpty(
+        amaster: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *mut termios,
+        winp: *mut ::winsize,
+    ) -> ::pid_t;
+    pub fn login_tty(fd: ::c_int) -> ::c_int;
+    pub fn fparseln(
+        stream: *mut ::FILE,
+        len: *mut ::size_t,
+        lineno: *mut ::size_t,
+        delim: *const ::c_char,
+        flags: ::c_int,
+    ) -> *mut ::c_char;
+}
+
+#[link(name = "execinfo")]
+extern "C" {
+    pub fn backtrace(addrlist: *mut *mut ::c_void, len: ::size_t) -> ::size_t;
+    pub fn backtrace_symbols(addrlist: *const *mut ::c_void, len: ::size_t) -> *mut *mut ::c_char;
+    pub fn backtrace_symbols_fd(
+        addrlist: *const *mut ::c_void,
+        len: ::size_t,
+        fd: ::c_int,
+    ) -> ::c_int;
+}
+
+#[link(name = "kvm")]
+extern "C" {
+    pub fn kvm_open(
+        execfile: *const ::c_char,
+        corefile: *const ::c_char,
+        swapfile: *const ::c_char,
+        flags: ::c_int,
+        errstr: *const ::c_char,
+    ) -> *mut ::kvm_t;
+    pub fn kvm_close(kd: *mut ::kvm_t) -> ::c_int;
+    pub fn kvm_getprocs(
+        kd: *mut ::kvm_t,
+        op: ::c_int,
+        arg: ::c_int,
+        cnt: *mut ::c_int,
+    ) -> *mut ::kinfo_proc;
+    pub fn kvm_getloadavg(kd: *mut kvm_t, loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
+    pub fn kvm_openfiles(
+        execfile: *const ::c_char,
+        corefile: *const ::c_char,
+        swapfile: *const ::c_char,
+        flags: ::c_int,
+        errbuf: *mut ::c_char,
+    ) -> *mut ::kvm_t;
+    pub fn kvm_read(
+        kd: *mut ::kvm_t,
+        addr: ::c_ulong,
+        buf: *mut ::c_void,
+        nbytes: ::size_t,
+    ) -> ::ssize_t;
+    pub fn kvm_write(
+        kd: *mut ::kvm_t,
+        addr: ::c_ulong,
+        buf: *const ::c_void,
+        nbytes: ::size_t,
+    ) -> ::ssize_t;
+}
+
+cfg_if! {
+    if #[cfg(target_os = "freebsd")] {
+        mod freebsd;
+        pub use self::freebsd::*;
+    } else if #[cfg(target_os = "dragonfly")] {
+        mod dragonfly;
+        pub use self::dragonfly::*;
+    } else {
+        // ...
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,933 @@
+pub type off_t = i64;
+pub type useconds_t = u32;
+pub type blkcnt_t = i64;
+pub type socklen_t = u32;
+pub type sa_family_t = u8;
+pub type pthread_t = ::uintptr_t;
+pub type nfds_t = ::c_uint;
+pub type regoff_t = off_t;
+
+s! {
+    pub struct sockaddr {
+        pub sa_len: u8,
+        pub sa_family: sa_family_t,
+        pub sa_data: [::c_char; 14],
+    }
+
+    pub struct sockaddr_in6 {
+        pub sin6_len: u8,
+        pub sin6_family: sa_family_t,
+        pub sin6_port: ::in_port_t,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_scope_id: u32,
+    }
+
+    pub struct passwd {
+        pub pw_name: *mut ::c_char,
+        pub pw_passwd: *mut ::c_char,
+        pub pw_uid: ::uid_t,
+        pub pw_gid: ::gid_t,
+        pub pw_change: ::time_t,
+        pub pw_class: *mut ::c_char,
+        pub pw_gecos: *mut ::c_char,
+        pub pw_dir: *mut ::c_char,
+        pub pw_shell: *mut ::c_char,
+        pub pw_expire: ::time_t,
+
+        #[cfg(not(any(target_os = "macos",
+                      target_os = "ios",
+                      target_os = "tvos",
+                      target_os = "watchos",
+                      target_os = "visionos",
+                      target_os = "netbsd",
+                      target_os = "openbsd")))]
+        pub pw_fields: ::c_int,
+    }
+
+    pub struct ifaddrs {
+        pub ifa_next: *mut ifaddrs,
+        pub ifa_name: *mut ::c_char,
+        pub ifa_flags: ::c_uint,
+        pub ifa_addr: *mut ::sockaddr,
+        pub ifa_netmask: *mut ::sockaddr,
+        pub ifa_dstaddr: *mut ::sockaddr,
+        pub ifa_data: *mut ::c_void,
+        #[cfg(target_os = "netbsd")]
+        pub ifa_addrflags: ::c_uint
+    }
+
+    pub struct fd_set {
+        #[cfg(all(target_pointer_width = "64",
+                  any(target_os = "freebsd", target_os = "dragonfly")))]
+        fds_bits: [i64; FD_SETSIZE / 64],
+        #[cfg(not(all(target_pointer_width = "64",
+                      any(target_os = "freebsd", target_os = "dragonfly"))))]
+        fds_bits: [i32; FD_SETSIZE / 32],
+    }
+
+    pub struct tm {
+        pub tm_sec: ::c_int,
+        pub tm_min: ::c_int,
+        pub tm_hour: ::c_int,
+        pub tm_mday: ::c_int,
+        pub tm_mon: ::c_int,
+        pub tm_year: ::c_int,
+        pub tm_wday: ::c_int,
+        pub tm_yday: ::c_int,
+        pub tm_isdst: ::c_int,
+        pub tm_gmtoff: ::c_long,
+        pub tm_zone: *mut ::c_char,
+    }
+
+    pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: ::socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::c_int,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: ::socklen_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct cmsghdr {
+        pub cmsg_len: ::socklen_t,
+        pub cmsg_level: ::c_int,
+        pub cmsg_type: ::c_int,
+    }
+
+    pub struct fsid_t {
+        __fsid_val: [i32; 2],
+    }
+
+    pub struct if_nameindex {
+        pub if_index: ::c_uint,
+        pub if_name: *mut ::c_char,
+    }
+
+    pub struct regex_t {
+        __re_magic: ::c_int,
+        __re_nsub: ::size_t,
+        __re_endp: *const ::c_char,
+        __re_g: *mut ::c_void,
+    }
+
+    pub struct regmatch_t {
+        pub rm_so: regoff_t,
+        pub rm_eo: regoff_t,
+    }
+
+    pub struct option {
+        pub name: *const ::c_char,
+        pub has_arg: ::c_int,
+        pub flag: *mut ::c_int,
+        pub val: ::c_int,
+    }
+}
+
+s_no_extra_traits! {
+    pub struct sockaddr_un {
+        pub sun_len: u8,
+        pub sun_family: sa_family_t,
+        pub sun_path: [c_char; 104]
+    }
+
+    pub struct utsname {
+        #[cfg(not(target_os = "dragonfly"))]
+        pub sysname: [::c_char; 256],
+        #[cfg(target_os = "dragonfly")]
+        pub sysname: [::c_char; 32],
+        #[cfg(not(target_os = "dragonfly"))]
+        pub nodename: [::c_char; 256],
+        #[cfg(target_os = "dragonfly")]
+        pub nodename: [::c_char; 32],
+        #[cfg(not(target_os = "dragonfly"))]
+        pub release: [::c_char; 256],
+        #[cfg(target_os = "dragonfly")]
+        pub release: [::c_char; 32],
+        #[cfg(not(target_os = "dragonfly"))]
+        pub version: [::c_char; 256],
+        #[cfg(target_os = "dragonfly")]
+        pub version: [::c_char; 32],
+        #[cfg(not(target_os = "dragonfly"))]
+        pub machine: [::c_char; 256],
+        #[cfg(target_os = "dragonfly")]
+        pub machine: [::c_char; 32],
+    }
+
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for sockaddr_un {
+            fn eq(&self, other: &sockaddr_un) -> bool {
+                self.sun_len == other.sun_len
+                    && self.sun_family == other.sun_family
+                    && self
+                    .sun_path
+                    .iter()
+                    .zip(other.sun_path.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for sockaddr_un {}
+
+        impl ::fmt::Debug for sockaddr_un {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_un")
+                    .field("sun_len", &self.sun_len)
+                    .field("sun_family", &self.sun_family)
+                // FIXME: .field("sun_path", &self.sun_path)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for sockaddr_un {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sun_len.hash(state);
+                self.sun_family.hash(state);
+                self.sun_path.hash(state);
+            }
+        }
+
+        impl PartialEq for utsname {
+            fn eq(&self, other: &utsname) -> bool {
+                self.sysname
+                    .iter()
+                    .zip(other.sysname.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .nodename
+                    .iter()
+                    .zip(other.nodename.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .release
+                    .iter()
+                    .zip(other.release.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .version
+                    .iter()
+                    .zip(other.version.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .machine
+                    .iter()
+                    .zip(other.machine.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for utsname {}
+
+        impl ::fmt::Debug for utsname {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("utsname")
+                // FIXME: .field("sysname", &self.sysname)
+                // FIXME: .field("nodename", &self.nodename)
+                // FIXME: .field("release", &self.release)
+                // FIXME: .field("version", &self.version)
+                // FIXME: .field("machine", &self.machine)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for utsname {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sysname.hash(state);
+                self.nodename.hash(state);
+                self.release.hash(state);
+                self.version.hash(state);
+                self.machine.hash(state);
+            }
+        }
+    }
+}
+
+pub const LC_ALL: ::c_int = 0;
+pub const LC_COLLATE: ::c_int = 1;
+pub const LC_CTYPE: ::c_int = 2;
+pub const LC_MONETARY: ::c_int = 3;
+pub const LC_NUMERIC: ::c_int = 4;
+pub const LC_TIME: ::c_int = 5;
+pub const LC_MESSAGES: ::c_int = 6;
+
+pub const FIOCLEX: ::c_ulong = 0x20006601;
+pub const FIONCLEX: ::c_ulong = 0x20006602;
+pub const FIONREAD: ::c_ulong = 0x4004667f;
+pub const FIONBIO: ::c_ulong = 0x8004667e;
+pub const FIOASYNC: ::c_ulong = 0x8004667d;
+pub const FIOSETOWN: ::c_ulong = 0x8004667c;
+pub const FIOGETOWN: ::c_ulong = 0x4004667b;
+
+pub const PATH_MAX: ::c_int = 1024;
+pub const MAXPATHLEN: ::c_int = PATH_MAX;
+
+pub const IOV_MAX: ::c_int = 1024;
+
+pub const SA_ONSTACK: ::c_int = 0x0001;
+pub const SA_SIGINFO: ::c_int = 0x0040;
+pub const SA_RESTART: ::c_int = 0x0002;
+pub const SA_RESETHAND: ::c_int = 0x0004;
+pub const SA_NOCLDSTOP: ::c_int = 0x0008;
+pub const SA_NODEFER: ::c_int = 0x0010;
+pub const SA_NOCLDWAIT: ::c_int = 0x0020;
+
+pub const SS_ONSTACK: ::c_int = 1;
+pub const SS_DISABLE: ::c_int = 4;
+
+pub const SIGCHLD: ::c_int = 20;
+pub const SIGBUS: ::c_int = 10;
+pub const SIGUSR1: ::c_int = 30;
+pub const SIGUSR2: ::c_int = 31;
+pub const SIGCONT: ::c_int = 19;
+pub const SIGSTOP: ::c_int = 17;
+pub const SIGTSTP: ::c_int = 18;
+pub const SIGURG: ::c_int = 16;
+pub const SIGIO: ::c_int = 23;
+pub const SIGSYS: ::c_int = 12;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGINFO: ::c_int = 29;
+
+pub const SIG_SETMASK: ::c_int = 3;
+pub const SIG_BLOCK: ::c_int = 0x1;
+pub const SIG_UNBLOCK: ::c_int = 0x2;
+
+pub const IP_TOS: ::c_int = 3;
+pub const IP_MULTICAST_IF: ::c_int = 9;
+pub const IP_MULTICAST_TTL: ::c_int = 10;
+pub const IP_MULTICAST_LOOP: ::c_int = 11;
+
+pub const IPV6_UNICAST_HOPS: ::c_int = 4;
+pub const IPV6_MULTICAST_IF: ::c_int = 9;
+pub const IPV6_MULTICAST_HOPS: ::c_int = 10;
+pub const IPV6_MULTICAST_LOOP: ::c_int = 11;
+pub const IPV6_V6ONLY: ::c_int = 27;
+
+pub const IPTOS_ECN_NOTECT: u8 = 0x00;
+pub const IPTOS_ECN_MASK: u8 = 0x03;
+pub const IPTOS_ECN_ECT1: u8 = 0x01;
+pub const IPTOS_ECN_ECT0: u8 = 0x02;
+pub const IPTOS_ECN_CE: u8 = 0x03;
+
+pub const ST_RDONLY: ::c_ulong = 1;
+
+pub const SCM_RIGHTS: ::c_int = 0x01;
+
+pub const NCCS: usize = 20;
+
+pub const O_ACCMODE: ::c_int = 0x3;
+pub const O_RDONLY: ::c_int = 0;
+pub const O_WRONLY: ::c_int = 1;
+pub const O_RDWR: ::c_int = 2;
+pub const O_APPEND: ::c_int = 8;
+pub const O_CREAT: ::c_int = 512;
+pub const O_TRUNC: ::c_int = 1024;
+pub const O_EXCL: ::c_int = 2048;
+pub const O_ASYNC: ::c_int = 0x40;
+pub const O_SYNC: ::c_int = 0x80;
+pub const O_NONBLOCK: ::c_int = 0x4;
+pub const O_NOFOLLOW: ::c_int = 0x100;
+pub const O_SHLOCK: ::c_int = 0x10;
+pub const O_EXLOCK: ::c_int = 0x20;
+pub const O_FSYNC: ::c_int = O_SYNC;
+pub const O_NDELAY: ::c_int = O_NONBLOCK;
+
+pub const F_GETOWN: ::c_int = 5;
+pub const F_SETOWN: ::c_int = 6;
+
+pub const F_RDLCK: ::c_short = 1;
+pub const F_UNLCK: ::c_short = 2;
+pub const F_WRLCK: ::c_short = 3;
+
+pub const MNT_RDONLY: ::c_int = 0x00000001;
+pub const MNT_SYNCHRONOUS: ::c_int = 0x00000002;
+pub const MNT_NOEXEC: ::c_int = 0x00000004;
+pub const MNT_NOSUID: ::c_int = 0x00000008;
+pub const MNT_ASYNC: ::c_int = 0x00000040;
+pub const MNT_EXPORTED: ::c_int = 0x00000100;
+pub const MNT_UPDATE: ::c_int = 0x00010000;
+pub const MNT_RELOAD: ::c_int = 0x00040000;
+pub const MNT_FORCE: ::c_int = 0x00080000;
+
+pub const Q_SYNC: ::c_int = 0x600;
+pub const Q_QUOTAON: ::c_int = 0x100;
+pub const Q_QUOTAOFF: ::c_int = 0x200;
+
+pub const TCIOFF: ::c_int = 3;
+pub const TCION: ::c_int = 4;
+pub const TCOOFF: ::c_int = 1;
+pub const TCOON: ::c_int = 2;
+pub const TCIFLUSH: ::c_int = 1;
+pub const TCOFLUSH: ::c_int = 2;
+pub const TCIOFLUSH: ::c_int = 3;
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+pub const VEOF: usize = 0;
+pub const VEOL: usize = 1;
+pub const VEOL2: usize = 2;
+pub const VERASE: usize = 3;
+pub const VWERASE: usize = 4;
+pub const VKILL: usize = 5;
+pub const VREPRINT: usize = 6;
+pub const VINTR: usize = 8;
+pub const VQUIT: usize = 9;
+pub const VSUSP: usize = 10;
+pub const VDSUSP: usize = 11;
+pub const VSTART: usize = 12;
+pub const VSTOP: usize = 13;
+pub const VLNEXT: usize = 14;
+pub const VDISCARD: usize = 15;
+pub const VMIN: usize = 16;
+pub const VTIME: usize = 17;
+pub const VSTATUS: usize = 18;
+pub const _POSIX_VDISABLE: ::cc_t = 0xff;
+pub const IGNBRK: ::tcflag_t = 0x00000001;
+pub const BRKINT: ::tcflag_t = 0x00000002;
+pub const IGNPAR: ::tcflag_t = 0x00000004;
+pub const PARMRK: ::tcflag_t = 0x00000008;
+pub const INPCK: ::tcflag_t = 0x00000010;
+pub const ISTRIP: ::tcflag_t = 0x00000020;
+pub const INLCR: ::tcflag_t = 0x00000040;
+pub const IGNCR: ::tcflag_t = 0x00000080;
+pub const ICRNL: ::tcflag_t = 0x00000100;
+pub const IXON: ::tcflag_t = 0x00000200;
+pub const IXOFF: ::tcflag_t = 0x00000400;
+pub const IXANY: ::tcflag_t = 0x00000800;
+pub const IMAXBEL: ::tcflag_t = 0x00002000;
+pub const OPOST: ::tcflag_t = 0x1;
+pub const ONLCR: ::tcflag_t = 0x2;
+pub const OXTABS: ::tcflag_t = 0x4;
+pub const ONOEOT: ::tcflag_t = 0x8;
+pub const CIGNORE: ::tcflag_t = 0x00000001;
+pub const CSIZE: ::tcflag_t = 0x00000300;
+pub const CS5: ::tcflag_t = 0x00000000;
+pub const CS6: ::tcflag_t = 0x00000100;
+pub const CS7: ::tcflag_t = 0x00000200;
+pub const CS8: ::tcflag_t = 0x00000300;
+pub const CSTOPB: ::tcflag_t = 0x00000400;
+pub const CREAD: ::tcflag_t = 0x00000800;
+pub const PARENB: ::tcflag_t = 0x00001000;
+pub const PARODD: ::tcflag_t = 0x00002000;
+pub const HUPCL: ::tcflag_t = 0x00004000;
+pub const CLOCAL: ::tcflag_t = 0x00008000;
+pub const ECHOKE: ::tcflag_t = 0x00000001;
+pub const ECHOE: ::tcflag_t = 0x00000002;
+pub const ECHOK: ::tcflag_t = 0x00000004;
+pub const ECHO: ::tcflag_t = 0x00000008;
+pub const ECHONL: ::tcflag_t = 0x00000010;
+pub const ECHOPRT: ::tcflag_t = 0x00000020;
+pub const ECHOCTL: ::tcflag_t = 0x00000040;
+pub const ISIG: ::tcflag_t = 0x00000080;
+pub const ICANON: ::tcflag_t = 0x00000100;
+pub const ALTWERASE: ::tcflag_t = 0x00000200;
+pub const IEXTEN: ::tcflag_t = 0x00000400;
+pub const EXTPROC: ::tcflag_t = 0x00000800;
+pub const TOSTOP: ::tcflag_t = 0x00400000;
+pub const FLUSHO: ::tcflag_t = 0x00800000;
+pub const NOKERNINFO: ::tcflag_t = 0x02000000;
+pub const PENDIN: ::tcflag_t = 0x20000000;
+pub const NOFLSH: ::tcflag_t = 0x80000000;
+pub const MDMBUF: ::tcflag_t = 0x00100000;
+
+pub const WNOHANG: ::c_int = 0x00000001;
+pub const WUNTRACED: ::c_int = 0x00000002;
+
+pub const RTLD_LAZY: ::c_int = 0x1;
+pub const RTLD_NOW: ::c_int = 0x2;
+pub const RTLD_NEXT: *mut ::c_void = -1isize as *mut ::c_void;
+pub const RTLD_DEFAULT: *mut ::c_void = -2isize as *mut ::c_void;
+pub const RTLD_SELF: *mut ::c_void = -3isize as *mut ::c_void;
+
+pub const LOG_CRON: ::c_int = 9 << 3;
+pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
+pub const LOG_FTP: ::c_int = 11 << 3;
+pub const LOG_PERROR: ::c_int = 0x20;
+
+pub const TCP_NODELAY: ::c_int = 1;
+pub const TCP_MAXSEG: ::c_int = 2;
+
+pub const PIPE_BUF: usize = 512;
+
+// si_code values for SIGBUS signal
+pub const BUS_ADRALN: ::c_int = 1;
+pub const BUS_ADRERR: ::c_int = 2;
+pub const BUS_OBJERR: ::c_int = 3;
+
+// si_code values for SIGCHLD signal
+pub const CLD_EXITED: ::c_int = 1;
+pub const CLD_KILLED: ::c_int = 2;
+pub const CLD_DUMPED: ::c_int = 3;
+pub const CLD_TRAPPED: ::c_int = 4;
+pub const CLD_STOPPED: ::c_int = 5;
+pub const CLD_CONTINUED: ::c_int = 6;
+
+pub const POLLIN: ::c_short = 0x1;
+pub const POLLPRI: ::c_short = 0x2;
+pub const POLLOUT: ::c_short = 0x4;
+pub const POLLERR: ::c_short = 0x8;
+pub const POLLHUP: ::c_short = 0x10;
+pub const POLLNVAL: ::c_short = 0x20;
+pub const POLLRDNORM: ::c_short = 0x040;
+pub const POLLWRNORM: ::c_short = 0x004;
+pub const POLLRDBAND: ::c_short = 0x080;
+pub const POLLWRBAND: ::c_short = 0x100;
+
+pub const BIOCGBLEN: ::c_ulong = 0x40044266;
+pub const BIOCSBLEN: ::c_ulong = 0xc0044266;
+pub const BIOCFLUSH: ::c_uint = 0x20004268;
+pub const BIOCPROMISC: ::c_uint = 0x20004269;
+pub const BIOCGDLT: ::c_ulong = 0x4004426a;
+pub const BIOCGETIF: ::c_ulong = 0x4020426b;
+pub const BIOCSETIF: ::c_ulong = 0x8020426c;
+pub const BIOCGSTATS: ::c_ulong = 0x4008426f;
+pub const BIOCIMMEDIATE: ::c_ulong = 0x80044270;
+pub const BIOCVERSION: ::c_ulong = 0x40044271;
+pub const BIOCGHDRCMPLT: ::c_ulong = 0x40044274;
+pub const BIOCSHDRCMPLT: ::c_ulong = 0x80044275;
+pub const SIOCGIFADDR: ::c_ulong = 0xc0206921;
+
+pub const REG_BASIC: ::c_int = 0o0000;
+pub const REG_EXTENDED: ::c_int = 0o0001;
+pub const REG_ICASE: ::c_int = 0o0002;
+pub const REG_NOSUB: ::c_int = 0o0004;
+pub const REG_NEWLINE: ::c_int = 0o0010;
+pub const REG_NOSPEC: ::c_int = 0o0020;
+pub const REG_PEND: ::c_int = 0o0040;
+pub const REG_DUMP: ::c_int = 0o0200;
+
+pub const REG_NOMATCH: ::c_int = 1;
+pub const REG_BADPAT: ::c_int = 2;
+pub const REG_ECOLLATE: ::c_int = 3;
+pub const REG_ECTYPE: ::c_int = 4;
+pub const REG_EESCAPE: ::c_int = 5;
+pub const REG_ESUBREG: ::c_int = 6;
+pub const REG_EBRACK: ::c_int = 7;
+pub const REG_EPAREN: ::c_int = 8;
+pub const REG_EBRACE: ::c_int = 9;
+pub const REG_BADBR: ::c_int = 10;
+pub const REG_ERANGE: ::c_int = 11;
+pub const REG_ESPACE: ::c_int = 12;
+pub const REG_BADRPT: ::c_int = 13;
+pub const REG_EMPTY: ::c_int = 14;
+pub const REG_ASSERT: ::c_int = 15;
+pub const REG_INVARG: ::c_int = 16;
+pub const REG_ATOI: ::c_int = 255;
+pub const REG_ITOA: ::c_int = 0o0400;
+
+pub const REG_NOTBOL: ::c_int = 0o00001;
+pub const REG_NOTEOL: ::c_int = 0o00002;
+pub const REG_STARTEND: ::c_int = 0o00004;
+pub const REG_TRACE: ::c_int = 0o00400;
+pub const REG_LARGE: ::c_int = 0o01000;
+pub const REG_BACKR: ::c_int = 0o02000;
+
+pub const TIOCCBRK: ::c_uint = 0x2000747a;
+pub const TIOCSBRK: ::c_uint = 0x2000747b;
+
+pub const PRIO_PROCESS: ::c_int = 0;
+pub const PRIO_PGRP: ::c_int = 1;
+pub const PRIO_USER: ::c_int = 2;
+
+pub const ITIMER_REAL: ::c_int = 0;
+pub const ITIMER_VIRTUAL: ::c_int = 1;
+pub const ITIMER_PROF: ::c_int = 2;
+
+f! {
+    pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr {
+        if (*mhdr).msg_controllen as usize >= ::mem::size_of::<::cmsghdr>() {
+            (*mhdr).msg_control as *mut ::cmsghdr
+        } else {
+            0 as *mut ::cmsghdr
+        }
+    }
+
+    pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
+        let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        let fd = fd as usize;
+        (*set).fds_bits[fd / bits] &= !(1 << (fd % bits));
+        return
+    }
+
+    pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
+        let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        let fd = fd as usize;
+        return ((*set).fds_bits[fd / bits] & (1 << (fd % bits))) != 0
+    }
+
+    pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
+        let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        let fd = fd as usize;
+        (*set).fds_bits[fd / bits] |= 1 << (fd % bits);
+        return
+    }
+
+    pub fn FD_ZERO(set: *mut fd_set) -> () {
+        for slot in (*set).fds_bits.iter_mut() {
+            *slot = 0;
+        }
+    }
+}
+
+safe_f! {
+    pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int {
+        status & 0o177
+    }
+
+    pub {const} fn WIFEXITED(status: ::c_int) -> bool {
+        (status & 0o177) == 0
+    }
+
+    pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int {
+        status >> 8
+    }
+
+    pub {const} fn WCOREDUMP(status: ::c_int) -> bool {
+        (status & 0o200) != 0
+    }
+
+    pub {const} fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int {
+        (cmd << 8) | (type_ & 0x00ff)
+    }
+}
+
+extern "C" {
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "getrlimit$UNIX2003"
+    )]
+    pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "setrlimit$UNIX2003"
+    )]
+    pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
+
+    pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
+    pub fn abs(i: ::c_int) -> ::c_int;
+    pub fn labs(i: ::c_long) -> ::c_long;
+    #[cfg_attr(
+        all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)),
+        link_name = "rand@FBSD_1.0"
+    )]
+    pub fn rand() -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)),
+        link_name = "srand@FBSD_1.0"
+    )]
+    pub fn srand(seed: ::c_uint);
+
+    pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
+    pub fn freeifaddrs(ifa: *mut ::ifaddrs);
+    pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int;
+    pub fn setlogin(name: *const ::c_char) -> ::c_int;
+    pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
+    pub fn kqueue() -> ::c_int;
+    pub fn unmount(target: *const ::c_char, arg: ::c_int) -> ::c_int;
+    pub fn syscall(num: ::c_int, ...) -> ::c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__getpwent50")]
+    pub fn getpwent() -> *mut passwd;
+    pub fn setpwent();
+    pub fn endpwent();
+    pub fn endgrent();
+    pub fn getgrent() -> *mut ::group;
+
+    pub fn getprogname() -> *const ::c_char;
+    pub fn setprogname(name: *const ::c_char);
+    pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
+    pub fn if_nameindex() -> *mut if_nameindex;
+    pub fn if_freenameindex(ptr: *mut if_nameindex);
+
+    pub fn getpeereid(socket: ::c_int, euid: *mut ::uid_t, egid: *mut ::gid_t) -> ::c_int;
+
+    #[cfg_attr(
+        all(target_os = "macos", not(target_arch = "aarch64")),
+        link_name = "glob$INODE64"
+    )]
+    #[cfg_attr(target_os = "netbsd", link_name = "__glob30")]
+    #[cfg_attr(
+        all(target_os = "freebsd", any(freebsd11, freebsd10)),
+        link_name = "glob@FBSD_1.0"
+    )]
+    pub fn glob(
+        pattern: *const ::c_char,
+        flags: ::c_int,
+        errfunc: ::Option<extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut ::glob_t,
+    ) -> ::c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__globfree30")]
+    #[cfg_attr(
+        all(target_os = "freebsd", any(freebsd11, freebsd10)),
+        link_name = "globfree@FBSD_1.0"
+    )]
+    pub fn globfree(pglob: *mut ::glob_t);
+
+    pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+
+    pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
+
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86_64"),
+        link_name = "seekdir$INODE64"
+    )]
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "seekdir$INODE64$UNIX2003"
+    )]
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86_64"),
+        link_name = "telldir$INODE64"
+    )]
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "telldir$INODE64$UNIX2003"
+    )]
+    pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
+    pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "msync$UNIX2003"
+    )]
+    #[cfg_attr(target_os = "netbsd", link_name = "__msync13")]
+    pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "recvfrom$UNIX2003"
+    )]
+    pub fn recvfrom(
+        socket: ::c_int,
+        buf: *mut ::c_void,
+        len: ::size_t,
+        flags: ::c_int,
+        addr: *mut ::sockaddr,
+        addrlen: *mut ::socklen_t,
+    ) -> ::ssize_t;
+    pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__futimes50")]
+    pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "bind$UNIX2003"
+    )]
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
+
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "writev$UNIX2003"
+    )]
+    pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "readv$UNIX2003"
+    )]
+    pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "sendmsg$UNIX2003"
+    )]
+    pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "recvmsg$UNIX2003"
+    )]
+    pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
+
+    pub fn sync();
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "sigaltstack$UNIX2003"
+    )]
+    #[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")]
+    pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
+    pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
+    pub fn sem_close(sem: *mut sem_t) -> ::c_int;
+    pub fn getdtablesize() -> ::c_int;
+    pub fn getgrnam_r(
+        name: *const ::c_char,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "pthread_sigmask$UNIX2003"
+    )]
+    pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
+    pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
+    pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "pthread_cancel$UNIX2003"
+    )]
+    pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
+    pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
+    pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
+    pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
+    pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")]
+    pub fn getpwnam_r(
+        name: *const ::c_char,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")]
+    pub fn getpwuid_r(
+        uid: ::uid_t,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "sigwait$UNIX2003"
+    )]
+    pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
+    pub fn pthread_atfork(
+        prepare: ::Option<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "popen$UNIX2003"
+    )]
+    pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
+    pub fn faccessat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::c_int,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_create(
+        native: *mut ::pthread_t,
+        attr: *const ::pthread_attr_t,
+        f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
+        value: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn acct(filename: *const ::c_char) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "wait4$UNIX2003"
+    )]
+    #[cfg_attr(
+        all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)),
+        link_name = "wait4@FBSD_1.0"
+    )]
+    pub fn wait4(
+        pid: ::pid_t,
+        status: *mut ::c_int,
+        options: ::c_int,
+        rusage: *mut ::rusage,
+    ) -> ::pid_t;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "getitimer$UNIX2003"
+    )]
+    pub fn getitimer(which: ::c_int, curr_value: *mut ::itimerval) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "setitimer$UNIX2003"
+    )]
+    pub fn setitimer(
+        which: ::c_int,
+        new_value: *const ::itimerval,
+        old_value: *mut ::itimerval,
+    ) -> ::c_int;
+
+    pub fn regcomp(preg: *mut regex_t, pattern: *const ::c_char, cflags: ::c_int) -> ::c_int;
+
+    pub fn regexec(
+        preg: *const regex_t,
+        input: *const ::c_char,
+        nmatch: ::size_t,
+        pmatch: *mut regmatch_t,
+        eflags: ::c_int,
+    ) -> ::c_int;
+
+    pub fn regerror(
+        errcode: ::c_int,
+        preg: *const regex_t,
+        errbuf: *mut ::c_char,
+        errbuf_size: ::size_t,
+    ) -> ::size_t;
+
+    pub fn regfree(preg: *mut regex_t);
+
+    pub fn arc4random() -> u32;
+    pub fn arc4random_buf(buf: *mut ::c_void, size: ::size_t);
+    pub fn arc4random_uniform(l: u32) -> u32;
+
+    pub fn drand48() -> ::c_double;
+    pub fn erand48(xseed: *mut ::c_ushort) -> ::c_double;
+    pub fn lrand48() -> ::c_long;
+    pub fn nrand48(xseed: *mut ::c_ushort) -> ::c_long;
+    pub fn mrand48() -> ::c_long;
+    pub fn jrand48(xseed: *mut ::c_ushort) -> ::c_long;
+    pub fn srand48(seed: ::c_long);
+    pub fn seed48(xseed: *mut ::c_ushort) -> *mut ::c_ushort;
+    pub fn lcong48(p: *mut ::c_ushort);
+    pub fn getopt_long(
+        argc: ::c_int,
+        argv: *const *mut c_char,
+        optstring: *const c_char,
+        longopts: *const option,
+        longindex: *mut ::c_int,
+    ) -> ::c_int;
+
+    pub fn strftime(
+        buf: *mut ::c_char,
+        maxsize: ::size_t,
+        format: *const ::c_char,
+        timeptr: *const ::tm,
+    ) -> ::size_t;
+    pub fn strftime_l(
+        buf: *mut ::c_char,
+        maxsize: ::size_t,
+        format: *const ::c_char,
+        timeptr: *const ::tm,
+        locale: ::locale_t,
+    ) -> ::size_t;
+}
+
+cfg_if! {
+    if #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))] {
+        mod apple;
+        pub use self::apple::*;
+    } else if #[cfg(any(target_os = "openbsd", target_os = "netbsd"))] {
+        mod netbsdlike;
+        pub use self::netbsdlike::*;
+    } else if #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] {
+        mod freebsdlike;
+        pub use self::freebsdlike::*;
+    } else {
+        // Unknown target_os
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,863 @@
+pub type wchar_t = i32;
+pub type time_t = i64;
+pub type mode_t = u32;
+pub type nlink_t = u32;
+pub type ino_t = u64;
+pub type pthread_key_t = ::c_int;
+pub type rlim_t = u64;
+pub type speed_t = ::c_uint;
+pub type tcflag_t = ::c_uint;
+pub type nl_item = c_long;
+pub type clockid_t = ::c_int;
+pub type id_t = u32;
+pub type sem_t = *mut sem;
+pub type key_t = c_long;
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum timezone {}
+impl ::Copy for timezone {}
+impl ::Clone for timezone {
+    fn clone(&self) -> timezone {
+        *self
+    }
+}
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum sem {}
+impl ::Copy for sem {}
+impl ::Clone for sem {
+    fn clone(&self) -> sem {
+        *self
+    }
+}
+
+s! {
+    pub struct sched_param {
+        pub sched_priority: ::c_int,
+    }
+
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_size: ::size_t,
+        pub ss_flags: ::c_int,
+    }
+
+    pub struct in6_pktinfo {
+        pub ipi6_addr: ::in6_addr,
+        pub ipi6_ifindex: ::c_uint,
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_cc: [::cc_t; ::NCCS],
+        pub c_ispeed: ::c_int,
+        pub c_ospeed: ::c_int,
+    }
+
+    pub struct flock {
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+    }
+
+    pub struct ipc_perm {
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub mode: ::mode_t,
+        #[cfg(target_os = "openbsd")]
+        pub seq: ::c_ushort,
+        #[cfg(target_os = "netbsd")]
+        pub _seq: ::c_ushort,
+        #[cfg(target_os = "openbsd")]
+        pub key: ::key_t,
+        #[cfg(target_os = "netbsd")]
+        pub _key: ::key_t,
+    }
+
+    pub struct ptrace_io_desc {
+        pub piod_op: ::c_int,
+        pub piod_offs: *mut ::c_void,
+        pub piod_addr: *mut ::c_void,
+        pub piod_len: ::size_t,
+    }
+}
+
+pub const D_T_FMT: ::nl_item = 0;
+pub const D_FMT: ::nl_item = 1;
+pub const T_FMT: ::nl_item = 2;
+pub const T_FMT_AMPM: ::nl_item = 3;
+pub const AM_STR: ::nl_item = 4;
+pub const PM_STR: ::nl_item = 5;
+
+pub const DAY_1: ::nl_item = 6;
+pub const DAY_2: ::nl_item = 7;
+pub const DAY_3: ::nl_item = 8;
+pub const DAY_4: ::nl_item = 9;
+pub const DAY_5: ::nl_item = 10;
+pub const DAY_6: ::nl_item = 11;
+pub const DAY_7: ::nl_item = 12;
+
+pub const ABDAY_1: ::nl_item = 13;
+pub const ABDAY_2: ::nl_item = 14;
+pub const ABDAY_3: ::nl_item = 15;
+pub const ABDAY_4: ::nl_item = 16;
+pub const ABDAY_5: ::nl_item = 17;
+pub const ABDAY_6: ::nl_item = 18;
+pub const ABDAY_7: ::nl_item = 19;
+
+pub const MON_1: ::nl_item = 20;
+pub const MON_2: ::nl_item = 21;
+pub const MON_3: ::nl_item = 22;
+pub const MON_4: ::nl_item = 23;
+pub const MON_5: ::nl_item = 24;
+pub const MON_6: ::nl_item = 25;
+pub const MON_7: ::nl_item = 26;
+pub const MON_8: ::nl_item = 27;
+pub const MON_9: ::nl_item = 28;
+pub const MON_10: ::nl_item = 29;
+pub const MON_11: ::nl_item = 30;
+pub const MON_12: ::nl_item = 31;
+
+pub const ABMON_1: ::nl_item = 32;
+pub const ABMON_2: ::nl_item = 33;
+pub const ABMON_3: ::nl_item = 34;
+pub const ABMON_4: ::nl_item = 35;
+pub const ABMON_5: ::nl_item = 36;
+pub const ABMON_6: ::nl_item = 37;
+pub const ABMON_7: ::nl_item = 38;
+pub const ABMON_8: ::nl_item = 39;
+pub const ABMON_9: ::nl_item = 40;
+pub const ABMON_10: ::nl_item = 41;
+pub const ABMON_11: ::nl_item = 42;
+pub const ABMON_12: ::nl_item = 43;
+
+pub const RADIXCHAR: ::nl_item = 44;
+pub const THOUSEP: ::nl_item = 45;
+pub const YESSTR: ::nl_item = 46;
+pub const YESEXPR: ::nl_item = 47;
+pub const NOSTR: ::nl_item = 48;
+pub const NOEXPR: ::nl_item = 49;
+pub const CRNCYSTR: ::nl_item = 50;
+
+pub const CODESET: ::nl_item = 51;
+
+pub const EXIT_FAILURE: ::c_int = 1;
+pub const EXIT_SUCCESS: ::c_int = 0;
+pub const RAND_MAX: ::c_int = 2147483647;
+pub const EOF: ::c_int = -1;
+pub const SEEK_SET: ::c_int = 0;
+pub const SEEK_CUR: ::c_int = 1;
+pub const SEEK_END: ::c_int = 2;
+pub const _IOFBF: ::c_int = 0;
+pub const _IONBF: ::c_int = 2;
+pub const _IOLBF: ::c_int = 1;
+pub const BUFSIZ: ::c_uint = 1024;
+pub const FOPEN_MAX: ::c_uint = 20;
+pub const FILENAME_MAX: ::c_uint = 1024;
+pub const L_tmpnam: ::c_uint = 1024;
+pub const O_NOCTTY: ::c_int = 32768;
+pub const S_IFIFO: mode_t = 4096;
+pub const S_IFCHR: mode_t = 8192;
+pub const S_IFBLK: mode_t = 24576;
+pub const S_IFDIR: mode_t = 16384;
+pub const S_IFREG: mode_t = 32768;
+pub const S_IFLNK: mode_t = 40960;
+pub const S_IFSOCK: mode_t = 49152;
+pub const S_IFMT: mode_t = 61440;
+pub const S_IEXEC: mode_t = 64;
+pub const S_IWRITE: mode_t = 128;
+pub const S_IREAD: mode_t = 256;
+pub const S_IRWXU: mode_t = 448;
+pub const S_IXUSR: mode_t = 64;
+pub const S_IWUSR: mode_t = 128;
+pub const S_IRUSR: mode_t = 256;
+pub const S_IRWXG: mode_t = 56;
+pub const S_IXGRP: mode_t = 8;
+pub const S_IWGRP: mode_t = 16;
+pub const S_IRGRP: mode_t = 32;
+pub const S_IRWXO: mode_t = 7;
+pub const S_IXOTH: mode_t = 1;
+pub const S_IWOTH: mode_t = 2;
+pub const S_IROTH: mode_t = 4;
+pub const F_OK: ::c_int = 0;
+pub const R_OK: ::c_int = 4;
+pub const W_OK: ::c_int = 2;
+pub const X_OK: ::c_int = 1;
+pub const STDIN_FILENO: ::c_int = 0;
+pub const STDOUT_FILENO: ::c_int = 1;
+pub const STDERR_FILENO: ::c_int = 2;
+pub const F_LOCK: ::c_int = 1;
+pub const F_TEST: ::c_int = 3;
+pub const F_TLOCK: ::c_int = 2;
+pub const F_ULOCK: ::c_int = 0;
+pub const F_GETLK: ::c_int = 7;
+pub const F_SETLK: ::c_int = 8;
+pub const F_SETLKW: ::c_int = 9;
+pub const SIGHUP: ::c_int = 1;
+pub const SIGINT: ::c_int = 2;
+pub const SIGQUIT: ::c_int = 3;
+pub const SIGILL: ::c_int = 4;
+pub const SIGABRT: ::c_int = 6;
+pub const SIGEMT: ::c_int = 7;
+pub const SIGFPE: ::c_int = 8;
+pub const SIGKILL: ::c_int = 9;
+pub const SIGSEGV: ::c_int = 11;
+pub const SIGPIPE: ::c_int = 13;
+pub const SIGALRM: ::c_int = 14;
+pub const SIGTERM: ::c_int = 15;
+
+pub const PROT_NONE: ::c_int = 0;
+pub const PROT_READ: ::c_int = 1;
+pub const PROT_WRITE: ::c_int = 2;
+pub const PROT_EXEC: ::c_int = 4;
+
+pub const MAP_FILE: ::c_int = 0x0000;
+pub const MAP_SHARED: ::c_int = 0x0001;
+pub const MAP_PRIVATE: ::c_int = 0x0002;
+pub const MAP_FIXED: ::c_int = 0x0010;
+pub const MAP_ANON: ::c_int = 0x1000;
+pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
+
+pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
+
+pub const IPC_CREAT: ::c_int = 0o001000;
+pub const IPC_EXCL: ::c_int = 0o002000;
+pub const IPC_NOWAIT: ::c_int = 0o004000;
+
+pub const IPC_PRIVATE: ::key_t = 0;
+
+pub const IPC_RMID: ::c_int = 0;
+pub const IPC_SET: ::c_int = 1;
+pub const IPC_STAT: ::c_int = 2;
+
+pub const IPC_R: ::c_int = 0o000400;
+pub const IPC_W: ::c_int = 0o000200;
+pub const IPC_M: ::c_int = 0o010000;
+
+pub const SHM_R: ::c_int = IPC_R;
+pub const SHM_W: ::c_int = IPC_W;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+
+pub const MS_ASYNC: ::c_int = 0x0001;
+
+pub const EPERM: ::c_int = 1;
+pub const ENOENT: ::c_int = 2;
+pub const ESRCH: ::c_int = 3;
+pub const EINTR: ::c_int = 4;
+pub const EIO: ::c_int = 5;
+pub const ENXIO: ::c_int = 6;
+pub const E2BIG: ::c_int = 7;
+pub const ENOEXEC: ::c_int = 8;
+pub const EBADF: ::c_int = 9;
+pub const ECHILD: ::c_int = 10;
+pub const EDEADLK: ::c_int = 11;
+pub const ENOMEM: ::c_int = 12;
+pub const EACCES: ::c_int = 13;
+pub const EFAULT: ::c_int = 14;
+pub const ENOTBLK: ::c_int = 15;
+pub const EBUSY: ::c_int = 16;
+pub const EEXIST: ::c_int = 17;
+pub const EXDEV: ::c_int = 18;
+pub const ENODEV: ::c_int = 19;
+pub const ENOTDIR: ::c_int = 20;
+pub const EISDIR: ::c_int = 21;
+pub const EINVAL: ::c_int = 22;
+pub const ENFILE: ::c_int = 23;
+pub const EMFILE: ::c_int = 24;
+pub const ENOTTY: ::c_int = 25;
+pub const ETXTBSY: ::c_int = 26;
+pub const EFBIG: ::c_int = 27;
+pub const ENOSPC: ::c_int = 28;
+pub const ESPIPE: ::c_int = 29;
+pub const EROFS: ::c_int = 30;
+pub const EMLINK: ::c_int = 31;
+pub const EPIPE: ::c_int = 32;
+pub const EDOM: ::c_int = 33;
+pub const ERANGE: ::c_int = 34;
+pub const EAGAIN: ::c_int = 35;
+pub const EWOULDBLOCK: ::c_int = 35;
+pub const EINPROGRESS: ::c_int = 36;
+pub const EALREADY: ::c_int = 37;
+pub const ENOTSOCK: ::c_int = 38;
+pub const EDESTADDRREQ: ::c_int = 39;
+pub const EMSGSIZE: ::c_int = 40;
+pub const EPROTOTYPE: ::c_int = 41;
+pub const ENOPROTOOPT: ::c_int = 42;
+pub const EPROTONOSUPPORT: ::c_int = 43;
+pub const ESOCKTNOSUPPORT: ::c_int = 44;
+pub const EOPNOTSUPP: ::c_int = 45;
+pub const EPFNOSUPPORT: ::c_int = 46;
+pub const EAFNOSUPPORT: ::c_int = 47;
+pub const EADDRINUSE: ::c_int = 48;
+pub const EADDRNOTAVAIL: ::c_int = 49;
+pub const ENETDOWN: ::c_int = 50;
+pub const ENETUNREACH: ::c_int = 51;
+pub const ENETRESET: ::c_int = 52;
+pub const ECONNABORTED: ::c_int = 53;
+pub const ECONNRESET: ::c_int = 54;
+pub const ENOBUFS: ::c_int = 55;
+pub const EISCONN: ::c_int = 56;
+pub const ENOTCONN: ::c_int = 57;
+pub const ESHUTDOWN: ::c_int = 58;
+pub const ETOOMANYREFS: ::c_int = 59;
+pub const ETIMEDOUT: ::c_int = 60;
+pub const ECONNREFUSED: ::c_int = 61;
+pub const ELOOP: ::c_int = 62;
+pub const ENAMETOOLONG: ::c_int = 63;
+pub const EHOSTDOWN: ::c_int = 64;
+pub const EHOSTUNREACH: ::c_int = 65;
+pub const ENOTEMPTY: ::c_int = 66;
+pub const EPROCLIM: ::c_int = 67;
+pub const EUSERS: ::c_int = 68;
+pub const EDQUOT: ::c_int = 69;
+pub const ESTALE: ::c_int = 70;
+pub const EREMOTE: ::c_int = 71;
+pub const EBADRPC: ::c_int = 72;
+pub const ERPCMISMATCH: ::c_int = 73;
+pub const EPROGUNAVAIL: ::c_int = 74;
+pub const EPROGMISMATCH: ::c_int = 75;
+pub const EPROCUNAVAIL: ::c_int = 76;
+pub const ENOLCK: ::c_int = 77;
+pub const ENOSYS: ::c_int = 78;
+pub const EFTYPE: ::c_int = 79;
+pub const EAUTH: ::c_int = 80;
+pub const ENEEDAUTH: ::c_int = 81;
+
+pub const F_DUPFD: ::c_int = 0;
+pub const F_GETFD: ::c_int = 1;
+pub const F_SETFD: ::c_int = 2;
+pub const F_GETFL: ::c_int = 3;
+pub const F_SETFL: ::c_int = 4;
+
+pub const SIGTRAP: ::c_int = 5;
+
+pub const GLOB_APPEND: ::c_int = 0x0001;
+pub const GLOB_DOOFFS: ::c_int = 0x0002;
+pub const GLOB_ERR: ::c_int = 0x0004;
+pub const GLOB_MARK: ::c_int = 0x0008;
+pub const GLOB_NOCHECK: ::c_int = 0x0010;
+pub const GLOB_NOSORT: ::c_int = 0x0020;
+pub const GLOB_NOESCAPE: ::c_int = 0x1000;
+
+pub const GLOB_NOSPACE: ::c_int = -1;
+pub const GLOB_ABORTED: ::c_int = -2;
+pub const GLOB_NOMATCH: ::c_int = -3;
+pub const GLOB_NOSYS: ::c_int = -4;
+
+pub const POSIX_MADV_NORMAL: ::c_int = 0;
+pub const POSIX_MADV_RANDOM: ::c_int = 1;
+pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
+pub const POSIX_MADV_WILLNEED: ::c_int = 3;
+pub const POSIX_MADV_DONTNEED: ::c_int = 4;
+
+pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
+pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02;
+pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x04;
+pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x08;
+pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10;
+pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20;
+
+pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
+pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
+
+pub const PIOD_READ_D: ::c_int = 1;
+pub const PIOD_WRITE_D: ::c_int = 2;
+pub const PIOD_READ_I: ::c_int = 3;
+pub const PIOD_WRITE_I: ::c_int = 4;
+pub const PIOD_READ_AUXV: ::c_int = 5;
+
+pub const PT_TRACE_ME: ::c_int = 0;
+pub const PT_READ_I: ::c_int = 1;
+pub const PT_READ_D: ::c_int = 2;
+pub const PT_WRITE_I: ::c_int = 4;
+pub const PT_WRITE_D: ::c_int = 5;
+pub const PT_CONTINUE: ::c_int = 7;
+pub const PT_KILL: ::c_int = 8;
+pub const PT_ATTACH: ::c_int = 9;
+pub const PT_DETACH: ::c_int = 10;
+pub const PT_IO: ::c_int = 11;
+
+// http://man.openbsd.org/OpenBSD-current/man2/clock_getres.2
+// The man page says clock_gettime(3) can accept various values as clockid_t but
+// http://fxr.watson.org/fxr/source/kern/kern_time.c?v=OPENBSD;im=excerpts#L161
+// the implementation rejects anything other than the below two
+//
+// http://netbsd.gw.com/cgi-bin/man-cgi?clock_gettime
+// https://github.com/jsonn/src/blob/HEAD/sys/kern/subr_time.c#L222
+// Basically the same goes for NetBSD
+pub const CLOCK_REALTIME: ::clockid_t = 0;
+pub const CLOCK_MONOTONIC: ::clockid_t = 3;
+
+pub const RLIMIT_CPU: ::c_int = 0;
+pub const RLIMIT_FSIZE: ::c_int = 1;
+pub const RLIMIT_DATA: ::c_int = 2;
+pub const RLIMIT_STACK: ::c_int = 3;
+pub const RLIMIT_CORE: ::c_int = 4;
+pub const RLIMIT_RSS: ::c_int = 5;
+pub const RLIMIT_MEMLOCK: ::c_int = 6;
+pub const RLIMIT_NPROC: ::c_int = 7;
+pub const RLIMIT_NOFILE: ::c_int = 8;
+
+pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff;
+pub const RLIM_SAVED_MAX: rlim_t = RLIM_INFINITY;
+pub const RLIM_SAVED_CUR: rlim_t = RLIM_INFINITY;
+
+pub const RUSAGE_SELF: ::c_int = 0;
+pub const RUSAGE_CHILDREN: ::c_int = -1;
+
+pub const MADV_NORMAL: ::c_int = 0;
+pub const MADV_RANDOM: ::c_int = 1;
+pub const MADV_SEQUENTIAL: ::c_int = 2;
+pub const MADV_WILLNEED: ::c_int = 3;
+pub const MADV_DONTNEED: ::c_int = 4;
+pub const MADV_FREE: ::c_int = 6;
+
+// sys/fstypes.h in NetBSD, or sys/mount.h in OpenBSD
+pub const MNT_NODEV: ::c_int = 0x00000010;
+pub const MNT_LOCAL: ::c_int = 0x00001000;
+pub const MNT_QUOTA: ::c_int = 0x00002000;
+
+pub const AF_UNSPEC: ::c_int = 0;
+pub const AF_LOCAL: ::c_int = 1;
+pub const AF_UNIX: ::c_int = AF_LOCAL;
+pub const AF_INET: ::c_int = 2;
+pub const AF_IMPLINK: ::c_int = 3;
+pub const AF_PUP: ::c_int = 4;
+pub const AF_CHAOS: ::c_int = 5;
+pub const AF_NS: ::c_int = 6;
+pub const AF_ISO: ::c_int = 7;
+pub const AF_OSI: ::c_int = AF_ISO;
+pub const AF_DATAKIT: ::c_int = 9;
+pub const AF_CCITT: ::c_int = 10;
+pub const AF_SNA: ::c_int = 11;
+pub const AF_DECnet: ::c_int = 12;
+pub const AF_DLI: ::c_int = 13;
+pub const AF_LAT: ::c_int = 14;
+pub const AF_HYLINK: ::c_int = 15;
+pub const AF_APPLETALK: ::c_int = 16;
+pub const AF_LINK: ::c_int = 18;
+pub const pseudo_AF_XTP: ::c_int = 19;
+pub const AF_COIP: ::c_int = 20;
+pub const AF_CNT: ::c_int = 21;
+pub const pseudo_AF_RTIP: ::c_int = 22;
+pub const AF_IPX: ::c_int = 23;
+pub const AF_INET6: ::c_int = 24;
+pub const pseudo_AF_PIP: ::c_int = 25;
+pub const AF_ISDN: ::c_int = 26;
+pub const AF_E164: ::c_int = AF_ISDN;
+pub const AF_NATM: ::c_int = 27;
+
+pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
+pub const PF_LOCAL: ::c_int = AF_LOCAL;
+pub const PF_UNIX: ::c_int = PF_LOCAL;
+pub const PF_INET: ::c_int = AF_INET;
+pub const PF_IMPLINK: ::c_int = AF_IMPLINK;
+pub const PF_PUP: ::c_int = AF_PUP;
+pub const PF_CHAOS: ::c_int = AF_CHAOS;
+pub const PF_NS: ::c_int = AF_NS;
+pub const PF_ISO: ::c_int = AF_ISO;
+pub const PF_OSI: ::c_int = AF_ISO;
+pub const PF_DATAKIT: ::c_int = AF_DATAKIT;
+pub const PF_CCITT: ::c_int = AF_CCITT;
+pub const PF_SNA: ::c_int = AF_SNA;
+pub const PF_DECnet: ::c_int = AF_DECnet;
+pub const PF_DLI: ::c_int = AF_DLI;
+pub const PF_LAT: ::c_int = AF_LAT;
+pub const PF_HYLINK: ::c_int = AF_HYLINK;
+pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
+pub const PF_LINK: ::c_int = AF_LINK;
+pub const PF_XTP: ::c_int = pseudo_AF_XTP;
+pub const PF_COIP: ::c_int = AF_COIP;
+pub const PF_CNT: ::c_int = AF_CNT;
+pub const PF_IPX: ::c_int = AF_IPX;
+pub const PF_INET6: ::c_int = AF_INET6;
+pub const PF_RTIP: ::c_int = pseudo_AF_RTIP;
+pub const PF_PIP: ::c_int = pseudo_AF_PIP;
+pub const PF_ISDN: ::c_int = AF_ISDN;
+pub const PF_NATM: ::c_int = AF_NATM;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+pub const SOCK_RAW: ::c_int = 3;
+pub const SOCK_RDM: ::c_int = 4;
+pub const SOCK_SEQPACKET: ::c_int = 5;
+pub const IP_TTL: ::c_int = 4;
+pub const IP_HDRINCL: ::c_int = 2;
+pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
+pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
+pub const IPV6_RECVPKTINFO: ::c_int = 36;
+pub const IPV6_PKTINFO: ::c_int = 46;
+pub const IPV6_RECVTCLASS: ::c_int = 57;
+pub const IPV6_TCLASS: ::c_int = 61;
+
+pub const SOL_SOCKET: ::c_int = 0xffff;
+pub const SO_DEBUG: ::c_int = 0x01;
+pub const SO_ACCEPTCONN: ::c_int = 0x0002;
+pub const SO_REUSEADDR: ::c_int = 0x0004;
+pub const SO_KEEPALIVE: ::c_int = 0x0008;
+pub const SO_DONTROUTE: ::c_int = 0x0010;
+pub const SO_BROADCAST: ::c_int = 0x0020;
+pub const SO_USELOOPBACK: ::c_int = 0x0040;
+pub const SO_LINGER: ::c_int = 0x0080;
+pub const SO_OOBINLINE: ::c_int = 0x0100;
+pub const SO_REUSEPORT: ::c_int = 0x0200;
+pub const SO_SNDBUF: ::c_int = 0x1001;
+pub const SO_RCVBUF: ::c_int = 0x1002;
+pub const SO_SNDLOWAT: ::c_int = 0x1003;
+pub const SO_RCVLOWAT: ::c_int = 0x1004;
+pub const SO_ERROR: ::c_int = 0x1007;
+pub const SO_TYPE: ::c_int = 0x1008;
+
+pub const SOMAXCONN: ::c_int = 128;
+
+pub const MSG_OOB: ::c_int = 0x1;
+pub const MSG_PEEK: ::c_int = 0x2;
+pub const MSG_DONTROUTE: ::c_int = 0x4;
+pub const MSG_EOR: ::c_int = 0x8;
+pub const MSG_TRUNC: ::c_int = 0x10;
+pub const MSG_CTRUNC: ::c_int = 0x20;
+pub const MSG_WAITALL: ::c_int = 0x40;
+pub const MSG_DONTWAIT: ::c_int = 0x80;
+pub const MSG_BCAST: ::c_int = 0x100;
+pub const MSG_MCAST: ::c_int = 0x200;
+pub const MSG_NOSIGNAL: ::c_int = 0x400;
+pub const MSG_CMSG_CLOEXEC: ::c_int = 0x800;
+
+pub const SHUT_RD: ::c_int = 0;
+pub const SHUT_WR: ::c_int = 1;
+pub const SHUT_RDWR: ::c_int = 2;
+
+pub const LOCK_SH: ::c_int = 1;
+pub const LOCK_EX: ::c_int = 2;
+pub const LOCK_NB: ::c_int = 4;
+pub const LOCK_UN: ::c_int = 8;
+
+pub const IPPROTO_RAW: ::c_int = 255;
+
+pub const _SC_ARG_MAX: ::c_int = 1;
+pub const _SC_CHILD_MAX: ::c_int = 2;
+pub const _SC_NGROUPS_MAX: ::c_int = 4;
+pub const _SC_OPEN_MAX: ::c_int = 5;
+pub const _SC_JOB_CONTROL: ::c_int = 6;
+pub const _SC_SAVED_IDS: ::c_int = 7;
+pub const _SC_VERSION: ::c_int = 8;
+pub const _SC_BC_BASE_MAX: ::c_int = 9;
+pub const _SC_BC_DIM_MAX: ::c_int = 10;
+pub const _SC_BC_SCALE_MAX: ::c_int = 11;
+pub const _SC_BC_STRING_MAX: ::c_int = 12;
+pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13;
+pub const _SC_EXPR_NEST_MAX: ::c_int = 14;
+pub const _SC_LINE_MAX: ::c_int = 15;
+pub const _SC_RE_DUP_MAX: ::c_int = 16;
+pub const _SC_2_VERSION: ::c_int = 17;
+pub const _SC_2_C_BIND: ::c_int = 18;
+pub const _SC_2_C_DEV: ::c_int = 19;
+pub const _SC_2_CHAR_TERM: ::c_int = 20;
+pub const _SC_2_FORT_DEV: ::c_int = 21;
+pub const _SC_2_FORT_RUN: ::c_int = 22;
+pub const _SC_2_LOCALEDEF: ::c_int = 23;
+pub const _SC_2_SW_DEV: ::c_int = 24;
+pub const _SC_2_UPE: ::c_int = 25;
+pub const _SC_STREAM_MAX: ::c_int = 26;
+pub const _SC_TZNAME_MAX: ::c_int = 27;
+pub const _SC_PAGESIZE: ::c_int = 28;
+pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
+pub const _SC_FSYNC: ::c_int = 29;
+pub const _SC_XOPEN_SHM: ::c_int = 30;
+
+pub const Q_GETQUOTA: ::c_int = 0x300;
+pub const Q_SETQUOTA: ::c_int = 0x400;
+
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+
+pub const LOG_NFACILITIES: ::c_int = 24;
+
+pub const HW_NCPU: ::c_int = 3;
+
+pub const B0: speed_t = 0;
+pub const B50: speed_t = 50;
+pub const B75: speed_t = 75;
+pub const B110: speed_t = 110;
+pub const B134: speed_t = 134;
+pub const B150: speed_t = 150;
+pub const B200: speed_t = 200;
+pub const B300: speed_t = 300;
+pub const B600: speed_t = 600;
+pub const B1200: speed_t = 1200;
+pub const B1800: speed_t = 1800;
+pub const B2400: speed_t = 2400;
+pub const B4800: speed_t = 4800;
+pub const B9600: speed_t = 9600;
+pub const B19200: speed_t = 19200;
+pub const B38400: speed_t = 38400;
+pub const B7200: speed_t = 7200;
+pub const B14400: speed_t = 14400;
+pub const B28800: speed_t = 28800;
+pub const B57600: speed_t = 57600;
+pub const B76800: speed_t = 76800;
+pub const B115200: speed_t = 115200;
+pub const B230400: speed_t = 230400;
+pub const EXTA: speed_t = 19200;
+pub const EXTB: speed_t = 38400;
+
+pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
+
+pub const CRTSCTS: ::tcflag_t = 0x00010000;
+pub const CRTS_IFLOW: ::tcflag_t = CRTSCTS;
+pub const CCTS_OFLOW: ::tcflag_t = CRTSCTS;
+pub const OCRNL: ::tcflag_t = 0x10;
+
+pub const TIOCEXCL: ::c_ulong = 0x2000740d;
+pub const TIOCNXCL: ::c_ulong = 0x2000740e;
+pub const TIOCFLUSH: ::c_ulong = 0x80047410;
+pub const TIOCGETA: ::c_ulong = 0x402c7413;
+pub const TIOCSETA: ::c_ulong = 0x802c7414;
+pub const TIOCSETAW: ::c_ulong = 0x802c7415;
+pub const TIOCSETAF: ::c_ulong = 0x802c7416;
+pub const TIOCGETD: ::c_ulong = 0x4004741a;
+pub const TIOCSETD: ::c_ulong = 0x8004741b;
+pub const TIOCMGET: ::c_ulong = 0x4004746a;
+pub const TIOCMBIC: ::c_ulong = 0x8004746b;
+pub const TIOCMBIS: ::c_ulong = 0x8004746c;
+pub const TIOCMSET: ::c_ulong = 0x8004746d;
+pub const TIOCSTART: ::c_ulong = 0x2000746e;
+pub const TIOCSTOP: ::c_ulong = 0x2000746f;
+pub const TIOCSCTTY: ::c_ulong = 0x20007461;
+pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
+pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
+pub const TIOCM_LE: ::c_int = 0o0001;
+pub const TIOCM_DTR: ::c_int = 0o0002;
+pub const TIOCM_RTS: ::c_int = 0o0004;
+pub const TIOCM_ST: ::c_int = 0o0010;
+pub const TIOCM_SR: ::c_int = 0o0020;
+pub const TIOCM_CTS: ::c_int = 0o0040;
+pub const TIOCM_CAR: ::c_int = 0o0100;
+pub const TIOCM_RNG: ::c_int = 0o0200;
+pub const TIOCM_DSR: ::c_int = 0o0400;
+pub const TIOCM_CD: ::c_int = TIOCM_CAR;
+pub const TIOCM_RI: ::c_int = TIOCM_RNG;
+
+pub const TIMER_ABSTIME: ::c_int = 1;
+
+// sys/reboot.h
+
+pub const RB_AUTOBOOT: ::c_int = 0;
+
+pub const TCP_INFO: ::c_int = 9;
+
+#[link(name = "util")]
+extern "C" {
+    pub fn setgrent();
+    pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
+    pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
+
+    pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
+    pub fn accept4(
+        s: ::c_int,
+        addr: *mut ::sockaddr,
+        addrlen: *mut ::socklen_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn mincore(addr: *mut ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__clock_getres50")]
+    pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__clock_gettime50")]
+    pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__clock_settime50")]
+    pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+    pub fn __errno() -> *mut ::c_int;
+    pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int;
+    pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
+    pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
+    pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
+        -> ::ssize_t;
+    pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
+    pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
+    pub fn utimensat(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::timespec,
+        flag: ::c_int,
+    ) -> ::c_int;
+    pub fn fdatasync(fd: ::c_int) -> ::c_int;
+    pub fn login_tty(fd: ::c_int) -> ::c_int;
+    pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
+
+    pub fn mknodat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::mode_t,
+        dev: dev_t,
+    ) -> ::c_int;
+    pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
+    pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
+    pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
+    pub fn pthread_condattr_setclock(
+        attr: *mut pthread_condattr_t,
+        clock_id: ::clockid_t,
+    ) -> ::c_int;
+    pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
+    pub fn pthread_mutex_timedlock(
+        lock: *mut pthread_mutex_t,
+        abstime: *const ::timespec,
+    ) -> ::c_int;
+    pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
+    pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_setschedparam(
+        native: ::pthread_t,
+        policy: ::c_int,
+        param: *const sched_param,
+    ) -> ::c_int;
+    pub fn pthread_getschedparam(
+        native: ::pthread_t,
+        policy: *mut ::c_int,
+        param: *mut sched_param,
+    ) -> ::c_int;
+    pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
+
+    pub fn getgrouplist(
+        name: *const ::c_char,
+        basegid: ::gid_t,
+        groups: *mut ::gid_t,
+        ngroups: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
+    pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
+    pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int;
+    pub fn uname(buf: *mut ::utsname) -> ::c_int;
+
+    pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
+    pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
+    pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
+    pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
+    pub fn execvpe(
+        file: *const ::c_char,
+        argv: *const *const ::c_char,
+        envp: *const *const ::c_char,
+    ) -> ::c_int;
+    pub fn waitid(
+        idtype: idtype_t,
+        id: ::id_t,
+        infop: *mut ::siginfo_t,
+        options: ::c_int,
+    ) -> ::c_int;
+
+    pub fn posix_spawn(
+        pid: *mut ::pid_t,
+        path: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawnp(
+        pid: *mut ::pid_t,
+        file: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
+    pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
+    pub fn posix_spawnattr_getsigdefault(
+        attr: *const posix_spawnattr_t,
+        default: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigdefault(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getsigmask(
+        attr: *const posix_spawnattr_t,
+        default: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigmask(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getflags(
+        attr: *const posix_spawnattr_t,
+        flags: *mut ::c_short,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int;
+    pub fn posix_spawnattr_getpgroup(
+        attr: *const posix_spawnattr_t,
+        flags: *mut ::pid_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
+    pub fn posix_spawnattr_getschedpolicy(
+        attr: *const posix_spawnattr_t,
+        flags: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int;
+    pub fn posix_spawnattr_getschedparam(
+        attr: *const posix_spawnattr_t,
+        param: *mut ::sched_param,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setschedparam(
+        attr: *mut posix_spawnattr_t,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+
+    pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+    pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+    pub fn posix_spawn_file_actions_addopen(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+        path: *const ::c_char,
+        oflag: ::c_int,
+        mode: ::mode_t,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_addclose(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_adddup2(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+        newfd: ::c_int,
+    ) -> ::c_int;
+}
+
+extern "C" {
+    pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
+    pub fn gethostid() -> ::c_long;
+    pub fn sethostid(hostid: ::c_long) -> ::c_int;
+    pub fn ftok(path: *const ::c_char, id: ::c_int) -> ::key_t;
+
+    pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+    pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
+    pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(target_os = "netbsd")] {
+        mod netbsd;
+        pub use self::netbsd::*;
+    } else if #[cfg(target_os = "openbsd")] {
+        mod openbsd;
+        pub use self::openbsd::*;
+    } else {
+        // Unknown target_os
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/aarch64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/aarch64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/aarch64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/aarch64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,162 @@
+use PT_FIRSTMACH;
+
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = u8;
+pub type greg_t = u64;
+pub type __cpu_simple_lock_nv_t = ::c_uchar;
+
+s! {
+    pub struct __fregset {
+        #[cfg(libc_union)]
+        pub __qregs: [__c_anonymous__freg; 32],
+        pub __fpcr: u32,
+        pub __fpsr: u32,
+    }
+
+    pub struct mcontext_t {
+        pub __gregs: [::greg_t; 32],
+        pub __fregs: __fregset,
+        __spare: [::greg_t; 8],
+    }
+
+    pub struct ucontext_t {
+        pub uc_flags: ::c_uint,
+        pub uc_link: *mut ucontext_t,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_stack: ::stack_t,
+        pub uc_mcontext: mcontext_t,
+    }
+}
+
+s_no_extra_traits! {
+    #[cfg(libc_union)]
+    #[repr(align(16))]
+    pub union __c_anonymous__freg {
+        pub __b8: [u8; 16],
+        pub __h16: [u16; 8],
+        pub __s32: [u32; 4],
+        pub __d64: [u64; 2],
+        pub __q128: [u128; 1],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        #[cfg(libc_union)]
+        impl PartialEq for __c_anonymous__freg {
+            fn eq(&self, other: &__c_anonymous__freg) -> bool {
+                unsafe {
+                self.__b8 == other.__b8
+                    || self.__h16 == other.__h16
+                    || self.__s32 == other.__s32
+                    || self.__d64 == other.__d64
+                    || self.__q128 == other.__q128
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous__freg {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous__freg {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                f.debug_struct("__c_anonymous__freg")
+                    .field("__b8", &self.__b8)
+                    .field("__h16", &self.__h16)
+                    .field("__s32", &self.__s32)
+                    .field("__d64", &self.__d64)
+                    .field("__q128", &self.__q128)
+                    .finish()
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous__freg {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                self.__b8.hash(state);
+                self.__h16.hash(state);
+                self.__s32.hash(state);
+                self.__d64.hash(state);
+                self.__q128.hash(state);
+                }
+            }
+        }
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 4 - 1;
+    }
+}
+
+pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 0;
+pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 1;
+pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 2;
+pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 3;
+
+pub const _REG_R0: ::c_int = 0;
+pub const _REG_R1: ::c_int = 1;
+pub const _REG_R2: ::c_int = 2;
+pub const _REG_R3: ::c_int = 3;
+pub const _REG_R4: ::c_int = 4;
+pub const _REG_R5: ::c_int = 5;
+pub const _REG_R6: ::c_int = 6;
+pub const _REG_R7: ::c_int = 7;
+pub const _REG_R8: ::c_int = 8;
+pub const _REG_R9: ::c_int = 9;
+pub const _REG_R10: ::c_int = 10;
+pub const _REG_R11: ::c_int = 11;
+pub const _REG_R12: ::c_int = 12;
+pub const _REG_R13: ::c_int = 13;
+pub const _REG_R14: ::c_int = 14;
+pub const _REG_R15: ::c_int = 15;
+pub const _REG_CPSR: ::c_int = 16;
+pub const _REG_X0: ::c_int = 0;
+pub const _REG_X1: ::c_int = 1;
+pub const _REG_X2: ::c_int = 2;
+pub const _REG_X3: ::c_int = 3;
+pub const _REG_X4: ::c_int = 4;
+pub const _REG_X5: ::c_int = 5;
+pub const _REG_X6: ::c_int = 6;
+pub const _REG_X7: ::c_int = 7;
+pub const _REG_X8: ::c_int = 8;
+pub const _REG_X9: ::c_int = 9;
+pub const _REG_X10: ::c_int = 10;
+pub const _REG_X11: ::c_int = 11;
+pub const _REG_X12: ::c_int = 12;
+pub const _REG_X13: ::c_int = 13;
+pub const _REG_X14: ::c_int = 14;
+pub const _REG_X15: ::c_int = 15;
+pub const _REG_X16: ::c_int = 16;
+pub const _REG_X17: ::c_int = 17;
+pub const _REG_X18: ::c_int = 18;
+pub const _REG_X19: ::c_int = 19;
+pub const _REG_X20: ::c_int = 20;
+pub const _REG_X21: ::c_int = 21;
+pub const _REG_X22: ::c_int = 22;
+pub const _REG_X23: ::c_int = 23;
+pub const _REG_X24: ::c_int = 24;
+pub const _REG_X25: ::c_int = 25;
+pub const _REG_X26: ::c_int = 26;
+pub const _REG_X27: ::c_int = 27;
+pub const _REG_X28: ::c_int = 28;
+pub const _REG_X29: ::c_int = 29;
+pub const _REG_X30: ::c_int = 30;
+pub const _REG_X31: ::c_int = 31;
+pub const _REG_ELR: ::c_int = 32;
+pub const _REG_SPSR: ::c_int = 33;
+pub const _REG_TIPDR: ::c_int = 34;
+
+pub const _REG_RV: ::c_int = _REG_X0;
+pub const _REG_FP: ::c_int = _REG_X29;
+pub const _REG_LR: ::c_int = _REG_X30;
+pub const _REG_SP: ::c_int = _REG_X31;
+pub const _REG_PC: ::c_int = _REG_ELR;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/arm.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/arm.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/arm.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/arm.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,81 @@
+use PT_FIRSTMACH;
+
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type c_char = u8;
+pub type __cpu_simple_lock_nv_t = ::c_int;
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
+pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
+pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
+pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;
+
+pub const _REG_R0: ::c_int = 0;
+pub const _REG_R1: ::c_int = 1;
+pub const _REG_R2: ::c_int = 2;
+pub const _REG_R3: ::c_int = 3;
+pub const _REG_R4: ::c_int = 4;
+pub const _REG_R5: ::c_int = 5;
+pub const _REG_R6: ::c_int = 6;
+pub const _REG_R7: ::c_int = 7;
+pub const _REG_R8: ::c_int = 8;
+pub const _REG_R9: ::c_int = 9;
+pub const _REG_R10: ::c_int = 10;
+pub const _REG_R11: ::c_int = 11;
+pub const _REG_R12: ::c_int = 12;
+pub const _REG_R13: ::c_int = 13;
+pub const _REG_R14: ::c_int = 14;
+pub const _REG_R15: ::c_int = 15;
+pub const _REG_CPSR: ::c_int = 16;
+pub const _REG_X0: ::c_int = 0;
+pub const _REG_X1: ::c_int = 1;
+pub const _REG_X2: ::c_int = 2;
+pub const _REG_X3: ::c_int = 3;
+pub const _REG_X4: ::c_int = 4;
+pub const _REG_X5: ::c_int = 5;
+pub const _REG_X6: ::c_int = 6;
+pub const _REG_X7: ::c_int = 7;
+pub const _REG_X8: ::c_int = 8;
+pub const _REG_X9: ::c_int = 9;
+pub const _REG_X10: ::c_int = 10;
+pub const _REG_X11: ::c_int = 11;
+pub const _REG_X12: ::c_int = 12;
+pub const _REG_X13: ::c_int = 13;
+pub const _REG_X14: ::c_int = 14;
+pub const _REG_X15: ::c_int = 15;
+pub const _REG_X16: ::c_int = 16;
+pub const _REG_X17: ::c_int = 17;
+pub const _REG_X18: ::c_int = 18;
+pub const _REG_X19: ::c_int = 19;
+pub const _REG_X20: ::c_int = 20;
+pub const _REG_X21: ::c_int = 21;
+pub const _REG_X22: ::c_int = 22;
+pub const _REG_X23: ::c_int = 23;
+pub const _REG_X24: ::c_int = 24;
+pub const _REG_X25: ::c_int = 25;
+pub const _REG_X26: ::c_int = 26;
+pub const _REG_X27: ::c_int = 27;
+pub const _REG_X28: ::c_int = 28;
+pub const _REG_X29: ::c_int = 29;
+pub const _REG_X30: ::c_int = 30;
+pub const _REG_X31: ::c_int = 31;
+pub const _REG_ELR: ::c_int = 32;
+pub const _REG_SPSR: ::c_int = 33;
+pub const _REG_TIPDR: ::c_int = 34;
+
+pub const _REG_RV: ::c_int = _REG_R0;
+pub const _REG_FP: ::c_int = _REG_R11;
+pub const _REG_LR: ::c_int = _REG_R13;
+pub const _REG_SP: ::c_int = _REG_R14;
+pub const _REG_PC: ::c_int = _REG_R15;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/mips.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/mips.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/mips.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/mips.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,21 @@
+use PT_FIRSTMACH;
+
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type c_char = i8;
+pub type __cpu_simple_lock_nv_t = ::c_int;
+
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+         #[doc(hidden)]
+         pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
+    } else {
+         #[doc(hidden)]
+         pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
+pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
+pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
+pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,3148 @@
+pub type clock_t = ::c_uint;
+pub type suseconds_t = ::c_int;
+pub type dev_t = u64;
+pub type blksize_t = i32;
+pub type fsblkcnt_t = u64;
+pub type fsfilcnt_t = u64;
+pub type idtype_t = ::c_int;
+pub type mqd_t = ::c_int;
+type __pthread_spin_t = __cpu_simple_lock_nv_t;
+pub type vm_size_t = ::uintptr_t; // FIXME: deprecated since long time
+pub type lwpid_t = ::c_uint;
+pub type shmatt_t = ::c_uint;
+pub type cpuid_t = ::c_ulong;
+pub type cpuset_t = _cpuset;
+pub type pthread_spin_t = ::c_uchar;
+pub type timer_t = ::c_int;
+
+// elf.h
+
+pub type Elf32_Addr = u32;
+pub type Elf32_Half = u16;
+pub type Elf32_Lword = u64;
+pub type Elf32_Off = u32;
+pub type Elf32_Sword = i32;
+pub type Elf32_Word = u32;
+
+pub type Elf64_Addr = u64;
+pub type Elf64_Half = u16;
+pub type Elf64_Lword = u64;
+pub type Elf64_Off = u64;
+pub type Elf64_Sword = i32;
+pub type Elf64_Sxword = i64;
+pub type Elf64_Word = u32;
+pub type Elf64_Xword = u64;
+
+pub type iconv_t = *mut ::c_void;
+
+e! {
+    pub enum fae_action {
+        FAE_OPEN,
+        FAE_DUP2,
+        FAE_CLOSE,
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_pointer_width = "64")] {
+        type Elf_Addr = Elf64_Addr;
+        type Elf_Half = Elf64_Half;
+        type Elf_Phdr = Elf64_Phdr;
+    } else if #[cfg(target_pointer_width = "32")] {
+        type Elf_Addr = Elf32_Addr;
+        type Elf_Half = Elf32_Half;
+        type Elf_Phdr = Elf32_Phdr;
+    }
+}
+
+impl siginfo_t {
+    pub unsafe fn si_addr(&self) -> *mut ::c_void {
+        self.si_addr
+    }
+
+    pub unsafe fn si_code(&self) -> ::c_int {
+        self.si_code
+    }
+
+    pub unsafe fn si_errno(&self) -> ::c_int {
+        self.si_errno
+    }
+
+    pub unsafe fn si_pid(&self) -> ::pid_t {
+        #[repr(C)]
+        struct siginfo_timer {
+            _si_signo: ::c_int,
+            _si_errno: ::c_int,
+            _si_code: ::c_int,
+            __pad1: ::c_int,
+            _pid: ::pid_t,
+        }
+        (*(self as *const siginfo_t as *const siginfo_timer))._pid
+    }
+
+    pub unsafe fn si_uid(&self) -> ::uid_t {
+        #[repr(C)]
+        struct siginfo_timer {
+            _si_signo: ::c_int,
+            _si_errno: ::c_int,
+            _si_code: ::c_int,
+            __pad1: ::c_int,
+            _pid: ::pid_t,
+            _uid: ::uid_t,
+        }
+        (*(self as *const siginfo_t as *const siginfo_timer))._uid
+    }
+
+    pub unsafe fn si_value(&self) -> ::sigval {
+        #[repr(C)]
+        struct siginfo_timer {
+            _si_signo: ::c_int,
+            _si_errno: ::c_int,
+            _si_code: ::c_int,
+            __pad1: ::c_int,
+            _pid: ::pid_t,
+            _uid: ::uid_t,
+            value: ::sigval,
+        }
+        (*(self as *const siginfo_t as *const siginfo_timer)).value
+    }
+
+    pub unsafe fn si_status(&self) -> ::c_int {
+        #[repr(C)]
+        struct siginfo_timer {
+            _si_signo: ::c_int,
+            _si_errno: ::c_int,
+            _si_code: ::c_int,
+            __pad1: ::c_int,
+            _pid: ::pid_t,
+            _uid: ::uid_t,
+            _value: ::sigval,
+            _cpid: ::pid_t,
+            _cuid: ::uid_t,
+            status: ::c_int,
+        }
+        (*(self as *const siginfo_t as *const siginfo_timer)).status
+    }
+}
+
+s! {
+    pub struct aiocb {
+        pub aio_offset: ::off_t,
+        pub aio_buf: *mut ::c_void,
+        pub aio_nbytes: ::size_t,
+        pub aio_fildes: ::c_int,
+        pub aio_lio_opcode: ::c_int,
+        pub aio_reqprio: ::c_int,
+        pub aio_sigevent: ::sigevent,
+        _state: ::c_int,
+        _errno: ::c_int,
+        _retval: ::ssize_t
+    }
+
+    pub struct glob_t {
+        pub gl_pathc:   ::size_t,
+        pub gl_matchc:  ::size_t,
+        pub gl_offs:    ::size_t,
+        pub gl_flags:   ::c_int,
+        pub gl_pathv:   *mut *mut ::c_char,
+
+        __unused3: *mut ::c_void,
+
+        __unused4: *mut ::c_void,
+        __unused5: *mut ::c_void,
+        __unused6: *mut ::c_void,
+        __unused7: *mut ::c_void,
+        __unused8: *mut ::c_void,
+    }
+
+    pub struct mq_attr {
+        pub mq_flags: ::c_long,
+        pub mq_maxmsg: ::c_long,
+        pub mq_msgsize: ::c_long,
+        pub mq_curmsgs: ::c_long,
+    }
+
+    pub struct itimerspec {
+        pub it_interval: ::timespec,
+        pub it_value: ::timespec,
+    }
+
+    pub struct sigset_t {
+        __bits: [u32; 4],
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_mode: ::mode_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_atime: ::time_t,
+        pub st_atimensec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtimensec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctimensec: ::c_long,
+        pub st_birthtime: ::time_t,
+        pub st_birthtimensec: ::c_long,
+        pub st_size: ::off_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_blksize: ::blksize_t,
+        pub st_flags: u32,
+        pub st_gen: u32,
+        pub st_spare: [u32; 2],
+    }
+
+    pub struct addrinfo {
+        pub ai_flags: ::c_int,
+        pub ai_family: ::c_int,
+        pub ai_socktype: ::c_int,
+        pub ai_protocol: ::c_int,
+        pub ai_addrlen: ::socklen_t,
+        pub ai_canonname: *mut ::c_char,
+        pub ai_addr: *mut ::sockaddr,
+        pub ai_next: *mut ::addrinfo,
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_code: ::c_int,
+        pub si_errno: ::c_int,
+        __pad1: ::c_int,
+        pub si_addr: *mut ::c_void,
+        __pad2: [u64; 13],
+    }
+
+    pub struct pthread_attr_t {
+        pta_magic: ::c_uint,
+        pta_flags: ::c_int,
+        pta_private: *mut ::c_void,
+    }
+
+    pub struct pthread_mutex_t {
+        ptm_magic: ::c_uint,
+        ptm_errorcheck: __pthread_spin_t,
+        #[cfg(any(target_arch = "sparc", target_arch = "sparc64",
+                  target_arch = "x86", target_arch = "x86_64"))]
+        ptm_pad1: [u8; 3],
+        // actually a union with a non-unused, 0-initialized field
+        ptm_unused: __pthread_spin_t,
+        #[cfg(any(target_arch = "sparc", target_arch = "sparc64",
+                  target_arch = "x86", target_arch = "x86_64"))]
+        ptm_pad2: [u8; 3],
+        ptm_owner: ::pthread_t,
+        ptm_waiters: *mut u8,
+        ptm_recursed: ::c_uint,
+        ptm_spare2: *mut ::c_void,
+    }
+
+    pub struct pthread_mutexattr_t {
+        ptma_magic: ::c_uint,
+        ptma_private: *mut ::c_void,
+    }
+
+    pub struct pthread_rwlockattr_t {
+        ptra_magic: ::c_uint,
+        ptra_private: *mut ::c_void,
+    }
+
+    pub struct pthread_cond_t {
+        ptc_magic: ::c_uint,
+        ptc_lock: __pthread_spin_t,
+        ptc_waiters_first: *mut u8,
+        ptc_waiters_last: *mut u8,
+        ptc_mutex: *mut ::pthread_mutex_t,
+        ptc_private: *mut ::c_void,
+    }
+
+    pub struct pthread_condattr_t {
+        ptca_magic: ::c_uint,
+        ptca_private: *mut ::c_void,
+    }
+
+    pub struct pthread_rwlock_t {
+        ptr_magic: ::c_uint,
+        ptr_interlock: __pthread_spin_t,
+        ptr_rblocked_first: *mut u8,
+        ptr_rblocked_last: *mut u8,
+        ptr_wblocked_first: *mut u8,
+        ptr_wblocked_last: *mut u8,
+        ptr_nreaders: ::c_uint,
+        ptr_owner: ::pthread_t,
+        ptr_private: *mut ::c_void,
+    }
+
+    pub struct pthread_spinlock_t {
+        pts_magic: ::c_uint,
+        pts_spin: ::pthread_spin_t,
+        pts_flags: ::c_int,
+    }
+
+    pub struct kevent {
+        pub ident: ::uintptr_t,
+        pub filter: u32,
+        pub flags: u32,
+        pub fflags: u32,
+        pub data: i64,
+        pub udata: ::intptr_t, /* FIXME: NetBSD 10.0 will finally have same layout as other BSD */
+    }
+
+    pub struct dqblk {
+        pub dqb_bhardlimit: u32,
+        pub dqb_bsoftlimit: u32,
+        pub dqb_curblocks: u32,
+        pub dqb_ihardlimit: u32,
+        pub dqb_isoftlimit: u32,
+        pub dqb_curinodes: u32,
+        pub dqb_btime: i32,
+        pub dqb_itime: i32,
+    }
+
+    pub struct Dl_info {
+        pub dli_fname: *const ::c_char,
+        pub dli_fbase: *mut ::c_void,
+        pub dli_sname: *const ::c_char,
+        pub dli_saddr: *const ::c_void,
+    }
+
+    pub struct lconv {
+        pub decimal_point: *mut ::c_char,
+        pub thousands_sep: *mut ::c_char,
+        pub grouping: *mut ::c_char,
+        pub int_curr_symbol: *mut ::c_char,
+        pub currency_symbol: *mut ::c_char,
+        pub mon_decimal_point: *mut ::c_char,
+        pub mon_thousands_sep: *mut ::c_char,
+        pub mon_grouping: *mut ::c_char,
+        pub positive_sign: *mut ::c_char,
+        pub negative_sign: *mut ::c_char,
+        pub int_frac_digits: ::c_char,
+        pub frac_digits: ::c_char,
+        pub p_cs_precedes: ::c_char,
+        pub p_sep_by_space: ::c_char,
+        pub n_cs_precedes: ::c_char,
+        pub n_sep_by_space: ::c_char,
+        pub p_sign_posn: ::c_char,
+        pub n_sign_posn: ::c_char,
+        pub int_p_cs_precedes: ::c_char,
+        pub int_n_cs_precedes: ::c_char,
+        pub int_p_sep_by_space: ::c_char,
+        pub int_n_sep_by_space: ::c_char,
+        pub int_p_sign_posn: ::c_char,
+        pub int_n_sign_posn: ::c_char,
+    }
+
+    pub struct if_data {
+        pub ifi_type: ::c_uchar,
+        pub ifi_addrlen: ::c_uchar,
+        pub ifi_hdrlen: ::c_uchar,
+        pub ifi_link_state: ::c_int,
+        pub ifi_mtu: u64,
+        pub ifi_metric: u64,
+        pub ifi_baudrate: u64,
+        pub ifi_ipackets: u64,
+        pub ifi_ierrors: u64,
+        pub ifi_opackets: u64,
+        pub ifi_oerrors: u64,
+        pub ifi_collisions: u64,
+        pub ifi_ibytes: u64,
+        pub ifi_obytes: u64,
+        pub ifi_imcasts: u64,
+        pub ifi_omcasts: u64,
+        pub ifi_iqdrops: u64,
+        pub ifi_noproto: u64,
+        pub ifi_lastchange: ::timespec,
+    }
+
+    pub struct if_msghdr {
+        pub ifm_msglen: ::c_ushort,
+        pub ifm_version: ::c_uchar,
+        pub ifm_type: ::c_uchar,
+        pub ifm_addrs: ::c_int,
+        pub ifm_flags: ::c_int,
+        pub ifm_index: ::c_ushort,
+        pub ifm_data: if_data,
+    }
+
+    pub struct sockcred {
+        pub sc_pid: ::pid_t,
+        pub sc_uid: ::uid_t,
+        pub sc_euid: ::uid_t,
+        pub sc_gid: ::gid_t,
+        pub sc_egid: ::gid_t,
+        pub sc_ngroups: ::c_int,
+        pub sc_groups: [::gid_t; 1],
+    }
+
+    pub struct uucred {
+        pub cr_unused: ::c_ushort,
+        pub cr_uid: ::uid_t,
+        pub cr_gid: ::gid_t,
+        pub cr_ngroups: ::c_int,
+        pub cr_groups: [::gid_t; NGROUPS_MAX as usize],
+    }
+
+    pub struct unpcbid {
+        pub unp_pid: ::pid_t,
+        pub unp_euid: ::uid_t,
+        pub unp_egid: ::gid_t,
+    }
+
+    pub struct sockaddr_dl {
+        pub sdl_len: ::c_uchar,
+        pub sdl_family: ::c_uchar,
+        pub sdl_index: ::c_ushort,
+        pub sdl_type: u8,
+        pub sdl_nlen: u8,
+        pub sdl_alen: u8,
+        pub sdl_slen: u8,
+        pub sdl_data: [::c_char; 12],
+    }
+
+    pub struct mmsghdr {
+        pub msg_hdr: ::msghdr,
+        pub msg_len: ::c_uint,
+    }
+
+    pub struct __exit_status {
+        pub e_termination: u16,
+        pub e_exit: u16,
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        _shm_internal: *mut ::c_void,
+    }
+
+    pub struct utmp {
+        pub ut_line: [::c_char; UT_LINESIZE],
+        pub ut_name: [::c_char; UT_NAMESIZE],
+        pub ut_host: [::c_char; UT_HOSTSIZE],
+        pub ut_time: ::time_t
+    }
+
+    pub struct lastlog {
+        pub ll_line: [::c_char; UT_LINESIZE],
+        pub ll_host: [::c_char; UT_HOSTSIZE],
+        pub ll_time: ::time_t
+    }
+
+    pub struct timex {
+        pub modes: ::c_uint,
+        pub offset: ::c_long,
+        pub freq: ::c_long,
+        pub maxerror: ::c_long,
+        pub esterror: ::c_long,
+        pub status: ::c_int,
+        pub constant: ::c_long,
+        pub precision: ::c_long,
+        pub tolerance: ::c_long,
+        pub ppsfreq: ::c_long,
+        pub jitter: ::c_long,
+        pub shift: ::c_int,
+        pub stabil: ::c_long,
+        pub jitcnt: ::c_long,
+        pub calcnt: ::c_long,
+        pub errcnt: ::c_long,
+        pub stbcnt: ::c_long,
+    }
+
+    pub struct ntptimeval {
+        pub time: ::timespec,
+        pub maxerror: ::c_long,
+        pub esterror: ::c_long,
+        pub tai: ::c_long,
+        pub time_state: ::c_int,
+    }
+
+    // elf.h
+
+    pub struct Elf32_Phdr {
+        pub p_type: Elf32_Word,
+        pub p_offset: Elf32_Off,
+        pub p_vaddr: Elf32_Addr,
+        pub p_paddr: Elf32_Addr,
+        pub p_filesz: Elf32_Word,
+        pub p_memsz: Elf32_Word,
+        pub p_flags: Elf32_Word,
+        pub p_align: Elf32_Word,
+    }
+
+    pub struct Elf64_Phdr {
+        pub p_type: Elf64_Word,
+        pub p_flags: Elf64_Word,
+        pub p_offset: Elf64_Off,
+        pub p_vaddr: Elf64_Addr,
+        pub p_paddr: Elf64_Addr,
+        pub p_filesz: Elf64_Xword,
+        pub p_memsz: Elf64_Xword,
+        pub p_align: Elf64_Xword,
+    }
+
+    pub struct Aux32Info {
+        pub a_type: Elf32_Word,
+        pub a_v: Elf32_Word,
+    }
+
+    pub struct Aux64Info {
+        pub a_type: Elf64_Word,
+        pub a_v: Elf64_Xword,
+    }
+
+    // link.h
+
+    pub struct dl_phdr_info {
+        pub dlpi_addr: Elf_Addr,
+        pub dlpi_name: *const ::c_char,
+        pub dlpi_phdr: *const Elf_Phdr,
+        pub dlpi_phnum: Elf_Half,
+        pub dlpi_adds: ::c_ulonglong,
+        pub dlpi_subs: ::c_ulonglong,
+        pub dlpi_tls_modid: usize,
+        pub dlpi_tls_data: *mut ::c_void,
+    }
+
+    pub struct _cpuset {
+        bits: [u32; 0]
+    }
+
+    pub struct accept_filter_arg {
+        pub af_name: [::c_char; 16],
+        af_arg: [[::c_char; 10]; 24],
+    }
+
+    pub struct ki_sigset_t {
+        pub __bits: [u32; 4],
+    }
+
+    pub struct kinfo_proc2 {
+        pub p_forw: u64,
+        pub p_back: u64,
+        pub p_paddr: u64,
+        pub p_addr: u64,
+        pub p_fd: u64,
+        pub p_cwdi: u64,
+        pub p_stats: u64,
+        pub p_limit: u64,
+        pub p_vmspace: u64,
+        pub p_sigacts: u64,
+        pub p_sess: u64,
+        pub p_tsess: u64,
+        pub p_ru: u64,
+        pub p_eflag: i32,
+        pub p_exitsig: i32,
+        pub p_flag: i32,
+        pub p_pid: i32,
+        pub p_ppid: i32,
+        pub p_sid: i32,
+        pub p__pgid: i32,
+        pub p_tpgid: i32,
+        pub p_uid: u32,
+        pub p_ruid: u32,
+        pub p_gid: u32,
+        pub p_rgid: u32,
+        pub p_groups: [u32; KI_NGROUPS as usize],
+        pub p_ngroups: i16,
+        pub p_jobc: i16,
+        pub p_tdev: u32,
+        pub p_estcpu: u32,
+        pub p_rtime_sec: u32,
+        pub p_rtime_usec: u32,
+        pub p_cpticks: i32,
+        pub p_pctcpu: u32,
+        pub p_swtime: u32,
+        pub p_slptime: u32,
+        pub p_schedflags: i32,
+        pub p_uticks: u64,
+        pub p_sticks: u64,
+        pub p_iticks: u64,
+        pub p_tracep: u64,
+        pub p_traceflag: i32,
+        pub p_holdcnt: i32,
+        pub p_siglist: ki_sigset_t,
+        pub p_sigmask: ki_sigset_t,
+        pub p_sigignore: ki_sigset_t,
+        pub p_sigcatch: ki_sigset_t,
+        pub p_stat: i8,
+        pub p_priority: u8,
+        pub p_usrpri: u8,
+        pub p_nice: u8,
+        pub p_xstat: u16,
+        pub p_acflag: u16,
+        pub p_comm: [::c_char; KI_MAXCOMLEN as usize],
+        pub p_wmesg: [::c_char; KI_WMESGLEN as usize],
+        pub p_wchan: u64,
+        pub p_login: [::c_char; KI_MAXLOGNAME as usize],
+        pub p_vm_rssize: i32,
+        pub p_vm_tsize: i32,
+        pub p_vm_dsize: i32,
+        pub p_vm_ssize: i32,
+        pub p_uvalid: i64,
+        pub p_ustart_sec: u32,
+        pub p_ustart_usec: u32,
+        pub p_uutime_sec: u32,
+        pub p_uutime_usec: u32,
+        pub p_ustime_sec: u32,
+        pub p_ustime_usec: u32,
+        pub p_uru_maxrss: u64,
+        pub p_uru_ixrss: u64,
+        pub p_uru_idrss: u64,
+        pub p_uru_isrss: u64,
+        pub p_uru_minflt: u64,
+        pub p_uru_majflt: u64,
+        pub p_uru_nswap: u64,
+        pub p_uru_inblock: u64,
+        pub p_uru_oublock: u64,
+        pub p_uru_msgsnd: u64,
+        pub p_uru_msgrcv: u64,
+        pub p_uru_nsignals: u64,
+        pub p_uru_nvcsw: u64,
+        pub p_uru_nivcsw: u64,
+        pub p_uctime_sec: u32,
+        pub p_uctime_usec: u32,
+        pub p_cpuid: u64,
+        pub p_realflag: u64,
+        pub p_nlwps: u64,
+        pub p_nrlwps: u64,
+        pub p_realstat: u64,
+        pub p_svuid: u32,
+        pub p_svgid: u32,
+        pub p_ename: [::c_char; KI_MAXEMULLEN as usize],
+        pub p_vm_vsize: i64,
+        pub p_vm_msize: i64,
+    }
+
+    pub struct kinfo_lwp {
+        pub l_forw: u64,
+        pub l_back: u64,
+        pub l_laddr: u64,
+        pub l_addr: u64,
+        pub l_lid: i32,
+        pub l_flag: i32,
+        pub l_swtime: u32,
+        pub l_slptime: u32,
+        pub l_schedflags: i32,
+        pub l_holdcnt: i32,
+        pub l_priority: u8,
+        pub l_usrpri: u8,
+        pub l_stat: i8,
+        l_pad1: i8,
+        l_pad2: i32,
+        pub l_wmesg: [::c_char; KI_WMESGLEN as usize],
+        pub l_wchan: u64,
+        pub l_cpuid: u64,
+        pub l_rtime_sec: u32,
+        pub l_rtime_usec: u32,
+        pub l_cpticks: u32,
+        pub l_pctcpu: u32,
+        pub l_pid: u32,
+        pub l_name: [::c_char; KI_LNAMELEN as usize],
+    }
+
+    pub struct kinfo_vmentry {
+        pub kve_start: u64,
+        pub kve_end: u64,
+        pub kve_offset: u64,
+        pub kve_type: u32,
+        pub kve_flags: u32,
+        pub kve_count: u32,
+        pub kve_wired_count: u32,
+        pub kve_advice: u32,
+        pub kve_attributes: u32,
+        pub kve_protection: u32,
+        pub kve_max_protection: u32,
+        pub kve_ref_count: u32,
+        pub kve_inheritance: u32,
+        pub kve_vn_fileid: u64,
+        pub kve_vn_size: u64,
+        pub kve_vn_fsid: u64,
+        pub kve_vn_rdev: u64,
+        pub kve_vn_type: u32,
+        pub kve_vn_mode: u32,
+        pub kve_path: [[::c_char; 32]; 32],
+    }
+
+    pub struct __c_anonymous_posix_spawn_fae_open {
+        pub path: *mut ::c_char,
+        pub oflag: ::c_int,
+        pub mode: ::mode_t,
+    }
+
+    pub struct __c_anonymous_posix_spawn_fae_dup2 {
+        pub newfildes: ::c_int,
+    }
+
+    pub struct posix_spawnattr_t {
+        pub sa_flags: ::c_short,
+        pub sa_pgroup: ::pid_t,
+        pub sa_schedparam: ::sched_param,
+        pub sa_schedpolicy: ::c_int,
+        pub sa_sigdefault: sigset_t,
+        pub sa_sigmask: sigset_t,
+    }
+
+    pub struct posix_spawn_file_actions_entry_t {
+        pub fae_action: fae_action,
+        pub fae_fildes: ::c_int,
+        #[cfg(libc_union)]
+        pub fae_data: __c_anonymous_posix_spawn_fae,
+    }
+
+    pub struct posix_spawn_file_actions_t {
+        pub size: ::c_uint,
+        pub len: ::c_uint,
+        #[cfg(libc_union)]
+        pub fae: *mut posix_spawn_file_actions_entry_t,
+    }
+
+    pub struct ptrace_lwpinfo {
+        pub pl_lwpid: lwpid_t,
+        pub pl_event: ::c_int,
+    }
+
+    pub struct ptrace_lwpstatus {
+        pub pl_lwpid: lwpid_t,
+        pub pl_sigpend: sigset_t,
+        pub pl_sigmask: sigset_t,
+        pub pl_name: [::c_char; 20],
+        pub pl_private: *mut ::c_void,
+    }
+
+    pub struct ptrace_siginfo {
+        pub psi_siginfo: siginfo_t,
+        pub psi_lwpid: lwpid_t,
+    }
+
+    pub struct ptrace_event {
+        pub pe_set_event: ::c_int,
+    }
+
+    pub struct sysctldesc {
+        pub descr_num: i32,
+        pub descr_ver: u32,
+        pub descr_len: u32,
+        pub descr_str: [::c_char; 1],
+    }
+
+    pub struct ifreq {
+        pub _priv: [[::c_char; 6]; 24],
+    }
+
+    pub struct ifconf {
+        pub ifc_len: ::c_int,
+        #[cfg(libc_union)]
+        pub ifc_ifcu: __c_anonymous_ifc_ifcu,
+    }
+
+    pub struct tcp_info {
+        pub tcpi_state: u8,
+        pub __tcpi_ca_state: u8,
+        pub __tcpi_retransmits: u8,
+        pub __tcpi_probes: u8,
+        pub __tcpi_backoff: u8,
+        pub tcpi_options: u8,
+        pub tcp_snd_wscale: u8,
+        pub tcp_rcv_wscale: u8,
+        pub tcpi_rto: u32,
+        pub __tcpi_ato: u32,
+        pub tcpi_snd_mss: u32,
+        pub tcpi_rcv_mss: u32,
+        pub __tcpi_unacked: u32,
+        pub __tcpi_sacked: u32,
+        pub __tcpi_lost: u32,
+        pub __tcpi_retrans: u32,
+        pub __tcpi_fackets: u32,
+        pub __tcpi_last_data_sent: u32,
+        pub __tcpi_last_ack_sent: u32,
+        pub tcpi_last_data_recv: u32,
+        pub __tcpi_last_ack_recv: u32,
+        pub __tcpi_pmtu: u32,
+        pub __tcpi_rcv_ssthresh: u32,
+        pub tcpi_rtt: u32,
+        pub tcpi_rttvar: u32,
+        pub tcpi_snd_ssthresh: u32,
+        pub tcpi_snd_cwnd: u32,
+        pub __tcpi_advmss: u32,
+        pub __tcpi_reordering: u32,
+        pub __tcpi_rcv_rtt: u32,
+        pub tcpi_rcv_space: u32,
+        pub tcpi_snd_wnd: u32,
+        pub tcpi_snd_bwnd: u32,
+        pub tcpi_snd_nxt: u32,
+        pub tcpi_rcv_nxt: u32,
+        pub tcpi_toe_tid: u32,
+        pub tcpi_snd_rexmitpack: u32,
+        pub tcpi_rcv_ooopack: u32,
+        pub tcpi_snd_zerowin: u32,
+        pub __tcpi_pad: [u32; 26],
+    }
+}
+
+s_no_extra_traits! {
+
+    pub struct utmpx {
+        pub ut_name: [::c_char; _UTX_USERSIZE],
+        pub ut_id: [::c_char; _UTX_IDSIZE],
+        pub ut_line: [::c_char; _UTX_LINESIZE],
+        pub ut_host: [::c_char; _UTX_HOSTSIZE],
+        pub ut_session: u16,
+        pub ut_type: u16,
+        pub ut_pid: ::pid_t,
+        pub ut_exit: __exit_status, // FIXME: when anonymous struct are supported
+        pub ut_ss: sockaddr_storage,
+        pub ut_tv: ::timeval,
+        pub ut_pad: [u8; _UTX_PADSIZE],
+    }
+
+    pub struct lastlogx {
+        pub ll_tv: ::timeval,
+        pub ll_line: [::c_char; _UTX_LINESIZE],
+        pub ll_host: [::c_char; _UTX_HOSTSIZE],
+        pub ll_ss: sockaddr_storage,
+    }
+
+    pub struct in_pktinfo {
+        pub ipi_addr: ::in_addr,
+        pub ipi_ifindex: ::c_uint,
+    }
+
+    pub struct arphdr {
+        pub ar_hrd: u16,
+        pub ar_pro: u16,
+        pub ar_hln: u8,
+        pub ar_pln: u8,
+        pub ar_op: u16,
+    }
+
+    pub struct in_addr {
+        pub s_addr: ::in_addr_t,
+    }
+
+    pub struct ip_mreq {
+        pub imr_multiaddr: in_addr,
+        pub imr_interface: in_addr,
+    }
+
+    pub struct sockaddr_in {
+        pub sin_len: u8,
+        pub sin_family: ::sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [i8; 8],
+    }
+
+    pub struct dirent {
+        pub d_fileno: ::ino_t,
+        pub d_reclen: u16,
+        pub d_namlen: u16,
+        pub d_type: u8,
+        pub d_name: [::c_char; 512],
+    }
+
+    pub struct statvfs {
+        pub f_flag: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_iosize: ::c_ulong,
+
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_bresvd: ::fsblkcnt_t,
+
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fresvd: ::fsfilcnt_t,
+
+        pub f_syncreads: u64,
+        pub f_syncwrites: u64,
+
+        pub f_asyncreads: u64,
+        pub f_asyncwrites: u64,
+
+        pub f_fsidx: ::fsid_t,
+        pub f_fsid: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        pub f_owner: ::uid_t,
+
+        pub f_spare: [u32; 4],
+
+        pub f_fstypename: [::c_char; 32],
+        pub f_mntonname: [::c_char; 1024],
+        pub f_mntfromname: [::c_char; 1024],
+    }
+
+    pub struct sockaddr_storage {
+        pub ss_len: u8,
+        pub ss_family: ::sa_family_t,
+        __ss_pad1: [u8; 6],
+        __ss_pad2: i64,
+        __ss_pad3: [u8; 112],
+    }
+
+    pub struct sigevent {
+        pub sigev_notify: ::c_int,
+        pub sigev_signo: ::c_int,
+        pub sigev_value: ::sigval,
+        __unused1: *mut ::c_void,       //actually a function pointer
+        pub sigev_notify_attributes: *mut ::c_void
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_posix_spawn_fae {
+        pub open: __c_anonymous_posix_spawn_fae_open,
+        pub dup2: __c_anonymous_posix_spawn_fae_dup2,
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifc_ifcu {
+        pub ifcu_buf: *mut ::c_void,
+        pub ifcu_req: *mut ifreq,
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for utmpx {
+            fn eq(&self, other: &utmpx) -> bool {
+                self.ut_type == other.ut_type
+                    && self.ut_pid == other.ut_pid
+                    && self.ut_name == other.ut_name
+                    && self.ut_line == other.ut_line
+                    && self.ut_id == other.ut_id
+                    && self.ut_exit == other.ut_exit
+                    && self.ut_session == other.ut_session
+                    && self.ut_tv == other.ut_tv
+                    && self.ut_ss == other.ut_ss
+                    && self
+                    .ut_pad
+                    .iter()
+                    .zip(other.ut_pad.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .ut_host
+                    .iter()
+                    .zip(other.ut_host.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for utmpx {}
+
+        impl ::fmt::Debug for utmpx {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("utmpx")
+                    .field("ut_name", &self.ut_name)
+                    .field("ut_id", &self.ut_id)
+                    .field("ut_line", &self.ut_line)
+                // FIXME .field("ut_host", &self.ut_host)
+                    .field("ut_session", &self.ut_session)
+                    .field("ut_type", &self.ut_type)
+                    .field("ut_pid", &self.ut_pid)
+                    .field("ut_exit", &self.ut_exit)
+                    .field("ut_ss", &self.ut_ss)
+                    .field("ut_tv", &self.ut_tv)
+                // FIXME .field("ut_pad", &self.ut_pad)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for utmpx {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ut_name.hash(state);
+                self.ut_type.hash(state);
+                self.ut_pid.hash(state);
+                self.ut_line.hash(state);
+                self.ut_id.hash(state);
+                self.ut_host.hash(state);
+                self.ut_exit.hash(state);
+                self.ut_session.hash(state);
+                self.ut_tv.hash(state);
+                self.ut_ss.hash(state);
+                self.ut_pad.hash(state);
+            }
+        }
+
+        impl PartialEq for lastlogx {
+            fn eq(&self, other: &lastlogx) -> bool {
+                self.ll_tv == other.ll_tv
+                    && self.ll_line == other.ll_line
+                    && self.ll_ss == other.ll_ss
+                    && self
+                    .ll_host
+                    .iter()
+                    .zip(other.ll_host.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for lastlogx {}
+
+        impl ::fmt::Debug for lastlogx {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("lastlogx")
+                    .field("ll_tv", &self.ll_tv)
+                    .field("ll_line", &self.ll_line)
+                // FIXME.field("ll_host", &self.ll_host)
+                    .field("ll_ss", &self.ll_ss)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for lastlogx {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ll_tv.hash(state);
+                self.ll_line.hash(state);
+                self.ll_host.hash(state);
+                self.ll_ss.hash(state);
+            }
+        }
+
+        impl PartialEq for in_pktinfo {
+            fn eq(&self, other: &in_pktinfo) -> bool {
+                self.ipi_addr == other.ipi_addr
+                    && self.ipi_ifindex == other.ipi_ifindex
+            }
+        }
+        impl Eq for in_pktinfo {}
+        impl ::fmt::Debug for in_pktinfo {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("in_pktinfo")
+                    .field("ipi_addr", &self.ipi_addr)
+                    .field("ipi_ifindex", &self.ipi_ifindex)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for in_pktinfo {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ipi_addr.hash(state);
+                self.ipi_ifindex.hash(state);
+            }
+        }
+
+        impl PartialEq for arphdr {
+            fn eq(&self, other: &arphdr) -> bool {
+                self.ar_hrd == other.ar_hrd
+                    && self.ar_pro == other.ar_pro
+                    && self.ar_hln == other.ar_hln
+                    && self.ar_pln == other.ar_pln
+                    && self.ar_op == other.ar_op
+            }
+        }
+        impl Eq for arphdr {}
+        impl ::fmt::Debug for arphdr {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let ar_hrd = self.ar_hrd;
+                let ar_pro = self.ar_pro;
+                let ar_op = self.ar_op;
+                f.debug_struct("arphdr")
+                    .field("ar_hrd", &ar_hrd)
+                    .field("ar_pro", &ar_pro)
+                    .field("ar_hln", &self.ar_hln)
+                    .field("ar_pln", &self.ar_pln)
+                    .field("ar_op", &ar_op)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for arphdr {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let ar_hrd = self.ar_hrd;
+                let ar_pro = self.ar_pro;
+                let ar_op = self.ar_op;
+                ar_hrd.hash(state);
+                ar_pro.hash(state);
+                self.ar_hln.hash(state);
+                self.ar_pln.hash(state);
+                ar_op.hash(state);
+            }
+        }
+
+        impl PartialEq for in_addr {
+            fn eq(&self, other: &in_addr) -> bool {
+                self.s_addr == other.s_addr
+            }
+        }
+        impl Eq for in_addr {}
+        impl ::fmt::Debug for in_addr {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let s_addr = self.s_addr;
+                f.debug_struct("in_addr")
+                    .field("s_addr", &s_addr)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for in_addr {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let s_addr = self.s_addr;
+                s_addr.hash(state);
+            }
+        }
+
+        impl PartialEq for ip_mreq {
+            fn eq(&self, other: &ip_mreq) -> bool {
+                self.imr_multiaddr == other.imr_multiaddr
+                    && self.imr_interface == other.imr_interface
+            }
+        }
+        impl Eq for ip_mreq {}
+        impl ::fmt::Debug for ip_mreq {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ip_mreq")
+                    .field("imr_multiaddr", &self.imr_multiaddr)
+                    .field("imr_interface", &self.imr_interface)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for ip_mreq {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.imr_multiaddr.hash(state);
+                self.imr_interface.hash(state);
+            }
+        }
+
+        impl PartialEq for sockaddr_in {
+            fn eq(&self, other: &sockaddr_in) -> bool {
+                self.sin_len == other.sin_len
+                    && self.sin_family == other.sin_family
+                    && self.sin_port == other.sin_port
+                    && self.sin_addr == other.sin_addr
+                    && self.sin_zero == other.sin_zero
+            }
+        }
+        impl Eq for sockaddr_in {}
+        impl ::fmt::Debug for sockaddr_in {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_in")
+                    .field("sin_len", &self.sin_len)
+                    .field("sin_family", &self.sin_family)
+                    .field("sin_port", &self.sin_port)
+                    .field("sin_addr", &self.sin_addr)
+                    .field("sin_zero", &self.sin_zero)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sockaddr_in {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sin_len.hash(state);
+                self.sin_family.hash(state);
+                self.sin_port.hash(state);
+                self.sin_addr.hash(state);
+                self.sin_zero.hash(state);
+            }
+        }
+
+        impl PartialEq for dirent {
+            fn eq(&self, other: &dirent) -> bool {
+                self.d_fileno == other.d_fileno
+                    && self.d_reclen == other.d_reclen
+                    && self.d_namlen == other.d_namlen
+                    && self.d_type == other.d_type
+                    && self
+                    .d_name
+                    .iter()
+                    .zip(other.d_name.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for dirent {}
+        impl ::fmt::Debug for dirent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("dirent")
+                    .field("d_fileno", &self.d_fileno)
+                    .field("d_reclen", &self.d_reclen)
+                    .field("d_namlen", &self.d_namlen)
+                    .field("d_type", &self.d_type)
+                    // FIXME: .field("d_name", &self.d_name)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for dirent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.d_fileno.hash(state);
+                self.d_reclen.hash(state);
+                self.d_namlen.hash(state);
+                self.d_type.hash(state);
+                self.d_name.hash(state);
+            }
+        }
+
+        impl PartialEq for statvfs {
+            fn eq(&self, other: &statvfs) -> bool {
+                self.f_flag == other.f_flag
+                    && self.f_bsize == other.f_bsize
+                    && self.f_frsize == other.f_frsize
+                    && self.f_iosize == other.f_iosize
+                    && self.f_blocks == other.f_blocks
+                    && self.f_bfree == other.f_bfree
+                    && self.f_bavail == other.f_bavail
+                    && self.f_bresvd == other.f_bresvd
+                    && self.f_files == other.f_files
+                    && self.f_ffree == other.f_ffree
+                    && self.f_favail == other.f_favail
+                    && self.f_fresvd == other.f_fresvd
+                    && self.f_syncreads == other.f_syncreads
+                    && self.f_syncwrites == other.f_syncwrites
+                    && self.f_asyncreads == other.f_asyncreads
+                    && self.f_asyncwrites == other.f_asyncwrites
+                    && self.f_fsidx == other.f_fsidx
+                    && self.f_fsid == other.f_fsid
+                    && self.f_namemax == other.f_namemax
+                    && self.f_owner == other.f_owner
+                    && self.f_spare == other.f_spare
+                    && self.f_fstypename == other.f_fstypename
+                    && self
+                    .f_mntonname
+                    .iter()
+                    .zip(other.f_mntonname.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .f_mntfromname
+                    .iter()
+                    .zip(other.f_mntfromname.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for statvfs {}
+        impl ::fmt::Debug for statvfs {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("statvfs")
+                    .field("f_flag", &self.f_flag)
+                    .field("f_bsize", &self.f_bsize)
+                    .field("f_frsize", &self.f_frsize)
+                    .field("f_iosize", &self.f_iosize)
+                    .field("f_blocks", &self.f_blocks)
+                    .field("f_bfree", &self.f_bfree)
+                    .field("f_bavail", &self.f_bavail)
+                    .field("f_bresvd", &self.f_bresvd)
+                    .field("f_files", &self.f_files)
+                    .field("f_ffree", &self.f_ffree)
+                    .field("f_favail", &self.f_favail)
+                    .field("f_fresvd", &self.f_fresvd)
+                    .field("f_syncreads", &self.f_syncreads)
+                    .field("f_syncwrites", &self.f_syncwrites)
+                    .field("f_asyncreads", &self.f_asyncreads)
+                    .field("f_asyncwrites", &self.f_asyncwrites)
+                    .field("f_fsidx", &self.f_fsidx)
+                    .field("f_fsid", &self.f_fsid)
+                    .field("f_namemax", &self.f_namemax)
+                    .field("f_owner", &self.f_owner)
+                    .field("f_spare", &self.f_spare)
+                    .field("f_fstypename", &self.f_fstypename)
+                    // FIXME: .field("f_mntonname", &self.f_mntonname)
+                    // FIXME: .field("f_mntfromname", &self.f_mntfromname)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for statvfs {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.f_flag.hash(state);
+                self.f_bsize.hash(state);
+                self.f_frsize.hash(state);
+                self.f_iosize.hash(state);
+                self.f_blocks.hash(state);
+                self.f_bfree.hash(state);
+                self.f_bavail.hash(state);
+                self.f_bresvd.hash(state);
+                self.f_files.hash(state);
+                self.f_ffree.hash(state);
+                self.f_favail.hash(state);
+                self.f_fresvd.hash(state);
+                self.f_syncreads.hash(state);
+                self.f_syncwrites.hash(state);
+                self.f_asyncreads.hash(state);
+                self.f_asyncwrites.hash(state);
+                self.f_fsidx.hash(state);
+                self.f_fsid.hash(state);
+                self.f_namemax.hash(state);
+                self.f_owner.hash(state);
+                self.f_spare.hash(state);
+                self.f_fstypename.hash(state);
+                self.f_mntonname.hash(state);
+                self.f_mntfromname.hash(state);
+            }
+        }
+
+        impl PartialEq for sockaddr_storage {
+            fn eq(&self, other: &sockaddr_storage) -> bool {
+                self.ss_len == other.ss_len
+                    && self.ss_family == other.ss_family
+                    && self.__ss_pad1 == other.__ss_pad1
+                    && self.__ss_pad2 == other.__ss_pad2
+                    && self
+                    .__ss_pad3
+                    .iter()
+                    .zip(other.__ss_pad3.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for sockaddr_storage {}
+        impl ::fmt::Debug for sockaddr_storage {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_storage")
+                    .field("ss_len", &self.ss_len)
+                    .field("ss_family", &self.ss_family)
+                    .field("__ss_pad1", &self.__ss_pad1)
+                    .field("__ss_pad2", &self.__ss_pad2)
+                    // FIXME: .field("__ss_pad3", &self.__ss_pad3)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sockaddr_storage {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ss_len.hash(state);
+                self.ss_family.hash(state);
+                self.__ss_pad1.hash(state);
+                self.__ss_pad2.hash(state);
+                self.__ss_pad3.hash(state);
+            }
+        }
+
+        impl PartialEq for sigevent {
+            fn eq(&self, other: &sigevent) -> bool {
+                self.sigev_notify == other.sigev_notify
+                    && self.sigev_signo == other.sigev_signo
+                    && self.sigev_value == other.sigev_value
+                    && self.sigev_notify_attributes
+                        == other.sigev_notify_attributes
+            }
+        }
+        impl Eq for sigevent {}
+        impl ::fmt::Debug for sigevent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sigevent")
+                    .field("sigev_notify", &self.sigev_notify)
+                    .field("sigev_signo", &self.sigev_signo)
+                    .field("sigev_value", &self.sigev_value)
+                    .field("sigev_notify_attributes",
+                           &self.sigev_notify_attributes)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sigevent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sigev_notify.hash(state);
+                self.sigev_signo.hash(state);
+                self.sigev_value.hash(state);
+                self.sigev_notify_attributes.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_posix_spawn_fae {}
+
+        #[cfg(libc_union)]
+        impl PartialEq for __c_anonymous_posix_spawn_fae {
+            fn eq(&self, other: &__c_anonymous_posix_spawn_fae) -> bool {
+                unsafe {
+                    self.open == other.open
+                        || self.dup2 == other.dup2
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_posix_spawn_fae {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                    f.debug_struct("__c_anonymous_posix_fae")
+                        .field("open", &self.open)
+                        .field("dup2", &self.dup2)
+                        .finish()
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_posix_spawn_fae {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                    self.open.hash(state);
+                    self.dup2.hash(state);
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_ifc_ifcu {}
+
+        #[cfg(libc_union)]
+        impl PartialEq for __c_anonymous_ifc_ifcu {
+            fn eq(&self, other: &__c_anonymous_ifc_ifcu) -> bool {
+                unsafe {
+                    self.ifcu_buf == other.ifcu_buf
+                        || self.ifcu_req == other.ifcu_req
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifc_ifcu {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                    f.debug_struct("__c_anonymous_ifc_ifcu")
+                        .field("ifcu_buf", &self.ifcu_buf)
+                        .field("ifcu_req", &self.ifcu_req)
+                        .finish()
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_ifc_ifcu {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                    self.ifcu_buf.hash(state);
+                    self.ifcu_req.hash(state);
+                }
+            }
+        }
+    }
+}
+
+pub const AT_FDCWD: ::c_int = -100;
+pub const AT_EACCESS: ::c_int = 0x100;
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200;
+pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
+pub const AT_REMOVEDIR: ::c_int = 0x800;
+
+pub const AT_NULL: ::c_int = 0;
+pub const AT_IGNORE: ::c_int = 1;
+pub const AT_EXECFD: ::c_int = 2;
+pub const AT_PHDR: ::c_int = 3;
+pub const AT_PHENT: ::c_int = 4;
+pub const AT_PHNUM: ::c_int = 5;
+pub const AT_PAGESZ: ::c_int = 6;
+pub const AT_BASE: ::c_int = 7;
+pub const AT_FLAGS: ::c_int = 8;
+pub const AT_ENTRY: ::c_int = 9;
+pub const AT_DCACHEBSIZE: ::c_int = 10;
+pub const AT_ICACHEBSIZE: ::c_int = 11;
+pub const AT_UCACHEBSIZE: ::c_int = 12;
+pub const AT_STACKBASE: ::c_int = 13;
+pub const AT_EUID: ::c_int = 2000;
+pub const AT_RUID: ::c_int = 2001;
+pub const AT_EGID: ::c_int = 2002;
+pub const AT_RGID: ::c_int = 2003;
+pub const AT_SUN_LDELF: ::c_int = 2004;
+pub const AT_SUN_LDSHDR: ::c_int = 2005;
+pub const AT_SUN_LDNAME: ::c_int = 2006;
+pub const AT_SUN_LDPGSIZE: ::c_int = 2007;
+pub const AT_SUN_PLATFORM: ::c_int = 2008;
+pub const AT_SUN_HWCAP: ::c_int = 2009;
+pub const AT_SUN_IFLUSH: ::c_int = 2010;
+pub const AT_SUN_CPU: ::c_int = 2011;
+pub const AT_SUN_EMUL_ENTRY: ::c_int = 2012;
+pub const AT_SUN_EMUL_EXECFD: ::c_int = 2013;
+pub const AT_SUN_EXECNAME: ::c_int = 2014;
+
+pub const EXTATTR_NAMESPACE_USER: ::c_int = 1;
+pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2;
+
+pub const LC_COLLATE_MASK: ::c_int = 1 << ::LC_COLLATE;
+pub const LC_CTYPE_MASK: ::c_int = 1 << ::LC_CTYPE;
+pub const LC_MONETARY_MASK: ::c_int = 1 << ::LC_MONETARY;
+pub const LC_NUMERIC_MASK: ::c_int = 1 << ::LC_NUMERIC;
+pub const LC_TIME_MASK: ::c_int = 1 << ::LC_TIME;
+pub const LC_MESSAGES_MASK: ::c_int = 1 << ::LC_MESSAGES;
+pub const LC_ALL_MASK: ::c_int = !0;
+
+pub const ERA: ::nl_item = 52;
+pub const ERA_D_FMT: ::nl_item = 53;
+pub const ERA_D_T_FMT: ::nl_item = 54;
+pub const ERA_T_FMT: ::nl_item = 55;
+pub const ALT_DIGITS: ::nl_item = 56;
+
+pub const O_CLOEXEC: ::c_int = 0x400000;
+pub const O_ALT_IO: ::c_int = 0x40000;
+pub const O_NOSIGPIPE: ::c_int = 0x1000000;
+pub const O_SEARCH: ::c_int = 0x800000;
+pub const O_DIRECTORY: ::c_int = 0x200000;
+pub const O_DIRECT: ::c_int = 0x00080000;
+pub const O_RSYNC: ::c_int = 0x00020000;
+
+pub const MS_SYNC: ::c_int = 0x4;
+pub const MS_INVALIDATE: ::c_int = 0x2;
+
+// Here because they are not present on OpenBSD
+// (https://github.com/openbsd/src/blob/HEAD/sys/sys/resource.h)
+pub const RLIMIT_SBSIZE: ::c_int = 9;
+pub const RLIMIT_AS: ::c_int = 10;
+pub const RLIMIT_NTHR: ::c_int = 11;
+
+#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+pub const RLIM_NLIMITS: ::c_int = 12;
+
+pub const EIDRM: ::c_int = 82;
+pub const ENOMSG: ::c_int = 83;
+pub const EOVERFLOW: ::c_int = 84;
+pub const EILSEQ: ::c_int = 85;
+pub const ENOTSUP: ::c_int = 86;
+pub const ECANCELED: ::c_int = 87;
+pub const EBADMSG: ::c_int = 88;
+pub const ENODATA: ::c_int = 89;
+pub const ENOSR: ::c_int = 90;
+pub const ENOSTR: ::c_int = 91;
+pub const ETIME: ::c_int = 92;
+pub const ENOATTR: ::c_int = 93;
+pub const EMULTIHOP: ::c_int = 94;
+pub const ENOLINK: ::c_int = 95;
+pub const EPROTO: ::c_int = 96;
+pub const EOWNERDEAD: ::c_int = 97;
+pub const ENOTRECOVERABLE: ::c_int = 98;
+#[deprecated(
+    since = "0.2.143",
+    note = "This value will always match the highest defined error number \
+            and thus is not stable. \
+            See #3040 for more info."
+)]
+pub const ELAST: ::c_int = 98;
+
+pub const F_DUPFD_CLOEXEC: ::c_int = 12;
+pub const F_CLOSEM: ::c_int = 10;
+pub const F_GETNOSIGPIPE: ::c_int = 13;
+pub const F_SETNOSIGPIPE: ::c_int = 14;
+pub const F_MAXFD: ::c_int = 11;
+pub const F_GETPATH: ::c_int = 15;
+
+pub const FUTEX_WAIT: ::c_int = 0;
+pub const FUTEX_WAKE: ::c_int = 1;
+pub const FUTEX_FD: ::c_int = 2;
+pub const FUTEX_REQUEUE: ::c_int = 3;
+pub const FUTEX_CMP_REQUEUE: ::c_int = 4;
+pub const FUTEX_WAKE_OP: ::c_int = 5;
+pub const FUTEX_LOCK_PI: ::c_int = 6;
+pub const FUTEX_UNLOCK_PI: ::c_int = 7;
+pub const FUTEX_TRYLOCK_PI: ::c_int = 8;
+pub const FUTEX_WAIT_BITSET: ::c_int = 9;
+pub const FUTEX_WAKE_BITSET: ::c_int = 10;
+pub const FUTEX_WAIT_REQUEUE_PI: ::c_int = 11;
+pub const FUTEX_CMP_REQUEUE_PI: ::c_int = 12;
+pub const FUTEX_PRIVATE_FLAG: ::c_int = 1 << 7;
+pub const FUTEX_CLOCK_REALTIME: ::c_int = 1 << 8;
+pub const FUTEX_CMD_MASK: ::c_int = !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME);
+pub const FUTEX_WAITERS: u32 = 1 << 31;
+pub const FUTEX_OWNER_DIED: u32 = 1 << 30;
+pub const FUTEX_SYNCOBJ_1: u32 = 1 << 29;
+pub const FUTEX_SYNCOBJ_0: u32 = 1 << 28;
+pub const FUTEX_TID_MASK: u32 = (1 << 28) - 1;
+pub const FUTEX_BITSET_MATCH_ANY: u32 = !0;
+
+pub const IP_RECVDSTADDR: ::c_int = 7;
+pub const IP_SENDSRCADDR: ::c_int = IP_RECVDSTADDR;
+pub const IP_RECVIF: ::c_int = 20;
+pub const IP_PKTINFO: ::c_int = 25;
+pub const IP_RECVPKTINFO: ::c_int = 26;
+pub const IPV6_JOIN_GROUP: ::c_int = 12;
+pub const IPV6_LEAVE_GROUP: ::c_int = 13;
+
+pub const TCP_KEEPIDLE: ::c_int = 3;
+pub const TCP_KEEPINTVL: ::c_int = 5;
+pub const TCP_KEEPCNT: ::c_int = 6;
+pub const TCP_KEEPINIT: ::c_int = 7;
+pub const TCP_MD5SIG: ::c_int = 0x10;
+pub const TCP_CONGCTL: ::c_int = 0x20;
+
+pub const SOCK_CONN_DGRAM: ::c_int = 6;
+pub const SOCK_DCCP: ::c_int = SOCK_CONN_DGRAM;
+pub const SOCK_NOSIGPIPE: ::c_int = 0x40000000;
+pub const SOCK_FLAGS_MASK: ::c_int = 0xf0000000;
+
+pub const SO_SNDTIMEO: ::c_int = 0x100b;
+pub const SO_RCVTIMEO: ::c_int = 0x100c;
+pub const SO_NOSIGPIPE: ::c_int = 0x0800;
+pub const SO_ACCEPTFILTER: ::c_int = 0x1000;
+pub const SO_TIMESTAMP: ::c_int = 0x2000;
+pub const SO_OVERFLOWED: ::c_int = 0x1009;
+pub const SO_NOHEADER: ::c_int = 0x100a;
+
+// http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/un.h?annotate
+pub const LOCAL_OCREDS: ::c_int = 0x0001; // pass credentials to receiver
+pub const LOCAL_CONNWAIT: ::c_int = 0x0002; // connects block until accepted
+pub const LOCAL_PEEREID: ::c_int = 0x0003; // get peer identification
+pub const LOCAL_CREDS: ::c_int = 0x0004; // pass credentials to receiver
+
+// https://github.com/NetBSD/src/blob/trunk/sys/net/if.h#L373
+pub const IFF_UP: ::c_int = 0x0001; // interface is up
+pub const IFF_BROADCAST: ::c_int = 0x0002; // broadcast address valid
+pub const IFF_DEBUG: ::c_int = 0x0004; // turn on debugging
+pub const IFF_LOOPBACK: ::c_int = 0x0008; // is a loopback net
+pub const IFF_POINTOPOINT: ::c_int = 0x0010; // interface is point-to-point link
+pub const IFF_NOTRAILERS: ::c_int = 0x0020; // avoid use of trailers
+pub const IFF_RUNNING: ::c_int = 0x0040; // resources allocated
+pub const IFF_NOARP: ::c_int = 0x0080; // no address resolution protocol
+pub const IFF_PROMISC: ::c_int = 0x0100; // receive all packets
+pub const IFF_ALLMULTI: ::c_int = 0x0200; // receive all multicast packets
+pub const IFF_OACTIVE: ::c_int = 0x0400; // transmission in progress
+pub const IFF_SIMPLEX: ::c_int = 0x0800; // can't hear own transmissions
+pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
+pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
+pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
+pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
+
+// sys/netinet/in.h
+// Protocols (RFC 1700)
+// NOTE: These are in addition to the constants defined in src/unix/mod.rs
+
+// IPPROTO_IP defined in src/unix/mod.rs
+/// Hop-by-hop option header
+pub const IPPROTO_HOPOPTS: ::c_int = 0;
+// IPPROTO_ICMP defined in src/unix/mod.rs
+/// group mgmt protocol
+pub const IPPROTO_IGMP: ::c_int = 2;
+/// gateway^2 (deprecated)
+pub const IPPROTO_GGP: ::c_int = 3;
+/// for compatibility
+pub const IPPROTO_IPIP: ::c_int = 4;
+// IPPROTO_TCP defined in src/unix/mod.rs
+/// exterior gateway protocol
+pub const IPPROTO_EGP: ::c_int = 8;
+/// pup
+pub const IPPROTO_PUP: ::c_int = 12;
+// IPPROTO_UDP defined in src/unix/mod.rs
+/// xns idp
+pub const IPPROTO_IDP: ::c_int = 22;
+/// tp-4 w/ class negotiation
+pub const IPPROTO_TP: ::c_int = 29;
+/// DCCP
+pub const IPPROTO_DCCP: ::c_int = 33;
+// IPPROTO_IPV6 defined in src/unix/mod.rs
+/// IP6 routing header
+pub const IPPROTO_ROUTING: ::c_int = 43;
+/// IP6 fragmentation header
+pub const IPPROTO_FRAGMENT: ::c_int = 44;
+/// resource reservation
+pub const IPPROTO_RSVP: ::c_int = 46;
+/// General Routing Encap.
+pub const IPPROTO_GRE: ::c_int = 47;
+/// IP6 Encap Sec. Payload
+pub const IPPROTO_ESP: ::c_int = 50;
+/// IP6 Auth Header
+pub const IPPROTO_AH: ::c_int = 51;
+/// IP Mobility RFC 2004
+pub const IPPROTO_MOBILE: ::c_int = 55;
+/// IPv6 ICMP
+pub const IPPROTO_IPV6_ICMP: ::c_int = 58;
+// IPPROTO_ICMPV6 defined in src/unix/mod.rs
+/// IP6 no next header
+pub const IPPROTO_NONE: ::c_int = 59;
+/// IP6 destination option
+pub const IPPROTO_DSTOPTS: ::c_int = 60;
+/// ISO cnlp
+pub const IPPROTO_EON: ::c_int = 80;
+/// Ethernet-in-IP
+pub const IPPROTO_ETHERIP: ::c_int = 97;
+/// encapsulation header
+pub const IPPROTO_ENCAP: ::c_int = 98;
+/// Protocol indep. multicast
+pub const IPPROTO_PIM: ::c_int = 103;
+/// IP Payload Comp. Protocol
+pub const IPPROTO_IPCOMP: ::c_int = 108;
+/// VRRP RFC 2338
+pub const IPPROTO_VRRP: ::c_int = 112;
+/// Common Address Resolution Protocol
+pub const IPPROTO_CARP: ::c_int = 112;
+/// L2TPv3
+pub const IPPROTO_L2TP: ::c_int = 115;
+/// SCTP
+pub const IPPROTO_SCTP: ::c_int = 132;
+/// PFSYNC
+pub const IPPROTO_PFSYNC: ::c_int = 240;
+pub const IPPROTO_MAX: ::c_int = 256;
+
+/// last return value of *_input(), meaning "all job for this pkt is done".
+pub const IPPROTO_DONE: ::c_int = 257;
+
+/// sysctl placeholder for (FAST_)IPSEC
+pub const CTL_IPPROTO_IPSEC: ::c_int = 258;
+
+pub const AF_OROUTE: ::c_int = 17;
+pub const AF_ARP: ::c_int = 28;
+pub const pseudo_AF_KEY: ::c_int = 29;
+pub const pseudo_AF_HDRCMPLT: ::c_int = 30;
+pub const AF_BLUETOOTH: ::c_int = 31;
+pub const AF_IEEE80211: ::c_int = 32;
+pub const AF_MPLS: ::c_int = 33;
+pub const AF_ROUTE: ::c_int = 34;
+pub const NET_RT_DUMP: ::c_int = 1;
+pub const NET_RT_FLAGS: ::c_int = 2;
+pub const NET_RT_OOOIFLIST: ::c_int = 3;
+pub const NET_RT_OOIFLIST: ::c_int = 4;
+pub const NET_RT_OIFLIST: ::c_int = 5;
+pub const NET_RT_IFLIST: ::c_int = 6;
+pub const NET_RT_MAXID: ::c_int = 7;
+
+pub const PF_OROUTE: ::c_int = AF_OROUTE;
+pub const PF_ARP: ::c_int = AF_ARP;
+pub const PF_KEY: ::c_int = pseudo_AF_KEY;
+pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
+pub const PF_MPLS: ::c_int = AF_MPLS;
+pub const PF_ROUTE: ::c_int = AF_ROUTE;
+
+pub const MSG_NBIO: ::c_int = 0x1000;
+pub const MSG_WAITFORONE: ::c_int = 0x2000;
+pub const MSG_NOTIFICATION: ::c_int = 0x4000;
+
+pub const SCM_TIMESTAMP: ::c_int = 0x08;
+pub const SCM_CREDS: ::c_int = 0x10;
+
+pub const O_DSYNC: ::c_int = 0x10000;
+
+pub const MAP_RENAME: ::c_int = 0x20;
+pub const MAP_NORESERVE: ::c_int = 0x40;
+pub const MAP_HASSEMAPHORE: ::c_int = 0x200;
+pub const MAP_TRYFIXED: ::c_int = 0x400;
+pub const MAP_WIRED: ::c_int = 0x800;
+pub const MAP_STACK: ::c_int = 0x2000;
+// map alignment aliases for MAP_ALIGNED
+pub const MAP_ALIGNMENT_SHIFT: ::c_int = 24;
+pub const MAP_ALIGNMENT_MASK: ::c_int = 0xff << MAP_ALIGNMENT_SHIFT;
+pub const MAP_ALIGNMENT_64KB: ::c_int = 16 << MAP_ALIGNMENT_SHIFT;
+pub const MAP_ALIGNMENT_16MB: ::c_int = 24 << MAP_ALIGNMENT_SHIFT;
+pub const MAP_ALIGNMENT_4GB: ::c_int = 32 << MAP_ALIGNMENT_SHIFT;
+pub const MAP_ALIGNMENT_1TB: ::c_int = 40 << MAP_ALIGNMENT_SHIFT;
+pub const MAP_ALIGNMENT_256TB: ::c_int = 48 << MAP_ALIGNMENT_SHIFT;
+pub const MAP_ALIGNMENT_64PB: ::c_int = 56 << MAP_ALIGNMENT_SHIFT;
+// mremap flag
+pub const MAP_REMAPDUP: ::c_int = 0x004;
+
+pub const DCCP_TYPE_REQUEST: ::c_int = 0;
+pub const DCCP_TYPE_RESPONSE: ::c_int = 1;
+pub const DCCP_TYPE_DATA: ::c_int = 2;
+pub const DCCP_TYPE_ACK: ::c_int = 3;
+pub const DCCP_TYPE_DATAACK: ::c_int = 4;
+pub const DCCP_TYPE_CLOSEREQ: ::c_int = 5;
+pub const DCCP_TYPE_CLOSE: ::c_int = 6;
+pub const DCCP_TYPE_RESET: ::c_int = 7;
+pub const DCCP_TYPE_MOVE: ::c_int = 8;
+
+pub const DCCP_FEATURE_CC: ::c_int = 1;
+pub const DCCP_FEATURE_ECN: ::c_int = 2;
+pub const DCCP_FEATURE_ACKRATIO: ::c_int = 3;
+pub const DCCP_FEATURE_ACKVECTOR: ::c_int = 4;
+pub const DCCP_FEATURE_MOBILITY: ::c_int = 5;
+pub const DCCP_FEATURE_LOSSWINDOW: ::c_int = 6;
+pub const DCCP_FEATURE_CONN_NONCE: ::c_int = 8;
+pub const DCCP_FEATURE_IDENTREG: ::c_int = 7;
+
+pub const DCCP_OPT_PADDING: ::c_int = 0;
+pub const DCCP_OPT_DATA_DISCARD: ::c_int = 1;
+pub const DCCP_OPT_SLOW_RECV: ::c_int = 2;
+pub const DCCP_OPT_BUF_CLOSED: ::c_int = 3;
+pub const DCCP_OPT_CHANGE_L: ::c_int = 32;
+pub const DCCP_OPT_CONFIRM_L: ::c_int = 33;
+pub const DCCP_OPT_CHANGE_R: ::c_int = 34;
+pub const DCCP_OPT_CONFIRM_R: ::c_int = 35;
+pub const DCCP_OPT_INIT_COOKIE: ::c_int = 36;
+pub const DCCP_OPT_NDP_COUNT: ::c_int = 37;
+pub const DCCP_OPT_ACK_VECTOR0: ::c_int = 38;
+pub const DCCP_OPT_ACK_VECTOR1: ::c_int = 39;
+pub const DCCP_OPT_RECV_BUF_DROPS: ::c_int = 40;
+pub const DCCP_OPT_TIMESTAMP: ::c_int = 41;
+pub const DCCP_OPT_TIMESTAMP_ECHO: ::c_int = 42;
+pub const DCCP_OPT_ELAPSEDTIME: ::c_int = 43;
+pub const DCCP_OPT_DATACHECKSUM: ::c_int = 44;
+
+pub const DCCP_REASON_UNSPEC: ::c_int = 0;
+pub const DCCP_REASON_CLOSED: ::c_int = 1;
+pub const DCCP_REASON_INVALID: ::c_int = 2;
+pub const DCCP_REASON_OPTION_ERR: ::c_int = 3;
+pub const DCCP_REASON_FEA_ERR: ::c_int = 4;
+pub const DCCP_REASON_CONN_REF: ::c_int = 5;
+pub const DCCP_REASON_BAD_SNAME: ::c_int = 6;
+pub const DCCP_REASON_BAD_COOKIE: ::c_int = 7;
+pub const DCCP_REASON_INV_MOVE: ::c_int = 8;
+pub const DCCP_REASON_UNANSW_CH: ::c_int = 10;
+pub const DCCP_REASON_FRUITLESS_NEG: ::c_int = 11;
+
+pub const DCCP_CCID: ::c_int = 1;
+pub const DCCP_CSLEN: ::c_int = 2;
+pub const DCCP_MAXSEG: ::c_int = 4;
+pub const DCCP_SERVICE: ::c_int = 8;
+
+pub const DCCP_NDP_LIMIT: ::c_int = 16;
+pub const DCCP_SEQ_NUM_LIMIT: ::c_int = 16777216;
+pub const DCCP_MAX_OPTIONS: ::c_int = 32;
+pub const DCCP_MAX_PKTS: ::c_int = 100;
+
+pub const _PC_LINK_MAX: ::c_int = 1;
+pub const _PC_MAX_CANON: ::c_int = 2;
+pub const _PC_MAX_INPUT: ::c_int = 3;
+pub const _PC_NAME_MAX: ::c_int = 4;
+pub const _PC_PATH_MAX: ::c_int = 5;
+pub const _PC_PIPE_BUF: ::c_int = 6;
+pub const _PC_CHOWN_RESTRICTED: ::c_int = 7;
+pub const _PC_NO_TRUNC: ::c_int = 8;
+pub const _PC_VDISABLE: ::c_int = 9;
+pub const _PC_SYNC_IO: ::c_int = 10;
+pub const _PC_FILESIZEBITS: ::c_int = 11;
+pub const _PC_SYMLINK_MAX: ::c_int = 12;
+pub const _PC_2_SYMLINKS: ::c_int = 13;
+pub const _PC_ACL_EXTENDED: ::c_int = 14;
+pub const _PC_MIN_HOLE_SIZE: ::c_int = 15;
+
+pub const _SC_SYNCHRONIZED_IO: ::c_int = 31;
+pub const _SC_IOV_MAX: ::c_int = 32;
+pub const _SC_MAPPED_FILES: ::c_int = 33;
+pub const _SC_MEMLOCK: ::c_int = 34;
+pub const _SC_MEMLOCK_RANGE: ::c_int = 35;
+pub const _SC_MEMORY_PROTECTION: ::c_int = 36;
+pub const _SC_LOGIN_NAME_MAX: ::c_int = 37;
+pub const _SC_MONOTONIC_CLOCK: ::c_int = 38;
+pub const _SC_CLK_TCK: ::c_int = 39;
+pub const _SC_ATEXIT_MAX: ::c_int = 40;
+pub const _SC_THREADS: ::c_int = 41;
+pub const _SC_SEMAPHORES: ::c_int = 42;
+pub const _SC_BARRIERS: ::c_int = 43;
+pub const _SC_TIMERS: ::c_int = 44;
+pub const _SC_SPIN_LOCKS: ::c_int = 45;
+pub const _SC_READER_WRITER_LOCKS: ::c_int = 46;
+pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 47;
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 48;
+pub const _SC_CLOCK_SELECTION: ::c_int = 49;
+pub const _SC_ASYNCHRONOUS_IO: ::c_int = 50;
+pub const _SC_AIO_LISTIO_MAX: ::c_int = 51;
+pub const _SC_AIO_MAX: ::c_int = 52;
+pub const _SC_MESSAGE_PASSING: ::c_int = 53;
+pub const _SC_MQ_OPEN_MAX: ::c_int = 54;
+pub const _SC_MQ_PRIO_MAX: ::c_int = 55;
+pub const _SC_PRIORITY_SCHEDULING: ::c_int = 56;
+pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 57;
+pub const _SC_THREAD_KEYS_MAX: ::c_int = 58;
+pub const _SC_THREAD_STACK_MIN: ::c_int = 59;
+pub const _SC_THREAD_THREADS_MAX: ::c_int = 60;
+pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 61;
+pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 62;
+pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 63;
+pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 64;
+pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 65;
+pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 66;
+pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 67;
+pub const _SC_TTY_NAME_MAX: ::c_int = 68;
+pub const _SC_HOST_NAME_MAX: ::c_int = 69;
+pub const _SC_PASS_MAX: ::c_int = 70;
+pub const _SC_REGEXP: ::c_int = 71;
+pub const _SC_SHELL: ::c_int = 72;
+pub const _SC_SYMLOOP_MAX: ::c_int = 73;
+pub const _SC_V6_ILP32_OFF32: ::c_int = 74;
+pub const _SC_V6_ILP32_OFFBIG: ::c_int = 75;
+pub const _SC_V6_LP64_OFF64: ::c_int = 76;
+pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 77;
+pub const _SC_2_PBS: ::c_int = 80;
+pub const _SC_2_PBS_ACCOUNTING: ::c_int = 81;
+pub const _SC_2_PBS_CHECKPOINT: ::c_int = 82;
+pub const _SC_2_PBS_LOCATE: ::c_int = 83;
+pub const _SC_2_PBS_MESSAGE: ::c_int = 84;
+pub const _SC_2_PBS_TRACK: ::c_int = 85;
+pub const _SC_SPAWN: ::c_int = 86;
+pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 87;
+pub const _SC_TIMER_MAX: ::c_int = 88;
+pub const _SC_SEM_NSEMS_MAX: ::c_int = 89;
+pub const _SC_CPUTIME: ::c_int = 90;
+pub const _SC_THREAD_CPUTIME: ::c_int = 91;
+pub const _SC_DELAYTIMER_MAX: ::c_int = 92;
+// These two variables will be supported in NetBSD 8.0
+// pub const _SC_SIGQUEUE_MAX : ::c_int = 93;
+// pub const _SC_REALTIME_SIGNALS : ::c_int = 94;
+pub const _SC_PHYS_PAGES: ::c_int = 121;
+pub const _SC_NPROCESSORS_CONF: ::c_int = 1001;
+pub const _SC_NPROCESSORS_ONLN: ::c_int = 1002;
+pub const _SC_SCHED_RT_TS: ::c_int = 2001;
+pub const _SC_SCHED_PRI_MIN: ::c_int = 2002;
+pub const _SC_SCHED_PRI_MAX: ::c_int = 2003;
+
+pub const FD_SETSIZE: usize = 0x100;
+
+pub const ST_NOSUID: ::c_ulong = 8;
+
+pub const BIOCGRSIG: ::c_ulong = 0x40044272;
+pub const BIOCSRSIG: ::c_ulong = 0x80044273;
+pub const BIOCSDLT: ::c_ulong = 0x80044278;
+pub const BIOCGSEESENT: ::c_ulong = 0x40044276;
+pub const BIOCSSEESENT: ::c_ulong = 0x80044277;
+
+// <sys/fstypes.h>
+pub const MNT_UNION: ::c_int = 0x00000020;
+pub const MNT_NOCOREDUMP: ::c_int = 0x00008000;
+pub const MNT_RELATIME: ::c_int = 0x00020000;
+pub const MNT_IGNORE: ::c_int = 0x00100000;
+pub const MNT_NFS4ACLS: ::c_int = 0x00200000;
+pub const MNT_DISCARD: ::c_int = 0x00800000;
+pub const MNT_EXTATTR: ::c_int = 0x01000000;
+pub const MNT_LOG: ::c_int = 0x02000000;
+pub const MNT_NOATIME: ::c_int = 0x04000000;
+pub const MNT_AUTOMOUNTED: ::c_int = 0x10000000;
+pub const MNT_SYMPERM: ::c_int = 0x20000000;
+pub const MNT_NODEVMTIME: ::c_int = 0x40000000;
+pub const MNT_SOFTDEP: ::c_int = 0x80000000;
+pub const MNT_POSIX1EACLS: ::c_int = 0x00000800;
+pub const MNT_ACLS: ::c_int = MNT_POSIX1EACLS;
+pub const MNT_WAIT: ::c_int = 1;
+pub const MNT_NOWAIT: ::c_int = 2;
+pub const MNT_LAZY: ::c_int = 3;
+
+//<sys/timex.h>
+pub const NTP_API: ::c_int = 4;
+pub const MAXPHASE: ::c_long = 500000000;
+pub const MAXFREQ: ::c_long = 500000;
+pub const MINSEC: ::c_int = 256;
+pub const MAXSEC: ::c_int = 2048;
+pub const NANOSECOND: ::c_long = 1000000000;
+pub const SCALE_PPM: ::c_int = 65;
+pub const MAXTC: ::c_int = 10;
+pub const MOD_OFFSET: ::c_uint = 0x0001;
+pub const MOD_FREQUENCY: ::c_uint = 0x0002;
+pub const MOD_MAXERROR: ::c_uint = 0x0004;
+pub const MOD_ESTERROR: ::c_uint = 0x0008;
+pub const MOD_STATUS: ::c_uint = 0x0010;
+pub const MOD_TIMECONST: ::c_uint = 0x0020;
+pub const MOD_PPSMAX: ::c_uint = 0x0040;
+pub const MOD_TAI: ::c_uint = 0x0080;
+pub const MOD_MICRO: ::c_uint = 0x1000;
+pub const MOD_NANO: ::c_uint = 0x2000;
+pub const MOD_CLKB: ::c_uint = 0x4000;
+pub const MOD_CLKA: ::c_uint = 0x8000;
+pub const STA_PLL: ::c_int = 0x0001;
+pub const STA_PPSFREQ: ::c_int = 0x0002;
+pub const STA_PPSTIME: ::c_int = 0x0004;
+pub const STA_FLL: ::c_int = 0x0008;
+pub const STA_INS: ::c_int = 0x0010;
+pub const STA_DEL: ::c_int = 0x0020;
+pub const STA_UNSYNC: ::c_int = 0x0040;
+pub const STA_FREQHOLD: ::c_int = 0x0080;
+pub const STA_PPSSIGNAL: ::c_int = 0x0100;
+pub const STA_PPSJITTER: ::c_int = 0x0200;
+pub const STA_PPSWANDER: ::c_int = 0x0400;
+pub const STA_PPSERROR: ::c_int = 0x0800;
+pub const STA_CLOCKERR: ::c_int = 0x1000;
+pub const STA_NANO: ::c_int = 0x2000;
+pub const STA_MODE: ::c_int = 0x4000;
+pub const STA_CLK: ::c_int = 0x8000;
+pub const STA_RONLY: ::c_int = STA_PPSSIGNAL
+    | STA_PPSJITTER
+    | STA_PPSWANDER
+    | STA_PPSERROR
+    | STA_CLOCKERR
+    | STA_NANO
+    | STA_MODE
+    | STA_CLK;
+pub const TIME_OK: ::c_int = 0;
+pub const TIME_INS: ::c_int = 1;
+pub const TIME_DEL: ::c_int = 2;
+pub const TIME_OOP: ::c_int = 3;
+pub const TIME_WAIT: ::c_int = 4;
+pub const TIME_ERROR: ::c_int = 5;
+
+pub const LITTLE_ENDIAN: ::c_int = 1234;
+pub const BIG_ENDIAN: ::c_int = 4321;
+
+pub const PL_EVENT_NONE: ::c_int = 0;
+pub const PL_EVENT_SIGNAL: ::c_int = 1;
+pub const PL_EVENT_SUSPENDED: ::c_int = 2;
+
+cfg_if! {
+    if #[cfg(any(target_arch = "sparc", target_arch = "sparc64",
+                 target_arch = "x86", target_arch = "x86_64"))] {
+        pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t
+          = pthread_mutex_t {
+            ptm_magic: 0x33330003,
+            ptm_errorcheck: 0,
+            ptm_pad1: [0; 3],
+            ptm_unused: 0,
+            ptm_pad2: [0; 3],
+            ptm_waiters: 0 as *mut _,
+            ptm_owner: 0,
+            ptm_recursed: 0,
+            ptm_spare2: 0 as *mut _,
+        };
+    } else {
+        pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t
+          = pthread_mutex_t {
+            ptm_magic: 0x33330003,
+            ptm_errorcheck: 0,
+            ptm_unused: 0,
+            ptm_waiters: 0 as *mut _,
+            ptm_owner: 0,
+            ptm_recursed: 0,
+            ptm_spare2: 0 as *mut _,
+        };
+    }
+}
+
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+    ptc_magic: 0x55550005,
+    ptc_lock: 0,
+    ptc_waiters_first: 0 as *mut _,
+    ptc_waiters_last: 0 as *mut _,
+    ptc_mutex: 0 as *mut _,
+    ptc_private: 0 as *mut _,
+};
+pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+    ptr_magic: 0x99990009,
+    ptr_interlock: 0,
+    ptr_rblocked_first: 0 as *mut _,
+    ptr_rblocked_last: 0 as *mut _,
+    ptr_wblocked_first: 0 as *mut _,
+    ptr_wblocked_last: 0 as *mut _,
+    ptr_nreaders: 0,
+    ptr_owner: 0,
+    ptr_private: 0 as *mut _,
+};
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
+pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
+pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
+
+pub const SCHED_NONE: ::c_int = -1;
+pub const SCHED_OTHER: ::c_int = 0;
+pub const SCHED_FIFO: ::c_int = 1;
+pub const SCHED_RR: ::c_int = 2;
+
+pub const EVFILT_AIO: u32 = 2;
+pub const EVFILT_PROC: u32 = 4;
+pub const EVFILT_READ: u32 = 0;
+pub const EVFILT_SIGNAL: u32 = 5;
+pub const EVFILT_TIMER: u32 = 6;
+pub const EVFILT_VNODE: u32 = 3;
+pub const EVFILT_WRITE: u32 = 1;
+pub const EVFILT_FS: u32 = 7;
+pub const EVFILT_USER: u32 = 8;
+pub const EVFILT_EMPTY: u32 = 9;
+
+pub const EV_ADD: u32 = 0x1;
+pub const EV_DELETE: u32 = 0x2;
+pub const EV_ENABLE: u32 = 0x4;
+pub const EV_DISABLE: u32 = 0x8;
+pub const EV_ONESHOT: u32 = 0x10;
+pub const EV_CLEAR: u32 = 0x20;
+pub const EV_RECEIPT: u32 = 0x40;
+pub const EV_DISPATCH: u32 = 0x80;
+pub const EV_FLAG1: u32 = 0x2000;
+pub const EV_ERROR: u32 = 0x4000;
+pub const EV_EOF: u32 = 0x8000;
+pub const EV_SYSFLAGS: u32 = 0xf000;
+
+pub const NOTE_TRIGGER: u32 = 0x01000000;
+pub const NOTE_FFNOP: u32 = 0x00000000;
+pub const NOTE_FFAND: u32 = 0x40000000;
+pub const NOTE_FFOR: u32 = 0x80000000;
+pub const NOTE_FFCOPY: u32 = 0xc0000000;
+pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
+pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
+pub const NOTE_LOWAT: u32 = 0x00000001;
+pub const NOTE_DELETE: u32 = 0x00000001;
+pub const NOTE_WRITE: u32 = 0x00000002;
+pub const NOTE_EXTEND: u32 = 0x00000004;
+pub const NOTE_ATTRIB: u32 = 0x00000008;
+pub const NOTE_LINK: u32 = 0x00000010;
+pub const NOTE_RENAME: u32 = 0x00000020;
+pub const NOTE_REVOKE: u32 = 0x00000040;
+pub const NOTE_EXIT: u32 = 0x80000000;
+pub const NOTE_FORK: u32 = 0x40000000;
+pub const NOTE_EXEC: u32 = 0x20000000;
+pub const NOTE_PDATAMASK: u32 = 0x000fffff;
+pub const NOTE_PCTRLMASK: u32 = 0xf0000000;
+pub const NOTE_TRACK: u32 = 0x00000001;
+pub const NOTE_TRACKERR: u32 = 0x00000002;
+pub const NOTE_CHILD: u32 = 0x00000004;
+pub const NOTE_MSECONDS: u32 = 0x00000000;
+pub const NOTE_SECONDS: u32 = 0x00000001;
+pub const NOTE_USECONDS: u32 = 0x00000002;
+pub const NOTE_NSECONDS: u32 = 0x00000003;
+pub const NOTE_ABSTIME: u32 = 0x000000010;
+
+pub const TMP_MAX: ::c_uint = 308915776;
+
+pub const AI_PASSIVE: ::c_int = 0x00000001;
+pub const AI_CANONNAME: ::c_int = 0x00000002;
+pub const AI_NUMERICHOST: ::c_int = 0x00000004;
+pub const AI_NUMERICSERV: ::c_int = 0x00000008;
+pub const AI_ADDRCONFIG: ::c_int = 0x00000400;
+pub const AI_SRV: ::c_int = 0x00000800;
+
+pub const NI_MAXHOST: ::socklen_t = 1025;
+pub const NI_MAXSERV: ::socklen_t = 32;
+
+pub const NI_NOFQDN: ::c_int = 0x00000001;
+pub const NI_NUMERICHOST: ::c_int = 0x000000002;
+pub const NI_NAMEREQD: ::c_int = 0x000000004;
+pub const NI_NUMERICSERV: ::c_int = 0x000000008;
+pub const NI_DGRAM: ::c_int = 0x00000010;
+pub const NI_WITHSCOPEID: ::c_int = 0x00000020;
+pub const NI_NUMERICSCOPE: ::c_int = 0x00000040;
+
+pub const RTLD_NOLOAD: ::c_int = 0x2000;
+pub const RTLD_LOCAL: ::c_int = 0x200;
+
+pub const CTL_MAXNAME: ::c_int = 12;
+pub const SYSCTL_NAMELEN: ::c_int = 32;
+pub const SYSCTL_DEFSIZE: ::c_int = 8;
+pub const CTLTYPE_NODE: ::c_int = 1;
+pub const CTLTYPE_INT: ::c_int = 2;
+pub const CTLTYPE_STRING: ::c_int = 3;
+pub const CTLTYPE_QUAD: ::c_int = 4;
+pub const CTLTYPE_STRUCT: ::c_int = 5;
+pub const CTLTYPE_BOOL: ::c_int = 6;
+pub const CTLFLAG_READONLY: ::c_int = 0x00000000;
+pub const CTLFLAG_READWRITE: ::c_int = 0x00000070;
+pub const CTLFLAG_ANYWRITE: ::c_int = 0x00000080;
+pub const CTLFLAG_PRIVATE: ::c_int = 0x00000100;
+pub const CTLFLAG_PERMANENT: ::c_int = 0x00000200;
+pub const CTLFLAG_OWNDATA: ::c_int = 0x00000400;
+pub const CTLFLAG_IMMEDIATE: ::c_int = 0x00000800;
+pub const CTLFLAG_HEX: ::c_int = 0x00001000;
+pub const CTLFLAG_ROOT: ::c_int = 0x00002000;
+pub const CTLFLAG_ANYNUMBER: ::c_int = 0x00004000;
+pub const CTLFLAG_HIDDEN: ::c_int = 0x00008000;
+pub const CTLFLAG_ALIAS: ::c_int = 0x00010000;
+pub const CTLFLAG_MMAP: ::c_int = 0x00020000;
+pub const CTLFLAG_OWNDESC: ::c_int = 0x00040000;
+pub const CTLFLAG_UNSIGNED: ::c_int = 0x00080000;
+pub const SYSCTL_VERS_MASK: ::c_int = 0xff000000;
+pub const SYSCTL_VERS_0: ::c_int = 0x00000000;
+pub const SYSCTL_VERS_1: ::c_int = 0x01000000;
+pub const SYSCTL_VERSION: ::c_int = SYSCTL_VERS_1;
+pub const CTL_EOL: ::c_int = -1;
+pub const CTL_QUERY: ::c_int = -2;
+pub const CTL_CREATE: ::c_int = -3;
+pub const CTL_CREATESYM: ::c_int = -4;
+pub const CTL_DESTROY: ::c_int = -5;
+pub const CTL_MMAP: ::c_int = -6;
+pub const CTL_DESCRIBE: ::c_int = -7;
+pub const CTL_UNSPEC: ::c_int = 0;
+pub const CTL_KERN: ::c_int = 1;
+pub const CTL_VM: ::c_int = 2;
+pub const CTL_VFS: ::c_int = 3;
+pub const CTL_NET: ::c_int = 4;
+pub const CTL_DEBUG: ::c_int = 5;
+pub const CTL_HW: ::c_int = 6;
+pub const CTL_MACHDEP: ::c_int = 7;
+pub const CTL_USER: ::c_int = 8;
+pub const CTL_DDB: ::c_int = 9;
+pub const CTL_PROC: ::c_int = 10;
+pub const CTL_VENDOR: ::c_int = 11;
+pub const CTL_EMUL: ::c_int = 12;
+pub const CTL_SECURITY: ::c_int = 13;
+pub const CTL_MAXID: ::c_int = 14;
+pub const KERN_OSTYPE: ::c_int = 1;
+pub const KERN_OSRELEASE: ::c_int = 2;
+pub const KERN_OSREV: ::c_int = 3;
+pub const KERN_VERSION: ::c_int = 4;
+pub const KERN_MAXVNODES: ::c_int = 5;
+pub const KERN_MAXPROC: ::c_int = 6;
+pub const KERN_MAXFILES: ::c_int = 7;
+pub const KERN_ARGMAX: ::c_int = 8;
+pub const KERN_SECURELVL: ::c_int = 9;
+pub const KERN_HOSTNAME: ::c_int = 10;
+pub const KERN_HOSTID: ::c_int = 11;
+pub const KERN_CLOCKRATE: ::c_int = 12;
+pub const KERN_VNODE: ::c_int = 13;
+pub const KERN_PROC: ::c_int = 14;
+pub const KERN_FILE: ::c_int = 15;
+pub const KERN_PROF: ::c_int = 16;
+pub const KERN_POSIX1: ::c_int = 17;
+pub const KERN_NGROUPS: ::c_int = 18;
+pub const KERN_JOB_CONTROL: ::c_int = 19;
+pub const KERN_SAVED_IDS: ::c_int = 20;
+pub const KERN_OBOOTTIME: ::c_int = 21;
+pub const KERN_DOMAINNAME: ::c_int = 22;
+pub const KERN_MAXPARTITIONS: ::c_int = 23;
+pub const KERN_RAWPARTITION: ::c_int = 24;
+pub const KERN_NTPTIME: ::c_int = 25;
+pub const KERN_TIMEX: ::c_int = 26;
+pub const KERN_AUTONICETIME: ::c_int = 27;
+pub const KERN_AUTONICEVAL: ::c_int = 28;
+pub const KERN_RTC_OFFSET: ::c_int = 29;
+pub const KERN_ROOT_DEVICE: ::c_int = 30;
+pub const KERN_MSGBUFSIZE: ::c_int = 31;
+pub const KERN_FSYNC: ::c_int = 32;
+pub const KERN_OLDSYSVMSG: ::c_int = 33;
+pub const KERN_OLDSYSVSEM: ::c_int = 34;
+pub const KERN_OLDSYSVSHM: ::c_int = 35;
+pub const KERN_OLDSHORTCORENAME: ::c_int = 36;
+pub const KERN_SYNCHRONIZED_IO: ::c_int = 37;
+pub const KERN_IOV_MAX: ::c_int = 38;
+pub const KERN_MBUF: ::c_int = 39;
+pub const KERN_MAPPED_FILES: ::c_int = 40;
+pub const KERN_MEMLOCK: ::c_int = 41;
+pub const KERN_MEMLOCK_RANGE: ::c_int = 42;
+pub const KERN_MEMORY_PROTECTION: ::c_int = 43;
+pub const KERN_LOGIN_NAME_MAX: ::c_int = 44;
+pub const KERN_DEFCORENAME: ::c_int = 45;
+pub const KERN_LOGSIGEXIT: ::c_int = 46;
+pub const KERN_PROC2: ::c_int = 47;
+pub const KERN_PROC_ARGS: ::c_int = 48;
+pub const KERN_FSCALE: ::c_int = 49;
+pub const KERN_CCPU: ::c_int = 50;
+pub const KERN_CP_TIME: ::c_int = 51;
+pub const KERN_OLDSYSVIPC_INFO: ::c_int = 52;
+pub const KERN_MSGBUF: ::c_int = 53;
+pub const KERN_CONSDEV: ::c_int = 54;
+pub const KERN_MAXPTYS: ::c_int = 55;
+pub const KERN_PIPE: ::c_int = 56;
+pub const KERN_MAXPHYS: ::c_int = 57;
+pub const KERN_SBMAX: ::c_int = 58;
+pub const KERN_TKSTAT: ::c_int = 59;
+pub const KERN_MONOTONIC_CLOCK: ::c_int = 60;
+pub const KERN_URND: ::c_int = 61;
+pub const KERN_LABELSECTOR: ::c_int = 62;
+pub const KERN_LABELOFFSET: ::c_int = 63;
+pub const KERN_LWP: ::c_int = 64;
+pub const KERN_FORKFSLEEP: ::c_int = 65;
+pub const KERN_POSIX_THREADS: ::c_int = 66;
+pub const KERN_POSIX_SEMAPHORES: ::c_int = 67;
+pub const KERN_POSIX_BARRIERS: ::c_int = 68;
+pub const KERN_POSIX_TIMERS: ::c_int = 69;
+pub const KERN_POSIX_SPIN_LOCKS: ::c_int = 70;
+pub const KERN_POSIX_READER_WRITER_LOCKS: ::c_int = 71;
+pub const KERN_DUMP_ON_PANIC: ::c_int = 72;
+pub const KERN_SOMAXKVA: ::c_int = 73;
+pub const KERN_ROOT_PARTITION: ::c_int = 74;
+pub const KERN_DRIVERS: ::c_int = 75;
+pub const KERN_BUF: ::c_int = 76;
+pub const KERN_FILE2: ::c_int = 77;
+pub const KERN_VERIEXEC: ::c_int = 78;
+pub const KERN_CP_ID: ::c_int = 79;
+pub const KERN_HARDCLOCK_TICKS: ::c_int = 80;
+pub const KERN_ARND: ::c_int = 81;
+pub const KERN_SYSVIPC: ::c_int = 82;
+pub const KERN_BOOTTIME: ::c_int = 83;
+pub const KERN_EVCNT: ::c_int = 84;
+pub const KERN_MAXID: ::c_int = 85;
+pub const KERN_PROC_ALL: ::c_int = 0;
+pub const KERN_PROC_PID: ::c_int = 1;
+pub const KERN_PROC_PGRP: ::c_int = 2;
+pub const KERN_PROC_SESSION: ::c_int = 3;
+pub const KERN_PROC_TTY: ::c_int = 4;
+pub const KERN_PROC_UID: ::c_int = 5;
+pub const KERN_PROC_RUID: ::c_int = 6;
+pub const KERN_PROC_GID: ::c_int = 7;
+pub const KERN_PROC_RGID: ::c_int = 8;
+pub const KERN_PROC_ARGV: ::c_int = 1;
+pub const KERN_PROC_NARGV: ::c_int = 2;
+pub const KERN_PROC_ENV: ::c_int = 3;
+pub const KERN_PROC_NENV: ::c_int = 4;
+pub const KERN_PROC_PATHNAME: ::c_int = 5;
+pub const VM_PROC: ::c_int = 16;
+pub const VM_PROC_MAP: ::c_int = 1;
+
+pub const EAI_AGAIN: ::c_int = 2;
+pub const EAI_BADFLAGS: ::c_int = 3;
+pub const EAI_FAIL: ::c_int = 4;
+pub const EAI_FAMILY: ::c_int = 5;
+pub const EAI_MEMORY: ::c_int = 6;
+pub const EAI_NODATA: ::c_int = 7;
+pub const EAI_NONAME: ::c_int = 8;
+pub const EAI_SERVICE: ::c_int = 9;
+pub const EAI_SOCKTYPE: ::c_int = 10;
+pub const EAI_SYSTEM: ::c_int = 11;
+pub const EAI_OVERFLOW: ::c_int = 14;
+
+pub const AIO_CANCELED: ::c_int = 1;
+pub const AIO_NOTCANCELED: ::c_int = 2;
+pub const AIO_ALLDONE: ::c_int = 3;
+pub const LIO_NOP: ::c_int = 0;
+pub const LIO_WRITE: ::c_int = 1;
+pub const LIO_READ: ::c_int = 2;
+pub const LIO_WAIT: ::c_int = 1;
+pub const LIO_NOWAIT: ::c_int = 0;
+
+pub const SIGEV_NONE: ::c_int = 0;
+pub const SIGEV_SIGNAL: ::c_int = 1;
+pub const SIGEV_THREAD: ::c_int = 2;
+
+pub const WSTOPPED: ::c_int = 0x00000002; // same as WUNTRACED
+pub const WCONTINUED: ::c_int = 0x00000010;
+pub const WEXITED: ::c_int = 0x000000020;
+pub const WNOWAIT: ::c_int = 0x00010000;
+
+pub const WALTSIG: ::c_int = 0x00000004;
+pub const WALLSIG: ::c_int = 0x00000008;
+pub const WTRAPPED: ::c_int = 0x00000040;
+pub const WNOZOMBIE: ::c_int = 0x00020000;
+
+pub const P_ALL: idtype_t = 0;
+pub const P_PID: idtype_t = 1;
+pub const P_PGID: idtype_t = 4;
+
+pub const UTIME_OMIT: c_long = 1073741822;
+pub const UTIME_NOW: c_long = 1073741823;
+
+pub const B460800: ::speed_t = 460800;
+pub const B921600: ::speed_t = 921600;
+
+pub const ONOCR: ::tcflag_t = 0x20;
+pub const ONLRET: ::tcflag_t = 0x40;
+pub const CDTRCTS: ::tcflag_t = 0x00020000;
+pub const CHWFLOW: ::tcflag_t = ::MDMBUF | ::CRTSCTS | ::CDTRCTS;
+
+// pub const _PATH_UTMPX: &[::c_char; 14] = b"/var/run/utmpx";
+// pub const _PATH_WTMPX: &[::c_char; 14] = b"/var/log/wtmpx";
+// pub const _PATH_LASTLOGX: &[::c_char; 17] = b"/var/log/lastlogx";
+// pub const _PATH_UTMP_UPDATE: &[::c_char; 24] = b"/usr/libexec/utmp_update";
+pub const UT_NAMESIZE: usize = 8;
+pub const UT_LINESIZE: usize = 8;
+pub const UT_HOSTSIZE: usize = 16;
+pub const _UTX_USERSIZE: usize = 32;
+pub const _UTX_LINESIZE: usize = 32;
+pub const _UTX_PADSIZE: usize = 40;
+pub const _UTX_IDSIZE: usize = 4;
+pub const _UTX_HOSTSIZE: usize = 256;
+pub const EMPTY: u16 = 0;
+pub const RUN_LVL: u16 = 1;
+pub const BOOT_TIME: u16 = 2;
+pub const OLD_TIME: u16 = 3;
+pub const NEW_TIME: u16 = 4;
+pub const INIT_PROCESS: u16 = 5;
+pub const LOGIN_PROCESS: u16 = 6;
+pub const USER_PROCESS: u16 = 7;
+pub const DEAD_PROCESS: u16 = 8;
+pub const ACCOUNTING: u16 = 9;
+pub const SIGNATURE: u16 = 10;
+pub const DOWN_TIME: u16 = 11;
+
+pub const SOCK_CLOEXEC: ::c_int = 0x10000000;
+pub const SOCK_NONBLOCK: ::c_int = 0x20000000;
+
+// Uncomment on next NetBSD release
+// pub const FIOSEEKDATA: ::c_ulong = 0xc0086661;
+// pub const FIOSEEKHOLE: ::c_ulong = 0xc0086662;
+pub const OFIOGETBMAP: ::c_ulong = 0xc004667a;
+pub const FIOGETBMAP: ::c_ulong = 0xc008667a;
+pub const FIONWRITE: ::c_ulong = 0x40046679;
+pub const FIONSPACE: ::c_ulong = 0x40046678;
+pub const FIBMAP: ::c_ulong = 0xc008667a;
+
+pub const SIGSTKSZ: ::size_t = 40960;
+
+pub const REG_ENOSYS: ::c_int = 17;
+
+pub const PT_DUMPCORE: ::c_int = 12;
+pub const PT_LWPINFO: ::c_int = 13;
+pub const PT_SYSCALL: ::c_int = 14;
+pub const PT_SYSCALLEMU: ::c_int = 15;
+pub const PT_SET_EVENT_MASK: ::c_int = 16;
+pub const PT_GET_EVENT_MASK: ::c_int = 17;
+pub const PT_GET_PROCESS_STATE: ::c_int = 18;
+pub const PT_SET_SIGINFO: ::c_int = 19;
+pub const PT_GET_SIGINFO: ::c_int = 20;
+pub const PT_RESUME: ::c_int = 21;
+pub const PT_SUSPEND: ::c_int = 23;
+pub const PT_STOP: ::c_int = 23;
+pub const PT_LWPSTATUS: ::c_int = 24;
+pub const PT_LWPNEXT: ::c_int = 25;
+pub const PT_SET_SIGPASS: ::c_int = 26;
+pub const PT_GET_SIGPASS: ::c_int = 27;
+pub const PT_FIRSTMACH: ::c_int = 32;
+pub const POSIX_SPAWN_RETURNERROR: ::c_int = 0x40;
+
+// Flags for chflags(2)
+pub const SF_APPEND: ::c_ulong = 0x00040000;
+pub const SF_ARCHIVED: ::c_ulong = 0x00010000;
+pub const SF_IMMUTABLE: ::c_ulong = 0x00020000;
+pub const SF_LOG: ::c_ulong = 0x00400000;
+pub const SF_SETTABLE: ::c_ulong = 0xffff0000;
+pub const SF_SNAPINVAL: ::c_ulong = 0x00800000;
+pub const SF_SNAPSHOT: ::c_ulong = 0x00200000;
+pub const UF_APPEND: ::c_ulong = 0x00000004;
+pub const UF_IMMUTABLE: ::c_ulong = 0x00000002;
+pub const UF_NODUMP: ::c_ulong = 0x00000001;
+pub const UF_OPAQUE: ::c_ulong = 0x00000008;
+pub const UF_SETTABLE: ::c_ulong = 0x0000ffff;
+
+// sys/sysctl.h
+pub const KVME_PROT_READ: ::c_int = 0x00000001;
+pub const KVME_PROT_WRITE: ::c_int = 0x00000002;
+pub const KVME_PROT_EXEC: ::c_int = 0x00000004;
+
+pub const KVME_FLAG_COW: ::c_int = 0x00000001;
+pub const KVME_FLAG_NEEDS_COPY: ::c_int = 0x00000002;
+pub const KVME_FLAG_NOCOREDUMP: ::c_int = 0x000000004;
+pub const KVME_FLAG_PAGEABLE: ::c_int = 0x000000008;
+pub const KVME_FLAG_GROWS_UP: ::c_int = 0x000000010;
+pub const KVME_FLAG_GROWS_DOWN: ::c_int = 0x000000020;
+
+pub const NGROUPS_MAX: ::c_int = 16;
+
+pub const KI_NGROUPS: ::c_int = 16;
+pub const KI_MAXCOMLEN: ::c_int = 24;
+pub const KI_WMESGLEN: ::c_int = 8;
+pub const KI_MAXLOGNAME: ::c_int = 24;
+pub const KI_MAXEMULLEN: ::c_int = 16;
+pub const KI_LNAMELEN: ::c_int = 20;
+
+// sys/lwp.h
+pub const LSIDL: ::c_int = 1;
+pub const LSRUN: ::c_int = 2;
+pub const LSSLEEP: ::c_int = 3;
+pub const LSSTOP: ::c_int = 4;
+pub const LSZOMB: ::c_int = 5;
+pub const LSONPROC: ::c_int = 7;
+pub const LSSUSPENDED: ::c_int = 8;
+
+// sys/xattr.h
+pub const XATTR_CREATE: ::c_int = 0x01;
+pub const XATTR_REPLACE: ::c_int = 0x02;
+// sys/extattr.h
+pub const EXTATTR_NAMESPACE_EMPTY: ::c_int = 0;
+
+// For getrandom()
+pub const GRND_NONBLOCK: ::c_uint = 0x1;
+pub const GRND_RANDOM: ::c_uint = 0x2;
+pub const GRND_INSECURE: ::c_uint = 0x4;
+
+// sys/reboot.h
+pub const RB_ASKNAME: ::c_int = 0x000000001;
+pub const RB_SINGLE: ::c_int = 0x000000002;
+pub const RB_NOSYNC: ::c_int = 0x000000004;
+pub const RB_HALT: ::c_int = 0x000000008;
+pub const RB_INITNAME: ::c_int = 0x000000010;
+pub const RB_KDB: ::c_int = 0x000000040;
+pub const RB_RDONLY: ::c_int = 0x000000080;
+pub const RB_DUMP: ::c_int = 0x000000100;
+pub const RB_MINIROOT: ::c_int = 0x000000200;
+pub const RB_STRING: ::c_int = 0x000000400;
+pub const RB_POWERDOWN: ::c_int = RB_HALT | 0x000000800;
+pub const RB_USERCONF: ::c_int = 0x000001000;
+
+cfg_if! {
+
+    if #[cfg(libc_const_extern_fn)] {
+        pub const fn MAP_ALIGNED(alignment: ::c_int) -> ::c_int {
+            alignment << MAP_ALIGNMENT_SHIFT
+        }
+    } else {
+        pub fn MAP_ALIGNED(alignment: ::c_int) -> ::c_int {
+            alignment << MAP_ALIGNMENT_SHIFT
+        }
+    }
+}
+
+const_fn! {
+    {const} fn _ALIGN(p: usize) -> usize {
+        (p + _ALIGNBYTES) & !_ALIGNBYTES
+    }
+}
+
+f! {
+    pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
+        (cmsg as *mut ::c_uchar)
+            .offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        _ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
+    }
+
+    pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
+        -> *mut ::cmsghdr
+    {
+        if cmsg.is_null() {
+            return ::CMSG_FIRSTHDR(mhdr);
+        };
+        let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)
+            + _ALIGN(::mem::size_of::<::cmsghdr>());
+        let max = (*mhdr).msg_control as usize
+            + (*mhdr).msg_controllen as usize;
+        if next > max {
+            0 as *mut ::cmsghdr
+        } else {
+            (cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize))
+                as *mut ::cmsghdr
+        }
+    }
+
+    pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
+        (_ALIGN(::mem::size_of::<::cmsghdr>()) + _ALIGN(length as usize))
+            as ::c_uint
+    }
+
+    // dirfd() is a macro on netbsd to access
+    // the first field of the struct where dirp points to:
+    // http://cvsweb.netbsd.org/bsdweb.cgi/src/include/dirent.h?rev=1.36
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int {
+        *(dirp as *const ::c_int)
+    }
+
+    pub fn SOCKCREDSIZE(ngrps: usize) -> usize {
+        let ngrps = if ngrps > 0 {
+            ngrps - 1
+        } else {
+            0
+        };
+        ::mem::size_of::<sockcred>() + ::mem::size_of::<::gid_t>() * ngrps
+    }
+
+    pub fn PROT_MPROTECT(x: ::c_int) -> ::c_int {
+        x << 3
+    }
+
+    pub fn PROT_MPROTECT_EXTRACT(x: ::c_int) -> ::c_int {
+        (x >> 3) & 0x7
+    }
+
+    pub fn major(dev: ::dev_t) -> ::c_int {
+        (((dev as u32) & 0x000fff00) >>  8) as ::c_int
+    }
+
+    pub fn minor(dev: ::dev_t) -> ::c_int {
+        let mut res = 0;
+        res |= ((dev as u32) & 0xfff00000) >> 12;
+        res |= (dev as u32) & 0x000000ff;
+        res as ::c_int
+    }
+}
+
+safe_f! {
+    pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
+        status >> 8
+    }
+
+    pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
+        (status & 0o177) != 0o177 && (status & 0o177) != 0
+    }
+
+    pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
+        (status & 0o177) == 0o177
+    }
+
+    pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
+        status == 0xffff
+    }
+
+    pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::dev_t;
+        let mut dev = 0;
+        dev |= (major << 8) & 0x000ff00;
+        dev |= (minor << 12) & 0xfff00000;
+        dev |= minor & 0xff;
+        dev
+    }
+}
+
+extern "C" {
+    pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
+    pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
+    pub fn clock_nanosleep(
+        clk_id: ::clockid_t,
+        flags: ::c_int,
+        rqtp: *const ::timespec,
+        rmtp: *mut ::timespec,
+    ) -> ::c_int;
+
+    pub fn reallocarr(ptr: *mut ::c_void, number: ::size_t, size: ::size_t) -> ::c_int;
+
+    pub fn chflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int;
+    pub fn fchflags(fd: ::c_int, flags: ::c_ulong) -> ::c_int;
+    pub fn lchflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int;
+
+    pub fn extattr_list_fd(
+        fd: ::c_int,
+        attrnamespace: ::c_int,
+        data: *mut ::c_void,
+        nbytes: ::size_t,
+    ) -> ::ssize_t;
+    pub fn extattr_list_file(
+        path: *const ::c_char,
+        attrnamespace: ::c_int,
+        data: *mut ::c_void,
+        nbytes: ::size_t,
+    ) -> ::ssize_t;
+    pub fn extattr_list_link(
+        path: *const ::c_char,
+        attrnamespace: ::c_int,
+        data: *mut ::c_void,
+        nbytes: ::size_t,
+    ) -> ::ssize_t;
+    pub fn extattr_delete_fd(
+        fd: ::c_int,
+        attrnamespace: ::c_int,
+        attrname: *const ::c_char,
+    ) -> ::c_int;
+    pub fn extattr_delete_file(
+        path: *const ::c_char,
+        attrnamespace: ::c_int,
+        attrname: *const ::c_char,
+    ) -> ::c_int;
+    pub fn extattr_delete_link(
+        path: *const ::c_char,
+        attrnamespace: ::c_int,
+        attrname: *const ::c_char,
+    ) -> ::c_int;
+    pub fn extattr_get_fd(
+        fd: ::c_int,
+        attrnamespace: ::c_int,
+        attrname: *const ::c_char,
+        data: *mut ::c_void,
+        nbytes: ::size_t,
+    ) -> ::ssize_t;
+    pub fn extattr_get_file(
+        path: *const ::c_char,
+        attrnamespace: ::c_int,
+        attrname: *const ::c_char,
+        data: *mut ::c_void,
+        nbytes: ::size_t,
+    ) -> ::ssize_t;
+    pub fn extattr_get_link(
+        path: *const ::c_char,
+        attrnamespace: ::c_int,
+        attrname: *const ::c_char,
+        data: *mut ::c_void,
+        nbytes: ::size_t,
+    ) -> ::ssize_t;
+    pub fn extattr_namespace_to_string(
+        attrnamespace: ::c_int,
+        string: *mut *mut ::c_char,
+    ) -> ::c_int;
+    pub fn extattr_set_fd(
+        fd: ::c_int,
+        attrnamespace: ::c_int,
+        attrname: *const ::c_char,
+        data: *const ::c_void,
+        nbytes: ::size_t,
+    ) -> ::c_int;
+    pub fn extattr_set_file(
+        path: *const ::c_char,
+        attrnamespace: ::c_int,
+        attrname: *const ::c_char,
+        data: *const ::c_void,
+        nbytes: ::size_t,
+    ) -> ::c_int;
+    pub fn extattr_set_link(
+        path: *const ::c_char,
+        attrnamespace: ::c_int,
+        attrname: *const ::c_char,
+        data: *const ::c_void,
+        nbytes: ::size_t,
+    ) -> ::c_int;
+    pub fn extattr_string_to_namespace(
+        string: *const ::c_char,
+        attrnamespace: *mut ::c_int,
+    ) -> ::c_int;
+
+    pub fn openpty(
+        amaster: *mut ::c_int,
+        aslave: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *mut ::termios,
+        winp: *mut ::winsize,
+    ) -> ::c_int;
+    pub fn forkpty(
+        amaster: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *mut ::termios,
+        winp: *mut ::winsize,
+    ) -> ::pid_t;
+
+    #[link_name = "__lutimes50"]
+    pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
+    #[link_name = "__gettimeofday50"]
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
+    pub fn getnameinfo(
+        sa: *const ::sockaddr,
+        salen: ::socklen_t,
+        host: *mut ::c_char,
+        hostlen: ::socklen_t,
+        serv: *mut ::c_char,
+        servlen: ::socklen_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+    pub fn sysctl(
+        name: *const ::c_int,
+        namelen: ::c_uint,
+        oldp: *mut ::c_void,
+        oldlenp: *mut ::size_t,
+        newp: *const ::c_void,
+        newlen: ::size_t,
+    ) -> ::c_int;
+    pub fn sysctlbyname(
+        name: *const ::c_char,
+        oldp: *mut ::c_void,
+        oldlenp: *mut ::size_t,
+        newp: *const ::c_void,
+        newlen: ::size_t,
+    ) -> ::c_int;
+    #[link_name = "__kevent50"]
+    pub fn kevent(
+        kq: ::c_int,
+        changelist: *const ::kevent,
+        nchanges: ::size_t,
+        eventlist: *mut ::kevent,
+        nevents: ::size_t,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    #[link_name = "__mount50"]
+    pub fn mount(
+        src: *const ::c_char,
+        target: *const ::c_char,
+        flags: ::c_int,
+        data: *mut ::c_void,
+        size: ::size_t,
+    ) -> ::c_int;
+    pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
+    pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
+    pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
+    pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int;
+    pub fn mq_receive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+    ) -> ::ssize_t;
+    pub fn mq_send(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+    ) -> ::c_int;
+    pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
+    #[link_name = "__mq_timedreceive50"]
+    pub fn mq_timedreceive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::ssize_t;
+    #[link_name = "__mq_timedsend50"]
+    pub fn mq_timedsend(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
+    pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_void, data: ::c_int) -> ::c_int;
+    pub fn utrace(label: *const ::c_char, addr: *mut ::c_void, len: ::size_t) -> ::c_int;
+    pub fn pthread_getname_np(t: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
+    pub fn pthread_setname_np(
+        t: ::pthread_t,
+        name: *const ::c_char,
+        arg: *const ::c_void,
+    ) -> ::c_int;
+    pub fn pthread_attr_get_np(thread: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
+    pub fn pthread_getattr_np(native: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
+    pub fn pthread_attr_getguardsize(
+        attr: *const ::pthread_attr_t,
+        guardsize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
+    pub fn pthread_attr_getstack(
+        attr: *const ::pthread_attr_t,
+        stackaddr: *mut *mut ::c_void,
+        stacksize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_getaffinity_np(
+        thread: ::pthread_t,
+        size: ::size_t,
+        set: *mut cpuset_t,
+    ) -> ::c_int;
+    pub fn pthread_setaffinity_np(
+        thread: ::pthread_t,
+        size: ::size_t,
+        set: *mut cpuset_t,
+    ) -> ::c_int;
+
+    pub fn _cpuset_create() -> *mut cpuset_t;
+    pub fn _cpuset_destroy(set: *mut cpuset_t);
+    pub fn _cpuset_clr(cpu: cpuid_t, set: *mut cpuset_t) -> ::c_int;
+    pub fn _cpuset_set(cpu: cpuid_t, set: *mut cpuset_t) -> ::c_int;
+    pub fn _cpuset_isset(cpu: cpuid_t, set: *const cpuset_t) -> ::c_int;
+    pub fn _cpuset_size(set: *const cpuset_t) -> ::size_t;
+    pub fn _cpuset_zero(set: *mut cpuset_t);
+    #[link_name = "__sigtimedwait50"]
+    pub fn sigtimedwait(
+        set: *const sigset_t,
+        info: *mut siginfo_t,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
+
+    pub fn duplocale(base: ::locale_t) -> ::locale_t;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn localeconv_l(loc: ::locale_t) -> *mut lconv;
+    pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+    #[link_name = "__settimeofday50"]
+    pub fn settimeofday(tv: *const ::timeval, tz: *const ::c_void) -> ::c_int;
+
+    pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
+
+    pub fn kqueue1(flags: ::c_int) -> ::c_int;
+
+    pub fn sendmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn recvmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_int,
+        timeout: *mut ::timespec,
+    ) -> ::c_int;
+
+    pub fn _lwp_self() -> lwpid_t;
+    pub fn memmem(
+        haystack: *const ::c_void,
+        haystacklen: ::size_t,
+        needle: *const ::c_void,
+        needlelen: ::size_t,
+    ) -> *mut ::c_void;
+
+    // link.h
+
+    pub fn dl_iterate_phdr(
+        callback: ::Option<
+            unsafe extern "C" fn(
+                info: *mut dl_phdr_info,
+                size: usize,
+                data: *mut ::c_void,
+            ) -> ::c_int,
+        >,
+        data: *mut ::c_void,
+    ) -> ::c_int;
+
+    // dlfcn.h
+
+    pub fn _dlauxinfo() -> *mut ::c_void;
+
+    pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
+    pub fn iconv(
+        cd: iconv_t,
+        inbuf: *mut *mut ::c_char,
+        inbytesleft: *mut ::size_t,
+        outbuf: *mut *mut ::c_char,
+        outbytesleft: *mut ::size_t,
+    ) -> ::size_t;
+    pub fn iconv_close(cd: iconv_t) -> ::c_int;
+
+    pub fn timer_create(
+        clockid: ::clockid_t,
+        sevp: *mut ::sigevent,
+        timerid: *mut ::timer_t,
+    ) -> ::c_int;
+    pub fn timer_delete(timerid: ::timer_t) -> ::c_int;
+    pub fn timer_getoverrun(timerid: ::timer_t) -> ::c_int;
+    pub fn timer_gettime(timerid: ::timer_t, curr_value: *mut ::itimerspec) -> ::c_int;
+    pub fn timer_settime(
+        timerid: ::timer_t,
+        flags: ::c_int,
+        new_value: *const ::itimerspec,
+        old_value: *mut ::itimerspec,
+    ) -> ::c_int;
+
+    // Added in `NetBSD` 7.0
+    pub fn explicit_memset(b: *mut ::c_void, c: ::c_int, len: ::size_t);
+    pub fn consttime_memequal(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int;
+
+    pub fn setproctitle(fmt: *const ::c_char, ...);
+    pub fn mremap(
+        oldp: *mut ::c_void,
+        oldsize: ::size_t,
+        newp: *mut ::c_void,
+        newsize: ::size_t,
+        flags: ::c_int,
+    ) -> *mut ::c_void;
+
+    pub fn sched_rr_get_interval(pid: ::pid_t, t: *mut ::timespec) -> ::c_int;
+    pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
+    pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int;
+    pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
+    pub fn sched_setscheduler(
+        pid: ::pid_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+
+    #[link_name = "__pollts50"]
+    pub fn pollts(
+        fds: *mut ::pollfd,
+        nfds: ::nfds_t,
+        ts: *const ::timespec,
+        sigmask: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn ppoll(
+        fds: *mut ::pollfd,
+        nfds: ::nfds_t,
+        ts: *const ::timespec,
+        sigmask: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+
+    pub fn reboot(mode: ::c_int, bootstr: *mut ::c_char) -> ::c_int;
+}
+
+#[link(name = "rt")]
+extern "C" {
+    pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
+    pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
+    #[link_name = "__aio_suspend50"]
+    pub fn aio_suspend(
+        aiocb_list: *const *const aiocb,
+        nitems: ::c_int,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+    pub fn lio_listio(
+        mode: ::c_int,
+        aiocb_list: *const *mut aiocb,
+        nitems: ::c_int,
+        sevp: *mut sigevent,
+    ) -> ::c_int;
+}
+
+#[link(name = "util")]
+extern "C" {
+    #[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
+    pub fn getpwent_r(
+        pwd: *mut ::passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::passwd,
+    ) -> ::c_int;
+    pub fn getgrent_r(
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+
+    pub fn updwtmpx(file: *const ::c_char, ut: *const utmpx) -> ::c_int;
+    pub fn getlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> *mut lastlogx;
+    pub fn updlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> ::c_int;
+    pub fn utmpxname(file: *const ::c_char) -> ::c_int;
+    pub fn getutxent() -> *mut utmpx;
+    pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
+    pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
+    pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
+    pub fn setutxent();
+    pub fn endutxent();
+
+    pub fn getutmp(ux: *const utmpx, u: *mut utmp);
+    pub fn getutmpx(u: *const utmp, ux: *mut utmpx);
+
+    pub fn utpname(file: *const ::c_char) -> ::c_int;
+    pub fn setutent();
+    pub fn endutent();
+    pub fn getutent() -> *mut utmp;
+
+    pub fn efopen(p: *const ::c_char, m: *const ::c_char) -> ::FILE;
+    pub fn emalloc(n: ::size_t) -> *mut ::c_void;
+    pub fn ecalloc(n: ::size_t, c: ::size_t) -> *mut ::c_void;
+    pub fn erealloc(p: *mut ::c_void, n: ::size_t) -> *mut ::c_void;
+    pub fn ereallocarr(p: *mut ::c_void, n: ::size_t, s: ::size_t);
+    pub fn estrdup(s: *const ::c_char) -> *mut ::c_char;
+    pub fn estrndup(s: *const ::c_char, len: ::size_t) -> *mut ::c_char;
+    pub fn estrlcpy(dst: *mut ::c_char, src: *const ::c_char, len: ::size_t) -> ::size_t;
+    pub fn estrlcat(dst: *mut ::c_char, src: *const ::c_char, len: ::size_t) -> ::size_t;
+    pub fn estrtoi(
+        nptr: *const ::c_char,
+        base: ::c_int,
+        lo: ::intmax_t,
+        hi: ::intmax_t,
+    ) -> ::intmax_t;
+    pub fn estrtou(
+        nptr: *const ::c_char,
+        base: ::c_int,
+        lo: ::uintmax_t,
+        hi: ::uintmax_t,
+    ) -> ::uintmax_t;
+    pub fn easprintf(string: *mut *mut ::c_char, fmt: *const ::c_char, ...) -> ::c_int;
+    pub fn evasprintf(string: *mut *mut ::c_char, fmt: *const ::c_char, ...) -> ::c_int;
+    pub fn esetfunc(
+        cb: ::Option<unsafe extern "C" fn(::c_int, *const ::c_char, ...)>,
+    ) -> ::Option<unsafe extern "C" fn(::c_int, *const ::c_char, ...)>;
+    pub fn secure_path(path: *const ::c_char) -> ::c_int;
+    pub fn snprintb(
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        fmt: *const ::c_char,
+        val: u64,
+    ) -> ::c_int;
+    pub fn snprintb_m(
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        fmt: *const ::c_char,
+        val: u64,
+        max: ::size_t,
+    ) -> ::c_int;
+
+    pub fn getbootfile() -> *const ::c_char;
+    pub fn getbyteorder() -> ::c_int;
+    pub fn getdiskrawname(
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        name: *const ::c_char,
+    ) -> *const ::c_char;
+    pub fn getdiskcookedname(
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        name: *const ::c_char,
+    ) -> *const ::c_char;
+    pub fn getfsspecname(
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        spec: *const ::c_char,
+    ) -> *const ::c_char;
+
+    pub fn strpct(
+        buf: *mut ::c_char,
+        bufsiz: ::size_t,
+        numerator: ::uintmax_t,
+        denominator: ::uintmax_t,
+        precision: ::size_t,
+    ) -> *mut ::c_char;
+    pub fn strspct(
+        buf: *mut ::c_char,
+        bufsiz: ::size_t,
+        numerator: ::intmax_t,
+        denominator: ::intmax_t,
+        precision: ::size_t,
+    ) -> *mut ::c_char;
+    #[link_name = "__login50"]
+    pub fn login(ut: *const utmp);
+    #[link_name = "__loginx50"]
+    pub fn loginx(ut: *const utmpx);
+    pub fn logout(line: *const ::c_char);
+    pub fn logoutx(line: *const ::c_char, status: ::c_int, tpe: ::c_int);
+    pub fn logwtmp(line: *const ::c_char, name: *const ::c_char, host: *const ::c_char);
+    pub fn logwtmpx(
+        line: *const ::c_char,
+        name: *const ::c_char,
+        host: *const ::c_char,
+        status: ::c_int,
+        tpe: ::c_int,
+    );
+
+    pub fn getxattr(
+        path: *const ::c_char,
+        name: *const ::c_char,
+        value: *mut ::c_void,
+        size: ::size_t,
+    ) -> ::ssize_t;
+    pub fn lgetxattr(
+        path: *const ::c_char,
+        name: *const ::c_char,
+        value: *mut ::c_void,
+        size: ::size_t,
+    ) -> ::ssize_t;
+    pub fn fgetxattr(
+        filedes: ::c_int,
+        name: *const ::c_char,
+        value: *mut ::c_void,
+        size: ::size_t,
+    ) -> ::ssize_t;
+    pub fn setxattr(
+        path: *const ::c_char,
+        name: *const ::c_char,
+        value: *const ::c_void,
+        size: ::size_t,
+    ) -> ::c_int;
+    pub fn lsetxattr(
+        path: *const ::c_char,
+        name: *const ::c_char,
+        value: *const ::c_void,
+        size: ::size_t,
+    ) -> ::c_int;
+    pub fn fsetxattr(
+        filedes: ::c_int,
+        name: *const ::c_char,
+        value: *const ::c_void,
+        size: ::size_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn listxattr(path: *const ::c_char, list: *mut ::c_char, size: ::size_t) -> ::ssize_t;
+    pub fn llistxattr(path: *const ::c_char, list: *mut ::c_char, size: ::size_t) -> ::ssize_t;
+    pub fn flistxattr(filedes: ::c_int, list: *mut ::c_char, size: ::size_t) -> ::ssize_t;
+    pub fn removexattr(path: *const ::c_char, name: *const ::c_char) -> ::c_int;
+    pub fn lremovexattr(path: *const ::c_char, name: *const ::c_char) -> ::c_int;
+    pub fn fremovexattr(fd: ::c_int, path: *const ::c_char, name: *const ::c_char) -> ::c_int;
+
+    pub fn string_to_flags(
+        string_p: *mut *mut ::c_char,
+        setp: *mut ::c_ulong,
+        clrp: *mut ::c_ulong,
+    ) -> ::c_int;
+    pub fn flags_to_string(flags: ::c_ulong, def: *const ::c_char) -> ::c_int;
+
+    pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::size_t) -> *mut kinfo_vmentry;
+}
+
+#[link(name = "execinfo")]
+extern "C" {
+    pub fn backtrace(addrlist: *mut *mut ::c_void, len: ::size_t) -> ::size_t;
+    pub fn backtrace_symbols(addrlist: *const *mut ::c_void, len: ::size_t) -> *mut *mut ::c_char;
+    pub fn backtrace_symbols_fd(
+        addrlist: *const *mut ::c_void,
+        len: ::size_t,
+        fd: ::c_int,
+    ) -> ::c_int;
+    pub fn backtrace_symbols_fmt(
+        addrlist: *const *mut ::c_void,
+        len: ::size_t,
+        fmt: *const ::c_char,
+    ) -> *mut *mut ::c_char;
+    pub fn backtrace_symbols_fd_fmt(
+        addrlist: *const *mut ::c_void,
+        len: ::size_t,
+        fd: ::c_int,
+        fmt: *const ::c_char,
+    ) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        extern {
+            // these functions use statvfs:
+            pub fn getmntinfo(mntbufp: *mut *mut ::statvfs, flags: ::c_int) -> ::c_int;
+            pub fn getvfsstat(buf: *mut statvfs, bufsize: ::size_t, flags: ::c_int) -> ::c_int;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "aarch64")] {
+        mod aarch64;
+        pub use self::aarch64::*;
+    } else if #[cfg(target_arch = "arm")] {
+        mod arm;
+        pub use self::arm::*;
+    } else if #[cfg(target_arch = "powerpc")] {
+        mod powerpc;
+        pub use self::powerpc::*;
+    } else if #[cfg(target_arch = "sparc64")] {
+        mod sparc64;
+        pub use self::sparc64::*;
+    } else if #[cfg(target_arch = "x86_64")] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    } else if #[cfg(target_arch = "x86")] {
+        mod x86;
+        pub use self::x86::*;
+    } else if #[cfg(target_arch = "mips")] {
+        mod mips;
+        pub use self::mips::*;
+    } else if #[cfg(target_arch = "riscv64")] {
+        mod riscv64;
+        pub use self::riscv64::*;
+    } else {
+        // Unknown target_arch
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/powerpc.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/powerpc.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/powerpc.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/powerpc.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,21 @@
+use PT_FIRSTMACH;
+
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type c_char = u8;
+pub type __cpu_simple_lock_nv_t = ::c_int;
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0;
+pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
+pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/riscv64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/riscv64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/riscv64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/riscv64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,21 @@
+use PT_FIRSTMACH;
+
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = u8;
+pub type __cpu_simple_lock_nv_t = ::c_int;
+
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 0;
+pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 1;
+pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 2;
+pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 3;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/sparc64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/sparc64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/sparc64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/sparc64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,8 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = i8;
+pub type __cpu_simple_lock_nv_t = ::c_uchar;
+
+// should be pub(crate), but that requires Rust 1.18.0
+#[doc(hidden)]
+pub const _ALIGNBYTES: usize = 0xf;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,15 @@
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type c_char = i8;
+pub type __cpu_simple_lock_nv_t = ::c_uchar;
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 4 - 1;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86_64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86_64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,67 @@
+use PT_FIRSTMACH;
+
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = i8;
+pub type c___greg_t = u64;
+pub type __cpu_simple_lock_nv_t = ::c_uchar;
+
+s! {
+    pub struct mcontext_t {
+        pub __gregs: [c___greg_t; 26],
+        pub _mc_tlsbase: c___greg_t,
+        pub __fpregs: [[::c_char;32]; 16],
+    }
+
+    pub struct ucontext_t {
+        pub uc_flags: ::c_uint,
+        pub uc_link: *mut ::ucontext_t,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_stack: ::stack_t,
+        pub uc_mcontext: ::mcontext_t,
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0;
+pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
+pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
+pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
+pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;
+
+pub const _REG_RDI: ::c_int = 0;
+pub const _REG_RSI: ::c_int = 1;
+pub const _REG_RDX: ::c_int = 2;
+pub const _REG_RCX: ::c_int = 3;
+pub const _REG_R8: ::c_int = 4;
+pub const _REG_R9: ::c_int = 5;
+pub const _REG_R10: ::c_int = 6;
+pub const _REG_R11: ::c_int = 7;
+pub const _REG_R12: ::c_int = 8;
+pub const _REG_R13: ::c_int = 9;
+pub const _REG_R14: ::c_int = 10;
+pub const _REG_R15: ::c_int = 11;
+pub const _REG_RBP: ::c_int = 12;
+pub const _REG_RBX: ::c_int = 13;
+pub const _REG_RAX: ::c_int = 14;
+pub const _REG_GS: ::c_int = 15;
+pub const _REG_FS: ::c_int = 16;
+pub const _REG_ES: ::c_int = 17;
+pub const _REG_DS: ::c_int = 18;
+pub const _REG_TRAPNO: ::c_int = 19;
+pub const _REG_ERR: ::c_int = 20;
+pub const _REG_RIP: ::c_int = 21;
+pub const _REG_CS: ::c_int = 22;
+pub const _REG_RFLAGS: ::c_int = 23;
+pub const _REG_RSP: ::c_int = 24;
+pub const _REG_SS: ::c_int = 25;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,30 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = u8;
+pub type ucontext_t = sigcontext;
+
+s! {
+    pub struct sigcontext {
+        __sc_unused: ::c_int,
+        pub sc_mask: ::c_int,
+        pub sc_sp: ::c_ulong,
+        pub sc_lr: ::c_ulong,
+        pub sc_elr: ::c_ulong,
+        pub sc_spsr: ::c_ulong,
+        pub sc_x: [::c_ulong; 30],
+        pub sc_cookie: ::c_long,
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+pub const _MAX_PAGE_SHIFT: u32 = 12;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/arm.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/arm.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/arm.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/arm.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,16 @@
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type c_char = u8;
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+pub const _MAX_PAGE_SHIFT: u32 = 12;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/mips64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/mips64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/mips64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/mips64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,8 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = i8;
+
+#[doc(hidden)]
+pub const _ALIGNBYTES: usize = 7;
+
+pub const _MAX_PAGE_SHIFT: u32 = 14;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,2209 @@
+use unix::bsd::O_SYNC;
+
+pub type clock_t = i64;
+pub type suseconds_t = ::c_long;
+pub type dev_t = i32;
+pub type sigset_t = ::c_uint;
+pub type blksize_t = i32;
+pub type fsblkcnt_t = u64;
+pub type fsfilcnt_t = u64;
+pub type idtype_t = ::c_uint;
+pub type pthread_attr_t = *mut ::c_void;
+pub type pthread_mutex_t = *mut ::c_void;
+pub type pthread_mutexattr_t = *mut ::c_void;
+pub type pthread_cond_t = *mut ::c_void;
+pub type pthread_condattr_t = *mut ::c_void;
+pub type pthread_rwlock_t = *mut ::c_void;
+pub type pthread_rwlockattr_t = *mut ::c_void;
+pub type pthread_spinlock_t = ::uintptr_t;
+pub type caddr_t = *mut ::c_char;
+
+// elf.h
+
+pub type Elf32_Addr = u32;
+pub type Elf32_Half = u16;
+pub type Elf32_Lword = u64;
+pub type Elf32_Off = u32;
+pub type Elf32_Sword = i32;
+pub type Elf32_Word = u32;
+
+pub type Elf64_Addr = u64;
+pub type Elf64_Half = u16;
+pub type Elf64_Lword = u64;
+pub type Elf64_Off = u64;
+pub type Elf64_Sword = i32;
+pub type Elf64_Sxword = i64;
+pub type Elf64_Word = u32;
+pub type Elf64_Xword = u64;
+
+// search.h
+
+pub type ENTRY = entry;
+pub type ACTION = ::c_uint;
+
+// spawn.h
+pub type posix_spawnattr_t = *mut ::c_void;
+pub type posix_spawn_file_actions_t = *mut ::c_void;
+
+cfg_if! {
+    if #[cfg(target_pointer_width = "64")] {
+        type Elf_Addr = Elf64_Addr;
+        type Elf_Half = Elf64_Half;
+        type Elf_Phdr = Elf64_Phdr;
+    } else if #[cfg(target_pointer_width = "32")] {
+        type Elf_Addr = Elf32_Addr;
+        type Elf_Half = Elf32_Half;
+        type Elf_Phdr = Elf32_Phdr;
+    }
+}
+
+s! {
+    pub struct ip_mreqn {
+        pub imr_multiaddr: in_addr,
+        pub imr_address: in_addr,
+        pub imr_ifindex: ::c_int,
+    }
+
+    pub struct glob_t {
+        pub gl_pathc:   ::size_t,
+        pub gl_matchc:  ::size_t,
+        pub gl_offs:    ::size_t,
+        pub gl_flags:   ::c_int,
+        pub gl_pathv:   *mut *mut ::c_char,
+        __unused1: *mut ::c_void,
+        __unused2: *mut ::c_void,
+        __unused3: *mut ::c_void,
+        __unused4: *mut ::c_void,
+        __unused5: *mut ::c_void,
+        __unused6: *mut ::c_void,
+        __unused7: *mut ::c_void,
+    }
+
+    pub struct lconv {
+        pub decimal_point: *mut ::c_char,
+        pub thousands_sep: *mut ::c_char,
+        pub grouping: *mut ::c_char,
+        pub int_curr_symbol: *mut ::c_char,
+        pub currency_symbol: *mut ::c_char,
+        pub mon_decimal_point: *mut ::c_char,
+        pub mon_thousands_sep: *mut ::c_char,
+        pub mon_grouping: *mut ::c_char,
+        pub positive_sign: *mut ::c_char,
+        pub negative_sign: *mut ::c_char,
+        pub int_frac_digits: ::c_char,
+        pub frac_digits: ::c_char,
+        pub p_cs_precedes: ::c_char,
+        pub p_sep_by_space: ::c_char,
+        pub n_cs_precedes: ::c_char,
+        pub n_sep_by_space: ::c_char,
+        pub p_sign_posn: ::c_char,
+        pub n_sign_posn: ::c_char,
+        pub int_p_cs_precedes: ::c_char,
+        pub int_p_sep_by_space: ::c_char,
+        pub int_n_cs_precedes: ::c_char,
+        pub int_n_sep_by_space: ::c_char,
+        pub int_p_sign_posn: ::c_char,
+        pub int_n_sign_posn: ::c_char,
+    }
+
+    pub struct ufs_args {
+        pub fspec: *mut ::c_char,
+        pub export_info: export_args,
+    }
+
+    pub struct mfs_args {
+        pub fspec: *mut ::c_char,
+        pub export_info: export_args,
+        // https://github.com/openbsd/src/blob/HEAD/sys/sys/types.h#L134
+        pub base: *mut ::c_char,
+        pub size: ::c_ulong,
+    }
+
+    pub struct iso_args {
+        pub fspec: *mut ::c_char,
+        pub export_info: export_args,
+        pub flags: ::c_int,
+        pub sess: ::c_int,
+    }
+
+    pub struct nfs_args {
+        pub version: ::c_int,
+        pub addr: *mut ::sockaddr,
+        pub addrlen: ::c_int,
+        pub sotype: ::c_int,
+        pub proto: ::c_int,
+        pub fh: *mut ::c_uchar,
+        pub fhsize: ::c_int,
+        pub flags: ::c_int,
+        pub wsize: ::c_int,
+        pub rsize: ::c_int,
+        pub readdirsize: ::c_int,
+        pub timeo: ::c_int,
+        pub retrans: ::c_int,
+        pub maxgrouplist: ::c_int,
+        pub readahead: ::c_int,
+        pub leaseterm: ::c_int,
+        pub deadthresh: ::c_int,
+        pub hostname: *mut ::c_char,
+        pub acregmin: ::c_int,
+        pub acregmax: ::c_int,
+        pub acdirmin: ::c_int,
+        pub acdirmax: ::c_int,
+    }
+
+    pub struct msdosfs_args {
+        pub fspec: *mut ::c_char,
+        pub export_info: export_args,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub mask: ::mode_t,
+        pub flags: ::c_int,
+    }
+
+    pub struct ntfs_args {
+        pub fspec: *mut ::c_char,
+        pub export_info: export_args,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub mode: ::mode_t,
+        pub flag: ::c_ulong,
+    }
+
+    pub struct udf_args {
+        pub fspec: *mut ::c_char,
+        pub lastblock: u32,
+    }
+
+    pub struct tmpfs_args {
+        pub ta_version: ::c_int,
+        pub ta_nodes_max: ::ino_t,
+        pub ta_size_max: ::off_t,
+        pub ta_root_uid: ::uid_t,
+        pub ta_root_gid: ::gid_t,
+        pub ta_root_mode: ::mode_t,
+    }
+
+    pub struct fusefs_args {
+        pub name: *mut ::c_char,
+        pub fd: ::c_int,
+        pub max_read: ::c_int,
+        pub allow_other: ::c_int,
+    }
+
+    pub struct xucred {
+        pub cr_uid: ::uid_t,
+        pub cr_gid: ::gid_t,
+        pub cr_ngroups: ::c_short,
+        //https://github.com/openbsd/src/blob/HEAD/sys/sys/syslimits.h#L44
+        pub cr_groups: [::gid_t; 16],
+    }
+
+    pub struct export_args {
+        pub ex_flags: ::c_int,
+        pub ex_root: ::uid_t,
+        pub ex_anon: xucred,
+        pub ex_addr: *mut ::sockaddr,
+        pub ex_addrlen: ::c_int,
+        pub ex_mask: *mut ::sockaddr,
+        pub ex_masklen: ::c_int,
+    }
+
+    pub struct ip_mreq {
+        pub imr_multiaddr: in_addr,
+        pub imr_interface: in_addr,
+    }
+
+    pub struct in_addr {
+        pub s_addr: ::in_addr_t,
+    }
+
+    pub struct sockaddr_in {
+        pub sin_len: u8,
+        pub sin_family: ::sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [i8; 8],
+    }
+
+    pub struct splice {
+        pub sp_fd: ::c_int,
+        pub sp_max: ::off_t,
+        pub sp_idle: ::timeval,
+    }
+
+    pub struct kevent {
+        pub ident: ::uintptr_t,
+        pub filter: ::c_short,
+        pub flags: ::c_ushort,
+        pub fflags: ::c_uint,
+        pub data: i64,
+        pub udata: *mut ::c_void,
+    }
+
+    pub struct stat {
+        pub st_mode: ::mode_t,
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_size: ::off_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_blksize: ::blksize_t,
+        pub st_flags: u32,
+        pub st_gen: u32,
+        pub st_birthtime: ::time_t,
+        pub st_birthtime_nsec: ::c_long,
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+    }
+
+    pub struct addrinfo {
+        pub ai_flags: ::c_int,
+        pub ai_family: ::c_int,
+        pub ai_socktype: ::c_int,
+        pub ai_protocol: ::c_int,
+        pub ai_addrlen: ::socklen_t,
+        pub ai_addr: *mut ::sockaddr,
+        pub ai_canonname: *mut ::c_char,
+        pub ai_next: *mut ::addrinfo,
+    }
+
+    pub struct Dl_info {
+        pub dli_fname: *const ::c_char,
+        pub dli_fbase: *mut ::c_void,
+        pub dli_sname: *const ::c_char,
+        pub dli_saddr: *mut ::c_void,
+    }
+
+    pub struct if_data {
+        pub ifi_type: ::c_uchar,
+        pub ifi_addrlen: ::c_uchar,
+        pub ifi_hdrlen: ::c_uchar,
+        pub ifi_link_state: ::c_uchar,
+        pub ifi_mtu: u32,
+        pub ifi_metric: u32,
+        pub ifi_rdomain: u32,
+        pub ifi_baudrate: u64,
+        pub ifi_ipackets: u64,
+        pub ifi_ierrors: u64,
+        pub ifi_opackets: u64,
+        pub ifi_oerrors: u64,
+        pub ifi_collisions: u64,
+        pub ifi_ibytes: u64,
+        pub ifi_obytes: u64,
+        pub ifi_imcasts: u64,
+        pub ifi_omcasts: u64,
+        pub ifi_iqdrops: u64,
+        pub ifi_oqdrops: u64,
+        pub ifi_noproto: u64,
+        pub ifi_capabilities: u32,
+        pub ifi_lastchange: ::timeval,
+    }
+
+    pub struct if_msghdr {
+        pub ifm_msglen: ::c_ushort,
+        pub ifm_version: ::c_uchar,
+        pub ifm_type: ::c_uchar,
+        pub ifm_hdrlen: ::c_ushort,
+        pub ifm_index: ::c_ushort,
+        pub ifm_tableid: ::c_ushort,
+        pub ifm_pad1: ::c_uchar,
+        pub ifm_pad2: ::c_uchar,
+        pub ifm_addrs: ::c_int,
+        pub ifm_flags: ::c_int,
+        pub ifm_xflags: ::c_int,
+        pub ifm_data: if_data,
+    }
+
+    pub struct sockaddr_dl {
+        pub sdl_len: ::c_uchar,
+        pub sdl_family: ::c_uchar,
+        pub sdl_index: ::c_ushort,
+        pub sdl_type: ::c_uchar,
+        pub sdl_nlen: ::c_uchar,
+        pub sdl_alen: ::c_uchar,
+        pub sdl_slen: ::c_uchar,
+        pub sdl_data: [::c_char; 24],
+    }
+
+    pub struct sockpeercred {
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub pid: ::pid_t,
+    }
+
+    pub struct arphdr {
+        pub ar_hrd: u16,
+        pub ar_pro: u16,
+        pub ar_hln: u8,
+        pub ar_pln: u8,
+        pub ar_op: u16,
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::c_int,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: ::c_short,
+        pub shm_atime: ::time_t,
+        __shm_atimensec: c_long,
+        pub shm_dtime: ::time_t,
+        __shm_dtimensec: c_long,
+        pub shm_ctime: ::time_t,
+        __shm_ctimensec: c_long,
+        pub shm_internal: *mut ::c_void,
+    }
+
+    // elf.h
+    pub struct Elf32_Phdr {
+        pub p_type: Elf32_Word,
+        pub p_offset: Elf32_Off,
+        pub p_vaddr: Elf32_Addr,
+        pub p_paddr: Elf32_Addr,
+        pub p_filesz: Elf32_Word,
+        pub p_memsz: Elf32_Word,
+        pub p_flags: Elf32_Word,
+        pub p_align: Elf32_Word,
+    }
+
+    pub struct Elf64_Phdr {
+        pub p_type: Elf64_Word,
+        pub p_flags: Elf64_Word,
+        pub p_offset: Elf64_Off,
+        pub p_vaddr: Elf64_Addr,
+        pub p_paddr: Elf64_Addr,
+        pub p_filesz: Elf64_Xword,
+        pub p_memsz: Elf64_Xword,
+        pub p_align: Elf64_Xword,
+    }
+
+    // link.h
+
+    pub struct dl_phdr_info {
+        pub dlpi_addr: Elf_Addr,
+        pub dlpi_name: *const ::c_char,
+        pub dlpi_phdr: *const Elf_Phdr,
+        pub dlpi_phnum: Elf_Half,
+    }
+
+    // sys/sysctl.h
+    pub struct kinfo_proc {
+        pub p_forw: u64,
+        pub p_back: u64,
+        pub p_paddr: u64,
+        pub p_addr: u64,
+        pub p_fd: u64,
+        pub p_stats: u64,
+        pub p_limit: u64,
+        pub p_vmspace: u64,
+        pub p_sigacts: u64,
+        pub p_sess: u64,
+        pub p_tsess: u64,
+        pub p_ru: u64,
+        pub p_eflag: i32,
+        pub p_exitsig: i32,
+        pub p_flag: i32,
+        pub p_pid: i32,
+        pub p_ppid: i32,
+        pub p_sid: i32,
+        pub p__pgid: i32,
+        pub p_tpgid: i32,
+        pub p_uid: u32,
+        pub p_ruid: u32,
+        pub p_gid: u32,
+        pub p_rgid: u32,
+        pub p_groups: [u32; KI_NGROUPS as usize],
+        pub p_ngroups: i16,
+        pub p_jobc: i16,
+        pub p_tdev: u32,
+        pub p_estcpu: u32,
+        pub p_rtime_sec: u32,
+        pub p_rtime_usec: u32,
+        pub p_cpticks: i32,
+        pub p_pctcpu: u32,
+        pub p_swtime: u32,
+        pub p_slptime: u32,
+        pub p_schedflags: i32,
+        pub p_uticks: u64,
+        pub p_sticks: u64,
+        pub p_iticks: u64,
+        pub p_tracep: u64,
+        pub p_traceflag: i32,
+        pub p_holdcnt: i32,
+        pub p_siglist: i32,
+        pub p_sigmask: u32,
+        pub p_sigignore: u32,
+        pub p_sigcatch: u32,
+        pub p_stat: i8,
+        pub p_priority: u8,
+        pub p_usrpri: u8,
+        pub p_nice: u8,
+        pub p_xstat: u16,
+        pub p_spare: u16,
+        pub p_comm: [::c_char; KI_MAXCOMLEN as usize],
+        pub p_wmesg: [::c_char; KI_WMESGLEN as usize],
+        pub p_wchan: u64,
+        pub p_login: [::c_char; KI_MAXLOGNAME as usize],
+        pub p_vm_rssize: i32,
+        pub p_vm_tsize: i32,
+        pub p_vm_dsize: i32,
+        pub p_vm_ssize: i32,
+        pub p_uvalid: i64,
+        pub p_ustart_sec: u64,
+        pub p_ustart_usec: u32,
+        pub p_uutime_sec: u32,
+        pub p_uutime_usec: u32,
+        pub p_ustime_sec: u32,
+        pub p_ustime_usec: u32,
+        pub p_uru_maxrss: u64,
+        pub p_uru_ixrss: u64,
+        pub p_uru_idrss: u64,
+        pub p_uru_isrss: u64,
+        pub p_uru_minflt: u64,
+        pub p_uru_majflt: u64,
+        pub p_uru_nswap: u64,
+        pub p_uru_inblock: u64,
+        pub p_uru_oublock: u64,
+        pub p_uru_msgsnd: u64,
+        pub p_uru_msgrcv: u64,
+        pub p_uru_nsignals: u64,
+        pub p_uru_nvcsw: u64,
+        pub p_uru_nivcsw: u64,
+        pub p_uctime_sec: u32,
+        pub p_uctime_usec: u32,
+        pub p_psflags: u32,
+        pub p_acflag: u32,
+        pub p_svuid: u32,
+        pub p_svgid: u32,
+        pub p_emul: [::c_char; KI_EMULNAMELEN as usize],
+        pub p_rlim_rss_cur: u64,
+        pub p_cpuid: u64,
+        pub p_vm_map_size: u64,
+        pub p_tid: i32,
+        pub p_rtableid: u32,
+        pub p_pledge: u64,
+        pub p_name: [::c_char; KI_MAXCOMLEN as usize],
+    }
+
+    pub struct kinfo_vmentry {
+        pub kve_start: ::c_ulong,
+        pub kve_end: ::c_ulong,
+        pub kve_guard: ::c_ulong,
+        pub kve_fspace: ::c_ulong,
+        pub kve_fspace_augment: ::c_ulong,
+        pub kve_offset: u64,
+        pub kve_wired_count: ::c_int,
+        pub kve_etype: ::c_int,
+        pub kve_protection: ::c_int,
+        pub kve_max_protection: ::c_int,
+        pub kve_advice: ::c_int,
+        pub kve_inheritance: ::c_int,
+        pub kve_flags: u8,
+    }
+
+    pub struct ptrace_state {
+        pub pe_report_event: ::c_int,
+        pub pe_other_pid: ::pid_t,
+        pub pe_tid: ::pid_t,
+    }
+
+    pub struct ptrace_thread_state {
+        pub pts_tid: ::pid_t,
+    }
+
+    // search.h
+    pub struct entry {
+        pub key: *mut ::c_char,
+        pub data: *mut ::c_void,
+    }
+
+    pub struct ifreq {
+        pub ifr_name: [::c_char; ::IFNAMSIZ],
+        #[cfg(libc_union)]
+        pub ifr_ifru: __c_anonymous_ifr_ifru,
+        #[cfg(not(libc_union))]
+        pub ifr_ifru: ::sockaddr,
+    }
+
+    pub struct tcp_info {
+        pub tcpi_state: u8,
+        pub __tcpi_ca_state: u8,
+        pub __tcpi_retransmits: u8,
+        pub __tcpi_probes: u8,
+        pub __tcpi_backoff: u8,
+        pub tcpi_options: u8,
+        pub tcpi_snd_wscale: u8,
+        pub tcpi_rcv_wscale: u8,
+        pub tcpi_rto: u32,
+        pub __tcpi_ato: u32,
+        pub tcpi_snd_mss: u32,
+        pub tcpi_rcv_mss: u32,
+        pub __tcpi_unacked: u32,
+        pub __tcpi_sacked: u32,
+        pub __tcpi_lost: u32,
+        pub __tcpi_retrans: u32,
+        pub __tcpi_fackets: u32,
+        pub tcpi_last_data_sent: u32,
+        pub tcpi_last_ack_sent: u32,
+        pub tcpi_last_data_recv: u32,
+        pub tcpi_last_ack_recv: u32,
+        pub __tcpi_pmtu: u32,
+        pub __tcpi_rcv_ssthresh: u32,
+        pub tcpi_rtt: u32,
+        pub tcpi_rttvar: u32,
+        pub tcpi_snd_ssthresh: u32,
+        pub tcpi_snd_cwnd: u32,
+        pub __tcpi_advmss: u32,
+        pub __tcpi_reordering: u32,
+        pub __tcpi_rcv_rtt: u32,
+        pub tcpi_rcv_space: u32,
+        pub tcpi_snd_wnd: u32,
+        pub tcpi_snd_nxt: u32,
+        pub tcpi_rcv_nxt: u32,
+        pub tcpi_toe_tid: u32,
+        pub tcpi_snd_rexmitpack: u32,
+        pub tcpi_rcv_ooopack: u32,
+        pub tcpi_snd_zerowin: u32,
+        pub tcpi_rttmin: u32,
+        pub tcpi_max_sndwnd: u32,
+        pub tcpi_rcv_adv: u32,
+        pub tcpi_rcv_up: u32,
+        pub tcpi_snd_una: u32,
+        pub tcpi_snd_up: u32,
+        pub tcpi_snd_wl1: u32,
+        pub tcpi_snd_wl2: u32,
+        pub tcpi_snd_max: u32,
+        pub tcpi_ts_recent: u32,
+        pub tcpi_ts_recent_age: u32,
+        pub tcpi_rfbuf_cnt: u32,
+        pub tcpi_rfbuf_ts: u32,
+        pub tcpi_so_rcv_sb_cc: u32,
+        pub tcpi_so_rcv_sb_hiwat: u32,
+        pub tcpi_so_rcv_sb_lowat: u32,
+        pub tcpi_so_rcv_sb_wat: u32,
+        pub tcpi_so_snd_sb_cc: u32,
+        pub tcpi_so_snd_sb_hiwat: u32,
+        pub tcpi_so_snd_sb_lowat: u32,
+        pub tcpi_so_snd_sb_wat: u32,
+    }
+}
+
+impl siginfo_t {
+    pub unsafe fn si_addr(&self) -> *mut ::c_char {
+        self.si_addr
+    }
+
+    pub unsafe fn si_code(&self) -> ::c_int {
+        self.si_code
+    }
+
+    pub unsafe fn si_errno(&self) -> ::c_int {
+        self.si_errno
+    }
+
+    pub unsafe fn si_pid(&self) -> ::pid_t {
+        #[repr(C)]
+        struct siginfo_timer {
+            _si_signo: ::c_int,
+            _si_code: ::c_int,
+            _si_errno: ::c_int,
+            _pad: [::c_int; SI_PAD],
+            _pid: ::pid_t,
+        }
+        (*(self as *const siginfo_t as *const siginfo_timer))._pid
+    }
+
+    pub unsafe fn si_uid(&self) -> ::uid_t {
+        #[repr(C)]
+        struct siginfo_timer {
+            _si_signo: ::c_int,
+            _si_code: ::c_int,
+            _si_errno: ::c_int,
+            _pad: [::c_int; SI_PAD],
+            _pid: ::pid_t,
+            _uid: ::uid_t,
+        }
+        (*(self as *const siginfo_t as *const siginfo_timer))._uid
+    }
+
+    pub unsafe fn si_value(&self) -> ::sigval {
+        #[repr(C)]
+        struct siginfo_timer {
+            _si_signo: ::c_int,
+            _si_code: ::c_int,
+            _si_errno: ::c_int,
+            _pad: [::c_int; SI_PAD],
+            _pid: ::pid_t,
+            _uid: ::uid_t,
+            value: ::sigval,
+        }
+        (*(self as *const siginfo_t as *const siginfo_timer)).value
+    }
+}
+
+s_no_extra_traits! {
+    pub struct dirent {
+        pub d_fileno: ::ino_t,
+        pub d_off: ::off_t,
+        pub d_reclen: u16,
+        pub d_type: u8,
+        pub d_namlen: u8,
+        __d_padding: [u8; 4],
+        pub d_name: [::c_char; 256],
+    }
+
+    pub struct sockaddr_storage {
+        pub ss_len: u8,
+        pub ss_family: ::sa_family_t,
+        __ss_pad1: [u8; 6],
+        __ss_pad2: i64,
+        __ss_pad3: [u8; 240],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_code: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_addr: *mut ::c_char,
+        #[cfg(target_pointer_width = "32")]
+        __pad: [u8; 112],
+        #[cfg(target_pointer_width = "64")]
+        __pad: [u8; 108],
+    }
+
+    pub struct lastlog {
+        ll_time: ::time_t,
+        ll_line: [::c_char; UT_LINESIZE],
+        ll_host: [::c_char; UT_HOSTSIZE],
+    }
+
+    pub struct utmp {
+        pub ut_line: [::c_char; UT_LINESIZE],
+        pub ut_name: [::c_char; UT_NAMESIZE],
+        pub ut_host: [::c_char; UT_HOSTSIZE],
+        pub ut_time: ::time_t,
+    }
+
+    pub union mount_info {
+        pub ufs_args: ufs_args,
+        pub mfs_args: mfs_args,
+        pub nfs_args: nfs_args,
+        pub iso_args: iso_args,
+        pub msdosfs_args: msdosfs_args,
+        pub ntfs_args: ntfs_args,
+        pub tmpfs_args: tmpfs_args,
+        align: [::c_char; 160],
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifr_ifru {
+        pub ifru_addr: ::sockaddr,
+        pub ifru_dstaddr: ::sockaddr,
+        pub ifru_broadaddr: ::sockaddr,
+        pub ifru_flags: ::c_short,
+        pub ifru_metric: ::c_int,
+        pub ifru_vnetid: i64,
+        pub ifru_media: u64,
+        pub ifru_data: ::caddr_t,
+        pub ifru_index: ::c_uint,
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for dirent {
+            fn eq(&self, other: &dirent) -> bool {
+                self.d_fileno == other.d_fileno
+                    && self.d_off == other.d_off
+                    && self.d_reclen == other.d_reclen
+                    && self.d_type == other.d_type
+                    && self.d_namlen == other.d_namlen
+                    && self
+                    .d_name
+                    .iter()
+                    .zip(other.d_name.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for dirent {}
+
+        impl ::fmt::Debug for dirent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("dirent")
+                    .field("d_fileno", &self.d_fileno)
+                    .field("d_off", &self.d_off)
+                    .field("d_reclen", &self.d_reclen)
+                    .field("d_type", &self.d_type)
+                    .field("d_namlen", &self.d_namlen)
+                // FIXME: .field("d_name", &self.d_name)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for dirent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.d_fileno.hash(state);
+                self.d_off.hash(state);
+                self.d_reclen.hash(state);
+                self.d_type.hash(state);
+                self.d_namlen.hash(state);
+                self.d_name.hash(state);
+            }
+        }
+
+        impl PartialEq for sockaddr_storage {
+            fn eq(&self, other: &sockaddr_storage) -> bool {
+                self.ss_len == other.ss_len
+                    && self.ss_family == other.ss_family
+            }
+        }
+
+        impl Eq for sockaddr_storage {}
+
+        impl ::fmt::Debug for sockaddr_storage {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_storage")
+                    .field("ss_len", &self.ss_len)
+                    .field("ss_family", &self.ss_family)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for sockaddr_storage {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ss_len.hash(state);
+                self.ss_family.hash(state);
+            }
+        }
+
+        impl PartialEq for siginfo_t {
+            fn eq(&self, other: &siginfo_t) -> bool {
+                self.si_signo == other.si_signo
+                    && self.si_code == other.si_code
+                    && self.si_errno == other.si_errno
+                    && self.si_addr == other.si_addr
+            }
+        }
+
+        impl Eq for siginfo_t {}
+
+        impl ::fmt::Debug for siginfo_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("siginfo_t")
+                    .field("si_signo", &self.si_signo)
+                    .field("si_code", &self.si_code)
+                    .field("si_errno", &self.si_errno)
+                    .field("si_addr", &self.si_addr)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for siginfo_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.si_signo.hash(state);
+                self.si_code.hash(state);
+                self.si_errno.hash(state);
+                self.si_addr.hash(state);
+            }
+        }
+
+        impl PartialEq for lastlog {
+            fn eq(&self, other: &lastlog) -> bool {
+                self.ll_time == other.ll_time
+                    && self
+                    .ll_line
+                    .iter()
+                    .zip(other.ll_line.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .ll_host
+                    .iter()
+                    .zip(other.ll_host.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for lastlog {}
+
+        impl ::fmt::Debug for lastlog {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("lastlog")
+                    .field("ll_time", &self.ll_time)
+                // FIXME: .field("ll_line", &self.ll_line)
+                // FIXME: .field("ll_host", &self.ll_host)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for lastlog {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ll_time.hash(state);
+                self.ll_line.hash(state);
+                self.ll_host.hash(state);
+            }
+        }
+
+        impl PartialEq for utmp {
+            fn eq(&self, other: &utmp) -> bool {
+                self.ut_time == other.ut_time
+                    && self
+                    .ut_line
+                    .iter()
+                    .zip(other.ut_line.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .ut_name
+                    .iter()
+                    .zip(other.ut_name.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .ut_host
+                    .iter()
+                    .zip(other.ut_host.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for utmp {}
+
+        impl ::fmt::Debug for utmp {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("utmp")
+                // FIXME: .field("ut_line", &self.ut_line)
+                // FIXME: .field("ut_name", &self.ut_name)
+                // FIXME: .field("ut_host", &self.ut_host)
+                    .field("ut_time", &self.ut_time)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for utmp {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ut_line.hash(state);
+                self.ut_name.hash(state);
+                self.ut_host.hash(state);
+                self.ut_time.hash(state);
+            }
+        }
+
+        impl PartialEq for mount_info {
+            fn eq(&self, other: &mount_info) -> bool {
+                unsafe {
+                    self.align
+                        .iter()
+                        .zip(other.align.iter())
+                        .all(|(a,b)| a == b)
+                }
+            }
+        }
+
+        impl Eq for mount_info { }
+
+        impl ::fmt::Debug for mount_info {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("mount_info")
+                // FIXME: .field("align", &self.align)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for mount_info {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe { self.align.hash(state) };
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl PartialEq for __c_anonymous_ifr_ifru {
+            fn eq(&self, other: &__c_anonymous_ifr_ifru) -> bool {
+                unsafe {
+                    self.ifru_addr == other.ifru_addr
+                        && self.ifru_dstaddr == other.ifru_dstaddr
+                        && self.ifru_broadaddr == other.ifru_broadaddr
+                        && self.ifru_flags == other.ifru_flags
+                        && self.ifru_metric == other.ifru_metric
+                        && self.ifru_vnetid == other.ifru_vnetid
+                        && self.ifru_media == other.ifru_media
+                        && self.ifru_data == other.ifru_data
+                        && self.ifru_index == other.ifru_index
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_ifr_ifru {}
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifr_ifru {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("__c_anonymous_ifr_ifru")
+                    .field("ifru_addr", unsafe { &self.ifru_addr })
+                    .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr })
+                    .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr })
+                    .field("ifru_flags", unsafe { &self.ifru_flags })
+                    .field("ifru_metric", unsafe { &self.ifru_metric })
+                    .field("ifru_vnetid", unsafe { &self.ifru_vnetid })
+                    .field("ifru_media", unsafe { &self.ifru_media })
+                    .field("ifru_data", unsafe { &self.ifru_data })
+                    .field("ifru_index", unsafe { &self.ifru_index })
+                    .finish()
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_ifr_ifru {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                    self.ifru_addr.hash(state);
+                    self.ifru_dstaddr.hash(state);
+                    self.ifru_broadaddr.hash(state);
+                    self.ifru_flags.hash(state);
+                    self.ifru_metric.hash(state);
+                    self.ifru_vnetid.hash(state);
+                    self.ifru_media.hash(state);
+                    self.ifru_data.hash(state);
+                    self.ifru_index.hash(state);
+                }
+            }
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        s_no_extra_traits! {
+            // This type uses the union mount_info:
+            pub struct statfs {
+                pub f_flags: u32,
+                pub f_bsize: u32,
+                pub f_iosize: u32,
+                pub f_blocks: u64,
+                pub f_bfree: u64,
+                pub f_bavail: i64,
+                pub f_files: u64,
+                pub f_ffree: u64,
+                pub f_favail: i64,
+                pub f_syncwrites: u64,
+                pub f_syncreads: u64,
+                pub f_asyncwrites: u64,
+                pub f_asyncreads: u64,
+                pub f_fsid: ::fsid_t,
+                pub f_namemax: u32,
+                pub f_owner: ::uid_t,
+                pub f_ctime: u64,
+                pub f_fstypename: [::c_char; 16],
+                pub f_mntonname: [::c_char; 90],
+                pub f_mntfromname: [::c_char; 90],
+                pub f_mntfromspec: [::c_char; 90],
+                pub mount_info: mount_info,
+            }
+        }
+
+        cfg_if! {
+            if #[cfg(feature = "extra_traits")] {
+                impl PartialEq for statfs {
+                    fn eq(&self, other: &statfs) -> bool {
+                        self.f_flags == other.f_flags
+                            && self.f_bsize == other.f_bsize
+                            && self.f_iosize == other.f_iosize
+                            && self.f_blocks == other.f_blocks
+                            && self.f_bfree == other.f_bfree
+                            && self.f_bavail == other.f_bavail
+                            && self.f_files == other.f_files
+                            && self.f_ffree == other.f_ffree
+                            && self.f_favail == other.f_favail
+                            && self.f_syncwrites == other.f_syncwrites
+                            && self.f_syncreads == other.f_syncreads
+                            && self.f_asyncwrites == other.f_asyncwrites
+                            && self.f_asyncreads == other.f_asyncreads
+                            && self.f_fsid == other.f_fsid
+                            && self.f_namemax == other.f_namemax
+                            && self.f_owner == other.f_owner
+                            && self.f_ctime == other.f_ctime
+                            && self.f_fstypename
+                            .iter()
+                            .zip(other.f_fstypename.iter())
+                            .all(|(a,b)| a == b)
+                            && self.f_mntonname
+                            .iter()
+                            .zip(other.f_mntonname.iter())
+                            .all(|(a,b)| a == b)
+                            && self.f_mntfromname
+                            .iter()
+                            .zip(other.f_mntfromname.iter())
+                            .all(|(a,b)| a == b)
+                            && self.f_mntfromspec
+                            .iter()
+                            .zip(other.f_mntfromspec.iter())
+                            .all(|(a,b)| a == b)
+                            && self.mount_info == other.mount_info
+                    }
+                }
+
+                impl Eq for statfs { }
+
+                impl ::fmt::Debug for statfs {
+                    fn fmt(&self, f: &mut ::fmt::Formatter)
+                           -> ::fmt::Result {
+                        f.debug_struct("statfs")
+                            .field("f_flags", &self.f_flags)
+                            .field("f_bsize", &self.f_bsize)
+                            .field("f_iosize", &self.f_iosize)
+                            .field("f_blocks", &self.f_blocks)
+                            .field("f_bfree", &self.f_bfree)
+                            .field("f_bavail", &self.f_bavail)
+                            .field("f_files", &self.f_files)
+                            .field("f_ffree", &self.f_ffree)
+                            .field("f_favail", &self.f_favail)
+                            .field("f_syncwrites", &self.f_syncwrites)
+                            .field("f_syncreads", &self.f_syncreads)
+                            .field("f_asyncwrites", &self.f_asyncwrites)
+                            .field("f_asyncreads", &self.f_asyncreads)
+                            .field("f_fsid", &self.f_fsid)
+                            .field("f_namemax", &self.f_namemax)
+                            .field("f_owner", &self.f_owner)
+                            .field("f_ctime", &self.f_ctime)
+                        // FIXME: .field("f_fstypename", &self.f_fstypename)
+                        // FIXME: .field("f_mntonname", &self.f_mntonname)
+                        // FIXME: .field("f_mntfromname", &self.f_mntfromname)
+                        // FIXME: .field("f_mntfromspec", &self.f_mntfromspec)
+                            .field("mount_info", &self.mount_info)
+                            .finish()
+                    }
+                }
+
+                impl ::hash::Hash for statfs {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        self.f_flags.hash(state);
+                        self.f_bsize.hash(state);
+                        self.f_iosize.hash(state);
+                        self.f_blocks.hash(state);
+                        self.f_bfree.hash(state);
+                        self.f_bavail.hash(state);
+                        self.f_files.hash(state);
+                        self.f_ffree.hash(state);
+                        self.f_favail.hash(state);
+                        self.f_syncwrites.hash(state);
+                        self.f_syncreads.hash(state);
+                        self.f_asyncwrites.hash(state);
+                        self.f_asyncreads.hash(state);
+                        self.f_fsid.hash(state);
+                        self.f_namemax.hash(state);
+                        self.f_owner.hash(state);
+                        self.f_ctime.hash(state);
+                        self.f_fstypename.hash(state);
+                        self.f_mntonname.hash(state);
+                        self.f_mntfromname.hash(state);
+                        self.f_mntfromspec.hash(state);
+                        self.mount_info.hash(state);
+                    }
+                }
+            }
+        }
+    }
+}
+
+pub const UT_NAMESIZE: usize = 32;
+pub const UT_LINESIZE: usize = 8;
+pub const UT_HOSTSIZE: usize = 256;
+
+pub const O_CLOEXEC: ::c_int = 0x10000;
+pub const O_DIRECTORY: ::c_int = 0x20000;
+pub const O_RSYNC: ::c_int = O_SYNC;
+
+pub const MS_SYNC: ::c_int = 0x0002;
+pub const MS_INVALIDATE: ::c_int = 0x0004;
+
+pub const POLLNORM: ::c_short = ::POLLRDNORM;
+
+pub const ENOATTR: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const EOVERFLOW: ::c_int = 87;
+pub const ECANCELED: ::c_int = 88;
+pub const EIDRM: ::c_int = 89;
+pub const ENOMSG: ::c_int = 90;
+pub const ENOTSUP: ::c_int = 91;
+pub const EBADMSG: ::c_int = 92;
+pub const ENOTRECOVERABLE: ::c_int = 93;
+pub const EOWNERDEAD: ::c_int = 94;
+pub const EPROTO: ::c_int = 95;
+pub const ELAST: ::c_int = 95;
+
+pub const F_DUPFD_CLOEXEC: ::c_int = 10;
+
+pub const UTIME_OMIT: c_long = -1;
+pub const UTIME_NOW: c_long = -2;
+
+pub const AT_FDCWD: ::c_int = -100;
+pub const AT_EACCESS: ::c_int = 0x01;
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x02;
+pub const AT_SYMLINK_FOLLOW: ::c_int = 0x04;
+pub const AT_REMOVEDIR: ::c_int = 0x08;
+
+#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+pub const RLIM_NLIMITS: ::c_int = 9;
+
+pub const SO_TIMESTAMP: ::c_int = 0x0800;
+pub const SO_SNDTIMEO: ::c_int = 0x1005;
+pub const SO_RCVTIMEO: ::c_int = 0x1006;
+pub const SO_BINDANY: ::c_int = 0x1000;
+pub const SO_NETPROC: ::c_int = 0x1020;
+pub const SO_RTABLE: ::c_int = 0x1021;
+pub const SO_PEERCRED: ::c_int = 0x1022;
+pub const SO_SPLICE: ::c_int = 0x1023;
+pub const SO_DOMAIN: ::c_int = 0x1024;
+pub const SO_PROTOCOL: ::c_int = 0x1025;
+
+// sys/netinet/in.h
+// Protocols (RFC 1700)
+// NOTE: These are in addition to the constants defined in src/unix/mod.rs
+
+// IPPROTO_IP defined in src/unix/mod.rs
+/// Hop-by-hop option header
+pub const IPPROTO_HOPOPTS: ::c_int = 0;
+// IPPROTO_ICMP defined in src/unix/mod.rs
+/// group mgmt protocol
+pub const IPPROTO_IGMP: ::c_int = 2;
+/// gateway^2 (deprecated)
+pub const IPPROTO_GGP: ::c_int = 3;
+/// for compatibility
+pub const IPPROTO_IPIP: ::c_int = 4;
+// IPPROTO_TCP defined in src/unix/mod.rs
+/// exterior gateway protocol
+pub const IPPROTO_EGP: ::c_int = 8;
+/// pup
+pub const IPPROTO_PUP: ::c_int = 12;
+// IPPROTO_UDP defined in src/unix/mod.rs
+/// xns idp
+pub const IPPROTO_IDP: ::c_int = 22;
+/// tp-4 w/ class negotiation
+pub const IPPROTO_TP: ::c_int = 29;
+// IPPROTO_IPV6 defined in src/unix/mod.rs
+/// IP6 routing header
+pub const IPPROTO_ROUTING: ::c_int = 43;
+/// IP6 fragmentation header
+pub const IPPROTO_FRAGMENT: ::c_int = 44;
+/// resource reservation
+pub const IPPROTO_RSVP: ::c_int = 46;
+/// General Routing Encap.
+pub const IPPROTO_GRE: ::c_int = 47;
+/// IP6 Encap Sec. Payload
+pub const IPPROTO_ESP: ::c_int = 50;
+/// IP6 Auth Header
+pub const IPPROTO_AH: ::c_int = 51;
+/// IP Mobility RFC 2004
+pub const IPPROTO_MOBILE: ::c_int = 55;
+// IPPROTO_ICMPV6 defined in src/unix/mod.rs
+/// IP6 no next header
+pub const IPPROTO_NONE: ::c_int = 59;
+/// IP6 destination option
+pub const IPPROTO_DSTOPTS: ::c_int = 60;
+/// ISO cnlp
+pub const IPPROTO_EON: ::c_int = 80;
+/// Ethernet-in-IP
+pub const IPPROTO_ETHERIP: ::c_int = 97;
+/// encapsulation header
+pub const IPPROTO_ENCAP: ::c_int = 98;
+/// Protocol indep. multicast
+pub const IPPROTO_PIM: ::c_int = 103;
+/// IP Payload Comp. Protocol
+pub const IPPROTO_IPCOMP: ::c_int = 108;
+/// CARP
+pub const IPPROTO_CARP: ::c_int = 112;
+/// unicast MPLS packet
+pub const IPPROTO_MPLS: ::c_int = 137;
+/// PFSYNC
+pub const IPPROTO_PFSYNC: ::c_int = 240;
+pub const IPPROTO_MAX: ::c_int = 256;
+
+// Only used internally, so it can be outside the range of valid IP protocols
+pub const IPPROTO_DIVERT: ::c_int = 258;
+
+pub const IP_RECVDSTADDR: ::c_int = 7;
+pub const IP_SENDSRCADDR: ::c_int = IP_RECVDSTADDR;
+pub const IP_RECVIF: ::c_int = 30;
+
+// sys/netinet/in.h
+pub const TCP_MD5SIG: ::c_int = 0x04;
+pub const TCP_NOPUSH: ::c_int = 0x10;
+
+pub const MSG_WAITFORONE: ::c_int = 0x1000;
+
+pub const AF_ECMA: ::c_int = 8;
+pub const AF_ROUTE: ::c_int = 17;
+pub const AF_ENCAP: ::c_int = 28;
+pub const AF_SIP: ::c_int = 29;
+pub const AF_KEY: ::c_int = 30;
+pub const pseudo_AF_HDRCMPLT: ::c_int = 31;
+pub const AF_BLUETOOTH: ::c_int = 32;
+pub const AF_MPLS: ::c_int = 33;
+pub const pseudo_AF_PFLOW: ::c_int = 34;
+pub const pseudo_AF_PIPEX: ::c_int = 35;
+pub const NET_RT_DUMP: ::c_int = 1;
+pub const NET_RT_FLAGS: ::c_int = 2;
+pub const NET_RT_IFLIST: ::c_int = 3;
+pub const NET_RT_STATS: ::c_int = 4;
+pub const NET_RT_TABLE: ::c_int = 5;
+pub const NET_RT_IFNAMES: ::c_int = 6;
+#[doc(hidden)]
+#[deprecated(
+    since = "0.2.95",
+    note = "Possibly increasing over the releases and might not be so used in the field"
+)]
+pub const NET_RT_MAXID: ::c_int = 7;
+
+pub const IPV6_JOIN_GROUP: ::c_int = 12;
+pub const IPV6_LEAVE_GROUP: ::c_int = 13;
+
+pub const PF_ROUTE: ::c_int = AF_ROUTE;
+pub const PF_ECMA: ::c_int = AF_ECMA;
+pub const PF_ENCAP: ::c_int = AF_ENCAP;
+pub const PF_SIP: ::c_int = AF_SIP;
+pub const PF_KEY: ::c_int = AF_KEY;
+pub const PF_BPF: ::c_int = pseudo_AF_HDRCMPLT;
+pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
+pub const PF_MPLS: ::c_int = AF_MPLS;
+pub const PF_PFLOW: ::c_int = pseudo_AF_PFLOW;
+pub const PF_PIPEX: ::c_int = pseudo_AF_PIPEX;
+
+pub const SCM_TIMESTAMP: ::c_int = 0x04;
+
+pub const O_DSYNC: ::c_int = 128;
+
+pub const MAP_RENAME: ::c_int = 0x0000;
+pub const MAP_NORESERVE: ::c_int = 0x0000;
+pub const MAP_HASSEMAPHORE: ::c_int = 0x0000;
+pub const MAP_TRYFIXED: ::c_int = 0;
+
+pub const EIPSEC: ::c_int = 82;
+pub const ENOMEDIUM: ::c_int = 85;
+pub const EMEDIUMTYPE: ::c_int = 86;
+
+pub const EAI_BADFLAGS: ::c_int = -1;
+pub const EAI_NONAME: ::c_int = -2;
+pub const EAI_AGAIN: ::c_int = -3;
+pub const EAI_FAIL: ::c_int = -4;
+pub const EAI_NODATA: ::c_int = -5;
+pub const EAI_FAMILY: ::c_int = -6;
+pub const EAI_SOCKTYPE: ::c_int = -7;
+pub const EAI_SERVICE: ::c_int = -8;
+pub const EAI_MEMORY: ::c_int = -10;
+pub const EAI_SYSTEM: ::c_int = -11;
+pub const EAI_OVERFLOW: ::c_int = -14;
+
+pub const RUSAGE_THREAD: ::c_int = 1;
+
+pub const MAP_COPY: ::c_int = 0x0002;
+pub const MAP_NOEXTEND: ::c_int = 0x0000;
+
+pub const _PC_LINK_MAX: ::c_int = 1;
+pub const _PC_MAX_CANON: ::c_int = 2;
+pub const _PC_MAX_INPUT: ::c_int = 3;
+pub const _PC_NAME_MAX: ::c_int = 4;
+pub const _PC_PATH_MAX: ::c_int = 5;
+pub const _PC_PIPE_BUF: ::c_int = 6;
+pub const _PC_CHOWN_RESTRICTED: ::c_int = 7;
+pub const _PC_NO_TRUNC: ::c_int = 8;
+pub const _PC_VDISABLE: ::c_int = 9;
+pub const _PC_2_SYMLINKS: ::c_int = 10;
+pub const _PC_ALLOC_SIZE_MIN: ::c_int = 11;
+pub const _PC_ASYNC_IO: ::c_int = 12;
+pub const _PC_FILESIZEBITS: ::c_int = 13;
+pub const _PC_PRIO_IO: ::c_int = 14;
+pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 15;
+pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 16;
+pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 17;
+pub const _PC_REC_XFER_ALIGN: ::c_int = 18;
+pub const _PC_SYMLINK_MAX: ::c_int = 19;
+pub const _PC_SYNC_IO: ::c_int = 20;
+pub const _PC_TIMESTAMP_RESOLUTION: ::c_int = 21;
+
+pub const _SC_CLK_TCK: ::c_int = 3;
+pub const _SC_SEM_NSEMS_MAX: ::c_int = 31;
+pub const _SC_SEM_VALUE_MAX: ::c_int = 32;
+pub const _SC_HOST_NAME_MAX: ::c_int = 33;
+pub const _SC_MONOTONIC_CLOCK: ::c_int = 34;
+pub const _SC_2_PBS: ::c_int = 35;
+pub const _SC_2_PBS_ACCOUNTING: ::c_int = 36;
+pub const _SC_2_PBS_CHECKPOINT: ::c_int = 37;
+pub const _SC_2_PBS_LOCATE: ::c_int = 38;
+pub const _SC_2_PBS_MESSAGE: ::c_int = 39;
+pub const _SC_2_PBS_TRACK: ::c_int = 40;
+pub const _SC_ADVISORY_INFO: ::c_int = 41;
+pub const _SC_AIO_LISTIO_MAX: ::c_int = 42;
+pub const _SC_AIO_MAX: ::c_int = 43;
+pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44;
+pub const _SC_ASYNCHRONOUS_IO: ::c_int = 45;
+pub const _SC_ATEXIT_MAX: ::c_int = 46;
+pub const _SC_BARRIERS: ::c_int = 47;
+pub const _SC_CLOCK_SELECTION: ::c_int = 48;
+pub const _SC_CPUTIME: ::c_int = 49;
+pub const _SC_DELAYTIMER_MAX: ::c_int = 50;
+pub const _SC_IOV_MAX: ::c_int = 51;
+pub const _SC_IPV6: ::c_int = 52;
+pub const _SC_MAPPED_FILES: ::c_int = 53;
+pub const _SC_MEMLOCK: ::c_int = 54;
+pub const _SC_MEMLOCK_RANGE: ::c_int = 55;
+pub const _SC_MEMORY_PROTECTION: ::c_int = 56;
+pub const _SC_MESSAGE_PASSING: ::c_int = 57;
+pub const _SC_MQ_OPEN_MAX: ::c_int = 58;
+pub const _SC_MQ_PRIO_MAX: ::c_int = 59;
+pub const _SC_PRIORITIZED_IO: ::c_int = 60;
+pub const _SC_PRIORITY_SCHEDULING: ::c_int = 61;
+pub const _SC_RAW_SOCKETS: ::c_int = 62;
+pub const _SC_READER_WRITER_LOCKS: ::c_int = 63;
+pub const _SC_REALTIME_SIGNALS: ::c_int = 64;
+pub const _SC_REGEXP: ::c_int = 65;
+pub const _SC_RTSIG_MAX: ::c_int = 66;
+pub const _SC_SEMAPHORES: ::c_int = 67;
+pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 68;
+pub const _SC_SHELL: ::c_int = 69;
+pub const _SC_SIGQUEUE_MAX: ::c_int = 70;
+pub const _SC_SPAWN: ::c_int = 71;
+pub const _SC_SPIN_LOCKS: ::c_int = 72;
+pub const _SC_SPORADIC_SERVER: ::c_int = 73;
+pub const _SC_SS_REPL_MAX: ::c_int = 74;
+pub const _SC_SYNCHRONIZED_IO: ::c_int = 75;
+pub const _SC_SYMLOOP_MAX: ::c_int = 76;
+pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77;
+pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78;
+pub const _SC_THREAD_CPUTIME: ::c_int = 79;
+pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 80;
+pub const _SC_THREAD_KEYS_MAX: ::c_int = 81;
+pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 82;
+pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 83;
+pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 84;
+pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 85;
+pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 86;
+pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 87;
+pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 88;
+pub const _SC_THREAD_STACK_MIN: ::c_int = 89;
+pub const _SC_THREAD_THREADS_MAX: ::c_int = 90;
+pub const _SC_THREADS: ::c_int = 91;
+pub const _SC_TIMEOUTS: ::c_int = 92;
+pub const _SC_TIMER_MAX: ::c_int = 93;
+pub const _SC_TIMERS: ::c_int = 94;
+pub const _SC_TRACE: ::c_int = 95;
+pub const _SC_TRACE_EVENT_FILTER: ::c_int = 96;
+pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 97;
+pub const _SC_TRACE_INHERIT: ::c_int = 98;
+pub const _SC_TRACE_LOG: ::c_int = 99;
+pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 100;
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 101;
+pub const _SC_LOGIN_NAME_MAX: ::c_int = 102;
+pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 103;
+pub const _SC_TRACE_NAME_MAX: ::c_int = 104;
+pub const _SC_TRACE_SYS_MAX: ::c_int = 105;
+pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 106;
+pub const _SC_TTY_NAME_MAX: ::c_int = 107;
+pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 108;
+pub const _SC_V6_ILP32_OFF32: ::c_int = 109;
+pub const _SC_V6_ILP32_OFFBIG: ::c_int = 110;
+pub const _SC_V6_LP64_OFF64: ::c_int = 111;
+pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 112;
+pub const _SC_V7_ILP32_OFF32: ::c_int = 113;
+pub const _SC_V7_ILP32_OFFBIG: ::c_int = 114;
+pub const _SC_V7_LP64_OFF64: ::c_int = 115;
+pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 116;
+pub const _SC_XOPEN_CRYPT: ::c_int = 117;
+pub const _SC_XOPEN_ENH_I18N: ::c_int = 118;
+pub const _SC_XOPEN_LEGACY: ::c_int = 119;
+pub const _SC_XOPEN_REALTIME: ::c_int = 120;
+pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 121;
+pub const _SC_XOPEN_STREAMS: ::c_int = 122;
+pub const _SC_XOPEN_UNIX: ::c_int = 123;
+pub const _SC_XOPEN_UUCP: ::c_int = 124;
+pub const _SC_XOPEN_VERSION: ::c_int = 125;
+pub const _SC_PHYS_PAGES: ::c_int = 500;
+pub const _SC_AVPHYS_PAGES: ::c_int = 501;
+pub const _SC_NPROCESSORS_CONF: ::c_int = 502;
+pub const _SC_NPROCESSORS_ONLN: ::c_int = 503;
+
+pub const FD_SETSIZE: usize = 1024;
+
+pub const SCHED_FIFO: ::c_int = 1;
+pub const SCHED_OTHER: ::c_int = 2;
+pub const SCHED_RR: ::c_int = 3;
+
+pub const ST_NOSUID: ::c_ulong = 2;
+
+pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0 as *mut _;
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = 0 as *mut _;
+pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = 0 as *mut _;
+
+pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 3;
+pub const PTHREAD_MUTEX_STRICT_NP: ::c_int = 4;
+pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_STRICT_NP;
+
+pub const EVFILT_READ: i16 = -1;
+pub const EVFILT_WRITE: i16 = -2;
+pub const EVFILT_AIO: i16 = -3;
+pub const EVFILT_VNODE: i16 = -4;
+pub const EVFILT_PROC: i16 = -5;
+pub const EVFILT_SIGNAL: i16 = -6;
+pub const EVFILT_TIMER: i16 = -7;
+pub const EVFILT_DEVICE: i16 = -8;
+pub const EVFILT_EXCEPT: i16 = -9;
+
+pub const EV_ADD: u16 = 0x1;
+pub const EV_DELETE: u16 = 0x2;
+pub const EV_ENABLE: u16 = 0x4;
+pub const EV_DISABLE: u16 = 0x8;
+pub const EV_ONESHOT: u16 = 0x10;
+pub const EV_CLEAR: u16 = 0x20;
+pub const EV_RECEIPT: u16 = 0x40;
+pub const EV_DISPATCH: u16 = 0x80;
+pub const EV_FLAG1: u16 = 0x2000;
+pub const EV_ERROR: u16 = 0x4000;
+pub const EV_EOF: u16 = 0x8000;
+
+#[deprecated(since = "0.2.113", note = "Not stable across OS versions")]
+pub const EV_SYSFLAGS: u16 = 0xf800;
+
+pub const NOTE_LOWAT: u32 = 0x00000001;
+pub const NOTE_EOF: u32 = 0x00000002;
+pub const NOTE_OOB: u32 = 0x00000004;
+pub const NOTE_DELETE: u32 = 0x00000001;
+pub const NOTE_WRITE: u32 = 0x00000002;
+pub const NOTE_EXTEND: u32 = 0x00000004;
+pub const NOTE_ATTRIB: u32 = 0x00000008;
+pub const NOTE_LINK: u32 = 0x00000010;
+pub const NOTE_RENAME: u32 = 0x00000020;
+pub const NOTE_REVOKE: u32 = 0x00000040;
+pub const NOTE_TRUNCATE: u32 = 0x00000080;
+pub const NOTE_EXIT: u32 = 0x80000000;
+pub const NOTE_FORK: u32 = 0x40000000;
+pub const NOTE_EXEC: u32 = 0x20000000;
+pub const NOTE_PDATAMASK: u32 = 0x000fffff;
+pub const NOTE_PCTRLMASK: u32 = 0xf0000000;
+pub const NOTE_TRACK: u32 = 0x00000001;
+pub const NOTE_TRACKERR: u32 = 0x00000002;
+pub const NOTE_CHILD: u32 = 0x00000004;
+pub const NOTE_CHANGE: u32 = 0x00000001;
+
+pub const TMP_MAX: ::c_uint = 0x7fffffff;
+
+pub const AI_PASSIVE: ::c_int = 1;
+pub const AI_CANONNAME: ::c_int = 2;
+pub const AI_NUMERICHOST: ::c_int = 4;
+pub const AI_EXT: ::c_int = 8;
+pub const AI_NUMERICSERV: ::c_int = 16;
+pub const AI_FQDN: ::c_int = 32;
+pub const AI_ADDRCONFIG: ::c_int = 64;
+
+pub const NI_NUMERICHOST: ::c_int = 1;
+pub const NI_NUMERICSERV: ::c_int = 2;
+pub const NI_NOFQDN: ::c_int = 4;
+pub const NI_NAMEREQD: ::c_int = 8;
+pub const NI_DGRAM: ::c_int = 16;
+
+pub const NI_MAXHOST: ::size_t = 256;
+
+pub const RTLD_LOCAL: ::c_int = 0;
+
+pub const CTL_MAXNAME: ::c_int = 12;
+
+pub const CTLTYPE_NODE: ::c_int = 1;
+pub const CTLTYPE_INT: ::c_int = 2;
+pub const CTLTYPE_STRING: ::c_int = 3;
+pub const CTLTYPE_QUAD: ::c_int = 4;
+pub const CTLTYPE_STRUCT: ::c_int = 5;
+
+pub const CTL_UNSPEC: ::c_int = 0;
+pub const CTL_KERN: ::c_int = 1;
+pub const CTL_VM: ::c_int = 2;
+pub const CTL_FS: ::c_int = 3;
+pub const CTL_NET: ::c_int = 4;
+pub const CTL_DEBUG: ::c_int = 5;
+pub const CTL_HW: ::c_int = 6;
+pub const CTL_MACHDEP: ::c_int = 7;
+pub const CTL_DDB: ::c_int = 9;
+pub const CTL_VFS: ::c_int = 10;
+pub const CTL_MAXID: ::c_int = 11;
+
+pub const HW_NCPUONLINE: ::c_int = 25;
+
+pub const KERN_OSTYPE: ::c_int = 1;
+pub const KERN_OSRELEASE: ::c_int = 2;
+pub const KERN_OSREV: ::c_int = 3;
+pub const KERN_VERSION: ::c_int = 4;
+pub const KERN_MAXVNODES: ::c_int = 5;
+pub const KERN_MAXPROC: ::c_int = 6;
+pub const KERN_MAXFILES: ::c_int = 7;
+pub const KERN_ARGMAX: ::c_int = 8;
+pub const KERN_SECURELVL: ::c_int = 9;
+pub const KERN_HOSTNAME: ::c_int = 10;
+pub const KERN_HOSTID: ::c_int = 11;
+pub const KERN_CLOCKRATE: ::c_int = 12;
+pub const KERN_PROF: ::c_int = 16;
+pub const KERN_POSIX1: ::c_int = 17;
+pub const KERN_NGROUPS: ::c_int = 18;
+pub const KERN_JOB_CONTROL: ::c_int = 19;
+pub const KERN_SAVED_IDS: ::c_int = 20;
+pub const KERN_BOOTTIME: ::c_int = 21;
+pub const KERN_DOMAINNAME: ::c_int = 22;
+pub const KERN_MAXPARTITIONS: ::c_int = 23;
+pub const KERN_RAWPARTITION: ::c_int = 24;
+pub const KERN_MAXTHREAD: ::c_int = 25;
+pub const KERN_NTHREADS: ::c_int = 26;
+pub const KERN_OSVERSION: ::c_int = 27;
+pub const KERN_SOMAXCONN: ::c_int = 28;
+pub const KERN_SOMINCONN: ::c_int = 29;
+#[deprecated(since = "0.2.71", note = "Removed in OpenBSD 6.0")]
+pub const KERN_USERMOUNT: ::c_int = 30;
+pub const KERN_NOSUIDCOREDUMP: ::c_int = 32;
+pub const KERN_FSYNC: ::c_int = 33;
+pub const KERN_SYSVMSG: ::c_int = 34;
+pub const KERN_SYSVSEM: ::c_int = 35;
+pub const KERN_SYSVSHM: ::c_int = 36;
+#[deprecated(since = "0.2.71", note = "Removed in OpenBSD 6.0")]
+pub const KERN_ARND: ::c_int = 37;
+pub const KERN_MSGBUFSIZE: ::c_int = 38;
+pub const KERN_MALLOCSTATS: ::c_int = 39;
+pub const KERN_CPTIME: ::c_int = 40;
+pub const KERN_NCHSTATS: ::c_int = 41;
+pub const KERN_FORKSTAT: ::c_int = 42;
+pub const KERN_NSELCOLL: ::c_int = 43;
+pub const KERN_TTY: ::c_int = 44;
+pub const KERN_CCPU: ::c_int = 45;
+pub const KERN_FSCALE: ::c_int = 46;
+pub const KERN_NPROCS: ::c_int = 47;
+pub const KERN_MSGBUF: ::c_int = 48;
+pub const KERN_POOL: ::c_int = 49;
+pub const KERN_STACKGAPRANDOM: ::c_int = 50;
+pub const KERN_SYSVIPC_INFO: ::c_int = 51;
+pub const KERN_SPLASSERT: ::c_int = 54;
+pub const KERN_PROC_ARGS: ::c_int = 55;
+pub const KERN_NFILES: ::c_int = 56;
+pub const KERN_TTYCOUNT: ::c_int = 57;
+pub const KERN_NUMVNODES: ::c_int = 58;
+pub const KERN_MBSTAT: ::c_int = 59;
+pub const KERN_SEMINFO: ::c_int = 61;
+pub const KERN_SHMINFO: ::c_int = 62;
+pub const KERN_INTRCNT: ::c_int = 63;
+pub const KERN_WATCHDOG: ::c_int = 64;
+pub const KERN_PROC: ::c_int = 66;
+pub const KERN_MAXCLUSTERS: ::c_int = 67;
+pub const KERN_EVCOUNT: ::c_int = 68;
+pub const KERN_TIMECOUNTER: ::c_int = 69;
+pub const KERN_MAXLOCKSPERUID: ::c_int = 70;
+pub const KERN_CPTIME2: ::c_int = 71;
+pub const KERN_CACHEPCT: ::c_int = 72;
+pub const KERN_FILE: ::c_int = 73;
+pub const KERN_CONSDEV: ::c_int = 75;
+pub const KERN_NETLIVELOCKS: ::c_int = 76;
+pub const KERN_POOL_DEBUG: ::c_int = 77;
+pub const KERN_PROC_CWD: ::c_int = 78;
+pub const KERN_PROC_NOBROADCASTKILL: ::c_int = 79;
+pub const KERN_PROC_VMMAP: ::c_int = 80;
+pub const KERN_GLOBAL_PTRACE: ::c_int = 81;
+pub const KERN_CONSBUFSIZE: ::c_int = 82;
+pub const KERN_CONSBUF: ::c_int = 83;
+pub const KERN_AUDIO: ::c_int = 84;
+pub const KERN_CPUSTATS: ::c_int = 85;
+pub const KERN_PFSTATUS: ::c_int = 86;
+pub const KERN_TIMEOUT_STATS: ::c_int = 87;
+#[deprecated(
+    since = "0.2.95",
+    note = "Possibly increasing over the releases and might not be so used in the field"
+)]
+pub const KERN_MAXID: ::c_int = 88;
+
+pub const KERN_PROC_ALL: ::c_int = 0;
+pub const KERN_PROC_PID: ::c_int = 1;
+pub const KERN_PROC_PGRP: ::c_int = 2;
+pub const KERN_PROC_SESSION: ::c_int = 3;
+pub const KERN_PROC_TTY: ::c_int = 4;
+pub const KERN_PROC_UID: ::c_int = 5;
+pub const KERN_PROC_RUID: ::c_int = 6;
+pub const KERN_PROC_KTHREAD: ::c_int = 7;
+pub const KERN_PROC_SHOW_THREADS: ::c_int = 0x40000000;
+
+pub const KERN_SYSVIPC_MSG_INFO: ::c_int = 1;
+pub const KERN_SYSVIPC_SEM_INFO: ::c_int = 2;
+pub const KERN_SYSVIPC_SHM_INFO: ::c_int = 3;
+
+pub const KERN_PROC_ARGV: ::c_int = 1;
+pub const KERN_PROC_NARGV: ::c_int = 2;
+pub const KERN_PROC_ENV: ::c_int = 3;
+pub const KERN_PROC_NENV: ::c_int = 4;
+
+pub const KI_NGROUPS: ::c_int = 16;
+pub const KI_MAXCOMLEN: ::c_int = 24;
+pub const KI_WMESGLEN: ::c_int = 8;
+pub const KI_MAXLOGNAME: ::c_int = 32;
+pub const KI_EMULNAMELEN: ::c_int = 8;
+
+pub const KVE_ET_OBJ: ::c_int = 0x00000001;
+pub const KVE_ET_SUBMAP: ::c_int = 0x00000002;
+pub const KVE_ET_COPYONWRITE: ::c_int = 0x00000004;
+pub const KVE_ET_NEEDSCOPY: ::c_int = 0x00000008;
+pub const KVE_ET_HOLE: ::c_int = 0x00000010;
+pub const KVE_ET_NOFAULT: ::c_int = 0x00000020;
+pub const KVE_ET_STACK: ::c_int = 0x00000040;
+pub const KVE_ET_WC: ::c_int = 0x000000080;
+pub const KVE_ET_CONCEAL: ::c_int = 0x000000100;
+pub const KVE_ET_SYSCALL: ::c_int = 0x000000200;
+pub const KVE_ET_FREEMAPPED: ::c_int = 0x000000800;
+
+pub const KVE_PROT_NONE: ::c_int = 0x00000000;
+pub const KVE_PROT_READ: ::c_int = 0x00000001;
+pub const KVE_PROT_WRITE: ::c_int = 0x00000002;
+pub const KVE_PROT_EXEC: ::c_int = 0x00000004;
+
+pub const KVE_ADV_NORMAL: ::c_int = 0x00000000;
+pub const KVE_ADV_RANDOM: ::c_int = 0x00000001;
+pub const KVE_ADV_SEQUENTIAL: ::c_int = 0x00000002;
+
+pub const KVE_INH_SHARE: ::c_int = 0x00000000;
+pub const KVE_INH_COPY: ::c_int = 0x00000010;
+pub const KVE_INH_NONE: ::c_int = 0x00000020;
+pub const KVE_INH_ZERO: ::c_int = 0x00000030;
+
+pub const KVE_F_STATIC: ::c_int = 0x1;
+pub const KVE_F_KMEM: ::c_int = 0x2;
+
+pub const CHWFLOW: ::tcflag_t = ::MDMBUF | ::CRTSCTS;
+pub const OLCUC: ::tcflag_t = 0x20;
+pub const ONOCR: ::tcflag_t = 0x40;
+pub const ONLRET: ::tcflag_t = 0x80;
+
+//https://github.com/openbsd/src/blob/HEAD/sys/sys/mount.h
+pub const ISOFSMNT_NORRIP: ::c_int = 0x1; // disable Rock Ridge Ext
+pub const ISOFSMNT_GENS: ::c_int = 0x2; // enable generation numbers
+pub const ISOFSMNT_EXTATT: ::c_int = 0x4; // enable extended attr
+pub const ISOFSMNT_NOJOLIET: ::c_int = 0x8; // disable Joliet Ext
+pub const ISOFSMNT_SESS: ::c_int = 0x10; // use iso_args.sess
+
+pub const NFS_ARGSVERSION: ::c_int = 4; // change when nfs_args changes
+
+pub const NFSMNT_RESVPORT: ::c_int = 0; // always use reserved ports
+pub const NFSMNT_SOFT: ::c_int = 0x1; // soft mount (hard is default)
+pub const NFSMNT_WSIZE: ::c_int = 0x2; // set write size
+pub const NFSMNT_RSIZE: ::c_int = 0x4; // set read size
+pub const NFSMNT_TIMEO: ::c_int = 0x8; // set initial timeout
+pub const NFSMNT_RETRANS: ::c_int = 0x10; // set number of request retries
+pub const NFSMNT_MAXGRPS: ::c_int = 0x20; // set maximum grouplist size
+pub const NFSMNT_INT: ::c_int = 0x40; // allow interrupts on hard mount
+pub const NFSMNT_NOCONN: ::c_int = 0x80; // Don't Connect the socket
+pub const NFSMNT_NQNFS: ::c_int = 0x100; // Use Nqnfs protocol
+pub const NFSMNT_NFSV3: ::c_int = 0x200; // Use NFS Version 3 protocol
+pub const NFSMNT_KERB: ::c_int = 0x400; // Use Kerberos authentication
+pub const NFSMNT_DUMBTIMR: ::c_int = 0x800; // Don't estimate rtt dynamically
+pub const NFSMNT_LEASETERM: ::c_int = 0x1000; // set lease term (nqnfs)
+pub const NFSMNT_READAHEAD: ::c_int = 0x2000; // set read ahead
+pub const NFSMNT_DEADTHRESH: ::c_int = 0x4000; // set dead server retry thresh
+pub const NFSMNT_NOAC: ::c_int = 0x8000; // disable attribute cache
+pub const NFSMNT_RDIRPLUS: ::c_int = 0x10000; // Use Readdirplus for V3
+pub const NFSMNT_READDIRSIZE: ::c_int = 0x20000; // Set readdir size
+
+/* Flags valid only in mount syscall arguments */
+pub const NFSMNT_ACREGMIN: ::c_int = 0x40000; // acregmin field valid
+pub const NFSMNT_ACREGMAX: ::c_int = 0x80000; // acregmax field valid
+pub const NFSMNT_ACDIRMIN: ::c_int = 0x100000; // acdirmin field valid
+pub const NFSMNT_ACDIRMAX: ::c_int = 0x200000; // acdirmax field valid
+
+/* Flags valid only in kernel */
+pub const NFSMNT_INTERNAL: ::c_int = 0xfffc0000; // Bits set internally
+pub const NFSMNT_HASWRITEVERF: ::c_int = 0x40000; // Has write verifier for V3
+pub const NFSMNT_GOTPATHCONF: ::c_int = 0x80000; // Got the V3 pathconf info
+pub const NFSMNT_GOTFSINFO: ::c_int = 0x100000; // Got the V3 fsinfo
+pub const NFSMNT_MNTD: ::c_int = 0x200000; // Mnt server for mnt point
+pub const NFSMNT_DISMINPROG: ::c_int = 0x400000; // Dismount in progress
+pub const NFSMNT_DISMNT: ::c_int = 0x800000; // Dismounted
+pub const NFSMNT_SNDLOCK: ::c_int = 0x1000000; // Send socket lock
+pub const NFSMNT_WANTSND: ::c_int = 0x2000000; // Want above
+pub const NFSMNT_RCVLOCK: ::c_int = 0x4000000; // Rcv socket lock
+pub const NFSMNT_WANTRCV: ::c_int = 0x8000000; // Want above
+pub const NFSMNT_WAITAUTH: ::c_int = 0x10000000; // Wait for authentication
+pub const NFSMNT_HASAUTH: ::c_int = 0x20000000; // Has authenticator
+pub const NFSMNT_WANTAUTH: ::c_int = 0x40000000; // Wants an authenticator
+pub const NFSMNT_AUTHERR: ::c_int = 0x80000000; // Authentication error
+
+pub const MSDOSFSMNT_SHORTNAME: ::c_int = 0x1; // Force old DOS short names only
+pub const MSDOSFSMNT_LONGNAME: ::c_int = 0x2; // Force Win'95 long names
+pub const MSDOSFSMNT_NOWIN95: ::c_int = 0x4; // Completely ignore Win95 entries
+
+pub const NTFS_MFLAG_CASEINS: ::c_int = 0x1;
+pub const NTFS_MFLAG_ALLNAMES: ::c_int = 0x2;
+
+pub const TMPFS_ARGS_VERSION: ::c_int = 1;
+
+const SI_MAXSZ: ::size_t = 128;
+const SI_PAD: ::size_t = (SI_MAXSZ / ::mem::size_of::<::c_int>()) - 3;
+
+pub const MAP_STACK: ::c_int = 0x4000;
+pub const MAP_CONCEAL: ::c_int = 0x8000;
+
+// https://github.com/openbsd/src/blob/HEAD/sys/net/if.h#L187
+pub const IFF_UP: ::c_int = 0x1; // interface is up
+pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid
+pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging
+pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net
+pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link
+pub const IFF_STATICARP: ::c_int = 0x20; // only static ARP
+pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated
+pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol
+pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets
+pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets
+pub const IFF_OACTIVE: ::c_int = 0x400; // transmission in progress
+pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions
+pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
+pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
+pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
+pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
+
+pub const PTHREAD_STACK_MIN: ::size_t = 1_usize << _MAX_PAGE_SHIFT;
+pub const MINSIGSTKSZ: ::size_t = 3_usize << _MAX_PAGE_SHIFT;
+pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + (1_usize << _MAX_PAGE_SHIFT) * 4;
+
+pub const PT_SET_EVENT_MASK: ::c_int = 12;
+pub const PT_GET_EVENT_MASK: ::c_int = 13;
+pub const PT_GET_PROCESS_STATE: ::c_int = 14;
+pub const PT_GET_THREAD_FIRST: ::c_int = 15;
+pub const PT_GET_THREAD_NEXT: ::c_int = 16;
+pub const PT_FIRSTMACH: ::c_int = 32;
+
+pub const SOCK_CLOEXEC: ::c_int = 0x8000;
+pub const SOCK_NONBLOCK: ::c_int = 0x4000;
+pub const SOCK_DNS: ::c_int = 0x1000;
+
+pub const BIOCGRSIG: ::c_ulong = 0x40044273;
+pub const BIOCSRSIG: ::c_ulong = 0x80044272;
+pub const BIOCSDLT: ::c_ulong = 0x8004427a;
+
+pub const PTRACE_FORK: ::c_int = 0x0002;
+
+pub const WCONTINUED: ::c_int = 0x08;
+pub const WEXITED: ::c_int = 0x04;
+pub const WSTOPPED: ::c_int = 0x02; // same as WUNTRACED
+pub const WNOWAIT: ::c_int = 0x10;
+pub const WTRAPPED: ::c_int = 0x20;
+
+pub const P_ALL: ::idtype_t = 0;
+pub const P_PGID: ::idtype_t = 1;
+pub const P_PID: ::idtype_t = 2;
+
+// search.h
+pub const FIND: ::ACTION = 0;
+pub const ENTER: ::ACTION = 1;
+
+// futex.h
+pub const FUTEX_WAIT: ::c_int = 1;
+pub const FUTEX_WAKE: ::c_int = 2;
+pub const FUTEX_REQUEUE: ::c_int = 3;
+pub const FUTEX_PRIVATE_FLAG: ::c_int = 128;
+
+// sysctl.h, kinfo_proc p_eflag constants
+pub const EPROC_CTTY: i32 = 0x01; // controlling tty vnode active
+pub const EPROC_SLEADER: i32 = 0x02; // session leader
+pub const EPROC_UNVEIL: i32 = 0x04; // has unveil settings
+pub const EPROC_LKUNVEIL: i32 = 0x08; // unveil is locked
+
+// Flags for chflags(2)
+pub const UF_SETTABLE: ::c_uint = 0x0000ffff;
+pub const UF_NODUMP: ::c_uint = 0x00000001;
+pub const UF_IMMUTABLE: ::c_uint = 0x00000002;
+pub const UF_APPEND: ::c_uint = 0x00000004;
+pub const UF_OPAQUE: ::c_uint = 0x00000008;
+pub const SF_SETTABLE: ::c_uint = 0xffff0000;
+pub const SF_ARCHIVED: ::c_uint = 0x00010000;
+pub const SF_IMMUTABLE: ::c_uint = 0x00020000;
+pub const SF_APPEND: ::c_uint = 0x00040000;
+
+// sys/exec_elf.h - Legal values for p_type (segment type).
+pub const PT_NULL: u32 = 0;
+pub const PT_LOAD: u32 = 1;
+pub const PT_DYNAMIC: u32 = 2;
+pub const PT_INTERP: u32 = 3;
+pub const PT_NOTE: u32 = 4;
+pub const PT_SHLIB: u32 = 5;
+pub const PT_PHDR: u32 = 6;
+pub const PT_TLS: u32 = 7;
+pub const PT_LOOS: u32 = 0x60000000;
+pub const PT_HIOS: u32 = 0x6fffffff;
+pub const PT_LOPROC: u32 = 0x70000000;
+pub const PT_HIPROC: u32 = 0x7fffffff;
+
+pub const PT_GNU_EH_FRAME: u32 = 0x6474e550;
+pub const PT_GNU_RELRO: u32 = 0x6474e552;
+
+// sys/exec_elf.h - Legal values for p_flags (segment flags).
+pub const PF_X: u32 = 0x1;
+pub const PF_W: u32 = 0x2;
+pub const PF_R: u32 = 0x4;
+pub const PF_MASKOS: u32 = 0x0ff00000;
+pub const PF_MASKPROC: u32 = 0xf0000000;
+
+// sys/mount.h
+pub const MNT_NOPERM: ::c_int = 0x00000020;
+pub const MNT_WXALLOWED: ::c_int = 0x00000800;
+pub const MNT_EXRDONLY: ::c_int = 0x00000080;
+pub const MNT_DEFEXPORTED: ::c_int = 0x00000200;
+pub const MNT_EXPORTANON: ::c_int = 0x00000400;
+pub const MNT_ROOTFS: ::c_int = 0x00004000;
+pub const MNT_NOATIME: ::c_int = 0x00008000;
+pub const MNT_DELEXPORT: ::c_int = 0x00020000;
+pub const MNT_STALLED: ::c_int = 0x00100000;
+pub const MNT_SWAPPABLE: ::c_int = 0x00200000;
+pub const MNT_WANTRDWR: ::c_int = 0x02000000;
+pub const MNT_SOFTDEP: ::c_int = 0x04000000;
+pub const MNT_DOOMED: ::c_int = 0x08000000;
+
+// For use with vfs_fsync and getfsstat
+pub const MNT_WAIT: ::c_int = 1;
+pub const MNT_NOWAIT: ::c_int = 2;
+pub const MNT_LAZY: ::c_int = 3;
+
+// sys/_time.h
+pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
+pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 4;
+pub const CLOCK_UPTIME: ::clockid_t = 5;
+pub const CLOCK_BOOTTIME: ::clockid_t = 6;
+
+pub const LC_COLLATE_MASK: ::c_int = 1 << ::LC_COLLATE;
+pub const LC_CTYPE_MASK: ::c_int = 1 << ::LC_CTYPE;
+pub const LC_MONETARY_MASK: ::c_int = 1 << ::LC_MONETARY;
+pub const LC_NUMERIC_MASK: ::c_int = 1 << ::LC_NUMERIC;
+pub const LC_TIME_MASK: ::c_int = 1 << ::LC_TIME;
+pub const LC_MESSAGES_MASK: ::c_int = 1 << ::LC_MESSAGES;
+
+const _LC_LAST: ::c_int = 7;
+pub const LC_ALL_MASK: ::c_int = (1 << _LC_LAST) - 2;
+
+pub const LC_GLOBAL_LOCALE: ::locale_t = -1isize as ::locale_t;
+
+// sys/reboot.h
+pub const RB_ASKNAME: ::c_int = 0x00001;
+pub const RB_SINGLE: ::c_int = 0x00002;
+pub const RB_NOSYNC: ::c_int = 0x00004;
+pub const RB_HALT: ::c_int = 0x00008;
+pub const RB_INITNAME: ::c_int = 0x00010;
+pub const RB_KDB: ::c_int = 0x00040;
+pub const RB_RDONLY: ::c_int = 0x00080;
+pub const RB_DUMP: ::c_int = 0x00100;
+pub const RB_MINIROOT: ::c_int = 0x00200;
+pub const RB_CONFIG: ::c_int = 0x00400;
+pub const RB_TIMEBAD: ::c_int = 0x00800;
+pub const RB_POWERDOWN: ::c_int = 0x01000;
+pub const RB_SERCONS: ::c_int = 0x02000;
+pub const RB_USERREQ: ::c_int = 0x04000;
+pub const RB_RESET: ::c_int = 0x08000;
+pub const RB_GOODRANDOM: ::c_int = 0x10000;
+pub const RB_UNHIBERNATE: ::c_int = 0x20000;
+
+const_fn! {
+    {const} fn _ALIGN(p: usize) -> usize {
+        (p + _ALIGNBYTES) & !_ALIGNBYTES
+    }
+}
+
+f! {
+    pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
+        (cmsg as *mut ::c_uchar)
+            .offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        _ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
+    }
+
+    pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
+        -> *mut ::cmsghdr
+    {
+        if cmsg.is_null() {
+            return ::CMSG_FIRSTHDR(mhdr);
+        };
+        let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)
+            + _ALIGN(::mem::size_of::<::cmsghdr>());
+        let max = (*mhdr).msg_control as usize
+            + (*mhdr).msg_controllen as usize;
+        if next > max {
+            0 as *mut ::cmsghdr
+        } else {
+            (cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize))
+                as *mut ::cmsghdr
+        }
+    }
+
+    pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
+        (_ALIGN(::mem::size_of::<::cmsghdr>()) + _ALIGN(length as usize))
+            as ::c_uint
+    }
+
+    pub fn major(dev: ::dev_t) -> ::c_uint{
+        ((dev as ::c_uint) >> 8) & 0xff
+    }
+
+    pub fn minor(dev: ::dev_t) -> ::c_uint {
+        let dev = dev as ::c_uint;
+        let mut res = 0;
+        res |= (dev) & 0xff;
+        res |= ((dev) & 0xffff0000) >> 8;
+
+        res
+    }
+}
+
+safe_f! {
+    pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
+        status >> 8
+    }
+
+    pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
+        (status & 0o177) != 0o177 && (status & 0o177) != 0
+    }
+
+    pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
+        (status & 0xff) == 0o177
+    }
+
+    pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
+        (status & 0o177777) == 0o177777
+    }
+
+    pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::dev_t;
+        let mut dev = 0;
+        dev |= (major & 0xff) << 8;
+        dev |= minor & 0xff;
+        dev |= (minor & 0xffff00) << 8;
+        dev
+    }
+}
+
+extern "C" {
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
+    pub fn settimeofday(tp: *const ::timeval, tz: *const ::timezone) -> ::c_int;
+    pub fn pledge(promises: *const ::c_char, execpromises: *const ::c_char) -> ::c_int;
+    pub fn unveil(path: *const ::c_char, permissions: *const ::c_char) -> ::c_int;
+    pub fn strtonum(
+        nptr: *const ::c_char,
+        minval: ::c_longlong,
+        maxval: ::c_longlong,
+        errstr: *mut *const ::c_char,
+    ) -> ::c_longlong;
+    pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn chflags(path: *const ::c_char, flags: ::c_uint) -> ::c_int;
+    pub fn fchflags(fd: ::c_int, flags: ::c_uint) -> ::c_int;
+    pub fn chflagsat(
+        fd: ::c_int,
+        path: *const ::c_char,
+        flags: ::c_uint,
+        atflag: ::c_int,
+    ) -> ::c_int;
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
+    pub fn getnameinfo(
+        sa: *const ::sockaddr,
+        salen: ::socklen_t,
+        host: *mut ::c_char,
+        hostlen: ::size_t,
+        serv: *mut ::c_char,
+        servlen: ::size_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int;
+    pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int;
+    pub fn kevent(
+        kq: ::c_int,
+        changelist: *const ::kevent,
+        nchanges: ::c_int,
+        eventlist: *mut ::kevent,
+        nevents: ::c_int,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+    pub fn getthrid() -> ::pid_t;
+    pub fn pthread_attr_getguardsize(
+        attr: *const ::pthread_attr_t,
+        guardsize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
+    pub fn pthread_attr_getstack(
+        attr: *const ::pthread_attr_t,
+        stackaddr: *mut *mut ::c_void,
+        stacksize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_main_np() -> ::c_int;
+    pub fn pthread_get_name_np(tid: ::pthread_t, name: *mut ::c_char, len: ::size_t);
+    pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
+    pub fn pthread_stackseg_np(thread: ::pthread_t, sinfo: *mut ::stack_t) -> ::c_int;
+
+    pub fn openpty(
+        amaster: *mut ::c_int,
+        aslave: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *const ::termios,
+        winp: *const ::winsize,
+    ) -> ::c_int;
+    pub fn forkpty(
+        amaster: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *const ::termios,
+        winp: *const ::winsize,
+    ) -> ::pid_t;
+
+    pub fn sysctl(
+        name: *const ::c_int,
+        namelen: ::c_uint,
+        oldp: *mut ::c_void,
+        oldlenp: *mut ::size_t,
+        newp: *mut ::c_void,
+        newlen: ::size_t,
+    ) -> ::c_int;
+    pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
+    pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
+    pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: caddr_t, data: ::c_int) -> ::c_int;
+    pub fn utrace(label: *const ::c_char, addr: *const ::c_void, len: ::size_t) -> ::c_int;
+    pub fn memmem(
+        haystack: *const ::c_void,
+        haystacklen: ::size_t,
+        needle: *const ::c_void,
+        needlelen: ::size_t,
+    ) -> *mut ::c_void;
+    // #include <link.h>
+    pub fn dl_iterate_phdr(
+        callback: ::Option<
+            unsafe extern "C" fn(
+                info: *mut dl_phdr_info,
+                size: usize,
+                data: *mut ::c_void,
+            ) -> ::c_int,
+        >,
+        data: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn uselocale(loc: ::locale_t) -> ::locale_t;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+    pub fn duplocale(base: ::locale_t) -> ::locale_t;
+
+    // Added in `OpenBSD` 5.5
+    pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t);
+
+    pub fn setproctitle(fmt: *const ::c_char, ...);
+
+    pub fn freezero(ptr: *mut ::c_void, size: ::size_t);
+    pub fn malloc_conceal(size: ::size_t) -> *mut ::c_void;
+    pub fn calloc_conceal(nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
+
+    pub fn srand48_deterministic(seed: ::c_long);
+    pub fn seed48_deterministic(xseed: *mut ::c_ushort) -> *mut ::c_ushort;
+    pub fn lcong48_deterministic(p: *mut ::c_ushort);
+
+    pub fn lsearch(
+        key: *const ::c_void,
+        base: *mut ::c_void,
+        nelp: *mut ::size_t,
+        width: ::size_t,
+        compar: ::Option<unsafe extern "C" fn(*const ::c_void, *const ::c_void) -> ::c_int>,
+    ) -> *mut ::c_void;
+    pub fn lfind(
+        key: *const ::c_void,
+        base: *const ::c_void,
+        nelp: *mut ::size_t,
+        width: ::size_t,
+        compar: ::Option<unsafe extern "C" fn(*const ::c_void, *const ::c_void) -> ::c_int>,
+    ) -> *mut ::c_void;
+    pub fn hcreate(nelt: ::size_t) -> ::c_int;
+    pub fn hdestroy();
+    pub fn hsearch(entry: ::ENTRY, action: ::ACTION) -> *mut ::ENTRY;
+
+    // futex.h
+    pub fn futex(
+        uaddr: *mut u32,
+        op: ::c_int,
+        val: ::c_int,
+        timeout: *const ::timespec,
+        uaddr2: *mut u32,
+    ) -> ::c_int;
+
+    pub fn mimmutable(addr: *mut ::c_void, len: ::size_t) -> ::c_int;
+
+    pub fn reboot(mode: ::c_int) -> ::c_int;
+}
+
+#[link(name = "execinfo")]
+extern "C" {
+    pub fn backtrace(addrlist: *mut *mut ::c_void, len: ::size_t) -> ::size_t;
+    pub fn backtrace_symbols(addrlist: *const *mut ::c_void, len: ::size_t) -> *mut *mut ::c_char;
+    pub fn backtrace_symbols_fd(
+        addrlist: *const *mut ::c_void,
+        len: ::size_t,
+        fd: ::c_int,
+    ) -> ::c_int;
+    pub fn backtrace_symbols_fmt(
+        addrlist: *const *mut ::c_void,
+        len: ::size_t,
+        fmt: *const ::c_char,
+    ) -> *mut *mut ::c_char;
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        extern {
+            // these functions use statfs which uses the union mount_info:
+            pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
+            pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
+            pub fn getmntinfo(mntbufp: *mut *mut ::statfs, flags: ::c_int) -> ::c_int;
+            pub fn getfsstat(buf: *mut statfs, bufsize: ::size_t, flags: ::c_int) -> ::c_int;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "aarch64")] {
+        mod aarch64;
+        pub use self::aarch64::*;
+    } else if #[cfg(target_arch = "arm")] {
+        mod arm;
+        pub use self::arm::*;
+    } else if #[cfg(target_arch = "mips64")] {
+        mod mips64;
+        pub use self::mips64::*;
+    } else if #[cfg(target_arch = "powerpc")] {
+        mod powerpc;
+        pub use self::powerpc::*;
+    } else if #[cfg(target_arch = "powerpc64")] {
+        mod powerpc64;
+        pub use self::powerpc64::*;
+    } else if #[cfg(target_arch = "riscv64")] {
+        mod riscv64;
+        pub use self::riscv64::*;
+    } else if #[cfg(target_arch = "sparc64")] {
+        mod sparc64;
+        pub use self::sparc64::*;
+    } else if #[cfg(target_arch = "x86")] {
+        mod x86;
+        pub use self::x86::*;
+    } else if #[cfg(target_arch = "x86_64")] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    } else {
+        // Unknown target_arch
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,16 @@
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type c_char = u8;
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+pub const _MAX_PAGE_SHIFT: u32 = 12;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,16 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = u8;
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+pub const _MAX_PAGE_SHIFT: u32 = 12;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/riscv64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/riscv64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/riscv64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/riscv64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,35 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = u8;
+pub type ucontext_t = sigcontext;
+
+s! {
+    pub struct sigcontext {
+        __sc_unused: ::c_int,
+        pub sc_mask: ::c_int,
+        pub sc_ra: ::c_long,
+        pub sc_sp: ::c_long,
+        pub sc_gp: ::c_long,
+        pub sc_tp: ::c_long,
+        pub sc_t: [::c_long; 7],
+        pub sc_s: [::c_long; 12],
+        pub sc_a: [::c_long; 8],
+        pub sc_sepc: ::c_long,
+        pub sc_f: [::c_long; 32],
+        pub sc_fcsr: ::c_long,
+        pub sc_cookie: ::c_long,
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+pub const _MAX_PAGE_SHIFT: u32 = 12;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,8 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = i8;
+
+#[doc(hidden)]
+pub const _ALIGNBYTES: usize = 0xf;
+
+pub const _MAX_PAGE_SHIFT: u32 = 13;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,16 @@
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type c_char = i8;
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 4 - 1;
+    }
+}
+
+pub const _MAX_PAGE_SHIFT: u32 = 12;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,130 @@
+use PT_FIRSTMACH;
+
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = i8;
+pub type ucontext_t = sigcontext;
+
+s! {
+    pub struct sigcontext {
+        pub sc_rdi: ::c_long,
+        pub sc_rsi: ::c_long,
+        pub sc_rdx: ::c_long,
+        pub sc_rcx: ::c_long,
+        pub sc_r8: ::c_long,
+        pub sc_r9: ::c_long,
+        pub sc_r10: ::c_long,
+        pub sc_r11: ::c_long,
+        pub sc_r12: ::c_long,
+        pub sc_r13: ::c_long,
+        pub sc_r14: ::c_long,
+        pub sc_r15: ::c_long,
+        pub sc_rbp: ::c_long,
+        pub sc_rbx: ::c_long,
+        pub sc_rax: ::c_long,
+        pub sc_gs: ::c_long,
+        pub sc_fs: ::c_long,
+        pub sc_es: ::c_long,
+        pub sc_ds: ::c_long,
+        pub sc_trapno: ::c_long,
+        pub sc_err: ::c_long,
+        pub sc_rip: ::c_long,
+        pub sc_cs: ::c_long,
+        pub sc_rflags: ::c_long,
+        pub sc_rsp: ::c_long,
+        pub sc_ss: ::c_long,
+        pub sc_fpstate: *mut fxsave64,
+        __sc_unused: ::c_int,
+        pub sc_mask: ::c_int,
+        pub sc_cookie: ::c_long,
+    }
+}
+
+s_no_extra_traits! {
+    #[repr(packed)]
+    pub struct fxsave64 {
+        pub fx_fcw: u16,
+        pub fx_fsw: u16,
+        pub fx_ftw: u8,
+        __fx_unused1: u8,
+        pub fx_fop: u16,
+        pub fx_rip: u64,
+        pub fx_rdp: u64,
+        pub fx_mxcsr: u32,
+        pub fx_mxcsr_mask: u32,
+        pub fx_st: [[u64; 2]; 8],
+        pub fx_xmm: [[u64; 2]; 16],
+        __fx_unused3: [u8; 96],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        // `fxsave64` is packed, so field access is unaligned.
+        // use {x} to create temporary storage, copy field to it, and do aligned access.
+        impl PartialEq for fxsave64 {
+            fn eq(&self, other: &fxsave64) -> bool {
+                return {self.fx_fcw} == {other.fx_fcw} &&
+                    {self.fx_fsw} == {other.fx_fsw} &&
+                    {self.fx_ftw} == {other.fx_ftw} &&
+                    {self.fx_fop} == {other.fx_fop} &&
+                    {self.fx_rip} == {other.fx_rip} &&
+                    {self.fx_rdp} == {other.fx_rdp} &&
+                    {self.fx_mxcsr} == {other.fx_mxcsr} &&
+                    {self.fx_mxcsr_mask} == {other.fx_mxcsr_mask} &&
+                    {self.fx_st}.iter().zip({other.fx_st}.iter()).all(|(a,b)| a == b) &&
+                    {self.fx_xmm}.iter().zip({other.fx_xmm}.iter()).all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for fxsave64 {}
+        impl ::fmt::Debug for fxsave64 {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("fxsave64")
+                    .field("fx_fcw", &{self.fx_fcw})
+                    .field("fx_fsw", &{self.fx_fsw})
+                    .field("fx_ftw", &{self.fx_ftw})
+                    .field("fx_fop", &{self.fx_fop})
+                    .field("fx_rip", &{self.fx_rip})
+                    .field("fx_rdp", &{self.fx_rdp})
+                    .field("fx_mxcsr", &{self.fx_mxcsr})
+                    .field("fx_mxcsr_mask", &{self.fx_mxcsr_mask})
+                    // FIXME: .field("fx_st", &{self.fx_st})
+                    // FIXME: .field("fx_xmm", &{self.fx_xmm})
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for fxsave64 {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                {self.fx_fcw}.hash(state);
+                {self.fx_fsw}.hash(state);
+                {self.fx_ftw}.hash(state);
+                {self.fx_fop}.hash(state);
+                {self.fx_rip}.hash(state);
+                {self.fx_rdp}.hash(state);
+                {self.fx_mxcsr}.hash(state);
+                {self.fx_mxcsr_mask}.hash(state);
+                {self.fx_st}.hash(state);
+                {self.fx_xmm}.hash(state);
+            }
+        }
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+pub const _MAX_PAGE_SHIFT: u32 = 12;
+
+pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0;
+pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
+pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
+pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
+pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/haiku/b32.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/haiku/b32.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/haiku/b32.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/haiku/b32.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,20 @@
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type time_t = i32;
+
+pub type Elf_Addr = ::Elf32_Addr;
+pub type Elf_Half = ::Elf32_Half;
+pub type Elf_Phdr = ::Elf32_Phdr;
+
+s! {
+    pub struct Elf32_Phdr {
+        pub p_type: ::Elf32_Word,
+        pub p_offset: ::Elf32_Off,
+        pub p_vaddr: ::Elf32_Addr,
+        pub p_paddr: ::Elf32_Addr,
+        pub p_filesz: ::Elf32_Word,
+        pub p_memsz: ::Elf32_Word,
+        pub p_flags: ::Elf32_Word,
+        pub p_align: ::Elf32_Word,
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/haiku/b64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/haiku/b64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/haiku/b64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/haiku/b64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,20 @@
+pub type c_ulong = u64;
+pub type c_long = i64;
+pub type time_t = i64;
+
+pub type Elf_Addr = ::Elf64_Addr;
+pub type Elf_Half = ::Elf64_Half;
+pub type Elf_Phdr = ::Elf64_Phdr;
+
+s! {
+    pub struct Elf64_Phdr {
+        pub p_type: ::Elf64_Word,
+        pub p_flags: ::Elf64_Word,
+        pub p_offset: ::Elf64_Off,
+        pub p_vaddr: ::Elf64_Addr,
+        pub p_paddr: ::Elf64_Addr,
+        pub p_filesz: ::Elf64_Xword,
+        pub p_memsz: ::Elf64_Xword,
+        pub p_align: ::Elf64_Xword,
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/haiku/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/haiku/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/haiku/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/haiku/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,2181 @@
+pub type rlim_t = ::uintptr_t;
+pub type sa_family_t = u8;
+pub type pthread_key_t = ::c_int;
+pub type nfds_t = ::c_ulong;
+pub type tcflag_t = ::c_uint;
+pub type speed_t = ::c_uchar;
+pub type c_char = i8;
+pub type clock_t = i32;
+pub type clockid_t = i32;
+pub type suseconds_t = i32;
+pub type wchar_t = i32;
+pub type off_t = i64;
+pub type ino_t = i64;
+pub type blkcnt_t = i64;
+pub type blksize_t = i32;
+pub type dev_t = i32;
+pub type mode_t = u32;
+pub type nlink_t = i32;
+pub type useconds_t = u32;
+pub type socklen_t = u32;
+pub type pthread_t = ::uintptr_t;
+pub type pthread_condattr_t = ::uintptr_t;
+pub type pthread_mutexattr_t = ::uintptr_t;
+pub type pthread_rwlockattr_t = ::uintptr_t;
+pub type sigset_t = u64;
+pub type fsblkcnt_t = i64;
+pub type fsfilcnt_t = i64;
+pub type pthread_attr_t = *mut ::c_void;
+pub type nl_item = ::c_int;
+pub type id_t = i32;
+pub type idtype_t = ::c_int;
+pub type fd_mask = u32;
+pub type regoff_t = ::c_int;
+pub type key_t = i32;
+pub type msgqnum_t = u32;
+pub type msglen_t = u32;
+
+pub type Elf32_Addr = u32;
+pub type Elf32_Half = u16;
+pub type Elf32_Off = u32;
+pub type Elf32_Sword = i32;
+pub type Elf32_Word = u32;
+
+pub type Elf64_Addr = u64;
+pub type Elf64_Half = u16;
+pub type Elf64_Off = u64;
+pub type Elf64_Sword = i32;
+pub type Elf64_Sxword = i64;
+pub type Elf64_Word = u32;
+pub type Elf64_Xword = u64;
+
+pub type ENTRY = entry;
+pub type ACTION = ::c_int;
+
+pub type posix_spawnattr_t = *mut ::c_void;
+pub type posix_spawn_file_actions_t = *mut ::c_void;
+
+pub type StringList = _stringlist;
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum timezone {}
+impl ::Copy for timezone {}
+impl ::Clone for timezone {
+    fn clone(&self) -> timezone {
+        *self
+    }
+}
+
+impl siginfo_t {
+    pub unsafe fn si_addr(&self) -> *mut ::c_void {
+        self.si_addr
+    }
+
+    pub unsafe fn si_pid(&self) -> ::pid_t {
+        self.si_pid
+    }
+
+    pub unsafe fn si_uid(&self) -> ::uid_t {
+        self.si_uid
+    }
+
+    pub unsafe fn si_status(&self) -> ::c_int {
+        self.si_status
+    }
+}
+
+s! {
+    pub struct in_addr {
+        pub s_addr: ::in_addr_t,
+    }
+
+    pub struct ip_mreq {
+        pub imr_multiaddr: in_addr,
+        pub imr_interface: in_addr,
+    }
+
+    pub struct sockaddr {
+        pub sa_len: u8,
+        pub sa_family: sa_family_t,
+        pub sa_data: [u8; 30],
+    }
+
+    pub struct sockaddr_in {
+        pub sin_len: u8,
+        pub sin_family: sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [i8; 24],
+    }
+
+    pub struct sockaddr_in6 {
+        pub sin6_len: u8,
+        pub sin6_family: u8,
+        pub sin6_port: u16,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_scope_id: u32,
+    }
+
+    pub struct addrinfo {
+        pub ai_flags: ::c_int,
+        pub ai_family: ::c_int,
+        pub ai_socktype: ::c_int,
+        pub ai_protocol: ::c_int,
+        pub ai_addrlen: socklen_t,
+        pub ai_canonname: *mut c_char,
+        pub ai_addr: *mut ::sockaddr,
+        pub ai_next: *mut addrinfo,
+    }
+
+    pub struct ifaddrs {
+        pub ifa_next: *mut ifaddrs,
+        pub ifa_name: *const ::c_char,
+        pub ifa_flags: ::c_uint,
+        pub ifa_addr: *mut ::sockaddr,
+        pub ifa_netmask: *mut ::sockaddr,
+        pub ifa_dstaddr: *mut ::sockaddr,
+        pub ifa_data: *mut ::c_void,
+    }
+
+    pub struct fd_set {
+        // size for 1024 bits, and a fd_mask with size u32
+        fds_bits: [fd_mask; 32],
+    }
+
+    pub struct tm {
+        pub tm_sec: ::c_int,
+        pub tm_min: ::c_int,
+        pub tm_hour: ::c_int,
+        pub tm_mday: ::c_int,
+        pub tm_mon: ::c_int,
+        pub tm_year: ::c_int,
+        pub tm_wday: ::c_int,
+        pub tm_yday: ::c_int,
+        pub tm_isdst: ::c_int,
+        pub tm_gmtoff: ::c_int,
+        pub tm_zone: *mut ::c_char,
+    }
+
+    pub struct utsname {
+        pub sysname: [::c_char; 32],
+        pub nodename: [::c_char; 32],
+        pub release: [::c_char; 32],
+        pub version: [::c_char; 32],
+        pub machine: [::c_char; 32],
+    }
+
+    pub struct lconv {
+        pub decimal_point: *mut ::c_char,
+        pub thousands_sep: *mut ::c_char,
+        pub grouping: *mut ::c_char,
+        pub int_curr_symbol: *mut ::c_char,
+        pub currency_symbol: *mut ::c_char,
+        pub mon_decimal_point: *mut ::c_char,
+        pub mon_thousands_sep: *mut ::c_char,
+        pub mon_grouping: *mut ::c_char,
+        pub positive_sign: *mut ::c_char,
+        pub negative_sign: *mut ::c_char,
+        pub int_frac_digits: ::c_char,
+        pub frac_digits: ::c_char,
+        pub p_cs_precedes: ::c_char,
+        pub p_sep_by_space: ::c_char,
+        pub n_cs_precedes: ::c_char,
+        pub n_sep_by_space: ::c_char,
+        pub p_sign_posn: ::c_char,
+        pub n_sign_posn: ::c_char,
+        pub int_p_cs_precedes: ::c_char,
+        pub int_p_sep_by_space: ::c_char,
+        pub int_n_cs_precedes: ::c_char,
+        pub int_n_sep_by_space: ::c_char,
+        pub int_p_sign_posn: ::c_char,
+        pub int_n_sign_posn: ::c_char,
+    }
+
+    pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::c_int,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: socklen_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct cmsghdr {
+        pub cmsg_len: ::socklen_t,
+        pub cmsg_level: ::c_int,
+        pub cmsg_type: ::c_int,
+    }
+
+    pub struct Dl_info {
+        pub dli_fname: *const ::c_char,
+        pub dli_fbase: *mut ::c_void,
+        pub dli_sname: *const ::c_char,
+        pub dli_saddr: *mut ::c_void,
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line:  ::c_char,
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::speed_t,
+        pub c_cc: [::cc_t; ::NCCS],
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct stat {
+        pub st_dev: dev_t,
+        pub st_ino: ino_t,
+        pub st_mode: mode_t,
+        pub st_nlink: nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_size: off_t,
+        pub st_rdev: dev_t,
+        pub st_blksize: blksize_t,
+        pub st_atime: time_t,
+        pub st_atime_nsec: c_long,
+        pub st_mtime: time_t,
+        pub st_mtime_nsec: c_long,
+        pub st_ctime: time_t,
+        pub st_ctime_nsec: c_long,
+        pub st_crtime: time_t,
+        pub st_crtime_nsec: c_long,
+        pub st_type: u32,
+        pub st_blocks: blkcnt_t,
+    }
+
+    pub struct glob_t {
+        pub gl_pathc: ::size_t,
+        __unused1: ::size_t,
+        pub gl_offs: ::size_t,
+        __unused2: ::size_t,
+        pub gl_pathv: *mut *mut c_char,
+
+        __unused3: *mut ::c_void,
+        __unused4: *mut ::c_void,
+        __unused5: *mut ::c_void,
+        __unused6: *mut ::c_void,
+        __unused7: *mut ::c_void,
+        __unused8: *mut ::c_void,
+    }
+
+    pub struct pthread_mutex_t {
+        flags: u32,
+        lock: i32,
+        unused: i32,
+        owner: i32,
+        owner_count: i32,
+    }
+
+    pub struct pthread_cond_t {
+        flags: u32,
+        unused: i32,
+        mutex: *mut ::c_void,
+        waiter_count: i32,
+        lock: i32,
+    }
+
+    pub struct pthread_rwlock_t {
+        flags: u32,
+        owner: i32,
+        lock_sem: i32,      // this is actually a union
+        lock_count: i32,
+        reader_count: i32,
+        writer_count: i32,
+        waiters: [*mut ::c_void; 2],
+    }
+
+    pub struct pthread_spinlock_t {
+        lock: u32,
+    }
+
+    pub struct passwd {
+        pub pw_name: *mut ::c_char,
+        pub pw_passwd: *mut ::c_char,
+        pub pw_uid: ::uid_t,
+        pub pw_gid: ::gid_t,
+        pub pw_dir: *mut ::c_char,
+        pub pw_shell: *mut ::c_char,
+        pub pw_gecos: *mut ::c_char,
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_size: ::size_t,
+        pub ss_flags: ::c_int,
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_code: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_pid: ::pid_t,
+        pub si_uid: ::uid_t,
+        pub si_addr: *mut ::c_void,
+        pub si_status: ::c_int,
+        pub si_band: c_long,
+        pub sigval: *mut ::c_void,
+    }
+
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t, //actually a union with sa_handler
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        sa_userdata: *mut ::c_void,
+    }
+
+    pub struct sem_t {
+        pub type_: i32,
+        pub named_sem_id: i32, // actually a union with unnamed_sem (i32)
+        pub padding: [i32; 2],
+    }
+
+    pub struct ucred {
+        pub pid: ::pid_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+    }
+
+    pub struct sockaddr_dl {
+        pub sdl_len: u8,
+        pub sdl_family: u8,
+        pub sdl_e_type: u16,
+        pub sdl_index: u32,
+        pub sdl_type: u8,
+        pub sdl_nlen: u8,
+        pub sdl_alen: u8,
+        pub sdl_slen: u8,
+        pub sdl_data: [u8; 46],
+    }
+
+    pub struct spwd {
+        pub sp_namp: *mut ::c_char,
+        pub sp_pwdp: *mut ::c_char,
+        pub sp_lstchg: ::c_int,
+        pub sp_min: ::c_int,
+        pub sp_max: ::c_int,
+        pub sp_warn: ::c_int,
+        pub sp_inact: ::c_int,
+        pub sp_expire: ::c_int,
+        pub sp_flag: ::c_int,
+    }
+
+    pub struct regex_t {
+        __buffer: *mut ::c_void,
+        __allocated: ::size_t,
+        __used: ::size_t,
+        __syntax: ::c_ulong,
+        __fastmap: *mut ::c_char,
+        __translate: *mut ::c_char,
+        __re_nsub: ::size_t,
+        __bitfield: u8,
+    }
+
+    pub struct regmatch_t {
+        pub rm_so: regoff_t,
+        pub rm_eo: regoff_t,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::time_t,
+    }
+
+    pub struct ipc_perm {
+        pub key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+    }
+
+    pub struct sembuf {
+        pub sem_num: ::c_ushort,
+        pub sem_op: ::c_short,
+        pub sem_flg: ::c_short,
+    }
+
+    pub struct entry {
+        pub key: *mut ::c_char,
+        pub data: *mut ::c_void,
+    }
+
+    pub struct option {
+        pub name: *const ::c_char,
+        pub has_arg: ::c_int,
+        pub flag: *mut ::c_int,
+        pub val: ::c_int,
+    }
+
+    pub struct _stringlist {
+        pub sl_str: *mut *mut ::c_char,
+        pub sl_max: ::size_t,
+        pub sl_cur: ::size_t,
+    }
+
+    pub struct dl_phdr_info {
+        pub dlpi_addr: ::Elf_Addr,
+        pub dlpi_name: *const ::c_char,
+        pub dlpi_phdr: *const ::Elf_Phdr,
+        pub dlpi_phnum: ::Elf_Half,
+    }
+}
+
+s_no_extra_traits! {
+    pub struct sockaddr_un {
+        pub sun_len: u8,
+        pub sun_family: sa_family_t,
+        pub sun_path: [::c_char; 126]
+    }
+    pub struct sockaddr_storage {
+        pub ss_len: u8,
+        pub ss_family: sa_family_t,
+        __ss_pad1: [u8; 6],
+        __ss_pad2: u64,
+        __ss_pad3: [u8; 112],
+    }
+    pub struct dirent {
+        pub d_dev: dev_t,
+        pub d_pdev: dev_t,
+        pub d_ino: ino_t,
+        pub d_pino: i64,
+        pub d_reclen: ::c_ushort,
+        pub d_name: [::c_char; 1024], // Max length is _POSIX_PATH_MAX
+    }
+
+    pub struct sigevent {
+        pub sigev_notify: ::c_int,
+        pub sigev_signo: ::c_int,
+        pub sigev_value: ::sigval,
+        __unused1: *mut ::c_void, // actually a function pointer
+        pub sigev_notify_attributes: *mut ::pthread_attr_t,
+    }
+
+    pub struct utmpx {
+        pub ut_type: ::c_short,
+        pub ut_tv: ::timeval,
+        pub ut_id: [::c_char; 8],
+        pub ut_pid: ::pid_t,
+        pub ut_user: [::c_char; 32],
+        pub ut_line: [::c_char; 16],
+        pub ut_host: [::c_char; 128],
+        __ut_reserved: [::c_char; 64],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for utmpx {
+            fn eq(&self, other: &utmpx) -> bool {
+                self.ut_type == other.ut_type
+                    && self.ut_tv == other.ut_tv
+                    && self.ut_id == other.ut_id
+                    && self.ut_pid == other.ut_pid
+                    && self.ut_user == other.ut_user
+                    && self.ut_line == other.ut_line
+                    && self.ut_host.iter().zip(other.ut_host.iter()).all(|(a,b)| a == b)
+                    && self.__ut_reserved == other.__ut_reserved
+            }
+        }
+
+        impl Eq for utmpx {}
+
+        impl ::fmt::Debug for utmpx {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("utmpx")
+                    .field("ut_type", &self.ut_type)
+                    .field("ut_tv", &self.ut_tv)
+                    .field("ut_id", &self.ut_id)
+                    .field("ut_pid", &self.ut_pid)
+                    .field("ut_user", &self.ut_user)
+                    .field("ut_line", &self.ut_line)
+                    .field("ut_host", &self.ut_host)
+                    .field("__ut_reserved", &self.__ut_reserved)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for utmpx {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ut_type.hash(state);
+                self.ut_tv.hash(state);
+                self.ut_id.hash(state);
+                self.ut_pid.hash(state);
+                self.ut_user.hash(state);
+                self.ut_line.hash(state);
+                self.ut_host.hash(state);
+                self.__ut_reserved.hash(state);
+            }
+        }
+        impl PartialEq for sockaddr_un {
+            fn eq(&self, other: &sockaddr_un) -> bool {
+                self.sun_len == other.sun_len
+                    && self.sun_family == other.sun_family
+                    && self
+                    .sun_path
+                    .iter()
+                    .zip(other.sun_path.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for sockaddr_un {}
+        impl ::fmt::Debug for sockaddr_un {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_un")
+                    .field("sun_len", &self.sun_len)
+                    .field("sun_family", &self.sun_family)
+                    // FIXME: .field("sun_path", &self.sun_path)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sockaddr_un {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sun_len.hash(state);
+                self.sun_family.hash(state);
+                self.sun_path.hash(state);
+            }
+        }
+
+        impl PartialEq for sockaddr_storage {
+            fn eq(&self, other: &sockaddr_storage) -> bool {
+                self.ss_len == other.ss_len
+                    && self.ss_family == other.ss_family
+                    && self
+                    .__ss_pad1
+                    .iter()
+                    .zip(other.__ss_pad1.iter())
+                    .all(|(a, b)| a == b)
+                    && self.__ss_pad2 == other.__ss_pad2
+                    && self
+                    .__ss_pad3
+                    .iter()
+                    .zip(other.__ss_pad3.iter())
+                    .all(|(a, b)| a == b)
+            }
+        }
+        impl Eq for sockaddr_storage {}
+        impl ::fmt::Debug for sockaddr_storage {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_storage")
+                    .field("ss_len", &self.ss_len)
+                    .field("ss_family", &self.ss_family)
+                    .field("__ss_pad1", &self.__ss_pad1)
+                    .field("__ss_pad2", &self.__ss_pad2)
+                    // FIXME: .field("__ss_pad3", &self.__ss_pad3)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sockaddr_storage {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ss_len.hash(state);
+                self.ss_family.hash(state);
+                self.__ss_pad1.hash(state);
+                self.__ss_pad2.hash(state);
+                self.__ss_pad3.hash(state);
+            }
+        }
+
+        impl PartialEq for dirent {
+            fn eq(&self, other: &dirent) -> bool {
+                self.d_dev == other.d_dev
+                    && self.d_pdev == other.d_pdev
+                    && self.d_ino == other.d_ino
+                    && self.d_pino == other.d_pino
+                    && self.d_reclen == other.d_reclen
+                    && self
+                    .d_name
+                    .iter()
+                    .zip(other.d_name.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for dirent {}
+        impl ::fmt::Debug for dirent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("dirent")
+                    .field("d_dev", &self.d_dev)
+                    .field("d_pdev", &self.d_pdev)
+                    .field("d_ino", &self.d_ino)
+                    .field("d_pino", &self.d_pino)
+                    .field("d_reclen", &self.d_reclen)
+                    // FIXME: .field("d_name", &self.d_name)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for dirent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.d_dev.hash(state);
+                self.d_pdev.hash(state);
+                self.d_ino.hash(state);
+                self.d_pino.hash(state);
+                self.d_reclen.hash(state);
+                self.d_name.hash(state);
+            }
+        }
+
+        impl PartialEq for sigevent {
+            fn eq(&self, other: &sigevent) -> bool {
+                self.sigev_notify == other.sigev_notify
+                    && self.sigev_signo == other.sigev_signo
+                    && self.sigev_value == other.sigev_value
+                    && self.sigev_notify_attributes
+                        == other.sigev_notify_attributes
+            }
+        }
+        impl Eq for sigevent {}
+        impl ::fmt::Debug for sigevent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sigevent")
+                    .field("sigev_notify", &self.sigev_notify)
+                    .field("sigev_signo", &self.sigev_signo)
+                    .field("sigev_value", &self.sigev_value)
+                    .field("sigev_notify_attributes",
+                           &self.sigev_notify_attributes)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sigevent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sigev_notify.hash(state);
+                self.sigev_signo.hash(state);
+                self.sigev_value.hash(state);
+                self.sigev_notify_attributes.hash(state);
+            }
+        }
+    }
+}
+
+pub const EXIT_FAILURE: ::c_int = 1;
+pub const EXIT_SUCCESS: ::c_int = 0;
+pub const RAND_MAX: ::c_int = 2147483647;
+pub const EOF: ::c_int = -1;
+pub const SEEK_SET: ::c_int = 0;
+pub const SEEK_CUR: ::c_int = 1;
+pub const SEEK_END: ::c_int = 2;
+pub const L_SET: ::c_int = SEEK_SET;
+pub const L_INCR: ::c_int = SEEK_CUR;
+pub const L_XTND: ::c_int = SEEK_END;
+pub const _IOFBF: ::c_int = 0;
+pub const _IONBF: ::c_int = 2;
+pub const _IOLBF: ::c_int = 1;
+
+pub const F_DUPFD: ::c_int = 0x0001;
+pub const F_GETFD: ::c_int = 0x0002;
+pub const F_SETFD: ::c_int = 0x0004;
+pub const F_GETFL: ::c_int = 0x0008;
+pub const F_SETFL: ::c_int = 0x0010;
+pub const F_GETLK: ::c_int = 0x0020;
+pub const F_SETLK: ::c_int = 0x0080;
+pub const F_SETLKW: ::c_int = 0x0100;
+pub const F_DUPFD_CLOEXEC: ::c_int = 0x0200;
+
+pub const F_RDLCK: ::c_int = 0x0040;
+pub const F_UNLCK: ::c_int = 0x0200;
+pub const F_WRLCK: ::c_int = 0x0400;
+
+pub const AT_FDCWD: ::c_int = -100;
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x01;
+pub const AT_SYMLINK_FOLLOW: ::c_int = 0x02;
+pub const AT_REMOVEDIR: ::c_int = 0x04;
+pub const AT_EACCESS: ::c_int = 0x08;
+
+pub const POLLIN: ::c_short = 0x0001;
+pub const POLLOUT: ::c_short = 0x0002;
+pub const POLLRDNORM: ::c_short = POLLIN;
+pub const POLLWRNORM: ::c_short = POLLOUT;
+pub const POLLRDBAND: ::c_short = 0x0008;
+pub const POLLWRBAND: ::c_short = 0x0010;
+pub const POLLPRI: ::c_short = 0x0020;
+pub const POLLERR: ::c_short = 0x0004;
+pub const POLLHUP: ::c_short = 0x0080;
+pub const POLLNVAL: ::c_short = 0x1000;
+
+pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
+pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
+
+pub const CLOCK_REALTIME: ::c_int = -1;
+pub const CLOCK_MONOTONIC: ::c_int = 0;
+pub const CLOCK_PROCESS_CPUTIME_ID: ::c_int = -2;
+pub const CLOCK_THREAD_CPUTIME_ID: ::c_int = -3;
+
+pub const RLIMIT_CORE: ::c_int = 0;
+pub const RLIMIT_CPU: ::c_int = 1;
+pub const RLIMIT_DATA: ::c_int = 2;
+pub const RLIMIT_FSIZE: ::c_int = 3;
+pub const RLIMIT_NOFILE: ::c_int = 4;
+pub const RLIMIT_STACK: ::c_int = 5;
+pub const RLIMIT_AS: ::c_int = 6;
+pub const RLIM_INFINITY: ::rlim_t = 0xffffffff;
+// Haiku specific
+pub const RLIMIT_NOVMON: ::c_int = 7;
+#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+pub const RLIM_NLIMITS: ::c_int = 8;
+
+pub const RUSAGE_SELF: ::c_int = 0;
+
+pub const RTLD_LAZY: ::c_int = 0;
+
+pub const NCCS: usize = 11;
+
+pub const O_RDONLY: ::c_int = 0x0000;
+pub const O_WRONLY: ::c_int = 0x0001;
+pub const O_RDWR: ::c_int = 0x0002;
+pub const O_ACCMODE: ::c_int = 0x0003;
+
+pub const O_EXCL: ::c_int = 0x0100;
+pub const O_CREAT: ::c_int = 0x0200;
+pub const O_TRUNC: ::c_int = 0x0400;
+pub const O_NOCTTY: ::c_int = 0x1000;
+pub const O_NOTRAVERSE: ::c_int = 0x2000;
+
+pub const O_CLOEXEC: ::c_int = 0x00000040;
+pub const O_NONBLOCK: ::c_int = 0x00000080;
+pub const O_APPEND: ::c_int = 0x00000800;
+pub const O_SYNC: ::c_int = 0x00010000;
+pub const O_RSYNC: ::c_int = 0x00020000;
+pub const O_DSYNC: ::c_int = 0x00040000;
+pub const O_NOFOLLOW: ::c_int = 0x00080000;
+pub const O_NOCACHE: ::c_int = 0x00100000;
+pub const O_DIRECTORY: ::c_int = 0x00200000;
+
+pub const S_IFIFO: ::mode_t = 4096;
+pub const S_IFCHR: ::mode_t = 8192;
+pub const S_IFBLK: ::mode_t = 24576;
+pub const S_IFDIR: ::mode_t = 16384;
+pub const S_IFREG: ::mode_t = 32768;
+pub const S_IFLNK: ::mode_t = 40960;
+pub const S_IFSOCK: ::mode_t = 49152;
+pub const S_IFMT: ::mode_t = 61440;
+
+pub const S_IRWXU: ::mode_t = 0o00700;
+pub const S_IRUSR: ::mode_t = 0o00400;
+pub const S_IWUSR: ::mode_t = 0o00200;
+pub const S_IXUSR: ::mode_t = 0o00100;
+pub const S_IRWXG: ::mode_t = 0o00070;
+pub const S_IRGRP: ::mode_t = 0o00040;
+pub const S_IWGRP: ::mode_t = 0o00020;
+pub const S_IXGRP: ::mode_t = 0o00010;
+pub const S_IRWXO: ::mode_t = 0o00007;
+pub const S_IROTH: ::mode_t = 0o00004;
+pub const S_IWOTH: ::mode_t = 0o00002;
+pub const S_IXOTH: ::mode_t = 0o00001;
+
+pub const F_OK: ::c_int = 0;
+pub const R_OK: ::c_int = 4;
+pub const W_OK: ::c_int = 2;
+pub const X_OK: ::c_int = 1;
+pub const STDIN_FILENO: ::c_int = 0;
+pub const STDOUT_FILENO: ::c_int = 1;
+pub const STDERR_FILENO: ::c_int = 2;
+
+pub const SIGHUP: ::c_int = 1;
+pub const SIGINT: ::c_int = 2;
+pub const SIGQUIT: ::c_int = 3;
+pub const SIGILL: ::c_int = 4;
+pub const SIGCHLD: ::c_int = 5;
+pub const SIGABRT: ::c_int = 6;
+pub const SIGPIPE: ::c_int = 7;
+pub const SIGFPE: ::c_int = 8;
+pub const SIGKILL: ::c_int = 9;
+pub const SIGSTOP: ::c_int = 10;
+pub const SIGSEGV: ::c_int = 11;
+pub const SIGCONT: ::c_int = 12;
+pub const SIGTSTP: ::c_int = 13;
+pub const SIGALRM: ::c_int = 14;
+pub const SIGTERM: ::c_int = 15;
+pub const SIGTTIN: ::c_int = 16;
+pub const SIGTTOU: ::c_int = 17;
+pub const SIGUSR1: ::c_int = 18;
+pub const SIGUSR2: ::c_int = 19;
+pub const SIGWINCH: ::c_int = 20;
+pub const SIGKILLTHR: ::c_int = 21;
+pub const SIGTRAP: ::c_int = 22;
+pub const SIGPOLL: ::c_int = 23;
+pub const SIGPROF: ::c_int = 24;
+pub const SIGSYS: ::c_int = 25;
+pub const SIGURG: ::c_int = 26;
+pub const SIGVTALRM: ::c_int = 27;
+pub const SIGXCPU: ::c_int = 28;
+pub const SIGXFSZ: ::c_int = 29;
+pub const SIGBUS: ::c_int = 30;
+
+pub const SIG_BLOCK: ::c_int = 1;
+pub const SIG_UNBLOCK: ::c_int = 2;
+pub const SIG_SETMASK: ::c_int = 3;
+
+pub const SIGEV_NONE: ::c_int = 0;
+pub const SIGEV_SIGNAL: ::c_int = 1;
+pub const SIGEV_THREAD: ::c_int = 2;
+
+pub const EAI_AGAIN: ::c_int = 2;
+pub const EAI_BADFLAGS: ::c_int = 3;
+pub const EAI_FAIL: ::c_int = 4;
+pub const EAI_FAMILY: ::c_int = 5;
+pub const EAI_MEMORY: ::c_int = 6;
+pub const EAI_NODATA: ::c_int = 7;
+pub const EAI_NONAME: ::c_int = 8;
+pub const EAI_SERVICE: ::c_int = 9;
+pub const EAI_SOCKTYPE: ::c_int = 10;
+pub const EAI_SYSTEM: ::c_int = 11;
+pub const EAI_OVERFLOW: ::c_int = 14;
+
+pub const PROT_NONE: ::c_int = 0;
+pub const PROT_READ: ::c_int = 1;
+pub const PROT_WRITE: ::c_int = 2;
+pub const PROT_EXEC: ::c_int = 4;
+
+pub const LC_ALL: ::c_int = 0;
+pub const LC_COLLATE: ::c_int = 1;
+pub const LC_CTYPE: ::c_int = 2;
+pub const LC_MONETARY: ::c_int = 3;
+pub const LC_NUMERIC: ::c_int = 4;
+pub const LC_TIME: ::c_int = 5;
+pub const LC_MESSAGES: ::c_int = 6;
+
+// FIXME: Haiku does not have MAP_FILE, but library/std/os.rs requires it
+pub const MAP_FILE: ::c_int = 0x00;
+pub const MAP_SHARED: ::c_int = 0x01;
+pub const MAP_PRIVATE: ::c_int = 0x02;
+pub const MAP_FIXED: ::c_int = 0x04;
+pub const MAP_ANONYMOUS: ::c_int = 0x08;
+pub const MAP_NORESERVE: ::c_int = 0x10;
+pub const MAP_ANON: ::c_int = MAP_ANONYMOUS;
+
+pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
+
+pub const MS_ASYNC: ::c_int = 0x01;
+pub const MS_INVALIDATE: ::c_int = 0x04;
+pub const MS_SYNC: ::c_int = 0x02;
+
+pub const E2BIG: ::c_int = -2147454975;
+pub const ECHILD: ::c_int = -2147454974;
+pub const EDEADLK: ::c_int = -2147454973;
+pub const EFBIG: ::c_int = -2147454972;
+pub const EMLINK: ::c_int = -2147454971;
+pub const ENFILE: ::c_int = -2147454970;
+pub const ENODEV: ::c_int = -2147454969;
+pub const ENOLCK: ::c_int = -2147454968;
+pub const ENOSYS: ::c_int = -2147454967;
+pub const ENOTTY: ::c_int = -2147454966;
+pub const ENXIO: ::c_int = -2147454965;
+pub const ESPIPE: ::c_int = -2147454964;
+pub const ESRCH: ::c_int = -2147454963;
+pub const EFPOS: ::c_int = -2147454962;
+pub const ESIGPARM: ::c_int = -2147454961;
+pub const EDOM: ::c_int = -2147454960;
+pub const ERANGE: ::c_int = -2147454959;
+pub const EPROTOTYPE: ::c_int = -2147454958;
+pub const EPROTONOSUPPORT: ::c_int = -2147454957;
+pub const EPFNOSUPPORT: ::c_int = -2147454956;
+pub const EAFNOSUPPORT: ::c_int = -2147454955;
+pub const EADDRINUSE: ::c_int = -2147454954;
+pub const EADDRNOTAVAIL: ::c_int = -2147454953;
+pub const ENETDOWN: ::c_int = -2147454952;
+pub const ENETUNREACH: ::c_int = -2147454951;
+pub const ENETRESET: ::c_int = -2147454950;
+pub const ECONNABORTED: ::c_int = -2147454949;
+pub const ECONNRESET: ::c_int = -2147454948;
+pub const EISCONN: ::c_int = -2147454947;
+pub const ENOTCONN: ::c_int = -2147454946;
+pub const ESHUTDOWN: ::c_int = -2147454945;
+pub const ECONNREFUSED: ::c_int = -2147454944;
+pub const EHOSTUNREACH: ::c_int = -2147454943;
+pub const ENOPROTOOPT: ::c_int = -2147454942;
+pub const ENOBUFS: ::c_int = -2147454941;
+pub const EINPROGRESS: ::c_int = -2147454940;
+pub const EALREADY: ::c_int = -2147454939;
+pub const EILSEQ: ::c_int = -2147454938;
+pub const ENOMSG: ::c_int = -2147454937;
+pub const ESTALE: ::c_int = -2147454936;
+pub const EOVERFLOW: ::c_int = -2147454935;
+pub const EMSGSIZE: ::c_int = -2147454934;
+pub const EOPNOTSUPP: ::c_int = -2147454933;
+pub const ENOTSOCK: ::c_int = -2147454932;
+pub const EHOSTDOWN: ::c_int = -2147454931;
+pub const EBADMSG: ::c_int = -2147454930;
+pub const ECANCELED: ::c_int = -2147454929;
+pub const EDESTADDRREQ: ::c_int = -2147454928;
+pub const EDQUOT: ::c_int = -2147454927;
+pub const EIDRM: ::c_int = -2147454926;
+pub const EMULTIHOP: ::c_int = -2147454925;
+pub const ENODATA: ::c_int = -2147454924;
+pub const ENOLINK: ::c_int = -2147454923;
+pub const ENOSR: ::c_int = -2147454922;
+pub const ENOSTR: ::c_int = -2147454921;
+pub const ENOTSUP: ::c_int = -2147454920;
+pub const EPROTO: ::c_int = -2147454919;
+pub const ETIME: ::c_int = -2147454918;
+pub const ETXTBSY: ::c_int = -2147454917;
+pub const ENOATTR: ::c_int = -2147454916;
+
+// INT_MIN
+pub const ENOMEM: ::c_int = -2147483648;
+
+// POSIX errors that can be mapped to BeOS error codes
+pub const EACCES: ::c_int = -2147483646;
+pub const EINTR: ::c_int = -2147483638;
+pub const EIO: ::c_int = -2147483647;
+pub const EBUSY: ::c_int = -2147483634;
+pub const EFAULT: ::c_int = -2147478783;
+pub const ETIMEDOUT: ::c_int = -2147483639;
+pub const EAGAIN: ::c_int = -2147483637;
+pub const EWOULDBLOCK: ::c_int = -2147483637;
+pub const EBADF: ::c_int = -2147459072;
+pub const EEXIST: ::c_int = -2147459070;
+pub const EINVAL: ::c_int = -2147483643;
+pub const ENAMETOOLONG: ::c_int = -2147459068;
+pub const ENOENT: ::c_int = -2147459069;
+pub const EPERM: ::c_int = -2147483633;
+pub const ENOTDIR: ::c_int = -2147459067;
+pub const EISDIR: ::c_int = -2147459063;
+pub const ENOTEMPTY: ::c_int = -2147459066;
+pub const ENOSPC: ::c_int = -2147459065;
+pub const EROFS: ::c_int = -2147459064;
+pub const EMFILE: ::c_int = -2147459062;
+pub const EXDEV: ::c_int = -2147459061;
+pub const ELOOP: ::c_int = -2147459060;
+pub const ENOEXEC: ::c_int = -2147478782;
+pub const EPIPE: ::c_int = -2147459059;
+
+pub const IPPROTO_RAW: ::c_int = 255;
+
+// These are prefixed with POSIX_ on Haiku
+pub const MADV_NORMAL: ::c_int = 1;
+pub const MADV_SEQUENTIAL: ::c_int = 2;
+pub const MADV_RANDOM: ::c_int = 3;
+pub const MADV_WILLNEED: ::c_int = 4;
+pub const MADV_DONTNEED: ::c_int = 5;
+pub const MADV_FREE: ::c_int = 6;
+
+// https://github.com/haiku/haiku/blob/HEAD/headers/posix/net/if.h#L80
+pub const IFF_UP: ::c_int = 0x0001;
+pub const IFF_BROADCAST: ::c_int = 0x0002; // valid broadcast address
+pub const IFF_LOOPBACK: ::c_int = 0x0008;
+pub const IFF_POINTOPOINT: ::c_int = 0x0010; // point-to-point link
+pub const IFF_NOARP: ::c_int = 0x0040; // no address resolution
+pub const IFF_AUTOUP: ::c_int = 0x0080; // auto dial
+pub const IFF_PROMISC: ::c_int = 0x0100; // receive all packets
+pub const IFF_ALLMULTI: ::c_int = 0x0200; // receive all multicast packets
+pub const IFF_SIMPLEX: ::c_int = 0x0800; // doesn't receive own transmissions
+pub const IFF_LINK: ::c_int = 0x1000; // has link
+pub const IFF_AUTO_CONFIGURED: ::c_int = 0x2000;
+pub const IFF_CONFIGURING: ::c_int = 0x4000;
+pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
+
+pub const AF_UNSPEC: ::c_int = 0;
+pub const AF_INET: ::c_int = 1;
+pub const AF_APPLETALK: ::c_int = 2;
+pub const AF_ROUTE: ::c_int = 3;
+pub const AF_LINK: ::c_int = 4;
+pub const AF_INET6: ::c_int = 5;
+pub const AF_DLI: ::c_int = 6;
+pub const AF_IPX: ::c_int = 7;
+pub const AF_NOTIFY: ::c_int = 8;
+pub const AF_LOCAL: ::c_int = 9;
+pub const AF_UNIX: ::c_int = AF_LOCAL;
+pub const AF_BLUETOOTH: ::c_int = 10;
+
+pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
+pub const PF_INET: ::c_int = AF_INET;
+pub const PF_ROUTE: ::c_int = AF_ROUTE;
+pub const PF_LINK: ::c_int = AF_LINK;
+pub const PF_INET6: ::c_int = AF_INET6;
+pub const PF_LOCAL: ::c_int = AF_LOCAL;
+pub const PF_UNIX: ::c_int = AF_UNIX;
+pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
+
+pub const IP_OPTIONS: ::c_int = 1;
+pub const IP_HDRINCL: ::c_int = 2;
+pub const IP_TOS: ::c_int = 3;
+pub const IP_TTL: ::c_int = 4;
+pub const IP_RECVOPTS: ::c_int = 5;
+pub const IP_RECVRETOPTS: ::c_int = 6;
+pub const IP_RECVDSTADDR: ::c_int = 7;
+pub const IP_RETOPTS: ::c_int = 8;
+pub const IP_MULTICAST_IF: ::c_int = 9;
+pub const IP_MULTICAST_TTL: ::c_int = 10;
+pub const IP_MULTICAST_LOOP: ::c_int = 11;
+pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
+pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
+pub const IP_BLOCK_SOURCE: ::c_int = 14;
+pub const IP_UNBLOCK_SOURCE: ::c_int = 15;
+pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 16;
+pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 17;
+
+pub const TCP_NODELAY: ::c_int = 0x01;
+pub const TCP_MAXSEG: ::c_int = 0x02;
+pub const TCP_NOPUSH: ::c_int = 0x04;
+pub const TCP_NOOPT: ::c_int = 0x08;
+
+pub const IF_NAMESIZE: ::size_t = 32;
+pub const IFNAMSIZ: ::size_t = IF_NAMESIZE;
+
+pub const IPV6_MULTICAST_IF: ::c_int = 24;
+pub const IPV6_MULTICAST_HOPS: ::c_int = 25;
+pub const IPV6_MULTICAST_LOOP: ::c_int = 26;
+pub const IPV6_UNICAST_HOPS: ::c_int = 27;
+pub const IPV6_JOIN_GROUP: ::c_int = 28;
+pub const IPV6_LEAVE_GROUP: ::c_int = 29;
+pub const IPV6_V6ONLY: ::c_int = 30;
+pub const IPV6_PKTINFO: ::c_int = 31;
+pub const IPV6_RECVPKTINFO: ::c_int = 32;
+pub const IPV6_HOPLIMIT: ::c_int = 33;
+pub const IPV6_RECVHOPLIMIT: ::c_int = 34;
+pub const IPV6_HOPOPTS: ::c_int = 35;
+pub const IPV6_DSTOPTS: ::c_int = 36;
+pub const IPV6_RTHDR: ::c_int = 37;
+
+pub const MSG_OOB: ::c_int = 0x0001;
+pub const MSG_PEEK: ::c_int = 0x0002;
+pub const MSG_DONTROUTE: ::c_int = 0x0004;
+pub const MSG_EOR: ::c_int = 0x0008;
+pub const MSG_TRUNC: ::c_int = 0x0010;
+pub const MSG_CTRUNC: ::c_int = 0x0020;
+pub const MSG_WAITALL: ::c_int = 0x0040;
+pub const MSG_DONTWAIT: ::c_int = 0x0080;
+pub const MSG_BCAST: ::c_int = 0x0100;
+pub const MSG_MCAST: ::c_int = 0x0200;
+pub const MSG_EOF: ::c_int = 0x0400;
+pub const MSG_NOSIGNAL: ::c_int = 0x0800;
+
+pub const SHUT_RD: ::c_int = 0;
+pub const SHUT_WR: ::c_int = 1;
+pub const SHUT_RDWR: ::c_int = 2;
+
+pub const LOCK_SH: ::c_int = 0x01;
+pub const LOCK_EX: ::c_int = 0x02;
+pub const LOCK_NB: ::c_int = 0x04;
+pub const LOCK_UN: ::c_int = 0x08;
+
+pub const MINSIGSTKSZ: ::size_t = 8192;
+pub const SIGSTKSZ: ::size_t = 16384;
+
+pub const IOV_MAX: ::c_int = 1024;
+pub const PATH_MAX: ::c_int = 1024;
+
+pub const SA_NOCLDSTOP: ::c_int = 0x01;
+pub const SA_NOCLDWAIT: ::c_int = 0x02;
+pub const SA_RESETHAND: ::c_int = 0x04;
+pub const SA_NODEFER: ::c_int = 0x08;
+pub const SA_RESTART: ::c_int = 0x10;
+pub const SA_ONSTACK: ::c_int = 0x20;
+pub const SA_SIGINFO: ::c_int = 0x40;
+pub const SA_NOMASK: ::c_int = SA_NODEFER;
+pub const SA_STACK: ::c_int = SA_ONSTACK;
+pub const SA_ONESHOT: ::c_int = SA_RESETHAND;
+
+pub const SS_ONSTACK: ::c_int = 0x1;
+pub const SS_DISABLE: ::c_int = 0x2;
+
+pub const FD_SETSIZE: usize = 1024;
+
+pub const RTLD_LOCAL: ::c_int = 0x0;
+pub const RTLD_NOW: ::c_int = 0x1;
+pub const RTLD_GLOBAL: ::c_int = 0x2;
+pub const RTLD_DEFAULT: *mut ::c_void = 0isize as *mut ::c_void;
+
+pub const BUFSIZ: ::c_uint = 8192;
+pub const FILENAME_MAX: ::c_uint = 256;
+pub const FOPEN_MAX: ::c_uint = 128;
+pub const L_tmpnam: ::c_uint = 512;
+pub const TMP_MAX: ::c_uint = 32768;
+
+pub const _PC_CHOWN_RESTRICTED: ::c_int = 1;
+pub const _PC_MAX_CANON: ::c_int = 2;
+pub const _PC_MAX_INPUT: ::c_int = 3;
+pub const _PC_NAME_MAX: ::c_int = 4;
+pub const _PC_NO_TRUNC: ::c_int = 5;
+pub const _PC_PATH_MAX: ::c_int = 6;
+pub const _PC_PIPE_BUF: ::c_int = 7;
+pub const _PC_VDISABLE: ::c_int = 8;
+pub const _PC_LINK_MAX: ::c_int = 25;
+pub const _PC_SYNC_IO: ::c_int = 26;
+pub const _PC_ASYNC_IO: ::c_int = 27;
+pub const _PC_PRIO_IO: ::c_int = 28;
+pub const _PC_SOCK_MAXBUF: ::c_int = 29;
+pub const _PC_FILESIZEBITS: ::c_int = 30;
+pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 31;
+pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 32;
+pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 33;
+pub const _PC_REC_XFER_ALIGN: ::c_int = 34;
+pub const _PC_ALLOC_SIZE_MIN: ::c_int = 35;
+pub const _PC_SYMLINK_MAX: ::c_int = 36;
+pub const _PC_2_SYMLINKS: ::c_int = 37;
+pub const _PC_XATTR_EXISTS: ::c_int = 38;
+pub const _PC_XATTR_ENABLED: ::c_int = 39;
+
+pub const FIONBIO: ::c_ulong = 0xbe000000;
+pub const FIONREAD: ::c_ulong = 0xbe000001;
+pub const FIOSEEKDATA: ::c_ulong = 0xbe000002;
+pub const FIOSEEKHOLE: ::c_ulong = 0xbe000003;
+
+pub const _SC_ARG_MAX: ::c_int = 15;
+pub const _SC_CHILD_MAX: ::c_int = 16;
+pub const _SC_CLK_TCK: ::c_int = 17;
+pub const _SC_JOB_CONTROL: ::c_int = 18;
+pub const _SC_NGROUPS_MAX: ::c_int = 19;
+pub const _SC_OPEN_MAX: ::c_int = 20;
+pub const _SC_SAVED_IDS: ::c_int = 21;
+pub const _SC_STREAM_MAX: ::c_int = 22;
+pub const _SC_TZNAME_MAX: ::c_int = 23;
+pub const _SC_VERSION: ::c_int = 24;
+pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 25;
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 26;
+pub const _SC_PAGESIZE: ::c_int = 27;
+pub const _SC_PAGE_SIZE: ::c_int = 27;
+pub const _SC_SEM_NSEMS_MAX: ::c_int = 28;
+pub const _SC_SEM_VALUE_MAX: ::c_int = 29;
+pub const _SC_SEMAPHORES: ::c_int = 30;
+pub const _SC_THREADS: ::c_int = 31;
+pub const _SC_IOV_MAX: ::c_int = 32;
+pub const _SC_UIO_MAXIOV: ::c_int = 32;
+pub const _SC_NPROCESSORS_CONF: ::c_int = 34;
+pub const _SC_NPROCESSORS_ONLN: ::c_int = 35;
+pub const _SC_ATEXIT_MAX: ::c_int = 37;
+pub const _SC_PASS_MAX: ::c_int = 39;
+pub const _SC_PHYS_PAGES: ::c_int = 40;
+pub const _SC_AVPHYS_PAGES: ::c_int = 41;
+pub const _SC_PIPE: ::c_int = 42;
+pub const _SC_SELECT: ::c_int = 43;
+pub const _SC_POLL: ::c_int = 44;
+pub const _SC_MAPPED_FILES: ::c_int = 45;
+pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 46;
+pub const _SC_THREAD_STACK_MIN: ::c_int = 47;
+pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 48;
+pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 49;
+pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 50;
+pub const _SC_REALTIME_SIGNALS: ::c_int = 51;
+pub const _SC_MEMORY_PROTECTION: ::c_int = 52;
+pub const _SC_SIGQUEUE_MAX: ::c_int = 53;
+pub const _SC_RTSIG_MAX: ::c_int = 54;
+pub const _SC_MONOTONIC_CLOCK: ::c_int = 55;
+pub const _SC_DELAYTIMER_MAX: ::c_int = 56;
+pub const _SC_TIMER_MAX: ::c_int = 57;
+pub const _SC_TIMERS: ::c_int = 58;
+pub const _SC_CPUTIME: ::c_int = 59;
+pub const _SC_THREAD_CPUTIME: ::c_int = 60;
+pub const _SC_HOST_NAME_MAX: ::c_int = 61;
+pub const _SC_REGEXP: ::c_int = 62;
+pub const _SC_SYMLOOP_MAX: ::c_int = 63;
+pub const _SC_SHELL: ::c_int = 64;
+pub const _SC_TTY_NAME_MAX: ::c_int = 65;
+pub const _SC_ADVISORY_INFO: ::c_int = 66;
+pub const _SC_BARRIERS: ::c_int = 67;
+pub const _SC_CLOCK_SELECTION: ::c_int = 68;
+pub const _SC_FSYNC: ::c_int = 69;
+pub const _SC_IPV6: ::c_int = 70;
+pub const _SC_MEMLOCK: ::c_int = 71;
+pub const _SC_MEMLOCK_RANGE: ::c_int = 72;
+pub const _SC_MESSAGE_PASSING: ::c_int = 73;
+pub const _SC_PRIORITIZED_IO: ::c_int = 74;
+pub const _SC_PRIORITY_SCHEDULING: ::c_int = 75;
+pub const _SC_READER_WRITER_LOCKS: ::c_int = 76;
+pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 77;
+pub const _SC_SPAWN: ::c_int = 78;
+pub const _SC_SPIN_LOCKS: ::c_int = 79;
+pub const _SC_SPORADIC_SERVER: ::c_int = 80;
+pub const _SC_SYNCHRONIZED_IO: ::c_int = 81;
+pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 82;
+pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 83;
+pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 84;
+pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 85;
+pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 86;
+pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 87;
+pub const _SC_TIMEOUTS: ::c_int = 88;
+pub const _SC_TRACE: ::c_int = 89;
+pub const _SC_TRACE_EVENT_FILTER: ::c_int = 90;
+pub const _SC_TRACE_INHERIT: ::c_int = 91;
+pub const _SC_TRACE_LOG: ::c_int = 92;
+pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 93;
+pub const _SC_V6_ILP32_OFF32: ::c_int = 94;
+pub const _SC_V6_ILP32_OFFBIG: ::c_int = 95;
+pub const _SC_V6_LP64_OFF64: ::c_int = 96;
+pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 97;
+pub const _SC_V7_ILP32_OFF32: ::c_int = 98;
+pub const _SC_V7_ILP32_OFFBIG: ::c_int = 99;
+pub const _SC_V7_LP64_OFF64: ::c_int = 100;
+pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 101;
+pub const _SC_2_C_BIND: ::c_int = 102;
+pub const _SC_2_C_DEV: ::c_int = 103;
+pub const _SC_2_CHAR_TERM: ::c_int = 104;
+pub const _SC_2_FORT_DEV: ::c_int = 105;
+pub const _SC_2_FORT_RUN: ::c_int = 106;
+pub const _SC_2_LOCALEDEF: ::c_int = 107;
+pub const _SC_2_PBS: ::c_int = 108;
+pub const _SC_2_PBS_ACCOUNTING: ::c_int = 109;
+pub const _SC_2_PBS_CHECKPOINT: ::c_int = 110;
+pub const _SC_2_PBS_LOCATE: ::c_int = 111;
+pub const _SC_2_PBS_MESSAGE: ::c_int = 112;
+pub const _SC_2_PBS_TRACK: ::c_int = 113;
+pub const _SC_2_SW_DEV: ::c_int = 114;
+pub const _SC_2_UPE: ::c_int = 115;
+pub const _SC_2_VERSION: ::c_int = 116;
+pub const _SC_XOPEN_CRYPT: ::c_int = 117;
+pub const _SC_XOPEN_ENH_I18N: ::c_int = 118;
+pub const _SC_XOPEN_REALTIME: ::c_int = 119;
+pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 120;
+pub const _SC_XOPEN_SHM: ::c_int = 121;
+pub const _SC_XOPEN_STREAMS: ::c_int = 122;
+pub const _SC_XOPEN_UNIX: ::c_int = 123;
+pub const _SC_XOPEN_UUCP: ::c_int = 124;
+pub const _SC_XOPEN_VERSION: ::c_int = 125;
+pub const _SC_BC_BASE_MAX: ::c_int = 129;
+pub const _SC_BC_DIM_MAX: ::c_int = 130;
+pub const _SC_BC_SCALE_MAX: ::c_int = 131;
+pub const _SC_BC_STRING_MAX: ::c_int = 132;
+pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 133;
+pub const _SC_EXPR_NEST_MAX: ::c_int = 134;
+pub const _SC_LINE_MAX: ::c_int = 135;
+pub const _SC_LOGIN_NAME_MAX: ::c_int = 136;
+pub const _SC_MQ_OPEN_MAX: ::c_int = 137;
+pub const _SC_MQ_PRIO_MAX: ::c_int = 138;
+pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 139;
+pub const _SC_THREAD_KEYS_MAX: ::c_int = 140;
+pub const _SC_THREAD_THREADS_MAX: ::c_int = 141;
+pub const _SC_RE_DUP_MAX: ::c_int = 142;
+
+pub const PTHREAD_STACK_MIN: ::size_t = 8192;
+
+pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+    flags: 0,
+    lock: 0,
+    unused: -42,
+    owner: -1,
+    owner_count: 0,
+};
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+    flags: 0,
+    unused: -42,
+    mutex: 0 as *mut _,
+    waiter_count: 0,
+    lock: 0,
+};
+pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+    flags: 0,
+    owner: -1,
+    lock_sem: 0,
+    lock_count: 0,
+    reader_count: 0,
+    writer_count: 0,
+    waiters: [0 as *mut _; 2],
+};
+
+pub const PTHREAD_MUTEX_DEFAULT: ::c_int = 0;
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 1;
+pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 3;
+
+pub const FIOCLEX: c_ulong = 0; // FIXME: does not exist on Haiku!
+
+pub const RUSAGE_CHILDREN: ::c_int = -1;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+pub const SOCK_RAW: ::c_int = 3;
+pub const SOCK_SEQPACKET: ::c_int = 5;
+
+pub const SOL_SOCKET: ::c_int = -1;
+pub const SO_ACCEPTCONN: ::c_int = 0x00000001;
+pub const SO_BROADCAST: ::c_int = 0x00000002;
+pub const SO_DEBUG: ::c_int = 0x00000004;
+pub const SO_DONTROUTE: ::c_int = 0x00000008;
+pub const SO_KEEPALIVE: ::c_int = 0x00000010;
+pub const SO_OOBINLINE: ::c_int = 0x00000020;
+pub const SO_REUSEADDR: ::c_int = 0x00000040;
+pub const SO_REUSEPORT: ::c_int = 0x00000080;
+pub const SO_USELOOPBACK: ::c_int = 0x00000100;
+pub const SO_LINGER: ::c_int = 0x00000200;
+pub const SO_SNDBUF: ::c_int = 0x40000001;
+pub const SO_SNDLOWAT: ::c_int = 0x40000002;
+pub const SO_SNDTIMEO: ::c_int = 0x40000003;
+pub const SO_RCVBUF: ::c_int = 0x40000004;
+pub const SO_RCVLOWAT: ::c_int = 0x40000005;
+pub const SO_RCVTIMEO: ::c_int = 0x40000006;
+pub const SO_ERROR: ::c_int = 0x40000007;
+pub const SO_TYPE: ::c_int = 0x40000008;
+pub const SO_NONBLOCK: ::c_int = 0x40000009;
+pub const SO_BINDTODEVICE: ::c_int = 0x4000000a;
+pub const SO_PEERCRED: ::c_int = 0x4000000b;
+
+pub const SCM_RIGHTS: ::c_int = 0x01;
+
+pub const SOMAXCONN: ::c_int = 32;
+
+pub const NI_MAXHOST: ::size_t = 1025;
+
+pub const WNOHANG: ::c_int = 0x01;
+pub const WUNTRACED: ::c_int = 0x02;
+pub const WCONTINUED: ::c_int = 0x04;
+pub const WEXITED: ::c_int = 0x08;
+pub const WSTOPPED: ::c_int = 0x10;
+pub const WNOWAIT: ::c_int = 0x20;
+
+// si_code values for SIGBUS signal
+pub const BUS_ADRALN: ::c_int = 40;
+pub const BUS_ADRERR: ::c_int = 41;
+pub const BUS_OBJERR: ::c_int = 42;
+
+// si_code values for SIGCHLD signal
+pub const CLD_EXITED: ::c_int = 60;
+pub const CLD_KILLED: ::c_int = 61;
+pub const CLD_DUMPED: ::c_int = 62;
+pub const CLD_TRAPPED: ::c_int = 63;
+pub const CLD_STOPPED: ::c_int = 64;
+pub const CLD_CONTINUED: ::c_int = 65;
+
+pub const P_ALL: idtype_t = 0;
+pub const P_PID: idtype_t = 1;
+pub const P_PGID: idtype_t = 2;
+
+pub const UTIME_OMIT: c_long = 1000000001;
+pub const UTIME_NOW: c_long = 1000000000;
+
+pub const VINTR: usize = 0;
+pub const VQUIT: usize = 1;
+pub const VERASE: usize = 2;
+pub const VKILL: usize = 3;
+pub const VEOF: usize = 4;
+pub const VEOL: usize = 5;
+pub const VMIN: usize = 4;
+pub const VTIME: usize = 5;
+pub const VEOL2: usize = 6;
+pub const VSWTCH: usize = 7;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VSUSP: usize = 10;
+
+pub const IGNBRK: ::tcflag_t = 0x01;
+pub const BRKINT: ::tcflag_t = 0x02;
+pub const IGNPAR: ::tcflag_t = 0x04;
+pub const PARMRK: ::tcflag_t = 0x08;
+pub const INPCK: ::tcflag_t = 0x10;
+pub const ISTRIP: ::tcflag_t = 0x20;
+pub const INLCR: ::tcflag_t = 0x40;
+pub const IGNCR: ::tcflag_t = 0x80;
+pub const ICRNL: ::tcflag_t = 0x100;
+pub const IUCLC: ::tcflag_t = 0x200;
+pub const IXON: ::tcflag_t = 0x400;
+pub const IXANY: ::tcflag_t = 0x800;
+pub const IXOFF: ::tcflag_t = 0x1000;
+
+pub const OPOST: ::tcflag_t = 0x00000001;
+pub const OLCUC: ::tcflag_t = 0x00000002;
+pub const ONLCR: ::tcflag_t = 0x00000004;
+pub const OCRNL: ::tcflag_t = 0x00000008;
+pub const ONOCR: ::tcflag_t = 0x00000010;
+pub const ONLRET: ::tcflag_t = 0x00000020;
+pub const OFILL: ::tcflag_t = 0x00000040;
+pub const OFDEL: ::tcflag_t = 0x00000080;
+pub const NLDLY: ::tcflag_t = 0x00000100;
+pub const NL0: ::tcflag_t = 0x00000000;
+pub const NL1: ::tcflag_t = 0x00000100;
+pub const CRDLY: ::tcflag_t = 0x00000600;
+pub const CR0: ::tcflag_t = 0x00000000;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const TABDLY: ::tcflag_t = 0x00001800;
+pub const TAB0: ::tcflag_t = 0x00000000;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const BSDLY: ::tcflag_t = 0x00002000;
+pub const BS0: ::tcflag_t = 0x00000000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VTDLY: ::tcflag_t = 0x00004000;
+pub const VT0: ::tcflag_t = 0x00000000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const FFDLY: ::tcflag_t = 0x00008000;
+pub const FF0: ::tcflag_t = 0x00000000;
+pub const FF1: ::tcflag_t = 0x00008000;
+
+pub const CSIZE: ::tcflag_t = 0x00000020;
+pub const CS5: ::tcflag_t = 0x00000000;
+pub const CS6: ::tcflag_t = 0x00000000;
+pub const CS7: ::tcflag_t = 0x00000000;
+pub const CS8: ::tcflag_t = 0x00000020;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const XLOBLK: ::tcflag_t = 0x00001000;
+pub const CTSFLOW: ::tcflag_t = 0x00002000;
+pub const RTSFLOW: ::tcflag_t = 0x00004000;
+pub const CRTSCTS: ::tcflag_t = RTSFLOW | CTSFLOW;
+
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const XCASE: ::tcflag_t = 0x00000004;
+pub const ECHO: ::tcflag_t = 0x00000008;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const IEXTEN: ::tcflag_t = 0x00000200;
+pub const ECHOCTL: ::tcflag_t = 0x00000400;
+pub const ECHOPRT: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00001000;
+pub const FLUSHO: ::tcflag_t = 0x00002000;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+
+pub const TCGB_CTS: ::c_int = 0x01;
+pub const TCGB_DSR: ::c_int = 0x02;
+pub const TCGB_RI: ::c_int = 0x04;
+pub const TCGB_DCD: ::c_int = 0x08;
+pub const TIOCM_CTS: ::c_int = TCGB_CTS;
+pub const TIOCM_CD: ::c_int = TCGB_DCD;
+pub const TIOCM_CAR: ::c_int = TCGB_DCD;
+pub const TIOCM_RI: ::c_int = TCGB_RI;
+pub const TIOCM_RNG: ::c_int = TCGB_RI;
+pub const TIOCM_DSR: ::c_int = TCGB_DSR;
+pub const TIOCM_DTR: ::c_int = 0x10;
+pub const TIOCM_RTS: ::c_int = 0x20;
+
+pub const B0: speed_t = 0x00;
+pub const B50: speed_t = 0x01;
+pub const B75: speed_t = 0x02;
+pub const B110: speed_t = 0x03;
+pub const B134: speed_t = 0x04;
+pub const B150: speed_t = 0x05;
+pub const B200: speed_t = 0x06;
+pub const B300: speed_t = 0x07;
+pub const B600: speed_t = 0x08;
+pub const B1200: speed_t = 0x09;
+pub const B1800: speed_t = 0x0A;
+pub const B2400: speed_t = 0x0B;
+pub const B4800: speed_t = 0x0C;
+pub const B9600: speed_t = 0x0D;
+pub const B19200: speed_t = 0x0E;
+pub const B38400: speed_t = 0x0F;
+pub const B57600: speed_t = 0x10;
+pub const B115200: speed_t = 0x11;
+pub const B230400: speed_t = 0x12;
+pub const B31250: speed_t = 0x13;
+
+pub const TCSANOW: ::c_int = 0x01;
+pub const TCSADRAIN: ::c_int = 0x02;
+pub const TCSAFLUSH: ::c_int = 0x04;
+
+pub const TCOOFF: ::c_int = 0x01;
+pub const TCOON: ::c_int = 0x02;
+pub const TCIOFF: ::c_int = 0x04;
+pub const TCION: ::c_int = 0x08;
+
+pub const TCIFLUSH: ::c_int = 0x01;
+pub const TCOFLUSH: ::c_int = 0x02;
+pub const TCIOFLUSH: ::c_int = 0x03;
+
+pub const TCGETA: ::c_ulong = 0x8000;
+pub const TCSETA: ::c_ulong = TCGETA + 1;
+pub const TCSETAF: ::c_ulong = TCGETA + 2;
+pub const TCSETAW: ::c_ulong = TCGETA + 3;
+pub const TCSBRK: ::c_ulong = TCGETA + 5;
+pub const TCFLSH: ::c_ulong = TCGETA + 6;
+pub const TCXONC: ::c_ulong = TCGETA + 7;
+pub const TCGETBITS: ::c_ulong = TCGETA + 9;
+pub const TCSETDTR: ::c_ulong = TCGETA + 10;
+pub const TCSETRTS: ::c_ulong = TCGETA + 11;
+pub const TIOCGWINSZ: ::c_ulong = TCGETA + 12;
+pub const TIOCSWINSZ: ::c_ulong = TCGETA + 13;
+pub const TIOCGPGRP: ::c_ulong = TCGETA + 15;
+pub const TIOCSPGRP: ::c_ulong = TCGETA + 16;
+pub const TIOCSCTTY: ::c_ulong = TCGETA + 17;
+pub const TIOCMGET: ::c_ulong = TCGETA + 18;
+pub const TIOCMSET: ::c_ulong = TCGETA + 19;
+pub const TIOCSBRK: ::c_ulong = TCGETA + 20;
+pub const TIOCCBRK: ::c_ulong = TCGETA + 21;
+pub const TIOCMBIS: ::c_ulong = TCGETA + 22;
+pub const TIOCMBIC: ::c_ulong = TCGETA + 23;
+pub const TIOCGSID: ::c_ulong = TCGETA + 24;
+pub const TIOCOUTQ: ::c_ulong = TCGETA + 25;
+pub const TIOCEXCL: ::c_ulong = TCGETA + 26;
+pub const TIOCNXCL: ::c_ulong = TCGETA + 27;
+
+pub const PRIO_PROCESS: ::c_int = 0;
+pub const PRIO_PGRP: ::c_int = 1;
+pub const PRIO_USER: ::c_int = 2;
+
+// utmpx entry types
+pub const EMPTY: ::c_short = 0;
+pub const BOOT_TIME: ::c_short = 1;
+pub const OLD_TIME: ::c_short = 2;
+pub const NEW_TIME: ::c_short = 3;
+pub const USER_PROCESS: ::c_short = 4;
+pub const INIT_PROCESS: ::c_short = 5;
+pub const LOGIN_PROCESS: ::c_short = 6;
+pub const DEAD_PROCESS: ::c_short = 7;
+
+pub const LOG_PID: ::c_int = 1 << 12;
+pub const LOG_CONS: ::c_int = 2 << 12;
+pub const LOG_ODELAY: ::c_int = 4 << 12;
+pub const LOG_NDELAY: ::c_int = 8 << 12;
+pub const LOG_SERIAL: ::c_int = 16 << 12;
+pub const LOG_PERROR: ::c_int = 32 << 12;
+pub const LOG_NOWAIT: ::c_int = 64 << 12;
+
+// spawn.h
+pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
+pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02;
+pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10;
+pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20;
+pub const POSIX_SPAWN_SETSID: ::c_int = 0x40;
+
+const_fn! {
+    {const} fn CMSG_ALIGN(len: usize) -> usize {
+        len + ::mem::size_of::<usize>() - 1 & !(::mem::size_of::<usize>() - 1)
+    }
+}
+
+f! {
+    pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
+        if (*mhdr).msg_controllen as usize >= ::mem::size_of::<cmsghdr>() {
+            (*mhdr).msg_control as *mut cmsghdr
+        } else {
+            0 as *mut cmsghdr
+        }
+    }
+
+    pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
+        (cmsg as *mut ::c_uchar)
+            .offset(CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
+    }
+
+    pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
+        (CMSG_ALIGN(length as usize) + CMSG_ALIGN(::mem::size_of::<cmsghdr>()))
+            as ::c_uint
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        CMSG_ALIGN(::mem::size_of::<cmsghdr>()) as ::c_uint + length
+    }
+
+    pub fn CMSG_NXTHDR(mhdr: *const msghdr,
+                       cmsg: *const cmsghdr) -> *mut cmsghdr {
+        if cmsg.is_null() {
+            return ::CMSG_FIRSTHDR(mhdr);
+        };
+        let next = cmsg as usize + CMSG_ALIGN((*cmsg).cmsg_len as usize)
+            + CMSG_ALIGN(::mem::size_of::<::cmsghdr>());
+        let max = (*mhdr).msg_control as usize
+            + (*mhdr).msg_controllen as usize;
+        if next > max {
+            0 as *mut ::cmsghdr
+        } else {
+            (cmsg as usize + CMSG_ALIGN((*cmsg).cmsg_len as usize))
+                as *mut ::cmsghdr
+        }
+    }
+
+    pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
+        let fd = fd as usize;
+        let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        (*set).fds_bits[fd / size] &= !(1 << (fd % size));
+        return
+    }
+
+    pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
+        let fd = fd as usize;
+        let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0
+    }
+
+    pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
+        let fd = fd as usize;
+        let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        (*set).fds_bits[fd / size] |= 1 << (fd % size);
+        return
+    }
+
+    pub fn FD_ZERO(set: *mut fd_set) -> () {
+        for slot in (*set).fds_bits.iter_mut() {
+            *slot = 0;
+        }
+    }
+}
+
+safe_f! {
+    pub {const} fn WIFEXITED(status: ::c_int) -> bool {
+        (status & !0xff) == 0
+    }
+
+    pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int {
+        status & 0xff
+    }
+
+    pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
+        ((status >> 8) & 0xff) != 0
+    }
+
+    pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int {
+        (status >> 8) & 0xff
+    }
+
+    pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
+        ((status >> 16) & 0xff) != 0
+    }
+
+    pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
+        (status >> 16) & 0xff
+    }
+
+    // actually WIFCORED, but this is used everywhere else
+    pub {const} fn WCOREDUMP(status: ::c_int) -> bool {
+        (status & 0x10000) != 0
+    }
+
+    pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
+        (status & 0x20000) != 0
+    }
+}
+
+extern "C" {
+    pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
+    pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
+    pub fn getpriority(which: ::c_int, who: id_t) -> ::c_int;
+    pub fn setpriority(which: ::c_int, who: id_t, priority: ::c_int) -> ::c_int;
+
+    pub fn endusershell();
+    pub fn getpass(prompt: *const ::c_char) -> *mut ::c_char;
+    pub fn getusershell() -> *mut ::c_char;
+    pub fn issetugid() -> ::c_int;
+    pub fn setusershell();
+
+    pub fn utimensat(
+        fd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::timespec,
+        flag: ::c_int,
+    ) -> ::c_int;
+    pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
+    pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
+    pub fn _errnop() -> *mut ::c_int;
+
+    pub fn abs(i: ::c_int) -> ::c_int;
+    pub fn labs(i: ::c_long) -> ::c_long;
+    pub fn rand() -> ::c_int;
+    pub fn srand(seed: ::c_uint);
+    pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
+    pub fn freeifaddrs(ifa: *mut ::ifaddrs);
+    pub fn ppoll(
+        fds: *mut ::pollfd,
+        numfds: ::nfds_t,
+        timeout: *const ::timespec,
+        sigMask: *const sigset_t,
+    ) -> ::c_int;
+
+    pub fn getspent() -> *mut spwd;
+    pub fn getspent_r(
+        pwd: *mut spwd,
+        buf: *mut ::c_char,
+        bufferSize: ::size_t,
+        res: *mut *mut spwd,
+    ) -> ::c_int;
+    pub fn setspent();
+    pub fn endspent();
+    pub fn getspnam(name: *const ::c_char) -> *mut spwd;
+    pub fn getspnam_r(
+        name: *const ::c_char,
+        spwd: *mut spwd,
+        buffer: *mut ::c_char,
+        bufferSize: ::size_t,
+        res: *mut *mut spwd,
+    ) -> ::c_int;
+    pub fn sgetspent(line: *const ::c_char) -> *mut spwd;
+    pub fn sgetspent_r(
+        line: *const ::c_char,
+        spwd: *mut spwd,
+        buffer: *mut ::c_char,
+        bufferSize: ::size_t,
+        res: *mut *mut spwd,
+    ) -> ::c_int;
+    pub fn fgetspent(file: *mut ::FILE) -> *mut spwd;
+    pub fn fgetspent_r(
+        file: *mut ::FILE,
+        spwd: *mut spwd,
+        buffer: *mut ::c_char,
+        bufferSize: ::size_t,
+        res: *mut *mut spwd,
+    ) -> ::c_int;
+    pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
+    pub fn mknodat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::mode_t,
+        dev: dev_t,
+    ) -> ::c_int;
+    pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
+    pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
+
+    pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+    pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int;
+    pub fn pthread_create(
+        thread: *mut ::pthread_t,
+        attr: *const ::pthread_attr_t,
+        f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
+        value: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn pthread_attr_getguardsize(
+        attr: *const ::pthread_attr_t,
+        guardsize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
+    pub fn pthread_attr_getstack(
+        attr: *const ::pthread_attr_t,
+        stackaddr: *mut *mut ::c_void,
+        stacksize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_condattr_getclock(
+        attr: *const pthread_condattr_t,
+        clock_id: *mut clockid_t,
+    ) -> ::c_int;
+    pub fn pthread_condattr_setclock(
+        attr: *mut pthread_condattr_t,
+        clock_id: ::clockid_t,
+    ) -> ::c_int;
+    pub fn valloc(numBytes: ::size_t) -> *mut ::c_void;
+    pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;
+    pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
+    pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int;
+    pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
+    pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
+    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
+    pub fn getnameinfo(
+        sa: *const ::sockaddr,
+        salen: ::socklen_t,
+        host: *mut ::c_char,
+        hostlen: ::socklen_t,
+        serv: *mut ::c_char,
+        servlen: ::socklen_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_mutex_timedlock(
+        lock: *mut pthread_mutex_t,
+        abstime: *const ::timespec,
+    ) -> ::c_int;
+    pub fn pthread_spin_init(lock: *mut ::pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
+    pub fn pthread_spin_destroy(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_lock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_trylock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_unlock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+    pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
+        -> ::c_int;
+
+    pub fn glob(
+        pattern: *const ::c_char,
+        flags: ::c_int,
+        errfunc: ::Option<extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut ::glob_t,
+    ) -> ::c_int;
+    pub fn globfree(pglob: *mut ::glob_t);
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
+    pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+    pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advice: ::c_int) -> ::c_int;
+    pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+
+    pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int;
+    pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
+
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+
+    pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
+    pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+
+    pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+
+    pub fn recvfrom(
+        socket: ::c_int,
+        buf: *mut ::c_void,
+        len: ::size_t,
+        flags: ::c_int,
+        addr: *mut ::sockaddr,
+        addrlen: *mut ::socklen_t,
+    ) -> ::ssize_t;
+    pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
+
+    pub fn writev(fd: ::c_int, iov: *const ::iovec, count: ::c_int) -> ::ssize_t;
+    pub fn readv(fd: ::c_int, iov: *const ::iovec, count: ::c_int) -> ::ssize_t;
+
+    pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+    pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
+    pub fn execvpe(
+        file: *const ::c_char,
+        argv: *const *const ::c_char,
+        environment: *const *const ::c_char,
+    ) -> ::c_int;
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn getgrouplist(
+        user: *const ::c_char,
+        basegroup: ::gid_t,
+        grouplist: *mut ::gid_t,
+        groupcount: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
+    pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
+    pub fn sem_close(sem: *mut sem_t) -> ::c_int;
+    pub fn getdtablesize() -> ::c_int;
+    pub fn getgrnam_r(
+        name: *const ::c_char,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
+    pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
+    pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
+    pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
+    pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
+    pub fn getpwnam_r(
+        name: *const ::c_char,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+    pub fn getpwuid_r(
+        uid: ::uid_t,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+    pub fn getpwent() -> *mut passwd;
+    pub fn setpwent();
+    pub fn endpwent();
+    pub fn endgrent();
+    pub fn getgrent() -> *mut ::group;
+    pub fn setgrent();
+    pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
+    pub fn pthread_atfork(
+        prepare: ::Option<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+    pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
+    pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
+    pub fn uname(buf: *mut ::utsname) -> ::c_int;
+    pub fn getutxent() -> *mut utmpx;
+    pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
+    pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
+    pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
+    pub fn setutxent();
+    pub fn endutxent();
+    pub fn faccessat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::c_int,
+        flags: ::c_int,
+    ) -> ::c_int;
+
+    pub fn sigtimedwait(
+        set: *const sigset_t,
+        info: *mut siginfo_t,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
+
+    pub fn getitimer(which: ::c_int, curr_value: *mut ::itimerval) -> ::c_int;
+    pub fn setitimer(
+        which: ::c_int,
+        new_value: *const ::itimerval,
+        old_value: *mut ::itimerval,
+    ) -> ::c_int;
+
+    pub fn regcomp(preg: *mut regex_t, pattern: *const ::c_char, cflags: ::c_int) -> ::c_int;
+
+    pub fn regexec(
+        preg: *const regex_t,
+        input: *const ::c_char,
+        nmatch: ::size_t,
+        pmatch: *mut regmatch_t,
+        eflags: ::c_int,
+    ) -> ::c_int;
+
+    pub fn regerror(
+        errcode: ::c_int,
+        preg: *const regex_t,
+        errbuf: *mut ::c_char,
+        errbuf_size: ::size_t,
+    ) -> ::size_t;
+
+    pub fn regfree(preg: *mut regex_t);
+
+    pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int;
+    pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
+    pub fn msgrcv(
+        msqid: ::c_int,
+        msgp: *mut ::c_void,
+        msgsz: ::size_t,
+        msgtype: ::c_long,
+        msgflg: ::c_int,
+    ) -> ::ssize_t;
+    pub fn msgsnd(
+        msqid: ::c_int,
+        msgp: *const ::c_void,
+        msgsz: ::size_t,
+        msgflg: ::c_int,
+    ) -> ::c_int;
+    pub fn semget(key: ::key_t, nsems: ::c_int, semflg: ::c_int) -> ::c_int;
+    pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
+    pub fn semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int;
+    pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
+
+    pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
+
+    pub fn lsearch(
+        key: *const ::c_void,
+        base: *mut ::c_void,
+        nelp: *mut ::size_t,
+        width: ::size_t,
+        compar: ::Option<unsafe extern "C" fn(*const ::c_void, *const ::c_void) -> ::c_int>,
+    ) -> *mut ::c_void;
+    pub fn lfind(
+        key: *const ::c_void,
+        base: *const ::c_void,
+        nelp: *mut ::size_t,
+        width: ::size_t,
+        compar: ::Option<unsafe extern "C" fn(*const ::c_void, *const ::c_void) -> ::c_int>,
+    ) -> *mut ::c_void;
+    pub fn hcreate(nelt: ::size_t) -> ::c_int;
+    pub fn hdestroy();
+    pub fn hsearch(entry: ::ENTRY, action: ::ACTION) -> *mut ::ENTRY;
+
+    pub fn drand48() -> ::c_double;
+    pub fn erand48(xseed: *mut ::c_ushort) -> ::c_double;
+    pub fn lrand48() -> ::c_long;
+    pub fn nrand48(xseed: *mut ::c_ushort) -> ::c_long;
+    pub fn mrand48() -> ::c_long;
+    pub fn jrand48(xseed: *mut ::c_ushort) -> ::c_long;
+    pub fn srand48(seed: ::c_long);
+    pub fn seed48(xseed: *mut ::c_ushort) -> *mut ::c_ushort;
+    pub fn lcong48(p: *mut ::c_ushort);
+
+    pub fn clearenv() -> ::c_int;
+    pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char;
+
+    pub fn sync();
+    pub fn getpagesize() -> ::c_int;
+
+    pub fn brk(addr: *mut ::c_void) -> ::c_int;
+    pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
+
+    pub fn posix_spawn(
+        pid: *mut ::pid_t,
+        path: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawnp(
+        pid: *mut ::pid_t,
+        file: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+
+    pub fn posix_spawn_file_actions_init(file_actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+    pub fn posix_spawn_file_actions_destroy(
+        file_actions: *mut posix_spawn_file_actions_t,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_addopen(
+        file_actions: *mut posix_spawn_file_actions_t,
+        fildes: ::c_int,
+        path: *const ::c_char,
+        oflag: ::c_int,
+        mode: ::mode_t,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_addclose(
+        file_actions: *mut posix_spawn_file_actions_t,
+        fildes: ::c_int,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_adddup2(
+        file_actions: *mut posix_spawn_file_actions_t,
+        fildes: ::c_int,
+        newfildes: ::c_int,
+    ) -> ::c_int;
+
+    pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
+    pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
+    pub fn posix_spawnattr_getflags(
+        attr: *const posix_spawnattr_t,
+        _flags: *mut ::c_short,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int;
+    pub fn posix_spawnattr_getpgroup(
+        attr: *const posix_spawnattr_t,
+        _pgroup: *mut ::pid_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, pgroup: ::pid_t) -> ::c_int;
+    pub fn posix_spawnattr_getsigdefault(
+        attr: *const posix_spawnattr_t,
+        sigdefault: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigdefault(
+        attr: *mut posix_spawnattr_t,
+        sigdefault: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getsigmask(
+        attr: *const posix_spawnattr_t,
+        _sigmask: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigmask(
+        attr: *mut posix_spawnattr_t,
+        sigmask: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn getopt_long(
+        argc: ::c_int,
+        argv: *const *mut c_char,
+        optstring: *const c_char,
+        longopts: *const option,
+        longindex: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn strcasecmp_l(
+        string1: *const ::c_char,
+        string2: *const ::c_char,
+        locale: ::locale_t,
+    ) -> ::c_int;
+    pub fn strncasecmp_l(
+        string1: *const ::c_char,
+        string2: *const ::c_char,
+        length: ::size_t,
+        locale: ::locale_t,
+    ) -> ::c_int;
+}
+
+#[link(name = "bsd")]
+extern "C" {
+    pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
+    pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
+    pub fn forkpty(
+        amaster: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *mut termios,
+        winp: *mut ::winsize,
+    ) -> ::pid_t;
+    pub fn openpty(
+        amaster: *mut ::c_int,
+        aslave: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *mut termios,
+        winp: *mut ::winsize,
+    ) -> ::c_int;
+    pub fn strsep(string: *mut *mut ::c_char, delimiters: *const ::c_char) -> *mut ::c_char;
+    pub fn explicit_bzero(buf: *mut ::c_void, len: ::size_t);
+    pub fn login_tty(_fd: ::c_int) -> ::c_int;
+
+    pub fn sl_init() -> *mut StringList;
+    pub fn sl_add(sl: *mut StringList, n: *mut ::c_char) -> ::c_int;
+    pub fn sl_free(sl: *mut StringList, i: ::c_int);
+    pub fn sl_find(sl: *mut StringList, n: *mut ::c_char) -> *mut ::c_char;
+
+    pub fn getprogname() -> *const ::c_char;
+    pub fn setprogname(progname: *const ::c_char);
+    pub fn dl_iterate_phdr(
+        callback: ::Option<
+            unsafe extern "C" fn(
+                info: *mut dl_phdr_info,
+                size: usize,
+                data: *mut ::c_void,
+            ) -> ::c_int,
+        >,
+        data: *mut ::c_void,
+    ) -> ::c_int;
+}
+
+#[link(name = "gnu")]
+extern "C" {
+    pub fn memmem(
+        source: *const ::c_void,
+        sourceLength: ::size_t,
+        search: *const ::c_void,
+        searchLength: ::size_t,
+    ) -> *mut ::c_void;
+
+    pub fn pthread_getattr_np(thread: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
+    pub fn pthread_getname_np(
+        thread: ::pthread_t,
+        buffer: *mut ::c_char,
+        length: ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(target_pointer_width = "64")] {
+        mod b64;
+        pub use self::b64::*;
+    } else {
+        mod b32;
+        pub use self::b32::*;
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "x86")] {
+        // TODO
+        // mod x86;
+        // pub use self::x86::*;
+    } else if #[cfg(target_arch = "x86_64")] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    } else if #[cfg(target_arch = "aarch64")] {
+        // TODO
+        // mod aarch64;
+        // pub use self::aarch64::*;
+    }
+}
+
+mod native;
+pub use self::native::*;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/haiku/native.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/haiku/native.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/haiku/native.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/haiku/native.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1488 @@
+// This module contains bindings to the native Haiku API. The Haiku API
+// originates from BeOS, and it was the original way to perform low level
+// system and IO operations. The POSIX API was in that era was like a
+// compatibility layer. In current Haiku development, both the POSIX API and
+// the Haiku API are considered to be co-equal status. However, they are not
+// integrated like they are on other UNIX platforms, which means that for many
+// low level concepts there are two versions, like processes (POSIX) and
+// teams (Haiku), or pthreads and native threads.
+//
+// Both the POSIX API and the Haiku API live in libroot.so, the library that is
+// linked to any binary by default.
+//
+// This file follows the Haiku API for Haiku R1 beta 2. It is organized by the
+// C/C++ header files in which the concepts can be found, while adhering to the
+// style guide for this crate.
+
+// Helper macro to generate u32 constants. The Haiku API uses (non-standard)
+// multi-character constants (like 'UPDA' or 'MSGM') to represent 32 bit
+// integer constants.
+
+macro_rules! haiku_constant {
+    ($a:tt, $b:tt, $c:tt, $d:tt) => {
+        (($a as u32) << 24) + (($b as u32) << 16) + (($c as u32) << 8) + ($d as u32)
+    };
+}
+
+// support/SupportDefs.h
+pub type status_t = i32;
+pub type bigtime_t = i64;
+pub type nanotime_t = i64;
+pub type type_code = u32;
+pub type perform_code = u32;
+
+// kernel/OS.h
+pub type area_id = i32;
+pub type port_id = i32;
+pub type sem_id = i32;
+pub type team_id = i32;
+pub type thread_id = i32;
+
+pub type thread_func = extern "C" fn(*mut ::c_void) -> status_t;
+
+// kernel/image.h
+pub type image_id = i32;
+
+e! {
+    // kernel/OS.h
+    pub enum thread_state {
+        B_THREAD_RUNNING = 1,
+        B_THREAD_READY,
+        B_THREAD_RECEIVING,
+        B_THREAD_ASLEEP,
+        B_THREAD_SUSPENDED,
+        B_THREAD_WAITING
+    }
+
+    // kernel/image.h
+    pub enum image_type {
+        B_APP_IMAGE = 1,
+        B_LIBRARY_IMAGE,
+        B_ADD_ON_IMAGE,
+        B_SYSTEM_IMAGE
+    }
+
+    // kernel/scheduler.h
+
+    pub enum be_task_flags {
+        B_DEFAULT_MEDIA_PRIORITY = 0x000,
+        B_OFFLINE_PROCESSING = 0x001,
+        B_STATUS_RENDERING = 0x002,
+        B_USER_INPUT_HANDLING = 0x004,
+        B_LIVE_VIDEO_MANIPULATION = 0x008,
+        B_VIDEO_PLAYBACK = 0x010,
+        B_VIDEO_RECORDING = 0x020,
+        B_LIVE_AUDIO_MANIPULATION = 0x040,
+        B_AUDIO_PLAYBACK = 0x080,
+        B_AUDIO_RECORDING = 0x100,
+        B_LIVE_3D_RENDERING = 0x200,
+        B_NUMBER_CRUNCHING = 0x400,
+        B_MIDI_PROCESSING = 0x800,
+    }
+
+    pub enum schduler_mode {
+        SCHEDULER_MODE_LOW_LATENCY,
+        SCHEDULER_MODE_POWER_SAVING,
+    }
+
+    // FindDirectory.h
+    pub enum path_base_directory {
+        B_FIND_PATH_INSTALLATION_LOCATION_DIRECTORY,
+        B_FIND_PATH_ADD_ONS_DIRECTORY,
+        B_FIND_PATH_APPS_DIRECTORY,
+        B_FIND_PATH_BIN_DIRECTORY,
+        B_FIND_PATH_BOOT_DIRECTORY,
+        B_FIND_PATH_CACHE_DIRECTORY,
+        B_FIND_PATH_DATA_DIRECTORY,
+        B_FIND_PATH_DEVELOP_DIRECTORY,
+        B_FIND_PATH_DEVELOP_LIB_DIRECTORY,
+        B_FIND_PATH_DOCUMENTATION_DIRECTORY,
+        B_FIND_PATH_ETC_DIRECTORY,
+        B_FIND_PATH_FONTS_DIRECTORY,
+        B_FIND_PATH_HEADERS_DIRECTORY,
+        B_FIND_PATH_LIB_DIRECTORY,
+        B_FIND_PATH_LOG_DIRECTORY,
+        B_FIND_PATH_MEDIA_NODES_DIRECTORY,
+        B_FIND_PATH_PACKAGES_DIRECTORY,
+        B_FIND_PATH_PREFERENCES_DIRECTORY,
+        B_FIND_PATH_SERVERS_DIRECTORY,
+        B_FIND_PATH_SETTINGS_DIRECTORY,
+        B_FIND_PATH_SOUNDS_DIRECTORY,
+        B_FIND_PATH_SPOOL_DIRECTORY,
+        B_FIND_PATH_TRANSLATORS_DIRECTORY,
+        B_FIND_PATH_VAR_DIRECTORY,
+        B_FIND_PATH_IMAGE_PATH = 1000,
+        B_FIND_PATH_PACKAGE_PATH,
+    }
+
+    pub enum directory_which {
+        B_DESKTOP_DIRECTORY = 0,
+        B_TRASH_DIRECTORY,
+        B_SYSTEM_DIRECTORY = 1000,
+        B_SYSTEM_ADDONS_DIRECTORY = 1002,
+        B_SYSTEM_BOOT_DIRECTORY,
+        B_SYSTEM_FONTS_DIRECTORY,
+        B_SYSTEM_LIB_DIRECTORY,
+        B_SYSTEM_SERVERS_DIRECTORY,
+        B_SYSTEM_APPS_DIRECTORY,
+        B_SYSTEM_BIN_DIRECTORY,
+        B_SYSTEM_DOCUMENTATION_DIRECTORY = 1010,
+        B_SYSTEM_PREFERENCES_DIRECTORY,
+        B_SYSTEM_TRANSLATORS_DIRECTORY,
+        B_SYSTEM_MEDIA_NODES_DIRECTORY,
+        B_SYSTEM_SOUNDS_DIRECTORY,
+        B_SYSTEM_DATA_DIRECTORY,
+        B_SYSTEM_DEVELOP_DIRECTORY,
+        B_SYSTEM_PACKAGES_DIRECTORY,
+        B_SYSTEM_HEADERS_DIRECTORY,
+        B_SYSTEM_ETC_DIRECTORY = 2008,
+        B_SYSTEM_SETTINGS_DIRECTORY = 2010,
+        B_SYSTEM_LOG_DIRECTORY = 2012,
+        B_SYSTEM_SPOOL_DIRECTORY,
+        B_SYSTEM_TEMP_DIRECTORY,
+        B_SYSTEM_VAR_DIRECTORY,
+        B_SYSTEM_CACHE_DIRECTORY = 2020,
+        B_SYSTEM_NONPACKAGED_DIRECTORY = 2023,
+        B_SYSTEM_NONPACKAGED_ADDONS_DIRECTORY,
+        B_SYSTEM_NONPACKAGED_TRANSLATORS_DIRECTORY,
+        B_SYSTEM_NONPACKAGED_MEDIA_NODES_DIRECTORY,
+        B_SYSTEM_NONPACKAGED_BIN_DIRECTORY,
+        B_SYSTEM_NONPACKAGED_DATA_DIRECTORY,
+        B_SYSTEM_NONPACKAGED_FONTS_DIRECTORY,
+        B_SYSTEM_NONPACKAGED_SOUNDS_DIRECTORY,
+        B_SYSTEM_NONPACKAGED_DOCUMENTATION_DIRECTORY,
+        B_SYSTEM_NONPACKAGED_LIB_DIRECTORY,
+        B_SYSTEM_NONPACKAGED_HEADERS_DIRECTORY,
+        B_SYSTEM_NONPACKAGED_DEVELOP_DIRECTORY,
+        B_USER_DIRECTORY = 3000,
+        B_USER_CONFIG_DIRECTORY,
+        B_USER_ADDONS_DIRECTORY,
+        B_USER_BOOT_DIRECTORY,
+        B_USER_FONTS_DIRECTORY,
+        B_USER_LIB_DIRECTORY,
+        B_USER_SETTINGS_DIRECTORY,
+        B_USER_DESKBAR_DIRECTORY,
+        B_USER_PRINTERS_DIRECTORY,
+        B_USER_TRANSLATORS_DIRECTORY,
+        B_USER_MEDIA_NODES_DIRECTORY,
+        B_USER_SOUNDS_DIRECTORY,
+        B_USER_DATA_DIRECTORY,
+        B_USER_CACHE_DIRECTORY,
+        B_USER_PACKAGES_DIRECTORY,
+        B_USER_HEADERS_DIRECTORY,
+        B_USER_NONPACKAGED_DIRECTORY,
+        B_USER_NONPACKAGED_ADDONS_DIRECTORY,
+        B_USER_NONPACKAGED_TRANSLATORS_DIRECTORY,
+        B_USER_NONPACKAGED_MEDIA_NODES_DIRECTORY,
+        B_USER_NONPACKAGED_BIN_DIRECTORY,
+        B_USER_NONPACKAGED_DATA_DIRECTORY,
+        B_USER_NONPACKAGED_FONTS_DIRECTORY,
+        B_USER_NONPACKAGED_SOUNDS_DIRECTORY,
+        B_USER_NONPACKAGED_DOCUMENTATION_DIRECTORY,
+        B_USER_NONPACKAGED_LIB_DIRECTORY,
+        B_USER_NONPACKAGED_HEADERS_DIRECTORY,
+        B_USER_NONPACKAGED_DEVELOP_DIRECTORY,
+        B_USER_DEVELOP_DIRECTORY,
+        B_USER_DOCUMENTATION_DIRECTORY,
+        B_USER_SERVERS_DIRECTORY,
+        B_USER_APPS_DIRECTORY,
+        B_USER_BIN_DIRECTORY,
+        B_USER_PREFERENCES_DIRECTORY,
+        B_USER_ETC_DIRECTORY,
+        B_USER_LOG_DIRECTORY,
+        B_USER_SPOOL_DIRECTORY,
+        B_USER_VAR_DIRECTORY,
+        B_APPS_DIRECTORY = 4000,
+        B_PREFERENCES_DIRECTORY,
+        B_UTILITIES_DIRECTORY,
+        B_PACKAGE_LINKS_DIRECTORY,
+    }
+
+    // kernel/OS.h
+
+    pub enum topology_level_type {
+        B_TOPOLOGY_UNKNOWN,
+        B_TOPOLOGY_ROOT,
+        B_TOPOLOGY_SMT,
+        B_TOPOLOGY_CORE,
+        B_TOPOLOGY_PACKAGE,
+    }
+
+    pub enum cpu_platform {
+        B_CPU_UNKNOWN,
+        B_CPU_x86,
+        B_CPU_x86_64,
+        B_CPU_PPC,
+        B_CPU_PPC_64,
+        B_CPU_M68K,
+        B_CPU_ARM,
+        B_CPU_ARM_64,
+        B_CPU_ALPHA,
+        B_CPU_MIPS,
+        B_CPU_SH,
+        B_CPU_SPARC,
+        B_CPU_RISC_V
+    }
+
+    pub enum cpu_vendor {
+        B_CPU_VENDOR_UNKNOWN,
+        B_CPU_VENDOR_AMD,
+        B_CPU_VENDOR_CYRIX,
+        B_CPU_VENDOR_IDT,
+        B_CPU_VENDOR_INTEL,
+        B_CPU_VENDOR_NATIONAL_SEMICONDUCTOR,
+        B_CPU_VENDOR_RISE,
+        B_CPU_VENDOR_TRANSMETA,
+        B_CPU_VENDOR_VIA,
+        B_CPU_VENDOR_IBM,
+        B_CPU_VENDOR_MOTOROLA,
+        B_CPU_VENDOR_NEC,
+        B_CPU_VENDOR_HYGON,
+        B_CPU_VENDOR_SUN,
+        B_CPU_VENDOR_FUJITSU
+    }
+}
+
+s! {
+    // kernel/OS.h
+    pub struct area_info {
+        pub area: area_id,
+        pub name: [::c_char; B_OS_NAME_LENGTH],
+        pub size: usize,
+        pub lock: u32,
+        pub protection: u32,
+        pub team: team_id,
+        pub ram_size: u32,
+        pub copy_count: u32,
+        pub in_count: u32,
+        pub out_count: u32,
+        pub address: *mut ::c_void
+    }
+
+    pub struct port_info {
+        pub port: port_id,
+        pub team: team_id,
+        pub name: [::c_char; B_OS_NAME_LENGTH],
+        pub capacity: i32,
+        pub queue_count: i32,
+        pub total_count: i32,
+    }
+
+    pub struct port_message_info {
+        pub size: ::size_t,
+        pub sender: ::uid_t,
+        pub sender_group: ::gid_t,
+        pub sender_team: ::team_id
+    }
+
+    pub struct team_info {
+        pub team: team_id,
+        pub thread_count: i32,
+        pub image_count: i32,
+        pub area_count: i32,
+        pub debugger_nub_thread: thread_id,
+        pub debugger_nub_port: port_id,
+        pub argc: i32,
+        pub args: [::c_char; 64],
+        pub uid: ::uid_t,
+        pub gid: ::gid_t
+    }
+
+    pub struct sem_info {
+        pub sem: sem_id,
+        pub team: team_id,
+        pub name: [::c_char; B_OS_NAME_LENGTH],
+        pub count: i32,
+        pub latest_holder: thread_id
+    }
+
+    pub struct team_usage_info {
+        pub user_time: bigtime_t,
+        pub kernel_time: bigtime_t
+    }
+
+    pub struct thread_info {
+        pub thread: thread_id,
+        pub team: team_id,
+        pub name: [::c_char; B_OS_NAME_LENGTH],
+        pub state: thread_state,
+        pub priority: i32,
+        pub sem: sem_id,
+        pub user_time: bigtime_t,
+        pub kernel_time: bigtime_t,
+        pub stack_base: *mut ::c_void,
+        pub stack_end: *mut ::c_void
+    }
+
+    pub struct cpu_info {
+        pub active_time: bigtime_t,
+        pub enabled: bool,
+        pub current_frequency: u64
+    }
+
+    pub struct system_info {
+        pub boot_time: bigtime_t,
+        pub cpu_count: u32,
+        pub max_pages: u64,
+        pub used_pages: u64,
+        pub cached_pages: u64,
+        pub block_cache_pages: u64,
+        pub ignored_pages: u64,
+        pub needed_memory: u64,
+        pub free_memory: u64,
+        pub max_swap_pages: u64,
+        pub free_swap_pages: u64,
+        pub page_faults: u32,
+        pub max_sems: u32,
+        pub used_sems: u32,
+        pub max_ports: u32,
+        pub used_ports: u32,
+        pub max_threads: u32,
+        pub used_threads: u32,
+        pub max_teams: u32,
+        pub used_teams: u32,
+        pub kernel_name: [::c_char; B_FILE_NAME_LENGTH],
+        pub kernel_build_date: [::c_char; B_OS_NAME_LENGTH],
+        pub kernel_build_time: [::c_char; B_OS_NAME_LENGTH],
+        pub kernel_version: i64,
+        pub abi: u32
+    }
+
+    pub struct object_wait_info {
+        pub object: i32,
+        pub type_: u16,
+        pub events: u16
+    }
+
+    pub struct cpu_topology_root_info {
+        pub platform: cpu_platform,
+    }
+
+    pub struct cpu_topology_package_info {
+        pub vendor: cpu_vendor,
+        pub cache_line_size: u32,
+    }
+
+    pub struct cpu_topology_core_info {
+        pub model: u32,
+        pub default_frequency: u64,
+    }
+    // kernel/fs_attr.h
+    pub struct attr_info {
+        pub type_: u32,
+        pub size: ::off_t
+    }
+
+    // kernel/fs_index.h
+    pub struct index_info {
+        pub type_: u32,
+        pub size: ::off_t,
+        pub modification_time: ::time_t,
+        pub creation_time: ::time_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t
+    }
+
+    //kernel/fs_info.h
+    pub struct fs_info {
+        pub dev: ::dev_t,
+        pub root: ::ino_t,
+        pub flags: u32,
+        pub block_size: ::off_t,
+        pub io_size: ::off_t,
+        pub total_blocks: ::off_t,
+        pub free_blocks: ::off_t,
+        pub total_nodes: ::off_t,
+        pub free_nodes: ::off_t,
+        pub device_name: [::c_char; 128],
+        pub volume_name: [::c_char; B_FILE_NAME_LENGTH],
+        pub fsh_name: [::c_char; B_OS_NAME_LENGTH]
+    }
+
+    // kernel/image.h
+    pub struct image_info {
+        pub id: image_id,
+        pub image_type: ::c_int,
+        pub sequence: i32,
+        pub init_order: i32,
+        pub init_routine: extern "C" fn(),
+        pub term_routine: extern "C" fn(),
+        pub device: ::dev_t,
+        pub node: ::ino_t,
+        pub name: [::c_char; ::PATH_MAX as usize],
+        pub text: *mut ::c_void,
+        pub data: *mut ::c_void,
+        pub text_size: i32,
+        pub data_size: i32,
+        pub api_version: i32,
+        pub abi: i32
+    }
+
+    pub struct __c_anonymous_eax_0 {
+        pub max_eax: u32,
+        pub vendor_id: [::c_char; 12],
+    }
+
+    pub struct __c_anonymous_eax_1 {
+        pub stepping: u32,
+        pub model: u32,
+        pub family: u32,
+        pub tpe: u32,
+        __reserved_0: u32,
+        pub extended_model: u32,
+        pub extended_family: u32,
+        __reserved_1: u32,
+        pub brand_index: u32,
+        pub clflush: u32,
+        pub logical_cpus: u32,
+        pub apic_id: u32,
+        pub features: u32,
+        pub extended_features: u32,
+    }
+
+    pub struct __c_anonymous_eax_2 {
+        pub call_num: u8,
+        pub cache_descriptors: [u8; 15],
+    }
+
+    pub struct __c_anonymous_eax_3 {
+        __reserved: [u32; 2],
+        pub serial_number_high: u32,
+        pub serial_number_low: u32,
+    }
+
+    pub struct __c_anonymous_regs {
+        pub eax: u32,
+        pub ebx: u32,
+        pub edx: u32,
+        pub ecx: u32,
+    }
+}
+
+s_no_extra_traits! {
+    #[cfg(libc_union)]
+    pub union cpuid_info {
+        pub eax_0: __c_anonymous_eax_0,
+        pub eax_1: __c_anonymous_eax_1,
+        pub eax_2: __c_anonymous_eax_2,
+        pub eax_3: __c_anonymous_eax_3,
+        pub as_chars: [::c_char; 16],
+        pub regs: __c_anonymous_regs,
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_cpu_topology_info_data {
+        pub root: cpu_topology_root_info,
+        pub package: cpu_topology_package_info,
+        pub core: cpu_topology_core_info,
+    }
+
+    pub struct cpu_topology_node_info {
+        pub id: u32,
+        pub type_: topology_level_type,
+        pub level: u32,
+        #[cfg(libc_union)]
+        pub data: __c_anonymous_cpu_topology_info_data,
+        #[cfg(not(libc_union))]
+        pub data: cpu_topology_core_info,
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        #[cfg(libc_union)]
+        impl PartialEq for cpuid_info {
+            fn eq(&self, other: &cpuid_info) -> bool {
+                unsafe {
+                self.eax_0 == other.eax_0
+                    || self.eax_1 == other.eax_1
+                    || self.eax_2 == other.eax_2
+                    || self.eax_3 == other.eax_3
+                    || self.as_chars == other.as_chars
+                    || self.regs == other.regs
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for cpuid_info {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for cpuid_info {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                f.debug_struct("cpuid_info")
+                    .field("eax_0", &self.eax_0)
+                    .field("eax_1", &self.eax_1)
+                    .field("eax_2", &self.eax_2)
+                    .field("eax_3", &self.eax_3)
+                    .field("as_chars", &self.as_chars)
+                    .field("regs", &self.regs)
+                    .finish()
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl PartialEq for __c_anonymous_cpu_topology_info_data {
+            fn eq(&self, other: &__c_anonymous_cpu_topology_info_data) -> bool {
+                unsafe {
+                self.root == other.root
+                    || self.package == other.package
+                    || self.core == other.core
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_cpu_topology_info_data {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_cpu_topology_info_data {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                f.debug_struct("__c_anonymous_cpu_topology_info_data")
+                    .field("root", &self.root)
+                    .field("package", &self.package)
+                    .field("core", &self.core)
+                    .finish()
+                }
+            }
+        }
+
+        impl PartialEq for cpu_topology_node_info {
+            fn eq(&self, other: &cpu_topology_node_info) -> bool {
+                self.id == other.id
+                    && self.type_ == other.type_
+                    && self.level == other.level
+            }
+        }
+
+        impl Eq for cpu_topology_node_info {}
+        impl ::fmt::Debug for cpu_topology_node_info {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("cpu_topology_node_info")
+                    .field("id", &self.id)
+                    .field("type", &self.type_)
+                    .field("level", &self.level)
+                    .finish()
+            }
+        }
+    }
+}
+
+// kernel/OS.h
+pub const B_OS_NAME_LENGTH: usize = 32;
+pub const B_PAGE_SIZE: usize = 4096;
+pub const B_INFINITE_TIMEOUT: usize = 9223372036854775807;
+
+pub const B_RELATIVE_TIMEOUT: u32 = 0x8;
+pub const B_ABSOLUTE_TIMEOUT: u32 = 0x10;
+pub const B_TIMEOUT_REAL_TIME_BASE: u32 = 0x40;
+pub const B_ABSOLUTE_REAL_TIME_TIMEOUT: u32 = B_ABSOLUTE_TIMEOUT | B_TIMEOUT_REAL_TIME_BASE;
+
+pub const B_NO_LOCK: u32 = 0;
+pub const B_LAZY_LOCK: u32 = 1;
+pub const B_FULL_LOCK: u32 = 2;
+pub const B_CONTIGUOUS: u32 = 3;
+pub const B_LOMEM: u32 = 4;
+pub const B_32_BIT_FULL_LOCK: u32 = 5;
+pub const B_32_BIT_CONTIGUOUS: u32 = 6;
+
+pub const B_ANY_ADDRESS: u32 = 0;
+pub const B_EXACT_ADDRESS: u32 = 1;
+pub const B_BASE_ADDRESS: u32 = 2;
+pub const B_CLONE_ADDRESS: u32 = 3;
+pub const B_ANY_KERNEL_ADDRESS: u32 = 4;
+pub const B_RANDOMIZED_ANY_ADDRESS: u32 = 6;
+pub const B_RANDOMIZED_BASE_ADDRESS: u32 = 7;
+
+pub const B_READ_AREA: u32 = 1 << 0;
+pub const B_WRITE_AREA: u32 = 1 << 1;
+pub const B_EXECUTE_AREA: u32 = 1 << 2;
+pub const B_STACK_AREA: u32 = 1 << 3;
+pub const B_CLONEABLE_AREA: u32 = 1 << 8;
+
+pub const B_CAN_INTERRUPT: u32 = 0x01;
+pub const B_CHECK_PERMISSION: u32 = 0x04;
+pub const B_KILL_CAN_INTERRUPT: u32 = 0x20;
+pub const B_DO_NOT_RESCHEDULE: u32 = 0x02;
+pub const B_RELEASE_ALL: u32 = 0x08;
+pub const B_RELEASE_IF_WAITING_ONLY: u32 = 0x10;
+
+pub const B_CURRENT_TEAM: team_id = 0;
+pub const B_SYSTEM_TEAM: team_id = 1;
+
+pub const B_TEAM_USAGE_SELF: i32 = 0;
+pub const B_TEAM_USAGE_CHILDREN: i32 = -1;
+
+pub const B_IDLE_PRIORITY: i32 = 0;
+pub const B_LOWEST_ACTIVE_PRIORITY: i32 = 1;
+pub const B_LOW_PRIORITY: i32 = 5;
+pub const B_NORMAL_PRIORITY: i32 = 10;
+pub const B_DISPLAY_PRIORITY: i32 = 15;
+pub const B_URGENT_DISPLAY_PRIORITY: i32 = 20;
+pub const B_REAL_TIME_DISPLAY_PRIORITY: i32 = 100;
+pub const B_URGENT_PRIORITY: i32 = 110;
+pub const B_REAL_TIME_PRIORITY: i32 = 120;
+
+pub const B_SYSTEM_TIMEBASE: i32 = 0;
+pub const B_FIRST_REAL_TIME_PRIORITY: i32 = B_REAL_TIME_DISPLAY_PRIORITY;
+
+pub const B_ONE_SHOT_ABSOLUTE_ALARM: u32 = 1;
+pub const B_ONE_SHOT_RELATIVE_ALARM: u32 = 2;
+pub const B_PERIODIC_ALARM: u32 = 3;
+
+pub const B_OBJECT_TYPE_FD: u16 = 0;
+pub const B_OBJECT_TYPE_SEMAPHORE: u16 = 1;
+pub const B_OBJECT_TYPE_PORT: u16 = 2;
+pub const B_OBJECT_TYPE_THREAD: u16 = 3;
+
+pub const B_EVENT_READ: u16 = 0x0001;
+pub const B_EVENT_WRITE: u16 = 0x0002;
+pub const B_EVENT_ERROR: u16 = 0x0004;
+pub const B_EVENT_PRIORITY_READ: u16 = 0x0008;
+pub const B_EVENT_PRIORITY_WRITE: u16 = 0x0010;
+pub const B_EVENT_HIGH_PRIORITY_READ: u16 = 0x0020;
+pub const B_EVENT_HIGH_PRIORITY_WRITE: u16 = 0x0040;
+pub const B_EVENT_DISCONNECTED: u16 = 0x0080;
+pub const B_EVENT_ACQUIRE_SEMAPHORE: u16 = 0x0001;
+pub const B_EVENT_INVALID: u16 = 0x1000;
+
+// kernel/fs_info.h
+pub const B_FS_IS_READONLY: u32 = 0x00000001;
+pub const B_FS_IS_REMOVABLE: u32 = 0x00000002;
+pub const B_FS_IS_PERSISTENT: u32 = 0x00000004;
+pub const B_FS_IS_SHARED: u32 = 0x00000008;
+pub const B_FS_HAS_MIME: u32 = 0x00010000;
+pub const B_FS_HAS_ATTR: u32 = 0x00020000;
+pub const B_FS_HAS_QUERY: u32 = 0x00040000;
+pub const B_FS_HAS_SELF_HEALING_LINKS: u32 = 0x00080000;
+pub const B_FS_HAS_ALIASES: u32 = 0x00100000;
+pub const B_FS_SUPPORTS_NODE_MONITORING: u32 = 0x00200000;
+pub const B_FS_SUPPORTS_MONITOR_CHILDREN: u32 = 0x00400000;
+
+// kernel/fs_query.h
+pub const B_LIVE_QUERY: u32 = 0x00000001;
+pub const B_QUERY_NON_INDEXED: u32 = 0x00000002;
+
+// kernel/fs_volume.h
+pub const B_MOUNT_READ_ONLY: u32 = 1;
+pub const B_MOUNT_VIRTUAL_DEVICE: u32 = 2;
+pub const B_FORCE_UNMOUNT: u32 = 1;
+
+// kernel/image.h
+pub const B_FLUSH_DCACHE: u32 = 0x0001;
+pub const B_FLUSH_ICACHE: u32 = 0x0004;
+pub const B_INVALIDATE_DCACHE: u32 = 0x0002;
+pub const B_INVALIDATE_ICACHE: u32 = 0x0008;
+
+pub const B_SYMBOL_TYPE_DATA: i32 = 0x1;
+pub const B_SYMBOL_TYPE_TEXT: i32 = 0x2;
+pub const B_SYMBOL_TYPE_ANY: i32 = 0x5;
+
+// storage/StorageDefs.h
+pub const B_DEV_NAME_LENGTH: usize = 128;
+pub const B_FILE_NAME_LENGTH: usize = ::FILENAME_MAX as usize;
+pub const B_PATH_NAME_LENGTH: usize = ::PATH_MAX as usize;
+pub const B_ATTR_NAME_LENGTH: usize = B_FILE_NAME_LENGTH - 1;
+pub const B_MIME_TYPE_LENGTH: usize = B_ATTR_NAME_LENGTH - 15;
+pub const B_MAX_SYMLINKS: usize = 16;
+
+// Haiku open modes in BFile are passed as u32
+pub const B_READ_ONLY: u32 = ::O_RDONLY as u32;
+pub const B_WRITE_ONLY: u32 = ::O_WRONLY as u32;
+pub const B_READ_WRITE: u32 = ::O_RDWR as u32;
+
+pub const B_FAIL_IF_EXISTS: u32 = ::O_EXCL as u32;
+pub const B_CREATE_FILE: u32 = ::O_CREAT as u32;
+pub const B_ERASE_FILE: u32 = ::O_TRUNC as u32;
+pub const B_OPEN_AT_END: u32 = ::O_APPEND as u32;
+
+pub const B_FILE_NODE: u32 = 0x01;
+pub const B_SYMLINK_NODE: u32 = 0x02;
+pub const B_DIRECTORY_NODE: u32 = 0x04;
+pub const B_ANY_NODE: u32 = 0x07;
+
+// support/Errors.h
+pub const B_GENERAL_ERROR_BASE: status_t = core::i32::MIN;
+pub const B_OS_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x1000;
+pub const B_APP_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x2000;
+pub const B_INTERFACE_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x3000;
+pub const B_MEDIA_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x4000;
+pub const B_TRANSLATION_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x4800;
+pub const B_MIDI_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x5000;
+pub const B_STORAGE_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x6000;
+pub const B_POSIX_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x7000;
+pub const B_MAIL_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x8000;
+pub const B_PRINT_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x9000;
+pub const B_DEVICE_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0xa000;
+pub const B_ERRORS_END: status_t = B_GENERAL_ERROR_BASE + 0xffff;
+
+// General errors
+pub const B_NO_MEMORY: status_t = B_GENERAL_ERROR_BASE + 0;
+pub const B_IO_ERROR: status_t = B_GENERAL_ERROR_BASE + 1;
+pub const B_PERMISSION_DENIED: status_t = B_GENERAL_ERROR_BASE + 2;
+pub const B_BAD_INDEX: status_t = B_GENERAL_ERROR_BASE + 3;
+pub const B_BAD_TYPE: status_t = B_GENERAL_ERROR_BASE + 4;
+pub const B_BAD_VALUE: status_t = B_GENERAL_ERROR_BASE + 5;
+pub const B_MISMATCHED_VALUES: status_t = B_GENERAL_ERROR_BASE + 6;
+pub const B_NAME_NOT_FOUND: status_t = B_GENERAL_ERROR_BASE + 7;
+pub const B_NAME_IN_USE: status_t = B_GENERAL_ERROR_BASE + 8;
+pub const B_TIMED_OUT: status_t = B_GENERAL_ERROR_BASE + 9;
+pub const B_INTERRUPTED: status_t = B_GENERAL_ERROR_BASE + 10;
+pub const B_WOULD_BLOCK: status_t = B_GENERAL_ERROR_BASE + 11;
+pub const B_CANCELED: status_t = B_GENERAL_ERROR_BASE + 12;
+pub const B_NO_INIT: status_t = B_GENERAL_ERROR_BASE + 13;
+pub const B_NOT_INITIALIZED: status_t = B_GENERAL_ERROR_BASE + 13;
+pub const B_BUSY: status_t = B_GENERAL_ERROR_BASE + 14;
+pub const B_NOT_ALLOWED: status_t = B_GENERAL_ERROR_BASE + 15;
+pub const B_BAD_DATA: status_t = B_GENERAL_ERROR_BASE + 16;
+pub const B_DONT_DO_THAT: status_t = B_GENERAL_ERROR_BASE + 17;
+
+pub const B_ERROR: status_t = -1;
+pub const B_OK: status_t = 0;
+pub const B_NO_ERROR: status_t = 0;
+
+// Kernel kit errors
+pub const B_BAD_SEM_ID: status_t = B_OS_ERROR_BASE + 0;
+pub const B_NO_MORE_SEMS: status_t = B_OS_ERROR_BASE + 1;
+
+pub const B_BAD_THREAD_ID: status_t = B_OS_ERROR_BASE + 0x100;
+pub const B_NO_MORE_THREADS: status_t = B_OS_ERROR_BASE + 0x101;
+pub const B_BAD_THREAD_STATE: status_t = B_OS_ERROR_BASE + 0x102;
+pub const B_BAD_TEAM_ID: status_t = B_OS_ERROR_BASE + 0x103;
+pub const B_NO_MORE_TEAMS: status_t = B_OS_ERROR_BASE + 0x104;
+
+pub const B_BAD_PORT_ID: status_t = B_OS_ERROR_BASE + 0x200;
+pub const B_NO_MORE_PORTS: status_t = B_OS_ERROR_BASE + 0x201;
+
+pub const B_BAD_IMAGE_ID: status_t = B_OS_ERROR_BASE + 0x300;
+pub const B_BAD_ADDRESS: status_t = B_OS_ERROR_BASE + 0x301;
+pub const B_NOT_AN_EXECUTABLE: status_t = B_OS_ERROR_BASE + 0x302;
+pub const B_MISSING_LIBRARY: status_t = B_OS_ERROR_BASE + 0x303;
+pub const B_MISSING_SYMBOL: status_t = B_OS_ERROR_BASE + 0x304;
+pub const B_UNKNOWN_EXECUTABLE: status_t = B_OS_ERROR_BASE + 0x305;
+pub const B_LEGACY_EXECUTABLE: status_t = B_OS_ERROR_BASE + 0x306;
+
+pub const B_DEBUGGER_ALREADY_INSTALLED: status_t = B_OS_ERROR_BASE + 0x400;
+
+// Application kit errors
+pub const B_BAD_REPLY: status_t = B_APP_ERROR_BASE + 0;
+pub const B_DUPLICATE_REPLY: status_t = B_APP_ERROR_BASE + 1;
+pub const B_MESSAGE_TO_SELF: status_t = B_APP_ERROR_BASE + 2;
+pub const B_BAD_HANDLER: status_t = B_APP_ERROR_BASE + 3;
+pub const B_ALREADY_RUNNING: status_t = B_APP_ERROR_BASE + 4;
+pub const B_LAUNCH_FAILED: status_t = B_APP_ERROR_BASE + 5;
+pub const B_AMBIGUOUS_APP_LAUNCH: status_t = B_APP_ERROR_BASE + 6;
+pub const B_UNKNOWN_MIME_TYPE: status_t = B_APP_ERROR_BASE + 7;
+pub const B_BAD_SCRIPT_SYNTAX: status_t = B_APP_ERROR_BASE + 8;
+pub const B_LAUNCH_FAILED_NO_RESOLVE_LINK: status_t = B_APP_ERROR_BASE + 9;
+pub const B_LAUNCH_FAILED_EXECUTABLE: status_t = B_APP_ERROR_BASE + 10;
+pub const B_LAUNCH_FAILED_APP_NOT_FOUND: status_t = B_APP_ERROR_BASE + 11;
+pub const B_LAUNCH_FAILED_APP_IN_TRASH: status_t = B_APP_ERROR_BASE + 12;
+pub const B_LAUNCH_FAILED_NO_PREFERRED_APP: status_t = B_APP_ERROR_BASE + 13;
+pub const B_LAUNCH_FAILED_FILES_APP_NOT_FOUND: status_t = B_APP_ERROR_BASE + 14;
+pub const B_BAD_MIME_SNIFFER_RULE: status_t = B_APP_ERROR_BASE + 15;
+pub const B_NOT_A_MESSAGE: status_t = B_APP_ERROR_BASE + 16;
+pub const B_SHUTDOWN_CANCELLED: status_t = B_APP_ERROR_BASE + 17;
+pub const B_SHUTTING_DOWN: status_t = B_APP_ERROR_BASE + 18;
+
+// Storage kit errors
+pub const B_FILE_ERROR: status_t = B_STORAGE_ERROR_BASE + 0;
+pub const B_FILE_EXISTS: status_t = B_STORAGE_ERROR_BASE + 2;
+pub const B_ENTRY_NOT_FOUND: status_t = B_STORAGE_ERROR_BASE + 3;
+pub const B_NAME_TOO_LONG: status_t = B_STORAGE_ERROR_BASE + 4;
+pub const B_NOT_A_DIRECTORY: status_t = B_STORAGE_ERROR_BASE + 5;
+pub const B_DIRECTORY_NOT_EMPTY: status_t = B_STORAGE_ERROR_BASE + 6;
+pub const B_DEVICE_FULL: status_t = B_STORAGE_ERROR_BASE + 7;
+pub const B_READ_ONLY_DEVICE: status_t = B_STORAGE_ERROR_BASE + 8;
+pub const B_IS_A_DIRECTORY: status_t = B_STORAGE_ERROR_BASE + 9;
+pub const B_NO_MORE_FDS: status_t = B_STORAGE_ERROR_BASE + 10;
+pub const B_CROSS_DEVICE_LINK: status_t = B_STORAGE_ERROR_BASE + 11;
+pub const B_LINK_LIMIT: status_t = B_STORAGE_ERROR_BASE + 12;
+pub const B_BUSTED_PIPE: status_t = B_STORAGE_ERROR_BASE + 13;
+pub const B_UNSUPPORTED: status_t = B_STORAGE_ERROR_BASE + 14;
+pub const B_PARTITION_TOO_SMALL: status_t = B_STORAGE_ERROR_BASE + 15;
+pub const B_PARTIAL_READ: status_t = B_STORAGE_ERROR_BASE + 16;
+pub const B_PARTIAL_WRITE: status_t = B_STORAGE_ERROR_BASE + 17;
+
+// Mapped posix errors
+pub const B_BUFFER_OVERFLOW: status_t = ::EOVERFLOW;
+pub const B_TOO_MANY_ARGS: status_t = ::E2BIG;
+pub const B_FILE_TOO_LARGE: status_t = ::EFBIG;
+pub const B_RESULT_NOT_REPRESENTABLE: status_t = ::ERANGE;
+pub const B_DEVICE_NOT_FOUND: status_t = ::ENODEV;
+pub const B_NOT_SUPPORTED: status_t = ::EOPNOTSUPP;
+
+// Media kit errors
+pub const B_STREAM_NOT_FOUND: status_t = B_MEDIA_ERROR_BASE + 0;
+pub const B_SERVER_NOT_FOUND: status_t = B_MEDIA_ERROR_BASE + 1;
+pub const B_RESOURCE_NOT_FOUND: status_t = B_MEDIA_ERROR_BASE + 2;
+pub const B_RESOURCE_UNAVAILABLE: status_t = B_MEDIA_ERROR_BASE + 3;
+pub const B_BAD_SUBSCRIBER: status_t = B_MEDIA_ERROR_BASE + 4;
+pub const B_SUBSCRIBER_NOT_ENTERED: status_t = B_MEDIA_ERROR_BASE + 5;
+pub const B_BUFFER_NOT_AVAILABLE: status_t = B_MEDIA_ERROR_BASE + 6;
+pub const B_LAST_BUFFER_ERROR: status_t = B_MEDIA_ERROR_BASE + 7;
+
+pub const B_MEDIA_SYSTEM_FAILURE: status_t = B_MEDIA_ERROR_BASE + 100;
+pub const B_MEDIA_BAD_NODE: status_t = B_MEDIA_ERROR_BASE + 101;
+pub const B_MEDIA_NODE_BUSY: status_t = B_MEDIA_ERROR_BASE + 102;
+pub const B_MEDIA_BAD_FORMAT: status_t = B_MEDIA_ERROR_BASE + 103;
+pub const B_MEDIA_BAD_BUFFER: status_t = B_MEDIA_ERROR_BASE + 104;
+pub const B_MEDIA_TOO_MANY_NODES: status_t = B_MEDIA_ERROR_BASE + 105;
+pub const B_MEDIA_TOO_MANY_BUFFERS: status_t = B_MEDIA_ERROR_BASE + 106;
+pub const B_MEDIA_NODE_ALREADY_EXISTS: status_t = B_MEDIA_ERROR_BASE + 107;
+pub const B_MEDIA_BUFFER_ALREADY_EXISTS: status_t = B_MEDIA_ERROR_BASE + 108;
+pub const B_MEDIA_CANNOT_SEEK: status_t = B_MEDIA_ERROR_BASE + 109;
+pub const B_MEDIA_CANNOT_CHANGE_RUN_MODE: status_t = B_MEDIA_ERROR_BASE + 110;
+pub const B_MEDIA_APP_ALREADY_REGISTERED: status_t = B_MEDIA_ERROR_BASE + 111;
+pub const B_MEDIA_APP_NOT_REGISTERED: status_t = B_MEDIA_ERROR_BASE + 112;
+pub const B_MEDIA_CANNOT_RECLAIM_BUFFERS: status_t = B_MEDIA_ERROR_BASE + 113;
+pub const B_MEDIA_BUFFERS_NOT_RECLAIMED: status_t = B_MEDIA_ERROR_BASE + 114;
+pub const B_MEDIA_TIME_SOURCE_STOPPED: status_t = B_MEDIA_ERROR_BASE + 115;
+pub const B_MEDIA_TIME_SOURCE_BUSY: status_t = B_MEDIA_ERROR_BASE + 116;
+pub const B_MEDIA_BAD_SOURCE: status_t = B_MEDIA_ERROR_BASE + 117;
+pub const B_MEDIA_BAD_DESTINATION: status_t = B_MEDIA_ERROR_BASE + 118;
+pub const B_MEDIA_ALREADY_CONNECTED: status_t = B_MEDIA_ERROR_BASE + 119;
+pub const B_MEDIA_NOT_CONNECTED: status_t = B_MEDIA_ERROR_BASE + 120;
+pub const B_MEDIA_BAD_CLIP_FORMAT: status_t = B_MEDIA_ERROR_BASE + 121;
+pub const B_MEDIA_ADDON_FAILED: status_t = B_MEDIA_ERROR_BASE + 122;
+pub const B_MEDIA_ADDON_DISABLED: status_t = B_MEDIA_ERROR_BASE + 123;
+pub const B_MEDIA_CHANGE_IN_PROGRESS: status_t = B_MEDIA_ERROR_BASE + 124;
+pub const B_MEDIA_STALE_CHANGE_COUNT: status_t = B_MEDIA_ERROR_BASE + 125;
+pub const B_MEDIA_ADDON_RESTRICTED: status_t = B_MEDIA_ERROR_BASE + 126;
+pub const B_MEDIA_NO_HANDLER: status_t = B_MEDIA_ERROR_BASE + 127;
+pub const B_MEDIA_DUPLICATE_FORMAT: status_t = B_MEDIA_ERROR_BASE + 128;
+pub const B_MEDIA_REALTIME_DISABLED: status_t = B_MEDIA_ERROR_BASE + 129;
+pub const B_MEDIA_REALTIME_UNAVAILABLE: status_t = B_MEDIA_ERROR_BASE + 130;
+
+// Mail kit errors
+pub const B_MAIL_NO_DAEMON: status_t = B_MAIL_ERROR_BASE + 0;
+pub const B_MAIL_UNKNOWN_USER: status_t = B_MAIL_ERROR_BASE + 1;
+pub const B_MAIL_WRONG_PASSWORD: status_t = B_MAIL_ERROR_BASE + 2;
+pub const B_MAIL_UNKNOWN_HOST: status_t = B_MAIL_ERROR_BASE + 3;
+pub const B_MAIL_ACCESS_ERROR: status_t = B_MAIL_ERROR_BASE + 4;
+pub const B_MAIL_UNKNOWN_FIELD: status_t = B_MAIL_ERROR_BASE + 5;
+pub const B_MAIL_NO_RECIPIENT: status_t = B_MAIL_ERROR_BASE + 6;
+pub const B_MAIL_INVALID_MAIL: status_t = B_MAIL_ERROR_BASE + 7;
+
+// Print kit errors
+pub const B_NO_PRINT_SERVER: status_t = B_PRINT_ERROR_BASE + 0;
+
+// Device kit errors
+pub const B_DEV_INVALID_IOCTL: status_t = B_DEVICE_ERROR_BASE + 0;
+pub const B_DEV_NO_MEMORY: status_t = B_DEVICE_ERROR_BASE + 1;
+pub const B_DEV_BAD_DRIVE_NUM: status_t = B_DEVICE_ERROR_BASE + 2;
+pub const B_DEV_NO_MEDIA: status_t = B_DEVICE_ERROR_BASE + 3;
+pub const B_DEV_UNREADABLE: status_t = B_DEVICE_ERROR_BASE + 4;
+pub const B_DEV_FORMAT_ERROR: status_t = B_DEVICE_ERROR_BASE + 5;
+pub const B_DEV_TIMEOUT: status_t = B_DEVICE_ERROR_BASE + 6;
+pub const B_DEV_RECALIBRATE_ERROR: status_t = B_DEVICE_ERROR_BASE + 7;
+pub const B_DEV_SEEK_ERROR: status_t = B_DEVICE_ERROR_BASE + 8;
+pub const B_DEV_ID_ERROR: status_t = B_DEVICE_ERROR_BASE + 9;
+pub const B_DEV_READ_ERROR: status_t = B_DEVICE_ERROR_BASE + 10;
+pub const B_DEV_WRITE_ERROR: status_t = B_DEVICE_ERROR_BASE + 11;
+pub const B_DEV_NOT_READY: status_t = B_DEVICE_ERROR_BASE + 12;
+pub const B_DEV_MEDIA_CHANGED: status_t = B_DEVICE_ERROR_BASE + 13;
+pub const B_DEV_MEDIA_CHANGE_REQUESTED: status_t = B_DEVICE_ERROR_BASE + 14;
+pub const B_DEV_RESOURCE_CONFLICT: status_t = B_DEVICE_ERROR_BASE + 15;
+pub const B_DEV_CONFIGURATION_ERROR: status_t = B_DEVICE_ERROR_BASE + 16;
+pub const B_DEV_DISABLED_BY_USER: status_t = B_DEVICE_ERROR_BASE + 17;
+pub const B_DEV_DOOR_OPEN: status_t = B_DEVICE_ERROR_BASE + 18;
+
+pub const B_DEV_INVALID_PIPE: status_t = B_DEVICE_ERROR_BASE + 19;
+pub const B_DEV_CRC_ERROR: status_t = B_DEVICE_ERROR_BASE + 20;
+pub const B_DEV_STALLED: status_t = B_DEVICE_ERROR_BASE + 21;
+pub const B_DEV_BAD_PID: status_t = B_DEVICE_ERROR_BASE + 22;
+pub const B_DEV_UNEXPECTED_PID: status_t = B_DEVICE_ERROR_BASE + 23;
+pub const B_DEV_DATA_OVERRUN: status_t = B_DEVICE_ERROR_BASE + 24;
+pub const B_DEV_DATA_UNDERRUN: status_t = B_DEVICE_ERROR_BASE + 25;
+pub const B_DEV_FIFO_OVERRUN: status_t = B_DEVICE_ERROR_BASE + 26;
+pub const B_DEV_FIFO_UNDERRUN: status_t = B_DEVICE_ERROR_BASE + 27;
+pub const B_DEV_PENDING: status_t = B_DEVICE_ERROR_BASE + 28;
+pub const B_DEV_MULTIPLE_ERRORS: status_t = B_DEVICE_ERROR_BASE + 29;
+pub const B_DEV_TOO_LATE: status_t = B_DEVICE_ERROR_BASE + 30;
+
+// translation kit errors
+pub const B_TRANSLATION_BASE_ERROR: status_t = B_TRANSLATION_ERROR_BASE + 0;
+pub const B_NO_TRANSLATOR: status_t = B_TRANSLATION_ERROR_BASE + 1;
+pub const B_ILLEGAL_DATA: status_t = B_TRANSLATION_ERROR_BASE + 2;
+
+// support/TypeConstants.h
+pub const B_AFFINE_TRANSFORM_TYPE: u32 = haiku_constant!('A', 'M', 'T', 'X');
+pub const B_ALIGNMENT_TYPE: u32 = haiku_constant!('A', 'L', 'G', 'N');
+pub const B_ANY_TYPE: u32 = haiku_constant!('A', 'N', 'Y', 'T');
+pub const B_ATOM_TYPE: u32 = haiku_constant!('A', 'T', 'O', 'M');
+pub const B_ATOMREF_TYPE: u32 = haiku_constant!('A', 'T', 'M', 'R');
+pub const B_BOOL_TYPE: u32 = haiku_constant!('B', 'O', 'O', 'L');
+pub const B_CHAR_TYPE: u32 = haiku_constant!('C', 'H', 'A', 'R');
+pub const B_COLOR_8_BIT_TYPE: u32 = haiku_constant!('C', 'L', 'R', 'B');
+pub const B_DOUBLE_TYPE: u32 = haiku_constant!('D', 'B', 'L', 'E');
+pub const B_FLOAT_TYPE: u32 = haiku_constant!('F', 'L', 'O', 'T');
+pub const B_GRAYSCALE_8_BIT_TYPE: u32 = haiku_constant!('G', 'R', 'Y', 'B');
+pub const B_INT16_TYPE: u32 = haiku_constant!('S', 'H', 'R', 'T');
+pub const B_INT32_TYPE: u32 = haiku_constant!('L', 'O', 'N', 'G');
+pub const B_INT64_TYPE: u32 = haiku_constant!('L', 'L', 'N', 'G');
+pub const B_INT8_TYPE: u32 = haiku_constant!('B', 'Y', 'T', 'E');
+pub const B_LARGE_ICON_TYPE: u32 = haiku_constant!('I', 'C', 'O', 'N');
+pub const B_MEDIA_PARAMETER_GROUP_TYPE: u32 = haiku_constant!('B', 'M', 'C', 'G');
+pub const B_MEDIA_PARAMETER_TYPE: u32 = haiku_constant!('B', 'M', 'C', 'T');
+pub const B_MEDIA_PARAMETER_WEB_TYPE: u32 = haiku_constant!('B', 'M', 'C', 'W');
+pub const B_MESSAGE_TYPE: u32 = haiku_constant!('M', 'S', 'G', 'G');
+pub const B_MESSENGER_TYPE: u32 = haiku_constant!('M', 'S', 'N', 'G');
+pub const B_MIME_TYPE: u32 = haiku_constant!('M', 'I', 'M', 'E');
+pub const B_MINI_ICON_TYPE: u32 = haiku_constant!('M', 'I', 'C', 'N');
+pub const B_MONOCHROME_1_BIT_TYPE: u32 = haiku_constant!('M', 'N', 'O', 'B');
+pub const B_OBJECT_TYPE: u32 = haiku_constant!('O', 'P', 'T', 'R');
+pub const B_OFF_T_TYPE: u32 = haiku_constant!('O', 'F', 'F', 'T');
+pub const B_PATTERN_TYPE: u32 = haiku_constant!('P', 'A', 'T', 'N');
+pub const B_POINTER_TYPE: u32 = haiku_constant!('P', 'N', 'T', 'R');
+pub const B_POINT_TYPE: u32 = haiku_constant!('B', 'P', 'N', 'T');
+pub const B_PROPERTY_INFO_TYPE: u32 = haiku_constant!('S', 'C', 'T', 'D');
+pub const B_RAW_TYPE: u32 = haiku_constant!('R', 'A', 'W', 'T');
+pub const B_RECT_TYPE: u32 = haiku_constant!('R', 'E', 'C', 'T');
+pub const B_REF_TYPE: u32 = haiku_constant!('R', 'R', 'E', 'F');
+pub const B_RGB_32_BIT_TYPE: u32 = haiku_constant!('R', 'G', 'B', 'B');
+pub const B_RGB_COLOR_TYPE: u32 = haiku_constant!('R', 'G', 'B', 'C');
+pub const B_SIZE_TYPE: u32 = haiku_constant!('S', 'I', 'Z', 'E');
+pub const B_SIZE_T_TYPE: u32 = haiku_constant!('S', 'I', 'Z', 'T');
+pub const B_SSIZE_T_TYPE: u32 = haiku_constant!('S', 'S', 'Z', 'T');
+pub const B_STRING_TYPE: u32 = haiku_constant!('C', 'S', 'T', 'R');
+pub const B_STRING_LIST_TYPE: u32 = haiku_constant!('S', 'T', 'R', 'L');
+pub const B_TIME_TYPE: u32 = haiku_constant!('T', 'I', 'M', 'E');
+pub const B_UINT16_TYPE: u32 = haiku_constant!('U', 'S', 'H', 'T');
+pub const B_UINT32_TYPE: u32 = haiku_constant!('U', 'L', 'N', 'G');
+pub const B_UINT64_TYPE: u32 = haiku_constant!('U', 'L', 'L', 'G');
+pub const B_UINT8_TYPE: u32 = haiku_constant!('U', 'B', 'Y', 'T');
+pub const B_VECTOR_ICON_TYPE: u32 = haiku_constant!('V', 'I', 'C', 'N');
+pub const B_XATTR_TYPE: u32 = haiku_constant!('X', 'A', 'T', 'R');
+pub const B_NETWORK_ADDRESS_TYPE: u32 = haiku_constant!('N', 'W', 'A', 'D');
+pub const B_MIME_STRING_TYPE: u32 = haiku_constant!('M', 'I', 'M', 'S');
+pub const B_ASCII_TYPE: u32 = haiku_constant!('T', 'E', 'X', 'T');
+
+extern "C" {
+    // kernel/OS.h
+    pub fn create_area(
+        name: *const ::c_char,
+        startAddress: *mut *mut ::c_void,
+        addressSpec: u32,
+        size: usize,
+        lock: u32,
+        protection: u32,
+    ) -> area_id;
+    pub fn clone_area(
+        name: *const ::c_char,
+        destAddress: *mut *mut ::c_void,
+        addressSpec: u32,
+        protection: u32,
+        source: area_id,
+    ) -> area_id;
+    pub fn find_area(name: *const ::c_char) -> area_id;
+    pub fn area_for(address: *mut ::c_void) -> area_id;
+    pub fn delete_area(id: area_id) -> status_t;
+    pub fn resize_area(id: area_id, newSize: usize) -> status_t;
+    pub fn set_area_protection(id: area_id, newProtection: u32) -> status_t;
+    pub fn _get_area_info(id: area_id, areaInfo: *mut area_info, size: usize) -> status_t;
+    pub fn _get_next_area_info(
+        team: team_id,
+        cookie: *mut isize,
+        areaInfo: *mut area_info,
+        size: usize,
+    ) -> status_t;
+
+    pub fn create_port(capacity: i32, name: *const ::c_char) -> port_id;
+    pub fn find_port(name: *const ::c_char) -> port_id;
+    pub fn read_port(
+        port: port_id,
+        code: *mut i32,
+        buffer: *mut ::c_void,
+        bufferSize: ::size_t,
+    ) -> ::ssize_t;
+    pub fn read_port_etc(
+        port: port_id,
+        code: *mut i32,
+        buffer: *mut ::c_void,
+        bufferSize: ::size_t,
+        flags: u32,
+        timeout: bigtime_t,
+    ) -> ::ssize_t;
+    pub fn write_port(
+        port: port_id,
+        code: i32,
+        buffer: *const ::c_void,
+        bufferSize: ::size_t,
+    ) -> status_t;
+    pub fn write_port_etc(
+        port: port_id,
+        code: i32,
+        buffer: *const ::c_void,
+        bufferSize: ::size_t,
+        flags: u32,
+        timeout: bigtime_t,
+    ) -> status_t;
+    pub fn close_port(port: port_id) -> status_t;
+    pub fn delete_port(port: port_id) -> status_t;
+    pub fn port_buffer_size(port: port_id) -> ::ssize_t;
+    pub fn port_buffer_size_etc(port: port_id, flags: u32, timeout: bigtime_t) -> ::ssize_t;
+    pub fn port_count(port: port_id) -> ::ssize_t;
+    pub fn set_port_owner(port: port_id, team: team_id) -> status_t;
+
+    pub fn _get_port_info(port: port_id, buf: *mut port_info, portInfoSize: ::size_t) -> status_t;
+    pub fn _get_next_port_info(
+        port: port_id,
+        cookie: *mut i32,
+        portInfo: *mut port_info,
+        portInfoSize: ::size_t,
+    ) -> status_t;
+    pub fn _get_port_message_info_etc(
+        port: port_id,
+        info: *mut port_message_info,
+        infoSize: ::size_t,
+        flags: u32,
+        timeout: bigtime_t,
+    ) -> status_t;
+
+    pub fn create_sem(count: i32, name: *const ::c_char) -> sem_id;
+    pub fn delete_sem(id: sem_id) -> status_t;
+    pub fn acquire_sem(id: sem_id) -> status_t;
+    pub fn acquire_sem_etc(id: sem_id, count: i32, flags: u32, timeout: bigtime_t) -> status_t;
+    pub fn release_sem(id: sem_id) -> status_t;
+    pub fn release_sem_etc(id: sem_id, count: i32, flags: u32) -> status_t;
+    pub fn switch_sem(semToBeReleased: sem_id, id: sem_id) -> status_t;
+    pub fn switch_sem_etc(
+        semToBeReleased: sem_id,
+        id: sem_id,
+        count: i32,
+        flags: u32,
+        timeout: bigtime_t,
+    ) -> status_t;
+    pub fn get_sem_count(id: sem_id, threadCount: *mut i32) -> status_t;
+    pub fn set_sem_owner(id: sem_id, team: team_id) -> status_t;
+    pub fn _get_sem_info(id: sem_id, info: *mut sem_info, infoSize: ::size_t) -> status_t;
+    pub fn _get_next_sem_info(
+        team: team_id,
+        cookie: *mut i32,
+        info: *mut sem_info,
+        infoSize: ::size_t,
+    ) -> status_t;
+
+    pub fn kill_team(team: team_id) -> status_t;
+    pub fn _get_team_info(team: team_id, info: *mut team_info, size: ::size_t) -> status_t;
+    pub fn _get_next_team_info(cookie: *mut i32, info: *mut team_info, size: ::size_t) -> status_t;
+
+    pub fn spawn_thread(
+        func: thread_func,
+        name: *const ::c_char,
+        priority: i32,
+        data: *mut ::c_void,
+    ) -> thread_id;
+    pub fn kill_thread(thread: thread_id) -> status_t;
+    pub fn resume_thread(thread: thread_id) -> status_t;
+    pub fn suspend_thread(thread: thread_id) -> status_t;
+
+    pub fn rename_thread(thread: thread_id, newName: *const ::c_char) -> status_t;
+    pub fn set_thread_priority(thread: thread_id, newPriority: i32) -> status_t;
+    pub fn suggest_thread_priority(
+        what: u32,
+        period: i32,
+        jitter: ::bigtime_t,
+        length: ::bigtime_t,
+    ) -> i32;
+    pub fn estimate_max_scheduling_latency(th: ::thread_id) -> ::bigtime_t;
+    pub fn exit_thread(status: status_t);
+    pub fn wait_for_thread(thread: thread_id, returnValue: *mut status_t) -> status_t;
+    pub fn on_exit_thread(callback: extern "C" fn(*mut ::c_void), data: *mut ::c_void) -> status_t;
+
+    pub fn find_thread(name: *const ::c_char) -> thread_id;
+
+    pub fn get_scheduler_mode() -> i32;
+    pub fn set_scheduler_mode(mode: i32) -> status_t;
+
+    pub fn send_data(
+        thread: thread_id,
+        code: i32,
+        buffer: *const ::c_void,
+        bufferSize: ::size_t,
+    ) -> status_t;
+    pub fn receive_data(sender: *mut thread_id, buffer: *mut ::c_void, bufferSize: ::size_t)
+        -> i32;
+    pub fn has_data(thread: thread_id) -> bool;
+
+    pub fn snooze(amount: bigtime_t) -> status_t;
+    pub fn snooze_etc(amount: bigtime_t, timeBase: ::c_int, flags: u32) -> status_t;
+    pub fn snooze_until(time: bigtime_t, timeBase: ::c_int) -> status_t;
+
+    pub fn _get_thread_info(id: thread_id, info: *mut thread_info, size: ::size_t) -> status_t;
+    pub fn _get_next_thread_info(
+        team: team_id,
+        cookie: *mut i32,
+        info: *mut thread_info,
+        size: ::size_t,
+    ) -> status_t;
+
+    pub fn get_pthread_thread_id(thread: ::pthread_t) -> thread_id;
+
+    pub fn _get_team_usage_info(
+        team: team_id,
+        who: i32,
+        info: *mut team_usage_info,
+        size: ::size_t,
+    ) -> status_t;
+
+    pub fn real_time_clock() -> ::c_ulong;
+    pub fn set_real_time_clock(secsSinceJan1st1970: ::c_ulong);
+    pub fn real_time_clock_usecs() -> bigtime_t;
+    pub fn system_time() -> bigtime_t;
+    pub fn system_time_nsecs() -> nanotime_t;
+    // set_timezone() is deprecated and a no-op
+
+    pub fn set_alarm(when: bigtime_t, flags: u32) -> bigtime_t;
+    pub fn debugger(message: *const ::c_char);
+    pub fn disable_debugger(state: ::c_int) -> ::c_int;
+
+    pub fn get_system_info(info: *mut system_info) -> status_t;
+    pub fn _get_cpu_info_etc(
+        firstCPU: u32,
+        cpuCount: u32,
+        info: *mut cpu_info,
+        size: ::size_t,
+    ) -> status_t;
+    pub fn get_cpu_topology_info(
+        topologyInfos: *mut cpu_topology_node_info,
+        topologyInfoCount: *mut u32,
+    ) -> status_t;
+    pub fn is_computer_on() -> i32;
+    pub fn is_computer_on_fire() -> ::c_double;
+    pub fn send_signal(threadID: thread_id, signal: ::c_uint) -> ::c_int;
+    pub fn set_signal_stack(base: *mut ::c_void, size: ::size_t);
+
+    pub fn wait_for_objects(infos: *mut object_wait_info, numInfos: ::c_int) -> ::ssize_t;
+    pub fn wait_for_objects_etc(
+        infos: *mut object_wait_info,
+        numInfos: ::c_int,
+        flags: u32,
+        timeout: bigtime_t,
+    ) -> ::ssize_t;
+
+    // kernel/fs_attr.h
+    pub fn fs_read_attr(
+        fd: ::c_int,
+        attribute: *const ::c_char,
+        type_: u32,
+        pos: ::off_t,
+        buffer: *mut ::c_void,
+        readBytes: ::size_t,
+    ) -> ::ssize_t;
+    pub fn fs_write_attr(
+        fd: ::c_int,
+        attribute: *const ::c_char,
+        type_: u32,
+        pos: ::off_t,
+        buffer: *const ::c_void,
+        writeBytes: ::size_t,
+    ) -> ::ssize_t;
+    pub fn fs_remove_attr(fd: ::c_int, attribute: *const ::c_char) -> ::c_int;
+    pub fn fs_stat_attr(
+        fd: ::c_int,
+        attribute: *const ::c_char,
+        attrInfo: *mut attr_info,
+    ) -> ::c_int;
+
+    pub fn fs_open_attr(
+        path: *const ::c_char,
+        attribute: *const ::c_char,
+        type_: u32,
+        openMode: ::c_int,
+    ) -> ::c_int;
+    pub fn fs_fopen_attr(
+        fd: ::c_int,
+        attribute: *const ::c_char,
+        type_: u32,
+        openMode: ::c_int,
+    ) -> ::c_int;
+    pub fn fs_close_attr(fd: ::c_int) -> ::c_int;
+
+    pub fn fs_open_attr_dir(path: *const ::c_char) -> *mut ::DIR;
+    pub fn fs_lopen_attr_dir(path: *const ::c_char) -> *mut ::DIR;
+    pub fn fs_fopen_attr_dir(fd: ::c_int) -> *mut ::DIR;
+    pub fn fs_close_attr_dir(dir: *mut ::DIR) -> ::c_int;
+    pub fn fs_read_attr_dir(dir: *mut ::DIR) -> *mut ::dirent;
+    pub fn fs_rewind_attr_dir(dir: *mut ::DIR);
+
+    // kernel/fs_image.h
+    pub fn fs_create_index(
+        device: ::dev_t,
+        name: *const ::c_char,
+        type_: u32,
+        flags: u32,
+    ) -> ::c_int;
+    pub fn fs_remove_index(device: ::dev_t, name: *const ::c_char) -> ::c_int;
+    pub fn fs_stat_index(
+        device: ::dev_t,
+        name: *const ::c_char,
+        indexInfo: *mut index_info,
+    ) -> ::c_int;
+
+    pub fn fs_open_index_dir(device: ::dev_t) -> *mut ::DIR;
+    pub fn fs_close_index_dir(indexDirectory: *mut ::DIR) -> ::c_int;
+    pub fn fs_read_index_dir(indexDirectory: *mut ::DIR) -> *mut ::dirent;
+    pub fn fs_rewind_index_dir(indexDirectory: *mut ::DIR);
+
+    // kernel/fs_info.h
+    pub fn dev_for_path(path: *const ::c_char) -> ::dev_t;
+    pub fn next_dev(pos: *mut i32) -> ::dev_t;
+    pub fn fs_stat_dev(dev: ::dev_t, info: *mut fs_info) -> ::c_int;
+
+    // kernel/fs_query.h
+    pub fn fs_open_query(device: ::dev_t, query: *const ::c_char, flags: u32) -> *mut ::DIR;
+    pub fn fs_open_live_query(
+        device: ::dev_t,
+        query: *const ::c_char,
+        flags: u32,
+        port: port_id,
+        token: i32,
+    ) -> *mut ::DIR;
+    pub fn fs_close_query(d: *mut ::DIR) -> ::c_int;
+    pub fn fs_read_query(d: *mut ::DIR) -> *mut ::dirent;
+    pub fn get_path_for_dirent(dent: *mut ::dirent, buf: *mut ::c_char, len: ::size_t) -> status_t;
+
+    // kernel/fs_volume.h
+    pub fn fs_mount_volume(
+        where_: *const ::c_char,
+        device: *const ::c_char,
+        filesystem: *const ::c_char,
+        flags: u32,
+        parameters: *const ::c_char,
+    ) -> ::dev_t;
+    pub fn fs_unmount_volume(path: *const ::c_char, flags: u32) -> status_t;
+
+    // kernel/image.h
+    pub fn load_image(
+        argc: i32,
+        argv: *mut *const ::c_char,
+        environ: *mut *const ::c_char,
+    ) -> thread_id;
+    pub fn load_add_on(path: *const ::c_char) -> image_id;
+    pub fn unload_add_on(image: image_id) -> status_t;
+    pub fn get_image_symbol(
+        image: image_id,
+        name: *const ::c_char,
+        symbolType: i32,
+        symbolLocation: *mut *mut ::c_void,
+    ) -> status_t;
+    pub fn get_nth_image_symbol(
+        image: image_id,
+        n: i32,
+        nameBuffer: *mut ::c_char,
+        nameLength: *mut i32,
+        symbolType: *mut i32,
+        symbolLocation: *mut *mut ::c_void,
+    ) -> status_t;
+    pub fn clear_caches(address: *mut ::c_void, length: ::size_t, flags: u32);
+    pub fn _get_image_info(image: image_id, info: *mut image_info, size: ::size_t) -> status_t;
+    pub fn _get_next_image_info(
+        team: team_id,
+        cookie: *mut i32,
+        info: *mut image_info,
+        size: ::size_t,
+    ) -> status_t;
+    pub fn find_path(
+        codePointer: *const ::c_void,
+        baseDirectory: path_base_directory,
+        subPath: *const ::c_char,
+        pathBuffer: *mut ::c_char,
+        bufferSize: usize,
+    ) -> status_t;
+    pub fn find_path_etc(
+        codePointer: *const ::c_void,
+        dependency: *const ::c_char,
+        architecture: *const ::c_char,
+        baseDirectory: path_base_directory,
+        subPath: *const ::c_char,
+        flags: u32,
+        pathBuffer: *mut ::c_char,
+        bufferSize: ::size_t,
+    ) -> status_t;
+    pub fn find_path_for_path(
+        path: *const ::c_char,
+        baseDirectory: path_base_directory,
+        subPath: *const ::c_char,
+        pathBuffer: *mut ::c_char,
+        bufferSize: ::size_t,
+    ) -> status_t;
+    pub fn find_path_for_path_etc(
+        path: *const ::c_char,
+        dependency: *const ::c_char,
+        architectur: *const ::c_char,
+        baseDirectory: path_base_directory,
+        subPath: *const ::c_char,
+        flags: u32,
+        pathBuffer: *mut ::c_char,
+        bufferSize: ::size_t,
+    ) -> status_t;
+    pub fn find_paths(
+        baseDirectory: path_base_directory,
+        subPath: *const ::c_char,
+        _paths: *mut *mut *mut ::c_char,
+        pathCount: *mut ::size_t,
+    ) -> status_t;
+    pub fn find_paths_etc(
+        architecture: *const ::c_char,
+        baseDirectory: path_base_directory,
+        subPath: *const ::c_char,
+        flags: u32,
+        _paths: *mut *mut *mut ::c_char,
+        pathCount: *mut ::size_t,
+    ) -> status_t;
+    pub fn find_directory(
+        which: directory_which,
+        volume: ::dev_t,
+        createIt: bool,
+        pathString: *mut ::c_char,
+        length: i32,
+    ) -> status_t;
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        extern "C" {
+            pub fn get_cpuid(info: *mut cpuid_info, eaxRegister: u32, cpuNum: u32) -> status_t;
+        }
+    }
+}
+
+// The following functions are defined as macros in C/C++
+#[inline]
+pub unsafe fn get_cpu_info(firstCPU: u32, cpuCount: u32, info: *mut cpu_info) -> status_t {
+    _get_cpu_info_etc(
+        firstCPU,
+        cpuCount,
+        info,
+        core::mem::size_of::<cpu_info>() as ::size_t,
+    )
+}
+
+#[inline]
+pub unsafe fn get_area_info(id: area_id, info: *mut area_info) -> status_t {
+    _get_area_info(id, info, core::mem::size_of::<area_info>() as usize)
+}
+
+#[inline]
+pub unsafe fn get_next_area_info(
+    team: team_id,
+    cookie: *mut isize,
+    info: *mut area_info,
+) -> status_t {
+    _get_next_area_info(
+        team,
+        cookie,
+        info,
+        core::mem::size_of::<area_info>() as usize,
+    )
+}
+
+#[inline]
+pub unsafe fn get_port_info(port: port_id, buf: *mut port_info) -> status_t {
+    _get_port_info(port, buf, core::mem::size_of::<port_info>() as ::size_t)
+}
+
+#[inline]
+pub unsafe fn get_next_port_info(
+    port: port_id,
+    cookie: *mut i32,
+    portInfo: *mut port_info,
+) -> status_t {
+    _get_next_port_info(
+        port,
+        cookie,
+        portInfo,
+        core::mem::size_of::<port_info>() as ::size_t,
+    )
+}
+
+#[inline]
+pub unsafe fn get_port_message_info_etc(
+    port: port_id,
+    info: *mut port_message_info,
+    flags: u32,
+    timeout: bigtime_t,
+) -> status_t {
+    _get_port_message_info_etc(
+        port,
+        info,
+        core::mem::size_of::<port_message_info>() as ::size_t,
+        flags,
+        timeout,
+    )
+}
+
+#[inline]
+pub unsafe fn get_sem_info(id: sem_id, info: *mut sem_info) -> status_t {
+    _get_sem_info(id, info, core::mem::size_of::<sem_info>() as ::size_t)
+}
+
+#[inline]
+pub unsafe fn get_next_sem_info(team: team_id, cookie: *mut i32, info: *mut sem_info) -> status_t {
+    _get_next_sem_info(
+        team,
+        cookie,
+        info,
+        core::mem::size_of::<sem_info>() as ::size_t,
+    )
+}
+
+#[inline]
+pub unsafe fn get_team_info(team: team_id, info: *mut team_info) -> status_t {
+    _get_team_info(team, info, core::mem::size_of::<team_info>() as ::size_t)
+}
+
+#[inline]
+pub unsafe fn get_next_team_info(cookie: *mut i32, info: *mut team_info) -> status_t {
+    _get_next_team_info(cookie, info, core::mem::size_of::<team_info>() as ::size_t)
+}
+
+#[inline]
+pub unsafe fn get_team_usage_info(team: team_id, who: i32, info: *mut team_usage_info) -> status_t {
+    _get_team_usage_info(
+        team,
+        who,
+        info,
+        core::mem::size_of::<team_usage_info>() as ::size_t,
+    )
+}
+
+#[inline]
+pub unsafe fn get_thread_info(id: thread_id, info: *mut thread_info) -> status_t {
+    _get_thread_info(id, info, core::mem::size_of::<thread_info>() as ::size_t)
+}
+
+#[inline]
+pub unsafe fn get_next_thread_info(
+    team: team_id,
+    cookie: *mut i32,
+    info: *mut thread_info,
+) -> status_t {
+    _get_next_thread_info(
+        team,
+        cookie,
+        info,
+        core::mem::size_of::<thread_info>() as ::size_t,
+    )
+}
+
+// kernel/image.h
+#[inline]
+pub unsafe fn get_image_info(image: image_id, info: *mut image_info) -> status_t {
+    _get_image_info(image, info, core::mem::size_of::<image_info>() as ::size_t)
+}
+
+#[inline]
+pub unsafe fn get_next_image_info(
+    team: team_id,
+    cookie: *mut i32,
+    info: *mut image_info,
+) -> status_t {
+    _get_next_image_info(
+        team,
+        cookie,
+        info,
+        core::mem::size_of::<image_info>() as ::size_t,
+    )
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/haiku/x86_64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/haiku/x86_64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/haiku/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/haiku/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,264 @@
+s_no_extra_traits! {
+    pub struct fpu_state {
+        pub control: ::c_ushort,
+        pub status: ::c_ushort,
+        pub tag: ::c_ushort,
+        pub opcode: ::c_ushort,
+        pub rip: ::c_ulong,
+        pub rdp: ::c_ulong,
+        pub mxcsr: ::c_uint,
+        pub mscsr_mask: ::c_uint,
+        pub _fpreg: [[::c_uchar; 8]; 16],
+        pub _xmm: [[::c_uchar; 16]; 16],
+        pub _reserved_416_511: [::c_uchar; 96],
+    }
+
+    pub struct xstate_hdr {
+        pub bv: ::c_ulong,
+        pub xcomp_bv: ::c_ulong,
+        pub _reserved: [::c_uchar; 48],
+    }
+
+    pub struct savefpu {
+        pub fp_fxsave: fpu_state,
+        pub fp_xstate: xstate_hdr,
+        pub _fp_ymm: [[::c_uchar; 16]; 16],
+    }
+
+    pub struct mcontext_t {
+        pub rax: ::c_ulong,
+        pub rbx: ::c_ulong,
+        pub rcx: ::c_ulong,
+        pub rdx: ::c_ulong,
+        pub rdi: ::c_ulong,
+        pub rsi: ::c_ulong,
+        pub rbp: ::c_ulong,
+        pub r8: ::c_ulong,
+        pub r9: ::c_ulong,
+        pub r10: ::c_ulong,
+        pub r11: ::c_ulong,
+        pub r12: ::c_ulong,
+        pub r13: ::c_ulong,
+        pub r14: ::c_ulong,
+        pub r15: ::c_ulong,
+        pub rsp: ::c_ulong,
+        pub rip: ::c_ulong,
+        pub rflags: ::c_ulong,
+        pub fpu: savefpu,
+    }
+
+    pub struct ucontext_t {
+        pub uc_link: *mut ucontext_t,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_stack: ::stack_t,
+        pub uc_mcontext: mcontext_t,
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for fpu_state {
+            fn eq(&self, other: &fpu_state) -> bool {
+                self.control == other.control
+                    && self.status == other.status
+                    && self.tag == other.tag
+                    && self.opcode == other.opcode
+                    && self.rip == other.rip
+                    && self.rdp == other.rdp
+                    && self.mxcsr == other.mxcsr
+                    && self.mscsr_mask == other.mscsr_mask
+                    && self._fpreg.iter().zip(other._fpreg.iter()).all(|(a, b)| a == b)
+                    && self._xmm.iter().zip(other._xmm.iter()).all(|(a, b)| a == b)
+                    && self._reserved_416_511.
+                        iter().
+                        zip(other._reserved_416_511.iter()).
+                        all(|(a, b)| a == b)
+            }
+        }
+        impl Eq for fpu_state {}
+        impl ::fmt::Debug for fpu_state {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("fpu_state")
+                    .field("control", &self.control)
+                    .field("status", &self.status)
+                    .field("tag", &self.tag)
+                    .field("opcode", &self.opcode)
+                    .field("rip", &self.rip)
+                    .field("rdp", &self.rdp)
+                    .field("mxcsr", &self.mxcsr)
+                    .field("mscsr_mask", &self.mscsr_mask)
+                    // FIXME: .field("_fpreg", &self._fpreg)
+                    // FIXME: .field("_xmm", &self._xmm)
+                    // FIXME: .field("_reserved_416_511", &self._reserved_416_511)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for fpu_state {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.control.hash(state);
+                self.status.hash(state);
+                self.tag.hash(state);
+                self.opcode.hash(state);
+                self.rip.hash(state);
+                self.rdp.hash(state);
+                self.mxcsr.hash(state);
+                self.mscsr_mask.hash(state);
+                self._fpreg.hash(state);
+                self._xmm.hash(state);
+                self._reserved_416_511.hash(state);
+            }
+        }
+
+        impl PartialEq for xstate_hdr {
+            fn eq(&self, other: &xstate_hdr) -> bool {
+                self.bv == other.bv
+                    && self.xcomp_bv == other.xcomp_bv
+                    && self._reserved.iter().zip(other._reserved.iter()).all(|(a, b)| a == b)
+            }
+        }
+        impl Eq for xstate_hdr {}
+        impl ::fmt::Debug for xstate_hdr {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("xstate_hdr")
+                    .field("bv", &self.bv)
+                    .field("xcomp_bv", &self.xcomp_bv)
+                    // FIXME: .field("_reserved", &field._reserved)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for xstate_hdr {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.bv.hash(state);
+                self.xcomp_bv.hash(state);
+                self._reserved.hash(state);
+            }
+        }
+
+        impl PartialEq for savefpu {
+            fn eq(&self, other: &savefpu) -> bool {
+                self.fp_fxsave == other.fp_fxsave
+                    && self.fp_xstate == other.fp_xstate
+                    && self._fp_ymm.iter().zip(other._fp_ymm.iter()).all(|(a, b)| a == b)
+            }
+        }
+        impl Eq for savefpu {}
+        impl ::fmt::Debug for savefpu {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("savefpu")
+                    .field("fp_fxsave", &self.fp_fxsave)
+                    .field("fp_xstate", &self.fp_xstate)
+                    // FIXME: .field("_fp_ymm", &field._fp_ymm)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for savefpu {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.fp_fxsave.hash(state);
+                self.fp_xstate.hash(state);
+                self._fp_ymm.hash(state);
+            }
+        }
+
+        impl PartialEq for mcontext_t {
+            fn eq(&self, other: &mcontext_t) -> bool {
+                self.rax == other.rax
+                    && self.rbx == other.rbx
+                    && self.rbx == other.rbx
+                    && self.rcx == other.rcx
+                    && self.rdx == other.rdx
+                    && self.rdi == other.rdi
+                    && self.rsi == other.rsi
+                    && self.r8 == other.r8
+                    && self.r9 == other.r9
+                    && self.r10 == other.r10
+                    && self.r11 == other.r11
+                    && self.r12 == other.r12
+                    && self.r13 == other.r13
+                    && self.r14 == other.r14
+                    && self.r15 == other.r15
+                    && self.rsp == other.rsp
+                    && self.rip == other.rip
+                    && self.rflags == other.rflags
+                    && self.fpu == other.fpu
+            }
+        }
+        impl Eq for mcontext_t {}
+        impl ::fmt::Debug for mcontext_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("mcontext_t")
+                    .field("rax", &self.rax)
+                    .field("rbx", &self.rbx)
+                    .field("rcx", &self.rcx)
+                    .field("rdx", &self.rdx)
+                    .field("rdi", &self.rdi)
+                    .field("rsi", &self.rsi)
+                    .field("rbp", &self.rbp)
+                    .field("r8", &self.r8)
+                    .field("r9", &self.r9)
+                    .field("r10", &self.r10)
+                    .field("r11", &self.r11)
+                    .field("r12", &self.r12)
+                    .field("r13", &self.r13)
+                    .field("r14", &self.r14)
+                    .field("r15", &self.r15)
+                    .field("rsp", &self.rsp)
+                    .field("rip", &self.rip)
+                    .field("rflags", &self.rflags)
+                    .field("fpu", &self.fpu)
+                    .finish()
+
+            }
+        }
+        impl ::hash::Hash for mcontext_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.rax.hash(state);
+                self.rbx.hash(state);
+                self.rcx.hash(state);
+                self.rdx.hash(state);
+                self.rdi.hash(state);
+                self.rsi.hash(state);
+                self.rbp.hash(state);
+                self.r8.hash(state);
+                self.r9.hash(state);
+                self.r10.hash(state);
+                self.r11.hash(state);
+                self.r12.hash(state);
+                self.r13.hash(state);
+                self.r14.hash(state);
+                self.r15.hash(state);
+                self.rsp.hash(state);
+                self.rip.hash(state);
+                self.rflags.hash(state);
+                self.fpu.hash(state);
+            }
+        }
+
+        impl PartialEq for ucontext_t {
+            fn eq(&self, other: &ucontext_t) -> bool {
+                self.uc_link == other.uc_link
+                    && self.uc_sigmask == other.uc_sigmask
+                    && self.uc_stack == other.uc_stack
+                    && self.uc_mcontext == other.uc_mcontext
+            }
+        }
+        impl Eq for ucontext_t {}
+        impl ::fmt::Debug for ucontext_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ucontext_t")
+                    .field("uc_link", &self.uc_link)
+                    .field("uc_sigmask", &self.uc_sigmask)
+                    .field("uc_stack", &self.uc_stack)
+                    .field("uc_mcontext", &self.uc_mcontext)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for ucontext_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.uc_link.hash(state);
+                self.uc_sigmask.hash(state);
+                self.uc_stack.hash(state);
+                self.uc_mcontext.hash(state);
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/hurd/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/hurd/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/hurd/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/hurd/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+// Placeholder file
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/hurd/b32.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/hurd/b32.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/hurd/b32.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/hurd/b32.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,93 @@
+pub type c_long = i32;
+pub type c_ulong = u32;
+
+pub type __int64_t = ::c_longlong;
+pub type __uint64_t = ::c_ulonglong;
+
+pub type int_fast16_t = ::c_int;
+pub type int_fast32_t = ::c_int;
+pub type int_fast64_t = ::c_longlong;
+pub type uint_fast16_t = ::c_uint;
+pub type uint_fast32_t = ::c_uint;
+pub type uint_fast64_t = ::c_ulonglong;
+
+pub type __quad_t = ::c_longlong;
+pub type __u_quad_t = ::c_ulonglong;
+pub type __intmax_t = ::c_longlong;
+pub type __uintmax_t = ::c_ulonglong;
+
+pub type __squad_type = ::__int64_t;
+pub type __uquad_type = ::__uint64_t;
+pub type __sword_type = ::c_int;
+pub type __uword_type = ::c_uint;
+pub type __slong32_type = ::c_long;
+pub type __ulong32_type = ::c_ulong;
+pub type __s64_type = ::__int64_t;
+pub type __u64_type = ::__uint64_t;
+
+pub type __ipc_pid_t = ::c_ushort;
+
+pub type Elf32_Half = u16;
+pub type Elf32_Word = u32;
+pub type Elf32_Off = u32;
+pub type Elf32_Addr = u32;
+pub type Elf32_Section = u16;
+
+pub type Elf_Addr = ::Elf32_Addr;
+pub type Elf_Half = ::Elf32_Half;
+pub type Elf_Ehdr = ::Elf32_Ehdr;
+pub type Elf_Phdr = ::Elf32_Phdr;
+pub type Elf_Shdr = ::Elf32_Shdr;
+pub type Elf_Sym = ::Elf32_Sym;
+
+s! {
+    pub struct Elf32_Ehdr {
+        pub e_ident: [::c_uchar; 16],
+        pub e_type: Elf32_Half,
+        pub e_machine: Elf32_Half,
+        pub e_version: Elf32_Word,
+        pub e_entry: Elf32_Addr,
+        pub e_phoff: Elf32_Off,
+        pub e_shoff: Elf32_Off,
+        pub e_flags: Elf32_Word,
+        pub e_ehsize: Elf32_Half,
+        pub e_phentsize: Elf32_Half,
+        pub e_phnum: Elf32_Half,
+        pub e_shentsize: Elf32_Half,
+        pub e_shnum: Elf32_Half,
+        pub e_shstrndx: Elf32_Half,
+    }
+
+    pub struct Elf32_Shdr {
+        pub sh_name: Elf32_Word,
+        pub sh_type: Elf32_Word,
+        pub sh_flags: Elf32_Word,
+        pub sh_addr: Elf32_Addr,
+        pub sh_offset: Elf32_Off,
+        pub sh_size: Elf32_Word,
+        pub sh_link: Elf32_Word,
+        pub sh_info: Elf32_Word,
+        pub sh_addralign: Elf32_Word,
+        pub sh_entsize: Elf32_Word,
+    }
+
+    pub struct Elf32_Sym {
+        pub st_name: Elf32_Word,
+        pub st_value: Elf32_Addr,
+        pub st_size: Elf32_Word,
+        pub st_info: ::c_uchar,
+        pub st_other: ::c_uchar,
+        pub st_shndx: Elf32_Section,
+    }
+
+    pub struct Elf32_Phdr {
+        pub p_type: ::Elf32_Word,
+        pub p_offset: ::Elf32_Off,
+        pub p_vaddr: ::Elf32_Addr,
+        pub p_paddr: ::Elf32_Addr,
+        pub p_filesz: ::Elf32_Word,
+        pub p_memsz: ::Elf32_Word,
+        pub p_flags: ::Elf32_Word,
+        pub p_align: ::Elf32_Word,
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/hurd/b64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/hurd/b64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/hurd/b64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/hurd/b64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,95 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
+
+pub type __int64_t = ::c_long;
+pub type __uint64_t = ::c_ulong;
+
+pub type int_fast16_t = ::c_long;
+pub type int_fast32_t = ::c_long;
+pub type int_fast64_t = ::c_long;
+pub type uint_fast16_t = ::c_ulong;
+pub type uint_fast32_t = ::c_ulong;
+pub type uint_fast64_t = ::c_ulong;
+
+pub type __quad_t = ::c_long;
+pub type __u_quad_t = ::c_ulong;
+pub type __intmax_t = ::c_long;
+pub type __uintmax_t = ::c_ulong;
+
+pub type __squad_type = ::c_long;
+pub type __uquad_type = ::c_ulong;
+pub type __sword_type = ::c_long;
+pub type __uword_type = ::c_ulong;
+pub type __slong32_type = ::c_int;
+pub type __ulong32_type = ::c_uint;
+pub type __s64_type = ::c_long;
+pub type __u64_type = ::c_ulong;
+
+pub type __ipc_pid_t = ::c_int;
+
+pub type Elf64_Half = u16;
+pub type Elf64_Word = u32;
+pub type Elf64_Off = u64;
+pub type Elf64_Addr = u64;
+pub type Elf64_Xword = u64;
+pub type Elf64_Sxword = i64;
+pub type Elf64_Section = u16;
+
+pub type Elf_Addr = ::Elf64_Addr;
+pub type Elf_Half = ::Elf64_Half;
+pub type Elf_Ehdr = ::Elf64_Ehdr;
+pub type Elf_Phdr = ::Elf64_Phdr;
+pub type Elf_Shdr = ::Elf64_Shdr;
+pub type Elf_Sym = ::Elf64_Sym;
+
+s! {
+    pub struct Elf64_Ehdr {
+        pub e_ident: [::c_uchar; 16],
+        pub e_type: Elf64_Half,
+        pub e_machine: Elf64_Half,
+        pub e_version: Elf64_Word,
+        pub e_entry: Elf64_Addr,
+        pub e_phoff: Elf64_Off,
+        pub e_shoff: Elf64_Off,
+        pub e_flags: Elf64_Word,
+        pub e_ehsize: Elf64_Half,
+        pub e_phentsize: Elf64_Half,
+        pub e_phnum: Elf64_Half,
+        pub e_shentsize: Elf64_Half,
+        pub e_shnum: Elf64_Half,
+        pub e_shstrndx: Elf64_Half,
+    }
+
+    pub struct Elf64_Shdr {
+        pub sh_name: Elf64_Word,
+        pub sh_type: Elf64_Word,
+        pub sh_flags: Elf64_Xword,
+        pub sh_addr: Elf64_Addr,
+        pub sh_offset: Elf64_Off,
+        pub sh_size: Elf64_Xword,
+        pub sh_link: Elf64_Word,
+        pub sh_info: Elf64_Word,
+        pub sh_addralign: Elf64_Xword,
+        pub sh_entsize: Elf64_Xword,
+    }
+
+    pub struct Elf64_Sym {
+        pub st_name: Elf64_Word,
+        pub st_info: ::c_uchar,
+        pub st_other: ::c_uchar,
+        pub st_shndx: Elf64_Section,
+        pub st_value: Elf64_Addr,
+        pub st_size: Elf64_Xword,
+    }
+
+    pub struct Elf64_Phdr {
+        pub p_type: ::Elf64_Word,
+        pub p_flags: ::Elf64_Word,
+        pub p_offset: ::Elf64_Off,
+        pub p_vaddr: ::Elf64_Addr,
+        pub p_paddr: ::Elf64_Addr,
+        pub p_filesz: ::Elf64_Xword,
+        pub p_memsz: ::Elf64_Xword,
+        pub p_align: ::Elf64_Xword,
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/hurd/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/hurd/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/hurd/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/hurd/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4687 @@
+#![allow(dead_code)]
+
+// types
+pub type c_char = i8;
+
+pub type __s16_type = ::c_short;
+pub type __u16_type = ::c_ushort;
+pub type __s32_type = ::c_int;
+pub type __u32_type = ::c_uint;
+pub type __slongword_type = ::c_long;
+pub type __ulongword_type = ::c_ulong;
+
+pub type __u_char = ::c_uchar;
+pub type __u_short = ::c_ushort;
+pub type __u_int = ::c_uint;
+pub type __u_long = ::c_ulong;
+pub type __int8_t = ::c_schar;
+pub type __uint8_t = ::c_uchar;
+pub type __int16_t = ::c_short;
+pub type __uint16_t = ::c_ushort;
+pub type __int32_t = ::c_int;
+pub type __uint32_t = ::c_uint;
+pub type __int_least8_t = __int8_t;
+pub type __uint_least8_t = __uint8_t;
+pub type __int_least16_t = __int16_t;
+pub type __uint_least16_t = __uint16_t;
+pub type __int_least32_t = __int32_t;
+pub type __uint_least32_t = __uint32_t;
+pub type __int_least64_t = __int64_t;
+pub type __uint_least64_t = __uint64_t;
+
+pub type __dev_t = __uword_type;
+pub type __uid_t = __u32_type;
+pub type __gid_t = __u32_type;
+pub type __ino_t = __ulongword_type;
+pub type __ino64_t = __uquad_type;
+pub type __mode_t = __u32_type;
+pub type __nlink_t = __uword_type;
+pub type __off_t = __slongword_type;
+pub type __off64_t = __squad_type;
+pub type __pid_t = __s32_type;
+pub type __rlim_t = __ulongword_type;
+pub type __rlim64_t = __uquad_type;
+pub type __blkcnt_t = __slongword_type;
+pub type __blkcnt64_t = __squad_type;
+pub type __fsblkcnt_t = __ulongword_type;
+pub type __fsblkcnt64_t = __uquad_type;
+pub type __fsfilcnt_t = __ulongword_type;
+pub type __fsfilcnt64_t = __uquad_type;
+pub type __fsword_t = __sword_type;
+pub type __id_t = __u32_type;
+pub type __clock_t = __slongword_type;
+pub type __time_t = __slongword_type;
+pub type __useconds_t = __u32_type;
+pub type __suseconds_t = __slongword_type;
+pub type __suseconds64_t = __squad_type;
+pub type __daddr_t = __s32_type;
+pub type __key_t = __s32_type;
+pub type __clockid_t = __s32_type;
+pub type __timer_t = __uword_type;
+pub type __blksize_t = __slongword_type;
+pub type __fsid_t = __uquad_type;
+pub type __ssize_t = __sword_type;
+pub type __syscall_slong_t = __slongword_type;
+pub type __syscall_ulong_t = __ulongword_type;
+pub type __cpu_mask = __ulongword_type;
+
+pub type __loff_t = __off64_t;
+pub type __caddr_t = *mut ::c_char;
+pub type __intptr_t = __sword_type;
+pub type __ptrdiff_t = __sword_type;
+pub type __socklen_t = __u32_type;
+pub type __sig_atomic_t = ::c_int;
+pub type __time64_t = __int64_t;
+pub type ssize_t = __ssize_t;
+pub type size_t = ::c_ulong;
+pub type wchar_t = ::c_int;
+pub type wint_t = ::c_uint;
+pub type gid_t = __gid_t;
+pub type uid_t = __uid_t;
+pub type off_t = __off_t;
+pub type off64_t = __off64_t;
+pub type useconds_t = __useconds_t;
+pub type pid_t = __pid_t;
+pub type socklen_t = __socklen_t;
+
+pub type in_addr_t = u32;
+
+pub type _Float32 = f32;
+pub type _Float64 = f64;
+pub type _Float32x = f64;
+pub type _Float64x = f64;
+
+pub type __locale_t = *mut __locale_struct;
+pub type locale_t = __locale_t;
+
+pub type u_char = __u_char;
+pub type u_short = __u_short;
+pub type u_int = __u_int;
+pub type u_long = __u_long;
+pub type quad_t = __quad_t;
+pub type u_quad_t = __u_quad_t;
+pub type fsid_t = __fsid_t;
+pub type loff_t = __loff_t;
+pub type ino_t = __ino_t;
+pub type ino64_t = __ino64_t;
+pub type dev_t = __dev_t;
+pub type mode_t = __mode_t;
+pub type nlink_t = __nlink_t;
+pub type id_t = __id_t;
+pub type daddr_t = __daddr_t;
+pub type caddr_t = __caddr_t;
+pub type key_t = __key_t;
+pub type clock_t = __clock_t;
+pub type clockid_t = __clockid_t;
+pub type time_t = __time_t;
+pub type timer_t = __timer_t;
+pub type suseconds_t = __suseconds_t;
+pub type ulong = ::c_ulong;
+pub type ushort = ::c_ushort;
+pub type uint = ::c_uint;
+pub type u_int8_t = __uint8_t;
+pub type u_int16_t = __uint16_t;
+pub type u_int32_t = __uint32_t;
+pub type u_int64_t = __uint64_t;
+pub type register_t = ::c_int;
+pub type __sigset_t = ::c_ulong;
+pub type sigset_t = __sigset_t;
+
+pub type __fd_mask = ::c_long;
+pub type fd_mask = __fd_mask;
+pub type blksize_t = __blksize_t;
+pub type blkcnt_t = __blkcnt_t;
+pub type fsblkcnt_t = __fsblkcnt_t;
+pub type fsfilcnt_t = __fsfilcnt_t;
+pub type blkcnt64_t = __blkcnt64_t;
+pub type fsblkcnt64_t = __fsblkcnt64_t;
+pub type fsfilcnt64_t = __fsfilcnt64_t;
+
+pub type __pthread_spinlock_t = ::c_int;
+pub type __tss_t = ::c_int;
+pub type __thrd_t = ::c_long;
+pub type __pthread_t = ::c_long;
+pub type pthread_t = __pthread_t;
+pub type __pthread_process_shared = ::c_uint;
+pub type __pthread_inheritsched = ::c_uint;
+pub type __pthread_contentionscope = ::c_uint;
+pub type __pthread_detachstate = ::c_uint;
+pub type pthread_attr_t = __pthread_attr;
+pub type __pthread_mutex_protocol = ::c_uint;
+pub type __pthread_mutex_type = ::c_uint;
+pub type __pthread_mutex_robustness = ::c_uint;
+pub type pthread_mutexattr_t = __pthread_mutexattr;
+pub type pthread_mutex_t = __pthread_mutex;
+pub type pthread_condattr_t = __pthread_condattr;
+pub type pthread_cond_t = __pthread_cond;
+pub type pthread_spinlock_t = __pthread_spinlock_t;
+pub type pthread_rwlockattr_t = __pthread_rwlockattr;
+pub type pthread_rwlock_t = __pthread_rwlock;
+pub type pthread_barrierattr_t = __pthread_barrierattr;
+pub type pthread_barrier_t = __pthread_barrier;
+pub type __pthread_key = ::c_int;
+pub type pthread_key_t = __pthread_key;
+pub type pthread_once_t = __pthread_once;
+
+pub type __rlimit_resource = ::c_uint;
+pub type __rlimit_resource_t = __rlimit_resource;
+pub type rlim_t = __rlim_t;
+pub type rlim64_t = __rlim64_t;
+
+pub type __rusage_who = ::c_int;
+
+pub type __priority_which = ::c_uint;
+
+pub type sa_family_t = ::c_uchar;
+
+pub type in_port_t = u16;
+
+pub type __sigval_t = ::sigval;
+
+pub type sigevent_t = sigevent;
+
+pub type nfds_t = ::c_ulong;
+
+pub type tcflag_t = ::c_uint;
+pub type cc_t = ::c_uchar;
+pub type speed_t = ::c_int;
+
+pub type sigval_t = ::sigval;
+
+pub type greg_t = ::c_int;
+pub type gregset_t = [greg_t; 19usize];
+
+pub type __ioctl_dir = ::c_uint;
+
+pub type __ioctl_datum = ::c_uint;
+
+pub type __error_t_codes = ::c_int;
+
+pub type int_least8_t = __int_least8_t;
+pub type int_least16_t = __int_least16_t;
+pub type int_least32_t = __int_least32_t;
+pub type int_least64_t = __int_least64_t;
+pub type uint_least8_t = __uint_least8_t;
+pub type uint_least16_t = __uint_least16_t;
+pub type uint_least32_t = __uint_least32_t;
+pub type uint_least64_t = __uint_least64_t;
+pub type int_fast8_t = ::c_schar;
+pub type uint_fast8_t = ::c_uchar;
+pub type intmax_t = __intmax_t;
+pub type uintmax_t = __uintmax_t;
+
+pub type tcp_seq = u32;
+
+pub type tcp_ca_state = ::c_uint;
+
+pub type idtype_t = ::c_uint;
+
+pub type mqd_t = ::c_int;
+
+pub type Lmid_t = ::c_long;
+
+pub type regoff_t = ::c_int;
+
+pub type nl_item = ::c_int;
+
+pub type iconv_t = *mut ::c_void;
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum fpos64_t {} // FIXME: fill this out with a struct
+impl ::Copy for fpos64_t {}
+impl ::Clone for fpos64_t {
+    fn clone(&self) -> fpos64_t {
+        *self
+    }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum timezone {}
+impl ::Copy for timezone {}
+impl ::Clone for timezone {
+    fn clone(&self) -> timezone {
+        *self
+    }
+}
+
+// structs
+s! {
+    pub struct ip_mreq {
+        pub imr_multiaddr: in_addr,
+        pub imr_interface: in_addr,
+    }
+
+    pub struct ip_mreqn {
+        pub imr_multiaddr: in_addr,
+        pub imr_address: in_addr,
+        pub imr_ifindex: ::c_int,
+    }
+
+    pub struct ip_mreq_source {
+        pub imr_multiaddr: in_addr,
+        pub imr_interface: in_addr,
+        pub imr_sourceaddr: in_addr,
+    }
+
+    pub struct sockaddr {
+        pub sa_len: ::c_uchar,
+        pub sa_family: sa_family_t,
+        pub sa_data: [::c_char; 14usize],
+    }
+
+    pub struct in_addr {
+        pub s_addr: in_addr_t,
+    }
+
+    pub struct sockaddr_in {
+        pub sin_len: ::c_uchar,
+        pub sin_family: sa_family_t,
+        pub sin_port: in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [::c_uchar; 8usize],
+    }
+
+    pub struct sockaddr_in6 {
+        pub sin6_len: ::c_uchar,
+        pub sin6_family: sa_family_t,
+        pub sin6_port: in_port_t,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_scope_id: u32,
+    }
+
+    pub struct sockaddr_un {
+        pub sun_len: ::c_uchar,
+        pub sun_family: sa_family_t,
+        pub sun_path: [::c_char; 108usize],
+    }
+
+    pub struct sockaddr_storage {
+        pub ss_len: ::c_uchar,
+        pub ss_family: sa_family_t,
+        pub __ss_padding: [::c_char; 122usize],
+        pub __ss_align: __uint32_t,
+    }
+
+    pub struct sockaddr_at {
+        pub _address: u8,
+    }
+
+    pub struct sockaddr_ax25 {
+        pub _address: u8,
+    }
+
+    pub struct sockaddr_x25 {
+        pub _address: u8,
+    }
+
+    pub struct sockaddr_dl {
+        pub _address: u8,
+    }
+    pub struct sockaddr_eon {
+        pub _address: u8,
+    }
+    pub struct sockaddr_inarp {
+        pub _address: u8,
+    }
+
+    pub struct sockaddr_ipx {
+        pub _address: u8,
+    }
+    pub struct sockaddr_iso {
+        pub _address: u8,
+    }
+
+    pub struct sockaddr_ns {
+        pub _address: u8,
+    }
+
+    pub struct addrinfo {
+        pub ai_flags: ::c_int,
+        pub ai_family: ::c_int,
+        pub ai_socktype: ::c_int,
+        pub ai_protocol: ::c_int,
+        pub ai_addrlen: socklen_t,
+        pub ai_addr: *mut sockaddr,
+        pub ai_canonname: *mut ::c_char,
+        pub ai_next: *mut addrinfo,
+    }
+
+    pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::c_int,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: socklen_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct cmsghdr {
+        pub cmsg_len: ::socklen_t,
+        pub cmsg_level: ::c_int,
+        pub cmsg_type: ::c_int,
+    }
+
+    pub struct dirent {
+        pub d_ino: __ino_t,
+        pub d_reclen: ::c_ushort,
+        pub d_type: ::c_uchar,
+        pub d_namlen: ::c_uchar,
+        pub d_name: [::c_char; 1usize],
+    }
+
+    pub struct dirent64 {
+        pub d_ino: __ino64_t,
+        pub d_reclen: ::c_ushort,
+        pub d_type: ::c_uchar,
+        pub d_namlen: ::c_uchar,
+        pub d_name: [::c_char; 1usize],
+    }
+
+    pub struct fd_set {
+        pub fds_bits: [__fd_mask; 8usize],
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_cc: [::cc_t; 20usize],
+        pub __ispeed: ::speed_t,
+        pub __ospeed: ::speed_t,
+    }
+
+    pub struct mallinfo {
+        pub arena: ::c_int,
+        pub ordblks: ::c_int,
+        pub smblks: ::c_int,
+        pub hblks: ::c_int,
+        pub hblkhd: ::c_int,
+        pub usmblks: ::c_int,
+        pub fsmblks: ::c_int,
+        pub uordblks: ::c_int,
+        pub fordblks: ::c_int,
+        pub keepcost: ::c_int,
+    }
+
+    pub struct mallinfo2 {
+        pub arena: ::size_t,
+        pub ordblks: ::size_t,
+        pub smblks: ::size_t,
+        pub hblks: ::size_t,
+        pub hblkhd: ::size_t,
+        pub usmblks: ::size_t,
+        pub fsmblks: ::size_t,
+        pub uordblks: ::size_t,
+        pub fordblks: ::size_t,
+        pub keepcost: ::size_t,
+    }
+
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: __sigset_t,
+        pub sa_flags: ::c_int,
+    }
+
+    pub struct sigevent {
+        pub sigev_value: ::sigval,
+        pub sigev_signo: ::c_int,
+        pub sigev_notify: ::c_int,
+        __unused1: *mut ::c_void,       //actually a function pointer
+        pub sigev_notify_attributes: *mut pthread_attr_t,
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        pub si_pid: __pid_t,
+        pub si_uid: __uid_t,
+        pub si_addr: *mut ::c_void,
+        pub si_status: ::c_int,
+        pub si_band: ::c_long,
+        pub si_value: ::sigval,
+    }
+
+    pub struct timespec {
+        pub tv_sec: __time_t,
+        pub tv_nsec: __syscall_slong_t,
+    }
+
+    pub struct __locale_data {
+        pub _address: u8,
+    }
+
+    pub struct stat {
+        pub st_fstype: ::c_int,
+        pub st_dev: __fsid_t, /* Actually st_fsid */
+        pub st_ino: __ino_t,
+        pub st_gen: ::c_uint,
+        pub st_rdev: __dev_t,
+        pub st_mode: __mode_t,
+        pub st_nlink: __nlink_t,
+        pub st_uid: __uid_t,
+        pub st_gid: __gid_t,
+        pub st_size: __off_t,
+        pub st_atim: ::timespec,
+        pub st_mtim: ::timespec,
+        pub st_ctim: ::timespec,
+        pub st_blksize: __blksize_t,
+        pub st_blocks: __blkcnt_t,
+        pub st_author: __uid_t,
+        pub st_flags: ::c_uint,
+        pub st_spare: [::c_int; 11usize],
+    }
+
+    pub struct stat64 {
+        pub st_fstype: ::c_int,
+        pub st_fsid: __fsid_t,
+        pub st_ino: __ino64_t,
+        pub st_gen: ::c_uint,
+        pub st_rdev: __dev_t,
+        pub st_mode: __mode_t,
+        pub st_nlink: __nlink_t,
+        pub st_uid: __uid_t,
+        pub st_gid: __gid_t,
+        pub st_size: __off64_t,
+        pub st_atim: ::timespec,
+        pub st_mtim: ::timespec,
+        pub st_ctim: ::timespec,
+        pub st_blksize: __blksize_t,
+        pub st_blocks: __blkcnt64_t,
+        pub st_author: __uid_t,
+        pub st_flags: ::c_uint,
+        pub st_spare: [::c_int; 8usize],
+    }
+
+    pub struct statx {
+        pub stx_mask: u32,
+        pub stx_blksize: u32,
+        pub stx_attributes: u64,
+        pub stx_nlink: u32,
+        pub stx_uid: u32,
+        pub stx_gid: u32,
+        pub stx_mode: u16,
+        __statx_pad1: [u16; 1],
+        pub stx_ino: u64,
+        pub stx_size: u64,
+        pub stx_blocks: u64,
+        pub stx_attributes_mask: u64,
+        pub stx_atime: ::statx_timestamp,
+        pub stx_btime: ::statx_timestamp,
+        pub stx_ctime: ::statx_timestamp,
+        pub stx_mtime: ::statx_timestamp,
+        pub stx_rdev_major: u32,
+        pub stx_rdev_minor: u32,
+        pub stx_dev_major: u32,
+        pub stx_dev_minor: u32,
+        __statx_pad2: [u64; 14],
+    }
+
+    pub struct statx_timestamp {
+        pub tv_sec: i64,
+        pub tv_nsec: u32,
+        pub __statx_timestamp_pad1: [i32; 1],
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_uint,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: __fsblkcnt_t,
+        pub f_bfree: __fsblkcnt_t,
+        pub f_bavail: __fsblkcnt_t,
+        pub f_files: __fsblkcnt_t,
+        pub f_ffree: __fsblkcnt_t,
+        pub f_fsid: __fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_favail: __fsfilcnt_t,
+        pub f_frsize: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_spare: [::c_uint; 3usize],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_uint,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: __fsblkcnt64_t,
+        pub f_bfree: __fsblkcnt64_t,
+        pub f_bavail: __fsblkcnt64_t,
+        pub f_files: __fsblkcnt64_t,
+        pub f_ffree: __fsblkcnt64_t,
+        pub f_fsid: __fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_favail: __fsfilcnt64_t,
+        pub f_frsize: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_spare: [::c_uint ; 3usize],
+    }
+
+    pub struct statvfs {
+        pub __f_type: ::c_uint,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: __fsblkcnt_t,
+        pub f_bfree: __fsblkcnt_t,
+        pub f_bavail: __fsblkcnt_t,
+        pub f_files: __fsfilcnt_t,
+        pub f_ffree: __fsfilcnt_t,
+        pub f_fsid: __fsid_t,
+        pub f_namemax: ::c_ulong,
+        pub f_favail: __fsfilcnt_t,
+        pub f_frsize: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_spare: [::c_uint; 3usize],
+    }
+
+    pub struct statvfs64 {
+        pub __f_type: ::c_uint,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: __fsblkcnt64_t,
+        pub f_bfree: __fsblkcnt64_t,
+        pub f_bavail: __fsblkcnt64_t,
+        pub f_files: __fsfilcnt64_t,
+        pub f_ffree: __fsfilcnt64_t,
+        pub f_fsid: __fsid_t,
+        pub f_namemax: ::c_ulong,
+        pub f_favail: __fsfilcnt64_t,
+        pub f_frsize: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_spare: [::c_uint; 3usize],
+    }
+
+    pub struct aiocb {
+        pub aio_fildes: ::c_int,
+        pub aio_lio_opcode: ::c_int,
+        pub aio_reqprio: ::c_int,
+        pub aio_buf: *mut ::c_void,
+        pub aio_nbytes: ::size_t,
+        pub aio_sigevent: ::sigevent,
+        __next_prio: *mut aiocb,
+        __abs_prio: ::c_int,
+        __policy: ::c_int,
+        __error_code: ::c_int,
+        __return_value: ::ssize_t,
+        pub aio_offset: off_t,
+        #[cfg(all(not(target_arch = "x86_64"), target_pointer_width = "32"))]
+        __unused1: [::c_char; 4],
+        __glibc_reserved: [::c_char; 32]
+    }
+
+    pub struct mq_attr {
+        pub mq_flags: ::c_long,
+        pub mq_maxmsg: ::c_long,
+        pub mq_msgsize: ::c_long,
+        pub mq_curmsgs: ::c_long,
+    }
+
+    pub struct __exit_status {
+        pub e_termination: ::c_short,
+        pub e_exit: ::c_short,
+    }
+
+    #[cfg_attr(target_pointer_width = "32",
+               repr(align(4)))]
+    #[cfg_attr(target_pointer_width = "64",
+               repr(align(8)))]
+    pub struct sem_t {
+        __size: [::c_char; 20usize],
+    }
+
+    pub struct __pthread {
+        pub _address: u8,
+    }
+
+    pub struct __pthread_mutexattr {
+        pub __prioceiling: ::c_int,
+        pub __protocol: __pthread_mutex_protocol,
+        pub __pshared: __pthread_process_shared,
+        pub __mutex_type: __pthread_mutex_type,
+    }
+    pub struct __pthread_mutex {
+        pub __lock: ::c_uint,
+        pub __owner_id: ::c_uint,
+        pub __cnt: ::c_uint,
+        pub __shpid: ::c_int,
+        pub __type: ::c_int,
+        pub __flags: ::c_int,
+        pub __reserved1: ::c_uint,
+        pub __reserved2: ::c_uint,
+    }
+
+    pub struct __pthread_condattr {
+        pub __pshared: __pthread_process_shared,
+        pub __clock: __clockid_t,
+    }
+
+    pub struct __pthread_rwlockattr {
+        pub __pshared: __pthread_process_shared,
+    }
+
+    pub struct __pthread_barrierattr {
+        pub __pshared: __pthread_process_shared,
+    }
+
+    pub struct __pthread_once {
+        pub __run: ::c_int,
+        pub __lock: __pthread_spinlock_t,
+    }
+
+    pub struct __pthread_cond {
+        pub __lock: __pthread_spinlock_t,
+        pub __queue: *mut __pthread,
+        pub __attr: *mut __pthread_condattr,
+        pub __wrefs: ::c_uint,
+        pub __data: *mut ::c_void,
+    }
+
+    pub struct __pthread_attr {
+        pub __schedparam: sched_param,
+        pub __stackaddr: *mut ::c_void,
+        pub __stacksize: size_t,
+        pub __guardsize: size_t,
+        pub __detachstate: __pthread_detachstate,
+        pub __inheritsched: __pthread_inheritsched,
+        pub __contentionscope: __pthread_contentionscope,
+        pub __schedpolicy: ::c_int,
+    }
+
+    pub struct __pthread_rwlock {
+        pub __held: __pthread_spinlock_t,
+        pub __lock: __pthread_spinlock_t,
+        pub __readers: ::c_int,
+        pub __readerqueue: *mut __pthread,
+        pub __writerqueue: *mut __pthread,
+        pub __attr: *mut __pthread_rwlockattr,
+        pub __data: *mut ::c_void,
+    }
+
+    pub struct __pthread_barrier {
+        pub __lock: __pthread_spinlock_t,
+        pub __queue: *mut __pthread,
+        pub __pending: ::c_uint,
+        pub __count: ::c_uint,
+        pub __attr: *mut __pthread_barrierattr,
+        pub __data: *mut ::c_void,
+    }
+
+    pub struct seminfo {
+        pub semmap: ::c_int,
+        pub semmni: ::c_int,
+        pub semmns: ::c_int,
+        pub semmnu: ::c_int,
+        pub semmsl: ::c_int,
+        pub semopm: ::c_int,
+        pub semume: ::c_int,
+        pub semusz: ::c_int,
+        pub semvmx: ::c_int,
+        pub semaem: ::c_int,
+    }
+
+    pub struct _IO_FILE {
+        _unused: [u8; 0],
+    }
+
+    pub struct sched_param {
+        pub sched_priority: ::c_int,
+    }
+
+    pub struct iovec {
+        pub iov_base: *mut ::c_void,
+        pub iov_len: size_t,
+    }
+
+    pub struct passwd {
+        pub pw_name: *mut ::c_char,
+        pub pw_passwd: *mut ::c_char,
+        pub pw_uid: __uid_t,
+        pub pw_gid: __gid_t,
+        pub pw_gecos: *mut ::c_char,
+        pub pw_dir: *mut ::c_char,
+        pub pw_shell: *mut ::c_char,
+    }
+
+    pub struct spwd {
+        pub sp_namp: *mut ::c_char,
+        pub sp_pwdp: *mut ::c_char,
+        pub sp_lstchg: ::c_long,
+        pub sp_min: ::c_long,
+        pub sp_max: ::c_long,
+        pub sp_warn: ::c_long,
+        pub sp_inact: ::c_long,
+        pub sp_expire: ::c_long,
+        pub sp_flag: ::c_ulong,
+    }
+
+    pub struct itimerspec {
+        pub it_interval: ::timespec,
+        pub it_value: ::timespec,
+    }
+
+    pub struct tm {
+        pub tm_sec: ::c_int,
+        pub tm_min: ::c_int,
+        pub tm_hour: ::c_int,
+        pub tm_mday: ::c_int,
+        pub tm_mon: ::c_int,
+        pub tm_year: ::c_int,
+        pub tm_wday: ::c_int,
+        pub tm_yday: ::c_int,
+        pub tm_isdst: ::c_int,
+        pub tm_gmtoff: ::c_long,
+        pub tm_zone: *const ::c_char,
+    }
+
+    pub struct lconv {
+        pub decimal_point: *mut ::c_char,
+        pub thousands_sep: *mut ::c_char,
+        pub grouping: *mut ::c_char,
+        pub int_curr_symbol: *mut ::c_char,
+        pub currency_symbol: *mut ::c_char,
+        pub mon_decimal_point: *mut ::c_char,
+        pub mon_thousands_sep: *mut ::c_char,
+        pub mon_grouping: *mut ::c_char,
+        pub positive_sign: *mut ::c_char,
+        pub negative_sign: *mut ::c_char,
+        pub int_frac_digits: ::c_char,
+        pub frac_digits: ::c_char,
+        pub p_cs_precedes: ::c_char,
+        pub p_sep_by_space: ::c_char,
+        pub n_cs_precedes: ::c_char,
+        pub n_sep_by_space: ::c_char,
+        pub p_sign_posn: ::c_char,
+        pub n_sign_posn: ::c_char,
+        pub int_p_cs_precedes: ::c_char,
+        pub int_p_sep_by_space: ::c_char,
+        pub int_n_cs_precedes: ::c_char,
+        pub int_n_sep_by_space: ::c_char,
+        pub int_p_sign_posn: ::c_char,
+        pub int_n_sign_posn: ::c_char,
+    }
+
+    pub struct Dl_info {
+        pub dli_fname: *const ::c_char,
+        pub dli_fbase: *mut ::c_void,
+        pub dli_sname: *const ::c_char,
+        pub dli_saddr: *mut ::c_void,
+    }
+
+    pub struct ifaddrs {
+        pub ifa_next: *mut ifaddrs,
+        pub ifa_name: *mut c_char,
+        pub ifa_flags: ::c_uint,
+        pub ifa_addr: *mut ::sockaddr,
+        pub ifa_netmask: *mut ::sockaddr,
+        pub ifa_ifu: *mut ::sockaddr, // FIXME This should be a union
+        pub ifa_data: *mut ::c_void
+    }
+
+    pub struct arpreq {
+        pub arp_pa: ::sockaddr,
+        pub arp_ha: ::sockaddr,
+        pub arp_flags: ::c_int,
+        pub arp_netmask: ::sockaddr,
+        pub arp_dev: [::c_char; 16],
+    }
+
+    pub struct arpreq_old {
+        pub arp_pa: ::sockaddr,
+        pub arp_ha: ::sockaddr,
+        pub arp_flags: ::c_int,
+        pub arp_netmask: ::sockaddr,
+    }
+
+    pub struct arphdr {
+        pub ar_hrd: u16,
+        pub ar_pro: u16,
+        pub ar_hln: u8,
+        pub ar_pln: u8,
+        pub ar_op: u16,
+    }
+
+    pub struct arpd_request {
+        pub req: ::c_ushort,
+        pub ip: u32,
+        pub dev: ::c_ulong,
+        pub stamp: ::c_ulong,
+        pub updated: ::c_ulong,
+        pub ha: [::c_uchar; ::MAX_ADDR_LEN],
+    }
+
+    pub struct mmsghdr {
+        pub msg_hdr: ::msghdr,
+        pub msg_len: ::c_uint,
+    }
+
+    pub struct ifreq {
+        /// interface name, e.g. "en0"
+        pub ifr_name: [::c_char; ::IFNAMSIZ],
+        pub ifr_ifru: ::sockaddr,
+    }
+
+    pub struct __locale_struct {
+        pub __locales: [*mut __locale_data; 13usize],
+        pub __ctype_b: *const ::c_ushort,
+        pub __ctype_tolower: *const ::c_int,
+        pub __ctype_toupper: *const ::c_int,
+        pub __names: [*const ::c_char; 13usize],
+    }
+
+    pub struct utsname {
+        pub sysname: [::c_char; 65],
+        pub nodename: [::c_char; 65],
+        pub release: [::c_char; 65],
+        pub version: [::c_char; 65],
+        pub machine: [::c_char; 65],
+        pub domainname: [::c_char; 65]
+    }
+
+    pub struct rlimit64 {
+        pub rlim_cur: rlim64_t,
+        pub rlim_max: rlim64_t,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: * mut ::c_void,
+        pub ss_size: ::size_t,
+        pub ss_flags: ::c_int,
+    }
+
+    pub struct dl_phdr_info {
+        pub dlpi_addr: Elf_Addr,
+        pub dlpi_name: *const ::c_char,
+        pub dlpi_phdr: *const Elf_Phdr,
+        pub dlpi_phnum: Elf_Half,
+        pub dlpi_adds: ::c_ulonglong,
+        pub dlpi_subs: ::c_ulonglong,
+        pub dlpi_tls_modid: ::size_t,
+        pub dlpi_tls_data: *mut ::c_void,
+    }
+
+    pub struct flock {
+        #[cfg(target_pointer_width = "32")]
+        pub l_type : ::c_int,
+        #[cfg(target_pointer_width = "32")]
+        pub l_whence : ::c_int,
+        #[cfg(target_pointer_width = "64")]
+        pub l_type : ::c_short,
+        #[cfg(target_pointer_width = "64")]
+        pub l_whence : ::c_short,
+        pub l_start : __off_t,
+        pub l_len : __off_t,
+        pub l_pid : __pid_t,
+    }
+
+    pub struct flock64 {
+        #[cfg(target_pointer_width = "32")]
+        pub l_type : ::c_int,
+        #[cfg(target_pointer_width = "32")]
+        pub l_whence : ::c_int,
+        #[cfg(target_pointer_width = "64")]
+        pub l_type : ::c_short,
+        #[cfg(target_pointer_width = "64")]
+        pub l_whence : ::c_short,
+        pub l_start : __off_t,
+        pub l_len : __off64_t,
+        pub l_pid : __pid_t,
+    }
+
+    pub struct glob_t {
+        pub gl_pathc: ::size_t,
+        pub gl_pathv: *mut *mut c_char,
+        pub gl_offs: ::size_t,
+        pub gl_flags: ::c_int,
+
+        __unused1: *mut ::c_void,
+        __unused2: *mut ::c_void,
+        __unused3: *mut ::c_void,
+        __unused4: *mut ::c_void,
+        __unused5: *mut ::c_void,
+    }
+
+    pub struct glob64_t {
+        pub gl_pathc: ::size_t,
+        pub gl_pathv: *mut *mut ::c_char,
+        pub gl_offs: ::size_t,
+        pub gl_flags: ::c_int,
+
+        __unused1: *mut ::c_void,
+        __unused2: *mut ::c_void,
+        __unused3: *mut ::c_void,
+        __unused4: *mut ::c_void,
+        __unused5: *mut ::c_void,
+    }
+
+    pub struct regex_t {
+        __buffer: *mut ::c_void,
+        __allocated: ::size_t,
+        __used: ::size_t,
+        __syntax: ::c_ulong,
+        __fastmap: *mut ::c_char,
+        __translate: *mut ::c_char,
+        __re_nsub: ::size_t,
+        __bitfield: u8,
+    }
+
+    pub struct cpu_set_t {
+        #[cfg(all(target_pointer_width = "32",
+                  not(target_arch = "x86_64")))]
+        bits: [u32; 32],
+        #[cfg(not(all(target_pointer_width = "32",
+                      not(target_arch = "x86_64"))))]
+        bits: [u64; 16],
+    }
+
+    pub struct if_nameindex {
+        pub if_index: ::c_uint,
+        pub if_name: *mut ::c_char,
+    }
+
+    // System V IPC
+    pub struct msginfo {
+        pub msgpool: ::c_int,
+        pub msgmap: ::c_int,
+        pub msgmax: ::c_int,
+        pub msgmnb: ::c_int,
+        pub msgmni: ::c_int,
+        pub msgssz: ::c_int,
+        pub msgtql: ::c_int,
+        pub msgseg: ::c_ushort,
+    }
+
+    pub struct sembuf {
+        pub sem_num: ::c_ushort,
+        pub sem_op: ::c_short,
+        pub sem_flg: ::c_short,
+    }
+
+    pub struct mntent {
+        pub mnt_fsname: *mut ::c_char,
+        pub mnt_dir: *mut ::c_char,
+        pub mnt_type: *mut ::c_char,
+        pub mnt_opts: *mut ::c_char,
+        pub mnt_freq: ::c_int,
+        pub mnt_passno: ::c_int,
+    }
+
+    pub struct posix_spawn_file_actions_t {
+        __allocated: ::c_int,
+        __used: ::c_int,
+        __actions: *mut ::c_int,
+        __pad: [::c_int; 16],
+    }
+
+    pub struct posix_spawnattr_t {
+        __flags: ::c_short,
+        __pgrp: ::pid_t,
+        __sd: ::sigset_t,
+        __ss: ::sigset_t,
+        __sp: ::sched_param,
+        __policy: ::c_int,
+        __pad: [::c_int; 16],
+    }
+
+    pub struct regmatch_t {
+        pub rm_so: regoff_t,
+        pub rm_eo: regoff_t,
+    }
+
+    pub struct option {
+        pub name: *const ::c_char,
+        pub has_arg: ::c_int,
+        pub flag: *mut ::c_int,
+        pub val: ::c_int,
+    }
+
+}
+
+s_no_extra_traits! {
+    pub struct utmpx {
+        pub ut_type: ::c_short,
+        pub ut_pid: ::pid_t,
+        pub ut_line: [::c_char; __UT_LINESIZE],
+        pub ut_id: [::c_char; 4],
+
+        pub ut_user: [::c_char; __UT_NAMESIZE],
+        pub ut_host: [::c_char; __UT_HOSTSIZE],
+        pub ut_exit: __exit_status,
+
+        #[cfg(any( all(target_pointer_width = "32",
+                      not(target_arch = "x86_64"))))]
+        pub ut_session: ::c_long,
+        #[cfg(any(all(target_pointer_width = "32",
+                      not(target_arch = "x86_64"))))]
+        pub ut_tv: ::timeval,
+
+        #[cfg(not(any(all(target_pointer_width = "32",
+                          not(target_arch = "x86_64")))))]
+        pub ut_session: i32,
+        #[cfg(not(any(all(target_pointer_width = "32",
+                          not(target_arch = "x86_64")))))]
+        pub ut_tv: __timeval,
+
+        pub ut_addr_v6: [i32; 4],
+        __glibc_reserved: [::c_char; 20],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for utmpx {
+            fn eq(&self, other: &utmpx) -> bool {
+                self.ut_type == other.ut_type
+                    && self.ut_pid == other.ut_pid
+                    && self.ut_line == other.ut_line
+                    && self.ut_id == other.ut_id
+                    && self.ut_user == other.ut_user
+                    && self
+                    .ut_host
+                    .iter()
+                    .zip(other.ut_host.iter())
+                    .all(|(a,b)| a == b)
+                    && self.ut_exit == other.ut_exit
+                    && self.ut_session == other.ut_session
+                    && self.ut_tv == other.ut_tv
+                    && self.ut_addr_v6 == other.ut_addr_v6
+                    && self.__glibc_reserved == other.__glibc_reserved
+            }
+        }
+
+        impl Eq for utmpx {}
+
+        impl ::fmt::Debug for utmpx {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("utmpx")
+                    .field("ut_type", &self.ut_type)
+                    .field("ut_pid", &self.ut_pid)
+                    .field("ut_line", &self.ut_line)
+                    .field("ut_id", &self.ut_id)
+                    .field("ut_user", &self.ut_user)
+                // FIXME: .field("ut_host", &self.ut_host)
+                    .field("ut_exit", &self.ut_exit)
+                    .field("ut_session", &self.ut_session)
+                    .field("ut_tv", &self.ut_tv)
+                    .field("ut_addr_v6", &self.ut_addr_v6)
+                    .field("__glibc_reserved", &self.__glibc_reserved)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for utmpx {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ut_type.hash(state);
+                self.ut_pid.hash(state);
+                self.ut_line.hash(state);
+                self.ut_id.hash(state);
+                self.ut_user.hash(state);
+                self.ut_host.hash(state);
+                self.ut_exit.hash(state);
+                self.ut_session.hash(state);
+                self.ut_tv.hash(state);
+                self.ut_addr_v6.hash(state);
+                self.__glibc_reserved.hash(state);
+            }
+        }
+    }
+}
+
+impl siginfo_t {
+    pub unsafe fn si_addr(&self) -> *mut ::c_void {
+        self.si_addr
+    }
+
+    pub unsafe fn si_value(&self) -> ::sigval {
+        self.si_value
+    }
+
+    pub unsafe fn si_pid(&self) -> ::pid_t {
+        self.si_pid
+    }
+
+    pub unsafe fn si_uid(&self) -> ::uid_t {
+        self.si_uid
+    }
+
+    pub unsafe fn si_status(&self) -> ::c_int {
+        self.si_status
+    }
+}
+
+// const
+
+// aio.h
+pub const AIO_CANCELED: ::c_int = 0;
+pub const AIO_NOTCANCELED: ::c_int = 1;
+pub const AIO_ALLDONE: ::c_int = 2;
+pub const LIO_READ: ::c_int = 0;
+pub const LIO_WRITE: ::c_int = 1;
+pub const LIO_NOP: ::c_int = 2;
+pub const LIO_WAIT: ::c_int = 0;
+pub const LIO_NOWAIT: ::c_int = 1;
+
+// glob.h
+pub const GLOB_ERR: ::c_int = 1 << 0;
+pub const GLOB_MARK: ::c_int = 1 << 1;
+pub const GLOB_NOSORT: ::c_int = 1 << 2;
+pub const GLOB_DOOFFS: ::c_int = 1 << 3;
+pub const GLOB_NOCHECK: ::c_int = 1 << 4;
+pub const GLOB_APPEND: ::c_int = 1 << 5;
+pub const GLOB_NOESCAPE: ::c_int = 1 << 6;
+
+pub const GLOB_NOSPACE: ::c_int = 1;
+pub const GLOB_ABORTED: ::c_int = 2;
+pub const GLOB_NOMATCH: ::c_int = 3;
+
+pub const GLOB_PERIOD: ::c_int = 1 << 7;
+pub const GLOB_ALTDIRFUNC: ::c_int = 1 << 9;
+pub const GLOB_BRACE: ::c_int = 1 << 10;
+pub const GLOB_NOMAGIC: ::c_int = 1 << 11;
+pub const GLOB_TILDE: ::c_int = 1 << 12;
+pub const GLOB_ONLYDIR: ::c_int = 1 << 13;
+pub const GLOB_TILDE_CHECK: ::c_int = 1 << 14;
+
+// ipc.h
+pub const IPC_PRIVATE: ::key_t = 0;
+
+pub const IPC_CREAT: ::c_int = 0o1000;
+pub const IPC_EXCL: ::c_int = 0o2000;
+pub const IPC_NOWAIT: ::c_int = 0o4000;
+
+pub const IPC_RMID: ::c_int = 0;
+pub const IPC_SET: ::c_int = 1;
+pub const IPC_STAT: ::c_int = 2;
+pub const IPC_INFO: ::c_int = 3;
+pub const MSG_STAT: ::c_int = 11;
+pub const MSG_INFO: ::c_int = 12;
+
+pub const MSG_NOERROR: ::c_int = 0o10000;
+pub const MSG_EXCEPT: ::c_int = 0o20000;
+
+// shm.h
+pub const SHM_R: ::c_int = 0o400;
+pub const SHM_W: ::c_int = 0o200;
+
+pub const SHM_RDONLY: ::c_int = 0o10000;
+pub const SHM_RND: ::c_int = 0o20000;
+pub const SHM_REMAP: ::c_int = 0o40000;
+
+pub const SHM_LOCK: ::c_int = 11;
+pub const SHM_UNLOCK: ::c_int = 12;
+// unistd.h
+pub const STDIN_FILENO: ::c_int = 0;
+pub const STDOUT_FILENO: ::c_int = 1;
+pub const STDERR_FILENO: ::c_int = 2;
+pub const __FD_SETSIZE: usize = 256;
+pub const R_OK: ::c_int = 4;
+pub const W_OK: ::c_int = 2;
+pub const X_OK: ::c_int = 1;
+pub const F_OK: ::c_int = 0;
+pub const SEEK_SET: ::c_int = 0;
+pub const SEEK_CUR: ::c_int = 1;
+pub const SEEK_END: ::c_int = 2;
+pub const SEEK_DATA: ::c_int = 3;
+pub const SEEK_HOLE: ::c_int = 4;
+pub const L_SET: ::c_int = 0;
+pub const L_INCR: ::c_int = 1;
+pub const L_XTND: ::c_int = 2;
+pub const F_ULOCK: ::c_int = 0;
+pub const F_LOCK: ::c_int = 1;
+pub const F_TLOCK: ::c_int = 2;
+pub const F_TEST: ::c_int = 3;
+pub const CLOSE_RANGE_CLOEXEC: ::c_int = 4;
+
+// stdio.h
+pub const EOF: ::c_int = -1;
+
+// stdlib.h
+pub const WNOHANG: ::c_int = 1;
+pub const WUNTRACED: ::c_int = 2;
+pub const WSTOPPED: ::c_int = 2;
+pub const WCONTINUED: ::c_int = 4;
+pub const WNOWAIT: ::c_int = 8;
+pub const WEXITED: ::c_int = 16;
+pub const __W_CONTINUED: ::c_int = 65535;
+pub const __WCOREFLAG: ::c_int = 128;
+pub const RAND_MAX: ::c_int = 2147483647;
+pub const EXIT_FAILURE: ::c_int = 1;
+pub const EXIT_SUCCESS: ::c_int = 0;
+pub const __LITTLE_ENDIAN: usize = 1234;
+pub const __BIG_ENDIAN: usize = 4321;
+pub const __PDP_ENDIAN: usize = 3412;
+pub const __BYTE_ORDER: usize = 1234;
+pub const __FLOAT_WORD_ORDER: usize = 1234;
+pub const LITTLE_ENDIAN: usize = 1234;
+pub const BIG_ENDIAN: usize = 4321;
+pub const PDP_ENDIAN: usize = 3412;
+pub const BYTE_ORDER: usize = 1234;
+
+// sys/select.h
+pub const FD_SETSIZE: usize = 256;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 32;
+pub const __SIZEOF_PTHREAD_ATTR_T: usize = 32;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 28;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 24;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 16;
+pub const __SIZEOF_PTHREAD_COND_T: usize = 20;
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 8;
+pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_ONCE_T: usize = 8;
+pub const __PTHREAD_SPIN_LOCK_INITIALIZER: ::c_int = 0;
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
+
+// sys/resource.h
+pub const RLIM_INFINITY: ::rlim_t = 2147483647;
+pub const RLIM64_INFINITY: ::rlim64_t = 9223372036854775807;
+pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY;
+pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY;
+pub const PRIO_MIN: ::c_int = -20;
+pub const PRIO_MAX: ::c_int = 20;
+
+// pwd.h
+pub const NSS_BUFLEN_PASSWD: usize = 1024;
+
+// sys/socket.h
+pub const SOCK_TYPE_MASK: usize = 15;
+pub const PF_UNSPEC: ::c_int = 0;
+pub const PF_LOCAL: ::c_int = 1;
+pub const PF_UNIX: ::c_int = 1;
+pub const PF_FILE: ::c_int = 1;
+pub const PF_INET: ::c_int = 2;
+pub const PF_IMPLINK: ::c_int = 3;
+pub const PF_PUP: ::c_int = 4;
+pub const PF_CHAOS: ::c_int = 5;
+pub const PF_NS: ::c_int = 6;
+pub const PF_ISO: ::c_int = 7;
+pub const PF_OSI: ::c_int = 7;
+pub const PF_ECMA: ::c_int = 8;
+pub const PF_DATAKIT: ::c_int = 9;
+pub const PF_CCITT: ::c_int = 10;
+pub const PF_SNA: ::c_int = 11;
+pub const PF_DECnet: ::c_int = 12;
+pub const PF_DLI: ::c_int = 13;
+pub const PF_LAT: ::c_int = 14;
+pub const PF_HYLINK: ::c_int = 15;
+pub const PF_APPLETALK: ::c_int = 16;
+pub const PF_ROUTE: ::c_int = 17;
+pub const PF_XTP: ::c_int = 19;
+pub const PF_COIP: ::c_int = 20;
+pub const PF_CNT: ::c_int = 21;
+pub const PF_RTIP: ::c_int = 22;
+pub const PF_IPX: ::c_int = 23;
+pub const PF_SIP: ::c_int = 24;
+pub const PF_PIP: ::c_int = 25;
+pub const PF_INET6: ::c_int = 26;
+pub const PF_MAX: ::c_int = 27;
+pub const AF_UNSPEC: ::c_int = 0;
+pub const AF_LOCAL: ::c_int = 1;
+pub const AF_UNIX: ::c_int = 1;
+pub const AF_FILE: ::c_int = 1;
+pub const AF_INET: ::c_int = 2;
+pub const AF_IMPLINK: ::c_int = 3;
+pub const AF_PUP: ::c_int = 4;
+pub const AF_CHAOS: ::c_int = 5;
+pub const AF_NS: ::c_int = 6;
+pub const AF_ISO: ::c_int = 7;
+pub const AF_OSI: ::c_int = 7;
+pub const AF_ECMA: ::c_int = 8;
+pub const AF_DATAKIT: ::c_int = 9;
+pub const AF_CCITT: ::c_int = 10;
+pub const AF_SNA: ::c_int = 11;
+pub const AF_DECnet: ::c_int = 12;
+pub const AF_DLI: ::c_int = 13;
+pub const AF_LAT: ::c_int = 14;
+pub const AF_HYLINK: ::c_int = 15;
+pub const AF_APPLETALK: ::c_int = 16;
+pub const AF_ROUTE: ::c_int = 17;
+pub const pseudo_AF_XTP: ::c_int = 19;
+pub const AF_COIP: ::c_int = 20;
+pub const AF_CNT: ::c_int = 21;
+pub const pseudo_AF_RTIP: ::c_int = 22;
+pub const AF_IPX: ::c_int = 23;
+pub const AF_SIP: ::c_int = 24;
+pub const pseudo_AF_PIP: ::c_int = 25;
+pub const AF_INET6: ::c_int = 26;
+pub const AF_MAX: ::c_int = 27;
+pub const SOMAXCONN: ::c_int = 4096;
+pub const _SS_SIZE: usize = 128;
+pub const CMGROUP_MAX: usize = 16;
+pub const SOL_SOCKET: ::c_int = 65535;
+
+// sys/time.h
+pub const ITIMER_REAL: ::c_int = 0;
+pub const ITIMER_VIRTUAL: ::c_int = 1;
+pub const ITIMER_PROF: ::c_int = 2;
+
+// netinet/in.h
+pub const SOL_IP: ::c_int = 0;
+pub const SOL_TCP: ::c_int = 6;
+pub const SOL_UDP: ::c_int = 17;
+pub const SOL_IPV6: ::c_int = 41;
+pub const SOL_ICMPV6: ::c_int = 58;
+pub const IP_OPTIONS: ::c_int = 1;
+pub const IP_HDRINCL: ::c_int = 2;
+pub const IP_TOS: ::c_int = 3;
+pub const IP_TTL: ::c_int = 4;
+pub const IP_RECVOPTS: ::c_int = 5;
+pub const IP_RECVRETOPTS: ::c_int = 6;
+pub const IP_RECVDSTADDR: ::c_int = 7;
+pub const IP_RETOPTS: ::c_int = 8;
+pub const IP_MULTICAST_IF: ::c_int = 9;
+pub const IP_MULTICAST_TTL: ::c_int = 10;
+pub const IP_MULTICAST_LOOP: ::c_int = 11;
+pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
+pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
+pub const IPV6_ADDRFORM: ::c_int = 1;
+pub const IPV6_2292PKTINFO: ::c_int = 2;
+pub const IPV6_2292HOPOPTS: ::c_int = 3;
+pub const IPV6_2292DSTOPTS: ::c_int = 4;
+pub const IPV6_2292RTHDR: ::c_int = 5;
+pub const IPV6_2292PKTOPTIONS: ::c_int = 6;
+pub const IPV6_CHECKSUM: ::c_int = 7;
+pub const IPV6_2292HOPLIMIT: ::c_int = 8;
+pub const IPV6_RXINFO: ::c_int = 2;
+pub const IPV6_TXINFO: ::c_int = 2;
+pub const SCM_SRCINFO: ::c_int = 2;
+pub const IPV6_UNICAST_HOPS: ::c_int = 16;
+pub const IPV6_MULTICAST_IF: ::c_int = 17;
+pub const IPV6_MULTICAST_HOPS: ::c_int = 18;
+pub const IPV6_MULTICAST_LOOP: ::c_int = 19;
+pub const IPV6_JOIN_GROUP: ::c_int = 20;
+pub const IPV6_LEAVE_GROUP: ::c_int = 21;
+pub const IPV6_ROUTER_ALERT: ::c_int = 22;
+pub const IPV6_MTU_DISCOVER: ::c_int = 23;
+pub const IPV6_MTU: ::c_int = 24;
+pub const IPV6_RECVERR: ::c_int = 25;
+pub const IPV6_V6ONLY: ::c_int = 26;
+pub const IPV6_JOIN_ANYCAST: ::c_int = 27;
+pub const IPV6_LEAVE_ANYCAST: ::c_int = 28;
+pub const IPV6_RECVPKTINFO: ::c_int = 49;
+pub const IPV6_PKTINFO: ::c_int = 50;
+pub const IPV6_RECVHOPLIMIT: ::c_int = 51;
+pub const IPV6_HOPLIMIT: ::c_int = 52;
+pub const IPV6_RECVHOPOPTS: ::c_int = 53;
+pub const IPV6_HOPOPTS: ::c_int = 54;
+pub const IPV6_RTHDRDSTOPTS: ::c_int = 55;
+pub const IPV6_RECVRTHDR: ::c_int = 56;
+pub const IPV6_RTHDR: ::c_int = 57;
+pub const IPV6_RECVDSTOPTS: ::c_int = 58;
+pub const IPV6_DSTOPTS: ::c_int = 59;
+pub const IPV6_RECVPATHMTU: ::c_int = 60;
+pub const IPV6_PATHMTU: ::c_int = 61;
+pub const IPV6_DONTFRAG: ::c_int = 62;
+pub const IPV6_RECVTCLASS: ::c_int = 66;
+pub const IPV6_TCLASS: ::c_int = 67;
+pub const IPV6_ADDR_PREFERENCES: ::c_int = 72;
+pub const IPV6_MINHOPCOUNT: ::c_int = 73;
+pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20;
+pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21;
+pub const IPV6_RXHOPOPTS: ::c_int = 3;
+pub const IPV6_RXDSTOPTS: ::c_int = 4;
+pub const IPV6_RTHDR_LOOSE: ::c_int = 0;
+pub const IPV6_RTHDR_STRICT: ::c_int = 1;
+pub const IPV6_RTHDR_TYPE_0: ::c_int = 0;
+pub const IN_CLASSA_NET: u32 = 4278190080;
+pub const IN_CLASSA_NSHIFT: usize = 24;
+pub const IN_CLASSA_HOST: u32 = 16777215;
+pub const IN_CLASSA_MAX: u32 = 128;
+pub const IN_CLASSB_NET: u32 = 4294901760;
+pub const IN_CLASSB_NSHIFT: usize = 16;
+pub const IN_CLASSB_HOST: u32 = 65535;
+pub const IN_CLASSB_MAX: u32 = 65536;
+pub const IN_CLASSC_NET: u32 = 4294967040;
+pub const IN_CLASSC_NSHIFT: usize = 8;
+pub const IN_CLASSC_HOST: u32 = 255;
+pub const IN_LOOPBACKNET: u32 = 127;
+pub const INET_ADDRSTRLEN: usize = 16;
+pub const INET6_ADDRSTRLEN: usize = 46;
+
+// netinet/ip.h
+pub const IPTOS_TOS_MASK: u8 = 0x1E;
+pub const IPTOS_PREC_MASK: u8 = 0xE0;
+
+pub const IPTOS_ECN_NOT_ECT: u8 = 0x00;
+
+pub const IPTOS_LOWDELAY: u8 = 0x10;
+pub const IPTOS_THROUGHPUT: u8 = 0x08;
+pub const IPTOS_RELIABILITY: u8 = 0x04;
+pub const IPTOS_MINCOST: u8 = 0x02;
+
+pub const IPTOS_PREC_NETCONTROL: u8 = 0xe0;
+pub const IPTOS_PREC_INTERNETCONTROL: u8 = 0xc0;
+pub const IPTOS_PREC_CRITIC_ECP: u8 = 0xa0;
+pub const IPTOS_PREC_FLASHOVERRIDE: u8 = 0x80;
+pub const IPTOS_PREC_FLASH: u8 = 0x60;
+pub const IPTOS_PREC_IMMEDIATE: u8 = 0x40;
+pub const IPTOS_PREC_PRIORITY: u8 = 0x20;
+pub const IPTOS_PREC_ROUTINE: u8 = 0x00;
+
+pub const IPTOS_ECN_MASK: u8 = 0x03;
+pub const IPTOS_ECN_ECT1: u8 = 0x01;
+pub const IPTOS_ECN_ECT0: u8 = 0x02;
+pub const IPTOS_ECN_CE: u8 = 0x03;
+
+pub const IPOPT_COPY: u8 = 0x80;
+pub const IPOPT_CLASS_MASK: u8 = 0x60;
+pub const IPOPT_NUMBER_MASK: u8 = 0x1f;
+
+pub const IPOPT_CONTROL: u8 = 0x00;
+pub const IPOPT_RESERVED1: u8 = 0x20;
+pub const IPOPT_MEASUREMENT: u8 = 0x40;
+pub const IPOPT_RESERVED2: u8 = 0x60;
+pub const IPOPT_END: u8 = 0 | IPOPT_CONTROL;
+pub const IPOPT_NOOP: u8 = 1 | IPOPT_CONTROL;
+pub const IPOPT_SEC: u8 = 2 | IPOPT_CONTROL | IPOPT_COPY;
+pub const IPOPT_LSRR: u8 = 3 | IPOPT_CONTROL | IPOPT_COPY;
+pub const IPOPT_TIMESTAMP: u8 = 4 | IPOPT_MEASUREMENT;
+pub const IPOPT_RR: u8 = 7 | IPOPT_CONTROL;
+pub const IPOPT_SID: u8 = 8 | IPOPT_CONTROL | IPOPT_COPY;
+pub const IPOPT_SSRR: u8 = 9 | IPOPT_CONTROL | IPOPT_COPY;
+pub const IPOPT_RA: u8 = 20 | IPOPT_CONTROL | IPOPT_COPY;
+pub const IPVERSION: u8 = 4;
+pub const MAXTTL: u8 = 255;
+pub const IPDEFTTL: u8 = 64;
+pub const IPOPT_OPTVAL: u8 = 0;
+pub const IPOPT_OLEN: u8 = 1;
+pub const IPOPT_OFFSET: u8 = 2;
+pub const IPOPT_MINOFF: u8 = 4;
+pub const MAX_IPOPTLEN: u8 = 40;
+pub const IPOPT_NOP: u8 = IPOPT_NOOP;
+pub const IPOPT_EOL: u8 = IPOPT_END;
+pub const IPOPT_TS: u8 = IPOPT_TIMESTAMP;
+pub const IPOPT_TS_TSONLY: u8 = 0;
+pub const IPOPT_TS_TSANDADDR: u8 = 1;
+pub const IPOPT_TS_PRESPEC: u8 = 3;
+
+// net/if_arp.h
+pub const ARPOP_REQUEST: u16 = 1;
+pub const ARPOP_REPLY: u16 = 2;
+pub const ARPOP_RREQUEST: u16 = 3;
+pub const ARPOP_RREPLY: u16 = 4;
+pub const ARPOP_InREQUEST: u16 = 8;
+pub const ARPOP_InREPLY: u16 = 9;
+pub const ARPOP_NAK: u16 = 10;
+
+pub const MAX_ADDR_LEN: usize = 7;
+pub const ARPD_UPDATE: ::c_ushort = 0x01;
+pub const ARPD_LOOKUP: ::c_ushort = 0x02;
+pub const ARPD_FLUSH: ::c_ushort = 0x03;
+pub const ATF_MAGIC: ::c_int = 0x80;
+
+pub const ATF_NETMASK: ::c_int = 0x20;
+pub const ATF_DONTPUB: ::c_int = 0x40;
+
+pub const ARPHRD_NETROM: u16 = 0;
+pub const ARPHRD_ETHER: u16 = 1;
+pub const ARPHRD_EETHER: u16 = 2;
+pub const ARPHRD_AX25: u16 = 3;
+pub const ARPHRD_PRONET: u16 = 4;
+pub const ARPHRD_CHAOS: u16 = 5;
+pub const ARPHRD_IEEE802: u16 = 6;
+pub const ARPHRD_ARCNET: u16 = 7;
+pub const ARPHRD_APPLETLK: u16 = 8;
+pub const ARPHRD_DLCI: u16 = 15;
+pub const ARPHRD_ATM: u16 = 19;
+pub const ARPHRD_METRICOM: u16 = 23;
+pub const ARPHRD_IEEE1394: u16 = 24;
+pub const ARPHRD_EUI64: u16 = 27;
+pub const ARPHRD_INFINIBAND: u16 = 32;
+
+pub const ARPHRD_SLIP: u16 = 256;
+pub const ARPHRD_CSLIP: u16 = 257;
+pub const ARPHRD_SLIP6: u16 = 258;
+pub const ARPHRD_CSLIP6: u16 = 259;
+pub const ARPHRD_RSRVD: u16 = 260;
+pub const ARPHRD_ADAPT: u16 = 264;
+pub const ARPHRD_ROSE: u16 = 270;
+pub const ARPHRD_X25: u16 = 271;
+pub const ARPHRD_HWX25: u16 = 272;
+pub const ARPHRD_CAN: u16 = 280;
+pub const ARPHRD_PPP: u16 = 512;
+pub const ARPHRD_CISCO: u16 = 513;
+pub const ARPHRD_HDLC: u16 = ARPHRD_CISCO;
+pub const ARPHRD_LAPB: u16 = 516;
+pub const ARPHRD_DDCMP: u16 = 517;
+pub const ARPHRD_RAWHDLC: u16 = 518;
+
+pub const ARPHRD_TUNNEL: u16 = 768;
+pub const ARPHRD_TUNNEL6: u16 = 769;
+pub const ARPHRD_FRAD: u16 = 770;
+pub const ARPHRD_SKIP: u16 = 771;
+pub const ARPHRD_LOOPBACK: u16 = 772;
+pub const ARPHRD_LOCALTLK: u16 = 773;
+pub const ARPHRD_FDDI: u16 = 774;
+pub const ARPHRD_BIF: u16 = 775;
+pub const ARPHRD_SIT: u16 = 776;
+pub const ARPHRD_IPDDP: u16 = 777;
+pub const ARPHRD_IPGRE: u16 = 778;
+pub const ARPHRD_PIMREG: u16 = 779;
+pub const ARPHRD_HIPPI: u16 = 780;
+pub const ARPHRD_ASH: u16 = 781;
+pub const ARPHRD_ECONET: u16 = 782;
+pub const ARPHRD_IRDA: u16 = 783;
+pub const ARPHRD_FCPP: u16 = 784;
+pub const ARPHRD_FCAL: u16 = 785;
+pub const ARPHRD_FCPL: u16 = 786;
+pub const ARPHRD_FCFABRIC: u16 = 787;
+pub const ARPHRD_IEEE802_TR: u16 = 800;
+pub const ARPHRD_IEEE80211: u16 = 801;
+pub const ARPHRD_IEEE80211_PRISM: u16 = 802;
+pub const ARPHRD_IEEE80211_RADIOTAP: u16 = 803;
+pub const ARPHRD_IEEE802154: u16 = 804;
+
+pub const ARPHRD_VOID: u16 = 0xFFFF;
+pub const ARPHRD_NONE: u16 = 0xFFFE;
+
+// bits/posix1_lim.h
+pub const _POSIX_AIO_LISTIO_MAX: usize = 2;
+pub const _POSIX_AIO_MAX: usize = 1;
+pub const _POSIX_ARG_MAX: usize = 4096;
+pub const _POSIX_CHILD_MAX: usize = 25;
+pub const _POSIX_DELAYTIMER_MAX: usize = 32;
+pub const _POSIX_HOST_NAME_MAX: usize = 255;
+pub const _POSIX_LINK_MAX: usize = 8;
+pub const _POSIX_LOGIN_NAME_MAX: usize = 9;
+pub const _POSIX_MAX_CANON: usize = 255;
+pub const _POSIX_MAX_INPUT: usize = 255;
+pub const _POSIX_MQ_OPEN_MAX: usize = 8;
+pub const _POSIX_MQ_PRIO_MAX: usize = 32;
+pub const _POSIX_NAME_MAX: usize = 14;
+pub const _POSIX_NGROUPS_MAX: usize = 8;
+pub const _POSIX_OPEN_MAX: usize = 20;
+pub const _POSIX_FD_SETSIZE: usize = 20;
+pub const _POSIX_PATH_MAX: usize = 256;
+pub const _POSIX_PIPE_BUF: usize = 512;
+pub const _POSIX_RE_DUP_MAX: usize = 255;
+pub const _POSIX_RTSIG_MAX: usize = 8;
+pub const _POSIX_SEM_NSEMS_MAX: usize = 256;
+pub const _POSIX_SEM_VALUE_MAX: usize = 32767;
+pub const _POSIX_SIGQUEUE_MAX: usize = 32;
+pub const _POSIX_SSIZE_MAX: usize = 32767;
+pub const _POSIX_STREAM_MAX: usize = 8;
+pub const _POSIX_SYMLINK_MAX: usize = 255;
+pub const _POSIX_SYMLOOP_MAX: usize = 8;
+pub const _POSIX_TIMER_MAX: usize = 32;
+pub const _POSIX_TTY_NAME_MAX: usize = 9;
+pub const _POSIX_TZNAME_MAX: usize = 6;
+pub const _POSIX_QLIMIT: usize = 1;
+pub const _POSIX_HIWAT: usize = 512;
+pub const _POSIX_UIO_MAXIOV: usize = 16;
+pub const _POSIX_CLOCKRES_MIN: usize = 20000000;
+pub const NAME_MAX: usize = 255;
+pub const NGROUPS_MAX: usize = 256;
+pub const _POSIX_THREAD_KEYS_MAX: usize = 128;
+pub const _POSIX_THREAD_DESTRUCTOR_ITERATIONS: usize = 4;
+pub const _POSIX_THREAD_THREADS_MAX: usize = 64;
+pub const SEM_VALUE_MAX: ::c_int = 2147483647;
+pub const MAXNAMLEN: usize = 255;
+
+// netdb.h
+pub const _PATH_HEQUIV: &'static [u8; 17usize] = b"/etc/hosts.equiv\0";
+pub const _PATH_HOSTS: &'static [u8; 11usize] = b"/etc/hosts\0";
+pub const _PATH_NETWORKS: &'static [u8; 14usize] = b"/etc/networks\0";
+pub const _PATH_NSSWITCH_CONF: &'static [u8; 19usize] = b"/etc/nsswitch.conf\0";
+pub const _PATH_PROTOCOLS: &'static [u8; 15usize] = b"/etc/protocols\0";
+pub const _PATH_SERVICES: &'static [u8; 14usize] = b"/etc/services\0";
+pub const HOST_NOT_FOUND: ::c_int = 1;
+pub const TRY_AGAIN: ::c_int = 2;
+pub const NO_RECOVERY: ::c_int = 3;
+pub const NO_DATA: ::c_int = 4;
+pub const NETDB_INTERNAL: ::c_int = -1;
+pub const NETDB_SUCCESS: ::c_int = 0;
+pub const NO_ADDRESS: ::c_int = 4;
+pub const IPPORT_RESERVED: ::c_int = 1024;
+pub const SCOPE_DELIMITER: u8 = 37u8;
+pub const GAI_WAIT: ::c_int = 0;
+pub const GAI_NOWAIT: ::c_int = 1;
+pub const AI_PASSIVE: ::c_int = 1;
+pub const AI_CANONNAME: ::c_int = 2;
+pub const AI_NUMERICHOST: ::c_int = 4;
+pub const AI_V4MAPPED: ::c_int = 8;
+pub const AI_ALL: ::c_int = 16;
+pub const AI_ADDRCONFIG: ::c_int = 32;
+pub const AI_IDN: ::c_int = 64;
+pub const AI_CANONIDN: ::c_int = 128;
+pub const AI_NUMERICSERV: ::c_int = 1024;
+pub const EAI_BADFLAGS: ::c_int = -1;
+pub const EAI_NONAME: ::c_int = -2;
+pub const EAI_AGAIN: ::c_int = -3;
+pub const EAI_FAIL: ::c_int = -4;
+pub const EAI_FAMILY: ::c_int = -6;
+pub const EAI_SOCKTYPE: ::c_int = -7;
+pub const EAI_SERVICE: ::c_int = -8;
+pub const EAI_MEMORY: ::c_int = -10;
+pub const EAI_SYSTEM: ::c_int = -11;
+pub const EAI_OVERFLOW: ::c_int = -12;
+pub const EAI_NODATA: ::c_int = -5;
+pub const EAI_ADDRFAMILY: ::c_int = -9;
+pub const EAI_INPROGRESS: ::c_int = -100;
+pub const EAI_CANCELED: ::c_int = -101;
+pub const EAI_NOTCANCELED: ::c_int = -102;
+pub const EAI_ALLDONE: ::c_int = -103;
+pub const EAI_INTR: ::c_int = -104;
+pub const EAI_IDN_ENCODE: ::c_int = -105;
+pub const NI_MAXHOST: usize = 1025;
+pub const NI_MAXSERV: usize = 32;
+pub const NI_NUMERICHOST: ::c_int = 1;
+pub const NI_NUMERICSERV: ::c_int = 2;
+pub const NI_NOFQDN: ::c_int = 4;
+pub const NI_NAMEREQD: ::c_int = 8;
+pub const NI_DGRAM: ::c_int = 16;
+pub const NI_IDN: ::c_int = 32;
+
+// time.h
+pub const CLOCK_REALTIME: ::clockid_t = 0;
+pub const CLOCK_MONOTONIC: ::clockid_t = 1;
+pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
+pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 3;
+pub const CLOCK_MONOTONIC_RAW: ::clockid_t = 4;
+pub const CLOCK_REALTIME_COARSE: ::clockid_t = 5;
+pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = 6;
+pub const TIMER_ABSTIME: ::c_int = 1;
+pub const TIME_UTC: ::c_int = 1;
+
+// sys/poll.h
+pub const POLLIN: i16 = 1;
+pub const POLLPRI: i16 = 2;
+pub const POLLOUT: i16 = 4;
+pub const POLLRDNORM: i16 = 1;
+pub const POLLRDBAND: i16 = 2;
+pub const POLLWRNORM: i16 = 4;
+pub const POLLWRBAND: i16 = 4;
+pub const POLLERR: i16 = 8;
+pub const POLLHUP: i16 = 16;
+pub const POLLNVAL: i16 = 32;
+
+// locale.h
+pub const __LC_CTYPE: usize = 0;
+pub const __LC_NUMERIC: usize = 1;
+pub const __LC_TIME: usize = 2;
+pub const __LC_COLLATE: usize = 3;
+pub const __LC_MONETARY: usize = 4;
+pub const __LC_MESSAGES: usize = 5;
+pub const __LC_ALL: usize = 6;
+pub const __LC_PAPER: usize = 7;
+pub const __LC_NAME: usize = 8;
+pub const __LC_ADDRESS: usize = 9;
+pub const __LC_TELEPHONE: usize = 10;
+pub const __LC_MEASUREMENT: usize = 11;
+pub const __LC_IDENTIFICATION: usize = 12;
+pub const LC_CTYPE: ::c_int = 0;
+pub const LC_NUMERIC: ::c_int = 1;
+pub const LC_TIME: ::c_int = 2;
+pub const LC_COLLATE: ::c_int = 3;
+pub const LC_MONETARY: ::c_int = 4;
+pub const LC_MESSAGES: ::c_int = 5;
+pub const LC_ALL: ::c_int = 6;
+pub const LC_PAPER: ::c_int = 7;
+pub const LC_NAME: ::c_int = 8;
+pub const LC_ADDRESS: ::c_int = 9;
+pub const LC_TELEPHONE: ::c_int = 10;
+pub const LC_MEASUREMENT: ::c_int = 11;
+pub const LC_IDENTIFICATION: ::c_int = 12;
+pub const LC_CTYPE_MASK: ::c_int = 1;
+pub const LC_NUMERIC_MASK: ::c_int = 2;
+pub const LC_TIME_MASK: ::c_int = 4;
+pub const LC_COLLATE_MASK: ::c_int = 8;
+pub const LC_MONETARY_MASK: ::c_int = 16;
+pub const LC_MESSAGES_MASK: ::c_int = 32;
+pub const LC_PAPER_MASK: ::c_int = 128;
+pub const LC_NAME_MASK: ::c_int = 256;
+pub const LC_ADDRESS_MASK: ::c_int = 512;
+pub const LC_TELEPHONE_MASK: ::c_int = 1024;
+pub const LC_MEASUREMENT_MASK: ::c_int = 2048;
+pub const LC_IDENTIFICATION_MASK: ::c_int = 4096;
+pub const LC_ALL_MASK: ::c_int = 8127;
+
+pub const ABDAY_1: ::nl_item = 0x20000;
+pub const ABDAY_2: ::nl_item = 0x20001;
+pub const ABDAY_3: ::nl_item = 0x20002;
+pub const ABDAY_4: ::nl_item = 0x20003;
+pub const ABDAY_5: ::nl_item = 0x20004;
+pub const ABDAY_6: ::nl_item = 0x20005;
+pub const ABDAY_7: ::nl_item = 0x20006;
+
+pub const DAY_1: ::nl_item = 0x20007;
+pub const DAY_2: ::nl_item = 0x20008;
+pub const DAY_3: ::nl_item = 0x20009;
+pub const DAY_4: ::nl_item = 0x2000A;
+pub const DAY_5: ::nl_item = 0x2000B;
+pub const DAY_6: ::nl_item = 0x2000C;
+pub const DAY_7: ::nl_item = 0x2000D;
+
+pub const ABMON_1: ::nl_item = 0x2000E;
+pub const ABMON_2: ::nl_item = 0x2000F;
+pub const ABMON_3: ::nl_item = 0x20010;
+pub const ABMON_4: ::nl_item = 0x20011;
+pub const ABMON_5: ::nl_item = 0x20012;
+pub const ABMON_6: ::nl_item = 0x20013;
+pub const ABMON_7: ::nl_item = 0x20014;
+pub const ABMON_8: ::nl_item = 0x20015;
+pub const ABMON_9: ::nl_item = 0x20016;
+pub const ABMON_10: ::nl_item = 0x20017;
+pub const ABMON_11: ::nl_item = 0x20018;
+pub const ABMON_12: ::nl_item = 0x20019;
+
+pub const MON_1: ::nl_item = 0x2001A;
+pub const MON_2: ::nl_item = 0x2001B;
+pub const MON_3: ::nl_item = 0x2001C;
+pub const MON_4: ::nl_item = 0x2001D;
+pub const MON_5: ::nl_item = 0x2001E;
+pub const MON_6: ::nl_item = 0x2001F;
+pub const MON_7: ::nl_item = 0x20020;
+pub const MON_8: ::nl_item = 0x20021;
+pub const MON_9: ::nl_item = 0x20022;
+pub const MON_10: ::nl_item = 0x20023;
+pub const MON_11: ::nl_item = 0x20024;
+pub const MON_12: ::nl_item = 0x20025;
+
+pub const AM_STR: ::nl_item = 0x20026;
+pub const PM_STR: ::nl_item = 0x20027;
+
+pub const D_T_FMT: ::nl_item = 0x20028;
+pub const D_FMT: ::nl_item = 0x20029;
+pub const T_FMT: ::nl_item = 0x2002A;
+pub const T_FMT_AMPM: ::nl_item = 0x2002B;
+
+pub const ERA: ::nl_item = 0x2002C;
+pub const ERA_D_FMT: ::nl_item = 0x2002E;
+pub const ALT_DIGITS: ::nl_item = 0x2002F;
+pub const ERA_D_T_FMT: ::nl_item = 0x20030;
+pub const ERA_T_FMT: ::nl_item = 0x20031;
+
+pub const CODESET: ::nl_item = 14;
+pub const CRNCYSTR: ::nl_item = 0x4000F;
+pub const RADIXCHAR: ::nl_item = 0x10000;
+pub const THOUSEP: ::nl_item = 0x10001;
+pub const YESEXPR: ::nl_item = 0x50000;
+pub const NOEXPR: ::nl_item = 0x50001;
+pub const YESSTR: ::nl_item = 0x50002;
+pub const NOSTR: ::nl_item = 0x50003;
+
+// reboot.h
+pub const RB_AUTOBOOT: ::c_int = 0x0;
+pub const RB_ASKNAME: ::c_int = 0x1;
+pub const RB_SINGLE: ::c_int = 0x2;
+pub const RB_KBD: ::c_int = 0x4;
+pub const RB_HALT: ::c_int = 0x8;
+pub const RB_INITNAME: ::c_int = 0x10;
+pub const RB_DFLTROOT: ::c_int = 0x20;
+pub const RB_NOBOOTRC: ::c_int = 0x20;
+pub const RB_ALTBOOT: ::c_int = 0x40;
+pub const RB_UNIPROC: ::c_int = 0x80;
+pub const RB_DEBUGGER: ::c_int = 0x1000;
+
+// semaphore.h
+pub const __SIZEOF_SEM_T: usize = 20;
+pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t;
+
+// termios.h
+pub const IGNBRK: ::tcflag_t = 1;
+pub const BRKINT: ::tcflag_t = 2;
+pub const IGNPAR: ::tcflag_t = 4;
+pub const PARMRK: ::tcflag_t = 8;
+pub const INPCK: ::tcflag_t = 16;
+pub const ISTRIP: ::tcflag_t = 32;
+pub const INLCR: ::tcflag_t = 64;
+pub const IGNCR: ::tcflag_t = 128;
+pub const ICRNL: ::tcflag_t = 256;
+pub const IXON: ::tcflag_t = 512;
+pub const IXOFF: ::tcflag_t = 1024;
+pub const IXANY: ::tcflag_t = 2048;
+pub const IMAXBEL: ::tcflag_t = 8192;
+pub const IUCLC: ::tcflag_t = 16384;
+pub const OPOST: ::tcflag_t = 1;
+pub const ONLCR: ::tcflag_t = 2;
+pub const ONOEOT: ::tcflag_t = 8;
+pub const OCRNL: ::tcflag_t = 16;
+pub const ONOCR: ::tcflag_t = 32;
+pub const ONLRET: ::tcflag_t = 64;
+pub const NLDLY: ::tcflag_t = 768;
+pub const NL0: ::tcflag_t = 0;
+pub const NL1: ::tcflag_t = 256;
+pub const TABDLY: ::tcflag_t = 3076;
+pub const TAB0: ::tcflag_t = 0;
+pub const TAB1: ::tcflag_t = 1024;
+pub const TAB2: ::tcflag_t = 2048;
+pub const TAB3: ::tcflag_t = 4;
+pub const CRDLY: ::tcflag_t = 12288;
+pub const CR0: ::tcflag_t = 0;
+pub const CR1: ::tcflag_t = 4096;
+pub const CR2: ::tcflag_t = 8192;
+pub const CR3: ::tcflag_t = 12288;
+pub const FFDLY: ::tcflag_t = 16384;
+pub const FF0: ::tcflag_t = 0;
+pub const FF1: ::tcflag_t = 16384;
+pub const BSDLY: ::tcflag_t = 32768;
+pub const BS0: ::tcflag_t = 0;
+pub const BS1: ::tcflag_t = 32768;
+pub const VTDLY: ::tcflag_t = 65536;
+pub const VT0: ::tcflag_t = 0;
+pub const VT1: ::tcflag_t = 65536;
+pub const OLCUC: ::tcflag_t = 131072;
+pub const OFILL: ::tcflag_t = 262144;
+pub const OFDEL: ::tcflag_t = 524288;
+pub const CIGNORE: ::tcflag_t = 1;
+pub const CSIZE: ::tcflag_t = 768;
+pub const CS5: ::tcflag_t = 0;
+pub const CS6: ::tcflag_t = 256;
+pub const CS7: ::tcflag_t = 512;
+pub const CS8: ::tcflag_t = 768;
+pub const CSTOPB: ::tcflag_t = 1024;
+pub const CREAD: ::tcflag_t = 2048;
+pub const PARENB: ::tcflag_t = 4096;
+pub const PARODD: ::tcflag_t = 8192;
+pub const HUPCL: ::tcflag_t = 16384;
+pub const CLOCAL: ::tcflag_t = 32768;
+pub const CRTSCTS: ::tcflag_t = 65536;
+pub const CRTS_IFLOW: ::tcflag_t = 65536;
+pub const CCTS_OFLOW: ::tcflag_t = 65536;
+pub const CDTRCTS: ::tcflag_t = 131072;
+pub const MDMBUF: ::tcflag_t = 1048576;
+pub const CHWFLOW: ::tcflag_t = 1245184;
+pub const ECHOKE: ::tcflag_t = 1;
+pub const _ECHOE: ::tcflag_t = 2;
+pub const ECHOE: ::tcflag_t = 2;
+pub const _ECHOK: ::tcflag_t = 4;
+pub const ECHOK: ::tcflag_t = 4;
+pub const _ECHO: ::tcflag_t = 8;
+pub const ECHO: ::tcflag_t = 8;
+pub const _ECHONL: ::tcflag_t = 16;
+pub const ECHONL: ::tcflag_t = 16;
+pub const ECHOPRT: ::tcflag_t = 32;
+pub const ECHOCTL: ::tcflag_t = 64;
+pub const _ISIG: ::tcflag_t = 128;
+pub const ISIG: ::tcflag_t = 128;
+pub const _ICANON: ::tcflag_t = 256;
+pub const ICANON: ::tcflag_t = 256;
+pub const ALTWERASE: ::tcflag_t = 512;
+pub const _IEXTEN: ::tcflag_t = 1024;
+pub const IEXTEN: ::tcflag_t = 1024;
+pub const EXTPROC: ::tcflag_t = 2048;
+pub const _TOSTOP: ::tcflag_t = 4194304;
+pub const TOSTOP: ::tcflag_t = 4194304;
+pub const FLUSHO: ::tcflag_t = 8388608;
+pub const NOKERNINFO: ::tcflag_t = 33554432;
+pub const PENDIN: ::tcflag_t = 536870912;
+pub const _NOFLSH: ::tcflag_t = 2147483648;
+pub const NOFLSH: ::tcflag_t = 2147483648;
+pub const VEOF: usize = 0;
+pub const VEOL: usize = 1;
+pub const VEOL2: usize = 2;
+pub const VERASE: usize = 3;
+pub const VWERASE: usize = 4;
+pub const VKILL: usize = 5;
+pub const VREPRINT: usize = 6;
+pub const VINTR: usize = 8;
+pub const VQUIT: usize = 9;
+pub const VSUSP: usize = 10;
+pub const VDSUSP: usize = 11;
+pub const VSTART: usize = 12;
+pub const VSTOP: usize = 13;
+pub const VLNEXT: usize = 14;
+pub const VDISCARD: usize = 15;
+pub const VMIN: usize = 16;
+pub const VTIME: usize = 17;
+pub const VSTATUS: usize = 18;
+pub const NCCS: usize = 20;
+pub const B0: ::speed_t = 0;
+pub const B50: ::speed_t = 50;
+pub const B75: ::speed_t = 75;
+pub const B110: ::speed_t = 110;
+pub const B134: ::speed_t = 134;
+pub const B150: ::speed_t = 150;
+pub const B200: ::speed_t = 200;
+pub const B300: ::speed_t = 300;
+pub const B600: ::speed_t = 600;
+pub const B1200: ::speed_t = 1200;
+pub const B1800: ::speed_t = 1800;
+pub const B2400: ::speed_t = 2400;
+pub const B4800: ::speed_t = 4800;
+pub const B9600: ::speed_t = 9600;
+pub const B7200: ::speed_t = 7200;
+pub const B14400: ::speed_t = 14400;
+pub const B19200: ::speed_t = 19200;
+pub const B28800: ::speed_t = 28800;
+pub const B38400: ::speed_t = 38400;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 57600;
+pub const B76800: ::speed_t = 76800;
+pub const B115200: ::speed_t = 115200;
+pub const B230400: ::speed_t = 230400;
+pub const B460800: ::speed_t = 460800;
+pub const B500000: ::speed_t = 500000;
+pub const B576000: ::speed_t = 576000;
+pub const B921600: ::speed_t = 921600;
+pub const B1000000: ::speed_t = 1000000;
+pub const B1152000: ::speed_t = 1152000;
+pub const B1500000: ::speed_t = 1500000;
+pub const B2000000: ::speed_t = 2000000;
+pub const B2500000: ::speed_t = 2500000;
+pub const B3000000: ::speed_t = 3000000;
+pub const B3500000: ::speed_t = 3500000;
+pub const B4000000: ::speed_t = 4000000;
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+pub const TCSASOFT: ::c_int = 16;
+pub const TCIFLUSH: ::c_int = 1;
+pub const TCOFLUSH: ::c_int = 2;
+pub const TCIOFLUSH: ::c_int = 3;
+pub const TCOOFF: ::c_int = 1;
+pub const TCOON: ::c_int = 2;
+pub const TCIOFF: ::c_int = 3;
+pub const TCION: ::c_int = 4;
+pub const TTYDEF_IFLAG: ::tcflag_t = 11042;
+pub const TTYDEF_LFLAG: ::tcflag_t = 1483;
+pub const TTYDEF_CFLAG: ::tcflag_t = 23040;
+pub const TTYDEF_SPEED: ::tcflag_t = 9600;
+pub const CEOL: u8 = 0u8;
+pub const CERASE: u8 = 127;
+pub const CMIN: u8 = 1;
+pub const CQUIT: u8 = 28;
+pub const CTIME: u8 = 0;
+pub const CBRK: u8 = 0u8;
+
+// dlfcn.h
+pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
+pub const RTLD_NEXT: *mut ::c_void = -1i64 as *mut ::c_void;
+pub const RTLD_LAZY: ::c_int = 1;
+pub const RTLD_NOW: ::c_int = 2;
+pub const RTLD_BINDING_MASK: ::c_int = 3;
+pub const RTLD_NOLOAD: ::c_int = 4;
+pub const RTLD_DEEPBIND: ::c_int = 8;
+pub const RTLD_GLOBAL: ::c_int = 256;
+pub const RTLD_LOCAL: ::c_int = 0;
+pub const RTLD_NODELETE: ::c_int = 4096;
+pub const DLFO_STRUCT_HAS_EH_DBASE: usize = 1;
+pub const DLFO_STRUCT_HAS_EH_COUNT: usize = 0;
+pub const LM_ID_BASE: c_long = 0;
+pub const LM_ID_NEWLM: c_long = -1;
+
+// bits/signum_generic.h
+pub const SIGINT: ::c_int = 2;
+pub const SIGILL: ::c_int = 4;
+pub const SIGABRT: ::c_int = 6;
+pub const SIGFPE: ::c_int = 8;
+pub const SIGSEGV: ::c_int = 11;
+pub const SIGTERM: ::c_int = 15;
+pub const SIGHUP: ::c_int = 1;
+pub const SIGQUIT: ::c_int = 3;
+pub const SIGTRAP: ::c_int = 5;
+pub const SIGKILL: ::c_int = 9;
+pub const SIGPIPE: ::c_int = 13;
+pub const SIGALRM: ::c_int = 14;
+pub const SIGIOT: ::c_int = 6;
+pub const SIGBUS: ::c_int = 10;
+pub const SIGSYS: ::c_int = 12;
+pub const SIGEMT: ::c_int = 7;
+pub const SIGINFO: ::c_int = 29;
+pub const SIGLOST: ::c_int = 32;
+pub const SIGURG: ::c_int = 16;
+pub const SIGSTOP: ::c_int = 17;
+pub const SIGTSTP: ::c_int = 18;
+pub const SIGCONT: ::c_int = 19;
+pub const SIGCHLD: ::c_int = 20;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGPOLL: ::c_int = 23;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGUSR1: ::c_int = 30;
+pub const SIGUSR2: ::c_int = 31;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGIO: ::c_int = 23;
+pub const SIGCLD: ::c_int = 20;
+pub const __SIGRTMIN: usize = 32;
+pub const __SIGRTMAX: usize = 32;
+pub const _NSIG: usize = 33;
+pub const NSIG: usize = 33;
+
+// bits/sigaction.h
+pub const SA_ONSTACK: ::c_int = 1;
+pub const SA_RESTART: ::c_int = 2;
+pub const SA_NODEFER: ::c_int = 16;
+pub const SA_RESETHAND: ::c_int = 4;
+pub const SA_NOCLDSTOP: ::c_int = 8;
+pub const SA_SIGINFO: ::c_int = 64;
+pub const SA_INTERRUPT: ::c_int = 0;
+pub const SA_NOMASK: ::c_int = 16;
+pub const SA_ONESHOT: ::c_int = 4;
+pub const SA_STACK: ::c_int = 1;
+pub const SIG_BLOCK: ::c_int = 1;
+pub const SIG_UNBLOCK: ::c_int = 2;
+pub const SIG_SETMASK: ::c_int = 3;
+
+// bits/sigcontext.h
+pub const FPC_IE: u16 = 1;
+pub const FPC_IM: u16 = 1;
+pub const FPC_DE: u16 = 2;
+pub const FPC_DM: u16 = 2;
+pub const FPC_ZE: u16 = 4;
+pub const FPC_ZM: u16 = 4;
+pub const FPC_OE: u16 = 8;
+pub const FPC_OM: u16 = 8;
+pub const FPC_UE: u16 = 16;
+pub const FPC_PE: u16 = 32;
+pub const FPC_PC: u16 = 768;
+pub const FPC_PC_24: u16 = 0;
+pub const FPC_PC_53: u16 = 512;
+pub const FPC_PC_64: u16 = 768;
+pub const FPC_RC: u16 = 3072;
+pub const FPC_RC_RN: u16 = 0;
+pub const FPC_RC_RD: u16 = 1024;
+pub const FPC_RC_RU: u16 = 2048;
+pub const FPC_RC_CHOP: u16 = 3072;
+pub const FPC_IC: u16 = 4096;
+pub const FPC_IC_PROJ: u16 = 0;
+pub const FPC_IC_AFF: u16 = 4096;
+pub const FPS_IE: u16 = 1;
+pub const FPS_DE: u16 = 2;
+pub const FPS_ZE: u16 = 4;
+pub const FPS_OE: u16 = 8;
+pub const FPS_UE: u16 = 16;
+pub const FPS_PE: u16 = 32;
+pub const FPS_SF: u16 = 64;
+pub const FPS_ES: u16 = 128;
+pub const FPS_C0: u16 = 256;
+pub const FPS_C1: u16 = 512;
+pub const FPS_C2: u16 = 1024;
+pub const FPS_TOS: u16 = 14336;
+pub const FPS_TOS_SHIFT: u16 = 11;
+pub const FPS_C3: u16 = 16384;
+pub const FPS_BUSY: u16 = 32768;
+pub const FPE_INTOVF_TRAP: ::c_int = 1;
+pub const FPE_INTDIV_FAULT: ::c_int = 2;
+pub const FPE_FLTOVF_FAULT: ::c_int = 3;
+pub const FPE_FLTDIV_FAULT: ::c_int = 4;
+pub const FPE_FLTUND_FAULT: ::c_int = 5;
+pub const FPE_SUBRNG_FAULT: ::c_int = 7;
+pub const FPE_FLTDNR_FAULT: ::c_int = 8;
+pub const FPE_FLTINX_FAULT: ::c_int = 9;
+pub const FPE_EMERR_FAULT: ::c_int = 10;
+pub const FPE_EMBND_FAULT: ::c_int = 11;
+pub const ILL_INVOPR_FAULT: ::c_int = 1;
+pub const ILL_STACK_FAULT: ::c_int = 2;
+pub const ILL_FPEOPR_FAULT: ::c_int = 3;
+pub const DBG_SINGLE_TRAP: ::c_int = 1;
+pub const DBG_BRKPNT_FAULT: ::c_int = 2;
+pub const __NGREG: usize = 19;
+pub const NGREG: usize = 19;
+
+// bits/sigstack.h
+pub const MINSIGSTKSZ: usize = 8192;
+pub const SIGSTKSZ: usize = 40960;
+
+// sys/stat.h
+pub const __S_IFMT: mode_t = 61440;
+pub const __S_IFDIR: mode_t = 16384;
+pub const __S_IFCHR: mode_t = 8192;
+pub const __S_IFBLK: mode_t = 24576;
+pub const __S_IFREG: mode_t = 32768;
+pub const __S_IFLNK: mode_t = 40960;
+pub const __S_IFSOCK: mode_t = 49152;
+pub const __S_IFIFO: mode_t = 4096;
+pub const __S_ISUID: mode_t = 2048;
+pub const __S_ISGID: mode_t = 1024;
+pub const __S_ISVTX: mode_t = 512;
+pub const __S_IREAD: mode_t = 256;
+pub const __S_IWRITE: mode_t = 128;
+pub const __S_IEXEC: mode_t = 64;
+pub const S_INOCACHE: mode_t = 65536;
+pub const S_IUSEUNK: mode_t = 131072;
+pub const S_IUNKNOWN: mode_t = 1835008;
+pub const S_IUNKSHIFT: mode_t = 12;
+pub const S_IPTRANS: mode_t = 2097152;
+pub const S_IATRANS: mode_t = 4194304;
+pub const S_IROOT: mode_t = 8388608;
+pub const S_ITRANS: mode_t = 14680064;
+pub const S_IMMAP0: mode_t = 16777216;
+pub const CMASK: mode_t = 18;
+pub const UF_SETTABLE: ::c_uint = 65535;
+pub const UF_NODUMP: ::c_uint = 1;
+pub const UF_IMMUTABLE: ::c_uint = 2;
+pub const UF_APPEND: ::c_uint = 4;
+pub const UF_OPAQUE: ::c_uint = 8;
+pub const UF_NOUNLINK: ::c_uint = 16;
+pub const SF_SETTABLE: ::c_uint = 4294901760;
+pub const SF_ARCHIVED: ::c_uint = 65536;
+pub const SF_IMMUTABLE: ::c_uint = 131072;
+pub const SF_APPEND: ::c_uint = 262144;
+pub const SF_NOUNLINK: ::c_uint = 1048576;
+pub const SF_SNAPSHOT: ::c_uint = 2097152;
+pub const UTIME_NOW: ::c_long = -1;
+pub const UTIME_OMIT: ::c_long = -2;
+pub const S_IFMT: ::mode_t = 61440;
+pub const S_IFDIR: ::mode_t = 16384;
+pub const S_IFCHR: ::mode_t = 8192;
+pub const S_IFBLK: ::mode_t = 24576;
+pub const S_IFREG: ::mode_t = 32768;
+pub const S_IFIFO: ::mode_t = 4096;
+pub const S_IFLNK: ::mode_t = 40960;
+pub const S_IFSOCK: ::mode_t = 49152;
+pub const S_ISUID: ::mode_t = 2048;
+pub const S_ISGID: ::mode_t = 1024;
+pub const S_ISVTX: ::mode_t = 512;
+pub const S_IRUSR: ::mode_t = 256;
+pub const S_IWUSR: ::mode_t = 128;
+pub const S_IXUSR: ::mode_t = 64;
+pub const S_IRWXU: ::mode_t = 448;
+pub const S_IREAD: ::mode_t = 256;
+pub const S_IWRITE: ::mode_t = 128;
+pub const S_IEXEC: ::mode_t = 64;
+pub const S_IRGRP: ::mode_t = 32;
+pub const S_IWGRP: ::mode_t = 16;
+pub const S_IXGRP: ::mode_t = 8;
+pub const S_IRWXG: ::mode_t = 56;
+pub const S_IROTH: ::mode_t = 4;
+pub const S_IWOTH: ::mode_t = 2;
+pub const S_IXOTH: ::mode_t = 1;
+pub const S_IRWXO: ::mode_t = 7;
+pub const ACCESSPERMS: ::mode_t = 511;
+pub const ALLPERMS: ::mode_t = 4095;
+pub const DEFFILEMODE: ::mode_t = 438;
+pub const S_BLKSIZE: usize = 512;
+pub const STATX_TYPE: ::c_uint = 1;
+pub const STATX_MODE: ::c_uint = 2;
+pub const STATX_NLINK: ::c_uint = 4;
+pub const STATX_UID: ::c_uint = 8;
+pub const STATX_GID: ::c_uint = 16;
+pub const STATX_ATIME: ::c_uint = 32;
+pub const STATX_MTIME: ::c_uint = 64;
+pub const STATX_CTIME: ::c_uint = 128;
+pub const STATX_INO: ::c_uint = 256;
+pub const STATX_SIZE: ::c_uint = 512;
+pub const STATX_BLOCKS: ::c_uint = 1024;
+pub const STATX_BASIC_STATS: ::c_uint = 2047;
+pub const STATX_ALL: ::c_uint = 4095;
+pub const STATX_BTIME: ::c_uint = 2048;
+pub const STATX_MNT_ID: ::c_uint = 4096;
+pub const STATX_DIOALIGN: ::c_uint = 8192;
+pub const STATX__RESERVED: ::c_uint = 2147483648;
+pub const STATX_ATTR_COMPRESSED: ::c_uint = 4;
+pub const STATX_ATTR_IMMUTABLE: ::c_uint = 16;
+pub const STATX_ATTR_APPEND: ::c_uint = 32;
+pub const STATX_ATTR_NODUMP: ::c_uint = 64;
+pub const STATX_ATTR_ENCRYPTED: ::c_uint = 2048;
+pub const STATX_ATTR_AUTOMOUNT: ::c_uint = 4096;
+pub const STATX_ATTR_MOUNT_ROOT: ::c_uint = 8192;
+pub const STATX_ATTR_VERITY: ::c_uint = 1048576;
+pub const STATX_ATTR_DAX: ::c_uint = 2097152;
+
+// sys/ioctl.h
+pub const TIOCM_LE: ::c_int = 1;
+pub const TIOCM_DTR: ::c_int = 2;
+pub const TIOCM_RTS: ::c_int = 4;
+pub const TIOCM_ST: ::c_int = 8;
+pub const TIOCM_SR: ::c_int = 16;
+pub const TIOCM_CTS: ::c_int = 32;
+pub const TIOCM_CAR: ::c_int = 64;
+pub const TIOCM_CD: ::c_int = 64;
+pub const TIOCM_RNG: ::c_int = 128;
+pub const TIOCM_RI: ::c_int = 128;
+pub const TIOCM_DSR: ::c_int = 256;
+pub const TIOCPKT_DATA: ::c_int = 0;
+pub const TIOCPKT_FLUSHREAD: ::c_int = 1;
+pub const TIOCPKT_FLUSHWRITE: ::c_int = 2;
+pub const TIOCPKT_STOP: ::c_int = 4;
+pub const TIOCPKT_START: ::c_int = 8;
+pub const TIOCPKT_NOSTOP: ::c_int = 16;
+pub const TIOCPKT_DOSTOP: ::c_int = 32;
+pub const TIOCPKT_IOCTL: ::c_int = 64;
+pub const TTYDISC: ::c_int = 0;
+pub const TABLDISC: ::c_int = 3;
+pub const SLIPDISC: ::c_int = 4;
+pub const TANDEM: ::tcflag_t = 1;
+pub const CBREAK: ::tcflag_t = 2;
+pub const LCASE: ::tcflag_t = 4;
+pub const CRMOD: ::tcflag_t = 16;
+pub const RAW: ::tcflag_t = 32;
+pub const ODDP: ::tcflag_t = 64;
+pub const EVENP: ::tcflag_t = 128;
+pub const ANYP: ::tcflag_t = 192;
+pub const NLDELAY: ::tcflag_t = 768;
+pub const NL2: ::tcflag_t = 512;
+pub const NL3: ::tcflag_t = 768;
+pub const TBDELAY: ::tcflag_t = 3072;
+pub const XTABS: ::tcflag_t = 3072;
+pub const CRDELAY: ::tcflag_t = 12288;
+pub const VTDELAY: ::tcflag_t = 16384;
+pub const BSDELAY: ::tcflag_t = 32768;
+pub const ALLDELAY: ::tcflag_t = 65280;
+pub const CRTBS: ::tcflag_t = 65536;
+pub const PRTERA: ::tcflag_t = 131072;
+pub const CRTERA: ::tcflag_t = 262144;
+pub const TILDE: ::tcflag_t = 524288;
+pub const LITOUT: ::tcflag_t = 2097152;
+pub const NOHANG: ::tcflag_t = 16777216;
+pub const L001000: ::tcflag_t = 33554432;
+pub const CRTKIL: ::tcflag_t = 67108864;
+pub const PASS8: ::tcflag_t = 134217728;
+pub const CTLECH: ::tcflag_t = 268435456;
+pub const DECCTQ: ::tcflag_t = 1073741824;
+
+pub const FIONBIO: ::c_ulong = 0xa008007e;
+pub const FIONREAD: ::c_ulong = 0x6008007f;
+pub const TIOCSWINSZ: ::c_ulong = 0x90200767;
+pub const TIOCGWINSZ: ::c_ulong = 0x50200768;
+pub const TIOCEXCL: ::c_ulong = 0x70d;
+pub const TIOCNXCL: ::c_ulong = 0x70e;
+pub const TIOCSCTTY: ::c_ulong = 0x761;
+
+pub const FIOCLEX: ::c_ulong = 1;
+
+// fcntl.h
+pub const O_EXEC: ::c_int = 4;
+pub const O_NORW: ::c_int = 0;
+pub const O_RDONLY: ::c_int = 1;
+pub const O_WRONLY: ::c_int = 2;
+pub const O_RDWR: ::c_int = 3;
+pub const O_ACCMODE: ::c_int = 3;
+pub const O_LARGEFILE: ::c_int = 0;
+pub const O_CREAT: ::c_int = 16;
+pub const O_EXCL: ::c_int = 32;
+pub const O_NOLINK: ::c_int = 64;
+pub const O_NOTRANS: ::c_int = 128;
+pub const O_NOFOLLOW: ::c_int = 1048576;
+pub const O_DIRECTORY: ::c_int = 2097152;
+pub const O_APPEND: ::c_int = 256;
+pub const O_ASYNC: ::c_int = 512;
+pub const O_FSYNC: ::c_int = 1024;
+pub const O_SYNC: ::c_int = 1024;
+pub const O_NOATIME: ::c_int = 2048;
+pub const O_SHLOCK: ::c_int = 131072;
+pub const O_EXLOCK: ::c_int = 262144;
+pub const O_DSYNC: ::c_int = 1024;
+pub const O_RSYNC: ::c_int = 1024;
+pub const O_NONBLOCK: ::c_int = 8;
+pub const O_NDELAY: ::c_int = 8;
+pub const O_HURD: ::c_int = 458751;
+pub const O_TRUNC: ::c_int = 65536;
+pub const O_CLOEXEC: ::c_int = 4194304;
+pub const O_IGNORE_CTTY: ::c_int = 524288;
+pub const O_TMPFILE: ::c_int = 8388608;
+pub const O_NOCTTY: ::c_int = 0;
+pub const FREAD: ::c_int = 1;
+pub const FWRITE: ::c_int = 2;
+pub const FASYNC: ::c_int = 512;
+pub const FCREAT: ::c_int = 16;
+pub const FEXCL: ::c_int = 32;
+pub const FTRUNC: ::c_int = 65536;
+pub const FNOCTTY: ::c_int = 0;
+pub const FFSYNC: ::c_int = 1024;
+pub const FSYNC: ::c_int = 1024;
+pub const FAPPEND: ::c_int = 256;
+pub const FNONBLOCK: ::c_int = 8;
+pub const FNDELAY: ::c_int = 8;
+pub const F_DUPFD: ::c_int = 0;
+pub const F_GETFD: ::c_int = 1;
+pub const F_SETFD: ::c_int = 2;
+pub const F_GETFL: ::c_int = 3;
+pub const F_SETFL: ::c_int = 4;
+pub const F_GETOWN: ::c_int = 5;
+pub const F_SETOWN: ::c_int = 6;
+pub const F_GETLK: ::c_int = 7;
+pub const F_SETLK: ::c_int = 8;
+pub const F_SETLKW: ::c_int = 9;
+pub const F_GETLK64: ::c_int = 10;
+pub const F_SETLK64: ::c_int = 11;
+pub const F_SETLKW64: ::c_int = 12;
+pub const F_DUPFD_CLOEXEC: ::c_int = 1030;
+pub const FD_CLOEXEC: ::c_int = 1;
+pub const F_RDLCK: ::c_int = 1;
+pub const F_WRLCK: ::c_int = 2;
+pub const F_UNLCK: ::c_int = 3;
+pub const POSIX_FADV_NORMAL: ::c_int = 0;
+pub const POSIX_FADV_RANDOM: ::c_int = 1;
+pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
+pub const POSIX_FADV_WILLNEED: ::c_int = 3;
+pub const POSIX_FADV_DONTNEED: ::c_int = 4;
+pub const POSIX_FADV_NOREUSE: ::c_int = 5;
+pub const AT_FDCWD: ::c_int = -100;
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 256;
+pub const AT_REMOVEDIR: ::c_int = 512;
+pub const AT_SYMLINK_FOLLOW: ::c_int = 1024;
+pub const AT_NO_AUTOMOUNT: ::c_int = 2048;
+pub const AT_EMPTY_PATH: ::c_int = 4096;
+pub const AT_STATX_SYNC_TYPE: ::c_int = 24576;
+pub const AT_STATX_SYNC_AS_STAT: ::c_int = 0;
+pub const AT_STATX_FORCE_SYNC: ::c_int = 8192;
+pub const AT_STATX_DONT_SYNC: ::c_int = 16384;
+pub const AT_RECURSIVE: ::c_int = 32768;
+pub const AT_EACCESS: ::c_int = 512;
+
+// sys/uio.h
+pub const RWF_HIPRI: ::c_int = 1;
+pub const RWF_DSYNC: ::c_int = 2;
+pub const RWF_SYNC: ::c_int = 4;
+pub const RWF_NOWAIT: ::c_int = 8;
+pub const RWF_APPEND: ::c_int = 16;
+
+// errno.h
+pub const EPERM: ::c_int = 1073741825;
+pub const ENOENT: ::c_int = 1073741826;
+pub const ESRCH: ::c_int = 1073741827;
+pub const EINTR: ::c_int = 1073741828;
+pub const EIO: ::c_int = 1073741829;
+pub const ENXIO: ::c_int = 1073741830;
+pub const E2BIG: ::c_int = 1073741831;
+pub const ENOEXEC: ::c_int = 1073741832;
+pub const EBADF: ::c_int = 1073741833;
+pub const ECHILD: ::c_int = 1073741834;
+pub const EDEADLK: ::c_int = 1073741835;
+pub const ENOMEM: ::c_int = 1073741836;
+pub const EACCES: ::c_int = 1073741837;
+pub const EFAULT: ::c_int = 1073741838;
+pub const ENOTBLK: ::c_int = 1073741839;
+pub const EBUSY: ::c_int = 1073741840;
+pub const EEXIST: ::c_int = 1073741841;
+pub const EXDEV: ::c_int = 1073741842;
+pub const ENODEV: ::c_int = 1073741843;
+pub const ENOTDIR: ::c_int = 1073741844;
+pub const EISDIR: ::c_int = 1073741845;
+pub const EINVAL: ::c_int = 1073741846;
+pub const EMFILE: ::c_int = 1073741848;
+pub const ENFILE: ::c_int = 1073741847;
+pub const ENOTTY: ::c_int = 1073741849;
+pub const ETXTBSY: ::c_int = 1073741850;
+pub const EFBIG: ::c_int = 1073741851;
+pub const ENOSPC: ::c_int = 1073741852;
+pub const ESPIPE: ::c_int = 1073741853;
+pub const EROFS: ::c_int = 1073741854;
+pub const EMLINK: ::c_int = 1073741855;
+pub const EPIPE: ::c_int = 1073741856;
+pub const EDOM: ::c_int = 1073741857;
+pub const ERANGE: ::c_int = 1073741858;
+pub const EAGAIN: ::c_int = 1073741859;
+pub const EWOULDBLOCK: ::c_int = 1073741859;
+pub const EINPROGRESS: ::c_int = 1073741860;
+pub const EALREADY: ::c_int = 1073741861;
+pub const ENOTSOCK: ::c_int = 1073741862;
+pub const EMSGSIZE: ::c_int = 1073741864;
+pub const EPROTOTYPE: ::c_int = 1073741865;
+pub const ENOPROTOOPT: ::c_int = 1073741866;
+pub const EPROTONOSUPPORT: ::c_int = 1073741867;
+pub const ESOCKTNOSUPPORT: ::c_int = 1073741868;
+pub const EOPNOTSUPP: ::c_int = 1073741869;
+pub const EPFNOSUPPORT: ::c_int = 1073741870;
+pub const EAFNOSUPPORT: ::c_int = 1073741871;
+pub const EADDRINUSE: ::c_int = 1073741872;
+pub const EADDRNOTAVAIL: ::c_int = 1073741873;
+pub const ENETDOWN: ::c_int = 1073741874;
+pub const ENETUNREACH: ::c_int = 1073741875;
+pub const ENETRESET: ::c_int = 1073741876;
+pub const ECONNABORTED: ::c_int = 1073741877;
+pub const ECONNRESET: ::c_int = 1073741878;
+pub const ENOBUFS: ::c_int = 1073741879;
+pub const EISCONN: ::c_int = 1073741880;
+pub const ENOTCONN: ::c_int = 1073741881;
+pub const EDESTADDRREQ: ::c_int = 1073741863;
+pub const ESHUTDOWN: ::c_int = 1073741882;
+pub const ETOOMANYREFS: ::c_int = 1073741883;
+pub const ETIMEDOUT: ::c_int = 1073741884;
+pub const ECONNREFUSED: ::c_int = 1073741885;
+pub const ELOOP: ::c_int = 1073741886;
+pub const ENAMETOOLONG: ::c_int = 1073741887;
+pub const EHOSTDOWN: ::c_int = 1073741888;
+pub const EHOSTUNREACH: ::c_int = 1073741889;
+pub const ENOTEMPTY: ::c_int = 1073741890;
+pub const EPROCLIM: ::c_int = 1073741891;
+pub const EUSERS: ::c_int = 1073741892;
+pub const EDQUOT: ::c_int = 1073741893;
+pub const ESTALE: ::c_int = 1073741894;
+pub const EREMOTE: ::c_int = 1073741895;
+pub const EBADRPC: ::c_int = 1073741896;
+pub const ERPCMISMATCH: ::c_int = 1073741897;
+pub const EPROGUNAVAIL: ::c_int = 1073741898;
+pub const EPROGMISMATCH: ::c_int = 1073741899;
+pub const EPROCUNAVAIL: ::c_int = 1073741900;
+pub const ENOLCK: ::c_int = 1073741901;
+pub const EFTYPE: ::c_int = 1073741903;
+pub const EAUTH: ::c_int = 1073741904;
+pub const ENEEDAUTH: ::c_int = 1073741905;
+pub const ENOSYS: ::c_int = 1073741902;
+pub const ELIBEXEC: ::c_int = 1073741907;
+pub const ENOTSUP: ::c_int = 1073741942;
+pub const EILSEQ: ::c_int = 1073741930;
+pub const EBACKGROUND: ::c_int = 1073741924;
+pub const EDIED: ::c_int = 1073741925;
+pub const EGREGIOUS: ::c_int = 1073741927;
+pub const EIEIO: ::c_int = 1073741928;
+pub const EGRATUITOUS: ::c_int = 1073741929;
+pub const EBADMSG: ::c_int = 1073741931;
+pub const EIDRM: ::c_int = 1073741932;
+pub const EMULTIHOP: ::c_int = 1073741933;
+pub const ENODATA: ::c_int = 1073741934;
+pub const ENOLINK: ::c_int = 1073741935;
+pub const ENOMSG: ::c_int = 1073741936;
+pub const ENOSR: ::c_int = 1073741937;
+pub const ENOSTR: ::c_int = 1073741938;
+pub const EOVERFLOW: ::c_int = 1073741939;
+pub const EPROTO: ::c_int = 1073741940;
+pub const ETIME: ::c_int = 1073741941;
+pub const ECANCELED: ::c_int = 1073741943;
+pub const EOWNERDEAD: ::c_int = 1073741944;
+pub const ENOTRECOVERABLE: ::c_int = 1073741945;
+pub const EMACH_SEND_IN_PROGRESS: ::c_int = 268435457;
+pub const EMACH_SEND_INVALID_DATA: ::c_int = 268435458;
+pub const EMACH_SEND_INVALID_DEST: ::c_int = 268435459;
+pub const EMACH_SEND_TIMED_OUT: ::c_int = 268435460;
+pub const EMACH_SEND_WILL_NOTIFY: ::c_int = 268435461;
+pub const EMACH_SEND_NOTIFY_IN_PROGRESS: ::c_int = 268435462;
+pub const EMACH_SEND_INTERRUPTED: ::c_int = 268435463;
+pub const EMACH_SEND_MSG_TOO_SMALL: ::c_int = 268435464;
+pub const EMACH_SEND_INVALID_REPLY: ::c_int = 268435465;
+pub const EMACH_SEND_INVALID_RIGHT: ::c_int = 268435466;
+pub const EMACH_SEND_INVALID_NOTIFY: ::c_int = 268435467;
+pub const EMACH_SEND_INVALID_MEMORY: ::c_int = 268435468;
+pub const EMACH_SEND_NO_BUFFER: ::c_int = 268435469;
+pub const EMACH_SEND_NO_NOTIFY: ::c_int = 268435470;
+pub const EMACH_SEND_INVALID_TYPE: ::c_int = 268435471;
+pub const EMACH_SEND_INVALID_HEADER: ::c_int = 268435472;
+pub const EMACH_RCV_IN_PROGRESS: ::c_int = 268451841;
+pub const EMACH_RCV_INVALID_NAME: ::c_int = 268451842;
+pub const EMACH_RCV_TIMED_OUT: ::c_int = 268451843;
+pub const EMACH_RCV_TOO_LARGE: ::c_int = 268451844;
+pub const EMACH_RCV_INTERRUPTED: ::c_int = 268451845;
+pub const EMACH_RCV_PORT_CHANGED: ::c_int = 268451846;
+pub const EMACH_RCV_INVALID_NOTIFY: ::c_int = 268451847;
+pub const EMACH_RCV_INVALID_DATA: ::c_int = 268451848;
+pub const EMACH_RCV_PORT_DIED: ::c_int = 268451849;
+pub const EMACH_RCV_IN_SET: ::c_int = 268451850;
+pub const EMACH_RCV_HEADER_ERROR: ::c_int = 268451851;
+pub const EMACH_RCV_BODY_ERROR: ::c_int = 268451852;
+pub const EKERN_INVALID_ADDRESS: ::c_int = 1;
+pub const EKERN_PROTECTION_FAILURE: ::c_int = 2;
+pub const EKERN_NO_SPACE: ::c_int = 3;
+pub const EKERN_INVALID_ARGUMENT: ::c_int = 4;
+pub const EKERN_FAILURE: ::c_int = 5;
+pub const EKERN_RESOURCE_SHORTAGE: ::c_int = 6;
+pub const EKERN_NOT_RECEIVER: ::c_int = 7;
+pub const EKERN_NO_ACCESS: ::c_int = 8;
+pub const EKERN_MEMORY_FAILURE: ::c_int = 9;
+pub const EKERN_MEMORY_ERROR: ::c_int = 10;
+pub const EKERN_NOT_IN_SET: ::c_int = 12;
+pub const EKERN_NAME_EXISTS: ::c_int = 13;
+pub const EKERN_ABORTED: ::c_int = 14;
+pub const EKERN_INVALID_NAME: ::c_int = 15;
+pub const EKERN_INVALID_TASK: ::c_int = 16;
+pub const EKERN_INVALID_RIGHT: ::c_int = 17;
+pub const EKERN_INVALID_VALUE: ::c_int = 18;
+pub const EKERN_UREFS_OVERFLOW: ::c_int = 19;
+pub const EKERN_INVALID_CAPABILITY: ::c_int = 20;
+pub const EKERN_RIGHT_EXISTS: ::c_int = 21;
+pub const EKERN_INVALID_HOST: ::c_int = 22;
+pub const EKERN_MEMORY_PRESENT: ::c_int = 23;
+pub const EKERN_WRITE_PROTECTION_FAILURE: ::c_int = 24;
+pub const EKERN_TERMINATED: ::c_int = 26;
+pub const EKERN_TIMEDOUT: ::c_int = 27;
+pub const EKERN_INTERRUPTED: ::c_int = 28;
+pub const EMIG_TYPE_ERROR: ::c_int = -300;
+pub const EMIG_REPLY_MISMATCH: ::c_int = -301;
+pub const EMIG_REMOTE_ERROR: ::c_int = -302;
+pub const EMIG_BAD_ID: ::c_int = -303;
+pub const EMIG_BAD_ARGUMENTS: ::c_int = -304;
+pub const EMIG_NO_REPLY: ::c_int = -305;
+pub const EMIG_EXCEPTION: ::c_int = -306;
+pub const EMIG_ARRAY_TOO_LARGE: ::c_int = -307;
+pub const EMIG_SERVER_DIED: ::c_int = -308;
+pub const EMIG_DESTROY_REQUEST: ::c_int = -309;
+pub const ED_IO_ERROR: ::c_int = 2500;
+pub const ED_WOULD_BLOCK: ::c_int = 2501;
+pub const ED_NO_SUCH_DEVICE: ::c_int = 2502;
+pub const ED_ALREADY_OPEN: ::c_int = 2503;
+pub const ED_DEVICE_DOWN: ::c_int = 2504;
+pub const ED_INVALID_OPERATION: ::c_int = 2505;
+pub const ED_INVALID_RECNUM: ::c_int = 2506;
+pub const ED_INVALID_SIZE: ::c_int = 2507;
+pub const ED_NO_MEMORY: ::c_int = 2508;
+pub const ED_READ_ONLY: ::c_int = 2509;
+pub const _HURD_ERRNOS: usize = 122;
+
+// sched.h
+pub const SCHED_OTHER: ::c_int = 0;
+pub const SCHED_FIFO: ::c_int = 1;
+pub const SCHED_RR: ::c_int = 2;
+pub const _BITS_TYPES_STRUCT_SCHED_PARAM: usize = 1;
+pub const __CPU_SETSIZE: usize = 1024;
+pub const CPU_SETSIZE: usize = 1024;
+
+// pthread.h
+pub const PTHREAD_SPINLOCK_INITIALIZER: ::c_int = 0;
+pub const PTHREAD_CANCEL_DISABLE: ::c_int = 0;
+pub const PTHREAD_CANCEL_ENABLE: ::c_int = 1;
+pub const PTHREAD_CANCEL_DEFERRED: ::c_int = 0;
+pub const PTHREAD_CANCEL_ASYNCHRONOUS: ::c_int = 1;
+pub const PTHREAD_BARRIER_SERIAL_THREAD: ::c_int = -1;
+
+// netinet/tcp.h
+pub const TCP_NODELAY: ::c_int = 1;
+pub const TCP_MAXSEG: ::c_int = 2;
+pub const TCP_CORK: ::c_int = 3;
+pub const TCP_KEEPIDLE: ::c_int = 4;
+pub const TCP_KEEPINTVL: ::c_int = 5;
+pub const TCP_KEEPCNT: ::c_int = 6;
+pub const TCP_SYNCNT: ::c_int = 7;
+pub const TCP_LINGER2: ::c_int = 8;
+pub const TCP_DEFER_ACCEPT: ::c_int = 9;
+pub const TCP_WINDOW_CLAMP: ::c_int = 10;
+pub const TCP_INFO: ::c_int = 11;
+pub const TCP_QUICKACK: ::c_int = 12;
+pub const TCP_CONGESTION: ::c_int = 13;
+pub const TCP_MD5SIG: ::c_int = 14;
+pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
+pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
+pub const TCP_THIN_DUPACK: ::c_int = 17;
+pub const TCP_USER_TIMEOUT: ::c_int = 18;
+pub const TCP_REPAIR: ::c_int = 19;
+pub const TCP_REPAIR_QUEUE: ::c_int = 20;
+pub const TCP_QUEUE_SEQ: ::c_int = 21;
+pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
+pub const TCP_FASTOPEN: ::c_int = 23;
+pub const TCP_TIMESTAMP: ::c_int = 24;
+pub const TCP_NOTSENT_LOWAT: ::c_int = 25;
+pub const TCP_CC_INFO: ::c_int = 26;
+pub const TCP_SAVE_SYN: ::c_int = 27;
+pub const TCP_SAVED_SYN: ::c_int = 28;
+pub const TCP_REPAIR_WINDOW: ::c_int = 29;
+pub const TCP_FASTOPEN_CONNECT: ::c_int = 30;
+pub const TCP_ULP: ::c_int = 31;
+pub const TCP_MD5SIG_EXT: ::c_int = 32;
+pub const TCP_FASTOPEN_KEY: ::c_int = 33;
+pub const TCP_FASTOPEN_NO_COOKIE: ::c_int = 34;
+pub const TCP_ZEROCOPY_RECEIVE: ::c_int = 35;
+pub const TCP_INQ: ::c_int = 36;
+pub const TCP_CM_INQ: ::c_int = 36;
+pub const TCP_TX_DELAY: ::c_int = 37;
+pub const TCP_REPAIR_ON: ::c_int = 1;
+pub const TCP_REPAIR_OFF: ::c_int = 0;
+pub const TCP_REPAIR_OFF_NO_WP: ::c_int = -1;
+
+// stdint.h
+pub const INT8_MIN: i8 = -128;
+pub const INT16_MIN: i16 = -32768;
+pub const INT32_MIN: i32 = -2147483648;
+pub const INT8_MAX: i8 = 127;
+pub const INT16_MAX: i16 = 32767;
+pub const INT32_MAX: i32 = 2147483647;
+pub const UINT8_MAX: u8 = 255;
+pub const UINT16_MAX: u16 = 65535;
+pub const UINT32_MAX: u32 = 4294967295;
+pub const INT_LEAST8_MIN: int_least8_t = -128;
+pub const INT_LEAST16_MIN: int_least16_t = -32768;
+pub const INT_LEAST32_MIN: int_least32_t = -2147483648;
+pub const INT_LEAST8_MAX: int_least8_t = 127;
+pub const INT_LEAST16_MAX: int_least16_t = 32767;
+pub const INT_LEAST32_MAX: int_least32_t = 2147483647;
+pub const UINT_LEAST8_MAX: uint_least8_t = 255;
+pub const UINT_LEAST16_MAX: uint_least16_t = 65535;
+pub const UINT_LEAST32_MAX: uint_least32_t = 4294967295;
+pub const INT_FAST8_MIN: int_fast8_t = -128;
+pub const INT_FAST16_MIN: int_fast16_t = -2147483648;
+pub const INT_FAST32_MIN: int_fast32_t = -2147483648;
+pub const INT_FAST8_MAX: int_fast8_t = 127;
+pub const INT_FAST16_MAX: int_fast16_t = 2147483647;
+pub const INT_FAST32_MAX: int_fast32_t = 2147483647;
+pub const UINT_FAST8_MAX: uint_fast8_t = 255;
+pub const UINT_FAST16_MAX: uint_fast16_t = 4294967295;
+pub const UINT_FAST32_MAX: uint_fast32_t = 4294967295;
+pub const INTPTR_MIN: __intptr_t = -2147483648;
+pub const INTPTR_MAX: __intptr_t = 2147483647;
+pub const UINTPTR_MAX: usize = 4294967295;
+pub const PTRDIFF_MIN: __ptrdiff_t = -2147483648;
+pub const PTRDIFF_MAX: __ptrdiff_t = 2147483647;
+pub const SIG_ATOMIC_MIN: __sig_atomic_t = -2147483648;
+pub const SIG_ATOMIC_MAX: __sig_atomic_t = 2147483647;
+pub const SIZE_MAX: usize = 4294967295;
+pub const WINT_MIN: wint_t = 0;
+pub const WINT_MAX: wint_t = 4294967295;
+pub const INT8_WIDTH: usize = 8;
+pub const UINT8_WIDTH: usize = 8;
+pub const INT16_WIDTH: usize = 16;
+pub const UINT16_WIDTH: usize = 16;
+pub const INT32_WIDTH: usize = 32;
+pub const UINT32_WIDTH: usize = 32;
+pub const INT64_WIDTH: usize = 64;
+pub const UINT64_WIDTH: usize = 64;
+pub const INT_LEAST8_WIDTH: usize = 8;
+pub const UINT_LEAST8_WIDTH: usize = 8;
+pub const INT_LEAST16_WIDTH: usize = 16;
+pub const UINT_LEAST16_WIDTH: usize = 16;
+pub const INT_LEAST32_WIDTH: usize = 32;
+pub const UINT_LEAST32_WIDTH: usize = 32;
+pub const INT_LEAST64_WIDTH: usize = 64;
+pub const UINT_LEAST64_WIDTH: usize = 64;
+pub const INT_FAST8_WIDTH: usize = 8;
+pub const UINT_FAST8_WIDTH: usize = 8;
+pub const INT_FAST16_WIDTH: usize = 32;
+pub const UINT_FAST16_WIDTH: usize = 32;
+pub const INT_FAST32_WIDTH: usize = 32;
+pub const UINT_FAST32_WIDTH: usize = 32;
+pub const INT_FAST64_WIDTH: usize = 64;
+pub const UINT_FAST64_WIDTH: usize = 64;
+pub const INTPTR_WIDTH: usize = 32;
+pub const UINTPTR_WIDTH: usize = 32;
+pub const INTMAX_WIDTH: usize = 64;
+pub const UINTMAX_WIDTH: usize = 64;
+pub const PTRDIFF_WIDTH: usize = 32;
+pub const SIG_ATOMIC_WIDTH: usize = 32;
+pub const SIZE_WIDTH: usize = 32;
+pub const WCHAR_WIDTH: usize = 32;
+pub const WINT_WIDTH: usize = 32;
+
+pub const TH_FIN: u8 = 1;
+pub const TH_SYN: u8 = 2;
+pub const TH_RST: u8 = 4;
+pub const TH_PUSH: u8 = 8;
+pub const TH_ACK: u8 = 16;
+pub const TH_URG: u8 = 32;
+pub const TCPOPT_EOL: u8 = 0;
+pub const TCPOPT_NOP: u8 = 1;
+pub const TCPOPT_MAXSEG: u8 = 2;
+pub const TCPOLEN_MAXSEG: u8 = 4;
+pub const TCPOPT_WINDOW: u8 = 3;
+pub const TCPOLEN_WINDOW: u8 = 3;
+pub const TCPOPT_SACK_PERMITTED: u8 = 4;
+pub const TCPOLEN_SACK_PERMITTED: u8 = 2;
+pub const TCPOPT_SACK: u8 = 5;
+pub const TCPOPT_TIMESTAMP: u8 = 8;
+pub const TCPOLEN_TIMESTAMP: u8 = 10;
+pub const TCPOLEN_TSTAMP_APPA: u8 = 12;
+pub const TCPOPT_TSTAMP_HDR: u32 = 16844810;
+pub const TCP_MSS: usize = 512;
+pub const TCP_MAXWIN: usize = 65535;
+pub const TCP_MAX_WINSHIFT: usize = 14;
+pub const TCPI_OPT_TIMESTAMPS: u8 = 1;
+pub const TCPI_OPT_SACK: u8 = 2;
+pub const TCPI_OPT_WSCALE: u8 = 4;
+pub const TCPI_OPT_ECN: u8 = 8;
+pub const TCPI_OPT_ECN_SEEN: u8 = 16;
+pub const TCPI_OPT_SYN_DATA: u8 = 32;
+pub const TCP_MD5SIG_MAXKEYLEN: usize = 80;
+pub const TCP_MD5SIG_FLAG_PREFIX: usize = 1;
+pub const TCP_COOKIE_MIN: usize = 8;
+pub const TCP_COOKIE_MAX: usize = 16;
+pub const TCP_COOKIE_PAIR_SIZE: usize = 32;
+pub const TCP_COOKIE_IN_ALWAYS: ::c_int = 1;
+pub const TCP_COOKIE_OUT_NEVER: ::c_int = 2;
+pub const TCP_S_DATA_IN: ::c_int = 4;
+pub const TCP_S_DATA_OUT: ::c_int = 8;
+pub const TCP_MSS_DEFAULT: usize = 536;
+pub const TCP_MSS_DESIRED: usize = 1220;
+
+// sys/wait.h
+pub const WCOREFLAG: ::c_int = 128;
+pub const WAIT_ANY: pid_t = -1;
+pub const WAIT_MYPGRP: pid_t = 0;
+
+// sys/file.h
+pub const LOCK_SH: ::c_int = 1;
+pub const LOCK_EX: ::c_int = 2;
+pub const LOCK_UN: ::c_int = 8;
+pub const LOCK_NB: ::c_int = 4;
+
+// sys/mman.h
+pub const PROT_NONE: ::c_int = 0;
+pub const PROT_READ: ::c_int = 4;
+pub const PROT_WRITE: ::c_int = 2;
+pub const PROT_EXEC: ::c_int = 1;
+pub const MAP_FILE: ::c_int = 1;
+pub const MAP_ANON: ::c_int = 2;
+pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
+pub const MAP_TYPE: ::c_int = 15;
+pub const MAP_COPY: ::c_int = 32;
+pub const MAP_SHARED: ::c_int = 16;
+pub const MAP_PRIVATE: ::c_int = 0;
+pub const MAP_FIXED: ::c_int = 256;
+pub const MAP_NOEXTEND: ::c_int = 512;
+pub const MAP_HASSEMPHORE: ::c_int = 1024;
+pub const MAP_INHERIT: ::c_int = 2048;
+pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
+pub const MADV_NORMAL: ::c_int = 0;
+pub const MADV_RANDOM: ::c_int = 1;
+pub const MADV_SEQUENTIAL: ::c_int = 2;
+pub const MADV_WILLNEED: ::c_int = 3;
+pub const MADV_DONTNEED: ::c_int = 4;
+pub const POSIX_MADV_NORMAL: ::c_int = 0;
+pub const POSIX_MADV_RANDOM: ::c_int = 1;
+pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
+pub const POSIX_MADV_WILLNEED: ::c_int = 3;
+pub const POSIX_MADV_WONTNEED: ::c_int = 4;
+
+pub const MS_ASYNC: ::c_int = 1;
+pub const MS_SYNC: ::c_int = 0;
+pub const MS_INVALIDATE: ::c_int = 2;
+pub const MREMAP_MAYMOVE: ::c_int = 1;
+pub const MREMAP_FIXED: ::c_int = 2;
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+
+// spawn.h
+pub const POSIX_SPAWN_USEVFORK: ::c_int = 64;
+pub const POSIX_SPAWN_SETSID: ::c_int = 128;
+
+// sys/syslog.h
+pub const LOG_CRON: ::c_int = 9 << 3;
+pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
+pub const LOG_FTP: ::c_int = 11 << 3;
+pub const LOG_PERROR: ::c_int = 0x20;
+
+// net/if.h
+pub const IFF_UP: ::c_int = 0x1;
+pub const IFF_BROADCAST: ::c_int = 0x2;
+pub const IFF_DEBUG: ::c_int = 0x4;
+pub const IFF_LOOPBACK: ::c_int = 0x8;
+pub const IFF_POINTOPOINT: ::c_int = 0x10;
+pub const IFF_NOTRAILERS: ::c_int = 0x20;
+pub const IFF_RUNNING: ::c_int = 0x40;
+pub const IFF_NOARP: ::c_int = 0x80;
+pub const IFF_PROMISC: ::c_int = 0x100;
+pub const IFF_ALLMULTI: ::c_int = 0x200;
+pub const IFF_MASTER: ::c_int = 0x400;
+pub const IFF_SLAVE: ::c_int = 0x800;
+pub const IFF_MULTICAST: ::c_int = 0x1000;
+pub const IFF_PORTSEL: ::c_int = 0x2000;
+pub const IFF_AUTOMEDIA: ::c_int = 0x4000;
+pub const IFF_DYNAMIC: ::c_int = 0x8000;
+
+// random.h
+pub const GRND_NONBLOCK: ::c_uint = 1;
+pub const GRND_RANDOM: ::c_uint = 2;
+pub const GRND_INSECURE: ::c_uint = 4;
+
+pub const _PC_LINK_MAX: ::c_int = 0;
+pub const _PC_MAX_CANON: ::c_int = 1;
+pub const _PC_MAX_INPUT: ::c_int = 2;
+pub const _PC_NAME_MAX: ::c_int = 3;
+pub const _PC_PATH_MAX: ::c_int = 4;
+pub const _PC_PIPE_BUF: ::c_int = 5;
+pub const _PC_CHOWN_RESTRICTED: ::c_int = 6;
+pub const _PC_NO_TRUNC: ::c_int = 7;
+pub const _PC_VDISABLE: ::c_int = 8;
+pub const _PC_SYNC_IO: ::c_int = 9;
+pub const _PC_ASYNC_IO: ::c_int = 10;
+pub const _PC_PRIO_IO: ::c_int = 11;
+pub const _PC_SOCK_MAXBUF: ::c_int = 12;
+pub const _PC_FILESIZEBITS: ::c_int = 13;
+pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14;
+pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15;
+pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16;
+pub const _PC_REC_XFER_ALIGN: ::c_int = 17;
+pub const _PC_ALLOC_SIZE_MIN: ::c_int = 18;
+pub const _PC_SYMLINK_MAX: ::c_int = 19;
+pub const _PC_2_SYMLINKS: ::c_int = 20;
+pub const _SC_ARG_MAX: ::c_int = 0;
+pub const _SC_CHILD_MAX: ::c_int = 1;
+pub const _SC_CLK_TCK: ::c_int = 2;
+pub const _SC_NGROUPS_MAX: ::c_int = 3;
+pub const _SC_OPEN_MAX: ::c_int = 4;
+pub const _SC_STREAM_MAX: ::c_int = 5;
+pub const _SC_TZNAME_MAX: ::c_int = 6;
+pub const _SC_JOB_CONTROL: ::c_int = 7;
+pub const _SC_SAVED_IDS: ::c_int = 8;
+pub const _SC_REALTIME_SIGNALS: ::c_int = 9;
+pub const _SC_PRIORITY_SCHEDULING: ::c_int = 10;
+pub const _SC_TIMERS: ::c_int = 11;
+pub const _SC_ASYNCHRONOUS_IO: ::c_int = 12;
+pub const _SC_PRIORITIZED_IO: ::c_int = 13;
+pub const _SC_SYNCHRONIZED_IO: ::c_int = 14;
+pub const _SC_FSYNC: ::c_int = 15;
+pub const _SC_MAPPED_FILES: ::c_int = 16;
+pub const _SC_MEMLOCK: ::c_int = 17;
+pub const _SC_MEMLOCK_RANGE: ::c_int = 18;
+pub const _SC_MEMORY_PROTECTION: ::c_int = 19;
+pub const _SC_MESSAGE_PASSING: ::c_int = 20;
+pub const _SC_SEMAPHORES: ::c_int = 21;
+pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 22;
+pub const _SC_AIO_LISTIO_MAX: ::c_int = 23;
+pub const _SC_AIO_MAX: ::c_int = 24;
+pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 25;
+pub const _SC_DELAYTIMER_MAX: ::c_int = 26;
+pub const _SC_MQ_OPEN_MAX: ::c_int = 27;
+pub const _SC_MQ_PRIO_MAX: ::c_int = 28;
+pub const _SC_VERSION: ::c_int = 29;
+pub const _SC_PAGESIZE: ::c_int = 30;
+pub const _SC_PAGE_SIZE: ::c_int = 30;
+pub const _SC_RTSIG_MAX: ::c_int = 31;
+pub const _SC_SEM_NSEMS_MAX: ::c_int = 32;
+pub const _SC_SEM_VALUE_MAX: ::c_int = 33;
+pub const _SC_SIGQUEUE_MAX: ::c_int = 34;
+pub const _SC_TIMER_MAX: ::c_int = 35;
+pub const _SC_BC_BASE_MAX: ::c_int = 36;
+pub const _SC_BC_DIM_MAX: ::c_int = 37;
+pub const _SC_BC_SCALE_MAX: ::c_int = 38;
+pub const _SC_BC_STRING_MAX: ::c_int = 39;
+pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 40;
+pub const _SC_EQUIV_CLASS_MAX: ::c_int = 41;
+pub const _SC_EXPR_NEST_MAX: ::c_int = 42;
+pub const _SC_LINE_MAX: ::c_int = 43;
+pub const _SC_RE_DUP_MAX: ::c_int = 44;
+pub const _SC_CHARCLASS_NAME_MAX: ::c_int = 45;
+pub const _SC_2_VERSION: ::c_int = 46;
+pub const _SC_2_C_BIND: ::c_int = 47;
+pub const _SC_2_C_DEV: ::c_int = 48;
+pub const _SC_2_FORT_DEV: ::c_int = 49;
+pub const _SC_2_FORT_RUN: ::c_int = 50;
+pub const _SC_2_SW_DEV: ::c_int = 51;
+pub const _SC_2_LOCALEDEF: ::c_int = 52;
+pub const _SC_PII: ::c_int = 53;
+pub const _SC_PII_XTI: ::c_int = 54;
+pub const _SC_PII_SOCKET: ::c_int = 55;
+pub const _SC_PII_INTERNET: ::c_int = 56;
+pub const _SC_PII_OSI: ::c_int = 57;
+pub const _SC_POLL: ::c_int = 58;
+pub const _SC_SELECT: ::c_int = 59;
+pub const _SC_UIO_MAXIOV: ::c_int = 60;
+pub const _SC_IOV_MAX: ::c_int = 60;
+pub const _SC_PII_INTERNET_STREAM: ::c_int = 61;
+pub const _SC_PII_INTERNET_DGRAM: ::c_int = 62;
+pub const _SC_PII_OSI_COTS: ::c_int = 63;
+pub const _SC_PII_OSI_CLTS: ::c_int = 64;
+pub const _SC_PII_OSI_M: ::c_int = 65;
+pub const _SC_T_IOV_MAX: ::c_int = 66;
+pub const _SC_THREADS: ::c_int = 67;
+pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 68;
+pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 69;
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 70;
+pub const _SC_LOGIN_NAME_MAX: ::c_int = 71;
+pub const _SC_TTY_NAME_MAX: ::c_int = 72;
+pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 73;
+pub const _SC_THREAD_KEYS_MAX: ::c_int = 74;
+pub const _SC_THREAD_STACK_MIN: ::c_int = 75;
+pub const _SC_THREAD_THREADS_MAX: ::c_int = 76;
+pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77;
+pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78;
+pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 79;
+pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 80;
+pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 81;
+pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 82;
+pub const _SC_NPROCESSORS_CONF: ::c_int = 83;
+pub const _SC_NPROCESSORS_ONLN: ::c_int = 84;
+pub const _SC_PHYS_PAGES: ::c_int = 85;
+pub const _SC_AVPHYS_PAGES: ::c_int = 86;
+pub const _SC_ATEXIT_MAX: ::c_int = 87;
+pub const _SC_PASS_MAX: ::c_int = 88;
+pub const _SC_XOPEN_VERSION: ::c_int = 89;
+pub const _SC_XOPEN_XCU_VERSION: ::c_int = 90;
+pub const _SC_XOPEN_UNIX: ::c_int = 91;
+pub const _SC_XOPEN_CRYPT: ::c_int = 92;
+pub const _SC_XOPEN_ENH_I18N: ::c_int = 93;
+pub const _SC_XOPEN_SHM: ::c_int = 94;
+pub const _SC_2_CHAR_TERM: ::c_int = 95;
+pub const _SC_2_C_VERSION: ::c_int = 96;
+pub const _SC_2_UPE: ::c_int = 97;
+pub const _SC_XOPEN_XPG2: ::c_int = 98;
+pub const _SC_XOPEN_XPG3: ::c_int = 99;
+pub const _SC_XOPEN_XPG4: ::c_int = 100;
+pub const _SC_CHAR_BIT: ::c_int = 101;
+pub const _SC_CHAR_MAX: ::c_int = 102;
+pub const _SC_CHAR_MIN: ::c_int = 103;
+pub const _SC_INT_MAX: ::c_int = 104;
+pub const _SC_INT_MIN: ::c_int = 105;
+pub const _SC_LONG_BIT: ::c_int = 106;
+pub const _SC_WORD_BIT: ::c_int = 107;
+pub const _SC_MB_LEN_MAX: ::c_int = 108;
+pub const _SC_NZERO: ::c_int = 109;
+pub const _SC_SSIZE_MAX: ::c_int = 110;
+pub const _SC_SCHAR_MAX: ::c_int = 111;
+pub const _SC_SCHAR_MIN: ::c_int = 112;
+pub const _SC_SHRT_MAX: ::c_int = 113;
+pub const _SC_SHRT_MIN: ::c_int = 114;
+pub const _SC_UCHAR_MAX: ::c_int = 115;
+pub const _SC_UINT_MAX: ::c_int = 116;
+pub const _SC_ULONG_MAX: ::c_int = 117;
+pub const _SC_USHRT_MAX: ::c_int = 118;
+pub const _SC_NL_ARGMAX: ::c_int = 119;
+pub const _SC_NL_LANGMAX: ::c_int = 120;
+pub const _SC_NL_MSGMAX: ::c_int = 121;
+pub const _SC_NL_NMAX: ::c_int = 122;
+pub const _SC_NL_SETMAX: ::c_int = 123;
+pub const _SC_NL_TEXTMAX: ::c_int = 124;
+pub const _SC_XBS5_ILP32_OFF32: ::c_int = 125;
+pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 126;
+pub const _SC_XBS5_LP64_OFF64: ::c_int = 127;
+pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 128;
+pub const _SC_XOPEN_LEGACY: ::c_int = 129;
+pub const _SC_XOPEN_REALTIME: ::c_int = 130;
+pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 131;
+pub const _SC_ADVISORY_INFO: ::c_int = 132;
+pub const _SC_BARRIERS: ::c_int = 133;
+pub const _SC_BASE: ::c_int = 134;
+pub const _SC_C_LANG_SUPPORT: ::c_int = 135;
+pub const _SC_C_LANG_SUPPORT_R: ::c_int = 136;
+pub const _SC_CLOCK_SELECTION: ::c_int = 137;
+pub const _SC_CPUTIME: ::c_int = 138;
+pub const _SC_THREAD_CPUTIME: ::c_int = 139;
+pub const _SC_DEVICE_IO: ::c_int = 140;
+pub const _SC_DEVICE_SPECIFIC: ::c_int = 141;
+pub const _SC_DEVICE_SPECIFIC_R: ::c_int = 142;
+pub const _SC_FD_MGMT: ::c_int = 143;
+pub const _SC_FIFO: ::c_int = 144;
+pub const _SC_PIPE: ::c_int = 145;
+pub const _SC_FILE_ATTRIBUTES: ::c_int = 146;
+pub const _SC_FILE_LOCKING: ::c_int = 147;
+pub const _SC_FILE_SYSTEM: ::c_int = 148;
+pub const _SC_MONOTONIC_CLOCK: ::c_int = 149;
+pub const _SC_MULTI_PROCESS: ::c_int = 150;
+pub const _SC_SINGLE_PROCESS: ::c_int = 151;
+pub const _SC_NETWORKING: ::c_int = 152;
+pub const _SC_READER_WRITER_LOCKS: ::c_int = 153;
+pub const _SC_SPIN_LOCKS: ::c_int = 154;
+pub const _SC_REGEXP: ::c_int = 155;
+pub const _SC_REGEX_VERSION: ::c_int = 156;
+pub const _SC_SHELL: ::c_int = 157;
+pub const _SC_SIGNALS: ::c_int = 158;
+pub const _SC_SPAWN: ::c_int = 159;
+pub const _SC_SPORADIC_SERVER: ::c_int = 160;
+pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 161;
+pub const _SC_SYSTEM_DATABASE: ::c_int = 162;
+pub const _SC_SYSTEM_DATABASE_R: ::c_int = 163;
+pub const _SC_TIMEOUTS: ::c_int = 164;
+pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 165;
+pub const _SC_USER_GROUPS: ::c_int = 166;
+pub const _SC_USER_GROUPS_R: ::c_int = 167;
+pub const _SC_2_PBS: ::c_int = 168;
+pub const _SC_2_PBS_ACCOUNTING: ::c_int = 169;
+pub const _SC_2_PBS_LOCATE: ::c_int = 170;
+pub const _SC_2_PBS_MESSAGE: ::c_int = 171;
+pub const _SC_2_PBS_TRACK: ::c_int = 172;
+pub const _SC_SYMLOOP_MAX: ::c_int = 173;
+pub const _SC_STREAMS: ::c_int = 174;
+pub const _SC_2_PBS_CHECKPOINT: ::c_int = 175;
+pub const _SC_V6_ILP32_OFF32: ::c_int = 176;
+pub const _SC_V6_ILP32_OFFBIG: ::c_int = 177;
+pub const _SC_V6_LP64_OFF64: ::c_int = 178;
+pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 179;
+pub const _SC_HOST_NAME_MAX: ::c_int = 180;
+pub const _SC_TRACE: ::c_int = 181;
+pub const _SC_TRACE_EVENT_FILTER: ::c_int = 182;
+pub const _SC_TRACE_INHERIT: ::c_int = 183;
+pub const _SC_TRACE_LOG: ::c_int = 184;
+pub const _SC_LEVEL1_ICACHE_SIZE: ::c_int = 185;
+pub const _SC_LEVEL1_ICACHE_ASSOC: ::c_int = 186;
+pub const _SC_LEVEL1_ICACHE_LINESIZE: ::c_int = 187;
+pub const _SC_LEVEL1_DCACHE_SIZE: ::c_int = 188;
+pub const _SC_LEVEL1_DCACHE_ASSOC: ::c_int = 189;
+pub const _SC_LEVEL1_DCACHE_LINESIZE: ::c_int = 190;
+pub const _SC_LEVEL2_CACHE_SIZE: ::c_int = 191;
+pub const _SC_LEVEL2_CACHE_ASSOC: ::c_int = 192;
+pub const _SC_LEVEL2_CACHE_LINESIZE: ::c_int = 193;
+pub const _SC_LEVEL3_CACHE_SIZE: ::c_int = 194;
+pub const _SC_LEVEL3_CACHE_ASSOC: ::c_int = 195;
+pub const _SC_LEVEL3_CACHE_LINESIZE: ::c_int = 196;
+pub const _SC_LEVEL4_CACHE_SIZE: ::c_int = 197;
+pub const _SC_LEVEL4_CACHE_ASSOC: ::c_int = 198;
+pub const _SC_LEVEL4_CACHE_LINESIZE: ::c_int = 199;
+pub const _SC_IPV6: ::c_int = 235;
+pub const _SC_RAW_SOCKETS: ::c_int = 236;
+pub const _SC_V7_ILP32_OFF32: ::c_int = 237;
+pub const _SC_V7_ILP32_OFFBIG: ::c_int = 238;
+pub const _SC_V7_LP64_OFF64: ::c_int = 239;
+pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 240;
+pub const _SC_SS_REPL_MAX: ::c_int = 241;
+pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 242;
+pub const _SC_TRACE_NAME_MAX: ::c_int = 243;
+pub const _SC_TRACE_SYS_MAX: ::c_int = 244;
+pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 245;
+pub const _SC_XOPEN_STREAMS: ::c_int = 246;
+pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 247;
+pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 248;
+pub const _SC_MINSIGSTKSZ: ::c_int = 249;
+pub const _SC_SIGSTKSZ: ::c_int = 250;
+
+pub const _CS_PATH: ::c_int = 0;
+pub const _CS_V6_WIDTH_RESTRICTED_ENVS: ::c_int = 1;
+pub const _CS_GNU_LIBC_VERSION: ::c_int = 2;
+pub const _CS_GNU_LIBPTHREAD_VERSION: ::c_int = 3;
+pub const _CS_V5_WIDTH_RESTRICTED_ENVS: ::c_int = 4;
+pub const _CS_V7_WIDTH_RESTRICTED_ENVS: ::c_int = 5;
+pub const _CS_LFS_CFLAGS: ::c_int = 1000;
+pub const _CS_LFS_LDFLAGS: ::c_int = 1001;
+pub const _CS_LFS_LIBS: ::c_int = 1002;
+pub const _CS_LFS_LINTFLAGS: ::c_int = 1003;
+pub const _CS_LFS64_CFLAGS: ::c_int = 1004;
+pub const _CS_LFS64_LDFLAGS: ::c_int = 1005;
+pub const _CS_LFS64_LIBS: ::c_int = 1006;
+pub const _CS_LFS64_LINTFLAGS: ::c_int = 1007;
+pub const _CS_XBS5_ILP32_OFF32_CFLAGS: ::c_int = 1100;
+pub const _CS_XBS5_ILP32_OFF32_LDFLAGS: ::c_int = 1101;
+pub const _CS_XBS5_ILP32_OFF32_LIBS: ::c_int = 1102;
+pub const _CS_XBS5_ILP32_OFF32_LINTFLAGS: ::c_int = 1103;
+pub const _CS_XBS5_ILP32_OFFBIG_CFLAGS: ::c_int = 1104;
+pub const _CS_XBS5_ILP32_OFFBIG_LDFLAGS: ::c_int = 1105;
+pub const _CS_XBS5_ILP32_OFFBIG_LIBS: ::c_int = 1106;
+pub const _CS_XBS5_ILP32_OFFBIG_LINTFLAGS: ::c_int = 1107;
+pub const _CS_XBS5_LP64_OFF64_CFLAGS: ::c_int = 1108;
+pub const _CS_XBS5_LP64_OFF64_LDFLAGS: ::c_int = 1109;
+pub const _CS_XBS5_LP64_OFF64_LIBS: ::c_int = 1110;
+pub const _CS_XBS5_LP64_OFF64_LINTFLAGS: ::c_int = 1111;
+pub const _CS_XBS5_LPBIG_OFFBIG_CFLAGS: ::c_int = 1112;
+pub const _CS_XBS5_LPBIG_OFFBIG_LDFLAGS: ::c_int = 1113;
+pub const _CS_XBS5_LPBIG_OFFBIG_LIBS: ::c_int = 1114;
+pub const _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS: ::c_int = 1115;
+pub const _CS_POSIX_V6_ILP32_OFF32_CFLAGS: ::c_int = 1116;
+pub const _CS_POSIX_V6_ILP32_OFF32_LDFLAGS: ::c_int = 1117;
+pub const _CS_POSIX_V6_ILP32_OFF32_LIBS: ::c_int = 1118;
+pub const _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS: ::c_int = 1119;
+pub const _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS: ::c_int = 1120;
+pub const _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS: ::c_int = 1121;
+pub const _CS_POSIX_V6_ILP32_OFFBIG_LIBS: ::c_int = 1122;
+pub const _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS: ::c_int = 1123;
+pub const _CS_POSIX_V6_LP64_OFF64_CFLAGS: ::c_int = 1124;
+pub const _CS_POSIX_V6_LP64_OFF64_LDFLAGS: ::c_int = 1125;
+pub const _CS_POSIX_V6_LP64_OFF64_LIBS: ::c_int = 1126;
+pub const _CS_POSIX_V6_LP64_OFF64_LINTFLAGS: ::c_int = 1127;
+pub const _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS: ::c_int = 1128;
+pub const _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS: ::c_int = 1129;
+pub const _CS_POSIX_V6_LPBIG_OFFBIG_LIBS: ::c_int = 1130;
+pub const _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS: ::c_int = 1131;
+pub const _CS_POSIX_V7_ILP32_OFF32_CFLAGS: ::c_int = 1132;
+pub const _CS_POSIX_V7_ILP32_OFF32_LDFLAGS: ::c_int = 1133;
+pub const _CS_POSIX_V7_ILP32_OFF32_LIBS: ::c_int = 1134;
+pub const _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS: ::c_int = 1135;
+pub const _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS: ::c_int = 1136;
+pub const _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS: ::c_int = 1137;
+pub const _CS_POSIX_V7_ILP32_OFFBIG_LIBS: ::c_int = 1138;
+pub const _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS: ::c_int = 1139;
+pub const _CS_POSIX_V7_LP64_OFF64_CFLAGS: ::c_int = 1140;
+pub const _CS_POSIX_V7_LP64_OFF64_LDFLAGS: ::c_int = 1141;
+pub const _CS_POSIX_V7_LP64_OFF64_LIBS: ::c_int = 1142;
+pub const _CS_POSIX_V7_LP64_OFF64_LINTFLAGS: ::c_int = 1143;
+pub const _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS: ::c_int = 1144;
+pub const _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS: ::c_int = 1145;
+pub const _CS_POSIX_V7_LPBIG_OFFBIG_LIBS: ::c_int = 1146;
+pub const _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS: ::c_int = 1147;
+pub const _CS_V6_ENV: ::c_int = 1148;
+pub const _CS_V7_ENV: ::c_int = 1149;
+
+pub const PTHREAD_PROCESS_PRIVATE: __pthread_process_shared = 0;
+pub const PTHREAD_PROCESS_SHARED: __pthread_process_shared = 1;
+
+pub const PTHREAD_EXPLICIT_SCHED: __pthread_inheritsched = 0;
+pub const PTHREAD_INHERIT_SCHED: __pthread_inheritsched = 1;
+
+pub const PTHREAD_SCOPE_SYSTEM: __pthread_contentionscope = 0;
+pub const PTHREAD_SCOPE_PROCESS: __pthread_contentionscope = 1;
+
+pub const PTHREAD_CREATE_JOINABLE: __pthread_detachstate = 0;
+pub const PTHREAD_CREATE_DETACHED: __pthread_detachstate = 1;
+
+pub const PTHREAD_PRIO_NONE: __pthread_mutex_protocol = 0;
+pub const PTHREAD_PRIO_INHERIT: __pthread_mutex_protocol = 1;
+pub const PTHREAD_PRIO_PROTECT: __pthread_mutex_protocol = 2;
+
+pub const PTHREAD_MUTEX_TIMED: __pthread_mutex_type = 0;
+pub const PTHREAD_MUTEX_ERRORCHECK: __pthread_mutex_type = 1;
+pub const PTHREAD_MUTEX_RECURSIVE: __pthread_mutex_type = 2;
+
+pub const PTHREAD_MUTEX_STALLED: __pthread_mutex_robustness = 0;
+pub const PTHREAD_MUTEX_ROBUST: __pthread_mutex_robustness = 256;
+
+pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
+pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
+pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
+pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
+pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
+pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
+pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 6;
+pub const RLIMIT_NPROC: ::__rlimit_resource_t = 7;
+pub const RLIMIT_OFILE: ::__rlimit_resource_t = 8;
+pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 8;
+pub const RLIMIT_SBSIZE: ::__rlimit_resource_t = 9;
+pub const RLIMIT_AS: ::__rlimit_resource_t = 10;
+pub const RLIMIT_VMEM: ::__rlimit_resource_t = 10;
+pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = 11;
+pub const RLIM_NLIMITS: ::__rlimit_resource_t = 11;
+
+pub const RUSAGE_SELF: __rusage_who = 0;
+pub const RUSAGE_CHILDREN: __rusage_who = -1;
+
+pub const PRIO_PROCESS: __priority_which = 0;
+pub const PRIO_PGRP: __priority_which = 1;
+pub const PRIO_USER: __priority_which = 2;
+
+pub const __UT_LINESIZE: usize = 32;
+pub const __UT_NAMESIZE: usize = 32;
+pub const __UT_HOSTSIZE: usize = 256;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+pub const SOCK_RAW: ::c_int = 3;
+pub const SOCK_RDM: ::c_int = 4;
+pub const SOCK_SEQPACKET: ::c_int = 5;
+pub const SOCK_CLOEXEC: ::c_int = 4194304;
+pub const SOCK_NONBLOCK: ::c_int = 2048;
+
+pub const MSG_OOB: ::c_int = 1;
+pub const MSG_PEEK: ::c_int = 2;
+pub const MSG_DONTROUTE: ::c_int = 4;
+pub const MSG_EOR: ::c_int = 8;
+pub const MSG_TRUNC: ::c_int = 16;
+pub const MSG_CTRUNC: ::c_int = 32;
+pub const MSG_WAITALL: ::c_int = 64;
+pub const MSG_DONTWAIT: ::c_int = 128;
+pub const MSG_NOSIGNAL: ::c_int = 1024;
+pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000;
+
+pub const SCM_RIGHTS: ::c_int = 1;
+pub const SCM_TIMESTAMP: ::c_int = 2;
+pub const SCM_CREDS: ::c_int = 3;
+
+pub const SO_DEBUG: ::c_int = 1;
+pub const SO_ACCEPTCONN: ::c_int = 2;
+pub const SO_REUSEADDR: ::c_int = 4;
+pub const SO_KEEPALIVE: ::c_int = 8;
+pub const SO_DONTROUTE: ::c_int = 16;
+pub const SO_BROADCAST: ::c_int = 32;
+pub const SO_USELOOPBACK: ::c_int = 64;
+pub const SO_LINGER: ::c_int = 128;
+pub const SO_OOBINLINE: ::c_int = 256;
+pub const SO_REUSEPORT: ::c_int = 512;
+pub const SO_SNDBUF: ::c_int = 4097;
+pub const SO_RCVBUF: ::c_int = 4098;
+pub const SO_SNDLOWAT: ::c_int = 4099;
+pub const SO_RCVLOWAT: ::c_int = 4100;
+pub const SO_SNDTIMEO: ::c_int = 4101;
+pub const SO_RCVTIMEO: ::c_int = 4102;
+pub const SO_ERROR: ::c_int = 4103;
+pub const SO_STYLE: ::c_int = 4104;
+pub const SO_TYPE: ::c_int = 4104;
+
+pub const IPPROTO_IP: ::c_int = 0;
+pub const IPPROTO_ICMP: ::c_int = 1;
+pub const IPPROTO_IGMP: ::c_int = 2;
+pub const IPPROTO_IPIP: ::c_int = 4;
+pub const IPPROTO_TCP: ::c_int = 6;
+pub const IPPROTO_EGP: ::c_int = 8;
+pub const IPPROTO_PUP: ::c_int = 12;
+pub const IPPROTO_UDP: ::c_int = 17;
+pub const IPPROTO_IDP: ::c_int = 22;
+pub const IPPROTO_TP: ::c_int = 29;
+pub const IPPROTO_DCCP: ::c_int = 33;
+pub const IPPROTO_IPV6: ::c_int = 41;
+pub const IPPROTO_RSVP: ::c_int = 46;
+pub const IPPROTO_GRE: ::c_int = 47;
+pub const IPPROTO_ESP: ::c_int = 50;
+pub const IPPROTO_AH: ::c_int = 51;
+pub const IPPROTO_MTP: ::c_int = 92;
+pub const IPPROTO_BEETPH: ::c_int = 94;
+pub const IPPROTO_ENCAP: ::c_int = 98;
+pub const IPPROTO_PIM: ::c_int = 103;
+pub const IPPROTO_COMP: ::c_int = 108;
+pub const IPPROTO_L2TP: ::c_int = 115;
+pub const IPPROTO_SCTP: ::c_int = 132;
+pub const IPPROTO_UDPLITE: ::c_int = 136;
+pub const IPPROTO_MPLS: ::c_int = 137;
+pub const IPPROTO_ETHERNET: ::c_int = 143;
+pub const IPPROTO_RAW: ::c_int = 255;
+pub const IPPROTO_MPTCP: ::c_int = 262;
+pub const IPPROTO_MAX: ::c_int = 263;
+
+pub const IPPROTO_HOPOPTS: ::c_int = 0;
+pub const IPPROTO_ROUTING: ::c_int = 43;
+pub const IPPROTO_FRAGMENT: ::c_int = 44;
+pub const IPPROTO_ICMPV6: ::c_int = 58;
+pub const IPPROTO_NONE: ::c_int = 59;
+pub const IPPROTO_DSTOPTS: ::c_int = 60;
+pub const IPPROTO_MH: ::c_int = 135;
+
+pub const IPPORT_ECHO: in_port_t = 7;
+pub const IPPORT_DISCARD: in_port_t = 9;
+pub const IPPORT_SYSTAT: in_port_t = 11;
+pub const IPPORT_DAYTIME: in_port_t = 13;
+pub const IPPORT_NETSTAT: in_port_t = 15;
+pub const IPPORT_FTP: in_port_t = 21;
+pub const IPPORT_TELNET: in_port_t = 23;
+pub const IPPORT_SMTP: in_port_t = 25;
+pub const IPPORT_TIMESERVER: in_port_t = 37;
+pub const IPPORT_NAMESERVER: in_port_t = 42;
+pub const IPPORT_WHOIS: in_port_t = 43;
+pub const IPPORT_MTP: in_port_t = 57;
+pub const IPPORT_TFTP: in_port_t = 69;
+pub const IPPORT_RJE: in_port_t = 77;
+pub const IPPORT_FINGER: in_port_t = 79;
+pub const IPPORT_TTYLINK: in_port_t = 87;
+pub const IPPORT_SUPDUP: in_port_t = 95;
+pub const IPPORT_EXECSERVER: in_port_t = 512;
+pub const IPPORT_LOGINSERVER: in_port_t = 513;
+pub const IPPORT_CMDSERVER: in_port_t = 514;
+pub const IPPORT_EFSSERVER: in_port_t = 520;
+pub const IPPORT_BIFFUDP: in_port_t = 512;
+pub const IPPORT_WHOSERVER: in_port_t = 513;
+pub const IPPORT_ROUTESERVER: in_port_t = 520;
+pub const IPPORT_USERRESERVED: in_port_t = 5000;
+
+pub const DT_UNKNOWN: ::c_uchar = 0;
+pub const DT_FIFO: ::c_uchar = 1;
+pub const DT_CHR: ::c_uchar = 2;
+pub const DT_DIR: ::c_uchar = 4;
+pub const DT_BLK: ::c_uchar = 6;
+pub const DT_REG: ::c_uchar = 8;
+pub const DT_LNK: ::c_uchar = 10;
+pub const DT_SOCK: ::c_uchar = 12;
+pub const DT_WHT: ::c_uchar = 14;
+
+pub const ST_RDONLY: ::c_ulong = 1;
+pub const ST_NOSUID: ::c_ulong = 2;
+pub const ST_NOEXEC: ::c_ulong = 8;
+pub const ST_SYNCHRONOUS: ::c_ulong = 16;
+pub const ST_NOATIME: ::c_ulong = 32;
+pub const ST_RELATIME: ::c_ulong = 64;
+
+pub const RTLD_DI_LMID: ::c_int = 1;
+pub const RTLD_DI_LINKMAP: ::c_int = 2;
+pub const RTLD_DI_CONFIGADDR: ::c_int = 3;
+pub const RTLD_DI_SERINFO: ::c_int = 4;
+pub const RTLD_DI_SERINFOSIZE: ::c_int = 5;
+pub const RTLD_DI_ORIGIN: ::c_int = 6;
+pub const RTLD_DI_PROFILENAME: ::c_int = 7;
+pub const RTLD_DI_PROFILEOUT: ::c_int = 8;
+pub const RTLD_DI_TLS_MODID: ::c_int = 9;
+pub const RTLD_DI_TLS_DATA: ::c_int = 10;
+pub const RTLD_DI_PHDR: ::c_int = 11;
+pub const RTLD_DI_MAX: ::c_int = 11;
+
+pub const SI_ASYNCIO: ::c_int = -4;
+pub const SI_MESGQ: ::c_int = -3;
+pub const SI_TIMER: ::c_int = -2;
+pub const SI_QUEUE: ::c_int = -1;
+pub const SI_USER: ::c_int = 0;
+
+pub const ILL_ILLOPC: ::c_int = 1;
+pub const ILL_ILLOPN: ::c_int = 2;
+pub const ILL_ILLADR: ::c_int = 3;
+pub const ILL_ILLTRP: ::c_int = 4;
+pub const ILL_PRVOPC: ::c_int = 5;
+pub const ILL_PRVREG: ::c_int = 6;
+pub const ILL_COPROC: ::c_int = 7;
+pub const ILL_BADSTK: ::c_int = 8;
+
+pub const FPE_INTDIV: ::c_int = 1;
+pub const FPE_INTOVF: ::c_int = 2;
+pub const FPE_FLTDIV: ::c_int = 3;
+pub const FPE_FLTOVF: ::c_int = 4;
+pub const FPE_FLTUND: ::c_int = 5;
+pub const FPE_FLTRES: ::c_int = 6;
+pub const FPE_FLTINV: ::c_int = 7;
+pub const FPE_FLTSUB: ::c_int = 8;
+
+pub const SEGV_MAPERR: ::c_int = 1;
+pub const SEGV_ACCERR: ::c_int = 2;
+
+pub const BUS_ADRALN: ::c_int = 1;
+pub const BUS_ADRERR: ::c_int = 2;
+pub const BUS_OBJERR: ::c_int = 3;
+
+pub const TRAP_BRKPT: ::c_int = 1;
+pub const TRAP_TRACE: ::c_int = 2;
+
+pub const CLD_EXITED: ::c_int = 1;
+pub const CLD_KILLED: ::c_int = 2;
+pub const CLD_DUMPED: ::c_int = 3;
+pub const CLD_TRAPPED: ::c_int = 4;
+pub const CLD_STOPPED: ::c_int = 5;
+pub const CLD_CONTINUED: ::c_int = 6;
+
+pub const POLL_IN: ::c_int = 1;
+pub const POLL_OUT: ::c_int = 2;
+pub const POLL_MSG: ::c_int = 3;
+pub const POLL_ERR: ::c_int = 4;
+pub const POLL_PRI: ::c_int = 5;
+pub const POLL_HUP: ::c_int = 6;
+
+pub const SIGEV_SIGNAL: ::c_int = 0;
+pub const SIGEV_NONE: ::c_int = 1;
+pub const SIGEV_THREAD: ::c_int = 2;
+
+pub const REG_GS: ::c_uint = 0;
+pub const REG_FS: ::c_uint = 1;
+pub const REG_ES: ::c_uint = 2;
+pub const REG_DS: ::c_uint = 3;
+pub const REG_EDI: ::c_uint = 4;
+pub const REG_ESI: ::c_uint = 5;
+pub const REG_EBP: ::c_uint = 6;
+pub const REG_ESP: ::c_uint = 7;
+pub const REG_EBX: ::c_uint = 8;
+pub const REG_EDX: ::c_uint = 9;
+pub const REG_ECX: ::c_uint = 10;
+pub const REG_EAX: ::c_uint = 11;
+pub const REG_TRAPNO: ::c_uint = 12;
+pub const REG_ERR: ::c_uint = 13;
+pub const REG_EIP: ::c_uint = 14;
+pub const REG_CS: ::c_uint = 15;
+pub const REG_EFL: ::c_uint = 16;
+pub const REG_UESP: ::c_uint = 17;
+pub const REG_SS: ::c_uint = 18;
+
+pub const IOC_VOID: __ioctl_dir = 0;
+pub const IOC_OUT: __ioctl_dir = 1;
+pub const IOC_IN: __ioctl_dir = 2;
+pub const IOC_INOUT: __ioctl_dir = 3;
+
+pub const IOC_8: __ioctl_datum = 0;
+pub const IOC_16: __ioctl_datum = 1;
+pub const IOC_32: __ioctl_datum = 2;
+pub const IOC_64: __ioctl_datum = 3;
+
+pub const TCP_ESTABLISHED: ::c_uint = 1;
+pub const TCP_SYN_SENT: ::c_uint = 2;
+pub const TCP_SYN_RECV: ::c_uint = 3;
+pub const TCP_FIN_WAIT1: ::c_uint = 4;
+pub const TCP_FIN_WAIT2: ::c_uint = 5;
+pub const TCP_TIME_WAIT: ::c_uint = 6;
+pub const TCP_CLOSE: ::c_uint = 7;
+pub const TCP_CLOSE_WAIT: ::c_uint = 8;
+pub const TCP_LAST_ACK: ::c_uint = 9;
+pub const TCP_LISTEN: ::c_uint = 10;
+pub const TCP_CLOSING: ::c_uint = 11;
+
+pub const TCP_CA_Open: tcp_ca_state = 0;
+pub const TCP_CA_Disorder: tcp_ca_state = 1;
+pub const TCP_CA_CWR: tcp_ca_state = 2;
+pub const TCP_CA_Recovery: tcp_ca_state = 3;
+pub const TCP_CA_Loss: tcp_ca_state = 4;
+
+pub const TCP_NO_QUEUE: ::c_uint = 0;
+pub const TCP_RECV_QUEUE: ::c_uint = 1;
+pub const TCP_SEND_QUEUE: ::c_uint = 2;
+pub const TCP_QUEUES_NR: ::c_uint = 3;
+
+pub const P_ALL: idtype_t = 0;
+pub const P_PID: idtype_t = 1;
+pub const P_PGID: idtype_t = 2;
+
+pub const SS_ONSTACK: ::c_int = 1;
+pub const SS_DISABLE: ::c_int = 4;
+
+pub const SHUT_RD: ::c_int = 0;
+pub const SHUT_WR: ::c_int = 1;
+pub const SHUT_RDWR: ::c_int = 2;
+pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+    __lock: 0,
+    __owner_id: 0,
+    __cnt: 0,
+    __shpid: 0,
+    __type: PTHREAD_MUTEX_TIMED as ::c_int,
+    __flags: 0,
+    __reserved1: 0,
+    __reserved2: 0,
+};
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+    __lock: __PTHREAD_SPIN_LOCK_INITIALIZER,
+    __queue: 0i64 as *mut __pthread,
+    __attr: 0i64 as *mut __pthread_condattr,
+    __wrefs: 0,
+    __data: 0i64 as *mut ::c_void,
+};
+pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+    __held: __PTHREAD_SPIN_LOCK_INITIALIZER,
+    __lock: __PTHREAD_SPIN_LOCK_INITIALIZER,
+    __readers: 0,
+    __readerqueue: 0i64 as *mut __pthread,
+    __writerqueue: 0i64 as *mut __pthread,
+    __attr: 0i64 as *mut __pthread_rwlockattr,
+    __data: 0i64 as *mut ::c_void,
+};
+pub const PTHREAD_STACK_MIN: ::size_t = 0;
+
+const_fn! {
+    {const} fn CMSG_ALIGN(len: usize) -> usize {
+        len + ::mem::size_of::<usize>() - 1 & !(::mem::size_of::<usize>() - 1)
+    }
+}
+
+// functions
+f! {
+    pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
+        if (*mhdr).msg_controllen as usize >= ::mem::size_of::<cmsghdr>() {
+            (*mhdr).msg_control as *mut cmsghdr
+        } else {
+            0 as *mut cmsghdr
+        }
+    }
+
+    pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut ::c_uchar {
+        cmsg.offset(1) as *mut ::c_uchar
+    }
+
+    pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
+        (CMSG_ALIGN(length as usize) + CMSG_ALIGN(::mem::size_of::<cmsghdr>()))
+            as ::c_uint
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        CMSG_ALIGN(::mem::size_of::<cmsghdr>()) as ::c_uint + length
+    }
+
+    pub fn CMSG_NXTHDR(mhdr: *const msghdr,
+                       cmsg: *const cmsghdr) -> *mut cmsghdr {
+        if ((*cmsg).cmsg_len as usize) < ::mem::size_of::<cmsghdr>() {
+            return 0 as *mut cmsghdr;
+        };
+        let next = (cmsg as usize +
+                    CMSG_ALIGN((*cmsg).cmsg_len as usize))
+            as *mut cmsghdr;
+        let max = (*mhdr).msg_control as usize
+            + (*mhdr).msg_controllen as usize;
+        if (next.offset(1)) as usize > max ||
+            next as usize + CMSG_ALIGN((*next).cmsg_len as usize) > max
+        {
+            0 as *mut cmsghdr
+        } else {
+            next as *mut cmsghdr
+        }
+    }
+
+    pub fn CPU_ALLOC_SIZE(count: ::c_int) -> ::size_t {
+        let _dummy: cpu_set_t = ::mem::zeroed();
+        let size_in_bits = 8 * ::mem::size_of_val(&_dummy.bits[0]);
+        ((count as ::size_t + size_in_bits - 1) / 8) as ::size_t
+    }
+
+    pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
+        for slot in cpuset.bits.iter_mut() {
+            *slot = 0;
+        }
+    }
+
+    pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
+        let size_in_bits
+            = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
+        let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
+        cpuset.bits[idx] |= 1 << offset;
+        ()
+    }
+
+    pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
+        let size_in_bits
+            = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
+        let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
+        cpuset.bits[idx] &= !(1 << offset);
+        ()
+    }
+
+    pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {
+        let size_in_bits = 8 * ::mem::size_of_val(&cpuset.bits[0]);
+        let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
+        0 != (cpuset.bits[idx] & (1 << offset))
+    }
+
+    pub fn CPU_COUNT_S(size: usize, cpuset: &cpu_set_t) -> ::c_int {
+        let mut s: u32 = 0;
+        let size_of_mask = ::mem::size_of_val(&cpuset.bits[0]);
+        for i in cpuset.bits[..(size / size_of_mask)].iter() {
+            s += i.count_ones();
+        };
+        s as ::c_int
+    }
+
+    pub fn CPU_COUNT(cpuset: &cpu_set_t) -> ::c_int {
+        CPU_COUNT_S(::mem::size_of::<cpu_set_t>(), cpuset)
+    }
+
+    pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
+        set1.bits == set2.bits
+    }
+
+    pub fn major(dev: ::dev_t) -> ::c_uint {
+         ((dev >> 8) & 0xff) as ::c_uint
+    }
+
+    pub fn minor(dev: ::dev_t) -> ::c_uint {
+        (dev & 0xffff00ff) as ::c_uint
+    }
+
+    pub fn IPTOS_TOS(tos: u8) -> u8 {
+        tos & IPTOS_TOS_MASK
+    }
+
+    pub fn IPTOS_PREC(tos: u8) -> u8 {
+        tos & IPTOS_PREC_MASK
+    }
+
+    pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
+        let fd = fd as usize;
+        let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        (*set).fds_bits[fd / size] &= !(1 << (fd % size));
+        return
+    }
+
+    pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
+        let fd = fd as usize;
+        let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0
+    }
+
+    pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
+        let fd = fd as usize;
+        let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        (*set).fds_bits[fd / size] |= 1 << (fd % size);
+        return
+    }
+
+    pub fn FD_ZERO(set: *mut fd_set) -> () {
+        for slot in (*set).fds_bits.iter_mut() {
+            *slot = 0;
+        }
+    }
+}
+
+extern "C" {
+    pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
+
+    pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
+    pub fn futimens(__fd: ::c_int, __times: *const ::timespec) -> ::c_int;
+
+    pub fn utimensat(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::timespec,
+        flag: ::c_int,
+    ) -> ::c_int;
+
+    pub fn mkfifoat(__fd: ::c_int, __path: *const ::c_char, __mode: __mode_t) -> ::c_int;
+
+    pub fn mknodat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::mode_t,
+        dev: dev_t,
+    ) -> ::c_int;
+
+    pub fn __libc_current_sigrtmin() -> ::c_int;
+
+    pub fn __libc_current_sigrtmax() -> ::c_int;
+
+    pub fn wait4(
+        pid: ::pid_t,
+        status: *mut ::c_int,
+        options: ::c_int,
+        rusage: *mut ::rusage,
+    ) -> ::pid_t;
+
+    pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
+        -> ::c_int;
+
+    pub fn sigwait(__set: *const sigset_t, __sig: *mut ::c_int) -> ::c_int;
+
+    pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
+    pub fn sigtimedwait(
+        set: *const sigset_t,
+        info: *mut siginfo_t,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
+
+    pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
+
+    pub fn ioctl(__fd: ::c_int, __request: ::c_ulong, ...) -> ::c_int;
+
+    pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
+
+    pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int;
+
+    pub fn pread64(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off64_t) -> ::ssize_t;
+    pub fn pwrite64(
+        fd: ::c_int,
+        buf: *const ::c_void,
+        count: ::size_t,
+        offset: off64_t,
+    ) -> ::ssize_t;
+
+    pub fn readv(__fd: ::c_int, __iovec: *const ::iovec, __count: ::c_int) -> ::ssize_t;
+    pub fn writev(__fd: ::c_int, __iovec: *const ::iovec, __count: ::c_int) -> ::ssize_t;
+
+    pub fn preadv(
+        __fd: ::c_int,
+        __iovec: *const ::iovec,
+        __count: ::c_int,
+        __offset: __off_t,
+    ) -> ssize_t;
+    pub fn pwritev(
+        __fd: ::c_int,
+        __iovec: *const ::iovec,
+        __count: ::c_int,
+        __offset: __off_t,
+    ) -> ssize_t;
+
+    pub fn preadv64(
+        fd: ::c_int,
+        iov: *const ::iovec,
+        iovcnt: ::c_int,
+        offset: ::off64_t,
+    ) -> ::ssize_t;
+    pub fn pwritev64(
+        fd: ::c_int,
+        iov: *const ::iovec,
+        iovcnt: ::c_int,
+        offset: ::off64_t,
+    ) -> ::ssize_t;
+
+    pub fn fread_unlocked(
+        buf: *mut ::c_void,
+        size: ::size_t,
+        nobj: ::size_t,
+        stream: *mut ::FILE,
+    ) -> ::size_t;
+
+    pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
+    pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
+    pub fn aio_suspend(
+        aiocb_list: *const *const aiocb,
+        nitems: ::c_int,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+    pub fn lio_listio(
+        mode: ::c_int,
+        aiocb_list: *const *mut aiocb,
+        nitems: ::c_int,
+        sevp: *mut ::sigevent,
+    ) -> ::c_int;
+
+    pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
+    pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
+    pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
+    pub fn mq_receive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+    ) -> ::ssize_t;
+    pub fn mq_timedreceive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::ssize_t;
+    pub fn mq_send(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+    ) -> ::c_int;
+    pub fn mq_timedsend(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
+    pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
+
+    pub fn lseek64(__fd: ::c_int, __offset: __off64_t, __whence: ::c_int) -> __off64_t;
+
+    pub fn lseek(__fd: ::c_int, __offset: __off_t, __whence: ::c_int) -> __off_t;
+
+    pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int;
+    pub fn fseeko64(stream: *mut ::FILE, offset: ::off64_t, whence: ::c_int) -> ::c_int;
+    pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int;
+    pub fn ftello64(stream: *mut ::FILE) -> ::off64_t;
+
+    pub fn bind(__fd: ::c_int, __addr: *const sockaddr, __len: socklen_t) -> ::c_int;
+
+    pub fn accept4(
+        fd: ::c_int,
+        addr: *mut ::sockaddr,
+        len: *mut ::socklen_t,
+        flg: ::c_int,
+    ) -> ::c_int;
+
+    pub fn ppoll(
+        fds: *mut ::pollfd,
+        nfds: nfds_t,
+        timeout: *const ::timespec,
+        sigmask: *const sigset_t,
+    ) -> ::c_int;
+
+    pub fn recvmsg(__fd: ::c_int, __message: *mut msghdr, __flags: ::c_int) -> ::ssize_t;
+
+    pub fn sendmsg(__fd: ::c_int, __message: *const msghdr, __flags: ::c_int) -> ssize_t;
+
+    pub fn recvfrom(
+        socket: ::c_int,
+        buf: *mut ::c_void,
+        len: ::size_t,
+        flags: ::c_int,
+        addr: *mut ::sockaddr,
+        addrlen: *mut ::socklen_t,
+    ) -> ::ssize_t;
+
+    pub fn sendfile(
+        out_fd: ::c_int,
+        in_fd: ::c_int,
+        offset: *mut off_t,
+        count: ::size_t,
+    ) -> ::ssize_t;
+    pub fn sendfile64(
+        out_fd: ::c_int,
+        in_fd: ::c_int,
+        offset: *mut off64_t,
+        count: ::size_t,
+    ) -> ::ssize_t;
+
+    pub fn shutdown(__fd: ::c_int, __how: ::c_int) -> ::c_int;
+
+    pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
+    pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
+    pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int;
+    pub fn if_nameindex() -> *mut if_nameindex;
+    pub fn if_freenameindex(ptr: *mut if_nameindex);
+
+    pub fn getnameinfo(
+        sa: *const ::sockaddr,
+        salen: ::socklen_t,
+        host: *mut ::c_char,
+        hostlen: ::socklen_t,
+        serv: *mut ::c_char,
+        servlen: ::socklen_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+
+    pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
+    pub fn freeifaddrs(ifa: *mut ::ifaddrs);
+
+    pub fn uname(buf: *mut ::utsname) -> ::c_int;
+
+    pub fn gethostid() -> ::c_long;
+    pub fn sethostid(hostid: ::c_long) -> ::c_int;
+
+    pub fn setpwent();
+    pub fn endpwent();
+    pub fn getpwent() -> *mut passwd;
+    pub fn setgrent();
+    pub fn endgrent();
+    pub fn getgrent() -> *mut ::group;
+    pub fn setspent();
+    pub fn endspent();
+    pub fn getspent() -> *mut spwd;
+
+    pub fn getspnam(name: *const ::c_char) -> *mut spwd;
+
+    pub fn getpwent_r(
+        pwd: *mut ::passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::passwd,
+    ) -> ::c_int;
+    pub fn getgrent_r(
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn fgetpwent_r(
+        stream: *mut ::FILE,
+        pwd: *mut ::passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::passwd,
+    ) -> ::c_int;
+    pub fn fgetgrent_r(
+        stream: *mut ::FILE,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+
+    pub fn putpwent(p: *const ::passwd, stream: *mut ::FILE) -> ::c_int;
+    pub fn putgrent(grp: *const ::group, stream: *mut ::FILE) -> ::c_int;
+
+    pub fn getpwnam_r(
+        name: *const ::c_char,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+
+    pub fn getpwuid_r(
+        uid: ::uid_t,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+
+    pub fn fgetspent_r(
+        fp: *mut ::FILE,
+        spbuf: *mut ::spwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        spbufp: *mut *mut ::spwd,
+    ) -> ::c_int;
+    pub fn sgetspent_r(
+        s: *const ::c_char,
+        spbuf: *mut ::spwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        spbufp: *mut *mut ::spwd,
+    ) -> ::c_int;
+    pub fn getspent_r(
+        spbuf: *mut ::spwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        spbufp: *mut *mut ::spwd,
+    ) -> ::c_int;
+
+    pub fn getspnam_r(
+        name: *const ::c_char,
+        spbuf: *mut spwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        spbufp: *mut *mut spwd,
+    ) -> ::c_int;
+
+    // mntent.h
+    pub fn getmntent_r(
+        stream: *mut ::FILE,
+        mntbuf: *mut ::mntent,
+        buf: *mut ::c_char,
+        buflen: ::c_int,
+    ) -> *mut ::mntent;
+
+    pub fn utmpname(file: *const ::c_char) -> ::c_int;
+    pub fn utmpxname(file: *const ::c_char) -> ::c_int;
+    pub fn getutxent() -> *mut utmpx;
+    pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
+    pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
+    pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
+    pub fn setutxent();
+    pub fn endutxent();
+
+    pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int;
+    pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int;
+    pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
+    pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
+
+    pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int;
+
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+
+    pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
+    pub fn getgrnam_r(
+        name: *const ::c_char,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+
+    pub fn getgrouplist(
+        user: *const ::c_char,
+        group: ::gid_t,
+        groups: *mut ::gid_t,
+        ngroups: *mut ::c_int,
+    ) -> ::c_int;
+
+    pub fn setgroups(ngroups: ::size_t, ptr: *const ::gid_t) -> ::c_int;
+
+    pub fn acct(filename: *const ::c_char) -> ::c_int;
+
+    pub fn setmntent(filename: *const ::c_char, ty: *const ::c_char) -> *mut ::FILE;
+    pub fn getmntent(stream: *mut ::FILE) -> *mut ::mntent;
+    pub fn addmntent(stream: *mut ::FILE, mnt: *const ::mntent) -> ::c_int;
+    pub fn endmntent(streamp: *mut ::FILE) -> ::c_int;
+    pub fn hasmntopt(mnt: *const ::mntent, opt: *const ::c_char) -> *mut ::c_char;
+
+    pub fn pthread_create(
+        native: *mut ::pthread_t,
+        attr: *const ::pthread_attr_t,
+        f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
+        value: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn pthread_kill(__threadid: ::pthread_t, __signo: ::c_int) -> ::c_int;
+    pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
+    pub fn __pthread_equal(__t1: __pthread_t, __t2: __pthread_t) -> ::c_int;
+
+    pub fn pthread_getattr_np(__thr: ::pthread_t, __attr: *mut pthread_attr_t) -> ::c_int;
+
+    pub fn pthread_attr_getguardsize(
+        __attr: *const pthread_attr_t,
+        __guardsize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
+
+    pub fn pthread_attr_getstack(
+        __attr: *const pthread_attr_t,
+        __stackaddr: *mut *mut ::c_void,
+        __stacksize: *mut ::size_t,
+    ) -> ::c_int;
+
+    pub fn pthread_mutexattr_getpshared(
+        attr: *const pthread_mutexattr_t,
+        pshared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_mutexattr_setpshared(
+        attr: *mut pthread_mutexattr_t,
+        pshared: ::c_int,
+    ) -> ::c_int;
+
+    pub fn pthread_mutex_timedlock(
+        lock: *mut pthread_mutex_t,
+        abstime: *const ::timespec,
+    ) -> ::c_int;
+
+    pub fn pthread_rwlockattr_getpshared(
+        attr: *const pthread_rwlockattr_t,
+        val: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int;
+
+    pub fn pthread_condattr_getclock(
+        attr: *const pthread_condattr_t,
+        clock_id: *mut clockid_t,
+    ) -> ::c_int;
+    pub fn pthread_condattr_setclock(
+        __attr: *mut pthread_condattr_t,
+        __clock_id: __clockid_t,
+    ) -> ::c_int;
+    pub fn pthread_condattr_getpshared(
+        attr: *const pthread_condattr_t,
+        pshared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int;
+
+    pub fn pthread_once(control: *mut pthread_once_t, routine: extern "C" fn()) -> ::c_int;
+
+    pub fn pthread_barrierattr_init(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_destroy(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_getpshared(
+        attr: *const ::pthread_barrierattr_t,
+        shared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrierattr_setpshared(
+        attr: *mut ::pthread_barrierattr_t,
+        shared: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrier_init(
+        barrier: *mut pthread_barrier_t,
+        attr: *const ::pthread_barrierattr_t,
+        count: ::c_uint,
+    ) -> ::c_int;
+    pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> ::c_int;
+    pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> ::c_int;
+    pub fn pthread_spin_init(lock: *mut ::pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
+    pub fn pthread_spin_destroy(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_lock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_trylock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_unlock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_atfork(
+        prepare: ::Option<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+
+    pub fn pthread_sigmask(
+        __how: ::c_int,
+        __newmask: *const __sigset_t,
+        __oldmask: *mut __sigset_t,
+    ) -> ::c_int;
+
+    pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int;
+    pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
+    pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
+    pub fn sched_setscheduler(
+        pid: ::pid_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn pthread_getschedparam(
+        native: ::pthread_t,
+        policy: *mut ::c_int,
+        param: *mut ::sched_param,
+    ) -> ::c_int;
+    pub fn pthread_setschedparam(
+        native: ::pthread_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+
+    pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int;
+
+    pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
+    pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
+    pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
+    pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
+
+    pub fn clock_getres(__clock_id: clockid_t, __res: *mut ::timespec) -> ::c_int;
+    pub fn clock_gettime(__clock_id: clockid_t, __tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_settime(__clock_id: clockid_t, __tp: *const ::timespec) -> ::c_int;
+    pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int;
+
+    pub fn clock_nanosleep(
+        clk_id: ::clockid_t,
+        flags: ::c_int,
+        rqtp: *const ::timespec,
+        rmtp: *mut ::timespec,
+    ) -> ::c_int;
+
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
+    pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
+
+    pub fn asctime_r(tm: *const ::tm, buf: *mut ::c_char) -> *mut ::c_char;
+    pub fn ctime_r(timep: *const time_t, buf: *mut ::c_char) -> *mut ::c_char;
+
+    pub fn strftime(
+        s: *mut ::c_char,
+        max: ::size_t,
+        format: *const ::c_char,
+        tm: *const ::tm,
+    ) -> ::size_t;
+    pub fn strptime(s: *const ::c_char, format: *const ::c_char, tm: *mut ::tm) -> *mut ::c_char;
+
+    pub fn timer_create(
+        clockid: ::clockid_t,
+        sevp: *mut ::sigevent,
+        timerid: *mut ::timer_t,
+    ) -> ::c_int;
+    pub fn timer_delete(timerid: ::timer_t) -> ::c_int;
+    pub fn timer_getoverrun(timerid: ::timer_t) -> ::c_int;
+    pub fn timer_gettime(timerid: ::timer_t, curr_value: *mut ::itimerspec) -> ::c_int;
+    pub fn timer_settime(
+        timerid: ::timer_t,
+        flags: ::c_int,
+        new_value: *const ::itimerspec,
+        old_value: *mut ::itimerspec,
+    ) -> ::c_int;
+
+    pub fn fstat(__fd: ::c_int, __buf: *mut stat) -> ::c_int;
+    pub fn fstat64(__fd: ::c_int, __buf: *mut stat64) -> ::c_int;
+
+    pub fn fstatat(
+        __fd: ::c_int,
+        __file: *const ::c_char,
+        __buf: *mut stat,
+        __flag: ::c_int,
+    ) -> ::c_int;
+    pub fn fstatat64(
+        __fd: ::c_int,
+        __file: *const ::c_char,
+        __buf: *mut stat64,
+        __flag: ::c_int,
+    ) -> ::c_int;
+
+    pub fn statx(
+        dirfd: ::c_int,
+        pathname: *const c_char,
+        flags: ::c_int,
+        mask: ::c_uint,
+        statxbuf: *mut statx,
+    ) -> ::c_int;
+
+    pub fn ftruncate(__fd: ::c_int, __length: __off_t) -> ::c_int;
+    pub fn ftruncate64(__fd: ::c_int, __length: __off64_t) -> ::c_int;
+    pub fn truncate64(__file: *const ::c_char, __length: __off64_t) -> ::c_int;
+
+    pub fn lstat(__file: *const ::c_char, __buf: *mut stat) -> ::c_int;
+    pub fn lstat64(__file: *const ::c_char, __buf: *mut stat64) -> ::c_int;
+
+    pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
+    pub fn statfs64(__file: *const ::c_char, __buf: *mut statfs64) -> ::c_int;
+    pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
+    pub fn fstatfs64(__fildes: ::c_int, __buf: *mut statfs64) -> ::c_int;
+
+    pub fn statvfs(__file: *const ::c_char, __buf: *mut statvfs) -> ::c_int;
+    pub fn statvfs64(__file: *const ::c_char, __buf: *mut statvfs64) -> ::c_int;
+    pub fn fstatvfs(__fildes: ::c_int, __buf: *mut statvfs) -> ::c_int;
+    pub fn fstatvfs64(__fildes: ::c_int, __buf: *mut statvfs64) -> ::c_int;
+
+    pub fn open(__file: *const ::c_char, __oflag: ::c_int, ...) -> ::c_int;
+    pub fn open64(__file: *const ::c_char, __oflag: ::c_int, ...) -> ::c_int;
+
+    pub fn openat(__fd: ::c_int, __file: *const ::c_char, __oflag: ::c_int, ...) -> ::c_int;
+    pub fn openat64(__fd: ::c_int, __file: *const ::c_char, __oflag: ::c_int, ...) -> ::c_int;
+
+    pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut ::FILE;
+    pub fn freopen64(
+        filename: *const c_char,
+        mode: *const c_char,
+        file: *mut ::FILE,
+    ) -> *mut ::FILE;
+
+    pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int;
+
+    pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
+    pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
+    pub fn tmpfile64() -> *mut ::FILE;
+
+    pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
+
+    pub fn getdtablesize() -> ::c_int;
+
+    // Added in `glibc` 2.34
+    pub fn close_range(first: ::c_uint, last: ::c_uint, flags: ::c_int) -> ::c_int;
+
+    pub fn openpty(
+        __amaster: *mut ::c_int,
+        __aslave: *mut ::c_int,
+        __name: *mut ::c_char,
+        __termp: *const termios,
+        __winp: *const ::winsize,
+    ) -> ::c_int;
+
+    pub fn forkpty(
+        __amaster: *mut ::c_int,
+        __name: *mut ::c_char,
+        __termp: *const termios,
+        __winp: *const ::winsize,
+    ) -> ::pid_t;
+
+    pub fn getpt() -> ::c_int;
+    pub fn ptsname_r(fd: ::c_int, buf: *mut ::c_char, buflen: ::size_t) -> ::c_int;
+    pub fn login_tty(fd: ::c_int) -> ::c_int;
+
+    pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char;
+
+    pub fn clearenv() -> ::c_int;
+
+    pub fn execveat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        argv: *const *mut c_char,
+        envp: *const *mut c_char,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn execvpe(
+        file: *const ::c_char,
+        argv: *const *const ::c_char,
+        envp: *const *const ::c_char,
+    ) -> ::c_int;
+    pub fn fexecve(
+        fd: ::c_int,
+        argv: *const *const ::c_char,
+        envp: *const *const ::c_char,
+    ) -> ::c_int;
+
+    pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
+
+    // posix/spawn.h
+    pub fn posix_spawn(
+        pid: *mut ::pid_t,
+        path: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawnp(
+        pid: *mut ::pid_t,
+        file: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
+    pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
+    pub fn posix_spawnattr_getsigdefault(
+        attr: *const posix_spawnattr_t,
+        default: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigdefault(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getsigmask(
+        attr: *const posix_spawnattr_t,
+        default: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigmask(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getflags(
+        attr: *const posix_spawnattr_t,
+        flags: *mut ::c_short,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int;
+    pub fn posix_spawnattr_getpgroup(
+        attr: *const posix_spawnattr_t,
+        flags: *mut ::pid_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
+    pub fn posix_spawnattr_getschedpolicy(
+        attr: *const posix_spawnattr_t,
+        flags: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int;
+    pub fn posix_spawnattr_getschedparam(
+        attr: *const posix_spawnattr_t,
+        param: *mut ::sched_param,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setschedparam(
+        attr: *mut posix_spawnattr_t,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+
+    pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+    pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+    pub fn posix_spawn_file_actions_addopen(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+        path: *const ::c_char,
+        oflag: ::c_int,
+        mode: ::mode_t,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_addclose(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_adddup2(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+        newfd: ::c_int,
+    ) -> ::c_int;
+
+    // Added in `glibc` 2.29
+    pub fn posix_spawn_file_actions_addchdir_np(
+        actions: *mut ::posix_spawn_file_actions_t,
+        path: *const ::c_char,
+    ) -> ::c_int;
+    // Added in `glibc` 2.29
+    pub fn posix_spawn_file_actions_addfchdir_np(
+        actions: *mut ::posix_spawn_file_actions_t,
+        fd: ::c_int,
+    ) -> ::c_int;
+    // Added in `glibc` 2.34
+    pub fn posix_spawn_file_actions_addclosefrom_np(
+        actions: *mut ::posix_spawn_file_actions_t,
+        from: ::c_int,
+    ) -> ::c_int;
+    // Added in `glibc` 2.35
+    pub fn posix_spawn_file_actions_addtcsetpgrp_np(
+        actions: *mut ::posix_spawn_file_actions_t,
+        tcfd: ::c_int,
+    ) -> ::c_int;
+
+    pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int;
+    pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
+
+    pub fn euidaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
+    pub fn eaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
+
+    pub fn faccessat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::c_int,
+        flags: ::c_int,
+    ) -> ::c_int;
+
+    pub fn stat(__file: *const ::c_char, __buf: *mut stat) -> ::c_int;
+    pub fn stat64(__file: *const ::c_char, __buf: *mut stat64) -> ::c_int;
+
+    pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent;
+    pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64;
+    pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent, result: *mut *mut ::dirent)
+        -> ::c_int;
+    pub fn readdir64_r(
+        dirp: *mut ::DIR,
+        entry: *mut ::dirent64,
+        result: *mut *mut ::dirent64,
+    ) -> ::c_int;
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+    pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
+
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
+
+    #[link_name = "__xpg_strerror_r"]
+    pub fn strerror_r(__errnum: ::c_int, __buf: *mut ::c_char, __buflen: ::size_t) -> ::c_int;
+
+    pub fn __errno_location() -> *mut ::c_int;
+
+    pub fn mmap64(
+        __addr: *mut ::c_void,
+        __len: size_t,
+        __prot: ::c_int,
+        __flags: ::c_int,
+        __fd: ::c_int,
+        __offset: __off64_t,
+    ) -> *mut ::c_void;
+
+    pub fn mremap(
+        addr: *mut ::c_void,
+        len: ::size_t,
+        new_len: ::size_t,
+        flags: ::c_int,
+        ...
+    ) -> *mut ::c_void;
+
+    pub fn mprotect(__addr: *mut ::c_void, __len: ::size_t, __prot: ::c_int) -> ::c_int;
+
+    pub fn msync(__addr: *mut ::c_void, __len: ::size_t, __flags: ::c_int) -> ::c_int;
+    pub fn sync();
+    pub fn syncfs(fd: ::c_int) -> ::c_int;
+    pub fn fdatasync(fd: ::c_int) -> ::c_int;
+
+    pub fn fallocate64(fd: ::c_int, mode: ::c_int, offset: ::off64_t, len: ::off64_t) -> ::c_int;
+    pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+    pub fn posix_fallocate64(fd: ::c_int, offset: ::off64_t, len: ::off64_t) -> ::c_int;
+
+    pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
+
+    pub fn posix_fadvise64(
+        fd: ::c_int,
+        offset: ::off64_t,
+        len: ::off64_t,
+        advise: ::c_int,
+    ) -> ::c_int;
+
+    pub fn madvise(__addr: *mut ::c_void, __len: ::size_t, __advice: ::c_int) -> ::c_int;
+
+    pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+
+    pub fn getrlimit(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit) -> ::c_int;
+    pub fn getrlimit64(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit64) -> ::c_int;
+    pub fn setrlimit(resource: ::__rlimit_resource_t, rlim: *const ::rlimit) -> ::c_int;
+    pub fn setrlimit64(resource: ::__rlimit_resource_t, rlim: *const ::rlimit64) -> ::c_int;
+
+    pub fn getpriority(which: ::__priority_which, who: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::__priority_which, who: ::id_t, prio: ::c_int) -> ::c_int;
+
+    pub fn getrandom(__buffer: *mut ::c_void, __length: ::size_t, __flags: ::c_uint) -> ::ssize_t;
+    pub fn getentropy(__buffer: *mut ::c_void, __length: ::size_t) -> ::c_int;
+
+    pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
+    pub fn memmem(
+        haystack: *const ::c_void,
+        haystacklen: ::size_t,
+        needle: *const ::c_void,
+        needlelen: ::size_t,
+    ) -> *mut ::c_void;
+    pub fn strchrnul(s: *const ::c_char, c: ::c_int) -> *mut ::c_char;
+
+    pub fn abs(i: ::c_int) -> ::c_int;
+    pub fn labs(i: ::c_long) -> ::c_long;
+    pub fn rand() -> ::c_int;
+    pub fn srand(seed: ::c_uint);
+
+    pub fn drand48() -> ::c_double;
+    pub fn erand48(xseed: *mut ::c_ushort) -> ::c_double;
+    pub fn lrand48() -> ::c_long;
+    pub fn nrand48(xseed: *mut ::c_ushort) -> ::c_long;
+    pub fn mrand48() -> ::c_long;
+    pub fn jrand48(xseed: *mut ::c_ushort) -> ::c_long;
+    pub fn srand48(seed: ::c_long);
+    pub fn seed48(xseed: *mut ::c_ushort) -> *mut ::c_ushort;
+    pub fn lcong48(p: *mut ::c_ushort);
+
+    pub fn qsort_r(
+        base: *mut ::c_void,
+        num: ::size_t,
+        size: ::size_t,
+        compar: ::Option<
+            unsafe extern "C" fn(*const ::c_void, *const ::c_void, *mut ::c_void) -> ::c_int,
+        >,
+        arg: *mut ::c_void,
+    );
+
+    pub fn brk(addr: *mut ::c_void) -> ::c_int;
+    pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
+
+    pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
+    pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int;
+
+    pub fn mallinfo() -> ::mallinfo;
+    pub fn mallinfo2() -> ::mallinfo2;
+    pub fn malloc_info(options: ::c_int, stream: *mut ::FILE) -> ::c_int;
+    pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;
+    pub fn malloc_trim(__pad: ::size_t) -> ::c_int;
+
+    pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
+    pub fn iconv(
+        cd: iconv_t,
+        inbuf: *mut *mut ::c_char,
+        inbytesleft: *mut ::size_t,
+        outbuf: *mut *mut ::c_char,
+        outbytesleft: *mut ::size_t,
+    ) -> ::size_t;
+    pub fn iconv_close(cd: iconv_t) -> ::c_int;
+
+    pub fn getopt_long(
+        argc: ::c_int,
+        argv: *const *mut c_char,
+        optstring: *const c_char,
+        longopts: *const option,
+        longindex: *mut ::c_int,
+    ) -> ::c_int;
+
+    pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int;
+
+    pub fn reboot(how_to: ::c_int) -> ::c_int;
+
+    pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
+
+    pub fn regexec(
+        preg: *const ::regex_t,
+        input: *const ::c_char,
+        nmatch: ::size_t,
+        pmatch: *mut regmatch_t,
+        eflags: ::c_int,
+    ) -> ::c_int;
+
+    pub fn regerror(
+        errcode: ::c_int,
+        preg: *const ::regex_t,
+        errbuf: *mut ::c_char,
+        errbuf_size: ::size_t,
+    ) -> ::size_t;
+
+    pub fn regfree(preg: *mut ::regex_t);
+
+    pub fn glob(
+        pattern: *const c_char,
+        flags: ::c_int,
+        errfunc: ::Option<extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut ::glob_t,
+    ) -> ::c_int;
+    pub fn globfree(pglob: *mut ::glob_t);
+
+    pub fn glob64(
+        pattern: *const ::c_char,
+        flags: ::c_int,
+        errfunc: ::Option<extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut glob64_t,
+    ) -> ::c_int;
+    pub fn globfree64(pglob: *mut glob64_t);
+
+    pub fn getxattr(
+        path: *const c_char,
+        name: *const c_char,
+        value: *mut ::c_void,
+        size: ::size_t,
+    ) -> ::ssize_t;
+    pub fn lgetxattr(
+        path: *const c_char,
+        name: *const c_char,
+        value: *mut ::c_void,
+        size: ::size_t,
+    ) -> ::ssize_t;
+    pub fn fgetxattr(
+        filedes: ::c_int,
+        name: *const c_char,
+        value: *mut ::c_void,
+        size: ::size_t,
+    ) -> ::ssize_t;
+    pub fn setxattr(
+        path: *const c_char,
+        name: *const c_char,
+        value: *const ::c_void,
+        size: ::size_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn lsetxattr(
+        path: *const c_char,
+        name: *const c_char,
+        value: *const ::c_void,
+        size: ::size_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn fsetxattr(
+        filedes: ::c_int,
+        name: *const c_char,
+        value: *const ::c_void,
+        size: ::size_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn listxattr(path: *const c_char, list: *mut c_char, size: ::size_t) -> ::ssize_t;
+    pub fn llistxattr(path: *const c_char, list: *mut c_char, size: ::size_t) -> ::ssize_t;
+    pub fn flistxattr(filedes: ::c_int, list: *mut c_char, size: ::size_t) -> ::ssize_t;
+    pub fn removexattr(path: *const c_char, name: *const c_char) -> ::c_int;
+    pub fn lremovexattr(path: *const c_char, name: *const c_char) -> ::c_int;
+    pub fn fremovexattr(filedes: ::c_int, name: *const c_char) -> ::c_int;
+
+    pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+    /// POSIX version of `basename(3)`, defined in `libgen.h`.
+    #[link_name = "__xpg_basename"]
+    pub fn posix_basename(path: *mut ::c_char) -> *mut ::c_char;
+    /// GNU version of `basename(3)`, defined in `string.h`.
+    #[link_name = "basename"]
+    pub fn gnu_basename(path: *const ::c_char) -> *mut ::c_char;
+
+    pub fn dlmopen(lmid: Lmid_t, filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void;
+    pub fn dlinfo(handle: *mut ::c_void, request: ::c_int, info: *mut ::c_void) -> ::c_int;
+    pub fn dladdr1(
+        addr: *const ::c_void,
+        info: *mut ::Dl_info,
+        extra_info: *mut *mut ::c_void,
+        flags: ::c_int,
+    ) -> ::c_int;
+
+    pub fn duplocale(base: ::locale_t) -> ::locale_t;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+    pub fn uselocale(loc: ::locale_t) -> ::locale_t;
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+    pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
+
+    pub fn dl_iterate_phdr(
+        callback: ::Option<
+            unsafe extern "C" fn(
+                info: *mut ::dl_phdr_info,
+                size: ::size_t,
+                data: *mut ::c_void,
+            ) -> ::c_int,
+        >,
+        data: *mut ::c_void,
+    ) -> ::c_int;
+
+    pub fn gnu_get_libc_release() -> *const ::c_char;
+    pub fn gnu_get_libc_version() -> *const ::c_char;
+}
+
+safe_f! {
+    pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::dev_t;
+        let mut dev = 0;
+        dev |= major << 8;
+        dev |= minor;
+        dev
+    }
+
+    pub fn SIGRTMAX() -> ::c_int {
+        unsafe { __libc_current_sigrtmax() }
+    }
+
+    pub fn SIGRTMIN() -> ::c_int {
+        unsafe { __libc_current_sigrtmin() }
+    }
+
+    pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
+        (status & 0xff) == 0x7f
+    }
+
+    pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
+        (status >> 8) & 0xff
+    }
+
+    pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
+        status == 0xffff
+    }
+
+    pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
+        ((status & 0x7f) + 1) as i8 >= 2
+    }
+
+    pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int {
+        status & 0x7f
+    }
+
+    pub {const} fn WIFEXITED(status: ::c_int) -> bool {
+        (status & 0x7f) == 0
+    }
+
+    pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int {
+        (status >> 8) & 0xff
+    }
+
+    pub {const} fn WCOREDUMP(status: ::c_int) -> bool {
+        (status & 0x80) != 0
+    }
+
+    pub {const} fn W_EXITCODE(ret: ::c_int, sig: ::c_int) -> ::c_int {
+        (ret << 8) | sig
+    }
+
+    pub {const} fn W_STOPCODE(sig: ::c_int) -> ::c_int {
+        (sig << 8) | 0x7f
+    }
+
+    pub {const} fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int {
+        (cmd << 8) | (type_ & 0x00ff)
+    }
+
+    pub {const} fn IPOPT_COPIED(o: u8) -> u8 {
+        o & IPOPT_COPY
+    }
+
+    pub {const} fn IPOPT_CLASS(o: u8) -> u8 {
+        o & IPOPT_CLASS_MASK
+    }
+
+    pub {const} fn IPOPT_NUMBER(o: u8) -> u8 {
+        o & IPOPT_NUMBER_MASK
+    }
+
+    pub {const} fn IPTOS_ECN(x: u8) -> u8 {
+        x & ::IPTOS_ECN_MASK
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    } else {
+        mod no_align;
+        pub use self::no_align::*;
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_pointer_width = "64")] {
+        mod b64;
+        pub use self::b64::*;
+    } else {
+        mod b32;
+        pub use self::b32::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/hurd/no_align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/hurd/no_align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/hurd/no_align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/hurd/no_align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+// Placeholder file
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b32/arm.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b32/arm.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b32/arm.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b32/arm.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,550 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
+pub type greg_t = i32;
+pub type mcontext_t = sigcontext;
+
+s! {
+    pub struct sigcontext {
+        pub trap_no: ::c_ulong,
+        pub error_code: ::c_ulong,
+        pub oldmask: ::c_ulong,
+        pub arm_r0: ::c_ulong,
+        pub arm_r1: ::c_ulong,
+        pub arm_r2: ::c_ulong,
+        pub arm_r3: ::c_ulong,
+        pub arm_r4: ::c_ulong,
+        pub arm_r5: ::c_ulong,
+        pub arm_r6: ::c_ulong,
+        pub arm_r7: ::c_ulong,
+        pub arm_r8: ::c_ulong,
+        pub arm_r9: ::c_ulong,
+        pub arm_r10: ::c_ulong,
+        pub arm_fp: ::c_ulong,
+        pub arm_ip: ::c_ulong,
+        pub arm_sp: ::c_ulong,
+        pub arm_lr: ::c_ulong,
+        pub arm_pc: ::c_ulong,
+        pub arm_cpsr: ::c_ulong,
+        pub fault_address: ::c_ulong,
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        s_no_extra_traits! {
+            pub struct __c_anonymous_uc_sigmask_with_padding {
+                pub uc_sigmask: ::sigset_t,
+                /* Android has a wrong (smaller) sigset_t on x86. */
+                __padding_rt_sigset: u32,
+            }
+
+            pub union __c_anonymous_uc_sigmask {
+                uc_sigmask: __c_anonymous_uc_sigmask_with_padding,
+                uc_sigmask64: ::sigset64_t,
+            }
+
+            pub struct ucontext_t {
+                pub uc_flags: ::c_ulong,
+                pub uc_link: *mut ucontext_t,
+                pub uc_stack: ::stack_t,
+                pub uc_mcontext: mcontext_t,
+                pub uc_sigmask__c_anonymous_union: __c_anonymous_uc_sigmask,
+                /* The kernel adds extra padding after uc_sigmask to match
+                 * glibc sigset_t on ARM. */
+                __padding: [c_char; 120],
+                __align: [::c_longlong; 0],
+                uc_regspace: [::c_ulong; 128],
+            }
+        }
+
+        cfg_if! {
+            if #[cfg(feature = "extra_traits")] {
+                impl PartialEq for __c_anonymous_uc_sigmask_with_padding {
+                    fn eq(
+                        &self, other: &__c_anonymous_uc_sigmask_with_padding
+                    ) -> bool {
+                        self.uc_sigmask == other.uc_sigmask
+                            // Ignore padding
+                    }
+                }
+                impl Eq for __c_anonymous_uc_sigmask_with_padding {}
+                impl ::fmt::Debug for __c_anonymous_uc_sigmask_with_padding {
+                    fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                        f.debug_struct("uc_sigmask_with_padding")
+                            .field("uc_sigmask_with_padding", &self.uc_sigmask)
+                            // Ignore padding
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for __c_anonymous_uc_sigmask_with_padding {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        self.uc_sigmask.hash(state)
+                            // Ignore padding
+                    }
+                }
+
+                impl PartialEq for __c_anonymous_uc_sigmask {
+                    fn eq(&self, other: &__c_anonymous_uc_sigmask) -> bool {
+                        unsafe { self.uc_sigmask == other.uc_sigmask }
+                    }
+                }
+                impl Eq for __c_anonymous_uc_sigmask {}
+                impl ::fmt::Debug for __c_anonymous_uc_sigmask {
+                    fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                        f.debug_struct("uc_sigmask")
+                            .field("uc_sigmask", unsafe { &self.uc_sigmask })
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for __c_anonymous_uc_sigmask {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        unsafe { self.uc_sigmask.hash(state) }
+                    }
+                }
+
+                impl PartialEq for ucontext_t {
+                    fn eq(&self, other: &Self) -> bool {
+                        self.uc_flags == other.uc_flags
+                            && self.uc_link == other.uc_link
+                            && self.uc_stack == other.uc_stack
+                            && self.uc_mcontext == other.uc_mcontext
+                            && self.uc_sigmask__c_anonymous_union
+                                == other.uc_sigmask__c_anonymous_union
+                            && &self.uc_regspace[..] == &other.uc_regspace[..]
+                            // Ignore padding field
+                    }
+                }
+                impl Eq for ucontext_t {}
+                impl ::fmt::Debug for ucontext_t {
+                    fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                        f.debug_struct("ucontext_t")
+                            .field("uc_flags", &self.uc_flags)
+                            .field("uc_link", &self.uc_link)
+                            .field("uc_stack", &self.uc_stack)
+                            .field("uc_mcontext", &self.uc_mcontext)
+                            .field(
+                                "uc_sigmask__c_anonymous_union",
+                                &self.uc_sigmask__c_anonymous_union
+                            )
+                            .field("uc_regspace", &&self.uc_regspace[..])
+                            // Ignore padding field
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for ucontext_t {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        self.uc_flags.hash(state);
+                        self.uc_link.hash(state);
+                        self.uc_stack.hash(state);
+                        self.uc_mcontext.hash(state);
+                        self.uc_sigmask__c_anonymous_union.hash(state);
+                        self.uc_regspace[..].hash(state);
+                        // Ignore padding field
+                    }
+                }
+            }
+        }
+    }
+}
+
+pub const O_DIRECT: ::c_int = 0x10000;
+pub const O_DIRECTORY: ::c_int = 0x4000;
+pub const O_NOFOLLOW: ::c_int = 0x8000;
+pub const O_LARGEFILE: ::c_int = 0o400000;
+
+pub const SYS_restart_syscall: ::c_long = 0;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execve: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lchown: ::c_long = 16;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_mount: ::c_long = 21;
+pub const SYS_setuid: ::c_long = 23;
+pub const SYS_getuid: ::c_long = 24;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_setgid: ::c_long = 46;
+pub const SYS_getgid: ::c_long = 47;
+pub const SYS_geteuid: ::c_long = 49;
+pub const SYS_getegid: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount2: ::c_long = 52;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_setreuid: ::c_long = 70;
+pub const SYS_setregid: ::c_long = 71;
+pub const SYS_sigsuspend: ::c_long = 72;
+pub const SYS_sigpending: ::c_long = 73;
+pub const SYS_sethostname: ::c_long = 74;
+pub const SYS_setrlimit: ::c_long = 75;
+pub const SYS_getrusage: ::c_long = 77;
+pub const SYS_gettimeofday: ::c_long = 78;
+pub const SYS_settimeofday: ::c_long = 79;
+pub const SYS_getgroups: ::c_long = 80;
+pub const SYS_setgroups: ::c_long = 81;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_readlink: ::c_long = 85;
+pub const SYS_uselib: ::c_long = 86;
+pub const SYS_swapon: ::c_long = 87;
+pub const SYS_reboot: ::c_long = 88;
+pub const SYS_munmap: ::c_long = 91;
+pub const SYS_truncate: ::c_long = 92;
+pub const SYS_ftruncate: ::c_long = 93;
+pub const SYS_fchmod: ::c_long = 94;
+pub const SYS_fchown: ::c_long = 95;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_setitimer: ::c_long = 104;
+pub const SYS_getitimer: ::c_long = 105;
+pub const SYS_stat: ::c_long = 106;
+pub const SYS_lstat: ::c_long = 107;
+pub const SYS_fstat: ::c_long = 108;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_fsync: ::c_long = 118;
+pub const SYS_sigreturn: ::c_long = 119;
+pub const SYS_clone: ::c_long = 120;
+pub const SYS_setdomainname: ::c_long = 121;
+pub const SYS_uname: ::c_long = 122;
+pub const SYS_adjtimex: ::c_long = 124;
+pub const SYS_mprotect: ::c_long = 125;
+pub const SYS_sigprocmask: ::c_long = 126;
+pub const SYS_init_module: ::c_long = 128;
+pub const SYS_delete_module: ::c_long = 129;
+pub const SYS_quotactl: ::c_long = 131;
+pub const SYS_getpgid: ::c_long = 132;
+pub const SYS_fchdir: ::c_long = 133;
+pub const SYS_bdflush: ::c_long = 134;
+pub const SYS_sysfs: ::c_long = 135;
+pub const SYS_personality: ::c_long = 136;
+pub const SYS_setfsuid: ::c_long = 138;
+pub const SYS_setfsgid: ::c_long = 139;
+pub const SYS_getdents: ::c_long = 141;
+pub const SYS_flock: ::c_long = 143;
+pub const SYS_msync: ::c_long = 144;
+pub const SYS_readv: ::c_long = 145;
+pub const SYS_writev: ::c_long = 146;
+pub const SYS_getsid: ::c_long = 147;
+pub const SYS_fdatasync: ::c_long = 148;
+pub const SYS_mlock: ::c_long = 150;
+pub const SYS_munlock: ::c_long = 151;
+pub const SYS_mlockall: ::c_long = 152;
+pub const SYS_munlockall: ::c_long = 153;
+pub const SYS_sched_setparam: ::c_long = 154;
+pub const SYS_sched_getparam: ::c_long = 155;
+pub const SYS_sched_setscheduler: ::c_long = 156;
+pub const SYS_sched_getscheduler: ::c_long = 157;
+pub const SYS_sched_yield: ::c_long = 158;
+pub const SYS_sched_get_priority_max: ::c_long = 159;
+pub const SYS_sched_get_priority_min: ::c_long = 160;
+pub const SYS_sched_rr_get_interval: ::c_long = 161;
+pub const SYS_nanosleep: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_setresuid: ::c_long = 164;
+pub const SYS_getresuid: ::c_long = 165;
+pub const SYS_poll: ::c_long = 168;
+pub const SYS_nfsservctl: ::c_long = 169;
+pub const SYS_setresgid: ::c_long = 170;
+pub const SYS_getresgid: ::c_long = 171;
+pub const SYS_prctl: ::c_long = 172;
+pub const SYS_rt_sigreturn: ::c_long = 173;
+pub const SYS_rt_sigaction: ::c_long = 174;
+pub const SYS_rt_sigprocmask: ::c_long = 175;
+pub const SYS_rt_sigpending: ::c_long = 176;
+pub const SYS_rt_sigtimedwait: ::c_long = 177;
+pub const SYS_rt_sigqueueinfo: ::c_long = 178;
+pub const SYS_rt_sigsuspend: ::c_long = 179;
+pub const SYS_pread64: ::c_long = 180;
+pub const SYS_pwrite64: ::c_long = 181;
+pub const SYS_chown: ::c_long = 182;
+pub const SYS_getcwd: ::c_long = 183;
+pub const SYS_capget: ::c_long = 184;
+pub const SYS_capset: ::c_long = 185;
+pub const SYS_sigaltstack: ::c_long = 186;
+pub const SYS_sendfile: ::c_long = 187;
+pub const SYS_vfork: ::c_long = 190;
+pub const SYS_ugetrlimit: ::c_long = 191;
+pub const SYS_mmap2: ::c_long = 192;
+pub const SYS_truncate64: ::c_long = 193;
+pub const SYS_ftruncate64: ::c_long = 194;
+pub const SYS_stat64: ::c_long = 195;
+pub const SYS_lstat64: ::c_long = 196;
+pub const SYS_fstat64: ::c_long = 197;
+pub const SYS_lchown32: ::c_long = 198;
+pub const SYS_getuid32: ::c_long = 199;
+pub const SYS_getgid32: ::c_long = 200;
+pub const SYS_geteuid32: ::c_long = 201;
+pub const SYS_getegid32: ::c_long = 202;
+pub const SYS_setreuid32: ::c_long = 203;
+pub const SYS_setregid32: ::c_long = 204;
+pub const SYS_getgroups32: ::c_long = 205;
+pub const SYS_setgroups32: ::c_long = 206;
+pub const SYS_fchown32: ::c_long = 207;
+pub const SYS_setresuid32: ::c_long = 208;
+pub const SYS_getresuid32: ::c_long = 209;
+pub const SYS_setresgid32: ::c_long = 210;
+pub const SYS_getresgid32: ::c_long = 211;
+pub const SYS_chown32: ::c_long = 212;
+pub const SYS_setuid32: ::c_long = 213;
+pub const SYS_setgid32: ::c_long = 214;
+pub const SYS_setfsuid32: ::c_long = 215;
+pub const SYS_setfsgid32: ::c_long = 216;
+pub const SYS_getdents64: ::c_long = 217;
+pub const SYS_pivot_root: ::c_long = 218;
+pub const SYS_mincore: ::c_long = 219;
+pub const SYS_madvise: ::c_long = 220;
+pub const SYS_fcntl64: ::c_long = 221;
+pub const SYS_gettid: ::c_long = 224;
+pub const SYS_readahead: ::c_long = 225;
+pub const SYS_setxattr: ::c_long = 226;
+pub const SYS_lsetxattr: ::c_long = 227;
+pub const SYS_fsetxattr: ::c_long = 228;
+pub const SYS_getxattr: ::c_long = 229;
+pub const SYS_lgetxattr: ::c_long = 230;
+pub const SYS_fgetxattr: ::c_long = 231;
+pub const SYS_listxattr: ::c_long = 232;
+pub const SYS_llistxattr: ::c_long = 233;
+pub const SYS_flistxattr: ::c_long = 234;
+pub const SYS_removexattr: ::c_long = 235;
+pub const SYS_lremovexattr: ::c_long = 236;
+pub const SYS_fremovexattr: ::c_long = 237;
+pub const SYS_tkill: ::c_long = 238;
+pub const SYS_sendfile64: ::c_long = 239;
+pub const SYS_futex: ::c_long = 240;
+pub const SYS_sched_setaffinity: ::c_long = 241;
+pub const SYS_sched_getaffinity: ::c_long = 242;
+pub const SYS_io_setup: ::c_long = 243;
+pub const SYS_io_destroy: ::c_long = 244;
+pub const SYS_io_getevents: ::c_long = 245;
+pub const SYS_io_submit: ::c_long = 246;
+pub const SYS_io_cancel: ::c_long = 247;
+pub const SYS_exit_group: ::c_long = 248;
+pub const SYS_lookup_dcookie: ::c_long = 249;
+pub const SYS_epoll_create: ::c_long = 250;
+pub const SYS_epoll_ctl: ::c_long = 251;
+pub const SYS_epoll_wait: ::c_long = 252;
+pub const SYS_remap_file_pages: ::c_long = 253;
+pub const SYS_set_tid_address: ::c_long = 256;
+pub const SYS_timer_create: ::c_long = 257;
+pub const SYS_timer_settime: ::c_long = 258;
+pub const SYS_timer_gettime: ::c_long = 259;
+pub const SYS_timer_getoverrun: ::c_long = 260;
+pub const SYS_timer_delete: ::c_long = 261;
+pub const SYS_clock_settime: ::c_long = 262;
+pub const SYS_clock_gettime: ::c_long = 263;
+pub const SYS_clock_getres: ::c_long = 264;
+pub const SYS_clock_nanosleep: ::c_long = 265;
+pub const SYS_statfs64: ::c_long = 266;
+pub const SYS_fstatfs64: ::c_long = 267;
+pub const SYS_tgkill: ::c_long = 268;
+pub const SYS_utimes: ::c_long = 269;
+pub const SYS_arm_fadvise64_64: ::c_long = 270;
+pub const SYS_pciconfig_iobase: ::c_long = 271;
+pub const SYS_pciconfig_read: ::c_long = 272;
+pub const SYS_pciconfig_write: ::c_long = 273;
+pub const SYS_mq_open: ::c_long = 274;
+pub const SYS_mq_unlink: ::c_long = 275;
+pub const SYS_mq_timedsend: ::c_long = 276;
+pub const SYS_mq_timedreceive: ::c_long = 277;
+pub const SYS_mq_notify: ::c_long = 278;
+pub const SYS_mq_getsetattr: ::c_long = 279;
+pub const SYS_waitid: ::c_long = 280;
+pub const SYS_socket: ::c_long = 281;
+pub const SYS_bind: ::c_long = 282;
+pub const SYS_connect: ::c_long = 283;
+pub const SYS_listen: ::c_long = 284;
+pub const SYS_accept: ::c_long = 285;
+pub const SYS_getsockname: ::c_long = 286;
+pub const SYS_getpeername: ::c_long = 287;
+pub const SYS_socketpair: ::c_long = 288;
+pub const SYS_send: ::c_long = 289;
+pub const SYS_sendto: ::c_long = 290;
+pub const SYS_recv: ::c_long = 291;
+pub const SYS_recvfrom: ::c_long = 292;
+pub const SYS_shutdown: ::c_long = 293;
+pub const SYS_setsockopt: ::c_long = 294;
+pub const SYS_getsockopt: ::c_long = 295;
+pub const SYS_sendmsg: ::c_long = 296;
+pub const SYS_recvmsg: ::c_long = 297;
+pub const SYS_semop: ::c_long = 298;
+pub const SYS_semget: ::c_long = 299;
+pub const SYS_semctl: ::c_long = 300;
+pub const SYS_msgsnd: ::c_long = 301;
+pub const SYS_msgrcv: ::c_long = 302;
+pub const SYS_msgget: ::c_long = 303;
+pub const SYS_msgctl: ::c_long = 304;
+pub const SYS_shmat: ::c_long = 305;
+pub const SYS_shmdt: ::c_long = 306;
+pub const SYS_shmget: ::c_long = 307;
+pub const SYS_shmctl: ::c_long = 308;
+pub const SYS_add_key: ::c_long = 309;
+pub const SYS_request_key: ::c_long = 310;
+pub const SYS_keyctl: ::c_long = 311;
+pub const SYS_semtimedop: ::c_long = 312;
+pub const SYS_vserver: ::c_long = 313;
+pub const SYS_ioprio_set: ::c_long = 314;
+pub const SYS_ioprio_get: ::c_long = 315;
+pub const SYS_inotify_init: ::c_long = 316;
+pub const SYS_inotify_add_watch: ::c_long = 317;
+pub const SYS_inotify_rm_watch: ::c_long = 318;
+pub const SYS_mbind: ::c_long = 319;
+pub const SYS_get_mempolicy: ::c_long = 320;
+pub const SYS_set_mempolicy: ::c_long = 321;
+pub const SYS_openat: ::c_long = 322;
+pub const SYS_mkdirat: ::c_long = 323;
+pub const SYS_mknodat: ::c_long = 324;
+pub const SYS_fchownat: ::c_long = 325;
+pub const SYS_futimesat: ::c_long = 326;
+pub const SYS_fstatat64: ::c_long = 327;
+pub const SYS_unlinkat: ::c_long = 328;
+pub const SYS_renameat: ::c_long = 329;
+pub const SYS_linkat: ::c_long = 330;
+pub const SYS_symlinkat: ::c_long = 331;
+pub const SYS_readlinkat: ::c_long = 332;
+pub const SYS_fchmodat: ::c_long = 333;
+pub const SYS_faccessat: ::c_long = 334;
+pub const SYS_pselect6: ::c_long = 335;
+pub const SYS_ppoll: ::c_long = 336;
+pub const SYS_unshare: ::c_long = 337;
+pub const SYS_set_robust_list: ::c_long = 338;
+pub const SYS_get_robust_list: ::c_long = 339;
+pub const SYS_splice: ::c_long = 340;
+pub const SYS_arm_sync_file_range: ::c_long = 341;
+pub const SYS_tee: ::c_long = 342;
+pub const SYS_vmsplice: ::c_long = 343;
+pub const SYS_move_pages: ::c_long = 344;
+pub const SYS_getcpu: ::c_long = 345;
+pub const SYS_epoll_pwait: ::c_long = 346;
+pub const SYS_kexec_load: ::c_long = 347;
+pub const SYS_utimensat: ::c_long = 348;
+pub const SYS_signalfd: ::c_long = 349;
+pub const SYS_timerfd_create: ::c_long = 350;
+pub const SYS_eventfd: ::c_long = 351;
+pub const SYS_fallocate: ::c_long = 352;
+pub const SYS_timerfd_settime: ::c_long = 353;
+pub const SYS_timerfd_gettime: ::c_long = 354;
+pub const SYS_signalfd4: ::c_long = 355;
+pub const SYS_eventfd2: ::c_long = 356;
+pub const SYS_epoll_create1: ::c_long = 357;
+pub const SYS_dup3: ::c_long = 358;
+pub const SYS_pipe2: ::c_long = 359;
+pub const SYS_inotify_init1: ::c_long = 360;
+pub const SYS_preadv: ::c_long = 361;
+pub const SYS_pwritev: ::c_long = 362;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 363;
+pub const SYS_perf_event_open: ::c_long = 364;
+pub const SYS_recvmmsg: ::c_long = 365;
+pub const SYS_accept4: ::c_long = 366;
+pub const SYS_fanotify_init: ::c_long = 367;
+pub const SYS_fanotify_mark: ::c_long = 368;
+pub const SYS_prlimit64: ::c_long = 369;
+pub const SYS_name_to_handle_at: ::c_long = 370;
+pub const SYS_open_by_handle_at: ::c_long = 371;
+pub const SYS_clock_adjtime: ::c_long = 372;
+pub const SYS_syncfs: ::c_long = 373;
+pub const SYS_sendmmsg: ::c_long = 374;
+pub const SYS_setns: ::c_long = 375;
+pub const SYS_process_vm_readv: ::c_long = 376;
+pub const SYS_process_vm_writev: ::c_long = 377;
+pub const SYS_kcmp: ::c_long = 378;
+pub const SYS_finit_module: ::c_long = 379;
+pub const SYS_sched_setattr: ::c_long = 380;
+pub const SYS_sched_getattr: ::c_long = 381;
+pub const SYS_renameat2: ::c_long = 382;
+pub const SYS_seccomp: ::c_long = 383;
+pub const SYS_getrandom: ::c_long = 384;
+pub const SYS_memfd_create: ::c_long = 385;
+pub const SYS_bpf: ::c_long = 386;
+pub const SYS_execveat: ::c_long = 387;
+pub const SYS_userfaultfd: ::c_long = 388;
+pub const SYS_membarrier: ::c_long = 389;
+pub const SYS_mlock2: ::c_long = 390;
+pub const SYS_copy_file_range: ::c_long = 391;
+pub const SYS_preadv2: ::c_long = 392;
+pub const SYS_pwritev2: ::c_long = 393;
+pub const SYS_pkey_mprotect: ::c_long = 394;
+pub const SYS_pkey_alloc: ::c_long = 395;
+pub const SYS_pkey_free: ::c_long = 396;
+pub const SYS_statx: ::c_long = 397;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+
+// offsets in mcontext_t.gregs from sys/ucontext.h
+pub const REG_R0: ::c_int = 0;
+pub const REG_R1: ::c_int = 1;
+pub const REG_R2: ::c_int = 2;
+pub const REG_R3: ::c_int = 3;
+pub const REG_R4: ::c_int = 4;
+pub const REG_R5: ::c_int = 5;
+pub const REG_R6: ::c_int = 6;
+pub const REG_R7: ::c_int = 7;
+pub const REG_R8: ::c_int = 8;
+pub const REG_R9: ::c_int = 9;
+pub const REG_R10: ::c_int = 10;
+pub const REG_R11: ::c_int = 11;
+pub const REG_R12: ::c_int = 12;
+pub const REG_R13: ::c_int = 13;
+pub const REG_R14: ::c_int = 14;
+pub const REG_R15: ::c_int = 15;
+
+pub const NGREG: ::c_int = 18;
+
+f! {
+    // Sadly, Android before 5.0 (API level 21), the accept4 syscall is not
+    // exposed by the libc. As work-around, we implement it through `syscall`
+    // directly. This workaround can be removed if the minimum version of
+    // Android is bumped. When the workaround is removed, `accept4` can be
+    // moved back to `linux_like/mod.rs`
+    pub fn accept4(
+        fd: ::c_int,
+        addr: *mut ::sockaddr,
+        len: *mut ::socklen_t,
+        flg: ::c_int
+    ) -> ::c_int {
+        ::syscall(SYS_accept4, fd, addr, len, flg) as ::c_int
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b32/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b32/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b32/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b32/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,244 @@
+// The following definitions are correct for arm and i686,
+// but may be wrong for mips
+
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type mode_t = u16;
+pub type off64_t = ::c_longlong;
+pub type sigset_t = ::c_ulong;
+pub type socklen_t = i32;
+pub type time64_t = i64;
+pub type __u64 = ::c_ulonglong;
+
+s! {
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct rlimit64 {
+        pub rlim_cur: u64,
+        pub rlim_max: u64,
+    }
+
+    pub struct stat {
+        pub st_dev: ::c_ulonglong,
+        __pad0: [::c_uchar; 4],
+        __st_ino: ::ino_t,
+        pub st_mode: ::c_uint,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulonglong,
+        __pad3: [::c_uchar; 4],
+        pub st_size: ::c_longlong,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::c_ulonglong,
+        pub st_atime: ::c_long,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::c_long,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::c_long,
+        pub st_ctime_nsec: ::c_long,
+        pub st_ino: ::c_ulonglong,
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::c_ulonglong,
+        __pad0: [::c_uchar; 4],
+        __st_ino: ::ino_t,
+        pub st_mode: ::c_uint,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulonglong,
+        __pad3: [::c_uchar; 4],
+        pub st_size: ::c_longlong,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::c_ulonglong,
+        pub st_atime: ::c_long,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::c_long,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::c_long,
+        pub st_ctime_nsec: ::c_long,
+        pub st_ino: ::c_ulonglong,
+    }
+
+    pub struct statfs64 {
+        pub f_type: u32,
+        pub f_bsize: u32,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_fsid: ::__fsid_t,
+        pub f_namelen: u32,
+        pub f_frsize: u32,
+        pub f_flags: u32,
+        pub f_spare: [u32; 4],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::c_ulong,
+        pub f_bfree: ::c_ulong,
+        pub f_bavail: ::c_ulong,
+        pub f_files: ::c_ulong,
+        pub f_ffree: ::c_ulong,
+        pub f_favail: ::c_ulong,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+    }
+
+    pub struct pthread_attr_t {
+        pub flags: u32,
+        pub stack_base: *mut ::c_void,
+        pub stack_size: ::size_t,
+        pub guard_size: ::size_t,
+        pub sched_policy: i32,
+        pub sched_priority: i32,
+    }
+
+    pub struct pthread_mutex_t { value: ::c_int }
+
+    pub struct pthread_cond_t { value: ::c_int }
+
+    pub struct pthread_rwlock_t {
+        lock: pthread_mutex_t,
+        cond: pthread_cond_t,
+        numLocks: ::c_int,
+        writerThreadId: ::c_int,
+        pendingReaders: ::c_int,
+        pendingWriters: ::c_int,
+        attr: i32,
+        __reserved: [::c_char; 12],
+    }
+
+    pub struct pthread_barrier_t {
+        __private: [i32; 8],
+    }
+
+    pub struct pthread_spinlock_t {
+        __private: [i32; 2],
+    }
+
+    pub struct passwd {
+        pub pw_name: *mut ::c_char,
+        pub pw_passwd: *mut ::c_char,
+        pub pw_uid: ::uid_t,
+        pub pw_gid: ::gid_t,
+        pub pw_dir: *mut ::c_char,
+        pub pw_shell: *mut ::c_char,
+    }
+
+    pub struct statfs {
+        pub f_type: u32,
+        pub f_bsize: u32,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_fsid: ::__fsid_t,
+        pub f_namelen: u32,
+        pub f_frsize: u32,
+        pub f_flags: u32,
+        pub f_spare: [u32; 4],
+    }
+
+    pub struct sysinfo {
+        pub uptime: ::c_long,
+        pub loads: [::c_ulong; 3],
+        pub totalram: ::c_ulong,
+        pub freeram: ::c_ulong,
+        pub sharedram: ::c_ulong,
+        pub bufferram: ::c_ulong,
+        pub totalswap: ::c_ulong,
+        pub freeswap: ::c_ulong,
+        pub procs: ::c_ushort,
+        pub pad: ::c_ushort,
+        pub totalhigh: ::c_ulong,
+        pub freehigh: ::c_ulong,
+        pub mem_unit: ::c_uint,
+        pub _f: [::c_char; 8],
+    }
+}
+
+s_no_extra_traits! {
+    pub struct sigset64_t {
+        __bits: [::c_ulong; 2]
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl ::fmt::Debug for sigset64_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sigset64_t")
+                    .field("__bits", &self.__bits)
+                    .finish()
+            }
+        }
+    }
+}
+
+// These constants must be of the same type of sigaction.sa_flags
+pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+pub const SA_NODEFER: ::c_int = 0x40000000;
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_RESETHAND: ::c_int = 0x80000000;
+pub const SA_RESTART: ::c_int = 0x10000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+
+pub const RTLD_GLOBAL: ::c_int = 2;
+pub const RTLD_NOW: ::c_int = 0;
+pub const RTLD_DEFAULT: *mut ::c_void = -1isize as *mut ::c_void;
+
+pub const PTRACE_GETFPREGS: ::c_int = 14;
+pub const PTRACE_SETFPREGS: ::c_int = 15;
+
+pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { value: 0 };
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { value: 0 };
+pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+    lock: PTHREAD_MUTEX_INITIALIZER,
+    cond: PTHREAD_COND_INITIALIZER,
+    numLocks: 0,
+    writerThreadId: 0,
+    pendingReaders: 0,
+    pendingWriters: 0,
+    attr: 0,
+    __reserved: [0; 12],
+};
+pub const PTHREAD_STACK_MIN: ::size_t = 4096 * 2;
+pub const CPU_SETSIZE: ::size_t = 32;
+pub const __CPU_BITS: ::size_t = 32;
+
+pub const UT_LINESIZE: usize = 8;
+pub const UT_NAMESIZE: usize = 8;
+pub const UT_HOSTSIZE: usize = 16;
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+
+extern "C" {
+    pub fn timegm64(tm: *const ::tm) -> ::time64_t;
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "x86")] {
+        mod x86;
+        pub use self::x86::*;
+    } else if #[cfg(target_arch = "arm")] {
+        mod arm;
+        pub use self::arm::*;
+    } else {
+        // Unknown target_arch
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b32/x86/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b32/x86/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b32/x86/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b32/x86/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(8))]
+    pub struct max_align_t {
+        priv_: [f64; 2]
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b32/x86/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b32/x86/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b32/x86/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b32/x86/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,622 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
+pub type greg_t = i32;
+
+s! {
+    pub struct _libc_fpreg {
+        pub significand: [u16; 4],
+        pub exponent: u16,
+    }
+
+    pub struct _libc_fpstate {
+        pub cw: ::c_ulong,
+        pub sw: ::c_ulong,
+        pub tag: ::c_ulong,
+        pub ipoff: ::c_ulong,
+        pub cssel: ::c_ulong,
+        pub dataoff: ::c_ulong,
+        pub datasel: ::c_ulong,
+        pub _st: [_libc_fpreg; 8],
+        pub status: ::c_ulong,
+    }
+
+    pub struct mcontext_t {
+        pub gregs: [greg_t; 19],
+        pub fpregs: *mut _libc_fpstate,
+        pub oldmask: ::c_ulong,
+        pub cr2: ::c_ulong,
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        s_no_extra_traits! {
+            pub struct __c_anonymous_uc_sigmask_with_padding {
+                pub uc_sigmask: ::sigset_t,
+                /* Android has a wrong (smaller) sigset_t on x86. */
+                __padding_rt_sigset: u32,
+            }
+
+            pub union __c_anonymous_uc_sigmask {
+                uc_sigmask: __c_anonymous_uc_sigmask_with_padding,
+                uc_sigmask64: ::sigset64_t,
+            }
+
+            pub struct ucontext_t {
+                pub uc_flags: ::c_ulong,
+                pub uc_link: *mut ucontext_t,
+                pub uc_stack: ::stack_t,
+                pub uc_mcontext: mcontext_t,
+                pub uc_sigmask__c_anonymous_union: __c_anonymous_uc_sigmask,
+                __padding_rt_sigset: u32,
+                __fpregs_mem: _libc_fpstate,
+            }
+        }
+
+        cfg_if! {
+            if #[cfg(feature = "extra_traits")] {
+                impl PartialEq for __c_anonymous_uc_sigmask_with_padding {
+                    fn eq(
+                        &self, other: &__c_anonymous_uc_sigmask_with_padding
+                    ) -> bool {
+                        self.uc_sigmask == other.uc_sigmask
+                            // Ignore padding
+                    }
+                }
+                impl Eq for __c_anonymous_uc_sigmask_with_padding {}
+                impl ::fmt::Debug for __c_anonymous_uc_sigmask_with_padding {
+                    fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                        f.debug_struct("uc_sigmask_with_padding")
+                            .field("uc_sigmask_with_padding", &self.uc_sigmask)
+                            // Ignore padding
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for __c_anonymous_uc_sigmask_with_padding {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        self.uc_sigmask.hash(state)
+                            // Ignore padding
+                    }
+                }
+
+                impl PartialEq for __c_anonymous_uc_sigmask {
+                    fn eq(&self, other: &__c_anonymous_uc_sigmask) -> bool {
+                        unsafe { self.uc_sigmask == other.uc_sigmask }
+                    }
+                }
+                impl Eq for __c_anonymous_uc_sigmask {}
+                impl ::fmt::Debug for __c_anonymous_uc_sigmask {
+                    fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                        f.debug_struct("uc_sigmask")
+                            .field("uc_sigmask", unsafe { &self.uc_sigmask })
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for __c_anonymous_uc_sigmask {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        unsafe { self.uc_sigmask.hash(state) }
+                    }
+                }
+
+                impl PartialEq for ucontext_t {
+                    fn eq(&self, other: &Self) -> bool {
+                        self.uc_flags == other.uc_flags
+                            && self.uc_link == other.uc_link
+                            && self.uc_stack == other.uc_stack
+                            && self.uc_mcontext == other.uc_mcontext
+                            && self.uc_sigmask__c_anonymous_union
+                                == other.uc_sigmask__c_anonymous_union
+                            // Ignore padding field
+                    }
+                }
+                impl Eq for ucontext_t {}
+                impl ::fmt::Debug for ucontext_t {
+                    fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                        f.debug_struct("ucontext_t")
+                            .field("uc_flags", &self.uc_flags)
+                            .field("uc_link", &self.uc_link)
+                            .field("uc_stack", &self.uc_stack)
+                            .field("uc_mcontext", &self.uc_mcontext)
+                            .field(
+                                "uc_sigmask__c_anonymous_union",
+                                &self.uc_sigmask__c_anonymous_union
+                            )
+                            // Ignore padding field
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for ucontext_t {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        self.uc_flags.hash(state);
+                        self.uc_link.hash(state);
+                        self.uc_stack.hash(state);
+                        self.uc_mcontext.hash(state);
+                        self.uc_sigmask__c_anonymous_union.hash(state);
+                        // Ignore padding field
+                    }
+                }
+            }
+        }
+    }
+}
+
+pub const O_DIRECT: ::c_int = 0x4000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+pub const O_LARGEFILE: ::c_int = 0o0100000;
+
+pub const MAP_32BIT: ::c_int = 0x40;
+
+// Syscall table
+pub const SYS_restart_syscall: ::c_long = 0;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_waitpid: ::c_long = 7;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execve: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_time: ::c_long = 13;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lchown: ::c_long = 16;
+pub const SYS_break: ::c_long = 17;
+pub const SYS_oldstat: ::c_long = 18;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_mount: ::c_long = 21;
+pub const SYS_umount: ::c_long = 22;
+pub const SYS_setuid: ::c_long = 23;
+pub const SYS_getuid: ::c_long = 24;
+pub const SYS_stime: ::c_long = 25;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_alarm: ::c_long = 27;
+pub const SYS_oldfstat: ::c_long = 28;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_utime: ::c_long = 30;
+pub const SYS_stty: ::c_long = 31;
+pub const SYS_gtty: ::c_long = 32;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_ftime: ::c_long = 35;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_prof: ::c_long = 44;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_setgid: ::c_long = 46;
+pub const SYS_getgid: ::c_long = 47;
+pub const SYS_signal: ::c_long = 48;
+pub const SYS_geteuid: ::c_long = 49;
+pub const SYS_getegid: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount2: ::c_long = 52;
+pub const SYS_lock: ::c_long = 53;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_mpx: ::c_long = 56;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_ulimit: ::c_long = 58;
+pub const SYS_oldolduname: ::c_long = 59;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_sgetmask: ::c_long = 68;
+pub const SYS_ssetmask: ::c_long = 69;
+pub const SYS_setreuid: ::c_long = 70;
+pub const SYS_setregid: ::c_long = 71;
+pub const SYS_sigsuspend: ::c_long = 72;
+pub const SYS_sigpending: ::c_long = 73;
+pub const SYS_sethostname: ::c_long = 74;
+pub const SYS_setrlimit: ::c_long = 75;
+pub const SYS_getrlimit: ::c_long = 76;
+pub const SYS_getrusage: ::c_long = 77;
+pub const SYS_gettimeofday: ::c_long = 78;
+pub const SYS_settimeofday: ::c_long = 79;
+pub const SYS_getgroups: ::c_long = 80;
+pub const SYS_setgroups: ::c_long = 81;
+pub const SYS_select: ::c_long = 82;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_oldlstat: ::c_long = 84;
+pub const SYS_readlink: ::c_long = 85;
+pub const SYS_uselib: ::c_long = 86;
+pub const SYS_swapon: ::c_long = 87;
+pub const SYS_reboot: ::c_long = 88;
+pub const SYS_readdir: ::c_long = 89;
+pub const SYS_mmap: ::c_long = 90;
+pub const SYS_munmap: ::c_long = 91;
+pub const SYS_truncate: ::c_long = 92;
+pub const SYS_ftruncate: ::c_long = 93;
+pub const SYS_fchmod: ::c_long = 94;
+pub const SYS_fchown: ::c_long = 95;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_profil: ::c_long = 98;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_ioperm: ::c_long = 101;
+pub const SYS_socketcall: ::c_long = 102;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_setitimer: ::c_long = 104;
+pub const SYS_getitimer: ::c_long = 105;
+pub const SYS_stat: ::c_long = 106;
+pub const SYS_lstat: ::c_long = 107;
+pub const SYS_fstat: ::c_long = 108;
+pub const SYS_olduname: ::c_long = 109;
+pub const SYS_iopl: ::c_long = 110;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_idle: ::c_long = 112;
+pub const SYS_vm86old: ::c_long = 113;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_ipc: ::c_long = 117;
+pub const SYS_fsync: ::c_long = 118;
+pub const SYS_sigreturn: ::c_long = 119;
+pub const SYS_clone: ::c_long = 120;
+pub const SYS_setdomainname: ::c_long = 121;
+pub const SYS_uname: ::c_long = 122;
+pub const SYS_modify_ldt: ::c_long = 123;
+pub const SYS_adjtimex: ::c_long = 124;
+pub const SYS_mprotect: ::c_long = 125;
+pub const SYS_sigprocmask: ::c_long = 126;
+pub const SYS_create_module: ::c_long = 127;
+pub const SYS_init_module: ::c_long = 128;
+pub const SYS_delete_module: ::c_long = 129;
+pub const SYS_get_kernel_syms: ::c_long = 130;
+pub const SYS_quotactl: ::c_long = 131;
+pub const SYS_getpgid: ::c_long = 132;
+pub const SYS_fchdir: ::c_long = 133;
+pub const SYS_bdflush: ::c_long = 134;
+pub const SYS_sysfs: ::c_long = 135;
+pub const SYS_personality: ::c_long = 136;
+pub const SYS_afs_syscall: ::c_long = 137;
+pub const SYS_setfsuid: ::c_long = 138;
+pub const SYS_setfsgid: ::c_long = 139;
+// FIXME: SYS__llseek is in the NDK sources but for some reason is
+//        not available in the tests
+// pub const SYS__llseek: ::c_long = 140;
+pub const SYS_getdents: ::c_long = 141;
+// FIXME: SYS__newselect is in the NDK sources but for some reason is
+//        not available in the tests
+// pub const SYS__newselect: ::c_long = 142;
+pub const SYS_flock: ::c_long = 143;
+pub const SYS_msync: ::c_long = 144;
+pub const SYS_readv: ::c_long = 145;
+pub const SYS_writev: ::c_long = 146;
+pub const SYS_getsid: ::c_long = 147;
+pub const SYS_fdatasync: ::c_long = 148;
+// FIXME: SYS__llseek is in the NDK sources but for some reason is
+//        not available in the tests
+// pub const SYS__sysctl: ::c_long = 149;
+pub const SYS_mlock: ::c_long = 150;
+pub const SYS_munlock: ::c_long = 151;
+pub const SYS_mlockall: ::c_long = 152;
+pub const SYS_munlockall: ::c_long = 153;
+pub const SYS_sched_setparam: ::c_long = 154;
+pub const SYS_sched_getparam: ::c_long = 155;
+pub const SYS_sched_setscheduler: ::c_long = 156;
+pub const SYS_sched_getscheduler: ::c_long = 157;
+pub const SYS_sched_yield: ::c_long = 158;
+pub const SYS_sched_get_priority_max: ::c_long = 159;
+pub const SYS_sched_get_priority_min: ::c_long = 160;
+pub const SYS_sched_rr_get_interval: ::c_long = 161;
+pub const SYS_nanosleep: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_setresuid: ::c_long = 164;
+pub const SYS_getresuid: ::c_long = 165;
+pub const SYS_vm86: ::c_long = 166;
+pub const SYS_query_module: ::c_long = 167;
+pub const SYS_poll: ::c_long = 168;
+pub const SYS_nfsservctl: ::c_long = 169;
+pub const SYS_setresgid: ::c_long = 170;
+pub const SYS_getresgid: ::c_long = 171;
+pub const SYS_prctl: ::c_long = 172;
+pub const SYS_rt_sigreturn: ::c_long = 173;
+pub const SYS_rt_sigaction: ::c_long = 174;
+pub const SYS_rt_sigprocmask: ::c_long = 175;
+pub const SYS_rt_sigpending: ::c_long = 176;
+pub const SYS_rt_sigtimedwait: ::c_long = 177;
+pub const SYS_rt_sigqueueinfo: ::c_long = 178;
+pub const SYS_rt_sigsuspend: ::c_long = 179;
+pub const SYS_pread64: ::c_long = 180;
+pub const SYS_pwrite64: ::c_long = 181;
+pub const SYS_chown: ::c_long = 182;
+pub const SYS_getcwd: ::c_long = 183;
+pub const SYS_capget: ::c_long = 184;
+pub const SYS_capset: ::c_long = 185;
+pub const SYS_sigaltstack: ::c_long = 186;
+pub const SYS_sendfile: ::c_long = 187;
+pub const SYS_getpmsg: ::c_long = 188;
+pub const SYS_putpmsg: ::c_long = 189;
+pub const SYS_vfork: ::c_long = 190;
+pub const SYS_ugetrlimit: ::c_long = 191;
+pub const SYS_mmap2: ::c_long = 192;
+pub const SYS_truncate64: ::c_long = 193;
+pub const SYS_ftruncate64: ::c_long = 194;
+pub const SYS_stat64: ::c_long = 195;
+pub const SYS_lstat64: ::c_long = 196;
+pub const SYS_fstat64: ::c_long = 197;
+pub const SYS_lchown32: ::c_long = 198;
+pub const SYS_getuid32: ::c_long = 199;
+pub const SYS_getgid32: ::c_long = 200;
+pub const SYS_geteuid32: ::c_long = 201;
+pub const SYS_getegid32: ::c_long = 202;
+pub const SYS_setreuid32: ::c_long = 203;
+pub const SYS_setregid32: ::c_long = 204;
+pub const SYS_getgroups32: ::c_long = 205;
+pub const SYS_setgroups32: ::c_long = 206;
+pub const SYS_fchown32: ::c_long = 207;
+pub const SYS_setresuid32: ::c_long = 208;
+pub const SYS_getresuid32: ::c_long = 209;
+pub const SYS_setresgid32: ::c_long = 210;
+pub const SYS_getresgid32: ::c_long = 211;
+pub const SYS_chown32: ::c_long = 212;
+pub const SYS_setuid32: ::c_long = 213;
+pub const SYS_setgid32: ::c_long = 214;
+pub const SYS_setfsuid32: ::c_long = 215;
+pub const SYS_setfsgid32: ::c_long = 216;
+pub const SYS_pivot_root: ::c_long = 217;
+pub const SYS_mincore: ::c_long = 218;
+pub const SYS_madvise: ::c_long = 219;
+pub const SYS_getdents64: ::c_long = 220;
+pub const SYS_fcntl64: ::c_long = 221;
+pub const SYS_gettid: ::c_long = 224;
+pub const SYS_readahead: ::c_long = 225;
+pub const SYS_setxattr: ::c_long = 226;
+pub const SYS_lsetxattr: ::c_long = 227;
+pub const SYS_fsetxattr: ::c_long = 228;
+pub const SYS_getxattr: ::c_long = 229;
+pub const SYS_lgetxattr: ::c_long = 230;
+pub const SYS_fgetxattr: ::c_long = 231;
+pub const SYS_listxattr: ::c_long = 232;
+pub const SYS_llistxattr: ::c_long = 233;
+pub const SYS_flistxattr: ::c_long = 234;
+pub const SYS_removexattr: ::c_long = 235;
+pub const SYS_lremovexattr: ::c_long = 236;
+pub const SYS_fremovexattr: ::c_long = 237;
+pub const SYS_tkill: ::c_long = 238;
+pub const SYS_sendfile64: ::c_long = 239;
+pub const SYS_futex: ::c_long = 240;
+pub const SYS_sched_setaffinity: ::c_long = 241;
+pub const SYS_sched_getaffinity: ::c_long = 242;
+pub const SYS_set_thread_area: ::c_long = 243;
+pub const SYS_get_thread_area: ::c_long = 244;
+pub const SYS_io_setup: ::c_long = 245;
+pub const SYS_io_destroy: ::c_long = 246;
+pub const SYS_io_getevents: ::c_long = 247;
+pub const SYS_io_submit: ::c_long = 248;
+pub const SYS_io_cancel: ::c_long = 249;
+pub const SYS_fadvise64: ::c_long = 250;
+pub const SYS_exit_group: ::c_long = 252;
+pub const SYS_lookup_dcookie: ::c_long = 253;
+pub const SYS_epoll_create: ::c_long = 254;
+pub const SYS_epoll_ctl: ::c_long = 255;
+pub const SYS_epoll_wait: ::c_long = 256;
+pub const SYS_remap_file_pages: ::c_long = 257;
+pub const SYS_set_tid_address: ::c_long = 258;
+pub const SYS_timer_create: ::c_long = 259;
+pub const SYS_timer_settime: ::c_long = 260;
+pub const SYS_timer_gettime: ::c_long = 261;
+pub const SYS_timer_getoverrun: ::c_long = 262;
+pub const SYS_timer_delete: ::c_long = 263;
+pub const SYS_clock_settime: ::c_long = 264;
+pub const SYS_clock_gettime: ::c_long = 265;
+pub const SYS_clock_getres: ::c_long = 266;
+pub const SYS_clock_nanosleep: ::c_long = 267;
+pub const SYS_statfs64: ::c_long = 268;
+pub const SYS_fstatfs64: ::c_long = 269;
+pub const SYS_tgkill: ::c_long = 270;
+pub const SYS_utimes: ::c_long = 271;
+pub const SYS_fadvise64_64: ::c_long = 272;
+pub const SYS_vserver: ::c_long = 273;
+pub const SYS_mbind: ::c_long = 274;
+pub const SYS_get_mempolicy: ::c_long = 275;
+pub const SYS_set_mempolicy: ::c_long = 276;
+pub const SYS_mq_open: ::c_long = 277;
+pub const SYS_mq_unlink: ::c_long = 278;
+pub const SYS_mq_timedsend: ::c_long = 279;
+pub const SYS_mq_timedreceive: ::c_long = 280;
+pub const SYS_mq_notify: ::c_long = 281;
+pub const SYS_mq_getsetattr: ::c_long = 282;
+pub const SYS_kexec_load: ::c_long = 283;
+pub const SYS_waitid: ::c_long = 284;
+pub const SYS_add_key: ::c_long = 286;
+pub const SYS_request_key: ::c_long = 287;
+pub const SYS_keyctl: ::c_long = 288;
+pub const SYS_ioprio_set: ::c_long = 289;
+pub const SYS_ioprio_get: ::c_long = 290;
+pub const SYS_inotify_init: ::c_long = 291;
+pub const SYS_inotify_add_watch: ::c_long = 292;
+pub const SYS_inotify_rm_watch: ::c_long = 293;
+pub const SYS_migrate_pages: ::c_long = 294;
+pub const SYS_openat: ::c_long = 295;
+pub const SYS_mkdirat: ::c_long = 296;
+pub const SYS_mknodat: ::c_long = 297;
+pub const SYS_fchownat: ::c_long = 298;
+pub const SYS_futimesat: ::c_long = 299;
+pub const SYS_fstatat64: ::c_long = 300;
+pub const SYS_unlinkat: ::c_long = 301;
+pub const SYS_renameat: ::c_long = 302;
+pub const SYS_linkat: ::c_long = 303;
+pub const SYS_symlinkat: ::c_long = 304;
+pub const SYS_readlinkat: ::c_long = 305;
+pub const SYS_fchmodat: ::c_long = 306;
+pub const SYS_faccessat: ::c_long = 307;
+pub const SYS_pselect6: ::c_long = 308;
+pub const SYS_ppoll: ::c_long = 309;
+pub const SYS_unshare: ::c_long = 310;
+pub const SYS_set_robust_list: ::c_long = 311;
+pub const SYS_get_robust_list: ::c_long = 312;
+pub const SYS_splice: ::c_long = 313;
+pub const SYS_sync_file_range: ::c_long = 314;
+pub const SYS_tee: ::c_long = 315;
+pub const SYS_vmsplice: ::c_long = 316;
+pub const SYS_move_pages: ::c_long = 317;
+pub const SYS_getcpu: ::c_long = 318;
+pub const SYS_epoll_pwait: ::c_long = 319;
+pub const SYS_utimensat: ::c_long = 320;
+pub const SYS_signalfd: ::c_long = 321;
+pub const SYS_timerfd_create: ::c_long = 322;
+pub const SYS_eventfd: ::c_long = 323;
+pub const SYS_fallocate: ::c_long = 324;
+pub const SYS_timerfd_settime: ::c_long = 325;
+pub const SYS_timerfd_gettime: ::c_long = 326;
+pub const SYS_signalfd4: ::c_long = 327;
+pub const SYS_eventfd2: ::c_long = 328;
+pub const SYS_epoll_create1: ::c_long = 329;
+pub const SYS_dup3: ::c_long = 330;
+pub const SYS_pipe2: ::c_long = 331;
+pub const SYS_inotify_init1: ::c_long = 332;
+pub const SYS_preadv: ::c_long = 333;
+pub const SYS_pwritev: ::c_long = 334;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 335;
+pub const SYS_perf_event_open: ::c_long = 336;
+pub const SYS_recvmmsg: ::c_long = 337;
+pub const SYS_fanotify_init: ::c_long = 338;
+pub const SYS_fanotify_mark: ::c_long = 339;
+pub const SYS_prlimit64: ::c_long = 340;
+pub const SYS_name_to_handle_at: ::c_long = 341;
+pub const SYS_open_by_handle_at: ::c_long = 342;
+pub const SYS_clock_adjtime: ::c_long = 343;
+pub const SYS_syncfs: ::c_long = 344;
+pub const SYS_sendmmsg: ::c_long = 345;
+pub const SYS_setns: ::c_long = 346;
+pub const SYS_process_vm_readv: ::c_long = 347;
+pub const SYS_process_vm_writev: ::c_long = 348;
+pub const SYS_kcmp: ::c_long = 349;
+pub const SYS_finit_module: ::c_long = 350;
+pub const SYS_sched_setattr: ::c_long = 351;
+pub const SYS_sched_getattr: ::c_long = 352;
+pub const SYS_renameat2: ::c_long = 353;
+pub const SYS_seccomp: ::c_long = 354;
+pub const SYS_getrandom: ::c_long = 355;
+pub const SYS_memfd_create: ::c_long = 356;
+pub const SYS_bpf: ::c_long = 357;
+pub const SYS_execveat: ::c_long = 358;
+pub const SYS_socket: ::c_long = 359;
+pub const SYS_socketpair: ::c_long = 360;
+pub const SYS_bind: ::c_long = 361;
+pub const SYS_connect: ::c_long = 362;
+pub const SYS_listen: ::c_long = 363;
+pub const SYS_accept4: ::c_long = 364;
+pub const SYS_getsockopt: ::c_long = 365;
+pub const SYS_setsockopt: ::c_long = 366;
+pub const SYS_getsockname: ::c_long = 367;
+pub const SYS_getpeername: ::c_long = 368;
+pub const SYS_sendto: ::c_long = 369;
+pub const SYS_sendmsg: ::c_long = 370;
+pub const SYS_recvfrom: ::c_long = 371;
+pub const SYS_recvmsg: ::c_long = 372;
+pub const SYS_shutdown: ::c_long = 373;
+pub const SYS_userfaultfd: ::c_long = 374;
+pub const SYS_membarrier: ::c_long = 375;
+pub const SYS_mlock2: ::c_long = 376;
+pub const SYS_copy_file_range: ::c_long = 377;
+pub const SYS_preadv2: ::c_long = 378;
+pub const SYS_pwritev2: ::c_long = 379;
+pub const SYS_pkey_mprotect: ::c_long = 380;
+pub const SYS_pkey_alloc: ::c_long = 381;
+pub const SYS_pkey_free: ::c_long = 382;
+pub const SYS_statx: ::c_long = 383;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+
+// offsets in user_regs_structs, from sys/reg.h
+pub const EBX: ::c_int = 0;
+pub const ECX: ::c_int = 1;
+pub const EDX: ::c_int = 2;
+pub const ESI: ::c_int = 3;
+pub const EDI: ::c_int = 4;
+pub const EBP: ::c_int = 5;
+pub const EAX: ::c_int = 6;
+pub const DS: ::c_int = 7;
+pub const ES: ::c_int = 8;
+pub const FS: ::c_int = 9;
+pub const GS: ::c_int = 10;
+pub const ORIG_EAX: ::c_int = 11;
+pub const EIP: ::c_int = 12;
+pub const CS: ::c_int = 13;
+pub const EFL: ::c_int = 14;
+pub const UESP: ::c_int = 15;
+pub const SS: ::c_int = 16;
+
+// offsets in mcontext_t.gregs from sys/ucontext.h
+pub const REG_GS: ::c_int = 0;
+pub const REG_FS: ::c_int = 1;
+pub const REG_ES: ::c_int = 2;
+pub const REG_DS: ::c_int = 3;
+pub const REG_EDI: ::c_int = 4;
+pub const REG_ESI: ::c_int = 5;
+pub const REG_EBP: ::c_int = 6;
+pub const REG_ESP: ::c_int = 7;
+pub const REG_EBX: ::c_int = 8;
+pub const REG_EDX: ::c_int = 9;
+pub const REG_ECX: ::c_int = 10;
+pub const REG_EAX: ::c_int = 11;
+pub const REG_TRAPNO: ::c_int = 12;
+pub const REG_ERR: ::c_int = 13;
+pub const REG_EIP: ::c_int = 14;
+pub const REG_CS: ::c_int = 15;
+pub const REG_EFL: ::c_int = 16;
+pub const REG_UESP: ::c_int = 17;
+pub const REG_SS: ::c_int = 18;
+
+// socketcall values from linux/net.h (only the needed ones, and not public)
+const SYS_ACCEPT4: ::c_int = 18;
+
+f! {
+    // Sadly, Android before 5.0 (API level 21), the accept4 syscall is not
+    // exposed by the libc. As work-around, we implement it as raw syscall.
+    // Note that for x86, the `accept4` syscall is not available either,
+    // and we must use the `socketcall` syscall instead.
+    // This workaround can be removed if the minimum Android version is bumped.
+    // When the workaround is removed, `accept4` can be moved back
+    // to `linux_like/mod.rs`
+    pub fn accept4(
+        fd: ::c_int,
+        addr: *mut ::sockaddr,
+        len: *mut ::socklen_t,
+        flg: ::c_int
+    ) -> ::c_int {
+        // Arguments are passed as array of `long int`
+        // (which is big enough on x86 for a pointer).
+        let mut args = [
+            fd as ::c_long,
+            addr as ::c_long,
+            len as ::c_long,
+            flg as ::c_long,
+        ];
+        ::syscall(SYS_socketcall, SYS_ACCEPT4, args[..].as_mut_ptr())
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b64/aarch64/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b64/aarch64/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b64/aarch64/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b64/aarch64/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,29 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f32; 8]
+    }
+}
+
+s! {
+    pub struct ucontext_t {
+        pub uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_mcontext: mcontext_t,
+    }
+
+    #[repr(align(16))]
+    pub struct mcontext_t {
+        pub fault_address: ::c_ulonglong,
+        pub regs: [::c_ulonglong; 31],
+        pub sp: ::c_ulonglong,
+        pub pc: ::c_ulonglong,
+        pub pstate: ::c_ulonglong,
+        // nested arrays to get the right size/length while being able to
+        // auto-derive traits like Debug
+        __reserved: [[u64; 32]; 16],
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b64/aarch64/int128.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b64/aarch64/int128.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b64/aarch64/int128.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b64/aarch64/int128.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s! {
+    pub struct user_fpsimd_struct {
+        pub vregs: [::__uint128_t; 32],
+        pub fpsr: u32,
+        pub fpcr: u32,
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b64/aarch64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b64/aarch64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b64/aarch64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b64/aarch64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,432 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
+pub type __u64 = ::c_ulonglong;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::c_uint,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad1: ::c_ulong,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::c_int,
+        __pad2: ::c_int,
+        pub st_blocks: ::c_long,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused4: ::c_uint,
+        __unused5: ::c_uint,
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::c_uint,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad1: ::c_ulong,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::c_int,
+        __pad2: ::c_int,
+        pub st_blocks: ::c_long,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused4: ::c_uint,
+        __unused5: ::c_uint,
+    }
+
+    pub struct user_regs_struct {
+        pub regs: [u64; 31],
+        pub sp: u64,
+        pub pc: u64,
+        pub pstate: u64,
+    }
+}
+
+pub const O_DIRECT: ::c_int = 0x10000;
+pub const O_DIRECTORY: ::c_int = 0x4000;
+pub const O_NOFOLLOW: ::c_int = 0x8000;
+pub const O_LARGEFILE: ::c_int = 0o400000;
+
+pub const SIGSTKSZ: ::size_t = 16384;
+pub const MINSIGSTKSZ: ::size_t = 5120;
+
+// From NDK's asm/hwcap.h
+pub const HWCAP_FP: ::c_ulong = 1 << 0;
+pub const HWCAP_ASIMD: ::c_ulong = 1 << 1;
+pub const HWCAP_EVTSTRM: ::c_ulong = 1 << 2;
+pub const HWCAP_AES: ::c_ulong = 1 << 3;
+pub const HWCAP_PMULL: ::c_ulong = 1 << 4;
+pub const HWCAP_SHA1: ::c_ulong = 1 << 5;
+pub const HWCAP_SHA2: ::c_ulong = 1 << 6;
+pub const HWCAP_CRC32: ::c_ulong = 1 << 7;
+pub const HWCAP_ATOMICS: ::c_ulong = 1 << 8;
+pub const HWCAP_FPHP: ::c_ulong = 1 << 9;
+pub const HWCAP_ASIMDHP: ::c_ulong = 1 << 10;
+pub const HWCAP_CPUID: ::c_ulong = 1 << 11;
+pub const HWCAP_ASIMDRDM: ::c_ulong = 1 << 12;
+pub const HWCAP_JSCVT: ::c_ulong = 1 << 13;
+pub const HWCAP_FCMA: ::c_ulong = 1 << 14;
+pub const HWCAP_LRCPC: ::c_ulong = 1 << 15;
+pub const HWCAP_DCPOP: ::c_ulong = 1 << 16;
+pub const HWCAP_SHA3: ::c_ulong = 1 << 17;
+pub const HWCAP_SM3: ::c_ulong = 1 << 18;
+pub const HWCAP_SM4: ::c_ulong = 1 << 19;
+pub const HWCAP_ASIMDDP: ::c_ulong = 1 << 20;
+pub const HWCAP_SHA512: ::c_ulong = 1 << 21;
+pub const HWCAP_SVE: ::c_ulong = 1 << 22;
+pub const HWCAP_ASIMDFHM: ::c_ulong = 1 << 23;
+pub const HWCAP_DIT: ::c_ulong = 1 << 24;
+pub const HWCAP_USCAT: ::c_ulong = 1 << 25;
+pub const HWCAP_ILRCPC: ::c_ulong = 1 << 26;
+pub const HWCAP_FLAGM: ::c_ulong = 1 << 27;
+pub const HWCAP_SSBS: ::c_ulong = 1 << 28;
+pub const HWCAP_SB: ::c_ulong = 1 << 29;
+pub const HWCAP_PACA: ::c_ulong = 1 << 30;
+pub const HWCAP_PACG: ::c_ulong = 1 << 31;
+pub const HWCAP2_DCPODP: ::c_ulong = 1 << 0;
+pub const HWCAP2_SVE2: ::c_ulong = 1 << 1;
+pub const HWCAP2_SVEAES: ::c_ulong = 1 << 2;
+pub const HWCAP2_SVEPMULL: ::c_ulong = 1 << 3;
+pub const HWCAP2_SVEBITPERM: ::c_ulong = 1 << 4;
+pub const HWCAP2_SVESHA3: ::c_ulong = 1 << 5;
+pub const HWCAP2_SVESM4: ::c_ulong = 1 << 6;
+pub const HWCAP2_FLAGM2: ::c_ulong = 1 << 7;
+pub const HWCAP2_FRINT: ::c_ulong = 1 << 8;
+pub const HWCAP2_SVEI8MM: ::c_ulong = 1 << 9;
+pub const HWCAP2_SVEF32MM: ::c_ulong = 1 << 10;
+pub const HWCAP2_SVEF64MM: ::c_ulong = 1 << 11;
+pub const HWCAP2_SVEBF16: ::c_ulong = 1 << 12;
+pub const HWCAP2_I8MM: ::c_ulong = 1 << 13;
+pub const HWCAP2_BF16: ::c_ulong = 1 << 14;
+pub const HWCAP2_DGH: ::c_ulong = 1 << 15;
+pub const HWCAP2_RNG: ::c_ulong = 1 << 16;
+pub const HWCAP2_BTI: ::c_ulong = 1 << 17;
+pub const HWCAP2_MTE: ::c_ulong = 1 << 18;
+pub const HWCAP2_ECV: ::c_ulong = 1 << 19;
+pub const HWCAP2_AFP: ::c_ulong = 1 << 20;
+pub const HWCAP2_RPRES: ::c_ulong = 1 << 21;
+pub const HWCAP2_MTE3: ::c_ulong = 1 << 22;
+pub const HWCAP2_SME: ::c_ulong = 1 << 23;
+pub const HWCAP2_SME_I16I64: ::c_ulong = 1 << 24;
+pub const HWCAP2_SME_F64F64: ::c_ulong = 1 << 25;
+pub const HWCAP2_SME_I8I32: ::c_ulong = 1 << 26;
+pub const HWCAP2_SME_F16F32: ::c_ulong = 1 << 27;
+pub const HWCAP2_SME_B16F32: ::c_ulong = 1 << 28;
+pub const HWCAP2_SME_F32F32: ::c_ulong = 1 << 29;
+pub const HWCAP2_SME_FA64: ::c_ulong = 1 << 30;
+pub const HWCAP2_WFXT: ::c_ulong = 1 << 31;
+pub const HWCAP2_EBF16: ::c_ulong = 1 << 32;
+pub const HWCAP2_SVE_EBF16: ::c_ulong = 1 << 33;
+
+pub const SYS_io_setup: ::c_long = 0;
+pub const SYS_io_destroy: ::c_long = 1;
+pub const SYS_io_submit: ::c_long = 2;
+pub const SYS_io_cancel: ::c_long = 3;
+pub const SYS_io_getevents: ::c_long = 4;
+pub const SYS_setxattr: ::c_long = 5;
+pub const SYS_lsetxattr: ::c_long = 6;
+pub const SYS_fsetxattr: ::c_long = 7;
+pub const SYS_getxattr: ::c_long = 8;
+pub const SYS_lgetxattr: ::c_long = 9;
+pub const SYS_fgetxattr: ::c_long = 10;
+pub const SYS_listxattr: ::c_long = 11;
+pub const SYS_llistxattr: ::c_long = 12;
+pub const SYS_flistxattr: ::c_long = 13;
+pub const SYS_removexattr: ::c_long = 14;
+pub const SYS_lremovexattr: ::c_long = 15;
+pub const SYS_fremovexattr: ::c_long = 16;
+pub const SYS_getcwd: ::c_long = 17;
+pub const SYS_lookup_dcookie: ::c_long = 18;
+pub const SYS_eventfd2: ::c_long = 19;
+pub const SYS_epoll_create1: ::c_long = 20;
+pub const SYS_epoll_ctl: ::c_long = 21;
+pub const SYS_epoll_pwait: ::c_long = 22;
+pub const SYS_dup: ::c_long = 23;
+pub const SYS_dup3: ::c_long = 24;
+pub const SYS_fcntl: ::c_long = 25;
+pub const SYS_inotify_init1: ::c_long = 26;
+pub const SYS_inotify_add_watch: ::c_long = 27;
+pub const SYS_inotify_rm_watch: ::c_long = 28;
+pub const SYS_ioctl: ::c_long = 29;
+pub const SYS_ioprio_set: ::c_long = 30;
+pub const SYS_ioprio_get: ::c_long = 31;
+pub const SYS_flock: ::c_long = 32;
+pub const SYS_mknodat: ::c_long = 33;
+pub const SYS_mkdirat: ::c_long = 34;
+pub const SYS_unlinkat: ::c_long = 35;
+pub const SYS_symlinkat: ::c_long = 36;
+pub const SYS_linkat: ::c_long = 37;
+pub const SYS_renameat: ::c_long = 38;
+pub const SYS_umount2: ::c_long = 39;
+pub const SYS_mount: ::c_long = 40;
+pub const SYS_pivot_root: ::c_long = 41;
+pub const SYS_nfsservctl: ::c_long = 42;
+pub const SYS_fallocate: ::c_long = 47;
+pub const SYS_faccessat: ::c_long = 48;
+pub const SYS_chdir: ::c_long = 49;
+pub const SYS_fchdir: ::c_long = 50;
+pub const SYS_chroot: ::c_long = 51;
+pub const SYS_fchmod: ::c_long = 52;
+pub const SYS_fchmodat: ::c_long = 53;
+pub const SYS_fchownat: ::c_long = 54;
+pub const SYS_fchown: ::c_long = 55;
+pub const SYS_openat: ::c_long = 56;
+pub const SYS_close: ::c_long = 57;
+pub const SYS_vhangup: ::c_long = 58;
+pub const SYS_pipe2: ::c_long = 59;
+pub const SYS_quotactl: ::c_long = 60;
+pub const SYS_getdents64: ::c_long = 61;
+pub const SYS_lseek: ::c_long = 62;
+pub const SYS_read: ::c_long = 63;
+pub const SYS_write: ::c_long = 64;
+pub const SYS_readv: ::c_long = 65;
+pub const SYS_writev: ::c_long = 66;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_preadv: ::c_long = 69;
+pub const SYS_pwritev: ::c_long = 70;
+pub const SYS_pselect6: ::c_long = 72;
+pub const SYS_ppoll: ::c_long = 73;
+pub const SYS_signalfd4: ::c_long = 74;
+pub const SYS_vmsplice: ::c_long = 75;
+pub const SYS_splice: ::c_long = 76;
+pub const SYS_tee: ::c_long = 77;
+pub const SYS_readlinkat: ::c_long = 78;
+pub const SYS_sync: ::c_long = 81;
+pub const SYS_fsync: ::c_long = 82;
+pub const SYS_fdatasync: ::c_long = 83;
+pub const SYS_sync_file_range: ::c_long = 84;
+pub const SYS_timerfd_create: ::c_long = 85;
+pub const SYS_timerfd_settime: ::c_long = 86;
+pub const SYS_timerfd_gettime: ::c_long = 87;
+pub const SYS_utimensat: ::c_long = 88;
+pub const SYS_acct: ::c_long = 89;
+pub const SYS_capget: ::c_long = 90;
+pub const SYS_capset: ::c_long = 91;
+pub const SYS_personality: ::c_long = 92;
+pub const SYS_exit: ::c_long = 93;
+pub const SYS_exit_group: ::c_long = 94;
+pub const SYS_waitid: ::c_long = 95;
+pub const SYS_set_tid_address: ::c_long = 96;
+pub const SYS_unshare: ::c_long = 97;
+pub const SYS_futex: ::c_long = 98;
+pub const SYS_set_robust_list: ::c_long = 99;
+pub const SYS_get_robust_list: ::c_long = 100;
+pub const SYS_nanosleep: ::c_long = 101;
+pub const SYS_getitimer: ::c_long = 102;
+pub const SYS_setitimer: ::c_long = 103;
+pub const SYS_kexec_load: ::c_long = 104;
+pub const SYS_init_module: ::c_long = 105;
+pub const SYS_delete_module: ::c_long = 106;
+pub const SYS_timer_create: ::c_long = 107;
+pub const SYS_timer_gettime: ::c_long = 108;
+pub const SYS_timer_getoverrun: ::c_long = 109;
+pub const SYS_timer_settime: ::c_long = 110;
+pub const SYS_timer_delete: ::c_long = 111;
+pub const SYS_clock_settime: ::c_long = 112;
+pub const SYS_clock_gettime: ::c_long = 113;
+pub const SYS_clock_getres: ::c_long = 114;
+pub const SYS_clock_nanosleep: ::c_long = 115;
+pub const SYS_syslog: ::c_long = 116;
+pub const SYS_ptrace: ::c_long = 117;
+pub const SYS_sched_setparam: ::c_long = 118;
+pub const SYS_sched_setscheduler: ::c_long = 119;
+pub const SYS_sched_getscheduler: ::c_long = 120;
+pub const SYS_sched_getparam: ::c_long = 121;
+pub const SYS_sched_setaffinity: ::c_long = 122;
+pub const SYS_sched_getaffinity: ::c_long = 123;
+pub const SYS_sched_yield: ::c_long = 124;
+pub const SYS_sched_get_priority_max: ::c_long = 125;
+pub const SYS_sched_get_priority_min: ::c_long = 126;
+pub const SYS_sched_rr_get_interval: ::c_long = 127;
+pub const SYS_restart_syscall: ::c_long = 128;
+pub const SYS_kill: ::c_long = 129;
+pub const SYS_tkill: ::c_long = 130;
+pub const SYS_tgkill: ::c_long = 131;
+pub const SYS_sigaltstack: ::c_long = 132;
+pub const SYS_rt_sigsuspend: ::c_long = 133;
+pub const SYS_rt_sigaction: ::c_long = 134;
+pub const SYS_rt_sigprocmask: ::c_long = 135;
+pub const SYS_rt_sigpending: ::c_long = 136;
+pub const SYS_rt_sigtimedwait: ::c_long = 137;
+pub const SYS_rt_sigqueueinfo: ::c_long = 138;
+pub const SYS_rt_sigreturn: ::c_long = 139;
+pub const SYS_setpriority: ::c_long = 140;
+pub const SYS_getpriority: ::c_long = 141;
+pub const SYS_reboot: ::c_long = 142;
+pub const SYS_setregid: ::c_long = 143;
+pub const SYS_setgid: ::c_long = 144;
+pub const SYS_setreuid: ::c_long = 145;
+pub const SYS_setuid: ::c_long = 146;
+pub const SYS_setresuid: ::c_long = 147;
+pub const SYS_getresuid: ::c_long = 148;
+pub const SYS_setresgid: ::c_long = 149;
+pub const SYS_getresgid: ::c_long = 150;
+pub const SYS_setfsuid: ::c_long = 151;
+pub const SYS_setfsgid: ::c_long = 152;
+pub const SYS_times: ::c_long = 153;
+pub const SYS_setpgid: ::c_long = 154;
+pub const SYS_getpgid: ::c_long = 155;
+pub const SYS_getsid: ::c_long = 156;
+pub const SYS_setsid: ::c_long = 157;
+pub const SYS_getgroups: ::c_long = 158;
+pub const SYS_setgroups: ::c_long = 159;
+pub const SYS_uname: ::c_long = 160;
+pub const SYS_sethostname: ::c_long = 161;
+pub const SYS_setdomainname: ::c_long = 162;
+pub const SYS_getrlimit: ::c_long = 163;
+pub const SYS_setrlimit: ::c_long = 164;
+pub const SYS_getrusage: ::c_long = 165;
+pub const SYS_umask: ::c_long = 166;
+pub const SYS_prctl: ::c_long = 167;
+pub const SYS_getcpu: ::c_long = 168;
+pub const SYS_gettimeofday: ::c_long = 169;
+pub const SYS_settimeofday: ::c_long = 170;
+pub const SYS_adjtimex: ::c_long = 171;
+pub const SYS_getpid: ::c_long = 172;
+pub const SYS_getppid: ::c_long = 173;
+pub const SYS_getuid: ::c_long = 174;
+pub const SYS_geteuid: ::c_long = 175;
+pub const SYS_getgid: ::c_long = 176;
+pub const SYS_getegid: ::c_long = 177;
+pub const SYS_gettid: ::c_long = 178;
+pub const SYS_sysinfo: ::c_long = 179;
+pub const SYS_mq_open: ::c_long = 180;
+pub const SYS_mq_unlink: ::c_long = 181;
+pub const SYS_mq_timedsend: ::c_long = 182;
+pub const SYS_mq_timedreceive: ::c_long = 183;
+pub const SYS_mq_notify: ::c_long = 184;
+pub const SYS_mq_getsetattr: ::c_long = 185;
+pub const SYS_msgget: ::c_long = 186;
+pub const SYS_msgctl: ::c_long = 187;
+pub const SYS_msgrcv: ::c_long = 188;
+pub const SYS_msgsnd: ::c_long = 189;
+pub const SYS_semget: ::c_long = 190;
+pub const SYS_semctl: ::c_long = 191;
+pub const SYS_semtimedop: ::c_long = 192;
+pub const SYS_semop: ::c_long = 193;
+pub const SYS_shmget: ::c_long = 194;
+pub const SYS_shmctl: ::c_long = 195;
+pub const SYS_shmat: ::c_long = 196;
+pub const SYS_shmdt: ::c_long = 197;
+pub const SYS_socket: ::c_long = 198;
+pub const SYS_socketpair: ::c_long = 199;
+pub const SYS_bind: ::c_long = 200;
+pub const SYS_listen: ::c_long = 201;
+pub const SYS_accept: ::c_long = 202;
+pub const SYS_connect: ::c_long = 203;
+pub const SYS_getsockname: ::c_long = 204;
+pub const SYS_getpeername: ::c_long = 205;
+pub const SYS_sendto: ::c_long = 206;
+pub const SYS_recvfrom: ::c_long = 207;
+pub const SYS_setsockopt: ::c_long = 208;
+pub const SYS_getsockopt: ::c_long = 209;
+pub const SYS_shutdown: ::c_long = 210;
+pub const SYS_sendmsg: ::c_long = 211;
+pub const SYS_recvmsg: ::c_long = 212;
+pub const SYS_readahead: ::c_long = 213;
+pub const SYS_brk: ::c_long = 214;
+pub const SYS_munmap: ::c_long = 215;
+pub const SYS_mremap: ::c_long = 216;
+pub const SYS_add_key: ::c_long = 217;
+pub const SYS_request_key: ::c_long = 218;
+pub const SYS_keyctl: ::c_long = 219;
+pub const SYS_clone: ::c_long = 220;
+pub const SYS_execve: ::c_long = 221;
+pub const SYS_mmap: ::c_long = 222;
+pub const SYS_swapon: ::c_long = 224;
+pub const SYS_swapoff: ::c_long = 225;
+pub const SYS_mprotect: ::c_long = 226;
+pub const SYS_msync: ::c_long = 227;
+pub const SYS_mlock: ::c_long = 228;
+pub const SYS_munlock: ::c_long = 229;
+pub const SYS_mlockall: ::c_long = 230;
+pub const SYS_munlockall: ::c_long = 231;
+pub const SYS_mincore: ::c_long = 232;
+pub const SYS_madvise: ::c_long = 233;
+pub const SYS_remap_file_pages: ::c_long = 234;
+pub const SYS_mbind: ::c_long = 235;
+pub const SYS_get_mempolicy: ::c_long = 236;
+pub const SYS_set_mempolicy: ::c_long = 237;
+pub const SYS_migrate_pages: ::c_long = 238;
+pub const SYS_move_pages: ::c_long = 239;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
+pub const SYS_perf_event_open: ::c_long = 241;
+pub const SYS_accept4: ::c_long = 242;
+pub const SYS_recvmmsg: ::c_long = 243;
+pub const SYS_arch_specific_syscall: ::c_long = 244;
+pub const SYS_wait4: ::c_long = 260;
+pub const SYS_prlimit64: ::c_long = 261;
+pub const SYS_fanotify_init: ::c_long = 262;
+pub const SYS_fanotify_mark: ::c_long = 263;
+pub const SYS_name_to_handle_at: ::c_long = 264;
+pub const SYS_open_by_handle_at: ::c_long = 265;
+pub const SYS_clock_adjtime: ::c_long = 266;
+pub const SYS_syncfs: ::c_long = 267;
+pub const SYS_setns: ::c_long = 268;
+pub const SYS_sendmmsg: ::c_long = 269;
+pub const SYS_process_vm_readv: ::c_long = 270;
+pub const SYS_process_vm_writev: ::c_long = 271;
+pub const SYS_kcmp: ::c_long = 272;
+pub const SYS_finit_module: ::c_long = 273;
+pub const SYS_sched_setattr: ::c_long = 274;
+pub const SYS_sched_getattr: ::c_long = 275;
+pub const SYS_renameat2: ::c_long = 276;
+pub const SYS_seccomp: ::c_long = 277;
+pub const SYS_getrandom: ::c_long = 278;
+pub const SYS_memfd_create: ::c_long = 279;
+pub const SYS_bpf: ::c_long = 280;
+pub const SYS_execveat: ::c_long = 281;
+pub const SYS_userfaultfd: ::c_long = 282;
+pub const SYS_membarrier: ::c_long = 283;
+pub const SYS_mlock2: ::c_long = 284;
+pub const SYS_copy_file_range: ::c_long = 285;
+pub const SYS_preadv2: ::c_long = 286;
+pub const SYS_pwritev2: ::c_long = 287;
+pub const SYS_pkey_mprotect: ::c_long = 288;
+pub const SYS_pkey_alloc: ::c_long = 289;
+pub const SYS_pkey_free: ::c_long = 290;
+pub const SYS_statx: ::c_long = 291;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_syscalls: ::c_long = 436;
+
+pub const PROT_BTI: ::c_int = 0x10;
+pub const PROT_MTE: ::c_int = 0x20;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_int128)] {
+        mod int128;
+        pub use self::int128::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,355 @@
+// The following definitions are correct for aarch64 and x86_64,
+// but may be wrong for mips64
+
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type mode_t = u32;
+pub type off64_t = i64;
+pub type socklen_t = u32;
+
+s! {
+    pub struct sigset_t {
+        __val: [::c_ulong; 1],
+    }
+
+    pub struct sigaction {
+        pub sa_flags: ::c_int,
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct rlimit64 {
+        pub rlim_cur: ::c_ulonglong,
+        pub rlim_max: ::c_ulonglong,
+    }
+
+    pub struct pthread_attr_t {
+        pub flags: u32,
+        pub stack_base: *mut ::c_void,
+        pub stack_size: ::size_t,
+        pub guard_size: ::size_t,
+        pub sched_policy: i32,
+        pub sched_priority: i32,
+        __reserved: [::c_char; 16],
+    }
+
+    pub struct passwd {
+        pub pw_name: *mut ::c_char,
+        pub pw_passwd: *mut ::c_char,
+        pub pw_uid: ::uid_t,
+        pub pw_gid: ::gid_t,
+        pub pw_gecos: *mut ::c_char,
+        pub pw_dir: *mut ::c_char,
+        pub pw_shell: *mut ::c_char,
+    }
+
+    pub struct statfs {
+        pub f_type: u64,
+        pub f_bsize: u64,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_fsid: ::__fsid_t,
+        pub f_namelen: u64,
+        pub f_frsize: u64,
+        pub f_flags: u64,
+        pub f_spare: [u64; 4],
+    }
+
+    pub struct sysinfo {
+        pub uptime: ::c_long,
+        pub loads: [::c_ulong; 3],
+        pub totalram: ::c_ulong,
+        pub freeram: ::c_ulong,
+        pub sharedram: ::c_ulong,
+        pub bufferram: ::c_ulong,
+        pub totalswap: ::c_ulong,
+        pub freeswap: ::c_ulong,
+        pub procs: ::c_ushort,
+        pub pad: ::c_ushort,
+        pub totalhigh: ::c_ulong,
+        pub freehigh: ::c_ulong,
+        pub mem_unit: ::c_uint,
+        pub _f: [::c_char; 0],
+    }
+
+    pub struct statfs64 {
+        pub f_type: u64,
+        pub f_bsize: u64,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_fsid: ::__fsid_t,
+        pub f_namelen: u64,
+        pub f_frsize: u64,
+        pub f_flags: u64,
+        pub f_spare: [u64; 4],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct pthread_barrier_t {
+        __private: [i64; 4],
+    }
+
+    pub struct pthread_spinlock_t {
+        __private: i64,
+    }
+}
+
+s_no_extra_traits! {
+    pub struct pthread_mutex_t {
+        value: ::c_int,
+        __reserved: [::c_char; 36],
+    }
+
+    pub struct pthread_cond_t {
+        value: ::c_int,
+        __reserved: [::c_char; 44],
+    }
+
+    pub struct pthread_rwlock_t {
+        numLocks: ::c_int,
+        writerThreadId: ::c_int,
+        pendingReaders: ::c_int,
+        pendingWriters: ::c_int,
+        attr: i32,
+        __reserved: [::c_char; 36],
+    }
+
+    pub struct sigset64_t {
+        __bits: [::c_ulong; 1]
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for pthread_mutex_t {
+            fn eq(&self, other: &pthread_mutex_t) -> bool {
+                self.value == other.value
+                    && self
+                    .__reserved
+                    .iter()
+                    .zip(other.__reserved.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for pthread_mutex_t {}
+
+        impl ::fmt::Debug for pthread_mutex_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("pthread_mutex_t")
+                    .field("value", &self.value)
+                    // FIXME: .field("__reserved", &self.__reserved)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for pthread_mutex_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.value.hash(state);
+                self.__reserved.hash(state);
+            }
+        }
+
+        impl PartialEq for pthread_cond_t {
+            fn eq(&self, other: &pthread_cond_t) -> bool {
+                self.value == other.value
+                    && self
+                    .__reserved
+                    .iter()
+                    .zip(other.__reserved.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for pthread_cond_t {}
+
+        impl ::fmt::Debug for pthread_cond_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("pthread_cond_t")
+                    .field("value", &self.value)
+                    // FIXME: .field("__reserved", &self.__reserved)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for pthread_cond_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.value.hash(state);
+                self.__reserved.hash(state);
+            }
+        }
+
+        impl PartialEq for pthread_rwlock_t {
+            fn eq(&self, other: &pthread_rwlock_t) -> bool {
+                self.numLocks == other.numLocks
+                    && self.writerThreadId == other.writerThreadId
+                    && self.pendingReaders == other.pendingReaders
+                    && self.pendingWriters == other.pendingWriters
+                    && self.attr == other.attr
+                    && self
+                    .__reserved
+                    .iter()
+                    .zip(other.__reserved.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for pthread_rwlock_t {}
+
+        impl ::fmt::Debug for pthread_rwlock_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("pthread_rwlock_t")
+                    .field("numLocks", &self.numLocks)
+                    .field("writerThreadId", &self.writerThreadId)
+                    .field("pendingReaders", &self.pendingReaders)
+                    .field("pendingWriters", &self.pendingWriters)
+                    .field("attr", &self.attr)
+                    // FIXME: .field("__reserved", &self.__reserved)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for pthread_rwlock_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.numLocks.hash(state);
+                self.writerThreadId.hash(state);
+                self.pendingReaders.hash(state);
+                self.pendingWriters.hash(state);
+                self.attr.hash(state);
+                self.__reserved.hash(state);
+            }
+        }
+
+        impl ::fmt::Debug for sigset64_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sigset64_t")
+                    .field("__bits", &self.__bits)
+                    .finish()
+            }
+        }
+    }
+}
+
+// These constants must be of the same type of sigaction.sa_flags
+pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+pub const SA_NODEFER: ::c_int = 0x40000000;
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_RESETHAND: ::c_int = 0x80000000;
+pub const SA_RESTART: ::c_int = 0x10000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+
+pub const RTLD_GLOBAL: ::c_int = 0x00100;
+pub const RTLD_NOW: ::c_int = 2;
+pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
+
+// From NDK's linux/auxvec.h
+pub const AT_NULL: ::c_ulong = 0;
+pub const AT_IGNORE: ::c_ulong = 1;
+pub const AT_EXECFD: ::c_ulong = 2;
+pub const AT_PHDR: ::c_ulong = 3;
+pub const AT_PHENT: ::c_ulong = 4;
+pub const AT_PHNUM: ::c_ulong = 5;
+pub const AT_PAGESZ: ::c_ulong = 6;
+pub const AT_BASE: ::c_ulong = 7;
+pub const AT_FLAGS: ::c_ulong = 8;
+pub const AT_ENTRY: ::c_ulong = 9;
+pub const AT_NOTELF: ::c_ulong = 10;
+pub const AT_UID: ::c_ulong = 11;
+pub const AT_EUID: ::c_ulong = 12;
+pub const AT_GID: ::c_ulong = 13;
+pub const AT_EGID: ::c_ulong = 14;
+pub const AT_PLATFORM: ::c_ulong = 15;
+pub const AT_HWCAP: ::c_ulong = 16;
+pub const AT_CLKTCK: ::c_ulong = 17;
+pub const AT_SECURE: ::c_ulong = 23;
+pub const AT_BASE_PLATFORM: ::c_ulong = 24;
+pub const AT_RANDOM: ::c_ulong = 25;
+pub const AT_HWCAP2: ::c_ulong = 26;
+pub const AT_EXECFN: ::c_ulong = 31;
+
+pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+    value: 0,
+    __reserved: [0; 36],
+};
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+    value: 0,
+    __reserved: [0; 44],
+};
+pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+    numLocks: 0,
+    writerThreadId: 0,
+    pendingReaders: 0,
+    pendingWriters: 0,
+    attr: 0,
+    __reserved: [0; 36],
+};
+pub const PTHREAD_STACK_MIN: ::size_t = 4096 * 4;
+pub const CPU_SETSIZE: ::size_t = 1024;
+pub const __CPU_BITS: ::size_t = 64;
+
+pub const UT_LINESIZE: usize = 32;
+pub const UT_NAMESIZE: usize = 32;
+pub const UT_HOSTSIZE: usize = 256;
+
+f! {
+    // Sadly, Android before 5.0 (API level 21), the accept4 syscall is not
+    // exposed by the libc. As work-around, we implement it through `syscall`
+    // directly. This workaround can be removed if the minimum version of
+    // Android is bumped. When the workaround is removed, `accept4` can be
+    // moved back to `linux_like/mod.rs`
+    pub fn accept4(
+        fd: ::c_int,
+        addr: *mut ::sockaddr,
+        len: *mut ::socklen_t,
+        flg: ::c_int
+    ) -> ::c_int {
+        ::syscall(SYS_accept4, fd, addr, len, flg) as ::c_int
+    }
+}
+
+extern "C" {
+    pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
+    pub fn __system_property_wait(
+        pi: *const ::prop_info,
+        __old_serial: u32,
+        __new_serial_ptr: *mut u32,
+        __relative_timeout: *const ::timespec,
+    ) -> bool;
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "x86_64")] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    } else if #[cfg(target_arch = "aarch64")] {
+        mod aarch64;
+        pub use self::aarch64::*;
+    } else if #[cfg(target_arch = "riscv64")] {
+        mod riscv64;
+        pub use self::riscv64::*;
+    } else {
+        // Unknown target_arch
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b64/riscv64/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b64/riscv64/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b64/riscv64/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b64/riscv64/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f32; 8]
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b64/riscv64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b64/riscv64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b64/riscv64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b64/riscv64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,353 @@
+pub type c_char = i8;
+pub type wchar_t = u32;
+pub type greg_t = i64;
+pub type __u64 = ::c_ulonglong;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::c_uint,
+        pub st_nlink: ::c_uint,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad1: ::c_ulong,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::c_int,
+        __pad2: ::c_int,
+        pub st_blocks: ::c_long,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused4: ::c_uint,
+        __unused5: ::c_uint,
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::c_uint,
+        pub st_nlink: ::c_uint,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad1: ::c_ulong,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::c_int,
+        __pad2: ::c_int,
+        pub st_blocks: ::c_long,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused4: ::c_uint,
+        __unused5: ::c_uint,
+    }
+}
+
+pub const O_DIRECT: ::c_int = 0x40000;
+pub const O_DIRECTORY: ::c_int = 0x200000;
+pub const O_NOFOLLOW: ::c_int = 0x400000;
+pub const O_LARGEFILE: ::c_int = 0x100000;
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+
+// From NDK's asm/hwcap.h
+pub const COMPAT_HWCAP_ISA_I: ::c_ulong = 1 << (b'I' - b'A');
+pub const COMPAT_HWCAP_ISA_M: ::c_ulong = 1 << (b'M' - b'A');
+pub const COMPAT_HWCAP_ISA_A: ::c_ulong = 1 << (b'A' - b'A');
+pub const COMPAT_HWCAP_ISA_F: ::c_ulong = 1 << (b'F' - b'A');
+pub const COMPAT_HWCAP_ISA_D: ::c_ulong = 1 << (b'D' - b'A');
+pub const COMPAT_HWCAP_ISA_C: ::c_ulong = 1 << (b'C' - b'A');
+
+pub const SYS_io_setup: ::c_long = 0;
+pub const SYS_io_destroy: ::c_long = 1;
+pub const SYS_io_submit: ::c_long = 2;
+pub const SYS_io_cancel: ::c_long = 3;
+pub const SYS_io_getevents: ::c_long = 4;
+pub const SYS_setxattr: ::c_long = 5;
+pub const SYS_lsetxattr: ::c_long = 6;
+pub const SYS_fsetxattr: ::c_long = 7;
+pub const SYS_getxattr: ::c_long = 8;
+pub const SYS_lgetxattr: ::c_long = 9;
+pub const SYS_fgetxattr: ::c_long = 10;
+pub const SYS_listxattr: ::c_long = 11;
+pub const SYS_llistxattr: ::c_long = 12;
+pub const SYS_flistxattr: ::c_long = 13;
+pub const SYS_removexattr: ::c_long = 14;
+pub const SYS_lremovexattr: ::c_long = 15;
+pub const SYS_fremovexattr: ::c_long = 16;
+pub const SYS_getcwd: ::c_long = 17;
+pub const SYS_lookup_dcookie: ::c_long = 18;
+pub const SYS_eventfd2: ::c_long = 19;
+pub const SYS_epoll_create1: ::c_long = 20;
+pub const SYS_epoll_ctl: ::c_long = 21;
+pub const SYS_epoll_pwait: ::c_long = 22;
+pub const SYS_dup: ::c_long = 23;
+pub const SYS_dup3: ::c_long = 24;
+pub const SYS_inotify_init1: ::c_long = 26;
+pub const SYS_inotify_add_watch: ::c_long = 27;
+pub const SYS_inotify_rm_watch: ::c_long = 28;
+pub const SYS_ioctl: ::c_long = 29;
+pub const SYS_ioprio_set: ::c_long = 30;
+pub const SYS_ioprio_get: ::c_long = 31;
+pub const SYS_flock: ::c_long = 32;
+pub const SYS_mknodat: ::c_long = 33;
+pub const SYS_mkdirat: ::c_long = 34;
+pub const SYS_unlinkat: ::c_long = 35;
+pub const SYS_symlinkat: ::c_long = 36;
+pub const SYS_linkat: ::c_long = 37;
+pub const SYS_renameat: ::c_long = 38;
+pub const SYS_umount2: ::c_long = 39;
+pub const SYS_mount: ::c_long = 40;
+pub const SYS_pivot_root: ::c_long = 41;
+pub const SYS_nfsservctl: ::c_long = 42;
+pub const SYS_fallocate: ::c_long = 47;
+pub const SYS_faccessat: ::c_long = 48;
+pub const SYS_chdir: ::c_long = 49;
+pub const SYS_fchdir: ::c_long = 50;
+pub const SYS_chroot: ::c_long = 51;
+pub const SYS_fchmod: ::c_long = 52;
+pub const SYS_fchmodat: ::c_long = 53;
+pub const SYS_fchownat: ::c_long = 54;
+pub const SYS_fchown: ::c_long = 55;
+pub const SYS_openat: ::c_long = 56;
+pub const SYS_close: ::c_long = 57;
+pub const SYS_vhangup: ::c_long = 58;
+pub const SYS_pipe2: ::c_long = 59;
+pub const SYS_quotactl: ::c_long = 60;
+pub const SYS_getdents64: ::c_long = 61;
+pub const SYS_read: ::c_long = 63;
+pub const SYS_write: ::c_long = 64;
+pub const SYS_readv: ::c_long = 65;
+pub const SYS_writev: ::c_long = 66;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_preadv: ::c_long = 69;
+pub const SYS_pwritev: ::c_long = 70;
+pub const SYS_pselect6: ::c_long = 72;
+pub const SYS_ppoll: ::c_long = 73;
+pub const SYS_signalfd4: ::c_long = 74;
+pub const SYS_vmsplice: ::c_long = 75;
+pub const SYS_splice: ::c_long = 76;
+pub const SYS_tee: ::c_long = 77;
+pub const SYS_readlinkat: ::c_long = 78;
+pub const SYS_sync: ::c_long = 81;
+pub const SYS_fsync: ::c_long = 82;
+pub const SYS_fdatasync: ::c_long = 83;
+pub const SYS_sync_file_range: ::c_long = 84;
+pub const SYS_timerfd_create: ::c_long = 85;
+pub const SYS_timerfd_settime: ::c_long = 86;
+pub const SYS_timerfd_gettime: ::c_long = 87;
+pub const SYS_utimensat: ::c_long = 88;
+pub const SYS_acct: ::c_long = 89;
+pub const SYS_capget: ::c_long = 90;
+pub const SYS_capset: ::c_long = 91;
+pub const SYS_personality: ::c_long = 92;
+pub const SYS_exit: ::c_long = 93;
+pub const SYS_exit_group: ::c_long = 94;
+pub const SYS_waitid: ::c_long = 95;
+pub const SYS_set_tid_address: ::c_long = 96;
+pub const SYS_unshare: ::c_long = 97;
+pub const SYS_futex: ::c_long = 98;
+pub const SYS_set_robust_list: ::c_long = 99;
+pub const SYS_get_robust_list: ::c_long = 100;
+pub const SYS_nanosleep: ::c_long = 101;
+pub const SYS_getitimer: ::c_long = 102;
+pub const SYS_setitimer: ::c_long = 103;
+pub const SYS_kexec_load: ::c_long = 104;
+pub const SYS_init_module: ::c_long = 105;
+pub const SYS_delete_module: ::c_long = 106;
+pub const SYS_timer_create: ::c_long = 107;
+pub const SYS_timer_gettime: ::c_long = 108;
+pub const SYS_timer_getoverrun: ::c_long = 109;
+pub const SYS_timer_settime: ::c_long = 110;
+pub const SYS_timer_delete: ::c_long = 111;
+pub const SYS_clock_settime: ::c_long = 112;
+pub const SYS_clock_gettime: ::c_long = 113;
+pub const SYS_clock_getres: ::c_long = 114;
+pub const SYS_clock_nanosleep: ::c_long = 115;
+pub const SYS_syslog: ::c_long = 116;
+pub const SYS_ptrace: ::c_long = 117;
+pub const SYS_sched_setparam: ::c_long = 118;
+pub const SYS_sched_setscheduler: ::c_long = 119;
+pub const SYS_sched_getscheduler: ::c_long = 120;
+pub const SYS_sched_getparam: ::c_long = 121;
+pub const SYS_sched_setaffinity: ::c_long = 122;
+pub const SYS_sched_getaffinity: ::c_long = 123;
+pub const SYS_sched_yield: ::c_long = 124;
+pub const SYS_sched_get_priority_max: ::c_long = 125;
+pub const SYS_sched_get_priority_min: ::c_long = 126;
+pub const SYS_sched_rr_get_interval: ::c_long = 127;
+pub const SYS_restart_syscall: ::c_long = 128;
+pub const SYS_kill: ::c_long = 129;
+pub const SYS_tkill: ::c_long = 130;
+pub const SYS_tgkill: ::c_long = 131;
+pub const SYS_sigaltstack: ::c_long = 132;
+pub const SYS_rt_sigsuspend: ::c_long = 133;
+pub const SYS_rt_sigaction: ::c_long = 134;
+pub const SYS_rt_sigprocmask: ::c_long = 135;
+pub const SYS_rt_sigpending: ::c_long = 136;
+pub const SYS_rt_sigtimedwait: ::c_long = 137;
+pub const SYS_rt_sigqueueinfo: ::c_long = 138;
+pub const SYS_rt_sigreturn: ::c_long = 139;
+pub const SYS_setpriority: ::c_long = 140;
+pub const SYS_getpriority: ::c_long = 141;
+pub const SYS_reboot: ::c_long = 142;
+pub const SYS_setregid: ::c_long = 143;
+pub const SYS_setgid: ::c_long = 144;
+pub const SYS_setreuid: ::c_long = 145;
+pub const SYS_setuid: ::c_long = 146;
+pub const SYS_setresuid: ::c_long = 147;
+pub const SYS_getresuid: ::c_long = 148;
+pub const SYS_setresgid: ::c_long = 149;
+pub const SYS_getresgid: ::c_long = 150;
+pub const SYS_setfsuid: ::c_long = 151;
+pub const SYS_setfsgid: ::c_long = 152;
+pub const SYS_times: ::c_long = 153;
+pub const SYS_setpgid: ::c_long = 154;
+pub const SYS_getpgid: ::c_long = 155;
+pub const SYS_getsid: ::c_long = 156;
+pub const SYS_setsid: ::c_long = 157;
+pub const SYS_getgroups: ::c_long = 158;
+pub const SYS_setgroups: ::c_long = 159;
+pub const SYS_uname: ::c_long = 160;
+pub const SYS_sethostname: ::c_long = 161;
+pub const SYS_setdomainname: ::c_long = 162;
+pub const SYS_getrlimit: ::c_long = 163;
+pub const SYS_setrlimit: ::c_long = 164;
+pub const SYS_getrusage: ::c_long = 165;
+pub const SYS_umask: ::c_long = 166;
+pub const SYS_prctl: ::c_long = 167;
+pub const SYS_getcpu: ::c_long = 168;
+pub const SYS_gettimeofday: ::c_long = 169;
+pub const SYS_settimeofday: ::c_long = 170;
+pub const SYS_adjtimex: ::c_long = 171;
+pub const SYS_getpid: ::c_long = 172;
+pub const SYS_getppid: ::c_long = 173;
+pub const SYS_getuid: ::c_long = 174;
+pub const SYS_geteuid: ::c_long = 175;
+pub const SYS_getgid: ::c_long = 176;
+pub const SYS_getegid: ::c_long = 177;
+pub const SYS_gettid: ::c_long = 178;
+pub const SYS_sysinfo: ::c_long = 179;
+pub const SYS_mq_open: ::c_long = 180;
+pub const SYS_mq_unlink: ::c_long = 181;
+pub const SYS_mq_timedsend: ::c_long = 182;
+pub const SYS_mq_timedreceive: ::c_long = 183;
+pub const SYS_mq_notify: ::c_long = 184;
+pub const SYS_mq_getsetattr: ::c_long = 185;
+pub const SYS_msgget: ::c_long = 186;
+pub const SYS_msgctl: ::c_long = 187;
+pub const SYS_msgrcv: ::c_long = 188;
+pub const SYS_msgsnd: ::c_long = 189;
+pub const SYS_semget: ::c_long = 190;
+pub const SYS_semctl: ::c_long = 191;
+pub const SYS_semtimedop: ::c_long = 192;
+pub const SYS_semop: ::c_long = 193;
+pub const SYS_shmget: ::c_long = 194;
+pub const SYS_shmctl: ::c_long = 195;
+pub const SYS_shmat: ::c_long = 196;
+pub const SYS_shmdt: ::c_long = 197;
+pub const SYS_socket: ::c_long = 198;
+pub const SYS_socketpair: ::c_long = 199;
+pub const SYS_bind: ::c_long = 200;
+pub const SYS_listen: ::c_long = 201;
+pub const SYS_accept: ::c_long = 202;
+pub const SYS_connect: ::c_long = 203;
+pub const SYS_getsockname: ::c_long = 204;
+pub const SYS_getpeername: ::c_long = 205;
+pub const SYS_sendto: ::c_long = 206;
+pub const SYS_recvfrom: ::c_long = 207;
+pub const SYS_setsockopt: ::c_long = 208;
+pub const SYS_getsockopt: ::c_long = 209;
+pub const SYS_shutdown: ::c_long = 210;
+pub const SYS_sendmsg: ::c_long = 211;
+pub const SYS_recvmsg: ::c_long = 212;
+pub const SYS_readahead: ::c_long = 213;
+pub const SYS_brk: ::c_long = 214;
+pub const SYS_munmap: ::c_long = 215;
+pub const SYS_mremap: ::c_long = 216;
+pub const SYS_add_key: ::c_long = 217;
+pub const SYS_request_key: ::c_long = 218;
+pub const SYS_keyctl: ::c_long = 219;
+pub const SYS_clone: ::c_long = 220;
+pub const SYS_execve: ::c_long = 221;
+pub const SYS_swapon: ::c_long = 224;
+pub const SYS_swapoff: ::c_long = 225;
+pub const SYS_mprotect: ::c_long = 226;
+pub const SYS_msync: ::c_long = 227;
+pub const SYS_mlock: ::c_long = 228;
+pub const SYS_munlock: ::c_long = 229;
+pub const SYS_mlockall: ::c_long = 230;
+pub const SYS_munlockall: ::c_long = 231;
+pub const SYS_mincore: ::c_long = 232;
+pub const SYS_madvise: ::c_long = 233;
+pub const SYS_remap_file_pages: ::c_long = 234;
+pub const SYS_mbind: ::c_long = 235;
+pub const SYS_get_mempolicy: ::c_long = 236;
+pub const SYS_set_mempolicy: ::c_long = 237;
+pub const SYS_migrate_pages: ::c_long = 238;
+pub const SYS_move_pages: ::c_long = 239;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
+pub const SYS_perf_event_open: ::c_long = 241;
+pub const SYS_accept4: ::c_long = 242;
+pub const SYS_recvmmsg: ::c_long = 243;
+pub const SYS_arch_specific_syscall: ::c_long = 244;
+pub const SYS_wait4: ::c_long = 260;
+pub const SYS_prlimit64: ::c_long = 261;
+pub const SYS_fanotify_init: ::c_long = 262;
+pub const SYS_fanotify_mark: ::c_long = 263;
+pub const SYS_name_to_handle_at: ::c_long = 264;
+pub const SYS_open_by_handle_at: ::c_long = 265;
+pub const SYS_clock_adjtime: ::c_long = 266;
+pub const SYS_syncfs: ::c_long = 267;
+pub const SYS_setns: ::c_long = 268;
+pub const SYS_sendmmsg: ::c_long = 269;
+pub const SYS_process_vm_readv: ::c_long = 270;
+pub const SYS_process_vm_writev: ::c_long = 271;
+pub const SYS_kcmp: ::c_long = 272;
+pub const SYS_finit_module: ::c_long = 273;
+pub const SYS_sched_setattr: ::c_long = 274;
+pub const SYS_sched_getattr: ::c_long = 275;
+pub const SYS_renameat2: ::c_long = 276;
+pub const SYS_seccomp: ::c_long = 277;
+pub const SYS_getrandom: ::c_long = 278;
+pub const SYS_memfd_create: ::c_long = 279;
+pub const SYS_bpf: ::c_long = 280;
+pub const SYS_execveat: ::c_long = 281;
+pub const SYS_userfaultfd: ::c_long = 282;
+pub const SYS_membarrier: ::c_long = 283;
+pub const SYS_mlock2: ::c_long = 284;
+pub const SYS_copy_file_range: ::c_long = 285;
+pub const SYS_preadv2: ::c_long = 286;
+pub const SYS_pwritev2: ::c_long = 287;
+pub const SYS_pkey_mprotect: ::c_long = 288;
+pub const SYS_pkey_alloc: ::c_long = 289;
+pub const SYS_pkey_free: ::c_long = 290;
+pub const SYS_statx: ::c_long = 291;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_syscalls: ::c_long = 436;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b64/x86_64/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b64/x86_64/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b64/x86_64/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b64/x86_64/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f64; 4]
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,802 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
+pub type greg_t = i64;
+pub type __u64 = ::c_ulonglong;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::c_ulong,
+        pub st_mode: ::c_uint,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::c_long,
+        pub st_blocks: ::c_long,
+        pub st_atime: ::c_long,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::c_long,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::c_long,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_long; 3],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::c_ulong,
+        pub st_mode: ::c_uint,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::c_long,
+        pub st_blocks: ::c_long,
+        pub st_atime: ::c_long,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::c_long,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::c_long,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_long; 3],
+    }
+
+    pub struct _libc_xmmreg {
+        pub element: [u32; 4],
+    }
+
+    pub struct user_regs_struct {
+        pub r15: ::c_ulong,
+        pub r14: ::c_ulong,
+        pub r13: ::c_ulong,
+        pub r12: ::c_ulong,
+        pub rbp: ::c_ulong,
+        pub rbx: ::c_ulong,
+        pub r11: ::c_ulong,
+        pub r10: ::c_ulong,
+        pub r9: ::c_ulong,
+        pub r8: ::c_ulong,
+        pub rax: ::c_ulong,
+        pub rcx: ::c_ulong,
+        pub rdx: ::c_ulong,
+        pub rsi: ::c_ulong,
+        pub rdi: ::c_ulong,
+        pub orig_rax: ::c_ulong,
+        pub rip: ::c_ulong,
+        pub cs: ::c_ulong,
+        pub eflags: ::c_ulong,
+        pub rsp: ::c_ulong,
+        pub ss: ::c_ulong,
+        pub fs_base: ::c_ulong,
+        pub gs_base: ::c_ulong,
+        pub ds: ::c_ulong,
+        pub es: ::c_ulong,
+        pub fs: ::c_ulong,
+        pub gs: ::c_ulong,
+    }
+
+    pub struct user {
+        pub regs: user_regs_struct,
+        pub u_fpvalid: ::c_int,
+        pub i387: user_fpregs_struct,
+        pub u_tsize: ::c_ulong,
+        pub u_dsize: ::c_ulong,
+        pub u_ssize: ::c_ulong,
+        pub start_code: ::c_ulong,
+        pub start_stack: ::c_ulong,
+        pub signal: ::c_long,
+        __reserved: ::c_int,
+        #[cfg(target_pointer_width = "32")]
+        __pad1: u32,
+        pub u_ar0: *mut user_regs_struct,
+        #[cfg(target_pointer_width = "32")]
+        __pad2: u32,
+        pub u_fpstate: *mut user_fpregs_struct,
+        pub magic: ::c_ulong,
+        pub u_comm: [::c_char; 32],
+        pub u_debugreg: [::c_ulong; 8],
+        pub error_code: ::c_ulong,
+        pub fault_address: ::c_ulong,
+    }
+
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        s_no_extra_traits! {
+            pub union __c_anonymous_uc_sigmask {
+                uc_sigmask: ::sigset_t,
+                uc_sigmask64: ::sigset64_t,
+            }
+        }
+
+        cfg_if! {
+            if #[cfg(feature = "extra_traits")] {
+                impl PartialEq for __c_anonymous_uc_sigmask {
+                    fn eq(&self, other: &__c_anonymous_uc_sigmask) -> bool {
+                        unsafe { self.uc_sigmask == other.uc_sigmask }
+                    }
+                }
+                impl Eq for __c_anonymous_uc_sigmask {}
+                impl ::fmt::Debug for __c_anonymous_uc_sigmask {
+                    fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                        f.debug_struct("uc_sigmask")
+                            .field("uc_sigmask", unsafe { &self.uc_sigmask })
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for __c_anonymous_uc_sigmask {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        unsafe { self.uc_sigmask.hash(state) }
+                    }
+                }
+            }
+        }
+    }
+}
+
+s_no_extra_traits! {
+    pub struct _libc_fpxreg {
+        pub significand: [u16; 4],
+        pub exponent: u16,
+        __padding: [u16; 3],
+    }
+
+    pub struct _libc_fpstate {
+        pub cwd: u16,
+        pub swd: u16,
+        pub ftw: u16,
+        pub fop: u16,
+        pub rip: u64,
+        pub rdp: u64,
+        pub mxcsr: u32,
+        pub mxcr_mask: u32,
+        pub _st: [_libc_fpxreg; 8],
+        pub _xmm: [_libc_xmmreg; 16],
+        __private: [u32; 24],
+    }
+
+    pub struct mcontext_t {
+        pub gregs: [greg_t; 23],
+        pub fpregs: *mut _libc_fpstate,
+        __private: [u64; 8],
+    }
+
+    pub struct ucontext_t {
+        pub uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_mcontext: mcontext_t,
+        pub uc_sigmask64: __c_anonymous_uc_sigmask,
+        __fpregs_mem: _libc_fpstate,
+    }
+
+    pub struct user_fpregs_struct {
+        pub cwd: ::c_ushort,
+        pub swd: ::c_ushort,
+        pub ftw: ::c_ushort,
+        pub fop: ::c_ushort,
+        pub rip: ::c_ulong,
+        pub rdp: ::c_ulong,
+        pub mxcsr: ::c_uint,
+        pub mxcr_mask: ::c_uint,
+        pub st_space: [::c_uint; 32],
+        pub xmm_space: [::c_uint; 64],
+        padding: [::c_uint; 24],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for _libc_fpxreg {
+            fn eq(&self, other: &Self) -> bool {
+                self.significand == other.significand
+                    && self.exponent == other.exponent
+                    // Ignore padding field
+            }
+        }
+        impl Eq for _libc_fpxreg {}
+        impl ::fmt::Debug for _libc_fpxreg {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("_libc_fpxreg")
+                    .field("significand", &self.significand)
+                    .field("exponent", &self.exponent)
+                    // Ignore padding field
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for _libc_fpxreg {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.significand.hash(state);
+                self.exponent.hash(state);
+                // Ignore padding field
+            }
+        }
+
+        impl PartialEq for _libc_fpstate {
+            fn eq(&self, other: &Self) -> bool {
+                self.cwd == other.cwd
+                    && self.swd == other.swd
+                    && self.ftw == other.ftw
+                    && self.fop == other.fop
+                    && self.rip == other.rip
+                    && self.rdp == other.rdp
+                    && self.mxcsr == other.mxcsr
+                    && self.mxcr_mask == other.mxcr_mask
+                    && self._st == other._st
+                    && self._xmm == other._xmm
+                    // Ignore padding field
+            }
+        }
+        impl Eq for _libc_fpstate {}
+        impl ::fmt::Debug for _libc_fpstate {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("_libc_fpstate")
+                    .field("cwd", &self.cwd)
+                    .field("swd", &self.swd)
+                    .field("ftw", &self.ftw)
+                    .field("fop", &self.fop)
+                    .field("rip", &self.rip)
+                    .field("rdp", &self.rdp)
+                    .field("mxcsr", &self.mxcsr)
+                    .field("mxcr_mask", &self.mxcr_mask)
+                    .field("_st", &self._st)
+                    .field("_xmm", &self._xmm)
+                    // Ignore padding field
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for _libc_fpstate {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.cwd.hash(state);
+                self.swd.hash(state);
+                self.ftw.hash(state);
+                self.fop.hash(state);
+                self.rip.hash(state);
+                self.rdp.hash(state);
+                self.mxcsr.hash(state);
+                self.mxcr_mask.hash(state);
+                self._st.hash(state);
+                self._xmm.hash(state);
+                // Ignore padding field
+            }
+        }
+
+        impl PartialEq for mcontext_t {
+            fn eq(&self, other: &Self) -> bool {
+                self.gregs == other.gregs
+                    && self.fpregs == other.fpregs
+                    // Ignore padding field
+            }
+        }
+        impl Eq for mcontext_t {}
+        impl ::fmt::Debug for mcontext_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("mcontext_t")
+                    .field("gregs", &self.gregs)
+                    .field("fpregs", &self.fpregs)
+                    // Ignore padding field
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for mcontext_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.gregs.hash(state);
+                self.fpregs.hash(state);
+                // Ignore padding field
+            }
+        }
+
+        impl PartialEq for ucontext_t {
+            fn eq(&self, other: &Self) -> bool {
+                self.uc_flags == other.uc_flags
+                    && self.uc_link == other.uc_link
+                    && self.uc_stack == other.uc_stack
+                    && self.uc_mcontext == other.uc_mcontext
+                    && self.uc_sigmask64 == other.uc_sigmask64
+                    // Ignore padding field
+            }
+        }
+        impl Eq for ucontext_t {}
+        impl ::fmt::Debug for ucontext_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ucontext_t")
+                    .field("uc_flags", &self.uc_flags)
+                    .field("uc_link", &self.uc_link)
+                    .field("uc_stack", &self.uc_stack)
+                    .field("uc_mcontext", &self.uc_mcontext)
+                    .field("uc_sigmask64", &self.uc_sigmask64)
+                    // Ignore padding field
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for ucontext_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.uc_flags.hash(state);
+                self.uc_link.hash(state);
+                self.uc_stack.hash(state);
+                self.uc_mcontext.hash(state);
+                self.uc_sigmask64.hash(state);
+                // Ignore padding field
+            }
+        }
+
+        impl PartialEq for user_fpregs_struct {
+            fn eq(&self, other: &user_fpregs_struct) -> bool {
+                self.cwd == other.cwd
+                    && self.swd == other.swd
+                    && self.ftw == other.ftw
+                    && self.fop == other.fop
+                    && self.rip == other.rip
+                    && self.rdp == other.rdp
+                    && self.mxcsr == other.mxcsr
+                    && self.mxcr_mask == other.mxcr_mask
+                    && self.st_space == other.st_space
+                    && self
+                    .xmm_space
+                    .iter()
+                    .zip(other.xmm_space.iter())
+                    .all(|(a,b)| a == b)
+                // Ignore padding field
+            }
+        }
+
+        impl Eq for user_fpregs_struct {}
+
+        impl ::fmt::Debug for user_fpregs_struct {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("user_fpregs_struct")
+                    .field("cwd", &self.cwd)
+                    .field("swd", &self.swd)
+                    .field("ftw", &self.ftw)
+                    .field("fop", &self.fop)
+                    .field("rip", &self.rip)
+                    .field("rdp", &self.rdp)
+                    .field("mxcsr", &self.mxcsr)
+                    .field("mxcr_mask", &self.mxcr_mask)
+                    .field("st_space", &self.st_space)
+                // FIXME: .field("xmm_space", &self.xmm_space)
+                // Ignore padding field
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for user_fpregs_struct {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.cwd.hash(state);
+                self.swd.hash(state);
+                self.ftw.hash(state);
+                self.fop.hash(state);
+                self.rip.hash(state);
+                self.rdp.hash(state);
+                self.mxcsr.hash(state);
+                self.mxcr_mask.hash(state);
+                self.st_space.hash(state);
+                self.xmm_space.hash(state);
+                // Ignore padding field
+            }
+        }
+    }
+}
+
+pub const O_DIRECT: ::c_int = 0x4000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+pub const O_LARGEFILE: ::c_int = 0o0100000;
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+
+pub const MAP_32BIT: ::c_int = 0x40;
+
+// Syscall table
+
+pub const SYS_read: ::c_long = 0;
+pub const SYS_write: ::c_long = 1;
+pub const SYS_open: ::c_long = 2;
+pub const SYS_close: ::c_long = 3;
+pub const SYS_stat: ::c_long = 4;
+pub const SYS_fstat: ::c_long = 5;
+pub const SYS_lstat: ::c_long = 6;
+pub const SYS_poll: ::c_long = 7;
+pub const SYS_lseek: ::c_long = 8;
+pub const SYS_mmap: ::c_long = 9;
+pub const SYS_mprotect: ::c_long = 10;
+pub const SYS_munmap: ::c_long = 11;
+pub const SYS_brk: ::c_long = 12;
+pub const SYS_rt_sigaction: ::c_long = 13;
+pub const SYS_rt_sigprocmask: ::c_long = 14;
+pub const SYS_rt_sigreturn: ::c_long = 15;
+pub const SYS_ioctl: ::c_long = 16;
+pub const SYS_pread64: ::c_long = 17;
+pub const SYS_pwrite64: ::c_long = 18;
+pub const SYS_readv: ::c_long = 19;
+pub const SYS_writev: ::c_long = 20;
+pub const SYS_access: ::c_long = 21;
+pub const SYS_pipe: ::c_long = 22;
+pub const SYS_select: ::c_long = 23;
+pub const SYS_sched_yield: ::c_long = 24;
+pub const SYS_mremap: ::c_long = 25;
+pub const SYS_msync: ::c_long = 26;
+pub const SYS_mincore: ::c_long = 27;
+pub const SYS_madvise: ::c_long = 28;
+pub const SYS_shmget: ::c_long = 29;
+pub const SYS_shmat: ::c_long = 30;
+pub const SYS_shmctl: ::c_long = 31;
+pub const SYS_dup: ::c_long = 32;
+pub const SYS_dup2: ::c_long = 33;
+pub const SYS_pause: ::c_long = 34;
+pub const SYS_nanosleep: ::c_long = 35;
+pub const SYS_getitimer: ::c_long = 36;
+pub const SYS_alarm: ::c_long = 37;
+pub const SYS_setitimer: ::c_long = 38;
+pub const SYS_getpid: ::c_long = 39;
+pub const SYS_sendfile: ::c_long = 40;
+pub const SYS_socket: ::c_long = 41;
+pub const SYS_connect: ::c_long = 42;
+pub const SYS_accept: ::c_long = 43;
+pub const SYS_sendto: ::c_long = 44;
+pub const SYS_recvfrom: ::c_long = 45;
+pub const SYS_sendmsg: ::c_long = 46;
+pub const SYS_recvmsg: ::c_long = 47;
+pub const SYS_shutdown: ::c_long = 48;
+pub const SYS_bind: ::c_long = 49;
+pub const SYS_listen: ::c_long = 50;
+pub const SYS_getsockname: ::c_long = 51;
+pub const SYS_getpeername: ::c_long = 52;
+pub const SYS_socketpair: ::c_long = 53;
+pub const SYS_setsockopt: ::c_long = 54;
+pub const SYS_getsockopt: ::c_long = 55;
+pub const SYS_clone: ::c_long = 56;
+pub const SYS_fork: ::c_long = 57;
+pub const SYS_vfork: ::c_long = 58;
+pub const SYS_execve: ::c_long = 59;
+pub const SYS_exit: ::c_long = 60;
+pub const SYS_wait4: ::c_long = 61;
+pub const SYS_kill: ::c_long = 62;
+pub const SYS_uname: ::c_long = 63;
+pub const SYS_semget: ::c_long = 64;
+pub const SYS_semop: ::c_long = 65;
+pub const SYS_semctl: ::c_long = 66;
+pub const SYS_shmdt: ::c_long = 67;
+pub const SYS_msgget: ::c_long = 68;
+pub const SYS_msgsnd: ::c_long = 69;
+pub const SYS_msgrcv: ::c_long = 70;
+pub const SYS_msgctl: ::c_long = 71;
+pub const SYS_fcntl: ::c_long = 72;
+pub const SYS_flock: ::c_long = 73;
+pub const SYS_fsync: ::c_long = 74;
+pub const SYS_fdatasync: ::c_long = 75;
+pub const SYS_truncate: ::c_long = 76;
+pub const SYS_ftruncate: ::c_long = 77;
+pub const SYS_getdents: ::c_long = 78;
+pub const SYS_getcwd: ::c_long = 79;
+pub const SYS_chdir: ::c_long = 80;
+pub const SYS_fchdir: ::c_long = 81;
+pub const SYS_rename: ::c_long = 82;
+pub const SYS_mkdir: ::c_long = 83;
+pub const SYS_rmdir: ::c_long = 84;
+pub const SYS_creat: ::c_long = 85;
+pub const SYS_link: ::c_long = 86;
+pub const SYS_unlink: ::c_long = 87;
+pub const SYS_symlink: ::c_long = 88;
+pub const SYS_readlink: ::c_long = 89;
+pub const SYS_chmod: ::c_long = 90;
+pub const SYS_fchmod: ::c_long = 91;
+pub const SYS_chown: ::c_long = 92;
+pub const SYS_fchown: ::c_long = 93;
+pub const SYS_lchown: ::c_long = 94;
+pub const SYS_umask: ::c_long = 95;
+pub const SYS_gettimeofday: ::c_long = 96;
+pub const SYS_getrlimit: ::c_long = 97;
+pub const SYS_getrusage: ::c_long = 98;
+pub const SYS_sysinfo: ::c_long = 99;
+pub const SYS_times: ::c_long = 100;
+pub const SYS_ptrace: ::c_long = 101;
+pub const SYS_getuid: ::c_long = 102;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_getgid: ::c_long = 104;
+pub const SYS_setuid: ::c_long = 105;
+pub const SYS_setgid: ::c_long = 106;
+pub const SYS_geteuid: ::c_long = 107;
+pub const SYS_getegid: ::c_long = 108;
+pub const SYS_setpgid: ::c_long = 109;
+pub const SYS_getppid: ::c_long = 110;
+pub const SYS_getpgrp: ::c_long = 111;
+pub const SYS_setsid: ::c_long = 112;
+pub const SYS_setreuid: ::c_long = 113;
+pub const SYS_setregid: ::c_long = 114;
+pub const SYS_getgroups: ::c_long = 115;
+pub const SYS_setgroups: ::c_long = 116;
+pub const SYS_setresuid: ::c_long = 117;
+pub const SYS_getresuid: ::c_long = 118;
+pub const SYS_setresgid: ::c_long = 119;
+pub const SYS_getresgid: ::c_long = 120;
+pub const SYS_getpgid: ::c_long = 121;
+pub const SYS_setfsuid: ::c_long = 122;
+pub const SYS_setfsgid: ::c_long = 123;
+pub const SYS_getsid: ::c_long = 124;
+pub const SYS_capget: ::c_long = 125;
+pub const SYS_capset: ::c_long = 126;
+pub const SYS_rt_sigpending: ::c_long = 127;
+pub const SYS_rt_sigtimedwait: ::c_long = 128;
+pub const SYS_rt_sigqueueinfo: ::c_long = 129;
+pub const SYS_rt_sigsuspend: ::c_long = 130;
+pub const SYS_sigaltstack: ::c_long = 131;
+pub const SYS_utime: ::c_long = 132;
+pub const SYS_mknod: ::c_long = 133;
+pub const SYS_uselib: ::c_long = 134;
+pub const SYS_personality: ::c_long = 135;
+pub const SYS_ustat: ::c_long = 136;
+pub const SYS_statfs: ::c_long = 137;
+pub const SYS_fstatfs: ::c_long = 138;
+pub const SYS_sysfs: ::c_long = 139;
+pub const SYS_getpriority: ::c_long = 140;
+pub const SYS_setpriority: ::c_long = 141;
+pub const SYS_sched_setparam: ::c_long = 142;
+pub const SYS_sched_getparam: ::c_long = 143;
+pub const SYS_sched_setscheduler: ::c_long = 144;
+pub const SYS_sched_getscheduler: ::c_long = 145;
+pub const SYS_sched_get_priority_max: ::c_long = 146;
+pub const SYS_sched_get_priority_min: ::c_long = 147;
+pub const SYS_sched_rr_get_interval: ::c_long = 148;
+pub const SYS_mlock: ::c_long = 149;
+pub const SYS_munlock: ::c_long = 150;
+pub const SYS_mlockall: ::c_long = 151;
+pub const SYS_munlockall: ::c_long = 152;
+pub const SYS_vhangup: ::c_long = 153;
+pub const SYS_modify_ldt: ::c_long = 154;
+pub const SYS_pivot_root: ::c_long = 155;
+// FIXME: SYS__sysctl is in the NDK sources but for some reason is
+//        not available in the tests
+// pub const SYS__sysctl: ::c_long = 156;
+pub const SYS_prctl: ::c_long = 157;
+pub const SYS_arch_prctl: ::c_long = 158;
+pub const SYS_adjtimex: ::c_long = 159;
+pub const SYS_setrlimit: ::c_long = 160;
+pub const SYS_chroot: ::c_long = 161;
+pub const SYS_sync: ::c_long = 162;
+pub const SYS_acct: ::c_long = 163;
+pub const SYS_settimeofday: ::c_long = 164;
+pub const SYS_mount: ::c_long = 165;
+pub const SYS_umount2: ::c_long = 166;
+pub const SYS_swapon: ::c_long = 167;
+pub const SYS_swapoff: ::c_long = 168;
+pub const SYS_reboot: ::c_long = 169;
+pub const SYS_sethostname: ::c_long = 170;
+pub const SYS_setdomainname: ::c_long = 171;
+pub const SYS_iopl: ::c_long = 172;
+pub const SYS_ioperm: ::c_long = 173;
+pub const SYS_create_module: ::c_long = 174;
+pub const SYS_init_module: ::c_long = 175;
+pub const SYS_delete_module: ::c_long = 176;
+pub const SYS_get_kernel_syms: ::c_long = 177;
+pub const SYS_query_module: ::c_long = 178;
+pub const SYS_quotactl: ::c_long = 179;
+pub const SYS_nfsservctl: ::c_long = 180;
+pub const SYS_getpmsg: ::c_long = 181;
+pub const SYS_putpmsg: ::c_long = 182;
+pub const SYS_afs_syscall: ::c_long = 183;
+pub const SYS_tuxcall: ::c_long = 184;
+pub const SYS_security: ::c_long = 185;
+pub const SYS_gettid: ::c_long = 186;
+pub const SYS_readahead: ::c_long = 187;
+pub const SYS_setxattr: ::c_long = 188;
+pub const SYS_lsetxattr: ::c_long = 189;
+pub const SYS_fsetxattr: ::c_long = 190;
+pub const SYS_getxattr: ::c_long = 191;
+pub const SYS_lgetxattr: ::c_long = 192;
+pub const SYS_fgetxattr: ::c_long = 193;
+pub const SYS_listxattr: ::c_long = 194;
+pub const SYS_llistxattr: ::c_long = 195;
+pub const SYS_flistxattr: ::c_long = 196;
+pub const SYS_removexattr: ::c_long = 197;
+pub const SYS_lremovexattr: ::c_long = 198;
+pub const SYS_fremovexattr: ::c_long = 199;
+pub const SYS_tkill: ::c_long = 200;
+pub const SYS_time: ::c_long = 201;
+pub const SYS_futex: ::c_long = 202;
+pub const SYS_sched_setaffinity: ::c_long = 203;
+pub const SYS_sched_getaffinity: ::c_long = 204;
+pub const SYS_set_thread_area: ::c_long = 205;
+pub const SYS_io_setup: ::c_long = 206;
+pub const SYS_io_destroy: ::c_long = 207;
+pub const SYS_io_getevents: ::c_long = 208;
+pub const SYS_io_submit: ::c_long = 209;
+pub const SYS_io_cancel: ::c_long = 210;
+pub const SYS_get_thread_area: ::c_long = 211;
+pub const SYS_lookup_dcookie: ::c_long = 212;
+pub const SYS_epoll_create: ::c_long = 213;
+pub const SYS_epoll_ctl_old: ::c_long = 214;
+pub const SYS_epoll_wait_old: ::c_long = 215;
+pub const SYS_remap_file_pages: ::c_long = 216;
+pub const SYS_getdents64: ::c_long = 217;
+pub const SYS_set_tid_address: ::c_long = 218;
+pub const SYS_restart_syscall: ::c_long = 219;
+pub const SYS_semtimedop: ::c_long = 220;
+pub const SYS_fadvise64: ::c_long = 221;
+pub const SYS_timer_create: ::c_long = 222;
+pub const SYS_timer_settime: ::c_long = 223;
+pub const SYS_timer_gettime: ::c_long = 224;
+pub const SYS_timer_getoverrun: ::c_long = 225;
+pub const SYS_timer_delete: ::c_long = 226;
+pub const SYS_clock_settime: ::c_long = 227;
+pub const SYS_clock_gettime: ::c_long = 228;
+pub const SYS_clock_getres: ::c_long = 229;
+pub const SYS_clock_nanosleep: ::c_long = 230;
+pub const SYS_exit_group: ::c_long = 231;
+pub const SYS_epoll_wait: ::c_long = 232;
+pub const SYS_epoll_ctl: ::c_long = 233;
+pub const SYS_tgkill: ::c_long = 234;
+pub const SYS_utimes: ::c_long = 235;
+pub const SYS_vserver: ::c_long = 236;
+pub const SYS_mbind: ::c_long = 237;
+pub const SYS_set_mempolicy: ::c_long = 238;
+pub const SYS_get_mempolicy: ::c_long = 239;
+pub const SYS_mq_open: ::c_long = 240;
+pub const SYS_mq_unlink: ::c_long = 241;
+pub const SYS_mq_timedsend: ::c_long = 242;
+pub const SYS_mq_timedreceive: ::c_long = 243;
+pub const SYS_mq_notify: ::c_long = 244;
+pub const SYS_mq_getsetattr: ::c_long = 245;
+pub const SYS_kexec_load: ::c_long = 246;
+pub const SYS_waitid: ::c_long = 247;
+pub const SYS_add_key: ::c_long = 248;
+pub const SYS_request_key: ::c_long = 249;
+pub const SYS_keyctl: ::c_long = 250;
+pub const SYS_ioprio_set: ::c_long = 251;
+pub const SYS_ioprio_get: ::c_long = 252;
+pub const SYS_inotify_init: ::c_long = 253;
+pub const SYS_inotify_add_watch: ::c_long = 254;
+pub const SYS_inotify_rm_watch: ::c_long = 255;
+pub const SYS_migrate_pages: ::c_long = 256;
+pub const SYS_openat: ::c_long = 257;
+pub const SYS_mkdirat: ::c_long = 258;
+pub const SYS_mknodat: ::c_long = 259;
+pub const SYS_fchownat: ::c_long = 260;
+pub const SYS_futimesat: ::c_long = 261;
+pub const SYS_newfstatat: ::c_long = 262;
+pub const SYS_unlinkat: ::c_long = 263;
+pub const SYS_renameat: ::c_long = 264;
+pub const SYS_linkat: ::c_long = 265;
+pub const SYS_symlinkat: ::c_long = 266;
+pub const SYS_readlinkat: ::c_long = 267;
+pub const SYS_fchmodat: ::c_long = 268;
+pub const SYS_faccessat: ::c_long = 269;
+pub const SYS_pselect6: ::c_long = 270;
+pub const SYS_ppoll: ::c_long = 271;
+pub const SYS_unshare: ::c_long = 272;
+pub const SYS_set_robust_list: ::c_long = 273;
+pub const SYS_get_robust_list: ::c_long = 274;
+pub const SYS_splice: ::c_long = 275;
+pub const SYS_tee: ::c_long = 276;
+pub const SYS_sync_file_range: ::c_long = 277;
+pub const SYS_vmsplice: ::c_long = 278;
+pub const SYS_move_pages: ::c_long = 279;
+pub const SYS_utimensat: ::c_long = 280;
+pub const SYS_epoll_pwait: ::c_long = 281;
+pub const SYS_signalfd: ::c_long = 282;
+pub const SYS_timerfd_create: ::c_long = 283;
+pub const SYS_eventfd: ::c_long = 284;
+pub const SYS_fallocate: ::c_long = 285;
+pub const SYS_timerfd_settime: ::c_long = 286;
+pub const SYS_timerfd_gettime: ::c_long = 287;
+pub const SYS_accept4: ::c_long = 288;
+pub const SYS_signalfd4: ::c_long = 289;
+pub const SYS_eventfd2: ::c_long = 290;
+pub const SYS_epoll_create1: ::c_long = 291;
+pub const SYS_dup3: ::c_long = 292;
+pub const SYS_pipe2: ::c_long = 293;
+pub const SYS_inotify_init1: ::c_long = 294;
+pub const SYS_preadv: ::c_long = 295;
+pub const SYS_pwritev: ::c_long = 296;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 297;
+pub const SYS_perf_event_open: ::c_long = 298;
+pub const SYS_recvmmsg: ::c_long = 299;
+pub const SYS_fanotify_init: ::c_long = 300;
+pub const SYS_fanotify_mark: ::c_long = 301;
+pub const SYS_prlimit64: ::c_long = 302;
+pub const SYS_name_to_handle_at: ::c_long = 303;
+pub const SYS_open_by_handle_at: ::c_long = 304;
+pub const SYS_clock_adjtime: ::c_long = 305;
+pub const SYS_syncfs: ::c_long = 306;
+pub const SYS_sendmmsg: ::c_long = 307;
+pub const SYS_setns: ::c_long = 308;
+pub const SYS_getcpu: ::c_long = 309;
+pub const SYS_process_vm_readv: ::c_long = 310;
+pub const SYS_process_vm_writev: ::c_long = 311;
+pub const SYS_kcmp: ::c_long = 312;
+pub const SYS_finit_module: ::c_long = 313;
+pub const SYS_sched_setattr: ::c_long = 314;
+pub const SYS_sched_getattr: ::c_long = 315;
+pub const SYS_renameat2: ::c_long = 316;
+pub const SYS_seccomp: ::c_long = 317;
+pub const SYS_getrandom: ::c_long = 318;
+pub const SYS_memfd_create: ::c_long = 319;
+pub const SYS_kexec_file_load: ::c_long = 320;
+pub const SYS_bpf: ::c_long = 321;
+pub const SYS_execveat: ::c_long = 322;
+pub const SYS_userfaultfd: ::c_long = 323;
+pub const SYS_membarrier: ::c_long = 324;
+pub const SYS_mlock2: ::c_long = 325;
+pub const SYS_copy_file_range: ::c_long = 326;
+pub const SYS_preadv2: ::c_long = 327;
+pub const SYS_pwritev2: ::c_long = 328;
+pub const SYS_pkey_mprotect: ::c_long = 329;
+pub const SYS_pkey_alloc: ::c_long = 330;
+pub const SYS_pkey_free: ::c_long = 331;
+pub const SYS_statx: ::c_long = 332;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+
+// offsets in user_regs_structs, from sys/reg.h
+pub const R15: ::c_int = 0;
+pub const R14: ::c_int = 1;
+pub const R13: ::c_int = 2;
+pub const R12: ::c_int = 3;
+pub const RBP: ::c_int = 4;
+pub const RBX: ::c_int = 5;
+pub const R11: ::c_int = 6;
+pub const R10: ::c_int = 7;
+pub const R9: ::c_int = 8;
+pub const R8: ::c_int = 9;
+pub const RAX: ::c_int = 10;
+pub const RCX: ::c_int = 11;
+pub const RDX: ::c_int = 12;
+pub const RSI: ::c_int = 13;
+pub const RDI: ::c_int = 14;
+pub const ORIG_RAX: ::c_int = 15;
+pub const RIP: ::c_int = 16;
+pub const CS: ::c_int = 17;
+pub const EFLAGS: ::c_int = 18;
+pub const RSP: ::c_int = 19;
+pub const SS: ::c_int = 20;
+pub const FS_BASE: ::c_int = 21;
+pub const GS_BASE: ::c_int = 22;
+pub const DS: ::c_int = 23;
+pub const ES: ::c_int = 24;
+pub const FS: ::c_int = 25;
+pub const GS: ::c_int = 26;
+
+// offsets in mcontext_t.gregs from sys/ucontext.h
+pub const REG_R8: ::c_int = 0;
+pub const REG_R9: ::c_int = 1;
+pub const REG_R10: ::c_int = 2;
+pub const REG_R11: ::c_int = 3;
+pub const REG_R12: ::c_int = 4;
+pub const REG_R13: ::c_int = 5;
+pub const REG_R14: ::c_int = 6;
+pub const REG_R15: ::c_int = 7;
+pub const REG_RDI: ::c_int = 8;
+pub const REG_RSI: ::c_int = 9;
+pub const REG_RBP: ::c_int = 10;
+pub const REG_RBX: ::c_int = 11;
+pub const REG_RDX: ::c_int = 12;
+pub const REG_RAX: ::c_int = 13;
+pub const REG_RCX: ::c_int = 14;
+pub const REG_RSP: ::c_int = 15;
+pub const REG_RIP: ::c_int = 16;
+pub const REG_EFL: ::c_int = 17;
+pub const REG_CSGSFS: ::c_int = 18;
+pub const REG_ERR: ::c_int = 19;
+pub const REG_TRAPNO: ::c_int = 20;
+pub const REG_OLDMASK: ::c_int = 21;
+pub const REG_CR2: ::c_int = 22;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/android/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/android/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4196 @@
+//! Android-specific definitions for linux-like values
+
+pub type clock_t = ::c_long;
+pub type time_t = ::c_long;
+pub type suseconds_t = ::c_long;
+pub type off_t = ::c_long;
+pub type blkcnt_t = ::c_ulong;
+pub type blksize_t = ::c_ulong;
+pub type nlink_t = u32;
+pub type useconds_t = u32;
+pub type pthread_t = ::c_long;
+pub type pthread_mutexattr_t = ::c_long;
+pub type pthread_rwlockattr_t = ::c_long;
+pub type pthread_barrierattr_t = ::c_int;
+pub type pthread_condattr_t = ::c_long;
+pub type pthread_key_t = ::c_int;
+pub type fsfilcnt_t = ::c_ulong;
+pub type fsblkcnt_t = ::c_ulong;
+pub type nfds_t = ::c_uint;
+pub type rlim_t = ::c_ulong;
+pub type dev_t = ::c_ulong;
+pub type ino_t = ::c_ulong;
+pub type ino64_t = u64;
+pub type __CPU_BITTYPE = ::c_ulong;
+pub type idtype_t = ::c_int;
+pub type loff_t = ::c_longlong;
+pub type __kernel_loff_t = ::c_longlong;
+pub type __kernel_pid_t = ::c_int;
+
+pub type __u8 = ::c_uchar;
+pub type __u16 = ::c_ushort;
+pub type __s16 = ::c_short;
+pub type __u32 = ::c_uint;
+pub type __s32 = ::c_int;
+
+// linux/elf.h
+
+pub type Elf32_Addr = u32;
+pub type Elf32_Half = u16;
+pub type Elf32_Off = u32;
+pub type Elf32_Word = u32;
+
+pub type Elf64_Addr = u64;
+pub type Elf64_Half = u16;
+pub type Elf64_Off = u64;
+pub type Elf64_Word = u32;
+pub type Elf64_Xword = u64;
+
+pub type eventfd_t = u64;
+
+// these structs sit behind a heap allocation on Android
+pub type posix_spawn_file_actions_t = *mut ::c_void;
+pub type posix_spawnattr_t = *mut ::c_void;
+
+s! {
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t
+    }
+
+    pub struct __fsid_t {
+        __val: [::c_int; 2],
+    }
+
+    pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: ::socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::size_t,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: ::size_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct cmsghdr {
+        pub cmsg_len: ::size_t,
+        pub cmsg_level: ::c_int,
+        pub cmsg_type: ::c_int,
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::NCCS],
+    }
+
+    pub struct termios2 {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; 19],
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::speed_t,
+    }
+
+    pub struct mallinfo {
+        pub arena: ::size_t,
+        pub ordblks: ::size_t,
+        pub smblks: ::size_t,
+        pub hblks: ::size_t,
+        pub hblkhd: ::size_t,
+        pub usmblks: ::size_t,
+        pub fsmblks: ::size_t,
+        pub uordblks: ::size_t,
+        pub fordblks: ::size_t,
+        pub keepcost: ::size_t,
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct flock64 {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::__kernel_loff_t,
+        pub l_len: ::__kernel_loff_t,
+        pub l_pid: ::__kernel_pid_t,
+    }
+
+    pub struct cpu_set_t {
+        #[cfg(target_pointer_width = "64")]
+        __bits: [__CPU_BITTYPE; 16],
+        #[cfg(target_pointer_width = "32")]
+        __bits: [__CPU_BITTYPE; 1],
+    }
+
+    pub struct sem_t {
+        count: ::c_uint,
+        #[cfg(target_pointer_width = "64")]
+        __reserved: [::c_int; 3],
+    }
+
+    pub struct exit_status {
+        pub e_termination: ::c_short,
+        pub e_exit: ::c_short,
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        #[cfg(target_pointer_width = "64")]
+        __f_reserved: [u32; 6],
+    }
+
+    pub struct signalfd_siginfo {
+        pub ssi_signo: u32,
+        pub ssi_errno: i32,
+        pub ssi_code: i32,
+        pub ssi_pid: u32,
+        pub ssi_uid: u32,
+        pub ssi_fd: i32,
+        pub ssi_tid: u32,
+        pub ssi_band: u32,
+        pub ssi_overrun: u32,
+        pub ssi_trapno: u32,
+        pub ssi_status: i32,
+        pub ssi_int: i32,
+        pub ssi_ptr: ::c_ulonglong,
+        pub ssi_utime: ::c_ulonglong,
+        pub ssi_stime: ::c_ulonglong,
+        pub ssi_addr: ::c_ulonglong,
+        pub ssi_addr_lsb: u16,
+        _pad2: u16,
+        pub ssi_syscall: i32,
+        pub ssi_call_addr: u64,
+        pub ssi_arch: u32,
+        _pad: [u8; 28],
+    }
+
+    pub struct itimerspec {
+        pub it_interval: ::timespec,
+        pub it_value: ::timespec,
+    }
+
+    pub struct ucred {
+        pub pid: ::pid_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+    }
+
+    pub struct genlmsghdr {
+        pub cmd: u8,
+        pub version: u8,
+        pub reserved: u16,
+    }
+
+    pub struct nlmsghdr {
+        pub nlmsg_len: u32,
+        pub nlmsg_type: u16,
+        pub nlmsg_flags: u16,
+        pub nlmsg_seq: u32,
+        pub nlmsg_pid: u32,
+    }
+
+    pub struct nlmsgerr {
+        pub error: ::c_int,
+        pub msg: nlmsghdr,
+    }
+
+    pub struct nl_pktinfo {
+        pub group: u32,
+    }
+
+    pub struct nl_mmap_req {
+        pub nm_block_size: ::c_uint,
+        pub nm_block_nr: ::c_uint,
+        pub nm_frame_size: ::c_uint,
+        pub nm_frame_nr: ::c_uint,
+    }
+
+    pub struct nl_mmap_hdr {
+        pub nm_status: ::c_uint,
+        pub nm_len: ::c_uint,
+        pub nm_group: u32,
+        pub nm_pid: u32,
+        pub nm_uid: u32,
+        pub nm_gid: u32,
+    }
+
+    pub struct nlattr {
+        pub nla_len: u16,
+        pub nla_type: u16,
+    }
+
+    pub struct in6_pktinfo {
+        pub ipi6_addr: ::in6_addr,
+        pub ipi6_ifindex: ::c_int,
+    }
+
+    pub struct inotify_event {
+        pub wd: ::c_int,
+        pub mask: u32,
+        pub cookie: u32,
+        pub len: u32
+    }
+
+    pub struct sock_extended_err {
+        pub ee_errno: u32,
+        pub ee_origin: u8,
+        pub ee_type: u8,
+        pub ee_code: u8,
+        pub ee_pad: u8,
+        pub ee_info: u32,
+        pub ee_data: u32,
+    }
+
+    pub struct regex_t {
+        re_magic: ::c_int,
+        re_nsub: ::size_t,
+        re_endp: *const ::c_char,
+        re_guts: *mut ::c_void,
+    }
+
+    pub struct regmatch_t {
+        pub rm_so: ::ssize_t,
+        pub rm_eo: ::ssize_t,
+    }
+
+    pub struct sockaddr_vm {
+        pub svm_family: ::sa_family_t,
+        pub svm_reserved1: ::c_ushort,
+        pub svm_port: ::c_uint,
+        pub svm_cid: ::c_uint,
+        pub svm_zero: [u8; 4]
+    }
+
+    // linux/elf.h
+
+    pub struct Elf32_Phdr {
+        pub p_type: Elf32_Word,
+        pub p_offset: Elf32_Off,
+        pub p_vaddr: Elf32_Addr,
+        pub p_paddr: Elf32_Addr,
+        pub p_filesz: Elf32_Word,
+        pub p_memsz: Elf32_Word,
+        pub p_flags: Elf32_Word,
+        pub p_align: Elf32_Word,
+    }
+
+    pub struct Elf64_Phdr {
+        pub p_type: Elf64_Word,
+        pub p_flags: Elf64_Word,
+        pub p_offset: Elf64_Off,
+        pub p_vaddr: Elf64_Addr,
+        pub p_paddr: Elf64_Addr,
+        pub p_filesz: Elf64_Xword,
+        pub p_memsz: Elf64_Xword,
+        pub p_align: Elf64_Xword,
+    }
+
+    // link.h
+
+    pub struct dl_phdr_info {
+        #[cfg(target_pointer_width = "64")]
+        pub dlpi_addr: Elf64_Addr,
+        #[cfg(target_pointer_width = "32")]
+        pub dlpi_addr: Elf32_Addr,
+
+        pub dlpi_name: *const ::c_char,
+
+        #[cfg(target_pointer_width = "64")]
+        pub dlpi_phdr: *const Elf64_Phdr,
+        #[cfg(target_pointer_width = "32")]
+        pub dlpi_phdr: *const Elf32_Phdr,
+
+        #[cfg(target_pointer_width = "64")]
+        pub dlpi_phnum: Elf64_Half,
+        #[cfg(target_pointer_width = "32")]
+        pub dlpi_phnum: Elf32_Half,
+
+        // These fields were added in Android R
+        pub dlpi_adds: ::c_ulonglong,
+        pub dlpi_subs: ::c_ulonglong,
+        pub dlpi_tls_modid: ::size_t,
+        pub dlpi_tls_data: *mut ::c_void,
+    }
+
+    // linux/filter.h
+    pub struct sock_filter {
+        pub code: ::__u16,
+        pub jt: ::__u8,
+        pub jf: ::__u8,
+        pub k: ::__u32,
+    }
+
+    pub struct sock_fprog {
+        pub len: ::c_ushort,
+        pub filter: *mut sock_filter,
+    }
+
+    // linux/seccomp.h
+    pub struct seccomp_data {
+        pub nr: ::c_int,
+        pub arch: ::__u32,
+        pub instruction_pointer: ::__u64,
+        pub args: [::__u64; 6],
+    }
+
+    pub struct seccomp_metadata {
+        pub filter_off: ::__u64,
+        pub flags: ::__u64,
+    }
+
+    pub struct ptrace_peeksiginfo_args {
+        pub off: ::__u64,
+        pub flags: ::__u32,
+        pub nr: ::__s32,
+    }
+
+    // linux/input.h
+    pub struct input_event {
+        pub time: ::timeval,
+        pub type_: ::__u16,
+        pub code: ::__u16,
+        pub value: ::__s32,
+    }
+
+    pub struct input_id {
+        pub bustype: ::__u16,
+        pub vendor: ::__u16,
+        pub product: ::__u16,
+        pub version: ::__u16,
+    }
+
+    pub struct input_absinfo {
+        pub value: ::__s32,
+        pub minimum: ::__s32,
+        pub maximum: ::__s32,
+        pub fuzz: ::__s32,
+        pub flat: ::__s32,
+        pub resolution: ::__s32,
+    }
+
+    pub struct input_keymap_entry {
+        pub flags: ::__u8,
+        pub len: ::__u8,
+        pub index: ::__u16,
+        pub keycode: ::__u32,
+        pub scancode: [::__u8; 32],
+    }
+
+    pub struct input_mask {
+        pub type_: ::__u32,
+        pub codes_size: ::__u32,
+        pub codes_ptr: ::__u64,
+    }
+
+    pub struct ff_replay {
+        pub length: ::__u16,
+        pub delay: ::__u16,
+    }
+
+    pub struct ff_trigger {
+        pub button: ::__u16,
+        pub interval: ::__u16,
+    }
+
+    pub struct ff_envelope {
+        pub attack_length: ::__u16,
+        pub attack_level: ::__u16,
+        pub fade_length: ::__u16,
+        pub fade_level: ::__u16,
+    }
+
+    pub struct ff_constant_effect {
+        pub level: ::__s16,
+        pub envelope: ff_envelope,
+    }
+
+    pub struct ff_ramp_effect {
+        pub start_level: ::__s16,
+        pub end_level: ::__s16,
+        pub envelope: ff_envelope,
+    }
+
+    pub struct ff_condition_effect {
+        pub right_saturation: ::__u16,
+        pub left_saturation: ::__u16,
+
+        pub right_coeff: ::__s16,
+        pub left_coeff: ::__s16,
+
+        pub deadband: ::__u16,
+        pub center: ::__s16,
+    }
+
+    pub struct ff_periodic_effect {
+        pub waveform: ::__u16,
+        pub period: ::__u16,
+        pub magnitude: ::__s16,
+        pub offset: ::__s16,
+        pub phase: ::__u16,
+
+        pub envelope: ff_envelope,
+
+        pub custom_len: ::__u32,
+        pub custom_data: *mut ::__s16,
+    }
+
+    pub struct ff_rumble_effect {
+        pub strong_magnitude: ::__u16,
+        pub weak_magnitude: ::__u16,
+    }
+
+    pub struct ff_effect {
+        pub type_: ::__u16,
+        pub id: ::__s16,
+        pub direction: ::__u16,
+        pub trigger: ff_trigger,
+        pub replay: ff_replay,
+        // FIXME this is actually a union
+        #[cfg(target_pointer_width = "64")]
+        pub u: [u64; 4],
+        #[cfg(target_pointer_width = "32")]
+        pub u: [u32; 7],
+    }
+
+    // linux/uinput.h
+    pub struct uinput_ff_upload {
+        pub request_id: ::__u32,
+        pub retval: ::__s32,
+        pub effect: ff_effect,
+        pub old: ff_effect,
+    }
+
+    pub struct uinput_ff_erase {
+        pub request_id: ::__u32,
+        pub retval: ::__s32,
+        pub effect_id: ::__u32,
+    }
+
+    pub struct uinput_abs_setup {
+        pub code: ::__u16,
+        pub absinfo: input_absinfo,
+    }
+
+    pub struct option {
+        pub name: *const ::c_char,
+        pub has_arg: ::c_int,
+        pub flag: *mut ::c_int,
+        pub val: ::c_int,
+    }
+
+    pub struct __c_anonymous_ifru_map {
+        pub mem_start: ::c_ulong,
+        pub mem_end: ::c_ulong,
+        pub base_addr: ::c_ushort,
+        pub irq: ::c_uchar,
+        pub dma: ::c_uchar,
+        pub port: ::c_uchar,
+    }
+
+    pub struct in6_ifreq {
+       pub ifr6_addr: ::in6_addr,
+       pub ifr6_prefixlen: u32,
+       pub ifr6_ifindex: ::c_int,
+   }
+
+}
+
+s_no_extra_traits! {
+    pub struct sockaddr_nl {
+        pub nl_family: ::sa_family_t,
+        nl_pad: ::c_ushort,
+        pub nl_pid: u32,
+        pub nl_groups: u32
+    }
+
+    pub struct dirent {
+        pub d_ino: u64,
+        pub d_off: i64,
+        pub d_reclen: ::c_ushort,
+        pub d_type: ::c_uchar,
+        pub d_name: [::c_char; 256],
+    }
+
+    pub struct dirent64 {
+        pub d_ino: u64,
+        pub d_off: i64,
+        pub d_reclen: ::c_ushort,
+        pub d_type: ::c_uchar,
+        pub d_name: [::c_char; 256],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        pub _pad: [::c_int; 29],
+        _align: [usize; 0],
+    }
+
+    pub struct lastlog {
+        ll_time: ::time_t,
+        ll_line: [::c_char; UT_LINESIZE],
+        ll_host: [::c_char; UT_HOSTSIZE],
+    }
+
+    pub struct utmp {
+        pub ut_type: ::c_short,
+        pub ut_pid: ::pid_t,
+        pub ut_line: [::c_char; UT_LINESIZE],
+        pub ut_id: [::c_char; 4],
+        pub ut_user: [::c_char; UT_NAMESIZE],
+        pub ut_host: [::c_char; UT_HOSTSIZE],
+        pub ut_exit: exit_status,
+        pub ut_session: ::c_long,
+        pub ut_tv: ::timeval,
+        pub ut_addr_v6: [i32; 4],
+        unused: [::c_char; 20],
+    }
+
+    pub struct sockaddr_alg {
+        pub salg_family: ::sa_family_t,
+        pub salg_type: [::c_uchar; 14],
+        pub salg_feat: u32,
+        pub salg_mask: u32,
+        pub salg_name: [::c_uchar; 64],
+    }
+
+    pub struct uinput_setup {
+        pub id: input_id,
+        pub name: [::c_char; UINPUT_MAX_NAME_SIZE],
+        pub ff_effects_max: ::__u32,
+    }
+
+    pub struct uinput_user_dev {
+        pub name: [::c_char; UINPUT_MAX_NAME_SIZE],
+        pub id: input_id,
+        pub ff_effects_max: ::__u32,
+        pub absmax: [::__s32; ABS_CNT],
+        pub absmin: [::__s32; ABS_CNT],
+        pub absfuzz: [::__s32; ABS_CNT],
+        pub absflat: [::__s32; ABS_CNT],
+    }
+
+    /// WARNING: The `PartialEq`, `Eq` and `Hash` implementations of this
+    /// type are unsound and will be removed in the future.
+    #[deprecated(
+        note = "this struct has unsafe trait implementations that will be \
+                removed in the future",
+        since = "0.2.80"
+    )]
+    pub struct af_alg_iv {
+        pub ivlen: u32,
+        pub iv: [::c_uchar; 0],
+    }
+
+    pub struct prop_info {
+        __name: [::c_char; 32],
+        __serial: ::c_uint,
+        __value: [[::c_char; 4]; 23],
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifr_ifru {
+        pub ifru_addr: ::sockaddr,
+        pub ifru_dstaddr: ::sockaddr,
+        pub ifru_broadaddr: ::sockaddr,
+        pub ifru_netmask: ::sockaddr,
+        pub ifru_hwaddr: ::sockaddr,
+        pub ifru_flags: ::c_short,
+        pub ifru_ifindex: ::c_int,
+        pub ifru_metric: ::c_int,
+        pub ifru_mtu: ::c_int,
+        pub ifru_map: __c_anonymous_ifru_map,
+        pub ifru_slave: [::c_char; ::IFNAMSIZ],
+        pub ifru_newname: [::c_char; ::IFNAMSIZ],
+        pub ifru_data: *mut ::c_char,
+    }
+
+    pub struct ifreq {
+        /// interface name, e.g. "en0"
+        pub ifr_name: [::c_char; ::IFNAMSIZ],
+        #[cfg(libc_union)]
+        pub ifr_ifru: __c_anonymous_ifr_ifru,
+        #[cfg(not(libc_union))]
+        pub ifr_ifru: ::sockaddr,
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifc_ifcu {
+        pub ifcu_buf: *mut ::c_char,
+        pub ifcu_req: *mut ::ifreq,
+    }
+
+    /*  Structure used in SIOCGIFCONF request.  Used to retrieve interface
+    configuration for machine (useful for programs which must know all
+    networks accessible).  */
+    pub struct ifconf {
+        pub ifc_len: ::c_int,       /* Size of buffer.  */
+        #[cfg(libc_union)]
+        pub ifc_ifcu: __c_anonymous_ifc_ifcu,
+        #[cfg(not(libc_union))]
+        pub ifc_ifcu: *mut ::ifreq,
+    }
+
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for sockaddr_nl {
+            fn eq(&self, other: &sockaddr_nl) -> bool {
+                self.nl_family == other.nl_family &&
+                    self.nl_pid == other.nl_pid &&
+                    self.nl_groups == other.nl_groups
+            }
+        }
+        impl Eq for sockaddr_nl {}
+        impl ::fmt::Debug for sockaddr_nl {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_nl")
+                    .field("nl_family", &self.nl_family)
+                    .field("nl_pid", &self.nl_pid)
+                    .field("nl_groups", &self.nl_groups)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sockaddr_nl {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.nl_family.hash(state);
+                self.nl_pid.hash(state);
+                self.nl_groups.hash(state);
+            }
+        }
+
+        impl PartialEq for dirent {
+            fn eq(&self, other: &dirent) -> bool {
+                self.d_ino == other.d_ino
+                    && self.d_off == other.d_off
+                    && self.d_reclen == other.d_reclen
+                    && self.d_type == other.d_type
+                    && self
+                    .d_name
+                    .iter()
+                    .zip(other.d_name.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for dirent {}
+
+        impl ::fmt::Debug for dirent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("dirent")
+                    .field("d_ino", &self.d_ino)
+                    .field("d_off", &self.d_off)
+                    .field("d_reclen", &self.d_reclen)
+                    .field("d_type", &self.d_type)
+                // FIXME: .field("d_name", &self.d_name)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for dirent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.d_ino.hash(state);
+                self.d_off.hash(state);
+                self.d_reclen.hash(state);
+                self.d_type.hash(state);
+                self.d_name.hash(state);
+            }
+        }
+
+        impl PartialEq for dirent64 {
+            fn eq(&self, other: &dirent64) -> bool {
+                self.d_ino == other.d_ino
+                    && self.d_off == other.d_off
+                    && self.d_reclen == other.d_reclen
+                    && self.d_type == other.d_type
+                    && self
+                    .d_name
+                    .iter()
+                    .zip(other.d_name.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for dirent64 {}
+
+        impl ::fmt::Debug for dirent64 {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("dirent64")
+                    .field("d_ino", &self.d_ino)
+                    .field("d_off", &self.d_off)
+                    .field("d_reclen", &self.d_reclen)
+                    .field("d_type", &self.d_type)
+                // FIXME: .field("d_name", &self.d_name)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for dirent64 {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.d_ino.hash(state);
+                self.d_off.hash(state);
+                self.d_reclen.hash(state);
+                self.d_type.hash(state);
+                self.d_name.hash(state);
+            }
+        }
+
+        impl PartialEq for siginfo_t {
+            fn eq(&self, other: &siginfo_t) -> bool {
+                self.si_signo == other.si_signo
+                    && self.si_errno == other.si_errno
+                    && self.si_code == other.si_code
+                // Ignore _pad
+                // Ignore _align
+            }
+        }
+
+        impl Eq for siginfo_t {}
+
+        impl ::fmt::Debug for siginfo_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("siginfo_t")
+                    .field("si_signo", &self.si_signo)
+                    .field("si_errno", &self.si_errno)
+                    .field("si_code", &self.si_code)
+                // Ignore _pad
+                // Ignore _align
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for siginfo_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.si_signo.hash(state);
+                self.si_errno.hash(state);
+                self.si_code.hash(state);
+                // Ignore _pad
+                // Ignore _align
+            }
+        }
+
+        impl PartialEq for lastlog {
+            fn eq(&self, other: &lastlog) -> bool {
+                self.ll_time == other.ll_time
+                    && self
+                    .ll_line
+                    .iter()
+                    .zip(other.ll_line.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .ll_host
+                    .iter()
+                    .zip(other.ll_host.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for lastlog {}
+
+        impl ::fmt::Debug for lastlog {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("lastlog")
+                    .field("ll_time", &self.ll_time)
+                    .field("ll_line", &self.ll_line)
+                // FIXME: .field("ll_host", &self.ll_host)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for lastlog {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ll_time.hash(state);
+                self.ll_line.hash(state);
+                self.ll_host.hash(state);
+            }
+        }
+
+        impl PartialEq for utmp {
+            fn eq(&self, other: &utmp) -> bool {
+                self.ut_type == other.ut_type
+                    && self.ut_pid == other.ut_pid
+                    && self
+                    .ut_line
+                    .iter()
+                    .zip(other.ut_line.iter())
+                    .all(|(a,b)| a == b)
+                    && self.ut_id == other.ut_id
+                    && self
+                    .ut_user
+                    .iter()
+                    .zip(other.ut_user.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .ut_host
+                    .iter()
+                    .zip(other.ut_host.iter())
+                    .all(|(a,b)| a == b)
+                    && self.ut_exit == other.ut_exit
+                    && self.ut_session == other.ut_session
+                    && self.ut_tv == other.ut_tv
+                    && self.ut_addr_v6 == other.ut_addr_v6
+                    && self.unused == other.unused
+            }
+        }
+
+        impl Eq for utmp {}
+
+        impl ::fmt::Debug for utmp {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("utmp")
+                    .field("ut_type", &self.ut_type)
+                    .field("ut_pid", &self.ut_pid)
+                    .field("ut_line", &self.ut_line)
+                    .field("ut_id", &self.ut_id)
+                    .field("ut_user", &self.ut_user)
+                // FIXME: .field("ut_host", &self.ut_host)
+                    .field("ut_exit", &self.ut_exit)
+                    .field("ut_session", &self.ut_session)
+                    .field("ut_tv", &self.ut_tv)
+                    .field("ut_addr_v6", &self.ut_addr_v6)
+                    .field("unused", &self.unused)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for utmp {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ut_type.hash(state);
+                self.ut_pid.hash(state);
+                self.ut_line.hash(state);
+                self.ut_id.hash(state);
+                self.ut_user.hash(state);
+                self.ut_host.hash(state);
+                self.ut_exit.hash(state);
+                self.ut_session.hash(state);
+                self.ut_tv.hash(state);
+                self.ut_addr_v6.hash(state);
+                self.unused.hash(state);
+            }
+        }
+
+        impl PartialEq for sockaddr_alg {
+            fn eq(&self, other: &sockaddr_alg) -> bool {
+                self.salg_family == other.salg_family
+                    && self
+                    .salg_type
+                    .iter()
+                    .zip(other.salg_type.iter())
+                    .all(|(a, b)| a == b)
+                    && self.salg_feat == other.salg_feat
+                    && self.salg_mask == other.salg_mask
+                    && self
+                    .salg_name
+                    .iter()
+                    .zip(other.salg_name.iter())
+                    .all(|(a, b)| a == b)
+           }
+        }
+
+        impl Eq for sockaddr_alg {}
+
+        impl ::fmt::Debug for sockaddr_alg {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_alg")
+                    .field("salg_family", &self.salg_family)
+                    .field("salg_type", &self.salg_type)
+                    .field("salg_feat", &self.salg_feat)
+                    .field("salg_mask", &self.salg_mask)
+                    .field("salg_name", &&self.salg_name[..])
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for sockaddr_alg {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.salg_family.hash(state);
+                self.salg_type.hash(state);
+                self.salg_feat.hash(state);
+                self.salg_mask.hash(state);
+                self.salg_name.hash(state);
+            }
+        }
+
+        impl PartialEq for uinput_setup {
+            fn eq(&self, other: &uinput_setup) -> bool {
+                self.id == other.id
+                    && self.name[..] == other.name[..]
+                    && self.ff_effects_max == other.ff_effects_max
+           }
+        }
+        impl Eq for uinput_setup {}
+
+        impl ::fmt::Debug for uinput_setup {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("uinput_setup")
+                    .field("id", &self.id)
+                    .field("name", &&self.name[..])
+                    .field("ff_effects_max", &self.ff_effects_max)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for uinput_setup {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.id.hash(state);
+                self.name.hash(state);
+                self.ff_effects_max.hash(state);
+            }
+        }
+
+        impl PartialEq for uinput_user_dev {
+            fn eq(&self, other: &uinput_user_dev) -> bool {
+                 self.name[..] == other.name[..]
+                    && self.id == other.id
+                    && self.ff_effects_max == other.ff_effects_max
+                    && self.absmax[..] == other.absmax[..]
+                    && self.absmin[..] == other.absmin[..]
+                    && self.absfuzz[..] == other.absfuzz[..]
+                    && self.absflat[..] == other.absflat[..]
+           }
+        }
+        impl Eq for uinput_user_dev {}
+
+        impl ::fmt::Debug for uinput_user_dev {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("uinput_setup")
+                    .field("name", &&self.name[..])
+                    .field("id", &self.id)
+                    .field("ff_effects_max", &self.ff_effects_max)
+                    .field("absmax", &&self.absmax[..])
+                    .field("absmin", &&self.absmin[..])
+                    .field("absfuzz", &&self.absfuzz[..])
+                    .field("absflat", &&self.absflat[..])
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for uinput_user_dev {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.name.hash(state);
+                self.id.hash(state);
+                self.ff_effects_max.hash(state);
+                self.absmax.hash(state);
+                self.absmin.hash(state);
+                self.absfuzz.hash(state);
+                self.absflat.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifr_ifru {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifr_ifru")
+                    .field("ifru_addr", unsafe { &self.ifru_addr })
+                    .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr })
+                    .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr })
+                    .field("ifru_netmask", unsafe { &self.ifru_netmask })
+                    .field("ifru_hwaddr", unsafe { &self.ifru_hwaddr })
+                    .field("ifru_flags", unsafe { &self.ifru_flags })
+                    .field("ifru_ifindex", unsafe { &self.ifru_ifindex })
+                    .field("ifru_metric", unsafe { &self.ifru_metric })
+                    .field("ifru_mtu", unsafe { &self.ifru_mtu })
+                    .field("ifru_map", unsafe { &self.ifru_map })
+                    .field("ifru_slave", unsafe { &self.ifru_slave })
+                    .field("ifru_newname", unsafe { &self.ifru_newname })
+                    .field("ifru_data", unsafe { &self.ifru_data })
+                    .finish()
+            }
+        }
+        impl ::fmt::Debug for ifreq {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifreq")
+                    .field("ifr_name", &self.ifr_name)
+                    .field("ifr_ifru", &self.ifr_ifru)
+                    .finish()
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifc_ifcu {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifr_ifru")
+                    .field("ifcu_buf", unsafe { &self.ifcu_buf })
+                    .field("ifcu_req", unsafe { &self.ifcu_req })
+                    .finish()
+            }
+        }
+        impl ::fmt::Debug for ifconf {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifconf")
+                    .field("ifc_len", &self.ifc_len)
+                    .field("ifc_ifcu", &self.ifc_ifcu)
+                    .finish()
+            }
+        }
+
+        #[allow(deprecated)]
+        impl af_alg_iv {
+            fn as_slice(&self) -> &[u8] {
+                unsafe {
+                    ::core::slice::from_raw_parts(
+                        self.iv.as_ptr(),
+                        self.ivlen as usize
+                    )
+                }
+            }
+        }
+
+        #[allow(deprecated)]
+        impl PartialEq for af_alg_iv {
+            fn eq(&self, other: &af_alg_iv) -> bool {
+                *self.as_slice() == *other.as_slice()
+           }
+        }
+
+        #[allow(deprecated)]
+        impl Eq for af_alg_iv {}
+
+        #[allow(deprecated)]
+        impl ::fmt::Debug for af_alg_iv {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("af_alg_iv")
+                    .field("ivlen", &self.ivlen)
+                    .finish()
+            }
+        }
+
+        #[allow(deprecated)]
+        impl ::hash::Hash for af_alg_iv {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.as_slice().hash(state);
+            }
+        }
+
+        impl PartialEq for prop_info {
+            fn eq(&self, other: &prop_info) -> bool {
+                self.__name == other.__name &&
+                    self.__serial == other.__serial &&
+                    self.__value == other.__value
+            }
+        }
+        impl Eq for prop_info {}
+        impl ::fmt::Debug for prop_info {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("prop_info")
+                    .field("__name", &self.__name)
+                    .field("__serial", &self.__serial)
+                    .field("__value", &self.__value)
+                    .finish()
+            }
+        }
+    }
+}
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MS_NOUSER: ::c_ulong = 0xffffffff80000000;
+pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
+
+pub const O_TRUNC: ::c_int = 512;
+pub const O_CLOEXEC: ::c_int = 0x80000;
+pub const O_PATH: ::c_int = 0o10000000;
+pub const O_NOATIME: ::c_int = 0o1000000;
+
+pub const EBFONT: ::c_int = 59;
+pub const ENOSTR: ::c_int = 60;
+pub const ENODATA: ::c_int = 61;
+pub const ETIME: ::c_int = 62;
+pub const ENOSR: ::c_int = 63;
+pub const ENONET: ::c_int = 64;
+pub const ENOPKG: ::c_int = 65;
+pub const EREMOTE: ::c_int = 66;
+pub const ENOLINK: ::c_int = 67;
+pub const EADV: ::c_int = 68;
+pub const ESRMNT: ::c_int = 69;
+pub const ECOMM: ::c_int = 70;
+pub const EPROTO: ::c_int = 71;
+pub const EDOTDOT: ::c_int = 73;
+
+pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
+
+// sys/eventfd.h
+pub const EFD_SEMAPHORE: ::c_int = 0x1;
+pub const EFD_CLOEXEC: ::c_int = O_CLOEXEC;
+pub const EFD_NONBLOCK: ::c_int = O_NONBLOCK;
+
+// sys/timerfd.h
+pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC;
+pub const TFD_NONBLOCK: ::c_int = O_NONBLOCK;
+pub const TFD_TIMER_ABSTIME: ::c_int = 1;
+pub const TFD_TIMER_CANCEL_ON_SET: ::c_int = 2;
+
+pub const USER_PROCESS: ::c_short = 7;
+
+pub const _POSIX_VDISABLE: ::cc_t = 0;
+
+// linux/falloc.h
+pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01;
+pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02;
+pub const FALLOC_FL_NO_HIDE_STALE: ::c_int = 0x04;
+pub const FALLOC_FL_COLLAPSE_RANGE: ::c_int = 0x08;
+pub const FALLOC_FL_ZERO_RANGE: ::c_int = 0x10;
+pub const FALLOC_FL_INSERT_RANGE: ::c_int = 0x20;
+pub const FALLOC_FL_UNSHARE_RANGE: ::c_int = 0x40;
+
+pub const BUFSIZ: ::c_uint = 1024;
+pub const FILENAME_MAX: ::c_uint = 4096;
+pub const FOPEN_MAX: ::c_uint = 20;
+pub const POSIX_FADV_DONTNEED: ::c_int = 4;
+pub const POSIX_FADV_NOREUSE: ::c_int = 5;
+pub const L_tmpnam: ::c_uint = 4096;
+pub const TMP_MAX: ::c_uint = 308915776;
+pub const _PC_LINK_MAX: ::c_int = 1;
+pub const _PC_MAX_CANON: ::c_int = 2;
+pub const _PC_MAX_INPUT: ::c_int = 3;
+pub const _PC_NAME_MAX: ::c_int = 4;
+pub const _PC_PATH_MAX: ::c_int = 5;
+pub const _PC_PIPE_BUF: ::c_int = 6;
+pub const _PC_2_SYMLINKS: ::c_int = 7;
+pub const _PC_ALLOC_SIZE_MIN: ::c_int = 8;
+pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 9;
+pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 10;
+pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 11;
+pub const _PC_REC_XFER_ALIGN: ::c_int = 12;
+pub const _PC_SYMLINK_MAX: ::c_int = 13;
+pub const _PC_CHOWN_RESTRICTED: ::c_int = 14;
+pub const _PC_NO_TRUNC: ::c_int = 15;
+pub const _PC_VDISABLE: ::c_int = 16;
+pub const _PC_ASYNC_IO: ::c_int = 17;
+pub const _PC_PRIO_IO: ::c_int = 18;
+pub const _PC_SYNC_IO: ::c_int = 19;
+
+pub const FIONBIO: ::c_int = 0x5421;
+
+pub const _SC_ARG_MAX: ::c_int = 0x0000;
+pub const _SC_BC_BASE_MAX: ::c_int = 0x0001;
+pub const _SC_BC_DIM_MAX: ::c_int = 0x0002;
+pub const _SC_BC_SCALE_MAX: ::c_int = 0x0003;
+pub const _SC_BC_STRING_MAX: ::c_int = 0x0004;
+pub const _SC_CHILD_MAX: ::c_int = 0x0005;
+pub const _SC_CLK_TCK: ::c_int = 0x0006;
+pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 0x0007;
+pub const _SC_EXPR_NEST_MAX: ::c_int = 0x0008;
+pub const _SC_LINE_MAX: ::c_int = 0x0009;
+pub const _SC_NGROUPS_MAX: ::c_int = 0x000a;
+pub const _SC_OPEN_MAX: ::c_int = 0x000b;
+pub const _SC_PASS_MAX: ::c_int = 0x000c;
+pub const _SC_2_C_BIND: ::c_int = 0x000d;
+pub const _SC_2_C_DEV: ::c_int = 0x000e;
+pub const _SC_2_C_VERSION: ::c_int = 0x000f;
+pub const _SC_2_CHAR_TERM: ::c_int = 0x0010;
+pub const _SC_2_FORT_DEV: ::c_int = 0x0011;
+pub const _SC_2_FORT_RUN: ::c_int = 0x0012;
+pub const _SC_2_LOCALEDEF: ::c_int = 0x0013;
+pub const _SC_2_SW_DEV: ::c_int = 0x0014;
+pub const _SC_2_UPE: ::c_int = 0x0015;
+pub const _SC_2_VERSION: ::c_int = 0x0016;
+pub const _SC_JOB_CONTROL: ::c_int = 0x0017;
+pub const _SC_SAVED_IDS: ::c_int = 0x0018;
+pub const _SC_VERSION: ::c_int = 0x0019;
+pub const _SC_RE_DUP_MAX: ::c_int = 0x001a;
+pub const _SC_STREAM_MAX: ::c_int = 0x001b;
+pub const _SC_TZNAME_MAX: ::c_int = 0x001c;
+pub const _SC_XOPEN_CRYPT: ::c_int = 0x001d;
+pub const _SC_XOPEN_ENH_I18N: ::c_int = 0x001e;
+pub const _SC_XOPEN_SHM: ::c_int = 0x001f;
+pub const _SC_XOPEN_VERSION: ::c_int = 0x0020;
+pub const _SC_XOPEN_XCU_VERSION: ::c_int = 0x0021;
+pub const _SC_XOPEN_REALTIME: ::c_int = 0x0022;
+pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 0x0023;
+pub const _SC_XOPEN_LEGACY: ::c_int = 0x0024;
+pub const _SC_ATEXIT_MAX: ::c_int = 0x0025;
+pub const _SC_IOV_MAX: ::c_int = 0x0026;
+pub const _SC_UIO_MAXIOV: ::c_int = _SC_IOV_MAX;
+pub const _SC_PAGESIZE: ::c_int = 0x0027;
+pub const _SC_PAGE_SIZE: ::c_int = 0x0028;
+pub const _SC_XOPEN_UNIX: ::c_int = 0x0029;
+pub const _SC_XBS5_ILP32_OFF32: ::c_int = 0x002a;
+pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 0x002b;
+pub const _SC_XBS5_LP64_OFF64: ::c_int = 0x002c;
+pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 0x002d;
+pub const _SC_AIO_LISTIO_MAX: ::c_int = 0x002e;
+pub const _SC_AIO_MAX: ::c_int = 0x002f;
+pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 0x0030;
+pub const _SC_DELAYTIMER_MAX: ::c_int = 0x0031;
+pub const _SC_MQ_OPEN_MAX: ::c_int = 0x0032;
+pub const _SC_MQ_PRIO_MAX: ::c_int = 0x0033;
+pub const _SC_RTSIG_MAX: ::c_int = 0x0034;
+pub const _SC_SEM_NSEMS_MAX: ::c_int = 0x0035;
+pub const _SC_SEM_VALUE_MAX: ::c_int = 0x0036;
+pub const _SC_SIGQUEUE_MAX: ::c_int = 0x0037;
+pub const _SC_TIMER_MAX: ::c_int = 0x0038;
+pub const _SC_ASYNCHRONOUS_IO: ::c_int = 0x0039;
+pub const _SC_FSYNC: ::c_int = 0x003a;
+pub const _SC_MAPPED_FILES: ::c_int = 0x003b;
+pub const _SC_MEMLOCK: ::c_int = 0x003c;
+pub const _SC_MEMLOCK_RANGE: ::c_int = 0x003d;
+pub const _SC_MEMORY_PROTECTION: ::c_int = 0x003e;
+pub const _SC_MESSAGE_PASSING: ::c_int = 0x003f;
+pub const _SC_PRIORITIZED_IO: ::c_int = 0x0040;
+pub const _SC_PRIORITY_SCHEDULING: ::c_int = 0x0041;
+pub const _SC_REALTIME_SIGNALS: ::c_int = 0x0042;
+pub const _SC_SEMAPHORES: ::c_int = 0x0043;
+pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 0x0044;
+pub const _SC_SYNCHRONIZED_IO: ::c_int = 0x0045;
+pub const _SC_TIMERS: ::c_int = 0x0046;
+pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 0x0047;
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 0x0048;
+pub const _SC_LOGIN_NAME_MAX: ::c_int = 0x0049;
+pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 0x004a;
+pub const _SC_THREAD_KEYS_MAX: ::c_int = 0x004b;
+pub const _SC_THREAD_STACK_MIN: ::c_int = 0x004c;
+pub const _SC_THREAD_THREADS_MAX: ::c_int = 0x004d;
+pub const _SC_TTY_NAME_MAX: ::c_int = 0x004e;
+pub const _SC_THREADS: ::c_int = 0x004f;
+pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 0x0050;
+pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 0x0051;
+pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 0x0052;
+pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 0x0053;
+pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 0x0054;
+pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 0x0055;
+pub const _SC_NPROCESSORS_CONF: ::c_int = 0x0060;
+pub const _SC_NPROCESSORS_ONLN: ::c_int = 0x0061;
+pub const _SC_PHYS_PAGES: ::c_int = 0x0062;
+pub const _SC_AVPHYS_PAGES: ::c_int = 0x0063;
+pub const _SC_MONOTONIC_CLOCK: ::c_int = 0x0064;
+pub const _SC_2_PBS: ::c_int = 0x0065;
+pub const _SC_2_PBS_ACCOUNTING: ::c_int = 0x0066;
+pub const _SC_2_PBS_CHECKPOINT: ::c_int = 0x0067;
+pub const _SC_2_PBS_LOCATE: ::c_int = 0x0068;
+pub const _SC_2_PBS_MESSAGE: ::c_int = 0x0069;
+pub const _SC_2_PBS_TRACK: ::c_int = 0x006a;
+pub const _SC_ADVISORY_INFO: ::c_int = 0x006b;
+pub const _SC_BARRIERS: ::c_int = 0x006c;
+pub const _SC_CLOCK_SELECTION: ::c_int = 0x006d;
+pub const _SC_CPUTIME: ::c_int = 0x006e;
+pub const _SC_HOST_NAME_MAX: ::c_int = 0x006f;
+pub const _SC_IPV6: ::c_int = 0x0070;
+pub const _SC_RAW_SOCKETS: ::c_int = 0x0071;
+pub const _SC_READER_WRITER_LOCKS: ::c_int = 0x0072;
+pub const _SC_REGEXP: ::c_int = 0x0073;
+pub const _SC_SHELL: ::c_int = 0x0074;
+pub const _SC_SPAWN: ::c_int = 0x0075;
+pub const _SC_SPIN_LOCKS: ::c_int = 0x0076;
+pub const _SC_SPORADIC_SERVER: ::c_int = 0x0077;
+pub const _SC_SS_REPL_MAX: ::c_int = 0x0078;
+pub const _SC_SYMLOOP_MAX: ::c_int = 0x0079;
+pub const _SC_THREAD_CPUTIME: ::c_int = 0x007a;
+pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 0x007b;
+pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 0x007c;
+pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 0x007d;
+pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 0x007e;
+pub const _SC_TIMEOUTS: ::c_int = 0x007f;
+pub const _SC_TRACE: ::c_int = 0x0080;
+pub const _SC_TRACE_EVENT_FILTER: ::c_int = 0x0081;
+pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 0x0082;
+pub const _SC_TRACE_INHERIT: ::c_int = 0x0083;
+pub const _SC_TRACE_LOG: ::c_int = 0x0084;
+pub const _SC_TRACE_NAME_MAX: ::c_int = 0x0085;
+pub const _SC_TRACE_SYS_MAX: ::c_int = 0x0086;
+pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 0x0087;
+pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 0x0088;
+pub const _SC_V7_ILP32_OFF32: ::c_int = 0x0089;
+pub const _SC_V7_ILP32_OFFBIG: ::c_int = 0x008a;
+pub const _SC_V7_LP64_OFF64: ::c_int = 0x008b;
+pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 0x008c;
+pub const _SC_XOPEN_STREAMS: ::c_int = 0x008d;
+pub const _SC_XOPEN_UUCP: ::c_int = 0x008e;
+pub const _SC_LEVEL1_ICACHE_SIZE: ::c_int = 0x008f;
+pub const _SC_LEVEL1_ICACHE_ASSOC: ::c_int = 0x0090;
+pub const _SC_LEVEL1_ICACHE_LINESIZE: ::c_int = 0x0091;
+pub const _SC_LEVEL1_DCACHE_SIZE: ::c_int = 0x0092;
+pub const _SC_LEVEL1_DCACHE_ASSOC: ::c_int = 0x0093;
+pub const _SC_LEVEL1_DCACHE_LINESIZE: ::c_int = 0x0094;
+pub const _SC_LEVEL2_CACHE_SIZE: ::c_int = 0x0095;
+pub const _SC_LEVEL2_CACHE_ASSOC: ::c_int = 0x0096;
+pub const _SC_LEVEL2_CACHE_LINESIZE: ::c_int = 0x0097;
+pub const _SC_LEVEL3_CACHE_SIZE: ::c_int = 0x0098;
+pub const _SC_LEVEL3_CACHE_ASSOC: ::c_int = 0x0099;
+pub const _SC_LEVEL3_CACHE_LINESIZE: ::c_int = 0x009a;
+pub const _SC_LEVEL4_CACHE_SIZE: ::c_int = 0x009b;
+pub const _SC_LEVEL4_CACHE_ASSOC: ::c_int = 0x009c;
+pub const _SC_LEVEL4_CACHE_LINESIZE: ::c_int = 0x009d;
+
+pub const F_LOCK: ::c_int = 1;
+pub const F_TEST: ::c_int = 3;
+pub const F_TLOCK: ::c_int = 2;
+pub const F_ULOCK: ::c_int = 0;
+
+pub const F_SEAL_FUTURE_WRITE: ::c_int = 0x0010;
+
+pub const IFF_LOWER_UP: ::c_int = 0x10000;
+pub const IFF_DORMANT: ::c_int = 0x20000;
+pub const IFF_ECHO: ::c_int = 0x40000;
+
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
+pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
+pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
+
+pub const PTHREAD_EXPLICIT_SCHED: ::c_int = 0;
+pub const PTHREAD_INHERIT_SCHED: ::c_int = 1;
+
+// stdio.h
+pub const RENAME_NOREPLACE: ::c_int = 1;
+pub const RENAME_EXCHANGE: ::c_int = 2;
+pub const RENAME_WHITEOUT: ::c_int = 4;
+
+pub const FIOCLEX: ::c_int = 0x5451;
+pub const FIONCLEX: ::c_int = 0x5450;
+
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
+pub const SIGUNUSED: ::c_int = 31;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+
+pub const RUSAGE_CHILDREN: ::c_int = -1;
+
+pub const LC_PAPER: ::c_int = 7;
+pub const LC_NAME: ::c_int = 8;
+pub const LC_ADDRESS: ::c_int = 9;
+pub const LC_TELEPHONE: ::c_int = 10;
+pub const LC_MEASUREMENT: ::c_int = 11;
+pub const LC_IDENTIFICATION: ::c_int = 12;
+pub const LC_PAPER_MASK: ::c_int = 1 << LC_PAPER;
+pub const LC_NAME_MASK: ::c_int = 1 << LC_NAME;
+pub const LC_ADDRESS_MASK: ::c_int = 1 << LC_ADDRESS;
+pub const LC_TELEPHONE_MASK: ::c_int = 1 << LC_TELEPHONE;
+pub const LC_MEASUREMENT_MASK: ::c_int = 1 << LC_MEASUREMENT;
+pub const LC_IDENTIFICATION_MASK: ::c_int = 1 << LC_IDENTIFICATION;
+pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK
+    | ::LC_NUMERIC_MASK
+    | ::LC_TIME_MASK
+    | ::LC_COLLATE_MASK
+    | ::LC_MONETARY_MASK
+    | ::LC_MESSAGES_MASK
+    | LC_PAPER_MASK
+    | LC_NAME_MASK
+    | LC_ADDRESS_MASK
+    | LC_TELEPHONE_MASK
+    | LC_MEASUREMENT_MASK
+    | LC_IDENTIFICATION_MASK;
+
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_ANONYMOUS: ::c_int = 0x0020;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_LOCKED: ::c_int = 0x02000;
+pub const MAP_NORESERVE: ::c_int = 0x04000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+
+pub const EDEADLK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+
+pub const EMULTIHOP: ::c_int = 72;
+pub const EBADMSG: ::c_int = 74;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+pub const SOCK_SEQPACKET: ::c_int = 5;
+pub const SOCK_DCCP: ::c_int = 6;
+pub const SOCK_PACKET: ::c_int = 10;
+
+pub const IPPROTO_MAX: ::c_int = 256;
+
+pub const SOL_SOCKET: ::c_int = 1;
+pub const SOL_SCTP: ::c_int = 132;
+pub const SOL_IPX: ::c_int = 256;
+pub const SOL_AX25: ::c_int = 257;
+pub const SOL_ATALK: ::c_int = 258;
+pub const SOL_NETROM: ::c_int = 259;
+pub const SOL_ROSE: ::c_int = 260;
+
+/* DCCP socket options */
+pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1;
+pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2;
+pub const DCCP_SOCKOPT_CHANGE_L: ::c_int = 3;
+pub const DCCP_SOCKOPT_CHANGE_R: ::c_int = 4;
+pub const DCCP_SOCKOPT_GET_CUR_MPS: ::c_int = 5;
+pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: ::c_int = 6;
+pub const DCCP_SOCKOPT_SEND_CSCOV: ::c_int = 10;
+pub const DCCP_SOCKOPT_RECV_CSCOV: ::c_int = 11;
+pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: ::c_int = 12;
+pub const DCCP_SOCKOPT_CCID: ::c_int = 13;
+pub const DCCP_SOCKOPT_TX_CCID: ::c_int = 14;
+pub const DCCP_SOCKOPT_RX_CCID: ::c_int = 15;
+pub const DCCP_SOCKOPT_QPOLICY_ID: ::c_int = 16;
+pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: ::c_int = 17;
+pub const DCCP_SOCKOPT_CCID_RX_INFO: ::c_int = 128;
+pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192;
+
+/// maximum number of services provided on the same listening port
+pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32;
+
+pub const SO_REUSEADDR: ::c_int = 2;
+pub const SO_TYPE: ::c_int = 3;
+pub const SO_ERROR: ::c_int = 4;
+pub const SO_DONTROUTE: ::c_int = 5;
+pub const SO_BROADCAST: ::c_int = 6;
+pub const SO_SNDBUF: ::c_int = 7;
+pub const SO_RCVBUF: ::c_int = 8;
+pub const SO_KEEPALIVE: ::c_int = 9;
+pub const SO_OOBINLINE: ::c_int = 10;
+pub const SO_PRIORITY: ::c_int = 12;
+pub const SO_LINGER: ::c_int = 13;
+pub const SO_BSDCOMPAT: ::c_int = 14;
+pub const SO_REUSEPORT: ::c_int = 15;
+pub const SO_PASSCRED: ::c_int = 16;
+pub const SO_PEERCRED: ::c_int = 17;
+pub const SO_RCVLOWAT: ::c_int = 18;
+pub const SO_SNDLOWAT: ::c_int = 19;
+pub const SO_RCVTIMEO: ::c_int = 20;
+pub const SO_SNDTIMEO: ::c_int = 21;
+pub const SO_BINDTODEVICE: ::c_int = 25;
+pub const SO_ATTACH_FILTER: ::c_int = 26;
+pub const SO_DETACH_FILTER: ::c_int = 27;
+pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
+pub const SO_TIMESTAMP: ::c_int = 29;
+pub const SO_ACCEPTCONN: ::c_int = 30;
+pub const SO_PEERSEC: ::c_int = 31;
+pub const SO_SNDBUFFORCE: ::c_int = 32;
+pub const SO_RCVBUFFORCE: ::c_int = 33;
+pub const SO_PASSSEC: ::c_int = 34;
+pub const SO_TIMESTAMPNS: ::c_int = 35;
+// pub const SO_TIMESTAMPNS_OLD: ::c_int = 35;
+pub const SO_MARK: ::c_int = 36;
+pub const SO_TIMESTAMPING: ::c_int = 37;
+// pub const SO_TIMESTAMPING_OLD: ::c_int = 37;
+pub const SO_PROTOCOL: ::c_int = 38;
+pub const SO_DOMAIN: ::c_int = 39;
+pub const SO_RXQ_OVFL: ::c_int = 40;
+pub const SO_PEEK_OFF: ::c_int = 42;
+pub const SO_BUSY_POLL: ::c_int = 46;
+pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 54;
+pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 58;
+pub const SO_TIMESTAMP_NEW: ::c_int = 63;
+pub const SO_TIMESTAMPNS_NEW: ::c_int = 64;
+pub const SO_TIMESTAMPING_NEW: ::c_int = 65;
+
+// Defined in unix/linux_like/mod.rs
+// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
+pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
+pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
+
+pub const IPTOS_ECN_NOTECT: u8 = 0x00;
+
+pub const O_ACCMODE: ::c_int = 3;
+pub const O_APPEND: ::c_int = 1024;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 0x101000;
+pub const O_ASYNC: ::c_int = 0x2000;
+pub const O_NDELAY: ::c_int = 0x800;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_RSYNC: ::c_int = O_SYNC;
+
+pub const NI_MAXHOST: ::size_t = 1025;
+pub const NI_MAXSERV: ::size_t = 32;
+
+pub const NI_NOFQDN: ::c_int = 0x00000001;
+pub const NI_NUMERICHOST: ::c_int = 0x00000002;
+pub const NI_NAMEREQD: ::c_int = 0x00000004;
+pub const NI_NUMERICSERV: ::c_int = 0x00000008;
+pub const NI_DGRAM: ::c_int = 0x00000010;
+
+pub const NCCS: usize = 19;
+pub const TCSBRKP: ::c_int = 0x5425;
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 0x1;
+pub const TCSAFLUSH: ::c_int = 0x2;
+pub const VEOF: usize = 4;
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+pub const EXTPROC: ::tcflag_t = 0o200000;
+
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+
+pub const PTRACE_TRACEME: ::c_int = 0;
+pub const PTRACE_PEEKTEXT: ::c_int = 1;
+pub const PTRACE_PEEKDATA: ::c_int = 2;
+pub const PTRACE_PEEKUSER: ::c_int = 3;
+pub const PTRACE_POKETEXT: ::c_int = 4;
+pub const PTRACE_POKEDATA: ::c_int = 5;
+pub const PTRACE_POKEUSER: ::c_int = 6;
+pub const PTRACE_CONT: ::c_int = 7;
+pub const PTRACE_KILL: ::c_int = 8;
+pub const PTRACE_SINGLESTEP: ::c_int = 9;
+pub const PTRACE_GETREGS: ::c_int = 12;
+pub const PTRACE_SETREGS: ::c_int = 13;
+pub const PTRACE_ATTACH: ::c_int = 16;
+pub const PTRACE_DETACH: ::c_int = 17;
+pub const PTRACE_SYSCALL: ::c_int = 24;
+pub const PTRACE_SETOPTIONS: ::c_int = 0x4200;
+pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201;
+pub const PTRACE_GETSIGINFO: ::c_int = 0x4202;
+pub const PTRACE_SETSIGINFO: ::c_int = 0x4203;
+pub const PTRACE_GETREGSET: ::c_int = 0x4204;
+pub const PTRACE_SETREGSET: ::c_int = 0x4205;
+pub const PTRACE_SECCOMP_GET_METADATA: ::c_int = 0x420d;
+
+pub const PTRACE_EVENT_STOP: ::c_int = 128;
+
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETOWN: ::c_int = 8;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+pub const F_RDLCK: ::c_int = 0;
+pub const F_WRLCK: ::c_int = 1;
+pub const F_UNLCK: ::c_int = 2;
+pub const F_OFD_GETLK: ::c_int = 36;
+pub const F_OFD_SETLK: ::c_int = 37;
+pub const F_OFD_SETLKW: ::c_int = 38;
+
+pub const RLIMIT_CPU: ::c_int = 0;
+pub const RLIMIT_FSIZE: ::c_int = 1;
+pub const RLIMIT_DATA: ::c_int = 2;
+pub const RLIMIT_STACK: ::c_int = 3;
+pub const RLIMIT_CORE: ::c_int = 4;
+pub const RLIMIT_RSS: ::c_int = 5;
+pub const RLIMIT_NPROC: ::c_int = 6;
+pub const RLIMIT_NOFILE: ::c_int = 7;
+pub const RLIMIT_MEMLOCK: ::c_int = 8;
+pub const RLIMIT_AS: ::c_int = 9;
+pub const RLIMIT_LOCKS: ::c_int = 10;
+pub const RLIMIT_SIGPENDING: ::c_int = 11;
+pub const RLIMIT_MSGQUEUE: ::c_int = 12;
+pub const RLIMIT_NICE: ::c_int = 13;
+pub const RLIMIT_RTPRIO: ::c_int = 14;
+
+#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+pub const RLIM_NLIMITS: ::c_int = 16;
+pub const RLIM_INFINITY: ::rlim_t = !0;
+
+pub const TCGETS: ::c_int = 0x5401;
+pub const TCSETS: ::c_int = 0x5402;
+pub const TCSETSW: ::c_int = 0x5403;
+pub const TCSETSF: ::c_int = 0x5404;
+pub const TCGETS2: ::c_int = 0x802c542a;
+pub const TCSETS2: ::c_int = 0x402c542b;
+pub const TCSETSW2: ::c_int = 0x402c542c;
+pub const TCSETSF2: ::c_int = 0x402c542d;
+pub const TCGETA: ::c_int = 0x5405;
+pub const TCSETA: ::c_int = 0x5406;
+pub const TCSETAW: ::c_int = 0x5407;
+pub const TCSETAF: ::c_int = 0x5408;
+pub const TCSBRK: ::c_int = 0x5409;
+pub const TCXONC: ::c_int = 0x540A;
+pub const TCFLSH: ::c_int = 0x540B;
+pub const TIOCGSOFTCAR: ::c_int = 0x5419;
+pub const TIOCSSOFTCAR: ::c_int = 0x541A;
+pub const TIOCINQ: ::c_int = 0x541B;
+pub const TIOCLINUX: ::c_int = 0x541C;
+pub const TIOCGSERIAL: ::c_int = 0x541E;
+pub const TIOCEXCL: ::c_int = 0x540C;
+pub const TIOCNXCL: ::c_int = 0x540D;
+pub const TIOCSCTTY: ::c_int = 0x540E;
+pub const TIOCGPGRP: ::c_int = 0x540F;
+pub const TIOCSPGRP: ::c_int = 0x5410;
+pub const TIOCOUTQ: ::c_int = 0x5411;
+pub const TIOCSTI: ::c_int = 0x5412;
+pub const TIOCGWINSZ: ::c_int = 0x5413;
+pub const TIOCSWINSZ: ::c_int = 0x5414;
+pub const TIOCMGET: ::c_int = 0x5415;
+pub const TIOCMBIS: ::c_int = 0x5416;
+pub const TIOCMBIC: ::c_int = 0x5417;
+pub const TIOCMSET: ::c_int = 0x5418;
+pub const FIONREAD: ::c_int = 0x541B;
+pub const TIOCCONS: ::c_int = 0x541D;
+pub const TIOCSBRK: ::c_int = 0x5427;
+pub const TIOCCBRK: ::c_int = 0x5428;
+cfg_if! {
+    if #[cfg(any(target_arch = "x86",
+                 target_arch = "x86_64",
+                 target_arch = "arm",
+                 target_arch = "aarch64",
+                 target_arch = "riscv64",
+                 target_arch = "s390x"))] {
+        pub const FICLONE: ::c_int = 0x40049409;
+        pub const FICLONERANGE: ::c_int = 0x4020940D;
+    } else if #[cfg(any(target_arch = "mips",
+                        target_arch = "mips64",
+                        target_arch = "powerpc",
+                        target_arch = "powerpc64"))] {
+        pub const FICLONE: ::c_int = 0x80049409;
+        pub const FICLONERANGE: ::c_int = 0x8020940D;
+    }
+}
+
+pub const ST_RDONLY: ::c_ulong = 1;
+pub const ST_NOSUID: ::c_ulong = 2;
+pub const ST_NODEV: ::c_ulong = 4;
+pub const ST_NOEXEC: ::c_ulong = 8;
+pub const ST_SYNCHRONOUS: ::c_ulong = 16;
+pub const ST_MANDLOCK: ::c_ulong = 64;
+pub const ST_NOATIME: ::c_ulong = 1024;
+pub const ST_NODIRATIME: ::c_ulong = 2048;
+pub const ST_RELATIME: ::c_ulong = 4096;
+
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+
+pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
+
+pub const AI_PASSIVE: ::c_int = 0x00000001;
+pub const AI_CANONNAME: ::c_int = 0x00000002;
+pub const AI_NUMERICHOST: ::c_int = 0x00000004;
+pub const AI_NUMERICSERV: ::c_int = 0x00000008;
+pub const AI_MASK: ::c_int =
+    AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | AI_ADDRCONFIG;
+pub const AI_ALL: ::c_int = 0x00000100;
+pub const AI_V4MAPPED_CFG: ::c_int = 0x00000200;
+pub const AI_ADDRCONFIG: ::c_int = 0x00000400;
+pub const AI_V4MAPPED: ::c_int = 0x00000800;
+pub const AI_DEFAULT: ::c_int = AI_V4MAPPED_CFG | AI_ADDRCONFIG;
+
+// linux/kexec.h
+pub const KEXEC_ON_CRASH: ::c_int = 0x00000001;
+pub const KEXEC_PRESERVE_CONTEXT: ::c_int = 0x00000002;
+pub const KEXEC_ARCH_MASK: ::c_int = 0xffff0000;
+pub const KEXEC_FILE_UNLOAD: ::c_int = 0x00000001;
+pub const KEXEC_FILE_ON_CRASH: ::c_int = 0x00000002;
+pub const KEXEC_FILE_NO_INITRAMFS: ::c_int = 0x00000004;
+
+pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead;
+pub const LINUX_REBOOT_MAGIC2: ::c_int = 672274793;
+pub const LINUX_REBOOT_MAGIC2A: ::c_int = 85072278;
+pub const LINUX_REBOOT_MAGIC2B: ::c_int = 369367448;
+pub const LINUX_REBOOT_MAGIC2C: ::c_int = 537993216;
+
+pub const LINUX_REBOOT_CMD_RESTART: ::c_int = 0x01234567;
+pub const LINUX_REBOOT_CMD_HALT: ::c_int = 0xCDEF0123;
+pub const LINUX_REBOOT_CMD_CAD_ON: ::c_int = 0x89ABCDEF;
+pub const LINUX_REBOOT_CMD_CAD_OFF: ::c_int = 0x00000000;
+pub const LINUX_REBOOT_CMD_POWER_OFF: ::c_int = 0x4321FEDC;
+pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4;
+pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2;
+pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543;
+
+pub const REG_BASIC: ::c_int = 0;
+pub const REG_EXTENDED: ::c_int = 1;
+pub const REG_ICASE: ::c_int = 2;
+pub const REG_NOSUB: ::c_int = 4;
+pub const REG_NEWLINE: ::c_int = 8;
+pub const REG_NOSPEC: ::c_int = 16;
+pub const REG_PEND: ::c_int = 32;
+pub const REG_DUMP: ::c_int = 128;
+
+pub const REG_NOMATCH: ::c_int = 1;
+pub const REG_BADPAT: ::c_int = 2;
+pub const REG_ECOLLATE: ::c_int = 3;
+pub const REG_ECTYPE: ::c_int = 4;
+pub const REG_EESCAPE: ::c_int = 5;
+pub const REG_ESUBREG: ::c_int = 6;
+pub const REG_EBRACK: ::c_int = 7;
+pub const REG_EPAREN: ::c_int = 8;
+pub const REG_EBRACE: ::c_int = 9;
+pub const REG_BADBR: ::c_int = 10;
+pub const REG_ERANGE: ::c_int = 11;
+pub const REG_ESPACE: ::c_int = 12;
+pub const REG_BADRPT: ::c_int = 13;
+pub const REG_EMPTY: ::c_int = 14;
+pub const REG_ASSERT: ::c_int = 15;
+pub const REG_INVARG: ::c_int = 16;
+pub const REG_ATOI: ::c_int = 255;
+pub const REG_ITOA: ::c_int = 256;
+
+pub const REG_NOTBOL: ::c_int = 1;
+pub const REG_NOTEOL: ::c_int = 2;
+pub const REG_STARTEND: ::c_int = 4;
+pub const REG_TRACE: ::c_int = 256;
+pub const REG_LARGE: ::c_int = 512;
+pub const REG_BACKR: ::c_int = 1024;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const BOTHER: ::speed_t = 0o010000;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+pub const IBSHIFT: ::tcflag_t = 16;
+
+pub const BLKIOMIN: ::c_int = 0x1278;
+pub const BLKIOOPT: ::c_int = 0x1279;
+pub const BLKSSZGET: ::c_int = 0x1268;
+pub const BLKPBSZGET: ::c_int = 0x127B;
+
+cfg_if! {
+    // Those type are constructed using the _IOC macro
+    // DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN
+    // where D stands for direction (either None (00), Read (01) or Write (11))
+    // where S stands for size (int, long, struct...)
+    // where T stands for type ('f','v','X'...)
+    // where N stands for NR (NumbeR)
+    if #[cfg(any(target_arch = "x86", target_arch = "arm"))] {
+        pub const FS_IOC_GETFLAGS: ::c_int = 0x80046601;
+        pub const FS_IOC_SETFLAGS: ::c_int = 0x40046602;
+        pub const FS_IOC_GETVERSION: ::c_int = 0x80047601;
+        pub const FS_IOC_SETVERSION: ::c_int = 0x40047602;
+        pub const FS_IOC32_GETFLAGS: ::c_int = 0x80046601;
+        pub const FS_IOC32_SETFLAGS: ::c_int = 0x40046602;
+        pub const FS_IOC32_GETVERSION: ::c_int = 0x80047601;
+        pub const FS_IOC32_SETVERSION: ::c_int = 0x40047602;
+    } else if #[cfg(any(target_arch = "x86_64", target_arch = "riscv64", target_arch = "aarch64"))] {
+        pub const FS_IOC_GETFLAGS: ::c_int = 0x80086601;
+        pub const FS_IOC_SETFLAGS: ::c_int = 0x40086602;
+        pub const FS_IOC_GETVERSION: ::c_int = 0x80087601;
+        pub const FS_IOC_SETVERSION: ::c_int = 0x40087602;
+        pub const FS_IOC32_GETFLAGS: ::c_int = 0x80046601;
+        pub const FS_IOC32_SETFLAGS: ::c_int = 0x40046602;
+        pub const FS_IOC32_GETVERSION: ::c_int = 0x80047601;
+        pub const FS_IOC32_SETVERSION: ::c_int = 0x40047602;
+    }
+}
+
+pub const EAI_AGAIN: ::c_int = 2;
+pub const EAI_BADFLAGS: ::c_int = 3;
+pub const EAI_FAIL: ::c_int = 4;
+pub const EAI_FAMILY: ::c_int = 5;
+pub const EAI_MEMORY: ::c_int = 6;
+pub const EAI_NODATA: ::c_int = 7;
+pub const EAI_NONAME: ::c_int = 8;
+pub const EAI_SERVICE: ::c_int = 9;
+pub const EAI_SOCKTYPE: ::c_int = 10;
+pub const EAI_SYSTEM: ::c_int = 11;
+pub const EAI_OVERFLOW: ::c_int = 14;
+
+pub const NETLINK_ROUTE: ::c_int = 0;
+pub const NETLINK_UNUSED: ::c_int = 1;
+pub const NETLINK_USERSOCK: ::c_int = 2;
+pub const NETLINK_FIREWALL: ::c_int = 3;
+pub const NETLINK_SOCK_DIAG: ::c_int = 4;
+pub const NETLINK_NFLOG: ::c_int = 5;
+pub const NETLINK_XFRM: ::c_int = 6;
+pub const NETLINK_SELINUX: ::c_int = 7;
+pub const NETLINK_ISCSI: ::c_int = 8;
+pub const NETLINK_AUDIT: ::c_int = 9;
+pub const NETLINK_FIB_LOOKUP: ::c_int = 10;
+pub const NETLINK_CONNECTOR: ::c_int = 11;
+pub const NETLINK_NETFILTER: ::c_int = 12;
+pub const NETLINK_IP6_FW: ::c_int = 13;
+pub const NETLINK_DNRTMSG: ::c_int = 14;
+pub const NETLINK_KOBJECT_UEVENT: ::c_int = 15;
+pub const NETLINK_GENERIC: ::c_int = 16;
+pub const NETLINK_SCSITRANSPORT: ::c_int = 18;
+pub const NETLINK_ECRYPTFS: ::c_int = 19;
+pub const NETLINK_RDMA: ::c_int = 20;
+pub const NETLINK_CRYPTO: ::c_int = 21;
+pub const NETLINK_INET_DIAG: ::c_int = NETLINK_SOCK_DIAG;
+
+pub const MAX_LINKS: ::c_int = 32;
+
+pub const NLM_F_REQUEST: ::c_int = 1;
+pub const NLM_F_MULTI: ::c_int = 2;
+pub const NLM_F_ACK: ::c_int = 4;
+pub const NLM_F_ECHO: ::c_int = 8;
+pub const NLM_F_DUMP_INTR: ::c_int = 16;
+pub const NLM_F_DUMP_FILTERED: ::c_int = 32;
+
+pub const NLM_F_ROOT: ::c_int = 0x100;
+pub const NLM_F_MATCH: ::c_int = 0x200;
+pub const NLM_F_ATOMIC: ::c_int = 0x400;
+pub const NLM_F_DUMP: ::c_int = NLM_F_ROOT | NLM_F_MATCH;
+
+pub const NLM_F_REPLACE: ::c_int = 0x100;
+pub const NLM_F_EXCL: ::c_int = 0x200;
+pub const NLM_F_CREATE: ::c_int = 0x400;
+pub const NLM_F_APPEND: ::c_int = 0x800;
+
+pub const NLMSG_NOOP: ::c_int = 0x1;
+pub const NLMSG_ERROR: ::c_int = 0x2;
+pub const NLMSG_DONE: ::c_int = 0x3;
+pub const NLMSG_OVERRUN: ::c_int = 0x4;
+pub const NLMSG_MIN_TYPE: ::c_int = 0x10;
+
+// linux/netfilter/nfnetlink.h
+pub const NFNLGRP_NONE: ::c_int = 0;
+pub const NFNLGRP_CONNTRACK_NEW: ::c_int = 1;
+pub const NFNLGRP_CONNTRACK_UPDATE: ::c_int = 2;
+pub const NFNLGRP_CONNTRACK_DESTROY: ::c_int = 3;
+pub const NFNLGRP_CONNTRACK_EXP_NEW: ::c_int = 4;
+pub const NFNLGRP_CONNTRACK_EXP_UPDATE: ::c_int = 5;
+pub const NFNLGRP_CONNTRACK_EXP_DESTROY: ::c_int = 6;
+pub const NFNLGRP_NFTABLES: ::c_int = 7;
+pub const NFNLGRP_ACCT_QUOTA: ::c_int = 8;
+
+pub const NFNETLINK_V0: ::c_int = 0;
+
+pub const NFNL_SUBSYS_NONE: ::c_int = 0;
+pub const NFNL_SUBSYS_CTNETLINK: ::c_int = 1;
+pub const NFNL_SUBSYS_CTNETLINK_EXP: ::c_int = 2;
+pub const NFNL_SUBSYS_QUEUE: ::c_int = 3;
+pub const NFNL_SUBSYS_ULOG: ::c_int = 4;
+pub const NFNL_SUBSYS_OSF: ::c_int = 5;
+pub const NFNL_SUBSYS_IPSET: ::c_int = 6;
+pub const NFNL_SUBSYS_ACCT: ::c_int = 7;
+pub const NFNL_SUBSYS_CTNETLINK_TIMEOUT: ::c_int = 8;
+pub const NFNL_SUBSYS_CTHELPER: ::c_int = 9;
+pub const NFNL_SUBSYS_NFTABLES: ::c_int = 10;
+pub const NFNL_SUBSYS_NFT_COMPAT: ::c_int = 11;
+pub const NFNL_SUBSYS_COUNT: ::c_int = 12;
+
+pub const NFNL_MSG_BATCH_BEGIN: ::c_int = NLMSG_MIN_TYPE;
+pub const NFNL_MSG_BATCH_END: ::c_int = NLMSG_MIN_TYPE + 1;
+
+// linux/netfilter/nfnetlink_log.h
+pub const NFULNL_MSG_PACKET: ::c_int = 0;
+pub const NFULNL_MSG_CONFIG: ::c_int = 1;
+
+pub const NFULA_UNSPEC: ::c_int = 0;
+pub const NFULA_PACKET_HDR: ::c_int = 1;
+pub const NFULA_MARK: ::c_int = 2;
+pub const NFULA_TIMESTAMP: ::c_int = 3;
+pub const NFULA_IFINDEX_INDEV: ::c_int = 4;
+pub const NFULA_IFINDEX_OUTDEV: ::c_int = 5;
+pub const NFULA_IFINDEX_PHYSINDEV: ::c_int = 6;
+pub const NFULA_IFINDEX_PHYSOUTDEV: ::c_int = 7;
+pub const NFULA_HWADDR: ::c_int = 8;
+pub const NFULA_PAYLOAD: ::c_int = 9;
+pub const NFULA_PREFIX: ::c_int = 10;
+pub const NFULA_UID: ::c_int = 11;
+pub const NFULA_SEQ: ::c_int = 12;
+pub const NFULA_SEQ_GLOBAL: ::c_int = 13;
+pub const NFULA_GID: ::c_int = 14;
+pub const NFULA_HWTYPE: ::c_int = 15;
+pub const NFULA_HWHEADER: ::c_int = 16;
+pub const NFULA_HWLEN: ::c_int = 17;
+pub const NFULA_CT: ::c_int = 18;
+pub const NFULA_CT_INFO: ::c_int = 19;
+
+pub const NFULNL_CFG_CMD_NONE: ::c_int = 0;
+pub const NFULNL_CFG_CMD_BIND: ::c_int = 1;
+pub const NFULNL_CFG_CMD_UNBIND: ::c_int = 2;
+pub const NFULNL_CFG_CMD_PF_BIND: ::c_int = 3;
+pub const NFULNL_CFG_CMD_PF_UNBIND: ::c_int = 4;
+
+pub const NFULA_CFG_UNSPEC: ::c_int = 0;
+pub const NFULA_CFG_CMD: ::c_int = 1;
+pub const NFULA_CFG_MODE: ::c_int = 2;
+pub const NFULA_CFG_NLBUFSIZ: ::c_int = 3;
+pub const NFULA_CFG_TIMEOUT: ::c_int = 4;
+pub const NFULA_CFG_QTHRESH: ::c_int = 5;
+pub const NFULA_CFG_FLAGS: ::c_int = 6;
+
+pub const NFULNL_COPY_NONE: ::c_int = 0x00;
+pub const NFULNL_COPY_META: ::c_int = 0x01;
+pub const NFULNL_COPY_PACKET: ::c_int = 0x02;
+
+pub const NFULNL_CFG_F_SEQ: ::c_int = 0x0001;
+pub const NFULNL_CFG_F_SEQ_GLOBAL: ::c_int = 0x0002;
+pub const NFULNL_CFG_F_CONNTRACK: ::c_int = 0x0004;
+
+// linux/netfilter/nfnetlink_log.h
+pub const NFQNL_MSG_PACKET: ::c_int = 0;
+pub const NFQNL_MSG_VERDICT: ::c_int = 1;
+pub const NFQNL_MSG_CONFIG: ::c_int = 2;
+pub const NFQNL_MSG_VERDICT_BATCH: ::c_int = 3;
+
+pub const NFQA_UNSPEC: ::c_int = 0;
+pub const NFQA_PACKET_HDR: ::c_int = 1;
+pub const NFQA_VERDICT_HDR: ::c_int = 2;
+pub const NFQA_MARK: ::c_int = 3;
+pub const NFQA_TIMESTAMP: ::c_int = 4;
+pub const NFQA_IFINDEX_INDEV: ::c_int = 5;
+pub const NFQA_IFINDEX_OUTDEV: ::c_int = 6;
+pub const NFQA_IFINDEX_PHYSINDEV: ::c_int = 7;
+pub const NFQA_IFINDEX_PHYSOUTDEV: ::c_int = 8;
+pub const NFQA_HWADDR: ::c_int = 9;
+pub const NFQA_PAYLOAD: ::c_int = 10;
+pub const NFQA_CT: ::c_int = 11;
+pub const NFQA_CT_INFO: ::c_int = 12;
+pub const NFQA_CAP_LEN: ::c_int = 13;
+pub const NFQA_SKB_INFO: ::c_int = 14;
+pub const NFQA_EXP: ::c_int = 15;
+pub const NFQA_UID: ::c_int = 16;
+pub const NFQA_GID: ::c_int = 17;
+pub const NFQA_SECCTX: ::c_int = 18;
+/*
+ FIXME: These are not yet available in musl sanitized kernel headers and
+ make the tests fail. Enable them once musl has them.
+
+ See https://github.com/rust-lang/libc/pull/1628 for more details.
+pub const NFQA_VLAN: ::c_int = 19;
+pub const NFQA_L2HDR: ::c_int = 20;
+
+pub const NFQA_VLAN_UNSPEC: ::c_int = 0;
+pub const NFQA_VLAN_PROTO: ::c_int = 1;
+pub const NFQA_VLAN_TCI: ::c_int = 2;
+*/
+
+pub const NFQNL_CFG_CMD_NONE: ::c_int = 0;
+pub const NFQNL_CFG_CMD_BIND: ::c_int = 1;
+pub const NFQNL_CFG_CMD_UNBIND: ::c_int = 2;
+pub const NFQNL_CFG_CMD_PF_BIND: ::c_int = 3;
+pub const NFQNL_CFG_CMD_PF_UNBIND: ::c_int = 4;
+
+pub const NFQNL_COPY_NONE: ::c_int = 0;
+pub const NFQNL_COPY_META: ::c_int = 1;
+pub const NFQNL_COPY_PACKET: ::c_int = 2;
+
+pub const NFQA_CFG_UNSPEC: ::c_int = 0;
+pub const NFQA_CFG_CMD: ::c_int = 1;
+pub const NFQA_CFG_PARAMS: ::c_int = 2;
+pub const NFQA_CFG_QUEUE_MAXLEN: ::c_int = 3;
+pub const NFQA_CFG_MASK: ::c_int = 4;
+pub const NFQA_CFG_FLAGS: ::c_int = 5;
+
+pub const NFQA_CFG_F_FAIL_OPEN: ::c_int = 0x0001;
+pub const NFQA_CFG_F_CONNTRACK: ::c_int = 0x0002;
+pub const NFQA_CFG_F_GSO: ::c_int = 0x0004;
+pub const NFQA_CFG_F_UID_GID: ::c_int = 0x0008;
+pub const NFQA_CFG_F_SECCTX: ::c_int = 0x0010;
+pub const NFQA_CFG_F_MAX: ::c_int = 0x0020;
+
+pub const NFQA_SKB_CSUMNOTREADY: ::c_int = 0x0001;
+pub const NFQA_SKB_GSO: ::c_int = 0x0002;
+pub const NFQA_SKB_CSUM_NOTVERIFIED: ::c_int = 0x0004;
+
+pub const GENL_NAMSIZ: ::c_int = 16;
+
+pub const GENL_MIN_ID: ::c_int = NLMSG_MIN_TYPE;
+pub const GENL_MAX_ID: ::c_int = 1023;
+
+pub const GENL_ADMIN_PERM: ::c_int = 0x01;
+pub const GENL_CMD_CAP_DO: ::c_int = 0x02;
+pub const GENL_CMD_CAP_DUMP: ::c_int = 0x04;
+pub const GENL_CMD_CAP_HASPOL: ::c_int = 0x08;
+pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10;
+
+pub const GENL_ID_CTRL: ::c_int = NLMSG_MIN_TYPE;
+pub const GENL_ID_VFS_DQUOT: ::c_int = NLMSG_MIN_TYPE + 1;
+pub const GENL_ID_PMCRAID: ::c_int = NLMSG_MIN_TYPE + 2;
+
+pub const CTRL_CMD_UNSPEC: ::c_int = 0;
+pub const CTRL_CMD_NEWFAMILY: ::c_int = 1;
+pub const CTRL_CMD_DELFAMILY: ::c_int = 2;
+pub const CTRL_CMD_GETFAMILY: ::c_int = 3;
+pub const CTRL_CMD_NEWOPS: ::c_int = 4;
+pub const CTRL_CMD_DELOPS: ::c_int = 5;
+pub const CTRL_CMD_GETOPS: ::c_int = 6;
+pub const CTRL_CMD_NEWMCAST_GRP: ::c_int = 7;
+pub const CTRL_CMD_DELMCAST_GRP: ::c_int = 8;
+pub const CTRL_CMD_GETMCAST_GRP: ::c_int = 9;
+
+pub const CTRL_ATTR_UNSPEC: ::c_int = 0;
+pub const CTRL_ATTR_FAMILY_ID: ::c_int = 1;
+pub const CTRL_ATTR_FAMILY_NAME: ::c_int = 2;
+pub const CTRL_ATTR_VERSION: ::c_int = 3;
+pub const CTRL_ATTR_HDRSIZE: ::c_int = 4;
+pub const CTRL_ATTR_MAXATTR: ::c_int = 5;
+pub const CTRL_ATTR_OPS: ::c_int = 6;
+pub const CTRL_ATTR_MCAST_GROUPS: ::c_int = 7;
+
+pub const CTRL_ATTR_OP_UNSPEC: ::c_int = 0;
+pub const CTRL_ATTR_OP_ID: ::c_int = 1;
+pub const CTRL_ATTR_OP_FLAGS: ::c_int = 2;
+
+pub const CTRL_ATTR_MCAST_GRP_UNSPEC: ::c_int = 0;
+pub const CTRL_ATTR_MCAST_GRP_NAME: ::c_int = 1;
+pub const CTRL_ATTR_MCAST_GRP_ID: ::c_int = 2;
+
+pub const NETLINK_ADD_MEMBERSHIP: ::c_int = 1;
+pub const NETLINK_DROP_MEMBERSHIP: ::c_int = 2;
+pub const NETLINK_PKTINFO: ::c_int = 3;
+pub const NETLINK_BROADCAST_ERROR: ::c_int = 4;
+pub const NETLINK_NO_ENOBUFS: ::c_int = 5;
+pub const NETLINK_RX_RING: ::c_int = 6;
+pub const NETLINK_TX_RING: ::c_int = 7;
+pub const NETLINK_LISTEN_ALL_NSID: ::c_int = 8;
+pub const NETLINK_LIST_MEMBERSHIPS: ::c_int = 9;
+pub const NETLINK_CAP_ACK: ::c_int = 10;
+pub const NETLINK_EXT_ACK: ::c_int = 11;
+pub const NETLINK_GET_STRICT_CHK: ::c_int = 12;
+
+pub const GRND_NONBLOCK: ::c_uint = 0x0001;
+pub const GRND_RANDOM: ::c_uint = 0x0002;
+pub const GRND_INSECURE: ::c_uint = 0x0004;
+
+pub const SECCOMP_MODE_DISABLED: ::c_uint = 0;
+pub const SECCOMP_MODE_STRICT: ::c_uint = 1;
+pub const SECCOMP_MODE_FILTER: ::c_uint = 2;
+
+pub const SECCOMP_FILTER_FLAG_TSYNC: ::c_ulong = 1;
+pub const SECCOMP_FILTER_FLAG_LOG: ::c_ulong = 2;
+pub const SECCOMP_FILTER_FLAG_SPEC_ALLOW: ::c_ulong = 4;
+pub const SECCOMP_FILTER_FLAG_NEW_LISTENER: ::c_ulong = 8;
+
+pub const SECCOMP_RET_ACTION_FULL: ::c_uint = 0xffff0000;
+pub const SECCOMP_RET_ACTION: ::c_uint = 0x7fff0000;
+pub const SECCOMP_RET_DATA: ::c_uint = 0x0000ffff;
+
+pub const SECCOMP_RET_KILL_PROCESS: ::c_uint = 0x80000000;
+pub const SECCOMP_RET_KILL_THREAD: ::c_uint = 0x00000000;
+pub const SECCOMP_RET_KILL: ::c_uint = SECCOMP_RET_KILL_THREAD;
+pub const SECCOMP_RET_TRAP: ::c_uint = 0x00030000;
+pub const SECCOMP_RET_ERRNO: ::c_uint = 0x00050000;
+pub const SECCOMP_RET_USER_NOTIF: ::c_uint = 0x7fc00000;
+pub const SECCOMP_RET_TRACE: ::c_uint = 0x7ff00000;
+pub const SECCOMP_RET_LOG: ::c_uint = 0x7ffc0000;
+pub const SECCOMP_RET_ALLOW: ::c_uint = 0x7fff0000;
+
+pub const NLA_F_NESTED: ::c_int = 1 << 15;
+pub const NLA_F_NET_BYTEORDER: ::c_int = 1 << 14;
+pub const NLA_TYPE_MASK: ::c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER);
+
+pub const NLA_ALIGNTO: ::c_int = 4;
+
+pub const SIGEV_THREAD_ID: ::c_int = 4;
+
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+
+pub const TIOCM_LE: ::c_int = 0x001;
+pub const TIOCM_DTR: ::c_int = 0x002;
+pub const TIOCM_RTS: ::c_int = 0x004;
+pub const TIOCM_ST: ::c_int = 0x008;
+pub const TIOCM_SR: ::c_int = 0x010;
+pub const TIOCM_CTS: ::c_int = 0x020;
+pub const TIOCM_CAR: ::c_int = 0x040;
+pub const TIOCM_RNG: ::c_int = 0x080;
+pub const TIOCM_DSR: ::c_int = 0x100;
+pub const TIOCM_CD: ::c_int = TIOCM_CAR;
+pub const TIOCM_RI: ::c_int = TIOCM_RNG;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const SFD_CLOEXEC: ::c_int = O_CLOEXEC;
+pub const SFD_NONBLOCK: ::c_int = O_NONBLOCK;
+
+pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK;
+
+pub const SO_ORIGINAL_DST: ::c_int = 80;
+
+pub const IP_RECVFRAGSIZE: ::c_int = 25;
+
+pub const IPV6_FLOWINFO: ::c_int = 11;
+pub const IPV6_MULTICAST_ALL: ::c_int = 29;
+pub const IPV6_ROUTER_ALERT_ISOLATE: ::c_int = 30;
+pub const IPV6_FLOWLABEL_MGR: ::c_int = 32;
+pub const IPV6_FLOWINFO_SEND: ::c_int = 33;
+pub const IPV6_RECVFRAGSIZE: ::c_int = 77;
+pub const IPV6_FREEBIND: ::c_int = 78;
+pub const IPV6_FLOWINFO_FLOWLABEL: ::c_int = 0x000fffff;
+pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 0x0ff00000;
+
+pub const IUTF8: ::tcflag_t = 0x00004000;
+pub const CMSPAR: ::tcflag_t = 0o10000000000;
+pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
+
+pub const MFD_CLOEXEC: ::c_uint = 0x0001;
+pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
+pub const MFD_HUGETLB: ::c_uint = 0x0004;
+pub const MFD_NOEXEC_SEAL: ::c_uint = 0x0008;
+pub const MFD_EXEC: ::c_uint = 0x0010;
+pub const MFD_HUGE_64KB: ::c_uint = 0x40000000;
+pub const MFD_HUGE_512KB: ::c_uint = 0x4c000000;
+pub const MFD_HUGE_1MB: ::c_uint = 0x50000000;
+pub const MFD_HUGE_2MB: ::c_uint = 0x54000000;
+pub const MFD_HUGE_8MB: ::c_uint = 0x5c000000;
+pub const MFD_HUGE_16MB: ::c_uint = 0x60000000;
+pub const MFD_HUGE_32MB: ::c_uint = 0x64000000;
+pub const MFD_HUGE_256MB: ::c_uint = 0x70000000;
+pub const MFD_HUGE_512MB: ::c_uint = 0x74000000;
+pub const MFD_HUGE_1GB: ::c_uint = 0x78000000;
+pub const MFD_HUGE_2GB: ::c_uint = 0x7c000000;
+pub const MFD_HUGE_16GB: ::c_uint = 0x88000000;
+pub const MFD_HUGE_MASK: ::c_uint = 63;
+pub const MFD_HUGE_SHIFT: ::c_uint = 26;
+
+// these are used in the p_type field of Elf32_Phdr and Elf64_Phdr, which has
+// the type Elf32Word and Elf64Word respectively. Luckily, both of those are u32
+// so we can use that type here to avoid having to cast.
+pub const PT_NULL: u32 = 0;
+pub const PT_LOAD: u32 = 1;
+pub const PT_DYNAMIC: u32 = 2;
+pub const PT_INTERP: u32 = 3;
+pub const PT_NOTE: u32 = 4;
+pub const PT_SHLIB: u32 = 5;
+pub const PT_PHDR: u32 = 6;
+pub const PT_TLS: u32 = 7;
+pub const PT_LOOS: u32 = 0x60000000;
+pub const PT_GNU_EH_FRAME: u32 = 0x6474e550;
+pub const PT_GNU_STACK: u32 = 0x6474e551;
+pub const PT_GNU_RELRO: u32 = 0x6474e552;
+pub const PT_HIOS: u32 = 0x6fffffff;
+pub const PT_LOPROC: u32 = 0x70000000;
+pub const PT_HIPROC: u32 = 0x7fffffff;
+
+// uapi/linux/mount.h
+pub const OPEN_TREE_CLONE: ::c_uint = 0x01;
+pub const OPEN_TREE_CLOEXEC: ::c_uint = O_CLOEXEC as ::c_uint;
+
+// linux/netfilter.h
+pub const NF_DROP: ::c_int = 0;
+pub const NF_ACCEPT: ::c_int = 1;
+pub const NF_STOLEN: ::c_int = 2;
+pub const NF_QUEUE: ::c_int = 3;
+pub const NF_REPEAT: ::c_int = 4;
+pub const NF_STOP: ::c_int = 5;
+pub const NF_MAX_VERDICT: ::c_int = NF_STOP;
+
+pub const NF_VERDICT_MASK: ::c_int = 0x000000ff;
+pub const NF_VERDICT_FLAG_QUEUE_BYPASS: ::c_int = 0x00008000;
+
+pub const NF_VERDICT_QMASK: ::c_int = 0xffff0000;
+pub const NF_VERDICT_QBITS: ::c_int = 16;
+
+pub const NF_VERDICT_BITS: ::c_int = 16;
+
+pub const NF_INET_PRE_ROUTING: ::c_int = 0;
+pub const NF_INET_LOCAL_IN: ::c_int = 1;
+pub const NF_INET_FORWARD: ::c_int = 2;
+pub const NF_INET_LOCAL_OUT: ::c_int = 3;
+pub const NF_INET_POST_ROUTING: ::c_int = 4;
+pub const NF_INET_NUMHOOKS: ::c_int = 5;
+
+pub const NF_NETDEV_INGRESS: ::c_int = 0;
+pub const NF_NETDEV_NUMHOOKS: ::c_int = 1;
+
+pub const NFPROTO_UNSPEC: ::c_int = 0;
+pub const NFPROTO_INET: ::c_int = 1;
+pub const NFPROTO_IPV4: ::c_int = 2;
+pub const NFPROTO_ARP: ::c_int = 3;
+pub const NFPROTO_NETDEV: ::c_int = 5;
+pub const NFPROTO_BRIDGE: ::c_int = 7;
+pub const NFPROTO_IPV6: ::c_int = 10;
+pub const NFPROTO_DECNET: ::c_int = 12;
+pub const NFPROTO_NUMPROTO: ::c_int = 13;
+
+// linux/netfilter_ipv4.h
+pub const NF_IP_PRE_ROUTING: ::c_int = 0;
+pub const NF_IP_LOCAL_IN: ::c_int = 1;
+pub const NF_IP_FORWARD: ::c_int = 2;
+pub const NF_IP_LOCAL_OUT: ::c_int = 3;
+pub const NF_IP_POST_ROUTING: ::c_int = 4;
+pub const NF_IP_NUMHOOKS: ::c_int = 5;
+
+pub const NF_IP_PRI_FIRST: ::c_int = ::INT_MIN;
+pub const NF_IP_PRI_CONNTRACK_DEFRAG: ::c_int = -400;
+pub const NF_IP_PRI_RAW: ::c_int = -300;
+pub const NF_IP_PRI_SELINUX_FIRST: ::c_int = -225;
+pub const NF_IP_PRI_CONNTRACK: ::c_int = -200;
+pub const NF_IP_PRI_MANGLE: ::c_int = -150;
+pub const NF_IP_PRI_NAT_DST: ::c_int = -100;
+pub const NF_IP_PRI_FILTER: ::c_int = 0;
+pub const NF_IP_PRI_SECURITY: ::c_int = 50;
+pub const NF_IP_PRI_NAT_SRC: ::c_int = 100;
+pub const NF_IP_PRI_SELINUX_LAST: ::c_int = 225;
+pub const NF_IP_PRI_CONNTRACK_HELPER: ::c_int = 300;
+pub const NF_IP_PRI_CONNTRACK_CONFIRM: ::c_int = ::INT_MAX;
+pub const NF_IP_PRI_LAST: ::c_int = ::INT_MAX;
+
+// linux/netfilter_ipv6.h
+pub const NF_IP6_PRE_ROUTING: ::c_int = 0;
+pub const NF_IP6_LOCAL_IN: ::c_int = 1;
+pub const NF_IP6_FORWARD: ::c_int = 2;
+pub const NF_IP6_LOCAL_OUT: ::c_int = 3;
+pub const NF_IP6_POST_ROUTING: ::c_int = 4;
+pub const NF_IP6_NUMHOOKS: ::c_int = 5;
+
+pub const NF_IP6_PRI_FIRST: ::c_int = ::INT_MIN;
+pub const NF_IP6_PRI_CONNTRACK_DEFRAG: ::c_int = -400;
+pub const NF_IP6_PRI_RAW: ::c_int = -300;
+pub const NF_IP6_PRI_SELINUX_FIRST: ::c_int = -225;
+pub const NF_IP6_PRI_CONNTRACK: ::c_int = -200;
+pub const NF_IP6_PRI_MANGLE: ::c_int = -150;
+pub const NF_IP6_PRI_NAT_DST: ::c_int = -100;
+pub const NF_IP6_PRI_FILTER: ::c_int = 0;
+pub const NF_IP6_PRI_SECURITY: ::c_int = 50;
+pub const NF_IP6_PRI_NAT_SRC: ::c_int = 100;
+pub const NF_IP6_PRI_SELINUX_LAST: ::c_int = 225;
+pub const NF_IP6_PRI_CONNTRACK_HELPER: ::c_int = 300;
+pub const NF_IP6_PRI_LAST: ::c_int = ::INT_MAX;
+
+// linux/netfilter_ipv6/ip6_tables.h
+pub const IP6T_SO_ORIGINAL_DST: ::c_int = 80;
+
+// linux/netfilter/nf_tables.h
+pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256;
+pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256;
+pub const NFT_SET_MAXNAMELEN: ::c_int = 256;
+pub const NFT_OBJ_MAXNAMELEN: ::c_int = 256;
+pub const NFT_USERDATA_MAXLEN: ::c_int = 256;
+
+pub const NFT_REG_VERDICT: ::c_int = 0;
+pub const NFT_REG_1: ::c_int = 1;
+pub const NFT_REG_2: ::c_int = 2;
+pub const NFT_REG_3: ::c_int = 3;
+pub const NFT_REG_4: ::c_int = 4;
+pub const __NFT_REG_MAX: ::c_int = 5;
+pub const NFT_REG32_00: ::c_int = 8;
+pub const NFT_REG32_01: ::c_int = 9;
+pub const NFT_REG32_02: ::c_int = 10;
+pub const NFT_REG32_03: ::c_int = 11;
+pub const NFT_REG32_04: ::c_int = 12;
+pub const NFT_REG32_05: ::c_int = 13;
+pub const NFT_REG32_06: ::c_int = 14;
+pub const NFT_REG32_07: ::c_int = 15;
+pub const NFT_REG32_08: ::c_int = 16;
+pub const NFT_REG32_09: ::c_int = 17;
+pub const NFT_REG32_10: ::c_int = 18;
+pub const NFT_REG32_11: ::c_int = 19;
+pub const NFT_REG32_12: ::c_int = 20;
+pub const NFT_REG32_13: ::c_int = 21;
+pub const NFT_REG32_14: ::c_int = 22;
+pub const NFT_REG32_15: ::c_int = 23;
+
+pub const NFT_REG_SIZE: ::c_int = 16;
+pub const NFT_REG32_SIZE: ::c_int = 4;
+
+pub const NFT_CONTINUE: ::c_int = -1;
+pub const NFT_BREAK: ::c_int = -2;
+pub const NFT_JUMP: ::c_int = -3;
+pub const NFT_GOTO: ::c_int = -4;
+pub const NFT_RETURN: ::c_int = -5;
+
+pub const NFT_MSG_NEWTABLE: ::c_int = 0;
+pub const NFT_MSG_GETTABLE: ::c_int = 1;
+pub const NFT_MSG_DELTABLE: ::c_int = 2;
+pub const NFT_MSG_NEWCHAIN: ::c_int = 3;
+pub const NFT_MSG_GETCHAIN: ::c_int = 4;
+pub const NFT_MSG_DELCHAIN: ::c_int = 5;
+pub const NFT_MSG_NEWRULE: ::c_int = 6;
+pub const NFT_MSG_GETRULE: ::c_int = 7;
+pub const NFT_MSG_DELRULE: ::c_int = 8;
+pub const NFT_MSG_NEWSET: ::c_int = 9;
+pub const NFT_MSG_GETSET: ::c_int = 10;
+pub const NFT_MSG_DELSET: ::c_int = 11;
+pub const NFT_MSG_NEWSETELEM: ::c_int = 12;
+pub const NFT_MSG_GETSETELEM: ::c_int = 13;
+pub const NFT_MSG_DELSETELEM: ::c_int = 14;
+pub const NFT_MSG_NEWGEN: ::c_int = 15;
+pub const NFT_MSG_GETGEN: ::c_int = 16;
+pub const NFT_MSG_TRACE: ::c_int = 17;
+pub const NFT_MSG_NEWOBJ: ::c_int = 18;
+pub const NFT_MSG_GETOBJ: ::c_int = 19;
+pub const NFT_MSG_DELOBJ: ::c_int = 20;
+pub const NFT_MSG_GETOBJ_RESET: ::c_int = 21;
+pub const NFT_MSG_MAX: ::c_int = 25;
+
+pub const NFT_SET_ANONYMOUS: ::c_int = 0x1;
+pub const NFT_SET_CONSTANT: ::c_int = 0x2;
+pub const NFT_SET_INTERVAL: ::c_int = 0x4;
+pub const NFT_SET_MAP: ::c_int = 0x8;
+pub const NFT_SET_TIMEOUT: ::c_int = 0x10;
+pub const NFT_SET_EVAL: ::c_int = 0x20;
+
+pub const NFT_SET_POL_PERFORMANCE: ::c_int = 0;
+pub const NFT_SET_POL_MEMORY: ::c_int = 1;
+
+pub const NFT_SET_ELEM_INTERVAL_END: ::c_int = 0x1;
+
+pub const NFT_DATA_VALUE: ::c_uint = 0;
+pub const NFT_DATA_VERDICT: ::c_uint = 0xffffff00;
+
+pub const NFT_DATA_RESERVED_MASK: ::c_uint = 0xffffff00;
+
+pub const NFT_DATA_VALUE_MAXLEN: ::c_int = 64;
+
+pub const NFT_BYTEORDER_NTOH: ::c_int = 0;
+pub const NFT_BYTEORDER_HTON: ::c_int = 1;
+
+pub const NFT_CMP_EQ: ::c_int = 0;
+pub const NFT_CMP_NEQ: ::c_int = 1;
+pub const NFT_CMP_LT: ::c_int = 2;
+pub const NFT_CMP_LTE: ::c_int = 3;
+pub const NFT_CMP_GT: ::c_int = 4;
+pub const NFT_CMP_GTE: ::c_int = 5;
+
+pub const NFT_RANGE_EQ: ::c_int = 0;
+pub const NFT_RANGE_NEQ: ::c_int = 1;
+
+pub const NFT_LOOKUP_F_INV: ::c_int = 1 << 0;
+
+pub const NFT_DYNSET_OP_ADD: ::c_int = 0;
+pub const NFT_DYNSET_OP_UPDATE: ::c_int = 1;
+
+pub const NFT_DYNSET_F_INV: ::c_int = 1 << 0;
+
+pub const NFT_PAYLOAD_LL_HEADER: ::c_int = 0;
+pub const NFT_PAYLOAD_NETWORK_HEADER: ::c_int = 1;
+pub const NFT_PAYLOAD_TRANSPORT_HEADER: ::c_int = 2;
+
+pub const NFT_PAYLOAD_CSUM_NONE: ::c_int = 0;
+pub const NFT_PAYLOAD_CSUM_INET: ::c_int = 1;
+
+pub const NFT_META_LEN: ::c_int = 0;
+pub const NFT_META_PROTOCOL: ::c_int = 1;
+pub const NFT_META_PRIORITY: ::c_int = 2;
+pub const NFT_META_MARK: ::c_int = 3;
+pub const NFT_META_IIF: ::c_int = 4;
+pub const NFT_META_OIF: ::c_int = 5;
+pub const NFT_META_IIFNAME: ::c_int = 6;
+pub const NFT_META_OIFNAME: ::c_int = 7;
+pub const NFT_META_IIFTYPE: ::c_int = 8;
+pub const NFT_META_OIFTYPE: ::c_int = 9;
+pub const NFT_META_SKUID: ::c_int = 10;
+pub const NFT_META_SKGID: ::c_int = 11;
+pub const NFT_META_NFTRACE: ::c_int = 12;
+pub const NFT_META_RTCLASSID: ::c_int = 13;
+pub const NFT_META_SECMARK: ::c_int = 14;
+pub const NFT_META_NFPROTO: ::c_int = 15;
+pub const NFT_META_L4PROTO: ::c_int = 16;
+pub const NFT_META_BRI_IIFNAME: ::c_int = 17;
+pub const NFT_META_BRI_OIFNAME: ::c_int = 18;
+pub const NFT_META_PKTTYPE: ::c_int = 19;
+pub const NFT_META_CPU: ::c_int = 20;
+pub const NFT_META_IIFGROUP: ::c_int = 21;
+pub const NFT_META_OIFGROUP: ::c_int = 22;
+pub const NFT_META_CGROUP: ::c_int = 23;
+pub const NFT_META_PRANDOM: ::c_int = 24;
+
+pub const NFT_CT_STATE: ::c_int = 0;
+pub const NFT_CT_DIRECTION: ::c_int = 1;
+pub const NFT_CT_STATUS: ::c_int = 2;
+pub const NFT_CT_MARK: ::c_int = 3;
+pub const NFT_CT_SECMARK: ::c_int = 4;
+pub const NFT_CT_EXPIRATION: ::c_int = 5;
+pub const NFT_CT_HELPER: ::c_int = 6;
+pub const NFT_CT_L3PROTOCOL: ::c_int = 7;
+pub const NFT_CT_SRC: ::c_int = 8;
+pub const NFT_CT_DST: ::c_int = 9;
+pub const NFT_CT_PROTOCOL: ::c_int = 10;
+pub const NFT_CT_PROTO_SRC: ::c_int = 11;
+pub const NFT_CT_PROTO_DST: ::c_int = 12;
+pub const NFT_CT_LABELS: ::c_int = 13;
+pub const NFT_CT_PKTS: ::c_int = 14;
+pub const NFT_CT_BYTES: ::c_int = 15;
+
+pub const NFT_LIMIT_PKTS: ::c_int = 0;
+pub const NFT_LIMIT_PKT_BYTES: ::c_int = 1;
+
+pub const NFT_LIMIT_F_INV: ::c_int = 1 << 0;
+
+pub const NFT_QUEUE_FLAG_BYPASS: ::c_int = 0x01;
+pub const NFT_QUEUE_FLAG_CPU_FANOUT: ::c_int = 0x02;
+pub const NFT_QUEUE_FLAG_MASK: ::c_int = 0x03;
+
+pub const NFT_QUOTA_F_INV: ::c_int = 1 << 0;
+
+pub const NFT_REJECT_ICMP_UNREACH: ::c_int = 0;
+pub const NFT_REJECT_TCP_RST: ::c_int = 1;
+pub const NFT_REJECT_ICMPX_UNREACH: ::c_int = 2;
+
+pub const NFT_REJECT_ICMPX_NO_ROUTE: ::c_int = 0;
+pub const NFT_REJECT_ICMPX_PORT_UNREACH: ::c_int = 1;
+pub const NFT_REJECT_ICMPX_HOST_UNREACH: ::c_int = 2;
+pub const NFT_REJECT_ICMPX_ADMIN_PROHIBITED: ::c_int = 3;
+
+pub const NFT_NAT_SNAT: ::c_int = 0;
+pub const NFT_NAT_DNAT: ::c_int = 1;
+
+pub const NFT_TRACETYPE_UNSPEC: ::c_int = 0;
+pub const NFT_TRACETYPE_POLICY: ::c_int = 1;
+pub const NFT_TRACETYPE_RETURN: ::c_int = 2;
+pub const NFT_TRACETYPE_RULE: ::c_int = 3;
+
+pub const NFT_NG_INCREMENTAL: ::c_int = 0;
+pub const NFT_NG_RANDOM: ::c_int = 1;
+
+// linux/input.h
+pub const FF_MAX: ::__u16 = 0x7f;
+pub const FF_CNT: usize = FF_MAX as usize + 1;
+
+// linux/input-event-codes.h
+pub const INPUT_PROP_MAX: ::__u16 = 0x1f;
+pub const INPUT_PROP_CNT: usize = INPUT_PROP_MAX as usize + 1;
+pub const EV_MAX: ::__u16 = 0x1f;
+pub const EV_CNT: usize = EV_MAX as usize + 1;
+pub const SYN_MAX: ::__u16 = 0xf;
+pub const SYN_CNT: usize = SYN_MAX as usize + 1;
+pub const KEY_MAX: ::__u16 = 0x2ff;
+pub const KEY_CNT: usize = KEY_MAX as usize + 1;
+pub const REL_MAX: ::__u16 = 0x0f;
+pub const REL_CNT: usize = REL_MAX as usize + 1;
+pub const ABS_MAX: ::__u16 = 0x3f;
+pub const ABS_CNT: usize = ABS_MAX as usize + 1;
+pub const SW_MAX: ::__u16 = 0x0f;
+pub const SW_CNT: usize = SW_MAX as usize + 1;
+pub const MSC_MAX: ::__u16 = 0x07;
+pub const MSC_CNT: usize = MSC_MAX as usize + 1;
+pub const LED_MAX: ::__u16 = 0x0f;
+pub const LED_CNT: usize = LED_MAX as usize + 1;
+pub const REP_MAX: ::__u16 = 0x01;
+pub const REP_CNT: usize = REP_MAX as usize + 1;
+pub const SND_MAX: ::__u16 = 0x07;
+pub const SND_CNT: usize = SND_MAX as usize + 1;
+
+// linux/uinput.h
+pub const UINPUT_VERSION: ::c_uint = 5;
+pub const UINPUT_MAX_NAME_SIZE: usize = 80;
+
+// bionic/libc/kernel/uapi/linux/if_tun.h
+pub const IFF_TUN: ::c_int = 0x0001;
+pub const IFF_TAP: ::c_int = 0x0002;
+pub const IFF_NAPI: ::c_int = 0x0010;
+pub const IFF_NAPI_FRAGS: ::c_int = 0x0020;
+pub const IFF_NO_CARRIER: ::c_int = 0x0040;
+pub const IFF_NO_PI: ::c_int = 0x1000;
+pub const IFF_ONE_QUEUE: ::c_int = 0x2000;
+pub const IFF_VNET_HDR: ::c_int = 0x4000;
+pub const IFF_TUN_EXCL: ::c_int = 0x8000;
+pub const IFF_MULTI_QUEUE: ::c_int = 0x0100;
+pub const IFF_ATTACH_QUEUE: ::c_int = 0x0200;
+pub const IFF_DETACH_QUEUE: ::c_int = 0x0400;
+pub const IFF_PERSIST: ::c_int = 0x0800;
+pub const IFF_NOFILTER: ::c_int = 0x1000;
+// Features for GSO (TUNSETOFFLOAD)
+pub const TUN_F_CSUM: ::c_uint = 0x01;
+pub const TUN_F_TSO4: ::c_uint = 0x02;
+pub const TUN_F_TSO6: ::c_uint = 0x04;
+pub const TUN_F_TSO_ECN: ::c_uint = 0x08;
+pub const TUN_F_UFO: ::c_uint = 0x10;
+pub const TUN_F_USO4: ::c_uint = 0x20;
+pub const TUN_F_USO6: ::c_uint = 0x40;
+
+// start android/platform/bionic/libc/kernel/uapi/linux/if_ether.h
+// from https://android.googlesource.com/platform/bionic/+/HEAD/libc/kernel/uapi/linux/if_ether.h
+pub const ETH_ALEN: ::c_int = 6;
+pub const ETH_HLEN: ::c_int = 14;
+pub const ETH_ZLEN: ::c_int = 60;
+pub const ETH_DATA_LEN: ::c_int = 1500;
+pub const ETH_FRAME_LEN: ::c_int = 1514;
+pub const ETH_FCS_LEN: ::c_int = 4;
+pub const ETH_MIN_MTU: ::c_int = 68;
+pub const ETH_MAX_MTU: ::c_int = 0xFFFF;
+pub const ETH_P_LOOP: ::c_int = 0x0060;
+pub const ETH_P_PUP: ::c_int = 0x0200;
+pub const ETH_P_PUPAT: ::c_int = 0x0201;
+pub const ETH_P_TSN: ::c_int = 0x22F0;
+pub const ETH_P_IP: ::c_int = 0x0800;
+pub const ETH_P_X25: ::c_int = 0x0805;
+pub const ETH_P_ARP: ::c_int = 0x0806;
+pub const ETH_P_BPQ: ::c_int = 0x08FF;
+pub const ETH_P_IEEEPUP: ::c_int = 0x0a00;
+pub const ETH_P_IEEEPUPAT: ::c_int = 0x0a01;
+pub const ETH_P_BATMAN: ::c_int = 0x4305;
+pub const ETH_P_DEC: ::c_int = 0x6000;
+pub const ETH_P_DNA_DL: ::c_int = 0x6001;
+pub const ETH_P_DNA_RC: ::c_int = 0x6002;
+pub const ETH_P_DNA_RT: ::c_int = 0x6003;
+pub const ETH_P_LAT: ::c_int = 0x6004;
+pub const ETH_P_DIAG: ::c_int = 0x6005;
+pub const ETH_P_CUST: ::c_int = 0x6006;
+pub const ETH_P_SCA: ::c_int = 0x6007;
+pub const ETH_P_TEB: ::c_int = 0x6558;
+pub const ETH_P_RARP: ::c_int = 0x8035;
+pub const ETH_P_ATALK: ::c_int = 0x809B;
+pub const ETH_P_AARP: ::c_int = 0x80F3;
+pub const ETH_P_8021Q: ::c_int = 0x8100;
+/* see rust-lang/libc#924 pub const ETH_P_ERSPAN: ::c_int = 0x88BE;*/
+pub const ETH_P_IPX: ::c_int = 0x8137;
+pub const ETH_P_IPV6: ::c_int = 0x86DD;
+pub const ETH_P_PAUSE: ::c_int = 0x8808;
+pub const ETH_P_SLOW: ::c_int = 0x8809;
+pub const ETH_P_WCCP: ::c_int = 0x883E;
+pub const ETH_P_MPLS_UC: ::c_int = 0x8847;
+pub const ETH_P_MPLS_MC: ::c_int = 0x8848;
+pub const ETH_P_ATMMPOA: ::c_int = 0x884c;
+pub const ETH_P_PPP_DISC: ::c_int = 0x8863;
+pub const ETH_P_PPP_SES: ::c_int = 0x8864;
+pub const ETH_P_LINK_CTL: ::c_int = 0x886c;
+pub const ETH_P_ATMFATE: ::c_int = 0x8884;
+pub const ETH_P_PAE: ::c_int = 0x888E;
+pub const ETH_P_AOE: ::c_int = 0x88A2;
+pub const ETH_P_8021AD: ::c_int = 0x88A8;
+pub const ETH_P_802_EX1: ::c_int = 0x88B5;
+pub const ETH_P_TIPC: ::c_int = 0x88CA;
+pub const ETH_P_MACSEC: ::c_int = 0x88E5;
+pub const ETH_P_8021AH: ::c_int = 0x88E7;
+pub const ETH_P_MVRP: ::c_int = 0x88F5;
+pub const ETH_P_1588: ::c_int = 0x88F7;
+pub const ETH_P_NCSI: ::c_int = 0x88F8;
+pub const ETH_P_PRP: ::c_int = 0x88FB;
+pub const ETH_P_FCOE: ::c_int = 0x8906;
+/* see rust-lang/libc#924 pub const ETH_P_IBOE: ::c_int = 0x8915;*/
+pub const ETH_P_TDLS: ::c_int = 0x890D;
+pub const ETH_P_FIP: ::c_int = 0x8914;
+pub const ETH_P_80221: ::c_int = 0x8917;
+pub const ETH_P_HSR: ::c_int = 0x892F;
+/* see rust-lang/libc#924 pub const ETH_P_NSH: ::c_int = 0x894F;*/
+pub const ETH_P_LOOPBACK: ::c_int = 0x9000;
+pub const ETH_P_QINQ1: ::c_int = 0x9100;
+pub const ETH_P_QINQ2: ::c_int = 0x9200;
+pub const ETH_P_QINQ3: ::c_int = 0x9300;
+pub const ETH_P_EDSA: ::c_int = 0xDADA;
+/* see rust-lang/libc#924 pub const ETH_P_IFE: ::c_int = 0xED3E;*/
+pub const ETH_P_AF_IUCV: ::c_int = 0xFBFB;
+pub const ETH_P_802_3_MIN: ::c_int = 0x0600;
+pub const ETH_P_802_3: ::c_int = 0x0001;
+pub const ETH_P_AX25: ::c_int = 0x0002;
+pub const ETH_P_ALL: ::c_int = 0x0003;
+pub const ETH_P_802_2: ::c_int = 0x0004;
+pub const ETH_P_SNAP: ::c_int = 0x0005;
+pub const ETH_P_DDCMP: ::c_int = 0x0006;
+pub const ETH_P_WAN_PPP: ::c_int = 0x0007;
+pub const ETH_P_PPP_MP: ::c_int = 0x0008;
+pub const ETH_P_LOCALTALK: ::c_int = 0x0009;
+pub const ETH_P_CAN: ::c_int = 0x000C;
+pub const ETH_P_CANFD: ::c_int = 0x000D;
+pub const ETH_P_PPPTALK: ::c_int = 0x0010;
+pub const ETH_P_TR_802_2: ::c_int = 0x0011;
+pub const ETH_P_MOBITEX: ::c_int = 0x0015;
+pub const ETH_P_CONTROL: ::c_int = 0x0016;
+pub const ETH_P_IRDA: ::c_int = 0x0017;
+pub const ETH_P_ECONET: ::c_int = 0x0018;
+pub const ETH_P_HDLC: ::c_int = 0x0019;
+pub const ETH_P_ARCNET: ::c_int = 0x001A;
+pub const ETH_P_DSA: ::c_int = 0x001B;
+pub const ETH_P_TRAILER: ::c_int = 0x001C;
+pub const ETH_P_PHONET: ::c_int = 0x00F5;
+pub const ETH_P_IEEE802154: ::c_int = 0x00F6;
+pub const ETH_P_CAIF: ::c_int = 0x00F7;
+pub const ETH_P_XDSA: ::c_int = 0x00F8;
+/* see rust-lang/libc#924 pub const ETH_P_MAP: ::c_int = 0x00F9;*/
+// end android/platform/bionic/libc/kernel/uapi/linux/if_ether.h
+
+// start android/platform/bionic/libc/kernel/uapi/linux/neighbour.h
+pub const NDA_UNSPEC: ::c_ushort = 0;
+pub const NDA_DST: ::c_ushort = 1;
+pub const NDA_LLADDR: ::c_ushort = 2;
+pub const NDA_CACHEINFO: ::c_ushort = 3;
+pub const NDA_PROBES: ::c_ushort = 4;
+pub const NDA_VLAN: ::c_ushort = 5;
+pub const NDA_PORT: ::c_ushort = 6;
+pub const NDA_VNI: ::c_ushort = 7;
+pub const NDA_IFINDEX: ::c_ushort = 8;
+pub const NDA_MASTER: ::c_ushort = 9;
+pub const NDA_LINK_NETNSID: ::c_ushort = 10;
+pub const NDA_SRC_VNI: ::c_ushort = 11;
+pub const NDA_PROTOCOL: ::c_ushort = 12;
+pub const NDA_NH_ID: ::c_ushort = 13;
+pub const NDA_FDB_EXT_ATTRS: ::c_ushort = 14;
+pub const NDA_FLAGS_EXT: ::c_ushort = 15;
+pub const NDA_NDM_STATE_MASK: ::c_ushort = 16;
+pub const NDA_NDM_FLAGS_MASK: ::c_ushort = 17;
+
+pub const NTF_USE: u8 = 0x01;
+pub const NTF_SELF: u8 = 0x02;
+pub const NTF_MASTER: u8 = 0x04;
+pub const NTF_PROXY: u8 = 0x08;
+pub const NTF_EXT_LEARNED: u8 = 0x10;
+pub const NTF_OFFLOADED: u8 = 0x20;
+pub const NTF_STICKY: u8 = 0x40;
+pub const NTF_ROUTER: u8 = 0x80;
+
+pub const NTF_EXT_MANAGED: u8 = 0x01;
+pub const NTF_EXT_LOCKED: u8 = 0x02;
+
+pub const NUD_NONE: u16 = 0x00;
+pub const NUD_INCOMPLETE: u16 = 0x01;
+pub const NUD_REACHABLE: u16 = 0x02;
+pub const NUD_STALE: u16 = 0x04;
+pub const NUD_DELAY: u16 = 0x08;
+pub const NUD_PROBE: u16 = 0x10;
+pub const NUD_FAILED: u16 = 0x20;
+pub const NUD_NOARP: u16 = 0x40;
+pub const NUD_PERMANENT: u16 = 0x80;
+
+pub const NDTPA_UNSPEC: ::c_ushort = 0;
+pub const NDTPA_IFINDEX: ::c_ushort = 1;
+pub const NDTPA_REFCNT: ::c_ushort = 2;
+pub const NDTPA_REACHABLE_TIME: ::c_ushort = 3;
+pub const NDTPA_BASE_REACHABLE_TIME: ::c_ushort = 4;
+pub const NDTPA_RETRANS_TIME: ::c_ushort = 5;
+pub const NDTPA_GC_STALETIME: ::c_ushort = 6;
+pub const NDTPA_DELAY_PROBE_TIME: ::c_ushort = 7;
+pub const NDTPA_QUEUE_LEN: ::c_ushort = 8;
+pub const NDTPA_APP_PROBES: ::c_ushort = 9;
+pub const NDTPA_UCAST_PROBES: ::c_ushort = 10;
+pub const NDTPA_MCAST_PROBES: ::c_ushort = 11;
+pub const NDTPA_ANYCAST_DELAY: ::c_ushort = 12;
+pub const NDTPA_PROXY_DELAY: ::c_ushort = 13;
+pub const NDTPA_PROXY_QLEN: ::c_ushort = 14;
+pub const NDTPA_LOCKTIME: ::c_ushort = 15;
+pub const NDTPA_QUEUE_LENBYTES: ::c_ushort = 16;
+pub const NDTPA_MCAST_REPROBES: ::c_ushort = 17;
+pub const NDTPA_PAD: ::c_ushort = 18;
+pub const NDTPA_INTERVAL_PROBE_TIME_MS: ::c_ushort = 19;
+
+pub const NDTA_UNSPEC: ::c_ushort = 0;
+pub const NDTA_NAME: ::c_ushort = 1;
+pub const NDTA_THRESH1: ::c_ushort = 2;
+pub const NDTA_THRESH2: ::c_ushort = 3;
+pub const NDTA_THRESH3: ::c_ushort = 4;
+pub const NDTA_CONFIG: ::c_ushort = 5;
+pub const NDTA_PARMS: ::c_ushort = 6;
+pub const NDTA_STATS: ::c_ushort = 7;
+pub const NDTA_GC_INTERVAL: ::c_ushort = 8;
+pub const NDTA_PAD: ::c_ushort = 9;
+
+pub const FDB_NOTIFY_BIT: u16 = 0x01;
+pub const FDB_NOTIFY_INACTIVE_BIT: u16 = 0x02;
+
+pub const NFEA_UNSPEC: ::c_ushort = 0;
+pub const NFEA_ACTIVITY_NOTIFY: ::c_ushort = 1;
+pub const NFEA_DONT_REFRESH: ::c_ushort = 2;
+// end android/platform/bionic/libc/kernel/uapi/linux/neighbour.h
+
+pub const SIOCADDRT: ::c_ulong = 0x0000890B;
+pub const SIOCDELRT: ::c_ulong = 0x0000890C;
+pub const SIOCRTMSG: ::c_ulong = 0x0000890D;
+pub const SIOCGIFNAME: ::c_ulong = 0x00008910;
+pub const SIOCSIFLINK: ::c_ulong = 0x00008911;
+pub const SIOCGIFCONF: ::c_ulong = 0x00008912;
+pub const SIOCGIFFLAGS: ::c_ulong = 0x00008913;
+pub const SIOCSIFFLAGS: ::c_ulong = 0x00008914;
+pub const SIOCGIFADDR: ::c_ulong = 0x00008915;
+pub const SIOCSIFADDR: ::c_ulong = 0x00008916;
+pub const SIOCGIFDSTADDR: ::c_ulong = 0x00008917;
+pub const SIOCSIFDSTADDR: ::c_ulong = 0x00008918;
+pub const SIOCGIFBRDADDR: ::c_ulong = 0x00008919;
+pub const SIOCSIFBRDADDR: ::c_ulong = 0x0000891A;
+pub const SIOCGIFNETMASK: ::c_ulong = 0x0000891B;
+pub const SIOCSIFNETMASK: ::c_ulong = 0x0000891C;
+pub const SIOCGIFMETRIC: ::c_ulong = 0x0000891D;
+pub const SIOCSIFMETRIC: ::c_ulong = 0x0000891E;
+pub const SIOCGIFMEM: ::c_ulong = 0x0000891F;
+pub const SIOCSIFMEM: ::c_ulong = 0x00008920;
+pub const SIOCGIFMTU: ::c_ulong = 0x00008921;
+pub const SIOCSIFMTU: ::c_ulong = 0x00008922;
+pub const SIOCSIFNAME: ::c_ulong = 0x00008923;
+pub const SIOCSIFHWADDR: ::c_ulong = 0x00008924;
+pub const SIOCGIFENCAP: ::c_ulong = 0x00008925;
+pub const SIOCSIFENCAP: ::c_ulong = 0x00008926;
+pub const SIOCGIFHWADDR: ::c_ulong = 0x00008927;
+pub const SIOCGIFSLAVE: ::c_ulong = 0x00008929;
+pub const SIOCSIFSLAVE: ::c_ulong = 0x00008930;
+pub const SIOCADDMULTI: ::c_ulong = 0x00008931;
+pub const SIOCDELMULTI: ::c_ulong = 0x00008932;
+pub const SIOCGIFINDEX: ::c_ulong = 0x00008933;
+pub const SIOGIFINDEX: ::c_ulong = SIOCGIFINDEX;
+pub const SIOCSIFPFLAGS: ::c_ulong = 0x00008934;
+pub const SIOCGIFPFLAGS: ::c_ulong = 0x00008935;
+pub const SIOCDIFADDR: ::c_ulong = 0x00008936;
+pub const SIOCSIFHWBROADCAST: ::c_ulong = 0x00008937;
+pub const SIOCGIFCOUNT: ::c_ulong = 0x00008938;
+pub const SIOCGIFBR: ::c_ulong = 0x00008940;
+pub const SIOCSIFBR: ::c_ulong = 0x00008941;
+pub const SIOCGIFTXQLEN: ::c_ulong = 0x00008942;
+pub const SIOCSIFTXQLEN: ::c_ulong = 0x00008943;
+pub const SIOCETHTOOL: ::c_ulong = 0x00008946;
+pub const SIOCGMIIPHY: ::c_ulong = 0x00008947;
+pub const SIOCGMIIREG: ::c_ulong = 0x00008948;
+pub const SIOCSMIIREG: ::c_ulong = 0x00008949;
+pub const SIOCWANDEV: ::c_ulong = 0x0000894A;
+pub const SIOCOUTQNSD: ::c_ulong = 0x0000894B;
+pub const SIOCGSKNS: ::c_ulong = 0x0000894C;
+pub const SIOCDARP: ::c_ulong = 0x00008953;
+pub const SIOCGARP: ::c_ulong = 0x00008954;
+pub const SIOCSARP: ::c_ulong = 0x00008955;
+pub const SIOCDRARP: ::c_ulong = 0x00008960;
+pub const SIOCGRARP: ::c_ulong = 0x00008961;
+pub const SIOCSRARP: ::c_ulong = 0x00008962;
+pub const SIOCGIFMAP: ::c_ulong = 0x00008970;
+pub const SIOCSIFMAP: ::c_ulong = 0x00008971;
+pub const SIOCADDDLCI: ::c_ulong = 0x00008980;
+pub const SIOCDELDLCI: ::c_ulong = 0x00008981;
+pub const SIOCGIFVLAN: ::c_ulong = 0x00008982;
+pub const SIOCSIFVLAN: ::c_ulong = 0x00008983;
+pub const SIOCBONDENSLAVE: ::c_ulong = 0x00008990;
+pub const SIOCBONDRELEASE: ::c_ulong = 0x00008991;
+pub const SIOCBONDSETHWADDR: ::c_ulong = 0x00008992;
+pub const SIOCBONDSLAVEINFOQUERY: ::c_ulong = 0x00008993;
+pub const SIOCBONDINFOQUERY: ::c_ulong = 0x00008994;
+pub const SIOCBONDCHANGEACTIVE: ::c_ulong = 0x00008995;
+pub const SIOCBRADDBR: ::c_ulong = 0x000089a0;
+pub const SIOCBRDELBR: ::c_ulong = 0x000089a1;
+pub const SIOCBRADDIF: ::c_ulong = 0x000089a2;
+pub const SIOCBRDELIF: ::c_ulong = 0x000089a3;
+pub const SIOCSHWTSTAMP: ::c_ulong = 0x000089b0;
+pub const SIOCGHWTSTAMP: ::c_ulong = 0x000089b1;
+pub const SIOCDEVPRIVATE: ::c_ulong = 0x000089F0;
+pub const SIOCPROTOPRIVATE: ::c_ulong = 0x000089E0;
+
+// linux/module.h
+pub const MODULE_INIT_IGNORE_MODVERSIONS: ::c_uint = 0x0001;
+pub const MODULE_INIT_IGNORE_VERMAGIC: ::c_uint = 0x0002;
+
+// linux/net_tstamp.h
+pub const SOF_TIMESTAMPING_TX_HARDWARE: ::c_uint = 1 << 0;
+pub const SOF_TIMESTAMPING_TX_SOFTWARE: ::c_uint = 1 << 1;
+pub const SOF_TIMESTAMPING_RX_HARDWARE: ::c_uint = 1 << 2;
+pub const SOF_TIMESTAMPING_RX_SOFTWARE: ::c_uint = 1 << 3;
+pub const SOF_TIMESTAMPING_SOFTWARE: ::c_uint = 1 << 4;
+pub const SOF_TIMESTAMPING_SYS_HARDWARE: ::c_uint = 1 << 5;
+pub const SOF_TIMESTAMPING_RAW_HARDWARE: ::c_uint = 1 << 6;
+pub const SOF_TIMESTAMPING_OPT_ID: ::c_uint = 1 << 7;
+pub const SOF_TIMESTAMPING_TX_SCHED: ::c_uint = 1 << 8;
+pub const SOF_TIMESTAMPING_TX_ACK: ::c_uint = 1 << 9;
+pub const SOF_TIMESTAMPING_OPT_CMSG: ::c_uint = 1 << 10;
+pub const SOF_TIMESTAMPING_OPT_TSONLY: ::c_uint = 1 << 11;
+pub const SOF_TIMESTAMPING_OPT_STATS: ::c_uint = 1 << 12;
+pub const SOF_TIMESTAMPING_OPT_PKTINFO: ::c_uint = 1 << 13;
+pub const SOF_TIMESTAMPING_OPT_TX_SWHW: ::c_uint = 1 << 14;
+
+#[deprecated(
+    since = "0.2.55",
+    note = "ENOATTR is not available on Android; use ENODATA instead"
+)]
+pub const ENOATTR: ::c_int = ::ENODATA;
+
+// linux/if_alg.h
+pub const ALG_SET_KEY: ::c_int = 1;
+pub const ALG_SET_IV: ::c_int = 2;
+pub const ALG_SET_OP: ::c_int = 3;
+pub const ALG_SET_AEAD_ASSOCLEN: ::c_int = 4;
+pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5;
+pub const ALG_SET_DRBG_ENTROPY: ::c_int = 6;
+
+pub const ALG_OP_DECRYPT: ::c_int = 0;
+pub const ALG_OP_ENCRYPT: ::c_int = 1;
+
+// sys/mman.h
+pub const MLOCK_ONFAULT: ::c_int = 0x01;
+
+// uapi/linux/vm_sockets.h
+pub const VMADDR_CID_ANY: ::c_uint = 0xFFFFFFFF;
+pub const VMADDR_CID_HYPERVISOR: ::c_uint = 0;
+pub const VMADDR_CID_LOCAL: ::c_uint = 1;
+pub const VMADDR_CID_HOST: ::c_uint = 2;
+pub const VMADDR_PORT_ANY: ::c_uint = 0xFFFFFFFF;
+
+// uapi/linux/inotify.h
+pub const IN_ACCESS: u32 = 0x0000_0001;
+pub const IN_MODIFY: u32 = 0x0000_0002;
+pub const IN_ATTRIB: u32 = 0x0000_0004;
+pub const IN_CLOSE_WRITE: u32 = 0x0000_0008;
+pub const IN_CLOSE_NOWRITE: u32 = 0x0000_0010;
+pub const IN_CLOSE: u32 = IN_CLOSE_WRITE | IN_CLOSE_NOWRITE;
+pub const IN_OPEN: u32 = 0x0000_0020;
+pub const IN_MOVED_FROM: u32 = 0x0000_0040;
+pub const IN_MOVED_TO: u32 = 0x0000_0080;
+pub const IN_MOVE: u32 = IN_MOVED_FROM | IN_MOVED_TO;
+pub const IN_CREATE: u32 = 0x0000_0100;
+pub const IN_DELETE: u32 = 0x0000_0200;
+pub const IN_DELETE_SELF: u32 = 0x0000_0400;
+pub const IN_MOVE_SELF: u32 = 0x0000_0800;
+pub const IN_UNMOUNT: u32 = 0x0000_2000;
+pub const IN_Q_OVERFLOW: u32 = 0x0000_4000;
+pub const IN_IGNORED: u32 = 0x0000_8000;
+pub const IN_ONLYDIR: u32 = 0x0100_0000;
+pub const IN_DONT_FOLLOW: u32 = 0x0200_0000;
+pub const IN_EXCL_UNLINK: u32 = 0x0400_0000;
+
+pub const IN_MASK_CREATE: u32 = 0x1000_0000;
+pub const IN_MASK_ADD: u32 = 0x2000_0000;
+pub const IN_ISDIR: u32 = 0x4000_0000;
+pub const IN_ONESHOT: u32 = 0x8000_0000;
+
+pub const IN_ALL_EVENTS: u32 = IN_ACCESS
+    | IN_MODIFY
+    | IN_ATTRIB
+    | IN_CLOSE_WRITE
+    | IN_CLOSE_NOWRITE
+    | IN_OPEN
+    | IN_MOVED_FROM
+    | IN_MOVED_TO
+    | IN_DELETE
+    | IN_CREATE
+    | IN_DELETE_SELF
+    | IN_MOVE_SELF;
+
+pub const IN_CLOEXEC: ::c_int = O_CLOEXEC;
+pub const IN_NONBLOCK: ::c_int = O_NONBLOCK;
+
+pub const FUTEX_WAIT: ::c_int = 0;
+pub const FUTEX_WAKE: ::c_int = 1;
+pub const FUTEX_FD: ::c_int = 2;
+pub const FUTEX_REQUEUE: ::c_int = 3;
+pub const FUTEX_CMP_REQUEUE: ::c_int = 4;
+pub const FUTEX_WAKE_OP: ::c_int = 5;
+pub const FUTEX_LOCK_PI: ::c_int = 6;
+pub const FUTEX_UNLOCK_PI: ::c_int = 7;
+pub const FUTEX_TRYLOCK_PI: ::c_int = 8;
+pub const FUTEX_WAIT_BITSET: ::c_int = 9;
+pub const FUTEX_WAKE_BITSET: ::c_int = 10;
+pub const FUTEX_WAIT_REQUEUE_PI: ::c_int = 11;
+pub const FUTEX_CMP_REQUEUE_PI: ::c_int = 12;
+pub const FUTEX_LOCK_PI2: ::c_int = 13;
+
+pub const FUTEX_PRIVATE_FLAG: ::c_int = 128;
+pub const FUTEX_CLOCK_REALTIME: ::c_int = 256;
+pub const FUTEX_CMD_MASK: ::c_int = !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME);
+
+// linux/errqueue.h
+pub const SO_EE_ORIGIN_NONE: u8 = 0;
+pub const SO_EE_ORIGIN_LOCAL: u8 = 1;
+pub const SO_EE_ORIGIN_ICMP: u8 = 2;
+pub const SO_EE_ORIGIN_ICMP6: u8 = 3;
+pub const SO_EE_ORIGIN_TXSTATUS: u8 = 4;
+pub const SO_EE_ORIGIN_TIMESTAMPING: u8 = SO_EE_ORIGIN_TXSTATUS;
+
+// errno.h
+pub const EPERM: ::c_int = 1;
+pub const ENOENT: ::c_int = 2;
+pub const ESRCH: ::c_int = 3;
+pub const EINTR: ::c_int = 4;
+pub const EIO: ::c_int = 5;
+pub const ENXIO: ::c_int = 6;
+pub const E2BIG: ::c_int = 7;
+pub const ENOEXEC: ::c_int = 8;
+pub const EBADF: ::c_int = 9;
+pub const ECHILD: ::c_int = 10;
+pub const EAGAIN: ::c_int = 11;
+pub const ENOMEM: ::c_int = 12;
+pub const EACCES: ::c_int = 13;
+pub const EFAULT: ::c_int = 14;
+pub const ENOTBLK: ::c_int = 15;
+pub const EBUSY: ::c_int = 16;
+pub const EEXIST: ::c_int = 17;
+pub const EXDEV: ::c_int = 18;
+pub const ENODEV: ::c_int = 19;
+pub const ENOTDIR: ::c_int = 20;
+pub const EISDIR: ::c_int = 21;
+pub const EINVAL: ::c_int = 22;
+pub const ENFILE: ::c_int = 23;
+pub const EMFILE: ::c_int = 24;
+pub const ENOTTY: ::c_int = 25;
+pub const ETXTBSY: ::c_int = 26;
+pub const EFBIG: ::c_int = 27;
+pub const ENOSPC: ::c_int = 28;
+pub const ESPIPE: ::c_int = 29;
+pub const EROFS: ::c_int = 30;
+pub const EMLINK: ::c_int = 31;
+pub const EPIPE: ::c_int = 32;
+pub const EDOM: ::c_int = 33;
+pub const ERANGE: ::c_int = 34;
+pub const EWOULDBLOCK: ::c_int = EAGAIN;
+
+pub const PRIO_PROCESS: ::c_int = 0;
+pub const PRIO_PGRP: ::c_int = 1;
+pub const PRIO_USER: ::c_int = 2;
+
+// linux/sched.h
+pub const SCHED_NORMAL: ::c_int = 0;
+pub const SCHED_FIFO: ::c_int = 1;
+pub const SCHED_RR: ::c_int = 2;
+pub const SCHED_BATCH: ::c_int = 3;
+pub const SCHED_IDLE: ::c_int = 5;
+pub const SCHED_DEADLINE: ::c_int = 6;
+
+pub const SCHED_RESET_ON_FORK: ::c_int = 0x40000000;
+
+pub const CLONE_PIDFD: ::c_int = 0x1000;
+
+// linux/membarrier.h
+pub const MEMBARRIER_CMD_QUERY: ::c_int = 0;
+pub const MEMBARRIER_CMD_GLOBAL: ::c_int = 1 << 0;
+pub const MEMBARRIER_CMD_GLOBAL_EXPEDITED: ::c_int = 1 << 1;
+pub const MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED: ::c_int = 1 << 2;
+pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED: ::c_int = 1 << 3;
+pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED: ::c_int = 1 << 4;
+pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE: ::c_int = 1 << 5;
+pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE: ::c_int = 1 << 6;
+pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ: ::c_int = 1 << 7;
+pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ: ::c_int = 1 << 8;
+
+// linux/mempolicy.h
+pub const MPOL_DEFAULT: ::c_int = 0;
+pub const MPOL_PREFERRED: ::c_int = 1;
+pub const MPOL_BIND: ::c_int = 2;
+pub const MPOL_INTERLEAVE: ::c_int = 3;
+pub const MPOL_LOCAL: ::c_int = 4;
+pub const MPOL_F_NUMA_BALANCING: ::c_int = 1 << 13;
+pub const MPOL_F_RELATIVE_NODES: ::c_int = 1 << 14;
+pub const MPOL_F_STATIC_NODES: ::c_int = 1 << 15;
+
+// bits/seek_constants.h
+pub const SEEK_DATA: ::c_int = 3;
+pub const SEEK_HOLE: ::c_int = 4;
+
+// sys/socket.h
+pub const AF_NFC: ::c_int = 39;
+pub const AF_VSOCK: ::c_int = 40;
+pub const PF_NFC: ::c_int = AF_NFC;
+pub const PF_VSOCK: ::c_int = AF_VSOCK;
+
+pub const SOMAXCONN: ::c_int = 128;
+
+// sys/prctl.h
+pub const PR_SET_PDEATHSIG: ::c_int = 1;
+pub const PR_GET_PDEATHSIG: ::c_int = 2;
+pub const PR_GET_SECUREBITS: ::c_int = 27;
+pub const PR_SET_SECUREBITS: ::c_int = 28;
+
+// sys/system_properties.h
+pub const PROP_VALUE_MAX: ::c_int = 92;
+pub const PROP_NAME_MAX: ::c_int = 32;
+
+// sys/prctl.h
+pub const PR_SET_VMA: ::c_int = 0x53564d41;
+pub const PR_SET_VMA_ANON_NAME: ::c_int = 0;
+pub const PR_SET_NO_NEW_PRIVS: ::c_int = 38;
+pub const PR_GET_NO_NEW_PRIVS: ::c_int = 39;
+pub const PR_GET_SECCOMP: ::c_int = 21;
+pub const PR_SET_SECCOMP: ::c_int = 22;
+pub const PR_GET_TIMING: ::c_int = 13;
+pub const PR_SET_TIMING: ::c_int = 14;
+pub const PR_TIMING_STATISTICAL: ::c_int = 0;
+pub const PR_TIMING_TIMESTAMP: ::c_int = 1;
+
+// linux/if_addr.h
+pub const IFA_UNSPEC: ::c_ushort = 0;
+pub const IFA_ADDRESS: ::c_ushort = 1;
+pub const IFA_LOCAL: ::c_ushort = 2;
+pub const IFA_LABEL: ::c_ushort = 3;
+pub const IFA_BROADCAST: ::c_ushort = 4;
+pub const IFA_ANYCAST: ::c_ushort = 5;
+pub const IFA_CACHEINFO: ::c_ushort = 6;
+pub const IFA_MULTICAST: ::c_ushort = 7;
+
+pub const IFA_F_SECONDARY: u32 = 0x01;
+pub const IFA_F_TEMPORARY: u32 = 0x01;
+pub const IFA_F_NODAD: u32 = 0x02;
+pub const IFA_F_OPTIMISTIC: u32 = 0x04;
+pub const IFA_F_DADFAILED: u32 = 0x08;
+pub const IFA_F_HOMEADDRESS: u32 = 0x10;
+pub const IFA_F_DEPRECATED: u32 = 0x20;
+pub const IFA_F_TENTATIVE: u32 = 0x40;
+pub const IFA_F_PERMANENT: u32 = 0x80;
+
+// linux/if_link.h
+pub const IFLA_UNSPEC: ::c_ushort = 0;
+pub const IFLA_ADDRESS: ::c_ushort = 1;
+pub const IFLA_BROADCAST: ::c_ushort = 2;
+pub const IFLA_IFNAME: ::c_ushort = 3;
+pub const IFLA_MTU: ::c_ushort = 4;
+pub const IFLA_LINK: ::c_ushort = 5;
+pub const IFLA_QDISC: ::c_ushort = 6;
+pub const IFLA_STATS: ::c_ushort = 7;
+pub const IFLA_COST: ::c_ushort = 8;
+pub const IFLA_PRIORITY: ::c_ushort = 9;
+pub const IFLA_MASTER: ::c_ushort = 10;
+pub const IFLA_WIRELESS: ::c_ushort = 11;
+pub const IFLA_PROTINFO: ::c_ushort = 12;
+pub const IFLA_TXQLEN: ::c_ushort = 13;
+pub const IFLA_MAP: ::c_ushort = 14;
+pub const IFLA_WEIGHT: ::c_ushort = 15;
+pub const IFLA_OPERSTATE: ::c_ushort = 16;
+pub const IFLA_LINKMODE: ::c_ushort = 17;
+pub const IFLA_LINKINFO: ::c_ushort = 18;
+pub const IFLA_NET_NS_PID: ::c_ushort = 19;
+pub const IFLA_IFALIAS: ::c_ushort = 20;
+pub const IFLA_NUM_VF: ::c_ushort = 21;
+pub const IFLA_VFINFO_LIST: ::c_ushort = 22;
+pub const IFLA_STATS64: ::c_ushort = 23;
+pub const IFLA_VF_PORTS: ::c_ushort = 24;
+pub const IFLA_PORT_SELF: ::c_ushort = 25;
+pub const IFLA_AF_SPEC: ::c_ushort = 26;
+pub const IFLA_GROUP: ::c_ushort = 27;
+pub const IFLA_NET_NS_FD: ::c_ushort = 28;
+pub const IFLA_EXT_MASK: ::c_ushort = 29;
+pub const IFLA_PROMISCUITY: ::c_ushort = 30;
+pub const IFLA_NUM_TX_QUEUES: ::c_ushort = 31;
+pub const IFLA_NUM_RX_QUEUES: ::c_ushort = 32;
+pub const IFLA_CARRIER: ::c_ushort = 33;
+pub const IFLA_PHYS_PORT_ID: ::c_ushort = 34;
+pub const IFLA_CARRIER_CHANGES: ::c_ushort = 35;
+pub const IFLA_PHYS_SWITCH_ID: ::c_ushort = 36;
+pub const IFLA_LINK_NETNSID: ::c_ushort = 37;
+pub const IFLA_PHYS_PORT_NAME: ::c_ushort = 38;
+pub const IFLA_PROTO_DOWN: ::c_ushort = 39;
+pub const IFLA_GSO_MAX_SEGS: ::c_ushort = 40;
+pub const IFLA_GSO_MAX_SIZE: ::c_ushort = 41;
+pub const IFLA_PAD: ::c_ushort = 42;
+pub const IFLA_XDP: ::c_ushort = 43;
+pub const IFLA_EVENT: ::c_ushort = 44;
+pub const IFLA_NEW_NETNSID: ::c_ushort = 45;
+pub const IFLA_IF_NETNSID: ::c_ushort = 46;
+pub const IFLA_TARGET_NETNSID: ::c_ushort = IFLA_IF_NETNSID;
+pub const IFLA_CARRIER_UP_COUNT: ::c_ushort = 47;
+pub const IFLA_CARRIER_DOWN_COUNT: ::c_ushort = 48;
+pub const IFLA_NEW_IFINDEX: ::c_ushort = 49;
+pub const IFLA_MIN_MTU: ::c_ushort = 50;
+pub const IFLA_MAX_MTU: ::c_ushort = 51;
+pub const IFLA_PROP_LIST: ::c_ushort = 52;
+pub const IFLA_ALT_IFNAME: ::c_ushort = 53;
+pub const IFLA_PERM_ADDRESS: ::c_ushort = 54;
+pub const IFLA_PROTO_DOWN_REASON: ::c_ushort = 55;
+pub const IFLA_PARENT_DEV_NAME: ::c_ushort = 56;
+pub const IFLA_PARENT_DEV_BUS_NAME: ::c_ushort = 57;
+pub const IFLA_GRO_MAX_SIZE: ::c_ushort = 58;
+pub const IFLA_TSO_MAX_SIZE: ::c_ushort = 59;
+pub const IFLA_TSO_MAX_SEGS: ::c_ushort = 60;
+pub const IFLA_ALLMULTI: ::c_ushort = 61;
+pub const IFLA_DEVLINK_PORT: ::c_ushort = 62;
+pub const IFLA_GSO_IPV4_MAX_SIZE: ::c_ushort = 63;
+pub const IFLA_GRO_IPV4_MAX_SIZE: ::c_ushort = 64;
+
+pub const IFLA_INFO_UNSPEC: ::c_ushort = 0;
+pub const IFLA_INFO_KIND: ::c_ushort = 1;
+pub const IFLA_INFO_DATA: ::c_ushort = 2;
+pub const IFLA_INFO_XSTATS: ::c_ushort = 3;
+pub const IFLA_INFO_SLAVE_KIND: ::c_ushort = 4;
+pub const IFLA_INFO_SLAVE_DATA: ::c_ushort = 5;
+
+// linux/rtnetlink.h
+pub const TCA_UNSPEC: ::c_ushort = 0;
+pub const TCA_KIND: ::c_ushort = 1;
+pub const TCA_OPTIONS: ::c_ushort = 2;
+pub const TCA_STATS: ::c_ushort = 3;
+pub const TCA_XSTATS: ::c_ushort = 4;
+pub const TCA_RATE: ::c_ushort = 5;
+pub const TCA_FCNT: ::c_ushort = 6;
+pub const TCA_STATS2: ::c_ushort = 7;
+pub const TCA_STAB: ::c_ushort = 8;
+
+pub const RTM_NEWLINK: u16 = 16;
+pub const RTM_DELLINK: u16 = 17;
+pub const RTM_GETLINK: u16 = 18;
+pub const RTM_SETLINK: u16 = 19;
+pub const RTM_NEWADDR: u16 = 20;
+pub const RTM_DELADDR: u16 = 21;
+pub const RTM_GETADDR: u16 = 22;
+pub const RTM_NEWROUTE: u16 = 24;
+pub const RTM_DELROUTE: u16 = 25;
+pub const RTM_GETROUTE: u16 = 26;
+pub const RTM_NEWNEIGH: u16 = 28;
+pub const RTM_DELNEIGH: u16 = 29;
+pub const RTM_GETNEIGH: u16 = 30;
+pub const RTM_NEWRULE: u16 = 32;
+pub const RTM_DELRULE: u16 = 33;
+pub const RTM_GETRULE: u16 = 34;
+pub const RTM_NEWQDISC: u16 = 36;
+pub const RTM_DELQDISC: u16 = 37;
+pub const RTM_GETQDISC: u16 = 38;
+pub const RTM_NEWTCLASS: u16 = 40;
+pub const RTM_DELTCLASS: u16 = 41;
+pub const RTM_GETTCLASS: u16 = 42;
+pub const RTM_NEWTFILTER: u16 = 44;
+pub const RTM_DELTFILTER: u16 = 45;
+pub const RTM_GETTFILTER: u16 = 46;
+pub const RTM_NEWACTION: u16 = 48;
+pub const RTM_DELACTION: u16 = 49;
+pub const RTM_GETACTION: u16 = 50;
+pub const RTM_NEWPREFIX: u16 = 52;
+pub const RTM_GETMULTICAST: u16 = 58;
+pub const RTM_GETANYCAST: u16 = 62;
+pub const RTM_NEWNEIGHTBL: u16 = 64;
+pub const RTM_GETNEIGHTBL: u16 = 66;
+pub const RTM_SETNEIGHTBL: u16 = 67;
+pub const RTM_NEWNDUSEROPT: u16 = 68;
+pub const RTM_NEWADDRLABEL: u16 = 72;
+pub const RTM_DELADDRLABEL: u16 = 73;
+pub const RTM_GETADDRLABEL: u16 = 74;
+pub const RTM_GETDCB: u16 = 78;
+pub const RTM_SETDCB: u16 = 79;
+pub const RTM_NEWNETCONF: u16 = 80;
+pub const RTM_GETNETCONF: u16 = 82;
+pub const RTM_NEWMDB: u16 = 84;
+pub const RTM_DELMDB: u16 = 85;
+pub const RTM_GETMDB: u16 = 86;
+pub const RTM_NEWNSID: u16 = 88;
+pub const RTM_DELNSID: u16 = 89;
+pub const RTM_GETNSID: u16 = 90;
+
+pub const RTM_F_NOTIFY: ::c_uint = 0x100;
+pub const RTM_F_CLONED: ::c_uint = 0x200;
+pub const RTM_F_EQUALIZE: ::c_uint = 0x400;
+pub const RTM_F_PREFIX: ::c_uint = 0x800;
+
+pub const RTA_UNSPEC: ::c_ushort = 0;
+pub const RTA_DST: ::c_ushort = 1;
+pub const RTA_SRC: ::c_ushort = 2;
+pub const RTA_IIF: ::c_ushort = 3;
+pub const RTA_OIF: ::c_ushort = 4;
+pub const RTA_GATEWAY: ::c_ushort = 5;
+pub const RTA_PRIORITY: ::c_ushort = 6;
+pub const RTA_PREFSRC: ::c_ushort = 7;
+pub const RTA_METRICS: ::c_ushort = 8;
+pub const RTA_MULTIPATH: ::c_ushort = 9;
+pub const RTA_PROTOINFO: ::c_ushort = 10; // No longer used
+pub const RTA_FLOW: ::c_ushort = 11;
+pub const RTA_CACHEINFO: ::c_ushort = 12;
+pub const RTA_SESSION: ::c_ushort = 13; // No longer used
+pub const RTA_MP_ALGO: ::c_ushort = 14; // No longer used
+pub const RTA_TABLE: ::c_ushort = 15;
+pub const RTA_MARK: ::c_ushort = 16;
+pub const RTA_MFC_STATS: ::c_ushort = 17;
+
+pub const RTN_UNSPEC: ::c_uchar = 0;
+pub const RTN_UNICAST: ::c_uchar = 1;
+pub const RTN_LOCAL: ::c_uchar = 2;
+pub const RTN_BROADCAST: ::c_uchar = 3;
+pub const RTN_ANYCAST: ::c_uchar = 4;
+pub const RTN_MULTICAST: ::c_uchar = 5;
+pub const RTN_BLACKHOLE: ::c_uchar = 6;
+pub const RTN_UNREACHABLE: ::c_uchar = 7;
+pub const RTN_PROHIBIT: ::c_uchar = 8;
+pub const RTN_THROW: ::c_uchar = 9;
+pub const RTN_NAT: ::c_uchar = 10;
+pub const RTN_XRESOLVE: ::c_uchar = 11;
+
+pub const RTPROT_UNSPEC: ::c_uchar = 0;
+pub const RTPROT_REDIRECT: ::c_uchar = 1;
+pub const RTPROT_KERNEL: ::c_uchar = 2;
+pub const RTPROT_BOOT: ::c_uchar = 3;
+pub const RTPROT_STATIC: ::c_uchar = 4;
+
+pub const RT_SCOPE_UNIVERSE: ::c_uchar = 0;
+pub const RT_SCOPE_SITE: ::c_uchar = 200;
+pub const RT_SCOPE_LINK: ::c_uchar = 253;
+pub const RT_SCOPE_HOST: ::c_uchar = 254;
+pub const RT_SCOPE_NOWHERE: ::c_uchar = 255;
+
+pub const RT_TABLE_UNSPEC: ::c_uchar = 0;
+pub const RT_TABLE_COMPAT: ::c_uchar = 252;
+pub const RT_TABLE_DEFAULT: ::c_uchar = 253;
+pub const RT_TABLE_MAIN: ::c_uchar = 254;
+pub const RT_TABLE_LOCAL: ::c_uchar = 255;
+
+pub const RTMSG_NEWDEVICE: u32 = 0x11;
+pub const RTMSG_DELDEVICE: u32 = 0x12;
+pub const RTMSG_NEWROUTE: u32 = 0x21;
+pub const RTMSG_DELROUTE: u32 = 0x22;
+
+pub const CTL_KERN: ::c_int = 1;
+pub const CTL_VM: ::c_int = 2;
+pub const CTL_NET: ::c_int = 3;
+pub const CTL_FS: ::c_int = 5;
+pub const CTL_DEBUG: ::c_int = 6;
+pub const CTL_DEV: ::c_int = 7;
+pub const CTL_BUS: ::c_int = 8;
+pub const CTL_ABI: ::c_int = 9;
+pub const CTL_CPU: ::c_int = 10;
+
+pub const CTL_BUS_ISA: ::c_int = 1;
+
+pub const INOTIFY_MAX_USER_INSTANCES: ::c_int = 1;
+pub const INOTIFY_MAX_USER_WATCHES: ::c_int = 2;
+pub const INOTIFY_MAX_QUEUED_EVENTS: ::c_int = 3;
+
+pub const KERN_OSTYPE: ::c_int = 1;
+pub const KERN_OSRELEASE: ::c_int = 2;
+pub const KERN_OSREV: ::c_int = 3;
+pub const KERN_VERSION: ::c_int = 4;
+pub const KERN_SECUREMASK: ::c_int = 5;
+pub const KERN_PROF: ::c_int = 6;
+pub const KERN_NODENAME: ::c_int = 7;
+pub const KERN_DOMAINNAME: ::c_int = 8;
+pub const KERN_PANIC: ::c_int = 15;
+pub const KERN_REALROOTDEV: ::c_int = 16;
+pub const KERN_SPARC_REBOOT: ::c_int = 21;
+pub const KERN_CTLALTDEL: ::c_int = 22;
+pub const KERN_PRINTK: ::c_int = 23;
+pub const KERN_NAMETRANS: ::c_int = 24;
+pub const KERN_PPC_HTABRECLAIM: ::c_int = 25;
+pub const KERN_PPC_ZEROPAGED: ::c_int = 26;
+pub const KERN_PPC_POWERSAVE_NAP: ::c_int = 27;
+pub const KERN_MODPROBE: ::c_int = 28;
+pub const KERN_SG_BIG_BUFF: ::c_int = 29;
+pub const KERN_ACCT: ::c_int = 30;
+pub const KERN_PPC_L2CR: ::c_int = 31;
+pub const KERN_RTSIGNR: ::c_int = 32;
+pub const KERN_RTSIGMAX: ::c_int = 33;
+pub const KERN_SHMMAX: ::c_int = 34;
+pub const KERN_MSGMAX: ::c_int = 35;
+pub const KERN_MSGMNB: ::c_int = 36;
+pub const KERN_MSGPOOL: ::c_int = 37;
+pub const KERN_SYSRQ: ::c_int = 38;
+pub const KERN_MAX_THREADS: ::c_int = 39;
+pub const KERN_RANDOM: ::c_int = 40;
+pub const KERN_SHMALL: ::c_int = 41;
+pub const KERN_MSGMNI: ::c_int = 42;
+pub const KERN_SEM: ::c_int = 43;
+pub const KERN_SPARC_STOP_A: ::c_int = 44;
+pub const KERN_SHMMNI: ::c_int = 45;
+pub const KERN_OVERFLOWUID: ::c_int = 46;
+pub const KERN_OVERFLOWGID: ::c_int = 47;
+pub const KERN_SHMPATH: ::c_int = 48;
+pub const KERN_HOTPLUG: ::c_int = 49;
+pub const KERN_IEEE_EMULATION_WARNINGS: ::c_int = 50;
+pub const KERN_S390_USER_DEBUG_LOGGING: ::c_int = 51;
+pub const KERN_CORE_USES_PID: ::c_int = 52;
+pub const KERN_TAINTED: ::c_int = 53;
+pub const KERN_CADPID: ::c_int = 54;
+pub const KERN_PIDMAX: ::c_int = 55;
+pub const KERN_CORE_PATTERN: ::c_int = 56;
+pub const KERN_PANIC_ON_OOPS: ::c_int = 57;
+pub const KERN_HPPA_PWRSW: ::c_int = 58;
+pub const KERN_HPPA_UNALIGNED: ::c_int = 59;
+pub const KERN_PRINTK_RATELIMIT: ::c_int = 60;
+pub const KERN_PRINTK_RATELIMIT_BURST: ::c_int = 61;
+pub const KERN_PTY: ::c_int = 62;
+pub const KERN_NGROUPS_MAX: ::c_int = 63;
+pub const KERN_SPARC_SCONS_PWROFF: ::c_int = 64;
+pub const KERN_HZ_TIMER: ::c_int = 65;
+pub const KERN_UNKNOWN_NMI_PANIC: ::c_int = 66;
+pub const KERN_BOOTLOADER_TYPE: ::c_int = 67;
+pub const KERN_RANDOMIZE: ::c_int = 68;
+pub const KERN_SETUID_DUMPABLE: ::c_int = 69;
+pub const KERN_SPIN_RETRY: ::c_int = 70;
+pub const KERN_ACPI_VIDEO_FLAGS: ::c_int = 71;
+pub const KERN_IA64_UNALIGNED: ::c_int = 72;
+pub const KERN_COMPAT_LOG: ::c_int = 73;
+pub const KERN_MAX_LOCK_DEPTH: ::c_int = 74;
+
+pub const VM_OVERCOMMIT_MEMORY: ::c_int = 5;
+pub const VM_PAGE_CLUSTER: ::c_int = 10;
+pub const VM_DIRTY_BACKGROUND: ::c_int = 11;
+pub const VM_DIRTY_RATIO: ::c_int = 12;
+pub const VM_DIRTY_WB_CS: ::c_int = 13;
+pub const VM_DIRTY_EXPIRE_CS: ::c_int = 14;
+pub const VM_NR_PDFLUSH_THREADS: ::c_int = 15;
+pub const VM_OVERCOMMIT_RATIO: ::c_int = 16;
+pub const VM_PAGEBUF: ::c_int = 17;
+pub const VM_HUGETLB_PAGES: ::c_int = 18;
+pub const VM_SWAPPINESS: ::c_int = 19;
+pub const VM_LOWMEM_RESERVE_RATIO: ::c_int = 20;
+pub const VM_MIN_FREE_KBYTES: ::c_int = 21;
+pub const VM_MAX_MAP_COUNT: ::c_int = 22;
+pub const VM_LAPTOP_MODE: ::c_int = 23;
+pub const VM_BLOCK_DUMP: ::c_int = 24;
+pub const VM_HUGETLB_GROUP: ::c_int = 25;
+pub const VM_VFS_CACHE_PRESSURE: ::c_int = 26;
+pub const VM_LEGACY_VA_LAYOUT: ::c_int = 27;
+pub const VM_SWAP_TOKEN_TIMEOUT: ::c_int = 28;
+pub const VM_DROP_PAGECACHE: ::c_int = 29;
+pub const VM_PERCPU_PAGELIST_FRACTION: ::c_int = 30;
+pub const VM_ZONE_RECLAIM_MODE: ::c_int = 31;
+pub const VM_MIN_UNMAPPED: ::c_int = 32;
+pub const VM_PANIC_ON_OOM: ::c_int = 33;
+pub const VM_VDSO_ENABLED: ::c_int = 34;
+
+pub const NET_CORE: ::c_int = 1;
+pub const NET_ETHER: ::c_int = 2;
+pub const NET_802: ::c_int = 3;
+pub const NET_UNIX: ::c_int = 4;
+pub const NET_IPV4: ::c_int = 5;
+pub const NET_IPX: ::c_int = 6;
+pub const NET_ATALK: ::c_int = 7;
+pub const NET_NETROM: ::c_int = 8;
+pub const NET_AX25: ::c_int = 9;
+pub const NET_BRIDGE: ::c_int = 10;
+pub const NET_ROSE: ::c_int = 11;
+pub const NET_IPV6: ::c_int = 12;
+pub const NET_X25: ::c_int = 13;
+pub const NET_TR: ::c_int = 14;
+pub const NET_DECNET: ::c_int = 15;
+pub const NET_ECONET: ::c_int = 16;
+pub const NET_SCTP: ::c_int = 17;
+pub const NET_LLC: ::c_int = 18;
+pub const NET_NETFILTER: ::c_int = 19;
+pub const NET_DCCP: ::c_int = 20;
+pub const HUGETLB_FLAG_ENCODE_SHIFT: ::c_int = 26;
+pub const MAP_HUGE_SHIFT: ::c_int = HUGETLB_FLAG_ENCODE_SHIFT;
+
+// include/linux/sched.h
+pub const PF_VCPU: ::c_int = 0x00000001;
+pub const PF_IDLE: ::c_int = 0x00000002;
+pub const PF_EXITING: ::c_int = 0x00000004;
+pub const PF_POSTCOREDUMP: ::c_int = 0x00000008;
+pub const PF_IO_WORKER: ::c_int = 0x00000010;
+pub const PF_WQ_WORKER: ::c_int = 0x00000020;
+pub const PF_FORKNOEXEC: ::c_int = 0x00000040;
+pub const PF_MCE_PROCESS: ::c_int = 0x00000080;
+pub const PF_SUPERPRIV: ::c_int = 0x00000100;
+pub const PF_DUMPCORE: ::c_int = 0x00000200;
+pub const PF_SIGNALED: ::c_int = 0x00000400;
+pub const PF_MEMALLOC: ::c_int = 0x00000800;
+pub const PF_NPROC_EXCEEDED: ::c_int = 0x00001000;
+pub const PF_USED_MATH: ::c_int = 0x00002000;
+pub const PF_USER_WORKER: ::c_int = 0x00004000;
+pub const PF_NOFREEZE: ::c_int = 0x00008000;
+
+pub const PF_KSWAPD: ::c_int = 0x00020000;
+pub const PF_MEMALLOC_NOFS: ::c_int = 0x00040000;
+pub const PF_MEMALLOC_NOIO: ::c_int = 0x00080000;
+pub const PF_LOCAL_THROTTLE: ::c_int = 0x00100000;
+pub const PF_KTHREAD: ::c_int = 0x00200000;
+pub const PF_RANDOMIZE: ::c_int = 0x00400000;
+
+pub const PF_NO_SETAFFINITY: ::c_int = 0x04000000;
+pub const PF_MCE_EARLY: ::c_int = 0x08000000;
+pub const PF_MEMALLOC_PIN: ::c_int = 0x10000000;
+
+pub const PF_SUSPEND_TASK: ::c_int = 0x80000000;
+
+// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the
+// following are only available on newer Linux versions than the versions
+// currently used in CI in some configurations, so we define them here.
+cfg_if! {
+    if #[cfg(not(target_arch = "s390x"))] {
+        pub const XFS_SUPER_MAGIC: ::c_long = 0x58465342;
+    } else if #[cfg(target_arch = "s390x")] {
+        pub const XFS_SUPER_MAGIC: ::c_uint = 0x58465342;
+    }
+}
+
+f! {
+    pub fn CMSG_NXTHDR(mhdr: *const msghdr,
+                       cmsg: *const cmsghdr) -> *mut cmsghdr {
+        let next = (cmsg as usize
+                    + super::CMSG_ALIGN((*cmsg).cmsg_len as usize))
+            as *mut cmsghdr;
+        let max = (*mhdr).msg_control as usize
+            + (*mhdr).msg_controllen as usize;
+        if (next.offset(1)) as usize > max {
+            0 as *mut cmsghdr
+        } else {
+            next as *mut cmsghdr
+        }
+    }
+
+    pub fn CPU_ALLOC_SIZE(count: ::c_int) -> ::size_t {
+        let _dummy: cpu_set_t = ::mem::zeroed();
+        let size_in_bits = 8 * ::mem::size_of_val(&_dummy.__bits[0]);
+        ((count as ::size_t + size_in_bits - 1) / 8) as ::size_t
+    }
+
+    pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
+        for slot in cpuset.__bits.iter_mut() {
+            *slot = 0;
+        }
+    }
+
+    pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
+        let size_in_bits
+            = 8 * ::mem::size_of_val(&cpuset.__bits[0]); // 32, 64 etc
+        let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
+        cpuset.__bits[idx] |= 1 << offset;
+        ()
+    }
+
+    pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
+        let size_in_bits
+            = 8 * ::mem::size_of_val(&cpuset.__bits[0]); // 32, 64 etc
+        let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
+        cpuset.__bits[idx] &= !(1 << offset);
+        ()
+    }
+
+    pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {
+        let size_in_bits = 8 * ::mem::size_of_val(&cpuset.__bits[0]);
+        let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
+        0 != (cpuset.__bits[idx] & (1 << offset))
+    }
+
+    pub fn CPU_COUNT_S(size: usize, cpuset: &cpu_set_t) -> ::c_int {
+        let mut s: u32 = 0;
+        let size_of_mask = ::mem::size_of_val(&cpuset.__bits[0]);
+        for i in cpuset.__bits[..(size / size_of_mask)].iter() {
+            s += i.count_ones();
+        };
+        s as ::c_int
+    }
+
+    pub fn CPU_COUNT(cpuset: &cpu_set_t) -> ::c_int {
+        CPU_COUNT_S(::mem::size_of::<cpu_set_t>(), cpuset)
+    }
+
+    pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
+        set1.__bits == set2.__bits
+    }
+
+    pub fn major(dev: ::dev_t) -> ::c_int {
+        ((dev >> 8) & 0xfff) as ::c_int
+    }
+    pub fn minor(dev: ::dev_t) -> ::c_int {
+        ((dev & 0xff) | ((dev >> 12) & 0xfff00)) as ::c_int
+    }
+    pub fn NLA_ALIGN(len: ::c_int) -> ::c_int {
+        return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1)
+    }
+
+    pub fn SO_EE_OFFENDER(ee: *const ::sock_extended_err) -> *mut ::sockaddr {
+        ee.offset(1) as *mut ::sockaddr
+    }
+}
+
+safe_f! {
+    pub {const} fn makedev(ma: ::c_uint, mi: ::c_uint) -> ::dev_t {
+        let ma = ma as ::dev_t;
+        let mi = mi as ::dev_t;
+        ((ma & 0xfff) << 8) | (mi & 0xff) | ((mi & 0xfff00) << 12)
+    }
+
+}
+
+extern "C" {
+    pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int;
+    pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int;
+    pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
+    pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
+    pub fn prlimit(
+        pid: ::pid_t,
+        resource: ::c_int,
+        new_limit: *const ::rlimit,
+        old_limit: *mut ::rlimit,
+    ) -> ::c_int;
+    pub fn prlimit64(
+        pid: ::pid_t,
+        resource: ::c_int,
+        new_limit: *const ::rlimit64,
+        old_limit: *mut ::rlimit64,
+    ) -> ::c_int;
+    pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
+
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
+    pub fn mlock2(addr: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+    pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+    pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
+    pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+    pub fn recvfrom(
+        socket: ::c_int,
+        buf: *mut ::c_void,
+        len: ::size_t,
+        flags: ::c_int,
+        addr: *mut ::sockaddr,
+        addrlen: *mut ::socklen_t,
+    ) -> ::ssize_t;
+    pub fn getnameinfo(
+        sa: *const ::sockaddr,
+        salen: ::socklen_t,
+        host: *mut ::c_char,
+        hostlen: ::size_t,
+        serv: *mut ::c_char,
+        servlen: ::size_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn preadv(fd: ::c_int, iov: *const ::iovec, count: ::c_int, offset: ::off_t) -> ::ssize_t;
+    pub fn pwritev(fd: ::c_int, iov: *const ::iovec, count: ::c_int, offset: ::off_t) -> ::ssize_t;
+    pub fn process_vm_readv(
+        pid: ::pid_t,
+        local_iov: *const ::iovec,
+        local_iov_count: ::c_ulong,
+        remote_iov: *const ::iovec,
+        remote_iov_count: ::c_ulong,
+        flags: ::c_ulong,
+    ) -> ::ssize_t;
+    pub fn process_vm_writev(
+        pid: ::pid_t,
+        local_iov: *const ::iovec,
+        local_iov_count: ::c_ulong,
+        remote_iov: *const ::iovec,
+        remote_iov_count: ::c_ulong,
+        flags: ::c_ulong,
+    ) -> ::ssize_t;
+    pub fn ptrace(request: ::c_int, ...) -> ::c_long;
+    pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
+    pub fn __sched_cpualloc(count: ::size_t) -> *mut ::cpu_set_t;
+    pub fn __sched_cpufree(set: *mut ::cpu_set_t);
+    pub fn __sched_cpucount(setsize: ::size_t, set: *const cpu_set_t) -> ::c_int;
+    pub fn sched_getcpu() -> ::c_int;
+    pub fn mallinfo() -> ::mallinfo;
+    // available from API 23
+    pub fn malloc_info(options: ::c_int, stream: *mut ::FILE) -> ::c_int;
+
+    pub fn malloc_usable_size(ptr: *const ::c_void) -> ::size_t;
+
+    pub fn utmpname(name: *const ::c_char) -> ::c_int;
+    pub fn setutent();
+    pub fn getutent() -> *mut utmp;
+
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+    pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
+    pub fn fallocate(fd: ::c_int, mode: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+    pub fn fallocate64(fd: ::c_int, mode: ::c_int, offset: ::off64_t, len: ::off64_t) -> ::c_int;
+    pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+    pub fn posix_fallocate64(fd: ::c_int, offset: ::off64_t, len: ::off64_t) -> ::c_int;
+    pub fn getxattr(
+        path: *const c_char,
+        name: *const c_char,
+        value: *mut ::c_void,
+        size: ::size_t,
+    ) -> ::ssize_t;
+    pub fn lgetxattr(
+        path: *const c_char,
+        name: *const c_char,
+        value: *mut ::c_void,
+        size: ::size_t,
+    ) -> ::ssize_t;
+    pub fn fgetxattr(
+        filedes: ::c_int,
+        name: *const c_char,
+        value: *mut ::c_void,
+        size: ::size_t,
+    ) -> ::ssize_t;
+    pub fn setxattr(
+        path: *const c_char,
+        name: *const c_char,
+        value: *const ::c_void,
+        size: ::size_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn lsetxattr(
+        path: *const c_char,
+        name: *const c_char,
+        value: *const ::c_void,
+        size: ::size_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn fsetxattr(
+        filedes: ::c_int,
+        name: *const c_char,
+        value: *const ::c_void,
+        size: ::size_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn listxattr(path: *const c_char, list: *mut c_char, size: ::size_t) -> ::ssize_t;
+    pub fn llistxattr(path: *const c_char, list: *mut c_char, size: ::size_t) -> ::ssize_t;
+    pub fn flistxattr(filedes: ::c_int, list: *mut c_char, size: ::size_t) -> ::ssize_t;
+    pub fn removexattr(path: *const c_char, name: *const c_char) -> ::c_int;
+    pub fn lremovexattr(path: *const c_char, name: *const c_char) -> ::c_int;
+    pub fn fremovexattr(filedes: ::c_int, name: *const c_char) -> ::c_int;
+    pub fn signalfd(fd: ::c_int, mask: *const ::sigset_t, flags: ::c_int) -> ::c_int;
+    pub fn timerfd_create(clock: ::clockid_t, flags: ::c_int) -> ::c_int;
+    pub fn timerfd_gettime(fd: ::c_int, current_value: *mut itimerspec) -> ::c_int;
+    pub fn timerfd_settime(
+        fd: ::c_int,
+        flags: ::c_int,
+        new_value: *const itimerspec,
+        old_value: *mut itimerspec,
+    ) -> ::c_int;
+    pub fn syscall(num: ::c_long, ...) -> ::c_long;
+    pub fn sched_getaffinity(pid: ::pid_t, cpusetsize: ::size_t, cpuset: *mut cpu_set_t)
+        -> ::c_int;
+    pub fn sched_setaffinity(
+        pid: ::pid_t,
+        cpusetsize: ::size_t,
+        cpuset: *const cpu_set_t,
+    ) -> ::c_int;
+    pub fn epoll_create(size: ::c_int) -> ::c_int;
+    pub fn epoll_create1(flags: ::c_int) -> ::c_int;
+    pub fn epoll_wait(
+        epfd: ::c_int,
+        events: *mut ::epoll_event,
+        maxevents: ::c_int,
+        timeout: ::c_int,
+    ) -> ::c_int;
+    pub fn epoll_ctl(epfd: ::c_int, op: ::c_int, fd: ::c_int, event: *mut ::epoll_event)
+        -> ::c_int;
+    pub fn pthread_getschedparam(
+        native: ::pthread_t,
+        policy: *mut ::c_int,
+        param: *mut ::sched_param,
+    ) -> ::c_int;
+    pub fn unshare(flags: ::c_int) -> ::c_int;
+    pub fn umount(target: *const ::c_char) -> ::c_int;
+    pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
+    pub fn tee(fd_in: ::c_int, fd_out: ::c_int, len: ::size_t, flags: ::c_uint) -> ::ssize_t;
+    pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
+    pub fn splice(
+        fd_in: ::c_int,
+        off_in: *mut ::loff_t,
+        fd_out: ::c_int,
+        off_out: *mut ::loff_t,
+        len: ::size_t,
+        flags: ::c_uint,
+    ) -> ::ssize_t;
+    pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
+    pub fn eventfd_read(fd: ::c_int, value: *mut eventfd_t) -> ::c_int;
+    pub fn eventfd_write(fd: ::c_int, value: eventfd_t) -> ::c_int;
+    pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
+    pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
+    pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
+    pub fn setns(fd: ::c_int, nstype: ::c_int) -> ::c_int;
+    pub fn swapoff(puath: *const ::c_char) -> ::c_int;
+    pub fn vmsplice(
+        fd: ::c_int,
+        iov: *const ::iovec,
+        nr_segs: ::size_t,
+        flags: ::c_uint,
+    ) -> ::ssize_t;
+    pub fn mount(
+        src: *const ::c_char,
+        target: *const ::c_char,
+        fstype: *const ::c_char,
+        flags: ::c_ulong,
+        data: *const ::c_void,
+    ) -> ::c_int;
+    pub fn personality(persona: ::c_uint) -> ::c_int;
+    pub fn prctl(option: ::c_int, ...) -> ::c_int;
+    pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int;
+    pub fn ppoll(
+        fds: *mut ::pollfd,
+        nfds: nfds_t,
+        timeout: *const ::timespec,
+        sigmask: *const sigset_t,
+    ) -> ::c_int;
+    pub fn pthread_mutex_timedlock(
+        lock: *mut pthread_mutex_t,
+        abstime: *const ::timespec,
+    ) -> ::c_int;
+    pub fn pthread_barrierattr_init(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_destroy(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_getpshared(
+        attr: *const ::pthread_barrierattr_t,
+        shared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrierattr_setpshared(
+        attr: *mut ::pthread_barrierattr_t,
+        shared: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrier_init(
+        barrier: *mut pthread_barrier_t,
+        attr: *const ::pthread_barrierattr_t,
+        count: ::c_uint,
+    ) -> ::c_int;
+    pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> ::c_int;
+    pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> ::c_int;
+    pub fn pthread_spin_init(lock: *mut ::pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
+    pub fn pthread_spin_destroy(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_lock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_trylock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_unlock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+    pub fn clone(
+        cb: extern "C" fn(*mut ::c_void) -> ::c_int,
+        child_stack: *mut ::c_void,
+        flags: ::c_int,
+        arg: *mut ::c_void,
+        ...
+    ) -> ::c_int;
+    pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
+    pub fn clock_nanosleep(
+        clk_id: ::clockid_t,
+        flags: ::c_int,
+        rqtp: *const ::timespec,
+        rmtp: *mut ::timespec,
+    ) -> ::c_int;
+    pub fn pthread_attr_getguardsize(
+        attr: *const ::pthread_attr_t,
+        guardsize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
+    pub fn pthread_attr_getinheritsched(
+        attr: *const ::pthread_attr_t,
+        flag: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_attr_setinheritsched(attr: *mut ::pthread_attr_t, flag: ::c_int) -> ::c_int;
+    pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
+    pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
+    pub fn pthread_condattr_getpshared(
+        attr: *const pthread_condattr_t,
+        pshared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn sysinfo(info: *mut ::sysinfo) -> ::c_int;
+    pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int;
+    pub fn pthread_setschedparam(
+        native: ::pthread_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int;
+    pub fn sched_setscheduler(
+        pid: ::pid_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn sendfile(
+        out_fd: ::c_int,
+        in_fd: ::c_int,
+        offset: *mut ::off_t,
+        count: ::size_t,
+    ) -> ::ssize_t;
+    pub fn sendfile64(
+        out_fd: ::c_int,
+        in_fd: ::c_int,
+        offset: *mut ::off64_t,
+        count: ::size_t,
+    ) -> ::ssize_t;
+    pub fn setfsgid(gid: ::gid_t) -> ::c_int;
+    pub fn setfsuid(uid: ::uid_t) -> ::c_int;
+    pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
+    pub fn sem_close(sem: *mut sem_t) -> ::c_int;
+    pub fn getgrnam_r(
+        name: *const ::c_char,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
+    pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
+    pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
+    pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
+    pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
+    pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
+    pub fn getpwnam_r(
+        name: *const ::c_char,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+    pub fn getpwuid_r(
+        uid: ::uid_t,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+    pub fn sigtimedwait(
+        set: *const sigset_t,
+        info: *mut siginfo_t,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
+    pub fn pthread_atfork(
+        prepare: ::Option<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+    pub fn getgrouplist(
+        user: *const ::c_char,
+        group: ::gid_t,
+        groups: *mut ::gid_t,
+        ngroups: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int;
+    pub fn pthread_mutexattr_getpshared(
+        attr: *const pthread_mutexattr_t,
+        pshared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
+    pub fn faccessat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::c_int,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_create(
+        native: *mut ::pthread_t,
+        attr: *const ::pthread_attr_t,
+        f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
+        value: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn __errno() -> *mut ::c_int;
+    pub fn inotify_rm_watch(fd: ::c_int, wd: u32) -> ::c_int;
+    pub fn sendmmsg(
+        sockfd: ::c_int,
+        msgvec: *const ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn recvmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_int,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn inotify_init() -> ::c_int;
+    pub fn inotify_init1(flags: ::c_int) -> ::c_int;
+    pub fn inotify_add_watch(fd: ::c_int, path: *const ::c_char, mask: u32) -> ::c_int;
+
+    pub fn regcomp(preg: *mut ::regex_t, pattern: *const ::c_char, cflags: ::c_int) -> ::c_int;
+
+    pub fn regexec(
+        preg: *const ::regex_t,
+        input: *const ::c_char,
+        nmatch: ::size_t,
+        pmatch: *mut regmatch_t,
+        eflags: ::c_int,
+    ) -> ::c_int;
+
+    pub fn regerror(
+        errcode: ::c_int,
+        preg: *const ::regex_t,
+        errbuf: *mut ::c_char,
+        errbuf_size: ::size_t,
+    ) -> ::size_t;
+
+    pub fn regfree(preg: *mut ::regex_t);
+
+    pub fn android_set_abort_message(msg: *const ::c_char);
+
+    pub fn gettid() -> ::pid_t;
+
+    /// Only available in API Version 28+
+    pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+    pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
+
+    pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
+
+    pub fn __system_property_set(__name: *const ::c_char, __value: *const ::c_char) -> ::c_int;
+    pub fn __system_property_get(__name: *const ::c_char, __value: *mut ::c_char) -> ::c_int;
+    pub fn __system_property_find(__name: *const ::c_char) -> *const prop_info;
+    pub fn __system_property_find_nth(__n: ::c_uint) -> *const prop_info;
+    pub fn __system_property_foreach(
+        __callback: unsafe extern "C" fn(__pi: *const prop_info, __cookie: *mut ::c_void),
+        __cookie: *mut ::c_void,
+    ) -> ::c_int;
+
+    // #include <link.h>
+    /// Only available in API Version 21+
+    pub fn dl_iterate_phdr(
+        callback: ::Option<
+            unsafe extern "C" fn(
+                info: *mut dl_phdr_info,
+                size: usize,
+                data: *mut ::c_void,
+            ) -> ::c_int,
+        >,
+        data: *mut ::c_void,
+    ) -> ::c_int;
+
+    pub fn arc4random() -> u32;
+    pub fn arc4random_uniform(__upper_bound: u32) -> u32;
+    pub fn arc4random_buf(__buf: *mut ::c_void, __n: ::size_t);
+
+    pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
+
+    pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int;
+
+    pub fn dirname(path: *const ::c_char) -> *mut ::c_char;
+    pub fn basename(path: *const ::c_char) -> *mut ::c_char;
+    pub fn getopt_long(
+        argc: ::c_int,
+        argv: *const *mut c_char,
+        optstring: *const c_char,
+        longopts: *const option,
+        longindex: *mut ::c_int,
+    ) -> ::c_int;
+
+    pub fn sync();
+    pub fn syncfs(fd: ::c_int) -> ::c_int;
+
+    pub fn memmem(
+        haystack: *const ::c_void,
+        haystacklen: ::size_t,
+        needle: *const ::c_void,
+        needlelen: ::size_t,
+    ) -> *mut ::c_void;
+    pub fn fread_unlocked(
+        buf: *mut ::c_void,
+        size: ::size_t,
+        nobj: ::size_t,
+        stream: *mut ::FILE,
+    ) -> ::size_t;
+    pub fn fwrite_unlocked(
+        buf: *const ::c_void,
+        size: ::size_t,
+        nobj: ::size_t,
+        stream: *mut ::FILE,
+    ) -> ::size_t;
+    pub fn fflush_unlocked(stream: *mut ::FILE) -> ::c_int;
+    pub fn fgets_unlocked(buf: *mut ::c_char, size: ::c_int, stream: *mut ::FILE) -> *mut ::c_char;
+}
+
+cfg_if! {
+    if #[cfg(target_pointer_width = "32")] {
+        mod b32;
+        pub use self::b32::*;
+    } else if #[cfg(target_pointer_width = "64")] {
+        mod b64;
+        pub use self::b64::*;
+    } else {
+        // Unknown target_pointer_width
+    }
+}
+
+impl siginfo_t {
+    pub unsafe fn si_addr(&self) -> *mut ::c_void {
+        #[repr(C)]
+        struct siginfo_sigfault {
+            _si_signo: ::c_int,
+            _si_errno: ::c_int,
+            _si_code: ::c_int,
+            si_addr: *mut ::c_void,
+        }
+        (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr
+    }
+
+    pub unsafe fn si_value(&self) -> ::sigval {
+        #[repr(C)]
+        struct siginfo_timer {
+            _si_signo: ::c_int,
+            _si_errno: ::c_int,
+            _si_code: ::c_int,
+            _si_tid: ::c_int,
+            _si_overrun: ::c_int,
+            si_sigval: ::sigval,
+        }
+        (*(self as *const siginfo_t as *const siginfo_timer)).si_sigval
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        // Internal, for casts to access union fields
+        #[repr(C)]
+        struct sifields_sigchld {
+            si_pid: ::pid_t,
+            si_uid: ::uid_t,
+            si_status: ::c_int,
+            si_utime: ::c_long,
+            si_stime: ::c_long,
+        }
+        impl ::Copy for sifields_sigchld {}
+        impl ::Clone for sifields_sigchld {
+            fn clone(&self) -> sifields_sigchld {
+                *self
+            }
+        }
+
+        // Internal, for casts to access union fields
+        #[repr(C)]
+        union sifields {
+            _align_pointer: *mut ::c_void,
+            sigchld: sifields_sigchld,
+        }
+
+        // Internal, for casts to access union fields. Note that some variants
+        // of sifields start with a pointer, which makes the alignment of
+        // sifields vary on 32-bit and 64-bit architectures.
+        #[repr(C)]
+        struct siginfo_f {
+            _siginfo_base: [::c_int; 3],
+            sifields: sifields,
+        }
+
+        impl siginfo_t {
+            unsafe fn sifields(&self) -> &sifields {
+                &(*(self as *const siginfo_t as *const siginfo_f)).sifields
+            }
+
+            pub unsafe fn si_pid(&self) -> ::pid_t {
+                self.sifields().sigchld.si_pid
+            }
+
+            pub unsafe fn si_uid(&self) -> ::uid_t {
+                self.sifields().sigchld.si_uid
+            }
+
+            pub unsafe fn si_status(&self) -> ::c_int {
+                self.sifields().sigchld.si_status
+            }
+
+            pub unsafe fn si_utime(&self) -> ::c_long {
+                self.sifields().sigchld.si_utime
+            }
+
+            pub unsafe fn si_stime(&self) -> ::c_long {
+                self.sifields().sigchld.si_stime
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/emscripten/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/emscripten/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/emscripten/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/emscripten/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,74 @@
+macro_rules! expand_align {
+    () => {
+        s! {
+            #[allow(missing_debug_implementations)]
+            #[repr(align(4))]
+            pub struct pthread_mutex_t {
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
+            }
+
+            #[repr(align(4))]
+            pub struct pthread_rwlock_t {
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
+            }
+
+            #[repr(align(4))]
+            pub struct pthread_mutexattr_t {
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
+            }
+
+            #[repr(align(4))]
+            pub struct pthread_rwlockattr_t {
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
+            }
+
+            #[repr(align(4))]
+            pub struct pthread_condattr_t {
+                size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
+            }
+        }
+
+        s_no_extra_traits! {
+            #[cfg_attr(target_pointer_width = "32",
+                       repr(align(4)))]
+            #[cfg_attr(target_pointer_width = "64",
+                       repr(align(8)))]
+            pub struct pthread_cond_t {
+                size: [u8; ::__SIZEOF_PTHREAD_COND_T],
+            }
+
+            #[allow(missing_debug_implementations)]
+            #[repr(align(16))]
+            pub struct max_align_t {
+                priv_: [f64; 4]
+            }
+
+        }
+
+        cfg_if! {
+            if #[cfg(feature = "extra_traits")] {
+                impl PartialEq for pthread_cond_t {
+                    fn eq(&self, other: &pthread_cond_t) -> bool {
+                        self.size
+                            .iter()
+                            .zip(other.size.iter())
+                            .all(|(a,b)| a == b)
+                    }
+                }
+                impl Eq for pthread_cond_t {}
+                impl ::fmt::Debug for pthread_cond_t {
+                    fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                        f.debug_struct("pthread_cond_t")
+                            // FIXME: .field("size", &self.size)
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for pthread_cond_t {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        self.size.hash(state);
+                    }
+                }
+            }
+        }
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/emscripten/lfs64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/emscripten/lfs64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/emscripten/lfs64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/emscripten/lfs64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,213 @@
+// In-sync with ../linux/musl/lfs64.rs except for fallocate64, prlimit64 and sendfile64
+
+#[inline]
+pub unsafe extern "C" fn creat64(path: *const ::c_char, mode: ::mode_t) -> ::c_int {
+    ::creat(path, mode)
+}
+
+#[inline]
+pub unsafe extern "C" fn fgetpos64(stream: *mut ::FILE, pos: *mut ::fpos64_t) -> ::c_int {
+    ::fgetpos(stream, pos as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn fopen64(pathname: *const ::c_char, mode: *const ::c_char) -> *mut ::FILE {
+    ::fopen(pathname, mode)
+}
+
+#[inline]
+pub unsafe extern "C" fn freopen64(
+    pathname: *const ::c_char,
+    mode: *const ::c_char,
+    stream: *mut ::FILE,
+) -> *mut ::FILE {
+    ::freopen(pathname, mode, stream)
+}
+
+#[inline]
+pub unsafe extern "C" fn fseeko64(
+    stream: *mut ::FILE,
+    offset: ::off64_t,
+    whence: ::c_int,
+) -> ::c_int {
+    ::fseeko(stream, offset, whence)
+}
+
+#[inline]
+pub unsafe extern "C" fn fsetpos64(stream: *mut ::FILE, pos: *const ::fpos64_t) -> ::c_int {
+    ::fsetpos(stream, pos as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn fstat64(fildes: ::c_int, buf: *mut ::stat64) -> ::c_int {
+    ::fstat(fildes, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn fstatat64(
+    fd: ::c_int,
+    path: *const ::c_char,
+    buf: *mut ::stat64,
+    flag: ::c_int,
+) -> ::c_int {
+    ::fstatat(fd, path, buf as *mut _, flag)
+}
+
+#[inline]
+pub unsafe extern "C" fn fstatfs64(fd: ::c_int, buf: *mut ::statfs64) -> ::c_int {
+    ::fstatfs(fd, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn fstatvfs64(fd: ::c_int, buf: *mut ::statvfs64) -> ::c_int {
+    ::fstatvfs(fd, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn ftello64(stream: *mut ::FILE) -> ::off64_t {
+    ::ftello(stream)
+}
+
+#[inline]
+pub unsafe extern "C" fn ftruncate64(fd: ::c_int, length: ::off64_t) -> ::c_int {
+    ::ftruncate(fd, length)
+}
+
+#[inline]
+pub unsafe extern "C" fn getrlimit64(resource: ::c_int, rlim: *mut ::rlimit64) -> ::c_int {
+    ::getrlimit(resource, rlim as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn lseek64(fd: ::c_int, offset: ::off64_t, whence: ::c_int) -> ::off64_t {
+    ::lseek(fd, offset, whence)
+}
+
+#[inline]
+pub unsafe extern "C" fn lstat64(path: *const ::c_char, buf: *mut ::stat64) -> ::c_int {
+    ::lstat(path, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn mmap64(
+    addr: *mut ::c_void,
+    length: ::size_t,
+    prot: ::c_int,
+    flags: ::c_int,
+    fd: ::c_int,
+    offset: ::off64_t,
+) -> *mut ::c_void {
+    ::mmap(addr, length, prot, flags, fd, offset)
+}
+
+// These functions are variadic in the C ABI since the `mode` argument is "optional".  Variadic
+// `extern "C"` functions are unstable in Rust so we cannot write a shim function for these
+// entrypoints.  See https://github.com/rust-lang/rust/issues/44930.
+//
+// These aliases are mostly fine though, neither function takes a LFS64-namespaced type as an
+// argument, nor do their names clash with any declared types.
+pub use open as open64;
+pub use openat as openat64;
+
+#[inline]
+pub unsafe extern "C" fn posix_fadvise64(
+    fd: ::c_int,
+    offset: ::off64_t,
+    len: ::off64_t,
+    advice: ::c_int,
+) -> ::c_int {
+    ::posix_fadvise(fd, offset, len, advice)
+}
+
+#[inline]
+pub unsafe extern "C" fn posix_fallocate64(
+    fd: ::c_int,
+    offset: ::off64_t,
+    len: ::off64_t,
+) -> ::c_int {
+    ::posix_fallocate(fd, offset, len)
+}
+
+#[inline]
+pub unsafe extern "C" fn pread64(
+    fd: ::c_int,
+    buf: *mut ::c_void,
+    count: ::size_t,
+    offset: ::off64_t,
+) -> ::ssize_t {
+    ::pread(fd, buf, count, offset)
+}
+
+#[inline]
+pub unsafe extern "C" fn preadv64(
+    fd: ::c_int,
+    iov: *const ::iovec,
+    iovcnt: ::c_int,
+    offset: ::off64_t,
+) -> ::ssize_t {
+    ::preadv(fd, iov, iovcnt, offset)
+}
+
+#[inline]
+pub unsafe extern "C" fn pwrite64(
+    fd: ::c_int,
+    buf: *const ::c_void,
+    count: ::size_t,
+    offset: ::off64_t,
+) -> ::ssize_t {
+    ::pwrite(fd, buf, count, offset)
+}
+
+#[inline]
+pub unsafe extern "C" fn pwritev64(
+    fd: ::c_int,
+    iov: *const ::iovec,
+    iovcnt: ::c_int,
+    offset: ::off64_t,
+) -> ::ssize_t {
+    ::pwritev(fd, iov, iovcnt, offset)
+}
+
+#[inline]
+pub unsafe extern "C" fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64 {
+    ::readdir(dirp) as *mut _
+}
+
+#[inline]
+pub unsafe extern "C" fn readdir64_r(
+    dirp: *mut ::DIR,
+    entry: *mut ::dirent64,
+    result: *mut *mut ::dirent64,
+) -> ::c_int {
+    ::readdir_r(dirp, entry as *mut _, result as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn setrlimit64(resource: ::c_int, rlim: *const ::rlimit64) -> ::c_int {
+    ::setrlimit(resource, rlim as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn stat64(pathname: *const ::c_char, statbuf: *mut ::stat64) -> ::c_int {
+    ::stat(pathname, statbuf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn statfs64(pathname: *const ::c_char, buf: *mut ::statfs64) -> ::c_int {
+    ::statfs(pathname, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn statvfs64(path: *const ::c_char, buf: *mut ::statvfs64) -> ::c_int {
+    ::statvfs(path, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn tmpfile64() -> *mut ::FILE {
+    ::tmpfile()
+}
+
+#[inline]
+pub unsafe extern "C" fn truncate64(path: *const ::c_char, length: ::off64_t) -> ::c_int {
+    ::truncate(path, length)
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/emscripten/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/emscripten/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/emscripten/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/emscripten/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1794 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
+pub type useconds_t = u32;
+pub type dev_t = u32;
+pub type socklen_t = u32;
+pub type pthread_t = c_ulong;
+pub type mode_t = u32;
+pub type shmatt_t = ::c_ulong;
+pub type mqd_t = ::c_int;
+pub type msgqnum_t = ::c_ulong;
+pub type msglen_t = ::c_ulong;
+pub type nfds_t = ::c_ulong;
+pub type nl_item = ::c_int;
+pub type idtype_t = ::c_uint;
+pub type loff_t = i64;
+pub type pthread_key_t = ::c_uint;
+
+pub type clock_t = c_long;
+pub type time_t = c_long;
+pub type suseconds_t = c_long;
+pub type ino_t = u64;
+pub type off_t = i64;
+pub type blkcnt_t = i32;
+
+pub type blksize_t = c_long;
+pub type fsblkcnt_t = u32;
+pub type fsfilcnt_t = u32;
+pub type rlim_t = u64;
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type nlink_t = u32;
+
+pub type ino64_t = ::ino_t;
+pub type off64_t = ::off_t;
+pub type blkcnt64_t = ::blkcnt_t;
+pub type rlim64_t = ::rlim_t;
+
+pub type rlimit64 = ::rlimit;
+pub type flock64 = ::flock;
+pub type stat64 = ::stat;
+pub type statfs64 = ::statfs;
+pub type statvfs64 = ::statvfs;
+pub type dirent64 = ::dirent;
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum fpos64_t {} // FIXME: fill this out with a struct
+impl ::Copy for fpos64_t {}
+impl ::Clone for fpos64_t {
+    fn clone(&self) -> fpos64_t {
+        *self
+    }
+}
+
+s! {
+    pub struct glob_t {
+        pub gl_pathc: ::size_t,
+        pub gl_pathv: *mut *mut c_char,
+        pub gl_offs: ::size_t,
+        pub gl_flags: ::c_int,
+
+        __unused1: *mut ::c_void,
+        __unused2: *mut ::c_void,
+        __unused3: *mut ::c_void,
+        __unused4: *mut ::c_void,
+        __unused5: *mut ::c_void,
+    }
+
+    pub struct passwd {
+        pub pw_name: *mut ::c_char,
+        pub pw_passwd: *mut ::c_char,
+        pub pw_uid: ::uid_t,
+        pub pw_gid: ::gid_t,
+        pub pw_gecos: *mut ::c_char,
+        pub pw_dir: *mut ::c_char,
+        pub pw_shell: *mut ::c_char,
+    }
+
+    pub struct spwd {
+        pub sp_namp: *mut ::c_char,
+        pub sp_pwdp: *mut ::c_char,
+        pub sp_lstchg: ::c_long,
+        pub sp_min: ::c_long,
+        pub sp_max: ::c_long,
+        pub sp_warn: ::c_long,
+        pub sp_inact: ::c_long,
+        pub sp_expire: ::c_long,
+        pub sp_flag: ::c_ulong,
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        __f_unused: ::c_int,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct dqblk {
+        pub dqb_bhardlimit: u64,
+        pub dqb_bsoftlimit: u64,
+        pub dqb_curspace: u64,
+        pub dqb_ihardlimit: u64,
+        pub dqb_isoftlimit: u64,
+        pub dqb_curinodes: u64,
+        pub dqb_btime: u64,
+        pub dqb_itime: u64,
+        pub dqb_valid: u32,
+    }
+
+    pub struct signalfd_siginfo {
+        pub ssi_signo: u32,
+        pub ssi_errno: i32,
+        pub ssi_code: i32,
+        pub ssi_pid: u32,
+        pub ssi_uid: u32,
+        pub ssi_fd: i32,
+        pub ssi_tid: u32,
+        pub ssi_band: u32,
+        pub ssi_overrun: u32,
+        pub ssi_trapno: u32,
+        pub ssi_status: i32,
+        pub ssi_int: i32,
+        pub ssi_ptr: u64,
+        pub ssi_utime: u64,
+        pub ssi_stime: u64,
+        pub ssi_addr: u64,
+        pub ssi_addr_lsb: u16,
+        _pad2: u16,
+        pub ssi_syscall: i32,
+        pub ssi_call_addr: u64,
+        pub ssi_arch: u32,
+        _pad: [u8; 28],
+    }
+
+    pub struct fsid_t {
+        __val: [::c_int; 2],
+    }
+
+    pub struct cpu_set_t {
+        bits: [u32; 32],
+    }
+
+    pub struct if_nameindex {
+        pub if_index: ::c_uint,
+        pub if_name: *mut ::c_char,
+    }
+
+    // System V IPC
+    pub struct msginfo {
+        pub msgpool: ::c_int,
+        pub msgmap: ::c_int,
+        pub msgmax: ::c_int,
+        pub msgmnb: ::c_int,
+        pub msgmni: ::c_int,
+        pub msgssz: ::c_int,
+        pub msgtql: ::c_int,
+        pub msgseg: ::c_ushort,
+    }
+
+    pub struct sembuf {
+        pub sem_num: ::c_ushort,
+        pub sem_op: ::c_short,
+        pub sem_flg: ::c_short,
+    }
+
+    pub struct aiocb {
+        pub aio_fildes: ::c_int,
+        pub aio_lio_opcode: ::c_int,
+        pub aio_reqprio: ::c_int,
+        pub aio_buf: *mut ::c_void,
+        pub aio_nbytes: ::size_t,
+        pub aio_sigevent: ::sigevent,
+        __td: *mut ::c_void,
+        __lock: [::c_int; 2],
+        __err: ::c_int,
+        __ret: ::ssize_t,
+        pub aio_offset: off_t,
+        __next: *mut ::c_void,
+        __prev: *mut ::c_void,
+        __dummy4: [::c_char; 24],
+    }
+
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct ipc_perm {
+        pub __ipc_perm_key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_int,
+        __unused1: ::c_long,
+        __unused2: ::c_long
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::NCCS],
+        pub __c_ispeed: ::speed_t,
+        pub __c_ospeed: ::speed_t,
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct pthread_attr_t {
+        __size: [u32; 11]
+    }
+
+    pub struct sigset_t {
+        __val: [::c_ulong; 32],
+    }
+
+    pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: ::socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::c_int,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: ::socklen_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct cmsghdr {
+        pub cmsg_len: ::socklen_t,
+        pub cmsg_level: ::c_int,
+        pub cmsg_type: ::c_int,
+    }
+
+    pub struct sem_t {
+        __val: [::c_int; 4],
+    }
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        #[cfg(not(emscripten_new_stat_abi))]
+        __st_dev_padding: ::c_int,
+        #[cfg(not(emscripten_new_stat_abi))]
+        __st_ino_truncated: ::c_long,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        #[cfg(not(emscripten_new_stat_abi))]
+        __st_rdev_padding: ::c_int,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_ino: ::ino_t,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        __unused1: ::c_int,
+        pub shm_dtime: ::time_t,
+        __unused2: ::c_int,
+        pub shm_ctime: ::time_t,
+        __unused3: ::c_int,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::c_ulong,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __unused1: ::c_int,
+        pub msg_rtime: ::time_t,
+        __unused2: ::c_int,
+        pub msg_ctime: ::time_t,
+        __unused3: ::c_int,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 4],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        pub _pad: [::c_int; 29],
+        _align: [usize; 0],
+    }
+
+    pub struct arpd_request {
+        pub req: ::c_ushort,
+        pub ip: u32,
+        pub dev: ::c_ulong,
+        pub stamp: ::c_ulong,
+        pub updated: ::c_ulong,
+        pub ha: [::c_uchar; ::MAX_ADDR_LEN],
+    }
+}
+
+s_no_extra_traits! {
+    pub struct dirent {
+        pub d_ino: ::ino_t,
+        pub d_off: ::off_t,
+        pub d_reclen: ::c_ushort,
+        pub d_type: ::c_uchar,
+        pub d_name: [::c_char; 256],
+    }
+
+    pub struct sysinfo {
+        pub uptime: ::c_ulong,
+        pub loads: [::c_ulong; 3],
+        pub totalram: ::c_ulong,
+        pub freeram: ::c_ulong,
+        pub sharedram: ::c_ulong,
+        pub bufferram: ::c_ulong,
+        pub totalswap: ::c_ulong,
+        pub freeswap: ::c_ulong,
+        pub procs: ::c_ushort,
+        pub pad: ::c_ushort,
+        pub totalhigh: ::c_ulong,
+        pub freehigh: ::c_ulong,
+        pub mem_unit: ::c_uint,
+        pub __reserved: [::c_char; 256],
+    }
+
+    pub struct mq_attr {
+        pub mq_flags: ::c_long,
+        pub mq_maxmsg: ::c_long,
+        pub mq_msgsize: ::c_long,
+        pub mq_curmsgs: ::c_long,
+        pad: [::c_long; 4]
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for dirent {
+            fn eq(&self, other: &dirent) -> bool {
+                self.d_ino == other.d_ino
+                    && self.d_off == other.d_off
+                    && self.d_reclen == other.d_reclen
+                    && self.d_type == other.d_type
+                    && self
+                    .d_name
+                    .iter()
+                    .zip(other.d_name.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for dirent {}
+        impl ::fmt::Debug for dirent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("dirent")
+                    .field("d_ino", &self.d_ino)
+                    .field("d_off", &self.d_off)
+                    .field("d_reclen", &self.d_reclen)
+                    .field("d_type", &self.d_type)
+                    // FIXME: .field("d_name", &self.d_name)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for dirent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.d_ino.hash(state);
+                self.d_off.hash(state);
+                self.d_reclen.hash(state);
+                self.d_type.hash(state);
+                self.d_name.hash(state);
+            }
+        }
+
+        impl PartialEq for sysinfo {
+            fn eq(&self, other: &sysinfo) -> bool {
+                self.uptime == other.uptime
+                    && self.loads == other.loads
+                    && self.totalram == other.totalram
+                    && self.freeram == other.freeram
+                    && self.sharedram == other.sharedram
+                    && self.bufferram == other.bufferram
+                    && self.totalswap == other.totalswap
+                    && self.freeswap == other.freeswap
+                    && self.procs == other.procs
+                    && self.pad == other.pad
+                    && self.totalhigh == other.totalhigh
+                    && self.freehigh == other.freehigh
+                    && self.mem_unit == other.mem_unit
+                    && self
+                    .__reserved
+                    .iter()
+                    .zip(other.__reserved.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for sysinfo {}
+        impl ::fmt::Debug for sysinfo {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sysinfo")
+                    .field("uptime", &self.uptime)
+                    .field("loads", &self.loads)
+                    .field("totalram", &self.totalram)
+                    .field("freeram", &self.freeram)
+                    .field("sharedram", &self.sharedram)
+                    .field("bufferram", &self.bufferram)
+                    .field("totalswap", &self.totalswap)
+                    .field("freeswap", &self.freeswap)
+                    .field("procs", &self.procs)
+                    .field("pad", &self.pad)
+                    .field("totalhigh", &self.totalhigh)
+                    .field("freehigh", &self.freehigh)
+                    .field("mem_unit", &self.mem_unit)
+                    // FIXME: .field("__reserved", &self.__reserved)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sysinfo {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.uptime.hash(state);
+                self.loads.hash(state);
+                self.totalram.hash(state);
+                self.freeram.hash(state);
+                self.sharedram.hash(state);
+                self.bufferram.hash(state);
+                self.totalswap.hash(state);
+                self.freeswap.hash(state);
+                self.procs.hash(state);
+                self.pad.hash(state);
+                self.totalhigh.hash(state);
+                self.freehigh.hash(state);
+                self.mem_unit.hash(state);
+                self.__reserved.hash(state);
+            }
+        }
+
+        impl PartialEq for mq_attr {
+            fn eq(&self, other: &mq_attr) -> bool {
+                self.mq_flags == other.mq_flags &&
+                self.mq_maxmsg == other.mq_maxmsg &&
+                self.mq_msgsize == other.mq_msgsize &&
+                self.mq_curmsgs == other.mq_curmsgs
+            }
+        }
+        impl Eq for mq_attr {}
+        impl ::fmt::Debug for mq_attr {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("mq_attr")
+                    .field("mq_flags", &self.mq_flags)
+                    .field("mq_maxmsg", &self.mq_maxmsg)
+                    .field("mq_msgsize", &self.mq_msgsize)
+                    .field("mq_curmsgs", &self.mq_curmsgs)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for mq_attr {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.mq_flags.hash(state);
+                self.mq_maxmsg.hash(state);
+                self.mq_msgsize.hash(state);
+                self.mq_curmsgs.hash(state);
+            }
+        }
+    }
+}
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MS_NOUSER: ::c_ulong = 0x80000000;
+pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
+
+pub const ABDAY_1: ::nl_item = 0x20000;
+pub const ABDAY_2: ::nl_item = 0x20001;
+pub const ABDAY_3: ::nl_item = 0x20002;
+pub const ABDAY_4: ::nl_item = 0x20003;
+pub const ABDAY_5: ::nl_item = 0x20004;
+pub const ABDAY_6: ::nl_item = 0x20005;
+pub const ABDAY_7: ::nl_item = 0x20006;
+
+pub const DAY_1: ::nl_item = 0x20007;
+pub const DAY_2: ::nl_item = 0x20008;
+pub const DAY_3: ::nl_item = 0x20009;
+pub const DAY_4: ::nl_item = 0x2000A;
+pub const DAY_5: ::nl_item = 0x2000B;
+pub const DAY_6: ::nl_item = 0x2000C;
+pub const DAY_7: ::nl_item = 0x2000D;
+
+pub const ABMON_1: ::nl_item = 0x2000E;
+pub const ABMON_2: ::nl_item = 0x2000F;
+pub const ABMON_3: ::nl_item = 0x20010;
+pub const ABMON_4: ::nl_item = 0x20011;
+pub const ABMON_5: ::nl_item = 0x20012;
+pub const ABMON_6: ::nl_item = 0x20013;
+pub const ABMON_7: ::nl_item = 0x20014;
+pub const ABMON_8: ::nl_item = 0x20015;
+pub const ABMON_9: ::nl_item = 0x20016;
+pub const ABMON_10: ::nl_item = 0x20017;
+pub const ABMON_11: ::nl_item = 0x20018;
+pub const ABMON_12: ::nl_item = 0x20019;
+
+pub const MON_1: ::nl_item = 0x2001A;
+pub const MON_2: ::nl_item = 0x2001B;
+pub const MON_3: ::nl_item = 0x2001C;
+pub const MON_4: ::nl_item = 0x2001D;
+pub const MON_5: ::nl_item = 0x2001E;
+pub const MON_6: ::nl_item = 0x2001F;
+pub const MON_7: ::nl_item = 0x20020;
+pub const MON_8: ::nl_item = 0x20021;
+pub const MON_9: ::nl_item = 0x20022;
+pub const MON_10: ::nl_item = 0x20023;
+pub const MON_11: ::nl_item = 0x20024;
+pub const MON_12: ::nl_item = 0x20025;
+
+pub const AM_STR: ::nl_item = 0x20026;
+pub const PM_STR: ::nl_item = 0x20027;
+
+pub const D_T_FMT: ::nl_item = 0x20028;
+pub const D_FMT: ::nl_item = 0x20029;
+pub const T_FMT: ::nl_item = 0x2002A;
+pub const T_FMT_AMPM: ::nl_item = 0x2002B;
+
+pub const ERA: ::nl_item = 0x2002C;
+pub const ERA_D_FMT: ::nl_item = 0x2002E;
+pub const ALT_DIGITS: ::nl_item = 0x2002F;
+pub const ERA_D_T_FMT: ::nl_item = 0x20030;
+pub const ERA_T_FMT: ::nl_item = 0x20031;
+
+pub const CODESET: ::nl_item = 14;
+
+pub const CRNCYSTR: ::nl_item = 0x4000F;
+
+pub const RUSAGE_THREAD: ::c_int = 1;
+pub const RUSAGE_CHILDREN: ::c_int = -1;
+
+pub const RADIXCHAR: ::nl_item = 0x10000;
+pub const THOUSEP: ::nl_item = 0x10001;
+
+pub const YESEXPR: ::nl_item = 0x50000;
+pub const NOEXPR: ::nl_item = 0x50001;
+pub const YESSTR: ::nl_item = 0x50002;
+pub const NOSTR: ::nl_item = 0x50003;
+
+pub const FILENAME_MAX: ::c_uint = 4096;
+pub const L_tmpnam: ::c_uint = 20;
+pub const _PC_LINK_MAX: ::c_int = 0;
+pub const _PC_MAX_CANON: ::c_int = 1;
+pub const _PC_MAX_INPUT: ::c_int = 2;
+pub const _PC_NAME_MAX: ::c_int = 3;
+pub const _PC_PATH_MAX: ::c_int = 4;
+pub const _PC_PIPE_BUF: ::c_int = 5;
+pub const _PC_CHOWN_RESTRICTED: ::c_int = 6;
+pub const _PC_NO_TRUNC: ::c_int = 7;
+pub const _PC_VDISABLE: ::c_int = 8;
+pub const _PC_SYNC_IO: ::c_int = 9;
+pub const _PC_ASYNC_IO: ::c_int = 10;
+pub const _PC_PRIO_IO: ::c_int = 11;
+pub const _PC_SOCK_MAXBUF: ::c_int = 12;
+pub const _PC_FILESIZEBITS: ::c_int = 13;
+pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14;
+pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15;
+pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16;
+pub const _PC_REC_XFER_ALIGN: ::c_int = 17;
+pub const _PC_ALLOC_SIZE_MIN: ::c_int = 18;
+pub const _PC_SYMLINK_MAX: ::c_int = 19;
+pub const _PC_2_SYMLINKS: ::c_int = 20;
+
+pub const _SC_ARG_MAX: ::c_int = 0;
+pub const _SC_CHILD_MAX: ::c_int = 1;
+pub const _SC_CLK_TCK: ::c_int = 2;
+pub const _SC_NGROUPS_MAX: ::c_int = 3;
+pub const _SC_OPEN_MAX: ::c_int = 4;
+pub const _SC_STREAM_MAX: ::c_int = 5;
+pub const _SC_TZNAME_MAX: ::c_int = 6;
+pub const _SC_JOB_CONTROL: ::c_int = 7;
+pub const _SC_SAVED_IDS: ::c_int = 8;
+pub const _SC_REALTIME_SIGNALS: ::c_int = 9;
+pub const _SC_PRIORITY_SCHEDULING: ::c_int = 10;
+pub const _SC_TIMERS: ::c_int = 11;
+pub const _SC_ASYNCHRONOUS_IO: ::c_int = 12;
+pub const _SC_PRIORITIZED_IO: ::c_int = 13;
+pub const _SC_SYNCHRONIZED_IO: ::c_int = 14;
+pub const _SC_FSYNC: ::c_int = 15;
+pub const _SC_MAPPED_FILES: ::c_int = 16;
+pub const _SC_MEMLOCK: ::c_int = 17;
+pub const _SC_MEMLOCK_RANGE: ::c_int = 18;
+pub const _SC_MEMORY_PROTECTION: ::c_int = 19;
+pub const _SC_MESSAGE_PASSING: ::c_int = 20;
+pub const _SC_SEMAPHORES: ::c_int = 21;
+pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 22;
+pub const _SC_AIO_LISTIO_MAX: ::c_int = 23;
+pub const _SC_AIO_MAX: ::c_int = 24;
+pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 25;
+pub const _SC_DELAYTIMER_MAX: ::c_int = 26;
+pub const _SC_MQ_OPEN_MAX: ::c_int = 27;
+pub const _SC_MQ_PRIO_MAX: ::c_int = 28;
+pub const _SC_VERSION: ::c_int = 29;
+pub const _SC_PAGESIZE: ::c_int = 30;
+pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
+pub const _SC_RTSIG_MAX: ::c_int = 31;
+pub const _SC_SEM_NSEMS_MAX: ::c_int = 32;
+pub const _SC_SEM_VALUE_MAX: ::c_int = 33;
+pub const _SC_SIGQUEUE_MAX: ::c_int = 34;
+pub const _SC_TIMER_MAX: ::c_int = 35;
+pub const _SC_BC_BASE_MAX: ::c_int = 36;
+pub const _SC_BC_DIM_MAX: ::c_int = 37;
+pub const _SC_BC_SCALE_MAX: ::c_int = 38;
+pub const _SC_BC_STRING_MAX: ::c_int = 39;
+pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 40;
+pub const _SC_EXPR_NEST_MAX: ::c_int = 42;
+pub const _SC_LINE_MAX: ::c_int = 43;
+pub const _SC_RE_DUP_MAX: ::c_int = 44;
+pub const _SC_2_VERSION: ::c_int = 46;
+pub const _SC_2_C_BIND: ::c_int = 47;
+pub const _SC_2_C_DEV: ::c_int = 48;
+pub const _SC_2_FORT_DEV: ::c_int = 49;
+pub const _SC_2_FORT_RUN: ::c_int = 50;
+pub const _SC_2_SW_DEV: ::c_int = 51;
+pub const _SC_2_LOCALEDEF: ::c_int = 52;
+pub const _SC_UIO_MAXIOV: ::c_int = 60;
+pub const _SC_IOV_MAX: ::c_int = 60;
+pub const _SC_THREADS: ::c_int = 67;
+pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 68;
+pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 69;
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 70;
+pub const _SC_LOGIN_NAME_MAX: ::c_int = 71;
+pub const _SC_TTY_NAME_MAX: ::c_int = 72;
+pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 73;
+pub const _SC_THREAD_KEYS_MAX: ::c_int = 74;
+pub const _SC_THREAD_STACK_MIN: ::c_int = 75;
+pub const _SC_THREAD_THREADS_MAX: ::c_int = 76;
+pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77;
+pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78;
+pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 79;
+pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 80;
+pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 81;
+pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 82;
+pub const _SC_NPROCESSORS_CONF: ::c_int = 83;
+pub const _SC_NPROCESSORS_ONLN: ::c_int = 84;
+pub const _SC_PHYS_PAGES: ::c_int = 85;
+pub const _SC_AVPHYS_PAGES: ::c_int = 86;
+pub const _SC_ATEXIT_MAX: ::c_int = 87;
+pub const _SC_PASS_MAX: ::c_int = 88;
+pub const _SC_XOPEN_VERSION: ::c_int = 89;
+pub const _SC_XOPEN_XCU_VERSION: ::c_int = 90;
+pub const _SC_XOPEN_UNIX: ::c_int = 91;
+pub const _SC_XOPEN_CRYPT: ::c_int = 92;
+pub const _SC_XOPEN_ENH_I18N: ::c_int = 93;
+pub const _SC_XOPEN_SHM: ::c_int = 94;
+pub const _SC_2_CHAR_TERM: ::c_int = 95;
+pub const _SC_2_UPE: ::c_int = 97;
+pub const _SC_XOPEN_XPG2: ::c_int = 98;
+pub const _SC_XOPEN_XPG3: ::c_int = 99;
+pub const _SC_XOPEN_XPG4: ::c_int = 100;
+pub const _SC_NZERO: ::c_int = 109;
+pub const _SC_XBS5_ILP32_OFF32: ::c_int = 125;
+pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 126;
+pub const _SC_XBS5_LP64_OFF64: ::c_int = 127;
+pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 128;
+pub const _SC_XOPEN_LEGACY: ::c_int = 129;
+pub const _SC_XOPEN_REALTIME: ::c_int = 130;
+pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 131;
+pub const _SC_ADVISORY_INFO: ::c_int = 132;
+pub const _SC_BARRIERS: ::c_int = 133;
+pub const _SC_CLOCK_SELECTION: ::c_int = 137;
+pub const _SC_CPUTIME: ::c_int = 138;
+pub const _SC_THREAD_CPUTIME: ::c_int = 139;
+pub const _SC_MONOTONIC_CLOCK: ::c_int = 149;
+pub const _SC_READER_WRITER_LOCKS: ::c_int = 153;
+pub const _SC_SPIN_LOCKS: ::c_int = 154;
+pub const _SC_REGEXP: ::c_int = 155;
+pub const _SC_SHELL: ::c_int = 157;
+pub const _SC_SPAWN: ::c_int = 159;
+pub const _SC_SPORADIC_SERVER: ::c_int = 160;
+pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 161;
+pub const _SC_TIMEOUTS: ::c_int = 164;
+pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 165;
+pub const _SC_2_PBS: ::c_int = 168;
+pub const _SC_2_PBS_ACCOUNTING: ::c_int = 169;
+pub const _SC_2_PBS_LOCATE: ::c_int = 170;
+pub const _SC_2_PBS_MESSAGE: ::c_int = 171;
+pub const _SC_2_PBS_TRACK: ::c_int = 172;
+pub const _SC_SYMLOOP_MAX: ::c_int = 173;
+pub const _SC_STREAMS: ::c_int = 174;
+pub const _SC_2_PBS_CHECKPOINT: ::c_int = 175;
+pub const _SC_V6_ILP32_OFF32: ::c_int = 176;
+pub const _SC_V6_ILP32_OFFBIG: ::c_int = 177;
+pub const _SC_V6_LP64_OFF64: ::c_int = 178;
+pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 179;
+pub const _SC_HOST_NAME_MAX: ::c_int = 180;
+pub const _SC_TRACE: ::c_int = 181;
+pub const _SC_TRACE_EVENT_FILTER: ::c_int = 182;
+pub const _SC_TRACE_INHERIT: ::c_int = 183;
+pub const _SC_TRACE_LOG: ::c_int = 184;
+pub const _SC_IPV6: ::c_int = 235;
+pub const _SC_RAW_SOCKETS: ::c_int = 236;
+pub const _SC_V7_ILP32_OFF32: ::c_int = 237;
+pub const _SC_V7_ILP32_OFFBIG: ::c_int = 238;
+pub const _SC_V7_LP64_OFF64: ::c_int = 239;
+pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 240;
+pub const _SC_SS_REPL_MAX: ::c_int = 241;
+pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 242;
+pub const _SC_TRACE_NAME_MAX: ::c_int = 243;
+pub const _SC_TRACE_SYS_MAX: ::c_int = 244;
+pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 245;
+pub const _SC_XOPEN_STREAMS: ::c_int = 246;
+pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 247;
+pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 248;
+
+pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY;
+pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY;
+
+pub const GLOB_ERR: ::c_int = 1 << 0;
+pub const GLOB_MARK: ::c_int = 1 << 1;
+pub const GLOB_NOSORT: ::c_int = 1 << 2;
+pub const GLOB_DOOFFS: ::c_int = 1 << 3;
+pub const GLOB_NOCHECK: ::c_int = 1 << 4;
+pub const GLOB_APPEND: ::c_int = 1 << 5;
+pub const GLOB_NOESCAPE: ::c_int = 1 << 6;
+
+pub const GLOB_NOSPACE: ::c_int = 1;
+pub const GLOB_ABORTED: ::c_int = 2;
+pub const GLOB_NOMATCH: ::c_int = 3;
+
+pub const POSIX_MADV_NORMAL: ::c_int = 0;
+pub const POSIX_MADV_RANDOM: ::c_int = 1;
+pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
+pub const POSIX_MADV_WILLNEED: ::c_int = 3;
+
+pub const S_IEXEC: mode_t = 64;
+pub const S_IWRITE: mode_t = 128;
+pub const S_IREAD: mode_t = 256;
+
+pub const F_LOCK: ::c_int = 1;
+pub const F_TEST: ::c_int = 3;
+pub const F_TLOCK: ::c_int = 2;
+pub const F_ULOCK: ::c_int = 0;
+
+pub const ST_RDONLY: ::c_ulong = 1;
+pub const ST_NOSUID: ::c_ulong = 2;
+pub const ST_NODEV: ::c_ulong = 4;
+pub const ST_NOEXEC: ::c_ulong = 8;
+pub const ST_SYNCHRONOUS: ::c_ulong = 16;
+pub const ST_MANDLOCK: ::c_ulong = 64;
+pub const ST_WRITE: ::c_ulong = 128;
+pub const ST_APPEND: ::c_ulong = 256;
+pub const ST_IMMUTABLE: ::c_ulong = 512;
+pub const ST_NOATIME: ::c_ulong = 1024;
+pub const ST_NODIRATIME: ::c_ulong = 2048;
+
+pub const RTLD_NEXT: *mut ::c_void = -1i64 as *mut ::c_void;
+pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
+pub const RTLD_NODELETE: ::c_int = 0x1000;
+pub const RTLD_NOW: ::c_int = 0x2;
+
+align_const! {
+    pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+        size: [0; __SIZEOF_PTHREAD_MUTEX_T],
+    };
+    pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+        size: [0; __SIZEOF_PTHREAD_COND_T],
+    };
+    pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+        size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
+    };
+}
+
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
+pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
+pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
+pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
+pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
+pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
+
+pub const SCHED_OTHER: ::c_int = 0;
+pub const SCHED_FIFO: ::c_int = 1;
+pub const SCHED_RR: ::c_int = 2;
+pub const SCHED_BATCH: ::c_int = 3;
+pub const SCHED_IDLE: ::c_int = 5;
+
+pub const AF_IB: ::c_int = 27;
+pub const AF_MPLS: ::c_int = 28;
+pub const AF_NFC: ::c_int = 39;
+pub const AF_VSOCK: ::c_int = 40;
+pub const PF_IB: ::c_int = AF_IB;
+pub const PF_MPLS: ::c_int = AF_MPLS;
+pub const PF_NFC: ::c_int = AF_NFC;
+pub const PF_VSOCK: ::c_int = AF_VSOCK;
+
+// System V IPC
+pub const IPC_PRIVATE: ::key_t = 0;
+
+pub const IPC_CREAT: ::c_int = 0o1000;
+pub const IPC_EXCL: ::c_int = 0o2000;
+pub const IPC_NOWAIT: ::c_int = 0o4000;
+
+pub const IPC_RMID: ::c_int = 0;
+pub const IPC_SET: ::c_int = 1;
+pub const IPC_STAT: ::c_int = 2;
+pub const IPC_INFO: ::c_int = 3;
+pub const MSG_STAT: ::c_int = 11;
+pub const MSG_INFO: ::c_int = 12;
+
+pub const MSG_NOERROR: ::c_int = 0o10000;
+pub const MSG_EXCEPT: ::c_int = 0o20000;
+
+pub const SHM_R: ::c_int = 0o400;
+pub const SHM_W: ::c_int = 0o200;
+
+pub const SHM_RDONLY: ::c_int = 0o10000;
+pub const SHM_RND: ::c_int = 0o20000;
+pub const SHM_REMAP: ::c_int = 0o40000;
+pub const SHM_EXEC: ::c_int = 0o100000;
+
+pub const SHM_LOCK: ::c_int = 11;
+pub const SHM_UNLOCK: ::c_int = 12;
+
+pub const SHM_HUGETLB: ::c_int = 0o4000;
+pub const SHM_NORESERVE: ::c_int = 0o10000;
+
+pub const QFMT_VFS_OLD: ::c_int = 1;
+pub const QFMT_VFS_V0: ::c_int = 2;
+
+pub const EFD_SEMAPHORE: ::c_int = 0x1;
+
+pub const LOG_NFACILITIES: ::c_int = 24;
+
+pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t;
+
+pub const RB_AUTOBOOT: ::c_int = 0x01234567u32 as i32;
+pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123u32 as i32;
+pub const RB_ENABLE_CAD: ::c_int = 0x89abcdefu32 as i32;
+pub const RB_DISABLE_CAD: ::c_int = 0x00000000u32 as i32;
+pub const RB_POWER_OFF: ::c_int = 0x4321fedcu32 as i32;
+pub const RB_SW_SUSPEND: ::c_int = 0xd000fce2u32 as i32;
+pub const RB_KEXEC: ::c_int = 0x45584543u32 as i32;
+
+pub const AI_PASSIVE: ::c_int = 0x0001;
+pub const AI_CANONNAME: ::c_int = 0x0002;
+pub const AI_NUMERICHOST: ::c_int = 0x0004;
+pub const AI_V4MAPPED: ::c_int = 0x0008;
+pub const AI_ALL: ::c_int = 0x0010;
+pub const AI_ADDRCONFIG: ::c_int = 0x0020;
+
+pub const AI_NUMERICSERV: ::c_int = 0x0400;
+
+pub const EAI_BADFLAGS: ::c_int = -1;
+pub const EAI_NONAME: ::c_int = -2;
+pub const EAI_AGAIN: ::c_int = -3;
+pub const EAI_FAIL: ::c_int = -4;
+pub const EAI_FAMILY: ::c_int = -6;
+pub const EAI_SOCKTYPE: ::c_int = -7;
+pub const EAI_SERVICE: ::c_int = -8;
+pub const EAI_MEMORY: ::c_int = -10;
+pub const EAI_OVERFLOW: ::c_int = -12;
+
+pub const NI_NUMERICHOST: ::c_int = 1;
+pub const NI_NUMERICSERV: ::c_int = 2;
+pub const NI_NOFQDN: ::c_int = 4;
+pub const NI_NAMEREQD: ::c_int = 8;
+pub const NI_DGRAM: ::c_int = 16;
+
+pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1;
+pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2;
+pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4;
+
+pub const EAI_SYSTEM: ::c_int = -11;
+
+pub const AIO_CANCELED: ::c_int = 0;
+pub const AIO_NOTCANCELED: ::c_int = 1;
+pub const AIO_ALLDONE: ::c_int = 2;
+pub const LIO_READ: ::c_int = 0;
+pub const LIO_WRITE: ::c_int = 1;
+pub const LIO_NOP: ::c_int = 2;
+pub const LIO_WAIT: ::c_int = 0;
+pub const LIO_NOWAIT: ::c_int = 1;
+
+pub const MREMAP_MAYMOVE: ::c_int = 1;
+pub const MREMAP_FIXED: ::c_int = 2;
+
+pub const PR_SET_PDEATHSIG: ::c_int = 1;
+pub const PR_GET_PDEATHSIG: ::c_int = 2;
+
+pub const PR_GET_DUMPABLE: ::c_int = 3;
+pub const PR_SET_DUMPABLE: ::c_int = 4;
+
+pub const PR_GET_UNALIGN: ::c_int = 5;
+pub const PR_SET_UNALIGN: ::c_int = 6;
+pub const PR_UNALIGN_NOPRINT: ::c_int = 1;
+pub const PR_UNALIGN_SIGBUS: ::c_int = 2;
+
+pub const PR_GET_KEEPCAPS: ::c_int = 7;
+pub const PR_SET_KEEPCAPS: ::c_int = 8;
+
+pub const PR_GET_FPEMU: ::c_int = 9;
+pub const PR_SET_FPEMU: ::c_int = 10;
+pub const PR_FPEMU_NOPRINT: ::c_int = 1;
+pub const PR_FPEMU_SIGFPE: ::c_int = 2;
+
+pub const PR_GET_FPEXC: ::c_int = 11;
+pub const PR_SET_FPEXC: ::c_int = 12;
+pub const PR_FP_EXC_SW_ENABLE: ::c_int = 0x80;
+pub const PR_FP_EXC_DIV: ::c_int = 0x010000;
+pub const PR_FP_EXC_OVF: ::c_int = 0x020000;
+pub const PR_FP_EXC_UND: ::c_int = 0x040000;
+pub const PR_FP_EXC_RES: ::c_int = 0x080000;
+pub const PR_FP_EXC_INV: ::c_int = 0x100000;
+pub const PR_FP_EXC_DISABLED: ::c_int = 0;
+pub const PR_FP_EXC_NONRECOV: ::c_int = 1;
+pub const PR_FP_EXC_ASYNC: ::c_int = 2;
+pub const PR_FP_EXC_PRECISE: ::c_int = 3;
+
+pub const PR_GET_TIMING: ::c_int = 13;
+pub const PR_SET_TIMING: ::c_int = 14;
+pub const PR_TIMING_STATISTICAL: ::c_int = 0;
+pub const PR_TIMING_TIMESTAMP: ::c_int = 1;
+
+pub const PR_SET_NAME: ::c_int = 15;
+pub const PR_GET_NAME: ::c_int = 16;
+
+pub const PR_GET_ENDIAN: ::c_int = 19;
+pub const PR_SET_ENDIAN: ::c_int = 20;
+pub const PR_ENDIAN_BIG: ::c_int = 0;
+pub const PR_ENDIAN_LITTLE: ::c_int = 1;
+pub const PR_ENDIAN_PPC_LITTLE: ::c_int = 2;
+
+pub const PR_GET_SECCOMP: ::c_int = 21;
+pub const PR_SET_SECCOMP: ::c_int = 22;
+
+pub const PR_CAPBSET_READ: ::c_int = 23;
+pub const PR_CAPBSET_DROP: ::c_int = 24;
+
+pub const PR_GET_TSC: ::c_int = 25;
+pub const PR_SET_TSC: ::c_int = 26;
+pub const PR_TSC_ENABLE: ::c_int = 1;
+pub const PR_TSC_SIGSEGV: ::c_int = 2;
+
+pub const PR_GET_SECUREBITS: ::c_int = 27;
+pub const PR_SET_SECUREBITS: ::c_int = 28;
+
+pub const PR_SET_TIMERSLACK: ::c_int = 29;
+pub const PR_GET_TIMERSLACK: ::c_int = 30;
+
+pub const PR_TASK_PERF_EVENTS_DISABLE: ::c_int = 31;
+pub const PR_TASK_PERF_EVENTS_ENABLE: ::c_int = 32;
+
+pub const PR_MCE_KILL: ::c_int = 33;
+pub const PR_MCE_KILL_CLEAR: ::c_int = 0;
+pub const PR_MCE_KILL_SET: ::c_int = 1;
+
+pub const PR_MCE_KILL_LATE: ::c_int = 0;
+pub const PR_MCE_KILL_EARLY: ::c_int = 1;
+pub const PR_MCE_KILL_DEFAULT: ::c_int = 2;
+
+pub const PR_MCE_KILL_GET: ::c_int = 34;
+
+pub const PR_SET_MM: ::c_int = 35;
+pub const PR_SET_MM_START_CODE: ::c_int = 1;
+pub const PR_SET_MM_END_CODE: ::c_int = 2;
+pub const PR_SET_MM_START_DATA: ::c_int = 3;
+pub const PR_SET_MM_END_DATA: ::c_int = 4;
+pub const PR_SET_MM_START_STACK: ::c_int = 5;
+pub const PR_SET_MM_START_BRK: ::c_int = 6;
+pub const PR_SET_MM_BRK: ::c_int = 7;
+pub const PR_SET_MM_ARG_START: ::c_int = 8;
+pub const PR_SET_MM_ARG_END: ::c_int = 9;
+pub const PR_SET_MM_ENV_START: ::c_int = 10;
+pub const PR_SET_MM_ENV_END: ::c_int = 11;
+pub const PR_SET_MM_AUXV: ::c_int = 12;
+pub const PR_SET_MM_EXE_FILE: ::c_int = 13;
+pub const PR_SET_MM_MAP: ::c_int = 14;
+pub const PR_SET_MM_MAP_SIZE: ::c_int = 15;
+
+pub const PR_SET_PTRACER: ::c_int = 0x59616d61;
+pub const PR_SET_PTRACER_ANY: ::c_ulong = 0xffffffffffffffff;
+
+pub const PR_SET_CHILD_SUBREAPER: ::c_int = 36;
+pub const PR_GET_CHILD_SUBREAPER: ::c_int = 37;
+
+pub const PR_SET_NO_NEW_PRIVS: ::c_int = 38;
+pub const PR_GET_NO_NEW_PRIVS: ::c_int = 39;
+
+pub const PR_GET_TID_ADDRESS: ::c_int = 40;
+
+pub const PR_SET_THP_DISABLE: ::c_int = 41;
+pub const PR_GET_THP_DISABLE: ::c_int = 42;
+
+pub const PR_MPX_ENABLE_MANAGEMENT: ::c_int = 43;
+pub const PR_MPX_DISABLE_MANAGEMENT: ::c_int = 44;
+
+pub const PR_SET_FP_MODE: ::c_int = 45;
+pub const PR_GET_FP_MODE: ::c_int = 46;
+pub const PR_FP_MODE_FR: ::c_int = 1 << 0;
+pub const PR_FP_MODE_FRE: ::c_int = 1 << 1;
+
+pub const PR_CAP_AMBIENT: ::c_int = 47;
+pub const PR_CAP_AMBIENT_IS_SET: ::c_int = 1;
+pub const PR_CAP_AMBIENT_RAISE: ::c_int = 2;
+pub const PR_CAP_AMBIENT_LOWER: ::c_int = 3;
+pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4;
+
+pub const ITIMER_REAL: ::c_int = 0;
+pub const ITIMER_VIRTUAL: ::c_int = 1;
+pub const ITIMER_PROF: ::c_int = 2;
+
+pub const _POSIX_VDISABLE: ::cc_t = 0;
+
+pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01;
+pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02;
+
+// On Linux, libc doesn't define this constant, libattr does instead.
+// We still define it for Linux as it's defined by libc on other platforms,
+// and it's mentioned in the man pages for getxattr and setxattr.
+pub const SFD_CLOEXEC: ::c_int = 0x080000;
+
+pub const NCCS: usize = 32;
+
+pub const O_TRUNC: ::c_int = 512;
+pub const O_NOATIME: ::c_int = 0o1000000;
+pub const O_CLOEXEC: ::c_int = 0x80000;
+
+// Defined as wasi value.
+pub const EPERM: ::c_int = 63;
+pub const ENOENT: ::c_int = 44;
+pub const ESRCH: ::c_int = 71;
+pub const EINTR: ::c_int = 27;
+pub const EIO: ::c_int = 29;
+pub const ENXIO: ::c_int = 60;
+pub const E2BIG: ::c_int = 1;
+pub const ENOEXEC: ::c_int = 45;
+pub const EBADF: ::c_int = 8;
+pub const ECHILD: ::c_int = 12;
+pub const EAGAIN: ::c_int = 6;
+pub const ENOMEM: ::c_int = 48;
+pub const EACCES: ::c_int = 2;
+pub const EFAULT: ::c_int = 21;
+pub const ENOTBLK: ::c_int = 105;
+pub const EBUSY: ::c_int = 10;
+pub const EEXIST: ::c_int = 20;
+pub const EXDEV: ::c_int = 75;
+pub const ENODEV: ::c_int = 43;
+pub const ENOTDIR: ::c_int = 54;
+pub const EISDIR: ::c_int = 31;
+pub const EINVAL: ::c_int = 28;
+pub const ENFILE: ::c_int = 41;
+pub const EMFILE: ::c_int = 33;
+pub const ENOTTY: ::c_int = 59;
+pub const ETXTBSY: ::c_int = 74;
+pub const EFBIG: ::c_int = 22;
+pub const ENOSPC: ::c_int = 51;
+pub const ESPIPE: ::c_int = 70;
+pub const EROFS: ::c_int = 69;
+pub const EMLINK: ::c_int = 34;
+pub const EPIPE: ::c_int = 64;
+pub const EDOM: ::c_int = 18;
+pub const ERANGE: ::c_int = 68;
+pub const EWOULDBLOCK: ::c_int = EAGAIN;
+pub const ENOLINK: ::c_int = 47;
+pub const EPROTO: ::c_int = 65;
+pub const EDEADLK: ::c_int = 16;
+pub const EDEADLOCK: ::c_int = EDEADLK;
+pub const ENAMETOOLONG: ::c_int = 37;
+pub const ENOLCK: ::c_int = 46;
+pub const ENOSYS: ::c_int = 52;
+pub const ENOTEMPTY: ::c_int = 55;
+pub const ELOOP: ::c_int = 32;
+pub const ENOMSG: ::c_int = 49;
+pub const EIDRM: ::c_int = 24;
+pub const EMULTIHOP: ::c_int = 36;
+pub const EBADMSG: ::c_int = 9;
+pub const EOVERFLOW: ::c_int = 61;
+pub const EILSEQ: ::c_int = 25;
+pub const ENOTSOCK: ::c_int = 57;
+pub const EDESTADDRREQ: ::c_int = 17;
+pub const EMSGSIZE: ::c_int = 35;
+pub const EPROTOTYPE: ::c_int = 67;
+pub const ENOPROTOOPT: ::c_int = 50;
+pub const EPROTONOSUPPORT: ::c_int = 66;
+pub const EAFNOSUPPORT: ::c_int = 5;
+pub const EADDRINUSE: ::c_int = 3;
+pub const EADDRNOTAVAIL: ::c_int = 4;
+pub const ENETDOWN: ::c_int = 38;
+pub const ENETUNREACH: ::c_int = 40;
+pub const ENETRESET: ::c_int = 39;
+pub const ECONNABORTED: ::c_int = 13;
+pub const ECONNRESET: ::c_int = 15;
+pub const ENOBUFS: ::c_int = 42;
+pub const EISCONN: ::c_int = 30;
+pub const ENOTCONN: ::c_int = 53;
+pub const ETIMEDOUT: ::c_int = 73;
+pub const ECONNREFUSED: ::c_int = 14;
+pub const EHOSTUNREACH: ::c_int = 23;
+pub const EALREADY: ::c_int = 7;
+pub const EINPROGRESS: ::c_int = 26;
+pub const ESTALE: ::c_int = 72;
+pub const EDQUOT: ::c_int = 19;
+pub const ECANCELED: ::c_int = 11;
+pub const EOWNERDEAD: ::c_int = 62;
+pub const ENOTRECOVERABLE: ::c_int = 56;
+
+pub const ENOSTR: ::c_int = 100;
+pub const EBFONT: ::c_int = 101;
+pub const EBADSLT: ::c_int = 102;
+pub const EBADRQC: ::c_int = 103;
+pub const ENOANO: ::c_int = 104;
+pub const ECHRNG: ::c_int = 106;
+pub const EL3HLT: ::c_int = 107;
+pub const EL3RST: ::c_int = 108;
+pub const ELNRNG: ::c_int = 109;
+pub const EUNATCH: ::c_int = 110;
+pub const ENOCSI: ::c_int = 111;
+pub const EL2HLT: ::c_int = 112;
+pub const EBADE: ::c_int = 113;
+pub const EBADR: ::c_int = 114;
+pub const EXFULL: ::c_int = 115;
+pub const ENODATA: ::c_int = 116;
+pub const ETIME: ::c_int = 117;
+pub const ENOSR: ::c_int = 118;
+pub const ENONET: ::c_int = 119;
+pub const ENOPKG: ::c_int = 120;
+pub const EREMOTE: ::c_int = 121;
+pub const EADV: ::c_int = 122;
+pub const ESRMNT: ::c_int = 123;
+pub const ECOMM: ::c_int = 124;
+pub const EDOTDOT: ::c_int = 125;
+pub const ENOTUNIQ: ::c_int = 126;
+pub const EBADFD: ::c_int = 127;
+pub const EREMCHG: ::c_int = 128;
+pub const ELIBACC: ::c_int = 129;
+pub const ELIBBAD: ::c_int = 130;
+pub const ELIBSCN: ::c_int = 131;
+pub const ELIBMAX: ::c_int = 132;
+pub const ELIBEXEC: ::c_int = 133;
+pub const ERESTART: ::c_int = 134;
+pub const ESTRPIPE: ::c_int = 135;
+pub const EUSERS: ::c_int = 136;
+pub const ESOCKTNOSUPPORT: ::c_int = 137;
+pub const EOPNOTSUPP: ::c_int = 138;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 139;
+pub const ESHUTDOWN: ::c_int = 140;
+pub const ETOOMANYREFS: ::c_int = 141;
+pub const EHOSTDOWN: ::c_int = 142;
+pub const EUCLEAN: ::c_int = 143;
+pub const ENOTNAM: ::c_int = 144;
+pub const ENAVAIL: ::c_int = 145;
+pub const EISNAM: ::c_int = 146;
+pub const EREMOTEIO: ::c_int = 147;
+pub const ENOMEDIUM: ::c_int = 148;
+pub const EMEDIUMTYPE: ::c_int = 149;
+pub const ENOKEY: ::c_int = 150;
+pub const EKEYEXPIRED: ::c_int = 151;
+pub const EKEYREVOKED: ::c_int = 152;
+pub const EKEYREJECTED: ::c_int = 153;
+pub const ERFKILL: ::c_int = 154;
+pub const EHWPOISON: ::c_int = 155;
+pub const EL2NSYNC: ::c_int = 156;
+
+pub const SA_NODEFER: ::c_int = 0x40000000;
+pub const SA_RESETHAND: ::c_int = 0x80000000;
+pub const SA_RESTART: ::c_int = 0x10000000;
+pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
+
+pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
+
+pub const EFD_CLOEXEC: ::c_int = 0x80000;
+
+pub const BUFSIZ: ::c_uint = 1024;
+pub const TMP_MAX: ::c_uint = 10000;
+pub const FOPEN_MAX: ::c_uint = 1000;
+pub const O_PATH: ::c_int = 0o10000000;
+pub const O_EXEC: ::c_int = 0o10000000;
+pub const O_SEARCH: ::c_int = 0o10000000;
+pub const O_ACCMODE: ::c_int = 0o10000003;
+pub const O_NDELAY: ::c_int = O_NONBLOCK;
+pub const NI_MAXHOST: ::socklen_t = 255;
+pub const PTHREAD_STACK_MIN: ::size_t = 2048;
+pub const POSIX_FADV_DONTNEED: ::c_int = 4;
+pub const POSIX_FADV_NOREUSE: ::c_int = 5;
+
+pub const POSIX_MADV_DONTNEED: ::c_int = 0;
+
+pub const RLIM_INFINITY: ::rlim_t = !0;
+#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+pub const RLIMIT_NLIMITS: ::c_int = 15;
+#[allow(deprecated)]
+#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+pub const RLIM_NLIMITS: ::c_int = RLIMIT_NLIMITS;
+
+pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
+
+#[doc(hidden)]
+#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
+pub const SIGUNUSED: ::c_int = ::SIGSYS;
+
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
+
+pub const CPU_SETSIZE: ::c_int = 128;
+
+pub const QFMT_VFS_V1: ::c_int = 4;
+
+pub const PTRACE_TRACEME: ::c_int = 0;
+pub const PTRACE_PEEKTEXT: ::c_int = 1;
+pub const PTRACE_PEEKDATA: ::c_int = 2;
+pub const PTRACE_PEEKUSER: ::c_int = 3;
+pub const PTRACE_POKETEXT: ::c_int = 4;
+pub const PTRACE_POKEDATA: ::c_int = 5;
+pub const PTRACE_POKEUSER: ::c_int = 6;
+pub const PTRACE_CONT: ::c_int = 7;
+pub const PTRACE_KILL: ::c_int = 8;
+pub const PTRACE_SINGLESTEP: ::c_int = 9;
+pub const PTRACE_ATTACH: ::c_int = 16;
+pub const PTRACE_DETACH: ::c_int = 17;
+pub const PTRACE_SYSCALL: ::c_int = 24;
+pub const PTRACE_SETOPTIONS: ::c_int = 0x4200;
+pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201;
+pub const PTRACE_GETSIGINFO: ::c_int = 0x4202;
+pub const PTRACE_SETSIGINFO: ::c_int = 0x4203;
+pub const PTRACE_GETREGSET: ::c_int = 0x4204;
+pub const PTRACE_SETREGSET: ::c_int = 0x4205;
+pub const PTRACE_SEIZE: ::c_int = 0x4206;
+pub const PTRACE_INTERRUPT: ::c_int = 0x4207;
+pub const PTRACE_LISTEN: ::c_int = 0x4208;
+pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
+
+pub const PTRACE_GETFPREGS: ::c_uint = 14;
+pub const PTRACE_SETFPREGS: ::c_uint = 15;
+pub const PTRACE_GETFPXREGS: ::c_uint = 18;
+pub const PTRACE_SETFPXREGS: ::c_uint = 19;
+pub const PTRACE_GETREGS: ::c_uint = 12;
+pub const PTRACE_SETREGS: ::c_uint = 13;
+
+pub const EFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
+
+pub const SFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
+
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+
+pub const TIOCINQ: ::c_int = ::FIONREAD;
+
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+
+pub const CLOCK_SGI_CYCLE: ::clockid_t = 10;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::c_int = 0x00000800;
+pub const TAB2: ::c_int = 0x00001000;
+pub const TAB3: ::c_int = 0x00001800;
+pub const CR1: ::c_int = 0x00000200;
+pub const CR2: ::c_int = 0x00000400;
+pub const CR3: ::c_int = 0x00000600;
+pub const FF1: ::c_int = 0x00008000;
+pub const BS1: ::c_int = 0x00002000;
+pub const VT1: ::c_int = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const SO_BINDTODEVICE: ::c_int = 25;
+pub const SO_TIMESTAMP: ::c_int = 29;
+pub const SO_MARK: ::c_int = 36;
+pub const SO_RXQ_OVFL: ::c_int = 40;
+pub const SO_PEEK_OFF: ::c_int = 42;
+pub const SO_BUSY_POLL: ::c_int = 46;
+
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 28;
+
+pub const O_DIRECT: ::c_int = 0x4000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+pub const O_ASYNC: ::c_int = 0x2000;
+
+pub const FIOCLEX: ::c_int = 0x5451;
+pub const FIONBIO: ::c_int = 0x5421;
+
+pub const RLIMIT_RSS: ::c_int = 5;
+pub const RLIMIT_NOFILE: ::c_int = 7;
+pub const RLIMIT_AS: ::c_int = 9;
+pub const RLIMIT_NPROC: ::c_int = 6;
+pub const RLIMIT_MEMLOCK: ::c_int = 8;
+pub const RLIMIT_CPU: ::c_int = 0;
+pub const RLIMIT_FSIZE: ::c_int = 1;
+pub const RLIMIT_DATA: ::c_int = 2;
+pub const RLIMIT_STACK: ::c_int = 3;
+pub const RLIMIT_CORE: ::c_int = 4;
+pub const RLIMIT_LOCKS: ::c_int = 10;
+pub const RLIMIT_SIGPENDING: ::c_int = 11;
+pub const RLIMIT_MSGQUEUE: ::c_int = 12;
+pub const RLIMIT_NICE: ::c_int = 13;
+pub const RLIMIT_RTPRIO: ::c_int = 14;
+
+pub const O_APPEND: ::c_int = 1024;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+
+pub const SOCK_NONBLOCK: ::c_int = 2048;
+
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_LOCKED: ::c_int = 0x02000;
+pub const MAP_NORESERVE: ::c_int = 0x04000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+pub const SOCK_SEQPACKET: ::c_int = 5;
+
+pub const IPPROTO_MAX: ::c_int = 256;
+
+pub const SOL_SOCKET: ::c_int = 1;
+
+pub const SO_REUSEADDR: ::c_int = 2;
+pub const SO_TYPE: ::c_int = 3;
+pub const SO_ERROR: ::c_int = 4;
+pub const SO_DONTROUTE: ::c_int = 5;
+pub const SO_BROADCAST: ::c_int = 6;
+pub const SO_SNDBUF: ::c_int = 7;
+pub const SO_RCVBUF: ::c_int = 8;
+pub const SO_KEEPALIVE: ::c_int = 9;
+pub const SO_OOBINLINE: ::c_int = 10;
+pub const SO_LINGER: ::c_int = 13;
+pub const SO_REUSEPORT: ::c_int = 15;
+pub const SO_RCVLOWAT: ::c_int = 18;
+pub const SO_SNDLOWAT: ::c_int = 19;
+pub const SO_RCVTIMEO: ::c_int = 20;
+pub const SO_SNDTIMEO: ::c_int = 21;
+pub const SO_ACCEPTCONN: ::c_int = 30;
+
+pub const IPV6_RTHDR_LOOSE: ::c_int = 0;
+pub const IPV6_RTHDR_STRICT: ::c_int = 1;
+
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+
+pub const F_GETLK: ::c_int = 12;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETLK: ::c_int = 13;
+pub const F_SETLKW: ::c_int = 14;
+pub const F_SETOWN: ::c_int = 8;
+pub const F_OFD_GETLK: ::c_int = 36;
+pub const F_OFD_SETLK: ::c_int = 37;
+pub const F_OFD_SETLKW: ::c_int = 38;
+
+pub const VEOF: usize = 4;
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+
+pub const TCGETS: ::c_int = 0x5401;
+pub const TCSETS: ::c_int = 0x5402;
+pub const TCSETSW: ::c_int = 0x5403;
+pub const TCSETSF: ::c_int = 0x5404;
+pub const TCGETA: ::c_int = 0x5405;
+pub const TCSETA: ::c_int = 0x5406;
+pub const TCSETAW: ::c_int = 0x5407;
+pub const TCSETAF: ::c_int = 0x5408;
+pub const TCSBRK: ::c_int = 0x5409;
+pub const TCXONC: ::c_int = 0x540A;
+pub const TCFLSH: ::c_int = 0x540B;
+pub const TIOCGSOFTCAR: ::c_int = 0x5419;
+pub const TIOCSSOFTCAR: ::c_int = 0x541A;
+pub const TIOCLINUX: ::c_int = 0x541C;
+pub const TIOCGSERIAL: ::c_int = 0x541E;
+pub const TIOCEXCL: ::c_int = 0x540C;
+pub const TIOCNXCL: ::c_int = 0x540D;
+pub const TIOCSCTTY: ::c_int = 0x540E;
+pub const TIOCGPGRP: ::c_int = 0x540F;
+pub const TIOCSPGRP: ::c_int = 0x5410;
+pub const TIOCOUTQ: ::c_int = 0x5411;
+pub const TIOCSTI: ::c_int = 0x5412;
+pub const TIOCGWINSZ: ::c_int = 0x5413;
+pub const TIOCSWINSZ: ::c_int = 0x5414;
+pub const TIOCMGET: ::c_int = 0x5415;
+pub const TIOCMBIS: ::c_int = 0x5416;
+pub const TIOCMBIC: ::c_int = 0x5417;
+pub const TIOCMSET: ::c_int = 0x5418;
+pub const FIONREAD: ::c_int = 0x541B;
+pub const TIOCCONS: ::c_int = 0x541D;
+
+pub const SYS_gettid: ::c_long = 224; // Valid for arm (32-bit) and x86 (32-bit)
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const TIOCM_LE: ::c_int = 0x001;
+pub const TIOCM_DTR: ::c_int = 0x002;
+pub const TIOCM_RTS: ::c_int = 0x004;
+pub const TIOCM_ST: ::c_int = 0x008;
+pub const TIOCM_SR: ::c_int = 0x010;
+pub const TIOCM_CTS: ::c_int = 0x020;
+pub const TIOCM_CAR: ::c_int = 0x040;
+pub const TIOCM_RNG: ::c_int = 0x080;
+pub const TIOCM_DSR: ::c_int = 0x100;
+pub const TIOCM_CD: ::c_int = TIOCM_CAR;
+pub const TIOCM_RI: ::c_int = TIOCM_RNG;
+pub const O_TMPFILE: ::c_int = 0x400000;
+
+pub const MAX_ADDR_LEN: usize = 7;
+pub const ARPD_UPDATE: ::c_ushort = 0x01;
+pub const ARPD_LOOKUP: ::c_ushort = 0x02;
+pub const ARPD_FLUSH: ::c_ushort = 0x03;
+pub const ATF_MAGIC: ::c_int = 0x80;
+
+pub const PRIO_PROCESS: ::c_int = 0;
+pub const PRIO_PGRP: ::c_int = 1;
+pub const PRIO_USER: ::c_int = 2;
+
+pub const SOMAXCONN: ::c_int = 128;
+
+f! {
+    pub fn CMSG_NXTHDR(mhdr: *const msghdr,
+                       cmsg: *const cmsghdr) -> *mut cmsghdr {
+        if ((*cmsg).cmsg_len as usize) < ::mem::size_of::<cmsghdr>() {
+            return 0 as *mut cmsghdr;
+        };
+        let next = (cmsg as usize +
+                    super::CMSG_ALIGN((*cmsg).cmsg_len as usize))
+            as *mut cmsghdr;
+        let max = (*mhdr).msg_control as usize
+            + (*mhdr).msg_controllen as usize;
+        if (next.offset(1)) as usize > max {
+            0 as *mut cmsghdr
+        } else {
+            next as *mut cmsghdr
+        }
+    }
+
+    pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
+        for slot in cpuset.bits.iter_mut() {
+            *slot = 0;
+        }
+    }
+
+    pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
+        let size_in_bits
+            = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
+        let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
+        cpuset.bits[idx] |= 1 << offset;
+        ()
+    }
+
+    pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
+        let size_in_bits
+            = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
+        let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
+        cpuset.bits[idx] &= !(1 << offset);
+        ()
+    }
+
+    pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {
+        let size_in_bits = 8 * ::mem::size_of_val(&cpuset.bits[0]);
+        let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
+        0 != (cpuset.bits[idx] & (1 << offset))
+    }
+
+    pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
+        set1.bits == set2.bits
+    }
+
+    pub fn major(dev: ::dev_t) -> ::c_uint {
+        // see
+        // https://github.com/emscripten-core/emscripten/blob/
+        // main/system/lib/libc/musl/include/sys/sysmacros.h
+        let mut major = 0;
+        major |= (dev & 0x00000fff) >> 8;
+        major |= (dev & 0xfffff000) >> 31 >> 1;
+        major as ::c_uint
+    }
+
+    pub fn minor(dev: ::dev_t) -> ::c_uint {
+        // see
+        // https://github.com/emscripten-core/emscripten/blob/
+        // main/system/lib/libc/musl/include/sys/sysmacros.h
+        let mut minor = 0;
+        minor |= (dev & 0x000000ff) >> 0;
+        minor |= (dev & 0xffffff00) >> 12;
+        minor as ::c_uint
+    }
+}
+
+safe_f! {
+    pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::dev_t;
+        let mut dev = 0;
+        dev |= (major & 0x00000fff) << 8;
+        dev |= (major & 0xfffff000) << 31 << 1;
+        dev |= (minor & 0x000000ff) << 0;
+        dev |= (minor & 0xffffff00) << 12;
+        dev
+    }
+}
+
+extern "C" {
+    pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
+    pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
+    pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
+
+    pub fn abs(i: ::c_int) -> ::c_int;
+    pub fn labs(i: ::c_long) -> ::c_long;
+    pub fn rand() -> ::c_int;
+    pub fn srand(seed: ::c_uint);
+
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
+
+    pub fn setpwent();
+    pub fn endpwent();
+    pub fn getpwent() -> *mut passwd;
+
+    pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int;
+
+    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+    pub fn __errno_location() -> *mut ::c_int;
+
+    pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+    pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
+        -> ::ssize_t;
+    pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
+    pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
+    pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
+    pub fn accept4(
+        fd: ::c_int,
+        addr: *mut ::sockaddr,
+        len: *mut ::socklen_t,
+        flg: ::c_int,
+    ) -> ::c_int;
+    pub fn getnameinfo(
+        sa: *const ::sockaddr,
+        salen: ::socklen_t,
+        host: *mut ::c_char,
+        hostlen: ::socklen_t,
+        serv: *mut ::c_char,
+        servlen: ::socklen_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
+
+    pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
+    pub fn if_nameindex() -> *mut if_nameindex;
+    pub fn if_freenameindex(ptr: *mut if_nameindex);
+
+    pub fn mremap(
+        addr: *mut ::c_void,
+        len: ::size_t,
+        new_len: ::size_t,
+        flags: ::c_int,
+        ...
+    ) -> *mut ::c_void;
+
+    pub fn glob(
+        pattern: *const c_char,
+        flags: ::c_int,
+        errfunc: ::Option<extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut ::glob_t,
+    ) -> ::c_int;
+    pub fn globfree(pglob: *mut ::glob_t);
+
+    pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+
+    pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
+
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+
+    pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
+    pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+
+    pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+
+    pub fn recvfrom(
+        socket: ::c_int,
+        buf: *mut ::c_void,
+        len: ::size_t,
+        flags: ::c_int,
+        addr: *mut ::sockaddr,
+        addrlen: *mut ::socklen_t,
+    ) -> ::ssize_t;
+    pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+
+    pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
+    pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int;
+    pub fn sendmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn recvmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_uint,
+        timeout: *mut ::timespec,
+    ) -> ::c_int;
+    pub fn sync();
+    pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
+    pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
+    pub fn pthread_create(
+        native: *mut ::pthread_t,
+        attr: *const ::pthread_attr_t,
+        f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
+        value: *mut ::c_void,
+    ) -> ::c_int;
+
+    pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
+}
+
+// Alias <foo> to <foo>64 to mimic glibc's LFS64 support
+mod lfs64;
+pub use self::lfs64::*;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        #[macro_use]
+        mod align;
+    } else {
+        #[macro_use]
+        mod no_align;
+    }
+}
+expand_align!();
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/emscripten/no_align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/emscripten/no_align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/emscripten/no_align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/emscripten/no_align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,63 @@
+macro_rules! expand_align {
+    () => {
+        s! {
+            pub struct pthread_mutex_t {
+                __align: [::c_long; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
+            }
+
+            pub struct pthread_rwlock_t {
+                __align: [::c_long; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
+            }
+
+            pub struct pthread_mutexattr_t {
+                __align: [::c_int; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
+            }
+
+            pub struct pthread_rwlockattr_t {
+                __align: [::c_int; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
+            }
+
+            pub struct pthread_condattr_t {
+                __align: [::c_int; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
+            }
+        }
+
+        s_no_extra_traits! {
+            pub struct pthread_cond_t {
+                __align: [*const ::c_void; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_COND_T],
+            }
+        }
+
+        cfg_if! {
+            if #[cfg(feature = "extra_traits")] {
+                impl PartialEq for pthread_cond_t {
+                    fn eq(&self, other: &pthread_cond_t) -> bool {
+                        self.size
+                            .iter()
+                            .zip(other.size.iter())
+                            .all(|(a,b)| a == b)
+                    }
+                }
+                impl Eq for pthread_cond_t {}
+                impl ::fmt::Debug for pthread_cond_t {
+                    fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                        f.debug_struct("pthread_cond_t")
+                            // FIXME: .field("size", &self.size)
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for pthread_cond_t {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        self.size.hash(state);
+                    }
+                }
+            }
+        }
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,205 @@
+macro_rules! expand_align {
+    () => {
+        s! {
+            #[cfg_attr(any(target_pointer_width = "32",
+                           target_arch = "x86_64",
+                           target_arch = "powerpc64",
+                           target_arch = "mips64",
+                           target_arch = "mips64r6",
+                           target_arch = "s390x",
+                           target_arch = "sparc64",
+                           target_arch = "aarch64",
+                           target_arch = "riscv64",
+                           target_arch = "riscv32",
+                           target_arch = "loongarch64"),
+                       repr(align(4)))]
+            #[cfg_attr(not(any(target_pointer_width = "32",
+                               target_arch = "x86_64",
+                               target_arch = "powerpc64",
+                               target_arch = "mips64",
+                               target_arch = "mips64r6",
+                               target_arch = "s390x",
+                               target_arch = "sparc64",
+                               target_arch = "aarch64",
+                               target_arch = "riscv64",
+                               target_arch = "riscv32",
+                               target_arch = "loongarch64")),
+                       repr(align(8)))]
+            pub struct pthread_mutexattr_t {
+                #[doc(hidden)]
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
+            }
+
+            #[cfg_attr(any(target_env = "musl", target_env = "ohos", target_pointer_width = "32"),
+                       repr(align(4)))]
+            #[cfg_attr(all(not(target_env = "musl"),
+                           not(target_env = "ohos"),
+                           target_pointer_width = "64"),
+                       repr(align(8)))]
+            pub struct pthread_rwlockattr_t {
+                #[doc(hidden)]
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
+            }
+
+            #[repr(align(4))]
+            pub struct pthread_condattr_t {
+                #[doc(hidden)]
+                size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
+            }
+
+            #[repr(align(4))]
+            pub struct pthread_barrierattr_t {
+                #[doc(hidden)]
+                size: [u8; ::__SIZEOF_PTHREAD_BARRIERATTR_T],
+            }
+
+            #[repr(align(8))]
+            pub struct fanotify_event_metadata {
+                pub event_len: __u32,
+                pub vers: __u8,
+                pub reserved: __u8,
+                pub metadata_len: __u16,
+                pub mask: __u64,
+                pub fd: ::c_int,
+                pub pid: ::c_int,
+            }
+        }
+
+        s_no_extra_traits! {
+            #[cfg_attr(all(any(target_env = "musl", target_env = "ohos"),
+                           target_pointer_width = "32"),
+                       repr(align(4)))]
+            #[cfg_attr(all(any(target_env = "musl", target_env = "ohos"),
+                           target_pointer_width = "64"),
+                       repr(align(8)))]
+            #[cfg_attr(all(not(any(target_env = "musl", target_env = "ohos")),
+                           target_arch = "x86"),
+                       repr(align(4)))]
+            #[cfg_attr(all(not(any(target_env = "musl", target_env = "ohos")),
+                           not(target_arch = "x86")),
+                       repr(align(8)))]
+            pub struct pthread_cond_t {
+                #[doc(hidden)]
+                size: [u8; ::__SIZEOF_PTHREAD_COND_T],
+            }
+
+            #[cfg_attr(all(target_pointer_width = "32",
+                           any(target_arch = "mips",
+                               target_arch = "mips32r6",
+                               target_arch = "arm",
+                               target_arch = "hexagon",
+                               target_arch = "m68k",
+                               target_arch = "csky",
+                               target_arch = "powerpc",
+                               target_arch = "sparc",
+                               target_arch = "x86_64",
+                               target_arch = "x86")),
+                       repr(align(4)))]
+            #[cfg_attr(any(target_pointer_width = "64",
+                           not(any(target_arch = "mips",
+                                   target_arch = "mips32r6",
+                                   target_arch = "arm",
+                                   target_arch = "hexagon",
+                                   target_arch = "m68k",
+                                   target_arch = "csky",
+                                   target_arch = "powerpc",
+                                   target_arch = "sparc",
+                                   target_arch = "x86_64",
+                                   target_arch = "x86"))),
+                       repr(align(8)))]
+            pub struct pthread_mutex_t {
+                #[doc(hidden)]
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
+            }
+
+            #[cfg_attr(all(target_pointer_width = "32",
+                           any(target_arch = "mips",
+                               target_arch = "mips32r6",
+                               target_arch = "arm",
+                               target_arch = "hexagon",
+                               target_arch = "m68k",
+                               target_arch = "csky",
+                               target_arch = "powerpc",
+                               target_arch = "sparc",
+                               target_arch = "x86_64",
+                               target_arch = "x86")),
+                       repr(align(4)))]
+            #[cfg_attr(any(target_pointer_width = "64",
+                           not(any(target_arch = "mips",
+                                   target_arch = "mips32r6",
+                                   target_arch = "arm",
+                                   target_arch = "hexagon",
+                                   target_arch = "m68k",
+                                   target_arch = "powerpc",
+                                   target_arch = "sparc",
+                                   target_arch = "x86_64",
+                                   target_arch = "x86"))),
+                       repr(align(8)))]
+            pub struct pthread_rwlock_t {
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
+            }
+
+            #[cfg_attr(all(target_pointer_width = "32",
+                           any(target_arch = "mips",
+                               target_arch = "mips32r6",
+                               target_arch = "arm",
+                               target_arch = "hexagon",
+                               target_arch = "m68k",
+                               target_arch = "csky",
+                               target_arch = "powerpc",
+                               target_arch = "sparc",
+                               target_arch = "x86_64",
+                               target_arch = "x86")),
+                       repr(align(4)))]
+            #[cfg_attr(any(target_pointer_width = "64",
+                           not(any(target_arch = "mips",
+                                   target_arch = "mips32r6",
+                                   target_arch = "arm",
+                                   target_arch = "hexagon",
+                                   target_arch = "m68k",
+                                   target_arch = "csky",
+                                   target_arch = "powerpc",
+                                   target_arch = "sparc",
+                                   target_arch = "x86_64",
+                                   target_arch = "x86"))),
+                       repr(align(8)))]
+            pub struct pthread_barrier_t {
+                size: [u8; ::__SIZEOF_PTHREAD_BARRIER_T],
+            }
+
+            // linux/can.h
+            #[repr(align(8))]
+            #[allow(missing_debug_implementations)]
+            pub struct can_frame {
+                pub can_id: canid_t,
+                pub can_dlc: u8,
+                __pad: u8,
+                __res0: u8,
+                __res1: u8,
+                pub data: [u8; CAN_MAX_DLEN],
+            }
+
+            #[repr(align(8))]
+            #[allow(missing_debug_implementations)]
+            pub struct canfd_frame {
+                pub can_id: canid_t,
+                pub len: u8,
+                pub flags: u8,
+                __res0: u8,
+                __res1: u8,
+                pub data: [u8; CANFD_MAX_DLEN],
+            }
+
+            #[repr(align(8))]
+            #[allow(missing_debug_implementations)]
+            pub struct canxl_frame {
+                pub prio: canid_t,
+                pub flags: u8,
+                pub sdt: u8,
+                pub len: u16,
+                pub af: u32,
+                pub data: [u8; CANXL_MAX_DLEN],
+            }
+        }
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,333 @@
+s! {
+    pub struct termios2 {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; 19],
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::speed_t,
+    }
+}
+
+// include/uapi/asm-generic/socket.h
+// arch/alpha/include/uapi/asm/socket.h
+// tools/include/uapi/asm-generic/socket.h
+// arch/mips/include/uapi/asm/socket.h
+pub const SOL_SOCKET: ::c_int = 1;
+
+// Defined in unix/linux_like/mod.rs
+// pub const SO_DEBUG: ::c_int = 1;
+pub const SO_REUSEADDR: ::c_int = 2;
+pub const SO_TYPE: ::c_int = 3;
+pub const SO_ERROR: ::c_int = 4;
+pub const SO_DONTROUTE: ::c_int = 5;
+pub const SO_BROADCAST: ::c_int = 6;
+pub const SO_SNDBUF: ::c_int = 7;
+pub const SO_RCVBUF: ::c_int = 8;
+pub const SO_KEEPALIVE: ::c_int = 9;
+pub const SO_OOBINLINE: ::c_int = 10;
+pub const SO_NO_CHECK: ::c_int = 11;
+pub const SO_PRIORITY: ::c_int = 12;
+pub const SO_LINGER: ::c_int = 13;
+pub const SO_BSDCOMPAT: ::c_int = 14;
+pub const SO_REUSEPORT: ::c_int = 15;
+pub const SO_PASSCRED: ::c_int = 16;
+pub const SO_PEERCRED: ::c_int = 17;
+pub const SO_RCVLOWAT: ::c_int = 18;
+pub const SO_SNDLOWAT: ::c_int = 19;
+pub const SO_RCVTIMEO: ::c_int = 20;
+pub const SO_SNDTIMEO: ::c_int = 21;
+// pub const SO_RCVTIMEO_OLD: ::c_int = 20;
+// pub const SO_SNDTIMEO_OLD: ::c_int = 21;
+pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
+pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
+pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
+pub const SO_BINDTODEVICE: ::c_int = 25;
+pub const SO_ATTACH_FILTER: ::c_int = 26;
+pub const SO_DETACH_FILTER: ::c_int = 27;
+pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
+pub const SO_PEERNAME: ::c_int = 28;
+pub const SO_TIMESTAMP: ::c_int = 29;
+// pub const SO_TIMESTAMP_OLD: ::c_int = 29;
+pub const SO_ACCEPTCONN: ::c_int = 30;
+pub const SO_PEERSEC: ::c_int = 31;
+pub const SO_SNDBUFFORCE: ::c_int = 32;
+pub const SO_RCVBUFFORCE: ::c_int = 33;
+pub const SO_PASSSEC: ::c_int = 34;
+pub const SO_TIMESTAMPNS: ::c_int = 35;
+// pub const SO_TIMESTAMPNS_OLD: ::c_int = 35;
+pub const SO_MARK: ::c_int = 36;
+pub const SO_TIMESTAMPING: ::c_int = 37;
+// pub const SO_TIMESTAMPING_OLD: ::c_int = 37;
+pub const SO_PROTOCOL: ::c_int = 38;
+pub const SO_DOMAIN: ::c_int = 39;
+pub const SO_RXQ_OVFL: ::c_int = 40;
+pub const SO_WIFI_STATUS: ::c_int = 41;
+pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
+pub const SO_PEEK_OFF: ::c_int = 42;
+pub const SO_NOFCS: ::c_int = 43;
+pub const SO_LOCK_FILTER: ::c_int = 44;
+pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
+pub const SO_BUSY_POLL: ::c_int = 46;
+pub const SO_MAX_PACING_RATE: ::c_int = 47;
+pub const SO_BPF_EXTENSIONS: ::c_int = 48;
+pub const SO_INCOMING_CPU: ::c_int = 49;
+pub const SO_ATTACH_BPF: ::c_int = 50;
+pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
+pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 51;
+pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 52;
+pub const SO_CNX_ADVICE: ::c_int = 53;
+pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 54;
+pub const SO_MEMINFO: ::c_int = 55;
+pub const SO_INCOMING_NAPI_ID: ::c_int = 56;
+pub const SO_COOKIE: ::c_int = 57;
+pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 58;
+pub const SO_PEERGROUPS: ::c_int = 59;
+pub const SO_ZEROCOPY: ::c_int = 60;
+pub const SO_TXTIME: ::c_int = 61;
+pub const SCM_TXTIME: ::c_int = SO_TXTIME;
+pub const SO_BINDTOIFINDEX: ::c_int = 62;
+cfg_if! {
+    // Some of these platforms in CI already have these constants.
+    // But they may still not have those _OLD ones.
+    if #[cfg(all(any(target_arch = "x86",
+                     target_arch = "x86_64",
+                     target_arch = "aarch64",
+                     target_arch = "csky",
+                     target_arch = "loongarch64"),
+                 not(any(target_env = "musl", target_env = "ohos"))))] {
+        pub const SO_TIMESTAMP_NEW: ::c_int = 63;
+        pub const SO_TIMESTAMPNS_NEW: ::c_int = 64;
+        pub const SO_TIMESTAMPING_NEW: ::c_int = 65;
+        pub const SO_RCVTIMEO_NEW: ::c_int = 66;
+        pub const SO_SNDTIMEO_NEW: ::c_int = 67;
+        pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 68;
+    }
+}
+// pub const SO_PREFER_BUSY_POLL: ::c_int = 69;
+// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70;
+
+cfg_if! {
+    if #[cfg(any(target_arch = "x86",
+                 target_arch = "x86_64",
+                 target_arch = "arm",
+                 target_arch = "aarch64",
+                 target_arch = "riscv64",
+                 target_arch = "s390x",
+                 target_arch = "csky",
+                 target_arch = "loongarch64"))] {
+        pub const FICLONE: ::c_ulong = 0x40049409;
+        pub const FICLONERANGE: ::c_ulong = 0x4020940D;
+    }
+}
+
+// Defined in unix/linux_like/mod.rs
+// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
+pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
+pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
+
+// Ioctl Constants
+
+pub const TCGETS: ::Ioctl = 0x5401;
+pub const TCSETS: ::Ioctl = 0x5402;
+pub const TCSETSW: ::Ioctl = 0x5403;
+pub const TCSETSF: ::Ioctl = 0x5404;
+pub const TCGETA: ::Ioctl = 0x5405;
+pub const TCSETA: ::Ioctl = 0x5406;
+pub const TCSETAW: ::Ioctl = 0x5407;
+pub const TCSETAF: ::Ioctl = 0x5408;
+pub const TCSBRK: ::Ioctl = 0x5409;
+pub const TCXONC: ::Ioctl = 0x540A;
+pub const TCFLSH: ::Ioctl = 0x540B;
+pub const TIOCEXCL: ::Ioctl = 0x540C;
+pub const TIOCNXCL: ::Ioctl = 0x540D;
+pub const TIOCSCTTY: ::Ioctl = 0x540E;
+pub const TIOCGPGRP: ::Ioctl = 0x540F;
+pub const TIOCSPGRP: ::Ioctl = 0x5410;
+pub const TIOCOUTQ: ::Ioctl = 0x5411;
+pub const TIOCSTI: ::Ioctl = 0x5412;
+pub const TIOCGWINSZ: ::Ioctl = 0x5413;
+pub const TIOCSWINSZ: ::Ioctl = 0x5414;
+pub const TIOCMGET: ::Ioctl = 0x5415;
+pub const TIOCMBIS: ::Ioctl = 0x5416;
+pub const TIOCMBIC: ::Ioctl = 0x5417;
+pub const TIOCMSET: ::Ioctl = 0x5418;
+pub const TIOCGSOFTCAR: ::Ioctl = 0x5419;
+pub const TIOCSSOFTCAR: ::Ioctl = 0x541A;
+pub const FIONREAD: ::Ioctl = 0x541B;
+pub const TIOCINQ: ::Ioctl = FIONREAD;
+pub const TIOCLINUX: ::Ioctl = 0x541C;
+pub const TIOCCONS: ::Ioctl = 0x541D;
+pub const TIOCGSERIAL: ::Ioctl = 0x541E;
+pub const TIOCSSERIAL: ::Ioctl = 0x541F;
+pub const TIOCPKT: ::Ioctl = 0x5420;
+pub const FIONBIO: ::Ioctl = 0x5421;
+pub const TIOCNOTTY: ::Ioctl = 0x5422;
+pub const TIOCSETD: ::Ioctl = 0x5423;
+pub const TIOCGETD: ::Ioctl = 0x5424;
+pub const TCSBRKP: ::Ioctl = 0x5425;
+pub const TIOCSBRK: ::Ioctl = 0x5427;
+pub const TIOCCBRK: ::Ioctl = 0x5428;
+pub const TIOCGSID: ::Ioctl = 0x5429;
+pub const TCGETS2: ::Ioctl = 0x802c542a;
+pub const TCSETS2: ::Ioctl = 0x402c542b;
+pub const TCSETSW2: ::Ioctl = 0x402c542c;
+pub const TCSETSF2: ::Ioctl = 0x402c542d;
+pub const TIOCGRS485: ::Ioctl = 0x542E;
+pub const TIOCSRS485: ::Ioctl = 0x542F;
+pub const TIOCGPTN: ::Ioctl = 0x80045430;
+pub const TIOCSPTLCK: ::Ioctl = 0x40045431;
+pub const TIOCGDEV: ::Ioctl = 0x80045432;
+pub const TCGETX: ::Ioctl = 0x5432;
+pub const TCSETX: ::Ioctl = 0x5433;
+pub const TCSETXF: ::Ioctl = 0x5434;
+pub const TCSETXW: ::Ioctl = 0x5435;
+pub const TIOCSIG: ::Ioctl = 0x40045436;
+pub const TIOCVHANGUP: ::Ioctl = 0x5437;
+pub const TIOCGPKT: ::Ioctl = 0x80045438;
+pub const TIOCGPTLCK: ::Ioctl = 0x80045439;
+pub const TIOCGEXCL: ::Ioctl = 0x80045440;
+pub const TIOCGPTPEER: ::Ioctl = 0x5441;
+// pub const TIOCGISO7816: ::Ioctl = 0x80285442;
+// pub const TIOCSISO7816: ::Ioctl = 0xc0285443;
+pub const FIONCLEX: ::Ioctl = 0x5450;
+pub const FIOCLEX: ::Ioctl = 0x5451;
+pub const FIOASYNC: ::Ioctl = 0x5452;
+pub const TIOCSERCONFIG: ::Ioctl = 0x5453;
+pub const TIOCSERGWILD: ::Ioctl = 0x5454;
+pub const TIOCSERSWILD: ::Ioctl = 0x5455;
+pub const TIOCGLCKTRMIOS: ::Ioctl = 0x5456;
+pub const TIOCSLCKTRMIOS: ::Ioctl = 0x5457;
+pub const TIOCSERGSTRUCT: ::Ioctl = 0x5458;
+pub const TIOCSERGETLSR: ::Ioctl = 0x5459;
+pub const TIOCSERGETMULTI: ::Ioctl = 0x545A;
+pub const TIOCSERSETMULTI: ::Ioctl = 0x545B;
+pub const TIOCMIWAIT: ::Ioctl = 0x545C;
+pub const TIOCGICOUNT: ::Ioctl = 0x545D;
+pub const BLKIOMIN: ::Ioctl = 0x1278;
+pub const BLKIOOPT: ::Ioctl = 0x1279;
+pub const BLKSSZGET: ::Ioctl = 0x1268;
+pub const BLKPBSZGET: ::Ioctl = 0x127B;
+
+cfg_if! {
+    // Those type are constructed using the _IOC macro
+    // DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN
+    // where D stands for direction (either None (00), Read (01) or Write (11))
+    // where S stands for size (int, long, struct...)
+    // where T stands for type ('f','v','X'...)
+    // where N stands for NR (NumbeR)
+    if #[cfg(any(target_arch = "x86", target_arch = "arm", target_arch = "csky"))] {
+        pub const FS_IOC_GETFLAGS: ::Ioctl = 0x80046601;
+        pub const FS_IOC_SETFLAGS: ::Ioctl = 0x40046602;
+        pub const FS_IOC_GETVERSION: ::Ioctl = 0x80047601;
+        pub const FS_IOC_SETVERSION: ::Ioctl = 0x40047602;
+        pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x80046601;
+        pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x40046602;
+        pub const FS_IOC32_GETVERSION: ::Ioctl = 0x80047601;
+        pub const FS_IOC32_SETVERSION: ::Ioctl = 0x40047602;
+    } else if #[cfg(any(target_arch = "x86_64",
+                        target_arch = "riscv64",
+                        target_arch = "aarch64",
+                        target_arch = "s390x",
+                        target_arch = "loongarch64"))] {
+        pub const FS_IOC_GETFLAGS: ::Ioctl = 0x80086601;
+        pub const FS_IOC_SETFLAGS: ::Ioctl = 0x40086602;
+        pub const FS_IOC_GETVERSION: ::Ioctl = 0x80087601;
+        pub const FS_IOC_SETVERSION: ::Ioctl = 0x40087602;
+        pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x80046601;
+        pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x40046602;
+        pub const FS_IOC32_GETVERSION: ::Ioctl = 0x80047601;
+        pub const FS_IOC32_SETVERSION: ::Ioctl = 0x40047602;
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(target_arch = "arm",
+                 target_arch = "s390x"))] {
+        pub const FIOQSIZE: ::Ioctl = 0x545E;
+    } else {
+        pub const FIOQSIZE: ::Ioctl = 0x5460;
+    }
+}
+
+pub const TIOCM_LE: ::c_int = 0x001;
+pub const TIOCM_DTR: ::c_int = 0x002;
+pub const TIOCM_RTS: ::c_int = 0x004;
+pub const TIOCM_ST: ::c_int = 0x008;
+pub const TIOCM_SR: ::c_int = 0x010;
+pub const TIOCM_CTS: ::c_int = 0x020;
+pub const TIOCM_CAR: ::c_int = 0x040;
+pub const TIOCM_CD: ::c_int = TIOCM_CAR;
+pub const TIOCM_RNG: ::c_int = 0x080;
+pub const TIOCM_RI: ::c_int = TIOCM_RNG;
+pub const TIOCM_DSR: ::c_int = 0x100;
+
+pub const BOTHER: ::speed_t = 0o010000;
+pub const IBSHIFT: ::tcflag_t = 16;
+
+// RLIMIT Constants
+
+cfg_if! {
+    if #[cfg(any(target_env = "gnu",
+                 target_env = "uclibc"))] {
+
+        pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
+        pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
+        pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
+        pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
+        pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
+        pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
+        pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
+        pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
+        pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
+        pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
+        pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
+        pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
+        pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
+        pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
+        pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
+        pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
+        #[allow(deprecated)]
+        #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+        pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS;
+
+    } else if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
+
+        pub const RLIMIT_CPU: ::c_int = 0;
+        pub const RLIMIT_FSIZE: ::c_int = 1;
+        pub const RLIMIT_DATA: ::c_int = 2;
+        pub const RLIMIT_STACK: ::c_int = 3;
+        pub const RLIMIT_CORE: ::c_int = 4;
+        pub const RLIMIT_RSS: ::c_int = 5;
+        pub const RLIMIT_NPROC: ::c_int = 6;
+        pub const RLIMIT_NOFILE: ::c_int = 7;
+        pub const RLIMIT_MEMLOCK: ::c_int = 8;
+        pub const RLIMIT_AS: ::c_int = 9;
+        pub const RLIMIT_LOCKS: ::c_int = 10;
+        pub const RLIMIT_SIGPENDING: ::c_int = 11;
+        pub const RLIMIT_MSGQUEUE: ::c_int = 12;
+        pub const RLIMIT_NICE: ::c_int = 13;
+        pub const RLIMIT_RTPRIO: ::c_int = 14;
+        pub const RLIMIT_RTTIME: ::c_int = 15;
+        #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+        pub const RLIM_NLIMITS: ::c_int = 15;
+        #[allow(deprecated)]
+        #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+        pub const RLIMIT_NLIMITS: ::c_int = RLIM_NLIMITS;
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_env = "gnu")] {
+        #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+        pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16;
+    }
+    else if #[cfg(target_env = "uclibc")] {
+        #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+        pub const RLIM_NLIMITS: ::__rlimit_resource_t = 15;
+    }
+}
+
+pub const RLIM_INFINITY: ::rlim_t = !0;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/arch/mips/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/arch/mips/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/arch/mips/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/arch/mips/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,323 @@
+s! {
+    pub struct termios2 {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; 23],
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::speed_t,
+    }
+}
+
+// arch/mips/include/uapi/asm/socket.h
+pub const SOL_SOCKET: ::c_int = 0xffff;
+
+// Defined in unix/linux_like/mod.rs
+// pub const SO_DEBUG: ::c_int = 0x0001;
+pub const SO_REUSEADDR: ::c_int = 0x0004;
+pub const SO_KEEPALIVE: ::c_int = 0x0008;
+pub const SO_DONTROUTE: ::c_int = 0x0010;
+pub const SO_BROADCAST: ::c_int = 0x0020;
+pub const SO_LINGER: ::c_int = 0x0080;
+pub const SO_OOBINLINE: ::c_int = 0x0100;
+pub const SO_REUSEPORT: ::c_int = 0x0200;
+pub const SO_TYPE: ::c_int = 0x1008;
+// pub const SO_STYLE: ::c_int = SO_TYPE;
+pub const SO_ERROR: ::c_int = 0x1007;
+pub const SO_SNDBUF: ::c_int = 0x1001;
+pub const SO_RCVBUF: ::c_int = 0x1002;
+pub const SO_SNDLOWAT: ::c_int = 0x1003;
+pub const SO_RCVLOWAT: ::c_int = 0x1004;
+// NOTE: These definitions are now being renamed with _OLD postfix,
+// but CI haven't support them yet.
+// Some related consts could be found in b32.rs and b64.rs
+pub const SO_SNDTIMEO: ::c_int = 0x1005;
+pub const SO_RCVTIMEO: ::c_int = 0x1006;
+// pub const SO_SNDTIMEO_OLD: ::c_int = 0x1005;
+// pub const SO_RCVTIMEO_OLD: ::c_int = 0x1006;
+pub const SO_ACCEPTCONN: ::c_int = 0x1009;
+pub const SO_PROTOCOL: ::c_int = 0x1028;
+pub const SO_DOMAIN: ::c_int = 0x1029;
+
+pub const SO_NO_CHECK: ::c_int = 11;
+pub const SO_PRIORITY: ::c_int = 12;
+pub const SO_BSDCOMPAT: ::c_int = 14;
+pub const SO_PASSCRED: ::c_int = 17;
+pub const SO_PEERCRED: ::c_int = 18;
+pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
+pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
+pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
+pub const SO_BINDTODEVICE: ::c_int = 25;
+pub const SO_ATTACH_FILTER: ::c_int = 26;
+pub const SO_DETACH_FILTER: ::c_int = 27;
+pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
+pub const SO_PEERNAME: ::c_int = 28;
+pub const SO_PEERSEC: ::c_int = 30;
+pub const SO_SNDBUFFORCE: ::c_int = 31;
+pub const SO_RCVBUFFORCE: ::c_int = 33;
+pub const SO_PASSSEC: ::c_int = 34;
+pub const SO_MARK: ::c_int = 36;
+pub const SO_RXQ_OVFL: ::c_int = 40;
+pub const SO_WIFI_STATUS: ::c_int = 41;
+pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
+pub const SO_PEEK_OFF: ::c_int = 42;
+pub const SO_NOFCS: ::c_int = 43;
+pub const SO_LOCK_FILTER: ::c_int = 44;
+pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
+pub const SO_BUSY_POLL: ::c_int = 46;
+pub const SO_MAX_PACING_RATE: ::c_int = 47;
+pub const SO_BPF_EXTENSIONS: ::c_int = 48;
+pub const SO_INCOMING_CPU: ::c_int = 49;
+pub const SO_ATTACH_BPF: ::c_int = 50;
+pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
+pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 51;
+pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 52;
+pub const SO_CNX_ADVICE: ::c_int = 53;
+pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 54;
+pub const SO_MEMINFO: ::c_int = 55;
+pub const SO_INCOMING_NAPI_ID: ::c_int = 56;
+pub const SO_COOKIE: ::c_int = 57;
+pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 58;
+pub const SO_PEERGROUPS: ::c_int = 59;
+pub const SO_ZEROCOPY: ::c_int = 60;
+pub const SO_TXTIME: ::c_int = 61;
+pub const SCM_TXTIME: ::c_int = SO_TXTIME;
+pub const SO_BINDTOIFINDEX: ::c_int = 62;
+// NOTE: These definitions are now being renamed with _OLD postfix,
+// but CI haven't support them yet.
+// Some related consts could be found in b32.rs and b64.rs
+pub const SO_TIMESTAMP: ::c_int = 29;
+pub const SO_TIMESTAMPNS: ::c_int = 35;
+pub const SO_TIMESTAMPING: ::c_int = 37;
+// pub const SO_TIMESTAMP_OLD: ::c_int = 29;
+// pub const SO_TIMESTAMPNS_OLD: ::c_int = 35;
+// pub const SO_TIMESTAMPING_OLD: ::c_int = 37;
+// pub const SO_TIMESTAMP_NEW: ::c_int = 63;
+// pub const SO_TIMESTAMPNS_NEW: ::c_int = 64;
+// pub const SO_TIMESTAMPING_NEW: ::c_int = 65;
+// pub const SO_RCVTIMEO_NEW: ::c_int = 66;
+// pub const SO_SNDTIMEO_NEW: ::c_int = 67;
+// pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 68;
+// pub const SO_PREFER_BUSY_POLL: ::c_int = 69;
+// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70;
+
+pub const FICLONE: ::c_ulong = 0x80049409;
+pub const FICLONERANGE: ::c_ulong = 0x8020940D;
+
+// Defined in unix/linux_like/mod.rs
+// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
+pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
+pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
+
+// Ioctl Constants
+
+pub const TCGETS: ::Ioctl = 0x540d;
+pub const TCSETS: ::Ioctl = 0x540e;
+pub const TCSETSW: ::Ioctl = 0x540f;
+pub const TCSETSF: ::Ioctl = 0x5410;
+pub const TCGETA: ::Ioctl = 0x5401;
+pub const TCSETA: ::Ioctl = 0x5402;
+pub const TCSETAW: ::Ioctl = 0x5403;
+pub const TCSETAF: ::Ioctl = 0x5404;
+pub const TCSBRK: ::Ioctl = 0x5405;
+pub const TCXONC: ::Ioctl = 0x5406;
+pub const TCFLSH: ::Ioctl = 0x5407;
+pub const TIOCEXCL: ::Ioctl = 0x740d;
+pub const TIOCNXCL: ::Ioctl = 0x740e;
+pub const TIOCSCTTY: ::Ioctl = 0x5480;
+pub const TIOCGPGRP: ::Ioctl = 0x40047477;
+pub const TIOCSPGRP: ::Ioctl = 0x80047476;
+pub const TIOCOUTQ: ::Ioctl = 0x7472;
+pub const TIOCSTI: ::Ioctl = 0x5472;
+pub const TIOCGWINSZ: ::Ioctl = 0x40087468;
+pub const TIOCSWINSZ: ::Ioctl = 0x80087467;
+pub const TIOCMGET: ::Ioctl = 0x741d;
+pub const TIOCMBIS: ::Ioctl = 0x741b;
+pub const TIOCMBIC: ::Ioctl = 0x741c;
+pub const TIOCMSET: ::Ioctl = 0x741a;
+pub const TIOCGSOFTCAR: ::Ioctl = 0x5481;
+pub const TIOCSSOFTCAR: ::Ioctl = 0x5482;
+pub const FIONREAD: ::Ioctl = 0x467f;
+pub const TIOCINQ: ::Ioctl = FIONREAD;
+pub const TIOCLINUX: ::Ioctl = 0x5483;
+pub const TIOCCONS: ::Ioctl = 0x80047478;
+pub const TIOCGSERIAL: ::Ioctl = 0x5484;
+pub const TIOCSSERIAL: ::Ioctl = 0x5485;
+pub const TIOCPKT: ::Ioctl = 0x5470;
+pub const FIONBIO: ::Ioctl = 0x667e;
+pub const TIOCNOTTY: ::Ioctl = 0x5471;
+pub const TIOCSETD: ::Ioctl = 0x7401;
+pub const TIOCGETD: ::Ioctl = 0x7400;
+pub const TCSBRKP: ::Ioctl = 0x5486;
+pub const TIOCSBRK: ::Ioctl = 0x5427;
+pub const TIOCCBRK: ::Ioctl = 0x5428;
+pub const TIOCGSID: ::Ioctl = 0x7416;
+pub const TCGETS2: ::Ioctl = 0x4030542a;
+pub const TCSETS2: ::Ioctl = 0x8030542b;
+pub const TCSETSW2: ::Ioctl = 0x8030542c;
+pub const TCSETSF2: ::Ioctl = 0x8030542d;
+pub const TIOCGPTN: ::Ioctl = 0x40045430;
+pub const TIOCSPTLCK: ::Ioctl = 0x80045431;
+pub const TIOCGDEV: ::Ioctl = 0x40045432;
+pub const TIOCSIG: ::Ioctl = 0x80045436;
+pub const TIOCVHANGUP: ::Ioctl = 0x5437;
+pub const TIOCGPKT: ::Ioctl = 0x40045438;
+pub const TIOCGPTLCK: ::Ioctl = 0x40045439;
+pub const TIOCGEXCL: ::Ioctl = 0x40045440;
+pub const TIOCGPTPEER: ::Ioctl = 0x20005441;
+//pub const TIOCGISO7816: ::Ioctl = 0x40285442;
+//pub const TIOCSISO7816: ::Ioctl = 0xc0285443;
+pub const FIONCLEX: ::Ioctl = 0x6602;
+pub const FIOCLEX: ::Ioctl = 0x6601;
+pub const FIOASYNC: ::Ioctl = 0x667d;
+pub const TIOCSERCONFIG: ::Ioctl = 0x5488;
+pub const TIOCSERGWILD: ::Ioctl = 0x5489;
+pub const TIOCSERSWILD: ::Ioctl = 0x548a;
+pub const TIOCGLCKTRMIOS: ::Ioctl = 0x548b;
+pub const TIOCSLCKTRMIOS: ::Ioctl = 0x548c;
+pub const TIOCSERGSTRUCT: ::Ioctl = 0x548d;
+pub const TIOCSERGETLSR: ::Ioctl = 0x548e;
+pub const TIOCSERGETMULTI: ::Ioctl = 0x548f;
+pub const TIOCSERSETMULTI: ::Ioctl = 0x5490;
+pub const TIOCMIWAIT: ::Ioctl = 0x5491;
+pub const TIOCGICOUNT: ::Ioctl = 0x5492;
+pub const FIOQSIZE: ::Ioctl = 0x667f;
+pub const TIOCSLTC: ::Ioctl = 0x7475;
+pub const TIOCGETP: ::Ioctl = 0x7408;
+pub const TIOCSETP: ::Ioctl = 0x7409;
+pub const TIOCSETN: ::Ioctl = 0x740a;
+pub const BLKIOMIN: ::Ioctl = 0x20001278;
+pub const BLKIOOPT: ::Ioctl = 0x20001279;
+pub const BLKSSZGET: ::Ioctl = 0x20001268;
+pub const BLKPBSZGET: ::Ioctl = 0x2000127B;
+
+cfg_if! {
+    // Those type are constructed using the _IOC macro
+    // DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN
+    // where D stands for direction (either None (00), Read (01) or Write (11))
+    // where S stands for size (int, long, struct...)
+    // where T stands for type ('f','v','X'...)
+    // where N stands for NR (NumbeR)
+    if #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] {
+        pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40046601;
+        pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80046602;
+        pub const FS_IOC_GETVERSION: ::Ioctl = 0x40047601;
+        pub const FS_IOC_SETVERSION: ::Ioctl = 0x80047602;
+        pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
+        pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
+        pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
+        pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
+    } else if #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))] {
+        pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40086601;
+        pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80086602;
+        pub const FS_IOC_GETVERSION: ::Ioctl = 0x40087601;
+        pub const FS_IOC_SETVERSION: ::Ioctl = 0x80087602;
+        pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
+        pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
+        pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
+        pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_env = "musl")] {
+        pub const TIOCGRS485: ::Ioctl = 0x4020542e;
+        pub const TIOCSRS485: ::Ioctl = 0xc020542f;
+    }
+}
+
+pub const TIOCM_LE: ::c_int = 0x001;
+pub const TIOCM_DTR: ::c_int = 0x002;
+pub const TIOCM_RTS: ::c_int = 0x004;
+pub const TIOCM_ST: ::c_int = 0x010;
+pub const TIOCM_SR: ::c_int = 0x020;
+pub const TIOCM_CTS: ::c_int = 0x040;
+pub const TIOCM_CAR: ::c_int = 0x100;
+pub const TIOCM_CD: ::c_int = TIOCM_CAR;
+pub const TIOCM_RNG: ::c_int = 0x200;
+pub const TIOCM_RI: ::c_int = TIOCM_RNG;
+pub const TIOCM_DSR: ::c_int = 0x400;
+
+pub const BOTHER: ::speed_t = 0o010000;
+pub const IBSHIFT: ::tcflag_t = 16;
+
+// RLIMIT Constants
+
+cfg_if! {
+    if #[cfg(any(target_env = "gnu",
+                 target_env = "uclibc"))] {
+
+        pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
+        pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
+        pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
+        pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
+        pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
+        pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 5;
+        pub const RLIMIT_AS: ::__rlimit_resource_t = 6;
+        pub const RLIMIT_RSS: ::__rlimit_resource_t = 7;
+        pub const RLIMIT_NPROC: ::__rlimit_resource_t = 8;
+        pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 9;
+        pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
+        pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
+        pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
+        pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
+        pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
+        pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
+        #[allow(deprecated)]
+        #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+        pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS;
+
+    } else if #[cfg(target_env = "musl")] {
+
+        pub const RLIMIT_CPU: ::c_int = 0;
+        pub const RLIMIT_FSIZE: ::c_int = 1;
+        pub const RLIMIT_DATA: ::c_int = 2;
+        pub const RLIMIT_STACK: ::c_int = 3;
+        pub const RLIMIT_CORE: ::c_int = 4;
+        pub const RLIMIT_NOFILE: ::c_int = 5;
+        pub const RLIMIT_AS: ::c_int = 6;
+        pub const RLIMIT_RSS: ::c_int = 7;
+        pub const RLIMIT_NPROC: ::c_int = 8;
+        pub const RLIMIT_MEMLOCK: ::c_int = 9;
+        pub const RLIMIT_LOCKS: ::c_int = 10;
+        pub const RLIMIT_SIGPENDING: ::c_int = 11;
+        pub const RLIMIT_MSGQUEUE: ::c_int = 12;
+        pub const RLIMIT_NICE: ::c_int = 13;
+        pub const RLIMIT_RTPRIO: ::c_int = 14;
+        pub const RLIMIT_RTTIME: ::c_int = 15;
+        #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+        pub const RLIM_NLIMITS: ::c_int = 15;
+        #[allow(deprecated)]
+        #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+        pub const RLIMIT_NLIMITS: ::c_int = RLIM_NLIMITS;
+        pub const RLIM_INFINITY: ::rlim_t = !0;
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_env = "gnu")] {
+        #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+        pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16;
+    } else if #[cfg(target_env = "uclibc")] {
+        #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+        pub const RLIM_NLIMITS: ::__rlimit_resource_t = 15;
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"),
+         any(target_env = "gnu",
+             target_env = "uclibc"))] {
+        pub const RLIM_INFINITY: ::rlim_t = !0;
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(target_arch = "mips", target_arch = "mips32r6"),
+         any(target_env = "gnu",
+             target_env = "uclibc"))] {
+        pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/arch/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/arch/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/arch/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/arch/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,18 @@
+cfg_if! {
+    if #[cfg(any(target_arch = "mips",
+                 target_arch = "mips32r6",
+                 target_arch = "mips64",
+                 target_arch = "mips64r6"))] {
+        mod mips;
+        pub use self::mips::*;
+    } else if #[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))] {
+        mod powerpc;
+        pub use self::powerpc::*;
+    } else if #[cfg(any(target_arch = "sparc", target_arch = "sparc64"))] {
+        mod sparc;
+        pub use self::sparc::*;
+    } else {
+        mod generic;
+        pub use self::generic::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/arch/powerpc/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/arch/powerpc/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/arch/powerpc/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/arch/powerpc/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,277 @@
+// arch/powerpc/include/uapi/asm/socket.h
+
+pub const SOL_SOCKET: ::c_int = 1;
+
+// Defined in unix/linux_like/mod.rs
+// pub const SO_DEBUG: ::c_int = 1;
+pub const SO_REUSEADDR: ::c_int = 2;
+pub const SO_TYPE: ::c_int = 3;
+pub const SO_ERROR: ::c_int = 4;
+pub const SO_DONTROUTE: ::c_int = 5;
+pub const SO_BROADCAST: ::c_int = 6;
+pub const SO_SNDBUF: ::c_int = 7;
+pub const SO_RCVBUF: ::c_int = 8;
+pub const SO_KEEPALIVE: ::c_int = 9;
+pub const SO_OOBINLINE: ::c_int = 10;
+pub const SO_NO_CHECK: ::c_int = 11;
+pub const SO_PRIORITY: ::c_int = 12;
+pub const SO_LINGER: ::c_int = 13;
+pub const SO_BSDCOMPAT: ::c_int = 14;
+pub const SO_REUSEPORT: ::c_int = 15;
+// powerpc only differs in these
+pub const SO_RCVLOWAT: ::c_int = 16;
+pub const SO_SNDLOWAT: ::c_int = 17;
+pub const SO_RCVTIMEO: ::c_int = 18;
+pub const SO_SNDTIMEO: ::c_int = 19;
+// pub const SO_RCVTIMEO_OLD: ::c_int = 18;
+// pub const SO_SNDTIMEO_OLD: ::c_int = 19;
+pub const SO_PASSCRED: ::c_int = 20;
+pub const SO_PEERCRED: ::c_int = 21;
+// end
+pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
+pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
+pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
+pub const SO_BINDTODEVICE: ::c_int = 25;
+pub const SO_ATTACH_FILTER: ::c_int = 26;
+pub const SO_DETACH_FILTER: ::c_int = 27;
+pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
+pub const SO_PEERNAME: ::c_int = 28;
+pub const SO_TIMESTAMP: ::c_int = 29;
+// pub const SO_TIMESTAMP_OLD: ::c_int = 29;
+pub const SO_ACCEPTCONN: ::c_int = 30;
+pub const SO_PEERSEC: ::c_int = 31;
+pub const SO_SNDBUFFORCE: ::c_int = 32;
+pub const SO_RCVBUFFORCE: ::c_int = 33;
+pub const SO_PASSSEC: ::c_int = 34;
+pub const SO_TIMESTAMPNS: ::c_int = 35;
+// pub const SO_TIMESTAMPNS_OLD: ::c_int = 35;
+pub const SO_MARK: ::c_int = 36;
+pub const SO_TIMESTAMPING: ::c_int = 37;
+// pub const SO_TIMESTAMPING_OLD: ::c_int = 37;
+pub const SO_PROTOCOL: ::c_int = 38;
+pub const SO_DOMAIN: ::c_int = 39;
+pub const SO_RXQ_OVFL: ::c_int = 40;
+pub const SO_WIFI_STATUS: ::c_int = 41;
+pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
+pub const SO_PEEK_OFF: ::c_int = 42;
+pub const SO_NOFCS: ::c_int = 43;
+pub const SO_LOCK_FILTER: ::c_int = 44;
+pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
+pub const SO_BUSY_POLL: ::c_int = 46;
+pub const SO_MAX_PACING_RATE: ::c_int = 47;
+pub const SO_BPF_EXTENSIONS: ::c_int = 48;
+pub const SO_INCOMING_CPU: ::c_int = 49;
+pub const SO_ATTACH_BPF: ::c_int = 50;
+pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
+pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 51;
+pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 52;
+pub const SO_CNX_ADVICE: ::c_int = 53;
+pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 54;
+pub const SO_MEMINFO: ::c_int = 55;
+pub const SO_INCOMING_NAPI_ID: ::c_int = 56;
+pub const SO_COOKIE: ::c_int = 57;
+pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 58;
+pub const SO_PEERGROUPS: ::c_int = 59;
+pub const SO_ZEROCOPY: ::c_int = 60;
+pub const SO_TXTIME: ::c_int = 61;
+pub const SCM_TXTIME: ::c_int = SO_TXTIME;
+pub const SO_BINDTOIFINDEX: ::c_int = 62;
+// pub const SO_TIMESTAMP_NEW: ::c_int = 63;
+// pub const SO_TIMESTAMPNS_NEW: ::c_int = 64;
+// pub const SO_TIMESTAMPING_NEW: ::c_int = 65;
+// pub const SO_RCVTIMEO_NEW: ::c_int = 66;
+// pub const SO_SNDTIMEO_NEW: ::c_int = 67;
+// pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 68;
+// pub const SO_PREFER_BUSY_POLL: ::c_int = 69;
+// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70;
+
+pub const FICLONE: ::c_ulong = 0x80049409;
+pub const FICLONERANGE: ::c_ulong = 0x8020940D;
+
+// Defined in unix/linux_like/mod.rs
+// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
+pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
+pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
+
+// Ioctl Constants
+
+cfg_if! {
+    if #[cfg(target_env = "gnu")] {
+        pub const TCGETS: ::Ioctl = 0x403c7413;
+        pub const TCSETS: ::Ioctl = 0x803c7414;
+        pub const TCSETSW: ::Ioctl = 0x803c7415;
+        pub const TCSETSF: ::Ioctl = 0x803c7416;
+    } else if #[cfg(target_env = "musl")] {
+        pub const TCGETS: ::Ioctl = 0x402c7413;
+        pub const TCSETS: ::Ioctl = 0x802c7414;
+        pub const TCSETSW: ::Ioctl = 0x802c7415;
+        pub const TCSETSF: ::Ioctl = 0x802c7416;
+    }
+}
+
+pub const TCGETA: ::Ioctl = 0x40147417;
+pub const TCSETA: ::Ioctl = 0x80147418;
+pub const TCSETAW: ::Ioctl = 0x80147419;
+pub const TCSETAF: ::Ioctl = 0x8014741C;
+pub const TCSBRK: ::Ioctl = 0x2000741D;
+pub const TCXONC: ::Ioctl = 0x2000741E;
+pub const TCFLSH: ::Ioctl = 0x2000741F;
+pub const TIOCEXCL: ::Ioctl = 0x540C;
+pub const TIOCNXCL: ::Ioctl = 0x540D;
+pub const TIOCSCTTY: ::Ioctl = 0x540E;
+pub const TIOCGPGRP: ::Ioctl = 0x40047477;
+pub const TIOCSPGRP: ::Ioctl = 0x80047476;
+pub const TIOCOUTQ: ::Ioctl = 0x40047473;
+pub const TIOCSTI: ::Ioctl = 0x5412;
+pub const TIOCGWINSZ: ::Ioctl = 0x40087468;
+pub const TIOCSWINSZ: ::Ioctl = 0x80087467;
+pub const TIOCMGET: ::Ioctl = 0x5415;
+pub const TIOCMBIS: ::Ioctl = 0x5416;
+pub const TIOCMBIC: ::Ioctl = 0x5417;
+pub const TIOCMSET: ::Ioctl = 0x5418;
+pub const TIOCGSOFTCAR: ::Ioctl = 0x5419;
+pub const TIOCSSOFTCAR: ::Ioctl = 0x541A;
+pub const FIONREAD: ::Ioctl = 0x4004667F;
+pub const TIOCINQ: ::Ioctl = FIONREAD;
+pub const TIOCLINUX: ::Ioctl = 0x541C;
+pub const TIOCCONS: ::Ioctl = 0x541D;
+pub const TIOCGSERIAL: ::Ioctl = 0x541E;
+pub const TIOCSSERIAL: ::Ioctl = 0x541F;
+pub const TIOCPKT: ::Ioctl = 0x5420;
+pub const FIONBIO: ::Ioctl = 0x8004667e;
+pub const TIOCNOTTY: ::Ioctl = 0x5422;
+pub const TIOCSETD: ::Ioctl = 0x5423;
+pub const TIOCGETD: ::Ioctl = 0x5424;
+pub const TCSBRKP: ::Ioctl = 0x5425;
+pub const TIOCSBRK: ::Ioctl = 0x5427;
+pub const TIOCCBRK: ::Ioctl = 0x5428;
+pub const TIOCGSID: ::Ioctl = 0x5429;
+pub const TIOCGRS485: ::Ioctl = 0x542e;
+pub const TIOCSRS485: ::Ioctl = 0x542f;
+pub const TIOCGPTN: ::Ioctl = 0x40045430;
+pub const TIOCSPTLCK: ::Ioctl = 0x80045431;
+pub const TIOCGDEV: ::Ioctl = 0x40045432;
+pub const TIOCSIG: ::Ioctl = 0x80045436;
+pub const TIOCVHANGUP: ::Ioctl = 0x5437;
+pub const TIOCGPKT: ::Ioctl = 0x40045438;
+pub const TIOCGPTLCK: ::Ioctl = 0x40045439;
+pub const TIOCGEXCL: ::Ioctl = 0x40045440;
+pub const TIOCGPTPEER: ::Ioctl = 0x20005441;
+//pub const TIOCGISO7816: ::Ioctl = 0x40285442;
+//pub const TIOCSISO7816: ::Ioctl = 0xc0285443;
+pub const FIONCLEX: ::Ioctl = 0x20006602;
+pub const FIOCLEX: ::Ioctl = 0x20006601;
+pub const FIOASYNC: ::Ioctl = 0x8004667d;
+pub const TIOCSERCONFIG: ::Ioctl = 0x5453;
+pub const TIOCSERGWILD: ::Ioctl = 0x5454;
+pub const TIOCSERSWILD: ::Ioctl = 0x5455;
+pub const TIOCGLCKTRMIOS: ::Ioctl = 0x5456;
+pub const TIOCSLCKTRMIOS: ::Ioctl = 0x5457;
+pub const TIOCSERGSTRUCT: ::Ioctl = 0x5458;
+pub const TIOCSERGETLSR: ::Ioctl = 0x5459;
+pub const TIOCSERGETMULTI: ::Ioctl = 0x545A;
+pub const TIOCSERSETMULTI: ::Ioctl = 0x545B;
+pub const TIOCMIWAIT: ::Ioctl = 0x545C;
+pub const TIOCGICOUNT: ::Ioctl = 0x545D;
+pub const BLKIOMIN: ::Ioctl = 0x20001278;
+pub const BLKIOOPT: ::Ioctl = 0x20001279;
+pub const BLKSSZGET: ::Ioctl = 0x20001268;
+pub const BLKPBSZGET: ::Ioctl = 0x2000127B;
+//pub const FIOQSIZE: ::Ioctl = 0x40086680;
+
+cfg_if! {
+    // Those type are constructed using the _IOC macro
+    // DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN
+    // where D stands for direction (either None (00), Read (01) or Write (11))
+    // where S stands for size (int, long, struct...)
+    // where T stands for type ('f','v','X'...)
+    // where N stands for NR (NumbeR)
+    if #[cfg(target_arch = "powerpc")] {
+        pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40046601;
+        pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80046602;
+        pub const FS_IOC_GETVERSION: ::Ioctl = 0x40047601;
+        pub const FS_IOC_SETVERSION: ::Ioctl = 0x80047602;
+        pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
+        pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
+        pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
+        pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
+    } else if #[cfg(target_arch = "powerpc64")] {
+        pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40086601;
+        pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80086602;
+        pub const FS_IOC_GETVERSION: ::Ioctl = 0x40087601;
+        pub const FS_IOC_SETVERSION: ::Ioctl = 0x80087602;
+        pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
+        pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
+        pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
+        pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
+    }
+}
+
+pub const TIOCM_LE: ::c_int = 0x001;
+pub const TIOCM_DTR: ::c_int = 0x002;
+pub const TIOCM_RTS: ::c_int = 0x004;
+pub const TIOCM_ST: ::c_int = 0x008;
+pub const TIOCM_SR: ::c_int = 0x010;
+pub const TIOCM_CTS: ::c_int = 0x020;
+pub const TIOCM_CAR: ::c_int = 0x040;
+pub const TIOCM_CD: ::c_int = TIOCM_CAR;
+pub const TIOCM_RNG: ::c_int = 0x080;
+pub const TIOCM_RI: ::c_int = TIOCM_RNG;
+pub const TIOCM_DSR: ::c_int = 0x100;
+
+pub const BOTHER: ::speed_t = 0o0037;
+pub const IBSHIFT: ::tcflag_t = 16;
+
+// RLIMIT Constants
+
+cfg_if! {
+    if #[cfg(target_env = "gnu")] {
+
+        pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
+        pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
+        pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
+        pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
+        pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
+        pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
+        pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
+        pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
+        pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
+        pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
+        pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
+        pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
+        pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
+        pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
+        pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
+        pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
+        #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+        pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16;
+        #[allow(deprecated)]
+        #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+        pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS;
+
+    } else if #[cfg(target_env = "musl")] {
+
+        pub const RLIMIT_CPU: ::c_int = 0;
+        pub const RLIMIT_FSIZE: ::c_int = 1;
+        pub const RLIMIT_DATA: ::c_int = 2;
+        pub const RLIMIT_STACK: ::c_int = 3;
+        pub const RLIMIT_CORE: ::c_int = 4;
+        pub const RLIMIT_RSS: ::c_int = 5;
+        pub const RLIMIT_NPROC: ::c_int = 6;
+        pub const RLIMIT_NOFILE: ::c_int = 7;
+        pub const RLIMIT_MEMLOCK: ::c_int = 8;
+        pub const RLIMIT_AS: ::c_int = 9;
+        pub const RLIMIT_LOCKS: ::c_int = 10;
+        pub const RLIMIT_SIGPENDING: ::c_int = 11;
+        pub const RLIMIT_MSGQUEUE: ::c_int = 12;
+        pub const RLIMIT_NICE: ::c_int = 13;
+        pub const RLIMIT_RTPRIO: ::c_int = 14;
+        pub const RLIMIT_RTTIME: ::c_int = 15;
+        #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+        pub const RLIM_NLIMITS: ::c_int = 15;
+        #[allow(deprecated)]
+        #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+        pub const RLIMIT_NLIMITS: ::c_int = RLIM_NLIMITS;
+    }
+}
+pub const RLIM_INFINITY: ::rlim_t = !0;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/arch/sparc/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/arch/sparc/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/arch/sparc/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/arch/sparc/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,259 @@
+s! {
+    pub struct termios2 {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; 19],
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::speed_t,
+    }
+}
+
+// arch/sparc/include/uapi/asm/socket.h
+pub const SOL_SOCKET: ::c_int = 0xffff;
+
+// Defined in unix/linux_like/mod.rs
+// pub const SO_DEBUG: ::c_int = 0x0001;
+pub const SO_PASSCRED: ::c_int = 0x0002;
+pub const SO_REUSEADDR: ::c_int = 0x0004;
+pub const SO_KEEPALIVE: ::c_int = 0x0008;
+pub const SO_DONTROUTE: ::c_int = 0x0010;
+pub const SO_BROADCAST: ::c_int = 0x0020;
+pub const SO_PEERCRED: ::c_int = 0x0040;
+pub const SO_LINGER: ::c_int = 0x0080;
+pub const SO_OOBINLINE: ::c_int = 0x0100;
+pub const SO_REUSEPORT: ::c_int = 0x0200;
+pub const SO_BSDCOMPAT: ::c_int = 0x0400;
+pub const SO_RCVLOWAT: ::c_int = 0x0800;
+pub const SO_SNDLOWAT: ::c_int = 0x1000;
+pub const SO_RCVTIMEO: ::c_int = 0x2000;
+pub const SO_SNDTIMEO: ::c_int = 0x4000;
+// pub const SO_RCVTIMEO_OLD: ::c_int = 0x2000;
+// pub const SO_SNDTIMEO_OLD: ::c_int = 0x4000;
+pub const SO_ACCEPTCONN: ::c_int = 0x8000;
+pub const SO_SNDBUF: ::c_int = 0x1001;
+pub const SO_RCVBUF: ::c_int = 0x1002;
+pub const SO_SNDBUFFORCE: ::c_int = 0x100a;
+pub const SO_RCVBUFFORCE: ::c_int = 0x100b;
+pub const SO_ERROR: ::c_int = 0x1007;
+pub const SO_TYPE: ::c_int = 0x1008;
+pub const SO_PROTOCOL: ::c_int = 0x1028;
+pub const SO_DOMAIN: ::c_int = 0x1029;
+pub const SO_NO_CHECK: ::c_int = 0x000b;
+pub const SO_PRIORITY: ::c_int = 0x000c;
+pub const SO_BINDTODEVICE: ::c_int = 0x000d;
+pub const SO_ATTACH_FILTER: ::c_int = 0x001a;
+pub const SO_DETACH_FILTER: ::c_int = 0x001b;
+pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
+pub const SO_PEERNAME: ::c_int = 0x001c;
+pub const SO_PEERSEC: ::c_int = 0x001e;
+pub const SO_PASSSEC: ::c_int = 0x001f;
+pub const SO_MARK: ::c_int = 0x0022;
+pub const SO_RXQ_OVFL: ::c_int = 0x0024;
+pub const SO_WIFI_STATUS: ::c_int = 0x0025;
+pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
+pub const SO_PEEK_OFF: ::c_int = 0x0026;
+pub const SO_NOFCS: ::c_int = 0x0027;
+pub const SO_LOCK_FILTER: ::c_int = 0x0028;
+pub const SO_SELECT_ERR_QUEUE: ::c_int = 0x0029;
+pub const SO_BUSY_POLL: ::c_int = 0x0030;
+pub const SO_MAX_PACING_RATE: ::c_int = 0x0031;
+pub const SO_BPF_EXTENSIONS: ::c_int = 0x0032;
+pub const SO_INCOMING_CPU: ::c_int = 0x0033;
+pub const SO_ATTACH_BPF: ::c_int = 0x0034;
+pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
+pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 0x0035;
+pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 0x0036;
+pub const SO_CNX_ADVICE: ::c_int = 0x0037;
+pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 0x0038;
+pub const SO_MEMINFO: ::c_int = 0x0039;
+pub const SO_INCOMING_NAPI_ID: ::c_int = 0x003a;
+pub const SO_COOKIE: ::c_int = 0x003b;
+pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 0x003c;
+pub const SO_PEERGROUPS: ::c_int = 0x003d;
+pub const SO_ZEROCOPY: ::c_int = 0x003e;
+pub const SO_TXTIME: ::c_int = 0x003f;
+pub const SCM_TXTIME: ::c_int = SO_TXTIME;
+pub const SO_BINDTOIFINDEX: ::c_int = 0x0041;
+pub const SO_SECURITY_AUTHENTICATION: ::c_int = 0x5001;
+pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 0x5002;
+pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 0x5004;
+pub const SO_TIMESTAMP: ::c_int = 0x001d;
+pub const SO_TIMESTAMPNS: ::c_int = 0x0021;
+pub const SO_TIMESTAMPING: ::c_int = 0x0023;
+// pub const SO_TIMESTAMP_OLD: ::c_int = 0x001d;
+// pub const SO_TIMESTAMPNS_OLD: ::c_int = 0x0021;
+// pub const SO_TIMESTAMPING_OLD: ::c_int = 0x0023;
+// pub const SO_TIMESTAMP_NEW: ::c_int = 0x0046;
+// pub const SO_TIMESTAMPNS_NEW: ::c_int = 0x0042;
+// pub const SO_TIMESTAMPING_NEW: ::c_int = 0x0043;
+// pub const SO_RCVTIMEO_NEW: ::c_int = 0x0044;
+// pub const SO_SNDTIMEO_NEW: ::c_int = 0x0045;
+// pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 0x0047;
+// pub const SO_PREFER_BUSY_POLL: ::c_int = 0x0048;
+// pub const SO_BUSY_POLL_BUDGET: ::c_int = 0x0049;
+
+// Defined in unix/linux_like/mod.rs
+// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
+pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
+pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
+
+// Ioctl Constants
+
+pub const TCGETS: ::Ioctl = 0x40245408;
+pub const TCSETS: ::Ioctl = 0x80245409;
+pub const TCSETSW: ::Ioctl = 0x8024540a;
+pub const TCSETSF: ::Ioctl = 0x8024540b;
+pub const TCGETA: ::Ioctl = 0x40125401;
+pub const TCSETA: ::Ioctl = 0x80125402;
+pub const TCSETAW: ::Ioctl = 0x80125403;
+pub const TCSETAF: ::Ioctl = 0x80125404;
+pub const TCSBRK: ::Ioctl = 0x20005405;
+pub const TCXONC: ::Ioctl = 0x20005406;
+pub const TCFLSH: ::Ioctl = 0x20005407;
+pub const TIOCEXCL: ::Ioctl = 0x2000740d;
+pub const TIOCNXCL: ::Ioctl = 0x2000740e;
+pub const TIOCSCTTY: ::Ioctl = 0x20007484;
+pub const TIOCGPGRP: ::Ioctl = 0x40047483;
+pub const TIOCSPGRP: ::Ioctl = 0x80047482;
+pub const TIOCOUTQ: ::Ioctl = 0x40047473;
+pub const TIOCSTI: ::Ioctl = 0x80017472;
+pub const TIOCGWINSZ: ::Ioctl = 0x40087468;
+pub const TIOCSWINSZ: ::Ioctl = 0x80087467;
+pub const TIOCMGET: ::Ioctl = 0x4004746a;
+pub const TIOCMBIS: ::Ioctl = 0x8004746c;
+pub const TIOCMBIC: ::Ioctl = 0x8004746b;
+pub const TIOCMSET: ::Ioctl = 0x8004746d;
+pub const TIOCGSOFTCAR: ::Ioctl = 0x40047464;
+pub const TIOCSSOFTCAR: ::Ioctl = 0x80047465;
+pub const FIONREAD: ::Ioctl = 0x4004667f;
+pub const TIOCINQ: ::Ioctl = FIONREAD;
+pub const TIOCLINUX: ::Ioctl = 0x541C;
+pub const TIOCCONS: ::Ioctl = 0x20007424;
+pub const TIOCGSERIAL: ::Ioctl = 0x541E;
+pub const TIOCSSERIAL: ::Ioctl = 0x541F;
+pub const TIOCPKT: ::Ioctl = 0x80047470;
+pub const FIONBIO: ::Ioctl = 0x8004667e;
+pub const TIOCNOTTY: ::Ioctl = 0x20007471;
+pub const TIOCSETD: ::Ioctl = 0x80047401;
+pub const TIOCGETD: ::Ioctl = 0x40047400;
+pub const TCSBRKP: ::Ioctl = 0x5425;
+pub const TIOCSBRK: ::Ioctl = 0x2000747b;
+pub const TIOCCBRK: ::Ioctl = 0x2000747a;
+pub const TIOCGSID: ::Ioctl = 0x40047485;
+pub const TCGETS2: ::Ioctl = 0x402c540c;
+pub const TCSETS2: ::Ioctl = 0x802c540d;
+pub const TCSETSW2: ::Ioctl = 0x802c540e;
+pub const TCSETSF2: ::Ioctl = 0x802c540f;
+pub const TIOCGPTN: ::Ioctl = 0x40047486;
+pub const TIOCSPTLCK: ::Ioctl = 0x80047487;
+pub const TIOCGDEV: ::Ioctl = 0x40045432;
+pub const TIOCSIG: ::Ioctl = 0x80047488;
+pub const TIOCVHANGUP: ::Ioctl = 0x20005437;
+pub const TIOCGPKT: ::Ioctl = 0x40045438;
+pub const TIOCGPTLCK: ::Ioctl = 0x40045439;
+pub const TIOCGEXCL: ::Ioctl = 0x40045440;
+pub const TIOCGPTPEER: ::Ioctl = 0x20007489;
+pub const FIONCLEX: ::Ioctl = 0x20006602;
+pub const FIOCLEX: ::Ioctl = 0x20006601;
+pub const TIOCSERCONFIG: ::Ioctl = 0x5453;
+pub const TIOCSERGWILD: ::Ioctl = 0x5454;
+pub const TIOCSERSWILD: ::Ioctl = 0x5455;
+pub const TIOCGLCKTRMIOS: ::Ioctl = 0x5456;
+pub const TIOCSLCKTRMIOS: ::Ioctl = 0x5457;
+pub const TIOCSERGSTRUCT: ::Ioctl = 0x5458;
+pub const TIOCSERGETLSR: ::Ioctl = 0x5459;
+pub const TIOCSERGETMULTI: ::Ioctl = 0x545A;
+pub const TIOCSERSETMULTI: ::Ioctl = 0x545B;
+pub const TIOCMIWAIT: ::Ioctl = 0x545C;
+pub const TIOCGICOUNT: ::Ioctl = 0x545D;
+pub const TIOCSTART: ::Ioctl = 0x2000746e;
+pub const TIOCSTOP: ::Ioctl = 0x2000746f;
+pub const BLKIOMIN: ::Ioctl = 0x20001278;
+pub const BLKIOOPT: ::Ioctl = 0x20001279;
+pub const BLKSSZGET: ::Ioctl = 0x20001268;
+pub const BLKPBSZGET: ::Ioctl = 0x2000127B;
+
+//pub const FIOASYNC: ::Ioctl = 0x4004667d;
+//pub const FIOQSIZE: ::Ioctl = ;
+//pub const TIOCGISO7816: ::Ioctl = 0x40285443;
+//pub const TIOCSISO7816: ::Ioctl = 0xc0285444;
+//pub const TIOCGRS485: ::Ioctl = 0x40205441;
+//pub const TIOCSRS485: ::Ioctl = 0xc0205442;
+
+pub const TIOCM_LE: ::c_int = 0x001;
+pub const TIOCM_DTR: ::c_int = 0x002;
+pub const TIOCM_RTS: ::c_int = 0x004;
+pub const TIOCM_ST: ::c_int = 0x008;
+pub const TIOCM_SR: ::c_int = 0x010;
+pub const TIOCM_CTS: ::c_int = 0x020;
+pub const TIOCM_CAR: ::c_int = 0x040;
+pub const TIOCM_CD: ::c_int = TIOCM_CAR;
+pub const TIOCM_RNG: ::c_int = 0x080;
+pub const TIOCM_RI: ::c_int = TIOCM_RNG;
+pub const TIOCM_DSR: ::c_int = 0x100;
+
+pub const BOTHER: ::speed_t = 0x1000;
+pub const IBSHIFT: ::tcflag_t = 16;
+
+// RLIMIT Constants
+
+pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
+pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
+pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
+pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
+pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
+pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
+pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 6;
+pub const RLIMIT_NPROC: ::__rlimit_resource_t = 7;
+pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
+pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
+pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
+pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
+pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
+pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
+pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
+pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
+#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16;
+#[allow(deprecated)]
+#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS;
+
+cfg_if! {
+    if #[cfg(target_arch = "sparc64")] {
+        pub const RLIM_INFINITY: ::rlim_t = !0;
+    } else if #[cfg(target_arch = "sparc")] {
+        pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
+    }
+}
+
+cfg_if! {
+    // Those type are constructed using the _IOC macro
+    // DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN
+    // where D stands for direction (either None (00), Read (01) or Write (11))
+    // where S stands for size (int, long, struct...)
+    // where T stands for type ('f','v','X'...)
+    // where N stands for NR (NumbeR)
+    if #[cfg(target_arch = "sparc")] {
+        pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40046601;
+        pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80046602;
+        pub const FS_IOC_GETVERSION: ::Ioctl = 0x40047601;
+        pub const FS_IOC_SETVERSION: ::Ioctl = 0x80047602;
+        pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
+        pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
+        pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
+        pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
+    } else if #[cfg(target_arch = "sparc64")] {
+        pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40086601;
+        pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80086602;
+        pub const FS_IOC_GETVERSION: ::Ioctl = 0x40087601;
+        pub const FS_IOC_SETVERSION: ::Ioctl = 0x80087602;
+        pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
+        pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
+        pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
+        pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,13 @@
+s! {
+    // FIXME this is actually a union
+    #[cfg_attr(target_pointer_width = "32",
+               repr(align(4)))]
+    #[cfg_attr(target_pointer_width = "64",
+               repr(align(8)))]
+    pub struct sem_t {
+        #[cfg(target_pointer_width = "32")]
+        __size: [::c_char; 16],
+        #[cfg(target_pointer_width = "64")]
+        __size: [::c_char; 32],
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,53 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(8))]
+    pub struct max_align_t {
+        priv_: [i64; 2]
+    }
+
+    #[allow(missing_debug_implementations)]
+    #[repr(align(8))]
+    pub struct ucontext_t {
+        pub uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_mcontext: ::mcontext_t,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_regspace: [::c_ulong; 128],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for ucontext_t {
+            fn eq(&self, other: &ucontext_t) -> bool {
+                self.uc_flags == other.uc_flags
+                    && self.uc_link == other.uc_link
+                    && self.uc_stack == other.uc_stack
+                    && self.uc_mcontext == other.uc_mcontext
+                    && self.uc_sigmask == other.uc_sigmask
+            }
+        }
+        impl Eq for ucontext_t {}
+        impl ::fmt::Debug for ucontext_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ucontext_t")
+                    .field("uc_flags", &self.uc_link)
+                    .field("uc_link", &self.uc_link)
+                    .field("uc_stack", &self.uc_stack)
+                    .field("uc_mcontext", &self.uc_mcontext)
+                    .field("uc_sigmask", &self.uc_sigmask)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for ucontext_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.uc_flags.hash(state);
+                self.uc_link.hash(state);
+                self.uc_stack.hash(state);
+                self.uc_mcontext.hash(state);
+                self.uc_sigmask.hash(state);
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,864 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
+
+s! {
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        f_spare: [::__fsword_t; 5],
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct flock64 {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off64_t,
+        pub l_len: ::off64_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::c_ushort,
+        __pad1: ::c_ushort,
+        pub __seq: ::c_ushort,
+        __pad2: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        __pad1: ::c_uint,
+        __st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad2: ::c_uint,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_ino: ::ino64_t,
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__fsword_t; 4],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        __f_unused: ::c_int,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        __unused1: ::c_ulong,
+        pub shm_dtime: ::time_t,
+        __unused2: ::c_ulong,
+        pub shm_ctime: ::time_t,
+        __unused3: ::c_ulong,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __glibc_reserved1: ::c_ulong,
+        pub msg_rtime: ::time_t,
+        __glibc_reserved2: ::c_ulong,
+        pub msg_ctime: ::time_t,
+        __glibc_reserved3: ::c_ulong,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved4: ::c_ulong,
+        __glibc_reserved5: ::c_ulong,
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        #[doc(hidden)]
+        #[deprecated(
+            since="0.2.54",
+            note="Please leave a comment on \
+                  https://github.com/rust-lang/libc/pull/1316 if you're using \
+                  this field"
+        )]
+        pub _pad: [::c_int; 29],
+        _align: [usize; 0],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t
+    }
+
+    pub struct mcontext_t {
+        pub trap_no: ::c_ulong,
+        pub error_code: ::c_ulong,
+        pub oldmask: ::c_ulong,
+        pub arm_r0: ::c_ulong,
+        pub arm_r1: ::c_ulong,
+        pub arm_r2: ::c_ulong,
+        pub arm_r3: ::c_ulong,
+        pub arm_r4: ::c_ulong,
+        pub arm_r5: ::c_ulong,
+        pub arm_r6: ::c_ulong,
+        pub arm_r7: ::c_ulong,
+        pub arm_r8: ::c_ulong,
+        pub arm_r9: ::c_ulong,
+        pub arm_r10: ::c_ulong,
+        pub arm_fp: ::c_ulong,
+        pub arm_ip: ::c_ulong,
+        pub arm_sp: ::c_ulong,
+        pub arm_lr: ::c_ulong,
+        pub arm_pc: ::c_ulong,
+        pub arm_cpsr: ::c_ulong,
+        pub fault_address: ::c_ulong,
+    }
+
+    pub struct user_regs {
+        pub arm_r0: ::c_ulong,
+        pub arm_r1: ::c_ulong,
+        pub arm_r2: ::c_ulong,
+        pub arm_r3: ::c_ulong,
+        pub arm_r4: ::c_ulong,
+        pub arm_r5: ::c_ulong,
+        pub arm_r6: ::c_ulong,
+        pub arm_r7: ::c_ulong,
+        pub arm_r8: ::c_ulong,
+        pub arm_r9: ::c_ulong,
+        pub arm_r10: ::c_ulong,
+        pub arm_fp: ::c_ulong,
+        pub arm_ip: ::c_ulong,
+        pub arm_sp: ::c_ulong,
+        pub arm_lr: ::c_ulong,
+        pub arm_pc: ::c_ulong,
+        pub arm_cpsr: ::c_ulong,
+        pub arm_orig_r0: ::c_ulong,
+    }
+}
+
+pub const VEOF: usize = 4;
+pub const RTLD_DEEPBIND: ::c_int = 0x8;
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+pub const O_DIRECT: ::c_int = 0x10000;
+pub const O_DIRECTORY: ::c_int = 0x4000;
+pub const O_NOFOLLOW: ::c_int = 0x8000;
+pub const O_LARGEFILE: ::c_int = 0o400000;
+pub const O_APPEND: ::c_int = 1024;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_FSYNC: ::c_int = 0x101000;
+pub const O_ASYNC: ::c_int = 0x2000;
+pub const O_NDELAY: ::c_int = 0x800;
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MAP_LOCKED: ::c_int = 0x02000;
+pub const MAP_NORESERVE: ::c_int = 0x04000;
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_ANONYMOUS: ::c_int = 0x0020;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const EDEADLOCK: ::c_int = 35;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EDEADLK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EBADMSG: ::c_int = 74;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const EHWPOISON: ::c_int = 133;
+pub const ERFKILL: ::c_int = 132;
+
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETOWN: ::c_int = 8;
+
+pub const EFD_NONBLOCK: ::c_int = 0x800;
+pub const SFD_NONBLOCK: ::c_int = 0x0800;
+
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
+pub const SIGUNUSED: ::c_int = 31;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+
+// Syscall table
+pub const SYS_restart_syscall: ::c_long = 0;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execve: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lchown: ::c_long = 16;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_mount: ::c_long = 21;
+pub const SYS_setuid: ::c_long = 23;
+pub const SYS_getuid: ::c_long = 24;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_setgid: ::c_long = 46;
+pub const SYS_getgid: ::c_long = 47;
+pub const SYS_geteuid: ::c_long = 49;
+pub const SYS_getegid: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount2: ::c_long = 52;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_setreuid: ::c_long = 70;
+pub const SYS_setregid: ::c_long = 71;
+pub const SYS_sigsuspend: ::c_long = 72;
+pub const SYS_sigpending: ::c_long = 73;
+pub const SYS_sethostname: ::c_long = 74;
+pub const SYS_setrlimit: ::c_long = 75;
+pub const SYS_getrusage: ::c_long = 77;
+pub const SYS_gettimeofday: ::c_long = 78;
+pub const SYS_settimeofday: ::c_long = 79;
+pub const SYS_getgroups: ::c_long = 80;
+pub const SYS_setgroups: ::c_long = 81;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_readlink: ::c_long = 85;
+pub const SYS_uselib: ::c_long = 86;
+pub const SYS_swapon: ::c_long = 87;
+pub const SYS_reboot: ::c_long = 88;
+pub const SYS_munmap: ::c_long = 91;
+pub const SYS_truncate: ::c_long = 92;
+pub const SYS_ftruncate: ::c_long = 93;
+pub const SYS_fchmod: ::c_long = 94;
+pub const SYS_fchown: ::c_long = 95;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_setitimer: ::c_long = 104;
+pub const SYS_getitimer: ::c_long = 105;
+pub const SYS_stat: ::c_long = 106;
+pub const SYS_lstat: ::c_long = 107;
+pub const SYS_fstat: ::c_long = 108;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_fsync: ::c_long = 118;
+pub const SYS_sigreturn: ::c_long = 119;
+pub const SYS_clone: ::c_long = 120;
+pub const SYS_setdomainname: ::c_long = 121;
+pub const SYS_uname: ::c_long = 122;
+pub const SYS_adjtimex: ::c_long = 124;
+pub const SYS_mprotect: ::c_long = 125;
+pub const SYS_sigprocmask: ::c_long = 126;
+pub const SYS_init_module: ::c_long = 128;
+pub const SYS_delete_module: ::c_long = 129;
+pub const SYS_quotactl: ::c_long = 131;
+pub const SYS_getpgid: ::c_long = 132;
+pub const SYS_fchdir: ::c_long = 133;
+pub const SYS_bdflush: ::c_long = 134;
+pub const SYS_sysfs: ::c_long = 135;
+pub const SYS_personality: ::c_long = 136;
+pub const SYS_setfsuid: ::c_long = 138;
+pub const SYS_setfsgid: ::c_long = 139;
+pub const SYS__llseek: ::c_long = 140;
+pub const SYS_getdents: ::c_long = 141;
+pub const SYS__newselect: ::c_long = 142;
+pub const SYS_flock: ::c_long = 143;
+pub const SYS_msync: ::c_long = 144;
+pub const SYS_readv: ::c_long = 145;
+pub const SYS_writev: ::c_long = 146;
+pub const SYS_getsid: ::c_long = 147;
+pub const SYS_fdatasync: ::c_long = 148;
+pub const SYS__sysctl: ::c_long = 149;
+pub const SYS_mlock: ::c_long = 150;
+pub const SYS_munlock: ::c_long = 151;
+pub const SYS_mlockall: ::c_long = 152;
+pub const SYS_munlockall: ::c_long = 153;
+pub const SYS_sched_setparam: ::c_long = 154;
+pub const SYS_sched_getparam: ::c_long = 155;
+pub const SYS_sched_setscheduler: ::c_long = 156;
+pub const SYS_sched_getscheduler: ::c_long = 157;
+pub const SYS_sched_yield: ::c_long = 158;
+pub const SYS_sched_get_priority_max: ::c_long = 159;
+pub const SYS_sched_get_priority_min: ::c_long = 160;
+pub const SYS_sched_rr_get_interval: ::c_long = 161;
+pub const SYS_nanosleep: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_setresuid: ::c_long = 164;
+pub const SYS_getresuid: ::c_long = 165;
+pub const SYS_poll: ::c_long = 168;
+pub const SYS_nfsservctl: ::c_long = 169;
+pub const SYS_setresgid: ::c_long = 170;
+pub const SYS_getresgid: ::c_long = 171;
+pub const SYS_prctl: ::c_long = 172;
+pub const SYS_rt_sigreturn: ::c_long = 173;
+pub const SYS_rt_sigaction: ::c_long = 174;
+pub const SYS_rt_sigprocmask: ::c_long = 175;
+pub const SYS_rt_sigpending: ::c_long = 176;
+pub const SYS_rt_sigtimedwait: ::c_long = 177;
+pub const SYS_rt_sigqueueinfo: ::c_long = 178;
+pub const SYS_rt_sigsuspend: ::c_long = 179;
+pub const SYS_pread64: ::c_long = 180;
+pub const SYS_pwrite64: ::c_long = 181;
+pub const SYS_chown: ::c_long = 182;
+pub const SYS_getcwd: ::c_long = 183;
+pub const SYS_capget: ::c_long = 184;
+pub const SYS_capset: ::c_long = 185;
+pub const SYS_sigaltstack: ::c_long = 186;
+pub const SYS_sendfile: ::c_long = 187;
+pub const SYS_vfork: ::c_long = 190;
+pub const SYS_ugetrlimit: ::c_long = 191;
+pub const SYS_mmap2: ::c_long = 192;
+pub const SYS_truncate64: ::c_long = 193;
+pub const SYS_ftruncate64: ::c_long = 194;
+pub const SYS_stat64: ::c_long = 195;
+pub const SYS_lstat64: ::c_long = 196;
+pub const SYS_fstat64: ::c_long = 197;
+pub const SYS_lchown32: ::c_long = 198;
+pub const SYS_getuid32: ::c_long = 199;
+pub const SYS_getgid32: ::c_long = 200;
+pub const SYS_geteuid32: ::c_long = 201;
+pub const SYS_getegid32: ::c_long = 202;
+pub const SYS_setreuid32: ::c_long = 203;
+pub const SYS_setregid32: ::c_long = 204;
+pub const SYS_getgroups32: ::c_long = 205;
+pub const SYS_setgroups32: ::c_long = 206;
+pub const SYS_fchown32: ::c_long = 207;
+pub const SYS_setresuid32: ::c_long = 208;
+pub const SYS_getresuid32: ::c_long = 209;
+pub const SYS_setresgid32: ::c_long = 210;
+pub const SYS_getresgid32: ::c_long = 211;
+pub const SYS_chown32: ::c_long = 212;
+pub const SYS_setuid32: ::c_long = 213;
+pub const SYS_setgid32: ::c_long = 214;
+pub const SYS_setfsuid32: ::c_long = 215;
+pub const SYS_setfsgid32: ::c_long = 216;
+pub const SYS_getdents64: ::c_long = 217;
+pub const SYS_pivot_root: ::c_long = 218;
+pub const SYS_mincore: ::c_long = 219;
+pub const SYS_madvise: ::c_long = 220;
+pub const SYS_fcntl64: ::c_long = 221;
+pub const SYS_gettid: ::c_long = 224;
+pub const SYS_readahead: ::c_long = 225;
+pub const SYS_setxattr: ::c_long = 226;
+pub const SYS_lsetxattr: ::c_long = 227;
+pub const SYS_fsetxattr: ::c_long = 228;
+pub const SYS_getxattr: ::c_long = 229;
+pub const SYS_lgetxattr: ::c_long = 230;
+pub const SYS_fgetxattr: ::c_long = 231;
+pub const SYS_listxattr: ::c_long = 232;
+pub const SYS_llistxattr: ::c_long = 233;
+pub const SYS_flistxattr: ::c_long = 234;
+pub const SYS_removexattr: ::c_long = 235;
+pub const SYS_lremovexattr: ::c_long = 236;
+pub const SYS_fremovexattr: ::c_long = 237;
+pub const SYS_tkill: ::c_long = 238;
+pub const SYS_sendfile64: ::c_long = 239;
+pub const SYS_futex: ::c_long = 240;
+pub const SYS_sched_setaffinity: ::c_long = 241;
+pub const SYS_sched_getaffinity: ::c_long = 242;
+pub const SYS_io_setup: ::c_long = 243;
+pub const SYS_io_destroy: ::c_long = 244;
+pub const SYS_io_getevents: ::c_long = 245;
+pub const SYS_io_submit: ::c_long = 246;
+pub const SYS_io_cancel: ::c_long = 247;
+pub const SYS_exit_group: ::c_long = 248;
+pub const SYS_lookup_dcookie: ::c_long = 249;
+pub const SYS_epoll_create: ::c_long = 250;
+pub const SYS_epoll_ctl: ::c_long = 251;
+pub const SYS_epoll_wait: ::c_long = 252;
+pub const SYS_remap_file_pages: ::c_long = 253;
+pub const SYS_set_tid_address: ::c_long = 256;
+pub const SYS_timer_create: ::c_long = 257;
+pub const SYS_timer_settime: ::c_long = 258;
+pub const SYS_timer_gettime: ::c_long = 259;
+pub const SYS_timer_getoverrun: ::c_long = 260;
+pub const SYS_timer_delete: ::c_long = 261;
+pub const SYS_clock_settime: ::c_long = 262;
+pub const SYS_clock_gettime: ::c_long = 263;
+pub const SYS_clock_getres: ::c_long = 264;
+pub const SYS_clock_nanosleep: ::c_long = 265;
+pub const SYS_statfs64: ::c_long = 266;
+pub const SYS_fstatfs64: ::c_long = 267;
+pub const SYS_tgkill: ::c_long = 268;
+pub const SYS_utimes: ::c_long = 269;
+pub const SYS_arm_fadvise64_64: ::c_long = 270;
+pub const SYS_pciconfig_iobase: ::c_long = 271;
+pub const SYS_pciconfig_read: ::c_long = 272;
+pub const SYS_pciconfig_write: ::c_long = 273;
+pub const SYS_mq_open: ::c_long = 274;
+pub const SYS_mq_unlink: ::c_long = 275;
+pub const SYS_mq_timedsend: ::c_long = 276;
+pub const SYS_mq_timedreceive: ::c_long = 277;
+pub const SYS_mq_notify: ::c_long = 278;
+pub const SYS_mq_getsetattr: ::c_long = 279;
+pub const SYS_waitid: ::c_long = 280;
+pub const SYS_socket: ::c_long = 281;
+pub const SYS_bind: ::c_long = 282;
+pub const SYS_connect: ::c_long = 283;
+pub const SYS_listen: ::c_long = 284;
+pub const SYS_accept: ::c_long = 285;
+pub const SYS_getsockname: ::c_long = 286;
+pub const SYS_getpeername: ::c_long = 287;
+pub const SYS_socketpair: ::c_long = 288;
+pub const SYS_send: ::c_long = 289;
+pub const SYS_sendto: ::c_long = 290;
+pub const SYS_recv: ::c_long = 291;
+pub const SYS_recvfrom: ::c_long = 292;
+pub const SYS_shutdown: ::c_long = 293;
+pub const SYS_setsockopt: ::c_long = 294;
+pub const SYS_getsockopt: ::c_long = 295;
+pub const SYS_sendmsg: ::c_long = 296;
+pub const SYS_recvmsg: ::c_long = 297;
+pub const SYS_semop: ::c_long = 298;
+pub const SYS_semget: ::c_long = 299;
+pub const SYS_semctl: ::c_long = 300;
+pub const SYS_msgsnd: ::c_long = 301;
+pub const SYS_msgrcv: ::c_long = 302;
+pub const SYS_msgget: ::c_long = 303;
+pub const SYS_msgctl: ::c_long = 304;
+pub const SYS_shmat: ::c_long = 305;
+pub const SYS_shmdt: ::c_long = 306;
+pub const SYS_shmget: ::c_long = 307;
+pub const SYS_shmctl: ::c_long = 308;
+pub const SYS_add_key: ::c_long = 309;
+pub const SYS_request_key: ::c_long = 310;
+pub const SYS_keyctl: ::c_long = 311;
+pub const SYS_semtimedop: ::c_long = 312;
+pub const SYS_vserver: ::c_long = 313;
+pub const SYS_ioprio_set: ::c_long = 314;
+pub const SYS_ioprio_get: ::c_long = 315;
+pub const SYS_inotify_init: ::c_long = 316;
+pub const SYS_inotify_add_watch: ::c_long = 317;
+pub const SYS_inotify_rm_watch: ::c_long = 318;
+pub const SYS_mbind: ::c_long = 319;
+pub const SYS_get_mempolicy: ::c_long = 320;
+pub const SYS_set_mempolicy: ::c_long = 321;
+pub const SYS_openat: ::c_long = 322;
+pub const SYS_mkdirat: ::c_long = 323;
+pub const SYS_mknodat: ::c_long = 324;
+pub const SYS_fchownat: ::c_long = 325;
+pub const SYS_futimesat: ::c_long = 326;
+pub const SYS_fstatat64: ::c_long = 327;
+pub const SYS_unlinkat: ::c_long = 328;
+pub const SYS_renameat: ::c_long = 329;
+pub const SYS_linkat: ::c_long = 330;
+pub const SYS_symlinkat: ::c_long = 331;
+pub const SYS_readlinkat: ::c_long = 332;
+pub const SYS_fchmodat: ::c_long = 333;
+pub const SYS_faccessat: ::c_long = 334;
+pub const SYS_pselect6: ::c_long = 335;
+pub const SYS_ppoll: ::c_long = 336;
+pub const SYS_unshare: ::c_long = 337;
+pub const SYS_set_robust_list: ::c_long = 338;
+pub const SYS_get_robust_list: ::c_long = 339;
+pub const SYS_splice: ::c_long = 340;
+pub const SYS_arm_sync_file_range: ::c_long = 341;
+pub const SYS_tee: ::c_long = 342;
+pub const SYS_vmsplice: ::c_long = 343;
+pub const SYS_move_pages: ::c_long = 344;
+pub const SYS_getcpu: ::c_long = 345;
+pub const SYS_epoll_pwait: ::c_long = 346;
+pub const SYS_kexec_load: ::c_long = 347;
+pub const SYS_utimensat: ::c_long = 348;
+pub const SYS_signalfd: ::c_long = 349;
+pub const SYS_timerfd_create: ::c_long = 350;
+pub const SYS_eventfd: ::c_long = 351;
+pub const SYS_fallocate: ::c_long = 352;
+pub const SYS_timerfd_settime: ::c_long = 353;
+pub const SYS_timerfd_gettime: ::c_long = 354;
+pub const SYS_signalfd4: ::c_long = 355;
+pub const SYS_eventfd2: ::c_long = 356;
+pub const SYS_epoll_create1: ::c_long = 357;
+pub const SYS_dup3: ::c_long = 358;
+pub const SYS_pipe2: ::c_long = 359;
+pub const SYS_inotify_init1: ::c_long = 360;
+pub const SYS_preadv: ::c_long = 361;
+pub const SYS_pwritev: ::c_long = 362;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 363;
+pub const SYS_perf_event_open: ::c_long = 364;
+pub const SYS_recvmmsg: ::c_long = 365;
+pub const SYS_accept4: ::c_long = 366;
+pub const SYS_fanotify_init: ::c_long = 367;
+pub const SYS_fanotify_mark: ::c_long = 368;
+pub const SYS_prlimit64: ::c_long = 369;
+pub const SYS_name_to_handle_at: ::c_long = 370;
+pub const SYS_open_by_handle_at: ::c_long = 371;
+pub const SYS_clock_adjtime: ::c_long = 372;
+pub const SYS_syncfs: ::c_long = 373;
+pub const SYS_sendmmsg: ::c_long = 374;
+pub const SYS_setns: ::c_long = 375;
+pub const SYS_process_vm_readv: ::c_long = 376;
+pub const SYS_process_vm_writev: ::c_long = 377;
+pub const SYS_kcmp: ::c_long = 378;
+pub const SYS_finit_module: ::c_long = 379;
+pub const SYS_sched_setattr: ::c_long = 380;
+pub const SYS_sched_getattr: ::c_long = 381;
+pub const SYS_renameat2: ::c_long = 382;
+pub const SYS_seccomp: ::c_long = 383;
+pub const SYS_getrandom: ::c_long = 384;
+pub const SYS_memfd_create: ::c_long = 385;
+pub const SYS_bpf: ::c_long = 386;
+pub const SYS_execveat: ::c_long = 387;
+pub const SYS_userfaultfd: ::c_long = 388;
+pub const SYS_membarrier: ::c_long = 389;
+pub const SYS_mlock2: ::c_long = 390;
+pub const SYS_copy_file_range: ::c_long = 391;
+pub const SYS_preadv2: ::c_long = 392;
+pub const SYS_pwritev2: ::c_long = 393;
+pub const SYS_pkey_mprotect: ::c_long = 394;
+pub const SYS_pkey_alloc: ::c_long = 395;
+pub const SYS_pkey_free: ::c_long = 396;
+pub const SYS_statx: ::c_long = 397;
+pub const SYS_rseq: ::c_long = 398;
+pub const SYS_kexec_file_load: ::c_long = 401;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(8))]
+    pub struct max_align_t {
+        priv_: [i64; 2]
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,741 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
+
+s! {
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        f_spare: [::__fsword_t; 5],
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct flock64 {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off64_t,
+        pub l_len: ::off64_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::c_ushort,
+        __pad1: ::c_ushort,
+        pub __seq: ::c_ushort,
+        __pad2: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        __pad1: ::c_uint,
+        __st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad2: ::c_uint,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_ino: ::ino64_t,
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__fsword_t; 4],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        __f_unused: ::c_int,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        __unused1: ::c_ulong,
+        pub shm_dtime: ::time_t,
+        __unused2: ::c_ulong,
+        pub shm_ctime: ::time_t,
+        __unused3: ::c_ulong,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __glibc_reserved1: ::c_ulong,
+        pub msg_rtime: ::time_t,
+        __glibc_reserved2: ::c_ulong,
+        pub msg_ctime: ::time_t,
+        __glibc_reserved3: ::c_ulong,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved4: ::c_ulong,
+        __glibc_reserved5: ::c_ulong,
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        #[doc(hidden)]
+        #[deprecated(
+            since="0.2.54",
+            note="Please leave a comment on \
+                  https://github.com/rust-lang/libc/pull/1316 if you're using \
+                  this field"
+        )]
+        pub _pad: [::c_int; 29],
+        _align: [usize; 0],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t
+    }
+}
+
+pub const VEOF: usize = 4;
+pub const RTLD_DEEPBIND: ::c_int = 0x8;
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+pub const O_DIRECT: ::c_int = 0x4000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+pub const O_LARGEFILE: ::c_int = 0o100000;
+pub const O_APPEND: ::c_int = 1024;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_FSYNC: ::c_int = 0x101000;
+pub const O_ASYNC: ::c_int = 0x2000;
+pub const O_NDELAY: ::c_int = 0x800;
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MAP_LOCKED: ::c_int = 0x02000;
+pub const MAP_NORESERVE: ::c_int = 0x04000;
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_ANONYMOUS: ::c_int = 0x0020;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const EDEADLOCK: ::c_int = 35;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EDEADLK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EBADMSG: ::c_int = 74;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const EHWPOISON: ::c_int = 133;
+pub const ERFKILL: ::c_int = 132;
+
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETOWN: ::c_int = 8;
+
+pub const EFD_NONBLOCK: ::c_int = 0x800;
+pub const SFD_NONBLOCK: ::c_int = 0x0800;
+
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
+pub const SIGUNUSED: ::c_int = 31;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+
+// Syscall table
+pub const SYS_read: ::c_long = 63;
+pub const SYS_write: ::c_long = 64;
+pub const SYS_close: ::c_long = 57;
+pub const SYS_fstat: ::c_long = 80;
+pub const SYS_lseek: ::c_long = 62;
+pub const SYS_mmap: ::c_long = 222;
+pub const SYS_mprotect: ::c_long = 226;
+pub const SYS_munmap: ::c_long = 215;
+pub const SYS_brk: ::c_long = 214;
+pub const SYS_rt_sigaction: ::c_long = 134;
+pub const SYS_rt_sigprocmask: ::c_long = 135;
+pub const SYS_rt_sigreturn: ::c_long = 139;
+pub const SYS_ioctl: ::c_long = 29;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_readv: ::c_long = 65;
+pub const SYS_writev: ::c_long = 66;
+pub const SYS_sched_yield: ::c_long = 124;
+pub const SYS_mremap: ::c_long = 216;
+pub const SYS_msync: ::c_long = 227;
+pub const SYS_mincore: ::c_long = 232;
+pub const SYS_madvise: ::c_long = 233;
+pub const SYS_shmget: ::c_long = 194;
+pub const SYS_shmat: ::c_long = 196;
+pub const SYS_shmctl: ::c_long = 195;
+pub const SYS_dup: ::c_long = 23;
+pub const SYS_nanosleep: ::c_long = 101;
+pub const SYS_getitimer: ::c_long = 102;
+pub const SYS_setitimer: ::c_long = 103;
+pub const SYS_getpid: ::c_long = 172;
+pub const SYS_sendfile: ::c_long = 71;
+pub const SYS_socket: ::c_long = 198;
+pub const SYS_connect: ::c_long = 203;
+pub const SYS_accept: ::c_long = 202;
+pub const SYS_sendto: ::c_long = 206;
+pub const SYS_recvfrom: ::c_long = 207;
+pub const SYS_sendmsg: ::c_long = 211;
+pub const SYS_recvmsg: ::c_long = 212;
+pub const SYS_shutdown: ::c_long = 210;
+pub const SYS_bind: ::c_long = 200;
+pub const SYS_listen: ::c_long = 201;
+pub const SYS_getsockname: ::c_long = 204;
+pub const SYS_getpeername: ::c_long = 205;
+pub const SYS_socketpair: ::c_long = 199;
+pub const SYS_setsockopt: ::c_long = 208;
+pub const SYS_getsockopt: ::c_long = 209;
+pub const SYS_clone: ::c_long = 220;
+pub const SYS_execve: ::c_long = 221;
+pub const SYS_exit: ::c_long = 93;
+pub const SYS_wait4: ::c_long = 260;
+pub const SYS_kill: ::c_long = 129;
+pub const SYS_uname: ::c_long = 160;
+pub const SYS_semget: ::c_long = 190;
+pub const SYS_semop: ::c_long = 193;
+pub const SYS_semctl: ::c_long = 191;
+pub const SYS_shmdt: ::c_long = 197;
+pub const SYS_msgget: ::c_long = 186;
+pub const SYS_msgsnd: ::c_long = 189;
+pub const SYS_msgrcv: ::c_long = 188;
+pub const SYS_msgctl: ::c_long = 187;
+pub const SYS_fcntl: ::c_long = 25;
+pub const SYS_flock: ::c_long = 32;
+pub const SYS_fsync: ::c_long = 82;
+pub const SYS_fdatasync: ::c_long = 83;
+pub const SYS_truncate: ::c_long = 45;
+pub const SYS_ftruncate: ::c_long = 46;
+pub const SYS_getcwd: ::c_long = 17;
+pub const SYS_chdir: ::c_long = 49;
+pub const SYS_fchdir: ::c_long = 50;
+pub const SYS_fchmod: ::c_long = 52;
+pub const SYS_fchown: ::c_long = 55;
+pub const SYS_umask: ::c_long = 166;
+pub const SYS_gettimeofday: ::c_long = 169;
+pub const SYS_getrlimit: ::c_long = 163;
+pub const SYS_getrusage: ::c_long = 165;
+pub const SYS_sysinfo: ::c_long = 179;
+pub const SYS_times: ::c_long = 153;
+pub const SYS_ptrace: ::c_long = 117;
+pub const SYS_getuid: ::c_long = 174;
+pub const SYS_syslog: ::c_long = 116;
+pub const SYS_getgid: ::c_long = 176;
+pub const SYS_setuid: ::c_long = 146;
+pub const SYS_setgid: ::c_long = 144;
+pub const SYS_geteuid: ::c_long = 175;
+pub const SYS_getegid: ::c_long = 177;
+pub const SYS_setpgid: ::c_long = 154;
+pub const SYS_getppid: ::c_long = 173;
+pub const SYS_setsid: ::c_long = 157;
+pub const SYS_setreuid: ::c_long = 145;
+pub const SYS_setregid: ::c_long = 143;
+pub const SYS_getgroups: ::c_long = 158;
+pub const SYS_setgroups: ::c_long = 159;
+pub const SYS_setresuid: ::c_long = 147;
+pub const SYS_getresuid: ::c_long = 148;
+pub const SYS_setresgid: ::c_long = 149;
+pub const SYS_getresgid: ::c_long = 150;
+pub const SYS_getpgid: ::c_long = 155;
+pub const SYS_setfsuid: ::c_long = 151;
+pub const SYS_setfsgid: ::c_long = 152;
+pub const SYS_getsid: ::c_long = 156;
+pub const SYS_capget: ::c_long = 90;
+pub const SYS_capset: ::c_long = 91;
+pub const SYS_rt_sigpending: ::c_long = 136;
+pub const SYS_rt_sigtimedwait: ::c_long = 137;
+pub const SYS_rt_sigqueueinfo: ::c_long = 138;
+pub const SYS_rt_sigsuspend: ::c_long = 133;
+pub const SYS_sigaltstack: ::c_long = 132;
+pub const SYS_personality: ::c_long = 92;
+pub const SYS_statfs: ::c_long = 43;
+pub const SYS_fstatfs: ::c_long = 44;
+pub const SYS_getpriority: ::c_long = 141;
+pub const SYS_setpriority: ::c_long = 140;
+pub const SYS_sched_setparam: ::c_long = 118;
+pub const SYS_sched_getparam: ::c_long = 121;
+pub const SYS_sched_setscheduler: ::c_long = 119;
+pub const SYS_sched_getscheduler: ::c_long = 120;
+pub const SYS_sched_get_priority_max: ::c_long = 125;
+pub const SYS_sched_get_priority_min: ::c_long = 126;
+pub const SYS_sched_rr_get_interval: ::c_long = 127;
+pub const SYS_mlock: ::c_long = 228;
+pub const SYS_munlock: ::c_long = 229;
+pub const SYS_mlockall: ::c_long = 230;
+pub const SYS_munlockall: ::c_long = 231;
+pub const SYS_vhangup: ::c_long = 58;
+pub const SYS_pivot_root: ::c_long = 41;
+pub const SYS_prctl: ::c_long = 167;
+pub const SYS_adjtimex: ::c_long = 171;
+pub const SYS_setrlimit: ::c_long = 164;
+pub const SYS_chroot: ::c_long = 51;
+pub const SYS_sync: ::c_long = 81;
+pub const SYS_acct: ::c_long = 89;
+pub const SYS_settimeofday: ::c_long = 170;
+pub const SYS_mount: ::c_long = 40;
+pub const SYS_umount2: ::c_long = 39;
+pub const SYS_swapon: ::c_long = 224;
+pub const SYS_swapoff: ::c_long = 225;
+pub const SYS_reboot: ::c_long = 142;
+pub const SYS_sethostname: ::c_long = 161;
+pub const SYS_setdomainname: ::c_long = 162;
+pub const SYS_init_module: ::c_long = 105;
+pub const SYS_delete_module: ::c_long = 106;
+pub const SYS_quotactl: ::c_long = 60;
+pub const SYS_nfsservctl: ::c_long = 42;
+pub const SYS_gettid: ::c_long = 178;
+pub const SYS_readahead: ::c_long = 213;
+pub const SYS_setxattr: ::c_long = 5;
+pub const SYS_lsetxattr: ::c_long = 6;
+pub const SYS_fsetxattr: ::c_long = 7;
+pub const SYS_getxattr: ::c_long = 8;
+pub const SYS_lgetxattr: ::c_long = 9;
+pub const SYS_fgetxattr: ::c_long = 10;
+pub const SYS_listxattr: ::c_long = 11;
+pub const SYS_llistxattr: ::c_long = 12;
+pub const SYS_flistxattr: ::c_long = 13;
+pub const SYS_removexattr: ::c_long = 14;
+pub const SYS_lremovexattr: ::c_long = 15;
+pub const SYS_fremovexattr: ::c_long = 16;
+pub const SYS_tkill: ::c_long = 130;
+pub const SYS_futex: ::c_long = 98;
+pub const SYS_sched_setaffinity: ::c_long = 122;
+pub const SYS_sched_getaffinity: ::c_long = 123;
+pub const SYS_io_setup: ::c_long = 0;
+pub const SYS_io_destroy: ::c_long = 1;
+pub const SYS_io_getevents: ::c_long = 4;
+pub const SYS_io_submit: ::c_long = 2;
+pub const SYS_io_cancel: ::c_long = 3;
+pub const SYS_lookup_dcookie: ::c_long = 18;
+pub const SYS_remap_file_pages: ::c_long = 234;
+pub const SYS_getdents64: ::c_long = 61;
+pub const SYS_set_tid_address: ::c_long = 96;
+pub const SYS_restart_syscall: ::c_long = 128;
+pub const SYS_semtimedop: ::c_long = 192;
+pub const SYS_fadvise64: ::c_long = 223;
+pub const SYS_timer_create: ::c_long = 107;
+pub const SYS_timer_settime: ::c_long = 110;
+pub const SYS_timer_gettime: ::c_long = 108;
+pub const SYS_timer_getoverrun: ::c_long = 109;
+pub const SYS_timer_delete: ::c_long = 111;
+pub const SYS_clock_settime: ::c_long = 112;
+pub const SYS_clock_gettime: ::c_long = 113;
+pub const SYS_clock_getres: ::c_long = 114;
+pub const SYS_clock_nanosleep: ::c_long = 115;
+pub const SYS_exit_group: ::c_long = 94;
+pub const SYS_epoll_ctl: ::c_long = 21;
+pub const SYS_tgkill: ::c_long = 131;
+pub const SYS_mbind: ::c_long = 235;
+pub const SYS_set_mempolicy: ::c_long = 237;
+pub const SYS_get_mempolicy: ::c_long = 236;
+pub const SYS_mq_open: ::c_long = 180;
+pub const SYS_mq_unlink: ::c_long = 181;
+pub const SYS_mq_timedsend: ::c_long = 182;
+pub const SYS_mq_timedreceive: ::c_long = 183;
+pub const SYS_mq_notify: ::c_long = 184;
+pub const SYS_mq_getsetattr: ::c_long = 185;
+pub const SYS_kexec_load: ::c_long = 104;
+pub const SYS_waitid: ::c_long = 95;
+pub const SYS_add_key: ::c_long = 217;
+pub const SYS_request_key: ::c_long = 218;
+pub const SYS_keyctl: ::c_long = 219;
+pub const SYS_ioprio_set: ::c_long = 30;
+pub const SYS_ioprio_get: ::c_long = 31;
+pub const SYS_inotify_add_watch: ::c_long = 27;
+pub const SYS_inotify_rm_watch: ::c_long = 28;
+pub const SYS_migrate_pages: ::c_long = 238;
+pub const SYS_openat: ::c_long = 56;
+pub const SYS_mkdirat: ::c_long = 34;
+pub const SYS_mknodat: ::c_long = 33;
+pub const SYS_fchownat: ::c_long = 54;
+pub const SYS_newfstatat: ::c_long = 79;
+pub const SYS_unlinkat: ::c_long = 35;
+pub const SYS_linkat: ::c_long = 37;
+pub const SYS_symlinkat: ::c_long = 36;
+pub const SYS_readlinkat: ::c_long = 78;
+pub const SYS_fchmodat: ::c_long = 53;
+pub const SYS_faccessat: ::c_long = 48;
+pub const SYS_pselect6: ::c_long = 72;
+pub const SYS_ppoll: ::c_long = 73;
+pub const SYS_unshare: ::c_long = 97;
+pub const SYS_set_robust_list: ::c_long = 99;
+pub const SYS_get_robust_list: ::c_long = 100;
+pub const SYS_splice: ::c_long = 76;
+pub const SYS_tee: ::c_long = 77;
+pub const SYS_sync_file_range: ::c_long = 84;
+pub const SYS_vmsplice: ::c_long = 75;
+pub const SYS_move_pages: ::c_long = 239;
+pub const SYS_utimensat: ::c_long = 88;
+pub const SYS_epoll_pwait: ::c_long = 22;
+pub const SYS_timerfd_create: ::c_long = 85;
+pub const SYS_fallocate: ::c_long = 47;
+pub const SYS_timerfd_settime: ::c_long = 86;
+pub const SYS_timerfd_gettime: ::c_long = 87;
+pub const SYS_accept4: ::c_long = 242;
+pub const SYS_signalfd4: ::c_long = 74;
+pub const SYS_eventfd2: ::c_long = 19;
+pub const SYS_epoll_create1: ::c_long = 20;
+pub const SYS_dup3: ::c_long = 24;
+pub const SYS_pipe2: ::c_long = 59;
+pub const SYS_inotify_init1: ::c_long = 26;
+pub const SYS_preadv: ::c_long = 69;
+pub const SYS_pwritev: ::c_long = 70;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
+pub const SYS_perf_event_open: ::c_long = 241;
+pub const SYS_recvmmsg: ::c_long = 243;
+pub const SYS_fanotify_init: ::c_long = 262;
+pub const SYS_fanotify_mark: ::c_long = 263;
+pub const SYS_prlimit64: ::c_long = 261;
+pub const SYS_name_to_handle_at: ::c_long = 264;
+pub const SYS_open_by_handle_at: ::c_long = 265;
+pub const SYS_clock_adjtime: ::c_long = 266;
+pub const SYS_syncfs: ::c_long = 267;
+pub const SYS_sendmmsg: ::c_long = 269;
+pub const SYS_setns: ::c_long = 268;
+pub const SYS_getcpu: ::c_long = 168;
+pub const SYS_process_vm_readv: ::c_long = 270;
+pub const SYS_process_vm_writev: ::c_long = 271;
+pub const SYS_kcmp: ::c_long = 272;
+pub const SYS_finit_module: ::c_long = 273;
+pub const SYS_sched_setattr: ::c_long = 274;
+pub const SYS_sched_getattr: ::c_long = 275;
+pub const SYS_renameat2: ::c_long = 276;
+pub const SYS_seccomp: ::c_long = 277;
+pub const SYS_getrandom: ::c_long = 278;
+pub const SYS_memfd_create: ::c_long = 279;
+pub const SYS_bpf: ::c_long = 280;
+pub const SYS_execveat: ::c_long = 281;
+pub const SYS_userfaultfd: ::c_long = 282;
+pub const SYS_membarrier: ::c_long = 283;
+pub const SYS_mlock2: ::c_long = 284;
+pub const SYS_copy_file_range: ::c_long = 285;
+pub const SYS_preadv2: ::c_long = 286;
+pub const SYS_pwritev2: ::c_long = 287;
+pub const SYS_pkey_mprotect: ::c_long = 288;
+pub const SYS_pkey_alloc: ::c_long = 289;
+pub const SYS_pkey_free: ::c_long = 290;
+pub const SYS_statx: ::c_long = 291;
+pub const SYS_rseq: ::c_long = 293;
+pub const SYS_syscall: ::c_long = 294;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(2))]
+    pub struct max_align_t {
+        priv_: [i8; 20]
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,850 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
+
+s! {
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        f_spare: [::__fsword_t; 4],
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct flock64 {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off64_t,
+        pub l_len: ::off64_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct ipc_perm {
+        __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        __seq: ::c_ushort,
+        __pad1: ::c_ushort,
+        __glibc_reserved1: ::c_ulong,
+        __glibc_reserved2: ::c_ulong,
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        __pad1: ::c_ushort,
+        pub __st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad2: ::c_ushort,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_ulong,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_ulong,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_ulong,
+        pub st_ino: ::ino64_t,
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: ::fsblkcnt64_t,
+        pub f_bfree: ::fsblkcnt64_t,
+        pub f_bavail: ::fsblkcnt64_t,
+        pub f_files: ::fsblkcnt64_t,
+        pub f_ffree: ::fsblkcnt64_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__fsword_t; 4],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt64_t,
+        pub f_bfree: ::fsblkcnt64_t,
+        pub f_bavail: ::fsblkcnt64_t,
+        pub f_files: ::fsblkcnt64_t,
+        pub f_ffree: ::fsblkcnt64_t,
+        pub f_favail: ::fsblkcnt64_t,
+        pub f_fsid: ::c_ulong,
+        __f_unused: ::c_int,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        __glibc_reserved1: ::c_long,
+        pub shm_dtime: ::time_t,
+        __glibc_reserved2: ::c_long,
+        pub shm_ctime: ::time_t,
+        __glibc_reserved3: ::c_long,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __glibc_reserved5: ::c_ulong,
+        __glibc_reserved6: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __glibc_reserved1: ::c_uint,
+        pub msg_rtime: ::time_t,
+        __glibc_reserved2: ::c_uint,
+        pub msg_ctime: ::time_t,
+        __glibc_reserved3: ::c_uint,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved4: ::c_ulong,
+        __glibc_reserved5: ::c_ulong,
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_code: ::c_int,
+        pub si_errno: ::c_int,
+        _pad: [::c_int; 29],
+        _align: [usize; 0],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t
+    }
+}
+
+pub const VEOF: usize = 4;
+pub const RTLD_DEEPBIND: ::c_int = 0x8;
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+pub const O_DIRECT: ::c_int = 0x10000;
+pub const O_DIRECTORY: ::c_int = 0x4000;
+pub const O_NOFOLLOW: ::c_int = 0x8000;
+pub const O_LARGEFILE: ::c_int = 0x20000;
+pub const O_APPEND: ::c_int = 1024;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_FSYNC: ::c_int = 0x101000;
+pub const O_ASYNC: ::c_int = 0x2000;
+pub const O_NDELAY: ::c_int = 0x800;
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MAP_LOCKED: ::c_int = 0x02000;
+pub const MAP_NORESERVE: ::c_int = 0x04000;
+pub const MAP_32BIT: ::c_int = 0x0040;
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_ANONYMOUS: ::c_int = 0x0020;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const EDEADLOCK: ::c_int = 35;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EDEADLK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EBADMSG: ::c_int = 74;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const EHWPOISON: ::c_int = 133;
+pub const ERFKILL: ::c_int = 132;
+
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETOWN: ::c_int = 8;
+
+pub const PTRACE_GETFPXREGS: ::c_uint = 18;
+pub const PTRACE_SETFPXREGS: ::c_uint = 19;
+pub const PTRACE_SYSEMU: ::c_uint = 31;
+pub const PTRACE_SYSEMU_SINGLESTEP: ::c_uint = 32;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const EFD_NONBLOCK: ::c_int = 0x800;
+pub const SFD_NONBLOCK: ::c_int = 0x0800;
+
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
+pub const SIGUNUSED: ::c_int = 31;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+
+pub const SYS_restart_syscall: ::c_long = 0;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_waitpid: ::c_long = 7;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execve: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_time32: ::c_long = 13;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_chown16: ::c_long = 16;
+pub const SYS_stat: ::c_long = 18;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_mount: ::c_long = 21;
+pub const SYS_oldumount: ::c_long = 22;
+pub const SYS_setuid16: ::c_long = 23;
+pub const SYS_getuid16: ::c_long = 24;
+pub const SYS_stime32: ::c_long = 25;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_alarm: ::c_long = 27;
+pub const SYS_fstat: ::c_long = 28;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_utime32: ::c_long = 30;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_setgid16: ::c_long = 46;
+pub const SYS_getgid16: ::c_long = 47;
+pub const SYS_signal: ::c_long = 48;
+pub const SYS_geteuid16: ::c_long = 49;
+pub const SYS_getegid16: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount: ::c_long = 52;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_sgetmask: ::c_long = 68;
+pub const SYS_ssetmask: ::c_long = 69;
+pub const SYS_setreuid16: ::c_long = 70;
+pub const SYS_setregid16: ::c_long = 71;
+pub const SYS_sigsuspend: ::c_long = 72;
+pub const SYS_sigpending: ::c_long = 73;
+pub const SYS_sethostname: ::c_long = 74;
+pub const SYS_setrlimit: ::c_long = 75;
+pub const SYS_old_getrlimit: ::c_long = 76;
+pub const SYS_getrusage: ::c_long = 77;
+pub const SYS_gettimeofday: ::c_long = 78;
+pub const SYS_settimeofday: ::c_long = 79;
+pub const SYS_getgroups16: ::c_long = 80;
+pub const SYS_setgroups16: ::c_long = 81;
+pub const SYS_old_select: ::c_long = 82;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_lstat: ::c_long = 84;
+pub const SYS_readlink: ::c_long = 85;
+pub const SYS_uselib: ::c_long = 86;
+pub const SYS_swapon: ::c_long = 87;
+pub const SYS_reboot: ::c_long = 88;
+pub const SYS_old_readdir: ::c_long = 89;
+pub const SYS_old_mmap: ::c_long = 90;
+pub const SYS_munmap: ::c_long = 91;
+pub const SYS_truncate: ::c_long = 92;
+pub const SYS_ftruncate: ::c_long = 93;
+pub const SYS_fchmod: ::c_long = 94;
+pub const SYS_fchown16: ::c_long = 95;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_socketcall: ::c_long = 102;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_setitimer: ::c_long = 104;
+pub const SYS_getitimer: ::c_long = 105;
+pub const SYS_newstat: ::c_long = 106;
+pub const SYS_newlstat: ::c_long = 107;
+pub const SYS_newfstat: ::c_long = 108;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_ipc: ::c_long = 117;
+pub const SYS_fsync: ::c_long = 118;
+pub const SYS_sigreturn: ::c_long = 119;
+pub const SYS_clone: ::c_long = 120;
+pub const SYS_setdomainname: ::c_long = 121;
+pub const SYS_newuname: ::c_long = 122;
+pub const SYS_cacheflush: ::c_long = 123;
+pub const SYS_adjtimex_time32: ::c_long = 124;
+pub const SYS_mprotect: ::c_long = 125;
+pub const SYS_sigprocmask: ::c_long = 126;
+pub const SYS_create_module: ::c_long = 127;
+pub const SYS_init_module: ::c_long = 128;
+pub const SYS_delete_module: ::c_long = 129;
+pub const SYS_get_kernel_syms: ::c_long = 130;
+pub const SYS_quotactl: ::c_long = 131;
+pub const SYS_getpgid: ::c_long = 132;
+pub const SYS_fchdir: ::c_long = 133;
+pub const SYS_bdflush: ::c_long = 134;
+pub const SYS_sysfs: ::c_long = 135;
+pub const SYS_personality: ::c_long = 136;
+pub const SYS_setfsuid16: ::c_long = 138;
+pub const SYS_setfsgid16: ::c_long = 139;
+pub const SYS_llseek: ::c_long = 140;
+pub const SYS_getdents: ::c_long = 141;
+pub const SYS_select: ::c_long = 142;
+pub const SYS_flock: ::c_long = 143;
+pub const SYS_msync: ::c_long = 144;
+pub const SYS_readv: ::c_long = 145;
+pub const SYS_writev: ::c_long = 146;
+pub const SYS_getsid: ::c_long = 147;
+pub const SYS_fdatasync: ::c_long = 148;
+pub const SYS__sysctl: ::c_long = 149;
+pub const SYS_mlock: ::c_long = 150;
+pub const SYS_munlock: ::c_long = 151;
+pub const SYS_mlockall: ::c_long = 152;
+pub const SYS_munlockall: ::c_long = 153;
+pub const SYS_sched_setparam: ::c_long = 154;
+pub const SYS_sched_getparam: ::c_long = 155;
+pub const SYS_sched_setscheduler: ::c_long = 156;
+pub const SYS_sched_getscheduler: ::c_long = 157;
+pub const SYS_sched_yield: ::c_long = 158;
+pub const SYS_sched_get_priority_max: ::c_long = 159;
+pub const SYS_sched_get_priority_min: ::c_long = 160;
+pub const SYS_sched_rr_get_interval_time32: ::c_long = 161;
+pub const SYS_nanosleep_time32: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_setresuid16: ::c_long = 164;
+pub const SYS_getresuid16: ::c_long = 165;
+pub const SYS_getpagesize: ::c_long = 166;
+pub const SYS_query_module: ::c_long = 167;
+pub const SYS_poll: ::c_long = 168;
+pub const SYS_nfsservctl: ::c_long = 169;
+pub const SYS_setresgid16: ::c_long = 170;
+pub const SYS_getresgid16: ::c_long = 171;
+pub const SYS_prctl: ::c_long = 172;
+pub const SYS_rt_sigreturn: ::c_long = 173;
+pub const SYS_rt_sigaction: ::c_long = 174;
+pub const SYS_rt_sigprocmask: ::c_long = 175;
+pub const SYS_rt_sigpending: ::c_long = 176;
+pub const SYS_rt_sigtimedwait_time32: ::c_long = 177;
+pub const SYS_rt_sigqueueinfo: ::c_long = 178;
+pub const SYS_rt_sigsuspend: ::c_long = 179;
+pub const SYS_pread64: ::c_long = 180;
+pub const SYS_pwrite64: ::c_long = 181;
+pub const SYS_lchown16: ::c_long = 182;
+pub const SYS_getcwd: ::c_long = 183;
+pub const SYS_capget: ::c_long = 184;
+pub const SYS_capset: ::c_long = 185;
+pub const SYS_sigaltstack: ::c_long = 186;
+pub const SYS_sendfile: ::c_long = 187;
+pub const SYS_getpmsg: ::c_long = 188;
+pub const SYS_putpmsg: ::c_long = 189;
+pub const SYS_vfork: ::c_long = 190;
+pub const SYS_getrlimit: ::c_long = 191;
+pub const SYS_mmap2: ::c_long = 192;
+pub const SYS_truncate64: ::c_long = 193;
+pub const SYS_ftruncate64: ::c_long = 194;
+pub const SYS_stat64: ::c_long = 195;
+pub const SYS_lstat64: ::c_long = 196;
+pub const SYS_fstat64: ::c_long = 197;
+pub const SYS_chown: ::c_long = 198;
+pub const SYS_getuid: ::c_long = 199;
+pub const SYS_getgid: ::c_long = 200;
+pub const SYS_geteuid: ::c_long = 201;
+pub const SYS_getegid: ::c_long = 202;
+pub const SYS_setreuid: ::c_long = 203;
+pub const SYS_setregid: ::c_long = 204;
+pub const SYS_getgroups: ::c_long = 205;
+pub const SYS_setgroups: ::c_long = 206;
+pub const SYS_fchown: ::c_long = 207;
+pub const SYS_setresuid: ::c_long = 208;
+pub const SYS_getresuid: ::c_long = 209;
+pub const SYS_setresgid: ::c_long = 210;
+pub const SYS_getresgid: ::c_long = 211;
+pub const SYS_lchown: ::c_long = 212;
+pub const SYS_setuid: ::c_long = 213;
+pub const SYS_setgid: ::c_long = 214;
+pub const SYS_setfsuid: ::c_long = 215;
+pub const SYS_setfsgid: ::c_long = 216;
+pub const SYS_pivot_root: ::c_long = 217;
+pub const SYS_getdents64: ::c_long = 220;
+pub const SYS_gettid: ::c_long = 221;
+pub const SYS_tkill: ::c_long = 222;
+pub const SYS_setxattr: ::c_long = 223;
+pub const SYS_lsetxattr: ::c_long = 224;
+pub const SYS_fsetxattr: ::c_long = 225;
+pub const SYS_getxattr: ::c_long = 226;
+pub const SYS_lgetxattr: ::c_long = 227;
+pub const SYS_fgetxattr: ::c_long = 228;
+pub const SYS_listxattr: ::c_long = 229;
+pub const SYS_llistxattr: ::c_long = 230;
+pub const SYS_flistxattr: ::c_long = 231;
+pub const SYS_removexattr: ::c_long = 232;
+pub const SYS_lremovexattr: ::c_long = 233;
+pub const SYS_fremovexattr: ::c_long = 234;
+pub const SYS_futex_time32: ::c_long = 235;
+pub const SYS_sendfile64: ::c_long = 236;
+pub const SYS_mincore: ::c_long = 237;
+pub const SYS_madvise: ::c_long = 238;
+pub const SYS_fcntl64: ::c_long = 239;
+pub const SYS_readahead: ::c_long = 240;
+pub const SYS_io_setup: ::c_long = 241;
+pub const SYS_io_destroy: ::c_long = 242;
+pub const SYS_io_getevents_time32: ::c_long = 243;
+pub const SYS_io_submit: ::c_long = 244;
+pub const SYS_io_cancel: ::c_long = 245;
+pub const SYS_fadvise64: ::c_long = 246;
+pub const SYS_exit_group: ::c_long = 247;
+pub const SYS_lookup_dcookie: ::c_long = 248;
+pub const SYS_epoll_create: ::c_long = 249;
+pub const SYS_epoll_ctl: ::c_long = 250;
+pub const SYS_epoll_wait: ::c_long = 251;
+pub const SYS_remap_file_pages: ::c_long = 252;
+pub const SYS_set_tid_address: ::c_long = 253;
+pub const SYS_timer_create: ::c_long = 254;
+pub const SYS_timer_settime32: ::c_long = 255;
+pub const SYS_timer_gettime32: ::c_long = 256;
+pub const SYS_timer_getoverrun: ::c_long = 257;
+pub const SYS_timer_delete: ::c_long = 258;
+pub const SYS_clock_settime32: ::c_long = 259;
+pub const SYS_clock_gettime32: ::c_long = 260;
+pub const SYS_clock_getres_time32: ::c_long = 261;
+pub const SYS_clock_nanosleep_time32: ::c_long = 262;
+pub const SYS_statfs64: ::c_long = 263;
+pub const SYS_fstatfs64: ::c_long = 264;
+pub const SYS_tgkill: ::c_long = 265;
+pub const SYS_utimes_time32: ::c_long = 266;
+pub const SYS_fadvise64_64: ::c_long = 267;
+pub const SYS_mbind: ::c_long = 268;
+pub const SYS_get_mempolicy: ::c_long = 269;
+pub const SYS_set_mempolicy: ::c_long = 270;
+pub const SYS_mq_open: ::c_long = 271;
+pub const SYS_mq_unlink: ::c_long = 272;
+pub const SYS_mq_timedsend_time32: ::c_long = 273;
+pub const SYS_mq_timedreceive_time32: ::c_long = 274;
+pub const SYS_mq_notify: ::c_long = 275;
+pub const SYS_mq_getsetattr: ::c_long = 276;
+pub const SYS_waitid: ::c_long = 277;
+pub const SYS_add_key: ::c_long = 279;
+pub const SYS_request_key: ::c_long = 280;
+pub const SYS_keyctl: ::c_long = 281;
+pub const SYS_ioprio_set: ::c_long = 282;
+pub const SYS_ioprio_get: ::c_long = 283;
+pub const SYS_inotify_init: ::c_long = 284;
+pub const SYS_inotify_add_watch: ::c_long = 285;
+pub const SYS_inotify_rm_watch: ::c_long = 286;
+pub const SYS_migrate_pages: ::c_long = 287;
+pub const SYS_openat: ::c_long = 288;
+pub const SYS_mkdirat: ::c_long = 289;
+pub const SYS_mknodat: ::c_long = 290;
+pub const SYS_fchownat: ::c_long = 291;
+pub const SYS_futimesat_time32: ::c_long = 292;
+pub const SYS_fstatat64: ::c_long = 293;
+pub const SYS_unlinkat: ::c_long = 294;
+pub const SYS_renameat: ::c_long = 295;
+pub const SYS_linkat: ::c_long = 296;
+pub const SYS_symlinkat: ::c_long = 297;
+pub const SYS_readlinkat: ::c_long = 298;
+pub const SYS_fchmodat: ::c_long = 299;
+pub const SYS_faccessat: ::c_long = 300;
+pub const SYS_pselect6_time32: ::c_long = 301;
+pub const SYS_ppoll_time32: ::c_long = 302;
+pub const SYS_unshare: ::c_long = 303;
+pub const SYS_set_robust_list: ::c_long = 304;
+pub const SYS_get_robust_list: ::c_long = 305;
+pub const SYS_splice: ::c_long = 306;
+pub const SYS_sync_file_range: ::c_long = 307;
+pub const SYS_tee: ::c_long = 308;
+pub const SYS_vmsplice: ::c_long = 309;
+pub const SYS_move_pages: ::c_long = 310;
+pub const SYS_sched_setaffinity: ::c_long = 311;
+pub const SYS_sched_getaffinity: ::c_long = 312;
+pub const SYS_kexec_load: ::c_long = 313;
+pub const SYS_getcpu: ::c_long = 314;
+pub const SYS_epoll_pwait: ::c_long = 315;
+pub const SYS_utimensat_time32: ::c_long = 316;
+pub const SYS_signalfd: ::c_long = 317;
+pub const SYS_timerfd_create: ::c_long = 318;
+pub const SYS_eventfd: ::c_long = 319;
+pub const SYS_fallocate: ::c_long = 320;
+pub const SYS_timerfd_settime32: ::c_long = 321;
+pub const SYS_timerfd_gettime32: ::c_long = 322;
+pub const SYS_signalfd4: ::c_long = 323;
+pub const SYS_eventfd2: ::c_long = 324;
+pub const SYS_epoll_create1: ::c_long = 325;
+pub const SYS_dup3: ::c_long = 326;
+pub const SYS_pipe2: ::c_long = 327;
+pub const SYS_inotify_init1: ::c_long = 328;
+pub const SYS_preadv: ::c_long = 329;
+pub const SYS_pwritev: ::c_long = 330;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 331;
+pub const SYS_perf_event_open: ::c_long = 332;
+pub const SYS_get_thread_area: ::c_long = 333;
+pub const SYS_set_thread_area: ::c_long = 334;
+pub const SYS_atomic_cmpxchg_32: ::c_long = 335;
+pub const SYS_atomic_barrier: ::c_long = 336;
+pub const SYS_fanotify_init: ::c_long = 337;
+pub const SYS_fanotify_mark: ::c_long = 338;
+pub const SYS_prlimit64: ::c_long = 339;
+pub const SYS_name_to_handle_at: ::c_long = 340;
+pub const SYS_open_by_handle_at: ::c_long = 341;
+pub const SYS_clock_adjtime32: ::c_long = 342;
+pub const SYS_syncfs: ::c_long = 343;
+pub const SYS_setns: ::c_long = 344;
+pub const SYS_process_vm_readv: ::c_long = 345;
+pub const SYS_process_vm_writev: ::c_long = 346;
+pub const SYS_kcmp: ::c_long = 347;
+pub const SYS_finit_module: ::c_long = 348;
+pub const SYS_sched_setattr: ::c_long = 349;
+pub const SYS_sched_getattr: ::c_long = 350;
+pub const SYS_renameat2: ::c_long = 351;
+pub const SYS_getrandom: ::c_long = 352;
+pub const SYS_memfd_create: ::c_long = 353;
+pub const SYS_bpf: ::c_long = 354;
+pub const SYS_execveat: ::c_long = 355;
+pub const SYS_socket: ::c_long = 356;
+pub const SYS_socketpair: ::c_long = 357;
+pub const SYS_bind: ::c_long = 358;
+pub const SYS_connect: ::c_long = 359;
+pub const SYS_listen: ::c_long = 360;
+pub const SYS_accept4: ::c_long = 361;
+pub const SYS_getsockopt: ::c_long = 362;
+pub const SYS_setsockopt: ::c_long = 363;
+pub const SYS_getsockname: ::c_long = 364;
+pub const SYS_getpeername: ::c_long = 365;
+pub const SYS_sendto: ::c_long = 366;
+pub const SYS_sendmsg: ::c_long = 367;
+pub const SYS_recvfrom: ::c_long = 368;
+pub const SYS_recvmsg: ::c_long = 369;
+pub const SYS_shutdown: ::c_long = 370;
+pub const SYS_recvmmsg_time32: ::c_long = 371;
+pub const SYS_sendmmsg: ::c_long = 372;
+pub const SYS_userfaultfd: ::c_long = 373;
+pub const SYS_membarrier: ::c_long = 374;
+pub const SYS_mlock2: ::c_long = 375;
+pub const SYS_copy_file_range: ::c_long = 376;
+pub const SYS_preadv2: ::c_long = 377;
+pub const SYS_pwritev2: ::c_long = 378;
+pub const SYS_statx: ::c_long = 379;
+pub const SYS_seccomp: ::c_long = 380;
+pub const SYS_pkey_mprotect: ::c_long = 381;
+pub const SYS_pkey_alloc: ::c_long = 382;
+pub const SYS_pkey_free: ::c_long = 383;
+pub const SYS_rseq: ::c_long = 384;
+pub const SYS_semget: ::c_long = 393;
+pub const SYS_semctl: ::c_long = 394;
+pub const SYS_shmget: ::c_long = 395;
+pub const SYS_shmctl: ::c_long = 396;
+pub const SYS_shmat: ::c_long = 397;
+pub const SYS_shmdt: ::c_long = 398;
+pub const SYS_msgget: ::c_long = 399;
+pub const SYS_msgsnd: ::c_long = 400;
+pub const SYS_msgrcv: ::c_long = 401;
+pub const SYS_msgctl: ::c_long = 402;
+pub const SYS_clock_gettime: ::c_long = 403;
+pub const SYS_clock_settime: ::c_long = 404;
+pub const SYS_clock_adjtime: ::c_long = 405;
+pub const SYS_clock_getres: ::c_long = 406;
+pub const SYS_clock_nanosleep: ::c_long = 407;
+pub const SYS_timer_gettime: ::c_long = 408;
+pub const SYS_timer_settime: ::c_long = 409;
+pub const SYS_timerfd_gettime: ::c_long = 410;
+pub const SYS_timerfd_settime: ::c_long = 411;
+pub const SYS_utimensat: ::c_long = 412;
+pub const SYS_pselect6: ::c_long = 413;
+pub const SYS_ppoll: ::c_long = 414;
+pub const SYS_io_pgetevents: ::c_long = 416;
+pub const SYS_recvmmsg: ::c_long = 417;
+pub const SYS_mq_timedsend: ::c_long = 418;
+pub const SYS_mq_timedreceive: ::c_long = 419;
+pub const SYS_semtimedop: ::c_long = 420;
+pub const SYS_rt_sigtimedwait: ::c_long = 421;
+pub const SYS_futex: ::c_long = 422;
+pub const SYS_sched_rr_get_interval: ::c_long = 423;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(8))]
+    pub struct max_align_t {
+        priv_: [f32; 4]
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,819 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
+
+s! {
+    pub struct stat64 {
+        pub st_dev: ::c_ulong,
+        st_pad1: [::c_long; 3],
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulong,
+        st_pad2: [::c_long; 2],
+        pub st_size: ::off64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_blksize: ::blksize_t,
+        st_pad3: ::c_long,
+        pub st_blocks: ::blkcnt64_t,
+        st_pad5: [::c_long; 14],
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        pub f_frsize: ::c_long,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_files: ::fsblkcnt_t,
+        pub f_ffree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_fsid: ::fsid_t,
+
+        pub f_namelen: ::c_long,
+        f_spare: [::c_long; 6],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        pub f_frsize: ::c_long,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_bavail: u64,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_long,
+        pub f_flags: ::c_long,
+        pub f_spare: [::c_long; 5],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        __f_unused: ::c_int,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct sigaction {
+        pub sa_flags: ::c_int,
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_restorer: ::Option<extern fn()>,
+        _resv: [::c_int; 1],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_size: ::size_t,
+        pub ss_flags: ::c_int,
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_code: ::c_int,
+        pub si_errno: ::c_int,
+        pub _pad: [::c_int; 29],
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::c_uint,
+        pub __seq: ::c_ushort,
+        __pad1: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        #[cfg(target_endian = "big")]
+        __glibc_reserved1: ::c_ulong,
+        pub msg_stime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __glibc_reserved1: ::c_ulong,
+        #[cfg(target_endian = "big")]
+        __glibc_reserved2: ::c_ulong,
+        pub msg_rtime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __glibc_reserved2: ::c_ulong,
+        #[cfg(target_endian = "big")]
+        __glibc_reserved3: ::c_ulong,
+        pub msg_ctime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __glibc_reserved3: ::c_ulong,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved4: ::c_ulong,
+        __glibc_reserved5: ::c_ulong,
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_sysid: ::c_long,
+        pub l_pid: ::pid_t,
+        pad: [::c_long; 4],
+    }
+}
+
+pub const O_LARGEFILE: ::c_int = 0x2000;
+
+pub const SYS_syscall: ::c_long = 4000 + 0;
+pub const SYS_exit: ::c_long = 4000 + 1;
+pub const SYS_fork: ::c_long = 4000 + 2;
+pub const SYS_read: ::c_long = 4000 + 3;
+pub const SYS_write: ::c_long = 4000 + 4;
+pub const SYS_open: ::c_long = 4000 + 5;
+pub const SYS_close: ::c_long = 4000 + 6;
+pub const SYS_waitpid: ::c_long = 4000 + 7;
+pub const SYS_creat: ::c_long = 4000 + 8;
+pub const SYS_link: ::c_long = 4000 + 9;
+pub const SYS_unlink: ::c_long = 4000 + 10;
+pub const SYS_execve: ::c_long = 4000 + 11;
+pub const SYS_chdir: ::c_long = 4000 + 12;
+pub const SYS_time: ::c_long = 4000 + 13;
+pub const SYS_mknod: ::c_long = 4000 + 14;
+pub const SYS_chmod: ::c_long = 4000 + 15;
+pub const SYS_lchown: ::c_long = 4000 + 16;
+pub const SYS_break: ::c_long = 4000 + 17;
+pub const SYS_lseek: ::c_long = 4000 + 19;
+pub const SYS_getpid: ::c_long = 4000 + 20;
+pub const SYS_mount: ::c_long = 4000 + 21;
+pub const SYS_umount: ::c_long = 4000 + 22;
+pub const SYS_setuid: ::c_long = 4000 + 23;
+pub const SYS_getuid: ::c_long = 4000 + 24;
+pub const SYS_stime: ::c_long = 4000 + 25;
+pub const SYS_ptrace: ::c_long = 4000 + 26;
+pub const SYS_alarm: ::c_long = 4000 + 27;
+pub const SYS_pause: ::c_long = 4000 + 29;
+pub const SYS_utime: ::c_long = 4000 + 30;
+pub const SYS_stty: ::c_long = 4000 + 31;
+pub const SYS_gtty: ::c_long = 4000 + 32;
+pub const SYS_access: ::c_long = 4000 + 33;
+pub const SYS_nice: ::c_long = 4000 + 34;
+pub const SYS_ftime: ::c_long = 4000 + 35;
+pub const SYS_sync: ::c_long = 4000 + 36;
+pub const SYS_kill: ::c_long = 4000 + 37;
+pub const SYS_rename: ::c_long = 4000 + 38;
+pub const SYS_mkdir: ::c_long = 4000 + 39;
+pub const SYS_rmdir: ::c_long = 4000 + 40;
+pub const SYS_dup: ::c_long = 4000 + 41;
+pub const SYS_pipe: ::c_long = 4000 + 42;
+pub const SYS_times: ::c_long = 4000 + 43;
+pub const SYS_prof: ::c_long = 4000 + 44;
+pub const SYS_brk: ::c_long = 4000 + 45;
+pub const SYS_setgid: ::c_long = 4000 + 46;
+pub const SYS_getgid: ::c_long = 4000 + 47;
+pub const SYS_signal: ::c_long = 4000 + 48;
+pub const SYS_geteuid: ::c_long = 4000 + 49;
+pub const SYS_getegid: ::c_long = 4000 + 50;
+pub const SYS_acct: ::c_long = 4000 + 51;
+pub const SYS_umount2: ::c_long = 4000 + 52;
+pub const SYS_lock: ::c_long = 4000 + 53;
+pub const SYS_ioctl: ::c_long = 4000 + 54;
+pub const SYS_fcntl: ::c_long = 4000 + 55;
+pub const SYS_mpx: ::c_long = 4000 + 56;
+pub const SYS_setpgid: ::c_long = 4000 + 57;
+pub const SYS_ulimit: ::c_long = 4000 + 58;
+pub const SYS_umask: ::c_long = 4000 + 60;
+pub const SYS_chroot: ::c_long = 4000 + 61;
+pub const SYS_ustat: ::c_long = 4000 + 62;
+pub const SYS_dup2: ::c_long = 4000 + 63;
+pub const SYS_getppid: ::c_long = 4000 + 64;
+pub const SYS_getpgrp: ::c_long = 4000 + 65;
+pub const SYS_setsid: ::c_long = 4000 + 66;
+pub const SYS_sigaction: ::c_long = 4000 + 67;
+pub const SYS_sgetmask: ::c_long = 4000 + 68;
+pub const SYS_ssetmask: ::c_long = 4000 + 69;
+pub const SYS_setreuid: ::c_long = 4000 + 70;
+pub const SYS_setregid: ::c_long = 4000 + 71;
+pub const SYS_sigsuspend: ::c_long = 4000 + 72;
+pub const SYS_sigpending: ::c_long = 4000 + 73;
+pub const SYS_sethostname: ::c_long = 4000 + 74;
+pub const SYS_setrlimit: ::c_long = 4000 + 75;
+pub const SYS_getrlimit: ::c_long = 4000 + 76;
+pub const SYS_getrusage: ::c_long = 4000 + 77;
+pub const SYS_gettimeofday: ::c_long = 4000 + 78;
+pub const SYS_settimeofday: ::c_long = 4000 + 79;
+pub const SYS_getgroups: ::c_long = 4000 + 80;
+pub const SYS_setgroups: ::c_long = 4000 + 81;
+pub const SYS_symlink: ::c_long = 4000 + 83;
+pub const SYS_readlink: ::c_long = 4000 + 85;
+pub const SYS_uselib: ::c_long = 4000 + 86;
+pub const SYS_swapon: ::c_long = 4000 + 87;
+pub const SYS_reboot: ::c_long = 4000 + 88;
+pub const SYS_readdir: ::c_long = 4000 + 89;
+pub const SYS_mmap: ::c_long = 4000 + 90;
+pub const SYS_munmap: ::c_long = 4000 + 91;
+pub const SYS_truncate: ::c_long = 4000 + 92;
+pub const SYS_ftruncate: ::c_long = 4000 + 93;
+pub const SYS_fchmod: ::c_long = 4000 + 94;
+pub const SYS_fchown: ::c_long = 4000 + 95;
+pub const SYS_getpriority: ::c_long = 4000 + 96;
+pub const SYS_setpriority: ::c_long = 4000 + 97;
+pub const SYS_profil: ::c_long = 4000 + 98;
+pub const SYS_statfs: ::c_long = 4000 + 99;
+pub const SYS_fstatfs: ::c_long = 4000 + 100;
+pub const SYS_ioperm: ::c_long = 4000 + 101;
+pub const SYS_socketcall: ::c_long = 4000 + 102;
+pub const SYS_syslog: ::c_long = 4000 + 103;
+pub const SYS_setitimer: ::c_long = 4000 + 104;
+pub const SYS_getitimer: ::c_long = 4000 + 105;
+pub const SYS_stat: ::c_long = 4000 + 106;
+pub const SYS_lstat: ::c_long = 4000 + 107;
+pub const SYS_fstat: ::c_long = 4000 + 108;
+pub const SYS_iopl: ::c_long = 4000 + 110;
+pub const SYS_vhangup: ::c_long = 4000 + 111;
+pub const SYS_idle: ::c_long = 4000 + 112;
+pub const SYS_vm86: ::c_long = 4000 + 113;
+pub const SYS_wait4: ::c_long = 4000 + 114;
+pub const SYS_swapoff: ::c_long = 4000 + 115;
+pub const SYS_sysinfo: ::c_long = 4000 + 116;
+pub const SYS_ipc: ::c_long = 4000 + 117;
+pub const SYS_fsync: ::c_long = 4000 + 118;
+pub const SYS_sigreturn: ::c_long = 4000 + 119;
+pub const SYS_clone: ::c_long = 4000 + 120;
+pub const SYS_setdomainname: ::c_long = 4000 + 121;
+pub const SYS_uname: ::c_long = 4000 + 122;
+pub const SYS_modify_ldt: ::c_long = 4000 + 123;
+pub const SYS_adjtimex: ::c_long = 4000 + 124;
+pub const SYS_mprotect: ::c_long = 4000 + 125;
+pub const SYS_sigprocmask: ::c_long = 4000 + 126;
+pub const SYS_create_module: ::c_long = 4000 + 127;
+pub const SYS_init_module: ::c_long = 4000 + 128;
+pub const SYS_delete_module: ::c_long = 4000 + 129;
+pub const SYS_get_kernel_syms: ::c_long = 4000 + 130;
+pub const SYS_quotactl: ::c_long = 4000 + 131;
+pub const SYS_getpgid: ::c_long = 4000 + 132;
+pub const SYS_fchdir: ::c_long = 4000 + 133;
+pub const SYS_bdflush: ::c_long = 4000 + 134;
+pub const SYS_sysfs: ::c_long = 4000 + 135;
+pub const SYS_personality: ::c_long = 4000 + 136;
+pub const SYS_afs_syscall: ::c_long = 4000 + 137;
+pub const SYS_setfsuid: ::c_long = 4000 + 138;
+pub const SYS_setfsgid: ::c_long = 4000 + 139;
+pub const SYS__llseek: ::c_long = 4000 + 140;
+pub const SYS_getdents: ::c_long = 4000 + 141;
+pub const SYS__newselect: ::c_long = 4000 + 142;
+pub const SYS_flock: ::c_long = 4000 + 143;
+pub const SYS_msync: ::c_long = 4000 + 144;
+pub const SYS_readv: ::c_long = 4000 + 145;
+pub const SYS_writev: ::c_long = 4000 + 146;
+pub const SYS_cacheflush: ::c_long = 4000 + 147;
+pub const SYS_cachectl: ::c_long = 4000 + 148;
+pub const SYS_sysmips: ::c_long = 4000 + 149;
+pub const SYS_getsid: ::c_long = 4000 + 151;
+pub const SYS_fdatasync: ::c_long = 4000 + 152;
+pub const SYS__sysctl: ::c_long = 4000 + 153;
+pub const SYS_mlock: ::c_long = 4000 + 154;
+pub const SYS_munlock: ::c_long = 4000 + 155;
+pub const SYS_mlockall: ::c_long = 4000 + 156;
+pub const SYS_munlockall: ::c_long = 4000 + 157;
+pub const SYS_sched_setparam: ::c_long = 4000 + 158;
+pub const SYS_sched_getparam: ::c_long = 4000 + 159;
+pub const SYS_sched_setscheduler: ::c_long = 4000 + 160;
+pub const SYS_sched_getscheduler: ::c_long = 4000 + 161;
+pub const SYS_sched_yield: ::c_long = 4000 + 162;
+pub const SYS_sched_get_priority_max: ::c_long = 4000 + 163;
+pub const SYS_sched_get_priority_min: ::c_long = 4000 + 164;
+pub const SYS_sched_rr_get_interval: ::c_long = 4000 + 165;
+pub const SYS_nanosleep: ::c_long = 4000 + 166;
+pub const SYS_mremap: ::c_long = 4000 + 167;
+pub const SYS_accept: ::c_long = 4000 + 168;
+pub const SYS_bind: ::c_long = 4000 + 169;
+pub const SYS_connect: ::c_long = 4000 + 170;
+pub const SYS_getpeername: ::c_long = 4000 + 171;
+pub const SYS_getsockname: ::c_long = 4000 + 172;
+pub const SYS_getsockopt: ::c_long = 4000 + 173;
+pub const SYS_listen: ::c_long = 4000 + 174;
+pub const SYS_recv: ::c_long = 4000 + 175;
+pub const SYS_recvfrom: ::c_long = 4000 + 176;
+pub const SYS_recvmsg: ::c_long = 4000 + 177;
+pub const SYS_send: ::c_long = 4000 + 178;
+pub const SYS_sendmsg: ::c_long = 4000 + 179;
+pub const SYS_sendto: ::c_long = 4000 + 180;
+pub const SYS_setsockopt: ::c_long = 4000 + 181;
+pub const SYS_shutdown: ::c_long = 4000 + 182;
+pub const SYS_socket: ::c_long = 4000 + 183;
+pub const SYS_socketpair: ::c_long = 4000 + 184;
+pub const SYS_setresuid: ::c_long = 4000 + 185;
+pub const SYS_getresuid: ::c_long = 4000 + 186;
+pub const SYS_query_module: ::c_long = 4000 + 187;
+pub const SYS_poll: ::c_long = 4000 + 188;
+pub const SYS_nfsservctl: ::c_long = 4000 + 189;
+pub const SYS_setresgid: ::c_long = 4000 + 190;
+pub const SYS_getresgid: ::c_long = 4000 + 191;
+pub const SYS_prctl: ::c_long = 4000 + 192;
+pub const SYS_rt_sigreturn: ::c_long = 4000 + 193;
+pub const SYS_rt_sigaction: ::c_long = 4000 + 194;
+pub const SYS_rt_sigprocmask: ::c_long = 4000 + 195;
+pub const SYS_rt_sigpending: ::c_long = 4000 + 196;
+pub const SYS_rt_sigtimedwait: ::c_long = 4000 + 197;
+pub const SYS_rt_sigqueueinfo: ::c_long = 4000 + 198;
+pub const SYS_rt_sigsuspend: ::c_long = 4000 + 199;
+pub const SYS_pread64: ::c_long = 4000 + 200;
+pub const SYS_pwrite64: ::c_long = 4000 + 201;
+pub const SYS_chown: ::c_long = 4000 + 202;
+pub const SYS_getcwd: ::c_long = 4000 + 203;
+pub const SYS_capget: ::c_long = 4000 + 204;
+pub const SYS_capset: ::c_long = 4000 + 205;
+pub const SYS_sigaltstack: ::c_long = 4000 + 206;
+pub const SYS_sendfile: ::c_long = 4000 + 207;
+pub const SYS_getpmsg: ::c_long = 4000 + 208;
+pub const SYS_putpmsg: ::c_long = 4000 + 209;
+pub const SYS_mmap2: ::c_long = 4000 + 210;
+pub const SYS_truncate64: ::c_long = 4000 + 211;
+pub const SYS_ftruncate64: ::c_long = 4000 + 212;
+pub const SYS_stat64: ::c_long = 4000 + 213;
+pub const SYS_lstat64: ::c_long = 4000 + 214;
+pub const SYS_fstat64: ::c_long = 4000 + 215;
+pub const SYS_pivot_root: ::c_long = 4000 + 216;
+pub const SYS_mincore: ::c_long = 4000 + 217;
+pub const SYS_madvise: ::c_long = 4000 + 218;
+pub const SYS_getdents64: ::c_long = 4000 + 219;
+pub const SYS_fcntl64: ::c_long = 4000 + 220;
+pub const SYS_gettid: ::c_long = 4000 + 222;
+pub const SYS_readahead: ::c_long = 4000 + 223;
+pub const SYS_setxattr: ::c_long = 4000 + 224;
+pub const SYS_lsetxattr: ::c_long = 4000 + 225;
+pub const SYS_fsetxattr: ::c_long = 4000 + 226;
+pub const SYS_getxattr: ::c_long = 4000 + 227;
+pub const SYS_lgetxattr: ::c_long = 4000 + 228;
+pub const SYS_fgetxattr: ::c_long = 4000 + 229;
+pub const SYS_listxattr: ::c_long = 4000 + 230;
+pub const SYS_llistxattr: ::c_long = 4000 + 231;
+pub const SYS_flistxattr: ::c_long = 4000 + 232;
+pub const SYS_removexattr: ::c_long = 4000 + 233;
+pub const SYS_lremovexattr: ::c_long = 4000 + 234;
+pub const SYS_fremovexattr: ::c_long = 4000 + 235;
+pub const SYS_tkill: ::c_long = 4000 + 236;
+pub const SYS_sendfile64: ::c_long = 4000 + 237;
+pub const SYS_futex: ::c_long = 4000 + 238;
+pub const SYS_sched_setaffinity: ::c_long = 4000 + 239;
+pub const SYS_sched_getaffinity: ::c_long = 4000 + 240;
+pub const SYS_io_setup: ::c_long = 4000 + 241;
+pub const SYS_io_destroy: ::c_long = 4000 + 242;
+pub const SYS_io_getevents: ::c_long = 4000 + 243;
+pub const SYS_io_submit: ::c_long = 4000 + 244;
+pub const SYS_io_cancel: ::c_long = 4000 + 245;
+pub const SYS_exit_group: ::c_long = 4000 + 246;
+pub const SYS_lookup_dcookie: ::c_long = 4000 + 247;
+pub const SYS_epoll_create: ::c_long = 4000 + 248;
+pub const SYS_epoll_ctl: ::c_long = 4000 + 249;
+pub const SYS_epoll_wait: ::c_long = 4000 + 250;
+pub const SYS_remap_file_pages: ::c_long = 4000 + 251;
+pub const SYS_set_tid_address: ::c_long = 4000 + 252;
+pub const SYS_restart_syscall: ::c_long = 4000 + 253;
+pub const SYS_fadvise64: ::c_long = 4000 + 254;
+pub const SYS_statfs64: ::c_long = 4000 + 255;
+pub const SYS_fstatfs64: ::c_long = 4000 + 256;
+pub const SYS_timer_create: ::c_long = 4000 + 257;
+pub const SYS_timer_settime: ::c_long = 4000 + 258;
+pub const SYS_timer_gettime: ::c_long = 4000 + 259;
+pub const SYS_timer_getoverrun: ::c_long = 4000 + 260;
+pub const SYS_timer_delete: ::c_long = 4000 + 261;
+pub const SYS_clock_settime: ::c_long = 4000 + 262;
+pub const SYS_clock_gettime: ::c_long = 4000 + 263;
+pub const SYS_clock_getres: ::c_long = 4000 + 264;
+pub const SYS_clock_nanosleep: ::c_long = 4000 + 265;
+pub const SYS_tgkill: ::c_long = 4000 + 266;
+pub const SYS_utimes: ::c_long = 4000 + 267;
+pub const SYS_mbind: ::c_long = 4000 + 268;
+pub const SYS_get_mempolicy: ::c_long = 4000 + 269;
+pub const SYS_set_mempolicy: ::c_long = 4000 + 270;
+pub const SYS_mq_open: ::c_long = 4000 + 271;
+pub const SYS_mq_unlink: ::c_long = 4000 + 272;
+pub const SYS_mq_timedsend: ::c_long = 4000 + 273;
+pub const SYS_mq_timedreceive: ::c_long = 4000 + 274;
+pub const SYS_mq_notify: ::c_long = 4000 + 275;
+pub const SYS_mq_getsetattr: ::c_long = 4000 + 276;
+pub const SYS_vserver: ::c_long = 4000 + 277;
+pub const SYS_waitid: ::c_long = 4000 + 278;
+/* pub const SYS_sys_setaltroot: ::c_long = 4000 + 279; */
+pub const SYS_add_key: ::c_long = 4000 + 280;
+pub const SYS_request_key: ::c_long = 4000 + 281;
+pub const SYS_keyctl: ::c_long = 4000 + 282;
+pub const SYS_set_thread_area: ::c_long = 4000 + 283;
+pub const SYS_inotify_init: ::c_long = 4000 + 284;
+pub const SYS_inotify_add_watch: ::c_long = 4000 + 285;
+pub const SYS_inotify_rm_watch: ::c_long = 4000 + 286;
+pub const SYS_migrate_pages: ::c_long = 4000 + 287;
+pub const SYS_openat: ::c_long = 4000 + 288;
+pub const SYS_mkdirat: ::c_long = 4000 + 289;
+pub const SYS_mknodat: ::c_long = 4000 + 290;
+pub const SYS_fchownat: ::c_long = 4000 + 291;
+pub const SYS_futimesat: ::c_long = 4000 + 292;
+pub const SYS_fstatat64: ::c_long = 4000 + 293;
+pub const SYS_unlinkat: ::c_long = 4000 + 294;
+pub const SYS_renameat: ::c_long = 4000 + 295;
+pub const SYS_linkat: ::c_long = 4000 + 296;
+pub const SYS_symlinkat: ::c_long = 4000 + 297;
+pub const SYS_readlinkat: ::c_long = 4000 + 298;
+pub const SYS_fchmodat: ::c_long = 4000 + 299;
+pub const SYS_faccessat: ::c_long = 4000 + 300;
+pub const SYS_pselect6: ::c_long = 4000 + 301;
+pub const SYS_ppoll: ::c_long = 4000 + 302;
+pub const SYS_unshare: ::c_long = 4000 + 303;
+pub const SYS_splice: ::c_long = 4000 + 304;
+pub const SYS_sync_file_range: ::c_long = 4000 + 305;
+pub const SYS_tee: ::c_long = 4000 + 306;
+pub const SYS_vmsplice: ::c_long = 4000 + 307;
+pub const SYS_move_pages: ::c_long = 4000 + 308;
+pub const SYS_set_robust_list: ::c_long = 4000 + 309;
+pub const SYS_get_robust_list: ::c_long = 4000 + 310;
+pub const SYS_kexec_load: ::c_long = 4000 + 311;
+pub const SYS_getcpu: ::c_long = 4000 + 312;
+pub const SYS_epoll_pwait: ::c_long = 4000 + 313;
+pub const SYS_ioprio_set: ::c_long = 4000 + 314;
+pub const SYS_ioprio_get: ::c_long = 4000 + 315;
+pub const SYS_utimensat: ::c_long = 4000 + 316;
+pub const SYS_signalfd: ::c_long = 4000 + 317;
+pub const SYS_timerfd: ::c_long = 4000 + 318;
+pub const SYS_eventfd: ::c_long = 4000 + 319;
+pub const SYS_fallocate: ::c_long = 4000 + 320;
+pub const SYS_timerfd_create: ::c_long = 4000 + 321;
+pub const SYS_timerfd_gettime: ::c_long = 4000 + 322;
+pub const SYS_timerfd_settime: ::c_long = 4000 + 323;
+pub const SYS_signalfd4: ::c_long = 4000 + 324;
+pub const SYS_eventfd2: ::c_long = 4000 + 325;
+pub const SYS_epoll_create1: ::c_long = 4000 + 326;
+pub const SYS_dup3: ::c_long = 4000 + 327;
+pub const SYS_pipe2: ::c_long = 4000 + 328;
+pub const SYS_inotify_init1: ::c_long = 4000 + 329;
+pub const SYS_preadv: ::c_long = 4000 + 330;
+pub const SYS_pwritev: ::c_long = 4000 + 331;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 4000 + 332;
+pub const SYS_perf_event_open: ::c_long = 4000 + 333;
+pub const SYS_accept4: ::c_long = 4000 + 334;
+pub const SYS_recvmmsg: ::c_long = 4000 + 335;
+pub const SYS_fanotify_init: ::c_long = 4000 + 336;
+pub const SYS_fanotify_mark: ::c_long = 4000 + 337;
+pub const SYS_prlimit64: ::c_long = 4000 + 338;
+pub const SYS_name_to_handle_at: ::c_long = 4000 + 339;
+pub const SYS_open_by_handle_at: ::c_long = 4000 + 340;
+pub const SYS_clock_adjtime: ::c_long = 4000 + 341;
+pub const SYS_syncfs: ::c_long = 4000 + 342;
+pub const SYS_sendmmsg: ::c_long = 4000 + 343;
+pub const SYS_setns: ::c_long = 4000 + 344;
+pub const SYS_process_vm_readv: ::c_long = 4000 + 345;
+pub const SYS_process_vm_writev: ::c_long = 4000 + 346;
+pub const SYS_kcmp: ::c_long = 4000 + 347;
+pub const SYS_finit_module: ::c_long = 4000 + 348;
+pub const SYS_sched_setattr: ::c_long = 4000 + 349;
+pub const SYS_sched_getattr: ::c_long = 4000 + 350;
+pub const SYS_renameat2: ::c_long = 4000 + 351;
+pub const SYS_seccomp: ::c_long = 4000 + 352;
+pub const SYS_getrandom: ::c_long = 4000 + 353;
+pub const SYS_memfd_create: ::c_long = 4000 + 354;
+pub const SYS_bpf: ::c_long = 4000 + 355;
+pub const SYS_execveat: ::c_long = 4000 + 356;
+pub const SYS_userfaultfd: ::c_long = 4000 + 357;
+pub const SYS_membarrier: ::c_long = 4000 + 358;
+pub const SYS_mlock2: ::c_long = 4000 + 359;
+pub const SYS_copy_file_range: ::c_long = 4000 + 360;
+pub const SYS_preadv2: ::c_long = 4000 + 361;
+pub const SYS_pwritev2: ::c_long = 4000 + 362;
+pub const SYS_pkey_mprotect: ::c_long = 4000 + 363;
+pub const SYS_pkey_alloc: ::c_long = 4000 + 364;
+pub const SYS_pkey_free: ::c_long = 4000 + 365;
+pub const SYS_statx: ::c_long = 4000 + 366;
+pub const SYS_rseq: ::c_long = 4000 + 367;
+pub const SYS_pidfd_send_signal: ::c_long = 4000 + 424;
+pub const SYS_io_uring_setup: ::c_long = 4000 + 425;
+pub const SYS_io_uring_enter: ::c_long = 4000 + 426;
+pub const SYS_io_uring_register: ::c_long = 4000 + 427;
+pub const SYS_open_tree: ::c_long = 4000 + 428;
+pub const SYS_move_mount: ::c_long = 4000 + 429;
+pub const SYS_fsopen: ::c_long = 4000 + 430;
+pub const SYS_fsconfig: ::c_long = 4000 + 431;
+pub const SYS_fsmount: ::c_long = 4000 + 432;
+pub const SYS_fspick: ::c_long = 4000 + 433;
+pub const SYS_pidfd_open: ::c_long = 4000 + 434;
+pub const SYS_clone3: ::c_long = 4000 + 435;
+pub const SYS_close_range: ::c_long = 4000 + 436;
+pub const SYS_openat2: ::c_long = 4000 + 437;
+pub const SYS_pidfd_getfd: ::c_long = 4000 + 438;
+pub const SYS_faccessat2: ::c_long = 4000 + 439;
+pub const SYS_process_madvise: ::c_long = 4000 + 440;
+pub const SYS_epoll_pwait2: ::c_long = 4000 + 441;
+pub const SYS_mount_setattr: ::c_long = 4000 + 442;
+pub const SYS_quotactl_fd: ::c_long = 4000 + 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 4000 + 444;
+pub const SYS_landlock_add_rule: ::c_long = 4000 + 445;
+pub const SYS_landlock_restrict_self: ::c_long = 4000 + 446;
+pub const SYS_memfd_secret: ::c_long = 4000 + 447;
+pub const SYS_process_mrelease: ::c_long = 4000 + 448;
+pub const SYS_futex_waitv: ::c_long = 4000 + 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 4000 + 450;
+
+pub const O_DIRECT: ::c_int = 0x8000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+
+pub const O_APPEND: ::c_int = 8;
+pub const O_CREAT: ::c_int = 256;
+pub const O_EXCL: ::c_int = 1024;
+pub const O_NOCTTY: ::c_int = 2048;
+pub const O_NONBLOCK: ::c_int = 128;
+pub const O_SYNC: ::c_int = 0x4010;
+pub const O_RSYNC: ::c_int = 0x4010;
+pub const O_DSYNC: ::c_int = 0x10;
+pub const O_FSYNC: ::c_int = 0x4010;
+pub const O_ASYNC: ::c_int = 0x1000;
+pub const O_NDELAY: ::c_int = 0x80;
+
+pub const EDEADLK: ::c_int = 45;
+pub const ENAMETOOLONG: ::c_int = 78;
+pub const ENOLCK: ::c_int = 46;
+pub const ENOSYS: ::c_int = 89;
+pub const ENOTEMPTY: ::c_int = 93;
+pub const ELOOP: ::c_int = 90;
+pub const ENOMSG: ::c_int = 35;
+pub const EIDRM: ::c_int = 36;
+pub const ECHRNG: ::c_int = 37;
+pub const EL2NSYNC: ::c_int = 38;
+pub const EL3HLT: ::c_int = 39;
+pub const EL3RST: ::c_int = 40;
+pub const ELNRNG: ::c_int = 41;
+pub const EUNATCH: ::c_int = 42;
+pub const ENOCSI: ::c_int = 43;
+pub const EL2HLT: ::c_int = 44;
+pub const EBADE: ::c_int = 50;
+pub const EBADR: ::c_int = 51;
+pub const EXFULL: ::c_int = 52;
+pub const ENOANO: ::c_int = 53;
+pub const EBADRQC: ::c_int = 54;
+pub const EBADSLT: ::c_int = 55;
+pub const EDEADLOCK: ::c_int = 56;
+pub const EMULTIHOP: ::c_int = 74;
+pub const EOVERFLOW: ::c_int = 79;
+pub const ENOTUNIQ: ::c_int = 80;
+pub const EBADFD: ::c_int = 81;
+pub const EBADMSG: ::c_int = 77;
+pub const EREMCHG: ::c_int = 82;
+pub const ELIBACC: ::c_int = 83;
+pub const ELIBBAD: ::c_int = 84;
+pub const ELIBSCN: ::c_int = 85;
+pub const ELIBMAX: ::c_int = 86;
+pub const ELIBEXEC: ::c_int = 87;
+pub const EILSEQ: ::c_int = 88;
+pub const ERESTART: ::c_int = 91;
+pub const ESTRPIPE: ::c_int = 92;
+pub const EUSERS: ::c_int = 94;
+pub const ENOTSOCK: ::c_int = 95;
+pub const EDESTADDRREQ: ::c_int = 96;
+pub const EMSGSIZE: ::c_int = 97;
+pub const EPROTOTYPE: ::c_int = 98;
+pub const ENOPROTOOPT: ::c_int = 99;
+pub const EPROTONOSUPPORT: ::c_int = 120;
+pub const ESOCKTNOSUPPORT: ::c_int = 121;
+pub const EOPNOTSUPP: ::c_int = 122;
+pub const EPFNOSUPPORT: ::c_int = 123;
+pub const EAFNOSUPPORT: ::c_int = 124;
+pub const EADDRINUSE: ::c_int = 125;
+pub const EADDRNOTAVAIL: ::c_int = 126;
+pub const ENETDOWN: ::c_int = 127;
+pub const ENETUNREACH: ::c_int = 128;
+pub const ENETRESET: ::c_int = 129;
+pub const ECONNABORTED: ::c_int = 130;
+pub const ECONNRESET: ::c_int = 131;
+pub const ENOBUFS: ::c_int = 132;
+pub const EISCONN: ::c_int = 133;
+pub const ENOTCONN: ::c_int = 134;
+pub const ESHUTDOWN: ::c_int = 143;
+pub const ETOOMANYREFS: ::c_int = 144;
+pub const ETIMEDOUT: ::c_int = 145;
+pub const ECONNREFUSED: ::c_int = 146;
+pub const EHOSTDOWN: ::c_int = 147;
+pub const EHOSTUNREACH: ::c_int = 148;
+pub const EALREADY: ::c_int = 149;
+pub const EINPROGRESS: ::c_int = 150;
+pub const ESTALE: ::c_int = 151;
+pub const EUCLEAN: ::c_int = 135;
+pub const ENOTNAM: ::c_int = 137;
+pub const ENAVAIL: ::c_int = 138;
+pub const EISNAM: ::c_int = 139;
+pub const EREMOTEIO: ::c_int = 140;
+pub const EDQUOT: ::c_int = 1133;
+pub const ENOMEDIUM: ::c_int = 159;
+pub const EMEDIUMTYPE: ::c_int = 160;
+pub const ECANCELED: ::c_int = 158;
+pub const ENOKEY: ::c_int = 161;
+pub const EKEYEXPIRED: ::c_int = 162;
+pub const EKEYREVOKED: ::c_int = 163;
+pub const EKEYREJECTED: ::c_int = 164;
+pub const EOWNERDEAD: ::c_int = 165;
+pub const ENOTRECOVERABLE: ::c_int = 166;
+pub const ERFKILL: ::c_int = 167;
+
+pub const MAP_NORESERVE: ::c_int = 0x400;
+pub const MAP_ANON: ::c_int = 0x800;
+pub const MAP_ANONYMOUS: ::c_int = 0x800;
+pub const MAP_GROWSDOWN: ::c_int = 0x1000;
+pub const MAP_DENYWRITE: ::c_int = 0x2000;
+pub const MAP_EXECUTABLE: ::c_int = 0x4000;
+pub const MAP_LOCKED: ::c_int = 0x8000;
+pub const MAP_POPULATE: ::c_int = 0x10000;
+pub const MAP_NONBLOCK: ::c_int = 0x20000;
+pub const MAP_STACK: ::c_int = 0x40000;
+
+pub const SOCK_STREAM: ::c_int = 2;
+pub const SOCK_DGRAM: ::c_int = 1;
+
+pub const SA_SIGINFO: ::c_int = 0x00000008;
+pub const SA_NOCLDWAIT: ::c_int = 0x00010000;
+
+pub const SIGCHLD: ::c_int = 18;
+pub const SIGBUS: ::c_int = 10;
+pub const SIGTTIN: ::c_int = 26;
+pub const SIGTTOU: ::c_int = 27;
+pub const SIGXCPU: ::c_int = 30;
+pub const SIGXFSZ: ::c_int = 31;
+pub const SIGVTALRM: ::c_int = 28;
+pub const SIGPROF: ::c_int = 29;
+pub const SIGWINCH: ::c_int = 20;
+pub const SIGUSR1: ::c_int = 16;
+pub const SIGUSR2: ::c_int = 17;
+pub const SIGCONT: ::c_int = 25;
+pub const SIGSTOP: ::c_int = 23;
+pub const SIGTSTP: ::c_int = 24;
+pub const SIGURG: ::c_int = 21;
+pub const SIGIO: ::c_int = 22;
+pub const SIGSYS: ::c_int = 12;
+pub const SIGPOLL: ::c_int = 22;
+pub const SIGPWR: ::c_int = 19;
+pub const SIG_SETMASK: ::c_int = 3;
+pub const SIG_BLOCK: ::c_int = 0x1;
+pub const SIG_UNBLOCK: ::c_int = 0x2;
+
+pub const POLLWRNORM: ::c_short = 0x004;
+pub const POLLWRBAND: ::c_short = 0x100;
+
+pub const VEOF: usize = 16;
+pub const VEOL: usize = 17;
+pub const VEOL2: usize = 6;
+pub const VMIN: usize = 4;
+pub const IEXTEN: ::tcflag_t = 0x00000100;
+pub const TOSTOP: ::tcflag_t = 0x00008000;
+pub const FLUSHO: ::tcflag_t = 0x00002000;
+pub const EXTPROC: ::tcflag_t = 0o200000;
+pub const TCSANOW: ::c_int = 0x540e;
+pub const TCSADRAIN: ::c_int = 0x540f;
+pub const TCSAFLUSH: ::c_int = 0x5410;
+
+pub const PTRACE_GETFPXREGS: ::c_uint = 18;
+pub const PTRACE_SETFPXREGS: ::c_uint = 19;
+
+pub const MAP_HUGETLB: ::c_int = 0x080000;
+
+pub const EFD_NONBLOCK: ::c_int = 0x80;
+
+pub const F_GETLK: ::c_int = 14;
+pub const F_GETOWN: ::c_int = 23;
+pub const F_SETOWN: ::c_int = 24;
+
+pub const SFD_NONBLOCK: ::c_int = 0x80;
+
+pub const RTLD_DEEPBIND: ::c_int = 0x10;
+pub const RTLD_GLOBAL: ::c_int = 0x4;
+pub const RTLD_NOLOAD: ::c_int = 0x8;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const EHWPOISON: ::c_int = 168;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,361 @@
+//! 32-bit specific definitions for linux-like values
+
+use pthread_mutex_t;
+
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type clock_t = i32;
+
+pub type shmatt_t = ::c_ulong;
+pub type msgqnum_t = ::c_ulong;
+pub type msglen_t = ::c_ulong;
+pub type nlink_t = u32;
+pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
+pub type __fsword_t = i32;
+pub type fsblkcnt64_t = u64;
+pub type fsfilcnt64_t = u64;
+pub type __syscall_ulong_t = ::c_ulong;
+
+cfg_if! {
+    if #[cfg(target_arch = "riscv32")] {
+        pub type time_t = i64;
+        pub type suseconds_t = i64;
+        pub type ino_t = u64;
+        pub type off_t = i64;
+        pub type blkcnt_t = i64;
+        pub type fsblkcnt_t = u64;
+        pub type fsfilcnt_t = u64;
+        pub type rlim_t = u64;
+        pub type blksize_t = i64;
+    } else {
+        pub type time_t = i32;
+        pub type suseconds_t = i32;
+        pub type ino_t = u32;
+        pub type off_t = i32;
+        pub type blkcnt_t = i32;
+        pub type fsblkcnt_t = ::c_ulong;
+        pub type fsfilcnt_t = ::c_ulong;
+        pub type rlim_t = c_ulong;
+        pub type blksize_t = i32;
+    }
+}
+
+s! {
+    pub struct stat {
+        #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
+        pub st_dev: ::dev_t,
+        #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
+        pub st_dev: ::c_ulong,
+
+        #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
+        __pad1: ::c_short,
+        #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
+        st_pad1: [::c_long; 3],
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
+        pub st_rdev: ::dev_t,
+        #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
+        pub st_rdev: ::c_ulong,
+        #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
+        __pad2: ::c_short,
+        #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
+        st_pad2: [::c_long; 2],
+        pub st_size: ::off_t,
+        #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
+        st_pad3: ::c_long,
+        #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
+        pub st_blksize: ::blksize_t,
+        #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
+        __unused4: ::c_long,
+        #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
+        __unused5: ::c_long,
+        #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
+        pub st_blksize: ::blksize_t,
+        #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
+        pub st_blocks: ::blkcnt_t,
+        #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
+        st_pad5: [::c_long; 14],
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        __f_unused: ::c_int,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct pthread_attr_t {
+        __size: [u32; 9]
+    }
+
+    pub struct sigset_t {
+        __val: [::c_ulong; 32],
+    }
+
+    pub struct sysinfo {
+        pub uptime: ::c_long,
+        pub loads: [::c_ulong; 3],
+        pub totalram: ::c_ulong,
+        pub freeram: ::c_ulong,
+        pub sharedram: ::c_ulong,
+        pub bufferram: ::c_ulong,
+        pub totalswap: ::c_ulong,
+        pub freeswap: ::c_ulong,
+        pub procs: ::c_ushort,
+        #[deprecated(
+            since = "0.2.58",
+            note = "This padding field might become private in the future"
+        )]
+        pub pad: ::c_ushort,
+        pub totalhigh: ::c_ulong,
+        pub freehigh: ::c_ulong,
+        pub mem_unit: ::c_uint,
+        pub _f: [::c_char; 8],
+    }
+
+    pub struct semid_ds {
+        pub sem_perm: ipc_perm,
+        #[cfg(target_arch = "powerpc")]
+        __reserved: ::__syscall_ulong_t,
+        pub sem_otime: ::time_t,
+        #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6", target_arch = "powerpc")))]
+        __reserved: ::__syscall_ulong_t,
+        #[cfg(target_arch = "powerpc")]
+        __reserved2: ::__syscall_ulong_t,
+        pub sem_ctime: ::time_t,
+        #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6", target_arch = "powerpc")))]
+        __reserved2: ::__syscall_ulong_t,
+        pub sem_nsems: ::__syscall_ulong_t,
+        __glibc_reserved3: ::__syscall_ulong_t,
+        __glibc_reserved4: ::__syscall_ulong_t,
+    }
+}
+
+pub const POSIX_FADV_DONTNEED: ::c_int = 4;
+pub const POSIX_FADV_NOREUSE: ::c_int = 5;
+
+pub const F_OFD_GETLK: ::c_int = 36;
+pub const F_OFD_SETLK: ::c_int = 37;
+pub const F_OFD_SETLKW: ::c_int = 38;
+
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
+
+cfg_if! {
+    if #[cfg(target_arch = "sparc")] {
+        pub const O_NOATIME: ::c_int = 0x200000;
+        pub const O_PATH: ::c_int = 0x1000000;
+        pub const O_TMPFILE: ::c_int = 0x2000000 | O_DIRECTORY;
+
+        pub const SA_ONSTACK: ::c_int = 1;
+
+        pub const PTRACE_DETACH: ::c_uint = 11;
+
+        pub const F_SETLK: ::c_int = 8;
+        pub const F_SETLKW: ::c_int = 9;
+
+        pub const F_RDLCK: ::c_int = 1;
+        pub const F_WRLCK: ::c_int = 2;
+        pub const F_UNLCK: ::c_int = 3;
+
+        pub const SFD_CLOEXEC: ::c_int = 0x400000;
+
+        pub const NCCS: usize = 17;
+
+        pub const O_TRUNC: ::c_int = 0x400;
+        pub const O_CLOEXEC: ::c_int = 0x400000;
+
+        pub const EBFONT: ::c_int = 109;
+        pub const ENOSTR: ::c_int = 72;
+        pub const ENODATA: ::c_int = 111;
+        pub const ETIME: ::c_int = 73;
+        pub const ENOSR: ::c_int = 74;
+        pub const ENONET: ::c_int = 80;
+        pub const ENOPKG: ::c_int = 113;
+        pub const EREMOTE: ::c_int = 71;
+        pub const ENOLINK: ::c_int = 82;
+        pub const EADV: ::c_int = 83;
+        pub const ESRMNT: ::c_int = 84;
+        pub const ECOMM: ::c_int = 85;
+        pub const EPROTO: ::c_int = 86;
+        pub const EDOTDOT: ::c_int = 88;
+
+        pub const SA_NODEFER: ::c_int = 0x20;
+        pub const SA_RESETHAND: ::c_int = 0x4;
+        pub const SA_RESTART: ::c_int = 0x2;
+        pub const SA_NOCLDSTOP: ::c_int = 0x00000008;
+
+        pub const EPOLL_CLOEXEC: ::c_int = 0x400000;
+
+        pub const EFD_CLOEXEC: ::c_int = 0x400000;
+    } else {
+        pub const O_NOATIME: ::c_int = 0o1000000;
+        pub const O_PATH: ::c_int = 0o10000000;
+        pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
+
+        pub const SA_ONSTACK: ::c_int = 0x08000000;
+
+        pub const PTRACE_DETACH: ::c_uint = 17;
+
+        pub const F_SETLK: ::c_int = 6;
+        pub const F_SETLKW: ::c_int = 7;
+
+        pub const F_RDLCK: ::c_int = 0;
+        pub const F_WRLCK: ::c_int = 1;
+        pub const F_UNLCK: ::c_int = 2;
+
+        pub const SFD_CLOEXEC: ::c_int = 0x080000;
+
+        pub const NCCS: usize = 32;
+
+        pub const O_TRUNC: ::c_int = 512;
+        pub const O_CLOEXEC: ::c_int = 0x80000;
+        pub const EBFONT: ::c_int = 59;
+        pub const ENOSTR: ::c_int = 60;
+        pub const ENODATA: ::c_int = 61;
+        pub const ETIME: ::c_int = 62;
+        pub const ENOSR: ::c_int = 63;
+        pub const ENONET: ::c_int = 64;
+        pub const ENOPKG: ::c_int = 65;
+        pub const EREMOTE: ::c_int = 66;
+        pub const ENOLINK: ::c_int = 67;
+        pub const EADV: ::c_int = 68;
+        pub const ESRMNT: ::c_int = 69;
+        pub const ECOMM: ::c_int = 70;
+        pub const EPROTO: ::c_int = 71;
+        pub const EDOTDOT: ::c_int = 73;
+
+        pub const SA_NODEFER: ::c_int = 0x40000000;
+        pub const SA_RESETHAND: ::c_int = 0x80000000;
+        pub const SA_RESTART: ::c_int = 0x10000000;
+        pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
+
+        pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
+
+        pub const EFD_CLOEXEC: ::c_int = 0x80000;
+    }
+}
+
+align_const! {
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+                0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
+                0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+                0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
+                0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
+                0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
+                0, 0, 0,
+            ],
+        };
+}
+
+pub const PTRACE_GETFPREGS: ::c_uint = 14;
+pub const PTRACE_SETFPREGS: ::c_uint = 15;
+pub const PTRACE_GETREGS: ::c_uint = 12;
+pub const PTRACE_SETREGS: ::c_uint = 13;
+
+extern "C" {
+    pub fn sysctl(
+        name: *mut ::c_int,
+        namelen: ::c_int,
+        oldp: *mut ::c_void,
+        oldlenp: *mut ::size_t,
+        newp: *mut ::c_void,
+        newlen: ::size_t,
+    ) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "x86")] {
+        mod x86;
+        pub use self::x86::*;
+    } else if #[cfg(target_arch = "arm")] {
+        mod arm;
+        pub use self::arm::*;
+    } else if #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] {
+        mod mips;
+        pub use self::mips::*;
+    } else if #[cfg(target_arch = "m68k")] {
+        mod m68k;
+        pub use self::m68k::*;
+    } else if #[cfg(target_arch = "powerpc")] {
+        mod powerpc;
+        pub use self::powerpc::*;
+    } else if #[cfg(target_arch = "sparc")] {
+        mod sparc;
+        pub use self::sparc::*;
+    } else if #[cfg(target_arch = "riscv32")] {
+        mod riscv32;
+        pub use self::riscv32::*;
+    } else if #[cfg(target_arch = "csky")] {
+        mod csky;
+        pub use self::csky::*;
+    } else {
+        // Unknown target_arch
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/powerpc.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/powerpc.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/powerpc.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/powerpc.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,825 @@
+pub type c_char = u8;
+pub type wchar_t = i32;
+
+s! {
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        f_spare: [::__fsword_t; 5],
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct flock64 {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off64_t,
+        pub l_len: ::off64_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct ipc_perm {
+        __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        __seq: u32,
+        __pad1: u32,
+        __glibc_reserved1: u64,
+        __glibc_reserved2: u64,
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad2: ::c_ushort,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __glibc_reserved4: ::c_ulong,
+        __glibc_reserved5: ::c_ulong,
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__fsword_t; 4],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        __f_unused: ::c_int,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        __glibc_reserved1: ::c_uint,
+        pub shm_atime: ::time_t,
+        __glibc_reserved2: ::c_uint,
+        pub shm_dtime: ::time_t,
+        __glibc_reserved3: ::c_uint,
+        pub shm_ctime: ::time_t,
+        __glibc_reserved4: ::c_uint,
+        pub shm_segsz: ::size_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __glibc_reserved5: ::c_ulong,
+        __glibc_reserved6: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        __glibc_reserved1: ::c_uint,
+        pub msg_stime: ::time_t,
+        __glibc_reserved2: ::c_uint,
+        pub msg_rtime: ::time_t,
+        __glibc_reserved3: ::c_uint,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved4: ::c_ulong,
+        __glibc_reserved5: ::c_ulong,
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        #[doc(hidden)]
+        #[deprecated(
+            since="0.2.54",
+            note="Please leave a comment on \
+                  https://github.com/rust-lang/libc/pull/1316 if you're using \
+                  this field"
+        )]
+        pub _pad: [::c_int; 29],
+        _align: [usize; 0],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t
+    }
+}
+
+pub const VEOF: usize = 4;
+pub const RTLD_DEEPBIND: ::c_int = 0x8;
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+pub const O_DIRECT: ::c_int = 0x20000;
+pub const O_DIRECTORY: ::c_int = 0x4000;
+pub const O_NOFOLLOW: ::c_int = 0x8000;
+pub const O_LARGEFILE: ::c_int = 0o200000;
+pub const O_APPEND: ::c_int = 1024;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_FSYNC: ::c_int = 0x101000;
+pub const O_ASYNC: ::c_int = 0x2000;
+pub const O_NDELAY: ::c_int = 0x800;
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MAP_LOCKED: ::c_int = 0x00080;
+pub const MAP_NORESERVE: ::c_int = 0x00040;
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_ANONYMOUS: ::c_int = 0x0020;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const EDEADLOCK: ::c_int = 58;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EDEADLK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EBADMSG: ::c_int = 74;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const EHWPOISON: ::c_int = 133;
+pub const ERFKILL: ::c_int = 132;
+
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const MCL_CURRENT: ::c_int = 0x2000;
+pub const MCL_FUTURE: ::c_int = 0x4000;
+pub const MCL_ONFAULT: ::c_int = 0x8000;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETOWN: ::c_int = 8;
+
+pub const EFD_NONBLOCK: ::c_int = 0x800;
+pub const SFD_NONBLOCK: ::c_int = 0x0800;
+
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
+pub const SIGUNUSED: ::c_int = 31;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGSTKSZ: ::size_t = 0x4000;
+pub const MINSIGSTKSZ: ::size_t = 4096;
+pub const CBAUD: ::tcflag_t = 0xff;
+pub const TAB1: ::tcflag_t = 0x400;
+pub const TAB2: ::tcflag_t = 0x800;
+pub const TAB3: ::tcflag_t = 0xc00;
+pub const CR1: ::tcflag_t = 0x1000;
+pub const CR2: ::tcflag_t = 0x2000;
+pub const CR3: ::tcflag_t = 0x3000;
+pub const FF1: ::tcflag_t = 0x4000;
+pub const BS1: ::tcflag_t = 0x8000;
+pub const VT1: ::tcflag_t = 0x10000;
+pub const VWERASE: usize = 0xa;
+pub const VREPRINT: usize = 0xb;
+pub const VSUSP: usize = 0xc;
+pub const VSTART: usize = 0xd;
+pub const VSTOP: usize = 0xe;
+pub const VDISCARD: usize = 0x10;
+pub const VTIME: usize = 0x7;
+pub const IXON: ::tcflag_t = 0x200;
+pub const IXOFF: ::tcflag_t = 0x400;
+pub const ONLCR: ::tcflag_t = 0x2;
+pub const CSIZE: ::tcflag_t = 0x300;
+pub const CS6: ::tcflag_t = 0x100;
+pub const CS7: ::tcflag_t = 0x200;
+pub const CS8: ::tcflag_t = 0x300;
+pub const CSTOPB: ::tcflag_t = 0x400;
+pub const CREAD: ::tcflag_t = 0x800;
+pub const PARENB: ::tcflag_t = 0x1000;
+pub const PARODD: ::tcflag_t = 0x2000;
+pub const HUPCL: ::tcflag_t = 0x4000;
+pub const CLOCAL: ::tcflag_t = 0x8000;
+pub const ECHOKE: ::tcflag_t = 0x1;
+pub const ECHOE: ::tcflag_t = 0x2;
+pub const ECHOK: ::tcflag_t = 0x4;
+pub const ECHONL: ::tcflag_t = 0x10;
+pub const ECHOPRT: ::tcflag_t = 0x20;
+pub const ECHOCTL: ::tcflag_t = 0x40;
+pub const ISIG: ::tcflag_t = 0x80;
+pub const ICANON: ::tcflag_t = 0x100;
+pub const PENDIN: ::tcflag_t = 0x20000000;
+pub const NOFLSH: ::tcflag_t = 0x80000000;
+pub const VSWTC: usize = 9;
+pub const OLCUC: ::tcflag_t = 0o000004;
+pub const NLDLY: ::tcflag_t = 0o001400;
+pub const CRDLY: ::tcflag_t = 0o030000;
+pub const TABDLY: ::tcflag_t = 0o006000;
+pub const BSDLY: ::tcflag_t = 0o100000;
+pub const FFDLY: ::tcflag_t = 0o040000;
+pub const VTDLY: ::tcflag_t = 0o200000;
+pub const XTABS: ::tcflag_t = 0o006000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const CBAUDEX: ::speed_t = 0o000020;
+pub const B57600: ::speed_t = 0o0020;
+pub const B115200: ::speed_t = 0o0021;
+pub const B230400: ::speed_t = 0o0022;
+pub const B460800: ::speed_t = 0o0023;
+pub const B500000: ::speed_t = 0o0024;
+pub const B576000: ::speed_t = 0o0025;
+pub const B921600: ::speed_t = 0o0026;
+pub const B1000000: ::speed_t = 0o0027;
+pub const B1152000: ::speed_t = 0o0030;
+pub const B1500000: ::speed_t = 0o0031;
+pub const B2000000: ::speed_t = 0o0032;
+pub const B2500000: ::speed_t = 0o0033;
+pub const B3000000: ::speed_t = 0o0034;
+pub const B3500000: ::speed_t = 0o0035;
+pub const B4000000: ::speed_t = 0o0036;
+
+pub const VEOL: usize = 6;
+pub const VEOL2: usize = 8;
+pub const VMIN: usize = 5;
+pub const IEXTEN: ::tcflag_t = 0x400;
+pub const TOSTOP: ::tcflag_t = 0x400000;
+pub const FLUSHO: ::tcflag_t = 0x800000;
+pub const EXTPROC: ::tcflag_t = 0x10000000;
+
+pub const SYS_restart_syscall: ::c_long = 0;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_waitpid: ::c_long = 7;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execve: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_time: ::c_long = 13;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lchown: ::c_long = 16;
+pub const SYS_break: ::c_long = 17;
+pub const SYS_oldstat: ::c_long = 18;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_mount: ::c_long = 21;
+pub const SYS_umount: ::c_long = 22;
+pub const SYS_setuid: ::c_long = 23;
+pub const SYS_getuid: ::c_long = 24;
+pub const SYS_stime: ::c_long = 25;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_alarm: ::c_long = 27;
+pub const SYS_oldfstat: ::c_long = 28;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_utime: ::c_long = 30;
+pub const SYS_stty: ::c_long = 31;
+pub const SYS_gtty: ::c_long = 32;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_ftime: ::c_long = 35;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_prof: ::c_long = 44;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_setgid: ::c_long = 46;
+pub const SYS_getgid: ::c_long = 47;
+pub const SYS_signal: ::c_long = 48;
+pub const SYS_geteuid: ::c_long = 49;
+pub const SYS_getegid: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount2: ::c_long = 52;
+pub const SYS_lock: ::c_long = 53;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_mpx: ::c_long = 56;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_ulimit: ::c_long = 58;
+pub const SYS_oldolduname: ::c_long = 59;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_sgetmask: ::c_long = 68;
+pub const SYS_ssetmask: ::c_long = 69;
+pub const SYS_setreuid: ::c_long = 70;
+pub const SYS_setregid: ::c_long = 71;
+pub const SYS_sigsuspend: ::c_long = 72;
+pub const SYS_sigpending: ::c_long = 73;
+pub const SYS_sethostname: ::c_long = 74;
+pub const SYS_setrlimit: ::c_long = 75;
+pub const SYS_getrlimit: ::c_long = 76;
+pub const SYS_getrusage: ::c_long = 77;
+pub const SYS_gettimeofday: ::c_long = 78;
+pub const SYS_settimeofday: ::c_long = 79;
+pub const SYS_getgroups: ::c_long = 80;
+pub const SYS_setgroups: ::c_long = 81;
+pub const SYS_select: ::c_long = 82;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_oldlstat: ::c_long = 84;
+pub const SYS_readlink: ::c_long = 85;
+pub const SYS_uselib: ::c_long = 86;
+pub const SYS_swapon: ::c_long = 87;
+pub const SYS_reboot: ::c_long = 88;
+pub const SYS_readdir: ::c_long = 89;
+pub const SYS_mmap: ::c_long = 90;
+pub const SYS_munmap: ::c_long = 91;
+pub const SYS_truncate: ::c_long = 92;
+pub const SYS_ftruncate: ::c_long = 93;
+pub const SYS_fchmod: ::c_long = 94;
+pub const SYS_fchown: ::c_long = 95;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_profil: ::c_long = 98;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_ioperm: ::c_long = 101;
+pub const SYS_socketcall: ::c_long = 102;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_setitimer: ::c_long = 104;
+pub const SYS_getitimer: ::c_long = 105;
+pub const SYS_stat: ::c_long = 106;
+pub const SYS_lstat: ::c_long = 107;
+pub const SYS_fstat: ::c_long = 108;
+pub const SYS_olduname: ::c_long = 109;
+pub const SYS_iopl: ::c_long = 110;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_idle: ::c_long = 112;
+pub const SYS_vm86: ::c_long = 113;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_ipc: ::c_long = 117;
+pub const SYS_fsync: ::c_long = 118;
+pub const SYS_sigreturn: ::c_long = 119;
+pub const SYS_clone: ::c_long = 120;
+pub const SYS_setdomainname: ::c_long = 121;
+pub const SYS_uname: ::c_long = 122;
+pub const SYS_modify_ldt: ::c_long = 123;
+pub const SYS_adjtimex: ::c_long = 124;
+pub const SYS_mprotect: ::c_long = 125;
+pub const SYS_sigprocmask: ::c_long = 126;
+pub const SYS_create_module: ::c_long = 127;
+pub const SYS_init_module: ::c_long = 128;
+pub const SYS_delete_module: ::c_long = 129;
+pub const SYS_get_kernel_syms: ::c_long = 130;
+pub const SYS_quotactl: ::c_long = 131;
+pub const SYS_getpgid: ::c_long = 132;
+pub const SYS_fchdir: ::c_long = 133;
+pub const SYS_bdflush: ::c_long = 134;
+pub const SYS_sysfs: ::c_long = 135;
+pub const SYS_personality: ::c_long = 136;
+pub const SYS_afs_syscall: ::c_long = 137; /* Syscall for Andrew File System */
+pub const SYS_setfsuid: ::c_long = 138;
+pub const SYS_setfsgid: ::c_long = 139;
+pub const SYS__llseek: ::c_long = 140;
+pub const SYS_getdents: ::c_long = 141;
+pub const SYS__newselect: ::c_long = 142;
+pub const SYS_flock: ::c_long = 143;
+pub const SYS_msync: ::c_long = 144;
+pub const SYS_readv: ::c_long = 145;
+pub const SYS_writev: ::c_long = 146;
+pub const SYS_getsid: ::c_long = 147;
+pub const SYS_fdatasync: ::c_long = 148;
+pub const SYS__sysctl: ::c_long = 149;
+pub const SYS_mlock: ::c_long = 150;
+pub const SYS_munlock: ::c_long = 151;
+pub const SYS_mlockall: ::c_long = 152;
+pub const SYS_munlockall: ::c_long = 153;
+pub const SYS_sched_setparam: ::c_long = 154;
+pub const SYS_sched_getparam: ::c_long = 155;
+pub const SYS_sched_setscheduler: ::c_long = 156;
+pub const SYS_sched_getscheduler: ::c_long = 157;
+pub const SYS_sched_yield: ::c_long = 158;
+pub const SYS_sched_get_priority_max: ::c_long = 159;
+pub const SYS_sched_get_priority_min: ::c_long = 160;
+pub const SYS_sched_rr_get_interval: ::c_long = 161;
+pub const SYS_nanosleep: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_setresuid: ::c_long = 164;
+pub const SYS_getresuid: ::c_long = 165;
+pub const SYS_query_module: ::c_long = 166;
+pub const SYS_poll: ::c_long = 167;
+pub const SYS_nfsservctl: ::c_long = 168;
+pub const SYS_setresgid: ::c_long = 169;
+pub const SYS_getresgid: ::c_long = 170;
+pub const SYS_prctl: ::c_long = 171;
+pub const SYS_rt_sigreturn: ::c_long = 172;
+pub const SYS_rt_sigaction: ::c_long = 173;
+pub const SYS_rt_sigprocmask: ::c_long = 174;
+pub const SYS_rt_sigpending: ::c_long = 175;
+pub const SYS_rt_sigtimedwait: ::c_long = 176;
+pub const SYS_rt_sigqueueinfo: ::c_long = 177;
+pub const SYS_rt_sigsuspend: ::c_long = 178;
+pub const SYS_pread64: ::c_long = 179;
+pub const SYS_pwrite64: ::c_long = 180;
+pub const SYS_chown: ::c_long = 181;
+pub const SYS_getcwd: ::c_long = 182;
+pub const SYS_capget: ::c_long = 183;
+pub const SYS_capset: ::c_long = 184;
+pub const SYS_sigaltstack: ::c_long = 185;
+pub const SYS_sendfile: ::c_long = 186;
+pub const SYS_getpmsg: ::c_long = 187; /* some people actually want streams */
+pub const SYS_putpmsg: ::c_long = 188; /* some people actually want streams */
+pub const SYS_vfork: ::c_long = 189;
+pub const SYS_ugetrlimit: ::c_long = 190; /* SuS compliant getrlimit */
+pub const SYS_readahead: ::c_long = 191;
+pub const SYS_mmap2: ::c_long = 192;
+pub const SYS_truncate64: ::c_long = 193;
+pub const SYS_ftruncate64: ::c_long = 194;
+pub const SYS_stat64: ::c_long = 195;
+pub const SYS_lstat64: ::c_long = 196;
+pub const SYS_fstat64: ::c_long = 197;
+pub const SYS_pciconfig_read: ::c_long = 198;
+pub const SYS_pciconfig_write: ::c_long = 199;
+pub const SYS_pciconfig_iobase: ::c_long = 200;
+pub const SYS_multiplexer: ::c_long = 201;
+pub const SYS_getdents64: ::c_long = 202;
+pub const SYS_pivot_root: ::c_long = 203;
+pub const SYS_fcntl64: ::c_long = 204;
+pub const SYS_madvise: ::c_long = 205;
+pub const SYS_mincore: ::c_long = 206;
+pub const SYS_gettid: ::c_long = 207;
+pub const SYS_tkill: ::c_long = 208;
+pub const SYS_setxattr: ::c_long = 209;
+pub const SYS_lsetxattr: ::c_long = 210;
+pub const SYS_fsetxattr: ::c_long = 211;
+pub const SYS_getxattr: ::c_long = 212;
+pub const SYS_lgetxattr: ::c_long = 213;
+pub const SYS_fgetxattr: ::c_long = 214;
+pub const SYS_listxattr: ::c_long = 215;
+pub const SYS_llistxattr: ::c_long = 216;
+pub const SYS_flistxattr: ::c_long = 217;
+pub const SYS_removexattr: ::c_long = 218;
+pub const SYS_lremovexattr: ::c_long = 219;
+pub const SYS_fremovexattr: ::c_long = 220;
+pub const SYS_futex: ::c_long = 221;
+pub const SYS_sched_setaffinity: ::c_long = 222;
+pub const SYS_sched_getaffinity: ::c_long = 223;
+pub const SYS_tuxcall: ::c_long = 225;
+pub const SYS_sendfile64: ::c_long = 226;
+pub const SYS_io_setup: ::c_long = 227;
+pub const SYS_io_destroy: ::c_long = 228;
+pub const SYS_io_getevents: ::c_long = 229;
+pub const SYS_io_submit: ::c_long = 230;
+pub const SYS_io_cancel: ::c_long = 231;
+pub const SYS_set_tid_address: ::c_long = 232;
+pub const SYS_fadvise64: ::c_long = 233;
+pub const SYS_exit_group: ::c_long = 234;
+pub const SYS_lookup_dcookie: ::c_long = 235;
+pub const SYS_epoll_create: ::c_long = 236;
+pub const SYS_epoll_ctl: ::c_long = 237;
+pub const SYS_epoll_wait: ::c_long = 238;
+pub const SYS_remap_file_pages: ::c_long = 239;
+pub const SYS_timer_create: ::c_long = 240;
+pub const SYS_timer_settime: ::c_long = 241;
+pub const SYS_timer_gettime: ::c_long = 242;
+pub const SYS_timer_getoverrun: ::c_long = 243;
+pub const SYS_timer_delete: ::c_long = 244;
+pub const SYS_clock_settime: ::c_long = 245;
+pub const SYS_clock_gettime: ::c_long = 246;
+pub const SYS_clock_getres: ::c_long = 247;
+pub const SYS_clock_nanosleep: ::c_long = 248;
+pub const SYS_swapcontext: ::c_long = 249;
+pub const SYS_tgkill: ::c_long = 250;
+pub const SYS_utimes: ::c_long = 251;
+pub const SYS_statfs64: ::c_long = 252;
+pub const SYS_fstatfs64: ::c_long = 253;
+pub const SYS_fadvise64_64: ::c_long = 254;
+pub const SYS_rtas: ::c_long = 255;
+pub const SYS_sys_debug_setcontext: ::c_long = 256;
+pub const SYS_migrate_pages: ::c_long = 258;
+pub const SYS_mbind: ::c_long = 259;
+pub const SYS_get_mempolicy: ::c_long = 260;
+pub const SYS_set_mempolicy: ::c_long = 261;
+pub const SYS_mq_open: ::c_long = 262;
+pub const SYS_mq_unlink: ::c_long = 263;
+pub const SYS_mq_timedsend: ::c_long = 264;
+pub const SYS_mq_timedreceive: ::c_long = 265;
+pub const SYS_mq_notify: ::c_long = 266;
+pub const SYS_mq_getsetattr: ::c_long = 267;
+pub const SYS_kexec_load: ::c_long = 268;
+pub const SYS_add_key: ::c_long = 269;
+pub const SYS_request_key: ::c_long = 270;
+pub const SYS_keyctl: ::c_long = 271;
+pub const SYS_waitid: ::c_long = 272;
+pub const SYS_ioprio_set: ::c_long = 273;
+pub const SYS_ioprio_get: ::c_long = 274;
+pub const SYS_inotify_init: ::c_long = 275;
+pub const SYS_inotify_add_watch: ::c_long = 276;
+pub const SYS_inotify_rm_watch: ::c_long = 277;
+pub const SYS_spu_run: ::c_long = 278;
+pub const SYS_spu_create: ::c_long = 279;
+pub const SYS_pselect6: ::c_long = 280;
+pub const SYS_ppoll: ::c_long = 281;
+pub const SYS_unshare: ::c_long = 282;
+pub const SYS_splice: ::c_long = 283;
+pub const SYS_tee: ::c_long = 284;
+pub const SYS_vmsplice: ::c_long = 285;
+pub const SYS_openat: ::c_long = 286;
+pub const SYS_mkdirat: ::c_long = 287;
+pub const SYS_mknodat: ::c_long = 288;
+pub const SYS_fchownat: ::c_long = 289;
+pub const SYS_futimesat: ::c_long = 290;
+pub const SYS_fstatat64: ::c_long = 291;
+pub const SYS_unlinkat: ::c_long = 292;
+pub const SYS_renameat: ::c_long = 293;
+pub const SYS_linkat: ::c_long = 294;
+pub const SYS_symlinkat: ::c_long = 295;
+pub const SYS_readlinkat: ::c_long = 296;
+pub const SYS_fchmodat: ::c_long = 297;
+pub const SYS_faccessat: ::c_long = 298;
+pub const SYS_get_robust_list: ::c_long = 299;
+pub const SYS_set_robust_list: ::c_long = 300;
+pub const SYS_move_pages: ::c_long = 301;
+pub const SYS_getcpu: ::c_long = 302;
+pub const SYS_epoll_pwait: ::c_long = 303;
+pub const SYS_utimensat: ::c_long = 304;
+pub const SYS_signalfd: ::c_long = 305;
+pub const SYS_timerfd_create: ::c_long = 306;
+pub const SYS_eventfd: ::c_long = 307;
+pub const SYS_sync_file_range2: ::c_long = 308;
+pub const SYS_fallocate: ::c_long = 309;
+pub const SYS_subpage_prot: ::c_long = 310;
+pub const SYS_timerfd_settime: ::c_long = 311;
+pub const SYS_timerfd_gettime: ::c_long = 312;
+pub const SYS_signalfd4: ::c_long = 313;
+pub const SYS_eventfd2: ::c_long = 314;
+pub const SYS_epoll_create1: ::c_long = 315;
+pub const SYS_dup3: ::c_long = 316;
+pub const SYS_pipe2: ::c_long = 317;
+pub const SYS_inotify_init1: ::c_long = 318;
+pub const SYS_perf_event_open: ::c_long = 319;
+pub const SYS_preadv: ::c_long = 320;
+pub const SYS_pwritev: ::c_long = 321;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 322;
+pub const SYS_fanotify_init: ::c_long = 323;
+pub const SYS_fanotify_mark: ::c_long = 324;
+pub const SYS_prlimit64: ::c_long = 325;
+pub const SYS_socket: ::c_long = 326;
+pub const SYS_bind: ::c_long = 327;
+pub const SYS_connect: ::c_long = 328;
+pub const SYS_listen: ::c_long = 329;
+pub const SYS_accept: ::c_long = 330;
+pub const SYS_getsockname: ::c_long = 331;
+pub const SYS_getpeername: ::c_long = 332;
+pub const SYS_socketpair: ::c_long = 333;
+pub const SYS_send: ::c_long = 334;
+pub const SYS_sendto: ::c_long = 335;
+pub const SYS_recv: ::c_long = 336;
+pub const SYS_recvfrom: ::c_long = 337;
+pub const SYS_shutdown: ::c_long = 338;
+pub const SYS_setsockopt: ::c_long = 339;
+pub const SYS_getsockopt: ::c_long = 340;
+pub const SYS_sendmsg: ::c_long = 341;
+pub const SYS_recvmsg: ::c_long = 342;
+pub const SYS_recvmmsg: ::c_long = 343;
+pub const SYS_accept4: ::c_long = 344;
+pub const SYS_name_to_handle_at: ::c_long = 345;
+pub const SYS_open_by_handle_at: ::c_long = 346;
+pub const SYS_clock_adjtime: ::c_long = 347;
+pub const SYS_syncfs: ::c_long = 348;
+pub const SYS_sendmmsg: ::c_long = 349;
+pub const SYS_setns: ::c_long = 350;
+pub const SYS_process_vm_readv: ::c_long = 351;
+pub const SYS_process_vm_writev: ::c_long = 352;
+pub const SYS_finit_module: ::c_long = 353;
+pub const SYS_kcmp: ::c_long = 354;
+pub const SYS_sched_setattr: ::c_long = 355;
+pub const SYS_sched_getattr: ::c_long = 356;
+pub const SYS_renameat2: ::c_long = 357;
+pub const SYS_seccomp: ::c_long = 358;
+pub const SYS_getrandom: ::c_long = 359;
+pub const SYS_memfd_create: ::c_long = 360;
+pub const SYS_bpf: ::c_long = 361;
+pub const SYS_execveat: ::c_long = 362;
+pub const SYS_switch_endian: ::c_long = 363;
+pub const SYS_userfaultfd: ::c_long = 364;
+pub const SYS_membarrier: ::c_long = 365;
+pub const SYS_mlock2: ::c_long = 378;
+pub const SYS_copy_file_range: ::c_long = 379;
+pub const SYS_preadv2: ::c_long = 380;
+pub const SYS_pwritev2: ::c_long = 381;
+pub const SYS_kexec_file_load: ::c_long = 382;
+pub const SYS_statx: ::c_long = 383;
+pub const SYS_rseq: ::c_long = 387;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,44 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    pub struct ucontext_t {
+        pub __uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_mcontext: mcontext_t,
+    }
+
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct mcontext_t {
+        pub __gregs: [::c_ulong; 32],
+        pub __fpregs: __riscv_mc_fp_state,
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub union __riscv_mc_fp_state {
+        pub __f: __riscv_mc_f_ext_state,
+        pub __d: __riscv_mc_d_ext_state,
+        pub __q: __riscv_mc_q_ext_state,
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub struct __riscv_mc_f_ext_state {
+        pub __f: [::c_uint; 32],
+        pub __fcsr: ::c_uint,
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub struct __riscv_mc_d_ext_state {
+        pub __f: [::c_ulonglong; 32],
+        pub __fcsr: ::c_uint,
+    }
+
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct __riscv_mc_q_ext_state {
+        pub __f: [::c_ulonglong; 64],
+        pub __fcsr: ::c_uint,
+        pub __glibc_reserved: [::c_uint; 3],
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,813 @@
+//! RISC-V-specific definitions for 32-bit linux-like values
+
+pub type c_char = u8;
+pub type wchar_t = ::c_int;
+
+s! {
+    pub struct pthread_attr_t {
+        __size: [::c_ulong; 7],
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved4: ::c_ulong,
+        __glibc_reserved5: ::c_ulong,
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub __pad1: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub __pad2: ::c_int,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_int; 2usize],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub __pad1: ::dev_t,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub __pad2: ::c_int,
+        pub st_blocks: ::blkcnt64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_int; 2],
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_long,
+        pub f_frsize: ::c_long,
+        pub f_flags: ::c_long,
+        pub f_spare: [::c_long; 4],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        pub f_blocks: ::fsblkcnt64_t,
+        pub f_bfree: ::fsblkcnt64_t,
+        pub f_bavail: ::fsblkcnt64_t,
+        pub f_files: ::fsfilcnt64_t,
+        pub f_ffree: ::fsfilcnt64_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_long,
+        pub f_frsize: ::c_long,
+        pub f_flags: ::c_long,
+        pub f_spare: [::c_long; 4],
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        pub __f_spare: [::c_int; 6],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt64_t,
+        pub f_bfree: ::fsblkcnt64_t,
+        pub f_bavail: ::fsblkcnt64_t,
+        pub f_files: ::fsfilcnt64_t,
+        pub f_ffree: ::fsfilcnt64_t,
+        pub f_favail: ::fsfilcnt64_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        pub __f_spare: [::c_int; 6],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        #[doc(hidden)]
+        #[deprecated(
+            since="0.2.54",
+            note="Please leave a comment on \
+                  https://github.com/rust-lang/libc/pull/1316 if you're using \
+                  this field"
+        )]
+        pub _pad: [::c_int; 29],
+        _align: [u64; 0],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t,
+    }
+
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<unsafe extern "C" fn()>,
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::c_ushort,
+        __pad1: ::c_ushort,
+        pub __seq: ::c_ushort,
+        __pad2: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong,
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused5: ::c_ulong,
+        __unused6: ::c_ulong,
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct flock64 {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off64_t,
+        pub l_len: ::off64_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct user_regs_struct {
+        pub pc: ::c_ulong,
+        pub ra: ::c_ulong,
+        pub sp: ::c_ulong,
+        pub gp: ::c_ulong,
+        pub tp: ::c_ulong,
+        pub t0: ::c_ulong,
+        pub t1: ::c_ulong,
+        pub t2: ::c_ulong,
+        pub s0: ::c_ulong,
+        pub s1: ::c_ulong,
+        pub a0: ::c_ulong,
+        pub a1: ::c_ulong,
+        pub a2: ::c_ulong,
+        pub a3: ::c_ulong,
+        pub a4: ::c_ulong,
+        pub a5: ::c_ulong,
+        pub a6: ::c_ulong,
+        pub a7: ::c_ulong,
+        pub s2: ::c_ulong,
+        pub s3: ::c_ulong,
+        pub s4: ::c_ulong,
+        pub s5: ::c_ulong,
+        pub s6: ::c_ulong,
+        pub s7: ::c_ulong,
+        pub s8: ::c_ulong,
+        pub s9: ::c_ulong,
+        pub s10: ::c_ulong,
+        pub s11: ::c_ulong,
+        pub t3: ::c_ulong,
+        pub t4: ::c_ulong,
+        pub t5: ::c_ulong,
+        pub t6: ::c_ulong,
+    }
+}
+
+pub const O_LARGEFILE: ::c_int = 0;
+pub const VEOF: usize = 4;
+pub const RTLD_DEEPBIND: ::c_int = 0x8;
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+pub const O_APPEND: ::c_int = 1024;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_FSYNC: ::c_int = 1052672;
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MAP_GROWSDOWN: ::c_int = 256;
+pub const EDEADLK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EBADMSG: ::c_int = 74;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const EHWPOISON: ::c_int = 133;
+pub const ERFKILL: ::c_int = 132;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+pub const SA_SIGINFO: ::c_int = 4;
+pub const SA_NOCLDWAIT: ::c_int = 2;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0;
+pub const SIG_UNBLOCK: ::c_int = 1;
+pub const POLLWRNORM: ::c_short = 256;
+pub const POLLWRBAND: ::c_short = 512;
+pub const O_ASYNC: ::c_int = 8192;
+pub const O_NDELAY: ::c_int = 2048;
+pub const EFD_NONBLOCK: ::c_int = 2048;
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETOWN: ::c_int = 8;
+pub const SFD_NONBLOCK: ::c_int = 2048;
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
+pub const O_DIRECT: ::c_int = 16384;
+pub const O_DIRECTORY: ::c_int = 65536;
+pub const O_NOFOLLOW: ::c_int = 131072;
+pub const MAP_HUGETLB: ::c_int = 262144;
+pub const MAP_LOCKED: ::c_int = 8192;
+pub const MAP_NORESERVE: ::c_int = 16384;
+pub const MAP_ANON: ::c_int = 32;
+pub const MAP_ANONYMOUS: ::c_int = 32;
+pub const MAP_DENYWRITE: ::c_int = 2048;
+pub const MAP_EXECUTABLE: ::c_int = 4096;
+pub const MAP_POPULATE: ::c_int = 32768;
+pub const MAP_NONBLOCK: ::c_int = 65536;
+pub const MAP_STACK: ::c_int = 131072;
+pub const MAP_SYNC: ::c_int = 0x080000;
+pub const EDEADLOCK: ::c_int = 35;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const MCL_CURRENT: ::c_int = 1;
+pub const MCL_FUTURE: ::c_int = 2;
+pub const MCL_ONFAULT: ::c_int = 4;
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+pub const CBAUD: ::tcflag_t = 4111;
+pub const TAB1: ::tcflag_t = 2048;
+pub const TAB2: ::tcflag_t = 4096;
+pub const TAB3: ::tcflag_t = 6144;
+pub const CR1: ::tcflag_t = 512;
+pub const CR2: ::tcflag_t = 1024;
+pub const CR3: ::tcflag_t = 1536;
+pub const FF1: ::tcflag_t = 32768;
+pub const BS1: ::tcflag_t = 8192;
+pub const VT1: ::tcflag_t = 16384;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 1024;
+pub const IXOFF: ::tcflag_t = 4096;
+pub const ONLCR: ::tcflag_t = 4;
+pub const CSIZE: ::tcflag_t = 48;
+pub const CS6: ::tcflag_t = 16;
+pub const CS7: ::tcflag_t = 32;
+pub const CS8: ::tcflag_t = 48;
+pub const CSTOPB: ::tcflag_t = 64;
+pub const CREAD: ::tcflag_t = 128;
+pub const PARENB: ::tcflag_t = 256;
+pub const PARODD: ::tcflag_t = 512;
+pub const HUPCL: ::tcflag_t = 1024;
+pub const CLOCAL: ::tcflag_t = 2048;
+pub const ECHOKE: ::tcflag_t = 2048;
+pub const ECHOE: ::tcflag_t = 16;
+pub const ECHOK: ::tcflag_t = 32;
+pub const ECHONL: ::tcflag_t = 64;
+pub const ECHOPRT: ::tcflag_t = 1024;
+pub const ECHOCTL: ::tcflag_t = 512;
+pub const ISIG: ::tcflag_t = 1;
+pub const ICANON: ::tcflag_t = 2;
+pub const PENDIN: ::tcflag_t = 16384;
+pub const NOFLSH: ::tcflag_t = 128;
+pub const CIBAUD: ::tcflag_t = 269418496;
+pub const CBAUDEX: ::tcflag_t = 4096;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 2;
+pub const NLDLY: ::tcflag_t = 256;
+pub const CRDLY: ::tcflag_t = 1536;
+pub const TABDLY: ::tcflag_t = 6144;
+pub const BSDLY: ::tcflag_t = 8192;
+pub const FFDLY: ::tcflag_t = 32768;
+pub const VTDLY: ::tcflag_t = 16384;
+pub const XTABS: ::tcflag_t = 6144;
+pub const B0: ::speed_t = 0;
+pub const B50: ::speed_t = 1;
+pub const B75: ::speed_t = 2;
+pub const B110: ::speed_t = 3;
+pub const B134: ::speed_t = 4;
+pub const B150: ::speed_t = 5;
+pub const B200: ::speed_t = 6;
+pub const B300: ::speed_t = 7;
+pub const B600: ::speed_t = 8;
+pub const B1200: ::speed_t = 9;
+pub const B1800: ::speed_t = 10;
+pub const B2400: ::speed_t = 11;
+pub const B4800: ::speed_t = 12;
+pub const B9600: ::speed_t = 13;
+pub const B19200: ::speed_t = 14;
+pub const B38400: ::speed_t = 15;
+pub const EXTA: ::speed_t = 14;
+pub const EXTB: ::speed_t = 15;
+pub const B57600: ::speed_t = 4097;
+pub const B115200: ::speed_t = 4098;
+pub const B230400: ::speed_t = 4099;
+pub const B460800: ::speed_t = 4100;
+pub const B500000: ::speed_t = 4101;
+pub const B576000: ::speed_t = 4102;
+pub const B921600: ::speed_t = 4103;
+pub const B1000000: ::speed_t = 4104;
+pub const B1152000: ::speed_t = 4105;
+pub const B1500000: ::speed_t = 4106;
+pub const B2000000: ::speed_t = 4107;
+pub const B2500000: ::speed_t = 4108;
+pub const B3000000: ::speed_t = 4109;
+pub const B3500000: ::speed_t = 4110;
+pub const B4000000: ::speed_t = 4111;
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 32768;
+pub const TOSTOP: ::tcflag_t = 256;
+pub const FLUSHO: ::tcflag_t = 4096;
+pub const EXTPROC: ::tcflag_t = 65536;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
+pub const NGREG: usize = 32;
+pub const REG_PC: usize = 0;
+pub const REG_RA: usize = 1;
+pub const REG_SP: usize = 2;
+pub const REG_TP: usize = 4;
+pub const REG_S0: usize = 8;
+pub const REG_S1: usize = 9;
+pub const REG_A0: usize = 10;
+pub const REG_S2: usize = 18;
+pub const REG_NARGS: usize = 8;
+
+pub const SYS_read: ::c_long = 63;
+pub const SYS_write: ::c_long = 64;
+pub const SYS_close: ::c_long = 57;
+pub const SYS_fstat: ::c_long = 80;
+pub const SYS_lseek: ::c_long = 62;
+pub const SYS_mmap: ::c_long = 222;
+pub const SYS_mprotect: ::c_long = 226;
+pub const SYS_munmap: ::c_long = 215;
+pub const SYS_brk: ::c_long = 214;
+pub const SYS_rt_sigaction: ::c_long = 134;
+pub const SYS_rt_sigprocmask: ::c_long = 135;
+pub const SYS_rt_sigreturn: ::c_long = 139;
+pub const SYS_ioctl: ::c_long = 29;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_readv: ::c_long = 65;
+pub const SYS_writev: ::c_long = 66;
+pub const SYS_sched_yield: ::c_long = 124;
+pub const SYS_mremap: ::c_long = 216;
+pub const SYS_msync: ::c_long = 227;
+pub const SYS_mincore: ::c_long = 232;
+pub const SYS_madvise: ::c_long = 233;
+pub const SYS_shmget: ::c_long = 194;
+pub const SYS_shmat: ::c_long = 196;
+pub const SYS_shmctl: ::c_long = 195;
+pub const SYS_dup: ::c_long = 23;
+pub const SYS_nanosleep: ::c_long = 101;
+pub const SYS_getitimer: ::c_long = 102;
+pub const SYS_setitimer: ::c_long = 103;
+pub const SYS_getpid: ::c_long = 172;
+pub const SYS_sendfile: ::c_long = 71;
+pub const SYS_socket: ::c_long = 198;
+pub const SYS_connect: ::c_long = 203;
+pub const SYS_accept: ::c_long = 202;
+pub const SYS_sendto: ::c_long = 206;
+pub const SYS_recvfrom: ::c_long = 207;
+pub const SYS_sendmsg: ::c_long = 211;
+pub const SYS_recvmsg: ::c_long = 212;
+pub const SYS_shutdown: ::c_long = 210;
+pub const SYS_bind: ::c_long = 200;
+pub const SYS_listen: ::c_long = 201;
+pub const SYS_getsockname: ::c_long = 204;
+pub const SYS_getpeername: ::c_long = 205;
+pub const SYS_socketpair: ::c_long = 199;
+pub const SYS_setsockopt: ::c_long = 208;
+pub const SYS_getsockopt: ::c_long = 209;
+pub const SYS_clone: ::c_long = 220;
+pub const SYS_execve: ::c_long = 221;
+pub const SYS_exit: ::c_long = 93;
+pub const SYS_wait4: ::c_long = 260;
+pub const SYS_kill: ::c_long = 129;
+pub const SYS_uname: ::c_long = 160;
+pub const SYS_semget: ::c_long = 190;
+pub const SYS_semop: ::c_long = 193;
+pub const SYS_semctl: ::c_long = 191;
+pub const SYS_shmdt: ::c_long = 197;
+pub const SYS_msgget: ::c_long = 186;
+pub const SYS_msgsnd: ::c_long = 189;
+pub const SYS_msgrcv: ::c_long = 188;
+pub const SYS_msgctl: ::c_long = 187;
+pub const SYS_fcntl: ::c_long = 25;
+pub const SYS_flock: ::c_long = 32;
+pub const SYS_fsync: ::c_long = 82;
+pub const SYS_fdatasync: ::c_long = 83;
+pub const SYS_truncate: ::c_long = 45;
+pub const SYS_ftruncate: ::c_long = 46;
+pub const SYS_getcwd: ::c_long = 17;
+pub const SYS_chdir: ::c_long = 49;
+pub const SYS_fchdir: ::c_long = 50;
+pub const SYS_fchmod: ::c_long = 52;
+pub const SYS_fchown: ::c_long = 55;
+pub const SYS_umask: ::c_long = 166;
+pub const SYS_gettimeofday: ::c_long = 169;
+pub const SYS_getrlimit: ::c_long = 163;
+pub const SYS_getrusage: ::c_long = 165;
+pub const SYS_sysinfo: ::c_long = 179;
+pub const SYS_times: ::c_long = 153;
+pub const SYS_ptrace: ::c_long = 117;
+pub const SYS_getuid: ::c_long = 174;
+pub const SYS_syslog: ::c_long = 116;
+pub const SYS_getgid: ::c_long = 176;
+pub const SYS_setuid: ::c_long = 146;
+pub const SYS_setgid: ::c_long = 144;
+pub const SYS_geteuid: ::c_long = 175;
+pub const SYS_getegid: ::c_long = 177;
+pub const SYS_setpgid: ::c_long = 154;
+pub const SYS_getppid: ::c_long = 173;
+pub const SYS_setsid: ::c_long = 157;
+pub const SYS_setreuid: ::c_long = 145;
+pub const SYS_setregid: ::c_long = 143;
+pub const SYS_getgroups: ::c_long = 158;
+pub const SYS_setgroups: ::c_long = 159;
+pub const SYS_setresuid: ::c_long = 147;
+pub const SYS_getresuid: ::c_long = 148;
+pub const SYS_setresgid: ::c_long = 149;
+pub const SYS_getresgid: ::c_long = 150;
+pub const SYS_getpgid: ::c_long = 155;
+pub const SYS_setfsuid: ::c_long = 151;
+pub const SYS_setfsgid: ::c_long = 152;
+pub const SYS_getsid: ::c_long = 156;
+pub const SYS_capget: ::c_long = 90;
+pub const SYS_capset: ::c_long = 91;
+pub const SYS_rt_sigpending: ::c_long = 136;
+pub const SYS_rt_sigtimedwait: ::c_long = 137;
+pub const SYS_rt_sigqueueinfo: ::c_long = 138;
+pub const SYS_rt_sigsuspend: ::c_long = 133;
+pub const SYS_sigaltstack: ::c_long = 132;
+pub const SYS_personality: ::c_long = 92;
+pub const SYS_statfs: ::c_long = 43;
+pub const SYS_fstatfs: ::c_long = 44;
+pub const SYS_getpriority: ::c_long = 141;
+pub const SYS_setpriority: ::c_long = 140;
+pub const SYS_sched_setparam: ::c_long = 118;
+pub const SYS_sched_getparam: ::c_long = 121;
+pub const SYS_sched_setscheduler: ::c_long = 119;
+pub const SYS_sched_getscheduler: ::c_long = 120;
+pub const SYS_sched_get_priority_max: ::c_long = 125;
+pub const SYS_sched_get_priority_min: ::c_long = 126;
+pub const SYS_sched_rr_get_interval: ::c_long = 127;
+pub const SYS_mlock: ::c_long = 228;
+pub const SYS_munlock: ::c_long = 229;
+pub const SYS_mlockall: ::c_long = 230;
+pub const SYS_munlockall: ::c_long = 231;
+pub const SYS_vhangup: ::c_long = 58;
+pub const SYS_pivot_root: ::c_long = 41;
+pub const SYS_prctl: ::c_long = 167;
+pub const SYS_adjtimex: ::c_long = 171;
+pub const SYS_setrlimit: ::c_long = 164;
+pub const SYS_chroot: ::c_long = 51;
+pub const SYS_sync: ::c_long = 81;
+pub const SYS_acct: ::c_long = 89;
+pub const SYS_settimeofday: ::c_long = 170;
+pub const SYS_mount: ::c_long = 40;
+pub const SYS_umount2: ::c_long = 39;
+pub const SYS_swapon: ::c_long = 224;
+pub const SYS_swapoff: ::c_long = 225;
+pub const SYS_reboot: ::c_long = 142;
+pub const SYS_sethostname: ::c_long = 161;
+pub const SYS_setdomainname: ::c_long = 162;
+pub const SYS_init_module: ::c_long = 105;
+pub const SYS_delete_module: ::c_long = 106;
+pub const SYS_quotactl: ::c_long = 60;
+pub const SYS_nfsservctl: ::c_long = 42;
+pub const SYS_gettid: ::c_long = 178;
+pub const SYS_readahead: ::c_long = 213;
+pub const SYS_setxattr: ::c_long = 5;
+pub const SYS_lsetxattr: ::c_long = 6;
+pub const SYS_fsetxattr: ::c_long = 7;
+pub const SYS_getxattr: ::c_long = 8;
+pub const SYS_lgetxattr: ::c_long = 9;
+pub const SYS_fgetxattr: ::c_long = 10;
+pub const SYS_listxattr: ::c_long = 11;
+pub const SYS_llistxattr: ::c_long = 12;
+pub const SYS_flistxattr: ::c_long = 13;
+pub const SYS_removexattr: ::c_long = 14;
+pub const SYS_lremovexattr: ::c_long = 15;
+pub const SYS_fremovexattr: ::c_long = 16;
+pub const SYS_tkill: ::c_long = 130;
+pub const SYS_futex: ::c_long = 98;
+pub const SYS_sched_setaffinity: ::c_long = 122;
+pub const SYS_sched_getaffinity: ::c_long = 123;
+pub const SYS_io_setup: ::c_long = 0;
+pub const SYS_io_destroy: ::c_long = 1;
+pub const SYS_io_getevents: ::c_long = 4;
+pub const SYS_io_submit: ::c_long = 2;
+pub const SYS_io_cancel: ::c_long = 3;
+pub const SYS_lookup_dcookie: ::c_long = 18;
+pub const SYS_remap_file_pages: ::c_long = 234;
+pub const SYS_getdents64: ::c_long = 61;
+pub const SYS_set_tid_address: ::c_long = 96;
+pub const SYS_restart_syscall: ::c_long = 128;
+pub const SYS_semtimedop: ::c_long = 192;
+pub const SYS_fadvise64: ::c_long = 223;
+pub const SYS_timer_create: ::c_long = 107;
+pub const SYS_timer_settime: ::c_long = 110;
+pub const SYS_timer_gettime: ::c_long = 108;
+pub const SYS_timer_getoverrun: ::c_long = 109;
+pub const SYS_timer_delete: ::c_long = 111;
+pub const SYS_clock_settime: ::c_long = 112;
+pub const SYS_clock_gettime: ::c_long = 113;
+pub const SYS_clock_getres: ::c_long = 114;
+pub const SYS_clock_nanosleep: ::c_long = 115;
+pub const SYS_exit_group: ::c_long = 94;
+pub const SYS_epoll_ctl: ::c_long = 21;
+pub const SYS_tgkill: ::c_long = 131;
+pub const SYS_mbind: ::c_long = 235;
+pub const SYS_set_mempolicy: ::c_long = 237;
+pub const SYS_get_mempolicy: ::c_long = 236;
+pub const SYS_mq_open: ::c_long = 180;
+pub const SYS_mq_unlink: ::c_long = 181;
+pub const SYS_mq_timedsend: ::c_long = 182;
+pub const SYS_mq_timedreceive: ::c_long = 183;
+pub const SYS_mq_notify: ::c_long = 184;
+pub const SYS_mq_getsetattr: ::c_long = 185;
+pub const SYS_kexec_load: ::c_long = 104;
+pub const SYS_waitid: ::c_long = 95;
+pub const SYS_add_key: ::c_long = 217;
+pub const SYS_request_key: ::c_long = 218;
+pub const SYS_keyctl: ::c_long = 219;
+pub const SYS_ioprio_set: ::c_long = 30;
+pub const SYS_ioprio_get: ::c_long = 31;
+pub const SYS_inotify_add_watch: ::c_long = 27;
+pub const SYS_inotify_rm_watch: ::c_long = 28;
+pub const SYS_migrate_pages: ::c_long = 238;
+pub const SYS_openat: ::c_long = 56;
+pub const SYS_mkdirat: ::c_long = 34;
+pub const SYS_mknodat: ::c_long = 33;
+pub const SYS_fchownat: ::c_long = 54;
+pub const SYS_newfstatat: ::c_long = 79;
+pub const SYS_unlinkat: ::c_long = 35;
+pub const SYS_linkat: ::c_long = 37;
+pub const SYS_symlinkat: ::c_long = 36;
+pub const SYS_readlinkat: ::c_long = 78;
+pub const SYS_fchmodat: ::c_long = 53;
+pub const SYS_faccessat: ::c_long = 48;
+pub const SYS_pselect6: ::c_long = 72;
+pub const SYS_ppoll: ::c_long = 73;
+pub const SYS_unshare: ::c_long = 97;
+pub const SYS_set_robust_list: ::c_long = 99;
+pub const SYS_get_robust_list: ::c_long = 100;
+pub const SYS_splice: ::c_long = 76;
+pub const SYS_tee: ::c_long = 77;
+pub const SYS_sync_file_range: ::c_long = 84;
+pub const SYS_vmsplice: ::c_long = 75;
+pub const SYS_move_pages: ::c_long = 239;
+pub const SYS_utimensat: ::c_long = 88;
+pub const SYS_epoll_pwait: ::c_long = 22;
+pub const SYS_timerfd_create: ::c_long = 85;
+pub const SYS_fallocate: ::c_long = 47;
+pub const SYS_timerfd_settime: ::c_long = 86;
+pub const SYS_timerfd_gettime: ::c_long = 87;
+pub const SYS_accept4: ::c_long = 242;
+pub const SYS_signalfd4: ::c_long = 74;
+pub const SYS_eventfd2: ::c_long = 19;
+pub const SYS_epoll_create1: ::c_long = 20;
+pub const SYS_dup3: ::c_long = 24;
+pub const SYS_pipe2: ::c_long = 59;
+pub const SYS_inotify_init1: ::c_long = 26;
+pub const SYS_preadv: ::c_long = 69;
+pub const SYS_pwritev: ::c_long = 70;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
+pub const SYS_perf_event_open: ::c_long = 241;
+pub const SYS_recvmmsg: ::c_long = 243;
+pub const SYS_fanotify_init: ::c_long = 262;
+pub const SYS_fanotify_mark: ::c_long = 263;
+pub const SYS_prlimit64: ::c_long = 261;
+pub const SYS_name_to_handle_at: ::c_long = 264;
+pub const SYS_open_by_handle_at: ::c_long = 265;
+pub const SYS_clock_adjtime: ::c_long = 266;
+pub const SYS_syncfs: ::c_long = 267;
+pub const SYS_sendmmsg: ::c_long = 269;
+pub const SYS_setns: ::c_long = 268;
+pub const SYS_getcpu: ::c_long = 168;
+pub const SYS_process_vm_readv: ::c_long = 270;
+pub const SYS_process_vm_writev: ::c_long = 271;
+pub const SYS_kcmp: ::c_long = 272;
+pub const SYS_finit_module: ::c_long = 273;
+pub const SYS_sched_setattr: ::c_long = 274;
+pub const SYS_sched_getattr: ::c_long = 275;
+pub const SYS_renameat2: ::c_long = 276;
+pub const SYS_seccomp: ::c_long = 277;
+pub const SYS_getrandom: ::c_long = 278;
+pub const SYS_memfd_create: ::c_long = 279;
+pub const SYS_bpf: ::c_long = 280;
+pub const SYS_execveat: ::c_long = 281;
+pub const SYS_userfaultfd: ::c_long = 282;
+pub const SYS_membarrier: ::c_long = 283;
+pub const SYS_mlock2: ::c_long = 284;
+pub const SYS_copy_file_range: ::c_long = 285;
+pub const SYS_preadv2: ::c_long = 286;
+pub const SYS_pwritev2: ::c_long = 287;
+pub const SYS_pkey_mprotect: ::c_long = 288;
+pub const SYS_pkey_alloc: ::c_long = 289;
+pub const SYS_pkey_free: ::c_long = 290;
+pub const SYS_statx: ::c_long = 291;
+pub const SYS_rseq: ::c_long = 293;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(8))]
+    pub struct max_align_t {
+        priv_: [i64; 3]
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,857 @@
+//! SPARC-specific definitions for 32-bit linux-like values
+
+pub type c_char = i8;
+pub type wchar_t = i32;
+
+s! {
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        f_spare: [::__fsword_t; 5],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        _pad: [::c_int; 29],
+        _align: [usize; 0],
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct flock64 {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off64_t,
+        pub l_len: ::off64_t,
+        pub l_pid: ::pid_t,
+        __reserved:  ::c_short,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad2: ::c_ushort,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_long; 2],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad2: ::c_ushort,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __reserved: [::c_long; 2],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__fsword_t; 4],
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        __pad1: ::c_ushort,
+        pub mode: ::c_ushort,
+        __pad2: ::c_ushort,
+        pub __seq: ::c_ushort,
+        __unused1: ::c_ulonglong,
+        __unused2: ::c_ulonglong,
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        __pad1: ::c_uint,
+        pub shm_atime: ::time_t,
+        __pad2: ::c_uint,
+        pub shm_dtime: ::time_t,
+        __pad3: ::c_uint,
+        pub shm_ctime: ::time_t,
+        pub shm_segsz: ::size_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __reserved1: ::c_ulong,
+        __reserved2: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        __pad1: ::c_uint,
+        pub msg_stime: ::time_t,
+        __pad2: ::c_uint,
+        pub msg_rtime: ::time_t,
+        __pad3: ::c_uint,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ushort,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved1: ::c_ulong,
+        __glibc_reserved2: ::c_ulong,
+    }
+}
+
+pub const VEOF: usize = 4;
+pub const RTLD_DEEPBIND: ::c_int = 0x8;
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+
+pub const O_APPEND: ::c_int = 0x8;
+pub const O_CREAT: ::c_int = 0x200;
+pub const O_EXCL: ::c_int = 0x800;
+pub const O_NOCTTY: ::c_int = 0x8000;
+pub const O_NONBLOCK: ::c_int = 0x4000;
+pub const O_SYNC: ::c_int = 0x802000;
+pub const O_RSYNC: ::c_int = 0x802000;
+pub const O_DSYNC: ::c_int = 0x2000;
+pub const O_FSYNC: ::c_int = 0x802000;
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MAP_GROWSDOWN: ::c_int = 0x0200;
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_ANONYMOUS: ::c_int = 0x0020;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const EDEADLK: ::c_int = 78;
+pub const ENAMETOOLONG: ::c_int = 63;
+pub const ENOLCK: ::c_int = 79;
+pub const ENOSYS: ::c_int = 90;
+pub const ENOTEMPTY: ::c_int = 66;
+pub const ELOOP: ::c_int = 62;
+pub const ENOMSG: ::c_int = 75;
+pub const EIDRM: ::c_int = 77;
+pub const ECHRNG: ::c_int = 94;
+pub const EL2NSYNC: ::c_int = 95;
+pub const EL3HLT: ::c_int = 96;
+pub const EL3RST: ::c_int = 97;
+pub const ELNRNG: ::c_int = 98;
+pub const EUNATCH: ::c_int = 99;
+pub const ENOCSI: ::c_int = 100;
+pub const EL2HLT: ::c_int = 101;
+pub const EBADE: ::c_int = 102;
+pub const EBADR: ::c_int = 103;
+pub const EXFULL: ::c_int = 104;
+pub const ENOANO: ::c_int = 105;
+pub const EBADRQC: ::c_int = 106;
+pub const EBADSLT: ::c_int = 107;
+pub const EMULTIHOP: ::c_int = 87;
+pub const EOVERFLOW: ::c_int = 92;
+pub const ENOTUNIQ: ::c_int = 115;
+pub const EBADFD: ::c_int = 93;
+pub const EBADMSG: ::c_int = 76;
+pub const EREMCHG: ::c_int = 89;
+pub const ELIBACC: ::c_int = 114;
+pub const ELIBBAD: ::c_int = 112;
+pub const ELIBSCN: ::c_int = 124;
+pub const ELIBMAX: ::c_int = 123;
+pub const ELIBEXEC: ::c_int = 110;
+pub const EILSEQ: ::c_int = 122;
+pub const ERESTART: ::c_int = 116;
+pub const ESTRPIPE: ::c_int = 91;
+pub const EUSERS: ::c_int = 68;
+pub const ENOTSOCK: ::c_int = 38;
+pub const EDESTADDRREQ: ::c_int = 39;
+pub const EMSGSIZE: ::c_int = 40;
+pub const EPROTOTYPE: ::c_int = 41;
+pub const ENOPROTOOPT: ::c_int = 42;
+pub const EPROTONOSUPPORT: ::c_int = 43;
+pub const ESOCKTNOSUPPORT: ::c_int = 44;
+pub const EOPNOTSUPP: ::c_int = 45;
+pub const EPFNOSUPPORT: ::c_int = 46;
+pub const EAFNOSUPPORT: ::c_int = 47;
+pub const EADDRINUSE: ::c_int = 48;
+pub const EADDRNOTAVAIL: ::c_int = 49;
+pub const ENETDOWN: ::c_int = 50;
+pub const ENETUNREACH: ::c_int = 51;
+pub const ENETRESET: ::c_int = 52;
+pub const ECONNABORTED: ::c_int = 53;
+pub const ECONNRESET: ::c_int = 54;
+pub const ENOBUFS: ::c_int = 55;
+pub const EISCONN: ::c_int = 56;
+pub const ENOTCONN: ::c_int = 57;
+pub const ESHUTDOWN: ::c_int = 58;
+pub const ETOOMANYREFS: ::c_int = 59;
+pub const ETIMEDOUT: ::c_int = 60;
+pub const ECONNREFUSED: ::c_int = 61;
+pub const EHOSTDOWN: ::c_int = 64;
+pub const EHOSTUNREACH: ::c_int = 65;
+pub const EALREADY: ::c_int = 37;
+pub const EINPROGRESS: ::c_int = 36;
+pub const ESTALE: ::c_int = 70;
+pub const EDQUOT: ::c_int = 69;
+pub const ENOMEDIUM: ::c_int = 125;
+pub const EMEDIUMTYPE: ::c_int = 126;
+pub const ECANCELED: ::c_int = 127;
+pub const ENOKEY: ::c_int = 128;
+pub const EKEYEXPIRED: ::c_int = 129;
+pub const EKEYREVOKED: ::c_int = 130;
+pub const EKEYREJECTED: ::c_int = 131;
+pub const EOWNERDEAD: ::c_int = 132;
+pub const ENOTRECOVERABLE: ::c_int = 133;
+pub const EHWPOISON: ::c_int = 135;
+pub const ERFKILL: ::c_int = 134;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const SA_SIGINFO: ::c_int = 0x200;
+pub const SA_NOCLDWAIT: ::c_int = 0x100;
+
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGCHLD: ::c_int = 20;
+pub const SIGBUS: ::c_int = 10;
+pub const SIGUSR1: ::c_int = 30;
+pub const SIGUSR2: ::c_int = 31;
+pub const SIGCONT: ::c_int = 19;
+pub const SIGSTOP: ::c_int = 17;
+pub const SIGTSTP: ::c_int = 18;
+pub const SIGURG: ::c_int = 16;
+pub const SIGIO: ::c_int = 23;
+pub const SIGSYS: ::c_int = 12;
+pub const SIGPOLL: ::c_int = 23;
+pub const SIGPWR: ::c_int = 29;
+pub const SIG_SETMASK: ::c_int = 4;
+pub const SIG_BLOCK: ::c_int = 1;
+pub const SIG_UNBLOCK: ::c_int = 2;
+
+pub const POLLWRNORM: ::c_short = 4;
+pub const POLLWRBAND: ::c_short = 0x100;
+
+pub const O_ASYNC: ::c_int = 0x40;
+pub const O_NDELAY: ::c_int = 0x4004;
+
+pub const EFD_NONBLOCK: ::c_int = 0x4000;
+
+pub const F_GETLK: ::c_int = 7;
+pub const F_GETOWN: ::c_int = 5;
+pub const F_SETOWN: ::c_int = 6;
+
+pub const SFD_NONBLOCK: ::c_int = 0x4000;
+
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+
+pub const O_DIRECTORY: ::c_int = 0o200000;
+pub const O_NOFOLLOW: ::c_int = 0o400000;
+pub const O_LARGEFILE: ::c_int = 0x40000;
+pub const O_DIRECT: ::c_int = 0x100000;
+
+pub const MAP_LOCKED: ::c_int = 0x0100;
+pub const MAP_NORESERVE: ::c_int = 0x00040;
+
+pub const EDEADLOCK: ::c_int = 108;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+
+pub const MCL_CURRENT: ::c_int = 0x2000;
+pub const MCL_FUTURE: ::c_int = 0x4000;
+pub const MCL_ONFAULT: ::c_int = 0x8000;
+
+pub const SIGSTKSZ: ::size_t = 16384;
+pub const MINSIGSTKSZ: ::size_t = 4096;
+pub const CBAUD: ::tcflag_t = 0x0000100f;
+pub const TAB1: ::tcflag_t = 0x800;
+pub const TAB2: ::tcflag_t = 0x1000;
+pub const TAB3: ::tcflag_t = 0x1800;
+pub const CR1: ::tcflag_t = 0x200;
+pub const CR2: ::tcflag_t = 0x400;
+pub const CR3: ::tcflag_t = 0x600;
+pub const FF1: ::tcflag_t = 0x8000;
+pub const BS1: ::tcflag_t = 0x2000;
+pub const VT1: ::tcflag_t = 0x4000;
+pub const VWERASE: usize = 0xe;
+pub const VREPRINT: usize = 0xc;
+pub const VSUSP: usize = 0xa;
+pub const VSTART: usize = 0x8;
+pub const VSTOP: usize = 0x9;
+pub const VDISCARD: usize = 0xd;
+pub const VTIME: usize = 0x5;
+pub const IXON: ::tcflag_t = 0x400;
+pub const IXOFF: ::tcflag_t = 0x1000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x30;
+pub const CS6: ::tcflag_t = 0x10;
+pub const CS7: ::tcflag_t = 0x20;
+pub const CS8: ::tcflag_t = 0x30;
+pub const CSTOPB: ::tcflag_t = 0x40;
+pub const CREAD: ::tcflag_t = 0x80;
+pub const PARENB: ::tcflag_t = 0x100;
+pub const PARODD: ::tcflag_t = 0x200;
+pub const HUPCL: ::tcflag_t = 0x400;
+pub const CLOCAL: ::tcflag_t = 0x800;
+pub const ECHOKE: ::tcflag_t = 0x800;
+pub const ECHOE: ::tcflag_t = 0x10;
+pub const ECHOK: ::tcflag_t = 0x20;
+pub const ECHONL: ::tcflag_t = 0x40;
+pub const ECHOPRT: ::tcflag_t = 0x400;
+pub const ECHOCTL: ::tcflag_t = 0x200;
+pub const ISIG: ::tcflag_t = 0x1;
+pub const ICANON: ::tcflag_t = 0x2;
+pub const PENDIN: ::tcflag_t = 0x4000;
+pub const NOFLSH: ::tcflag_t = 0x80;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0x00001000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0x1001;
+pub const B115200: ::speed_t = 0x1002;
+pub const B230400: ::speed_t = 0x1003;
+pub const B460800: ::speed_t = 0x1004;
+pub const B76800: ::speed_t = 0x1005;
+pub const B153600: ::speed_t = 0x1006;
+pub const B307200: ::speed_t = 0x1007;
+pub const B614400: ::speed_t = 0x1008;
+pub const B921600: ::speed_t = 0x1009;
+pub const B500000: ::speed_t = 0x100a;
+pub const B576000: ::speed_t = 0x100b;
+pub const B1000000: ::speed_t = 0x100c;
+pub const B1152000: ::speed_t = 0x100d;
+pub const B1500000: ::speed_t = 0x100e;
+pub const B2000000: ::speed_t = 0x100f;
+
+pub const VEOL: usize = 5;
+pub const VEOL2: usize = 6;
+pub const VMIN: usize = 4;
+pub const IEXTEN: ::tcflag_t = 0x8000;
+pub const TOSTOP: ::tcflag_t = 0x100;
+pub const FLUSHO: ::tcflag_t = 0x1000;
+pub const EXTPROC: ::tcflag_t = 0x10000;
+
+pub const SYS_restart_syscall: ::c_long = 0;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_wait4: ::c_long = 7;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execv: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_chown: ::c_long = 13;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lchown: ::c_long = 16;
+pub const SYS_brk: ::c_long = 17;
+pub const SYS_perfctr: ::c_long = 18;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_capget: ::c_long = 21;
+pub const SYS_capset: ::c_long = 22;
+pub const SYS_setuid: ::c_long = 23;
+pub const SYS_getuid: ::c_long = 24;
+pub const SYS_vmsplice: ::c_long = 25;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_alarm: ::c_long = 27;
+pub const SYS_sigaltstack: ::c_long = 28;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_utime: ::c_long = 30;
+pub const SYS_lchown32: ::c_long = 31;
+pub const SYS_fchown32: ::c_long = 32;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_chown32: ::c_long = 35;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_stat: ::c_long = 38;
+pub const SYS_sendfile: ::c_long = 39;
+pub const SYS_lstat: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_getuid32: ::c_long = 44;
+pub const SYS_umount2: ::c_long = 45;
+pub const SYS_setgid: ::c_long = 46;
+pub const SYS_getgid: ::c_long = 47;
+pub const SYS_signal: ::c_long = 48;
+pub const SYS_geteuid: ::c_long = 49;
+pub const SYS_getegid: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_getgid32: ::c_long = 53;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_reboot: ::c_long = 55;
+pub const SYS_mmap2: ::c_long = 56;
+pub const SYS_symlink: ::c_long = 57;
+pub const SYS_readlink: ::c_long = 58;
+pub const SYS_execve: ::c_long = 59;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_fstat: ::c_long = 62;
+pub const SYS_fstat64: ::c_long = 63;
+pub const SYS_getpagesize: ::c_long = 64;
+pub const SYS_msync: ::c_long = 65;
+pub const SYS_vfork: ::c_long = 66;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_geteuid32: ::c_long = 69;
+pub const SYS_getegid32: ::c_long = 70;
+pub const SYS_mmap: ::c_long = 71;
+pub const SYS_setreuid32: ::c_long = 72;
+pub const SYS_munmap: ::c_long = 73;
+pub const SYS_mprotect: ::c_long = 74;
+pub const SYS_madvise: ::c_long = 75;
+pub const SYS_vhangup: ::c_long = 76;
+pub const SYS_truncate64: ::c_long = 77;
+pub const SYS_mincore: ::c_long = 78;
+pub const SYS_getgroups: ::c_long = 79;
+pub const SYS_setgroups: ::c_long = 80;
+pub const SYS_getpgrp: ::c_long = 81;
+pub const SYS_setgroups32: ::c_long = 82;
+pub const SYS_setitimer: ::c_long = 83;
+pub const SYS_ftruncate64: ::c_long = 84;
+pub const SYS_swapon: ::c_long = 85;
+pub const SYS_getitimer: ::c_long = 86;
+pub const SYS_setuid32: ::c_long = 87;
+pub const SYS_sethostname: ::c_long = 88;
+pub const SYS_setgid32: ::c_long = 89;
+pub const SYS_dup2: ::c_long = 90;
+pub const SYS_setfsuid32: ::c_long = 91;
+pub const SYS_fcntl: ::c_long = 92;
+pub const SYS_select: ::c_long = 93;
+pub const SYS_setfsgid32: ::c_long = 94;
+pub const SYS_fsync: ::c_long = 95;
+pub const SYS_setpriority: ::c_long = 96;
+pub const SYS_socket: ::c_long = 97;
+pub const SYS_connect: ::c_long = 98;
+pub const SYS_accept: ::c_long = 99;
+pub const SYS_getpriority: ::c_long = 100;
+pub const SYS_rt_sigreturn: ::c_long = 101;
+pub const SYS_rt_sigaction: ::c_long = 102;
+pub const SYS_rt_sigprocmask: ::c_long = 103;
+pub const SYS_rt_sigpending: ::c_long = 104;
+pub const SYS_rt_sigtimedwait: ::c_long = 105;
+pub const SYS_rt_sigqueueinfo: ::c_long = 106;
+pub const SYS_rt_sigsuspend: ::c_long = 107;
+pub const SYS_setresuid32: ::c_long = 108;
+pub const SYS_getresuid32: ::c_long = 109;
+pub const SYS_setresgid32: ::c_long = 110;
+pub const SYS_getresgid32: ::c_long = 111;
+pub const SYS_setregid32: ::c_long = 112;
+pub const SYS_recvmsg: ::c_long = 113;
+pub const SYS_sendmsg: ::c_long = 114;
+pub const SYS_getgroups32: ::c_long = 115;
+pub const SYS_gettimeofday: ::c_long = 116;
+pub const SYS_getrusage: ::c_long = 117;
+pub const SYS_getsockopt: ::c_long = 118;
+pub const SYS_getcwd: ::c_long = 119;
+pub const SYS_readv: ::c_long = 120;
+pub const SYS_writev: ::c_long = 121;
+pub const SYS_settimeofday: ::c_long = 122;
+pub const SYS_fchown: ::c_long = 123;
+pub const SYS_fchmod: ::c_long = 124;
+pub const SYS_recvfrom: ::c_long = 125;
+pub const SYS_setreuid: ::c_long = 126;
+pub const SYS_setregid: ::c_long = 127;
+pub const SYS_rename: ::c_long = 128;
+pub const SYS_truncate: ::c_long = 129;
+pub const SYS_ftruncate: ::c_long = 130;
+pub const SYS_flock: ::c_long = 131;
+pub const SYS_lstat64: ::c_long = 132;
+pub const SYS_sendto: ::c_long = 133;
+pub const SYS_shutdown: ::c_long = 134;
+pub const SYS_socketpair: ::c_long = 135;
+pub const SYS_mkdir: ::c_long = 136;
+pub const SYS_rmdir: ::c_long = 137;
+pub const SYS_utimes: ::c_long = 138;
+pub const SYS_stat64: ::c_long = 139;
+pub const SYS_sendfile64: ::c_long = 140;
+pub const SYS_getpeername: ::c_long = 141;
+pub const SYS_futex: ::c_long = 142;
+pub const SYS_gettid: ::c_long = 143;
+pub const SYS_getrlimit: ::c_long = 144;
+pub const SYS_setrlimit: ::c_long = 145;
+pub const SYS_pivot_root: ::c_long = 146;
+pub const SYS_prctl: ::c_long = 147;
+pub const SYS_pciconfig_read: ::c_long = 148;
+pub const SYS_pciconfig_write: ::c_long = 149;
+pub const SYS_getsockname: ::c_long = 150;
+pub const SYS_inotify_init: ::c_long = 151;
+pub const SYS_inotify_add_watch: ::c_long = 152;
+pub const SYS_poll: ::c_long = 153;
+pub const SYS_getdents64: ::c_long = 154;
+pub const SYS_fcntl64: ::c_long = 155;
+pub const SYS_inotify_rm_watch: ::c_long = 156;
+pub const SYS_statfs: ::c_long = 157;
+pub const SYS_fstatfs: ::c_long = 158;
+pub const SYS_umount: ::c_long = 159;
+pub const SYS_sched_set_affinity: ::c_long = 160;
+pub const SYS_sched_get_affinity: ::c_long = 161;
+pub const SYS_getdomainname: ::c_long = 162;
+pub const SYS_setdomainname: ::c_long = 163;
+pub const SYS_quotactl: ::c_long = 165;
+pub const SYS_set_tid_address: ::c_long = 166;
+pub const SYS_mount: ::c_long = 167;
+pub const SYS_ustat: ::c_long = 168;
+pub const SYS_setxattr: ::c_long = 169;
+pub const SYS_lsetxattr: ::c_long = 170;
+pub const SYS_fsetxattr: ::c_long = 171;
+pub const SYS_getxattr: ::c_long = 172;
+pub const SYS_lgetxattr: ::c_long = 173;
+pub const SYS_getdents: ::c_long = 174;
+pub const SYS_setsid: ::c_long = 175;
+pub const SYS_fchdir: ::c_long = 176;
+pub const SYS_fgetxattr: ::c_long = 177;
+pub const SYS_listxattr: ::c_long = 178;
+pub const SYS_llistxattr: ::c_long = 179;
+pub const SYS_flistxattr: ::c_long = 180;
+pub const SYS_removexattr: ::c_long = 181;
+pub const SYS_lremovexattr: ::c_long = 182;
+pub const SYS_sigpending: ::c_long = 183;
+pub const SYS_query_module: ::c_long = 184;
+pub const SYS_setpgid: ::c_long = 185;
+pub const SYS_fremovexattr: ::c_long = 186;
+pub const SYS_tkill: ::c_long = 187;
+pub const SYS_exit_group: ::c_long = 188;
+pub const SYS_uname: ::c_long = 189;
+pub const SYS_init_module: ::c_long = 190;
+pub const SYS_personality: ::c_long = 191;
+pub const SYS_remap_file_pages: ::c_long = 192;
+pub const SYS_epoll_create: ::c_long = 193;
+pub const SYS_epoll_ctl: ::c_long = 194;
+pub const SYS_epoll_wait: ::c_long = 195;
+pub const SYS_ioprio_set: ::c_long = 196;
+pub const SYS_getppid: ::c_long = 197;
+pub const SYS_sigaction: ::c_long = 198;
+pub const SYS_sgetmask: ::c_long = 199;
+pub const SYS_ssetmask: ::c_long = 200;
+pub const SYS_sigsuspend: ::c_long = 201;
+pub const SYS_oldlstat: ::c_long = 202;
+pub const SYS_uselib: ::c_long = 203;
+pub const SYS_readdir: ::c_long = 204;
+pub const SYS_readahead: ::c_long = 205;
+pub const SYS_socketcall: ::c_long = 206;
+pub const SYS_syslog: ::c_long = 207;
+pub const SYS_lookup_dcookie: ::c_long = 208;
+pub const SYS_fadvise64: ::c_long = 209;
+pub const SYS_fadvise64_64: ::c_long = 210;
+pub const SYS_tgkill: ::c_long = 211;
+pub const SYS_waitpid: ::c_long = 212;
+pub const SYS_swapoff: ::c_long = 213;
+pub const SYS_sysinfo: ::c_long = 214;
+pub const SYS_ipc: ::c_long = 215;
+pub const SYS_sigreturn: ::c_long = 216;
+pub const SYS_clone: ::c_long = 217;
+pub const SYS_ioprio_get: ::c_long = 218;
+pub const SYS_adjtimex: ::c_long = 219;
+pub const SYS_sigprocmask: ::c_long = 220;
+pub const SYS_create_module: ::c_long = 221;
+pub const SYS_delete_module: ::c_long = 222;
+pub const SYS_get_kernel_syms: ::c_long = 223;
+pub const SYS_getpgid: ::c_long = 224;
+pub const SYS_bdflush: ::c_long = 225;
+pub const SYS_sysfs: ::c_long = 226;
+pub const SYS_afs_syscall: ::c_long = 227;
+pub const SYS_setfsuid: ::c_long = 228;
+pub const SYS_setfsgid: ::c_long = 229;
+pub const SYS__newselect: ::c_long = 230;
+pub const SYS_time: ::c_long = 231;
+pub const SYS_splice: ::c_long = 232;
+pub const SYS_stime: ::c_long = 233;
+pub const SYS_statfs64: ::c_long = 234;
+pub const SYS_fstatfs64: ::c_long = 235;
+pub const SYS__llseek: ::c_long = 236;
+pub const SYS_mlock: ::c_long = 237;
+pub const SYS_munlock: ::c_long = 238;
+pub const SYS_mlockall: ::c_long = 239;
+pub const SYS_munlockall: ::c_long = 240;
+pub const SYS_sched_setparam: ::c_long = 241;
+pub const SYS_sched_getparam: ::c_long = 242;
+pub const SYS_sched_setscheduler: ::c_long = 243;
+pub const SYS_sched_getscheduler: ::c_long = 244;
+pub const SYS_sched_yield: ::c_long = 245;
+pub const SYS_sched_get_priority_max: ::c_long = 246;
+pub const SYS_sched_get_priority_min: ::c_long = 247;
+pub const SYS_sched_rr_get_interval: ::c_long = 248;
+pub const SYS_nanosleep: ::c_long = 249;
+pub const SYS_mremap: ::c_long = 250;
+pub const SYS__sysctl: ::c_long = 251;
+pub const SYS_getsid: ::c_long = 252;
+pub const SYS_fdatasync: ::c_long = 253;
+pub const SYS_nfsservctl: ::c_long = 254;
+pub const SYS_sync_file_range: ::c_long = 255;
+pub const SYS_clock_settime: ::c_long = 256;
+pub const SYS_clock_gettime: ::c_long = 257;
+pub const SYS_clock_getres: ::c_long = 258;
+pub const SYS_clock_nanosleep: ::c_long = 259;
+pub const SYS_sched_getaffinity: ::c_long = 260;
+pub const SYS_sched_setaffinity: ::c_long = 261;
+pub const SYS_timer_settime: ::c_long = 262;
+pub const SYS_timer_gettime: ::c_long = 263;
+pub const SYS_timer_getoverrun: ::c_long = 264;
+pub const SYS_timer_delete: ::c_long = 265;
+pub const SYS_timer_create: ::c_long = 266;
+pub const SYS_io_setup: ::c_long = 268;
+pub const SYS_io_destroy: ::c_long = 269;
+pub const SYS_io_submit: ::c_long = 270;
+pub const SYS_io_cancel: ::c_long = 271;
+pub const SYS_io_getevents: ::c_long = 272;
+pub const SYS_mq_open: ::c_long = 273;
+pub const SYS_mq_unlink: ::c_long = 274;
+pub const SYS_mq_timedsend: ::c_long = 275;
+pub const SYS_mq_timedreceive: ::c_long = 276;
+pub const SYS_mq_notify: ::c_long = 277;
+pub const SYS_mq_getsetattr: ::c_long = 278;
+pub const SYS_waitid: ::c_long = 279;
+pub const SYS_tee: ::c_long = 280;
+pub const SYS_add_key: ::c_long = 281;
+pub const SYS_request_key: ::c_long = 282;
+pub const SYS_keyctl: ::c_long = 283;
+pub const SYS_openat: ::c_long = 284;
+pub const SYS_mkdirat: ::c_long = 285;
+pub const SYS_mknodat: ::c_long = 286;
+pub const SYS_fchownat: ::c_long = 287;
+pub const SYS_futimesat: ::c_long = 288;
+pub const SYS_fstatat64: ::c_long = 289;
+pub const SYS_unlinkat: ::c_long = 290;
+pub const SYS_renameat: ::c_long = 291;
+pub const SYS_linkat: ::c_long = 292;
+pub const SYS_symlinkat: ::c_long = 293;
+pub const SYS_readlinkat: ::c_long = 294;
+pub const SYS_fchmodat: ::c_long = 295;
+pub const SYS_faccessat: ::c_long = 296;
+pub const SYS_pselect6: ::c_long = 297;
+pub const SYS_ppoll: ::c_long = 298;
+pub const SYS_unshare: ::c_long = 299;
+pub const SYS_set_robust_list: ::c_long = 300;
+pub const SYS_get_robust_list: ::c_long = 301;
+pub const SYS_migrate_pages: ::c_long = 302;
+pub const SYS_mbind: ::c_long = 303;
+pub const SYS_get_mempolicy: ::c_long = 304;
+pub const SYS_set_mempolicy: ::c_long = 305;
+pub const SYS_kexec_load: ::c_long = 306;
+pub const SYS_move_pages: ::c_long = 307;
+pub const SYS_getcpu: ::c_long = 308;
+pub const SYS_epoll_pwait: ::c_long = 309;
+pub const SYS_utimensat: ::c_long = 310;
+pub const SYS_signalfd: ::c_long = 311;
+pub const SYS_timerfd_create: ::c_long = 312;
+pub const SYS_eventfd: ::c_long = 313;
+pub const SYS_fallocate: ::c_long = 314;
+pub const SYS_timerfd_settime: ::c_long = 315;
+pub const SYS_timerfd_gettime: ::c_long = 316;
+pub const SYS_signalfd4: ::c_long = 317;
+pub const SYS_eventfd2: ::c_long = 318;
+pub const SYS_epoll_create1: ::c_long = 319;
+pub const SYS_dup3: ::c_long = 320;
+pub const SYS_pipe2: ::c_long = 321;
+pub const SYS_inotify_init1: ::c_long = 322;
+pub const SYS_accept4: ::c_long = 323;
+pub const SYS_preadv: ::c_long = 324;
+pub const SYS_pwritev: ::c_long = 325;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 326;
+pub const SYS_perf_event_open: ::c_long = 327;
+pub const SYS_recvmmsg: ::c_long = 328;
+pub const SYS_fanotify_init: ::c_long = 329;
+pub const SYS_fanotify_mark: ::c_long = 330;
+pub const SYS_prlimit64: ::c_long = 331;
+pub const SYS_name_to_handle_at: ::c_long = 332;
+pub const SYS_open_by_handle_at: ::c_long = 333;
+pub const SYS_clock_adjtime: ::c_long = 334;
+pub const SYS_syncfs: ::c_long = 335;
+pub const SYS_sendmmsg: ::c_long = 336;
+pub const SYS_setns: ::c_long = 337;
+pub const SYS_process_vm_readv: ::c_long = 338;
+pub const SYS_process_vm_writev: ::c_long = 339;
+pub const SYS_kern_features: ::c_long = 340;
+pub const SYS_kcmp: ::c_long = 341;
+pub const SYS_finit_module: ::c_long = 342;
+pub const SYS_sched_setattr: ::c_long = 343;
+pub const SYS_sched_getattr: ::c_long = 344;
+pub const SYS_renameat2: ::c_long = 345;
+pub const SYS_seccomp: ::c_long = 346;
+pub const SYS_getrandom: ::c_long = 347;
+pub const SYS_memfd_create: ::c_long = 348;
+pub const SYS_bpf: ::c_long = 349;
+pub const SYS_execveat: ::c_long = 350;
+pub const SYS_membarrier: ::c_long = 351;
+pub const SYS_userfaultfd: ::c_long = 352;
+pub const SYS_bind: ::c_long = 353;
+pub const SYS_listen: ::c_long = 354;
+pub const SYS_setsockopt: ::c_long = 355;
+pub const SYS_mlock2: ::c_long = 356;
+pub const SYS_copy_file_range: ::c_long = 357;
+pub const SYS_preadv2: ::c_long = 358;
+pub const SYS_pwritev2: ::c_long = 359;
+pub const SYS_statx: ::c_long = 360;
+pub const SYS_rseq: ::c_long = 365;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+// Reserved in the kernel, but not actually implemented yet
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f64; 6]
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1100 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
+pub type greg_t = i32;
+
+s! {
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        f_spare: [::__fsword_t; 5],
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct flock64 {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off64_t,
+        pub l_len: ::off64_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct _libc_fpreg {
+        pub significand: [u16; 4],
+        pub exponent: u16,
+    }
+
+    pub struct _libc_fpstate {
+        pub cw: ::c_ulong,
+        pub sw: ::c_ulong,
+        pub tag: ::c_ulong,
+        pub ipoff: ::c_ulong,
+        pub cssel: ::c_ulong,
+        pub dataoff: ::c_ulong,
+        pub datasel: ::c_ulong,
+        pub _st: [_libc_fpreg; 8],
+        pub status: ::c_ulong,
+    }
+
+    pub struct user_fpregs_struct {
+        pub cwd: ::c_long,
+        pub swd: ::c_long,
+        pub twd: ::c_long,
+        pub fip: ::c_long,
+        pub fcs: ::c_long,
+        pub foo: ::c_long,
+        pub fos: ::c_long,
+        pub st_space: [::c_long; 20],
+    }
+
+    pub struct user_regs_struct {
+        pub ebx: ::c_long,
+        pub ecx: ::c_long,
+        pub edx: ::c_long,
+        pub esi: ::c_long,
+        pub edi: ::c_long,
+        pub ebp: ::c_long,
+        pub eax: ::c_long,
+        pub xds: ::c_long,
+        pub xes: ::c_long,
+        pub xfs: ::c_long,
+        pub xgs: ::c_long,
+        pub orig_eax: ::c_long,
+        pub eip: ::c_long,
+        pub xcs: ::c_long,
+        pub eflags: ::c_long,
+        pub esp: ::c_long,
+        pub xss: ::c_long,
+    }
+
+    pub struct user {
+        pub regs: user_regs_struct,
+        pub u_fpvalid: ::c_int,
+        pub i387: user_fpregs_struct,
+        pub u_tsize: ::c_ulong,
+        pub u_dsize: ::c_ulong,
+        pub u_ssize: ::c_ulong,
+        pub start_code: ::c_ulong,
+        pub start_stack: ::c_ulong,
+        pub signal: ::c_long,
+        __reserved: ::c_int,
+        pub u_ar0: *mut user_regs_struct,
+        pub u_fpstate: *mut user_fpregs_struct,
+        pub magic: ::c_ulong,
+        pub u_comm: [c_char; 32],
+        pub u_debugreg: [::c_int; 8],
+    }
+
+    pub struct mcontext_t {
+        pub gregs: [greg_t; 19],
+        pub fpregs: *mut _libc_fpstate,
+        pub oldmask: ::c_ulong,
+        pub cr2: ::c_ulong,
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::c_ushort,
+        __pad1: ::c_ushort,
+        pub __seq: ::c_ushort,
+        __pad2: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        __pad1: ::c_uint,
+        __st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad2: ::c_uint,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_ino: ::ino64_t,
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__fsword_t; 4],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        __f_unused: ::c_int,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        __unused1: ::c_ulong,
+        pub shm_dtime: ::time_t,
+        __unused2: ::c_ulong,
+        pub shm_ctime: ::time_t,
+        __unused3: ::c_ulong,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __glibc_reserved1: ::c_ulong,
+        pub msg_rtime: ::time_t,
+        __glibc_reserved2: ::c_ulong,
+        pub msg_ctime: ::time_t,
+        __glibc_reserved3: ::c_ulong,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved4: ::c_ulong,
+        __glibc_reserved5: ::c_ulong,
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        #[doc(hidden)]
+        #[deprecated(
+            since="0.2.54",
+            note="Please leave a comment on \
+                  https://github.com/rust-lang/libc/pull/1316 if you're using \
+                  this field"
+        )]
+        pub _pad: [::c_int; 29],
+        _align: [usize; 0],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t
+    }
+
+}
+
+s_no_extra_traits! {
+    pub struct user_fpxregs_struct {
+        pub cwd: ::c_ushort,
+        pub swd: ::c_ushort,
+        pub twd: ::c_ushort,
+        pub fop: ::c_ushort,
+        pub fip: ::c_long,
+        pub fcs: ::c_long,
+        pub foo: ::c_long,
+        pub fos: ::c_long,
+        pub mxcsr: ::c_long,
+        __reserved: ::c_long,
+        pub st_space: [::c_long; 32],
+        pub xmm_space: [::c_long; 32],
+        padding: [::c_long; 56],
+    }
+
+    pub struct ucontext_t {
+        pub uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_mcontext: mcontext_t,
+        pub uc_sigmask: ::sigset_t,
+        __private: [u8; 112],
+        __ssp: [::c_ulong; 4],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for user_fpxregs_struct {
+            fn eq(&self, other: &user_fpxregs_struct) -> bool {
+                self.cwd == other.cwd
+                    && self.swd == other.swd
+                    && self.twd == other.twd
+                    && self.fop == other.fop
+                    && self.fip == other.fip
+                    && self.fcs == other.fcs
+                    && self.foo == other.foo
+                    && self.fos == other.fos
+                    && self.mxcsr == other.mxcsr
+                // Ignore __reserved field
+                    && self.st_space == other.st_space
+                    && self.xmm_space == other.xmm_space
+                // Ignore padding field
+            }
+        }
+
+        impl Eq for user_fpxregs_struct {}
+
+        impl ::fmt::Debug for user_fpxregs_struct {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("user_fpxregs_struct")
+                    .field("cwd", &self.cwd)
+                    .field("swd", &self.swd)
+                    .field("twd", &self.twd)
+                    .field("fop", &self.fop)
+                    .field("fip", &self.fip)
+                    .field("fcs", &self.fcs)
+                    .field("foo", &self.foo)
+                    .field("fos", &self.fos)
+                    .field("mxcsr", &self.mxcsr)
+                // Ignore __reserved field
+                    .field("st_space", &self.st_space)
+                    .field("xmm_space", &self.xmm_space)
+                // Ignore padding field
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for user_fpxregs_struct {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.cwd.hash(state);
+                self.swd.hash(state);
+                self.twd.hash(state);
+                self.fop.hash(state);
+                self.fip.hash(state);
+                self.fcs.hash(state);
+                self.foo.hash(state);
+                self.fos.hash(state);
+                self.mxcsr.hash(state);
+                // Ignore __reserved field
+                self.st_space.hash(state);
+                self.xmm_space.hash(state);
+                // Ignore padding field
+            }
+        }
+
+        impl PartialEq for ucontext_t {
+            fn eq(&self, other: &ucontext_t) -> bool {
+                self.uc_flags == other.uc_flags
+                    && self.uc_link == other.uc_link
+                    && self.uc_stack == other.uc_stack
+                    && self.uc_mcontext == other.uc_mcontext
+                    && self.uc_sigmask == other.uc_sigmask
+                // Ignore __private field
+            }
+        }
+
+        impl Eq for ucontext_t {}
+
+        impl ::fmt::Debug for ucontext_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ucontext_t")
+                    .field("uc_flags", &self.uc_flags)
+                    .field("uc_link", &self.uc_link)
+                    .field("uc_stack", &self.uc_stack)
+                    .field("uc_mcontext", &self.uc_mcontext)
+                    .field("uc_sigmask", &self.uc_sigmask)
+                // Ignore __private field
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for ucontext_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.uc_flags.hash(state);
+                self.uc_link.hash(state);
+                self.uc_stack.hash(state);
+                self.uc_mcontext.hash(state);
+                self.uc_sigmask.hash(state);
+                // Ignore __private field
+            }
+        }
+    }
+}
+
+pub const VEOF: usize = 4;
+pub const RTLD_DEEPBIND: ::c_int = 0x8;
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+pub const O_DIRECT: ::c_int = 0x4000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+pub const O_LARGEFILE: ::c_int = 0o0100000;
+pub const O_APPEND: ::c_int = 1024;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_FSYNC: ::c_int = 0x101000;
+pub const O_ASYNC: ::c_int = 0x2000;
+pub const O_NDELAY: ::c_int = 0x800;
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MAP_LOCKED: ::c_int = 0x02000;
+pub const MAP_NORESERVE: ::c_int = 0x04000;
+pub const MAP_32BIT: ::c_int = 0x0040;
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_ANONYMOUS: ::c_int = 0x0020;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const EDEADLOCK: ::c_int = 35;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EDEADLK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EBADMSG: ::c_int = 74;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const EHWPOISON: ::c_int = 133;
+pub const ERFKILL: ::c_int = 132;
+
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETOWN: ::c_int = 8;
+
+pub const PTRACE_GETFPXREGS: ::c_uint = 18;
+pub const PTRACE_SETFPXREGS: ::c_uint = 19;
+pub const PTRACE_SYSEMU: ::c_uint = 31;
+pub const PTRACE_SYSEMU_SINGLESTEP: ::c_uint = 32;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const EFD_NONBLOCK: ::c_int = 0x800;
+pub const SFD_NONBLOCK: ::c_int = 0x0800;
+
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
+pub const SIGUNUSED: ::c_int = 31;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+
+// Syscall table
+pub const SYS_restart_syscall: ::c_long = 0;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_waitpid: ::c_long = 7;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execve: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_time: ::c_long = 13;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lchown: ::c_long = 16;
+pub const SYS_break: ::c_long = 17;
+pub const SYS_oldstat: ::c_long = 18;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_mount: ::c_long = 21;
+pub const SYS_umount: ::c_long = 22;
+pub const SYS_setuid: ::c_long = 23;
+pub const SYS_getuid: ::c_long = 24;
+pub const SYS_stime: ::c_long = 25;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_alarm: ::c_long = 27;
+pub const SYS_oldfstat: ::c_long = 28;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_utime: ::c_long = 30;
+pub const SYS_stty: ::c_long = 31;
+pub const SYS_gtty: ::c_long = 32;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_ftime: ::c_long = 35;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_prof: ::c_long = 44;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_setgid: ::c_long = 46;
+pub const SYS_getgid: ::c_long = 47;
+pub const SYS_signal: ::c_long = 48;
+pub const SYS_geteuid: ::c_long = 49;
+pub const SYS_getegid: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount2: ::c_long = 52;
+pub const SYS_lock: ::c_long = 53;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_mpx: ::c_long = 56;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_ulimit: ::c_long = 58;
+pub const SYS_oldolduname: ::c_long = 59;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_sgetmask: ::c_long = 68;
+pub const SYS_ssetmask: ::c_long = 69;
+pub const SYS_setreuid: ::c_long = 70;
+pub const SYS_setregid: ::c_long = 71;
+pub const SYS_sigsuspend: ::c_long = 72;
+pub const SYS_sigpending: ::c_long = 73;
+pub const SYS_sethostname: ::c_long = 74;
+pub const SYS_setrlimit: ::c_long = 75;
+pub const SYS_getrlimit: ::c_long = 76;
+pub const SYS_getrusage: ::c_long = 77;
+pub const SYS_gettimeofday: ::c_long = 78;
+pub const SYS_settimeofday: ::c_long = 79;
+pub const SYS_getgroups: ::c_long = 80;
+pub const SYS_setgroups: ::c_long = 81;
+pub const SYS_select: ::c_long = 82;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_oldlstat: ::c_long = 84;
+pub const SYS_readlink: ::c_long = 85;
+pub const SYS_uselib: ::c_long = 86;
+pub const SYS_swapon: ::c_long = 87;
+pub const SYS_reboot: ::c_long = 88;
+pub const SYS_readdir: ::c_long = 89;
+pub const SYS_mmap: ::c_long = 90;
+pub const SYS_munmap: ::c_long = 91;
+pub const SYS_truncate: ::c_long = 92;
+pub const SYS_ftruncate: ::c_long = 93;
+pub const SYS_fchmod: ::c_long = 94;
+pub const SYS_fchown: ::c_long = 95;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_profil: ::c_long = 98;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_ioperm: ::c_long = 101;
+pub const SYS_socketcall: ::c_long = 102;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_setitimer: ::c_long = 104;
+pub const SYS_getitimer: ::c_long = 105;
+pub const SYS_stat: ::c_long = 106;
+pub const SYS_lstat: ::c_long = 107;
+pub const SYS_fstat: ::c_long = 108;
+pub const SYS_olduname: ::c_long = 109;
+pub const SYS_iopl: ::c_long = 110;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_idle: ::c_long = 112;
+pub const SYS_vm86old: ::c_long = 113;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_ipc: ::c_long = 117;
+pub const SYS_fsync: ::c_long = 118;
+pub const SYS_sigreturn: ::c_long = 119;
+pub const SYS_clone: ::c_long = 120;
+pub const SYS_setdomainname: ::c_long = 121;
+pub const SYS_uname: ::c_long = 122;
+pub const SYS_modify_ldt: ::c_long = 123;
+pub const SYS_adjtimex: ::c_long = 124;
+pub const SYS_mprotect: ::c_long = 125;
+pub const SYS_sigprocmask: ::c_long = 126;
+pub const SYS_create_module: ::c_long = 127;
+pub const SYS_init_module: ::c_long = 128;
+pub const SYS_delete_module: ::c_long = 129;
+pub const SYS_get_kernel_syms: ::c_long = 130;
+pub const SYS_quotactl: ::c_long = 131;
+pub const SYS_getpgid: ::c_long = 132;
+pub const SYS_fchdir: ::c_long = 133;
+pub const SYS_bdflush: ::c_long = 134;
+pub const SYS_sysfs: ::c_long = 135;
+pub const SYS_personality: ::c_long = 136;
+pub const SYS_afs_syscall: ::c_long = 137;
+pub const SYS_setfsuid: ::c_long = 138;
+pub const SYS_setfsgid: ::c_long = 139;
+pub const SYS__llseek: ::c_long = 140;
+pub const SYS_getdents: ::c_long = 141;
+pub const SYS__newselect: ::c_long = 142;
+pub const SYS_flock: ::c_long = 143;
+pub const SYS_msync: ::c_long = 144;
+pub const SYS_readv: ::c_long = 145;
+pub const SYS_writev: ::c_long = 146;
+pub const SYS_getsid: ::c_long = 147;
+pub const SYS_fdatasync: ::c_long = 148;
+pub const SYS__sysctl: ::c_long = 149;
+pub const SYS_mlock: ::c_long = 150;
+pub const SYS_munlock: ::c_long = 151;
+pub const SYS_mlockall: ::c_long = 152;
+pub const SYS_munlockall: ::c_long = 153;
+pub const SYS_sched_setparam: ::c_long = 154;
+pub const SYS_sched_getparam: ::c_long = 155;
+pub const SYS_sched_setscheduler: ::c_long = 156;
+pub const SYS_sched_getscheduler: ::c_long = 157;
+pub const SYS_sched_yield: ::c_long = 158;
+pub const SYS_sched_get_priority_max: ::c_long = 159;
+pub const SYS_sched_get_priority_min: ::c_long = 160;
+pub const SYS_sched_rr_get_interval: ::c_long = 161;
+pub const SYS_nanosleep: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_setresuid: ::c_long = 164;
+pub const SYS_getresuid: ::c_long = 165;
+pub const SYS_vm86: ::c_long = 166;
+pub const SYS_query_module: ::c_long = 167;
+pub const SYS_poll: ::c_long = 168;
+pub const SYS_nfsservctl: ::c_long = 169;
+pub const SYS_setresgid: ::c_long = 170;
+pub const SYS_getresgid: ::c_long = 171;
+pub const SYS_prctl: ::c_long = 172;
+pub const SYS_rt_sigreturn: ::c_long = 173;
+pub const SYS_rt_sigaction: ::c_long = 174;
+pub const SYS_rt_sigprocmask: ::c_long = 175;
+pub const SYS_rt_sigpending: ::c_long = 176;
+pub const SYS_rt_sigtimedwait: ::c_long = 177;
+pub const SYS_rt_sigqueueinfo: ::c_long = 178;
+pub const SYS_rt_sigsuspend: ::c_long = 179;
+pub const SYS_pread64: ::c_long = 180;
+pub const SYS_pwrite64: ::c_long = 181;
+pub const SYS_chown: ::c_long = 182;
+pub const SYS_getcwd: ::c_long = 183;
+pub const SYS_capget: ::c_long = 184;
+pub const SYS_capset: ::c_long = 185;
+pub const SYS_sigaltstack: ::c_long = 186;
+pub const SYS_sendfile: ::c_long = 187;
+pub const SYS_getpmsg: ::c_long = 188;
+pub const SYS_putpmsg: ::c_long = 189;
+pub const SYS_vfork: ::c_long = 190;
+pub const SYS_ugetrlimit: ::c_long = 191;
+pub const SYS_mmap2: ::c_long = 192;
+pub const SYS_truncate64: ::c_long = 193;
+pub const SYS_ftruncate64: ::c_long = 194;
+pub const SYS_stat64: ::c_long = 195;
+pub const SYS_lstat64: ::c_long = 196;
+pub const SYS_fstat64: ::c_long = 197;
+pub const SYS_lchown32: ::c_long = 198;
+pub const SYS_getuid32: ::c_long = 199;
+pub const SYS_getgid32: ::c_long = 200;
+pub const SYS_geteuid32: ::c_long = 201;
+pub const SYS_getegid32: ::c_long = 202;
+pub const SYS_setreuid32: ::c_long = 203;
+pub const SYS_setregid32: ::c_long = 204;
+pub const SYS_getgroups32: ::c_long = 205;
+pub const SYS_setgroups32: ::c_long = 206;
+pub const SYS_fchown32: ::c_long = 207;
+pub const SYS_setresuid32: ::c_long = 208;
+pub const SYS_getresuid32: ::c_long = 209;
+pub const SYS_setresgid32: ::c_long = 210;
+pub const SYS_getresgid32: ::c_long = 211;
+pub const SYS_chown32: ::c_long = 212;
+pub const SYS_setuid32: ::c_long = 213;
+pub const SYS_setgid32: ::c_long = 214;
+pub const SYS_setfsuid32: ::c_long = 215;
+pub const SYS_setfsgid32: ::c_long = 216;
+pub const SYS_pivot_root: ::c_long = 217;
+pub const SYS_mincore: ::c_long = 218;
+pub const SYS_madvise: ::c_long = 219;
+pub const SYS_getdents64: ::c_long = 220;
+pub const SYS_fcntl64: ::c_long = 221;
+pub const SYS_gettid: ::c_long = 224;
+pub const SYS_readahead: ::c_long = 225;
+pub const SYS_setxattr: ::c_long = 226;
+pub const SYS_lsetxattr: ::c_long = 227;
+pub const SYS_fsetxattr: ::c_long = 228;
+pub const SYS_getxattr: ::c_long = 229;
+pub const SYS_lgetxattr: ::c_long = 230;
+pub const SYS_fgetxattr: ::c_long = 231;
+pub const SYS_listxattr: ::c_long = 232;
+pub const SYS_llistxattr: ::c_long = 233;
+pub const SYS_flistxattr: ::c_long = 234;
+pub const SYS_removexattr: ::c_long = 235;
+pub const SYS_lremovexattr: ::c_long = 236;
+pub const SYS_fremovexattr: ::c_long = 237;
+pub const SYS_tkill: ::c_long = 238;
+pub const SYS_sendfile64: ::c_long = 239;
+pub const SYS_futex: ::c_long = 240;
+pub const SYS_sched_setaffinity: ::c_long = 241;
+pub const SYS_sched_getaffinity: ::c_long = 242;
+pub const SYS_set_thread_area: ::c_long = 243;
+pub const SYS_get_thread_area: ::c_long = 244;
+pub const SYS_io_setup: ::c_long = 245;
+pub const SYS_io_destroy: ::c_long = 246;
+pub const SYS_io_getevents: ::c_long = 247;
+pub const SYS_io_submit: ::c_long = 248;
+pub const SYS_io_cancel: ::c_long = 249;
+pub const SYS_fadvise64: ::c_long = 250;
+pub const SYS_exit_group: ::c_long = 252;
+pub const SYS_lookup_dcookie: ::c_long = 253;
+pub const SYS_epoll_create: ::c_long = 254;
+pub const SYS_epoll_ctl: ::c_long = 255;
+pub const SYS_epoll_wait: ::c_long = 256;
+pub const SYS_remap_file_pages: ::c_long = 257;
+pub const SYS_set_tid_address: ::c_long = 258;
+pub const SYS_timer_create: ::c_long = 259;
+pub const SYS_timer_settime: ::c_long = 260;
+pub const SYS_timer_gettime: ::c_long = 261;
+pub const SYS_timer_getoverrun: ::c_long = 262;
+pub const SYS_timer_delete: ::c_long = 263;
+pub const SYS_clock_settime: ::c_long = 264;
+pub const SYS_clock_gettime: ::c_long = 265;
+pub const SYS_clock_getres: ::c_long = 266;
+pub const SYS_clock_nanosleep: ::c_long = 267;
+pub const SYS_statfs64: ::c_long = 268;
+pub const SYS_fstatfs64: ::c_long = 269;
+pub const SYS_tgkill: ::c_long = 270;
+pub const SYS_utimes: ::c_long = 271;
+pub const SYS_fadvise64_64: ::c_long = 272;
+pub const SYS_vserver: ::c_long = 273;
+pub const SYS_mbind: ::c_long = 274;
+pub const SYS_get_mempolicy: ::c_long = 275;
+pub const SYS_set_mempolicy: ::c_long = 276;
+pub const SYS_mq_open: ::c_long = 277;
+pub const SYS_mq_unlink: ::c_long = 278;
+pub const SYS_mq_timedsend: ::c_long = 279;
+pub const SYS_mq_timedreceive: ::c_long = 280;
+pub const SYS_mq_notify: ::c_long = 281;
+pub const SYS_mq_getsetattr: ::c_long = 282;
+pub const SYS_kexec_load: ::c_long = 283;
+pub const SYS_waitid: ::c_long = 284;
+pub const SYS_add_key: ::c_long = 286;
+pub const SYS_request_key: ::c_long = 287;
+pub const SYS_keyctl: ::c_long = 288;
+pub const SYS_ioprio_set: ::c_long = 289;
+pub const SYS_ioprio_get: ::c_long = 290;
+pub const SYS_inotify_init: ::c_long = 291;
+pub const SYS_inotify_add_watch: ::c_long = 292;
+pub const SYS_inotify_rm_watch: ::c_long = 293;
+pub const SYS_migrate_pages: ::c_long = 294;
+pub const SYS_openat: ::c_long = 295;
+pub const SYS_mkdirat: ::c_long = 296;
+pub const SYS_mknodat: ::c_long = 297;
+pub const SYS_fchownat: ::c_long = 298;
+pub const SYS_futimesat: ::c_long = 299;
+pub const SYS_fstatat64: ::c_long = 300;
+pub const SYS_unlinkat: ::c_long = 301;
+pub const SYS_renameat: ::c_long = 302;
+pub const SYS_linkat: ::c_long = 303;
+pub const SYS_symlinkat: ::c_long = 304;
+pub const SYS_readlinkat: ::c_long = 305;
+pub const SYS_fchmodat: ::c_long = 306;
+pub const SYS_faccessat: ::c_long = 307;
+pub const SYS_pselect6: ::c_long = 308;
+pub const SYS_ppoll: ::c_long = 309;
+pub const SYS_unshare: ::c_long = 310;
+pub const SYS_set_robust_list: ::c_long = 311;
+pub const SYS_get_robust_list: ::c_long = 312;
+pub const SYS_splice: ::c_long = 313;
+pub const SYS_sync_file_range: ::c_long = 314;
+pub const SYS_tee: ::c_long = 315;
+pub const SYS_vmsplice: ::c_long = 316;
+pub const SYS_move_pages: ::c_long = 317;
+pub const SYS_getcpu: ::c_long = 318;
+pub const SYS_epoll_pwait: ::c_long = 319;
+pub const SYS_utimensat: ::c_long = 320;
+pub const SYS_signalfd: ::c_long = 321;
+pub const SYS_timerfd_create: ::c_long = 322;
+pub const SYS_eventfd: ::c_long = 323;
+pub const SYS_fallocate: ::c_long = 324;
+pub const SYS_timerfd_settime: ::c_long = 325;
+pub const SYS_timerfd_gettime: ::c_long = 326;
+pub const SYS_signalfd4: ::c_long = 327;
+pub const SYS_eventfd2: ::c_long = 328;
+pub const SYS_epoll_create1: ::c_long = 329;
+pub const SYS_dup3: ::c_long = 330;
+pub const SYS_pipe2: ::c_long = 331;
+pub const SYS_inotify_init1: ::c_long = 332;
+pub const SYS_preadv: ::c_long = 333;
+pub const SYS_pwritev: ::c_long = 334;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 335;
+pub const SYS_perf_event_open: ::c_long = 336;
+pub const SYS_recvmmsg: ::c_long = 337;
+pub const SYS_fanotify_init: ::c_long = 338;
+pub const SYS_fanotify_mark: ::c_long = 339;
+pub const SYS_prlimit64: ::c_long = 340;
+pub const SYS_name_to_handle_at: ::c_long = 341;
+pub const SYS_open_by_handle_at: ::c_long = 342;
+pub const SYS_clock_adjtime: ::c_long = 343;
+pub const SYS_syncfs: ::c_long = 344;
+pub const SYS_sendmmsg: ::c_long = 345;
+pub const SYS_setns: ::c_long = 346;
+pub const SYS_process_vm_readv: ::c_long = 347;
+pub const SYS_process_vm_writev: ::c_long = 348;
+pub const SYS_kcmp: ::c_long = 349;
+pub const SYS_finit_module: ::c_long = 350;
+pub const SYS_sched_setattr: ::c_long = 351;
+pub const SYS_sched_getattr: ::c_long = 352;
+pub const SYS_renameat2: ::c_long = 353;
+pub const SYS_seccomp: ::c_long = 354;
+pub const SYS_getrandom: ::c_long = 355;
+pub const SYS_memfd_create: ::c_long = 356;
+pub const SYS_bpf: ::c_long = 357;
+pub const SYS_execveat: ::c_long = 358;
+pub const SYS_socket: ::c_long = 359;
+pub const SYS_socketpair: ::c_long = 360;
+pub const SYS_bind: ::c_long = 361;
+pub const SYS_connect: ::c_long = 362;
+pub const SYS_listen: ::c_long = 363;
+pub const SYS_accept4: ::c_long = 364;
+pub const SYS_getsockopt: ::c_long = 365;
+pub const SYS_setsockopt: ::c_long = 366;
+pub const SYS_getsockname: ::c_long = 367;
+pub const SYS_getpeername: ::c_long = 368;
+pub const SYS_sendto: ::c_long = 369;
+pub const SYS_sendmsg: ::c_long = 370;
+pub const SYS_recvfrom: ::c_long = 371;
+pub const SYS_recvmsg: ::c_long = 372;
+pub const SYS_shutdown: ::c_long = 373;
+pub const SYS_userfaultfd: ::c_long = 374;
+pub const SYS_membarrier: ::c_long = 375;
+pub const SYS_mlock2: ::c_long = 376;
+pub const SYS_copy_file_range: ::c_long = 377;
+pub const SYS_preadv2: ::c_long = 378;
+pub const SYS_pwritev2: ::c_long = 379;
+pub const SYS_pkey_mprotect: ::c_long = 380;
+pub const SYS_pkey_alloc: ::c_long = 381;
+pub const SYS_pkey_free: ::c_long = 382;
+pub const SYS_statx: ::c_long = 383;
+pub const SYS_rseq: ::c_long = 386;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+// offsets in user_regs_structs, from sys/reg.h
+pub const EBX: ::c_int = 0;
+pub const ECX: ::c_int = 1;
+pub const EDX: ::c_int = 2;
+pub const ESI: ::c_int = 3;
+pub const EDI: ::c_int = 4;
+pub const EBP: ::c_int = 5;
+pub const EAX: ::c_int = 6;
+pub const DS: ::c_int = 7;
+pub const ES: ::c_int = 8;
+pub const FS: ::c_int = 9;
+pub const GS: ::c_int = 10;
+pub const ORIG_EAX: ::c_int = 11;
+pub const EIP: ::c_int = 12;
+pub const CS: ::c_int = 13;
+pub const EFL: ::c_int = 14;
+pub const UESP: ::c_int = 15;
+pub const SS: ::c_int = 16;
+
+// offsets in mcontext_t.gregs from sys/ucontext.h
+pub const REG_GS: ::c_int = 0;
+pub const REG_FS: ::c_int = 1;
+pub const REG_ES: ::c_int = 2;
+pub const REG_DS: ::c_int = 3;
+pub const REG_EDI: ::c_int = 4;
+pub const REG_ESI: ::c_int = 5;
+pub const REG_EBP: ::c_int = 6;
+pub const REG_ESP: ::c_int = 7;
+pub const REG_EBX: ::c_int = 8;
+pub const REG_EDX: ::c_int = 9;
+pub const REG_ECX: ::c_int = 10;
+pub const REG_EAX: ::c_int = 11;
+pub const REG_TRAPNO: ::c_int = 12;
+pub const REG_ERR: ::c_int = 13;
+pub const REG_EIP: ::c_int = 14;
+pub const REG_CS: ::c_int = 15;
+pub const REG_EFL: ::c_int = 16;
+pub const REG_UESP: ::c_int = 17;
+pub const REG_SS: ::c_int = 18;
+
+extern "C" {
+    pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int;
+    pub fn setcontext(ucp: *const ucontext_t) -> ::c_int;
+    pub fn makecontext(ucp: *mut ucontext_t, func: extern "C" fn(), argc: ::c_int, ...);
+    pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,51 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f32; 8]
+    }
+}
+
+s! {
+    pub struct ucontext_t {
+        pub uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_mcontext: mcontext_t,
+    }
+
+    #[repr(align(16))]
+    pub struct mcontext_t {
+        pub fault_address: ::c_ulonglong,
+        pub regs: [::c_ulonglong; 31],
+        pub sp: ::c_ulonglong,
+        pub pc: ::c_ulonglong,
+        pub pstate: ::c_ulonglong,
+        // nested arrays to get the right size/length while being able to
+        // auto-derive traits like Debug
+        __reserved: [[u64; 32]; 16],
+    }
+
+    #[repr(align(8))]
+    pub struct clone_args {
+        pub flags: ::c_ulonglong,
+        pub pidfd: ::c_ulonglong,
+        pub child_tid: ::c_ulonglong,
+        pub parent_tid: ::c_ulonglong,
+        pub exit_signal: ::c_ulonglong,
+        pub stack: ::c_ulonglong,
+        pub stack_size: ::c_ulonglong,
+        pub tls: ::c_ulonglong,
+        pub set_tid: ::c_ulonglong,
+        pub set_tid_size: ::c_ulonglong,
+        pub cgroup: ::c_ulonglong,
+    }
+}
+
+extern "C" {
+    pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int;
+    pub fn setcontext(ucp: *const ucontext_t) -> ::c_int;
+    pub fn makecontext(ucp: *mut ucontext_t, func: extern "C" fn(), argc: ::c_int, ...);
+    pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> ::c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/fallback.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/fallback.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/fallback.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/fallback.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,8 @@
+s! {
+    #[repr(align(16))]
+    pub struct user_fpsimd_struct {
+        pub vregs: [[u64; 2]; 32],
+        pub fpsr: ::c_uint,
+        pub fpcr: ::c_uint,
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,64 @@
+use pthread_mutex_t;
+
+pub type c_long = i32;
+pub type c_ulong = u32;
+
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 32;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 48;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20;
+
+align_const! {
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+}
+
+pub const SYS_sync_file_range2: ::c_long = 84;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s! {
+    pub struct user_fpsimd_struct {
+        pub vregs: [::__uint128_t; 32],
+        pub fpsr: u32,
+        pub fpcr: u32,
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,73 @@
+use pthread_mutex_t;
+
+pub type c_long = i64;
+pub type c_ulong = u64;
+
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 8;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 48;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 8;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 8;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
+
+align_const! {
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0,
+            ],
+        };
+}
+
+pub const SYS_renameat: ::c_long = 38;
+pub const SYS_sync_file_range: ::c_long = 84;
+pub const SYS_getrlimit: ::c_long = 163;
+pub const SYS_setrlimit: ::c_long = 164;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,937 @@
+//! AArch64-specific definitions for 64-bit linux-like values
+
+pub type c_char = u8;
+pub type wchar_t = u32;
+pub type nlink_t = u32;
+pub type blksize_t = i32;
+pub type suseconds_t = i64;
+pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
+
+s! {
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        #[cfg(target_arch = "sparc64")]
+        __reserved0: ::c_int,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        f_spare: [::__fsword_t; 5],
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct flock64 {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off64_t,
+        pub l_len: ::off64_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad1: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        __pad2: ::c_int,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_int; 2],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad1: ::dev_t,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        __pad2: ::c_int,
+        pub st_blocks: ::blkcnt64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_int; 2],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__fsword_t; 4],
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct pthread_attr_t {
+        __size: [usize; 8]
+    }
+
+    pub struct user_regs_struct {
+        pub regs: [::c_ulonglong; 31],
+        pub sp: ::c_ulonglong,
+        pub pc: ::c_ulonglong,
+        pub pstate: ::c_ulonglong,
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::c_uint,
+        pub __seq: ::c_ushort,
+        __pad1: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        #[doc(hidden)]
+        #[deprecated(
+            since="0.2.54",
+            note="Please leave a comment on \
+                  https://github.com/rust-lang/libc/pull/1316 if you're using \
+                  this field"
+        )]
+        pub _pad: [::c_int; 29],
+        _align: [usize; 0],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t
+    }
+
+}
+
+pub const VEOF: usize = 4;
+
+pub const RTLD_DEEPBIND: ::c_int = 0x8;
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+
+pub const O_APPEND: ::c_int = 1024;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_FSYNC: ::c_int = 0x101000;
+pub const O_NOATIME: ::c_int = 0o1000000;
+pub const O_PATH: ::c_int = 0o10000000;
+pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EDEADLK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EBADMSG: ::c_int = 74;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const EHWPOISON: ::c_int = 133;
+pub const ERFKILL: ::c_int = 132;
+
+pub const POSIX_FADV_DONTNEED: ::c_int = 4;
+pub const POSIX_FADV_NOREUSE: ::c_int = 5;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
+pub const SIGUNUSED: ::c_int = 31;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const O_ASYNC: ::c_int = 0x2000;
+pub const O_NDELAY: ::c_int = 0x800;
+
+pub const PTRACE_DETACH: ::c_uint = 17;
+
+pub const EFD_NONBLOCK: ::c_int = 0x800;
+
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETOWN: ::c_int = 8;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+pub const F_OFD_GETLK: ::c_int = 36;
+pub const F_OFD_SETLK: ::c_int = 37;
+pub const F_OFD_SETLKW: ::c_int = 38;
+
+pub const F_RDLCK: ::c_int = 0;
+pub const F_WRLCK: ::c_int = 1;
+pub const F_UNLCK: ::c_int = 2;
+
+pub const SFD_NONBLOCK: ::c_int = 0x0800;
+
+pub const SFD_CLOEXEC: ::c_int = 0x080000;
+
+pub const NCCS: usize = 32;
+
+pub const O_TRUNC: ::c_int = 512;
+
+pub const O_CLOEXEC: ::c_int = 0x80000;
+
+pub const EBFONT: ::c_int = 59;
+pub const ENOSTR: ::c_int = 60;
+pub const ENODATA: ::c_int = 61;
+pub const ETIME: ::c_int = 62;
+pub const ENOSR: ::c_int = 63;
+pub const ENONET: ::c_int = 64;
+pub const ENOPKG: ::c_int = 65;
+pub const EREMOTE: ::c_int = 66;
+pub const ENOLINK: ::c_int = 67;
+pub const EADV: ::c_int = 68;
+pub const ESRMNT: ::c_int = 69;
+pub const ECOMM: ::c_int = 70;
+pub const EPROTO: ::c_int = 71;
+pub const EDOTDOT: ::c_int = 73;
+
+pub const SA_NODEFER: ::c_int = 0x40000000;
+pub const SA_RESETHAND: ::c_int = 0x80000000;
+pub const SA_RESTART: ::c_int = 0x10000000;
+pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
+
+pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
+
+pub const EFD_CLOEXEC: ::c_int = 0x80000;
+
+pub const O_DIRECT: ::c_int = 0x10000;
+pub const O_DIRECTORY: ::c_int = 0x4000;
+pub const O_NOFOLLOW: ::c_int = 0x8000;
+
+pub const MAP_LOCKED: ::c_int = 0x02000;
+pub const MAP_NORESERVE: ::c_int = 0x04000;
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_ANONYMOUS: ::c_int = 0x0020;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const EDEADLOCK: ::c_int = 35;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+
+pub const SIGSTKSZ: ::size_t = 16384;
+pub const MINSIGSTKSZ: ::size_t = 5120;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+
+// sys/auxv.h
+pub const HWCAP_FP: ::c_ulong = 1 << 0;
+pub const HWCAP_ASIMD: ::c_ulong = 1 << 1;
+pub const HWCAP_EVTSTRM: ::c_ulong = 1 << 2;
+pub const HWCAP_AES: ::c_ulong = 1 << 3;
+pub const HWCAP_PMULL: ::c_ulong = 1 << 4;
+pub const HWCAP_SHA1: ::c_ulong = 1 << 5;
+pub const HWCAP_SHA2: ::c_ulong = 1 << 6;
+pub const HWCAP_CRC32: ::c_ulong = 1 << 7;
+pub const HWCAP_ATOMICS: ::c_ulong = 1 << 8;
+pub const HWCAP_FPHP: ::c_ulong = 1 << 9;
+pub const HWCAP_ASIMDHP: ::c_ulong = 1 << 10;
+pub const HWCAP_CPUID: ::c_ulong = 1 << 11;
+pub const HWCAP_ASIMDRDM: ::c_ulong = 1 << 12;
+pub const HWCAP_JSCVT: ::c_ulong = 1 << 13;
+pub const HWCAP_FCMA: ::c_ulong = 1 << 14;
+pub const HWCAP_LRCPC: ::c_ulong = 1 << 15;
+pub const HWCAP_DCPOP: ::c_ulong = 1 << 16;
+pub const HWCAP_SHA3: ::c_ulong = 1 << 17;
+pub const HWCAP_SM3: ::c_ulong = 1 << 18;
+pub const HWCAP_SM4: ::c_ulong = 1 << 19;
+pub const HWCAP_ASIMDDP: ::c_ulong = 1 << 20;
+pub const HWCAP_SHA512: ::c_ulong = 1 << 21;
+pub const HWCAP_SVE: ::c_ulong = 1 << 22;
+pub const HWCAP_ASIMDFHM: ::c_ulong = 1 << 23;
+pub const HWCAP_DIT: ::c_ulong = 1 << 24;
+pub const HWCAP_USCAT: ::c_ulong = 1 << 25;
+pub const HWCAP_ILRCPC: ::c_ulong = 1 << 26;
+pub const HWCAP_FLAGM: ::c_ulong = 1 << 27;
+pub const HWCAP_SSBS: ::c_ulong = 1 << 28;
+pub const HWCAP_SB: ::c_ulong = 1 << 29;
+pub const HWCAP_PACA: ::c_ulong = 1 << 30;
+pub const HWCAP_PACG: ::c_ulong = 1 << 31;
+// FIXME: enable these again once linux-api-headers are up to date enough on CI.
+// See discussion in https://github.com/rust-lang/libc/pull/1638
+//pub const HWCAP2_DCPODP: ::c_ulong = 1 << 0;
+//pub const HWCAP2_SVE2: ::c_ulong = 1 << 1;
+//pub const HWCAP2_SVEAES: ::c_ulong = 1 << 2;
+//pub const HWCAP2_SVEPMULL: ::c_ulong = 1 << 3;
+//pub const HWCAP2_SVEBITPERM: ::c_ulong = 1 << 4;
+//pub const HWCAP2_SVESHA3: ::c_ulong = 1 << 5;
+//pub const HWCAP2_SVESM4: ::c_ulong = 1 << 6;
+//pub const HWCAP2_FLAGM2: ::c_ulong = 1 << 7;
+//pub const HWCAP2_FRINT: ::c_ulong = 1 << 8;
+//pub const HWCAP2_MTE: ::c_ulong = 1 << 18;
+
+// linux/prctl.h
+pub const PR_PAC_RESET_KEYS: ::c_int = 54;
+pub const PR_SET_TAGGED_ADDR_CTRL: ::c_int = 55;
+pub const PR_GET_TAGGED_ADDR_CTRL: ::c_int = 56;
+pub const PR_PAC_SET_ENABLED_KEYS: ::c_int = 60;
+pub const PR_PAC_GET_ENABLED_KEYS: ::c_int = 61;
+
+pub const PR_TAGGED_ADDR_ENABLE: ::c_ulong = 1;
+
+pub const PR_PAC_APIAKEY: ::c_ulong = 1 << 0;
+pub const PR_PAC_APIBKEY: ::c_ulong = 1 << 1;
+pub const PR_PAC_APDAKEY: ::c_ulong = 1 << 2;
+pub const PR_PAC_APDBKEY: ::c_ulong = 1 << 3;
+pub const PR_PAC_APGAKEY: ::c_ulong = 1 << 4;
+
+pub const PR_SME_SET_VL: ::c_int = 63;
+pub const PR_SME_GET_VL: ::c_int = 64;
+pub const PR_SME_VL_LEN_MAX: ::c_int = 0xffff;
+
+pub const PR_SME_SET_VL_INHERIT: ::c_ulong = 1 << 17;
+pub const PR_SME_SET_VL_ONE_EXEC: ::c_ulong = 1 << 18;
+
+// Syscall table
+pub const SYS_io_setup: ::c_long = 0;
+pub const SYS_io_destroy: ::c_long = 1;
+pub const SYS_io_submit: ::c_long = 2;
+pub const SYS_io_cancel: ::c_long = 3;
+pub const SYS_io_getevents: ::c_long = 4;
+pub const SYS_setxattr: ::c_long = 5;
+pub const SYS_lsetxattr: ::c_long = 6;
+pub const SYS_fsetxattr: ::c_long = 7;
+pub const SYS_getxattr: ::c_long = 8;
+pub const SYS_lgetxattr: ::c_long = 9;
+pub const SYS_fgetxattr: ::c_long = 10;
+pub const SYS_listxattr: ::c_long = 11;
+pub const SYS_llistxattr: ::c_long = 12;
+pub const SYS_flistxattr: ::c_long = 13;
+pub const SYS_removexattr: ::c_long = 14;
+pub const SYS_lremovexattr: ::c_long = 15;
+pub const SYS_fremovexattr: ::c_long = 16;
+pub const SYS_getcwd: ::c_long = 17;
+pub const SYS_lookup_dcookie: ::c_long = 18;
+pub const SYS_eventfd2: ::c_long = 19;
+pub const SYS_epoll_create1: ::c_long = 20;
+pub const SYS_epoll_ctl: ::c_long = 21;
+pub const SYS_epoll_pwait: ::c_long = 22;
+pub const SYS_dup: ::c_long = 23;
+pub const SYS_dup3: ::c_long = 24;
+pub const SYS_fcntl: ::c_long = 25;
+pub const SYS_inotify_init1: ::c_long = 26;
+pub const SYS_inotify_add_watch: ::c_long = 27;
+pub const SYS_inotify_rm_watch: ::c_long = 28;
+pub const SYS_ioctl: ::c_long = 29;
+pub const SYS_ioprio_set: ::c_long = 30;
+pub const SYS_ioprio_get: ::c_long = 31;
+pub const SYS_flock: ::c_long = 32;
+pub const SYS_mknodat: ::c_long = 33;
+pub const SYS_mkdirat: ::c_long = 34;
+pub const SYS_unlinkat: ::c_long = 35;
+pub const SYS_symlinkat: ::c_long = 36;
+pub const SYS_linkat: ::c_long = 37;
+// 38 is renameat only on LP64
+pub const SYS_umount2: ::c_long = 39;
+pub const SYS_mount: ::c_long = 40;
+pub const SYS_pivot_root: ::c_long = 41;
+pub const SYS_nfsservctl: ::c_long = 42;
+pub const SYS_statfs: ::c_long = 43;
+pub const SYS_fstatfs: ::c_long = 44;
+pub const SYS_truncate: ::c_long = 45;
+pub const SYS_ftruncate: ::c_long = 46;
+pub const SYS_fallocate: ::c_long = 47;
+pub const SYS_faccessat: ::c_long = 48;
+pub const SYS_chdir: ::c_long = 49;
+pub const SYS_fchdir: ::c_long = 50;
+pub const SYS_chroot: ::c_long = 51;
+pub const SYS_fchmod: ::c_long = 52;
+pub const SYS_fchmodat: ::c_long = 53;
+pub const SYS_fchownat: ::c_long = 54;
+pub const SYS_fchown: ::c_long = 55;
+pub const SYS_openat: ::c_long = 56;
+pub const SYS_close: ::c_long = 57;
+pub const SYS_vhangup: ::c_long = 58;
+pub const SYS_pipe2: ::c_long = 59;
+pub const SYS_quotactl: ::c_long = 60;
+pub const SYS_getdents64: ::c_long = 61;
+pub const SYS_lseek: ::c_long = 62;
+pub const SYS_read: ::c_long = 63;
+pub const SYS_write: ::c_long = 64;
+pub const SYS_readv: ::c_long = 65;
+pub const SYS_writev: ::c_long = 66;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_preadv: ::c_long = 69;
+pub const SYS_pwritev: ::c_long = 70;
+pub const SYS_pselect6: ::c_long = 72;
+pub const SYS_ppoll: ::c_long = 73;
+pub const SYS_signalfd4: ::c_long = 74;
+pub const SYS_vmsplice: ::c_long = 75;
+pub const SYS_splice: ::c_long = 76;
+pub const SYS_tee: ::c_long = 77;
+pub const SYS_readlinkat: ::c_long = 78;
+pub const SYS_newfstatat: ::c_long = 79;
+pub const SYS_fstat: ::c_long = 80;
+pub const SYS_sync: ::c_long = 81;
+pub const SYS_fsync: ::c_long = 82;
+pub const SYS_fdatasync: ::c_long = 83;
+// 84 sync_file_range on LP64 and sync_file_range2 on ILP32
+pub const SYS_timerfd_create: ::c_long = 85;
+pub const SYS_timerfd_settime: ::c_long = 86;
+pub const SYS_timerfd_gettime: ::c_long = 87;
+pub const SYS_utimensat: ::c_long = 88;
+pub const SYS_acct: ::c_long = 89;
+pub const SYS_capget: ::c_long = 90;
+pub const SYS_capset: ::c_long = 91;
+pub const SYS_personality: ::c_long = 92;
+pub const SYS_exit: ::c_long = 93;
+pub const SYS_exit_group: ::c_long = 94;
+pub const SYS_waitid: ::c_long = 95;
+pub const SYS_set_tid_address: ::c_long = 96;
+pub const SYS_unshare: ::c_long = 97;
+pub const SYS_futex: ::c_long = 98;
+pub const SYS_set_robust_list: ::c_long = 99;
+pub const SYS_get_robust_list: ::c_long = 100;
+pub const SYS_nanosleep: ::c_long = 101;
+pub const SYS_getitimer: ::c_long = 102;
+pub const SYS_setitimer: ::c_long = 103;
+pub const SYS_kexec_load: ::c_long = 104;
+pub const SYS_init_module: ::c_long = 105;
+pub const SYS_delete_module: ::c_long = 106;
+pub const SYS_timer_create: ::c_long = 107;
+pub const SYS_timer_gettime: ::c_long = 108;
+pub const SYS_timer_getoverrun: ::c_long = 109;
+pub const SYS_timer_settime: ::c_long = 110;
+pub const SYS_timer_delete: ::c_long = 111;
+pub const SYS_clock_settime: ::c_long = 112;
+pub const SYS_clock_gettime: ::c_long = 113;
+pub const SYS_clock_getres: ::c_long = 114;
+pub const SYS_clock_nanosleep: ::c_long = 115;
+pub const SYS_syslog: ::c_long = 116;
+pub const SYS_ptrace: ::c_long = 117;
+pub const SYS_sched_setparam: ::c_long = 118;
+pub const SYS_sched_setscheduler: ::c_long = 119;
+pub const SYS_sched_getscheduler: ::c_long = 120;
+pub const SYS_sched_getparam: ::c_long = 121;
+pub const SYS_sched_setaffinity: ::c_long = 122;
+pub const SYS_sched_getaffinity: ::c_long = 123;
+pub const SYS_sched_yield: ::c_long = 124;
+pub const SYS_sched_get_priority_max: ::c_long = 125;
+pub const SYS_sched_get_priority_min: ::c_long = 126;
+pub const SYS_sched_rr_get_interval: ::c_long = 127;
+pub const SYS_restart_syscall: ::c_long = 128;
+pub const SYS_kill: ::c_long = 129;
+pub const SYS_tkill: ::c_long = 130;
+pub const SYS_tgkill: ::c_long = 131;
+pub const SYS_sigaltstack: ::c_long = 132;
+pub const SYS_rt_sigsuspend: ::c_long = 133;
+pub const SYS_rt_sigaction: ::c_long = 134;
+pub const SYS_rt_sigprocmask: ::c_long = 135;
+pub const SYS_rt_sigpending: ::c_long = 136;
+pub const SYS_rt_sigtimedwait: ::c_long = 137;
+pub const SYS_rt_sigqueueinfo: ::c_long = 138;
+pub const SYS_rt_sigreturn: ::c_long = 139;
+pub const SYS_setpriority: ::c_long = 140;
+pub const SYS_getpriority: ::c_long = 141;
+pub const SYS_reboot: ::c_long = 142;
+pub const SYS_setregid: ::c_long = 143;
+pub const SYS_setgid: ::c_long = 144;
+pub const SYS_setreuid: ::c_long = 145;
+pub const SYS_setuid: ::c_long = 146;
+pub const SYS_setresuid: ::c_long = 147;
+pub const SYS_getresuid: ::c_long = 148;
+pub const SYS_setresgid: ::c_long = 149;
+pub const SYS_getresgid: ::c_long = 150;
+pub const SYS_setfsuid: ::c_long = 151;
+pub const SYS_setfsgid: ::c_long = 152;
+pub const SYS_times: ::c_long = 153;
+pub const SYS_setpgid: ::c_long = 154;
+pub const SYS_getpgid: ::c_long = 155;
+pub const SYS_getsid: ::c_long = 156;
+pub const SYS_setsid: ::c_long = 157;
+pub const SYS_getgroups: ::c_long = 158;
+pub const SYS_setgroups: ::c_long = 159;
+pub const SYS_uname: ::c_long = 160;
+pub const SYS_sethostname: ::c_long = 161;
+pub const SYS_setdomainname: ::c_long = 162;
+// 163 is getrlimit only on LP64
+// 164 is setrlimit only on LP64
+pub const SYS_getrusage: ::c_long = 165;
+pub const SYS_umask: ::c_long = 166;
+pub const SYS_prctl: ::c_long = 167;
+pub const SYS_getcpu: ::c_long = 168;
+pub const SYS_gettimeofday: ::c_long = 169;
+pub const SYS_settimeofday: ::c_long = 170;
+pub const SYS_adjtimex: ::c_long = 171;
+pub const SYS_getpid: ::c_long = 172;
+pub const SYS_getppid: ::c_long = 173;
+pub const SYS_getuid: ::c_long = 174;
+pub const SYS_geteuid: ::c_long = 175;
+pub const SYS_getgid: ::c_long = 176;
+pub const SYS_getegid: ::c_long = 177;
+pub const SYS_gettid: ::c_long = 178;
+pub const SYS_sysinfo: ::c_long = 179;
+pub const SYS_mq_open: ::c_long = 180;
+pub const SYS_mq_unlink: ::c_long = 181;
+pub const SYS_mq_timedsend: ::c_long = 182;
+pub const SYS_mq_timedreceive: ::c_long = 183;
+pub const SYS_mq_notify: ::c_long = 184;
+pub const SYS_mq_getsetattr: ::c_long = 185;
+pub const SYS_msgget: ::c_long = 186;
+pub const SYS_msgctl: ::c_long = 187;
+pub const SYS_msgrcv: ::c_long = 188;
+pub const SYS_msgsnd: ::c_long = 189;
+pub const SYS_semget: ::c_long = 190;
+pub const SYS_semctl: ::c_long = 191;
+pub const SYS_semtimedop: ::c_long = 192;
+pub const SYS_semop: ::c_long = 193;
+pub const SYS_shmget: ::c_long = 194;
+pub const SYS_shmctl: ::c_long = 195;
+pub const SYS_shmat: ::c_long = 196;
+pub const SYS_shmdt: ::c_long = 197;
+pub const SYS_socket: ::c_long = 198;
+pub const SYS_socketpair: ::c_long = 199;
+pub const SYS_bind: ::c_long = 200;
+pub const SYS_listen: ::c_long = 201;
+pub const SYS_accept: ::c_long = 202;
+pub const SYS_connect: ::c_long = 203;
+pub const SYS_getsockname: ::c_long = 204;
+pub const SYS_getpeername: ::c_long = 205;
+pub const SYS_sendto: ::c_long = 206;
+pub const SYS_recvfrom: ::c_long = 207;
+pub const SYS_setsockopt: ::c_long = 208;
+pub const SYS_getsockopt: ::c_long = 209;
+pub const SYS_shutdown: ::c_long = 210;
+pub const SYS_sendmsg: ::c_long = 211;
+pub const SYS_recvmsg: ::c_long = 212;
+pub const SYS_readahead: ::c_long = 213;
+pub const SYS_brk: ::c_long = 214;
+pub const SYS_munmap: ::c_long = 215;
+pub const SYS_mremap: ::c_long = 216;
+pub const SYS_add_key: ::c_long = 217;
+pub const SYS_request_key: ::c_long = 218;
+pub const SYS_keyctl: ::c_long = 219;
+pub const SYS_clone: ::c_long = 220;
+pub const SYS_execve: ::c_long = 221;
+pub const SYS_mmap: ::c_long = 222;
+pub const SYS_swapon: ::c_long = 224;
+pub const SYS_swapoff: ::c_long = 225;
+pub const SYS_mprotect: ::c_long = 226;
+pub const SYS_msync: ::c_long = 227;
+pub const SYS_mlock: ::c_long = 228;
+pub const SYS_munlock: ::c_long = 229;
+pub const SYS_mlockall: ::c_long = 230;
+pub const SYS_munlockall: ::c_long = 231;
+pub const SYS_mincore: ::c_long = 232;
+pub const SYS_madvise: ::c_long = 233;
+pub const SYS_remap_file_pages: ::c_long = 234;
+pub const SYS_mbind: ::c_long = 235;
+pub const SYS_get_mempolicy: ::c_long = 236;
+pub const SYS_set_mempolicy: ::c_long = 237;
+pub const SYS_migrate_pages: ::c_long = 238;
+pub const SYS_move_pages: ::c_long = 239;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
+pub const SYS_perf_event_open: ::c_long = 241;
+pub const SYS_accept4: ::c_long = 242;
+pub const SYS_recvmmsg: ::c_long = 243;
+pub const SYS_wait4: ::c_long = 260;
+pub const SYS_prlimit64: ::c_long = 261;
+pub const SYS_fanotify_init: ::c_long = 262;
+pub const SYS_fanotify_mark: ::c_long = 263;
+pub const SYS_name_to_handle_at: ::c_long = 264;
+pub const SYS_open_by_handle_at: ::c_long = 265;
+pub const SYS_clock_adjtime: ::c_long = 266;
+pub const SYS_syncfs: ::c_long = 267;
+pub const SYS_setns: ::c_long = 268;
+pub const SYS_sendmmsg: ::c_long = 269;
+pub const SYS_process_vm_readv: ::c_long = 270;
+pub const SYS_process_vm_writev: ::c_long = 271;
+pub const SYS_kcmp: ::c_long = 272;
+pub const SYS_finit_module: ::c_long = 273;
+pub const SYS_sched_setattr: ::c_long = 274;
+pub const SYS_sched_getattr: ::c_long = 275;
+pub const SYS_renameat2: ::c_long = 276;
+pub const SYS_seccomp: ::c_long = 277;
+pub const SYS_getrandom: ::c_long = 278;
+pub const SYS_memfd_create: ::c_long = 279;
+pub const SYS_bpf: ::c_long = 280;
+pub const SYS_execveat: ::c_long = 281;
+pub const SYS_userfaultfd: ::c_long = 282;
+pub const SYS_membarrier: ::c_long = 283;
+pub const SYS_mlock2: ::c_long = 284;
+pub const SYS_copy_file_range: ::c_long = 285;
+pub const SYS_preadv2: ::c_long = 286;
+pub const SYS_pwritev2: ::c_long = 287;
+pub const SYS_pkey_mprotect: ::c_long = 288;
+pub const SYS_pkey_alloc: ::c_long = 289;
+pub const SYS_pkey_free: ::c_long = 290;
+pub const SYS_statx: ::c_long = 291;
+pub const SYS_rseq: ::c_long = 293;
+pub const SYS_kexec_file_load: ::c_long = 294;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+pub const PROT_BTI: ::c_int = 0x10;
+pub const PROT_MTE: ::c_int = 0x20;
+
+extern "C" {
+    pub fn sysctl(
+        name: *mut ::c_int,
+        namelen: ::c_int,
+        oldp: *mut ::c_void,
+        oldlenp: *mut ::size_t,
+        newp: *mut ::c_void,
+        newlen: ::size_t,
+    ) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(target_pointer_width = "32")] {
+        mod ilp32;
+        pub use self::ilp32::*;
+    } else {
+        mod lp64;
+        pub use self::lp64::*;
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+
+
+}
+
+cfg_if! {
+    if #[cfg(libc_int128)] {
+        mod int128;
+        pub use self::int128::*;
+    } else if #[cfg(libc_align)] {
+        mod fallback;
+        pub use self::fallback::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,40 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f64; 4]
+    }
+}
+
+s! {
+    pub struct ucontext_t {
+        pub uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_mcontext: mcontext_t,
+    }
+
+    #[repr(align(16))]
+    pub struct mcontext_t {
+        pub __pc: ::c_ulonglong,
+        pub __gregs: [::c_ulonglong; 32],
+        pub __flags: ::c_uint,
+        pub __extcontext: [::c_ulonglong; 0],
+    }
+
+    #[repr(align(8))]
+    pub struct clone_args {
+        pub flags: ::c_ulonglong,
+        pub pidfd: ::c_ulonglong,
+        pub child_tid: ::c_ulonglong,
+        pub parent_tid: ::c_ulonglong,
+        pub exit_signal: ::c_ulonglong,
+        pub stack: ::c_ulonglong,
+        pub stack_size: ::c_ulonglong,
+        pub tls: ::c_ulonglong,
+        pub set_tid: ::c_ulonglong,
+        pub set_tid_size: ::c_ulonglong,
+        pub cgroup: ::c_ulonglong,
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,900 @@
+use pthread_mutex_t;
+
+pub type c_char = i8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type wchar_t = i32;
+
+pub type blksize_t = i32;
+pub type nlink_t = u32;
+pub type suseconds_t = i64;
+pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad1: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        __pad2: ::c_int,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_int; 2],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub __pad1: ::dev_t,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub __pad2: ::c_int,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_int; 2],
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__fsword_t; 4],
+    }
+
+        pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__fsword_t; 4],
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct flock64 {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off64_t,
+        pub l_len: ::off64_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct pthread_attr_t {
+        __size: [::c_ulong; 7]
+    }
+
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t,
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        #[doc(hidden)]
+        #[deprecated(
+            since="0.2.54",
+            note="Please leave a comment on \
+                  https://github.com/rust-lang/libc/pull/1316 if you're using \
+                  this field"
+        )]
+        pub _pad: [::c_int; 29],
+        _align: [u64; 0],
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::c_uint,
+        pub __seq: ::c_ushort,
+        __pad2: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+
+    pub struct user_regs_struct {
+        pub regs: [u64; 32],
+        pub orig_a0: u64,
+        pub csr_era: u64,
+        pub csr_badv: u64,
+        pub reserved: [u64; 10],
+
+    }
+
+    pub struct user_fp_struct {
+        pub fpr: [u64; 32],
+        pub fcc: u64,
+        pub fcsr: u32,
+    }
+}
+
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
+
+align_const! {
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+}
+
+pub const HWCAP_LOONGARCH_CPUCFG: ::c_ulong = 1 << 0;
+pub const HWCAP_LOONGARCH_LAM: ::c_ulong = 1 << 1;
+pub const HWCAP_LOONGARCH_UAL: ::c_ulong = 1 << 2;
+pub const HWCAP_LOONGARCH_FPU: ::c_ulong = 1 << 3;
+pub const HWCAP_LOONGARCH_LSX: ::c_ulong = 1 << 4;
+pub const HWCAP_LOONGARCH_LASX: ::c_ulong = 1 << 5;
+pub const HWCAP_LOONGARCH_CRC32: ::c_ulong = 1 << 6;
+pub const HWCAP_LOONGARCH_COMPLEX: ::c_ulong = 1 << 7;
+pub const HWCAP_LOONGARCH_CRYPTO: ::c_ulong = 1 << 8;
+pub const HWCAP_LOONGARCH_LVZ: ::c_ulong = 1 << 9;
+pub const HWCAP_LOONGARCH_LBT_X86: ::c_ulong = 1 << 10;
+pub const HWCAP_LOONGARCH_LBT_ARM: ::c_ulong = 1 << 11;
+pub const HWCAP_LOONGARCH_LBT_MIPS: ::c_ulong = 1 << 12;
+pub const HWCAP_LOONGARCH_PTW: ::c_ulong = 1 << 13;
+
+pub const SYS_io_setup: ::c_long = 0;
+pub const SYS_io_destroy: ::c_long = 1;
+pub const SYS_io_submit: ::c_long = 2;
+pub const SYS_io_cancel: ::c_long = 3;
+pub const SYS_io_getevents: ::c_long = 4;
+pub const SYS_setxattr: ::c_long = 5;
+pub const SYS_lsetxattr: ::c_long = 6;
+pub const SYS_fsetxattr: ::c_long = 7;
+pub const SYS_getxattr: ::c_long = 8;
+pub const SYS_lgetxattr: ::c_long = 9;
+pub const SYS_fgetxattr: ::c_long = 10;
+pub const SYS_listxattr: ::c_long = 11;
+pub const SYS_llistxattr: ::c_long = 12;
+pub const SYS_flistxattr: ::c_long = 13;
+pub const SYS_removexattr: ::c_long = 14;
+pub const SYS_lremovexattr: ::c_long = 15;
+pub const SYS_fremovexattr: ::c_long = 16;
+pub const SYS_getcwd: ::c_long = 17;
+pub const SYS_lookup_dcookie: ::c_long = 18;
+pub const SYS_eventfd2: ::c_long = 19;
+pub const SYS_epoll_create1: ::c_long = 20;
+pub const SYS_epoll_ctl: ::c_long = 21;
+pub const SYS_epoll_pwait: ::c_long = 22;
+pub const SYS_dup: ::c_long = 23;
+pub const SYS_dup3: ::c_long = 24;
+pub const SYS_fcntl: ::c_long = 25;
+pub const SYS_inotify_init1: ::c_long = 26;
+pub const SYS_inotify_add_watch: ::c_long = 27;
+pub const SYS_inotify_rm_watch: ::c_long = 28;
+pub const SYS_ioctl: ::c_long = 29;
+pub const SYS_ioprio_set: ::c_long = 30;
+pub const SYS_ioprio_get: ::c_long = 31;
+pub const SYS_flock: ::c_long = 32;
+pub const SYS_mknodat: ::c_long = 33;
+pub const SYS_mkdirat: ::c_long = 34;
+pub const SYS_unlinkat: ::c_long = 35;
+pub const SYS_symlinkat: ::c_long = 36;
+pub const SYS_linkat: ::c_long = 37;
+pub const SYS_umount2: ::c_long = 39;
+pub const SYS_mount: ::c_long = 40;
+pub const SYS_pivot_root: ::c_long = 41;
+pub const SYS_nfsservctl: ::c_long = 42;
+pub const SYS_statfs: ::c_long = 43;
+pub const SYS_fstatfs: ::c_long = 44;
+pub const SYS_truncate: ::c_long = 45;
+pub const SYS_ftruncate: ::c_long = 46;
+pub const SYS_fallocate: ::c_long = 47;
+pub const SYS_faccessat: ::c_long = 48;
+pub const SYS_chdir: ::c_long = 49;
+pub const SYS_fchdir: ::c_long = 50;
+pub const SYS_chroot: ::c_long = 51;
+pub const SYS_fchmod: ::c_long = 52;
+pub const SYS_fchmodat: ::c_long = 53;
+pub const SYS_fchownat: ::c_long = 54;
+pub const SYS_fchown: ::c_long = 55;
+pub const SYS_openat: ::c_long = 56;
+pub const SYS_close: ::c_long = 57;
+pub const SYS_vhangup: ::c_long = 58;
+pub const SYS_pipe2: ::c_long = 59;
+pub const SYS_quotactl: ::c_long = 60;
+pub const SYS_getdents64: ::c_long = 61;
+pub const SYS_lseek: ::c_long = 62;
+pub const SYS_read: ::c_long = 63;
+pub const SYS_write: ::c_long = 64;
+pub const SYS_readv: ::c_long = 65;
+pub const SYS_writev: ::c_long = 66;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_preadv: ::c_long = 69;
+pub const SYS_pwritev: ::c_long = 70;
+pub const SYS_sendfile: ::c_long = 71;
+pub const SYS_pselect6: ::c_long = 72;
+pub const SYS_ppoll: ::c_long = 73;
+pub const SYS_signalfd4: ::c_long = 74;
+pub const SYS_vmsplice: ::c_long = 75;
+pub const SYS_splice: ::c_long = 76;
+pub const SYS_tee: ::c_long = 77;
+pub const SYS_readlinkat: ::c_long = 78;
+pub const SYS_sync: ::c_long = 81;
+pub const SYS_fsync: ::c_long = 82;
+pub const SYS_fdatasync: ::c_long = 83;
+pub const SYS_sync_file_range: ::c_long = 84;
+pub const SYS_timerfd_create: ::c_long = 85;
+pub const SYS_timerfd_settime: ::c_long = 86;
+pub const SYS_timerfd_gettime: ::c_long = 87;
+pub const SYS_utimensat: ::c_long = 88;
+pub const SYS_acct: ::c_long = 89;
+pub const SYS_capget: ::c_long = 90;
+pub const SYS_capset: ::c_long = 91;
+pub const SYS_personality: ::c_long = 92;
+pub const SYS_exit: ::c_long = 93;
+pub const SYS_exit_group: ::c_long = 94;
+pub const SYS_waitid: ::c_long = 95;
+pub const SYS_set_tid_address: ::c_long = 96;
+pub const SYS_unshare: ::c_long = 97;
+pub const SYS_futex: ::c_long = 98;
+pub const SYS_set_robust_list: ::c_long = 99;
+pub const SYS_get_robust_list: ::c_long = 100;
+pub const SYS_nanosleep: ::c_long = 101;
+pub const SYS_getitimer: ::c_long = 102;
+pub const SYS_setitimer: ::c_long = 103;
+pub const SYS_kexec_load: ::c_long = 104;
+pub const SYS_init_module: ::c_long = 105;
+pub const SYS_delete_module: ::c_long = 106;
+pub const SYS_timer_create: ::c_long = 107;
+pub const SYS_timer_gettime: ::c_long = 108;
+pub const SYS_timer_getoverrun: ::c_long = 109;
+pub const SYS_timer_settime: ::c_long = 110;
+pub const SYS_timer_delete: ::c_long = 111;
+pub const SYS_clock_settime: ::c_long = 112;
+pub const SYS_clock_gettime: ::c_long = 113;
+pub const SYS_clock_getres: ::c_long = 114;
+pub const SYS_clock_nanosleep: ::c_long = 115;
+pub const SYS_syslog: ::c_long = 116;
+pub const SYS_ptrace: ::c_long = 117;
+pub const SYS_sched_setparam: ::c_long = 118;
+pub const SYS_sched_setscheduler: ::c_long = 119;
+pub const SYS_sched_getscheduler: ::c_long = 120;
+pub const SYS_sched_getparam: ::c_long = 121;
+pub const SYS_sched_setaffinity: ::c_long = 122;
+pub const SYS_sched_getaffinity: ::c_long = 123;
+pub const SYS_sched_yield: ::c_long = 124;
+pub const SYS_sched_get_priority_max: ::c_long = 125;
+pub const SYS_sched_get_priority_min: ::c_long = 126;
+pub const SYS_sched_rr_get_interval: ::c_long = 127;
+pub const SYS_restart_syscall: ::c_long = 128;
+pub const SYS_kill: ::c_long = 129;
+pub const SYS_tkill: ::c_long = 130;
+pub const SYS_tgkill: ::c_long = 131;
+pub const SYS_sigaltstack: ::c_long = 132;
+pub const SYS_rt_sigsuspend: ::c_long = 133;
+pub const SYS_rt_sigaction: ::c_long = 134;
+pub const SYS_rt_sigprocmask: ::c_long = 135;
+pub const SYS_rt_sigpending: ::c_long = 136;
+pub const SYS_rt_sigtimedwait: ::c_long = 137;
+pub const SYS_rt_sigqueueinfo: ::c_long = 138;
+pub const SYS_rt_sigreturn: ::c_long = 139;
+pub const SYS_setpriority: ::c_long = 140;
+pub const SYS_getpriority: ::c_long = 141;
+pub const SYS_reboot: ::c_long = 142;
+pub const SYS_setregid: ::c_long = 143;
+pub const SYS_setgid: ::c_long = 144;
+pub const SYS_setreuid: ::c_long = 145;
+pub const SYS_setuid: ::c_long = 146;
+pub const SYS_setresuid: ::c_long = 147;
+pub const SYS_getresuid: ::c_long = 148;
+pub const SYS_setresgid: ::c_long = 149;
+pub const SYS_getresgid: ::c_long = 150;
+pub const SYS_setfsuid: ::c_long = 151;
+pub const SYS_setfsgid: ::c_long = 152;
+pub const SYS_times: ::c_long = 153;
+pub const SYS_setpgid: ::c_long = 154;
+pub const SYS_getpgid: ::c_long = 155;
+pub const SYS_getsid: ::c_long = 156;
+pub const SYS_setsid: ::c_long = 157;
+pub const SYS_getgroups: ::c_long = 158;
+pub const SYS_setgroups: ::c_long = 159;
+pub const SYS_uname: ::c_long = 160;
+pub const SYS_sethostname: ::c_long = 161;
+pub const SYS_setdomainname: ::c_long = 162;
+pub const SYS_getrusage: ::c_long = 165;
+pub const SYS_umask: ::c_long = 166;
+pub const SYS_prctl: ::c_long = 167;
+pub const SYS_getcpu: ::c_long = 168;
+pub const SYS_gettimeofday: ::c_long = 169;
+pub const SYS_settimeofday: ::c_long = 170;
+pub const SYS_adjtimex: ::c_long = 171;
+pub const SYS_getpid: ::c_long = 172;
+pub const SYS_getppid: ::c_long = 173;
+pub const SYS_getuid: ::c_long = 174;
+pub const SYS_geteuid: ::c_long = 175;
+pub const SYS_getgid: ::c_long = 176;
+pub const SYS_getegid: ::c_long = 177;
+pub const SYS_gettid: ::c_long = 178;
+pub const SYS_sysinfo: ::c_long = 179;
+pub const SYS_mq_open: ::c_long = 180;
+pub const SYS_mq_unlink: ::c_long = 181;
+pub const SYS_mq_timedsend: ::c_long = 182;
+pub const SYS_mq_timedreceive: ::c_long = 183;
+pub const SYS_mq_notify: ::c_long = 184;
+pub const SYS_mq_getsetattr: ::c_long = 185;
+pub const SYS_msgget: ::c_long = 186;
+pub const SYS_msgctl: ::c_long = 187;
+pub const SYS_msgrcv: ::c_long = 188;
+pub const SYS_msgsnd: ::c_long = 189;
+pub const SYS_semget: ::c_long = 190;
+pub const SYS_semctl: ::c_long = 191;
+pub const SYS_semtimedop: ::c_long = 192;
+pub const SYS_semop: ::c_long = 193;
+pub const SYS_shmget: ::c_long = 194;
+pub const SYS_shmctl: ::c_long = 195;
+pub const SYS_shmat: ::c_long = 196;
+pub const SYS_shmdt: ::c_long = 197;
+pub const SYS_socket: ::c_long = 198;
+pub const SYS_socketpair: ::c_long = 199;
+pub const SYS_bind: ::c_long = 200;
+pub const SYS_listen: ::c_long = 201;
+pub const SYS_accept: ::c_long = 202;
+pub const SYS_connect: ::c_long = 203;
+pub const SYS_getsockname: ::c_long = 204;
+pub const SYS_getpeername: ::c_long = 205;
+pub const SYS_sendto: ::c_long = 206;
+pub const SYS_recvfrom: ::c_long = 207;
+pub const SYS_setsockopt: ::c_long = 208;
+pub const SYS_getsockopt: ::c_long = 209;
+pub const SYS_shutdown: ::c_long = 210;
+pub const SYS_sendmsg: ::c_long = 211;
+pub const SYS_recvmsg: ::c_long = 212;
+pub const SYS_readahead: ::c_long = 213;
+pub const SYS_brk: ::c_long = 214;
+pub const SYS_munmap: ::c_long = 215;
+pub const SYS_mremap: ::c_long = 216;
+pub const SYS_add_key: ::c_long = 217;
+pub const SYS_request_key: ::c_long = 218;
+pub const SYS_keyctl: ::c_long = 219;
+pub const SYS_clone: ::c_long = 220;
+pub const SYS_execve: ::c_long = 221;
+pub const SYS_mmap: ::c_long = 222;
+pub const SYS_fadvise64: ::c_long = 223;
+pub const SYS_swapon: ::c_long = 224;
+pub const SYS_swapoff: ::c_long = 225;
+pub const SYS_mprotect: ::c_long = 226;
+pub const SYS_msync: ::c_long = 227;
+pub const SYS_mlock: ::c_long = 228;
+pub const SYS_munlock: ::c_long = 229;
+pub const SYS_mlockall: ::c_long = 230;
+pub const SYS_munlockall: ::c_long = 231;
+pub const SYS_mincore: ::c_long = 232;
+pub const SYS_madvise: ::c_long = 233;
+pub const SYS_remap_file_pages: ::c_long = 234;
+pub const SYS_mbind: ::c_long = 235;
+pub const SYS_get_mempolicy: ::c_long = 236;
+pub const SYS_set_mempolicy: ::c_long = 237;
+pub const SYS_migrate_pages: ::c_long = 238;
+pub const SYS_move_pages: ::c_long = 239;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
+pub const SYS_perf_event_open: ::c_long = 241;
+pub const SYS_accept4: ::c_long = 242;
+pub const SYS_recvmmsg: ::c_long = 243;
+//pub const SYS_arch_specific_syscall: ::c_long = 244;
+pub const SYS_wait4: ::c_long = 260;
+pub const SYS_prlimit64: ::c_long = 261;
+pub const SYS_fanotify_init: ::c_long = 262;
+pub const SYS_fanotify_mark: ::c_long = 263;
+pub const SYS_name_to_handle_at: ::c_long = 264;
+pub const SYS_open_by_handle_at: ::c_long = 265;
+pub const SYS_clock_adjtime: ::c_long = 266;
+pub const SYS_syncfs: ::c_long = 267;
+pub const SYS_setns: ::c_long = 268;
+pub const SYS_sendmmsg: ::c_long = 269;
+pub const SYS_process_vm_readv: ::c_long = 270;
+pub const SYS_process_vm_writev: ::c_long = 271;
+pub const SYS_kcmp: ::c_long = 272;
+pub const SYS_finit_module: ::c_long = 273;
+pub const SYS_sched_setattr: ::c_long = 274;
+pub const SYS_sched_getattr: ::c_long = 275;
+pub const SYS_renameat2: ::c_long = 276;
+pub const SYS_seccomp: ::c_long = 277;
+pub const SYS_getrandom: ::c_long = 278;
+pub const SYS_memfd_create: ::c_long = 279;
+pub const SYS_bpf: ::c_long = 280;
+pub const SYS_execveat: ::c_long = 281;
+pub const SYS_userfaultfd: ::c_long = 282;
+pub const SYS_membarrier: ::c_long = 283;
+pub const SYS_mlock2: ::c_long = 284;
+pub const SYS_copy_file_range: ::c_long = 285;
+pub const SYS_preadv2: ::c_long = 286;
+pub const SYS_pwritev2: ::c_long = 287;
+pub const SYS_pkey_mprotect: ::c_long = 288;
+pub const SYS_pkey_alloc: ::c_long = 289;
+pub const SYS_pkey_free: ::c_long = 290;
+pub const SYS_statx: ::c_long = 291;
+pub const SYS_io_pgetevents: ::c_long = 292;
+pub const SYS_rseq: ::c_long = 293;
+pub const SYS_kexec_file_load: ::c_long = 294;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+pub const POSIX_FADV_DONTNEED: ::c_int = 4;
+pub const POSIX_FADV_NOREUSE: ::c_int = 5;
+pub const O_DIRECT: ::c_int = 0o00040000;
+pub const O_DIRECTORY: ::c_int = 0o00200000;
+pub const O_NOFOLLOW: ::c_int = 0o00400000;
+pub const O_TRUNC: ::c_int = 0o00001000;
+pub const O_NOATIME: ::c_int = 0o1000000;
+pub const O_CLOEXEC: ::c_int = 0o02000000;
+pub const O_PATH: ::c_int = 0o10000000;
+pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
+pub const O_APPEND: ::c_int = 0o00002000;
+pub const O_CREAT: ::c_int = 0o00000100;
+pub const O_EXCL: ::c_int = 0o00000200;
+pub const O_NOCTTY: ::c_int = 0o00000400;
+pub const O_NONBLOCK: ::c_int = 0o00004000;
+pub const FASYNC: ::c_int = 0o00020000;
+pub const O_SYNC: ::c_int = 0o04010000;
+pub const O_RSYNC: ::c_int = 0o04010000;
+pub const O_FSYNC: ::c_int = O_SYNC;
+pub const O_ASYNC: ::c_int = 0o00020000;
+pub const O_DSYNC: ::c_int = 0o00010000;
+pub const O_NDELAY: ::c_int = O_NONBLOCK;
+pub const F_RDLCK: ::c_int = 0;
+pub const F_WRLCK: ::c_int = 1;
+pub const F_UNLCK: ::c_int = 2;
+pub const F_GETLK: ::c_int = 5;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+pub const F_SETOWN: ::c_int = 8;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_OFD_GETLK: ::c_int = 36;
+pub const F_OFD_SETLK: ::c_int = 37;
+pub const F_OFD_SETLKW: ::c_int = 38;
+
+pub const EDEADLK: ::c_int = 35;
+pub const EDEADLOCK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EBFONT: ::c_int = 59;
+pub const ENOSTR: ::c_int = 60;
+pub const ENODATA: ::c_int = 61;
+pub const ETIME: ::c_int = 62;
+pub const ENOSR: ::c_int = 63;
+pub const ENONET: ::c_int = 64;
+pub const ENOPKG: ::c_int = 65;
+pub const EREMOTE: ::c_int = 66;
+pub const ENOLINK: ::c_int = 67;
+pub const EADV: ::c_int = 68;
+pub const ESRMNT: ::c_int = 69;
+pub const ECOMM: ::c_int = 70;
+pub const EPROTO: ::c_int = 71;
+pub const EDOTDOT: ::c_int = 73;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EBADMSG: ::c_int = 74;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const ERFKILL: ::c_int = 132;
+pub const EHWPOISON: ::c_int = 133;
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+
+pub const MAP_NORESERVE: ::c_int = 0x4000;
+pub const MAP_ANONYMOUS: ::c_int = 0x0020;
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x1000;
+pub const MAP_LOCKED: ::c_int = 0x2000;
+pub const MAP_POPULATE: ::c_int = 0x8000;
+pub const MAP_NONBLOCK: ::c_int = 0x10000;
+pub const MAP_STACK: ::c_int = 0x20000;
+pub const MAP_HUGETLB: ::c_int = 0x40000;
+pub const MAP_SYNC: ::c_int = 0x080000;
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const SFD_NONBLOCK: ::c_int = 0x800;
+pub const SFD_CLOEXEC: ::c_int = 0x080000;
+pub const SA_NODEFER: ::c_int = 0x40000000;
+pub const SA_RESETHAND: ::c_int = 0x80000000;
+pub const SA_RESTART: ::c_int = 0x10000000;
+pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+pub const SIG_BLOCK: ::c_int = 0;
+pub const SIG_UNBLOCK: ::c_int = 1;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGSTKFLT: ::c_int = 16;
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGURG: ::c_int = 23;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGIO: ::c_int = 29;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGUNUSED: ::c_int = 31;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const PTRACE_GETFPREGS: ::c_uint = 14;
+pub const PTRACE_SETFPREGS: ::c_uint = 15;
+pub const PTRACE_DETACH: ::c_uint = 17;
+pub const PTRACE_GETFPXREGS: ::c_uint = 18;
+pub const PTRACE_SETFPXREGS: ::c_uint = 19;
+pub const PTRACE_GETREGS: ::c_uint = 12;
+pub const PTRACE_SETREGS: ::c_uint = 13;
+pub const PTRACE_SYSEMU: ::c_uint = 31;
+pub const PTRACE_SYSEMU_SINGLESTEP: ::c_uint = 32;
+
+pub const RTLD_DEEPBIND: ::c_int = 0x8;
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+
+pub const VEOF: usize = 4;
+pub const VTIME: usize = 5;
+pub const VMIN: usize = 6;
+pub const VSWTC: usize = 7;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VSUSP: usize = 10;
+pub const VEOL: usize = 11;
+pub const VREPRINT: usize = 12;
+pub const VDISCARD: usize = 13;
+pub const VWERASE: usize = 14;
+pub const VEOL2: usize = 16;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+pub const SIGSTKSZ: ::size_t = 16384;
+pub const MINSIGSTKSZ: ::size_t = 4096;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const XCASE: ::tcflag_t = 0x00000004;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+
+pub const NCCS: usize = 32;
+
+pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
+
+pub const EFD_CLOEXEC: ::c_int = 0x80000;
+pub const EFD_NONBLOCK: ::c_int = 0x800;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f64; 4]
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,934 @@
+use pthread_mutex_t;
+
+pub type blksize_t = i64;
+pub type c_char = i8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type nlink_t = u64;
+pub type suseconds_t = i64;
+pub type wchar_t = i32;
+pub type __u64 = ::c_ulong;
+pub type __s64 = ::c_long;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::c_ulong,
+        st_pad1: [::c_long; 2],
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulong,
+        st_pad2: [::c_ulong; 1],
+        pub st_size: ::off_t,
+        st_pad3: ::c_long,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_blksize: ::blksize_t,
+        st_pad4: ::c_long,
+        pub st_blocks: ::blkcnt_t,
+        st_pad5: [::c_long; 7],
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        pub f_frsize: ::c_long,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_files: ::fsblkcnt_t,
+        pub f_ffree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_fsid: ::fsid_t,
+
+        pub f_namelen: ::c_long,
+        f_spare: [::c_long; 6],
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct flock64 {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off64_t,
+        pub l_len: ::off64_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::c_ulong,
+        st_pad1: [::c_long; 2],
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulong,
+        st_pad2: [::c_long; 2],
+        pub st_size: ::off64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_blksize: ::blksize_t,
+        st_pad3: ::c_long,
+        pub st_blocks: ::blkcnt64_t,
+        st_pad5: [::c_long; 7],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        pub f_frsize: ::c_long,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_bavail: u64,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_long,
+        pub f_flags: ::c_long,
+        pub f_spare: [::c_long; 5],
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct pthread_attr_t {
+        __size: [::c_ulong; 7]
+    }
+
+    pub struct sigaction {
+        pub sa_flags: ::c_int,
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_size: ::size_t,
+        pub ss_flags: ::c_int,
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_code: ::c_int,
+        pub si_errno: ::c_int,
+        _pad: ::c_int,
+        _pad2: [::c_long; 14],
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::c_uint,
+        pub __seq: ::c_ushort,
+        __pad1: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+}
+
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
+
+align_const! {
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+}
+
+pub const SYS_read: ::c_long = 5000 + 0;
+pub const SYS_write: ::c_long = 5000 + 1;
+pub const SYS_open: ::c_long = 5000 + 2;
+pub const SYS_close: ::c_long = 5000 + 3;
+pub const SYS_stat: ::c_long = 5000 + 4;
+pub const SYS_fstat: ::c_long = 5000 + 5;
+pub const SYS_lstat: ::c_long = 5000 + 6;
+pub const SYS_poll: ::c_long = 5000 + 7;
+pub const SYS_lseek: ::c_long = 5000 + 8;
+pub const SYS_mmap: ::c_long = 5000 + 9;
+pub const SYS_mprotect: ::c_long = 5000 + 10;
+pub const SYS_munmap: ::c_long = 5000 + 11;
+pub const SYS_brk: ::c_long = 5000 + 12;
+pub const SYS_rt_sigaction: ::c_long = 5000 + 13;
+pub const SYS_rt_sigprocmask: ::c_long = 5000 + 14;
+pub const SYS_ioctl: ::c_long = 5000 + 15;
+pub const SYS_pread64: ::c_long = 5000 + 16;
+pub const SYS_pwrite64: ::c_long = 5000 + 17;
+pub const SYS_readv: ::c_long = 5000 + 18;
+pub const SYS_writev: ::c_long = 5000 + 19;
+pub const SYS_access: ::c_long = 5000 + 20;
+pub const SYS_pipe: ::c_long = 5000 + 21;
+pub const SYS__newselect: ::c_long = 5000 + 22;
+pub const SYS_sched_yield: ::c_long = 5000 + 23;
+pub const SYS_mremap: ::c_long = 5000 + 24;
+pub const SYS_msync: ::c_long = 5000 + 25;
+pub const SYS_mincore: ::c_long = 5000 + 26;
+pub const SYS_madvise: ::c_long = 5000 + 27;
+pub const SYS_shmget: ::c_long = 5000 + 28;
+pub const SYS_shmat: ::c_long = 5000 + 29;
+pub const SYS_shmctl: ::c_long = 5000 + 30;
+pub const SYS_dup: ::c_long = 5000 + 31;
+pub const SYS_dup2: ::c_long = 5000 + 32;
+pub const SYS_pause: ::c_long = 5000 + 33;
+pub const SYS_nanosleep: ::c_long = 5000 + 34;
+pub const SYS_getitimer: ::c_long = 5000 + 35;
+pub const SYS_setitimer: ::c_long = 5000 + 36;
+pub const SYS_alarm: ::c_long = 5000 + 37;
+pub const SYS_getpid: ::c_long = 5000 + 38;
+pub const SYS_sendfile: ::c_long = 5000 + 39;
+pub const SYS_socket: ::c_long = 5000 + 40;
+pub const SYS_connect: ::c_long = 5000 + 41;
+pub const SYS_accept: ::c_long = 5000 + 42;
+pub const SYS_sendto: ::c_long = 5000 + 43;
+pub const SYS_recvfrom: ::c_long = 5000 + 44;
+pub const SYS_sendmsg: ::c_long = 5000 + 45;
+pub const SYS_recvmsg: ::c_long = 5000 + 46;
+pub const SYS_shutdown: ::c_long = 5000 + 47;
+pub const SYS_bind: ::c_long = 5000 + 48;
+pub const SYS_listen: ::c_long = 5000 + 49;
+pub const SYS_getsockname: ::c_long = 5000 + 50;
+pub const SYS_getpeername: ::c_long = 5000 + 51;
+pub const SYS_socketpair: ::c_long = 5000 + 52;
+pub const SYS_setsockopt: ::c_long = 5000 + 53;
+pub const SYS_getsockopt: ::c_long = 5000 + 54;
+pub const SYS_clone: ::c_long = 5000 + 55;
+pub const SYS_fork: ::c_long = 5000 + 56;
+pub const SYS_execve: ::c_long = 5000 + 57;
+pub const SYS_exit: ::c_long = 5000 + 58;
+pub const SYS_wait4: ::c_long = 5000 + 59;
+pub const SYS_kill: ::c_long = 5000 + 60;
+pub const SYS_uname: ::c_long = 5000 + 61;
+pub const SYS_semget: ::c_long = 5000 + 62;
+pub const SYS_semop: ::c_long = 5000 + 63;
+pub const SYS_semctl: ::c_long = 5000 + 64;
+pub const SYS_shmdt: ::c_long = 5000 + 65;
+pub const SYS_msgget: ::c_long = 5000 + 66;
+pub const SYS_msgsnd: ::c_long = 5000 + 67;
+pub const SYS_msgrcv: ::c_long = 5000 + 68;
+pub const SYS_msgctl: ::c_long = 5000 + 69;
+pub const SYS_fcntl: ::c_long = 5000 + 70;
+pub const SYS_flock: ::c_long = 5000 + 71;
+pub const SYS_fsync: ::c_long = 5000 + 72;
+pub const SYS_fdatasync: ::c_long = 5000 + 73;
+pub const SYS_truncate: ::c_long = 5000 + 74;
+pub const SYS_ftruncate: ::c_long = 5000 + 75;
+pub const SYS_getdents: ::c_long = 5000 + 76;
+pub const SYS_getcwd: ::c_long = 5000 + 77;
+pub const SYS_chdir: ::c_long = 5000 + 78;
+pub const SYS_fchdir: ::c_long = 5000 + 79;
+pub const SYS_rename: ::c_long = 5000 + 80;
+pub const SYS_mkdir: ::c_long = 5000 + 81;
+pub const SYS_rmdir: ::c_long = 5000 + 82;
+pub const SYS_creat: ::c_long = 5000 + 83;
+pub const SYS_link: ::c_long = 5000 + 84;
+pub const SYS_unlink: ::c_long = 5000 + 85;
+pub const SYS_symlink: ::c_long = 5000 + 86;
+pub const SYS_readlink: ::c_long = 5000 + 87;
+pub const SYS_chmod: ::c_long = 5000 + 88;
+pub const SYS_fchmod: ::c_long = 5000 + 89;
+pub const SYS_chown: ::c_long = 5000 + 90;
+pub const SYS_fchown: ::c_long = 5000 + 91;
+pub const SYS_lchown: ::c_long = 5000 + 92;
+pub const SYS_umask: ::c_long = 5000 + 93;
+pub const SYS_gettimeofday: ::c_long = 5000 + 94;
+pub const SYS_getrlimit: ::c_long = 5000 + 95;
+pub const SYS_getrusage: ::c_long = 5000 + 96;
+pub const SYS_sysinfo: ::c_long = 5000 + 97;
+pub const SYS_times: ::c_long = 5000 + 98;
+pub const SYS_ptrace: ::c_long = 5000 + 99;
+pub const SYS_getuid: ::c_long = 5000 + 100;
+pub const SYS_syslog: ::c_long = 5000 + 101;
+pub const SYS_getgid: ::c_long = 5000 + 102;
+pub const SYS_setuid: ::c_long = 5000 + 103;
+pub const SYS_setgid: ::c_long = 5000 + 104;
+pub const SYS_geteuid: ::c_long = 5000 + 105;
+pub const SYS_getegid: ::c_long = 5000 + 106;
+pub const SYS_setpgid: ::c_long = 5000 + 107;
+pub const SYS_getppid: ::c_long = 5000 + 108;
+pub const SYS_getpgrp: ::c_long = 5000 + 109;
+pub const SYS_setsid: ::c_long = 5000 + 110;
+pub const SYS_setreuid: ::c_long = 5000 + 111;
+pub const SYS_setregid: ::c_long = 5000 + 112;
+pub const SYS_getgroups: ::c_long = 5000 + 113;
+pub const SYS_setgroups: ::c_long = 5000 + 114;
+pub const SYS_setresuid: ::c_long = 5000 + 115;
+pub const SYS_getresuid: ::c_long = 5000 + 116;
+pub const SYS_setresgid: ::c_long = 5000 + 117;
+pub const SYS_getresgid: ::c_long = 5000 + 118;
+pub const SYS_getpgid: ::c_long = 5000 + 119;
+pub const SYS_setfsuid: ::c_long = 5000 + 120;
+pub const SYS_setfsgid: ::c_long = 5000 + 121;
+pub const SYS_getsid: ::c_long = 5000 + 122;
+pub const SYS_capget: ::c_long = 5000 + 123;
+pub const SYS_capset: ::c_long = 5000 + 124;
+pub const SYS_rt_sigpending: ::c_long = 5000 + 125;
+pub const SYS_rt_sigtimedwait: ::c_long = 5000 + 126;
+pub const SYS_rt_sigqueueinfo: ::c_long = 5000 + 127;
+pub const SYS_rt_sigsuspend: ::c_long = 5000 + 128;
+pub const SYS_sigaltstack: ::c_long = 5000 + 129;
+pub const SYS_utime: ::c_long = 5000 + 130;
+pub const SYS_mknod: ::c_long = 5000 + 131;
+pub const SYS_personality: ::c_long = 5000 + 132;
+pub const SYS_ustat: ::c_long = 5000 + 133;
+pub const SYS_statfs: ::c_long = 5000 + 134;
+pub const SYS_fstatfs: ::c_long = 5000 + 135;
+pub const SYS_sysfs: ::c_long = 5000 + 136;
+pub const SYS_getpriority: ::c_long = 5000 + 137;
+pub const SYS_setpriority: ::c_long = 5000 + 138;
+pub const SYS_sched_setparam: ::c_long = 5000 + 139;
+pub const SYS_sched_getparam: ::c_long = 5000 + 140;
+pub const SYS_sched_setscheduler: ::c_long = 5000 + 141;
+pub const SYS_sched_getscheduler: ::c_long = 5000 + 142;
+pub const SYS_sched_get_priority_max: ::c_long = 5000 + 143;
+pub const SYS_sched_get_priority_min: ::c_long = 5000 + 144;
+pub const SYS_sched_rr_get_interval: ::c_long = 5000 + 145;
+pub const SYS_mlock: ::c_long = 5000 + 146;
+pub const SYS_munlock: ::c_long = 5000 + 147;
+pub const SYS_mlockall: ::c_long = 5000 + 148;
+pub const SYS_munlockall: ::c_long = 5000 + 149;
+pub const SYS_vhangup: ::c_long = 5000 + 150;
+pub const SYS_pivot_root: ::c_long = 5000 + 151;
+pub const SYS__sysctl: ::c_long = 5000 + 152;
+pub const SYS_prctl: ::c_long = 5000 + 153;
+pub const SYS_adjtimex: ::c_long = 5000 + 154;
+pub const SYS_setrlimit: ::c_long = 5000 + 155;
+pub const SYS_chroot: ::c_long = 5000 + 156;
+pub const SYS_sync: ::c_long = 5000 + 157;
+pub const SYS_acct: ::c_long = 5000 + 158;
+pub const SYS_settimeofday: ::c_long = 5000 + 159;
+pub const SYS_mount: ::c_long = 5000 + 160;
+pub const SYS_umount2: ::c_long = 5000 + 161;
+pub const SYS_swapon: ::c_long = 5000 + 162;
+pub const SYS_swapoff: ::c_long = 5000 + 163;
+pub const SYS_reboot: ::c_long = 5000 + 164;
+pub const SYS_sethostname: ::c_long = 5000 + 165;
+pub const SYS_setdomainname: ::c_long = 5000 + 166;
+pub const SYS_create_module: ::c_long = 5000 + 167;
+pub const SYS_init_module: ::c_long = 5000 + 168;
+pub const SYS_delete_module: ::c_long = 5000 + 169;
+pub const SYS_get_kernel_syms: ::c_long = 5000 + 170;
+pub const SYS_query_module: ::c_long = 5000 + 171;
+pub const SYS_quotactl: ::c_long = 5000 + 172;
+pub const SYS_nfsservctl: ::c_long = 5000 + 173;
+pub const SYS_getpmsg: ::c_long = 5000 + 174;
+pub const SYS_putpmsg: ::c_long = 5000 + 175;
+pub const SYS_afs_syscall: ::c_long = 5000 + 176;
+pub const SYS_gettid: ::c_long = 5000 + 178;
+pub const SYS_readahead: ::c_long = 5000 + 179;
+pub const SYS_setxattr: ::c_long = 5000 + 180;
+pub const SYS_lsetxattr: ::c_long = 5000 + 181;
+pub const SYS_fsetxattr: ::c_long = 5000 + 182;
+pub const SYS_getxattr: ::c_long = 5000 + 183;
+pub const SYS_lgetxattr: ::c_long = 5000 + 184;
+pub const SYS_fgetxattr: ::c_long = 5000 + 185;
+pub const SYS_listxattr: ::c_long = 5000 + 186;
+pub const SYS_llistxattr: ::c_long = 5000 + 187;
+pub const SYS_flistxattr: ::c_long = 5000 + 188;
+pub const SYS_removexattr: ::c_long = 5000 + 189;
+pub const SYS_lremovexattr: ::c_long = 5000 + 190;
+pub const SYS_fremovexattr: ::c_long = 5000 + 191;
+pub const SYS_tkill: ::c_long = 5000 + 192;
+pub const SYS_futex: ::c_long = 5000 + 194;
+pub const SYS_sched_setaffinity: ::c_long = 5000 + 195;
+pub const SYS_sched_getaffinity: ::c_long = 5000 + 196;
+pub const SYS_cacheflush: ::c_long = 5000 + 197;
+pub const SYS_cachectl: ::c_long = 5000 + 198;
+pub const SYS_sysmips: ::c_long = 5000 + 199;
+pub const SYS_io_setup: ::c_long = 5000 + 200;
+pub const SYS_io_destroy: ::c_long = 5000 + 201;
+pub const SYS_io_getevents: ::c_long = 5000 + 202;
+pub const SYS_io_submit: ::c_long = 5000 + 203;
+pub const SYS_io_cancel: ::c_long = 5000 + 204;
+pub const SYS_exit_group: ::c_long = 5000 + 205;
+pub const SYS_lookup_dcookie: ::c_long = 5000 + 206;
+pub const SYS_epoll_create: ::c_long = 5000 + 207;
+pub const SYS_epoll_ctl: ::c_long = 5000 + 208;
+pub const SYS_epoll_wait: ::c_long = 5000 + 209;
+pub const SYS_remap_file_pages: ::c_long = 5000 + 210;
+pub const SYS_rt_sigreturn: ::c_long = 5000 + 211;
+pub const SYS_set_tid_address: ::c_long = 5000 + 212;
+pub const SYS_restart_syscall: ::c_long = 5000 + 213;
+pub const SYS_semtimedop: ::c_long = 5000 + 214;
+pub const SYS_fadvise64: ::c_long = 5000 + 215;
+pub const SYS_timer_create: ::c_long = 5000 + 216;
+pub const SYS_timer_settime: ::c_long = 5000 + 217;
+pub const SYS_timer_gettime: ::c_long = 5000 + 218;
+pub const SYS_timer_getoverrun: ::c_long = 5000 + 219;
+pub const SYS_timer_delete: ::c_long = 5000 + 220;
+pub const SYS_clock_settime: ::c_long = 5000 + 221;
+pub const SYS_clock_gettime: ::c_long = 5000 + 222;
+pub const SYS_clock_getres: ::c_long = 5000 + 223;
+pub const SYS_clock_nanosleep: ::c_long = 5000 + 224;
+pub const SYS_tgkill: ::c_long = 5000 + 225;
+pub const SYS_utimes: ::c_long = 5000 + 226;
+pub const SYS_mbind: ::c_long = 5000 + 227;
+pub const SYS_get_mempolicy: ::c_long = 5000 + 228;
+pub const SYS_set_mempolicy: ::c_long = 5000 + 229;
+pub const SYS_mq_open: ::c_long = 5000 + 230;
+pub const SYS_mq_unlink: ::c_long = 5000 + 231;
+pub const SYS_mq_timedsend: ::c_long = 5000 + 232;
+pub const SYS_mq_timedreceive: ::c_long = 5000 + 233;
+pub const SYS_mq_notify: ::c_long = 5000 + 234;
+pub const SYS_mq_getsetattr: ::c_long = 5000 + 235;
+pub const SYS_vserver: ::c_long = 5000 + 236;
+pub const SYS_waitid: ::c_long = 5000 + 237;
+/* pub const SYS_sys_setaltroot: ::c_long = 5000 + 238; */
+pub const SYS_add_key: ::c_long = 5000 + 239;
+pub const SYS_request_key: ::c_long = 5000 + 240;
+pub const SYS_keyctl: ::c_long = 5000 + 241;
+pub const SYS_set_thread_area: ::c_long = 5000 + 242;
+pub const SYS_inotify_init: ::c_long = 5000 + 243;
+pub const SYS_inotify_add_watch: ::c_long = 5000 + 244;
+pub const SYS_inotify_rm_watch: ::c_long = 5000 + 245;
+pub const SYS_migrate_pages: ::c_long = 5000 + 246;
+pub const SYS_openat: ::c_long = 5000 + 247;
+pub const SYS_mkdirat: ::c_long = 5000 + 248;
+pub const SYS_mknodat: ::c_long = 5000 + 249;
+pub const SYS_fchownat: ::c_long = 5000 + 250;
+pub const SYS_futimesat: ::c_long = 5000 + 251;
+pub const SYS_newfstatat: ::c_long = 5000 + 252;
+pub const SYS_unlinkat: ::c_long = 5000 + 253;
+pub const SYS_renameat: ::c_long = 5000 + 254;
+pub const SYS_linkat: ::c_long = 5000 + 255;
+pub const SYS_symlinkat: ::c_long = 5000 + 256;
+pub const SYS_readlinkat: ::c_long = 5000 + 257;
+pub const SYS_fchmodat: ::c_long = 5000 + 258;
+pub const SYS_faccessat: ::c_long = 5000 + 259;
+pub const SYS_pselect6: ::c_long = 5000 + 260;
+pub const SYS_ppoll: ::c_long = 5000 + 261;
+pub const SYS_unshare: ::c_long = 5000 + 262;
+pub const SYS_splice: ::c_long = 5000 + 263;
+pub const SYS_sync_file_range: ::c_long = 5000 + 264;
+pub const SYS_tee: ::c_long = 5000 + 265;
+pub const SYS_vmsplice: ::c_long = 5000 + 266;
+pub const SYS_move_pages: ::c_long = 5000 + 267;
+pub const SYS_set_robust_list: ::c_long = 5000 + 268;
+pub const SYS_get_robust_list: ::c_long = 5000 + 269;
+pub const SYS_kexec_load: ::c_long = 5000 + 270;
+pub const SYS_getcpu: ::c_long = 5000 + 271;
+pub const SYS_epoll_pwait: ::c_long = 5000 + 272;
+pub const SYS_ioprio_set: ::c_long = 5000 + 273;
+pub const SYS_ioprio_get: ::c_long = 5000 + 274;
+pub const SYS_utimensat: ::c_long = 5000 + 275;
+pub const SYS_signalfd: ::c_long = 5000 + 276;
+pub const SYS_timerfd: ::c_long = 5000 + 277;
+pub const SYS_eventfd: ::c_long = 5000 + 278;
+pub const SYS_fallocate: ::c_long = 5000 + 279;
+pub const SYS_timerfd_create: ::c_long = 5000 + 280;
+pub const SYS_timerfd_gettime: ::c_long = 5000 + 281;
+pub const SYS_timerfd_settime: ::c_long = 5000 + 282;
+pub const SYS_signalfd4: ::c_long = 5000 + 283;
+pub const SYS_eventfd2: ::c_long = 5000 + 284;
+pub const SYS_epoll_create1: ::c_long = 5000 + 285;
+pub const SYS_dup3: ::c_long = 5000 + 286;
+pub const SYS_pipe2: ::c_long = 5000 + 287;
+pub const SYS_inotify_init1: ::c_long = 5000 + 288;
+pub const SYS_preadv: ::c_long = 5000 + 289;
+pub const SYS_pwritev: ::c_long = 5000 + 290;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 5000 + 291;
+pub const SYS_perf_event_open: ::c_long = 5000 + 292;
+pub const SYS_accept4: ::c_long = 5000 + 293;
+pub const SYS_recvmmsg: ::c_long = 5000 + 294;
+pub const SYS_fanotify_init: ::c_long = 5000 + 295;
+pub const SYS_fanotify_mark: ::c_long = 5000 + 296;
+pub const SYS_prlimit64: ::c_long = 5000 + 297;
+pub const SYS_name_to_handle_at: ::c_long = 5000 + 298;
+pub const SYS_open_by_handle_at: ::c_long = 5000 + 299;
+pub const SYS_clock_adjtime: ::c_long = 5000 + 300;
+pub const SYS_syncfs: ::c_long = 5000 + 301;
+pub const SYS_sendmmsg: ::c_long = 5000 + 302;
+pub const SYS_setns: ::c_long = 5000 + 303;
+pub const SYS_process_vm_readv: ::c_long = 5000 + 304;
+pub const SYS_process_vm_writev: ::c_long = 5000 + 305;
+pub const SYS_kcmp: ::c_long = 5000 + 306;
+pub const SYS_finit_module: ::c_long = 5000 + 307;
+pub const SYS_getdents64: ::c_long = 5000 + 308;
+pub const SYS_sched_setattr: ::c_long = 5000 + 309;
+pub const SYS_sched_getattr: ::c_long = 5000 + 310;
+pub const SYS_renameat2: ::c_long = 5000 + 311;
+pub const SYS_seccomp: ::c_long = 5000 + 312;
+pub const SYS_getrandom: ::c_long = 5000 + 313;
+pub const SYS_memfd_create: ::c_long = 5000 + 314;
+pub const SYS_bpf: ::c_long = 5000 + 315;
+pub const SYS_execveat: ::c_long = 5000 + 316;
+pub const SYS_userfaultfd: ::c_long = 5000 + 317;
+pub const SYS_membarrier: ::c_long = 5000 + 318;
+pub const SYS_mlock2: ::c_long = 5000 + 319;
+pub const SYS_copy_file_range: ::c_long = 5000 + 320;
+pub const SYS_preadv2: ::c_long = 5000 + 321;
+pub const SYS_pwritev2: ::c_long = 5000 + 322;
+pub const SYS_pkey_mprotect: ::c_long = 5000 + 323;
+pub const SYS_pkey_alloc: ::c_long = 5000 + 324;
+pub const SYS_pkey_free: ::c_long = 5000 + 325;
+pub const SYS_statx: ::c_long = 5000 + 326;
+pub const SYS_rseq: ::c_long = 5000 + 327;
+pub const SYS_pidfd_send_signal: ::c_long = 5000 + 424;
+pub const SYS_io_uring_setup: ::c_long = 5000 + 425;
+pub const SYS_io_uring_enter: ::c_long = 5000 + 426;
+pub const SYS_io_uring_register: ::c_long = 5000 + 427;
+pub const SYS_open_tree: ::c_long = 5000 + 428;
+pub const SYS_move_mount: ::c_long = 5000 + 429;
+pub const SYS_fsopen: ::c_long = 5000 + 430;
+pub const SYS_fsconfig: ::c_long = 5000 + 431;
+pub const SYS_fsmount: ::c_long = 5000 + 432;
+pub const SYS_fspick: ::c_long = 5000 + 433;
+pub const SYS_pidfd_open: ::c_long = 5000 + 434;
+pub const SYS_clone3: ::c_long = 5000 + 435;
+pub const SYS_close_range: ::c_long = 5000 + 436;
+pub const SYS_openat2: ::c_long = 5000 + 437;
+pub const SYS_pidfd_getfd: ::c_long = 5000 + 438;
+pub const SYS_faccessat2: ::c_long = 5000 + 439;
+pub const SYS_process_madvise: ::c_long = 5000 + 440;
+pub const SYS_epoll_pwait2: ::c_long = 5000 + 441;
+pub const SYS_mount_setattr: ::c_long = 5000 + 442;
+pub const SYS_quotactl_fd: ::c_long = 5000 + 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 5000 + 444;
+pub const SYS_landlock_add_rule: ::c_long = 5000 + 445;
+pub const SYS_landlock_restrict_self: ::c_long = 5000 + 446;
+pub const SYS_memfd_secret: ::c_long = 5000 + 447;
+pub const SYS_process_mrelease: ::c_long = 5000 + 448;
+pub const SYS_futex_waitv: ::c_long = 5000 + 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 5000 + 450;
+
+pub const SFD_CLOEXEC: ::c_int = 0x080000;
+
+pub const NCCS: usize = 32;
+
+pub const O_TRUNC: ::c_int = 512;
+
+pub const O_NOATIME: ::c_int = 0o1000000;
+pub const O_CLOEXEC: ::c_int = 0x80000;
+pub const O_PATH: ::c_int = 0o10000000;
+pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
+
+pub const EBFONT: ::c_int = 59;
+pub const ENOSTR: ::c_int = 60;
+pub const ENODATA: ::c_int = 61;
+pub const ETIME: ::c_int = 62;
+pub const ENOSR: ::c_int = 63;
+pub const ENONET: ::c_int = 64;
+pub const ENOPKG: ::c_int = 65;
+pub const EREMOTE: ::c_int = 66;
+pub const ENOLINK: ::c_int = 67;
+pub const EADV: ::c_int = 68;
+pub const ESRMNT: ::c_int = 69;
+pub const ECOMM: ::c_int = 70;
+pub const EPROTO: ::c_int = 71;
+pub const EDOTDOT: ::c_int = 73;
+
+pub const SA_NODEFER: ::c_int = 0x40000000;
+pub const SA_RESETHAND: ::c_int = 0x80000000;
+pub const SA_RESTART: ::c_int = 0x10000000;
+pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
+
+pub const POSIX_FADV_DONTNEED: ::c_int = 4;
+pub const POSIX_FADV_NOREUSE: ::c_int = 5;
+
+pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
+
+pub const EFD_CLOEXEC: ::c_int = 0x80000;
+
+pub const O_DIRECT: ::c_int = 0x8000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+
+pub const O_APPEND: ::c_int = 8;
+pub const O_CREAT: ::c_int = 256;
+pub const O_EXCL: ::c_int = 1024;
+pub const O_NOCTTY: ::c_int = 2048;
+pub const O_NONBLOCK: ::c_int = 128;
+pub const O_SYNC: ::c_int = 0x4010;
+pub const O_RSYNC: ::c_int = 0x4010;
+pub const O_DSYNC: ::c_int = 0x10;
+pub const O_FSYNC: ::c_int = 0x4010;
+pub const O_ASYNC: ::c_int = 0x1000;
+pub const O_NDELAY: ::c_int = 0x80;
+
+pub const EDEADLK: ::c_int = 45;
+pub const ENAMETOOLONG: ::c_int = 78;
+pub const ENOLCK: ::c_int = 46;
+pub const ENOSYS: ::c_int = 89;
+pub const ENOTEMPTY: ::c_int = 93;
+pub const ELOOP: ::c_int = 90;
+pub const ENOMSG: ::c_int = 35;
+pub const EIDRM: ::c_int = 36;
+pub const ECHRNG: ::c_int = 37;
+pub const EL2NSYNC: ::c_int = 38;
+pub const EL3HLT: ::c_int = 39;
+pub const EL3RST: ::c_int = 40;
+pub const ELNRNG: ::c_int = 41;
+pub const EUNATCH: ::c_int = 42;
+pub const ENOCSI: ::c_int = 43;
+pub const EL2HLT: ::c_int = 44;
+pub const EBADE: ::c_int = 50;
+pub const EBADR: ::c_int = 51;
+pub const EXFULL: ::c_int = 52;
+pub const ENOANO: ::c_int = 53;
+pub const EBADRQC: ::c_int = 54;
+pub const EBADSLT: ::c_int = 55;
+pub const EDEADLOCK: ::c_int = 56;
+pub const EMULTIHOP: ::c_int = 74;
+pub const EOVERFLOW: ::c_int = 79;
+pub const ENOTUNIQ: ::c_int = 80;
+pub const EBADFD: ::c_int = 81;
+pub const EBADMSG: ::c_int = 77;
+pub const EREMCHG: ::c_int = 82;
+pub const ELIBACC: ::c_int = 83;
+pub const ELIBBAD: ::c_int = 84;
+pub const ELIBSCN: ::c_int = 85;
+pub const ELIBMAX: ::c_int = 86;
+pub const ELIBEXEC: ::c_int = 87;
+pub const EILSEQ: ::c_int = 88;
+pub const ERESTART: ::c_int = 91;
+pub const ESTRPIPE: ::c_int = 92;
+pub const EUSERS: ::c_int = 94;
+pub const ENOTSOCK: ::c_int = 95;
+pub const EDESTADDRREQ: ::c_int = 96;
+pub const EMSGSIZE: ::c_int = 97;
+pub const EPROTOTYPE: ::c_int = 98;
+pub const ENOPROTOOPT: ::c_int = 99;
+pub const EPROTONOSUPPORT: ::c_int = 120;
+pub const ESOCKTNOSUPPORT: ::c_int = 121;
+pub const EOPNOTSUPP: ::c_int = 122;
+pub const EPFNOSUPPORT: ::c_int = 123;
+pub const EAFNOSUPPORT: ::c_int = 124;
+pub const EADDRINUSE: ::c_int = 125;
+pub const EADDRNOTAVAIL: ::c_int = 126;
+pub const ENETDOWN: ::c_int = 127;
+pub const ENETUNREACH: ::c_int = 128;
+pub const ENETRESET: ::c_int = 129;
+pub const ECONNABORTED: ::c_int = 130;
+pub const ECONNRESET: ::c_int = 131;
+pub const ENOBUFS: ::c_int = 132;
+pub const EISCONN: ::c_int = 133;
+pub const ENOTCONN: ::c_int = 134;
+pub const ESHUTDOWN: ::c_int = 143;
+pub const ETOOMANYREFS: ::c_int = 144;
+pub const ETIMEDOUT: ::c_int = 145;
+pub const ECONNREFUSED: ::c_int = 146;
+pub const EHOSTDOWN: ::c_int = 147;
+pub const EHOSTUNREACH: ::c_int = 148;
+pub const EALREADY: ::c_int = 149;
+pub const EINPROGRESS: ::c_int = 150;
+pub const ESTALE: ::c_int = 151;
+pub const EUCLEAN: ::c_int = 135;
+pub const ENOTNAM: ::c_int = 137;
+pub const ENAVAIL: ::c_int = 138;
+pub const EISNAM: ::c_int = 139;
+pub const EREMOTEIO: ::c_int = 140;
+pub const EDQUOT: ::c_int = 1133;
+pub const ENOMEDIUM: ::c_int = 159;
+pub const EMEDIUMTYPE: ::c_int = 160;
+pub const ECANCELED: ::c_int = 158;
+pub const ENOKEY: ::c_int = 161;
+pub const EKEYEXPIRED: ::c_int = 162;
+pub const EKEYREVOKED: ::c_int = 163;
+pub const EKEYREJECTED: ::c_int = 164;
+pub const EOWNERDEAD: ::c_int = 165;
+pub const ENOTRECOVERABLE: ::c_int = 166;
+pub const ERFKILL: ::c_int = 167;
+
+pub const MAP_NORESERVE: ::c_int = 0x400;
+pub const MAP_ANON: ::c_int = 0x800;
+pub const MAP_ANONYMOUS: ::c_int = 0x800;
+pub const MAP_GROWSDOWN: ::c_int = 0x1000;
+pub const MAP_DENYWRITE: ::c_int = 0x2000;
+pub const MAP_EXECUTABLE: ::c_int = 0x4000;
+pub const MAP_LOCKED: ::c_int = 0x8000;
+pub const MAP_POPULATE: ::c_int = 0x10000;
+pub const MAP_NONBLOCK: ::c_int = 0x20000;
+pub const MAP_STACK: ::c_int = 0x40000;
+pub const MAP_HUGETLB: ::c_int = 0x080000;
+
+pub const SOCK_STREAM: ::c_int = 2;
+pub const SOCK_DGRAM: ::c_int = 1;
+
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 0x00000008;
+pub const SA_NOCLDWAIT: ::c_int = 0x00010000;
+
+pub const SIGCHLD: ::c_int = 18;
+pub const SIGBUS: ::c_int = 10;
+pub const SIGTTIN: ::c_int = 26;
+pub const SIGTTOU: ::c_int = 27;
+pub const SIGXCPU: ::c_int = 30;
+pub const SIGXFSZ: ::c_int = 31;
+pub const SIGVTALRM: ::c_int = 28;
+pub const SIGPROF: ::c_int = 29;
+pub const SIGWINCH: ::c_int = 20;
+pub const SIGUSR1: ::c_int = 16;
+pub const SIGUSR2: ::c_int = 17;
+pub const SIGCONT: ::c_int = 25;
+pub const SIGSTOP: ::c_int = 23;
+pub const SIGTSTP: ::c_int = 24;
+pub const SIGURG: ::c_int = 21;
+pub const SIGIO: ::c_int = 22;
+pub const SIGSYS: ::c_int = 12;
+pub const SIGPOLL: ::c_int = 22;
+pub const SIGPWR: ::c_int = 19;
+pub const SIG_SETMASK: ::c_int = 3;
+pub const SIG_BLOCK: ::c_int = 0x1;
+pub const SIG_UNBLOCK: ::c_int = 0x2;
+
+pub const POLLWRNORM: ::c_short = 0x004;
+pub const POLLWRBAND: ::c_short = 0x100;
+
+pub const VEOF: usize = 16;
+pub const VEOL: usize = 17;
+pub const VEOL2: usize = 6;
+pub const VMIN: usize = 4;
+pub const IEXTEN: ::tcflag_t = 0x00000100;
+pub const TOSTOP: ::tcflag_t = 0x00008000;
+pub const FLUSHO: ::tcflag_t = 0x00002000;
+pub const EXTPROC: ::tcflag_t = 0o200000;
+pub const TCSANOW: ::c_int = 0x540e;
+pub const TCSADRAIN: ::c_int = 0x540f;
+pub const TCSAFLUSH: ::c_int = 0x5410;
+
+pub const PTRACE_GETFPREGS: ::c_uint = 14;
+pub const PTRACE_SETFPREGS: ::c_uint = 15;
+pub const PTRACE_DETACH: ::c_uint = 17;
+pub const PTRACE_GETFPXREGS: ::c_uint = 18;
+pub const PTRACE_SETFPXREGS: ::c_uint = 19;
+pub const PTRACE_GETREGS: ::c_uint = 12;
+pub const PTRACE_SETREGS: ::c_uint = 13;
+
+pub const EFD_NONBLOCK: ::c_int = 0x80;
+
+pub const F_RDLCK: ::c_int = 0;
+pub const F_WRLCK: ::c_int = 1;
+pub const F_UNLCK: ::c_int = 2;
+pub const F_GETLK: ::c_int = 14;
+pub const F_GETOWN: ::c_int = 23;
+pub const F_SETOWN: ::c_int = 24;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+pub const F_OFD_GETLK: ::c_int = 36;
+pub const F_OFD_SETLK: ::c_int = 37;
+pub const F_OFD_SETLKW: ::c_int = 38;
+
+pub const SFD_NONBLOCK: ::c_int = 0x80;
+
+pub const RTLD_DEEPBIND: ::c_int = 0x10;
+pub const RTLD_GLOBAL: ::c_int = 0x4;
+pub const RTLD_NOLOAD: ::c_int = 0x8;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const EHWPOISON: ::c_int = 168;
+
+extern "C" {
+    pub fn sysctl(
+        name: *mut ::c_int,
+        namelen: ::c_int,
+        oldp: *mut ::c_void,
+        oldlenp: *mut ::size_t,
+        newp: *mut ::c_void,
+        newlen: ::size_t,
+    ) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,128 @@
+//! 64-bit specific definitions for linux-like values
+
+pub type ino_t = u64;
+pub type off_t = i64;
+pub type blkcnt_t = i64;
+pub type shmatt_t = u64;
+pub type msgqnum_t = u64;
+pub type msglen_t = u64;
+pub type fsblkcnt_t = u64;
+pub type fsfilcnt_t = u64;
+pub type rlim_t = u64;
+#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+pub type __syscall_ulong_t = ::c_ulonglong;
+#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+pub type __syscall_ulong_t = ::c_ulong;
+
+cfg_if! {
+    if #[cfg(all(target_arch = "aarch64", target_pointer_width = "32"))] {
+        pub type clock_t = i32;
+        pub type time_t = i32;
+        pub type __fsword_t = i32;
+    } else {
+        pub type __fsword_t = i64;
+        pub type clock_t = i64;
+        pub type time_t = i64;
+    }
+}
+
+s! {
+    pub struct sigset_t {
+        #[cfg(target_pointer_width = "32")]
+        __val: [u32; 32],
+        #[cfg(target_pointer_width = "64")]
+        __val: [u64; 16],
+    }
+
+    pub struct sysinfo {
+        pub uptime: i64,
+        pub loads: [u64; 3],
+        pub totalram: u64,
+        pub freeram: u64,
+        pub sharedram: u64,
+        pub bufferram: u64,
+        pub totalswap: u64,
+        pub freeswap: u64,
+        pub procs: ::c_ushort,
+        pub pad: ::c_ushort,
+        pub totalhigh: u64,
+        pub freehigh: u64,
+        pub mem_unit: ::c_uint,
+        pub _f: [::c_char; 0],
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: u64,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved4: u64,
+        __glibc_reserved5: u64,
+    }
+
+    pub struct semid_ds {
+        pub sem_perm: ipc_perm,
+        pub sem_otime: ::time_t,
+        #[cfg(not(any(
+            target_arch = "aarch64",
+            target_arch = "loongarch64",
+            target_arch = "mips64",
+            target_arch = "mips64r6",
+            target_arch = "powerpc64",
+            target_arch = "riscv64",
+            target_arch = "sparc64")))]
+        __reserved: ::__syscall_ulong_t,
+        pub sem_ctime: ::time_t,
+        #[cfg(not(any(
+            target_arch = "aarch64",
+            target_arch = "loongarch64",
+            target_arch = "mips64",
+            target_arch = "mips64r6",
+            target_arch = "powerpc64",
+            target_arch = "riscv64",
+            target_arch = "sparc64")))]
+        __reserved2: ::__syscall_ulong_t,
+        pub sem_nsems: ::__syscall_ulong_t,
+        __glibc_reserved3: ::__syscall_ulong_t,
+        __glibc_reserved4: ::__syscall_ulong_t,
+    }
+}
+
+pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
+
+pub const O_LARGEFILE: ::c_int = 0;
+
+cfg_if! {
+    if #[cfg(target_arch = "aarch64")] {
+        mod aarch64;
+        pub use self::aarch64::*;
+    } else if #[cfg(any(target_arch = "powerpc64"))] {
+        mod powerpc64;
+        pub use self::powerpc64::*;
+    } else if #[cfg(any(target_arch = "sparc64"))] {
+        mod sparc64;
+        pub use self::sparc64::*;
+    } else if #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))] {
+        mod mips64;
+        pub use self::mips64::*;
+    } else if #[cfg(any(target_arch = "s390x"))] {
+        mod s390x;
+        pub use self::s390x::*;
+    } else if #[cfg(any(target_arch = "x86_64"))] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    } else if #[cfg(any(target_arch = "riscv64"))] {
+        mod riscv64;
+        pub use self::riscv64::*;
+    } else if #[cfg(any(target_arch = "loongarch64"))] {
+        mod loongarch64;
+        pub use self::loongarch64::*;
+    } else {
+        // Unknown target_arch
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [i64; 4]
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,979 @@
+//! PowerPC64-specific definitions for 64-bit linux-like values
+
+use pthread_mutex_t;
+
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = u8;
+pub type wchar_t = i32;
+pub type nlink_t = u64;
+pub type blksize_t = i64;
+pub type suseconds_t = i64;
+pub type __u64 = ::c_ulong;
+pub type __s64 = ::c_long;
+
+s! {
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        #[cfg(target_arch = "sparc64")]
+        __reserved0: ::c_int,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        f_spare: [::__fsword_t; 5],
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct flock64 {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off64_t,
+        pub l_len: ::off64_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        __pad0: ::c_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_long; 3],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        __pad0: ::c_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __reserved: [::c_long; 3],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__fsword_t; 4],
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct pthread_attr_t {
+        __size: [u64; 7]
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: u32,
+        __pad1: u32,
+        __unused1: u64,
+        __unused2: ::c_ulong,
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_segsz: ::size_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        #[doc(hidden)]
+        #[deprecated(
+            since="0.2.54",
+            note="Please leave a comment on \
+                  https://github.com/rust-lang/libc/pull/1316 if you're using \
+                  this field"
+        )]
+        pub _pad: [::c_int; 29],
+        _align: [usize; 0],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t
+    }
+}
+
+pub const POSIX_FADV_DONTNEED: ::c_int = 4;
+pub const POSIX_FADV_NOREUSE: ::c_int = 5;
+
+pub const RTLD_DEEPBIND: ::c_int = 0x8;
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+pub const VEOF: usize = 4;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
+
+pub const O_APPEND: ::c_int = 1024;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_FSYNC: ::c_int = 0x101000;
+pub const O_NOATIME: ::c_int = 0o1000000;
+pub const O_PATH: ::c_int = 0o10000000;
+pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_ANONYMOUS: ::c_int = 0x0020;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+
+pub const EDEADLK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EBADMSG: ::c_int = 74;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const EHWPOISON: ::c_int = 133;
+pub const ERFKILL: ::c_int = 132;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
+pub const SIGUNUSED: ::c_int = 31;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const O_ASYNC: ::c_int = 0x2000;
+pub const O_NDELAY: ::c_int = 0x800;
+
+pub const PTRACE_DETACH: ::c_uint = 17;
+
+pub const EFD_NONBLOCK: ::c_int = 0x800;
+
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETOWN: ::c_int = 8;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+pub const F_OFD_GETLK: ::c_int = 36;
+pub const F_OFD_SETLK: ::c_int = 37;
+pub const F_OFD_SETLKW: ::c_int = 38;
+
+pub const F_RDLCK: ::c_int = 0;
+pub const F_WRLCK: ::c_int = 1;
+pub const F_UNLCK: ::c_int = 2;
+
+pub const SFD_NONBLOCK: ::c_int = 0x0800;
+
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+
+pub const SFD_CLOEXEC: ::c_int = 0x080000;
+
+pub const NCCS: usize = 32;
+
+pub const O_TRUNC: ::c_int = 512;
+
+pub const O_CLOEXEC: ::c_int = 0x80000;
+
+pub const EBFONT: ::c_int = 59;
+pub const ENOSTR: ::c_int = 60;
+pub const ENODATA: ::c_int = 61;
+pub const ETIME: ::c_int = 62;
+pub const ENOSR: ::c_int = 63;
+pub const ENONET: ::c_int = 64;
+pub const ENOPKG: ::c_int = 65;
+pub const EREMOTE: ::c_int = 66;
+pub const ENOLINK: ::c_int = 67;
+pub const EADV: ::c_int = 68;
+pub const ESRMNT: ::c_int = 69;
+pub const ECOMM: ::c_int = 70;
+pub const EPROTO: ::c_int = 71;
+pub const EDOTDOT: ::c_int = 73;
+
+pub const SA_NODEFER: ::c_int = 0x40000000;
+pub const SA_RESETHAND: ::c_int = 0x80000000;
+pub const SA_RESTART: ::c_int = 0x10000000;
+pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
+
+pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
+
+pub const EFD_CLOEXEC: ::c_int = 0x80000;
+
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
+
+align_const! {
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+}
+
+pub const O_DIRECTORY: ::c_int = 0x4000;
+pub const O_NOFOLLOW: ::c_int = 0x8000;
+pub const O_DIRECT: ::c_int = 0x20000;
+
+pub const MAP_LOCKED: ::c_int = 0x00080;
+pub const MAP_NORESERVE: ::c_int = 0x00040;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const EDEADLOCK: ::c_int = 58;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+
+pub const MCL_CURRENT: ::c_int = 0x2000;
+pub const MCL_FUTURE: ::c_int = 0x4000;
+pub const MCL_ONFAULT: ::c_int = 0x8000;
+
+pub const SIGSTKSZ: ::size_t = 0x4000;
+pub const MINSIGSTKSZ: ::size_t = 4096;
+pub const CBAUD: ::tcflag_t = 0xff;
+pub const TAB1: ::tcflag_t = 0x400;
+pub const TAB2: ::tcflag_t = 0x800;
+pub const TAB3: ::tcflag_t = 0xc00;
+pub const CR1: ::tcflag_t = 0x1000;
+pub const CR2: ::tcflag_t = 0x2000;
+pub const CR3: ::tcflag_t = 0x3000;
+pub const FF1: ::tcflag_t = 0x4000;
+pub const BS1: ::tcflag_t = 0x8000;
+pub const VT1: ::tcflag_t = 0x10000;
+pub const VWERASE: usize = 0xa;
+pub const VREPRINT: usize = 0xb;
+pub const VSUSP: usize = 0xc;
+pub const VSTART: usize = 0xd;
+pub const VSTOP: usize = 0xe;
+pub const VDISCARD: usize = 0x10;
+pub const VTIME: usize = 0x7;
+pub const IXON: ::tcflag_t = 0x200;
+pub const IXOFF: ::tcflag_t = 0x400;
+pub const ONLCR: ::tcflag_t = 0x2;
+pub const CSIZE: ::tcflag_t = 0x300;
+pub const CS6: ::tcflag_t = 0x100;
+pub const CS7: ::tcflag_t = 0x200;
+pub const CS8: ::tcflag_t = 0x300;
+pub const CSTOPB: ::tcflag_t = 0x400;
+pub const CREAD: ::tcflag_t = 0x800;
+pub const PARENB: ::tcflag_t = 0x1000;
+pub const PARODD: ::tcflag_t = 0x2000;
+pub const HUPCL: ::tcflag_t = 0x4000;
+pub const CLOCAL: ::tcflag_t = 0x8000;
+pub const ECHOKE: ::tcflag_t = 0x1;
+pub const ECHOE: ::tcflag_t = 0x2;
+pub const ECHOK: ::tcflag_t = 0x4;
+pub const ECHONL: ::tcflag_t = 0x10;
+pub const ECHOPRT: ::tcflag_t = 0x20;
+pub const ECHOCTL: ::tcflag_t = 0x40;
+pub const ISIG: ::tcflag_t = 0x80;
+pub const ICANON: ::tcflag_t = 0x100;
+pub const PENDIN: ::tcflag_t = 0x20000000;
+pub const NOFLSH: ::tcflag_t = 0x80000000;
+pub const VSWTC: usize = 9;
+pub const OLCUC: ::tcflag_t = 0o000004;
+pub const NLDLY: ::tcflag_t = 0o001400;
+pub const CRDLY: ::tcflag_t = 0o030000;
+pub const TABDLY: ::tcflag_t = 0o006000;
+pub const BSDLY: ::tcflag_t = 0o100000;
+pub const FFDLY: ::tcflag_t = 0o040000;
+pub const VTDLY: ::tcflag_t = 0o200000;
+pub const XTABS: ::tcflag_t = 0o006000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const CBAUDEX: ::speed_t = 0o000020;
+pub const B57600: ::speed_t = 0o0020;
+pub const B115200: ::speed_t = 0o0021;
+pub const B230400: ::speed_t = 0o0022;
+pub const B460800: ::speed_t = 0o0023;
+pub const B500000: ::speed_t = 0o0024;
+pub const B576000: ::speed_t = 0o0025;
+pub const B921600: ::speed_t = 0o0026;
+pub const B1000000: ::speed_t = 0o0027;
+pub const B1152000: ::speed_t = 0o0030;
+pub const B1500000: ::speed_t = 0o0031;
+pub const B2000000: ::speed_t = 0o0032;
+pub const B2500000: ::speed_t = 0o0033;
+pub const B3000000: ::speed_t = 0o0034;
+pub const B3500000: ::speed_t = 0o0035;
+pub const B4000000: ::speed_t = 0o0036;
+
+pub const VEOL: usize = 6;
+pub const VEOL2: usize = 8;
+pub const VMIN: usize = 5;
+pub const IEXTEN: ::tcflag_t = 0x400;
+pub const TOSTOP: ::tcflag_t = 0x400000;
+pub const FLUSHO: ::tcflag_t = 0x800000;
+pub const EXTPROC: ::tcflag_t = 0x10000000;
+
+// Syscall table
+pub const SYS_restart_syscall: ::c_long = 0;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_waitpid: ::c_long = 7;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execve: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_time: ::c_long = 13;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lchown: ::c_long = 16;
+pub const SYS_break: ::c_long = 17;
+pub const SYS_oldstat: ::c_long = 18;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_mount: ::c_long = 21;
+pub const SYS_umount: ::c_long = 22;
+pub const SYS_setuid: ::c_long = 23;
+pub const SYS_getuid: ::c_long = 24;
+pub const SYS_stime: ::c_long = 25;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_alarm: ::c_long = 27;
+pub const SYS_oldfstat: ::c_long = 28;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_utime: ::c_long = 30;
+pub const SYS_stty: ::c_long = 31;
+pub const SYS_gtty: ::c_long = 32;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_ftime: ::c_long = 35;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_prof: ::c_long = 44;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_setgid: ::c_long = 46;
+pub const SYS_getgid: ::c_long = 47;
+pub const SYS_signal: ::c_long = 48;
+pub const SYS_geteuid: ::c_long = 49;
+pub const SYS_getegid: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount2: ::c_long = 52;
+pub const SYS_lock: ::c_long = 53;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_mpx: ::c_long = 56;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_ulimit: ::c_long = 58;
+pub const SYS_oldolduname: ::c_long = 59;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_sgetmask: ::c_long = 68;
+pub const SYS_ssetmask: ::c_long = 69;
+pub const SYS_setreuid: ::c_long = 70;
+pub const SYS_setregid: ::c_long = 71;
+pub const SYS_sigsuspend: ::c_long = 72;
+pub const SYS_sigpending: ::c_long = 73;
+pub const SYS_sethostname: ::c_long = 74;
+pub const SYS_setrlimit: ::c_long = 75;
+pub const SYS_getrlimit: ::c_long = 76;
+pub const SYS_getrusage: ::c_long = 77;
+pub const SYS_gettimeofday: ::c_long = 78;
+pub const SYS_settimeofday: ::c_long = 79;
+pub const SYS_getgroups: ::c_long = 80;
+pub const SYS_setgroups: ::c_long = 81;
+pub const SYS_select: ::c_long = 82;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_oldlstat: ::c_long = 84;
+pub const SYS_readlink: ::c_long = 85;
+pub const SYS_uselib: ::c_long = 86;
+pub const SYS_swapon: ::c_long = 87;
+pub const SYS_reboot: ::c_long = 88;
+pub const SYS_readdir: ::c_long = 89;
+pub const SYS_mmap: ::c_long = 90;
+pub const SYS_munmap: ::c_long = 91;
+pub const SYS_truncate: ::c_long = 92;
+pub const SYS_ftruncate: ::c_long = 93;
+pub const SYS_fchmod: ::c_long = 94;
+pub const SYS_fchown: ::c_long = 95;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_profil: ::c_long = 98;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_ioperm: ::c_long = 101;
+pub const SYS_socketcall: ::c_long = 102;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_setitimer: ::c_long = 104;
+pub const SYS_getitimer: ::c_long = 105;
+pub const SYS_stat: ::c_long = 106;
+pub const SYS_lstat: ::c_long = 107;
+pub const SYS_fstat: ::c_long = 108;
+pub const SYS_olduname: ::c_long = 109;
+pub const SYS_iopl: ::c_long = 110;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_idle: ::c_long = 112;
+pub const SYS_vm86: ::c_long = 113;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_ipc: ::c_long = 117;
+pub const SYS_fsync: ::c_long = 118;
+pub const SYS_sigreturn: ::c_long = 119;
+pub const SYS_clone: ::c_long = 120;
+pub const SYS_setdomainname: ::c_long = 121;
+pub const SYS_uname: ::c_long = 122;
+pub const SYS_modify_ldt: ::c_long = 123;
+pub const SYS_adjtimex: ::c_long = 124;
+pub const SYS_mprotect: ::c_long = 125;
+pub const SYS_sigprocmask: ::c_long = 126;
+pub const SYS_create_module: ::c_long = 127;
+pub const SYS_init_module: ::c_long = 128;
+pub const SYS_delete_module: ::c_long = 129;
+pub const SYS_get_kernel_syms: ::c_long = 130;
+pub const SYS_quotactl: ::c_long = 131;
+pub const SYS_getpgid: ::c_long = 132;
+pub const SYS_fchdir: ::c_long = 133;
+pub const SYS_bdflush: ::c_long = 134;
+pub const SYS_sysfs: ::c_long = 135;
+pub const SYS_personality: ::c_long = 136;
+pub const SYS_afs_syscall: ::c_long = 137; /* Syscall for Andrew File System */
+pub const SYS_setfsuid: ::c_long = 138;
+pub const SYS_setfsgid: ::c_long = 139;
+pub const SYS__llseek: ::c_long = 140;
+pub const SYS_getdents: ::c_long = 141;
+pub const SYS__newselect: ::c_long = 142;
+pub const SYS_flock: ::c_long = 143;
+pub const SYS_msync: ::c_long = 144;
+pub const SYS_readv: ::c_long = 145;
+pub const SYS_writev: ::c_long = 146;
+pub const SYS_getsid: ::c_long = 147;
+pub const SYS_fdatasync: ::c_long = 148;
+pub const SYS__sysctl: ::c_long = 149;
+pub const SYS_mlock: ::c_long = 150;
+pub const SYS_munlock: ::c_long = 151;
+pub const SYS_mlockall: ::c_long = 152;
+pub const SYS_munlockall: ::c_long = 153;
+pub const SYS_sched_setparam: ::c_long = 154;
+pub const SYS_sched_getparam: ::c_long = 155;
+pub const SYS_sched_setscheduler: ::c_long = 156;
+pub const SYS_sched_getscheduler: ::c_long = 157;
+pub const SYS_sched_yield: ::c_long = 158;
+pub const SYS_sched_get_priority_max: ::c_long = 159;
+pub const SYS_sched_get_priority_min: ::c_long = 160;
+pub const SYS_sched_rr_get_interval: ::c_long = 161;
+pub const SYS_nanosleep: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_setresuid: ::c_long = 164;
+pub const SYS_getresuid: ::c_long = 165;
+pub const SYS_query_module: ::c_long = 166;
+pub const SYS_poll: ::c_long = 167;
+pub const SYS_nfsservctl: ::c_long = 168;
+pub const SYS_setresgid: ::c_long = 169;
+pub const SYS_getresgid: ::c_long = 170;
+pub const SYS_prctl: ::c_long = 171;
+pub const SYS_rt_sigreturn: ::c_long = 172;
+pub const SYS_rt_sigaction: ::c_long = 173;
+pub const SYS_rt_sigprocmask: ::c_long = 174;
+pub const SYS_rt_sigpending: ::c_long = 175;
+pub const SYS_rt_sigtimedwait: ::c_long = 176;
+pub const SYS_rt_sigqueueinfo: ::c_long = 177;
+pub const SYS_rt_sigsuspend: ::c_long = 178;
+pub const SYS_pread64: ::c_long = 179;
+pub const SYS_pwrite64: ::c_long = 180;
+pub const SYS_chown: ::c_long = 181;
+pub const SYS_getcwd: ::c_long = 182;
+pub const SYS_capget: ::c_long = 183;
+pub const SYS_capset: ::c_long = 184;
+pub const SYS_sigaltstack: ::c_long = 185;
+pub const SYS_sendfile: ::c_long = 186;
+pub const SYS_getpmsg: ::c_long = 187; /* some people actually want streams */
+pub const SYS_putpmsg: ::c_long = 188; /* some people actually want streams */
+pub const SYS_vfork: ::c_long = 189;
+pub const SYS_ugetrlimit: ::c_long = 190; /* SuS compliant getrlimit */
+pub const SYS_readahead: ::c_long = 191;
+pub const SYS_pciconfig_read: ::c_long = 198;
+pub const SYS_pciconfig_write: ::c_long = 199;
+pub const SYS_pciconfig_iobase: ::c_long = 200;
+pub const SYS_multiplexer: ::c_long = 201;
+pub const SYS_getdents64: ::c_long = 202;
+pub const SYS_pivot_root: ::c_long = 203;
+pub const SYS_madvise: ::c_long = 205;
+pub const SYS_mincore: ::c_long = 206;
+pub const SYS_gettid: ::c_long = 207;
+pub const SYS_tkill: ::c_long = 208;
+pub const SYS_setxattr: ::c_long = 209;
+pub const SYS_lsetxattr: ::c_long = 210;
+pub const SYS_fsetxattr: ::c_long = 211;
+pub const SYS_getxattr: ::c_long = 212;
+pub const SYS_lgetxattr: ::c_long = 213;
+pub const SYS_fgetxattr: ::c_long = 214;
+pub const SYS_listxattr: ::c_long = 215;
+pub const SYS_llistxattr: ::c_long = 216;
+pub const SYS_flistxattr: ::c_long = 217;
+pub const SYS_removexattr: ::c_long = 218;
+pub const SYS_lremovexattr: ::c_long = 219;
+pub const SYS_fremovexattr: ::c_long = 220;
+pub const SYS_futex: ::c_long = 221;
+pub const SYS_sched_setaffinity: ::c_long = 222;
+pub const SYS_sched_getaffinity: ::c_long = 223;
+pub const SYS_tuxcall: ::c_long = 225;
+pub const SYS_io_setup: ::c_long = 227;
+pub const SYS_io_destroy: ::c_long = 228;
+pub const SYS_io_getevents: ::c_long = 229;
+pub const SYS_io_submit: ::c_long = 230;
+pub const SYS_io_cancel: ::c_long = 231;
+pub const SYS_set_tid_address: ::c_long = 232;
+pub const SYS_exit_group: ::c_long = 234;
+pub const SYS_lookup_dcookie: ::c_long = 235;
+pub const SYS_epoll_create: ::c_long = 236;
+pub const SYS_epoll_ctl: ::c_long = 237;
+pub const SYS_epoll_wait: ::c_long = 238;
+pub const SYS_remap_file_pages: ::c_long = 239;
+pub const SYS_timer_create: ::c_long = 240;
+pub const SYS_timer_settime: ::c_long = 241;
+pub const SYS_timer_gettime: ::c_long = 242;
+pub const SYS_timer_getoverrun: ::c_long = 243;
+pub const SYS_timer_delete: ::c_long = 244;
+pub const SYS_clock_settime: ::c_long = 245;
+pub const SYS_clock_gettime: ::c_long = 246;
+pub const SYS_clock_getres: ::c_long = 247;
+pub const SYS_clock_nanosleep: ::c_long = 248;
+pub const SYS_swapcontext: ::c_long = 249;
+pub const SYS_tgkill: ::c_long = 250;
+pub const SYS_utimes: ::c_long = 251;
+pub const SYS_statfs64: ::c_long = 252;
+pub const SYS_fstatfs64: ::c_long = 253;
+pub const SYS_rtas: ::c_long = 255;
+pub const SYS_sys_debug_setcontext: ::c_long = 256;
+pub const SYS_migrate_pages: ::c_long = 258;
+pub const SYS_mbind: ::c_long = 259;
+pub const SYS_get_mempolicy: ::c_long = 260;
+pub const SYS_set_mempolicy: ::c_long = 261;
+pub const SYS_mq_open: ::c_long = 262;
+pub const SYS_mq_unlink: ::c_long = 263;
+pub const SYS_mq_timedsend: ::c_long = 264;
+pub const SYS_mq_timedreceive: ::c_long = 265;
+pub const SYS_mq_notify: ::c_long = 266;
+pub const SYS_mq_getsetattr: ::c_long = 267;
+pub const SYS_kexec_load: ::c_long = 268;
+pub const SYS_add_key: ::c_long = 269;
+pub const SYS_request_key: ::c_long = 270;
+pub const SYS_keyctl: ::c_long = 271;
+pub const SYS_waitid: ::c_long = 272;
+pub const SYS_ioprio_set: ::c_long = 273;
+pub const SYS_ioprio_get: ::c_long = 274;
+pub const SYS_inotify_init: ::c_long = 275;
+pub const SYS_inotify_add_watch: ::c_long = 276;
+pub const SYS_inotify_rm_watch: ::c_long = 277;
+pub const SYS_spu_run: ::c_long = 278;
+pub const SYS_spu_create: ::c_long = 279;
+pub const SYS_pselect6: ::c_long = 280;
+pub const SYS_ppoll: ::c_long = 281;
+pub const SYS_unshare: ::c_long = 282;
+pub const SYS_splice: ::c_long = 283;
+pub const SYS_tee: ::c_long = 284;
+pub const SYS_vmsplice: ::c_long = 285;
+pub const SYS_openat: ::c_long = 286;
+pub const SYS_mkdirat: ::c_long = 287;
+pub const SYS_mknodat: ::c_long = 288;
+pub const SYS_fchownat: ::c_long = 289;
+pub const SYS_futimesat: ::c_long = 290;
+pub const SYS_newfstatat: ::c_long = 291;
+pub const SYS_unlinkat: ::c_long = 292;
+pub const SYS_renameat: ::c_long = 293;
+pub const SYS_linkat: ::c_long = 294;
+pub const SYS_symlinkat: ::c_long = 295;
+pub const SYS_readlinkat: ::c_long = 296;
+pub const SYS_fchmodat: ::c_long = 297;
+pub const SYS_faccessat: ::c_long = 298;
+pub const SYS_get_robust_list: ::c_long = 299;
+pub const SYS_set_robust_list: ::c_long = 300;
+pub const SYS_move_pages: ::c_long = 301;
+pub const SYS_getcpu: ::c_long = 302;
+pub const SYS_epoll_pwait: ::c_long = 303;
+pub const SYS_utimensat: ::c_long = 304;
+pub const SYS_signalfd: ::c_long = 305;
+pub const SYS_timerfd_create: ::c_long = 306;
+pub const SYS_eventfd: ::c_long = 307;
+pub const SYS_sync_file_range2: ::c_long = 308;
+pub const SYS_fallocate: ::c_long = 309;
+pub const SYS_subpage_prot: ::c_long = 310;
+pub const SYS_timerfd_settime: ::c_long = 311;
+pub const SYS_timerfd_gettime: ::c_long = 312;
+pub const SYS_signalfd4: ::c_long = 313;
+pub const SYS_eventfd2: ::c_long = 314;
+pub const SYS_epoll_create1: ::c_long = 315;
+pub const SYS_dup3: ::c_long = 316;
+pub const SYS_pipe2: ::c_long = 317;
+pub const SYS_inotify_init1: ::c_long = 318;
+pub const SYS_perf_event_open: ::c_long = 319;
+pub const SYS_preadv: ::c_long = 320;
+pub const SYS_pwritev: ::c_long = 321;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 322;
+pub const SYS_fanotify_init: ::c_long = 323;
+pub const SYS_fanotify_mark: ::c_long = 324;
+pub const SYS_prlimit64: ::c_long = 325;
+pub const SYS_socket: ::c_long = 326;
+pub const SYS_bind: ::c_long = 327;
+pub const SYS_connect: ::c_long = 328;
+pub const SYS_listen: ::c_long = 329;
+pub const SYS_accept: ::c_long = 330;
+pub const SYS_getsockname: ::c_long = 331;
+pub const SYS_getpeername: ::c_long = 332;
+pub const SYS_socketpair: ::c_long = 333;
+pub const SYS_send: ::c_long = 334;
+pub const SYS_sendto: ::c_long = 335;
+pub const SYS_recv: ::c_long = 336;
+pub const SYS_recvfrom: ::c_long = 337;
+pub const SYS_shutdown: ::c_long = 338;
+pub const SYS_setsockopt: ::c_long = 339;
+pub const SYS_getsockopt: ::c_long = 340;
+pub const SYS_sendmsg: ::c_long = 341;
+pub const SYS_recvmsg: ::c_long = 342;
+pub const SYS_recvmmsg: ::c_long = 343;
+pub const SYS_accept4: ::c_long = 344;
+pub const SYS_name_to_handle_at: ::c_long = 345;
+pub const SYS_open_by_handle_at: ::c_long = 346;
+pub const SYS_clock_adjtime: ::c_long = 347;
+pub const SYS_syncfs: ::c_long = 348;
+pub const SYS_sendmmsg: ::c_long = 349;
+pub const SYS_setns: ::c_long = 350;
+pub const SYS_process_vm_readv: ::c_long = 351;
+pub const SYS_process_vm_writev: ::c_long = 352;
+pub const SYS_finit_module: ::c_long = 353;
+pub const SYS_kcmp: ::c_long = 354;
+pub const SYS_sched_setattr: ::c_long = 355;
+pub const SYS_sched_getattr: ::c_long = 356;
+pub const SYS_renameat2: ::c_long = 357;
+pub const SYS_seccomp: ::c_long = 358;
+pub const SYS_getrandom: ::c_long = 359;
+pub const SYS_memfd_create: ::c_long = 360;
+pub const SYS_bpf: ::c_long = 361;
+pub const SYS_execveat: ::c_long = 362;
+pub const SYS_switch_endian: ::c_long = 363;
+pub const SYS_userfaultfd: ::c_long = 364;
+pub const SYS_membarrier: ::c_long = 365;
+pub const SYS_mlock2: ::c_long = 378;
+pub const SYS_copy_file_range: ::c_long = 379;
+pub const SYS_preadv2: ::c_long = 380;
+pub const SYS_pwritev2: ::c_long = 381;
+pub const SYS_kexec_file_load: ::c_long = 382;
+pub const SYS_statx: ::c_long = 383;
+pub const SYS_rseq: ::c_long = 387;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+extern "C" {
+    pub fn sysctl(
+        name: *mut ::c_int,
+        namelen: ::c_int,
+        oldp: *mut ::c_void,
+        oldlenp: *mut ::size_t,
+        newp: *mut ::c_void,
+        newlen: ::size_t,
+    ) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,44 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    pub struct ucontext_t {
+        pub __uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_mcontext: mcontext_t,
+    }
+
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct mcontext_t {
+        pub __gregs: [::c_ulong; 32],
+        pub __fpregs: __riscv_mc_fp_state,
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub union __riscv_mc_fp_state {
+        pub __f: __riscv_mc_f_ext_state,
+        pub __d: __riscv_mc_d_ext_state,
+        pub __q: __riscv_mc_q_ext_state,
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub struct __riscv_mc_f_ext_state {
+        pub __f: [::c_uint; 32],
+        pub __fcsr: ::c_uint,
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub struct __riscv_mc_d_ext_state {
+        pub __f: [::c_ulonglong; 32],
+        pub __fcsr: ::c_uint,
+    }
+
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct __riscv_mc_q_ext_state {
+        pub __f: [::c_ulonglong; 64],
+        pub __fcsr: ::c_uint,
+        pub __glibc_reserved: [::c_uint; 3],
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,860 @@
+//! RISC-V-specific definitions for 64-bit linux-like values
+
+pub type c_char = u8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type wchar_t = ::c_int;
+
+pub type nlink_t = ::c_uint;
+pub type blksize_t = ::c_int;
+pub type fsblkcnt64_t = ::c_ulong;
+pub type fsfilcnt64_t = ::c_ulong;
+pub type suseconds_t = i64;
+pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
+
+s! {
+    pub struct pthread_attr_t {
+        __size: [::c_ulong; 7],
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub __pad1: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub __pad2: ::c_int,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_int; 2usize],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub __pad1: ::dev_t,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub __pad2: ::c_int,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_int; 2],
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_long,
+        pub f_frsize: ::c_long,
+        pub f_flags: ::c_long,
+        pub f_spare: [::c_long; 4],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        pub f_blocks: ::fsblkcnt64_t,
+        pub f_bfree: ::fsblkcnt64_t,
+        pub f_bavail: ::fsblkcnt64_t,
+        pub f_files: ::fsfilcnt64_t,
+        pub f_ffree: ::fsfilcnt64_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_long,
+        pub f_frsize: ::c_long,
+        pub f_flags: ::c_long,
+        pub f_spare: [::c_long; 4],
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        pub __f_spare: [::c_int; 6],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt64_t,
+        pub f_bfree: ::fsblkcnt64_t,
+        pub f_bavail: ::fsblkcnt64_t,
+        pub f_files: ::fsfilcnt64_t,
+        pub f_ffree: ::fsfilcnt64_t,
+        pub f_favail: ::fsfilcnt64_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        pub __f_spare: [::c_int; 6],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        #[doc(hidden)]
+        #[deprecated(
+            since="0.2.54",
+            note="Please leave a comment on \
+                  https://github.com/rust-lang/libc/pull/1316 if you're using \
+                  this field"
+        )]
+        pub _pad: [::c_int; 29],
+        _align: [u64; 0],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t,
+    }
+
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<unsafe extern "C" fn()>,
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::c_ushort,
+        __pad1: ::c_ushort,
+        pub __seq: ::c_ushort,
+        __pad2: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong,
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused5: ::c_ulong,
+        __unused6: ::c_ulong,
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct flock64 {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off64_t,
+        pub l_len: ::off64_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct user_regs_struct {
+        pub pc: ::c_ulong,
+        pub ra: ::c_ulong,
+        pub sp: ::c_ulong,
+        pub gp: ::c_ulong,
+        pub tp: ::c_ulong,
+        pub t0: ::c_ulong,
+        pub t1: ::c_ulong,
+        pub t2: ::c_ulong,
+        pub s0: ::c_ulong,
+        pub s1: ::c_ulong,
+        pub a0: ::c_ulong,
+        pub a1: ::c_ulong,
+        pub a2: ::c_ulong,
+        pub a3: ::c_ulong,
+        pub a4: ::c_ulong,
+        pub a5: ::c_ulong,
+        pub a6: ::c_ulong,
+        pub a7: ::c_ulong,
+        pub s2: ::c_ulong,
+        pub s3: ::c_ulong,
+        pub s4: ::c_ulong,
+        pub s5: ::c_ulong,
+        pub s6: ::c_ulong,
+        pub s7: ::c_ulong,
+        pub s8: ::c_ulong,
+        pub s9: ::c_ulong,
+        pub s10: ::c_ulong,
+        pub s11: ::c_ulong,
+        pub t3: ::c_ulong,
+        pub t4: ::c_ulong,
+        pub t5: ::c_ulong,
+        pub t6: ::c_ulong,
+    }
+}
+
+pub const POSIX_FADV_DONTNEED: ::c_int = 4;
+pub const POSIX_FADV_NOREUSE: ::c_int = 5;
+pub const VEOF: usize = 4;
+pub const RTLD_DEEPBIND: ::c_int = 0x8;
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+pub const O_APPEND: ::c_int = 1024;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_FSYNC: ::c_int = 1052672;
+pub const O_NOATIME: ::c_int = 262144;
+pub const O_PATH: ::c_int = 2097152;
+pub const O_TMPFILE: ::c_int = 4259840;
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MAP_GROWSDOWN: ::c_int = 256;
+pub const EDEADLK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EBADMSG: ::c_int = 74;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const EHWPOISON: ::c_int = 133;
+pub const ERFKILL: ::c_int = 132;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+pub const SA_ONSTACK: ::c_int = 134217728;
+pub const SA_SIGINFO: ::c_int = 4;
+pub const SA_NOCLDWAIT: ::c_int = 2;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0;
+pub const SIG_UNBLOCK: ::c_int = 1;
+pub const POLLWRNORM: ::c_short = 256;
+pub const POLLWRBAND: ::c_short = 512;
+pub const O_ASYNC: ::c_int = 8192;
+pub const O_NDELAY: ::c_int = 2048;
+pub const PTRACE_DETACH: ::c_uint = 17;
+pub const EFD_NONBLOCK: ::c_int = 2048;
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETOWN: ::c_int = 8;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+pub const F_RDLCK: ::c_int = 0;
+pub const F_WRLCK: ::c_int = 1;
+pub const F_UNLCK: ::c_int = 2;
+pub const F_OFD_GETLK: ::c_int = 36;
+pub const F_OFD_SETLK: ::c_int = 37;
+pub const F_OFD_SETLKW: ::c_int = 38;
+pub const SFD_NONBLOCK: ::c_int = 2048;
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+pub const SFD_CLOEXEC: ::c_int = 524288;
+pub const NCCS: usize = 32;
+pub const O_TRUNC: ::c_int = 512;
+pub const O_CLOEXEC: ::c_int = 524288;
+pub const EBFONT: ::c_int = 59;
+pub const ENOSTR: ::c_int = 60;
+pub const ENODATA: ::c_int = 61;
+pub const ETIME: ::c_int = 62;
+pub const ENOSR: ::c_int = 63;
+pub const ENONET: ::c_int = 64;
+pub const ENOPKG: ::c_int = 65;
+pub const EREMOTE: ::c_int = 66;
+pub const ENOLINK: ::c_int = 67;
+pub const EADV: ::c_int = 68;
+pub const ESRMNT: ::c_int = 69;
+pub const ECOMM: ::c_int = 70;
+pub const EPROTO: ::c_int = 71;
+pub const EDOTDOT: ::c_int = 73;
+pub const SA_NODEFER: ::c_int = 1073741824;
+pub const SA_RESETHAND: ::c_int = -2147483648;
+pub const SA_RESTART: ::c_int = 268435456;
+pub const SA_NOCLDSTOP: ::c_int = 1;
+pub const EPOLL_CLOEXEC: ::c_int = 524288;
+pub const EFD_CLOEXEC: ::c_int = 524288;
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
+pub const O_DIRECT: ::c_int = 16384;
+pub const O_DIRECTORY: ::c_int = 65536;
+pub const O_NOFOLLOW: ::c_int = 131072;
+pub const MAP_HUGETLB: ::c_int = 262144;
+pub const MAP_LOCKED: ::c_int = 8192;
+pub const MAP_NORESERVE: ::c_int = 16384;
+pub const MAP_ANON: ::c_int = 32;
+pub const MAP_ANONYMOUS: ::c_int = 32;
+pub const MAP_DENYWRITE: ::c_int = 2048;
+pub const MAP_EXECUTABLE: ::c_int = 4096;
+pub const MAP_POPULATE: ::c_int = 32768;
+pub const MAP_NONBLOCK: ::c_int = 65536;
+pub const MAP_STACK: ::c_int = 131072;
+pub const MAP_SYNC: ::c_int = 0x080000;
+pub const EDEADLOCK: ::c_int = 35;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const PTRACE_GETFPREGS: ::c_uint = 14;
+pub const PTRACE_SETFPREGS: ::c_uint = 15;
+pub const PTRACE_GETFPXREGS: ::c_uint = 18;
+pub const PTRACE_SETFPXREGS: ::c_uint = 19;
+pub const PTRACE_GETREGS: ::c_uint = 12;
+pub const PTRACE_SETREGS: ::c_uint = 13;
+pub const MCL_CURRENT: ::c_int = 1;
+pub const MCL_FUTURE: ::c_int = 2;
+pub const MCL_ONFAULT: ::c_int = 4;
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+pub const CBAUD: ::tcflag_t = 4111;
+pub const TAB1: ::tcflag_t = 2048;
+pub const TAB2: ::tcflag_t = 4096;
+pub const TAB3: ::tcflag_t = 6144;
+pub const CR1: ::tcflag_t = 512;
+pub const CR2: ::tcflag_t = 1024;
+pub const CR3: ::tcflag_t = 1536;
+pub const FF1: ::tcflag_t = 32768;
+pub const BS1: ::tcflag_t = 8192;
+pub const VT1: ::tcflag_t = 16384;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 1024;
+pub const IXOFF: ::tcflag_t = 4096;
+pub const ONLCR: ::tcflag_t = 4;
+pub const CSIZE: ::tcflag_t = 48;
+pub const CS6: ::tcflag_t = 16;
+pub const CS7: ::tcflag_t = 32;
+pub const CS8: ::tcflag_t = 48;
+pub const CSTOPB: ::tcflag_t = 64;
+pub const CREAD: ::tcflag_t = 128;
+pub const PARENB: ::tcflag_t = 256;
+pub const PARODD: ::tcflag_t = 512;
+pub const HUPCL: ::tcflag_t = 1024;
+pub const CLOCAL: ::tcflag_t = 2048;
+pub const ECHOKE: ::tcflag_t = 2048;
+pub const ECHOE: ::tcflag_t = 16;
+pub const ECHOK: ::tcflag_t = 32;
+pub const ECHONL: ::tcflag_t = 64;
+pub const ECHOPRT: ::tcflag_t = 1024;
+pub const ECHOCTL: ::tcflag_t = 512;
+pub const ISIG: ::tcflag_t = 1;
+pub const ICANON: ::tcflag_t = 2;
+pub const PENDIN: ::tcflag_t = 16384;
+pub const NOFLSH: ::tcflag_t = 128;
+pub const CIBAUD: ::tcflag_t = 269418496;
+pub const CBAUDEX: ::tcflag_t = 4096;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 2;
+pub const NLDLY: ::tcflag_t = 256;
+pub const CRDLY: ::tcflag_t = 1536;
+pub const TABDLY: ::tcflag_t = 6144;
+pub const BSDLY: ::tcflag_t = 8192;
+pub const FFDLY: ::tcflag_t = 32768;
+pub const VTDLY: ::tcflag_t = 16384;
+pub const XTABS: ::tcflag_t = 6144;
+pub const B0: ::speed_t = 0;
+pub const B50: ::speed_t = 1;
+pub const B75: ::speed_t = 2;
+pub const B110: ::speed_t = 3;
+pub const B134: ::speed_t = 4;
+pub const B150: ::speed_t = 5;
+pub const B200: ::speed_t = 6;
+pub const B300: ::speed_t = 7;
+pub const B600: ::speed_t = 8;
+pub const B1200: ::speed_t = 9;
+pub const B1800: ::speed_t = 10;
+pub const B2400: ::speed_t = 11;
+pub const B4800: ::speed_t = 12;
+pub const B9600: ::speed_t = 13;
+pub const B19200: ::speed_t = 14;
+pub const B38400: ::speed_t = 15;
+pub const EXTA: ::speed_t = 14;
+pub const EXTB: ::speed_t = 15;
+pub const B57600: ::speed_t = 4097;
+pub const B115200: ::speed_t = 4098;
+pub const B230400: ::speed_t = 4099;
+pub const B460800: ::speed_t = 4100;
+pub const B500000: ::speed_t = 4101;
+pub const B576000: ::speed_t = 4102;
+pub const B921600: ::speed_t = 4103;
+pub const B1000000: ::speed_t = 4104;
+pub const B1152000: ::speed_t = 4105;
+pub const B1500000: ::speed_t = 4106;
+pub const B2000000: ::speed_t = 4107;
+pub const B2500000: ::speed_t = 4108;
+pub const B3000000: ::speed_t = 4109;
+pub const B3500000: ::speed_t = 4110;
+pub const B4000000: ::speed_t = 4111;
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 32768;
+pub const TOSTOP: ::tcflag_t = 256;
+pub const FLUSHO: ::tcflag_t = 4096;
+pub const EXTPROC: ::tcflag_t = 65536;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
+pub const NGREG: usize = 32;
+pub const REG_PC: usize = 0;
+pub const REG_RA: usize = 1;
+pub const REG_SP: usize = 2;
+pub const REG_TP: usize = 4;
+pub const REG_S0: usize = 8;
+pub const REG_S1: usize = 9;
+pub const REG_A0: usize = 10;
+pub const REG_S2: usize = 18;
+pub const REG_NARGS: usize = 8;
+
+pub const COMPAT_HWCAP_ISA_I: ::c_ulong = 1 << (b'I' - b'A');
+pub const COMPAT_HWCAP_ISA_M: ::c_ulong = 1 << (b'M' - b'A');
+pub const COMPAT_HWCAP_ISA_A: ::c_ulong = 1 << (b'A' - b'A');
+pub const COMPAT_HWCAP_ISA_F: ::c_ulong = 1 << (b'F' - b'A');
+pub const COMPAT_HWCAP_ISA_D: ::c_ulong = 1 << (b'D' - b'A');
+pub const COMPAT_HWCAP_ISA_C: ::c_ulong = 1 << (b'C' - b'A');
+pub const COMPAT_HWCAP_ISA_V: ::c_ulong = 1 << (b'V' - b'A');
+
+pub const SYS_read: ::c_long = 63;
+pub const SYS_write: ::c_long = 64;
+pub const SYS_close: ::c_long = 57;
+pub const SYS_fstat: ::c_long = 80;
+pub const SYS_lseek: ::c_long = 62;
+pub const SYS_mmap: ::c_long = 222;
+pub const SYS_mprotect: ::c_long = 226;
+pub const SYS_munmap: ::c_long = 215;
+pub const SYS_brk: ::c_long = 214;
+pub const SYS_rt_sigaction: ::c_long = 134;
+pub const SYS_rt_sigprocmask: ::c_long = 135;
+pub const SYS_rt_sigreturn: ::c_long = 139;
+pub const SYS_ioctl: ::c_long = 29;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_readv: ::c_long = 65;
+pub const SYS_writev: ::c_long = 66;
+pub const SYS_sched_yield: ::c_long = 124;
+pub const SYS_mremap: ::c_long = 216;
+pub const SYS_msync: ::c_long = 227;
+pub const SYS_mincore: ::c_long = 232;
+pub const SYS_madvise: ::c_long = 233;
+pub const SYS_shmget: ::c_long = 194;
+pub const SYS_shmat: ::c_long = 196;
+pub const SYS_shmctl: ::c_long = 195;
+pub const SYS_dup: ::c_long = 23;
+pub const SYS_nanosleep: ::c_long = 101;
+pub const SYS_getitimer: ::c_long = 102;
+pub const SYS_setitimer: ::c_long = 103;
+pub const SYS_getpid: ::c_long = 172;
+pub const SYS_sendfile: ::c_long = 71;
+pub const SYS_socket: ::c_long = 198;
+pub const SYS_connect: ::c_long = 203;
+pub const SYS_accept: ::c_long = 202;
+pub const SYS_sendto: ::c_long = 206;
+pub const SYS_recvfrom: ::c_long = 207;
+pub const SYS_sendmsg: ::c_long = 211;
+pub const SYS_recvmsg: ::c_long = 212;
+pub const SYS_shutdown: ::c_long = 210;
+pub const SYS_bind: ::c_long = 200;
+pub const SYS_listen: ::c_long = 201;
+pub const SYS_getsockname: ::c_long = 204;
+pub const SYS_getpeername: ::c_long = 205;
+pub const SYS_socketpair: ::c_long = 199;
+pub const SYS_setsockopt: ::c_long = 208;
+pub const SYS_getsockopt: ::c_long = 209;
+pub const SYS_clone: ::c_long = 220;
+pub const SYS_execve: ::c_long = 221;
+pub const SYS_exit: ::c_long = 93;
+pub const SYS_wait4: ::c_long = 260;
+pub const SYS_kill: ::c_long = 129;
+pub const SYS_uname: ::c_long = 160;
+pub const SYS_semget: ::c_long = 190;
+pub const SYS_semop: ::c_long = 193;
+pub const SYS_semctl: ::c_long = 191;
+pub const SYS_shmdt: ::c_long = 197;
+pub const SYS_msgget: ::c_long = 186;
+pub const SYS_msgsnd: ::c_long = 189;
+pub const SYS_msgrcv: ::c_long = 188;
+pub const SYS_msgctl: ::c_long = 187;
+pub const SYS_fcntl: ::c_long = 25;
+pub const SYS_flock: ::c_long = 32;
+pub const SYS_fsync: ::c_long = 82;
+pub const SYS_fdatasync: ::c_long = 83;
+pub const SYS_truncate: ::c_long = 45;
+pub const SYS_ftruncate: ::c_long = 46;
+pub const SYS_getcwd: ::c_long = 17;
+pub const SYS_chdir: ::c_long = 49;
+pub const SYS_fchdir: ::c_long = 50;
+pub const SYS_fchmod: ::c_long = 52;
+pub const SYS_fchown: ::c_long = 55;
+pub const SYS_umask: ::c_long = 166;
+pub const SYS_gettimeofday: ::c_long = 169;
+pub const SYS_getrlimit: ::c_long = 163;
+pub const SYS_getrusage: ::c_long = 165;
+pub const SYS_sysinfo: ::c_long = 179;
+pub const SYS_times: ::c_long = 153;
+pub const SYS_ptrace: ::c_long = 117;
+pub const SYS_getuid: ::c_long = 174;
+pub const SYS_syslog: ::c_long = 116;
+pub const SYS_getgid: ::c_long = 176;
+pub const SYS_setuid: ::c_long = 146;
+pub const SYS_setgid: ::c_long = 144;
+pub const SYS_geteuid: ::c_long = 175;
+pub const SYS_getegid: ::c_long = 177;
+pub const SYS_setpgid: ::c_long = 154;
+pub const SYS_getppid: ::c_long = 173;
+pub const SYS_setsid: ::c_long = 157;
+pub const SYS_setreuid: ::c_long = 145;
+pub const SYS_setregid: ::c_long = 143;
+pub const SYS_getgroups: ::c_long = 158;
+pub const SYS_setgroups: ::c_long = 159;
+pub const SYS_setresuid: ::c_long = 147;
+pub const SYS_getresuid: ::c_long = 148;
+pub const SYS_setresgid: ::c_long = 149;
+pub const SYS_getresgid: ::c_long = 150;
+pub const SYS_getpgid: ::c_long = 155;
+pub const SYS_setfsuid: ::c_long = 151;
+pub const SYS_setfsgid: ::c_long = 152;
+pub const SYS_getsid: ::c_long = 156;
+pub const SYS_capget: ::c_long = 90;
+pub const SYS_capset: ::c_long = 91;
+pub const SYS_rt_sigpending: ::c_long = 136;
+pub const SYS_rt_sigtimedwait: ::c_long = 137;
+pub const SYS_rt_sigqueueinfo: ::c_long = 138;
+pub const SYS_rt_sigsuspend: ::c_long = 133;
+pub const SYS_sigaltstack: ::c_long = 132;
+pub const SYS_personality: ::c_long = 92;
+pub const SYS_statfs: ::c_long = 43;
+pub const SYS_fstatfs: ::c_long = 44;
+pub const SYS_getpriority: ::c_long = 141;
+pub const SYS_setpriority: ::c_long = 140;
+pub const SYS_sched_setparam: ::c_long = 118;
+pub const SYS_sched_getparam: ::c_long = 121;
+pub const SYS_sched_setscheduler: ::c_long = 119;
+pub const SYS_sched_getscheduler: ::c_long = 120;
+pub const SYS_sched_get_priority_max: ::c_long = 125;
+pub const SYS_sched_get_priority_min: ::c_long = 126;
+pub const SYS_sched_rr_get_interval: ::c_long = 127;
+pub const SYS_mlock: ::c_long = 228;
+pub const SYS_munlock: ::c_long = 229;
+pub const SYS_mlockall: ::c_long = 230;
+pub const SYS_munlockall: ::c_long = 231;
+pub const SYS_vhangup: ::c_long = 58;
+pub const SYS_pivot_root: ::c_long = 41;
+pub const SYS_prctl: ::c_long = 167;
+pub const SYS_adjtimex: ::c_long = 171;
+pub const SYS_setrlimit: ::c_long = 164;
+pub const SYS_chroot: ::c_long = 51;
+pub const SYS_sync: ::c_long = 81;
+pub const SYS_acct: ::c_long = 89;
+pub const SYS_settimeofday: ::c_long = 170;
+pub const SYS_mount: ::c_long = 40;
+pub const SYS_umount2: ::c_long = 39;
+pub const SYS_swapon: ::c_long = 224;
+pub const SYS_swapoff: ::c_long = 225;
+pub const SYS_reboot: ::c_long = 142;
+pub const SYS_sethostname: ::c_long = 161;
+pub const SYS_setdomainname: ::c_long = 162;
+pub const SYS_init_module: ::c_long = 105;
+pub const SYS_delete_module: ::c_long = 106;
+pub const SYS_quotactl: ::c_long = 60;
+pub const SYS_nfsservctl: ::c_long = 42;
+pub const SYS_gettid: ::c_long = 178;
+pub const SYS_readahead: ::c_long = 213;
+pub const SYS_setxattr: ::c_long = 5;
+pub const SYS_lsetxattr: ::c_long = 6;
+pub const SYS_fsetxattr: ::c_long = 7;
+pub const SYS_getxattr: ::c_long = 8;
+pub const SYS_lgetxattr: ::c_long = 9;
+pub const SYS_fgetxattr: ::c_long = 10;
+pub const SYS_listxattr: ::c_long = 11;
+pub const SYS_llistxattr: ::c_long = 12;
+pub const SYS_flistxattr: ::c_long = 13;
+pub const SYS_removexattr: ::c_long = 14;
+pub const SYS_lremovexattr: ::c_long = 15;
+pub const SYS_fremovexattr: ::c_long = 16;
+pub const SYS_tkill: ::c_long = 130;
+pub const SYS_futex: ::c_long = 98;
+pub const SYS_sched_setaffinity: ::c_long = 122;
+pub const SYS_sched_getaffinity: ::c_long = 123;
+pub const SYS_io_setup: ::c_long = 0;
+pub const SYS_io_destroy: ::c_long = 1;
+pub const SYS_io_getevents: ::c_long = 4;
+pub const SYS_io_submit: ::c_long = 2;
+pub const SYS_io_cancel: ::c_long = 3;
+pub const SYS_lookup_dcookie: ::c_long = 18;
+pub const SYS_remap_file_pages: ::c_long = 234;
+pub const SYS_getdents64: ::c_long = 61;
+pub const SYS_set_tid_address: ::c_long = 96;
+pub const SYS_restart_syscall: ::c_long = 128;
+pub const SYS_semtimedop: ::c_long = 192;
+pub const SYS_fadvise64: ::c_long = 223;
+pub const SYS_timer_create: ::c_long = 107;
+pub const SYS_timer_settime: ::c_long = 110;
+pub const SYS_timer_gettime: ::c_long = 108;
+pub const SYS_timer_getoverrun: ::c_long = 109;
+pub const SYS_timer_delete: ::c_long = 111;
+pub const SYS_clock_settime: ::c_long = 112;
+pub const SYS_clock_gettime: ::c_long = 113;
+pub const SYS_clock_getres: ::c_long = 114;
+pub const SYS_clock_nanosleep: ::c_long = 115;
+pub const SYS_exit_group: ::c_long = 94;
+pub const SYS_epoll_ctl: ::c_long = 21;
+pub const SYS_tgkill: ::c_long = 131;
+pub const SYS_mbind: ::c_long = 235;
+pub const SYS_set_mempolicy: ::c_long = 237;
+pub const SYS_get_mempolicy: ::c_long = 236;
+pub const SYS_mq_open: ::c_long = 180;
+pub const SYS_mq_unlink: ::c_long = 181;
+pub const SYS_mq_timedsend: ::c_long = 182;
+pub const SYS_mq_timedreceive: ::c_long = 183;
+pub const SYS_mq_notify: ::c_long = 184;
+pub const SYS_mq_getsetattr: ::c_long = 185;
+pub const SYS_kexec_load: ::c_long = 104;
+pub const SYS_waitid: ::c_long = 95;
+pub const SYS_add_key: ::c_long = 217;
+pub const SYS_request_key: ::c_long = 218;
+pub const SYS_keyctl: ::c_long = 219;
+pub const SYS_ioprio_set: ::c_long = 30;
+pub const SYS_ioprio_get: ::c_long = 31;
+pub const SYS_inotify_add_watch: ::c_long = 27;
+pub const SYS_inotify_rm_watch: ::c_long = 28;
+pub const SYS_migrate_pages: ::c_long = 238;
+pub const SYS_openat: ::c_long = 56;
+pub const SYS_mkdirat: ::c_long = 34;
+pub const SYS_mknodat: ::c_long = 33;
+pub const SYS_fchownat: ::c_long = 54;
+pub const SYS_newfstatat: ::c_long = 79;
+pub const SYS_unlinkat: ::c_long = 35;
+pub const SYS_linkat: ::c_long = 37;
+pub const SYS_symlinkat: ::c_long = 36;
+pub const SYS_readlinkat: ::c_long = 78;
+pub const SYS_fchmodat: ::c_long = 53;
+pub const SYS_faccessat: ::c_long = 48;
+pub const SYS_pselect6: ::c_long = 72;
+pub const SYS_ppoll: ::c_long = 73;
+pub const SYS_unshare: ::c_long = 97;
+pub const SYS_set_robust_list: ::c_long = 99;
+pub const SYS_get_robust_list: ::c_long = 100;
+pub const SYS_splice: ::c_long = 76;
+pub const SYS_tee: ::c_long = 77;
+pub const SYS_sync_file_range: ::c_long = 84;
+pub const SYS_vmsplice: ::c_long = 75;
+pub const SYS_move_pages: ::c_long = 239;
+pub const SYS_utimensat: ::c_long = 88;
+pub const SYS_epoll_pwait: ::c_long = 22;
+pub const SYS_timerfd_create: ::c_long = 85;
+pub const SYS_fallocate: ::c_long = 47;
+pub const SYS_timerfd_settime: ::c_long = 86;
+pub const SYS_timerfd_gettime: ::c_long = 87;
+pub const SYS_accept4: ::c_long = 242;
+pub const SYS_signalfd4: ::c_long = 74;
+pub const SYS_eventfd2: ::c_long = 19;
+pub const SYS_epoll_create1: ::c_long = 20;
+pub const SYS_dup3: ::c_long = 24;
+pub const SYS_pipe2: ::c_long = 59;
+pub const SYS_inotify_init1: ::c_long = 26;
+pub const SYS_preadv: ::c_long = 69;
+pub const SYS_pwritev: ::c_long = 70;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
+pub const SYS_perf_event_open: ::c_long = 241;
+pub const SYS_recvmmsg: ::c_long = 243;
+pub const SYS_fanotify_init: ::c_long = 262;
+pub const SYS_fanotify_mark: ::c_long = 263;
+pub const SYS_prlimit64: ::c_long = 261;
+pub const SYS_name_to_handle_at: ::c_long = 264;
+pub const SYS_open_by_handle_at: ::c_long = 265;
+pub const SYS_clock_adjtime: ::c_long = 266;
+pub const SYS_syncfs: ::c_long = 267;
+pub const SYS_sendmmsg: ::c_long = 269;
+pub const SYS_setns: ::c_long = 268;
+pub const SYS_getcpu: ::c_long = 168;
+pub const SYS_process_vm_readv: ::c_long = 270;
+pub const SYS_process_vm_writev: ::c_long = 271;
+pub const SYS_kcmp: ::c_long = 272;
+pub const SYS_finit_module: ::c_long = 273;
+pub const SYS_sched_setattr: ::c_long = 274;
+pub const SYS_sched_getattr: ::c_long = 275;
+pub const SYS_renameat2: ::c_long = 276;
+pub const SYS_seccomp: ::c_long = 277;
+pub const SYS_getrandom: ::c_long = 278;
+pub const SYS_memfd_create: ::c_long = 279;
+pub const SYS_bpf: ::c_long = 280;
+pub const SYS_execveat: ::c_long = 281;
+pub const SYS_userfaultfd: ::c_long = 282;
+pub const SYS_membarrier: ::c_long = 283;
+pub const SYS_mlock2: ::c_long = 284;
+pub const SYS_copy_file_range: ::c_long = 285;
+pub const SYS_preadv2: ::c_long = 286;
+pub const SYS_pwritev2: ::c_long = 287;
+pub const SYS_pkey_mprotect: ::c_long = 288;
+pub const SYS_pkey_alloc: ::c_long = 289;
+pub const SYS_pkey_free: ::c_long = 290;
+pub const SYS_statx: ::c_long = 291;
+pub const SYS_rseq: ::c_long = 293;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,964 @@
+//! s390x
+
+use pthread_mutex_t;
+
+pub type blksize_t = i64;
+pub type c_char = u8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type nlink_t = u64;
+pub type suseconds_t = i64;
+pub type wchar_t = i32;
+pub type greg_t = u64;
+pub type __u64 = u64;
+pub type __s64 = i64;
+
+s! {
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        __glibc_reserved0: ::c_int,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+        pub sa_mask: ::sigset_t,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_uint,
+        pub f_bsize: ::c_uint,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_uint,
+        pub f_frsize: ::c_uint,
+        pub f_flags: ::c_uint,
+        f_spare: [::c_uint; 4],
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct flock64 {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off64_t,
+        pub l_len: ::off64_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        _pad: ::c_int,
+        _pad2: [::c_long; 14],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        st_pad0: ::c_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        __glibc_reserved: [::c_long; 3],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        st_pad0: ::c_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_t,
+        __glibc_reserved: [::c_long; 3],
+    }
+
+    pub struct pthread_attr_t {
+        __size: [::c_ulong; 7]
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_ushort,
+        __pad1: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct __psw_t {
+        pub mask: u64,
+        pub addr: u64,
+    }
+
+    pub struct fpregset_t {
+        pub fpc: u32,
+        __pad: u32,
+        pub fprs: [fpreg_t; 16],
+    }
+
+    pub struct mcontext_t {
+        pub psw: __psw_t,
+        pub gregs: [u64; 16],
+        pub aregs: [u32; 16],
+        pub fpregs: fpregset_t,
+    }
+
+    pub struct ucontext_t {
+        pub uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_mcontext: mcontext_t,
+        pub uc_sigmask: ::sigset_t,
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_uint,
+        pub f_bsize: ::c_uint,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_uint,
+        pub f_frsize: ::c_uint,
+        pub f_flags: ::c_uint,
+        pub f_spare: [::c_uint; 4],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+}
+
+s_no_extra_traits! {
+    // FIXME: This is actually a union.
+    pub struct fpreg_t {
+        pub d: ::c_double,
+        // f: ::c_float,
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for fpreg_t {
+            fn eq(&self, other: &fpreg_t) -> bool {
+                self.d == other.d
+            }
+        }
+
+        impl Eq for fpreg_t {}
+
+        impl ::fmt::Debug for fpreg_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("fpreg_t")
+                    .field("d", &self.d)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for fpreg_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let d: u64 = unsafe { ::mem::transmute(self.d) };
+                d.hash(state);
+            }
+        }
+    }
+}
+
+pub const POSIX_FADV_DONTNEED: ::c_int = 6;
+pub const POSIX_FADV_NOREUSE: ::c_int = 7;
+
+pub const VEOF: usize = 4;
+pub const RTLD_DEEPBIND: ::c_int = 0x8;
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+pub const SFD_CLOEXEC: ::c_int = 0x080000;
+
+pub const NCCS: usize = 32;
+
+pub const O_TRUNC: ::c_int = 512;
+pub const O_NOATIME: ::c_int = 0o1000000;
+pub const O_CLOEXEC: ::c_int = 0x80000;
+pub const O_PATH: ::c_int = 0o10000000;
+pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
+
+pub const EBFONT: ::c_int = 59;
+pub const ENOSTR: ::c_int = 60;
+pub const ENODATA: ::c_int = 61;
+pub const ETIME: ::c_int = 62;
+pub const ENOSR: ::c_int = 63;
+pub const ENONET: ::c_int = 64;
+pub const ENOPKG: ::c_int = 65;
+pub const EREMOTE: ::c_int = 66;
+pub const ENOLINK: ::c_int = 67;
+pub const EADV: ::c_int = 68;
+pub const ESRMNT: ::c_int = 69;
+pub const ECOMM: ::c_int = 70;
+pub const EPROTO: ::c_int = 71;
+pub const EDOTDOT: ::c_int = 73;
+
+pub const SA_NODEFER: ::c_int = 0x40000000;
+pub const SA_RESETHAND: ::c_int = 0x80000000;
+pub const SA_RESTART: ::c_int = 0x10000000;
+pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
+
+pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
+
+pub const EFD_CLOEXEC: ::c_int = 0x80000;
+
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
+
+align_const! {
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+}
+
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const ECONNRESET: ::c_int = 104;
+pub const EDEADLK: ::c_int = 35;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTCONN: ::c_int = 107;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const O_APPEND: ::c_int = 1024;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const SA_NOCLDWAIT: ::c_int = 2;
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 4;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGSTKSZ: ::size_t = 0x2000;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+pub const SIG_SETMASK: ::c_int = 2;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_FSYNC: ::c_int = 0x101000;
+pub const O_DIRECT: ::c_int = 0x4000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_LOCKED: ::c_int = 0x02000;
+pub const MAP_NORESERVE: ::c_int = 0x04000;
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_ANONYMOUS: ::c_int = 0x0020;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const EDEADLOCK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EBADMSG: ::c_int = 74;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const EHWPOISON: ::c_int = 133;
+pub const ERFKILL: ::c_int = 132;
+
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
+pub const SIGUNUSED: ::c_int = 31;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+
+pub const O_ASYNC: ::c_int = 0x2000;
+pub const O_NDELAY: ::c_int = 0x800;
+
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+
+pub const PTRACE_DETACH: ::c_uint = 17;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+
+pub const EFD_NONBLOCK: ::c_int = 0x800;
+
+pub const F_RDLCK: ::c_int = 0;
+pub const F_WRLCK: ::c_int = 1;
+pub const F_UNLCK: ::c_int = 2;
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETOWN: ::c_int = 8;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+pub const F_OFD_GETLK: ::c_int = 36;
+pub const F_OFD_SETLK: ::c_int = 37;
+pub const F_OFD_SETLKW: ::c_int = 38;
+
+pub const SFD_NONBLOCK: ::c_int = 0x0800;
+
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+
+pub const VTIME: usize = 5;
+pub const VSWTC: usize = 7;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VSUSP: usize = 10;
+pub const VREPRINT: usize = 12;
+pub const VDISCARD: usize = 13;
+pub const VWERASE: usize = 14;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const ONLCR: ::tcflag_t = 0o000004;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const CBAUD: ::speed_t = 0o010017;
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const CSIZE: ::tcflag_t = 0o000060;
+pub const CS6: ::tcflag_t = 0o000020;
+pub const CS7: ::tcflag_t = 0o000040;
+pub const CS8: ::tcflag_t = 0o000060;
+pub const CSTOPB: ::tcflag_t = 0o000100;
+pub const CREAD: ::tcflag_t = 0o000200;
+pub const PARENB: ::tcflag_t = 0o000400;
+pub const PARODD: ::tcflag_t = 0o001000;
+pub const HUPCL: ::tcflag_t = 0o002000;
+pub const CLOCAL: ::tcflag_t = 0o004000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+
+pub const ISIG: ::tcflag_t = 0o000001;
+pub const ICANON: ::tcflag_t = 0o000002;
+pub const XCASE: ::tcflag_t = 0o000004;
+pub const ECHOE: ::tcflag_t = 0o000020;
+pub const ECHOK: ::tcflag_t = 0o000040;
+pub const ECHONL: ::tcflag_t = 0o000100;
+pub const NOFLSH: ::tcflag_t = 0o000200;
+pub const ECHOCTL: ::tcflag_t = 0o001000;
+pub const ECHOPRT: ::tcflag_t = 0o002000;
+pub const ECHOKE: ::tcflag_t = 0o004000;
+pub const PENDIN: ::tcflag_t = 0o040000;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const IXON: ::tcflag_t = 0o002000;
+pub const IXOFF: ::tcflag_t = 0o010000;
+
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_restart_syscall: ::c_long = 7;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execve: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_mount: ::c_long = 21;
+pub const SYS_umount: ::c_long = 22;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_alarm: ::c_long = 27;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_utime: ::c_long = 30;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_signal: ::c_long = 48;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount2: ::c_long = 52;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_sigsuspend: ::c_long = 72;
+pub const SYS_sigpending: ::c_long = 73;
+pub const SYS_sethostname: ::c_long = 74;
+pub const SYS_setrlimit: ::c_long = 75;
+pub const SYS_getrusage: ::c_long = 77;
+pub const SYS_gettimeofday: ::c_long = 78;
+pub const SYS_settimeofday: ::c_long = 79;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_readlink: ::c_long = 85;
+pub const SYS_uselib: ::c_long = 86;
+pub const SYS_swapon: ::c_long = 87;
+pub const SYS_reboot: ::c_long = 88;
+pub const SYS_readdir: ::c_long = 89;
+pub const SYS_mmap: ::c_long = 90;
+pub const SYS_munmap: ::c_long = 91;
+pub const SYS_truncate: ::c_long = 92;
+pub const SYS_ftruncate: ::c_long = 93;
+pub const SYS_fchmod: ::c_long = 94;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_socketcall: ::c_long = 102;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_setitimer: ::c_long = 104;
+pub const SYS_getitimer: ::c_long = 105;
+pub const SYS_stat: ::c_long = 106;
+pub const SYS_lstat: ::c_long = 107;
+pub const SYS_fstat: ::c_long = 108;
+pub const SYS_lookup_dcookie: ::c_long = 110;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_idle: ::c_long = 112;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_ipc: ::c_long = 117;
+pub const SYS_fsync: ::c_long = 118;
+pub const SYS_sigreturn: ::c_long = 119;
+pub const SYS_clone: ::c_long = 120;
+pub const SYS_setdomainname: ::c_long = 121;
+pub const SYS_uname: ::c_long = 122;
+pub const SYS_adjtimex: ::c_long = 124;
+pub const SYS_mprotect: ::c_long = 125;
+pub const SYS_sigprocmask: ::c_long = 126;
+pub const SYS_create_module: ::c_long = 127;
+pub const SYS_init_module: ::c_long = 128;
+pub const SYS_delete_module: ::c_long = 129;
+pub const SYS_get_kernel_syms: ::c_long = 130;
+pub const SYS_quotactl: ::c_long = 131;
+pub const SYS_getpgid: ::c_long = 132;
+pub const SYS_fchdir: ::c_long = 133;
+pub const SYS_bdflush: ::c_long = 134;
+pub const SYS_sysfs: ::c_long = 135;
+pub const SYS_personality: ::c_long = 136;
+pub const SYS_afs_syscall: ::c_long = 137; /* Syscall for Andrew File System */
+pub const SYS_getdents: ::c_long = 141;
+pub const SYS_flock: ::c_long = 143;
+pub const SYS_msync: ::c_long = 144;
+pub const SYS_readv: ::c_long = 145;
+pub const SYS_writev: ::c_long = 146;
+pub const SYS_getsid: ::c_long = 147;
+pub const SYS_fdatasync: ::c_long = 148;
+pub const SYS__sysctl: ::c_long = 149;
+pub const SYS_mlock: ::c_long = 150;
+pub const SYS_munlock: ::c_long = 151;
+pub const SYS_mlockall: ::c_long = 152;
+pub const SYS_munlockall: ::c_long = 153;
+pub const SYS_sched_setparam: ::c_long = 154;
+pub const SYS_sched_getparam: ::c_long = 155;
+pub const SYS_sched_setscheduler: ::c_long = 156;
+pub const SYS_sched_getscheduler: ::c_long = 157;
+pub const SYS_sched_yield: ::c_long = 158;
+pub const SYS_sched_get_priority_max: ::c_long = 159;
+pub const SYS_sched_get_priority_min: ::c_long = 160;
+pub const SYS_sched_rr_get_interval: ::c_long = 161;
+pub const SYS_nanosleep: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_query_module: ::c_long = 167;
+pub const SYS_poll: ::c_long = 168;
+pub const SYS_nfsservctl: ::c_long = 169;
+pub const SYS_prctl: ::c_long = 172;
+pub const SYS_rt_sigreturn: ::c_long = 173;
+pub const SYS_rt_sigaction: ::c_long = 174;
+pub const SYS_rt_sigprocmask: ::c_long = 175;
+pub const SYS_rt_sigpending: ::c_long = 176;
+pub const SYS_rt_sigtimedwait: ::c_long = 177;
+pub const SYS_rt_sigqueueinfo: ::c_long = 178;
+pub const SYS_rt_sigsuspend: ::c_long = 179;
+pub const SYS_pread64: ::c_long = 180;
+pub const SYS_pwrite64: ::c_long = 181;
+pub const SYS_getcwd: ::c_long = 183;
+pub const SYS_capget: ::c_long = 184;
+pub const SYS_capset: ::c_long = 185;
+pub const SYS_sigaltstack: ::c_long = 186;
+pub const SYS_sendfile: ::c_long = 187;
+pub const SYS_getpmsg: ::c_long = 188;
+pub const SYS_putpmsg: ::c_long = 189;
+pub const SYS_vfork: ::c_long = 190;
+pub const SYS_pivot_root: ::c_long = 217;
+pub const SYS_mincore: ::c_long = 218;
+pub const SYS_madvise: ::c_long = 219;
+pub const SYS_getdents64: ::c_long = 220;
+pub const SYS_readahead: ::c_long = 222;
+pub const SYS_setxattr: ::c_long = 224;
+pub const SYS_lsetxattr: ::c_long = 225;
+pub const SYS_fsetxattr: ::c_long = 226;
+pub const SYS_getxattr: ::c_long = 227;
+pub const SYS_lgetxattr: ::c_long = 228;
+pub const SYS_fgetxattr: ::c_long = 229;
+pub const SYS_listxattr: ::c_long = 230;
+pub const SYS_llistxattr: ::c_long = 231;
+pub const SYS_flistxattr: ::c_long = 232;
+pub const SYS_removexattr: ::c_long = 233;
+pub const SYS_lremovexattr: ::c_long = 234;
+pub const SYS_fremovexattr: ::c_long = 235;
+pub const SYS_gettid: ::c_long = 236;
+pub const SYS_tkill: ::c_long = 237;
+pub const SYS_futex: ::c_long = 238;
+pub const SYS_sched_setaffinity: ::c_long = 239;
+pub const SYS_sched_getaffinity: ::c_long = 240;
+pub const SYS_tgkill: ::c_long = 241;
+pub const SYS_io_setup: ::c_long = 243;
+pub const SYS_io_destroy: ::c_long = 244;
+pub const SYS_io_getevents: ::c_long = 245;
+pub const SYS_io_submit: ::c_long = 246;
+pub const SYS_io_cancel: ::c_long = 247;
+pub const SYS_exit_group: ::c_long = 248;
+pub const SYS_epoll_create: ::c_long = 249;
+pub const SYS_epoll_ctl: ::c_long = 250;
+pub const SYS_epoll_wait: ::c_long = 251;
+pub const SYS_set_tid_address: ::c_long = 252;
+pub const SYS_fadvise64: ::c_long = 253;
+pub const SYS_timer_create: ::c_long = 254;
+pub const SYS_timer_settime: ::c_long = 255;
+pub const SYS_timer_gettime: ::c_long = 256;
+pub const SYS_timer_getoverrun: ::c_long = 257;
+pub const SYS_timer_delete: ::c_long = 258;
+pub const SYS_clock_settime: ::c_long = 259;
+pub const SYS_clock_gettime: ::c_long = 260;
+pub const SYS_clock_getres: ::c_long = 261;
+pub const SYS_clock_nanosleep: ::c_long = 262;
+pub const SYS_statfs64: ::c_long = 265;
+pub const SYS_fstatfs64: ::c_long = 266;
+pub const SYS_remap_file_pages: ::c_long = 267;
+pub const SYS_mbind: ::c_long = 268;
+pub const SYS_get_mempolicy: ::c_long = 269;
+pub const SYS_set_mempolicy: ::c_long = 270;
+pub const SYS_mq_open: ::c_long = 271;
+pub const SYS_mq_unlink: ::c_long = 272;
+pub const SYS_mq_timedsend: ::c_long = 273;
+pub const SYS_mq_timedreceive: ::c_long = 274;
+pub const SYS_mq_notify: ::c_long = 275;
+pub const SYS_mq_getsetattr: ::c_long = 276;
+pub const SYS_kexec_load: ::c_long = 277;
+pub const SYS_add_key: ::c_long = 278;
+pub const SYS_request_key: ::c_long = 279;
+pub const SYS_keyctl: ::c_long = 280;
+pub const SYS_waitid: ::c_long = 281;
+pub const SYS_ioprio_set: ::c_long = 282;
+pub const SYS_ioprio_get: ::c_long = 283;
+pub const SYS_inotify_init: ::c_long = 284;
+pub const SYS_inotify_add_watch: ::c_long = 285;
+pub const SYS_inotify_rm_watch: ::c_long = 286;
+pub const SYS_migrate_pages: ::c_long = 287;
+pub const SYS_openat: ::c_long = 288;
+pub const SYS_mkdirat: ::c_long = 289;
+pub const SYS_mknodat: ::c_long = 290;
+pub const SYS_fchownat: ::c_long = 291;
+pub const SYS_futimesat: ::c_long = 292;
+pub const SYS_unlinkat: ::c_long = 294;
+pub const SYS_renameat: ::c_long = 295;
+pub const SYS_linkat: ::c_long = 296;
+pub const SYS_symlinkat: ::c_long = 297;
+pub const SYS_readlinkat: ::c_long = 298;
+pub const SYS_fchmodat: ::c_long = 299;
+pub const SYS_faccessat: ::c_long = 300;
+pub const SYS_pselect6: ::c_long = 301;
+pub const SYS_ppoll: ::c_long = 302;
+pub const SYS_unshare: ::c_long = 303;
+pub const SYS_set_robust_list: ::c_long = 304;
+pub const SYS_get_robust_list: ::c_long = 305;
+pub const SYS_splice: ::c_long = 306;
+pub const SYS_sync_file_range: ::c_long = 307;
+pub const SYS_tee: ::c_long = 308;
+pub const SYS_vmsplice: ::c_long = 309;
+pub const SYS_move_pages: ::c_long = 310;
+pub const SYS_getcpu: ::c_long = 311;
+pub const SYS_epoll_pwait: ::c_long = 312;
+pub const SYS_utimes: ::c_long = 313;
+pub const SYS_fallocate: ::c_long = 314;
+pub const SYS_utimensat: ::c_long = 315;
+pub const SYS_signalfd: ::c_long = 316;
+pub const SYS_timerfd: ::c_long = 317;
+pub const SYS_eventfd: ::c_long = 318;
+pub const SYS_timerfd_create: ::c_long = 319;
+pub const SYS_timerfd_settime: ::c_long = 320;
+pub const SYS_timerfd_gettime: ::c_long = 321;
+pub const SYS_signalfd4: ::c_long = 322;
+pub const SYS_eventfd2: ::c_long = 323;
+pub const SYS_inotify_init1: ::c_long = 324;
+pub const SYS_pipe2: ::c_long = 325;
+pub const SYS_dup3: ::c_long = 326;
+pub const SYS_epoll_create1: ::c_long = 327;
+pub const SYS_preadv: ::c_long = 328;
+pub const SYS_pwritev: ::c_long = 329;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 330;
+pub const SYS_perf_event_open: ::c_long = 331;
+pub const SYS_fanotify_init: ::c_long = 332;
+pub const SYS_fanotify_mark: ::c_long = 333;
+pub const SYS_prlimit64: ::c_long = 334;
+pub const SYS_name_to_handle_at: ::c_long = 335;
+pub const SYS_open_by_handle_at: ::c_long = 336;
+pub const SYS_clock_adjtime: ::c_long = 337;
+pub const SYS_syncfs: ::c_long = 338;
+pub const SYS_setns: ::c_long = 339;
+pub const SYS_process_vm_readv: ::c_long = 340;
+pub const SYS_process_vm_writev: ::c_long = 341;
+pub const SYS_s390_runtime_instr: ::c_long = 342;
+pub const SYS_kcmp: ::c_long = 343;
+pub const SYS_finit_module: ::c_long = 344;
+pub const SYS_sched_setattr: ::c_long = 345;
+pub const SYS_sched_getattr: ::c_long = 346;
+pub const SYS_renameat2: ::c_long = 347;
+pub const SYS_seccomp: ::c_long = 348;
+pub const SYS_getrandom: ::c_long = 349;
+pub const SYS_memfd_create: ::c_long = 350;
+pub const SYS_bpf: ::c_long = 351;
+pub const SYS_s390_pci_mmio_write: ::c_long = 352;
+pub const SYS_s390_pci_mmio_read: ::c_long = 353;
+pub const SYS_execveat: ::c_long = 354;
+pub const SYS_userfaultfd: ::c_long = 355;
+pub const SYS_membarrier: ::c_long = 356;
+pub const SYS_recvmmsg: ::c_long = 357;
+pub const SYS_sendmmsg: ::c_long = 358;
+pub const SYS_socket: ::c_long = 359;
+pub const SYS_socketpair: ::c_long = 360;
+pub const SYS_bind: ::c_long = 361;
+pub const SYS_connect: ::c_long = 362;
+pub const SYS_listen: ::c_long = 363;
+pub const SYS_accept4: ::c_long = 364;
+pub const SYS_getsockopt: ::c_long = 365;
+pub const SYS_setsockopt: ::c_long = 366;
+pub const SYS_getsockname: ::c_long = 367;
+pub const SYS_getpeername: ::c_long = 368;
+pub const SYS_sendto: ::c_long = 369;
+pub const SYS_sendmsg: ::c_long = 370;
+pub const SYS_recvfrom: ::c_long = 371;
+pub const SYS_recvmsg: ::c_long = 372;
+pub const SYS_shutdown: ::c_long = 373;
+pub const SYS_mlock2: ::c_long = 374;
+pub const SYS_copy_file_range: ::c_long = 375;
+pub const SYS_preadv2: ::c_long = 376;
+pub const SYS_pwritev2: ::c_long = 377;
+pub const SYS_lchown: ::c_long = 198;
+pub const SYS_setuid: ::c_long = 213;
+pub const SYS_getuid: ::c_long = 199;
+pub const SYS_setgid: ::c_long = 214;
+pub const SYS_getgid: ::c_long = 200;
+pub const SYS_geteuid: ::c_long = 201;
+pub const SYS_setreuid: ::c_long = 203;
+pub const SYS_setregid: ::c_long = 204;
+pub const SYS_getrlimit: ::c_long = 191;
+pub const SYS_getgroups: ::c_long = 205;
+pub const SYS_fchown: ::c_long = 207;
+pub const SYS_setresuid: ::c_long = 208;
+pub const SYS_setresgid: ::c_long = 210;
+pub const SYS_getresgid: ::c_long = 211;
+pub const SYS_select: ::c_long = 142;
+pub const SYS_getegid: ::c_long = 202;
+pub const SYS_setgroups: ::c_long = 206;
+pub const SYS_getresuid: ::c_long = 209;
+pub const SYS_chown: ::c_long = 212;
+pub const SYS_setfsuid: ::c_long = 215;
+pub const SYS_setfsgid: ::c_long = 216;
+pub const SYS_newfstatat: ::c_long = 293;
+pub const SYS_statx: ::c_long = 379;
+pub const SYS_rseq: ::c_long = 383;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+extern "C" {
+
+    pub fn sysctl(
+        name: *mut ::c_int,
+        namelen: ::c_int,
+        oldp: *mut ::c_void,
+        oldlenp: *mut ::size_t,
+        newp: *mut ::c_void,
+        newlen: ::size_t,
+    ) -> ::c_int;
+    pub fn getcontext(ucp: *mut ::ucontext_t) -> ::c_int;
+    pub fn setcontext(ucp: *const ::ucontext_t) -> ::c_int;
+    pub fn makecontext(ucp: *mut ::ucontext_t, func: extern "C" fn(), argc: ::c_int, ...);
+    pub fn swapcontext(uocp: *mut ::ucontext_t, ucp: *const ::ucontext_t) -> ::c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [i64; 4]
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,931 @@
+//! SPARC64-specific definitions for 64-bit linux-like values
+
+use pthread_mutex_t;
+
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = i8;
+pub type wchar_t = i32;
+pub type nlink_t = u32;
+pub type blksize_t = i64;
+pub type suseconds_t = i32;
+pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
+
+s! {
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        #[cfg(target_arch = "sparc64")]
+        __reserved0: ::c_int,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        f_spare: [::__fsword_t; 5],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        #[doc(hidden)]
+        #[deprecated(
+            since="0.2.54",
+            note="Please leave a comment on \
+                  https://github.com/rust-lang/libc/pull/1316 if you're using \
+                  this field"
+        )]
+        pub _pad: [::c_int; 29],
+        _align: [usize; 0],
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct flock64 {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off64_t,
+        pub l_len: ::off64_t,
+        pub l_pid: ::pid_t,
+        __reserved:  ::c_short,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        __pad0: u64,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad1: u64,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_long; 2],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        __pad0: u64,
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad2: ::c_int,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __reserved: [::c_long; 2],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__fsword_t; 4],
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct pthread_attr_t {
+        __size: [u64; 7]
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        __pad0: u16,
+        pub __seq: ::c_ushort,
+        __unused1: ::c_ulonglong,
+        __unused2: ::c_ulonglong,
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_segsz: ::size_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __reserved1: ::c_ulong,
+        __reserved2: ::c_ulong
+    }
+}
+
+pub const POSIX_FADV_DONTNEED: ::c_int = 4;
+pub const POSIX_FADV_NOREUSE: ::c_int = 5;
+
+pub const VEOF: usize = 4;
+pub const RTLD_DEEPBIND: ::c_int = 0x8;
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
+
+pub const O_APPEND: ::c_int = 0x8;
+pub const O_CREAT: ::c_int = 0x200;
+pub const O_EXCL: ::c_int = 0x800;
+pub const O_NOCTTY: ::c_int = 0x8000;
+pub const O_NONBLOCK: ::c_int = 0x4000;
+pub const O_SYNC: ::c_int = 0x802000;
+pub const O_RSYNC: ::c_int = 0x802000;
+pub const O_DSYNC: ::c_int = 0x2000;
+pub const O_FSYNC: ::c_int = 0x802000;
+pub const O_NOATIME: ::c_int = 0x200000;
+pub const O_PATH: ::c_int = 0x1000000;
+pub const O_TMPFILE: ::c_int = 0x2000000 | O_DIRECTORY;
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MAP_GROWSDOWN: ::c_int = 0x0200;
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_ANONYMOUS: ::c_int = 0x0020;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const EDEADLK: ::c_int = 78;
+pub const ENAMETOOLONG: ::c_int = 63;
+pub const ENOLCK: ::c_int = 79;
+pub const ENOSYS: ::c_int = 90;
+pub const ENOTEMPTY: ::c_int = 66;
+pub const ELOOP: ::c_int = 62;
+pub const ENOMSG: ::c_int = 75;
+pub const EIDRM: ::c_int = 77;
+pub const ECHRNG: ::c_int = 94;
+pub const EL2NSYNC: ::c_int = 95;
+pub const EL3HLT: ::c_int = 96;
+pub const EL3RST: ::c_int = 97;
+pub const ELNRNG: ::c_int = 98;
+pub const EUNATCH: ::c_int = 99;
+pub const ENOCSI: ::c_int = 100;
+pub const EL2HLT: ::c_int = 101;
+pub const EBADE: ::c_int = 102;
+pub const EBADR: ::c_int = 103;
+pub const EXFULL: ::c_int = 104;
+pub const ENOANO: ::c_int = 105;
+pub const EBADRQC: ::c_int = 106;
+pub const EBADSLT: ::c_int = 107;
+pub const EMULTIHOP: ::c_int = 87;
+pub const EOVERFLOW: ::c_int = 92;
+pub const ENOTUNIQ: ::c_int = 115;
+pub const EBADFD: ::c_int = 93;
+pub const EBADMSG: ::c_int = 76;
+pub const EREMCHG: ::c_int = 89;
+pub const ELIBACC: ::c_int = 114;
+pub const ELIBBAD: ::c_int = 112;
+pub const ELIBSCN: ::c_int = 124;
+pub const ELIBMAX: ::c_int = 123;
+pub const ELIBEXEC: ::c_int = 110;
+pub const EILSEQ: ::c_int = 122;
+pub const ERESTART: ::c_int = 116;
+pub const ESTRPIPE: ::c_int = 91;
+pub const EUSERS: ::c_int = 68;
+pub const ENOTSOCK: ::c_int = 38;
+pub const EDESTADDRREQ: ::c_int = 39;
+pub const EMSGSIZE: ::c_int = 40;
+pub const EPROTOTYPE: ::c_int = 41;
+pub const ENOPROTOOPT: ::c_int = 42;
+pub const EPROTONOSUPPORT: ::c_int = 43;
+pub const ESOCKTNOSUPPORT: ::c_int = 44;
+pub const EOPNOTSUPP: ::c_int = 45;
+pub const EPFNOSUPPORT: ::c_int = 46;
+pub const EAFNOSUPPORT: ::c_int = 47;
+pub const EADDRINUSE: ::c_int = 48;
+pub const EADDRNOTAVAIL: ::c_int = 49;
+pub const ENETDOWN: ::c_int = 50;
+pub const ENETUNREACH: ::c_int = 51;
+pub const ENETRESET: ::c_int = 52;
+pub const ECONNABORTED: ::c_int = 53;
+pub const ECONNRESET: ::c_int = 54;
+pub const ENOBUFS: ::c_int = 55;
+pub const EISCONN: ::c_int = 56;
+pub const ENOTCONN: ::c_int = 57;
+pub const ESHUTDOWN: ::c_int = 58;
+pub const ETOOMANYREFS: ::c_int = 59;
+pub const ETIMEDOUT: ::c_int = 60;
+pub const ECONNREFUSED: ::c_int = 61;
+pub const EHOSTDOWN: ::c_int = 64;
+pub const EHOSTUNREACH: ::c_int = 65;
+pub const EALREADY: ::c_int = 37;
+pub const EINPROGRESS: ::c_int = 36;
+pub const ESTALE: ::c_int = 70;
+pub const EDQUOT: ::c_int = 69;
+pub const ENOMEDIUM: ::c_int = 125;
+pub const EMEDIUMTYPE: ::c_int = 126;
+pub const ECANCELED: ::c_int = 127;
+pub const ENOKEY: ::c_int = 128;
+pub const EKEYEXPIRED: ::c_int = 129;
+pub const EKEYREVOKED: ::c_int = 130;
+pub const EKEYREJECTED: ::c_int = 131;
+pub const EOWNERDEAD: ::c_int = 132;
+pub const ENOTRECOVERABLE: ::c_int = 133;
+pub const EHWPOISON: ::c_int = 135;
+pub const ERFKILL: ::c_int = 134;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const SA_ONSTACK: ::c_int = 1;
+pub const SA_SIGINFO: ::c_int = 0x200;
+pub const SA_NOCLDWAIT: ::c_int = 0x100;
+
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGCHLD: ::c_int = 20;
+pub const SIGBUS: ::c_int = 10;
+pub const SIGUSR1: ::c_int = 30;
+pub const SIGUSR2: ::c_int = 31;
+pub const SIGCONT: ::c_int = 19;
+pub const SIGSTOP: ::c_int = 17;
+pub const SIGTSTP: ::c_int = 18;
+pub const SIGURG: ::c_int = 16;
+pub const SIGIO: ::c_int = 23;
+pub const SIGSYS: ::c_int = 12;
+pub const SIGPOLL: ::c_int = 23;
+pub const SIGPWR: ::c_int = 29;
+pub const SIG_SETMASK: ::c_int = 4;
+pub const SIG_BLOCK: ::c_int = 1;
+pub const SIG_UNBLOCK: ::c_int = 2;
+
+pub const POLLWRNORM: ::c_short = 4;
+pub const POLLWRBAND: ::c_short = 0x100;
+
+pub const O_ASYNC: ::c_int = 0x40;
+pub const O_NDELAY: ::c_int = 0x4004;
+
+pub const PTRACE_DETACH: ::c_uint = 17;
+
+pub const EFD_NONBLOCK: ::c_int = 0x4000;
+
+pub const F_GETLK: ::c_int = 7;
+pub const F_GETOWN: ::c_int = 5;
+pub const F_SETOWN: ::c_int = 6;
+pub const F_SETLK: ::c_int = 8;
+pub const F_SETLKW: ::c_int = 9;
+pub const F_OFD_GETLK: ::c_int = 36;
+pub const F_OFD_SETLK: ::c_int = 37;
+pub const F_OFD_SETLKW: ::c_int = 38;
+
+pub const F_RDLCK: ::c_int = 1;
+pub const F_WRLCK: ::c_int = 2;
+pub const F_UNLCK: ::c_int = 3;
+
+pub const SFD_NONBLOCK: ::c_int = 0x4000;
+
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+
+pub const SFD_CLOEXEC: ::c_int = 0x400000;
+
+pub const NCCS: usize = 17;
+pub const O_TRUNC: ::c_int = 0x400;
+
+pub const O_CLOEXEC: ::c_int = 0x400000;
+
+pub const EBFONT: ::c_int = 109;
+pub const ENOSTR: ::c_int = 72;
+pub const ENODATA: ::c_int = 111;
+pub const ETIME: ::c_int = 73;
+pub const ENOSR: ::c_int = 74;
+pub const ENONET: ::c_int = 80;
+pub const ENOPKG: ::c_int = 113;
+pub const EREMOTE: ::c_int = 71;
+pub const ENOLINK: ::c_int = 82;
+pub const EADV: ::c_int = 83;
+pub const ESRMNT: ::c_int = 84;
+pub const ECOMM: ::c_int = 85;
+pub const EPROTO: ::c_int = 86;
+pub const EDOTDOT: ::c_int = 88;
+
+pub const SA_NODEFER: ::c_int = 0x20;
+pub const SA_RESETHAND: ::c_int = 0x4;
+pub const SA_RESTART: ::c_int = 0x2;
+pub const SA_NOCLDSTOP: ::c_int = 0x00000008;
+
+pub const EPOLL_CLOEXEC: ::c_int = 0x400000;
+
+pub const EFD_CLOEXEC: ::c_int = 0x400000;
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
+
+align_const! {
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+}
+
+pub const O_DIRECTORY: ::c_int = 0o200000;
+pub const O_NOFOLLOW: ::c_int = 0o400000;
+pub const O_DIRECT: ::c_int = 0x100000;
+
+pub const MAP_LOCKED: ::c_int = 0x0100;
+pub const MAP_NORESERVE: ::c_int = 0x00040;
+
+pub const EDEADLOCK: ::c_int = 108;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+
+pub const MCL_CURRENT: ::c_int = 0x2000;
+pub const MCL_FUTURE: ::c_int = 0x4000;
+pub const MCL_ONFAULT: ::c_int = 0x8000;
+
+pub const SIGSTKSZ: ::size_t = 16384;
+pub const MINSIGSTKSZ: ::size_t = 4096;
+pub const CBAUD: ::tcflag_t = 0x0000100f;
+pub const TAB1: ::tcflag_t = 0x800;
+pub const TAB2: ::tcflag_t = 0x1000;
+pub const TAB3: ::tcflag_t = 0x1800;
+pub const CR1: ::tcflag_t = 0x200;
+pub const CR2: ::tcflag_t = 0x400;
+pub const CR3: ::tcflag_t = 0x600;
+pub const FF1: ::tcflag_t = 0x8000;
+pub const BS1: ::tcflag_t = 0x2000;
+pub const VT1: ::tcflag_t = 0x4000;
+pub const VWERASE: usize = 0xe;
+pub const VREPRINT: usize = 0xc;
+pub const VSUSP: usize = 0xa;
+pub const VSTART: usize = 0x8;
+pub const VSTOP: usize = 0x9;
+pub const VDISCARD: usize = 0xd;
+pub const VTIME: usize = 0x5;
+pub const IXON: ::tcflag_t = 0x400;
+pub const IXOFF: ::tcflag_t = 0x1000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x30;
+pub const CS6: ::tcflag_t = 0x10;
+pub const CS7: ::tcflag_t = 0x20;
+pub const CS8: ::tcflag_t = 0x30;
+pub const CSTOPB: ::tcflag_t = 0x40;
+pub const CREAD: ::tcflag_t = 0x80;
+pub const PARENB: ::tcflag_t = 0x100;
+pub const PARODD: ::tcflag_t = 0x200;
+pub const HUPCL: ::tcflag_t = 0x400;
+pub const CLOCAL: ::tcflag_t = 0x800;
+pub const ECHOKE: ::tcflag_t = 0x800;
+pub const ECHOE: ::tcflag_t = 0x10;
+pub const ECHOK: ::tcflag_t = 0x20;
+pub const ECHONL: ::tcflag_t = 0x40;
+pub const ECHOPRT: ::tcflag_t = 0x400;
+pub const ECHOCTL: ::tcflag_t = 0x200;
+pub const ISIG: ::tcflag_t = 0x1;
+pub const ICANON: ::tcflag_t = 0x2;
+pub const PENDIN: ::tcflag_t = 0x4000;
+pub const NOFLSH: ::tcflag_t = 0x80;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0x00001000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0x1001;
+pub const B115200: ::speed_t = 0x1002;
+pub const B230400: ::speed_t = 0x1003;
+pub const B460800: ::speed_t = 0x1004;
+pub const B76800: ::speed_t = 0x1005;
+pub const B153600: ::speed_t = 0x1006;
+pub const B307200: ::speed_t = 0x1007;
+pub const B614400: ::speed_t = 0x1008;
+pub const B921600: ::speed_t = 0x1009;
+pub const B500000: ::speed_t = 0x100a;
+pub const B576000: ::speed_t = 0x100b;
+pub const B1000000: ::speed_t = 0x100c;
+pub const B1152000: ::speed_t = 0x100d;
+pub const B1500000: ::speed_t = 0x100e;
+pub const B2000000: ::speed_t = 0x100f;
+
+pub const VEOL: usize = 5;
+pub const VEOL2: usize = 6;
+pub const VMIN: usize = 4;
+pub const IEXTEN: ::tcflag_t = 0x8000;
+pub const TOSTOP: ::tcflag_t = 0x100;
+pub const FLUSHO: ::tcflag_t = 0x1000;
+pub const EXTPROC: ::tcflag_t = 0x10000;
+
+pub const SYS_restart_syscall: ::c_long = 0;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_wait4: ::c_long = 7;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execv: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_chown: ::c_long = 13;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lchown: ::c_long = 16;
+pub const SYS_brk: ::c_long = 17;
+pub const SYS_perfctr: ::c_long = 18;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_capget: ::c_long = 21;
+pub const SYS_capset: ::c_long = 22;
+pub const SYS_setuid: ::c_long = 23;
+pub const SYS_getuid: ::c_long = 24;
+pub const SYS_vmsplice: ::c_long = 25;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_alarm: ::c_long = 27;
+pub const SYS_sigaltstack: ::c_long = 28;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_utime: ::c_long = 30;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_stat: ::c_long = 38;
+pub const SYS_sendfile: ::c_long = 39;
+pub const SYS_lstat: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_umount2: ::c_long = 45;
+pub const SYS_setgid: ::c_long = 46;
+pub const SYS_getgid: ::c_long = 47;
+pub const SYS_signal: ::c_long = 48;
+pub const SYS_geteuid: ::c_long = 49;
+pub const SYS_getegid: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_memory_ordering: ::c_long = 52;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_reboot: ::c_long = 55;
+pub const SYS_symlink: ::c_long = 57;
+pub const SYS_readlink: ::c_long = 58;
+pub const SYS_execve: ::c_long = 59;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_fstat: ::c_long = 62;
+pub const SYS_fstat64: ::c_long = 63;
+pub const SYS_getpagesize: ::c_long = 64;
+pub const SYS_msync: ::c_long = 65;
+pub const SYS_vfork: ::c_long = 66;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_mmap: ::c_long = 71;
+pub const SYS_munmap: ::c_long = 73;
+pub const SYS_mprotect: ::c_long = 74;
+pub const SYS_madvise: ::c_long = 75;
+pub const SYS_vhangup: ::c_long = 76;
+pub const SYS_mincore: ::c_long = 78;
+pub const SYS_getgroups: ::c_long = 79;
+pub const SYS_setgroups: ::c_long = 80;
+pub const SYS_getpgrp: ::c_long = 81;
+pub const SYS_setitimer: ::c_long = 83;
+pub const SYS_swapon: ::c_long = 85;
+pub const SYS_getitimer: ::c_long = 86;
+pub const SYS_sethostname: ::c_long = 88;
+pub const SYS_dup2: ::c_long = 90;
+pub const SYS_fcntl: ::c_long = 92;
+pub const SYS_select: ::c_long = 93;
+pub const SYS_fsync: ::c_long = 95;
+pub const SYS_setpriority: ::c_long = 96;
+pub const SYS_socket: ::c_long = 97;
+pub const SYS_connect: ::c_long = 98;
+pub const SYS_accept: ::c_long = 99;
+pub const SYS_getpriority: ::c_long = 100;
+pub const SYS_rt_sigreturn: ::c_long = 101;
+pub const SYS_rt_sigaction: ::c_long = 102;
+pub const SYS_rt_sigprocmask: ::c_long = 103;
+pub const SYS_rt_sigpending: ::c_long = 104;
+pub const SYS_rt_sigtimedwait: ::c_long = 105;
+pub const SYS_rt_sigqueueinfo: ::c_long = 106;
+pub const SYS_rt_sigsuspend: ::c_long = 107;
+pub const SYS_setresuid: ::c_long = 108;
+pub const SYS_getresuid: ::c_long = 109;
+pub const SYS_setresgid: ::c_long = 110;
+pub const SYS_getresgid: ::c_long = 111;
+pub const SYS_recvmsg: ::c_long = 113;
+pub const SYS_sendmsg: ::c_long = 114;
+pub const SYS_gettimeofday: ::c_long = 116;
+pub const SYS_getrusage: ::c_long = 117;
+pub const SYS_getsockopt: ::c_long = 118;
+pub const SYS_getcwd: ::c_long = 119;
+pub const SYS_readv: ::c_long = 120;
+pub const SYS_writev: ::c_long = 121;
+pub const SYS_settimeofday: ::c_long = 122;
+pub const SYS_fchown: ::c_long = 123;
+pub const SYS_fchmod: ::c_long = 124;
+pub const SYS_recvfrom: ::c_long = 125;
+pub const SYS_setreuid: ::c_long = 126;
+pub const SYS_setregid: ::c_long = 127;
+pub const SYS_rename: ::c_long = 128;
+pub const SYS_truncate: ::c_long = 129;
+pub const SYS_ftruncate: ::c_long = 130;
+pub const SYS_flock: ::c_long = 131;
+pub const SYS_lstat64: ::c_long = 132;
+pub const SYS_sendto: ::c_long = 133;
+pub const SYS_shutdown: ::c_long = 134;
+pub const SYS_socketpair: ::c_long = 135;
+pub const SYS_mkdir: ::c_long = 136;
+pub const SYS_rmdir: ::c_long = 137;
+pub const SYS_utimes: ::c_long = 138;
+pub const SYS_stat64: ::c_long = 139;
+pub const SYS_sendfile64: ::c_long = 140;
+pub const SYS_getpeername: ::c_long = 141;
+pub const SYS_futex: ::c_long = 142;
+pub const SYS_gettid: ::c_long = 143;
+pub const SYS_getrlimit: ::c_long = 144;
+pub const SYS_setrlimit: ::c_long = 145;
+pub const SYS_pivot_root: ::c_long = 146;
+pub const SYS_prctl: ::c_long = 147;
+pub const SYS_pciconfig_read: ::c_long = 148;
+pub const SYS_pciconfig_write: ::c_long = 149;
+pub const SYS_getsockname: ::c_long = 150;
+pub const SYS_inotify_init: ::c_long = 151;
+pub const SYS_inotify_add_watch: ::c_long = 152;
+pub const SYS_poll: ::c_long = 153;
+pub const SYS_getdents64: ::c_long = 154;
+pub const SYS_inotify_rm_watch: ::c_long = 156;
+pub const SYS_statfs: ::c_long = 157;
+pub const SYS_fstatfs: ::c_long = 158;
+pub const SYS_umount: ::c_long = 159;
+pub const SYS_sched_set_affinity: ::c_long = 160;
+pub const SYS_sched_get_affinity: ::c_long = 161;
+pub const SYS_getdomainname: ::c_long = 162;
+pub const SYS_setdomainname: ::c_long = 163;
+pub const SYS_utrap_install: ::c_long = 164;
+pub const SYS_quotactl: ::c_long = 165;
+pub const SYS_set_tid_address: ::c_long = 166;
+pub const SYS_mount: ::c_long = 167;
+pub const SYS_ustat: ::c_long = 168;
+pub const SYS_setxattr: ::c_long = 169;
+pub const SYS_lsetxattr: ::c_long = 170;
+pub const SYS_fsetxattr: ::c_long = 171;
+pub const SYS_getxattr: ::c_long = 172;
+pub const SYS_lgetxattr: ::c_long = 173;
+pub const SYS_getdents: ::c_long = 174;
+pub const SYS_setsid: ::c_long = 175;
+pub const SYS_fchdir: ::c_long = 176;
+pub const SYS_fgetxattr: ::c_long = 177;
+pub const SYS_listxattr: ::c_long = 178;
+pub const SYS_llistxattr: ::c_long = 179;
+pub const SYS_flistxattr: ::c_long = 180;
+pub const SYS_removexattr: ::c_long = 181;
+pub const SYS_lremovexattr: ::c_long = 182;
+pub const SYS_sigpending: ::c_long = 183;
+pub const SYS_query_module: ::c_long = 184;
+pub const SYS_setpgid: ::c_long = 185;
+pub const SYS_fremovexattr: ::c_long = 186;
+pub const SYS_tkill: ::c_long = 187;
+pub const SYS_exit_group: ::c_long = 188;
+pub const SYS_uname: ::c_long = 189;
+pub const SYS_init_module: ::c_long = 190;
+pub const SYS_personality: ::c_long = 191;
+pub const SYS_remap_file_pages: ::c_long = 192;
+pub const SYS_epoll_create: ::c_long = 193;
+pub const SYS_epoll_ctl: ::c_long = 194;
+pub const SYS_epoll_wait: ::c_long = 195;
+pub const SYS_ioprio_set: ::c_long = 196;
+pub const SYS_getppid: ::c_long = 197;
+pub const SYS_sigaction: ::c_long = 198;
+pub const SYS_sgetmask: ::c_long = 199;
+pub const SYS_ssetmask: ::c_long = 200;
+pub const SYS_sigsuspend: ::c_long = 201;
+pub const SYS_oldlstat: ::c_long = 202;
+pub const SYS_uselib: ::c_long = 203;
+pub const SYS_readdir: ::c_long = 204;
+pub const SYS_readahead: ::c_long = 205;
+pub const SYS_socketcall: ::c_long = 206;
+pub const SYS_syslog: ::c_long = 207;
+pub const SYS_lookup_dcookie: ::c_long = 208;
+pub const SYS_fadvise64: ::c_long = 209;
+pub const SYS_fadvise64_64: ::c_long = 210;
+pub const SYS_tgkill: ::c_long = 211;
+pub const SYS_waitpid: ::c_long = 212;
+pub const SYS_swapoff: ::c_long = 213;
+pub const SYS_sysinfo: ::c_long = 214;
+pub const SYS_ipc: ::c_long = 215;
+pub const SYS_sigreturn: ::c_long = 216;
+pub const SYS_clone: ::c_long = 217;
+pub const SYS_ioprio_get: ::c_long = 218;
+pub const SYS_adjtimex: ::c_long = 219;
+pub const SYS_sigprocmask: ::c_long = 220;
+pub const SYS_create_module: ::c_long = 221;
+pub const SYS_delete_module: ::c_long = 222;
+pub const SYS_get_kernel_syms: ::c_long = 223;
+pub const SYS_getpgid: ::c_long = 224;
+pub const SYS_bdflush: ::c_long = 225;
+pub const SYS_sysfs: ::c_long = 226;
+pub const SYS_afs_syscall: ::c_long = 227;
+pub const SYS_setfsuid: ::c_long = 228;
+pub const SYS_setfsgid: ::c_long = 229;
+pub const SYS__newselect: ::c_long = 230;
+pub const SYS_splice: ::c_long = 232;
+pub const SYS_stime: ::c_long = 233;
+pub const SYS_statfs64: ::c_long = 234;
+pub const SYS_fstatfs64: ::c_long = 235;
+pub const SYS__llseek: ::c_long = 236;
+pub const SYS_mlock: ::c_long = 237;
+pub const SYS_munlock: ::c_long = 238;
+pub const SYS_mlockall: ::c_long = 239;
+pub const SYS_munlockall: ::c_long = 240;
+pub const SYS_sched_setparam: ::c_long = 241;
+pub const SYS_sched_getparam: ::c_long = 242;
+pub const SYS_sched_setscheduler: ::c_long = 243;
+pub const SYS_sched_getscheduler: ::c_long = 244;
+pub const SYS_sched_yield: ::c_long = 245;
+pub const SYS_sched_get_priority_max: ::c_long = 246;
+pub const SYS_sched_get_priority_min: ::c_long = 247;
+pub const SYS_sched_rr_get_interval: ::c_long = 248;
+pub const SYS_nanosleep: ::c_long = 249;
+pub const SYS_mremap: ::c_long = 250;
+pub const SYS__sysctl: ::c_long = 251;
+pub const SYS_getsid: ::c_long = 252;
+pub const SYS_fdatasync: ::c_long = 253;
+pub const SYS_nfsservctl: ::c_long = 254;
+pub const SYS_sync_file_range: ::c_long = 255;
+pub const SYS_clock_settime: ::c_long = 256;
+pub const SYS_clock_gettime: ::c_long = 257;
+pub const SYS_clock_getres: ::c_long = 258;
+pub const SYS_clock_nanosleep: ::c_long = 259;
+pub const SYS_sched_getaffinity: ::c_long = 260;
+pub const SYS_sched_setaffinity: ::c_long = 261;
+pub const SYS_timer_settime: ::c_long = 262;
+pub const SYS_timer_gettime: ::c_long = 263;
+pub const SYS_timer_getoverrun: ::c_long = 264;
+pub const SYS_timer_delete: ::c_long = 265;
+pub const SYS_timer_create: ::c_long = 266;
+pub const SYS_io_setup: ::c_long = 268;
+pub const SYS_io_destroy: ::c_long = 269;
+pub const SYS_io_submit: ::c_long = 270;
+pub const SYS_io_cancel: ::c_long = 271;
+pub const SYS_io_getevents: ::c_long = 272;
+pub const SYS_mq_open: ::c_long = 273;
+pub const SYS_mq_unlink: ::c_long = 274;
+pub const SYS_mq_timedsend: ::c_long = 275;
+pub const SYS_mq_timedreceive: ::c_long = 276;
+pub const SYS_mq_notify: ::c_long = 277;
+pub const SYS_mq_getsetattr: ::c_long = 278;
+pub const SYS_waitid: ::c_long = 279;
+pub const SYS_tee: ::c_long = 280;
+pub const SYS_add_key: ::c_long = 281;
+pub const SYS_request_key: ::c_long = 282;
+pub const SYS_keyctl: ::c_long = 283;
+pub const SYS_openat: ::c_long = 284;
+pub const SYS_mkdirat: ::c_long = 285;
+pub const SYS_mknodat: ::c_long = 286;
+pub const SYS_fchownat: ::c_long = 287;
+pub const SYS_futimesat: ::c_long = 288;
+pub const SYS_fstatat64: ::c_long = 289;
+pub const SYS_unlinkat: ::c_long = 290;
+pub const SYS_renameat: ::c_long = 291;
+pub const SYS_linkat: ::c_long = 292;
+pub const SYS_symlinkat: ::c_long = 293;
+pub const SYS_readlinkat: ::c_long = 294;
+pub const SYS_fchmodat: ::c_long = 295;
+pub const SYS_faccessat: ::c_long = 296;
+pub const SYS_pselect6: ::c_long = 297;
+pub const SYS_ppoll: ::c_long = 298;
+pub const SYS_unshare: ::c_long = 299;
+pub const SYS_set_robust_list: ::c_long = 300;
+pub const SYS_get_robust_list: ::c_long = 301;
+pub const SYS_migrate_pages: ::c_long = 302;
+pub const SYS_mbind: ::c_long = 303;
+pub const SYS_get_mempolicy: ::c_long = 304;
+pub const SYS_set_mempolicy: ::c_long = 305;
+pub const SYS_kexec_load: ::c_long = 306;
+pub const SYS_move_pages: ::c_long = 307;
+pub const SYS_getcpu: ::c_long = 308;
+pub const SYS_epoll_pwait: ::c_long = 309;
+pub const SYS_utimensat: ::c_long = 310;
+pub const SYS_signalfd: ::c_long = 311;
+pub const SYS_timerfd_create: ::c_long = 312;
+pub const SYS_eventfd: ::c_long = 313;
+pub const SYS_fallocate: ::c_long = 314;
+pub const SYS_timerfd_settime: ::c_long = 315;
+pub const SYS_timerfd_gettime: ::c_long = 316;
+pub const SYS_signalfd4: ::c_long = 317;
+pub const SYS_eventfd2: ::c_long = 318;
+pub const SYS_epoll_create1: ::c_long = 319;
+pub const SYS_dup3: ::c_long = 320;
+pub const SYS_pipe2: ::c_long = 321;
+pub const SYS_inotify_init1: ::c_long = 322;
+pub const SYS_accept4: ::c_long = 323;
+pub const SYS_preadv: ::c_long = 324;
+pub const SYS_pwritev: ::c_long = 325;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 326;
+pub const SYS_perf_event_open: ::c_long = 327;
+pub const SYS_recvmmsg: ::c_long = 328;
+pub const SYS_fanotify_init: ::c_long = 329;
+pub const SYS_fanotify_mark: ::c_long = 330;
+pub const SYS_prlimit64: ::c_long = 331;
+pub const SYS_name_to_handle_at: ::c_long = 332;
+pub const SYS_open_by_handle_at: ::c_long = 333;
+pub const SYS_clock_adjtime: ::c_long = 334;
+pub const SYS_syncfs: ::c_long = 335;
+pub const SYS_sendmmsg: ::c_long = 336;
+pub const SYS_setns: ::c_long = 337;
+pub const SYS_process_vm_readv: ::c_long = 338;
+pub const SYS_process_vm_writev: ::c_long = 339;
+pub const SYS_kern_features: ::c_long = 340;
+pub const SYS_kcmp: ::c_long = 341;
+pub const SYS_finit_module: ::c_long = 342;
+pub const SYS_sched_setattr: ::c_long = 343;
+pub const SYS_sched_getattr: ::c_long = 344;
+pub const SYS_renameat2: ::c_long = 345;
+pub const SYS_seccomp: ::c_long = 346;
+pub const SYS_getrandom: ::c_long = 347;
+pub const SYS_memfd_create: ::c_long = 348;
+pub const SYS_bpf: ::c_long = 349;
+pub const SYS_execveat: ::c_long = 350;
+pub const SYS_membarrier: ::c_long = 351;
+pub const SYS_userfaultfd: ::c_long = 352;
+pub const SYS_bind: ::c_long = 353;
+pub const SYS_listen: ::c_long = 354;
+pub const SYS_setsockopt: ::c_long = 355;
+pub const SYS_mlock2: ::c_long = 356;
+pub const SYS_copy_file_range: ::c_long = 357;
+pub const SYS_preadv2: ::c_long = 358;
+pub const SYS_pwritev2: ::c_long = 359;
+pub const SYS_statx: ::c_long = 360;
+pub const SYS_rseq: ::c_long = 365;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+// Reserved in the kernel, but not actually implemented yet
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+extern "C" {
+    pub fn sysctl(
+        name: *mut ::c_int,
+        namelen: ::c_int,
+        oldp: *mut ::c_void,
+        oldlenp: *mut ::size_t,
+        newp: *mut ::c_void,
+        newlen: ::size_t,
+    ) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,24 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f64; 4]
+    }
+}
+
+s! {
+    #[repr(align(8))]
+    pub struct clone_args {
+        pub flags: ::c_ulonglong,
+        pub pidfd: ::c_ulonglong,
+        pub child_tid: ::c_ulonglong,
+        pub parent_tid: ::c_ulonglong,
+        pub exit_signal: ::c_ulonglong,
+        pub stack: ::c_ulonglong,
+        pub stack_size: ::c_ulonglong,
+        pub tls: ::c_ulonglong,
+        pub set_tid: ::c_ulonglong,
+        pub set_tid_size: ::c_ulonglong,
+        pub cgroup: ::c_ulonglong,
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,824 @@
+//! x86_64-specific definitions for 64-bit linux-like values
+
+pub type c_char = i8;
+pub type wchar_t = i32;
+pub type nlink_t = u64;
+pub type blksize_t = i64;
+pub type greg_t = i64;
+pub type suseconds_t = i64;
+pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
+
+s! {
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        #[cfg(target_arch = "sparc64")]
+        __reserved0: ::c_int,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        f_spare: [::__fsword_t; 5],
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct flock64 {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off64_t,
+        pub l_len: ::off64_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        #[doc(hidden)]
+        #[deprecated(
+            since="0.2.54",
+            note="Please leave a comment on \
+                  https://github.com/rust-lang/libc/pull/1316 if you're using \
+                  this field"
+        )]
+        pub _pad: [::c_int; 29],
+        _align: [u64; 0],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        __pad0: ::c_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: i64,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: i64,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: i64,
+        __unused: [i64; 3],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        __pad0: ::c_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: i64,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: i64,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: i64,
+        __reserved: [i64; 3],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__fsword_t; 4],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct pthread_attr_t {
+        #[cfg(target_pointer_width = "32")]
+        __size: [u32; 8],
+        #[cfg(target_pointer_width = "64")]
+        __size: [u64; 7]
+    }
+
+    pub struct _libc_fpxreg {
+        pub significand: [u16; 4],
+        pub exponent: u16,
+        __private: [u16; 3],
+    }
+
+    pub struct _libc_xmmreg {
+        pub element: [u32; 4],
+    }
+
+    pub struct _libc_fpstate {
+        pub cwd: u16,
+        pub swd: u16,
+        pub ftw: u16,
+        pub fop: u16,
+        pub rip: u64,
+        pub rdp: u64,
+        pub mxcsr: u32,
+        pub mxcr_mask: u32,
+        pub _st: [_libc_fpxreg; 8],
+        pub _xmm: [_libc_xmmreg; 16],
+        __private: [u64; 12],
+    }
+
+    pub struct user_regs_struct {
+        pub r15: ::c_ulonglong,
+        pub r14: ::c_ulonglong,
+        pub r13: ::c_ulonglong,
+        pub r12: ::c_ulonglong,
+        pub rbp: ::c_ulonglong,
+        pub rbx: ::c_ulonglong,
+        pub r11: ::c_ulonglong,
+        pub r10: ::c_ulonglong,
+        pub r9: ::c_ulonglong,
+        pub r8: ::c_ulonglong,
+        pub rax: ::c_ulonglong,
+        pub rcx: ::c_ulonglong,
+        pub rdx: ::c_ulonglong,
+        pub rsi: ::c_ulonglong,
+        pub rdi: ::c_ulonglong,
+        pub orig_rax: ::c_ulonglong,
+        pub rip: ::c_ulonglong,
+        pub cs: ::c_ulonglong,
+        pub eflags: ::c_ulonglong,
+        pub rsp: ::c_ulonglong,
+        pub ss: ::c_ulonglong,
+        pub fs_base: ::c_ulonglong,
+        pub gs_base: ::c_ulonglong,
+        pub ds: ::c_ulonglong,
+        pub es: ::c_ulonglong,
+        pub fs: ::c_ulonglong,
+        pub gs: ::c_ulonglong,
+    }
+
+    pub struct user {
+        pub regs: user_regs_struct,
+        pub u_fpvalid: ::c_int,
+        pub i387: user_fpregs_struct,
+        pub u_tsize: ::c_ulonglong,
+        pub u_dsize: ::c_ulonglong,
+        pub u_ssize: ::c_ulonglong,
+        pub start_code: ::c_ulonglong,
+        pub start_stack: ::c_ulonglong,
+        pub signal: ::c_longlong,
+        __reserved: ::c_int,
+        #[cfg(target_pointer_width = "32")]
+        __pad1: u32,
+        pub u_ar0: *mut user_regs_struct,
+        #[cfg(target_pointer_width = "32")]
+        __pad2: u32,
+        pub u_fpstate: *mut user_fpregs_struct,
+        pub magic: ::c_ulonglong,
+        pub u_comm: [::c_char; 32],
+        pub u_debugreg: [::c_ulonglong; 8],
+    }
+
+    pub struct mcontext_t {
+        pub gregs: [greg_t; 23],
+        pub fpregs: *mut _libc_fpstate,
+        __private: [u64; 8],
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::c_ushort,
+        __pad1: ::c_ushort,
+        pub __seq: ::c_ushort,
+        __pad2: ::c_ushort,
+        __unused1: u64,
+        __unused2: u64
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: u64,
+        __unused5: u64
+    }
+
+    pub struct ptrace_rseq_configuration {
+        pub rseq_abi_pointer: ::__u64,
+        pub rseq_abi_size: ::__u32,
+        pub signature: ::__u32,
+        pub flags: ::__u32,
+        pub pad: ::__u32,
+    }
+}
+
+s_no_extra_traits! {
+    pub struct user_fpregs_struct {
+        pub cwd: ::c_ushort,
+        pub swd: ::c_ushort,
+        pub ftw: ::c_ushort,
+        pub fop: ::c_ushort,
+        pub rip: ::c_ulonglong,
+        pub rdp: ::c_ulonglong,
+        pub mxcsr: ::c_uint,
+        pub mxcr_mask: ::c_uint,
+        pub st_space: [::c_uint; 32],
+        pub xmm_space: [::c_uint; 64],
+        padding: [::c_uint; 24],
+    }
+
+    pub struct ucontext_t {
+        pub uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_mcontext: mcontext_t,
+        pub uc_sigmask: ::sigset_t,
+        __private: [u8; 512],
+        // FIXME: the shadow stack field requires glibc >= 2.28.
+        // Re-add once we drop compatibility with glibc versions older than
+        // 2.28.
+        //
+        // __ssp: [::c_ulonglong; 4],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for user_fpregs_struct {
+            fn eq(&self, other: &user_fpregs_struct) -> bool {
+                self.cwd == other.cwd
+                    && self.swd == other.swd
+                    && self.ftw == other.ftw
+                    && self.fop == other.fop
+                    && self.rip == other.rip
+                    && self.rdp == other.rdp
+                    && self.mxcsr == other.mxcsr
+                    && self.mxcr_mask == other.mxcr_mask
+                    && self.st_space == other.st_space
+                    && self
+                    .xmm_space
+                    .iter()
+                    .zip(other.xmm_space.iter())
+                    .all(|(a,b)| a == b)
+                // Ignore padding field
+            }
+        }
+
+        impl Eq for user_fpregs_struct {}
+
+        impl ::fmt::Debug for user_fpregs_struct {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("user_fpregs_struct")
+                    .field("cwd", &self.cwd)
+                    .field("ftw", &self.ftw)
+                    .field("fop", &self.fop)
+                    .field("rip", &self.rip)
+                    .field("rdp", &self.rdp)
+                    .field("mxcsr", &self.mxcsr)
+                    .field("mxcr_mask", &self.mxcr_mask)
+                    .field("st_space", &self.st_space)
+                // FIXME: .field("xmm_space", &self.xmm_space)
+                // Ignore padding field
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for user_fpregs_struct {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.cwd.hash(state);
+                self.ftw.hash(state);
+                self.fop.hash(state);
+                self.rip.hash(state);
+                self.rdp.hash(state);
+                self.mxcsr.hash(state);
+                self.mxcr_mask.hash(state);
+                self.st_space.hash(state);
+                self.xmm_space.hash(state);
+                // Ignore padding field
+            }
+        }
+
+        impl PartialEq for ucontext_t {
+            fn eq(&self, other: &ucontext_t) -> bool {
+                self.uc_flags == other.uc_flags
+                    && self.uc_link == other.uc_link
+                    && self.uc_stack == other.uc_stack
+                    && self.uc_mcontext == other.uc_mcontext
+                    && self.uc_sigmask == other.uc_sigmask
+                // Ignore __private field
+            }
+        }
+
+        impl Eq for ucontext_t {}
+
+        impl ::fmt::Debug for ucontext_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ucontext_t")
+                    .field("uc_flags", &self.uc_flags)
+                    .field("uc_link", &self.uc_link)
+                    .field("uc_stack", &self.uc_stack)
+                    .field("uc_mcontext", &self.uc_mcontext)
+                    .field("uc_sigmask", &self.uc_sigmask)
+                // Ignore __private field
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for ucontext_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.uc_flags.hash(state);
+                self.uc_link.hash(state);
+                self.uc_stack.hash(state);
+                self.uc_mcontext.hash(state);
+                self.uc_sigmask.hash(state);
+                // Ignore __private field
+            }
+        }
+    }
+}
+
+pub const POSIX_FADV_DONTNEED: ::c_int = 4;
+pub const POSIX_FADV_NOREUSE: ::c_int = 5;
+
+pub const VEOF: usize = 4;
+pub const RTLD_DEEPBIND: ::c_int = 0x8;
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+
+pub const O_APPEND: ::c_int = 1024;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_FSYNC: ::c_int = 0x101000;
+pub const O_NOATIME: ::c_int = 0o1000000;
+pub const O_PATH: ::c_int = 0o10000000;
+pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+
+pub const EDEADLK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EBADMSG: ::c_int = 74;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const EHWPOISON: ::c_int = 133;
+pub const ERFKILL: ::c_int = 132;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
+pub const SIGUNUSED: ::c_int = 31;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const O_ASYNC: ::c_int = 0x2000;
+pub const O_NDELAY: ::c_int = 0x800;
+
+pub const PTRACE_DETACH: ::c_uint = 17;
+pub const PTRACE_GET_RSEQ_CONFIGURATION: ::c_uint = 0x420f;
+
+pub const EFD_NONBLOCK: ::c_int = 0x800;
+
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETOWN: ::c_int = 8;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+pub const F_OFD_GETLK: ::c_int = 36;
+pub const F_OFD_SETLK: ::c_int = 37;
+pub const F_OFD_SETLKW: ::c_int = 38;
+
+pub const F_RDLCK: ::c_int = 0;
+pub const F_WRLCK: ::c_int = 1;
+pub const F_UNLCK: ::c_int = 2;
+
+pub const SFD_NONBLOCK: ::c_int = 0x0800;
+
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+
+pub const SFD_CLOEXEC: ::c_int = 0x080000;
+
+pub const NCCS: usize = 32;
+
+pub const O_TRUNC: ::c_int = 512;
+
+pub const O_CLOEXEC: ::c_int = 0x80000;
+
+pub const EBFONT: ::c_int = 59;
+pub const ENOSTR: ::c_int = 60;
+pub const ENODATA: ::c_int = 61;
+pub const ETIME: ::c_int = 62;
+pub const ENOSR: ::c_int = 63;
+pub const ENONET: ::c_int = 64;
+pub const ENOPKG: ::c_int = 65;
+pub const EREMOTE: ::c_int = 66;
+pub const ENOLINK: ::c_int = 67;
+pub const EADV: ::c_int = 68;
+pub const ESRMNT: ::c_int = 69;
+pub const ECOMM: ::c_int = 70;
+pub const EPROTO: ::c_int = 71;
+pub const EDOTDOT: ::c_int = 73;
+
+pub const SA_NODEFER: ::c_int = 0x40000000;
+pub const SA_RESETHAND: ::c_int = 0x80000000;
+pub const SA_RESTART: ::c_int = 0x10000000;
+pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
+
+pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
+
+pub const EFD_CLOEXEC: ::c_int = 0x80000;
+
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
+
+pub const O_DIRECT: ::c_int = 0x4000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_LOCKED: ::c_int = 0x02000;
+pub const MAP_NORESERVE: ::c_int = 0x04000;
+pub const MAP_32BIT: ::c_int = 0x0040;
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_ANONYMOUS: ::c_int = 0x0020;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const EDEADLOCK: ::c_int = 35;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+
+pub const PTRACE_GETFPREGS: ::c_uint = 14;
+pub const PTRACE_SETFPREGS: ::c_uint = 15;
+pub const PTRACE_GETFPXREGS: ::c_uint = 18;
+pub const PTRACE_SETFPXREGS: ::c_uint = 19;
+pub const PTRACE_GETREGS: ::c_uint = 12;
+pub const PTRACE_SETREGS: ::c_uint = 13;
+pub const PTRACE_PEEKSIGINFO_SHARED: ::c_uint = 1;
+pub const PTRACE_SYSEMU: ::c_uint = 31;
+pub const PTRACE_SYSEMU_SINGLESTEP: ::c_uint = 32;
+
+pub const PR_GET_SPECULATION_CTRL: ::c_int = 52;
+pub const PR_SET_SPECULATION_CTRL: ::c_int = 53;
+pub const PR_SPEC_NOT_AFFECTED: ::c_uint = 0;
+pub const PR_SPEC_PRCTL: ::c_uint = 1 << 0;
+pub const PR_SPEC_ENABLE: ::c_uint = 1 << 1;
+pub const PR_SPEC_DISABLE: ::c_uint = 1 << 2;
+pub const PR_SPEC_FORCE_DISABLE: ::c_uint = 1 << 3;
+pub const PR_SPEC_DISABLE_NOEXEC: ::c_uint = 1 << 4;
+pub const PR_SPEC_STORE_BYPASS: ::c_int = 0;
+pub const PR_SPEC_INDIRECT_BRANCH: ::c_int = 1;
+// FIXME: perharps for later
+//pub const PR_SPEC_L1D_FLUSH: ::c_int = 2;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+
+// offsets in user_regs_structs, from sys/reg.h
+pub const R15: ::c_int = 0;
+pub const R14: ::c_int = 1;
+pub const R13: ::c_int = 2;
+pub const R12: ::c_int = 3;
+pub const RBP: ::c_int = 4;
+pub const RBX: ::c_int = 5;
+pub const R11: ::c_int = 6;
+pub const R10: ::c_int = 7;
+pub const R9: ::c_int = 8;
+pub const R8: ::c_int = 9;
+pub const RAX: ::c_int = 10;
+pub const RCX: ::c_int = 11;
+pub const RDX: ::c_int = 12;
+pub const RSI: ::c_int = 13;
+pub const RDI: ::c_int = 14;
+pub const ORIG_RAX: ::c_int = 15;
+pub const RIP: ::c_int = 16;
+pub const CS: ::c_int = 17;
+pub const EFLAGS: ::c_int = 18;
+pub const RSP: ::c_int = 19;
+pub const SS: ::c_int = 20;
+pub const FS_BASE: ::c_int = 21;
+pub const GS_BASE: ::c_int = 22;
+pub const DS: ::c_int = 23;
+pub const ES: ::c_int = 24;
+pub const FS: ::c_int = 25;
+pub const GS: ::c_int = 26;
+
+// offsets in mcontext_t.gregs from sys/ucontext.h
+pub const REG_R8: ::c_int = 0;
+pub const REG_R9: ::c_int = 1;
+pub const REG_R10: ::c_int = 2;
+pub const REG_R11: ::c_int = 3;
+pub const REG_R12: ::c_int = 4;
+pub const REG_R13: ::c_int = 5;
+pub const REG_R14: ::c_int = 6;
+pub const REG_R15: ::c_int = 7;
+pub const REG_RDI: ::c_int = 8;
+pub const REG_RSI: ::c_int = 9;
+pub const REG_RBP: ::c_int = 10;
+pub const REG_RBX: ::c_int = 11;
+pub const REG_RDX: ::c_int = 12;
+pub const REG_RAX: ::c_int = 13;
+pub const REG_RCX: ::c_int = 14;
+pub const REG_RSP: ::c_int = 15;
+pub const REG_RIP: ::c_int = 16;
+pub const REG_EFL: ::c_int = 17;
+pub const REG_CSGSFS: ::c_int = 18;
+pub const REG_ERR: ::c_int = 19;
+pub const REG_TRAPNO: ::c_int = 20;
+pub const REG_OLDMASK: ::c_int = 21;
+pub const REG_CR2: ::c_int = 22;
+
+extern "C" {
+    pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int;
+    pub fn setcontext(ucp: *const ucontext_t) -> ::c_int;
+    pub fn makecontext(ucp: *mut ucontext_t, func: extern "C" fn(), argc: ::c_int, ...);
+    pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> ::c_int;
+    pub fn iopl(level: ::c_int) -> ::c_int;
+    pub fn ioperm(from: ::c_ulong, num: ::c_ulong, turn_on: ::c_int) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(target_pointer_width = "32")] {
+        mod x32;
+        pub use self::x32::*;
+    } else {
+        mod not_x32;
+        pub use self::not_x32::*;
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,451 @@
+use pthread_mutex_t;
+
+pub type c_long = i64;
+pub type c_ulong = u64;
+
+s! {
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+}
+
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
+
+align_const! {
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    #[cfg(target_endian = "big")]
+    pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+}
+
+// Syscall table
+
+pub const SYS_read: ::c_long = 0;
+pub const SYS_write: ::c_long = 1;
+pub const SYS_open: ::c_long = 2;
+pub const SYS_close: ::c_long = 3;
+pub const SYS_stat: ::c_long = 4;
+pub const SYS_fstat: ::c_long = 5;
+pub const SYS_lstat: ::c_long = 6;
+pub const SYS_poll: ::c_long = 7;
+pub const SYS_lseek: ::c_long = 8;
+pub const SYS_mmap: ::c_long = 9;
+pub const SYS_mprotect: ::c_long = 10;
+pub const SYS_munmap: ::c_long = 11;
+pub const SYS_brk: ::c_long = 12;
+pub const SYS_rt_sigaction: ::c_long = 13;
+pub const SYS_rt_sigprocmask: ::c_long = 14;
+pub const SYS_rt_sigreturn: ::c_long = 15;
+pub const SYS_ioctl: ::c_long = 16;
+pub const SYS_pread64: ::c_long = 17;
+pub const SYS_pwrite64: ::c_long = 18;
+pub const SYS_readv: ::c_long = 19;
+pub const SYS_writev: ::c_long = 20;
+pub const SYS_access: ::c_long = 21;
+pub const SYS_pipe: ::c_long = 22;
+pub const SYS_select: ::c_long = 23;
+pub const SYS_sched_yield: ::c_long = 24;
+pub const SYS_mremap: ::c_long = 25;
+pub const SYS_msync: ::c_long = 26;
+pub const SYS_mincore: ::c_long = 27;
+pub const SYS_madvise: ::c_long = 28;
+pub const SYS_shmget: ::c_long = 29;
+pub const SYS_shmat: ::c_long = 30;
+pub const SYS_shmctl: ::c_long = 31;
+pub const SYS_dup: ::c_long = 32;
+pub const SYS_dup2: ::c_long = 33;
+pub const SYS_pause: ::c_long = 34;
+pub const SYS_nanosleep: ::c_long = 35;
+pub const SYS_getitimer: ::c_long = 36;
+pub const SYS_alarm: ::c_long = 37;
+pub const SYS_setitimer: ::c_long = 38;
+pub const SYS_getpid: ::c_long = 39;
+pub const SYS_sendfile: ::c_long = 40;
+pub const SYS_socket: ::c_long = 41;
+pub const SYS_connect: ::c_long = 42;
+pub const SYS_accept: ::c_long = 43;
+pub const SYS_sendto: ::c_long = 44;
+pub const SYS_recvfrom: ::c_long = 45;
+pub const SYS_sendmsg: ::c_long = 46;
+pub const SYS_recvmsg: ::c_long = 47;
+pub const SYS_shutdown: ::c_long = 48;
+pub const SYS_bind: ::c_long = 49;
+pub const SYS_listen: ::c_long = 50;
+pub const SYS_getsockname: ::c_long = 51;
+pub const SYS_getpeername: ::c_long = 52;
+pub const SYS_socketpair: ::c_long = 53;
+pub const SYS_setsockopt: ::c_long = 54;
+pub const SYS_getsockopt: ::c_long = 55;
+pub const SYS_clone: ::c_long = 56;
+pub const SYS_fork: ::c_long = 57;
+pub const SYS_vfork: ::c_long = 58;
+pub const SYS_execve: ::c_long = 59;
+pub const SYS_exit: ::c_long = 60;
+pub const SYS_wait4: ::c_long = 61;
+pub const SYS_kill: ::c_long = 62;
+pub const SYS_uname: ::c_long = 63;
+pub const SYS_semget: ::c_long = 64;
+pub const SYS_semop: ::c_long = 65;
+pub const SYS_semctl: ::c_long = 66;
+pub const SYS_shmdt: ::c_long = 67;
+pub const SYS_msgget: ::c_long = 68;
+pub const SYS_msgsnd: ::c_long = 69;
+pub const SYS_msgrcv: ::c_long = 70;
+pub const SYS_msgctl: ::c_long = 71;
+pub const SYS_fcntl: ::c_long = 72;
+pub const SYS_flock: ::c_long = 73;
+pub const SYS_fsync: ::c_long = 74;
+pub const SYS_fdatasync: ::c_long = 75;
+pub const SYS_truncate: ::c_long = 76;
+pub const SYS_ftruncate: ::c_long = 77;
+pub const SYS_getdents: ::c_long = 78;
+pub const SYS_getcwd: ::c_long = 79;
+pub const SYS_chdir: ::c_long = 80;
+pub const SYS_fchdir: ::c_long = 81;
+pub const SYS_rename: ::c_long = 82;
+pub const SYS_mkdir: ::c_long = 83;
+pub const SYS_rmdir: ::c_long = 84;
+pub const SYS_creat: ::c_long = 85;
+pub const SYS_link: ::c_long = 86;
+pub const SYS_unlink: ::c_long = 87;
+pub const SYS_symlink: ::c_long = 88;
+pub const SYS_readlink: ::c_long = 89;
+pub const SYS_chmod: ::c_long = 90;
+pub const SYS_fchmod: ::c_long = 91;
+pub const SYS_chown: ::c_long = 92;
+pub const SYS_fchown: ::c_long = 93;
+pub const SYS_lchown: ::c_long = 94;
+pub const SYS_umask: ::c_long = 95;
+pub const SYS_gettimeofday: ::c_long = 96;
+pub const SYS_getrlimit: ::c_long = 97;
+pub const SYS_getrusage: ::c_long = 98;
+pub const SYS_sysinfo: ::c_long = 99;
+pub const SYS_times: ::c_long = 100;
+pub const SYS_ptrace: ::c_long = 101;
+pub const SYS_getuid: ::c_long = 102;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_getgid: ::c_long = 104;
+pub const SYS_setuid: ::c_long = 105;
+pub const SYS_setgid: ::c_long = 106;
+pub const SYS_geteuid: ::c_long = 107;
+pub const SYS_getegid: ::c_long = 108;
+pub const SYS_setpgid: ::c_long = 109;
+pub const SYS_getppid: ::c_long = 110;
+pub const SYS_getpgrp: ::c_long = 111;
+pub const SYS_setsid: ::c_long = 112;
+pub const SYS_setreuid: ::c_long = 113;
+pub const SYS_setregid: ::c_long = 114;
+pub const SYS_getgroups: ::c_long = 115;
+pub const SYS_setgroups: ::c_long = 116;
+pub const SYS_setresuid: ::c_long = 117;
+pub const SYS_getresuid: ::c_long = 118;
+pub const SYS_setresgid: ::c_long = 119;
+pub const SYS_getresgid: ::c_long = 120;
+pub const SYS_getpgid: ::c_long = 121;
+pub const SYS_setfsuid: ::c_long = 122;
+pub const SYS_setfsgid: ::c_long = 123;
+pub const SYS_getsid: ::c_long = 124;
+pub const SYS_capget: ::c_long = 125;
+pub const SYS_capset: ::c_long = 126;
+pub const SYS_rt_sigpending: ::c_long = 127;
+pub const SYS_rt_sigtimedwait: ::c_long = 128;
+pub const SYS_rt_sigqueueinfo: ::c_long = 129;
+pub const SYS_rt_sigsuspend: ::c_long = 130;
+pub const SYS_sigaltstack: ::c_long = 131;
+pub const SYS_utime: ::c_long = 132;
+pub const SYS_mknod: ::c_long = 133;
+pub const SYS_uselib: ::c_long = 134;
+pub const SYS_personality: ::c_long = 135;
+pub const SYS_ustat: ::c_long = 136;
+pub const SYS_statfs: ::c_long = 137;
+pub const SYS_fstatfs: ::c_long = 138;
+pub const SYS_sysfs: ::c_long = 139;
+pub const SYS_getpriority: ::c_long = 140;
+pub const SYS_setpriority: ::c_long = 141;
+pub const SYS_sched_setparam: ::c_long = 142;
+pub const SYS_sched_getparam: ::c_long = 143;
+pub const SYS_sched_setscheduler: ::c_long = 144;
+pub const SYS_sched_getscheduler: ::c_long = 145;
+pub const SYS_sched_get_priority_max: ::c_long = 146;
+pub const SYS_sched_get_priority_min: ::c_long = 147;
+pub const SYS_sched_rr_get_interval: ::c_long = 148;
+pub const SYS_mlock: ::c_long = 149;
+pub const SYS_munlock: ::c_long = 150;
+pub const SYS_mlockall: ::c_long = 151;
+pub const SYS_munlockall: ::c_long = 152;
+pub const SYS_vhangup: ::c_long = 153;
+pub const SYS_modify_ldt: ::c_long = 154;
+pub const SYS_pivot_root: ::c_long = 155;
+pub const SYS__sysctl: ::c_long = 156;
+pub const SYS_prctl: ::c_long = 157;
+pub const SYS_arch_prctl: ::c_long = 158;
+pub const SYS_adjtimex: ::c_long = 159;
+pub const SYS_setrlimit: ::c_long = 160;
+pub const SYS_chroot: ::c_long = 161;
+pub const SYS_sync: ::c_long = 162;
+pub const SYS_acct: ::c_long = 163;
+pub const SYS_settimeofday: ::c_long = 164;
+pub const SYS_mount: ::c_long = 165;
+pub const SYS_umount2: ::c_long = 166;
+pub const SYS_swapon: ::c_long = 167;
+pub const SYS_swapoff: ::c_long = 168;
+pub const SYS_reboot: ::c_long = 169;
+pub const SYS_sethostname: ::c_long = 170;
+pub const SYS_setdomainname: ::c_long = 171;
+pub const SYS_iopl: ::c_long = 172;
+pub const SYS_ioperm: ::c_long = 173;
+pub const SYS_create_module: ::c_long = 174;
+pub const SYS_init_module: ::c_long = 175;
+pub const SYS_delete_module: ::c_long = 176;
+pub const SYS_get_kernel_syms: ::c_long = 177;
+pub const SYS_query_module: ::c_long = 178;
+pub const SYS_quotactl: ::c_long = 179;
+pub const SYS_nfsservctl: ::c_long = 180;
+pub const SYS_getpmsg: ::c_long = 181;
+pub const SYS_putpmsg: ::c_long = 182;
+pub const SYS_afs_syscall: ::c_long = 183;
+pub const SYS_tuxcall: ::c_long = 184;
+pub const SYS_security: ::c_long = 185;
+pub const SYS_gettid: ::c_long = 186;
+pub const SYS_readahead: ::c_long = 187;
+pub const SYS_setxattr: ::c_long = 188;
+pub const SYS_lsetxattr: ::c_long = 189;
+pub const SYS_fsetxattr: ::c_long = 190;
+pub const SYS_getxattr: ::c_long = 191;
+pub const SYS_lgetxattr: ::c_long = 192;
+pub const SYS_fgetxattr: ::c_long = 193;
+pub const SYS_listxattr: ::c_long = 194;
+pub const SYS_llistxattr: ::c_long = 195;
+pub const SYS_flistxattr: ::c_long = 196;
+pub const SYS_removexattr: ::c_long = 197;
+pub const SYS_lremovexattr: ::c_long = 198;
+pub const SYS_fremovexattr: ::c_long = 199;
+pub const SYS_tkill: ::c_long = 200;
+pub const SYS_time: ::c_long = 201;
+pub const SYS_futex: ::c_long = 202;
+pub const SYS_sched_setaffinity: ::c_long = 203;
+pub const SYS_sched_getaffinity: ::c_long = 204;
+pub const SYS_set_thread_area: ::c_long = 205;
+pub const SYS_io_setup: ::c_long = 206;
+pub const SYS_io_destroy: ::c_long = 207;
+pub const SYS_io_getevents: ::c_long = 208;
+pub const SYS_io_submit: ::c_long = 209;
+pub const SYS_io_cancel: ::c_long = 210;
+pub const SYS_get_thread_area: ::c_long = 211;
+pub const SYS_lookup_dcookie: ::c_long = 212;
+pub const SYS_epoll_create: ::c_long = 213;
+pub const SYS_epoll_ctl_old: ::c_long = 214;
+pub const SYS_epoll_wait_old: ::c_long = 215;
+pub const SYS_remap_file_pages: ::c_long = 216;
+pub const SYS_getdents64: ::c_long = 217;
+pub const SYS_set_tid_address: ::c_long = 218;
+pub const SYS_restart_syscall: ::c_long = 219;
+pub const SYS_semtimedop: ::c_long = 220;
+pub const SYS_fadvise64: ::c_long = 221;
+pub const SYS_timer_create: ::c_long = 222;
+pub const SYS_timer_settime: ::c_long = 223;
+pub const SYS_timer_gettime: ::c_long = 224;
+pub const SYS_timer_getoverrun: ::c_long = 225;
+pub const SYS_timer_delete: ::c_long = 226;
+pub const SYS_clock_settime: ::c_long = 227;
+pub const SYS_clock_gettime: ::c_long = 228;
+pub const SYS_clock_getres: ::c_long = 229;
+pub const SYS_clock_nanosleep: ::c_long = 230;
+pub const SYS_exit_group: ::c_long = 231;
+pub const SYS_epoll_wait: ::c_long = 232;
+pub const SYS_epoll_ctl: ::c_long = 233;
+pub const SYS_tgkill: ::c_long = 234;
+pub const SYS_utimes: ::c_long = 235;
+pub const SYS_vserver: ::c_long = 236;
+pub const SYS_mbind: ::c_long = 237;
+pub const SYS_set_mempolicy: ::c_long = 238;
+pub const SYS_get_mempolicy: ::c_long = 239;
+pub const SYS_mq_open: ::c_long = 240;
+pub const SYS_mq_unlink: ::c_long = 241;
+pub const SYS_mq_timedsend: ::c_long = 242;
+pub const SYS_mq_timedreceive: ::c_long = 243;
+pub const SYS_mq_notify: ::c_long = 244;
+pub const SYS_mq_getsetattr: ::c_long = 245;
+pub const SYS_kexec_load: ::c_long = 246;
+pub const SYS_waitid: ::c_long = 247;
+pub const SYS_add_key: ::c_long = 248;
+pub const SYS_request_key: ::c_long = 249;
+pub const SYS_keyctl: ::c_long = 250;
+pub const SYS_ioprio_set: ::c_long = 251;
+pub const SYS_ioprio_get: ::c_long = 252;
+pub const SYS_inotify_init: ::c_long = 253;
+pub const SYS_inotify_add_watch: ::c_long = 254;
+pub const SYS_inotify_rm_watch: ::c_long = 255;
+pub const SYS_migrate_pages: ::c_long = 256;
+pub const SYS_openat: ::c_long = 257;
+pub const SYS_mkdirat: ::c_long = 258;
+pub const SYS_mknodat: ::c_long = 259;
+pub const SYS_fchownat: ::c_long = 260;
+pub const SYS_futimesat: ::c_long = 261;
+pub const SYS_newfstatat: ::c_long = 262;
+pub const SYS_unlinkat: ::c_long = 263;
+pub const SYS_renameat: ::c_long = 264;
+pub const SYS_linkat: ::c_long = 265;
+pub const SYS_symlinkat: ::c_long = 266;
+pub const SYS_readlinkat: ::c_long = 267;
+pub const SYS_fchmodat: ::c_long = 268;
+pub const SYS_faccessat: ::c_long = 269;
+pub const SYS_pselect6: ::c_long = 270;
+pub const SYS_ppoll: ::c_long = 271;
+pub const SYS_unshare: ::c_long = 272;
+pub const SYS_set_robust_list: ::c_long = 273;
+pub const SYS_get_robust_list: ::c_long = 274;
+pub const SYS_splice: ::c_long = 275;
+pub const SYS_tee: ::c_long = 276;
+pub const SYS_sync_file_range: ::c_long = 277;
+pub const SYS_vmsplice: ::c_long = 278;
+pub const SYS_move_pages: ::c_long = 279;
+pub const SYS_utimensat: ::c_long = 280;
+pub const SYS_epoll_pwait: ::c_long = 281;
+pub const SYS_signalfd: ::c_long = 282;
+pub const SYS_timerfd_create: ::c_long = 283;
+pub const SYS_eventfd: ::c_long = 284;
+pub const SYS_fallocate: ::c_long = 285;
+pub const SYS_timerfd_settime: ::c_long = 286;
+pub const SYS_timerfd_gettime: ::c_long = 287;
+pub const SYS_accept4: ::c_long = 288;
+pub const SYS_signalfd4: ::c_long = 289;
+pub const SYS_eventfd2: ::c_long = 290;
+pub const SYS_epoll_create1: ::c_long = 291;
+pub const SYS_dup3: ::c_long = 292;
+pub const SYS_pipe2: ::c_long = 293;
+pub const SYS_inotify_init1: ::c_long = 294;
+pub const SYS_preadv: ::c_long = 295;
+pub const SYS_pwritev: ::c_long = 296;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 297;
+pub const SYS_perf_event_open: ::c_long = 298;
+pub const SYS_recvmmsg: ::c_long = 299;
+pub const SYS_fanotify_init: ::c_long = 300;
+pub const SYS_fanotify_mark: ::c_long = 301;
+pub const SYS_prlimit64: ::c_long = 302;
+pub const SYS_name_to_handle_at: ::c_long = 303;
+pub const SYS_open_by_handle_at: ::c_long = 304;
+pub const SYS_clock_adjtime: ::c_long = 305;
+pub const SYS_syncfs: ::c_long = 306;
+pub const SYS_sendmmsg: ::c_long = 307;
+pub const SYS_setns: ::c_long = 308;
+pub const SYS_getcpu: ::c_long = 309;
+pub const SYS_process_vm_readv: ::c_long = 310;
+pub const SYS_process_vm_writev: ::c_long = 311;
+pub const SYS_kcmp: ::c_long = 312;
+pub const SYS_finit_module: ::c_long = 313;
+pub const SYS_sched_setattr: ::c_long = 314;
+pub const SYS_sched_getattr: ::c_long = 315;
+pub const SYS_renameat2: ::c_long = 316;
+pub const SYS_seccomp: ::c_long = 317;
+pub const SYS_getrandom: ::c_long = 318;
+pub const SYS_memfd_create: ::c_long = 319;
+pub const SYS_kexec_file_load: ::c_long = 320;
+pub const SYS_bpf: ::c_long = 321;
+pub const SYS_execveat: ::c_long = 322;
+pub const SYS_userfaultfd: ::c_long = 323;
+pub const SYS_membarrier: ::c_long = 324;
+pub const SYS_mlock2: ::c_long = 325;
+pub const SYS_copy_file_range: ::c_long = 326;
+pub const SYS_preadv2: ::c_long = 327;
+pub const SYS_pwritev2: ::c_long = 328;
+pub const SYS_pkey_mprotect: ::c_long = 329;
+pub const SYS_pkey_alloc: ::c_long = 330;
+pub const SYS_pkey_free: ::c_long = 331;
+pub const SYS_statx: ::c_long = 332;
+pub const SYS_rseq: ::c_long = 334;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+extern "C" {
+    pub fn sysctl(
+        name: *mut ::c_int,
+        namelen: ::c_int,
+        oldp: *mut ::c_void,
+        oldlenp: *mut ::size_t,
+        newp: *mut ::c_void,
+        newlen: ::size_t,
+    ) -> ::c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,404 @@
+use pthread_mutex_t;
+
+pub type c_long = i32;
+pub type c_ulong = u32;
+
+s! {
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+}
+
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 32;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 44;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20;
+
+align_const! {
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+    pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+        pthread_mutex_t {
+            size: [
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0,
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+            ],
+        };
+}
+
+// Syscall table
+
+pub const __X32_SYSCALL_BIT: ::c_long = 0x40000000;
+
+pub const SYS_read: ::c_long = __X32_SYSCALL_BIT + 0;
+pub const SYS_write: ::c_long = __X32_SYSCALL_BIT + 1;
+pub const SYS_open: ::c_long = __X32_SYSCALL_BIT + 2;
+pub const SYS_close: ::c_long = __X32_SYSCALL_BIT + 3;
+pub const SYS_stat: ::c_long = __X32_SYSCALL_BIT + 4;
+pub const SYS_fstat: ::c_long = __X32_SYSCALL_BIT + 5;
+pub const SYS_lstat: ::c_long = __X32_SYSCALL_BIT + 6;
+pub const SYS_poll: ::c_long = __X32_SYSCALL_BIT + 7;
+pub const SYS_lseek: ::c_long = __X32_SYSCALL_BIT + 8;
+pub const SYS_mmap: ::c_long = __X32_SYSCALL_BIT + 9;
+pub const SYS_mprotect: ::c_long = __X32_SYSCALL_BIT + 10;
+pub const SYS_munmap: ::c_long = __X32_SYSCALL_BIT + 11;
+pub const SYS_brk: ::c_long = __X32_SYSCALL_BIT + 12;
+pub const SYS_rt_sigprocmask: ::c_long = __X32_SYSCALL_BIT + 14;
+pub const SYS_pread64: ::c_long = __X32_SYSCALL_BIT + 17;
+pub const SYS_pwrite64: ::c_long = __X32_SYSCALL_BIT + 18;
+pub const SYS_access: ::c_long = __X32_SYSCALL_BIT + 21;
+pub const SYS_pipe: ::c_long = __X32_SYSCALL_BIT + 22;
+pub const SYS_select: ::c_long = __X32_SYSCALL_BIT + 23;
+pub const SYS_sched_yield: ::c_long = __X32_SYSCALL_BIT + 24;
+pub const SYS_mremap: ::c_long = __X32_SYSCALL_BIT + 25;
+pub const SYS_msync: ::c_long = __X32_SYSCALL_BIT + 26;
+pub const SYS_mincore: ::c_long = __X32_SYSCALL_BIT + 27;
+pub const SYS_madvise: ::c_long = __X32_SYSCALL_BIT + 28;
+pub const SYS_shmget: ::c_long = __X32_SYSCALL_BIT + 29;
+pub const SYS_shmat: ::c_long = __X32_SYSCALL_BIT + 30;
+pub const SYS_shmctl: ::c_long = __X32_SYSCALL_BIT + 31;
+pub const SYS_dup: ::c_long = __X32_SYSCALL_BIT + 32;
+pub const SYS_dup2: ::c_long = __X32_SYSCALL_BIT + 33;
+pub const SYS_pause: ::c_long = __X32_SYSCALL_BIT + 34;
+pub const SYS_nanosleep: ::c_long = __X32_SYSCALL_BIT + 35;
+pub const SYS_getitimer: ::c_long = __X32_SYSCALL_BIT + 36;
+pub const SYS_alarm: ::c_long = __X32_SYSCALL_BIT + 37;
+pub const SYS_setitimer: ::c_long = __X32_SYSCALL_BIT + 38;
+pub const SYS_getpid: ::c_long = __X32_SYSCALL_BIT + 39;
+pub const SYS_sendfile: ::c_long = __X32_SYSCALL_BIT + 40;
+pub const SYS_socket: ::c_long = __X32_SYSCALL_BIT + 41;
+pub const SYS_connect: ::c_long = __X32_SYSCALL_BIT + 42;
+pub const SYS_accept: ::c_long = __X32_SYSCALL_BIT + 43;
+pub const SYS_sendto: ::c_long = __X32_SYSCALL_BIT + 44;
+pub const SYS_shutdown: ::c_long = __X32_SYSCALL_BIT + 48;
+pub const SYS_bind: ::c_long = __X32_SYSCALL_BIT + 49;
+pub const SYS_listen: ::c_long = __X32_SYSCALL_BIT + 50;
+pub const SYS_getsockname: ::c_long = __X32_SYSCALL_BIT + 51;
+pub const SYS_getpeername: ::c_long = __X32_SYSCALL_BIT + 52;
+pub const SYS_socketpair: ::c_long = __X32_SYSCALL_BIT + 53;
+pub const SYS_clone: ::c_long = __X32_SYSCALL_BIT + 56;
+pub const SYS_fork: ::c_long = __X32_SYSCALL_BIT + 57;
+pub const SYS_vfork: ::c_long = __X32_SYSCALL_BIT + 58;
+pub const SYS_exit: ::c_long = __X32_SYSCALL_BIT + 60;
+pub const SYS_wait4: ::c_long = __X32_SYSCALL_BIT + 61;
+pub const SYS_kill: ::c_long = __X32_SYSCALL_BIT + 62;
+pub const SYS_uname: ::c_long = __X32_SYSCALL_BIT + 63;
+pub const SYS_semget: ::c_long = __X32_SYSCALL_BIT + 64;
+pub const SYS_semop: ::c_long = __X32_SYSCALL_BIT + 65;
+pub const SYS_semctl: ::c_long = __X32_SYSCALL_BIT + 66;
+pub const SYS_shmdt: ::c_long = __X32_SYSCALL_BIT + 67;
+pub const SYS_msgget: ::c_long = __X32_SYSCALL_BIT + 68;
+pub const SYS_msgsnd: ::c_long = __X32_SYSCALL_BIT + 69;
+pub const SYS_msgrcv: ::c_long = __X32_SYSCALL_BIT + 70;
+pub const SYS_msgctl: ::c_long = __X32_SYSCALL_BIT + 71;
+pub const SYS_fcntl: ::c_long = __X32_SYSCALL_BIT + 72;
+pub const SYS_flock: ::c_long = __X32_SYSCALL_BIT + 73;
+pub const SYS_fsync: ::c_long = __X32_SYSCALL_BIT + 74;
+pub const SYS_fdatasync: ::c_long = __X32_SYSCALL_BIT + 75;
+pub const SYS_truncate: ::c_long = __X32_SYSCALL_BIT + 76;
+pub const SYS_ftruncate: ::c_long = __X32_SYSCALL_BIT + 77;
+pub const SYS_getdents: ::c_long = __X32_SYSCALL_BIT + 78;
+pub const SYS_getcwd: ::c_long = __X32_SYSCALL_BIT + 79;
+pub const SYS_chdir: ::c_long = __X32_SYSCALL_BIT + 80;
+pub const SYS_fchdir: ::c_long = __X32_SYSCALL_BIT + 81;
+pub const SYS_rename: ::c_long = __X32_SYSCALL_BIT + 82;
+pub const SYS_mkdir: ::c_long = __X32_SYSCALL_BIT + 83;
+pub const SYS_rmdir: ::c_long = __X32_SYSCALL_BIT + 84;
+pub const SYS_creat: ::c_long = __X32_SYSCALL_BIT + 85;
+pub const SYS_link: ::c_long = __X32_SYSCALL_BIT + 86;
+pub const SYS_unlink: ::c_long = __X32_SYSCALL_BIT + 87;
+pub const SYS_symlink: ::c_long = __X32_SYSCALL_BIT + 88;
+pub const SYS_readlink: ::c_long = __X32_SYSCALL_BIT + 89;
+pub const SYS_chmod: ::c_long = __X32_SYSCALL_BIT + 90;
+pub const SYS_fchmod: ::c_long = __X32_SYSCALL_BIT + 91;
+pub const SYS_chown: ::c_long = __X32_SYSCALL_BIT + 92;
+pub const SYS_fchown: ::c_long = __X32_SYSCALL_BIT + 93;
+pub const SYS_lchown: ::c_long = __X32_SYSCALL_BIT + 94;
+pub const SYS_umask: ::c_long = __X32_SYSCALL_BIT + 95;
+pub const SYS_gettimeofday: ::c_long = __X32_SYSCALL_BIT + 96;
+pub const SYS_getrlimit: ::c_long = __X32_SYSCALL_BIT + 97;
+pub const SYS_getrusage: ::c_long = __X32_SYSCALL_BIT + 98;
+pub const SYS_sysinfo: ::c_long = __X32_SYSCALL_BIT + 99;
+pub const SYS_times: ::c_long = __X32_SYSCALL_BIT + 100;
+pub const SYS_getuid: ::c_long = __X32_SYSCALL_BIT + 102;
+pub const SYS_syslog: ::c_long = __X32_SYSCALL_BIT + 103;
+pub const SYS_getgid: ::c_long = __X32_SYSCALL_BIT + 104;
+pub const SYS_setuid: ::c_long = __X32_SYSCALL_BIT + 105;
+pub const SYS_setgid: ::c_long = __X32_SYSCALL_BIT + 106;
+pub const SYS_geteuid: ::c_long = __X32_SYSCALL_BIT + 107;
+pub const SYS_getegid: ::c_long = __X32_SYSCALL_BIT + 108;
+pub const SYS_setpgid: ::c_long = __X32_SYSCALL_BIT + 109;
+pub const SYS_getppid: ::c_long = __X32_SYSCALL_BIT + 110;
+pub const SYS_getpgrp: ::c_long = __X32_SYSCALL_BIT + 111;
+pub const SYS_setsid: ::c_long = __X32_SYSCALL_BIT + 112;
+pub const SYS_setreuid: ::c_long = __X32_SYSCALL_BIT + 113;
+pub const SYS_setregid: ::c_long = __X32_SYSCALL_BIT + 114;
+pub const SYS_getgroups: ::c_long = __X32_SYSCALL_BIT + 115;
+pub const SYS_setgroups: ::c_long = __X32_SYSCALL_BIT + 116;
+pub const SYS_setresuid: ::c_long = __X32_SYSCALL_BIT + 117;
+pub const SYS_getresuid: ::c_long = __X32_SYSCALL_BIT + 118;
+pub const SYS_setresgid: ::c_long = __X32_SYSCALL_BIT + 119;
+pub const SYS_getresgid: ::c_long = __X32_SYSCALL_BIT + 120;
+pub const SYS_getpgid: ::c_long = __X32_SYSCALL_BIT + 121;
+pub const SYS_setfsuid: ::c_long = __X32_SYSCALL_BIT + 122;
+pub const SYS_setfsgid: ::c_long = __X32_SYSCALL_BIT + 123;
+pub const SYS_getsid: ::c_long = __X32_SYSCALL_BIT + 124;
+pub const SYS_capget: ::c_long = __X32_SYSCALL_BIT + 125;
+pub const SYS_capset: ::c_long = __X32_SYSCALL_BIT + 126;
+pub const SYS_rt_sigsuspend: ::c_long = __X32_SYSCALL_BIT + 130;
+pub const SYS_utime: ::c_long = __X32_SYSCALL_BIT + 132;
+pub const SYS_mknod: ::c_long = __X32_SYSCALL_BIT + 133;
+pub const SYS_personality: ::c_long = __X32_SYSCALL_BIT + 135;
+pub const SYS_ustat: ::c_long = __X32_SYSCALL_BIT + 136;
+pub const SYS_statfs: ::c_long = __X32_SYSCALL_BIT + 137;
+pub const SYS_fstatfs: ::c_long = __X32_SYSCALL_BIT + 138;
+pub const SYS_sysfs: ::c_long = __X32_SYSCALL_BIT + 139;
+pub const SYS_getpriority: ::c_long = __X32_SYSCALL_BIT + 140;
+pub const SYS_setpriority: ::c_long = __X32_SYSCALL_BIT + 141;
+pub const SYS_sched_setparam: ::c_long = __X32_SYSCALL_BIT + 142;
+pub const SYS_sched_getparam: ::c_long = __X32_SYSCALL_BIT + 143;
+pub const SYS_sched_setscheduler: ::c_long = __X32_SYSCALL_BIT + 144;
+pub const SYS_sched_getscheduler: ::c_long = __X32_SYSCALL_BIT + 145;
+pub const SYS_sched_get_priority_max: ::c_long = __X32_SYSCALL_BIT + 146;
+pub const SYS_sched_get_priority_min: ::c_long = __X32_SYSCALL_BIT + 147;
+pub const SYS_sched_rr_get_interval: ::c_long = __X32_SYSCALL_BIT + 148;
+pub const SYS_mlock: ::c_long = __X32_SYSCALL_BIT + 149;
+pub const SYS_munlock: ::c_long = __X32_SYSCALL_BIT + 150;
+pub const SYS_mlockall: ::c_long = __X32_SYSCALL_BIT + 151;
+pub const SYS_munlockall: ::c_long = __X32_SYSCALL_BIT + 152;
+pub const SYS_vhangup: ::c_long = __X32_SYSCALL_BIT + 153;
+pub const SYS_modify_ldt: ::c_long = __X32_SYSCALL_BIT + 154;
+pub const SYS_pivot_root: ::c_long = __X32_SYSCALL_BIT + 155;
+pub const SYS_prctl: ::c_long = __X32_SYSCALL_BIT + 157;
+pub const SYS_arch_prctl: ::c_long = __X32_SYSCALL_BIT + 158;
+pub const SYS_adjtimex: ::c_long = __X32_SYSCALL_BIT + 159;
+pub const SYS_setrlimit: ::c_long = __X32_SYSCALL_BIT + 160;
+pub const SYS_chroot: ::c_long = __X32_SYSCALL_BIT + 161;
+pub const SYS_sync: ::c_long = __X32_SYSCALL_BIT + 162;
+pub const SYS_acct: ::c_long = __X32_SYSCALL_BIT + 163;
+pub const SYS_settimeofday: ::c_long = __X32_SYSCALL_BIT + 164;
+pub const SYS_mount: ::c_long = __X32_SYSCALL_BIT + 165;
+pub const SYS_umount2: ::c_long = __X32_SYSCALL_BIT + 166;
+pub const SYS_swapon: ::c_long = __X32_SYSCALL_BIT + 167;
+pub const SYS_swapoff: ::c_long = __X32_SYSCALL_BIT + 168;
+pub const SYS_reboot: ::c_long = __X32_SYSCALL_BIT + 169;
+pub const SYS_sethostname: ::c_long = __X32_SYSCALL_BIT + 170;
+pub const SYS_setdomainname: ::c_long = __X32_SYSCALL_BIT + 171;
+pub const SYS_iopl: ::c_long = __X32_SYSCALL_BIT + 172;
+pub const SYS_ioperm: ::c_long = __X32_SYSCALL_BIT + 173;
+pub const SYS_init_module: ::c_long = __X32_SYSCALL_BIT + 175;
+pub const SYS_delete_module: ::c_long = __X32_SYSCALL_BIT + 176;
+pub const SYS_quotactl: ::c_long = __X32_SYSCALL_BIT + 179;
+pub const SYS_getpmsg: ::c_long = __X32_SYSCALL_BIT + 181;
+pub const SYS_putpmsg: ::c_long = __X32_SYSCALL_BIT + 182;
+pub const SYS_afs_syscall: ::c_long = __X32_SYSCALL_BIT + 183;
+pub const SYS_tuxcall: ::c_long = __X32_SYSCALL_BIT + 184;
+pub const SYS_security: ::c_long = __X32_SYSCALL_BIT + 185;
+pub const SYS_gettid: ::c_long = __X32_SYSCALL_BIT + 186;
+pub const SYS_readahead: ::c_long = __X32_SYSCALL_BIT + 187;
+pub const SYS_setxattr: ::c_long = __X32_SYSCALL_BIT + 188;
+pub const SYS_lsetxattr: ::c_long = __X32_SYSCALL_BIT + 189;
+pub const SYS_fsetxattr: ::c_long = __X32_SYSCALL_BIT + 190;
+pub const SYS_getxattr: ::c_long = __X32_SYSCALL_BIT + 191;
+pub const SYS_lgetxattr: ::c_long = __X32_SYSCALL_BIT + 192;
+pub const SYS_fgetxattr: ::c_long = __X32_SYSCALL_BIT + 193;
+pub const SYS_listxattr: ::c_long = __X32_SYSCALL_BIT + 194;
+pub const SYS_llistxattr: ::c_long = __X32_SYSCALL_BIT + 195;
+pub const SYS_flistxattr: ::c_long = __X32_SYSCALL_BIT + 196;
+pub const SYS_removexattr: ::c_long = __X32_SYSCALL_BIT + 197;
+pub const SYS_lremovexattr: ::c_long = __X32_SYSCALL_BIT + 198;
+pub const SYS_fremovexattr: ::c_long = __X32_SYSCALL_BIT + 199;
+pub const SYS_tkill: ::c_long = __X32_SYSCALL_BIT + 200;
+pub const SYS_time: ::c_long = __X32_SYSCALL_BIT + 201;
+pub const SYS_futex: ::c_long = __X32_SYSCALL_BIT + 202;
+pub const SYS_sched_setaffinity: ::c_long = __X32_SYSCALL_BIT + 203;
+pub const SYS_sched_getaffinity: ::c_long = __X32_SYSCALL_BIT + 204;
+pub const SYS_io_destroy: ::c_long = __X32_SYSCALL_BIT + 207;
+pub const SYS_io_getevents: ::c_long = __X32_SYSCALL_BIT + 208;
+pub const SYS_io_cancel: ::c_long = __X32_SYSCALL_BIT + 210;
+pub const SYS_lookup_dcookie: ::c_long = __X32_SYSCALL_BIT + 212;
+pub const SYS_epoll_create: ::c_long = __X32_SYSCALL_BIT + 213;
+pub const SYS_remap_file_pages: ::c_long = __X32_SYSCALL_BIT + 216;
+pub const SYS_getdents64: ::c_long = __X32_SYSCALL_BIT + 217;
+pub const SYS_set_tid_address: ::c_long = __X32_SYSCALL_BIT + 218;
+pub const SYS_restart_syscall: ::c_long = __X32_SYSCALL_BIT + 219;
+pub const SYS_semtimedop: ::c_long = __X32_SYSCALL_BIT + 220;
+pub const SYS_fadvise64: ::c_long = __X32_SYSCALL_BIT + 221;
+pub const SYS_timer_settime: ::c_long = __X32_SYSCALL_BIT + 223;
+pub const SYS_timer_gettime: ::c_long = __X32_SYSCALL_BIT + 224;
+pub const SYS_timer_getoverrun: ::c_long = __X32_SYSCALL_BIT + 225;
+pub const SYS_timer_delete: ::c_long = __X32_SYSCALL_BIT + 226;
+pub const SYS_clock_settime: ::c_long = __X32_SYSCALL_BIT + 227;
+pub const SYS_clock_gettime: ::c_long = __X32_SYSCALL_BIT + 228;
+pub const SYS_clock_getres: ::c_long = __X32_SYSCALL_BIT + 229;
+pub const SYS_clock_nanosleep: ::c_long = __X32_SYSCALL_BIT + 230;
+pub const SYS_exit_group: ::c_long = __X32_SYSCALL_BIT + 231;
+pub const SYS_epoll_wait: ::c_long = __X32_SYSCALL_BIT + 232;
+pub const SYS_epoll_ctl: ::c_long = __X32_SYSCALL_BIT + 233;
+pub const SYS_tgkill: ::c_long = __X32_SYSCALL_BIT + 234;
+pub const SYS_utimes: ::c_long = __X32_SYSCALL_BIT + 235;
+pub const SYS_mbind: ::c_long = __X32_SYSCALL_BIT + 237;
+pub const SYS_set_mempolicy: ::c_long = __X32_SYSCALL_BIT + 238;
+pub const SYS_get_mempolicy: ::c_long = __X32_SYSCALL_BIT + 239;
+pub const SYS_mq_open: ::c_long = __X32_SYSCALL_BIT + 240;
+pub const SYS_mq_unlink: ::c_long = __X32_SYSCALL_BIT + 241;
+pub const SYS_mq_timedsend: ::c_long = __X32_SYSCALL_BIT + 242;
+pub const SYS_mq_timedreceive: ::c_long = __X32_SYSCALL_BIT + 243;
+pub const SYS_mq_getsetattr: ::c_long = __X32_SYSCALL_BIT + 245;
+pub const SYS_add_key: ::c_long = __X32_SYSCALL_BIT + 248;
+pub const SYS_request_key: ::c_long = __X32_SYSCALL_BIT + 249;
+pub const SYS_keyctl: ::c_long = __X32_SYSCALL_BIT + 250;
+pub const SYS_ioprio_set: ::c_long = __X32_SYSCALL_BIT + 251;
+pub const SYS_ioprio_get: ::c_long = __X32_SYSCALL_BIT + 252;
+pub const SYS_inotify_init: ::c_long = __X32_SYSCALL_BIT + 253;
+pub const SYS_inotify_add_watch: ::c_long = __X32_SYSCALL_BIT + 254;
+pub const SYS_inotify_rm_watch: ::c_long = __X32_SYSCALL_BIT + 255;
+pub const SYS_migrate_pages: ::c_long = __X32_SYSCALL_BIT + 256;
+pub const SYS_openat: ::c_long = __X32_SYSCALL_BIT + 257;
+pub const SYS_mkdirat: ::c_long = __X32_SYSCALL_BIT + 258;
+pub const SYS_mknodat: ::c_long = __X32_SYSCALL_BIT + 259;
+pub const SYS_fchownat: ::c_long = __X32_SYSCALL_BIT + 260;
+pub const SYS_futimesat: ::c_long = __X32_SYSCALL_BIT + 261;
+pub const SYS_newfstatat: ::c_long = __X32_SYSCALL_BIT + 262;
+pub const SYS_unlinkat: ::c_long = __X32_SYSCALL_BIT + 263;
+pub const SYS_renameat: ::c_long = __X32_SYSCALL_BIT + 264;
+pub const SYS_linkat: ::c_long = __X32_SYSCALL_BIT + 265;
+pub const SYS_symlinkat: ::c_long = __X32_SYSCALL_BIT + 266;
+pub const SYS_readlinkat: ::c_long = __X32_SYSCALL_BIT + 267;
+pub const SYS_fchmodat: ::c_long = __X32_SYSCALL_BIT + 268;
+pub const SYS_faccessat: ::c_long = __X32_SYSCALL_BIT + 269;
+pub const SYS_pselect6: ::c_long = __X32_SYSCALL_BIT + 270;
+pub const SYS_ppoll: ::c_long = __X32_SYSCALL_BIT + 271;
+pub const SYS_unshare: ::c_long = __X32_SYSCALL_BIT + 272;
+pub const SYS_splice: ::c_long = __X32_SYSCALL_BIT + 275;
+pub const SYS_tee: ::c_long = __X32_SYSCALL_BIT + 276;
+pub const SYS_sync_file_range: ::c_long = __X32_SYSCALL_BIT + 277;
+pub const SYS_utimensat: ::c_long = __X32_SYSCALL_BIT + 280;
+pub const SYS_epoll_pwait: ::c_long = __X32_SYSCALL_BIT + 281;
+pub const SYS_signalfd: ::c_long = __X32_SYSCALL_BIT + 282;
+pub const SYS_timerfd_create: ::c_long = __X32_SYSCALL_BIT + 283;
+pub const SYS_eventfd: ::c_long = __X32_SYSCALL_BIT + 284;
+pub const SYS_fallocate: ::c_long = __X32_SYSCALL_BIT + 285;
+pub const SYS_timerfd_settime: ::c_long = __X32_SYSCALL_BIT + 286;
+pub const SYS_timerfd_gettime: ::c_long = __X32_SYSCALL_BIT + 287;
+pub const SYS_accept4: ::c_long = __X32_SYSCALL_BIT + 288;
+pub const SYS_signalfd4: ::c_long = __X32_SYSCALL_BIT + 289;
+pub const SYS_eventfd2: ::c_long = __X32_SYSCALL_BIT + 290;
+pub const SYS_epoll_create1: ::c_long = __X32_SYSCALL_BIT + 291;
+pub const SYS_dup3: ::c_long = __X32_SYSCALL_BIT + 292;
+pub const SYS_pipe2: ::c_long = __X32_SYSCALL_BIT + 293;
+pub const SYS_inotify_init1: ::c_long = __X32_SYSCALL_BIT + 294;
+pub const SYS_perf_event_open: ::c_long = __X32_SYSCALL_BIT + 298;
+pub const SYS_fanotify_init: ::c_long = __X32_SYSCALL_BIT + 300;
+pub const SYS_fanotify_mark: ::c_long = __X32_SYSCALL_BIT + 301;
+pub const SYS_prlimit64: ::c_long = __X32_SYSCALL_BIT + 302;
+pub const SYS_name_to_handle_at: ::c_long = __X32_SYSCALL_BIT + 303;
+pub const SYS_open_by_handle_at: ::c_long = __X32_SYSCALL_BIT + 304;
+pub const SYS_clock_adjtime: ::c_long = __X32_SYSCALL_BIT + 305;
+pub const SYS_syncfs: ::c_long = __X32_SYSCALL_BIT + 306;
+pub const SYS_setns: ::c_long = __X32_SYSCALL_BIT + 308;
+pub const SYS_getcpu: ::c_long = __X32_SYSCALL_BIT + 309;
+pub const SYS_kcmp: ::c_long = __X32_SYSCALL_BIT + 312;
+pub const SYS_finit_module: ::c_long = __X32_SYSCALL_BIT + 313;
+pub const SYS_sched_setattr: ::c_long = __X32_SYSCALL_BIT + 314;
+pub const SYS_sched_getattr: ::c_long = __X32_SYSCALL_BIT + 315;
+pub const SYS_renameat2: ::c_long = __X32_SYSCALL_BIT + 316;
+pub const SYS_seccomp: ::c_long = __X32_SYSCALL_BIT + 317;
+pub const SYS_getrandom: ::c_long = __X32_SYSCALL_BIT + 318;
+pub const SYS_memfd_create: ::c_long = __X32_SYSCALL_BIT + 319;
+pub const SYS_kexec_file_load: ::c_long = __X32_SYSCALL_BIT + 320;
+pub const SYS_bpf: ::c_long = __X32_SYSCALL_BIT + 321;
+pub const SYS_userfaultfd: ::c_long = __X32_SYSCALL_BIT + 323;
+pub const SYS_membarrier: ::c_long = __X32_SYSCALL_BIT + 324;
+pub const SYS_mlock2: ::c_long = __X32_SYSCALL_BIT + 325;
+pub const SYS_copy_file_range: ::c_long = __X32_SYSCALL_BIT + 326;
+pub const SYS_pkey_mprotect: ::c_long = __X32_SYSCALL_BIT + 329;
+pub const SYS_pkey_alloc: ::c_long = __X32_SYSCALL_BIT + 330;
+pub const SYS_pkey_free: ::c_long = __X32_SYSCALL_BIT + 331;
+pub const SYS_statx: ::c_long = __X32_SYSCALL_BIT + 332;
+pub const SYS_rseq: ::c_long = __X32_SYSCALL_BIT + 334;
+pub const SYS_pidfd_send_signal: ::c_long = __X32_SYSCALL_BIT + 424;
+pub const SYS_io_uring_setup: ::c_long = __X32_SYSCALL_BIT + 425;
+pub const SYS_io_uring_enter: ::c_long = __X32_SYSCALL_BIT + 426;
+pub const SYS_io_uring_register: ::c_long = __X32_SYSCALL_BIT + 427;
+pub const SYS_open_tree: ::c_long = __X32_SYSCALL_BIT + 428;
+pub const SYS_move_mount: ::c_long = __X32_SYSCALL_BIT + 429;
+pub const SYS_fsopen: ::c_long = __X32_SYSCALL_BIT + 430;
+pub const SYS_fsconfig: ::c_long = __X32_SYSCALL_BIT + 431;
+pub const SYS_fsmount: ::c_long = __X32_SYSCALL_BIT + 432;
+pub const SYS_fspick: ::c_long = __X32_SYSCALL_BIT + 433;
+pub const SYS_pidfd_open: ::c_long = __X32_SYSCALL_BIT + 434;
+pub const SYS_clone3: ::c_long = __X32_SYSCALL_BIT + 435;
+pub const SYS_close_range: ::c_long = __X32_SYSCALL_BIT + 436;
+pub const SYS_openat2: ::c_long = __X32_SYSCALL_BIT + 437;
+pub const SYS_pidfd_getfd: ::c_long = __X32_SYSCALL_BIT + 438;
+pub const SYS_faccessat2: ::c_long = __X32_SYSCALL_BIT + 439;
+pub const SYS_process_madvise: ::c_long = __X32_SYSCALL_BIT + 440;
+pub const SYS_epoll_pwait2: ::c_long = __X32_SYSCALL_BIT + 441;
+pub const SYS_mount_setattr: ::c_long = __X32_SYSCALL_BIT + 442;
+pub const SYS_quotactl_fd: ::c_long = __X32_SYSCALL_BIT + 443;
+pub const SYS_landlock_create_ruleset: ::c_long = __X32_SYSCALL_BIT + 444;
+pub const SYS_landlock_add_rule: ::c_long = __X32_SYSCALL_BIT + 445;
+pub const SYS_landlock_restrict_self: ::c_long = __X32_SYSCALL_BIT + 446;
+pub const SYS_memfd_secret: ::c_long = __X32_SYSCALL_BIT + 447;
+pub const SYS_process_mrelease: ::c_long = __X32_SYSCALL_BIT + 448;
+pub const SYS_futex_waitv: ::c_long = __X32_SYSCALL_BIT + 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = __X32_SYSCALL_BIT + 450;
+pub const SYS_rt_sigaction: ::c_long = __X32_SYSCALL_BIT + 512;
+pub const SYS_rt_sigreturn: ::c_long = __X32_SYSCALL_BIT + 513;
+pub const SYS_ioctl: ::c_long = __X32_SYSCALL_BIT + 514;
+pub const SYS_readv: ::c_long = __X32_SYSCALL_BIT + 515;
+pub const SYS_writev: ::c_long = __X32_SYSCALL_BIT + 516;
+pub const SYS_recvfrom: ::c_long = __X32_SYSCALL_BIT + 517;
+pub const SYS_sendmsg: ::c_long = __X32_SYSCALL_BIT + 518;
+pub const SYS_recvmsg: ::c_long = __X32_SYSCALL_BIT + 519;
+pub const SYS_execve: ::c_long = __X32_SYSCALL_BIT + 520;
+pub const SYS_ptrace: ::c_long = __X32_SYSCALL_BIT + 521;
+pub const SYS_rt_sigpending: ::c_long = __X32_SYSCALL_BIT + 522;
+pub const SYS_rt_sigtimedwait: ::c_long = __X32_SYSCALL_BIT + 523;
+pub const SYS_rt_sigqueueinfo: ::c_long = __X32_SYSCALL_BIT + 524;
+pub const SYS_sigaltstack: ::c_long = __X32_SYSCALL_BIT + 525;
+pub const SYS_timer_create: ::c_long = __X32_SYSCALL_BIT + 526;
+pub const SYS_mq_notify: ::c_long = __X32_SYSCALL_BIT + 527;
+pub const SYS_kexec_load: ::c_long = __X32_SYSCALL_BIT + 528;
+pub const SYS_waitid: ::c_long = __X32_SYSCALL_BIT + 529;
+pub const SYS_set_robust_list: ::c_long = __X32_SYSCALL_BIT + 530;
+pub const SYS_get_robust_list: ::c_long = __X32_SYSCALL_BIT + 531;
+pub const SYS_vmsplice: ::c_long = __X32_SYSCALL_BIT + 532;
+pub const SYS_move_pages: ::c_long = __X32_SYSCALL_BIT + 533;
+pub const SYS_preadv: ::c_long = __X32_SYSCALL_BIT + 534;
+pub const SYS_pwritev: ::c_long = __X32_SYSCALL_BIT + 535;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = __X32_SYSCALL_BIT + 536;
+pub const SYS_recvmmsg: ::c_long = __X32_SYSCALL_BIT + 537;
+pub const SYS_sendmmsg: ::c_long = __X32_SYSCALL_BIT + 538;
+pub const SYS_process_vm_readv: ::c_long = __X32_SYSCALL_BIT + 539;
+pub const SYS_process_vm_writev: ::c_long = __X32_SYSCALL_BIT + 540;
+pub const SYS_setsockopt: ::c_long = __X32_SYSCALL_BIT + 541;
+pub const SYS_getsockopt: ::c_long = __X32_SYSCALL_BIT + 542;
+pub const SYS_io_setup: ::c_long = __X32_SYSCALL_BIT + 543;
+pub const SYS_io_submit: ::c_long = __X32_SYSCALL_BIT + 544;
+pub const SYS_execveat: ::c_long = __X32_SYSCALL_BIT + 545;
+pub const SYS_preadv2: ::c_long = __X32_SYSCALL_BIT + 546;
+pub const SYS_pwritev2: ::c_long = __X32_SYSCALL_BIT + 547;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1578 @@
+pub type pthread_t = c_ulong;
+pub type __priority_which_t = ::c_uint;
+pub type __rlimit_resource_t = ::c_uint;
+pub type Lmid_t = ::c_long;
+pub type regoff_t = ::c_int;
+pub type __kernel_rwf_t = ::c_int;
+
+cfg_if! {
+    if #[cfg(doc)] {
+        // Used in `linux::arch` to define ioctl constants.
+        pub(crate) type Ioctl = ::c_ulong;
+    } else {
+        #[doc(hidden)]
+        pub type Ioctl = ::c_ulong;
+    }
+}
+
+s! {
+    pub struct statx {
+        pub stx_mask: u32,
+        pub stx_blksize: u32,
+        pub stx_attributes: u64,
+        pub stx_nlink: u32,
+        pub stx_uid: u32,
+        pub stx_gid: u32,
+        pub stx_mode: u16,
+        __statx_pad1: [u16; 1],
+        pub stx_ino: u64,
+        pub stx_size: u64,
+        pub stx_blocks: u64,
+        pub stx_attributes_mask: u64,
+        pub stx_atime: ::statx_timestamp,
+        pub stx_btime: ::statx_timestamp,
+        pub stx_ctime: ::statx_timestamp,
+        pub stx_mtime: ::statx_timestamp,
+        pub stx_rdev_major: u32,
+        pub stx_rdev_minor: u32,
+        pub stx_dev_major: u32,
+        pub stx_dev_minor: u32,
+        pub stx_mnt_id: u64,
+        pub stx_dio_mem_align: u32,
+        pub stx_dio_offset_align: u32,
+        __statx_pad3: [u64; 12],
+    }
+
+    pub struct statx_timestamp {
+        pub tv_sec: i64,
+        pub tv_nsec: u32,
+        pub __statx_timestamp_pad1: [i32; 1],
+    }
+
+    pub struct aiocb {
+        pub aio_fildes: ::c_int,
+        pub aio_lio_opcode: ::c_int,
+        pub aio_reqprio: ::c_int,
+        pub aio_buf: *mut ::c_void,
+        pub aio_nbytes: ::size_t,
+        pub aio_sigevent: ::sigevent,
+        __next_prio: *mut aiocb,
+        __abs_prio: ::c_int,
+        __policy: ::c_int,
+        __error_code: ::c_int,
+        __return_value: ::ssize_t,
+        pub aio_offset: off_t,
+        #[cfg(all(not(target_arch = "x86_64"), target_pointer_width = "32"))]
+        __unused1: [::c_char; 4],
+        __glibc_reserved: [::c_char; 32]
+    }
+
+    pub struct __exit_status {
+        pub e_termination: ::c_short,
+        pub e_exit: ::c_short,
+    }
+
+    pub struct __timeval {
+        pub tv_sec: i32,
+        pub tv_usec: i32,
+    }
+
+    pub struct glob64_t {
+        pub gl_pathc: ::size_t,
+        pub gl_pathv: *mut *mut ::c_char,
+        pub gl_offs: ::size_t,
+        pub gl_flags: ::c_int,
+
+        __unused1: *mut ::c_void,
+        __unused2: *mut ::c_void,
+        __unused3: *mut ::c_void,
+        __unused4: *mut ::c_void,
+        __unused5: *mut ::c_void,
+    }
+
+    pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: ::socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::size_t,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: ::size_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct cmsghdr {
+        pub cmsg_len: ::size_t,
+        pub cmsg_level: ::c_int,
+        pub cmsg_type: ::c_int,
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::NCCS],
+        #[cfg(not(any(
+            target_arch = "sparc",
+            target_arch = "sparc64",
+            target_arch = "mips",
+            target_arch = "mips32r6",
+            target_arch = "mips64",
+            target_arch = "mips64r6")))]
+        pub c_ispeed: ::speed_t,
+        #[cfg(not(any(
+            target_arch = "sparc",
+            target_arch = "sparc64",
+            target_arch = "mips",
+            target_arch = "mips32r6",
+            target_arch = "mips64",
+            target_arch = "mips64r6")))]
+        pub c_ospeed: ::speed_t,
+    }
+
+    pub struct mallinfo {
+        pub arena: ::c_int,
+        pub ordblks: ::c_int,
+        pub smblks: ::c_int,
+        pub hblks: ::c_int,
+        pub hblkhd: ::c_int,
+        pub usmblks: ::c_int,
+        pub fsmblks: ::c_int,
+        pub uordblks: ::c_int,
+        pub fordblks: ::c_int,
+        pub keepcost: ::c_int,
+    }
+
+    pub struct mallinfo2 {
+        pub arena: ::size_t,
+        pub ordblks: ::size_t,
+        pub smblks: ::size_t,
+        pub hblks: ::size_t,
+        pub hblkhd: ::size_t,
+        pub usmblks: ::size_t,
+        pub fsmblks: ::size_t,
+        pub uordblks: ::size_t,
+        pub fordblks: ::size_t,
+        pub keepcost: ::size_t,
+    }
+
+    pub struct nl_pktinfo {
+        pub group: u32,
+    }
+
+    pub struct nl_mmap_req {
+        pub nm_block_size: ::c_uint,
+        pub nm_block_nr: ::c_uint,
+        pub nm_frame_size: ::c_uint,
+        pub nm_frame_nr: ::c_uint,
+    }
+
+    pub struct nl_mmap_hdr {
+        pub nm_status: ::c_uint,
+        pub nm_len: ::c_uint,
+        pub nm_group: u32,
+        pub nm_pid: u32,
+        pub nm_uid: u32,
+        pub nm_gid: u32,
+    }
+
+    pub struct rtentry {
+        pub rt_pad1: ::c_ulong,
+        pub rt_dst: ::sockaddr,
+        pub rt_gateway: ::sockaddr,
+        pub rt_genmask: ::sockaddr,
+        pub rt_flags: ::c_ushort,
+        pub rt_pad2: ::c_short,
+        pub rt_pad3: ::c_ulong,
+        pub rt_tos: ::c_uchar,
+        pub rt_class: ::c_uchar,
+        #[cfg(target_pointer_width = "64")]
+        pub rt_pad4: [::c_short; 3usize],
+        #[cfg(not(target_pointer_width = "64"))]
+        pub rt_pad4: ::c_short,
+        pub rt_metric: ::c_short,
+        pub rt_dev: *mut ::c_char,
+        pub rt_mtu: ::c_ulong,
+        pub rt_window: ::c_ulong,
+        pub rt_irtt: ::c_ushort,
+    }
+
+    pub struct timex {
+        pub modes: ::c_uint,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub offset: i64,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub offset: ::c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub freq: i64,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub freq: ::c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub maxerror: i64,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub maxerror: ::c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub esterror: i64,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub esterror: ::c_long,
+        pub status: ::c_int,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub constant: i64,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub constant: ::c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub precision: i64,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub precision: ::c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub tolerance: i64,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub tolerance: ::c_long,
+        pub time: ::timeval,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub tick: i64,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub tick: ::c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub ppsfreq: i64,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub ppsfreq: ::c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub jitter: i64,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub jitter: ::c_long,
+        pub shift: ::c_int,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub stabil: i64,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub stabil: ::c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub jitcnt: i64,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub jitcnt: ::c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub calcnt: i64,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub calcnt: ::c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub errcnt: i64,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub errcnt: ::c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub stbcnt: i64,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub stbcnt: ::c_long,
+        pub tai: ::c_int,
+        pub __unused1: i32,
+        pub __unused2: i32,
+        pub __unused3: i32,
+        pub __unused4: i32,
+        pub __unused5: i32,
+        pub __unused6: i32,
+        pub __unused7: i32,
+        pub __unused8: i32,
+        pub __unused9: i32,
+        pub __unused10: i32,
+        pub __unused11: i32,
+    }
+
+    pub struct ntptimeval {
+        pub time: ::timeval,
+        pub maxerror: ::c_long,
+        pub esterror: ::c_long,
+        pub tai: ::c_long,
+        pub __glibc_reserved1: ::c_long,
+        pub __glibc_reserved2: ::c_long,
+        pub __glibc_reserved3: ::c_long,
+        pub __glibc_reserved4: ::c_long,
+    }
+
+    pub struct regex_t {
+        __buffer: *mut ::c_void,
+        __allocated: ::size_t,
+        __used: ::size_t,
+        __syntax: ::c_ulong,
+        __fastmap: *mut ::c_char,
+        __translate: *mut ::c_char,
+        __re_nsub: ::size_t,
+        __bitfield: u8,
+    }
+
+    pub struct Elf64_Chdr {
+        pub ch_type: ::Elf64_Word,
+        pub ch_reserved: ::Elf64_Word,
+        pub ch_size: ::Elf64_Xword,
+        pub ch_addralign: ::Elf64_Xword,
+    }
+
+    pub struct Elf32_Chdr {
+        pub ch_type: ::Elf32_Word,
+        pub ch_size: ::Elf32_Word,
+        pub ch_addralign: ::Elf32_Word,
+    }
+
+    pub struct seminfo {
+        pub semmap: ::c_int,
+        pub semmni: ::c_int,
+        pub semmns: ::c_int,
+        pub semmnu: ::c_int,
+        pub semmsl: ::c_int,
+        pub semopm: ::c_int,
+        pub semume: ::c_int,
+        pub semusz: ::c_int,
+        pub semvmx: ::c_int,
+        pub semaem: ::c_int,
+    }
+
+    pub struct ptrace_peeksiginfo_args {
+        pub off: ::__u64,
+        pub flags: ::__u32,
+        pub nr: ::__s32,
+    }
+
+    pub struct __c_anonymous_ptrace_syscall_info_entry {
+        pub nr: ::__u64,
+        pub args: [::__u64; 6],
+    }
+
+    pub struct __c_anonymous_ptrace_syscall_info_exit {
+        pub sval: ::__s64,
+        pub is_error: ::__u8,
+    }
+
+    pub struct __c_anonymous_ptrace_syscall_info_seccomp {
+        pub nr: ::__u64,
+        pub args: [::__u64; 6],
+        pub ret_data: ::__u32,
+    }
+
+    pub struct ptrace_syscall_info {
+        pub op: ::__u8,
+        pub pad: [::__u8; 3],
+        pub arch: ::__u32,
+        pub instruction_pointer: ::__u64,
+        pub stack_pointer: ::__u64,
+        #[cfg(libc_union)]
+        pub u: __c_anonymous_ptrace_syscall_info_data,
+    }
+
+    // linux/if_xdp.h
+
+    pub struct sockaddr_xdp {
+        pub sxdp_family: ::__u16,
+        pub sxdp_flags: ::__u16,
+        pub sxdp_ifindex: ::__u32,
+        pub sxdp_queue_id: ::__u32,
+        pub sxdp_shared_umem_fd: ::__u32,
+    }
+
+    pub struct xdp_ring_offset {
+        pub producer: ::__u64,
+        pub consumer: ::__u64,
+        pub desc: ::__u64,
+        pub flags: ::__u64,
+    }
+
+    pub struct xdp_mmap_offsets {
+        pub rx: xdp_ring_offset,
+        pub tx: xdp_ring_offset,
+        pub fr: xdp_ring_offset,
+        pub cr: xdp_ring_offset,
+    }
+
+    pub struct xdp_ring_offset_v1 {
+        pub producer: ::__u64,
+        pub consumer: ::__u64,
+        pub desc: ::__u64,
+    }
+
+    pub struct xdp_mmap_offsets_v1 {
+        pub rx: xdp_ring_offset_v1,
+        pub tx: xdp_ring_offset_v1,
+        pub fr: xdp_ring_offset_v1,
+        pub cr: xdp_ring_offset_v1,
+    }
+
+    pub struct xdp_umem_reg {
+        pub addr: ::__u64,
+        pub len: ::__u64,
+        pub chunk_size: ::__u32,
+        pub headroom: ::__u32,
+        pub flags: ::__u32,
+    }
+
+    pub struct xdp_umem_reg_v1 {
+        pub addr: ::__u64,
+        pub len: ::__u64,
+        pub chunk_size: ::__u32,
+        pub headroom: ::__u32,
+    }
+
+    pub struct xdp_statistics {
+        pub rx_dropped: ::__u64,
+        pub rx_invalid_descs: ::__u64,
+        pub tx_invalid_descs: ::__u64,
+        pub rx_ring_full: ::__u64,
+        pub rx_fill_ring_empty_descs: ::__u64,
+        pub tx_ring_empty_descs: ::__u64,
+    }
+
+    pub struct xdp_statistics_v1 {
+        pub rx_dropped: ::__u64,
+        pub rx_invalid_descs: ::__u64,
+        pub tx_invalid_descs: ::__u64,
+    }
+
+    pub struct xdp_options {
+        pub flags: ::__u32,
+    }
+
+    pub struct xdp_desc {
+        pub addr: ::__u64,
+        pub len: ::__u32,
+        pub options: ::__u32,
+    }
+
+    pub struct iocb {
+        pub aio_data: ::__u64,
+        #[cfg(target_endian = "little")]
+        pub aio_key: ::__u32,
+        #[cfg(target_endian = "little")]
+        pub aio_rw_flags: ::__kernel_rwf_t,
+        #[cfg(target_endian = "big")]
+        pub aio_rw_flags: ::__kernel_rwf_t,
+        #[cfg(target_endian = "big")]
+        pub aio_key: ::__u32,
+        pub aio_lio_opcode: ::__u16,
+        pub aio_reqprio: ::__s16,
+        pub aio_fildes: ::__u32,
+        pub aio_buf: ::__u64,
+        pub aio_nbytes: ::__u64,
+        pub aio_offset: ::__s64,
+        aio_reserved2: ::__u64,
+        pub aio_flags: ::__u32,
+        pub aio_resfd: ::__u32,
+    }
+}
+
+impl siginfo_t {
+    pub unsafe fn si_addr(&self) -> *mut ::c_void {
+        #[repr(C)]
+        struct siginfo_sigfault {
+            _si_signo: ::c_int,
+            _si_errno: ::c_int,
+            _si_code: ::c_int,
+            si_addr: *mut ::c_void,
+        }
+        (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr
+    }
+
+    pub unsafe fn si_value(&self) -> ::sigval {
+        #[repr(C)]
+        struct siginfo_timer {
+            _si_signo: ::c_int,
+            _si_errno: ::c_int,
+            _si_code: ::c_int,
+            _si_tid: ::c_int,
+            _si_overrun: ::c_int,
+            si_sigval: ::sigval,
+        }
+        (*(self as *const siginfo_t as *const siginfo_timer)).si_sigval
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        // Internal, for casts to access union fields
+        #[repr(C)]
+        struct sifields_sigchld {
+            si_pid: ::pid_t,
+            si_uid: ::uid_t,
+            si_status: ::c_int,
+            si_utime: ::c_long,
+            si_stime: ::c_long,
+        }
+        impl ::Copy for sifields_sigchld {}
+        impl ::Clone for sifields_sigchld {
+            fn clone(&self) -> sifields_sigchld {
+                *self
+            }
+        }
+
+        // Internal, for casts to access union fields
+        #[repr(C)]
+        union sifields {
+            _align_pointer: *mut ::c_void,
+            sigchld: sifields_sigchld,
+        }
+
+        // Internal, for casts to access union fields. Note that some variants
+        // of sifields start with a pointer, which makes the alignment of
+        // sifields vary on 32-bit and 64-bit architectures.
+        #[repr(C)]
+        struct siginfo_f {
+            _siginfo_base: [::c_int; 3],
+            sifields: sifields,
+        }
+
+        impl siginfo_t {
+            unsafe fn sifields(&self) -> &sifields {
+                &(*(self as *const siginfo_t as *const siginfo_f)).sifields
+            }
+
+            pub unsafe fn si_pid(&self) -> ::pid_t {
+                self.sifields().sigchld.si_pid
+            }
+
+            pub unsafe fn si_uid(&self) -> ::uid_t {
+                self.sifields().sigchld.si_uid
+            }
+
+            pub unsafe fn si_status(&self) -> ::c_int {
+                self.sifields().sigchld.si_status
+            }
+
+            pub unsafe fn si_utime(&self) -> ::c_long {
+                self.sifields().sigchld.si_utime
+            }
+
+            pub unsafe fn si_stime(&self) -> ::c_long {
+                self.sifields().sigchld.si_stime
+            }
+        }
+
+        pub union __c_anonymous_ptrace_syscall_info_data {
+            pub entry: __c_anonymous_ptrace_syscall_info_entry,
+            pub exit: __c_anonymous_ptrace_syscall_info_exit,
+            pub seccomp: __c_anonymous_ptrace_syscall_info_seccomp,
+        }
+        impl ::Copy for __c_anonymous_ptrace_syscall_info_data {}
+        impl ::Clone for __c_anonymous_ptrace_syscall_info_data {
+            fn clone(&self) -> __c_anonymous_ptrace_syscall_info_data {
+                *self
+            }
+        }
+    }
+}
+
+s_no_extra_traits! {
+    pub struct utmpx {
+        pub ut_type: ::c_short,
+        pub ut_pid: ::pid_t,
+        pub ut_line: [::c_char; __UT_LINESIZE],
+        pub ut_id: [::c_char; 4],
+
+        pub ut_user: [::c_char; __UT_NAMESIZE],
+        pub ut_host: [::c_char; __UT_HOSTSIZE],
+        pub ut_exit: __exit_status,
+
+        #[cfg(any(target_arch = "aarch64",
+                  target_arch = "s390x",
+                  target_arch = "loongarch64",
+                  all(target_pointer_width = "32",
+                      not(target_arch = "x86_64"))))]
+        pub ut_session: ::c_long,
+        #[cfg(any(target_arch = "aarch64",
+                  target_arch = "s390x",
+                  target_arch = "loongarch64",
+                  all(target_pointer_width = "32",
+                      not(target_arch = "x86_64"))))]
+        pub ut_tv: ::timeval,
+
+        #[cfg(not(any(target_arch = "aarch64",
+                      target_arch = "s390x",
+                      target_arch = "loongarch64",
+                      all(target_pointer_width = "32",
+                          not(target_arch = "x86_64")))))]
+        pub ut_session: i32,
+        #[cfg(not(any(target_arch = "aarch64",
+                      target_arch = "s390x",
+                      target_arch = "loongarch64",
+                      all(target_pointer_width = "32",
+                          not(target_arch = "x86_64")))))]
+        pub ut_tv: __timeval,
+
+        pub ut_addr_v6: [i32; 4],
+        __glibc_reserved: [::c_char; 20],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for utmpx {
+            fn eq(&self, other: &utmpx) -> bool {
+                self.ut_type == other.ut_type
+                    && self.ut_pid == other.ut_pid
+                    && self.ut_line == other.ut_line
+                    && self.ut_id == other.ut_id
+                    && self.ut_user == other.ut_user
+                    && self
+                    .ut_host
+                    .iter()
+                    .zip(other.ut_host.iter())
+                    .all(|(a,b)| a == b)
+                    && self.ut_exit == other.ut_exit
+                    && self.ut_session == other.ut_session
+                    && self.ut_tv == other.ut_tv
+                    && self.ut_addr_v6 == other.ut_addr_v6
+                    && self.__glibc_reserved == other.__glibc_reserved
+            }
+        }
+
+        impl Eq for utmpx {}
+
+        impl ::fmt::Debug for utmpx {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("utmpx")
+                    .field("ut_type", &self.ut_type)
+                    .field("ut_pid", &self.ut_pid)
+                    .field("ut_line", &self.ut_line)
+                    .field("ut_id", &self.ut_id)
+                    .field("ut_user", &self.ut_user)
+                // FIXME: .field("ut_host", &self.ut_host)
+                    .field("ut_exit", &self.ut_exit)
+                    .field("ut_session", &self.ut_session)
+                    .field("ut_tv", &self.ut_tv)
+                    .field("ut_addr_v6", &self.ut_addr_v6)
+                    .field("__glibc_reserved", &self.__glibc_reserved)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for utmpx {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ut_type.hash(state);
+                self.ut_pid.hash(state);
+                self.ut_line.hash(state);
+                self.ut_id.hash(state);
+                self.ut_user.hash(state);
+                self.ut_host.hash(state);
+                self.ut_exit.hash(state);
+                self.ut_session.hash(state);
+                self.ut_tv.hash(state);
+                self.ut_addr_v6.hash(state);
+                self.__glibc_reserved.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl PartialEq for __c_anonymous_ptrace_syscall_info_data {
+            fn eq(&self, other: &__c_anonymous_ptrace_syscall_info_data) -> bool {
+                unsafe {
+                self.entry == other.entry ||
+                    self.exit == other.exit ||
+                    self.seccomp == other.seccomp
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_ptrace_syscall_info_data {}
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ptrace_syscall_info_data {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                f.debug_struct("__c_anonymous_ptrace_syscall_info_data")
+                    .field("entry", &self.entry)
+                    .field("exit", &self.exit)
+                    .field("seccomp", &self.seccomp)
+                    .finish()
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_ptrace_syscall_info_data {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                self.entry.hash(state);
+                self.exit.hash(state);
+                self.seccomp.hash(state);
+                }
+            }
+        }
+    }
+}
+
+// include/uapi/asm-generic/hugetlb_encode.h
+pub const HUGETLB_FLAG_ENCODE_SHIFT: ::c_int = 26;
+pub const HUGETLB_FLAG_ENCODE_MASK: ::c_int = 0x3f;
+
+pub const HUGETLB_FLAG_ENCODE_64KB: ::c_int = 16 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_512KB: ::c_int = 19 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_1MB: ::c_int = 20 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_2MB: ::c_int = 21 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_8MB: ::c_int = 23 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_16MB: ::c_int = 24 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_32MB: ::c_int = 25 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_256MB: ::c_int = 28 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_512MB: ::c_int = 29 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_1GB: ::c_int = 30 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_2GB: ::c_int = 31 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_16GB: ::c_int = 34 << HUGETLB_FLAG_ENCODE_SHIFT;
+
+// include/uapi/linux/mman.h
+/*
+ * Huge page size encoding when MAP_HUGETLB is specified, and a huge page
+ * size other than the default is desired.  See hugetlb_encode.h.
+ * All known huge page size encodings are provided here.  It is the
+ * responsibility of the application to know which sizes are supported on
+ * the running system.  See mmap(2) man page for details.
+ */
+pub const MAP_HUGE_SHIFT: ::c_int = HUGETLB_FLAG_ENCODE_SHIFT;
+pub const MAP_HUGE_MASK: ::c_int = HUGETLB_FLAG_ENCODE_MASK;
+
+pub const MAP_HUGE_64KB: ::c_int = HUGETLB_FLAG_ENCODE_64KB;
+pub const MAP_HUGE_512KB: ::c_int = HUGETLB_FLAG_ENCODE_512KB;
+pub const MAP_HUGE_1MB: ::c_int = HUGETLB_FLAG_ENCODE_1MB;
+pub const MAP_HUGE_2MB: ::c_int = HUGETLB_FLAG_ENCODE_2MB;
+pub const MAP_HUGE_8MB: ::c_int = HUGETLB_FLAG_ENCODE_8MB;
+pub const MAP_HUGE_16MB: ::c_int = HUGETLB_FLAG_ENCODE_16MB;
+pub const MAP_HUGE_32MB: ::c_int = HUGETLB_FLAG_ENCODE_32MB;
+pub const MAP_HUGE_256MB: ::c_int = HUGETLB_FLAG_ENCODE_256MB;
+pub const MAP_HUGE_512MB: ::c_int = HUGETLB_FLAG_ENCODE_512MB;
+pub const MAP_HUGE_1GB: ::c_int = HUGETLB_FLAG_ENCODE_1GB;
+pub const MAP_HUGE_2GB: ::c_int = HUGETLB_FLAG_ENCODE_2GB;
+pub const MAP_HUGE_16GB: ::c_int = HUGETLB_FLAG_ENCODE_16GB;
+
+pub const PRIO_PROCESS: ::__priority_which_t = 0;
+pub const PRIO_PGRP: ::__priority_which_t = 1;
+pub const PRIO_USER: ::__priority_which_t = 2;
+
+pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
+
+pub const __UT_LINESIZE: usize = 32;
+pub const __UT_NAMESIZE: usize = 32;
+pub const __UT_HOSTSIZE: usize = 256;
+pub const EMPTY: ::c_short = 0;
+pub const RUN_LVL: ::c_short = 1;
+pub const BOOT_TIME: ::c_short = 2;
+pub const NEW_TIME: ::c_short = 3;
+pub const OLD_TIME: ::c_short = 4;
+pub const INIT_PROCESS: ::c_short = 5;
+pub const LOGIN_PROCESS: ::c_short = 6;
+pub const USER_PROCESS: ::c_short = 7;
+pub const DEAD_PROCESS: ::c_short = 8;
+pub const ACCOUNTING: ::c_short = 9;
+
+// dlfcn.h
+pub const LM_ID_BASE: ::c_long = 0;
+pub const LM_ID_NEWLM: ::c_long = -1;
+
+pub const RTLD_DI_LMID: ::c_int = 1;
+pub const RTLD_DI_LINKMAP: ::c_int = 2;
+pub const RTLD_DI_CONFIGADDR: ::c_int = 3;
+pub const RTLD_DI_SERINFO: ::c_int = 4;
+pub const RTLD_DI_SERINFOSIZE: ::c_int = 5;
+pub const RTLD_DI_ORIGIN: ::c_int = 6;
+pub const RTLD_DI_PROFILENAME: ::c_int = 7;
+pub const RTLD_DI_PROFILEOUT: ::c_int = 8;
+pub const RTLD_DI_TLS_MODID: ::c_int = 9;
+pub const RTLD_DI_TLS_DATA: ::c_int = 10;
+
+pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK;
+pub const PIDFD_NONBLOCK: ::c_uint = O_NONBLOCK as ::c_uint;
+
+pub const SOL_RXRPC: ::c_int = 272;
+pub const SOL_PPPOL2TP: ::c_int = 273;
+pub const SOL_PNPIPE: ::c_int = 275;
+pub const SOL_RDS: ::c_int = 276;
+pub const SOL_IUCV: ::c_int = 277;
+pub const SOL_CAIF: ::c_int = 278;
+pub const SOL_NFC: ::c_int = 280;
+pub const SOL_XDP: ::c_int = 283;
+
+pub const MSG_TRYHARD: ::c_int = 4;
+
+pub const LC_PAPER: ::c_int = 7;
+pub const LC_NAME: ::c_int = 8;
+pub const LC_ADDRESS: ::c_int = 9;
+pub const LC_TELEPHONE: ::c_int = 10;
+pub const LC_MEASUREMENT: ::c_int = 11;
+pub const LC_IDENTIFICATION: ::c_int = 12;
+pub const LC_PAPER_MASK: ::c_int = 1 << LC_PAPER;
+pub const LC_NAME_MASK: ::c_int = 1 << LC_NAME;
+pub const LC_ADDRESS_MASK: ::c_int = 1 << LC_ADDRESS;
+pub const LC_TELEPHONE_MASK: ::c_int = 1 << LC_TELEPHONE;
+pub const LC_MEASUREMENT_MASK: ::c_int = 1 << LC_MEASUREMENT;
+pub const LC_IDENTIFICATION_MASK: ::c_int = 1 << LC_IDENTIFICATION;
+pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK
+    | ::LC_NUMERIC_MASK
+    | ::LC_TIME_MASK
+    | ::LC_COLLATE_MASK
+    | ::LC_MONETARY_MASK
+    | ::LC_MESSAGES_MASK
+    | LC_PAPER_MASK
+    | LC_NAME_MASK
+    | LC_ADDRESS_MASK
+    | LC_TELEPHONE_MASK
+    | LC_MEASUREMENT_MASK
+    | LC_IDENTIFICATION_MASK;
+
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+
+pub const SOCK_SEQPACKET: ::c_int = 5;
+pub const SOCK_DCCP: ::c_int = 6;
+pub const SOCK_PACKET: ::c_int = 10;
+
+pub const AF_IB: ::c_int = 27;
+pub const AF_MPLS: ::c_int = 28;
+pub const AF_NFC: ::c_int = 39;
+pub const AF_VSOCK: ::c_int = 40;
+pub const AF_XDP: ::c_int = 44;
+pub const PF_IB: ::c_int = AF_IB;
+pub const PF_MPLS: ::c_int = AF_MPLS;
+pub const PF_NFC: ::c_int = AF_NFC;
+pub const PF_VSOCK: ::c_int = AF_VSOCK;
+pub const PF_XDP: ::c_int = AF_XDP;
+
+pub const SIGEV_THREAD_ID: ::c_int = 4;
+
+pub const BUFSIZ: ::c_uint = 8192;
+pub const TMP_MAX: ::c_uint = 238328;
+pub const FOPEN_MAX: ::c_uint = 16;
+pub const FILENAME_MAX: ::c_uint = 4096;
+pub const POSIX_MADV_DONTNEED: ::c_int = 4;
+pub const _SC_EQUIV_CLASS_MAX: ::c_int = 41;
+pub const _SC_CHARCLASS_NAME_MAX: ::c_int = 45;
+pub const _SC_PII: ::c_int = 53;
+pub const _SC_PII_XTI: ::c_int = 54;
+pub const _SC_PII_SOCKET: ::c_int = 55;
+pub const _SC_PII_INTERNET: ::c_int = 56;
+pub const _SC_PII_OSI: ::c_int = 57;
+pub const _SC_POLL: ::c_int = 58;
+pub const _SC_SELECT: ::c_int = 59;
+pub const _SC_PII_INTERNET_STREAM: ::c_int = 61;
+pub const _SC_PII_INTERNET_DGRAM: ::c_int = 62;
+pub const _SC_PII_OSI_COTS: ::c_int = 63;
+pub const _SC_PII_OSI_CLTS: ::c_int = 64;
+pub const _SC_PII_OSI_M: ::c_int = 65;
+pub const _SC_T_IOV_MAX: ::c_int = 66;
+pub const _SC_2_C_VERSION: ::c_int = 96;
+pub const _SC_CHAR_BIT: ::c_int = 101;
+pub const _SC_CHAR_MAX: ::c_int = 102;
+pub const _SC_CHAR_MIN: ::c_int = 103;
+pub const _SC_INT_MAX: ::c_int = 104;
+pub const _SC_INT_MIN: ::c_int = 105;
+pub const _SC_LONG_BIT: ::c_int = 106;
+pub const _SC_WORD_BIT: ::c_int = 107;
+pub const _SC_MB_LEN_MAX: ::c_int = 108;
+pub const _SC_SSIZE_MAX: ::c_int = 110;
+pub const _SC_SCHAR_MAX: ::c_int = 111;
+pub const _SC_SCHAR_MIN: ::c_int = 112;
+pub const _SC_SHRT_MAX: ::c_int = 113;
+pub const _SC_SHRT_MIN: ::c_int = 114;
+pub const _SC_UCHAR_MAX: ::c_int = 115;
+pub const _SC_UINT_MAX: ::c_int = 116;
+pub const _SC_ULONG_MAX: ::c_int = 117;
+pub const _SC_USHRT_MAX: ::c_int = 118;
+pub const _SC_NL_ARGMAX: ::c_int = 119;
+pub const _SC_NL_LANGMAX: ::c_int = 120;
+pub const _SC_NL_MSGMAX: ::c_int = 121;
+pub const _SC_NL_NMAX: ::c_int = 122;
+pub const _SC_NL_SETMAX: ::c_int = 123;
+pub const _SC_NL_TEXTMAX: ::c_int = 124;
+pub const _SC_BASE: ::c_int = 134;
+pub const _SC_C_LANG_SUPPORT: ::c_int = 135;
+pub const _SC_C_LANG_SUPPORT_R: ::c_int = 136;
+pub const _SC_DEVICE_IO: ::c_int = 140;
+pub const _SC_DEVICE_SPECIFIC: ::c_int = 141;
+pub const _SC_DEVICE_SPECIFIC_R: ::c_int = 142;
+pub const _SC_FD_MGMT: ::c_int = 143;
+pub const _SC_FIFO: ::c_int = 144;
+pub const _SC_PIPE: ::c_int = 145;
+pub const _SC_FILE_ATTRIBUTES: ::c_int = 146;
+pub const _SC_FILE_LOCKING: ::c_int = 147;
+pub const _SC_FILE_SYSTEM: ::c_int = 148;
+pub const _SC_MULTI_PROCESS: ::c_int = 150;
+pub const _SC_SINGLE_PROCESS: ::c_int = 151;
+pub const _SC_NETWORKING: ::c_int = 152;
+pub const _SC_REGEX_VERSION: ::c_int = 156;
+pub const _SC_SIGNALS: ::c_int = 158;
+pub const _SC_SYSTEM_DATABASE: ::c_int = 162;
+pub const _SC_SYSTEM_DATABASE_R: ::c_int = 163;
+pub const _SC_USER_GROUPS: ::c_int = 166;
+pub const _SC_USER_GROUPS_R: ::c_int = 167;
+pub const _SC_LEVEL1_ICACHE_SIZE: ::c_int = 185;
+pub const _SC_LEVEL1_ICACHE_ASSOC: ::c_int = 186;
+pub const _SC_LEVEL1_ICACHE_LINESIZE: ::c_int = 187;
+pub const _SC_LEVEL1_DCACHE_SIZE: ::c_int = 188;
+pub const _SC_LEVEL1_DCACHE_ASSOC: ::c_int = 189;
+pub const _SC_LEVEL1_DCACHE_LINESIZE: ::c_int = 190;
+pub const _SC_LEVEL2_CACHE_SIZE: ::c_int = 191;
+pub const _SC_LEVEL2_CACHE_ASSOC: ::c_int = 192;
+pub const _SC_LEVEL2_CACHE_LINESIZE: ::c_int = 193;
+pub const _SC_LEVEL3_CACHE_SIZE: ::c_int = 194;
+pub const _SC_LEVEL3_CACHE_ASSOC: ::c_int = 195;
+pub const _SC_LEVEL3_CACHE_LINESIZE: ::c_int = 196;
+pub const _SC_LEVEL4_CACHE_SIZE: ::c_int = 197;
+pub const _SC_LEVEL4_CACHE_ASSOC: ::c_int = 198;
+pub const _SC_LEVEL4_CACHE_LINESIZE: ::c_int = 199;
+pub const O_ACCMODE: ::c_int = 3;
+pub const ST_RELATIME: ::c_ulong = 4096;
+pub const NI_MAXHOST: ::socklen_t = 1025;
+
+// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the
+// following are only available on newer Linux versions than the versions
+// currently used in CI in some configurations, so we define them here.
+cfg_if! {
+    if #[cfg(not(target_arch = "s390x"))] {
+        pub const BINDERFS_SUPER_MAGIC: ::c_long = 0x6c6f6f70;
+        pub const XFS_SUPER_MAGIC: ::c_long = 0x58465342;
+    } else if #[cfg(target_arch = "s390x")] {
+        pub const BINDERFS_SUPER_MAGIC: ::c_uint = 0x6c6f6f70;
+        pub const XFS_SUPER_MAGIC: ::c_uint = 0x58465342;
+    }
+}
+
+pub const CPU_SETSIZE: ::c_int = 0x400;
+
+pub const PTRACE_TRACEME: ::c_uint = 0;
+pub const PTRACE_PEEKTEXT: ::c_uint = 1;
+pub const PTRACE_PEEKDATA: ::c_uint = 2;
+pub const PTRACE_PEEKUSER: ::c_uint = 3;
+pub const PTRACE_POKETEXT: ::c_uint = 4;
+pub const PTRACE_POKEDATA: ::c_uint = 5;
+pub const PTRACE_POKEUSER: ::c_uint = 6;
+pub const PTRACE_CONT: ::c_uint = 7;
+pub const PTRACE_KILL: ::c_uint = 8;
+pub const PTRACE_SINGLESTEP: ::c_uint = 9;
+pub const PTRACE_ATTACH: ::c_uint = 16;
+pub const PTRACE_SYSCALL: ::c_uint = 24;
+pub const PTRACE_SETOPTIONS: ::c_uint = 0x4200;
+pub const PTRACE_GETEVENTMSG: ::c_uint = 0x4201;
+pub const PTRACE_GETSIGINFO: ::c_uint = 0x4202;
+pub const PTRACE_SETSIGINFO: ::c_uint = 0x4203;
+pub const PTRACE_GETREGSET: ::c_uint = 0x4204;
+pub const PTRACE_SETREGSET: ::c_uint = 0x4205;
+pub const PTRACE_SEIZE: ::c_uint = 0x4206;
+pub const PTRACE_INTERRUPT: ::c_uint = 0x4207;
+pub const PTRACE_LISTEN: ::c_uint = 0x4208;
+pub const PTRACE_PEEKSIGINFO: ::c_uint = 0x4209;
+pub const PTRACE_GETSIGMASK: ::c_uint = 0x420a;
+pub const PTRACE_SETSIGMASK: ::c_uint = 0x420b;
+pub const PTRACE_GET_SYSCALL_INFO: ::c_uint = 0x420e;
+pub const PTRACE_SYSCALL_INFO_NONE: ::__u8 = 0;
+pub const PTRACE_SYSCALL_INFO_ENTRY: ::__u8 = 1;
+pub const PTRACE_SYSCALL_INFO_EXIT: ::__u8 = 2;
+pub const PTRACE_SYSCALL_INFO_SECCOMP: ::__u8 = 3;
+
+// linux/fs.h
+
+// Flags for preadv2/pwritev2
+pub const RWF_HIPRI: ::c_int = 0x00000001;
+pub const RWF_DSYNC: ::c_int = 0x00000002;
+pub const RWF_SYNC: ::c_int = 0x00000004;
+pub const RWF_NOWAIT: ::c_int = 0x00000008;
+pub const RWF_APPEND: ::c_int = 0x00000010;
+
+// linux/rtnetlink.h
+pub const TCA_PAD: ::c_ushort = 9;
+pub const TCA_DUMP_INVISIBLE: ::c_ushort = 10;
+pub const TCA_CHAIN: ::c_ushort = 11;
+pub const TCA_HW_OFFLOAD: ::c_ushort = 12;
+
+pub const RTM_DELNETCONF: u16 = 81;
+pub const RTM_NEWSTATS: u16 = 92;
+pub const RTM_GETSTATS: u16 = 94;
+pub const RTM_NEWCACHEREPORT: u16 = 96;
+
+pub const RTM_F_LOOKUP_TABLE: ::c_uint = 0x1000;
+pub const RTM_F_FIB_MATCH: ::c_uint = 0x2000;
+
+pub const RTA_VIA: ::c_ushort = 18;
+pub const RTA_NEWDST: ::c_ushort = 19;
+pub const RTA_PREF: ::c_ushort = 20;
+pub const RTA_ENCAP_TYPE: ::c_ushort = 21;
+pub const RTA_ENCAP: ::c_ushort = 22;
+pub const RTA_EXPIRES: ::c_ushort = 23;
+pub const RTA_PAD: ::c_ushort = 24;
+pub const RTA_UID: ::c_ushort = 25;
+pub const RTA_TTL_PROPAGATE: ::c_ushort = 26;
+
+// linux/neighbor.h
+pub const NTF_EXT_LEARNED: u8 = 0x10;
+pub const NTF_OFFLOADED: u8 = 0x20;
+
+pub const NDA_MASTER: ::c_ushort = 9;
+pub const NDA_LINK_NETNSID: ::c_ushort = 10;
+pub const NDA_SRC_VNI: ::c_ushort = 11;
+
+// linux/personality.h
+pub const UNAME26: ::c_int = 0x0020000;
+pub const FDPIC_FUNCPTRS: ::c_int = 0x0080000;
+
+// linux/if_addr.h
+pub const IFA_FLAGS: ::c_ushort = 8;
+
+pub const IFA_F_MANAGETEMPADDR: u32 = 0x100;
+pub const IFA_F_NOPREFIXROUTE: u32 = 0x200;
+pub const IFA_F_MCAUTOJOIN: u32 = 0x400;
+pub const IFA_F_STABLE_PRIVACY: u32 = 0x800;
+
+pub const MAX_LINKS: ::c_int = 32;
+
+pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10;
+
+pub const GENL_ID_VFS_DQUOT: ::c_int = ::NLMSG_MIN_TYPE + 1;
+pub const GENL_ID_PMCRAID: ::c_int = ::NLMSG_MIN_TYPE + 2;
+
+// linux/if_xdp.h
+pub const XDP_SHARED_UMEM: ::__u16 = 1 << 0;
+pub const XDP_COPY: ::__u16 = 1 << 1;
+pub const XDP_ZEROCOPY: ::__u16 = 1 << 2;
+pub const XDP_USE_NEED_WAKEUP: ::__u16 = 1 << 3;
+pub const XDP_USE_SG: ::__u16 = 1 << 4;
+
+pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: ::__u32 = 1 << 0;
+
+pub const XDP_RING_NEED_WAKEUP: ::__u32 = 1 << 0;
+
+pub const XDP_MMAP_OFFSETS: ::c_int = 1;
+pub const XDP_RX_RING: ::c_int = 2;
+pub const XDP_TX_RING: ::c_int = 3;
+pub const XDP_UMEM_REG: ::c_int = 4;
+pub const XDP_UMEM_FILL_RING: ::c_int = 5;
+pub const XDP_UMEM_COMPLETION_RING: ::c_int = 6;
+pub const XDP_STATISTICS: ::c_int = 7;
+pub const XDP_OPTIONS: ::c_int = 8;
+
+pub const XDP_OPTIONS_ZEROCOPY: ::__u32 = 1 << 0;
+
+pub const XDP_PGOFF_RX_RING: ::off_t = 0;
+pub const XDP_PGOFF_TX_RING: ::off_t = 0x80000000;
+pub const XDP_UMEM_PGOFF_FILL_RING: ::c_ulonglong = 0x100000000;
+pub const XDP_UMEM_PGOFF_COMPLETION_RING: ::c_ulonglong = 0x180000000;
+
+pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: ::c_int = 48;
+pub const XSK_UNALIGNED_BUF_ADDR_MASK: ::c_ulonglong = (1 << XSK_UNALIGNED_BUF_OFFSET_SHIFT) - 1;
+
+pub const XDP_PKT_CONTD: ::__u32 = 1 << 0;
+
+// elf.h
+pub const NT_PRSTATUS: ::c_int = 1;
+pub const NT_PRFPREG: ::c_int = 2;
+pub const NT_FPREGSET: ::c_int = 2;
+pub const NT_PRPSINFO: ::c_int = 3;
+pub const NT_PRXREG: ::c_int = 4;
+pub const NT_TASKSTRUCT: ::c_int = 4;
+pub const NT_PLATFORM: ::c_int = 5;
+pub const NT_AUXV: ::c_int = 6;
+pub const NT_GWINDOWS: ::c_int = 7;
+pub const NT_ASRS: ::c_int = 8;
+pub const NT_PSTATUS: ::c_int = 10;
+pub const NT_PSINFO: ::c_int = 13;
+pub const NT_PRCRED: ::c_int = 14;
+pub const NT_UTSNAME: ::c_int = 15;
+pub const NT_LWPSTATUS: ::c_int = 16;
+pub const NT_LWPSINFO: ::c_int = 17;
+pub const NT_PRFPXREG: ::c_int = 20;
+
+pub const ELFOSABI_ARM_AEABI: u8 = 64;
+
+// linux/sched.h
+pub const CLONE_NEWTIME: ::c_int = 0x80;
+pub const CLONE_CLEAR_SIGHAND: ::c_int = 0x100000000;
+pub const CLONE_INTO_CGROUP: ::c_int = 0x200000000;
+
+// linux/keyctl.h
+pub const KEYCTL_DH_COMPUTE: u32 = 23;
+pub const KEYCTL_PKEY_QUERY: u32 = 24;
+pub const KEYCTL_PKEY_ENCRYPT: u32 = 25;
+pub const KEYCTL_PKEY_DECRYPT: u32 = 26;
+pub const KEYCTL_PKEY_SIGN: u32 = 27;
+pub const KEYCTL_PKEY_VERIFY: u32 = 28;
+pub const KEYCTL_RESTRICT_KEYRING: u32 = 29;
+
+pub const KEYCTL_SUPPORTS_ENCRYPT: u32 = 0x01;
+pub const KEYCTL_SUPPORTS_DECRYPT: u32 = 0x02;
+pub const KEYCTL_SUPPORTS_SIGN: u32 = 0x04;
+pub const KEYCTL_SUPPORTS_VERIFY: u32 = 0x08;
+cfg_if! {
+    if #[cfg(not(any(target_arch = "mips",
+                     target_arch = "mips32r6",
+                     target_arch = "mips64",
+                     target_arch = "mips64r6")))] {
+        pub const KEYCTL_MOVE: u32 = 30;
+        pub const KEYCTL_CAPABILITIES: u32 = 31;
+
+        pub const KEYCTL_CAPS0_CAPABILITIES: u32 = 0x01;
+        pub const KEYCTL_CAPS0_PERSISTENT_KEYRINGS: u32 = 0x02;
+        pub const KEYCTL_CAPS0_DIFFIE_HELLMAN: u32 = 0x04;
+        pub const KEYCTL_CAPS0_PUBLIC_KEY: u32 = 0x08;
+        pub const KEYCTL_CAPS0_BIG_KEY: u32 = 0x10;
+        pub const KEYCTL_CAPS0_INVALIDATE: u32 = 0x20;
+        pub const KEYCTL_CAPS0_RESTRICT_KEYRING: u32 = 0x40;
+        pub const KEYCTL_CAPS0_MOVE: u32 = 0x80;
+        pub const KEYCTL_CAPS1_NS_KEYRING_NAME: u32 = 0x01;
+        pub const KEYCTL_CAPS1_NS_KEY_TAG: u32 = 0x02;
+    }
+}
+
+pub const M_MXFAST: ::c_int = 1;
+pub const M_NLBLKS: ::c_int = 2;
+pub const M_GRAIN: ::c_int = 3;
+pub const M_KEEP: ::c_int = 4;
+pub const M_TRIM_THRESHOLD: ::c_int = -1;
+pub const M_TOP_PAD: ::c_int = -2;
+pub const M_MMAP_THRESHOLD: ::c_int = -3;
+pub const M_MMAP_MAX: ::c_int = -4;
+pub const M_CHECK_ACTION: ::c_int = -5;
+pub const M_PERTURB: ::c_int = -6;
+pub const M_ARENA_TEST: ::c_int = -7;
+pub const M_ARENA_MAX: ::c_int = -8;
+
+pub const AT_STATX_SYNC_TYPE: ::c_int = 0x6000;
+pub const AT_STATX_SYNC_AS_STAT: ::c_int = 0x0000;
+pub const AT_STATX_FORCE_SYNC: ::c_int = 0x2000;
+pub const AT_STATX_DONT_SYNC: ::c_int = 0x4000;
+pub const STATX_TYPE: ::c_uint = 0x0001;
+pub const STATX_MODE: ::c_uint = 0x0002;
+pub const STATX_NLINK: ::c_uint = 0x0004;
+pub const STATX_UID: ::c_uint = 0x0008;
+pub const STATX_GID: ::c_uint = 0x0010;
+pub const STATX_ATIME: ::c_uint = 0x0020;
+pub const STATX_MTIME: ::c_uint = 0x0040;
+pub const STATX_CTIME: ::c_uint = 0x0080;
+pub const STATX_INO: ::c_uint = 0x0100;
+pub const STATX_SIZE: ::c_uint = 0x0200;
+pub const STATX_BLOCKS: ::c_uint = 0x0400;
+pub const STATX_BASIC_STATS: ::c_uint = 0x07ff;
+pub const STATX_BTIME: ::c_uint = 0x0800;
+pub const STATX_MNT_ID: ::c_uint = 0x1000;
+pub const STATX_DIOALIGN: ::c_uint = 0x2000;
+pub const STATX_ALL: ::c_uint = 0x0fff;
+pub const STATX__RESERVED: ::c_int = 0x80000000;
+pub const STATX_ATTR_COMPRESSED: ::c_int = 0x0004;
+pub const STATX_ATTR_IMMUTABLE: ::c_int = 0x0010;
+pub const STATX_ATTR_APPEND: ::c_int = 0x0020;
+pub const STATX_ATTR_NODUMP: ::c_int = 0x0040;
+pub const STATX_ATTR_ENCRYPTED: ::c_int = 0x0800;
+pub const STATX_ATTR_AUTOMOUNT: ::c_int = 0x1000;
+pub const STATX_ATTR_MOUNT_ROOT: ::c_int = 0x2000;
+pub const STATX_ATTR_VERITY: ::c_int = 0x00100000;
+pub const STATX_ATTR_DAX: ::c_int = 0x00200000;
+
+pub const SOMAXCONN: ::c_int = 4096;
+
+// linux/mount.h
+pub const MOVE_MOUNT_F_SYMLINKS: ::c_uint = 0x00000001;
+pub const MOVE_MOUNT_F_AUTOMOUNTS: ::c_uint = 0x00000002;
+pub const MOVE_MOUNT_F_EMPTY_PATH: ::c_uint = 0x00000004;
+pub const MOVE_MOUNT_T_SYMLINKS: ::c_uint = 0x00000010;
+pub const MOVE_MOUNT_T_AUTOMOUNTS: ::c_uint = 0x00000020;
+pub const MOVE_MOUNT_T_EMPTY_PATH: ::c_uint = 0x00000040;
+pub const MOVE_MOUNT_SET_GROUP: ::c_uint = 0x00000100;
+pub const MOVE_MOUNT_BENEATH: ::c_uint = 0x00000200;
+
+// sys/timex.h
+pub const ADJ_OFFSET: ::c_uint = 0x0001;
+pub const ADJ_FREQUENCY: ::c_uint = 0x0002;
+pub const ADJ_MAXERROR: ::c_uint = 0x0004;
+pub const ADJ_ESTERROR: ::c_uint = 0x0008;
+pub const ADJ_STATUS: ::c_uint = 0x0010;
+pub const ADJ_TIMECONST: ::c_uint = 0x0020;
+pub const ADJ_TAI: ::c_uint = 0x0080;
+pub const ADJ_SETOFFSET: ::c_uint = 0x0100;
+pub const ADJ_MICRO: ::c_uint = 0x1000;
+pub const ADJ_NANO: ::c_uint = 0x2000;
+pub const ADJ_TICK: ::c_uint = 0x4000;
+pub const ADJ_OFFSET_SINGLESHOT: ::c_uint = 0x8001;
+pub const ADJ_OFFSET_SS_READ: ::c_uint = 0xa001;
+pub const MOD_OFFSET: ::c_uint = ADJ_OFFSET;
+pub const MOD_FREQUENCY: ::c_uint = ADJ_FREQUENCY;
+pub const MOD_MAXERROR: ::c_uint = ADJ_MAXERROR;
+pub const MOD_ESTERROR: ::c_uint = ADJ_ESTERROR;
+pub const MOD_STATUS: ::c_uint = ADJ_STATUS;
+pub const MOD_TIMECONST: ::c_uint = ADJ_TIMECONST;
+pub const MOD_CLKB: ::c_uint = ADJ_TICK;
+pub const MOD_CLKA: ::c_uint = ADJ_OFFSET_SINGLESHOT;
+pub const MOD_TAI: ::c_uint = ADJ_TAI;
+pub const MOD_MICRO: ::c_uint = ADJ_MICRO;
+pub const MOD_NANO: ::c_uint = ADJ_NANO;
+pub const STA_PLL: ::c_int = 0x0001;
+pub const STA_PPSFREQ: ::c_int = 0x0002;
+pub const STA_PPSTIME: ::c_int = 0x0004;
+pub const STA_FLL: ::c_int = 0x0008;
+pub const STA_INS: ::c_int = 0x0010;
+pub const STA_DEL: ::c_int = 0x0020;
+pub const STA_UNSYNC: ::c_int = 0x0040;
+pub const STA_FREQHOLD: ::c_int = 0x0080;
+pub const STA_PPSSIGNAL: ::c_int = 0x0100;
+pub const STA_PPSJITTER: ::c_int = 0x0200;
+pub const STA_PPSWANDER: ::c_int = 0x0400;
+pub const STA_PPSERROR: ::c_int = 0x0800;
+pub const STA_CLOCKERR: ::c_int = 0x1000;
+pub const STA_NANO: ::c_int = 0x2000;
+pub const STA_MODE: ::c_int = 0x4000;
+pub const STA_CLK: ::c_int = 0x8000;
+pub const STA_RONLY: ::c_int = STA_PPSSIGNAL
+    | STA_PPSJITTER
+    | STA_PPSWANDER
+    | STA_PPSERROR
+    | STA_CLOCKERR
+    | STA_NANO
+    | STA_MODE
+    | STA_CLK;
+pub const NTP_API: ::c_int = 4;
+pub const TIME_OK: ::c_int = 0;
+pub const TIME_INS: ::c_int = 1;
+pub const TIME_DEL: ::c_int = 2;
+pub const TIME_OOP: ::c_int = 3;
+pub const TIME_WAIT: ::c_int = 4;
+pub const TIME_ERROR: ::c_int = 5;
+pub const TIME_BAD: ::c_int = TIME_ERROR;
+pub const MAXTC: ::c_long = 6;
+
+// Portable GLOB_* flags are defined at the `linux_like` level.
+// The following are GNU extensions.
+pub const GLOB_PERIOD: ::c_int = 1 << 7;
+pub const GLOB_ALTDIRFUNC: ::c_int = 1 << 9;
+pub const GLOB_BRACE: ::c_int = 1 << 10;
+pub const GLOB_NOMAGIC: ::c_int = 1 << 11;
+pub const GLOB_TILDE: ::c_int = 1 << 12;
+pub const GLOB_ONLYDIR: ::c_int = 1 << 13;
+pub const GLOB_TILDE_CHECK: ::c_int = 1 << 14;
+
+pub const MADV_COLLAPSE: ::c_int = 25;
+
+cfg_if! {
+    if #[cfg(any(
+        target_arch = "arm",
+        target_arch = "x86",
+        target_arch = "x86_64",
+        target_arch = "s390x",
+        target_arch = "riscv64",
+        target_arch = "riscv32"
+    ))] {
+        pub const PTHREAD_STACK_MIN: ::size_t = 16384;
+    } else if #[cfg(any(
+               target_arch = "sparc",
+               target_arch = "sparc64"
+           ))] {
+        pub const PTHREAD_STACK_MIN: ::size_t = 0x6000;
+    } else {
+        pub const PTHREAD_STACK_MIN: ::size_t = 131072;
+    }
+}
+pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 3;
+
+pub const REG_STARTEND: ::c_int = 4;
+
+pub const REG_EEND: ::c_int = 14;
+pub const REG_ESIZE: ::c_int = 15;
+pub const REG_ERPAREN: ::c_int = 16;
+
+extern "C" {
+    pub fn fgetspent_r(
+        fp: *mut ::FILE,
+        spbuf: *mut ::spwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        spbufp: *mut *mut ::spwd,
+    ) -> ::c_int;
+    pub fn sgetspent_r(
+        s: *const ::c_char,
+        spbuf: *mut ::spwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        spbufp: *mut *mut ::spwd,
+    ) -> ::c_int;
+    pub fn getspent_r(
+        spbuf: *mut ::spwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        spbufp: *mut *mut ::spwd,
+    ) -> ::c_int;
+    pub fn qsort_r(
+        base: *mut ::c_void,
+        num: ::size_t,
+        size: ::size_t,
+        compar: ::Option<
+            unsafe extern "C" fn(*const ::c_void, *const ::c_void, *mut ::c_void) -> ::c_int,
+        >,
+        arg: *mut ::c_void,
+    );
+    pub fn sendmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn recvmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_int,
+        timeout: *mut ::timespec,
+    ) -> ::c_int;
+
+    pub fn getrlimit64(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit64) -> ::c_int;
+    pub fn setrlimit64(resource: ::__rlimit_resource_t, rlim: *const ::rlimit64) -> ::c_int;
+    pub fn getrlimit(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit) -> ::c_int;
+    pub fn setrlimit(resource: ::__rlimit_resource_t, rlim: *const ::rlimit) -> ::c_int;
+    pub fn prlimit(
+        pid: ::pid_t,
+        resource: ::__rlimit_resource_t,
+        new_limit: *const ::rlimit,
+        old_limit: *mut ::rlimit,
+    ) -> ::c_int;
+    pub fn prlimit64(
+        pid: ::pid_t,
+        resource: ::__rlimit_resource_t,
+        new_limit: *const ::rlimit64,
+        old_limit: *mut ::rlimit64,
+    ) -> ::c_int;
+    pub fn utmpname(file: *const ::c_char) -> ::c_int;
+    pub fn utmpxname(file: *const ::c_char) -> ::c_int;
+    pub fn getutxent() -> *mut utmpx;
+    pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
+    pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
+    pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
+    pub fn setutxent();
+    pub fn endutxent();
+    pub fn getpt() -> ::c_int;
+    pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int;
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
+    pub fn statx(
+        dirfd: ::c_int,
+        pathname: *const c_char,
+        flags: ::c_int,
+        mask: ::c_uint,
+        statxbuf: *mut statx,
+    ) -> ::c_int;
+    pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
+    pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+    pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
+
+    pub fn adjtimex(buf: *mut timex) -> ::c_int;
+    pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
+    #[link_name = "ntp_gettimex"]
+    pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
+    pub fn clock_adjtime(clk_id: ::clockid_t, buf: *mut ::timex) -> ::c_int;
+
+    pub fn fanotify_mark(
+        fd: ::c_int,
+        flags: ::c_uint,
+        mask: u64,
+        dirfd: ::c_int,
+        path: *const ::c_char,
+    ) -> ::c_int;
+    pub fn preadv2(
+        fd: ::c_int,
+        iov: *const ::iovec,
+        iovcnt: ::c_int,
+        offset: ::off_t,
+        flags: ::c_int,
+    ) -> ::ssize_t;
+    pub fn pwritev2(
+        fd: ::c_int,
+        iov: *const ::iovec,
+        iovcnt: ::c_int,
+        offset: ::off_t,
+        flags: ::c_int,
+    ) -> ::ssize_t;
+    pub fn preadv64v2(
+        fd: ::c_int,
+        iov: *const ::iovec,
+        iovcnt: ::c_int,
+        offset: ::off64_t,
+        flags: ::c_int,
+    ) -> ::ssize_t;
+    pub fn pwritev64v2(
+        fd: ::c_int,
+        iov: *const ::iovec,
+        iovcnt: ::c_int,
+        offset: ::off64_t,
+        flags: ::c_int,
+    ) -> ::ssize_t;
+    pub fn renameat2(
+        olddirfd: ::c_int,
+        oldpath: *const ::c_char,
+        newdirfd: ::c_int,
+        newpath: *const ::c_char,
+        flags: ::c_uint,
+    ) -> ::c_int;
+
+    // Added in `glibc` 2.25
+    pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t);
+    // Added in `glibc` 2.29
+    pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
+
+    pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char;
+    pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
+    pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int;
+    pub fn glob64(
+        pattern: *const ::c_char,
+        flags: ::c_int,
+        errfunc: ::Option<extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut glob64_t,
+    ) -> ::c_int;
+    pub fn globfree64(pglob: *mut glob64_t);
+    pub fn ptrace(request: ::c_uint, ...) -> ::c_long;
+    pub fn pthread_attr_getaffinity_np(
+        attr: *const ::pthread_attr_t,
+        cpusetsize: ::size_t,
+        cpuset: *mut ::cpu_set_t,
+    ) -> ::c_int;
+    pub fn pthread_attr_setaffinity_np(
+        attr: *mut ::pthread_attr_t,
+        cpusetsize: ::size_t,
+        cpuset: *const ::cpu_set_t,
+    ) -> ::c_int;
+    pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::__priority_which_t, who: ::id_t, prio: ::c_int) -> ::c_int;
+    pub fn pthread_rwlockattr_getkind_np(
+        attr: *const ::pthread_rwlockattr_t,
+        val: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_rwlockattr_setkind_np(
+        attr: *mut ::pthread_rwlockattr_t,
+        val: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_sigqueue(thread: ::pthread_t, sig: ::c_int, value: ::sigval) -> ::c_int;
+    pub fn mallinfo() -> ::mallinfo;
+    pub fn mallinfo2() -> ::mallinfo2;
+    pub fn malloc_info(options: ::c_int, stream: *mut ::FILE) -> ::c_int;
+    pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;
+    pub fn getpwent_r(
+        pwd: *mut ::passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::passwd,
+    ) -> ::c_int;
+    pub fn getgrent_r(
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn fgetpwent_r(
+        stream: *mut ::FILE,
+        pwd: *mut ::passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::passwd,
+    ) -> ::c_int;
+    pub fn fgetgrent_r(
+        stream: *mut ::FILE,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+
+    pub fn putpwent(p: *const ::passwd, stream: *mut ::FILE) -> ::c_int;
+    pub fn putgrent(grp: *const ::group, stream: *mut ::FILE) -> ::c_int;
+
+    pub fn sethostid(hostid: ::c_long) -> ::c_int;
+
+    pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
+    pub fn mlock2(addr: *const ::c_void, len: ::size_t, flags: ::c_uint) -> ::c_int;
+
+    pub fn euidaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
+    pub fn eaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
+
+    pub fn asctime_r(tm: *const ::tm, buf: *mut ::c_char) -> *mut ::c_char;
+    pub fn ctime_r(timep: *const time_t, buf: *mut ::c_char) -> *mut ::c_char;
+
+    pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+    /// POSIX version of `basename(3)`, defined in `libgen.h`.
+    #[link_name = "__xpg_basename"]
+    pub fn posix_basename(path: *mut ::c_char) -> *mut ::c_char;
+    /// GNU version of `basename(3)`, defined in `string.h`.
+    #[link_name = "basename"]
+    pub fn gnu_basename(path: *const ::c_char) -> *mut ::c_char;
+    pub fn dlmopen(lmid: Lmid_t, filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void;
+    pub fn dlinfo(handle: *mut ::c_void, request: ::c_int, info: *mut ::c_void) -> ::c_int;
+    pub fn dladdr1(
+        addr: *const ::c_void,
+        info: *mut ::Dl_info,
+        extra_info: *mut *mut ::c_void,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn malloc_trim(__pad: ::size_t) -> ::c_int;
+    pub fn gnu_get_libc_release() -> *const ::c_char;
+    pub fn gnu_get_libc_version() -> *const ::c_char;
+
+    // posix/spawn.h
+    // Added in `glibc` 2.29
+    pub fn posix_spawn_file_actions_addchdir_np(
+        actions: *mut ::posix_spawn_file_actions_t,
+        path: *const ::c_char,
+    ) -> ::c_int;
+    // Added in `glibc` 2.29
+    pub fn posix_spawn_file_actions_addfchdir_np(
+        actions: *mut ::posix_spawn_file_actions_t,
+        fd: ::c_int,
+    ) -> ::c_int;
+    // Added in `glibc` 2.34
+    pub fn posix_spawn_file_actions_addclosefrom_np(
+        actions: *mut ::posix_spawn_file_actions_t,
+        from: ::c_int,
+    ) -> ::c_int;
+    // Added in `glibc` 2.35
+    pub fn posix_spawn_file_actions_addtcsetpgrp_np(
+        actions: *mut ::posix_spawn_file_actions_t,
+        tcfd: ::c_int,
+    ) -> ::c_int;
+
+    // mntent.h
+    pub fn getmntent_r(
+        stream: *mut ::FILE,
+        mntbuf: *mut ::mntent,
+        buf: *mut ::c_char,
+        buflen: ::c_int,
+    ) -> *mut ::mntent;
+
+    pub fn execveat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        argv: *const *mut c_char,
+        envp: *const *mut c_char,
+        flags: ::c_int,
+    ) -> ::c_int;
+
+    // Added in `glibc` 2.34
+    pub fn close_range(first: ::c_uint, last: ::c_uint, flags: ::c_int) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(any(target_arch = "x86",
+                 target_arch = "arm",
+                 target_arch = "m68k",
+                 target_arch = "csky",
+                 target_arch = "mips",
+                 target_arch = "mips32r6",
+                 target_arch = "powerpc",
+                 target_arch = "sparc",
+                 target_arch = "riscv32"))] {
+        mod b32;
+        pub use self::b32::*;
+    } else if #[cfg(any(target_arch = "x86_64",
+                        target_arch = "aarch64",
+                        target_arch = "powerpc64",
+                        target_arch = "mips64",
+                        target_arch = "mips64r6",
+                        target_arch = "s390x",
+                        target_arch = "sparc64",
+                        target_arch = "riscv64",
+                        target_arch = "loongarch64"))] {
+        mod b64;
+        pub use self::b64::*;
+    } else {
+        // Unknown target_arch
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    } else {
+        mod no_align;
+        pub use self::no_align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/no_align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/no_align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/gnu/no_align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/gnu/no_align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,10 @@
+s! {
+    // FIXME this is actually a union
+    pub struct sem_t {
+        #[cfg(target_pointer_width = "32")]
+        __size: [::c_char; 16],
+        #[cfg(target_pointer_width = "64")]
+        __size: [::c_char; 32],
+        __align: [::c_long; 0],
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5690 @@
+//! Linux-specific definitions for linux-like values
+
+pub type useconds_t = u32;
+pub type dev_t = u64;
+pub type socklen_t = u32;
+pub type mode_t = u32;
+pub type ino64_t = u64;
+pub type off64_t = i64;
+pub type blkcnt64_t = i64;
+pub type rlim64_t = u64;
+pub type mqd_t = ::c_int;
+pub type nfds_t = ::c_ulong;
+pub type nl_item = ::c_int;
+pub type idtype_t = ::c_uint;
+pub type loff_t = ::c_longlong;
+pub type pthread_key_t = ::c_uint;
+pub type pthread_once_t = ::c_int;
+pub type pthread_spinlock_t = ::c_int;
+
+pub type __u8 = ::c_uchar;
+pub type __u16 = ::c_ushort;
+pub type __s16 = ::c_short;
+pub type __u32 = ::c_uint;
+pub type __s32 = ::c_int;
+
+pub type Elf32_Half = u16;
+pub type Elf32_Word = u32;
+pub type Elf32_Off = u32;
+pub type Elf32_Addr = u32;
+
+pub type Elf64_Half = u16;
+pub type Elf64_Word = u32;
+pub type Elf64_Off = u64;
+pub type Elf64_Addr = u64;
+pub type Elf64_Xword = u64;
+pub type Elf64_Sxword = i64;
+
+pub type Elf32_Section = u16;
+pub type Elf64_Section = u16;
+
+// linux/can.h
+pub type canid_t = u32;
+
+// linux/can/j1939.h
+pub type can_err_mask_t = u32;
+pub type pgn_t = u32;
+pub type priority_t = u8;
+pub type name_t = u64;
+
+pub type iconv_t = *mut ::c_void;
+
+// linux/sctp.h
+pub type sctp_assoc_t = ::__s32;
+
+pub type eventfd_t = u64;
+missing! {
+    #[cfg_attr(feature = "extra_traits", derive(Debug))]
+    pub enum fpos64_t {} // FIXME: fill this out with a struct
+}
+
+s! {
+    pub struct glob_t {
+        pub gl_pathc: ::size_t,
+        pub gl_pathv: *mut *mut c_char,
+        pub gl_offs: ::size_t,
+        pub gl_flags: ::c_int,
+
+        __unused1: *mut ::c_void,
+        __unused2: *mut ::c_void,
+        __unused3: *mut ::c_void,
+        __unused4: *mut ::c_void,
+        __unused5: *mut ::c_void,
+    }
+
+    pub struct passwd {
+        pub pw_name: *mut ::c_char,
+        pub pw_passwd: *mut ::c_char,
+        pub pw_uid: ::uid_t,
+        pub pw_gid: ::gid_t,
+        pub pw_gecos: *mut ::c_char,
+        pub pw_dir: *mut ::c_char,
+        pub pw_shell: *mut ::c_char,
+    }
+
+    pub struct spwd {
+        pub sp_namp: *mut ::c_char,
+        pub sp_pwdp: *mut ::c_char,
+        pub sp_lstchg: ::c_long,
+        pub sp_min: ::c_long,
+        pub sp_max: ::c_long,
+        pub sp_warn: ::c_long,
+        pub sp_inact: ::c_long,
+        pub sp_expire: ::c_long,
+        pub sp_flag: ::c_ulong,
+    }
+
+    pub struct dqblk {
+        pub dqb_bhardlimit: u64,
+        pub dqb_bsoftlimit: u64,
+        pub dqb_curspace: u64,
+        pub dqb_ihardlimit: u64,
+        pub dqb_isoftlimit: u64,
+        pub dqb_curinodes: u64,
+        pub dqb_btime: u64,
+        pub dqb_itime: u64,
+        pub dqb_valid: u32,
+    }
+
+    pub struct signalfd_siginfo {
+        pub ssi_signo: u32,
+        pub ssi_errno: i32,
+        pub ssi_code: i32,
+        pub ssi_pid: u32,
+        pub ssi_uid: u32,
+        pub ssi_fd: i32,
+        pub ssi_tid: u32,
+        pub ssi_band: u32,
+        pub ssi_overrun: u32,
+        pub ssi_trapno: u32,
+        pub ssi_status: i32,
+        pub ssi_int: i32,
+        pub ssi_ptr: u64,
+        pub ssi_utime: u64,
+        pub ssi_stime: u64,
+        pub ssi_addr: u64,
+        pub ssi_addr_lsb: u16,
+        _pad2: u16,
+        pub ssi_syscall: i32,
+        pub ssi_call_addr: u64,
+        pub ssi_arch: u32,
+        _pad: [u8; 28],
+    }
+
+    pub struct itimerspec {
+        pub it_interval: ::timespec,
+        pub it_value: ::timespec,
+    }
+
+    pub struct fsid_t {
+        __val: [::c_int; 2],
+    }
+
+    pub struct packet_mreq {
+        pub mr_ifindex: ::c_int,
+        pub mr_type: ::c_ushort,
+        pub mr_alen: ::c_ushort,
+        pub mr_address: [::c_uchar; 8],
+    }
+
+    pub struct cpu_set_t {
+        #[cfg(all(target_pointer_width = "32",
+                  not(target_arch = "x86_64")))]
+        bits: [u32; 32],
+        #[cfg(not(all(target_pointer_width = "32",
+                      not(target_arch = "x86_64"))))]
+        bits: [u64; 16],
+    }
+
+    pub struct if_nameindex {
+        pub if_index: ::c_uint,
+        pub if_name: *mut ::c_char,
+    }
+
+    // System V IPC
+    pub struct msginfo {
+        pub msgpool: ::c_int,
+        pub msgmap: ::c_int,
+        pub msgmax: ::c_int,
+        pub msgmnb: ::c_int,
+        pub msgmni: ::c_int,
+        pub msgssz: ::c_int,
+        pub msgtql: ::c_int,
+        pub msgseg: ::c_ushort,
+    }
+
+    pub struct sembuf {
+        pub sem_num: ::c_ushort,
+        pub sem_op: ::c_short,
+        pub sem_flg: ::c_short,
+    }
+
+    pub struct input_event {
+        pub time: ::timeval,
+        pub type_: ::__u16,
+        pub code: ::__u16,
+        pub value: ::__s32,
+    }
+
+    pub struct input_id {
+        pub bustype: ::__u16,
+        pub vendor: ::__u16,
+        pub product: ::__u16,
+        pub version: ::__u16,
+    }
+
+    pub struct input_absinfo {
+        pub value: ::__s32,
+        pub minimum: ::__s32,
+        pub maximum: ::__s32,
+        pub fuzz: ::__s32,
+        pub flat: ::__s32,
+        pub resolution: ::__s32,
+    }
+
+    pub struct input_keymap_entry {
+        pub flags: ::__u8,
+        pub len: ::__u8,
+        pub index: ::__u16,
+        pub keycode: ::__u32,
+        pub scancode: [::__u8; 32],
+    }
+
+    pub struct input_mask {
+        pub type_: ::__u32,
+        pub codes_size: ::__u32,
+        pub codes_ptr: ::__u64,
+    }
+
+    pub struct ff_replay {
+        pub length: ::__u16,
+        pub delay: ::__u16,
+    }
+
+    pub struct ff_trigger {
+        pub button: ::__u16,
+        pub interval: ::__u16,
+    }
+
+    pub struct ff_envelope {
+        pub attack_length: ::__u16,
+        pub attack_level: ::__u16,
+        pub fade_length: ::__u16,
+        pub fade_level: ::__u16,
+    }
+
+    pub struct ff_constant_effect {
+        pub level: ::__s16,
+        pub envelope: ff_envelope,
+    }
+
+    pub struct ff_ramp_effect {
+        pub start_level: ::__s16,
+        pub end_level: ::__s16,
+        pub envelope: ff_envelope,
+    }
+
+    pub struct ff_condition_effect {
+        pub right_saturation: ::__u16,
+        pub left_saturation: ::__u16,
+
+        pub right_coeff: ::__s16,
+        pub left_coeff: ::__s16,
+
+        pub deadband: ::__u16,
+        pub center: ::__s16,
+    }
+
+    pub struct ff_periodic_effect {
+        pub waveform: ::__u16,
+        pub period: ::__u16,
+        pub magnitude: ::__s16,
+        pub offset: ::__s16,
+        pub phase: ::__u16,
+
+        pub envelope: ff_envelope,
+
+        pub custom_len: ::__u32,
+        pub custom_data: *mut ::__s16,
+    }
+
+    pub struct ff_rumble_effect {
+        pub strong_magnitude: ::__u16,
+        pub weak_magnitude: ::__u16,
+    }
+
+    pub struct ff_effect {
+        pub type_: ::__u16,
+        pub id: ::__s16,
+        pub direction: ::__u16,
+        pub trigger: ff_trigger,
+        pub replay: ff_replay,
+        // FIXME this is actually a union
+        #[cfg(target_pointer_width = "64")]
+        pub u: [u64; 4],
+        #[cfg(target_pointer_width = "32")]
+        pub u: [u32; 7],
+    }
+
+    pub struct uinput_ff_upload {
+        pub request_id: ::__u32,
+        pub retval: ::__s32,
+        pub effect: ff_effect,
+        pub old: ff_effect,
+    }
+
+    pub struct uinput_ff_erase {
+        pub request_id: ::__u32,
+        pub retval: ::__s32,
+        pub effect_id: ::__u32,
+    }
+
+    pub struct uinput_abs_setup {
+        pub code: ::__u16,
+        pub absinfo: input_absinfo,
+    }
+
+    pub struct dl_phdr_info {
+        #[cfg(target_pointer_width = "64")]
+        pub dlpi_addr: Elf64_Addr,
+        #[cfg(target_pointer_width = "32")]
+        pub dlpi_addr: Elf32_Addr,
+
+        pub dlpi_name: *const ::c_char,
+
+        #[cfg(target_pointer_width = "64")]
+        pub dlpi_phdr: *const Elf64_Phdr,
+        #[cfg(target_pointer_width = "32")]
+        pub dlpi_phdr: *const Elf32_Phdr,
+
+        #[cfg(target_pointer_width = "64")]
+        pub dlpi_phnum: Elf64_Half,
+        #[cfg(target_pointer_width = "32")]
+        pub dlpi_phnum: Elf32_Half,
+
+        // As of uClibc 1.0.36, the following fields are
+        // gated behind a "#if 0" block which always evaluates
+        // to false. So I'm just removing these, and if uClibc changes
+        // the #if block in the future to include the following fields, these
+        // will probably need including here. tsidea, skrap
+        #[cfg(not(target_env = "uclibc"))]
+        pub dlpi_adds: ::c_ulonglong,
+        #[cfg(not(target_env = "uclibc"))]
+        pub dlpi_subs: ::c_ulonglong,
+        #[cfg(not(target_env = "uclibc"))]
+        pub dlpi_tls_modid: ::size_t,
+        #[cfg(not(target_env = "uclibc"))]
+        pub dlpi_tls_data: *mut ::c_void,
+    }
+
+    pub struct Elf32_Ehdr {
+        pub e_ident: [::c_uchar; 16],
+        pub e_type: Elf32_Half,
+        pub e_machine: Elf32_Half,
+        pub e_version: Elf32_Word,
+        pub e_entry: Elf32_Addr,
+        pub e_phoff: Elf32_Off,
+        pub e_shoff: Elf32_Off,
+        pub e_flags: Elf32_Word,
+        pub e_ehsize: Elf32_Half,
+        pub e_phentsize: Elf32_Half,
+        pub e_phnum: Elf32_Half,
+        pub e_shentsize: Elf32_Half,
+        pub e_shnum: Elf32_Half,
+        pub e_shstrndx: Elf32_Half,
+    }
+
+    pub struct Elf64_Ehdr {
+        pub e_ident: [::c_uchar; 16],
+        pub e_type: Elf64_Half,
+        pub e_machine: Elf64_Half,
+        pub e_version: Elf64_Word,
+        pub e_entry: Elf64_Addr,
+        pub e_phoff: Elf64_Off,
+        pub e_shoff: Elf64_Off,
+        pub e_flags: Elf64_Word,
+        pub e_ehsize: Elf64_Half,
+        pub e_phentsize: Elf64_Half,
+        pub e_phnum: Elf64_Half,
+        pub e_shentsize: Elf64_Half,
+        pub e_shnum: Elf64_Half,
+        pub e_shstrndx: Elf64_Half,
+    }
+
+    pub struct Elf32_Sym {
+        pub st_name: Elf32_Word,
+        pub st_value: Elf32_Addr,
+        pub st_size: Elf32_Word,
+        pub st_info: ::c_uchar,
+        pub st_other: ::c_uchar,
+        pub st_shndx: Elf32_Section,
+    }
+
+    pub struct Elf64_Sym {
+        pub st_name: Elf64_Word,
+        pub st_info: ::c_uchar,
+        pub st_other: ::c_uchar,
+        pub st_shndx: Elf64_Section,
+        pub st_value: Elf64_Addr,
+        pub st_size: Elf64_Xword,
+    }
+
+    pub struct Elf32_Phdr {
+        pub p_type: Elf32_Word,
+        pub p_offset: Elf32_Off,
+        pub p_vaddr: Elf32_Addr,
+        pub p_paddr: Elf32_Addr,
+        pub p_filesz: Elf32_Word,
+        pub p_memsz: Elf32_Word,
+        pub p_flags: Elf32_Word,
+        pub p_align: Elf32_Word,
+    }
+
+    pub struct Elf64_Phdr {
+        pub p_type: Elf64_Word,
+        pub p_flags: Elf64_Word,
+        pub p_offset: Elf64_Off,
+        pub p_vaddr: Elf64_Addr,
+        pub p_paddr: Elf64_Addr,
+        pub p_filesz: Elf64_Xword,
+        pub p_memsz: Elf64_Xword,
+        pub p_align: Elf64_Xword,
+    }
+
+    pub struct Elf32_Shdr {
+        pub sh_name: Elf32_Word,
+        pub sh_type: Elf32_Word,
+        pub sh_flags: Elf32_Word,
+        pub sh_addr: Elf32_Addr,
+        pub sh_offset: Elf32_Off,
+        pub sh_size: Elf32_Word,
+        pub sh_link: Elf32_Word,
+        pub sh_info: Elf32_Word,
+        pub sh_addralign: Elf32_Word,
+        pub sh_entsize: Elf32_Word,
+    }
+
+    pub struct Elf64_Shdr {
+        pub sh_name: Elf64_Word,
+        pub sh_type: Elf64_Word,
+        pub sh_flags: Elf64_Xword,
+        pub sh_addr: Elf64_Addr,
+        pub sh_offset: Elf64_Off,
+        pub sh_size: Elf64_Xword,
+        pub sh_link: Elf64_Word,
+        pub sh_info: Elf64_Word,
+        pub sh_addralign: Elf64_Xword,
+        pub sh_entsize: Elf64_Xword,
+    }
+
+    pub struct ucred {
+        pub pid: ::pid_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+    }
+
+    pub struct mntent {
+        pub mnt_fsname: *mut ::c_char,
+        pub mnt_dir: *mut ::c_char,
+        pub mnt_type: *mut ::c_char,
+        pub mnt_opts: *mut ::c_char,
+        pub mnt_freq: ::c_int,
+        pub mnt_passno: ::c_int,
+    }
+
+    pub struct posix_spawn_file_actions_t {
+        __allocated: ::c_int,
+        __used: ::c_int,
+        __actions: *mut ::c_int,
+        __pad: [::c_int; 16],
+    }
+
+    pub struct posix_spawnattr_t {
+        __flags: ::c_short,
+        __pgrp: ::pid_t,
+        __sd: ::sigset_t,
+        __ss: ::sigset_t,
+        #[cfg(any(target_env = "musl", target_env = "ohos"))]
+        __prio: ::c_int,
+        #[cfg(not(any(target_env = "musl", target_env = "ohos")))]
+        __sp: ::sched_param,
+        __policy: ::c_int,
+        __pad: [::c_int; 16],
+    }
+
+    pub struct genlmsghdr {
+        pub cmd: u8,
+        pub version: u8,
+        pub reserved: u16,
+    }
+
+    pub struct in6_pktinfo {
+        pub ipi6_addr: ::in6_addr,
+        pub ipi6_ifindex: ::c_uint,
+    }
+
+    pub struct arpd_request {
+        pub req: ::c_ushort,
+        pub ip: u32,
+        pub dev: ::c_ulong,
+        pub stamp: ::c_ulong,
+        pub updated: ::c_ulong,
+        pub ha: [::c_uchar; ::MAX_ADDR_LEN],
+    }
+
+    pub struct inotify_event {
+        pub wd: ::c_int,
+        pub mask: u32,
+        pub cookie: u32,
+        pub len: u32
+    }
+
+    pub struct fanotify_response {
+        pub fd: ::c_int,
+        pub response: __u32,
+    }
+
+    pub struct sockaddr_vm {
+        pub svm_family: ::sa_family_t,
+        pub svm_reserved1: ::c_ushort,
+        pub svm_port: ::c_uint,
+        pub svm_cid: ::c_uint,
+        pub svm_zero: [u8; 4]
+    }
+
+    pub struct regmatch_t {
+        pub rm_so: regoff_t,
+        pub rm_eo: regoff_t,
+    }
+
+    pub struct sock_extended_err {
+        pub ee_errno: u32,
+        pub ee_origin: u8,
+        pub ee_type: u8,
+        pub ee_code: u8,
+        pub ee_pad: u8,
+        pub ee_info: u32,
+        pub ee_data: u32,
+    }
+
+    // linux/can.h
+    pub struct __c_anonymous_sockaddr_can_tp {
+        pub rx_id: canid_t,
+        pub tx_id: canid_t,
+    }
+
+    pub struct __c_anonymous_sockaddr_can_j1939 {
+        pub name: u64,
+        pub pgn: u32,
+        pub addr: u8,
+    }
+
+    pub struct can_filter {
+        pub can_id: canid_t,
+        pub can_mask: canid_t,
+    }
+
+    // linux/can/j1939.h
+    pub struct j1939_filter {
+        pub name: name_t,
+        pub name_mask: name_t,
+        pub pgn: pgn_t,
+        pub pgn_mask: pgn_t,
+        pub addr: u8,
+        pub addr_mask: u8,
+    }
+
+    // linux/filter.h
+    pub struct sock_filter {
+        pub code: ::__u16,
+        pub jt: ::__u8,
+        pub jf: ::__u8,
+        pub k: ::__u32,
+    }
+
+    pub struct sock_fprog {
+        pub len: ::c_ushort,
+        pub filter: *mut sock_filter,
+    }
+
+    // linux/seccomp.h
+    pub struct seccomp_data {
+        pub nr: ::c_int,
+        pub arch: ::__u32,
+        pub instruction_pointer: ::__u64,
+        pub args: [::__u64; 6],
+    }
+
+    pub struct seccomp_notif_sizes {
+        pub seccomp_notif: ::__u16,
+        pub seccomp_notif_resp: ::__u16,
+        pub seccomp_data: ::__u16,
+    }
+
+    pub struct seccomp_notif {
+        pub id: ::__u64,
+        pub pid: ::__u32,
+        pub flags: ::__u32,
+        pub data: seccomp_data,
+    }
+
+    pub struct seccomp_notif_resp {
+        pub id: ::__u64,
+        pub val: ::__s64,
+        pub error: ::__s32,
+        pub flags: ::__u32,
+    }
+
+    pub struct seccomp_notif_addfd {
+        pub id: ::__u64,
+        pub flags: ::__u32,
+        pub srcfd: ::__u32,
+        pub newfd: ::__u32,
+        pub newfd_flags: ::__u32,
+    }
+
+    pub struct nlmsghdr {
+        pub nlmsg_len: u32,
+        pub nlmsg_type: u16,
+        pub nlmsg_flags: u16,
+        pub nlmsg_seq: u32,
+        pub nlmsg_pid: u32,
+    }
+
+    pub struct nlmsgerr {
+        pub error: ::c_int,
+        pub msg: nlmsghdr,
+    }
+
+    pub struct nlattr {
+        pub nla_len: u16,
+        pub nla_type: u16,
+    }
+
+    pub struct file_clone_range {
+        pub src_fd: ::__s64,
+        pub src_offset: ::__u64,
+        pub src_length: ::__u64,
+        pub dest_offset: ::__u64,
+    }
+
+    pub struct __c_anonymous_ifru_map {
+        pub mem_start: ::c_ulong,
+        pub mem_end: ::c_ulong,
+        pub base_addr: ::c_ushort,
+        pub irq: ::c_uchar,
+        pub dma: ::c_uchar,
+        pub port: ::c_uchar,
+    }
+
+   pub struct in6_ifreq {
+       pub ifr6_addr: ::in6_addr,
+       pub ifr6_prefixlen: u32,
+       pub ifr6_ifindex: ::c_int,
+   }
+
+    pub struct option {
+        pub name: *const ::c_char,
+        pub has_arg: ::c_int,
+        pub flag: *mut ::c_int,
+        pub val: ::c_int,
+    }
+
+    // linux/sctp.h
+
+    pub struct sctp_initmsg {
+        pub sinit_num_ostreams: ::__u16,
+        pub sinit_max_instreams: ::__u16,
+        pub sinit_max_attempts: ::__u16,
+        pub sinit_max_init_timeo: ::__u16,
+    }
+
+    pub struct sctp_sndrcvinfo {
+        pub sinfo_stream: ::__u16,
+        pub sinfo_ssn: ::__u16,
+        pub sinfo_flags: ::__u16,
+        pub sinfo_ppid: ::__u32,
+        pub sinfo_context: ::__u32,
+        pub sinfo_timetolive: ::__u32,
+        pub sinfo_tsn: ::__u32,
+        pub sinfo_cumtsn: ::__u32,
+        pub sinfo_assoc_id: ::sctp_assoc_t,
+    }
+
+    pub struct sctp_sndinfo {
+        pub snd_sid: ::__u16,
+        pub snd_flags: ::__u16,
+        pub snd_ppid: ::__u32,
+        pub snd_context: ::__u32,
+        pub snd_assoc_id: ::sctp_assoc_t,
+    }
+
+    pub struct sctp_rcvinfo {
+        pub rcv_sid: ::__u16,
+        pub rcv_ssn: ::__u16,
+        pub rcv_flags: ::__u16,
+        pub rcv_ppid: ::__u32,
+        pub rcv_tsn: ::__u32,
+        pub rcv_cumtsn: ::__u32,
+        pub rcv_context: ::__u32,
+        pub rcv_assoc_id: ::sctp_assoc_t,
+    }
+
+    pub struct sctp_nxtinfo {
+        pub nxt_sid: ::__u16,
+        pub nxt_flags: ::__u16,
+        pub nxt_ppid: ::__u32,
+        pub nxt_length: ::__u32,
+        pub nxt_assoc_id: ::sctp_assoc_t,
+    }
+
+    pub struct sctp_prinfo {
+        pub pr_policy: ::__u16,
+        pub pr_value: ::__u32,
+    }
+
+    pub struct sctp_authinfo {
+        pub auth_keynumber: ::__u16,
+    }
+
+    pub struct rlimit64 {
+        pub rlim_cur: rlim64_t,
+        pub rlim_max: rlim64_t,
+    }
+
+    // linux/tls.h
+
+    pub struct tls_crypto_info {
+        pub version: ::__u16,
+        pub cipher_type: ::__u16,
+    }
+
+    pub struct tls12_crypto_info_aes_gcm_128 {
+        pub info: tls_crypto_info,
+        pub iv: [::c_uchar; TLS_CIPHER_AES_GCM_128_IV_SIZE],
+        pub key: [::c_uchar; TLS_CIPHER_AES_GCM_128_KEY_SIZE],
+        pub salt: [::c_uchar; TLS_CIPHER_AES_GCM_128_SALT_SIZE],
+        pub rec_seq: [::c_uchar; TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE],
+    }
+
+    pub struct tls12_crypto_info_aes_gcm_256 {
+        pub info: tls_crypto_info,
+        pub iv: [::c_uchar; TLS_CIPHER_AES_GCM_256_IV_SIZE],
+        pub key: [::c_uchar; TLS_CIPHER_AES_GCM_256_KEY_SIZE],
+        pub salt: [::c_uchar; TLS_CIPHER_AES_GCM_256_SALT_SIZE],
+        pub rec_seq: [::c_uchar; TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE],
+    }
+
+    pub struct tls12_crypto_info_chacha20_poly1305 {
+        pub info: tls_crypto_info,
+        pub iv: [::c_uchar; TLS_CIPHER_CHACHA20_POLY1305_IV_SIZE],
+        pub key: [::c_uchar; TLS_CIPHER_CHACHA20_POLY1305_KEY_SIZE],
+        pub salt: [::c_uchar; TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE],
+        pub rec_seq: [::c_uchar; TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE],
+    }
+}
+
+s_no_extra_traits! {
+    pub struct sockaddr_nl {
+        pub nl_family: ::sa_family_t,
+        nl_pad: ::c_ushort,
+        pub nl_pid: u32,
+        pub nl_groups: u32
+    }
+
+    pub struct dirent {
+        pub d_ino: ::ino_t,
+        pub d_off: ::off_t,
+        pub d_reclen: ::c_ushort,
+        pub d_type: ::c_uchar,
+        pub d_name: [::c_char; 256],
+    }
+
+    pub struct sockaddr_alg {
+        pub salg_family: ::sa_family_t,
+        pub salg_type: [::c_uchar; 14],
+        pub salg_feat: u32,
+        pub salg_mask: u32,
+        pub salg_name: [::c_uchar; 64],
+    }
+
+    pub struct uinput_setup {
+        pub id: input_id,
+        pub name: [::c_char; UINPUT_MAX_NAME_SIZE],
+        pub ff_effects_max: ::__u32,
+    }
+
+    pub struct uinput_user_dev {
+        pub name: [::c_char; UINPUT_MAX_NAME_SIZE],
+        pub id: input_id,
+        pub ff_effects_max: ::__u32,
+        pub absmax: [::__s32; ABS_CNT],
+        pub absmin: [::__s32; ABS_CNT],
+        pub absfuzz: [::__s32; ABS_CNT],
+        pub absflat: [::__s32; ABS_CNT],
+    }
+
+    /// WARNING: The `PartialEq`, `Eq` and `Hash` implementations of this
+    /// type are unsound and will be removed in the future.
+    #[deprecated(
+        note = "this struct has unsafe trait implementations that will be \
+                removed in the future",
+        since = "0.2.80"
+    )]
+    pub struct af_alg_iv {
+        pub ivlen: u32,
+        pub iv: [::c_uchar; 0],
+    }
+
+    // x32 compatibility
+    // See https://sourceware.org/bugzilla/show_bug.cgi?id=21279
+    pub struct mq_attr {
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub mq_flags: i64,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub mq_maxmsg: i64,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub mq_msgsize: i64,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub mq_curmsgs: i64,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pad: [i64; 4],
+
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub mq_flags: ::c_long,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub mq_maxmsg: ::c_long,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub mq_msgsize: ::c_long,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub mq_curmsgs: ::c_long,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pad: [::c_long; 4],
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifr_ifru {
+        pub ifru_addr: ::sockaddr,
+        pub ifru_dstaddr: ::sockaddr,
+        pub ifru_broadaddr: ::sockaddr,
+        pub ifru_netmask: ::sockaddr,
+        pub ifru_hwaddr: ::sockaddr,
+        pub ifru_flags: ::c_short,
+        pub ifru_ifindex: ::c_int,
+        pub ifru_metric: ::c_int,
+        pub ifru_mtu: ::c_int,
+        pub ifru_map: __c_anonymous_ifru_map,
+        pub ifru_slave: [::c_char; ::IFNAMSIZ],
+        pub ifru_newname: [::c_char; ::IFNAMSIZ],
+        pub ifru_data: *mut ::c_char,
+    }
+
+    pub struct ifreq {
+        /// interface name, e.g. "en0"
+        pub ifr_name: [::c_char; ::IFNAMSIZ],
+        #[cfg(libc_union)]
+        pub ifr_ifru: __c_anonymous_ifr_ifru,
+        #[cfg(not(libc_union))]
+        pub ifr_ifru: ::sockaddr,
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifc_ifcu {
+        pub ifcu_buf: *mut ::c_char,
+        pub ifcu_req: *mut ::ifreq,
+    }
+
+    /*  Structure used in SIOCGIFCONF request.  Used to retrieve interface
+    configuration for machine (useful for programs which must know all
+    networks accessible).  */
+    pub struct ifconf {
+        pub ifc_len: ::c_int,       /* Size of buffer.  */
+        #[cfg(libc_union)]
+        pub ifc_ifcu: __c_anonymous_ifc_ifcu,
+        #[cfg(not(libc_union))]
+        pub ifc_ifcu: *mut ::ifreq,
+    }
+
+    pub struct hwtstamp_config {
+        pub flags: ::c_int,
+        pub tx_type: ::c_int,
+        pub rx_filter: ::c_int,
+    }
+
+    pub struct dirent64 {
+        pub d_ino: ::ino64_t,
+        pub d_off: ::off64_t,
+        pub d_reclen: ::c_ushort,
+        pub d_type: ::c_uchar,
+        pub d_name: [::c_char; 256],
+    }
+
+    pub struct sched_attr {
+        pub size: ::__u32,
+        pub sched_policy: ::__u32,
+        pub sched_flags: ::__u64,
+        pub sched_nice: ::__s32,
+        pub sched_priority: ::__u32,
+        pub sched_runtime: ::__u64,
+        pub sched_deadline: ::__u64,
+        pub sched_period: ::__u64,
+    }
+}
+
+s_no_extra_traits! {
+    // linux/net_tstamp.h
+    #[allow(missing_debug_implementations)]
+    pub struct sock_txtime {
+        pub clockid: ::clockid_t,
+        pub flags: ::__u32,
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        s_no_extra_traits! {
+            // linux/can.h
+            #[allow(missing_debug_implementations)]
+            pub union __c_anonymous_sockaddr_can_can_addr {
+                pub tp: __c_anonymous_sockaddr_can_tp,
+                pub j1939: __c_anonymous_sockaddr_can_j1939,
+            }
+
+            #[allow(missing_debug_implementations)]
+            pub struct sockaddr_can {
+                pub can_family: ::sa_family_t,
+                pub can_ifindex: ::c_int,
+                pub can_addr: __c_anonymous_sockaddr_can_can_addr,
+            }
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for sockaddr_nl {
+            fn eq(&self, other: &sockaddr_nl) -> bool {
+                self.nl_family == other.nl_family &&
+                    self.nl_pid == other.nl_pid &&
+                    self.nl_groups == other.nl_groups
+            }
+        }
+        impl Eq for sockaddr_nl {}
+        impl ::fmt::Debug for sockaddr_nl {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_nl")
+                    .field("nl_family", &self.nl_family)
+                    .field("nl_pid", &self.nl_pid)
+                    .field("nl_groups", &self.nl_groups)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sockaddr_nl {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.nl_family.hash(state);
+                self.nl_pid.hash(state);
+                self.nl_groups.hash(state);
+            }
+        }
+
+        impl PartialEq for dirent {
+            fn eq(&self, other: &dirent) -> bool {
+                self.d_ino == other.d_ino
+                    && self.d_off == other.d_off
+                    && self.d_reclen == other.d_reclen
+                    && self.d_type == other.d_type
+                    && self
+                    .d_name
+                    .iter()
+                    .zip(other.d_name.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for dirent {}
+
+        impl ::fmt::Debug for dirent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("dirent")
+                    .field("d_ino", &self.d_ino)
+                    .field("d_off", &self.d_off)
+                    .field("d_reclen", &self.d_reclen)
+                    .field("d_type", &self.d_type)
+                // FIXME: .field("d_name", &self.d_name)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for dirent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.d_ino.hash(state);
+                self.d_off.hash(state);
+                self.d_reclen.hash(state);
+                self.d_type.hash(state);
+                self.d_name.hash(state);
+            }
+        }
+
+        impl PartialEq for dirent64 {
+            fn eq(&self, other: &dirent64) -> bool {
+                self.d_ino == other.d_ino
+                    && self.d_off == other.d_off
+                    && self.d_reclen == other.d_reclen
+                    && self.d_type == other.d_type
+                    && self
+                    .d_name
+                    .iter()
+                    .zip(other.d_name.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for dirent64 {}
+
+        impl ::fmt::Debug for dirent64 {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("dirent64")
+                    .field("d_ino", &self.d_ino)
+                    .field("d_off", &self.d_off)
+                    .field("d_reclen", &self.d_reclen)
+                    .field("d_type", &self.d_type)
+                // FIXME: .field("d_name", &self.d_name)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for dirent64 {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.d_ino.hash(state);
+                self.d_off.hash(state);
+                self.d_reclen.hash(state);
+                self.d_type.hash(state);
+                self.d_name.hash(state);
+            }
+        }
+
+        impl PartialEq for pthread_cond_t {
+            fn eq(&self, other: &pthread_cond_t) -> bool {
+                self.size.iter().zip(other.size.iter()).all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for pthread_cond_t {}
+
+        impl ::fmt::Debug for pthread_cond_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("pthread_cond_t")
+                // FIXME: .field("size", &self.size)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for pthread_cond_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.size.hash(state);
+            }
+        }
+
+        impl PartialEq for pthread_mutex_t {
+            fn eq(&self, other: &pthread_mutex_t) -> bool {
+                self.size.iter().zip(other.size.iter()).all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for pthread_mutex_t {}
+
+        impl ::fmt::Debug for pthread_mutex_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("pthread_mutex_t")
+                // FIXME: .field("size", &self.size)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for pthread_mutex_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.size.hash(state);
+            }
+        }
+
+        impl PartialEq for pthread_rwlock_t {
+            fn eq(&self, other: &pthread_rwlock_t) -> bool {
+                self.size.iter().zip(other.size.iter()).all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for pthread_rwlock_t {}
+
+        impl ::fmt::Debug for pthread_rwlock_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("pthread_rwlock_t")
+                // FIXME: .field("size", &self.size)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for pthread_rwlock_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.size.hash(state);
+            }
+        }
+
+        impl PartialEq for pthread_barrier_t {
+            fn eq(&self, other: &pthread_barrier_t) -> bool {
+                self.size.iter().zip(other.size.iter()).all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for pthread_barrier_t {}
+
+        impl ::fmt::Debug for pthread_barrier_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("pthread_barrier_t")
+                    .field("size", &self.size)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for pthread_barrier_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.size.hash(state);
+            }
+        }
+
+        impl PartialEq for sockaddr_alg {
+            fn eq(&self, other: &sockaddr_alg) -> bool {
+                self.salg_family == other.salg_family
+                    && self
+                    .salg_type
+                    .iter()
+                    .zip(other.salg_type.iter())
+                    .all(|(a, b)| a == b)
+                    && self.salg_feat == other.salg_feat
+                    && self.salg_mask == other.salg_mask
+                    && self
+                    .salg_name
+                    .iter()
+                    .zip(other.salg_name.iter())
+                    .all(|(a, b)| a == b)
+           }
+        }
+
+        impl Eq for sockaddr_alg {}
+
+        impl ::fmt::Debug for sockaddr_alg {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_alg")
+                    .field("salg_family", &self.salg_family)
+                    .field("salg_type", &self.salg_type)
+                    .field("salg_feat", &self.salg_feat)
+                    .field("salg_mask", &self.salg_mask)
+                    .field("salg_name", &&self.salg_name[..])
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for sockaddr_alg {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.salg_family.hash(state);
+                self.salg_type.hash(state);
+                self.salg_feat.hash(state);
+                self.salg_mask.hash(state);
+                self.salg_name.hash(state);
+            }
+        }
+
+        impl PartialEq for uinput_setup {
+            fn eq(&self, other: &uinput_setup) -> bool {
+                self.id == other.id
+                    && self.name[..] == other.name[..]
+                    && self.ff_effects_max == other.ff_effects_max
+           }
+        }
+        impl Eq for uinput_setup {}
+
+        impl ::fmt::Debug for uinput_setup {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("uinput_setup")
+                    .field("id", &self.id)
+                    .field("name", &&self.name[..])
+                    .field("ff_effects_max", &self.ff_effects_max)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for uinput_setup {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.id.hash(state);
+                self.name.hash(state);
+                self.ff_effects_max.hash(state);
+            }
+        }
+
+        impl PartialEq for uinput_user_dev {
+            fn eq(&self, other: &uinput_user_dev) -> bool {
+                 self.name[..] == other.name[..]
+                    && self.id == other.id
+                    && self.ff_effects_max == other.ff_effects_max
+                    && self.absmax[..] == other.absmax[..]
+                    && self.absmin[..] == other.absmin[..]
+                    && self.absfuzz[..] == other.absfuzz[..]
+                    && self.absflat[..] == other.absflat[..]
+           }
+        }
+        impl Eq for uinput_user_dev {}
+
+        impl ::fmt::Debug for uinput_user_dev {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("uinput_setup")
+                    .field("name", &&self.name[..])
+                    .field("id", &self.id)
+                    .field("ff_effects_max", &self.ff_effects_max)
+                    .field("absmax", &&self.absmax[..])
+                    .field("absmin", &&self.absmin[..])
+                    .field("absfuzz", &&self.absfuzz[..])
+                    .field("absflat", &&self.absflat[..])
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for uinput_user_dev {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.name.hash(state);
+                self.id.hash(state);
+                self.ff_effects_max.hash(state);
+                self.absmax.hash(state);
+                self.absmin.hash(state);
+                self.absfuzz.hash(state);
+                self.absflat.hash(state);
+            }
+        }
+
+        #[allow(deprecated)]
+        impl af_alg_iv {
+            fn as_slice(&self) -> &[u8] {
+                unsafe {
+                    ::core::slice::from_raw_parts(
+                        self.iv.as_ptr(),
+                        self.ivlen as usize
+                    )
+                }
+            }
+        }
+
+        #[allow(deprecated)]
+        impl PartialEq for af_alg_iv {
+            fn eq(&self, other: &af_alg_iv) -> bool {
+                *self.as_slice() == *other.as_slice()
+           }
+        }
+
+        #[allow(deprecated)]
+        impl Eq for af_alg_iv {}
+
+        #[allow(deprecated)]
+        impl ::fmt::Debug for af_alg_iv {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("af_alg_iv")
+                    .field("ivlen", &self.ivlen)
+                    .finish()
+            }
+        }
+
+        #[allow(deprecated)]
+        impl ::hash::Hash for af_alg_iv {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.as_slice().hash(state);
+            }
+        }
+
+        impl PartialEq for mq_attr {
+            fn eq(&self, other: &mq_attr) -> bool {
+                self.mq_flags == other.mq_flags &&
+                self.mq_maxmsg == other.mq_maxmsg &&
+                self.mq_msgsize == other.mq_msgsize &&
+                self.mq_curmsgs == other.mq_curmsgs
+            }
+        }
+        impl Eq for mq_attr {}
+        impl ::fmt::Debug for mq_attr {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("mq_attr")
+                    .field("mq_flags", &self.mq_flags)
+                    .field("mq_maxmsg", &self.mq_maxmsg)
+                    .field("mq_msgsize", &self.mq_msgsize)
+                    .field("mq_curmsgs", &self.mq_curmsgs)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for mq_attr {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.mq_flags.hash(state);
+                self.mq_maxmsg.hash(state);
+                self.mq_msgsize.hash(state);
+                self.mq_curmsgs.hash(state);
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifr_ifru {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifr_ifru")
+                    .field("ifru_addr", unsafe { &self.ifru_addr })
+                    .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr })
+                    .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr })
+                    .field("ifru_netmask", unsafe { &self.ifru_netmask })
+                    .field("ifru_hwaddr", unsafe { &self.ifru_hwaddr })
+                    .field("ifru_flags", unsafe { &self.ifru_flags })
+                    .field("ifru_ifindex", unsafe { &self.ifru_ifindex })
+                    .field("ifru_metric", unsafe { &self.ifru_metric })
+                    .field("ifru_mtu", unsafe { &self.ifru_mtu })
+                    .field("ifru_map", unsafe { &self.ifru_map })
+                    .field("ifru_slave", unsafe { &self.ifru_slave })
+                    .field("ifru_newname", unsafe { &self.ifru_newname })
+                    .field("ifru_data", unsafe { &self.ifru_data })
+                    .finish()
+            }
+        }
+        impl ::fmt::Debug for ifreq {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifreq")
+                    .field("ifr_name", &self.ifr_name)
+                    .field("ifr_ifru", &self.ifr_ifru)
+                    .finish()
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifc_ifcu {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifr_ifru")
+                    .field("ifcu_buf", unsafe { &self.ifcu_buf })
+                    .field("ifcu_req", unsafe { &self.ifcu_req })
+                    .finish()
+            }
+        }
+        impl ::fmt::Debug for ifconf {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifconf")
+                    .field("ifc_len", &self.ifc_len)
+                    .field("ifc_ifcu", &self.ifc_ifcu)
+                    .finish()
+            }
+        }
+        impl ::fmt::Debug for hwtstamp_config {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("hwtstamp_config")
+                    .field("flags", &self.flags)
+                    .field("tx_type", &self.tx_type)
+                    .field("rx_filter", &self.rx_filter)
+                    .finish()
+            }
+        }
+        impl PartialEq for hwtstamp_config {
+            fn eq(&self, other: &hwtstamp_config) -> bool {
+                self.flags == other.flags &&
+                self.tx_type == other.tx_type &&
+                self.rx_filter == other.rx_filter
+            }
+        }
+        impl Eq for hwtstamp_config {}
+        impl ::hash::Hash for hwtstamp_config {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.flags.hash(state);
+                self.tx_type.hash(state);
+                self.rx_filter.hash(state);
+            }
+        }
+
+        impl ::fmt::Debug for sched_attr {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sched_attr")
+                    .field("size", &self.size)
+                    .field("sched_policy", &self.sched_policy)
+                    .field("sched_flags", &self.sched_flags)
+                    .field("sched_nice", &self.sched_nice)
+                    .field("sched_priority", &self.sched_priority)
+                    .field("sched_runtime", &self.sched_runtime)
+                    .field("sched_deadline", &self.sched_deadline)
+                    .field("sched_period", &self.sched_period)
+                    .finish()
+            }
+        }
+        impl PartialEq for sched_attr {
+            fn eq(&self, other: &sched_attr) -> bool {
+                self.size == other.size &&
+                self.sched_policy == other.sched_policy &&
+                self.sched_flags == other.sched_flags &&
+                self.sched_nice == other.sched_nice &&
+                self.sched_priority == other.sched_priority &&
+                self.sched_runtime == other.sched_runtime &&
+                self.sched_deadline == other.sched_deadline &&
+                self.sched_period == other.sched_period
+            }
+        }
+        impl Eq for sched_attr {}
+        impl ::hash::Hash for sched_attr {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.size.hash(state);
+                self.sched_policy.hash(state);
+                self.sched_flags.hash(state);
+                self.sched_nice.hash(state);
+                self.sched_priority.hash(state);
+                self.sched_runtime.hash(state);
+                self.sched_deadline.hash(state);
+                self.sched_period.hash(state);
+            }
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(target_env = "gnu", target_env = "musl", target_env = "ohos"))] {
+        pub const ABDAY_1: ::nl_item = 0x20000;
+        pub const ABDAY_2: ::nl_item = 0x20001;
+        pub const ABDAY_3: ::nl_item = 0x20002;
+        pub const ABDAY_4: ::nl_item = 0x20003;
+        pub const ABDAY_5: ::nl_item = 0x20004;
+        pub const ABDAY_6: ::nl_item = 0x20005;
+        pub const ABDAY_7: ::nl_item = 0x20006;
+
+        pub const DAY_1: ::nl_item = 0x20007;
+        pub const DAY_2: ::nl_item = 0x20008;
+        pub const DAY_3: ::nl_item = 0x20009;
+        pub const DAY_4: ::nl_item = 0x2000A;
+        pub const DAY_5: ::nl_item = 0x2000B;
+        pub const DAY_6: ::nl_item = 0x2000C;
+        pub const DAY_7: ::nl_item = 0x2000D;
+
+        pub const ABMON_1: ::nl_item = 0x2000E;
+        pub const ABMON_2: ::nl_item = 0x2000F;
+        pub const ABMON_3: ::nl_item = 0x20010;
+        pub const ABMON_4: ::nl_item = 0x20011;
+        pub const ABMON_5: ::nl_item = 0x20012;
+        pub const ABMON_6: ::nl_item = 0x20013;
+        pub const ABMON_7: ::nl_item = 0x20014;
+        pub const ABMON_8: ::nl_item = 0x20015;
+        pub const ABMON_9: ::nl_item = 0x20016;
+        pub const ABMON_10: ::nl_item = 0x20017;
+        pub const ABMON_11: ::nl_item = 0x20018;
+        pub const ABMON_12: ::nl_item = 0x20019;
+
+        pub const MON_1: ::nl_item = 0x2001A;
+        pub const MON_2: ::nl_item = 0x2001B;
+        pub const MON_3: ::nl_item = 0x2001C;
+        pub const MON_4: ::nl_item = 0x2001D;
+        pub const MON_5: ::nl_item = 0x2001E;
+        pub const MON_6: ::nl_item = 0x2001F;
+        pub const MON_7: ::nl_item = 0x20020;
+        pub const MON_8: ::nl_item = 0x20021;
+        pub const MON_9: ::nl_item = 0x20022;
+        pub const MON_10: ::nl_item = 0x20023;
+        pub const MON_11: ::nl_item = 0x20024;
+        pub const MON_12: ::nl_item = 0x20025;
+
+        pub const AM_STR: ::nl_item = 0x20026;
+        pub const PM_STR: ::nl_item = 0x20027;
+
+        pub const D_T_FMT: ::nl_item = 0x20028;
+        pub const D_FMT: ::nl_item = 0x20029;
+        pub const T_FMT: ::nl_item = 0x2002A;
+        pub const T_FMT_AMPM: ::nl_item = 0x2002B;
+
+        pub const ERA: ::nl_item = 0x2002C;
+        pub const ERA_D_FMT: ::nl_item = 0x2002E;
+        pub const ALT_DIGITS: ::nl_item = 0x2002F;
+        pub const ERA_D_T_FMT: ::nl_item = 0x20030;
+        pub const ERA_T_FMT: ::nl_item = 0x20031;
+
+        pub const CODESET: ::nl_item = 14;
+        pub const CRNCYSTR: ::nl_item = 0x4000F;
+        pub const RADIXCHAR: ::nl_item = 0x10000;
+        pub const THOUSEP: ::nl_item = 0x10001;
+        pub const YESEXPR: ::nl_item = 0x50000;
+        pub const NOEXPR: ::nl_item = 0x50001;
+        pub const YESSTR: ::nl_item = 0x50002;
+        pub const NOSTR: ::nl_item = 0x50003;
+    }
+}
+
+pub const RUSAGE_CHILDREN: ::c_int = -1;
+pub const L_tmpnam: ::c_uint = 20;
+pub const _PC_LINK_MAX: ::c_int = 0;
+pub const _PC_MAX_CANON: ::c_int = 1;
+pub const _PC_MAX_INPUT: ::c_int = 2;
+pub const _PC_NAME_MAX: ::c_int = 3;
+pub const _PC_PATH_MAX: ::c_int = 4;
+pub const _PC_PIPE_BUF: ::c_int = 5;
+pub const _PC_CHOWN_RESTRICTED: ::c_int = 6;
+pub const _PC_NO_TRUNC: ::c_int = 7;
+pub const _PC_VDISABLE: ::c_int = 8;
+pub const _PC_SYNC_IO: ::c_int = 9;
+pub const _PC_ASYNC_IO: ::c_int = 10;
+pub const _PC_PRIO_IO: ::c_int = 11;
+pub const _PC_SOCK_MAXBUF: ::c_int = 12;
+pub const _PC_FILESIZEBITS: ::c_int = 13;
+pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14;
+pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15;
+pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16;
+pub const _PC_REC_XFER_ALIGN: ::c_int = 17;
+pub const _PC_ALLOC_SIZE_MIN: ::c_int = 18;
+pub const _PC_SYMLINK_MAX: ::c_int = 19;
+pub const _PC_2_SYMLINKS: ::c_int = 20;
+
+pub const MS_NOUSER: ::c_ulong = 0xffffffff80000000;
+
+pub const _SC_ARG_MAX: ::c_int = 0;
+pub const _SC_CHILD_MAX: ::c_int = 1;
+pub const _SC_CLK_TCK: ::c_int = 2;
+pub const _SC_NGROUPS_MAX: ::c_int = 3;
+pub const _SC_OPEN_MAX: ::c_int = 4;
+pub const _SC_STREAM_MAX: ::c_int = 5;
+pub const _SC_TZNAME_MAX: ::c_int = 6;
+pub const _SC_JOB_CONTROL: ::c_int = 7;
+pub const _SC_SAVED_IDS: ::c_int = 8;
+pub const _SC_REALTIME_SIGNALS: ::c_int = 9;
+pub const _SC_PRIORITY_SCHEDULING: ::c_int = 10;
+pub const _SC_TIMERS: ::c_int = 11;
+pub const _SC_ASYNCHRONOUS_IO: ::c_int = 12;
+pub const _SC_PRIORITIZED_IO: ::c_int = 13;
+pub const _SC_SYNCHRONIZED_IO: ::c_int = 14;
+pub const _SC_FSYNC: ::c_int = 15;
+pub const _SC_MAPPED_FILES: ::c_int = 16;
+pub const _SC_MEMLOCK: ::c_int = 17;
+pub const _SC_MEMLOCK_RANGE: ::c_int = 18;
+pub const _SC_MEMORY_PROTECTION: ::c_int = 19;
+pub const _SC_MESSAGE_PASSING: ::c_int = 20;
+pub const _SC_SEMAPHORES: ::c_int = 21;
+pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 22;
+pub const _SC_AIO_LISTIO_MAX: ::c_int = 23;
+pub const _SC_AIO_MAX: ::c_int = 24;
+pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 25;
+pub const _SC_DELAYTIMER_MAX: ::c_int = 26;
+pub const _SC_MQ_OPEN_MAX: ::c_int = 27;
+pub const _SC_MQ_PRIO_MAX: ::c_int = 28;
+pub const _SC_VERSION: ::c_int = 29;
+pub const _SC_PAGESIZE: ::c_int = 30;
+pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
+pub const _SC_RTSIG_MAX: ::c_int = 31;
+pub const _SC_SEM_NSEMS_MAX: ::c_int = 32;
+pub const _SC_SEM_VALUE_MAX: ::c_int = 33;
+pub const _SC_SIGQUEUE_MAX: ::c_int = 34;
+pub const _SC_TIMER_MAX: ::c_int = 35;
+pub const _SC_BC_BASE_MAX: ::c_int = 36;
+pub const _SC_BC_DIM_MAX: ::c_int = 37;
+pub const _SC_BC_SCALE_MAX: ::c_int = 38;
+pub const _SC_BC_STRING_MAX: ::c_int = 39;
+pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 40;
+pub const _SC_EXPR_NEST_MAX: ::c_int = 42;
+pub const _SC_LINE_MAX: ::c_int = 43;
+pub const _SC_RE_DUP_MAX: ::c_int = 44;
+pub const _SC_2_VERSION: ::c_int = 46;
+pub const _SC_2_C_BIND: ::c_int = 47;
+pub const _SC_2_C_DEV: ::c_int = 48;
+pub const _SC_2_FORT_DEV: ::c_int = 49;
+pub const _SC_2_FORT_RUN: ::c_int = 50;
+pub const _SC_2_SW_DEV: ::c_int = 51;
+pub const _SC_2_LOCALEDEF: ::c_int = 52;
+pub const _SC_UIO_MAXIOV: ::c_int = 60;
+pub const _SC_IOV_MAX: ::c_int = 60;
+pub const _SC_THREADS: ::c_int = 67;
+pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 68;
+pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 69;
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 70;
+pub const _SC_LOGIN_NAME_MAX: ::c_int = 71;
+pub const _SC_TTY_NAME_MAX: ::c_int = 72;
+pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 73;
+pub const _SC_THREAD_KEYS_MAX: ::c_int = 74;
+pub const _SC_THREAD_STACK_MIN: ::c_int = 75;
+pub const _SC_THREAD_THREADS_MAX: ::c_int = 76;
+pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77;
+pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78;
+pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 79;
+pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 80;
+pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 81;
+pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 82;
+pub const _SC_NPROCESSORS_CONF: ::c_int = 83;
+pub const _SC_NPROCESSORS_ONLN: ::c_int = 84;
+pub const _SC_PHYS_PAGES: ::c_int = 85;
+pub const _SC_AVPHYS_PAGES: ::c_int = 86;
+pub const _SC_ATEXIT_MAX: ::c_int = 87;
+pub const _SC_PASS_MAX: ::c_int = 88;
+pub const _SC_XOPEN_VERSION: ::c_int = 89;
+pub const _SC_XOPEN_XCU_VERSION: ::c_int = 90;
+pub const _SC_XOPEN_UNIX: ::c_int = 91;
+pub const _SC_XOPEN_CRYPT: ::c_int = 92;
+pub const _SC_XOPEN_ENH_I18N: ::c_int = 93;
+pub const _SC_XOPEN_SHM: ::c_int = 94;
+pub const _SC_2_CHAR_TERM: ::c_int = 95;
+pub const _SC_2_UPE: ::c_int = 97;
+pub const _SC_XOPEN_XPG2: ::c_int = 98;
+pub const _SC_XOPEN_XPG3: ::c_int = 99;
+pub const _SC_XOPEN_XPG4: ::c_int = 100;
+pub const _SC_NZERO: ::c_int = 109;
+pub const _SC_XBS5_ILP32_OFF32: ::c_int = 125;
+pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 126;
+pub const _SC_XBS5_LP64_OFF64: ::c_int = 127;
+pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 128;
+pub const _SC_XOPEN_LEGACY: ::c_int = 129;
+pub const _SC_XOPEN_REALTIME: ::c_int = 130;
+pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 131;
+pub const _SC_ADVISORY_INFO: ::c_int = 132;
+pub const _SC_BARRIERS: ::c_int = 133;
+pub const _SC_CLOCK_SELECTION: ::c_int = 137;
+pub const _SC_CPUTIME: ::c_int = 138;
+pub const _SC_THREAD_CPUTIME: ::c_int = 139;
+pub const _SC_MONOTONIC_CLOCK: ::c_int = 149;
+pub const _SC_READER_WRITER_LOCKS: ::c_int = 153;
+pub const _SC_SPIN_LOCKS: ::c_int = 154;
+pub const _SC_REGEXP: ::c_int = 155;
+pub const _SC_SHELL: ::c_int = 157;
+pub const _SC_SPAWN: ::c_int = 159;
+pub const _SC_SPORADIC_SERVER: ::c_int = 160;
+pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 161;
+pub const _SC_TIMEOUTS: ::c_int = 164;
+pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 165;
+pub const _SC_2_PBS: ::c_int = 168;
+pub const _SC_2_PBS_ACCOUNTING: ::c_int = 169;
+pub const _SC_2_PBS_LOCATE: ::c_int = 170;
+pub const _SC_2_PBS_MESSAGE: ::c_int = 171;
+pub const _SC_2_PBS_TRACK: ::c_int = 172;
+pub const _SC_SYMLOOP_MAX: ::c_int = 173;
+pub const _SC_STREAMS: ::c_int = 174;
+pub const _SC_2_PBS_CHECKPOINT: ::c_int = 175;
+pub const _SC_V6_ILP32_OFF32: ::c_int = 176;
+pub const _SC_V6_ILP32_OFFBIG: ::c_int = 177;
+pub const _SC_V6_LP64_OFF64: ::c_int = 178;
+pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 179;
+pub const _SC_HOST_NAME_MAX: ::c_int = 180;
+pub const _SC_TRACE: ::c_int = 181;
+pub const _SC_TRACE_EVENT_FILTER: ::c_int = 182;
+pub const _SC_TRACE_INHERIT: ::c_int = 183;
+pub const _SC_TRACE_LOG: ::c_int = 184;
+pub const _SC_IPV6: ::c_int = 235;
+pub const _SC_RAW_SOCKETS: ::c_int = 236;
+pub const _SC_V7_ILP32_OFF32: ::c_int = 237;
+pub const _SC_V7_ILP32_OFFBIG: ::c_int = 238;
+pub const _SC_V7_LP64_OFF64: ::c_int = 239;
+pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 240;
+pub const _SC_SS_REPL_MAX: ::c_int = 241;
+pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 242;
+pub const _SC_TRACE_NAME_MAX: ::c_int = 243;
+pub const _SC_TRACE_SYS_MAX: ::c_int = 244;
+pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 245;
+pub const _SC_XOPEN_STREAMS: ::c_int = 246;
+pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 247;
+pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 248;
+
+pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY;
+pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY;
+
+// elf.h - Fields in the e_ident array.
+pub const EI_NIDENT: usize = 16;
+
+pub const EI_MAG0: usize = 0;
+pub const ELFMAG0: u8 = 0x7f;
+pub const EI_MAG1: usize = 1;
+pub const ELFMAG1: u8 = b'E';
+pub const EI_MAG2: usize = 2;
+pub const ELFMAG2: u8 = b'L';
+pub const EI_MAG3: usize = 3;
+pub const ELFMAG3: u8 = b'F';
+pub const SELFMAG: usize = 4;
+
+pub const EI_CLASS: usize = 4;
+pub const ELFCLASSNONE: u8 = 0;
+pub const ELFCLASS32: u8 = 1;
+pub const ELFCLASS64: u8 = 2;
+pub const ELFCLASSNUM: usize = 3;
+
+pub const EI_DATA: usize = 5;
+pub const ELFDATANONE: u8 = 0;
+pub const ELFDATA2LSB: u8 = 1;
+pub const ELFDATA2MSB: u8 = 2;
+pub const ELFDATANUM: usize = 3;
+
+pub const EI_VERSION: usize = 6;
+
+pub const EI_OSABI: usize = 7;
+pub const ELFOSABI_NONE: u8 = 0;
+pub const ELFOSABI_SYSV: u8 = 0;
+pub const ELFOSABI_HPUX: u8 = 1;
+pub const ELFOSABI_NETBSD: u8 = 2;
+pub const ELFOSABI_GNU: u8 = 3;
+pub const ELFOSABI_LINUX: u8 = ELFOSABI_GNU;
+pub const ELFOSABI_SOLARIS: u8 = 6;
+pub const ELFOSABI_AIX: u8 = 7;
+pub const ELFOSABI_IRIX: u8 = 8;
+pub const ELFOSABI_FREEBSD: u8 = 9;
+pub const ELFOSABI_TRU64: u8 = 10;
+pub const ELFOSABI_MODESTO: u8 = 11;
+pub const ELFOSABI_OPENBSD: u8 = 12;
+pub const ELFOSABI_ARM: u8 = 97;
+pub const ELFOSABI_STANDALONE: u8 = 255;
+
+pub const EI_ABIVERSION: usize = 8;
+
+pub const EI_PAD: usize = 9;
+
+// elf.h - Legal values for e_type (object file type).
+pub const ET_NONE: u16 = 0;
+pub const ET_REL: u16 = 1;
+pub const ET_EXEC: u16 = 2;
+pub const ET_DYN: u16 = 3;
+pub const ET_CORE: u16 = 4;
+pub const ET_NUM: u16 = 5;
+pub const ET_LOOS: u16 = 0xfe00;
+pub const ET_HIOS: u16 = 0xfeff;
+pub const ET_LOPROC: u16 = 0xff00;
+pub const ET_HIPROC: u16 = 0xffff;
+
+// elf.h - Legal values for e_machine (architecture).
+pub const EM_NONE: u16 = 0;
+pub const EM_M32: u16 = 1;
+pub const EM_SPARC: u16 = 2;
+pub const EM_386: u16 = 3;
+pub const EM_68K: u16 = 4;
+pub const EM_88K: u16 = 5;
+pub const EM_860: u16 = 7;
+pub const EM_MIPS: u16 = 8;
+pub const EM_S370: u16 = 9;
+pub const EM_MIPS_RS3_LE: u16 = 10;
+pub const EM_PARISC: u16 = 15;
+pub const EM_VPP500: u16 = 17;
+pub const EM_SPARC32PLUS: u16 = 18;
+pub const EM_960: u16 = 19;
+pub const EM_PPC: u16 = 20;
+pub const EM_PPC64: u16 = 21;
+pub const EM_S390: u16 = 22;
+pub const EM_V800: u16 = 36;
+pub const EM_FR20: u16 = 37;
+pub const EM_RH32: u16 = 38;
+pub const EM_RCE: u16 = 39;
+pub const EM_ARM: u16 = 40;
+pub const EM_FAKE_ALPHA: u16 = 41;
+pub const EM_SH: u16 = 42;
+pub const EM_SPARCV9: u16 = 43;
+pub const EM_TRICORE: u16 = 44;
+pub const EM_ARC: u16 = 45;
+pub const EM_H8_300: u16 = 46;
+pub const EM_H8_300H: u16 = 47;
+pub const EM_H8S: u16 = 48;
+pub const EM_H8_500: u16 = 49;
+pub const EM_IA_64: u16 = 50;
+pub const EM_MIPS_X: u16 = 51;
+pub const EM_COLDFIRE: u16 = 52;
+pub const EM_68HC12: u16 = 53;
+pub const EM_MMA: u16 = 54;
+pub const EM_PCP: u16 = 55;
+pub const EM_NCPU: u16 = 56;
+pub const EM_NDR1: u16 = 57;
+pub const EM_STARCORE: u16 = 58;
+pub const EM_ME16: u16 = 59;
+pub const EM_ST100: u16 = 60;
+pub const EM_TINYJ: u16 = 61;
+pub const EM_X86_64: u16 = 62;
+pub const EM_PDSP: u16 = 63;
+pub const EM_FX66: u16 = 66;
+pub const EM_ST9PLUS: u16 = 67;
+pub const EM_ST7: u16 = 68;
+pub const EM_68HC16: u16 = 69;
+pub const EM_68HC11: u16 = 70;
+pub const EM_68HC08: u16 = 71;
+pub const EM_68HC05: u16 = 72;
+pub const EM_SVX: u16 = 73;
+pub const EM_ST19: u16 = 74;
+pub const EM_VAX: u16 = 75;
+pub const EM_CRIS: u16 = 76;
+pub const EM_JAVELIN: u16 = 77;
+pub const EM_FIREPATH: u16 = 78;
+pub const EM_ZSP: u16 = 79;
+pub const EM_MMIX: u16 = 80;
+pub const EM_HUANY: u16 = 81;
+pub const EM_PRISM: u16 = 82;
+pub const EM_AVR: u16 = 83;
+pub const EM_FR30: u16 = 84;
+pub const EM_D10V: u16 = 85;
+pub const EM_D30V: u16 = 86;
+pub const EM_V850: u16 = 87;
+pub const EM_M32R: u16 = 88;
+pub const EM_MN10300: u16 = 89;
+pub const EM_MN10200: u16 = 90;
+pub const EM_PJ: u16 = 91;
+pub const EM_OPENRISC: u16 = 92;
+pub const EM_ARC_A5: u16 = 93;
+pub const EM_XTENSA: u16 = 94;
+pub const EM_AARCH64: u16 = 183;
+pub const EM_TILEPRO: u16 = 188;
+pub const EM_TILEGX: u16 = 191;
+pub const EM_ALPHA: u16 = 0x9026;
+
+// elf.h - Legal values for e_version (version).
+pub const EV_NONE: u32 = 0;
+pub const EV_CURRENT: u32 = 1;
+pub const EV_NUM: u32 = 2;
+
+// elf.h - Legal values for p_type (segment type).
+pub const PT_NULL: u32 = 0;
+pub const PT_LOAD: u32 = 1;
+pub const PT_DYNAMIC: u32 = 2;
+pub const PT_INTERP: u32 = 3;
+pub const PT_NOTE: u32 = 4;
+pub const PT_SHLIB: u32 = 5;
+pub const PT_PHDR: u32 = 6;
+pub const PT_TLS: u32 = 7;
+pub const PT_NUM: u32 = 8;
+pub const PT_LOOS: u32 = 0x60000000;
+pub const PT_GNU_EH_FRAME: u32 = 0x6474e550;
+pub const PT_GNU_STACK: u32 = 0x6474e551;
+pub const PT_GNU_RELRO: u32 = 0x6474e552;
+pub const PT_LOSUNW: u32 = 0x6ffffffa;
+pub const PT_SUNWBSS: u32 = 0x6ffffffa;
+pub const PT_SUNWSTACK: u32 = 0x6ffffffb;
+pub const PT_HISUNW: u32 = 0x6fffffff;
+pub const PT_HIOS: u32 = 0x6fffffff;
+pub const PT_LOPROC: u32 = 0x70000000;
+pub const PT_HIPROC: u32 = 0x7fffffff;
+
+// Legal values for p_flags (segment flags).
+pub const PF_X: u32 = 1 << 0;
+pub const PF_W: u32 = 1 << 1;
+pub const PF_R: u32 = 1 << 2;
+pub const PF_MASKOS: u32 = 0x0ff00000;
+pub const PF_MASKPROC: u32 = 0xf0000000;
+
+// elf.h - Legal values for a_type (entry type).
+pub const AT_NULL: ::c_ulong = 0;
+pub const AT_IGNORE: ::c_ulong = 1;
+pub const AT_EXECFD: ::c_ulong = 2;
+pub const AT_PHDR: ::c_ulong = 3;
+pub const AT_PHENT: ::c_ulong = 4;
+pub const AT_PHNUM: ::c_ulong = 5;
+pub const AT_PAGESZ: ::c_ulong = 6;
+pub const AT_BASE: ::c_ulong = 7;
+pub const AT_FLAGS: ::c_ulong = 8;
+pub const AT_ENTRY: ::c_ulong = 9;
+pub const AT_NOTELF: ::c_ulong = 10;
+pub const AT_UID: ::c_ulong = 11;
+pub const AT_EUID: ::c_ulong = 12;
+pub const AT_GID: ::c_ulong = 13;
+pub const AT_EGID: ::c_ulong = 14;
+pub const AT_PLATFORM: ::c_ulong = 15;
+pub const AT_HWCAP: ::c_ulong = 16;
+pub const AT_CLKTCK: ::c_ulong = 17;
+
+pub const AT_SECURE: ::c_ulong = 23;
+pub const AT_BASE_PLATFORM: ::c_ulong = 24;
+pub const AT_RANDOM: ::c_ulong = 25;
+pub const AT_HWCAP2: ::c_ulong = 26;
+
+pub const AT_EXECFN: ::c_ulong = 31;
+
+// defined in arch/<arch>/include/uapi/asm/auxvec.h but has the same value
+// wherever it is defined.
+pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
+pub const AT_MINSIGSTKSZ: ::c_ulong = 51;
+
+pub const GLOB_ERR: ::c_int = 1 << 0;
+pub const GLOB_MARK: ::c_int = 1 << 1;
+pub const GLOB_NOSORT: ::c_int = 1 << 2;
+pub const GLOB_DOOFFS: ::c_int = 1 << 3;
+pub const GLOB_NOCHECK: ::c_int = 1 << 4;
+pub const GLOB_APPEND: ::c_int = 1 << 5;
+pub const GLOB_NOESCAPE: ::c_int = 1 << 6;
+
+pub const GLOB_NOSPACE: ::c_int = 1;
+pub const GLOB_ABORTED: ::c_int = 2;
+pub const GLOB_NOMATCH: ::c_int = 3;
+
+pub const POSIX_MADV_NORMAL: ::c_int = 0;
+pub const POSIX_MADV_RANDOM: ::c_int = 1;
+pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
+pub const POSIX_MADV_WILLNEED: ::c_int = 3;
+pub const POSIX_SPAWN_USEVFORK: ::c_int = 64;
+pub const POSIX_SPAWN_SETSID: ::c_int = 128;
+
+pub const S_IEXEC: mode_t = 64;
+pub const S_IWRITE: mode_t = 128;
+pub const S_IREAD: mode_t = 256;
+
+pub const F_LOCK: ::c_int = 1;
+pub const F_TEST: ::c_int = 3;
+pub const F_TLOCK: ::c_int = 2;
+pub const F_ULOCK: ::c_int = 0;
+
+pub const F_SEAL_FUTURE_WRITE: ::c_int = 0x0010;
+
+pub const IFF_LOWER_UP: ::c_int = 0x10000;
+pub const IFF_DORMANT: ::c_int = 0x20000;
+pub const IFF_ECHO: ::c_int = 0x40000;
+
+// linux/if_addr.h
+pub const IFA_UNSPEC: ::c_ushort = 0;
+pub const IFA_ADDRESS: ::c_ushort = 1;
+pub const IFA_LOCAL: ::c_ushort = 2;
+pub const IFA_LABEL: ::c_ushort = 3;
+pub const IFA_BROADCAST: ::c_ushort = 4;
+pub const IFA_ANYCAST: ::c_ushort = 5;
+pub const IFA_CACHEINFO: ::c_ushort = 6;
+pub const IFA_MULTICAST: ::c_ushort = 7;
+
+pub const IFA_F_SECONDARY: u32 = 0x01;
+pub const IFA_F_TEMPORARY: u32 = 0x01;
+pub const IFA_F_NODAD: u32 = 0x02;
+pub const IFA_F_OPTIMISTIC: u32 = 0x04;
+pub const IFA_F_DADFAILED: u32 = 0x08;
+pub const IFA_F_HOMEADDRESS: u32 = 0x10;
+pub const IFA_F_DEPRECATED: u32 = 0x20;
+pub const IFA_F_TENTATIVE: u32 = 0x40;
+pub const IFA_F_PERMANENT: u32 = 0x80;
+
+// linux/if_link.h
+pub const IFLA_UNSPEC: ::c_ushort = 0;
+pub const IFLA_ADDRESS: ::c_ushort = 1;
+pub const IFLA_BROADCAST: ::c_ushort = 2;
+pub const IFLA_IFNAME: ::c_ushort = 3;
+pub const IFLA_MTU: ::c_ushort = 4;
+pub const IFLA_LINK: ::c_ushort = 5;
+pub const IFLA_QDISC: ::c_ushort = 6;
+pub const IFLA_STATS: ::c_ushort = 7;
+pub const IFLA_COST: ::c_ushort = 8;
+pub const IFLA_PRIORITY: ::c_ushort = 9;
+pub const IFLA_MASTER: ::c_ushort = 10;
+pub const IFLA_WIRELESS: ::c_ushort = 11;
+pub const IFLA_PROTINFO: ::c_ushort = 12;
+pub const IFLA_TXQLEN: ::c_ushort = 13;
+pub const IFLA_MAP: ::c_ushort = 14;
+pub const IFLA_WEIGHT: ::c_ushort = 15;
+pub const IFLA_OPERSTATE: ::c_ushort = 16;
+pub const IFLA_LINKMODE: ::c_ushort = 17;
+pub const IFLA_LINKINFO: ::c_ushort = 18;
+pub const IFLA_NET_NS_PID: ::c_ushort = 19;
+pub const IFLA_IFALIAS: ::c_ushort = 20;
+pub const IFLA_NUM_VF: ::c_ushort = 21;
+pub const IFLA_VFINFO_LIST: ::c_ushort = 22;
+pub const IFLA_STATS64: ::c_ushort = 23;
+pub const IFLA_VF_PORTS: ::c_ushort = 24;
+pub const IFLA_PORT_SELF: ::c_ushort = 25;
+pub const IFLA_AF_SPEC: ::c_ushort = 26;
+pub const IFLA_GROUP: ::c_ushort = 27;
+pub const IFLA_NET_NS_FD: ::c_ushort = 28;
+pub const IFLA_EXT_MASK: ::c_ushort = 29;
+pub const IFLA_PROMISCUITY: ::c_ushort = 30;
+pub const IFLA_NUM_TX_QUEUES: ::c_ushort = 31;
+pub const IFLA_NUM_RX_QUEUES: ::c_ushort = 32;
+pub const IFLA_CARRIER: ::c_ushort = 33;
+pub const IFLA_PHYS_PORT_ID: ::c_ushort = 34;
+pub const IFLA_CARRIER_CHANGES: ::c_ushort = 35;
+pub const IFLA_PHYS_SWITCH_ID: ::c_ushort = 36;
+pub const IFLA_LINK_NETNSID: ::c_ushort = 37;
+pub const IFLA_PHYS_PORT_NAME: ::c_ushort = 38;
+pub const IFLA_PROTO_DOWN: ::c_ushort = 39;
+pub const IFLA_GSO_MAX_SEGS: ::c_ushort = 40;
+pub const IFLA_GSO_MAX_SIZE: ::c_ushort = 41;
+pub const IFLA_PAD: ::c_ushort = 42;
+pub const IFLA_XDP: ::c_ushort = 43;
+pub const IFLA_EVENT: ::c_ushort = 44;
+pub const IFLA_NEW_NETNSID: ::c_ushort = 45;
+pub const IFLA_IF_NETNSID: ::c_ushort = 46;
+pub const IFLA_TARGET_NETNSID: ::c_ushort = IFLA_IF_NETNSID;
+pub const IFLA_CARRIER_UP_COUNT: ::c_ushort = 47;
+pub const IFLA_CARRIER_DOWN_COUNT: ::c_ushort = 48;
+pub const IFLA_NEW_IFINDEX: ::c_ushort = 49;
+pub const IFLA_MIN_MTU: ::c_ushort = 50;
+pub const IFLA_MAX_MTU: ::c_ushort = 51;
+pub const IFLA_PROP_LIST: ::c_ushort = 52;
+pub const IFLA_ALT_IFNAME: ::c_ushort = 53;
+pub const IFLA_PERM_ADDRESS: ::c_ushort = 54;
+pub const IFLA_PROTO_DOWN_REASON: ::c_ushort = 55;
+pub const IFLA_PARENT_DEV_NAME: ::c_ushort = 56;
+pub const IFLA_PARENT_DEV_BUS_NAME: ::c_ushort = 57;
+pub const IFLA_GRO_MAX_SIZE: ::c_ushort = 58;
+pub const IFLA_TSO_MAX_SIZE: ::c_ushort = 59;
+pub const IFLA_TSO_MAX_SEGS: ::c_ushort = 60;
+pub const IFLA_ALLMULTI: ::c_ushort = 61;
+
+pub const IFLA_INFO_UNSPEC: ::c_ushort = 0;
+pub const IFLA_INFO_KIND: ::c_ushort = 1;
+pub const IFLA_INFO_DATA: ::c_ushort = 2;
+pub const IFLA_INFO_XSTATS: ::c_ushort = 3;
+pub const IFLA_INFO_SLAVE_KIND: ::c_ushort = 4;
+pub const IFLA_INFO_SLAVE_DATA: ::c_ushort = 5;
+
+// linux/if_tun.h
+pub const IFF_TUN: ::c_int = 0x0001;
+pub const IFF_TAP: ::c_int = 0x0002;
+pub const IFF_NAPI: ::c_int = 0x0010;
+pub const IFF_NAPI_FRAGS: ::c_int = 0x0020;
+// Used in TUNSETIFF to bring up tun/tap without carrier
+pub const IFF_NO_CARRIER: ::c_int = 0x0040;
+pub const IFF_NO_PI: ::c_int = 0x1000;
+// Read queue size
+pub const TUN_READQ_SIZE: ::c_short = 500;
+// TUN device type flags: deprecated. Use IFF_TUN/IFF_TAP instead.
+pub const TUN_TUN_DEV: ::c_short = ::IFF_TUN as ::c_short;
+pub const TUN_TAP_DEV: ::c_short = ::IFF_TAP as ::c_short;
+pub const TUN_TYPE_MASK: ::c_short = 0x000f;
+// This flag has no real effect
+pub const IFF_ONE_QUEUE: ::c_int = 0x2000;
+pub const IFF_VNET_HDR: ::c_int = 0x4000;
+pub const IFF_TUN_EXCL: ::c_int = 0x8000;
+pub const IFF_MULTI_QUEUE: ::c_int = 0x0100;
+pub const IFF_ATTACH_QUEUE: ::c_int = 0x0200;
+pub const IFF_DETACH_QUEUE: ::c_int = 0x0400;
+// read-only flag
+pub const IFF_PERSIST: ::c_int = 0x0800;
+pub const IFF_NOFILTER: ::c_int = 0x1000;
+// Socket options
+pub const TUN_TX_TIMESTAMP: ::c_int = 1;
+// Features for GSO (TUNSETOFFLOAD)
+pub const TUN_F_CSUM: ::c_uint = 0x01;
+pub const TUN_F_TSO4: ::c_uint = 0x02;
+pub const TUN_F_TSO6: ::c_uint = 0x04;
+pub const TUN_F_TSO_ECN: ::c_uint = 0x08;
+pub const TUN_F_UFO: ::c_uint = 0x10;
+pub const TUN_F_USO4: ::c_uint = 0x20;
+pub const TUN_F_USO6: ::c_uint = 0x40;
+// Protocol info prepended to the packets (when IFF_NO_PI is not set)
+pub const TUN_PKT_STRIP: ::c_int = 0x0001;
+// Accept all multicast packets
+pub const TUN_FLT_ALLMULTI: ::c_int = 0x0001;
+
+// Since Linux 3.1
+pub const SEEK_DATA: ::c_int = 3;
+pub const SEEK_HOLE: ::c_int = 4;
+
+pub const ST_RDONLY: ::c_ulong = 1;
+pub const ST_NOSUID: ::c_ulong = 2;
+pub const ST_NODEV: ::c_ulong = 4;
+pub const ST_NOEXEC: ::c_ulong = 8;
+pub const ST_SYNCHRONOUS: ::c_ulong = 16;
+pub const ST_MANDLOCK: ::c_ulong = 64;
+pub const ST_WRITE: ::c_ulong = 128;
+pub const ST_APPEND: ::c_ulong = 256;
+pub const ST_IMMUTABLE: ::c_ulong = 512;
+pub const ST_NOATIME: ::c_ulong = 1024;
+pub const ST_NODIRATIME: ::c_ulong = 2048;
+
+pub const RTLD_NEXT: *mut ::c_void = -1i64 as *mut ::c_void;
+pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
+pub const RTLD_NODELETE: ::c_int = 0x1000;
+pub const RTLD_NOW: ::c_int = 0x2;
+
+pub const AT_EACCESS: ::c_int = 0x200;
+
+// linux/mempolicy.h
+pub const MPOL_DEFAULT: ::c_int = 0;
+pub const MPOL_PREFERRED: ::c_int = 1;
+pub const MPOL_BIND: ::c_int = 2;
+pub const MPOL_INTERLEAVE: ::c_int = 3;
+pub const MPOL_LOCAL: ::c_int = 4;
+pub const MPOL_F_NUMA_BALANCING: ::c_int = 1 << 13;
+pub const MPOL_F_RELATIVE_NODES: ::c_int = 1 << 14;
+pub const MPOL_F_STATIC_NODES: ::c_int = 1 << 15;
+
+// linux/membarrier.h
+pub const MEMBARRIER_CMD_QUERY: ::c_int = 0;
+pub const MEMBARRIER_CMD_GLOBAL: ::c_int = 1 << 0;
+pub const MEMBARRIER_CMD_GLOBAL_EXPEDITED: ::c_int = 1 << 1;
+pub const MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED: ::c_int = 1 << 2;
+pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED: ::c_int = 1 << 3;
+pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED: ::c_int = 1 << 4;
+pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE: ::c_int = 1 << 5;
+pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE: ::c_int = 1 << 6;
+pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ: ::c_int = 1 << 7;
+pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ: ::c_int = 1 << 8;
+
+align_const! {
+    pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+        size: [0; __SIZEOF_PTHREAD_MUTEX_T],
+    };
+    pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+        size: [0; __SIZEOF_PTHREAD_COND_T],
+    };
+    pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+        size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
+    };
+}
+pub const PTHREAD_ONCE_INIT: pthread_once_t = 0;
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
+pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
+pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
+pub const PTHREAD_MUTEX_STALLED: ::c_int = 0;
+pub const PTHREAD_MUTEX_ROBUST: ::c_int = 1;
+pub const PTHREAD_PRIO_NONE: ::c_int = 0;
+pub const PTHREAD_PRIO_INHERIT: ::c_int = 1;
+pub const PTHREAD_PRIO_PROTECT: ::c_int = 2;
+pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
+pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
+pub const PTHREAD_INHERIT_SCHED: ::c_int = 0;
+pub const PTHREAD_EXPLICIT_SCHED: ::c_int = 1;
+pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
+
+pub const RENAME_NOREPLACE: ::c_uint = 1;
+pub const RENAME_EXCHANGE: ::c_uint = 2;
+pub const RENAME_WHITEOUT: ::c_uint = 4;
+
+// netinet/in.h
+// NOTE: These are in addition to the constants defined in src/unix/mod.rs
+
+#[deprecated(
+    since = "0.2.80",
+    note = "This value was increased in the newer kernel \
+            and we'll change this following upstream in the future release. \
+            See #1896 for more info."
+)]
+pub const IPPROTO_MAX: ::c_int = 256;
+
+// System V IPC
+pub const IPC_PRIVATE: ::key_t = 0;
+
+pub const IPC_CREAT: ::c_int = 0o1000;
+pub const IPC_EXCL: ::c_int = 0o2000;
+pub const IPC_NOWAIT: ::c_int = 0o4000;
+
+pub const IPC_RMID: ::c_int = 0;
+pub const IPC_SET: ::c_int = 1;
+pub const IPC_STAT: ::c_int = 2;
+pub const IPC_INFO: ::c_int = 3;
+pub const MSG_STAT: ::c_int = 11;
+pub const MSG_INFO: ::c_int = 12;
+pub const MSG_NOTIFICATION: ::c_int = 0x8000;
+
+pub const MSG_NOERROR: ::c_int = 0o10000;
+pub const MSG_EXCEPT: ::c_int = 0o20000;
+pub const MSG_ZEROCOPY: ::c_int = 0x4000000;
+
+pub const SHM_R: ::c_int = 0o400;
+pub const SHM_W: ::c_int = 0o200;
+
+pub const SHM_RDONLY: ::c_int = 0o10000;
+pub const SHM_RND: ::c_int = 0o20000;
+pub const SHM_REMAP: ::c_int = 0o40000;
+
+pub const SHM_LOCK: ::c_int = 11;
+pub const SHM_UNLOCK: ::c_int = 12;
+
+pub const SHM_HUGETLB: ::c_int = 0o4000;
+#[cfg(not(all(target_env = "uclibc", target_arch = "mips")))]
+pub const SHM_NORESERVE: ::c_int = 0o10000;
+
+pub const QFMT_VFS_OLD: ::c_int = 1;
+pub const QFMT_VFS_V0: ::c_int = 2;
+pub const QFMT_VFS_V1: ::c_int = 4;
+
+pub const EFD_SEMAPHORE: ::c_int = 0x1;
+
+pub const LOG_NFACILITIES: ::c_int = 24;
+
+pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t;
+
+pub const RB_AUTOBOOT: ::c_int = 0x01234567u32 as i32;
+pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123u32 as i32;
+pub const RB_ENABLE_CAD: ::c_int = 0x89abcdefu32 as i32;
+pub const RB_DISABLE_CAD: ::c_int = 0x00000000u32 as i32;
+pub const RB_POWER_OFF: ::c_int = 0x4321fedcu32 as i32;
+pub const RB_SW_SUSPEND: ::c_int = 0xd000fce2u32 as i32;
+pub const RB_KEXEC: ::c_int = 0x45584543u32 as i32;
+
+pub const AI_PASSIVE: ::c_int = 0x0001;
+pub const AI_CANONNAME: ::c_int = 0x0002;
+pub const AI_NUMERICHOST: ::c_int = 0x0004;
+pub const AI_V4MAPPED: ::c_int = 0x0008;
+pub const AI_ALL: ::c_int = 0x0010;
+pub const AI_ADDRCONFIG: ::c_int = 0x0020;
+
+pub const AI_NUMERICSERV: ::c_int = 0x0400;
+
+pub const EAI_BADFLAGS: ::c_int = -1;
+pub const EAI_NONAME: ::c_int = -2;
+pub const EAI_AGAIN: ::c_int = -3;
+pub const EAI_FAIL: ::c_int = -4;
+pub const EAI_NODATA: ::c_int = -5;
+pub const EAI_FAMILY: ::c_int = -6;
+pub const EAI_SOCKTYPE: ::c_int = -7;
+pub const EAI_SERVICE: ::c_int = -8;
+pub const EAI_MEMORY: ::c_int = -10;
+pub const EAI_SYSTEM: ::c_int = -11;
+pub const EAI_OVERFLOW: ::c_int = -12;
+
+pub const NI_NUMERICHOST: ::c_int = 1;
+pub const NI_NUMERICSERV: ::c_int = 2;
+pub const NI_NOFQDN: ::c_int = 4;
+pub const NI_NAMEREQD: ::c_int = 8;
+pub const NI_DGRAM: ::c_int = 16;
+pub const NI_IDN: ::c_int = 32;
+
+pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1;
+pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2;
+pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4;
+
+cfg_if! {
+    if #[cfg(not(target_env = "uclibc"))] {
+        pub const AIO_CANCELED: ::c_int = 0;
+        pub const AIO_NOTCANCELED: ::c_int = 1;
+        pub const AIO_ALLDONE: ::c_int = 2;
+        pub const LIO_READ: ::c_int = 0;
+        pub const LIO_WRITE: ::c_int = 1;
+        pub const LIO_NOP: ::c_int = 2;
+        pub const LIO_WAIT: ::c_int = 0;
+        pub const LIO_NOWAIT: ::c_int = 1;
+        pub const RUSAGE_THREAD: ::c_int = 1;
+        pub const MSG_COPY: ::c_int = 0o40000;
+        pub const SHM_EXEC: ::c_int = 0o100000;
+        pub const IPV6_MULTICAST_ALL: ::c_int = 29;
+        pub const IPV6_ROUTER_ALERT_ISOLATE: ::c_int = 30;
+        pub const PACKET_MR_UNICAST: ::c_int = 3;
+        pub const PTRACE_EVENT_STOP: ::c_int = 128;
+        pub const UDP_SEGMENT: ::c_int = 103;
+        pub const UDP_GRO: ::c_int = 104;
+    }
+}
+
+pub const MREMAP_MAYMOVE: ::c_int = 1;
+pub const MREMAP_FIXED: ::c_int = 2;
+pub const MREMAP_DONTUNMAP: ::c_int = 4;
+
+pub const PR_SET_PDEATHSIG: ::c_int = 1;
+pub const PR_GET_PDEATHSIG: ::c_int = 2;
+
+pub const PR_GET_DUMPABLE: ::c_int = 3;
+pub const PR_SET_DUMPABLE: ::c_int = 4;
+
+pub const PR_GET_UNALIGN: ::c_int = 5;
+pub const PR_SET_UNALIGN: ::c_int = 6;
+pub const PR_UNALIGN_NOPRINT: ::c_int = 1;
+pub const PR_UNALIGN_SIGBUS: ::c_int = 2;
+
+pub const PR_GET_KEEPCAPS: ::c_int = 7;
+pub const PR_SET_KEEPCAPS: ::c_int = 8;
+
+pub const PR_GET_FPEMU: ::c_int = 9;
+pub const PR_SET_FPEMU: ::c_int = 10;
+pub const PR_FPEMU_NOPRINT: ::c_int = 1;
+pub const PR_FPEMU_SIGFPE: ::c_int = 2;
+
+pub const PR_GET_FPEXC: ::c_int = 11;
+pub const PR_SET_FPEXC: ::c_int = 12;
+pub const PR_FP_EXC_SW_ENABLE: ::c_int = 0x80;
+pub const PR_FP_EXC_DIV: ::c_int = 0x010000;
+pub const PR_FP_EXC_OVF: ::c_int = 0x020000;
+pub const PR_FP_EXC_UND: ::c_int = 0x040000;
+pub const PR_FP_EXC_RES: ::c_int = 0x080000;
+pub const PR_FP_EXC_INV: ::c_int = 0x100000;
+pub const PR_FP_EXC_DISABLED: ::c_int = 0;
+pub const PR_FP_EXC_NONRECOV: ::c_int = 1;
+pub const PR_FP_EXC_ASYNC: ::c_int = 2;
+pub const PR_FP_EXC_PRECISE: ::c_int = 3;
+
+pub const PR_GET_TIMING: ::c_int = 13;
+pub const PR_SET_TIMING: ::c_int = 14;
+pub const PR_TIMING_STATISTICAL: ::c_int = 0;
+pub const PR_TIMING_TIMESTAMP: ::c_int = 1;
+
+pub const PR_SET_NAME: ::c_int = 15;
+pub const PR_GET_NAME: ::c_int = 16;
+
+pub const PR_GET_ENDIAN: ::c_int = 19;
+pub const PR_SET_ENDIAN: ::c_int = 20;
+pub const PR_ENDIAN_BIG: ::c_int = 0;
+pub const PR_ENDIAN_LITTLE: ::c_int = 1;
+pub const PR_ENDIAN_PPC_LITTLE: ::c_int = 2;
+
+pub const PR_GET_SECCOMP: ::c_int = 21;
+pub const PR_SET_SECCOMP: ::c_int = 22;
+
+pub const PR_CAPBSET_READ: ::c_int = 23;
+pub const PR_CAPBSET_DROP: ::c_int = 24;
+
+pub const PR_GET_TSC: ::c_int = 25;
+pub const PR_SET_TSC: ::c_int = 26;
+pub const PR_TSC_ENABLE: ::c_int = 1;
+pub const PR_TSC_SIGSEGV: ::c_int = 2;
+
+pub const PR_GET_SECUREBITS: ::c_int = 27;
+pub const PR_SET_SECUREBITS: ::c_int = 28;
+
+pub const PR_SET_TIMERSLACK: ::c_int = 29;
+pub const PR_GET_TIMERSLACK: ::c_int = 30;
+
+pub const PR_TASK_PERF_EVENTS_DISABLE: ::c_int = 31;
+pub const PR_TASK_PERF_EVENTS_ENABLE: ::c_int = 32;
+
+pub const PR_MCE_KILL: ::c_int = 33;
+pub const PR_MCE_KILL_CLEAR: ::c_int = 0;
+pub const PR_MCE_KILL_SET: ::c_int = 1;
+
+pub const PR_MCE_KILL_LATE: ::c_int = 0;
+pub const PR_MCE_KILL_EARLY: ::c_int = 1;
+pub const PR_MCE_KILL_DEFAULT: ::c_int = 2;
+
+pub const PR_MCE_KILL_GET: ::c_int = 34;
+
+pub const PR_SET_MM: ::c_int = 35;
+pub const PR_SET_MM_START_CODE: ::c_int = 1;
+pub const PR_SET_MM_END_CODE: ::c_int = 2;
+pub const PR_SET_MM_START_DATA: ::c_int = 3;
+pub const PR_SET_MM_END_DATA: ::c_int = 4;
+pub const PR_SET_MM_START_STACK: ::c_int = 5;
+pub const PR_SET_MM_START_BRK: ::c_int = 6;
+pub const PR_SET_MM_BRK: ::c_int = 7;
+pub const PR_SET_MM_ARG_START: ::c_int = 8;
+pub const PR_SET_MM_ARG_END: ::c_int = 9;
+pub const PR_SET_MM_ENV_START: ::c_int = 10;
+pub const PR_SET_MM_ENV_END: ::c_int = 11;
+pub const PR_SET_MM_AUXV: ::c_int = 12;
+pub const PR_SET_MM_EXE_FILE: ::c_int = 13;
+pub const PR_SET_MM_MAP: ::c_int = 14;
+pub const PR_SET_MM_MAP_SIZE: ::c_int = 15;
+
+pub const PR_SET_PTRACER: ::c_int = 0x59616d61;
+pub const PR_SET_PTRACER_ANY: ::c_ulong = 0xffffffffffffffff;
+
+pub const PR_SET_CHILD_SUBREAPER: ::c_int = 36;
+pub const PR_GET_CHILD_SUBREAPER: ::c_int = 37;
+
+pub const PR_SET_NO_NEW_PRIVS: ::c_int = 38;
+pub const PR_GET_NO_NEW_PRIVS: ::c_int = 39;
+
+pub const PR_GET_TID_ADDRESS: ::c_int = 40;
+
+pub const PR_SET_THP_DISABLE: ::c_int = 41;
+pub const PR_GET_THP_DISABLE: ::c_int = 42;
+
+pub const PR_MPX_ENABLE_MANAGEMENT: ::c_int = 43;
+pub const PR_MPX_DISABLE_MANAGEMENT: ::c_int = 44;
+
+pub const PR_SET_FP_MODE: ::c_int = 45;
+pub const PR_GET_FP_MODE: ::c_int = 46;
+pub const PR_FP_MODE_FR: ::c_int = 1 << 0;
+pub const PR_FP_MODE_FRE: ::c_int = 1 << 1;
+
+pub const PR_CAP_AMBIENT: ::c_int = 47;
+pub const PR_CAP_AMBIENT_IS_SET: ::c_int = 1;
+pub const PR_CAP_AMBIENT_RAISE: ::c_int = 2;
+pub const PR_CAP_AMBIENT_LOWER: ::c_int = 3;
+pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4;
+
+pub const PR_SET_VMA: ::c_int = 0x53564d41;
+pub const PR_SET_VMA_ANON_NAME: ::c_int = 0;
+
+pub const PR_SCHED_CORE: ::c_int = 62;
+pub const PR_SCHED_CORE_GET: ::c_int = 0;
+pub const PR_SCHED_CORE_CREATE: ::c_int = 1;
+pub const PR_SCHED_CORE_SHARE_TO: ::c_int = 2;
+pub const PR_SCHED_CORE_SHARE_FROM: ::c_int = 3;
+pub const PR_SCHED_CORE_MAX: ::c_int = 4;
+pub const PR_SCHED_CORE_SCOPE_THREAD: ::c_int = 0;
+pub const PR_SCHED_CORE_SCOPE_THREAD_GROUP: ::c_int = 1;
+pub const PR_SCHED_CORE_SCOPE_PROCESS_GROUP: ::c_int = 2;
+
+pub const GRND_NONBLOCK: ::c_uint = 0x0001;
+pub const GRND_RANDOM: ::c_uint = 0x0002;
+pub const GRND_INSECURE: ::c_uint = 0x0004;
+
+// <linux/seccomp.h>
+pub const SECCOMP_MODE_DISABLED: ::c_uint = 0;
+pub const SECCOMP_MODE_STRICT: ::c_uint = 1;
+pub const SECCOMP_MODE_FILTER: ::c_uint = 2;
+
+pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0;
+pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1;
+pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2;
+pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3;
+
+pub const SECCOMP_FILTER_FLAG_TSYNC: ::c_ulong = 1;
+pub const SECCOMP_FILTER_FLAG_LOG: ::c_ulong = 2;
+pub const SECCOMP_FILTER_FLAG_SPEC_ALLOW: ::c_ulong = 4;
+pub const SECCOMP_FILTER_FLAG_NEW_LISTENER: ::c_ulong = 8;
+pub const SECCOMP_FILTER_FLAG_TSYNC_ESRCH: ::c_ulong = 16;
+pub const SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV: ::c_ulong = 32;
+
+pub const SECCOMP_RET_KILL_PROCESS: ::c_uint = 0x80000000;
+pub const SECCOMP_RET_KILL_THREAD: ::c_uint = 0x00000000;
+pub const SECCOMP_RET_KILL: ::c_uint = SECCOMP_RET_KILL_THREAD;
+pub const SECCOMP_RET_TRAP: ::c_uint = 0x00030000;
+pub const SECCOMP_RET_ERRNO: ::c_uint = 0x00050000;
+pub const SECCOMP_RET_TRACE: ::c_uint = 0x7ff00000;
+pub const SECCOMP_RET_LOG: ::c_uint = 0x7ffc0000;
+pub const SECCOMP_RET_ALLOW: ::c_uint = 0x7fff0000;
+
+pub const SECCOMP_RET_ACTION_FULL: ::c_uint = 0xffff0000;
+pub const SECCOMP_RET_ACTION: ::c_uint = 0x7fff0000;
+pub const SECCOMP_RET_DATA: ::c_uint = 0x0000ffff;
+
+pub const SECCOMP_USER_NOTIF_FLAG_CONTINUE: ::c_ulong = 1;
+
+pub const SECCOMP_ADDFD_FLAG_SETFD: ::c_ulong = 1;
+pub const SECCOMP_ADDFD_FLAG_SEND: ::c_ulong = 2;
+
+pub const ITIMER_REAL: ::c_int = 0;
+pub const ITIMER_VIRTUAL: ::c_int = 1;
+pub const ITIMER_PROF: ::c_int = 2;
+
+pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC;
+pub const TFD_NONBLOCK: ::c_int = O_NONBLOCK;
+pub const TFD_TIMER_ABSTIME: ::c_int = 1;
+pub const TFD_TIMER_CANCEL_ON_SET: ::c_int = 2;
+
+pub const _POSIX_VDISABLE: ::cc_t = 0;
+
+pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01;
+pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02;
+pub const FALLOC_FL_COLLAPSE_RANGE: ::c_int = 0x08;
+pub const FALLOC_FL_ZERO_RANGE: ::c_int = 0x10;
+pub const FALLOC_FL_INSERT_RANGE: ::c_int = 0x20;
+pub const FALLOC_FL_UNSHARE_RANGE: ::c_int = 0x40;
+
+#[deprecated(
+    since = "0.2.55",
+    note = "ENOATTR is not available on Linux; use ENODATA instead"
+)]
+pub const ENOATTR: ::c_int = ::ENODATA;
+
+pub const SO_ORIGINAL_DST: ::c_int = 80;
+
+pub const IP_RECVFRAGSIZE: ::c_int = 25;
+
+pub const IPV6_FLOWINFO: ::c_int = 11;
+pub const IPV6_FLOWLABEL_MGR: ::c_int = 32;
+pub const IPV6_FLOWINFO_SEND: ::c_int = 33;
+pub const IPV6_RECVFRAGSIZE: ::c_int = 77;
+pub const IPV6_FREEBIND: ::c_int = 78;
+pub const IPV6_FLOWINFO_FLOWLABEL: ::c_int = 0x000fffff;
+pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 0x0ff00000;
+
+pub const IPV6_RTHDR_LOOSE: ::c_int = 0;
+pub const IPV6_RTHDR_STRICT: ::c_int = 1;
+
+// SO_MEMINFO offsets
+pub const SK_MEMINFO_RMEM_ALLOC: ::c_int = 0;
+pub const SK_MEMINFO_RCVBUF: ::c_int = 1;
+pub const SK_MEMINFO_WMEM_ALLOC: ::c_int = 2;
+pub const SK_MEMINFO_SNDBUF: ::c_int = 3;
+pub const SK_MEMINFO_FWD_ALLOC: ::c_int = 4;
+pub const SK_MEMINFO_WMEM_QUEUED: ::c_int = 5;
+pub const SK_MEMINFO_OPTMEM: ::c_int = 6;
+pub const SK_MEMINFO_BACKLOG: ::c_int = 7;
+pub const SK_MEMINFO_DROPS: ::c_int = 8;
+
+pub const IUTF8: ::tcflag_t = 0x00004000;
+#[cfg(not(all(target_env = "uclibc", target_arch = "mips")))]
+pub const CMSPAR: ::tcflag_t = 0o10000000000;
+
+pub const MFD_CLOEXEC: ::c_uint = 0x0001;
+pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
+pub const MFD_HUGETLB: ::c_uint = 0x0004;
+pub const MFD_NOEXEC_SEAL: ::c_uint = 0x0008;
+pub const MFD_EXEC: ::c_uint = 0x0010;
+pub const MFD_HUGE_64KB: ::c_uint = 0x40000000;
+pub const MFD_HUGE_512KB: ::c_uint = 0x4c000000;
+pub const MFD_HUGE_1MB: ::c_uint = 0x50000000;
+pub const MFD_HUGE_2MB: ::c_uint = 0x54000000;
+pub const MFD_HUGE_8MB: ::c_uint = 0x5c000000;
+pub const MFD_HUGE_16MB: ::c_uint = 0x60000000;
+pub const MFD_HUGE_32MB: ::c_uint = 0x64000000;
+pub const MFD_HUGE_256MB: ::c_uint = 0x70000000;
+pub const MFD_HUGE_512MB: ::c_uint = 0x74000000;
+pub const MFD_HUGE_1GB: ::c_uint = 0x78000000;
+pub const MFD_HUGE_2GB: ::c_uint = 0x7c000000;
+pub const MFD_HUGE_16GB: ::c_uint = 0x88000000;
+pub const MFD_HUGE_MASK: ::c_uint = 63;
+pub const MFD_HUGE_SHIFT: ::c_uint = 26;
+
+// linux/close_range.h
+pub const CLOSE_RANGE_UNSHARE: ::c_uint = 1 << 1;
+pub const CLOSE_RANGE_CLOEXEC: ::c_uint = 1 << 2;
+
+// linux/filter.h
+pub const SKF_AD_OFF: ::c_int = -0x1000;
+pub const SKF_AD_PROTOCOL: ::c_int = 0;
+pub const SKF_AD_PKTTYPE: ::c_int = 4;
+pub const SKF_AD_IFINDEX: ::c_int = 8;
+pub const SKF_AD_NLATTR: ::c_int = 12;
+pub const SKF_AD_NLATTR_NEST: ::c_int = 16;
+pub const SKF_AD_MARK: ::c_int = 20;
+pub const SKF_AD_QUEUE: ::c_int = 24;
+pub const SKF_AD_HATYPE: ::c_int = 28;
+pub const SKF_AD_RXHASH: ::c_int = 32;
+pub const SKF_AD_CPU: ::c_int = 36;
+pub const SKF_AD_ALU_XOR_X: ::c_int = 40;
+pub const SKF_AD_VLAN_TAG: ::c_int = 44;
+pub const SKF_AD_VLAN_TAG_PRESENT: ::c_int = 48;
+pub const SKF_AD_PAY_OFFSET: ::c_int = 52;
+pub const SKF_AD_RANDOM: ::c_int = 56;
+pub const SKF_AD_VLAN_TPID: ::c_int = 60;
+pub const SKF_AD_MAX: ::c_int = 64;
+pub const SKF_NET_OFF: ::c_int = -0x100000;
+pub const SKF_LL_OFF: ::c_int = -0x200000;
+pub const BPF_NET_OFF: ::c_int = SKF_NET_OFF;
+pub const BPF_LL_OFF: ::c_int = SKF_LL_OFF;
+pub const BPF_MEMWORDS: ::c_int = 16;
+pub const BPF_MAXINSNS: ::c_int = 4096;
+
+// linux/bpf_common.h
+pub const BPF_LD: ::__u32 = 0x00;
+pub const BPF_LDX: ::__u32 = 0x01;
+pub const BPF_ST: ::__u32 = 0x02;
+pub const BPF_STX: ::__u32 = 0x03;
+pub const BPF_ALU: ::__u32 = 0x04;
+pub const BPF_JMP: ::__u32 = 0x05;
+pub const BPF_RET: ::__u32 = 0x06;
+pub const BPF_MISC: ::__u32 = 0x07;
+pub const BPF_W: ::__u32 = 0x00;
+pub const BPF_H: ::__u32 = 0x08;
+pub const BPF_B: ::__u32 = 0x10;
+pub const BPF_IMM: ::__u32 = 0x00;
+pub const BPF_ABS: ::__u32 = 0x20;
+pub const BPF_IND: ::__u32 = 0x40;
+pub const BPF_MEM: ::__u32 = 0x60;
+pub const BPF_LEN: ::__u32 = 0x80;
+pub const BPF_MSH: ::__u32 = 0xa0;
+pub const BPF_ADD: ::__u32 = 0x00;
+pub const BPF_SUB: ::__u32 = 0x10;
+pub const BPF_MUL: ::__u32 = 0x20;
+pub const BPF_DIV: ::__u32 = 0x30;
+pub const BPF_OR: ::__u32 = 0x40;
+pub const BPF_AND: ::__u32 = 0x50;
+pub const BPF_LSH: ::__u32 = 0x60;
+pub const BPF_RSH: ::__u32 = 0x70;
+pub const BPF_NEG: ::__u32 = 0x80;
+pub const BPF_MOD: ::__u32 = 0x90;
+pub const BPF_XOR: ::__u32 = 0xa0;
+pub const BPF_JA: ::__u32 = 0x00;
+pub const BPF_JEQ: ::__u32 = 0x10;
+pub const BPF_JGT: ::__u32 = 0x20;
+pub const BPF_JGE: ::__u32 = 0x30;
+pub const BPF_JSET: ::__u32 = 0x40;
+pub const BPF_K: ::__u32 = 0x00;
+pub const BPF_X: ::__u32 = 0x08;
+
+// linux/openat2.h
+pub const RESOLVE_NO_XDEV: ::__u64 = 0x01;
+pub const RESOLVE_NO_MAGICLINKS: ::__u64 = 0x02;
+pub const RESOLVE_NO_SYMLINKS: ::__u64 = 0x04;
+pub const RESOLVE_BENEATH: ::__u64 = 0x08;
+pub const RESOLVE_IN_ROOT: ::__u64 = 0x10;
+pub const RESOLVE_CACHED: ::__u64 = 0x20;
+
+// linux/if_ether.h
+pub const ETH_ALEN: ::c_int = 6;
+pub const ETH_HLEN: ::c_int = 14;
+pub const ETH_ZLEN: ::c_int = 60;
+pub const ETH_DATA_LEN: ::c_int = 1500;
+pub const ETH_FRAME_LEN: ::c_int = 1514;
+pub const ETH_FCS_LEN: ::c_int = 4;
+
+// These are the defined Ethernet Protocol ID's.
+pub const ETH_P_LOOP: ::c_int = 0x0060;
+pub const ETH_P_PUP: ::c_int = 0x0200;
+pub const ETH_P_PUPAT: ::c_int = 0x0201;
+pub const ETH_P_IP: ::c_int = 0x0800;
+pub const ETH_P_X25: ::c_int = 0x0805;
+pub const ETH_P_ARP: ::c_int = 0x0806;
+pub const ETH_P_BPQ: ::c_int = 0x08FF;
+pub const ETH_P_IEEEPUP: ::c_int = 0x0a00;
+pub const ETH_P_IEEEPUPAT: ::c_int = 0x0a01;
+pub const ETH_P_BATMAN: ::c_int = 0x4305;
+pub const ETH_P_DEC: ::c_int = 0x6000;
+pub const ETH_P_DNA_DL: ::c_int = 0x6001;
+pub const ETH_P_DNA_RC: ::c_int = 0x6002;
+pub const ETH_P_DNA_RT: ::c_int = 0x6003;
+pub const ETH_P_LAT: ::c_int = 0x6004;
+pub const ETH_P_DIAG: ::c_int = 0x6005;
+pub const ETH_P_CUST: ::c_int = 0x6006;
+pub const ETH_P_SCA: ::c_int = 0x6007;
+pub const ETH_P_TEB: ::c_int = 0x6558;
+pub const ETH_P_RARP: ::c_int = 0x8035;
+pub const ETH_P_ATALK: ::c_int = 0x809B;
+pub const ETH_P_AARP: ::c_int = 0x80F3;
+pub const ETH_P_8021Q: ::c_int = 0x8100;
+pub const ETH_P_IPX: ::c_int = 0x8137;
+pub const ETH_P_IPV6: ::c_int = 0x86DD;
+pub const ETH_P_PAUSE: ::c_int = 0x8808;
+pub const ETH_P_SLOW: ::c_int = 0x8809;
+pub const ETH_P_WCCP: ::c_int = 0x883E;
+pub const ETH_P_MPLS_UC: ::c_int = 0x8847;
+pub const ETH_P_MPLS_MC: ::c_int = 0x8848;
+pub const ETH_P_ATMMPOA: ::c_int = 0x884c;
+pub const ETH_P_PPP_DISC: ::c_int = 0x8863;
+pub const ETH_P_PPP_SES: ::c_int = 0x8864;
+pub const ETH_P_LINK_CTL: ::c_int = 0x886c;
+pub const ETH_P_ATMFATE: ::c_int = 0x8884;
+pub const ETH_P_PAE: ::c_int = 0x888E;
+pub const ETH_P_AOE: ::c_int = 0x88A2;
+pub const ETH_P_8021AD: ::c_int = 0x88A8;
+pub const ETH_P_802_EX1: ::c_int = 0x88B5;
+pub const ETH_P_TIPC: ::c_int = 0x88CA;
+pub const ETH_P_MACSEC: ::c_int = 0x88E5;
+pub const ETH_P_8021AH: ::c_int = 0x88E7;
+pub const ETH_P_MVRP: ::c_int = 0x88F5;
+pub const ETH_P_1588: ::c_int = 0x88F7;
+pub const ETH_P_PRP: ::c_int = 0x88FB;
+pub const ETH_P_FCOE: ::c_int = 0x8906;
+pub const ETH_P_TDLS: ::c_int = 0x890D;
+pub const ETH_P_FIP: ::c_int = 0x8914;
+pub const ETH_P_80221: ::c_int = 0x8917;
+pub const ETH_P_LOOPBACK: ::c_int = 0x9000;
+pub const ETH_P_QINQ1: ::c_int = 0x9100;
+pub const ETH_P_QINQ2: ::c_int = 0x9200;
+pub const ETH_P_QINQ3: ::c_int = 0x9300;
+pub const ETH_P_EDSA: ::c_int = 0xDADA;
+pub const ETH_P_AF_IUCV: ::c_int = 0xFBFB;
+
+pub const ETH_P_802_3_MIN: ::c_int = 0x0600;
+
+// Non DIX types. Won't clash for 1500 types.
+pub const ETH_P_802_3: ::c_int = 0x0001;
+pub const ETH_P_AX25: ::c_int = 0x0002;
+pub const ETH_P_ALL: ::c_int = 0x0003;
+pub const ETH_P_802_2: ::c_int = 0x0004;
+pub const ETH_P_SNAP: ::c_int = 0x0005;
+pub const ETH_P_DDCMP: ::c_int = 0x0006;
+pub const ETH_P_WAN_PPP: ::c_int = 0x0007;
+pub const ETH_P_PPP_MP: ::c_int = 0x0008;
+pub const ETH_P_LOCALTALK: ::c_int = 0x0009;
+pub const ETH_P_CANFD: ::c_int = 0x000D;
+pub const ETH_P_PPPTALK: ::c_int = 0x0010;
+pub const ETH_P_TR_802_2: ::c_int = 0x0011;
+pub const ETH_P_MOBITEX: ::c_int = 0x0015;
+pub const ETH_P_CONTROL: ::c_int = 0x0016;
+pub const ETH_P_IRDA: ::c_int = 0x0017;
+pub const ETH_P_ECONET: ::c_int = 0x0018;
+pub const ETH_P_HDLC: ::c_int = 0x0019;
+pub const ETH_P_ARCNET: ::c_int = 0x001A;
+pub const ETH_P_DSA: ::c_int = 0x001B;
+pub const ETH_P_TRAILER: ::c_int = 0x001C;
+pub const ETH_P_PHONET: ::c_int = 0x00F5;
+pub const ETH_P_IEEE802154: ::c_int = 0x00F6;
+pub const ETH_P_CAIF: ::c_int = 0x00F7;
+
+pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
+pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02;
+pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x04;
+pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x08;
+pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x10;
+pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x20;
+
+pub const NLMSG_NOOP: ::c_int = 0x1;
+pub const NLMSG_ERROR: ::c_int = 0x2;
+pub const NLMSG_DONE: ::c_int = 0x3;
+pub const NLMSG_OVERRUN: ::c_int = 0x4;
+pub const NLMSG_MIN_TYPE: ::c_int = 0x10;
+
+// linux/netfilter/nfnetlink.h
+pub const NFNLGRP_NONE: ::c_int = 0;
+pub const NFNLGRP_CONNTRACK_NEW: ::c_int = 1;
+pub const NFNLGRP_CONNTRACK_UPDATE: ::c_int = 2;
+pub const NFNLGRP_CONNTRACK_DESTROY: ::c_int = 3;
+pub const NFNLGRP_CONNTRACK_EXP_NEW: ::c_int = 4;
+pub const NFNLGRP_CONNTRACK_EXP_UPDATE: ::c_int = 5;
+pub const NFNLGRP_CONNTRACK_EXP_DESTROY: ::c_int = 6;
+pub const NFNLGRP_NFTABLES: ::c_int = 7;
+pub const NFNLGRP_ACCT_QUOTA: ::c_int = 8;
+pub const NFNLGRP_NFTRACE: ::c_int = 9;
+
+pub const NFNETLINK_V0: ::c_int = 0;
+
+pub const NFNL_SUBSYS_NONE: ::c_int = 0;
+pub const NFNL_SUBSYS_CTNETLINK: ::c_int = 1;
+pub const NFNL_SUBSYS_CTNETLINK_EXP: ::c_int = 2;
+pub const NFNL_SUBSYS_QUEUE: ::c_int = 3;
+pub const NFNL_SUBSYS_ULOG: ::c_int = 4;
+pub const NFNL_SUBSYS_OSF: ::c_int = 5;
+pub const NFNL_SUBSYS_IPSET: ::c_int = 6;
+pub const NFNL_SUBSYS_ACCT: ::c_int = 7;
+pub const NFNL_SUBSYS_CTNETLINK_TIMEOUT: ::c_int = 8;
+pub const NFNL_SUBSYS_CTHELPER: ::c_int = 9;
+pub const NFNL_SUBSYS_NFTABLES: ::c_int = 10;
+pub const NFNL_SUBSYS_NFT_COMPAT: ::c_int = 11;
+pub const NFNL_SUBSYS_HOOK: ::c_int = 12;
+pub const NFNL_SUBSYS_COUNT: ::c_int = 13;
+
+pub const NFNL_MSG_BATCH_BEGIN: ::c_int = NLMSG_MIN_TYPE;
+pub const NFNL_MSG_BATCH_END: ::c_int = NLMSG_MIN_TYPE + 1;
+
+pub const NFNL_BATCH_UNSPEC: ::c_int = 0;
+pub const NFNL_BATCH_GENID: ::c_int = 1;
+
+// linux/netfilter/nfnetlink_log.h
+pub const NFULNL_MSG_PACKET: ::c_int = 0;
+pub const NFULNL_MSG_CONFIG: ::c_int = 1;
+
+pub const NFULA_VLAN_UNSPEC: ::c_int = 0;
+pub const NFULA_VLAN_PROTO: ::c_int = 1;
+pub const NFULA_VLAN_TCI: ::c_int = 2;
+
+pub const NFULA_UNSPEC: ::c_int = 0;
+pub const NFULA_PACKET_HDR: ::c_int = 1;
+pub const NFULA_MARK: ::c_int = 2;
+pub const NFULA_TIMESTAMP: ::c_int = 3;
+pub const NFULA_IFINDEX_INDEV: ::c_int = 4;
+pub const NFULA_IFINDEX_OUTDEV: ::c_int = 5;
+pub const NFULA_IFINDEX_PHYSINDEV: ::c_int = 6;
+pub const NFULA_IFINDEX_PHYSOUTDEV: ::c_int = 7;
+pub const NFULA_HWADDR: ::c_int = 8;
+pub const NFULA_PAYLOAD: ::c_int = 9;
+pub const NFULA_PREFIX: ::c_int = 10;
+pub const NFULA_UID: ::c_int = 11;
+pub const NFULA_SEQ: ::c_int = 12;
+pub const NFULA_SEQ_GLOBAL: ::c_int = 13;
+pub const NFULA_GID: ::c_int = 14;
+pub const NFULA_HWTYPE: ::c_int = 15;
+pub const NFULA_HWHEADER: ::c_int = 16;
+pub const NFULA_HWLEN: ::c_int = 17;
+pub const NFULA_CT: ::c_int = 18;
+pub const NFULA_CT_INFO: ::c_int = 19;
+pub const NFULA_VLAN: ::c_int = 20;
+pub const NFULA_L2HDR: ::c_int = 21;
+
+pub const NFULNL_CFG_CMD_NONE: ::c_int = 0;
+pub const NFULNL_CFG_CMD_BIND: ::c_int = 1;
+pub const NFULNL_CFG_CMD_UNBIND: ::c_int = 2;
+pub const NFULNL_CFG_CMD_PF_BIND: ::c_int = 3;
+pub const NFULNL_CFG_CMD_PF_UNBIND: ::c_int = 4;
+
+pub const NFULA_CFG_UNSPEC: ::c_int = 0;
+pub const NFULA_CFG_CMD: ::c_int = 1;
+pub const NFULA_CFG_MODE: ::c_int = 2;
+pub const NFULA_CFG_NLBUFSIZ: ::c_int = 3;
+pub const NFULA_CFG_TIMEOUT: ::c_int = 4;
+pub const NFULA_CFG_QTHRESH: ::c_int = 5;
+pub const NFULA_CFG_FLAGS: ::c_int = 6;
+
+pub const NFULNL_COPY_NONE: ::c_int = 0x00;
+pub const NFULNL_COPY_META: ::c_int = 0x01;
+pub const NFULNL_COPY_PACKET: ::c_int = 0x02;
+
+pub const NFULNL_CFG_F_SEQ: ::c_int = 0x0001;
+pub const NFULNL_CFG_F_SEQ_GLOBAL: ::c_int = 0x0002;
+pub const NFULNL_CFG_F_CONNTRACK: ::c_int = 0x0004;
+
+// linux/netfilter/nfnetlink_queue.h
+pub const NFQNL_MSG_PACKET: ::c_int = 0;
+pub const NFQNL_MSG_VERDICT: ::c_int = 1;
+pub const NFQNL_MSG_CONFIG: ::c_int = 2;
+pub const NFQNL_MSG_VERDICT_BATCH: ::c_int = 3;
+
+pub const NFQA_UNSPEC: ::c_int = 0;
+pub const NFQA_PACKET_HDR: ::c_int = 1;
+pub const NFQA_VERDICT_HDR: ::c_int = 2;
+pub const NFQA_MARK: ::c_int = 3;
+pub const NFQA_TIMESTAMP: ::c_int = 4;
+pub const NFQA_IFINDEX_INDEV: ::c_int = 5;
+pub const NFQA_IFINDEX_OUTDEV: ::c_int = 6;
+pub const NFQA_IFINDEX_PHYSINDEV: ::c_int = 7;
+pub const NFQA_IFINDEX_PHYSOUTDEV: ::c_int = 8;
+pub const NFQA_HWADDR: ::c_int = 9;
+pub const NFQA_PAYLOAD: ::c_int = 10;
+pub const NFQA_CT: ::c_int = 11;
+pub const NFQA_CT_INFO: ::c_int = 12;
+pub const NFQA_CAP_LEN: ::c_int = 13;
+pub const NFQA_SKB_INFO: ::c_int = 14;
+pub const NFQA_EXP: ::c_int = 15;
+pub const NFQA_UID: ::c_int = 16;
+pub const NFQA_GID: ::c_int = 17;
+pub const NFQA_SECCTX: ::c_int = 18;
+pub const NFQA_VLAN: ::c_int = 19;
+pub const NFQA_L2HDR: ::c_int = 20;
+pub const NFQA_PRIORITY: ::c_int = 21;
+
+pub const NFQA_VLAN_UNSPEC: ::c_int = 0;
+pub const NFQA_VLAN_PROTO: ::c_int = 1;
+pub const NFQA_VLAN_TCI: ::c_int = 2;
+
+pub const NFQNL_CFG_CMD_NONE: ::c_int = 0;
+pub const NFQNL_CFG_CMD_BIND: ::c_int = 1;
+pub const NFQNL_CFG_CMD_UNBIND: ::c_int = 2;
+pub const NFQNL_CFG_CMD_PF_BIND: ::c_int = 3;
+pub const NFQNL_CFG_CMD_PF_UNBIND: ::c_int = 4;
+
+pub const NFQNL_COPY_NONE: ::c_int = 0;
+pub const NFQNL_COPY_META: ::c_int = 1;
+pub const NFQNL_COPY_PACKET: ::c_int = 2;
+
+pub const NFQA_CFG_UNSPEC: ::c_int = 0;
+pub const NFQA_CFG_CMD: ::c_int = 1;
+pub const NFQA_CFG_PARAMS: ::c_int = 2;
+pub const NFQA_CFG_QUEUE_MAXLEN: ::c_int = 3;
+pub const NFQA_CFG_MASK: ::c_int = 4;
+pub const NFQA_CFG_FLAGS: ::c_int = 5;
+
+pub const NFQA_CFG_F_FAIL_OPEN: ::c_int = 0x0001;
+pub const NFQA_CFG_F_CONNTRACK: ::c_int = 0x0002;
+pub const NFQA_CFG_F_GSO: ::c_int = 0x0004;
+pub const NFQA_CFG_F_UID_GID: ::c_int = 0x0008;
+pub const NFQA_CFG_F_SECCTX: ::c_int = 0x0010;
+pub const NFQA_CFG_F_MAX: ::c_int = 0x0020;
+
+pub const NFQA_SKB_CSUMNOTREADY: ::c_int = 0x0001;
+pub const NFQA_SKB_GSO: ::c_int = 0x0002;
+pub const NFQA_SKB_CSUM_NOTVERIFIED: ::c_int = 0x0004;
+
+// linux/genetlink.h
+
+pub const GENL_NAMSIZ: ::c_int = 16;
+
+pub const GENL_MIN_ID: ::c_int = NLMSG_MIN_TYPE;
+pub const GENL_MAX_ID: ::c_int = 1023;
+
+pub const GENL_ADMIN_PERM: ::c_int = 0x01;
+pub const GENL_CMD_CAP_DO: ::c_int = 0x02;
+pub const GENL_CMD_CAP_DUMP: ::c_int = 0x04;
+pub const GENL_CMD_CAP_HASPOL: ::c_int = 0x08;
+
+pub const GENL_ID_CTRL: ::c_int = NLMSG_MIN_TYPE;
+
+pub const CTRL_CMD_UNSPEC: ::c_int = 0;
+pub const CTRL_CMD_NEWFAMILY: ::c_int = 1;
+pub const CTRL_CMD_DELFAMILY: ::c_int = 2;
+pub const CTRL_CMD_GETFAMILY: ::c_int = 3;
+pub const CTRL_CMD_NEWOPS: ::c_int = 4;
+pub const CTRL_CMD_DELOPS: ::c_int = 5;
+pub const CTRL_CMD_GETOPS: ::c_int = 6;
+pub const CTRL_CMD_NEWMCAST_GRP: ::c_int = 7;
+pub const CTRL_CMD_DELMCAST_GRP: ::c_int = 8;
+pub const CTRL_CMD_GETMCAST_GRP: ::c_int = 9;
+
+pub const CTRL_ATTR_UNSPEC: ::c_int = 0;
+pub const CTRL_ATTR_FAMILY_ID: ::c_int = 1;
+pub const CTRL_ATTR_FAMILY_NAME: ::c_int = 2;
+pub const CTRL_ATTR_VERSION: ::c_int = 3;
+pub const CTRL_ATTR_HDRSIZE: ::c_int = 4;
+pub const CTRL_ATTR_MAXATTR: ::c_int = 5;
+pub const CTRL_ATTR_OPS: ::c_int = 6;
+pub const CTRL_ATTR_MCAST_GROUPS: ::c_int = 7;
+
+pub const CTRL_ATTR_OP_UNSPEC: ::c_int = 0;
+pub const CTRL_ATTR_OP_ID: ::c_int = 1;
+pub const CTRL_ATTR_OP_FLAGS: ::c_int = 2;
+
+pub const CTRL_ATTR_MCAST_GRP_UNSPEC: ::c_int = 0;
+pub const CTRL_ATTR_MCAST_GRP_NAME: ::c_int = 1;
+pub const CTRL_ATTR_MCAST_GRP_ID: ::c_int = 2;
+
+// linux/if_packet.h
+pub const PACKET_ADD_MEMBERSHIP: ::c_int = 1;
+pub const PACKET_DROP_MEMBERSHIP: ::c_int = 2;
+
+pub const PACKET_MR_MULTICAST: ::c_int = 0;
+pub const PACKET_MR_PROMISC: ::c_int = 1;
+pub const PACKET_MR_ALLMULTI: ::c_int = 2;
+
+// linux/netfilter.h
+pub const NF_DROP: ::c_int = 0;
+pub const NF_ACCEPT: ::c_int = 1;
+pub const NF_STOLEN: ::c_int = 2;
+pub const NF_QUEUE: ::c_int = 3;
+pub const NF_REPEAT: ::c_int = 4;
+pub const NF_STOP: ::c_int = 5;
+pub const NF_MAX_VERDICT: ::c_int = NF_STOP;
+
+pub const NF_VERDICT_MASK: ::c_int = 0x000000ff;
+pub const NF_VERDICT_FLAG_QUEUE_BYPASS: ::c_int = 0x00008000;
+
+pub const NF_VERDICT_QMASK: ::c_int = 0xffff0000;
+pub const NF_VERDICT_QBITS: ::c_int = 16;
+
+pub const NF_VERDICT_BITS: ::c_int = 16;
+
+pub const NF_INET_PRE_ROUTING: ::c_int = 0;
+pub const NF_INET_LOCAL_IN: ::c_int = 1;
+pub const NF_INET_FORWARD: ::c_int = 2;
+pub const NF_INET_LOCAL_OUT: ::c_int = 3;
+pub const NF_INET_POST_ROUTING: ::c_int = 4;
+pub const NF_INET_NUMHOOKS: ::c_int = 5;
+
+// Some NFPROTO are not compatible with musl and are defined in submodules.
+pub const NFPROTO_UNSPEC: ::c_int = 0;
+pub const NFPROTO_IPV4: ::c_int = 2;
+pub const NFPROTO_ARP: ::c_int = 3;
+pub const NFPROTO_BRIDGE: ::c_int = 7;
+pub const NFPROTO_IPV6: ::c_int = 10;
+pub const NFPROTO_DECNET: ::c_int = 12;
+pub const NFPROTO_NUMPROTO: ::c_int = 13;
+pub const NFPROTO_INET: ::c_int = 1;
+pub const NFPROTO_NETDEV: ::c_int = 5;
+
+pub const NF_NETDEV_INGRESS: ::c_int = 0;
+pub const NF_NETDEV_NUMHOOKS: ::c_int = 1;
+
+// linux/netfilter_ipv4.h
+pub const NF_IP_PRE_ROUTING: ::c_int = 0;
+pub const NF_IP_LOCAL_IN: ::c_int = 1;
+pub const NF_IP_FORWARD: ::c_int = 2;
+pub const NF_IP_LOCAL_OUT: ::c_int = 3;
+pub const NF_IP_POST_ROUTING: ::c_int = 4;
+pub const NF_IP_NUMHOOKS: ::c_int = 5;
+
+pub const NF_IP_PRI_FIRST: ::c_int = ::INT_MIN;
+pub const NF_IP_PRI_CONNTRACK_DEFRAG: ::c_int = -400;
+pub const NF_IP_PRI_RAW: ::c_int = -300;
+pub const NF_IP_PRI_SELINUX_FIRST: ::c_int = -225;
+pub const NF_IP_PRI_CONNTRACK: ::c_int = -200;
+pub const NF_IP_PRI_MANGLE: ::c_int = -150;
+pub const NF_IP_PRI_NAT_DST: ::c_int = -100;
+pub const NF_IP_PRI_FILTER: ::c_int = 0;
+pub const NF_IP_PRI_SECURITY: ::c_int = 50;
+pub const NF_IP_PRI_NAT_SRC: ::c_int = 100;
+pub const NF_IP_PRI_SELINUX_LAST: ::c_int = 225;
+pub const NF_IP_PRI_CONNTRACK_HELPER: ::c_int = 300;
+pub const NF_IP_PRI_CONNTRACK_CONFIRM: ::c_int = ::INT_MAX;
+pub const NF_IP_PRI_LAST: ::c_int = ::INT_MAX;
+
+// linux/netfilter_ipv6.h
+pub const NF_IP6_PRE_ROUTING: ::c_int = 0;
+pub const NF_IP6_LOCAL_IN: ::c_int = 1;
+pub const NF_IP6_FORWARD: ::c_int = 2;
+pub const NF_IP6_LOCAL_OUT: ::c_int = 3;
+pub const NF_IP6_POST_ROUTING: ::c_int = 4;
+pub const NF_IP6_NUMHOOKS: ::c_int = 5;
+
+pub const NF_IP6_PRI_FIRST: ::c_int = ::INT_MIN;
+pub const NF_IP6_PRI_CONNTRACK_DEFRAG: ::c_int = -400;
+pub const NF_IP6_PRI_RAW: ::c_int = -300;
+pub const NF_IP6_PRI_SELINUX_FIRST: ::c_int = -225;
+pub const NF_IP6_PRI_CONNTRACK: ::c_int = -200;
+pub const NF_IP6_PRI_MANGLE: ::c_int = -150;
+pub const NF_IP6_PRI_NAT_DST: ::c_int = -100;
+pub const NF_IP6_PRI_FILTER: ::c_int = 0;
+pub const NF_IP6_PRI_SECURITY: ::c_int = 50;
+pub const NF_IP6_PRI_NAT_SRC: ::c_int = 100;
+pub const NF_IP6_PRI_SELINUX_LAST: ::c_int = 225;
+pub const NF_IP6_PRI_CONNTRACK_HELPER: ::c_int = 300;
+pub const NF_IP6_PRI_LAST: ::c_int = ::INT_MAX;
+
+// linux/netfilter_ipv6/ip6_tables.h
+pub const IP6T_SO_ORIGINAL_DST: ::c_int = 80;
+
+pub const SIOCADDRT: ::c_ulong = 0x0000890B;
+pub const SIOCDELRT: ::c_ulong = 0x0000890C;
+pub const SIOCGIFNAME: ::c_ulong = 0x00008910;
+pub const SIOCSIFLINK: ::c_ulong = 0x00008911;
+pub const SIOCGIFCONF: ::c_ulong = 0x00008912;
+pub const SIOCGIFFLAGS: ::c_ulong = 0x00008913;
+pub const SIOCSIFFLAGS: ::c_ulong = 0x00008914;
+pub const SIOCGIFADDR: ::c_ulong = 0x00008915;
+pub const SIOCSIFADDR: ::c_ulong = 0x00008916;
+pub const SIOCGIFDSTADDR: ::c_ulong = 0x00008917;
+pub const SIOCSIFDSTADDR: ::c_ulong = 0x00008918;
+pub const SIOCGIFBRDADDR: ::c_ulong = 0x00008919;
+pub const SIOCSIFBRDADDR: ::c_ulong = 0x0000891A;
+pub const SIOCGIFNETMASK: ::c_ulong = 0x0000891B;
+pub const SIOCSIFNETMASK: ::c_ulong = 0x0000891C;
+pub const SIOCGIFMETRIC: ::c_ulong = 0x0000891D;
+pub const SIOCSIFMETRIC: ::c_ulong = 0x0000891E;
+pub const SIOCGIFMEM: ::c_ulong = 0x0000891F;
+pub const SIOCSIFMEM: ::c_ulong = 0x00008920;
+pub const SIOCGIFMTU: ::c_ulong = 0x00008921;
+pub const SIOCSIFMTU: ::c_ulong = 0x00008922;
+pub const SIOCSIFNAME: ::c_ulong = 0x00008923;
+pub const SIOCSIFHWADDR: ::c_ulong = 0x00008924;
+pub const SIOCGIFENCAP: ::c_ulong = 0x00008925;
+pub const SIOCSIFENCAP: ::c_ulong = 0x00008926;
+pub const SIOCGIFHWADDR: ::c_ulong = 0x00008927;
+pub const SIOCGIFSLAVE: ::c_ulong = 0x00008929;
+pub const SIOCSIFSLAVE: ::c_ulong = 0x00008930;
+pub const SIOCADDMULTI: ::c_ulong = 0x00008931;
+pub const SIOCDELMULTI: ::c_ulong = 0x00008932;
+pub const SIOCGIFINDEX: ::c_ulong = 0x00008933;
+pub const SIOGIFINDEX: ::c_ulong = SIOCGIFINDEX;
+pub const SIOCSIFPFLAGS: ::c_ulong = 0x00008934;
+pub const SIOCGIFPFLAGS: ::c_ulong = 0x00008935;
+pub const SIOCDIFADDR: ::c_ulong = 0x00008936;
+pub const SIOCSIFHWBROADCAST: ::c_ulong = 0x00008937;
+pub const SIOCGIFCOUNT: ::c_ulong = 0x00008938;
+pub const SIOCGIFBR: ::c_ulong = 0x00008940;
+pub const SIOCSIFBR: ::c_ulong = 0x00008941;
+pub const SIOCGIFTXQLEN: ::c_ulong = 0x00008942;
+pub const SIOCSIFTXQLEN: ::c_ulong = 0x00008943;
+pub const SIOCETHTOOL: ::c_ulong = 0x00008946;
+pub const SIOCGMIIPHY: ::c_ulong = 0x00008947;
+pub const SIOCGMIIREG: ::c_ulong = 0x00008948;
+pub const SIOCSMIIREG: ::c_ulong = 0x00008949;
+pub const SIOCWANDEV: ::c_ulong = 0x0000894A;
+pub const SIOCOUTQNSD: ::c_ulong = 0x0000894B;
+pub const SIOCGSKNS: ::c_ulong = 0x0000894C;
+pub const SIOCDARP: ::c_ulong = 0x00008953;
+pub const SIOCGARP: ::c_ulong = 0x00008954;
+pub const SIOCSARP: ::c_ulong = 0x00008955;
+pub const SIOCDRARP: ::c_ulong = 0x00008960;
+pub const SIOCGRARP: ::c_ulong = 0x00008961;
+pub const SIOCSRARP: ::c_ulong = 0x00008962;
+pub const SIOCGIFMAP: ::c_ulong = 0x00008970;
+pub const SIOCSIFMAP: ::c_ulong = 0x00008971;
+pub const SIOCSHWTSTAMP: ::c_ulong = 0x000089b0;
+pub const SIOCGHWTSTAMP: ::c_ulong = 0x000089b1;
+
+// wireless.h
+pub const WIRELESS_EXT: ::c_ulong = 0x16;
+
+pub const SIOCSIWCOMMIT: ::c_ulong = 0x8B00;
+pub const SIOCGIWNAME: ::c_ulong = 0x8B01;
+
+pub const SIOCSIWNWID: ::c_ulong = 0x8B02;
+pub const SIOCGIWNWID: ::c_ulong = 0x8B03;
+pub const SIOCSIWFREQ: ::c_ulong = 0x8B04;
+pub const SIOCGIWFREQ: ::c_ulong = 0x8B05;
+pub const SIOCSIWMODE: ::c_ulong = 0x8B06;
+pub const SIOCGIWMODE: ::c_ulong = 0x8B07;
+pub const SIOCSIWSENS: ::c_ulong = 0x8B08;
+pub const SIOCGIWSENS: ::c_ulong = 0x8B09;
+
+pub const SIOCSIWRANGE: ::c_ulong = 0x8B0A;
+pub const SIOCGIWRANGE: ::c_ulong = 0x8B0B;
+pub const SIOCSIWPRIV: ::c_ulong = 0x8B0C;
+pub const SIOCGIWPRIV: ::c_ulong = 0x8B0D;
+pub const SIOCSIWSTATS: ::c_ulong = 0x8B0E;
+pub const SIOCGIWSTATS: ::c_ulong = 0x8B0F;
+
+pub const SIOCSIWSPY: ::c_ulong = 0x8B10;
+pub const SIOCGIWSPY: ::c_ulong = 0x8B11;
+pub const SIOCSIWTHRSPY: ::c_ulong = 0x8B12;
+pub const SIOCGIWTHRSPY: ::c_ulong = 0x8B13;
+
+pub const SIOCSIWAP: ::c_ulong = 0x8B14;
+pub const SIOCGIWAP: ::c_ulong = 0x8B15;
+pub const SIOCGIWAPLIST: ::c_ulong = 0x8B17;
+pub const SIOCSIWSCAN: ::c_ulong = 0x8B18;
+pub const SIOCGIWSCAN: ::c_ulong = 0x8B19;
+
+pub const SIOCSIWESSID: ::c_ulong = 0x8B1A;
+pub const SIOCGIWESSID: ::c_ulong = 0x8B1B;
+pub const SIOCSIWNICKN: ::c_ulong = 0x8B1C;
+pub const SIOCGIWNICKN: ::c_ulong = 0x8B1D;
+
+pub const SIOCSIWRATE: ::c_ulong = 0x8B20;
+pub const SIOCGIWRATE: ::c_ulong = 0x8B21;
+pub const SIOCSIWRTS: ::c_ulong = 0x8B22;
+pub const SIOCGIWRTS: ::c_ulong = 0x8B23;
+pub const SIOCSIWFRAG: ::c_ulong = 0x8B24;
+pub const SIOCGIWFRAG: ::c_ulong = 0x8B25;
+pub const SIOCSIWTXPOW: ::c_ulong = 0x8B26;
+pub const SIOCGIWTXPOW: ::c_ulong = 0x8B27;
+pub const SIOCSIWRETRY: ::c_ulong = 0x8B28;
+pub const SIOCGIWRETRY: ::c_ulong = 0x8B29;
+
+pub const SIOCSIWENCODE: ::c_ulong = 0x8B2A;
+pub const SIOCGIWENCODE: ::c_ulong = 0x8B2B;
+
+pub const SIOCSIWPOWER: ::c_ulong = 0x8B2C;
+pub const SIOCGIWPOWER: ::c_ulong = 0x8B2D;
+
+pub const SIOCSIWGENIE: ::c_ulong = 0x8B30;
+pub const SIOCGIWGENIE: ::c_ulong = 0x8B31;
+
+pub const SIOCSIWMLME: ::c_ulong = 0x8B16;
+
+pub const SIOCSIWAUTH: ::c_ulong = 0x8B32;
+pub const SIOCGIWAUTH: ::c_ulong = 0x8B33;
+
+pub const SIOCSIWENCODEEXT: ::c_ulong = 0x8B34;
+pub const SIOCGIWENCODEEXT: ::c_ulong = 0x8B35;
+
+pub const SIOCSIWPMKSA: ::c_ulong = 0x8B36;
+
+pub const SIOCIWFIRSTPRIV: ::c_ulong = 0x8BE0;
+pub const SIOCIWLASTPRIV: ::c_ulong = 0x8BFF;
+
+pub const SIOCIWFIRST: ::c_ulong = 0x8B00;
+pub const SIOCIWLAST: ::c_ulong = SIOCIWLASTPRIV;
+
+pub const IWEVTXDROP: ::c_ulong = 0x8C00;
+pub const IWEVQUAL: ::c_ulong = 0x8C01;
+pub const IWEVCUSTOM: ::c_ulong = 0x8C02;
+pub const IWEVREGISTERED: ::c_ulong = 0x8C03;
+pub const IWEVEXPIRED: ::c_ulong = 0x8C04;
+pub const IWEVGENIE: ::c_ulong = 0x8C05;
+pub const IWEVMICHAELMICFAILURE: ::c_ulong = 0x8C06;
+pub const IWEVASSOCREQIE: ::c_ulong = 0x8C07;
+pub const IWEVASSOCRESPIE: ::c_ulong = 0x8C08;
+pub const IWEVPMKIDCAND: ::c_ulong = 0x8C09;
+pub const IWEVFIRST: ::c_ulong = 0x8C00;
+
+pub const IW_PRIV_TYPE_MASK: ::c_ulong = 0x7000;
+pub const IW_PRIV_TYPE_NONE: ::c_ulong = 0x0000;
+pub const IW_PRIV_TYPE_BYTE: ::c_ulong = 0x1000;
+pub const IW_PRIV_TYPE_CHAR: ::c_ulong = 0x2000;
+pub const IW_PRIV_TYPE_INT: ::c_ulong = 0x4000;
+pub const IW_PRIV_TYPE_FLOAT: ::c_ulong = 0x5000;
+pub const IW_PRIV_TYPE_ADDR: ::c_ulong = 0x6000;
+
+pub const IW_PRIV_SIZE_FIXED: ::c_ulong = 0x0800;
+
+pub const IW_PRIV_SIZE_MASK: ::c_ulong = 0x07FF;
+
+pub const IW_MAX_FREQUENCIES: usize = 32;
+pub const IW_MAX_BITRATES: usize = 32;
+pub const IW_MAX_TXPOWER: usize = 8;
+pub const IW_MAX_SPY: usize = 8;
+pub const IW_MAX_AP: usize = 64;
+pub const IW_ESSID_MAX_SIZE: usize = 32;
+
+pub const IW_MODE_AUTO: usize = 0;
+pub const IW_MODE_ADHOC: usize = 1;
+pub const IW_MODE_INFRA: usize = 2;
+pub const IW_MODE_MASTER: usize = 3;
+pub const IW_MODE_REPEAT: usize = 4;
+pub const IW_MODE_SECOND: usize = 5;
+pub const IW_MODE_MONITOR: usize = 6;
+pub const IW_MODE_MESH: usize = 7;
+
+pub const IW_QUAL_QUAL_UPDATED: ::c_ulong = 0x01;
+pub const IW_QUAL_LEVEL_UPDATED: ::c_ulong = 0x02;
+pub const IW_QUAL_NOISE_UPDATED: ::c_ulong = 0x04;
+pub const IW_QUAL_ALL_UPDATED: ::c_ulong = 0x07;
+pub const IW_QUAL_DBM: ::c_ulong = 0x08;
+pub const IW_QUAL_QUAL_INVALID: ::c_ulong = 0x10;
+pub const IW_QUAL_LEVEL_INVALID: ::c_ulong = 0x20;
+pub const IW_QUAL_NOISE_INVALID: ::c_ulong = 0x40;
+pub const IW_QUAL_RCPI: ::c_ulong = 0x80;
+pub const IW_QUAL_ALL_INVALID: ::c_ulong = 0x70;
+
+pub const IW_FREQ_AUTO: ::c_ulong = 0x00;
+pub const IW_FREQ_FIXED: ::c_ulong = 0x01;
+
+pub const IW_MAX_ENCODING_SIZES: usize = 8;
+pub const IW_ENCODING_TOKEN_MAX: usize = 64;
+
+pub const IW_ENCODE_INDEX: ::c_ulong = 0x00FF;
+pub const IW_ENCODE_FLAGS: ::c_ulong = 0xFF00;
+pub const IW_ENCODE_MODE: ::c_ulong = 0xF000;
+pub const IW_ENCODE_DISABLED: ::c_ulong = 0x8000;
+pub const IW_ENCODE_ENABLED: ::c_ulong = 0x0000;
+pub const IW_ENCODE_RESTRICTED: ::c_ulong = 0x4000;
+pub const IW_ENCODE_OPEN: ::c_ulong = 0x2000;
+pub const IW_ENCODE_NOKEY: ::c_ulong = 0x0800;
+pub const IW_ENCODE_TEMP: ::c_ulong = 0x0400;
+
+pub const IW_POWER_ON: ::c_ulong = 0x0000;
+pub const IW_POWER_TYPE: ::c_ulong = 0xF000;
+pub const IW_POWER_PERIOD: ::c_ulong = 0x1000;
+pub const IW_POWER_TIMEOUT: ::c_ulong = 0x2000;
+pub const IW_POWER_MODE: ::c_ulong = 0x0F00;
+pub const IW_POWER_UNICAST_R: ::c_ulong = 0x0100;
+pub const IW_POWER_MULTICAST_R: ::c_ulong = 0x0200;
+pub const IW_POWER_ALL_R: ::c_ulong = 0x0300;
+pub const IW_POWER_FORCE_S: ::c_ulong = 0x0400;
+pub const IW_POWER_REPEATER: ::c_ulong = 0x0800;
+pub const IW_POWER_MODIFIER: ::c_ulong = 0x000F;
+pub const IW_POWER_MIN: ::c_ulong = 0x0001;
+pub const IW_POWER_MAX: ::c_ulong = 0x0002;
+pub const IW_POWER_RELATIVE: ::c_ulong = 0x0004;
+
+pub const IW_TXPOW_TYPE: ::c_ulong = 0x00FF;
+pub const IW_TXPOW_DBM: ::c_ulong = 0x0000;
+pub const IW_TXPOW_MWATT: ::c_ulong = 0x0001;
+pub const IW_TXPOW_RELATIVE: ::c_ulong = 0x0002;
+pub const IW_TXPOW_RANGE: ::c_ulong = 0x1000;
+
+pub const IW_RETRY_ON: ::c_ulong = 0x0000;
+pub const IW_RETRY_TYPE: ::c_ulong = 0xF000;
+pub const IW_RETRY_LIMIT: ::c_ulong = 0x1000;
+pub const IW_RETRY_LIFETIME: ::c_ulong = 0x2000;
+pub const IW_RETRY_MODIFIER: ::c_ulong = 0x00FF;
+pub const IW_RETRY_MIN: ::c_ulong = 0x0001;
+pub const IW_RETRY_MAX: ::c_ulong = 0x0002;
+pub const IW_RETRY_RELATIVE: ::c_ulong = 0x0004;
+pub const IW_RETRY_SHORT: ::c_ulong = 0x0010;
+pub const IW_RETRY_LONG: ::c_ulong = 0x0020;
+
+pub const IW_SCAN_DEFAULT: ::c_ulong = 0x0000;
+pub const IW_SCAN_ALL_ESSID: ::c_ulong = 0x0001;
+pub const IW_SCAN_THIS_ESSID: ::c_ulong = 0x0002;
+pub const IW_SCAN_ALL_FREQ: ::c_ulong = 0x0004;
+pub const IW_SCAN_THIS_FREQ: ::c_ulong = 0x0008;
+pub const IW_SCAN_ALL_MODE: ::c_ulong = 0x0010;
+pub const IW_SCAN_THIS_MODE: ::c_ulong = 0x0020;
+pub const IW_SCAN_ALL_RATE: ::c_ulong = 0x0040;
+pub const IW_SCAN_THIS_RATE: ::c_ulong = 0x0080;
+
+pub const IW_SCAN_TYPE_ACTIVE: usize = 0;
+pub const IW_SCAN_TYPE_PASSIVE: usize = 1;
+
+pub const IW_SCAN_MAX_DATA: usize = 4096;
+
+pub const IW_SCAN_CAPA_NONE: ::c_ulong = 0x00;
+pub const IW_SCAN_CAPA_ESSID: ::c_ulong = 0x01;
+pub const IW_SCAN_CAPA_BSSID: ::c_ulong = 0x02;
+pub const IW_SCAN_CAPA_CHANNEL: ::c_ulong = 0x04;
+pub const IW_SCAN_CAPA_MODE: ::c_ulong = 0x08;
+pub const IW_SCAN_CAPA_RATE: ::c_ulong = 0x10;
+pub const IW_SCAN_CAPA_TYPE: ::c_ulong = 0x20;
+pub const IW_SCAN_CAPA_TIME: ::c_ulong = 0x40;
+
+pub const IW_CUSTOM_MAX: ::c_ulong = 256;
+
+pub const IW_GENERIC_IE_MAX: ::c_ulong = 1024;
+
+pub const IW_MLME_DEAUTH: ::c_ulong = 0;
+pub const IW_MLME_DISASSOC: ::c_ulong = 1;
+pub const IW_MLME_AUTH: ::c_ulong = 2;
+pub const IW_MLME_ASSOC: ::c_ulong = 3;
+
+pub const IW_AUTH_INDEX: ::c_ulong = 0x0FFF;
+pub const IW_AUTH_FLAGS: ::c_ulong = 0xF000;
+
+pub const IW_AUTH_WPA_VERSION: usize = 0;
+pub const IW_AUTH_CIPHER_PAIRWISE: usize = 1;
+pub const IW_AUTH_CIPHER_GROUP: usize = 2;
+pub const IW_AUTH_KEY_MGMT: usize = 3;
+pub const IW_AUTH_TKIP_COUNTERMEASURES: usize = 4;
+pub const IW_AUTH_DROP_UNENCRYPTED: usize = 5;
+pub const IW_AUTH_80211_AUTH_ALG: usize = 6;
+pub const IW_AUTH_WPA_ENABLED: usize = 7;
+pub const IW_AUTH_RX_UNENCRYPTED_EAPOL: usize = 8;
+pub const IW_AUTH_ROAMING_CONTROL: usize = 9;
+pub const IW_AUTH_PRIVACY_INVOKED: usize = 10;
+pub const IW_AUTH_CIPHER_GROUP_MGMT: usize = 11;
+pub const IW_AUTH_MFP: usize = 12;
+
+pub const IW_AUTH_WPA_VERSION_DISABLED: ::c_ulong = 0x00000001;
+pub const IW_AUTH_WPA_VERSION_WPA: ::c_ulong = 0x00000002;
+pub const IW_AUTH_WPA_VERSION_WPA2: ::c_ulong = 0x00000004;
+
+pub const IW_AUTH_CIPHER_NONE: ::c_ulong = 0x00000001;
+pub const IW_AUTH_CIPHER_WEP40: ::c_ulong = 0x00000002;
+pub const IW_AUTH_CIPHER_TKIP: ::c_ulong = 0x00000004;
+pub const IW_AUTH_CIPHER_CCMP: ::c_ulong = 0x00000008;
+pub const IW_AUTH_CIPHER_WEP104: ::c_ulong = 0x00000010;
+pub const IW_AUTH_CIPHER_AES_CMAC: ::c_ulong = 0x00000020;
+
+pub const IW_AUTH_KEY_MGMT_802_1X: usize = 1;
+pub const IW_AUTH_KEY_MGMT_PSK: usize = 2;
+
+pub const IW_AUTH_ALG_OPEN_SYSTEM: ::c_ulong = 0x00000001;
+pub const IW_AUTH_ALG_SHARED_KEY: ::c_ulong = 0x00000002;
+pub const IW_AUTH_ALG_LEAP: ::c_ulong = 0x00000004;
+
+pub const IW_AUTH_ROAMING_ENABLE: usize = 0;
+pub const IW_AUTH_ROAMING_DISABLE: usize = 1;
+
+pub const IW_AUTH_MFP_DISABLED: usize = 0;
+pub const IW_AUTH_MFP_OPTIONAL: usize = 1;
+pub const IW_AUTH_MFP_REQUIRED: usize = 2;
+
+pub const IW_ENCODE_SEQ_MAX_SIZE: usize = 8;
+
+pub const IW_ENCODE_ALG_NONE: usize = 0;
+pub const IW_ENCODE_ALG_WEP: usize = 1;
+pub const IW_ENCODE_ALG_TKIP: usize = 2;
+pub const IW_ENCODE_ALG_CCMP: usize = 3;
+pub const IW_ENCODE_ALG_PMK: usize = 4;
+pub const IW_ENCODE_ALG_AES_CMAC: usize = 5;
+
+pub const IW_ENCODE_EXT_TX_SEQ_VALID: ::c_ulong = 0x00000001;
+pub const IW_ENCODE_EXT_RX_SEQ_VALID: ::c_ulong = 0x00000002;
+pub const IW_ENCODE_EXT_GROUP_KEY: ::c_ulong = 0x00000004;
+pub const IW_ENCODE_EXT_SET_TX_KEY: ::c_ulong = 0x00000008;
+
+pub const IW_MICFAILURE_KEY_ID: ::c_ulong = 0x00000003;
+pub const IW_MICFAILURE_GROUP: ::c_ulong = 0x00000004;
+pub const IW_MICFAILURE_PAIRWISE: ::c_ulong = 0x00000008;
+pub const IW_MICFAILURE_STAKEY: ::c_ulong = 0x00000010;
+pub const IW_MICFAILURE_COUNT: ::c_ulong = 0x00000060;
+
+pub const IW_ENC_CAPA_WPA: ::c_ulong = 0x00000001;
+pub const IW_ENC_CAPA_WPA2: ::c_ulong = 0x00000002;
+pub const IW_ENC_CAPA_CIPHER_TKIP: ::c_ulong = 0x00000004;
+pub const IW_ENC_CAPA_CIPHER_CCMP: ::c_ulong = 0x00000008;
+pub const IW_ENC_CAPA_4WAY_HANDSHAKE: ::c_ulong = 0x00000010;
+
+pub const IW_PMKSA_ADD: usize = 1;
+pub const IW_PMKSA_REMOVE: usize = 2;
+pub const IW_PMKSA_FLUSH: usize = 3;
+
+pub const IW_PMKID_LEN: usize = 16;
+
+pub const IW_PMKID_CAND_PREAUTH: ::c_ulong = 0x00000001;
+
+pub const IW_EV_LCP_PK_LEN: usize = 4;
+
+pub const IW_EV_CHAR_PK_LEN: usize = IW_EV_LCP_PK_LEN + ::IFNAMSIZ;
+pub const IW_EV_POINT_PK_LEN: usize = IW_EV_LCP_PK_LEN + 4;
+
+pub const IPTOS_TOS_MASK: u8 = 0x1E;
+pub const IPTOS_PREC_MASK: u8 = 0xE0;
+
+pub const IPTOS_ECN_NOT_ECT: u8 = 0x00;
+
+pub const RTF_UP: ::c_ushort = 0x0001;
+pub const RTF_GATEWAY: ::c_ushort = 0x0002;
+
+pub const RTF_HOST: ::c_ushort = 0x0004;
+pub const RTF_REINSTATE: ::c_ushort = 0x0008;
+pub const RTF_DYNAMIC: ::c_ushort = 0x0010;
+pub const RTF_MODIFIED: ::c_ushort = 0x0020;
+pub const RTF_MTU: ::c_ushort = 0x0040;
+pub const RTF_MSS: ::c_ushort = RTF_MTU;
+pub const RTF_WINDOW: ::c_ushort = 0x0080;
+pub const RTF_IRTT: ::c_ushort = 0x0100;
+pub const RTF_REJECT: ::c_ushort = 0x0200;
+pub const RTF_STATIC: ::c_ushort = 0x0400;
+pub const RTF_XRESOLVE: ::c_ushort = 0x0800;
+pub const RTF_NOFORWARD: ::c_ushort = 0x1000;
+pub const RTF_THROW: ::c_ushort = 0x2000;
+pub const RTF_NOPMTUDISC: ::c_ushort = 0x4000;
+
+pub const RTF_DEFAULT: u32 = 0x00010000;
+pub const RTF_ALLONLINK: u32 = 0x00020000;
+pub const RTF_ADDRCONF: u32 = 0x00040000;
+pub const RTF_LINKRT: u32 = 0x00100000;
+pub const RTF_NONEXTHOP: u32 = 0x00200000;
+pub const RTF_CACHE: u32 = 0x01000000;
+pub const RTF_FLOW: u32 = 0x02000000;
+pub const RTF_POLICY: u32 = 0x04000000;
+
+pub const RTCF_VALVE: u32 = 0x00200000;
+pub const RTCF_MASQ: u32 = 0x00400000;
+pub const RTCF_NAT: u32 = 0x00800000;
+pub const RTCF_DOREDIRECT: u32 = 0x01000000;
+pub const RTCF_LOG: u32 = 0x02000000;
+pub const RTCF_DIRECTSRC: u32 = 0x04000000;
+
+pub const RTF_LOCAL: u32 = 0x80000000;
+pub const RTF_INTERFACE: u32 = 0x40000000;
+pub const RTF_MULTICAST: u32 = 0x20000000;
+pub const RTF_BROADCAST: u32 = 0x10000000;
+pub const RTF_NAT: u32 = 0x08000000;
+pub const RTF_ADDRCLASSMASK: u32 = 0xF8000000;
+
+pub const RT_CLASS_UNSPEC: u8 = 0;
+pub const RT_CLASS_DEFAULT: u8 = 253;
+pub const RT_CLASS_MAIN: u8 = 254;
+pub const RT_CLASS_LOCAL: u8 = 255;
+pub const RT_CLASS_MAX: u8 = 255;
+
+// linux/neighbor.h
+pub const NUD_NONE: u16 = 0x00;
+pub const NUD_INCOMPLETE: u16 = 0x01;
+pub const NUD_REACHABLE: u16 = 0x02;
+pub const NUD_STALE: u16 = 0x04;
+pub const NUD_DELAY: u16 = 0x08;
+pub const NUD_PROBE: u16 = 0x10;
+pub const NUD_FAILED: u16 = 0x20;
+pub const NUD_NOARP: u16 = 0x40;
+pub const NUD_PERMANENT: u16 = 0x80;
+
+pub const NTF_USE: u8 = 0x01;
+pub const NTF_SELF: u8 = 0x02;
+pub const NTF_MASTER: u8 = 0x04;
+pub const NTF_PROXY: u8 = 0x08;
+pub const NTF_ROUTER: u8 = 0x80;
+
+pub const NDA_UNSPEC: ::c_ushort = 0;
+pub const NDA_DST: ::c_ushort = 1;
+pub const NDA_LLADDR: ::c_ushort = 2;
+pub const NDA_CACHEINFO: ::c_ushort = 3;
+pub const NDA_PROBES: ::c_ushort = 4;
+pub const NDA_VLAN: ::c_ushort = 5;
+pub const NDA_PORT: ::c_ushort = 6;
+pub const NDA_VNI: ::c_ushort = 7;
+pub const NDA_IFINDEX: ::c_ushort = 8;
+
+// linux/netlink.h
+pub const NLA_ALIGNTO: ::c_int = 4;
+
+pub const NETLINK_ROUTE: ::c_int = 0;
+pub const NETLINK_UNUSED: ::c_int = 1;
+pub const NETLINK_USERSOCK: ::c_int = 2;
+pub const NETLINK_FIREWALL: ::c_int = 3;
+pub const NETLINK_SOCK_DIAG: ::c_int = 4;
+pub const NETLINK_NFLOG: ::c_int = 5;
+pub const NETLINK_XFRM: ::c_int = 6;
+pub const NETLINK_SELINUX: ::c_int = 7;
+pub const NETLINK_ISCSI: ::c_int = 8;
+pub const NETLINK_AUDIT: ::c_int = 9;
+pub const NETLINK_FIB_LOOKUP: ::c_int = 10;
+pub const NETLINK_CONNECTOR: ::c_int = 11;
+pub const NETLINK_NETFILTER: ::c_int = 12;
+pub const NETLINK_IP6_FW: ::c_int = 13;
+pub const NETLINK_DNRTMSG: ::c_int = 14;
+pub const NETLINK_KOBJECT_UEVENT: ::c_int = 15;
+pub const NETLINK_GENERIC: ::c_int = 16;
+pub const NETLINK_SCSITRANSPORT: ::c_int = 18;
+pub const NETLINK_ECRYPTFS: ::c_int = 19;
+pub const NETLINK_RDMA: ::c_int = 20;
+pub const NETLINK_CRYPTO: ::c_int = 21;
+pub const NETLINK_INET_DIAG: ::c_int = NETLINK_SOCK_DIAG;
+
+pub const NLM_F_REQUEST: ::c_int = 1;
+pub const NLM_F_MULTI: ::c_int = 2;
+pub const NLM_F_ACK: ::c_int = 4;
+pub const NLM_F_ECHO: ::c_int = 8;
+pub const NLM_F_DUMP_INTR: ::c_int = 16;
+pub const NLM_F_DUMP_FILTERED: ::c_int = 32;
+
+pub const NLM_F_ROOT: ::c_int = 0x100;
+pub const NLM_F_MATCH: ::c_int = 0x200;
+pub const NLM_F_ATOMIC: ::c_int = 0x400;
+pub const NLM_F_DUMP: ::c_int = NLM_F_ROOT | NLM_F_MATCH;
+
+pub const NLM_F_REPLACE: ::c_int = 0x100;
+pub const NLM_F_EXCL: ::c_int = 0x200;
+pub const NLM_F_CREATE: ::c_int = 0x400;
+pub const NLM_F_APPEND: ::c_int = 0x800;
+
+pub const NETLINK_ADD_MEMBERSHIP: ::c_int = 1;
+pub const NETLINK_DROP_MEMBERSHIP: ::c_int = 2;
+pub const NETLINK_PKTINFO: ::c_int = 3;
+pub const NETLINK_BROADCAST_ERROR: ::c_int = 4;
+pub const NETLINK_NO_ENOBUFS: ::c_int = 5;
+pub const NETLINK_RX_RING: ::c_int = 6;
+pub const NETLINK_TX_RING: ::c_int = 7;
+pub const NETLINK_LISTEN_ALL_NSID: ::c_int = 8;
+pub const NETLINK_LIST_MEMBERSHIPS: ::c_int = 9;
+pub const NETLINK_CAP_ACK: ::c_int = 10;
+pub const NETLINK_EXT_ACK: ::c_int = 11;
+pub const NETLINK_GET_STRICT_CHK: ::c_int = 12;
+
+pub const NLA_F_NESTED: ::c_int = 1 << 15;
+pub const NLA_F_NET_BYTEORDER: ::c_int = 1 << 14;
+pub const NLA_TYPE_MASK: ::c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER);
+
+// linux/rtnetlink.h
+pub const TCA_UNSPEC: ::c_ushort = 0;
+pub const TCA_KIND: ::c_ushort = 1;
+pub const TCA_OPTIONS: ::c_ushort = 2;
+pub const TCA_STATS: ::c_ushort = 3;
+pub const TCA_XSTATS: ::c_ushort = 4;
+pub const TCA_RATE: ::c_ushort = 5;
+pub const TCA_FCNT: ::c_ushort = 6;
+pub const TCA_STATS2: ::c_ushort = 7;
+pub const TCA_STAB: ::c_ushort = 8;
+
+pub const RTM_NEWLINK: u16 = 16;
+pub const RTM_DELLINK: u16 = 17;
+pub const RTM_GETLINK: u16 = 18;
+pub const RTM_SETLINK: u16 = 19;
+pub const RTM_NEWADDR: u16 = 20;
+pub const RTM_DELADDR: u16 = 21;
+pub const RTM_GETADDR: u16 = 22;
+pub const RTM_NEWROUTE: u16 = 24;
+pub const RTM_DELROUTE: u16 = 25;
+pub const RTM_GETROUTE: u16 = 26;
+pub const RTM_NEWNEIGH: u16 = 28;
+pub const RTM_DELNEIGH: u16 = 29;
+pub const RTM_GETNEIGH: u16 = 30;
+pub const RTM_NEWRULE: u16 = 32;
+pub const RTM_DELRULE: u16 = 33;
+pub const RTM_GETRULE: u16 = 34;
+pub const RTM_NEWQDISC: u16 = 36;
+pub const RTM_DELQDISC: u16 = 37;
+pub const RTM_GETQDISC: u16 = 38;
+pub const RTM_NEWTCLASS: u16 = 40;
+pub const RTM_DELTCLASS: u16 = 41;
+pub const RTM_GETTCLASS: u16 = 42;
+pub const RTM_NEWTFILTER: u16 = 44;
+pub const RTM_DELTFILTER: u16 = 45;
+pub const RTM_GETTFILTER: u16 = 46;
+pub const RTM_NEWACTION: u16 = 48;
+pub const RTM_DELACTION: u16 = 49;
+pub const RTM_GETACTION: u16 = 50;
+pub const RTM_NEWPREFIX: u16 = 52;
+pub const RTM_GETMULTICAST: u16 = 58;
+pub const RTM_GETANYCAST: u16 = 62;
+pub const RTM_NEWNEIGHTBL: u16 = 64;
+pub const RTM_GETNEIGHTBL: u16 = 66;
+pub const RTM_SETNEIGHTBL: u16 = 67;
+pub const RTM_NEWNDUSEROPT: u16 = 68;
+pub const RTM_NEWADDRLABEL: u16 = 72;
+pub const RTM_DELADDRLABEL: u16 = 73;
+pub const RTM_GETADDRLABEL: u16 = 74;
+pub const RTM_GETDCB: u16 = 78;
+pub const RTM_SETDCB: u16 = 79;
+pub const RTM_NEWNETCONF: u16 = 80;
+pub const RTM_GETNETCONF: u16 = 82;
+pub const RTM_NEWMDB: u16 = 84;
+pub const RTM_DELMDB: u16 = 85;
+pub const RTM_GETMDB: u16 = 86;
+pub const RTM_NEWNSID: u16 = 88;
+pub const RTM_DELNSID: u16 = 89;
+pub const RTM_GETNSID: u16 = 90;
+
+pub const RTM_F_NOTIFY: ::c_uint = 0x100;
+pub const RTM_F_CLONED: ::c_uint = 0x200;
+pub const RTM_F_EQUALIZE: ::c_uint = 0x400;
+pub const RTM_F_PREFIX: ::c_uint = 0x800;
+
+pub const RTA_UNSPEC: ::c_ushort = 0;
+pub const RTA_DST: ::c_ushort = 1;
+pub const RTA_SRC: ::c_ushort = 2;
+pub const RTA_IIF: ::c_ushort = 3;
+pub const RTA_OIF: ::c_ushort = 4;
+pub const RTA_GATEWAY: ::c_ushort = 5;
+pub const RTA_PRIORITY: ::c_ushort = 6;
+pub const RTA_PREFSRC: ::c_ushort = 7;
+pub const RTA_METRICS: ::c_ushort = 8;
+pub const RTA_MULTIPATH: ::c_ushort = 9;
+pub const RTA_PROTOINFO: ::c_ushort = 10; // No longer used
+pub const RTA_FLOW: ::c_ushort = 11;
+pub const RTA_CACHEINFO: ::c_ushort = 12;
+pub const RTA_SESSION: ::c_ushort = 13; // No longer used
+pub const RTA_MP_ALGO: ::c_ushort = 14; // No longer used
+pub const RTA_TABLE: ::c_ushort = 15;
+pub const RTA_MARK: ::c_ushort = 16;
+pub const RTA_MFC_STATS: ::c_ushort = 17;
+
+pub const RTN_UNSPEC: ::c_uchar = 0;
+pub const RTN_UNICAST: ::c_uchar = 1;
+pub const RTN_LOCAL: ::c_uchar = 2;
+pub const RTN_BROADCAST: ::c_uchar = 3;
+pub const RTN_ANYCAST: ::c_uchar = 4;
+pub const RTN_MULTICAST: ::c_uchar = 5;
+pub const RTN_BLACKHOLE: ::c_uchar = 6;
+pub const RTN_UNREACHABLE: ::c_uchar = 7;
+pub const RTN_PROHIBIT: ::c_uchar = 8;
+pub const RTN_THROW: ::c_uchar = 9;
+pub const RTN_NAT: ::c_uchar = 10;
+pub const RTN_XRESOLVE: ::c_uchar = 11;
+
+pub const RTPROT_UNSPEC: ::c_uchar = 0;
+pub const RTPROT_REDIRECT: ::c_uchar = 1;
+pub const RTPROT_KERNEL: ::c_uchar = 2;
+pub const RTPROT_BOOT: ::c_uchar = 3;
+pub const RTPROT_STATIC: ::c_uchar = 4;
+
+pub const RT_SCOPE_UNIVERSE: ::c_uchar = 0;
+pub const RT_SCOPE_SITE: ::c_uchar = 200;
+pub const RT_SCOPE_LINK: ::c_uchar = 253;
+pub const RT_SCOPE_HOST: ::c_uchar = 254;
+pub const RT_SCOPE_NOWHERE: ::c_uchar = 255;
+
+pub const RT_TABLE_UNSPEC: ::c_uchar = 0;
+pub const RT_TABLE_COMPAT: ::c_uchar = 252;
+pub const RT_TABLE_DEFAULT: ::c_uchar = 253;
+pub const RT_TABLE_MAIN: ::c_uchar = 254;
+pub const RT_TABLE_LOCAL: ::c_uchar = 255;
+
+pub const RTMSG_OVERRUN: u32 = ::NLMSG_OVERRUN as u32;
+pub const RTMSG_NEWDEVICE: u32 = 0x11;
+pub const RTMSG_DELDEVICE: u32 = 0x12;
+pub const RTMSG_NEWROUTE: u32 = 0x21;
+pub const RTMSG_DELROUTE: u32 = 0x22;
+pub const RTMSG_NEWRULE: u32 = 0x31;
+pub const RTMSG_DELRULE: u32 = 0x32;
+pub const RTMSG_CONTROL: u32 = 0x40;
+pub const RTMSG_AR_FAILED: u32 = 0x51;
+
+pub const MAX_ADDR_LEN: usize = 7;
+pub const ARPD_UPDATE: ::c_ushort = 0x01;
+pub const ARPD_LOOKUP: ::c_ushort = 0x02;
+pub const ARPD_FLUSH: ::c_ushort = 0x03;
+pub const ATF_MAGIC: ::c_int = 0x80;
+
+pub const RTEXT_FILTER_VF: ::c_int = 1 << 0;
+pub const RTEXT_FILTER_BRVLAN: ::c_int = 1 << 1;
+pub const RTEXT_FILTER_BRVLAN_COMPRESSED: ::c_int = 1 << 2;
+pub const RTEXT_FILTER_SKIP_STATS: ::c_int = 1 << 3;
+pub const RTEXT_FILTER_MRP: ::c_int = 1 << 4;
+pub const RTEXT_FILTER_CFM_CONFIG: ::c_int = 1 << 5;
+pub const RTEXT_FILTER_CFM_STATUS: ::c_int = 1 << 6;
+
+// userspace compat definitions for RTNLGRP_*
+pub const RTMGRP_LINK: ::c_int = 0x00001;
+pub const RTMGRP_NOTIFY: ::c_int = 0x00002;
+pub const RTMGRP_NEIGH: ::c_int = 0x00004;
+pub const RTMGRP_TC: ::c_int = 0x00008;
+pub const RTMGRP_IPV4_IFADDR: ::c_int = 0x00010;
+pub const RTMGRP_IPV4_MROUTE: ::c_int = 0x00020;
+pub const RTMGRP_IPV4_ROUTE: ::c_int = 0x00040;
+pub const RTMGRP_IPV4_RULE: ::c_int = 0x00080;
+pub const RTMGRP_IPV6_IFADDR: ::c_int = 0x00100;
+pub const RTMGRP_IPV6_MROUTE: ::c_int = 0x00200;
+pub const RTMGRP_IPV6_ROUTE: ::c_int = 0x00400;
+pub const RTMGRP_IPV6_IFINFO: ::c_int = 0x00800;
+pub const RTMGRP_DECnet_IFADDR: ::c_int = 0x01000;
+pub const RTMGRP_DECnet_ROUTE: ::c_int = 0x04000;
+pub const RTMGRP_IPV6_PREFIX: ::c_int = 0x20000;
+
+// enum rtnetlink_groups
+pub const RTNLGRP_NONE: ::c_uint = 0x00;
+pub const RTNLGRP_LINK: ::c_uint = 0x01;
+pub const RTNLGRP_NOTIFY: ::c_uint = 0x02;
+pub const RTNLGRP_NEIGH: ::c_uint = 0x03;
+pub const RTNLGRP_TC: ::c_uint = 0x04;
+pub const RTNLGRP_IPV4_IFADDR: ::c_uint = 0x05;
+pub const RTNLGRP_IPV4_MROUTE: ::c_uint = 0x06;
+pub const RTNLGRP_IPV4_ROUTE: ::c_uint = 0x07;
+pub const RTNLGRP_IPV4_RULE: ::c_uint = 0x08;
+pub const RTNLGRP_IPV6_IFADDR: ::c_uint = 0x09;
+pub const RTNLGRP_IPV6_MROUTE: ::c_uint = 0x0a;
+pub const RTNLGRP_IPV6_ROUTE: ::c_uint = 0x0b;
+pub const RTNLGRP_IPV6_IFINFO: ::c_uint = 0x0c;
+pub const RTNLGRP_DECnet_IFADDR: ::c_uint = 0x0d;
+pub const RTNLGRP_NOP2: ::c_uint = 0x0e;
+pub const RTNLGRP_DECnet_ROUTE: ::c_uint = 0x0f;
+pub const RTNLGRP_DECnet_RULE: ::c_uint = 0x10;
+pub const RTNLGRP_NOP4: ::c_uint = 0x11;
+pub const RTNLGRP_IPV6_PREFIX: ::c_uint = 0x12;
+pub const RTNLGRP_IPV6_RULE: ::c_uint = 0x13;
+pub const RTNLGRP_ND_USEROPT: ::c_uint = 0x14;
+pub const RTNLGRP_PHONET_IFADDR: ::c_uint = 0x15;
+pub const RTNLGRP_PHONET_ROUTE: ::c_uint = 0x16;
+pub const RTNLGRP_DCB: ::c_uint = 0x17;
+pub const RTNLGRP_IPV4_NETCONF: ::c_uint = 0x18;
+pub const RTNLGRP_IPV6_NETCONF: ::c_uint = 0x19;
+pub const RTNLGRP_MDB: ::c_uint = 0x1a;
+pub const RTNLGRP_MPLS_ROUTE: ::c_uint = 0x1b;
+pub const RTNLGRP_NSID: ::c_uint = 0x1c;
+pub const RTNLGRP_MPLS_NETCONF: ::c_uint = 0x1d;
+pub const RTNLGRP_IPV4_MROUTE_R: ::c_uint = 0x1e;
+pub const RTNLGRP_IPV6_MROUTE_R: ::c_uint = 0x1f;
+pub const RTNLGRP_NEXTHOP: ::c_uint = 0x20;
+pub const RTNLGRP_BRVLAN: ::c_uint = 0x21;
+pub const RTNLGRP_MCTP_IFADDR: ::c_uint = 0x22;
+pub const RTNLGRP_TUNNEL: ::c_uint = 0x23;
+pub const RTNLGRP_STATS: ::c_uint = 0x24;
+
+// linux/module.h
+pub const MODULE_INIT_IGNORE_MODVERSIONS: ::c_uint = 0x0001;
+pub const MODULE_INIT_IGNORE_VERMAGIC: ::c_uint = 0x0002;
+
+// linux/net_tstamp.h
+pub const SOF_TIMESTAMPING_TX_HARDWARE: ::c_uint = 1 << 0;
+pub const SOF_TIMESTAMPING_TX_SOFTWARE: ::c_uint = 1 << 1;
+pub const SOF_TIMESTAMPING_RX_HARDWARE: ::c_uint = 1 << 2;
+pub const SOF_TIMESTAMPING_RX_SOFTWARE: ::c_uint = 1 << 3;
+pub const SOF_TIMESTAMPING_SOFTWARE: ::c_uint = 1 << 4;
+pub const SOF_TIMESTAMPING_SYS_HARDWARE: ::c_uint = 1 << 5;
+pub const SOF_TIMESTAMPING_RAW_HARDWARE: ::c_uint = 1 << 6;
+pub const SOF_TIMESTAMPING_OPT_ID: ::c_uint = 1 << 7;
+pub const SOF_TIMESTAMPING_TX_SCHED: ::c_uint = 1 << 8;
+pub const SOF_TIMESTAMPING_TX_ACK: ::c_uint = 1 << 9;
+pub const SOF_TIMESTAMPING_OPT_CMSG: ::c_uint = 1 << 10;
+pub const SOF_TIMESTAMPING_OPT_TSONLY: ::c_uint = 1 << 11;
+pub const SOF_TIMESTAMPING_OPT_STATS: ::c_uint = 1 << 12;
+pub const SOF_TIMESTAMPING_OPT_PKTINFO: ::c_uint = 1 << 13;
+pub const SOF_TIMESTAMPING_OPT_TX_SWHW: ::c_uint = 1 << 14;
+pub const SOF_TXTIME_DEADLINE_MODE: u32 = 1 << 0;
+pub const SOF_TXTIME_REPORT_ERRORS: u32 = 1 << 1;
+
+pub const HWTSTAMP_TX_OFF: ::c_uint = 0;
+pub const HWTSTAMP_TX_ON: ::c_uint = 1;
+pub const HWTSTAMP_TX_ONESTEP_SYNC: ::c_uint = 2;
+pub const HWTSTAMP_TX_ONESTEP_P2P: ::c_uint = 3;
+
+pub const HWTSTAMP_FILTER_NONE: ::c_uint = 0;
+pub const HWTSTAMP_FILTER_ALL: ::c_uint = 1;
+pub const HWTSTAMP_FILTER_SOME: ::c_uint = 2;
+pub const HWTSTAMP_FILTER_PTP_V1_L4_EVENT: ::c_uint = 3;
+pub const HWTSTAMP_FILTER_PTP_V1_L4_SYNC: ::c_uint = 4;
+pub const HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ: ::c_uint = 5;
+pub const HWTSTAMP_FILTER_PTP_V2_L4_EVENT: ::c_uint = 6;
+pub const HWTSTAMP_FILTER_PTP_V2_L4_SYNC: ::c_uint = 7;
+pub const HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ: ::c_uint = 8;
+pub const HWTSTAMP_FILTER_PTP_V2_L2_EVENT: ::c_uint = 9;
+pub const HWTSTAMP_FILTER_PTP_V2_L2_SYNC: ::c_uint = 10;
+pub const HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ: ::c_uint = 11;
+pub const HWTSTAMP_FILTER_PTP_V2_EVENT: ::c_uint = 12;
+pub const HWTSTAMP_FILTER_PTP_V2_SYNC: ::c_uint = 13;
+pub const HWTSTAMP_FILTER_PTP_V2_DELAY_REQ: ::c_uint = 14;
+pub const HWTSTAMP_FILTER_NTP_ALL: ::c_uint = 15;
+
+// linux/tls.h
+pub const TLS_TX: ::c_int = 1;
+pub const TLS_RX: ::c_int = 2;
+
+pub const TLS_1_2_VERSION_MAJOR: ::__u8 = 0x3;
+pub const TLS_1_2_VERSION_MINOR: ::__u8 = 0x3;
+pub const TLS_1_2_VERSION: ::__u16 =
+    ((TLS_1_2_VERSION_MAJOR as ::__u16) << 8) | (TLS_1_2_VERSION_MINOR as ::__u16);
+
+pub const TLS_1_3_VERSION_MAJOR: ::__u8 = 0x3;
+pub const TLS_1_3_VERSION_MINOR: ::__u8 = 0x4;
+pub const TLS_1_3_VERSION: ::__u16 =
+    ((TLS_1_3_VERSION_MAJOR as ::__u16) << 8) | (TLS_1_3_VERSION_MINOR as ::__u16);
+
+pub const TLS_CIPHER_AES_GCM_128: ::__u16 = 51;
+pub const TLS_CIPHER_AES_GCM_128_IV_SIZE: usize = 8;
+pub const TLS_CIPHER_AES_GCM_128_KEY_SIZE: usize = 16;
+pub const TLS_CIPHER_AES_GCM_128_SALT_SIZE: usize = 4;
+pub const TLS_CIPHER_AES_GCM_128_TAG_SIZE: usize = 16;
+pub const TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE: usize = 8;
+
+pub const TLS_CIPHER_AES_GCM_256: ::__u16 = 52;
+pub const TLS_CIPHER_AES_GCM_256_IV_SIZE: usize = 8;
+pub const TLS_CIPHER_AES_GCM_256_KEY_SIZE: usize = 32;
+pub const TLS_CIPHER_AES_GCM_256_SALT_SIZE: usize = 4;
+pub const TLS_CIPHER_AES_GCM_256_TAG_SIZE: usize = 16;
+pub const TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE: usize = 8;
+
+pub const TLS_CIPHER_CHACHA20_POLY1305: ::__u16 = 54;
+pub const TLS_CIPHER_CHACHA20_POLY1305_IV_SIZE: usize = 12;
+pub const TLS_CIPHER_CHACHA20_POLY1305_KEY_SIZE: usize = 32;
+pub const TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE: usize = 0;
+pub const TLS_CIPHER_CHACHA20_POLY1305_TAG_SIZE: usize = 16;
+pub const TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE: usize = 8;
+
+pub const TLS_SET_RECORD_TYPE: ::c_int = 1;
+pub const TLS_GET_RECORD_TYPE: ::c_int = 2;
+
+pub const SOL_TLS: ::c_int = 282;
+
+// linux/if_alg.h
+pub const ALG_SET_KEY: ::c_int = 1;
+pub const ALG_SET_IV: ::c_int = 2;
+pub const ALG_SET_OP: ::c_int = 3;
+pub const ALG_SET_AEAD_ASSOCLEN: ::c_int = 4;
+pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5;
+pub const ALG_SET_DRBG_ENTROPY: ::c_int = 6;
+pub const ALG_SET_KEY_BY_KEY_SERIAL: ::c_int = 7;
+
+pub const ALG_OP_DECRYPT: ::c_int = 0;
+pub const ALG_OP_ENCRYPT: ::c_int = 1;
+
+// include/uapi/linux/if.h
+pub const IF_OPER_UNKNOWN: ::c_int = 0;
+pub const IF_OPER_NOTPRESENT: ::c_int = 1;
+pub const IF_OPER_DOWN: ::c_int = 2;
+pub const IF_OPER_LOWERLAYERDOWN: ::c_int = 3;
+pub const IF_OPER_TESTING: ::c_int = 4;
+pub const IF_OPER_DORMANT: ::c_int = 5;
+pub const IF_OPER_UP: ::c_int = 6;
+
+pub const IF_LINK_MODE_DEFAULT: ::c_int = 0;
+pub const IF_LINK_MODE_DORMANT: ::c_int = 1;
+pub const IF_LINK_MODE_TESTING: ::c_int = 2;
+
+// include/uapi/linux/udp.h
+pub const UDP_CORK: ::c_int = 1;
+pub const UDP_ENCAP: ::c_int = 100;
+pub const UDP_NO_CHECK6_TX: ::c_int = 101;
+pub const UDP_NO_CHECK6_RX: ::c_int = 102;
+
+// include/uapi/linux/mman.h
+pub const MAP_SHARED_VALIDATE: ::c_int = 0x3;
+
+// include/uapi/asm-generic/mman-common.h
+pub const MAP_FIXED_NOREPLACE: ::c_int = 0x100000;
+pub const MLOCK_ONFAULT: ::c_uint = 0x01;
+
+// uapi/linux/vm_sockets.h
+pub const VMADDR_CID_ANY: ::c_uint = 0xFFFFFFFF;
+pub const VMADDR_CID_HYPERVISOR: ::c_uint = 0;
+#[deprecated(
+    since = "0.2.74",
+    note = "VMADDR_CID_RESERVED is removed since Linux v5.6 and \
+            replaced with VMADDR_CID_LOCAL"
+)]
+pub const VMADDR_CID_RESERVED: ::c_uint = 1;
+pub const VMADDR_CID_LOCAL: ::c_uint = 1;
+pub const VMADDR_CID_HOST: ::c_uint = 2;
+pub const VMADDR_PORT_ANY: ::c_uint = 0xFFFFFFFF;
+
+// uapi/linux/inotify.h
+pub const IN_ACCESS: u32 = 0x0000_0001;
+pub const IN_MODIFY: u32 = 0x0000_0002;
+pub const IN_ATTRIB: u32 = 0x0000_0004;
+pub const IN_CLOSE_WRITE: u32 = 0x0000_0008;
+pub const IN_CLOSE_NOWRITE: u32 = 0x0000_0010;
+pub const IN_CLOSE: u32 = IN_CLOSE_WRITE | IN_CLOSE_NOWRITE;
+pub const IN_OPEN: u32 = 0x0000_0020;
+pub const IN_MOVED_FROM: u32 = 0x0000_0040;
+pub const IN_MOVED_TO: u32 = 0x0000_0080;
+pub const IN_MOVE: u32 = IN_MOVED_FROM | IN_MOVED_TO;
+pub const IN_CREATE: u32 = 0x0000_0100;
+pub const IN_DELETE: u32 = 0x0000_0200;
+pub const IN_DELETE_SELF: u32 = 0x0000_0400;
+pub const IN_MOVE_SELF: u32 = 0x0000_0800;
+pub const IN_UNMOUNT: u32 = 0x0000_2000;
+pub const IN_Q_OVERFLOW: u32 = 0x0000_4000;
+pub const IN_IGNORED: u32 = 0x0000_8000;
+pub const IN_ONLYDIR: u32 = 0x0100_0000;
+pub const IN_DONT_FOLLOW: u32 = 0x0200_0000;
+pub const IN_EXCL_UNLINK: u32 = 0x0400_0000;
+
+// linux/keyctl.h
+pub const KEY_SPEC_THREAD_KEYRING: i32 = -1;
+pub const KEY_SPEC_PROCESS_KEYRING: i32 = -2;
+pub const KEY_SPEC_SESSION_KEYRING: i32 = -3;
+pub const KEY_SPEC_USER_KEYRING: i32 = -4;
+pub const KEY_SPEC_USER_SESSION_KEYRING: i32 = -5;
+pub const KEY_SPEC_GROUP_KEYRING: i32 = -6;
+pub const KEY_SPEC_REQKEY_AUTH_KEY: i32 = -7;
+pub const KEY_SPEC_REQUESTOR_KEYRING: i32 = -8;
+
+pub const KEY_REQKEY_DEFL_NO_CHANGE: i32 = -1;
+pub const KEY_REQKEY_DEFL_DEFAULT: i32 = 0;
+pub const KEY_REQKEY_DEFL_THREAD_KEYRING: i32 = 1;
+pub const KEY_REQKEY_DEFL_PROCESS_KEYRING: i32 = 2;
+pub const KEY_REQKEY_DEFL_SESSION_KEYRING: i32 = 3;
+pub const KEY_REQKEY_DEFL_USER_KEYRING: i32 = 4;
+pub const KEY_REQKEY_DEFL_USER_SESSION_KEYRING: i32 = 5;
+pub const KEY_REQKEY_DEFL_GROUP_KEYRING: i32 = 6;
+pub const KEY_REQKEY_DEFL_REQUESTOR_KEYRING: i32 = 7;
+
+pub const KEYCTL_GET_KEYRING_ID: u32 = 0;
+pub const KEYCTL_JOIN_SESSION_KEYRING: u32 = 1;
+pub const KEYCTL_UPDATE: u32 = 2;
+pub const KEYCTL_REVOKE: u32 = 3;
+pub const KEYCTL_CHOWN: u32 = 4;
+pub const KEYCTL_SETPERM: u32 = 5;
+pub const KEYCTL_DESCRIBE: u32 = 6;
+pub const KEYCTL_CLEAR: u32 = 7;
+pub const KEYCTL_LINK: u32 = 8;
+pub const KEYCTL_UNLINK: u32 = 9;
+pub const KEYCTL_SEARCH: u32 = 10;
+pub const KEYCTL_READ: u32 = 11;
+pub const KEYCTL_INSTANTIATE: u32 = 12;
+pub const KEYCTL_NEGATE: u32 = 13;
+pub const KEYCTL_SET_REQKEY_KEYRING: u32 = 14;
+pub const KEYCTL_SET_TIMEOUT: u32 = 15;
+pub const KEYCTL_ASSUME_AUTHORITY: u32 = 16;
+pub const KEYCTL_GET_SECURITY: u32 = 17;
+pub const KEYCTL_SESSION_TO_PARENT: u32 = 18;
+pub const KEYCTL_REJECT: u32 = 19;
+pub const KEYCTL_INSTANTIATE_IOV: u32 = 20;
+pub const KEYCTL_INVALIDATE: u32 = 21;
+pub const KEYCTL_GET_PERSISTENT: u32 = 22;
+
+pub const IN_MASK_CREATE: u32 = 0x1000_0000;
+pub const IN_MASK_ADD: u32 = 0x2000_0000;
+pub const IN_ISDIR: u32 = 0x4000_0000;
+pub const IN_ONESHOT: u32 = 0x8000_0000;
+
+pub const IN_ALL_EVENTS: u32 = IN_ACCESS
+    | IN_MODIFY
+    | IN_ATTRIB
+    | IN_CLOSE_WRITE
+    | IN_CLOSE_NOWRITE
+    | IN_OPEN
+    | IN_MOVED_FROM
+    | IN_MOVED_TO
+    | IN_DELETE
+    | IN_CREATE
+    | IN_DELETE_SELF
+    | IN_MOVE_SELF;
+
+pub const IN_CLOEXEC: ::c_int = O_CLOEXEC;
+pub const IN_NONBLOCK: ::c_int = O_NONBLOCK;
+
+// uapi/linux/mount.h
+pub const OPEN_TREE_CLONE: ::c_uint = 0x01;
+pub const OPEN_TREE_CLOEXEC: ::c_uint = O_CLOEXEC as ::c_uint;
+
+// uapi/linux/netfilter/nf_tables.h
+pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256;
+pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256;
+pub const NFT_SET_MAXNAMELEN: ::c_int = 256;
+pub const NFT_OBJ_MAXNAMELEN: ::c_int = 256;
+pub const NFT_USERDATA_MAXLEN: ::c_int = 256;
+
+pub const NFT_REG_VERDICT: ::c_int = 0;
+pub const NFT_REG_1: ::c_int = 1;
+pub const NFT_REG_2: ::c_int = 2;
+pub const NFT_REG_3: ::c_int = 3;
+pub const NFT_REG_4: ::c_int = 4;
+pub const __NFT_REG_MAX: ::c_int = 5;
+pub const NFT_REG32_00: ::c_int = 8;
+pub const NFT_REG32_01: ::c_int = 9;
+pub const NFT_REG32_02: ::c_int = 10;
+pub const NFT_REG32_03: ::c_int = 11;
+pub const NFT_REG32_04: ::c_int = 12;
+pub const NFT_REG32_05: ::c_int = 13;
+pub const NFT_REG32_06: ::c_int = 14;
+pub const NFT_REG32_07: ::c_int = 15;
+pub const NFT_REG32_08: ::c_int = 16;
+pub const NFT_REG32_09: ::c_int = 17;
+pub const NFT_REG32_10: ::c_int = 18;
+pub const NFT_REG32_11: ::c_int = 19;
+pub const NFT_REG32_12: ::c_int = 20;
+pub const NFT_REG32_13: ::c_int = 21;
+pub const NFT_REG32_14: ::c_int = 22;
+pub const NFT_REG32_15: ::c_int = 23;
+
+pub const NFT_REG_SIZE: ::c_int = 16;
+pub const NFT_REG32_SIZE: ::c_int = 4;
+
+pub const NFT_CONTINUE: ::c_int = -1;
+pub const NFT_BREAK: ::c_int = -2;
+pub const NFT_JUMP: ::c_int = -3;
+pub const NFT_GOTO: ::c_int = -4;
+pub const NFT_RETURN: ::c_int = -5;
+
+pub const NFT_MSG_NEWTABLE: ::c_int = 0;
+pub const NFT_MSG_GETTABLE: ::c_int = 1;
+pub const NFT_MSG_DELTABLE: ::c_int = 2;
+pub const NFT_MSG_NEWCHAIN: ::c_int = 3;
+pub const NFT_MSG_GETCHAIN: ::c_int = 4;
+pub const NFT_MSG_DELCHAIN: ::c_int = 5;
+pub const NFT_MSG_NEWRULE: ::c_int = 6;
+pub const NFT_MSG_GETRULE: ::c_int = 7;
+pub const NFT_MSG_DELRULE: ::c_int = 8;
+pub const NFT_MSG_NEWSET: ::c_int = 9;
+pub const NFT_MSG_GETSET: ::c_int = 10;
+pub const NFT_MSG_DELSET: ::c_int = 11;
+pub const NFT_MSG_NEWSETELEM: ::c_int = 12;
+pub const NFT_MSG_GETSETELEM: ::c_int = 13;
+pub const NFT_MSG_DELSETELEM: ::c_int = 14;
+pub const NFT_MSG_NEWGEN: ::c_int = 15;
+pub const NFT_MSG_GETGEN: ::c_int = 16;
+pub const NFT_MSG_TRACE: ::c_int = 17;
+cfg_if! {
+    if #[cfg(not(target_arch = "sparc64"))] {
+        pub const NFT_MSG_NEWOBJ: ::c_int = 18;
+        pub const NFT_MSG_GETOBJ: ::c_int = 19;
+        pub const NFT_MSG_DELOBJ: ::c_int = 20;
+        pub const NFT_MSG_GETOBJ_RESET: ::c_int = 21;
+    }
+}
+pub const NFT_MSG_MAX: ::c_int = 25;
+
+pub const NFT_SET_ANONYMOUS: ::c_int = 0x1;
+pub const NFT_SET_CONSTANT: ::c_int = 0x2;
+pub const NFT_SET_INTERVAL: ::c_int = 0x4;
+pub const NFT_SET_MAP: ::c_int = 0x8;
+pub const NFT_SET_TIMEOUT: ::c_int = 0x10;
+pub const NFT_SET_EVAL: ::c_int = 0x20;
+
+pub const NFT_SET_POL_PERFORMANCE: ::c_int = 0;
+pub const NFT_SET_POL_MEMORY: ::c_int = 1;
+
+pub const NFT_SET_ELEM_INTERVAL_END: ::c_int = 0x1;
+
+pub const NFT_DATA_VALUE: ::c_uint = 0;
+pub const NFT_DATA_VERDICT: ::c_uint = 0xffffff00;
+
+pub const NFT_DATA_RESERVED_MASK: ::c_uint = 0xffffff00;
+
+pub const NFT_DATA_VALUE_MAXLEN: ::c_int = 64;
+
+pub const NFT_BYTEORDER_NTOH: ::c_int = 0;
+pub const NFT_BYTEORDER_HTON: ::c_int = 1;
+
+pub const NFT_CMP_EQ: ::c_int = 0;
+pub const NFT_CMP_NEQ: ::c_int = 1;
+pub const NFT_CMP_LT: ::c_int = 2;
+pub const NFT_CMP_LTE: ::c_int = 3;
+pub const NFT_CMP_GT: ::c_int = 4;
+pub const NFT_CMP_GTE: ::c_int = 5;
+
+pub const NFT_RANGE_EQ: ::c_int = 0;
+pub const NFT_RANGE_NEQ: ::c_int = 1;
+
+pub const NFT_LOOKUP_F_INV: ::c_int = 1 << 0;
+
+pub const NFT_DYNSET_OP_ADD: ::c_int = 0;
+pub const NFT_DYNSET_OP_UPDATE: ::c_int = 1;
+
+pub const NFT_DYNSET_F_INV: ::c_int = 1 << 0;
+
+pub const NFT_PAYLOAD_LL_HEADER: ::c_int = 0;
+pub const NFT_PAYLOAD_NETWORK_HEADER: ::c_int = 1;
+pub const NFT_PAYLOAD_TRANSPORT_HEADER: ::c_int = 2;
+
+pub const NFT_PAYLOAD_CSUM_NONE: ::c_int = 0;
+pub const NFT_PAYLOAD_CSUM_INET: ::c_int = 1;
+
+pub const NFT_META_LEN: ::c_int = 0;
+pub const NFT_META_PROTOCOL: ::c_int = 1;
+pub const NFT_META_PRIORITY: ::c_int = 2;
+pub const NFT_META_MARK: ::c_int = 3;
+pub const NFT_META_IIF: ::c_int = 4;
+pub const NFT_META_OIF: ::c_int = 5;
+pub const NFT_META_IIFNAME: ::c_int = 6;
+pub const NFT_META_OIFNAME: ::c_int = 7;
+pub const NFT_META_IIFTYPE: ::c_int = 8;
+pub const NFT_META_OIFTYPE: ::c_int = 9;
+pub const NFT_META_SKUID: ::c_int = 10;
+pub const NFT_META_SKGID: ::c_int = 11;
+pub const NFT_META_NFTRACE: ::c_int = 12;
+pub const NFT_META_RTCLASSID: ::c_int = 13;
+pub const NFT_META_SECMARK: ::c_int = 14;
+pub const NFT_META_NFPROTO: ::c_int = 15;
+pub const NFT_META_L4PROTO: ::c_int = 16;
+pub const NFT_META_BRI_IIFNAME: ::c_int = 17;
+pub const NFT_META_BRI_OIFNAME: ::c_int = 18;
+pub const NFT_META_PKTTYPE: ::c_int = 19;
+pub const NFT_META_CPU: ::c_int = 20;
+pub const NFT_META_IIFGROUP: ::c_int = 21;
+pub const NFT_META_OIFGROUP: ::c_int = 22;
+pub const NFT_META_CGROUP: ::c_int = 23;
+pub const NFT_META_PRANDOM: ::c_int = 24;
+
+pub const NFT_CT_STATE: ::c_int = 0;
+pub const NFT_CT_DIRECTION: ::c_int = 1;
+pub const NFT_CT_STATUS: ::c_int = 2;
+pub const NFT_CT_MARK: ::c_int = 3;
+pub const NFT_CT_SECMARK: ::c_int = 4;
+pub const NFT_CT_EXPIRATION: ::c_int = 5;
+pub const NFT_CT_HELPER: ::c_int = 6;
+pub const NFT_CT_L3PROTOCOL: ::c_int = 7;
+pub const NFT_CT_SRC: ::c_int = 8;
+pub const NFT_CT_DST: ::c_int = 9;
+pub const NFT_CT_PROTOCOL: ::c_int = 10;
+pub const NFT_CT_PROTO_SRC: ::c_int = 11;
+pub const NFT_CT_PROTO_DST: ::c_int = 12;
+pub const NFT_CT_LABELS: ::c_int = 13;
+pub const NFT_CT_PKTS: ::c_int = 14;
+pub const NFT_CT_BYTES: ::c_int = 15;
+
+pub const NFT_LIMIT_PKTS: ::c_int = 0;
+pub const NFT_LIMIT_PKT_BYTES: ::c_int = 1;
+
+pub const NFT_LIMIT_F_INV: ::c_int = 1 << 0;
+
+pub const NFT_QUEUE_FLAG_BYPASS: ::c_int = 0x01;
+pub const NFT_QUEUE_FLAG_CPU_FANOUT: ::c_int = 0x02;
+pub const NFT_QUEUE_FLAG_MASK: ::c_int = 0x03;
+
+pub const NFT_QUOTA_F_INV: ::c_int = 1 << 0;
+
+pub const NFT_REJECT_ICMP_UNREACH: ::c_int = 0;
+pub const NFT_REJECT_TCP_RST: ::c_int = 1;
+pub const NFT_REJECT_ICMPX_UNREACH: ::c_int = 2;
+
+pub const NFT_REJECT_ICMPX_NO_ROUTE: ::c_int = 0;
+pub const NFT_REJECT_ICMPX_PORT_UNREACH: ::c_int = 1;
+pub const NFT_REJECT_ICMPX_HOST_UNREACH: ::c_int = 2;
+pub const NFT_REJECT_ICMPX_ADMIN_PROHIBITED: ::c_int = 3;
+
+pub const NFT_NAT_SNAT: ::c_int = 0;
+pub const NFT_NAT_DNAT: ::c_int = 1;
+
+pub const NFT_TRACETYPE_UNSPEC: ::c_int = 0;
+pub const NFT_TRACETYPE_POLICY: ::c_int = 1;
+pub const NFT_TRACETYPE_RETURN: ::c_int = 2;
+pub const NFT_TRACETYPE_RULE: ::c_int = 3;
+
+pub const NFT_NG_INCREMENTAL: ::c_int = 0;
+pub const NFT_NG_RANDOM: ::c_int = 1;
+
+// linux/input.h
+pub const FF_MAX: ::__u16 = 0x7f;
+pub const FF_CNT: usize = FF_MAX as usize + 1;
+
+// linux/input-event-codes.h
+pub const INPUT_PROP_MAX: ::__u16 = 0x1f;
+pub const INPUT_PROP_CNT: usize = INPUT_PROP_MAX as usize + 1;
+pub const EV_MAX: ::__u16 = 0x1f;
+pub const EV_CNT: usize = EV_MAX as usize + 1;
+pub const SYN_MAX: ::__u16 = 0xf;
+pub const SYN_CNT: usize = SYN_MAX as usize + 1;
+pub const KEY_MAX: ::__u16 = 0x2ff;
+pub const KEY_CNT: usize = KEY_MAX as usize + 1;
+pub const REL_MAX: ::__u16 = 0x0f;
+pub const REL_CNT: usize = REL_MAX as usize + 1;
+pub const ABS_MAX: ::__u16 = 0x3f;
+pub const ABS_CNT: usize = ABS_MAX as usize + 1;
+pub const SW_MAX: ::__u16 = 0x10;
+pub const SW_CNT: usize = SW_MAX as usize + 1;
+pub const MSC_MAX: ::__u16 = 0x07;
+pub const MSC_CNT: usize = MSC_MAX as usize + 1;
+pub const LED_MAX: ::__u16 = 0x0f;
+pub const LED_CNT: usize = LED_MAX as usize + 1;
+pub const REP_MAX: ::__u16 = 0x01;
+pub const REP_CNT: usize = REP_MAX as usize + 1;
+pub const SND_MAX: ::__u16 = 0x07;
+pub const SND_CNT: usize = SND_MAX as usize + 1;
+
+// linux/uinput.h
+pub const UINPUT_VERSION: ::c_uint = 5;
+pub const UINPUT_MAX_NAME_SIZE: usize = 80;
+
+// uapi/linux/fanotify.h
+pub const FAN_ACCESS: u64 = 0x0000_0001;
+pub const FAN_MODIFY: u64 = 0x0000_0002;
+pub const FAN_ATTRIB: u64 = 0x0000_0004;
+pub const FAN_CLOSE_WRITE: u64 = 0x0000_0008;
+pub const FAN_CLOSE_NOWRITE: u64 = 0x0000_0010;
+pub const FAN_OPEN: u64 = 0x0000_0020;
+pub const FAN_MOVED_FROM: u64 = 0x0000_0040;
+pub const FAN_MOVED_TO: u64 = 0x0000_0080;
+pub const FAN_CREATE: u64 = 0x0000_0100;
+pub const FAN_DELETE: u64 = 0x0000_0200;
+pub const FAN_DELETE_SELF: u64 = 0x0000_0400;
+pub const FAN_MOVE_SELF: u64 = 0x0000_0800;
+pub const FAN_OPEN_EXEC: u64 = 0x0000_1000;
+
+pub const FAN_Q_OVERFLOW: u64 = 0x0000_4000;
+pub const FAN_FS_ERROR: u64 = 0x0000_8000;
+
+pub const FAN_OPEN_PERM: u64 = 0x0001_0000;
+pub const FAN_ACCESS_PERM: u64 = 0x0002_0000;
+pub const FAN_OPEN_EXEC_PERM: u64 = 0x0004_0000;
+
+pub const FAN_EVENT_ON_CHILD: u64 = 0x0800_0000;
+
+pub const FAN_RENAME: u64 = 0x1000_0000;
+
+pub const FAN_ONDIR: u64 = 0x4000_0000;
+
+pub const FAN_CLOSE: u64 = FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE;
+pub const FAN_MOVE: u64 = FAN_MOVED_FROM | FAN_MOVED_TO;
+
+pub const FAN_CLOEXEC: ::c_uint = 0x0000_0001;
+pub const FAN_NONBLOCK: ::c_uint = 0x0000_0002;
+
+pub const FAN_CLASS_NOTIF: ::c_uint = 0x0000_0000;
+pub const FAN_CLASS_CONTENT: ::c_uint = 0x0000_0004;
+pub const FAN_CLASS_PRE_CONTENT: ::c_uint = 0x0000_0008;
+
+pub const FAN_UNLIMITED_QUEUE: ::c_uint = 0x0000_0010;
+pub const FAN_UNLIMITED_MARKS: ::c_uint = 0x0000_0020;
+pub const FAN_ENABLE_AUDIT: ::c_uint = 0x0000_0040;
+
+pub const FAN_REPORT_PIDFD: ::c_uint = 0x0000_0080;
+pub const FAN_REPORT_TID: ::c_uint = 0x0000_0100;
+pub const FAN_REPORT_FID: ::c_uint = 0x0000_0200;
+pub const FAN_REPORT_DIR_FID: ::c_uint = 0x0000_0400;
+pub const FAN_REPORT_NAME: ::c_uint = 0x0000_0800;
+pub const FAN_REPORT_TARGET_FID: ::c_uint = 0x0000_1000;
+
+pub const FAN_REPORT_DFID_NAME: ::c_uint = FAN_REPORT_DIR_FID | FAN_REPORT_NAME;
+pub const FAN_REPORT_DFID_NAME_TARGET: ::c_uint =
+    FAN_REPORT_DFID_NAME | FAN_REPORT_FID | FAN_REPORT_TARGET_FID;
+
+pub const FAN_MARK_ADD: ::c_uint = 0x0000_0001;
+pub const FAN_MARK_REMOVE: ::c_uint = 0x0000_0002;
+pub const FAN_MARK_DONT_FOLLOW: ::c_uint = 0x0000_0004;
+pub const FAN_MARK_ONLYDIR: ::c_uint = 0x0000_0008;
+pub const FAN_MARK_IGNORED_MASK: ::c_uint = 0x0000_0020;
+pub const FAN_MARK_IGNORED_SURV_MODIFY: ::c_uint = 0x0000_0040;
+pub const FAN_MARK_FLUSH: ::c_uint = 0x0000_0080;
+pub const FAN_MARK_EVICTABLE: ::c_uint = 0x0000_0200;
+pub const FAN_MARK_IGNORE: ::c_uint = 0x0000_0400;
+
+pub const FAN_MARK_INODE: ::c_uint = 0x0000_0000;
+pub const FAN_MARK_MOUNT: ::c_uint = 0x0000_0010;
+pub const FAN_MARK_FILESYSTEM: ::c_uint = 0x0000_0100;
+
+pub const FAN_MARK_IGNORE_SURV: ::c_uint = FAN_MARK_IGNORE | FAN_MARK_IGNORED_SURV_MODIFY;
+
+pub const FANOTIFY_METADATA_VERSION: u8 = 3;
+
+pub const FAN_EVENT_INFO_TYPE_FID: u8 = 1;
+pub const FAN_EVENT_INFO_TYPE_DFID_NAME: u8 = 2;
+pub const FAN_EVENT_INFO_TYPE_DFID: u8 = 3;
+pub const FAN_EVENT_INFO_TYPE_PIDFD: u8 = 4;
+pub const FAN_EVENT_INFO_TYPE_ERROR: u8 = 5;
+
+pub const FAN_EVENT_INFO_TYPE_OLD_DFID_NAME: u8 = 10;
+pub const FAN_EVENT_INFO_TYPE_NEW_DFID_NAME: u8 = 12;
+
+pub const FAN_RESPONSE_INFO_NONE: u8 = 0;
+pub const FAN_RESPONSE_INFO_AUDIT_RULE: u8 = 1;
+
+pub const FAN_ALLOW: u32 = 0x01;
+pub const FAN_DENY: u32 = 0x02;
+pub const FAN_AUDIT: u32 = 0x10;
+pub const FAN_INFO: u32 = 0x20;
+
+pub const FAN_NOFD: ::c_int = -1;
+pub const FAN_NOPIDFD: ::c_int = FAN_NOFD;
+pub const FAN_EPIDFD: ::c_int = -2;
+
+pub const FUTEX_WAIT: ::c_int = 0;
+pub const FUTEX_WAKE: ::c_int = 1;
+pub const FUTEX_FD: ::c_int = 2;
+pub const FUTEX_REQUEUE: ::c_int = 3;
+pub const FUTEX_CMP_REQUEUE: ::c_int = 4;
+pub const FUTEX_WAKE_OP: ::c_int = 5;
+pub const FUTEX_LOCK_PI: ::c_int = 6;
+pub const FUTEX_UNLOCK_PI: ::c_int = 7;
+pub const FUTEX_TRYLOCK_PI: ::c_int = 8;
+pub const FUTEX_WAIT_BITSET: ::c_int = 9;
+pub const FUTEX_WAKE_BITSET: ::c_int = 10;
+pub const FUTEX_WAIT_REQUEUE_PI: ::c_int = 11;
+pub const FUTEX_CMP_REQUEUE_PI: ::c_int = 12;
+pub const FUTEX_LOCK_PI2: ::c_int = 13;
+
+pub const FUTEX_PRIVATE_FLAG: ::c_int = 128;
+pub const FUTEX_CLOCK_REALTIME: ::c_int = 256;
+pub const FUTEX_CMD_MASK: ::c_int = !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME);
+
+pub const FUTEX_BITSET_MATCH_ANY: ::c_int = 0xffffffff;
+
+pub const FUTEX_OP_SET: ::c_int = 0;
+pub const FUTEX_OP_ADD: ::c_int = 1;
+pub const FUTEX_OP_OR: ::c_int = 2;
+pub const FUTEX_OP_ANDN: ::c_int = 3;
+pub const FUTEX_OP_XOR: ::c_int = 4;
+
+pub const FUTEX_OP_OPARG_SHIFT: ::c_int = 8;
+
+pub const FUTEX_OP_CMP_EQ: ::c_int = 0;
+pub const FUTEX_OP_CMP_NE: ::c_int = 1;
+pub const FUTEX_OP_CMP_LT: ::c_int = 2;
+pub const FUTEX_OP_CMP_LE: ::c_int = 3;
+pub const FUTEX_OP_CMP_GT: ::c_int = 4;
+pub const FUTEX_OP_CMP_GE: ::c_int = 5;
+
+pub fn FUTEX_OP(op: ::c_int, oparg: ::c_int, cmp: ::c_int, cmparg: ::c_int) -> ::c_int {
+    ((op & 0xf) << 28) | ((cmp & 0xf) << 24) | ((oparg & 0xfff) << 12) | (cmparg & 0xfff)
+}
+
+// linux/kexec.h
+pub const KEXEC_ON_CRASH: ::c_int = 0x00000001;
+pub const KEXEC_PRESERVE_CONTEXT: ::c_int = 0x00000002;
+pub const KEXEC_ARCH_MASK: ::c_int = 0xffff0000;
+pub const KEXEC_FILE_UNLOAD: ::c_int = 0x00000001;
+pub const KEXEC_FILE_ON_CRASH: ::c_int = 0x00000002;
+pub const KEXEC_FILE_NO_INITRAMFS: ::c_int = 0x00000004;
+
+// linux/reboot.h
+pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead;
+pub const LINUX_REBOOT_MAGIC2: ::c_int = 672274793;
+pub const LINUX_REBOOT_MAGIC2A: ::c_int = 85072278;
+pub const LINUX_REBOOT_MAGIC2B: ::c_int = 369367448;
+pub const LINUX_REBOOT_MAGIC2C: ::c_int = 537993216;
+
+pub const LINUX_REBOOT_CMD_RESTART: ::c_int = 0x01234567;
+pub const LINUX_REBOOT_CMD_HALT: ::c_int = 0xCDEF0123;
+pub const LINUX_REBOOT_CMD_CAD_ON: ::c_int = 0x89ABCDEF;
+pub const LINUX_REBOOT_CMD_CAD_OFF: ::c_int = 0x00000000;
+pub const LINUX_REBOOT_CMD_POWER_OFF: ::c_int = 0x4321FEDC;
+pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4;
+pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2;
+pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543;
+
+pub const REG_EXTENDED: ::c_int = 1;
+pub const REG_ICASE: ::c_int = 2;
+pub const REG_NEWLINE: ::c_int = 4;
+pub const REG_NOSUB: ::c_int = 8;
+
+pub const REG_NOTBOL: ::c_int = 1;
+pub const REG_NOTEOL: ::c_int = 2;
+
+pub const REG_ENOSYS: ::c_int = -1;
+pub const REG_NOMATCH: ::c_int = 1;
+pub const REG_BADPAT: ::c_int = 2;
+pub const REG_ECOLLATE: ::c_int = 3;
+pub const REG_ECTYPE: ::c_int = 4;
+pub const REG_EESCAPE: ::c_int = 5;
+pub const REG_ESUBREG: ::c_int = 6;
+pub const REG_EBRACK: ::c_int = 7;
+pub const REG_EPAREN: ::c_int = 8;
+pub const REG_EBRACE: ::c_int = 9;
+pub const REG_BADBR: ::c_int = 10;
+pub const REG_ERANGE: ::c_int = 11;
+pub const REG_ESPACE: ::c_int = 12;
+pub const REG_BADRPT: ::c_int = 13;
+
+// linux/errqueue.h
+pub const SO_EE_ORIGIN_NONE: u8 = 0;
+pub const SO_EE_ORIGIN_LOCAL: u8 = 1;
+pub const SO_EE_ORIGIN_ICMP: u8 = 2;
+pub const SO_EE_ORIGIN_ICMP6: u8 = 3;
+pub const SO_EE_ORIGIN_TXSTATUS: u8 = 4;
+pub const SO_EE_ORIGIN_TIMESTAMPING: u8 = SO_EE_ORIGIN_TXSTATUS;
+
+// errno.h
+pub const EPERM: ::c_int = 1;
+pub const ENOENT: ::c_int = 2;
+pub const ESRCH: ::c_int = 3;
+pub const EINTR: ::c_int = 4;
+pub const EIO: ::c_int = 5;
+pub const ENXIO: ::c_int = 6;
+pub const E2BIG: ::c_int = 7;
+pub const ENOEXEC: ::c_int = 8;
+pub const EBADF: ::c_int = 9;
+pub const ECHILD: ::c_int = 10;
+pub const EAGAIN: ::c_int = 11;
+pub const ENOMEM: ::c_int = 12;
+pub const EACCES: ::c_int = 13;
+pub const EFAULT: ::c_int = 14;
+pub const ENOTBLK: ::c_int = 15;
+pub const EBUSY: ::c_int = 16;
+pub const EEXIST: ::c_int = 17;
+pub const EXDEV: ::c_int = 18;
+pub const ENODEV: ::c_int = 19;
+pub const ENOTDIR: ::c_int = 20;
+pub const EISDIR: ::c_int = 21;
+pub const EINVAL: ::c_int = 22;
+pub const ENFILE: ::c_int = 23;
+pub const EMFILE: ::c_int = 24;
+pub const ENOTTY: ::c_int = 25;
+pub const ETXTBSY: ::c_int = 26;
+pub const EFBIG: ::c_int = 27;
+pub const ENOSPC: ::c_int = 28;
+pub const ESPIPE: ::c_int = 29;
+pub const EROFS: ::c_int = 30;
+pub const EMLINK: ::c_int = 31;
+pub const EPIPE: ::c_int = 32;
+pub const EDOM: ::c_int = 33;
+pub const ERANGE: ::c_int = 34;
+pub const EWOULDBLOCK: ::c_int = EAGAIN;
+
+// linux/can.h
+pub const CAN_EFF_FLAG: canid_t = 0x80000000;
+pub const CAN_RTR_FLAG: canid_t = 0x40000000;
+pub const CAN_ERR_FLAG: canid_t = 0x20000000;
+pub const CAN_SFF_MASK: canid_t = 0x000007FF;
+pub const CAN_EFF_MASK: canid_t = 0x1FFFFFFF;
+pub const CAN_ERR_MASK: canid_t = 0x1FFFFFFF;
+pub const CANXL_PRIO_MASK: ::canid_t = CAN_SFF_MASK;
+
+pub const CAN_SFF_ID_BITS: ::c_int = 11;
+pub const CAN_EFF_ID_BITS: ::c_int = 29;
+pub const CANXL_PRIO_BITS: ::c_int = CAN_SFF_ID_BITS;
+
+pub const CAN_MAX_DLC: ::c_int = 8;
+pub const CAN_MAX_DLEN: usize = 8;
+pub const CANFD_MAX_DLC: ::c_int = 15;
+pub const CANFD_MAX_DLEN: usize = 64;
+
+pub const CANFD_BRS: ::c_int = 0x01;
+pub const CANFD_ESI: ::c_int = 0x02;
+
+pub const CANXL_MIN_DLC: ::c_int = 0;
+pub const CANXL_MAX_DLC: ::c_int = 2047;
+pub const CANXL_MAX_DLC_MASK: ::c_int = 0x07FF;
+pub const CANXL_MIN_DLEN: usize = 1;
+pub const CANXL_MAX_DLEN: usize = 2048;
+
+pub const CANXL_XLF: ::c_int = 0x80;
+pub const CANXL_SEC: ::c_int = 0x01;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        pub const CAN_MTU: usize = ::mem::size_of::<can_frame>();
+        pub const CANFD_MTU: usize = ::mem::size_of::<canfd_frame>();
+        pub const CANXL_MTU: usize = ::mem::size_of::<canxl_frame>();
+        // FIXME: use `core::mem::offset_of!` once that is available
+        // https://github.com/rust-lang/rfcs/pull/3308
+        // pub const CANXL_HDR_SIZE: usize = core::mem::offset_of!(canxl_frame, data);
+        pub const CANXL_HDR_SIZE: usize = 12;
+        pub const CANXL_MIN_MTU: usize = CANXL_HDR_SIZE + 64;
+        pub const CANXL_MAX_MTU: usize = CANXL_MTU;
+    }
+}
+
+pub const CAN_RAW: ::c_int = 1;
+pub const CAN_BCM: ::c_int = 2;
+pub const CAN_TP16: ::c_int = 3;
+pub const CAN_TP20: ::c_int = 4;
+pub const CAN_MCNET: ::c_int = 5;
+pub const CAN_ISOTP: ::c_int = 6;
+pub const CAN_J1939: ::c_int = 7;
+pub const CAN_NPROTO: ::c_int = 8;
+
+pub const SOL_CAN_BASE: ::c_int = 100;
+
+pub const CAN_INV_FILTER: canid_t = 0x20000000;
+pub const CAN_RAW_FILTER_MAX: ::c_int = 512;
+
+// linux/can/raw.h
+pub const SOL_CAN_RAW: ::c_int = SOL_CAN_BASE + CAN_RAW;
+pub const CAN_RAW_FILTER: ::c_int = 1;
+pub const CAN_RAW_ERR_FILTER: ::c_int = 2;
+pub const CAN_RAW_LOOPBACK: ::c_int = 3;
+pub const CAN_RAW_RECV_OWN_MSGS: ::c_int = 4;
+pub const CAN_RAW_FD_FRAMES: ::c_int = 5;
+pub const CAN_RAW_JOIN_FILTERS: ::c_int = 6;
+pub const CAN_RAW_XL_FRAMES: ::c_int = 7;
+
+// linux/can/j1939.h
+pub const SOL_CAN_J1939: ::c_int = SOL_CAN_BASE + CAN_J1939;
+
+pub const J1939_MAX_UNICAST_ADDR: ::c_uchar = 0xfd;
+pub const J1939_IDLE_ADDR: ::c_uchar = 0xfe;
+pub const J1939_NO_ADDR: ::c_uchar = 0xff;
+pub const J1939_NO_NAME: ::c_ulong = 0;
+pub const J1939_PGN_REQUEST: ::c_uint = 0x0ea00;
+pub const J1939_PGN_ADDRESS_CLAIMED: ::c_uint = 0x0ee00;
+pub const J1939_PGN_ADDRESS_COMMANDED: ::c_uint = 0x0fed8;
+pub const J1939_PGN_PDU1_MAX: ::c_uint = 0x3ff00;
+pub const J1939_PGN_MAX: ::c_uint = 0x3ffff;
+pub const J1939_NO_PGN: ::c_uint = 0x40000;
+
+pub const SO_J1939_FILTER: ::c_int = 1;
+pub const SO_J1939_PROMISC: ::c_int = 2;
+pub const SO_J1939_SEND_PRIO: ::c_int = 3;
+pub const SO_J1939_ERRQUEUE: ::c_int = 4;
+
+pub const SCM_J1939_DEST_ADDR: ::c_int = 1;
+pub const SCM_J1939_DEST_NAME: ::c_int = 2;
+pub const SCM_J1939_PRIO: ::c_int = 3;
+pub const SCM_J1939_ERRQUEUE: ::c_int = 4;
+
+pub const J1939_NLA_PAD: ::c_int = 0;
+pub const J1939_NLA_BYTES_ACKED: ::c_int = 1;
+pub const J1939_NLA_TOTAL_SIZE: ::c_int = 2;
+pub const J1939_NLA_PGN: ::c_int = 3;
+pub const J1939_NLA_SRC_NAME: ::c_int = 4;
+pub const J1939_NLA_DEST_NAME: ::c_int = 5;
+pub const J1939_NLA_SRC_ADDR: ::c_int = 6;
+pub const J1939_NLA_DEST_ADDR: ::c_int = 7;
+
+pub const J1939_EE_INFO_NONE: ::c_int = 0;
+pub const J1939_EE_INFO_TX_ABORT: ::c_int = 1;
+pub const J1939_EE_INFO_RX_RTS: ::c_int = 2;
+pub const J1939_EE_INFO_RX_DPO: ::c_int = 3;
+pub const J1939_EE_INFO_RX_ABORT: ::c_int = 4;
+
+pub const J1939_FILTER_MAX: ::c_int = 512;
+
+// linux/sctp.h
+pub const SCTP_FUTURE_ASSOC: ::c_int = 0;
+pub const SCTP_CURRENT_ASSOC: ::c_int = 1;
+pub const SCTP_ALL_ASSOC: ::c_int = 2;
+pub const SCTP_RTOINFO: ::c_int = 0;
+pub const SCTP_ASSOCINFO: ::c_int = 1;
+pub const SCTP_INITMSG: ::c_int = 2;
+pub const SCTP_NODELAY: ::c_int = 3;
+pub const SCTP_AUTOCLOSE: ::c_int = 4;
+pub const SCTP_SET_PEER_PRIMARY_ADDR: ::c_int = 5;
+pub const SCTP_PRIMARY_ADDR: ::c_int = 6;
+pub const SCTP_ADAPTATION_LAYER: ::c_int = 7;
+pub const SCTP_DISABLE_FRAGMENTS: ::c_int = 8;
+pub const SCTP_PEER_ADDR_PARAMS: ::c_int = 9;
+pub const SCTP_DEFAULT_SEND_PARAM: ::c_int = 10;
+pub const SCTP_EVENTS: ::c_int = 11;
+pub const SCTP_I_WANT_MAPPED_V4_ADDR: ::c_int = 12;
+pub const SCTP_MAXSEG: ::c_int = 13;
+pub const SCTP_STATUS: ::c_int = 14;
+pub const SCTP_GET_PEER_ADDR_INFO: ::c_int = 15;
+pub const SCTP_DELAYED_ACK_TIME: ::c_int = 16;
+pub const SCTP_DELAYED_ACK: ::c_int = SCTP_DELAYED_ACK_TIME;
+pub const SCTP_DELAYED_SACK: ::c_int = SCTP_DELAYED_ACK_TIME;
+pub const SCTP_CONTEXT: ::c_int = 17;
+pub const SCTP_FRAGMENT_INTERLEAVE: ::c_int = 18;
+pub const SCTP_PARTIAL_DELIVERY_POINT: ::c_int = 19;
+pub const SCTP_MAX_BURST: ::c_int = 20;
+pub const SCTP_AUTH_CHUNK: ::c_int = 21;
+pub const SCTP_HMAC_IDENT: ::c_int = 22;
+pub const SCTP_AUTH_KEY: ::c_int = 23;
+pub const SCTP_AUTH_ACTIVE_KEY: ::c_int = 24;
+pub const SCTP_AUTH_DELETE_KEY: ::c_int = 25;
+pub const SCTP_PEER_AUTH_CHUNKS: ::c_int = 26;
+pub const SCTP_LOCAL_AUTH_CHUNKS: ::c_int = 27;
+pub const SCTP_GET_ASSOC_NUMBER: ::c_int = 28;
+pub const SCTP_GET_ASSOC_ID_LIST: ::c_int = 29;
+pub const SCTP_AUTO_ASCONF: ::c_int = 30;
+pub const SCTP_PEER_ADDR_THLDS: ::c_int = 31;
+pub const SCTP_RECVRCVINFO: ::c_int = 32;
+pub const SCTP_RECVNXTINFO: ::c_int = 33;
+pub const SCTP_DEFAULT_SNDINFO: ::c_int = 34;
+pub const SCTP_AUTH_DEACTIVATE_KEY: ::c_int = 35;
+pub const SCTP_REUSE_PORT: ::c_int = 36;
+pub const SCTP_PEER_ADDR_THLDS_V2: ::c_int = 37;
+pub const SCTP_PR_SCTP_NONE: ::c_int = 0x0000;
+pub const SCTP_PR_SCTP_TTL: ::c_int = 0x0010;
+pub const SCTP_PR_SCTP_RTX: ::c_int = 0x0020;
+pub const SCTP_PR_SCTP_PRIO: ::c_int = 0x0030;
+pub const SCTP_PR_SCTP_MAX: ::c_int = SCTP_PR_SCTP_PRIO;
+pub const SCTP_PR_SCTP_MASK: ::c_int = 0x0030;
+pub const SCTP_ENABLE_RESET_STREAM_REQ: ::c_int = 0x01;
+pub const SCTP_ENABLE_RESET_ASSOC_REQ: ::c_int = 0x02;
+pub const SCTP_ENABLE_CHANGE_ASSOC_REQ: ::c_int = 0x04;
+pub const SCTP_ENABLE_STRRESET_MASK: ::c_int = 0x07;
+pub const SCTP_STREAM_RESET_INCOMING: ::c_int = 0x01;
+pub const SCTP_STREAM_RESET_OUTGOING: ::c_int = 0x02;
+
+pub const SCTP_INIT: ::c_int = 0;
+pub const SCTP_SNDRCV: ::c_int = 1;
+pub const SCTP_SNDINFO: ::c_int = 2;
+pub const SCTP_RCVINFO: ::c_int = 3;
+pub const SCTP_NXTINFO: ::c_int = 4;
+pub const SCTP_PRINFO: ::c_int = 5;
+pub const SCTP_AUTHINFO: ::c_int = 6;
+pub const SCTP_DSTADDRV4: ::c_int = 7;
+pub const SCTP_DSTADDRV6: ::c_int = 8;
+
+pub const SCTP_UNORDERED: ::c_int = 1 << 0;
+pub const SCTP_ADDR_OVER: ::c_int = 1 << 1;
+pub const SCTP_ABORT: ::c_int = 1 << 2;
+pub const SCTP_SACK_IMMEDIATELY: ::c_int = 1 << 3;
+pub const SCTP_SENDALL: ::c_int = 1 << 6;
+pub const SCTP_PR_SCTP_ALL: ::c_int = 1 << 7;
+pub const SCTP_NOTIFICATION: ::c_int = MSG_NOTIFICATION;
+pub const SCTP_EOF: ::c_int = ::MSG_FIN;
+
+/* DCCP socket options */
+pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1;
+pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2;
+pub const DCCP_SOCKOPT_CHANGE_L: ::c_int = 3;
+pub const DCCP_SOCKOPT_CHANGE_R: ::c_int = 4;
+pub const DCCP_SOCKOPT_GET_CUR_MPS: ::c_int = 5;
+pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: ::c_int = 6;
+pub const DCCP_SOCKOPT_SEND_CSCOV: ::c_int = 10;
+pub const DCCP_SOCKOPT_RECV_CSCOV: ::c_int = 11;
+pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: ::c_int = 12;
+pub const DCCP_SOCKOPT_CCID: ::c_int = 13;
+pub const DCCP_SOCKOPT_TX_CCID: ::c_int = 14;
+pub const DCCP_SOCKOPT_RX_CCID: ::c_int = 15;
+pub const DCCP_SOCKOPT_QPOLICY_ID: ::c_int = 16;
+pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: ::c_int = 17;
+pub const DCCP_SOCKOPT_CCID_RX_INFO: ::c_int = 128;
+pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192;
+
+/// maximum number of services provided on the same listening port
+pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32;
+
+pub const CTL_KERN: ::c_int = 1;
+pub const CTL_VM: ::c_int = 2;
+pub const CTL_NET: ::c_int = 3;
+pub const CTL_FS: ::c_int = 5;
+pub const CTL_DEBUG: ::c_int = 6;
+pub const CTL_DEV: ::c_int = 7;
+pub const CTL_BUS: ::c_int = 8;
+pub const CTL_ABI: ::c_int = 9;
+pub const CTL_CPU: ::c_int = 10;
+
+pub const CTL_BUS_ISA: ::c_int = 1;
+
+pub const INOTIFY_MAX_USER_INSTANCES: ::c_int = 1;
+pub const INOTIFY_MAX_USER_WATCHES: ::c_int = 2;
+pub const INOTIFY_MAX_QUEUED_EVENTS: ::c_int = 3;
+
+pub const KERN_OSTYPE: ::c_int = 1;
+pub const KERN_OSRELEASE: ::c_int = 2;
+pub const KERN_OSREV: ::c_int = 3;
+pub const KERN_VERSION: ::c_int = 4;
+pub const KERN_SECUREMASK: ::c_int = 5;
+pub const KERN_PROF: ::c_int = 6;
+pub const KERN_NODENAME: ::c_int = 7;
+pub const KERN_DOMAINNAME: ::c_int = 8;
+pub const KERN_PANIC: ::c_int = 15;
+pub const KERN_REALROOTDEV: ::c_int = 16;
+pub const KERN_SPARC_REBOOT: ::c_int = 21;
+pub const KERN_CTLALTDEL: ::c_int = 22;
+pub const KERN_PRINTK: ::c_int = 23;
+pub const KERN_NAMETRANS: ::c_int = 24;
+pub const KERN_PPC_HTABRECLAIM: ::c_int = 25;
+pub const KERN_PPC_ZEROPAGED: ::c_int = 26;
+pub const KERN_PPC_POWERSAVE_NAP: ::c_int = 27;
+pub const KERN_MODPROBE: ::c_int = 28;
+pub const KERN_SG_BIG_BUFF: ::c_int = 29;
+pub const KERN_ACCT: ::c_int = 30;
+pub const KERN_PPC_L2CR: ::c_int = 31;
+pub const KERN_RTSIGNR: ::c_int = 32;
+pub const KERN_RTSIGMAX: ::c_int = 33;
+pub const KERN_SHMMAX: ::c_int = 34;
+pub const KERN_MSGMAX: ::c_int = 35;
+pub const KERN_MSGMNB: ::c_int = 36;
+pub const KERN_MSGPOOL: ::c_int = 37;
+pub const KERN_SYSRQ: ::c_int = 38;
+pub const KERN_MAX_THREADS: ::c_int = 39;
+pub const KERN_RANDOM: ::c_int = 40;
+pub const KERN_SHMALL: ::c_int = 41;
+pub const KERN_MSGMNI: ::c_int = 42;
+pub const KERN_SEM: ::c_int = 43;
+pub const KERN_SPARC_STOP_A: ::c_int = 44;
+pub const KERN_SHMMNI: ::c_int = 45;
+pub const KERN_OVERFLOWUID: ::c_int = 46;
+pub const KERN_OVERFLOWGID: ::c_int = 47;
+pub const KERN_SHMPATH: ::c_int = 48;
+pub const KERN_HOTPLUG: ::c_int = 49;
+pub const KERN_IEEE_EMULATION_WARNINGS: ::c_int = 50;
+pub const KERN_S390_USER_DEBUG_LOGGING: ::c_int = 51;
+pub const KERN_CORE_USES_PID: ::c_int = 52;
+pub const KERN_TAINTED: ::c_int = 53;
+pub const KERN_CADPID: ::c_int = 54;
+pub const KERN_PIDMAX: ::c_int = 55;
+pub const KERN_CORE_PATTERN: ::c_int = 56;
+pub const KERN_PANIC_ON_OOPS: ::c_int = 57;
+pub const KERN_HPPA_PWRSW: ::c_int = 58;
+pub const KERN_HPPA_UNALIGNED: ::c_int = 59;
+pub const KERN_PRINTK_RATELIMIT: ::c_int = 60;
+pub const KERN_PRINTK_RATELIMIT_BURST: ::c_int = 61;
+pub const KERN_PTY: ::c_int = 62;
+pub const KERN_NGROUPS_MAX: ::c_int = 63;
+pub const KERN_SPARC_SCONS_PWROFF: ::c_int = 64;
+pub const KERN_HZ_TIMER: ::c_int = 65;
+pub const KERN_UNKNOWN_NMI_PANIC: ::c_int = 66;
+pub const KERN_BOOTLOADER_TYPE: ::c_int = 67;
+pub const KERN_RANDOMIZE: ::c_int = 68;
+pub const KERN_SETUID_DUMPABLE: ::c_int = 69;
+pub const KERN_SPIN_RETRY: ::c_int = 70;
+pub const KERN_ACPI_VIDEO_FLAGS: ::c_int = 71;
+pub const KERN_IA64_UNALIGNED: ::c_int = 72;
+pub const KERN_COMPAT_LOG: ::c_int = 73;
+pub const KERN_MAX_LOCK_DEPTH: ::c_int = 74;
+pub const KERN_NMI_WATCHDOG: ::c_int = 75;
+pub const KERN_PANIC_ON_NMI: ::c_int = 76;
+
+pub const VM_OVERCOMMIT_MEMORY: ::c_int = 5;
+pub const VM_PAGE_CLUSTER: ::c_int = 10;
+pub const VM_DIRTY_BACKGROUND: ::c_int = 11;
+pub const VM_DIRTY_RATIO: ::c_int = 12;
+pub const VM_DIRTY_WB_CS: ::c_int = 13;
+pub const VM_DIRTY_EXPIRE_CS: ::c_int = 14;
+pub const VM_NR_PDFLUSH_THREADS: ::c_int = 15;
+pub const VM_OVERCOMMIT_RATIO: ::c_int = 16;
+pub const VM_PAGEBUF: ::c_int = 17;
+pub const VM_HUGETLB_PAGES: ::c_int = 18;
+pub const VM_SWAPPINESS: ::c_int = 19;
+pub const VM_LOWMEM_RESERVE_RATIO: ::c_int = 20;
+pub const VM_MIN_FREE_KBYTES: ::c_int = 21;
+pub const VM_MAX_MAP_COUNT: ::c_int = 22;
+pub const VM_LAPTOP_MODE: ::c_int = 23;
+pub const VM_BLOCK_DUMP: ::c_int = 24;
+pub const VM_HUGETLB_GROUP: ::c_int = 25;
+pub const VM_VFS_CACHE_PRESSURE: ::c_int = 26;
+pub const VM_LEGACY_VA_LAYOUT: ::c_int = 27;
+pub const VM_SWAP_TOKEN_TIMEOUT: ::c_int = 28;
+pub const VM_DROP_PAGECACHE: ::c_int = 29;
+pub const VM_PERCPU_PAGELIST_FRACTION: ::c_int = 30;
+pub const VM_ZONE_RECLAIM_MODE: ::c_int = 31;
+pub const VM_MIN_UNMAPPED: ::c_int = 32;
+pub const VM_PANIC_ON_OOM: ::c_int = 33;
+pub const VM_VDSO_ENABLED: ::c_int = 34;
+pub const VM_MIN_SLAB: ::c_int = 35;
+
+pub const NET_CORE: ::c_int = 1;
+pub const NET_ETHER: ::c_int = 2;
+pub const NET_802: ::c_int = 3;
+pub const NET_UNIX: ::c_int = 4;
+pub const NET_IPV4: ::c_int = 5;
+pub const NET_IPX: ::c_int = 6;
+pub const NET_ATALK: ::c_int = 7;
+pub const NET_NETROM: ::c_int = 8;
+pub const NET_AX25: ::c_int = 9;
+pub const NET_BRIDGE: ::c_int = 10;
+pub const NET_ROSE: ::c_int = 11;
+pub const NET_IPV6: ::c_int = 12;
+pub const NET_X25: ::c_int = 13;
+pub const NET_TR: ::c_int = 14;
+pub const NET_DECNET: ::c_int = 15;
+pub const NET_ECONET: ::c_int = 16;
+pub const NET_SCTP: ::c_int = 17;
+pub const NET_LLC: ::c_int = 18;
+pub const NET_NETFILTER: ::c_int = 19;
+pub const NET_DCCP: ::c_int = 20;
+pub const NET_IRDA: ::c_int = 412;
+
+// include/linux/sched.h
+pub const PF_VCPU: ::c_int = 0x00000001;
+pub const PF_IDLE: ::c_int = 0x00000002;
+pub const PF_EXITING: ::c_int = 0x00000004;
+pub const PF_POSTCOREDUMP: ::c_int = 0x00000008;
+pub const PF_IO_WORKER: ::c_int = 0x00000010;
+pub const PF_WQ_WORKER: ::c_int = 0x00000020;
+pub const PF_FORKNOEXEC: ::c_int = 0x00000040;
+pub const PF_MCE_PROCESS: ::c_int = 0x00000080;
+pub const PF_SUPERPRIV: ::c_int = 0x00000100;
+pub const PF_DUMPCORE: ::c_int = 0x00000200;
+pub const PF_SIGNALED: ::c_int = 0x00000400;
+pub const PF_MEMALLOC: ::c_int = 0x00000800;
+pub const PF_NPROC_EXCEEDED: ::c_int = 0x00001000;
+pub const PF_USED_MATH: ::c_int = 0x00002000;
+pub const PF_USER_WORKER: ::c_int = 0x00004000;
+pub const PF_NOFREEZE: ::c_int = 0x00008000;
+pub const PF_KSWAPD: ::c_int = 0x00020000;
+pub const PF_MEMALLOC_NOFS: ::c_int = 0x00040000;
+pub const PF_MEMALLOC_NOIO: ::c_int = 0x00080000;
+pub const PF_LOCAL_THROTTLE: ::c_int = 0x00100000;
+pub const PF_KTHREAD: ::c_int = 0x00200000;
+pub const PF_RANDOMIZE: ::c_int = 0x00400000;
+pub const PF_NO_SETAFFINITY: ::c_int = 0x04000000;
+pub const PF_MCE_EARLY: ::c_int = 0x08000000;
+pub const PF_MEMALLOC_PIN: ::c_int = 0x10000000;
+
+pub const CSIGNAL: ::c_int = 0x000000ff;
+
+pub const SCHED_NORMAL: ::c_int = 0;
+pub const SCHED_OTHER: ::c_int = 0;
+pub const SCHED_FIFO: ::c_int = 1;
+pub const SCHED_RR: ::c_int = 2;
+pub const SCHED_BATCH: ::c_int = 3;
+pub const SCHED_IDLE: ::c_int = 5;
+pub const SCHED_DEADLINE: ::c_int = 6;
+
+pub const SCHED_RESET_ON_FORK: ::c_int = 0x40000000;
+
+pub const CLONE_PIDFD: ::c_int = 0x1000;
+
+pub const SCHED_FLAG_RESET_ON_FORK: ::c_int = 0x01;
+pub const SCHED_FLAG_RECLAIM: ::c_int = 0x02;
+pub const SCHED_FLAG_DL_OVERRUN: ::c_int = 0x04;
+pub const SCHED_FLAG_KEEP_POLICY: ::c_int = 0x08;
+pub const SCHED_FLAG_KEEP_PARAMS: ::c_int = 0x10;
+pub const SCHED_FLAG_UTIL_CLAMP_MIN: ::c_int = 0x20;
+pub const SCHED_FLAG_UTIL_CLAMP_MAX: ::c_int = 0x40;
+
+pub const SCHED_FLAG_KEEP_ALL: ::c_int = SCHED_FLAG_KEEP_POLICY | SCHED_FLAG_KEEP_PARAMS;
+
+pub const SCHED_FLAG_UTIL_CLAMP: ::c_int = SCHED_FLAG_UTIL_CLAMP_MIN | SCHED_FLAG_UTIL_CLAMP_MAX;
+
+pub const SCHED_FLAG_ALL: ::c_int = SCHED_FLAG_RESET_ON_FORK
+    | SCHED_FLAG_RECLAIM
+    | SCHED_FLAG_DL_OVERRUN
+    | SCHED_FLAG_KEEP_ALL
+    | SCHED_FLAG_UTIL_CLAMP;
+
+f! {
+    pub fn NLA_ALIGN(len: ::c_int) -> ::c_int {
+        return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1)
+    }
+
+    pub fn CMSG_NXTHDR(mhdr: *const msghdr,
+                       cmsg: *const cmsghdr) -> *mut cmsghdr {
+        if ((*cmsg).cmsg_len as usize) < ::mem::size_of::<cmsghdr>() {
+            return 0 as *mut cmsghdr;
+        };
+        let next = (cmsg as usize +
+                    super::CMSG_ALIGN((*cmsg).cmsg_len as usize))
+            as *mut cmsghdr;
+        let max = (*mhdr).msg_control as usize
+            + (*mhdr).msg_controllen as usize;
+        if (next.wrapping_offset(1)) as usize > max ||
+            next as usize + super::CMSG_ALIGN((*next).cmsg_len as usize) > max
+        {
+            0 as *mut cmsghdr
+        } else {
+            next as *mut cmsghdr
+        }
+    }
+
+    pub fn CPU_ALLOC_SIZE(count: ::c_int) -> ::size_t {
+        let _dummy: cpu_set_t = ::mem::zeroed();
+        let size_in_bits = 8 * ::mem::size_of_val(&_dummy.bits[0]);
+        ((count as ::size_t + size_in_bits - 1) / 8) as ::size_t
+    }
+
+    pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
+        for slot in cpuset.bits.iter_mut() {
+            *slot = 0;
+        }
+    }
+
+    pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
+        let size_in_bits
+            = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
+        let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
+        cpuset.bits[idx] |= 1 << offset;
+        ()
+    }
+
+    pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
+        let size_in_bits
+            = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
+        let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
+        cpuset.bits[idx] &= !(1 << offset);
+        ()
+    }
+
+    pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {
+        let size_in_bits = 8 * ::mem::size_of_val(&cpuset.bits[0]);
+        let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
+        0 != (cpuset.bits[idx] & (1 << offset))
+    }
+
+    pub fn CPU_COUNT_S(size: usize, cpuset: &cpu_set_t) -> ::c_int {
+        let mut s: u32 = 0;
+        let size_of_mask = ::mem::size_of_val(&cpuset.bits[0]);
+        for i in cpuset.bits[..(size / size_of_mask)].iter() {
+            s += i.count_ones();
+        };
+        s as ::c_int
+    }
+
+    pub fn CPU_COUNT(cpuset: &cpu_set_t) -> ::c_int {
+        CPU_COUNT_S(::mem::size_of::<cpu_set_t>(), cpuset)
+    }
+
+    pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
+        set1.bits == set2.bits
+    }
+
+    pub fn SCTP_PR_INDEX(policy: ::c_int) -> ::c_int {
+        policy >> 4 - 1
+    }
+
+    pub fn SCTP_PR_POLICY(policy: ::c_int) -> ::c_int {
+        policy & SCTP_PR_SCTP_MASK
+    }
+
+    pub fn SCTP_PR_SET_POLICY(flags: &mut ::c_int, policy: ::c_int) -> () {
+        *flags &= !SCTP_PR_SCTP_MASK;
+        *flags |= policy;
+        ()
+    }
+
+    pub fn major(dev: ::dev_t) -> ::c_uint {
+        let mut major = 0;
+        major |= (dev & 0x00000000000fff00) >> 8;
+        major |= (dev & 0xfffff00000000000) >> 32;
+        major as ::c_uint
+    }
+
+    pub fn minor(dev: ::dev_t) -> ::c_uint {
+        let mut minor = 0;
+        minor |= (dev & 0x00000000000000ff) >> 0;
+        minor |= (dev & 0x00000ffffff00000) >> 12;
+        minor as ::c_uint
+    }
+
+    pub fn IPTOS_TOS(tos: u8) -> u8 {
+        tos & IPTOS_TOS_MASK
+    }
+
+    pub fn IPTOS_PREC(tos: u8) -> u8 {
+        tos & IPTOS_PREC_MASK
+    }
+
+    pub fn RT_TOS(tos: u8) -> u8 {
+        tos & ::IPTOS_TOS_MASK
+    }
+
+    pub fn RT_ADDRCLASS(flags: u32) -> u32 {
+        flags >> 23
+    }
+
+    pub fn RT_LOCALADDR(flags: u32) -> bool {
+        (flags & RTF_ADDRCLASSMASK) == (RTF_LOCAL | RTF_INTERFACE)
+    }
+
+    pub fn SO_EE_OFFENDER(ee: *const ::sock_extended_err) -> *mut ::sockaddr {
+        ee.offset(1) as *mut ::sockaddr
+    }
+
+    pub fn BPF_RVAL(code: ::__u32) -> ::__u32 {
+        code & 0x18
+    }
+
+    pub fn BPF_MISCOP(code: ::__u32) -> ::__u32 {
+        code & 0xf8
+    }
+
+    pub fn BPF_STMT(code: ::__u16, k: ::__u32) -> sock_filter {
+        sock_filter{code: code, jt: 0, jf: 0, k: k}
+    }
+
+    pub fn BPF_JUMP(code: ::__u16, k: ::__u32, jt: ::__u8, jf: ::__u8) -> sock_filter {
+        sock_filter{code: code, jt: jt, jf: jf, k: k}
+    }
+}
+
+safe_f! {
+    pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::dev_t;
+        let mut dev = 0;
+        dev |= (major & 0x00000fff) << 8;
+        dev |= (major & 0xfffff000) << 32;
+        dev |= (minor & 0x000000ff) << 0;
+        dev |= (minor & 0xffffff00) << 12;
+        dev
+    }
+
+    pub {const} fn SCTP_PR_TTL_ENABLED(policy: ::c_int) -> bool {
+        policy == SCTP_PR_SCTP_TTL
+    }
+
+    pub {const} fn SCTP_PR_RTX_ENABLED(policy: ::c_int) -> bool {
+        policy == SCTP_PR_SCTP_RTX
+    }
+
+    pub {const} fn SCTP_PR_PRIO_ENABLED(policy: ::c_int) -> bool {
+        policy == SCTP_PR_SCTP_PRIO
+    }
+}
+
+cfg_if! {
+    if #[cfg(all(not(target_env = "uclibc"), not(target_env = "ohos")))] {
+        extern "C" {
+            pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
+            pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
+            pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+            pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
+            pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
+            pub fn aio_suspend(
+                aiocb_list: *const *const aiocb,
+                nitems: ::c_int,
+                timeout: *const ::timespec,
+            ) -> ::c_int;
+            pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+            pub fn lio_listio(
+                mode: ::c_int,
+                aiocb_list: *const *mut aiocb,
+                nitems: ::c_int,
+                sevp: *mut ::sigevent,
+            ) -> ::c_int;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(not(target_env = "uclibc"))] {
+        extern "C" {
+            pub fn pwritev(
+                fd: ::c_int,
+                iov: *const ::iovec,
+                iovcnt: ::c_int,
+                offset: ::off_t,
+            ) -> ::ssize_t;
+            pub fn preadv(
+                fd: ::c_int,
+                iov: *const ::iovec,
+                iovcnt: ::c_int,
+                offset: ::off_t,
+            ) -> ::ssize_t;
+            pub fn getnameinfo(
+                sa: *const ::sockaddr,
+                salen: ::socklen_t,
+                host: *mut ::c_char,
+                hostlen: ::socklen_t,
+                serv: *mut ::c_char,
+                servlen: ::socklen_t,
+                flags: ::c_int,
+            ) -> ::c_int;
+            pub fn getloadavg(
+                loadavg: *mut ::c_double,
+                nelem: ::c_int
+            ) -> ::c_int;
+            pub fn process_vm_readv(
+                pid: ::pid_t,
+                local_iov: *const ::iovec,
+                liovcnt: ::c_ulong,
+                remote_iov: *const ::iovec,
+                riovcnt: ::c_ulong,
+                flags: ::c_ulong,
+            ) -> isize;
+            pub fn process_vm_writev(
+                pid: ::pid_t,
+                local_iov: *const ::iovec,
+                liovcnt: ::c_ulong,
+                remote_iov: *const ::iovec,
+                riovcnt: ::c_ulong,
+                flags: ::c_ulong,
+            ) -> isize;
+            pub fn futimes(
+                fd: ::c_int,
+                times: *const ::timeval
+            ) -> ::c_int;
+        }
+    }
+}
+
+// These functions are not available on OpenHarmony
+cfg_if! {
+    if #[cfg(not(target_env = "ohos"))] {
+        extern "C" {
+            // Only `getspnam_r` is implemented for musl, out of all of the reenterant
+            // functions from `shadow.h`.
+            // https://git.musl-libc.org/cgit/musl/tree/include/shadow.h
+            pub fn getspnam_r(
+                name: *const ::c_char,
+                spbuf: *mut spwd,
+                buf: *mut ::c_char,
+                buflen: ::size_t,
+                spbufp: *mut *mut spwd,
+            ) -> ::c_int;
+
+            pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int;
+            pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
+
+            pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
+            pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
+            pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
+            pub fn mq_receive(
+                mqd: ::mqd_t,
+                msg_ptr: *mut ::c_char,
+                msg_len: ::size_t,
+                msg_prio: *mut ::c_uint,
+            ) -> ::ssize_t;
+            pub fn mq_timedreceive(
+                mqd: ::mqd_t,
+                msg_ptr: *mut ::c_char,
+                msg_len: ::size_t,
+                msg_prio: *mut ::c_uint,
+                abs_timeout: *const ::timespec,
+            ) -> ::ssize_t;
+            pub fn mq_send(
+                mqd: ::mqd_t,
+                msg_ptr: *const ::c_char,
+                msg_len: ::size_t,
+                msg_prio: ::c_uint,
+            ) -> ::c_int;
+            pub fn mq_timedsend(
+                mqd: ::mqd_t,
+                msg_ptr: *const ::c_char,
+                msg_len: ::size_t,
+                msg_prio: ::c_uint,
+                abs_timeout: *const ::timespec,
+            ) -> ::c_int;
+            pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
+            pub fn mq_setattr(
+                mqd: ::mqd_t,
+                newattr: *const ::mq_attr,
+                oldattr: *mut ::mq_attr
+            ) -> ::c_int;
+
+            pub fn pthread_mutex_consistent(mutex: *mut pthread_mutex_t) -> ::c_int;
+            pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
+            pub fn pthread_mutexattr_getrobust(
+                attr: *const pthread_mutexattr_t,
+                robustness: *mut ::c_int,
+            ) -> ::c_int;
+            pub fn pthread_mutexattr_setrobust(
+                attr: *mut pthread_mutexattr_t,
+                robustness: ::c_int,
+            ) -> ::c_int;
+        }
+    }
+}
+
+extern "C" {
+    #[cfg_attr(
+        not(any(target_env = "musl", target_env = "ohos")),
+        link_name = "__xpg_strerror_r"
+    )]
+    pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
+
+    pub fn abs(i: ::c_int) -> ::c_int;
+    pub fn labs(i: ::c_long) -> ::c_long;
+    pub fn rand() -> ::c_int;
+    pub fn srand(seed: ::c_uint);
+
+    pub fn drand48() -> ::c_double;
+    pub fn erand48(xseed: *mut ::c_ushort) -> ::c_double;
+    pub fn lrand48() -> ::c_long;
+    pub fn nrand48(xseed: *mut ::c_ushort) -> ::c_long;
+    pub fn mrand48() -> ::c_long;
+    pub fn jrand48(xseed: *mut ::c_ushort) -> ::c_long;
+    pub fn srand48(seed: ::c_long);
+    pub fn seed48(xseed: *mut ::c_ushort) -> *mut ::c_ushort;
+    pub fn lcong48(p: *mut ::c_ushort);
+
+    pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
+
+    pub fn setpwent();
+    pub fn endpwent();
+    pub fn getpwent() -> *mut passwd;
+    pub fn setgrent();
+    pub fn endgrent();
+    pub fn getgrent() -> *mut ::group;
+    pub fn setspent();
+    pub fn endspent();
+    pub fn getspent() -> *mut spwd;
+
+    pub fn getspnam(name: *const ::c_char) -> *mut spwd;
+
+    // System V IPC
+    pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
+    pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
+    pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
+    pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
+    pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
+    pub fn semget(key: ::key_t, nsems: ::c_int, semflag: ::c_int) -> ::c_int;
+    pub fn semop(semid: ::c_int, sops: *mut ::sembuf, nsops: ::size_t) -> ::c_int;
+    pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
+    pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int;
+    pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
+    pub fn msgrcv(
+        msqid: ::c_int,
+        msgp: *mut ::c_void,
+        msgsz: ::size_t,
+        msgtyp: ::c_long,
+        msgflg: ::c_int,
+    ) -> ::ssize_t;
+    pub fn msgsnd(
+        msqid: ::c_int,
+        msgp: *const ::c_void,
+        msgsz: ::size_t,
+        msgflg: ::c_int,
+    ) -> ::c_int;
+
+    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+    pub fn __errno_location() -> *mut ::c_int;
+
+    pub fn fallocate(fd: ::c_int, mode: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+    pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+    pub fn readahead(fd: ::c_int, offset: ::off64_t, count: ::size_t) -> ::ssize_t;
+    pub fn getxattr(
+        path: *const c_char,
+        name: *const c_char,
+        value: *mut ::c_void,
+        size: ::size_t,
+    ) -> ::ssize_t;
+    pub fn lgetxattr(
+        path: *const c_char,
+        name: *const c_char,
+        value: *mut ::c_void,
+        size: ::size_t,
+    ) -> ::ssize_t;
+    pub fn fgetxattr(
+        filedes: ::c_int,
+        name: *const c_char,
+        value: *mut ::c_void,
+        size: ::size_t,
+    ) -> ::ssize_t;
+    pub fn setxattr(
+        path: *const c_char,
+        name: *const c_char,
+        value: *const ::c_void,
+        size: ::size_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn lsetxattr(
+        path: *const c_char,
+        name: *const c_char,
+        value: *const ::c_void,
+        size: ::size_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn fsetxattr(
+        filedes: ::c_int,
+        name: *const c_char,
+        value: *const ::c_void,
+        size: ::size_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn listxattr(path: *const c_char, list: *mut c_char, size: ::size_t) -> ::ssize_t;
+    pub fn llistxattr(path: *const c_char, list: *mut c_char, size: ::size_t) -> ::ssize_t;
+    pub fn flistxattr(filedes: ::c_int, list: *mut c_char, size: ::size_t) -> ::ssize_t;
+    pub fn removexattr(path: *const c_char, name: *const c_char) -> ::c_int;
+    pub fn lremovexattr(path: *const c_char, name: *const c_char) -> ::c_int;
+    pub fn fremovexattr(filedes: ::c_int, name: *const c_char) -> ::c_int;
+    pub fn signalfd(fd: ::c_int, mask: *const ::sigset_t, flags: ::c_int) -> ::c_int;
+    pub fn timerfd_create(clockid: ::clockid_t, flags: ::c_int) -> ::c_int;
+    pub fn timerfd_gettime(fd: ::c_int, curr_value: *mut itimerspec) -> ::c_int;
+    pub fn timerfd_settime(
+        fd: ::c_int,
+        flags: ::c_int,
+        new_value: *const itimerspec,
+        old_value: *mut itimerspec,
+    ) -> ::c_int;
+    pub fn quotactl(
+        cmd: ::c_int,
+        special: *const ::c_char,
+        id: ::c_int,
+        data: *mut ::c_char,
+    ) -> ::c_int;
+    pub fn epoll_pwait(
+        epfd: ::c_int,
+        events: *mut ::epoll_event,
+        maxevents: ::c_int,
+        timeout: ::c_int,
+        sigmask: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
+    pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn sigtimedwait(
+        set: *const sigset_t,
+        info: *mut siginfo_t,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
+    pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
+    pub fn accept4(
+        fd: ::c_int,
+        addr: *mut ::sockaddr,
+        len: *mut ::socklen_t,
+        flg: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_getaffinity_np(
+        thread: ::pthread_t,
+        cpusetsize: ::size_t,
+        cpuset: *mut ::cpu_set_t,
+    ) -> ::c_int;
+    pub fn pthread_setaffinity_np(
+        thread: ::pthread_t,
+        cpusetsize: ::size_t,
+        cpuset: *const ::cpu_set_t,
+    ) -> ::c_int;
+    pub fn pthread_setschedprio(native: ::pthread_t, priority: ::c_int) -> ::c_int;
+    pub fn reboot(how_to: ::c_int) -> ::c_int;
+    pub fn setfsgid(gid: ::gid_t) -> ::c_int;
+    pub fn setfsuid(uid: ::uid_t) -> ::c_int;
+
+    // Not available now on Android
+    pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
+    pub fn if_nameindex() -> *mut if_nameindex;
+    pub fn if_freenameindex(ptr: *mut if_nameindex);
+    pub fn sync_file_range(
+        fd: ::c_int,
+        offset: ::off64_t,
+        nbytes: ::off64_t,
+        flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn mremap(
+        addr: *mut ::c_void,
+        len: ::size_t,
+        new_len: ::size_t,
+        flags: ::c_int,
+        ...
+    ) -> *mut ::c_void;
+
+    pub fn glob(
+        pattern: *const c_char,
+        flags: ::c_int,
+        errfunc: ::Option<extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut ::glob_t,
+    ) -> ::c_int;
+    pub fn globfree(pglob: *mut ::glob_t);
+
+    pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+
+    pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
+    pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+
+    pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+    pub fn remap_file_pages(
+        addr: *mut ::c_void,
+        size: ::size_t,
+        prot: ::c_int,
+        pgoff: ::size_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn recvfrom(
+        socket: ::c_int,
+        buf: *mut ::c_void,
+        len: ::size_t,
+        flags: ::c_int,
+        addr: *mut ::sockaddr,
+        addrlen: *mut ::socklen_t,
+    ) -> ::ssize_t;
+    pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
+
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+
+    pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
+    pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int;
+    pub fn vhangup() -> ::c_int;
+    pub fn sync();
+    pub fn syncfs(fd: ::c_int) -> ::c_int;
+    pub fn syscall(num: ::c_long, ...) -> ::c_long;
+    pub fn sched_getaffinity(pid: ::pid_t, cpusetsize: ::size_t, cpuset: *mut cpu_set_t)
+        -> ::c_int;
+    pub fn sched_setaffinity(
+        pid: ::pid_t,
+        cpusetsize: ::size_t,
+        cpuset: *const cpu_set_t,
+    ) -> ::c_int;
+    pub fn epoll_create(size: ::c_int) -> ::c_int;
+    pub fn epoll_create1(flags: ::c_int) -> ::c_int;
+    pub fn epoll_wait(
+        epfd: ::c_int,
+        events: *mut ::epoll_event,
+        maxevents: ::c_int,
+        timeout: ::c_int,
+    ) -> ::c_int;
+    pub fn epoll_ctl(epfd: ::c_int, op: ::c_int, fd: ::c_int, event: *mut ::epoll_event)
+        -> ::c_int;
+    pub fn pthread_getschedparam(
+        native: ::pthread_t,
+        policy: *mut ::c_int,
+        param: *mut ::sched_param,
+    ) -> ::c_int;
+    pub fn unshare(flags: ::c_int) -> ::c_int;
+    pub fn umount(target: *const ::c_char) -> ::c_int;
+    pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
+    pub fn tee(fd_in: ::c_int, fd_out: ::c_int, len: ::size_t, flags: ::c_uint) -> ::ssize_t;
+    pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
+    pub fn splice(
+        fd_in: ::c_int,
+        off_in: *mut ::loff_t,
+        fd_out: ::c_int,
+        off_out: *mut ::loff_t,
+        len: ::size_t,
+        flags: ::c_uint,
+    ) -> ::ssize_t;
+    pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
+    pub fn eventfd_read(fd: ::c_int, value: *mut eventfd_t) -> ::c_int;
+    pub fn eventfd_write(fd: ::c_int, value: eventfd_t) -> ::c_int;
+
+    pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
+    pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
+    pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
+    pub fn setns(fd: ::c_int, nstype: ::c_int) -> ::c_int;
+    pub fn swapoff(path: *const ::c_char) -> ::c_int;
+    pub fn vmsplice(
+        fd: ::c_int,
+        iov: *const ::iovec,
+        nr_segs: ::size_t,
+        flags: ::c_uint,
+    ) -> ::ssize_t;
+    pub fn mount(
+        src: *const ::c_char,
+        target: *const ::c_char,
+        fstype: *const ::c_char,
+        flags: ::c_ulong,
+        data: *const ::c_void,
+    ) -> ::c_int;
+    pub fn personality(persona: ::c_ulong) -> ::c_int;
+    pub fn prctl(option: ::c_int, ...) -> ::c_int;
+    pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int;
+    pub fn ppoll(
+        fds: *mut ::pollfd,
+        nfds: nfds_t,
+        timeout: *const ::timespec,
+        sigmask: *const sigset_t,
+    ) -> ::c_int;
+    pub fn pthread_mutexattr_getprotocol(
+        attr: *const pthread_mutexattr_t,
+        protocol: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_mutexattr_setprotocol(
+        attr: *mut pthread_mutexattr_t,
+        protocol: ::c_int,
+    ) -> ::c_int;
+
+    pub fn pthread_mutex_timedlock(
+        lock: *mut pthread_mutex_t,
+        abstime: *const ::timespec,
+    ) -> ::c_int;
+    pub fn pthread_barrierattr_init(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_destroy(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_getpshared(
+        attr: *const ::pthread_barrierattr_t,
+        shared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrierattr_setpshared(
+        attr: *mut ::pthread_barrierattr_t,
+        shared: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrier_init(
+        barrier: *mut pthread_barrier_t,
+        attr: *const ::pthread_barrierattr_t,
+        count: ::c_uint,
+    ) -> ::c_int;
+    pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> ::c_int;
+    pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> ::c_int;
+    pub fn pthread_spin_init(lock: *mut ::pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
+    pub fn pthread_spin_destroy(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_lock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_trylock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_unlock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+    pub fn clone(
+        cb: extern "C" fn(*mut ::c_void) -> ::c_int,
+        child_stack: *mut ::c_void,
+        flags: ::c_int,
+        arg: *mut ::c_void,
+        ...
+    ) -> ::c_int;
+    pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
+    pub fn clock_nanosleep(
+        clk_id: ::clockid_t,
+        flags: ::c_int,
+        rqtp: *const ::timespec,
+        rmtp: *mut ::timespec,
+    ) -> ::c_int;
+    pub fn pthread_attr_getguardsize(
+        attr: *const ::pthread_attr_t,
+        guardsize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
+    pub fn pthread_attr_getinheritsched(
+        attr: *const ::pthread_attr_t,
+        inheritsched: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_attr_setinheritsched(
+        attr: *mut ::pthread_attr_t,
+        inheritsched: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_attr_getschedpolicy(
+        attr: *const ::pthread_attr_t,
+        policy: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_attr_setschedpolicy(attr: *mut ::pthread_attr_t, policy: ::c_int) -> ::c_int;
+    pub fn pthread_attr_getschedparam(
+        attr: *const ::pthread_attr_t,
+        param: *mut ::sched_param,
+    ) -> ::c_int;
+    pub fn pthread_attr_setschedparam(
+        attr: *mut ::pthread_attr_t,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
+    pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
+    pub fn pthread_condattr_getpshared(
+        attr: *const pthread_condattr_t,
+        pshared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn sysinfo(info: *mut ::sysinfo) -> ::c_int;
+    pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int;
+    pub fn pthread_setschedparam(
+        native: ::pthread_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int;
+    pub fn sched_setscheduler(
+        pid: ::pid_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn sendfile(
+        out_fd: ::c_int,
+        in_fd: ::c_int,
+        offset: *mut off_t,
+        count: ::size_t,
+    ) -> ::ssize_t;
+    pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
+    pub fn sem_close(sem: *mut sem_t) -> ::c_int;
+    pub fn getdtablesize() -> ::c_int;
+    pub fn getgrnam_r(
+        name: *const ::c_char,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int;
+    pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
+    pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
+    pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
+    pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
+    pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
+    pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
+    pub fn getpwnam_r(
+        name: *const ::c_char,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+    pub fn getpwuid_r(
+        uid: ::uid_t,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+    pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
+    pub fn pthread_atfork(
+        prepare: ::Option<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+    pub fn getgrouplist(
+        user: *const ::c_char,
+        group: ::gid_t,
+        groups: *mut ::gid_t,
+        ngroups: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_mutexattr_getpshared(
+        attr: *const pthread_mutexattr_t,
+        pshared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
+    pub fn faccessat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::c_int,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_create(
+        native: *mut ::pthread_t,
+        attr: *const ::pthread_attr_t,
+        f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
+        value: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn dl_iterate_phdr(
+        callback: ::Option<
+            unsafe extern "C" fn(
+                info: *mut ::dl_phdr_info,
+                size: ::size_t,
+                data: *mut ::c_void,
+            ) -> ::c_int,
+        >,
+        data: *mut ::c_void,
+    ) -> ::c_int;
+
+    pub fn setmntent(filename: *const ::c_char, ty: *const ::c_char) -> *mut ::FILE;
+    pub fn getmntent(stream: *mut ::FILE) -> *mut ::mntent;
+    pub fn addmntent(stream: *mut ::FILE, mnt: *const ::mntent) -> ::c_int;
+    pub fn endmntent(streamp: *mut ::FILE) -> ::c_int;
+    pub fn hasmntopt(mnt: *const ::mntent, opt: *const ::c_char) -> *mut ::c_char;
+
+    pub fn posix_spawn(
+        pid: *mut ::pid_t,
+        path: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawnp(
+        pid: *mut ::pid_t,
+        file: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
+    pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
+    pub fn posix_spawnattr_getsigdefault(
+        attr: *const posix_spawnattr_t,
+        default: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigdefault(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getsigmask(
+        attr: *const posix_spawnattr_t,
+        default: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigmask(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getflags(
+        attr: *const posix_spawnattr_t,
+        flags: *mut ::c_short,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int;
+    pub fn posix_spawnattr_getpgroup(
+        attr: *const posix_spawnattr_t,
+        flags: *mut ::pid_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
+    pub fn posix_spawnattr_getschedpolicy(
+        attr: *const posix_spawnattr_t,
+        flags: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int;
+    pub fn posix_spawnattr_getschedparam(
+        attr: *const posix_spawnattr_t,
+        param: *mut ::sched_param,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setschedparam(
+        attr: *mut posix_spawnattr_t,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+
+    pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+    pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+    pub fn posix_spawn_file_actions_addopen(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+        path: *const ::c_char,
+        oflag: ::c_int,
+        mode: ::mode_t,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_addclose(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_adddup2(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+        newfd: ::c_int,
+    ) -> ::c_int;
+    pub fn fread_unlocked(
+        buf: *mut ::c_void,
+        size: ::size_t,
+        nobj: ::size_t,
+        stream: *mut ::FILE,
+    ) -> ::size_t;
+    pub fn inotify_rm_watch(fd: ::c_int, wd: ::c_int) -> ::c_int;
+    pub fn inotify_init() -> ::c_int;
+    pub fn inotify_init1(flags: ::c_int) -> ::c_int;
+    pub fn inotify_add_watch(fd: ::c_int, path: *const ::c_char, mask: u32) -> ::c_int;
+    pub fn fanotify_init(flags: ::c_uint, event_f_flags: ::c_uint) -> ::c_int;
+
+    pub fn regcomp(preg: *mut ::regex_t, pattern: *const ::c_char, cflags: ::c_int) -> ::c_int;
+
+    pub fn regexec(
+        preg: *const ::regex_t,
+        input: *const ::c_char,
+        nmatch: ::size_t,
+        pmatch: *mut regmatch_t,
+        eflags: ::c_int,
+    ) -> ::c_int;
+
+    pub fn regerror(
+        errcode: ::c_int,
+        preg: *const ::regex_t,
+        errbuf: *mut ::c_char,
+        errbuf_size: ::size_t,
+    ) -> ::size_t;
+
+    pub fn regfree(preg: *mut ::regex_t);
+
+    pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
+    pub fn iconv(
+        cd: iconv_t,
+        inbuf: *mut *mut ::c_char,
+        inbytesleft: *mut ::size_t,
+        outbuf: *mut *mut ::c_char,
+        outbytesleft: *mut ::size_t,
+    ) -> ::size_t;
+    pub fn iconv_close(cd: iconv_t) -> ::c_int;
+
+    pub fn gettid() -> ::pid_t;
+
+    pub fn timer_create(
+        clockid: ::clockid_t,
+        sevp: *mut ::sigevent,
+        timerid: *mut ::timer_t,
+    ) -> ::c_int;
+    pub fn timer_delete(timerid: ::timer_t) -> ::c_int;
+    pub fn timer_getoverrun(timerid: ::timer_t) -> ::c_int;
+    pub fn timer_gettime(timerid: ::timer_t, curr_value: *mut ::itimerspec) -> ::c_int;
+    pub fn timer_settime(
+        timerid: ::timer_t,
+        flags: ::c_int,
+        new_value: *const ::itimerspec,
+        old_value: *mut ::itimerspec,
+    ) -> ::c_int;
+
+    pub fn gethostid() -> ::c_long;
+
+    pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int;
+    pub fn memmem(
+        haystack: *const ::c_void,
+        haystacklen: ::size_t,
+        needle: *const ::c_void,
+        needlelen: ::size_t,
+    ) -> *mut ::c_void;
+    pub fn sched_getcpu() -> ::c_int;
+
+    pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
+    pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
+    pub fn getopt_long(
+        argc: ::c_int,
+        argv: *const *mut c_char,
+        optstring: *const c_char,
+        longopts: *const option,
+        longindex: *mut ::c_int,
+    ) -> ::c_int;
+
+    pub fn pthread_once(control: *mut pthread_once_t, routine: extern "C" fn()) -> ::c_int;
+
+    pub fn copy_file_range(
+        fd_in: ::c_int,
+        off_in: *mut ::off64_t,
+        fd_out: ::c_int,
+        off_out: *mut ::off64_t,
+        len: ::size_t,
+        flags: ::c_uint,
+    ) -> ::ssize_t;
+}
+
+// LFS64 extensions
+//
+// * musl has 64-bit versions only so aliases the LFS64 symbols to the standard ones
+cfg_if! {
+    if #[cfg(not(target_env = "musl"))] {
+        extern "C" {
+            pub fn fallocate64(
+                fd: ::c_int,
+                mode: ::c_int,
+                offset: ::off64_t,
+                len: ::off64_t
+            ) -> ::c_int;
+            pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int;
+            pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut ::FILE;
+            pub fn freopen64(
+                filename: *const c_char,
+                mode: *const c_char,
+                file: *mut ::FILE,
+            ) -> *mut ::FILE;
+            pub fn fseeko64(stream: *mut ::FILE, offset: ::off64_t, whence: ::c_int) -> ::c_int;
+            pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int;
+            pub fn ftello64(stream: *mut ::FILE) -> ::off64_t;
+            pub fn posix_fallocate64(fd: ::c_int, offset: ::off64_t, len: ::off64_t) -> ::c_int;
+            pub fn sendfile64(
+                out_fd: ::c_int,
+                in_fd: ::c_int,
+                offset: *mut off64_t,
+                count: ::size_t,
+            ) -> ::ssize_t;
+            pub fn tmpfile64() -> *mut ::FILE;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_env = "uclibc")] {
+        mod uclibc;
+        pub use self::uclibc::*;
+    } else if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
+        mod musl;
+        pub use self::musl::*;
+    } else if #[cfg(target_env = "gnu")] {
+        mod gnu;
+        pub use self::gnu::*;
+    }
+}
+
+mod arch;
+pub use self::arch::*;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        #[macro_use]
+        mod align;
+    } else {
+        #[macro_use]
+        mod no_align;
+    }
+}
+expand_align!();
+
+cfg_if! {
+    if #[cfg(libc_non_exhaustive)] {
+        mod non_exhaustive;
+        pub use self::non_exhaustive::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/arm/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/arm/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/arm/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/arm/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(8))]
+    pub struct max_align_t {
+        priv_: (i64, i64)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/arm/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/arm/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/arm/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/arm/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,853 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        __st_dev_padding: ::c_int,
+        __st_ino_truncated: ::c_long,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __st_rdev_padding: ::c_int,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_ino: ::ino_t,
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        __st_dev_padding: ::c_int,
+        __st_ino_truncated: ::c_long,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __st_rdev_padding: ::c_int,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_ino: ::ino_t,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t
+    }
+
+    pub struct ipc_perm {
+        pub __ipc_perm_key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_int,
+        __unused1: ::c_long,
+        __unused2: ::c_long
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        __unused1: ::c_int,
+        pub shm_dtime: ::time_t,
+        __unused2: ::c_int,
+        pub shm_ctime: ::time_t,
+        __unused3: ::c_int,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::c_ulong,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __unused1: ::c_int,
+        pub msg_rtime: ::time_t,
+        __unused2: ::c_int,
+        pub msg_ctime: ::time_t,
+        __unused3: ::c_int,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 4],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        pub _pad: [::c_int; 29],
+        _align: [usize; 0],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 4],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        __f_unused: ::c_int,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct mcontext_t {
+        pub trap_no: ::c_ulong,
+        pub error_code: ::c_ulong,
+        pub oldmask: ::c_ulong,
+        pub arm_r0: ::c_ulong,
+        pub arm_r1: ::c_ulong,
+        pub arm_r2: ::c_ulong,
+        pub arm_r3: ::c_ulong,
+        pub arm_r4: ::c_ulong,
+        pub arm_r5: ::c_ulong,
+        pub arm_r6: ::c_ulong,
+        pub arm_r7: ::c_ulong,
+        pub arm_r8: ::c_ulong,
+        pub arm_r9: ::c_ulong,
+        pub arm_r10: ::c_ulong,
+        pub arm_fp: ::c_ulong,
+        pub arm_ip: ::c_ulong,
+        pub arm_sp: ::c_ulong,
+        pub arm_lr: ::c_ulong,
+        pub arm_pc: ::c_ulong,
+        pub arm_cpsr: ::c_ulong,
+        pub fault_address: ::c_ulong,
+    }
+}
+
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    pub struct ucontext_t {
+        pub uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_mcontext: mcontext_t,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_regspace: [::c_ulonglong; 64],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for ucontext_t {
+            fn eq(&self, other: &ucontext_t) -> bool {
+                self.uc_flags == other.uc_flags
+                    && self.uc_link == other.uc_link
+                    && self.uc_stack == other.uc_stack
+                    && self.uc_mcontext == other.uc_mcontext
+                    && self.uc_sigmask == other.uc_sigmask
+            }
+        }
+        impl Eq for ucontext_t {}
+        impl ::fmt::Debug for ucontext_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ucontext_t")
+                    .field("uc_flags", &self.uc_link)
+                    .field("uc_link", &self.uc_link)
+                    .field("uc_stack", &self.uc_stack)
+                    .field("uc_mcontext", &self.uc_mcontext)
+                    .field("uc_sigmask", &self.uc_sigmask)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for ucontext_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.uc_flags.hash(state);
+                self.uc_link.hash(state);
+                self.uc_stack.hash(state);
+                self.uc_mcontext.hash(state);
+                self.uc_sigmask.hash(state);
+            }
+        }
+    }
+}
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+
+pub const O_DIRECT: ::c_int = 0x10000;
+pub const O_DIRECTORY: ::c_int = 0x4000;
+pub const O_NOFOLLOW: ::c_int = 0x8000;
+pub const O_ASYNC: ::c_int = 0x2000;
+pub const O_LARGEFILE: ::c_int = 0o400000;
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::c_int = 0x00000800;
+pub const TAB2: ::c_int = 0x00001000;
+pub const TAB3: ::c_int = 0x00001800;
+pub const CR1: ::c_int = 0x00000200;
+pub const CR2: ::c_int = 0x00000400;
+pub const CR3: ::c_int = 0x00000600;
+pub const FF1: ::c_int = 0x00008000;
+pub const BS1: ::c_int = 0x00002000;
+pub const VT1: ::c_int = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const O_APPEND: ::c_int = 1024;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_LOCKED: ::c_int = 0x02000;
+pub const MAP_NORESERVE: ::c_int = 0x04000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const EDEADLK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EDEADLOCK: ::c_int = EDEADLK;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EBADMSG: ::c_int = 74;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const ERFKILL: ::c_int = 132;
+pub const EHWPOISON: ::c_int = 133;
+
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+
+pub const F_GETLK: ::c_int = 12;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETLK: ::c_int = 13;
+pub const F_SETLKW: ::c_int = 14;
+pub const F_SETOWN: ::c_int = 8;
+
+pub const VEOF: usize = 4;
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+// Syscall table
+pub const SYS_restart_syscall: ::c_long = 0;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execve: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lchown: ::c_long = 16;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_mount: ::c_long = 21;
+pub const SYS_setuid: ::c_long = 23;
+pub const SYS_getuid: ::c_long = 24;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_setgid: ::c_long = 46;
+pub const SYS_getgid: ::c_long = 47;
+pub const SYS_geteuid: ::c_long = 49;
+pub const SYS_getegid: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount2: ::c_long = 52;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_setreuid: ::c_long = 70;
+pub const SYS_setregid: ::c_long = 71;
+pub const SYS_sigsuspend: ::c_long = 72;
+pub const SYS_sigpending: ::c_long = 73;
+pub const SYS_sethostname: ::c_long = 74;
+pub const SYS_setrlimit: ::c_long = 75;
+pub const SYS_getrusage: ::c_long = 77;
+pub const SYS_gettimeofday: ::c_long = 78;
+pub const SYS_settimeofday: ::c_long = 79;
+pub const SYS_getgroups: ::c_long = 80;
+pub const SYS_setgroups: ::c_long = 81;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_readlink: ::c_long = 85;
+pub const SYS_uselib: ::c_long = 86;
+pub const SYS_swapon: ::c_long = 87;
+pub const SYS_reboot: ::c_long = 88;
+pub const SYS_munmap: ::c_long = 91;
+pub const SYS_truncate: ::c_long = 92;
+pub const SYS_ftruncate: ::c_long = 93;
+pub const SYS_fchmod: ::c_long = 94;
+pub const SYS_fchown: ::c_long = 95;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_setitimer: ::c_long = 104;
+pub const SYS_getitimer: ::c_long = 105;
+pub const SYS_stat: ::c_long = 106;
+pub const SYS_lstat: ::c_long = 107;
+pub const SYS_fstat: ::c_long = 108;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_fsync: ::c_long = 118;
+pub const SYS_sigreturn: ::c_long = 119;
+pub const SYS_clone: ::c_long = 120;
+pub const SYS_setdomainname: ::c_long = 121;
+pub const SYS_uname: ::c_long = 122;
+pub const SYS_adjtimex: ::c_long = 124;
+pub const SYS_mprotect: ::c_long = 125;
+pub const SYS_sigprocmask: ::c_long = 126;
+pub const SYS_init_module: ::c_long = 128;
+pub const SYS_delete_module: ::c_long = 129;
+pub const SYS_quotactl: ::c_long = 131;
+pub const SYS_getpgid: ::c_long = 132;
+pub const SYS_fchdir: ::c_long = 133;
+pub const SYS_bdflush: ::c_long = 134;
+pub const SYS_sysfs: ::c_long = 135;
+pub const SYS_personality: ::c_long = 136;
+pub const SYS_setfsuid: ::c_long = 138;
+pub const SYS_setfsgid: ::c_long = 139;
+pub const SYS__llseek: ::c_long = 140;
+pub const SYS_getdents: ::c_long = 141;
+pub const SYS__newselect: ::c_long = 142;
+pub const SYS_flock: ::c_long = 143;
+pub const SYS_msync: ::c_long = 144;
+pub const SYS_readv: ::c_long = 145;
+pub const SYS_writev: ::c_long = 146;
+pub const SYS_getsid: ::c_long = 147;
+pub const SYS_fdatasync: ::c_long = 148;
+pub const SYS__sysctl: ::c_long = 149;
+pub const SYS_mlock: ::c_long = 150;
+pub const SYS_munlock: ::c_long = 151;
+pub const SYS_mlockall: ::c_long = 152;
+pub const SYS_munlockall: ::c_long = 153;
+pub const SYS_sched_setparam: ::c_long = 154;
+pub const SYS_sched_getparam: ::c_long = 155;
+pub const SYS_sched_setscheduler: ::c_long = 156;
+pub const SYS_sched_getscheduler: ::c_long = 157;
+pub const SYS_sched_yield: ::c_long = 158;
+pub const SYS_sched_get_priority_max: ::c_long = 159;
+pub const SYS_sched_get_priority_min: ::c_long = 160;
+pub const SYS_sched_rr_get_interval: ::c_long = 161;
+pub const SYS_nanosleep: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_setresuid: ::c_long = 164;
+pub const SYS_getresuid: ::c_long = 165;
+pub const SYS_poll: ::c_long = 168;
+pub const SYS_nfsservctl: ::c_long = 169;
+pub const SYS_setresgid: ::c_long = 170;
+pub const SYS_getresgid: ::c_long = 171;
+pub const SYS_prctl: ::c_long = 172;
+pub const SYS_rt_sigreturn: ::c_long = 173;
+pub const SYS_rt_sigaction: ::c_long = 174;
+pub const SYS_rt_sigprocmask: ::c_long = 175;
+pub const SYS_rt_sigpending: ::c_long = 176;
+pub const SYS_rt_sigtimedwait: ::c_long = 177;
+pub const SYS_rt_sigqueueinfo: ::c_long = 178;
+pub const SYS_rt_sigsuspend: ::c_long = 179;
+pub const SYS_pread64: ::c_long = 180;
+pub const SYS_pwrite64: ::c_long = 181;
+pub const SYS_chown: ::c_long = 182;
+pub const SYS_getcwd: ::c_long = 183;
+pub const SYS_capget: ::c_long = 184;
+pub const SYS_capset: ::c_long = 185;
+pub const SYS_sigaltstack: ::c_long = 186;
+pub const SYS_sendfile: ::c_long = 187;
+pub const SYS_vfork: ::c_long = 190;
+pub const SYS_ugetrlimit: ::c_long = 191;
+pub const SYS_mmap2: ::c_long = 192;
+pub const SYS_truncate64: ::c_long = 193;
+pub const SYS_ftruncate64: ::c_long = 194;
+pub const SYS_stat64: ::c_long = 195;
+pub const SYS_lstat64: ::c_long = 196;
+pub const SYS_fstat64: ::c_long = 197;
+pub const SYS_lchown32: ::c_long = 198;
+pub const SYS_getuid32: ::c_long = 199;
+pub const SYS_getgid32: ::c_long = 200;
+pub const SYS_geteuid32: ::c_long = 201;
+pub const SYS_getegid32: ::c_long = 202;
+pub const SYS_setreuid32: ::c_long = 203;
+pub const SYS_setregid32: ::c_long = 204;
+pub const SYS_getgroups32: ::c_long = 205;
+pub const SYS_setgroups32: ::c_long = 206;
+pub const SYS_fchown32: ::c_long = 207;
+pub const SYS_setresuid32: ::c_long = 208;
+pub const SYS_getresuid32: ::c_long = 209;
+pub const SYS_setresgid32: ::c_long = 210;
+pub const SYS_getresgid32: ::c_long = 211;
+pub const SYS_chown32: ::c_long = 212;
+pub const SYS_setuid32: ::c_long = 213;
+pub const SYS_setgid32: ::c_long = 214;
+pub const SYS_setfsuid32: ::c_long = 215;
+pub const SYS_setfsgid32: ::c_long = 216;
+pub const SYS_getdents64: ::c_long = 217;
+pub const SYS_pivot_root: ::c_long = 218;
+pub const SYS_mincore: ::c_long = 219;
+pub const SYS_madvise: ::c_long = 220;
+pub const SYS_fcntl64: ::c_long = 221;
+pub const SYS_gettid: ::c_long = 224;
+pub const SYS_readahead: ::c_long = 225;
+pub const SYS_setxattr: ::c_long = 226;
+pub const SYS_lsetxattr: ::c_long = 227;
+pub const SYS_fsetxattr: ::c_long = 228;
+pub const SYS_getxattr: ::c_long = 229;
+pub const SYS_lgetxattr: ::c_long = 230;
+pub const SYS_fgetxattr: ::c_long = 231;
+pub const SYS_listxattr: ::c_long = 232;
+pub const SYS_llistxattr: ::c_long = 233;
+pub const SYS_flistxattr: ::c_long = 234;
+pub const SYS_removexattr: ::c_long = 235;
+pub const SYS_lremovexattr: ::c_long = 236;
+pub const SYS_fremovexattr: ::c_long = 237;
+pub const SYS_tkill: ::c_long = 238;
+pub const SYS_sendfile64: ::c_long = 239;
+pub const SYS_futex: ::c_long = 240;
+pub const SYS_sched_setaffinity: ::c_long = 241;
+pub const SYS_sched_getaffinity: ::c_long = 242;
+pub const SYS_io_setup: ::c_long = 243;
+pub const SYS_io_destroy: ::c_long = 244;
+pub const SYS_io_getevents: ::c_long = 245;
+pub const SYS_io_submit: ::c_long = 246;
+pub const SYS_io_cancel: ::c_long = 247;
+pub const SYS_exit_group: ::c_long = 248;
+pub const SYS_lookup_dcookie: ::c_long = 249;
+pub const SYS_epoll_create: ::c_long = 250;
+pub const SYS_epoll_ctl: ::c_long = 251;
+pub const SYS_epoll_wait: ::c_long = 252;
+pub const SYS_remap_file_pages: ::c_long = 253;
+pub const SYS_set_tid_address: ::c_long = 256;
+pub const SYS_timer_create: ::c_long = 257;
+pub const SYS_timer_settime: ::c_long = 258;
+pub const SYS_timer_gettime: ::c_long = 259;
+pub const SYS_timer_getoverrun: ::c_long = 260;
+pub const SYS_timer_delete: ::c_long = 261;
+pub const SYS_clock_settime: ::c_long = 262;
+pub const SYS_clock_gettime: ::c_long = 263;
+pub const SYS_clock_getres: ::c_long = 264;
+pub const SYS_clock_nanosleep: ::c_long = 265;
+pub const SYS_statfs64: ::c_long = 266;
+pub const SYS_fstatfs64: ::c_long = 267;
+pub const SYS_tgkill: ::c_long = 268;
+pub const SYS_utimes: ::c_long = 269;
+pub const SYS_pciconfig_iobase: ::c_long = 271;
+pub const SYS_pciconfig_read: ::c_long = 272;
+pub const SYS_pciconfig_write: ::c_long = 273;
+pub const SYS_mq_open: ::c_long = 274;
+pub const SYS_mq_unlink: ::c_long = 275;
+pub const SYS_mq_timedsend: ::c_long = 276;
+pub const SYS_mq_timedreceive: ::c_long = 277;
+pub const SYS_mq_notify: ::c_long = 278;
+pub const SYS_mq_getsetattr: ::c_long = 279;
+pub const SYS_waitid: ::c_long = 280;
+pub const SYS_socket: ::c_long = 281;
+pub const SYS_bind: ::c_long = 282;
+pub const SYS_connect: ::c_long = 283;
+pub const SYS_listen: ::c_long = 284;
+pub const SYS_accept: ::c_long = 285;
+pub const SYS_getsockname: ::c_long = 286;
+pub const SYS_getpeername: ::c_long = 287;
+pub const SYS_socketpair: ::c_long = 288;
+pub const SYS_send: ::c_long = 289;
+pub const SYS_sendto: ::c_long = 290;
+pub const SYS_recv: ::c_long = 291;
+pub const SYS_recvfrom: ::c_long = 292;
+pub const SYS_shutdown: ::c_long = 293;
+pub const SYS_setsockopt: ::c_long = 294;
+pub const SYS_getsockopt: ::c_long = 295;
+pub const SYS_sendmsg: ::c_long = 296;
+pub const SYS_recvmsg: ::c_long = 297;
+pub const SYS_semop: ::c_long = 298;
+pub const SYS_semget: ::c_long = 299;
+pub const SYS_semctl: ::c_long = 300;
+pub const SYS_msgsnd: ::c_long = 301;
+pub const SYS_msgrcv: ::c_long = 302;
+pub const SYS_msgget: ::c_long = 303;
+pub const SYS_msgctl: ::c_long = 304;
+pub const SYS_shmat: ::c_long = 305;
+pub const SYS_shmdt: ::c_long = 306;
+pub const SYS_shmget: ::c_long = 307;
+pub const SYS_shmctl: ::c_long = 308;
+pub const SYS_add_key: ::c_long = 309;
+pub const SYS_request_key: ::c_long = 310;
+pub const SYS_keyctl: ::c_long = 311;
+pub const SYS_semtimedop: ::c_long = 312;
+pub const SYS_vserver: ::c_long = 313;
+pub const SYS_ioprio_set: ::c_long = 314;
+pub const SYS_ioprio_get: ::c_long = 315;
+pub const SYS_inotify_init: ::c_long = 316;
+pub const SYS_inotify_add_watch: ::c_long = 317;
+pub const SYS_inotify_rm_watch: ::c_long = 318;
+pub const SYS_mbind: ::c_long = 319;
+pub const SYS_get_mempolicy: ::c_long = 320;
+pub const SYS_set_mempolicy: ::c_long = 321;
+pub const SYS_openat: ::c_long = 322;
+pub const SYS_mkdirat: ::c_long = 323;
+pub const SYS_mknodat: ::c_long = 324;
+pub const SYS_fchownat: ::c_long = 325;
+pub const SYS_futimesat: ::c_long = 326;
+pub const SYS_fstatat64: ::c_long = 327;
+pub const SYS_unlinkat: ::c_long = 328;
+pub const SYS_renameat: ::c_long = 329;
+pub const SYS_linkat: ::c_long = 330;
+pub const SYS_symlinkat: ::c_long = 331;
+pub const SYS_readlinkat: ::c_long = 332;
+pub const SYS_fchmodat: ::c_long = 333;
+pub const SYS_faccessat: ::c_long = 334;
+pub const SYS_pselect6: ::c_long = 335;
+pub const SYS_ppoll: ::c_long = 336;
+pub const SYS_unshare: ::c_long = 337;
+pub const SYS_set_robust_list: ::c_long = 338;
+pub const SYS_get_robust_list: ::c_long = 339;
+pub const SYS_splice: ::c_long = 340;
+pub const SYS_tee: ::c_long = 342;
+pub const SYS_vmsplice: ::c_long = 343;
+pub const SYS_move_pages: ::c_long = 344;
+pub const SYS_getcpu: ::c_long = 345;
+pub const SYS_epoll_pwait: ::c_long = 346;
+pub const SYS_kexec_load: ::c_long = 347;
+pub const SYS_utimensat: ::c_long = 348;
+pub const SYS_signalfd: ::c_long = 349;
+pub const SYS_timerfd_create: ::c_long = 350;
+pub const SYS_eventfd: ::c_long = 351;
+pub const SYS_fallocate: ::c_long = 352;
+pub const SYS_timerfd_settime: ::c_long = 353;
+pub const SYS_timerfd_gettime: ::c_long = 354;
+pub const SYS_signalfd4: ::c_long = 355;
+pub const SYS_eventfd2: ::c_long = 356;
+pub const SYS_epoll_create1: ::c_long = 357;
+pub const SYS_dup3: ::c_long = 358;
+pub const SYS_pipe2: ::c_long = 359;
+pub const SYS_inotify_init1: ::c_long = 360;
+pub const SYS_preadv: ::c_long = 361;
+pub const SYS_pwritev: ::c_long = 362;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 363;
+pub const SYS_perf_event_open: ::c_long = 364;
+pub const SYS_recvmmsg: ::c_long = 365;
+pub const SYS_accept4: ::c_long = 366;
+pub const SYS_fanotify_init: ::c_long = 367;
+pub const SYS_fanotify_mark: ::c_long = 368;
+pub const SYS_prlimit64: ::c_long = 369;
+pub const SYS_name_to_handle_at: ::c_long = 370;
+pub const SYS_open_by_handle_at: ::c_long = 371;
+pub const SYS_clock_adjtime: ::c_long = 372;
+pub const SYS_syncfs: ::c_long = 373;
+pub const SYS_sendmmsg: ::c_long = 374;
+pub const SYS_setns: ::c_long = 375;
+pub const SYS_process_vm_readv: ::c_long = 376;
+pub const SYS_process_vm_writev: ::c_long = 377;
+pub const SYS_kcmp: ::c_long = 378;
+pub const SYS_finit_module: ::c_long = 379;
+pub const SYS_sched_setattr: ::c_long = 380;
+pub const SYS_sched_getattr: ::c_long = 381;
+pub const SYS_renameat2: ::c_long = 382;
+pub const SYS_seccomp: ::c_long = 383;
+pub const SYS_getrandom: ::c_long = 384;
+pub const SYS_memfd_create: ::c_long = 385;
+pub const SYS_bpf: ::c_long = 386;
+pub const SYS_execveat: ::c_long = 387;
+pub const SYS_userfaultfd: ::c_long = 388;
+pub const SYS_membarrier: ::c_long = 389;
+pub const SYS_mlock2: ::c_long = 390;
+pub const SYS_copy_file_range: ::c_long = 391;
+pub const SYS_preadv2: ::c_long = 392;
+pub const SYS_pwritev2: ::c_long = 393;
+pub const SYS_pkey_mprotect: ::c_long = 394;
+pub const SYS_pkey_alloc: ::c_long = 395;
+pub const SYS_pkey_free: ::c_long = 396;
+pub const SYS_statx: ::c_long = 397;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+extern "C" {
+    pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/hexagon.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/hexagon.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/hexagon.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/hexagon.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,667 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
+pub type stat64 = ::stat;
+
+s! {
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::c_ulonglong,
+        pub st_mode: ::c_uint,
+        pub st_nlink: ::c_uint,
+        pub st_uid: ::c_uint,
+        pub st_gid: ::c_uint,
+        pub st_rdev: ::c_ulonglong,
+        __st_rdev_padding: ::c_ulong,
+        pub st_size: ::c_longlong,
+        pub st_blksize: ::blksize_t,
+        __st_blksize_padding: ::c_int,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+
+        __unused: [::c_int;2],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t
+    }
+
+    pub struct ipc_perm {
+        pub __ipc_perm_key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_ushort,
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        __unused1: ::c_int,
+        pub shm_dtime: ::time_t,
+        __unused2: ::c_int,
+        pub shm_ctime: ::time_t,
+        __unused3: ::c_int,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::c_ulong,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __unused1: ::c_int,
+        pub msg_rtime: ::time_t,
+        __unused2: ::c_int,
+        pub msg_ctime: ::time_t,
+        __unused3: ::c_int,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 4],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        pub _pad: [::c_int; 29],
+        _align: [usize; 0],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 4],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        __f_unused: ::c_int,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+}
+
+pub const AF_FILE: ::c_int = 1;
+pub const AF_KCM: ::c_int = 41;
+pub const AF_MAX: ::c_int = 43;
+pub const AF_QIPCRTR: ::c_int = 42;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EALREADY: ::c_int = 114;
+pub const EBADE: ::c_int = 52;
+pub const EBADMSG: ::c_int = 74;
+pub const EBADR: ::c_int = 53;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const ECANCELED: ::c_int = 125;
+pub const ECHRNG: ::c_int = 44;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const ECONNRESET: ::c_int = 104;
+pub const EDEADLK: ::c_int = 35;
+pub const EDEADLOCK: ::c_int = 35;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EDQUOT: ::c_int = 122;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EHWPOISON: ::c_int = 133;
+pub const EIDRM: ::c_int = 43;
+pub const EILSEQ: ::c_int = 84;
+pub const EINPROGRESS: ::c_int = 115;
+pub const EISCONN: ::c_int = 106;
+pub const EISNAM: ::c_int = 120;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EL2HLT: ::c_int = 51;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBEXEC: ::c_int = 83;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELNRNG: ::c_int = 48;
+pub const ELOOP: ::c_int = 40;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EMULTIHOP: ::c_int = 72;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENAVAIL: ::c_int = 119;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETRESET: ::c_int = 102;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENOANO: ::c_int = 55;
+pub const ENOBUFS: ::c_int = 105;
+pub const ENOCSI: ::c_int = 50;
+pub const ENOKEY: ::c_int = 126;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const ENOMSG: ::c_int = 42;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTCONN: ::c_int = 107;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const ENOTSOCK: ::c_int = 88;
+pub const ENOTSUP: ::c_int = 95;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const EOVERFLOW: ::c_int = 75;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EREMCHG: ::c_int = 78;
+pub const ERESTART: ::c_int = 85;
+pub const ERFKILL: ::c_int = 132;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const ESTALE: ::c_int = 116;
+pub const ESTRPIPE: ::c_int = 86;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const EUCLEAN: ::c_int = 117;
+pub const EUNATCH: ::c_int = 49;
+pub const EUSERS: ::c_int = 87;
+pub const EXFULL: ::c_int = 54;
+pub const EXTPROC: ::c_int = 65536;
+pub const F_EXLCK: ::c_int = 4;
+pub const F_GETLK: ::c_int = 12;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_GETOWNER_UIDS: ::c_int = 17;
+pub const F_GETOWN_EX: ::c_int = 16;
+pub const F_GETSIG: ::c_int = 11;
+pub const F_LINUX_SPECIFIC_BASE: ::c_int = 1024;
+pub const FLUSHO: ::c_int = 4096;
+pub const F_OWNER_PGRP: ::c_int = 2;
+pub const F_OWNER_PID: ::c_int = 1;
+pub const F_OWNER_TID: ::c_int = 0;
+pub const F_SETLK: ::c_int = 13;
+pub const F_SETLKW: ::c_int = 14;
+pub const F_SETOWN: ::c_int = 8;
+pub const F_SETOWN_EX: ::c_int = 15;
+pub const F_SETSIG: ::c_int = 10;
+pub const F_SHLCK: ::c_int = 8;
+pub const IEXTEN: ::c_int = 32768;
+pub const MAP_ANON: ::c_int = 32;
+pub const MAP_DENYWRITE: ::c_int = 2048;
+pub const MAP_EXECUTABLE: ::c_int = 4096;
+pub const MAP_GROWSDOWN: ::c_int = 256;
+pub const MAP_HUGETLB: ::c_int = 262144;
+pub const MAP_LOCKED: ::c_int = 8192;
+pub const MAP_NONBLOCK: ::c_int = 65536;
+pub const MAP_NORESERVE: ::c_int = 16384;
+pub const MAP_POPULATE: ::c_int = 32768;
+pub const MAP_STACK: ::c_int = 131072;
+pub const MAP_UNINITIALIZED: ::c_int = 0;
+pub const O_APPEND: ::c_int = 1024;
+pub const O_ASYNC: ::c_int = 8192;
+pub const O_CREAT: ::c_int = 64;
+pub const O_DIRECT: ::c_int = 16384;
+pub const O_DIRECTORY: ::c_int = 65536;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_EXCL: ::c_int = 128;
+pub const O_LARGEFILE: ::c_int = 32768;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NOFOLLOW: ::c_int = 131072;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const PF_FILE: ::c_int = 1;
+pub const PF_KCM: ::c_int = 41;
+pub const PF_MAX: ::c_int = 43;
+pub const PF_QIPCRTR: ::c_int = 42;
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGIO: ::c_int = 29;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGPWR: ::c_int = 30;
+pub const SIGSTKFLT: ::c_int = 16;
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGURG: ::c_int = 23;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIG_SETMASK: ::c_int = 2; // FIXME check these
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+pub const SOCK_DGRAM: ::c_int = 2;
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOL_CAIF: ::c_int = 278;
+pub const SOL_IUCV: ::c_int = 277;
+pub const SOL_KCM: ::c_int = 281;
+pub const SOL_NFC: ::c_int = 280;
+pub const SOL_PNPIPE: ::c_int = 275;
+pub const SOL_PPPOL2TP: ::c_int = 273;
+pub const SOL_RDS: ::c_int = 276;
+pub const SOL_RXRPC: ::c_int = 272;
+
+pub const SYS3264_fadvise64: ::c_int = 223;
+pub const SYS3264_fcntl: ::c_int = 25;
+pub const SYS3264_fstatat: ::c_int = 79;
+pub const SYS3264_fstat: ::c_int = 80;
+pub const SYS3264_fstatfs: ::c_int = 44;
+pub const SYS3264_ftruncate: ::c_int = 46;
+pub const SYS3264_lseek: ::c_int = 62;
+pub const SYS3264_lstat: ::c_int = 1039;
+pub const SYS3264_mmap: ::c_int = 222;
+pub const SYS3264_sendfile: ::c_int = 71;
+pub const SYS3264_stat: ::c_int = 1038;
+pub const SYS3264_statfs: ::c_int = 43;
+pub const SYS3264_truncate: ::c_int = 45;
+pub const SYS_accept4: ::c_int = 242;
+pub const SYS_accept: ::c_int = 202;
+pub const SYS_access: ::c_int = 1033;
+pub const SYS_acct: ::c_int = 89;
+pub const SYS_add_key: ::c_int = 217;
+pub const SYS_adjtimex: ::c_int = 171;
+pub const SYS_alarm: ::c_int = 1059;
+pub const SYS_arch_specific_syscall: ::c_int = 244;
+pub const SYS_bdflush: ::c_int = 1075;
+pub const SYS_bind: ::c_int = 200;
+pub const SYS_bpf: ::c_int = 280;
+pub const SYS_brk: ::c_int = 214;
+pub const SYS_capget: ::c_int = 90;
+pub const SYS_capset: ::c_int = 91;
+pub const SYS_chdir: ::c_int = 49;
+pub const SYS_chmod: ::c_int = 1028;
+pub const SYS_chown: ::c_int = 1029;
+pub const SYS_chroot: ::c_int = 51;
+pub const SYS_clock_adjtime: ::c_int = 266;
+pub const SYS_clock_getres: ::c_int = 114;
+pub const SYS_clock_gettime: ::c_int = 113;
+pub const SYS_clock_nanosleep: ::c_int = 115;
+pub const SYS_clock_settime: ::c_int = 112;
+pub const SYS_clone: ::c_int = 220;
+pub const SYS_close: ::c_int = 57;
+pub const SYS_connect: ::c_int = 203;
+pub const SYS_copy_file_range: ::c_int = -1; // FIXME
+pub const SYS_creat: ::c_int = 1064;
+pub const SYS_delete_module: ::c_int = 106;
+pub const SYS_dup2: ::c_int = 1041;
+pub const SYS_dup3: ::c_int = 24;
+pub const SYS_dup: ::c_int = 23;
+pub const SYS_epoll_create1: ::c_int = 20;
+pub const SYS_epoll_create: ::c_int = 1042;
+pub const SYS_epoll_ctl: ::c_int = 21;
+pub const SYS_epoll_pwait: ::c_int = 22;
+pub const SYS_epoll_wait: ::c_int = 1069;
+pub const SYS_eventfd2: ::c_int = 19;
+pub const SYS_eventfd: ::c_int = 1044;
+pub const SYS_execveat: ::c_int = 281;
+pub const SYS_execve: ::c_int = 221;
+pub const SYS_exit: ::c_int = 93;
+pub const SYS_exit_group: ::c_int = 94;
+pub const SYS_faccessat: ::c_int = 48;
+pub const SYS_fadvise64_64: ::c_int = 223;
+pub const SYS_fallocate: ::c_int = 47;
+pub const SYS_fanotify_init: ::c_int = 262;
+pub const SYS_fanotify_mark: ::c_int = 263;
+pub const SYS_fchdir: ::c_int = 50;
+pub const SYS_fchmodat: ::c_int = 53;
+pub const SYS_fchmod: ::c_int = 52;
+pub const SYS_fchownat: ::c_int = 54;
+pub const SYS_fchown: ::c_int = 55;
+pub const SYS_fcntl64: ::c_int = 25;
+pub const SYS_fcntl: ::c_int = 25;
+pub const SYS_fdatasync: ::c_int = 83;
+pub const SYS_fgetxattr: ::c_int = 10;
+pub const SYS_finit_module: ::c_int = 273;
+pub const SYS_flistxattr: ::c_int = 13;
+pub const SYS_flock: ::c_int = 32;
+pub const SYS_fork: ::c_int = 1079;
+pub const SYS_fremovexattr: ::c_int = 16;
+pub const SYS_fsetxattr: ::c_int = 7;
+pub const SYS_fstat64: ::c_int = 80;
+pub const SYS_fstatat64: ::c_int = 79;
+pub const SYS_fstatfs64: ::c_int = 44;
+pub const SYS_fstatfs: ::c_int = 44;
+pub const SYS_fsync: ::c_int = 82;
+pub const SYS_ftruncate64: ::c_int = 46;
+pub const SYS_ftruncate: ::c_int = 46;
+pub const SYS_futex: ::c_int = 98;
+pub const SYS_futimesat: ::c_int = 1066;
+pub const SYS_getcpu: ::c_int = 168;
+pub const SYS_getcwd: ::c_int = 17;
+pub const SYS_getdents64: ::c_int = 61;
+pub const SYS_getdents: ::c_int = 1065;
+pub const SYS_getegid: ::c_int = 177;
+pub const SYS_geteuid: ::c_int = 175;
+pub const SYS_getgid: ::c_int = 176;
+pub const SYS_getgroups: ::c_int = 158;
+pub const SYS_getitimer: ::c_int = 102;
+pub const SYS_get_mempolicy: ::c_int = 236;
+pub const SYS_getpeername: ::c_int = 205;
+pub const SYS_getpgid: ::c_int = 155;
+pub const SYS_getpgrp: ::c_int = 1060;
+pub const SYS_getpid: ::c_int = 172;
+pub const SYS_getppid: ::c_int = 173;
+pub const SYS_getpriority: ::c_int = 141;
+pub const SYS_getrandom: ::c_int = 278;
+pub const SYS_getresgid: ::c_int = 150;
+pub const SYS_getresuid: ::c_int = 148;
+pub const SYS_getrlimit: ::c_int = 163;
+pub const SYS_get_robust_list: ::c_int = 100;
+pub const SYS_getrusage: ::c_int = 165;
+pub const SYS_getsid: ::c_int = 156;
+pub const SYS_getsockname: ::c_int = 204;
+pub const SYS_getsockopt: ::c_int = 209;
+pub const SYS_gettid: ::c_int = 178;
+pub const SYS_gettimeofday: ::c_int = 169;
+pub const SYS_getuid: ::c_int = 174;
+pub const SYS_getxattr: ::c_int = 8;
+pub const SYS_init_module: ::c_int = 105;
+pub const SYS_inotify_add_watch: ::c_int = 27;
+pub const SYS_inotify_init1: ::c_int = 26;
+pub const SYS_inotify_init: ::c_int = 1043;
+pub const SYS_inotify_rm_watch: ::c_int = 28;
+pub const SYS_io_cancel: ::c_int = 3;
+pub const SYS_ioctl: ::c_int = 29;
+pub const SYS_io_destroy: ::c_int = 1;
+pub const SYS_io_getevents: ::c_int = 4;
+pub const SYS_ioprio_get: ::c_int = 31;
+pub const SYS_ioprio_set: ::c_int = 30;
+pub const SYS_io_setup: ::c_int = 0;
+pub const SYS_io_submit: ::c_int = 2;
+pub const SYS_kcmp: ::c_int = 272;
+pub const SYS_kexec_load: ::c_int = 104;
+pub const SYS_keyctl: ::c_int = 219;
+pub const SYS_kill: ::c_int = 129;
+pub const SYS_lchown: ::c_int = 1032;
+pub const SYS_lgetxattr: ::c_int = 9;
+pub const SYS_linkat: ::c_int = 37;
+pub const SYS_link: ::c_int = 1025;
+pub const SYS_listen: ::c_int = 201;
+pub const SYS_listxattr: ::c_int = 11;
+pub const SYS_llistxattr: ::c_int = 12;
+pub const SYS__llseek: ::c_int = 62;
+pub const SYS_lookup_dcookie: ::c_int = 18;
+pub const SYS_lremovexattr: ::c_int = 15;
+pub const SYS_lseek: ::c_int = 62;
+pub const SYS_lsetxattr: ::c_int = 6;
+pub const SYS_lstat64: ::c_int = 1039;
+pub const SYS_lstat: ::c_int = 1039;
+pub const SYS_madvise: ::c_int = 233;
+pub const SYS_mbind: ::c_int = 235;
+pub const SYS_memfd_create: ::c_int = 279;
+pub const SYS_migrate_pages: ::c_int = 238;
+pub const SYS_mincore: ::c_int = 232;
+pub const SYS_mkdirat: ::c_int = 34;
+pub const SYS_mkdir: ::c_int = 1030;
+pub const SYS_mknodat: ::c_int = 33;
+pub const SYS_mknod: ::c_int = 1027;
+pub const SYS_mlockall: ::c_int = 230;
+pub const SYS_mlock: ::c_int = 228;
+pub const SYS_mmap2: ::c_int = 222;
+pub const SYS_mount: ::c_int = 40;
+pub const SYS_move_pages: ::c_int = 239;
+pub const SYS_mprotect: ::c_int = 226;
+pub const SYS_mq_getsetattr: ::c_int = 185;
+pub const SYS_mq_notify: ::c_int = 184;
+pub const SYS_mq_open: ::c_int = 180;
+pub const SYS_mq_timedreceive: ::c_int = 183;
+pub const SYS_mq_timedsend: ::c_int = 182;
+pub const SYS_mq_unlink: ::c_int = 181;
+pub const SYS_mremap: ::c_int = 216;
+pub const SYS_msgctl: ::c_int = 187;
+pub const SYS_msgget: ::c_int = 186;
+pub const SYS_msgrcv: ::c_int = 188;
+pub const SYS_msgsnd: ::c_int = 189;
+pub const SYS_msync: ::c_int = 227;
+pub const SYS_munlockall: ::c_int = 231;
+pub const SYS_munlock: ::c_int = 229;
+pub const SYS_munmap: ::c_int = 215;
+pub const SYS_name_to_handle_at: ::c_int = 264;
+pub const SYS_nanosleep: ::c_int = 101;
+pub const SYS_newfstatat: ::c_int = 79;
+pub const SYS_nfsservctl: ::c_int = 42;
+pub const SYS_oldwait4: ::c_int = 1072;
+pub const SYS_openat: ::c_int = 56;
+pub const SYS_open_by_handle_at: ::c_int = 265;
+pub const SYS_open: ::c_int = 1024;
+pub const SYS_pause: ::c_int = 1061;
+pub const SYS_perf_event_open: ::c_int = 241;
+pub const SYS_personality: ::c_int = 92;
+pub const SYS_pipe2: ::c_int = 59;
+pub const SYS_pipe: ::c_int = 1040;
+pub const SYS_pivot_root: ::c_int = 41;
+pub const SYS_poll: ::c_int = 1068;
+pub const SYS_ppoll: ::c_int = 73;
+pub const SYS_prctl: ::c_int = 167;
+pub const SYS_pread64: ::c_int = 67;
+pub const SYS_preadv: ::c_int = 69;
+pub const SYS_prlimit64: ::c_int = 261;
+pub const SYS_process_vm_readv: ::c_int = 270;
+pub const SYS_process_vm_writev: ::c_int = 271;
+pub const SYS_pselect6: ::c_int = 72;
+pub const SYS_ptrace: ::c_int = 117;
+pub const SYS_pwrite64: ::c_int = 68;
+pub const SYS_pwritev: ::c_int = 70;
+pub const SYS_quotactl: ::c_int = 60;
+pub const SYS_readahead: ::c_int = 213;
+pub const SYS_read: ::c_int = 63;
+pub const SYS_readlinkat: ::c_int = 78;
+pub const SYS_readlink: ::c_int = 1035;
+pub const SYS_readv: ::c_int = 65;
+pub const SYS_reboot: ::c_int = 142;
+pub const SYS_recv: ::c_int = 1073;
+pub const SYS_recvfrom: ::c_int = 207;
+pub const SYS_recvmmsg: ::c_int = 243;
+pub const SYS_recvmsg: ::c_int = 212;
+pub const SYS_remap_file_pages: ::c_int = 234;
+pub const SYS_removexattr: ::c_int = 14;
+pub const SYS_renameat2: ::c_int = 276;
+pub const SYS_renameat: ::c_int = 38;
+pub const SYS_rename: ::c_int = 1034;
+pub const SYS_request_key: ::c_int = 218;
+pub const SYS_restart_syscall: ::c_int = 128;
+pub const SYS_rmdir: ::c_int = 1031;
+pub const SYS_rt_sigaction: ::c_int = 134;
+pub const SYS_rt_sigpending: ::c_int = 136;
+pub const SYS_rt_sigprocmask: ::c_int = 135;
+pub const SYS_rt_sigqueueinfo: ::c_int = 138;
+pub const SYS_rt_sigreturn: ::c_int = 139;
+pub const SYS_rt_sigsuspend: ::c_int = 133;
+pub const SYS_rt_sigtimedwait: ::c_int = 137;
+pub const SYS_rt_tgsigqueueinfo: ::c_int = 240;
+pub const SYS_sched_getaffinity: ::c_int = 123;
+pub const SYS_sched_getattr: ::c_int = 275;
+pub const SYS_sched_getparam: ::c_int = 121;
+pub const SYS_sched_get_priority_max: ::c_int = 125;
+pub const SYS_sched_get_priority_min: ::c_int = 126;
+pub const SYS_sched_getscheduler: ::c_int = 120;
+pub const SYS_sched_rr_get_interval: ::c_int = 127;
+pub const SYS_sched_setaffinity: ::c_int = 122;
+pub const SYS_sched_setattr: ::c_int = 274;
+pub const SYS_sched_setparam: ::c_int = 118;
+pub const SYS_sched_setscheduler: ::c_int = 119;
+pub const SYS_sched_yield: ::c_int = 124;
+pub const SYS_seccomp: ::c_int = 277;
+pub const SYS_select: ::c_int = 1067;
+pub const SYS_semctl: ::c_int = 191;
+pub const SYS_semget: ::c_int = 190;
+pub const SYS_semop: ::c_int = 193;
+pub const SYS_semtimedop: ::c_int = 192;
+pub const SYS_send: ::c_int = 1074;
+pub const SYS_sendfile64: ::c_int = 71;
+pub const SYS_sendfile: ::c_int = 71;
+pub const SYS_sendmmsg: ::c_int = 269;
+pub const SYS_sendmsg: ::c_int = 211;
+pub const SYS_sendto: ::c_int = 206;
+pub const SYS_setdomainname: ::c_int = 162;
+pub const SYS_setfsgid: ::c_int = 152;
+pub const SYS_setfsuid: ::c_int = 151;
+pub const SYS_setgid: ::c_int = 144;
+pub const SYS_setgroups: ::c_int = 159;
+pub const SYS_sethostname: ::c_int = 161;
+pub const SYS_setitimer: ::c_int = 103;
+pub const SYS_set_mempolicy: ::c_int = 237;
+pub const SYS_setns: ::c_int = 268;
+pub const SYS_setpgid: ::c_int = 154;
+pub const SYS_setpriority: ::c_int = 140;
+pub const SYS_setregid: ::c_int = 143;
+pub const SYS_setresgid: ::c_int = 149;
+pub const SYS_setresuid: ::c_int = 147;
+pub const SYS_setreuid: ::c_int = 145;
+pub const SYS_setrlimit: ::c_int = 164;
+pub const SYS_set_robust_list: ::c_int = 99;
+pub const SYS_setsid: ::c_int = 157;
+pub const SYS_setsockopt: ::c_int = 208;
+pub const SYS_set_tid_address: ::c_int = 96;
+pub const SYS_settimeofday: ::c_int = 170;
+pub const SYS_setuid: ::c_int = 146;
+pub const SYS_setxattr: ::c_int = 5;
+pub const SYS_shmat: ::c_int = 196;
+pub const SYS_shmctl: ::c_int = 195;
+pub const SYS_shmdt: ::c_int = 197;
+pub const SYS_shmget: ::c_int = 194;
+pub const SYS_shutdown: ::c_int = 210;
+pub const SYS_sigaltstack: ::c_int = 132;
+pub const SYS_signalfd4: ::c_int = 74;
+pub const SYS_signalfd: ::c_int = 1045;
+pub const SYS_socket: ::c_int = 198;
+pub const SYS_socketpair: ::c_int = 199;
+pub const SYS_splice: ::c_int = 76;
+pub const SYS_stat64: ::c_int = 1038;
+pub const SYS_stat: ::c_int = 1038;
+pub const SYS_statfs64: ::c_int = 43;
+pub const SYS_swapoff: ::c_int = 225;
+pub const SYS_swapon: ::c_int = 224;
+pub const SYS_symlinkat: ::c_int = 36;
+pub const SYS_symlink: ::c_int = 1036;
+pub const SYS_sync: ::c_int = 81;
+pub const SYS_sync_file_range2: ::c_int = 84;
+pub const SYS_sync_file_range: ::c_int = 84;
+pub const SYS_syncfs: ::c_int = 267;
+pub const SYS_syscalls: ::c_int = 1080;
+pub const SYS__sysctl: ::c_int = 1078;
+pub const SYS_sysinfo: ::c_int = 179;
+pub const SYS_syslog: ::c_int = 116;
+pub const SYS_tee: ::c_int = 77;
+pub const SYS_tgkill: ::c_int = 131;
+pub const SYS_time: ::c_int = 1062;
+pub const SYS_timer_create: ::c_int = 107;
+pub const SYS_timer_delete: ::c_int = 111;
+pub const SYS_timerfd_create: ::c_int = 85;
+pub const SYS_timerfd_gettime: ::c_int = 87;
+pub const SYS_timerfd_settime: ::c_int = 86;
+pub const SYS_timer_getoverrun: ::c_int = 109;
+pub const SYS_timer_gettime: ::c_int = 108;
+pub const SYS_timer_settime: ::c_int = 110;
+pub const SYS_times: ::c_int = 153;
+pub const SYS_tkill: ::c_int = 130;
+pub const SYS_truncate64: ::c_int = 45;
+pub const SYS_truncate: ::c_int = 45;
+pub const SYS_umask: ::c_int = 166;
+pub const SYS_umount2: ::c_int = 39;
+pub const SYS_umount: ::c_int = 1076;
+pub const SYS_uname: ::c_int = 160;
+pub const SYS_unlinkat: ::c_int = 35;
+pub const SYS_unlink: ::c_int = 1026;
+pub const SYS_unshare: ::c_int = 97;
+pub const SYS_uselib: ::c_int = 1077;
+pub const SYS_ustat: ::c_int = 1070;
+pub const SYS_utime: ::c_int = 1063;
+pub const SYS_utimensat: ::c_int = 88;
+pub const SYS_utimes: ::c_int = 1037;
+pub const SYS_vfork: ::c_int = 1071;
+pub const SYS_vhangup: ::c_int = 58;
+pub const SYS_vmsplice: ::c_int = 75;
+pub const SYS_wait4: ::c_int = 260;
+pub const SYS_waitid: ::c_int = 95;
+pub const SYS_write: ::c_int = 64;
+pub const SYS_writev: ::c_int = 66;
+pub const SYS_statx: ::c_int = 291;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const TIOCM_LOOP: ::c_int = 32768;
+pub const TIOCM_OUT1: ::c_int = 8192;
+pub const TIOCM_OUT2: ::c_int = 16384;
+pub const TIOCSER_TEMT: ::c_int = 1;
+pub const TOSTOP: ::c_int = 256;
+pub const VEOF: ::c_int = 4;
+pub const VEOL2: ::c_int = 16;
+pub const VEOL: ::c_int = 11;
+pub const VMIN: ::c_int = 6;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/mips/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/mips/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/mips/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/mips/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(8))]
+    pub struct max_align_t {
+        priv_: [f32; 4]
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/mips/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/mips/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/mips/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/mips/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,788 @@
+pub type c_char = i8;
+pub type wchar_t = ::c_int;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        __st_padding1: [::c_long; 2],
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __st_padding2: [::c_long; 2],
+        pub st_size: ::off_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_blksize: ::blksize_t,
+        __st_padding3: ::c_long,
+        pub st_blocks: ::blkcnt_t,
+        __st_padding4: [::c_long; 14],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        __st_padding1: [::c_long; 2],
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __st_padding2: [::c_long; 2],
+        pub st_size: ::off_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_blksize: ::blksize_t,
+        __st_padding3: ::c_long,
+        pub st_blocks: ::blkcnt64_t,
+        __st_padding4: [::c_long; 14],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_size: ::size_t,
+        pub ss_flags: ::c_int,
+    }
+
+    pub struct ipc_perm {
+        pub __ipc_perm_key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_int,
+        __unused1: ::c_long,
+        __unused2: ::c_long
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::c_ulong,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        #[cfg(target_endian = "big")]
+        __unused1: ::c_int,
+        pub msg_stime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __unused1: ::c_int,
+        #[cfg(target_endian = "big")]
+        __unused2: ::c_int,
+        pub msg_rtime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __unused2: ::c_int,
+        #[cfg(target_endian = "big")]
+        __unused3: ::c_int,
+        pub msg_ctime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __unused3: ::c_int,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 5],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_code: ::c_int,
+        pub si_errno: ::c_int,
+        pub _pad: [::c_int; 29],
+        _align: [usize; 0],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 5],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        #[cfg(target_endian = "little")]
+        pub f_fsid: ::c_ulong,
+        __f_unused: ::c_int,
+        #[cfg(target_endian = "big")]
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+}
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+
+pub const O_DIRECT: ::c_int = 0o100000;
+pub const O_DIRECTORY: ::c_int = 0o200000;
+pub const O_NOFOLLOW: ::c_int = 0o400000;
+pub const O_ASYNC: ::c_int = 0o10000;
+pub const O_LARGEFILE: ::c_int = 0x2000;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::c_int = 0x00000800;
+pub const TAB2: ::c_int = 0x00001000;
+pub const TAB3: ::c_int = 0x00001800;
+pub const CR1: ::c_int = 0x00000200;
+pub const CR2: ::c_int = 0x00000400;
+pub const CR3: ::c_int = 0x00000600;
+pub const FF1: ::c_int = 0x00008000;
+pub const BS1: ::c_int = 0x00002000;
+pub const VT1: ::c_int = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const O_APPEND: ::c_int = 0o010;
+pub const O_CREAT: ::c_int = 0o400;
+pub const O_EXCL: ::c_int = 0o2000;
+pub const O_NOCTTY: ::c_int = 0o4000;
+pub const O_NONBLOCK: ::c_int = 0o200;
+pub const O_SYNC: ::c_int = 0o40020;
+pub const O_RSYNC: ::c_int = 0o40020;
+pub const O_DSYNC: ::c_int = 0o020;
+
+pub const MAP_ANON: ::c_int = 0x800;
+pub const MAP_GROWSDOWN: ::c_int = 0x1000;
+pub const MAP_DENYWRITE: ::c_int = 0x2000;
+pub const MAP_EXECUTABLE: ::c_int = 0x4000;
+pub const MAP_LOCKED: ::c_int = 0x8000;
+pub const MAP_NORESERVE: ::c_int = 0x0400;
+pub const MAP_POPULATE: ::c_int = 0x10000;
+pub const MAP_NONBLOCK: ::c_int = 0x20000;
+pub const MAP_STACK: ::c_int = 0x40000;
+pub const MAP_HUGETLB: ::c_int = 0x80000;
+
+pub const EDEADLK: ::c_int = 45;
+pub const ENAMETOOLONG: ::c_int = 78;
+pub const ENOLCK: ::c_int = 46;
+pub const ENOSYS: ::c_int = 89;
+pub const ENOTEMPTY: ::c_int = 93;
+pub const ELOOP: ::c_int = 90;
+pub const ENOMSG: ::c_int = 35;
+pub const EIDRM: ::c_int = 36;
+pub const ECHRNG: ::c_int = 37;
+pub const EL2NSYNC: ::c_int = 38;
+pub const EL3HLT: ::c_int = 39;
+pub const EL3RST: ::c_int = 40;
+pub const ELNRNG: ::c_int = 41;
+pub const EUNATCH: ::c_int = 42;
+pub const ENOCSI: ::c_int = 43;
+pub const EL2HLT: ::c_int = 44;
+pub const EBADE: ::c_int = 50;
+pub const EBADR: ::c_int = 51;
+pub const EXFULL: ::c_int = 52;
+pub const ENOANO: ::c_int = 53;
+pub const EBADRQC: ::c_int = 54;
+pub const EBADSLT: ::c_int = 55;
+pub const EDEADLOCK: ::c_int = 56;
+pub const EMULTIHOP: ::c_int = 74;
+pub const EOVERFLOW: ::c_int = 79;
+pub const ENOTUNIQ: ::c_int = 80;
+pub const EBADFD: ::c_int = 81;
+pub const EBADMSG: ::c_int = 77;
+pub const EREMCHG: ::c_int = 82;
+pub const ELIBACC: ::c_int = 83;
+pub const ELIBBAD: ::c_int = 84;
+pub const ELIBSCN: ::c_int = 85;
+pub const ELIBMAX: ::c_int = 86;
+pub const ELIBEXEC: ::c_int = 87;
+pub const EILSEQ: ::c_int = 88;
+pub const ERESTART: ::c_int = 91;
+pub const ESTRPIPE: ::c_int = 92;
+pub const EUSERS: ::c_int = 94;
+pub const ENOTSOCK: ::c_int = 95;
+pub const EDESTADDRREQ: ::c_int = 96;
+pub const EMSGSIZE: ::c_int = 97;
+pub const EPROTOTYPE: ::c_int = 98;
+pub const ENOPROTOOPT: ::c_int = 99;
+pub const EPROTONOSUPPORT: ::c_int = 120;
+pub const ESOCKTNOSUPPORT: ::c_int = 121;
+pub const EOPNOTSUPP: ::c_int = 122;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 123;
+pub const EAFNOSUPPORT: ::c_int = 124;
+pub const EADDRINUSE: ::c_int = 125;
+pub const EADDRNOTAVAIL: ::c_int = 126;
+pub const ENETDOWN: ::c_int = 127;
+pub const ENETUNREACH: ::c_int = 128;
+pub const ENETRESET: ::c_int = 129;
+pub const ECONNABORTED: ::c_int = 130;
+pub const ECONNRESET: ::c_int = 131;
+pub const ENOBUFS: ::c_int = 132;
+pub const EISCONN: ::c_int = 133;
+pub const ENOTCONN: ::c_int = 134;
+pub const ESHUTDOWN: ::c_int = 143;
+pub const ETOOMANYREFS: ::c_int = 144;
+pub const ETIMEDOUT: ::c_int = 145;
+pub const ECONNREFUSED: ::c_int = 146;
+pub const EHOSTDOWN: ::c_int = 147;
+pub const EHOSTUNREACH: ::c_int = 148;
+pub const EALREADY: ::c_int = 149;
+pub const EINPROGRESS: ::c_int = 150;
+pub const ESTALE: ::c_int = 151;
+pub const EUCLEAN: ::c_int = 135;
+pub const ENOTNAM: ::c_int = 137;
+pub const ENAVAIL: ::c_int = 138;
+pub const EISNAM: ::c_int = 139;
+pub const EREMOTEIO: ::c_int = 140;
+pub const EDQUOT: ::c_int = 1133;
+pub const ENOMEDIUM: ::c_int = 159;
+pub const EMEDIUMTYPE: ::c_int = 160;
+pub const ECANCELED: ::c_int = 158;
+pub const ENOKEY: ::c_int = 161;
+pub const EKEYEXPIRED: ::c_int = 162;
+pub const EKEYREVOKED: ::c_int = 163;
+pub const EKEYREJECTED: ::c_int = 164;
+pub const EOWNERDEAD: ::c_int = 165;
+pub const ENOTRECOVERABLE: ::c_int = 166;
+pub const EHWPOISON: ::c_int = 168;
+pub const ERFKILL: ::c_int = 167;
+
+pub const SOCK_STREAM: ::c_int = 2;
+pub const SOCK_DGRAM: ::c_int = 1;
+
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 8;
+pub const SA_NOCLDWAIT: ::c_int = 0x10000;
+
+pub const SIGCHLD: ::c_int = 18;
+pub const SIGBUS: ::c_int = 10;
+pub const SIGTTIN: ::c_int = 26;
+pub const SIGTTOU: ::c_int = 27;
+pub const SIGXCPU: ::c_int = 30;
+pub const SIGXFSZ: ::c_int = 31;
+pub const SIGVTALRM: ::c_int = 28;
+pub const SIGPROF: ::c_int = 29;
+pub const SIGWINCH: ::c_int = 20;
+pub const SIGUSR1: ::c_int = 16;
+pub const SIGUSR2: ::c_int = 17;
+pub const SIGCONT: ::c_int = 25;
+pub const SIGSTOP: ::c_int = 23;
+pub const SIGTSTP: ::c_int = 24;
+pub const SIGURG: ::c_int = 21;
+pub const SIGIO: ::c_int = 22;
+pub const SIGSYS: ::c_int = 12;
+pub const SIGSTKFLT: ::c_int = 7;
+pub const SIGPOLL: ::c_int = ::SIGIO;
+pub const SIGPWR: ::c_int = 19;
+pub const SIG_SETMASK: ::c_int = 3;
+pub const SIG_BLOCK: ::c_int = 1;
+pub const SIG_UNBLOCK: ::c_int = 2;
+
+pub const EXTPROC: ::tcflag_t = 0o200000;
+
+pub const F_GETLK: ::c_int = 33;
+pub const F_GETOWN: ::c_int = 23;
+pub const F_SETLK: ::c_int = 34;
+pub const F_SETLKW: ::c_int = 35;
+pub const F_SETOWN: ::c_int = 24;
+
+pub const VEOF: usize = 16;
+pub const VEOL: usize = 17;
+pub const VEOL2: usize = 6;
+pub const VMIN: usize = 4;
+pub const IEXTEN: ::tcflag_t = 0o000400;
+pub const TOSTOP: ::tcflag_t = 0o100000;
+pub const FLUSHO: ::tcflag_t = 0o020000;
+
+pub const POLLWRNORM: ::c_short = 0x4;
+pub const POLLWRBAND: ::c_short = 0x100;
+
+pub const SYS_syscall: ::c_long = 4000 + 0;
+pub const SYS_exit: ::c_long = 4000 + 1;
+pub const SYS_fork: ::c_long = 4000 + 2;
+pub const SYS_read: ::c_long = 4000 + 3;
+pub const SYS_write: ::c_long = 4000 + 4;
+pub const SYS_open: ::c_long = 4000 + 5;
+pub const SYS_close: ::c_long = 4000 + 6;
+pub const SYS_waitpid: ::c_long = 4000 + 7;
+pub const SYS_creat: ::c_long = 4000 + 8;
+pub const SYS_link: ::c_long = 4000 + 9;
+pub const SYS_unlink: ::c_long = 4000 + 10;
+pub const SYS_execve: ::c_long = 4000 + 11;
+pub const SYS_chdir: ::c_long = 4000 + 12;
+pub const SYS_time: ::c_long = 4000 + 13;
+pub const SYS_mknod: ::c_long = 4000 + 14;
+pub const SYS_chmod: ::c_long = 4000 + 15;
+pub const SYS_lchown: ::c_long = 4000 + 16;
+pub const SYS_break: ::c_long = 4000 + 17;
+pub const SYS_lseek: ::c_long = 4000 + 19;
+pub const SYS_getpid: ::c_long = 4000 + 20;
+pub const SYS_mount: ::c_long = 4000 + 21;
+pub const SYS_umount: ::c_long = 4000 + 22;
+pub const SYS_setuid: ::c_long = 4000 + 23;
+pub const SYS_getuid: ::c_long = 4000 + 24;
+pub const SYS_stime: ::c_long = 4000 + 25;
+pub const SYS_ptrace: ::c_long = 4000 + 26;
+pub const SYS_alarm: ::c_long = 4000 + 27;
+pub const SYS_pause: ::c_long = 4000 + 29;
+pub const SYS_utime: ::c_long = 4000 + 30;
+pub const SYS_stty: ::c_long = 4000 + 31;
+pub const SYS_gtty: ::c_long = 4000 + 32;
+pub const SYS_access: ::c_long = 4000 + 33;
+pub const SYS_nice: ::c_long = 4000 + 34;
+pub const SYS_ftime: ::c_long = 4000 + 35;
+pub const SYS_sync: ::c_long = 4000 + 36;
+pub const SYS_kill: ::c_long = 4000 + 37;
+pub const SYS_rename: ::c_long = 4000 + 38;
+pub const SYS_mkdir: ::c_long = 4000 + 39;
+pub const SYS_rmdir: ::c_long = 4000 + 40;
+pub const SYS_dup: ::c_long = 4000 + 41;
+pub const SYS_pipe: ::c_long = 4000 + 42;
+pub const SYS_times: ::c_long = 4000 + 43;
+pub const SYS_prof: ::c_long = 4000 + 44;
+pub const SYS_brk: ::c_long = 4000 + 45;
+pub const SYS_setgid: ::c_long = 4000 + 46;
+pub const SYS_getgid: ::c_long = 4000 + 47;
+pub const SYS_signal: ::c_long = 4000 + 48;
+pub const SYS_geteuid: ::c_long = 4000 + 49;
+pub const SYS_getegid: ::c_long = 4000 + 50;
+pub const SYS_acct: ::c_long = 4000 + 51;
+pub const SYS_umount2: ::c_long = 4000 + 52;
+pub const SYS_lock: ::c_long = 4000 + 53;
+pub const SYS_ioctl: ::c_long = 4000 + 54;
+pub const SYS_fcntl: ::c_long = 4000 + 55;
+pub const SYS_mpx: ::c_long = 4000 + 56;
+pub const SYS_setpgid: ::c_long = 4000 + 57;
+pub const SYS_ulimit: ::c_long = 4000 + 58;
+pub const SYS_umask: ::c_long = 4000 + 60;
+pub const SYS_chroot: ::c_long = 4000 + 61;
+pub const SYS_ustat: ::c_long = 4000 + 62;
+pub const SYS_dup2: ::c_long = 4000 + 63;
+pub const SYS_getppid: ::c_long = 4000 + 64;
+pub const SYS_getpgrp: ::c_long = 4000 + 65;
+pub const SYS_setsid: ::c_long = 4000 + 66;
+pub const SYS_sigaction: ::c_long = 4000 + 67;
+pub const SYS_sgetmask: ::c_long = 4000 + 68;
+pub const SYS_ssetmask: ::c_long = 4000 + 69;
+pub const SYS_setreuid: ::c_long = 4000 + 70;
+pub const SYS_setregid: ::c_long = 4000 + 71;
+pub const SYS_sigsuspend: ::c_long = 4000 + 72;
+pub const SYS_sigpending: ::c_long = 4000 + 73;
+pub const SYS_sethostname: ::c_long = 4000 + 74;
+pub const SYS_setrlimit: ::c_long = 4000 + 75;
+pub const SYS_getrlimit: ::c_long = 4000 + 76;
+pub const SYS_getrusage: ::c_long = 4000 + 77;
+pub const SYS_gettimeofday: ::c_long = 4000 + 78;
+pub const SYS_settimeofday: ::c_long = 4000 + 79;
+pub const SYS_getgroups: ::c_long = 4000 + 80;
+pub const SYS_setgroups: ::c_long = 4000 + 81;
+pub const SYS_symlink: ::c_long = 4000 + 83;
+pub const SYS_readlink: ::c_long = 4000 + 85;
+pub const SYS_uselib: ::c_long = 4000 + 86;
+pub const SYS_swapon: ::c_long = 4000 + 87;
+pub const SYS_reboot: ::c_long = 4000 + 88;
+pub const SYS_readdir: ::c_long = 4000 + 89;
+pub const SYS_mmap: ::c_long = 4000 + 90;
+pub const SYS_munmap: ::c_long = 4000 + 91;
+pub const SYS_truncate: ::c_long = 4000 + 92;
+pub const SYS_ftruncate: ::c_long = 4000 + 93;
+pub const SYS_fchmod: ::c_long = 4000 + 94;
+pub const SYS_fchown: ::c_long = 4000 + 95;
+pub const SYS_getpriority: ::c_long = 4000 + 96;
+pub const SYS_setpriority: ::c_long = 4000 + 97;
+pub const SYS_profil: ::c_long = 4000 + 98;
+pub const SYS_statfs: ::c_long = 4000 + 99;
+pub const SYS_fstatfs: ::c_long = 4000 + 100;
+pub const SYS_ioperm: ::c_long = 4000 + 101;
+pub const SYS_socketcall: ::c_long = 4000 + 102;
+pub const SYS_syslog: ::c_long = 4000 + 103;
+pub const SYS_setitimer: ::c_long = 4000 + 104;
+pub const SYS_getitimer: ::c_long = 4000 + 105;
+pub const SYS_stat: ::c_long = 4000 + 106;
+pub const SYS_lstat: ::c_long = 4000 + 107;
+pub const SYS_fstat: ::c_long = 4000 + 108;
+pub const SYS_iopl: ::c_long = 4000 + 110;
+pub const SYS_vhangup: ::c_long = 4000 + 111;
+pub const SYS_idle: ::c_long = 4000 + 112;
+pub const SYS_vm86: ::c_long = 4000 + 113;
+pub const SYS_wait4: ::c_long = 4000 + 114;
+pub const SYS_swapoff: ::c_long = 4000 + 115;
+pub const SYS_sysinfo: ::c_long = 4000 + 116;
+pub const SYS_ipc: ::c_long = 4000 + 117;
+pub const SYS_fsync: ::c_long = 4000 + 118;
+pub const SYS_sigreturn: ::c_long = 4000 + 119;
+pub const SYS_clone: ::c_long = 4000 + 120;
+pub const SYS_setdomainname: ::c_long = 4000 + 121;
+pub const SYS_uname: ::c_long = 4000 + 122;
+pub const SYS_modify_ldt: ::c_long = 4000 + 123;
+pub const SYS_adjtimex: ::c_long = 4000 + 124;
+pub const SYS_mprotect: ::c_long = 4000 + 125;
+pub const SYS_sigprocmask: ::c_long = 4000 + 126;
+pub const SYS_create_module: ::c_long = 4000 + 127;
+pub const SYS_init_module: ::c_long = 4000 + 128;
+pub const SYS_delete_module: ::c_long = 4000 + 129;
+pub const SYS_get_kernel_syms: ::c_long = 4000 + 130;
+pub const SYS_quotactl: ::c_long = 4000 + 131;
+pub const SYS_getpgid: ::c_long = 4000 + 132;
+pub const SYS_fchdir: ::c_long = 4000 + 133;
+pub const SYS_bdflush: ::c_long = 4000 + 134;
+pub const SYS_sysfs: ::c_long = 4000 + 135;
+pub const SYS_personality: ::c_long = 4000 + 136;
+pub const SYS_afs_syscall: ::c_long = 4000 + 137;
+pub const SYS_setfsuid: ::c_long = 4000 + 138;
+pub const SYS_setfsgid: ::c_long = 4000 + 139;
+pub const SYS__llseek: ::c_long = 4000 + 140;
+pub const SYS_getdents: ::c_long = 4000 + 141;
+pub const SYS_flock: ::c_long = 4000 + 143;
+pub const SYS_msync: ::c_long = 4000 + 144;
+pub const SYS_readv: ::c_long = 4000 + 145;
+pub const SYS_writev: ::c_long = 4000 + 146;
+pub const SYS_cacheflush: ::c_long = 4000 + 147;
+pub const SYS_cachectl: ::c_long = 4000 + 148;
+pub const SYS_sysmips: ::c_long = 4000 + 149;
+pub const SYS_getsid: ::c_long = 4000 + 151;
+pub const SYS_fdatasync: ::c_long = 4000 + 152;
+pub const SYS__sysctl: ::c_long = 4000 + 153;
+pub const SYS_mlock: ::c_long = 4000 + 154;
+pub const SYS_munlock: ::c_long = 4000 + 155;
+pub const SYS_mlockall: ::c_long = 4000 + 156;
+pub const SYS_munlockall: ::c_long = 4000 + 157;
+pub const SYS_sched_setparam: ::c_long = 4000 + 158;
+pub const SYS_sched_getparam: ::c_long = 4000 + 159;
+pub const SYS_sched_setscheduler: ::c_long = 4000 + 160;
+pub const SYS_sched_getscheduler: ::c_long = 4000 + 161;
+pub const SYS_sched_yield: ::c_long = 4000 + 162;
+pub const SYS_sched_get_priority_max: ::c_long = 4000 + 163;
+pub const SYS_sched_get_priority_min: ::c_long = 4000 + 164;
+pub const SYS_sched_rr_get_interval: ::c_long = 4000 + 165;
+pub const SYS_nanosleep: ::c_long = 4000 + 166;
+pub const SYS_mremap: ::c_long = 4000 + 167;
+pub const SYS_accept: ::c_long = 4000 + 168;
+pub const SYS_bind: ::c_long = 4000 + 169;
+pub const SYS_connect: ::c_long = 4000 + 170;
+pub const SYS_getpeername: ::c_long = 4000 + 171;
+pub const SYS_getsockname: ::c_long = 4000 + 172;
+pub const SYS_getsockopt: ::c_long = 4000 + 173;
+pub const SYS_listen: ::c_long = 4000 + 174;
+pub const SYS_recv: ::c_long = 4000 + 175;
+pub const SYS_recvfrom: ::c_long = 4000 + 176;
+pub const SYS_recvmsg: ::c_long = 4000 + 177;
+pub const SYS_send: ::c_long = 4000 + 178;
+pub const SYS_sendmsg: ::c_long = 4000 + 179;
+pub const SYS_sendto: ::c_long = 4000 + 180;
+pub const SYS_setsockopt: ::c_long = 4000 + 181;
+pub const SYS_shutdown: ::c_long = 4000 + 182;
+pub const SYS_socket: ::c_long = 4000 + 183;
+pub const SYS_socketpair: ::c_long = 4000 + 184;
+pub const SYS_setresuid: ::c_long = 4000 + 185;
+pub const SYS_getresuid: ::c_long = 4000 + 186;
+pub const SYS_query_module: ::c_long = 4000 + 187;
+pub const SYS_poll: ::c_long = 4000 + 188;
+pub const SYS_nfsservctl: ::c_long = 4000 + 189;
+pub const SYS_setresgid: ::c_long = 4000 + 190;
+pub const SYS_getresgid: ::c_long = 4000 + 191;
+pub const SYS_prctl: ::c_long = 4000 + 192;
+pub const SYS_rt_sigreturn: ::c_long = 4000 + 193;
+pub const SYS_rt_sigaction: ::c_long = 4000 + 194;
+pub const SYS_rt_sigprocmask: ::c_long = 4000 + 195;
+pub const SYS_rt_sigpending: ::c_long = 4000 + 196;
+pub const SYS_rt_sigtimedwait: ::c_long = 4000 + 197;
+pub const SYS_rt_sigqueueinfo: ::c_long = 4000 + 198;
+pub const SYS_rt_sigsuspend: ::c_long = 4000 + 199;
+pub const SYS_chown: ::c_long = 4000 + 202;
+pub const SYS_getcwd: ::c_long = 4000 + 203;
+pub const SYS_capget: ::c_long = 4000 + 204;
+pub const SYS_capset: ::c_long = 4000 + 205;
+pub const SYS_sigaltstack: ::c_long = 4000 + 206;
+pub const SYS_sendfile: ::c_long = 4000 + 207;
+pub const SYS_getpmsg: ::c_long = 4000 + 208;
+pub const SYS_putpmsg: ::c_long = 4000 + 209;
+pub const SYS_mmap2: ::c_long = 4000 + 210;
+pub const SYS_truncate64: ::c_long = 4000 + 211;
+pub const SYS_ftruncate64: ::c_long = 4000 + 212;
+pub const SYS_stat64: ::c_long = 4000 + 213;
+pub const SYS_lstat64: ::c_long = 4000 + 214;
+pub const SYS_fstat64: ::c_long = 4000 + 215;
+pub const SYS_pivot_root: ::c_long = 4000 + 216;
+pub const SYS_mincore: ::c_long = 4000 + 217;
+pub const SYS_madvise: ::c_long = 4000 + 218;
+pub const SYS_getdents64: ::c_long = 4000 + 219;
+pub const SYS_fcntl64: ::c_long = 4000 + 220;
+pub const SYS_gettid: ::c_long = 4000 + 222;
+pub const SYS_readahead: ::c_long = 4000 + 223;
+pub const SYS_setxattr: ::c_long = 4000 + 224;
+pub const SYS_lsetxattr: ::c_long = 4000 + 225;
+pub const SYS_fsetxattr: ::c_long = 4000 + 226;
+pub const SYS_getxattr: ::c_long = 4000 + 227;
+pub const SYS_lgetxattr: ::c_long = 4000 + 228;
+pub const SYS_fgetxattr: ::c_long = 4000 + 229;
+pub const SYS_listxattr: ::c_long = 4000 + 230;
+pub const SYS_llistxattr: ::c_long = 4000 + 231;
+pub const SYS_flistxattr: ::c_long = 4000 + 232;
+pub const SYS_removexattr: ::c_long = 4000 + 233;
+pub const SYS_lremovexattr: ::c_long = 4000 + 234;
+pub const SYS_fremovexattr: ::c_long = 4000 + 235;
+pub const SYS_tkill: ::c_long = 4000 + 236;
+pub const SYS_sendfile64: ::c_long = 4000 + 237;
+pub const SYS_futex: ::c_long = 4000 + 238;
+pub const SYS_sched_setaffinity: ::c_long = 4000 + 239;
+pub const SYS_sched_getaffinity: ::c_long = 4000 + 240;
+pub const SYS_io_setup: ::c_long = 4000 + 241;
+pub const SYS_io_destroy: ::c_long = 4000 + 242;
+pub const SYS_io_getevents: ::c_long = 4000 + 243;
+pub const SYS_io_submit: ::c_long = 4000 + 244;
+pub const SYS_io_cancel: ::c_long = 4000 + 245;
+pub const SYS_exit_group: ::c_long = 4000 + 246;
+pub const SYS_lookup_dcookie: ::c_long = 4000 + 247;
+pub const SYS_epoll_create: ::c_long = 4000 + 248;
+pub const SYS_epoll_ctl: ::c_long = 4000 + 249;
+pub const SYS_epoll_wait: ::c_long = 4000 + 250;
+pub const SYS_remap_file_pages: ::c_long = 4000 + 251;
+pub const SYS_set_tid_address: ::c_long = 4000 + 252;
+pub const SYS_restart_syscall: ::c_long = 4000 + 253;
+pub const SYS_statfs64: ::c_long = 4000 + 255;
+pub const SYS_fstatfs64: ::c_long = 4000 + 256;
+pub const SYS_timer_create: ::c_long = 4000 + 257;
+pub const SYS_timer_settime: ::c_long = 4000 + 258;
+pub const SYS_timer_gettime: ::c_long = 4000 + 259;
+pub const SYS_timer_getoverrun: ::c_long = 4000 + 260;
+pub const SYS_timer_delete: ::c_long = 4000 + 261;
+pub const SYS_clock_settime: ::c_long = 4000 + 262;
+pub const SYS_clock_gettime: ::c_long = 4000 + 263;
+pub const SYS_clock_getres: ::c_long = 4000 + 264;
+pub const SYS_clock_nanosleep: ::c_long = 4000 + 265;
+pub const SYS_tgkill: ::c_long = 4000 + 266;
+pub const SYS_utimes: ::c_long = 4000 + 267;
+pub const SYS_mbind: ::c_long = 4000 + 268;
+pub const SYS_get_mempolicy: ::c_long = 4000 + 269;
+pub const SYS_set_mempolicy: ::c_long = 4000 + 270;
+pub const SYS_mq_open: ::c_long = 4000 + 271;
+pub const SYS_mq_unlink: ::c_long = 4000 + 272;
+pub const SYS_mq_timedsend: ::c_long = 4000 + 273;
+pub const SYS_mq_timedreceive: ::c_long = 4000 + 274;
+pub const SYS_mq_notify: ::c_long = 4000 + 275;
+pub const SYS_mq_getsetattr: ::c_long = 4000 + 276;
+pub const SYS_vserver: ::c_long = 4000 + 277;
+pub const SYS_waitid: ::c_long = 4000 + 278;
+/* pub const SYS_sys_setaltroot: ::c_long = 4000 + 279; */
+pub const SYS_add_key: ::c_long = 4000 + 280;
+pub const SYS_request_key: ::c_long = 4000 + 281;
+pub const SYS_keyctl: ::c_long = 4000 + 282;
+pub const SYS_set_thread_area: ::c_long = 4000 + 283;
+pub const SYS_inotify_init: ::c_long = 4000 + 284;
+pub const SYS_inotify_add_watch: ::c_long = 4000 + 285;
+pub const SYS_inotify_rm_watch: ::c_long = 4000 + 286;
+pub const SYS_migrate_pages: ::c_long = 4000 + 287;
+pub const SYS_openat: ::c_long = 4000 + 288;
+pub const SYS_mkdirat: ::c_long = 4000 + 289;
+pub const SYS_mknodat: ::c_long = 4000 + 290;
+pub const SYS_fchownat: ::c_long = 4000 + 291;
+pub const SYS_futimesat: ::c_long = 4000 + 292;
+pub const SYS_unlinkat: ::c_long = 4000 + 294;
+pub const SYS_renameat: ::c_long = 4000 + 295;
+pub const SYS_linkat: ::c_long = 4000 + 296;
+pub const SYS_symlinkat: ::c_long = 4000 + 297;
+pub const SYS_readlinkat: ::c_long = 4000 + 298;
+pub const SYS_fchmodat: ::c_long = 4000 + 299;
+pub const SYS_faccessat: ::c_long = 4000 + 300;
+pub const SYS_pselect6: ::c_long = 4000 + 301;
+pub const SYS_ppoll: ::c_long = 4000 + 302;
+pub const SYS_unshare: ::c_long = 4000 + 303;
+pub const SYS_splice: ::c_long = 4000 + 304;
+pub const SYS_sync_file_range: ::c_long = 4000 + 305;
+pub const SYS_tee: ::c_long = 4000 + 306;
+pub const SYS_vmsplice: ::c_long = 4000 + 307;
+pub const SYS_move_pages: ::c_long = 4000 + 308;
+pub const SYS_set_robust_list: ::c_long = 4000 + 309;
+pub const SYS_get_robust_list: ::c_long = 4000 + 310;
+pub const SYS_kexec_load: ::c_long = 4000 + 311;
+pub const SYS_getcpu: ::c_long = 4000 + 312;
+pub const SYS_epoll_pwait: ::c_long = 4000 + 313;
+pub const SYS_ioprio_set: ::c_long = 4000 + 314;
+pub const SYS_ioprio_get: ::c_long = 4000 + 315;
+pub const SYS_utimensat: ::c_long = 4000 + 316;
+pub const SYS_signalfd: ::c_long = 4000 + 317;
+pub const SYS_timerfd: ::c_long = 4000 + 318;
+pub const SYS_eventfd: ::c_long = 4000 + 319;
+pub const SYS_fallocate: ::c_long = 4000 + 320;
+pub const SYS_timerfd_create: ::c_long = 4000 + 321;
+pub const SYS_timerfd_gettime: ::c_long = 4000 + 322;
+pub const SYS_timerfd_settime: ::c_long = 4000 + 323;
+pub const SYS_signalfd4: ::c_long = 4000 + 324;
+pub const SYS_eventfd2: ::c_long = 4000 + 325;
+pub const SYS_epoll_create1: ::c_long = 4000 + 326;
+pub const SYS_dup3: ::c_long = 4000 + 327;
+pub const SYS_pipe2: ::c_long = 4000 + 328;
+pub const SYS_inotify_init1: ::c_long = 4000 + 329;
+pub const SYS_preadv: ::c_long = 4000 + 330;
+pub const SYS_pwritev: ::c_long = 4000 + 331;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 4000 + 332;
+pub const SYS_perf_event_open: ::c_long = 4000 + 333;
+pub const SYS_accept4: ::c_long = 4000 + 334;
+pub const SYS_recvmmsg: ::c_long = 4000 + 335;
+pub const SYS_fanotify_init: ::c_long = 4000 + 336;
+pub const SYS_fanotify_mark: ::c_long = 4000 + 337;
+pub const SYS_prlimit64: ::c_long = 4000 + 338;
+pub const SYS_name_to_handle_at: ::c_long = 4000 + 339;
+pub const SYS_open_by_handle_at: ::c_long = 4000 + 340;
+pub const SYS_clock_adjtime: ::c_long = 4000 + 341;
+pub const SYS_syncfs: ::c_long = 4000 + 342;
+pub const SYS_sendmmsg: ::c_long = 4000 + 343;
+pub const SYS_setns: ::c_long = 4000 + 344;
+pub const SYS_process_vm_readv: ::c_long = 4000 + 345;
+pub const SYS_process_vm_writev: ::c_long = 4000 + 346;
+pub const SYS_kcmp: ::c_long = 4000 + 347;
+pub const SYS_finit_module: ::c_long = 4000 + 348;
+pub const SYS_sched_setattr: ::c_long = 4000 + 349;
+pub const SYS_sched_getattr: ::c_long = 4000 + 350;
+pub const SYS_renameat2: ::c_long = 4000 + 351;
+pub const SYS_seccomp: ::c_long = 4000 + 352;
+pub const SYS_getrandom: ::c_long = 4000 + 353;
+pub const SYS_memfd_create: ::c_long = 4000 + 354;
+pub const SYS_bpf: ::c_long = 4000 + 355;
+pub const SYS_execveat: ::c_long = 4000 + 356;
+pub const SYS_userfaultfd: ::c_long = 4000 + 357;
+pub const SYS_membarrier: ::c_long = 4000 + 358;
+pub const SYS_mlock2: ::c_long = 4000 + 359;
+pub const SYS_copy_file_range: ::c_long = 4000 + 360;
+pub const SYS_preadv2: ::c_long = 4000 + 361;
+pub const SYS_pwritev2: ::c_long = 4000 + 362;
+pub const SYS_pkey_mprotect: ::c_long = 4000 + 363;
+pub const SYS_pkey_alloc: ::c_long = 4000 + 364;
+pub const SYS_pkey_free: ::c_long = 4000 + 365;
+pub const SYS_statx: ::c_long = 4000 + 366;
+pub const SYS_pidfd_send_signal: ::c_long = 4000 + 424;
+pub const SYS_io_uring_setup: ::c_long = 4000 + 425;
+pub const SYS_io_uring_enter: ::c_long = 4000 + 426;
+pub const SYS_io_uring_register: ::c_long = 4000 + 427;
+pub const SYS_open_tree: ::c_long = 4000 + 428;
+pub const SYS_move_mount: ::c_long = 4000 + 429;
+pub const SYS_fsopen: ::c_long = 4000 + 430;
+pub const SYS_fsconfig: ::c_long = 4000 + 431;
+pub const SYS_fsmount: ::c_long = 4000 + 432;
+pub const SYS_fspick: ::c_long = 4000 + 433;
+pub const SYS_pidfd_open: ::c_long = 4000 + 434;
+pub const SYS_clone3: ::c_long = 4000 + 435;
+pub const SYS_close_range: ::c_long = 4000 + 436;
+pub const SYS_openat2: ::c_long = 4000 + 437;
+pub const SYS_pidfd_getfd: ::c_long = 4000 + 438;
+pub const SYS_faccessat2: ::c_long = 4000 + 439;
+pub const SYS_process_madvise: ::c_long = 4000 + 440;
+pub const SYS_epoll_pwait2: ::c_long = 4000 + 441;
+pub const SYS_mount_setattr: ::c_long = 4000 + 442;
+pub const SYS_quotactl_fd: ::c_long = 4000 + 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 4000 + 444;
+pub const SYS_landlock_add_rule: ::c_long = 4000 + 445;
+pub const SYS_landlock_restrict_self: ::c_long = 4000 + 446;
+pub const SYS_memfd_secret: ::c_long = 4000 + 447;
+pub const SYS_process_mrelease: ::c_long = 4000 + 448;
+pub const SYS_futex_waitv: ::c_long = 4000 + 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 4000 + 450;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,65 @@
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type nlink_t = u32;
+pub type blksize_t = ::c_long;
+pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
+pub type regoff_t = ::c_int;
+
+s! {
+    pub struct pthread_attr_t {
+        __size: [u32; 9]
+    }
+
+    pub struct sigset_t {
+        __val: [::c_ulong; 32],
+    }
+
+    pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: ::socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::c_int,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: ::socklen_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct cmsghdr {
+        pub cmsg_len: ::socklen_t,
+        pub cmsg_level: ::c_int,
+        pub cmsg_type: ::c_int,
+    }
+
+    pub struct sem_t {
+        __val: [::c_int; 4],
+    }
+}
+
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20;
+
+cfg_if! {
+    if #[cfg(any(target_arch = "x86"))] {
+        mod x86;
+        pub use self::x86::*;
+    } else if #[cfg(any(target_arch = "mips"))] {
+        mod mips;
+        pub use self::mips::*;
+    } else if #[cfg(any(target_arch = "arm"))] {
+        mod arm;
+        pub use self::arm::*;
+    } else if #[cfg(any(target_arch = "powerpc"))] {
+        mod powerpc;
+        pub use self::powerpc::*;
+    } else if #[cfg(any(target_arch = "hexagon"))] {
+        mod hexagon;
+        pub use self::hexagon::*;
+    } else if #[cfg(any(target_arch = "riscv32"))] {
+        mod riscv32;
+        pub use self::riscv32::*;
+    } else {
+        // Unknown target_arch
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,802 @@
+pub type c_char = u8;
+pub type wchar_t = i32;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __st_rdev_padding: ::c_short,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_long; 2],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __st_rdev_padding: ::c_short,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_long; 2],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t
+    }
+
+    pub struct ipc_perm {
+        pub __ipc_perm_key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_int,
+        __pad1: ::c_int,
+        __pad2: ::c_longlong,
+        __pad3: ::c_longlong
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        __unused1: ::c_int,
+        pub shm_atime: ::time_t,
+        __unused2: ::c_int,
+        pub shm_dtime: ::time_t,
+        __unused3: ::c_int,
+        pub shm_ctime: ::time_t,
+        __unused4: ::c_int,
+        pub shm_segsz: ::size_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::c_ulong,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        __unused1: ::c_int,
+        pub msg_stime: ::time_t,
+        __unused2: ::c_int,
+        pub msg_rtime: ::time_t,
+        __unused3: ::c_int,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 4],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        pub _pad: [::c_int; 29],
+        _align: [usize; 0],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 4],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        #[cfg(target_endian = "little")]
+        pub f_fsid: ::c_ulong,
+        __f_unused: ::c_int,
+        #[cfg(target_endian = "big")]
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+}
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const SIGSTKSZ: ::size_t = 10240;
+pub const MINSIGSTKSZ: ::size_t = 4096;
+
+pub const O_DIRECT: ::c_int = 0x20000;
+pub const O_DIRECTORY: ::c_int = 0x4000;
+pub const O_NOFOLLOW: ::c_int = 0x8000;
+pub const O_ASYNC: ::c_int = 0x2000;
+pub const O_LARGEFILE: ::c_int = 0x10000;
+
+pub const MCL_CURRENT: ::c_int = 0x2000;
+pub const MCL_FUTURE: ::c_int = 0x4000;
+pub const MCL_ONFAULT: ::c_int = 0x8000;
+pub const CBAUD: ::tcflag_t = 0o0000377;
+pub const TAB1: ::c_int = 0x00000400;
+pub const TAB2: ::c_int = 0x00000800;
+pub const TAB3: ::c_int = 0x00000C00;
+pub const CR1: ::c_int = 0x00001000;
+pub const CR2: ::c_int = 0x00002000;
+pub const CR3: ::c_int = 0x00003000;
+pub const FF1: ::c_int = 0x00004000;
+pub const BS1: ::c_int = 0x00008000;
+pub const VT1: ::c_int = 0x00010000;
+pub const VWERASE: usize = 10;
+pub const VREPRINT: usize = 11;
+pub const VSUSP: usize = 12;
+pub const VSTART: usize = 13;
+pub const VSTOP: usize = 14;
+pub const VDISCARD: usize = 16;
+pub const VTIME: usize = 7;
+pub const IXON: ::tcflag_t = 0x00000200;
+pub const IXOFF: ::tcflag_t = 0x00000400;
+pub const ONLCR: ::tcflag_t = 0x00000002;
+pub const CSIZE: ::tcflag_t = 0x00000300;
+pub const CS6: ::tcflag_t = 0x00000100;
+pub const CS7: ::tcflag_t = 0x00000200;
+pub const CS8: ::tcflag_t = 0x00000300;
+pub const CSTOPB: ::tcflag_t = 0x00000400;
+pub const CREAD: ::tcflag_t = 0x00000800;
+pub const PARENB: ::tcflag_t = 0x00001000;
+pub const PARODD: ::tcflag_t = 0x00002000;
+pub const HUPCL: ::tcflag_t = 0x00004000;
+pub const CLOCAL: ::tcflag_t = 0x00008000;
+pub const ECHOKE: ::tcflag_t = 0x00000001;
+pub const ECHOE: ::tcflag_t = 0x00000002;
+pub const ECHOK: ::tcflag_t = 0x00000004;
+pub const ECHONL: ::tcflag_t = 0x00000010;
+pub const ECHOPRT: ::tcflag_t = 0x00000020;
+pub const ECHOCTL: ::tcflag_t = 0x00000040;
+pub const ISIG: ::tcflag_t = 0x00000080;
+pub const ICANON: ::tcflag_t = 0x00000100;
+pub const PENDIN: ::tcflag_t = 0x20000000;
+pub const NOFLSH: ::tcflag_t = 0x80000000;
+pub const CIBAUD: ::tcflag_t = 0o00077600000;
+pub const CBAUDEX: ::tcflag_t = 0o000020;
+pub const VSWTC: usize = 9;
+pub const OLCUC: ::tcflag_t = 0o000004;
+pub const NLDLY: ::tcflag_t = 0o001400;
+pub const CRDLY: ::tcflag_t = 0o030000;
+pub const TABDLY: ::tcflag_t = 0o006000;
+pub const BSDLY: ::tcflag_t = 0o100000;
+pub const FFDLY: ::tcflag_t = 0o040000;
+pub const VTDLY: ::tcflag_t = 0o200000;
+pub const XTABS: ::tcflag_t = 0o006000;
+pub const B57600: ::speed_t = 0o000020;
+pub const B115200: ::speed_t = 0o000021;
+pub const B230400: ::speed_t = 0o000022;
+pub const B460800: ::speed_t = 0o000023;
+pub const B500000: ::speed_t = 0o000024;
+pub const B576000: ::speed_t = 0o000025;
+pub const B921600: ::speed_t = 0o000026;
+pub const B1000000: ::speed_t = 0o000027;
+pub const B1152000: ::speed_t = 0o000030;
+pub const B1500000: ::speed_t = 0o000031;
+pub const B2000000: ::speed_t = 0o000032;
+pub const B2500000: ::speed_t = 0o000033;
+pub const B3000000: ::speed_t = 0o000034;
+pub const B3500000: ::speed_t = 0o000035;
+pub const B4000000: ::speed_t = 0o000036;
+
+pub const O_APPEND: ::c_int = 1024;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_LOCKED: ::c_int = 0x00080;
+pub const MAP_NORESERVE: ::c_int = 0x00040;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const PTRACE_SYSEMU: ::c_int = 0x1d;
+pub const PTRACE_SYSEMU_SINGLESTEP: ::c_int = 0x1e;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const EDEADLK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EDEADLOCK: ::c_int = 58;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EBADMSG: ::c_int = 74;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const ERFKILL: ::c_int = 132;
+pub const EHWPOISON: ::c_int = 133;
+
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+
+pub const EXTPROC: ::tcflag_t = 0x10000000;
+
+pub const F_GETLK: ::c_int = 12;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETLK: ::c_int = 13;
+pub const F_SETLKW: ::c_int = 14;
+pub const F_SETOWN: ::c_int = 8;
+
+pub const VEOF: usize = 4;
+pub const VEOL: usize = 6;
+pub const VEOL2: usize = 8;
+pub const VMIN: usize = 5;
+pub const IEXTEN: ::tcflag_t = 0x00000400;
+pub const TOSTOP: ::tcflag_t = 0x00400000;
+pub const FLUSHO: ::tcflag_t = 0x00800000;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+// Syscall table
+pub const SYS_restart_syscall: ::c_long = 0;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_waitpid: ::c_long = 7;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execve: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_time: ::c_long = 13;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lchown: ::c_long = 16;
+pub const SYS_break: ::c_long = 17;
+pub const SYS_oldstat: ::c_long = 18;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_mount: ::c_long = 21;
+pub const SYS_umount: ::c_long = 22;
+pub const SYS_setuid: ::c_long = 23;
+pub const SYS_getuid: ::c_long = 24;
+pub const SYS_stime: ::c_long = 25;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_alarm: ::c_long = 27;
+pub const SYS_oldfstat: ::c_long = 28;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_utime: ::c_long = 30;
+pub const SYS_stty: ::c_long = 31;
+pub const SYS_gtty: ::c_long = 32;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_ftime: ::c_long = 35;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_prof: ::c_long = 44;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_setgid: ::c_long = 46;
+pub const SYS_getgid: ::c_long = 47;
+pub const SYS_signal: ::c_long = 48;
+pub const SYS_geteuid: ::c_long = 49;
+pub const SYS_getegid: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount2: ::c_long = 52;
+pub const SYS_lock: ::c_long = 53;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_mpx: ::c_long = 56;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_ulimit: ::c_long = 58;
+pub const SYS_oldolduname: ::c_long = 59;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_sgetmask: ::c_long = 68;
+pub const SYS_ssetmask: ::c_long = 69;
+pub const SYS_setreuid: ::c_long = 70;
+pub const SYS_setregid: ::c_long = 71;
+pub const SYS_sigsuspend: ::c_long = 72;
+pub const SYS_sigpending: ::c_long = 73;
+pub const SYS_sethostname: ::c_long = 74;
+pub const SYS_setrlimit: ::c_long = 75;
+pub const SYS_getrlimit: ::c_long = 76;
+pub const SYS_getrusage: ::c_long = 77;
+pub const SYS_gettimeofday: ::c_long = 78;
+pub const SYS_settimeofday: ::c_long = 79;
+pub const SYS_getgroups: ::c_long = 80;
+pub const SYS_setgroups: ::c_long = 81;
+pub const SYS_select: ::c_long = 82;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_oldlstat: ::c_long = 84;
+pub const SYS_readlink: ::c_long = 85;
+pub const SYS_uselib: ::c_long = 86;
+pub const SYS_swapon: ::c_long = 87;
+pub const SYS_reboot: ::c_long = 88;
+pub const SYS_readdir: ::c_long = 89;
+pub const SYS_mmap: ::c_long = 90;
+pub const SYS_munmap: ::c_long = 91;
+pub const SYS_truncate: ::c_long = 92;
+pub const SYS_ftruncate: ::c_long = 93;
+pub const SYS_fchmod: ::c_long = 94;
+pub const SYS_fchown: ::c_long = 95;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_profil: ::c_long = 98;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_ioperm: ::c_long = 101;
+pub const SYS_socketcall: ::c_long = 102;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_setitimer: ::c_long = 104;
+pub const SYS_getitimer: ::c_long = 105;
+pub const SYS_stat: ::c_long = 106;
+pub const SYS_lstat: ::c_long = 107;
+pub const SYS_fstat: ::c_long = 108;
+pub const SYS_olduname: ::c_long = 109;
+pub const SYS_iopl: ::c_long = 110;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_idle: ::c_long = 112;
+pub const SYS_vm86: ::c_long = 113;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_ipc: ::c_long = 117;
+pub const SYS_fsync: ::c_long = 118;
+pub const SYS_sigreturn: ::c_long = 119;
+pub const SYS_clone: ::c_long = 120;
+pub const SYS_setdomainname: ::c_long = 121;
+pub const SYS_uname: ::c_long = 122;
+pub const SYS_modify_ldt: ::c_long = 123;
+pub const SYS_adjtimex: ::c_long = 124;
+pub const SYS_mprotect: ::c_long = 125;
+pub const SYS_sigprocmask: ::c_long = 126;
+pub const SYS_create_module: ::c_long = 127;
+pub const SYS_init_module: ::c_long = 128;
+pub const SYS_delete_module: ::c_long = 129;
+pub const SYS_get_kernel_syms: ::c_long = 130;
+pub const SYS_quotactl: ::c_long = 131;
+pub const SYS_getpgid: ::c_long = 132;
+pub const SYS_fchdir: ::c_long = 133;
+pub const SYS_bdflush: ::c_long = 134;
+pub const SYS_sysfs: ::c_long = 135;
+pub const SYS_personality: ::c_long = 136;
+pub const SYS_afs_syscall: ::c_long = 137;
+pub const SYS_setfsuid: ::c_long = 138;
+pub const SYS_setfsgid: ::c_long = 139;
+pub const SYS__llseek: ::c_long = 140;
+pub const SYS_getdents: ::c_long = 141;
+pub const SYS__newselect: ::c_long = 142;
+pub const SYS_flock: ::c_long = 143;
+pub const SYS_msync: ::c_long = 144;
+pub const SYS_readv: ::c_long = 145;
+pub const SYS_writev: ::c_long = 146;
+pub const SYS_getsid: ::c_long = 147;
+pub const SYS_fdatasync: ::c_long = 148;
+pub const SYS__sysctl: ::c_long = 149;
+pub const SYS_mlock: ::c_long = 150;
+pub const SYS_munlock: ::c_long = 151;
+pub const SYS_mlockall: ::c_long = 152;
+pub const SYS_munlockall: ::c_long = 153;
+pub const SYS_sched_setparam: ::c_long = 154;
+pub const SYS_sched_getparam: ::c_long = 155;
+pub const SYS_sched_setscheduler: ::c_long = 156;
+pub const SYS_sched_getscheduler: ::c_long = 157;
+pub const SYS_sched_yield: ::c_long = 158;
+pub const SYS_sched_get_priority_max: ::c_long = 159;
+pub const SYS_sched_get_priority_min: ::c_long = 160;
+pub const SYS_sched_rr_get_interval: ::c_long = 161;
+pub const SYS_nanosleep: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_setresuid: ::c_long = 164;
+pub const SYS_getresuid: ::c_long = 165;
+pub const SYS_query_module: ::c_long = 166;
+pub const SYS_poll: ::c_long = 167;
+pub const SYS_nfsservctl: ::c_long = 168;
+pub const SYS_setresgid: ::c_long = 169;
+pub const SYS_getresgid: ::c_long = 170;
+pub const SYS_prctl: ::c_long = 171;
+pub const SYS_rt_sigreturn: ::c_long = 172;
+pub const SYS_rt_sigaction: ::c_long = 173;
+pub const SYS_rt_sigprocmask: ::c_long = 174;
+pub const SYS_rt_sigpending: ::c_long = 175;
+pub const SYS_rt_sigtimedwait: ::c_long = 176;
+pub const SYS_rt_sigqueueinfo: ::c_long = 177;
+pub const SYS_rt_sigsuspend: ::c_long = 178;
+pub const SYS_pread64: ::c_long = 179;
+pub const SYS_pwrite64: ::c_long = 180;
+pub const SYS_chown: ::c_long = 181;
+pub const SYS_getcwd: ::c_long = 182;
+pub const SYS_capget: ::c_long = 183;
+pub const SYS_capset: ::c_long = 184;
+pub const SYS_sigaltstack: ::c_long = 185;
+pub const SYS_sendfile: ::c_long = 186;
+pub const SYS_getpmsg: ::c_long = 187;
+pub const SYS_putpmsg: ::c_long = 188;
+pub const SYS_vfork: ::c_long = 189;
+pub const SYS_ugetrlimit: ::c_long = 190;
+pub const SYS_readahead: ::c_long = 191;
+pub const SYS_mmap2: ::c_long = 192;
+pub const SYS_truncate64: ::c_long = 193;
+pub const SYS_ftruncate64: ::c_long = 194;
+pub const SYS_stat64: ::c_long = 195;
+pub const SYS_lstat64: ::c_long = 196;
+pub const SYS_fstat64: ::c_long = 197;
+pub const SYS_pciconfig_read: ::c_long = 198;
+pub const SYS_pciconfig_write: ::c_long = 199;
+pub const SYS_pciconfig_iobase: ::c_long = 200;
+pub const SYS_multiplexer: ::c_long = 201;
+pub const SYS_getdents64: ::c_long = 202;
+pub const SYS_pivot_root: ::c_long = 203;
+pub const SYS_fcntl64: ::c_long = 204;
+pub const SYS_madvise: ::c_long = 205;
+pub const SYS_mincore: ::c_long = 206;
+pub const SYS_gettid: ::c_long = 207;
+pub const SYS_tkill: ::c_long = 208;
+pub const SYS_setxattr: ::c_long = 209;
+pub const SYS_lsetxattr: ::c_long = 210;
+pub const SYS_fsetxattr: ::c_long = 211;
+pub const SYS_getxattr: ::c_long = 212;
+pub const SYS_lgetxattr: ::c_long = 213;
+pub const SYS_fgetxattr: ::c_long = 214;
+pub const SYS_listxattr: ::c_long = 215;
+pub const SYS_llistxattr: ::c_long = 216;
+pub const SYS_flistxattr: ::c_long = 217;
+pub const SYS_removexattr: ::c_long = 218;
+pub const SYS_lremovexattr: ::c_long = 219;
+pub const SYS_fremovexattr: ::c_long = 220;
+pub const SYS_futex: ::c_long = 221;
+pub const SYS_sched_setaffinity: ::c_long = 222;
+pub const SYS_sched_getaffinity: ::c_long = 223;
+pub const SYS_tuxcall: ::c_long = 225;
+pub const SYS_sendfile64: ::c_long = 226;
+pub const SYS_io_setup: ::c_long = 227;
+pub const SYS_io_destroy: ::c_long = 228;
+pub const SYS_io_getevents: ::c_long = 229;
+pub const SYS_io_submit: ::c_long = 230;
+pub const SYS_io_cancel: ::c_long = 231;
+pub const SYS_set_tid_address: ::c_long = 232;
+pub const SYS_fadvise64: ::c_long = 233;
+pub const SYS_exit_group: ::c_long = 234;
+pub const SYS_lookup_dcookie: ::c_long = 235;
+pub const SYS_epoll_create: ::c_long = 236;
+pub const SYS_epoll_ctl: ::c_long = 237;
+pub const SYS_epoll_wait: ::c_long = 238;
+pub const SYS_remap_file_pages: ::c_long = 239;
+pub const SYS_timer_create: ::c_long = 240;
+pub const SYS_timer_settime: ::c_long = 241;
+pub const SYS_timer_gettime: ::c_long = 242;
+pub const SYS_timer_getoverrun: ::c_long = 243;
+pub const SYS_timer_delete: ::c_long = 244;
+pub const SYS_clock_settime: ::c_long = 245;
+pub const SYS_clock_gettime: ::c_long = 246;
+pub const SYS_clock_getres: ::c_long = 247;
+pub const SYS_clock_nanosleep: ::c_long = 248;
+pub const SYS_swapcontext: ::c_long = 249;
+pub const SYS_tgkill: ::c_long = 250;
+pub const SYS_utimes: ::c_long = 251;
+pub const SYS_statfs64: ::c_long = 252;
+pub const SYS_fstatfs64: ::c_long = 253;
+pub const SYS_fadvise64_64: ::c_long = 254;
+pub const SYS_rtas: ::c_long = 255;
+pub const SYS_sys_debug_setcontext: ::c_long = 256;
+pub const SYS_migrate_pages: ::c_long = 258;
+pub const SYS_mbind: ::c_long = 259;
+pub const SYS_get_mempolicy: ::c_long = 260;
+pub const SYS_set_mempolicy: ::c_long = 261;
+pub const SYS_mq_open: ::c_long = 262;
+pub const SYS_mq_unlink: ::c_long = 263;
+pub const SYS_mq_timedsend: ::c_long = 264;
+pub const SYS_mq_timedreceive: ::c_long = 265;
+pub const SYS_mq_notify: ::c_long = 266;
+pub const SYS_mq_getsetattr: ::c_long = 267;
+pub const SYS_kexec_load: ::c_long = 268;
+pub const SYS_add_key: ::c_long = 269;
+pub const SYS_request_key: ::c_long = 270;
+pub const SYS_keyctl: ::c_long = 271;
+pub const SYS_waitid: ::c_long = 272;
+pub const SYS_ioprio_set: ::c_long = 273;
+pub const SYS_ioprio_get: ::c_long = 274;
+pub const SYS_inotify_init: ::c_long = 275;
+pub const SYS_inotify_add_watch: ::c_long = 276;
+pub const SYS_inotify_rm_watch: ::c_long = 277;
+pub const SYS_spu_run: ::c_long = 278;
+pub const SYS_spu_create: ::c_long = 279;
+pub const SYS_pselect6: ::c_long = 280;
+pub const SYS_ppoll: ::c_long = 281;
+pub const SYS_unshare: ::c_long = 282;
+pub const SYS_splice: ::c_long = 283;
+pub const SYS_tee: ::c_long = 284;
+pub const SYS_vmsplice: ::c_long = 285;
+pub const SYS_openat: ::c_long = 286;
+pub const SYS_mkdirat: ::c_long = 287;
+pub const SYS_mknodat: ::c_long = 288;
+pub const SYS_fchownat: ::c_long = 289;
+pub const SYS_futimesat: ::c_long = 290;
+pub const SYS_fstatat64: ::c_long = 291;
+pub const SYS_unlinkat: ::c_long = 292;
+pub const SYS_renameat: ::c_long = 293;
+pub const SYS_linkat: ::c_long = 294;
+pub const SYS_symlinkat: ::c_long = 295;
+pub const SYS_readlinkat: ::c_long = 296;
+pub const SYS_fchmodat: ::c_long = 297;
+pub const SYS_faccessat: ::c_long = 298;
+pub const SYS_get_robust_list: ::c_long = 299;
+pub const SYS_set_robust_list: ::c_long = 300;
+pub const SYS_move_pages: ::c_long = 301;
+pub const SYS_getcpu: ::c_long = 302;
+pub const SYS_epoll_pwait: ::c_long = 303;
+pub const SYS_utimensat: ::c_long = 304;
+pub const SYS_signalfd: ::c_long = 305;
+pub const SYS_timerfd_create: ::c_long = 306;
+pub const SYS_eventfd: ::c_long = 307;
+pub const SYS_sync_file_range2: ::c_long = 308;
+pub const SYS_fallocate: ::c_long = 309;
+pub const SYS_subpage_prot: ::c_long = 310;
+pub const SYS_timerfd_settime: ::c_long = 311;
+pub const SYS_timerfd_gettime: ::c_long = 312;
+pub const SYS_signalfd4: ::c_long = 313;
+pub const SYS_eventfd2: ::c_long = 314;
+pub const SYS_epoll_create1: ::c_long = 315;
+pub const SYS_dup3: ::c_long = 316;
+pub const SYS_pipe2: ::c_long = 317;
+pub const SYS_inotify_init1: ::c_long = 318;
+pub const SYS_perf_event_open: ::c_long = 319;
+pub const SYS_preadv: ::c_long = 320;
+pub const SYS_pwritev: ::c_long = 321;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 322;
+pub const SYS_fanotify_init: ::c_long = 323;
+pub const SYS_fanotify_mark: ::c_long = 324;
+pub const SYS_prlimit64: ::c_long = 325;
+pub const SYS_socket: ::c_long = 326;
+pub const SYS_bind: ::c_long = 327;
+pub const SYS_connect: ::c_long = 328;
+pub const SYS_listen: ::c_long = 329;
+pub const SYS_accept: ::c_long = 330;
+pub const SYS_getsockname: ::c_long = 331;
+pub const SYS_getpeername: ::c_long = 332;
+pub const SYS_socketpair: ::c_long = 333;
+pub const SYS_send: ::c_long = 334;
+pub const SYS_sendto: ::c_long = 335;
+pub const SYS_recv: ::c_long = 336;
+pub const SYS_recvfrom: ::c_long = 337;
+pub const SYS_shutdown: ::c_long = 338;
+pub const SYS_setsockopt: ::c_long = 339;
+pub const SYS_getsockopt: ::c_long = 340;
+pub const SYS_sendmsg: ::c_long = 341;
+pub const SYS_recvmsg: ::c_long = 342;
+pub const SYS_recvmmsg: ::c_long = 343;
+pub const SYS_accept4: ::c_long = 344;
+pub const SYS_name_to_handle_at: ::c_long = 345;
+pub const SYS_open_by_handle_at: ::c_long = 346;
+pub const SYS_clock_adjtime: ::c_long = 347;
+pub const SYS_syncfs: ::c_long = 348;
+pub const SYS_sendmmsg: ::c_long = 349;
+pub const SYS_setns: ::c_long = 350;
+pub const SYS_process_vm_readv: ::c_long = 351;
+pub const SYS_process_vm_writev: ::c_long = 352;
+pub const SYS_finit_module: ::c_long = 353;
+pub const SYS_kcmp: ::c_long = 354;
+pub const SYS_sched_setattr: ::c_long = 355;
+pub const SYS_sched_getattr: ::c_long = 356;
+pub const SYS_renameat2: ::c_long = 357;
+pub const SYS_seccomp: ::c_long = 358;
+pub const SYS_getrandom: ::c_long = 359;
+pub const SYS_memfd_create: ::c_long = 360;
+pub const SYS_bpf: ::c_long = 361;
+pub const SYS_execveat: ::c_long = 362;
+pub const SYS_switch_endian: ::c_long = 363;
+pub const SYS_userfaultfd: ::c_long = 364;
+pub const SYS_membarrier: ::c_long = 365;
+pub const SYS_mlock2: ::c_long = 378;
+pub const SYS_copy_file_range: ::c_long = 379;
+pub const SYS_preadv2: ::c_long = 380;
+pub const SYS_pwritev2: ::c_long = 381;
+pub const SYS_kexec_file_load: ::c_long = 382;
+pub const SYS_statx: ::c_long = 383;
+pub const SYS_pkey_alloc: ::c_long = 384;
+pub const SYS_pkey_free: ::c_long = 385;
+pub const SYS_pkey_mprotect: ::c_long = 386;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+extern "C" {
+    pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(8))]
+    pub struct max_align_t {
+        priv_: (i64, f64)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,798 @@
+//! RISC-V-specific definitions for 32-bit linux-like values
+
+pub type c_char = u8;
+pub type wchar_t = ::c_int;
+
+s! {
+    pub struct pthread_attr_t {
+        __size: [::c_ulong; 7],
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub __pad1: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub __pad2: ::c_int,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_int; 2usize],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub __pad1: ::dev_t,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub __pad2: ::c_int,
+        pub st_blocks: ::blkcnt64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_int; 2],
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_long,
+        pub f_frsize: ::c_long,
+        pub f_flags: ::c_long,
+        pub f_spare: [::c_long; 4],
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        pub __f_spare: [::c_int; 6],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 4],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        __f_unused: ::c_int,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        #[doc(hidden)]
+        #[deprecated(
+            since="0.2.54",
+            note="Please leave a comment on \
+                  https://github.com/rust-lang/libc/pull/1316 if you're using \
+                  this field"
+        )]
+        pub _pad: [::c_int; 29],
+        _align: [u64; 0],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t,
+    }
+
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<unsafe extern "C" fn()>,
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::c_ushort,
+        __pad1: ::c_ushort,
+        pub __seq: ::c_ushort,
+        __pad2: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong,
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused5: ::c_ulong,
+        __unused6: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __unused1: ::c_int,
+        pub msg_rtime: ::time_t,
+        __unused2: ::c_int,
+        pub msg_ctime: ::time_t,
+        __unused3: ::c_int,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+}
+
+//pub const RLIM_INFINITY: ::rlim_t = !0;
+pub const VEOF: usize = 4;
+pub const RTLD_DEEPBIND: ::c_int = 0x8;
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+pub const TIOCGSOFTCAR: ::c_ulong = 21529;
+pub const TIOCSSOFTCAR: ::c_ulong = 21530;
+pub const TIOCGRS485: ::c_int = 21550;
+pub const TIOCSRS485: ::c_int = 21551;
+//pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
+//pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
+//pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
+//pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
+//pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
+pub const O_APPEND: ::c_int = 1024;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_FSYNC: ::c_int = 1052672;
+pub const MAP_GROWSDOWN: ::c_int = 256;
+pub const EDEADLK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EBADMSG: ::c_int = 74;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const EHWPOISON: ::c_int = 133;
+pub const ERFKILL: ::c_int = 132;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+pub const SA_ONSTACK: ::c_int = 8;
+pub const SA_SIGINFO: ::c_int = 4;
+pub const SA_NOCLDWAIT: ::c_int = 2;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0;
+pub const SIG_UNBLOCK: ::c_int = 1;
+pub const POLLWRNORM: ::c_short = 256;
+pub const POLLWRBAND: ::c_short = 512;
+pub const O_ASYNC: ::c_int = 8192;
+pub const O_NDELAY: ::c_int = 2048;
+pub const EFD_NONBLOCK: ::c_int = 2048;
+pub const F_SETOWN: ::c_int = 8;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_GETLK: ::c_int = 12;
+pub const F_SETLK: ::c_int = 13;
+pub const F_SETLKW: ::c_int = 14;
+pub const SFD_NONBLOCK: ::c_int = 2048;
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+pub const TIOCLINUX: ::c_ulong = 21532;
+pub const TIOCGSERIAL: ::c_ulong = 21534;
+pub const TIOCEXCL: ::c_ulong = 21516;
+pub const TIOCNXCL: ::c_ulong = 21517;
+pub const TIOCSCTTY: ::c_ulong = 21518;
+pub const TIOCSTI: ::c_ulong = 21522;
+pub const TIOCMGET: ::c_ulong = 21525;
+pub const TIOCMBIS: ::c_ulong = 21526;
+pub const TIOCMBIC: ::c_ulong = 21527;
+pub const TIOCMSET: ::c_ulong = 21528;
+pub const TIOCCONS: ::c_ulong = 21533;
+pub const TIOCM_ST: ::c_int = 8;
+pub const TIOCM_SR: ::c_int = 16;
+pub const TIOCM_CTS: ::c_int = 32;
+pub const TIOCM_CAR: ::c_int = 64;
+pub const TIOCM_RNG: ::c_int = 128;
+pub const TIOCM_DSR: ::c_int = 256;
+
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
+pub const O_DIRECT: ::c_int = 16384;
+pub const O_DIRECTORY: ::c_int = 65536;
+pub const O_LARGEFILE: ::c_int = 0o0100000;
+pub const O_NOFOLLOW: ::c_int = 131072;
+pub const MAP_HUGETLB: ::c_int = 262144;
+pub const MAP_LOCKED: ::c_int = 8192;
+pub const MAP_NORESERVE: ::c_int = 16384;
+pub const MAP_ANON: ::c_int = 32;
+pub const MAP_ANONYMOUS: ::c_int = 32;
+pub const MAP_DENYWRITE: ::c_int = 2048;
+pub const MAP_EXECUTABLE: ::c_int = 4096;
+pub const MAP_POPULATE: ::c_int = 32768;
+pub const MAP_NONBLOCK: ::c_int = 65536;
+pub const MAP_STACK: ::c_int = 131072;
+pub const MAP_SYNC: ::c_int = 0x080000;
+pub const EDEADLOCK: ::c_int = 35;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const FIOCLEX: ::c_int = 21585;
+pub const FIONCLEX: ::c_int = 21584;
+pub const FIONBIO: ::c_int = 21537;
+pub const MCL_CURRENT: ::c_int = 1;
+pub const MCL_FUTURE: ::c_int = 2;
+pub const MCL_ONFAULT: ::c_int = 4;
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+pub const CBAUD: ::tcflag_t = 4111;
+pub const TAB1: ::tcflag_t = 2048;
+pub const TAB2: ::tcflag_t = 4096;
+pub const TAB3: ::tcflag_t = 6144;
+pub const CR1: ::tcflag_t = 512;
+pub const CR2: ::tcflag_t = 1024;
+pub const CR3: ::tcflag_t = 1536;
+pub const FF1: ::tcflag_t = 32768;
+pub const BS1: ::tcflag_t = 8192;
+pub const VT1: ::tcflag_t = 16384;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 1024;
+pub const IXOFF: ::tcflag_t = 4096;
+pub const ONLCR: ::tcflag_t = 4;
+pub const CSIZE: ::tcflag_t = 48;
+pub const CS6: ::tcflag_t = 16;
+pub const CS7: ::tcflag_t = 32;
+pub const CS8: ::tcflag_t = 48;
+pub const CSTOPB: ::tcflag_t = 64;
+pub const CREAD: ::tcflag_t = 128;
+pub const PARENB: ::tcflag_t = 256;
+pub const PARODD: ::tcflag_t = 512;
+pub const HUPCL: ::tcflag_t = 1024;
+pub const CLOCAL: ::tcflag_t = 2048;
+pub const ECHOKE: ::tcflag_t = 2048;
+pub const ECHOE: ::tcflag_t = 16;
+pub const ECHOK: ::tcflag_t = 32;
+pub const ECHONL: ::tcflag_t = 64;
+pub const ECHOPRT: ::tcflag_t = 1024;
+pub const ECHOCTL: ::tcflag_t = 512;
+pub const ISIG: ::tcflag_t = 1;
+pub const ICANON: ::tcflag_t = 2;
+pub const PENDIN: ::tcflag_t = 16384;
+pub const NOFLSH: ::tcflag_t = 128;
+pub const CIBAUD: ::tcflag_t = 269418496;
+pub const CBAUDEX: ::tcflag_t = 4096;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 2;
+pub const NLDLY: ::tcflag_t = 256;
+pub const CRDLY: ::tcflag_t = 1536;
+pub const TABDLY: ::tcflag_t = 6144;
+pub const BSDLY: ::tcflag_t = 8192;
+pub const FFDLY: ::tcflag_t = 32768;
+pub const VTDLY: ::tcflag_t = 16384;
+pub const XTABS: ::tcflag_t = 6144;
+pub const B0: ::speed_t = 0;
+pub const B50: ::speed_t = 1;
+pub const B75: ::speed_t = 2;
+pub const B110: ::speed_t = 3;
+pub const B134: ::speed_t = 4;
+pub const B150: ::speed_t = 5;
+pub const B200: ::speed_t = 6;
+pub const B300: ::speed_t = 7;
+pub const B600: ::speed_t = 8;
+pub const B1200: ::speed_t = 9;
+pub const B1800: ::speed_t = 10;
+pub const B2400: ::speed_t = 11;
+pub const B4800: ::speed_t = 12;
+pub const B9600: ::speed_t = 13;
+pub const B19200: ::speed_t = 14;
+pub const B38400: ::speed_t = 15;
+pub const EXTA: ::speed_t = 14;
+pub const EXTB: ::speed_t = 15;
+pub const B57600: ::speed_t = 4097;
+pub const B115200: ::speed_t = 4098;
+pub const B230400: ::speed_t = 4099;
+pub const B460800: ::speed_t = 4100;
+pub const B500000: ::speed_t = 4101;
+pub const B576000: ::speed_t = 4102;
+pub const B921600: ::speed_t = 4103;
+pub const B1000000: ::speed_t = 4104;
+pub const B1152000: ::speed_t = 4105;
+pub const B1500000: ::speed_t = 4106;
+pub const B2000000: ::speed_t = 4107;
+pub const B2500000: ::speed_t = 4108;
+pub const B3000000: ::speed_t = 4109;
+pub const B3500000: ::speed_t = 4110;
+pub const B4000000: ::speed_t = 4111;
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 32768;
+pub const TOSTOP: ::tcflag_t = 256;
+pub const FLUSHO: ::tcflag_t = 4096;
+pub const EXTPROC: ::tcflag_t = 65536;
+pub const TCGETS: ::c_int = 21505;
+pub const TCSETS: ::c_int = 21506;
+pub const TCSETSW: ::c_int = 21507;
+pub const TCSETSF: ::c_int = 21508;
+pub const TCGETA: ::c_int = 21509;
+pub const TCSETA: ::c_int = 21510;
+pub const TCSETAW: ::c_int = 21511;
+pub const TCSETAF: ::c_int = 21512;
+pub const TCSBRK: ::c_int = 21513;
+pub const TCXONC: ::c_int = 21514;
+pub const TCFLSH: ::c_int = 21515;
+pub const TIOCINQ: ::c_int = 21531;
+pub const TIOCGPGRP: ::c_int = 21519;
+pub const TIOCSPGRP: ::c_int = 21520;
+pub const TIOCOUTQ: ::c_int = 21521;
+pub const TIOCGWINSZ: ::c_int = 21523;
+pub const TIOCSWINSZ: ::c_int = 21524;
+pub const FIONREAD: ::c_int = 21531;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
+
+pub const SYS_read: ::c_long = 63;
+pub const SYS_write: ::c_long = 64;
+pub const SYS_close: ::c_long = 57;
+pub const SYS_fstat: ::c_long = 80;
+pub const SYS_lseek: ::c_long = 62;
+pub const SYS_mmap: ::c_long = 222;
+pub const SYS_mprotect: ::c_long = 226;
+pub const SYS_munmap: ::c_long = 215;
+pub const SYS_brk: ::c_long = 214;
+pub const SYS_rt_sigaction: ::c_long = 134;
+pub const SYS_rt_sigprocmask: ::c_long = 135;
+pub const SYS_rt_sigreturn: ::c_long = 139;
+pub const SYS_ioctl: ::c_long = 29;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_readv: ::c_long = 65;
+pub const SYS_writev: ::c_long = 66;
+pub const SYS_sched_yield: ::c_long = 124;
+pub const SYS_mremap: ::c_long = 216;
+pub const SYS_msync: ::c_long = 227;
+pub const SYS_mincore: ::c_long = 232;
+pub const SYS_madvise: ::c_long = 233;
+pub const SYS_shmget: ::c_long = 194;
+pub const SYS_shmat: ::c_long = 196;
+pub const SYS_shmctl: ::c_long = 195;
+pub const SYS_dup: ::c_long = 23;
+pub const SYS_nanosleep: ::c_long = 101;
+pub const SYS_getitimer: ::c_long = 102;
+pub const SYS_setitimer: ::c_long = 103;
+pub const SYS_getpid: ::c_long = 172;
+pub const SYS_sendfile: ::c_long = 71;
+pub const SYS_socket: ::c_long = 198;
+pub const SYS_connect: ::c_long = 203;
+pub const SYS_accept: ::c_long = 202;
+pub const SYS_sendto: ::c_long = 206;
+pub const SYS_recvfrom: ::c_long = 207;
+pub const SYS_sendmsg: ::c_long = 211;
+pub const SYS_recvmsg: ::c_long = 212;
+pub const SYS_shutdown: ::c_long = 210;
+pub const SYS_bind: ::c_long = 200;
+pub const SYS_listen: ::c_long = 201;
+pub const SYS_getsockname: ::c_long = 204;
+pub const SYS_getpeername: ::c_long = 205;
+pub const SYS_socketpair: ::c_long = 199;
+pub const SYS_setsockopt: ::c_long = 208;
+pub const SYS_getsockopt: ::c_long = 209;
+pub const SYS_clone: ::c_long = 220;
+pub const SYS_execve: ::c_long = 221;
+pub const SYS_exit: ::c_long = 93;
+pub const SYS_wait4: ::c_long = 260;
+pub const SYS_kill: ::c_long = 129;
+pub const SYS_uname: ::c_long = 160;
+pub const SYS_semget: ::c_long = 190;
+pub const SYS_semop: ::c_long = 193;
+pub const SYS_semctl: ::c_long = 191;
+pub const SYS_shmdt: ::c_long = 197;
+pub const SYS_msgget: ::c_long = 186;
+pub const SYS_msgsnd: ::c_long = 189;
+pub const SYS_msgrcv: ::c_long = 188;
+pub const SYS_msgctl: ::c_long = 187;
+pub const SYS_fcntl: ::c_long = 25;
+pub const SYS_flock: ::c_long = 32;
+pub const SYS_fsync: ::c_long = 82;
+pub const SYS_fdatasync: ::c_long = 83;
+pub const SYS_truncate: ::c_long = 45;
+pub const SYS_ftruncate: ::c_long = 46;
+pub const SYS_getcwd: ::c_long = 17;
+pub const SYS_chdir: ::c_long = 49;
+pub const SYS_fchdir: ::c_long = 50;
+pub const SYS_fchmod: ::c_long = 52;
+pub const SYS_fchown: ::c_long = 55;
+pub const SYS_umask: ::c_long = 166;
+pub const SYS_gettimeofday: ::c_long = 169;
+pub const SYS_getrlimit: ::c_long = 163;
+pub const SYS_getrusage: ::c_long = 165;
+pub const SYS_sysinfo: ::c_long = 179;
+pub const SYS_times: ::c_long = 153;
+pub const SYS_ptrace: ::c_long = 117;
+pub const SYS_getuid: ::c_long = 174;
+pub const SYS_syslog: ::c_long = 116;
+pub const SYS_getgid: ::c_long = 176;
+pub const SYS_setuid: ::c_long = 146;
+pub const SYS_setgid: ::c_long = 144;
+pub const SYS_geteuid: ::c_long = 175;
+pub const SYS_getegid: ::c_long = 177;
+pub const SYS_setpgid: ::c_long = 154;
+pub const SYS_getppid: ::c_long = 173;
+pub const SYS_setsid: ::c_long = 157;
+pub const SYS_setreuid: ::c_long = 145;
+pub const SYS_setregid: ::c_long = 143;
+pub const SYS_getgroups: ::c_long = 158;
+pub const SYS_setgroups: ::c_long = 159;
+pub const SYS_setresuid: ::c_long = 147;
+pub const SYS_getresuid: ::c_long = 148;
+pub const SYS_setresgid: ::c_long = 149;
+pub const SYS_getresgid: ::c_long = 150;
+pub const SYS_getpgid: ::c_long = 155;
+pub const SYS_setfsuid: ::c_long = 151;
+pub const SYS_setfsgid: ::c_long = 152;
+pub const SYS_getsid: ::c_long = 156;
+pub const SYS_capget: ::c_long = 90;
+pub const SYS_capset: ::c_long = 91;
+pub const SYS_rt_sigpending: ::c_long = 136;
+pub const SYS_rt_sigtimedwait: ::c_long = 137;
+pub const SYS_rt_sigqueueinfo: ::c_long = 138;
+pub const SYS_rt_sigsuspend: ::c_long = 133;
+pub const SYS_sigaltstack: ::c_long = 132;
+pub const SYS_personality: ::c_long = 92;
+pub const SYS_statfs: ::c_long = 43;
+pub const SYS_fstatfs: ::c_long = 44;
+pub const SYS_getpriority: ::c_long = 141;
+pub const SYS_setpriority: ::c_long = 140;
+pub const SYS_sched_setparam: ::c_long = 118;
+pub const SYS_sched_getparam: ::c_long = 121;
+pub const SYS_sched_setscheduler: ::c_long = 119;
+pub const SYS_sched_getscheduler: ::c_long = 120;
+pub const SYS_sched_get_priority_max: ::c_long = 125;
+pub const SYS_sched_get_priority_min: ::c_long = 126;
+pub const SYS_sched_rr_get_interval: ::c_long = 127;
+pub const SYS_mlock: ::c_long = 228;
+pub const SYS_munlock: ::c_long = 229;
+pub const SYS_mlockall: ::c_long = 230;
+pub const SYS_munlockall: ::c_long = 231;
+pub const SYS_vhangup: ::c_long = 58;
+pub const SYS_pivot_root: ::c_long = 41;
+pub const SYS_prctl: ::c_long = 167;
+pub const SYS_adjtimex: ::c_long = 171;
+pub const SYS_setrlimit: ::c_long = 164;
+pub const SYS_chroot: ::c_long = 51;
+pub const SYS_sync: ::c_long = 81;
+pub const SYS_acct: ::c_long = 89;
+pub const SYS_settimeofday: ::c_long = 170;
+pub const SYS_mount: ::c_long = 40;
+pub const SYS_umount2: ::c_long = 39;
+pub const SYS_swapon: ::c_long = 224;
+pub const SYS_swapoff: ::c_long = 225;
+pub const SYS_reboot: ::c_long = 142;
+pub const SYS_sethostname: ::c_long = 161;
+pub const SYS_setdomainname: ::c_long = 162;
+pub const SYS_init_module: ::c_long = 105;
+pub const SYS_delete_module: ::c_long = 106;
+pub const SYS_quotactl: ::c_long = 60;
+pub const SYS_nfsservctl: ::c_long = 42;
+pub const SYS_gettid: ::c_long = 178;
+pub const SYS_readahead: ::c_long = 213;
+pub const SYS_setxattr: ::c_long = 5;
+pub const SYS_lsetxattr: ::c_long = 6;
+pub const SYS_fsetxattr: ::c_long = 7;
+pub const SYS_getxattr: ::c_long = 8;
+pub const SYS_lgetxattr: ::c_long = 9;
+pub const SYS_fgetxattr: ::c_long = 10;
+pub const SYS_listxattr: ::c_long = 11;
+pub const SYS_llistxattr: ::c_long = 12;
+pub const SYS_flistxattr: ::c_long = 13;
+pub const SYS_removexattr: ::c_long = 14;
+pub const SYS_lremovexattr: ::c_long = 15;
+pub const SYS_fremovexattr: ::c_long = 16;
+pub const SYS_tkill: ::c_long = 130;
+pub const SYS_futex: ::c_long = 98;
+pub const SYS_sched_setaffinity: ::c_long = 122;
+pub const SYS_sched_getaffinity: ::c_long = 123;
+pub const SYS_io_setup: ::c_long = 0;
+pub const SYS_io_destroy: ::c_long = 1;
+pub const SYS_io_getevents: ::c_long = 4;
+pub const SYS_io_submit: ::c_long = 2;
+pub const SYS_io_cancel: ::c_long = 3;
+pub const SYS_lookup_dcookie: ::c_long = 18;
+pub const SYS_remap_file_pages: ::c_long = 234;
+pub const SYS_getdents64: ::c_long = 61;
+pub const SYS_set_tid_address: ::c_long = 96;
+pub const SYS_restart_syscall: ::c_long = 128;
+pub const SYS_semtimedop: ::c_long = 192;
+pub const SYS_fadvise64: ::c_long = 223;
+pub const SYS_timer_create: ::c_long = 107;
+pub const SYS_timer_settime: ::c_long = 110;
+pub const SYS_timer_gettime: ::c_long = 108;
+pub const SYS_timer_getoverrun: ::c_long = 109;
+pub const SYS_timer_delete: ::c_long = 111;
+pub const SYS_clock_settime: ::c_long = 112;
+pub const SYS_clock_gettime: ::c_long = 113;
+pub const SYS_clock_getres: ::c_long = 114;
+pub const SYS_clock_nanosleep: ::c_long = 115;
+pub const SYS_exit_group: ::c_long = 94;
+pub const SYS_epoll_ctl: ::c_long = 21;
+pub const SYS_tgkill: ::c_long = 131;
+pub const SYS_mbind: ::c_long = 235;
+pub const SYS_set_mempolicy: ::c_long = 237;
+pub const SYS_get_mempolicy: ::c_long = 236;
+pub const SYS_mq_open: ::c_long = 180;
+pub const SYS_mq_unlink: ::c_long = 181;
+pub const SYS_mq_timedsend: ::c_long = 182;
+pub const SYS_mq_timedreceive: ::c_long = 183;
+pub const SYS_mq_notify: ::c_long = 184;
+pub const SYS_mq_getsetattr: ::c_long = 185;
+pub const SYS_kexec_load: ::c_long = 104;
+pub const SYS_waitid: ::c_long = 95;
+pub const SYS_add_key: ::c_long = 217;
+pub const SYS_request_key: ::c_long = 218;
+pub const SYS_keyctl: ::c_long = 219;
+pub const SYS_ioprio_set: ::c_long = 30;
+pub const SYS_ioprio_get: ::c_long = 31;
+pub const SYS_inotify_add_watch: ::c_long = 27;
+pub const SYS_inotify_rm_watch: ::c_long = 28;
+pub const SYS_migrate_pages: ::c_long = 238;
+pub const SYS_openat: ::c_long = 56;
+pub const SYS_mkdirat: ::c_long = 34;
+pub const SYS_mknodat: ::c_long = 33;
+pub const SYS_fchownat: ::c_long = 54;
+pub const SYS_newfstatat: ::c_long = 79;
+pub const SYS_unlinkat: ::c_long = 35;
+pub const SYS_linkat: ::c_long = 37;
+pub const SYS_symlinkat: ::c_long = 36;
+pub const SYS_readlinkat: ::c_long = 78;
+pub const SYS_fchmodat: ::c_long = 53;
+pub const SYS_faccessat: ::c_long = 48;
+pub const SYS_pselect6: ::c_long = 72;
+pub const SYS_ppoll: ::c_long = 73;
+pub const SYS_unshare: ::c_long = 97;
+pub const SYS_set_robust_list: ::c_long = 99;
+pub const SYS_get_robust_list: ::c_long = 100;
+pub const SYS_splice: ::c_long = 76;
+pub const SYS_tee: ::c_long = 77;
+pub const SYS_sync_file_range: ::c_long = 84;
+pub const SYS_vmsplice: ::c_long = 75;
+pub const SYS_move_pages: ::c_long = 239;
+pub const SYS_utimensat: ::c_long = 88;
+pub const SYS_epoll_pwait: ::c_long = 22;
+pub const SYS_timerfd_create: ::c_long = 85;
+pub const SYS_fallocate: ::c_long = 47;
+pub const SYS_timerfd_settime: ::c_long = 86;
+pub const SYS_timerfd_gettime: ::c_long = 87;
+pub const SYS_accept4: ::c_long = 242;
+pub const SYS_signalfd4: ::c_long = 74;
+pub const SYS_eventfd2: ::c_long = 19;
+pub const SYS_epoll_create1: ::c_long = 20;
+pub const SYS_dup3: ::c_long = 24;
+pub const SYS_pipe2: ::c_long = 59;
+pub const SYS_inotify_init1: ::c_long = 26;
+pub const SYS_preadv: ::c_long = 69;
+pub const SYS_pwritev: ::c_long = 70;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
+pub const SYS_perf_event_open: ::c_long = 241;
+pub const SYS_recvmmsg: ::c_long = 243;
+pub const SYS_fanotify_init: ::c_long = 262;
+pub const SYS_fanotify_mark: ::c_long = 263;
+pub const SYS_prlimit64: ::c_long = 261;
+pub const SYS_name_to_handle_at: ::c_long = 264;
+pub const SYS_open_by_handle_at: ::c_long = 265;
+pub const SYS_clock_adjtime: ::c_long = 266;
+pub const SYS_syncfs: ::c_long = 267;
+pub const SYS_sendmmsg: ::c_long = 269;
+pub const SYS_setns: ::c_long = 268;
+pub const SYS_getcpu: ::c_long = 168;
+pub const SYS_process_vm_readv: ::c_long = 270;
+pub const SYS_process_vm_writev: ::c_long = 271;
+pub const SYS_kcmp: ::c_long = 272;
+pub const SYS_finit_module: ::c_long = 273;
+pub const SYS_sched_setattr: ::c_long = 274;
+pub const SYS_sched_getattr: ::c_long = 275;
+pub const SYS_renameat2: ::c_long = 276;
+pub const SYS_seccomp: ::c_long = 277;
+pub const SYS_getrandom: ::c_long = 278;
+pub const SYS_memfd_create: ::c_long = 279;
+pub const SYS_bpf: ::c_long = 280;
+pub const SYS_execveat: ::c_long = 281;
+pub const SYS_userfaultfd: ::c_long = 282;
+pub const SYS_membarrier: ::c_long = 283;
+pub const SYS_mlock2: ::c_long = 284;
+pub const SYS_copy_file_range: ::c_long = 285;
+pub const SYS_preadv2: ::c_long = 286;
+pub const SYS_pwritev2: ::c_long = 287;
+pub const SYS_pkey_mprotect: ::c_long = 288;
+pub const SYS_pkey_alloc: ::c_long = 289;
+pub const SYS_pkey_free: ::c_long = 290;
+pub const SYS_statx: ::c_long = 291;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/x86/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/x86/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/x86/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/x86/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(8))]
+    pub struct max_align_t {
+        priv_: [f64; 3]
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,968 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        __st_dev_padding: ::c_int,
+        __st_ino_truncated: ::c_long,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __st_rdev_padding: ::c_int,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_ino: ::ino_t,
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        __st_dev_padding: ::c_int,
+        __st_ino_truncated: ::c_long,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __st_rdev_padding: ::c_int,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_ino: ::ino_t,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t
+    }
+
+    pub struct ipc_perm {
+        pub __ipc_perm_key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_int,
+        __unused1: ::c_long,
+        __unused2: ::c_long
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        __unused1: ::c_int,
+        pub shm_dtime: ::time_t,
+        __unused2: ::c_int,
+        pub shm_ctime: ::time_t,
+        __unused3: ::c_int,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::c_ulong,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __unused1: ::c_int,
+        pub msg_rtime: ::time_t,
+        __unused2: ::c_int,
+        pub msg_ctime: ::time_t,
+        __unused3: ::c_int,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 4],
+    }
+
+    pub struct mcontext_t {
+        __private: [u32; 22]
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        pub _pad: [::c_int; 29],
+        _align: [usize; 0],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 4],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        __f_unused: ::c_int,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+}
+
+s_no_extra_traits! {
+    pub struct user_fpxregs_struct {
+        pub cwd: ::c_ushort,
+        pub swd: ::c_ushort,
+        pub twd: ::c_ushort,
+        pub fop: ::c_ushort,
+        pub fip: ::c_long,
+        pub fcs: ::c_long,
+        pub foo: ::c_long,
+        pub fos: ::c_long,
+        pub mxcsr: ::c_long,
+        __reserved: ::c_long,
+        pub st_space: [::c_long; 32],
+        pub xmm_space: [::c_long; 32],
+        padding: [::c_long; 56],
+    }
+
+    pub struct ucontext_t {
+        pub uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_mcontext: mcontext_t,
+        pub uc_sigmask: ::sigset_t,
+        __private: [u8; 112],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for user_fpxregs_struct {
+            fn eq(&self, other: &user_fpxregs_struct) -> bool {
+                self.cwd == other.cwd
+                    && self.swd == other.swd
+                    && self.twd == other.twd
+                    && self.fop == other.fop
+                    && self.fip == other.fip
+                    && self.fcs == other.fcs
+                    && self.foo == other.foo
+                    && self.fos == other.fos
+                    && self.mxcsr == other.mxcsr
+                // Ignore __reserved field
+                    && self.st_space == other.st_space
+                    && self.xmm_space == other.xmm_space
+                // Ignore padding field
+            }
+        }
+
+        impl Eq for user_fpxregs_struct {}
+
+        impl ::fmt::Debug for user_fpxregs_struct {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("user_fpxregs_struct")
+                    .field("cwd", &self.cwd)
+                    .field("swd", &self.swd)
+                    .field("twd", &self.twd)
+                    .field("fop", &self.fop)
+                    .field("fip", &self.fip)
+                    .field("fcs", &self.fcs)
+                    .field("foo", &self.foo)
+                    .field("fos", &self.fos)
+                    .field("mxcsr", &self.mxcsr)
+                // Ignore __reserved field
+                    .field("st_space", &self.st_space)
+                    .field("xmm_space", &self.xmm_space)
+                // Ignore padding field
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for user_fpxregs_struct {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.cwd.hash(state);
+                self.swd.hash(state);
+                self.twd.hash(state);
+                self.fop.hash(state);
+                self.fip.hash(state);
+                self.fcs.hash(state);
+                self.foo.hash(state);
+                self.fos.hash(state);
+                self.mxcsr.hash(state);
+                // Ignore __reserved field
+                self.st_space.hash(state);
+                self.xmm_space.hash(state);
+                // Ignore padding field
+            }
+        }
+
+        impl PartialEq for ucontext_t {
+            fn eq(&self, other: &ucontext_t) -> bool {
+                self.uc_flags == other.uc_flags
+                    && self.uc_link == other.uc_link
+                    && self.uc_stack == other.uc_stack
+                    && self.uc_mcontext == other.uc_mcontext
+                    && self.uc_sigmask == other.uc_sigmask
+                    && self
+                    .__private
+                    .iter()
+                    .zip(other.__private.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for ucontext_t {}
+
+        impl ::fmt::Debug for ucontext_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ucontext_t")
+                    .field("uc_flags", &self.uc_flags)
+                    .field("uc_link", &self.uc_link)
+                    .field("uc_stack", &self.uc_stack)
+                    .field("uc_mcontext", &self.uc_mcontext)
+                    .field("uc_sigmask", &self.uc_sigmask)
+                // Ignore __private field
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for ucontext_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.uc_flags.hash(state);
+                self.uc_link.hash(state);
+                self.uc_stack.hash(state);
+                self.uc_mcontext.hash(state);
+                self.uc_sigmask.hash(state);
+                self.__private.hash(state);
+            }
+        }
+    }
+}
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+
+pub const O_DIRECT: ::c_int = 0x4000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+pub const O_ASYNC: ::c_int = 0x2000;
+pub const O_LARGEFILE: ::c_int = 0o0100000;
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::c_int = 0x00000800;
+pub const TAB2: ::c_int = 0x00001000;
+pub const TAB3: ::c_int = 0x00001800;
+pub const CR1: ::c_int = 0x00000200;
+pub const CR2: ::c_int = 0x00000400;
+pub const CR3: ::c_int = 0x00000600;
+pub const FF1: ::c_int = 0x00008000;
+pub const BS1: ::c_int = 0x00002000;
+pub const VT1: ::c_int = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const O_APPEND: ::c_int = 1024;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_LOCKED: ::c_int = 0x02000;
+pub const MAP_NORESERVE: ::c_int = 0x04000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const EDEADLK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EDEADLOCK: ::c_int = EDEADLK;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EBADMSG: ::c_int = 74;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const ERFKILL: ::c_int = 132;
+pub const EHWPOISON: ::c_int = 133;
+
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_32BIT: ::c_int = 0x0040;
+
+pub const F_GETLK: ::c_int = 12;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETLK: ::c_int = 13;
+pub const F_SETLKW: ::c_int = 14;
+pub const F_SETOWN: ::c_int = 8;
+
+pub const VEOF: usize = 4;
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const PTRACE_SYSEMU: ::c_int = 31;
+pub const PTRACE_SYSEMU_SINGLESTEP: ::c_int = 32;
+
+// Syscall table
+pub const SYS_restart_syscall: ::c_long = 0;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_waitpid: ::c_long = 7;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execve: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_time: ::c_long = 13;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lchown: ::c_long = 16;
+pub const SYS_break: ::c_long = 17;
+pub const SYS_oldstat: ::c_long = 18;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_mount: ::c_long = 21;
+pub const SYS_umount: ::c_long = 22;
+pub const SYS_setuid: ::c_long = 23;
+pub const SYS_getuid: ::c_long = 24;
+pub const SYS_stime: ::c_long = 25;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_alarm: ::c_long = 27;
+pub const SYS_oldfstat: ::c_long = 28;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_utime: ::c_long = 30;
+pub const SYS_stty: ::c_long = 31;
+pub const SYS_gtty: ::c_long = 32;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_ftime: ::c_long = 35;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_prof: ::c_long = 44;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_setgid: ::c_long = 46;
+pub const SYS_getgid: ::c_long = 47;
+pub const SYS_signal: ::c_long = 48;
+pub const SYS_geteuid: ::c_long = 49;
+pub const SYS_getegid: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount2: ::c_long = 52;
+pub const SYS_lock: ::c_long = 53;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_mpx: ::c_long = 56;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_ulimit: ::c_long = 58;
+pub const SYS_oldolduname: ::c_long = 59;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_sgetmask: ::c_long = 68;
+pub const SYS_ssetmask: ::c_long = 69;
+pub const SYS_setreuid: ::c_long = 70;
+pub const SYS_setregid: ::c_long = 71;
+pub const SYS_sigsuspend: ::c_long = 72;
+pub const SYS_sigpending: ::c_long = 73;
+pub const SYS_sethostname: ::c_long = 74;
+pub const SYS_setrlimit: ::c_long = 75;
+pub const SYS_getrlimit: ::c_long = 76;
+pub const SYS_getrusage: ::c_long = 77;
+pub const SYS_gettimeofday: ::c_long = 78;
+pub const SYS_settimeofday: ::c_long = 79;
+pub const SYS_getgroups: ::c_long = 80;
+pub const SYS_setgroups: ::c_long = 81;
+pub const SYS_select: ::c_long = 82;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_oldlstat: ::c_long = 84;
+pub const SYS_readlink: ::c_long = 85;
+pub const SYS_uselib: ::c_long = 86;
+pub const SYS_swapon: ::c_long = 87;
+pub const SYS_reboot: ::c_long = 88;
+pub const SYS_readdir: ::c_long = 89;
+pub const SYS_mmap: ::c_long = 90;
+pub const SYS_munmap: ::c_long = 91;
+pub const SYS_truncate: ::c_long = 92;
+pub const SYS_ftruncate: ::c_long = 93;
+pub const SYS_fchmod: ::c_long = 94;
+pub const SYS_fchown: ::c_long = 95;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_profil: ::c_long = 98;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_ioperm: ::c_long = 101;
+pub const SYS_socketcall: ::c_long = 102;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_setitimer: ::c_long = 104;
+pub const SYS_getitimer: ::c_long = 105;
+pub const SYS_stat: ::c_long = 106;
+pub const SYS_lstat: ::c_long = 107;
+pub const SYS_fstat: ::c_long = 108;
+pub const SYS_olduname: ::c_long = 109;
+pub const SYS_iopl: ::c_long = 110;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_idle: ::c_long = 112;
+pub const SYS_vm86old: ::c_long = 113;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_ipc: ::c_long = 117;
+pub const SYS_fsync: ::c_long = 118;
+pub const SYS_sigreturn: ::c_long = 119;
+pub const SYS_clone: ::c_long = 120;
+pub const SYS_setdomainname: ::c_long = 121;
+pub const SYS_uname: ::c_long = 122;
+pub const SYS_modify_ldt: ::c_long = 123;
+pub const SYS_adjtimex: ::c_long = 124;
+pub const SYS_mprotect: ::c_long = 125;
+pub const SYS_sigprocmask: ::c_long = 126;
+pub const SYS_create_module: ::c_long = 127;
+pub const SYS_init_module: ::c_long = 128;
+pub const SYS_delete_module: ::c_long = 129;
+pub const SYS_get_kernel_syms: ::c_long = 130;
+pub const SYS_quotactl: ::c_long = 131;
+pub const SYS_getpgid: ::c_long = 132;
+pub const SYS_fchdir: ::c_long = 133;
+pub const SYS_bdflush: ::c_long = 134;
+pub const SYS_sysfs: ::c_long = 135;
+pub const SYS_personality: ::c_long = 136;
+pub const SYS_afs_syscall: ::c_long = 137;
+pub const SYS_setfsuid: ::c_long = 138;
+pub const SYS_setfsgid: ::c_long = 139;
+pub const SYS__llseek: ::c_long = 140;
+pub const SYS_getdents: ::c_long = 141;
+pub const SYS__newselect: ::c_long = 142;
+pub const SYS_flock: ::c_long = 143;
+pub const SYS_msync: ::c_long = 144;
+pub const SYS_readv: ::c_long = 145;
+pub const SYS_writev: ::c_long = 146;
+pub const SYS_getsid: ::c_long = 147;
+pub const SYS_fdatasync: ::c_long = 148;
+pub const SYS__sysctl: ::c_long = 149;
+pub const SYS_mlock: ::c_long = 150;
+pub const SYS_munlock: ::c_long = 151;
+pub const SYS_mlockall: ::c_long = 152;
+pub const SYS_munlockall: ::c_long = 153;
+pub const SYS_sched_setparam: ::c_long = 154;
+pub const SYS_sched_getparam: ::c_long = 155;
+pub const SYS_sched_setscheduler: ::c_long = 156;
+pub const SYS_sched_getscheduler: ::c_long = 157;
+pub const SYS_sched_yield: ::c_long = 158;
+pub const SYS_sched_get_priority_max: ::c_long = 159;
+pub const SYS_sched_get_priority_min: ::c_long = 160;
+pub const SYS_sched_rr_get_interval: ::c_long = 161;
+pub const SYS_nanosleep: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_setresuid: ::c_long = 164;
+pub const SYS_getresuid: ::c_long = 165;
+pub const SYS_vm86: ::c_long = 166;
+pub const SYS_query_module: ::c_long = 167;
+pub const SYS_poll: ::c_long = 168;
+pub const SYS_nfsservctl: ::c_long = 169;
+pub const SYS_setresgid: ::c_long = 170;
+pub const SYS_getresgid: ::c_long = 171;
+pub const SYS_prctl: ::c_long = 172;
+pub const SYS_rt_sigreturn: ::c_long = 173;
+pub const SYS_rt_sigaction: ::c_long = 174;
+pub const SYS_rt_sigprocmask: ::c_long = 175;
+pub const SYS_rt_sigpending: ::c_long = 176;
+pub const SYS_rt_sigtimedwait: ::c_long = 177;
+pub const SYS_rt_sigqueueinfo: ::c_long = 178;
+pub const SYS_rt_sigsuspend: ::c_long = 179;
+pub const SYS_pread64: ::c_long = 180;
+pub const SYS_pwrite64: ::c_long = 181;
+pub const SYS_chown: ::c_long = 182;
+pub const SYS_getcwd: ::c_long = 183;
+pub const SYS_capget: ::c_long = 184;
+pub const SYS_capset: ::c_long = 185;
+pub const SYS_sigaltstack: ::c_long = 186;
+pub const SYS_sendfile: ::c_long = 187;
+pub const SYS_getpmsg: ::c_long = 188;
+pub const SYS_putpmsg: ::c_long = 189;
+pub const SYS_vfork: ::c_long = 190;
+pub const SYS_ugetrlimit: ::c_long = 191;
+pub const SYS_mmap2: ::c_long = 192;
+pub const SYS_truncate64: ::c_long = 193;
+pub const SYS_ftruncate64: ::c_long = 194;
+pub const SYS_stat64: ::c_long = 195;
+pub const SYS_lstat64: ::c_long = 196;
+pub const SYS_fstat64: ::c_long = 197;
+pub const SYS_lchown32: ::c_long = 198;
+pub const SYS_getuid32: ::c_long = 199;
+pub const SYS_getgid32: ::c_long = 200;
+pub const SYS_geteuid32: ::c_long = 201;
+pub const SYS_getegid32: ::c_long = 202;
+pub const SYS_setreuid32: ::c_long = 203;
+pub const SYS_setregid32: ::c_long = 204;
+pub const SYS_getgroups32: ::c_long = 205;
+pub const SYS_setgroups32: ::c_long = 206;
+pub const SYS_fchown32: ::c_long = 207;
+pub const SYS_setresuid32: ::c_long = 208;
+pub const SYS_getresuid32: ::c_long = 209;
+pub const SYS_setresgid32: ::c_long = 210;
+pub const SYS_getresgid32: ::c_long = 211;
+pub const SYS_chown32: ::c_long = 212;
+pub const SYS_setuid32: ::c_long = 213;
+pub const SYS_setgid32: ::c_long = 214;
+pub const SYS_setfsuid32: ::c_long = 215;
+pub const SYS_setfsgid32: ::c_long = 216;
+pub const SYS_pivot_root: ::c_long = 217;
+pub const SYS_mincore: ::c_long = 218;
+pub const SYS_madvise: ::c_long = 219;
+pub const SYS_getdents64: ::c_long = 220;
+pub const SYS_fcntl64: ::c_long = 221;
+pub const SYS_gettid: ::c_long = 224;
+pub const SYS_readahead: ::c_long = 225;
+pub const SYS_setxattr: ::c_long = 226;
+pub const SYS_lsetxattr: ::c_long = 227;
+pub const SYS_fsetxattr: ::c_long = 228;
+pub const SYS_getxattr: ::c_long = 229;
+pub const SYS_lgetxattr: ::c_long = 230;
+pub const SYS_fgetxattr: ::c_long = 231;
+pub const SYS_listxattr: ::c_long = 232;
+pub const SYS_llistxattr: ::c_long = 233;
+pub const SYS_flistxattr: ::c_long = 234;
+pub const SYS_removexattr: ::c_long = 235;
+pub const SYS_lremovexattr: ::c_long = 236;
+pub const SYS_fremovexattr: ::c_long = 237;
+pub const SYS_tkill: ::c_long = 238;
+pub const SYS_sendfile64: ::c_long = 239;
+pub const SYS_futex: ::c_long = 240;
+pub const SYS_sched_setaffinity: ::c_long = 241;
+pub const SYS_sched_getaffinity: ::c_long = 242;
+pub const SYS_set_thread_area: ::c_long = 243;
+pub const SYS_get_thread_area: ::c_long = 244;
+pub const SYS_io_setup: ::c_long = 245;
+pub const SYS_io_destroy: ::c_long = 246;
+pub const SYS_io_getevents: ::c_long = 247;
+pub const SYS_io_submit: ::c_long = 248;
+pub const SYS_io_cancel: ::c_long = 249;
+pub const SYS_fadvise64: ::c_long = 250;
+pub const SYS_exit_group: ::c_long = 252;
+pub const SYS_lookup_dcookie: ::c_long = 253;
+pub const SYS_epoll_create: ::c_long = 254;
+pub const SYS_epoll_ctl: ::c_long = 255;
+pub const SYS_epoll_wait: ::c_long = 256;
+pub const SYS_remap_file_pages: ::c_long = 257;
+pub const SYS_set_tid_address: ::c_long = 258;
+pub const SYS_timer_create: ::c_long = 259;
+pub const SYS_timer_settime: ::c_long = 260;
+pub const SYS_timer_gettime: ::c_long = 261;
+pub const SYS_timer_getoverrun: ::c_long = 262;
+pub const SYS_timer_delete: ::c_long = 263;
+pub const SYS_clock_settime: ::c_long = 264;
+pub const SYS_clock_gettime: ::c_long = 265;
+pub const SYS_clock_getres: ::c_long = 266;
+pub const SYS_clock_nanosleep: ::c_long = 267;
+pub const SYS_statfs64: ::c_long = 268;
+pub const SYS_fstatfs64: ::c_long = 269;
+pub const SYS_tgkill: ::c_long = 270;
+pub const SYS_utimes: ::c_long = 271;
+pub const SYS_fadvise64_64: ::c_long = 272;
+pub const SYS_vserver: ::c_long = 273;
+pub const SYS_mbind: ::c_long = 274;
+pub const SYS_get_mempolicy: ::c_long = 275;
+pub const SYS_set_mempolicy: ::c_long = 276;
+pub const SYS_mq_open: ::c_long = 277;
+pub const SYS_mq_unlink: ::c_long = 278;
+pub const SYS_mq_timedsend: ::c_long = 279;
+pub const SYS_mq_timedreceive: ::c_long = 280;
+pub const SYS_mq_notify: ::c_long = 281;
+pub const SYS_mq_getsetattr: ::c_long = 282;
+pub const SYS_kexec_load: ::c_long = 283;
+pub const SYS_waitid: ::c_long = 284;
+pub const SYS_add_key: ::c_long = 286;
+pub const SYS_request_key: ::c_long = 287;
+pub const SYS_keyctl: ::c_long = 288;
+pub const SYS_ioprio_set: ::c_long = 289;
+pub const SYS_ioprio_get: ::c_long = 290;
+pub const SYS_inotify_init: ::c_long = 291;
+pub const SYS_inotify_add_watch: ::c_long = 292;
+pub const SYS_inotify_rm_watch: ::c_long = 293;
+pub const SYS_migrate_pages: ::c_long = 294;
+pub const SYS_openat: ::c_long = 295;
+pub const SYS_mkdirat: ::c_long = 296;
+pub const SYS_mknodat: ::c_long = 297;
+pub const SYS_fchownat: ::c_long = 298;
+pub const SYS_futimesat: ::c_long = 299;
+pub const SYS_fstatat64: ::c_long = 300;
+pub const SYS_unlinkat: ::c_long = 301;
+pub const SYS_renameat: ::c_long = 302;
+pub const SYS_linkat: ::c_long = 303;
+pub const SYS_symlinkat: ::c_long = 304;
+pub const SYS_readlinkat: ::c_long = 305;
+pub const SYS_fchmodat: ::c_long = 306;
+pub const SYS_faccessat: ::c_long = 307;
+pub const SYS_pselect6: ::c_long = 308;
+pub const SYS_ppoll: ::c_long = 309;
+pub const SYS_unshare: ::c_long = 310;
+pub const SYS_set_robust_list: ::c_long = 311;
+pub const SYS_get_robust_list: ::c_long = 312;
+pub const SYS_splice: ::c_long = 313;
+pub const SYS_sync_file_range: ::c_long = 314;
+pub const SYS_tee: ::c_long = 315;
+pub const SYS_vmsplice: ::c_long = 316;
+pub const SYS_move_pages: ::c_long = 317;
+pub const SYS_getcpu: ::c_long = 318;
+pub const SYS_epoll_pwait: ::c_long = 319;
+pub const SYS_utimensat: ::c_long = 320;
+pub const SYS_signalfd: ::c_long = 321;
+pub const SYS_timerfd_create: ::c_long = 322;
+pub const SYS_eventfd: ::c_long = 323;
+pub const SYS_fallocate: ::c_long = 324;
+pub const SYS_timerfd_settime: ::c_long = 325;
+pub const SYS_timerfd_gettime: ::c_long = 326;
+pub const SYS_signalfd4: ::c_long = 327;
+pub const SYS_eventfd2: ::c_long = 328;
+pub const SYS_epoll_create1: ::c_long = 329;
+pub const SYS_dup3: ::c_long = 330;
+pub const SYS_pipe2: ::c_long = 331;
+pub const SYS_inotify_init1: ::c_long = 332;
+pub const SYS_preadv: ::c_long = 333;
+pub const SYS_pwritev: ::c_long = 334;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 335;
+pub const SYS_perf_event_open: ::c_long = 336;
+pub const SYS_recvmmsg: ::c_long = 337;
+pub const SYS_fanotify_init: ::c_long = 338;
+pub const SYS_fanotify_mark: ::c_long = 339;
+pub const SYS_prlimit64: ::c_long = 340;
+pub const SYS_name_to_handle_at: ::c_long = 341;
+pub const SYS_open_by_handle_at: ::c_long = 342;
+pub const SYS_clock_adjtime: ::c_long = 343;
+pub const SYS_syncfs: ::c_long = 344;
+pub const SYS_sendmmsg: ::c_long = 345;
+pub const SYS_setns: ::c_long = 346;
+pub const SYS_process_vm_readv: ::c_long = 347;
+pub const SYS_process_vm_writev: ::c_long = 348;
+pub const SYS_kcmp: ::c_long = 349;
+pub const SYS_finit_module: ::c_long = 350;
+pub const SYS_sched_setattr: ::c_long = 351;
+pub const SYS_sched_getattr: ::c_long = 352;
+pub const SYS_renameat2: ::c_long = 353;
+pub const SYS_seccomp: ::c_long = 354;
+pub const SYS_getrandom: ::c_long = 355;
+pub const SYS_memfd_create: ::c_long = 356;
+pub const SYS_bpf: ::c_long = 357;
+pub const SYS_execveat: ::c_long = 358;
+pub const SYS_socket: ::c_long = 359;
+pub const SYS_socketpair: ::c_long = 360;
+pub const SYS_bind: ::c_long = 361;
+pub const SYS_connect: ::c_long = 362;
+pub const SYS_listen: ::c_long = 363;
+pub const SYS_accept4: ::c_long = 364;
+pub const SYS_getsockopt: ::c_long = 365;
+pub const SYS_setsockopt: ::c_long = 366;
+pub const SYS_getsockname: ::c_long = 367;
+pub const SYS_getpeername: ::c_long = 368;
+pub const SYS_sendto: ::c_long = 369;
+pub const SYS_sendmsg: ::c_long = 370;
+pub const SYS_recvfrom: ::c_long = 371;
+pub const SYS_recvmsg: ::c_long = 372;
+pub const SYS_shutdown: ::c_long = 373;
+pub const SYS_userfaultfd: ::c_long = 374;
+pub const SYS_membarrier: ::c_long = 375;
+pub const SYS_mlock2: ::c_long = 376;
+pub const SYS_copy_file_range: ::c_long = 377;
+pub const SYS_preadv2: ::c_long = 378;
+pub const SYS_pwritev2: ::c_long = 379;
+pub const SYS_pkey_mprotect: ::c_long = 380;
+pub const SYS_pkey_alloc: ::c_long = 381;
+pub const SYS_pkey_free: ::c_long = 382;
+pub const SYS_statx: ::c_long = 383;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+// offsets in user_regs_structs, from sys/reg.h
+pub const EBX: ::c_int = 0;
+pub const ECX: ::c_int = 1;
+pub const EDX: ::c_int = 2;
+pub const ESI: ::c_int = 3;
+pub const EDI: ::c_int = 4;
+pub const EBP: ::c_int = 5;
+pub const EAX: ::c_int = 6;
+pub const DS: ::c_int = 7;
+pub const ES: ::c_int = 8;
+pub const FS: ::c_int = 9;
+pub const GS: ::c_int = 10;
+pub const ORIG_EAX: ::c_int = 11;
+pub const EIP: ::c_int = 12;
+pub const CS: ::c_int = 13;
+pub const EFL: ::c_int = 14;
+pub const UESP: ::c_int = 15;
+pub const SS: ::c_int = 16;
+
+extern "C" {
+    pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,42 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f32; 8]
+    }
+}
+
+s! {
+    pub struct ucontext_t {
+        pub uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_mcontext: mcontext_t,
+    }
+
+    #[repr(align(16))]
+    pub struct mcontext_t {
+        pub fault_address: ::c_ulong,
+        pub regs: [::c_ulong; 31],
+        pub sp: ::c_ulong,
+        pub pc: ::c_ulong,
+        pub pstate: ::c_ulong,
+        __reserved: [[u64; 32]; 16],
+    }
+
+    #[repr(align(8))]
+    pub struct clone_args {
+        pub flags: ::c_ulonglong,
+        pub pidfd: ::c_ulonglong,
+        pub child_tid: ::c_ulonglong,
+        pub parent_tid: ::c_ulonglong,
+        pub exit_signal: ::c_ulonglong,
+        pub stack: ::c_ulonglong,
+        pub stack_size: ::c_ulonglong,
+        pub tls: ::c_ulonglong,
+        pub set_tid: ::c_ulonglong,
+        pub set_tid_size: ::c_ulonglong,
+        pub cgroup: ::c_ulonglong,
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s! {
+    pub struct user_fpsimd_struct {
+        pub vregs: [::__uint128_t; 32],
+        pub fpsr: u32,
+        pub fpcr: u32,
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,658 @@
+pub type c_char = u8;
+pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
+pub type wchar_t = u32;
+pub type nlink_t = u32;
+pub type blksize_t = ::c_int;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad0: ::c_ulong,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        __pad1: ::c_int,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_uint; 2],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad0: ::c_ulong,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        __pad1: ::c_int,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_uint; 2],
+    }
+
+    pub struct user_regs_struct {
+        pub regs: [::c_ulonglong; 31],
+        pub sp: ::c_ulonglong,
+        pub pc: ::c_ulonglong,
+        pub pstate: ::c_ulonglong,
+    }
+
+    pub struct ipc_perm {
+        pub __ipc_perm_key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong,
+    }
+}
+
+pub const O_APPEND: ::c_int = 1024;
+pub const O_DIRECT: ::c_int = 0x10000;
+pub const O_DIRECTORY: ::c_int = 0x4000;
+pub const O_LARGEFILE: ::c_int = 0x20000;
+pub const O_NOFOLLOW: ::c_int = 0x8000;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_ASYNC: ::c_int = 0x2000;
+
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EBADMSG: ::c_int = 74;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const ERFKILL: ::c_int = 132;
+pub const EHWPOISON: ::c_int = 133;
+
+// bits/hwcap.h
+pub const HWCAP_FP: ::c_ulong = 1 << 0;
+pub const HWCAP_ASIMD: ::c_ulong = 1 << 1;
+pub const HWCAP_EVTSTRM: ::c_ulong = 1 << 2;
+pub const HWCAP_AES: ::c_ulong = 1 << 3;
+pub const HWCAP_PMULL: ::c_ulong = 1 << 4;
+pub const HWCAP_SHA1: ::c_ulong = 1 << 5;
+pub const HWCAP_SHA2: ::c_ulong = 1 << 6;
+pub const HWCAP_CRC32: ::c_ulong = 1 << 7;
+pub const HWCAP_ATOMICS: ::c_ulong = 1 << 8;
+pub const HWCAP_FPHP: ::c_ulong = 1 << 9;
+pub const HWCAP_ASIMDHP: ::c_ulong = 1 << 10;
+pub const HWCAP_CPUID: ::c_ulong = 1 << 11;
+pub const HWCAP_ASIMDRDM: ::c_ulong = 1 << 12;
+pub const HWCAP_JSCVT: ::c_ulong = 1 << 13;
+pub const HWCAP_FCMA: ::c_ulong = 1 << 14;
+pub const HWCAP_LRCPC: ::c_ulong = 1 << 15;
+pub const HWCAP_DCPOP: ::c_ulong = 1 << 16;
+pub const HWCAP_SHA3: ::c_ulong = 1 << 17;
+pub const HWCAP_SM3: ::c_ulong = 1 << 18;
+pub const HWCAP_SM4: ::c_ulong = 1 << 19;
+pub const HWCAP_ASIMDDP: ::c_ulong = 1 << 20;
+pub const HWCAP_SHA512: ::c_ulong = 1 << 21;
+pub const HWCAP_SVE: ::c_ulong = 1 << 22;
+pub const HWCAP_ASIMDFHM: ::c_ulong = 1 << 23;
+pub const HWCAP_DIT: ::c_ulong = 1 << 24;
+pub const HWCAP_USCAT: ::c_ulong = 1 << 25;
+pub const HWCAP_ILRCPC: ::c_ulong = 1 << 26;
+pub const HWCAP_FLAGM: ::c_ulong = 1 << 27;
+pub const HWCAP_SSBS: ::c_ulong = 1 << 28;
+pub const HWCAP_SB: ::c_ulong = 1 << 29;
+pub const HWCAP_PACA: ::c_ulong = 1 << 30;
+pub const HWCAP_PACG: ::c_ulong = 1 << 31;
+
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_LOCKED: ::c_int = 0x02000;
+pub const MAP_NORESERVE: ::c_int = 0x04000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+pub const F_SETOWN: ::c_int = 8;
+
+pub const VEOF: usize = 4;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const MINSIGSTKSZ: ::size_t = 6144;
+pub const SIGSTKSZ: ::size_t = 12288;
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const SYS_io_setup: ::c_long = 0;
+pub const SYS_io_destroy: ::c_long = 1;
+pub const SYS_io_submit: ::c_long = 2;
+pub const SYS_io_cancel: ::c_long = 3;
+pub const SYS_io_getevents: ::c_long = 4;
+pub const SYS_setxattr: ::c_long = 5;
+pub const SYS_lsetxattr: ::c_long = 6;
+pub const SYS_fsetxattr: ::c_long = 7;
+pub const SYS_getxattr: ::c_long = 8;
+pub const SYS_lgetxattr: ::c_long = 9;
+pub const SYS_fgetxattr: ::c_long = 10;
+pub const SYS_listxattr: ::c_long = 11;
+pub const SYS_llistxattr: ::c_long = 12;
+pub const SYS_flistxattr: ::c_long = 13;
+pub const SYS_removexattr: ::c_long = 14;
+pub const SYS_lremovexattr: ::c_long = 15;
+pub const SYS_fremovexattr: ::c_long = 16;
+pub const SYS_getcwd: ::c_long = 17;
+pub const SYS_lookup_dcookie: ::c_long = 18;
+pub const SYS_eventfd2: ::c_long = 19;
+pub const SYS_epoll_create1: ::c_long = 20;
+pub const SYS_epoll_ctl: ::c_long = 21;
+pub const SYS_epoll_pwait: ::c_long = 22;
+pub const SYS_dup: ::c_long = 23;
+pub const SYS_dup3: ::c_long = 24;
+pub const SYS_fcntl: ::c_long = 25;
+pub const SYS_inotify_init1: ::c_long = 26;
+pub const SYS_inotify_add_watch: ::c_long = 27;
+pub const SYS_inotify_rm_watch: ::c_long = 28;
+pub const SYS_ioctl: ::c_long = 29;
+pub const SYS_ioprio_set: ::c_long = 30;
+pub const SYS_ioprio_get: ::c_long = 31;
+pub const SYS_flock: ::c_long = 32;
+pub const SYS_mknodat: ::c_long = 33;
+pub const SYS_mkdirat: ::c_long = 34;
+pub const SYS_unlinkat: ::c_long = 35;
+pub const SYS_symlinkat: ::c_long = 36;
+pub const SYS_linkat: ::c_long = 37;
+pub const SYS_renameat: ::c_long = 38;
+pub const SYS_umount2: ::c_long = 39;
+pub const SYS_mount: ::c_long = 40;
+pub const SYS_pivot_root: ::c_long = 41;
+pub const SYS_nfsservctl: ::c_long = 42;
+pub const SYS_statfs: ::c_long = 43;
+pub const SYS_fstatfs: ::c_long = 44;
+pub const SYS_truncate: ::c_long = 45;
+pub const SYS_ftruncate: ::c_long = 46;
+pub const SYS_fallocate: ::c_long = 47;
+pub const SYS_faccessat: ::c_long = 48;
+pub const SYS_chdir: ::c_long = 49;
+pub const SYS_fchdir: ::c_long = 50;
+pub const SYS_chroot: ::c_long = 51;
+pub const SYS_fchmod: ::c_long = 52;
+pub const SYS_fchmodat: ::c_long = 53;
+pub const SYS_fchownat: ::c_long = 54;
+pub const SYS_fchown: ::c_long = 55;
+pub const SYS_openat: ::c_long = 56;
+pub const SYS_close: ::c_long = 57;
+pub const SYS_vhangup: ::c_long = 58;
+pub const SYS_pipe2: ::c_long = 59;
+pub const SYS_quotactl: ::c_long = 60;
+pub const SYS_getdents64: ::c_long = 61;
+pub const SYS_lseek: ::c_long = 62;
+pub const SYS_read: ::c_long = 63;
+pub const SYS_write: ::c_long = 64;
+pub const SYS_readv: ::c_long = 65;
+pub const SYS_writev: ::c_long = 66;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_preadv: ::c_long = 69;
+pub const SYS_pwritev: ::c_long = 70;
+pub const SYS_pselect6: ::c_long = 72;
+pub const SYS_ppoll: ::c_long = 73;
+pub const SYS_signalfd4: ::c_long = 74;
+pub const SYS_vmsplice: ::c_long = 75;
+pub const SYS_splice: ::c_long = 76;
+pub const SYS_tee: ::c_long = 77;
+pub const SYS_readlinkat: ::c_long = 78;
+pub const SYS_newfstatat: ::c_long = 79;
+pub const SYS_fstat: ::c_long = 80;
+pub const SYS_sync: ::c_long = 81;
+pub const SYS_fsync: ::c_long = 82;
+pub const SYS_fdatasync: ::c_long = 83;
+pub const SYS_sync_file_range: ::c_long = 84;
+pub const SYS_timerfd_create: ::c_long = 85;
+pub const SYS_timerfd_settime: ::c_long = 86;
+pub const SYS_timerfd_gettime: ::c_long = 87;
+pub const SYS_utimensat: ::c_long = 88;
+pub const SYS_acct: ::c_long = 89;
+pub const SYS_capget: ::c_long = 90;
+pub const SYS_capset: ::c_long = 91;
+pub const SYS_personality: ::c_long = 92;
+pub const SYS_exit: ::c_long = 93;
+pub const SYS_exit_group: ::c_long = 94;
+pub const SYS_waitid: ::c_long = 95;
+pub const SYS_set_tid_address: ::c_long = 96;
+pub const SYS_unshare: ::c_long = 97;
+pub const SYS_futex: ::c_long = 98;
+pub const SYS_set_robust_list: ::c_long = 99;
+pub const SYS_get_robust_list: ::c_long = 100;
+pub const SYS_nanosleep: ::c_long = 101;
+pub const SYS_getitimer: ::c_long = 102;
+pub const SYS_setitimer: ::c_long = 103;
+pub const SYS_kexec_load: ::c_long = 104;
+pub const SYS_init_module: ::c_long = 105;
+pub const SYS_delete_module: ::c_long = 106;
+pub const SYS_timer_create: ::c_long = 107;
+pub const SYS_timer_gettime: ::c_long = 108;
+pub const SYS_timer_getoverrun: ::c_long = 109;
+pub const SYS_timer_settime: ::c_long = 110;
+pub const SYS_timer_delete: ::c_long = 111;
+pub const SYS_clock_settime: ::c_long = 112;
+pub const SYS_clock_gettime: ::c_long = 113;
+pub const SYS_clock_getres: ::c_long = 114;
+pub const SYS_clock_nanosleep: ::c_long = 115;
+pub const SYS_syslog: ::c_long = 116;
+pub const SYS_ptrace: ::c_long = 117;
+pub const SYS_sched_setparam: ::c_long = 118;
+pub const SYS_sched_setscheduler: ::c_long = 119;
+pub const SYS_sched_getscheduler: ::c_long = 120;
+pub const SYS_sched_getparam: ::c_long = 121;
+pub const SYS_sched_setaffinity: ::c_long = 122;
+pub const SYS_sched_getaffinity: ::c_long = 123;
+pub const SYS_sched_yield: ::c_long = 124;
+pub const SYS_sched_get_priority_max: ::c_long = 125;
+pub const SYS_sched_get_priority_min: ::c_long = 126;
+pub const SYS_sched_rr_get_interval: ::c_long = 127;
+pub const SYS_restart_syscall: ::c_long = 128;
+pub const SYS_kill: ::c_long = 129;
+pub const SYS_tkill: ::c_long = 130;
+pub const SYS_tgkill: ::c_long = 131;
+pub const SYS_sigaltstack: ::c_long = 132;
+pub const SYS_rt_sigsuspend: ::c_long = 133;
+pub const SYS_rt_sigaction: ::c_long = 134;
+pub const SYS_rt_sigprocmask: ::c_long = 135;
+pub const SYS_rt_sigpending: ::c_long = 136;
+pub const SYS_rt_sigtimedwait: ::c_long = 137;
+pub const SYS_rt_sigqueueinfo: ::c_long = 138;
+pub const SYS_rt_sigreturn: ::c_long = 139;
+pub const SYS_setpriority: ::c_long = 140;
+pub const SYS_getpriority: ::c_long = 141;
+pub const SYS_reboot: ::c_long = 142;
+pub const SYS_setregid: ::c_long = 143;
+pub const SYS_setgid: ::c_long = 144;
+pub const SYS_setreuid: ::c_long = 145;
+pub const SYS_setuid: ::c_long = 146;
+pub const SYS_setresuid: ::c_long = 147;
+pub const SYS_getresuid: ::c_long = 148;
+pub const SYS_setresgid: ::c_long = 149;
+pub const SYS_getresgid: ::c_long = 150;
+pub const SYS_setfsuid: ::c_long = 151;
+pub const SYS_setfsgid: ::c_long = 152;
+pub const SYS_times: ::c_long = 153;
+pub const SYS_setpgid: ::c_long = 154;
+pub const SYS_getpgid: ::c_long = 155;
+pub const SYS_getsid: ::c_long = 156;
+pub const SYS_setsid: ::c_long = 157;
+pub const SYS_getgroups: ::c_long = 158;
+pub const SYS_setgroups: ::c_long = 159;
+pub const SYS_uname: ::c_long = 160;
+pub const SYS_sethostname: ::c_long = 161;
+pub const SYS_setdomainname: ::c_long = 162;
+pub const SYS_getrlimit: ::c_long = 163;
+pub const SYS_setrlimit: ::c_long = 164;
+pub const SYS_getrusage: ::c_long = 165;
+pub const SYS_umask: ::c_long = 166;
+pub const SYS_prctl: ::c_long = 167;
+pub const SYS_getcpu: ::c_long = 168;
+pub const SYS_gettimeofday: ::c_long = 169;
+pub const SYS_settimeofday: ::c_long = 170;
+pub const SYS_adjtimex: ::c_long = 171;
+pub const SYS_getpid: ::c_long = 172;
+pub const SYS_getppid: ::c_long = 173;
+pub const SYS_getuid: ::c_long = 174;
+pub const SYS_geteuid: ::c_long = 175;
+pub const SYS_getgid: ::c_long = 176;
+pub const SYS_getegid: ::c_long = 177;
+pub const SYS_gettid: ::c_long = 178;
+pub const SYS_sysinfo: ::c_long = 179;
+pub const SYS_mq_open: ::c_long = 180;
+pub const SYS_mq_unlink: ::c_long = 181;
+pub const SYS_mq_timedsend: ::c_long = 182;
+pub const SYS_mq_timedreceive: ::c_long = 183;
+pub const SYS_mq_notify: ::c_long = 184;
+pub const SYS_mq_getsetattr: ::c_long = 185;
+pub const SYS_msgget: ::c_long = 186;
+pub const SYS_msgctl: ::c_long = 187;
+pub const SYS_msgrcv: ::c_long = 188;
+pub const SYS_msgsnd: ::c_long = 189;
+pub const SYS_semget: ::c_long = 190;
+pub const SYS_semctl: ::c_long = 191;
+pub const SYS_semtimedop: ::c_long = 192;
+pub const SYS_semop: ::c_long = 193;
+pub const SYS_shmget: ::c_long = 194;
+pub const SYS_shmctl: ::c_long = 195;
+pub const SYS_shmat: ::c_long = 196;
+pub const SYS_shmdt: ::c_long = 197;
+pub const SYS_socket: ::c_long = 198;
+pub const SYS_socketpair: ::c_long = 199;
+pub const SYS_bind: ::c_long = 200;
+pub const SYS_listen: ::c_long = 201;
+pub const SYS_accept: ::c_long = 202;
+pub const SYS_connect: ::c_long = 203;
+pub const SYS_getsockname: ::c_long = 204;
+pub const SYS_getpeername: ::c_long = 205;
+pub const SYS_sendto: ::c_long = 206;
+pub const SYS_recvfrom: ::c_long = 207;
+pub const SYS_setsockopt: ::c_long = 208;
+pub const SYS_getsockopt: ::c_long = 209;
+pub const SYS_shutdown: ::c_long = 210;
+pub const SYS_sendmsg: ::c_long = 211;
+pub const SYS_recvmsg: ::c_long = 212;
+pub const SYS_readahead: ::c_long = 213;
+pub const SYS_brk: ::c_long = 214;
+pub const SYS_munmap: ::c_long = 215;
+pub const SYS_mremap: ::c_long = 216;
+pub const SYS_add_key: ::c_long = 217;
+pub const SYS_request_key: ::c_long = 218;
+pub const SYS_keyctl: ::c_long = 219;
+pub const SYS_clone: ::c_long = 220;
+pub const SYS_execve: ::c_long = 221;
+pub const SYS_mmap: ::c_long = 222;
+pub const SYS_swapon: ::c_long = 224;
+pub const SYS_swapoff: ::c_long = 225;
+pub const SYS_mprotect: ::c_long = 226;
+pub const SYS_msync: ::c_long = 227;
+pub const SYS_mlock: ::c_long = 228;
+pub const SYS_munlock: ::c_long = 229;
+pub const SYS_mlockall: ::c_long = 230;
+pub const SYS_munlockall: ::c_long = 231;
+pub const SYS_mincore: ::c_long = 232;
+pub const SYS_madvise: ::c_long = 233;
+pub const SYS_remap_file_pages: ::c_long = 234;
+pub const SYS_mbind: ::c_long = 235;
+pub const SYS_get_mempolicy: ::c_long = 236;
+pub const SYS_set_mempolicy: ::c_long = 237;
+pub const SYS_migrate_pages: ::c_long = 238;
+pub const SYS_move_pages: ::c_long = 239;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
+pub const SYS_perf_event_open: ::c_long = 241;
+pub const SYS_accept4: ::c_long = 242;
+pub const SYS_recvmmsg: ::c_long = 243;
+pub const SYS_wait4: ::c_long = 260;
+pub const SYS_prlimit64: ::c_long = 261;
+pub const SYS_fanotify_init: ::c_long = 262;
+pub const SYS_fanotify_mark: ::c_long = 263;
+pub const SYS_name_to_handle_at: ::c_long = 264;
+pub const SYS_open_by_handle_at: ::c_long = 265;
+pub const SYS_clock_adjtime: ::c_long = 266;
+pub const SYS_syncfs: ::c_long = 267;
+pub const SYS_setns: ::c_long = 268;
+pub const SYS_sendmmsg: ::c_long = 269;
+pub const SYS_process_vm_readv: ::c_long = 270;
+pub const SYS_process_vm_writev: ::c_long = 271;
+pub const SYS_kcmp: ::c_long = 272;
+pub const SYS_finit_module: ::c_long = 273;
+pub const SYS_sched_setattr: ::c_long = 274;
+pub const SYS_sched_getattr: ::c_long = 275;
+pub const SYS_renameat2: ::c_long = 276;
+pub const SYS_seccomp: ::c_long = 277;
+pub const SYS_getrandom: ::c_long = 278;
+pub const SYS_memfd_create: ::c_long = 279;
+pub const SYS_bpf: ::c_long = 280;
+pub const SYS_execveat: ::c_long = 281;
+pub const SYS_userfaultfd: ::c_long = 282;
+pub const SYS_membarrier: ::c_long = 283;
+pub const SYS_mlock2: ::c_long = 284;
+pub const SYS_copy_file_range: ::c_long = 285;
+pub const SYS_preadv2: ::c_long = 286;
+pub const SYS_pwritev2: ::c_long = 287;
+pub const SYS_pkey_mprotect: ::c_long = 288;
+pub const SYS_pkey_alloc: ::c_long = 289;
+pub const SYS_pkey_free: ::c_long = 290;
+pub const SYS_statx: ::c_long = 291;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::c_int = 0x00000800;
+pub const TAB2: ::c_int = 0x00001000;
+pub const TAB3: ::c_int = 0x00001800;
+pub const CR1: ::c_int = 0x00000200;
+pub const CR2: ::c_int = 0x00000400;
+pub const CR3: ::c_int = 0x00000600;
+pub const FF1: ::c_int = 0x00008000;
+pub const BS1: ::c_int = 0x00002000;
+pub const VT1: ::c_int = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const EDEADLK: ::c_int = 35;
+pub const EDEADLOCK: ::c_int = EDEADLK;
+
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_int128)] {
+        mod int128;
+        pub use self::int128::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/loongarch64/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/loongarch64/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/loongarch64/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/loongarch64/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,40 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f64; 4]
+    }
+}
+
+s! {
+    pub struct ucontext_t {
+        pub uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_mcontext: mcontext_t,
+    }
+
+    #[repr(align(16))]
+    pub struct mcontext_t {
+        pub __pc: ::c_ulonglong,
+        pub __gregs: [::c_ulonglong; 32],
+        pub __flags: ::c_uint,
+        pub __extcontext: [::c_ulonglong; 0],
+    }
+
+    #[repr(align(8))]
+    pub struct clone_args {
+        pub flags: ::c_ulonglong,
+        pub pidfd: ::c_ulonglong,
+        pub child_tid: ::c_ulonglong,
+        pub parent_tid: ::c_ulonglong,
+        pub exit_signal: ::c_ulonglong,
+        pub stack: ::c_ulonglong,
+        pub stack_size: ::c_ulonglong,
+        pub tls: ::c_ulonglong,
+        pub set_tid: ::c_ulonglong,
+        pub set_tid_size: ::c_ulonglong,
+        pub cgroup: ::c_ulonglong,
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,669 @@
+//! LoongArch-specific definitions for 64-bit linux-like values
+
+pub type c_char = i8;
+pub type wchar_t = ::c_int;
+
+pub type nlink_t = ::c_uint;
+pub type blksize_t = ::c_int;
+pub type fsblkcnt64_t = ::c_ulong;
+pub type fsfilcnt64_t = ::c_ulong;
+pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
+
+s! {
+    pub struct pthread_attr_t {
+        __size: [::c_ulong; 7],
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad1: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        __pad2: ::c_int,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_int; 2usize],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub __pad1: ::dev_t,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub __pad2: ::c_int,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_int; 2],
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_long,
+        pub f_frsize: ::c_long,
+        pub f_flags: ::c_long,
+        pub f_spare: [::c_long; 4],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        pub f_blocks: ::fsblkcnt64_t,
+        pub f_bfree: ::fsblkcnt64_t,
+        pub f_bavail: ::fsblkcnt64_t,
+        pub f_files: ::fsfilcnt64_t,
+        pub f_ffree: ::fsfilcnt64_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_long,
+        pub f_frsize: ::c_long,
+        pub f_flags: ::c_long,
+        pub f_spare: [::c_long; 4],
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::c_uint,
+        pub __seq: ::c_ushort,
+        __pad2: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong,
+    }
+
+    pub struct user_regs_struct {
+        pub regs: [u64; 32],
+        pub orig_a0: u64,
+        pub csr_era: u64,
+        pub csr_badv: u64,
+        pub reserved: [u64; 10],
+
+    }
+
+    pub struct user_fp_struct {
+        pub fpr: [u64; 32],
+        pub fcc: u64,
+        pub fcsr: u32,
+    }
+}
+
+pub const SYS_io_setup: ::c_long = 0;
+pub const SYS_io_destroy: ::c_long = 1;
+pub const SYS_io_submit: ::c_long = 2;
+pub const SYS_io_cancel: ::c_long = 3;
+pub const SYS_io_getevents: ::c_long = 4;
+pub const SYS_setxattr: ::c_long = 5;
+pub const SYS_lsetxattr: ::c_long = 6;
+pub const SYS_fsetxattr: ::c_long = 7;
+pub const SYS_getxattr: ::c_long = 8;
+pub const SYS_lgetxattr: ::c_long = 9;
+pub const SYS_fgetxattr: ::c_long = 10;
+pub const SYS_listxattr: ::c_long = 11;
+pub const SYS_llistxattr: ::c_long = 12;
+pub const SYS_flistxattr: ::c_long = 13;
+pub const SYS_removexattr: ::c_long = 14;
+pub const SYS_lremovexattr: ::c_long = 15;
+pub const SYS_fremovexattr: ::c_long = 16;
+pub const SYS_getcwd: ::c_long = 17;
+pub const SYS_lookup_dcookie: ::c_long = 18;
+pub const SYS_eventfd2: ::c_long = 19;
+pub const SYS_epoll_create1: ::c_long = 20;
+pub const SYS_epoll_ctl: ::c_long = 21;
+pub const SYS_epoll_pwait: ::c_long = 22;
+pub const SYS_dup: ::c_long = 23;
+pub const SYS_dup3: ::c_long = 24;
+pub const SYS_fcntl: ::c_long = 25;
+pub const SYS_inotify_init1: ::c_long = 26;
+pub const SYS_inotify_add_watch: ::c_long = 27;
+pub const SYS_inotify_rm_watch: ::c_long = 28;
+pub const SYS_ioctl: ::c_long = 29;
+pub const SYS_ioprio_set: ::c_long = 30;
+pub const SYS_ioprio_get: ::c_long = 31;
+pub const SYS_flock: ::c_long = 32;
+pub const SYS_mknodat: ::c_long = 33;
+pub const SYS_mkdirat: ::c_long = 34;
+pub const SYS_unlinkat: ::c_long = 35;
+pub const SYS_symlinkat: ::c_long = 36;
+pub const SYS_linkat: ::c_long = 37;
+pub const SYS_umount2: ::c_long = 39;
+pub const SYS_mount: ::c_long = 40;
+pub const SYS_pivot_root: ::c_long = 41;
+pub const SYS_nfsservctl: ::c_long = 42;
+pub const SYS_statfs: ::c_long = 43;
+pub const SYS_fstatfs: ::c_long = 44;
+pub const SYS_truncate: ::c_long = 45;
+pub const SYS_ftruncate: ::c_long = 46;
+pub const SYS_fallocate: ::c_long = 47;
+pub const SYS_faccessat: ::c_long = 48;
+pub const SYS_chdir: ::c_long = 49;
+pub const SYS_fchdir: ::c_long = 50;
+pub const SYS_chroot: ::c_long = 51;
+pub const SYS_fchmod: ::c_long = 52;
+pub const SYS_fchmodat: ::c_long = 53;
+pub const SYS_fchownat: ::c_long = 54;
+pub const SYS_fchown: ::c_long = 55;
+pub const SYS_openat: ::c_long = 56;
+pub const SYS_close: ::c_long = 57;
+pub const SYS_vhangup: ::c_long = 58;
+pub const SYS_pipe2: ::c_long = 59;
+pub const SYS_quotactl: ::c_long = 60;
+pub const SYS_getdents64: ::c_long = 61;
+pub const SYS_lseek: ::c_long = 62;
+pub const SYS_read: ::c_long = 63;
+pub const SYS_write: ::c_long = 64;
+pub const SYS_readv: ::c_long = 65;
+pub const SYS_writev: ::c_long = 66;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_preadv: ::c_long = 69;
+pub const SYS_pwritev: ::c_long = 70;
+pub const SYS_sendfile: ::c_long = 71;
+pub const SYS_pselect6: ::c_long = 72;
+pub const SYS_ppoll: ::c_long = 73;
+pub const SYS_signalfd4: ::c_long = 74;
+pub const SYS_vmsplice: ::c_long = 75;
+pub const SYS_splice: ::c_long = 76;
+pub const SYS_tee: ::c_long = 77;
+pub const SYS_readlinkat: ::c_long = 78;
+pub const SYS_sync: ::c_long = 81;
+pub const SYS_fsync: ::c_long = 82;
+pub const SYS_fdatasync: ::c_long = 83;
+pub const SYS_sync_file_range: ::c_long = 84;
+pub const SYS_timerfd_create: ::c_long = 85;
+pub const SYS_timerfd_settime: ::c_long = 86;
+pub const SYS_timerfd_gettime: ::c_long = 87;
+pub const SYS_utimensat: ::c_long = 88;
+pub const SYS_acct: ::c_long = 89;
+pub const SYS_capget: ::c_long = 90;
+pub const SYS_capset: ::c_long = 91;
+pub const SYS_personality: ::c_long = 92;
+pub const SYS_exit: ::c_long = 93;
+pub const SYS_exit_group: ::c_long = 94;
+pub const SYS_waitid: ::c_long = 95;
+pub const SYS_set_tid_address: ::c_long = 96;
+pub const SYS_unshare: ::c_long = 97;
+pub const SYS_futex: ::c_long = 98;
+pub const SYS_set_robust_list: ::c_long = 99;
+pub const SYS_get_robust_list: ::c_long = 100;
+pub const SYS_nanosleep: ::c_long = 101;
+pub const SYS_getitimer: ::c_long = 102;
+pub const SYS_setitimer: ::c_long = 103;
+pub const SYS_kexec_load: ::c_long = 104;
+pub const SYS_init_module: ::c_long = 105;
+pub const SYS_delete_module: ::c_long = 106;
+pub const SYS_timer_create: ::c_long = 107;
+pub const SYS_timer_gettime: ::c_long = 108;
+pub const SYS_timer_getoverrun: ::c_long = 109;
+pub const SYS_timer_settime: ::c_long = 110;
+pub const SYS_timer_delete: ::c_long = 111;
+pub const SYS_clock_settime: ::c_long = 112;
+pub const SYS_clock_gettime: ::c_long = 113;
+pub const SYS_clock_getres: ::c_long = 114;
+pub const SYS_clock_nanosleep: ::c_long = 115;
+pub const SYS_syslog: ::c_long = 116;
+pub const SYS_ptrace: ::c_long = 117;
+pub const SYS_sched_setparam: ::c_long = 118;
+pub const SYS_sched_setscheduler: ::c_long = 119;
+pub const SYS_sched_getscheduler: ::c_long = 120;
+pub const SYS_sched_getparam: ::c_long = 121;
+pub const SYS_sched_setaffinity: ::c_long = 122;
+pub const SYS_sched_getaffinity: ::c_long = 123;
+pub const SYS_sched_yield: ::c_long = 124;
+pub const SYS_sched_get_priority_max: ::c_long = 125;
+pub const SYS_sched_get_priority_min: ::c_long = 126;
+pub const SYS_sched_rr_get_interval: ::c_long = 127;
+pub const SYS_restart_syscall: ::c_long = 128;
+pub const SYS_kill: ::c_long = 129;
+pub const SYS_tkill: ::c_long = 130;
+pub const SYS_tgkill: ::c_long = 131;
+pub const SYS_sigaltstack: ::c_long = 132;
+pub const SYS_rt_sigsuspend: ::c_long = 133;
+pub const SYS_rt_sigaction: ::c_long = 134;
+pub const SYS_rt_sigprocmask: ::c_long = 135;
+pub const SYS_rt_sigpending: ::c_long = 136;
+pub const SYS_rt_sigtimedwait: ::c_long = 137;
+pub const SYS_rt_sigqueueinfo: ::c_long = 138;
+pub const SYS_rt_sigreturn: ::c_long = 139;
+pub const SYS_setpriority: ::c_long = 140;
+pub const SYS_getpriority: ::c_long = 141;
+pub const SYS_reboot: ::c_long = 142;
+pub const SYS_setregid: ::c_long = 143;
+pub const SYS_setgid: ::c_long = 144;
+pub const SYS_setreuid: ::c_long = 145;
+pub const SYS_setuid: ::c_long = 146;
+pub const SYS_setresuid: ::c_long = 147;
+pub const SYS_getresuid: ::c_long = 148;
+pub const SYS_setresgid: ::c_long = 149;
+pub const SYS_getresgid: ::c_long = 150;
+pub const SYS_setfsuid: ::c_long = 151;
+pub const SYS_setfsgid: ::c_long = 152;
+pub const SYS_times: ::c_long = 153;
+pub const SYS_setpgid: ::c_long = 154;
+pub const SYS_getpgid: ::c_long = 155;
+pub const SYS_getsid: ::c_long = 156;
+pub const SYS_setsid: ::c_long = 157;
+pub const SYS_getgroups: ::c_long = 158;
+pub const SYS_setgroups: ::c_long = 159;
+pub const SYS_uname: ::c_long = 160;
+pub const SYS_sethostname: ::c_long = 161;
+pub const SYS_setdomainname: ::c_long = 162;
+pub const SYS_getrusage: ::c_long = 165;
+pub const SYS_umask: ::c_long = 166;
+pub const SYS_prctl: ::c_long = 167;
+pub const SYS_getcpu: ::c_long = 168;
+pub const SYS_gettimeofday: ::c_long = 169;
+pub const SYS_settimeofday: ::c_long = 170;
+pub const SYS_adjtimex: ::c_long = 171;
+pub const SYS_getpid: ::c_long = 172;
+pub const SYS_getppid: ::c_long = 173;
+pub const SYS_getuid: ::c_long = 174;
+pub const SYS_geteuid: ::c_long = 175;
+pub const SYS_getgid: ::c_long = 176;
+pub const SYS_getegid: ::c_long = 177;
+pub const SYS_gettid: ::c_long = 178;
+pub const SYS_sysinfo: ::c_long = 179;
+pub const SYS_mq_open: ::c_long = 180;
+pub const SYS_mq_unlink: ::c_long = 181;
+pub const SYS_mq_timedsend: ::c_long = 182;
+pub const SYS_mq_timedreceive: ::c_long = 183;
+pub const SYS_mq_notify: ::c_long = 184;
+pub const SYS_mq_getsetattr: ::c_long = 185;
+pub const SYS_msgget: ::c_long = 186;
+pub const SYS_msgctl: ::c_long = 187;
+pub const SYS_msgrcv: ::c_long = 188;
+pub const SYS_msgsnd: ::c_long = 189;
+pub const SYS_semget: ::c_long = 190;
+pub const SYS_semctl: ::c_long = 191;
+pub const SYS_semtimedop: ::c_long = 192;
+pub const SYS_semop: ::c_long = 193;
+pub const SYS_shmget: ::c_long = 194;
+pub const SYS_shmctl: ::c_long = 195;
+pub const SYS_shmat: ::c_long = 196;
+pub const SYS_shmdt: ::c_long = 197;
+pub const SYS_socket: ::c_long = 198;
+pub const SYS_socketpair: ::c_long = 199;
+pub const SYS_bind: ::c_long = 200;
+pub const SYS_listen: ::c_long = 201;
+pub const SYS_accept: ::c_long = 202;
+pub const SYS_connect: ::c_long = 203;
+pub const SYS_getsockname: ::c_long = 204;
+pub const SYS_getpeername: ::c_long = 205;
+pub const SYS_sendto: ::c_long = 206;
+pub const SYS_recvfrom: ::c_long = 207;
+pub const SYS_setsockopt: ::c_long = 208;
+pub const SYS_getsockopt: ::c_long = 209;
+pub const SYS_shutdown: ::c_long = 210;
+pub const SYS_sendmsg: ::c_long = 211;
+pub const SYS_recvmsg: ::c_long = 212;
+pub const SYS_readahead: ::c_long = 213;
+pub const SYS_brk: ::c_long = 214;
+pub const SYS_munmap: ::c_long = 215;
+pub const SYS_mremap: ::c_long = 216;
+pub const SYS_add_key: ::c_long = 217;
+pub const SYS_request_key: ::c_long = 218;
+pub const SYS_keyctl: ::c_long = 219;
+pub const SYS_clone: ::c_long = 220;
+pub const SYS_execve: ::c_long = 221;
+pub const SYS_mmap: ::c_long = 222;
+pub const SYS_fadvise64: ::c_long = 223;
+pub const SYS_swapon: ::c_long = 224;
+pub const SYS_swapoff: ::c_long = 225;
+pub const SYS_mprotect: ::c_long = 226;
+pub const SYS_msync: ::c_long = 227;
+pub const SYS_mlock: ::c_long = 228;
+pub const SYS_munlock: ::c_long = 229;
+pub const SYS_mlockall: ::c_long = 230;
+pub const SYS_munlockall: ::c_long = 231;
+pub const SYS_mincore: ::c_long = 232;
+pub const SYS_madvise: ::c_long = 233;
+pub const SYS_remap_file_pages: ::c_long = 234;
+pub const SYS_mbind: ::c_long = 235;
+pub const SYS_get_mempolicy: ::c_long = 236;
+pub const SYS_set_mempolicy: ::c_long = 237;
+pub const SYS_migrate_pages: ::c_long = 238;
+pub const SYS_move_pages: ::c_long = 239;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
+pub const SYS_perf_event_open: ::c_long = 241;
+pub const SYS_accept4: ::c_long = 242;
+pub const SYS_recvmmsg: ::c_long = 243;
+pub const SYS_arch_specific_syscall: ::c_long = 244;
+pub const SYS_wait4: ::c_long = 260;
+pub const SYS_prlimit64: ::c_long = 261;
+pub const SYS_fanotify_init: ::c_long = 262;
+pub const SYS_fanotify_mark: ::c_long = 263;
+pub const SYS_name_to_handle_at: ::c_long = 264;
+pub const SYS_open_by_handle_at: ::c_long = 265;
+pub const SYS_clock_adjtime: ::c_long = 266;
+pub const SYS_syncfs: ::c_long = 267;
+pub const SYS_setns: ::c_long = 268;
+pub const SYS_sendmmsg: ::c_long = 269;
+pub const SYS_process_vm_readv: ::c_long = 270;
+pub const SYS_process_vm_writev: ::c_long = 271;
+pub const SYS_kcmp: ::c_long = 272;
+pub const SYS_finit_module: ::c_long = 273;
+pub const SYS_sched_setattr: ::c_long = 274;
+pub const SYS_sched_getattr: ::c_long = 275;
+pub const SYS_renameat2: ::c_long = 276;
+pub const SYS_seccomp: ::c_long = 277;
+pub const SYS_getrandom: ::c_long = 278;
+pub const SYS_memfd_create: ::c_long = 279;
+pub const SYS_bpf: ::c_long = 280;
+pub const SYS_execveat: ::c_long = 281;
+pub const SYS_userfaultfd: ::c_long = 282;
+pub const SYS_membarrier: ::c_long = 283;
+pub const SYS_mlock2: ::c_long = 284;
+pub const SYS_copy_file_range: ::c_long = 285;
+pub const SYS_preadv2: ::c_long = 286;
+pub const SYS_pwritev2: ::c_long = 287;
+pub const SYS_pkey_mprotect: ::c_long = 288;
+pub const SYS_pkey_alloc: ::c_long = 289;
+pub const SYS_pkey_free: ::c_long = 290;
+pub const SYS_statx: ::c_long = 291;
+pub const SYS_io_pgetevents: ::c_long = 292;
+pub const SYS_rseq: ::c_long = 293;
+pub const SYS_kexec_file_load: ::c_long = 294;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+pub const SYS_cachestat: ::c_long = 451;
+pub const SYS_fchmodat2: ::c_long = 452;
+pub const SYS_map_shadow_stack: ::c_long = 453;
+pub const SYS_futex_wake: ::c_long = 454;
+pub const SYS_futex_wait: ::c_long = 455;
+pub const SYS_futex_requeue: ::c_long = 456;
+
+pub const O_APPEND: ::c_int = 1024;
+pub const O_DIRECT: ::c_int = 0x4000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_LARGEFILE: ::c_int = 0;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_ASYNC: ::c_int = 4096;
+
+pub const SIGSTKSZ: ::size_t = 16384;
+pub const MINSIGSTKSZ: ::size_t = 4096;
+
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EBADMSG: ::c_int = 74;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const EHWPOISON: ::c_int = 133;
+pub const ERFKILL: ::c_int = 132;
+
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0;
+pub const SIG_UNBLOCK: ::c_int = 1;
+
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+pub const F_SETOWN: ::c_int = 8;
+
+pub const VEOF: usize = 4;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_LOCKED: ::c_int = 0x02000;
+pub const MAP_NORESERVE: ::c_int = 0x04000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::c_int = 0x00000800;
+pub const TAB2: ::c_int = 0x00001000;
+pub const TAB3: ::c_int = 0x00001800;
+pub const CR1: ::c_int = 0x00000200;
+pub const CR2: ::c_int = 0x00000400;
+pub const CR3: ::c_int = 0x00000600;
+pub const FF1: ::c_int = 0x00008000;
+pub const BS1: ::c_int = 0x00002000;
+pub const VT1: ::c_int = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const EDEADLK: ::c_int = 35;
+pub const EDEADLOCK: ::c_int = EDEADLK;
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/mips64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/mips64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/mips64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/mips64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,688 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
+pub type __u64 = ::c_ulong;
+pub type __s64 = ::c_long;
+pub type nlink_t = u64;
+pub type blksize_t = i64;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        __pad1: [::c_int; 3],
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad2: [::c_uint; 2],
+        pub st_size: ::off_t,
+        __pad3: ::c_int,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_blksize: ::blksize_t,
+        __pad4: ::c_uint,
+        pub st_blocks: ::blkcnt_t,
+        __pad5: [::c_int; 14],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        __pad1: [::c_int; 3],
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad2: [::c_uint; 2],
+        pub st_size: ::off_t,
+        __pad3: ::c_int,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_blksize: ::blksize_t,
+        __pad4: ::c_uint,
+        pub st_blocks: ::blkcnt_t,
+        __pad5: [::c_int; 14],
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 5],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 5],
+    }
+
+    pub struct ipc_perm {
+        pub __ipc_perm_key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_int,
+        __pad1: ::c_int,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong
+    }
+}
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+
+pub const SYS_read: ::c_long = 5000 + 0;
+pub const SYS_write: ::c_long = 5000 + 1;
+pub const SYS_open: ::c_long = 5000 + 2;
+pub const SYS_close: ::c_long = 5000 + 3;
+pub const SYS_stat: ::c_long = 5000 + 4;
+pub const SYS_fstat: ::c_long = 5000 + 5;
+pub const SYS_lstat: ::c_long = 5000 + 6;
+pub const SYS_poll: ::c_long = 5000 + 7;
+pub const SYS_lseek: ::c_long = 5000 + 8;
+pub const SYS_mmap: ::c_long = 5000 + 9;
+pub const SYS_mprotect: ::c_long = 5000 + 10;
+pub const SYS_munmap: ::c_long = 5000 + 11;
+pub const SYS_brk: ::c_long = 5000 + 12;
+pub const SYS_rt_sigaction: ::c_long = 5000 + 13;
+pub const SYS_rt_sigprocmask: ::c_long = 5000 + 14;
+pub const SYS_ioctl: ::c_long = 5000 + 15;
+pub const SYS_pread64: ::c_long = 5000 + 16;
+pub const SYS_pwrite64: ::c_long = 5000 + 17;
+pub const SYS_readv: ::c_long = 5000 + 18;
+pub const SYS_writev: ::c_long = 5000 + 19;
+pub const SYS_access: ::c_long = 5000 + 20;
+pub const SYS_pipe: ::c_long = 5000 + 21;
+pub const SYS__newselect: ::c_long = 5000 + 22;
+pub const SYS_sched_yield: ::c_long = 5000 + 23;
+pub const SYS_mremap: ::c_long = 5000 + 24;
+pub const SYS_msync: ::c_long = 5000 + 25;
+pub const SYS_mincore: ::c_long = 5000 + 26;
+pub const SYS_madvise: ::c_long = 5000 + 27;
+pub const SYS_shmget: ::c_long = 5000 + 28;
+pub const SYS_shmat: ::c_long = 5000 + 29;
+pub const SYS_shmctl: ::c_long = 5000 + 30;
+pub const SYS_dup: ::c_long = 5000 + 31;
+pub const SYS_dup2: ::c_long = 5000 + 32;
+pub const SYS_pause: ::c_long = 5000 + 33;
+pub const SYS_nanosleep: ::c_long = 5000 + 34;
+pub const SYS_getitimer: ::c_long = 5000 + 35;
+pub const SYS_setitimer: ::c_long = 5000 + 36;
+pub const SYS_alarm: ::c_long = 5000 + 37;
+pub const SYS_getpid: ::c_long = 5000 + 38;
+pub const SYS_sendfile: ::c_long = 5000 + 39;
+pub const SYS_socket: ::c_long = 5000 + 40;
+pub const SYS_connect: ::c_long = 5000 + 41;
+pub const SYS_accept: ::c_long = 5000 + 42;
+pub const SYS_sendto: ::c_long = 5000 + 43;
+pub const SYS_recvfrom: ::c_long = 5000 + 44;
+pub const SYS_sendmsg: ::c_long = 5000 + 45;
+pub const SYS_recvmsg: ::c_long = 5000 + 46;
+pub const SYS_shutdown: ::c_long = 5000 + 47;
+pub const SYS_bind: ::c_long = 5000 + 48;
+pub const SYS_listen: ::c_long = 5000 + 49;
+pub const SYS_getsockname: ::c_long = 5000 + 50;
+pub const SYS_getpeername: ::c_long = 5000 + 51;
+pub const SYS_socketpair: ::c_long = 5000 + 52;
+pub const SYS_setsockopt: ::c_long = 5000 + 53;
+pub const SYS_getsockopt: ::c_long = 5000 + 54;
+pub const SYS_clone: ::c_long = 5000 + 55;
+pub const SYS_fork: ::c_long = 5000 + 56;
+pub const SYS_execve: ::c_long = 5000 + 57;
+pub const SYS_exit: ::c_long = 5000 + 58;
+pub const SYS_wait4: ::c_long = 5000 + 59;
+pub const SYS_kill: ::c_long = 5000 + 60;
+pub const SYS_uname: ::c_long = 5000 + 61;
+pub const SYS_semget: ::c_long = 5000 + 62;
+pub const SYS_semop: ::c_long = 5000 + 63;
+pub const SYS_semctl: ::c_long = 5000 + 64;
+pub const SYS_shmdt: ::c_long = 5000 + 65;
+pub const SYS_msgget: ::c_long = 5000 + 66;
+pub const SYS_msgsnd: ::c_long = 5000 + 67;
+pub const SYS_msgrcv: ::c_long = 5000 + 68;
+pub const SYS_msgctl: ::c_long = 5000 + 69;
+pub const SYS_fcntl: ::c_long = 5000 + 70;
+pub const SYS_flock: ::c_long = 5000 + 71;
+pub const SYS_fsync: ::c_long = 5000 + 72;
+pub const SYS_fdatasync: ::c_long = 5000 + 73;
+pub const SYS_truncate: ::c_long = 5000 + 74;
+pub const SYS_ftruncate: ::c_long = 5000 + 75;
+pub const SYS_getdents: ::c_long = 5000 + 76;
+pub const SYS_getcwd: ::c_long = 5000 + 77;
+pub const SYS_chdir: ::c_long = 5000 + 78;
+pub const SYS_fchdir: ::c_long = 5000 + 79;
+pub const SYS_rename: ::c_long = 5000 + 80;
+pub const SYS_mkdir: ::c_long = 5000 + 81;
+pub const SYS_rmdir: ::c_long = 5000 + 82;
+pub const SYS_creat: ::c_long = 5000 + 83;
+pub const SYS_link: ::c_long = 5000 + 84;
+pub const SYS_unlink: ::c_long = 5000 + 85;
+pub const SYS_symlink: ::c_long = 5000 + 86;
+pub const SYS_readlink: ::c_long = 5000 + 87;
+pub const SYS_chmod: ::c_long = 5000 + 88;
+pub const SYS_fchmod: ::c_long = 5000 + 89;
+pub const SYS_chown: ::c_long = 5000 + 90;
+pub const SYS_fchown: ::c_long = 5000 + 91;
+pub const SYS_lchown: ::c_long = 5000 + 92;
+pub const SYS_umask: ::c_long = 5000 + 93;
+pub const SYS_gettimeofday: ::c_long = 5000 + 94;
+pub const SYS_getrlimit: ::c_long = 5000 + 95;
+pub const SYS_getrusage: ::c_long = 5000 + 96;
+pub const SYS_sysinfo: ::c_long = 5000 + 97;
+pub const SYS_times: ::c_long = 5000 + 98;
+pub const SYS_ptrace: ::c_long = 5000 + 99;
+pub const SYS_getuid: ::c_long = 5000 + 100;
+pub const SYS_syslog: ::c_long = 5000 + 101;
+pub const SYS_getgid: ::c_long = 5000 + 102;
+pub const SYS_setuid: ::c_long = 5000 + 103;
+pub const SYS_setgid: ::c_long = 5000 + 104;
+pub const SYS_geteuid: ::c_long = 5000 + 105;
+pub const SYS_getegid: ::c_long = 5000 + 106;
+pub const SYS_setpgid: ::c_long = 5000 + 107;
+pub const SYS_getppid: ::c_long = 5000 + 108;
+pub const SYS_getpgrp: ::c_long = 5000 + 109;
+pub const SYS_setsid: ::c_long = 5000 + 110;
+pub const SYS_setreuid: ::c_long = 5000 + 111;
+pub const SYS_setregid: ::c_long = 5000 + 112;
+pub const SYS_getgroups: ::c_long = 5000 + 113;
+pub const SYS_setgroups: ::c_long = 5000 + 114;
+pub const SYS_setresuid: ::c_long = 5000 + 115;
+pub const SYS_getresuid: ::c_long = 5000 + 116;
+pub const SYS_setresgid: ::c_long = 5000 + 117;
+pub const SYS_getresgid: ::c_long = 5000 + 118;
+pub const SYS_getpgid: ::c_long = 5000 + 119;
+pub const SYS_setfsuid: ::c_long = 5000 + 120;
+pub const SYS_setfsgid: ::c_long = 5000 + 121;
+pub const SYS_getsid: ::c_long = 5000 + 122;
+pub const SYS_capget: ::c_long = 5000 + 123;
+pub const SYS_capset: ::c_long = 5000 + 124;
+pub const SYS_rt_sigpending: ::c_long = 5000 + 125;
+pub const SYS_rt_sigtimedwait: ::c_long = 5000 + 126;
+pub const SYS_rt_sigqueueinfo: ::c_long = 5000 + 127;
+pub const SYS_rt_sigsuspend: ::c_long = 5000 + 128;
+pub const SYS_sigaltstack: ::c_long = 5000 + 129;
+pub const SYS_utime: ::c_long = 5000 + 130;
+pub const SYS_mknod: ::c_long = 5000 + 131;
+pub const SYS_personality: ::c_long = 5000 + 132;
+pub const SYS_ustat: ::c_long = 5000 + 133;
+pub const SYS_statfs: ::c_long = 5000 + 134;
+pub const SYS_fstatfs: ::c_long = 5000 + 135;
+pub const SYS_sysfs: ::c_long = 5000 + 136;
+pub const SYS_getpriority: ::c_long = 5000 + 137;
+pub const SYS_setpriority: ::c_long = 5000 + 138;
+pub const SYS_sched_setparam: ::c_long = 5000 + 139;
+pub const SYS_sched_getparam: ::c_long = 5000 + 140;
+pub const SYS_sched_setscheduler: ::c_long = 5000 + 141;
+pub const SYS_sched_getscheduler: ::c_long = 5000 + 142;
+pub const SYS_sched_get_priority_max: ::c_long = 5000 + 143;
+pub const SYS_sched_get_priority_min: ::c_long = 5000 + 144;
+pub const SYS_sched_rr_get_interval: ::c_long = 5000 + 145;
+pub const SYS_mlock: ::c_long = 5000 + 146;
+pub const SYS_munlock: ::c_long = 5000 + 147;
+pub const SYS_mlockall: ::c_long = 5000 + 148;
+pub const SYS_munlockall: ::c_long = 5000 + 149;
+pub const SYS_vhangup: ::c_long = 5000 + 150;
+pub const SYS_pivot_root: ::c_long = 5000 + 151;
+pub const SYS__sysctl: ::c_long = 5000 + 152;
+pub const SYS_prctl: ::c_long = 5000 + 153;
+pub const SYS_adjtimex: ::c_long = 5000 + 154;
+pub const SYS_setrlimit: ::c_long = 5000 + 155;
+pub const SYS_chroot: ::c_long = 5000 + 156;
+pub const SYS_sync: ::c_long = 5000 + 157;
+pub const SYS_acct: ::c_long = 5000 + 158;
+pub const SYS_settimeofday: ::c_long = 5000 + 159;
+pub const SYS_mount: ::c_long = 5000 + 160;
+pub const SYS_umount2: ::c_long = 5000 + 161;
+pub const SYS_swapon: ::c_long = 5000 + 162;
+pub const SYS_swapoff: ::c_long = 5000 + 163;
+pub const SYS_reboot: ::c_long = 5000 + 164;
+pub const SYS_sethostname: ::c_long = 5000 + 165;
+pub const SYS_setdomainname: ::c_long = 5000 + 166;
+pub const SYS_create_module: ::c_long = 5000 + 167;
+pub const SYS_init_module: ::c_long = 5000 + 168;
+pub const SYS_delete_module: ::c_long = 5000 + 169;
+pub const SYS_get_kernel_syms: ::c_long = 5000 + 170;
+pub const SYS_query_module: ::c_long = 5000 + 171;
+pub const SYS_quotactl: ::c_long = 5000 + 172;
+pub const SYS_nfsservctl: ::c_long = 5000 + 173;
+pub const SYS_getpmsg: ::c_long = 5000 + 174;
+pub const SYS_putpmsg: ::c_long = 5000 + 175;
+pub const SYS_afs_syscall: ::c_long = 5000 + 176;
+pub const SYS_gettid: ::c_long = 5000 + 178;
+pub const SYS_readahead: ::c_long = 5000 + 179;
+pub const SYS_setxattr: ::c_long = 5000 + 180;
+pub const SYS_lsetxattr: ::c_long = 5000 + 181;
+pub const SYS_fsetxattr: ::c_long = 5000 + 182;
+pub const SYS_getxattr: ::c_long = 5000 + 183;
+pub const SYS_lgetxattr: ::c_long = 5000 + 184;
+pub const SYS_fgetxattr: ::c_long = 5000 + 185;
+pub const SYS_listxattr: ::c_long = 5000 + 186;
+pub const SYS_llistxattr: ::c_long = 5000 + 187;
+pub const SYS_flistxattr: ::c_long = 5000 + 188;
+pub const SYS_removexattr: ::c_long = 5000 + 189;
+pub const SYS_lremovexattr: ::c_long = 5000 + 190;
+pub const SYS_fremovexattr: ::c_long = 5000 + 191;
+pub const SYS_tkill: ::c_long = 5000 + 192;
+pub const SYS_futex: ::c_long = 5000 + 194;
+pub const SYS_sched_setaffinity: ::c_long = 5000 + 195;
+pub const SYS_sched_getaffinity: ::c_long = 5000 + 196;
+pub const SYS_cacheflush: ::c_long = 5000 + 197;
+pub const SYS_cachectl: ::c_long = 5000 + 198;
+pub const SYS_sysmips: ::c_long = 5000 + 199;
+pub const SYS_io_setup: ::c_long = 5000 + 200;
+pub const SYS_io_destroy: ::c_long = 5000 + 201;
+pub const SYS_io_getevents: ::c_long = 5000 + 202;
+pub const SYS_io_submit: ::c_long = 5000 + 203;
+pub const SYS_io_cancel: ::c_long = 5000 + 204;
+pub const SYS_exit_group: ::c_long = 5000 + 205;
+pub const SYS_lookup_dcookie: ::c_long = 5000 + 206;
+pub const SYS_epoll_create: ::c_long = 5000 + 207;
+pub const SYS_epoll_ctl: ::c_long = 5000 + 208;
+pub const SYS_epoll_wait: ::c_long = 5000 + 209;
+pub const SYS_remap_file_pages: ::c_long = 5000 + 210;
+pub const SYS_rt_sigreturn: ::c_long = 5000 + 211;
+pub const SYS_set_tid_address: ::c_long = 5000 + 212;
+pub const SYS_restart_syscall: ::c_long = 5000 + 213;
+pub const SYS_semtimedop: ::c_long = 5000 + 214;
+pub const SYS_fadvise64: ::c_long = 5000 + 215;
+pub const SYS_timer_create: ::c_long = 5000 + 216;
+pub const SYS_timer_settime: ::c_long = 5000 + 217;
+pub const SYS_timer_gettime: ::c_long = 5000 + 218;
+pub const SYS_timer_getoverrun: ::c_long = 5000 + 219;
+pub const SYS_timer_delete: ::c_long = 5000 + 220;
+pub const SYS_clock_settime: ::c_long = 5000 + 221;
+pub const SYS_clock_gettime: ::c_long = 5000 + 222;
+pub const SYS_clock_getres: ::c_long = 5000 + 223;
+pub const SYS_clock_nanosleep: ::c_long = 5000 + 224;
+pub const SYS_tgkill: ::c_long = 5000 + 225;
+pub const SYS_utimes: ::c_long = 5000 + 226;
+pub const SYS_mbind: ::c_long = 5000 + 227;
+pub const SYS_get_mempolicy: ::c_long = 5000 + 228;
+pub const SYS_set_mempolicy: ::c_long = 5000 + 229;
+pub const SYS_mq_open: ::c_long = 5000 + 230;
+pub const SYS_mq_unlink: ::c_long = 5000 + 231;
+pub const SYS_mq_timedsend: ::c_long = 5000 + 232;
+pub const SYS_mq_timedreceive: ::c_long = 5000 + 233;
+pub const SYS_mq_notify: ::c_long = 5000 + 234;
+pub const SYS_mq_getsetattr: ::c_long = 5000 + 235;
+pub const SYS_vserver: ::c_long = 5000 + 236;
+pub const SYS_waitid: ::c_long = 5000 + 237;
+/* pub const SYS_sys_setaltroot: ::c_long = 5000 + 238; */
+pub const SYS_add_key: ::c_long = 5000 + 239;
+pub const SYS_request_key: ::c_long = 5000 + 240;
+pub const SYS_keyctl: ::c_long = 5000 + 241;
+pub const SYS_set_thread_area: ::c_long = 5000 + 242;
+pub const SYS_inotify_init: ::c_long = 5000 + 243;
+pub const SYS_inotify_add_watch: ::c_long = 5000 + 244;
+pub const SYS_inotify_rm_watch: ::c_long = 5000 + 245;
+pub const SYS_migrate_pages: ::c_long = 5000 + 246;
+pub const SYS_openat: ::c_long = 5000 + 247;
+pub const SYS_mkdirat: ::c_long = 5000 + 248;
+pub const SYS_mknodat: ::c_long = 5000 + 249;
+pub const SYS_fchownat: ::c_long = 5000 + 250;
+pub const SYS_futimesat: ::c_long = 5000 + 251;
+pub const SYS_newfstatat: ::c_long = 5000 + 252;
+pub const SYS_unlinkat: ::c_long = 5000 + 253;
+pub const SYS_renameat: ::c_long = 5000 + 254;
+pub const SYS_linkat: ::c_long = 5000 + 255;
+pub const SYS_symlinkat: ::c_long = 5000 + 256;
+pub const SYS_readlinkat: ::c_long = 5000 + 257;
+pub const SYS_fchmodat: ::c_long = 5000 + 258;
+pub const SYS_faccessat: ::c_long = 5000 + 259;
+pub const SYS_pselect6: ::c_long = 5000 + 260;
+pub const SYS_ppoll: ::c_long = 5000 + 261;
+pub const SYS_unshare: ::c_long = 5000 + 262;
+pub const SYS_splice: ::c_long = 5000 + 263;
+pub const SYS_sync_file_range: ::c_long = 5000 + 264;
+pub const SYS_tee: ::c_long = 5000 + 265;
+pub const SYS_vmsplice: ::c_long = 5000 + 266;
+pub const SYS_move_pages: ::c_long = 5000 + 267;
+pub const SYS_set_robust_list: ::c_long = 5000 + 268;
+pub const SYS_get_robust_list: ::c_long = 5000 + 269;
+pub const SYS_kexec_load: ::c_long = 5000 + 270;
+pub const SYS_getcpu: ::c_long = 5000 + 271;
+pub const SYS_epoll_pwait: ::c_long = 5000 + 272;
+pub const SYS_ioprio_set: ::c_long = 5000 + 273;
+pub const SYS_ioprio_get: ::c_long = 5000 + 274;
+pub const SYS_utimensat: ::c_long = 5000 + 275;
+pub const SYS_signalfd: ::c_long = 5000 + 276;
+pub const SYS_timerfd: ::c_long = 5000 + 277;
+pub const SYS_eventfd: ::c_long = 5000 + 278;
+pub const SYS_fallocate: ::c_long = 5000 + 279;
+pub const SYS_timerfd_create: ::c_long = 5000 + 280;
+pub const SYS_timerfd_gettime: ::c_long = 5000 + 281;
+pub const SYS_timerfd_settime: ::c_long = 5000 + 282;
+pub const SYS_signalfd4: ::c_long = 5000 + 283;
+pub const SYS_eventfd2: ::c_long = 5000 + 284;
+pub const SYS_epoll_create1: ::c_long = 5000 + 285;
+pub const SYS_dup3: ::c_long = 5000 + 286;
+pub const SYS_pipe2: ::c_long = 5000 + 287;
+pub const SYS_inotify_init1: ::c_long = 5000 + 288;
+pub const SYS_preadv: ::c_long = 5000 + 289;
+pub const SYS_pwritev: ::c_long = 5000 + 290;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 5000 + 291;
+pub const SYS_perf_event_open: ::c_long = 5000 + 292;
+pub const SYS_accept4: ::c_long = 5000 + 293;
+pub const SYS_recvmmsg: ::c_long = 5000 + 294;
+pub const SYS_fanotify_init: ::c_long = 5000 + 295;
+pub const SYS_fanotify_mark: ::c_long = 5000 + 296;
+pub const SYS_prlimit64: ::c_long = 5000 + 297;
+pub const SYS_name_to_handle_at: ::c_long = 5000 + 298;
+pub const SYS_open_by_handle_at: ::c_long = 5000 + 299;
+pub const SYS_clock_adjtime: ::c_long = 5000 + 300;
+pub const SYS_syncfs: ::c_long = 5000 + 301;
+pub const SYS_sendmmsg: ::c_long = 5000 + 302;
+pub const SYS_setns: ::c_long = 5000 + 303;
+pub const SYS_process_vm_readv: ::c_long = 5000 + 304;
+pub const SYS_process_vm_writev: ::c_long = 5000 + 305;
+pub const SYS_kcmp: ::c_long = 5000 + 306;
+pub const SYS_finit_module: ::c_long = 5000 + 307;
+pub const SYS_getdents64: ::c_long = 5000 + 308;
+pub const SYS_sched_setattr: ::c_long = 5000 + 309;
+pub const SYS_sched_getattr: ::c_long = 5000 + 310;
+pub const SYS_renameat2: ::c_long = 5000 + 311;
+pub const SYS_seccomp: ::c_long = 5000 + 312;
+pub const SYS_getrandom: ::c_long = 5000 + 313;
+pub const SYS_memfd_create: ::c_long = 5000 + 314;
+pub const SYS_bpf: ::c_long = 5000 + 315;
+pub const SYS_execveat: ::c_long = 5000 + 316;
+pub const SYS_userfaultfd: ::c_long = 5000 + 317;
+pub const SYS_membarrier: ::c_long = 5000 + 318;
+pub const SYS_mlock2: ::c_long = 5000 + 319;
+pub const SYS_copy_file_range: ::c_long = 5000 + 320;
+pub const SYS_preadv2: ::c_long = 5000 + 321;
+pub const SYS_pwritev2: ::c_long = 5000 + 322;
+pub const SYS_pkey_mprotect: ::c_long = 5000 + 323;
+pub const SYS_pkey_alloc: ::c_long = 5000 + 324;
+pub const SYS_pkey_free: ::c_long = 5000 + 325;
+pub const SYS_statx: ::c_long = 5000 + 326;
+pub const SYS_pidfd_send_signal: ::c_long = 5000 + 424;
+pub const SYS_io_uring_setup: ::c_long = 5000 + 425;
+pub const SYS_io_uring_enter: ::c_long = 5000 + 426;
+pub const SYS_io_uring_register: ::c_long = 5000 + 427;
+pub const SYS_open_tree: ::c_long = 5000 + 428;
+pub const SYS_move_mount: ::c_long = 5000 + 429;
+pub const SYS_fsopen: ::c_long = 5000 + 430;
+pub const SYS_fsconfig: ::c_long = 5000 + 431;
+pub const SYS_fsmount: ::c_long = 5000 + 432;
+pub const SYS_fspick: ::c_long = 5000 + 433;
+pub const SYS_pidfd_open: ::c_long = 5000 + 434;
+pub const SYS_clone3: ::c_long = 5000 + 435;
+pub const SYS_close_range: ::c_long = 5000 + 436;
+pub const SYS_openat2: ::c_long = 5000 + 437;
+pub const SYS_pidfd_getfd: ::c_long = 5000 + 438;
+pub const SYS_faccessat2: ::c_long = 5000 + 439;
+pub const SYS_process_madvise: ::c_long = 5000 + 440;
+pub const SYS_epoll_pwait2: ::c_long = 5000 + 441;
+pub const SYS_mount_setattr: ::c_long = 5000 + 442;
+pub const SYS_quotactl_fd: ::c_long = 5000 + 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 5000 + 444;
+pub const SYS_landlock_add_rule: ::c_long = 5000 + 445;
+pub const SYS_landlock_restrict_self: ::c_long = 5000 + 446;
+pub const SYS_memfd_secret: ::c_long = 5000 + 447;
+pub const SYS_process_mrelease: ::c_long = 5000 + 448;
+pub const SYS_futex_waitv: ::c_long = 5000 + 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 5000 + 450;
+
+pub const O_DIRECT: ::c_int = 0x8000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+
+pub const O_APPEND: ::c_int = 8;
+pub const O_CREAT: ::c_int = 256;
+pub const O_EXCL: ::c_int = 1024;
+pub const O_NOCTTY: ::c_int = 2048;
+pub const O_NONBLOCK: ::c_int = 128;
+pub const O_SYNC: ::c_int = 0x4010;
+pub const O_RSYNC: ::c_int = 0x4010;
+pub const O_DSYNC: ::c_int = 0x10;
+pub const O_ASYNC: ::c_int = 0x1000;
+pub const O_LARGEFILE: ::c_int = 0x2000;
+
+pub const EDEADLK: ::c_int = 45;
+pub const ENAMETOOLONG: ::c_int = 78;
+pub const ENOLCK: ::c_int = 46;
+pub const ENOSYS: ::c_int = 89;
+pub const ENOTEMPTY: ::c_int = 93;
+pub const ELOOP: ::c_int = 90;
+pub const ENOMSG: ::c_int = 35;
+pub const EIDRM: ::c_int = 36;
+pub const ECHRNG: ::c_int = 37;
+pub const EL2NSYNC: ::c_int = 38;
+pub const EL3HLT: ::c_int = 39;
+pub const EL3RST: ::c_int = 40;
+pub const ELNRNG: ::c_int = 41;
+pub const EUNATCH: ::c_int = 42;
+pub const ENOCSI: ::c_int = 43;
+pub const EL2HLT: ::c_int = 44;
+pub const EBADE: ::c_int = 50;
+pub const EBADR: ::c_int = 51;
+pub const EXFULL: ::c_int = 52;
+pub const ENOANO: ::c_int = 53;
+pub const EBADRQC: ::c_int = 54;
+pub const EBADSLT: ::c_int = 55;
+pub const EDEADLOCK: ::c_int = 56;
+pub const EMULTIHOP: ::c_int = 74;
+pub const EOVERFLOW: ::c_int = 79;
+pub const ENOTUNIQ: ::c_int = 80;
+pub const EBADFD: ::c_int = 81;
+pub const EBADMSG: ::c_int = 77;
+pub const EREMCHG: ::c_int = 82;
+pub const ELIBACC: ::c_int = 83;
+pub const ELIBBAD: ::c_int = 84;
+pub const ELIBSCN: ::c_int = 85;
+pub const ELIBMAX: ::c_int = 86;
+pub const ELIBEXEC: ::c_int = 87;
+pub const EILSEQ: ::c_int = 88;
+pub const ERESTART: ::c_int = 91;
+pub const ESTRPIPE: ::c_int = 92;
+pub const EUSERS: ::c_int = 94;
+pub const ENOTSOCK: ::c_int = 95;
+pub const EDESTADDRREQ: ::c_int = 96;
+pub const EMSGSIZE: ::c_int = 97;
+pub const EPROTOTYPE: ::c_int = 98;
+pub const ENOPROTOOPT: ::c_int = 99;
+pub const EPROTONOSUPPORT: ::c_int = 120;
+pub const ESOCKTNOSUPPORT: ::c_int = 121;
+pub const EOPNOTSUPP: ::c_int = 122;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 123;
+pub const EAFNOSUPPORT: ::c_int = 124;
+pub const EADDRINUSE: ::c_int = 125;
+pub const EADDRNOTAVAIL: ::c_int = 126;
+pub const ENETDOWN: ::c_int = 127;
+pub const ENETUNREACH: ::c_int = 128;
+pub const ENETRESET: ::c_int = 129;
+pub const ECONNABORTED: ::c_int = 130;
+pub const ECONNRESET: ::c_int = 131;
+pub const ENOBUFS: ::c_int = 132;
+pub const EISCONN: ::c_int = 133;
+pub const ENOTCONN: ::c_int = 134;
+pub const ESHUTDOWN: ::c_int = 143;
+pub const ETOOMANYREFS: ::c_int = 144;
+pub const ETIMEDOUT: ::c_int = 145;
+pub const ECONNREFUSED: ::c_int = 146;
+pub const EHOSTDOWN: ::c_int = 147;
+pub const EHOSTUNREACH: ::c_int = 148;
+pub const EALREADY: ::c_int = 149;
+pub const EINPROGRESS: ::c_int = 150;
+pub const ESTALE: ::c_int = 151;
+pub const EUCLEAN: ::c_int = 135;
+pub const ENOTNAM: ::c_int = 137;
+pub const ENAVAIL: ::c_int = 138;
+pub const EISNAM: ::c_int = 139;
+pub const EREMOTEIO: ::c_int = 140;
+pub const EDQUOT: ::c_int = 1133;
+pub const ENOMEDIUM: ::c_int = 159;
+pub const EMEDIUMTYPE: ::c_int = 160;
+pub const ECANCELED: ::c_int = 158;
+pub const ENOKEY: ::c_int = 161;
+pub const EKEYEXPIRED: ::c_int = 162;
+pub const EKEYREVOKED: ::c_int = 163;
+pub const EKEYREJECTED: ::c_int = 164;
+pub const EOWNERDEAD: ::c_int = 165;
+pub const ENOTRECOVERABLE: ::c_int = 166;
+pub const ERFKILL: ::c_int = 167;
+
+pub const MAP_ANON: ::c_int = 0x800;
+pub const MAP_GROWSDOWN: ::c_int = 0x1000;
+pub const MAP_DENYWRITE: ::c_int = 0x2000;
+pub const MAP_EXECUTABLE: ::c_int = 0x4000;
+pub const MAP_LOCKED: ::c_int = 0x8000;
+pub const MAP_NORESERVE: ::c_int = 0x400;
+pub const MAP_POPULATE: ::c_int = 0x10000;
+pub const MAP_NONBLOCK: ::c_int = 0x20000;
+pub const MAP_STACK: ::c_int = 0x40000;
+pub const MAP_HUGETLB: ::c_int = 0x080000;
+
+pub const SOCK_STREAM: ::c_int = 2;
+pub const SOCK_DGRAM: ::c_int = 1;
+
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 0x00000008;
+pub const SA_NOCLDWAIT: ::c_int = 0x00010000;
+
+pub const SIGCHLD: ::c_int = 18;
+pub const SIGBUS: ::c_int = 10;
+pub const SIGTTIN: ::c_int = 26;
+pub const SIGTTOU: ::c_int = 27;
+pub const SIGXCPU: ::c_int = 30;
+pub const SIGXFSZ: ::c_int = 31;
+pub const SIGVTALRM: ::c_int = 28;
+pub const SIGPROF: ::c_int = 29;
+pub const SIGWINCH: ::c_int = 20;
+pub const SIGUSR1: ::c_int = 16;
+pub const SIGUSR2: ::c_int = 17;
+pub const SIGCONT: ::c_int = 25;
+pub const SIGSTOP: ::c_int = 23;
+pub const SIGTSTP: ::c_int = 24;
+pub const SIGURG: ::c_int = 21;
+pub const SIGIO: ::c_int = 22;
+pub const SIGSYS: ::c_int = 12;
+pub const SIGPOLL: ::c_int = 22;
+pub const SIGPWR: ::c_int = 19;
+pub const SIG_SETMASK: ::c_int = 3;
+pub const SIG_BLOCK: ::c_int = 0x1;
+pub const SIG_UNBLOCK: ::c_int = 0x2;
+
+pub const POLLWRNORM: ::c_short = 0x004;
+pub const POLLWRBAND: ::c_short = 0x100;
+
+pub const VEOF: usize = 16;
+pub const VEOL: usize = 17;
+pub const VEOL2: usize = 6;
+pub const VMIN: usize = 4;
+pub const IEXTEN: ::tcflag_t = 0x00000100;
+pub const TOSTOP: ::tcflag_t = 0x00008000;
+pub const FLUSHO: ::tcflag_t = 0x00002000;
+pub const EXTPROC: ::tcflag_t = 0o200000;
+
+pub const F_GETLK: ::c_int = 14;
+pub const F_GETOWN: ::c_int = 23;
+pub const F_SETOWN: ::c_int = 24;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const EHWPOISON: ::c_int = 168;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,166 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type regoff_t = ::c_long;
+
+s! {
+    pub struct statfs64 {
+        pub f_type: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 4],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t
+    }
+
+    pub struct pthread_attr_t {
+        __size: [u64; 7]
+    }
+
+    pub struct sigset_t {
+        __val: [::c_ulong; 16],
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::c_ulong,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 4],
+    }
+
+    pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: ::socklen_t,
+        pub msg_iov: *mut ::iovec,
+        #[cfg(target_endian = "big")]
+        __pad1: ::c_int,
+        pub msg_iovlen: ::c_int,
+        #[cfg(target_endian = "little")]
+        __pad1: ::c_int,
+        pub msg_control: *mut ::c_void,
+        #[cfg(target_endian = "big")]
+        __pad2: ::c_int,
+        pub msg_controllen: ::socklen_t,
+        #[cfg(target_endian = "little")]
+        __pad2: ::c_int,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct cmsghdr {
+        #[cfg(target_endian = "big")]
+        pub __pad1: ::c_int,
+        pub cmsg_len: ::socklen_t,
+        #[cfg(target_endian = "little")]
+        pub __pad1: ::c_int,
+        pub cmsg_level: ::c_int,
+        pub cmsg_type: ::c_int,
+    }
+
+    pub struct sem_t {
+        __val: [::c_int; 8],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        pub _pad: [::c_int; 29],
+        _align: [usize; 0],
+    }
+}
+
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
+
+extern "C" {
+    pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "aarch64")] {
+        mod aarch64;
+        pub use self::aarch64::*;
+    } else if #[cfg(target_arch = "mips64")] {
+        mod mips64;
+        pub use self::mips64::*;
+    } else if #[cfg(any(target_arch = "powerpc64"))] {
+        mod powerpc64;
+        pub use self::powerpc64::*;
+    } else if #[cfg(any(target_arch = "s390x"))] {
+        mod s390x;
+        pub use self::s390x::*;
+    } else if #[cfg(any(target_arch = "x86_64"))] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    } else if #[cfg(any(target_arch = "riscv64"))] {
+        mod riscv64;
+        pub use self::riscv64::*;
+    } else if #[cfg(any(target_arch = "loongarch64"))] {
+        mod loongarch64;
+        pub use self::loongarch64::*;
+    } else {
+        // Unknown target_arch
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,695 @@
+pub type c_char = u8;
+pub type wchar_t = i32;
+pub type __u64 = ::c_ulong;
+pub type __s64 = ::c_long;
+pub type nlink_t = u64;
+pub type blksize_t = ::c_long;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        __pad0: ::c_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_long; 3],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        __pad0: ::c_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __reserved: [::c_long; 3],
+    }
+
+    pub struct ipc_perm {
+        pub __ipc_perm_key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_int,
+        __unused1: ::c_long,
+        __unused2: ::c_long
+    }
+}
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MAP_32BIT: ::c_int = 0x0040;
+pub const O_APPEND: ::c_int = 1024;
+pub const O_DIRECT: ::c_int = 0x20000;
+pub const O_DIRECTORY: ::c_int = 0x4000;
+pub const O_LARGEFILE: ::c_int = 0x10000;
+pub const O_NOFOLLOW: ::c_int = 0x8000;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_ASYNC: ::c_int = 0x2000;
+
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EBADMSG: ::c_int = 74;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const ERFKILL: ::c_int = 132;
+pub const EHWPOISON: ::c_int = 133;
+
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_LOCKED: ::c_int = 0x02000;
+pub const MAP_NORESERVE: ::c_int = 0x04000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const PTRACE_SYSEMU: ::c_int = 0x1d;
+pub const PTRACE_SYSEMU_SINGLESTEP: ::c_int = 0x1e;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+pub const F_SETOWN: ::c_int = 8;
+
+pub const VEOF: usize = 4;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const SIGSTKSZ: ::size_t = 10240;
+pub const MINSIGSTKSZ: ::size_t = 4096;
+
+// Syscall table
+pub const SYS_restart_syscall: ::c_long = 0;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_waitpid: ::c_long = 7;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execve: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_time: ::c_long = 13;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lchown: ::c_long = 16;
+pub const SYS_break: ::c_long = 17;
+pub const SYS_oldstat: ::c_long = 18;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_mount: ::c_long = 21;
+pub const SYS_umount: ::c_long = 22;
+pub const SYS_setuid: ::c_long = 23;
+pub const SYS_getuid: ::c_long = 24;
+pub const SYS_stime: ::c_long = 25;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_alarm: ::c_long = 27;
+pub const SYS_oldfstat: ::c_long = 28;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_utime: ::c_long = 30;
+pub const SYS_stty: ::c_long = 31;
+pub const SYS_gtty: ::c_long = 32;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_ftime: ::c_long = 35;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_prof: ::c_long = 44;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_setgid: ::c_long = 46;
+pub const SYS_getgid: ::c_long = 47;
+pub const SYS_signal: ::c_long = 48;
+pub const SYS_geteuid: ::c_long = 49;
+pub const SYS_getegid: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount2: ::c_long = 52;
+pub const SYS_lock: ::c_long = 53;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_mpx: ::c_long = 56;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_ulimit: ::c_long = 58;
+pub const SYS_oldolduname: ::c_long = 59;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_sgetmask: ::c_long = 68;
+pub const SYS_ssetmask: ::c_long = 69;
+pub const SYS_setreuid: ::c_long = 70;
+pub const SYS_setregid: ::c_long = 71;
+pub const SYS_sigsuspend: ::c_long = 72;
+pub const SYS_sigpending: ::c_long = 73;
+pub const SYS_sethostname: ::c_long = 74;
+pub const SYS_setrlimit: ::c_long = 75;
+pub const SYS_getrlimit: ::c_long = 76;
+pub const SYS_getrusage: ::c_long = 77;
+pub const SYS_gettimeofday: ::c_long = 78;
+pub const SYS_settimeofday: ::c_long = 79;
+pub const SYS_getgroups: ::c_long = 80;
+pub const SYS_setgroups: ::c_long = 81;
+pub const SYS_select: ::c_long = 82;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_oldlstat: ::c_long = 84;
+pub const SYS_readlink: ::c_long = 85;
+pub const SYS_uselib: ::c_long = 86;
+pub const SYS_swapon: ::c_long = 87;
+pub const SYS_reboot: ::c_long = 88;
+pub const SYS_readdir: ::c_long = 89;
+pub const SYS_mmap: ::c_long = 90;
+pub const SYS_munmap: ::c_long = 91;
+pub const SYS_truncate: ::c_long = 92;
+pub const SYS_ftruncate: ::c_long = 93;
+pub const SYS_fchmod: ::c_long = 94;
+pub const SYS_fchown: ::c_long = 95;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_profil: ::c_long = 98;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_ioperm: ::c_long = 101;
+pub const SYS_socketcall: ::c_long = 102;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_setitimer: ::c_long = 104;
+pub const SYS_getitimer: ::c_long = 105;
+pub const SYS_stat: ::c_long = 106;
+pub const SYS_lstat: ::c_long = 107;
+pub const SYS_fstat: ::c_long = 108;
+pub const SYS_olduname: ::c_long = 109;
+pub const SYS_iopl: ::c_long = 110;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_idle: ::c_long = 112;
+pub const SYS_vm86: ::c_long = 113;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_ipc: ::c_long = 117;
+pub const SYS_fsync: ::c_long = 118;
+pub const SYS_sigreturn: ::c_long = 119;
+pub const SYS_clone: ::c_long = 120;
+pub const SYS_setdomainname: ::c_long = 121;
+pub const SYS_uname: ::c_long = 122;
+pub const SYS_modify_ldt: ::c_long = 123;
+pub const SYS_adjtimex: ::c_long = 124;
+pub const SYS_mprotect: ::c_long = 125;
+pub const SYS_sigprocmask: ::c_long = 126;
+pub const SYS_create_module: ::c_long = 127;
+pub const SYS_init_module: ::c_long = 128;
+pub const SYS_delete_module: ::c_long = 129;
+pub const SYS_get_kernel_syms: ::c_long = 130;
+pub const SYS_quotactl: ::c_long = 131;
+pub const SYS_getpgid: ::c_long = 132;
+pub const SYS_fchdir: ::c_long = 133;
+pub const SYS_bdflush: ::c_long = 134;
+pub const SYS_sysfs: ::c_long = 135;
+pub const SYS_personality: ::c_long = 136;
+pub const SYS_afs_syscall: ::c_long = 137; /* Syscall for Andrew File System */
+pub const SYS_setfsuid: ::c_long = 138;
+pub const SYS_setfsgid: ::c_long = 139;
+pub const SYS__llseek: ::c_long = 140;
+pub const SYS_getdents: ::c_long = 141;
+pub const SYS__newselect: ::c_long = 142;
+pub const SYS_flock: ::c_long = 143;
+pub const SYS_msync: ::c_long = 144;
+pub const SYS_readv: ::c_long = 145;
+pub const SYS_writev: ::c_long = 146;
+pub const SYS_getsid: ::c_long = 147;
+pub const SYS_fdatasync: ::c_long = 148;
+pub const SYS__sysctl: ::c_long = 149;
+pub const SYS_mlock: ::c_long = 150;
+pub const SYS_munlock: ::c_long = 151;
+pub const SYS_mlockall: ::c_long = 152;
+pub const SYS_munlockall: ::c_long = 153;
+pub const SYS_sched_setparam: ::c_long = 154;
+pub const SYS_sched_getparam: ::c_long = 155;
+pub const SYS_sched_setscheduler: ::c_long = 156;
+pub const SYS_sched_getscheduler: ::c_long = 157;
+pub const SYS_sched_yield: ::c_long = 158;
+pub const SYS_sched_get_priority_max: ::c_long = 159;
+pub const SYS_sched_get_priority_min: ::c_long = 160;
+pub const SYS_sched_rr_get_interval: ::c_long = 161;
+pub const SYS_nanosleep: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_setresuid: ::c_long = 164;
+pub const SYS_getresuid: ::c_long = 165;
+pub const SYS_query_module: ::c_long = 166;
+pub const SYS_poll: ::c_long = 167;
+pub const SYS_nfsservctl: ::c_long = 168;
+pub const SYS_setresgid: ::c_long = 169;
+pub const SYS_getresgid: ::c_long = 170;
+pub const SYS_prctl: ::c_long = 171;
+pub const SYS_rt_sigreturn: ::c_long = 172;
+pub const SYS_rt_sigaction: ::c_long = 173;
+pub const SYS_rt_sigprocmask: ::c_long = 174;
+pub const SYS_rt_sigpending: ::c_long = 175;
+pub const SYS_rt_sigtimedwait: ::c_long = 176;
+pub const SYS_rt_sigqueueinfo: ::c_long = 177;
+pub const SYS_rt_sigsuspend: ::c_long = 178;
+pub const SYS_pread64: ::c_long = 179;
+pub const SYS_pwrite64: ::c_long = 180;
+pub const SYS_chown: ::c_long = 181;
+pub const SYS_getcwd: ::c_long = 182;
+pub const SYS_capget: ::c_long = 183;
+pub const SYS_capset: ::c_long = 184;
+pub const SYS_sigaltstack: ::c_long = 185;
+pub const SYS_sendfile: ::c_long = 186;
+pub const SYS_getpmsg: ::c_long = 187; /* some people actually want streams */
+pub const SYS_putpmsg: ::c_long = 188; /* some people actually want streams */
+pub const SYS_vfork: ::c_long = 189;
+pub const SYS_ugetrlimit: ::c_long = 190; /* SuS compliant getrlimit */
+pub const SYS_readahead: ::c_long = 191;
+pub const SYS_pciconfig_read: ::c_long = 198;
+pub const SYS_pciconfig_write: ::c_long = 199;
+pub const SYS_pciconfig_iobase: ::c_long = 200;
+pub const SYS_multiplexer: ::c_long = 201;
+pub const SYS_getdents64: ::c_long = 202;
+pub const SYS_pivot_root: ::c_long = 203;
+pub const SYS_madvise: ::c_long = 205;
+pub const SYS_mincore: ::c_long = 206;
+pub const SYS_gettid: ::c_long = 207;
+pub const SYS_tkill: ::c_long = 208;
+pub const SYS_setxattr: ::c_long = 209;
+pub const SYS_lsetxattr: ::c_long = 210;
+pub const SYS_fsetxattr: ::c_long = 211;
+pub const SYS_getxattr: ::c_long = 212;
+pub const SYS_lgetxattr: ::c_long = 213;
+pub const SYS_fgetxattr: ::c_long = 214;
+pub const SYS_listxattr: ::c_long = 215;
+pub const SYS_llistxattr: ::c_long = 216;
+pub const SYS_flistxattr: ::c_long = 217;
+pub const SYS_removexattr: ::c_long = 218;
+pub const SYS_lremovexattr: ::c_long = 219;
+pub const SYS_fremovexattr: ::c_long = 220;
+pub const SYS_futex: ::c_long = 221;
+pub const SYS_sched_setaffinity: ::c_long = 222;
+pub const SYS_sched_getaffinity: ::c_long = 223;
+pub const SYS_tuxcall: ::c_long = 225;
+pub const SYS_io_setup: ::c_long = 227;
+pub const SYS_io_destroy: ::c_long = 228;
+pub const SYS_io_getevents: ::c_long = 229;
+pub const SYS_io_submit: ::c_long = 230;
+pub const SYS_io_cancel: ::c_long = 231;
+pub const SYS_set_tid_address: ::c_long = 232;
+pub const SYS_exit_group: ::c_long = 234;
+pub const SYS_lookup_dcookie: ::c_long = 235;
+pub const SYS_epoll_create: ::c_long = 236;
+pub const SYS_epoll_ctl: ::c_long = 237;
+pub const SYS_epoll_wait: ::c_long = 238;
+pub const SYS_remap_file_pages: ::c_long = 239;
+pub const SYS_timer_create: ::c_long = 240;
+pub const SYS_timer_settime: ::c_long = 241;
+pub const SYS_timer_gettime: ::c_long = 242;
+pub const SYS_timer_getoverrun: ::c_long = 243;
+pub const SYS_timer_delete: ::c_long = 244;
+pub const SYS_clock_settime: ::c_long = 245;
+pub const SYS_clock_gettime: ::c_long = 246;
+pub const SYS_clock_getres: ::c_long = 247;
+pub const SYS_clock_nanosleep: ::c_long = 248;
+pub const SYS_swapcontext: ::c_long = 249;
+pub const SYS_tgkill: ::c_long = 250;
+pub const SYS_utimes: ::c_long = 251;
+pub const SYS_statfs64: ::c_long = 252;
+pub const SYS_fstatfs64: ::c_long = 253;
+pub const SYS_rtas: ::c_long = 255;
+pub const SYS_sys_debug_setcontext: ::c_long = 256;
+pub const SYS_migrate_pages: ::c_long = 258;
+pub const SYS_mbind: ::c_long = 259;
+pub const SYS_get_mempolicy: ::c_long = 260;
+pub const SYS_set_mempolicy: ::c_long = 261;
+pub const SYS_mq_open: ::c_long = 262;
+pub const SYS_mq_unlink: ::c_long = 263;
+pub const SYS_mq_timedsend: ::c_long = 264;
+pub const SYS_mq_timedreceive: ::c_long = 265;
+pub const SYS_mq_notify: ::c_long = 266;
+pub const SYS_mq_getsetattr: ::c_long = 267;
+pub const SYS_kexec_load: ::c_long = 268;
+pub const SYS_add_key: ::c_long = 269;
+pub const SYS_request_key: ::c_long = 270;
+pub const SYS_keyctl: ::c_long = 271;
+pub const SYS_waitid: ::c_long = 272;
+pub const SYS_ioprio_set: ::c_long = 273;
+pub const SYS_ioprio_get: ::c_long = 274;
+pub const SYS_inotify_init: ::c_long = 275;
+pub const SYS_inotify_add_watch: ::c_long = 276;
+pub const SYS_inotify_rm_watch: ::c_long = 277;
+pub const SYS_spu_run: ::c_long = 278;
+pub const SYS_spu_create: ::c_long = 279;
+pub const SYS_pselect6: ::c_long = 280;
+pub const SYS_ppoll: ::c_long = 281;
+pub const SYS_unshare: ::c_long = 282;
+pub const SYS_splice: ::c_long = 283;
+pub const SYS_tee: ::c_long = 284;
+pub const SYS_vmsplice: ::c_long = 285;
+pub const SYS_openat: ::c_long = 286;
+pub const SYS_mkdirat: ::c_long = 287;
+pub const SYS_mknodat: ::c_long = 288;
+pub const SYS_fchownat: ::c_long = 289;
+pub const SYS_futimesat: ::c_long = 290;
+pub const SYS_newfstatat: ::c_long = 291;
+pub const SYS_unlinkat: ::c_long = 292;
+pub const SYS_renameat: ::c_long = 293;
+pub const SYS_linkat: ::c_long = 294;
+pub const SYS_symlinkat: ::c_long = 295;
+pub const SYS_readlinkat: ::c_long = 296;
+pub const SYS_fchmodat: ::c_long = 297;
+pub const SYS_faccessat: ::c_long = 298;
+pub const SYS_get_robust_list: ::c_long = 299;
+pub const SYS_set_robust_list: ::c_long = 300;
+pub const SYS_move_pages: ::c_long = 301;
+pub const SYS_getcpu: ::c_long = 302;
+pub const SYS_epoll_pwait: ::c_long = 303;
+pub const SYS_utimensat: ::c_long = 304;
+pub const SYS_signalfd: ::c_long = 305;
+pub const SYS_timerfd_create: ::c_long = 306;
+pub const SYS_eventfd: ::c_long = 307;
+pub const SYS_sync_file_range2: ::c_long = 308;
+pub const SYS_fallocate: ::c_long = 309;
+pub const SYS_subpage_prot: ::c_long = 310;
+pub const SYS_timerfd_settime: ::c_long = 311;
+pub const SYS_timerfd_gettime: ::c_long = 312;
+pub const SYS_signalfd4: ::c_long = 313;
+pub const SYS_eventfd2: ::c_long = 314;
+pub const SYS_epoll_create1: ::c_long = 315;
+pub const SYS_dup3: ::c_long = 316;
+pub const SYS_pipe2: ::c_long = 317;
+pub const SYS_inotify_init1: ::c_long = 318;
+pub const SYS_perf_event_open: ::c_long = 319;
+pub const SYS_preadv: ::c_long = 320;
+pub const SYS_pwritev: ::c_long = 321;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 322;
+pub const SYS_fanotify_init: ::c_long = 323;
+pub const SYS_fanotify_mark: ::c_long = 324;
+pub const SYS_prlimit64: ::c_long = 325;
+pub const SYS_socket: ::c_long = 326;
+pub const SYS_bind: ::c_long = 327;
+pub const SYS_connect: ::c_long = 328;
+pub const SYS_listen: ::c_long = 329;
+pub const SYS_accept: ::c_long = 330;
+pub const SYS_getsockname: ::c_long = 331;
+pub const SYS_getpeername: ::c_long = 332;
+pub const SYS_socketpair: ::c_long = 333;
+pub const SYS_send: ::c_long = 334;
+pub const SYS_sendto: ::c_long = 335;
+pub const SYS_recv: ::c_long = 336;
+pub const SYS_recvfrom: ::c_long = 337;
+pub const SYS_shutdown: ::c_long = 338;
+pub const SYS_setsockopt: ::c_long = 339;
+pub const SYS_getsockopt: ::c_long = 340;
+pub const SYS_sendmsg: ::c_long = 341;
+pub const SYS_recvmsg: ::c_long = 342;
+pub const SYS_recvmmsg: ::c_long = 343;
+pub const SYS_accept4: ::c_long = 344;
+pub const SYS_name_to_handle_at: ::c_long = 345;
+pub const SYS_open_by_handle_at: ::c_long = 346;
+pub const SYS_clock_adjtime: ::c_long = 347;
+pub const SYS_syncfs: ::c_long = 348;
+pub const SYS_sendmmsg: ::c_long = 349;
+pub const SYS_setns: ::c_long = 350;
+pub const SYS_process_vm_readv: ::c_long = 351;
+pub const SYS_process_vm_writev: ::c_long = 352;
+pub const SYS_finit_module: ::c_long = 353;
+pub const SYS_kcmp: ::c_long = 354;
+pub const SYS_sched_setattr: ::c_long = 355;
+pub const SYS_sched_getattr: ::c_long = 356;
+pub const SYS_renameat2: ::c_long = 357;
+pub const SYS_seccomp: ::c_long = 358;
+pub const SYS_getrandom: ::c_long = 359;
+pub const SYS_memfd_create: ::c_long = 360;
+pub const SYS_bpf: ::c_long = 361;
+pub const SYS_execveat: ::c_long = 362;
+pub const SYS_switch_endian: ::c_long = 363;
+pub const SYS_userfaultfd: ::c_long = 364;
+pub const SYS_membarrier: ::c_long = 365;
+pub const SYS_mlock2: ::c_long = 378;
+pub const SYS_copy_file_range: ::c_long = 379;
+pub const SYS_preadv2: ::c_long = 380;
+pub const SYS_pwritev2: ::c_long = 381;
+pub const SYS_kexec_file_load: ::c_long = 382;
+pub const SYS_statx: ::c_long = 383;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+pub const EDEADLK: ::c_int = 58;
+pub const EDEADLOCK: ::c_int = EDEADLK;
+
+pub const EXTPROC: ::tcflag_t = 0x10000000;
+pub const VEOL: usize = 6;
+pub const VEOL2: usize = 8;
+pub const VMIN: usize = 5;
+pub const IEXTEN: ::tcflag_t = 0x00000400;
+pub const TOSTOP: ::tcflag_t = 0x00400000;
+pub const FLUSHO: ::tcflag_t = 0x00800000;
+
+pub const MCL_CURRENT: ::c_int = 0x2000;
+pub const MCL_FUTURE: ::c_int = 0x4000;
+pub const MCL_ONFAULT: ::c_int = 0x8000;
+pub const CBAUD: ::tcflag_t = 0xff;
+pub const TAB1: ::c_int = 0x400;
+pub const TAB2: ::c_int = 0x800;
+pub const TAB3: ::c_int = 0xc00;
+pub const CR1: ::c_int = 0x1000;
+pub const CR2: ::c_int = 0x2000;
+pub const CR3: ::c_int = 0x3000;
+pub const FF1: ::c_int = 0x4000;
+pub const BS1: ::c_int = 0x8000;
+pub const VT1: ::c_int = 0x10000;
+pub const VWERASE: usize = 10;
+pub const VREPRINT: usize = 11;
+pub const VSUSP: usize = 12;
+pub const VSTART: usize = 13;
+pub const VSTOP: usize = 14;
+pub const VDISCARD: usize = 16;
+pub const VTIME: usize = 7;
+pub const IXON: ::tcflag_t = 0x00000200;
+pub const IXOFF: ::tcflag_t = 0x00000400;
+pub const ONLCR: ::tcflag_t = 0x2;
+pub const CSIZE: ::tcflag_t = 0x00000300;
+
+pub const CS6: ::tcflag_t = 0x00000100;
+pub const CS7: ::tcflag_t = 0x00000200;
+pub const CS8: ::tcflag_t = 0x00000300;
+pub const CSTOPB: ::tcflag_t = 0x00000400;
+pub const CREAD: ::tcflag_t = 0x00000800;
+pub const PARENB: ::tcflag_t = 0x00001000;
+pub const PARODD: ::tcflag_t = 0x00002000;
+pub const HUPCL: ::tcflag_t = 0x00004000;
+pub const CLOCAL: ::tcflag_t = 0x00008000;
+pub const ECHOKE: ::tcflag_t = 0x00000001;
+pub const ECHOE: ::tcflag_t = 0x00000002;
+pub const ECHOK: ::tcflag_t = 0x00000004;
+pub const ECHONL: ::tcflag_t = 0x00000010;
+pub const ECHOPRT: ::tcflag_t = 0x00000020;
+pub const ECHOCTL: ::tcflag_t = 0x00000040;
+pub const ISIG: ::tcflag_t = 0x00000080;
+pub const ICANON: ::tcflag_t = 0x00000100;
+pub const PENDIN: ::tcflag_t = 0x20000000;
+pub const NOFLSH: ::tcflag_t = 0x80000000;
+
+pub const CIBAUD: ::tcflag_t = 0o77600000;
+pub const CBAUDEX: ::tcflag_t = 0o0000020;
+pub const VSWTC: usize = 9;
+pub const OLCUC: ::tcflag_t = 0o000004;
+pub const NLDLY: ::tcflag_t = 0o0001400;
+pub const CRDLY: ::tcflag_t = 0o0030000;
+pub const TABDLY: ::tcflag_t = 0o0006000;
+pub const BSDLY: ::tcflag_t = 0o0100000;
+pub const FFDLY: ::tcflag_t = 0o0040000;
+pub const VTDLY: ::tcflag_t = 0o0200000;
+pub const XTABS: ::tcflag_t = 0o00006000;
+
+pub const B57600: ::speed_t = 0o00020;
+pub const B115200: ::speed_t = 0o00021;
+pub const B230400: ::speed_t = 0o00022;
+pub const B460800: ::speed_t = 0o00023;
+pub const B500000: ::speed_t = 0o00024;
+pub const B576000: ::speed_t = 0o00025;
+pub const B921600: ::speed_t = 0o00026;
+pub const B1000000: ::speed_t = 0o00027;
+pub const B1152000: ::speed_t = 0o00030;
+pub const B1500000: ::speed_t = 0o00031;
+pub const B2000000: ::speed_t = 0o00032;
+pub const B2500000: ::speed_t = 0o00033;
+pub const B3000000: ::speed_t = 0o00034;
+pub const B3500000: ::speed_t = 0o00035;
+pub const B4000000: ::speed_t = 0o00036;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,44 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    pub struct ucontext_t {
+        pub __uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_mcontext: mcontext_t,
+    }
+
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct mcontext_t {
+        pub __gregs: [::c_ulong; 32],
+        pub __fpregs: __riscv_mc_fp_state,
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub union __riscv_mc_fp_state {
+        pub __f: __riscv_mc_f_ext_state,
+        pub __d: __riscv_mc_d_ext_state,
+        pub __q: __riscv_mc_q_ext_state,
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub struct __riscv_mc_f_ext_state {
+        pub __f: [::c_uint; 32],
+        pub __fcsr: ::c_uint,
+    }
+
+    #[allow(missing_debug_implementations)]
+    pub struct __riscv_mc_d_ext_state {
+        pub __f: [::c_ulonglong; 32],
+        pub __fcsr: ::c_uint,
+    }
+
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct __riscv_mc_q_ext_state {
+        pub __f: [::c_ulonglong; 64],
+        pub __fcsr: ::c_uint,
+        pub __glibc_reserved: [::c_uint; 3],
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,727 @@
+//! RISC-V-specific definitions for 64-bit linux-like values
+
+pub type c_char = u8;
+pub type wchar_t = ::c_int;
+
+pub type nlink_t = ::c_uint;
+pub type blksize_t = ::c_int;
+pub type fsblkcnt64_t = ::c_ulong;
+pub type fsfilcnt64_t = ::c_ulong;
+pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
+
+s! {
+    pub struct pthread_attr_t {
+        __size: [::c_ulong; 7],
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub __pad1: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub __pad2: ::c_int,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_int; 2usize],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub __pad1: ::dev_t,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub __pad2: ::c_int,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_int; 2],
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_long,
+        pub f_frsize: ::c_long,
+        pub f_flags: ::c_long,
+        pub f_spare: [::c_long; 4],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        pub f_blocks: ::fsblkcnt64_t,
+        pub f_bfree: ::fsblkcnt64_t,
+        pub f_bavail: ::fsblkcnt64_t,
+        pub f_files: ::fsfilcnt64_t,
+        pub f_ffree: ::fsfilcnt64_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_long,
+        pub f_frsize: ::c_long,
+        pub f_flags: ::c_long,
+        pub f_spare: [::c_long; 4],
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        pub __f_spare: [::c_int; 6],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt64_t,
+        pub f_bfree: ::fsblkcnt64_t,
+        pub f_bavail: ::fsblkcnt64_t,
+        pub f_files: ::fsfilcnt64_t,
+        pub f_ffree: ::fsfilcnt64_t,
+        pub f_favail: ::fsfilcnt64_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        pub __f_spare: [::c_int; 6],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        #[doc(hidden)]
+        #[deprecated(
+            since="0.2.54",
+            note="Please leave a comment on \
+                  https://github.com/rust-lang/libc/pull/1316 if you're using \
+                  this field"
+        )]
+        pub _pad: [::c_int; 29],
+        _align: [u64; 0],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t,
+    }
+
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<unsafe extern "C" fn()>,
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::c_ushort,
+        __pad1: ::c_ushort,
+        pub __seq: ::c_ushort,
+        __pad2: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong,
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused5: ::c_ulong,
+        __unused6: ::c_ulong,
+    }
+}
+
+pub const SYS_read: ::c_long = 63;
+pub const SYS_write: ::c_long = 64;
+pub const SYS_close: ::c_long = 57;
+pub const SYS_fstat: ::c_long = 80;
+pub const SYS_lseek: ::c_long = 62;
+pub const SYS_mmap: ::c_long = 222;
+pub const SYS_mprotect: ::c_long = 226;
+pub const SYS_munmap: ::c_long = 215;
+pub const SYS_brk: ::c_long = 214;
+pub const SYS_rt_sigaction: ::c_long = 134;
+pub const SYS_rt_sigprocmask: ::c_long = 135;
+pub const SYS_rt_sigreturn: ::c_long = 139;
+pub const SYS_ioctl: ::c_long = 29;
+pub const SYS_pread64: ::c_long = 67;
+pub const SYS_pwrite64: ::c_long = 68;
+pub const SYS_readv: ::c_long = 65;
+pub const SYS_writev: ::c_long = 66;
+pub const SYS_sched_yield: ::c_long = 124;
+pub const SYS_mremap: ::c_long = 216;
+pub const SYS_msync: ::c_long = 227;
+pub const SYS_mincore: ::c_long = 232;
+pub const SYS_madvise: ::c_long = 233;
+pub const SYS_shmget: ::c_long = 194;
+pub const SYS_shmat: ::c_long = 196;
+pub const SYS_shmctl: ::c_long = 195;
+pub const SYS_dup: ::c_long = 23;
+pub const SYS_nanosleep: ::c_long = 101;
+pub const SYS_getitimer: ::c_long = 102;
+pub const SYS_setitimer: ::c_long = 103;
+pub const SYS_getpid: ::c_long = 172;
+pub const SYS_sendfile: ::c_long = 71;
+pub const SYS_socket: ::c_long = 198;
+pub const SYS_connect: ::c_long = 203;
+pub const SYS_accept: ::c_long = 202;
+pub const SYS_sendto: ::c_long = 206;
+pub const SYS_recvfrom: ::c_long = 207;
+pub const SYS_sendmsg: ::c_long = 211;
+pub const SYS_recvmsg: ::c_long = 212;
+pub const SYS_shutdown: ::c_long = 210;
+pub const SYS_bind: ::c_long = 200;
+pub const SYS_listen: ::c_long = 201;
+pub const SYS_getsockname: ::c_long = 204;
+pub const SYS_getpeername: ::c_long = 205;
+pub const SYS_socketpair: ::c_long = 199;
+pub const SYS_setsockopt: ::c_long = 208;
+pub const SYS_getsockopt: ::c_long = 209;
+pub const SYS_clone: ::c_long = 220;
+pub const SYS_execve: ::c_long = 221;
+pub const SYS_exit: ::c_long = 93;
+pub const SYS_wait4: ::c_long = 260;
+pub const SYS_kill: ::c_long = 129;
+pub const SYS_uname: ::c_long = 160;
+pub const SYS_semget: ::c_long = 190;
+pub const SYS_semop: ::c_long = 193;
+pub const SYS_semctl: ::c_long = 191;
+pub const SYS_shmdt: ::c_long = 197;
+pub const SYS_msgget: ::c_long = 186;
+pub const SYS_msgsnd: ::c_long = 189;
+pub const SYS_msgrcv: ::c_long = 188;
+pub const SYS_msgctl: ::c_long = 187;
+pub const SYS_fcntl: ::c_long = 25;
+pub const SYS_flock: ::c_long = 32;
+pub const SYS_fsync: ::c_long = 82;
+pub const SYS_fdatasync: ::c_long = 83;
+pub const SYS_truncate: ::c_long = 45;
+pub const SYS_ftruncate: ::c_long = 46;
+pub const SYS_getcwd: ::c_long = 17;
+pub const SYS_chdir: ::c_long = 49;
+pub const SYS_fchdir: ::c_long = 50;
+pub const SYS_fchmod: ::c_long = 52;
+pub const SYS_fchown: ::c_long = 55;
+pub const SYS_umask: ::c_long = 166;
+pub const SYS_gettimeofday: ::c_long = 169;
+pub const SYS_getrlimit: ::c_long = 163;
+pub const SYS_getrusage: ::c_long = 165;
+pub const SYS_sysinfo: ::c_long = 179;
+pub const SYS_times: ::c_long = 153;
+pub const SYS_ptrace: ::c_long = 117;
+pub const SYS_getuid: ::c_long = 174;
+pub const SYS_syslog: ::c_long = 116;
+pub const SYS_getgid: ::c_long = 176;
+pub const SYS_setuid: ::c_long = 146;
+pub const SYS_setgid: ::c_long = 144;
+pub const SYS_geteuid: ::c_long = 175;
+pub const SYS_getegid: ::c_long = 177;
+pub const SYS_setpgid: ::c_long = 154;
+pub const SYS_getppid: ::c_long = 173;
+pub const SYS_setsid: ::c_long = 157;
+pub const SYS_setreuid: ::c_long = 145;
+pub const SYS_setregid: ::c_long = 143;
+pub const SYS_getgroups: ::c_long = 158;
+pub const SYS_setgroups: ::c_long = 159;
+pub const SYS_setresuid: ::c_long = 147;
+pub const SYS_getresuid: ::c_long = 148;
+pub const SYS_setresgid: ::c_long = 149;
+pub const SYS_getresgid: ::c_long = 150;
+pub const SYS_getpgid: ::c_long = 155;
+pub const SYS_setfsuid: ::c_long = 151;
+pub const SYS_setfsgid: ::c_long = 152;
+pub const SYS_getsid: ::c_long = 156;
+pub const SYS_capget: ::c_long = 90;
+pub const SYS_capset: ::c_long = 91;
+pub const SYS_rt_sigpending: ::c_long = 136;
+pub const SYS_rt_sigtimedwait: ::c_long = 137;
+pub const SYS_rt_sigqueueinfo: ::c_long = 138;
+pub const SYS_rt_sigsuspend: ::c_long = 133;
+pub const SYS_sigaltstack: ::c_long = 132;
+pub const SYS_personality: ::c_long = 92;
+pub const SYS_statfs: ::c_long = 43;
+pub const SYS_fstatfs: ::c_long = 44;
+pub const SYS_getpriority: ::c_long = 141;
+pub const SYS_setpriority: ::c_long = 140;
+pub const SYS_sched_setparam: ::c_long = 118;
+pub const SYS_sched_getparam: ::c_long = 121;
+pub const SYS_sched_setscheduler: ::c_long = 119;
+pub const SYS_sched_getscheduler: ::c_long = 120;
+pub const SYS_sched_get_priority_max: ::c_long = 125;
+pub const SYS_sched_get_priority_min: ::c_long = 126;
+pub const SYS_sched_rr_get_interval: ::c_long = 127;
+pub const SYS_mlock: ::c_long = 228;
+pub const SYS_munlock: ::c_long = 229;
+pub const SYS_mlockall: ::c_long = 230;
+pub const SYS_munlockall: ::c_long = 231;
+pub const SYS_vhangup: ::c_long = 58;
+pub const SYS_pivot_root: ::c_long = 41;
+pub const SYS_prctl: ::c_long = 167;
+pub const SYS_adjtimex: ::c_long = 171;
+pub const SYS_setrlimit: ::c_long = 164;
+pub const SYS_chroot: ::c_long = 51;
+pub const SYS_sync: ::c_long = 81;
+pub const SYS_acct: ::c_long = 89;
+pub const SYS_settimeofday: ::c_long = 170;
+pub const SYS_mount: ::c_long = 40;
+pub const SYS_umount2: ::c_long = 39;
+pub const SYS_swapon: ::c_long = 224;
+pub const SYS_swapoff: ::c_long = 225;
+pub const SYS_reboot: ::c_long = 142;
+pub const SYS_sethostname: ::c_long = 161;
+pub const SYS_setdomainname: ::c_long = 162;
+pub const SYS_init_module: ::c_long = 105;
+pub const SYS_delete_module: ::c_long = 106;
+pub const SYS_quotactl: ::c_long = 60;
+pub const SYS_nfsservctl: ::c_long = 42;
+pub const SYS_gettid: ::c_long = 178;
+pub const SYS_readahead: ::c_long = 213;
+pub const SYS_setxattr: ::c_long = 5;
+pub const SYS_lsetxattr: ::c_long = 6;
+pub const SYS_fsetxattr: ::c_long = 7;
+pub const SYS_getxattr: ::c_long = 8;
+pub const SYS_lgetxattr: ::c_long = 9;
+pub const SYS_fgetxattr: ::c_long = 10;
+pub const SYS_listxattr: ::c_long = 11;
+pub const SYS_llistxattr: ::c_long = 12;
+pub const SYS_flistxattr: ::c_long = 13;
+pub const SYS_removexattr: ::c_long = 14;
+pub const SYS_lremovexattr: ::c_long = 15;
+pub const SYS_fremovexattr: ::c_long = 16;
+pub const SYS_tkill: ::c_long = 130;
+pub const SYS_futex: ::c_long = 98;
+pub const SYS_sched_setaffinity: ::c_long = 122;
+pub const SYS_sched_getaffinity: ::c_long = 123;
+pub const SYS_io_setup: ::c_long = 0;
+pub const SYS_io_destroy: ::c_long = 1;
+pub const SYS_io_getevents: ::c_long = 4;
+pub const SYS_io_submit: ::c_long = 2;
+pub const SYS_io_cancel: ::c_long = 3;
+pub const SYS_lookup_dcookie: ::c_long = 18;
+pub const SYS_remap_file_pages: ::c_long = 234;
+pub const SYS_getdents64: ::c_long = 61;
+pub const SYS_set_tid_address: ::c_long = 96;
+pub const SYS_restart_syscall: ::c_long = 128;
+pub const SYS_semtimedop: ::c_long = 192;
+pub const SYS_fadvise64: ::c_long = 223;
+pub const SYS_timer_create: ::c_long = 107;
+pub const SYS_timer_settime: ::c_long = 110;
+pub const SYS_timer_gettime: ::c_long = 108;
+pub const SYS_timer_getoverrun: ::c_long = 109;
+pub const SYS_timer_delete: ::c_long = 111;
+pub const SYS_clock_settime: ::c_long = 112;
+pub const SYS_clock_gettime: ::c_long = 113;
+pub const SYS_clock_getres: ::c_long = 114;
+pub const SYS_clock_nanosleep: ::c_long = 115;
+pub const SYS_exit_group: ::c_long = 94;
+pub const SYS_epoll_ctl: ::c_long = 21;
+pub const SYS_tgkill: ::c_long = 131;
+pub const SYS_mbind: ::c_long = 235;
+pub const SYS_set_mempolicy: ::c_long = 237;
+pub const SYS_get_mempolicy: ::c_long = 236;
+pub const SYS_mq_open: ::c_long = 180;
+pub const SYS_mq_unlink: ::c_long = 181;
+pub const SYS_mq_timedsend: ::c_long = 182;
+pub const SYS_mq_timedreceive: ::c_long = 183;
+pub const SYS_mq_notify: ::c_long = 184;
+pub const SYS_mq_getsetattr: ::c_long = 185;
+pub const SYS_kexec_load: ::c_long = 104;
+pub const SYS_waitid: ::c_long = 95;
+pub const SYS_add_key: ::c_long = 217;
+pub const SYS_request_key: ::c_long = 218;
+pub const SYS_keyctl: ::c_long = 219;
+pub const SYS_ioprio_set: ::c_long = 30;
+pub const SYS_ioprio_get: ::c_long = 31;
+pub const SYS_inotify_add_watch: ::c_long = 27;
+pub const SYS_inotify_rm_watch: ::c_long = 28;
+pub const SYS_migrate_pages: ::c_long = 238;
+pub const SYS_openat: ::c_long = 56;
+pub const SYS_mkdirat: ::c_long = 34;
+pub const SYS_mknodat: ::c_long = 33;
+pub const SYS_fchownat: ::c_long = 54;
+pub const SYS_newfstatat: ::c_long = 79;
+pub const SYS_unlinkat: ::c_long = 35;
+pub const SYS_linkat: ::c_long = 37;
+pub const SYS_symlinkat: ::c_long = 36;
+pub const SYS_readlinkat: ::c_long = 78;
+pub const SYS_fchmodat: ::c_long = 53;
+pub const SYS_faccessat: ::c_long = 48;
+pub const SYS_pselect6: ::c_long = 72;
+pub const SYS_ppoll: ::c_long = 73;
+pub const SYS_unshare: ::c_long = 97;
+pub const SYS_set_robust_list: ::c_long = 99;
+pub const SYS_get_robust_list: ::c_long = 100;
+pub const SYS_splice: ::c_long = 76;
+pub const SYS_tee: ::c_long = 77;
+pub const SYS_sync_file_range: ::c_long = 84;
+pub const SYS_vmsplice: ::c_long = 75;
+pub const SYS_move_pages: ::c_long = 239;
+pub const SYS_utimensat: ::c_long = 88;
+pub const SYS_epoll_pwait: ::c_long = 22;
+pub const SYS_timerfd_create: ::c_long = 85;
+pub const SYS_fallocate: ::c_long = 47;
+pub const SYS_timerfd_settime: ::c_long = 86;
+pub const SYS_timerfd_gettime: ::c_long = 87;
+pub const SYS_accept4: ::c_long = 242;
+pub const SYS_signalfd4: ::c_long = 74;
+pub const SYS_eventfd2: ::c_long = 19;
+pub const SYS_epoll_create1: ::c_long = 20;
+pub const SYS_dup3: ::c_long = 24;
+pub const SYS_pipe2: ::c_long = 59;
+pub const SYS_inotify_init1: ::c_long = 26;
+pub const SYS_preadv: ::c_long = 69;
+pub const SYS_pwritev: ::c_long = 70;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
+pub const SYS_perf_event_open: ::c_long = 241;
+pub const SYS_recvmmsg: ::c_long = 243;
+pub const SYS_fanotify_init: ::c_long = 262;
+pub const SYS_fanotify_mark: ::c_long = 263;
+pub const SYS_prlimit64: ::c_long = 261;
+pub const SYS_name_to_handle_at: ::c_long = 264;
+pub const SYS_open_by_handle_at: ::c_long = 265;
+pub const SYS_clock_adjtime: ::c_long = 266;
+pub const SYS_syncfs: ::c_long = 267;
+pub const SYS_sendmmsg: ::c_long = 269;
+pub const SYS_setns: ::c_long = 268;
+pub const SYS_getcpu: ::c_long = 168;
+pub const SYS_process_vm_readv: ::c_long = 270;
+pub const SYS_process_vm_writev: ::c_long = 271;
+pub const SYS_kcmp: ::c_long = 272;
+pub const SYS_finit_module: ::c_long = 273;
+pub const SYS_sched_setattr: ::c_long = 274;
+pub const SYS_sched_getattr: ::c_long = 275;
+pub const SYS_renameat2: ::c_long = 276;
+pub const SYS_seccomp: ::c_long = 277;
+pub const SYS_getrandom: ::c_long = 278;
+pub const SYS_memfd_create: ::c_long = 279;
+pub const SYS_bpf: ::c_long = 280;
+pub const SYS_execveat: ::c_long = 281;
+pub const SYS_userfaultfd: ::c_long = 282;
+pub const SYS_membarrier: ::c_long = 283;
+pub const SYS_mlock2: ::c_long = 284;
+pub const SYS_copy_file_range: ::c_long = 285;
+pub const SYS_preadv2: ::c_long = 286;
+pub const SYS_pwritev2: ::c_long = 287;
+pub const SYS_pkey_mprotect: ::c_long = 288;
+pub const SYS_pkey_alloc: ::c_long = 289;
+pub const SYS_pkey_free: ::c_long = 290;
+pub const SYS_statx: ::c_long = 291;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+
+pub const O_APPEND: ::c_int = 1024;
+pub const O_DIRECT: ::c_int = 0x4000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_LARGEFILE: ::c_int = 0;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_ASYNC: ::c_int = 0x2000;
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EBADMSG: ::c_int = 74;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const EHWPOISON: ::c_int = 133;
+pub const ERFKILL: ::c_int = 132;
+
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+pub const F_SETOWN: ::c_int = 8;
+
+pub const VEOF: usize = 4;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_LOCKED: ::c_int = 0x02000;
+pub const MAP_NORESERVE: ::c_int = 0x04000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::c_int = 0x00000800;
+pub const TAB2: ::c_int = 0x00001000;
+pub const TAB3: ::c_int = 0x00001800;
+pub const CR1: ::c_int = 0x00000200;
+pub const CR2: ::c_int = 0x00000400;
+pub const CR3: ::c_int = 0x00000600;
+pub const FF1: ::c_int = 0x00008000;
+pub const BS1: ::c_int = 0x00002000;
+pub const VT1: ::c_int = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const EDEADLK: ::c_int = 35;
+pub const EDEADLOCK: ::c_int = EDEADLK;
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+
+pub const NGREG: usize = 32;
+pub const REG_PC: usize = 0;
+pub const REG_RA: usize = 1;
+pub const REG_SP: usize = 2;
+pub const REG_TP: usize = 4;
+pub const REG_S0: usize = 8;
+pub const REG_S1: usize = 9;
+pub const REG_A0: usize = 10;
+pub const REG_S2: usize = 18;
+pub const REG_NARGS: usize = 8;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,724 @@
+pub type blksize_t = i64;
+pub type c_char = u8;
+pub type nlink_t = u64;
+pub type wchar_t = i32;
+pub type greg_t = u64;
+pub type __u64 = u64;
+pub type __s64 = i64;
+
+s! {
+    pub struct ipc_perm {
+        pub __ipc_perm_key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_int,
+        __pad1: ::c_long,
+        __pad2: ::c_long,
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        __unused: [::c_long; 3],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_t,
+        __unused: [::c_long; 3],
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_uint,
+        pub f_bsize: ::c_uint,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_uint,
+        pub f_frsize: ::c_uint,
+        pub f_flags: ::c_uint,
+        pub f_spare: [::c_uint; 4],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_uint,
+        pub f_bsize: ::c_uint,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_uint,
+        pub f_frsize: ::c_uint,
+        pub f_flags: ::c_uint,
+        pub f_spare: [::c_uint; 4],
+    }
+}
+
+s_no_extra_traits! {
+    // FIXME: This is actually a union.
+    pub struct fpreg_t {
+        pub d: ::c_double,
+        // f: ::c_float,
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for fpreg_t {
+            fn eq(&self, other: &fpreg_t) -> bool {
+                self.d == other.d
+            }
+        }
+
+        impl Eq for fpreg_t {}
+
+        impl ::fmt::Debug for fpreg_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("fpreg_t")
+                    .field("d", &self.d)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for fpreg_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let d: u64 = unsafe { ::mem::transmute(self.d) };
+                d.hash(state);
+            }
+        }
+    }
+}
+
+pub const VEOF: usize = 4;
+pub const RTLD_DEEPBIND: ::c_int = 0x8;
+
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const ECONNRESET: ::c_int = 104;
+pub const EDEADLK: ::c_int = 35;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTCONN: ::c_int = 107;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const O_APPEND: ::c_int = 1024;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_LARGEFILE: ::c_int = 0x8000;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const SA_NOCLDWAIT: ::c_int = 2;
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 4;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGSTKSZ: ::size_t = 0x2000;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+pub const SIG_SETMASK: ::c_int = 2;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_FSYNC: ::c_int = 0x101000;
+pub const O_DIRECT: ::c_int = 0x4000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_LOCKED: ::c_int = 0x02000;
+pub const MAP_NORESERVE: ::c_int = 0x04000;
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const PTRACE_SYSEMU: ::c_int = 31;
+pub const PTRACE_SYSEMU_SINGLESTEP: ::c_int = 32;
+
+pub const EDEADLOCK: ::c_int = 35;
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EBADMSG: ::c_int = 74;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const EHWPOISON: ::c_int = 133;
+pub const ERFKILL: ::c_int = 132;
+
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+
+pub const O_ASYNC: ::c_int = 0x2000;
+
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETOWN: ::c_int = 8;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+
+pub const VTIME: usize = 5;
+pub const VSWTC: usize = 7;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VSUSP: usize = 10;
+pub const VREPRINT: usize = 12;
+pub const VDISCARD: usize = 13;
+pub const VWERASE: usize = 14;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const ONLCR: ::tcflag_t = 0o000004;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const CBAUD: ::speed_t = 0o010017;
+pub const CSIZE: ::tcflag_t = 0o000060;
+pub const CS6: ::tcflag_t = 0o000020;
+pub const CS7: ::tcflag_t = 0o000040;
+pub const CS8: ::tcflag_t = 0o000060;
+pub const CSTOPB: ::tcflag_t = 0o000100;
+pub const CREAD: ::tcflag_t = 0o000200;
+pub const PARENB: ::tcflag_t = 0o000400;
+pub const PARODD: ::tcflag_t = 0o001000;
+pub const HUPCL: ::tcflag_t = 0o002000;
+pub const CLOCAL: ::tcflag_t = 0o004000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+
+pub const ISIG: ::tcflag_t = 0o000001;
+pub const ICANON: ::tcflag_t = 0o000002;
+pub const XCASE: ::tcflag_t = 0o000004;
+pub const ECHOE: ::tcflag_t = 0o000020;
+pub const ECHOK: ::tcflag_t = 0o000040;
+pub const ECHONL: ::tcflag_t = 0o000100;
+pub const NOFLSH: ::tcflag_t = 0o000200;
+pub const ECHOCTL: ::tcflag_t = 0o001000;
+pub const ECHOPRT: ::tcflag_t = 0o002000;
+pub const ECHOKE: ::tcflag_t = 0o004000;
+pub const PENDIN: ::tcflag_t = 0o040000;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const IXON: ::tcflag_t = 0o002000;
+pub const IXOFF: ::tcflag_t = 0o010000;
+
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_restart_syscall: ::c_long = 7;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execve: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_mount: ::c_long = 21;
+pub const SYS_umount: ::c_long = 22;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_alarm: ::c_long = 27;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_utime: ::c_long = 30;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_signal: ::c_long = 48;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount2: ::c_long = 52;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_sigsuspend: ::c_long = 72;
+pub const SYS_sigpending: ::c_long = 73;
+pub const SYS_sethostname: ::c_long = 74;
+pub const SYS_setrlimit: ::c_long = 75;
+pub const SYS_getrusage: ::c_long = 77;
+pub const SYS_gettimeofday: ::c_long = 78;
+pub const SYS_settimeofday: ::c_long = 79;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_readlink: ::c_long = 85;
+pub const SYS_uselib: ::c_long = 86;
+pub const SYS_swapon: ::c_long = 87;
+pub const SYS_reboot: ::c_long = 88;
+pub const SYS_readdir: ::c_long = 89;
+pub const SYS_mmap: ::c_long = 90;
+pub const SYS_munmap: ::c_long = 91;
+pub const SYS_truncate: ::c_long = 92;
+pub const SYS_ftruncate: ::c_long = 93;
+pub const SYS_fchmod: ::c_long = 94;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_socketcall: ::c_long = 102;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_setitimer: ::c_long = 104;
+pub const SYS_getitimer: ::c_long = 105;
+pub const SYS_stat: ::c_long = 106;
+pub const SYS_lstat: ::c_long = 107;
+pub const SYS_fstat: ::c_long = 108;
+pub const SYS_lookup_dcookie: ::c_long = 110;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_idle: ::c_long = 112;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_ipc: ::c_long = 117;
+pub const SYS_fsync: ::c_long = 118;
+pub const SYS_sigreturn: ::c_long = 119;
+pub const SYS_clone: ::c_long = 120;
+pub const SYS_setdomainname: ::c_long = 121;
+pub const SYS_uname: ::c_long = 122;
+pub const SYS_adjtimex: ::c_long = 124;
+pub const SYS_mprotect: ::c_long = 125;
+pub const SYS_sigprocmask: ::c_long = 126;
+pub const SYS_create_module: ::c_long = 127;
+pub const SYS_init_module: ::c_long = 128;
+pub const SYS_delete_module: ::c_long = 129;
+pub const SYS_get_kernel_syms: ::c_long = 130;
+pub const SYS_quotactl: ::c_long = 131;
+pub const SYS_getpgid: ::c_long = 132;
+pub const SYS_fchdir: ::c_long = 133;
+pub const SYS_bdflush: ::c_long = 134;
+pub const SYS_sysfs: ::c_long = 135;
+pub const SYS_personality: ::c_long = 136;
+pub const SYS_afs_syscall: ::c_long = 137; /* Syscall for Andrew File System */
+pub const SYS_getdents: ::c_long = 141;
+pub const SYS_flock: ::c_long = 143;
+pub const SYS_msync: ::c_long = 144;
+pub const SYS_readv: ::c_long = 145;
+pub const SYS_writev: ::c_long = 146;
+pub const SYS_getsid: ::c_long = 147;
+pub const SYS_fdatasync: ::c_long = 148;
+pub const SYS__sysctl: ::c_long = 149;
+pub const SYS_mlock: ::c_long = 150;
+pub const SYS_munlock: ::c_long = 151;
+pub const SYS_mlockall: ::c_long = 152;
+pub const SYS_munlockall: ::c_long = 153;
+pub const SYS_sched_setparam: ::c_long = 154;
+pub const SYS_sched_getparam: ::c_long = 155;
+pub const SYS_sched_setscheduler: ::c_long = 156;
+pub const SYS_sched_getscheduler: ::c_long = 157;
+pub const SYS_sched_yield: ::c_long = 158;
+pub const SYS_sched_get_priority_max: ::c_long = 159;
+pub const SYS_sched_get_priority_min: ::c_long = 160;
+pub const SYS_sched_rr_get_interval: ::c_long = 161;
+pub const SYS_nanosleep: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_query_module: ::c_long = 167;
+pub const SYS_poll: ::c_long = 168;
+pub const SYS_nfsservctl: ::c_long = 169;
+pub const SYS_prctl: ::c_long = 172;
+pub const SYS_rt_sigreturn: ::c_long = 173;
+pub const SYS_rt_sigaction: ::c_long = 174;
+pub const SYS_rt_sigprocmask: ::c_long = 175;
+pub const SYS_rt_sigpending: ::c_long = 176;
+pub const SYS_rt_sigtimedwait: ::c_long = 177;
+pub const SYS_rt_sigqueueinfo: ::c_long = 178;
+pub const SYS_rt_sigsuspend: ::c_long = 179;
+pub const SYS_pread64: ::c_long = 180;
+pub const SYS_pwrite64: ::c_long = 181;
+pub const SYS_getcwd: ::c_long = 183;
+pub const SYS_capget: ::c_long = 184;
+pub const SYS_capset: ::c_long = 185;
+pub const SYS_sigaltstack: ::c_long = 186;
+pub const SYS_sendfile: ::c_long = 187;
+pub const SYS_getpmsg: ::c_long = 188;
+pub const SYS_putpmsg: ::c_long = 189;
+pub const SYS_vfork: ::c_long = 190;
+pub const SYS_pivot_root: ::c_long = 217;
+pub const SYS_mincore: ::c_long = 218;
+pub const SYS_madvise: ::c_long = 219;
+pub const SYS_getdents64: ::c_long = 220;
+pub const SYS_readahead: ::c_long = 222;
+pub const SYS_setxattr: ::c_long = 224;
+pub const SYS_lsetxattr: ::c_long = 225;
+pub const SYS_fsetxattr: ::c_long = 226;
+pub const SYS_getxattr: ::c_long = 227;
+pub const SYS_lgetxattr: ::c_long = 228;
+pub const SYS_fgetxattr: ::c_long = 229;
+pub const SYS_listxattr: ::c_long = 230;
+pub const SYS_llistxattr: ::c_long = 231;
+pub const SYS_flistxattr: ::c_long = 232;
+pub const SYS_removexattr: ::c_long = 233;
+pub const SYS_lremovexattr: ::c_long = 234;
+pub const SYS_fremovexattr: ::c_long = 235;
+pub const SYS_gettid: ::c_long = 236;
+pub const SYS_tkill: ::c_long = 237;
+pub const SYS_futex: ::c_long = 238;
+pub const SYS_sched_setaffinity: ::c_long = 239;
+pub const SYS_sched_getaffinity: ::c_long = 240;
+pub const SYS_tgkill: ::c_long = 241;
+pub const SYS_io_setup: ::c_long = 243;
+pub const SYS_io_destroy: ::c_long = 244;
+pub const SYS_io_getevents: ::c_long = 245;
+pub const SYS_io_submit: ::c_long = 246;
+pub const SYS_io_cancel: ::c_long = 247;
+pub const SYS_exit_group: ::c_long = 248;
+pub const SYS_epoll_create: ::c_long = 249;
+pub const SYS_epoll_ctl: ::c_long = 250;
+pub const SYS_epoll_wait: ::c_long = 251;
+pub const SYS_set_tid_address: ::c_long = 252;
+pub const SYS_fadvise64: ::c_long = 253;
+pub const SYS_timer_create: ::c_long = 254;
+pub const SYS_timer_settime: ::c_long = 255;
+pub const SYS_timer_gettime: ::c_long = 256;
+pub const SYS_timer_getoverrun: ::c_long = 257;
+pub const SYS_timer_delete: ::c_long = 258;
+pub const SYS_clock_settime: ::c_long = 259;
+pub const SYS_clock_gettime: ::c_long = 260;
+pub const SYS_clock_getres: ::c_long = 261;
+pub const SYS_clock_nanosleep: ::c_long = 262;
+pub const SYS_statfs64: ::c_long = 265;
+pub const SYS_fstatfs64: ::c_long = 266;
+pub const SYS_remap_file_pages: ::c_long = 267;
+pub const SYS_mbind: ::c_long = 268;
+pub const SYS_get_mempolicy: ::c_long = 269;
+pub const SYS_set_mempolicy: ::c_long = 270;
+pub const SYS_mq_open: ::c_long = 271;
+pub const SYS_mq_unlink: ::c_long = 272;
+pub const SYS_mq_timedsend: ::c_long = 273;
+pub const SYS_mq_timedreceive: ::c_long = 274;
+pub const SYS_mq_notify: ::c_long = 275;
+pub const SYS_mq_getsetattr: ::c_long = 276;
+pub const SYS_kexec_load: ::c_long = 277;
+pub const SYS_add_key: ::c_long = 278;
+pub const SYS_request_key: ::c_long = 279;
+pub const SYS_keyctl: ::c_long = 280;
+pub const SYS_waitid: ::c_long = 281;
+pub const SYS_ioprio_set: ::c_long = 282;
+pub const SYS_ioprio_get: ::c_long = 283;
+pub const SYS_inotify_init: ::c_long = 284;
+pub const SYS_inotify_add_watch: ::c_long = 285;
+pub const SYS_inotify_rm_watch: ::c_long = 286;
+pub const SYS_migrate_pages: ::c_long = 287;
+pub const SYS_openat: ::c_long = 288;
+pub const SYS_mkdirat: ::c_long = 289;
+pub const SYS_mknodat: ::c_long = 290;
+pub const SYS_fchownat: ::c_long = 291;
+pub const SYS_futimesat: ::c_long = 292;
+pub const SYS_unlinkat: ::c_long = 294;
+pub const SYS_renameat: ::c_long = 295;
+pub const SYS_linkat: ::c_long = 296;
+pub const SYS_symlinkat: ::c_long = 297;
+pub const SYS_readlinkat: ::c_long = 298;
+pub const SYS_fchmodat: ::c_long = 299;
+pub const SYS_faccessat: ::c_long = 300;
+pub const SYS_pselect6: ::c_long = 301;
+pub const SYS_ppoll: ::c_long = 302;
+pub const SYS_unshare: ::c_long = 303;
+pub const SYS_set_robust_list: ::c_long = 304;
+pub const SYS_get_robust_list: ::c_long = 305;
+pub const SYS_splice: ::c_long = 306;
+pub const SYS_sync_file_range: ::c_long = 307;
+pub const SYS_tee: ::c_long = 308;
+pub const SYS_vmsplice: ::c_long = 309;
+pub const SYS_move_pages: ::c_long = 310;
+pub const SYS_getcpu: ::c_long = 311;
+pub const SYS_epoll_pwait: ::c_long = 312;
+pub const SYS_utimes: ::c_long = 313;
+pub const SYS_fallocate: ::c_long = 314;
+pub const SYS_utimensat: ::c_long = 315;
+pub const SYS_signalfd: ::c_long = 316;
+pub const SYS_timerfd: ::c_long = 317;
+pub const SYS_eventfd: ::c_long = 318;
+pub const SYS_timerfd_create: ::c_long = 319;
+pub const SYS_timerfd_settime: ::c_long = 320;
+pub const SYS_timerfd_gettime: ::c_long = 321;
+pub const SYS_signalfd4: ::c_long = 322;
+pub const SYS_eventfd2: ::c_long = 323;
+pub const SYS_inotify_init1: ::c_long = 324;
+pub const SYS_pipe2: ::c_long = 325;
+pub const SYS_dup3: ::c_long = 326;
+pub const SYS_epoll_create1: ::c_long = 327;
+pub const SYS_preadv: ::c_long = 328;
+pub const SYS_pwritev: ::c_long = 329;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 330;
+pub const SYS_perf_event_open: ::c_long = 331;
+pub const SYS_fanotify_init: ::c_long = 332;
+pub const SYS_fanotify_mark: ::c_long = 333;
+pub const SYS_prlimit64: ::c_long = 334;
+pub const SYS_name_to_handle_at: ::c_long = 335;
+pub const SYS_open_by_handle_at: ::c_long = 336;
+pub const SYS_clock_adjtime: ::c_long = 337;
+pub const SYS_syncfs: ::c_long = 338;
+pub const SYS_setns: ::c_long = 339;
+pub const SYS_process_vm_readv: ::c_long = 340;
+pub const SYS_process_vm_writev: ::c_long = 341;
+pub const SYS_s390_runtime_instr: ::c_long = 342;
+pub const SYS_kcmp: ::c_long = 343;
+pub const SYS_finit_module: ::c_long = 344;
+pub const SYS_sched_setattr: ::c_long = 345;
+pub const SYS_sched_getattr: ::c_long = 346;
+pub const SYS_renameat2: ::c_long = 347;
+pub const SYS_seccomp: ::c_long = 348;
+pub const SYS_getrandom: ::c_long = 349;
+pub const SYS_memfd_create: ::c_long = 350;
+pub const SYS_bpf: ::c_long = 351;
+pub const SYS_s390_pci_mmio_write: ::c_long = 352;
+pub const SYS_s390_pci_mmio_read: ::c_long = 353;
+pub const SYS_execveat: ::c_long = 354;
+pub const SYS_userfaultfd: ::c_long = 355;
+pub const SYS_membarrier: ::c_long = 356;
+pub const SYS_recvmmsg: ::c_long = 357;
+pub const SYS_sendmmsg: ::c_long = 358;
+pub const SYS_socket: ::c_long = 359;
+pub const SYS_socketpair: ::c_long = 360;
+pub const SYS_bind: ::c_long = 361;
+pub const SYS_connect: ::c_long = 362;
+pub const SYS_listen: ::c_long = 363;
+pub const SYS_accept4: ::c_long = 364;
+pub const SYS_getsockopt: ::c_long = 365;
+pub const SYS_setsockopt: ::c_long = 366;
+pub const SYS_getsockname: ::c_long = 367;
+pub const SYS_getpeername: ::c_long = 368;
+pub const SYS_sendto: ::c_long = 369;
+pub const SYS_sendmsg: ::c_long = 370;
+pub const SYS_recvfrom: ::c_long = 371;
+pub const SYS_recvmsg: ::c_long = 372;
+pub const SYS_shutdown: ::c_long = 373;
+pub const SYS_mlock2: ::c_long = 374;
+pub const SYS_copy_file_range: ::c_long = 375;
+pub const SYS_preadv2: ::c_long = 376;
+pub const SYS_pwritev2: ::c_long = 377;
+pub const SYS_lchown: ::c_long = 198;
+pub const SYS_setuid: ::c_long = 213;
+pub const SYS_getuid: ::c_long = 199;
+pub const SYS_setgid: ::c_long = 214;
+pub const SYS_getgid: ::c_long = 200;
+pub const SYS_geteuid: ::c_long = 201;
+pub const SYS_setreuid: ::c_long = 203;
+pub const SYS_setregid: ::c_long = 204;
+pub const SYS_getrlimit: ::c_long = 191;
+pub const SYS_getgroups: ::c_long = 205;
+pub const SYS_fchown: ::c_long = 207;
+pub const SYS_setresuid: ::c_long = 208;
+pub const SYS_setresgid: ::c_long = 210;
+pub const SYS_getresgid: ::c_long = 211;
+pub const SYS_select: ::c_long = 142;
+pub const SYS_getegid: ::c_long = 202;
+pub const SYS_setgroups: ::c_long = 206;
+pub const SYS_getresuid: ::c_long = 209;
+pub const SYS_chown: ::c_long = 212;
+pub const SYS_setfsuid: ::c_long = 215;
+pub const SYS_setfsgid: ::c_long = 216;
+pub const SYS_newfstatat: ::c_long = 293;
+pub const SYS_statx: ::c_long = 379;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,25 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f64; 4]
+    }
+
+}
+
+s! {
+    #[repr(align(8))]
+    pub struct clone_args {
+        pub flags: ::c_ulonglong,
+        pub pidfd: ::c_ulonglong,
+        pub child_tid: ::c_ulonglong,
+        pub parent_tid: ::c_ulonglong,
+        pub exit_signal: ::c_ulonglong,
+        pub stack: ::c_ulonglong,
+        pub stack_size: ::c_ulonglong,
+        pub tls: ::c_ulonglong,
+        pub set_tid: ::c_ulonglong,
+        pub set_tid_size: ::c_ulonglong,
+        pub cgroup: ::c_ulonglong,
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,915 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
+pub type nlink_t = u64;
+pub type blksize_t = ::c_long;
+pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
+pub type greg_t = i64;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        __pad0: ::c_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused: [::c_long; 3],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        __pad0: ::c_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __reserved: [::c_long; 3],
+    }
+
+    pub struct user_regs_struct {
+        pub r15: ::c_ulong,
+        pub r14: ::c_ulong,
+        pub r13: ::c_ulong,
+        pub r12: ::c_ulong,
+        pub rbp: ::c_ulong,
+        pub rbx: ::c_ulong,
+        pub r11: ::c_ulong,
+        pub r10: ::c_ulong,
+        pub r9: ::c_ulong,
+        pub r8: ::c_ulong,
+        pub rax: ::c_ulong,
+        pub rcx: ::c_ulong,
+        pub rdx: ::c_ulong,
+        pub rsi: ::c_ulong,
+        pub rdi: ::c_ulong,
+        pub orig_rax: ::c_ulong,
+        pub rip: ::c_ulong,
+        pub cs: ::c_ulong,
+        pub eflags: ::c_ulong,
+        pub rsp: ::c_ulong,
+        pub ss: ::c_ulong,
+        pub fs_base: ::c_ulong,
+        pub gs_base: ::c_ulong,
+        pub ds: ::c_ulong,
+        pub es: ::c_ulong,
+        pub fs: ::c_ulong,
+        pub gs: ::c_ulong,
+    }
+
+    pub struct user {
+        pub regs: user_regs_struct,
+        pub u_fpvalid: ::c_int,
+        pub i387: user_fpregs_struct,
+        pub u_tsize: ::c_ulong,
+        pub u_dsize: ::c_ulong,
+        pub u_ssize: ::c_ulong,
+        pub start_code: ::c_ulong,
+        pub start_stack: ::c_ulong,
+        pub signal: ::c_long,
+        __reserved: ::c_int,
+        #[cfg(target_pointer_width = "32")]
+        __pad1: u32,
+        pub u_ar0: *mut user_regs_struct,
+        #[cfg(target_pointer_width = "32")]
+        __pad2: u32,
+        pub u_fpstate: *mut user_fpregs_struct,
+        pub magic: ::c_ulong,
+        pub u_comm: [::c_char; 32],
+        pub u_debugreg: [::c_ulong; 8],
+    }
+
+    // GitHub repo: ifduyue/musl/
+    // commit: b4b1e10364c8737a632be61582e05a8d3acf5690
+    // file: arch/x86_64/bits/signal.h#L80-L84
+    pub struct mcontext_t {
+        pub gregs: [greg_t; 23],
+        __private: [u64; 9],
+    }
+
+    pub struct ipc_perm {
+        pub __ipc_perm_key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_int,
+        __unused1: ::c_long,
+        __unused2: ::c_long
+    }
+}
+
+s_no_extra_traits! {
+    pub struct user_fpregs_struct {
+        pub cwd: ::c_ushort,
+        pub swd: ::c_ushort,
+        pub ftw: ::c_ushort,
+        pub fop: ::c_ushort,
+        pub rip: ::c_ulong,
+        pub rdp: ::c_ulong,
+        pub mxcsr: ::c_uint,
+        pub mxcr_mask: ::c_uint,
+        pub st_space: [::c_uint; 32],
+        pub xmm_space: [::c_uint; 64],
+        padding: [::c_uint; 24],
+    }
+
+    pub struct ucontext_t {
+        pub uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_mcontext: mcontext_t,
+        pub uc_sigmask: ::sigset_t,
+        __private: [u8; 512],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for user_fpregs_struct {
+            fn eq(&self, other: &user_fpregs_struct) -> bool {
+                self.cwd == other.cwd
+                    && self.swd == other.swd
+                    && self.ftw == other.ftw
+                    && self.fop == other.fop
+                    && self.rip == other.rip
+                    && self.rdp == other.rdp
+                    && self.mxcsr == other.mxcsr
+                    && self.mxcr_mask == other.mxcr_mask
+                    && self.st_space == other.st_space
+                    && self
+                    .xmm_space
+                    .iter()
+                    .zip(other.xmm_space.iter())
+                    .all(|(a,b)| a == b)
+                // Ignore padding field
+            }
+        }
+
+        impl Eq for user_fpregs_struct {}
+
+        impl ::fmt::Debug for user_fpregs_struct {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("user_fpregs_struct")
+                    .field("cwd", &self.cwd)
+                    .field("ftw", &self.ftw)
+                    .field("fop", &self.fop)
+                    .field("rip", &self.rip)
+                    .field("rdp", &self.rdp)
+                    .field("mxcsr", &self.mxcsr)
+                    .field("mxcr_mask", &self.mxcr_mask)
+                    .field("st_space", &self.st_space)
+                // FIXME: .field("xmm_space", &self.xmm_space)
+                // Ignore padding field
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for user_fpregs_struct {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.cwd.hash(state);
+                self.ftw.hash(state);
+                self.fop.hash(state);
+                self.rip.hash(state);
+                self.rdp.hash(state);
+                self.mxcsr.hash(state);
+                self.mxcr_mask.hash(state);
+                self.st_space.hash(state);
+                self.xmm_space.hash(state);
+                // Ignore padding field
+            }
+        }
+
+        impl PartialEq for ucontext_t {
+            fn eq(&self, other: &ucontext_t) -> bool {
+                self.uc_flags == other.uc_flags
+                    && self.uc_link == other.uc_link
+                    && self.uc_stack == other.uc_stack
+                    && self.uc_mcontext == other.uc_mcontext
+                    && self.uc_sigmask == other.uc_sigmask
+                    && self
+                    .__private
+                    .iter()
+                    .zip(other.__private.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for ucontext_t {}
+
+        impl ::fmt::Debug for ucontext_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ucontext_t")
+                    .field("uc_flags", &self.uc_flags)
+                    .field("uc_link", &self.uc_link)
+                    .field("uc_stack", &self.uc_stack)
+                    .field("uc_mcontext", &self.uc_mcontext)
+                    .field("uc_sigmask", &self.uc_sigmask)
+                // Ignore __private field
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for ucontext_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.uc_flags.hash(state);
+                self.uc_link.hash(state);
+                self.uc_stack.hash(state);
+                self.uc_mcontext.hash(state);
+                self.uc_sigmask.hash(state);
+                self.__private.hash(state);
+            }
+        }
+    }
+}
+
+// Syscall table
+
+pub const SYS_read: ::c_long = 0;
+pub const SYS_write: ::c_long = 1;
+pub const SYS_open: ::c_long = 2;
+pub const SYS_close: ::c_long = 3;
+pub const SYS_stat: ::c_long = 4;
+pub const SYS_fstat: ::c_long = 5;
+pub const SYS_lstat: ::c_long = 6;
+pub const SYS_poll: ::c_long = 7;
+pub const SYS_lseek: ::c_long = 8;
+pub const SYS_mmap: ::c_long = 9;
+pub const SYS_mprotect: ::c_long = 10;
+pub const SYS_munmap: ::c_long = 11;
+pub const SYS_brk: ::c_long = 12;
+pub const SYS_rt_sigaction: ::c_long = 13;
+pub const SYS_rt_sigprocmask: ::c_long = 14;
+pub const SYS_rt_sigreturn: ::c_long = 15;
+pub const SYS_ioctl: ::c_long = 16;
+pub const SYS_pread64: ::c_long = 17;
+pub const SYS_pwrite64: ::c_long = 18;
+pub const SYS_readv: ::c_long = 19;
+pub const SYS_writev: ::c_long = 20;
+pub const SYS_access: ::c_long = 21;
+pub const SYS_pipe: ::c_long = 22;
+pub const SYS_select: ::c_long = 23;
+pub const SYS_sched_yield: ::c_long = 24;
+pub const SYS_mremap: ::c_long = 25;
+pub const SYS_msync: ::c_long = 26;
+pub const SYS_mincore: ::c_long = 27;
+pub const SYS_madvise: ::c_long = 28;
+pub const SYS_shmget: ::c_long = 29;
+pub const SYS_shmat: ::c_long = 30;
+pub const SYS_shmctl: ::c_long = 31;
+pub const SYS_dup: ::c_long = 32;
+pub const SYS_dup2: ::c_long = 33;
+pub const SYS_pause: ::c_long = 34;
+pub const SYS_nanosleep: ::c_long = 35;
+pub const SYS_getitimer: ::c_long = 36;
+pub const SYS_alarm: ::c_long = 37;
+pub const SYS_setitimer: ::c_long = 38;
+pub const SYS_getpid: ::c_long = 39;
+pub const SYS_sendfile: ::c_long = 40;
+pub const SYS_socket: ::c_long = 41;
+pub const SYS_connect: ::c_long = 42;
+pub const SYS_accept: ::c_long = 43;
+pub const SYS_sendto: ::c_long = 44;
+pub const SYS_recvfrom: ::c_long = 45;
+pub const SYS_sendmsg: ::c_long = 46;
+pub const SYS_recvmsg: ::c_long = 47;
+pub const SYS_shutdown: ::c_long = 48;
+pub const SYS_bind: ::c_long = 49;
+pub const SYS_listen: ::c_long = 50;
+pub const SYS_getsockname: ::c_long = 51;
+pub const SYS_getpeername: ::c_long = 52;
+pub const SYS_socketpair: ::c_long = 53;
+pub const SYS_setsockopt: ::c_long = 54;
+pub const SYS_getsockopt: ::c_long = 55;
+pub const SYS_clone: ::c_long = 56;
+pub const SYS_fork: ::c_long = 57;
+pub const SYS_vfork: ::c_long = 58;
+pub const SYS_execve: ::c_long = 59;
+pub const SYS_exit: ::c_long = 60;
+pub const SYS_wait4: ::c_long = 61;
+pub const SYS_kill: ::c_long = 62;
+pub const SYS_uname: ::c_long = 63;
+pub const SYS_semget: ::c_long = 64;
+pub const SYS_semop: ::c_long = 65;
+pub const SYS_semctl: ::c_long = 66;
+pub const SYS_shmdt: ::c_long = 67;
+pub const SYS_msgget: ::c_long = 68;
+pub const SYS_msgsnd: ::c_long = 69;
+pub const SYS_msgrcv: ::c_long = 70;
+pub const SYS_msgctl: ::c_long = 71;
+pub const SYS_fcntl: ::c_long = 72;
+pub const SYS_flock: ::c_long = 73;
+pub const SYS_fsync: ::c_long = 74;
+pub const SYS_fdatasync: ::c_long = 75;
+pub const SYS_truncate: ::c_long = 76;
+pub const SYS_ftruncate: ::c_long = 77;
+pub const SYS_getdents: ::c_long = 78;
+pub const SYS_getcwd: ::c_long = 79;
+pub const SYS_chdir: ::c_long = 80;
+pub const SYS_fchdir: ::c_long = 81;
+pub const SYS_rename: ::c_long = 82;
+pub const SYS_mkdir: ::c_long = 83;
+pub const SYS_rmdir: ::c_long = 84;
+pub const SYS_creat: ::c_long = 85;
+pub const SYS_link: ::c_long = 86;
+pub const SYS_unlink: ::c_long = 87;
+pub const SYS_symlink: ::c_long = 88;
+pub const SYS_readlink: ::c_long = 89;
+pub const SYS_chmod: ::c_long = 90;
+pub const SYS_fchmod: ::c_long = 91;
+pub const SYS_chown: ::c_long = 92;
+pub const SYS_fchown: ::c_long = 93;
+pub const SYS_lchown: ::c_long = 94;
+pub const SYS_umask: ::c_long = 95;
+pub const SYS_gettimeofday: ::c_long = 96;
+pub const SYS_getrlimit: ::c_long = 97;
+pub const SYS_getrusage: ::c_long = 98;
+pub const SYS_sysinfo: ::c_long = 99;
+pub const SYS_times: ::c_long = 100;
+pub const SYS_ptrace: ::c_long = 101;
+pub const SYS_getuid: ::c_long = 102;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_getgid: ::c_long = 104;
+pub const SYS_setuid: ::c_long = 105;
+pub const SYS_setgid: ::c_long = 106;
+pub const SYS_geteuid: ::c_long = 107;
+pub const SYS_getegid: ::c_long = 108;
+pub const SYS_setpgid: ::c_long = 109;
+pub const SYS_getppid: ::c_long = 110;
+pub const SYS_getpgrp: ::c_long = 111;
+pub const SYS_setsid: ::c_long = 112;
+pub const SYS_setreuid: ::c_long = 113;
+pub const SYS_setregid: ::c_long = 114;
+pub const SYS_getgroups: ::c_long = 115;
+pub const SYS_setgroups: ::c_long = 116;
+pub const SYS_setresuid: ::c_long = 117;
+pub const SYS_getresuid: ::c_long = 118;
+pub const SYS_setresgid: ::c_long = 119;
+pub const SYS_getresgid: ::c_long = 120;
+pub const SYS_getpgid: ::c_long = 121;
+pub const SYS_setfsuid: ::c_long = 122;
+pub const SYS_setfsgid: ::c_long = 123;
+pub const SYS_getsid: ::c_long = 124;
+pub const SYS_capget: ::c_long = 125;
+pub const SYS_capset: ::c_long = 126;
+pub const SYS_rt_sigpending: ::c_long = 127;
+pub const SYS_rt_sigtimedwait: ::c_long = 128;
+pub const SYS_rt_sigqueueinfo: ::c_long = 129;
+pub const SYS_rt_sigsuspend: ::c_long = 130;
+pub const SYS_sigaltstack: ::c_long = 131;
+pub const SYS_utime: ::c_long = 132;
+pub const SYS_mknod: ::c_long = 133;
+pub const SYS_uselib: ::c_long = 134;
+pub const SYS_personality: ::c_long = 135;
+pub const SYS_ustat: ::c_long = 136;
+pub const SYS_statfs: ::c_long = 137;
+pub const SYS_fstatfs: ::c_long = 138;
+pub const SYS_sysfs: ::c_long = 139;
+pub const SYS_getpriority: ::c_long = 140;
+pub const SYS_setpriority: ::c_long = 141;
+pub const SYS_sched_setparam: ::c_long = 142;
+pub const SYS_sched_getparam: ::c_long = 143;
+pub const SYS_sched_setscheduler: ::c_long = 144;
+pub const SYS_sched_getscheduler: ::c_long = 145;
+pub const SYS_sched_get_priority_max: ::c_long = 146;
+pub const SYS_sched_get_priority_min: ::c_long = 147;
+pub const SYS_sched_rr_get_interval: ::c_long = 148;
+pub const SYS_mlock: ::c_long = 149;
+pub const SYS_munlock: ::c_long = 150;
+pub const SYS_mlockall: ::c_long = 151;
+pub const SYS_munlockall: ::c_long = 152;
+pub const SYS_vhangup: ::c_long = 153;
+pub const SYS_modify_ldt: ::c_long = 154;
+pub const SYS_pivot_root: ::c_long = 155;
+pub const SYS__sysctl: ::c_long = 156;
+pub const SYS_prctl: ::c_long = 157;
+pub const SYS_arch_prctl: ::c_long = 158;
+pub const SYS_adjtimex: ::c_long = 159;
+pub const SYS_setrlimit: ::c_long = 160;
+pub const SYS_chroot: ::c_long = 161;
+pub const SYS_sync: ::c_long = 162;
+pub const SYS_acct: ::c_long = 163;
+pub const SYS_settimeofday: ::c_long = 164;
+pub const SYS_mount: ::c_long = 165;
+pub const SYS_umount2: ::c_long = 166;
+pub const SYS_swapon: ::c_long = 167;
+pub const SYS_swapoff: ::c_long = 168;
+pub const SYS_reboot: ::c_long = 169;
+pub const SYS_sethostname: ::c_long = 170;
+pub const SYS_setdomainname: ::c_long = 171;
+pub const SYS_iopl: ::c_long = 172;
+pub const SYS_ioperm: ::c_long = 173;
+pub const SYS_create_module: ::c_long = 174;
+pub const SYS_init_module: ::c_long = 175;
+pub const SYS_delete_module: ::c_long = 176;
+pub const SYS_get_kernel_syms: ::c_long = 177;
+pub const SYS_query_module: ::c_long = 178;
+pub const SYS_quotactl: ::c_long = 179;
+pub const SYS_nfsservctl: ::c_long = 180;
+pub const SYS_getpmsg: ::c_long = 181;
+pub const SYS_putpmsg: ::c_long = 182;
+pub const SYS_afs_syscall: ::c_long = 183;
+pub const SYS_tuxcall: ::c_long = 184;
+pub const SYS_security: ::c_long = 185;
+pub const SYS_gettid: ::c_long = 186;
+pub const SYS_readahead: ::c_long = 187;
+pub const SYS_setxattr: ::c_long = 188;
+pub const SYS_lsetxattr: ::c_long = 189;
+pub const SYS_fsetxattr: ::c_long = 190;
+pub const SYS_getxattr: ::c_long = 191;
+pub const SYS_lgetxattr: ::c_long = 192;
+pub const SYS_fgetxattr: ::c_long = 193;
+pub const SYS_listxattr: ::c_long = 194;
+pub const SYS_llistxattr: ::c_long = 195;
+pub const SYS_flistxattr: ::c_long = 196;
+pub const SYS_removexattr: ::c_long = 197;
+pub const SYS_lremovexattr: ::c_long = 198;
+pub const SYS_fremovexattr: ::c_long = 199;
+pub const SYS_tkill: ::c_long = 200;
+pub const SYS_time: ::c_long = 201;
+pub const SYS_futex: ::c_long = 202;
+pub const SYS_sched_setaffinity: ::c_long = 203;
+pub const SYS_sched_getaffinity: ::c_long = 204;
+pub const SYS_set_thread_area: ::c_long = 205;
+pub const SYS_io_setup: ::c_long = 206;
+pub const SYS_io_destroy: ::c_long = 207;
+pub const SYS_io_getevents: ::c_long = 208;
+pub const SYS_io_submit: ::c_long = 209;
+pub const SYS_io_cancel: ::c_long = 210;
+pub const SYS_get_thread_area: ::c_long = 211;
+pub const SYS_lookup_dcookie: ::c_long = 212;
+pub const SYS_epoll_create: ::c_long = 213;
+pub const SYS_epoll_ctl_old: ::c_long = 214;
+pub const SYS_epoll_wait_old: ::c_long = 215;
+pub const SYS_remap_file_pages: ::c_long = 216;
+pub const SYS_getdents64: ::c_long = 217;
+pub const SYS_set_tid_address: ::c_long = 218;
+pub const SYS_restart_syscall: ::c_long = 219;
+pub const SYS_semtimedop: ::c_long = 220;
+pub const SYS_fadvise64: ::c_long = 221;
+pub const SYS_timer_create: ::c_long = 222;
+pub const SYS_timer_settime: ::c_long = 223;
+pub const SYS_timer_gettime: ::c_long = 224;
+pub const SYS_timer_getoverrun: ::c_long = 225;
+pub const SYS_timer_delete: ::c_long = 226;
+pub const SYS_clock_settime: ::c_long = 227;
+pub const SYS_clock_gettime: ::c_long = 228;
+pub const SYS_clock_getres: ::c_long = 229;
+pub const SYS_clock_nanosleep: ::c_long = 230;
+pub const SYS_exit_group: ::c_long = 231;
+pub const SYS_epoll_wait: ::c_long = 232;
+pub const SYS_epoll_ctl: ::c_long = 233;
+pub const SYS_tgkill: ::c_long = 234;
+pub const SYS_utimes: ::c_long = 235;
+pub const SYS_vserver: ::c_long = 236;
+pub const SYS_mbind: ::c_long = 237;
+pub const SYS_set_mempolicy: ::c_long = 238;
+pub const SYS_get_mempolicy: ::c_long = 239;
+pub const SYS_mq_open: ::c_long = 240;
+pub const SYS_mq_unlink: ::c_long = 241;
+pub const SYS_mq_timedsend: ::c_long = 242;
+pub const SYS_mq_timedreceive: ::c_long = 243;
+pub const SYS_mq_notify: ::c_long = 244;
+pub const SYS_mq_getsetattr: ::c_long = 245;
+pub const SYS_kexec_load: ::c_long = 246;
+pub const SYS_waitid: ::c_long = 247;
+pub const SYS_add_key: ::c_long = 248;
+pub const SYS_request_key: ::c_long = 249;
+pub const SYS_keyctl: ::c_long = 250;
+pub const SYS_ioprio_set: ::c_long = 251;
+pub const SYS_ioprio_get: ::c_long = 252;
+pub const SYS_inotify_init: ::c_long = 253;
+pub const SYS_inotify_add_watch: ::c_long = 254;
+pub const SYS_inotify_rm_watch: ::c_long = 255;
+pub const SYS_migrate_pages: ::c_long = 256;
+pub const SYS_openat: ::c_long = 257;
+pub const SYS_mkdirat: ::c_long = 258;
+pub const SYS_mknodat: ::c_long = 259;
+pub const SYS_fchownat: ::c_long = 260;
+pub const SYS_futimesat: ::c_long = 261;
+pub const SYS_newfstatat: ::c_long = 262;
+pub const SYS_unlinkat: ::c_long = 263;
+pub const SYS_renameat: ::c_long = 264;
+pub const SYS_linkat: ::c_long = 265;
+pub const SYS_symlinkat: ::c_long = 266;
+pub const SYS_readlinkat: ::c_long = 267;
+pub const SYS_fchmodat: ::c_long = 268;
+pub const SYS_faccessat: ::c_long = 269;
+pub const SYS_pselect6: ::c_long = 270;
+pub const SYS_ppoll: ::c_long = 271;
+pub const SYS_unshare: ::c_long = 272;
+pub const SYS_set_robust_list: ::c_long = 273;
+pub const SYS_get_robust_list: ::c_long = 274;
+pub const SYS_splice: ::c_long = 275;
+pub const SYS_tee: ::c_long = 276;
+pub const SYS_sync_file_range: ::c_long = 277;
+pub const SYS_vmsplice: ::c_long = 278;
+pub const SYS_move_pages: ::c_long = 279;
+pub const SYS_utimensat: ::c_long = 280;
+pub const SYS_epoll_pwait: ::c_long = 281;
+pub const SYS_signalfd: ::c_long = 282;
+pub const SYS_timerfd_create: ::c_long = 283;
+pub const SYS_eventfd: ::c_long = 284;
+pub const SYS_fallocate: ::c_long = 285;
+pub const SYS_timerfd_settime: ::c_long = 286;
+pub const SYS_timerfd_gettime: ::c_long = 287;
+pub const SYS_accept4: ::c_long = 288;
+pub const SYS_signalfd4: ::c_long = 289;
+pub const SYS_eventfd2: ::c_long = 290;
+pub const SYS_epoll_create1: ::c_long = 291;
+pub const SYS_dup3: ::c_long = 292;
+pub const SYS_pipe2: ::c_long = 293;
+pub const SYS_inotify_init1: ::c_long = 294;
+pub const SYS_preadv: ::c_long = 295;
+pub const SYS_pwritev: ::c_long = 296;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 297;
+pub const SYS_perf_event_open: ::c_long = 298;
+pub const SYS_recvmmsg: ::c_long = 299;
+pub const SYS_fanotify_init: ::c_long = 300;
+pub const SYS_fanotify_mark: ::c_long = 301;
+pub const SYS_prlimit64: ::c_long = 302;
+pub const SYS_name_to_handle_at: ::c_long = 303;
+pub const SYS_open_by_handle_at: ::c_long = 304;
+pub const SYS_clock_adjtime: ::c_long = 305;
+pub const SYS_syncfs: ::c_long = 306;
+pub const SYS_sendmmsg: ::c_long = 307;
+pub const SYS_setns: ::c_long = 308;
+pub const SYS_getcpu: ::c_long = 309;
+pub const SYS_process_vm_readv: ::c_long = 310;
+pub const SYS_process_vm_writev: ::c_long = 311;
+pub const SYS_kcmp: ::c_long = 312;
+pub const SYS_finit_module: ::c_long = 313;
+pub const SYS_sched_setattr: ::c_long = 314;
+pub const SYS_sched_getattr: ::c_long = 315;
+pub const SYS_renameat2: ::c_long = 316;
+pub const SYS_seccomp: ::c_long = 317;
+pub const SYS_getrandom: ::c_long = 318;
+pub const SYS_memfd_create: ::c_long = 319;
+pub const SYS_kexec_file_load: ::c_long = 320;
+pub const SYS_bpf: ::c_long = 321;
+pub const SYS_execveat: ::c_long = 322;
+pub const SYS_userfaultfd: ::c_long = 323;
+pub const SYS_membarrier: ::c_long = 324;
+pub const SYS_mlock2: ::c_long = 325;
+pub const SYS_copy_file_range: ::c_long = 326;
+pub const SYS_preadv2: ::c_long = 327;
+pub const SYS_pwritev2: ::c_long = 328;
+pub const SYS_pkey_mprotect: ::c_long = 329;
+pub const SYS_pkey_alloc: ::c_long = 330;
+pub const SYS_pkey_free: ::c_long = 331;
+pub const SYS_statx: ::c_long = 332;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+// offsets in user_regs_structs, from sys/reg.h
+pub const R15: ::c_int = 0;
+pub const R14: ::c_int = 1;
+pub const R13: ::c_int = 2;
+pub const R12: ::c_int = 3;
+pub const RBP: ::c_int = 4;
+pub const RBX: ::c_int = 5;
+pub const R11: ::c_int = 6;
+pub const R10: ::c_int = 7;
+pub const R9: ::c_int = 8;
+pub const R8: ::c_int = 9;
+pub const RAX: ::c_int = 10;
+pub const RCX: ::c_int = 11;
+pub const RDX: ::c_int = 12;
+pub const RSI: ::c_int = 13;
+pub const RDI: ::c_int = 14;
+pub const ORIG_RAX: ::c_int = 15;
+pub const RIP: ::c_int = 16;
+pub const CS: ::c_int = 17;
+pub const EFLAGS: ::c_int = 18;
+pub const RSP: ::c_int = 19;
+pub const SS: ::c_int = 20;
+pub const FS_BASE: ::c_int = 21;
+pub const GS_BASE: ::c_int = 22;
+pub const DS: ::c_int = 23;
+pub const ES: ::c_int = 24;
+pub const FS: ::c_int = 25;
+pub const GS: ::c_int = 26;
+
+// offsets in mcontext_t.gregs from bits/signal.h
+// GitHub repo: ifduyue/musl/
+// commit: b4b1e10364c8737a632be61582e05a8d3acf5690
+// file: arch/x86_64/bits/signal.h#L9-L56
+pub const REG_R8: ::c_int = 0;
+pub const REG_R9: ::c_int = 1;
+pub const REG_R10: ::c_int = 2;
+pub const REG_R11: ::c_int = 3;
+pub const REG_R12: ::c_int = 4;
+pub const REG_R13: ::c_int = 5;
+pub const REG_R14: ::c_int = 6;
+pub const REG_R15: ::c_int = 7;
+pub const REG_RDI: ::c_int = 8;
+pub const REG_RSI: ::c_int = 9;
+pub const REG_RBP: ::c_int = 10;
+pub const REG_RBX: ::c_int = 11;
+pub const REG_RDX: ::c_int = 12;
+pub const REG_RAX: ::c_int = 13;
+pub const REG_RCX: ::c_int = 14;
+pub const REG_RSP: ::c_int = 15;
+pub const REG_RIP: ::c_int = 16;
+pub const REG_EFL: ::c_int = 17;
+pub const REG_CSGSFS: ::c_int = 18;
+pub const REG_ERR: ::c_int = 19;
+pub const REG_TRAPNO: ::c_int = 20;
+pub const REG_OLDMASK: ::c_int = 21;
+pub const REG_CR2: ::c_int = 22;
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MAP_32BIT: ::c_int = 0x0040;
+pub const O_APPEND: ::c_int = 1024;
+pub const O_DIRECT: ::c_int = 0x4000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_LARGEFILE: ::c_int = 0;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+pub const O_CREAT: ::c_int = 64;
+pub const O_EXCL: ::c_int = 128;
+pub const O_NOCTTY: ::c_int = 256;
+pub const O_NONBLOCK: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 1052672;
+pub const O_RSYNC: ::c_int = 1052672;
+pub const O_DSYNC: ::c_int = 4096;
+pub const O_ASYNC: ::c_int = 0x2000;
+
+pub const PTRACE_SYSEMU: ::c_int = 31;
+pub const PTRACE_SYSEMU_SINGLESTEP: ::c_int = 32;
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+
+pub const ENAMETOOLONG: ::c_int = 36;
+pub const ENOLCK: ::c_int = 37;
+pub const ENOSYS: ::c_int = 38;
+pub const ENOTEMPTY: ::c_int = 39;
+pub const ELOOP: ::c_int = 40;
+pub const ENOMSG: ::c_int = 42;
+pub const EIDRM: ::c_int = 43;
+pub const ECHRNG: ::c_int = 44;
+pub const EL2NSYNC: ::c_int = 45;
+pub const EL3HLT: ::c_int = 46;
+pub const EL3RST: ::c_int = 47;
+pub const ELNRNG: ::c_int = 48;
+pub const EUNATCH: ::c_int = 49;
+pub const ENOCSI: ::c_int = 50;
+pub const EL2HLT: ::c_int = 51;
+pub const EBADE: ::c_int = 52;
+pub const EBADR: ::c_int = 53;
+pub const EXFULL: ::c_int = 54;
+pub const ENOANO: ::c_int = 55;
+pub const EBADRQC: ::c_int = 56;
+pub const EBADSLT: ::c_int = 57;
+pub const EMULTIHOP: ::c_int = 72;
+pub const EBADMSG: ::c_int = 74;
+pub const EOVERFLOW: ::c_int = 75;
+pub const ENOTUNIQ: ::c_int = 76;
+pub const EBADFD: ::c_int = 77;
+pub const EREMCHG: ::c_int = 78;
+pub const ELIBACC: ::c_int = 79;
+pub const ELIBBAD: ::c_int = 80;
+pub const ELIBSCN: ::c_int = 81;
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86;
+pub const EUSERS: ::c_int = 87;
+pub const ENOTSOCK: ::c_int = 88;
+pub const EDESTADDRREQ: ::c_int = 89;
+pub const EMSGSIZE: ::c_int = 90;
+pub const EPROTOTYPE: ::c_int = 91;
+pub const ENOPROTOOPT: ::c_int = 92;
+pub const EPROTONOSUPPORT: ::c_int = 93;
+pub const ESOCKTNOSUPPORT: ::c_int = 94;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98;
+pub const EADDRNOTAVAIL: ::c_int = 99;
+pub const ENETDOWN: ::c_int = 100;
+pub const ENETUNREACH: ::c_int = 101;
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EISCONN: ::c_int = 106;
+pub const ENOTCONN: ::c_int = 107;
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109;
+pub const ETIMEDOUT: ::c_int = 110;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EHOSTDOWN: ::c_int = 112;
+pub const EHOSTUNREACH: ::c_int = 113;
+pub const EALREADY: ::c_int = 114;
+pub const EINPROGRESS: ::c_int = 115;
+pub const ESTALE: ::c_int = 116;
+pub const EUCLEAN: ::c_int = 117;
+pub const ENOTNAM: ::c_int = 118;
+pub const ENAVAIL: ::c_int = 119;
+pub const EISNAM: ::c_int = 120;
+pub const EREMOTEIO: ::c_int = 121;
+pub const EDQUOT: ::c_int = 122;
+pub const ENOMEDIUM: ::c_int = 123;
+pub const EMEDIUMTYPE: ::c_int = 124;
+pub const ECANCELED: ::c_int = 125;
+pub const ENOKEY: ::c_int = 126;
+pub const EKEYEXPIRED: ::c_int = 127;
+pub const EKEYREVOKED: ::c_int = 128;
+pub const EKEYREJECTED: ::c_int = 129;
+pub const EOWNERDEAD: ::c_int = 130;
+pub const ENOTRECOVERABLE: ::c_int = 131;
+pub const ERFKILL: ::c_int = 132;
+pub const EHWPOISON: ::c_int = 133;
+
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGURG: ::c_int = 23;
+pub const SIGIO: ::c_int = 29;
+pub const SIGSYS: ::c_int = 31;
+pub const SIGSTKFLT: ::c_int = 16;
+pub const SIGPOLL: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0x000000;
+pub const SIG_UNBLOCK: ::c_int = 0x01;
+
+pub const F_GETLK: ::c_int = 5;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+pub const F_SETOWN: ::c_int = 8;
+
+pub const VEOF: usize = 4;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_GROWSDOWN: ::c_int = 0x0100;
+pub const MAP_DENYWRITE: ::c_int = 0x0800;
+pub const MAP_EXECUTABLE: ::c_int = 0x01000;
+pub const MAP_LOCKED: ::c_int = 0x02000;
+pub const MAP_NORESERVE: ::c_int = 0x04000;
+pub const MAP_POPULATE: ::c_int = 0x08000;
+pub const MAP_NONBLOCK: ::c_int = 0x010000;
+pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_HUGETLB: ::c_int = 0x040000;
+pub const MAP_SYNC: ::c_int = 0x080000;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const TAB1: ::c_int = 0x00000800;
+pub const TAB2: ::c_int = 0x00001000;
+pub const TAB3: ::c_int = 0x00001800;
+pub const CR1: ::c_int = 0x00000200;
+pub const CR2: ::c_int = 0x00000400;
+pub const CR3: ::c_int = 0x00000600;
+pub const FF1: ::c_int = 0x00008000;
+pub const BS1: ::c_int = 0x00002000;
+pub const VT1: ::c_int = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const EDEADLK: ::c_int = 35;
+pub const EDEADLOCK: ::c_int = EDEADLK;
+
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/lfs64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/lfs64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/lfs64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/lfs64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,241 @@
+#[inline]
+pub unsafe extern "C" fn creat64(path: *const ::c_char, mode: ::mode_t) -> ::c_int {
+    ::creat(path, mode)
+}
+
+#[inline]
+pub unsafe extern "C" fn fallocate64(
+    fd: ::c_int,
+    mode: ::c_int,
+    offset: ::off64_t,
+    len: ::off64_t,
+) -> ::c_int {
+    ::fallocate(fd, mode, offset, len)
+}
+
+#[inline]
+pub unsafe extern "C" fn fgetpos64(stream: *mut ::FILE, pos: *mut ::fpos64_t) -> ::c_int {
+    ::fgetpos(stream, pos as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn fopen64(pathname: *const ::c_char, mode: *const ::c_char) -> *mut ::FILE {
+    ::fopen(pathname, mode)
+}
+
+#[inline]
+pub unsafe extern "C" fn freopen64(
+    pathname: *const ::c_char,
+    mode: *const ::c_char,
+    stream: *mut ::FILE,
+) -> *mut ::FILE {
+    ::freopen(pathname, mode, stream)
+}
+
+#[inline]
+pub unsafe extern "C" fn fseeko64(
+    stream: *mut ::FILE,
+    offset: ::off64_t,
+    whence: ::c_int,
+) -> ::c_int {
+    ::fseeko(stream, offset, whence)
+}
+
+#[inline]
+pub unsafe extern "C" fn fsetpos64(stream: *mut ::FILE, pos: *const ::fpos64_t) -> ::c_int {
+    ::fsetpos(stream, pos as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn fstat64(fildes: ::c_int, buf: *mut ::stat64) -> ::c_int {
+    ::fstat(fildes, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn fstatat64(
+    fd: ::c_int,
+    path: *const ::c_char,
+    buf: *mut ::stat64,
+    flag: ::c_int,
+) -> ::c_int {
+    ::fstatat(fd, path, buf as *mut _, flag)
+}
+
+#[inline]
+pub unsafe extern "C" fn fstatfs64(fd: ::c_int, buf: *mut ::statfs64) -> ::c_int {
+    ::fstatfs(fd, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn fstatvfs64(fd: ::c_int, buf: *mut ::statvfs64) -> ::c_int {
+    ::fstatvfs(fd, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn ftello64(stream: *mut ::FILE) -> ::off64_t {
+    ::ftello(stream)
+}
+
+#[inline]
+pub unsafe extern "C" fn ftruncate64(fd: ::c_int, length: ::off64_t) -> ::c_int {
+    ::ftruncate(fd, length)
+}
+
+#[inline]
+pub unsafe extern "C" fn getrlimit64(resource: ::c_int, rlim: *mut ::rlimit64) -> ::c_int {
+    ::getrlimit(resource, rlim as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn lseek64(fd: ::c_int, offset: ::off64_t, whence: ::c_int) -> ::off64_t {
+    ::lseek(fd, offset, whence)
+}
+
+#[inline]
+pub unsafe extern "C" fn lstat64(path: *const ::c_char, buf: *mut ::stat64) -> ::c_int {
+    ::lstat(path, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn mmap64(
+    addr: *mut ::c_void,
+    length: ::size_t,
+    prot: ::c_int,
+    flags: ::c_int,
+    fd: ::c_int,
+    offset: ::off64_t,
+) -> *mut ::c_void {
+    ::mmap(addr, length, prot, flags, fd, offset)
+}
+
+// These functions are variadic in the C ABI since the `mode` argument is "optional".  Variadic
+// `extern "C"` functions are unstable in Rust so we cannot write a shim function for these
+// entrypoints.  See https://github.com/rust-lang/rust/issues/44930.
+//
+// These aliases are mostly fine though, neither function takes a LFS64-namespaced type as an
+// argument, nor do their names clash with any declared types.
+pub use open as open64;
+pub use openat as openat64;
+
+#[inline]
+pub unsafe extern "C" fn posix_fadvise64(
+    fd: ::c_int,
+    offset: ::off64_t,
+    len: ::off64_t,
+    advice: ::c_int,
+) -> ::c_int {
+    ::posix_fadvise(fd, offset, len, advice)
+}
+
+#[inline]
+pub unsafe extern "C" fn posix_fallocate64(
+    fd: ::c_int,
+    offset: ::off64_t,
+    len: ::off64_t,
+) -> ::c_int {
+    ::posix_fallocate(fd, offset, len)
+}
+
+#[inline]
+pub unsafe extern "C" fn pread64(
+    fd: ::c_int,
+    buf: *mut ::c_void,
+    count: ::size_t,
+    offset: ::off64_t,
+) -> ::ssize_t {
+    ::pread(fd, buf, count, offset)
+}
+
+#[inline]
+pub unsafe extern "C" fn preadv64(
+    fd: ::c_int,
+    iov: *const ::iovec,
+    iovcnt: ::c_int,
+    offset: ::off64_t,
+) -> ::ssize_t {
+    ::preadv(fd, iov, iovcnt, offset)
+}
+
+#[inline]
+pub unsafe extern "C" fn prlimit64(
+    pid: ::pid_t,
+    resource: ::c_int,
+    new_limit: *const ::rlimit64,
+    old_limit: *mut ::rlimit64,
+) -> ::c_int {
+    ::prlimit(pid, resource, new_limit as *mut _, old_limit as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn pwrite64(
+    fd: ::c_int,
+    buf: *const ::c_void,
+    count: ::size_t,
+    offset: ::off64_t,
+) -> ::ssize_t {
+    ::pwrite(fd, buf, count, offset)
+}
+
+#[inline]
+pub unsafe extern "C" fn pwritev64(
+    fd: ::c_int,
+    iov: *const ::iovec,
+    iovcnt: ::c_int,
+    offset: ::off64_t,
+) -> ::ssize_t {
+    ::pwritev(fd, iov, iovcnt, offset)
+}
+
+#[inline]
+pub unsafe extern "C" fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64 {
+    ::readdir(dirp) as *mut _
+}
+
+#[inline]
+pub unsafe extern "C" fn readdir64_r(
+    dirp: *mut ::DIR,
+    entry: *mut ::dirent64,
+    result: *mut *mut ::dirent64,
+) -> ::c_int {
+    ::readdir_r(dirp, entry as *mut _, result as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn sendfile64(
+    out_fd: ::c_int,
+    in_fd: ::c_int,
+    offset: *mut ::off64_t,
+    count: ::size_t,
+) -> ::ssize_t {
+    ::sendfile(out_fd, in_fd, offset, count)
+}
+
+#[inline]
+pub unsafe extern "C" fn setrlimit64(resource: ::c_int, rlim: *const ::rlimit64) -> ::c_int {
+    ::setrlimit(resource, rlim as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn stat64(pathname: *const ::c_char, statbuf: *mut ::stat64) -> ::c_int {
+    ::stat(pathname, statbuf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn statfs64(pathname: *const ::c_char, buf: *mut ::statfs64) -> ::c_int {
+    ::statfs(pathname, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn statvfs64(path: *const ::c_char, buf: *mut ::statvfs64) -> ::c_int {
+    ::statvfs(path, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn tmpfile64() -> *mut ::FILE {
+    ::tmpfile()
+}
+
+#[inline]
+pub unsafe extern "C" fn truncate64(path: *const ::c_char, length: ::off64_t) -> ::c_int {
+    ::truncate(path, length)
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/musl/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/musl/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,913 @@
+pub type pthread_t = *mut ::c_void;
+pub type clock_t = c_long;
+#[cfg_attr(
+    not(feature = "rustc-dep-of-std"),
+    deprecated(
+        since = "0.2.80",
+        note = "This type is changed to 64-bit in musl 1.2.0, \
+                we'll follow that change in the future release. \
+                See #1848 for more info."
+    )
+)]
+pub type time_t = c_long;
+pub type suseconds_t = c_long;
+pub type ino_t = u64;
+pub type off_t = i64;
+pub type blkcnt_t = i64;
+
+pub type shmatt_t = ::c_ulong;
+pub type msgqnum_t = ::c_ulong;
+pub type msglen_t = ::c_ulong;
+pub type fsblkcnt_t = ::c_ulonglong;
+pub type fsfilcnt_t = ::c_ulonglong;
+pub type rlim_t = ::c_ulonglong;
+
+cfg_if! {
+    if #[cfg(doc)] {
+        // Used in `linux::arch` to define ioctl constants.
+        pub(crate) type Ioctl = ::c_int;
+    } else {
+        #[doc(hidden)]
+        pub type Ioctl = ::c_int;
+    }
+}
+
+impl siginfo_t {
+    pub unsafe fn si_addr(&self) -> *mut ::c_void {
+        #[repr(C)]
+        struct siginfo_sigfault {
+            _si_signo: ::c_int,
+            _si_errno: ::c_int,
+            _si_code: ::c_int,
+            si_addr: *mut ::c_void,
+        }
+        (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr
+    }
+
+    pub unsafe fn si_value(&self) -> ::sigval {
+        #[repr(C)]
+        struct siginfo_si_value {
+            _si_signo: ::c_int,
+            _si_errno: ::c_int,
+            _si_code: ::c_int,
+            _si_timerid: ::c_int,
+            _si_overrun: ::c_int,
+            si_value: ::sigval,
+        }
+        (*(self as *const siginfo_t as *const siginfo_si_value)).si_value
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        // Internal, for casts to access union fields
+        #[repr(C)]
+        struct sifields_sigchld {
+            si_pid: ::pid_t,
+            si_uid: ::uid_t,
+            si_status: ::c_int,
+            si_utime: ::c_long,
+            si_stime: ::c_long,
+        }
+        impl ::Copy for sifields_sigchld {}
+        impl ::Clone for sifields_sigchld {
+            fn clone(&self) -> sifields_sigchld {
+                *self
+            }
+        }
+
+        // Internal, for casts to access union fields
+        #[repr(C)]
+        union sifields {
+            _align_pointer: *mut ::c_void,
+            sigchld: sifields_sigchld,
+        }
+
+        // Internal, for casts to access union fields. Note that some variants
+        // of sifields start with a pointer, which makes the alignment of
+        // sifields vary on 32-bit and 64-bit architectures.
+        #[repr(C)]
+        struct siginfo_f {
+            _siginfo_base: [::c_int; 3],
+            sifields: sifields,
+        }
+
+        impl siginfo_t {
+            unsafe fn sifields(&self) -> &sifields {
+                &(*(self as *const siginfo_t as *const siginfo_f)).sifields
+            }
+
+            pub unsafe fn si_pid(&self) -> ::pid_t {
+                self.sifields().sigchld.si_pid
+            }
+
+            pub unsafe fn si_uid(&self) -> ::uid_t {
+                self.sifields().sigchld.si_uid
+            }
+
+            pub unsafe fn si_status(&self) -> ::c_int {
+                self.sifields().sigchld.si_status
+            }
+
+            pub unsafe fn si_utime(&self) -> ::c_long {
+                self.sifields().sigchld.si_utime
+            }
+
+            pub unsafe fn si_stime(&self) -> ::c_long {
+                self.sifields().sigchld.si_stime
+            }
+        }
+    }
+}
+
+s! {
+    pub struct aiocb {
+        pub aio_fildes: ::c_int,
+        pub aio_lio_opcode: ::c_int,
+        pub aio_reqprio: ::c_int,
+        pub aio_buf: *mut ::c_void,
+        pub aio_nbytes: ::size_t,
+        pub aio_sigevent: ::sigevent,
+        __td: *mut ::c_void,
+        __lock: [::c_int; 2],
+        __err: ::c_int,
+        __ret: ::ssize_t,
+        pub aio_offset: off_t,
+        __next: *mut ::c_void,
+        __prev: *mut ::c_void,
+        #[cfg(target_pointer_width = "32")]
+        __dummy4: [::c_char; 24],
+        #[cfg(target_pointer_width = "64")]
+        __dummy4: [::c_char; 16],
+    }
+
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        #[cfg(target_endian = "little")]
+        pub f_fsid: ::c_ulong,
+        #[cfg(target_pointer_width = "32")]
+        __f_unused: ::c_int,
+        #[cfg(target_endian = "big")]
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::NCCS],
+        pub __c_ispeed: ::speed_t,
+        pub __c_ospeed: ::speed_t,
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct flock64 {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off64_t,
+        pub l_len: ::off64_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct regex_t {
+        __re_nsub: ::size_t,
+        __opaque: *mut ::c_void,
+        __padding: [*mut ::c_void; 4usize],
+        __nsub2: ::size_t,
+        __padding2: ::c_char,
+    }
+
+    pub struct rtentry {
+        pub rt_pad1: ::c_ulong,
+        pub rt_dst: ::sockaddr,
+        pub rt_gateway: ::sockaddr,
+        pub rt_genmask: ::sockaddr,
+        pub rt_flags: ::c_ushort,
+        pub rt_pad2: ::c_short,
+        pub rt_pad3: ::c_ulong,
+        pub rt_tos: ::c_uchar,
+        pub rt_class: ::c_uchar,
+        #[cfg(target_pointer_width = "64")]
+        pub rt_pad4: [::c_short; 3usize],
+        #[cfg(not(target_pointer_width = "64"))]
+        pub rt_pad4: [::c_short; 1usize],
+        pub rt_metric: ::c_short,
+        pub rt_dev: *mut ::c_char,
+        pub rt_mtu: ::c_ulong,
+        pub rt_window: ::c_ulong,
+        pub rt_irtt: ::c_ushort,
+    }
+
+    pub struct __exit_status {
+        pub e_termination: ::c_short,
+        pub e_exit: ::c_short,
+    }
+
+    pub struct Elf64_Chdr {
+        pub ch_type: ::Elf64_Word,
+        pub ch_reserved: ::Elf64_Word,
+        pub ch_size: ::Elf64_Xword,
+        pub ch_addralign: ::Elf64_Xword,
+    }
+
+    pub struct Elf32_Chdr {
+        pub ch_type: ::Elf32_Word,
+        pub ch_size: ::Elf32_Word,
+        pub ch_addralign: ::Elf32_Word,
+    }
+
+    pub struct timex {
+        pub modes: ::c_uint,
+        pub offset: ::c_long,
+        pub freq: ::c_long,
+        pub maxerror: ::c_long,
+        pub esterror: ::c_long,
+        pub status: ::c_int,
+        pub constant: ::c_long,
+        pub precision: ::c_long,
+        pub tolerance: ::c_long,
+        pub time: ::timeval,
+        pub tick: ::c_long,
+        pub ppsfreq: ::c_long,
+        pub jitter: ::c_long,
+        pub shift: ::c_int,
+        pub stabil: ::c_long,
+        pub jitcnt: ::c_long,
+        pub calcnt: ::c_long,
+        pub errcnt: ::c_long,
+        pub stbcnt: ::c_long,
+        pub tai: ::c_int,
+        pub __padding: [::c_int; 11],
+    }
+
+    pub struct ntptimeval {
+        pub time: ::timeval,
+        pub maxerror: ::c_long,
+        pub esterror: ::c_long,
+    }
+
+    // linux/if_xdp.h
+
+    pub struct sockaddr_xdp {
+        pub sxdp_family: ::__u16,
+        pub sxdp_flags: ::__u16,
+        pub sxdp_ifindex: ::__u32,
+        pub sxdp_queue_id: ::__u32,
+        pub sxdp_shared_umem_fd: ::__u32,
+    }
+
+    pub struct xdp_ring_offset {
+        pub producer: ::__u64,
+        pub consumer: ::__u64,
+        pub desc: ::__u64,
+        pub flags: ::__u64,
+    }
+
+    pub struct xdp_mmap_offsets {
+        pub rx: xdp_ring_offset,
+        pub tx: xdp_ring_offset,
+        pub fr: xdp_ring_offset,
+        pub cr: xdp_ring_offset,
+    }
+
+    pub struct xdp_ring_offset_v1 {
+        pub producer: ::__u64,
+        pub consumer: ::__u64,
+        pub desc: ::__u64,
+    }
+
+    pub struct xdp_mmap_offsets_v1 {
+        pub rx: xdp_ring_offset_v1,
+        pub tx: xdp_ring_offset_v1,
+        pub fr: xdp_ring_offset_v1,
+        pub cr: xdp_ring_offset_v1,
+    }
+
+    pub struct xdp_umem_reg {
+        pub addr: ::__u64,
+        pub len: ::__u64,
+        pub chunk_size: ::__u32,
+        pub headroom: ::__u32,
+        pub flags: ::__u32,
+    }
+
+    pub struct xdp_umem_reg_v1 {
+        pub addr: ::__u64,
+        pub len: ::__u64,
+        pub chunk_size: ::__u32,
+        pub headroom: ::__u32,
+    }
+
+    pub struct xdp_statistics {
+        pub rx_dropped: ::__u64,
+        pub rx_invalid_descs: ::__u64,
+        pub tx_invalid_descs: ::__u64,
+        pub rx_ring_full: ::__u64,
+        pub rx_fill_ring_empty_descs: ::__u64,
+        pub tx_ring_empty_descs: ::__u64,
+    }
+
+    pub struct xdp_statistics_v1 {
+        pub rx_dropped: ::__u64,
+        pub rx_invalid_descs: ::__u64,
+        pub tx_invalid_descs: ::__u64,
+    }
+
+    pub struct xdp_options {
+        pub flags: ::__u32,
+    }
+
+    pub struct xdp_desc {
+        pub addr: ::__u64,
+        pub len: ::__u32,
+        pub options: ::__u32,
+    }
+}
+
+s_no_extra_traits! {
+    pub struct sysinfo {
+        pub uptime: ::c_ulong,
+        pub loads: [::c_ulong; 3],
+        pub totalram: ::c_ulong,
+        pub freeram: ::c_ulong,
+        pub sharedram: ::c_ulong,
+        pub bufferram: ::c_ulong,
+        pub totalswap: ::c_ulong,
+        pub freeswap: ::c_ulong,
+        pub procs: ::c_ushort,
+        pub pad: ::c_ushort,
+        pub totalhigh: ::c_ulong,
+        pub freehigh: ::c_ulong,
+        pub mem_unit: ::c_uint,
+        pub __reserved: [::c_char; 256],
+    }
+
+    // FIXME: musl added paddings and adjusted
+    // layout in 1.2.0 but our CI is still 1.1.24.
+    // So, I'm leaving some fields as cfg for now.
+    // ref. https://github.com/bminor/musl/commit/
+    // 1e7f0fcd7ff2096904fd93a2ee6d12a2392be392
+    //
+    // OpenHarmony uses the musl 1.2 layout.
+    pub struct utmpx {
+        pub ut_type: ::c_short,
+        __ut_pad1: ::c_short,
+        pub ut_pid: ::pid_t,
+        pub ut_line: [::c_char; 32],
+        pub ut_id: [::c_char; 4],
+        pub ut_user: [::c_char; 32],
+        pub ut_host: [::c_char; 256],
+        pub ut_exit: __exit_status,
+
+        #[cfg(target_env = "musl")]
+        pub ut_session: ::c_long,
+
+        #[cfg(target_env = "ohos")]
+        #[cfg(target_endian = "little")]
+        pub ut_session: ::c_int,
+        #[cfg(target_env = "ohos")]
+        #[cfg(target_endian = "little")]
+        __ut_pad2: ::c_int,
+
+        #[cfg(target_env = "ohos")]
+        #[cfg(not(target_endian = "little"))]
+        __ut_pad2: ::c_int,
+        #[cfg(target_env = "ohos")]
+        #[cfg(not(target_endian = "little"))]
+        pub ut_session: ::c_int,
+
+        pub ut_tv: ::timeval,
+        pub ut_addr_v6: [::c_uint; 4],
+        __unused: [::c_char; 20],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for sysinfo {
+            fn eq(&self, other: &sysinfo) -> bool {
+                self.uptime == other.uptime
+                    && self.loads == other.loads
+                    && self.totalram == other.totalram
+                    && self.freeram == other.freeram
+                    && self.sharedram == other.sharedram
+                    && self.bufferram == other.bufferram
+                    && self.totalswap == other.totalswap
+                    && self.freeswap == other.freeswap
+                    && self.procs == other.procs
+                    && self.pad == other.pad
+                    && self.totalhigh == other.totalhigh
+                    && self.freehigh == other.freehigh
+                    && self.mem_unit == other.mem_unit
+                    && self
+                        .__reserved
+                        .iter()
+                        .zip(other.__reserved.iter())
+                        .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for sysinfo {}
+
+        impl ::fmt::Debug for sysinfo {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sysinfo")
+                    .field("uptime", &self.uptime)
+                    .field("loads", &self.loads)
+                    .field("totalram", &self.totalram)
+                    .field("freeram", &self.freeram)
+                    .field("sharedram", &self.sharedram)
+                    .field("bufferram", &self.bufferram)
+                    .field("totalswap", &self.totalswap)
+                    .field("freeswap", &self.freeswap)
+                    .field("procs", &self.procs)
+                    .field("pad", &self.pad)
+                    .field("totalhigh", &self.totalhigh)
+                    .field("freehigh", &self.freehigh)
+                    .field("mem_unit", &self.mem_unit)
+                    // FIXME: .field("__reserved", &self.__reserved)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for sysinfo {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.uptime.hash(state);
+                self.loads.hash(state);
+                self.totalram.hash(state);
+                self.freeram.hash(state);
+                self.sharedram.hash(state);
+                self.bufferram.hash(state);
+                self.totalswap.hash(state);
+                self.freeswap.hash(state);
+                self.procs.hash(state);
+                self.pad.hash(state);
+                self.totalhigh.hash(state);
+                self.freehigh.hash(state);
+                self.mem_unit.hash(state);
+                self.__reserved.hash(state);
+            }
+        }
+
+        impl PartialEq for utmpx {
+            fn eq(&self, other: &utmpx) -> bool {
+                self.ut_type == other.ut_type
+                    //&& self.__ut_pad1 == other.__ut_pad1
+                    && self.ut_pid == other.ut_pid
+                    && self.ut_line == other.ut_line
+                    && self.ut_id == other.ut_id
+                    && self.ut_user == other.ut_user
+                    && self
+                        .ut_host
+                        .iter()
+                        .zip(other.ut_host.iter())
+                        .all(|(a,b)| a == b)
+                    && self.ut_exit == other.ut_exit
+                    && self.ut_session == other.ut_session
+                    //&& self.__ut_pad2 == other.__ut_pad2
+                    && self.ut_tv == other.ut_tv
+                    && self.ut_addr_v6 == other.ut_addr_v6
+                    && self.__unused == other.__unused
+            }
+        }
+
+        impl Eq for utmpx {}
+
+        impl ::fmt::Debug for utmpx {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("utmpx")
+                    .field("ut_type", &self.ut_type)
+                    //.field("__ut_pad1", &self.__ut_pad1)
+                    .field("ut_pid", &self.ut_pid)
+                    .field("ut_line", &self.ut_line)
+                    .field("ut_id", &self.ut_id)
+                    .field("ut_user", &self.ut_user)
+                    //FIXME: .field("ut_host", &self.ut_host)
+                    .field("ut_exit", &self.ut_exit)
+                    .field("ut_session", &self.ut_session)
+                    //.field("__ut_pad2", &self.__ut_pad2)
+                    .field("ut_tv", &self.ut_tv)
+                    .field("ut_addr_v6", &self.ut_addr_v6)
+                    .field("__unused", &self.__unused)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for utmpx {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ut_type.hash(state);
+                //self.__ut_pad1.hash(state);
+                self.ut_pid.hash(state);
+                self.ut_line.hash(state);
+                self.ut_id.hash(state);
+                self.ut_user.hash(state);
+                self.ut_host.hash(state);
+                self.ut_exit.hash(state);
+                self.ut_session.hash(state);
+                //self.__ut_pad2.hash(state);
+                self.ut_tv.hash(state);
+                self.ut_addr_v6.hash(state);
+                self.__unused.hash(state);
+            }
+        }
+    }
+}
+
+// include/sys/mman.h
+/*
+ * Huge page size encoding when MAP_HUGETLB is specified, and a huge page
+ * size other than the default is desired.  See hugetlb_encode.h.
+ * All known huge page size encodings are provided here.  It is the
+ * responsibility of the application to know which sizes are supported on
+ * the running system.  See mmap(2) man page for details.
+ */
+pub const MAP_HUGE_SHIFT: ::c_int = 26;
+pub const MAP_HUGE_MASK: ::c_int = 0x3f;
+
+pub const MAP_HUGE_64KB: ::c_int = 16 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_512KB: ::c_int = 19 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_1MB: ::c_int = 20 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_2MB: ::c_int = 21 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_8MB: ::c_int = 23 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_16MB: ::c_int = 24 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_32MB: ::c_int = 25 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_256MB: ::c_int = 28 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_512MB: ::c_int = 29 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_1GB: ::c_int = 30 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_2GB: ::c_int = 31 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_16GB: ::c_int = 34 << MAP_HUGE_SHIFT;
+
+pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
+
+pub const SFD_CLOEXEC: ::c_int = 0x080000;
+
+pub const NCCS: usize = 32;
+
+pub const O_TRUNC: ::c_int = 512;
+pub const O_NOATIME: ::c_int = 0o1000000;
+pub const O_CLOEXEC: ::c_int = 0x80000;
+pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
+
+pub const EBFONT: ::c_int = 59;
+pub const ENOSTR: ::c_int = 60;
+pub const ENODATA: ::c_int = 61;
+pub const ETIME: ::c_int = 62;
+pub const ENOSR: ::c_int = 63;
+pub const ENONET: ::c_int = 64;
+pub const ENOPKG: ::c_int = 65;
+pub const EREMOTE: ::c_int = 66;
+pub const ENOLINK: ::c_int = 67;
+pub const EADV: ::c_int = 68;
+pub const ESRMNT: ::c_int = 69;
+pub const ECOMM: ::c_int = 70;
+pub const EPROTO: ::c_int = 71;
+pub const EDOTDOT: ::c_int = 73;
+
+pub const F_OFD_GETLK: ::c_int = 36;
+pub const F_OFD_SETLK: ::c_int = 37;
+pub const F_OFD_SETLKW: ::c_int = 38;
+
+pub const F_RDLCK: ::c_int = 0;
+pub const F_WRLCK: ::c_int = 1;
+pub const F_UNLCK: ::c_int = 2;
+
+pub const SA_NODEFER: ::c_int = 0x40000000;
+pub const SA_RESETHAND: ::c_int = 0x80000000;
+pub const SA_RESTART: ::c_int = 0x10000000;
+pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
+
+pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
+
+pub const EFD_CLOEXEC: ::c_int = 0x80000;
+
+pub const BUFSIZ: ::c_uint = 1024;
+pub const TMP_MAX: ::c_uint = 10000;
+pub const FOPEN_MAX: ::c_uint = 1000;
+pub const FILENAME_MAX: ::c_uint = 4096;
+pub const O_PATH: ::c_int = 0o10000000;
+pub const O_EXEC: ::c_int = 0o10000000;
+pub const O_SEARCH: ::c_int = 0o10000000;
+pub const O_ACCMODE: ::c_int = 0o10000003;
+pub const O_NDELAY: ::c_int = O_NONBLOCK;
+pub const NI_MAXHOST: ::socklen_t = 255;
+pub const PTHREAD_STACK_MIN: ::size_t = 2048;
+
+pub const POSIX_MADV_DONTNEED: ::c_int = 4;
+
+pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
+
+pub const SOCK_SEQPACKET: ::c_int = 5;
+pub const SOCK_DCCP: ::c_int = 6;
+pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK;
+pub const SOCK_PACKET: ::c_int = 10;
+
+pub const SOMAXCONN: ::c_int = 128;
+
+#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
+pub const SIGUNUSED: ::c_int = ::SIGSYS;
+
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
+
+pub const CPU_SETSIZE: ::c_int = 128;
+
+pub const PTRACE_TRACEME: ::c_int = 0;
+pub const PTRACE_PEEKTEXT: ::c_int = 1;
+pub const PTRACE_PEEKDATA: ::c_int = 2;
+pub const PTRACE_PEEKUSER: ::c_int = 3;
+pub const PTRACE_POKETEXT: ::c_int = 4;
+pub const PTRACE_POKEDATA: ::c_int = 5;
+pub const PTRACE_POKEUSER: ::c_int = 6;
+pub const PTRACE_CONT: ::c_int = 7;
+pub const PTRACE_KILL: ::c_int = 8;
+pub const PTRACE_SINGLESTEP: ::c_int = 9;
+pub const PTRACE_GETREGS: ::c_int = 12;
+pub const PTRACE_SETREGS: ::c_int = 13;
+pub const PTRACE_GETFPREGS: ::c_int = 14;
+pub const PTRACE_SETFPREGS: ::c_int = 15;
+pub const PTRACE_ATTACH: ::c_int = 16;
+pub const PTRACE_DETACH: ::c_int = 17;
+pub const PTRACE_GETFPXREGS: ::c_int = 18;
+pub const PTRACE_SETFPXREGS: ::c_int = 19;
+pub const PTRACE_SYSCALL: ::c_int = 24;
+pub const PTRACE_SETOPTIONS: ::c_int = 0x4200;
+pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201;
+pub const PTRACE_GETSIGINFO: ::c_int = 0x4202;
+pub const PTRACE_SETSIGINFO: ::c_int = 0x4203;
+pub const PTRACE_GETREGSET: ::c_int = 0x4204;
+pub const PTRACE_SETREGSET: ::c_int = 0x4205;
+pub const PTRACE_SEIZE: ::c_int = 0x4206;
+pub const PTRACE_INTERRUPT: ::c_int = 0x4207;
+pub const PTRACE_LISTEN: ::c_int = 0x4208;
+pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
+pub const PTRACE_GETSIGMASK: ::c_uint = 0x420a;
+pub const PTRACE_SETSIGMASK: ::c_uint = 0x420b;
+
+pub const AF_IB: ::c_int = 27;
+pub const AF_MPLS: ::c_int = 28;
+pub const AF_NFC: ::c_int = 39;
+pub const AF_VSOCK: ::c_int = 40;
+pub const AF_XDP: ::c_int = 44;
+pub const PF_IB: ::c_int = AF_IB;
+pub const PF_MPLS: ::c_int = AF_MPLS;
+pub const PF_NFC: ::c_int = AF_NFC;
+pub const PF_VSOCK: ::c_int = AF_VSOCK;
+pub const PF_XDP: ::c_int = AF_XDP;
+
+pub const EFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
+
+pub const SFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
+
+pub const PIDFD_NONBLOCK: ::c_uint = O_NONBLOCK as ::c_uint;
+
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+
+pub const CLOCK_SGI_CYCLE: ::clockid_t = 10;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+
+pub const REG_OK: ::c_int = 0;
+
+pub const PRIO_PROCESS: ::c_int = 0;
+pub const PRIO_PGRP: ::c_int = 1;
+pub const PRIO_USER: ::c_int = 2;
+
+pub const ADJ_OFFSET: ::c_uint = 0x0001;
+pub const ADJ_FREQUENCY: ::c_uint = 0x0002;
+pub const ADJ_MAXERROR: ::c_uint = 0x0004;
+pub const ADJ_ESTERROR: ::c_uint = 0x0008;
+pub const ADJ_STATUS: ::c_uint = 0x0010;
+pub const ADJ_TIMECONST: ::c_uint = 0x0020;
+pub const ADJ_TAI: ::c_uint = 0x0080;
+pub const ADJ_SETOFFSET: ::c_uint = 0x0100;
+pub const ADJ_MICRO: ::c_uint = 0x1000;
+pub const ADJ_NANO: ::c_uint = 0x2000;
+pub const ADJ_TICK: ::c_uint = 0x4000;
+pub const ADJ_OFFSET_SINGLESHOT: ::c_uint = 0x8001;
+pub const ADJ_OFFSET_SS_READ: ::c_uint = 0xa001;
+pub const MOD_OFFSET: ::c_uint = ADJ_OFFSET;
+pub const MOD_FREQUENCY: ::c_uint = ADJ_FREQUENCY;
+pub const MOD_MAXERROR: ::c_uint = ADJ_MAXERROR;
+pub const MOD_ESTERROR: ::c_uint = ADJ_ESTERROR;
+pub const MOD_STATUS: ::c_uint = ADJ_STATUS;
+pub const MOD_TIMECONST: ::c_uint = ADJ_TIMECONST;
+pub const MOD_CLKB: ::c_uint = ADJ_TICK;
+pub const MOD_CLKA: ::c_uint = ADJ_OFFSET_SINGLESHOT;
+pub const MOD_TAI: ::c_uint = ADJ_TAI;
+pub const MOD_MICRO: ::c_uint = ADJ_MICRO;
+pub const MOD_NANO: ::c_uint = ADJ_NANO;
+pub const STA_PLL: ::c_int = 0x0001;
+pub const STA_PPSFREQ: ::c_int = 0x0002;
+pub const STA_PPSTIME: ::c_int = 0x0004;
+pub const STA_FLL: ::c_int = 0x0008;
+pub const STA_INS: ::c_int = 0x0010;
+pub const STA_DEL: ::c_int = 0x0020;
+pub const STA_UNSYNC: ::c_int = 0x0040;
+pub const STA_FREQHOLD: ::c_int = 0x0080;
+pub const STA_PPSSIGNAL: ::c_int = 0x0100;
+pub const STA_PPSJITTER: ::c_int = 0x0200;
+pub const STA_PPSWANDER: ::c_int = 0x0400;
+pub const STA_PPSERROR: ::c_int = 0x0800;
+pub const STA_CLOCKERR: ::c_int = 0x1000;
+pub const STA_NANO: ::c_int = 0x2000;
+pub const STA_MODE: ::c_int = 0x4000;
+pub const STA_CLK: ::c_int = 0x8000;
+pub const STA_RONLY: ::c_int = STA_PPSSIGNAL
+    | STA_PPSJITTER
+    | STA_PPSWANDER
+    | STA_PPSERROR
+    | STA_CLOCKERR
+    | STA_NANO
+    | STA_MODE
+    | STA_CLK;
+
+pub const TIME_OK: ::c_int = 0;
+pub const TIME_INS: ::c_int = 1;
+pub const TIME_DEL: ::c_int = 2;
+pub const TIME_OOP: ::c_int = 3;
+pub const TIME_WAIT: ::c_int = 4;
+pub const TIME_ERROR: ::c_int = 5;
+pub const TIME_BAD: ::c_int = TIME_ERROR;
+pub const MAXTC: ::c_long = 6;
+
+pub const SOL_XDP: ::c_int = 283;
+
+// linux/if_xdp.h
+pub const XDP_SHARED_UMEM: ::__u16 = 1 << 0;
+pub const XDP_COPY: ::__u16 = 1 << 1;
+pub const XDP_ZEROCOPY: ::__u16 = 1 << 2;
+pub const XDP_USE_NEED_WAKEUP: ::__u16 = 1 << 3;
+pub const XDP_USE_SG: ::__u16 = 1 << 4;
+
+pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: ::__u32 = 1 << 0;
+
+pub const XDP_RING_NEED_WAKEUP: ::__u32 = 1 << 0;
+
+pub const XDP_MMAP_OFFSETS: ::c_int = 1;
+pub const XDP_RX_RING: ::c_int = 2;
+pub const XDP_TX_RING: ::c_int = 3;
+pub const XDP_UMEM_REG: ::c_int = 4;
+pub const XDP_UMEM_FILL_RING: ::c_int = 5;
+pub const XDP_UMEM_COMPLETION_RING: ::c_int = 6;
+pub const XDP_STATISTICS: ::c_int = 7;
+pub const XDP_OPTIONS: ::c_int = 8;
+
+pub const XDP_OPTIONS_ZEROCOPY: ::__u32 = 1 << 0;
+
+pub const XDP_PGOFF_RX_RING: ::off_t = 0;
+pub const XDP_PGOFF_TX_RING: ::off_t = 0x80000000;
+pub const XDP_UMEM_PGOFF_FILL_RING: ::c_ulonglong = 0x100000000;
+pub const XDP_UMEM_PGOFF_COMPLETION_RING: ::c_ulonglong = 0x180000000;
+
+pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: ::c_int = 48;
+pub const XSK_UNALIGNED_BUF_ADDR_MASK: ::c_ulonglong = (1 << XSK_UNALIGNED_BUF_OFFSET_SHIFT) - 1;
+
+pub const XDP_PKT_CONTD: ::__u32 = 1 << 0;
+
+cfg_if! {
+    if #[cfg(target_arch = "s390x")] {
+        pub const POSIX_FADV_DONTNEED: ::c_int = 6;
+        pub const POSIX_FADV_NOREUSE: ::c_int = 7;
+    } else {
+        pub const POSIX_FADV_DONTNEED: ::c_int = 4;
+        pub const POSIX_FADV_NOREUSE: ::c_int = 5;
+    }
+}
+
+extern "C" {
+    pub fn sendmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn recvmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_uint,
+        timeout: *mut ::timespec,
+    ) -> ::c_int;
+
+    pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
+    pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
+    pub fn prlimit(
+        pid: ::pid_t,
+        resource: ::c_int,
+        new_limit: *const ::rlimit,
+        old_limit: *mut ::rlimit,
+    ) -> ::c_int;
+    pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
+    pub fn ptrace(request: ::c_int, ...) -> ::c_long;
+    pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
+    // Musl targets need the `mask` argument of `fanotify_mark` be specified
+    // `::c_ulonglong` instead of `u64` or there will be a type mismatch between
+    // `long long unsigned int` and the expected `uint64_t`.
+    pub fn fanotify_mark(
+        fd: ::c_int,
+        flags: ::c_uint,
+        mask: ::c_ulonglong,
+        dirfd: ::c_int,
+        path: *const ::c_char,
+    ) -> ::c_int;
+    pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
+
+    // Added in `musl` 1.1.20
+    pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t);
+    // Added in `musl` 1.2.2
+    pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
+
+    pub fn adjtimex(buf: *mut ::timex) -> ::c_int;
+    pub fn clock_adjtime(clk_id: ::clockid_t, buf: *mut ::timex) -> ::c_int;
+
+    pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char;
+
+    pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
+    pub fn mlock2(addr: *const ::c_void, len: ::size_t, flags: ::c_uint) -> ::c_int;
+    pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;
+
+    pub fn euidaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
+    pub fn eaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
+
+    pub fn asctime_r(tm: *const ::tm, buf: *mut ::c_char) -> *mut ::c_char;
+
+    pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+    pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
+}
+
+// Alias <foo> to <foo>64 to mimic glibc's LFS64 support
+mod lfs64;
+pub use self::lfs64::*;
+
+cfg_if! {
+    if #[cfg(any(target_arch = "x86_64",
+                 target_arch = "aarch64",
+                 target_arch = "mips64",
+                 target_arch = "powerpc64",
+                 target_arch = "s390x",
+                 target_arch = "riscv64",
+                 target_arch = "loongarch64"))] {
+        mod b64;
+        pub use self::b64::*;
+    } else if #[cfg(any(target_arch = "x86",
+                        target_arch = "mips",
+                        target_arch = "powerpc",
+                        target_arch = "hexagon",
+                        target_arch = "riscv32",
+                        target_arch = "arm"))] {
+        mod b32;
+        pub use self::b32::*;
+    } else { }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/no_align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/no_align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/no_align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/no_align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,144 @@
+macro_rules! expand_align {
+    () => {
+        s! {
+            pub struct pthread_mutexattr_t {
+                #[cfg(any(target_arch = "x86_64",
+                          target_arch = "powerpc64",
+                          target_arch = "mips64",
+                          target_arch = "mips64r6",
+                          target_arch = "s390x",
+                          target_arch = "sparc64",
+                          target_arch = "riscv64",
+                          target_arch = "riscv32",
+                          target_arch = "loongarch64",
+                          all(target_arch = "aarch64",
+                              any(target_env = "musl", target_env = "ohos"))))]
+                __align: [::c_int; 0],
+                #[cfg(not(any(target_arch = "x86_64",
+                              target_arch = "powerpc64",
+                              target_arch = "mips64",
+                              target_arch = "mips64r6",
+                              target_arch = "s390x",
+                              target_arch = "sparc64",
+                              target_arch = "riscv64",
+                              target_arch = "riscv32",
+                              target_arch = "loongarch64",
+                              all(target_arch = "aarch64",
+                                  any(target_env = "musl", target_env = "ohos")))))]
+                __align: [::c_long; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
+            }
+
+            pub struct pthread_rwlockattr_t {
+                #[cfg(any(target_env = "musl", target_env = "ohos"))]
+                __align: [::c_int; 0],
+                #[cfg(not(any(target_env = "musl", target_env = "ohos")))]
+                __align: [::c_long; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
+            }
+
+            pub struct pthread_condattr_t {
+                __align: [::c_int; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
+            }
+
+            pub struct pthread_barrierattr_t {
+                __align: [::c_int; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_BARRIERATTR_T],
+            }
+
+            pub struct fanotify_event_metadata {
+                __align: [::c_long; 0],
+                pub event_len: __u32,
+                pub vers: __u8,
+                pub reserved: __u8,
+                pub metadata_len: __u16,
+                pub mask: __u64,
+                pub fd: ::c_int,
+                pub pid: ::c_int,
+            }
+        }
+
+        s_no_extra_traits! {
+            pub struct pthread_cond_t {
+                #[cfg(any(target_env = "musl", target_env = "ohos"))]
+                __align: [*const ::c_void; 0],
+                #[cfg(not(any(target_env = "musl", target_env = "ohos")))]
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_COND_T],
+            }
+
+            pub struct pthread_mutex_t {
+                #[cfg(any(target_arch = "mips",
+                          target_arch = "mips32r6",
+                          target_arch = "arm",
+                          target_arch = "m68k",
+                          target_arch = "csky",
+                          target_arch = "powerpc",
+                          target_arch = "sparc",
+                          all(target_arch = "x86_64",
+                              target_pointer_width = "32")))]
+                __align: [::c_long; 0],
+                #[cfg(not(any(target_arch = "mips",
+                              target_arch = "mips32r6",
+                              target_arch = "arm",
+                              target_arch = "m68k",
+                              target_arch = "csky",
+                              target_arch = "powerpc",
+                              target_arch = "sparc",
+                              all(target_arch = "x86_64",
+                                  target_pointer_width = "32"))))]
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
+            }
+
+            pub struct pthread_rwlock_t {
+                #[cfg(any(target_arch = "mips",
+                          target_arch = "mips32r6",
+                          target_arch = "arm",
+                          target_arch = "m68k",
+                          target_arch = "csky",
+                          target_arch = "powerpc",
+                          target_arch = "sparc",
+                          all(target_arch = "x86_64",
+                              target_pointer_width = "32")))]
+                __align: [::c_long; 0],
+                #[cfg(not(any(target_arch = "mips",
+                              target_arch = "mips32r6",
+                              target_arch = "arm",
+                              target_arch = "m68k",
+                              target_arch = "csky",
+                              target_arch = "powerpc",
+                              target_arch = "sparc",
+                              all(target_arch = "x86_64",
+                                  target_pointer_width = "32"))))]
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
+            }
+
+            pub struct pthread_barrier_t {
+                #[cfg(any(target_arch = "mips",
+                          target_arch = "mips32r6",
+                          target_arch = "arm",
+                          target_arch = "m68k",
+                          target_arch = "csky",
+                          target_arch = "powerpc",
+                          target_arch = "sparc",
+                          all(target_arch = "x86_64",
+                              target_pointer_width = "32")))]
+                __align: [::c_long; 0],
+                #[cfg(not(any(target_arch = "mips",
+                              target_arch = "mips32r6",
+                              target_arch = "arm",
+                              target_arch = "m68k",
+                              target_arch = "csky",
+                              target_arch = "powerpc",
+                              target_arch = "sparc",
+                              all(target_arch = "x86_64",
+                                  target_pointer_width = "32"))))]
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_BARRIER_T],
+            }
+        }
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/non_exhaustive.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/non_exhaustive.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/non_exhaustive.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/non_exhaustive.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,9 @@
+s! {
+    // linux/openat2.h
+    #[non_exhaustive]
+    pub struct open_how {
+        pub flags: ::__u64,
+        pub mode: ::__u64,
+        pub resolve: ::__u64,
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,28 @@
+macro_rules! expand_align {
+    () => {
+        s! {
+            #[cfg_attr(any(target_pointer_width = "32",
+                           target_arch = "x86_64",
+                           target_arch = "powerpc64",
+                           target_arch = "mips64",
+                           target_arch = "s390x",
+                           target_arch = "sparc64"),
+                       repr(align(4)))]
+            #[cfg_attr(not(any(target_pointer_width = "32",
+                               target_arch = "x86_64",
+                               target_arch = "powerpc64",
+                               target_arch = "mips64",
+                               target_arch = "s390x",
+                               target_arch = "sparc64")),
+                       repr(align(8)))]
+            pub struct pthread_mutexattr_t {
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
+            }
+
+            #[repr(align(4))]
+            pub struct pthread_condattr_t {
+                size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
+            }
+        }
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/arm/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/arm/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/arm/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/arm/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,13 @@
+s! {
+    // FIXME this is actually a union
+    #[cfg_attr(target_pointer_width = "32",
+               repr(align(4)))]
+    #[cfg_attr(target_pointer_width = "64",
+               repr(align(8)))]
+    pub struct sem_t {
+        #[cfg(target_pointer_width = "32")]
+        __size: [::c_char; 16],
+        #[cfg(target_pointer_width = "64")]
+        __size: [::c_char; 32],
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/arm/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/arm/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/arm/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/arm/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,925 @@
+pub type c_char = u8;
+pub type wchar_t = ::c_uint;
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type time_t = ::c_long;
+
+pub type clock_t = ::c_long;
+pub type fsblkcnt_t = ::c_ulong;
+pub type fsfilcnt_t = ::c_ulong;
+pub type ino_t = ::c_ulong;
+pub type off_t = ::c_long;
+pub type pthread_t = ::c_ulong;
+pub type suseconds_t = ::c_long;
+
+pub type nlink_t = ::c_uint;
+pub type blksize_t = ::c_long;
+pub type blkcnt_t = ::c_long;
+
+pub type fsblkcnt64_t = u64;
+pub type fsfilcnt64_t = u64;
+pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
+
+s! {
+    pub struct cmsghdr {
+        pub cmsg_len: ::size_t,
+        pub cmsg_level: ::c_int,
+        pub cmsg_type: ::c_int,
+    }
+
+    pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: ::socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::c_int,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: ::socklen_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct pthread_attr_t {
+        __size: [::c_long; 9],
+    }
+
+    pub struct stat {
+        pub st_dev: ::c_ulonglong,
+        __pad1: ::c_ushort,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulonglong,
+        __pad2: ::c_ushort,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong,
+    }
+
+    pub struct stat64
+    {
+        pub st_dev: ::c_ulonglong,
+        pub __pad1: ::c_uint,
+        pub __st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulonglong,
+        pub __pad2: ::c_uint,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_ino: ::ino64_t,
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+    }
+
+    pub struct sysinfo {
+        pub uptime: ::c_long,
+        pub loads: [::c_ulong; 3],
+        pub totalram: ::c_ulong,
+        pub freeram: ::c_ulong,
+        pub sharedram: ::c_ulong,
+        pub bufferram: ::c_ulong,
+        pub totalswap: ::c_ulong,
+        pub freeswap: ::c_ulong,
+        pub procs: ::c_ushort,
+        pub pad: ::c_ushort,
+        pub totalhigh: ::c_ulong,
+        pub freehigh: ::c_ulong,
+        pub mem_unit: ::c_uint,
+        pub _f: [::c_char; 8],
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_int,
+        pub f_bsize: ::c_int,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_int,
+        pub f_frsize: ::c_int,
+        pub f_flags: ::c_int,
+        pub f_spare: [::c_int; 4],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_int,
+        pub f_bsize: ::c_int,
+        pub f_blocks: ::fsblkcnt64_t,
+        pub f_bfree: ::fsblkcnt64_t,
+        pub f_bavail: ::fsblkcnt64_t,
+        pub f_files: ::fsfilcnt64_t,
+        pub f_ffree: ::fsfilcnt64_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_int,
+        pub f_frsize: ::c_int,
+        pub f_flags: ::c_int,
+        pub f_spare: [::c_int; 4],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        __f_unused: ::c_int,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct sigset_t {
+        __val: [::c_ulong; 2],
+    }
+
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_flags: ::c_ulong,
+        pub sa_restorer: ::Option<extern fn()>,
+        pub sa_mask: sigset_t,
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::NCCS],
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::speed_t,
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        pub _pad: [::c_int; 29],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t,
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::c_ushort,
+        __pad1: ::c_ushort,
+        pub __seq: ::c_ushort,
+        __pad2: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __unused1: ::c_ulong,
+        pub msg_rtime: ::time_t,
+        __unused2: ::c_ulong,
+        pub msg_ctime: ::time_t,
+        __unused3: ::c_ulong,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong,
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        __unused1: ::c_ulong,
+        pub shm_dtime: ::time_t,
+        __unused2: ::c_ulong,
+        pub shm_ctime: ::time_t,
+        __unused3: ::c_ulong,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong,
+    }
+}
+
+pub const O_CLOEXEC: ::c_int = 0o2000000;
+pub const __SIZEOF_PTHREAD_ATTR_T: usize = 36;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_COND_COMPAT_T: usize = 12;
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32;
+pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
+pub const NCCS: usize = 32;
+
+// I wasn't able to find those constants
+// in uclibc build environment for armv7
+pub const MAP_HUGETLB: ::c_int = 0x040000; // from linux/other/mod.rs
+
+// autogenerated constants with hand tuned types
+pub const B0: ::speed_t = 0;
+pub const B1000000: ::speed_t = 0x1008;
+pub const B110: ::speed_t = 0x3;
+pub const B115200: ::speed_t = 0x1002;
+pub const B1152000: ::speed_t = 0x1009;
+pub const B1200: ::speed_t = 0x9;
+pub const B134: ::speed_t = 0x4;
+pub const B150: ::speed_t = 0x5;
+pub const B1500000: ::speed_t = 0x100a;
+pub const B1800: ::speed_t = 0xa;
+pub const B19200: ::speed_t = 0xe;
+pub const B200: ::speed_t = 0x6;
+pub const B2000000: ::speed_t = 0x100b;
+pub const B230400: ::speed_t = 0x1003;
+pub const B2400: ::speed_t = 0xb;
+pub const B2500000: ::speed_t = 0x100c;
+pub const B300: ::speed_t = 0x7;
+pub const B3000000: ::speed_t = 0x100d;
+pub const B3500000: ::speed_t = 0x100e;
+pub const B38400: ::speed_t = 0xf;
+pub const B4000000: ::speed_t = 0x100f;
+pub const B460800: ::speed_t = 0x1004;
+pub const B4800: ::speed_t = 0xc;
+pub const B50: ::speed_t = 0x1;
+pub const B500000: ::speed_t = 0x1005;
+pub const B57600: ::speed_t = 0x1001;
+pub const B576000: ::speed_t = 0x1006;
+pub const B600: ::speed_t = 0x8;
+pub const B75: ::speed_t = 0x2;
+pub const B921600: ::speed_t = 0x1007;
+pub const B9600: ::speed_t = 0xd;
+pub const BS1: ::c_int = 0x2000;
+pub const BSDLY: ::c_int = 0x2000;
+pub const CBAUD: ::tcflag_t = 0x100f;
+pub const CBAUDEX: ::tcflag_t = 0x1000;
+pub const CIBAUD: ::tcflag_t = 0x100f0000;
+pub const CLOCAL: ::tcflag_t = 0x800;
+pub const CPU_SETSIZE: ::c_int = 0x400;
+pub const CR1: ::c_int = 0x200;
+pub const CR2: ::c_int = 0x400;
+pub const CR3: ::c_int = 0x600;
+pub const CRDLY: ::c_int = 0x600;
+pub const CREAD: ::tcflag_t = 0x80;
+pub const CS6: ::tcflag_t = 0x10;
+pub const CS7: ::tcflag_t = 0x20;
+pub const CS8: ::tcflag_t = 0x30;
+pub const CSIZE: ::tcflag_t = 0x30;
+pub const CSTOPB: ::tcflag_t = 0x40;
+pub const EADDRINUSE: ::c_int = 0x62;
+pub const EADDRNOTAVAIL: ::c_int = 0x63;
+pub const EADV: ::c_int = 0x44;
+pub const EAFNOSUPPORT: ::c_int = 0x61;
+pub const EALREADY: ::c_int = 0x72;
+pub const EBADE: ::c_int = 0x34;
+pub const EBADFD: ::c_int = 0x4d;
+pub const EBADMSG: ::c_int = 0x4a;
+pub const EBADR: ::c_int = 0x35;
+pub const EBADRQC: ::c_int = 0x38;
+pub const EBADSLT: ::c_int = 0x39;
+pub const EBFONT: ::c_int = 0x3b;
+pub const ECANCELED: ::c_int = 0x7d;
+pub const ECHOCTL: ::tcflag_t = 0x200;
+pub const ECHOE: ::tcflag_t = 0x10;
+pub const ECHOK: ::tcflag_t = 0x20;
+pub const ECHOKE: ::tcflag_t = 0x800;
+pub const ECHONL: ::tcflag_t = 0x40;
+pub const ECHOPRT: ::tcflag_t = 0x400;
+pub const ECHRNG: ::c_int = 0x2c;
+pub const ECOMM: ::c_int = 0x46;
+pub const ECONNABORTED: ::c_int = 0x67;
+pub const ECONNREFUSED: ::c_int = 0x6f;
+pub const ECONNRESET: ::c_int = 0x68;
+pub const EDEADLK: ::c_int = 0x23;
+pub const EDESTADDRREQ: ::c_int = 0x59;
+pub const EDOTDOT: ::c_int = 0x49;
+pub const EDQUOT: ::c_int = 0x7a;
+pub const EFD_CLOEXEC: ::c_int = 0x80000;
+pub const EFD_NONBLOCK: ::c_int = 0x800;
+pub const EHOSTDOWN: ::c_int = 0x70;
+pub const EHOSTUNREACH: ::c_int = 0x71;
+pub const EHWPOISON: ::c_int = 0x85;
+pub const EIDRM: ::c_int = 0x2b;
+pub const EILSEQ: ::c_int = 0x54;
+pub const EINPROGRESS: ::c_int = 0x73;
+pub const EISCONN: ::c_int = 0x6a;
+pub const EISNAM: ::c_int = 0x78;
+pub const EKEYEXPIRED: ::c_int = 0x7f;
+pub const EKEYREJECTED: ::c_int = 0x81;
+pub const EKEYREVOKED: ::c_int = 0x80;
+pub const EL2HLT: ::c_int = 0x33;
+pub const EL2NSYNC: ::c_int = 0x2d;
+pub const EL3HLT: ::c_int = 0x2e;
+pub const EL3RST: ::c_int = 0x2f;
+pub const ELIBACC: ::c_int = 0x4f;
+pub const ELIBBAD: ::c_int = 0x50;
+pub const ELIBEXEC: ::c_int = 0x53;
+pub const ELIBMAX: ::c_int = 0x52;
+pub const ELIBSCN: ::c_int = 0x51;
+pub const ELNRNG: ::c_int = 0x30;
+pub const ELOOP: ::c_int = 0x28;
+pub const EMEDIUMTYPE: ::c_int = 0x7c;
+pub const EMSGSIZE: ::c_int = 0x5a;
+pub const EMULTIHOP: ::c_int = 0x48;
+pub const ENAMETOOLONG: ::c_int = 0x24;
+pub const ENAVAIL: ::c_int = 0x77;
+pub const ENETDOWN: ::c_int = 0x64;
+pub const ENETRESET: ::c_int = 0x66;
+pub const ENETUNREACH: ::c_int = 0x65;
+pub const ENOANO: ::c_int = 0x37;
+pub const ENOBUFS: ::c_int = 0x69;
+pub const ENOCSI: ::c_int = 0x32;
+pub const ENODATA: ::c_int = 0x3d;
+pub const ENOKEY: ::c_int = 0x7e;
+pub const ENOLCK: ::c_int = 0x25;
+pub const ENOLINK: ::c_int = 0x43;
+pub const ENOMEDIUM: ::c_int = 0x7b;
+pub const ENOMSG: ::c_int = 0x2a;
+pub const ENONET: ::c_int = 0x40;
+pub const ENOPKG: ::c_int = 0x41;
+pub const ENOPROTOOPT: ::c_int = 0x5c;
+pub const ENOSR: ::c_int = 0x3f;
+pub const ENOSTR: ::c_int = 0x3c;
+pub const ENOSYS: ::c_int = 0x26;
+pub const ENOTCONN: ::c_int = 0x6b;
+pub const ENOTEMPTY: ::c_int = 0x27;
+pub const ENOTNAM: ::c_int = 0x76;
+pub const ENOTRECOVERABLE: ::c_int = 0x83;
+pub const ENOTSOCK: ::c_int = 0x58;
+pub const ENOTUNIQ: ::c_int = 0x4c;
+pub const EOPNOTSUPP: ::c_int = 0x5f;
+pub const EOVERFLOW: ::c_int = 0x4b;
+pub const EOWNERDEAD: ::c_int = 0x82;
+pub const EPFNOSUPPORT: ::c_int = 0x60;
+pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
+pub const EPROTO: ::c_int = 0x47;
+pub const EPROTONOSUPPORT: ::c_int = 0x5d;
+pub const EPROTOTYPE: ::c_int = 0x5b;
+pub const EREMCHG: ::c_int = 0x4e;
+pub const EREMOTE: ::c_int = 0x42;
+pub const EREMOTEIO: ::c_int = 0x79;
+pub const ERESTART: ::c_int = 0x55;
+pub const ERFKILL: ::c_int = 0x84;
+pub const ESHUTDOWN: ::c_int = 0x6c;
+pub const ESOCKTNOSUPPORT: ::c_int = 0x5e;
+pub const ESRMNT: ::c_int = 0x45;
+pub const ESTALE: ::c_int = 0x74;
+pub const ESTRPIPE: ::c_int = 0x56;
+pub const ETIME: ::c_int = 0x3e;
+pub const ETIMEDOUT: ::c_int = 0x6e;
+pub const ETOOMANYREFS: ::c_int = 0x6d;
+pub const EUCLEAN: ::c_int = 0x75;
+pub const EUNATCH: ::c_int = 0x31;
+pub const EUSERS: ::c_int = 0x57;
+pub const EXFULL: ::c_int = 0x36;
+pub const FF1: ::c_int = 0x8000;
+pub const FFDLY: ::c_int = 0x8000;
+pub const FLUSHO: ::tcflag_t = 0x1000;
+pub const F_GETLK: ::c_int = 0x5;
+pub const F_SETLK: ::c_int = 0x6;
+pub const F_SETLKW: ::c_int = 0x7;
+pub const HUPCL: ::tcflag_t = 0x400;
+pub const ICANON: ::tcflag_t = 0x2;
+pub const IEXTEN: ::tcflag_t = 0x8000;
+pub const ISIG: ::tcflag_t = 0x1;
+pub const IXOFF: ::tcflag_t = 0x1000;
+pub const IXON: ::tcflag_t = 0x400;
+pub const MAP_ANON: ::c_int = 0x20;
+pub const MAP_ANONYMOUS: ::c_int = 0x20;
+pub const MAP_DENYWRITE: ::c_int = 0x800;
+pub const MAP_EXECUTABLE: ::c_int = 0x1000;
+pub const MAP_GROWSDOWN: ::c_int = 0x100;
+pub const MAP_LOCKED: ::c_int = 0x2000;
+pub const MAP_NONBLOCK: ::c_int = 0x10000;
+pub const MAP_NORESERVE: ::c_int = 0x4000;
+pub const MAP_POPULATE: ::c_int = 0x8000;
+pub const MAP_STACK: ::c_int = 0x20000;
+pub const NLDLY: ::tcflag_t = 0x100;
+pub const NOFLSH: ::tcflag_t = 0x80;
+pub const OLCUC: ::tcflag_t = 0x2;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const O_ACCMODE: ::c_int = 0x3;
+pub const O_APPEND: ::c_int = 0x400;
+pub const O_ASYNC: ::c_int = 0o20000;
+pub const O_CREAT: ::c_int = 0x40;
+pub const O_DIRECT: ::c_int = 0x10000;
+pub const O_DIRECTORY: ::c_int = 0x4000;
+pub const O_DSYNC: ::c_int = O_SYNC;
+pub const O_EXCL: ::c_int = 0x80;
+pub const O_FSYNC: ::c_int = O_SYNC;
+pub const O_LARGEFILE: ::c_int = 0o400000;
+pub const O_NDELAY: ::c_int = O_NONBLOCK;
+pub const O_NOATIME: ::c_int = 0o1000000;
+pub const O_NOCTTY: ::c_int = 0x100;
+pub const O_NOFOLLOW: ::c_int = 0x8000;
+pub const O_NONBLOCK: ::c_int = 0x800;
+pub const O_PATH: ::c_int = 0o10000000;
+pub const O_RSYNC: ::c_int = O_SYNC;
+pub const O_SYNC: ::c_int = 0o10000;
+pub const O_TRUNC: ::c_int = 0x200;
+pub const PARENB: ::tcflag_t = 0x100;
+pub const PARODD: ::tcflag_t = 0x200;
+pub const PENDIN: ::tcflag_t = 0x4000;
+pub const POLLWRBAND: ::c_short = 0x200;
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const PTHREAD_STACK_MIN: ::size_t = 16384;
+pub const RTLD_GLOBAL: ::c_int = 0x00100;
+pub const PIDFD_NONBLOCK: ::c_int = 0x800;
+
+// These are typed unsigned to match sigaction
+pub const SA_NOCLDSTOP: ::c_ulong = 0x1;
+pub const SA_NOCLDWAIT: ::c_ulong = 0x2;
+pub const SA_SIGINFO: ::c_ulong = 0x4;
+pub const SA_NODEFER: ::c_ulong = 0x40000000;
+pub const SA_ONSTACK: ::c_ulong = 0x8000000;
+pub const SA_RESETHAND: ::c_ulong = 0x80000000;
+pub const SA_RESTART: ::c_ulong = 0x10000000;
+
+pub const SFD_CLOEXEC: ::c_int = 0x80000;
+pub const SFD_NONBLOCK: ::c_int = 0x800;
+pub const SIGBUS: ::c_int = 0x7;
+pub const SIGCHLD: ::c_int = 0x11;
+pub const SIGCONT: ::c_int = 0x12;
+pub const SIGIO: ::c_int = 0x1d;
+pub const SIGPROF: ::c_int = 0x1b;
+pub const SIGPWR: ::c_int = 0x1e;
+pub const SIGSTKFLT: ::c_int = 0x10;
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const SIGSTOP: ::c_int = 0x13;
+pub const SIGSYS: ::c_int = 0x1f;
+pub const SIGTSTP: ::c_int = 0x14;
+pub const SIGTTIN: ::c_int = 0x15;
+pub const SIGTTOU: ::c_int = 0x16;
+pub const SIGURG: ::c_int = 0x17;
+pub const SIGUSR1: ::c_int = 0xa;
+pub const SIGUSR2: ::c_int = 0xc;
+pub const SIGVTALRM: ::c_int = 0x1a;
+pub const SIGWINCH: ::c_int = 0x1c;
+pub const SIGXCPU: ::c_int = 0x18;
+pub const SIGXFSZ: ::c_int = 0x19;
+pub const SIG_BLOCK: ::c_int = 0;
+pub const SIG_SETMASK: ::c_int = 0x2;
+pub const SIG_UNBLOCK: ::c_int = 0x1;
+pub const SOCK_DGRAM: ::c_int = 0x2;
+pub const SOCK_NONBLOCK: ::c_int = 0o0004000;
+pub const SOCK_SEQPACKET: ::c_int = 0x5;
+pub const SOCK_STREAM: ::c_int = 0x1;
+
+pub const TAB1: ::c_int = 0x800;
+pub const TAB2: ::c_int = 0x1000;
+pub const TAB3: ::c_int = 0x1800;
+pub const TABDLY: ::c_int = 0x1800;
+pub const TCSADRAIN: ::c_int = 0x1;
+pub const TCSAFLUSH: ::c_int = 0x2;
+pub const TCSANOW: ::c_int = 0;
+pub const TOSTOP: ::tcflag_t = 0x100;
+pub const VDISCARD: usize = 0xd;
+pub const VEOF: usize = 0x4;
+pub const VEOL: usize = 0xb;
+pub const VEOL2: usize = 0x10;
+pub const VMIN: usize = 0x6;
+pub const VREPRINT: usize = 0xc;
+pub const VSTART: usize = 0x8;
+pub const VSTOP: usize = 0x9;
+pub const VSUSP: usize = 0xa;
+pub const VSWTC: usize = 0x7;
+pub const VT1: ::c_int = 0x4000;
+pub const VTDLY: ::c_int = 0x4000;
+pub const VTIME: usize = 0x5;
+pub const VWERASE: usize = 0xe;
+pub const XTABS: ::tcflag_t = 0x1800;
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+
+// Syscall table is copied from src/unix/notbsd/linux/musl/b32/arm.rs
+pub const SYS_restart_syscall: ::c_long = 0;
+pub const SYS_exit: ::c_long = 1;
+pub const SYS_fork: ::c_long = 2;
+pub const SYS_read: ::c_long = 3;
+pub const SYS_write: ::c_long = 4;
+pub const SYS_open: ::c_long = 5;
+pub const SYS_close: ::c_long = 6;
+pub const SYS_creat: ::c_long = 8;
+pub const SYS_link: ::c_long = 9;
+pub const SYS_unlink: ::c_long = 10;
+pub const SYS_execve: ::c_long = 11;
+pub const SYS_chdir: ::c_long = 12;
+pub const SYS_mknod: ::c_long = 14;
+pub const SYS_chmod: ::c_long = 15;
+pub const SYS_lchown: ::c_long = 16;
+pub const SYS_lseek: ::c_long = 19;
+pub const SYS_getpid: ::c_long = 20;
+pub const SYS_mount: ::c_long = 21;
+pub const SYS_setuid: ::c_long = 23;
+pub const SYS_getuid: ::c_long = 24;
+pub const SYS_ptrace: ::c_long = 26;
+pub const SYS_pause: ::c_long = 29;
+pub const SYS_access: ::c_long = 33;
+pub const SYS_nice: ::c_long = 34;
+pub const SYS_sync: ::c_long = 36;
+pub const SYS_kill: ::c_long = 37;
+pub const SYS_rename: ::c_long = 38;
+pub const SYS_mkdir: ::c_long = 39;
+pub const SYS_rmdir: ::c_long = 40;
+pub const SYS_dup: ::c_long = 41;
+pub const SYS_pipe: ::c_long = 42;
+pub const SYS_times: ::c_long = 43;
+pub const SYS_brk: ::c_long = 45;
+pub const SYS_setgid: ::c_long = 46;
+pub const SYS_getgid: ::c_long = 47;
+pub const SYS_geteuid: ::c_long = 49;
+pub const SYS_getegid: ::c_long = 50;
+pub const SYS_acct: ::c_long = 51;
+pub const SYS_umount2: ::c_long = 52;
+pub const SYS_ioctl: ::c_long = 54;
+pub const SYS_fcntl: ::c_long = 55;
+pub const SYS_setpgid: ::c_long = 57;
+pub const SYS_umask: ::c_long = 60;
+pub const SYS_chroot: ::c_long = 61;
+pub const SYS_ustat: ::c_long = 62;
+pub const SYS_dup2: ::c_long = 63;
+pub const SYS_getppid: ::c_long = 64;
+pub const SYS_getpgrp: ::c_long = 65;
+pub const SYS_setsid: ::c_long = 66;
+pub const SYS_sigaction: ::c_long = 67;
+pub const SYS_setreuid: ::c_long = 70;
+pub const SYS_setregid: ::c_long = 71;
+pub const SYS_sigsuspend: ::c_long = 72;
+pub const SYS_sigpending: ::c_long = 73;
+pub const SYS_sethostname: ::c_long = 74;
+pub const SYS_setrlimit: ::c_long = 75;
+pub const SYS_getrusage: ::c_long = 77;
+pub const SYS_gettimeofday: ::c_long = 78;
+pub const SYS_settimeofday: ::c_long = 79;
+pub const SYS_getgroups: ::c_long = 80;
+pub const SYS_setgroups: ::c_long = 81;
+pub const SYS_symlink: ::c_long = 83;
+pub const SYS_readlink: ::c_long = 85;
+pub const SYS_uselib: ::c_long = 86;
+pub const SYS_swapon: ::c_long = 87;
+pub const SYS_reboot: ::c_long = 88;
+pub const SYS_munmap: ::c_long = 91;
+pub const SYS_truncate: ::c_long = 92;
+pub const SYS_ftruncate: ::c_long = 93;
+pub const SYS_fchmod: ::c_long = 94;
+pub const SYS_fchown: ::c_long = 95;
+pub const SYS_getpriority: ::c_long = 96;
+pub const SYS_setpriority: ::c_long = 97;
+pub const SYS_statfs: ::c_long = 99;
+pub const SYS_fstatfs: ::c_long = 100;
+pub const SYS_syslog: ::c_long = 103;
+pub const SYS_setitimer: ::c_long = 104;
+pub const SYS_getitimer: ::c_long = 105;
+pub const SYS_stat: ::c_long = 106;
+pub const SYS_lstat: ::c_long = 107;
+pub const SYS_fstat: ::c_long = 108;
+pub const SYS_vhangup: ::c_long = 111;
+pub const SYS_wait4: ::c_long = 114;
+pub const SYS_swapoff: ::c_long = 115;
+pub const SYS_sysinfo: ::c_long = 116;
+pub const SYS_fsync: ::c_long = 118;
+pub const SYS_sigreturn: ::c_long = 119;
+pub const SYS_clone: ::c_long = 120;
+pub const SYS_setdomainname: ::c_long = 121;
+pub const SYS_uname: ::c_long = 122;
+pub const SYS_adjtimex: ::c_long = 124;
+pub const SYS_mprotect: ::c_long = 125;
+pub const SYS_sigprocmask: ::c_long = 126;
+pub const SYS_init_module: ::c_long = 128;
+pub const SYS_delete_module: ::c_long = 129;
+pub const SYS_quotactl: ::c_long = 131;
+pub const SYS_getpgid: ::c_long = 132;
+pub const SYS_fchdir: ::c_long = 133;
+pub const SYS_bdflush: ::c_long = 134;
+pub const SYS_sysfs: ::c_long = 135;
+pub const SYS_personality: ::c_long = 136;
+pub const SYS_setfsuid: ::c_long = 138;
+pub const SYS_setfsgid: ::c_long = 139;
+pub const SYS__llseek: ::c_long = 140;
+pub const SYS_getdents: ::c_long = 141;
+pub const SYS__newselect: ::c_long = 142;
+pub const SYS_flock: ::c_long = 143;
+pub const SYS_msync: ::c_long = 144;
+pub const SYS_readv: ::c_long = 145;
+pub const SYS_writev: ::c_long = 146;
+pub const SYS_getsid: ::c_long = 147;
+pub const SYS_fdatasync: ::c_long = 148;
+pub const SYS__sysctl: ::c_long = 149;
+pub const SYS_mlock: ::c_long = 150;
+pub const SYS_munlock: ::c_long = 151;
+pub const SYS_mlockall: ::c_long = 152;
+pub const SYS_munlockall: ::c_long = 153;
+pub const SYS_sched_setparam: ::c_long = 154;
+pub const SYS_sched_getparam: ::c_long = 155;
+pub const SYS_sched_setscheduler: ::c_long = 156;
+pub const SYS_sched_getscheduler: ::c_long = 157;
+pub const SYS_sched_yield: ::c_long = 158;
+pub const SYS_sched_get_priority_max: ::c_long = 159;
+pub const SYS_sched_get_priority_min: ::c_long = 160;
+pub const SYS_sched_rr_get_interval: ::c_long = 161;
+pub const SYS_nanosleep: ::c_long = 162;
+pub const SYS_mremap: ::c_long = 163;
+pub const SYS_setresuid: ::c_long = 164;
+pub const SYS_getresuid: ::c_long = 165;
+pub const SYS_poll: ::c_long = 168;
+pub const SYS_nfsservctl: ::c_long = 169;
+pub const SYS_setresgid: ::c_long = 170;
+pub const SYS_getresgid: ::c_long = 171;
+pub const SYS_prctl: ::c_long = 172;
+pub const SYS_rt_sigreturn: ::c_long = 173;
+pub const SYS_rt_sigaction: ::c_long = 174;
+pub const SYS_rt_sigprocmask: ::c_long = 175;
+pub const SYS_rt_sigpending: ::c_long = 176;
+pub const SYS_rt_sigtimedwait: ::c_long = 177;
+pub const SYS_rt_sigqueueinfo: ::c_long = 178;
+pub const SYS_rt_sigsuspend: ::c_long = 179;
+pub const SYS_pread64: ::c_long = 180;
+pub const SYS_pwrite64: ::c_long = 181;
+pub const SYS_chown: ::c_long = 182;
+pub const SYS_getcwd: ::c_long = 183;
+pub const SYS_capget: ::c_long = 184;
+pub const SYS_capset: ::c_long = 185;
+pub const SYS_sigaltstack: ::c_long = 186;
+pub const SYS_sendfile: ::c_long = 187;
+pub const SYS_vfork: ::c_long = 190;
+pub const SYS_ugetrlimit: ::c_long = 191;
+pub const SYS_mmap2: ::c_long = 192;
+pub const SYS_truncate64: ::c_long = 193;
+pub const SYS_ftruncate64: ::c_long = 194;
+pub const SYS_stat64: ::c_long = 195;
+pub const SYS_lstat64: ::c_long = 196;
+pub const SYS_fstat64: ::c_long = 197;
+pub const SYS_lchown32: ::c_long = 198;
+pub const SYS_getuid32: ::c_long = 199;
+pub const SYS_getgid32: ::c_long = 200;
+pub const SYS_geteuid32: ::c_long = 201;
+pub const SYS_getegid32: ::c_long = 202;
+pub const SYS_setreuid32: ::c_long = 203;
+pub const SYS_setregid32: ::c_long = 204;
+pub const SYS_getgroups32: ::c_long = 205;
+pub const SYS_setgroups32: ::c_long = 206;
+pub const SYS_fchown32: ::c_long = 207;
+pub const SYS_setresuid32: ::c_long = 208;
+pub const SYS_getresuid32: ::c_long = 209;
+pub const SYS_setresgid32: ::c_long = 210;
+pub const SYS_getresgid32: ::c_long = 211;
+pub const SYS_chown32: ::c_long = 212;
+pub const SYS_setuid32: ::c_long = 213;
+pub const SYS_setgid32: ::c_long = 214;
+pub const SYS_setfsuid32: ::c_long = 215;
+pub const SYS_setfsgid32: ::c_long = 216;
+pub const SYS_getdents64: ::c_long = 217;
+pub const SYS_pivot_root: ::c_long = 218;
+pub const SYS_mincore: ::c_long = 219;
+pub const SYS_madvise: ::c_long = 220;
+pub const SYS_fcntl64: ::c_long = 221;
+pub const SYS_gettid: ::c_long = 224;
+pub const SYS_readahead: ::c_long = 225;
+pub const SYS_setxattr: ::c_long = 226;
+pub const SYS_lsetxattr: ::c_long = 227;
+pub const SYS_fsetxattr: ::c_long = 228;
+pub const SYS_getxattr: ::c_long = 229;
+pub const SYS_lgetxattr: ::c_long = 230;
+pub const SYS_fgetxattr: ::c_long = 231;
+pub const SYS_listxattr: ::c_long = 232;
+pub const SYS_llistxattr: ::c_long = 233;
+pub const SYS_flistxattr: ::c_long = 234;
+pub const SYS_removexattr: ::c_long = 235;
+pub const SYS_lremovexattr: ::c_long = 236;
+pub const SYS_fremovexattr: ::c_long = 237;
+pub const SYS_tkill: ::c_long = 238;
+pub const SYS_sendfile64: ::c_long = 239;
+pub const SYS_futex: ::c_long = 240;
+pub const SYS_sched_setaffinity: ::c_long = 241;
+pub const SYS_sched_getaffinity: ::c_long = 242;
+pub const SYS_io_setup: ::c_long = 243;
+pub const SYS_io_destroy: ::c_long = 244;
+pub const SYS_io_getevents: ::c_long = 245;
+pub const SYS_io_submit: ::c_long = 246;
+pub const SYS_io_cancel: ::c_long = 247;
+pub const SYS_exit_group: ::c_long = 248;
+pub const SYS_lookup_dcookie: ::c_long = 249;
+pub const SYS_epoll_create: ::c_long = 250;
+pub const SYS_epoll_ctl: ::c_long = 251;
+pub const SYS_epoll_wait: ::c_long = 252;
+pub const SYS_remap_file_pages: ::c_long = 253;
+pub const SYS_set_tid_address: ::c_long = 256;
+pub const SYS_timer_create: ::c_long = 257;
+pub const SYS_timer_settime: ::c_long = 258;
+pub const SYS_timer_gettime: ::c_long = 259;
+pub const SYS_timer_getoverrun: ::c_long = 260;
+pub const SYS_timer_delete: ::c_long = 261;
+pub const SYS_clock_settime: ::c_long = 262;
+pub const SYS_clock_gettime: ::c_long = 263;
+pub const SYS_clock_getres: ::c_long = 264;
+pub const SYS_clock_nanosleep: ::c_long = 265;
+pub const SYS_statfs64: ::c_long = 266;
+pub const SYS_fstatfs64: ::c_long = 267;
+pub const SYS_tgkill: ::c_long = 268;
+pub const SYS_utimes: ::c_long = 269;
+pub const SYS_pciconfig_iobase: ::c_long = 271;
+pub const SYS_pciconfig_read: ::c_long = 272;
+pub const SYS_pciconfig_write: ::c_long = 273;
+pub const SYS_mq_open: ::c_long = 274;
+pub const SYS_mq_unlink: ::c_long = 275;
+pub const SYS_mq_timedsend: ::c_long = 276;
+pub const SYS_mq_timedreceive: ::c_long = 277;
+pub const SYS_mq_notify: ::c_long = 278;
+pub const SYS_mq_getsetattr: ::c_long = 279;
+pub const SYS_waitid: ::c_long = 280;
+pub const SYS_socket: ::c_long = 281;
+pub const SYS_bind: ::c_long = 282;
+pub const SYS_connect: ::c_long = 283;
+pub const SYS_listen: ::c_long = 284;
+pub const SYS_accept: ::c_long = 285;
+pub const SYS_getsockname: ::c_long = 286;
+pub const SYS_getpeername: ::c_long = 287;
+pub const SYS_socketpair: ::c_long = 288;
+pub const SYS_send: ::c_long = 289;
+pub const SYS_sendto: ::c_long = 290;
+pub const SYS_recv: ::c_long = 291;
+pub const SYS_recvfrom: ::c_long = 292;
+pub const SYS_shutdown: ::c_long = 293;
+pub const SYS_setsockopt: ::c_long = 294;
+pub const SYS_getsockopt: ::c_long = 295;
+pub const SYS_sendmsg: ::c_long = 296;
+pub const SYS_recvmsg: ::c_long = 297;
+pub const SYS_semop: ::c_long = 298;
+pub const SYS_semget: ::c_long = 299;
+pub const SYS_semctl: ::c_long = 300;
+pub const SYS_msgsnd: ::c_long = 301;
+pub const SYS_msgrcv: ::c_long = 302;
+pub const SYS_msgget: ::c_long = 303;
+pub const SYS_msgctl: ::c_long = 304;
+pub const SYS_shmat: ::c_long = 305;
+pub const SYS_shmdt: ::c_long = 306;
+pub const SYS_shmget: ::c_long = 307;
+pub const SYS_shmctl: ::c_long = 308;
+pub const SYS_add_key: ::c_long = 309;
+pub const SYS_request_key: ::c_long = 310;
+pub const SYS_keyctl: ::c_long = 311;
+pub const SYS_semtimedop: ::c_long = 312;
+pub const SYS_vserver: ::c_long = 313;
+pub const SYS_ioprio_set: ::c_long = 314;
+pub const SYS_ioprio_get: ::c_long = 315;
+pub const SYS_inotify_init: ::c_long = 316;
+pub const SYS_inotify_add_watch: ::c_long = 317;
+pub const SYS_inotify_rm_watch: ::c_long = 318;
+pub const SYS_mbind: ::c_long = 319;
+pub const SYS_get_mempolicy: ::c_long = 320;
+pub const SYS_set_mempolicy: ::c_long = 321;
+pub const SYS_openat: ::c_long = 322;
+pub const SYS_mkdirat: ::c_long = 323;
+pub const SYS_mknodat: ::c_long = 324;
+pub const SYS_fchownat: ::c_long = 325;
+pub const SYS_futimesat: ::c_long = 326;
+pub const SYS_fstatat64: ::c_long = 327;
+pub const SYS_unlinkat: ::c_long = 328;
+pub const SYS_renameat: ::c_long = 329;
+pub const SYS_linkat: ::c_long = 330;
+pub const SYS_symlinkat: ::c_long = 331;
+pub const SYS_readlinkat: ::c_long = 332;
+pub const SYS_fchmodat: ::c_long = 333;
+pub const SYS_faccessat: ::c_long = 334;
+pub const SYS_pselect6: ::c_long = 335;
+pub const SYS_ppoll: ::c_long = 336;
+pub const SYS_unshare: ::c_long = 337;
+pub const SYS_set_robust_list: ::c_long = 338;
+pub const SYS_get_robust_list: ::c_long = 339;
+pub const SYS_splice: ::c_long = 340;
+pub const SYS_tee: ::c_long = 342;
+pub const SYS_vmsplice: ::c_long = 343;
+pub const SYS_move_pages: ::c_long = 344;
+pub const SYS_getcpu: ::c_long = 345;
+pub const SYS_epoll_pwait: ::c_long = 346;
+pub const SYS_kexec_load: ::c_long = 347;
+pub const SYS_utimensat: ::c_long = 348;
+pub const SYS_signalfd: ::c_long = 349;
+pub const SYS_timerfd_create: ::c_long = 350;
+pub const SYS_eventfd: ::c_long = 351;
+pub const SYS_fallocate: ::c_long = 352;
+pub const SYS_timerfd_settime: ::c_long = 353;
+pub const SYS_timerfd_gettime: ::c_long = 354;
+pub const SYS_signalfd4: ::c_long = 355;
+pub const SYS_eventfd2: ::c_long = 356;
+pub const SYS_epoll_create1: ::c_long = 357;
+pub const SYS_dup3: ::c_long = 358;
+pub const SYS_pipe2: ::c_long = 359;
+pub const SYS_inotify_init1: ::c_long = 360;
+pub const SYS_preadv: ::c_long = 361;
+pub const SYS_pwritev: ::c_long = 362;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 363;
+pub const SYS_perf_event_open: ::c_long = 364;
+pub const SYS_recvmmsg: ::c_long = 365;
+pub const SYS_accept4: ::c_long = 366;
+pub const SYS_fanotify_init: ::c_long = 367;
+pub const SYS_fanotify_mark: ::c_long = 368;
+pub const SYS_prlimit64: ::c_long = 369;
+pub const SYS_name_to_handle_at: ::c_long = 370;
+pub const SYS_open_by_handle_at: ::c_long = 371;
+pub const SYS_clock_adjtime: ::c_long = 372;
+pub const SYS_syncfs: ::c_long = 373;
+pub const SYS_sendmmsg: ::c_long = 374;
+pub const SYS_setns: ::c_long = 375;
+pub const SYS_process_vm_readv: ::c_long = 376;
+pub const SYS_process_vm_writev: ::c_long = 377;
+pub const SYS_kcmp: ::c_long = 378;
+pub const SYS_finit_module: ::c_long = 379;
+pub const SYS_sched_setattr: ::c_long = 380;
+pub const SYS_sched_getattr: ::c_long = 381;
+pub const SYS_renameat2: ::c_long = 382;
+pub const SYS_seccomp: ::c_long = 383;
+pub const SYS_getrandom: ::c_long = 384;
+pub const SYS_memfd_create: ::c_long = 385;
+pub const SYS_bpf: ::c_long = 386;
+pub const SYS_execveat: ::c_long = 387;
+pub const SYS_userfaultfd: ::c_long = 388;
+pub const SYS_membarrier: ::c_long = 389;
+pub const SYS_mlock2: ::c_long = 390;
+pub const SYS_copy_file_range: ::c_long = 391;
+pub const SYS_preadv2: ::c_long = 392;
+pub const SYS_pwritev2: ::c_long = 393;
+pub const SYS_pkey_mprotect: ::c_long = 394;
+pub const SYS_pkey_alloc: ::c_long = 395;
+pub const SYS_pkey_free: ::c_long = 396;
+// FIXME: should be a `c_long` too, but a bug slipped in.
+pub const SYS_statx: ::c_int = 397;
+pub const SYS_pidfd_send_signal: ::c_long = 424;
+pub const SYS_io_uring_setup: ::c_long = 425;
+pub const SYS_io_uring_enter: ::c_long = 426;
+pub const SYS_io_uring_register: ::c_long = 427;
+pub const SYS_open_tree: ::c_long = 428;
+pub const SYS_move_mount: ::c_long = 429;
+pub const SYS_fsopen: ::c_long = 430;
+pub const SYS_fsconfig: ::c_long = 431;
+pub const SYS_fsmount: ::c_long = 432;
+pub const SYS_fspick: ::c_long = 433;
+pub const SYS_pidfd_open: ::c_long = 434;
+pub const SYS_clone3: ::c_long = 435;
+pub const SYS_close_range: ::c_long = 436;
+pub const SYS_openat2: ::c_long = 437;
+pub const SYS_pidfd_getfd: ::c_long = 438;
+pub const SYS_faccessat2: ::c_long = 439;
+pub const SYS_process_madvise: ::c_long = 440;
+pub const SYS_epoll_pwait2: ::c_long = 441;
+pub const SYS_mount_setattr: ::c_long = 442;
+pub const SYS_quotactl_fd: ::c_long = 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 444;
+pub const SYS_landlock_add_rule: ::c_long = 445;
+pub const SYS_landlock_restrict_self: ::c_long = 446;
+pub const SYS_memfd_secret: ::c_long = 447;
+pub const SYS_process_mrelease: ::c_long = 448;
+pub const SYS_futex_waitv: ::c_long = 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 450;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    } else {
+        mod no_align;
+        pub use self::no_align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/arm/no_align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/arm/no_align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/arm/no_align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/arm/no_align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,10 @@
+s! {
+    // FIXME this is actually a union
+    pub struct sem_t {
+        #[cfg(target_pointer_width = "32")]
+        __size: [::c_char; 16],
+        #[cfg(target_pointer_width = "64")]
+        __size: [::c_char; 32],
+        __align: [::c_long; 0],
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,13 @@
+s! {
+    // FIXME this is actually a union
+    #[cfg_attr(target_pointer_width = "32",
+               repr(align(4)))]
+    #[cfg_attr(target_pointer_width = "64",
+               repr(align(8)))]
+    pub struct sem_t {
+        #[cfg(target_pointer_width = "32")]
+        __size: [::c_char; 16],
+        #[cfg(target_pointer_width = "64")]
+        __size: [::c_char; 32],
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,692 @@
+pub type c_char = i8;
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type clock_t = i32;
+pub type time_t = i32;
+pub type suseconds_t = i32;
+pub type wchar_t = i32;
+pub type off_t = i32;
+pub type ino_t = u32;
+pub type blkcnt_t = i32;
+pub type blksize_t = i32;
+pub type nlink_t = u32;
+pub type fsblkcnt_t = ::c_ulong;
+pub type fsfilcnt_t = ::c_ulong;
+pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
+pub type fsblkcnt64_t = u64;
+pub type fsfilcnt64_t = u64;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        st_pad1: [::c_long; 2],
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_pad2: [::c_long; 1],
+        pub st_size: ::off_t,
+        st_pad3: ::c_long,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        st_pad5: [::c_long; 14],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        st_pad1: [::c_long; 2],
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        st_pad2: [::c_long; 2],
+        pub st_size: ::off64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_blksize: ::blksize_t,
+        st_pad3: ::c_long,
+        pub st_blocks: ::blkcnt64_t,
+        st_pad5: [::c_long; 14],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt64_t,
+        pub f_bfree: ::fsblkcnt64_t,
+        pub f_bavail: ::fsblkcnt64_t,
+        pub f_files: ::fsfilcnt64_t,
+        pub f_ffree: ::fsfilcnt64_t,
+        pub f_favail: ::fsfilcnt64_t,
+        pub f_fsid: ::c_ulong,
+        pub __f_unused: ::c_int,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        pub __f_spare: [::c_int; 6],
+    }
+
+    pub struct pthread_attr_t {
+        __size: [u32; 9]
+    }
+
+    pub struct sigaction {
+        pub sa_flags: ::c_uint,
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: sigset_t,
+        _restorer: *mut ::c_void,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_size: ::size_t,
+        pub ss_flags: ::c_int,
+    }
+
+    pub struct sigset_t {
+        __val: [::c_ulong; 4],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_code: ::c_int,
+        pub si_errno: ::c_int,
+        pub _pad: [::c_int; 29],
+    }
+
+    pub struct glob64_t {
+        pub gl_pathc: ::size_t,
+        pub gl_pathv: *mut *mut ::c_char,
+        pub gl_offs: ::size_t,
+        pub gl_flags: ::c_int,
+
+        __unused1: *mut ::c_void,
+        __unused2: *mut ::c_void,
+        __unused3: *mut ::c_void,
+        __unused4: *mut ::c_void,
+        __unused5: *mut ::c_void,
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::c_uint,
+        pub __seq: ::c_ushort,
+        __pad1: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        #[cfg(target_endian = "big")]
+        __glibc_reserved1: ::c_ulong,
+        pub msg_stime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __glibc_reserved1: ::c_ulong,
+        #[cfg(target_endian = "big")]
+        __glibc_reserved2: ::c_ulong,
+        pub msg_rtime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __glibc_reserved2: ::c_ulong,
+        #[cfg(target_endian = "big")]
+        __glibc_reserved3: ::c_ulong,
+        pub msg_ctime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __glibc_reserved3: ::c_ulong,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved4: ::c_ulong,
+        __glibc_reserved5: ::c_ulong,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        pub f_frsize: ::c_long,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_files: ::fsblkcnt_t,
+        pub f_ffree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_fsid: ::fsid_t,
+
+        pub f_namelen: ::c_long,
+        f_spare: [::c_long; 6],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        pub f_frsize: ::c_long,
+        pub f_blocks: ::fsblkcnt64_t,
+        pub f_bfree: ::fsblkcnt64_t,
+        pub f_files: ::fsblkcnt64_t,
+        pub f_ffree: ::fsblkcnt64_t,
+        pub f_bavail: ::fsblkcnt64_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_long,
+        pub f_flags: ::c_long,
+        pub f_spare: [::c_long; 5],
+    }
+
+    pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: ::socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::c_int,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: ::size_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct cmsghdr {
+        pub cmsg_len: ::size_t,
+        pub cmsg_level: ::c_int,
+        pub cmsg_type: ::c_int,
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::NCCS],
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_sysid: ::c_long,
+        pub l_pid: ::pid_t,
+        pad: [::c_long; 4],
+    }
+
+    pub struct sysinfo {
+        pub uptime: ::c_long,
+        pub loads: [::c_ulong; 3],
+        pub totalram: ::c_ulong,
+        pub freeram: ::c_ulong,
+        pub sharedram: ::c_ulong,
+        pub bufferram: ::c_ulong,
+        pub totalswap: ::c_ulong,
+        pub freeswap: ::c_ulong,
+        pub procs: ::c_ushort,
+        pub pad: ::c_ushort,
+        pub totalhigh: ::c_ulong,
+        pub freehigh: ::c_ulong,
+        pub mem_unit: ::c_uint,
+        pub _f: [::c_char; 8],
+    }
+}
+
+pub const __SIZEOF_PTHREAD_ATTR_T: usize = 36;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32;
+pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
+
+pub const SYS_syscall: ::c_long = 4000 + 0;
+pub const SYS_exit: ::c_long = 4000 + 1;
+pub const SYS_fork: ::c_long = 4000 + 2;
+pub const SYS_read: ::c_long = 4000 + 3;
+pub const SYS_write: ::c_long = 4000 + 4;
+pub const SYS_open: ::c_long = 4000 + 5;
+pub const SYS_close: ::c_long = 4000 + 6;
+pub const SYS_waitpid: ::c_long = 4000 + 7;
+pub const SYS_creat: ::c_long = 4000 + 8;
+pub const SYS_link: ::c_long = 4000 + 9;
+pub const SYS_unlink: ::c_long = 4000 + 10;
+pub const SYS_execve: ::c_long = 4000 + 11;
+pub const SYS_chdir: ::c_long = 4000 + 12;
+pub const SYS_time: ::c_long = 4000 + 13;
+pub const SYS_mknod: ::c_long = 4000 + 14;
+pub const SYS_chmod: ::c_long = 4000 + 15;
+pub const SYS_lchown: ::c_long = 4000 + 16;
+pub const SYS_break: ::c_long = 4000 + 17;
+pub const SYS_lseek: ::c_long = 4000 + 19;
+pub const SYS_getpid: ::c_long = 4000 + 20;
+pub const SYS_mount: ::c_long = 4000 + 21;
+pub const SYS_umount: ::c_long = 4000 + 22;
+pub const SYS_setuid: ::c_long = 4000 + 23;
+pub const SYS_getuid: ::c_long = 4000 + 24;
+pub const SYS_stime: ::c_long = 4000 + 25;
+pub const SYS_ptrace: ::c_long = 4000 + 26;
+pub const SYS_alarm: ::c_long = 4000 + 27;
+pub const SYS_pause: ::c_long = 4000 + 29;
+pub const SYS_utime: ::c_long = 4000 + 30;
+pub const SYS_stty: ::c_long = 4000 + 31;
+pub const SYS_gtty: ::c_long = 4000 + 32;
+pub const SYS_access: ::c_long = 4000 + 33;
+pub const SYS_nice: ::c_long = 4000 + 34;
+pub const SYS_ftime: ::c_long = 4000 + 35;
+pub const SYS_sync: ::c_long = 4000 + 36;
+pub const SYS_kill: ::c_long = 4000 + 37;
+pub const SYS_rename: ::c_long = 4000 + 38;
+pub const SYS_mkdir: ::c_long = 4000 + 39;
+pub const SYS_rmdir: ::c_long = 4000 + 40;
+pub const SYS_dup: ::c_long = 4000 + 41;
+pub const SYS_pipe: ::c_long = 4000 + 42;
+pub const SYS_times: ::c_long = 4000 + 43;
+pub const SYS_prof: ::c_long = 4000 + 44;
+pub const SYS_brk: ::c_long = 4000 + 45;
+pub const SYS_setgid: ::c_long = 4000 + 46;
+pub const SYS_getgid: ::c_long = 4000 + 47;
+pub const SYS_signal: ::c_long = 4000 + 48;
+pub const SYS_geteuid: ::c_long = 4000 + 49;
+pub const SYS_getegid: ::c_long = 4000 + 50;
+pub const SYS_acct: ::c_long = 4000 + 51;
+pub const SYS_umount2: ::c_long = 4000 + 52;
+pub const SYS_lock: ::c_long = 4000 + 53;
+pub const SYS_ioctl: ::c_long = 4000 + 54;
+pub const SYS_fcntl: ::c_long = 4000 + 55;
+pub const SYS_mpx: ::c_long = 4000 + 56;
+pub const SYS_setpgid: ::c_long = 4000 + 57;
+pub const SYS_ulimit: ::c_long = 4000 + 58;
+pub const SYS_umask: ::c_long = 4000 + 60;
+pub const SYS_chroot: ::c_long = 4000 + 61;
+pub const SYS_ustat: ::c_long = 4000 + 62;
+pub const SYS_dup2: ::c_long = 4000 + 63;
+pub const SYS_getppid: ::c_long = 4000 + 64;
+pub const SYS_getpgrp: ::c_long = 4000 + 65;
+pub const SYS_setsid: ::c_long = 4000 + 66;
+pub const SYS_sigaction: ::c_long = 4000 + 67;
+pub const SYS_sgetmask: ::c_long = 4000 + 68;
+pub const SYS_ssetmask: ::c_long = 4000 + 69;
+pub const SYS_setreuid: ::c_long = 4000 + 70;
+pub const SYS_setregid: ::c_long = 4000 + 71;
+pub const SYS_sigsuspend: ::c_long = 4000 + 72;
+pub const SYS_sigpending: ::c_long = 4000 + 73;
+pub const SYS_sethostname: ::c_long = 4000 + 74;
+pub const SYS_setrlimit: ::c_long = 4000 + 75;
+pub const SYS_getrlimit: ::c_long = 4000 + 76;
+pub const SYS_getrusage: ::c_long = 4000 + 77;
+pub const SYS_gettimeofday: ::c_long = 4000 + 78;
+pub const SYS_settimeofday: ::c_long = 4000 + 79;
+pub const SYS_getgroups: ::c_long = 4000 + 80;
+pub const SYS_setgroups: ::c_long = 4000 + 81;
+pub const SYS_symlink: ::c_long = 4000 + 83;
+pub const SYS_readlink: ::c_long = 4000 + 85;
+pub const SYS_uselib: ::c_long = 4000 + 86;
+pub const SYS_swapon: ::c_long = 4000 + 87;
+pub const SYS_reboot: ::c_long = 4000 + 88;
+pub const SYS_readdir: ::c_long = 4000 + 89;
+pub const SYS_mmap: ::c_long = 4000 + 90;
+pub const SYS_munmap: ::c_long = 4000 + 91;
+pub const SYS_truncate: ::c_long = 4000 + 92;
+pub const SYS_ftruncate: ::c_long = 4000 + 93;
+pub const SYS_fchmod: ::c_long = 4000 + 94;
+pub const SYS_fchown: ::c_long = 4000 + 95;
+pub const SYS_getpriority: ::c_long = 4000 + 96;
+pub const SYS_setpriority: ::c_long = 4000 + 97;
+pub const SYS_profil: ::c_long = 4000 + 98;
+pub const SYS_statfs: ::c_long = 4000 + 99;
+pub const SYS_fstatfs: ::c_long = 4000 + 100;
+pub const SYS_ioperm: ::c_long = 4000 + 101;
+pub const SYS_socketcall: ::c_long = 4000 + 102;
+pub const SYS_syslog: ::c_long = 4000 + 103;
+pub const SYS_setitimer: ::c_long = 4000 + 104;
+pub const SYS_getitimer: ::c_long = 4000 + 105;
+pub const SYS_stat: ::c_long = 4000 + 106;
+pub const SYS_lstat: ::c_long = 4000 + 107;
+pub const SYS_fstat: ::c_long = 4000 + 108;
+pub const SYS_iopl: ::c_long = 4000 + 110;
+pub const SYS_vhangup: ::c_long = 4000 + 111;
+pub const SYS_idle: ::c_long = 4000 + 112;
+pub const SYS_vm86: ::c_long = 4000 + 113;
+pub const SYS_wait4: ::c_long = 4000 + 114;
+pub const SYS_swapoff: ::c_long = 4000 + 115;
+pub const SYS_sysinfo: ::c_long = 4000 + 116;
+pub const SYS_ipc: ::c_long = 4000 + 117;
+pub const SYS_fsync: ::c_long = 4000 + 118;
+pub const SYS_sigreturn: ::c_long = 4000 + 119;
+pub const SYS_clone: ::c_long = 4000 + 120;
+pub const SYS_setdomainname: ::c_long = 4000 + 121;
+pub const SYS_uname: ::c_long = 4000 + 122;
+pub const SYS_modify_ldt: ::c_long = 4000 + 123;
+pub const SYS_adjtimex: ::c_long = 4000 + 124;
+pub const SYS_mprotect: ::c_long = 4000 + 125;
+pub const SYS_sigprocmask: ::c_long = 4000 + 126;
+pub const SYS_create_module: ::c_long = 4000 + 127;
+pub const SYS_init_module: ::c_long = 4000 + 128;
+pub const SYS_delete_module: ::c_long = 4000 + 129;
+pub const SYS_get_kernel_syms: ::c_long = 4000 + 130;
+pub const SYS_quotactl: ::c_long = 4000 + 131;
+pub const SYS_getpgid: ::c_long = 4000 + 132;
+pub const SYS_fchdir: ::c_long = 4000 + 133;
+pub const SYS_bdflush: ::c_long = 4000 + 134;
+pub const SYS_sysfs: ::c_long = 4000 + 135;
+pub const SYS_personality: ::c_long = 4000 + 136;
+pub const SYS_afs_syscall: ::c_long = 4000 + 137;
+pub const SYS_setfsuid: ::c_long = 4000 + 138;
+pub const SYS_setfsgid: ::c_long = 4000 + 139;
+pub const SYS__llseek: ::c_long = 4000 + 140;
+pub const SYS_getdents: ::c_long = 4000 + 141;
+pub const SYS__newselect: ::c_long = 4000 + 142;
+pub const SYS_flock: ::c_long = 4000 + 143;
+pub const SYS_msync: ::c_long = 4000 + 144;
+pub const SYS_readv: ::c_long = 4000 + 145;
+pub const SYS_writev: ::c_long = 4000 + 146;
+pub const SYS_cacheflush: ::c_long = 4000 + 147;
+pub const SYS_cachectl: ::c_long = 4000 + 148;
+pub const SYS_sysmips: ::c_long = 4000 + 149;
+pub const SYS_getsid: ::c_long = 4000 + 151;
+pub const SYS_fdatasync: ::c_long = 4000 + 152;
+pub const SYS__sysctl: ::c_long = 4000 + 153;
+pub const SYS_mlock: ::c_long = 4000 + 154;
+pub const SYS_munlock: ::c_long = 4000 + 155;
+pub const SYS_mlockall: ::c_long = 4000 + 156;
+pub const SYS_munlockall: ::c_long = 4000 + 157;
+pub const SYS_sched_setparam: ::c_long = 4000 + 158;
+pub const SYS_sched_getparam: ::c_long = 4000 + 159;
+pub const SYS_sched_setscheduler: ::c_long = 4000 + 160;
+pub const SYS_sched_getscheduler: ::c_long = 4000 + 161;
+pub const SYS_sched_yield: ::c_long = 4000 + 162;
+pub const SYS_sched_get_priority_max: ::c_long = 4000 + 163;
+pub const SYS_sched_get_priority_min: ::c_long = 4000 + 164;
+pub const SYS_sched_rr_get_interval: ::c_long = 4000 + 165;
+pub const SYS_nanosleep: ::c_long = 4000 + 166;
+pub const SYS_mremap: ::c_long = 4000 + 167;
+pub const SYS_accept: ::c_long = 4000 + 168;
+pub const SYS_bind: ::c_long = 4000 + 169;
+pub const SYS_connect: ::c_long = 4000 + 170;
+pub const SYS_getpeername: ::c_long = 4000 + 171;
+pub const SYS_getsockname: ::c_long = 4000 + 172;
+pub const SYS_getsockopt: ::c_long = 4000 + 173;
+pub const SYS_listen: ::c_long = 4000 + 174;
+pub const SYS_recv: ::c_long = 4000 + 175;
+pub const SYS_recvfrom: ::c_long = 4000 + 176;
+pub const SYS_recvmsg: ::c_long = 4000 + 177;
+pub const SYS_send: ::c_long = 4000 + 178;
+pub const SYS_sendmsg: ::c_long = 4000 + 179;
+pub const SYS_sendto: ::c_long = 4000 + 180;
+pub const SYS_setsockopt: ::c_long = 4000 + 181;
+pub const SYS_shutdown: ::c_long = 4000 + 182;
+pub const SYS_socket: ::c_long = 4000 + 183;
+pub const SYS_socketpair: ::c_long = 4000 + 184;
+pub const SYS_setresuid: ::c_long = 4000 + 185;
+pub const SYS_getresuid: ::c_long = 4000 + 186;
+pub const SYS_query_module: ::c_long = 4000 + 187;
+pub const SYS_poll: ::c_long = 4000 + 188;
+pub const SYS_nfsservctl: ::c_long = 4000 + 189;
+pub const SYS_setresgid: ::c_long = 4000 + 190;
+pub const SYS_getresgid: ::c_long = 4000 + 191;
+pub const SYS_prctl: ::c_long = 4000 + 192;
+pub const SYS_rt_sigreturn: ::c_long = 4000 + 193;
+pub const SYS_rt_sigaction: ::c_long = 4000 + 194;
+pub const SYS_rt_sigprocmask: ::c_long = 4000 + 195;
+pub const SYS_rt_sigpending: ::c_long = 4000 + 196;
+pub const SYS_rt_sigtimedwait: ::c_long = 4000 + 197;
+pub const SYS_rt_sigqueueinfo: ::c_long = 4000 + 198;
+pub const SYS_rt_sigsuspend: ::c_long = 4000 + 199;
+pub const SYS_pread64: ::c_long = 4000 + 200;
+pub const SYS_pwrite64: ::c_long = 4000 + 201;
+pub const SYS_chown: ::c_long = 4000 + 202;
+pub const SYS_getcwd: ::c_long = 4000 + 203;
+pub const SYS_capget: ::c_long = 4000 + 204;
+pub const SYS_capset: ::c_long = 4000 + 205;
+pub const SYS_sigaltstack: ::c_long = 4000 + 206;
+pub const SYS_sendfile: ::c_long = 4000 + 207;
+pub const SYS_getpmsg: ::c_long = 4000 + 208;
+pub const SYS_putpmsg: ::c_long = 4000 + 209;
+pub const SYS_mmap2: ::c_long = 4000 + 210;
+pub const SYS_truncate64: ::c_long = 4000 + 211;
+pub const SYS_ftruncate64: ::c_long = 4000 + 212;
+pub const SYS_stat64: ::c_long = 4000 + 213;
+pub const SYS_lstat64: ::c_long = 4000 + 214;
+pub const SYS_fstat64: ::c_long = 4000 + 215;
+pub const SYS_pivot_root: ::c_long = 4000 + 216;
+pub const SYS_mincore: ::c_long = 4000 + 217;
+pub const SYS_madvise: ::c_long = 4000 + 218;
+pub const SYS_getdents64: ::c_long = 4000 + 219;
+pub const SYS_fcntl64: ::c_long = 4000 + 220;
+pub const SYS_gettid: ::c_long = 4000 + 222;
+pub const SYS_readahead: ::c_long = 4000 + 223;
+pub const SYS_setxattr: ::c_long = 4000 + 224;
+pub const SYS_lsetxattr: ::c_long = 4000 + 225;
+pub const SYS_fsetxattr: ::c_long = 4000 + 226;
+pub const SYS_getxattr: ::c_long = 4000 + 227;
+pub const SYS_lgetxattr: ::c_long = 4000 + 228;
+pub const SYS_fgetxattr: ::c_long = 4000 + 229;
+pub const SYS_listxattr: ::c_long = 4000 + 230;
+pub const SYS_llistxattr: ::c_long = 4000 + 231;
+pub const SYS_flistxattr: ::c_long = 4000 + 232;
+pub const SYS_removexattr: ::c_long = 4000 + 233;
+pub const SYS_lremovexattr: ::c_long = 4000 + 234;
+pub const SYS_fremovexattr: ::c_long = 4000 + 235;
+pub const SYS_tkill: ::c_long = 4000 + 236;
+pub const SYS_sendfile64: ::c_long = 4000 + 237;
+pub const SYS_futex: ::c_long = 4000 + 238;
+pub const SYS_sched_setaffinity: ::c_long = 4000 + 239;
+pub const SYS_sched_getaffinity: ::c_long = 4000 + 240;
+pub const SYS_io_setup: ::c_long = 4000 + 241;
+pub const SYS_io_destroy: ::c_long = 4000 + 242;
+pub const SYS_io_getevents: ::c_long = 4000 + 243;
+pub const SYS_io_submit: ::c_long = 4000 + 244;
+pub const SYS_io_cancel: ::c_long = 4000 + 245;
+pub const SYS_exit_group: ::c_long = 4000 + 246;
+pub const SYS_lookup_dcookie: ::c_long = 4000 + 247;
+pub const SYS_epoll_create: ::c_long = 4000 + 248;
+pub const SYS_epoll_ctl: ::c_long = 4000 + 249;
+pub const SYS_epoll_wait: ::c_long = 4000 + 250;
+pub const SYS_remap_file_pages: ::c_long = 4000 + 251;
+pub const SYS_set_tid_address: ::c_long = 4000 + 252;
+pub const SYS_restart_syscall: ::c_long = 4000 + 253;
+pub const SYS_fadvise64: ::c_long = 4000 + 254;
+pub const SYS_statfs64: ::c_long = 4000 + 255;
+pub const SYS_fstatfs64: ::c_long = 4000 + 256;
+pub const SYS_timer_create: ::c_long = 4000 + 257;
+pub const SYS_timer_settime: ::c_long = 4000 + 258;
+pub const SYS_timer_gettime: ::c_long = 4000 + 259;
+pub const SYS_timer_getoverrun: ::c_long = 4000 + 260;
+pub const SYS_timer_delete: ::c_long = 4000 + 261;
+pub const SYS_clock_settime: ::c_long = 4000 + 262;
+pub const SYS_clock_gettime: ::c_long = 4000 + 263;
+pub const SYS_clock_getres: ::c_long = 4000 + 264;
+pub const SYS_clock_nanosleep: ::c_long = 4000 + 265;
+pub const SYS_tgkill: ::c_long = 4000 + 266;
+pub const SYS_utimes: ::c_long = 4000 + 267;
+pub const SYS_mbind: ::c_long = 4000 + 268;
+pub const SYS_get_mempolicy: ::c_long = 4000 + 269;
+pub const SYS_set_mempolicy: ::c_long = 4000 + 270;
+pub const SYS_mq_open: ::c_long = 4000 + 271;
+pub const SYS_mq_unlink: ::c_long = 4000 + 272;
+pub const SYS_mq_timedsend: ::c_long = 4000 + 273;
+pub const SYS_mq_timedreceive: ::c_long = 4000 + 274;
+pub const SYS_mq_notify: ::c_long = 4000 + 275;
+pub const SYS_mq_getsetattr: ::c_long = 4000 + 276;
+pub const SYS_vserver: ::c_long = 4000 + 277;
+pub const SYS_waitid: ::c_long = 4000 + 278;
+/* pub const SYS_sys_setaltroot: ::c_long = 4000 + 279; */
+pub const SYS_add_key: ::c_long = 4000 + 280;
+pub const SYS_request_key: ::c_long = 4000 + 281;
+pub const SYS_keyctl: ::c_long = 4000 + 282;
+pub const SYS_set_thread_area: ::c_long = 4000 + 283;
+pub const SYS_inotify_init: ::c_long = 4000 + 284;
+pub const SYS_inotify_add_watch: ::c_long = 4000 + 285;
+pub const SYS_inotify_rm_watch: ::c_long = 4000 + 286;
+pub const SYS_migrate_pages: ::c_long = 4000 + 287;
+pub const SYS_openat: ::c_long = 4000 + 288;
+pub const SYS_mkdirat: ::c_long = 4000 + 289;
+pub const SYS_mknodat: ::c_long = 4000 + 290;
+pub const SYS_fchownat: ::c_long = 4000 + 291;
+pub const SYS_futimesat: ::c_long = 4000 + 292;
+pub const SYS_fstatat64: ::c_long = 4000 + 293;
+pub const SYS_unlinkat: ::c_long = 4000 + 294;
+pub const SYS_renameat: ::c_long = 4000 + 295;
+pub const SYS_linkat: ::c_long = 4000 + 296;
+pub const SYS_symlinkat: ::c_long = 4000 + 297;
+pub const SYS_readlinkat: ::c_long = 4000 + 298;
+pub const SYS_fchmodat: ::c_long = 4000 + 299;
+pub const SYS_faccessat: ::c_long = 4000 + 300;
+pub const SYS_pselect6: ::c_long = 4000 + 301;
+pub const SYS_ppoll: ::c_long = 4000 + 302;
+pub const SYS_unshare: ::c_long = 4000 + 303;
+pub const SYS_splice: ::c_long = 4000 + 304;
+pub const SYS_sync_file_range: ::c_long = 4000 + 305;
+pub const SYS_tee: ::c_long = 4000 + 306;
+pub const SYS_vmsplice: ::c_long = 4000 + 307;
+pub const SYS_move_pages: ::c_long = 4000 + 308;
+pub const SYS_set_robust_list: ::c_long = 4000 + 309;
+pub const SYS_get_robust_list: ::c_long = 4000 + 310;
+pub const SYS_kexec_load: ::c_long = 4000 + 311;
+pub const SYS_getcpu: ::c_long = 4000 + 312;
+pub const SYS_epoll_pwait: ::c_long = 4000 + 313;
+pub const SYS_ioprio_set: ::c_long = 4000 + 314;
+pub const SYS_ioprio_get: ::c_long = 4000 + 315;
+pub const SYS_utimensat: ::c_long = 4000 + 316;
+pub const SYS_signalfd: ::c_long = 4000 + 317;
+pub const SYS_timerfd: ::c_long = 4000 + 318;
+pub const SYS_eventfd: ::c_long = 4000 + 319;
+pub const SYS_fallocate: ::c_long = 4000 + 320;
+pub const SYS_timerfd_create: ::c_long = 4000 + 321;
+pub const SYS_timerfd_gettime: ::c_long = 4000 + 322;
+pub const SYS_timerfd_settime: ::c_long = 4000 + 323;
+pub const SYS_signalfd4: ::c_long = 4000 + 324;
+pub const SYS_eventfd2: ::c_long = 4000 + 325;
+pub const SYS_epoll_create1: ::c_long = 4000 + 326;
+pub const SYS_dup3: ::c_long = 4000 + 327;
+pub const SYS_pipe2: ::c_long = 4000 + 328;
+pub const SYS_inotify_init1: ::c_long = 4000 + 329;
+pub const SYS_preadv: ::c_long = 4000 + 330;
+pub const SYS_pwritev: ::c_long = 4000 + 331;
+pub const SYS_rt_tgsigqueueinfo: ::c_long = 4000 + 332;
+pub const SYS_perf_event_open: ::c_long = 4000 + 333;
+pub const SYS_accept4: ::c_long = 4000 + 334;
+pub const SYS_recvmmsg: ::c_long = 4000 + 335;
+pub const SYS_fanotify_init: ::c_long = 4000 + 336;
+pub const SYS_fanotify_mark: ::c_long = 4000 + 337;
+pub const SYS_prlimit64: ::c_long = 4000 + 338;
+pub const SYS_name_to_handle_at: ::c_long = 4000 + 339;
+pub const SYS_open_by_handle_at: ::c_long = 4000 + 340;
+pub const SYS_clock_adjtime: ::c_long = 4000 + 341;
+pub const SYS_syncfs: ::c_long = 4000 + 342;
+pub const SYS_sendmmsg: ::c_long = 4000 + 343;
+pub const SYS_setns: ::c_long = 4000 + 344;
+pub const SYS_process_vm_readv: ::c_long = 4000 + 345;
+pub const SYS_process_vm_writev: ::c_long = 4000 + 346;
+pub const SYS_kcmp: ::c_long = 4000 + 347;
+pub const SYS_finit_module: ::c_long = 4000 + 348;
+pub const SYS_sched_setattr: ::c_long = 4000 + 349;
+pub const SYS_sched_getattr: ::c_long = 4000 + 350;
+pub const SYS_renameat2: ::c_long = 4000 + 351;
+pub const SYS_seccomp: ::c_long = 4000 + 352;
+pub const SYS_getrandom: ::c_long = 4000 + 353;
+pub const SYS_memfd_create: ::c_long = 4000 + 354;
+pub const SYS_bpf: ::c_long = 4000 + 355;
+pub const SYS_execveat: ::c_long = 4000 + 356;
+pub const SYS_userfaultfd: ::c_long = 4000 + 357;
+pub const SYS_membarrier: ::c_long = 4000 + 358;
+pub const SYS_mlock2: ::c_long = 4000 + 359;
+pub const SYS_copy_file_range: ::c_long = 4000 + 360;
+pub const SYS_preadv2: ::c_long = 4000 + 361;
+pub const SYS_pwritev2: ::c_long = 4000 + 362;
+pub const SYS_pkey_mprotect: ::c_long = 4000 + 363;
+pub const SYS_pkey_alloc: ::c_long = 4000 + 364;
+pub const SYS_pkey_free: ::c_long = 4000 + 365;
+pub const SYS_statx: ::c_long = 4000 + 366;
+pub const SYS_pidfd_send_signal: ::c_long = 4000 + 424;
+pub const SYS_io_uring_setup: ::c_long = 4000 + 425;
+pub const SYS_io_uring_enter: ::c_long = 4000 + 426;
+pub const SYS_io_uring_register: ::c_long = 4000 + 427;
+pub const SYS_open_tree: ::c_long = 4000 + 428;
+pub const SYS_move_mount: ::c_long = 4000 + 429;
+pub const SYS_fsopen: ::c_long = 4000 + 430;
+pub const SYS_fsconfig: ::c_long = 4000 + 431;
+pub const SYS_fsmount: ::c_long = 4000 + 432;
+pub const SYS_fspick: ::c_long = 4000 + 433;
+pub const SYS_pidfd_open: ::c_long = 4000 + 434;
+pub const SYS_clone3: ::c_long = 4000 + 435;
+pub const SYS_close_range: ::c_long = 4000 + 436;
+pub const SYS_openat2: ::c_long = 4000 + 437;
+pub const SYS_pidfd_getfd: ::c_long = 4000 + 438;
+pub const SYS_faccessat2: ::c_long = 4000 + 439;
+pub const SYS_process_madvise: ::c_long = 4000 + 440;
+pub const SYS_epoll_pwait2: ::c_long = 4000 + 441;
+pub const SYS_mount_setattr: ::c_long = 4000 + 442;
+pub const SYS_quotactl_fd: ::c_long = 4000 + 443;
+pub const SYS_landlock_create_ruleset: ::c_long = 4000 + 444;
+pub const SYS_landlock_add_rule: ::c_long = 4000 + 445;
+pub const SYS_landlock_restrict_self: ::c_long = 4000 + 446;
+pub const SYS_memfd_secret: ::c_long = 4000 + 447;
+pub const SYS_process_mrelease: ::c_long = 4000 + 448;
+pub const SYS_futex_waitv: ::c_long = 4000 + 449;
+pub const SYS_set_mempolicy_home_node: ::c_long = 4000 + 450;
+
+#[link(name = "util")]
+extern "C" {
+    pub fn sysctl(
+        name: *mut ::c_int,
+        namelen: ::c_int,
+        oldp: *mut ::c_void,
+        oldlenp: *mut ::size_t,
+        newp: *mut ::c_void,
+        newlen: ::size_t,
+    ) -> ::c_int;
+    pub fn glob64(
+        pattern: *const ::c_char,
+        flags: ::c_int,
+        errfunc: ::Option<extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut glob64_t,
+    ) -> ::c_int;
+    pub fn globfree64(pglob: *mut glob64_t);
+    pub fn pthread_attr_getaffinity_np(
+        attr: *const ::pthread_attr_t,
+        cpusetsize: ::size_t,
+        cpuset: *mut ::cpu_set_t,
+    ) -> ::c_int;
+    pub fn pthread_attr_setaffinity_np(
+        attr: *mut ::pthread_attr_t,
+        cpusetsize: ::size_t,
+        cpuset: *const ::cpu_set_t,
+    ) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    } else {
+        mod no_align;
+        pub use self::no_align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,10 @@
+s! {
+    // FIXME this is actually a union
+    pub struct sem_t {
+        #[cfg(target_pointer_width = "32")]
+        __size: [::c_char; 16],
+        #[cfg(target_pointer_width = "64")]
+        __size: [::c_char; 32],
+        __align: [::c_long; 0],
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,10 @@
+s! {
+    // FIXME this is actually a union
+    #[cfg_attr(target_pointer_width = "32",
+               repr(align(4)))]
+    #[cfg_attr(target_pointer_width = "64",
+               repr(align(8)))]
+    pub struct sem_t {
+        __size: [::c_char; 32],
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,207 @@
+pub type blkcnt_t = i64;
+pub type blksize_t = i64;
+pub type c_char = i8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type fsblkcnt_t = ::c_ulong;
+pub type fsfilcnt_t = ::c_ulong;
+pub type ino_t = u64;
+pub type nlink_t = u64;
+pub type off_t = i64;
+pub type suseconds_t = i64;
+pub type time_t = i64;
+pub type wchar_t = i32;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::c_ulong,
+        st_pad1: [::c_long; 2],
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulong,
+        st_pad2: [::c_ulong; 1],
+        pub st_size: ::off_t,
+        st_pad3: ::c_long,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_blksize: ::blksize_t,
+        st_pad4: ::c_long,
+        pub st_blocks: ::blkcnt_t,
+        st_pad5: [::c_long; 7],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::c_ulong,
+        st_pad1: [::c_long; 2],
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulong,
+        st_pad2: [::c_long; 2],
+        pub st_size: ::off64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_blksize: ::blksize_t,
+        st_pad3: ::c_long,
+        pub st_blocks: ::blkcnt64_t,
+        st_pad5: [::c_long; 7],
+    }
+
+    pub struct pthread_attr_t {
+        __size: [::c_ulong; 7]
+    }
+
+    pub struct sigaction {
+        pub sa_flags: ::c_int,
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: sigset_t,
+        _restorer: *mut ::c_void,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_size: ::size_t,
+        pub ss_flags: ::c_int,
+    }
+
+    pub struct sigset_t {
+        __size: [::c_ulong; 16],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_code: ::c_int,
+        pub si_errno: ::c_int,
+        _pad: ::c_int,
+        _pad2: [::c_long; 14],
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::c_uint,
+        pub __seq: ::c_ushort,
+        __pad1: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved4: ::c_ulong,
+        __glibc_reserved5: ::c_ulong,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        pub f_frsize: ::c_long,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_files: ::fsblkcnt_t,
+        pub f_ffree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_fsid: ::fsid_t,
+
+        pub f_namelen: ::c_long,
+        f_spare: [::c_long; 6],
+    }
+
+    pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: ::socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::size_t,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: ::size_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct cmsghdr {
+        pub cmsg_len: ::size_t,
+        pub cmsg_level: ::c_int,
+        pub cmsg_type: ::c_int,
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::NCCS],
+    }
+
+    pub struct sysinfo {
+        pub uptime: ::c_long,
+        pub loads: [::c_ulong; 3],
+        pub totalram: ::c_ulong,
+        pub freeram: ::c_ulong,
+        pub sharedram: ::c_ulong,
+        pub bufferram: ::c_ulong,
+        pub totalswap: ::c_ulong,
+        pub freeswap: ::c_ulong,
+        pub procs: ::c_ushort,
+        pub pad: ::c_ushort,
+        pub totalhigh: ::c_ulong,
+        pub freehigh: ::c_ulong,
+        pub mem_unit: ::c_uint,
+        pub _f: [::c_char; 0],
+    }
+}
+
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
+
+pub const SYS_gettid: ::c_long = 5178; // Valid for n64
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    } else {
+        mod no_align;
+        pub use self::no_align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+s! {
+    // FIXME this is actually a union
+    pub struct sem_t {
+        __size: [::c_char; 32],
+        __align: [::c_long; 0],
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mips/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,310 @@
+pub type pthread_t = ::c_ulong;
+
+pub const SFD_CLOEXEC: ::c_int = 0x080000;
+
+pub const NCCS: usize = 32;
+
+pub const O_TRUNC: ::c_int = 512;
+
+pub const O_CLOEXEC: ::c_int = 0x80000;
+
+pub const EBFONT: ::c_int = 59;
+pub const ENOSTR: ::c_int = 60;
+pub const ENODATA: ::c_int = 61;
+pub const ETIME: ::c_int = 62;
+pub const ENOSR: ::c_int = 63;
+pub const ENONET: ::c_int = 64;
+pub const ENOPKG: ::c_int = 65;
+pub const EREMOTE: ::c_int = 66;
+pub const ENOLINK: ::c_int = 67;
+pub const EADV: ::c_int = 68;
+pub const ESRMNT: ::c_int = 69;
+pub const ECOMM: ::c_int = 70;
+pub const EPROTO: ::c_int = 71;
+pub const EDOTDOT: ::c_int = 73;
+
+pub const SA_NODEFER: ::c_int = 0x40000000;
+pub const SA_RESETHAND: ::c_int = 0x80000000;
+pub const SA_RESTART: ::c_int = 0x10000000;
+pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
+
+pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
+
+pub const EFD_CLOEXEC: ::c_int = 0x80000;
+
+pub const TMP_MAX: ::c_uint = 238328;
+pub const _SC_2_C_VERSION: ::c_int = 96;
+pub const O_ACCMODE: ::c_int = 3;
+pub const O_DIRECT: ::c_int = 0x8000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+pub const O_NOATIME: ::c_int = 0x40000;
+pub const O_PATH: ::c_int = 0o010000000;
+
+pub const O_APPEND: ::c_int = 8;
+pub const O_CREAT: ::c_int = 256;
+pub const O_EXCL: ::c_int = 1024;
+pub const O_NOCTTY: ::c_int = 2048;
+pub const O_NONBLOCK: ::c_int = 128;
+pub const O_SYNC: ::c_int = 0x10;
+pub const O_RSYNC: ::c_int = 0x10;
+pub const O_DSYNC: ::c_int = 0x10;
+pub const O_FSYNC: ::c_int = 0x10;
+pub const O_ASYNC: ::c_int = 0x1000;
+pub const O_LARGEFILE: ::c_int = 0x2000;
+pub const O_NDELAY: ::c_int = 0x80;
+
+pub const SOCK_NONBLOCK: ::c_int = 128;
+pub const PIDFD_NONBLOCK: ::c_int = 128;
+
+pub const EDEADLK: ::c_int = 45;
+pub const ENAMETOOLONG: ::c_int = 78;
+pub const ENOLCK: ::c_int = 46;
+pub const ENOSYS: ::c_int = 89;
+pub const ENOTEMPTY: ::c_int = 93;
+pub const ELOOP: ::c_int = 90;
+pub const ENOMSG: ::c_int = 35;
+pub const EIDRM: ::c_int = 36;
+pub const ECHRNG: ::c_int = 37;
+pub const EL2NSYNC: ::c_int = 38;
+pub const EL3HLT: ::c_int = 39;
+pub const EL3RST: ::c_int = 40;
+pub const ELNRNG: ::c_int = 41;
+pub const EUNATCH: ::c_int = 42;
+pub const ENOCSI: ::c_int = 43;
+pub const EL2HLT: ::c_int = 44;
+pub const EBADE: ::c_int = 50;
+pub const EBADR: ::c_int = 51;
+pub const EXFULL: ::c_int = 52;
+pub const FFDLY: ::c_int = 0o0100000;
+pub const ENOANO: ::c_int = 53;
+pub const EBADRQC: ::c_int = 54;
+pub const EBADSLT: ::c_int = 55;
+pub const EMULTIHOP: ::c_int = 74;
+pub const EOVERFLOW: ::c_int = 79;
+pub const ENOTUNIQ: ::c_int = 80;
+pub const EBADFD: ::c_int = 81;
+pub const EBADMSG: ::c_int = 77;
+pub const EREMCHG: ::c_int = 82;
+pub const ELIBACC: ::c_int = 83;
+pub const ELIBBAD: ::c_int = 84;
+pub const ELIBSCN: ::c_int = 85;
+pub const ELIBMAX: ::c_int = 86;
+pub const ELIBEXEC: ::c_int = 87;
+pub const EILSEQ: ::c_int = 88;
+pub const ERESTART: ::c_int = 91;
+pub const ESTRPIPE: ::c_int = 92;
+pub const EUSERS: ::c_int = 94;
+pub const ENOTSOCK: ::c_int = 95;
+pub const EDESTADDRREQ: ::c_int = 96;
+pub const EMSGSIZE: ::c_int = 97;
+pub const EPROTOTYPE: ::c_int = 98;
+pub const ENOPROTOOPT: ::c_int = 99;
+pub const EPROTONOSUPPORT: ::c_int = 120;
+pub const ESOCKTNOSUPPORT: ::c_int = 121;
+pub const EOPNOTSUPP: ::c_int = 122;
+pub const EPFNOSUPPORT: ::c_int = 123;
+pub const EAFNOSUPPORT: ::c_int = 124;
+pub const EADDRINUSE: ::c_int = 125;
+pub const EADDRNOTAVAIL: ::c_int = 126;
+pub const ENETDOWN: ::c_int = 127;
+pub const ENETUNREACH: ::c_int = 128;
+pub const ENETRESET: ::c_int = 129;
+pub const ECONNABORTED: ::c_int = 130;
+pub const ECONNRESET: ::c_int = 131;
+pub const ENOBUFS: ::c_int = 132;
+pub const EISCONN: ::c_int = 133;
+pub const ENOTCONN: ::c_int = 134;
+pub const ESHUTDOWN: ::c_int = 143;
+pub const ETOOMANYREFS: ::c_int = 144;
+pub const ETIMEDOUT: ::c_int = 145;
+pub const ECONNREFUSED: ::c_int = 146;
+pub const EHOSTDOWN: ::c_int = 147;
+pub const EHOSTUNREACH: ::c_int = 148;
+pub const EALREADY: ::c_int = 149;
+pub const EINPROGRESS: ::c_int = 150;
+pub const ESTALE: ::c_int = 151;
+pub const EUCLEAN: ::c_int = 135;
+pub const ENOTNAM: ::c_int = 137;
+pub const ENAVAIL: ::c_int = 138;
+pub const EISNAM: ::c_int = 139;
+pub const EREMOTEIO: ::c_int = 140;
+pub const EDQUOT: ::c_int = 1133;
+pub const ENOMEDIUM: ::c_int = 159;
+pub const EMEDIUMTYPE: ::c_int = 160;
+pub const ECANCELED: ::c_int = 158;
+pub const ENOKEY: ::c_int = 161;
+pub const EKEYEXPIRED: ::c_int = 162;
+pub const EKEYREVOKED: ::c_int = 163;
+pub const EKEYREJECTED: ::c_int = 164;
+pub const EOWNERDEAD: ::c_int = 165;
+pub const ENOTRECOVERABLE: ::c_int = 166;
+pub const ERFKILL: ::c_int = 167;
+
+pub const MAP_NORESERVE: ::c_int = 0x400;
+pub const MAP_ANON: ::c_int = 0x800;
+pub const MAP_ANONYMOUS: ::c_int = 0x800;
+pub const MAP_GROWSDOWN: ::c_int = 0x1000;
+pub const MAP_DENYWRITE: ::c_int = 0x2000;
+pub const MAP_EXECUTABLE: ::c_int = 0x4000;
+pub const MAP_LOCKED: ::c_int = 0x8000;
+pub const MAP_POPULATE: ::c_int = 0x10000;
+pub const MAP_NONBLOCK: ::c_int = 0x20000;
+pub const MAP_STACK: ::c_int = 0x40000;
+
+pub const NLDLY: ::tcflag_t = 0o0000400;
+
+pub const SOCK_STREAM: ::c_int = 2;
+pub const SOCK_DGRAM: ::c_int = 1;
+pub const SOCK_SEQPACKET: ::c_int = 5;
+
+pub const SA_ONSTACK: ::c_uint = 0x08000000;
+pub const SA_SIGINFO: ::c_uint = 0x00000008;
+pub const SA_NOCLDWAIT: ::c_int = 0x00010000;
+
+pub const SIGCHLD: ::c_int = 18;
+pub const SIGBUS: ::c_int = 10;
+pub const SIGTTIN: ::c_int = 26;
+pub const SIGTTOU: ::c_int = 27;
+pub const SIGXCPU: ::c_int = 30;
+pub const SIGXFSZ: ::c_int = 31;
+pub const SIGVTALRM: ::c_int = 28;
+pub const SIGPROF: ::c_int = 29;
+pub const SIGWINCH: ::c_int = 20;
+pub const SIGUSR1: ::c_int = 16;
+pub const SIGUSR2: ::c_int = 17;
+pub const SIGCONT: ::c_int = 25;
+pub const SIGSTOP: ::c_int = 23;
+pub const SIGTSTP: ::c_int = 24;
+pub const SIGURG: ::c_int = 21;
+pub const SIGIO: ::c_int = 22;
+pub const SIGSYS: ::c_int = 12;
+pub const SIGPWR: ::c_int = 19;
+pub const SIG_SETMASK: ::c_int = 3;
+pub const SIG_BLOCK: ::c_int = 0x1;
+pub const SIG_UNBLOCK: ::c_int = 0x2;
+
+pub const POLLWRNORM: ::c_short = 0x004;
+pub const POLLWRBAND: ::c_short = 0x100;
+
+pub const PTHREAD_STACK_MIN: ::size_t = 16384;
+
+pub const VEOF: usize = 16;
+pub const VEOL: usize = 17;
+pub const VEOL2: usize = 6;
+pub const VMIN: usize = 4;
+pub const IEXTEN: ::tcflag_t = 0x00000100;
+pub const TOSTOP: ::tcflag_t = 0x00008000;
+pub const FLUSHO: ::tcflag_t = 0x00002000;
+pub const TCSANOW: ::c_int = 0x540e;
+pub const TCSADRAIN: ::c_int = 0x540f;
+pub const TCSAFLUSH: ::c_int = 0x5410;
+
+pub const CPU_SETSIZE: ::c_int = 0x400;
+
+pub const EFD_NONBLOCK: ::c_int = 0x80;
+
+pub const F_GETLK: ::c_int = 14;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+
+pub const SFD_NONBLOCK: ::c_int = 0x80;
+
+pub const RTLD_GLOBAL: ::c_int = 0x4;
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const CBAUD: ::tcflag_t = 0o0010017;
+pub const CBAUDEX: ::tcflag_t = 0o0010000;
+pub const CIBAUD: ::tcflag_t = 0o002003600000;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const TABDLY: ::tcflag_t = 0o0014000;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const BSDLY: ::tcflag_t = 0o0020000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const XTABS: ::tcflag_t = 0o0014000;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSWTC: usize = 7;
+pub const VTDLY: ::c_int = 0o0040000;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 5;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const OLCUC: ::tcflag_t = 0o0000002;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CRDLY: ::c_int = 0o0003000;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+
+pub const MAP_HUGETLB: ::c_int = 0x80000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+cfg_if! {
+    if #[cfg(target_arch = "mips")] {
+        mod mips32;
+        pub use self::mips32::*;
+    } else if #[cfg(target_arch = "mips64")] {
+        mod mips64;
+        pub use self::mips64::*;
+    } else {
+        // Unknown target_arch
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,392 @@
+pub type shmatt_t = ::c_ulong;
+pub type msgqnum_t = ::c_ulong;
+pub type msglen_t = ::c_ulong;
+pub type regoff_t = ::c_int;
+pub type rlim_t = ::c_ulong;
+pub type __rlimit_resource_t = ::c_ulong;
+pub type __priority_which_t = ::c_uint;
+
+cfg_if! {
+    if #[cfg(doc)] {
+        // Used in `linux::arch` to define ioctl constants.
+        pub(crate) type Ioctl = ::c_ulong;
+    } else {
+        #[doc(hidden)]
+        pub type Ioctl = ::c_ulong;
+    }
+}
+
+s! {
+    pub struct statvfs {  // Different than GNU!
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        #[cfg(target_endian = "little")]
+        pub f_fsid: ::c_ulong,
+        #[cfg(target_pointer_width = "32")]
+        __f_unused: ::c_int,
+        #[cfg(target_endian = "big")]
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct regex_t {
+        __buffer: *mut ::c_void,
+        __allocated: ::size_t,
+        __used: ::size_t,
+        __syntax: ::c_ulong,
+        __fastmap: *mut ::c_char,
+        __translate: *mut ::c_char,
+        __re_nsub: ::size_t,
+        __bitfield: u8,
+    }
+
+    pub struct rtentry {
+        pub rt_pad1: ::c_ulong,
+        pub rt_dst: ::sockaddr,
+        pub rt_gateway: ::sockaddr,
+        pub rt_genmask: ::sockaddr,
+        pub rt_flags: ::c_ushort,
+        pub rt_pad2: ::c_short,
+        pub rt_pad3: ::c_ulong,
+        pub rt_tos: ::c_uchar,
+        pub rt_class: ::c_uchar,
+        #[cfg(target_pointer_width = "64")]
+        pub rt_pad4: [::c_short; 3usize],
+        #[cfg(not(target_pointer_width = "64"))]
+        pub rt_pad4: ::c_short,
+        pub rt_metric: ::c_short,
+        pub rt_dev: *mut ::c_char,
+        pub rt_mtu: ::c_ulong,
+        pub rt_window: ::c_ulong,
+        pub rt_irtt: ::c_ushort,
+    }
+
+    pub struct __exit_status {
+        pub e_termination: ::c_short,
+        pub e_exit: ::c_short,
+    }
+
+    pub struct ptrace_peeksiginfo_args {
+        pub off: ::__u64,
+        pub flags: ::__u32,
+        pub nr: ::__s32,
+    }
+}
+
+impl siginfo_t {
+    pub unsafe fn si_addr(&self) -> *mut ::c_void {
+        #[repr(C)]
+        struct siginfo_sigfault {
+            _si_signo: ::c_int,
+            _si_errno: ::c_int,
+            _si_code: ::c_int,
+            si_addr: *mut ::c_void,
+        }
+        (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr
+    }
+
+    pub unsafe fn si_value(&self) -> ::sigval {
+        #[repr(C)]
+        struct siginfo_si_value {
+            _si_signo: ::c_int,
+            _si_errno: ::c_int,
+            _si_code: ::c_int,
+            _si_timerid: ::c_int,
+            _si_overrun: ::c_int,
+            si_value: ::sigval,
+        }
+        (*(self as *const siginfo_t as *const siginfo_si_value)).si_value
+    }
+}
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+
+pub const SIGEV_THREAD_ID: ::c_int = 4;
+
+pub const AF_VSOCK: ::c_int = 40;
+
+// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the
+// following are only available on newer Linux versions than the versions
+// currently used in CI in some configurations, so we define them here.
+pub const BINDERFS_SUPER_MAGIC: ::c_long = 0x6c6f6f70;
+pub const XFS_SUPER_MAGIC: ::c_long = 0x58465342;
+
+pub const PTRACE_TRACEME: ::c_int = 0;
+pub const PTRACE_PEEKTEXT: ::c_int = 1;
+pub const PTRACE_PEEKDATA: ::c_int = 2;
+pub const PTRACE_PEEKUSER: ::c_int = 3;
+pub const PTRACE_POKETEXT: ::c_int = 4;
+pub const PTRACE_POKEDATA: ::c_int = 5;
+pub const PTRACE_POKEUSER: ::c_int = 6;
+pub const PTRACE_CONT: ::c_int = 7;
+pub const PTRACE_KILL: ::c_int = 8;
+pub const PTRACE_SINGLESTEP: ::c_int = 9;
+pub const PTRACE_GETREGS: ::c_int = 12;
+pub const PTRACE_SETREGS: ::c_int = 13;
+pub const PTRACE_GETFPREGS: ::c_int = 14;
+pub const PTRACE_SETFPREGS: ::c_int = 15;
+pub const PTRACE_ATTACH: ::c_int = 16;
+pub const PTRACE_DETACH: ::c_int = 17;
+pub const PTRACE_GETFPXREGS: ::c_int = 18;
+pub const PTRACE_SETFPXREGS: ::c_int = 19;
+pub const PTRACE_SYSCALL: ::c_int = 24;
+pub const PTRACE_SETOPTIONS: ::c_int = 0x4200;
+pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201;
+pub const PTRACE_GETSIGINFO: ::c_int = 0x4202;
+pub const PTRACE_SETSIGINFO: ::c_int = 0x4203;
+pub const PTRACE_GETREGSET: ::c_int = 0x4204;
+pub const PTRACE_SETREGSET: ::c_int = 0x4205;
+pub const PTRACE_SEIZE: ::c_int = 0x4206;
+pub const PTRACE_INTERRUPT: ::c_int = 0x4207;
+pub const PTRACE_LISTEN: ::c_int = 0x4208;
+
+pub const POSIX_FADV_DONTNEED: ::c_int = 4;
+pub const POSIX_FADV_NOREUSE: ::c_int = 5;
+
+// These are different than GNU!
+pub const LC_CTYPE: ::c_int = 0;
+pub const LC_NUMERIC: ::c_int = 1;
+pub const LC_TIME: ::c_int = 3;
+pub const LC_COLLATE: ::c_int = 4;
+pub const LC_MONETARY: ::c_int = 2;
+pub const LC_MESSAGES: ::c_int = 5;
+pub const LC_ALL: ::c_int = 6;
+// end different section
+
+// MS_ flags for mount(2)
+pub const MS_RMT_MASK: ::c_ulong = ::MS_RDONLY | ::MS_SYNCHRONOUS | ::MS_MANDLOCK | ::MS_I_VERSION;
+
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+
+pub const IPV6_JOIN_GROUP: ::c_int = 20;
+pub const IPV6_LEAVE_GROUP: ::c_int = 21;
+
+// These are different from GNU
+pub const ABDAY_1: ::nl_item = 0x300;
+pub const ABDAY_2: ::nl_item = 0x301;
+pub const ABDAY_3: ::nl_item = 0x302;
+pub const ABDAY_4: ::nl_item = 0x303;
+pub const ABDAY_5: ::nl_item = 0x304;
+pub const ABDAY_6: ::nl_item = 0x305;
+pub const ABDAY_7: ::nl_item = 0x306;
+pub const DAY_1: ::nl_item = 0x307;
+pub const DAY_2: ::nl_item = 0x308;
+pub const DAY_3: ::nl_item = 0x309;
+pub const DAY_4: ::nl_item = 0x30A;
+pub const DAY_5: ::nl_item = 0x30B;
+pub const DAY_6: ::nl_item = 0x30C;
+pub const DAY_7: ::nl_item = 0x30D;
+pub const ABMON_1: ::nl_item = 0x30E;
+pub const ABMON_2: ::nl_item = 0x30F;
+pub const ABMON_3: ::nl_item = 0x310;
+pub const ABMON_4: ::nl_item = 0x311;
+pub const ABMON_5: ::nl_item = 0x312;
+pub const ABMON_6: ::nl_item = 0x313;
+pub const ABMON_7: ::nl_item = 0x314;
+pub const ABMON_8: ::nl_item = 0x315;
+pub const ABMON_9: ::nl_item = 0x316;
+pub const ABMON_10: ::nl_item = 0x317;
+pub const ABMON_11: ::nl_item = 0x318;
+pub const ABMON_12: ::nl_item = 0x319;
+pub const MON_1: ::nl_item = 0x31A;
+pub const MON_2: ::nl_item = 0x31B;
+pub const MON_3: ::nl_item = 0x31C;
+pub const MON_4: ::nl_item = 0x31D;
+pub const MON_5: ::nl_item = 0x31E;
+pub const MON_6: ::nl_item = 0x31F;
+pub const MON_7: ::nl_item = 0x320;
+pub const MON_8: ::nl_item = 0x321;
+pub const MON_9: ::nl_item = 0x322;
+pub const MON_10: ::nl_item = 0x323;
+pub const MON_11: ::nl_item = 0x324;
+pub const MON_12: ::nl_item = 0x325;
+pub const AM_STR: ::nl_item = 0x326;
+pub const PM_STR: ::nl_item = 0x327;
+pub const D_T_FMT: ::nl_item = 0x328;
+pub const D_FMT: ::nl_item = 0x329;
+pub const T_FMT: ::nl_item = 0x32A;
+pub const T_FMT_AMPM: ::nl_item = 0x32B;
+pub const ERA: ::nl_item = 0x32C;
+pub const ERA_D_FMT: ::nl_item = 0x32E;
+pub const ALT_DIGITS: ::nl_item = 0x32F;
+pub const ERA_D_T_FMT: ::nl_item = 0x330;
+pub const ERA_T_FMT: ::nl_item = 0x331;
+pub const CODESET: ::nl_item = 10;
+pub const CRNCYSTR: ::nl_item = 0x215;
+pub const RADIXCHAR: ::nl_item = 0x100;
+pub const THOUSEP: ::nl_item = 0x101;
+pub const NOEXPR: ::nl_item = 0x501;
+pub const YESSTR: ::nl_item = 0x502;
+pub const NOSTR: ::nl_item = 0x503;
+
+// Different than Gnu.
+pub const FILENAME_MAX: ::c_uint = 4095;
+
+pub const PRIO_PROCESS: ::c_int = 0;
+pub const PRIO_PGRP: ::c_int = 1;
+pub const PRIO_USER: ::c_int = 2;
+
+pub const SOMAXCONN: ::c_int = 128;
+
+pub const ST_RELATIME: ::c_ulong = 4096;
+
+pub const AF_NFC: ::c_int = PF_NFC;
+pub const BUFSIZ: ::c_int = 4096;
+pub const EDEADLOCK: ::c_int = EDEADLK;
+pub const EXTA: ::c_uint = B19200;
+pub const EXTB: ::c_uint = B38400;
+pub const EXTPROC: ::tcflag_t = 0200000;
+pub const FOPEN_MAX: ::c_int = 16;
+pub const F_GETOWN: ::c_int = 9;
+pub const F_OFD_GETLK: ::c_int = 36;
+pub const F_OFD_SETLK: ::c_int = 37;
+pub const F_OFD_SETLKW: ::c_int = 38;
+pub const F_RDLCK: ::c_int = 0;
+pub const F_SETOWN: ::c_int = 8;
+pub const F_UNLCK: ::c_int = 2;
+pub const F_WRLCK: ::c_int = 1;
+pub const IPV6_MULTICAST_ALL: ::c_int = 29;
+pub const IPV6_ROUTER_ALERT_ISOLATE: ::c_int = 30;
+pub const MAP_HUGE_SHIFT: ::c_int = 26;
+pub const MAP_HUGE_MASK: ::c_int = 0x3f;
+pub const MAP_HUGE_64KB: ::c_int = 16 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_512KB: ::c_int = 19 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_1MB: ::c_int = 20 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_2MB: ::c_int = 21 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_8MB: ::c_int = 23 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_16MB: ::c_int = 24 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_32MB: ::c_int = 25 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_256MB: ::c_int = 28 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_512MB: ::c_int = 29 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_1GB: ::c_int = 30 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_2GB: ::c_int = 31 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_16GB: ::c_int = 34 << MAP_HUGE_SHIFT;
+pub const MINSIGSTKSZ: ::c_int = 2048;
+pub const MSG_COPY: ::c_int = 040000;
+pub const NI_MAXHOST: ::socklen_t = 1025;
+pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
+pub const PACKET_MR_UNICAST: ::c_int = 3;
+pub const PF_NFC: ::c_int = 39;
+pub const PF_VSOCK: ::c_int = 40;
+pub const POSIX_MADV_DONTNEED: ::c_int = 4;
+pub const PTRACE_EVENT_STOP: ::c_int = 128;
+pub const PTRACE_GETSIGMASK: ::c_uint = 0x420a;
+pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
+pub const PTRACE_SETSIGMASK: ::c_uint = 0x420b;
+pub const RTLD_NOLOAD: ::c_int = 0x00004;
+pub const RUSAGE_THREAD: ::c_int = 1;
+pub const SHM_EXEC: ::c_int = 0100000;
+pub const SIGPOLL: ::c_int = SIGIO;
+pub const SOCK_DCCP: ::c_int = 6;
+pub const SOCK_PACKET: ::c_int = 10;
+pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
+pub const UDP_GRO: ::c_int = 104;
+pub const UDP_SEGMENT: ::c_int = 103;
+pub const YESEXPR: ::c_int = ((5) << 8) | (0);
+
+extern "C" {
+    pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
+
+    pub fn pthread_rwlockattr_getkind_np(
+        attr: *const ::pthread_rwlockattr_t,
+        val: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_rwlockattr_setkind_np(
+        attr: *mut ::pthread_rwlockattr_t,
+        val: ::c_int,
+    ) -> ::c_int;
+
+    pub fn ptrace(request: ::c_uint, ...) -> ::c_long;
+
+    pub fn sendmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn recvmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_int,
+        timeout: *mut ::timespec,
+    ) -> ::c_int;
+
+    pub fn openpty(
+        amaster: *mut ::c_int,
+        aslave: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *mut termios,
+        winp: *mut ::winsize,
+    ) -> ::c_int;
+    pub fn forkpty(
+        amaster: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *mut termios,
+        winp: *mut ::winsize,
+    ) -> ::pid_t;
+
+    pub fn getnameinfo(
+        sa: *const ::sockaddr,
+        salen: ::socklen_t,
+        host: *mut ::c_char,
+        hostlen: ::socklen_t,
+        serv: *mut ::c_char,
+        servlen: ::socklen_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+
+    pub fn pwritev(
+        fd: ::c_int,
+        iov: *const ::iovec,
+        iovcnt: ::c_int,
+        offset: ::off64_t,
+    ) -> ::ssize_t;
+    pub fn preadv(
+        fd: ::c_int,
+        iov: *const ::iovec,
+        iovcnt: ::c_int,
+        offset: ::off64_t,
+    ) -> ::ssize_t;
+
+    pub fn sethostid(hostid: ::c_long) -> ::c_int;
+    pub fn fanotify_mark(
+        fd: ::c_int,
+        flags: ::c_uint,
+        mask: u64,
+        dirfd: ::c_int,
+        path: *const ::c_char,
+    ) -> ::c_int;
+    pub fn getrlimit64(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit64) -> ::c_int;
+    pub fn setrlimit64(resource: ::__rlimit_resource_t, rlim: *const ::rlimit64) -> ::c_int;
+    pub fn getrlimit(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit) -> ::c_int;
+    pub fn setrlimit(resource: ::__rlimit_resource_t, rlim: *const ::rlimit) -> ::c_int;
+    pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::__priority_which_t, who: ::id_t, prio: ::c_int) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(any(target_arch = "mips", target_arch = "mips64"))] {
+        mod mips;
+        pub use self::mips::*;
+    } else if #[cfg(target_arch = "x86_64")] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    } else if #[cfg(target_arch = "arm")] {
+        mod arm;
+        pub use self::arm::*;
+    } else {
+        pub use unsupported_target;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/no_align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/no_align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/no_align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/no_align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,53 @@
+macro_rules! expand_align {
+    () => {
+        s! {
+            pub struct pthread_mutex_t {
+                #[cfg(any(target_arch = "mips",
+                          target_arch = "arm",
+                          target_arch = "powerpc"))]
+                __align: [::c_long; 0],
+                #[cfg(any(libc_align,
+                          target_arch = "mips",
+                          target_arch = "arm",
+                          target_arch = "powerpc"))]
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
+            }
+
+            pub struct pthread_rwlock_t {
+                #[cfg(any(target_arch = "mips",
+                          target_arch = "arm",
+                          target_arch = "powerpc"))]
+                __align: [::c_long; 0],
+                #[cfg(not(any(
+                    target_arch = "mips",
+                    target_arch = "arm",
+                    target_arch = "powerpc")))]
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
+            }
+
+            pub struct pthread_mutexattr_t {
+                #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64",
+                          target_arch = "mips64", target_arch = "s390x",
+                          target_arch = "sparc64"))]
+                __align: [::c_int; 0],
+                #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64",
+                              target_arch = "mips64", target_arch = "s390x",
+                              target_arch = "sparc64")))]
+                __align: [::c_long; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
+            }
+
+            pub struct pthread_cond_t {
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_COND_T],
+            }
+
+            pub struct pthread_condattr_t {
+                __align: [::c_int; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,53 @@
+/// L4Re specifics
+/// This module contains definitions required by various L4Re libc backends.
+/// Some of them are formally not part of the libc, but are a dependency of the
+/// libc and hence we should provide them here.
+
+pub type l4_umword_t = ::c_ulong; // Unsigned machine word.
+pub type pthread_t = *mut ::c_void;
+
+s! {
+    /// CPU sets.
+    pub struct l4_sched_cpu_set_t {
+        // from the L4Re docs
+        /// Combination of granularity and offset.
+        ///
+        /// The granularity defines how many CPUs each bit in map describes.
+        /// The offset is the number of the first CPU described by the first
+        /// bit in the bitmap.
+        /// offset must be a multiple of 2^graularity.
+        ///
+        /// | MSB              |                 LSB |
+        /// | ---------------- | ------------------- |
+        /// | 8bit granularity | 24bit offset ..     |
+        gran_offset: l4_umword_t ,
+        /// Bitmap of CPUs.
+        map: l4_umword_t ,
+    }
+}
+
+#[cfg(target_os = "l4re")]
+#[allow(missing_debug_implementations)]
+pub struct pthread_attr_t {
+    pub __detachstate: ::c_int,
+    pub __schedpolicy: ::c_int,
+    pub __schedparam: super::__sched_param,
+    pub __inheritsched: ::c_int,
+    pub __scope: ::c_int,
+    pub __guardsize: ::size_t,
+    pub __stackaddr_set: ::c_int,
+    pub __stackaddr: *mut ::c_void, // better don't use it
+    pub __stacksize: ::size_t,
+    // L4Re specifics
+    pub affinity: l4_sched_cpu_set_t,
+    pub create_flags: ::c_uint,
+}
+
+// L4Re requires a min stack size of 64k; that isn't defined in uClibc, but
+// somewhere in the core libraries. uClibc wants 16k, but that's not enough.
+pub const PTHREAD_STACK_MIN: usize = 65536;
+
+// Misc other constants required for building.
+pub const SIGIO: ::c_int = 29;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,345 @@
+//! Definitions for uclibc on 64bit systems
+pub type blkcnt_t = i64;
+pub type blksize_t = i64;
+pub type clock_t = i64;
+pub type c_char = u8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type fsblkcnt_t = ::c_ulong;
+pub type fsfilcnt_t = ::c_ulong;
+pub type fsword_t = ::c_long;
+pub type ino_t = ::c_ulong;
+pub type nlink_t = ::c_uint;
+pub type off_t = ::c_long;
+// [uClibc docs] Note stat64 has the same shape as stat for x86-64.
+pub type stat64 = stat;
+pub type suseconds_t = ::c_long;
+pub type time_t = ::c_int;
+pub type wchar_t = ::c_int;
+
+pub type fsblkcnt64_t = u64;
+pub type fsfilcnt64_t = u64;
+pub type __u64 = ::c_ulong;
+pub type __s64 = ::c_long;
+
+s! {
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::c_ushort, // read / write
+        __pad1: ::c_ushort,
+        pub __seq: ::c_ushort,
+        __pad2: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong
+    }
+
+    #[cfg(not(target_os = "l4re"))]
+    pub struct pthread_attr_t {
+        __detachstate: ::c_int,
+        __schedpolicy: ::c_int,
+        __schedparam: __sched_param,
+        __inheritsched: ::c_int,
+        __scope: ::c_int,
+        __guardsize: ::size_t,
+        __stackaddr_set: ::c_int,
+        __stackaddr: *mut ::c_void, // better don't use it
+        __stacksize: ::size_t,
+    }
+
+    pub struct __sched_param {
+        __sched_priority: ::c_int,
+    }
+
+    pub struct siginfo_t {
+        si_signo: ::c_int, // signal number
+        si_errno: ::c_int, // if not zero: error value of signal, see errno.h
+        si_code: ::c_int,  // signal code
+        pub _pad: [::c_int; 28], // unported union
+        _align: [usize; 0],
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t, // segment size in bytes
+        pub shm_atime: ::time_t, // time of last shmat()
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __ignored1: ::c_ulong,
+        __ignored2: ::c_ulong,
+    }
+
+    pub struct sockaddr {
+        pub sa_family: ::sa_family_t,
+        pub sa_data: [::c_char; 14],
+    }
+
+    pub struct sockaddr_in {
+        pub sin_family: ::sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [u8; 8],
+    }
+
+    pub struct sockaddr_in6 {
+        pub sin6_family: ::sa_family_t,
+        pub sin6_port: ::in_port_t,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_scope_id: u32,
+    }
+
+    // ------------------------------------------------------------
+    // definitions below are *unverified* and might **break** the software
+//    pub struct in_addr {
+//        pub s_addr: in_addr_t,
+//    }
+//
+//    pub struct in6_addr {
+//        pub s6_addr: [u8; 16],
+//        #[cfg(not(libc_align))]
+//        __align: [u32; 0],
+//    }
+
+    pub struct stat {
+        pub st_dev: ::c_ulong,
+        pub st_ino: ::ino_t,
+        // According to uclibc/libc/sysdeps/linux/x86_64/bits/stat.h, order of
+        // nlink and mode are swapped on 64 bit systems.
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulong, // dev_t
+        pub st_size: off_t, // file size
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_ulong,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_ulong,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_ulong,
+        st_pad4: [::c_long; 3]
+    }
+
+    pub struct sigaction {
+        pub sa_handler: ::sighandler_t,
+        pub sa_flags: ::c_ulong,
+        pub sa_restorer: ::Option<extern fn()>,
+        pub sa_mask: ::sigset_t,
+    }
+
+    pub struct stack_t { // FIXME
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: ::size_t
+    }
+
+    pub struct statfs { // FIXME
+        pub f_type: fsword_t,
+        pub f_bsize: fsword_t,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: fsword_t,
+        pub f_frsize: fsword_t,
+        f_spare: [fsword_t; 5],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_int,
+        pub f_bsize: ::c_int,
+        pub f_blocks: ::fsblkcnt64_t,
+        pub f_bfree: ::fsblkcnt64_t,
+        pub f_bavail: ::fsblkcnt64_t,
+        pub f_files: ::fsfilcnt64_t,
+        pub f_ffree: ::fsfilcnt64_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_int,
+        pub f_frsize: ::c_int,
+        pub f_flags: ::c_int,
+        pub f_spare: [::c_int; 4],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: u64,
+        pub f_bfree: u64,
+        pub f_bavail: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_favail: u64,
+        pub f_fsid: ::c_ulong,
+        __f_unused: ::c_int,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    pub struct msghdr { // FIXME
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: ::socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::size_t,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: ::size_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct termios { // FIXME
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::NCCS],
+    }
+
+    pub struct sigset_t { // FIXME
+        __val: [::c_ulong; 16],
+    }
+
+    pub struct sysinfo { // FIXME
+        pub uptime: ::c_long,
+        pub loads: [::c_ulong; 3],
+        pub totalram: ::c_ulong,
+        pub freeram: ::c_ulong,
+        pub sharedram: ::c_ulong,
+        pub bufferram: ::c_ulong,
+        pub totalswap: ::c_ulong,
+        pub freeswap: ::c_ulong,
+        pub procs: ::c_ushort,
+        pub pad: ::c_ushort,
+        pub totalhigh: ::c_ulong,
+        pub freehigh: ::c_ulong,
+        pub mem_unit: ::c_uint,
+        pub _f: [::c_char; 0],
+    }
+
+    pub struct glob_t { // FIXME
+        pub gl_pathc: ::size_t,
+        pub gl_pathv: *mut *mut c_char,
+        pub gl_offs: ::size_t,
+        pub gl_flags: ::c_int,
+        __unused1: *mut ::c_void,
+        __unused2: *mut ::c_void,
+        __unused3: *mut ::c_void,
+        __unused4: *mut ::c_void,
+        __unused5: *mut ::c_void,
+    }
+
+    pub struct cpu_set_t { // FIXME
+        #[cfg(target_pointer_width = "32")]
+        bits: [u32; 32],
+        #[cfg(target_pointer_width = "64")]
+        bits: [u64; 16],
+    }
+
+    pub struct fsid_t { // FIXME
+        __val: [::c_int; 2],
+    }
+
+    // FIXME this is actually a union
+    pub struct sem_t {
+        #[cfg(target_pointer_width = "32")]
+        __size: [::c_char; 16],
+        #[cfg(target_pointer_width = "64")]
+        __size: [::c_char; 32],
+        __align: [::c_long; 0],
+    }
+
+    pub struct cmsghdr {
+        pub cmsg_len: ::size_t,
+        pub cmsg_level: ::c_int,
+        pub cmsg_type: ::c_int,
+    }
+}
+
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    pub struct dirent {
+        pub d_ino: ::ino64_t,
+        pub d_off: ::off64_t,
+        pub d_reclen: u16,
+        pub d_type: u8,
+        pub d_name: [::c_char; 256],
+    }
+}
+
+// constants
+pub const ENAMETOOLONG: ::c_int = 36; // File name too long
+pub const ENOTEMPTY: ::c_int = 39; // Directory not empty
+pub const ELOOP: ::c_int = 40; // Too many symbolic links encountered
+pub const EADDRINUSE: ::c_int = 98; // Address already in use
+pub const EADDRNOTAVAIL: ::c_int = 99; // Cannot assign requested address
+pub const ENETDOWN: ::c_int = 100; // Network is down
+pub const ENETUNREACH: ::c_int = 101; // Network is unreachable
+pub const ECONNABORTED: ::c_int = 103; // Software caused connection abort
+pub const ECONNREFUSED: ::c_int = 111; // Connection refused
+pub const ECONNRESET: ::c_int = 104; // Connection reset by peer
+pub const EDEADLK: ::c_int = 35; // Resource deadlock would occur
+pub const ENOSYS: ::c_int = 38; // Function not implemented
+pub const ENOTCONN: ::c_int = 107; // Transport endpoint is not connected
+pub const ETIMEDOUT: ::c_int = 110; // connection timed out
+pub const ESTALE: ::c_int = 116; // Stale file handle
+pub const EHOSTUNREACH: ::c_int = 113; // No route to host
+pub const EDQUOT: ::c_int = 122; // Quota exceeded
+pub const EOPNOTSUPP: ::c_int = 0x5f;
+pub const ENODATA: ::c_int = 0x3d;
+pub const O_APPEND: ::c_int = 02000;
+pub const O_ACCMODE: ::c_int = 0003;
+pub const O_CLOEXEC: ::c_int = 0x80000;
+pub const O_CREAT: ::c_int = 0100;
+pub const O_DIRECTORY: ::c_int = 0200000;
+pub const O_EXCL: ::c_int = 0200;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+pub const O_NONBLOCK: ::c_int = 04000;
+pub const O_TRUNC: ::c_int = 01000;
+pub const NCCS: usize = 32;
+pub const SIG_SETMASK: ::c_int = 2; // Set the set of blocked signals
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+pub const SOCK_DGRAM: ::c_int = 2; // connectionless, unreliable datagrams
+pub const SOCK_STREAM: ::c_int = 1; // …/common/bits/socket_type.h
+pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
+pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
+pub const PIDFD_NONBLOCK: ::c_int = 04000;
+
+cfg_if! {
+    if #[cfg(target_os = "l4re")] {
+        mod l4re;
+        pub use self::l4re::*;
+    } else {
+        mod other;
+        pub use other::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/other.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/other.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/other.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/other.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+// Thestyle checker discourages the use of #[cfg], so this has to go into a
+// separate module
+pub type pthread_t = ::c_ulong;
+
+pub const PTHREAD_STACK_MIN: usize = 16384;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/linux_like/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/linux_like/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/linux_like/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1914 @@
+pub type sa_family_t = u16;
+pub type speed_t = ::c_uint;
+pub type tcflag_t = ::c_uint;
+pub type clockid_t = ::c_int;
+pub type timer_t = *mut ::c_void;
+pub type key_t = ::c_int;
+pub type id_t = ::c_uint;
+
+missing! {
+    #[cfg_attr(feature = "extra_traits", derive(Debug))]
+    pub enum timezone {}
+}
+
+s! {
+    pub struct in_addr {
+        pub s_addr: ::in_addr_t,
+    }
+
+    pub struct ip_mreq {
+        pub imr_multiaddr: in_addr,
+        pub imr_interface: in_addr,
+    }
+
+    pub struct ip_mreqn {
+        pub imr_multiaddr: in_addr,
+        pub imr_address: in_addr,
+        pub imr_ifindex: ::c_int,
+    }
+
+    pub struct ip_mreq_source {
+        pub imr_multiaddr: in_addr,
+        pub imr_interface: in_addr,
+        pub imr_sourceaddr: in_addr,
+    }
+
+    pub struct sockaddr {
+        pub sa_family: sa_family_t,
+        pub sa_data: [::c_char; 14],
+    }
+
+    pub struct sockaddr_in {
+        pub sin_family: sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [u8; 8],
+    }
+
+    pub struct sockaddr_in6 {
+        pub sin6_family: sa_family_t,
+        pub sin6_port: ::in_port_t,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_scope_id: u32,
+    }
+
+    // The order of the `ai_addr` field in this struct is crucial
+    // for converting between the Rust and C types.
+    pub struct addrinfo {
+        pub ai_flags: ::c_int,
+        pub ai_family: ::c_int,
+        pub ai_socktype: ::c_int,
+        pub ai_protocol: ::c_int,
+        pub ai_addrlen: socklen_t,
+
+        #[cfg(any(target_os = "linux",
+                  target_os = "emscripten"))]
+        pub ai_addr: *mut ::sockaddr,
+
+        pub ai_canonname: *mut c_char,
+
+        #[cfg(target_os = "android")]
+        pub ai_addr: *mut ::sockaddr,
+
+        pub ai_next: *mut addrinfo,
+    }
+
+    pub struct sockaddr_ll {
+        pub sll_family: ::c_ushort,
+        pub sll_protocol: ::c_ushort,
+        pub sll_ifindex: ::c_int,
+        pub sll_hatype: ::c_ushort,
+        pub sll_pkttype: ::c_uchar,
+        pub sll_halen: ::c_uchar,
+        pub sll_addr: [::c_uchar; 8]
+    }
+
+    pub struct fd_set {
+        fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE],
+    }
+
+    pub struct tm {
+        pub tm_sec: ::c_int,
+        pub tm_min: ::c_int,
+        pub tm_hour: ::c_int,
+        pub tm_mday: ::c_int,
+        pub tm_mon: ::c_int,
+        pub tm_year: ::c_int,
+        pub tm_wday: ::c_int,
+        pub tm_yday: ::c_int,
+        pub tm_isdst: ::c_int,
+        pub tm_gmtoff: ::c_long,
+        pub tm_zone: *const ::c_char,
+    }
+
+    pub struct sched_param {
+        pub sched_priority: ::c_int,
+        #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
+        pub sched_ss_low_priority: ::c_int,
+        #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
+        pub sched_ss_repl_period: ::timespec,
+        #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
+        pub sched_ss_init_budget: ::timespec,
+        #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
+        pub sched_ss_max_repl: ::c_int,
+    }
+
+    pub struct Dl_info {
+        pub dli_fname: *const ::c_char,
+        pub dli_fbase: *mut ::c_void,
+        pub dli_sname: *const ::c_char,
+        pub dli_saddr: *mut ::c_void,
+    }
+
+    pub struct lconv {
+        pub decimal_point: *mut ::c_char,
+        pub thousands_sep: *mut ::c_char,
+        pub grouping: *mut ::c_char,
+        pub int_curr_symbol: *mut ::c_char,
+        pub currency_symbol: *mut ::c_char,
+        pub mon_decimal_point: *mut ::c_char,
+        pub mon_thousands_sep: *mut ::c_char,
+        pub mon_grouping: *mut ::c_char,
+        pub positive_sign: *mut ::c_char,
+        pub negative_sign: *mut ::c_char,
+        pub int_frac_digits: ::c_char,
+        pub frac_digits: ::c_char,
+        pub p_cs_precedes: ::c_char,
+        pub p_sep_by_space: ::c_char,
+        pub n_cs_precedes: ::c_char,
+        pub n_sep_by_space: ::c_char,
+        pub p_sign_posn: ::c_char,
+        pub n_sign_posn: ::c_char,
+        pub int_p_cs_precedes: ::c_char,
+        pub int_p_sep_by_space: ::c_char,
+        pub int_n_cs_precedes: ::c_char,
+        pub int_n_sep_by_space: ::c_char,
+        pub int_p_sign_posn: ::c_char,
+        pub int_n_sign_posn: ::c_char,
+    }
+
+    pub struct in_pktinfo {
+        pub ipi_ifindex: ::c_int,
+        pub ipi_spec_dst: ::in_addr,
+        pub ipi_addr: ::in_addr,
+    }
+
+    pub struct ifaddrs {
+        pub ifa_next: *mut ifaddrs,
+        pub ifa_name: *mut c_char,
+        pub ifa_flags: ::c_uint,
+        pub ifa_addr: *mut ::sockaddr,
+        pub ifa_netmask: *mut ::sockaddr,
+        pub ifa_ifu: *mut ::sockaddr, // FIXME This should be a union
+        pub ifa_data: *mut ::c_void
+    }
+
+    pub struct in6_rtmsg {
+        rtmsg_dst: ::in6_addr,
+        rtmsg_src: ::in6_addr,
+        rtmsg_gateway: ::in6_addr,
+        rtmsg_type: u32,
+        rtmsg_dst_len: u16,
+        rtmsg_src_len: u16,
+        rtmsg_metric: u32,
+        rtmsg_info: ::c_ulong,
+        rtmsg_flags: u32,
+        rtmsg_ifindex: ::c_int,
+    }
+
+    pub struct arpreq {
+        pub arp_pa: ::sockaddr,
+        pub arp_ha: ::sockaddr,
+        pub arp_flags: ::c_int,
+        pub arp_netmask: ::sockaddr,
+        pub arp_dev: [::c_char; 16],
+    }
+
+    pub struct arpreq_old {
+        pub arp_pa: ::sockaddr,
+        pub arp_ha: ::sockaddr,
+        pub arp_flags: ::c_int,
+        pub arp_netmask: ::sockaddr,
+    }
+
+    pub struct arphdr {
+        pub ar_hrd: u16,
+        pub ar_pro: u16,
+        pub ar_hln: u8,
+        pub ar_pln: u8,
+        pub ar_op: u16,
+    }
+
+    pub struct mmsghdr {
+        pub msg_hdr: ::msghdr,
+        pub msg_len: ::c_uint,
+    }
+}
+
+s_no_extra_traits! {
+    #[cfg_attr(
+        any(
+            all(
+                target_arch = "x86",
+                not(target_env = "musl"),
+                not(target_os = "android")),
+            target_arch = "x86_64"),
+        repr(packed))]
+    pub struct epoll_event {
+        pub events: u32,
+        pub u64: u64,
+    }
+
+    pub struct sockaddr_un {
+        pub sun_family: sa_family_t,
+        pub sun_path: [::c_char; 108]
+    }
+
+    pub struct sockaddr_storage {
+        pub ss_family: sa_family_t,
+        #[cfg(target_pointer_width = "32")]
+        __ss_pad2: [u8; 128 - 2 - 4],
+        #[cfg(target_pointer_width = "64")]
+        __ss_pad2: [u8; 128 - 2 - 8],
+        __ss_align: ::size_t,
+    }
+
+    pub struct utsname {
+        pub sysname: [::c_char; 65],
+        pub nodename: [::c_char; 65],
+        pub release: [::c_char; 65],
+        pub version: [::c_char; 65],
+        pub machine: [::c_char; 65],
+        pub domainname: [::c_char; 65]
+    }
+
+    pub struct sigevent {
+        pub sigev_value: ::sigval,
+        pub sigev_signo: ::c_int,
+        pub sigev_notify: ::c_int,
+        // Actually a union.  We only expose sigev_notify_thread_id because it's
+        // the most useful member
+        pub sigev_notify_thread_id: ::c_int,
+        #[cfg(target_pointer_width = "64")]
+        __unused1: [::c_int; 11],
+        #[cfg(target_pointer_width = "32")]
+        __unused1: [::c_int; 12]
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for epoll_event {
+            fn eq(&self, other: &epoll_event) -> bool {
+                self.events == other.events
+                    && self.u64 == other.u64
+            }
+        }
+        impl Eq for epoll_event {}
+        impl ::fmt::Debug for epoll_event {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let events = self.events;
+                let u64 = self.u64;
+                f.debug_struct("epoll_event")
+                    .field("events", &events)
+                    .field("u64", &u64)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for epoll_event {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let events = self.events;
+                let u64 = self.u64;
+                events.hash(state);
+                u64.hash(state);
+            }
+        }
+
+        impl PartialEq for sockaddr_un {
+            fn eq(&self, other: &sockaddr_un) -> bool {
+                self.sun_family == other.sun_family
+                    && self
+                    .sun_path
+                    .iter()
+                    .zip(other.sun_path.iter())
+                    .all(|(a, b)| a == b)
+            }
+        }
+        impl Eq for sockaddr_un {}
+        impl ::fmt::Debug for sockaddr_un {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_un")
+                    .field("sun_family", &self.sun_family)
+                // FIXME: .field("sun_path", &self.sun_path)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sockaddr_un {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sun_family.hash(state);
+                self.sun_path.hash(state);
+            }
+        }
+
+        impl PartialEq for sockaddr_storage {
+            fn eq(&self, other: &sockaddr_storage) -> bool {
+                self.ss_family == other.ss_family
+                    && self
+                    .__ss_pad2
+                    .iter()
+                    .zip(other.__ss_pad2.iter())
+                    .all(|(a, b)| a == b)
+            }
+        }
+
+        impl Eq for sockaddr_storage {}
+
+        impl ::fmt::Debug for sockaddr_storage {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_storage")
+                    .field("ss_family", &self.ss_family)
+                    .field("__ss_align", &self.__ss_align)
+                // FIXME: .field("__ss_pad2", &self.__ss_pad2)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for sockaddr_storage {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ss_family.hash(state);
+                self.__ss_pad2.hash(state);
+            }
+        }
+
+        impl PartialEq for utsname {
+            fn eq(&self, other: &utsname) -> bool {
+                self.sysname
+                    .iter()
+                    .zip(other.sysname.iter())
+                    .all(|(a, b)| a == b)
+                    && self
+                    .nodename
+                    .iter()
+                    .zip(other.nodename.iter())
+                    .all(|(a, b)| a == b)
+                    && self
+                    .release
+                    .iter()
+                    .zip(other.release.iter())
+                    .all(|(a, b)| a == b)
+                    && self
+                    .version
+                    .iter()
+                    .zip(other.version.iter())
+                    .all(|(a, b)| a == b)
+                    && self
+                    .machine
+                    .iter()
+                    .zip(other.machine.iter())
+                    .all(|(a, b)| a == b)
+                    && self
+                    .domainname
+                    .iter()
+                    .zip(other.domainname.iter())
+                    .all(|(a, b)| a == b)
+            }
+        }
+
+        impl Eq for utsname {}
+
+        impl ::fmt::Debug for utsname {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("utsname")
+                // FIXME: .field("sysname", &self.sysname)
+                // FIXME: .field("nodename", &self.nodename)
+                // FIXME: .field("release", &self.release)
+                // FIXME: .field("version", &self.version)
+                // FIXME: .field("machine", &self.machine)
+                // FIXME: .field("domainname", &self.domainname)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for utsname {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sysname.hash(state);
+                self.nodename.hash(state);
+                self.release.hash(state);
+                self.version.hash(state);
+                self.machine.hash(state);
+                self.domainname.hash(state);
+            }
+        }
+
+        impl PartialEq for sigevent {
+            fn eq(&self, other: &sigevent) -> bool {
+                self.sigev_value == other.sigev_value
+                    && self.sigev_signo == other.sigev_signo
+                    && self.sigev_notify == other.sigev_notify
+                    && self.sigev_notify_thread_id
+                        == other.sigev_notify_thread_id
+            }
+        }
+        impl Eq for sigevent {}
+        impl ::fmt::Debug for sigevent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sigevent")
+                    .field("sigev_value", &self.sigev_value)
+                    .field("sigev_signo", &self.sigev_signo)
+                    .field("sigev_notify", &self.sigev_notify)
+                    .field("sigev_notify_thread_id",
+                           &self.sigev_notify_thread_id)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sigevent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sigev_value.hash(state);
+                self.sigev_signo.hash(state);
+                self.sigev_notify.hash(state);
+                self.sigev_notify_thread_id.hash(state);
+            }
+        }
+    }
+}
+
+// intentionally not public, only used for fd_set
+cfg_if! {
+    if #[cfg(target_pointer_width = "32")] {
+        const ULONG_SIZE: usize = 32;
+    } else if #[cfg(target_pointer_width = "64")] {
+        const ULONG_SIZE: usize = 64;
+    } else {
+        // Unknown target_pointer_width
+    }
+}
+
+pub const EXIT_FAILURE: ::c_int = 1;
+pub const EXIT_SUCCESS: ::c_int = 0;
+pub const RAND_MAX: ::c_int = 2147483647;
+pub const EOF: ::c_int = -1;
+pub const SEEK_SET: ::c_int = 0;
+pub const SEEK_CUR: ::c_int = 1;
+pub const SEEK_END: ::c_int = 2;
+pub const _IOFBF: ::c_int = 0;
+pub const _IONBF: ::c_int = 2;
+pub const _IOLBF: ::c_int = 1;
+
+pub const F_DUPFD: ::c_int = 0;
+pub const F_GETFD: ::c_int = 1;
+pub const F_SETFD: ::c_int = 2;
+pub const F_GETFL: ::c_int = 3;
+pub const F_SETFL: ::c_int = 4;
+
+// Linux-specific fcntls
+pub const F_SETLEASE: ::c_int = 1024;
+pub const F_GETLEASE: ::c_int = 1025;
+pub const F_NOTIFY: ::c_int = 1026;
+pub const F_CANCELLK: ::c_int = 1029;
+pub const F_DUPFD_CLOEXEC: ::c_int = 1030;
+pub const F_SETPIPE_SZ: ::c_int = 1031;
+pub const F_GETPIPE_SZ: ::c_int = 1032;
+pub const F_ADD_SEALS: ::c_int = 1033;
+pub const F_GET_SEALS: ::c_int = 1034;
+
+pub const F_SEAL_SEAL: ::c_int = 0x0001;
+pub const F_SEAL_SHRINK: ::c_int = 0x0002;
+pub const F_SEAL_GROW: ::c_int = 0x0004;
+pub const F_SEAL_WRITE: ::c_int = 0x0008;
+
+// FIXME(#235): Include file sealing fcntls once we have a way to verify them.
+
+pub const SIGTRAP: ::c_int = 5;
+
+pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
+pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
+
+pub const CLOCK_REALTIME: ::clockid_t = 0;
+pub const CLOCK_MONOTONIC: ::clockid_t = 1;
+pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
+pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 3;
+pub const CLOCK_MONOTONIC_RAW: ::clockid_t = 4;
+pub const CLOCK_REALTIME_COARSE: ::clockid_t = 5;
+pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = 6;
+pub const CLOCK_BOOTTIME: ::clockid_t = 7;
+pub const CLOCK_REALTIME_ALARM: ::clockid_t = 8;
+pub const CLOCK_BOOTTIME_ALARM: ::clockid_t = 9;
+pub const CLOCK_TAI: ::clockid_t = 11;
+pub const TIMER_ABSTIME: ::c_int = 1;
+
+pub const RUSAGE_SELF: ::c_int = 0;
+
+pub const O_RDONLY: ::c_int = 0;
+pub const O_WRONLY: ::c_int = 1;
+pub const O_RDWR: ::c_int = 2;
+
+pub const SOCK_CLOEXEC: ::c_int = O_CLOEXEC;
+
+pub const S_IFIFO: ::mode_t = 4096;
+pub const S_IFCHR: ::mode_t = 8192;
+pub const S_IFBLK: ::mode_t = 24576;
+pub const S_IFDIR: ::mode_t = 16384;
+pub const S_IFREG: ::mode_t = 32768;
+pub const S_IFLNK: ::mode_t = 40960;
+pub const S_IFSOCK: ::mode_t = 49152;
+pub const S_IFMT: ::mode_t = 61440;
+pub const S_IRWXU: ::mode_t = 448;
+pub const S_IXUSR: ::mode_t = 64;
+pub const S_IWUSR: ::mode_t = 128;
+pub const S_IRUSR: ::mode_t = 256;
+pub const S_IRWXG: ::mode_t = 56;
+pub const S_IXGRP: ::mode_t = 8;
+pub const S_IWGRP: ::mode_t = 16;
+pub const S_IRGRP: ::mode_t = 32;
+pub const S_IRWXO: ::mode_t = 7;
+pub const S_IXOTH: ::mode_t = 1;
+pub const S_IWOTH: ::mode_t = 2;
+pub const S_IROTH: ::mode_t = 4;
+pub const F_OK: ::c_int = 0;
+pub const R_OK: ::c_int = 4;
+pub const W_OK: ::c_int = 2;
+pub const X_OK: ::c_int = 1;
+pub const STDIN_FILENO: ::c_int = 0;
+pub const STDOUT_FILENO: ::c_int = 1;
+pub const STDERR_FILENO: ::c_int = 2;
+pub const SIGHUP: ::c_int = 1;
+pub const SIGINT: ::c_int = 2;
+pub const SIGQUIT: ::c_int = 3;
+pub const SIGILL: ::c_int = 4;
+pub const SIGABRT: ::c_int = 6;
+pub const SIGFPE: ::c_int = 8;
+pub const SIGKILL: ::c_int = 9;
+pub const SIGSEGV: ::c_int = 11;
+pub const SIGPIPE: ::c_int = 13;
+pub const SIGALRM: ::c_int = 14;
+pub const SIGTERM: ::c_int = 15;
+
+pub const PROT_NONE: ::c_int = 0;
+pub const PROT_READ: ::c_int = 1;
+pub const PROT_WRITE: ::c_int = 2;
+pub const PROT_EXEC: ::c_int = 4;
+
+pub const XATTR_CREATE: ::c_int = 0x1;
+pub const XATTR_REPLACE: ::c_int = 0x2;
+
+cfg_if! {
+    if #[cfg(target_os = "android")] {
+        pub const RLIM64_INFINITY: ::c_ulonglong = !0;
+    } else {
+        pub const RLIM64_INFINITY: ::rlim64_t = !0;
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_env = "ohos")] {
+        pub const LC_CTYPE: ::c_int = 0;
+        pub const LC_NUMERIC: ::c_int = 1;
+        pub const LC_TIME: ::c_int = 2;
+        pub const LC_COLLATE: ::c_int = 3;
+        pub const LC_MONETARY: ::c_int = 4;
+        pub const LC_MESSAGES: ::c_int = 5;
+        pub const LC_PAPER: ::c_int = 6;
+        pub const LC_NAME: ::c_int = 7;
+        pub const LC_ADDRESS: ::c_int = 8;
+        pub const LC_TELEPHONE: ::c_int = 9;
+        pub const LC_MEASUREMENT: ::c_int = 10;
+        pub const LC_IDENTIFICATION: ::c_int = 11;
+        pub const LC_ALL: ::c_int = 12;
+    } else if #[cfg(not(target_env = "uclibc"))] {
+        pub const LC_CTYPE: ::c_int = 0;
+        pub const LC_NUMERIC: ::c_int = 1;
+        pub const LC_TIME: ::c_int = 2;
+        pub const LC_COLLATE: ::c_int = 3;
+        pub const LC_MONETARY: ::c_int = 4;
+        pub const LC_MESSAGES: ::c_int = 5;
+        pub const LC_ALL: ::c_int = 6;
+    }
+}
+
+pub const LC_CTYPE_MASK: ::c_int = 1 << LC_CTYPE;
+pub const LC_NUMERIC_MASK: ::c_int = 1 << LC_NUMERIC;
+pub const LC_TIME_MASK: ::c_int = 1 << LC_TIME;
+pub const LC_COLLATE_MASK: ::c_int = 1 << LC_COLLATE;
+pub const LC_MONETARY_MASK: ::c_int = 1 << LC_MONETARY;
+pub const LC_MESSAGES_MASK: ::c_int = 1 << LC_MESSAGES;
+// LC_ALL_MASK defined per platform
+
+pub const MAP_FILE: ::c_int = 0x0000;
+pub const MAP_SHARED: ::c_int = 0x0001;
+pub const MAP_PRIVATE: ::c_int = 0x0002;
+pub const MAP_FIXED: ::c_int = 0x0010;
+
+pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
+
+// MS_ flags for msync(2)
+pub const MS_ASYNC: ::c_int = 0x0001;
+pub const MS_INVALIDATE: ::c_int = 0x0002;
+pub const MS_SYNC: ::c_int = 0x0004;
+
+// MS_ flags for mount(2)
+pub const MS_RDONLY: ::c_ulong = 0x01;
+pub const MS_NOSUID: ::c_ulong = 0x02;
+pub const MS_NODEV: ::c_ulong = 0x04;
+pub const MS_NOEXEC: ::c_ulong = 0x08;
+pub const MS_SYNCHRONOUS: ::c_ulong = 0x10;
+pub const MS_REMOUNT: ::c_ulong = 0x20;
+pub const MS_MANDLOCK: ::c_ulong = 0x40;
+pub const MS_DIRSYNC: ::c_ulong = 0x80;
+pub const MS_NOATIME: ::c_ulong = 0x0400;
+pub const MS_NODIRATIME: ::c_ulong = 0x0800;
+pub const MS_BIND: ::c_ulong = 0x1000;
+pub const MS_MOVE: ::c_ulong = 0x2000;
+pub const MS_REC: ::c_ulong = 0x4000;
+pub const MS_SILENT: ::c_ulong = 0x8000;
+pub const MS_POSIXACL: ::c_ulong = 0x010000;
+pub const MS_UNBINDABLE: ::c_ulong = 0x020000;
+pub const MS_PRIVATE: ::c_ulong = 0x040000;
+pub const MS_SLAVE: ::c_ulong = 0x080000;
+pub const MS_SHARED: ::c_ulong = 0x100000;
+pub const MS_RELATIME: ::c_ulong = 0x200000;
+pub const MS_KERNMOUNT: ::c_ulong = 0x400000;
+pub const MS_I_VERSION: ::c_ulong = 0x800000;
+pub const MS_STRICTATIME: ::c_ulong = 0x1000000;
+pub const MS_LAZYTIME: ::c_ulong = 0x2000000;
+pub const MS_ACTIVE: ::c_ulong = 0x40000000;
+pub const MS_MGC_VAL: ::c_ulong = 0xc0ed0000;
+pub const MS_MGC_MSK: ::c_ulong = 0xffff0000;
+
+pub const SCM_RIGHTS: ::c_int = 0x01;
+pub const SCM_CREDENTIALS: ::c_int = 0x02;
+
+pub const PROT_GROWSDOWN: ::c_int = 0x1000000;
+pub const PROT_GROWSUP: ::c_int = 0x2000000;
+
+pub const MAP_TYPE: ::c_int = 0x000f;
+
+pub const MADV_NORMAL: ::c_int = 0;
+pub const MADV_RANDOM: ::c_int = 1;
+pub const MADV_SEQUENTIAL: ::c_int = 2;
+pub const MADV_WILLNEED: ::c_int = 3;
+pub const MADV_DONTNEED: ::c_int = 4;
+pub const MADV_FREE: ::c_int = 8;
+pub const MADV_REMOVE: ::c_int = 9;
+pub const MADV_DONTFORK: ::c_int = 10;
+pub const MADV_DOFORK: ::c_int = 11;
+pub const MADV_MERGEABLE: ::c_int = 12;
+pub const MADV_UNMERGEABLE: ::c_int = 13;
+pub const MADV_HUGEPAGE: ::c_int = 14;
+pub const MADV_NOHUGEPAGE: ::c_int = 15;
+pub const MADV_DONTDUMP: ::c_int = 16;
+pub const MADV_DODUMP: ::c_int = 17;
+pub const MADV_WIPEONFORK: ::c_int = 18;
+pub const MADV_KEEPONFORK: ::c_int = 19;
+pub const MADV_COLD: ::c_int = 20;
+pub const MADV_PAGEOUT: ::c_int = 21;
+pub const MADV_HWPOISON: ::c_int = 100;
+cfg_if! {
+    if #[cfg(not(target_os = "emscripten"))] {
+        pub const MADV_POPULATE_READ: ::c_int = 22;
+        pub const MADV_POPULATE_WRITE: ::c_int = 23;
+        pub const MADV_DONTNEED_LOCKED: ::c_int = 24;
+    }
+}
+
+pub const IFF_UP: ::c_int = 0x1;
+pub const IFF_BROADCAST: ::c_int = 0x2;
+pub const IFF_DEBUG: ::c_int = 0x4;
+pub const IFF_LOOPBACK: ::c_int = 0x8;
+pub const IFF_POINTOPOINT: ::c_int = 0x10;
+pub const IFF_NOTRAILERS: ::c_int = 0x20;
+pub const IFF_RUNNING: ::c_int = 0x40;
+pub const IFF_NOARP: ::c_int = 0x80;
+pub const IFF_PROMISC: ::c_int = 0x100;
+pub const IFF_ALLMULTI: ::c_int = 0x200;
+pub const IFF_MASTER: ::c_int = 0x400;
+pub const IFF_SLAVE: ::c_int = 0x800;
+pub const IFF_MULTICAST: ::c_int = 0x1000;
+pub const IFF_PORTSEL: ::c_int = 0x2000;
+pub const IFF_AUTOMEDIA: ::c_int = 0x4000;
+pub const IFF_DYNAMIC: ::c_int = 0x8000;
+
+pub const SOL_IP: ::c_int = 0;
+pub const SOL_TCP: ::c_int = 6;
+pub const SOL_UDP: ::c_int = 17;
+pub const SOL_IPV6: ::c_int = 41;
+pub const SOL_ICMPV6: ::c_int = 58;
+pub const SOL_RAW: ::c_int = 255;
+pub const SOL_DECNET: ::c_int = 261;
+pub const SOL_X25: ::c_int = 262;
+pub const SOL_PACKET: ::c_int = 263;
+pub const SOL_ATM: ::c_int = 264;
+pub const SOL_AAL: ::c_int = 265;
+pub const SOL_IRDA: ::c_int = 266;
+pub const SOL_NETBEUI: ::c_int = 267;
+pub const SOL_LLC: ::c_int = 268;
+pub const SOL_DCCP: ::c_int = 269;
+pub const SOL_NETLINK: ::c_int = 270;
+pub const SOL_TIPC: ::c_int = 271;
+pub const SOL_BLUETOOTH: ::c_int = 274;
+pub const SOL_ALG: ::c_int = 279;
+
+pub const AF_UNSPEC: ::c_int = 0;
+pub const AF_UNIX: ::c_int = 1;
+pub const AF_LOCAL: ::c_int = 1;
+pub const AF_INET: ::c_int = 2;
+pub const AF_AX25: ::c_int = 3;
+pub const AF_IPX: ::c_int = 4;
+pub const AF_APPLETALK: ::c_int = 5;
+pub const AF_NETROM: ::c_int = 6;
+pub const AF_BRIDGE: ::c_int = 7;
+pub const AF_ATMPVC: ::c_int = 8;
+pub const AF_X25: ::c_int = 9;
+pub const AF_INET6: ::c_int = 10;
+pub const AF_ROSE: ::c_int = 11;
+pub const AF_DECnet: ::c_int = 12;
+pub const AF_NETBEUI: ::c_int = 13;
+pub const AF_SECURITY: ::c_int = 14;
+pub const AF_KEY: ::c_int = 15;
+pub const AF_NETLINK: ::c_int = 16;
+pub const AF_ROUTE: ::c_int = AF_NETLINK;
+pub const AF_PACKET: ::c_int = 17;
+pub const AF_ASH: ::c_int = 18;
+pub const AF_ECONET: ::c_int = 19;
+pub const AF_ATMSVC: ::c_int = 20;
+pub const AF_RDS: ::c_int = 21;
+pub const AF_SNA: ::c_int = 22;
+pub const AF_IRDA: ::c_int = 23;
+pub const AF_PPPOX: ::c_int = 24;
+pub const AF_WANPIPE: ::c_int = 25;
+pub const AF_LLC: ::c_int = 26;
+pub const AF_CAN: ::c_int = 29;
+pub const AF_TIPC: ::c_int = 30;
+pub const AF_BLUETOOTH: ::c_int = 31;
+pub const AF_IUCV: ::c_int = 32;
+pub const AF_RXRPC: ::c_int = 33;
+pub const AF_ISDN: ::c_int = 34;
+pub const AF_PHONET: ::c_int = 35;
+pub const AF_IEEE802154: ::c_int = 36;
+pub const AF_CAIF: ::c_int = 37;
+pub const AF_ALG: ::c_int = 38;
+
+pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
+pub const PF_UNIX: ::c_int = AF_UNIX;
+pub const PF_LOCAL: ::c_int = AF_LOCAL;
+pub const PF_INET: ::c_int = AF_INET;
+pub const PF_AX25: ::c_int = AF_AX25;
+pub const PF_IPX: ::c_int = AF_IPX;
+pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
+pub const PF_NETROM: ::c_int = AF_NETROM;
+pub const PF_BRIDGE: ::c_int = AF_BRIDGE;
+pub const PF_ATMPVC: ::c_int = AF_ATMPVC;
+pub const PF_X25: ::c_int = AF_X25;
+pub const PF_INET6: ::c_int = AF_INET6;
+pub const PF_ROSE: ::c_int = AF_ROSE;
+pub const PF_DECnet: ::c_int = AF_DECnet;
+pub const PF_NETBEUI: ::c_int = AF_NETBEUI;
+pub const PF_SECURITY: ::c_int = AF_SECURITY;
+pub const PF_KEY: ::c_int = AF_KEY;
+pub const PF_NETLINK: ::c_int = AF_NETLINK;
+pub const PF_ROUTE: ::c_int = AF_ROUTE;
+pub const PF_PACKET: ::c_int = AF_PACKET;
+pub const PF_ASH: ::c_int = AF_ASH;
+pub const PF_ECONET: ::c_int = AF_ECONET;
+pub const PF_ATMSVC: ::c_int = AF_ATMSVC;
+pub const PF_RDS: ::c_int = AF_RDS;
+pub const PF_SNA: ::c_int = AF_SNA;
+pub const PF_IRDA: ::c_int = AF_IRDA;
+pub const PF_PPPOX: ::c_int = AF_PPPOX;
+pub const PF_WANPIPE: ::c_int = AF_WANPIPE;
+pub const PF_LLC: ::c_int = AF_LLC;
+pub const PF_CAN: ::c_int = AF_CAN;
+pub const PF_TIPC: ::c_int = AF_TIPC;
+pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
+pub const PF_IUCV: ::c_int = AF_IUCV;
+pub const PF_RXRPC: ::c_int = AF_RXRPC;
+pub const PF_ISDN: ::c_int = AF_ISDN;
+pub const PF_PHONET: ::c_int = AF_PHONET;
+pub const PF_IEEE802154: ::c_int = AF_IEEE802154;
+pub const PF_CAIF: ::c_int = AF_CAIF;
+pub const PF_ALG: ::c_int = AF_ALG;
+
+pub const MSG_OOB: ::c_int = 1;
+pub const MSG_PEEK: ::c_int = 2;
+pub const MSG_DONTROUTE: ::c_int = 4;
+pub const MSG_CTRUNC: ::c_int = 8;
+pub const MSG_TRUNC: ::c_int = 0x20;
+pub const MSG_DONTWAIT: ::c_int = 0x40;
+pub const MSG_EOR: ::c_int = 0x80;
+pub const MSG_WAITALL: ::c_int = 0x100;
+pub const MSG_FIN: ::c_int = 0x200;
+pub const MSG_SYN: ::c_int = 0x400;
+pub const MSG_CONFIRM: ::c_int = 0x800;
+pub const MSG_RST: ::c_int = 0x1000;
+pub const MSG_ERRQUEUE: ::c_int = 0x2000;
+pub const MSG_NOSIGNAL: ::c_int = 0x4000;
+pub const MSG_MORE: ::c_int = 0x8000;
+pub const MSG_WAITFORONE: ::c_int = 0x10000;
+pub const MSG_FASTOPEN: ::c_int = 0x20000000;
+pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000;
+
+pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
+
+pub const SOCK_RAW: ::c_int = 3;
+pub const SOCK_RDM: ::c_int = 4;
+pub const IP_TOS: ::c_int = 1;
+pub const IP_TTL: ::c_int = 2;
+pub const IP_HDRINCL: ::c_int = 3;
+pub const IP_OPTIONS: ::c_int = 4;
+pub const IP_ROUTER_ALERT: ::c_int = 5;
+pub const IP_RECVOPTS: ::c_int = 6;
+pub const IP_RETOPTS: ::c_int = 7;
+pub const IP_PKTINFO: ::c_int = 8;
+pub const IP_PKTOPTIONS: ::c_int = 9;
+pub const IP_MTU_DISCOVER: ::c_int = 10;
+pub const IP_RECVERR: ::c_int = 11;
+pub const IP_RECVTTL: ::c_int = 12;
+pub const IP_RECVTOS: ::c_int = 13;
+pub const IP_MTU: ::c_int = 14;
+pub const IP_FREEBIND: ::c_int = 15;
+pub const IP_IPSEC_POLICY: ::c_int = 16;
+pub const IP_XFRM_POLICY: ::c_int = 17;
+pub const IP_PASSSEC: ::c_int = 18;
+pub const IP_TRANSPARENT: ::c_int = 19;
+pub const IP_ORIGDSTADDR: ::c_int = 20;
+pub const IP_RECVORIGDSTADDR: ::c_int = IP_ORIGDSTADDR;
+pub const IP_MINTTL: ::c_int = 21;
+pub const IP_NODEFRAG: ::c_int = 22;
+pub const IP_CHECKSUM: ::c_int = 23;
+pub const IP_BIND_ADDRESS_NO_PORT: ::c_int = 24;
+pub const IP_MULTICAST_IF: ::c_int = 32;
+pub const IP_MULTICAST_TTL: ::c_int = 33;
+pub const IP_MULTICAST_LOOP: ::c_int = 34;
+pub const IP_ADD_MEMBERSHIP: ::c_int = 35;
+pub const IP_DROP_MEMBERSHIP: ::c_int = 36;
+pub const IP_UNBLOCK_SOURCE: ::c_int = 37;
+pub const IP_BLOCK_SOURCE: ::c_int = 38;
+pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 39;
+pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 40;
+pub const IP_MSFILTER: ::c_int = 41;
+pub const IP_MULTICAST_ALL: ::c_int = 49;
+pub const IP_UNICAST_IF: ::c_int = 50;
+
+pub const IP_DEFAULT_MULTICAST_TTL: ::c_int = 1;
+pub const IP_DEFAULT_MULTICAST_LOOP: ::c_int = 1;
+
+pub const IP_PMTUDISC_DONT: ::c_int = 0;
+pub const IP_PMTUDISC_WANT: ::c_int = 1;
+pub const IP_PMTUDISC_DO: ::c_int = 2;
+pub const IP_PMTUDISC_PROBE: ::c_int = 3;
+pub const IP_PMTUDISC_INTERFACE: ::c_int = 4;
+pub const IP_PMTUDISC_OMIT: ::c_int = 5;
+
+// IPPROTO_IP defined in src/unix/mod.rs
+/// Hop-by-hop option header
+pub const IPPROTO_HOPOPTS: ::c_int = 0;
+// IPPROTO_ICMP defined in src/unix/mod.rs
+/// group mgmt protocol
+pub const IPPROTO_IGMP: ::c_int = 2;
+/// for compatibility
+pub const IPPROTO_IPIP: ::c_int = 4;
+// IPPROTO_TCP defined in src/unix/mod.rs
+/// exterior gateway protocol
+pub const IPPROTO_EGP: ::c_int = 8;
+/// pup
+pub const IPPROTO_PUP: ::c_int = 12;
+// IPPROTO_UDP defined in src/unix/mod.rs
+/// xns idp
+pub const IPPROTO_IDP: ::c_int = 22;
+/// tp-4 w/ class negotiation
+pub const IPPROTO_TP: ::c_int = 29;
+/// DCCP
+pub const IPPROTO_DCCP: ::c_int = 33;
+// IPPROTO_IPV6 defined in src/unix/mod.rs
+/// IP6 routing header
+pub const IPPROTO_ROUTING: ::c_int = 43;
+/// IP6 fragmentation header
+pub const IPPROTO_FRAGMENT: ::c_int = 44;
+/// resource reservation
+pub const IPPROTO_RSVP: ::c_int = 46;
+/// General Routing Encap.
+pub const IPPROTO_GRE: ::c_int = 47;
+/// IP6 Encap Sec. Payload
+pub const IPPROTO_ESP: ::c_int = 50;
+/// IP6 Auth Header
+pub const IPPROTO_AH: ::c_int = 51;
+// IPPROTO_ICMPV6 defined in src/unix/mod.rs
+/// IP6 no next header
+pub const IPPROTO_NONE: ::c_int = 59;
+/// IP6 destination option
+pub const IPPROTO_DSTOPTS: ::c_int = 60;
+pub const IPPROTO_MTP: ::c_int = 92;
+/// encapsulation header
+pub const IPPROTO_ENCAP: ::c_int = 98;
+/// Protocol indep. multicast
+pub const IPPROTO_PIM: ::c_int = 103;
+/// IP Payload Comp. Protocol
+pub const IPPROTO_COMP: ::c_int = 108;
+/// SCTP
+pub const IPPROTO_SCTP: ::c_int = 132;
+pub const IPPROTO_MH: ::c_int = 135;
+pub const IPPROTO_UDPLITE: ::c_int = 136;
+/// raw IP packet
+pub const IPPROTO_RAW: ::c_int = 255;
+pub const IPPROTO_BEETPH: ::c_int = 94;
+pub const IPPROTO_MPLS: ::c_int = 137;
+/// Multipath TCP
+pub const IPPROTO_MPTCP: ::c_int = 262;
+/// Ethernet-within-IPv6 encapsulation.
+pub const IPPROTO_ETHERNET: ::c_int = 143;
+
+pub const MCAST_EXCLUDE: ::c_int = 0;
+pub const MCAST_INCLUDE: ::c_int = 1;
+pub const MCAST_JOIN_GROUP: ::c_int = 42;
+pub const MCAST_BLOCK_SOURCE: ::c_int = 43;
+pub const MCAST_UNBLOCK_SOURCE: ::c_int = 44;
+pub const MCAST_LEAVE_GROUP: ::c_int = 45;
+pub const MCAST_JOIN_SOURCE_GROUP: ::c_int = 46;
+pub const MCAST_LEAVE_SOURCE_GROUP: ::c_int = 47;
+pub const MCAST_MSFILTER: ::c_int = 48;
+
+pub const IPV6_ADDRFORM: ::c_int = 1;
+pub const IPV6_2292PKTINFO: ::c_int = 2;
+pub const IPV6_2292HOPOPTS: ::c_int = 3;
+pub const IPV6_2292DSTOPTS: ::c_int = 4;
+pub const IPV6_2292RTHDR: ::c_int = 5;
+pub const IPV6_2292PKTOPTIONS: ::c_int = 6;
+pub const IPV6_CHECKSUM: ::c_int = 7;
+pub const IPV6_2292HOPLIMIT: ::c_int = 8;
+pub const IPV6_NEXTHOP: ::c_int = 9;
+pub const IPV6_AUTHHDR: ::c_int = 10;
+pub const IPV6_UNICAST_HOPS: ::c_int = 16;
+pub const IPV6_MULTICAST_IF: ::c_int = 17;
+pub const IPV6_MULTICAST_HOPS: ::c_int = 18;
+pub const IPV6_MULTICAST_LOOP: ::c_int = 19;
+pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20;
+pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21;
+pub const IPV6_ROUTER_ALERT: ::c_int = 22;
+pub const IPV6_MTU_DISCOVER: ::c_int = 23;
+pub const IPV6_MTU: ::c_int = 24;
+pub const IPV6_RECVERR: ::c_int = 25;
+pub const IPV6_V6ONLY: ::c_int = 26;
+pub const IPV6_JOIN_ANYCAST: ::c_int = 27;
+pub const IPV6_LEAVE_ANYCAST: ::c_int = 28;
+pub const IPV6_IPSEC_POLICY: ::c_int = 34;
+pub const IPV6_XFRM_POLICY: ::c_int = 35;
+pub const IPV6_HDRINCL: ::c_int = 36;
+pub const IPV6_RECVPKTINFO: ::c_int = 49;
+pub const IPV6_PKTINFO: ::c_int = 50;
+pub const IPV6_RECVHOPLIMIT: ::c_int = 51;
+pub const IPV6_HOPLIMIT: ::c_int = 52;
+pub const IPV6_RECVHOPOPTS: ::c_int = 53;
+pub const IPV6_HOPOPTS: ::c_int = 54;
+pub const IPV6_RTHDRDSTOPTS: ::c_int = 55;
+pub const IPV6_RECVRTHDR: ::c_int = 56;
+pub const IPV6_RTHDR: ::c_int = 57;
+pub const IPV6_RECVDSTOPTS: ::c_int = 58;
+pub const IPV6_DSTOPTS: ::c_int = 59;
+pub const IPV6_RECVPATHMTU: ::c_int = 60;
+pub const IPV6_PATHMTU: ::c_int = 61;
+pub const IPV6_DONTFRAG: ::c_int = 62;
+pub const IPV6_RECVTCLASS: ::c_int = 66;
+pub const IPV6_TCLASS: ::c_int = 67;
+pub const IPV6_AUTOFLOWLABEL: ::c_int = 70;
+pub const IPV6_ADDR_PREFERENCES: ::c_int = 72;
+pub const IPV6_MINHOPCOUNT: ::c_int = 73;
+pub const IPV6_ORIGDSTADDR: ::c_int = 74;
+pub const IPV6_RECVORIGDSTADDR: ::c_int = IPV6_ORIGDSTADDR;
+pub const IPV6_TRANSPARENT: ::c_int = 75;
+pub const IPV6_UNICAST_IF: ::c_int = 76;
+pub const IPV6_PREFER_SRC_TMP: ::c_int = 0x0001;
+pub const IPV6_PREFER_SRC_PUBLIC: ::c_int = 0x0002;
+pub const IPV6_PREFER_SRC_PUBTMP_DEFAULT: ::c_int = 0x0100;
+pub const IPV6_PREFER_SRC_COA: ::c_int = 0x0004;
+pub const IPV6_PREFER_SRC_HOME: ::c_int = 0x0400;
+pub const IPV6_PREFER_SRC_CGA: ::c_int = 0x0008;
+pub const IPV6_PREFER_SRC_NONCGA: ::c_int = 0x0800;
+
+pub const IPV6_PMTUDISC_DONT: ::c_int = 0;
+pub const IPV6_PMTUDISC_WANT: ::c_int = 1;
+pub const IPV6_PMTUDISC_DO: ::c_int = 2;
+pub const IPV6_PMTUDISC_PROBE: ::c_int = 3;
+pub const IPV6_PMTUDISC_INTERFACE: ::c_int = 4;
+pub const IPV6_PMTUDISC_OMIT: ::c_int = 5;
+
+pub const TCP_NODELAY: ::c_int = 1;
+pub const TCP_MAXSEG: ::c_int = 2;
+pub const TCP_CORK: ::c_int = 3;
+pub const TCP_KEEPIDLE: ::c_int = 4;
+pub const TCP_KEEPINTVL: ::c_int = 5;
+pub const TCP_KEEPCNT: ::c_int = 6;
+pub const TCP_SYNCNT: ::c_int = 7;
+pub const TCP_LINGER2: ::c_int = 8;
+pub const TCP_DEFER_ACCEPT: ::c_int = 9;
+pub const TCP_WINDOW_CLAMP: ::c_int = 10;
+pub const TCP_INFO: ::c_int = 11;
+pub const TCP_QUICKACK: ::c_int = 12;
+pub const TCP_CONGESTION: ::c_int = 13;
+pub const TCP_MD5SIG: ::c_int = 14;
+cfg_if! {
+    if #[cfg(all(target_os = "linux", any(
+            target_env = "gnu",
+            target_env = "musl",
+            target_env = "ohos"
+        )))] {
+        // WARN: deprecated
+        pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
+    }
+}
+pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
+pub const TCP_THIN_DUPACK: ::c_int = 17;
+pub const TCP_USER_TIMEOUT: ::c_int = 18;
+pub const TCP_REPAIR: ::c_int = 19;
+pub const TCP_REPAIR_QUEUE: ::c_int = 20;
+pub const TCP_QUEUE_SEQ: ::c_int = 21;
+pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
+pub const TCP_FASTOPEN: ::c_int = 23;
+pub const TCP_TIMESTAMP: ::c_int = 24;
+pub const TCP_NOTSENT_LOWAT: ::c_int = 25;
+pub const TCP_CC_INFO: ::c_int = 26;
+pub const TCP_SAVE_SYN: ::c_int = 27;
+pub const TCP_SAVED_SYN: ::c_int = 28;
+cfg_if! {
+    if #[cfg(not(target_os = "emscripten"))] {
+        // NOTE: emscripten doesn't support these options yet.
+
+        pub const TCP_REPAIR_WINDOW: ::c_int = 29;
+        pub const TCP_FASTOPEN_CONNECT: ::c_int = 30;
+        pub const TCP_ULP: ::c_int = 31;
+        pub const TCP_MD5SIG_EXT: ::c_int = 32;
+        pub const TCP_FASTOPEN_KEY: ::c_int = 33;
+        pub const TCP_FASTOPEN_NO_COOKIE: ::c_int = 34;
+        pub const TCP_ZEROCOPY_RECEIVE: ::c_int = 35;
+        pub const TCP_INQ: ::c_int = 36;
+        pub const TCP_CM_INQ: ::c_int = TCP_INQ;
+        // NOTE: Some CI images doesn't have this option yet.
+        // pub const TCP_TX_DELAY: ::c_int = 37;
+        pub const TCP_MD5SIG_MAXKEYLEN: usize = 80;
+    }
+}
+
+pub const SO_DEBUG: ::c_int = 1;
+
+pub const SHUT_RD: ::c_int = 0;
+pub const SHUT_WR: ::c_int = 1;
+pub const SHUT_RDWR: ::c_int = 2;
+
+pub const LOCK_SH: ::c_int = 1;
+pub const LOCK_EX: ::c_int = 2;
+pub const LOCK_NB: ::c_int = 4;
+pub const LOCK_UN: ::c_int = 8;
+
+pub const SS_ONSTACK: ::c_int = 1;
+pub const SS_DISABLE: ::c_int = 2;
+
+pub const PATH_MAX: ::c_int = 4096;
+
+pub const UIO_MAXIOV: ::c_int = 1024;
+
+pub const FD_SETSIZE: usize = 1024;
+
+pub const EPOLLIN: ::c_int = 0x1;
+pub const EPOLLPRI: ::c_int = 0x2;
+pub const EPOLLOUT: ::c_int = 0x4;
+pub const EPOLLERR: ::c_int = 0x8;
+pub const EPOLLHUP: ::c_int = 0x10;
+pub const EPOLLRDNORM: ::c_int = 0x40;
+pub const EPOLLRDBAND: ::c_int = 0x80;
+pub const EPOLLWRNORM: ::c_int = 0x100;
+pub const EPOLLWRBAND: ::c_int = 0x200;
+pub const EPOLLMSG: ::c_int = 0x400;
+pub const EPOLLRDHUP: ::c_int = 0x2000;
+pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000;
+pub const EPOLLWAKEUP: ::c_int = 0x20000000;
+pub const EPOLLONESHOT: ::c_int = 0x40000000;
+pub const EPOLLET: ::c_int = 0x80000000;
+
+pub const EPOLL_CTL_ADD: ::c_int = 1;
+pub const EPOLL_CTL_MOD: ::c_int = 3;
+pub const EPOLL_CTL_DEL: ::c_int = 2;
+
+pub const MNT_FORCE: ::c_int = 0x1;
+pub const MNT_DETACH: ::c_int = 0x2;
+pub const MNT_EXPIRE: ::c_int = 0x4;
+pub const UMOUNT_NOFOLLOW: ::c_int = 0x8;
+
+pub const Q_GETFMT: ::c_int = 0x800004;
+pub const Q_GETINFO: ::c_int = 0x800005;
+pub const Q_SETINFO: ::c_int = 0x800006;
+pub const QIF_BLIMITS: u32 = 1;
+pub const QIF_SPACE: u32 = 2;
+pub const QIF_ILIMITS: u32 = 4;
+pub const QIF_INODES: u32 = 8;
+pub const QIF_BTIME: u32 = 16;
+pub const QIF_ITIME: u32 = 32;
+pub const QIF_LIMITS: u32 = 5;
+pub const QIF_USAGE: u32 = 10;
+pub const QIF_TIMES: u32 = 48;
+pub const QIF_ALL: u32 = 63;
+
+pub const Q_SYNC: ::c_int = 0x800001;
+pub const Q_QUOTAON: ::c_int = 0x800002;
+pub const Q_QUOTAOFF: ::c_int = 0x800003;
+pub const Q_GETQUOTA: ::c_int = 0x800007;
+pub const Q_SETQUOTA: ::c_int = 0x800008;
+
+pub const TCIOFF: ::c_int = 2;
+pub const TCION: ::c_int = 3;
+pub const TCOOFF: ::c_int = 0;
+pub const TCOON: ::c_int = 1;
+pub const TCIFLUSH: ::c_int = 0;
+pub const TCOFLUSH: ::c_int = 1;
+pub const TCIOFLUSH: ::c_int = 2;
+pub const NL0: ::tcflag_t = 0x00000000;
+pub const NL1: ::tcflag_t = 0x00000100;
+pub const TAB0: ::tcflag_t = 0x00000000;
+pub const CR0: ::tcflag_t = 0x00000000;
+pub const FF0: ::tcflag_t = 0x00000000;
+pub const BS0: ::tcflag_t = 0x00000000;
+pub const VT0: ::tcflag_t = 0x00000000;
+pub const VERASE: usize = 2;
+pub const VKILL: usize = 3;
+pub const VINTR: usize = 0;
+pub const VQUIT: usize = 1;
+pub const VLNEXT: usize = 15;
+pub const IGNBRK: ::tcflag_t = 0x00000001;
+pub const BRKINT: ::tcflag_t = 0x00000002;
+pub const IGNPAR: ::tcflag_t = 0x00000004;
+pub const PARMRK: ::tcflag_t = 0x00000008;
+pub const INPCK: ::tcflag_t = 0x00000010;
+pub const ISTRIP: ::tcflag_t = 0x00000020;
+pub const INLCR: ::tcflag_t = 0x00000040;
+pub const IGNCR: ::tcflag_t = 0x00000080;
+pub const ICRNL: ::tcflag_t = 0x00000100;
+pub const IXANY: ::tcflag_t = 0x00000800;
+pub const IMAXBEL: ::tcflag_t = 0x00002000;
+pub const OPOST: ::tcflag_t = 0x1;
+pub const CS5: ::tcflag_t = 0x00000000;
+pub const CRTSCTS: ::tcflag_t = 0x80000000;
+pub const ECHO: ::tcflag_t = 0x00000008;
+pub const OCRNL: ::tcflag_t = 0o000010;
+pub const ONOCR: ::tcflag_t = 0o000020;
+pub const ONLRET: ::tcflag_t = 0o000040;
+pub const OFILL: ::tcflag_t = 0o000100;
+pub const OFDEL: ::tcflag_t = 0o000200;
+
+pub const CLONE_VM: ::c_int = 0x100;
+pub const CLONE_FS: ::c_int = 0x200;
+pub const CLONE_FILES: ::c_int = 0x400;
+pub const CLONE_SIGHAND: ::c_int = 0x800;
+pub const CLONE_PTRACE: ::c_int = 0x2000;
+pub const CLONE_VFORK: ::c_int = 0x4000;
+pub const CLONE_PARENT: ::c_int = 0x8000;
+pub const CLONE_THREAD: ::c_int = 0x10000;
+pub const CLONE_NEWNS: ::c_int = 0x20000;
+pub const CLONE_SYSVSEM: ::c_int = 0x40000;
+pub const CLONE_SETTLS: ::c_int = 0x80000;
+pub const CLONE_PARENT_SETTID: ::c_int = 0x100000;
+pub const CLONE_CHILD_CLEARTID: ::c_int = 0x200000;
+pub const CLONE_DETACHED: ::c_int = 0x400000;
+pub const CLONE_UNTRACED: ::c_int = 0x800000;
+pub const CLONE_CHILD_SETTID: ::c_int = 0x01000000;
+pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
+pub const CLONE_NEWUTS: ::c_int = 0x04000000;
+pub const CLONE_NEWIPC: ::c_int = 0x08000000;
+pub const CLONE_NEWUSER: ::c_int = 0x10000000;
+pub const CLONE_NEWPID: ::c_int = 0x20000000;
+pub const CLONE_NEWNET: ::c_int = 0x40000000;
+pub const CLONE_IO: ::c_int = 0x80000000;
+
+pub const WNOHANG: ::c_int = 0x00000001;
+pub const WUNTRACED: ::c_int = 0x00000002;
+pub const WSTOPPED: ::c_int = WUNTRACED;
+pub const WEXITED: ::c_int = 0x00000004;
+pub const WCONTINUED: ::c_int = 0x00000008;
+pub const WNOWAIT: ::c_int = 0x01000000;
+
+// Options for personality(2).
+pub const ADDR_NO_RANDOMIZE: ::c_int = 0x0040000;
+pub const MMAP_PAGE_ZERO: ::c_int = 0x0100000;
+pub const ADDR_COMPAT_LAYOUT: ::c_int = 0x0200000;
+pub const READ_IMPLIES_EXEC: ::c_int = 0x0400000;
+pub const ADDR_LIMIT_32BIT: ::c_int = 0x0800000;
+pub const SHORT_INODE: ::c_int = 0x1000000;
+pub const WHOLE_SECONDS: ::c_int = 0x2000000;
+pub const STICKY_TIMEOUTS: ::c_int = 0x4000000;
+pub const ADDR_LIMIT_3GB: ::c_int = 0x8000000;
+
+// Options set using PTRACE_SETOPTIONS.
+pub const PTRACE_O_TRACESYSGOOD: ::c_int = 0x00000001;
+pub const PTRACE_O_TRACEFORK: ::c_int = 0x00000002;
+pub const PTRACE_O_TRACEVFORK: ::c_int = 0x00000004;
+pub const PTRACE_O_TRACECLONE: ::c_int = 0x00000008;
+pub const PTRACE_O_TRACEEXEC: ::c_int = 0x00000010;
+pub const PTRACE_O_TRACEVFORKDONE: ::c_int = 0x00000020;
+pub const PTRACE_O_TRACEEXIT: ::c_int = 0x00000040;
+pub const PTRACE_O_TRACESECCOMP: ::c_int = 0x00000080;
+pub const PTRACE_O_SUSPEND_SECCOMP: ::c_int = 0x00200000;
+pub const PTRACE_O_EXITKILL: ::c_int = 0x00100000;
+pub const PTRACE_O_MASK: ::c_int = 0x003000ff;
+
+// Wait extended result codes for the above trace options.
+pub const PTRACE_EVENT_FORK: ::c_int = 1;
+pub const PTRACE_EVENT_VFORK: ::c_int = 2;
+pub const PTRACE_EVENT_CLONE: ::c_int = 3;
+pub const PTRACE_EVENT_EXEC: ::c_int = 4;
+pub const PTRACE_EVENT_VFORK_DONE: ::c_int = 5;
+pub const PTRACE_EVENT_EXIT: ::c_int = 6;
+pub const PTRACE_EVENT_SECCOMP: ::c_int = 7;
+
+pub const __WNOTHREAD: ::c_int = 0x20000000;
+pub const __WALL: ::c_int = 0x40000000;
+pub const __WCLONE: ::c_int = 0x80000000;
+
+pub const SPLICE_F_MOVE: ::c_uint = 0x01;
+pub const SPLICE_F_NONBLOCK: ::c_uint = 0x02;
+pub const SPLICE_F_MORE: ::c_uint = 0x04;
+pub const SPLICE_F_GIFT: ::c_uint = 0x08;
+
+pub const RTLD_LOCAL: ::c_int = 0;
+pub const RTLD_LAZY: ::c_int = 1;
+
+pub const POSIX_FADV_NORMAL: ::c_int = 0;
+pub const POSIX_FADV_RANDOM: ::c_int = 1;
+pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
+pub const POSIX_FADV_WILLNEED: ::c_int = 3;
+
+pub const AT_FDCWD: ::c_int = -100;
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x100;
+pub const AT_REMOVEDIR: ::c_int = 0x200;
+pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
+pub const AT_NO_AUTOMOUNT: ::c_int = 0x800;
+pub const AT_EMPTY_PATH: ::c_int = 0x1000;
+pub const AT_RECURSIVE: ::c_int = 0x8000;
+
+pub const LOG_CRON: ::c_int = 9 << 3;
+pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
+pub const LOG_FTP: ::c_int = 11 << 3;
+pub const LOG_PERROR: ::c_int = 0x20;
+
+pub const PIPE_BUF: usize = 4096;
+
+pub const SI_LOAD_SHIFT: ::c_uint = 16;
+
+// si_code values for SIGBUS signal
+pub const BUS_ADRALN: ::c_int = 1;
+pub const BUS_ADRERR: ::c_int = 2;
+pub const BUS_OBJERR: ::c_int = 3;
+// Linux-specific si_code values for SIGBUS signal
+pub const BUS_MCEERR_AR: ::c_int = 4;
+pub const BUS_MCEERR_AO: ::c_int = 5;
+
+// si_code values for SIGCHLD signal
+pub const CLD_EXITED: ::c_int = 1;
+pub const CLD_KILLED: ::c_int = 2;
+pub const CLD_DUMPED: ::c_int = 3;
+pub const CLD_TRAPPED: ::c_int = 4;
+pub const CLD_STOPPED: ::c_int = 5;
+pub const CLD_CONTINUED: ::c_int = 6;
+
+pub const SIGEV_SIGNAL: ::c_int = 0;
+pub const SIGEV_NONE: ::c_int = 1;
+pub const SIGEV_THREAD: ::c_int = 2;
+
+pub const P_ALL: idtype_t = 0;
+pub const P_PID: idtype_t = 1;
+pub const P_PGID: idtype_t = 2;
+cfg_if! {
+    if #[cfg(not(target_os = "emscripten"))] {
+        pub const P_PIDFD: idtype_t = 3;
+    }
+}
+
+pub const UTIME_OMIT: c_long = 1073741822;
+pub const UTIME_NOW: c_long = 1073741823;
+
+pub const POLLIN: ::c_short = 0x1;
+pub const POLLPRI: ::c_short = 0x2;
+pub const POLLOUT: ::c_short = 0x4;
+pub const POLLERR: ::c_short = 0x8;
+pub const POLLHUP: ::c_short = 0x10;
+pub const POLLNVAL: ::c_short = 0x20;
+pub const POLLRDNORM: ::c_short = 0x040;
+pub const POLLRDBAND: ::c_short = 0x080;
+#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64")))]
+pub const POLLRDHUP: ::c_short = 0x2000;
+#[cfg(any(target_arch = "sparc", target_arch = "sparc64"))]
+pub const POLLRDHUP: ::c_short = 0x800;
+
+pub const IPTOS_LOWDELAY: u8 = 0x10;
+pub const IPTOS_THROUGHPUT: u8 = 0x08;
+pub const IPTOS_RELIABILITY: u8 = 0x04;
+pub const IPTOS_MINCOST: u8 = 0x02;
+
+pub const IPTOS_PREC_NETCONTROL: u8 = 0xe0;
+pub const IPTOS_PREC_INTERNETCONTROL: u8 = 0xc0;
+pub const IPTOS_PREC_CRITIC_ECP: u8 = 0xa0;
+pub const IPTOS_PREC_FLASHOVERRIDE: u8 = 0x80;
+pub const IPTOS_PREC_FLASH: u8 = 0x60;
+pub const IPTOS_PREC_IMMEDIATE: u8 = 0x40;
+pub const IPTOS_PREC_PRIORITY: u8 = 0x20;
+pub const IPTOS_PREC_ROUTINE: u8 = 0x00;
+
+pub const IPTOS_ECN_MASK: u8 = 0x03;
+pub const IPTOS_ECN_ECT1: u8 = 0x01;
+pub const IPTOS_ECN_ECT0: u8 = 0x02;
+pub const IPTOS_ECN_CE: u8 = 0x03;
+
+pub const IPOPT_COPY: u8 = 0x80;
+pub const IPOPT_CLASS_MASK: u8 = 0x60;
+pub const IPOPT_NUMBER_MASK: u8 = 0x1f;
+
+pub const IPOPT_CONTROL: u8 = 0x00;
+pub const IPOPT_RESERVED1: u8 = 0x20;
+pub const IPOPT_MEASUREMENT: u8 = 0x40;
+pub const IPOPT_RESERVED2: u8 = 0x60;
+pub const IPOPT_END: u8 = 0 | IPOPT_CONTROL;
+pub const IPOPT_NOOP: u8 = 1 | IPOPT_CONTROL;
+pub const IPOPT_SEC: u8 = 2 | IPOPT_CONTROL | IPOPT_COPY;
+pub const IPOPT_LSRR: u8 = 3 | IPOPT_CONTROL | IPOPT_COPY;
+pub const IPOPT_TIMESTAMP: u8 = 4 | IPOPT_MEASUREMENT;
+pub const IPOPT_RR: u8 = 7 | IPOPT_CONTROL;
+pub const IPOPT_SID: u8 = 8 | IPOPT_CONTROL | IPOPT_COPY;
+pub const IPOPT_SSRR: u8 = 9 | IPOPT_CONTROL | IPOPT_COPY;
+pub const IPOPT_RA: u8 = 20 | IPOPT_CONTROL | IPOPT_COPY;
+pub const IPVERSION: u8 = 4;
+pub const MAXTTL: u8 = 255;
+pub const IPDEFTTL: u8 = 64;
+pub const IPOPT_OPTVAL: u8 = 0;
+pub const IPOPT_OLEN: u8 = 1;
+pub const IPOPT_OFFSET: u8 = 2;
+pub const IPOPT_MINOFF: u8 = 4;
+pub const MAX_IPOPTLEN: u8 = 40;
+pub const IPOPT_NOP: u8 = IPOPT_NOOP;
+pub const IPOPT_EOL: u8 = IPOPT_END;
+pub const IPOPT_TS: u8 = IPOPT_TIMESTAMP;
+pub const IPOPT_TS_TSONLY: u8 = 0;
+pub const IPOPT_TS_TSANDADDR: u8 = 1;
+pub const IPOPT_TS_PRESPEC: u8 = 3;
+
+pub const ARPOP_RREQUEST: u16 = 3;
+pub const ARPOP_RREPLY: u16 = 4;
+pub const ARPOP_InREQUEST: u16 = 8;
+pub const ARPOP_InREPLY: u16 = 9;
+pub const ARPOP_NAK: u16 = 10;
+
+pub const ATF_NETMASK: ::c_int = 0x20;
+pub const ATF_DONTPUB: ::c_int = 0x40;
+
+pub const ARPHRD_NETROM: u16 = 0;
+pub const ARPHRD_ETHER: u16 = 1;
+pub const ARPHRD_EETHER: u16 = 2;
+pub const ARPHRD_AX25: u16 = 3;
+pub const ARPHRD_PRONET: u16 = 4;
+pub const ARPHRD_CHAOS: u16 = 5;
+pub const ARPHRD_IEEE802: u16 = 6;
+pub const ARPHRD_ARCNET: u16 = 7;
+pub const ARPHRD_APPLETLK: u16 = 8;
+pub const ARPHRD_DLCI: u16 = 15;
+pub const ARPHRD_ATM: u16 = 19;
+pub const ARPHRD_METRICOM: u16 = 23;
+pub const ARPHRD_IEEE1394: u16 = 24;
+pub const ARPHRD_EUI64: u16 = 27;
+pub const ARPHRD_INFINIBAND: u16 = 32;
+
+pub const ARPHRD_SLIP: u16 = 256;
+pub const ARPHRD_CSLIP: u16 = 257;
+pub const ARPHRD_SLIP6: u16 = 258;
+pub const ARPHRD_CSLIP6: u16 = 259;
+pub const ARPHRD_RSRVD: u16 = 260;
+pub const ARPHRD_ADAPT: u16 = 264;
+pub const ARPHRD_ROSE: u16 = 270;
+pub const ARPHRD_X25: u16 = 271;
+pub const ARPHRD_HWX25: u16 = 272;
+pub const ARPHRD_CAN: u16 = 280;
+pub const ARPHRD_PPP: u16 = 512;
+pub const ARPHRD_CISCO: u16 = 513;
+pub const ARPHRD_HDLC: u16 = ARPHRD_CISCO;
+pub const ARPHRD_LAPB: u16 = 516;
+pub const ARPHRD_DDCMP: u16 = 517;
+pub const ARPHRD_RAWHDLC: u16 = 518;
+
+pub const ARPHRD_TUNNEL: u16 = 768;
+pub const ARPHRD_TUNNEL6: u16 = 769;
+pub const ARPHRD_FRAD: u16 = 770;
+pub const ARPHRD_SKIP: u16 = 771;
+pub const ARPHRD_LOOPBACK: u16 = 772;
+pub const ARPHRD_LOCALTLK: u16 = 773;
+pub const ARPHRD_FDDI: u16 = 774;
+pub const ARPHRD_BIF: u16 = 775;
+pub const ARPHRD_SIT: u16 = 776;
+pub const ARPHRD_IPDDP: u16 = 777;
+pub const ARPHRD_IPGRE: u16 = 778;
+pub const ARPHRD_PIMREG: u16 = 779;
+pub const ARPHRD_HIPPI: u16 = 780;
+pub const ARPHRD_ASH: u16 = 781;
+pub const ARPHRD_ECONET: u16 = 782;
+pub const ARPHRD_IRDA: u16 = 783;
+pub const ARPHRD_FCPP: u16 = 784;
+pub const ARPHRD_FCAL: u16 = 785;
+pub const ARPHRD_FCPL: u16 = 786;
+pub const ARPHRD_FCFABRIC: u16 = 787;
+pub const ARPHRD_IEEE802_TR: u16 = 800;
+pub const ARPHRD_IEEE80211: u16 = 801;
+pub const ARPHRD_IEEE80211_PRISM: u16 = 802;
+pub const ARPHRD_IEEE80211_RADIOTAP: u16 = 803;
+pub const ARPHRD_IEEE802154: u16 = 804;
+
+pub const ARPHRD_VOID: u16 = 0xFFFF;
+pub const ARPHRD_NONE: u16 = 0xFFFE;
+
+cfg_if! {
+    if #[cfg(target_os = "emscripten")] {
+        // Emscripten does not define any `*_SUPER_MAGIC` constants.
+    } else if #[cfg(not(target_arch = "s390x"))] {
+        pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5;
+        pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff;
+        pub const AFS_SUPER_MAGIC: ::c_long = 0x5346414f;
+        pub const AUTOFS_SUPER_MAGIC: ::c_long = 0x0187;
+        pub const BPF_FS_MAGIC: ::c_long = 0xcafe4a11;
+        pub const BTRFS_SUPER_MAGIC: ::c_long = 0x9123683e;
+        pub const CGROUP2_SUPER_MAGIC: ::c_long = 0x63677270;
+        pub const CGROUP_SUPER_MAGIC: ::c_long = 0x27e0eb;
+        pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245;
+        pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45;
+        pub const DEBUGFS_MAGIC: ::c_long = 0x64626720;
+        pub const DEVPTS_SUPER_MAGIC: ::c_long = 0x1cd1;
+        pub const ECRYPTFS_SUPER_MAGIC: ::c_long = 0xf15f;
+        pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53;
+        pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53;
+        pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53;
+        pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53;
+        pub const F2FS_SUPER_MAGIC: ::c_long = 0xf2f52010;
+        pub const FUSE_SUPER_MAGIC: ::c_long = 0x65735546;
+        pub const FUTEXFS_SUPER_MAGIC: ::c_long = 0xbad1dea;
+        pub const HOSTFS_SUPER_MAGIC: ::c_long = 0x00c0ffee;
+        pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849;
+        pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6;
+        pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660;
+        pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6;
+        pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478;
+        pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468;
+        pub const MINIX3_SUPER_MAGIC: ::c_long = 0x4d5a;
+        pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f;
+        pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f;
+        pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44;
+        pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c;
+        pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969;
+        pub const NILFS_SUPER_MAGIC: ::c_long = 0x3434;
+        pub const OCFS2_SUPER_MAGIC: ::c_long = 0x7461636f;
+        pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1;
+        pub const OVERLAYFS_SUPER_MAGIC: ::c_long = 0x794c7630;
+        pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0;
+        pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f;
+        pub const QNX6_SUPER_MAGIC: ::c_long = 0x68191122;
+        pub const RDTGROUP_SUPER_MAGIC: ::c_long = 0x7655821;
+        pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973;
+        pub const SECURITYFS_MAGIC: ::c_long = 0x73636673;
+        pub const SELINUX_MAGIC: ::c_long = 0xf97cff8c;
+        pub const SMACK_MAGIC: ::c_long = 0x43415d53;
+        pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b;
+        pub const SYSFS_MAGIC: ::c_long = 0x62656572;
+        pub const TMPFS_MAGIC: ::c_long = 0x01021994;
+        pub const TRACEFS_MAGIC: ::c_long = 0x74726163;
+        pub const UDF_SUPER_MAGIC: ::c_long = 0x15013346;
+        pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2;
+        pub const XENFS_SUPER_MAGIC: ::c_long = 0xabba1974;
+        pub const NSFS_MAGIC: ::c_long = 0x6e736673;
+    } else if #[cfg(target_arch = "s390x")] {
+        pub const ADFS_SUPER_MAGIC: ::c_uint = 0x0000adf5;
+        pub const AFFS_SUPER_MAGIC: ::c_uint = 0x0000adff;
+        pub const AFS_SUPER_MAGIC: ::c_uint = 0x5346414f;
+        pub const AUTOFS_SUPER_MAGIC: ::c_uint = 0x0187;
+        pub const BPF_FS_MAGIC: ::c_uint = 0xcafe4a11;
+        pub const BTRFS_SUPER_MAGIC: ::c_uint = 0x9123683e;
+        pub const CGROUP2_SUPER_MAGIC: ::c_uint = 0x63677270;
+        pub const CGROUP_SUPER_MAGIC: ::c_uint = 0x27e0eb;
+        pub const CODA_SUPER_MAGIC: ::c_uint = 0x73757245;
+        pub const CRAMFS_MAGIC: ::c_uint = 0x28cd3d45;
+        pub const DEBUGFS_MAGIC: ::c_uint = 0x64626720;
+        pub const DEVPTS_SUPER_MAGIC: ::c_uint = 0x1cd1;
+        pub const ECRYPTFS_SUPER_MAGIC: ::c_uint = 0xf15f;
+        pub const EFS_SUPER_MAGIC: ::c_uint = 0x00414a53;
+        pub const EXT2_SUPER_MAGIC: ::c_uint = 0x0000ef53;
+        pub const EXT3_SUPER_MAGIC: ::c_uint = 0x0000ef53;
+        pub const EXT4_SUPER_MAGIC: ::c_uint = 0x0000ef53;
+        pub const F2FS_SUPER_MAGIC: ::c_uint = 0xf2f52010;
+        pub const FUSE_SUPER_MAGIC: ::c_uint = 0x65735546;
+        pub const FUTEXFS_SUPER_MAGIC: ::c_uint = 0xbad1dea;
+        pub const HOSTFS_SUPER_MAGIC: ::c_uint = 0x00c0ffee;
+        pub const HPFS_SUPER_MAGIC: ::c_uint = 0xf995e849;
+        pub const HUGETLBFS_MAGIC: ::c_uint = 0x958458f6;
+        pub const ISOFS_SUPER_MAGIC: ::c_uint = 0x00009660;
+        pub const JFFS2_SUPER_MAGIC: ::c_uint = 0x000072b6;
+        pub const MINIX2_SUPER_MAGIC2: ::c_uint = 0x00002478;
+        pub const MINIX2_SUPER_MAGIC: ::c_uint = 0x00002468;
+        pub const MINIX3_SUPER_MAGIC: ::c_uint = 0x4d5a;
+        pub const MINIX_SUPER_MAGIC2: ::c_uint = 0x0000138f;
+        pub const MINIX_SUPER_MAGIC: ::c_uint = 0x0000137f;
+        pub const MSDOS_SUPER_MAGIC: ::c_uint = 0x00004d44;
+        pub const NCP_SUPER_MAGIC: ::c_uint = 0x0000564c;
+        pub const NFS_SUPER_MAGIC: ::c_uint = 0x00006969;
+        pub const NILFS_SUPER_MAGIC: ::c_uint = 0x3434;
+        pub const OCFS2_SUPER_MAGIC: ::c_uint = 0x7461636f;
+        pub const OPENPROM_SUPER_MAGIC: ::c_uint = 0x00009fa1;
+        pub const OVERLAYFS_SUPER_MAGIC: ::c_uint = 0x794c7630;
+        pub const PROC_SUPER_MAGIC: ::c_uint = 0x00009fa0;
+        pub const QNX4_SUPER_MAGIC: ::c_uint = 0x0000002f;
+        pub const QNX6_SUPER_MAGIC: ::c_uint = 0x68191122;
+        pub const RDTGROUP_SUPER_MAGIC: ::c_uint = 0x7655821;
+        pub const REISERFS_SUPER_MAGIC: ::c_uint = 0x52654973;
+        pub const SECURITYFS_MAGIC: ::c_uint = 0x73636673;
+        pub const SELINUX_MAGIC: ::c_uint = 0xf97cff8c;
+        pub const SMACK_MAGIC: ::c_uint = 0x43415d53;
+        pub const SMB_SUPER_MAGIC: ::c_uint = 0x0000517b;
+        pub const SYSFS_MAGIC: ::c_uint = 0x62656572;
+        pub const TMPFS_MAGIC: ::c_uint = 0x01021994;
+        pub const TRACEFS_MAGIC: ::c_uint = 0x74726163;
+        pub const UDF_SUPER_MAGIC: ::c_uint = 0x15013346;
+        pub const USBDEVICE_SUPER_MAGIC: ::c_uint = 0x00009fa2;
+        pub const XENFS_SUPER_MAGIC: ::c_uint = 0xabba1974;
+        pub const NSFS_MAGIC: ::c_uint = 0x6e736673;
+    }
+}
+
+const_fn! {
+    {const} fn CMSG_ALIGN(len: usize) -> usize {
+        len + ::mem::size_of::<usize>() - 1 & !(::mem::size_of::<usize>() - 1)
+    }
+}
+
+f! {
+    pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
+        if (*mhdr).msg_controllen as usize >= ::mem::size_of::<cmsghdr>() {
+            (*mhdr).msg_control as *mut cmsghdr
+        } else {
+            0 as *mut cmsghdr
+        }
+    }
+
+    pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut ::c_uchar {
+        cmsg.offset(1) as *mut ::c_uchar
+    }
+
+    pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
+        (CMSG_ALIGN(length as usize) + CMSG_ALIGN(::mem::size_of::<cmsghdr>()))
+            as ::c_uint
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        CMSG_ALIGN(::mem::size_of::<cmsghdr>()) as ::c_uint + length
+    }
+
+    pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
+        let fd = fd as usize;
+        let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        (*set).fds_bits[fd / size] &= !(1 << (fd % size));
+        return
+    }
+
+    pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
+        let fd = fd as usize;
+        let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0
+    }
+
+    pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
+        let fd = fd as usize;
+        let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        (*set).fds_bits[fd / size] |= 1 << (fd % size);
+        return
+    }
+
+    pub fn FD_ZERO(set: *mut fd_set) -> () {
+        for slot in (*set).fds_bits.iter_mut() {
+            *slot = 0;
+        }
+    }
+}
+
+safe_f! {
+    pub fn SIGRTMAX() -> ::c_int {
+        unsafe { __libc_current_sigrtmax() }
+    }
+
+    pub fn SIGRTMIN() -> ::c_int {
+        unsafe { __libc_current_sigrtmin() }
+    }
+
+    pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
+        (status & 0xff) == 0x7f
+    }
+
+    pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
+        (status >> 8) & 0xff
+    }
+
+    pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
+        status == 0xffff
+    }
+
+    pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
+        ((status & 0x7f) + 1) as i8 >= 2
+    }
+
+    pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int {
+        status & 0x7f
+    }
+
+    pub {const} fn WIFEXITED(status: ::c_int) -> bool {
+        (status & 0x7f) == 0
+    }
+
+    pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int {
+        (status >> 8) & 0xff
+    }
+
+    pub {const} fn WCOREDUMP(status: ::c_int) -> bool {
+        (status & 0x80) != 0
+    }
+
+    pub {const} fn W_EXITCODE(ret: ::c_int, sig: ::c_int) -> ::c_int {
+        (ret << 8) | sig
+    }
+
+    pub {const} fn W_STOPCODE(sig: ::c_int) -> ::c_int {
+        (sig << 8) | 0x7f
+    }
+
+    pub {const} fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int {
+        (cmd << 8) | (type_ & 0x00ff)
+    }
+
+    pub {const} fn IPOPT_COPIED(o: u8) -> u8 {
+        o & IPOPT_COPY
+    }
+
+    pub {const} fn IPOPT_CLASS(o: u8) -> u8 {
+        o & IPOPT_CLASS_MASK
+    }
+
+    pub {const} fn IPOPT_NUMBER(o: u8) -> u8 {
+        o & IPOPT_NUMBER_MASK
+    }
+
+    pub {const} fn IPTOS_ECN(x: u8) -> u8 {
+        x & ::IPTOS_ECN_MASK
+    }
+
+    #[allow(ellipsis_inclusive_range_patterns)]
+    pub {const} fn KERNEL_VERSION(a: u32, b: u32, c: u32) -> u32 {
+        ((a << 16) + (b << 8)) + match c {
+            0 ... 255 => c,
+            _ => 255,
+        }
+    }
+}
+
+extern "C" {
+    #[doc(hidden)]
+    pub fn __libc_current_sigrtmax() -> ::c_int;
+    #[doc(hidden)]
+    pub fn __libc_current_sigrtmin() -> ::c_int;
+
+    pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
+    pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
+    pub fn fdatasync(fd: ::c_int) -> ::c_int;
+    pub fn mincore(addr: *mut ::c_void, len: ::size_t, vec: *mut ::c_uchar) -> ::c_int;
+
+    pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+    pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int;
+
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
+
+    pub fn pthread_getattr_np(native: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
+    pub fn pthread_attr_getstack(
+        attr: *const ::pthread_attr_t,
+        stackaddr: *mut *mut ::c_void,
+        stacksize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
+    pub fn setgroups(ngroups: ::size_t, ptr: *const ::gid_t) -> ::c_int;
+    pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
+    pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
+    pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
+    pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
+    pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
+    pub fn utimensat(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::timespec,
+        flag: ::c_int,
+    ) -> ::c_int;
+    pub fn duplocale(base: ::locale_t) -> ::locale_t;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+    pub fn uselocale(loc: ::locale_t) -> ::locale_t;
+    pub fn mknodat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::mode_t,
+        dev: dev_t,
+    ) -> ::c_int;
+    pub fn pthread_condattr_getclock(
+        attr: *const pthread_condattr_t,
+        clock_id: *mut clockid_t,
+    ) -> ::c_int;
+    pub fn pthread_condattr_setclock(
+        attr: *mut pthread_condattr_t,
+        clock_id: ::clockid_t,
+    ) -> ::c_int;
+    pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int;
+    pub fn pthread_mutexattr_setpshared(
+        attr: *mut pthread_mutexattr_t,
+        pshared: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_rwlockattr_getpshared(
+        attr: *const pthread_rwlockattr_t,
+        val: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int;
+    pub fn ptsname_r(fd: ::c_int, buf: *mut ::c_char, buflen: ::size_t) -> ::c_int;
+    pub fn clearenv() -> ::c_int;
+    pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
+        -> ::c_int;
+    pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int;
+    pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int;
+    pub fn acct(filename: *const ::c_char) -> ::c_int;
+    pub fn brk(addr: *mut ::c_void) -> ::c_int;
+    pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
+    #[deprecated(
+        since = "0.2.66",
+        note = "causes memory corruption, see rust-lang/libc#1596"
+    )]
+    pub fn vfork() -> ::pid_t;
+    pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
+    pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
+    pub fn wait4(
+        pid: ::pid_t,
+        status: *mut ::c_int,
+        options: ::c_int,
+        rusage: *mut ::rusage,
+    ) -> ::pid_t;
+    pub fn login_tty(fd: ::c_int) -> ::c_int;
+    pub fn execvpe(
+        file: *const ::c_char,
+        argv: *const *const ::c_char,
+        envp: *const *const ::c_char,
+    ) -> ::c_int;
+    pub fn fexecve(
+        fd: ::c_int,
+        argv: *const *const ::c_char,
+        envp: *const *const ::c_char,
+    ) -> ::c_int;
+    pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
+    pub fn freeifaddrs(ifa: *mut ::ifaddrs);
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
+
+    pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+
+    pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+    pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
+    pub fn uname(buf: *mut ::utsname) -> ::c_int;
+
+    pub fn strchrnul(s: *const ::c_char, c: ::c_int) -> *mut ::c_char;
+
+    pub fn strftime(
+        s: *mut ::c_char,
+        max: ::size_t,
+        format: *const ::c_char,
+        tm: *const ::tm,
+    ) -> ::size_t;
+    pub fn strftime_l(
+        s: *mut ::c_char,
+        max: ::size_t,
+        format: *const ::c_char,
+        tm: *const ::tm,
+        locale: ::locale_t,
+    ) -> ::size_t;
+    pub fn strptime(s: *const ::c_char, format: *const ::c_char, tm: *mut ::tm) -> *mut ::c_char;
+}
+
+// LFS64 extensions
+//
+// * musl and Emscripten has 64-bit versions only so aliases the LFS64 symbols to the standard ones
+// * ulibc doesn't have preadv64/pwritev64
+cfg_if! {
+    if #[cfg(not(any(target_env = "musl", target_os = "emscripten")))] {
+        extern "C" {
+            pub fn fstatfs64(fd: ::c_int, buf: *mut statfs64) -> ::c_int;
+            pub fn statvfs64(path: *const ::c_char, buf: *mut statvfs64) -> ::c_int;
+            pub fn fstatvfs64(fd: ::c_int, buf: *mut statvfs64) -> ::c_int;
+            pub fn statfs64(path: *const ::c_char, buf: *mut statfs64) -> ::c_int;
+            pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int;
+            pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int;
+            pub fn fstatat64(
+                dirfd: ::c_int,
+                pathname: *const c_char,
+                buf: *mut stat64,
+                flags: ::c_int,
+            ) -> ::c_int;
+            pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int;
+            pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t;
+            pub fn lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
+            pub fn mmap64(
+                addr: *mut ::c_void,
+                len: ::size_t,
+                prot: ::c_int,
+                flags: ::c_int,
+                fd: ::c_int,
+                offset: off64_t,
+            ) -> *mut ::c_void;
+            pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
+            pub fn openat64(fd: ::c_int, path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
+            pub fn posix_fadvise64(
+                fd: ::c_int,
+                offset: ::off64_t,
+                len: ::off64_t,
+                advise: ::c_int,
+            ) -> ::c_int;
+            pub fn pread64(
+                fd: ::c_int,
+                buf: *mut ::c_void,
+                count: ::size_t,
+                offset: off64_t
+            ) -> ::ssize_t;
+            pub fn pwrite64(
+                fd: ::c_int,
+                buf: *const ::c_void,
+                count: ::size_t,
+                offset: off64_t,
+            ) -> ::ssize_t;
+            pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64;
+            pub fn readdir64_r(
+                dirp: *mut ::DIR,
+                entry: *mut ::dirent64,
+                result: *mut *mut ::dirent64,
+            ) -> ::c_int;
+            pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
+            pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(not(any(target_env = "uclibc", target_env = "musl", target_os = "emscripten")))] {
+        extern "C" {
+            pub fn preadv64(
+                fd: ::c_int,
+                iov: *const ::iovec,
+                iovcnt: ::c_int,
+                offset: ::off64_t,
+            ) -> ::ssize_t;
+            pub fn pwritev64(
+                fd: ::c_int,
+                iov: *const ::iovec,
+                iovcnt: ::c_int,
+                offset: ::off64_t,
+            ) -> ::ssize_t;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(not(target_env = "uclibc"))] {
+        extern "C" {
+            // uclibc has separate non-const version of this function
+            pub fn forkpty(
+                amaster: *mut ::c_int,
+                name: *mut ::c_char,
+                termp: *const termios,
+                winp: *const ::winsize,
+            ) -> ::pid_t;
+            // uclibc has separate non-const version of this function
+            pub fn openpty(
+                amaster: *mut ::c_int,
+                aslave: *mut ::c_int,
+                name: *mut ::c_char,
+                termp: *const termios,
+                winp: *const ::winsize,
+            ) -> ::c_int;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_os = "emscripten")] {
+        mod emscripten;
+        pub use self::emscripten::*;
+    } else if #[cfg(target_os = "linux")] {
+        mod linux;
+        pub use self::linux::*;
+    } else if #[cfg(target_os = "l4re")] {
+        mod linux;
+        pub use self::linux::*;
+    } else if #[cfg(target_os = "android")] {
+        mod android;
+        pub use self::android::*;
+    } else {
+        // Unknown target_os
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1629 @@
+//! Definitions found commonly among almost all Unix derivatives
+//!
+//! More functions and definitions can be found in the more specific modules
+//! according to the platform in question.
+
+pub type c_schar = i8;
+pub type c_uchar = u8;
+pub type c_short = i16;
+pub type c_ushort = u16;
+pub type c_int = i32;
+pub type c_uint = u32;
+pub type c_float = f32;
+pub type c_double = f64;
+pub type c_longlong = i64;
+pub type c_ulonglong = u64;
+pub type intmax_t = i64;
+pub type uintmax_t = u64;
+
+pub type size_t = usize;
+pub type ptrdiff_t = isize;
+pub type intptr_t = isize;
+pub type uintptr_t = usize;
+pub type ssize_t = isize;
+
+pub type pid_t = i32;
+pub type in_addr_t = u32;
+pub type in_port_t = u16;
+pub type sighandler_t = ::size_t;
+pub type cc_t = ::c_uchar;
+
+cfg_if! {
+    if #[cfg(any(target_os = "espidf", target_os = "horizon", target_os = "vita"))] {
+        pub type uid_t = ::c_ushort;
+        pub type gid_t = ::c_ushort;
+    } else if #[cfg(target_os = "nto")] {
+        pub type uid_t = i32;
+        pub type gid_t = i32;
+    } else {
+        pub type uid_t = u32;
+        pub type gid_t = u32;
+    }
+}
+
+missing! {
+    #[cfg_attr(feature = "extra_traits", derive(Debug))]
+    pub enum DIR {}
+}
+pub type locale_t = *mut ::c_void;
+
+s! {
+    pub struct group {
+        pub gr_name: *mut ::c_char,
+        pub gr_passwd: *mut ::c_char,
+        pub gr_gid: ::gid_t,
+        pub gr_mem: *mut *mut ::c_char,
+    }
+
+    pub struct utimbuf {
+        pub actime: time_t,
+        pub modtime: time_t,
+    }
+
+    pub struct timeval {
+        pub tv_sec: time_t,
+        pub tv_usec: suseconds_t,
+    }
+
+    // linux x32 compatibility
+    // See https://sourceware.org/bugzilla/show_bug.cgi?id=16437
+    pub struct timespec {
+        pub tv_sec: time_t,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        pub tv_nsec: i64,
+        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+        pub tv_nsec: ::c_long,
+    }
+
+    pub struct rlimit {
+        pub rlim_cur: rlim_t,
+        pub rlim_max: rlim_t,
+    }
+
+    pub struct rusage {
+        pub ru_utime: timeval,
+        pub ru_stime: timeval,
+        pub ru_maxrss: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad1: u32,
+        pub ru_ixrss: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad2: u32,
+        pub ru_idrss: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad3: u32,
+        pub ru_isrss: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad4: u32,
+        pub ru_minflt: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad5: u32,
+        pub ru_majflt: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad6: u32,
+        pub ru_nswap: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad7: u32,
+        pub ru_inblock: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad8: u32,
+        pub ru_oublock: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad9: u32,
+        pub ru_msgsnd: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad10: u32,
+        pub ru_msgrcv: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad11: u32,
+        pub ru_nsignals: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad12: u32,
+        pub ru_nvcsw: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad13: u32,
+        pub ru_nivcsw: c_long,
+        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+        __pad14: u32,
+
+        #[cfg(any(target_env = "musl", target_env = "ohos", target_os = "emscripten"))]
+        __reserved: [c_long; 16],
+    }
+
+    pub struct ipv6_mreq {
+        pub ipv6mr_multiaddr: in6_addr,
+        #[cfg(target_os = "android")]
+        pub ipv6mr_interface: ::c_int,
+        #[cfg(not(target_os = "android"))]
+        pub ipv6mr_interface: ::c_uint,
+    }
+
+    pub struct hostent {
+        pub h_name: *mut ::c_char,
+        pub h_aliases: *mut *mut ::c_char,
+        pub h_addrtype: ::c_int,
+        pub h_length: ::c_int,
+        pub h_addr_list: *mut *mut ::c_char,
+    }
+
+    pub struct iovec {
+        pub iov_base: *mut ::c_void,
+        pub iov_len: ::size_t,
+    }
+
+    pub struct pollfd {
+        pub fd: ::c_int,
+        pub events: ::c_short,
+        pub revents: ::c_short,
+    }
+
+    pub struct winsize {
+        pub ws_row: ::c_ushort,
+        pub ws_col: ::c_ushort,
+        pub ws_xpixel: ::c_ushort,
+        pub ws_ypixel: ::c_ushort,
+    }
+
+    pub struct linger {
+        pub l_onoff: ::c_int,
+        pub l_linger: ::c_int,
+    }
+
+    pub struct sigval {
+        // Actually a union of an int and a void*
+        pub sival_ptr: *mut ::c_void
+    }
+
+    // <sys/time.h>
+    pub struct itimerval {
+        pub it_interval: ::timeval,
+        pub it_value: ::timeval,
+    }
+
+    // <sys/times.h>
+    pub struct tms {
+        pub tms_utime: ::clock_t,
+        pub tms_stime: ::clock_t,
+        pub tms_cutime: ::clock_t,
+        pub tms_cstime: ::clock_t,
+    }
+
+    pub struct servent {
+        pub s_name: *mut ::c_char,
+        pub s_aliases: *mut *mut ::c_char,
+        pub s_port: ::c_int,
+        pub s_proto: *mut ::c_char,
+    }
+
+    pub struct protoent {
+        pub p_name: *mut ::c_char,
+        pub p_aliases: *mut *mut ::c_char,
+        pub p_proto: ::c_int,
+    }
+}
+
+pub const INT_MIN: c_int = -2147483648;
+pub const INT_MAX: c_int = 2147483647;
+
+pub const SIG_DFL: sighandler_t = 0 as sighandler_t;
+pub const SIG_IGN: sighandler_t = 1 as sighandler_t;
+pub const SIG_ERR: sighandler_t = !0 as sighandler_t;
+cfg_if! {
+    if #[cfg(not(target_os = "nto"))] {
+        pub const DT_UNKNOWN: u8 = 0;
+        pub const DT_FIFO: u8 = 1;
+        pub const DT_CHR: u8 = 2;
+        pub const DT_DIR: u8 = 4;
+        pub const DT_BLK: u8 = 6;
+        pub const DT_REG: u8 = 8;
+        pub const DT_LNK: u8 = 10;
+        pub const DT_SOCK: u8 = 12;
+    }
+}
+cfg_if! {
+    if #[cfg(not(target_os = "redox"))] {
+        pub const FD_CLOEXEC: ::c_int = 0x1;
+    }
+}
+
+cfg_if! {
+    if #[cfg(not(target_os = "nto"))]
+    {
+        pub const USRQUOTA: ::c_int = 0;
+        pub const GRPQUOTA: ::c_int = 1;
+    }
+}
+pub const SIGIOT: ::c_int = 6;
+
+pub const S_ISUID: ::mode_t = 0x800;
+pub const S_ISGID: ::mode_t = 0x400;
+pub const S_ISVTX: ::mode_t = 0x200;
+
+cfg_if! {
+    if #[cfg(not(any(target_os = "haiku", target_os = "illumos",
+                     target_os = "solaris")))] {
+        pub const IF_NAMESIZE: ::size_t = 16;
+        pub const IFNAMSIZ: ::size_t = IF_NAMESIZE;
+    }
+}
+
+pub const LOG_EMERG: ::c_int = 0;
+pub const LOG_ALERT: ::c_int = 1;
+pub const LOG_CRIT: ::c_int = 2;
+pub const LOG_ERR: ::c_int = 3;
+pub const LOG_WARNING: ::c_int = 4;
+pub const LOG_NOTICE: ::c_int = 5;
+pub const LOG_INFO: ::c_int = 6;
+pub const LOG_DEBUG: ::c_int = 7;
+
+pub const LOG_KERN: ::c_int = 0;
+pub const LOG_USER: ::c_int = 1 << 3;
+pub const LOG_MAIL: ::c_int = 2 << 3;
+pub const LOG_DAEMON: ::c_int = 3 << 3;
+pub const LOG_AUTH: ::c_int = 4 << 3;
+pub const LOG_SYSLOG: ::c_int = 5 << 3;
+pub const LOG_LPR: ::c_int = 6 << 3;
+pub const LOG_NEWS: ::c_int = 7 << 3;
+pub const LOG_UUCP: ::c_int = 8 << 3;
+pub const LOG_LOCAL0: ::c_int = 16 << 3;
+pub const LOG_LOCAL1: ::c_int = 17 << 3;
+pub const LOG_LOCAL2: ::c_int = 18 << 3;
+pub const LOG_LOCAL3: ::c_int = 19 << 3;
+pub const LOG_LOCAL4: ::c_int = 20 << 3;
+pub const LOG_LOCAL5: ::c_int = 21 << 3;
+pub const LOG_LOCAL6: ::c_int = 22 << 3;
+pub const LOG_LOCAL7: ::c_int = 23 << 3;
+
+cfg_if! {
+    if #[cfg(not(target_os = "haiku"))] {
+        pub const LOG_PID: ::c_int = 0x01;
+        pub const LOG_CONS: ::c_int = 0x02;
+        pub const LOG_ODELAY: ::c_int = 0x04;
+        pub const LOG_NDELAY: ::c_int = 0x08;
+        pub const LOG_NOWAIT: ::c_int = 0x10;
+    }
+}
+pub const LOG_PRIMASK: ::c_int = 7;
+pub const LOG_FACMASK: ::c_int = 0x3f8;
+
+cfg_if! {
+    if #[cfg(not(target_os = "nto"))]
+    {
+        pub const PRIO_MIN: ::c_int = -20;
+        pub const PRIO_MAX: ::c_int = 20;
+    }
+}
+pub const IPPROTO_ICMP: ::c_int = 1;
+pub const IPPROTO_ICMPV6: ::c_int = 58;
+pub const IPPROTO_TCP: ::c_int = 6;
+pub const IPPROTO_UDP: ::c_int = 17;
+pub const IPPROTO_IP: ::c_int = 0;
+pub const IPPROTO_IPV6: ::c_int = 41;
+
+pub const INADDR_LOOPBACK: in_addr_t = 2130706433;
+pub const INADDR_ANY: in_addr_t = 0;
+pub const INADDR_BROADCAST: in_addr_t = 4294967295;
+pub const INADDR_NONE: in_addr_t = 4294967295;
+
+pub const ARPOP_REQUEST: u16 = 1;
+pub const ARPOP_REPLY: u16 = 2;
+
+pub const ATF_COM: ::c_int = 0x02;
+pub const ATF_PERM: ::c_int = 0x04;
+pub const ATF_PUBL: ::c_int = 0x08;
+pub const ATF_USETRAILERS: ::c_int = 0x10;
+
+cfg_if! {
+    if #[cfg(any(target_os = "l4re", target_os = "espidf"))] {
+        // required libraries for L4Re and the ESP-IDF framework are linked externally, ATM
+    } else if #[cfg(feature = "std")] {
+        // cargo build, don't pull in anything extra as the std dep
+        // already pulls in all libs.
+    } else if #[cfg(all(target_os = "linux",
+                        any(target_env = "gnu", target_env = "uclibc"),
+                        feature = "rustc-dep-of-std"))] {
+        #[link(name = "util", kind = "static", modifiers = "-bundle",
+            cfg(target_feature = "crt-static"))]
+        #[link(name = "rt", kind = "static", modifiers = "-bundle",
+            cfg(target_feature = "crt-static"))]
+        #[link(name = "pthread", kind = "static", modifiers = "-bundle",
+            cfg(target_feature = "crt-static"))]
+        #[link(name = "m", kind = "static", modifiers = "-bundle",
+            cfg(target_feature = "crt-static"))]
+        #[link(name = "dl", kind = "static", modifiers = "-bundle",
+            cfg(target_feature = "crt-static"))]
+        #[link(name = "c", kind = "static", modifiers = "-bundle",
+            cfg(target_feature = "crt-static"))]
+        #[link(name = "gcc_eh", kind = "static", modifiers = "-bundle",
+            cfg(target_feature = "crt-static"))]
+        #[link(name = "gcc", kind = "static", modifiers = "-bundle",
+            cfg(target_feature = "crt-static"))]
+        #[link(name = "c", kind = "static", modifiers = "-bundle",
+            cfg(target_feature = "crt-static"))]
+        #[link(name = "util", cfg(not(target_feature = "crt-static")))]
+        #[link(name = "rt", cfg(not(target_feature = "crt-static")))]
+        #[link(name = "pthread", cfg(not(target_feature = "crt-static")))]
+        #[link(name = "m", cfg(not(target_feature = "crt-static")))]
+        #[link(name = "dl", cfg(not(target_feature = "crt-static")))]
+        #[link(name = "c", cfg(not(target_feature = "crt-static")))]
+        extern {}
+    } else if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
+        #[cfg_attr(feature = "rustc-dep-of-std",
+                   link(name = "c", kind = "static", modifiers = "-bundle",
+                        cfg(target_feature = "crt-static")))]
+        #[cfg_attr(feature = "rustc-dep-of-std",
+                   link(name = "c", cfg(not(target_feature = "crt-static"))))]
+        extern {}
+    } else if #[cfg(target_os = "emscripten")] {
+        #[link(name = "c")]
+        extern {}
+    } else if #[cfg(all(target_os = "android", feature = "rustc-dep-of-std"))] {
+        #[link(name = "c", kind = "static", modifiers = "-bundle",
+            cfg(target_feature = "crt-static"))]
+        #[link(name = "m", kind = "static", modifiers = "-bundle",
+            cfg(target_feature = "crt-static"))]
+        #[link(name = "m", cfg(not(target_feature = "crt-static")))]
+        #[link(name = "c", cfg(not(target_feature = "crt-static")))]
+        extern {}
+    } else if #[cfg(any(target_os = "macos",
+                        target_os = "ios",
+                        target_os = "tvos",
+                        target_os = "watchos",
+                        target_os = "visionos",
+                        target_os = "android",
+                        target_os = "openbsd",
+                        target_os = "nto",
+                    ))] {
+        #[link(name = "c")]
+        #[link(name = "m")]
+        extern {}
+    } else if #[cfg(target_os = "haiku")] {
+        #[link(name = "root")]
+        #[link(name = "network")]
+        extern {}
+    } else if #[cfg(target_env = "newlib")] {
+        #[link(name = "c")]
+        #[link(name = "m")]
+        extern {}
+    } else if #[cfg(target_env = "illumos")] {
+        #[link(name = "c")]
+        #[link(name = "m")]
+        extern {}
+    } else if #[cfg(target_os = "redox")] {
+        #[cfg_attr(feature = "rustc-dep-of-std",
+                   link(name = "c", kind = "static", modifiers = "-bundle",
+                        cfg(target_feature = "crt-static")))]
+        #[cfg_attr(feature = "rustc-dep-of-std",
+                   link(name = "c", cfg(not(target_feature = "crt-static"))))]
+        extern {}
+    } else if #[cfg(target_env = "aix")] {
+        #[link(name = "c")]
+        #[link(name = "m")]
+        #[link(name = "bsd")]
+        #[link(name = "pthread")]
+        extern {}
+    } else {
+        #[link(name = "c")]
+        #[link(name = "m")]
+        #[link(name = "rt")]
+        #[link(name = "pthread")]
+        extern {}
+    }
+}
+
+missing! {
+    #[cfg_attr(feature = "extra_traits", derive(Debug))]
+    pub enum FILE {}
+    #[cfg_attr(feature = "extra_traits", derive(Debug))]
+    pub enum fpos_t {} // FIXME: fill this out with a struct
+}
+
+extern "C" {
+    pub fn isalnum(c: c_int) -> c_int;
+    pub fn isalpha(c: c_int) -> c_int;
+    pub fn iscntrl(c: c_int) -> c_int;
+    pub fn isdigit(c: c_int) -> c_int;
+    pub fn isgraph(c: c_int) -> c_int;
+    pub fn islower(c: c_int) -> c_int;
+    pub fn isprint(c: c_int) -> c_int;
+    pub fn ispunct(c: c_int) -> c_int;
+    pub fn isspace(c: c_int) -> c_int;
+    pub fn isupper(c: c_int) -> c_int;
+    pub fn isxdigit(c: c_int) -> c_int;
+    pub fn isblank(c: c_int) -> c_int;
+    pub fn tolower(c: c_int) -> c_int;
+    pub fn toupper(c: c_int) -> c_int;
+    pub fn qsort(
+        base: *mut c_void,
+        num: size_t,
+        size: size_t,
+        compar: ::Option<unsafe extern "C" fn(*const c_void, *const c_void) -> c_int>,
+    );
+    pub fn bsearch(
+        key: *const c_void,
+        base: *const c_void,
+        num: size_t,
+        size: size_t,
+        compar: ::Option<unsafe extern "C" fn(*const c_void, *const c_void) -> c_int>,
+    ) -> *mut c_void;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "fopen$UNIX2003"
+    )]
+    pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "freopen$UNIX2003"
+    )]
+    pub fn freopen(filename: *const c_char, mode: *const c_char, file: *mut FILE) -> *mut FILE;
+
+    pub fn fflush(file: *mut FILE) -> c_int;
+    pub fn fclose(file: *mut FILE) -> c_int;
+    pub fn remove(filename: *const c_char) -> c_int;
+    pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int;
+    pub fn tmpfile() -> *mut FILE;
+    pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int;
+    pub fn setbuf(stream: *mut FILE, buf: *mut c_char);
+    pub fn getchar() -> c_int;
+    pub fn putchar(c: c_int) -> c_int;
+    pub fn fgetc(stream: *mut FILE) -> c_int;
+    pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char;
+    pub fn fputc(c: c_int, stream: *mut FILE) -> c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "fputs$UNIX2003"
+    )]
+    pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int;
+    pub fn puts(s: *const c_char) -> c_int;
+    pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int;
+    pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "fwrite$UNIX2003"
+    )]
+    pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
+    pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int;
+    pub fn ftell(stream: *mut FILE) -> c_long;
+    pub fn rewind(stream: *mut FILE);
+    #[cfg_attr(target_os = "netbsd", link_name = "__fgetpos50")]
+    pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__fsetpos50")]
+    pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int;
+    pub fn feof(stream: *mut FILE) -> c_int;
+    pub fn ferror(stream: *mut FILE) -> c_int;
+    pub fn clearerr(stream: *mut FILE);
+    pub fn perror(s: *const c_char);
+    pub fn atof(s: *const c_char) -> c_double;
+    pub fn atoi(s: *const c_char) -> c_int;
+    pub fn atol(s: *const c_char) -> c_long;
+    pub fn atoll(s: *const c_char) -> c_longlong;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "strtod$UNIX2003"
+    )]
+    pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
+    pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
+    pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
+    pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
+    pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
+    pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
+    pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
+    pub fn malloc(size: size_t) -> *mut c_void;
+    pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
+    pub fn free(p: *mut c_void);
+    pub fn abort() -> !;
+    pub fn exit(status: c_int) -> !;
+    pub fn _exit(status: c_int) -> !;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "system$UNIX2003"
+    )]
+    pub fn system(s: *const c_char) -> c_int;
+    pub fn getenv(s: *const c_char) -> *mut c_char;
+
+    pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char;
+    pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
+    pub fn stpcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char;
+    pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char;
+    pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char;
+    pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int;
+    pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int;
+    pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int;
+    pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char;
+    pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char;
+    pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t;
+    pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t;
+    pub fn strdup(cs: *const c_char) -> *mut c_char;
+    pub fn strndup(cs: *const c_char, n: size_t) -> *mut c_char;
+    pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char;
+    pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
+    pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int;
+    pub fn strncasecmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int;
+    pub fn strlen(cs: *const c_char) -> size_t;
+    pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "strerror$UNIX2003"
+    )]
+    pub fn strerror(n: c_int) -> *mut c_char;
+    pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char;
+    pub fn strtok_r(s: *mut c_char, t: *const c_char, p: *mut *mut c_char) -> *mut c_char;
+    pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t;
+    pub fn strsignal(sig: c_int) -> *mut c_char;
+    pub fn wcslen(buf: *const wchar_t) -> size_t;
+    pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> ::size_t;
+
+    pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
+    pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t;
+    pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
+    pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
+    pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
+    pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
+}
+
+extern "C" {
+    #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam50")]
+    pub fn getpwnam(name: *const ::c_char) -> *mut passwd;
+    #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid50")]
+    pub fn getpwuid(uid: ::uid_t) -> *mut passwd;
+
+    pub fn fprintf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
+    pub fn printf(format: *const ::c_char, ...) -> ::c_int;
+    pub fn snprintf(s: *mut ::c_char, n: ::size_t, format: *const ::c_char, ...) -> ::c_int;
+    pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "linux", not(target_env = "uclibc")),
+        link_name = "__isoc99_fscanf"
+    )]
+    pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "linux", not(target_env = "uclibc")),
+        link_name = "__isoc99_scanf"
+    )]
+    pub fn scanf(format: *const ::c_char, ...) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "linux", not(target_env = "uclibc")),
+        link_name = "__isoc99_sscanf"
+    )]
+    pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int;
+    pub fn getchar_unlocked() -> ::c_int;
+    pub fn putchar_unlocked(c: ::c_int) -> ::c_int;
+
+    #[cfg(not(all(
+        libc_cfg_target_vendor,
+        target_arch = "powerpc",
+        target_vendor = "nintendo"
+    )))]
+    #[cfg_attr(target_os = "netbsd", link_name = "__socket30")]
+    #[cfg_attr(target_os = "illumos", link_name = "__xnet_socket")]
+    #[cfg_attr(target_os = "espidf", link_name = "lwip_socket")]
+    pub fn socket(domain: ::c_int, ty: ::c_int, protocol: ::c_int) -> ::c_int;
+    #[cfg(not(all(
+        libc_cfg_target_vendor,
+        target_arch = "powerpc",
+        target_vendor = "nintendo"
+    )))]
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "connect$UNIX2003"
+    )]
+    #[cfg_attr(target_os = "illumos", link_name = "__xnet_connect")]
+    #[cfg_attr(target_os = "espidf", link_name = "lwip_connect")]
+    pub fn connect(socket: ::c_int, address: *const sockaddr, len: socklen_t) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "listen$UNIX2003"
+    )]
+    #[cfg_attr(target_os = "espidf", link_name = "lwip_listen")]
+    pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int;
+    #[cfg(not(all(
+        libc_cfg_target_vendor,
+        target_arch = "powerpc",
+        target_vendor = "nintendo"
+    )))]
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "accept$UNIX2003"
+    )]
+    #[cfg_attr(target_os = "espidf", link_name = "lwip_accept")]
+    pub fn accept(socket: ::c_int, address: *mut sockaddr, address_len: *mut socklen_t) -> ::c_int;
+    #[cfg(not(all(
+        libc_cfg_target_vendor,
+        target_arch = "powerpc",
+        target_vendor = "nintendo"
+    )))]
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "getpeername$UNIX2003"
+    )]
+    #[cfg_attr(target_os = "espidf", link_name = "lwip_getpeername")]
+    pub fn getpeername(
+        socket: ::c_int,
+        address: *mut sockaddr,
+        address_len: *mut socklen_t,
+    ) -> ::c_int;
+    #[cfg(not(all(
+        libc_cfg_target_vendor,
+        target_arch = "powerpc",
+        target_vendor = "nintendo"
+    )))]
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "getsockname$UNIX2003"
+    )]
+    #[cfg_attr(target_os = "espidf", link_name = "lwip_getsockname")]
+    pub fn getsockname(
+        socket: ::c_int,
+        address: *mut sockaddr,
+        address_len: *mut socklen_t,
+    ) -> ::c_int;
+    #[cfg_attr(target_os = "espidf", link_name = "lwip_setsockopt")]
+    pub fn setsockopt(
+        socket: ::c_int,
+        level: ::c_int,
+        name: ::c_int,
+        value: *const ::c_void,
+        option_len: socklen_t,
+    ) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "socketpair$UNIX2003"
+    )]
+    #[cfg_attr(target_os = "illumos", link_name = "__xnet_socketpair")]
+    pub fn socketpair(
+        domain: ::c_int,
+        type_: ::c_int,
+        protocol: ::c_int,
+        socket_vector: *mut ::c_int,
+    ) -> ::c_int;
+    #[cfg(not(all(
+        libc_cfg_target_vendor,
+        target_arch = "powerpc",
+        target_vendor = "nintendo"
+    )))]
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "sendto$UNIX2003"
+    )]
+    #[cfg_attr(target_os = "illumos", link_name = "__xnet_sendto")]
+    #[cfg_attr(target_os = "espidf", link_name = "lwip_sendto")]
+    pub fn sendto(
+        socket: ::c_int,
+        buf: *const ::c_void,
+        len: ::size_t,
+        flags: ::c_int,
+        addr: *const sockaddr,
+        addrlen: socklen_t,
+    ) -> ::ssize_t;
+    #[cfg_attr(target_os = "espidf", link_name = "lwip_shutdown")]
+    pub fn shutdown(socket: ::c_int, how: ::c_int) -> ::c_int;
+
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "chmod$UNIX2003"
+    )]
+    pub fn chmod(path: *const c_char, mode: mode_t) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "fchmod$UNIX2003"
+    )]
+    pub fn fchmod(fd: ::c_int, mode: mode_t) -> ::c_int;
+
+    #[cfg_attr(
+        all(target_os = "macos", not(target_arch = "aarch64")),
+        link_name = "fstat$INODE64"
+    )]
+    #[cfg_attr(target_os = "netbsd", link_name = "__fstat50")]
+    #[cfg_attr(
+        all(target_os = "freebsd", any(freebsd11, freebsd10)),
+        link_name = "fstat@FBSD_1.0"
+    )]
+    pub fn fstat(fildes: ::c_int, buf: *mut stat) -> ::c_int;
+
+    pub fn mkdir(path: *const c_char, mode: mode_t) -> ::c_int;
+
+    #[cfg_attr(
+        all(target_os = "macos", not(target_arch = "aarch64")),
+        link_name = "stat$INODE64"
+    )]
+    #[cfg_attr(target_os = "netbsd", link_name = "__stat50")]
+    #[cfg_attr(
+        all(target_os = "freebsd", any(freebsd11, freebsd10)),
+        link_name = "stat@FBSD_1.0"
+    )]
+    pub fn stat(path: *const c_char, buf: *mut stat) -> ::c_int;
+
+    pub fn pclose(stream: *mut ::FILE) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "fdopen$UNIX2003"
+    )]
+    pub fn fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE;
+    pub fn fileno(stream: *mut ::FILE) -> ::c_int;
+
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "open$UNIX2003"
+    )]
+    pub fn open(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "creat$UNIX2003"
+    )]
+    pub fn creat(path: *const c_char, mode: mode_t) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "fcntl$UNIX2003"
+    )]
+    pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int;
+
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86_64"),
+        link_name = "opendir$INODE64"
+    )]
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "opendir$INODE64$UNIX2003"
+    )]
+    #[cfg_attr(target_os = "netbsd", link_name = "__opendir30")]
+    pub fn opendir(dirname: *const c_char) -> *mut ::DIR;
+
+    #[cfg_attr(
+        all(target_os = "macos", not(target_arch = "aarch64")),
+        link_name = "readdir$INODE64"
+    )]
+    #[cfg_attr(target_os = "netbsd", link_name = "__readdir30")]
+    #[cfg_attr(
+        all(target_os = "freebsd", any(freebsd11, freebsd10)),
+        link_name = "readdir@FBSD_1.0"
+    )]
+    pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "closedir$UNIX2003"
+    )]
+    pub fn closedir(dirp: *mut ::DIR) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86_64"),
+        link_name = "rewinddir$INODE64"
+    )]
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "rewinddir$INODE64$UNIX2003"
+    )]
+    pub fn rewinddir(dirp: *mut ::DIR);
+
+    pub fn fchmodat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::mode_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn fchown(fd: ::c_int, owner: ::uid_t, group: ::gid_t) -> ::c_int;
+    pub fn fchownat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        owner: ::uid_t,
+        group: ::gid_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", not(target_arch = "aarch64")),
+        link_name = "fstatat$INODE64"
+    )]
+    #[cfg_attr(
+        all(target_os = "freebsd", any(freebsd11, freebsd10)),
+        link_name = "fstatat@FBSD_1.1"
+    )]
+    pub fn fstatat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        buf: *mut stat,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn linkat(
+        olddirfd: ::c_int,
+        oldpath: *const ::c_char,
+        newdirfd: ::c_int,
+        newpath: *const ::c_char,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn renameat(
+        olddirfd: ::c_int,
+        oldpath: *const ::c_char,
+        newdirfd: ::c_int,
+        newpath: *const ::c_char,
+    ) -> ::c_int;
+    pub fn symlinkat(
+        target: *const ::c_char,
+        newdirfd: ::c_int,
+        linkpath: *const ::c_char,
+    ) -> ::c_int;
+    pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int) -> ::c_int;
+
+    pub fn access(path: *const c_char, amode: ::c_int) -> ::c_int;
+    pub fn alarm(seconds: ::c_uint) -> ::c_uint;
+    pub fn chdir(dir: *const c_char) -> ::c_int;
+    pub fn fchdir(dirfd: ::c_int) -> ::c_int;
+    pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "lchown$UNIX2003"
+    )]
+    pub fn lchown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "close$NOCANCEL$UNIX2003"
+    )]
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86_64"),
+        link_name = "close$NOCANCEL"
+    )]
+    pub fn close(fd: ::c_int) -> ::c_int;
+    pub fn dup(fd: ::c_int) -> ::c_int;
+    pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int;
+    pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> ::c_int;
+    pub fn execle(path: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int;
+    pub fn execlp(file: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int;
+    pub fn execv(prog: *const c_char, argv: *const *const c_char) -> ::c_int;
+    pub fn execve(
+        prog: *const c_char,
+        argv: *const *const c_char,
+        envp: *const *const c_char,
+    ) -> ::c_int;
+    pub fn execvp(c: *const c_char, argv: *const *const c_char) -> ::c_int;
+    pub fn fork() -> pid_t;
+    pub fn fpathconf(filedes: ::c_int, name: ::c_int) -> c_long;
+    pub fn getcwd(buf: *mut c_char, size: ::size_t) -> *mut c_char;
+    pub fn getegid() -> gid_t;
+    pub fn geteuid() -> uid_t;
+    pub fn getgid() -> gid_t;
+    pub fn getgroups(ngroups_max: ::c_int, groups: *mut gid_t) -> ::c_int;
+    #[cfg_attr(target_os = "illumos", link_name = "getloginx")]
+    pub fn getlogin() -> *mut c_char;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "getopt$UNIX2003"
+    )]
+    pub fn getopt(argc: ::c_int, argv: *const *mut c_char, optstr: *const c_char) -> ::c_int;
+    pub fn getpgid(pid: pid_t) -> pid_t;
+    pub fn getpgrp() -> pid_t;
+    pub fn getpid() -> pid_t;
+    pub fn getppid() -> pid_t;
+    pub fn getuid() -> uid_t;
+    pub fn isatty(fd: ::c_int) -> ::c_int;
+    pub fn link(src: *const c_char, dst: *const c_char) -> ::c_int;
+    pub fn lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t;
+    pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long;
+    pub fn pipe(fds: *mut ::c_int) -> ::c_int;
+    pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "read$UNIX2003"
+    )]
+    pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) -> ::ssize_t;
+    pub fn rmdir(path: *const c_char) -> ::c_int;
+    pub fn seteuid(uid: uid_t) -> ::c_int;
+    pub fn setegid(gid: gid_t) -> ::c_int;
+    pub fn setgid(gid: gid_t) -> ::c_int;
+    pub fn setpgid(pid: pid_t, pgid: pid_t) -> ::c_int;
+    pub fn setsid() -> pid_t;
+    pub fn setuid(uid: uid_t) -> ::c_int;
+    pub fn setreuid(ruid: uid_t, euid: uid_t) -> ::c_int;
+    pub fn setregid(rgid: gid_t, egid: gid_t) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "sleep$UNIX2003"
+    )]
+    pub fn sleep(secs: ::c_uint) -> ::c_uint;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "nanosleep$UNIX2003"
+    )]
+    #[cfg_attr(target_os = "netbsd", link_name = "__nanosleep50")]
+    pub fn nanosleep(rqtp: *const timespec, rmtp: *mut timespec) -> ::c_int;
+    pub fn tcgetpgrp(fd: ::c_int) -> pid_t;
+    pub fn tcsetpgrp(fd: ::c_int, pgrp: ::pid_t) -> ::c_int;
+    pub fn ttyname(fd: ::c_int) -> *mut c_char;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "ttyname_r$UNIX2003"
+    )]
+    #[cfg_attr(target_os = "illumos", link_name = "__posix_ttyname_r")]
+    pub fn ttyname_r(fd: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
+    pub fn unlink(c: *const c_char) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "wait$UNIX2003"
+    )]
+    pub fn wait(status: *mut ::c_int) -> pid_t;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "waitpid$UNIX2003"
+    )]
+    pub fn waitpid(pid: pid_t, status: *mut ::c_int, options: ::c_int) -> pid_t;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "write$UNIX2003"
+    )]
+    pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) -> ::ssize_t;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "pread$UNIX2003"
+    )]
+    pub fn pread(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "pwrite$UNIX2003"
+    )]
+    pub fn pwrite(fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
+    pub fn umask(mask: mode_t) -> mode_t;
+
+    #[cfg_attr(target_os = "netbsd", link_name = "__utime50")]
+    pub fn utime(file: *const c_char, buf: *const utimbuf) -> ::c_int;
+
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "kill$UNIX2003"
+    )]
+    pub fn kill(pid: pid_t, sig: ::c_int) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "killpg$UNIX2003"
+    )]
+    pub fn killpg(pgrp: pid_t, sig: ::c_int) -> ::c_int;
+
+    pub fn mlock(addr: *const ::c_void, len: ::size_t) -> ::c_int;
+    pub fn munlock(addr: *const ::c_void, len: ::size_t) -> ::c_int;
+    pub fn mlockall(flags: ::c_int) -> ::c_int;
+    pub fn munlockall() -> ::c_int;
+
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "mmap$UNIX2003"
+    )]
+    pub fn mmap(
+        addr: *mut ::c_void,
+        len: ::size_t,
+        prot: ::c_int,
+        flags: ::c_int,
+        fd: ::c_int,
+        offset: off_t,
+    ) -> *mut ::c_void;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "munmap$UNIX2003"
+    )]
+    pub fn munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int;
+
+    pub fn if_nametoindex(ifname: *const c_char) -> ::c_uint;
+    pub fn if_indextoname(ifindex: ::c_uint, ifname: *mut ::c_char) -> *mut ::c_char;
+
+    #[cfg_attr(
+        all(target_os = "macos", not(target_arch = "aarch64")),
+        link_name = "lstat$INODE64"
+    )]
+    #[cfg_attr(target_os = "netbsd", link_name = "__lstat50")]
+    #[cfg_attr(
+        all(target_os = "freebsd", any(freebsd11, freebsd10)),
+        link_name = "lstat@FBSD_1.0"
+    )]
+    pub fn lstat(path: *const c_char, buf: *mut stat) -> ::c_int;
+
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "fsync$UNIX2003"
+    )]
+    pub fn fsync(fd: ::c_int) -> ::c_int;
+
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "setenv$UNIX2003"
+    )]
+    pub fn setenv(name: *const c_char, val: *const c_char, overwrite: ::c_int) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "unsetenv$UNIX2003"
+    )]
+    #[cfg_attr(target_os = "netbsd", link_name = "__unsetenv13")]
+    pub fn unsetenv(name: *const c_char) -> ::c_int;
+
+    pub fn symlink(path1: *const c_char, path2: *const c_char) -> ::c_int;
+
+    pub fn truncate(path: *const c_char, length: off_t) -> ::c_int;
+    pub fn ftruncate(fd: ::c_int, length: off_t) -> ::c_int;
+
+    pub fn signal(signum: ::c_int, handler: sighandler_t) -> sighandler_t;
+
+    #[cfg_attr(target_os = "netbsd", link_name = "__getrusage50")]
+    pub fn getrusage(resource: ::c_int, usage: *mut rusage) -> ::c_int;
+
+    #[cfg_attr(
+        any(
+            target_os = "macos",
+            target_os = "ios",
+            target_os = "tvos",
+            target_os = "watchos",
+            target_os = "visionos"
+        ),
+        link_name = "realpath$DARWIN_EXTSN"
+    )]
+    pub fn realpath(pathname: *const ::c_char, resolved: *mut ::c_char) -> *mut ::c_char;
+
+    pub fn flock(fd: ::c_int, operation: ::c_int) -> ::c_int;
+
+    #[cfg_attr(target_os = "netbsd", link_name = "__times13")]
+    pub fn times(buf: *mut ::tms) -> ::clock_t;
+
+    pub fn pthread_self() -> ::pthread_t;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "pthread_join$UNIX2003"
+    )]
+    pub fn pthread_join(native: ::pthread_t, value: *mut *mut ::c_void) -> ::c_int;
+    pub fn pthread_exit(value: *mut ::c_void) -> !;
+    pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int;
+    pub fn pthread_attr_destroy(attr: *mut ::pthread_attr_t) -> ::c_int;
+    pub fn pthread_attr_getstacksize(
+        attr: *const ::pthread_attr_t,
+        stacksize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_attr_setstacksize(attr: *mut ::pthread_attr_t, stack_size: ::size_t) -> ::c_int;
+    pub fn pthread_attr_setdetachstate(attr: *mut ::pthread_attr_t, state: ::c_int) -> ::c_int;
+    pub fn pthread_detach(thread: ::pthread_t) -> ::c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__libc_thr_yield")]
+    pub fn sched_yield() -> ::c_int;
+    pub fn pthread_key_create(
+        key: *mut pthread_key_t,
+        dtor: ::Option<unsafe extern "C" fn(*mut ::c_void)>,
+    ) -> ::c_int;
+    pub fn pthread_key_delete(key: pthread_key_t) -> ::c_int;
+    pub fn pthread_getspecific(key: pthread_key_t) -> *mut ::c_void;
+    pub fn pthread_setspecific(key: pthread_key_t, value: *const ::c_void) -> ::c_int;
+    pub fn pthread_mutex_init(
+        lock: *mut pthread_mutex_t,
+        attr: *const pthread_mutexattr_t,
+    ) -> ::c_int;
+    pub fn pthread_mutex_destroy(lock: *mut pthread_mutex_t) -> ::c_int;
+    pub fn pthread_mutex_lock(lock: *mut pthread_mutex_t) -> ::c_int;
+    pub fn pthread_mutex_trylock(lock: *mut pthread_mutex_t) -> ::c_int;
+    pub fn pthread_mutex_unlock(lock: *mut pthread_mutex_t) -> ::c_int;
+
+    pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "pthread_mutexattr_destroy$UNIX2003"
+    )]
+    pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> ::c_int;
+    pub fn pthread_mutexattr_settype(attr: *mut pthread_mutexattr_t, _type: ::c_int) -> ::c_int;
+
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "pthread_cond_init$UNIX2003"
+    )]
+    pub fn pthread_cond_init(cond: *mut pthread_cond_t, attr: *const pthread_condattr_t)
+        -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "pthread_cond_wait$UNIX2003"
+    )]
+    pub fn pthread_cond_wait(cond: *mut pthread_cond_t, lock: *mut pthread_mutex_t) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "pthread_cond_timedwait$UNIX2003"
+    )]
+    pub fn pthread_cond_timedwait(
+        cond: *mut pthread_cond_t,
+        lock: *mut pthread_mutex_t,
+        abstime: *const ::timespec,
+    ) -> ::c_int;
+    pub fn pthread_cond_signal(cond: *mut pthread_cond_t) -> ::c_int;
+    pub fn pthread_cond_broadcast(cond: *mut pthread_cond_t) -> ::c_int;
+    pub fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> ::c_int;
+    pub fn pthread_condattr_init(attr: *mut pthread_condattr_t) -> ::c_int;
+    pub fn pthread_condattr_destroy(attr: *mut pthread_condattr_t) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "pthread_rwlock_init$UNIX2003"
+    )]
+    pub fn pthread_rwlock_init(
+        lock: *mut pthread_rwlock_t,
+        attr: *const pthread_rwlockattr_t,
+    ) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "pthread_rwlock_destroy$UNIX2003"
+    )]
+    pub fn pthread_rwlock_destroy(lock: *mut pthread_rwlock_t) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "pthread_rwlock_rdlock$UNIX2003"
+    )]
+    pub fn pthread_rwlock_rdlock(lock: *mut pthread_rwlock_t) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "pthread_rwlock_tryrdlock$UNIX2003"
+    )]
+    pub fn pthread_rwlock_tryrdlock(lock: *mut pthread_rwlock_t) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "pthread_rwlock_wrlock$UNIX2003"
+    )]
+    pub fn pthread_rwlock_wrlock(lock: *mut pthread_rwlock_t) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "pthread_rwlock_trywrlock$UNIX2003"
+    )]
+    pub fn pthread_rwlock_trywrlock(lock: *mut pthread_rwlock_t) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "pthread_rwlock_unlock$UNIX2003"
+    )]
+    pub fn pthread_rwlock_unlock(lock: *mut pthread_rwlock_t) -> ::c_int;
+    pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t) -> ::c_int;
+    pub fn pthread_rwlockattr_destroy(attr: *mut pthread_rwlockattr_t) -> ::c_int;
+
+    #[cfg_attr(target_os = "illumos", link_name = "__xnet_getsockopt")]
+    #[cfg_attr(target_os = "espidf", link_name = "lwip_getsockopt")]
+    pub fn getsockopt(
+        sockfd: ::c_int,
+        level: ::c_int,
+        optname: ::c_int,
+        optval: *mut ::c_void,
+        optlen: *mut ::socklen_t,
+    ) -> ::c_int;
+    pub fn raise(signum: ::c_int) -> ::c_int;
+
+    #[cfg_attr(target_os = "netbsd", link_name = "__utimes50")]
+    pub fn utimes(filename: *const ::c_char, times: *const ::timeval) -> ::c_int;
+    pub fn dlopen(filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void;
+    pub fn dlerror() -> *mut ::c_char;
+    pub fn dlsym(handle: *mut ::c_void, symbol: *const ::c_char) -> *mut ::c_void;
+    pub fn dlclose(handle: *mut ::c_void) -> ::c_int;
+
+    #[cfg(not(all(
+        libc_cfg_target_vendor,
+        target_arch = "powerpc",
+        target_vendor = "nintendo"
+    )))]
+    #[cfg_attr(target_os = "illumos", link_name = "__xnet_getaddrinfo")]
+    #[cfg_attr(target_os = "espidf", link_name = "lwip_getaddrinfo")]
+    pub fn getaddrinfo(
+        node: *const c_char,
+        service: *const c_char,
+        hints: *const addrinfo,
+        res: *mut *mut addrinfo,
+    ) -> ::c_int;
+    #[cfg(not(all(
+        libc_cfg_target_vendor,
+        target_arch = "powerpc",
+        target_vendor = "nintendo"
+    )))]
+    #[cfg_attr(target_os = "espidf", link_name = "lwip_freeaddrinfo")]
+    pub fn freeaddrinfo(res: *mut addrinfo);
+    pub fn hstrerror(errcode: ::c_int) -> *const ::c_char;
+    pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char;
+    #[cfg_attr(
+        any(
+            all(
+                target_os = "linux",
+                not(any(target_env = "musl", target_env = "ohos"))
+            ),
+            target_os = "freebsd",
+            target_os = "dragonfly",
+            target_os = "haiku"
+        ),
+        link_name = "__res_init"
+    )]
+    #[cfg_attr(
+        any(
+            target_os = "macos",
+            target_os = "ios",
+            target_os = "tvos",
+            target_os = "watchos",
+            target_os = "visionos"
+        ),
+        link_name = "res_9_init"
+    )]
+    pub fn res_init() -> ::c_int;
+
+    #[cfg_attr(target_os = "netbsd", link_name = "__gmtime_r50")]
+    #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
+    // FIXME: for `time_t`
+    pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
+    #[cfg_attr(target_os = "netbsd", link_name = "__localtime_r50")]
+    #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
+    // FIXME: for `time_t`
+    pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "mktime$UNIX2003"
+    )]
+    #[cfg_attr(target_os = "netbsd", link_name = "__mktime50")]
+    #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
+    // FIXME: for `time_t`
+    pub fn mktime(tm: *mut tm) -> time_t;
+    #[cfg_attr(target_os = "netbsd", link_name = "__time50")]
+    #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
+    // FIXME: for `time_t`
+    pub fn time(time: *mut time_t) -> time_t;
+    #[cfg_attr(target_os = "netbsd", link_name = "__gmtime50")]
+    #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
+    // FIXME: for `time_t`
+    pub fn gmtime(time_p: *const time_t) -> *mut tm;
+    #[cfg_attr(target_os = "netbsd", link_name = "__locatime50")]
+    #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
+    // FIXME: for `time_t`
+    pub fn localtime(time_p: *const time_t) -> *mut tm;
+    #[cfg_attr(target_os = "netbsd", link_name = "__difftime50")]
+    #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
+    // FIXME: for `time_t`
+    pub fn difftime(time1: time_t, time0: time_t) -> ::c_double;
+    #[cfg_attr(target_os = "netbsd", link_name = "__timegm50")]
+    #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
+    // FIXME: for `time_t`
+    pub fn timegm(tm: *mut ::tm) -> time_t;
+
+    #[cfg_attr(target_os = "netbsd", link_name = "__mknod50")]
+    #[cfg_attr(
+        all(target_os = "freebsd", any(freebsd11, freebsd10)),
+        link_name = "mknod@FBSD_1.0"
+    )]
+    pub fn mknod(pathname: *const ::c_char, mode: ::mode_t, dev: ::dev_t) -> ::c_int;
+    pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
+    pub fn endservent();
+    pub fn getservbyname(name: *const ::c_char, proto: *const ::c_char) -> *mut servent;
+    pub fn getservbyport(port: ::c_int, proto: *const ::c_char) -> *mut servent;
+    pub fn getservent() -> *mut servent;
+    pub fn setservent(stayopen: ::c_int);
+    pub fn getprotobyname(name: *const ::c_char) -> *mut protoent;
+    pub fn getprotobynumber(proto: ::c_int) -> *mut protoent;
+    pub fn chroot(name: *const ::c_char) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "usleep$UNIX2003"
+    )]
+    pub fn usleep(secs: ::c_uint) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "send$UNIX2003"
+    )]
+    #[cfg_attr(target_os = "espidf", link_name = "lwip_send")]
+    pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "recv$UNIX2003"
+    )]
+    #[cfg_attr(target_os = "espidf", link_name = "lwip_recv")]
+    pub fn recv(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "putenv$UNIX2003"
+    )]
+    #[cfg_attr(target_os = "netbsd", link_name = "__putenv50")]
+    pub fn putenv(string: *mut c_char) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "poll$UNIX2003"
+    )]
+    pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86_64"),
+        link_name = "select$1050"
+    )]
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "select$UNIX2003"
+    )]
+    #[cfg_attr(target_os = "netbsd", link_name = "__select50")]
+    pub fn select(
+        nfds: ::c_int,
+        readfds: *mut fd_set,
+        writefds: *mut fd_set,
+        errorfds: *mut fd_set,
+        timeout: *mut timeval,
+    ) -> ::c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__setlocale50")]
+    pub fn setlocale(category: ::c_int, locale: *const ::c_char) -> *mut ::c_char;
+    pub fn localeconv() -> *mut lconv;
+
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "sem_wait$UNIX2003"
+    )]
+    pub fn sem_wait(sem: *mut sem_t) -> ::c_int;
+    pub fn sem_trywait(sem: *mut sem_t) -> ::c_int;
+    pub fn sem_post(sem: *mut sem_t) -> ::c_int;
+    pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> ::c_int;
+    pub fn fstatvfs(fd: ::c_int, buf: *mut statvfs) -> ::c_int;
+
+    #[cfg_attr(target_os = "netbsd", link_name = "__sigemptyset14")]
+    pub fn sigemptyset(set: *mut sigset_t) -> ::c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__sigaddset14")]
+    pub fn sigaddset(set: *mut sigset_t, signum: ::c_int) -> ::c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__sigfillset14")]
+    pub fn sigfillset(set: *mut sigset_t) -> ::c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__sigdelset14")]
+    pub fn sigdelset(set: *mut sigset_t, signum: ::c_int) -> ::c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__sigismember14")]
+    pub fn sigismember(set: *const sigset_t, signum: ::c_int) -> ::c_int;
+
+    #[cfg_attr(target_os = "netbsd", link_name = "__sigprocmask14")]
+    pub fn sigprocmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__sigpending14")]
+    pub fn sigpending(set: *mut sigset_t) -> ::c_int;
+
+    pub fn sysconf(name: ::c_int) -> ::c_long;
+
+    pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int;
+
+    pub fn fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int;
+    pub fn ftello(stream: *mut ::FILE) -> ::off_t;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "tcdrain$UNIX2003"
+    )]
+    pub fn tcdrain(fd: ::c_int) -> ::c_int;
+    pub fn cfgetispeed(termios: *const ::termios) -> ::speed_t;
+    pub fn cfgetospeed(termios: *const ::termios) -> ::speed_t;
+    pub fn cfsetispeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
+    pub fn cfsetospeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
+    pub fn tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int;
+    pub fn tcsetattr(fd: ::c_int, optional_actions: ::c_int, termios: *const ::termios) -> ::c_int;
+    pub fn tcflow(fd: ::c_int, action: ::c_int) -> ::c_int;
+    pub fn tcflush(fd: ::c_int, action: ::c_int) -> ::c_int;
+    pub fn tcgetsid(fd: ::c_int) -> ::pid_t;
+    pub fn tcsendbreak(fd: ::c_int, duration: ::c_int) -> ::c_int;
+    pub fn mkstemp(template: *mut ::c_char) -> ::c_int;
+    pub fn mkdtemp(template: *mut ::c_char) -> *mut ::c_char;
+
+    pub fn tmpnam(ptr: *mut ::c_char) -> *mut ::c_char;
+
+    pub fn openlog(ident: *const ::c_char, logopt: ::c_int, facility: ::c_int);
+    pub fn closelog();
+    pub fn setlogmask(maskpri: ::c_int) -> ::c_int;
+    #[cfg_attr(target_os = "macos", link_name = "syslog$DARWIN_EXTSN")]
+    pub fn syslog(priority: ::c_int, message: *const ::c_char, ...);
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "nice$UNIX2003"
+    )]
+    pub fn nice(incr: ::c_int) -> ::c_int;
+
+    pub fn grantpt(fd: ::c_int) -> ::c_int;
+    pub fn posix_openpt(flags: ::c_int) -> ::c_int;
+    pub fn ptsname(fd: ::c_int) -> *mut ::c_char;
+    pub fn unlockpt(fd: ::c_int) -> ::c_int;
+
+    pub fn strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
+    pub fn getline(lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t;
+
+    pub fn lockf(fd: ::c_int, cmd: ::c_int, len: ::off_t) -> ::c_int;
+
+}
+
+cfg_if! {
+    if #[cfg(not(any(target_os = "emscripten",
+                     target_os = "android",
+                     target_os = "haiku",
+                     target_os = "nto")))] {
+        extern "C" {
+            pub fn adjtime(delta: *const timeval, olddelta: *mut timeval) -> ::c_int;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(not(any(target_os = "emscripten",
+                     target_os = "android",
+                     target_os = "nto")))] {
+        extern "C" {
+            pub fn stpncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(not(target_os = "aix"))] {
+        extern "C" {
+            pub fn dladdr(addr: *const ::c_void, info: *mut Dl_info) -> ::c_int;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(not(any(target_env = "uclibc", target_os = "nto")))] {
+        extern "C" {
+            pub fn open_wmemstream(
+                ptr: *mut *mut wchar_t,
+                sizeloc: *mut size_t,
+            ) -> *mut FILE;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(not(target_os = "redox"))] {
+        extern {
+            pub fn getsid(pid: pid_t) -> pid_t;
+            #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
+                       link_name = "pause$UNIX2003")]
+            pub fn pause() -> ::c_int;
+
+            pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char,
+                          mode: ::mode_t) -> ::c_int;
+            pub fn openat(dirfd: ::c_int, pathname: *const ::c_char,
+                          flags: ::c_int, ...) -> ::c_int;
+
+            #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"),
+                       link_name = "fdopendir$INODE64")]
+            #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
+                       link_name = "fdopendir$INODE64$UNIX2003")]
+            pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
+
+            #[cfg_attr(all(target_os = "macos", not(target_arch = "aarch64")),
+                       link_name = "readdir_r$INODE64")]
+            #[cfg_attr(target_os = "netbsd", link_name = "__readdir_r30")]
+            #[cfg_attr(
+                all(target_os = "freebsd", any(freebsd11, freebsd10)),
+                link_name = "readdir_r@FBSD_1.0"
+            )]
+            #[allow(non_autolinks)] // FIXME: `<>` breaks line length limit.
+            /// The 64-bit libc on Solaris and illumos only has readdir_r. If a
+            /// 32-bit Solaris or illumos target is ever created, it should use
+            /// __posix_readdir_r. See libc(3LIB) on Solaris or illumos:
+            /// https://illumos.org/man/3lib/libc
+            /// https://docs.oracle.com/cd/E36784_01/html/E36873/libc-3lib.html
+            /// https://www.unix.com/man-page/opensolaris/3LIB/libc/
+            pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent,
+                             result: *mut *mut ::dirent) -> ::c_int;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_os = "nto")] {
+        extern {
+            pub fn readlinkat(dirfd: ::c_int,
+                pathname: *const ::c_char,
+                buf: *mut ::c_char,
+                bufsiz: ::size_t) -> ::c_int;
+            pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::c_int;
+            pub fn pselect(
+                nfds: ::c_int,
+                readfds: *mut fd_set,
+                writefds: *mut fd_set,
+                errorfds: *mut fd_set,
+                timeout: *mut timespec,
+                sigmask: *const sigset_t,
+            ) -> ::c_int;
+            pub fn sigaction(
+                signum: ::c_int,
+                act: *const sigaction,
+                oldact: *mut sigaction
+            ) -> ::c_int;
+        }
+    } else {
+        extern {
+            pub fn readlinkat(dirfd: ::c_int,
+                pathname: *const ::c_char,
+                buf: *mut ::c_char,
+                bufsiz: ::size_t) -> ::ssize_t;
+            pub fn fmemopen(buf: *mut c_void, size: size_t, mode: *const c_char) -> *mut FILE;
+            pub fn open_memstream(ptr: *mut *mut c_char, sizeloc: *mut size_t) -> *mut FILE;
+            pub fn atexit(cb: extern "C" fn()) -> c_int;
+            #[cfg_attr(target_os = "netbsd", link_name = "__sigaction14")]
+            pub fn sigaction(
+                signum: ::c_int,
+                act: *const sigaction,
+                oldact: *mut sigaction
+            ) -> ::c_int;
+            pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::ssize_t;
+            #[cfg_attr(
+                all(target_os = "macos", target_arch = "x86_64"),
+                link_name = "pselect$1050"
+            )]
+            #[cfg_attr(
+                all(target_os = "macos", target_arch = "x86"),
+                link_name = "pselect$UNIX2003"
+            )]
+            #[cfg_attr(target_os = "netbsd", link_name = "__pselect50")]
+            pub fn pselect(
+                nfds: ::c_int,
+                readfds: *mut fd_set,
+                writefds: *mut fd_set,
+                errorfds: *mut fd_set,
+                timeout: *const timespec,
+                sigmask: *const sigset_t,
+            ) -> ::c_int;
+        }
+    }
+}
+
+cfg_if! {
+   if #[cfg(not(any(target_os = "solaris",
+                    target_os = "illumos",
+                    target_os = "nto",
+                )))] {
+        extern {
+            pub fn cfmakeraw(termios: *mut ::termios);
+            pub fn cfsetspeed(termios: *mut ::termios,
+                              speed: ::speed_t) -> ::c_int;
+        }
+   }
+}
+
+cfg_if! {
+    if #[cfg(target_env = "newlib")] {
+        mod newlib;
+        pub use self::newlib::*;
+    } else if #[cfg(any(target_os = "linux",
+                        target_os = "l4re",
+                        target_os = "android",
+                        target_os = "emscripten"))] {
+        mod linux_like;
+        pub use self::linux_like::*;
+    } else if #[cfg(any(target_os = "macos",
+                        target_os = "ios",
+                        target_os = "tvos",
+                        target_os = "watchos",
+                        target_os = "visionos",
+                        target_os = "freebsd",
+                        target_os = "dragonfly",
+                        target_os = "openbsd",
+                        target_os = "netbsd"))] {
+        mod bsd;
+        pub use self::bsd::*;
+    } else if #[cfg(any(target_os = "solaris",
+                        target_os = "illumos"))] {
+        mod solarish;
+        pub use self::solarish::*;
+    } else if #[cfg(target_os = "haiku")] {
+        mod haiku;
+        pub use self::haiku::*;
+    } else if #[cfg(target_os = "redox")] {
+        mod redox;
+        pub use self::redox::*;
+    } else if #[cfg(target_os = "nto")] {
+        mod nto;
+        pub use self::nto::*;
+    } else if #[cfg(target_os = "aix")] {
+        mod aix;
+        pub use self::aix::*;
+    } else if #[cfg(target_os = "hurd")] {
+        mod hurd;
+        pub use self::hurd::*;
+    } else {
+        // Unknown target_os
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_core_cvoid)] {
+        pub use ::ffi::c_void;
+    } else {
+        // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
+        // enable more optimization opportunities around it recognizing things
+        // like malloc/free.
+        #[repr(u8)]
+        #[allow(missing_copy_implementations)]
+        #[allow(missing_debug_implementations)]
+        pub enum c_void {
+            // Two dummy variants so the #[repr] attribute can be used.
+            #[doc(hidden)]
+            __variant1,
+            #[doc(hidden)]
+            __variant2,
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    } else {
+        mod no_align;
+        pub use self::no_align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/newlib/aarch64/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/newlib/aarch64/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/newlib/aarch64/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/newlib/aarch64/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,54 @@
+pub type clock_t = ::c_long;
+pub type c_char = u8;
+pub type wchar_t = u32;
+
+pub type c_long = i64;
+pub type c_ulong = u64;
+
+s! {
+    pub struct sockaddr {
+        pub sa_len: u8,
+        pub sa_family: ::sa_family_t,
+        pub sa_data: [::c_char; 14],
+    }
+
+    pub struct sockaddr_in6 {
+        pub sin6_len: u8,
+        pub sin6_family: ::sa_family_t,
+        pub sin6_port: ::in_port_t,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_scope_id: u32,
+    }
+
+    pub struct sockaddr_in {
+        pub sin_len: u8,
+        pub sin_family: ::sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [::c_char; 8],
+    }
+}
+
+pub const AF_INET6: ::c_int = 23;
+
+pub const FIONBIO: ::c_ulong = 1;
+
+pub const POLLIN: ::c_short = 0x1;
+pub const POLLPRI: ::c_short = 0x2;
+pub const POLLOUT: ::c_short = 0x4;
+pub const POLLERR: ::c_short = 0x8;
+pub const POLLHUP: ::c_short = 0x10;
+pub const POLLNVAL: ::c_short = 0x20;
+
+pub const SOL_SOCKET: ::c_int = 65535;
+
+pub const MSG_OOB: ::c_int = 1;
+pub const MSG_PEEK: ::c_int = 2;
+pub const MSG_DONTWAIT: ::c_int = 4;
+pub const MSG_DONTROUTE: ::c_int = 0;
+pub const MSG_WAITALL: ::c_int = 0;
+pub const MSG_MORE: ::c_int = 0;
+pub const MSG_NOSIGNAL: ::c_int = 0;
+
+pub use crate::unix::newlib::generic::{dirent, sigset_t, stat};
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/newlib/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/newlib/align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/newlib/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/newlib/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,61 @@
+macro_rules! expand_align {
+    () => {
+        s! {
+            #[cfg_attr(all(target_pointer_width = "32",
+                           any(target_arch = "mips",
+                               target_arch = "arm",
+                               target_arch = "powerpc")),
+                       repr(align(4)))]
+            #[cfg_attr(any(target_pointer_width = "64",
+                           not(any(target_arch = "mips",
+                                   target_arch = "arm",
+                                   target_arch = "powerpc"))),
+                       repr(align(8)))]
+            pub struct pthread_mutex_t { // Unverified
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
+            }
+
+            #[cfg_attr(all(target_pointer_width = "32",
+                           any(target_arch = "mips",
+                               target_arch = "arm",
+                               target_arch = "powerpc")),
+                       repr(align(4)))]
+            #[cfg_attr(any(target_pointer_width = "64",
+                           not(any(target_arch = "mips",
+                                   target_arch = "arm",
+                                   target_arch = "powerpc"))),
+                       repr(align(8)))]
+            pub struct pthread_rwlock_t { // Unverified
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
+            }
+
+            #[cfg_attr(any(target_pointer_width = "32",
+                           target_arch = "x86_64",
+                           target_arch = "powerpc64",
+                           target_arch = "mips64",
+                           target_arch = "s390x",
+                           target_arch = "sparc64"),
+                       repr(align(4)))]
+            #[cfg_attr(not(any(target_pointer_width = "32",
+                               target_arch = "x86_64",
+                               target_arch = "powerpc64",
+                               target_arch = "mips64",
+                               target_arch = "s390x",
+                               target_arch = "sparc64")),
+                       repr(align(8)))]
+            pub struct pthread_mutexattr_t { // Unverified
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
+            }
+
+            #[repr(align(8))]
+            pub struct pthread_cond_t { // Unverified
+                size: [u8; ::__SIZEOF_PTHREAD_COND_T],
+            }
+
+            #[repr(align(4))]
+            pub struct pthread_condattr_t { // Unverified
+                size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
+            }
+        }
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/newlib/arm/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/newlib/arm/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/newlib/arm/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/newlib/arm/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,56 @@
+pub type clock_t = ::c_long;
+pub type c_char = u8;
+pub type wchar_t = u32;
+
+pub type c_long = i32;
+pub type c_ulong = u32;
+
+s! {
+    pub struct sockaddr {
+        pub sa_family: ::sa_family_t,
+        pub sa_data: [::c_char; 14],
+    }
+
+    pub struct sockaddr_in6 {
+        pub sin6_family: ::sa_family_t,
+        pub sin6_port: ::in_port_t,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_scope_id: u32,
+    }
+
+    pub struct sockaddr_in {
+        pub sin_family: ::sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [u8; 8],
+    }
+
+    pub struct sockaddr_storage {
+        pub ss_family: ::sa_family_t,
+        pub __ss_padding: [u8; 26],
+    }
+}
+
+pub const AF_INET6: ::c_int = 23;
+
+pub const FIONBIO: ::c_ulong = 1;
+
+pub const POLLIN: ::c_short = 0x1;
+pub const POLLPRI: ::c_short = 0x2;
+pub const POLLHUP: ::c_short = 0x4;
+pub const POLLERR: ::c_short = 0x8;
+pub const POLLOUT: ::c_short = 0x10;
+pub const POLLNVAL: ::c_short = 0x20;
+
+pub const SOL_SOCKET: ::c_int = 65535;
+
+pub const MSG_OOB: ::c_int = 1;
+pub const MSG_PEEK: ::c_int = 2;
+pub const MSG_DONTWAIT: ::c_int = 4;
+pub const MSG_DONTROUTE: ::c_int = 0;
+pub const MSG_WAITALL: ::c_int = 0;
+pub const MSG_MORE: ::c_int = 0;
+pub const MSG_NOSIGNAL: ::c_int = 0;
+
+pub use crate::unix::newlib::generic::{dirent, sigset_t, stat};
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/newlib/espidf/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/newlib/espidf/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/newlib/espidf/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/newlib/espidf/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,120 @@
+pub type clock_t = ::c_ulong;
+pub type c_char = i8;
+pub type wchar_t = u32;
+
+pub type c_long = i32;
+pub type c_ulong = u32;
+
+s! {
+    pub struct cmsghdr {
+        pub cmsg_len: ::socklen_t,
+        pub cmsg_level: ::c_int,
+        pub cmsg_type: ::c_int,
+    }
+
+    pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: ::socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::c_int,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: ::socklen_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct sockaddr_un {
+        pub sun_family: ::sa_family_t,
+        pub sun_path: [::c_char; 108],
+    }
+
+    pub struct sockaddr {
+        pub sa_len: u8,
+        pub sa_family: ::sa_family_t,
+        pub sa_data: [::c_char; 14],
+    }
+
+    pub struct sockaddr_in6 {
+        pub sin6_len: u8,
+        pub sin6_family: ::sa_family_t,
+        pub sin6_port: ::in_port_t,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_scope_id: u32,
+    }
+
+    pub struct sockaddr_in {
+        pub sin_len: u8,
+        pub sin_family: ::sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [::c_char; 8],
+    }
+
+    pub struct sockaddr_storage {
+        pub s2_len: u8,
+        pub ss_family: ::sa_family_t,
+        pub s2_data1: [::c_char; 2],
+        pub s2_data2: [u32; 3],
+        pub s2_data3: [u32; 3],
+    }
+}
+
+pub const AF_UNIX: ::c_int = 1;
+pub const AF_INET6: ::c_int = 10;
+
+pub const FIONBIO: ::c_ulong = 2147772030;
+
+pub const POLLIN: ::c_short = 1 << 0;
+pub const POLLRDNORM: ::c_short = 1 << 1;
+pub const POLLRDBAND: ::c_short = 1 << 2;
+pub const POLLPRI: ::c_short = POLLRDBAND;
+pub const POLLOUT: ::c_short = 1 << 3;
+pub const POLLWRNORM: ::c_short = POLLOUT;
+pub const POLLWRBAND: ::c_short = 1 << 4;
+pub const POLLERR: ::c_short = 1 << 5;
+pub const POLLHUP: ::c_short = 1 << 6;
+
+pub const SOL_SOCKET: ::c_int = 0xfff;
+
+pub const MSG_OOB: ::c_int = 0x04;
+pub const MSG_PEEK: ::c_int = 0x01;
+pub const MSG_DONTWAIT: ::c_int = 0x08;
+pub const MSG_DONTROUTE: ::c_int = 0x4;
+pub const MSG_WAITALL: ::c_int = 0x02;
+pub const MSG_MORE: ::c_int = 0x10;
+pub const MSG_NOSIGNAL: ::c_int = 0x20;
+pub const MSG_TRUNC: ::c_int = 0x04;
+pub const MSG_CTRUNC: ::c_int = 0x08;
+pub const MSG_EOR: ::c_int = 0x08;
+
+pub const PTHREAD_STACK_MIN: ::size_t = 768;
+
+pub const SIGABRT: ::size_t = 1;
+pub const SIGFPE: ::size_t = 1;
+pub const SIGILL: ::size_t = 1;
+pub const SIGINT: ::size_t = 1;
+pub const SIGSEGV: ::size_t = 1;
+pub const SIGTERM: ::size_t = 1;
+pub const SIGHUP: ::size_t = 1;
+pub const SIGQUIT: ::size_t = 1;
+pub const NSIG: ::size_t = 2;
+
+extern "C" {
+    pub fn pthread_create(
+        native: *mut ::pthread_t,
+        attr: *const ::pthread_attr_t,
+        f: extern "C" fn(_: *mut ::c_void) -> *mut ::c_void,
+        value: *mut ::c_void,
+    ) -> ::c_int;
+
+    pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+
+    #[link_name = "lwip_sendmsg"]
+    pub fn sendmsg(s: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+    #[link_name = "lwip_recvmsg"]
+    pub fn recvmsg(s: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
+
+    pub fn eventfd(initval: ::c_uint, flags: ::c_int) -> ::c_int;
+}
+
+pub use crate::unix::newlib::generic::{dirent, sigset_t, stat};
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/newlib/generic.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/newlib/generic.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/newlib/generic.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/newlib/generic.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,33 @@
+//! Common types used by most newlib platforms
+
+s! {
+    pub struct sigset_t {
+        __val: [::c_ulong; 16],
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_atime: ::time_t,
+        pub st_spare1: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_spare2: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_spare3: ::c_long,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_spare4: [::c_long; 2usize],
+    }
+
+    pub struct dirent {
+        pub d_ino: ::ino_t,
+        pub d_type: ::c_uchar,
+        pub d_name: [::c_char; 256usize],
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/newlib/horizon/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/newlib/horizon/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/newlib/horizon/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/newlib/horizon/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,270 @@
+//! ARMv6K Nintendo 3DS C Newlib definitions
+
+pub type c_char = u8;
+pub type c_long = i32;
+pub type c_ulong = u32;
+
+pub type wchar_t = ::c_uint;
+
+pub type u_register_t = ::c_uint;
+pub type u_char = ::c_uchar;
+pub type u_short = ::c_ushort;
+pub type u_int = ::c_uint;
+pub type u_long = c_ulong;
+pub type ushort = ::c_ushort;
+pub type uint = ::c_uint;
+pub type ulong = c_ulong;
+pub type clock_t = c_ulong;
+pub type daddr_t = c_long;
+pub type caddr_t = *mut c_char;
+pub type sbintime_t = ::c_longlong;
+pub type sigset_t = ::c_ulong;
+
+s! {
+    pub struct sockaddr {
+        pub sa_family: ::sa_family_t,
+        pub sa_data: [::c_char; 26usize],
+    }
+
+    pub struct sockaddr_storage {
+        pub ss_family: ::sa_family_t,
+        pub __ss_padding: [::c_char; 26usize],
+    }
+
+    pub struct sockaddr_in {
+        pub sin_family: ::sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+    }
+
+    pub struct sockaddr_in6 {
+        pub sin6_family: ::sa_family_t,
+        pub sin6_port: ::in_port_t,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_scope_id: u32,
+    }
+
+    pub struct sockaddr_un {
+        pub sun_len: ::c_uchar,
+        pub sun_family: ::sa_family_t,
+        pub sun_path: [::c_char; 104usize],
+    }
+
+    pub struct sched_param {
+        pub sched_priority: ::c_int,
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_atim: ::timespec,
+        pub st_mtim: ::timespec,
+        pub st_ctim: ::timespec,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_spare4: [::c_long; 2usize],
+    }
+}
+
+pub const SIGEV_NONE: ::c_int = 1;
+pub const SIGEV_SIGNAL: ::c_int = 2;
+pub const SIGEV_THREAD: ::c_int = 3;
+pub const SA_NOCLDSTOP: ::c_int = 1;
+pub const MINSIGSTKSZ: ::c_int = 2048;
+pub const SIGSTKSZ: ::c_int = 8192;
+pub const SS_ONSTACK: ::c_int = 1;
+pub const SS_DISABLE: ::c_int = 2;
+pub const SIG_SETMASK: ::c_int = 0;
+pub const SIG_BLOCK: ::c_int = 1;
+pub const SIG_UNBLOCK: ::c_int = 2;
+pub const SIGHUP: ::c_int = 1;
+pub const SIGINT: ::c_int = 2;
+pub const SIGQUIT: ::c_int = 3;
+pub const SIGILL: ::c_int = 4;
+pub const SIGTRAP: ::c_int = 5;
+pub const SIGABRT: ::c_int = 6;
+pub const SIGEMT: ::c_int = 7;
+pub const SIGFPE: ::c_int = 8;
+pub const SIGKILL: ::c_int = 9;
+pub const SIGBUS: ::c_int = 10;
+pub const SIGSEGV: ::c_int = 11;
+pub const SIGSYS: ::c_int = 12;
+pub const SIGPIPE: ::c_int = 13;
+pub const SIGALRM: ::c_int = 14;
+pub const SIGTERM: ::c_int = 15;
+pub const SIGURG: ::c_int = 16;
+pub const SIGSTOP: ::c_int = 17;
+pub const SIGTSTP: ::c_int = 18;
+pub const SIGCONT: ::c_int = 19;
+pub const SIGCHLD: ::c_int = 20;
+pub const SIGCLD: ::c_int = 20;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGIO: ::c_int = 23;
+pub const SIGPOLL: ::c_int = 23;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGLOST: ::c_int = 29;
+pub const SIGUSR1: ::c_int = 30;
+pub const SIGUSR2: ::c_int = 31;
+pub const NSIG: ::c_int = 32;
+pub const CLOCK_ENABLED: ::c_uint = 1;
+pub const CLOCK_DISABLED: ::c_uint = 0;
+pub const CLOCK_ALLOWED: ::c_uint = 1;
+pub const CLOCK_DISALLOWED: ::c_uint = 0;
+pub const TIMER_ABSTIME: ::c_uint = 4;
+pub const SOL_SOCKET: ::c_int = 65535;
+pub const MSG_OOB: ::c_int = 1;
+pub const MSG_PEEK: ::c_int = 2;
+pub const MSG_DONTWAIT: ::c_int = 4;
+pub const MSG_DONTROUTE: ::c_int = 0;
+pub const MSG_WAITALL: ::c_int = 0;
+pub const MSG_MORE: ::c_int = 0;
+pub const MSG_NOSIGNAL: ::c_int = 0;
+pub const SOL_CONFIG: ::c_uint = 65534;
+
+pub const _SC_PAGESIZE: ::c_int = 8;
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 51;
+
+pub const PTHREAD_STACK_MIN: ::size_t = 4096;
+pub const WNOHANG: ::c_int = 1;
+
+pub const POLLIN: ::c_short = 0x0001;
+pub const POLLPRI: ::c_short = 0x0002;
+pub const POLLOUT: ::c_short = 0x0004;
+pub const POLLRDNORM: ::c_short = 0x0040;
+pub const POLLWRNORM: ::c_short = POLLOUT;
+pub const POLLRDBAND: ::c_short = 0x0080;
+pub const POLLWRBAND: ::c_short = 0x0100;
+pub const POLLERR: ::c_short = 0x0008;
+pub const POLLHUP: ::c_short = 0x0010;
+pub const POLLNVAL: ::c_short = 0x0020;
+
+pub const EAI_AGAIN: ::c_int = 2;
+pub const EAI_BADFLAGS: ::c_int = 3;
+pub const EAI_FAIL: ::c_int = 4;
+pub const EAI_SERVICE: ::c_int = 9;
+pub const EAI_SYSTEM: ::c_int = 11;
+pub const EAI_BADHINTS: ::c_int = 12;
+pub const EAI_PROTOCOL: ::c_int = 13;
+pub const EAI_OVERFLOW: ::c_int = 14;
+pub const EAI_MAX: ::c_int = 15;
+
+pub const AF_UNIX: ::c_int = 1;
+pub const AF_INET6: ::c_int = 23;
+
+pub const FIONBIO: ::c_ulong = 1;
+
+pub const RTLD_DEFAULT: *mut ::c_void = 0 as *mut ::c_void;
+
+// For pthread get/setschedparam
+pub const SCHED_FIFO: ::c_int = 1;
+pub const SCHED_RR: ::c_int = 2;
+
+// For getrandom()
+pub const GRND_NONBLOCK: ::c_uint = 0x1;
+pub const GRND_RANDOM: ::c_uint = 0x2;
+
+// Horizon OS works doesn't or can't hold any of this information
+safe_f! {
+    pub {const} fn WIFSTOPPED(_status: ::c_int) -> bool {
+        false
+    }
+
+    pub {const} fn WSTOPSIG(_status: ::c_int) -> ::c_int {
+        0
+    }
+
+    pub {const} fn WIFCONTINUED(_status: ::c_int) -> bool {
+        true
+    }
+
+    pub {const} fn WIFSIGNALED(_status: ::c_int) -> bool {
+        false
+    }
+
+    pub {const} fn WTERMSIG(_status: ::c_int) -> ::c_int {
+        0
+    }
+
+    pub {const} fn WIFEXITED(_status: ::c_int) -> bool {
+        true
+    }
+
+    pub {const} fn WEXITSTATUS(_status: ::c_int) -> ::c_int {
+        0
+    }
+
+    pub {const} fn WCOREDUMP(_status: ::c_int) -> bool {
+        false
+    }
+}
+
+extern "C" {
+    pub fn pthread_create(
+        native: *mut ::pthread_t,
+        attr: *const ::pthread_attr_t,
+        f: extern "C" fn(_: *mut ::c_void) -> *mut ::c_void,
+        value: *mut ::c_void,
+    ) -> ::c_int;
+
+    pub fn pthread_attr_getschedparam(
+        attr: *const ::pthread_attr_t,
+        param: *mut sched_param,
+    ) -> ::c_int;
+
+    pub fn pthread_attr_setschedparam(
+        attr: *mut ::pthread_attr_t,
+        param: *const sched_param,
+    ) -> ::c_int;
+
+    pub fn pthread_attr_getprocessorid_np(
+        attr: *const ::pthread_attr_t,
+        processor_id: *mut ::c_int,
+    ) -> ::c_int;
+
+    pub fn pthread_attr_setprocessorid_np(
+        attr: *mut ::pthread_attr_t,
+        processor_id: ::c_int,
+    ) -> ::c_int;
+
+    pub fn pthread_getschedparam(
+        native: ::pthread_t,
+        policy: *mut ::c_int,
+        param: *mut ::sched_param,
+    ) -> ::c_int;
+
+    pub fn pthread_setschedparam(
+        native: ::pthread_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+
+    pub fn pthread_condattr_getclock(
+        attr: *const ::pthread_condattr_t,
+        clock_id: *mut ::clockid_t,
+    ) -> ::c_int;
+
+    pub fn pthread_condattr_setclock(
+        attr: *mut ::pthread_condattr_t,
+        clock_id: ::clockid_t,
+    ) -> ::c_int;
+
+    pub fn pthread_getprocessorid_np() -> ::c_int;
+
+    pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+
+    pub fn gethostid() -> ::c_long;
+}
+
+pub use crate::unix::newlib::generic::dirent;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/newlib/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/newlib/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/newlib/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/newlib/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,798 @@
+pub type blkcnt_t = i32;
+pub type blksize_t = i32;
+
+pub type clockid_t = ::c_ulong;
+
+cfg_if! {
+    if #[cfg(any(target_os = "espidf"))] {
+        pub type dev_t = ::c_short;
+        pub type ino_t = ::c_ushort;
+        pub type off_t = ::c_long;
+    } else if #[cfg(any(target_os = "vita"))] {
+        pub type dev_t = ::c_short;
+        pub type ino_t = ::c_ushort;
+        pub type off_t = ::c_int;
+    } else {
+        pub type dev_t = u32;
+        pub type ino_t = u32;
+        pub type off_t = i64;
+    }
+}
+
+pub type fsblkcnt_t = u64;
+pub type fsfilcnt_t = u32;
+pub type id_t = u32;
+pub type key_t = ::c_int;
+pub type loff_t = ::c_longlong;
+pub type mode_t = ::c_uint;
+pub type nfds_t = u32;
+pub type nlink_t = ::c_ushort;
+pub type pthread_t = ::c_ulong;
+pub type pthread_key_t = ::c_uint;
+pub type rlim_t = u32;
+
+cfg_if! {
+    if #[cfg(target_os = "horizon")] {
+        pub type sa_family_t = u16;
+    } else {
+        pub type sa_family_t = u8;
+    }
+}
+
+pub type socklen_t = u32;
+pub type speed_t = u32;
+pub type suseconds_t = i32;
+pub type tcflag_t = ::c_uint;
+pub type useconds_t = u32;
+
+cfg_if! {
+    if #[cfg(any(target_os = "horizon", all(target_os = "espidf", espidf_time64)))] {
+        pub type time_t = ::c_longlong;
+    } else {
+        pub type time_t = i32;
+    }
+}
+
+s! {
+    // The order of the `ai_addr` field in this struct is crucial
+    // for converting between the Rust and C types.
+    pub struct addrinfo {
+        pub ai_flags: ::c_int,
+        pub ai_family: ::c_int,
+        pub ai_socktype: ::c_int,
+        pub ai_protocol: ::c_int,
+        pub ai_addrlen: socklen_t,
+
+        #[cfg(target_os = "espidf")]
+        pub ai_addr: *mut sockaddr,
+
+        pub ai_canonname: *mut ::c_char,
+
+        #[cfg(not(any(
+            target_os = "espidf",
+            all(libc_cfg_target_vendor, target_arch = "powerpc", target_vendor = "nintendo"))))]
+        pub ai_addr: *mut sockaddr,
+
+        pub ai_next: *mut addrinfo,
+    }
+
+    pub struct ip_mreq {
+        pub imr_multiaddr: in_addr,
+        pub imr_interface: in_addr,
+    }
+
+    pub struct linger {
+        pub l_onoff: ::c_int,
+        pub l_linger: ::c_int,
+    }
+
+    pub struct in_addr {
+            pub s_addr: ::in_addr_t,
+    }
+
+    pub struct hostent {
+            pub h_name: *mut ::c_char,
+            pub h_aliases: *mut *mut ::c_char,
+            pub h_addrtype: ::c_int,
+            pub h_length: ::c_int,
+            pub h_addr_list: *mut *mut ::c_char,
+            pub h_addr: *mut ::c_char,
+    }
+
+    pub struct pollfd {
+        pub fd: ::c_int,
+        pub events: ::c_int,
+        pub revents: ::c_int,
+    }
+
+    pub struct lconv {
+        pub decimal_point: *mut ::c_char,
+        pub thousands_sep: *mut ::c_char,
+        pub grouping: *mut ::c_char,
+        pub int_curr_symbol: *mut ::c_char,
+        pub currency_symbol: *mut ::c_char,
+        pub mon_decimal_point: *mut ::c_char,
+        pub mon_thousands_sep: *mut ::c_char,
+        pub mon_grouping: *mut ::c_char,
+        pub positive_sign: *mut ::c_char,
+        pub negative_sign: *mut ::c_char,
+        pub int_frac_digits: ::c_char,
+        pub frac_digits: ::c_char,
+        pub p_cs_precedes: ::c_char,
+        pub p_sep_by_space: ::c_char,
+        pub n_cs_precedes: ::c_char,
+        pub n_sep_by_space: ::c_char,
+        pub p_sign_posn: ::c_char,
+        pub n_sign_posn: ::c_char,
+        pub int_n_cs_precedes: ::c_char,
+        pub int_n_sep_by_space: ::c_char,
+        pub int_n_sign_posn: ::c_char,
+        pub int_p_cs_precedes: ::c_char,
+        pub int_p_sep_by_space: ::c_char,
+        pub int_p_sign_posn: ::c_char,
+    }
+
+    pub struct tm {
+        pub tm_sec: ::c_int,
+        pub tm_min: ::c_int,
+        pub tm_hour: ::c_int,
+        pub tm_mday: ::c_int,
+        pub tm_mon: ::c_int,
+        pub tm_year: ::c_int,
+        pub tm_wday: ::c_int,
+        pub tm_yday: ::c_int,
+        pub tm_isdst: ::c_int,
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: fsblkcnt_t,
+        pub f_bfree: fsblkcnt_t,
+        pub f_bavail: fsblkcnt_t,
+        pub f_files: fsfilcnt_t,
+        pub f_ffree: fsfilcnt_t,
+        pub f_favail: fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+    }
+
+    pub struct sigaction {
+        pub sa_handler: extern fn(arg1: ::c_int),
+        pub sa_mask: sigset_t,
+        pub sa_flags: ::c_int,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_flags: ::c_int,
+        pub ss_size: usize,
+    }
+
+    pub struct fd_set { // Unverified
+        fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE],
+    }
+
+    pub struct passwd { // Unverified
+        pub pw_name: *mut ::c_char,
+        pub pw_passwd: *mut ::c_char,
+        pub pw_uid: ::uid_t,
+        pub pw_gid: ::gid_t,
+        pub pw_gecos: *mut ::c_char,
+        pub pw_dir: *mut ::c_char,
+        pub pw_shell: *mut ::c_char,
+    }
+
+    pub struct termios { // Unverified
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::NCCS],
+    }
+
+    pub struct sem_t { // Unverified
+        __size: [::c_char; 16],
+    }
+
+    pub struct Dl_info { // Unverified
+        pub dli_fname: *const ::c_char,
+        pub dli_fbase: *mut ::c_void,
+        pub dli_sname: *const ::c_char,
+        pub dli_saddr: *mut ::c_void,
+    }
+
+    pub struct utsname { // Unverified
+        pub sysname: [::c_char; 65],
+        pub nodename: [::c_char; 65],
+        pub release: [::c_char; 65],
+        pub version: [::c_char; 65],
+        pub machine: [::c_char; 65],
+        pub domainname: [::c_char; 65]
+    }
+
+    pub struct cpu_set_t { // Unverified
+        bits: [u32; 32],
+    }
+
+    pub struct pthread_attr_t { // Unverified
+        __size: [u8; __SIZEOF_PTHREAD_ATTR_T]
+    }
+
+    pub struct pthread_rwlockattr_t { // Unverified
+        __size: [u8; __SIZEOF_PTHREAD_RWLOCKATTR_T]
+    }
+}
+
+// unverified constants
+align_const! {
+    pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+        size: [__PTHREAD_INITIALIZER_BYTE; __SIZEOF_PTHREAD_MUTEX_T],
+    };
+    pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+        size: [__PTHREAD_INITIALIZER_BYTE; __SIZEOF_PTHREAD_COND_T],
+    };
+    pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+        size: [__PTHREAD_INITIALIZER_BYTE; __SIZEOF_PTHREAD_RWLOCK_T],
+    };
+}
+pub const NCCS: usize = 32;
+
+cfg_if! {
+    if #[cfg(target_os = "espidf")] {
+        const __PTHREAD_INITIALIZER_BYTE: u8 = 0xff;
+        pub const __SIZEOF_PTHREAD_ATTR_T: usize = 32;
+        pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 4;
+        pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 12;
+        pub const __SIZEOF_PTHREAD_COND_T: usize = 4;
+        pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 8;
+        pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 4;
+        pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 12;
+        pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
+    } else if #[cfg(target_os = "vita")] {
+        const __PTHREAD_INITIALIZER_BYTE: u8 = 0xff;
+        pub const __SIZEOF_PTHREAD_ATTR_T: usize = 4;
+        pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 4;
+        pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+        pub const __SIZEOF_PTHREAD_COND_T: usize = 4;
+        pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+        pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 4;
+        pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 4;
+        pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 4;
+    } else {
+        const __PTHREAD_INITIALIZER_BYTE: u8 = 0;
+        pub const __SIZEOF_PTHREAD_ATTR_T: usize = 56;
+        pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
+        pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
+        pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
+        pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
+        pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
+        pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
+        pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
+    }
+}
+
+pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
+pub const __PTHREAD_MUTEX_HAVE_PREV: usize = 1;
+pub const __PTHREAD_RWLOCK_INT_FLAGS_SHARED: usize = 1;
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
+pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
+
+cfg_if! {
+    if #[cfg(any(target_os = "horizon", target_os = "espidf"))] {
+        pub const FD_SETSIZE: usize = 64;
+    } else if #[cfg(target_os = "vita")] {
+        pub const FD_SETSIZE: usize = 256;
+    } else {
+        pub const FD_SETSIZE: usize = 1024;
+    }
+}
+// intentionally not public, only used for fd_set
+const ULONG_SIZE: usize = 32;
+
+// Other constants
+pub const EPERM: ::c_int = 1;
+pub const ENOENT: ::c_int = 2;
+pub const ESRCH: ::c_int = 3;
+pub const EINTR: ::c_int = 4;
+pub const EIO: ::c_int = 5;
+pub const ENXIO: ::c_int = 6;
+pub const E2BIG: ::c_int = 7;
+pub const ENOEXEC: ::c_int = 8;
+pub const EBADF: ::c_int = 9;
+pub const ECHILD: ::c_int = 10;
+pub const EAGAIN: ::c_int = 11;
+pub const ENOMEM: ::c_int = 12;
+pub const EACCES: ::c_int = 13;
+pub const EFAULT: ::c_int = 14;
+pub const EBUSY: ::c_int = 16;
+pub const EEXIST: ::c_int = 17;
+pub const EXDEV: ::c_int = 18;
+pub const ENODEV: ::c_int = 19;
+pub const ENOTDIR: ::c_int = 20;
+pub const EISDIR: ::c_int = 21;
+pub const EINVAL: ::c_int = 22;
+pub const ENFILE: ::c_int = 23;
+pub const EMFILE: ::c_int = 24;
+pub const ENOTTY: ::c_int = 25;
+pub const ETXTBSY: ::c_int = 26;
+pub const EFBIG: ::c_int = 27;
+pub const ENOSPC: ::c_int = 28;
+pub const ESPIPE: ::c_int = 29;
+pub const EROFS: ::c_int = 30;
+pub const EMLINK: ::c_int = 31;
+pub const EPIPE: ::c_int = 32;
+pub const EDOM: ::c_int = 33;
+pub const ERANGE: ::c_int = 34;
+pub const ENOMSG: ::c_int = 35;
+pub const EIDRM: ::c_int = 36;
+pub const EDEADLK: ::c_int = 45;
+pub const ENOLCK: ::c_int = 46;
+pub const ENOSTR: ::c_int = 60;
+pub const ENODATA: ::c_int = 61;
+pub const ETIME: ::c_int = 62;
+pub const ENOSR: ::c_int = 63;
+pub const ENOLINK: ::c_int = 67;
+pub const EPROTO: ::c_int = 71;
+pub const EMULTIHOP: ::c_int = 74;
+pub const EBADMSG: ::c_int = 77;
+pub const EFTYPE: ::c_int = 79;
+pub const ENOSYS: ::c_int = 88;
+pub const ENOTEMPTY: ::c_int = 90;
+pub const ENAMETOOLONG: ::c_int = 91;
+pub const ELOOP: ::c_int = 92;
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const EPFNOSUPPORT: ::c_int = 96;
+pub const ECONNRESET: ::c_int = 104;
+pub const ENOBUFS: ::c_int = 105;
+pub const EAFNOSUPPORT: ::c_int = 106;
+pub const EPROTOTYPE: ::c_int = 107;
+pub const ENOTSOCK: ::c_int = 108;
+pub const ENOPROTOOPT: ::c_int = 109;
+pub const ECONNREFUSED: ::c_int = 111;
+pub const EADDRINUSE: ::c_int = 112;
+pub const ECONNABORTED: ::c_int = 113;
+pub const ENETUNREACH: ::c_int = 114;
+pub const ENETDOWN: ::c_int = 115;
+pub const ETIMEDOUT: ::c_int = 116;
+pub const EHOSTDOWN: ::c_int = 117;
+pub const EHOSTUNREACH: ::c_int = 118;
+pub const EINPROGRESS: ::c_int = 119;
+pub const EALREADY: ::c_int = 120;
+pub const EDESTADDRREQ: ::c_int = 121;
+pub const EMSGSIZE: ::c_int = 122;
+pub const EPROTONOSUPPORT: ::c_int = 123;
+pub const EADDRNOTAVAIL: ::c_int = 125;
+pub const ENETRESET: ::c_int = 126;
+pub const EISCONN: ::c_int = 127;
+pub const ENOTCONN: ::c_int = 128;
+pub const ETOOMANYREFS: ::c_int = 129;
+pub const EDQUOT: ::c_int = 132;
+pub const ESTALE: ::c_int = 133;
+pub const ENOTSUP: ::c_int = 134;
+pub const EILSEQ: ::c_int = 138;
+pub const EOVERFLOW: ::c_int = 139;
+pub const ECANCELED: ::c_int = 140;
+pub const ENOTRECOVERABLE: ::c_int = 141;
+pub const EOWNERDEAD: ::c_int = 142;
+pub const EWOULDBLOCK: ::c_int = 11;
+
+pub const F_DUPFD: ::c_int = 0;
+pub const F_GETFD: ::c_int = 1;
+pub const F_SETFD: ::c_int = 2;
+pub const F_GETFL: ::c_int = 3;
+pub const F_SETFL: ::c_int = 4;
+pub const F_GETOWN: ::c_int = 5;
+pub const F_SETOWN: ::c_int = 6;
+pub const F_GETLK: ::c_int = 7;
+pub const F_SETLK: ::c_int = 8;
+pub const F_SETLKW: ::c_int = 9;
+pub const F_RGETLK: ::c_int = 10;
+pub const F_RSETLK: ::c_int = 11;
+pub const F_CNVT: ::c_int = 12;
+pub const F_RSETLKW: ::c_int = 13;
+pub const F_DUPFD_CLOEXEC: ::c_int = 14;
+
+pub const O_RDONLY: ::c_int = 0;
+pub const O_WRONLY: ::c_int = 1;
+pub const O_RDWR: ::c_int = 2;
+pub const O_APPEND: ::c_int = 8;
+pub const O_CREAT: ::c_int = 512;
+pub const O_TRUNC: ::c_int = 1024;
+pub const O_EXCL: ::c_int = 2048;
+pub const O_SYNC: ::c_int = 8192;
+pub const O_NONBLOCK: ::c_int = 16384;
+
+pub const O_ACCMODE: ::c_int = 3;
+pub const O_CLOEXEC: ::c_int = 0x80000;
+
+pub const RTLD_LAZY: ::c_int = 0x1;
+
+pub const STDIN_FILENO: ::c_int = 0;
+pub const STDOUT_FILENO: ::c_int = 1;
+pub const STDERR_FILENO: ::c_int = 2;
+
+pub const SEEK_SET: ::c_int = 0;
+pub const SEEK_CUR: ::c_int = 1;
+pub const SEEK_END: ::c_int = 2;
+
+pub const FIOCLEX: ::c_ulong = 0x20006601;
+pub const FIONCLEX: ::c_ulong = 0x20006602;
+
+pub const S_BLKSIZE: ::mode_t = 1024;
+pub const S_IREAD: ::mode_t = 256;
+pub const S_IWRITE: ::mode_t = 128;
+pub const S_IEXEC: ::mode_t = 64;
+pub const S_ENFMT: ::mode_t = 1024;
+pub const S_IFMT: ::mode_t = 61440;
+pub const S_IFDIR: ::mode_t = 16384;
+pub const S_IFCHR: ::mode_t = 8192;
+pub const S_IFBLK: ::mode_t = 24576;
+pub const S_IFREG: ::mode_t = 32768;
+pub const S_IFLNK: ::mode_t = 40960;
+pub const S_IFSOCK: ::mode_t = 49152;
+pub const S_IFIFO: ::mode_t = 4096;
+pub const S_IRUSR: ::mode_t = 256;
+pub const S_IWUSR: ::mode_t = 128;
+pub const S_IXUSR: ::mode_t = 64;
+pub const S_IRGRP: ::mode_t = 32;
+pub const S_IWGRP: ::mode_t = 16;
+pub const S_IXGRP: ::mode_t = 8;
+pub const S_IROTH: ::mode_t = 4;
+pub const S_IWOTH: ::mode_t = 2;
+pub const S_IXOTH: ::mode_t = 1;
+
+pub const SOL_TCP: ::c_int = 6;
+
+pub const PF_UNSPEC: ::c_int = 0;
+pub const PF_INET: ::c_int = 2;
+pub const PF_INET6: ::c_int = 23;
+
+pub const AF_UNSPEC: ::c_int = 0;
+pub const AF_INET: ::c_int = 2;
+
+pub const CLOCK_REALTIME: ::clockid_t = 1;
+pub const CLOCK_MONOTONIC: ::clockid_t = 4;
+pub const CLOCK_BOOTTIME: ::clockid_t = 4;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+
+pub const SHUT_RD: ::c_int = 0;
+pub const SHUT_WR: ::c_int = 1;
+pub const SHUT_RDWR: ::c_int = 2;
+
+pub const SO_BINTIME: ::c_int = 0x2000;
+pub const SO_NO_OFFLOAD: ::c_int = 0x4000;
+pub const SO_NO_DDP: ::c_int = 0x8000;
+pub const SO_REUSEPORT_LB: ::c_int = 0x10000;
+pub const SO_LABEL: ::c_int = 0x1009;
+pub const SO_PEERLABEL: ::c_int = 0x1010;
+pub const SO_LISTENQLIMIT: ::c_int = 0x1011;
+pub const SO_LISTENQLEN: ::c_int = 0x1012;
+pub const SO_LISTENINCQLEN: ::c_int = 0x1013;
+pub const SO_SETFIB: ::c_int = 0x1014;
+pub const SO_USER_COOKIE: ::c_int = 0x1015;
+pub const SO_PROTOCOL: ::c_int = 0x1016;
+pub const SO_PROTOTYPE: ::c_int = SO_PROTOCOL;
+pub const SO_VENDOR: ::c_int = 0x80000000;
+pub const SO_DEBUG: ::c_int = 0x01;
+pub const SO_ACCEPTCONN: ::c_int = 0x0002;
+pub const SO_REUSEADDR: ::c_int = 0x0004;
+pub const SO_KEEPALIVE: ::c_int = 0x0008;
+pub const SO_DONTROUTE: ::c_int = 0x0010;
+pub const SO_BROADCAST: ::c_int = 0x0020;
+pub const SO_USELOOPBACK: ::c_int = 0x0040;
+pub const SO_LINGER: ::c_int = 0x0080;
+pub const SO_OOBINLINE: ::c_int = 0x0100;
+pub const SO_REUSEPORT: ::c_int = 0x0200;
+pub const SO_TIMESTAMP: ::c_int = 0x0400;
+pub const SO_NOSIGPIPE: ::c_int = 0x0800;
+pub const SO_ACCEPTFILTER: ::c_int = 0x1000;
+pub const SO_SNDBUF: ::c_int = 0x1001;
+pub const SO_RCVBUF: ::c_int = 0x1002;
+pub const SO_SNDLOWAT: ::c_int = 0x1003;
+pub const SO_RCVLOWAT: ::c_int = 0x1004;
+pub const SO_SNDTIMEO: ::c_int = 0x1005;
+pub const SO_RCVTIMEO: ::c_int = 0x1006;
+cfg_if! {
+    if #[cfg(target_os = "horizon")] {
+        pub const SO_ERROR: ::c_int = 0x1009;
+    } else {
+        pub const SO_ERROR: ::c_int = 0x1007;
+    }
+}
+pub const SO_TYPE: ::c_int = 0x1008;
+
+pub const SOCK_CLOEXEC: ::c_int = O_CLOEXEC;
+
+pub const INET_ADDRSTRLEN: ::c_int = 16;
+
+// https://github.com/bminor/newlib/blob/HEAD/newlib/libc/sys/linux/include/net/if.h#L121
+pub const IFF_UP: ::c_int = 0x1; // interface is up
+pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid
+pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging
+pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net
+pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link
+pub const IFF_NOTRAILERS: ::c_int = 0x20; // avoid use of trailers
+pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated
+pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol
+pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets
+pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets
+pub const IFF_OACTIVE: ::c_int = 0x400; // transmission in progress
+pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions
+pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
+pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
+pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
+pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection
+pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
+
+cfg_if! {
+    if #[cfg(target_os = "vita")] {
+        pub const TCP_NODELAY: ::c_int = 1;
+        pub const TCP_MAXSEG: ::c_int = 2;
+    } else {
+        pub const TCP_NODELAY: ::c_int = 8193;
+        pub const TCP_MAXSEG: ::c_int = 8194;
+    }
+}
+
+pub const TCP_NOPUSH: ::c_int = 4;
+pub const TCP_NOOPT: ::c_int = 8;
+pub const TCP_KEEPIDLE: ::c_int = 256;
+pub const TCP_KEEPINTVL: ::c_int = 512;
+pub const TCP_KEEPCNT: ::c_int = 1024;
+
+cfg_if! {
+    if #[cfg(target_os = "horizon")] {
+        pub const IP_TOS: ::c_int = 7;
+    } else {
+        pub const IP_TOS: ::c_int = 3;
+    }
+}
+cfg_if! {
+    if #[cfg(target_os = "vita")] {
+        pub const IP_TTL: ::c_int = 4;
+    } else {
+        pub const IP_TTL: ::c_int = 8;
+    }
+}
+pub const IP_MULTICAST_IF: ::c_int = 9;
+pub const IP_MULTICAST_TTL: ::c_int = 10;
+pub const IP_MULTICAST_LOOP: ::c_int = 11;
+cfg_if! {
+    if #[cfg(target_os = "vita")] {
+        pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
+        pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
+    } else {
+        pub const IP_ADD_MEMBERSHIP: ::c_int = 11;
+        pub const IP_DROP_MEMBERSHIP: ::c_int = 12;
+    }
+}
+pub const IPV6_UNICAST_HOPS: ::c_int = 4;
+pub const IPV6_MULTICAST_IF: ::c_int = 9;
+pub const IPV6_MULTICAST_HOPS: ::c_int = 10;
+pub const IPV6_MULTICAST_LOOP: ::c_int = 11;
+pub const IPV6_V6ONLY: ::c_int = 27;
+pub const IPV6_JOIN_GROUP: ::c_int = 12;
+pub const IPV6_LEAVE_GROUP: ::c_int = 13;
+pub const IPV6_ADD_MEMBERSHIP: ::c_int = 12;
+pub const IPV6_DROP_MEMBERSHIP: ::c_int = 13;
+
+pub const HOST_NOT_FOUND: ::c_int = 1;
+pub const NO_DATA: ::c_int = 2;
+pub const NO_ADDRESS: ::c_int = 2;
+pub const NO_RECOVERY: ::c_int = 3;
+pub const TRY_AGAIN: ::c_int = 4;
+
+pub const AI_PASSIVE: ::c_int = 1;
+pub const AI_CANONNAME: ::c_int = 2;
+pub const AI_NUMERICHOST: ::c_int = 4;
+pub const AI_NUMERICSERV: ::c_int = 0;
+pub const AI_ADDRCONFIG: ::c_int = 0;
+
+pub const NI_MAXHOST: ::c_int = 1025;
+pub const NI_MAXSERV: ::c_int = 32;
+pub const NI_NOFQDN: ::c_int = 1;
+pub const NI_NUMERICHOST: ::c_int = 2;
+pub const NI_NAMEREQD: ::c_int = 4;
+pub const NI_NUMERICSERV: ::c_int = 0;
+pub const NI_DGRAM: ::c_int = 0;
+
+cfg_if! {
+    // Defined in vita/mod.rs for "vita"
+    if #[cfg(not(target_os = "vita"))] {
+        pub const EAI_FAMILY: ::c_int = -303;
+        pub const EAI_MEMORY: ::c_int = -304;
+        pub const EAI_NONAME: ::c_int = -305;
+        pub const EAI_SOCKTYPE: ::c_int = -307;
+    }
+}
+
+pub const EXIT_SUCCESS: ::c_int = 0;
+pub const EXIT_FAILURE: ::c_int = 1;
+
+pub const PRIO_PROCESS: ::c_int = 0;
+pub const PRIO_PGRP: ::c_int = 1;
+pub const PRIO_USER: ::c_int = 2;
+
+f! {
+    pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
+        let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        let fd = fd as usize;
+        (*set).fds_bits[fd / bits] &= !(1 << (fd % bits));
+        return
+    }
+
+    pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
+        let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        let fd = fd as usize;
+        return ((*set).fds_bits[fd / bits] & (1 << (fd % bits))) != 0
+    }
+
+    pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
+        let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        let fd = fd as usize;
+        (*set).fds_bits[fd / bits] |= 1 << (fd % bits);
+        return
+    }
+
+    pub fn FD_ZERO(set: *mut fd_set) -> () {
+        for slot in (*set).fds_bits.iter_mut() {
+            *slot = 0;
+        }
+    }
+}
+
+extern "C" {
+    pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
+    pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
+
+    #[cfg_attr(target_os = "linux", link_name = "__xpg_strerror_r")]
+    pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
+
+    pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
+    pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
+
+    pub fn abs(i: ::c_int) -> ::c_int;
+    pub fn labs(i: ::c_long) -> ::c_long;
+    pub fn rand() -> ::c_int;
+    pub fn srand(seed: ::c_uint);
+
+    #[cfg(not(all(
+        libc_cfg_target_vendor,
+        target_arch = "powerpc",
+        target_vendor = "nintendo"
+    )))]
+    #[cfg_attr(target_os = "espidf", link_name = "lwip_bind")]
+    pub fn bind(fd: ::c_int, addr: *const sockaddr, len: socklen_t) -> ::c_int;
+    pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+    pub fn clock_gettime(clock_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_getres(clock_id: ::clockid_t, res: *mut ::timespec) -> ::c_int;
+    #[cfg_attr(target_os = "espidf", link_name = "lwip_close")]
+    pub fn closesocket(sockfd: ::c_int) -> ::c_int;
+    pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
+    #[cfg(not(all(
+        libc_cfg_target_vendor,
+        target_arch = "powerpc",
+        target_vendor = "nintendo"
+    )))]
+    #[cfg_attr(target_os = "espidf", link_name = "lwip_recvfrom")]
+    pub fn recvfrom(
+        fd: ::c_int,
+        buf: *mut ::c_void,
+        n: usize,
+        flags: ::c_int,
+        addr: *mut sockaddr,
+        addr_len: *mut socklen_t,
+    ) -> isize;
+    #[cfg(not(all(
+        libc_cfg_target_vendor,
+        target_arch = "powerpc",
+        target_vendor = "nintendo"
+    )))]
+    pub fn getnameinfo(
+        sa: *const sockaddr,
+        salen: socklen_t,
+        host: *mut ::c_char,
+        hostlen: socklen_t,
+        serv: *mut ::c_char,
+        servlen: socklen_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
+    pub fn fexecve(
+        fd: ::c_int,
+        argv: *const *const ::c_char,
+        envp: *const *const ::c_char,
+    ) -> ::c_int;
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
+    pub fn sem_close(sem: *mut sem_t) -> ::c_int;
+    pub fn getdtablesize() -> ::c_int;
+    pub fn getgrnam_r(
+        name: *const ::c_char,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
+    pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
+    pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
+    pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
+    pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
+    pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
+    pub fn getpwnam_r(
+        name: *const ::c_char,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+    pub fn getpwuid_r(
+        uid: ::uid_t,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+    pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
+    pub fn pthread_atfork(
+        prepare: ::Option<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+    pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
+    pub fn uname(buf: *mut ::utsname) -> ::c_int;
+}
+
+mod generic;
+
+cfg_if! {
+    if #[cfg(target_os = "espidf")] {
+        mod espidf;
+        pub use self::espidf::*;
+    } else if #[cfg(target_os = "horizon")] {
+        mod horizon;
+        pub use self::horizon::*;
+    } else if #[cfg(target_os = "vita")] {
+        mod vita;
+        pub use self::vita::*;
+    } else if #[cfg(target_arch = "arm")] {
+        mod arm;
+        pub use self::arm::*;
+    } else if #[cfg(target_arch = "aarch64")] {
+        mod aarch64;
+        pub use self::aarch64::*;
+    } else if #[cfg(target_arch = "powerpc")] {
+        mod powerpc;
+        pub use self::powerpc::*;
+    } else {
+        // Only tested on ARM so far. Other platforms might have different
+        // definitions for types and constants.
+        pub use target_arch_not_implemented;
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        #[macro_use]
+        mod align;
+    } else {
+        #[macro_use]
+        mod no_align;
+    }
+}
+expand_align!();
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/newlib/no_align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/newlib/no_align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/newlib/no_align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/newlib/no_align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,51 @@
+macro_rules! expand_align {
+    () => {
+        s! {
+            pub struct pthread_mutex_t { // Unverified
+                #[cfg(any(target_arch = "mips",
+                          target_arch = "arm",
+                          target_arch = "powerpc"))]
+                __align: [::c_long; 0],
+                #[cfg(not(any(target_arch = "mips",
+                              target_arch = "arm",
+                              target_arch = "powerpc")))]
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
+            }
+
+            pub struct pthread_rwlock_t { // Unverified
+                #[cfg(any(target_arch = "mips",
+                          target_arch = "arm",
+                          target_arch = "powerpc"))]
+                __align: [::c_long; 0],
+                #[cfg(not(any(target_arch = "mips",
+                              target_arch = "arm",
+                              target_arch = "powerpc")))]
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
+            }
+
+            pub struct pthread_mutexattr_t { // Unverified
+                #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64",
+                          target_arch = "mips64", target_arch = "s390x",
+                          target_arch = "sparc64"))]
+                __align: [::c_int; 0],
+                #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64",
+                              target_arch = "mips64", target_arch = "s390x",
+                              target_arch = "sparc64")))]
+                __align: [::c_long; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
+            }
+
+            pub struct pthread_cond_t { // Unverified
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_COND_T],
+            }
+
+            pub struct pthread_condattr_t { // Unverified
+                __align: [::c_int; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
+            }
+        }
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/newlib/powerpc/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/newlib/powerpc/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/newlib/powerpc/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/newlib/powerpc/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,16 @@
+pub type clock_t = ::c_ulong;
+pub type c_char = u8;
+pub type wchar_t = ::c_int;
+
+pub type c_long = i32;
+pub type c_ulong = u32;
+
+pub use crate::unix::newlib::generic::{dirent, sigset_t, stat};
+
+// the newlib shipped with devkitPPC does not support the following components:
+// - sockaddr
+// - AF_INET6
+// - FIONBIO
+// - POLL*
+// - SOL_SOCKET
+// - MSG_*
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/newlib/vita/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/newlib/vita/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/newlib/vita/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/newlib/vita/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,236 @@
+pub type clock_t = ::c_long;
+
+pub type c_char = i8;
+pub type wchar_t = u32;
+
+pub type c_long = i32;
+pub type c_ulong = u32;
+
+pub type sigset_t = ::c_ulong;
+
+s! {
+    pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: ::socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::c_int,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: ::socklen_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct sockaddr {
+        pub sa_len: u8,
+        pub sa_family: ::sa_family_t,
+        pub sa_data: [::c_char; 14],
+    }
+
+    pub struct sockaddr_in6 {
+        pub sin6_len: u8,
+        pub sin6_family: ::sa_family_t,
+        pub sin6_port: ::in_port_t,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_vport: ::in_port_t,
+        pub sin6_scope_id: u32,
+    }
+
+    pub struct sockaddr_in {
+        pub sin_len: u8,
+        pub sin_family: ::sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_vport: ::in_port_t,
+        pub sin_zero: [u8; 6],
+    }
+
+    pub struct sockaddr_un {
+        pub ss_len: u8,
+        pub sun_family: ::sa_family_t,
+        pub sun_path: [::c_char; 108usize],
+    }
+
+    pub struct sockaddr_storage {
+        pub ss_len: u8,
+        pub ss_family: ::sa_family_t,
+        pub __ss_pad1: [u8; 2],
+        pub __ss_align: i64,
+        pub __ss_pad2: [u8; 116],
+    }
+
+    pub struct sched_param {
+        pub sched_priority: ::c_int,
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_atime: ::time_t,
+        pub st_mtime: ::time_t,
+        pub st_ctime: ::time_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_spare4: [::c_long; 2usize],
+    }
+
+    #[repr(align(8))]
+    pub struct dirent {
+        __offset: [u8; 88],
+        pub d_name: [::c_char; 256usize],
+        __pad: [u8; 8],
+    }
+}
+
+pub const AF_UNIX: ::c_int = 1;
+pub const AF_INET6: ::c_int = 24;
+
+pub const SOCK_RAW: ::c_int = 3;
+pub const SOCK_RDM: ::c_int = 4;
+pub const SOCK_SEQPACKET: ::c_int = 5;
+
+pub const SOMAXCONN: ::c_int = 128;
+
+pub const FIONBIO: ::c_ulong = 1;
+
+pub const POLLIN: ::c_short = 0x0001;
+pub const POLLPRI: ::c_short = POLLIN;
+pub const POLLOUT: ::c_short = 0x0004;
+pub const POLLRDNORM: ::c_short = POLLIN;
+pub const POLLRDBAND: ::c_short = POLLIN;
+pub const POLLWRNORM: ::c_short = POLLOUT;
+pub const POLLWRBAND: ::c_short = POLLOUT;
+pub const POLLERR: ::c_short = 0x0008;
+pub const POLLHUP: ::c_short = 0x0010;
+pub const POLLNVAL: ::c_short = 0x0020;
+
+pub const RTLD_DEFAULT: *mut ::c_void = 0 as *mut ::c_void;
+
+pub const SOL_SOCKET: ::c_int = 0xffff;
+pub const SO_NONBLOCK: ::c_int = 0x1100;
+
+pub const MSG_OOB: ::c_int = 0x1;
+pub const MSG_PEEK: ::c_int = 0x2;
+pub const MSG_DONTROUTE: ::c_int = 0x4;
+pub const MSG_EOR: ::c_int = 0x8;
+pub const MSG_TRUNC: ::c_int = 0x10;
+pub const MSG_CTRUNC: ::c_int = 0x20;
+pub const MSG_WAITALL: ::c_int = 0x40;
+pub const MSG_DONTWAIT: ::c_int = 0x80;
+pub const MSG_BCAST: ::c_int = 0x100;
+pub const MSG_MCAST: ::c_int = 0x200;
+
+pub const UTIME_OMIT: c_long = -1;
+pub const AT_FDCWD: ::c_int = -2;
+
+pub const O_DIRECTORY: ::c_int = 0x200000;
+pub const O_NOFOLLOW: ::c_int = 0x100000;
+
+pub const AT_EACCESS: ::c_int = 1;
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 2;
+pub const AT_SYMLINK_FOLLOW: ::c_int = 4;
+pub const AT_REMOVEDIR: ::c_int = 8;
+
+pub const SIGHUP: ::c_int = 1;
+pub const SIGINT: ::c_int = 2;
+pub const SIGQUIT: ::c_int = 3;
+pub const SIGILL: ::c_int = 4;
+pub const SIGTRAP: ::c_int = 5;
+pub const SIGABRT: ::c_int = 6;
+pub const SIGEMT: ::c_int = 7;
+pub const SIGFPE: ::c_int = 8;
+pub const SIGKILL: ::c_int = 9;
+pub const SIGBUS: ::c_int = 10;
+pub const SIGSEGV: ::c_int = 11;
+pub const SIGSYS: ::c_int = 12;
+pub const SIGPIPE: ::c_int = 13;
+pub const SIGALRM: ::c_int = 14;
+pub const SIGTERM: ::c_int = 15;
+
+pub const EAI_BADFLAGS: ::c_int = -1;
+pub const EAI_NONAME: ::c_int = -2;
+pub const EAI_AGAIN: ::c_int = -3;
+pub const EAI_FAIL: ::c_int = -4;
+pub const EAI_NODATA: ::c_int = -5;
+pub const EAI_FAMILY: ::c_int = -6;
+pub const EAI_SOCKTYPE: ::c_int = -7;
+pub const EAI_SERVICE: ::c_int = -8;
+pub const EAI_ADDRFAMILY: ::c_int = -9;
+pub const EAI_MEMORY: ::c_int = -10;
+pub const EAI_SYSTEM: ::c_int = -11;
+pub const EAI_OVERFLOW: ::c_int = -12;
+
+pub const _SC_PAGESIZE: ::c_int = 8;
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 51;
+pub const PTHREAD_STACK_MIN: ::size_t = 32 * 1024;
+
+pub const IP_HDRINCL: ::c_int = 2;
+
+extern "C" {
+    pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
+    pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+
+    pub fn sendmsg(s: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+    pub fn recvmsg(s: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
+
+    pub fn pthread_create(
+        native: *mut ::pthread_t,
+        attr: *const ::pthread_attr_t,
+        f: extern "C" fn(_: *mut ::c_void) -> *mut ::c_void,
+        value: *mut ::c_void,
+    ) -> ::c_int;
+
+    pub fn pthread_attr_getschedparam(
+        attr: *const ::pthread_attr_t,
+        param: *mut sched_param,
+    ) -> ::c_int;
+
+    pub fn pthread_attr_setschedparam(
+        attr: *mut ::pthread_attr_t,
+        param: *const sched_param,
+    ) -> ::c_int;
+
+    pub fn pthread_attr_getprocessorid_np(
+        attr: *const ::pthread_attr_t,
+        processor_id: *mut ::c_int,
+    ) -> ::c_int;
+
+    pub fn pthread_attr_setprocessorid_np(
+        attr: *mut ::pthread_attr_t,
+        processor_id: ::c_int,
+    ) -> ::c_int;
+
+    pub fn pthread_getschedparam(
+        native: ::pthread_t,
+        policy: *mut ::c_int,
+        param: *mut ::sched_param,
+    ) -> ::c_int;
+
+    pub fn pthread_setschedparam(
+        native: ::pthread_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+
+    pub fn pthread_condattr_getclock(
+        attr: *const ::pthread_condattr_t,
+        clock_id: *mut ::clockid_t,
+    ) -> ::c_int;
+
+    pub fn pthread_condattr_setclock(
+        attr: *mut ::pthread_condattr_t,
+        clock_id: ::clockid_t,
+    ) -> ::c_int;
+
+    pub fn pthread_getprocessorid_np() -> ::c_int;
+
+    pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
+
+    pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/no_align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/no_align.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/no_align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/no_align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,6 @@
+s! {
+    pub struct in6_addr {
+        pub s6_addr: [u8; 16],
+        __align: [u32; 0],
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/nto/aarch64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/nto/aarch64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/nto/aarch64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/nto/aarch64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,36 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type time_t = i64;
+
+s! {
+    pub struct aarch64_qreg_t {
+        pub qlo: u64,
+        pub qhi: u64,
+    }
+
+    pub struct aarch64_fpu_registers {
+        pub reg: [::aarch64_qreg_t; 32],
+        pub fpsr: u32,
+        pub fpcr: u32,
+    }
+
+    pub struct aarch64_cpu_registers {
+        pub gpr: [u64; 32],
+        pub elr: u64,
+        pub pstate: u64,
+    }
+
+    #[repr(align(16))]
+    pub struct mcontext_t {
+        pub cpu: ::aarch64_cpu_registers,
+        pub fpu: ::aarch64_fpu_registers,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_size: ::size_t,
+        pub ss_flags: ::c_int,
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/nto/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/nto/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/nto/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/nto/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,3508 @@
+pub type clock_t = u32;
+
+pub type sa_family_t = u8;
+pub type speed_t = ::c_uint;
+pub type tcflag_t = ::c_uint;
+pub type clockid_t = ::c_int;
+pub type timer_t = ::c_int;
+pub type key_t = ::c_uint;
+pub type id_t = ::c_int;
+
+pub type useconds_t = u32;
+pub type dev_t = u32;
+pub type socklen_t = u32;
+pub type mode_t = u32;
+pub type rlim64_t = u64;
+pub type mqd_t = ::c_int;
+pub type nfds_t = ::c_uint;
+pub type idtype_t = ::c_uint;
+pub type errno_t = ::c_int;
+pub type rsize_t = c_ulong;
+
+pub type Elf32_Half = u16;
+pub type Elf32_Word = u32;
+pub type Elf32_Off = u32;
+pub type Elf32_Addr = u32;
+pub type Elf32_Lword = u64;
+pub type Elf32_Sword = i32;
+
+pub type Elf64_Half = u16;
+pub type Elf64_Word = u32;
+pub type Elf64_Off = u64;
+pub type Elf64_Addr = u64;
+pub type Elf64_Xword = u64;
+pub type Elf64_Sxword = i64;
+pub type Elf64_Lword = u64;
+pub type Elf64_Sword = i32;
+
+pub type Elf32_Section = u16;
+pub type Elf64_Section = u16;
+
+pub type _Time32t = u32;
+
+pub type pthread_t = ::c_int;
+pub type regoff_t = ::ssize_t;
+
+pub type nlink_t = u32;
+pub type blksize_t = u32;
+pub type suseconds_t = i32;
+
+pub type ino_t = u64;
+pub type off_t = i64;
+pub type blkcnt_t = u64;
+pub type msgqnum_t = u64;
+pub type msglen_t = u64;
+pub type fsblkcnt_t = u64;
+pub type fsfilcnt_t = u64;
+pub type rlim_t = u64;
+pub type posix_spawn_file_actions_t = *mut ::c_void;
+pub type posix_spawnattr_t = ::uintptr_t;
+
+pub type pthread_mutex_t = ::sync_t;
+pub type pthread_mutexattr_t = ::_sync_attr;
+pub type pthread_cond_t = ::sync_t;
+pub type pthread_condattr_t = ::_sync_attr;
+pub type pthread_rwlockattr_t = ::_sync_attr;
+pub type pthread_key_t = ::c_int;
+pub type pthread_spinlock_t = sync_t;
+pub type pthread_barrierattr_t = _sync_attr;
+pub type sem_t = sync_t;
+
+pub type nl_item = ::c_int;
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum timezone {}
+impl ::Copy for timezone {}
+impl ::Clone for timezone {
+    fn clone(&self) -> timezone {
+        *self
+    }
+}
+
+s! {
+    pub struct dirent_extra {
+        pub d_datalen: u16,
+        pub d_type: u16,
+        pub d_reserved: u32,
+    }
+
+    pub struct stat {
+        pub st_ino: ::ino_t,
+        pub st_size: ::off_t,
+        pub st_dev: ::dev_t,
+        pub st_rdev: ::dev_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub __old_st_mtime: ::_Time32t,
+        pub __old_st_atime: ::_Time32t,
+        pub __old_st_ctime: ::_Time32t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_blocksize: ::blksize_t,
+        pub st_nblocks: i32,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_mtim:    ::timespec,
+        pub st_atim:    ::timespec,
+        pub st_ctim:    ::timespec,
+    }
+
+    pub struct ip_mreq {
+        pub imr_multiaddr: in_addr,
+        pub imr_interface: in_addr,
+    }
+
+    #[repr(packed)]
+    pub struct in_addr {
+        pub s_addr: ::in_addr_t,
+    }
+
+    pub struct sockaddr {
+        pub sa_len: u8,
+        pub sa_family: sa_family_t,
+        pub sa_data: [::c_char; 14],
+    }
+
+    pub struct sockaddr_in {
+        pub sin_len: u8,
+        pub sin_family: sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [i8; 8],
+    }
+
+    pub struct sockaddr_in6 {
+        pub sin6_len: u8,
+        pub sin6_family: sa_family_t,
+        pub sin6_port: ::in_port_t,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_scope_id: u32,
+    }
+
+    // The order of the `ai_addr` field in this struct is crucial
+    // for converting between the Rust and C types.
+    pub struct addrinfo {
+        pub ai_flags: ::c_int,
+        pub ai_family: ::c_int,
+        pub ai_socktype: ::c_int,
+        pub ai_protocol: ::c_int,
+        pub ai_addrlen: socklen_t,
+        pub ai_canonname: *mut c_char,
+        pub ai_addr: *mut ::sockaddr,
+        pub ai_next: *mut addrinfo,
+    }
+
+    pub struct fd_set {
+        fds_bits: [::c_uint; 2 * FD_SETSIZE / ULONG_SIZE],
+    }
+
+    pub struct tm {
+        pub tm_sec: ::c_int,
+        pub tm_min: ::c_int,
+        pub tm_hour: ::c_int,
+        pub tm_mday: ::c_int,
+        pub tm_mon: ::c_int,
+        pub tm_year: ::c_int,
+        pub tm_wday: ::c_int,
+        pub tm_yday: ::c_int,
+        pub tm_isdst: ::c_int,
+        pub tm_gmtoff: ::c_long,
+        pub tm_zone: *const ::c_char,
+    }
+
+    #[repr(align(8))]
+    pub struct sched_param {
+        pub sched_priority: ::c_int,
+        pub sched_curpriority: ::c_int,
+        pub reserved: [::c_int; 10],
+    }
+
+    #[repr(align(8))]
+    pub struct __sched_param {
+        pub __sched_priority: ::c_int,
+        pub __sched_curpriority: ::c_int,
+        pub reserved: [::c_int; 10],
+    }
+
+    pub struct Dl_info {
+        pub dli_fname: *const ::c_char,
+        pub dli_fbase: *mut ::c_void,
+        pub dli_sname: *const ::c_char,
+        pub dli_saddr: *mut ::c_void,
+    }
+
+    pub struct lconv {
+        pub currency_symbol: *mut ::c_char,
+        pub int_curr_symbol: *mut ::c_char,
+        pub mon_decimal_point: *mut ::c_char,
+        pub mon_grouping: *mut ::c_char,
+        pub mon_thousands_sep: *mut ::c_char,
+        pub negative_sign: *mut ::c_char,
+        pub positive_sign: *mut ::c_char,
+        pub frac_digits: ::c_char,
+        pub int_frac_digits: ::c_char,
+        pub n_cs_precedes: ::c_char,
+        pub n_sep_by_space: ::c_char,
+        pub n_sign_posn: ::c_char,
+        pub p_cs_precedes: ::c_char,
+        pub p_sep_by_space: ::c_char,
+        pub p_sign_posn: ::c_char,
+
+        pub int_n_cs_precedes: ::c_char,
+        pub int_n_sep_by_space: ::c_char,
+        pub int_n_sign_posn: ::c_char,
+        pub int_p_cs_precedes: ::c_char,
+        pub int_p_sep_by_space: ::c_char,
+        pub int_p_sign_posn: ::c_char,
+
+        pub decimal_point: *mut ::c_char,
+        pub grouping: *mut ::c_char,
+        pub thousands_sep: *mut ::c_char,
+
+        pub _Frac_grouping: *mut ::c_char,
+        pub _Frac_sep: *mut ::c_char,
+        pub _False: *mut ::c_char,
+        pub _True: *mut ::c_char,
+
+        pub _No: *mut ::c_char,
+        pub _Yes: *mut ::c_char,
+        pub _Nostr: *mut ::c_char,
+        pub _Yesstr: *mut ::c_char,
+        pub _Reserved: [*mut ::c_char; 8],
+        }
+
+    pub struct in_pktinfo {
+        pub ipi_addr: ::in_addr,
+        pub ipi_ifindex: ::c_uint,
+    }
+
+    pub struct ifaddrs {
+        pub ifa_next: *mut ifaddrs,
+        pub ifa_name: *mut c_char,
+        pub ifa_flags: ::c_uint,
+        pub ifa_addr: *mut ::sockaddr,
+        pub ifa_netmask: *mut ::sockaddr,
+        pub ifa_dstaddr: *mut ::sockaddr,
+        pub ifa_data: *mut ::c_void
+    }
+
+    pub struct arpreq {
+        pub arp_pa: ::sockaddr,
+        pub arp_ha: ::sockaddr,
+        pub arp_flags: ::c_int,
+    }
+
+    #[repr(packed)]
+    pub struct arphdr {
+        pub ar_hrd: u16,
+        pub ar_pro: u16,
+        pub ar_hln: u8,
+        pub ar_pln: u8,
+        pub ar_op: u16,
+    }
+
+    pub struct mmsghdr {
+        pub msg_hdr: ::msghdr,
+        pub msg_len: ::c_uint,
+    }
+
+    #[repr(align(8))]
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_code: ::c_int,
+        pub si_errno: ::c_int,
+        __data: [u8; 36], // union
+    }
+
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_flags: ::c_int,
+        pub sa_mask: ::sigset_t,
+    }
+
+    pub struct _sync {
+        _union: ::c_uint,
+        __owner: ::c_uint,
+    }
+    pub struct rlimit64 {
+        pub rlim_cur: rlim64_t,
+        pub rlim_max: rlim64_t,
+    }
+
+    pub struct glob_t {
+        pub gl_pathc: ::size_t,
+        pub gl_matchc: ::c_int,
+        pub gl_pathv: *mut *mut c_char,
+        pub gl_offs: ::size_t,
+        pub gl_flags: ::c_int,
+        pub gl_errfunc: extern "C" fn(*const ::c_char, ::c_int) -> ::c_int,
+
+        __unused1: *mut ::c_void,
+        __unused2: *mut ::c_void,
+        __unused3: *mut ::c_void,
+        __unused4: *mut ::c_void,
+        __unused5: *mut ::c_void,
+    }
+
+    pub struct passwd {
+        pub pw_name: *mut ::c_char,
+        pub pw_passwd: *mut ::c_char,
+        pub pw_uid: ::uid_t,
+        pub pw_gid: ::gid_t,
+        pub pw_age: *mut ::c_char,
+        pub pw_comment: *mut ::c_char,
+        pub pw_gecos: *mut ::c_char,
+        pub pw_dir: *mut ::c_char,
+        pub pw_shell: *mut ::c_char,
+    }
+
+    pub struct if_nameindex {
+        pub if_index: ::c_uint,
+        pub if_name: *mut ::c_char,
+    }
+
+    pub struct sembuf {
+        pub sem_num: ::c_ushort,
+        pub sem_op: ::c_short,
+        pub sem_flg: ::c_short,
+    }
+
+    pub struct Elf32_Ehdr {
+        pub e_ident: [::c_uchar; 16],
+        pub e_type: Elf32_Half,
+        pub e_machine: Elf32_Half,
+        pub e_version: Elf32_Word,
+        pub e_entry: Elf32_Addr,
+        pub e_phoff: Elf32_Off,
+        pub e_shoff: Elf32_Off,
+        pub e_flags: Elf32_Word,
+        pub e_ehsize: Elf32_Half,
+        pub e_phentsize: Elf32_Half,
+        pub e_phnum: Elf32_Half,
+        pub e_shentsize: Elf32_Half,
+        pub e_shnum: Elf32_Half,
+        pub e_shstrndx: Elf32_Half,
+    }
+
+    pub struct Elf64_Ehdr {
+        pub e_ident: [::c_uchar; 16],
+        pub e_type: Elf64_Half,
+        pub e_machine: Elf64_Half,
+        pub e_version: Elf64_Word,
+        pub e_entry: Elf64_Addr,
+        pub e_phoff: Elf64_Off,
+        pub e_shoff: Elf64_Off,
+        pub e_flags: Elf64_Word,
+        pub e_ehsize: Elf64_Half,
+        pub e_phentsize: Elf64_Half,
+        pub e_phnum: Elf64_Half,
+        pub e_shentsize: Elf64_Half,
+        pub e_shnum: Elf64_Half,
+        pub e_shstrndx: Elf64_Half,
+    }
+
+    pub struct Elf32_Sym {
+        pub st_name: Elf32_Word,
+        pub st_value: Elf32_Addr,
+        pub st_size: Elf32_Word,
+        pub st_info: ::c_uchar,
+        pub st_other: ::c_uchar,
+        pub st_shndx: Elf32_Section,
+    }
+
+    pub struct Elf64_Sym {
+        pub st_name: Elf64_Word,
+        pub st_info: ::c_uchar,
+        pub st_other: ::c_uchar,
+        pub st_shndx: Elf64_Section,
+        pub st_value: Elf64_Addr,
+        pub st_size: Elf64_Xword,
+    }
+
+    pub struct Elf32_Phdr {
+        pub p_type: Elf32_Word,
+        pub p_offset: Elf32_Off,
+        pub p_vaddr: Elf32_Addr,
+        pub p_paddr: Elf32_Addr,
+        pub p_filesz: Elf32_Word,
+        pub p_memsz: Elf32_Word,
+        pub p_flags: Elf32_Word,
+        pub p_align: Elf32_Word,
+    }
+
+    pub struct Elf64_Phdr {
+        pub p_type: Elf64_Word,
+        pub p_flags: Elf64_Word,
+        pub p_offset: Elf64_Off,
+        pub p_vaddr: Elf64_Addr,
+        pub p_paddr: Elf64_Addr,
+        pub p_filesz: Elf64_Xword,
+        pub p_memsz: Elf64_Xword,
+        pub p_align: Elf64_Xword,
+    }
+
+    pub struct Elf32_Shdr {
+        pub sh_name: Elf32_Word,
+        pub sh_type: Elf32_Word,
+        pub sh_flags: Elf32_Word,
+        pub sh_addr: Elf32_Addr,
+        pub sh_offset: Elf32_Off,
+        pub sh_size: Elf32_Word,
+        pub sh_link: Elf32_Word,
+        pub sh_info: Elf32_Word,
+        pub sh_addralign: Elf32_Word,
+        pub sh_entsize: Elf32_Word,
+    }
+
+    pub struct Elf64_Shdr {
+        pub sh_name: Elf64_Word,
+        pub sh_type: Elf64_Word,
+        pub sh_flags: Elf64_Xword,
+        pub sh_addr: Elf64_Addr,
+        pub sh_offset: Elf64_Off,
+        pub sh_size: Elf64_Xword,
+        pub sh_link: Elf64_Word,
+        pub sh_info: Elf64_Word,
+        pub sh_addralign: Elf64_Xword,
+        pub sh_entsize: Elf64_Xword,
+    }
+
+    pub struct in6_pktinfo {
+        pub ipi6_addr: ::in6_addr,
+        pub ipi6_ifindex: ::c_uint,
+    }
+
+    pub struct inotify_event {
+        pub wd: ::c_int,
+        pub mask: u32,
+        pub cookie: u32,
+        pub len: u32
+    }
+
+    pub struct regmatch_t {
+        pub rm_so: regoff_t,
+        pub rm_eo: regoff_t,
+    }
+
+    pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: ::socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::c_int,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: ::socklen_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct cmsghdr {
+        pub cmsg_len: ::socklen_t,
+        pub cmsg_level: ::c_int,
+        pub cmsg_type: ::c_int,
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_cc: [::cc_t; ::NCCS],
+        __reserved: [::c_uint; 3],
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::speed_t,
+    }
+
+    pub struct mallinfo {
+        pub arena: ::c_int,
+        pub ordblks: ::c_int,
+        pub smblks: ::c_int,
+        pub hblks: ::c_int,
+        pub hblkhd: ::c_int,
+        pub usmblks: ::c_int,
+        pub fsmblks: ::c_int,
+        pub uordblks: ::c_int,
+        pub fordblks: ::c_int,
+        pub keepcost: ::c_int,
+    }
+
+    pub struct flock {
+        pub l_type: i16,
+        pub l_whence: i16,
+        pub l_zero1: i32,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+        pub l_sysid: u32,
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_basetype: [::c_char; 16],
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        f_filler: [::c_uint; 21],
+    }
+
+    pub struct aiocb {
+        pub aio_fildes: ::c_int,
+        pub aio_reqprio: ::c_int,
+        pub aio_offset: off_t,
+        pub aio_buf: *mut ::c_void,
+        pub aio_nbytes: ::size_t,
+        pub aio_sigevent: ::sigevent,
+        pub aio_lio_opcode: ::c_int,
+        pub _aio_lio_state: *mut ::c_void,
+        _aio_pad: [::c_int; 3],
+        pub _aio_next: *mut ::aiocb,
+        pub _aio_flag: ::c_uint,
+        pub _aio_iotype: ::c_uint,
+        pub _aio_result: ::ssize_t,
+        pub _aio_error: ::c_uint,
+        pub _aio_suspend: *mut ::c_void,
+        pub _aio_plist: *mut ::c_void,
+        pub _aio_policy: ::c_int,
+        pub _aio_param: ::__sched_param,
+    }
+
+    pub struct pthread_attr_t {
+        __data1: ::c_long,
+        __data2: [u8; 96]
+    }
+
+    pub struct ipc_perm {
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub seq: ::c_uint,
+        pub key: ::key_t,
+        _reserved: [::c_int; 4],
+    }
+
+    pub struct regex_t {
+        re_magic: ::c_int,
+        re_nsub: ::size_t,
+        re_endp: *const ::c_char,
+        re_g: *mut ::c_void,
+    }
+
+    pub struct _thread_attr {
+        pub __flags: ::c_int,
+        pub __stacksize: ::size_t,
+        pub __stackaddr: *mut ::c_void,
+        pub __exitfunc: ::Option<unsafe extern "C" fn(_fake: *mut ::c_void)>,
+        pub __policy: ::c_int,
+        pub __param: ::__sched_param,
+        pub __guardsize: ::c_uint,
+        pub __prealloc: ::c_uint,
+        __spare: [::c_int; 2],
+    }
+
+    pub struct _sync_attr {
+        pub __protocol: ::c_int,
+        pub __flags: ::c_int,
+        pub __prioceiling: ::c_int,
+        pub __clockid: ::c_int,
+        pub __count: ::c_int,
+        __reserved: [::c_int; 3],
+    }
+
+    pub struct sockcred {
+        pub sc_uid: ::uid_t,
+        pub sc_euid: ::uid_t,
+        pub sc_gid: ::gid_t,
+        pub sc_egid: ::gid_t,
+        pub sc_ngroups: ::c_int,
+        pub sc_groups: [::gid_t; 1],
+    }
+
+    pub struct bpf_program {
+        pub bf_len: ::c_uint,
+        pub bf_insns: *mut ::bpf_insn,
+    }
+
+    pub struct bpf_stat {
+        pub bs_recv: u64,
+        pub bs_drop: u64,
+        pub bs_capt: u64,
+        bs_padding: [u64; 13],
+    }
+
+    pub struct bpf_version {
+        pub bv_major: ::c_ushort,
+        pub bv_minor: ::c_ushort,
+    }
+
+    pub struct bpf_hdr {
+        pub bh_tstamp: ::timeval,
+        pub bh_caplen: u32,
+        pub bh_datalen: u32,
+        pub bh_hdrlen: u16,
+    }
+
+    pub struct bpf_insn {
+        pub code: u16,
+        pub jt: ::c_uchar,
+        pub jf: ::c_uchar,
+        pub k: u32,
+    }
+
+    pub struct bpf_dltlist {
+        pub bfl_len: ::c_uint,
+        pub bfl_list: *mut ::c_uint,
+    }
+
+    pub struct unpcbid {
+        pub unp_pid: ::pid_t,
+        pub unp_euid: ::uid_t,
+        pub unp_egid: ::gid_t,
+    }
+
+    pub struct dl_phdr_info {
+        pub dlpi_addr: ::Elf64_Addr,
+        pub dlpi_name: *const ::c_char,
+        pub dlpi_phdr: *const ::Elf64_Phdr,
+        pub dlpi_phnum: ::Elf64_Half,
+    }
+
+    #[repr(align(8))]
+    pub struct ucontext_t {
+        pub uc_link: *mut ucontext_t,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_stack: stack_t,
+        pub uc_mcontext: mcontext_t,
+    }
+}
+
+s_no_extra_traits! {
+    pub struct sockaddr_un {
+        pub sun_len: u8,
+        pub sun_family: sa_family_t,
+        pub sun_path: [::c_char; 104]
+    }
+
+    pub struct sockaddr_storage {
+        pub ss_len: u8,
+        pub ss_family: sa_family_t,
+        __ss_pad1: [::c_char; 6],
+        __ss_align: i64,
+        __ss_pad2: [::c_char; 112],
+    }
+
+    pub struct utsname {
+        pub sysname: [::c_char; _SYSNAME_SIZE],
+        pub nodename: [::c_char; _SYSNAME_SIZE],
+        pub release: [::c_char; _SYSNAME_SIZE],
+        pub version: [::c_char; _SYSNAME_SIZE],
+        pub machine: [::c_char; _SYSNAME_SIZE],
+    }
+
+    pub struct sigevent {
+        pub sigev_notify: ::c_int,
+        pub __padding1: ::c_int,
+        pub sigev_signo: ::c_int, // union
+        pub __padding2: ::c_int,
+        pub sigev_value: ::sigval,
+        __sigev_un2: usize, // union
+
+    }
+    pub struct dirent {
+        pub d_ino: ::ino_t,
+        pub d_offset: ::off_t,
+        pub d_reclen: ::c_short,
+        pub d_namelen: ::c_short,
+        pub d_name: [::c_char; 1], // flex array
+    }
+
+    pub struct sigset_t {
+        __val: [u32; 2],
+    }
+
+    pub struct mq_attr {
+        pub mq_maxmsg: ::c_long,
+        pub mq_msgsize: ::c_long,
+        pub mq_flags: ::c_long,
+        pub mq_curmsgs: ::c_long,
+        pub mq_sendwait: ::c_long,
+        pub mq_recvwait: ::c_long,
+    }
+
+    pub struct msg {
+        pub msg_next: *mut ::msg,
+        pub msg_type: ::c_long,
+        pub msg_ts: ::c_ushort,
+        pub msg_spot: ::c_short,
+        _pad: [u8; 4],
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_first: *mut ::msg,
+        pub msg_last: *mut ::msg,
+        pub msg_cbytes: ::msglen_t,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        pub msg_stime: ::time_t,
+        msg_pad1: ::c_long,
+        pub msg_rtime: ::time_t,
+        msg_pad2: ::c_long,
+        pub msg_ctime: ::time_t,
+        msg_pad3: ::c_long,
+        msg_pad4: [::c_long; 4],
+    }
+
+    pub struct sockaddr_dl {
+        pub sdl_len: ::c_uchar,
+        pub sdl_family: ::sa_family_t,
+        pub sdl_index: u16,
+        pub sdl_type: ::c_uchar,
+        pub sdl_nlen: ::c_uchar,
+        pub sdl_alen: ::c_uchar,
+        pub sdl_slen: ::c_uchar,
+        pub sdl_data: [::c_char; 12],
+    }
+
+    pub struct sync_t {
+        __u: ::c_uint,                     // union
+        pub __owner: ::c_uint,
+    }
+
+    #[repr(align(4))]
+    pub struct pthread_barrier_t {         // union
+        __pad: [u8; 28],                   // union
+    }
+
+    pub struct pthread_rwlock_t {
+        pub __active: ::c_int,
+        pub __blockedwriters: ::c_int,
+        pub __blockedreaders: ::c_int,
+        pub __heavy: ::c_int,
+        pub __lock: ::pthread_mutex_t,     // union
+        pub __rcond: ::pthread_cond_t,     // union
+        pub __wcond: ::pthread_cond_t,     // union
+        pub __owner: ::c_uint,
+        pub __spare: ::c_uint,
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        // sigevent
+        impl PartialEq for sigevent {
+            fn eq(&self, other: &sigevent) -> bool {
+                self.sigev_notify == other.sigev_notify
+                    && self.sigev_signo == other.sigev_signo
+                    && self.sigev_value == other.sigev_value
+                    && self.__sigev_un2
+                        == other.__sigev_un2
+            }
+        }
+        impl Eq for sigevent {}
+        impl ::fmt::Debug for sigevent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sigevent")
+                    .field("sigev_notify", &self.sigev_notify)
+                    .field("sigev_signo", &self.sigev_signo)
+                    .field("sigev_value", &self.sigev_value)
+                    .field("__sigev_un2",
+                        &self.__sigev_un2)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sigevent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sigev_notify.hash(state);
+                self.sigev_signo.hash(state);
+                self.sigev_value.hash(state);
+                self.__sigev_un2.hash(state);
+            }
+        }
+
+        impl PartialEq for sockaddr_un {
+            fn eq(&self, other: &sockaddr_un) -> bool {
+                self.sun_len == other.sun_len
+                    && self.sun_family == other.sun_family
+                    && self
+                    .sun_path
+                    .iter()
+                    .zip(other.sun_path.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for sockaddr_un {}
+        impl ::fmt::Debug for sockaddr_un {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_un")
+                    .field("sun_len", &self.sun_len)
+                    .field("sun_family", &self.sun_family)
+                    // FIXME: .field("sun_path", &self.sun_path)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for sockaddr_un {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sun_len.hash(state);
+                self.sun_family.hash(state);
+                self.sun_path.hash(state);
+            }
+        }
+
+        // sigset_t
+        impl PartialEq for sigset_t {
+            fn eq(&self, other: &sigset_t) -> bool {
+                self.__val == other.__val
+            }
+        }
+        impl Eq for sigset_t {}
+        impl ::fmt::Debug for sigset_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sigset_t")
+                    .field("__val", &self.__val)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sigset_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.__val.hash(state);
+            }
+        }
+
+        // msg
+        impl ::fmt::Debug for msg {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("msg")
+                    .field("msg_next", &self.msg_next)
+                    .field("msg_type", &self.msg_type)
+                    .field("msg_ts", &self.msg_ts)
+                    .field("msg_spot", &self.msg_spot)
+                .finish()
+            }
+        }
+
+        // msqid_ds
+        impl ::fmt::Debug for msqid_ds {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("msqid_ds")
+                    .field("msg_perm", &self.msg_perm)
+                    .field("msg_first", &self.msg_first)
+                    .field("msg_cbytes", &self.msg_cbytes)
+                    .field("msg_qnum", &self.msg_qnum)
+                    .field("msg_qbytes", &self.msg_qbytes)
+                    .field("msg_lspid", &self.msg_lspid)
+                    .field("msg_lrpid", &self.msg_lrpid)
+                    .field("msg_stime", &self.msg_stime)
+                    .field("msg_rtime", &self.msg_rtime)
+                    .field("msg_ctime", &self.msg_ctime)
+                    .finish()
+            }
+        }
+
+        // sockaddr_dl
+        impl ::fmt::Debug for sockaddr_dl {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_dl")
+                    .field("sdl_len", &self.sdl_len)
+                    .field("sdl_family", &self.sdl_family)
+                    .field("sdl_index", &self.sdl_index)
+                    .field("sdl_type", &self.sdl_type)
+                    .field("sdl_nlen", &self.sdl_nlen)
+                    .field("sdl_alen", &self.sdl_alen)
+                    .field("sdl_slen", &self.sdl_slen)
+                    .field("sdl_data", &self.sdl_data)
+                    .finish()
+            }
+        }
+        impl PartialEq for sockaddr_dl {
+            fn eq(&self, other: &sockaddr_dl) -> bool {
+                self.sdl_len == other.sdl_len
+                    && self.sdl_family == other.sdl_family
+                    && self.sdl_index == other.sdl_index
+                    && self.sdl_type == other.sdl_type
+                    && self.sdl_nlen == other.sdl_nlen
+                    && self.sdl_alen == other.sdl_alen
+                    && self.sdl_slen == other.sdl_slen
+                    && self
+                    .sdl_data
+                    .iter()
+                    .zip(other.sdl_data.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for sockaddr_dl {}
+        impl ::hash::Hash for sockaddr_dl {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sdl_len.hash(state);
+                self.sdl_family.hash(state);
+                self.sdl_index.hash(state);
+                self.sdl_type.hash(state);
+                self.sdl_nlen.hash(state);
+                self.sdl_alen.hash(state);
+                self.sdl_slen.hash(state);
+                self.sdl_data.hash(state);
+            }
+        }
+
+        // sync_t
+        impl ::fmt::Debug for sync_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sync_t")
+                    .field("__owner", &self.__owner)
+                    .field("__u", &self.__u)
+                    .finish()
+            }
+        }
+
+        // pthread_barrier_t
+        impl ::fmt::Debug for pthread_barrier_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("pthread_barrier_t")
+                    .field("__pad", &self.__pad)
+                    .finish()
+            }
+        }
+
+        // pthread_rwlock_t
+        impl ::fmt::Debug for pthread_rwlock_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("pthread_rwlock_t")
+                    .field("__active", &self.__active)
+                    .field("__blockedwriters", &self.__blockedwriters)
+                    .field("__blockedreaders", &self.__blockedreaders)
+                    .field("__heavy", &self.__heavy)
+                    .field("__lock", &self.__lock)
+                    .field("__rcond", &self.__rcond)
+                    .field("__wcond", &self.__wcond)
+                    .field("__owner", &self.__owner)
+                    .field("__spare", &self.__spare)
+                .finish()
+            }
+        }
+
+        // syspage_entry
+        impl ::fmt::Debug for syspage_entry {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("syspage_entry")
+                    .field("size", &self.size)
+                    .field("total_size", &self.total_size)
+                    .field("type_", &self.type_)
+                    .field("num_cpu", &self.num_cpu)
+                    .field("system_private", &self.system_private)
+                    .field("old_asinfo", &self.old_asinfo)
+                    .field("hwinfo", &self.hwinfo)
+                    .field("old_cpuinfo", &self.old_cpuinfo)
+                    .field("old_cacheattr", &self.old_cacheattr)
+                    .field("qtime", &self.qtime)
+                    .field("callout", &self.callout)
+                    .field("callin", &self.callin)
+                    .field("typed_strings", &self.typed_strings)
+                    .field("strings", &self.strings)
+                    .field("old_intrinfo", &self.old_intrinfo)
+                    .field("smp", &self.smp)
+                    .field("pminfo", &self.pminfo)
+                    .field("old_mdriver", &self.old_mdriver)
+                    .field("new_asinfo", &self.new_asinfo)
+                    .field("new_cpuinfo", &self.new_cpuinfo)
+                    .field("new_cacheattr", &self.new_cacheattr)
+                    .field("new_intrinfo", &self.new_intrinfo)
+                    .field("new_mdriver", &self.new_mdriver)
+                    .finish()
+            }
+        }
+
+        impl PartialEq for utsname {
+            fn eq(&self, other: &utsname) -> bool {
+                self.sysname
+                    .iter()
+                    .zip(other.sysname.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .nodename
+                    .iter()
+                    .zip(other.nodename.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .release
+                    .iter()
+                    .zip(other.release.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .version
+                    .iter()
+                    .zip(other.version.iter())
+                    .all(|(a,b)| a == b)
+                    && self
+                    .machine
+                    .iter()
+                    .zip(other.machine.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for utsname {}
+
+        impl ::fmt::Debug for utsname {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("utsname")
+                // FIXME: .field("sysname", &self.sysname)
+                // FIXME: .field("nodename", &self.nodename)
+                // FIXME: .field("release", &self.release)
+                // FIXME: .field("version", &self.version)
+                // FIXME: .field("machine", &self.machine)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for utsname {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sysname.hash(state);
+                self.nodename.hash(state);
+                self.release.hash(state);
+                self.version.hash(state);
+                self.machine.hash(state);
+            }
+        }
+
+        impl PartialEq for mq_attr {
+            fn eq(&self, other: &mq_attr) -> bool {
+                self.mq_maxmsg == other.mq_maxmsg &&
+                self.mq_msgsize == other.mq_msgsize &&
+                self.mq_flags == other.mq_flags &&
+                self.mq_curmsgs == other.mq_curmsgs &&
+                self.mq_msgsize == other.mq_msgsize &&
+                self.mq_sendwait == other.mq_sendwait &&
+                self.mq_recvwait == other.mq_recvwait
+            }
+        }
+
+        impl Eq for mq_attr {}
+
+        impl ::fmt::Debug for mq_attr {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("mq_attr")
+                    .field("mq_maxmsg", &self.mq_maxmsg)
+                    .field("mq_msgsize", &self.mq_msgsize)
+                    .field("mq_flags", &self.mq_flags)
+                    .field("mq_curmsgs", &self.mq_curmsgs)
+                    .field("mq_msgsize", &self.mq_msgsize)
+                    .field("mq_sendwait", &self.mq_sendwait)
+                    .field("mq_recvwait", &self.mq_recvwait)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for mq_attr {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.mq_maxmsg.hash(state);
+                self.mq_msgsize.hash(state);
+                self.mq_flags.hash(state);
+                self.mq_curmsgs.hash(state);
+                self.mq_sendwait.hash(state);
+                self.mq_recvwait.hash(state);
+            }
+        }
+
+        impl PartialEq for sockaddr_storage {
+            fn eq(&self, other: &sockaddr_storage) -> bool {
+                self.ss_len == other.ss_len
+                    && self.ss_family == other.ss_family
+                    && self.__ss_pad1 == other.__ss_pad1
+                    && self.__ss_align == other.__ss_align
+                    && self
+                    .__ss_pad2
+                    .iter()
+                    .zip(other.__ss_pad2.iter())
+                    .all(|(a, b)| a == b)
+            }
+        }
+
+        impl Eq for sockaddr_storage {}
+
+        impl ::fmt::Debug for sockaddr_storage {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_storage")
+                    .field("ss_len", &self.ss_len)
+                    .field("ss_family", &self.ss_family)
+                    .field("__ss_pad1", &self.__ss_pad1)
+                    .field("__ss_align", &self.__ss_align)
+                    // FIXME: .field("__ss_pad2", &self.__ss_pad2)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for sockaddr_storage {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ss_len.hash(state);
+                self.ss_family.hash(state);
+                self.__ss_pad1.hash(state);
+                self.__ss_align.hash(state);
+                self.__ss_pad2.hash(state);
+            }
+        }
+
+        impl PartialEq for dirent {
+            fn eq(&self, other: &dirent) -> bool {
+                self.d_ino == other.d_ino
+                    && self.d_offset == other.d_offset
+                    && self.d_reclen == other.d_reclen
+                    && self.d_namelen == other.d_namelen
+                    && self
+                    .d_name[..self.d_namelen as _]
+                    .iter()
+                    .zip(other.d_name.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for dirent {}
+
+        impl ::fmt::Debug for dirent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("dirent")
+                    .field("d_ino", &self.d_ino)
+                    .field("d_offset", &self.d_offset)
+                    .field("d_reclen", &self.d_reclen)
+                    .field("d_namelen", &self.d_namelen)
+                    .field("d_name", &&self.d_name[..self.d_namelen as _])
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for dirent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.d_ino.hash(state);
+                self.d_offset.hash(state);
+                self.d_reclen.hash(state);
+                self.d_namelen.hash(state);
+                self.d_name[..self.d_namelen as _].hash(state);
+            }
+        }
+    }
+}
+
+pub const _SYSNAME_SIZE: usize = 256 + 1;
+pub const RLIM_INFINITY: ::rlim_t = 0xfffffffffffffffd;
+pub const O_LARGEFILE: ::c_int = 0o0100000;
+
+// intentionally not public, only used for fd_set
+cfg_if! {
+    if #[cfg(target_pointer_width = "32")] {
+        const ULONG_SIZE: usize = 32;
+    } else if #[cfg(target_pointer_width = "64")] {
+        const ULONG_SIZE: usize = 64;
+    } else {
+        // Unknown target_pointer_width
+    }
+}
+
+pub const EXIT_FAILURE: ::c_int = 1;
+pub const EXIT_SUCCESS: ::c_int = 0;
+pub const RAND_MAX: ::c_int = 32767;
+pub const EOF: ::c_int = -1;
+pub const SEEK_SET: ::c_int = 0;
+pub const SEEK_CUR: ::c_int = 1;
+pub const SEEK_END: ::c_int = 2;
+pub const _IOFBF: ::c_int = 0;
+pub const _IONBF: ::c_int = 2;
+pub const _IOLBF: ::c_int = 1;
+
+pub const F_DUPFD: ::c_int = 0;
+pub const F_GETFD: ::c_int = 1;
+pub const F_SETFD: ::c_int = 2;
+pub const F_GETFL: ::c_int = 3;
+pub const F_SETFL: ::c_int = 4;
+
+pub const F_DUPFD_CLOEXEC: ::c_int = 5;
+
+pub const SIGTRAP: ::c_int = 5;
+
+pub const CLOCK_REALTIME: ::clockid_t = 0;
+pub const CLOCK_MONOTONIC: ::clockid_t = 2;
+pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 3;
+pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 4;
+pub const TIMER_ABSTIME: ::c_uint = 0x80000000;
+
+pub const RUSAGE_SELF: ::c_int = 0;
+
+pub const F_OK: ::c_int = 0;
+pub const X_OK: ::c_int = 1;
+pub const W_OK: ::c_int = 2;
+pub const R_OK: ::c_int = 4;
+
+pub const STDIN_FILENO: ::c_int = 0;
+pub const STDOUT_FILENO: ::c_int = 1;
+pub const STDERR_FILENO: ::c_int = 2;
+
+pub const SIGHUP: ::c_int = 1;
+pub const SIGINT: ::c_int = 2;
+pub const SIGQUIT: ::c_int = 3;
+pub const SIGILL: ::c_int = 4;
+pub const SIGABRT: ::c_int = 6;
+pub const SIGFPE: ::c_int = 8;
+pub const SIGKILL: ::c_int = 9;
+pub const SIGSEGV: ::c_int = 11;
+pub const SIGPIPE: ::c_int = 13;
+pub const SIGALRM: ::c_int = 14;
+pub const SIGTERM: ::c_int = 15;
+
+pub const PROT_NONE: ::c_int = 0x00000000;
+pub const PROT_READ: ::c_int = 0x00000100;
+pub const PROT_WRITE: ::c_int = 0x00000200;
+pub const PROT_EXEC: ::c_int = 0x00000400;
+
+pub const MAP_FILE: ::c_int = 0;
+pub const MAP_SHARED: ::c_int = 1;
+pub const MAP_PRIVATE: ::c_int = 2;
+pub const MAP_FIXED: ::c_int = 0x10;
+
+pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
+
+pub const MS_ASYNC: ::c_int = 1;
+pub const MS_INVALIDATE: ::c_int = 4;
+pub const MS_SYNC: ::c_int = 2;
+
+pub const SCM_RIGHTS: ::c_int = 0x01;
+pub const SCM_TIMESTAMP: ::c_int = 0x02;
+pub const SCM_CREDS: ::c_int = 0x04;
+
+pub const MAP_TYPE: ::c_int = 0x3;
+
+pub const IFF_UP: ::c_int = 0x00000001;
+pub const IFF_BROADCAST: ::c_int = 0x00000002;
+pub const IFF_DEBUG: ::c_int = 0x00000004;
+pub const IFF_LOOPBACK: ::c_int = 0x00000008;
+pub const IFF_POINTOPOINT: ::c_int = 0x00000010;
+pub const IFF_NOTRAILERS: ::c_int = 0x00000020;
+pub const IFF_RUNNING: ::c_int = 0x00000040;
+pub const IFF_NOARP: ::c_int = 0x00000080;
+pub const IFF_PROMISC: ::c_int = 0x00000100;
+pub const IFF_ALLMULTI: ::c_int = 0x00000200;
+pub const IFF_MULTICAST: ::c_int = 0x00008000;
+
+pub const AF_UNSPEC: ::c_int = 0;
+pub const AF_UNIX: ::c_int = AF_LOCAL;
+pub const AF_LOCAL: ::c_int = 1;
+pub const AF_INET: ::c_int = 2;
+pub const AF_IPX: ::c_int = 23;
+pub const AF_APPLETALK: ::c_int = 16;
+pub const AF_INET6: ::c_int = 24;
+pub const AF_ROUTE: ::c_int = 17;
+pub const AF_SNA: ::c_int = 11;
+pub const AF_BLUETOOTH: ::c_int = 31;
+pub const AF_ISDN: ::c_int = 26;
+
+pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
+pub const PF_UNIX: ::c_int = PF_LOCAL;
+pub const PF_LOCAL: ::c_int = AF_LOCAL;
+pub const PF_INET: ::c_int = AF_INET;
+pub const PF_IPX: ::c_int = AF_IPX;
+pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
+pub const PF_INET6: ::c_int = AF_INET6;
+pub const pseudo_AF_KEY: ::c_int = 29;
+pub const PF_KEY: ::c_int = pseudo_AF_KEY;
+pub const PF_ROUTE: ::c_int = AF_ROUTE;
+pub const PF_SNA: ::c_int = AF_SNA;
+
+pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
+pub const PF_ISDN: ::c_int = AF_ISDN;
+
+pub const SOMAXCONN: ::c_int = 128;
+
+pub const MSG_OOB: ::c_int = 0x0001;
+pub const MSG_PEEK: ::c_int = 0x0002;
+pub const MSG_DONTROUTE: ::c_int = 0x0004;
+pub const MSG_CTRUNC: ::c_int = 0x0020;
+pub const MSG_TRUNC: ::c_int = 0x0010;
+pub const MSG_DONTWAIT: ::c_int = 0x0080;
+pub const MSG_EOR: ::c_int = 0x0008;
+pub const MSG_WAITALL: ::c_int = 0x0040;
+pub const MSG_NOSIGNAL: ::c_int = 0x0800;
+pub const MSG_WAITFORONE: ::c_int = 0x2000;
+
+pub const IP_TOS: ::c_int = 3;
+pub const IP_TTL: ::c_int = 4;
+pub const IP_HDRINCL: ::c_int = 2;
+pub const IP_OPTIONS: ::c_int = 1;
+pub const IP_RECVOPTS: ::c_int = 5;
+pub const IP_RETOPTS: ::c_int = 8;
+pub const IP_PKTINFO: ::c_int = 25;
+pub const IP_IPSEC_POLICY_COMPAT: ::c_int = 22;
+pub const IP_MULTICAST_IF: ::c_int = 9;
+pub const IP_MULTICAST_TTL: ::c_int = 10;
+pub const IP_MULTICAST_LOOP: ::c_int = 11;
+pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
+pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
+pub const IP_DEFAULT_MULTICAST_TTL: ::c_int = 1;
+pub const IP_DEFAULT_MULTICAST_LOOP: ::c_int = 1;
+
+pub const IPPROTO_HOPOPTS: ::c_int = 0;
+pub const IPPROTO_IGMP: ::c_int = 2;
+pub const IPPROTO_IPIP: ::c_int = 4;
+pub const IPPROTO_EGP: ::c_int = 8;
+pub const IPPROTO_PUP: ::c_int = 12;
+pub const IPPROTO_IDP: ::c_int = 22;
+pub const IPPROTO_TP: ::c_int = 29;
+pub const IPPROTO_ROUTING: ::c_int = 43;
+pub const IPPROTO_FRAGMENT: ::c_int = 44;
+pub const IPPROTO_RSVP: ::c_int = 46;
+pub const IPPROTO_GRE: ::c_int = 47;
+pub const IPPROTO_ESP: ::c_int = 50;
+pub const IPPROTO_AH: ::c_int = 51;
+pub const IPPROTO_NONE: ::c_int = 59;
+pub const IPPROTO_DSTOPTS: ::c_int = 60;
+pub const IPPROTO_ENCAP: ::c_int = 98;
+pub const IPPROTO_PIM: ::c_int = 103;
+pub const IPPROTO_SCTP: ::c_int = 132;
+pub const IPPROTO_RAW: ::c_int = 255;
+pub const IPPROTO_MAX: ::c_int = 256;
+pub const IPPROTO_CARP: ::c_int = 112;
+pub const IPPROTO_DIVERT: ::c_int = 259;
+pub const IPPROTO_DONE: ::c_int = 257;
+pub const IPPROTO_EON: ::c_int = 80;
+pub const IPPROTO_ETHERIP: ::c_int = 97;
+pub const IPPROTO_GGP: ::c_int = 3;
+pub const IPPROTO_IPCOMP: ::c_int = 108;
+pub const IPPROTO_MOBILE: ::c_int = 55;
+
+pub const IPV6_RTHDR_LOOSE: ::c_int = 0;
+pub const IPV6_RTHDR_STRICT: ::c_int = 1;
+pub const IPV6_UNICAST_HOPS: ::c_int = 4;
+pub const IPV6_MULTICAST_IF: ::c_int = 9;
+pub const IPV6_MULTICAST_HOPS: ::c_int = 10;
+pub const IPV6_MULTICAST_LOOP: ::c_int = 11;
+pub const IPV6_JOIN_GROUP: ::c_int = 12;
+pub const IPV6_LEAVE_GROUP: ::c_int = 13;
+pub const IPV6_CHECKSUM: ::c_int = 26;
+pub const IPV6_V6ONLY: ::c_int = 27;
+pub const IPV6_IPSEC_POLICY_COMPAT: ::c_int = 28;
+pub const IPV6_RTHDRDSTOPTS: ::c_int = 35;
+pub const IPV6_RECVPKTINFO: ::c_int = 36;
+pub const IPV6_RECVHOPLIMIT: ::c_int = 37;
+pub const IPV6_RECVRTHDR: ::c_int = 38;
+pub const IPV6_RECVHOPOPTS: ::c_int = 39;
+pub const IPV6_RECVDSTOPTS: ::c_int = 40;
+pub const IPV6_RECVPATHMTU: ::c_int = 43;
+pub const IPV6_PATHMTU: ::c_int = 44;
+pub const IPV6_PKTINFO: ::c_int = 46;
+pub const IPV6_HOPLIMIT: ::c_int = 47;
+pub const IPV6_NEXTHOP: ::c_int = 48;
+pub const IPV6_HOPOPTS: ::c_int = 49;
+pub const IPV6_DSTOPTS: ::c_int = 50;
+pub const IPV6_RECVTCLASS: ::c_int = 57;
+pub const IPV6_TCLASS: ::c_int = 61;
+pub const IPV6_DONTFRAG: ::c_int = 62;
+
+pub const TCP_NODELAY: ::c_int = 0x01;
+pub const TCP_MAXSEG: ::c_int = 0x02;
+pub const TCP_MD5SIG: ::c_int = 0x10;
+pub const TCP_KEEPALIVE: ::c_int = 0x04;
+
+pub const SHUT_RD: ::c_int = 0;
+pub const SHUT_WR: ::c_int = 1;
+pub const SHUT_RDWR: ::c_int = 2;
+
+pub const LOCK_SH: ::c_int = 0x1;
+pub const LOCK_EX: ::c_int = 0x2;
+pub const LOCK_NB: ::c_int = 0x4;
+pub const LOCK_UN: ::c_int = 0x8;
+
+pub const SS_ONSTACK: ::c_int = 1;
+pub const SS_DISABLE: ::c_int = 2;
+
+pub const PATH_MAX: ::c_int = 1024;
+
+pub const UIO_MAXIOV: ::c_int = 1024;
+
+pub const FD_SETSIZE: usize = 256;
+
+pub const TCIOFF: ::c_int = 0x0002;
+pub const TCION: ::c_int = 0x0003;
+pub const TCOOFF: ::c_int = 0x0000;
+pub const TCOON: ::c_int = 0x0001;
+pub const TCIFLUSH: ::c_int = 0;
+pub const TCOFLUSH: ::c_int = 1;
+pub const TCIOFLUSH: ::c_int = 2;
+pub const NL0: ::tcflag_t = 0x000;
+pub const NL1: ::tcflag_t = 0x100;
+pub const TAB0: ::tcflag_t = 0x0000;
+pub const CR0: ::tcflag_t = 0x000;
+pub const FF0: ::tcflag_t = 0x0000;
+pub const BS0: ::tcflag_t = 0x0000;
+pub const VT0: ::tcflag_t = 0x0000;
+pub const VERASE: usize = 2;
+pub const VKILL: usize = 3;
+pub const VINTR: usize = 0;
+pub const VQUIT: usize = 1;
+pub const VLNEXT: usize = 15;
+pub const IGNBRK: ::tcflag_t = 0x00000001;
+pub const BRKINT: ::tcflag_t = 0x00000002;
+pub const IGNPAR: ::tcflag_t = 0x00000004;
+pub const PARMRK: ::tcflag_t = 0x00000008;
+pub const INPCK: ::tcflag_t = 0x00000010;
+pub const ISTRIP: ::tcflag_t = 0x00000020;
+pub const INLCR: ::tcflag_t = 0x00000040;
+pub const IGNCR: ::tcflag_t = 0x00000080;
+pub const ICRNL: ::tcflag_t = 0x00000100;
+pub const IXANY: ::tcflag_t = 0x00000800;
+pub const IMAXBEL: ::tcflag_t = 0x00002000;
+pub const OPOST: ::tcflag_t = 0x00000001;
+pub const CS5: ::tcflag_t = 0x00;
+pub const ECHO: ::tcflag_t = 0x00000008;
+pub const OCRNL: ::tcflag_t = 0x00000008;
+pub const ONOCR: ::tcflag_t = 0x00000010;
+pub const ONLRET: ::tcflag_t = 0x00000020;
+pub const OFILL: ::tcflag_t = 0x00000040;
+pub const OFDEL: ::tcflag_t = 0x00000080;
+
+pub const WNOHANG: ::c_int = 0x0040;
+pub const WUNTRACED: ::c_int = 0x0004;
+pub const WSTOPPED: ::c_int = WUNTRACED;
+pub const WEXITED: ::c_int = 0x0001;
+pub const WCONTINUED: ::c_int = 0x0008;
+pub const WNOWAIT: ::c_int = 0x0080;
+pub const WTRAPPED: ::c_int = 0x0002;
+
+pub const RTLD_LOCAL: ::c_int = 0x0200;
+pub const RTLD_LAZY: ::c_int = 0x0001;
+
+pub const POSIX_FADV_NORMAL: ::c_int = 0;
+pub const POSIX_FADV_RANDOM: ::c_int = 2;
+pub const POSIX_FADV_SEQUENTIAL: ::c_int = 1;
+pub const POSIX_FADV_WILLNEED: ::c_int = 3;
+
+pub const AT_FDCWD: ::c_int = -100;
+pub const AT_EACCESS: ::c_int = 0x0001;
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x0002;
+pub const AT_SYMLINK_FOLLOW: ::c_int = 0x0004;
+pub const AT_REMOVEDIR: ::c_int = 0x0008;
+
+pub const LOG_CRON: ::c_int = 9 << 3;
+pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
+pub const LOG_FTP: ::c_int = 11 << 3;
+pub const LOG_PERROR: ::c_int = 0x20;
+
+pub const PIPE_BUF: usize = 5120;
+
+pub const CLD_EXITED: ::c_int = 1;
+pub const CLD_KILLED: ::c_int = 2;
+pub const CLD_DUMPED: ::c_int = 3;
+pub const CLD_TRAPPED: ::c_int = 4;
+pub const CLD_STOPPED: ::c_int = 5;
+pub const CLD_CONTINUED: ::c_int = 6;
+
+pub const UTIME_OMIT: c_long = 0x40000002;
+pub const UTIME_NOW: c_long = 0x40000001;
+
+pub const POLLIN: ::c_short = POLLRDNORM | POLLRDBAND;
+pub const POLLPRI: ::c_short = 0x0008;
+pub const POLLOUT: ::c_short = 0x0002;
+pub const POLLERR: ::c_short = 0x0020;
+pub const POLLHUP: ::c_short = 0x0040;
+pub const POLLNVAL: ::c_short = 0x1000;
+pub const POLLRDNORM: ::c_short = 0x0001;
+pub const POLLRDBAND: ::c_short = 0x0004;
+
+pub const IPTOS_LOWDELAY: u8 = 0x10;
+pub const IPTOS_THROUGHPUT: u8 = 0x08;
+pub const IPTOS_RELIABILITY: u8 = 0x04;
+pub const IPTOS_MINCOST: u8 = 0x02;
+
+pub const IPTOS_PREC_NETCONTROL: u8 = 0xe0;
+pub const IPTOS_PREC_INTERNETCONTROL: u8 = 0xc0;
+pub const IPTOS_PREC_CRITIC_ECP: u8 = 0xa0;
+pub const IPTOS_PREC_FLASHOVERRIDE: u8 = 0x80;
+pub const IPTOS_PREC_FLASH: u8 = 0x60;
+pub const IPTOS_PREC_IMMEDIATE: u8 = 0x40;
+pub const IPTOS_PREC_PRIORITY: u8 = 0x20;
+pub const IPTOS_PREC_ROUTINE: u8 = 0x00;
+
+pub const IPTOS_ECN_MASK: u8 = 0x03;
+pub const IPTOS_ECN_ECT1: u8 = 0x01;
+pub const IPTOS_ECN_ECT0: u8 = 0x02;
+pub const IPTOS_ECN_CE: u8 = 0x03;
+
+pub const IPOPT_CONTROL: u8 = 0x00;
+pub const IPOPT_RESERVED1: u8 = 0x20;
+pub const IPOPT_RESERVED2: u8 = 0x60;
+pub const IPOPT_LSRR: u8 = 131;
+pub const IPOPT_RR: u8 = 7;
+pub const IPOPT_SSRR: u8 = 137;
+pub const IPDEFTTL: u8 = 64;
+pub const IPOPT_OPTVAL: u8 = 0;
+pub const IPOPT_OLEN: u8 = 1;
+pub const IPOPT_OFFSET: u8 = 2;
+pub const IPOPT_MINOFF: u8 = 4;
+pub const IPOPT_NOP: u8 = 1;
+pub const IPOPT_EOL: u8 = 0;
+pub const IPOPT_TS: u8 = 68;
+pub const IPOPT_TS_TSONLY: u8 = 0;
+pub const IPOPT_TS_TSANDADDR: u8 = 1;
+pub const IPOPT_TS_PRESPEC: u8 = 3;
+
+pub const MAX_IPOPTLEN: u8 = 40;
+pub const IPVERSION: u8 = 4;
+pub const MAXTTL: u8 = 255;
+
+pub const ARPHRD_ETHER: u16 = 1;
+pub const ARPHRD_IEEE802: u16 = 6;
+pub const ARPHRD_ARCNET: u16 = 7;
+pub const ARPHRD_IEEE1394: u16 = 24;
+
+pub const SOL_SOCKET: ::c_int = 0xffff;
+
+pub const SO_DEBUG: ::c_int = 0x0001;
+pub const SO_REUSEADDR: ::c_int = 0x0004;
+pub const SO_TYPE: ::c_int = 0x1008;
+pub const SO_ERROR: ::c_int = 0x1007;
+pub const SO_DONTROUTE: ::c_int = 0x0010;
+pub const SO_BROADCAST: ::c_int = 0x0020;
+pub const SO_SNDBUF: ::c_int = 0x1001;
+pub const SO_RCVBUF: ::c_int = 0x1002;
+pub const SO_KEEPALIVE: ::c_int = 0x0008;
+pub const SO_OOBINLINE: ::c_int = 0x0100;
+pub const SO_LINGER: ::c_int = 0x0080;
+pub const SO_REUSEPORT: ::c_int = 0x0200;
+pub const SO_RCVLOWAT: ::c_int = 0x1004;
+pub const SO_SNDLOWAT: ::c_int = 0x1003;
+pub const SO_RCVTIMEO: ::c_int = 0x1006;
+pub const SO_SNDTIMEO: ::c_int = 0x1005;
+pub const SO_BINDTODEVICE: ::c_int = 0x0800;
+pub const SO_TIMESTAMP: ::c_int = 0x0400;
+pub const SO_ACCEPTCONN: ::c_int = 0x0002;
+
+pub const TIOCM_LE: ::c_int = 0x0100;
+pub const TIOCM_DTR: ::c_int = 0x0001;
+pub const TIOCM_RTS: ::c_int = 0x0002;
+pub const TIOCM_ST: ::c_int = 0x0200;
+pub const TIOCM_SR: ::c_int = 0x0400;
+pub const TIOCM_CTS: ::c_int = 0x1000;
+pub const TIOCM_CAR: ::c_int = TIOCM_CD;
+pub const TIOCM_CD: ::c_int = 0x8000;
+pub const TIOCM_RNG: ::c_int = TIOCM_RI;
+pub const TIOCM_RI: ::c_int = 0x4000;
+pub const TIOCM_DSR: ::c_int = 0x2000;
+
+pub const SCHED_OTHER: ::c_int = 3;
+pub const SCHED_FIFO: ::c_int = 1;
+pub const SCHED_RR: ::c_int = 2;
+
+pub const IPC_PRIVATE: ::key_t = 0;
+
+pub const IPC_CREAT: ::c_int = 0o001000;
+pub const IPC_EXCL: ::c_int = 0o002000;
+pub const IPC_NOWAIT: ::c_int = 0o004000;
+
+pub const IPC_RMID: ::c_int = 0;
+pub const IPC_SET: ::c_int = 1;
+pub const IPC_STAT: ::c_int = 2;
+
+pub const MSG_NOERROR: ::c_int = 0o010000;
+
+pub const LOG_NFACILITIES: ::c_int = 24;
+
+pub const SEM_FAILED: *mut ::sem_t = 0xFFFFFFFFFFFFFFFF as *mut sem_t;
+
+pub const AI_PASSIVE: ::c_int = 0x00000001;
+pub const AI_CANONNAME: ::c_int = 0x00000002;
+pub const AI_NUMERICHOST: ::c_int = 0x00000004;
+
+pub const AI_NUMERICSERV: ::c_int = 0x00000008;
+
+pub const EAI_BADFLAGS: ::c_int = 3;
+pub const EAI_NONAME: ::c_int = 8;
+pub const EAI_AGAIN: ::c_int = 2;
+pub const EAI_FAIL: ::c_int = 4;
+pub const EAI_NODATA: ::c_int = 7;
+pub const EAI_FAMILY: ::c_int = 5;
+pub const EAI_SOCKTYPE: ::c_int = 10;
+pub const EAI_SERVICE: ::c_int = 9;
+pub const EAI_MEMORY: ::c_int = 6;
+pub const EAI_SYSTEM: ::c_int = 11;
+pub const EAI_OVERFLOW: ::c_int = 14;
+
+pub const NI_NUMERICHOST: ::c_int = 0x00000002;
+pub const NI_NUMERICSERV: ::c_int = 0x00000008;
+pub const NI_NOFQDN: ::c_int = 0x00000001;
+pub const NI_NAMEREQD: ::c_int = 0x00000004;
+pub const NI_DGRAM: ::c_int = 0x00000010;
+
+pub const AIO_CANCELED: ::c_int = 0;
+pub const AIO_NOTCANCELED: ::c_int = 2;
+pub const AIO_ALLDONE: ::c_int = 1;
+pub const LIO_READ: ::c_int = 1;
+pub const LIO_WRITE: ::c_int = 2;
+pub const LIO_NOP: ::c_int = 0;
+pub const LIO_WAIT: ::c_int = 1;
+pub const LIO_NOWAIT: ::c_int = 0;
+
+pub const ITIMER_REAL: ::c_int = 0;
+pub const ITIMER_VIRTUAL: ::c_int = 1;
+pub const ITIMER_PROF: ::c_int = 2;
+
+pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x00000010;
+pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x00000001;
+pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x00000004;
+pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x00000002;
+pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x00000400;
+pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x00000040;
+
+pub const IPTOS_ECN_NOT_ECT: u8 = 0x00;
+
+pub const RTF_UP: ::c_ushort = 0x0001;
+pub const RTF_GATEWAY: ::c_ushort = 0x0002;
+
+pub const RTF_HOST: ::c_ushort = 0x0004;
+pub const RTF_DYNAMIC: ::c_ushort = 0x0010;
+pub const RTF_MODIFIED: ::c_ushort = 0x0020;
+pub const RTF_REJECT: ::c_ushort = 0x0008;
+pub const RTF_STATIC: ::c_ushort = 0x0800;
+pub const RTF_XRESOLVE: ::c_ushort = 0x0200;
+pub const RTF_BROADCAST: u32 = 0x80000;
+pub const RTM_NEWADDR: u16 = 0xc;
+pub const RTM_DELADDR: u16 = 0xd;
+pub const RTA_DST: ::c_ushort = 0x1;
+pub const RTA_GATEWAY: ::c_ushort = 0x2;
+
+pub const UDP_ENCAP: ::c_int = 100;
+
+pub const IN_ACCESS: u32 = 0x00000001;
+pub const IN_MODIFY: u32 = 0x00000002;
+pub const IN_ATTRIB: u32 = 0x00000004;
+pub const IN_CLOSE_WRITE: u32 = 0x00000008;
+pub const IN_CLOSE_NOWRITE: u32 = 0x00000010;
+pub const IN_CLOSE: u32 = IN_CLOSE_WRITE | IN_CLOSE_NOWRITE;
+pub const IN_OPEN: u32 = 0x00000020;
+pub const IN_MOVED_FROM: u32 = 0x00000040;
+pub const IN_MOVED_TO: u32 = 0x00000080;
+pub const IN_MOVE: u32 = IN_MOVED_FROM | IN_MOVED_TO;
+pub const IN_CREATE: u32 = 0x00000100;
+pub const IN_DELETE: u32 = 0x00000200;
+pub const IN_DELETE_SELF: u32 = 0x00000400;
+pub const IN_MOVE_SELF: u32 = 0x00000800;
+pub const IN_UNMOUNT: u32 = 0x00002000;
+pub const IN_Q_OVERFLOW: u32 = 0x00004000;
+pub const IN_IGNORED: u32 = 0x00008000;
+pub const IN_ONLYDIR: u32 = 0x01000000;
+pub const IN_DONT_FOLLOW: u32 = 0x02000000;
+
+pub const IN_ISDIR: u32 = 0x40000000;
+pub const IN_ONESHOT: u32 = 0x80000000;
+
+pub const REG_EXTENDED: ::c_int = 0o0001;
+pub const REG_ICASE: ::c_int = 0o0002;
+pub const REG_NEWLINE: ::c_int = 0o0010;
+pub const REG_NOSUB: ::c_int = 0o0004;
+
+pub const REG_NOTBOL: ::c_int = 0o00001;
+pub const REG_NOTEOL: ::c_int = 0o00002;
+
+pub const REG_ENOSYS: ::c_int = 17;
+pub const REG_NOMATCH: ::c_int = 1;
+pub const REG_BADPAT: ::c_int = 2;
+pub const REG_ECOLLATE: ::c_int = 3;
+pub const REG_ECTYPE: ::c_int = 4;
+pub const REG_EESCAPE: ::c_int = 5;
+pub const REG_ESUBREG: ::c_int = 6;
+pub const REG_EBRACK: ::c_int = 7;
+pub const REG_EPAREN: ::c_int = 8;
+pub const REG_EBRACE: ::c_int = 9;
+pub const REG_BADBR: ::c_int = 10;
+pub const REG_ERANGE: ::c_int = 11;
+pub const REG_ESPACE: ::c_int = 12;
+pub const REG_BADRPT: ::c_int = 13;
+
+// errno.h
+pub const EOK: ::c_int = 0;
+pub const EWOULDBLOCK: ::c_int = EAGAIN;
+pub const EPERM: ::c_int = 1;
+pub const ENOENT: ::c_int = 2;
+pub const ESRCH: ::c_int = 3;
+pub const EINTR: ::c_int = 4;
+pub const EIO: ::c_int = 5;
+pub const ENXIO: ::c_int = 6;
+pub const E2BIG: ::c_int = 7;
+pub const ENOEXEC: ::c_int = 8;
+pub const EBADF: ::c_int = 9;
+pub const ECHILD: ::c_int = 10;
+pub const EAGAIN: ::c_int = 11;
+pub const ENOMEM: ::c_int = 12;
+pub const EACCES: ::c_int = 13;
+pub const EFAULT: ::c_int = 14;
+pub const ENOTBLK: ::c_int = 15;
+pub const EBUSY: ::c_int = 16;
+pub const EEXIST: ::c_int = 17;
+pub const EXDEV: ::c_int = 18;
+pub const ENODEV: ::c_int = 19;
+pub const ENOTDIR: ::c_int = 20;
+pub const EISDIR: ::c_int = 21;
+pub const EINVAL: ::c_int = 22;
+pub const ENFILE: ::c_int = 23;
+pub const EMFILE: ::c_int = 24;
+pub const ENOTTY: ::c_int = 25;
+pub const ETXTBSY: ::c_int = 26;
+pub const EFBIG: ::c_int = 27;
+pub const ENOSPC: ::c_int = 28;
+pub const ESPIPE: ::c_int = 29;
+pub const EROFS: ::c_int = 30;
+pub const EMLINK: ::c_int = 31;
+pub const EPIPE: ::c_int = 32;
+pub const EDOM: ::c_int = 33;
+pub const ERANGE: ::c_int = 34;
+pub const ENOMSG: ::c_int = 35;
+pub const EIDRM: ::c_int = 36;
+pub const ECHRNG: ::c_int = 37;
+pub const EL2NSYNC: ::c_int = 38;
+pub const EL3HLT: ::c_int = 39;
+pub const EL3RST: ::c_int = 40;
+pub const ELNRNG: ::c_int = 41;
+pub const EUNATCH: ::c_int = 42;
+pub const ENOCSI: ::c_int = 43;
+pub const EL2HLT: ::c_int = 44;
+pub const EDEADLK: ::c_int = 45;
+pub const ENOLCK: ::c_int = 46;
+pub const ECANCELED: ::c_int = 47;
+pub const EDQUOT: ::c_int = 49;
+pub const EBADE: ::c_int = 50;
+pub const EBADR: ::c_int = 51;
+pub const EXFULL: ::c_int = 52;
+pub const ENOANO: ::c_int = 53;
+pub const EBADRQC: ::c_int = 54;
+pub const EBADSLT: ::c_int = 55;
+pub const EDEADLOCK: ::c_int = 56;
+pub const EBFONT: ::c_int = 57;
+pub const EOWNERDEAD: ::c_int = 58;
+pub const ENOSTR: ::c_int = 60;
+pub const ENODATA: ::c_int = 61;
+pub const ETIME: ::c_int = 62;
+pub const ENOSR: ::c_int = 63;
+pub const ENONET: ::c_int = 64;
+pub const ENOPKG: ::c_int = 65;
+pub const EREMOTE: ::c_int = 66;
+pub const ENOLINK: ::c_int = 67;
+pub const EADV: ::c_int = 68;
+pub const ESRMNT: ::c_int = 69;
+pub const ECOMM: ::c_int = 70;
+pub const EPROTO: ::c_int = 71;
+pub const EMULTIHOP: ::c_int = 74;
+pub const EBADMSG: ::c_int = 77;
+pub const ENAMETOOLONG: ::c_int = 78;
+pub const EOVERFLOW: ::c_int = 79;
+pub const ENOTUNIQ: ::c_int = 80;
+pub const EBADFD: ::c_int = 81;
+pub const EREMCHG: ::c_int = 82;
+pub const ELIBACC: ::c_int = 83;
+pub const ELIBBAD: ::c_int = 84;
+pub const ELIBSCN: ::c_int = 85;
+pub const ELIBMAX: ::c_int = 86;
+pub const ELIBEXEC: ::c_int = 87;
+pub const EILSEQ: ::c_int = 88;
+pub const ENOSYS: ::c_int = 89;
+pub const ELOOP: ::c_int = 90;
+pub const ERESTART: ::c_int = 91;
+pub const ESTRPIPE: ::c_int = 92;
+pub const ENOTEMPTY: ::c_int = 93;
+pub const EUSERS: ::c_int = 94;
+pub const ENOTRECOVERABLE: ::c_int = 95;
+pub const EOPNOTSUPP: ::c_int = 103;
+pub const EFPOS: ::c_int = 110;
+pub const ESTALE: ::c_int = 122;
+pub const EINPROGRESS: ::c_int = 236;
+pub const EALREADY: ::c_int = 237;
+pub const ENOTSOCK: ::c_int = 238;
+pub const EDESTADDRREQ: ::c_int = 239;
+pub const EMSGSIZE: ::c_int = 240;
+pub const EPROTOTYPE: ::c_int = 241;
+pub const ENOPROTOOPT: ::c_int = 242;
+pub const EPROTONOSUPPORT: ::c_int = 243;
+pub const ESOCKTNOSUPPORT: ::c_int = 244;
+pub const EPFNOSUPPORT: ::c_int = 246;
+pub const EAFNOSUPPORT: ::c_int = 247;
+pub const EADDRINUSE: ::c_int = 248;
+pub const EADDRNOTAVAIL: ::c_int = 249;
+pub const ENETDOWN: ::c_int = 250;
+pub const ENETUNREACH: ::c_int = 251;
+pub const ENETRESET: ::c_int = 252;
+pub const ECONNABORTED: ::c_int = 253;
+pub const ECONNRESET: ::c_int = 254;
+pub const ENOBUFS: ::c_int = 255;
+pub const EISCONN: ::c_int = 256;
+pub const ENOTCONN: ::c_int = 257;
+pub const ESHUTDOWN: ::c_int = 258;
+pub const ETOOMANYREFS: ::c_int = 259;
+pub const ETIMEDOUT: ::c_int = 260;
+pub const ECONNREFUSED: ::c_int = 261;
+pub const EHOSTDOWN: ::c_int = 264;
+pub const EHOSTUNREACH: ::c_int = 265;
+pub const EBADRPC: ::c_int = 272;
+pub const ERPCMISMATCH: ::c_int = 273;
+pub const EPROGUNAVAIL: ::c_int = 274;
+pub const EPROGMISMATCH: ::c_int = 275;
+pub const EPROCUNAVAIL: ::c_int = 276;
+pub const ENOREMOTE: ::c_int = 300;
+pub const ENONDP: ::c_int = 301;
+pub const EBADFSYS: ::c_int = 302;
+pub const EMORE: ::c_int = 309;
+pub const ECTRLTERM: ::c_int = 310;
+pub const ENOLIC: ::c_int = 311;
+pub const ESRVRFAULT: ::c_int = 312;
+pub const EENDIAN: ::c_int = 313;
+pub const ESECTYPEINVAL: ::c_int = 314;
+
+pub const RUSAGE_CHILDREN: ::c_int = -1;
+pub const L_tmpnam: ::c_uint = 255;
+
+pub const _PC_LINK_MAX: ::c_int = 1;
+pub const _PC_MAX_CANON: ::c_int = 2;
+pub const _PC_MAX_INPUT: ::c_int = 3;
+pub const _PC_NAME_MAX: ::c_int = 4;
+pub const _PC_PATH_MAX: ::c_int = 5;
+pub const _PC_PIPE_BUF: ::c_int = 6;
+pub const _PC_CHOWN_RESTRICTED: ::c_int = 9;
+pub const _PC_NO_TRUNC: ::c_int = 7;
+pub const _PC_VDISABLE: ::c_int = 8;
+pub const _PC_SYNC_IO: ::c_int = 14;
+pub const _PC_ASYNC_IO: ::c_int = 12;
+pub const _PC_PRIO_IO: ::c_int = 13;
+pub const _PC_SOCK_MAXBUF: ::c_int = 15;
+pub const _PC_FILESIZEBITS: ::c_int = 16;
+pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 22;
+pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 23;
+pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 24;
+pub const _PC_REC_XFER_ALIGN: ::c_int = 25;
+pub const _PC_ALLOC_SIZE_MIN: ::c_int = 21;
+pub const _PC_SYMLINK_MAX: ::c_int = 17;
+pub const _PC_2_SYMLINKS: ::c_int = 20;
+
+pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
+pub const _SC_ARG_MAX: ::c_int = 1;
+pub const _SC_CHILD_MAX: ::c_int = 2;
+pub const _SC_CLK_TCK: ::c_int = 3;
+pub const _SC_NGROUPS_MAX: ::c_int = 4;
+pub const _SC_OPEN_MAX: ::c_int = 5;
+pub const _SC_JOB_CONTROL: ::c_int = 6;
+pub const _SC_SAVED_IDS: ::c_int = 7;
+pub const _SC_VERSION: ::c_int = 8;
+pub const _SC_PASS_MAX: ::c_int = 9;
+pub const _SC_PAGESIZE: ::c_int = 11;
+pub const _SC_XOPEN_VERSION: ::c_int = 12;
+pub const _SC_STREAM_MAX: ::c_int = 13;
+pub const _SC_TZNAME_MAX: ::c_int = 14;
+pub const _SC_AIO_LISTIO_MAX: ::c_int = 15;
+pub const _SC_AIO_MAX: ::c_int = 16;
+pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 17;
+pub const _SC_DELAYTIMER_MAX: ::c_int = 18;
+pub const _SC_MQ_OPEN_MAX: ::c_int = 19;
+pub const _SC_MQ_PRIO_MAX: ::c_int = 20;
+pub const _SC_RTSIG_MAX: ::c_int = 21;
+pub const _SC_SEM_NSEMS_MAX: ::c_int = 22;
+pub const _SC_SEM_VALUE_MAX: ::c_int = 23;
+pub const _SC_SIGQUEUE_MAX: ::c_int = 24;
+pub const _SC_TIMER_MAX: ::c_int = 25;
+pub const _SC_ASYNCHRONOUS_IO: ::c_int = 26;
+pub const _SC_FSYNC: ::c_int = 27;
+pub const _SC_MAPPED_FILES: ::c_int = 28;
+pub const _SC_MEMLOCK: ::c_int = 29;
+pub const _SC_MEMLOCK_RANGE: ::c_int = 30;
+pub const _SC_MEMORY_PROTECTION: ::c_int = 31;
+pub const _SC_MESSAGE_PASSING: ::c_int = 32;
+pub const _SC_PRIORITIZED_IO: ::c_int = 33;
+pub const _SC_PRIORITY_SCHEDULING: ::c_int = 34;
+pub const _SC_REALTIME_SIGNALS: ::c_int = 35;
+pub const _SC_SEMAPHORES: ::c_int = 36;
+pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 37;
+pub const _SC_SYNCHRONIZED_IO: ::c_int = 38;
+pub const _SC_TIMERS: ::c_int = 39;
+pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 40;
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 41;
+pub const _SC_LOGIN_NAME_MAX: ::c_int = 42;
+pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 43;
+pub const _SC_THREAD_KEYS_MAX: ::c_int = 44;
+pub const _SC_THREAD_STACK_MIN: ::c_int = 45;
+pub const _SC_THREAD_THREADS_MAX: ::c_int = 46;
+pub const _SC_TTY_NAME_MAX: ::c_int = 47;
+pub const _SC_THREADS: ::c_int = 48;
+pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 49;
+pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 50;
+pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 51;
+pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 52;
+pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 53;
+pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 54;
+pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 55;
+pub const _SC_2_CHAR_TERM: ::c_int = 56;
+pub const _SC_2_C_BIND: ::c_int = 57;
+pub const _SC_2_C_DEV: ::c_int = 58;
+pub const _SC_2_C_VERSION: ::c_int = 59;
+pub const _SC_2_FORT_DEV: ::c_int = 60;
+pub const _SC_2_FORT_RUN: ::c_int = 61;
+pub const _SC_2_LOCALEDEF: ::c_int = 62;
+pub const _SC_2_SW_DEV: ::c_int = 63;
+pub const _SC_2_UPE: ::c_int = 64;
+pub const _SC_2_VERSION: ::c_int = 65;
+pub const _SC_ATEXIT_MAX: ::c_int = 66;
+pub const _SC_AVPHYS_PAGES: ::c_int = 67;
+pub const _SC_BC_BASE_MAX: ::c_int = 68;
+pub const _SC_BC_DIM_MAX: ::c_int = 69;
+pub const _SC_BC_SCALE_MAX: ::c_int = 70;
+pub const _SC_BC_STRING_MAX: ::c_int = 71;
+pub const _SC_CHARCLASS_NAME_MAX: ::c_int = 72;
+pub const _SC_CHAR_BIT: ::c_int = 73;
+pub const _SC_CHAR_MAX: ::c_int = 74;
+pub const _SC_CHAR_MIN: ::c_int = 75;
+pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 76;
+pub const _SC_EQUIV_CLASS_MAX: ::c_int = 77;
+pub const _SC_EXPR_NEST_MAX: ::c_int = 78;
+pub const _SC_INT_MAX: ::c_int = 79;
+pub const _SC_INT_MIN: ::c_int = 80;
+pub const _SC_LINE_MAX: ::c_int = 81;
+pub const _SC_LONG_BIT: ::c_int = 82;
+pub const _SC_MB_LEN_MAX: ::c_int = 83;
+pub const _SC_NL_ARGMAX: ::c_int = 84;
+pub const _SC_NL_LANGMAX: ::c_int = 85;
+pub const _SC_NL_MSGMAX: ::c_int = 86;
+pub const _SC_NL_NMAX: ::c_int = 87;
+pub const _SC_NL_SETMAX: ::c_int = 88;
+pub const _SC_NL_TEXTMAX: ::c_int = 89;
+pub const _SC_NPROCESSORS_CONF: ::c_int = 90;
+pub const _SC_NPROCESSORS_ONLN: ::c_int = 91;
+pub const _SC_NZERO: ::c_int = 92;
+pub const _SC_PHYS_PAGES: ::c_int = 93;
+pub const _SC_PII: ::c_int = 94;
+pub const _SC_PII_INTERNET: ::c_int = 95;
+pub const _SC_PII_INTERNET_DGRAM: ::c_int = 96;
+pub const _SC_PII_INTERNET_STREAM: ::c_int = 97;
+pub const _SC_PII_OSI: ::c_int = 98;
+pub const _SC_PII_OSI_CLTS: ::c_int = 99;
+pub const _SC_PII_OSI_COTS: ::c_int = 100;
+pub const _SC_PII_OSI_M: ::c_int = 101;
+pub const _SC_PII_SOCKET: ::c_int = 102;
+pub const _SC_PII_XTI: ::c_int = 103;
+pub const _SC_POLL: ::c_int = 104;
+pub const _SC_RE_DUP_MAX: ::c_int = 105;
+pub const _SC_SCHAR_MAX: ::c_int = 106;
+pub const _SC_SCHAR_MIN: ::c_int = 107;
+pub const _SC_SELECT: ::c_int = 108;
+pub const _SC_SHRT_MAX: ::c_int = 109;
+pub const _SC_SHRT_MIN: ::c_int = 110;
+pub const _SC_SSIZE_MAX: ::c_int = 111;
+pub const _SC_T_IOV_MAX: ::c_int = 112;
+pub const _SC_UCHAR_MAX: ::c_int = 113;
+pub const _SC_UINT_MAX: ::c_int = 114;
+pub const _SC_UIO_MAXIOV: ::c_int = 115;
+pub const _SC_ULONG_MAX: ::c_int = 116;
+pub const _SC_USHRT_MAX: ::c_int = 117;
+pub const _SC_WORD_BIT: ::c_int = 118;
+pub const _SC_XOPEN_CRYPT: ::c_int = 119;
+pub const _SC_XOPEN_ENH_I18N: ::c_int = 120;
+pub const _SC_XOPEN_SHM: ::c_int = 121;
+pub const _SC_XOPEN_UNIX: ::c_int = 122;
+pub const _SC_XOPEN_XCU_VERSION: ::c_int = 123;
+pub const _SC_XOPEN_XPG2: ::c_int = 124;
+pub const _SC_XOPEN_XPG3: ::c_int = 125;
+pub const _SC_XOPEN_XPG4: ::c_int = 126;
+pub const _SC_XBS5_ILP32_OFF32: ::c_int = 127;
+pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 128;
+pub const _SC_XBS5_LP64_OFF64: ::c_int = 129;
+pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 130;
+pub const _SC_ADVISORY_INFO: ::c_int = 131;
+pub const _SC_CPUTIME: ::c_int = 132;
+pub const _SC_SPAWN: ::c_int = 133;
+pub const _SC_SPORADIC_SERVER: ::c_int = 134;
+pub const _SC_THREAD_CPUTIME: ::c_int = 135;
+pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 136;
+pub const _SC_TIMEOUTS: ::c_int = 137;
+pub const _SC_BARRIERS: ::c_int = 138;
+pub const _SC_CLOCK_SELECTION: ::c_int = 139;
+pub const _SC_MONOTONIC_CLOCK: ::c_int = 140;
+pub const _SC_READER_WRITER_LOCKS: ::c_int = 141;
+pub const _SC_SPIN_LOCKS: ::c_int = 142;
+pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 143;
+pub const _SC_TRACE_EVENT_FILTER: ::c_int = 144;
+pub const _SC_TRACE: ::c_int = 145;
+pub const _SC_TRACE_INHERIT: ::c_int = 146;
+pub const _SC_TRACE_LOG: ::c_int = 147;
+pub const _SC_2_PBS: ::c_int = 148;
+pub const _SC_2_PBS_ACCOUNTING: ::c_int = 149;
+pub const _SC_2_PBS_CHECKPOINT: ::c_int = 150;
+pub const _SC_2_PBS_LOCATE: ::c_int = 151;
+pub const _SC_2_PBS_MESSAGE: ::c_int = 152;
+pub const _SC_2_PBS_TRACK: ::c_int = 153;
+pub const _SC_HOST_NAME_MAX: ::c_int = 154;
+pub const _SC_IOV_MAX: ::c_int = 155;
+pub const _SC_IPV6: ::c_int = 156;
+pub const _SC_RAW_SOCKETS: ::c_int = 157;
+pub const _SC_REGEXP: ::c_int = 158;
+pub const _SC_SHELL: ::c_int = 159;
+pub const _SC_SS_REPL_MAX: ::c_int = 160;
+pub const _SC_SYMLOOP_MAX: ::c_int = 161;
+pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 162;
+pub const _SC_TRACE_NAME_MAX: ::c_int = 163;
+pub const _SC_TRACE_SYS_MAX: ::c_int = 164;
+pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 165;
+pub const _SC_V6_ILP32_OFF32: ::c_int = 166;
+pub const _SC_V6_ILP32_OFFBIG: ::c_int = 167;
+pub const _SC_V6_LP64_OFF64: ::c_int = 168;
+pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 169;
+pub const _SC_XOPEN_REALTIME: ::c_int = 170;
+pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 171;
+pub const _SC_XOPEN_LEGACY: ::c_int = 172;
+pub const _SC_XOPEN_STREAMS: ::c_int = 173;
+pub const _SC_V7_ILP32_OFF32: ::c_int = 176;
+pub const _SC_V7_ILP32_OFFBIG: ::c_int = 177;
+pub const _SC_V7_LP64_OFF64: ::c_int = 178;
+pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 179;
+
+pub const GLOB_ERR: ::c_int = 0x0001;
+pub const GLOB_MARK: ::c_int = 0x0002;
+pub const GLOB_NOSORT: ::c_int = 0x0004;
+pub const GLOB_DOOFFS: ::c_int = 0x0008;
+pub const GLOB_NOCHECK: ::c_int = 0x0010;
+pub const GLOB_APPEND: ::c_int = 0x0020;
+pub const GLOB_NOESCAPE: ::c_int = 0x0040;
+
+pub const GLOB_NOSPACE: ::c_int = 1;
+pub const GLOB_ABORTED: ::c_int = 2;
+pub const GLOB_NOMATCH: ::c_int = 3;
+
+pub const S_IEXEC: mode_t = ::S_IXUSR;
+pub const S_IWRITE: mode_t = ::S_IWUSR;
+pub const S_IREAD: mode_t = ::S_IRUSR;
+
+pub const S_IFIFO: ::mode_t = 0x1000;
+pub const S_IFCHR: ::mode_t = 0x2000;
+pub const S_IFDIR: ::mode_t = 0x4000;
+pub const S_IFBLK: ::mode_t = 0x6000;
+pub const S_IFREG: ::mode_t = 0x8000;
+pub const S_IFLNK: ::mode_t = 0xA000;
+pub const S_IFSOCK: ::mode_t = 0xC000;
+pub const S_IFMT: ::mode_t = 0xF000;
+
+pub const S_IXOTH: ::mode_t = 0o000001;
+pub const S_IWOTH: ::mode_t = 0o000002;
+pub const S_IROTH: ::mode_t = 0o000004;
+pub const S_IRWXO: ::mode_t = 0o000007;
+pub const S_IXGRP: ::mode_t = 0o000010;
+pub const S_IWGRP: ::mode_t = 0o000020;
+pub const S_IRGRP: ::mode_t = 0o000040;
+pub const S_IRWXG: ::mode_t = 0o000070;
+pub const S_IXUSR: ::mode_t = 0o000100;
+pub const S_IWUSR: ::mode_t = 0o000200;
+pub const S_IRUSR: ::mode_t = 0o000400;
+pub const S_IRWXU: ::mode_t = 0o000700;
+
+pub const F_LOCK: ::c_int = 1;
+pub const F_TEST: ::c_int = 3;
+pub const F_TLOCK: ::c_int = 2;
+pub const F_ULOCK: ::c_int = 0;
+
+pub const ST_RDONLY: ::c_ulong = 0x01;
+pub const ST_NOSUID: ::c_ulong = 0x04;
+pub const ST_NOEXEC: ::c_ulong = 0x02;
+pub const ST_NOATIME: ::c_ulong = 0x20;
+
+pub const RTLD_NEXT: *mut ::c_void = -3i64 as *mut ::c_void;
+pub const RTLD_DEFAULT: *mut ::c_void = -2i64 as *mut ::c_void;
+pub const RTLD_NODELETE: ::c_int = 0x1000;
+pub const RTLD_NOW: ::c_int = 0x0002;
+
+pub const EMPTY: ::c_short = 0;
+pub const RUN_LVL: ::c_short = 1;
+pub const BOOT_TIME: ::c_short = 2;
+pub const NEW_TIME: ::c_short = 4;
+pub const OLD_TIME: ::c_short = 3;
+pub const INIT_PROCESS: ::c_short = 5;
+pub const LOGIN_PROCESS: ::c_short = 6;
+pub const USER_PROCESS: ::c_short = 7;
+pub const DEAD_PROCESS: ::c_short = 8;
+pub const ACCOUNTING: ::c_short = 9;
+
+pub const ENOTSUP: ::c_int = 48;
+
+pub const BUFSIZ: ::c_uint = 1024;
+pub const TMP_MAX: ::c_uint = 26 * 26 * 26;
+pub const FOPEN_MAX: ::c_uint = 16;
+pub const FILENAME_MAX: ::c_uint = 255;
+
+pub const NI_MAXHOST: ::socklen_t = 1025;
+pub const M_KEEP: ::c_int = 4;
+pub const REG_STARTEND: ::c_int = 0o00004;
+pub const VEOF: usize = 4;
+
+pub const RTLD_GLOBAL: ::c_int = 0x0100;
+pub const RTLD_NOLOAD: ::c_int = 0x0004;
+
+pub const O_RDONLY: ::c_int = 0o000000;
+pub const O_WRONLY: ::c_int = 0o000001;
+pub const O_RDWR: ::c_int = 0o000002;
+
+pub const O_EXEC: ::c_int = 0o00003;
+pub const O_ASYNC: ::c_int = 0o0200000;
+pub const O_NDELAY: ::c_int = O_NONBLOCK;
+pub const O_TRUNC: ::c_int = 0o001000;
+pub const O_CLOEXEC: ::c_int = 0o020000;
+pub const O_DIRECTORY: ::c_int = 0o4000000;
+pub const O_ACCMODE: ::c_int = 0o000007;
+pub const O_APPEND: ::c_int = 0o000010;
+pub const O_CREAT: ::c_int = 0o000400;
+pub const O_EXCL: ::c_int = 0o002000;
+pub const O_NOCTTY: ::c_int = 0o004000;
+pub const O_NONBLOCK: ::c_int = 0o000200;
+pub const O_SYNC: ::c_int = 0o000040;
+pub const O_RSYNC: ::c_int = 0o000100;
+pub const O_DSYNC: ::c_int = 0o000020;
+pub const O_NOFOLLOW: ::c_int = 0o010000;
+
+pub const POSIX_FADV_DONTNEED: ::c_int = 4;
+pub const POSIX_FADV_NOREUSE: ::c_int = 5;
+
+pub const SOCK_SEQPACKET: ::c_int = 5;
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+pub const SOCK_RAW: ::c_int = 3;
+pub const SOCK_RDM: ::c_int = 4;
+pub const SOCK_CLOEXEC: ::c_int = 0x10000000;
+
+pub const SA_SIGINFO: ::c_int = 0x0002;
+pub const SA_NOCLDWAIT: ::c_int = 0x0020;
+pub const SA_NODEFER: ::c_int = 0x0010;
+pub const SA_RESETHAND: ::c_int = 0x0004;
+pub const SA_NOCLDSTOP: ::c_int = 0x0001;
+
+pub const SIGTTIN: ::c_int = 26;
+pub const SIGTTOU: ::c_int = 27;
+pub const SIGXCPU: ::c_int = 30;
+pub const SIGXFSZ: ::c_int = 31;
+pub const SIGVTALRM: ::c_int = 28;
+pub const SIGPROF: ::c_int = 29;
+pub const SIGWINCH: ::c_int = 20;
+pub const SIGCHLD: ::c_int = 18;
+pub const SIGBUS: ::c_int = 10;
+pub const SIGUSR1: ::c_int = 16;
+pub const SIGUSR2: ::c_int = 17;
+pub const SIGCONT: ::c_int = 25;
+pub const SIGSTOP: ::c_int = 23;
+pub const SIGTSTP: ::c_int = 24;
+pub const SIGURG: ::c_int = 21;
+pub const SIGIO: ::c_int = SIGPOLL;
+pub const SIGSYS: ::c_int = 12;
+pub const SIGPOLL: ::c_int = 22;
+pub const SIGPWR: ::c_int = 19;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIG_BLOCK: ::c_int = 0;
+pub const SIG_UNBLOCK: ::c_int = 1;
+
+pub const POLLWRNORM: ::c_short = ::POLLOUT;
+pub const POLLWRBAND: ::c_short = 0x0010;
+
+pub const F_SETLK: ::c_int = 106;
+pub const F_SETLKW: ::c_int = 107;
+pub const F_ALLOCSP: ::c_int = 110;
+pub const F_FREESP: ::c_int = 111;
+pub const F_GETLK: ::c_int = 114;
+
+pub const F_RDLCK: ::c_int = 1;
+pub const F_WRLCK: ::c_int = 2;
+pub const F_UNLCK: ::c_int = 3;
+
+pub const NCCS: usize = 40;
+
+pub const MAP_ANON: ::c_int = MAP_ANONYMOUS;
+pub const MAP_ANONYMOUS: ::c_int = 0x00080000;
+
+pub const MCL_CURRENT: ::c_int = 0x000000001;
+pub const MCL_FUTURE: ::c_int = 0x000000002;
+
+pub const _TIO_CBAUD: ::tcflag_t = 15;
+pub const CBAUD: ::tcflag_t = _TIO_CBAUD;
+pub const TAB1: ::tcflag_t = 0x0800;
+pub const TAB2: ::tcflag_t = 0x1000;
+pub const TAB3: ::tcflag_t = 0x1800;
+pub const CR1: ::tcflag_t = 0x200;
+pub const CR2: ::tcflag_t = 0x400;
+pub const CR3: ::tcflag_t = 0x600;
+pub const FF1: ::tcflag_t = 0x8000;
+pub const BS1: ::tcflag_t = 0x2000;
+pub const VT1: ::tcflag_t = 0x4000;
+pub const VWERASE: usize = 14;
+pub const VREPRINT: usize = 12;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VDISCARD: usize = 13;
+pub const VTIME: usize = 17;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x00000004;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x10;
+pub const CS7: ::tcflag_t = 0x20;
+pub const CS8: ::tcflag_t = 0x30;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const OLCUC: ::tcflag_t = 0x00000002;
+pub const NLDLY: ::tcflag_t = 0x00000100;
+pub const CRDLY: ::tcflag_t = 0x00000600;
+pub const TABDLY: ::tcflag_t = 0x00001800;
+pub const BSDLY: ::tcflag_t = 0x00002000;
+pub const FFDLY: ::tcflag_t = 0x00008000;
+pub const VTDLY: ::tcflag_t = 0x00004000;
+pub const XTABS: ::tcflag_t = 0x1800;
+
+pub const B0: ::speed_t = 0;
+pub const B50: ::speed_t = 1;
+pub const B75: ::speed_t = 2;
+pub const B110: ::speed_t = 3;
+pub const B134: ::speed_t = 4;
+pub const B150: ::speed_t = 5;
+pub const B200: ::speed_t = 6;
+pub const B300: ::speed_t = 7;
+pub const B600: ::speed_t = 8;
+pub const B1200: ::speed_t = 9;
+pub const B1800: ::speed_t = 10;
+pub const B2400: ::speed_t = 11;
+pub const B4800: ::speed_t = 12;
+pub const B9600: ::speed_t = 13;
+pub const B19200: ::speed_t = 14;
+pub const B38400: ::speed_t = 15;
+pub const EXTA: ::speed_t = 14;
+pub const EXTB: ::speed_t = 15;
+pub const B57600: ::speed_t = 57600;
+pub const B115200: ::speed_t = 115200;
+
+pub const VEOL: usize = 5;
+pub const VEOL2: usize = 6;
+pub const VMIN: usize = 16;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+
+pub const TCSANOW: ::c_int = 0x0001;
+pub const TCSADRAIN: ::c_int = 0x0002;
+pub const TCSAFLUSH: ::c_int = 0x0004;
+
+pub const HW_MACHINE: ::c_int = 1;
+pub const HW_MODEL: ::c_int = 2;
+pub const HW_NCPU: ::c_int = 3;
+pub const HW_BYTEORDER: ::c_int = 4;
+pub const HW_PHYSMEM: ::c_int = 5;
+pub const HW_USERMEM: ::c_int = 6;
+pub const HW_PAGESIZE: ::c_int = 7;
+pub const HW_DISKNAMES: ::c_int = 8;
+pub const HW_IOSTATS: ::c_int = 9;
+pub const HW_MACHINE_ARCH: ::c_int = 10;
+pub const HW_ALIGNBYTES: ::c_int = 11;
+pub const HW_CNMAGIC: ::c_int = 12;
+pub const HW_PHYSMEM64: ::c_int = 13;
+pub const HW_USERMEM64: ::c_int = 14;
+pub const HW_IOSTATNAMES: ::c_int = 15;
+pub const HW_MAXID: ::c_int = 15;
+
+pub const CTL_UNSPEC: ::c_int = 0;
+pub const CTL_KERN: ::c_int = 1;
+pub const CTL_VM: ::c_int = 2;
+pub const CTL_VFS: ::c_int = 3;
+pub const CTL_NET: ::c_int = 4;
+pub const CTL_DEBUG: ::c_int = 5;
+pub const CTL_HW: ::c_int = 6;
+pub const CTL_MACHDEP: ::c_int = 7;
+pub const CTL_USER: ::c_int = 8;
+pub const CTL_QNX: ::c_int = 9;
+pub const CTL_PROC: ::c_int = 10;
+pub const CTL_VENDOR: ::c_int = 11;
+pub const CTL_EMUL: ::c_int = 12;
+pub const CTL_SECURITY: ::c_int = 13;
+pub const CTL_MAXID: ::c_int = 14;
+
+pub const DAY_1: ::nl_item = 8;
+pub const DAY_2: ::nl_item = 9;
+pub const DAY_3: ::nl_item = 10;
+pub const DAY_4: ::nl_item = 11;
+pub const DAY_5: ::nl_item = 12;
+pub const DAY_6: ::nl_item = 13;
+pub const DAY_7: ::nl_item = 14;
+
+pub const MON_1: ::nl_item = 22;
+pub const MON_2: ::nl_item = 23;
+pub const MON_3: ::nl_item = 24;
+pub const MON_4: ::nl_item = 25;
+pub const MON_5: ::nl_item = 26;
+pub const MON_6: ::nl_item = 27;
+pub const MON_7: ::nl_item = 28;
+pub const MON_8: ::nl_item = 29;
+pub const MON_9: ::nl_item = 30;
+pub const MON_10: ::nl_item = 31;
+pub const MON_11: ::nl_item = 32;
+pub const MON_12: ::nl_item = 33;
+
+pub const ABDAY_1: ::nl_item = 15;
+pub const ABDAY_2: ::nl_item = 16;
+pub const ABDAY_3: ::nl_item = 17;
+pub const ABDAY_4: ::nl_item = 18;
+pub const ABDAY_5: ::nl_item = 19;
+pub const ABDAY_6: ::nl_item = 20;
+pub const ABDAY_7: ::nl_item = 21;
+
+pub const ABMON_1: ::nl_item = 34;
+pub const ABMON_2: ::nl_item = 35;
+pub const ABMON_3: ::nl_item = 36;
+pub const ABMON_4: ::nl_item = 37;
+pub const ABMON_5: ::nl_item = 38;
+pub const ABMON_6: ::nl_item = 39;
+pub const ABMON_7: ::nl_item = 40;
+pub const ABMON_8: ::nl_item = 41;
+pub const ABMON_9: ::nl_item = 42;
+pub const ABMON_10: ::nl_item = 43;
+pub const ABMON_11: ::nl_item = 44;
+pub const ABMON_12: ::nl_item = 45;
+
+pub const AF_ARP: ::c_int = 28;
+pub const AF_CCITT: ::c_int = 10;
+pub const AF_CHAOS: ::c_int = 5;
+pub const AF_CNT: ::c_int = 21;
+pub const AF_COIP: ::c_int = 20;
+pub const AF_DATAKIT: ::c_int = 9;
+pub const AF_DECnet: ::c_int = 12;
+pub const AF_DLI: ::c_int = 13;
+pub const AF_E164: ::c_int = 26;
+pub const AF_ECMA: ::c_int = 8;
+pub const AF_HYLINK: ::c_int = 15;
+pub const AF_IEEE80211: ::c_int = 32;
+pub const AF_IMPLINK: ::c_int = 3;
+pub const AF_ISO: ::c_int = 7;
+pub const AF_LAT: ::c_int = 14;
+pub const AF_LINK: ::c_int = 18;
+pub const AF_NATM: ::c_int = 27;
+pub const AF_NS: ::c_int = 6;
+pub const AF_OSI: ::c_int = 7;
+pub const AF_PUP: ::c_int = 4;
+pub const ALT_DIGITS: ::nl_item = 50;
+pub const AM_STR: ::nl_item = 6;
+pub const B76800: ::speed_t = 76800;
+
+pub const BIOCFLUSH: ::c_int = 17000;
+pub const BIOCGBLEN: ::c_int = 1074020966;
+pub const BIOCGDLT: ::c_int = 1074020970;
+pub const BIOCGDLTLIST: ::c_int = -1072676233;
+pub const BIOCGETIF: ::c_int = 1083196011;
+pub const BIOCGHDRCMPLT: ::c_int = 1074020980;
+pub const BIOCGRTIMEOUT: ::c_int = 1074807406;
+pub const BIOCGSEESENT: ::c_int = 1074020984;
+pub const BIOCGSTATS: ::c_int = 1082147439;
+pub const BIOCIMMEDIATE: ::c_int = -2147204496;
+pub const BIOCPROMISC: ::c_int = 17001;
+pub const BIOCSBLEN: ::c_int = -1073462682;
+pub const BIOCSDLT: ::c_int = -2147204490;
+pub const BIOCSETF: ::c_int = -2146418073;
+pub const BIOCSETIF: ::c_int = -2138029460;
+pub const BIOCSHDRCMPLT: ::c_int = -2147204491;
+pub const BIOCSRTIMEOUT: ::c_int = -2146418067;
+pub const BIOCSSEESENT: ::c_int = -2147204487;
+pub const BIOCVERSION: ::c_int = 1074020977;
+
+pub const BPF_ALIGNMENT: usize = ::mem::size_of::<::c_long>();
+pub const CHAR_BIT: usize = 8;
+pub const CODESET: ::nl_item = 1;
+pub const CRNCYSTR: ::nl_item = 55;
+
+pub const D_FLAG_FILTER: ::c_int = 0x00000001;
+pub const D_FLAG_STAT: ::c_int = 0x00000002;
+pub const D_FLAG_STAT_FORM_MASK: ::c_int = 0x000000f0;
+pub const D_FLAG_STAT_FORM_T32_2001: ::c_int = 0x00000010;
+pub const D_FLAG_STAT_FORM_T32_2008: ::c_int = 0x00000020;
+pub const D_FLAG_STAT_FORM_T64_2008: ::c_int = 0x00000030;
+pub const D_FLAG_STAT_FORM_UNSET: ::c_int = 0x00000000;
+
+pub const D_FMT: ::nl_item = 3;
+pub const D_GETFLAG: ::c_int = 1;
+pub const D_SETFLAG: ::c_int = 2;
+pub const D_T_FMT: ::nl_item = 2;
+pub const ERA: ::nl_item = 46;
+pub const ERA_D_FMT: ::nl_item = 47;
+pub const ERA_D_T_FMT: ::nl_item = 48;
+pub const ERA_T_FMT: ::nl_item = 49;
+pub const RADIXCHAR: ::nl_item = 51;
+pub const THOUSEP: ::nl_item = 52;
+pub const YESEXPR: ::nl_item = 53;
+pub const NOEXPR: ::nl_item = 54;
+pub const F_GETOWN: ::c_int = 35;
+
+pub const FIONBIO: ::c_int = -2147195266;
+pub const FIOASYNC: ::c_int = -2147195267;
+pub const FIOCLEX: ::c_int = 26113;
+pub const FIOGETOWN: ::c_int = 1074030203;
+pub const FIONCLEX: ::c_int = 26114;
+pub const FIONREAD: ::c_int = 1074030207;
+pub const FIONSPACE: ::c_int = 1074030200;
+pub const FIONWRITE: ::c_int = 1074030201;
+pub const FIOSETOWN: ::c_int = -2147195268;
+
+pub const F_SETOWN: ::c_int = 36;
+pub const IFF_ACCEPTRTADV: ::c_int = 0x40000000;
+pub const IFF_IP6FORWARDING: ::c_int = 0x20000000;
+pub const IFF_LINK0: ::c_int = 0x00001000;
+pub const IFF_LINK1: ::c_int = 0x00002000;
+pub const IFF_LINK2: ::c_int = 0x00004000;
+pub const IFF_OACTIVE: ::c_int = 0x00000400;
+pub const IFF_SHIM: ::c_int = 0x80000000;
+pub const IFF_SIMPLEX: ::c_int = 0x00000800;
+pub const IHFLOW: tcflag_t = 0x00000001;
+pub const IIDLE: tcflag_t = 0x00000008;
+pub const IP_RECVDSTADDR: ::c_int = 7;
+pub const IP_RECVIF: ::c_int = 20;
+pub const IPTOS_ECN_NOTECT: u8 = 0x00;
+pub const IUCLC: tcflag_t = 0x00000200;
+pub const IUTF8: tcflag_t = 0x0004000;
+
+pub const KERN_ARGMAX: ::c_int = 8;
+pub const KERN_ARND: ::c_int = 81;
+pub const KERN_BOOTTIME: ::c_int = 21;
+pub const KERN_CLOCKRATE: ::c_int = 12;
+pub const KERN_FILE: ::c_int = 15;
+pub const KERN_HOSTID: ::c_int = 11;
+pub const KERN_HOSTNAME: ::c_int = 10;
+pub const KERN_IOV_MAX: ::c_int = 38;
+pub const KERN_JOB_CONTROL: ::c_int = 19;
+pub const KERN_LOGSIGEXIT: ::c_int = 46;
+pub const KERN_MAXFILES: ::c_int = 7;
+pub const KERN_MAXID: ::c_int = 83;
+pub const KERN_MAXPROC: ::c_int = 6;
+pub const KERN_MAXVNODES: ::c_int = 5;
+pub const KERN_NGROUPS: ::c_int = 18;
+pub const KERN_OSRELEASE: ::c_int = 2;
+pub const KERN_OSREV: ::c_int = 3;
+pub const KERN_OSTYPE: ::c_int = 1;
+pub const KERN_POSIX1: ::c_int = 17;
+pub const KERN_PROC: ::c_int = 14;
+pub const KERN_PROC_ALL: ::c_int = 0;
+pub const KERN_PROC_ARGS: ::c_int = 48;
+pub const KERN_PROC_ENV: ::c_int = 3;
+pub const KERN_PROC_GID: ::c_int = 7;
+pub const KERN_PROC_PGRP: ::c_int = 2;
+pub const KERN_PROC_PID: ::c_int = 1;
+pub const KERN_PROC_RGID: ::c_int = 8;
+pub const KERN_PROC_RUID: ::c_int = 6;
+pub const KERN_PROC_SESSION: ::c_int = 3;
+pub const KERN_PROC_TTY: ::c_int = 4;
+pub const KERN_PROC_UID: ::c_int = 5;
+pub const KERN_PROF: ::c_int = 16;
+pub const KERN_SAVED_IDS: ::c_int = 20;
+pub const KERN_SECURELVL: ::c_int = 9;
+pub const KERN_VERSION: ::c_int = 4;
+pub const KERN_VNODE: ::c_int = 13;
+
+pub const LC_ALL: ::c_int = 63;
+pub const LC_COLLATE: ::c_int = 1;
+pub const LC_CTYPE: ::c_int = 2;
+pub const LC_MESSAGES: ::c_int = 32;
+pub const LC_MONETARY: ::c_int = 4;
+pub const LC_NUMERIC: ::c_int = 8;
+pub const LC_TIME: ::c_int = 16;
+
+pub const LOCAL_CONNWAIT: ::c_int = 0x0002;
+pub const LOCAL_CREDS: ::c_int = 0x0001;
+pub const LOCAL_PEEREID: ::c_int = 0x0003;
+
+pub const MAP_STACK: ::c_int = 0x00001000;
+pub const MNT_NOEXEC: ::c_int = 0x02;
+pub const MNT_NOSUID: ::c_int = 0x04;
+pub const MNT_RDONLY: ::c_int = 0x01;
+
+pub const MSG_NOTIFICATION: ::c_int = 0x0400;
+
+pub const NET_RT_DUMP: ::c_int = 1;
+pub const NET_RT_FLAGS: ::c_int = 2;
+pub const NET_RT_IFLIST: ::c_int = 4;
+pub const NI_NUMERICSCOPE: ::c_int = 0x00000040;
+pub const OHFLOW: tcflag_t = 0x00000002;
+pub const P_ALL: idtype_t = 0;
+pub const PARSTK: tcflag_t = 0x00000004;
+pub const PF_ARP: ::c_int = 28;
+pub const PF_CCITT: ::c_int = 10;
+pub const PF_CHAOS: ::c_int = 5;
+pub const PF_CNT: ::c_int = 21;
+pub const PF_COIP: ::c_int = 20;
+pub const PF_DATAKIT: ::c_int = 9;
+pub const PF_DECnet: ::c_int = 12;
+pub const PF_DLI: ::c_int = 13;
+pub const PF_ECMA: ::c_int = 8;
+pub const PF_HYLINK: ::c_int = 15;
+pub const PF_IMPLINK: ::c_int = 3;
+pub const PF_ISO: ::c_int = 7;
+pub const PF_LAT: ::c_int = 14;
+pub const PF_LINK: ::c_int = 18;
+pub const PF_NATM: ::c_int = 27;
+pub const PF_OSI: ::c_int = 7;
+pub const PF_PIP: ::c_int = 25;
+pub const PF_PUP: ::c_int = 4;
+pub const PF_RTIP: ::c_int = 22;
+pub const PF_XTP: ::c_int = 19;
+pub const PM_STR: ::nl_item = 7;
+pub const POSIX_MADV_DONTNEED: ::c_int = 4;
+pub const POSIX_MADV_NORMAL: ::c_int = 0;
+pub const POSIX_MADV_RANDOM: ::c_int = 2;
+pub const POSIX_MADV_SEQUENTIAL: ::c_int = 1;
+pub const POSIX_MADV_WILLNEED: ::c_int = 3;
+pub const _POSIX_VDISABLE: ::c_int = 0;
+pub const P_PGID: idtype_t = 2;
+pub const P_PID: idtype_t = 1;
+pub const PRIO_PGRP: ::c_int = 1;
+pub const PRIO_PROCESS: ::c_int = 0;
+pub const PRIO_USER: ::c_int = 2;
+pub const pseudo_AF_HDRCMPLT: ::c_int = 30;
+pub const pseudo_AF_PIP: ::c_int = 25;
+pub const pseudo_AF_RTIP: ::c_int = 22;
+pub const pseudo_AF_XTP: ::c_int = 19;
+pub const REG_ASSERT: ::c_int = 15;
+pub const REG_ATOI: ::c_int = 255;
+pub const REG_BACKR: ::c_int = 0x400;
+pub const REG_BASIC: ::c_int = 0x00;
+pub const REG_DUMP: ::c_int = 0x80;
+pub const REG_EMPTY: ::c_int = 14;
+pub const REG_INVARG: ::c_int = 16;
+pub const REG_ITOA: ::c_int = 0o400;
+pub const REG_LARGE: ::c_int = 0x200;
+pub const REG_NOSPEC: ::c_int = 0x10;
+pub const REG_OK: ::c_int = 0;
+pub const REG_PEND: ::c_int = 0x20;
+pub const REG_TRACE: ::c_int = 0x100;
+
+pub const RLIMIT_AS: ::c_int = 6;
+pub const RLIMIT_CORE: ::c_int = 4;
+pub const RLIMIT_CPU: ::c_int = 0;
+pub const RLIMIT_DATA: ::c_int = 2;
+pub const RLIMIT_FSIZE: ::c_int = 1;
+pub const RLIMIT_MEMLOCK: ::c_int = 7;
+pub const RLIMIT_NOFILE: ::c_int = 5;
+pub const RLIMIT_NPROC: ::c_int = 8;
+pub const RLIMIT_RSS: ::c_int = 6;
+pub const RLIMIT_STACK: ::c_int = 3;
+pub const RLIMIT_VMEM: ::c_int = 6;
+#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+pub const RLIM_NLIMITS: ::c_int = 14;
+
+pub const SCHED_ADJTOHEAD: ::c_int = 5;
+pub const SCHED_ADJTOTAIL: ::c_int = 6;
+pub const SCHED_MAXPOLICY: ::c_int = 7;
+pub const SCHED_SETPRIO: ::c_int = 7;
+pub const SCHED_SPORADIC: ::c_int = 4;
+
+pub const SHM_ANON: *mut ::c_char = -1isize as *mut ::c_char;
+pub const SIGCLD: ::c_int = SIGCHLD;
+pub const SIGDEADLK: ::c_int = 7;
+pub const SIGEMT: ::c_int = 7;
+pub const SIGEV_NONE: ::c_int = 0;
+pub const SIGEV_SIGNAL: ::c_int = 129;
+pub const SIGEV_THREAD: ::c_int = 135;
+pub const SIOCGIFADDR: ::c_int = -1064277727;
+pub const SO_FIB: ::c_int = 0x100a;
+pub const SO_OVERFLOWED: ::c_int = 0x1009;
+pub const SO_SETFIB: ::c_int = 0x100a;
+pub const SO_TXPRIO: ::c_int = 0x100b;
+pub const SO_USELOOPBACK: ::c_int = 0x0040;
+pub const SO_VLANPRIO: ::c_int = 0x100c;
+pub const _SS_ALIGNSIZE: usize = ::mem::size_of::<i64>();
+pub const _SS_MAXSIZE: usize = 128;
+pub const _SS_PAD1SIZE: usize = _SS_ALIGNSIZE - 2;
+pub const _SS_PAD2SIZE: usize = _SS_MAXSIZE - 2 - _SS_PAD1SIZE - _SS_ALIGNSIZE;
+pub const TC_CPOSIX: tcflag_t = CLOCAL | CREAD | CSIZE | CSTOPB | HUPCL | PARENB | PARODD;
+pub const TCGETS: ::c_int = 0x404c540d;
+pub const TC_IPOSIX: tcflag_t =
+    BRKINT | ICRNL | IGNBRK | IGNPAR | INLCR | INPCK | ISTRIP | IXOFF | IXON | PARMRK;
+pub const TC_LPOSIX: tcflag_t =
+    ECHO | ECHOE | ECHOK | ECHONL | ICANON | IEXTEN | ISIG | NOFLSH | TOSTOP;
+pub const TC_OPOSIX: tcflag_t = OPOST;
+pub const T_FMT_AMPM: ::nl_item = 5;
+
+pub const TIOCCBRK: ::c_int = 29818;
+pub const TIOCCDTR: ::c_int = 29816;
+pub const TIOCDRAIN: ::c_int = 29790;
+pub const TIOCEXCL: ::c_int = 29709;
+pub const TIOCFLUSH: ::c_int = -2147191792;
+pub const TIOCGETA: ::c_int = 1078752275;
+pub const TIOCGPGRP: ::c_int = 1074033783;
+pub const TIOCGWINSZ: ::c_int = 1074295912;
+pub const TIOCMBIC: ::c_int = -2147191701;
+pub const TIOCMBIS: ::c_int = -2147191700;
+pub const TIOCMGET: ::c_int = 1074033770;
+pub const TIOCMSET: ::c_int = -2147191699;
+pub const TIOCNOTTY: ::c_int = 29809;
+pub const TIOCNXCL: ::c_int = 29710;
+pub const TIOCOUTQ: ::c_int = 1074033779;
+pub const TIOCPKT: ::c_int = -2147191696;
+pub const TIOCPKT_DATA: ::c_int = 0x00;
+pub const TIOCPKT_DOSTOP: ::c_int = 0x20;
+pub const TIOCPKT_FLUSHREAD: ::c_int = 0x01;
+pub const TIOCPKT_FLUSHWRITE: ::c_int = 0x02;
+pub const TIOCPKT_IOCTL: ::c_int = 0x40;
+pub const TIOCPKT_NOSTOP: ::c_int = 0x10;
+pub const TIOCPKT_START: ::c_int = 0x08;
+pub const TIOCPKT_STOP: ::c_int = 0x04;
+pub const TIOCSBRK: ::c_int = 29819;
+pub const TIOCSCTTY: ::c_int = 29793;
+pub const TIOCSDTR: ::c_int = 29817;
+pub const TIOCSETA: ::c_int = -2142473196;
+pub const TIOCSETAF: ::c_int = -2142473194;
+pub const TIOCSETAW: ::c_int = -2142473195;
+pub const TIOCSPGRP: ::c_int = -2147191690;
+pub const TIOCSTART: ::c_int = 29806;
+pub const TIOCSTI: ::c_int = -2147388302;
+pub const TIOCSTOP: ::c_int = 29807;
+pub const TIOCSWINSZ: ::c_int = -2146929561;
+
+pub const USER_CS_PATH: ::c_int = 1;
+pub const USER_BC_BASE_MAX: ::c_int = 2;
+pub const USER_BC_DIM_MAX: ::c_int = 3;
+pub const USER_BC_SCALE_MAX: ::c_int = 4;
+pub const USER_BC_STRING_MAX: ::c_int = 5;
+pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6;
+pub const USER_EXPR_NEST_MAX: ::c_int = 7;
+pub const USER_LINE_MAX: ::c_int = 8;
+pub const USER_RE_DUP_MAX: ::c_int = 9;
+pub const USER_POSIX2_VERSION: ::c_int = 10;
+pub const USER_POSIX2_C_BIND: ::c_int = 11;
+pub const USER_POSIX2_C_DEV: ::c_int = 12;
+pub const USER_POSIX2_CHAR_TERM: ::c_int = 13;
+pub const USER_POSIX2_FORT_DEV: ::c_int = 14;
+pub const USER_POSIX2_FORT_RUN: ::c_int = 15;
+pub const USER_POSIX2_LOCALEDEF: ::c_int = 16;
+pub const USER_POSIX2_SW_DEV: ::c_int = 17;
+pub const USER_POSIX2_UPE: ::c_int = 18;
+pub const USER_STREAM_MAX: ::c_int = 19;
+pub const USER_TZNAME_MAX: ::c_int = 20;
+pub const USER_ATEXIT_MAX: ::c_int = 21;
+pub const USER_MAXID: ::c_int = 22;
+
+pub const VDOWN: usize = 31;
+pub const VINS: usize = 32;
+pub const VDEL: usize = 33;
+pub const VRUB: usize = 34;
+pub const VCAN: usize = 35;
+pub const VHOME: usize = 36;
+pub const VEND: usize = 37;
+pub const VSPARE3: usize = 38;
+pub const VSPARE4: usize = 39;
+pub const VSWTCH: usize = 7;
+pub const VDSUSP: usize = 11;
+pub const VFWD: usize = 18;
+pub const VLOGIN: usize = 19;
+pub const VPREFIX: usize = 20;
+pub const VSUFFIX: usize = 24;
+pub const VLEFT: usize = 28;
+pub const VRIGHT: usize = 29;
+pub const VUP: usize = 30;
+pub const XCASE: tcflag_t = 0x00000004;
+
+pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0x00;
+pub const PTHREAD_CREATE_DETACHED: ::c_int = 0x01;
+
+pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 3;
+pub const PTHREAD_STACK_MIN: ::size_t = 256;
+pub const PTHREAD_MUTEX_DEFAULT: ::c_int = 0;
+pub const PTHREAD_MUTEX_STALLED: ::c_int = 0x00;
+pub const PTHREAD_MUTEX_ROBUST: ::c_int = 0x10;
+pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0x00;
+pub const PTHREAD_PROCESS_SHARED: ::c_int = 0x01;
+
+pub const PTHREAD_KEYS_MAX: usize = 128;
+
+pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+    __u: 0x80000000,
+    __owner: 0xffffffff,
+};
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+    __u: CLOCK_REALTIME as u32,
+    __owner: 0xfffffffb,
+};
+pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+    __active: 0,
+    __blockedwriters: 0,
+    __blockedreaders: 0,
+    __heavy: 0,
+    __lock: PTHREAD_MUTEX_INITIALIZER,
+    __rcond: PTHREAD_COND_INITIALIZER,
+    __wcond: PTHREAD_COND_INITIALIZER,
+    __owner: -2i32 as ::c_uint,
+    __spare: 0,
+};
+
+const_fn! {
+    {const} fn _CMSG_ALIGN(len: usize) -> usize {
+        len + ::mem::size_of::<usize>() - 1 & !(::mem::size_of::<usize>() - 1)
+    }
+
+    {const} fn _ALIGN(p: usize, b: usize) -> usize {
+        (p + b - 1) & !(b-1)
+    }
+}
+
+f! {
+    pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
+        if (*mhdr).msg_controllen as usize >= ::mem::size_of::<cmsghdr>() {
+            (*mhdr).msg_control as *mut cmsghdr
+        } else {
+            0 as *mut cmsghdr
+        }
+    }
+
+    pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
+        -> *mut ::cmsghdr
+    {
+        let msg = _CMSG_ALIGN((*cmsg).cmsg_len as usize);
+        let next = cmsg as usize + msg + _CMSG_ALIGN(::mem::size_of::<::cmsghdr>());
+        if next > (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize {
+           0 as *mut ::cmsghdr
+        } else {
+            (cmsg as usize + msg) as *mut ::cmsghdr
+        }
+    }
+
+    pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
+        (cmsg as *mut ::c_uchar)
+            .offset(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        _CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
+    }
+
+    pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
+        (_CMSG_ALIGN(::mem::size_of::<cmsghdr>()) + _CMSG_ALIGN(length as usize) )
+            as ::c_uint
+    }
+
+    pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
+        let fd = fd as usize;
+        let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        (*set).fds_bits[fd / size] &= !(1 << (fd % size));
+        return
+    }
+
+    pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
+        let fd = fd as usize;
+        let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0
+    }
+
+    pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
+        let fd = fd as usize;
+        let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        (*set).fds_bits[fd / size] |= 1 << (fd % size);
+        return
+    }
+
+    pub fn FD_ZERO(set: *mut fd_set) -> () {
+        for slot in (*set).fds_bits.iter_mut() {
+            *slot = 0;
+        }
+    }
+
+    pub fn _DEXTRA_FIRST(_d: *const dirent) -> *mut ::dirent_extra {
+        let _f = &((*(_d)).d_name) as *const _;
+        let _s = _d as usize;
+
+        _ALIGN(_s + _f as usize - _s + (*_d).d_namelen as usize + 1, 8) as *mut ::dirent_extra
+    }
+
+    pub fn _DEXTRA_VALID(_x: *const ::dirent_extra, _d: *const dirent) -> bool {
+        let sz = _x as usize - _d as usize + ::mem::size_of::<::dirent_extra>();
+        let rsz = (*_d).d_reclen as usize;
+
+        if sz > rsz || sz + (*_x).d_datalen as usize > rsz {
+            false
+        } else {
+            true
+        }
+    }
+
+    pub fn _DEXTRA_NEXT(_x: *const ::dirent_extra) -> *mut ::dirent_extra {
+        _ALIGN(
+            _x as usize + ::mem::size_of::<::dirent_extra>() + (*_x).d_datalen as usize, 8
+        ) as *mut ::dirent_extra
+    }
+
+    pub fn SOCKCREDSIZE(ngrps: usize) -> usize {
+        let ngrps = if ngrps > 0 {
+            ngrps - 1
+        } else {
+            0
+        };
+        ::mem::size_of::<sockcred>() + ::mem::size_of::<::gid_t>() * ngrps
+    }
+
+    pub fn major(dev: ::dev_t) -> ::c_uint {
+        ((dev as ::c_uint) >> 10) & 0x3f
+    }
+
+    pub fn minor(dev: ::dev_t) -> ::c_uint {
+        (dev as ::c_uint) & 0x3ff
+    }
+}
+
+safe_f! {
+    pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
+        (status & 0xff) == 0x7f
+    }
+
+    pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
+        (status >> 8) & 0xff
+    }
+
+    pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
+        status == 0xffff
+    }
+
+    pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
+        ((status & 0x7f) + 1) as i8 >= 2
+    }
+
+    pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int {
+        status & 0x7f
+    }
+
+    pub {const} fn WIFEXITED(status: ::c_int) -> bool {
+        (status & 0x7f) == 0
+    }
+
+    pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int {
+        (status >> 8) & 0xff
+    }
+
+    pub {const} fn WCOREDUMP(status: ::c_int) -> bool {
+        (status & 0x80) != 0
+    }
+
+    pub {const} fn IPTOS_ECN(x: u8) -> u8 {
+        x & ::IPTOS_ECN_MASK
+    }
+
+    pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+        ((major << 10) | (minor)) as ::dev_t
+    }
+}
+
+// Network related functions are provided by libsocket and regex
+// functions are provided by libregex.
+#[link(name = "socket")]
+#[link(name = "regex")]
+
+extern "C" {
+    pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
+    pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
+    pub fn fdatasync(fd: ::c_int) -> ::c_int;
+    pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
+    pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
+    pub fn mknodat(
+        __fd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::mode_t,
+        dev: ::dev_t,
+    ) -> ::c_int;
+
+    pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+    pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int;
+
+    pub fn pthread_attr_getstack(
+        attr: *const ::pthread_attr_t,
+        stackaddr: *mut *mut ::c_void,
+        stacksize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
+    pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int;
+
+    pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
+    pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+
+    pub fn utimensat(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::timespec,
+        flag: ::c_int,
+    ) -> ::c_int;
+
+    pub fn pthread_condattr_getclock(
+        attr: *const pthread_condattr_t,
+        clock_id: *mut clockid_t,
+    ) -> ::c_int;
+    pub fn pthread_condattr_setclock(
+        attr: *mut pthread_condattr_t,
+        clock_id: ::clockid_t,
+    ) -> ::c_int;
+    pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int;
+    pub fn pthread_mutexattr_setpshared(
+        attr: *mut pthread_mutexattr_t,
+        pshared: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_rwlockattr_getpshared(
+        attr: *const pthread_rwlockattr_t,
+        val: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int;
+    pub fn ptsname_r(fd: ::c_int, buf: *mut ::c_char, buflen: ::size_t) -> *mut ::c_char;
+    pub fn clearenv() -> ::c_int;
+    pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
+        -> ::c_int;
+    pub fn wait4(
+        pid: ::pid_t,
+        status: *mut ::c_int,
+        options: ::c_int,
+        rusage: *mut ::rusage,
+    ) -> ::pid_t;
+    pub fn execvpe(
+        file: *const ::c_char,
+        argv: *const *const ::c_char,
+        envp: *const *const ::c_char,
+    ) -> ::c_int;
+
+    pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
+    pub fn freeifaddrs(ifa: *mut ::ifaddrs);
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
+
+    pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+
+    pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+    pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
+    pub fn openpty(
+        amaster: *mut ::c_int,
+        aslave: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *mut termios,
+        winp: *mut ::winsize,
+    ) -> ::c_int;
+    pub fn forkpty(
+        amaster: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *mut termios,
+        winp: *mut ::winsize,
+    ) -> ::pid_t;
+    pub fn login_tty(fd: ::c_int) -> ::c_int;
+
+    pub fn uname(buf: *mut ::utsname) -> ::c_int;
+
+    pub fn getpeereid(socket: ::c_int, euid: *mut ::uid_t, egid: *mut ::gid_t) -> ::c_int;
+
+    pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
+
+    pub fn abs(i: ::c_int) -> ::c_int;
+    pub fn labs(i: ::c_long) -> ::c_long;
+    pub fn rand() -> ::c_int;
+    pub fn srand(seed: ::c_uint);
+
+    pub fn setpwent();
+    pub fn endpwent();
+    pub fn getpwent() -> *mut passwd;
+    pub fn setgrent();
+    pub fn endgrent();
+    pub fn getgrent() -> *mut ::group;
+    pub fn setspent();
+    pub fn endspent();
+
+    pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int;
+
+    pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
+    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+
+    pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+    pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
+    pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn sigtimedwait(
+        set: *const sigset_t,
+        info: *mut siginfo_t,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
+    pub fn pthread_setschedprio(native: ::pthread_t, priority: ::c_int) -> ::c_int;
+
+    pub fn if_nameindex() -> *mut if_nameindex;
+    pub fn if_freenameindex(ptr: *mut if_nameindex);
+
+    pub fn glob(
+        pattern: *const c_char,
+        flags: ::c_int,
+        errfunc: ::Option<extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut ::glob_t,
+    ) -> ::c_int;
+    pub fn globfree(pglob: *mut ::glob_t);
+
+    pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+
+    pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
+
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+
+    pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
+
+    pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+
+    pub fn recvfrom(
+        socket: ::c_int,
+        buf: *mut ::c_void,
+        len: ::size_t,
+        flags: ::c_int,
+        addr: *mut ::sockaddr,
+        addrlen: *mut ::socklen_t,
+    ) -> ::ssize_t;
+    pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
+
+    pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
+    pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int;
+    pub fn sync();
+    pub fn pthread_getschedparam(
+        native: ::pthread_t,
+        policy: *mut ::c_int,
+        param: *mut ::sched_param,
+    ) -> ::c_int;
+    pub fn umount(target: *const ::c_char, flags: ::c_int) -> ::c_int;
+    pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
+    pub fn settimeofday(tv: *const ::timeval, tz: *const ::c_void) -> ::c_int;
+    pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
+    pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
+    pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
+    pub fn mount(
+        special_device: *const ::c_char,
+        mount_directory: *const ::c_char,
+        flags: ::c_int,
+        mount_type: *const ::c_char,
+        mount_data: *const ::c_void,
+        mount_datalen: ::c_int,
+    ) -> ::c_int;
+    pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int;
+    pub fn pthread_mutex_consistent(mutex: *mut pthread_mutex_t) -> ::c_int;
+    pub fn pthread_mutex_timedlock(
+        lock: *mut pthread_mutex_t,
+        abstime: *const ::timespec,
+    ) -> ::c_int;
+    pub fn pthread_spin_init(lock: *mut ::pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
+    pub fn pthread_spin_destroy(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_lock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_trylock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_spin_unlock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+    pub fn pthread_barrierattr_init(__attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_destroy(__attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_getpshared(
+        __attr: *const ::pthread_barrierattr_t,
+        __pshared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrierattr_setpshared(
+        __attr: *mut ::pthread_barrierattr_t,
+        __pshared: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrier_init(
+        __barrier: *mut ::pthread_barrier_t,
+        __attr: *const ::pthread_barrierattr_t,
+        __count: ::c_uint,
+    ) -> ::c_int;
+    pub fn pthread_barrier_destroy(__barrier: *mut ::pthread_barrier_t) -> ::c_int;
+    pub fn pthread_barrier_wait(__barrier: *mut ::pthread_barrier_t) -> ::c_int;
+
+    pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
+    pub fn clock_nanosleep(
+        clk_id: ::clockid_t,
+        flags: ::c_int,
+        rqtp: *const ::timespec,
+        rmtp: *mut ::timespec,
+    ) -> ::c_int;
+    pub fn pthread_attr_getguardsize(
+        attr: *const ::pthread_attr_t,
+        guardsize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
+    pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
+    pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
+    pub fn pthread_condattr_getpshared(
+        attr: *const pthread_condattr_t,
+        pshared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_setschedparam(
+        native: ::pthread_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn sched_setscheduler(
+        pid: ::pid_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn sem_close(sem: *mut sem_t) -> ::c_int;
+    pub fn getdtablesize() -> ::c_int;
+    pub fn getgrnam_r(
+        name: *const ::c_char,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int;
+    pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
+    pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
+    pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
+    pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
+    pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
+    pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
+    pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
+    pub fn getpwnam_r(
+        name: *const ::c_char,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+    pub fn getpwuid_r(
+        uid: ::uid_t,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+    pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
+    pub fn pthread_atfork(
+        prepare: ::Option<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+    pub fn getgrouplist(
+        user: *const ::c_char,
+        group: ::gid_t,
+        groups: *mut ::gid_t,
+        ngroups: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_mutexattr_getpshared(
+        attr: *const pthread_mutexattr_t,
+        pshared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_mutexattr_getrobust(
+        attr: *const pthread_mutexattr_t,
+        robustness: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_mutexattr_setrobust(
+        attr: *mut pthread_mutexattr_t,
+        robustness: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_create(
+        native: *mut ::pthread_t,
+        attr: *const ::pthread_attr_t,
+        f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
+        value: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn getitimer(which: ::c_int, curr_value: *mut ::itimerval) -> ::c_int;
+    pub fn setitimer(
+        which: ::c_int,
+        value: *const ::itimerval,
+        ovalue: *mut ::itimerval,
+    ) -> ::c_int;
+    pub fn posix_spawn(
+        pid: *mut ::pid_t,
+        path: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawnp(
+        pid: *mut ::pid_t,
+        file: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
+    pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
+    pub fn posix_spawnattr_getsigdefault(
+        attr: *const posix_spawnattr_t,
+        default: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigdefault(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getsigmask(
+        attr: *const posix_spawnattr_t,
+        default: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigmask(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getflags(
+        attr: *const posix_spawnattr_t,
+        flags: *mut ::c_short,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int;
+    pub fn posix_spawnattr_getpgroup(
+        attr: *const posix_spawnattr_t,
+        flags: *mut ::pid_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
+    pub fn posix_spawnattr_getschedpolicy(
+        attr: *const posix_spawnattr_t,
+        flags: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int;
+    pub fn posix_spawnattr_getschedparam(
+        attr: *const posix_spawnattr_t,
+        param: *mut ::sched_param,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setschedparam(
+        attr: *mut posix_spawnattr_t,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+
+    pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+    pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+    pub fn posix_spawn_file_actions_addopen(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+        path: *const ::c_char,
+        oflag: ::c_int,
+        mode: ::mode_t,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_addclose(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_adddup2(
+        actions: *mut posix_spawn_file_actions_t,
+        fd: ::c_int,
+        newfd: ::c_int,
+    ) -> ::c_int;
+    pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
+    pub fn faccessat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::c_int,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn inotify_rm_watch(fd: ::c_int, wd: ::c_int) -> ::c_int;
+    pub fn inotify_init() -> ::c_int;
+    pub fn inotify_add_watch(fd: ::c_int, path: *const ::c_char, mask: u32) -> ::c_int;
+
+    pub fn gettid() -> ::pid_t;
+
+    pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int;
+
+    pub fn getnameinfo(
+        sa: *const ::sockaddr,
+        salen: ::socklen_t,
+        host: *mut ::c_char,
+        hostlen: ::socklen_t,
+        serv: *mut ::c_char,
+        servlen: ::socklen_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+
+    pub fn sendmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn recvmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_uint,
+        timeout: *mut ::timespec,
+    ) -> ::c_int;
+
+    pub fn mallopt(param: ::c_int, value: i64) -> ::c_int;
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
+
+    pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char;
+    pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
+
+    pub fn mallinfo() -> ::mallinfo;
+    pub fn getpwent_r(
+        pwd: *mut ::passwd,
+        buf: *mut ::c_char,
+        __bufsize: ::c_int,
+        __result: *mut *mut ::passwd,
+    ) -> ::c_int;
+    pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::c_int) -> ::c_int;
+    pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
+
+    pub fn sysctl(
+        _: *const ::c_int,
+        _: ::c_uint,
+        _: *mut ::c_void,
+        _: *mut ::size_t,
+        _: *const ::c_void,
+        _: ::size_t,
+    ) -> ::c_int;
+
+    pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
+    pub fn setrlimit(resource: ::c_int, rlp: *const ::rlimit) -> ::c_int;
+
+    pub fn lio_listio(
+        __mode: ::c_int,
+        __list: *const *mut aiocb,
+        __nent: ::c_int,
+        __sig: *mut sigevent,
+    ) -> ::c_int;
+
+    pub fn dl_iterate_phdr(
+        callback: ::Option<
+            unsafe extern "C" fn(
+                info: *const dl_phdr_info,
+                size: ::size_t,
+                data: *mut ::c_void,
+            ) -> ::c_int,
+        >,
+        data: *mut ::c_void,
+    ) -> ::c_int;
+
+    pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
+
+    pub fn regcomp(
+        __preg: *mut ::regex_t,
+        __pattern: *const ::c_char,
+        __cflags: ::c_int,
+    ) -> ::c_int;
+    pub fn regexec(
+        __preg: *const ::regex_t,
+        __str: *const ::c_char,
+        __nmatch: ::size_t,
+        __pmatch: *mut ::regmatch_t,
+        __eflags: ::c_int,
+    ) -> ::c_int;
+    pub fn regerror(
+        __errcode: ::c_int,
+        __preg: *const ::regex_t,
+        __errbuf: *mut ::c_char,
+        __errbuf_size: ::size_t,
+    ) -> ::size_t;
+    pub fn regfree(__preg: *mut ::regex_t);
+    pub fn dirfd(__dirp: *mut ::DIR) -> ::c_int;
+    pub fn dircntl(dir: *mut ::DIR, cmd: ::c_int, ...) -> ::c_int;
+
+    pub fn aio_cancel(__fd: ::c_int, __aiocbp: *mut ::aiocb) -> ::c_int;
+    pub fn aio_error(__aiocbp: *const ::aiocb) -> ::c_int;
+    pub fn aio_fsync(__operation: ::c_int, __aiocbp: *mut ::aiocb) -> ::c_int;
+    pub fn aio_read(__aiocbp: *mut ::aiocb) -> ::c_int;
+    pub fn aio_return(__aiocpb: *mut ::aiocb) -> ::ssize_t;
+    pub fn aio_suspend(
+        __list: *const *const ::aiocb,
+        __nent: ::c_int,
+        __timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn aio_write(__aiocpb: *mut ::aiocb) -> ::c_int;
+
+    pub fn mq_close(__mqdes: ::mqd_t) -> ::c_int;
+    pub fn mq_getattr(__mqdes: ::mqd_t, __mqstat: *mut ::mq_attr) -> ::c_int;
+    pub fn mq_notify(__mqdes: ::mqd_t, __notification: *const ::sigevent) -> ::c_int;
+    pub fn mq_open(__name: *const ::c_char, __oflag: ::c_int, ...) -> ::mqd_t;
+    pub fn mq_receive(
+        __mqdes: ::mqd_t,
+        __msg_ptr: *mut ::c_char,
+        __msg_len: ::size_t,
+        __msg_prio: *mut ::c_uint,
+    ) -> ::ssize_t;
+    pub fn mq_send(
+        __mqdes: ::mqd_t,
+        __msg_ptr: *const ::c_char,
+        __msg_len: ::size_t,
+        __msg_prio: ::c_uint,
+    ) -> ::c_int;
+    pub fn mq_setattr(
+        __mqdes: ::mqd_t,
+        __mqstat: *const mq_attr,
+        __omqstat: *mut mq_attr,
+    ) -> ::c_int;
+    pub fn mq_timedreceive(
+        __mqdes: ::mqd_t,
+        __msg_ptr: *mut ::c_char,
+        __msg_len: ::size_t,
+        __msg_prio: *mut ::c_uint,
+        __abs_timeout: *const ::timespec,
+    ) -> ::ssize_t;
+    pub fn mq_timedsend(
+        __mqdes: ::mqd_t,
+        __msg_ptr: *const ::c_char,
+        __msg_len: ::size_t,
+        __msg_prio: ::c_uint,
+        __abs_timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn mq_unlink(__name: *const ::c_char) -> ::c_int;
+    pub fn __get_errno_ptr() -> *mut ::c_int;
+
+    // System page, see https://www.qnx.com/developers/docs/7.1#com.qnx.doc.neutrino.building/topic/syspage/syspage_about.html
+    pub static mut _syspage_ptr: *mut syspage_entry;
+
+    // Function on the stack after a call to pthread_create().  This is used
+    // as a sentinel to work around an infitnite loop in the unwinding code.
+    pub fn __my_thread_exit(value_ptr: *mut *const ::c_void);
+}
+
+// Models the implementation in stdlib.h.  Ctest will fail if trying to use the
+// default symbol from libc
+pub unsafe fn atexit(cb: extern "C" fn()) -> ::c_int {
+    extern "C" {
+        static __dso_handle: *mut ::c_void;
+        pub fn __cxa_atexit(
+            cb: extern "C" fn(),
+            __arg: *mut ::c_void,
+            __dso: *mut ::c_void,
+        ) -> ::c_int;
+    }
+    __cxa_atexit(cb, 0 as *mut ::c_void, __dso_handle)
+}
+
+impl siginfo_t {
+    pub unsafe fn si_addr(&self) -> *mut ::c_void {
+        #[repr(C)]
+        struct siginfo_si_addr {
+            _pad: [u8; 32],
+            si_addr: *mut ::c_void,
+        }
+        (*(self as *const siginfo_t as *const siginfo_si_addr)).si_addr
+    }
+
+    pub unsafe fn si_value(&self) -> ::sigval {
+        #[repr(C)]
+        struct siginfo_si_value {
+            _pad: [u8; 32],
+            si_value: ::sigval,
+        }
+        (*(self as *const siginfo_t as *const siginfo_si_value)).si_value
+    }
+
+    pub unsafe fn si_pid(&self) -> ::pid_t {
+        #[repr(C)]
+        struct siginfo_si_pid {
+            _pad: [u8; 16],
+            si_pid: ::pid_t,
+        }
+        (*(self as *const siginfo_t as *const siginfo_si_pid)).si_pid
+    }
+
+    pub unsafe fn si_uid(&self) -> ::uid_t {
+        #[repr(C)]
+        struct siginfo_si_uid {
+            _pad: [u8; 24],
+            si_uid: ::uid_t,
+        }
+        (*(self as *const siginfo_t as *const siginfo_si_uid)).si_uid
+    }
+
+    pub unsafe fn si_status(&self) -> ::c_int {
+        #[repr(C)]
+        struct siginfo_si_status {
+            _pad: [u8; 28],
+            si_status: ::c_int,
+        }
+        (*(self as *const siginfo_t as *const siginfo_si_status)).si_status
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "x86_64")] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    }
+    else if #[cfg(target_arch = "aarch64")] {
+        mod aarch64;
+        pub use self::aarch64::*;
+    }
+    else {
+        panic!("Unsupported arch");
+    }
+}
+
+mod neutrino;
+pub use self::neutrino::*;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/nto/neutrino.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/nto/neutrino.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/nto/neutrino.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/nto/neutrino.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1288 @@
+pub type nto_job_t = ::sync_t;
+
+s! {
+    pub struct syspage_entry_info {
+        pub entry_off: u16,
+        pub entry_size: u16,
+    }
+    pub struct syspage_array_info {
+        entry_off: u16,
+        entry_size: u16,
+        element_size: u16,
+    }
+
+    pub struct intrspin {
+        pub value: ::c_uint, // volatile
+    }
+
+    pub struct iov_t {
+        pub iov_base: *mut ::c_void,  // union
+        pub iov_len: ::size_t,
+    }
+
+    pub struct _itimer {
+        pub nsec: u64,
+        pub interval_nsec: u64,
+    }
+
+    pub struct _msg_info64 {
+        pub nd: u32,
+        pub srcnd: u32,
+        pub pid: ::pid_t,
+        pub tid: i32,
+        pub chid: i32,
+        pub scoid: i32,
+        pub coid: i32,
+        pub priority: i16,
+        pub flags: i16,
+        pub msglen: isize,
+        pub srcmsglen: isize,
+        pub dstmsglen: isize,
+        pub type_id: u32,
+        reserved: u32,
+    }
+
+    pub struct _cred_info {
+        pub ruid: ::uid_t,
+        pub euid: ::uid_t,
+        pub suid: ::uid_t,
+        pub rgid: ::gid_t,
+        pub egid: ::gid_t,
+        pub sgid: ::gid_t,
+        pub ngroups: u32,
+        pub grouplist: [::gid_t; 8],
+    }
+
+    pub struct _client_info {
+        pub nd: u32,
+        pub pid: ::pid_t,
+        pub sid: ::pid_t,
+        pub flags: u32,
+        pub cred: ::_cred_info,
+    }
+
+    pub struct _client_able {
+        pub ability: u32,
+        pub flags: u32,
+        pub range_lo: u64,
+        pub range_hi: u64,
+    }
+
+    pub struct nto_channel_config {
+        pub event: ::sigevent,
+        pub num_pulses: ::c_uint,
+        pub rearm_threshold: ::c_uint,
+        pub options: ::c_uint,
+        reserved: [::c_uint; 3],
+    }
+
+    // TODO: The following structures are defined in a header file which doesn't
+    //       appear as part of the default headers found in a standard installation
+    //       of Neutrino 7.1 SDP.  Commented out for now.
+    //pub struct _asyncmsg_put_header {
+    //    pub err: ::c_int,
+    //    pub iov: *mut ::iov_t,
+    //    pub parts: ::c_int,
+    //    pub handle: ::c_uint,
+    //    pub cb: ::Option<
+    //        unsafe extern "C" fn(
+    //            err: ::c_int,
+    //            buf: *mut ::c_void,
+    //            handle: ::c_uint,
+    //        ) -> ::c_int>,
+    //    pub put_hdr_flags: ::c_uint,
+    //}
+
+    //pub struct _asyncmsg_connection_attr {
+    //    pub call_back: ::Option<
+    //        unsafe extern "C" fn(
+    //            err: ::c_int,
+    //            buff: *mut ::c_void,
+    //            handle: ::c_uint,
+    //        ) -> ::c_int>,
+    //    pub buffer_size: ::size_t,
+    //    pub max_num_buffer: ::c_uint,
+    //    pub trigger_num_msg: ::c_uint,
+    //    pub trigger_time: ::_itimer,
+    //    reserve: ::c_uint,
+    //}
+
+    //pub struct _asyncmsg_connection_descriptor {
+    //    pub flags: ::c_uint,
+    //    pub sendq_size: ::c_uint,
+    //    pub sendq_head: ::c_uint,
+    //    pub sendq_tail: ::c_uint,
+    //    pub sendq_free: ::c_uint,
+    //    pub err: ::c_int,
+    //    pub ev: ::sigevent,
+    //    pub num_curmsg: ::c_uint,
+    //    pub ttimer: ::timer_t,
+    //    pub block_con: ::pthread_cond_t,
+    //    pub mu: ::pthread_mutex_t,
+    //    reserved: ::c_uint,
+    //    pub attr: ::_asyncmsg_connection_attr,
+    //    pub reserves: [::c_uint; 3],
+    //    pub sendq: [::_asyncmsg_put_header; 1], // flexarray
+    //}
+
+    pub struct __c_anonymous_struct_ev {
+        pub event: ::sigevent,
+        pub coid: ::c_int,
+    }
+
+    pub struct _channel_connect_attr {  // union
+        pub ev: ::__c_anonymous_struct_ev,
+    }
+
+    pub struct _sighandler_info {
+        pub siginfo: ::siginfo_t,
+        pub handler: ::Option<unsafe extern "C" fn(value: ::c_int)>,
+        pub context: *mut ::c_void,
+    }
+
+    pub struct __c_anonymous_struct_time {
+        pub length: ::c_uint,
+        pub scale: ::c_uint,
+    }
+
+    pub struct _idle_hook {
+        pub hook_size: ::c_uint,
+        pub cmd: ::c_uint,
+        pub mode: ::c_uint,
+        pub latency: ::c_uint,
+        pub next_fire: u64,
+        pub curr_time: u64,
+        pub tod_adjust: u64,
+        pub resp: ::c_uint,
+        pub time: __c_anonymous_struct_time,
+        pub trigger: ::sigevent,
+        pub intrs: *mut ::c_uint,
+        pub block_stack_size: ::c_uint,
+    }
+
+    pub struct _clockadjust {
+        pub tick_count: u32,
+        pub tick_nsec_inc: i32,
+    }
+
+    pub struct qtime_entry {
+        pub cycles_per_sec: u64,
+        pub nsec_tod_adjust: u64, // volatile
+        pub nsec: u64,            // volatile
+        pub nsec_inc: u32,
+        pub boot_time: u32,
+        pub adjust: _clockadjust,
+        pub timer_rate: u32,
+        pub timer_scale: i32,
+        pub timer_load: u32,
+        pub intr: i32,
+        pub epoch: u32,
+        pub flags: u32,
+        pub rr_interval_mul: u32,
+        pub timer_load_hi: u32,
+        pub nsec_stable: u64,      // volatile
+        pub timer_load_max: u64,
+        pub timer_prog_time: u32,
+        spare: [u32; 7],
+    }
+
+    pub struct _sched_info {
+        pub priority_min: ::c_int,
+        pub priority_max: ::c_int,
+        pub interval: u64,
+        pub priority_priv: ::c_int,
+        reserved: [::c_int; 11],
+    }
+
+    pub struct _timer_info {
+        pub itime: ::_itimer,
+        pub otime: ::_itimer,
+        pub flags: u32,
+        pub tid: i32,
+        pub notify: i32,
+        pub clockid: ::clockid_t,
+        pub overruns: u32,
+        pub event: ::sigevent, // union
+    }
+
+    pub struct _clockperiod {
+        pub nsec: u32,
+        pub fract: i32,
+    }
+}
+
+s_no_extra_traits! {
+
+    #[repr(align(8))]
+    pub struct syspage_entry {
+        pub size: u16,
+        pub total_size: u16,
+        pub type_: u16,
+        pub num_cpu: u16,
+        pub system_private: syspage_entry_info,
+        pub old_asinfo: syspage_entry_info,
+        pub __mangle_name_to_cause_compilation_errs_meminfo: syspage_entry_info,
+        pub hwinfo: syspage_entry_info,
+        pub old_cpuinfo: syspage_entry_info,
+        pub old_cacheattr: syspage_entry_info,
+        pub qtime: syspage_entry_info,
+        pub callout: syspage_entry_info,
+        pub callin: syspage_entry_info,
+        pub typed_strings: syspage_entry_info,
+        pub strings: syspage_entry_info,
+        pub old_intrinfo: syspage_entry_info,
+        pub smp: syspage_entry_info,
+        pub pminfo: syspage_entry_info,
+        pub old_mdriver: syspage_entry_info,
+        spare0: [u32; 1],
+        __reserved: [u8; 160], // anonymous union with architecture dependent structs
+        pub new_asinfo: syspage_array_info,
+        pub new_cpuinfo: syspage_array_info,
+        pub new_cacheattr: syspage_array_info,
+        pub new_intrinfo: syspage_array_info,
+        pub new_mdriver: syspage_array_info,
+    }
+}
+
+pub const SYSMGR_PID: u32 = 1;
+pub const SYSMGR_CHID: u32 = 1;
+pub const SYSMGR_COID: u32 = _NTO_SIDE_CHANNEL;
+pub const SYSMGR_HANDLE: u32 = 0;
+
+pub const STATE_DEAD: ::c_int = 0x00;
+pub const STATE_RUNNING: ::c_int = 0x01;
+pub const STATE_READY: ::c_int = 0x02;
+pub const STATE_STOPPED: ::c_int = 0x03;
+pub const STATE_SEND: ::c_int = 0x04;
+pub const STATE_RECEIVE: ::c_int = 0x05;
+pub const STATE_REPLY: ::c_int = 0x06;
+pub const STATE_STACK: ::c_int = 0x07;
+pub const STATE_WAITTHREAD: ::c_int = 0x08;
+pub const STATE_WAITPAGE: ::c_int = 0x09;
+pub const STATE_SIGSUSPEND: ::c_int = 0x0a;
+pub const STATE_SIGWAITINFO: ::c_int = 0x0b;
+pub const STATE_NANOSLEEP: ::c_int = 0x0c;
+pub const STATE_MUTEX: ::c_int = 0x0d;
+pub const STATE_CONDVAR: ::c_int = 0x0e;
+pub const STATE_JOIN: ::c_int = 0x0f;
+pub const STATE_INTR: ::c_int = 0x10;
+pub const STATE_SEM: ::c_int = 0x11;
+pub const STATE_WAITCTX: ::c_int = 0x12;
+pub const STATE_NET_SEND: ::c_int = 0x13;
+pub const STATE_NET_REPLY: ::c_int = 0x14;
+pub const STATE_MAX: ::c_int = 0x18;
+
+pub const _NTO_TIMEOUT_RECEIVE: i32 = 1 << STATE_RECEIVE;
+pub const _NTO_TIMEOUT_SEND: i32 = 1 << STATE_SEND;
+pub const _NTO_TIMEOUT_REPLY: i32 = 1 << STATE_REPLY;
+pub const _NTO_TIMEOUT_SIGSUSPEND: i32 = 1 << STATE_SIGSUSPEND;
+pub const _NTO_TIMEOUT_SIGWAITINFO: i32 = 1 << STATE_SIGWAITINFO;
+pub const _NTO_TIMEOUT_NANOSLEEP: i32 = 1 << STATE_NANOSLEEP;
+pub const _NTO_TIMEOUT_MUTEX: i32 = 1 << STATE_MUTEX;
+pub const _NTO_TIMEOUT_CONDVAR: i32 = 1 << STATE_CONDVAR;
+pub const _NTO_TIMEOUT_JOIN: i32 = 1 << STATE_JOIN;
+pub const _NTO_TIMEOUT_INTR: i32 = 1 << STATE_INTR;
+pub const _NTO_TIMEOUT_SEM: i32 = 1 << STATE_SEM;
+
+pub const _NTO_MI_ENDIAN_BIG: u32 = 1;
+pub const _NTO_MI_ENDIAN_DIFF: u32 = 2;
+pub const _NTO_MI_UNBLOCK_REQ: u32 = 256;
+pub const _NTO_MI_NET_CRED_DIRTY: u32 = 512;
+pub const _NTO_MI_CONSTRAINED: u32 = 1024;
+pub const _NTO_MI_CHROOT: u32 = 2048;
+pub const _NTO_MI_BITS_64: u32 = 4096;
+pub const _NTO_MI_BITS_DIFF: u32 = 8192;
+pub const _NTO_MI_SANDBOX: u32 = 16384;
+
+pub const _NTO_CI_ENDIAN_BIG: u32 = 1;
+pub const _NTO_CI_BKGND_PGRP: u32 = 4;
+pub const _NTO_CI_ORPHAN_PGRP: u32 = 8;
+pub const _NTO_CI_STOPPED: u32 = 128;
+pub const _NTO_CI_UNABLE: u32 = 256;
+pub const _NTO_CI_TYPE_ID: u32 = 512;
+pub const _NTO_CI_CHROOT: u32 = 2048;
+pub const _NTO_CI_BITS_64: u32 = 4096;
+pub const _NTO_CI_SANDBOX: u32 = 16384;
+pub const _NTO_CI_LOADER: u32 = 32768;
+pub const _NTO_CI_FULL_GROUPS: u32 = 2147483648;
+
+pub const _NTO_TI_ACTIVE: u32 = 1;
+pub const _NTO_TI_ABSOLUTE: u32 = 2;
+pub const _NTO_TI_EXPIRED: u32 = 4;
+pub const _NTO_TI_TOD_BASED: u32 = 8;
+pub const _NTO_TI_TARGET_PROCESS: u32 = 16;
+pub const _NTO_TI_REPORT_TOLERANCE: u32 = 32;
+pub const _NTO_TI_PRECISE: u32 = 64;
+pub const _NTO_TI_TOLERANT: u32 = 128;
+pub const _NTO_TI_WAKEUP: u32 = 256;
+pub const _NTO_TI_PROCESS_TOLERANT: u32 = 512;
+pub const _NTO_TI_HIGH_RESOLUTION: u32 = 1024;
+
+pub const _PULSE_TYPE: u32 = 0;
+pub const _PULSE_SUBTYPE: u32 = 0;
+pub const _PULSE_CODE_UNBLOCK: i32 = -32;
+pub const _PULSE_CODE_DISCONNECT: i32 = -33;
+pub const _PULSE_CODE_THREADDEATH: i32 = -34;
+pub const _PULSE_CODE_COIDDEATH: i32 = -35;
+pub const _PULSE_CODE_NET_ACK: i32 = -36;
+pub const _PULSE_CODE_NET_UNBLOCK: i32 = -37;
+pub const _PULSE_CODE_NET_DETACH: i32 = -38;
+pub const _PULSE_CODE_RESTART: i32 = -39;
+pub const _PULSE_CODE_NORESTART: i32 = -40;
+pub const _PULSE_CODE_UNBLOCK_RESTART: i32 = -41;
+pub const _PULSE_CODE_UNBLOCK_TIMER: i32 = -42;
+pub const _PULSE_CODE_MINAVAIL: u32 = 0;
+pub const _PULSE_CODE_MAXAVAIL: u32 = 127;
+
+pub const _NTO_HARD_FLAGS_END: u32 = 1;
+
+pub const _NTO_PULSE_IF_UNIQUE: u32 = 4096;
+pub const _NTO_PULSE_REPLACE: u32 = 8192;
+
+pub const _NTO_PF_NOCLDSTOP: u32 = 1;
+pub const _NTO_PF_LOADING: u32 = 2;
+pub const _NTO_PF_TERMING: u32 = 4;
+pub const _NTO_PF_ZOMBIE: u32 = 8;
+pub const _NTO_PF_NOZOMBIE: u32 = 16;
+pub const _NTO_PF_FORKED: u32 = 32;
+pub const _NTO_PF_ORPHAN_PGRP: u32 = 64;
+pub const _NTO_PF_STOPPED: u32 = 128;
+pub const _NTO_PF_DEBUG_STOPPED: u32 = 256;
+pub const _NTO_PF_BKGND_PGRP: u32 = 512;
+pub const _NTO_PF_NOISYNC: u32 = 1024;
+pub const _NTO_PF_CONTINUED: u32 = 2048;
+pub const _NTO_PF_CHECK_INTR: u32 = 4096;
+pub const _NTO_PF_COREDUMP: u32 = 8192;
+pub const _NTO_PF_RING0: u32 = 32768;
+pub const _NTO_PF_SLEADER: u32 = 65536;
+pub const _NTO_PF_WAITINFO: u32 = 131072;
+pub const _NTO_PF_DESTROYALL: u32 = 524288;
+pub const _NTO_PF_NOCOREDUMP: u32 = 1048576;
+pub const _NTO_PF_WAITDONE: u32 = 4194304;
+pub const _NTO_PF_TERM_WAITING: u32 = 8388608;
+pub const _NTO_PF_ASLR: u32 = 16777216;
+pub const _NTO_PF_EXECED: u32 = 33554432;
+pub const _NTO_PF_APP_STOPPED: u32 = 67108864;
+pub const _NTO_PF_64BIT: u32 = 134217728;
+pub const _NTO_PF_NET: u32 = 268435456;
+pub const _NTO_PF_NOLAZYSTACK: u32 = 536870912;
+pub const _NTO_PF_NOEXEC_STACK: u32 = 1073741824;
+pub const _NTO_PF_LOADER_PERMS: u32 = 2147483648;
+
+pub const _NTO_TF_INTR_PENDING: u32 = 65536;
+pub const _NTO_TF_DETACHED: u32 = 131072;
+pub const _NTO_TF_SHR_MUTEX: u32 = 262144;
+pub const _NTO_TF_SHR_MUTEX_EUID: u32 = 524288;
+pub const _NTO_TF_THREADS_HOLD: u32 = 1048576;
+pub const _NTO_TF_UNBLOCK_REQ: u32 = 4194304;
+pub const _NTO_TF_ALIGN_FAULT: u32 = 16777216;
+pub const _NTO_TF_SSTEP: u32 = 33554432;
+pub const _NTO_TF_ALLOCED_STACK: u32 = 67108864;
+pub const _NTO_TF_NOMULTISIG: u32 = 134217728;
+pub const _NTO_TF_LOW_LATENCY: u32 = 268435456;
+pub const _NTO_TF_IOPRIV: u32 = 2147483648;
+
+pub const _NTO_TCTL_IO_PRIV: u32 = 1;
+pub const _NTO_TCTL_THREADS_HOLD: u32 = 2;
+pub const _NTO_TCTL_THREADS_CONT: u32 = 3;
+pub const _NTO_TCTL_RUNMASK: u32 = 4;
+pub const _NTO_TCTL_ALIGN_FAULT: u32 = 5;
+pub const _NTO_TCTL_RUNMASK_GET_AND_SET: u32 = 6;
+pub const _NTO_TCTL_PERFCOUNT: u32 = 7;
+pub const _NTO_TCTL_ONE_THREAD_HOLD: u32 = 8;
+pub const _NTO_TCTL_ONE_THREAD_CONT: u32 = 9;
+pub const _NTO_TCTL_RUNMASK_GET_AND_SET_INHERIT: u32 = 10;
+pub const _NTO_TCTL_NAME: u32 = 11;
+pub const _NTO_TCTL_RCM_GET_AND_SET: u32 = 12;
+pub const _NTO_TCTL_SHR_MUTEX: u32 = 13;
+pub const _NTO_TCTL_IO: u32 = 14;
+pub const _NTO_TCTL_NET_KIF_GET_AND_SET: u32 = 15;
+pub const _NTO_TCTL_LOW_LATENCY: u32 = 16;
+pub const _NTO_TCTL_ADD_EXIT_EVENT: u32 = 17;
+pub const _NTO_TCTL_DEL_EXIT_EVENT: u32 = 18;
+pub const _NTO_TCTL_IO_LEVEL: u32 = 19;
+pub const _NTO_TCTL_RESERVED: u32 = 2147483648;
+pub const _NTO_TCTL_IO_LEVEL_INHERIT: u32 = 1073741824;
+pub const _NTO_IO_LEVEL_NONE: u32 = 1;
+pub const _NTO_IO_LEVEL_1: u32 = 2;
+pub const _NTO_IO_LEVEL_2: u32 = 3;
+
+pub const _NTO_THREAD_NAME_MAX: u32 = 100;
+
+pub const _NTO_CHF_FIXED_PRIORITY: u32 = 1;
+pub const _NTO_CHF_UNBLOCK: u32 = 2;
+pub const _NTO_CHF_THREAD_DEATH: u32 = 4;
+pub const _NTO_CHF_DISCONNECT: u32 = 8;
+pub const _NTO_CHF_NET_MSG: u32 = 16;
+pub const _NTO_CHF_SENDER_LEN: u32 = 32;
+pub const _NTO_CHF_COID_DISCONNECT: u32 = 64;
+pub const _NTO_CHF_REPLY_LEN: u32 = 128;
+pub const _NTO_CHF_PULSE_POOL: u32 = 256;
+pub const _NTO_CHF_ASYNC_NONBLOCK: u32 = 512;
+pub const _NTO_CHF_ASYNC: u32 = 1024;
+pub const _NTO_CHF_GLOBAL: u32 = 2048;
+pub const _NTO_CHF_PRIVATE: u32 = 4096;
+pub const _NTO_CHF_MSG_PAUSING: u32 = 8192;
+pub const _NTO_CHF_INHERIT_RUNMASK: u32 = 16384;
+pub const _NTO_CHF_UNBLOCK_TIMER: u32 = 32768;
+
+pub const _NTO_CHO_CUSTOM_EVENT: u32 = 1;
+
+pub const _NTO_COF_CLOEXEC: u32 = 1;
+pub const _NTO_COF_DEAD: u32 = 2;
+pub const _NTO_COF_NOSHARE: u32 = 64;
+pub const _NTO_COF_NETCON: u32 = 128;
+pub const _NTO_COF_NONBLOCK: u32 = 256;
+pub const _NTO_COF_ASYNC: u32 = 512;
+pub const _NTO_COF_GLOBAL: u32 = 1024;
+pub const _NTO_COF_NOEVENT: u32 = 2048;
+pub const _NTO_COF_INSECURE: u32 = 4096;
+pub const _NTO_COF_REG_EVENTS: u32 = 8192;
+pub const _NTO_COF_UNREG_EVENTS: u32 = 16384;
+pub const _NTO_COF_MASK: u32 = 65535;
+
+pub const _NTO_SIDE_CHANNEL: u32 = 1073741824;
+
+pub const _NTO_CONNECTION_SCOID: u32 = 65536;
+pub const _NTO_GLOBAL_CHANNEL: u32 = 1073741824;
+
+pub const _NTO_TIMEOUT_MASK: u32 = (1 << STATE_MAX) - 1;
+pub const _NTO_TIMEOUT_ACTIVE: u32 = 1 << STATE_MAX;
+pub const _NTO_TIMEOUT_IMMEDIATE: u32 = 1 << (STATE_MAX + 1);
+
+pub const _NTO_IC_LATENCY: u32 = 0;
+
+pub const _NTO_INTR_FLAGS_END: u32 = 1;
+pub const _NTO_INTR_FLAGS_NO_UNMASK: u32 = 2;
+pub const _NTO_INTR_FLAGS_PROCESS: u32 = 4;
+pub const _NTO_INTR_FLAGS_TRK_MSK: u32 = 8;
+pub const _NTO_INTR_FLAGS_ARRAY: u32 = 16;
+pub const _NTO_INTR_FLAGS_EXCLUSIVE: u32 = 32;
+pub const _NTO_INTR_FLAGS_FPU: u32 = 64;
+
+pub const _NTO_INTR_CLASS_EXTERNAL: u32 = 0;
+pub const _NTO_INTR_CLASS_SYNTHETIC: u32 = 2147418112;
+
+pub const _NTO_INTR_SPARE: u32 = 2147483647;
+
+pub const _NTO_HOOK_IDLE: u32 = 2147418113;
+pub const _NTO_HOOK_OVERDRIVE: u32 = 2147418114;
+pub const _NTO_HOOK_LAST: u32 = 2147418114;
+pub const _NTO_HOOK_IDLE2_FLAG: u32 = 32768;
+
+pub const _NTO_IH_CMD_SLEEP_SETUP: u32 = 1;
+pub const _NTO_IH_CMD_SLEEP_BLOCK: u32 = 2;
+pub const _NTO_IH_CMD_SLEEP_WAKEUP: u32 = 4;
+pub const _NTO_IH_CMD_SLEEP_ONLINE: u32 = 8;
+pub const _NTO_IH_RESP_NEEDS_BLOCK: u32 = 1;
+pub const _NTO_IH_RESP_NEEDS_WAKEUP: u32 = 2;
+pub const _NTO_IH_RESP_NEEDS_ONLINE: u32 = 4;
+pub const _NTO_IH_RESP_SYNC_TIME: u32 = 16;
+pub const _NTO_IH_RESP_SYNC_TLB: u32 = 32;
+pub const _NTO_IH_RESP_SUGGEST_OFFLINE: u32 = 256;
+pub const _NTO_IH_RESP_SLEEP_MODE_REACHED: u32 = 512;
+pub const _NTO_IH_RESP_DELIVER_INTRS: u32 = 1024;
+
+pub const _NTO_READIOV_SEND: u32 = 0;
+pub const _NTO_READIOV_REPLY: u32 = 1;
+
+pub const _NTO_KEYDATA_VTID: u32 = 2147483648;
+
+pub const _NTO_KEYDATA_PATHSIGN: u32 = 32768;
+pub const _NTO_KEYDATA_OP_MASK: u32 = 255;
+pub const _NTO_KEYDATA_VERIFY: u32 = 0;
+pub const _NTO_KEYDATA_CALCULATE: u32 = 1;
+pub const _NTO_KEYDATA_CALCULATE_REUSE: u32 = 2;
+pub const _NTO_KEYDATA_PATHSIGN_VERIFY: u32 = 32768;
+pub const _NTO_KEYDATA_PATHSIGN_CALCULATE: u32 = 32769;
+pub const _NTO_KEYDATA_PATHSIGN_CALCULATE_REUSE: u32 = 32770;
+
+pub const _NTO_SCTL_SETPRIOCEILING: u32 = 1;
+pub const _NTO_SCTL_GETPRIOCEILING: u32 = 2;
+pub const _NTO_SCTL_SETEVENT: u32 = 3;
+pub const _NTO_SCTL_MUTEX_WAKEUP: u32 = 4;
+pub const _NTO_SCTL_MUTEX_CONSISTENT: u32 = 5;
+pub const _NTO_SCTL_SEM_VALUE: u32 = 6;
+
+pub const _NTO_CLIENTINFO_GETGROUPS: u32 = 1;
+pub const _NTO_CLIENTINFO_GETTYPEID: u32 = 2;
+
+extern "C" {
+    pub fn ChannelCreate(__flags: ::c_uint) -> ::c_int;
+    pub fn ChannelCreate_r(__flags: ::c_uint) -> ::c_int;
+    pub fn ChannelCreatePulsePool(
+        __flags: ::c_uint,
+        __config: *const nto_channel_config,
+    ) -> ::c_int;
+    pub fn ChannelCreateExt(
+        __flags: ::c_uint,
+        __mode: ::mode_t,
+        __bufsize: usize,
+        __maxnumbuf: ::c_uint,
+        __ev: *const ::sigevent,
+        __cred: *mut _cred_info,
+    ) -> ::c_int;
+    pub fn ChannelDestroy(__chid: ::c_int) -> ::c_int;
+    pub fn ChannelDestroy_r(__chid: ::c_int) -> ::c_int;
+    pub fn ConnectAttach(
+        __nd: u32,
+        __pid: ::pid_t,
+        __chid: ::c_int,
+        __index: ::c_uint,
+        __flags: ::c_int,
+    ) -> ::c_int;
+    pub fn ConnectAttach_r(
+        __nd: u32,
+        __pid: ::pid_t,
+        __chid: ::c_int,
+        __index: ::c_uint,
+        __flags: ::c_int,
+    ) -> ::c_int;
+
+    // TODO: The following function uses a structure defined in a header file
+    //       which doesn't appear as part of the default headers found in a
+    //       standard installation of Neutrino 7.1 SDP.  Commented out for now.
+    //pub fn ConnectAttachExt(
+    //    __nd: u32,
+    //    __pid: ::pid_t,
+    //    __chid: ::c_int,
+    //    __index: ::c_uint,
+    //    __flags: ::c_int,
+    //    __cd: *mut _asyncmsg_connection_descriptor,
+    //) -> ::c_int;
+    pub fn ConnectDetach(__coid: ::c_int) -> ::c_int;
+    pub fn ConnectDetach_r(__coid: ::c_int) -> ::c_int;
+    pub fn ConnectServerInfo(__pid: ::pid_t, __coid: ::c_int, __info: *mut _msg_info64) -> ::c_int;
+    pub fn ConnectServerInfo_r(
+        __pid: ::pid_t,
+        __coid: ::c_int,
+        __info: *mut _msg_info64,
+    ) -> ::c_int;
+    pub fn ConnectClientInfoExtraArgs(
+        __scoid: ::c_int,
+        __info_pp: *mut _client_info,
+        __ngroups: ::c_int,
+        __abilities: *mut _client_able,
+        __nable: ::c_int,
+        __type_id: *mut ::c_uint,
+    ) -> ::c_int;
+    pub fn ConnectClientInfoExtraArgs_r(
+        __scoid: ::c_int,
+        __info_pp: *mut _client_info,
+        __ngroups: ::c_int,
+        __abilities: *mut _client_able,
+        __nable: ::c_int,
+        __type_id: *mut ::c_uint,
+    ) -> ::c_int;
+    pub fn ConnectClientInfo(
+        __scoid: ::c_int,
+        __info: *mut _client_info,
+        __ngroups: ::c_int,
+    ) -> ::c_int;
+    pub fn ConnectClientInfo_r(
+        __scoid: ::c_int,
+        __info: *mut _client_info,
+        __ngroups: ::c_int,
+    ) -> ::c_int;
+    pub fn ConnectClientInfoExt(
+        __scoid: ::c_int,
+        __info_pp: *mut *mut _client_info,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn ClientInfoExtFree(__info_pp: *mut *mut _client_info) -> ::c_int;
+    pub fn ConnectClientInfoAble(
+        __scoid: ::c_int,
+        __info_pp: *mut *mut _client_info,
+        flags: ::c_int,
+        abilities: *mut _client_able,
+        nable: ::c_int,
+    ) -> ::c_int;
+    pub fn ConnectFlags(
+        __pid: ::pid_t,
+        __coid: ::c_int,
+        __mask: ::c_uint,
+        __bits: ::c_uint,
+    ) -> ::c_int;
+    pub fn ConnectFlags_r(
+        __pid: ::pid_t,
+        __coid: ::c_int,
+        __mask: ::c_uint,
+        __bits: ::c_uint,
+    ) -> ::c_int;
+    pub fn ChannelConnectAttr(
+        __id: ::c_uint,
+        __old_attr: *mut _channel_connect_attr,
+        __new_attr: *mut _channel_connect_attr,
+        __flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn MsgSend(
+        __coid: ::c_int,
+        __smsg: *const ::c_void,
+        __sbytes: usize,
+        __rmsg: *mut ::c_void,
+        __rbytes: usize,
+    ) -> ::c_long;
+    pub fn MsgSend_r(
+        __coid: ::c_int,
+        __smsg: *const ::c_void,
+        __sbytes: usize,
+        __rmsg: *mut ::c_void,
+        __rbytes: usize,
+    ) -> ::c_long;
+    pub fn MsgSendnc(
+        __coid: ::c_int,
+        __smsg: *const ::c_void,
+        __sbytes: usize,
+        __rmsg: *mut ::c_void,
+        __rbytes: usize,
+    ) -> ::c_long;
+    pub fn MsgSendnc_r(
+        __coid: ::c_int,
+        __smsg: *const ::c_void,
+        __sbytes: usize,
+        __rmsg: *mut ::c_void,
+        __rbytes: usize,
+    ) -> ::c_long;
+    pub fn MsgSendsv(
+        __coid: ::c_int,
+        __smsg: *const ::c_void,
+        __sbytes: usize,
+        __riov: *const ::iovec,
+        __rparts: usize,
+    ) -> ::c_long;
+    pub fn MsgSendsv_r(
+        __coid: ::c_int,
+        __smsg: *const ::c_void,
+        __sbytes: usize,
+        __riov: *const ::iovec,
+        __rparts: usize,
+    ) -> ::c_long;
+    pub fn MsgSendsvnc(
+        __coid: ::c_int,
+        __smsg: *const ::c_void,
+        __sbytes: usize,
+        __riov: *const ::iovec,
+        __rparts: usize,
+    ) -> ::c_long;
+    pub fn MsgSendsvnc_r(
+        __coid: ::c_int,
+        __smsg: *const ::c_void,
+        __sbytes: usize,
+        __riov: *const ::iovec,
+        __rparts: usize,
+    ) -> ::c_long;
+    pub fn MsgSendvs(
+        __coid: ::c_int,
+        __siov: *const ::iovec,
+        __sparts: usize,
+        __rmsg: *mut ::c_void,
+        __rbytes: usize,
+    ) -> ::c_long;
+    pub fn MsgSendvs_r(
+        __coid: ::c_int,
+        __siov: *const ::iovec,
+        __sparts: usize,
+        __rmsg: *mut ::c_void,
+        __rbytes: usize,
+    ) -> ::c_long;
+    pub fn MsgSendvsnc(
+        __coid: ::c_int,
+        __siov: *const ::iovec,
+        __sparts: usize,
+        __rmsg: *mut ::c_void,
+        __rbytes: usize,
+    ) -> ::c_long;
+    pub fn MsgSendvsnc_r(
+        __coid: ::c_int,
+        __siov: *const ::iovec,
+        __sparts: usize,
+        __rmsg: *mut ::c_void,
+        __rbytes: usize,
+    ) -> ::c_long;
+    pub fn MsgSendv(
+        __coid: ::c_int,
+        __siov: *const ::iovec,
+        __sparts: usize,
+        __riov: *const ::iovec,
+        __rparts: usize,
+    ) -> ::c_long;
+    pub fn MsgSendv_r(
+        __coid: ::c_int,
+        __siov: *const ::iovec,
+        __sparts: usize,
+        __riov: *const ::iovec,
+        __rparts: usize,
+    ) -> ::c_long;
+    pub fn MsgSendvnc(
+        __coid: ::c_int,
+        __siov: *const ::iovec,
+        __sparts: usize,
+        __riov: *const ::iovec,
+        __rparts: usize,
+    ) -> ::c_long;
+    pub fn MsgSendvnc_r(
+        __coid: ::c_int,
+        __siov: *const ::iovec,
+        __sparts: usize,
+        __riov: *const ::iovec,
+        __rparts: usize,
+    ) -> ::c_long;
+    pub fn MsgReceive(
+        __chid: ::c_int,
+        __msg: *mut ::c_void,
+        __bytes: usize,
+        __info: *mut _msg_info64,
+    ) -> ::c_int;
+    pub fn MsgReceive_r(
+        __chid: ::c_int,
+        __msg: *mut ::c_void,
+        __bytes: usize,
+        __info: *mut _msg_info64,
+    ) -> ::c_int;
+    pub fn MsgReceivev(
+        __chid: ::c_int,
+        __iov: *const ::iovec,
+        __parts: usize,
+        __info: *mut _msg_info64,
+    ) -> ::c_int;
+    pub fn MsgReceivev_r(
+        __chid: ::c_int,
+        __iov: *const ::iovec,
+        __parts: usize,
+        __info: *mut _msg_info64,
+    ) -> ::c_int;
+    pub fn MsgReceivePulse(
+        __chid: ::c_int,
+        __pulse: *mut ::c_void,
+        __bytes: usize,
+        __info: *mut _msg_info64,
+    ) -> ::c_int;
+    pub fn MsgReceivePulse_r(
+        __chid: ::c_int,
+        __pulse: *mut ::c_void,
+        __bytes: usize,
+        __info: *mut _msg_info64,
+    ) -> ::c_int;
+    pub fn MsgReceivePulsev(
+        __chid: ::c_int,
+        __iov: *const ::iovec,
+        __parts: usize,
+        __info: *mut _msg_info64,
+    ) -> ::c_int;
+    pub fn MsgReceivePulsev_r(
+        __chid: ::c_int,
+        __iov: *const ::iovec,
+        __parts: usize,
+        __info: *mut _msg_info64,
+    ) -> ::c_int;
+    pub fn MsgReply(
+        __rcvid: ::c_int,
+        __status: ::c_long,
+        __msg: *const ::c_void,
+        __bytes: usize,
+    ) -> ::c_int;
+    pub fn MsgReply_r(
+        __rcvid: ::c_int,
+        __status: ::c_long,
+        __msg: *const ::c_void,
+        __bytes: usize,
+    ) -> ::c_int;
+    pub fn MsgReplyv(
+        __rcvid: ::c_int,
+        __status: ::c_long,
+        __iov: *const ::iovec,
+        __parts: usize,
+    ) -> ::c_int;
+    pub fn MsgReplyv_r(
+        __rcvid: ::c_int,
+        __status: ::c_long,
+        __iov: *const ::iovec,
+        __parts: usize,
+    ) -> ::c_int;
+    pub fn MsgReadiov(
+        __rcvid: ::c_int,
+        __iov: *const ::iovec,
+        __parts: usize,
+        __offset: usize,
+        __flags: ::c_int,
+    ) -> isize;
+    pub fn MsgReadiov_r(
+        __rcvid: ::c_int,
+        __iov: *const ::iovec,
+        __parts: usize,
+        __offset: usize,
+        __flags: ::c_int,
+    ) -> isize;
+    pub fn MsgRead(
+        __rcvid: ::c_int,
+        __msg: *mut ::c_void,
+        __bytes: usize,
+        __offset: usize,
+    ) -> isize;
+    pub fn MsgRead_r(
+        __rcvid: ::c_int,
+        __msg: *mut ::c_void,
+        __bytes: usize,
+        __offset: usize,
+    ) -> isize;
+    pub fn MsgReadv(
+        __rcvid: ::c_int,
+        __iov: *const ::iovec,
+        __parts: usize,
+        __offset: usize,
+    ) -> isize;
+    pub fn MsgReadv_r(
+        __rcvid: ::c_int,
+        __iov: *const ::iovec,
+        __parts: usize,
+        __offset: usize,
+    ) -> isize;
+    pub fn MsgWrite(
+        __rcvid: ::c_int,
+        __msg: *const ::c_void,
+        __bytes: usize,
+        __offset: usize,
+    ) -> isize;
+    pub fn MsgWrite_r(
+        __rcvid: ::c_int,
+        __msg: *const ::c_void,
+        __bytes: usize,
+        __offset: usize,
+    ) -> isize;
+    pub fn MsgWritev(
+        __rcvid: ::c_int,
+        __iov: *const ::iovec,
+        __parts: usize,
+        __offset: usize,
+    ) -> isize;
+    pub fn MsgWritev_r(
+        __rcvid: ::c_int,
+        __iov: *const ::iovec,
+        __parts: usize,
+        __offset: usize,
+    ) -> isize;
+    pub fn MsgSendPulse(
+        __coid: ::c_int,
+        __priority: ::c_int,
+        __code: ::c_int,
+        __value: ::c_int,
+    ) -> ::c_int;
+    pub fn MsgSendPulse_r(
+        __coid: ::c_int,
+        __priority: ::c_int,
+        __code: ::c_int,
+        __value: ::c_int,
+    ) -> ::c_int;
+    pub fn MsgSendPulsePtr(
+        __coid: ::c_int,
+        __priority: ::c_int,
+        __code: ::c_int,
+        __value: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn MsgSendPulsePtr_r(
+        __coid: ::c_int,
+        __priority: ::c_int,
+        __code: ::c_int,
+        __value: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn MsgDeliverEvent(__rcvid: ::c_int, __event: *const ::sigevent) -> ::c_int;
+    pub fn MsgDeliverEvent_r(__rcvid: ::c_int, __event: *const ::sigevent) -> ::c_int;
+    pub fn MsgVerifyEvent(__rcvid: ::c_int, __event: *const ::sigevent) -> ::c_int;
+    pub fn MsgVerifyEvent_r(__rcvid: ::c_int, __event: *const ::sigevent) -> ::c_int;
+    pub fn MsgRegisterEvent(__event: *mut ::sigevent, __coid: ::c_int) -> ::c_int;
+    pub fn MsgRegisterEvent_r(__event: *mut ::sigevent, __coid: ::c_int) -> ::c_int;
+    pub fn MsgUnregisterEvent(__event: *const ::sigevent) -> ::c_int;
+    pub fn MsgUnregisterEvent_r(__event: *const ::sigevent) -> ::c_int;
+    pub fn MsgInfo(__rcvid: ::c_int, __info: *mut _msg_info64) -> ::c_int;
+    pub fn MsgInfo_r(__rcvid: ::c_int, __info: *mut _msg_info64) -> ::c_int;
+    pub fn MsgKeyData(
+        __rcvid: ::c_int,
+        __oper: ::c_int,
+        __key: u32,
+        __newkey: *mut u32,
+        __iov: *const ::iovec,
+        __parts: ::c_int,
+    ) -> ::c_int;
+    pub fn MsgKeyData_r(
+        __rcvid: ::c_int,
+        __oper: ::c_int,
+        __key: u32,
+        __newkey: *mut u32,
+        __iov: *const ::iovec,
+        __parts: ::c_int,
+    ) -> ::c_int;
+    pub fn MsgError(__rcvid: ::c_int, __err: ::c_int) -> ::c_int;
+    pub fn MsgError_r(__rcvid: ::c_int, __err: ::c_int) -> ::c_int;
+    pub fn MsgCurrent(__rcvid: ::c_int) -> ::c_int;
+    pub fn MsgCurrent_r(__rcvid: ::c_int) -> ::c_int;
+    pub fn MsgSendAsyncGbl(
+        __coid: ::c_int,
+        __smsg: *const ::c_void,
+        __sbytes: usize,
+        __msg_prio: ::c_uint,
+    ) -> ::c_int;
+    pub fn MsgSendAsync(__coid: ::c_int) -> ::c_int;
+    pub fn MsgReceiveAsyncGbl(
+        __chid: ::c_int,
+        __rmsg: *mut ::c_void,
+        __rbytes: usize,
+        __info: *mut _msg_info64,
+        __coid: ::c_int,
+    ) -> ::c_int;
+    pub fn MsgReceiveAsync(__chid: ::c_int, __iov: *const ::iovec, __parts: ::c_uint) -> ::c_int;
+    pub fn MsgPause(__rcvid: ::c_int, __cookie: ::c_uint) -> ::c_int;
+    pub fn MsgPause_r(__rcvid: ::c_int, __cookie: ::c_uint) -> ::c_int;
+
+    pub fn SignalKill(
+        __nd: u32,
+        __pid: ::pid_t,
+        __tid: ::c_int,
+        __signo: ::c_int,
+        __code: ::c_int,
+        __value: ::c_int,
+    ) -> ::c_int;
+    pub fn SignalKill_r(
+        __nd: u32,
+        __pid: ::pid_t,
+        __tid: ::c_int,
+        __signo: ::c_int,
+        __code: ::c_int,
+        __value: ::c_int,
+    ) -> ::c_int;
+    pub fn SignalKillSigval(
+        __nd: u32,
+        __pid: ::pid_t,
+        __tid: ::c_int,
+        __signo: ::c_int,
+        __code: ::c_int,
+        __value: *const ::sigval,
+    ) -> ::c_int;
+    pub fn SignalKillSigval_r(
+        __nd: u32,
+        __pid: ::pid_t,
+        __tid: ::c_int,
+        __signo: ::c_int,
+        __code: ::c_int,
+        __value: *const ::sigval,
+    ) -> ::c_int;
+    pub fn SignalReturn(__info: *mut _sighandler_info) -> ::c_int;
+    pub fn SignalFault(__sigcode: ::c_uint, __regs: *mut ::c_void, __refaddr: usize) -> ::c_int;
+    pub fn SignalAction(
+        __pid: ::pid_t,
+        __sigstub: unsafe extern "C" fn(),
+        __signo: ::c_int,
+        __act: *const ::sigaction,
+        __oact: *mut ::sigaction,
+    ) -> ::c_int;
+    pub fn SignalAction_r(
+        __pid: ::pid_t,
+        __sigstub: unsafe extern "C" fn(),
+        __signo: ::c_int,
+        __act: *const ::sigaction,
+        __oact: *mut ::sigaction,
+    ) -> ::c_int;
+    pub fn SignalProcmask(
+        __pid: ::pid_t,
+        __tid: ::c_int,
+        __how: ::c_int,
+        __set: *const ::sigset_t,
+        __oldset: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn SignalProcmask_r(
+        __pid: ::pid_t,
+        __tid: ::c_int,
+        __how: ::c_int,
+        __set: *const ::sigset_t,
+        __oldset: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn SignalSuspend(__set: *const ::sigset_t) -> ::c_int;
+    pub fn SignalSuspend_r(__set: *const ::sigset_t) -> ::c_int;
+    pub fn SignalWaitinfo(__set: *const ::sigset_t, __info: *mut ::siginfo_t) -> ::c_int;
+    pub fn SignalWaitinfo_r(__set: *const ::sigset_t, __info: *mut ::siginfo_t) -> ::c_int;
+    pub fn SignalWaitinfoMask(
+        __set: *const ::sigset_t,
+        __info: *mut ::siginfo_t,
+        __mask: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn SignalWaitinfoMask_r(
+        __set: *const ::sigset_t,
+        __info: *mut ::siginfo_t,
+        __mask: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn ThreadCreate(
+        __pid: ::pid_t,
+        __func: unsafe extern "C" fn(__arg: *mut ::c_void) -> *mut ::c_void,
+        __arg: *mut ::c_void,
+        __attr: *const ::_thread_attr,
+    ) -> ::c_int;
+    pub fn ThreadCreate_r(
+        __pid: ::pid_t,
+        __func: unsafe extern "C" fn(__arg: *mut ::c_void) -> *mut ::c_void,
+        __arg: *mut ::c_void,
+        __attr: *const ::_thread_attr,
+    ) -> ::c_int;
+
+    pub fn ThreadDestroy(__tid: ::c_int, __priority: ::c_int, __status: *mut ::c_void) -> ::c_int;
+    pub fn ThreadDestroy_r(__tid: ::c_int, __priority: ::c_int, __status: *mut ::c_void)
+        -> ::c_int;
+    pub fn ThreadDetach(__tid: ::c_int) -> ::c_int;
+    pub fn ThreadDetach_r(__tid: ::c_int) -> ::c_int;
+    pub fn ThreadJoin(__tid: ::c_int, __status: *mut *mut ::c_void) -> ::c_int;
+    pub fn ThreadJoin_r(__tid: ::c_int, __status: *mut *mut ::c_void) -> ::c_int;
+    pub fn ThreadCancel(__tid: ::c_int, __canstub: unsafe extern "C" fn()) -> ::c_int;
+    pub fn ThreadCancel_r(__tid: ::c_int, __canstub: unsafe extern "C" fn()) -> ::c_int;
+    pub fn ThreadCtl(__cmd: ::c_int, __data: *mut ::c_void) -> ::c_int;
+    pub fn ThreadCtl_r(__cmd: ::c_int, __data: *mut ::c_void) -> ::c_int;
+    pub fn ThreadCtlExt(
+        __pid: ::pid_t,
+        __tid: ::c_int,
+        __cmd: ::c_int,
+        __data: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn ThreadCtlExt_r(
+        __pid: ::pid_t,
+        __tid: ::c_int,
+        __cmd: ::c_int,
+        __data: *mut ::c_void,
+    ) -> ::c_int;
+
+    pub fn InterruptHookTrace(
+        __handler: ::Option<unsafe extern "C" fn(arg1: ::c_int) -> *const ::sigevent>,
+        __flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn InterruptHookIdle(
+        __handler: ::Option<unsafe extern "C" fn(arg1: *mut u64, arg2: *mut qtime_entry)>,
+        __flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn InterruptHookIdle2(
+        __handler: ::Option<
+            unsafe extern "C" fn(arg1: ::c_uint, arg2: *mut syspage_entry, arg3: *mut _idle_hook),
+        >,
+        __flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn InterruptHookOverdriveEvent(__event: *const ::sigevent, __flags: ::c_uint) -> ::c_int;
+    pub fn InterruptAttachEvent(
+        __intr: ::c_int,
+        __event: *const ::sigevent,
+        __flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn InterruptAttachEvent_r(
+        __intr: ::c_int,
+        __event: *const ::sigevent,
+        __flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn InterruptAttach(
+        __intr: ::c_int,
+        __handler: ::Option<
+            unsafe extern "C" fn(__area: *mut ::c_void, __id: ::c_int) -> *const ::sigevent,
+        >,
+        __area: *const ::c_void,
+        __size: ::c_int,
+        __flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn InterruptAttach_r(
+        __intr: ::c_int,
+        __handler: ::Option<
+            unsafe extern "C" fn(__area: *mut ::c_void, __id: ::c_int) -> *const ::sigevent,
+        >,
+        __area: *const ::c_void,
+        __size: ::c_int,
+        __flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn InterruptAttachArray(
+        __intr: ::c_int,
+        __handler: ::Option<
+            unsafe extern "C" fn(__area: *mut ::c_void, __id: ::c_int) -> *const *const ::sigevent,
+        >,
+        __area: *const ::c_void,
+        __size: ::c_int,
+        __flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn InterruptAttachArray_r(
+        __intr: ::c_int,
+        __handler: ::Option<
+            unsafe extern "C" fn(__area: *mut ::c_void, __id: ::c_int) -> *const *const ::sigevent,
+        >,
+        __area: *const ::c_void,
+        __size: ::c_int,
+        __flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn InterruptDetach(__id: ::c_int) -> ::c_int;
+    pub fn InterruptDetach_r(__id: ::c_int) -> ::c_int;
+    pub fn InterruptWait(__flags: ::c_int, __timeout: *const u64) -> ::c_int;
+    pub fn InterruptWait_r(__flags: ::c_int, __timeout: *const u64) -> ::c_int;
+    pub fn InterruptCharacteristic(
+        __type: ::c_int,
+        __id: ::c_int,
+        __new: *mut ::c_uint,
+        __old: *mut ::c_uint,
+    ) -> ::c_int;
+    pub fn InterruptCharacteristic_r(
+        __type: ::c_int,
+        __id: ::c_int,
+        __new: *mut ::c_uint,
+        __old: *mut ::c_uint,
+    ) -> ::c_int;
+
+    pub fn SchedGet(__pid: ::pid_t, __tid: ::c_int, __param: *mut ::sched_param) -> ::c_int;
+    pub fn SchedGet_r(__pid: ::pid_t, __tid: ::c_int, __param: *mut ::sched_param) -> ::c_int;
+    pub fn SchedGetCpuNum() -> ::c_uint;
+    pub fn SchedSet(
+        __pid: ::pid_t,
+        __tid: ::c_int,
+        __algorithm: ::c_int,
+        __param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn SchedSet_r(
+        __pid: ::pid_t,
+        __tid: ::c_int,
+        __algorithm: ::c_int,
+        __param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn SchedInfo(__pid: ::pid_t, __algorithm: ::c_int, __info: *mut ::_sched_info) -> ::c_int;
+    pub fn SchedInfo_r(__pid: ::pid_t, __algorithm: ::c_int, __info: *mut ::_sched_info)
+        -> ::c_int;
+    pub fn SchedYield() -> ::c_int;
+    pub fn SchedYield_r() -> ::c_int;
+    pub fn SchedCtl(__cmd: ::c_int, __data: *mut ::c_void, __length: usize) -> ::c_int;
+    pub fn SchedCtl_r(__cmd: ::c_int, __data: *mut ::c_void, __length: usize) -> ::c_int;
+    pub fn SchedJobCreate(__job: *mut nto_job_t) -> ::c_int;
+    pub fn SchedJobCreate_r(__job: *mut nto_job_t) -> ::c_int;
+    pub fn SchedJobDestroy(__job: *mut nto_job_t) -> ::c_int;
+    pub fn SchedJobDestroy_r(__job: *mut nto_job_t) -> ::c_int;
+    pub fn SchedWaypoint(
+        __job: *mut nto_job_t,
+        __new: *const i64,
+        __max: *const i64,
+        __old: *mut i64,
+    ) -> ::c_int;
+    pub fn SchedWaypoint_r(
+        __job: *mut nto_job_t,
+        __new: *const i64,
+        __max: *const i64,
+        __old: *mut i64,
+    ) -> ::c_int;
+
+    pub fn TimerCreate(__id: ::clockid_t, __notify: *const ::sigevent) -> ::c_int;
+    pub fn TimerCreate_r(__id: ::clockid_t, __notify: *const ::sigevent) -> ::c_int;
+    pub fn TimerDestroy(__id: ::timer_t) -> ::c_int;
+    pub fn TimerDestroy_r(__id: ::timer_t) -> ::c_int;
+    pub fn TimerSettime(
+        __id: ::timer_t,
+        __flags: ::c_int,
+        __itime: *const ::_itimer,
+        __oitime: *mut ::_itimer,
+    ) -> ::c_int;
+    pub fn TimerSettime_r(
+        __id: ::timer_t,
+        __flags: ::c_int,
+        __itime: *const ::_itimer,
+        __oitime: *mut ::_itimer,
+    ) -> ::c_int;
+    pub fn TimerInfo(
+        __pid: ::pid_t,
+        __id: ::timer_t,
+        __flags: ::c_int,
+        __info: *mut ::_timer_info,
+    ) -> ::c_int;
+    pub fn TimerInfo_r(
+        __pid: ::pid_t,
+        __id: ::timer_t,
+        __flags: ::c_int,
+        __info: *mut ::_timer_info,
+    ) -> ::c_int;
+    pub fn TimerAlarm(
+        __id: ::clockid_t,
+        __itime: *const ::_itimer,
+        __otime: *mut ::_itimer,
+    ) -> ::c_int;
+    pub fn TimerAlarm_r(
+        __id: ::clockid_t,
+        __itime: *const ::_itimer,
+        __otime: *mut ::_itimer,
+    ) -> ::c_int;
+    pub fn TimerTimeout(
+        __id: ::clockid_t,
+        __flags: ::c_int,
+        __notify: *const ::sigevent,
+        __ntime: *const u64,
+        __otime: *mut u64,
+    ) -> ::c_int;
+    pub fn TimerTimeout_r(
+        __id: ::clockid_t,
+        __flags: ::c_int,
+        __notify: *const ::sigevent,
+        __ntime: *const u64,
+        __otime: *mut u64,
+    ) -> ::c_int;
+
+    pub fn SyncTypeCreate(
+        __type: ::c_uint,
+        __sync: *mut ::sync_t,
+        __attr: *const ::_sync_attr,
+    ) -> ::c_int;
+    pub fn SyncTypeCreate_r(
+        __type: ::c_uint,
+        __sync: *mut ::sync_t,
+        __attr: *const ::_sync_attr,
+    ) -> ::c_int;
+    pub fn SyncDestroy(__sync: *mut ::sync_t) -> ::c_int;
+    pub fn SyncDestroy_r(__sync: *mut ::sync_t) -> ::c_int;
+    pub fn SyncCtl(__cmd: ::c_int, __sync: *mut ::sync_t, __data: *mut ::c_void) -> ::c_int;
+    pub fn SyncCtl_r(__cmd: ::c_int, __sync: *mut ::sync_t, __data: *mut ::c_void) -> ::c_int;
+    pub fn SyncMutexEvent(__sync: *mut ::sync_t, event: *const ::sigevent) -> ::c_int;
+    pub fn SyncMutexEvent_r(__sync: *mut ::sync_t, event: *const ::sigevent) -> ::c_int;
+    pub fn SyncMutexLock(__sync: *mut ::sync_t) -> ::c_int;
+    pub fn SyncMutexLock_r(__sync: *mut ::sync_t) -> ::c_int;
+    pub fn SyncMutexUnlock(__sync: *mut ::sync_t) -> ::c_int;
+    pub fn SyncMutexUnlock_r(__sync: *mut ::sync_t) -> ::c_int;
+    pub fn SyncMutexRevive(__sync: *mut ::sync_t) -> ::c_int;
+    pub fn SyncMutexRevive_r(__sync: *mut ::sync_t) -> ::c_int;
+    pub fn SyncCondvarWait(__sync: *mut ::sync_t, __mutex: *mut ::sync_t) -> ::c_int;
+    pub fn SyncCondvarWait_r(__sync: *mut ::sync_t, __mutex: *mut ::sync_t) -> ::c_int;
+    pub fn SyncCondvarSignal(__sync: *mut ::sync_t, __all: ::c_int) -> ::c_int;
+    pub fn SyncCondvarSignal_r(__sync: *mut ::sync_t, __all: ::c_int) -> ::c_int;
+    pub fn SyncSemPost(__sync: *mut ::sync_t) -> ::c_int;
+    pub fn SyncSemPost_r(__sync: *mut ::sync_t) -> ::c_int;
+    pub fn SyncSemWait(__sync: *mut ::sync_t, __tryto: ::c_int) -> ::c_int;
+    pub fn SyncSemWait_r(__sync: *mut ::sync_t, __tryto: ::c_int) -> ::c_int;
+
+    pub fn ClockTime(__id: ::clockid_t, _new: *const u64, __old: *mut u64) -> ::c_int;
+    pub fn ClockTime_r(__id: ::clockid_t, _new: *const u64, __old: *mut u64) -> ::c_int;
+    pub fn ClockAdjust(
+        __id: ::clockid_t,
+        _new: *const ::_clockadjust,
+        __old: *mut ::_clockadjust,
+    ) -> ::c_int;
+    pub fn ClockAdjust_r(
+        __id: ::clockid_t,
+        _new: *const ::_clockadjust,
+        __old: *mut ::_clockadjust,
+    ) -> ::c_int;
+    pub fn ClockPeriod(
+        __id: ::clockid_t,
+        _new: *const ::_clockperiod,
+        __old: *mut ::_clockperiod,
+        __reserved: ::c_int,
+    ) -> ::c_int;
+    pub fn ClockPeriod_r(
+        __id: ::clockid_t,
+        _new: *const ::_clockperiod,
+        __old: *mut ::_clockperiod,
+        __reserved: ::c_int,
+    ) -> ::c_int;
+    pub fn ClockId(__pid: ::pid_t, __tid: ::c_int) -> ::c_int;
+    pub fn ClockId_r(__pid: ::pid_t, __tid: ::c_int) -> ::c_int;
+
+    //
+    //TODO: The following commented out functions are implemented in assembly.
+    //      We can implmement them either via a C stub or rust's inline assembly.
+    //
+    //pub fn InterruptEnable();
+    //pub fn InterruptDisable();
+    pub fn InterruptMask(__intr: ::c_int, __id: ::c_int) -> ::c_int;
+    pub fn InterruptUnmask(__intr: ::c_int, __id: ::c_int) -> ::c_int;
+    //pub fn InterruptLock(__spin: *mut ::intrspin);
+    //pub fn InterruptUnlock(__spin: *mut ::intrspin);
+    //pub fn InterruptStatus() -> ::c_uint;
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/nto/x86_64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/nto/x86_64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/nto/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/nto/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,132 @@
+pub type c_char = i8;
+pub type wchar_t = u32;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type time_t = i64;
+
+s! {
+    #[repr(align(8))]
+    pub struct x86_64_cpu_registers {
+        pub rdi: u64,
+        pub rsi: u64,
+        pub rdx: u64,
+        pub r10: u64,
+        pub r8: u64,
+        pub r9: u64,
+        pub rax: u64,
+        pub rbx: u64,
+        pub rbp: u64,
+        pub rcx: u64,
+        pub r11: u64,
+        pub r12: u64,
+        pub r13: u64,
+        pub r14: u64,
+        pub r15: u64,
+        pub rip: u64,
+        pub cs: u32,
+        rsvd1: u32,
+        pub rflags: u64,
+        pub rsp: u64,
+        pub ss: u32,
+        rsvd2: u32,
+    }
+
+    #[repr(align(8))]
+    pub struct mcontext_t {
+        pub cpu: x86_64_cpu_registers,
+        #[cfg(libc_union)]
+        pub fpu: x86_64_fpu_registers,
+        #[cfg(not(libc_union))]
+        __reserved: [u8; 1024],
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_size: ::size_t,
+        pub ss_flags: ::c_int,
+    }
+
+    pub struct fsave_area_64 {
+        pub fpu_control_word: u32,
+        pub fpu_status_word: u32,
+        pub fpu_tag_word: u32,
+        pub fpu_ip: u32,
+        pub fpu_cs: u32,
+        pub fpu_op: u32,
+        pub fpu_ds: u32,
+        pub st_regs: [u8; 80],
+   }
+
+    pub struct fxsave_area_64 {
+        pub fpu_control_word: u16,
+        pub fpu_status_word: u16,
+        pub fpu_tag_word: u16,
+        pub fpu_operand: u16,
+        pub fpu_rip: u64,
+        pub fpu_rdp: u64,
+        pub mxcsr: u32,
+        pub mxcsr_mask: u32,
+        pub st_regs: [u8; 128],
+        pub xmm_regs: [u8; 128],
+        reserved2: [u8; 224],
+    }
+
+    pub struct fpu_extention_savearea_64 {
+        pub other: [u8; 512],
+        pub xstate_bv: u64,
+        pub xstate_undef: [u64; 7],
+        pub xstate_info: [u8; 224],
+    }
+}
+
+s_no_extra_traits! {
+    #[cfg(libc_union)]
+    pub union x86_64_fpu_registers {
+        pub fsave_area: fsave_area_64,
+        pub fxsave_area: fxsave_area_64,
+        pub xsave_area: fpu_extention_savearea_64,
+        pub data: [u8; 1024],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        #[cfg(libc_union)]
+        impl Eq for x86_64_fpu_registers {}
+
+        #[cfg(libc_union)]
+        impl PartialEq for x86_64_fpu_registers {
+            fn eq(&self, other: &x86_64_fpu_registers) -> bool {
+                unsafe {
+                    self.fsave_area == other.fsave_area
+                        || self.fxsave_area == other.fxsave_area
+                        || self.xsave_area == other.xsave_area
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for x86_64_fpu_registers {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                    f.debug_struct("x86_64_fpu_registers")
+                        .field("fsave_area", &self.fsave_area)
+                        .field("fxsave_area", &self.fxsave_area)
+                        .field("xsave_area", &self.xsave_area)
+                        .finish()
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::hash::Hash for x86_64_fpu_registers {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                    self.fsave_area.hash(state);
+                    self.fxsave_area.hash(state);
+                    self.xsave_area.hash(state);
+                }
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/redox/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/redox/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/redox/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/redox/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1416 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
+
+cfg_if! {
+    if #[cfg(target_pointer_width = "32")] {
+        pub type c_long = i32;
+        pub type c_ulong = u32;
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_pointer_width = "64")] {
+        pub type c_long = i64;
+        pub type c_ulong = u64;
+    }
+}
+
+pub type blkcnt_t = ::c_ulong;
+pub type blksize_t = ::c_long;
+pub type clock_t = ::c_long;
+pub type clockid_t = ::c_int;
+pub type dev_t = ::c_long;
+pub type fsblkcnt_t = ::c_ulong;
+pub type fsfilcnt_t = ::c_ulong;
+pub type ino_t = ::c_ulong;
+pub type mode_t = ::c_int;
+pub type nfds_t = ::c_ulong;
+pub type nlink_t = ::c_ulong;
+pub type off_t = ::c_longlong;
+pub type pthread_t = *mut ::c_void;
+// Must be usize due to library/std/sys_common/thread_local.rs,
+// should technically be *mut ::c_void
+pub type pthread_key_t = usize;
+pub type rlim_t = ::c_ulonglong;
+pub type sa_family_t = u16;
+pub type sem_t = *mut ::c_void;
+pub type sigset_t = ::c_ulonglong;
+pub type socklen_t = u32;
+pub type speed_t = u32;
+pub type suseconds_t = ::c_int;
+pub type tcflag_t = u32;
+pub type time_t = ::c_longlong;
+pub type id_t = ::c_uint;
+pub type pid_t = usize;
+pub type uid_t = u32;
+pub type gid_t = u32;
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum timezone {}
+impl ::Copy for timezone {}
+impl ::Clone for timezone {
+    fn clone(&self) -> timezone {
+        *self
+    }
+}
+
+s_no_extra_traits! {
+    #[repr(C)]
+    pub struct utsname {
+        pub sysname: [::c_char; UTSLENGTH],
+        pub nodename: [::c_char; UTSLENGTH],
+        pub release: [::c_char; UTSLENGTH],
+        pub version: [::c_char; UTSLENGTH],
+        pub machine: [::c_char; UTSLENGTH],
+        pub domainname: [::c_char; UTSLENGTH],
+    }
+
+    pub struct dirent {
+        pub d_ino: ::ino_t,
+        pub d_off: ::off_t,
+        pub d_reclen: ::c_ushort,
+        pub d_type: ::c_uchar,
+        pub d_name: [::c_char; 256],
+    }
+
+    pub struct sockaddr_un {
+        pub sun_family: ::sa_family_t,
+        pub sun_path: [::c_char; 108]
+    }
+
+    pub struct sockaddr_storage {
+        pub ss_family: ::sa_family_t,
+        __ss_padding: [
+            u8;
+            128 -
+            ::core::mem::size_of::<sa_family_t>() -
+            ::core::mem::size_of::<c_ulong>()
+        ],
+        __ss_align: ::c_ulong,
+    }
+}
+
+s! {
+    pub struct addrinfo {
+        pub ai_flags: ::c_int,
+        pub ai_family: ::c_int,
+        pub ai_socktype: ::c_int,
+        pub ai_protocol: ::c_int,
+        pub ai_addrlen: ::size_t,
+        pub ai_canonname: *mut ::c_char,
+        pub ai_addr: *mut ::sockaddr,
+        pub ai_next: *mut ::addrinfo,
+    }
+
+    pub struct Dl_info {
+        pub dli_fname: *const ::c_char,
+        pub dli_fbase: *mut ::c_void,
+        pub dli_sname: *const ::c_char,
+        pub dli_saddr: *mut ::c_void,
+    }
+
+    pub struct epoll_event {
+        pub events: u32,
+        pub u64: u64,
+        pub _pad: u64,
+    }
+
+    pub struct fd_set {
+        fds_bits: [::c_ulong; ::FD_SETSIZE / ULONG_SIZE],
+    }
+
+    pub struct in_addr {
+        pub s_addr: ::in_addr_t,
+    }
+
+    pub struct ip_mreq {
+        pub imr_multiaddr: ::in_addr,
+        pub imr_interface: ::in_addr,
+    }
+
+    pub struct lconv {
+        pub currency_symbol: *const ::c_char,
+        pub decimal_point: *const ::c_char,
+        pub frac_digits: ::c_char,
+        pub grouping: *const ::c_char,
+        pub int_curr_symbol: *const ::c_char,
+        pub int_frac_digits: ::c_char,
+        pub mon_decimal_point: *const ::c_char,
+        pub mon_grouping: *const ::c_char,
+        pub mon_thousands_sep: *const ::c_char,
+        pub negative_sign: *const ::c_char,
+        pub n_cs_precedes: ::c_char,
+        pub n_sep_by_space: ::c_char,
+        pub n_sign_posn: ::c_char,
+        pub positive_sign: *const ::c_char,
+        pub p_cs_precedes: ::c_char,
+        pub p_sep_by_space: ::c_char,
+        pub p_sign_posn: ::c_char,
+        pub thousands_sep: *const ::c_char,
+    }
+
+    pub struct passwd {
+        pub pw_name: *mut ::c_char,
+        pub pw_passwd: *mut ::c_char,
+        pub pw_uid: ::uid_t,
+        pub pw_gid: ::gid_t,
+        pub pw_gecos: *mut ::c_char,
+        pub pw_dir: *mut ::c_char,
+        pub pw_shell: *mut ::c_char,
+    }
+
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_flags: ::c_ulong,
+        pub sa_restorer: ::Option<extern fn()>,
+        pub sa_mask: ::sigset_t,
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_errno: ::c_int,
+        pub si_code: ::c_int,
+        _pad: [::c_int; 29],
+        _align: [usize; 0],
+    }
+
+    pub struct sockaddr {
+        pub sa_family: ::sa_family_t,
+        pub sa_data: [::c_char; 14],
+    }
+
+    pub struct sockaddr_in {
+        pub sin_family: ::sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [::c_char; 8],
+    }
+
+    pub struct sockaddr_in6 {
+        pub sin6_family: ::sa_family_t,
+        pub sin6_port: ::in_port_t,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_scope_id: u32,
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        _pad: [::c_char; 24],
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::NCCS],
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::speed_t,
+    }
+
+    pub struct tm {
+        pub tm_sec: ::c_int,
+        pub tm_min: ::c_int,
+        pub tm_hour: ::c_int,
+        pub tm_mday: ::c_int,
+        pub tm_mon: ::c_int,
+        pub tm_year: ::c_int,
+        pub tm_wday: ::c_int,
+        pub tm_yday: ::c_int,
+        pub tm_isdst: ::c_int,
+        pub tm_gmtoff: ::c_long,
+        pub tm_zone: *const ::c_char,
+    }
+
+    pub struct ucred {
+        pub pid: pid_t,
+        pub uid: uid_t,
+        pub gid: gid_t,
+    }
+
+    #[cfg_attr(target_pointer_width = "32", repr(C, align(4)))]
+    #[cfg_attr(target_pointer_width = "64", repr(C, align(8)))]
+    pub struct pthread_attr_t {
+        bytes: [u8; _PTHREAD_ATTR_SIZE],
+    }
+    #[repr(C)]
+    #[repr(align(4))]
+    pub struct pthread_barrier_t {
+        bytes: [u8; _PTHREAD_BARRIER_SIZE],
+    }
+    #[repr(C)]
+    #[repr(align(4))]
+    pub struct pthread_barrierattr_t {
+        bytes: [u8; _PTHREAD_BARRIERATTR_SIZE],
+    }
+    #[repr(C)]
+    #[repr(align(4))]
+    pub struct pthread_mutex_t {
+        bytes: [u8; _PTHREAD_MUTEX_SIZE],
+    }
+    #[repr(C)]
+    #[repr(align(4))]
+    pub struct pthread_rwlock_t {
+        bytes: [u8; _PTHREAD_RWLOCK_SIZE],
+    }
+    #[repr(C)]
+    #[repr(align(4))]
+    pub struct pthread_mutexattr_t {
+        bytes: [u8; _PTHREAD_MUTEXATTR_SIZE],
+    }
+    #[repr(C)]
+    #[repr(align(1))]
+    pub struct pthread_rwlockattr_t {
+        bytes: [u8; _PTHREAD_RWLOCKATTR_SIZE],
+    }
+    #[repr(C)]
+    #[repr(align(4))]
+    pub struct pthread_cond_t {
+        bytes: [u8; _PTHREAD_COND_SIZE],
+    }
+    #[repr(C)]
+    #[repr(align(4))]
+    pub struct pthread_condattr_t {
+        bytes: [u8; _PTHREAD_CONDATTR_SIZE],
+    }
+    #[repr(C)]
+    #[repr(align(4))]
+    pub struct pthread_once_t {
+        bytes: [u8; _PTHREAD_ONCE_SIZE],
+    }
+    #[repr(C)]
+    #[repr(align(4))]
+    pub struct pthread_spinlock_t {
+        bytes: [u8; _PTHREAD_SPINLOCK_SIZE],
+    }
+}
+const _PTHREAD_ATTR_SIZE: usize = 32;
+const _PTHREAD_RWLOCKATTR_SIZE: usize = 1;
+const _PTHREAD_RWLOCK_SIZE: usize = 4;
+const _PTHREAD_BARRIER_SIZE: usize = 24;
+const _PTHREAD_BARRIERATTR_SIZE: usize = 4;
+const _PTHREAD_CONDATTR_SIZE: usize = 8;
+const _PTHREAD_COND_SIZE: usize = 8;
+const _PTHREAD_MUTEX_SIZE: usize = 12;
+const _PTHREAD_MUTEXATTR_SIZE: usize = 20;
+const _PTHREAD_ONCE_SIZE: usize = 4;
+const _PTHREAD_SPINLOCK_SIZE: usize = 4;
+
+pub const UTSLENGTH: usize = 65;
+
+// intentionally not public, only used for fd_set
+cfg_if! {
+    if #[cfg(target_pointer_width = "32")] {
+        const ULONG_SIZE: usize = 32;
+    } else if #[cfg(target_pointer_width = "64")] {
+        const ULONG_SIZE: usize = 64;
+    } else {
+        // Unknown target_pointer_width
+    }
+}
+
+// limits.h
+pub const PATH_MAX: ::c_int = 4096;
+
+// fcntl.h
+pub const F_GETLK: ::c_int = 5;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+pub const F_ULOCK: ::c_int = 0;
+pub const F_LOCK: ::c_int = 1;
+pub const F_TLOCK: ::c_int = 2;
+pub const F_TEST: ::c_int = 3;
+
+// FIXME: relibc {
+pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
+// }
+
+// dlfcn.h
+pub const RTLD_LAZY: ::c_int = 0x0001;
+pub const RTLD_NOW: ::c_int = 0x0002;
+pub const RTLD_GLOBAL: ::c_int = 0x0100;
+pub const RTLD_LOCAL: ::c_int = 0x0000;
+
+// errno.h
+pub const EPERM: ::c_int = 1; /* Operation not permitted */
+pub const ENOENT: ::c_int = 2; /* No such file or directory */
+pub const ESRCH: ::c_int = 3; /* No such process */
+pub const EINTR: ::c_int = 4; /* Interrupted system call */
+pub const EIO: ::c_int = 5; /* I/O error */
+pub const ENXIO: ::c_int = 6; /* No such device or address */
+pub const E2BIG: ::c_int = 7; /* Argument list too long */
+pub const ENOEXEC: ::c_int = 8; /* Exec format error */
+pub const EBADF: ::c_int = 9; /* Bad file number */
+pub const ECHILD: ::c_int = 10; /* No child processes */
+pub const EAGAIN: ::c_int = 11; /* Try again */
+pub const ENOMEM: ::c_int = 12; /* Out of memory */
+pub const EACCES: ::c_int = 13; /* Permission denied */
+pub const EFAULT: ::c_int = 14; /* Bad address */
+pub const ENOTBLK: ::c_int = 15; /* Block device required */
+pub const EBUSY: ::c_int = 16; /* Device or resource busy */
+pub const EEXIST: ::c_int = 17; /* File exists */
+pub const EXDEV: ::c_int = 18; /* Cross-device link */
+pub const ENODEV: ::c_int = 19; /* No such device */
+pub const ENOTDIR: ::c_int = 20; /* Not a directory */
+pub const EISDIR: ::c_int = 21; /* Is a directory */
+pub const EINVAL: ::c_int = 22; /* Invalid argument */
+pub const ENFILE: ::c_int = 23; /* File table overflow */
+pub const EMFILE: ::c_int = 24; /* Too many open files */
+pub const ENOTTY: ::c_int = 25; /* Not a typewriter */
+pub const ETXTBSY: ::c_int = 26; /* Text file busy */
+pub const EFBIG: ::c_int = 27; /* File too large */
+pub const ENOSPC: ::c_int = 28; /* No space left on device */
+pub const ESPIPE: ::c_int = 29; /* Illegal seek */
+pub const EROFS: ::c_int = 30; /* Read-only file system */
+pub const EMLINK: ::c_int = 31; /* Too many links */
+pub const EPIPE: ::c_int = 32; /* Broken pipe */
+pub const EDOM: ::c_int = 33; /* Math argument out of domain of func */
+pub const ERANGE: ::c_int = 34; /* Math result not representable */
+pub const EDEADLK: ::c_int = 35; /* Resource deadlock would occur */
+pub const ENAMETOOLONG: ::c_int = 36; /* File name too long */
+pub const ENOLCK: ::c_int = 37; /* No record locks available */
+pub const ENOSYS: ::c_int = 38; /* Function not implemented */
+pub const ENOTEMPTY: ::c_int = 39; /* Directory not empty */
+pub const ELOOP: ::c_int = 40; /* Too many symbolic links encountered */
+pub const EWOULDBLOCK: ::c_int = 41; /* Operation would block */
+pub const ENOMSG: ::c_int = 42; /* No message of desired type */
+pub const EIDRM: ::c_int = 43; /* Identifier removed */
+pub const ECHRNG: ::c_int = 44; /* Channel number out of range */
+pub const EL2NSYNC: ::c_int = 45; /* Level 2 not synchronized */
+pub const EL3HLT: ::c_int = 46; /* Level 3 halted */
+pub const EL3RST: ::c_int = 47; /* Level 3 reset */
+pub const ELNRNG: ::c_int = 48; /* Link number out of range */
+pub const EUNATCH: ::c_int = 49; /* Protocol driver not attached */
+pub const ENOCSI: ::c_int = 50; /* No CSI structure available */
+pub const EL2HLT: ::c_int = 51; /* Level 2 halted */
+pub const EBADE: ::c_int = 52; /* Invalid exchange */
+pub const EBADR: ::c_int = 53; /* Invalid request descriptor */
+pub const EXFULL: ::c_int = 54; /* Exchange full */
+pub const ENOANO: ::c_int = 55; /* No anode */
+pub const EBADRQC: ::c_int = 56; /* Invalid request code */
+pub const EBADSLT: ::c_int = 57; /* Invalid slot */
+pub const EDEADLOCK: ::c_int = 58; /* Resource deadlock would occur */
+pub const EBFONT: ::c_int = 59; /* Bad font file format */
+pub const ENOSTR: ::c_int = 60; /* Device not a stream */
+pub const ENODATA: ::c_int = 61; /* No data available */
+pub const ETIME: ::c_int = 62; /* Timer expired */
+pub const ENOSR: ::c_int = 63; /* Out of streams resources */
+pub const ENONET: ::c_int = 64; /* Machine is not on the network */
+pub const ENOPKG: ::c_int = 65; /* Package not installed */
+pub const EREMOTE: ::c_int = 66; /* Object is remote */
+pub const ENOLINK: ::c_int = 67; /* Link has been severed */
+pub const EADV: ::c_int = 68; /* Advertise error */
+pub const ESRMNT: ::c_int = 69; /* Srmount error */
+pub const ECOMM: ::c_int = 70; /* Communication error on send */
+pub const EPROTO: ::c_int = 71; /* Protocol error */
+pub const EMULTIHOP: ::c_int = 72; /* Multihop attempted */
+pub const EDOTDOT: ::c_int = 73; /* RFS specific error */
+pub const EBADMSG: ::c_int = 74; /* Not a data message */
+pub const EOVERFLOW: ::c_int = 75; /* Value too large for defined data type */
+pub const ENOTUNIQ: ::c_int = 76; /* Name not unique on network */
+pub const EBADFD: ::c_int = 77; /* File descriptor in bad state */
+pub const EREMCHG: ::c_int = 78; /* Remote address changed */
+pub const ELIBACC: ::c_int = 79; /* Can not access a needed shared library */
+pub const ELIBBAD: ::c_int = 80; /* Accessing a corrupted shared library */
+pub const ELIBSCN: ::c_int = 81; /* .lib section in a.out corrupted */
+/* Attempting to link in too many shared libraries */
+pub const ELIBMAX: ::c_int = 82;
+pub const ELIBEXEC: ::c_int = 83; /* Cannot exec a shared library directly */
+pub const EILSEQ: ::c_int = 84; /* Illegal byte sequence */
+/* Interrupted system call should be restarted */
+pub const ERESTART: ::c_int = 85;
+pub const ESTRPIPE: ::c_int = 86; /* Streams pipe error */
+pub const EUSERS: ::c_int = 87; /* Too many users */
+pub const ENOTSOCK: ::c_int = 88; /* Socket operation on non-socket */
+pub const EDESTADDRREQ: ::c_int = 89; /* Destination address required */
+pub const EMSGSIZE: ::c_int = 90; /* Message too long */
+pub const EPROTOTYPE: ::c_int = 91; /* Protocol wrong type for socket */
+pub const ENOPROTOOPT: ::c_int = 92; /* Protocol not available */
+pub const EPROTONOSUPPORT: ::c_int = 93; /* Protocol not supported */
+pub const ESOCKTNOSUPPORT: ::c_int = 94; /* Socket type not supported */
+/* Operation not supported on transport endpoint */
+pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 96; /* Protocol family not supported */
+/* Address family not supported by protocol */
+pub const EAFNOSUPPORT: ::c_int = 97;
+pub const EADDRINUSE: ::c_int = 98; /* Address already in use */
+pub const EADDRNOTAVAIL: ::c_int = 99; /* Cannot assign requested address */
+pub const ENETDOWN: ::c_int = 100; /* Network is down */
+pub const ENETUNREACH: ::c_int = 101; /* Network is unreachable */
+/* Network dropped connection because of reset */
+pub const ENETRESET: ::c_int = 102;
+pub const ECONNABORTED: ::c_int = 103; /* Software caused connection abort */
+pub const ECONNRESET: ::c_int = 104; /* Connection reset by peer */
+pub const ENOBUFS: ::c_int = 105; /* No buffer space available */
+pub const EISCONN: ::c_int = 106; /* Transport endpoint is already connected */
+pub const ENOTCONN: ::c_int = 107; /* Transport endpoint is not connected */
+/* Cannot send after transport endpoint shutdown */
+pub const ESHUTDOWN: ::c_int = 108;
+pub const ETOOMANYREFS: ::c_int = 109; /* Too many references: cannot splice */
+pub const ETIMEDOUT: ::c_int = 110; /* Connection timed out */
+pub const ECONNREFUSED: ::c_int = 111; /* Connection refused */
+pub const EHOSTDOWN: ::c_int = 112; /* Host is down */
+pub const EHOSTUNREACH: ::c_int = 113; /* No route to host */
+pub const EALREADY: ::c_int = 114; /* Operation already in progress */
+pub const EINPROGRESS: ::c_int = 115; /* Operation now in progress */
+pub const ESTALE: ::c_int = 116; /* Stale NFS file handle */
+pub const EUCLEAN: ::c_int = 117; /* Structure needs cleaning */
+pub const ENOTNAM: ::c_int = 118; /* Not a XENIX named type file */
+pub const ENAVAIL: ::c_int = 119; /* No XENIX semaphores available */
+pub const EISNAM: ::c_int = 120; /* Is a named type file */
+pub const EREMOTEIO: ::c_int = 121; /* Remote I/O error */
+pub const EDQUOT: ::c_int = 122; /* Quota exceeded */
+pub const ENOMEDIUM: ::c_int = 123; /* No medium found */
+pub const EMEDIUMTYPE: ::c_int = 124; /* Wrong medium type */
+pub const ECANCELED: ::c_int = 125; /* Operation Canceled */
+pub const ENOKEY: ::c_int = 126; /* Required key not available */
+pub const EKEYEXPIRED: ::c_int = 127; /* Key has expired */
+pub const EKEYREVOKED: ::c_int = 128; /* Key has been revoked */
+pub const EKEYREJECTED: ::c_int = 129; /* Key was rejected by service */
+pub const EOWNERDEAD: ::c_int = 130; /* Owner died */
+pub const ENOTRECOVERABLE: ::c_int = 131; /* State not recoverable */
+
+// fcntl.h
+pub const F_DUPFD: ::c_int = 0;
+pub const F_GETFD: ::c_int = 1;
+pub const F_SETFD: ::c_int = 2;
+pub const F_GETFL: ::c_int = 3;
+pub const F_SETFL: ::c_int = 4;
+// FIXME: relibc {
+pub const F_DUPFD_CLOEXEC: ::c_int = ::F_DUPFD;
+// }
+pub const FD_CLOEXEC: ::c_int = 0x0100_0000;
+pub const O_RDONLY: ::c_int = 0x0001_0000;
+pub const O_WRONLY: ::c_int = 0x0002_0000;
+pub const O_RDWR: ::c_int = 0x0003_0000;
+pub const O_ACCMODE: ::c_int = 0x0003_0000;
+pub const O_NONBLOCK: ::c_int = 0x0004_0000;
+pub const O_APPEND: ::c_int = 0x0008_0000;
+pub const O_SHLOCK: ::c_int = 0x0010_0000;
+pub const O_EXLOCK: ::c_int = 0x0020_0000;
+pub const O_ASYNC: ::c_int = 0x0040_0000;
+pub const O_FSYNC: ::c_int = 0x0080_0000;
+pub const O_CLOEXEC: ::c_int = 0x0100_0000;
+pub const O_CREAT: ::c_int = 0x0200_0000;
+pub const O_TRUNC: ::c_int = 0x0400_0000;
+pub const O_EXCL: ::c_int = 0x0800_0000;
+pub const O_DIRECTORY: ::c_int = 0x1000_0000;
+pub const O_PATH: ::c_int = 0x2000_0000;
+pub const O_SYMLINK: ::c_int = 0x4000_0000;
+// Negative to allow it to be used as int
+// FIXME: Fix negative values missing from includes
+pub const O_NOFOLLOW: ::c_int = -0x8000_0000;
+
+// locale.h
+pub const LC_ALL: ::c_int = 0;
+pub const LC_COLLATE: ::c_int = 1;
+pub const LC_CTYPE: ::c_int = 2;
+pub const LC_MESSAGES: ::c_int = 3;
+pub const LC_MONETARY: ::c_int = 4;
+pub const LC_NUMERIC: ::c_int = 5;
+pub const LC_TIME: ::c_int = 6;
+
+// netdb.h
+pub const AI_PASSIVE: ::c_int = 0x0001;
+pub const AI_CANONNAME: ::c_int = 0x0002;
+pub const AI_NUMERICHOST: ::c_int = 0x0004;
+pub const AI_V4MAPPED: ::c_int = 0x0008;
+pub const AI_ALL: ::c_int = 0x0010;
+pub const AI_ADDRCONFIG: ::c_int = 0x0020;
+pub const AI_NUMERICSERV: ::c_int = 0x0400;
+pub const EAI_BADFLAGS: ::c_int = -1;
+pub const EAI_NONAME: ::c_int = -2;
+pub const EAI_AGAIN: ::c_int = -3;
+pub const EAI_FAIL: ::c_int = -4;
+pub const EAI_NODATA: ::c_int = -5;
+pub const EAI_FAMILY: ::c_int = -6;
+pub const EAI_SOCKTYPE: ::c_int = -7;
+pub const EAI_SERVICE: ::c_int = -8;
+pub const EAI_ADDRFAMILY: ::c_int = -9;
+pub const EAI_MEMORY: ::c_int = -10;
+pub const EAI_SYSTEM: ::c_int = -11;
+pub const EAI_OVERFLOW: ::c_int = -12;
+pub const NI_MAXHOST: ::c_int = 1025;
+pub const NI_MAXSERV: ::c_int = 32;
+pub const NI_NUMERICHOST: ::c_int = 0x0001;
+pub const NI_NUMERICSERV: ::c_int = 0x0002;
+pub const NI_NOFQDN: ::c_int = 0x0004;
+pub const NI_NAMEREQD: ::c_int = 0x0008;
+pub const NI_DGRAM: ::c_int = 0x0010;
+
+// netinet/in.h
+// FIXME: relibc {
+pub const IP_TTL: ::c_int = 2;
+pub const IPV6_UNICAST_HOPS: ::c_int = 16;
+pub const IPV6_MULTICAST_IF: ::c_int = 17;
+pub const IPV6_MULTICAST_HOPS: ::c_int = 18;
+pub const IPV6_MULTICAST_LOOP: ::c_int = 19;
+pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20;
+pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21;
+pub const IPV6_V6ONLY: ::c_int = 26;
+pub const IP_MULTICAST_IF: ::c_int = 32;
+pub const IP_MULTICAST_TTL: ::c_int = 33;
+pub const IP_MULTICAST_LOOP: ::c_int = 34;
+pub const IP_ADD_MEMBERSHIP: ::c_int = 35;
+pub const IP_DROP_MEMBERSHIP: ::c_int = 36;
+pub const IPPROTO_RAW: ::c_int = 255;
+// }
+
+// netinet/tcp.h
+pub const TCP_NODELAY: ::c_int = 1;
+// FIXME: relibc {
+pub const TCP_KEEPIDLE: ::c_int = 1;
+// }
+
+// poll.h
+pub const POLLIN: ::c_short = 0x001;
+pub const POLLPRI: ::c_short = 0x002;
+pub const POLLOUT: ::c_short = 0x004;
+pub const POLLERR: ::c_short = 0x008;
+pub const POLLHUP: ::c_short = 0x010;
+pub const POLLNVAL: ::c_short = 0x020;
+pub const POLLRDNORM: ::c_short = 0x040;
+pub const POLLRDBAND: ::c_short = 0x080;
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+// pthread.h
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
+pub const PTHREAD_MUTEX_INITIALIZER: ::pthread_mutex_t = ::pthread_mutex_t {
+    bytes: [0; _PTHREAD_MUTEX_SIZE],
+};
+pub const PTHREAD_COND_INITIALIZER: ::pthread_cond_t = ::pthread_cond_t {
+    bytes: [0; _PTHREAD_COND_SIZE],
+};
+pub const PTHREAD_RWLOCK_INITIALIZER: ::pthread_rwlock_t = ::pthread_rwlock_t {
+    bytes: [0; _PTHREAD_RWLOCK_SIZE],
+};
+pub const PTHREAD_STACK_MIN: ::size_t = 4096;
+
+// signal.h
+pub const SIG_BLOCK: ::c_int = 0;
+pub const SIG_UNBLOCK: ::c_int = 1;
+pub const SIG_SETMASK: ::c_int = 2;
+pub const SIGHUP: ::c_int = 1;
+pub const SIGINT: ::c_int = 2;
+pub const SIGQUIT: ::c_int = 3;
+pub const SIGILL: ::c_int = 4;
+pub const SIGTRAP: ::c_int = 5;
+pub const SIGABRT: ::c_int = 6;
+pub const SIGBUS: ::c_int = 7;
+pub const SIGFPE: ::c_int = 8;
+pub const SIGKILL: ::c_int = 9;
+pub const SIGUSR1: ::c_int = 10;
+pub const SIGSEGV: ::c_int = 11;
+pub const SIGUSR2: ::c_int = 12;
+pub const SIGPIPE: ::c_int = 13;
+pub const SIGALRM: ::c_int = 14;
+pub const SIGTERM: ::c_int = 15;
+pub const SIGSTKFLT: ::c_int = 16;
+pub const SIGCHLD: ::c_int = 17;
+pub const SIGCONT: ::c_int = 18;
+pub const SIGSTOP: ::c_int = 19;
+pub const SIGTSTP: ::c_int = 20;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+pub const SIGURG: ::c_int = 23;
+pub const SIGXCPU: ::c_int = 24;
+pub const SIGXFSZ: ::c_int = 25;
+pub const SIGVTALRM: ::c_int = 26;
+pub const SIGPROF: ::c_int = 27;
+pub const SIGWINCH: ::c_int = 28;
+pub const SIGIO: ::c_int = 29;
+pub const SIGPWR: ::c_int = 30;
+pub const SIGSYS: ::c_int = 31;
+pub const NSIG: ::c_int = 32;
+
+pub const SA_NOCLDSTOP: ::c_ulong = 0x00000001;
+pub const SA_NOCLDWAIT: ::c_ulong = 0x00000002;
+pub const SA_SIGINFO: ::c_ulong = 0x00000004;
+pub const SA_RESTORER: ::c_ulong = 0x04000000;
+pub const SA_ONSTACK: ::c_ulong = 0x08000000;
+pub const SA_RESTART: ::c_ulong = 0x10000000;
+pub const SA_NODEFER: ::c_ulong = 0x40000000;
+pub const SA_RESETHAND: ::c_ulong = 0x80000000;
+
+// sys/file.h
+pub const LOCK_SH: ::c_int = 1;
+pub const LOCK_EX: ::c_int = 2;
+pub const LOCK_NB: ::c_int = 4;
+pub const LOCK_UN: ::c_int = 8;
+
+// sys/epoll.h
+pub const EPOLL_CLOEXEC: ::c_int = 0x0100_0000;
+pub const EPOLL_CTL_ADD: ::c_int = 1;
+pub const EPOLL_CTL_DEL: ::c_int = 2;
+pub const EPOLL_CTL_MOD: ::c_int = 3;
+pub const EPOLLIN: ::c_int = 0x001;
+pub const EPOLLPRI: ::c_int = 0x002;
+pub const EPOLLOUT: ::c_int = 0x004;
+pub const EPOLLERR: ::c_int = 0x008;
+pub const EPOLLHUP: ::c_int = 0x010;
+pub const EPOLLNVAL: ::c_int = 0x020;
+pub const EPOLLRDNORM: ::c_int = 0x040;
+pub const EPOLLRDBAND: ::c_int = 0x080;
+pub const EPOLLWRNORM: ::c_int = 0x100;
+pub const EPOLLWRBAND: ::c_int = 0x200;
+pub const EPOLLMSG: ::c_int = 0x400;
+pub const EPOLLRDHUP: ::c_int = 0x2000;
+pub const EPOLLEXCLUSIVE: ::c_int = 1 << 28;
+pub const EPOLLWAKEUP: ::c_int = 1 << 29;
+pub const EPOLLONESHOT: ::c_int = 1 << 30;
+pub const EPOLLET: ::c_int = 1 << 31;
+
+// sys/stat.h
+pub const S_IFMT: ::c_int = 0o0_170_000;
+pub const S_IFDIR: ::c_int = 0o040_000;
+pub const S_IFCHR: ::c_int = 0o020_000;
+pub const S_IFBLK: ::c_int = 0o060_000;
+pub const S_IFREG: ::c_int = 0o100_000;
+pub const S_IFIFO: ::c_int = 0o010_000;
+pub const S_IFLNK: ::c_int = 0o120_000;
+pub const S_IFSOCK: ::c_int = 0o140_000;
+pub const S_IRWXU: ::c_int = 0o0_700;
+pub const S_IRUSR: ::c_int = 0o0_400;
+pub const S_IWUSR: ::c_int = 0o0_200;
+pub const S_IXUSR: ::c_int = 0o0_100;
+pub const S_IRWXG: ::c_int = 0o0_070;
+pub const S_IRGRP: ::c_int = 0o0_040;
+pub const S_IWGRP: ::c_int = 0o0_020;
+pub const S_IXGRP: ::c_int = 0o0_010;
+pub const S_IRWXO: ::c_int = 0o0_007;
+pub const S_IROTH: ::c_int = 0o0_004;
+pub const S_IWOTH: ::c_int = 0o0_002;
+pub const S_IXOTH: ::c_int = 0o0_001;
+
+// stdlib.h
+pub const EXIT_SUCCESS: ::c_int = 0;
+pub const EXIT_FAILURE: ::c_int = 1;
+
+// sys/ioctl.h
+// FIXME: relibc {
+pub const FIONREAD: ::c_ulong = 0x541B;
+pub const FIONBIO: ::c_ulong = 0x5421;
+pub const FIOCLEX: ::c_ulong = 0x5451;
+// }
+pub const TCGETS: ::c_ulong = 0x5401;
+pub const TCSETS: ::c_ulong = 0x5402;
+pub const TCFLSH: ::c_ulong = 0x540B;
+pub const TIOCSCTTY: ::c_ulong = 0x540E;
+pub const TIOCGPGRP: ::c_ulong = 0x540F;
+pub const TIOCSPGRP: ::c_ulong = 0x5410;
+pub const TIOCGWINSZ: ::c_ulong = 0x5413;
+pub const TIOCSWINSZ: ::c_ulong = 0x5414;
+
+// sys/mman.h
+pub const PROT_NONE: ::c_int = 0x0000;
+pub const PROT_READ: ::c_int = 0x0004;
+pub const PROT_WRITE: ::c_int = 0x0002;
+pub const PROT_EXEC: ::c_int = 0x0001;
+
+pub const MADV_NORMAL: ::c_int = 0;
+pub const MADV_RANDOM: ::c_int = 1;
+pub const MADV_SEQUENTIAL: ::c_int = 2;
+pub const MADV_WILLNEED: ::c_int = 3;
+pub const MADV_DONTNEED: ::c_int = 4;
+
+pub const MAP_SHARED: ::c_int = 0x0001;
+pub const MAP_PRIVATE: ::c_int = 0x0002;
+pub const MAP_ANON: ::c_int = 0x0020;
+pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
+pub const MAP_FIXED: ::c_int = 0x0010;
+pub const MAP_FAILED: *mut ::c_void = !0 as _;
+
+pub const MS_ASYNC: ::c_int = 0x0001;
+pub const MS_INVALIDATE: ::c_int = 0x0002;
+pub const MS_SYNC: ::c_int = 0x0004;
+
+// sys/select.h
+pub const FD_SETSIZE: usize = 1024;
+
+// sys/socket.h
+pub const AF_INET: ::c_int = 2;
+pub const AF_INET6: ::c_int = 10;
+pub const AF_UNIX: ::c_int = 1;
+pub const AF_UNSPEC: ::c_int = 0;
+pub const PF_INET: ::c_int = 2;
+pub const PF_INET6: ::c_int = 10;
+pub const PF_UNIX: ::c_int = 1;
+pub const PF_UNSPEC: ::c_int = 0;
+pub const MSG_CTRUNC: ::c_int = 8;
+pub const MSG_DONTROUTE: ::c_int = 4;
+pub const MSG_EOR: ::c_int = 128;
+pub const MSG_OOB: ::c_int = 1;
+pub const MSG_PEEK: ::c_int = 2;
+pub const MSG_TRUNC: ::c_int = 32;
+pub const MSG_DONTWAIT: ::c_int = 64;
+pub const MSG_WAITALL: ::c_int = 256;
+pub const SHUT_RD: ::c_int = 0;
+pub const SHUT_WR: ::c_int = 1;
+pub const SHUT_RDWR: ::c_int = 2;
+pub const SO_DEBUG: ::c_int = 1;
+pub const SO_REUSEADDR: ::c_int = 2;
+pub const SO_TYPE: ::c_int = 3;
+pub const SO_ERROR: ::c_int = 4;
+pub const SO_DONTROUTE: ::c_int = 5;
+pub const SO_BROADCAST: ::c_int = 6;
+pub const SO_SNDBUF: ::c_int = 7;
+pub const SO_RCVBUF: ::c_int = 8;
+pub const SO_KEEPALIVE: ::c_int = 9;
+pub const SO_OOBINLINE: ::c_int = 10;
+pub const SO_NO_CHECK: ::c_int = 11;
+pub const SO_PRIORITY: ::c_int = 12;
+pub const SO_LINGER: ::c_int = 13;
+pub const SO_BSDCOMPAT: ::c_int = 14;
+pub const SO_REUSEPORT: ::c_int = 15;
+pub const SO_PASSCRED: ::c_int = 16;
+pub const SO_PEERCRED: ::c_int = 17;
+pub const SO_RCVLOWAT: ::c_int = 18;
+pub const SO_SNDLOWAT: ::c_int = 19;
+pub const SO_RCVTIMEO: ::c_int = 20;
+pub const SO_SNDTIMEO: ::c_int = 21;
+pub const SO_ACCEPTCONN: ::c_int = 30;
+pub const SO_PEERSEC: ::c_int = 31;
+pub const SO_SNDBUFFORCE: ::c_int = 32;
+pub const SO_RCVBUFFORCE: ::c_int = 33;
+pub const SO_PROTOCOL: ::c_int = 38;
+pub const SO_DOMAIN: ::c_int = 39;
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+pub const SOCK_NONBLOCK: ::c_int = 0o4_000;
+pub const SOCK_CLOEXEC: ::c_int = 0o2_000_000;
+pub const SOCK_SEQPACKET: ::c_int = 5;
+pub const SOL_SOCKET: ::c_int = 1;
+pub const SOMAXCONN: ::c_int = 128;
+
+// sys/termios.h
+pub const VEOF: usize = 0;
+pub const VEOL: usize = 1;
+pub const VEOL2: usize = 2;
+pub const VERASE: usize = 3;
+pub const VWERASE: usize = 4;
+pub const VKILL: usize = 5;
+pub const VREPRINT: usize = 6;
+pub const VSWTC: usize = 7;
+pub const VINTR: usize = 8;
+pub const VQUIT: usize = 9;
+pub const VSUSP: usize = 10;
+pub const VSTART: usize = 12;
+pub const VSTOP: usize = 13;
+pub const VLNEXT: usize = 14;
+pub const VDISCARD: usize = 15;
+pub const VMIN: usize = 16;
+pub const VTIME: usize = 17;
+pub const NCCS: usize = 32;
+
+pub const IGNBRK: ::tcflag_t = 0o000_001;
+pub const BRKINT: ::tcflag_t = 0o000_002;
+pub const IGNPAR: ::tcflag_t = 0o000_004;
+pub const PARMRK: ::tcflag_t = 0o000_010;
+pub const INPCK: ::tcflag_t = 0o000_020;
+pub const ISTRIP: ::tcflag_t = 0o000_040;
+pub const INLCR: ::tcflag_t = 0o000_100;
+pub const IGNCR: ::tcflag_t = 0o000_200;
+pub const ICRNL: ::tcflag_t = 0o000_400;
+pub const IXON: ::tcflag_t = 0o001_000;
+pub const IXOFF: ::tcflag_t = 0o002_000;
+
+pub const OPOST: ::tcflag_t = 0o000_001;
+pub const ONLCR: ::tcflag_t = 0o000_002;
+pub const OLCUC: ::tcflag_t = 0o000_004;
+pub const OCRNL: ::tcflag_t = 0o000_010;
+pub const ONOCR: ::tcflag_t = 0o000_020;
+pub const ONLRET: ::tcflag_t = 0o000_040;
+pub const OFILL: ::tcflag_t = 0o0000_100;
+pub const OFDEL: ::tcflag_t = 0o0000_200;
+
+pub const B0: speed_t = 0o000_000;
+pub const B50: speed_t = 0o000_001;
+pub const B75: speed_t = 0o000_002;
+pub const B110: speed_t = 0o000_003;
+pub const B134: speed_t = 0o000_004;
+pub const B150: speed_t = 0o000_005;
+pub const B200: speed_t = 0o000_006;
+pub const B300: speed_t = 0o000_007;
+pub const B600: speed_t = 0o000_010;
+pub const B1200: speed_t = 0o000_011;
+pub const B1800: speed_t = 0o000_012;
+pub const B2400: speed_t = 0o000_013;
+pub const B4800: speed_t = 0o000_014;
+pub const B9600: speed_t = 0o000_015;
+pub const B19200: speed_t = 0o000_016;
+pub const B38400: speed_t = 0o000_017;
+
+pub const B57600: speed_t = 0o0_020;
+pub const B115200: speed_t = 0o0_021;
+pub const B230400: speed_t = 0o0_022;
+pub const B460800: speed_t = 0o0_023;
+pub const B500000: speed_t = 0o0_024;
+pub const B576000: speed_t = 0o0_025;
+pub const B921600: speed_t = 0o0_026;
+pub const B1000000: speed_t = 0o0_027;
+pub const B1152000: speed_t = 0o0_030;
+pub const B1500000: speed_t = 0o0_031;
+pub const B2000000: speed_t = 0o0_032;
+pub const B2500000: speed_t = 0o0_033;
+pub const B3000000: speed_t = 0o0_034;
+pub const B3500000: speed_t = 0o0_035;
+pub const B4000000: speed_t = 0o0_036;
+
+pub const CSIZE: ::tcflag_t = 0o001_400;
+pub const CS5: ::tcflag_t = 0o000_000;
+pub const CS6: ::tcflag_t = 0o000_400;
+pub const CS7: ::tcflag_t = 0o001_000;
+pub const CS8: ::tcflag_t = 0o001_400;
+
+pub const CSTOPB: ::tcflag_t = 0o002_000;
+pub const CREAD: ::tcflag_t = 0o004_000;
+pub const PARENB: ::tcflag_t = 0o010_000;
+pub const PARODD: ::tcflag_t = 0o020_000;
+pub const HUPCL: ::tcflag_t = 0o040_000;
+
+pub const CLOCAL: ::tcflag_t = 0o0100000;
+
+pub const ISIG: ::tcflag_t = 0x0000_0080;
+pub const ICANON: ::tcflag_t = 0x0000_0100;
+pub const ECHO: ::tcflag_t = 0x0000_0008;
+pub const ECHOE: ::tcflag_t = 0x0000_0002;
+pub const ECHOK: ::tcflag_t = 0x0000_0004;
+pub const ECHONL: ::tcflag_t = 0x0000_0010;
+pub const NOFLSH: ::tcflag_t = 0x8000_0000;
+pub const TOSTOP: ::tcflag_t = 0x0040_0000;
+pub const IEXTEN: ::tcflag_t = 0x0000_0400;
+
+pub const TCOOFF: ::c_int = 0;
+pub const TCOON: ::c_int = 1;
+pub const TCIOFF: ::c_int = 2;
+pub const TCION: ::c_int = 3;
+
+pub const TCIFLUSH: ::c_int = 0;
+pub const TCOFLUSH: ::c_int = 1;
+pub const TCIOFLUSH: ::c_int = 2;
+
+pub const TCSANOW: ::c_int = 0;
+pub const TCSADRAIN: ::c_int = 1;
+pub const TCSAFLUSH: ::c_int = 2;
+
+// sys/wait.h
+pub const WNOHANG: ::c_int = 1;
+pub const WUNTRACED: ::c_int = 2;
+
+pub const WSTOPPED: ::c_int = 2;
+pub const WEXITED: ::c_int = 4;
+pub const WCONTINUED: ::c_int = 8;
+pub const WNOWAIT: ::c_int = 0x0100_0000;
+
+pub const __WNOTHREAD: ::c_int = 0x2000_0000;
+pub const __WALL: ::c_int = 0x4000_0000;
+#[allow(overflowing_literals)]
+pub const __WCLONE: ::c_int = 0x8000_0000;
+
+// time.h
+pub const CLOCK_REALTIME: ::c_int = 1;
+pub const CLOCK_MONOTONIC: ::c_int = 4;
+pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
+pub const CLOCKS_PER_SEC: ::clock_t = 1_000_000;
+
+// unistd.h
+// POSIX.1 {
+pub const _SC_ARG_MAX: ::c_int = 0;
+pub const _SC_CHILD_MAX: ::c_int = 1;
+pub const _SC_CLK_TCK: ::c_int = 2;
+pub const _SC_NGROUPS_MAX: ::c_int = 3;
+pub const _SC_OPEN_MAX: ::c_int = 4;
+pub const _SC_STREAM_MAX: ::c_int = 5;
+pub const _SC_TZNAME_MAX: ::c_int = 6;
+// ...
+pub const _SC_VERSION: ::c_int = 29;
+pub const _SC_PAGESIZE: ::c_int = 30;
+pub const _SC_PAGE_SIZE: ::c_int = 30;
+// ...
+pub const _SC_RE_DUP_MAX: ::c_int = 44;
+// ...
+pub const _SC_LOGIN_NAME_MAX: ::c_int = 71;
+pub const _SC_TTY_NAME_MAX: ::c_int = 72;
+// ...
+pub const _SC_SYMLOOP_MAX: ::c_int = 173;
+// ...
+pub const _SC_HOST_NAME_MAX: ::c_int = 180;
+// } POSIX.1
+
+pub const F_OK: ::c_int = 0;
+pub const R_OK: ::c_int = 4;
+pub const W_OK: ::c_int = 2;
+pub const X_OK: ::c_int = 1;
+
+pub const SEEK_SET: ::c_int = 0;
+pub const SEEK_CUR: ::c_int = 1;
+pub const SEEK_END: ::c_int = 2;
+pub const STDIN_FILENO: ::c_int = 0;
+pub const STDOUT_FILENO: ::c_int = 1;
+pub const STDERR_FILENO: ::c_int = 2;
+
+pub const _PC_LINK_MAX: ::c_int = 0;
+pub const _PC_MAX_CANON: ::c_int = 1;
+pub const _PC_MAX_INPUT: ::c_int = 2;
+pub const _PC_NAME_MAX: ::c_int = 3;
+pub const _PC_PATH_MAX: ::c_int = 4;
+pub const _PC_PIPE_BUF: ::c_int = 5;
+pub const _PC_CHOWN_RESTRICTED: ::c_int = 6;
+pub const _PC_NO_TRUNC: ::c_int = 7;
+pub const _PC_VDISABLE: ::c_int = 8;
+pub const _PC_SYNC_IO: ::c_int = 9;
+pub const _PC_ASYNC_IO: ::c_int = 10;
+pub const _PC_PRIO_IO: ::c_int = 11;
+pub const _PC_SOCK_MAXBUF: ::c_int = 12;
+pub const _PC_FILESIZEBITS: ::c_int = 13;
+pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14;
+pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15;
+pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16;
+pub const _PC_REC_XFER_ALIGN: ::c_int = 17;
+pub const _PC_ALLOC_SIZE_MIN: ::c_int = 18;
+pub const _PC_SYMLINK_MAX: ::c_int = 19;
+pub const _PC_2_SYMLINKS: ::c_int = 20;
+
+pub const PRIO_PROCESS: ::c_int = 0;
+pub const PRIO_PGRP: ::c_int = 1;
+pub const PRIO_USER: ::c_int = 2;
+
+// wait.h
+f! {
+    pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
+        let fd = fd as usize;
+        let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        (*set).fds_bits[fd / size] &= !(1 << (fd % size));
+        return
+    }
+
+    pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
+        let fd = fd as usize;
+        let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0
+    }
+
+    pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
+        let fd = fd as usize;
+        let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        (*set).fds_bits[fd / size] |= 1 << (fd % size);
+        return
+    }
+
+    pub fn FD_ZERO(set: *mut fd_set) -> () {
+        for slot in (*set).fds_bits.iter_mut() {
+            *slot = 0;
+        }
+    }
+}
+
+safe_f! {
+    pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
+        (status & 0xff) == 0x7f
+    }
+
+    pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
+        (status >> 8) & 0xff
+    }
+
+    pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
+        status == 0xffff
+    }
+
+    pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
+        ((status & 0x7f) + 1) as i8 >= 2
+    }
+
+    pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int {
+        status & 0x7f
+    }
+
+    pub {const} fn WIFEXITED(status: ::c_int) -> bool {
+        (status & 0x7f) == 0
+    }
+
+    pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int {
+        (status >> 8) & 0xff
+    }
+
+    pub {const} fn WCOREDUMP(status: ::c_int) -> bool {
+        (status & 0x80) != 0
+    }
+}
+
+extern "C" {
+    // errno.h
+    pub fn __errno_location() -> *mut ::c_int;
+    pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
+
+    // unistd.h
+    pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn getdtablesize() -> ::c_int;
+
+    // grp.h
+    pub fn getgrent() -> *mut ::group;
+    pub fn setgrent();
+    pub fn endgrent();
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
+    pub fn getgrnam_r(
+        name: *const ::c_char,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn getgrouplist(
+        user: *const ::c_char,
+        group: ::gid_t,
+        groups: *mut ::gid_t,
+        ngroups: *mut ::c_int,
+    ) -> ::c_int;
+
+    // malloc.h
+    pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
+
+    // netdb.h
+    pub fn getnameinfo(
+        addr: *const ::sockaddr,
+        addrlen: ::socklen_t,
+        host: *mut ::c_char,
+        hostlen: ::socklen_t,
+        serv: *mut ::c_char,
+        servlen: ::socklen_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_atfork(
+        prepare: ::Option<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+    pub fn pthread_create(
+        tid: *mut ::pthread_t,
+        attr: *const ::pthread_attr_t,
+        start: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
+        arg: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn pthread_condattr_setclock(
+        attr: *mut pthread_condattr_t,
+        clock_id: ::clockid_t,
+    ) -> ::c_int;
+
+    //pty.h
+    pub fn openpty(
+        amaster: *mut ::c_int,
+        aslave: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *const termios,
+        winp: *const ::winsize,
+    ) -> ::c_int;
+
+    // pwd.h
+    pub fn getpwent() -> *mut passwd;
+    pub fn setpwent();
+    pub fn endpwent();
+    pub fn getpwnam_r(
+        name: *const ::c_char,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+    pub fn getpwuid_r(
+        uid: ::uid_t,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+
+    // signal.h
+    pub fn pthread_sigmask(
+        how: ::c_int,
+        set: *const ::sigset_t,
+        oldset: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
+    pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
+    pub fn sigtimedwait(
+        set: *const sigset_t,
+        sig: *mut siginfo_t,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
+
+    // stdlib.h
+    pub fn getsubopt(
+        optionp: *mut *mut c_char,
+        tokens: *const *mut c_char,
+        valuep: *mut *mut c_char,
+    ) -> ::c_int;
+    pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
+
+    // string.h
+    pub fn explicit_bzero(p: *mut ::c_void, len: ::size_t);
+    pub fn strlcat(dst: *mut ::c_char, src: *const ::c_char, siz: ::size_t) -> ::size_t;
+    pub fn strlcpy(dst: *mut ::c_char, src: *const ::c_char, siz: ::size_t) -> ::size_t;
+
+    // sys/epoll.h
+    pub fn epoll_create(size: ::c_int) -> ::c_int;
+    pub fn epoll_create1(flags: ::c_int) -> ::c_int;
+    pub fn epoll_wait(
+        epfd: ::c_int,
+        events: *mut ::epoll_event,
+        maxevents: ::c_int,
+        timeout: ::c_int,
+    ) -> ::c_int;
+    pub fn epoll_ctl(epfd: ::c_int, op: ::c_int, fd: ::c_int, event: *mut ::epoll_event)
+        -> ::c_int;
+
+    // sys/ioctl.h
+    pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
+
+    // sys/mman.h
+    pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+    pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+    pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int;
+    pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
+
+    // sys/resource.h
+    pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
+    pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
+    pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
+
+    // sys/socket.h
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
+    pub fn recvfrom(
+        socket: ::c_int,
+        buf: *mut ::c_void,
+        len: ::size_t,
+        flags: ::c_int,
+        addr: *mut ::sockaddr,
+        addrlen: *mut ::socklen_t,
+    ) -> ::ssize_t;
+
+    // sys/stat.h
+    pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
+
+    // sys/uio.h
+    pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+
+    // sys/utsname.h
+    pub fn uname(utsname: *mut utsname) -> ::c_int;
+
+    // time.h
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
+    pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+
+    // utmp.h
+    pub fn login_tty(fd: ::c_int) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for dirent {
+            fn eq(&self, other: &dirent) -> bool {
+                self.d_ino == other.d_ino
+                    && self.d_off == other.d_off
+                    && self.d_reclen == other.d_reclen
+                    && self.d_type == other.d_type
+                    && self
+                    .d_name
+                    .iter()
+                    .zip(other.d_name.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for dirent {}
+
+        impl ::fmt::Debug for dirent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("dirent")
+                    .field("d_ino", &self.d_ino)
+                    .field("d_off", &self.d_off)
+                    .field("d_reclen", &self.d_reclen)
+                    .field("d_type", &self.d_type)
+                // FIXME: .field("d_name", &self.d_name)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for dirent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.d_ino.hash(state);
+                self.d_off.hash(state);
+                self.d_reclen.hash(state);
+                self.d_type.hash(state);
+                self.d_name.hash(state);
+            }
+        }
+
+        impl PartialEq for sockaddr_un {
+            fn eq(&self, other: &sockaddr_un) -> bool {
+                self.sun_family == other.sun_family
+                    && self
+                    .sun_path
+                    .iter()
+                    .zip(other.sun_path.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for sockaddr_un {}
+
+        impl ::fmt::Debug for sockaddr_un {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_un")
+                    .field("sun_family", &self.sun_family)
+                // FIXME: .field("sun_path", &self.sun_path)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for sockaddr_un {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sun_family.hash(state);
+                self.sun_path.hash(state);
+            }
+        }
+
+        impl PartialEq for sockaddr_storage {
+            fn eq(&self, other: &sockaddr_storage) -> bool {
+                self.ss_family == other.ss_family
+                    && self.__ss_align == self.__ss_align
+                    && self
+                    .__ss_padding
+                    .iter()
+                    .zip(other.__ss_padding.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for sockaddr_storage {}
+
+        impl ::fmt::Debug for sockaddr_storage {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_storage")
+                    .field("ss_family", &self.ss_family)
+                    .field("__ss_align", &self.__ss_align)
+                // FIXME: .field("__ss_padding", &self.__ss_padding)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for sockaddr_storage {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ss_family.hash(state);
+                self.__ss_padding.hash(state);
+                self.__ss_align.hash(state);
+            }
+        }
+
+        impl PartialEq for utsname {
+            fn eq(&self, other: &utsname) -> bool {
+                self.sysname
+                    .iter()
+                    .zip(other.sysname.iter())
+                    .all(|(a, b)| a == b)
+                    && self
+                    .nodename
+                    .iter()
+                    .zip(other.nodename.iter())
+                    .all(|(a, b)| a == b)
+                    && self
+                    .release
+                    .iter()
+                    .zip(other.release.iter())
+                    .all(|(a, b)| a == b)
+                    && self
+                    .version
+                    .iter()
+                    .zip(other.version.iter())
+                    .all(|(a, b)| a == b)
+                    && self
+                    .machine
+                    .iter()
+                    .zip(other.machine.iter())
+                    .all(|(a, b)| a == b)
+                    && self
+                    .domainname
+                    .iter()
+                    .zip(other.domainname.iter())
+                    .all(|(a, b)| a == b)
+            }
+        }
+
+        impl Eq for utsname {}
+
+        impl ::fmt::Debug for utsname {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("utsname")
+                // FIXME: .field("sysname", &self.sysname)
+                // FIXME: .field("nodename", &self.nodename)
+                // FIXME: .field("release", &self.release)
+                // FIXME: .field("version", &self.version)
+                // FIXME: .field("machine", &self.machine)
+                // FIXME: .field("domainname", &self.domainname)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for utsname {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sysname.hash(state);
+                self.nodename.hash(state);
+                self.release.hash(state);
+                self.version.hash(state);
+                self.machine.hash(state);
+                self.domainname.hash(state);
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/solarish/compat.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/solarish/compat.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/solarish/compat.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/solarish/compat.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,220 @@
+// Common functions that are unfortunately missing on illumos and
+// Solaris, but often needed by other crates.
+
+use core::cmp::min;
+use unix::solarish::*;
+
+const PTEM: &[u8] = b"ptem\0";
+const LDTERM: &[u8] = b"ldterm\0";
+
+pub unsafe fn cfmakeraw(termios: *mut ::termios) {
+    (*termios).c_iflag &=
+        !(IMAXBEL | IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON);
+    (*termios).c_oflag &= !OPOST;
+    (*termios).c_lflag &= !(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
+    (*termios).c_cflag &= !(CSIZE | PARENB);
+    (*termios).c_cflag |= CS8;
+
+    // By default, most software expects a pending read to block until at
+    // least one byte becomes available.  As per termio(7I), this requires
+    // setting the MIN and TIME parameters appropriately.
+    //
+    // As a somewhat unfortunate artefact of history, the MIN and TIME slots
+    // in the control character array overlap with the EOF and EOL slots used
+    // for canonical mode processing.  Because the EOF character needs to be
+    // the ASCII EOT value (aka Control-D), it has the byte value 4.  When
+    // switching to raw mode, this is interpreted as a MIN value of 4; i.e.,
+    // reads will block until at least four bytes have been input.
+    //
+    // Other platforms with a distinct MIN slot like Linux and FreeBSD appear
+    // to default to a MIN value of 1, so we'll force that value here:
+    (*termios).c_cc[VMIN] = 1;
+    (*termios).c_cc[VTIME] = 0;
+}
+
+pub unsafe fn cfsetspeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int {
+    // Neither of these functions on illumos or Solaris actually ever
+    // return an error
+    ::cfsetispeed(termios, speed);
+    ::cfsetospeed(termios, speed);
+    0
+}
+
+unsafe fn bail(fdm: ::c_int, fds: ::c_int) -> ::c_int {
+    let e = *___errno();
+    if fds >= 0 {
+        ::close(fds);
+    }
+    if fdm >= 0 {
+        ::close(fdm);
+    }
+    *___errno() = e;
+    return -1;
+}
+
+pub unsafe fn openpty(
+    amain: *mut ::c_int,
+    asubord: *mut ::c_int,
+    name: *mut ::c_char,
+    termp: *const termios,
+    winp: *const ::winsize,
+) -> ::c_int {
+    // Open the main pseudo-terminal device, making sure not to set it as the
+    // controlling terminal for this process:
+    let fdm = ::posix_openpt(O_RDWR | O_NOCTTY);
+    if fdm < 0 {
+        return -1;
+    }
+
+    // Set permissions and ownership on the subordinate device and unlock it:
+    if ::grantpt(fdm) < 0 || ::unlockpt(fdm) < 0 {
+        return bail(fdm, -1);
+    }
+
+    // Get the path name of the subordinate device:
+    let subordpath = ::ptsname(fdm);
+    if subordpath.is_null() {
+        return bail(fdm, -1);
+    }
+
+    // Open the subordinate device without setting it as the controlling
+    // terminal for this process:
+    let fds = ::open(subordpath, O_RDWR | O_NOCTTY);
+    if fds < 0 {
+        return bail(fdm, -1);
+    }
+
+    // Check if the STREAMS modules are already pushed:
+    let setup = ::ioctl(fds, I_FIND, LDTERM.as_ptr());
+    if setup < 0 {
+        return bail(fdm, fds);
+    } else if setup == 0 {
+        // The line discipline is not present, so push the appropriate STREAMS
+        // modules for the subordinate device:
+        if ::ioctl(fds, I_PUSH, PTEM.as_ptr()) < 0 || ::ioctl(fds, I_PUSH, LDTERM.as_ptr()) < 0 {
+            return bail(fdm, fds);
+        }
+    }
+
+    // If provided, set the terminal parameters:
+    if !termp.is_null() && ::tcsetattr(fds, TCSAFLUSH, termp) != 0 {
+        return bail(fdm, fds);
+    }
+
+    // If provided, set the window size:
+    if !winp.is_null() && ::ioctl(fds, TIOCSWINSZ, winp) < 0 {
+        return bail(fdm, fds);
+    }
+
+    // If the caller wants the name of the subordinate device, copy it out.
+    //
+    // Note that this is a terrible interface: there appears to be no standard
+    // upper bound on the copy length for this pointer.  Nobody should pass
+    // anything but NULL here, preferring instead to use ptsname(3C) directly.
+    if !name.is_null() {
+        ::strcpy(name, subordpath);
+    }
+
+    *amain = fdm;
+    *asubord = fds;
+    0
+}
+
+pub unsafe fn forkpty(
+    amain: *mut ::c_int,
+    name: *mut ::c_char,
+    termp: *const termios,
+    winp: *const ::winsize,
+) -> ::pid_t {
+    let mut fds = -1;
+
+    if openpty(amain, &mut fds, name, termp, winp) != 0 {
+        return -1;
+    }
+
+    let pid = ::fork();
+    if pid < 0 {
+        return bail(*amain, fds);
+    } else if pid > 0 {
+        // In the parent process, we close the subordinate device and return the
+        // process ID of the new child:
+        ::close(fds);
+        return pid;
+    }
+
+    // The rest of this function executes in the child process.
+
+    // Close the main side of the pseudo-terminal pair:
+    ::close(*amain);
+
+    // Use TIOCSCTTY to set the subordinate device as our controlling
+    // terminal.  This will fail (with ENOTTY) if we are not the leader in
+    // our own session, so we call setsid() first.  Finally, arrange for
+    // the pseudo-terminal to occupy the standard I/O descriptors.
+    if ::setsid() < 0
+        || ::ioctl(fds, TIOCSCTTY, 0) < 0
+        || ::dup2(fds, 0) < 0
+        || ::dup2(fds, 1) < 0
+        || ::dup2(fds, 2) < 0
+    {
+        // At this stage there are no particularly good ways to handle failure.
+        // Exit as abruptly as possible, using _exit() to avoid messing with any
+        // state still shared with the parent process.
+        ::_exit(EXIT_FAILURE);
+    }
+    // Close the inherited descriptor, taking care to avoid closing the standard
+    // descriptors by mistake:
+    if fds > 2 {
+        ::close(fds);
+    }
+
+    0
+}
+
+pub unsafe fn getpwent_r(
+    pwd: *mut passwd,
+    buf: *mut ::c_char,
+    buflen: ::size_t,
+    result: *mut *mut passwd,
+) -> ::c_int {
+    let old_errno = *::___errno();
+    *::___errno() = 0;
+    *result = native_getpwent_r(
+        pwd,
+        buf,
+        min(buflen, ::c_int::max_value() as ::size_t) as ::c_int,
+    );
+
+    let ret = if (*result).is_null() {
+        *::___errno()
+    } else {
+        0
+    };
+    *::___errno() = old_errno;
+
+    ret
+}
+
+pub unsafe fn getgrent_r(
+    grp: *mut ::group,
+    buf: *mut ::c_char,
+    buflen: ::size_t,
+    result: *mut *mut ::group,
+) -> ::c_int {
+    let old_errno = *::___errno();
+    *::___errno() = 0;
+    *result = native_getgrent_r(
+        grp,
+        buf,
+        min(buflen, ::c_int::max_value() as ::size_t) as ::c_int,
+    );
+
+    let ret = if (*result).is_null() {
+        *::___errno()
+    } else {
+        0
+    };
+    *::___errno() = old_errno;
+
+    ret
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/solarish/illumos.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/solarish/illumos.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/solarish/illumos.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/solarish/illumos.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,88 @@
+s! {
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_amp: *mut ::c_void,
+        pub shm_lkcnt: ::c_ushort,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        pub shm_cnattch: ::c_ulong,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_pad4: [i64; 4],
+    }
+
+    pub struct fil_info {
+        pub fi_flags: ::c_int,
+        pub fi_pos: ::c_int,
+        pub fi_name: [::c_char; ::FILNAME_MAX as usize],
+    }
+}
+
+pub const AF_LOCAL: ::c_int = 1; // AF_UNIX
+pub const AF_FILE: ::c_int = 1; // AF_UNIX
+
+pub const EFD_SEMAPHORE: ::c_int = 0x1;
+pub const EFD_NONBLOCK: ::c_int = 0x800;
+pub const EFD_CLOEXEC: ::c_int = 0x80000;
+
+pub const TCP_KEEPIDLE: ::c_int = 34;
+pub const TCP_KEEPCNT: ::c_int = 35;
+pub const TCP_KEEPINTVL: ::c_int = 36;
+pub const TCP_CONGESTION: ::c_int = 37;
+
+// These constants are correct for 64-bit programs or 32-bit programs that are
+// not using large-file mode.  If Rust ever supports anything other than 64-bit
+// compilation on illumos, this may require adjustment:
+pub const F_OFD_GETLK: ::c_int = 47;
+pub const F_OFD_SETLK: ::c_int = 48;
+pub const F_OFD_SETLKW: ::c_int = 49;
+pub const F_FLOCK: ::c_int = 53;
+pub const F_FLOCKW: ::c_int = 54;
+
+pub const F_DUPFD_CLOEXEC: ::c_int = 37;
+pub const F_DUP2FD_CLOEXEC: ::c_int = 36;
+
+pub const FIL_ATTACH: ::c_int = 0x1;
+pub const FIL_DETACH: ::c_int = 0x2;
+pub const FIL_LIST: ::c_int = 0x3;
+pub const FILNAME_MAX: ::c_int = 32;
+pub const FILF_PROG: ::c_int = 0x1;
+pub const FILF_AUTO: ::c_int = 0x2;
+pub const FILF_BYPASS: ::c_int = 0x4;
+pub const SOL_FILTER: ::c_int = 0xfffc;
+
+pub const MADV_PURGE: ::c_int = 9;
+
+pub const B1000000: ::speed_t = 24;
+pub const B1152000: ::speed_t = 25;
+pub const B1500000: ::speed_t = 26;
+pub const B2000000: ::speed_t = 27;
+pub const B2500000: ::speed_t = 28;
+pub const B3000000: ::speed_t = 29;
+pub const B3500000: ::speed_t = 30;
+pub const B4000000: ::speed_t = 31;
+
+// sys/systeminfo.h
+pub const SI_ADDRESS_WIDTH: ::c_int = 520;
+
+extern "C" {
+    pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
+
+    pub fn mincore(addr: ::caddr_t, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
+
+    pub fn pset_bind_lwp(
+        pset: ::psetid_t,
+        id: ::id_t,
+        pid: ::pid_t,
+        opset: *mut ::psetid_t,
+    ) -> ::c_int;
+    pub fn pset_getloadavg(pset: ::psetid_t, load: *mut ::c_double, num: ::c_int) -> ::c_int;
+
+    pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
+    pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
+        -> ::ssize_t;
+    pub fn getpagesizes2(pagesize: *mut ::size_t, nelem: ::c_int) -> ::c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/solarish/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/solarish/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/solarish/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/solarish/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,3310 @@
+pub type c_char = i8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type caddr_t = *mut ::c_char;
+
+pub type clockid_t = ::c_int;
+pub type blkcnt_t = ::c_long;
+pub type clock_t = ::c_long;
+pub type daddr_t = ::c_long;
+pub type dev_t = ::c_ulong;
+pub type fsblkcnt_t = ::c_ulong;
+pub type fsfilcnt_t = ::c_ulong;
+pub type ino_t = ::c_ulong;
+pub type key_t = ::c_int;
+pub type major_t = ::c_uint;
+pub type minor_t = ::c_uint;
+pub type mode_t = ::c_uint;
+pub type nlink_t = ::c_uint;
+pub type rlim_t = ::c_ulong;
+pub type speed_t = ::c_uint;
+pub type tcflag_t = ::c_uint;
+pub type time_t = ::c_long;
+pub type timer_t = ::c_int;
+pub type wchar_t = ::c_int;
+pub type nfds_t = ::c_ulong;
+pub type projid_t = ::c_int;
+pub type zoneid_t = ::c_int;
+pub type psetid_t = ::c_int;
+pub type processorid_t = ::c_int;
+pub type chipid_t = ::c_int;
+pub type ctid_t = ::id_t;
+
+pub type suseconds_t = ::c_long;
+pub type off_t = ::c_long;
+pub type useconds_t = ::c_uint;
+pub type socklen_t = ::c_uint;
+pub type sa_family_t = u16;
+pub type pthread_t = ::c_uint;
+pub type pthread_key_t = ::c_uint;
+pub type thread_t = ::c_uint;
+pub type blksize_t = ::c_int;
+pub type nl_item = ::c_int;
+pub type mqd_t = *mut ::c_void;
+pub type id_t = ::c_int;
+pub type idtype_t = ::c_uint;
+pub type shmatt_t = ::c_ulong;
+
+pub type lgrp_rsrc_t = ::c_int;
+pub type lgrp_affinity_t = ::c_int;
+pub type lgrp_id_t = ::id_t;
+pub type lgrp_mem_size_t = ::c_longlong;
+pub type lgrp_cookie_t = ::uintptr_t;
+pub type lgrp_content_t = ::c_uint;
+pub type lgrp_lat_between_t = ::c_uint;
+pub type lgrp_mem_size_flag_t = ::c_uint;
+pub type lgrp_view_t = ::c_uint;
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum timezone {}
+impl ::Copy for timezone {}
+impl ::Clone for timezone {
+    fn clone(&self) -> timezone {
+        *self
+    }
+}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum ucred_t {}
+impl ::Copy for ucred_t {}
+impl ::Clone for ucred_t {
+    fn clone(&self) -> ucred_t {
+        *self
+    }
+}
+
+s! {
+    pub struct in_addr {
+        pub s_addr: ::in_addr_t,
+    }
+
+    pub struct ip_mreq {
+        pub imr_multiaddr: in_addr,
+        pub imr_interface: in_addr,
+    }
+
+    pub struct ip_mreq_source {
+        pub imr_multiaddr: in_addr,
+        pub imr_sourceaddr: in_addr,
+        pub imr_interface: in_addr,
+    }
+
+    pub struct ipc_perm {
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub seq: ::c_uint,
+        pub key: ::key_t,
+    }
+
+    pub struct sockaddr {
+        pub sa_family: sa_family_t,
+        pub sa_data: [::c_char; 14],
+    }
+
+    pub struct sockaddr_in {
+        pub sin_family: sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [::c_char; 8]
+    }
+
+    pub struct sockaddr_in6 {
+        pub sin6_family: sa_family_t,
+        pub sin6_port: ::in_port_t,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_scope_id: u32,
+        pub __sin6_src_id: u32
+    }
+
+    pub struct passwd {
+        pub pw_name: *mut ::c_char,
+        pub pw_passwd: *mut ::c_char,
+        pub pw_uid: ::uid_t,
+        pub pw_gid: ::gid_t,
+        pub pw_age: *mut ::c_char,
+        pub pw_comment: *mut ::c_char,
+        pub pw_gecos: *mut ::c_char,
+        pub pw_dir: *mut ::c_char,
+        pub pw_shell: *mut ::c_char
+    }
+
+    pub struct ifaddrs {
+        pub ifa_next: *mut ifaddrs,
+        pub ifa_name: *mut ::c_char,
+        pub ifa_flags: ::c_ulong,
+        pub ifa_addr: *mut ::sockaddr,
+        pub ifa_netmask: *mut ::sockaddr,
+        pub ifa_dstaddr: *mut ::sockaddr,
+        pub ifa_data: *mut ::c_void
+    }
+
+    pub struct itimerspec {
+        pub it_interval: ::timespec,
+        pub it_value: ::timespec,
+    }
+
+    pub struct tm {
+        pub tm_sec: ::c_int,
+        pub tm_min: ::c_int,
+        pub tm_hour: ::c_int,
+        pub tm_mday: ::c_int,
+        pub tm_mon: ::c_int,
+        pub tm_year: ::c_int,
+        pub tm_wday: ::c_int,
+        pub tm_yday: ::c_int,
+        pub tm_isdst: ::c_int
+    }
+
+     pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: ::socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::c_int,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: ::socklen_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct cmsghdr {
+        pub cmsg_len: ::socklen_t,
+        pub cmsg_level: ::c_int,
+        pub cmsg_type: ::c_int,
+    }
+
+    pub struct pthread_attr_t {
+        __pthread_attrp: *mut ::c_void
+    }
+
+    pub struct pthread_mutex_t {
+        __pthread_mutex_flag1: u16,
+        __pthread_mutex_flag2: u8,
+        __pthread_mutex_ceiling: u8,
+        __pthread_mutex_type: u16,
+        __pthread_mutex_magic: u16,
+        __pthread_mutex_lock: u64,
+        __pthread_mutex_data: u64
+    }
+
+    pub struct pthread_mutexattr_t {
+        __pthread_mutexattrp: *mut ::c_void
+    }
+
+    pub struct pthread_cond_t {
+        __pthread_cond_flag: [u8; 4],
+        __pthread_cond_type: u16,
+        __pthread_cond_magic: u16,
+        __pthread_cond_data: u64
+    }
+
+    pub struct pthread_condattr_t {
+        __pthread_condattrp: *mut ::c_void,
+    }
+
+    pub struct pthread_rwlock_t {
+        __pthread_rwlock_readers: i32,
+        __pthread_rwlock_type: u16,
+        __pthread_rwlock_magic: u16,
+        __pthread_rwlock_mutex: ::pthread_mutex_t,
+        __pthread_rwlock_readercv: ::pthread_cond_t,
+        __pthread_rwlock_writercv: ::pthread_cond_t
+    }
+
+    pub struct pthread_rwlockattr_t {
+        __pthread_rwlockattrp: *mut ::c_void,
+    }
+
+    pub struct dirent {
+        pub d_ino: ::ino_t,
+        pub d_off: ::off_t,
+        pub d_reclen: u16,
+        pub d_name: [::c_char; 3]
+    }
+
+    pub struct glob_t {
+        pub gl_pathc: ::size_t,
+        pub gl_pathv:  *mut *mut ::c_char,
+        pub gl_offs: ::size_t,
+        __unused1: *mut ::c_void,
+        __unused2: ::c_int,
+        __unused3: ::c_int,
+        __unused4: ::c_int,
+        __unused5: *mut ::c_void,
+        __unused6: *mut ::c_void,
+        __unused7: *mut ::c_void,
+        __unused8: *mut ::c_void,
+        __unused9: *mut ::c_void,
+        __unused10: *mut ::c_void,
+    }
+
+    pub struct addrinfo {
+        pub ai_flags: ::c_int,
+        pub ai_family: ::c_int,
+        pub ai_socktype: ::c_int,
+        pub ai_protocol: ::c_int,
+        #[cfg(target_arch = "sparc64")]
+        __sparcv9_pad: ::c_int,
+        pub ai_addrlen: ::socklen_t,
+        pub ai_canonname: *mut ::c_char,
+        pub ai_addr: *mut ::sockaddr,
+        pub ai_next: *mut addrinfo,
+    }
+
+    pub struct sigset_t {
+        bits: [u32; 4],
+    }
+
+    pub struct sigaction {
+        pub sa_flags: ::c_int,
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: sigset_t,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_size: ::size_t,
+        pub ss_flags: ::c_int,
+    }
+
+    pub struct statvfs {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fsid: ::c_ulong,
+        pub f_basetype: [::c_char; 16],
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        pub f_fstr: [::c_char; 32]
+    }
+
+    pub struct sendfilevec_t {
+        pub sfv_fd: ::c_int,
+        pub sfv_flag: ::c_uint,
+        pub sfv_off: ::off_t,
+        pub sfv_len: ::size_t,
+    }
+
+    pub struct sched_param {
+        pub sched_priority: ::c_int,
+        sched_pad: [::c_int; 8]
+    }
+
+    pub struct Dl_info {
+        pub dli_fname: *const ::c_char,
+        pub dli_fbase: *mut ::c_void,
+        pub dli_sname: *const ::c_char,
+        pub dli_saddr: *mut ::c_void,
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        __unused: [::c_char; 16]
+    }
+
+    pub struct termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_cc: [::cc_t; ::NCCS]
+    }
+
+    pub struct lconv {
+        pub decimal_point: *mut ::c_char,
+        pub thousands_sep: *mut ::c_char,
+        pub grouping: *mut ::c_char,
+        pub int_curr_symbol: *mut ::c_char,
+        pub currency_symbol: *mut ::c_char,
+        pub mon_decimal_point: *mut ::c_char,
+        pub mon_thousands_sep: *mut ::c_char,
+        pub mon_grouping: *mut ::c_char,
+        pub positive_sign: *mut ::c_char,
+        pub negative_sign: *mut ::c_char,
+        pub int_frac_digits: ::c_char,
+        pub frac_digits: ::c_char,
+        pub p_cs_precedes: ::c_char,
+        pub p_sep_by_space: ::c_char,
+        pub n_cs_precedes: ::c_char,
+        pub n_sep_by_space: ::c_char,
+        pub p_sign_posn: ::c_char,
+        pub n_sign_posn: ::c_char,
+        pub int_p_cs_precedes: ::c_char,
+        pub int_p_sep_by_space: ::c_char,
+        pub int_n_cs_precedes: ::c_char,
+        pub int_n_sep_by_space: ::c_char,
+        pub int_p_sign_posn: ::c_char,
+        pub int_n_sign_posn: ::c_char,
+    }
+
+    pub struct sem_t {
+        pub sem_count: u32,
+        pub sem_type: u16,
+        pub sem_magic: u16,
+        pub sem_pad1: [u64; 3],
+        pub sem_pad2: [u64; 2]
+    }
+
+    pub struct flock {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_sysid: ::c_int,
+        pub l_pid: ::pid_t,
+        pub l_pad: [::c_long; 4]
+    }
+
+    pub struct if_nameindex {
+        pub if_index: ::c_uint,
+        pub if_name: *mut ::c_char,
+    }
+
+    pub struct mq_attr {
+        pub mq_flags: ::c_long,
+        pub mq_maxmsg: ::c_long,
+        pub mq_msgsize: ::c_long,
+        pub mq_curmsgs: ::c_long,
+        _pad: [::c_int; 12]
+    }
+
+    pub struct port_event {
+        pub portev_events: ::c_int,
+        pub portev_source: ::c_ushort,
+        pub portev_pad: ::c_ushort,
+        pub portev_object: ::uintptr_t,
+        pub portev_user: *mut ::c_void,
+    }
+
+    pub struct port_notify {
+        pub portnfy_port: ::c_int,
+        pub portnfy_user: *mut ::c_void,
+    }
+
+    pub struct exit_status {
+        e_termination: ::c_short,
+        e_exit: ::c_short,
+    }
+
+    pub struct utmp {
+        pub ut_user: [::c_char; 8],
+        pub ut_id: [::c_char; 4],
+        pub ut_line: [::c_char; 12],
+        pub ut_pid: ::c_short,
+        pub ut_type: ::c_short,
+        pub ut_exit: exit_status,
+        pub ut_time: ::time_t,
+    }
+
+    pub struct timex {
+        pub modes: u32,
+        pub offset: i32,
+        pub freq: i32,
+        pub maxerror: i32,
+        pub esterror: i32,
+        pub status: i32,
+        pub constant: i32,
+        pub precision: i32,
+        pub tolerance: i32,
+        pub ppsfreq: i32,
+        pub jitter: i32,
+        pub shift: i32,
+        pub stabil: i32,
+        pub jitcnt: i32,
+        pub calcnt: i32,
+        pub errcnt: i32,
+        pub stbcnt: i32,
+    }
+
+    pub struct ntptimeval {
+        pub time: ::timeval,
+        pub maxerror: i32,
+        pub esterror: i32,
+    }
+
+    pub struct mmapobj_result_t {
+        pub mr_addr: ::caddr_t,
+        pub mr_msize: ::size_t,
+        pub mr_fsize: ::size_t,
+        pub mr_offset: ::size_t,
+        pub mr_prot: ::c_uint,
+        pub mr_flags: ::c_uint,
+    }
+
+    pub struct lgrp_affinity_args {
+        pub idtype: ::idtype_t,
+        pub id: ::id_t,
+        pub lgrp: ::lgrp_id_t,
+        pub aff: ::lgrp_affinity_t,
+    }
+
+    pub struct processor_info_t {
+        pub pi_state: ::c_int,
+        pub pi_processor_type: [::c_char; PI_TYPELEN as usize],
+        pub pi_fputypes: [::c_char; PI_FPUTYPE as usize],
+        pub pi_clock: ::c_int,
+    }
+
+    pub struct option {
+        pub name: *const ::c_char,
+        pub has_arg: ::c_int,
+        pub flag: *mut ::c_int,
+        pub val: ::c_int,
+    }
+}
+
+s_no_extra_traits! {
+    #[cfg_attr(all(
+            any(target_arch = "x86", target_arch = "x86_64"),
+            libc_packedN
+        ), repr(packed(4)))]
+    #[cfg_attr(all(
+            any(target_arch = "x86", target_arch = "x86_64"),
+            not(libc_packedN)
+        ), repr(packed))]
+    pub struct epoll_event {
+        pub events: u32,
+        pub u64: u64,
+    }
+
+    pub struct utmpx {
+        pub ut_user: [::c_char; _UTX_USERSIZE],
+        pub ut_id: [::c_char; _UTX_IDSIZE],
+        pub ut_line: [::c_char; _UTX_LINESIZE],
+        pub ut_pid: ::pid_t,
+        pub ut_type: ::c_short,
+        pub ut_exit: exit_status,
+        pub ut_tv: ::timeval,
+        pub ut_session: ::c_int,
+        pub ut_pad: [::c_int; _UTX_PADSIZE],
+        pub ut_syslen: ::c_short,
+        pub ut_host: [::c_char; _UTX_HOSTSIZE],
+    }
+
+    pub struct sockaddr_un {
+        pub sun_family: sa_family_t,
+        pub sun_path: [c_char; 108]
+    }
+
+    pub struct utsname {
+        pub sysname: [::c_char; 257],
+        pub nodename: [::c_char; 257],
+        pub release: [::c_char; 257],
+        pub version: [::c_char; 257],
+        pub machine: [::c_char; 257],
+    }
+
+    pub struct fd_set {
+        #[cfg(target_pointer_width = "64")]
+        fds_bits: [i64; FD_SETSIZE / 64],
+        #[cfg(target_pointer_width = "32")]
+        fds_bits: [i32; FD_SETSIZE / 32],
+    }
+
+    pub struct sockaddr_storage {
+        pub ss_family: ::sa_family_t,
+        __ss_pad1: [u8; 6],
+        __ss_align: i64,
+        __ss_pad2: [u8; 240],
+    }
+
+    #[cfg_attr(all(target_pointer_width = "64", libc_align), repr(align(8)))]
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_code: ::c_int,
+        pub si_errno: ::c_int,
+        #[cfg(target_pointer_width = "64")]
+        pub si_pad: ::c_int,
+
+        __data_pad: [::c_int; SIGINFO_DATA_SIZE],
+    }
+
+    pub struct sockaddr_dl {
+        pub sdl_family: ::c_ushort,
+        pub sdl_index: ::c_ushort,
+        pub sdl_type: ::c_uchar,
+        pub sdl_nlen: ::c_uchar,
+        pub sdl_alen: ::c_uchar,
+        pub sdl_slen: ::c_uchar,
+        pub sdl_data: [::c_char; 244],
+    }
+
+    pub struct sigevent {
+        pub sigev_notify: ::c_int,
+        pub sigev_signo: ::c_int,
+        pub sigev_value: ::sigval,
+        pub ss_sp: *mut ::c_void,
+        pub sigev_notify_attributes: *const ::pthread_attr_t,
+        __sigev_pad2: ::c_int,
+    }
+
+    #[cfg(libc_union)]
+    #[cfg_attr(libc_align, repr(align(16)))]
+    pub union pad128_t {
+        // pub _q in this structure would be a "long double", of 16 bytes
+        pub _l: [i32; 4],
+    }
+
+    #[cfg(libc_union)]
+    #[cfg_attr(libc_align, repr(align(16)))]
+    pub union upad128_t {
+        // pub _q in this structure would be a "long double", of 16 bytes
+        pub _l: [u32; 4],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl PartialEq for utmpx {
+            fn eq(&self, other: &utmpx) -> bool {
+                self.ut_type == other.ut_type
+                    && self.ut_pid == other.ut_pid
+                    && self.ut_user == other.ut_user
+                    && self.ut_line == other.ut_line
+                    && self.ut_id == other.ut_id
+                    && self.ut_exit == other.ut_exit
+                    && self.ut_session == other.ut_session
+                    && self.ut_tv == other.ut_tv
+                    && self.ut_syslen == other.ut_syslen
+                    && self.ut_pad == other.ut_pad
+                    && self
+                    .ut_host
+                    .iter()
+                    .zip(other.ut_host.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+
+        impl Eq for utmpx {}
+
+        impl ::fmt::Debug for utmpx {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("utmpx")
+                    .field("ut_user", &self.ut_user)
+                    .field("ut_id", &self.ut_id)
+                    .field("ut_line", &self.ut_line)
+                    .field("ut_pid", &self.ut_pid)
+                    .field("ut_type", &self.ut_type)
+                    .field("ut_exit", &self.ut_exit)
+                    .field("ut_tv", &self.ut_tv)
+                    .field("ut_session", &self.ut_session)
+                    .field("ut_pad", &self.ut_pad)
+                    .field("ut_syslen", &self.ut_syslen)
+                    .field("ut_host", &&self.ut_host[..])
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for utmpx {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ut_user.hash(state);
+                self.ut_type.hash(state);
+                self.ut_pid.hash(state);
+                self.ut_line.hash(state);
+                self.ut_id.hash(state);
+                self.ut_host.hash(state);
+                self.ut_exit.hash(state);
+                self.ut_session.hash(state);
+                self.ut_tv.hash(state);
+                self.ut_syslen.hash(state);
+                self.ut_pad.hash(state);
+            }
+        }
+
+        impl PartialEq for epoll_event {
+            fn eq(&self, other: &epoll_event) -> bool {
+                self.events == other.events
+                    && self.u64 == other.u64
+            }
+        }
+        impl Eq for epoll_event {}
+        impl ::fmt::Debug for epoll_event {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let events = self.events;
+                let u64 = self.u64;
+                f.debug_struct("epoll_event")
+                    .field("events", &events)
+                    .field("u64", &u64)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for epoll_event {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                let events = self.events;
+                let u64 = self.u64;
+                events.hash(state);
+                u64.hash(state);
+            }
+        }
+
+        impl PartialEq for sockaddr_un {
+            fn eq(&self, other: &sockaddr_un) -> bool {
+                self.sun_family == other.sun_family
+                    && self
+                    .sun_path
+                    .iter()
+                    .zip(other.sun_path.iter())
+                    .all(|(a, b)| a == b)
+            }
+        }
+        impl Eq for sockaddr_un {}
+        impl ::fmt::Debug for sockaddr_un {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_un")
+                    .field("sun_family", &self.sun_family)
+                    // FIXME: .field("sun_path", &self.sun_path)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sockaddr_un {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sun_family.hash(state);
+                self.sun_path.hash(state);
+            }
+        }
+
+        impl PartialEq for utsname {
+            fn eq(&self, other: &utsname) -> bool {
+                self.sysname
+                    .iter()
+                    .zip(other.sysname.iter())
+                    .all(|(a, b)| a == b)
+                    && self
+                    .nodename
+                    .iter()
+                    .zip(other.nodename.iter())
+                    .all(|(a, b)| a == b)
+                    && self
+                    .release
+                    .iter()
+                    .zip(other.release.iter())
+                    .all(|(a, b)| a == b)
+                    && self
+                    .version
+                    .iter()
+                    .zip(other.version.iter())
+                    .all(|(a, b)| a == b)
+                    && self
+                    .machine
+                    .iter()
+                    .zip(other.machine.iter())
+                    .all(|(a, b)| a == b)
+            }
+        }
+        impl Eq for utsname {}
+        impl ::fmt::Debug for utsname {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("utsname")
+                    // FIXME: .field("sysname", &self.sysname)
+                    // FIXME: .field("nodename", &self.nodename)
+                    // FIXME: .field("release", &self.release)
+                    // FIXME: .field("version", &self.version)
+                    // FIXME: .field("machine", &self.machine)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for utsname {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sysname.hash(state);
+                self.nodename.hash(state);
+                self.release.hash(state);
+                self.version.hash(state);
+                self.machine.hash(state);
+            }
+        }
+
+        impl PartialEq for fd_set {
+            fn eq(&self, other: &fd_set) -> bool {
+                self.fds_bits
+                    .iter()
+                    .zip(other.fds_bits.iter())
+                    .all(|(a, b)| a == b)
+            }
+        }
+        impl Eq for fd_set {}
+        impl ::fmt::Debug for fd_set {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("fd_set")
+                    // FIXME: .field("fds_bits", &self.fds_bits)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for fd_set {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.fds_bits.hash(state);
+            }
+        }
+
+        impl PartialEq for sockaddr_storage {
+            fn eq(&self, other: &sockaddr_storage) -> bool {
+                self.ss_family == other.ss_family
+                    && self.__ss_pad1 == other.__ss_pad1
+                    && self.__ss_align == other.__ss_align
+                    && self
+                    .__ss_pad2
+                    .iter()
+                    .zip(other.__ss_pad2.iter())
+                    .all(|(a, b)| a == b)
+            }
+        }
+        impl Eq for sockaddr_storage {}
+        impl ::fmt::Debug for sockaddr_storage {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_storage")
+                    .field("ss_family", &self.ss_family)
+                    .field("__ss_pad1", &self.__ss_pad1)
+                    .field("__ss_align", &self.__ss_align)
+                    // FIXME: .field("__ss_pad2", &self.__ss_pad2)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sockaddr_storage {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ss_family.hash(state);
+                self.__ss_pad1.hash(state);
+                self.__ss_align.hash(state);
+                self.__ss_pad2.hash(state);
+            }
+        }
+
+        impl siginfo_t {
+            /// The siginfo_t will have differing contents based on the delivered signal.  Based on
+            /// `si_signo`, this determines how many of the `c_int` pad fields contain valid data
+            /// exposed by the C unions.
+            ///
+            /// It is not yet exhausitive for the OS-defined types, and defaults to assuming the
+            /// entire data pad area is "valid" for otherwise unrecognized signal numbers.
+            fn data_field_count(&self) -> usize {
+                match self.si_signo {
+                    ::SIGSEGV | ::SIGBUS | ::SIGILL | ::SIGTRAP | ::SIGFPE => {
+                        ::mem::size_of::<siginfo_fault>() / ::mem::size_of::<::c_int>()
+                    }
+                    ::SIGCLD => ::mem::size_of::<siginfo_sigcld>() / ::mem::size_of::<::c_int>(),
+                    ::SIGHUP
+                    | ::SIGINT
+                    | ::SIGQUIT
+                    | ::SIGABRT
+                    | ::SIGSYS
+                    | ::SIGPIPE
+                    | ::SIGALRM
+                    | ::SIGTERM
+                    | ::SIGUSR1
+                    | ::SIGUSR2
+                    | ::SIGPWR
+                    | ::SIGWINCH
+                    | ::SIGURG => ::mem::size_of::<siginfo_kill>() / ::mem::size_of::<::c_int>(),
+                    _ => SIGINFO_DATA_SIZE,
+                }
+            }
+        }
+        impl PartialEq for siginfo_t {
+            fn eq(&self, other: &siginfo_t) -> bool {
+                if self.si_signo == other.si_signo
+                    && self.si_code == other.si_code
+                    && self.si_errno == other.si_errno {
+                        // FIXME: The `si_pad` field in the 64-bit version of the struct is ignored
+                        // (for now) when doing comparisons.
+
+                        let field_count = self.data_field_count();
+                        self.__data_pad[..field_count]
+                            .iter()
+                            .zip(other.__data_pad[..field_count].iter())
+                            .all(|(a, b)| a == b)
+                } else {
+                    false
+                }
+            }
+        }
+        impl Eq for siginfo_t {}
+        impl ::fmt::Debug for siginfo_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("siginfo_t")
+                    .field("si_signo", &self.si_signo)
+                    .field("si_code", &self.si_code)
+                    .field("si_errno", &self.si_errno)
+                    // FIXME: .field("__pad", &self.__pad)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for siginfo_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.si_signo.hash(state);
+                self.si_code.hash(state);
+                self.si_errno.hash(state);
+
+                // FIXME: The `si_pad` field in the 64-bit version of the struct is ignored
+                // (for now) when doing hashing.
+
+                let field_count = self.data_field_count();
+                self.__data_pad[..field_count].hash(state)
+            }
+        }
+
+        impl PartialEq for sockaddr_dl {
+            fn eq(&self, other: &sockaddr_dl) -> bool {
+                self.sdl_family == other.sdl_family
+                    && self.sdl_index == other.sdl_index
+                    && self.sdl_type == other.sdl_type
+                    && self.sdl_nlen == other.sdl_nlen
+                    && self.sdl_alen == other.sdl_alen
+                    && self.sdl_slen == other.sdl_slen
+                    && self
+                    .sdl_data
+                    .iter()
+                    .zip(other.sdl_data.iter())
+                    .all(|(a,b)| a == b)
+            }
+        }
+        impl Eq for sockaddr_dl {}
+        impl ::fmt::Debug for sockaddr_dl {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_dl")
+                    .field("sdl_family", &self.sdl_family)
+                    .field("sdl_index", &self.sdl_index)
+                    .field("sdl_type", &self.sdl_type)
+                    .field("sdl_nlen", &self.sdl_nlen)
+                    .field("sdl_alen", &self.sdl_alen)
+                    .field("sdl_slen", &self.sdl_slen)
+                    // FIXME: .field("sdl_data", &self.sdl_data)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sockaddr_dl {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sdl_family.hash(state);
+                self.sdl_index.hash(state);
+                self.sdl_type.hash(state);
+                self.sdl_nlen.hash(state);
+                self.sdl_alen.hash(state);
+                self.sdl_slen.hash(state);
+                self.sdl_data.hash(state);
+            }
+        }
+
+        impl PartialEq for sigevent {
+            fn eq(&self, other: &sigevent) -> bool {
+                self.sigev_notify == other.sigev_notify
+                    && self.sigev_signo == other.sigev_signo
+                    && self.sigev_value == other.sigev_value
+                    && self.ss_sp == other.ss_sp
+                    && self.sigev_notify_attributes
+                        == other.sigev_notify_attributes
+            }
+        }
+        impl Eq for sigevent {}
+        impl ::fmt::Debug for sigevent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sigevent")
+                    .field("sigev_notify", &self.sigev_notify)
+                    .field("sigev_signo", &self.sigev_signo)
+                    .field("sigev_value", &self.sigev_value)
+                    .field("ss_sp", &self.ss_sp)
+                    .field("sigev_notify_attributes",
+                           &self.sigev_notify_attributes)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sigevent {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.sigev_notify.hash(state);
+                self.sigev_signo.hash(state);
+                self.sigev_value.hash(state);
+                self.ss_sp.hash(state);
+                self.sigev_notify_attributes.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl PartialEq for pad128_t {
+            fn eq(&self, other: &pad128_t) -> bool {
+                unsafe {
+                // FIXME: self._q == other._q ||
+                    self._l == other._l
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for pad128_t {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for pad128_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                f.debug_struct("pad128_t")
+                    // FIXME: .field("_q", &{self._q})
+                    .field("_l", &{self._l})
+                    .finish()
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for pad128_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                // FIXME: state.write_i64(self._q as i64);
+                self._l.hash(state);
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl PartialEq for upad128_t {
+            fn eq(&self, other: &upad128_t) -> bool {
+                unsafe {
+                // FIXME: self._q == other._q ||
+                    self._l == other._l
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for upad128_t {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for upad128_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                f.debug_struct("upad128_t")
+                    // FIXME: .field("_q", &{self._q})
+                    .field("_l", &{self._l})
+                    .finish()
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for upad128_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                // FIXME: state.write_i64(self._q as i64);
+                self._l.hash(state);
+                }
+            }
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_pointer_width = "64")] {
+        const SIGINFO_DATA_SIZE: usize = 60;
+    } else {
+        const SIGINFO_DATA_SIZE: usize = 29;
+    }
+}
+
+#[repr(C)]
+struct siginfo_fault {
+    addr: *mut ::c_void,
+    trapno: ::c_int,
+    pc: *mut ::caddr_t,
+}
+impl ::Copy for siginfo_fault {}
+impl ::Clone for siginfo_fault {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+#[repr(C)]
+struct siginfo_cldval {
+    utime: ::clock_t,
+    status: ::c_int,
+    stime: ::clock_t,
+}
+impl ::Copy for siginfo_cldval {}
+impl ::Clone for siginfo_cldval {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+#[repr(C)]
+struct siginfo_killval {
+    uid: ::uid_t,
+    value: ::sigval,
+    // Pad out to match the SIGCLD value size
+    _pad: *mut ::c_void,
+}
+impl ::Copy for siginfo_killval {}
+impl ::Clone for siginfo_killval {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+#[repr(C)]
+struct siginfo_sigcld {
+    pid: ::pid_t,
+    val: siginfo_cldval,
+    ctid: ::ctid_t,
+    zoneid: ::zoneid_t,
+}
+impl ::Copy for siginfo_sigcld {}
+impl ::Clone for siginfo_sigcld {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+#[repr(C)]
+struct siginfo_kill {
+    pid: ::pid_t,
+    val: siginfo_killval,
+    ctid: ::ctid_t,
+    zoneid: ::zoneid_t,
+}
+impl ::Copy for siginfo_kill {}
+impl ::Clone for siginfo_kill {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+impl siginfo_t {
+    unsafe fn sidata<T: ::Copy>(&self) -> T {
+        *((&self.__data_pad) as *const ::c_int as *const T)
+    }
+    pub unsafe fn si_addr(&self) -> *mut ::c_void {
+        let sifault: siginfo_fault = self.sidata();
+        sifault.addr
+    }
+    pub unsafe fn si_uid(&self) -> ::uid_t {
+        let kill: siginfo_kill = self.sidata();
+        kill.val.uid
+    }
+    pub unsafe fn si_value(&self) -> ::sigval {
+        let kill: siginfo_kill = self.sidata();
+        kill.val.value
+    }
+    pub unsafe fn si_pid(&self) -> ::pid_t {
+        let sigcld: siginfo_sigcld = self.sidata();
+        sigcld.pid
+    }
+    pub unsafe fn si_status(&self) -> ::c_int {
+        let sigcld: siginfo_sigcld = self.sidata();
+        sigcld.val.status
+    }
+    pub unsafe fn si_utime(&self) -> ::c_long {
+        let sigcld: siginfo_sigcld = self.sidata();
+        sigcld.val.utime
+    }
+    pub unsafe fn si_stime(&self) -> ::c_long {
+        let sigcld: siginfo_sigcld = self.sidata();
+        sigcld.val.stime
+    }
+}
+
+pub const LC_CTYPE: ::c_int = 0;
+pub const LC_NUMERIC: ::c_int = 1;
+pub const LC_TIME: ::c_int = 2;
+pub const LC_COLLATE: ::c_int = 3;
+pub const LC_MONETARY: ::c_int = 4;
+pub const LC_MESSAGES: ::c_int = 5;
+pub const LC_ALL: ::c_int = 6;
+pub const LC_CTYPE_MASK: ::c_int = 1 << LC_CTYPE;
+pub const LC_NUMERIC_MASK: ::c_int = 1 << LC_NUMERIC;
+pub const LC_TIME_MASK: ::c_int = 1 << LC_TIME;
+pub const LC_COLLATE_MASK: ::c_int = 1 << LC_COLLATE;
+pub const LC_MONETARY_MASK: ::c_int = 1 << LC_MONETARY;
+pub const LC_MESSAGES_MASK: ::c_int = 1 << LC_MESSAGES;
+pub const LC_ALL_MASK: ::c_int = LC_CTYPE_MASK
+    | LC_NUMERIC_MASK
+    | LC_TIME_MASK
+    | LC_COLLATE_MASK
+    | LC_MONETARY_MASK
+    | LC_MESSAGES_MASK;
+
+pub const DAY_1: ::nl_item = 1;
+pub const DAY_2: ::nl_item = 2;
+pub const DAY_3: ::nl_item = 3;
+pub const DAY_4: ::nl_item = 4;
+pub const DAY_5: ::nl_item = 5;
+pub const DAY_6: ::nl_item = 6;
+pub const DAY_7: ::nl_item = 7;
+
+pub const ABDAY_1: ::nl_item = 8;
+pub const ABDAY_2: ::nl_item = 9;
+pub const ABDAY_3: ::nl_item = 10;
+pub const ABDAY_4: ::nl_item = 11;
+pub const ABDAY_5: ::nl_item = 12;
+pub const ABDAY_6: ::nl_item = 13;
+pub const ABDAY_7: ::nl_item = 14;
+
+pub const MON_1: ::nl_item = 15;
+pub const MON_2: ::nl_item = 16;
+pub const MON_3: ::nl_item = 17;
+pub const MON_4: ::nl_item = 18;
+pub const MON_5: ::nl_item = 19;
+pub const MON_6: ::nl_item = 20;
+pub const MON_7: ::nl_item = 21;
+pub const MON_8: ::nl_item = 22;
+pub const MON_9: ::nl_item = 23;
+pub const MON_10: ::nl_item = 24;
+pub const MON_11: ::nl_item = 25;
+pub const MON_12: ::nl_item = 26;
+
+pub const ABMON_1: ::nl_item = 27;
+pub const ABMON_2: ::nl_item = 28;
+pub const ABMON_3: ::nl_item = 29;
+pub const ABMON_4: ::nl_item = 30;
+pub const ABMON_5: ::nl_item = 31;
+pub const ABMON_6: ::nl_item = 32;
+pub const ABMON_7: ::nl_item = 33;
+pub const ABMON_8: ::nl_item = 34;
+pub const ABMON_9: ::nl_item = 35;
+pub const ABMON_10: ::nl_item = 36;
+pub const ABMON_11: ::nl_item = 37;
+pub const ABMON_12: ::nl_item = 38;
+
+pub const RADIXCHAR: ::nl_item = 39;
+pub const THOUSEP: ::nl_item = 40;
+pub const YESSTR: ::nl_item = 41;
+pub const NOSTR: ::nl_item = 42;
+pub const CRNCYSTR: ::nl_item = 43;
+
+pub const D_T_FMT: ::nl_item = 44;
+pub const D_FMT: ::nl_item = 45;
+pub const T_FMT: ::nl_item = 46;
+pub const AM_STR: ::nl_item = 47;
+pub const PM_STR: ::nl_item = 48;
+
+pub const CODESET: ::nl_item = 49;
+pub const T_FMT_AMPM: ::nl_item = 50;
+pub const ERA: ::nl_item = 51;
+pub const ERA_D_FMT: ::nl_item = 52;
+pub const ERA_D_T_FMT: ::nl_item = 53;
+pub const ERA_T_FMT: ::nl_item = 54;
+pub const ALT_DIGITS: ::nl_item = 55;
+pub const YESEXPR: ::nl_item = 56;
+pub const NOEXPR: ::nl_item = 57;
+pub const _DATE_FMT: ::nl_item = 58;
+pub const MAXSTRMSG: ::nl_item = 58;
+
+pub const PATH_MAX: ::c_int = 1024;
+
+pub const SA_ONSTACK: ::c_int = 0x00000001;
+pub const SA_RESETHAND: ::c_int = 0x00000002;
+pub const SA_RESTART: ::c_int = 0x00000004;
+pub const SA_SIGINFO: ::c_int = 0x00000008;
+pub const SA_NODEFER: ::c_int = 0x00000010;
+pub const SA_NOCLDWAIT: ::c_int = 0x00010000;
+pub const SA_NOCLDSTOP: ::c_int = 0x00020000;
+
+pub const SS_ONSTACK: ::c_int = 1;
+pub const SS_DISABLE: ::c_int = 2;
+
+pub const FIOCLEX: ::c_int = 0x20006601;
+pub const FIONCLEX: ::c_int = 0x20006602;
+pub const FIONREAD: ::c_int = 0x4004667f;
+pub const FIONBIO: ::c_int = 0x8004667e;
+pub const FIOASYNC: ::c_int = 0x8004667d;
+pub const FIOSETOWN: ::c_int = 0x8004667c;
+pub const FIOGETOWN: ::c_int = 0x4004667b;
+
+pub const SIGCHLD: ::c_int = 18;
+pub const SIGCLD: ::c_int = ::SIGCHLD;
+pub const SIGBUS: ::c_int = 10;
+pub const SIGINFO: ::c_int = 41;
+pub const SIG_BLOCK: ::c_int = 1;
+pub const SIG_UNBLOCK: ::c_int = 2;
+pub const SIG_SETMASK: ::c_int = 3;
+
+pub const SIGEV_NONE: ::c_int = 1;
+pub const SIGEV_SIGNAL: ::c_int = 2;
+pub const SIGEV_THREAD: ::c_int = 3;
+
+pub const CLD_EXITED: ::c_int = 1;
+pub const CLD_KILLED: ::c_int = 2;
+pub const CLD_DUMPED: ::c_int = 3;
+pub const CLD_TRAPPED: ::c_int = 4;
+pub const CLD_STOPPED: ::c_int = 5;
+pub const CLD_CONTINUED: ::c_int = 6;
+
+pub const IP_RECVDSTADDR: ::c_int = 0x7;
+pub const IP_SEC_OPT: ::c_int = 0x22;
+
+pub const IPV6_UNICAST_HOPS: ::c_int = 0x5;
+pub const IPV6_MULTICAST_IF: ::c_int = 0x6;
+pub const IPV6_MULTICAST_HOPS: ::c_int = 0x7;
+pub const IPV6_MULTICAST_LOOP: ::c_int = 0x8;
+pub const IPV6_RECVPKTINFO: ::c_int = 0x12;
+pub const IPV6_SEC_OPT: ::c_int = 0x22;
+pub const IPV6_V6ONLY: ::c_int = 0x27;
+
+cfg_if! {
+    if #[cfg(target_pointer_width = "64")] {
+        pub const FD_SETSIZE: usize = 65536;
+    } else {
+        pub const FD_SETSIZE: usize = 1024;
+    }
+}
+
+pub const ST_RDONLY: ::c_ulong = 1;
+pub const ST_NOSUID: ::c_ulong = 2;
+
+pub const NI_MAXHOST: ::socklen_t = 1025;
+pub const NI_MAXSERV: ::socklen_t = 32;
+
+pub const EXIT_FAILURE: ::c_int = 1;
+pub const EXIT_SUCCESS: ::c_int = 0;
+pub const RAND_MAX: ::c_int = 32767;
+pub const EOF: ::c_int = -1;
+pub const SEEK_SET: ::c_int = 0;
+pub const SEEK_CUR: ::c_int = 1;
+pub const SEEK_END: ::c_int = 2;
+pub const SEEK_DATA: ::c_int = 3;
+pub const SEEK_HOLE: ::c_int = 4;
+pub const _IOFBF: ::c_int = 0;
+pub const _IONBF: ::c_int = 4;
+pub const _IOLBF: ::c_int = 64;
+pub const BUFSIZ: ::c_uint = 1024;
+pub const FOPEN_MAX: ::c_uint = 20;
+pub const FILENAME_MAX: ::c_uint = 1024;
+pub const L_tmpnam: ::c_uint = 25;
+pub const TMP_MAX: ::c_uint = 17576;
+
+pub const GRND_NONBLOCK: ::c_uint = 0x0001;
+pub const GRND_RANDOM: ::c_uint = 0x0002;
+
+pub const O_RDONLY: ::c_int = 0;
+pub const O_WRONLY: ::c_int = 1;
+pub const O_RDWR: ::c_int = 2;
+pub const O_NDELAY: ::c_int = 0x04;
+pub const O_APPEND: ::c_int = 8;
+pub const O_DSYNC: ::c_int = 0x40;
+pub const O_CREAT: ::c_int = 256;
+pub const O_EXCL: ::c_int = 1024;
+pub const O_NOCTTY: ::c_int = 2048;
+pub const O_TRUNC: ::c_int = 512;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+pub const O_SEARCH: ::c_int = 0x200000;
+pub const O_EXEC: ::c_int = 0x400000;
+pub const O_CLOEXEC: ::c_int = 0x800000;
+pub const O_ACCMODE: ::c_int = 0x600003;
+pub const O_XATTR: ::c_int = 0x4000;
+pub const O_DIRECTORY: ::c_int = 0x1000000;
+pub const O_DIRECT: ::c_int = 0x2000000;
+pub const S_IFIFO: mode_t = 4096;
+pub const S_IFCHR: mode_t = 8192;
+pub const S_IFBLK: mode_t = 24576;
+pub const S_IFDIR: mode_t = 16384;
+pub const S_IFREG: mode_t = 32768;
+pub const S_IFLNK: mode_t = 40960;
+pub const S_IFSOCK: mode_t = 49152;
+pub const S_IFMT: mode_t = 61440;
+pub const S_IEXEC: mode_t = 64;
+pub const S_IWRITE: mode_t = 128;
+pub const S_IREAD: mode_t = 256;
+pub const S_IRWXU: mode_t = 448;
+pub const S_IXUSR: mode_t = 64;
+pub const S_IWUSR: mode_t = 128;
+pub const S_IRUSR: mode_t = 256;
+pub const S_IRWXG: mode_t = 56;
+pub const S_IXGRP: mode_t = 8;
+pub const S_IWGRP: mode_t = 16;
+pub const S_IRGRP: mode_t = 32;
+pub const S_IRWXO: mode_t = 7;
+pub const S_IXOTH: mode_t = 1;
+pub const S_IWOTH: mode_t = 2;
+pub const S_IROTH: mode_t = 4;
+pub const F_OK: ::c_int = 0;
+pub const R_OK: ::c_int = 4;
+pub const W_OK: ::c_int = 2;
+pub const X_OK: ::c_int = 1;
+pub const STDIN_FILENO: ::c_int = 0;
+pub const STDOUT_FILENO: ::c_int = 1;
+pub const STDERR_FILENO: ::c_int = 2;
+pub const F_LOCK: ::c_int = 1;
+pub const F_TEST: ::c_int = 3;
+pub const F_TLOCK: ::c_int = 2;
+pub const F_ULOCK: ::c_int = 0;
+pub const F_SETLK: ::c_int = 6;
+pub const F_SETLKW: ::c_int = 7;
+pub const F_GETLK: ::c_int = 14;
+pub const F_ALLOCSP: ::c_int = 10;
+pub const F_FREESP: ::c_int = 11;
+pub const F_BLOCKS: ::c_int = 18;
+pub const F_BLKSIZE: ::c_int = 19;
+pub const F_SHARE: ::c_int = 40;
+pub const F_UNSHARE: ::c_int = 41;
+pub const F_ISSTREAM: ::c_int = 13;
+pub const F_PRIV: ::c_int = 15;
+pub const F_NPRIV: ::c_int = 16;
+pub const F_QUOTACTL: ::c_int = 17;
+pub const F_GETOWN: ::c_int = 23;
+pub const F_SETOWN: ::c_int = 24;
+pub const F_REVOKE: ::c_int = 25;
+pub const F_HASREMOTELOCKS: ::c_int = 26;
+pub const SIGHUP: ::c_int = 1;
+pub const SIGINT: ::c_int = 2;
+pub const SIGQUIT: ::c_int = 3;
+pub const SIGILL: ::c_int = 4;
+pub const SIGABRT: ::c_int = 6;
+pub const SIGEMT: ::c_int = 7;
+pub const SIGFPE: ::c_int = 8;
+pub const SIGKILL: ::c_int = 9;
+pub const SIGSEGV: ::c_int = 11;
+pub const SIGSYS: ::c_int = 12;
+pub const SIGPIPE: ::c_int = 13;
+pub const SIGALRM: ::c_int = 14;
+pub const SIGTERM: ::c_int = 15;
+pub const SIGUSR1: ::c_int = 16;
+pub const SIGUSR2: ::c_int = 17;
+pub const SIGPWR: ::c_int = 19;
+pub const SIGWINCH: ::c_int = 20;
+pub const SIGURG: ::c_int = 21;
+pub const SIGPOLL: ::c_int = 22;
+pub const SIGIO: ::c_int = SIGPOLL;
+pub const SIGSTOP: ::c_int = 23;
+pub const SIGTSTP: ::c_int = 24;
+pub const SIGCONT: ::c_int = 25;
+pub const SIGTTIN: ::c_int = 26;
+pub const SIGTTOU: ::c_int = 27;
+pub const SIGVTALRM: ::c_int = 28;
+pub const SIGPROF: ::c_int = 29;
+pub const SIGXCPU: ::c_int = 30;
+pub const SIGXFSZ: ::c_int = 31;
+
+pub const WNOHANG: ::c_int = 0x40;
+pub const WUNTRACED: ::c_int = 0x04;
+
+pub const WEXITED: ::c_int = 0x01;
+pub const WTRAPPED: ::c_int = 0x02;
+pub const WSTOPPED: ::c_int = WUNTRACED;
+pub const WCONTINUED: ::c_int = 0x08;
+pub const WNOWAIT: ::c_int = 0x80;
+
+pub const AT_FDCWD: ::c_int = 0xffd19553;
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x1000;
+pub const AT_SYMLINK_FOLLOW: ::c_int = 0x2000;
+pub const AT_REMOVEDIR: ::c_int = 0x1;
+pub const _AT_TRIGGER: ::c_int = 0x2;
+pub const AT_EACCESS: ::c_int = 0x4;
+
+pub const P_PID: idtype_t = 0;
+pub const P_PPID: idtype_t = 1;
+pub const P_PGID: idtype_t = 2;
+pub const P_SID: idtype_t = 3;
+pub const P_CID: idtype_t = 4;
+pub const P_UID: idtype_t = 5;
+pub const P_GID: idtype_t = 6;
+pub const P_ALL: idtype_t = 7;
+pub const P_LWPID: idtype_t = 8;
+pub const P_TASKID: idtype_t = 9;
+pub const P_PROJID: idtype_t = 10;
+pub const P_POOLID: idtype_t = 11;
+pub const P_ZONEID: idtype_t = 12;
+pub const P_CTID: idtype_t = 13;
+pub const P_CPUID: idtype_t = 14;
+pub const P_PSETID: idtype_t = 15;
+
+pub const PBIND_NONE: ::processorid_t = -1;
+pub const PBIND_QUERY: ::processorid_t = -2;
+pub const PBIND_HARD: ::processorid_t = -3;
+pub const PBIND_SOFT: ::processorid_t = -4;
+
+pub const PS_NONE: ::c_int = -1;
+pub const PS_QUERY: ::c_int = -2;
+pub const PS_MYID: ::c_int = -3;
+pub const PS_SOFT: ::c_int = -4;
+pub const PS_HARD: ::c_int = -5;
+pub const PS_QUERY_TYPE: ::c_int = -6;
+pub const PS_SYSTEM: ::c_int = 1;
+pub const PS_PRIVATE: ::c_int = 2;
+
+pub const UTIME_OMIT: c_long = -2;
+pub const UTIME_NOW: c_long = -1;
+
+pub const PROT_NONE: ::c_int = 0;
+pub const PROT_READ: ::c_int = 1;
+pub const PROT_WRITE: ::c_int = 2;
+pub const PROT_EXEC: ::c_int = 4;
+
+pub const MAP_FILE: ::c_int = 0;
+pub const MAP_SHARED: ::c_int = 0x0001;
+pub const MAP_PRIVATE: ::c_int = 0x0002;
+pub const MAP_FIXED: ::c_int = 0x0010;
+pub const MAP_NORESERVE: ::c_int = 0x40;
+pub const MAP_ANON: ::c_int = 0x0100;
+pub const MAP_ANONYMOUS: ::c_int = 0x0100;
+pub const MAP_RENAME: ::c_int = 0x20;
+pub const MAP_ALIGN: ::c_int = 0x200;
+pub const MAP_TEXT: ::c_int = 0x400;
+pub const MAP_INITDATA: ::c_int = 0x800;
+pub const MAP_32BIT: ::c_int = 0x80;
+pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
+
+pub const MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+
+pub const MS_SYNC: ::c_int = 0x0004;
+pub const MS_ASYNC: ::c_int = 0x0001;
+pub const MS_INVALIDATE: ::c_int = 0x0002;
+
+pub const MMOBJ_PADDING: ::c_uint = 0x10000;
+pub const MMOBJ_INTERPRET: ::c_uint = 0x20000;
+pub const MR_PADDING: ::c_uint = 0x1;
+pub const MR_HDR_ELF: ::c_uint = 0x2;
+
+pub const EPERM: ::c_int = 1;
+pub const ENOENT: ::c_int = 2;
+pub const ESRCH: ::c_int = 3;
+pub const EINTR: ::c_int = 4;
+pub const EIO: ::c_int = 5;
+pub const ENXIO: ::c_int = 6;
+pub const E2BIG: ::c_int = 7;
+pub const ENOEXEC: ::c_int = 8;
+pub const EBADF: ::c_int = 9;
+pub const ECHILD: ::c_int = 10;
+pub const EAGAIN: ::c_int = 11;
+pub const ENOMEM: ::c_int = 12;
+pub const EACCES: ::c_int = 13;
+pub const EFAULT: ::c_int = 14;
+pub const ENOTBLK: ::c_int = 15;
+pub const EBUSY: ::c_int = 16;
+pub const EEXIST: ::c_int = 17;
+pub const EXDEV: ::c_int = 18;
+pub const ENODEV: ::c_int = 19;
+pub const ENOTDIR: ::c_int = 20;
+pub const EISDIR: ::c_int = 21;
+pub const EINVAL: ::c_int = 22;
+pub const ENFILE: ::c_int = 23;
+pub const EMFILE: ::c_int = 24;
+pub const ENOTTY: ::c_int = 25;
+pub const ETXTBSY: ::c_int = 26;
+pub const EFBIG: ::c_int = 27;
+pub const ENOSPC: ::c_int = 28;
+pub const ESPIPE: ::c_int = 29;
+pub const EROFS: ::c_int = 30;
+pub const EMLINK: ::c_int = 31;
+pub const EPIPE: ::c_int = 32;
+pub const EDOM: ::c_int = 33;
+pub const ERANGE: ::c_int = 34;
+pub const ENOMSG: ::c_int = 35;
+pub const EIDRM: ::c_int = 36;
+pub const ECHRNG: ::c_int = 37;
+pub const EL2NSYNC: ::c_int = 38;
+pub const EL3HLT: ::c_int = 39;
+pub const EL3RST: ::c_int = 40;
+pub const ELNRNG: ::c_int = 41;
+pub const EUNATCH: ::c_int = 42;
+pub const ENOCSI: ::c_int = 43;
+pub const EL2HLT: ::c_int = 44;
+pub const EDEADLK: ::c_int = 45;
+pub const ENOLCK: ::c_int = 46;
+pub const ECANCELED: ::c_int = 47;
+pub const ENOTSUP: ::c_int = 48;
+pub const EDQUOT: ::c_int = 49;
+pub const EBADE: ::c_int = 50;
+pub const EBADR: ::c_int = 51;
+pub const EXFULL: ::c_int = 52;
+pub const ENOANO: ::c_int = 53;
+pub const EBADRQC: ::c_int = 54;
+pub const EBADSLT: ::c_int = 55;
+pub const EDEADLOCK: ::c_int = 56;
+pub const EBFONT: ::c_int = 57;
+pub const EOWNERDEAD: ::c_int = 58;
+pub const ENOTRECOVERABLE: ::c_int = 59;
+pub const ENOSTR: ::c_int = 60;
+pub const ENODATA: ::c_int = 61;
+pub const ETIME: ::c_int = 62;
+pub const ENOSR: ::c_int = 63;
+pub const ENONET: ::c_int = 64;
+pub const ENOPKG: ::c_int = 65;
+pub const EREMOTE: ::c_int = 66;
+pub const ENOLINK: ::c_int = 67;
+pub const EADV: ::c_int = 68;
+pub const ESRMNT: ::c_int = 69;
+pub const ECOMM: ::c_int = 70;
+pub const EPROTO: ::c_int = 71;
+pub const ELOCKUNMAPPED: ::c_int = 72;
+pub const ENOTACTIVE: ::c_int = 73;
+pub const EMULTIHOP: ::c_int = 74;
+pub const EADI: ::c_int = 75;
+pub const EBADMSG: ::c_int = 77;
+pub const ENAMETOOLONG: ::c_int = 78;
+pub const EOVERFLOW: ::c_int = 79;
+pub const ENOTUNIQ: ::c_int = 80;
+pub const EBADFD: ::c_int = 81;
+pub const EREMCHG: ::c_int = 82;
+pub const ELIBACC: ::c_int = 83;
+pub const ELIBBAD: ::c_int = 84;
+pub const ELIBSCN: ::c_int = 85;
+pub const ELIBMAX: ::c_int = 86;
+pub const ELIBEXEC: ::c_int = 87;
+pub const EILSEQ: ::c_int = 88;
+pub const ENOSYS: ::c_int = 89;
+pub const ELOOP: ::c_int = 90;
+pub const ERESTART: ::c_int = 91;
+pub const ESTRPIPE: ::c_int = 92;
+pub const ENOTEMPTY: ::c_int = 93;
+pub const EUSERS: ::c_int = 94;
+pub const ENOTSOCK: ::c_int = 95;
+pub const EDESTADDRREQ: ::c_int = 96;
+pub const EMSGSIZE: ::c_int = 97;
+pub const EPROTOTYPE: ::c_int = 98;
+pub const ENOPROTOOPT: ::c_int = 99;
+pub const EPROTONOSUPPORT: ::c_int = 120;
+pub const ESOCKTNOSUPPORT: ::c_int = 121;
+pub const EOPNOTSUPP: ::c_int = 122;
+pub const EPFNOSUPPORT: ::c_int = 123;
+pub const EAFNOSUPPORT: ::c_int = 124;
+pub const EADDRINUSE: ::c_int = 125;
+pub const EADDRNOTAVAIL: ::c_int = 126;
+pub const ENETDOWN: ::c_int = 127;
+pub const ENETUNREACH: ::c_int = 128;
+pub const ENETRESET: ::c_int = 129;
+pub const ECONNABORTED: ::c_int = 130;
+pub const ECONNRESET: ::c_int = 131;
+pub const ENOBUFS: ::c_int = 132;
+pub const EISCONN: ::c_int = 133;
+pub const ENOTCONN: ::c_int = 134;
+pub const ESHUTDOWN: ::c_int = 143;
+pub const ETOOMANYREFS: ::c_int = 144;
+pub const ETIMEDOUT: ::c_int = 145;
+pub const ECONNREFUSED: ::c_int = 146;
+pub const EHOSTDOWN: ::c_int = 147;
+pub const EHOSTUNREACH: ::c_int = 148;
+pub const EWOULDBLOCK: ::c_int = EAGAIN;
+pub const EALREADY: ::c_int = 149;
+pub const EINPROGRESS: ::c_int = 150;
+pub const ESTALE: ::c_int = 151;
+
+pub const EAI_AGAIN: ::c_int = 2;
+pub const EAI_BADFLAGS: ::c_int = 3;
+pub const EAI_FAIL: ::c_int = 4;
+pub const EAI_FAMILY: ::c_int = 5;
+pub const EAI_MEMORY: ::c_int = 6;
+pub const EAI_NODATA: ::c_int = 7;
+pub const EAI_NONAME: ::c_int = 8;
+pub const EAI_SERVICE: ::c_int = 9;
+pub const EAI_SOCKTYPE: ::c_int = 10;
+pub const EAI_SYSTEM: ::c_int = 11;
+pub const EAI_OVERFLOW: ::c_int = 12;
+
+pub const NI_NOFQDN: ::c_uint = 0x0001;
+pub const NI_NUMERICHOST: ::c_uint = 0x0002;
+pub const NI_NAMEREQD: ::c_uint = 0x0004;
+pub const NI_NUMERICSERV: ::c_uint = 0x0008;
+pub const NI_DGRAM: ::c_uint = 0x0010;
+pub const NI_WITHSCOPEID: ::c_uint = 0x0020;
+pub const NI_NUMERICSCOPE: ::c_uint = 0x0040;
+
+pub const F_DUPFD: ::c_int = 0;
+pub const F_DUP2FD: ::c_int = 9;
+pub const F_GETFD: ::c_int = 1;
+pub const F_SETFD: ::c_int = 2;
+pub const F_GETFL: ::c_int = 3;
+pub const F_SETFL: ::c_int = 4;
+pub const F_GETXFL: ::c_int = 45;
+
+pub const SIGTRAP: ::c_int = 5;
+
+pub const GLOB_APPEND: ::c_int = 32;
+pub const GLOB_DOOFFS: ::c_int = 16;
+pub const GLOB_ERR: ::c_int = 1;
+pub const GLOB_MARK: ::c_int = 2;
+pub const GLOB_NOCHECK: ::c_int = 8;
+pub const GLOB_NOSORT: ::c_int = 4;
+pub const GLOB_NOESCAPE: ::c_int = 64;
+
+pub const GLOB_NOSPACE: ::c_int = -2;
+pub const GLOB_ABORTED: ::c_int = -1;
+pub const GLOB_NOMATCH: ::c_int = -3;
+
+pub const POLLIN: ::c_short = 0x1;
+pub const POLLPRI: ::c_short = 0x2;
+pub const POLLOUT: ::c_short = 0x4;
+pub const POLLERR: ::c_short = 0x8;
+pub const POLLHUP: ::c_short = 0x10;
+pub const POLLNVAL: ::c_short = 0x20;
+pub const POLLNORM: ::c_short = 0x0040;
+pub const POLLRDNORM: ::c_short = 0x0040;
+pub const POLLWRNORM: ::c_short = 0x4; /* POLLOUT */
+pub const POLLRDBAND: ::c_short = 0x0080;
+pub const POLLWRBAND: ::c_short = 0x0100;
+
+pub const POSIX_MADV_NORMAL: ::c_int = 0;
+pub const POSIX_MADV_RANDOM: ::c_int = 1;
+pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
+pub const POSIX_MADV_WILLNEED: ::c_int = 3;
+pub const POSIX_MADV_DONTNEED: ::c_int = 4;
+
+pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
+pub const PTHREAD_CREATE_DETACHED: ::c_int = 0x40;
+pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
+pub const PTHREAD_PROCESS_PRIVATE: ::c_ushort = 0;
+pub const PTHREAD_STACK_MIN: ::size_t = 4096;
+
+pub const SIGSTKSZ: ::size_t = 8192;
+
+// https://illumos.org/man/3c/clock_gettime
+// https://github.com/illumos/illumos-gate/
+//   blob/HEAD/usr/src/lib/libc/amd64/sys/__clock_gettime.s
+// clock_gettime(3c) doesn't seem to accept anything other than CLOCK_REALTIME
+// or __CLOCK_REALTIME0
+//
+// https://github.com/illumos/illumos-gate/
+//   blob/HEAD/usr/src/uts/common/sys/time_impl.h
+// Confusing! CLOCK_HIGHRES==CLOCK_MONOTONIC==4
+// __CLOCK_REALTIME0==0 is an obsoleted version of CLOCK_REALTIME==3
+pub const CLOCK_REALTIME: ::clockid_t = 3;
+pub const CLOCK_MONOTONIC: ::clockid_t = 4;
+pub const TIMER_RELTIME: ::c_int = 0;
+pub const TIMER_ABSTIME: ::c_int = 1;
+
+pub const RLIMIT_CPU: ::c_int = 0;
+pub const RLIMIT_FSIZE: ::c_int = 1;
+pub const RLIMIT_DATA: ::c_int = 2;
+pub const RLIMIT_STACK: ::c_int = 3;
+pub const RLIMIT_CORE: ::c_int = 4;
+pub const RLIMIT_NOFILE: ::c_int = 5;
+pub const RLIMIT_VMEM: ::c_int = 6;
+pub const RLIMIT_AS: ::c_int = RLIMIT_VMEM;
+
+#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+pub const RLIM_NLIMITS: rlim_t = 7;
+pub const RLIM_INFINITY: rlim_t = 0xfffffffffffffffd;
+
+pub const RUSAGE_SELF: ::c_int = 0;
+pub const RUSAGE_CHILDREN: ::c_int = -1;
+
+pub const MADV_NORMAL: ::c_int = 0;
+pub const MADV_RANDOM: ::c_int = 1;
+pub const MADV_SEQUENTIAL: ::c_int = 2;
+pub const MADV_WILLNEED: ::c_int = 3;
+pub const MADV_DONTNEED: ::c_int = 4;
+pub const MADV_FREE: ::c_int = 5;
+pub const MADV_ACCESS_DEFAULT: ::c_int = 6;
+pub const MADV_ACCESS_LWP: ::c_int = 7;
+pub const MADV_ACCESS_MANY: ::c_int = 8;
+
+pub const AF_UNSPEC: ::c_int = 0;
+pub const AF_UNIX: ::c_int = 1;
+pub const AF_INET: ::c_int = 2;
+pub const AF_IMPLINK: ::c_int = 3;
+pub const AF_PUP: ::c_int = 4;
+pub const AF_CHAOS: ::c_int = 5;
+pub const AF_NS: ::c_int = 6;
+pub const AF_NBS: ::c_int = 7;
+pub const AF_ECMA: ::c_int = 8;
+pub const AF_DATAKIT: ::c_int = 9;
+pub const AF_CCITT: ::c_int = 10;
+pub const AF_SNA: ::c_int = 11;
+pub const AF_DECnet: ::c_int = 12;
+pub const AF_DLI: ::c_int = 13;
+pub const AF_LAT: ::c_int = 14;
+pub const AF_HYLINK: ::c_int = 15;
+pub const AF_APPLETALK: ::c_int = 16;
+pub const AF_NIT: ::c_int = 17;
+pub const AF_802: ::c_int = 18;
+pub const AF_OSI: ::c_int = 19;
+pub const AF_X25: ::c_int = 20;
+pub const AF_OSINET: ::c_int = 21;
+pub const AF_GOSIP: ::c_int = 22;
+pub const AF_IPX: ::c_int = 23;
+pub const AF_ROUTE: ::c_int = 24;
+pub const AF_LINK: ::c_int = 25;
+pub const AF_INET6: ::c_int = 26;
+pub const AF_KEY: ::c_int = 27;
+pub const AF_NCA: ::c_int = 28;
+pub const AF_POLICY: ::c_int = 29;
+pub const AF_INET_OFFLOAD: ::c_int = 30;
+pub const AF_TRILL: ::c_int = 31;
+pub const AF_PACKET: ::c_int = 32;
+
+pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
+pub const PF_UNIX: ::c_int = AF_UNIX;
+pub const PF_LOCAL: ::c_int = PF_UNIX;
+pub const PF_FILE: ::c_int = PF_UNIX;
+pub const PF_INET: ::c_int = AF_INET;
+pub const PF_IMPLINK: ::c_int = AF_IMPLINK;
+pub const PF_PUP: ::c_int = AF_PUP;
+pub const PF_CHAOS: ::c_int = AF_CHAOS;
+pub const PF_NS: ::c_int = AF_NS;
+pub const PF_NBS: ::c_int = AF_NBS;
+pub const PF_ECMA: ::c_int = AF_ECMA;
+pub const PF_DATAKIT: ::c_int = AF_DATAKIT;
+pub const PF_CCITT: ::c_int = AF_CCITT;
+pub const PF_SNA: ::c_int = AF_SNA;
+pub const PF_DECnet: ::c_int = AF_DECnet;
+pub const PF_DLI: ::c_int = AF_DLI;
+pub const PF_LAT: ::c_int = AF_LAT;
+pub const PF_HYLINK: ::c_int = AF_HYLINK;
+pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
+pub const PF_NIT: ::c_int = AF_NIT;
+pub const PF_802: ::c_int = AF_802;
+pub const PF_OSI: ::c_int = AF_OSI;
+pub const PF_X25: ::c_int = AF_X25;
+pub const PF_OSINET: ::c_int = AF_OSINET;
+pub const PF_GOSIP: ::c_int = AF_GOSIP;
+pub const PF_IPX: ::c_int = AF_IPX;
+pub const PF_ROUTE: ::c_int = AF_ROUTE;
+pub const PF_LINK: ::c_int = AF_LINK;
+pub const PF_INET6: ::c_int = AF_INET6;
+pub const PF_KEY: ::c_int = AF_KEY;
+pub const PF_NCA: ::c_int = AF_NCA;
+pub const PF_POLICY: ::c_int = AF_POLICY;
+pub const PF_INET_OFFLOAD: ::c_int = AF_INET_OFFLOAD;
+pub const PF_TRILL: ::c_int = AF_TRILL;
+pub const PF_PACKET: ::c_int = AF_PACKET;
+
+pub const SOCK_DGRAM: ::c_int = 1;
+pub const SOCK_STREAM: ::c_int = 2;
+pub const SOCK_RAW: ::c_int = 4;
+pub const SOCK_RDM: ::c_int = 5;
+pub const SOCK_SEQPACKET: ::c_int = 6;
+pub const IP_MULTICAST_IF: ::c_int = 16;
+pub const IP_MULTICAST_TTL: ::c_int = 17;
+pub const IP_MULTICAST_LOOP: ::c_int = 18;
+pub const IP_TTL: ::c_int = 4;
+pub const IP_HDRINCL: ::c_int = 2;
+pub const IP_ADD_MEMBERSHIP: ::c_int = 19;
+pub const IP_DROP_MEMBERSHIP: ::c_int = 20;
+pub const IPV6_JOIN_GROUP: ::c_int = 9;
+pub const IPV6_LEAVE_GROUP: ::c_int = 10;
+pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 23;
+pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 24;
+pub const IP_BLOCK_SOURCE: ::c_int = 21;
+pub const IP_UNBLOCK_SOURCE: ::c_int = 22;
+
+// These TCP socket options are common between illumos and Solaris, while higher
+// numbers have generally diverged:
+pub const TCP_NODELAY: ::c_int = 0x1;
+pub const TCP_MAXSEG: ::c_int = 0x2;
+pub const TCP_KEEPALIVE: ::c_int = 0x8;
+pub const TCP_NOTIFY_THRESHOLD: ::c_int = 0x10;
+pub const TCP_ABORT_THRESHOLD: ::c_int = 0x11;
+pub const TCP_CONN_NOTIFY_THRESHOLD: ::c_int = 0x12;
+pub const TCP_CONN_ABORT_THRESHOLD: ::c_int = 0x13;
+pub const TCP_RECVDSTADDR: ::c_int = 0x14;
+pub const TCP_INIT_CWND: ::c_int = 0x15;
+pub const TCP_KEEPALIVE_THRESHOLD: ::c_int = 0x16;
+pub const TCP_KEEPALIVE_ABORT_THRESHOLD: ::c_int = 0x17;
+pub const TCP_CORK: ::c_int = 0x18;
+pub const TCP_RTO_INITIAL: ::c_int = 0x19;
+pub const TCP_RTO_MIN: ::c_int = 0x1a;
+pub const TCP_RTO_MAX: ::c_int = 0x1b;
+pub const TCP_LINGER2: ::c_int = 0x1c;
+
+pub const UDP_NAT_T_ENDPOINT: ::c_int = 0x0103;
+
+pub const SOMAXCONN: ::c_int = 128;
+
+pub const SOL_SOCKET: ::c_int = 0xffff;
+pub const SO_DEBUG: ::c_int = 0x01;
+pub const SO_ACCEPTCONN: ::c_int = 0x0002;
+pub const SO_REUSEADDR: ::c_int = 0x0004;
+pub const SO_KEEPALIVE: ::c_int = 0x0008;
+pub const SO_DONTROUTE: ::c_int = 0x0010;
+pub const SO_BROADCAST: ::c_int = 0x0020;
+pub const SO_USELOOPBACK: ::c_int = 0x0040;
+pub const SO_LINGER: ::c_int = 0x0080;
+pub const SO_OOBINLINE: ::c_int = 0x0100;
+pub const SO_SNDBUF: ::c_int = 0x1001;
+pub const SO_RCVBUF: ::c_int = 0x1002;
+pub const SO_SNDLOWAT: ::c_int = 0x1003;
+pub const SO_RCVLOWAT: ::c_int = 0x1004;
+pub const SO_SNDTIMEO: ::c_int = 0x1005;
+pub const SO_RCVTIMEO: ::c_int = 0x1006;
+pub const SO_ERROR: ::c_int = 0x1007;
+pub const SO_TYPE: ::c_int = 0x1008;
+pub const SO_PROTOTYPE: ::c_int = 0x1009;
+pub const SO_DOMAIN: ::c_int = 0x100c;
+pub const SO_TIMESTAMP: ::c_int = 0x1013;
+pub const SO_EXCLBIND: ::c_int = 0x1015;
+
+pub const SCM_RIGHTS: ::c_int = 0x1010;
+pub const SCM_UCRED: ::c_int = 0x1012;
+pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
+
+pub const MSG_OOB: ::c_int = 0x1;
+pub const MSG_PEEK: ::c_int = 0x2;
+pub const MSG_DONTROUTE: ::c_int = 0x4;
+pub const MSG_EOR: ::c_int = 0x8;
+pub const MSG_CTRUNC: ::c_int = 0x10;
+pub const MSG_TRUNC: ::c_int = 0x20;
+pub const MSG_WAITALL: ::c_int = 0x40;
+pub const MSG_DONTWAIT: ::c_int = 0x80;
+pub const MSG_NOTIFICATION: ::c_int = 0x100;
+pub const MSG_NOSIGNAL: ::c_int = 0x200;
+pub const MSG_DUPCTRL: ::c_int = 0x800;
+pub const MSG_XPG4_2: ::c_int = 0x8000;
+pub const MSG_MAXIOVLEN: ::c_int = 16;
+
+pub const IF_NAMESIZE: ::size_t = 32;
+pub const IFNAMSIZ: ::size_t = 16;
+
+// https://docs.oracle.com/cd/E23824_01/html/821-1475/if-7p.html
+pub const IFF_UP: ::c_int = 0x0000000001; // Address is up
+pub const IFF_BROADCAST: ::c_int = 0x0000000002; // Broadcast address valid
+pub const IFF_DEBUG: ::c_int = 0x0000000004; // Turn on debugging
+pub const IFF_LOOPBACK: ::c_int = 0x0000000008; // Loopback net
+pub const IFF_POINTOPOINT: ::c_int = 0x0000000010; // Interface is p-to-p
+pub const IFF_NOTRAILERS: ::c_int = 0x0000000020; // Avoid use of trailers
+pub const IFF_RUNNING: ::c_int = 0x0000000040; // Resources allocated
+pub const IFF_NOARP: ::c_int = 0x0000000080; // No address res. protocol
+pub const IFF_PROMISC: ::c_int = 0x0000000100; // Receive all packets
+pub const IFF_ALLMULTI: ::c_int = 0x0000000200; // Receive all multicast pkts
+pub const IFF_INTELLIGENT: ::c_int = 0x0000000400; // Protocol code on board
+pub const IFF_MULTICAST: ::c_int = 0x0000000800; // Supports multicast
+
+// Multicast using broadcst. add.
+pub const IFF_MULTI_BCAST: ::c_int = 0x0000001000;
+pub const IFF_UNNUMBERED: ::c_int = 0x0000002000; // Non-unique address
+pub const IFF_DHCPRUNNING: ::c_int = 0x0000004000; // DHCP controls interface
+pub const IFF_PRIVATE: ::c_int = 0x0000008000; // Do not advertise
+pub const IFF_NOXMIT: ::c_int = 0x0000010000; // Do not transmit pkts
+
+// No address - just on-link subnet
+pub const IFF_NOLOCAL: ::c_int = 0x0000020000;
+pub const IFF_DEPRECATED: ::c_int = 0x0000040000; // Address is deprecated
+pub const IFF_ADDRCONF: ::c_int = 0x0000080000; // Addr. from stateless addrconf
+pub const IFF_ROUTER: ::c_int = 0x0000100000; // Router on interface
+pub const IFF_NONUD: ::c_int = 0x0000200000; // No NUD on interface
+pub const IFF_ANYCAST: ::c_int = 0x0000400000; // Anycast address
+pub const IFF_NORTEXCH: ::c_int = 0x0000800000; // Don't xchange rout. info
+pub const IFF_IPV4: ::c_int = 0x0001000000; // IPv4 interface
+pub const IFF_IPV6: ::c_int = 0x0002000000; // IPv6 interface
+pub const IFF_NOFAILOVER: ::c_int = 0x0008000000; // in.mpathd test address
+pub const IFF_FAILED: ::c_int = 0x0010000000; // Interface has failed
+pub const IFF_STANDBY: ::c_int = 0x0020000000; // Interface is a hot-spare
+pub const IFF_INACTIVE: ::c_int = 0x0040000000; // Functioning but not used
+pub const IFF_OFFLINE: ::c_int = 0x0080000000; // Interface is offline
+                                               // If CoS marking is supported
+pub const IFF_COS_ENABLED: ::c_longlong = 0x0200000000;
+pub const IFF_PREFERRED: ::c_longlong = 0x0400000000; // Prefer as source addr.
+pub const IFF_TEMPORARY: ::c_longlong = 0x0800000000; // RFC3041
+pub const IFF_FIXEDMTU: ::c_longlong = 0x1000000000; // MTU set with SIOCSLIFMTU
+pub const IFF_VIRTUAL: ::c_longlong = 0x2000000000; // Cannot send/receive pkts
+pub const IFF_DUPLICATE: ::c_longlong = 0x4000000000; // Local address in use
+pub const IFF_IPMP: ::c_longlong = 0x8000000000; // IPMP IP interface
+
+// sys/ipc.h:
+pub const IPC_ALLOC: ::c_int = 0x8000;
+pub const IPC_CREAT: ::c_int = 0x200;
+pub const IPC_EXCL: ::c_int = 0x400;
+pub const IPC_NOWAIT: ::c_int = 0x800;
+pub const IPC_PRIVATE: key_t = 0;
+pub const IPC_RMID: ::c_int = 10;
+pub const IPC_SET: ::c_int = 11;
+pub const IPC_SEAT: ::c_int = 12;
+
+// sys/shm.h
+pub const SHM_R: ::c_int = 0o400;
+pub const SHM_W: ::c_int = 0o200;
+pub const SHM_RDONLY: ::c_int = 0o10000;
+pub const SHM_RND: ::c_int = 0o20000;
+pub const SHM_SHARE_MMU: ::c_int = 0o40000;
+pub const SHM_PAGEABLE: ::c_int = 0o100000;
+
+pub const SHUT_RD: ::c_int = 0;
+pub const SHUT_WR: ::c_int = 1;
+pub const SHUT_RDWR: ::c_int = 2;
+
+pub const LOCK_SH: ::c_int = 1;
+pub const LOCK_EX: ::c_int = 2;
+pub const LOCK_NB: ::c_int = 4;
+pub const LOCK_UN: ::c_int = 8;
+
+pub const F_RDLCK: ::c_short = 1;
+pub const F_WRLCK: ::c_short = 2;
+pub const F_UNLCK: ::c_short = 3;
+
+pub const O_SYNC: ::c_int = 16;
+pub const O_NONBLOCK: ::c_int = 128;
+
+pub const IPPROTO_RAW: ::c_int = 255;
+
+pub const _PC_LINK_MAX: ::c_int = 1;
+pub const _PC_MAX_CANON: ::c_int = 2;
+pub const _PC_MAX_INPUT: ::c_int = 3;
+pub const _PC_NAME_MAX: ::c_int = 4;
+pub const _PC_PATH_MAX: ::c_int = 5;
+pub const _PC_PIPE_BUF: ::c_int = 6;
+pub const _PC_NO_TRUNC: ::c_int = 7;
+pub const _PC_VDISABLE: ::c_int = 8;
+pub const _PC_CHOWN_RESTRICTED: ::c_int = 9;
+pub const _PC_ASYNC_IO: ::c_int = 10;
+pub const _PC_PRIO_IO: ::c_int = 11;
+pub const _PC_SYNC_IO: ::c_int = 12;
+pub const _PC_ALLOC_SIZE_MIN: ::c_int = 13;
+pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14;
+pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15;
+pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16;
+pub const _PC_REC_XFER_ALIGN: ::c_int = 17;
+pub const _PC_SYMLINK_MAX: ::c_int = 18;
+pub const _PC_2_SYMLINKS: ::c_int = 19;
+pub const _PC_ACL_ENABLED: ::c_int = 20;
+pub const _PC_MIN_HOLE_SIZE: ::c_int = 21;
+pub const _PC_CASE_BEHAVIOR: ::c_int = 22;
+pub const _PC_SATTR_ENABLED: ::c_int = 23;
+pub const _PC_SATTR_EXISTS: ::c_int = 24;
+pub const _PC_ACCESS_FILTERING: ::c_int = 25;
+pub const _PC_TIMESTAMP_RESOLUTION: ::c_int = 26;
+pub const _PC_FILESIZEBITS: ::c_int = 67;
+pub const _PC_XATTR_ENABLED: ::c_int = 100;
+pub const _PC_LAST: ::c_int = 101;
+pub const _PC_XATTR_EXISTS: ::c_int = 101;
+
+pub const _SC_ARG_MAX: ::c_int = 1;
+pub const _SC_CHILD_MAX: ::c_int = 2;
+pub const _SC_CLK_TCK: ::c_int = 3;
+pub const _SC_NGROUPS_MAX: ::c_int = 4;
+pub const _SC_OPEN_MAX: ::c_int = 5;
+pub const _SC_JOB_CONTROL: ::c_int = 6;
+pub const _SC_SAVED_IDS: ::c_int = 7;
+pub const _SC_VERSION: ::c_int = 8;
+pub const _SC_PASS_MAX: ::c_int = 9;
+pub const _SC_LOGNAME_MAX: ::c_int = 10;
+pub const _SC_PAGESIZE: ::c_int = 11;
+pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
+pub const _SC_XOPEN_VERSION: ::c_int = 12;
+pub const _SC_NPROCESSORS_CONF: ::c_int = 14;
+pub const _SC_NPROCESSORS_ONLN: ::c_int = 15;
+pub const _SC_STREAM_MAX: ::c_int = 16;
+pub const _SC_TZNAME_MAX: ::c_int = 17;
+pub const _SC_AIO_LISTIO_MAX: ::c_int = 18;
+pub const _SC_AIO_MAX: ::c_int = 19;
+pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 20;
+pub const _SC_ASYNCHRONOUS_IO: ::c_int = 21;
+pub const _SC_DELAYTIMER_MAX: ::c_int = 22;
+pub const _SC_FSYNC: ::c_int = 23;
+pub const _SC_MAPPED_FILES: ::c_int = 24;
+pub const _SC_MEMLOCK: ::c_int = 25;
+pub const _SC_MEMLOCK_RANGE: ::c_int = 26;
+pub const _SC_MEMORY_PROTECTION: ::c_int = 27;
+pub const _SC_MESSAGE_PASSING: ::c_int = 28;
+pub const _SC_MQ_OPEN_MAX: ::c_int = 29;
+pub const _SC_MQ_PRIO_MAX: ::c_int = 30;
+pub const _SC_PRIORITIZED_IO: ::c_int = 31;
+pub const _SC_PRIORITY_SCHEDULING: ::c_int = 32;
+pub const _SC_REALTIME_SIGNALS: ::c_int = 33;
+pub const _SC_RTSIG_MAX: ::c_int = 34;
+pub const _SC_SEMAPHORES: ::c_int = 35;
+pub const _SC_SEM_NSEMS_MAX: ::c_int = 36;
+pub const _SC_SEM_VALUE_MAX: ::c_int = 37;
+pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 38;
+pub const _SC_SIGQUEUE_MAX: ::c_int = 39;
+pub const _SC_SIGRT_MIN: ::c_int = 40;
+pub const _SC_SIGRT_MAX: ::c_int = 41;
+pub const _SC_SYNCHRONIZED_IO: ::c_int = 42;
+pub const _SC_TIMERS: ::c_int = 43;
+pub const _SC_TIMER_MAX: ::c_int = 44;
+pub const _SC_2_C_BIND: ::c_int = 45;
+pub const _SC_2_C_DEV: ::c_int = 46;
+pub const _SC_2_C_VERSION: ::c_int = 47;
+pub const _SC_2_FORT_DEV: ::c_int = 48;
+pub const _SC_2_FORT_RUN: ::c_int = 49;
+pub const _SC_2_LOCALEDEF: ::c_int = 50;
+pub const _SC_2_SW_DEV: ::c_int = 51;
+pub const _SC_2_UPE: ::c_int = 52;
+pub const _SC_2_VERSION: ::c_int = 53;
+pub const _SC_BC_BASE_MAX: ::c_int = 54;
+pub const _SC_BC_DIM_MAX: ::c_int = 55;
+pub const _SC_BC_SCALE_MAX: ::c_int = 56;
+pub const _SC_BC_STRING_MAX: ::c_int = 57;
+pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 58;
+pub const _SC_EXPR_NEST_MAX: ::c_int = 59;
+pub const _SC_LINE_MAX: ::c_int = 60;
+pub const _SC_RE_DUP_MAX: ::c_int = 61;
+pub const _SC_XOPEN_CRYPT: ::c_int = 62;
+pub const _SC_XOPEN_ENH_I18N: ::c_int = 63;
+pub const _SC_XOPEN_SHM: ::c_int = 64;
+pub const _SC_2_CHAR_TERM: ::c_int = 66;
+pub const _SC_XOPEN_XCU_VERSION: ::c_int = 67;
+pub const _SC_ATEXIT_MAX: ::c_int = 76;
+pub const _SC_IOV_MAX: ::c_int = 77;
+pub const _SC_XOPEN_UNIX: ::c_int = 78;
+pub const _SC_T_IOV_MAX: ::c_int = 79;
+pub const _SC_PHYS_PAGES: ::c_int = 500;
+pub const _SC_AVPHYS_PAGES: ::c_int = 501;
+pub const _SC_COHER_BLKSZ: ::c_int = 503;
+pub const _SC_SPLIT_CACHE: ::c_int = 504;
+pub const _SC_ICACHE_SZ: ::c_int = 505;
+pub const _SC_DCACHE_SZ: ::c_int = 506;
+pub const _SC_ICACHE_LINESZ: ::c_int = 507;
+pub const _SC_DCACHE_LINESZ: ::c_int = 508;
+pub const _SC_ICACHE_BLKSZ: ::c_int = 509;
+pub const _SC_DCACHE_BLKSZ: ::c_int = 510;
+pub const _SC_DCACHE_TBLKSZ: ::c_int = 511;
+pub const _SC_ICACHE_ASSOC: ::c_int = 512;
+pub const _SC_DCACHE_ASSOC: ::c_int = 513;
+pub const _SC_MAXPID: ::c_int = 514;
+pub const _SC_STACK_PROT: ::c_int = 515;
+pub const _SC_NPROCESSORS_MAX: ::c_int = 516;
+pub const _SC_CPUID_MAX: ::c_int = 517;
+pub const _SC_EPHID_MAX: ::c_int = 518;
+pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 568;
+pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 569;
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 570;
+pub const _SC_LOGIN_NAME_MAX: ::c_int = 571;
+pub const _SC_THREAD_KEYS_MAX: ::c_int = 572;
+pub const _SC_THREAD_STACK_MIN: ::c_int = 573;
+pub const _SC_THREAD_THREADS_MAX: ::c_int = 574;
+pub const _SC_TTY_NAME_MAX: ::c_int = 575;
+pub const _SC_THREADS: ::c_int = 576;
+pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 577;
+pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 578;
+pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 579;
+pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 580;
+pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 581;
+pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 582;
+pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 583;
+pub const _SC_XOPEN_LEGACY: ::c_int = 717;
+pub const _SC_XOPEN_REALTIME: ::c_int = 718;
+pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 719;
+pub const _SC_XBS5_ILP32_OFF32: ::c_int = 720;
+pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 721;
+pub const _SC_XBS5_LP64_OFF64: ::c_int = 722;
+pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 723;
+pub const _SC_2_PBS: ::c_int = 724;
+pub const _SC_2_PBS_ACCOUNTING: ::c_int = 725;
+pub const _SC_2_PBS_CHECKPOINT: ::c_int = 726;
+pub const _SC_2_PBS_LOCATE: ::c_int = 728;
+pub const _SC_2_PBS_MESSAGE: ::c_int = 729;
+pub const _SC_2_PBS_TRACK: ::c_int = 730;
+pub const _SC_ADVISORY_INFO: ::c_int = 731;
+pub const _SC_BARRIERS: ::c_int = 732;
+pub const _SC_CLOCK_SELECTION: ::c_int = 733;
+pub const _SC_CPUTIME: ::c_int = 734;
+pub const _SC_HOST_NAME_MAX: ::c_int = 735;
+pub const _SC_MONOTONIC_CLOCK: ::c_int = 736;
+pub const _SC_READER_WRITER_LOCKS: ::c_int = 737;
+pub const _SC_REGEXP: ::c_int = 738;
+pub const _SC_SHELL: ::c_int = 739;
+pub const _SC_SPAWN: ::c_int = 740;
+pub const _SC_SPIN_LOCKS: ::c_int = 741;
+pub const _SC_SPORADIC_SERVER: ::c_int = 742;
+pub const _SC_SS_REPL_MAX: ::c_int = 743;
+pub const _SC_SYMLOOP_MAX: ::c_int = 744;
+pub const _SC_THREAD_CPUTIME: ::c_int = 745;
+pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 746;
+pub const _SC_TIMEOUTS: ::c_int = 747;
+pub const _SC_TRACE: ::c_int = 748;
+pub const _SC_TRACE_EVENT_FILTER: ::c_int = 749;
+pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 750;
+pub const _SC_TRACE_INHERIT: ::c_int = 751;
+pub const _SC_TRACE_LOG: ::c_int = 752;
+pub const _SC_TRACE_NAME_MAX: ::c_int = 753;
+pub const _SC_TRACE_SYS_MAX: ::c_int = 754;
+pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 755;
+pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 756;
+pub const _SC_V6_ILP32_OFF32: ::c_int = 757;
+pub const _SC_V6_ILP32_OFFBIG: ::c_int = 758;
+pub const _SC_V6_LP64_OFF64: ::c_int = 759;
+pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 760;
+pub const _SC_XOPEN_STREAMS: ::c_int = 761;
+pub const _SC_IPV6: ::c_int = 762;
+pub const _SC_RAW_SOCKETS: ::c_int = 763;
+
+pub const _MUTEX_MAGIC: u16 = 0x4d58; // MX
+pub const _COND_MAGIC: u16 = 0x4356; // CV
+pub const _RWL_MAGIC: u16 = 0x5257; // RW
+
+pub const NCCS: usize = 19;
+
+pub const LOG_CRON: ::c_int = 15 << 3;
+
+pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+    __pthread_mutex_flag1: 0,
+    __pthread_mutex_flag2: 0,
+    __pthread_mutex_ceiling: 0,
+    __pthread_mutex_type: PTHREAD_PROCESS_PRIVATE,
+    __pthread_mutex_magic: _MUTEX_MAGIC,
+    __pthread_mutex_lock: 0,
+    __pthread_mutex_data: 0,
+};
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+    __pthread_cond_flag: [0; 4],
+    __pthread_cond_type: PTHREAD_PROCESS_PRIVATE,
+    __pthread_cond_magic: _COND_MAGIC,
+    __pthread_cond_data: 0,
+};
+pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+    __pthread_rwlock_readers: 0,
+    __pthread_rwlock_type: PTHREAD_PROCESS_PRIVATE,
+    __pthread_rwlock_magic: _RWL_MAGIC,
+    __pthread_rwlock_mutex: PTHREAD_MUTEX_INITIALIZER,
+    __pthread_rwlock_readercv: PTHREAD_COND_INITIALIZER,
+    __pthread_rwlock_writercv: PTHREAD_COND_INITIALIZER,
+};
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
+pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 4;
+pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
+
+pub const RTLD_NEXT: *mut ::c_void = -1isize as *mut ::c_void;
+pub const RTLD_DEFAULT: *mut ::c_void = -2isize as *mut ::c_void;
+pub const RTLD_SELF: *mut ::c_void = -3isize as *mut ::c_void;
+pub const RTLD_PROBE: *mut ::c_void = -4isize as *mut ::c_void;
+
+pub const RTLD_LAZY: ::c_int = 0x1;
+pub const RTLD_NOW: ::c_int = 0x2;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_LOCAL: ::c_int = 0x0;
+pub const RTLD_PARENT: ::c_int = 0x200;
+pub const RTLD_GROUP: ::c_int = 0x400;
+pub const RTLD_WORLD: ::c_int = 0x800;
+pub const RTLD_NODELETE: ::c_int = 0x1000;
+pub const RTLD_FIRST: ::c_int = 0x2000;
+pub const RTLD_CONFGEN: ::c_int = 0x10000;
+
+pub const PORT_SOURCE_AIO: ::c_int = 1;
+pub const PORT_SOURCE_TIMER: ::c_int = 2;
+pub const PORT_SOURCE_USER: ::c_int = 3;
+pub const PORT_SOURCE_FD: ::c_int = 4;
+pub const PORT_SOURCE_ALERT: ::c_int = 5;
+pub const PORT_SOURCE_MQ: ::c_int = 6;
+pub const PORT_SOURCE_FILE: ::c_int = 7;
+
+pub const NONROOT_USR: ::c_short = 2;
+pub const _UTX_USERSIZE: usize = 32;
+pub const _UTX_LINESIZE: usize = 32;
+pub const _UTX_PADSIZE: usize = 5;
+pub const _UTX_IDSIZE: usize = 4;
+pub const _UTX_HOSTSIZE: usize = 257;
+pub const EMPTY: ::c_short = 0;
+pub const RUN_LVL: ::c_short = 1;
+pub const BOOT_TIME: ::c_short = 2;
+pub const OLD_TIME: ::c_short = 3;
+pub const NEW_TIME: ::c_short = 4;
+pub const INIT_PROCESS: ::c_short = 5;
+pub const LOGIN_PROCESS: ::c_short = 6;
+pub const USER_PROCESS: ::c_short = 7;
+pub const DEAD_PROCESS: ::c_short = 8;
+pub const ACCOUNTING: ::c_short = 9;
+pub const DOWN_TIME: ::c_short = 10;
+
+const _TIOC: ::c_int = ('T' as i32) << 8;
+const tIOC: ::c_int = ('t' as i32) << 8;
+pub const TCGETA: ::c_int = _TIOC | 1;
+pub const TCSETA: ::c_int = _TIOC | 2;
+pub const TCSETAW: ::c_int = _TIOC | 3;
+pub const TCSETAF: ::c_int = _TIOC | 4;
+pub const TCSBRK: ::c_int = _TIOC | 5;
+pub const TCXONC: ::c_int = _TIOC | 6;
+pub const TCFLSH: ::c_int = _TIOC | 7;
+pub const TCDSET: ::c_int = _TIOC | 32;
+pub const TCGETS: ::c_int = _TIOC | 13;
+pub const TCSETS: ::c_int = _TIOC | 14;
+pub const TCSANOW: ::c_int = _TIOC | 14;
+pub const TCSETSW: ::c_int = _TIOC | 15;
+pub const TCSADRAIN: ::c_int = _TIOC | 15;
+pub const TCSETSF: ::c_int = _TIOC | 16;
+pub const TCSAFLUSH: ::c_int = _TIOC | 16;
+pub const TCIFLUSH: ::c_int = 0;
+pub const TCOFLUSH: ::c_int = 1;
+pub const TCIOFLUSH: ::c_int = 2;
+pub const TCOOFF: ::c_int = 0;
+pub const TCOON: ::c_int = 1;
+pub const TCIOFF: ::c_int = 2;
+pub const TCION: ::c_int = 3;
+pub const TIOC: ::c_int = _TIOC;
+pub const TIOCKBON: ::c_int = _TIOC | 8;
+pub const TIOCKBOF: ::c_int = _TIOC | 9;
+pub const TIOCGWINSZ: ::c_int = _TIOC | 104;
+pub const TIOCSWINSZ: ::c_int = _TIOC | 103;
+pub const TIOCGSOFTCAR: ::c_int = _TIOC | 105;
+pub const TIOCSSOFTCAR: ::c_int = _TIOC | 106;
+pub const TIOCGPPS: ::c_int = _TIOC | 125;
+pub const TIOCSPPS: ::c_int = _TIOC | 126;
+pub const TIOCGPPSEV: ::c_int = _TIOC | 127;
+pub const TIOCGETD: ::c_int = tIOC | 0;
+pub const TIOCSETD: ::c_int = tIOC | 1;
+pub const TIOCHPCL: ::c_int = tIOC | 2;
+pub const TIOCGETP: ::c_int = tIOC | 8;
+pub const TIOCSETP: ::c_int = tIOC | 9;
+pub const TIOCSETN: ::c_int = tIOC | 10;
+pub const TIOCEXCL: ::c_int = tIOC | 13;
+pub const TIOCNXCL: ::c_int = tIOC | 14;
+pub const TIOCFLUSH: ::c_int = tIOC | 16;
+pub const TIOCSETC: ::c_int = tIOC | 17;
+pub const TIOCGETC: ::c_int = tIOC | 18;
+pub const TIOCLBIS: ::c_int = tIOC | 127;
+pub const TIOCLBIC: ::c_int = tIOC | 126;
+pub const TIOCLSET: ::c_int = tIOC | 125;
+pub const TIOCLGET: ::c_int = tIOC | 124;
+pub const TIOCSBRK: ::c_int = tIOC | 123;
+pub const TIOCCBRK: ::c_int = tIOC | 122;
+pub const TIOCSDTR: ::c_int = tIOC | 121;
+pub const TIOCCDTR: ::c_int = tIOC | 120;
+pub const TIOCSLTC: ::c_int = tIOC | 117;
+pub const TIOCGLTC: ::c_int = tIOC | 116;
+pub const TIOCOUTQ: ::c_int = tIOC | 115;
+pub const TIOCNOTTY: ::c_int = tIOC | 113;
+pub const TIOCSCTTY: ::c_int = tIOC | 132;
+pub const TIOCSTOP: ::c_int = tIOC | 111;
+pub const TIOCSTART: ::c_int = tIOC | 110;
+pub const TIOCSILOOP: ::c_int = tIOC | 109;
+pub const TIOCCILOOP: ::c_int = tIOC | 108;
+pub const TIOCGPGRP: ::c_int = tIOC | 20;
+pub const TIOCSPGRP: ::c_int = tIOC | 21;
+pub const TIOCGSID: ::c_int = tIOC | 22;
+pub const TIOCSTI: ::c_int = tIOC | 23;
+pub const TIOCMSET: ::c_int = tIOC | 26;
+pub const TIOCMBIS: ::c_int = tIOC | 27;
+pub const TIOCMBIC: ::c_int = tIOC | 28;
+pub const TIOCMGET: ::c_int = tIOC | 29;
+pub const TIOCREMOTE: ::c_int = tIOC | 30;
+pub const TIOCSIGNAL: ::c_int = tIOC | 31;
+
+pub const TIOCM_LE: ::c_int = 0o0001;
+pub const TIOCM_DTR: ::c_int = 0o0002;
+pub const TIOCM_RTS: ::c_int = 0o0004;
+pub const TIOCM_ST: ::c_int = 0o0010;
+pub const TIOCM_SR: ::c_int = 0o0020;
+pub const TIOCM_CTS: ::c_int = 0o0040;
+pub const TIOCM_CAR: ::c_int = 0o0100;
+pub const TIOCM_CD: ::c_int = TIOCM_CAR;
+pub const TIOCM_RNG: ::c_int = 0o0200;
+pub const TIOCM_RI: ::c_int = TIOCM_RNG;
+pub const TIOCM_DSR: ::c_int = 0o0400;
+
+pub const EPOLLIN: ::c_int = 0x1;
+pub const EPOLLPRI: ::c_int = 0x2;
+pub const EPOLLOUT: ::c_int = 0x4;
+pub const EPOLLRDNORM: ::c_int = 0x40;
+pub const EPOLLRDBAND: ::c_int = 0x80;
+pub const EPOLLWRNORM: ::c_int = 0x100;
+pub const EPOLLWRBAND: ::c_int = 0x200;
+pub const EPOLLMSG: ::c_int = 0x400;
+pub const EPOLLERR: ::c_int = 0x8;
+pub const EPOLLHUP: ::c_int = 0x10;
+pub const EPOLLET: ::c_int = 0x80000000;
+pub const EPOLLRDHUP: ::c_int = 0x2000;
+pub const EPOLLONESHOT: ::c_int = 0x40000000;
+pub const EPOLLWAKEUP: ::c_int = 0x20000000;
+pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000;
+pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
+pub const EPOLL_CTL_ADD: ::c_int = 1;
+pub const EPOLL_CTL_MOD: ::c_int = 3;
+pub const EPOLL_CTL_DEL: ::c_int = 2;
+
+/* termios */
+pub const B0: speed_t = 0;
+pub const B50: speed_t = 1;
+pub const B75: speed_t = 2;
+pub const B110: speed_t = 3;
+pub const B134: speed_t = 4;
+pub const B150: speed_t = 5;
+pub const B200: speed_t = 6;
+pub const B300: speed_t = 7;
+pub const B600: speed_t = 8;
+pub const B1200: speed_t = 9;
+pub const B1800: speed_t = 10;
+pub const B2400: speed_t = 11;
+pub const B4800: speed_t = 12;
+pub const B9600: speed_t = 13;
+pub const B19200: speed_t = 14;
+pub const B38400: speed_t = 15;
+pub const B57600: speed_t = 16;
+pub const B76800: speed_t = 17;
+pub const B115200: speed_t = 18;
+pub const B153600: speed_t = 19;
+pub const B230400: speed_t = 20;
+pub const B307200: speed_t = 21;
+pub const B460800: speed_t = 22;
+pub const B921600: speed_t = 23;
+pub const CSTART: ::tcflag_t = 0o21;
+pub const CSTOP: ::tcflag_t = 0o23;
+pub const CSWTCH: ::tcflag_t = 0o32;
+pub const CBAUD: ::tcflag_t = 0o17;
+pub const CIBAUD: ::tcflag_t = 0o3600000;
+pub const CBAUDEXT: ::tcflag_t = 0o10000000;
+pub const CIBAUDEXT: ::tcflag_t = 0o20000000;
+pub const CSIZE: ::tcflag_t = 0o000060;
+pub const CS5: ::tcflag_t = 0;
+pub const CS6: ::tcflag_t = 0o000020;
+pub const CS7: ::tcflag_t = 0o000040;
+pub const CS8: ::tcflag_t = 0o000060;
+pub const CSTOPB: ::tcflag_t = 0o000100;
+pub const ECHO: ::tcflag_t = 0o000010;
+pub const ECHOE: ::tcflag_t = 0o000020;
+pub const ECHOK: ::tcflag_t = 0o000040;
+pub const ECHONL: ::tcflag_t = 0o000100;
+pub const ECHOCTL: ::tcflag_t = 0o001000;
+pub const ECHOPRT: ::tcflag_t = 0o002000;
+pub const ECHOKE: ::tcflag_t = 0o004000;
+pub const EXTPROC: ::tcflag_t = 0o200000;
+pub const IGNBRK: ::tcflag_t = 0o000001;
+pub const BRKINT: ::tcflag_t = 0o000002;
+pub const IGNPAR: ::tcflag_t = 0o000004;
+pub const PARMRK: ::tcflag_t = 0o000010;
+pub const INPCK: ::tcflag_t = 0o000020;
+pub const ISTRIP: ::tcflag_t = 0o000040;
+pub const INLCR: ::tcflag_t = 0o000100;
+pub const IGNCR: ::tcflag_t = 0o000200;
+pub const ICRNL: ::tcflag_t = 0o000400;
+pub const IUCLC: ::tcflag_t = 0o001000;
+pub const IXON: ::tcflag_t = 0o002000;
+pub const IXOFF: ::tcflag_t = 0o010000;
+pub const IXANY: ::tcflag_t = 0o004000;
+pub const IMAXBEL: ::tcflag_t = 0o020000;
+pub const DOSMODE: ::tcflag_t = 0o100000;
+pub const OPOST: ::tcflag_t = 0o000001;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const ONLCR: ::tcflag_t = 0o000004;
+pub const OCRNL: ::tcflag_t = 0o000010;
+pub const ONOCR: ::tcflag_t = 0o000020;
+pub const ONLRET: ::tcflag_t = 0o000040;
+pub const OFILL: ::tcflag_t = 0o0000100;
+pub const OFDEL: ::tcflag_t = 0o0000200;
+pub const CREAD: ::tcflag_t = 0o000200;
+pub const PARENB: ::tcflag_t = 0o000400;
+pub const PARODD: ::tcflag_t = 0o001000;
+pub const HUPCL: ::tcflag_t = 0o002000;
+pub const CLOCAL: ::tcflag_t = 0o004000;
+pub const CRTSXOFF: ::tcflag_t = 0o10000000000;
+pub const CRTSCTS: ::tcflag_t = 0o20000000000;
+pub const ISIG: ::tcflag_t = 0o000001;
+pub const ICANON: ::tcflag_t = 0o000002;
+pub const IEXTEN: ::tcflag_t = 0o100000;
+pub const TOSTOP: ::tcflag_t = 0o000400;
+pub const FLUSHO: ::tcflag_t = 0o020000;
+pub const PENDIN: ::tcflag_t = 0o040000;
+pub const NOFLSH: ::tcflag_t = 0o000200;
+pub const VINTR: usize = 0;
+pub const VQUIT: usize = 1;
+pub const VERASE: usize = 2;
+pub const VKILL: usize = 3;
+pub const VEOF: usize = 4;
+pub const VEOL: usize = 5;
+pub const VEOL2: usize = 6;
+pub const VMIN: usize = 4;
+pub const VTIME: usize = 5;
+pub const VSWTCH: usize = 7;
+pub const VSTART: usize = 8;
+pub const VSTOP: usize = 9;
+pub const VSUSP: usize = 10;
+pub const VDSUSP: usize = 11;
+pub const VREPRINT: usize = 12;
+pub const VDISCARD: usize = 13;
+pub const VWERASE: usize = 14;
+pub const VLNEXT: usize = 15;
+pub const VSTATUS: usize = 16;
+pub const VERASE2: usize = 17;
+
+// <sys/stropts.h>
+const STR: ::c_int = (b'S' as ::c_int) << 8;
+pub const I_NREAD: ::c_int = STR | 0o1;
+pub const I_PUSH: ::c_int = STR | 0o2;
+pub const I_POP: ::c_int = STR | 0o3;
+pub const I_LOOK: ::c_int = STR | 0o4;
+pub const I_FLUSH: ::c_int = STR | 0o5;
+pub const I_SRDOPT: ::c_int = STR | 0o6;
+pub const I_GRDOPT: ::c_int = STR | 0o7;
+pub const I_STR: ::c_int = STR | 0o10;
+pub const I_SETSIG: ::c_int = STR | 0o11;
+pub const I_GETSIG: ::c_int = STR | 0o12;
+pub const I_FIND: ::c_int = STR | 0o13;
+pub const I_LINK: ::c_int = STR | 0o14;
+pub const I_UNLINK: ::c_int = STR | 0o15;
+pub const I_PEEK: ::c_int = STR | 0o17;
+pub const I_FDINSERT: ::c_int = STR | 0o20;
+pub const I_SENDFD: ::c_int = STR | 0o21;
+pub const I_RECVFD: ::c_int = STR | 0o16;
+pub const I_SWROPT: ::c_int = STR | 0o23;
+pub const I_GWROPT: ::c_int = STR | 0o24;
+pub const I_LIST: ::c_int = STR | 0o25;
+pub const I_PLINK: ::c_int = STR | 0o26;
+pub const I_PUNLINK: ::c_int = STR | 0o27;
+pub const I_ANCHOR: ::c_int = STR | 0o30;
+pub const I_FLUSHBAND: ::c_int = STR | 0o34;
+pub const I_CKBAND: ::c_int = STR | 0o35;
+pub const I_GETBAND: ::c_int = STR | 0o36;
+pub const I_ATMARK: ::c_int = STR | 0o37;
+pub const I_SETCLTIME: ::c_int = STR | 0o40;
+pub const I_GETCLTIME: ::c_int = STR | 0o41;
+pub const I_CANPUT: ::c_int = STR | 0o42;
+pub const I_SERROPT: ::c_int = STR | 0o43;
+pub const I_GERROPT: ::c_int = STR | 0o44;
+pub const I_ESETSIG: ::c_int = STR | 0o45;
+pub const I_EGETSIG: ::c_int = STR | 0o46;
+pub const __I_PUSH_NOCTTY: ::c_int = STR | 0o47;
+
+// 3SOCKET flags
+pub const SOCK_CLOEXEC: ::c_int = 0x080000;
+pub const SOCK_NONBLOCK: ::c_int = 0x100000;
+pub const SOCK_NDELAY: ::c_int = 0x200000;
+
+//<sys/timex.h>
+pub const SCALE_KG: ::c_int = 1 << 6;
+pub const SCALE_KF: ::c_int = 1 << 16;
+pub const SCALE_KH: ::c_int = 1 << 2;
+pub const MAXTC: ::c_int = 1 << 6;
+pub const SCALE_PHASE: ::c_int = 1 << 22;
+pub const SCALE_USEC: ::c_int = 1 << 16;
+pub const SCALE_UPDATE: ::c_int = SCALE_KG * MAXTC;
+pub const FINEUSEC: ::c_int = 1 << 22;
+pub const MAXPHASE: ::c_int = 512000;
+pub const MAXFREQ: ::c_int = 512 * SCALE_USEC;
+pub const MAXTIME: ::c_int = 200 << PPS_AVG;
+pub const MINSEC: ::c_int = 16;
+pub const MAXSEC: ::c_int = 1200;
+pub const PPS_AVG: ::c_int = 2;
+pub const PPS_SHIFT: ::c_int = 2;
+pub const PPS_SHIFTMAX: ::c_int = 8;
+pub const PPS_VALID: ::c_int = 120;
+pub const MAXGLITCH: ::c_int = 30;
+pub const MOD_OFFSET: u32 = 0x0001;
+pub const MOD_FREQUENCY: u32 = 0x0002;
+pub const MOD_MAXERROR: u32 = 0x0004;
+pub const MOD_ESTERROR: u32 = 0x0008;
+pub const MOD_STATUS: u32 = 0x0010;
+pub const MOD_TIMECONST: u32 = 0x0020;
+pub const MOD_CLKB: u32 = 0x4000;
+pub const MOD_CLKA: u32 = 0x8000;
+pub const STA_PLL: u32 = 0x0001;
+pub const STA_PPSFREQ: i32 = 0x0002;
+pub const STA_PPSTIME: i32 = 0x0004;
+pub const STA_FLL: i32 = 0x0008;
+pub const STA_INS: i32 = 0x0010;
+pub const STA_DEL: i32 = 0x0020;
+pub const STA_UNSYNC: i32 = 0x0040;
+pub const STA_FREQHOLD: i32 = 0x0080;
+pub const STA_PPSSIGNAL: i32 = 0x0100;
+pub const STA_PPSJITTER: i32 = 0x0200;
+pub const STA_PPSWANDER: i32 = 0x0400;
+pub const STA_PPSERROR: i32 = 0x0800;
+pub const STA_CLOCKERR: i32 = 0x1000;
+pub const STA_RONLY: i32 =
+    STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | STA_PPSERROR | STA_CLOCKERR;
+pub const TIME_OK: i32 = 0;
+pub const TIME_INS: i32 = 1;
+pub const TIME_DEL: i32 = 2;
+pub const TIME_OOP: i32 = 3;
+pub const TIME_WAIT: i32 = 4;
+pub const TIME_ERROR: i32 = 5;
+
+pub const PRIO_PROCESS: ::c_int = 0;
+pub const PRIO_PGRP: ::c_int = 1;
+pub const PRIO_USER: ::c_int = 2;
+
+pub const SCHED_OTHER: ::c_int = 0;
+pub const SCHED_FIFO: ::c_int = 1;
+pub const SCHED_RR: ::c_int = 2;
+pub const SCHED_SYS: ::c_int = 3;
+pub const SCHED_IA: ::c_int = 4;
+pub const SCHED_FSS: ::c_int = 5;
+pub const SCHED_FX: ::c_int = 6;
+
+// sys/priv.h
+pub const PRIV_DEBUG: ::c_uint = 0x0001;
+pub const PRIV_AWARE: ::c_uint = 0x0002;
+pub const PRIV_AWARE_INHERIT: ::c_uint = 0x0004;
+pub const __PROC_PROTECT: ::c_uint = 0x0008;
+pub const NET_MAC_AWARE: ::c_uint = 0x0010;
+pub const NET_MAC_AWARE_INHERIT: ::c_uint = 0x0020;
+pub const PRIV_AWARE_RESET: ::c_uint = 0x0040;
+pub const PRIV_XPOLICY: ::c_uint = 0x0080;
+pub const PRIV_PFEXEC: ::c_uint = 0x0100;
+pub const PRIV_USER: ::c_uint = PRIV_DEBUG
+    | NET_MAC_AWARE
+    | NET_MAC_AWARE_INHERIT
+    | PRIV_XPOLICY
+    | PRIV_AWARE_RESET
+    | PRIV_PFEXEC;
+
+// sys/systeminfo.h
+pub const SI_SYSNAME: ::c_int = 1;
+pub const SI_HOSTNAME: ::c_int = 2;
+pub const SI_RELEASE: ::c_int = 3;
+pub const SI_VERSION: ::c_int = 4;
+pub const SI_MACHINE: ::c_int = 5;
+pub const SI_ARCHITECTURE: ::c_int = 6;
+pub const SI_HW_SERIAL: ::c_int = 7;
+pub const SI_HW_PROVIDER: ::c_int = 8;
+pub const SI_SET_HOSTNAME: ::c_int = 258;
+pub const SI_SET_SRPC_DOMAIN: ::c_int = 265;
+pub const SI_PLATFORM: ::c_int = 513;
+pub const SI_ISALIST: ::c_int = 514;
+pub const SI_DHCP_CACHE: ::c_int = 515;
+pub const SI_ARCHITECTURE_32: ::c_int = 516;
+pub const SI_ARCHITECTURE_64: ::c_int = 517;
+pub const SI_ARCHITECTURE_K: ::c_int = 518;
+pub const SI_ARCHITECTURE_NATIVE: ::c_int = 519;
+
+// sys/lgrp_user.h
+pub const LGRP_COOKIE_NONE: ::lgrp_cookie_t = 0;
+pub const LGRP_AFF_NONE: ::lgrp_affinity_t = 0x0;
+pub const LGRP_AFF_WEAK: ::lgrp_affinity_t = 0x10;
+pub const LGRP_AFF_STRONG: ::lgrp_affinity_t = 0x100;
+pub const LGRP_RSRC_COUNT: ::lgrp_rsrc_t = 2;
+pub const LGRP_RSRC_CPU: ::lgrp_rsrc_t = 0;
+pub const LGRP_RSRC_MEM: ::lgrp_rsrc_t = 1;
+pub const LGRP_CONTENT_ALL: ::lgrp_content_t = 0;
+pub const LGRP_CONTENT_HIERARCHY: ::lgrp_content_t = LGRP_CONTENT_ALL;
+pub const LGRP_CONTENT_DIRECT: ::lgrp_content_t = 1;
+pub const LGRP_LAT_CPU_TO_MEM: ::lgrp_lat_between_t = 0;
+pub const LGRP_MEM_SZ_FREE: ::lgrp_mem_size_flag_t = 0;
+pub const LGRP_MEM_SZ_INSTALLED: ::lgrp_mem_size_flag_t = 1;
+pub const LGRP_VIEW_CALLER: ::lgrp_view_t = 0;
+pub const LGRP_VIEW_OS: ::lgrp_view_t = 1;
+
+// sys/processor.h
+
+pub const P_OFFLINE: ::c_int = 0x001;
+pub const P_ONLINE: ::c_int = 0x002;
+pub const P_STATUS: ::c_int = 0x003;
+pub const P_FAULTED: ::c_int = 0x004;
+pub const P_POWEROFF: ::c_int = 0x005;
+pub const P_NOINTR: ::c_int = 0x006;
+pub const P_SPARE: ::c_int = 0x007;
+pub const P_DISABLED: ::c_int = 0x008;
+pub const P_FORCED: ::c_int = 0x10000000;
+pub const PI_TYPELEN: ::c_int = 16;
+pub const PI_FPUTYPE: ::c_int = 32;
+
+// sys/auxv.h
+pub const AT_SUN_HWCAP: ::c_uint = 2009;
+pub const AT_SUN_HWCAP2: ::c_uint = 2023;
+pub const AT_SUN_FPTYPE: ::c_uint = 2027;
+
+// As per sys/socket.h, header alignment must be 8 bytes on SPARC
+// and 4 bytes everywhere else:
+#[cfg(target_arch = "sparc64")]
+const _CMSG_HDR_ALIGNMENT: usize = 8;
+#[cfg(not(target_arch = "sparc64"))]
+const _CMSG_HDR_ALIGNMENT: usize = 4;
+
+const _CMSG_DATA_ALIGNMENT: usize = ::mem::size_of::<::c_int>();
+
+const NEWDEV: ::c_int = 1;
+
+// sys/sendfile.h
+pub const SFV_FD_SELF: ::c_int = -2;
+
+const_fn! {
+    {const} fn _CMSG_HDR_ALIGN(p: usize) -> usize {
+        (p + _CMSG_HDR_ALIGNMENT - 1) & !(_CMSG_HDR_ALIGNMENT - 1)
+    }
+
+    {const} fn _CMSG_DATA_ALIGN(p: usize) -> usize {
+        (p + _CMSG_DATA_ALIGNMENT - 1) & !(_CMSG_DATA_ALIGNMENT - 1)
+    }
+}
+
+f! {
+    pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
+        _CMSG_DATA_ALIGN(cmsg.offset(1) as usize) as *mut ::c_uchar
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        _CMSG_DATA_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
+    }
+
+    pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr {
+        if ((*mhdr).msg_controllen as usize) < ::mem::size_of::<::cmsghdr>() {
+            0 as *mut ::cmsghdr
+        } else {
+            (*mhdr).msg_control as *mut ::cmsghdr
+        }
+    }
+
+    pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
+        -> *mut ::cmsghdr
+    {
+        if cmsg.is_null() {
+            return ::CMSG_FIRSTHDR(mhdr);
+        };
+        let next = _CMSG_HDR_ALIGN(cmsg as usize + (*cmsg).cmsg_len as usize
+            + ::mem::size_of::<::cmsghdr>());
+        let max = (*mhdr).msg_control as usize
+            + (*mhdr).msg_controllen as usize;
+        if next > max {
+            0 as *mut ::cmsghdr
+        } else {
+            _CMSG_HDR_ALIGN(cmsg as usize + (*cmsg).cmsg_len as usize)
+                as *mut ::cmsghdr
+        }
+    }
+
+    pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
+        _CMSG_HDR_ALIGN(::mem::size_of::<::cmsghdr>() as usize
+            + length as usize) as ::c_uint
+    }
+
+    pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
+        let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        let fd = fd as usize;
+        (*set).fds_bits[fd / bits] &= !(1 << (fd % bits));
+        return
+    }
+
+    pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
+        let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        let fd = fd as usize;
+        return ((*set).fds_bits[fd / bits] & (1 << (fd % bits))) != 0
+    }
+
+    pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
+        let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
+        let fd = fd as usize;
+        (*set).fds_bits[fd / bits] |= 1 << (fd % bits);
+        return
+    }
+
+    pub fn FD_ZERO(set: *mut fd_set) -> () {
+        for slot in (*set).fds_bits.iter_mut() {
+            *slot = 0;
+        }
+    }
+}
+
+safe_f! {
+    pub {const} fn WIFEXITED(status: ::c_int) -> bool {
+        (status & 0xFF) == 0
+    }
+
+    pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int {
+        (status >> 8) & 0xFF
+    }
+
+    pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int {
+        status & 0x7F
+    }
+
+    pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
+        (status & 0xffff) == 0xffff
+    }
+
+    pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
+        (status & 0xff00) >> 8
+    }
+
+    pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
+        ((status & 0xff) > 0) && (status & 0xff00 == 0)
+    }
+
+    pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
+        ((status & 0xff) == 0x7f) && ((status & 0xff00) != 0)
+    }
+
+    pub {const} fn WCOREDUMP(status: ::c_int) -> bool {
+        (status & 0x80) != 0
+    }
+
+    pub {const} fn MR_GET_TYPE(flags: ::c_uint) -> ::c_uint {
+        flags & 0x0000ffff
+    }
+}
+
+extern "C" {
+    pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
+    pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
+
+    pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
+
+    pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
+    pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
+
+    pub fn abs(i: ::c_int) -> ::c_int;
+    pub fn acct(filename: *const ::c_char) -> ::c_int;
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
+    pub fn labs(i: ::c_long) -> ::c_long;
+    pub fn rand() -> ::c_int;
+    pub fn srand(seed: ::c_uint);
+    pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
+    pub fn getrandom(bbuf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
+    pub fn settimeofday(tp: *const ::timeval, tz: *const ::c_void) -> ::c_int;
+    pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
+    pub fn freeifaddrs(ifa: *mut ::ifaddrs);
+
+    pub fn stack_getbounds(sp: *mut ::stack_t) -> ::c_int;
+    pub fn getgrouplist(
+        name: *const ::c_char,
+        basegid: ::gid_t,
+        groups: *mut ::gid_t,
+        ngroups: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
+    pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int;
+    pub fn ioctl(fildes: ::c_int, request: ::c_int, ...) -> ::c_int;
+    pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+    pub fn ___errno() -> *mut ::c_int;
+    pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_nanosleep(
+        clk_id: ::clockid_t,
+        flags: ::c_int,
+        rqtp: *const ::timespec,
+        rmtp: *mut ::timespec,
+    ) -> ::c_int;
+    pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+    pub fn getnameinfo(
+        sa: *const ::sockaddr,
+        salen: ::socklen_t,
+        host: *mut ::c_char,
+        hostlen: ::socklen_t,
+        serv: *mut ::c_char,
+        servlen: ::socklen_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn setpwent();
+    pub fn endpwent();
+    pub fn getpwent() -> *mut passwd;
+    pub fn fdatasync(fd: ::c_int) -> ::c_int;
+    pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
+    pub fn duplocale(base: ::locale_t) -> ::locale_t;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+    pub fn uselocale(loc: ::locale_t) -> ::locale_t;
+    pub fn getprogname() -> *const ::c_char;
+    pub fn setprogname(name: *const ::c_char);
+    pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
+    pub fn getpriority(which: ::c_int, who: ::c_int) -> ::c_int;
+    pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int;
+
+    pub fn mknodat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::mode_t,
+        dev: dev_t,
+    ) -> ::c_int;
+    pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
+    pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int;
+    pub fn if_nameindex() -> *mut if_nameindex;
+    pub fn if_freenameindex(ptr: *mut if_nameindex);
+    pub fn pthread_create(
+        native: *mut ::pthread_t,
+        attr: *const ::pthread_attr_t,
+        f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
+        value: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn pthread_attr_getstack(
+        attr: *const ::pthread_attr_t,
+        stackaddr: *mut *mut ::c_void,
+        stacksize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_condattr_getclock(
+        attr: *const pthread_condattr_t,
+        clock_id: *mut clockid_t,
+    ) -> ::c_int;
+    pub fn pthread_condattr_setclock(
+        attr: *mut pthread_condattr_t,
+        clock_id: ::clockid_t,
+    ) -> ::c_int;
+    pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
+    pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
+    pub fn pthread_mutex_timedlock(
+        lock: *mut pthread_mutex_t,
+        abstime: *const ::timespec,
+    ) -> ::c_int;
+    pub fn pthread_getname_np(tid: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
+    pub fn pthread_setname_np(tid: ::pthread_t, name: *const ::c_char) -> ::c_int;
+    pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
+        -> ::c_int;
+
+    #[cfg_attr(target_os = "illumos", link_name = "_glob_ext")]
+    pub fn glob(
+        pattern: *const ::c_char,
+        flags: ::c_int,
+        errfunc: ::Option<extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut ::glob_t,
+    ) -> ::c_int;
+
+    #[cfg_attr(target_os = "illumos", link_name = "_globfree_ext")]
+    pub fn globfree(pglob: *mut ::glob_t);
+
+    pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+
+    pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
+
+    pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
+
+    pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
+
+    pub fn shmget(key: key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
+
+    pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int;
+    pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
+
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+
+    pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
+    pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+
+    pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+
+    pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
+
+    pub fn recvfrom(
+        socket: ::c_int,
+        buf: *mut ::c_void,
+        len: ::size_t,
+        flags: ::c_int,
+        addr: *mut ::sockaddr,
+        addrlen: *mut ::socklen_t,
+    ) -> ::ssize_t;
+    pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
+    pub fn futimesat(fd: ::c_int, path: *const ::c_char, times: *const ::timeval) -> ::c_int;
+    pub fn futimens(dirfd: ::c_int, times: *const ::timespec) -> ::c_int;
+    pub fn utimensat(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::timespec,
+        flag: ::c_int,
+    ) -> ::c_int;
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+
+    #[cfg_attr(target_os = "illumos", link_name = "__xnet_bind")]
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
+
+    pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+
+    #[cfg_attr(target_os = "illumos", link_name = "__xnet_sendmsg")]
+    pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+    #[cfg_attr(target_os = "illumos", link_name = "__xnet_recvmsg")]
+    pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
+    pub fn accept4(
+        fd: ::c_int,
+        address: *mut sockaddr,
+        address_len: *mut socklen_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+
+    pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
+    pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
+    pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
+    pub fn mq_receive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+    ) -> ::ssize_t;
+    pub fn mq_timedreceive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::ssize_t;
+    pub fn mq_send(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+    ) -> ::c_int;
+    pub fn mq_timedsend(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
+    pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
+    pub fn port_create() -> ::c_int;
+    pub fn port_associate(
+        port: ::c_int,
+        source: ::c_int,
+        object: ::uintptr_t,
+        events: ::c_int,
+        user: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn port_dissociate(port: ::c_int, source: ::c_int, object: ::uintptr_t) -> ::c_int;
+    pub fn port_get(port: ::c_int, pe: *mut port_event, timeout: *mut ::timespec) -> ::c_int;
+    pub fn port_getn(
+        port: ::c_int,
+        pe_list: *mut port_event,
+        max: ::c_uint,
+        nget: *mut ::c_uint,
+        timeout: *mut ::timespec,
+    ) -> ::c_int;
+    pub fn port_send(port: ::c_int, events: ::c_int, user: *mut ::c_void) -> ::c_int;
+    pub fn port_sendn(
+        port_list: *mut ::c_int,
+        error_list: *mut ::c_int,
+        nent: ::c_uint,
+        events: ::c_int,
+        user: *mut ::c_void,
+    ) -> ::c_int;
+    #[cfg_attr(
+        any(target_os = "solaris", target_os = "illumos"),
+        link_name = "__posix_getgrgid_r"
+    )]
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
+    pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
+    pub fn sem_close(sem: *mut sem_t) -> ::c_int;
+    pub fn getdtablesize() -> ::c_int;
+
+    // The epoll functions are actually only present on illumos.  However,
+    // there are things using epoll on illumos (built using the
+    // x86_64-pc-solaris target) which would break until the illumos target is
+    // present in rustc.
+    pub fn epoll_pwait(
+        epfd: ::c_int,
+        events: *mut ::epoll_event,
+        maxevents: ::c_int,
+        timeout: ::c_int,
+        sigmask: *const ::sigset_t,
+    ) -> ::c_int;
+
+    pub fn epoll_create(size: ::c_int) -> ::c_int;
+    pub fn epoll_create1(flags: ::c_int) -> ::c_int;
+    pub fn epoll_wait(
+        epfd: ::c_int,
+        events: *mut ::epoll_event,
+        maxevents: ::c_int,
+        timeout: ::c_int,
+    ) -> ::c_int;
+    pub fn epoll_ctl(epfd: ::c_int, op: ::c_int, fd: ::c_int, event: *mut ::epoll_event)
+        -> ::c_int;
+
+    #[cfg_attr(
+        any(target_os = "solaris", target_os = "illumos"),
+        link_name = "__posix_getgrnam_r"
+    )]
+    pub fn getgrnam_r(
+        name: *const ::c_char,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn thr_self() -> ::thread_t;
+    pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
+    pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
+    pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
+    pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
+    pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
+    pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
+    pub fn sched_getparam(pid: ::pid_t, param: *mut sched_param) -> ::c_int;
+    pub fn sched_setparam(pid: ::pid_t, param: *const sched_param) -> ::c_int;
+    pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
+    pub fn sched_setscheduler(
+        pid: ::pid_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
+    pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
+    #[cfg_attr(
+        any(target_os = "solaris", target_os = "illumos"),
+        link_name = "__posix_getpwnam_r"
+    )]
+    pub fn getpwnam_r(
+        name: *const ::c_char,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+    #[cfg_attr(
+        any(target_os = "solaris", target_os = "illumos"),
+        link_name = "__posix_getpwuid_r"
+    )]
+    pub fn getpwuid_r(
+        uid: ::uid_t,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+    #[cfg_attr(
+        any(target_os = "solaris", target_os = "illumos"),
+        link_name = "getpwent_r"
+    )]
+    fn native_getpwent_r(pwd: *mut passwd, buf: *mut ::c_char, buflen: ::c_int) -> *mut passwd;
+    #[cfg_attr(
+        any(target_os = "solaris", target_os = "illumos"),
+        link_name = "getgrent_r"
+    )]
+    fn native_getgrent_r(grp: *mut ::group, buf: *mut ::c_char, buflen: ::c_int) -> *mut ::group;
+    #[cfg_attr(
+        any(target_os = "solaris", target_os = "illumos"),
+        link_name = "__posix_sigwait"
+    )]
+    pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
+    pub fn pthread_atfork(
+        prepare: ::Option<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+    pub fn setgrent();
+    pub fn endgrent();
+    pub fn getgrent() -> *mut ::group;
+    pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
+
+    pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn uname(buf: *mut ::utsname) -> ::c_int;
+    pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
+
+    pub fn makeutx(ux: *const utmpx) -> *mut utmpx;
+    pub fn modutx(ux: *const utmpx) -> *mut utmpx;
+    pub fn updwtmpx(file: *const ::c_char, ut: *const utmpx) -> ::c_int;
+    pub fn utmpxname(file: *const ::c_char) -> ::c_int;
+    pub fn getutxent() -> *mut utmpx;
+    pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
+    pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
+    pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
+    pub fn setutxent();
+    pub fn endutxent();
+
+    pub fn endutent();
+    pub fn getutent() -> *mut utmp;
+    pub fn getutid(u: *const utmp) -> *mut utmp;
+    pub fn getutline(u: *const utmp) -> *mut utmp;
+    pub fn pututline(u: *const utmp) -> *mut utmp;
+    pub fn setutent();
+    pub fn utmpname(file: *const ::c_char) -> ::c_int;
+
+    pub fn getutmp(ux: *const utmpx, u: *mut utmp);
+    pub fn getutmpx(u: *const utmp, ux: *mut utmpx);
+    pub fn updwtmp(file: *const ::c_char, u: *mut utmp);
+
+    pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
+    pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
+
+    pub fn timer_create(clock_id: clockid_t, evp: *mut sigevent, timerid: *mut timer_t) -> ::c_int;
+    pub fn timer_delete(timerid: timer_t) -> ::c_int;
+    pub fn timer_getoverrun(timerid: timer_t) -> ::c_int;
+    pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> ::c_int;
+    pub fn timer_settime(
+        timerid: timer_t,
+        flags: ::c_int,
+        value: *const itimerspec,
+        ovalue: *mut itimerspec,
+    ) -> ::c_int;
+
+    pub fn ucred_get(pid: ::pid_t) -> *mut ucred_t;
+    pub fn getpeerucred(fd: ::c_int, ucred: *mut *mut ucred_t) -> ::c_int;
+
+    pub fn ucred_free(ucred: *mut ucred_t);
+
+    pub fn ucred_geteuid(ucred: *const ucred_t) -> ::uid_t;
+    pub fn ucred_getruid(ucred: *const ucred_t) -> ::uid_t;
+    pub fn ucred_getsuid(ucred: *const ucred_t) -> ::uid_t;
+    pub fn ucred_getegid(ucred: *const ucred_t) -> ::gid_t;
+    pub fn ucred_getrgid(ucred: *const ucred_t) -> ::gid_t;
+    pub fn ucred_getsgid(ucred: *const ucred_t) -> ::gid_t;
+    pub fn ucred_getgroups(ucred: *const ucred_t, groups: *mut *const ::gid_t) -> ::c_int;
+    pub fn ucred_getpid(ucred: *const ucred_t) -> ::pid_t;
+    pub fn ucred_getprojid(ucred: *const ucred_t) -> projid_t;
+    pub fn ucred_getzoneid(ucred: *const ucred_t) -> zoneid_t;
+    pub fn ucred_getpflags(ucred: *const ucred_t, flags: ::c_uint) -> ::c_uint;
+
+    pub fn ucred_size() -> ::size_t;
+
+    pub fn pset_create(newpset: *mut ::psetid_t) -> ::c_int;
+    pub fn pset_destroy(pset: ::psetid_t) -> ::c_int;
+    pub fn pset_assign(pset: ::psetid_t, cpu: ::processorid_t, opset: *mut psetid_t) -> ::c_int;
+    pub fn pset_info(
+        pset: ::psetid_t,
+        tpe: *mut ::c_int,
+        numcpus: *mut ::c_uint,
+        cpulist: *mut processorid_t,
+    ) -> ::c_int;
+    pub fn pset_bind(
+        pset: ::psetid_t,
+        idtype: ::idtype_t,
+        id: ::id_t,
+        opset: *mut psetid_t,
+    ) -> ::c_int;
+    pub fn pset_list(pset: *mut psetid_t, numpsets: *mut ::c_uint) -> ::c_int;
+    pub fn pset_setattr(pset: psetid_t, attr: ::c_uint) -> ::c_int;
+    pub fn pset_getattr(pset: psetid_t, attr: *mut ::c_uint) -> ::c_int;
+    pub fn processor_bind(
+        idtype: ::idtype_t,
+        id: ::id_t,
+        new_binding: ::processorid_t,
+        old_binding: *mut processorid_t,
+    ) -> ::c_int;
+    pub fn p_online(processorid: ::processorid_t, flag: ::c_int) -> ::c_int;
+    pub fn processor_info(processorid: ::processorid_t, infop: *mut processor_info_t) -> ::c_int;
+
+    pub fn getexecname() -> *const ::c_char;
+
+    pub fn gethostid() -> ::c_long;
+
+    pub fn getpflags(flags: ::c_uint) -> ::c_uint;
+    pub fn setpflags(flags: ::c_uint, value: ::c_uint) -> ::c_int;
+
+    pub fn sysinfo(command: ::c_int, buf: *mut ::c_char, count: ::c_long) -> ::c_int;
+
+    pub fn faccessat(fd: ::c_int, path: *const ::c_char, amode: ::c_int, flag: ::c_int) -> ::c_int;
+
+    // #include <link.h>
+    #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
+    pub fn dl_iterate_phdr(
+        callback: ::Option<
+            unsafe extern "C" fn(
+                info: *mut dl_phdr_info,
+                size: usize,
+                data: *mut ::c_void,
+            ) -> ::c_int,
+        >,
+        data: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn getpagesize() -> ::c_int;
+    pub fn getpagesizes(pagesize: *mut ::size_t, nelem: ::c_int) -> ::c_int;
+    pub fn mmapobj(
+        fd: ::c_int,
+        flags: ::c_uint,
+        storage: *mut mmapobj_result_t,
+        elements: *mut ::c_uint,
+        arg: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn meminfo(
+        inaddr: *const u64,
+        addr_count: ::c_int,
+        info_req: *const ::c_uint,
+        info_count: ::c_int,
+        outdata: *mut u64,
+        validity: *mut ::c_uint,
+    ) -> ::c_int;
+
+    pub fn strcasecmp_l(s1: *const ::c_char, s2: *const ::c_char, loc: ::locale_t) -> ::c_int;
+    pub fn strncasecmp_l(
+        s1: *const ::c_char,
+        s2: *const ::c_char,
+        n: ::size_t,
+        loc: ::locale_t,
+    ) -> ::c_int;
+    pub fn strsep(string: *mut *mut ::c_char, delim: *const ::c_char) -> *mut ::c_char;
+
+    pub fn getisax(array: *mut u32, n: ::c_uint) -> ::c_uint;
+
+    pub fn backtrace(buffer: *mut *mut ::c_void, size: ::c_int) -> ::c_int;
+    pub fn backtrace_symbols(buffer: *const *mut ::c_void, size: ::c_int) -> *mut *mut ::c_char;
+    pub fn backtrace_symbols_fd(buffer: *const *mut ::c_void, size: ::c_int, fd: ::c_int);
+
+    pub fn getopt_long(
+        argc: ::c_int,
+        argv: *const *mut c_char,
+        optstring: *const c_char,
+        longopts: *const option,
+        longindex: *mut ::c_int,
+    ) -> ::c_int;
+
+    pub fn sync();
+
+    pub fn __major(version: ::c_int, devnum: ::dev_t) -> ::major_t;
+    pub fn __minor(version: ::c_int, devnum: ::dev_t) -> ::minor_t;
+    pub fn __makedev(version: ::c_int, majdev: ::major_t, mindev: ::minor_t) -> ::dev_t;
+}
+
+#[link(name = "sendfile")]
+extern "C" {
+    pub fn sendfile(out_fd: ::c_int, in_fd: ::c_int, off: *mut ::off_t, len: ::size_t)
+        -> ::ssize_t;
+    pub fn sendfilev(
+        fildes: ::c_int,
+        vec: *const sendfilevec_t,
+        sfvcnt: ::c_int,
+        xferred: *mut ::size_t,
+    ) -> ::ssize_t;
+}
+
+#[link(name = "lgrp")]
+extern "C" {
+    pub fn lgrp_init(view: lgrp_view_t) -> lgrp_cookie_t;
+    pub fn lgrp_fini(cookie: lgrp_cookie_t) -> ::c_int;
+    pub fn lgrp_affinity_get(
+        idtype: ::idtype_t,
+        id: ::id_t,
+        lgrp: ::lgrp_id_t,
+    ) -> ::lgrp_affinity_t;
+    pub fn lgrp_affinity_set(
+        idtype: ::idtype_t,
+        id: ::id_t,
+        lgrp: ::lgrp_id_t,
+        aff: lgrp_affinity_t,
+    ) -> ::lgrp_affinity_t;
+    pub fn lgrp_cpus(
+        cookie: ::lgrp_cookie_t,
+        lgrp: ::lgrp_id_t,
+        cpuids: *mut ::processorid_t,
+        count: ::c_uint,
+        content: ::lgrp_content_t,
+    ) -> ::c_int;
+    pub fn lgrp_mem_size(
+        cookie: ::lgrp_cookie_t,
+        lgrp: ::lgrp_id_t,
+        tpe: ::lgrp_mem_size_flag_t,
+        content: ::lgrp_content_t,
+    ) -> ::lgrp_mem_size_t;
+    pub fn lgrp_nlgrps(cookie: ::lgrp_cookie_t) -> ::c_int;
+    pub fn lgrp_view(cookie: ::lgrp_cookie_t) -> ::lgrp_view_t;
+    pub fn lgrp_home(idtype: ::idtype_t, id: ::id_t) -> ::lgrp_id_t;
+    pub fn lgrp_version(version: ::c_int) -> ::c_int;
+    pub fn lgrp_resources(
+        cookie: ::lgrp_cookie_t,
+        lgrp: ::lgrp_id_t,
+        lgrps: *mut ::lgrp_id_t,
+        count: ::c_uint,
+        tpe: ::lgrp_rsrc_t,
+    ) -> ::c_int;
+    pub fn lgrp_root(cookie: ::lgrp_cookie_t) -> ::lgrp_id_t;
+}
+
+pub unsafe fn major(device: ::dev_t) -> ::major_t {
+    __major(NEWDEV, device)
+}
+
+pub unsafe fn minor(device: ::dev_t) -> ::minor_t {
+    __minor(NEWDEV, device)
+}
+
+pub unsafe fn makedev(maj: ::major_t, min: ::minor_t) -> ::dev_t {
+    __makedev(NEWDEV, maj, min)
+}
+
+mod compat;
+pub use self::compat::*;
+
+cfg_if! {
+    if #[cfg(target_os = "illumos")] {
+        mod illumos;
+        pub use self::illumos::*;
+    } else if #[cfg(target_os = "solaris")] {
+        mod solaris;
+        pub use self::solaris::*;
+    } else {
+        // Unknown target_os
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "x86_64")] {
+        mod x86_64;
+        mod x86_common;
+        pub use self::x86_64::*;
+        pub use self::x86_common::*;
+    } else if #[cfg(target_arch = "x86")] {
+        mod x86;
+        mod x86_common;
+        pub use self::x86::*;
+        pub use self::x86_common::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/solarish/solaris.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/solarish/solaris.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/solarish/solaris.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/solarish/solaris.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,101 @@
+pub type door_attr_t = ::c_uint;
+pub type door_id_t = ::c_ulonglong;
+
+s! {
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_flags: ::uintptr_t,
+        pub shm_lkcnt: ::c_ushort,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        pub shm_cnattch: ::c_ulong,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_amp: *mut ::c_void,
+        pub shm_gransize: u64,
+        pub shm_allocated: u64,
+        pub shm_pad4: [i64; 1],
+    }
+
+    pub struct door_desc_t__d_data__d_desc {
+        pub d_descriptor: ::c_int,
+        pub d_id: ::door_id_t
+    }
+}
+
+s_no_extra_traits! {
+    #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
+    pub union door_desc_t__d_data {
+        pub d_desc: door_desc_t__d_data__d_desc,
+        d_resv: [::c_int; 5], /* Check out /usr/include/sys/door.h */
+    }
+
+    #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
+    pub struct door_desc_t {
+        pub d_attributes: door_attr_t,
+        pub d_data: door_desc_t__d_data,
+    }
+
+    #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
+    pub struct door_arg_t {
+        pub data_ptr: *const ::c_char,
+        pub data_size: ::size_t,
+        pub desc_ptr: *const door_desc_t,
+        pub dec_num: ::c_uint,
+        pub rbuf: *const ::c_char,
+        pub rsize: ::size_t,
+    }
+}
+
+pub const PORT_SOURCE_POSTWAIT: ::c_int = 8;
+pub const PORT_SOURCE_SIGNAL: ::c_int = 9;
+
+pub const AF_LOCAL: ::c_int = 0;
+pub const AF_FILE: ::c_int = 0;
+
+pub const TCP_KEEPIDLE: ::c_int = 0x1d;
+pub const TCP_KEEPINTVL: ::c_int = 0x1e;
+pub const TCP_KEEPCNT: ::c_int = 0x1f;
+
+pub const F_DUPFD_CLOEXEC: ::c_int = 47;
+pub const F_DUPFD_CLOFORK: ::c_int = 49;
+pub const F_DUP2FD_CLOEXEC: ::c_int = 48;
+pub const F_DUP2FD_CLOFORK: ::c_int = 50;
+
+extern "C" {
+    pub fn fexecve(
+        fd: ::c_int,
+        argv: *const *const ::c_char,
+        envp: *const *const ::c_char,
+    ) -> ::c_int;
+
+    pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
+
+    pub fn door_call(d: ::c_int, params: *const door_arg_t) -> ::c_int;
+    pub fn door_return(
+        data_ptr: *const ::c_char,
+        data_size: ::size_t,
+        desc_ptr: *const door_desc_t,
+        num_desc: ::c_uint,
+    );
+    pub fn door_create(
+        server_procedure: extern "C" fn(
+            cookie: *const ::c_void,
+            argp: *const ::c_char,
+            arg_size: ::size_t,
+            dp: *const door_desc_t,
+            n_desc: ::c_uint,
+        ),
+        cookie: *const ::c_void,
+        attributes: door_attr_t,
+    ) -> ::c_int;
+
+    pub fn fattach(fildes: ::c_int, path: *const ::c_char) -> ::c_int;
+
+    pub fn pthread_getattr_np(thread: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
+
+    pub fn euidaccess(path: *const ::c_char, amode: ::c_int) -> ::c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/solarish/x86.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/solarish/x86.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/solarish/x86.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/solarish/x86.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,29 @@
+pub type Elf32_Addr = ::c_ulong;
+pub type Elf32_Half = ::c_ushort;
+pub type Elf32_Off = ::c_ulong;
+pub type Elf32_Sword = ::c_long;
+pub type Elf32_Word = ::c_ulong;
+pub type Elf32_Lword = ::c_ulonglong;
+pub type Elf32_Phdr = __c_anonymous_Elf32_Phdr;
+
+s! {
+    pub struct __c_anonymous_Elf32_Phdr {
+        pub p_type: ::Elf32_Word,
+        pub p_offset: ::Elf32_Off,
+        pub p_vaddr: ::Elf32_Addr,
+        pub p_paddr: ::Elf32_Addr,
+        pub p_filesz: ::Elf32_Word,
+        pub p_memsz: ::Elf32_Word,
+        pub p_flags: ::Elf32_Word,
+        pub p_align: ::Elf32_Word,
+    }
+
+    pub struct dl_phdr_info {
+        pub dlpi_addr: ::Elf32_Addr,
+        pub dlpi_name: *const ::c_char,
+        pub dlpi_phdr: *const ::Elf32_Phdr,
+        pub dlpi_phnum: ::Elf32_Half,
+        pub dlpi_adds: ::c_ulonglong,
+        pub dlpi_subs: ::c_ulonglong,
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/solarish/x86_64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/solarish/x86_64.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/solarish/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/solarish/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,190 @@
+pub type greg_t = ::c_long;
+
+pub type Elf64_Addr = ::c_ulong;
+pub type Elf64_Half = ::c_ushort;
+pub type Elf64_Off = ::c_ulong;
+pub type Elf64_Sword = ::c_int;
+pub type Elf64_Sxword = ::c_long;
+pub type Elf64_Word = ::c_uint;
+pub type Elf64_Xword = ::c_ulong;
+pub type Elf64_Lword = ::c_ulong;
+pub type Elf64_Phdr = __c_anonymous_Elf64_Phdr;
+
+s! {
+    pub struct __c_anonymous_fpchip_state {
+        pub cw: u16,
+        pub sw: u16,
+        pub fctw: u8,
+        pub __fx_rsvd: u8,
+        pub fop: u16,
+        pub rip: u64,
+        pub rdp: u64,
+        pub mxcsr: u32,
+        pub mxcsr_mask: u32,
+        pub st: [::upad128_t; 8],
+        pub xmm: [::upad128_t; 16],
+        pub __fx_ign: [::upad128_t; 6],
+        pub status: u32,
+        pub xstatus: u32,
+    }
+
+    pub struct __c_anonymous_Elf64_Phdr {
+        pub p_type: ::Elf64_Word,
+        pub p_flags: ::Elf64_Word,
+        pub p_offset: ::Elf64_Off,
+        pub p_vaddr: ::Elf64_Addr,
+        pub p_paddr: ::Elf64_Addr,
+        pub p_filesz: ::Elf64_Xword,
+        pub p_memsz: ::Elf64_Xword,
+        pub p_align: ::Elf64_Xword,
+    }
+
+    pub struct dl_phdr_info {
+        pub dlpi_addr: ::Elf64_Addr,
+        pub dlpi_name: *const ::c_char,
+        pub dlpi_phdr: *const ::Elf64_Phdr,
+        pub dlpi_phnum: ::Elf64_Half,
+        pub dlpi_adds: ::c_ulonglong,
+        pub dlpi_subs: ::c_ulonglong,
+    }
+}
+
+s_no_extra_traits! {
+    #[cfg(libc_union)]
+    pub union __c_anonymous_fp_reg_set {
+        pub fpchip_state: __c_anonymous_fpchip_state,
+        pub f_fpregs: [[u32; 13]; 10],
+    }
+
+    pub struct fpregset_t {
+        pub fp_reg_set: __c_anonymous_fp_reg_set,
+    }
+
+    pub struct mcontext_t {
+        pub gregs: [::greg_t; 28],
+        pub fpregs: fpregset_t,
+    }
+
+    pub struct ucontext_t {
+        pub uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_stack: ::stack_t,
+        pub uc_mcontext: mcontext_t,
+        pub uc_filler: [::c_long; 5],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        #[cfg(libc_union)]
+        impl PartialEq for __c_anonymous_fp_reg_set {
+            fn eq(&self, other: &__c_anonymous_fp_reg_set) -> bool {
+                unsafe {
+                self.fpchip_state == other.fpchip_state ||
+                    self.
+                    f_fpregs.
+                    iter().
+                    zip(other.f_fpregs.iter()).
+                    all(|(a, b)| a == b)
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_fp_reg_set {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_fp_reg_set {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                f.debug_struct("__c_anonymous_fp_reg_set")
+                    .field("fpchip_state", &{self.fpchip_state})
+                    .field("f_fpregs", &{self.f_fpregs})
+                    .finish()
+                }
+            }
+        }
+        impl PartialEq for fpregset_t {
+            fn eq(&self, other: &fpregset_t) -> bool {
+                self.fp_reg_set == other.fp_reg_set
+            }
+        }
+        impl Eq for fpregset_t {}
+        impl ::fmt::Debug for fpregset_t {
+            fn fmt(&self, f:&mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("fpregset_t")
+                    .field("fp_reg_set", &self.fp_reg_set)
+                    .finish()
+            }
+        }
+        impl PartialEq for mcontext_t {
+            fn eq(&self, other: &mcontext_t) -> bool {
+                self.gregs == other.gregs &&
+                    self.fpregs == other.fpregs
+            }
+        }
+        impl Eq for mcontext_t {}
+        impl ::fmt::Debug for mcontext_t {
+            fn fmt(&self, f:&mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("mcontext_t")
+                    .field("gregs", &self.gregs)
+                    .field("fpregs", &self.fpregs)
+                    .finish()
+            }
+        }
+        impl PartialEq for ucontext_t {
+            fn eq(&self, other: &ucontext_t) -> bool {
+                self.uc_flags == other.uc_flags
+                    && self.uc_link == other.uc_link
+                    && self.uc_sigmask == other.uc_sigmask
+                    && self.uc_stack == other.uc_stack
+                    && self.uc_mcontext == other.uc_mcontext
+                    && self.uc_filler == other.uc_filler
+            }
+        }
+        impl Eq for ucontext_t {}
+        impl ::fmt::Debug for ucontext_t {
+            fn fmt(&self, f:&mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ucontext_t")
+                    .field("uc_flags", &self.uc_flags)
+                    .field("uc_link", &self.uc_link)
+                    .field("uc_sigmask", &self.uc_sigmask)
+                    .field("uc_stack", &self.uc_stack)
+                    .field("uc_mcontext", &self.uc_mcontext)
+                    .field("uc_filler", &self.uc_filler)
+                    .finish()
+            }
+        }
+
+    }
+}
+
+// sys/regset.h
+
+pub const REG_GSBASE: ::c_int = 27;
+pub const REG_FSBASE: ::c_int = 26;
+pub const REG_DS: ::c_int = 25;
+pub const REG_ES: ::c_int = 24;
+pub const REG_GS: ::c_int = 23;
+pub const REG_FS: ::c_int = 22;
+pub const REG_SS: ::c_int = 21;
+pub const REG_RSP: ::c_int = 20;
+pub const REG_RFL: ::c_int = 19;
+pub const REG_CS: ::c_int = 18;
+pub const REG_RIP: ::c_int = 17;
+pub const REG_ERR: ::c_int = 16;
+pub const REG_TRAPNO: ::c_int = 15;
+pub const REG_RAX: ::c_int = 14;
+pub const REG_RCX: ::c_int = 13;
+pub const REG_RDX: ::c_int = 12;
+pub const REG_RBX: ::c_int = 11;
+pub const REG_RBP: ::c_int = 10;
+pub const REG_RSI: ::c_int = 9;
+pub const REG_RDI: ::c_int = 8;
+pub const REG_R8: ::c_int = 7;
+pub const REG_R9: ::c_int = 6;
+pub const REG_R10: ::c_int = 5;
+pub const REG_R11: ::c_int = 4;
+pub const REG_R12: ::c_int = 3;
+pub const REG_R13: ::c_int = 2;
+pub const REG_R14: ::c_int = 1;
+pub const REG_R15: ::c_int = 0;
diff -pruN 43.0.0-1/rust-vendor/libc/src/unix/solarish/x86_common.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/solarish/x86_common.rs
--- 43.0.0-1/rust-vendor/libc/src/unix/solarish/x86_common.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/unix/solarish/x86_common.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,65 @@
+// AT_SUN_HWCAP
+pub const AV_386_FPU: u32 = 0x00001;
+pub const AV_386_TSC: u32 = 0x00002;
+pub const AV_386_CX8: u32 = 0x00004;
+pub const AV_386_SEP: u32 = 0x00008;
+pub const AV_386_AMD_SYSC: u32 = 0x00010;
+pub const AV_386_CMOV: u32 = 0x00020;
+pub const AV_386_MMX: u32 = 0x00040;
+pub const AV_386_AMD_MMX: u32 = 0x00080;
+pub const AV_386_AMD_3DNow: u32 = 0x00100;
+pub const AV_386_AMD_3DNowx: u32 = 0x00200;
+pub const AV_386_FXSR: u32 = 0x00400;
+pub const AV_386_SSE: u32 = 0x00800;
+pub const AV_386_SSE2: u32 = 0x01000;
+pub const AV_386_CX16: u32 = 0x10000;
+pub const AV_386_AHF: u32 = 0x20000;
+pub const AV_386_TSCP: u32 = 0x40000;
+pub const AV_386_AMD_SSE4A: u32 = 0x80000;
+pub const AV_386_POPCNT: u32 = 0x100000;
+pub const AV_386_AMD_LZCNT: u32 = 0x200000;
+pub const AV_386_SSSE3: u32 = 0x400000;
+pub const AV_386_SSE4_1: u32 = 0x800000;
+pub const AV_386_SSE4_2: u32 = 0x1000000;
+pub const AV_386_MOVBE: u32 = 0x2000000;
+pub const AV_386_AES: u32 = 0x4000000;
+pub const AV_386_PCLMULQDQ: u32 = 0x8000000;
+pub const AV_386_XSAVE: u32 = 0x10000000;
+pub const AV_386_AVX: u32 = 0x20000000;
+pub const AV_386_VMX: u32 = 0x40000000;
+pub const AV_386_AMD_SVM: u32 = 0x80000000;
+// AT_SUN_HWCAP2
+pub const AV_386_2_F16C: u32 = 0x00000001;
+pub const AV_386_2_RDRAND: u32 = 0x00000002;
+pub const AV_386_2_BMI1: u32 = 0x00000004;
+pub const AV_386_2_BMI2: u32 = 0x00000008;
+pub const AV_386_2_FMA: u32 = 0x00000010;
+pub const AV_386_2_AVX2: u32 = 0x00000020;
+pub const AV_386_2_ADX: u32 = 0x00000040;
+pub const AV_386_2_RDSEED: u32 = 0x00000080;
+pub const AV_386_2_AVX512F: u32 = 0x00000100;
+pub const AV_386_2_AVX512DQ: u32 = 0x00000200;
+pub const AV_386_2_AVX512IFMA: u32 = 0x00000400;
+pub const AV_386_2_AVX512PF: u32 = 0x00000800;
+pub const AV_386_2_AVX512ER: u32 = 0x00001000;
+pub const AV_386_2_AVX512CD: u32 = 0x00002000;
+pub const AV_386_2_AVX512BW: u32 = 0x00004000;
+pub const AV_386_2_AVX512VL: u32 = 0x00008000;
+pub const AV_386_2_AVX512VBMI: u32 = 0x00010000;
+pub const AV_386_2_AVX512VPOPCDQ: u32 = 0x00020000;
+pub const AV_386_2_AVX512_4NNIW: u32 = 0x00040000;
+pub const AV_386_2_AVX512_4FMAPS: u32 = 0x00080000;
+pub const AV_386_2_SHA: u32 = 0x00100000;
+pub const AV_386_2_FSGSBASE: u32 = 0x00200000;
+pub const AV_386_2_CLFLUSHOPT: u32 = 0x00400000;
+pub const AV_386_2_CLWB: u32 = 0x00800000;
+pub const AV_386_2_MONITORX: u32 = 0x01000000;
+pub const AV_386_2_CLZERO: u32 = 0x02000000;
+pub const AV_386_2_AVX512_VNNI: u32 = 0x04000000;
+pub const AV_386_2_VPCLMULQDQ: u32 = 0x08000000;
+pub const AV_386_2_VAES: u32 = 0x10000000;
+// AT_SUN_FPTYPE
+pub const AT_386_FPINFO_NONE: u32 = 0;
+pub const AT_386_FPINFO_FXSAVE: u32 = 1;
+pub const AT_386_FPINFO_XSAVE: u32 = 2;
+pub const AT_386_FPINFO_XSAVE_AMD: u32 = 3;
diff -pruN 43.0.0-1/rust-vendor/libc/src/vxworks/aarch64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/vxworks/aarch64.rs
--- 43.0.0-1/rust-vendor/libc/src/vxworks/aarch64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/vxworks/aarch64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
+pub type c_long = i64;
+pub type c_ulong = u64;
diff -pruN 43.0.0-1/rust-vendor/libc/src/vxworks/arm.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/vxworks/arm.rs
--- 43.0.0-1/rust-vendor/libc/src/vxworks/arm.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/vxworks/arm.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
+pub type c_long = i32;
+pub type c_ulong = u32;
diff -pruN 43.0.0-1/rust-vendor/libc/src/vxworks/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/vxworks/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/vxworks/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/vxworks/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1947 @@
+//! Interface to VxWorks C library
+
+use core::mem::size_of;
+use core::ptr::null_mut;
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum DIR {}
+impl ::Copy for DIR {}
+impl ::Clone for DIR {
+    fn clone(&self) -> DIR {
+        *self
+    }
+}
+
+pub type c_schar = i8;
+pub type c_uchar = u8;
+pub type c_short = i16;
+pub type c_ushort = u16;
+pub type c_int = i32;
+pub type c_uint = u32;
+pub type c_float = f32;
+pub type c_double = f64;
+pub type c_longlong = i64;
+pub type c_ulonglong = u64;
+pub type intmax_t = i64;
+pub type uintmax_t = u64;
+
+pub type uintptr_t = usize;
+pub type intptr_t = isize;
+pub type ptrdiff_t = isize;
+pub type size_t = ::uintptr_t;
+pub type ssize_t = ::intptr_t;
+
+pub type pid_t = ::c_int;
+pub type in_addr_t = u32;
+pub type sighandler_t = ::size_t;
+pub type cpuset_t = u32;
+
+pub type blkcnt_t = ::c_long;
+pub type blksize_t = ::c_long;
+pub type ino_t = ::c_ulong;
+
+pub type rlim_t = ::c_ulong;
+pub type suseconds_t = ::c_long;
+pub type time_t = ::c_long;
+
+pub type errno_t = ::c_int;
+
+pub type useconds_t = ::c_ulong;
+
+pub type socklen_t = ::c_uint;
+
+pub type pthread_t = ::c_ulong;
+
+pub type clockid_t = ::c_int;
+
+//defined for the structs
+pub type dev_t = ::c_ulong;
+pub type mode_t = ::c_int;
+pub type nlink_t = ::c_ulong;
+pub type uid_t = ::c_ushort;
+pub type gid_t = ::c_ushort;
+pub type sigset_t = ::c_ulonglong;
+pub type key_t = ::c_long;
+
+pub type nfds_t = ::c_uint;
+pub type stat64 = ::stat;
+
+pub type pthread_key_t = ::c_ulong;
+
+// From b_off_t.h
+pub type off_t = ::c_longlong;
+pub type off64_t = off_t;
+
+// From b_BOOL.h
+pub type BOOL = ::c_int;
+
+// From vxWind.h ..
+pub type _Vx_OBJ_HANDLE = ::c_int;
+pub type _Vx_TASK_ID = ::_Vx_OBJ_HANDLE;
+pub type _Vx_MSG_Q_ID = ::_Vx_OBJ_HANDLE;
+pub type _Vx_SEM_ID_KERNEL = ::_Vx_OBJ_HANDLE;
+pub type _Vx_RTP_ID = ::_Vx_OBJ_HANDLE;
+pub type _Vx_SD_ID = ::_Vx_OBJ_HANDLE;
+pub type _Vx_CONDVAR_ID = ::_Vx_OBJ_HANDLE;
+pub type _Vx_SEM_ID = *mut ::_Vx_semaphore;
+pub type OBJ_HANDLE = ::_Vx_OBJ_HANDLE;
+pub type TASK_ID = ::OBJ_HANDLE;
+pub type MSG_Q_ID = ::OBJ_HANDLE;
+pub type SEM_ID_KERNEL = ::OBJ_HANDLE;
+pub type RTP_ID = ::OBJ_HANDLE;
+pub type SD_ID = ::OBJ_HANDLE;
+pub type CONDVAR_ID = ::OBJ_HANDLE;
+
+// From vxTypes.h
+pub type _Vx_usr_arg_t = isize;
+pub type _Vx_exit_code_t = isize;
+pub type _Vx_ticks_t = ::c_uint;
+pub type _Vx_ticks64_t = ::c_ulonglong;
+
+pub type sa_family_t = ::c_uchar;
+
+// mqueue.h
+pub type mqd_t = ::c_int;
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum _Vx_semaphore {}
+impl ::Copy for _Vx_semaphore {}
+impl ::Clone for _Vx_semaphore {
+    fn clone(&self) -> _Vx_semaphore {
+        *self
+    }
+}
+
+impl siginfo_t {
+    pub unsafe fn si_addr(&self) -> *mut ::c_void {
+        self.si_addr
+    }
+
+    pub unsafe fn si_value(&self) -> ::sigval {
+        self.si_value
+    }
+
+    pub unsafe fn si_pid(&self) -> ::pid_t {
+        self.si_pid
+    }
+
+    pub unsafe fn si_uid(&self) -> ::uid_t {
+        self.si_uid
+    }
+
+    pub unsafe fn si_status(&self) -> ::c_int {
+        self.si_status
+    }
+}
+
+s! {
+    // b_pthread_condattr_t.h
+    pub struct pthread_condattr_t {
+        pub condAttrStatus: ::c_int,
+        pub condAttrPshared: ::c_int,
+        pub condAttrClockId: ::clockid_t,
+    }
+
+    // b_pthread_cond_t.h
+    pub struct pthread_cond_t{
+        pub condSemId: ::_Vx_SEM_ID,
+        pub condValid: ::c_int,
+        pub condInitted: ::c_int,
+        pub condRefCount: ::c_int,
+        pub condMutex: *mut ::pthread_mutex_t,
+        pub condAttr: ::pthread_condattr_t,
+        pub condSemName: [::c_char; _PTHREAD_SHARED_SEM_NAME_MAX]
+    }
+
+    // b_pthread_rwlockattr_t.h
+    pub struct pthread_rwlockattr_t {
+        pub rwlockAttrStatus: ::c_int,
+        pub rwlockAttrPshared: ::c_int,
+        pub rwlockAttrMaxReaders: ::c_uint,
+        pub rwlockAttrConformOpt: ::c_uint,
+    }
+
+    // b_pthread_rwlock_t.h
+    pub struct pthread_rwlock_t {
+        pub rwlockSemId: :: _Vx_SEM_ID,
+        pub rwlockReadersRefCount: ::c_uint,
+        pub rwlockValid: ::c_int,
+        pub rwlockInitted: ::c_int,
+        pub rwlockAttr: ::pthread_rwlockattr_t,
+        pub rwlockSemName: [::c_char; _PTHREAD_SHARED_SEM_NAME_MAX]
+    }
+
+    // b_struct_timeval.h
+    pub struct timeval {
+        pub tv_sec: ::time_t,
+        pub tv_usec: ::suseconds_t,
+    }
+
+    // socket.h
+    pub struct linger {
+        pub l_onoff: ::c_int,
+        pub l_linger: ::c_int,
+    }
+
+    pub struct sockaddr {
+        pub sa_len    : ::c_uchar,
+        pub sa_family : sa_family_t,
+        pub sa_data   : [::c_char; 14],
+    }
+
+    pub struct iovec {
+        pub iov_base: *mut ::c_void,
+        pub iov_len: ::size_t,
+    }
+
+    pub struct msghdr {
+        pub msg_name: *mut c_void,
+        pub msg_namelen: socklen_t,
+        pub msg_iov: *mut iovec,
+        pub msg_iovlen: ::c_int,
+        pub msg_control: *mut c_void,
+        pub msg_controllen: socklen_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct cmsghdr {
+        pub cmsg_len: socklen_t,
+        pub cmsg_level: ::c_int,
+        pub cmsg_type: ::c_int,
+    }
+
+    // poll.h
+    pub struct pollfd {
+        pub fd      : ::c_int,
+        pub events  : ::c_short,
+        pub revents : ::c_short,
+    }
+
+    // resource.h
+    pub struct rlimit {
+                           pub rlim_cur : ::rlim_t,
+                           pub rlim_max : ::rlim_t,
+    }
+
+    // stat.h
+    pub struct stat {
+                         pub st_dev       : ::dev_t,
+                         pub st_ino       : ::ino_t,
+                         pub st_mode      : ::mode_t,
+                         pub st_nlink     : ::nlink_t,
+                         pub st_uid       : ::uid_t,
+                         pub st_gid       : ::gid_t,
+                         pub st_rdev      : ::dev_t,
+                         pub st_size      : ::off_t,
+                         pub st_atime     : ::time_t,
+                         pub st_mtime     : ::time_t,
+                         pub st_ctime     : ::time_t,
+                         pub st_blksize   : ::blksize_t,
+                         pub st_blocks    : ::blkcnt_t,
+                         pub st_attrib    : ::c_uchar,
+                         pub st_reserved1 : ::c_int,
+                         pub st_reserved2 : ::c_int,
+                         pub st_reserved3 : ::c_int,
+                         pub st_reserved4 : ::c_int,
+    }
+
+    //b_struct__Timespec.h
+    pub struct _Timespec {
+        pub tv_sec  : ::time_t,
+        pub tv_nsec : ::c_long,
+    }
+
+    // b_struct__Sched_param.h
+    pub struct _Sched_param {
+        pub sched_priority: ::c_int, /* scheduling priority */
+        pub sched_ss_low_priority: ::c_int,    /* low scheduling priority */
+        pub sched_ss_repl_period: ::_Timespec, /* replenishment period */
+        pub sched_ss_init_budget: ::_Timespec, /* initial budget */
+        pub sched_ss_max_repl: ::c_int,        /* max pending replenishment */
+
+    }
+
+    // b_pthread_attr_t.h
+    pub struct pthread_attr_t {
+        pub threadAttrStatus          : ::c_int,
+        pub threadAttrStacksize       : ::size_t,
+        pub threadAttrStackaddr       : *mut ::c_void,
+        pub threadAttrGuardsize       : ::size_t,
+        pub threadAttrDetachstate     : ::c_int,
+        pub threadAttrContentionscope : ::c_int,
+        pub threadAttrInheritsched    : ::c_int,
+        pub threadAttrSchedpolicy     : ::c_int,
+        pub threadAttrName            : *mut ::c_char,
+        pub threadAttrOptions         : ::c_int,
+        pub threadAttrSchedparam      : ::_Sched_param,
+    }
+
+    // signal.h
+
+    pub struct sigaction {
+        pub sa_u     : ::sa_u_t,
+        pub sa_mask  : ::sigset_t,
+        pub sa_flags : ::c_int,
+    }
+
+    // b_stack_t.h
+    pub struct stack_t {
+        pub ss_sp    : *mut ::c_void,
+        pub ss_size  : ::size_t,
+        pub ss_flags : ::c_int,
+    }
+
+    // signal.h
+    pub struct siginfo_t {
+        pub si_signo : ::c_int,
+        pub si_code  : ::c_int,
+        pub si_value : ::sigval,
+        pub si_errno : ::c_int,
+        pub si_status: ::c_int,
+        pub si_addr: *mut ::c_void,
+        pub si_uid: ::uid_t,
+        pub si_pid: ::pid_t,
+    }
+
+    // pthread.h (krnl)
+    // b_pthread_mutexattr_t.h (usr)
+    pub struct pthread_mutexattr_t {
+        mutexAttrStatus      : ::c_int,
+        mutexAttrPshared     : ::c_int,
+        mutexAttrProtocol    : ::c_int,
+        mutexAttrPrioceiling : ::c_int,
+        mutexAttrType        : ::c_int,
+    }
+
+    // pthread.h (krnl)
+    // b_pthread_mutex_t.h (usr)
+    pub struct pthread_mutex_t  {
+        pub mutexSemId: ::_Vx_SEM_ID, /*_Vx_SEM_ID ..*/
+        pub mutexValid: ::c_int,
+        pub mutexInitted: ::c_int,
+        pub mutexCondRefCount: ::c_int,
+        pub mutexSavPriority: ::c_int,
+        pub mutexAttr: ::pthread_mutexattr_t,
+        pub mutexSemName: [::c_char; _PTHREAD_SHARED_SEM_NAME_MAX],
+    }
+
+    // b_struct_timespec.h
+    pub struct timespec {
+        pub tv_sec: ::time_t,
+        pub tv_nsec: ::c_long,
+    }
+
+    // time.h
+    pub struct tm {
+        pub tm_sec: ::c_int,
+        pub tm_min: ::c_int,
+        pub tm_hour: ::c_int,
+        pub tm_mday: ::c_int,
+        pub tm_mon: ::c_int,
+        pub tm_year: ::c_int,
+        pub tm_wday: ::c_int,
+        pub tm_yday: ::c_int,
+        pub tm_isdst: ::c_int,
+    }
+
+    // in.h
+    pub struct in_addr {
+        pub s_addr: in_addr_t,
+    }
+
+    // in.h
+    pub struct ip_mreq {
+        pub imr_multiaddr: in_addr,
+        pub imr_interface: in_addr,
+    }
+
+    // in6.h
+    #[repr(align(4))]
+    pub struct in6_addr {
+        pub s6_addr: [u8; 16],
+    }
+
+    // in6.h
+    pub struct ipv6_mreq {
+        pub ipv6mr_multiaddr: in6_addr,
+        pub ipv6mr_interface: ::c_uint,
+    }
+
+    // netdb.h
+    pub struct addrinfo {
+        pub ai_flags    : ::c_int,
+        pub ai_family   : ::c_int,
+        pub ai_socktype : ::c_int,
+        pub ai_protocol : ::c_int,
+        pub ai_addrlen  : ::size_t,
+        pub ai_canonname: *mut ::c_char,
+        pub ai_addr     : *mut ::sockaddr,
+        pub ai_next     : *mut ::addrinfo,
+    }
+
+    // in.h
+    pub struct sockaddr_in {
+        pub sin_len   : u8,
+        pub sin_family: u8,
+        pub sin_port  : u16,
+        pub sin_addr  : ::in_addr,
+        pub sin_zero  : [::c_char; 8],
+    }
+
+    // in6.h
+    pub struct sockaddr_in6 {
+        pub sin6_len     : u8,
+        pub sin6_family  : u8,
+        pub sin6_port    : u16,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr    : ::in6_addr,
+        pub sin6_scope_id: u32,
+    }
+
+    pub struct Dl_info {
+        pub dli_fname: *const ::c_char,
+        pub dli_fbase: *mut ::c_void,
+        pub dli_sname: *const ::c_char,
+        pub dli_saddr: *mut ::c_void,
+    }
+
+    pub struct mq_attr {
+        pub mq_maxmsg:  ::c_long,
+        pub mq_msgsize: ::c_long,
+        pub mq_flags:   ::c_long,
+        pub mq_curmsgs: ::c_long,
+    }
+}
+
+s_no_extra_traits! {
+    // dirent.h
+    pub struct dirent {
+        pub d_ino  : ::ino_t,
+        pub d_name : [::c_char; _PARM_NAME_MAX as usize + 1],
+    }
+
+    pub struct sockaddr_un {
+        pub sun_len: u8,
+        pub sun_family: sa_family_t,
+        pub sun_path: [::c_char; 104]
+    }
+
+    // rtpLibCommon.h
+    pub struct RTP_DESC {
+        pub status    : ::c_int,
+        pub options   : u32,
+        pub entrAddr  : *mut ::c_void,
+        pub initTaskId: ::TASK_ID,
+        pub parentId  : ::RTP_ID,
+        pub pathName  : [::c_char; VX_RTP_NAME_LENGTH as usize + 1],
+        pub taskCnt   : ::c_int,
+        pub textStart : *mut ::c_void,
+        pub textEnd   : *mut ::c_void,
+    }
+    // socket.h
+    pub struct sockaddr_storage {
+        pub ss_len     : ::c_uchar,
+        pub ss_family  : ::sa_family_t,
+        pub __ss_pad1  : [::c_char; _SS_PAD1SIZE],
+        pub __ss_align : i32,
+        pub __ss_pad2  : [::c_char; _SS_PAD2SIZE],
+    }
+
+    pub union sa_u_t {
+        pub sa_handler : ::Option<unsafe extern "C" fn(::c_int) -> !>,
+        pub sa_sigaction: ::Option<unsafe extern "C" fn(::c_int,
+                                                        *mut ::siginfo_t,
+                                                        *mut ::c_void) -> !>,
+    }
+
+    pub union sigval {
+        pub sival_int : ::c_int,
+        pub sival_ptr : *mut ::c_void,
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        impl ::fmt::Debug for dirent {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("dirent")
+                    .field("d_ino", &self.d_ino)
+                    .field("d_name", &&self.d_name[..])
+                    .finish()
+            }
+        }
+
+        impl ::fmt::Debug for sockaddr_un {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_un")
+                    .field("sun_len", &self.sun_len)
+                    .field("sun_family", &self.sun_family)
+                    .field("sun_path", &&self.sun_path[..])
+                    .finish()
+            }
+        }
+
+        impl ::fmt::Debug for RTP_DESC {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("RTP_DESC")
+                    .field("status", &self.status)
+                    .field("options", &self.options)
+                    .field("entrAddr", &self.entrAddr)
+                    .field("initTaskId", &self.initTaskId)
+                    .field("parentId", &self.parentId)
+                    .field("pathName", &&self.pathName[..])
+                    .field("taskCnt", &self.taskCnt)
+                    .field("textStart", &self.textStart)
+                    .field("textEnd", &self.textEnd)
+                    .finish()
+            }
+        }
+        impl ::fmt::Debug for sockaddr_storage {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sockaddr_storage")
+                    .field("ss_len", &self.ss_len)
+                    .field("ss_family", &self.ss_family)
+                    .field("__ss_pad1", &&self.__ss_pad1[..])
+                    .field("__ss_align", &self.__ss_align)
+                    .field("__ss_pad2", &&self.__ss_pad2[..])
+                    .finish()
+            }
+        }
+
+        impl PartialEq for sa_u_t {
+            fn eq(&self, other: &sa_u_t) -> bool {
+                unsafe {
+                    let h1 = match self.sa_handler {
+                        Some(handler) => handler as usize,
+                        None => 0 as usize,
+                    };
+                    let h2 = match other.sa_handler {
+                        Some(handler) => handler as usize,
+                        None => 0 as usize,
+                    };
+                    h1 == h2
+                }
+            }
+        }
+        impl Eq for sa_u_t {}
+        impl ::fmt::Debug for sa_u_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                    let h = match self.sa_handler {
+                        Some(handler) => handler as usize,
+                        None => 0 as usize,
+                    };
+
+                    f.debug_struct("sa_u_t")
+                        .field("sa_handler", &h)
+                        .finish()
+                }
+            }
+        }
+        impl ::hash::Hash for sa_u_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                    let h = match self.sa_handler {
+                        Some(handler) => handler as usize,
+                        None => 0 as usize,
+                    };
+                    h.hash(state)
+                }
+            }
+        }
+
+        impl PartialEq for sigval {
+            fn eq(&self, other: &sigval) -> bool {
+                unsafe { self.sival_ptr as usize == other.sival_ptr as usize }
+            }
+        }
+        impl Eq for sigval {}
+        impl ::fmt::Debug for sigval {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sigval")
+                    .field("sival_ptr", unsafe { &(self.sival_ptr as usize) })
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sigval {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe { (self.sival_ptr as usize).hash(state) };
+            }
+        }
+    }
+}
+
+pub const STDIN_FILENO: ::c_int = 0;
+pub const STDOUT_FILENO: ::c_int = 1;
+pub const STDERR_FILENO: ::c_int = 2;
+
+pub const EXIT_SUCCESS: ::c_int = 0;
+pub const EXIT_FAILURE: ::c_int = 1;
+
+pub const EAI_SERVICE: ::c_int = 9;
+pub const EAI_SOCKTYPE: ::c_int = 10;
+pub const EAI_SYSTEM: ::c_int = 11;
+
+// FIXME: This is not defined in vxWorks, but we have to define it here
+// to make the building pass for getrandom and std
+pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
+
+//Clock Lib Stuff
+pub const CLOCK_REALTIME: ::c_int = 0x0;
+pub const CLOCK_MONOTONIC: ::c_int = 0x1;
+pub const CLOCK_PROCESS_CPUTIME_ID: ::c_int = 0x2;
+pub const CLOCK_THREAD_CPUTIME_ID: ::c_int = 0x3;
+pub const TIMER_ABSTIME: ::c_int = 0x1;
+pub const TIMER_RELTIME: ::c_int = 0x0;
+
+// PTHREAD STUFF
+pub const PTHREAD_INITIALIZED_OBJ: ::c_int = 0xF70990EF;
+pub const PTHREAD_DESTROYED_OBJ: ::c_int = -1;
+pub const PTHREAD_VALID_OBJ: ::c_int = 0xEC542A37;
+pub const PTHREAD_INVALID_OBJ: ::c_int = -1;
+pub const PTHREAD_UNUSED_YET_OBJ: ::c_int = -1;
+
+pub const PTHREAD_PRIO_NONE: ::c_int = 0;
+pub const PTHREAD_PRIO_INHERIT: ::c_int = 1;
+pub const PTHREAD_PRIO_PROTECT: ::c_int = 2;
+
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
+pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
+pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
+pub const PTHREAD_STACK_MIN: usize = 4096;
+pub const _PTHREAD_SHARED_SEM_NAME_MAX: usize = 30;
+
+// ERRNO STUFF
+pub const OK: ::c_int = 0;
+pub const EPERM: ::c_int = 1; /* Not owner */
+pub const ENOENT: ::c_int = 2; /* No such file or directory */
+pub const ESRCH: ::c_int = 3; /* No such process */
+pub const EINTR: ::c_int = 4; /* Interrupted system call */
+pub const EIO: ::c_int = 5; /* I/O error */
+pub const ENXIO: ::c_int = 6; /* No such device or address */
+pub const E2BIG: ::c_int = 7; /* Arg list too long */
+pub const ENOEXEC: ::c_int = 8; /* Exec format error */
+pub const EBADF: ::c_int = 9; /* Bad file number */
+pub const ECHILD: ::c_int = 10; /* No children */
+pub const EAGAIN: ::c_int = 11; /* No more processes */
+pub const ENOMEM: ::c_int = 12; /* Not enough core */
+pub const EACCES: ::c_int = 13; /* Permission denied */
+pub const EFAULT: ::c_int = 14;
+pub const ENOTEMPTY: ::c_int = 15;
+pub const EBUSY: ::c_int = 16;
+pub const EEXIST: ::c_int = 17;
+pub const EXDEV: ::c_int = 18;
+pub const ENODEV: ::c_int = 19;
+pub const ENOTDIR: ::c_int = 20;
+pub const EISDIR: ::c_int = 21;
+pub const EINVAL: ::c_int = 22;
+pub const ENAMETOOLONG: ::c_int = 26;
+pub const EFBIG: ::c_int = 27;
+pub const ENOSPC: ::c_int = 28;
+pub const ESPIPE: ::c_int = 29;
+pub const EROFS: ::c_int = 30;
+pub const EMLINK: ::c_int = 31;
+pub const EPIPE: ::c_int = 32;
+pub const EDEADLK: ::c_int = 33;
+pub const ERANGE: ::c_int = 38;
+pub const EDESTADDRREQ: ::c_int = 40;
+pub const EPROTOTYPE: ::c_int = 41;
+pub const ENOPROTOOPT: ::c_int = 42;
+pub const EPROTONOSUPPORT: ::c_int = 43;
+pub const ESOCKTNOSUPPORT: ::c_int = 44;
+pub const EOPNOTSUPP: ::c_int = 45;
+pub const EPFNOSUPPORT: ::c_int = 46;
+pub const EAFNOSUPPORT: ::c_int = 47;
+pub const EADDRINUSE: ::c_int = 48;
+pub const EADDRNOTAVAIL: ::c_int = 49;
+pub const ENOTSOCK: ::c_int = 50;
+pub const ENETUNREACH: ::c_int = 51;
+pub const ENETRESET: ::c_int = 52;
+pub const ECONNABORTED: ::c_int = 53;
+pub const ECONNRESET: ::c_int = 54;
+pub const ENOBUFS: ::c_int = 55;
+pub const EISCONN: ::c_int = 56;
+pub const ENOTCONN: ::c_int = 57;
+pub const ESHUTDOWN: ::c_int = 58;
+pub const ETOOMANYREFS: ::c_int = 59;
+pub const ETIMEDOUT: ::c_int = 60;
+pub const ECONNREFUSED: ::c_int = 61;
+pub const ENETDOWN: ::c_int = 62;
+pub const ETXTBSY: ::c_int = 63;
+pub const ELOOP: ::c_int = 64;
+pub const EHOSTUNREACH: ::c_int = 65;
+pub const EINPROGRESS: ::c_int = 68;
+pub const EALREADY: ::c_int = 69;
+pub const EWOULDBLOCK: ::c_int = 70;
+pub const ENOSYS: ::c_int = 71;
+pub const EDQUOT: ::c_int = 83;
+pub const ESTALE: ::c_int = 88;
+
+// NFS errnos: Refer to pkgs_v2/storage/fs/nfs/h/nfs/nfsCommon.h
+const M_nfsStat: ::c_int = 48 << 16;
+enum nfsstat {
+    NFSERR_REMOTE = 71,
+    NFSERR_WFLUSH = 99,
+    NFSERR_BADHANDLE = 10001,
+    NFSERR_NOT_SYNC = 10002,
+    NFSERR_BAD_COOKIE = 10003,
+    NFSERR_TOOSMALL = 10005,
+    NFSERR_BADTYPE = 10007,
+    NFSERR_JUKEBOX = 10008,
+}
+
+pub const S_nfsLib_NFS_OK: ::c_int = OK;
+pub const S_nfsLib_NFSERR_PERM: ::c_int = EPERM;
+pub const S_nfsLib_NFSERR_NOENT: ::c_int = ENOENT;
+pub const S_nfsLib_NFSERR_IO: ::c_int = EIO;
+pub const S_nfsLib_NFSERR_NXIO: ::c_int = ENXIO;
+pub const S_nfsLib_NFSERR_ACCESS: ::c_int = EACCES;
+pub const S_nfsLib_NFSERR_EXIST: ::c_int = EEXIST;
+pub const S_nfsLib_NFSERR_ENODEV: ::c_int = ENODEV;
+pub const S_nfsLib_NFSERR_NOTDIR: ::c_int = ENOTDIR;
+pub const S_nfsLib_NFSERR_ISDIR: ::c_int = EISDIR;
+pub const S_nfsLib_NFSERR_INVAL: ::c_int = EINVAL;
+pub const S_nfsLib_NFSERR_FBIG: ::c_int = EFBIG;
+pub const S_nfsLib_NFSERR_NOSPC: ::c_int = ENOSPC;
+pub const S_nfsLib_NFSERR_ROFS: ::c_int = EROFS;
+pub const S_nfsLib_NFSERR_NAMETOOLONG: ::c_int = ENAMETOOLONG;
+pub const S_nfsLib_NFSERR_NOTEMPTY: ::c_int = ENOTEMPTY;
+pub const S_nfsLib_NFSERR_DQUOT: ::c_int = EDQUOT;
+pub const S_nfsLib_NFSERR_STALE: ::c_int = ESTALE;
+pub const S_nfsLib_NFSERR_WFLUSH: ::c_int = M_nfsStat | nfsstat::NFSERR_WFLUSH as ::c_int;
+pub const S_nfsLib_NFSERR_REMOTE: ::c_int = M_nfsStat | nfsstat::NFSERR_REMOTE as ::c_int;
+pub const S_nfsLib_NFSERR_BADHANDLE: ::c_int = M_nfsStat | nfsstat::NFSERR_BADHANDLE as ::c_int;
+pub const S_nfsLib_NFSERR_NOT_SYNC: ::c_int = M_nfsStat | nfsstat::NFSERR_NOT_SYNC as ::c_int;
+pub const S_nfsLib_NFSERR_BAD_COOKIE: ::c_int = M_nfsStat | nfsstat::NFSERR_BAD_COOKIE as ::c_int;
+pub const S_nfsLib_NFSERR_NOTSUPP: ::c_int = EOPNOTSUPP;
+pub const S_nfsLib_NFSERR_TOOSMALL: ::c_int = M_nfsStat | nfsstat::NFSERR_TOOSMALL as ::c_int;
+pub const S_nfsLib_NFSERR_SERVERFAULT: ::c_int = EIO;
+pub const S_nfsLib_NFSERR_BADTYPE: ::c_int = M_nfsStat | nfsstat::NFSERR_BADTYPE as ::c_int;
+pub const S_nfsLib_NFSERR_JUKEBOX: ::c_int = M_nfsStat | nfsstat::NFSERR_JUKEBOX as ::c_int;
+
+// in.h
+pub const IPPROTO_IP: ::c_int = 0;
+pub const IPPROTO_IPV6: ::c_int = 41;
+
+pub const IP_TTL: ::c_int = 4;
+pub const IP_MULTICAST_IF: ::c_int = 9;
+pub const IP_MULTICAST_TTL: ::c_int = 10;
+pub const IP_MULTICAST_LOOP: ::c_int = 11;
+pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
+pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
+
+// in6.h
+pub const IPV6_V6ONLY: ::c_int = 1;
+pub const IPV6_UNICAST_HOPS: ::c_int = 4;
+pub const IPV6_MULTICAST_IF: ::c_int = 9;
+pub const IPV6_MULTICAST_HOPS: ::c_int = 10;
+pub const IPV6_MULTICAST_LOOP: ::c_int = 11;
+pub const IPV6_ADD_MEMBERSHIP: ::c_int = 12;
+pub const IPV6_DROP_MEMBERSHIP: ::c_int = 13;
+
+// STAT Stuff
+pub const S_IFMT: ::c_int = 0xf000;
+pub const S_IFIFO: ::c_int = 0x1000;
+pub const S_IFCHR: ::c_int = 0x2000;
+pub const S_IFDIR: ::c_int = 0x4000;
+pub const S_IFBLK: ::c_int = 0x6000;
+pub const S_IFREG: ::c_int = 0x8000;
+pub const S_IFLNK: ::c_int = 0xa000;
+pub const S_IFSHM: ::c_int = 0xb000;
+pub const S_IFSOCK: ::c_int = 0xc000;
+pub const S_ISUID: ::c_int = 0x0800;
+pub const S_ISGID: ::c_int = 0x0400;
+pub const S_ISTXT: ::c_int = 0x0200;
+pub const S_IRUSR: ::c_int = 0x0100;
+pub const S_IWUSR: ::c_int = 0x0080;
+pub const S_IXUSR: ::c_int = 0x0040;
+pub const S_IRWXU: ::c_int = 0x01c0;
+pub const S_IRGRP: ::c_int = 0x0020;
+pub const S_IWGRP: ::c_int = 0x0010;
+pub const S_IXGRP: ::c_int = 0x0008;
+pub const S_IRWXG: ::c_int = 0x0038;
+pub const S_IROTH: ::c_int = 0x0004;
+pub const S_IWOTH: ::c_int = 0x0002;
+pub const S_IXOTH: ::c_int = 0x0001;
+pub const S_IRWXO: ::c_int = 0x0007;
+
+// socket.h
+pub const SOL_SOCKET: ::c_int = 0xffff;
+
+pub const SO_DEBUG: ::c_int = 0x0001;
+pub const SO_REUSEADDR: ::c_int = 0x0004;
+pub const SO_KEEPALIVE: ::c_int = 0x0008;
+pub const SO_DONTROUTE: ::c_int = 0x0010;
+pub const SO_RCVLOWAT: ::c_int = 0x0012;
+pub const SO_SNDLOWAT: ::c_int = 0x0013;
+pub const SO_SNDTIMEO: ::c_int = 0x1005;
+pub const SO_ACCEPTCONN: ::c_int = 0x001e;
+pub const SO_BROADCAST: ::c_int = 0x0020;
+pub const SO_USELOOPBACK: ::c_int = 0x0040;
+pub const SO_LINGER: ::c_int = 0x0080;
+pub const SO_REUSEPORT: ::c_int = 0x0200;
+
+pub const SO_VLAN: ::c_int = 0x8000;
+
+pub const SO_SNDBUF: ::c_int = 0x1001;
+pub const SO_RCVBUF: ::c_int = 0x1002;
+pub const SO_RCVTIMEO: ::c_int = 0x1006;
+pub const SO_ERROR: ::c_int = 0x1007;
+pub const SO_TYPE: ::c_int = 0x1008;
+pub const SO_BINDTODEVICE: ::c_int = 0x1010;
+pub const SO_OOBINLINE: ::c_int = 0x1011;
+pub const SO_CONNTIMEO: ::c_int = 0x100a;
+
+pub const SOCK_STREAM: ::c_int = 1;
+pub const SOCK_DGRAM: ::c_int = 2;
+pub const SOCK_RAW: ::c_int = 3;
+pub const SOCK_RDM: ::c_int = 4;
+pub const SOCK_SEQPACKET: ::c_int = 5;
+pub const SOCK_PACKET: ::c_int = 10;
+
+pub const _SS_MAXSIZE: usize = 128;
+pub const _SS_ALIGNSIZE: usize = size_of::<u32>();
+pub const _SS_PAD1SIZE: usize = _SS_ALIGNSIZE - size_of::<::c_uchar>() - size_of::<::sa_family_t>();
+pub const _SS_PAD2SIZE: usize = _SS_MAXSIZE
+    - size_of::<::c_uchar>()
+    - size_of::<::sa_family_t>()
+    - _SS_PAD1SIZE
+    - _SS_ALIGNSIZE;
+
+pub const MSG_OOB: ::c_int = 0x0001;
+pub const MSG_PEEK: ::c_int = 0x0002;
+pub const MSG_DONTROUTE: ::c_int = 0x0004;
+pub const MSG_EOR: ::c_int = 0x0008;
+pub const MSG_TRUNC: ::c_int = 0x0010;
+pub const MSG_CTRUNC: ::c_int = 0x0020;
+pub const MSG_WAITALL: ::c_int = 0x0040;
+pub const MSG_DONTWAIT: ::c_int = 0x0080;
+pub const MSG_EOF: ::c_int = 0x0100;
+pub const MSG_EXP: ::c_int = 0x0200;
+pub const MSG_MBUF: ::c_int = 0x0400;
+pub const MSG_NOTIFICATION: ::c_int = 0x0800;
+pub const MSG_COMPAT: ::c_int = 0x8000;
+
+pub const AF_UNSPEC: ::c_int = 0;
+pub const AF_LOCAL: ::c_int = 1;
+pub const AF_UNIX: ::c_int = AF_LOCAL;
+pub const AF_INET: ::c_int = 2;
+pub const AF_NETLINK: ::c_int = 16;
+pub const AF_ROUTE: ::c_int = 17;
+pub const AF_LINK: ::c_int = 18;
+pub const AF_PACKET: ::c_int = 19;
+pub const pseudo_AF_KEY: ::c_int = 27;
+pub const AF_KEY: ::c_int = pseudo_AF_KEY;
+pub const AF_INET6: ::c_int = 28;
+pub const AF_SOCKDEV: ::c_int = 31;
+pub const AF_TIPC: ::c_int = 33;
+pub const AF_MIPC: ::c_int = 34;
+pub const AF_MIPC_SAFE: ::c_int = 35;
+pub const AF_MAX: ::c_int = 37;
+
+pub const SHUT_RD: ::c_int = 0;
+pub const SHUT_WR: ::c_int = 1;
+pub const SHUT_RDWR: ::c_int = 2;
+
+pub const IPPROTO_TCP: ::c_int = 6;
+pub const TCP_NODELAY: ::c_int = 1;
+pub const TCP_MAXSEG: ::c_int = 2;
+pub const TCP_NOPUSH: ::c_int = 3;
+pub const TCP_KEEPIDLE: ::c_int = 4;
+pub const TCP_KEEPINTVL: ::c_int = 5;
+pub const TCP_KEEPCNT: ::c_int = 6;
+
+// ioLib.h
+pub const FIONREAD: ::c_int = 0x40040001;
+pub const FIOFLUSH: ::c_int = 2;
+pub const FIOOPTIONS: ::c_int = 3;
+pub const FIOBAUDRATE: ::c_int = 4;
+pub const FIODISKFORMAT: ::c_int = 5;
+pub const FIODISKINIT: ::c_int = 6;
+pub const FIOSEEK: ::c_int = 7;
+pub const FIOWHERE: ::c_int = 8;
+pub const FIODIRENTRY: ::c_int = 9;
+pub const FIORENAME: ::c_int = 10;
+pub const FIOREADYCHANGE: ::c_int = 11;
+pub const FIODISKCHANGE: ::c_int = 13;
+pub const FIOCANCEL: ::c_int = 14;
+pub const FIOSQUEEZE: ::c_int = 15;
+pub const FIOGETNAME: ::c_int = 18;
+pub const FIONBIO: ::c_int = 0x90040010;
+
+// limits.h
+pub const PATH_MAX: ::c_int = _PARM_PATH_MAX;
+pub const _POSIX_PATH_MAX: ::c_int = 256;
+
+// Some poll stuff
+pub const POLLIN: ::c_short = 0x0001;
+pub const POLLPRI: ::c_short = 0x0002;
+pub const POLLOUT: ::c_short = 0x0004;
+pub const POLLRDNORM: ::c_short = 0x0040;
+pub const POLLWRNORM: ::c_short = POLLOUT;
+pub const POLLRDBAND: ::c_short = 0x0080;
+pub const POLLWRBAND: ::c_short = 0x0100;
+pub const POLLERR: ::c_short = 0x0008;
+pub const POLLHUP: ::c_short = 0x0010;
+pub const POLLNVAL: ::c_short = 0x0020;
+
+// fnctlcom.h
+pub const FD_CLOEXEC: ::c_int = 1;
+pub const F_DUPFD: ::c_int = 0;
+pub const F_GETFD: ::c_int = 1;
+pub const F_SETFD: ::c_int = 2;
+pub const F_GETFL: ::c_int = 3;
+pub const F_SETFL: ::c_int = 4;
+pub const F_GETOWN: ::c_int = 5;
+pub const F_SETOWN: ::c_int = 6;
+pub const F_GETLK: ::c_int = 7;
+pub const F_SETLK: ::c_int = 8;
+pub const F_SETLKW: ::c_int = 9;
+pub const F_DUPFD_CLOEXEC: ::c_int = 14;
+
+// signal.h
+pub const SIG_DFL: sighandler_t = 0 as sighandler_t;
+pub const SIG_IGN: sighandler_t = 1 as sighandler_t;
+pub const SIG_ERR: sighandler_t = -1 as isize as sighandler_t;
+
+pub const SIGHUP: ::c_int = 1;
+pub const SIGINT: ::c_int = 2;
+pub const SIGQUIT: ::c_int = 3;
+pub const SIGILL: ::c_int = 4;
+pub const SIGTRAP: ::c_int = 5;
+pub const SIGABRT: ::c_int = 6;
+pub const SIGEMT: ::c_int = 7;
+pub const SIGFPE: ::c_int = 8;
+pub const SIGKILL: ::c_int = 9;
+pub const SIGBUS: ::c_int = 10;
+pub const SIGSEGV: ::c_int = 11;
+pub const SIGFMT: ::c_int = 12;
+pub const SIGPIPE: ::c_int = 13;
+pub const SIGALRM: ::c_int = 14;
+pub const SIGTERM: ::c_int = 15;
+pub const SIGCNCL: ::c_int = 16;
+pub const SIGSTOP: ::c_int = 17;
+pub const SIGTSTP: ::c_int = 18;
+pub const SIGCONT: ::c_int = 19;
+pub const SIGCHLD: ::c_int = 20;
+pub const SIGTTIN: ::c_int = 21;
+pub const SIGTTOU: ::c_int = 22;
+
+pub const SIG_BLOCK: ::c_int = 1;
+pub const SIG_UNBLOCK: ::c_int = 2;
+pub const SIG_SETMASK: ::c_int = 3;
+
+pub const SI_SYNC: ::c_int = 0;
+pub const SI_USER: ::c_int = -1;
+pub const SI_QUEUE: ::c_int = -2;
+pub const SI_TIMER: ::c_int = -3;
+pub const SI_ASYNCIO: ::c_int = -4;
+pub const SI_MESGQ: ::c_int = -5;
+pub const SI_CHILD: ::c_int = -6;
+pub const SI_KILL: ::c_int = SI_USER;
+
+// vxParams.h definitions
+pub const _PARM_NAME_MAX: ::c_int = 255;
+pub const _PARM_PATH_MAX: ::c_int = 1024;
+
+// WAIT STUFF
+pub const WNOHANG: ::c_int = 0x01;
+pub const WUNTRACED: ::c_int = 0x02;
+
+const PTHREAD_MUTEXATTR_INITIALIZER: pthread_mutexattr_t = pthread_mutexattr_t {
+    mutexAttrStatus: PTHREAD_INITIALIZED_OBJ,
+    mutexAttrProtocol: PTHREAD_PRIO_NONE,
+    mutexAttrPrioceiling: 0,
+    mutexAttrType: PTHREAD_MUTEX_DEFAULT,
+    mutexAttrPshared: 1,
+};
+pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+    mutexSemId: null_mut(),
+    mutexValid: PTHREAD_VALID_OBJ,
+    mutexInitted: PTHREAD_UNUSED_YET_OBJ,
+    mutexCondRefCount: 0,
+    mutexSavPriority: -1,
+    mutexAttr: PTHREAD_MUTEXATTR_INITIALIZER,
+    mutexSemName: [0; _PTHREAD_SHARED_SEM_NAME_MAX],
+};
+
+const PTHREAD_CONDATTR_INITIALIZER: pthread_condattr_t = pthread_condattr_t {
+    condAttrStatus: 0xf70990ef,
+    condAttrPshared: 1,
+    condAttrClockId: CLOCK_REALTIME,
+};
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+    condSemId: null_mut(),
+    condValid: PTHREAD_VALID_OBJ,
+    condInitted: PTHREAD_UNUSED_YET_OBJ,
+    condRefCount: 0,
+    condMutex: null_mut(),
+    condAttr: PTHREAD_CONDATTR_INITIALIZER,
+    condSemName: [0; _PTHREAD_SHARED_SEM_NAME_MAX],
+};
+
+const PTHREAD_RWLOCKATTR_INITIALIZER: pthread_rwlockattr_t = pthread_rwlockattr_t {
+    rwlockAttrStatus: PTHREAD_INITIALIZED_OBJ,
+    rwlockAttrPshared: 1,
+    rwlockAttrMaxReaders: 0,
+    rwlockAttrConformOpt: 1,
+};
+pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+    rwlockSemId: null_mut(),
+    rwlockReadersRefCount: 0,
+    rwlockValid: PTHREAD_VALID_OBJ,
+    rwlockInitted: PTHREAD_UNUSED_YET_OBJ,
+    rwlockAttr: PTHREAD_RWLOCKATTR_INITIALIZER,
+    rwlockSemName: [0; _PTHREAD_SHARED_SEM_NAME_MAX],
+};
+
+pub const SEEK_SET: ::c_int = 0;
+pub const SEEK_CUR: ::c_int = 1;
+pub const SEEK_END: ::c_int = 2;
+
+// rtpLibCommon.h
+pub const VX_RTP_NAME_LENGTH: ::c_int = 255;
+pub const RTP_ID_ERROR: ::RTP_ID = -1;
+
+// h/public/unistd.h
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 21; // Via unistd.h
+pub const _SC_PAGESIZE: ::c_int = 39;
+pub const O_ACCMODE: ::c_int = 3;
+pub const O_CLOEXEC: ::c_int = 0x100000; // fcntlcom
+pub const O_EXCL: ::c_int = 0x0800;
+pub const O_CREAT: ::c_int = 0x0200;
+pub const O_TRUNC: ::c_int = 0x0400;
+pub const O_APPEND: ::c_int = 0x0008;
+pub const O_RDWR: ::c_int = 0x0002;
+pub const O_WRONLY: ::c_int = 0x0001;
+pub const O_RDONLY: ::c_int = 0;
+pub const O_NONBLOCK: ::c_int = 0x4000;
+
+// mman.h
+pub const PROT_NONE: ::c_int = 0x0000;
+pub const PROT_READ: ::c_int = 0x0001;
+pub const PROT_WRITE: ::c_int = 0x0002;
+pub const PROT_EXEC: ::c_int = 0x0004;
+
+pub const MAP_SHARED: ::c_int = 0x0001;
+pub const MAP_PRIVATE: ::c_int = 0x0002;
+pub const MAP_ANON: ::c_int = 0x0004;
+pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
+pub const MAP_FIXED: ::c_int = 0x0010;
+pub const MAP_CONTIG: ::c_int = 0x0020;
+
+pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum FILE {}
+impl ::Copy for FILE {}
+impl ::Clone for FILE {
+    fn clone(&self) -> FILE {
+        *self
+    }
+}
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum fpos_t {} // FIXME: fill this out with a struct
+impl ::Copy for fpos_t {}
+impl ::Clone for fpos_t {
+    fn clone(&self) -> fpos_t {
+        *self
+    }
+}
+
+f! {
+    pub {const} fn CMSG_ALIGN(len: usize) -> usize {
+        len + ::mem::size_of::<usize>() - 1 & !(::mem::size_of::<usize>() - 1)
+    }
+
+    pub fn CMSG_NXTHDR(mhdr: *const msghdr,
+                       cmsg: *const cmsghdr) -> *mut cmsghdr {
+        let next = cmsg as usize + CMSG_ALIGN((*cmsg).cmsg_len as usize)
+            + CMSG_ALIGN(::mem::size_of::<::cmsghdr>());
+        let max = (*mhdr).msg_control as usize
+            + (*mhdr).msg_controllen as usize;
+        if next <= max {
+            (cmsg as usize + CMSG_ALIGN((*cmsg).cmsg_len as usize))
+                as *mut ::cmsghdr
+        } else {
+            0 as *mut ::cmsghdr
+        }
+    }
+
+    pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
+        if (*mhdr).msg_controllen as usize > 0  {
+            (*mhdr).msg_control as *mut cmsghdr
+        } else {
+            0 as *mut cmsghdr
+        }
+    }
+
+    pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut ::c_uchar {
+        (cmsg as *mut ::c_uchar)
+            .offset(CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
+    }
+
+    pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
+        (CMSG_ALIGN(length as usize) + CMSG_ALIGN(::mem::size_of::<cmsghdr>()))
+            as ::c_uint
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        CMSG_ALIGN(::mem::size_of::<cmsghdr>()) as ::c_uint + length
+    }
+}
+
+extern "C" {
+    pub fn isalnum(c: c_int) -> c_int;
+    pub fn isalpha(c: c_int) -> c_int;
+    pub fn iscntrl(c: c_int) -> c_int;
+    pub fn isdigit(c: c_int) -> c_int;
+    pub fn isgraph(c: c_int) -> c_int;
+    pub fn islower(c: c_int) -> c_int;
+    pub fn isprint(c: c_int) -> c_int;
+    pub fn ispunct(c: c_int) -> c_int;
+    pub fn isspace(c: c_int) -> c_int;
+    pub fn isupper(c: c_int) -> c_int;
+    pub fn isxdigit(c: c_int) -> c_int;
+    pub fn isblank(c: c_int) -> c_int;
+    pub fn tolower(c: c_int) -> c_int;
+    pub fn toupper(c: c_int) -> c_int;
+    pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE;
+    pub fn freopen(filename: *const c_char, mode: *const c_char, file: *mut FILE) -> *mut FILE;
+    pub fn fflush(file: *mut FILE) -> c_int;
+    pub fn fclose(file: *mut FILE) -> c_int;
+    pub fn remove(filename: *const c_char) -> c_int;
+    pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int;
+    pub fn tmpfile() -> *mut FILE;
+    pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int;
+    pub fn setbuf(stream: *mut FILE, buf: *mut c_char);
+    pub fn getchar() -> c_int;
+    pub fn putchar(c: c_int) -> c_int;
+    pub fn fgetc(stream: *mut FILE) -> c_int;
+    pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char;
+    pub fn fputc(c: c_int, stream: *mut FILE) -> c_int;
+    pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int;
+    pub fn puts(s: *const c_char) -> c_int;
+    pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int;
+    pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
+    pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
+    pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int;
+    pub fn ftell(stream: *mut FILE) -> c_long;
+    pub fn rewind(stream: *mut FILE);
+    pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int;
+    pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int;
+    pub fn feof(stream: *mut FILE) -> c_int;
+    pub fn ferror(stream: *mut FILE) -> c_int;
+    pub fn perror(s: *const c_char);
+    pub fn atof(s: *const c_char) -> c_double;
+    pub fn atoi(s: *const c_char) -> c_int;
+    pub fn atol(s: *const c_char) -> c_long;
+    pub fn atoll(s: *const c_char) -> c_longlong;
+    pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
+    pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
+    pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
+    pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
+    pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
+    pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
+    pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
+    pub fn malloc(size: size_t) -> *mut c_void;
+    pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
+    pub fn free(p: *mut c_void);
+    pub fn abort() -> !;
+    pub fn exit(status: c_int) -> !;
+    pub fn atexit(cb: extern "C" fn()) -> c_int;
+    pub fn system(s: *const c_char) -> c_int;
+    pub fn getenv(s: *const c_char) -> *mut c_char;
+
+    pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char;
+    pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
+    pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char;
+    pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char;
+    pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int;
+    pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int;
+    pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int;
+    pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char;
+    pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char;
+    pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t;
+    pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t;
+    pub fn strdup(cs: *const c_char) -> *mut c_char;
+    pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char;
+    pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
+    pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int;
+    pub fn strncasecmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int;
+    pub fn strlen(cs: *const c_char) -> size_t;
+    pub fn strerror(n: c_int) -> *mut c_char;
+    pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char;
+    pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t;
+    pub fn wcslen(buf: *const wchar_t) -> size_t;
+    pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> ::size_t;
+
+    pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
+    pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t;
+    pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
+    pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
+    pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
+    pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
+}
+
+extern "C" {
+    pub fn fprintf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
+    pub fn printf(format: *const ::c_char, ...) -> ::c_int;
+    pub fn snprintf(s: *mut ::c_char, n: ::size_t, format: *const ::c_char, ...) -> ::c_int;
+    pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int;
+    pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
+    pub fn scanf(format: *const ::c_char, ...) -> ::c_int;
+    pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int;
+    pub fn getchar_unlocked() -> ::c_int;
+    pub fn putchar_unlocked(c: ::c_int) -> ::c_int;
+    pub fn stat(path: *const c_char, buf: *mut stat) -> ::c_int;
+    pub fn fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE;
+    pub fn fileno(stream: *mut ::FILE) -> ::c_int;
+    pub fn creat(path: *const c_char, mode: mode_t) -> ::c_int;
+    pub fn rewinddir(dirp: *mut ::DIR);
+    pub fn fchown(fd: ::c_int, owner: ::uid_t, group: ::gid_t) -> ::c_int;
+    pub fn access(path: *const c_char, amode: ::c_int) -> ::c_int;
+    pub fn alarm(seconds: ::c_uint) -> ::c_uint;
+    pub fn fchdir(dirfd: ::c_int) -> ::c_int;
+    pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int;
+    pub fn fpathconf(filedes: ::c_int, name: ::c_int) -> c_long;
+    pub fn getegid() -> gid_t;
+    pub fn geteuid() -> uid_t;
+    pub fn getgroups(ngroups_max: ::c_int, groups: *mut gid_t) -> ::c_int;
+    pub fn getlogin() -> *mut c_char;
+    pub fn getopt(argc: ::c_int, argv: *const *mut c_char, optstr: *const c_char) -> ::c_int;
+    pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long;
+    pub fn pause() -> ::c_int;
+    pub fn seteuid(uid: uid_t) -> ::c_int;
+    pub fn setegid(gid: gid_t) -> ::c_int;
+    pub fn sleep(secs: ::c_uint) -> ::c_uint;
+    pub fn ttyname(fd: ::c_int) -> *mut c_char;
+    pub fn wait(status: *mut ::c_int) -> pid_t;
+    pub fn umask(mask: mode_t) -> mode_t;
+    pub fn mlock(addr: *const ::c_void, len: ::size_t) -> ::c_int;
+    pub fn mlockall(flags: ::c_int) -> ::c_int;
+    pub fn munlockall() -> ::c_int;
+
+    pub fn mmap(
+        addr: *mut ::c_void,
+        len: ::size_t,
+        prot: ::c_int,
+        flags: ::c_int,
+        fd: ::c_int,
+        offset: off_t,
+    ) -> *mut ::c_void;
+    pub fn munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int;
+    pub fn truncate(path: *const c_char, length: off_t) -> ::c_int;
+    pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int;
+    pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
+
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
+    pub fn pthread_exit(value: *mut ::c_void) -> !;
+    pub fn pthread_attr_setdetachstate(attr: *mut ::pthread_attr_t, state: ::c_int) -> ::c_int;
+
+    pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
+
+    pub fn sigaddset(set: *mut sigset_t, signum: ::c_int) -> ::c_int;
+
+    pub fn sigaction(signum: ::c_int, act: *const sigaction, oldact: *mut sigaction) -> ::c_int;
+
+    pub fn utimes(filename: *const ::c_char, times: *const ::timeval) -> ::c_int;
+
+    #[link_name = "_rtld_dlopen"]
+    pub fn dlopen(filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void;
+
+    #[link_name = "_rtld_dlerror"]
+    pub fn dlerror() -> *mut ::c_char;
+
+    #[link_name = "_rtld_dlsym"]
+    pub fn dlsym(handle: *mut ::c_void, symbol: *const ::c_char) -> *mut ::c_void;
+
+    #[link_name = "_rtld_dlclose"]
+    pub fn dlclose(handle: *mut ::c_void) -> ::c_int;
+
+    #[link_name = "_rtld_dladdr"]
+    pub fn dladdr(addr: *mut ::c_void, info: *mut Dl_info) -> ::c_int;
+
+    // time.h
+    pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
+    pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
+    pub fn mktime(tm: *mut tm) -> time_t;
+    pub fn time(time: *mut time_t) -> time_t;
+    pub fn gmtime(time_p: *const time_t) -> *mut tm;
+    pub fn localtime(time_p: *const time_t) -> *mut tm;
+    pub fn timegm(tm: *mut tm) -> time_t;
+    pub fn difftime(time1: time_t, time0: time_t) -> ::c_double;
+    pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
+    pub fn usleep(secs: ::useconds_t) -> ::c_int;
+    pub fn putenv(string: *mut c_char) -> ::c_int;
+    pub fn setlocale(category: ::c_int, locale: *const ::c_char) -> *mut ::c_char;
+
+    pub fn sigprocmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
+    pub fn sigpending(set: *mut sigset_t) -> ::c_int;
+
+    pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int;
+
+    pub fn fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int;
+    pub fn ftello(stream: *mut ::FILE) -> ::off_t;
+    pub fn mkstemp(template: *mut ::c_char) -> ::c_int;
+
+    pub fn tmpnam(ptr: *mut ::c_char) -> *mut ::c_char;
+
+    pub fn openlog(ident: *const ::c_char, logopt: ::c_int, facility: ::c_int);
+    pub fn closelog();
+    pub fn setlogmask(maskpri: ::c_int) -> ::c_int;
+    pub fn syslog(priority: ::c_int, message: *const ::c_char, ...);
+    pub fn getline(lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t;
+
+}
+
+extern "C" {
+    // stdlib.h
+    pub fn memalign(block_size: ::size_t, size_arg: ::size_t) -> *mut ::c_void;
+
+    // ioLib.h
+    pub fn getcwd(buf: *mut ::c_char, size: ::size_t) -> *mut ::c_char;
+
+    // ioLib.h
+    pub fn chdir(attr: *const ::c_char) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_mutexattr_settype(pAttr: *mut ::pthread_mutexattr_t, pType: ::c_int) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_mutex_init(
+        mutex: *mut pthread_mutex_t,
+        attr: *const pthread_mutexattr_t,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_mutex_destroy(mutex: *mut pthread_mutex_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_mutex_lock(mutex: *mut pthread_mutex_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_mutex_trylock(mutex: *mut pthread_mutex_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_mutex_timedlock(attr: *mut pthread_mutex_t, spec: *const timespec) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_mutex_unlock(mutex: *mut pthread_mutex_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_attr_setname(pAttr: *mut ::pthread_attr_t, name: *mut ::c_char) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_attr_setstacksize(attr: *mut ::pthread_attr_t, stacksize: ::size_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_attr_getstacksize(attr: *const ::pthread_attr_t, size: *mut ::size_t)
+        -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_create(
+        pThread: *mut ::pthread_t,
+        pAttr: *const ::pthread_attr_t,
+        start_routine: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
+        value: *mut ::c_void,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_attr_destroy(thread: *mut ::pthread_attr_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_detach(thread: ::pthread_t) -> ::c_int;
+
+    // int pthread_atfork (void (*)(void), void (*)(void), void (*)(void));
+    pub fn pthread_atfork(
+        prepare: ::Option<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+    // stat.h
+    pub fn fstat(fildes: ::c_int, buf: *mut stat) -> ::c_int;
+
+    // stat.h
+    pub fn lstat(path: *const ::c_char, buf: *mut stat) -> ::c_int;
+
+    // unistd.h
+    pub fn ftruncate(fd: ::c_int, length: off_t) -> ::c_int;
+
+    // dirent.h
+    pub fn readdir_r(pDir: *mut ::DIR, entry: *mut ::dirent, result: *mut *mut ::dirent)
+        -> ::c_int;
+
+    // dirent.h
+    pub fn readdir(pDir: *mut ::DIR) -> *mut ::dirent;
+
+    // fcntl.h or
+    // ioLib.h
+    pub fn open(path: *const ::c_char, oflag: ::c_int, ...) -> ::c_int;
+
+    // poll.h
+    pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_condattr_init(attr: *mut ::pthread_condattr_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_condattr_destroy(attr: *mut ::pthread_condattr_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_condattr_getclock(
+        pAttr: *const ::pthread_condattr_t,
+        pClockId: *mut ::clockid_t,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_condattr_setclock(
+        pAttr: *mut ::pthread_condattr_t,
+        clockId: ::clockid_t,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_cond_init(
+        cond: *mut ::pthread_cond_t,
+        attr: *const ::pthread_condattr_t,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_cond_signal(cond: *mut ::pthread_cond_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_cond_broadcast(cond: *mut ::pthread_cond_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_cond_wait(cond: *mut ::pthread_cond_t, mutex: *mut ::pthread_mutex_t)
+        -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlockattr_init(attr: *mut ::pthread_rwlockattr_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlockattr_destroy(attr: *mut ::pthread_rwlockattr_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlockattr_setmaxreaders(
+        attr: *mut ::pthread_rwlockattr_t,
+        attr2: ::c_uint,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlock_init(
+        attr: *mut ::pthread_rwlock_t,
+        host: *const ::pthread_rwlockattr_t,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlock_destroy(attr: *mut ::pthread_rwlock_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlock_rdlock(attr: *mut ::pthread_rwlock_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlock_tryrdlock(attr: *mut ::pthread_rwlock_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlock_timedrdlock(
+        attr: *mut ::pthread_rwlock_t,
+        host: *const ::timespec,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlock_wrlock(attr: *mut ::pthread_rwlock_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlock_trywrlock(attr: *mut ::pthread_rwlock_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlock_timedwrlock(
+        attr: *mut ::pthread_rwlock_t,
+        host: *const ::timespec,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlock_unlock(attr: *mut ::pthread_rwlock_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_key_create(
+        key: *mut ::pthread_key_t,
+        dtor: ::Option<unsafe extern "C" fn(*mut ::c_void)>,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_key_delete(key: ::pthread_key_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_setspecific(key: ::pthread_key_t, value: *const ::c_void) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_getspecific(key: ::pthread_key_t) -> *mut ::c_void;
+
+    // pthread.h
+    pub fn pthread_cond_timedwait(
+        cond: *mut ::pthread_cond_t,
+        mutex: *mut ::pthread_mutex_t,
+        abstime: *const ::timespec,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_attr_getname(attr: *mut ::pthread_attr_t, name: *mut *mut ::c_char) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_join(thread: ::pthread_t, status: *mut *mut ::c_void) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_self() -> ::pthread_t;
+
+    // clockLib.h
+    pub fn clock_gettime(clock_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+
+    // clockLib.h
+    pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+
+    // clockLib.h
+    pub fn clock_getres(clock_id: ::clockid_t, res: *mut ::timespec) -> ::c_int;
+
+    // clockLib.h
+    pub fn clock_nanosleep(
+        clock_id: ::clockid_t,
+        flags: ::c_int,
+        rqtp: *const ::timespec,
+        rmtp: *mut ::timespec,
+    ) -> ::c_int;
+
+    // timerLib.h
+    pub fn nanosleep(rqtp: *const ::timespec, rmtp: *mut ::timespec) -> ::c_int;
+
+    // socket.h
+    pub fn accept(s: ::c_int, addr: *mut ::sockaddr, addrlen: *mut ::socklen_t) -> ::c_int;
+
+    // socket.h
+    pub fn bind(fd: ::c_int, addr: *const sockaddr, len: socklen_t) -> ::c_int;
+
+    // socket.h
+    pub fn connect(s: ::c_int, name: *const ::sockaddr, namelen: ::socklen_t) -> ::c_int;
+
+    // socket.h
+    pub fn getpeername(s: ::c_int, name: *mut ::sockaddr, namelen: *mut ::socklen_t) -> ::c_int;
+
+    // socket.h
+    pub fn getsockname(
+        socket: ::c_int,
+        address: *mut sockaddr,
+        address_len: *mut socklen_t,
+    ) -> ::c_int;
+
+    // socket.h
+    pub fn getsockopt(
+        sockfd: ::c_int,
+        level: ::c_int,
+        optname: ::c_int,
+        optval: *mut ::c_void,
+        optlen: *mut ::socklen_t,
+    ) -> ::c_int;
+
+    // socket.h
+    pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int;
+
+    // socket.h
+    pub fn recv(s: ::c_int, buf: *mut ::c_void, bufLen: ::size_t, flags: ::c_int) -> ::ssize_t;
+
+    // socket.h
+    pub fn recvfrom(
+        s: ::c_int,
+        buf: *mut ::c_void,
+        bufLen: ::size_t,
+        flags: ::c_int,
+        from: *mut ::sockaddr,
+        pFromLen: *mut ::socklen_t,
+    ) -> ::ssize_t;
+
+    pub fn recvmsg(socket: ::c_int, mp: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
+
+    // socket.h
+    pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
+
+    pub fn sendmsg(socket: ::c_int, mp: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+
+    // socket.h
+    pub fn sendto(
+        socket: ::c_int,
+        buf: *const ::c_void,
+        len: ::size_t,
+        flags: ::c_int,
+        addr: *const sockaddr,
+        addrlen: socklen_t,
+    ) -> ::ssize_t;
+
+    // socket.h
+    pub fn setsockopt(
+        socket: ::c_int,
+        level: ::c_int,
+        name: ::c_int,
+        value: *const ::c_void,
+        option_len: socklen_t,
+    ) -> ::c_int;
+
+    // socket.h
+    pub fn shutdown(s: ::c_int, how: ::c_int) -> ::c_int;
+
+    // socket.h
+    pub fn socket(domain: ::c_int, _type: ::c_int, protocol: ::c_int) -> ::c_int;
+
+    // icotl.h
+    pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
+
+    // fcntl.h
+    pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int;
+
+    // ntp_rfc2553.h for kernel
+    // netdb.h for user
+    pub fn gai_strerror(errcode: ::c_int) -> *mut ::c_char;
+
+    // ioLib.h or
+    // unistd.h
+    pub fn close(fd: ::c_int) -> ::c_int;
+
+    // ioLib.h or
+    // unistd.h
+    pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) -> ::ssize_t;
+
+    // ioLib.h or
+    // unistd.h
+    pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) -> ::ssize_t;
+
+    // ioLib.h or
+    // unistd.h
+    pub fn isatty(fd: ::c_int) -> ::c_int;
+
+    // ioLib.h or
+    // unistd.h
+    pub fn dup(src: ::c_int) -> ::c_int;
+
+    // ioLib.h or
+    // unistd.h
+    pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int;
+
+    // ioLib.h or
+    // unistd.h
+    pub fn pipe(fds: *mut ::c_int) -> ::c_int;
+
+    // ioLib.h or
+    // unistd.h
+    pub fn unlink(pathname: *const ::c_char) -> ::c_int;
+
+    // unistd.h and
+    // ioLib.h
+    pub fn lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t;
+
+    // netdb.h
+    pub fn getaddrinfo(
+        node: *const ::c_char,
+        service: *const ::c_char,
+        hints: *const addrinfo,
+        res: *mut *mut addrinfo,
+    ) -> ::c_int;
+
+    // netdb.h
+    pub fn freeaddrinfo(res: *mut addrinfo);
+
+    // signal.h
+    pub fn signal(signum: ::c_int, handler: sighandler_t) -> sighandler_t;
+
+    // unistd.h
+    pub fn getpid() -> pid_t;
+
+    // unistd.h
+    pub fn getppid() -> pid_t;
+
+    // wait.h
+    pub fn waitpid(pid: pid_t, status: *mut ::c_int, optons: ::c_int) -> pid_t;
+
+    // unistd.h
+    pub fn sysconf(attr: ::c_int) -> ::c_long;
+
+    // stdlib.h
+    pub fn setenv(
+        // setenv.c
+        envVarName: *const ::c_char,
+        envVarValue: *const ::c_char,
+        overwrite: ::c_int,
+    ) -> ::c_int;
+
+    // stdlib.h
+    pub fn unsetenv(
+        // setenv.c
+        envVarName: *const ::c_char,
+    ) -> ::c_int;
+
+    // stdlib.h
+    pub fn realpath(fileName: *const ::c_char, resolvedName: *mut ::c_char) -> *mut ::c_char;
+
+    // unistd.h
+    pub fn link(src: *const ::c_char, dst: *const ::c_char) -> ::c_int;
+
+    // unistd.h
+    pub fn readlink(path: *const ::c_char, buf: *mut ::c_char, bufsize: ::size_t) -> ::ssize_t;
+
+    // unistd.h
+    pub fn symlink(path1: *const ::c_char, path2: *const ::c_char) -> ::c_int;
+
+    // dirent.h
+    pub fn opendir(name: *const ::c_char) -> *mut ::DIR;
+
+    // unistd.h
+    pub fn rmdir(path: *const ::c_char) -> ::c_int;
+
+    // stat.h
+    pub fn mkdir(dirName: *const ::c_char, mode: ::mode_t) -> ::c_int;
+
+    // stat.h
+    pub fn chmod(path: *const ::c_char, mode: ::mode_t) -> ::c_int;
+
+    // stat.h
+    pub fn fchmod(attr1: ::c_int, attr2: ::mode_t) -> ::c_int;
+
+    // unistd.h
+    pub fn fsync(fd: ::c_int) -> ::c_int;
+
+    // dirent.h
+    pub fn closedir(ptr: *mut ::DIR) -> ::c_int;
+
+    // sched.h
+    pub fn sched_yield() -> ::c_int;
+
+    // errnoLib.h
+    pub fn errnoSet(err: ::c_int) -> ::c_int;
+
+    // errnoLib.h
+    pub fn errnoGet() -> ::c_int;
+
+    // unistd.h
+    pub fn _exit(status: ::c_int) -> !;
+
+    // unistd.h
+    pub fn setgid(gid: ::gid_t) -> ::c_int;
+
+    // unistd.h
+    pub fn getgid() -> ::gid_t;
+
+    // unistd.h
+    pub fn setuid(uid: ::uid_t) -> ::c_int;
+
+    // unistd.h
+    pub fn getuid() -> ::uid_t;
+
+    // signal.h
+    pub fn sigemptyset(__set: *mut sigset_t) -> ::c_int;
+
+    // pthread.h for kernel
+    // signal.h for user
+    pub fn pthread_sigmask(
+        __how: ::c_int,
+        __set: *const sigset_t,
+        __oset: *mut sigset_t,
+    ) -> ::c_int;
+
+    // signal.h for user
+    pub fn kill(__pid: pid_t, __signo: ::c_int) -> ::c_int;
+
+    // signal.h for user
+    pub fn sigqueue(__pid: pid_t, __signo: ::c_int, __value: ::sigval) -> ::c_int;
+
+    // signal.h for user
+    pub fn _sigqueue(
+        rtpId: ::RTP_ID,
+        signo: ::c_int,
+        pValue: *const ::sigval,
+        sigCode: ::c_int,
+    ) -> ::c_int;
+
+    // signal.h
+    pub fn taskKill(taskId: ::TASK_ID, signo: ::c_int) -> ::c_int;
+
+    // signal.h
+    pub fn raise(__signo: ::c_int) -> ::c_int;
+
+    // taskLibCommon.h
+    pub fn taskIdSelf() -> ::TASK_ID;
+    pub fn taskDelay(ticks: ::_Vx_ticks_t) -> ::c_int;
+
+    // rtpLibCommon.h
+    pub fn rtpInfoGet(rtpId: ::RTP_ID, rtpStruct: *mut ::RTP_DESC) -> ::c_int;
+    pub fn rtpSpawn(
+        pubrtpFileName: *const ::c_char,
+        argv: *mut *const ::c_char,
+        envp: *mut *const ::c_char,
+        priority: ::c_int,
+        uStackSize: ::size_t,
+        options: ::c_int,
+        taskOptions: ::c_int,
+    ) -> RTP_ID;
+
+    // ioLib.h
+    pub fn _realpath(fileName: *const ::c_char, resolvedName: *mut ::c_char) -> *mut ::c_char;
+
+    // pathLib.h
+    pub fn _pathIsAbsolute(filepath: *const ::c_char, pNameTail: *mut *const ::c_char) -> BOOL;
+
+    pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+
+    // randomNumGen.h
+    pub fn randBytes(buf: *mut c_uchar, length: c_int) -> c_int;
+    pub fn randABytes(buf: *mut c_uchar, length: c_int) -> c_int;
+    pub fn randUBytes(buf: *mut c_uchar, length: c_int) -> c_int;
+    pub fn randSecure() -> c_int;
+
+    // mqueue.h
+    pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
+    pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
+    pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
+    pub fn mq_receive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+    ) -> ::ssize_t;
+    pub fn mq_timedreceive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::ssize_t;
+    pub fn mq_send(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+    ) -> ::c_int;
+    pub fn mq_timedsend(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
+    pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
+}
+
+//Dummy functions, these don't really exist in VxWorks.
+
+// wait.h macros
+safe_f! {
+    pub {const} fn WIFEXITED(status: ::c_int) -> bool {
+        (status & 0xFF00) == 0
+    }
+    pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
+        (status & 0xFF00) != 0
+    }
+    pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
+        (status & 0xFF0000) != 0
+    }
+    pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int {
+        status & 0xFF
+    }
+    pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int {
+        (status >> 8) & 0xFF
+    }
+    pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
+        (status >> 16) & 0xFF
+    }
+}
+
+pub fn pread(_fd: ::c_int, _buf: *mut ::c_void, _count: ::size_t, _offset: off64_t) -> ::ssize_t {
+    -1
+}
+
+pub fn pwrite(
+    _fd: ::c_int,
+    _buf: *const ::c_void,
+    _count: ::size_t,
+    _offset: off64_t,
+) -> ::ssize_t {
+    -1
+}
+pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int {
+    // check to see if align is a power of 2 and if align is a multiple
+    //  of sizeof(void *)
+    if (align & align - 1 != 0) || (align as usize % size_of::<::size_t>() != 0) {
+        return ::EINVAL;
+    }
+
+    unsafe {
+        // posix_memalign should not set errno
+        let e = ::errnoGet();
+
+        let temp = memalign(align, size);
+        ::errnoSet(e as ::c_int);
+
+        if temp.is_null() {
+            ::ENOMEM
+        } else {
+            *memptr = temp;
+            0
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_core_cvoid)] {
+        pub use ::ffi::c_void;
+    } else {
+        // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
+        // enable more optimization opportunities around it recognizing things
+        // like malloc/free.
+        #[repr(u8)]
+        #[allow(missing_copy_implementations)]
+        #[allow(missing_debug_implementations)]
+        pub enum c_void {
+            // Two dummy variants so the #[repr] attribute can be used.
+            #[doc(hidden)]
+            __variant1,
+            #[doc(hidden)]
+            __variant2,
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "aarch64")] {
+        mod aarch64;
+        pub use self::aarch64::*;
+    } else if #[cfg(target_arch = "arm")] {
+        mod arm;
+        pub use self::arm::*;
+    }  else if #[cfg(target_arch = "x86")] {
+        mod x86;
+        pub use self::x86::*;
+    } else if #[cfg(target_arch = "x86_64")] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    } else if #[cfg(target_arch = "powerpc")] {
+        mod powerpc;
+        pub use self::powerpc::*;
+    } else if #[cfg(target_arch = "powerpc64")] {
+        mod powerpc64;
+        pub use self::powerpc64::*;
+    } else {
+        // Unknown target_arch
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/vxworks/powerpc.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/vxworks/powerpc.rs
--- 43.0.0-1/rust-vendor/libc/src/vxworks/powerpc.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/vxworks/powerpc.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
+pub type c_long = i32;
+pub type c_ulong = u32;
diff -pruN 43.0.0-1/rust-vendor/libc/src/vxworks/powerpc64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/vxworks/powerpc64.rs
--- 43.0.0-1/rust-vendor/libc/src/vxworks/powerpc64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/vxworks/powerpc64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
+pub type c_long = i64;
+pub type c_ulong = u64;
diff -pruN 43.0.0-1/rust-vendor/libc/src/vxworks/x86.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/vxworks/x86.rs
--- 43.0.0-1/rust-vendor/libc/src/vxworks/x86.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/vxworks/x86.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
+pub type c_long = i32;
+pub type c_ulong = u32;
diff -pruN 43.0.0-1/rust-vendor/libc/src/vxworks/x86_64.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/vxworks/x86_64.rs
--- 43.0.0-1/rust-vendor/libc/src/vxworks/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/vxworks/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
+pub type c_long = i64;
+pub type c_ulong = u64;
diff -pruN 43.0.0-1/rust-vendor/libc/src/wasi.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/wasi.rs
--- 43.0.0-1/rust-vendor/libc/src/wasi.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/wasi.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,831 @@
+use super::{Send, Sync};
+
+pub use ffi::c_void;
+
+pub type c_char = i8;
+pub type c_uchar = u8;
+pub type c_schar = i8;
+pub type c_int = i32;
+pub type c_uint = u32;
+pub type c_short = i16;
+pub type c_ushort = u16;
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type c_longlong = i64;
+pub type c_ulonglong = u64;
+pub type intmax_t = i64;
+pub type uintmax_t = u64;
+pub type size_t = usize;
+pub type ssize_t = isize;
+pub type ptrdiff_t = isize;
+pub type intptr_t = isize;
+pub type uintptr_t = usize;
+pub type off_t = i64;
+pub type pid_t = i32;
+pub type clock_t = c_longlong;
+pub type time_t = c_longlong;
+pub type c_double = f64;
+pub type c_float = f32;
+pub type ino_t = u64;
+pub type sigset_t = c_uchar;
+pub type suseconds_t = c_longlong;
+pub type mode_t = u32;
+pub type dev_t = u64;
+pub type uid_t = u32;
+pub type gid_t = u32;
+pub type nlink_t = u64;
+pub type blksize_t = c_long;
+pub type blkcnt_t = i64;
+pub type nfds_t = c_ulong;
+pub type wchar_t = i32;
+pub type nl_item = c_int;
+pub type __wasi_rights_t = u64;
+
+s_no_extra_traits! {
+    #[repr(align(16))]
+    #[allow(missing_debug_implementations)]
+    pub struct max_align_t {
+        priv_: [f64; 4]
+    }
+}
+
+#[allow(missing_copy_implementations)]
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum FILE {}
+#[allow(missing_copy_implementations)]
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum DIR {}
+#[allow(missing_copy_implementations)]
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum __locale_struct {}
+
+pub type locale_t = *mut __locale_struct;
+
+s_paren! {
+    // in wasi-libc clockid_t is const struct __clockid* (where __clockid is an opaque struct),
+    // but that's an implementation detail that we don't want to have to deal with
+    #[repr(transparent)]
+    #[allow(dead_code)]
+    pub struct clockid_t(*const u8);
+}
+
+unsafe impl Send for clockid_t {}
+unsafe impl Sync for clockid_t {}
+
+s! {
+    #[repr(align(8))]
+    pub struct fpos_t {
+        data: [u8; 16],
+    }
+
+    pub struct tm {
+        pub tm_sec: c_int,
+        pub tm_min: c_int,
+        pub tm_hour: c_int,
+        pub tm_mday: c_int,
+        pub tm_mon: c_int,
+        pub tm_year: c_int,
+        pub tm_wday: c_int,
+        pub tm_yday: c_int,
+        pub tm_isdst: c_int,
+        pub __tm_gmtoff: c_int,
+        pub __tm_zone: *const c_char,
+        pub __tm_nsec: c_int,
+    }
+
+    pub struct timeval {
+        pub tv_sec: time_t,
+        pub tv_usec: suseconds_t,
+    }
+
+    pub struct timespec {
+        pub tv_sec: time_t,
+        pub tv_nsec: c_long,
+    }
+
+    pub struct tms {
+        pub tms_utime: clock_t,
+        pub tms_stime: clock_t,
+        pub tms_cutime: clock_t,
+        pub tms_cstime: clock_t,
+    }
+
+    pub struct itimerspec {
+        pub it_interval: timespec,
+        pub it_value: timespec,
+    }
+
+    pub struct iovec {
+        pub iov_base: *mut c_void,
+        pub iov_len: size_t,
+    }
+
+    pub struct lconv {
+        pub decimal_point: *mut c_char,
+        pub thousands_sep: *mut c_char,
+        pub grouping: *mut c_char,
+        pub int_curr_symbol: *mut c_char,
+        pub currency_symbol: *mut c_char,
+        pub mon_decimal_point: *mut c_char,
+        pub mon_thousands_sep: *mut c_char,
+        pub mon_grouping: *mut c_char,
+        pub positive_sign: *mut c_char,
+        pub negative_sign: *mut c_char,
+        pub int_frac_digits: c_char,
+        pub frac_digits: c_char,
+        pub p_cs_precedes: c_char,
+        pub p_sep_by_space: c_char,
+        pub n_cs_precedes: c_char,
+        pub n_sep_by_space: c_char,
+        pub p_sign_posn: c_char,
+        pub n_sign_posn: c_char,
+        pub int_p_cs_precedes: c_char,
+        pub int_p_sep_by_space: c_char,
+        pub int_n_cs_precedes: c_char,
+        pub int_n_sep_by_space: c_char,
+        pub int_p_sign_posn: c_char,
+        pub int_n_sign_posn: c_char,
+    }
+
+    pub struct pollfd {
+        pub fd: c_int,
+        pub events: c_short,
+        pub revents: c_short,
+    }
+
+    pub struct rusage {
+        pub ru_utime: timeval,
+        pub ru_stime: timeval,
+    }
+
+    pub struct stat {
+        pub st_dev: dev_t,
+        pub st_ino: ino_t,
+        pub st_nlink: nlink_t,
+        pub st_mode: mode_t,
+        pub st_uid: uid_t,
+        pub st_gid: gid_t,
+        __pad0: c_uint,
+        pub st_rdev: dev_t,
+        pub st_size: off_t,
+        pub st_blksize: blksize_t,
+        pub st_blocks: blkcnt_t,
+        pub st_atim: timespec,
+        pub st_mtim: timespec,
+        pub st_ctim: timespec,
+        __reserved: [c_longlong; 3],
+    }
+}
+
+// Declare dirent outside of s! so that it doesn't implement Copy, Eq, Hash,
+// etc., since it contains a flexible array member with a dynamic size.
+#[repr(C)]
+#[allow(missing_copy_implementations)]
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub struct dirent {
+    pub d_ino: ino_t,
+    pub d_type: c_uchar,
+    /// d_name is declared in WASI libc as a flexible array member, which
+    /// can't be directly expressed in Rust. As an imperfect workaround,
+    /// declare it as a zero-length array instead.
+    pub d_name: [c_char; 0],
+}
+
+pub const EXIT_SUCCESS: c_int = 0;
+pub const EXIT_FAILURE: c_int = 1;
+pub const STDIN_FILENO: c_int = 0;
+pub const STDOUT_FILENO: c_int = 1;
+pub const STDERR_FILENO: c_int = 2;
+pub const SEEK_SET: c_int = 0;
+pub const SEEK_CUR: c_int = 1;
+pub const SEEK_END: c_int = 2;
+pub const _IOFBF: c_int = 0;
+pub const _IONBF: c_int = 2;
+pub const _IOLBF: c_int = 1;
+pub const F_GETFD: c_int = 1;
+pub const F_SETFD: c_int = 2;
+pub const F_GETFL: c_int = 3;
+pub const F_SETFL: c_int = 4;
+pub const FD_CLOEXEC: c_int = 1;
+pub const FD_SETSIZE: size_t = 1024;
+pub const O_APPEND: c_int = 0x0001;
+pub const O_DSYNC: c_int = 0x0002;
+pub const O_NONBLOCK: c_int = 0x0004;
+pub const O_RSYNC: c_int = 0x0008;
+pub const O_SYNC: c_int = 0x0010;
+pub const O_CREAT: c_int = 0x0001 << 12;
+pub const O_DIRECTORY: c_int = 0x0002 << 12;
+pub const O_EXCL: c_int = 0x0004 << 12;
+pub const O_TRUNC: c_int = 0x0008 << 12;
+pub const O_NOFOLLOW: c_int = 0x01000000;
+pub const O_EXEC: c_int = 0x02000000;
+pub const O_RDONLY: c_int = 0x04000000;
+pub const O_SEARCH: c_int = 0x08000000;
+pub const O_WRONLY: c_int = 0x10000000;
+pub const O_CLOEXEC: c_int = 0x0;
+pub const O_RDWR: c_int = O_WRONLY | O_RDONLY;
+pub const O_ACCMODE: c_int = O_EXEC | O_RDWR | O_SEARCH;
+pub const O_NOCTTY: c_int = 0x0;
+pub const POSIX_FADV_DONTNEED: c_int = 4;
+pub const POSIX_FADV_NOREUSE: c_int = 5;
+pub const POSIX_FADV_NORMAL: c_int = 0;
+pub const POSIX_FADV_RANDOM: c_int = 2;
+pub const POSIX_FADV_SEQUENTIAL: c_int = 1;
+pub const POSIX_FADV_WILLNEED: c_int = 3;
+pub const AT_FDCWD: ::c_int = -2;
+pub const AT_EACCESS: c_int = 0x0;
+pub const AT_SYMLINK_NOFOLLOW: c_int = 0x1;
+pub const AT_SYMLINK_FOLLOW: c_int = 0x2;
+pub const AT_REMOVEDIR: c_int = 0x4;
+pub const UTIME_OMIT: c_long = 0xfffffffe;
+pub const UTIME_NOW: c_long = 0xffffffff;
+pub const S_IFIFO: mode_t = 49152;
+pub const S_IFCHR: mode_t = 8192;
+pub const S_IFBLK: mode_t = 24576;
+pub const S_IFDIR: mode_t = 16384;
+pub const S_IFREG: mode_t = 32768;
+pub const S_IFLNK: mode_t = 40960;
+pub const S_IFSOCK: mode_t = 49152;
+pub const S_IFMT: mode_t = 57344;
+pub const S_IRWXO: mode_t = 0x7;
+pub const S_IXOTH: mode_t = 0x1;
+pub const S_IWOTH: mode_t = 0x2;
+pub const S_IROTH: mode_t = 0x4;
+pub const S_IRWXG: mode_t = 0x38;
+pub const S_IXGRP: mode_t = 0x8;
+pub const S_IWGRP: mode_t = 0x10;
+pub const S_IRGRP: mode_t = 0x20;
+pub const S_IRWXU: mode_t = 0x1c0;
+pub const S_IXUSR: mode_t = 0x40;
+pub const S_IWUSR: mode_t = 0x80;
+pub const S_IRUSR: mode_t = 0x100;
+pub const S_ISVTX: mode_t = 0x200;
+pub const S_ISGID: mode_t = 0x400;
+pub const S_ISUID: mode_t = 0x800;
+pub const DT_UNKNOWN: u8 = 0;
+pub const DT_BLK: u8 = 1;
+pub const DT_CHR: u8 = 2;
+pub const DT_DIR: u8 = 3;
+pub const DT_REG: u8 = 4;
+pub const DT_LNK: u8 = 7;
+pub const FIONREAD: c_int = 1;
+pub const FIONBIO: c_int = 2;
+pub const F_OK: ::c_int = 0;
+pub const R_OK: ::c_int = 4;
+pub const W_OK: ::c_int = 2;
+pub const X_OK: ::c_int = 1;
+pub const POLLIN: ::c_short = 0x1;
+pub const POLLOUT: ::c_short = 0x2;
+pub const POLLERR: ::c_short = 0x1000;
+pub const POLLHUP: ::c_short = 0x2000;
+pub const POLLNVAL: ::c_short = 0x4000;
+pub const POLLRDNORM: ::c_short = 0x1;
+pub const POLLWRNORM: ::c_short = 0x2;
+
+pub const E2BIG: c_int = 1;
+pub const EACCES: c_int = 2;
+pub const EADDRINUSE: c_int = 3;
+pub const EADDRNOTAVAIL: c_int = 4;
+pub const EAFNOSUPPORT: c_int = 5;
+pub const EAGAIN: c_int = 6;
+pub const EALREADY: c_int = 7;
+pub const EBADF: c_int = 8;
+pub const EBADMSG: c_int = 9;
+pub const EBUSY: c_int = 10;
+pub const ECANCELED: c_int = 11;
+pub const ECHILD: c_int = 12;
+pub const ECONNABORTED: c_int = 13;
+pub const ECONNREFUSED: c_int = 14;
+pub const ECONNRESET: c_int = 15;
+pub const EDEADLK: c_int = 16;
+pub const EDESTADDRREQ: c_int = 17;
+pub const EDOM: c_int = 18;
+pub const EDQUOT: c_int = 19;
+pub const EEXIST: c_int = 20;
+pub const EFAULT: c_int = 21;
+pub const EFBIG: c_int = 22;
+pub const EHOSTUNREACH: c_int = 23;
+pub const EIDRM: c_int = 24;
+pub const EILSEQ: c_int = 25;
+pub const EINPROGRESS: c_int = 26;
+pub const EINTR: c_int = 27;
+pub const EINVAL: c_int = 28;
+pub const EIO: c_int = 29;
+pub const EISCONN: c_int = 30;
+pub const EISDIR: c_int = 31;
+pub const ELOOP: c_int = 32;
+pub const EMFILE: c_int = 33;
+pub const EMLINK: c_int = 34;
+pub const EMSGSIZE: c_int = 35;
+pub const EMULTIHOP: c_int = 36;
+pub const ENAMETOOLONG: c_int = 37;
+pub const ENETDOWN: c_int = 38;
+pub const ENETRESET: c_int = 39;
+pub const ENETUNREACH: c_int = 40;
+pub const ENFILE: c_int = 41;
+pub const ENOBUFS: c_int = 42;
+pub const ENODEV: c_int = 43;
+pub const ENOENT: c_int = 44;
+pub const ENOEXEC: c_int = 45;
+pub const ENOLCK: c_int = 46;
+pub const ENOLINK: c_int = 47;
+pub const ENOMEM: c_int = 48;
+pub const ENOMSG: c_int = 49;
+pub const ENOPROTOOPT: c_int = 50;
+pub const ENOSPC: c_int = 51;
+pub const ENOSYS: c_int = 52;
+pub const ENOTCONN: c_int = 53;
+pub const ENOTDIR: c_int = 54;
+pub const ENOTEMPTY: c_int = 55;
+pub const ENOTRECOVERABLE: c_int = 56;
+pub const ENOTSOCK: c_int = 57;
+pub const ENOTSUP: c_int = 58;
+pub const ENOTTY: c_int = 59;
+pub const ENXIO: c_int = 60;
+pub const EOVERFLOW: c_int = 61;
+pub const EOWNERDEAD: c_int = 62;
+pub const EPERM: c_int = 63;
+pub const EPIPE: c_int = 64;
+pub const EPROTO: c_int = 65;
+pub const EPROTONOSUPPORT: c_int = 66;
+pub const EPROTOTYPE: c_int = 67;
+pub const ERANGE: c_int = 68;
+pub const EROFS: c_int = 69;
+pub const ESPIPE: c_int = 70;
+pub const ESRCH: c_int = 71;
+pub const ESTALE: c_int = 72;
+pub const ETIMEDOUT: c_int = 73;
+pub const ETXTBSY: c_int = 74;
+pub const EXDEV: c_int = 75;
+pub const ENOTCAPABLE: c_int = 76;
+pub const EOPNOTSUPP: c_int = ENOTSUP;
+pub const EWOULDBLOCK: c_int = EAGAIN;
+
+pub const _SC_PAGESIZE: c_int = 30;
+pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
+pub const _SC_IOV_MAX: c_int = 60;
+pub const _SC_SYMLOOP_MAX: c_int = 173;
+
+pub static CLOCK_MONOTONIC: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_MONOTONIC)) };
+pub static CLOCK_PROCESS_CPUTIME_ID: clockid_t =
+    unsafe { clockid_t(ptr_addr_of!(_CLOCK_PROCESS_CPUTIME_ID)) };
+pub static CLOCK_REALTIME: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_REALTIME)) };
+pub static CLOCK_THREAD_CPUTIME_ID: clockid_t =
+    unsafe { clockid_t(ptr_addr_of!(_CLOCK_THREAD_CPUTIME_ID)) };
+
+pub const ABDAY_1: ::nl_item = 0x20000;
+pub const ABDAY_2: ::nl_item = 0x20001;
+pub const ABDAY_3: ::nl_item = 0x20002;
+pub const ABDAY_4: ::nl_item = 0x20003;
+pub const ABDAY_5: ::nl_item = 0x20004;
+pub const ABDAY_6: ::nl_item = 0x20005;
+pub const ABDAY_7: ::nl_item = 0x20006;
+
+pub const DAY_1: ::nl_item = 0x20007;
+pub const DAY_2: ::nl_item = 0x20008;
+pub const DAY_3: ::nl_item = 0x20009;
+pub const DAY_4: ::nl_item = 0x2000A;
+pub const DAY_5: ::nl_item = 0x2000B;
+pub const DAY_6: ::nl_item = 0x2000C;
+pub const DAY_7: ::nl_item = 0x2000D;
+
+pub const ABMON_1: ::nl_item = 0x2000E;
+pub const ABMON_2: ::nl_item = 0x2000F;
+pub const ABMON_3: ::nl_item = 0x20010;
+pub const ABMON_4: ::nl_item = 0x20011;
+pub const ABMON_5: ::nl_item = 0x20012;
+pub const ABMON_6: ::nl_item = 0x20013;
+pub const ABMON_7: ::nl_item = 0x20014;
+pub const ABMON_8: ::nl_item = 0x20015;
+pub const ABMON_9: ::nl_item = 0x20016;
+pub const ABMON_10: ::nl_item = 0x20017;
+pub const ABMON_11: ::nl_item = 0x20018;
+pub const ABMON_12: ::nl_item = 0x20019;
+
+pub const MON_1: ::nl_item = 0x2001A;
+pub const MON_2: ::nl_item = 0x2001B;
+pub const MON_3: ::nl_item = 0x2001C;
+pub const MON_4: ::nl_item = 0x2001D;
+pub const MON_5: ::nl_item = 0x2001E;
+pub const MON_6: ::nl_item = 0x2001F;
+pub const MON_7: ::nl_item = 0x20020;
+pub const MON_8: ::nl_item = 0x20021;
+pub const MON_9: ::nl_item = 0x20022;
+pub const MON_10: ::nl_item = 0x20023;
+pub const MON_11: ::nl_item = 0x20024;
+pub const MON_12: ::nl_item = 0x20025;
+
+pub const AM_STR: ::nl_item = 0x20026;
+pub const PM_STR: ::nl_item = 0x20027;
+
+pub const D_T_FMT: ::nl_item = 0x20028;
+pub const D_FMT: ::nl_item = 0x20029;
+pub const T_FMT: ::nl_item = 0x2002A;
+pub const T_FMT_AMPM: ::nl_item = 0x2002B;
+
+pub const ERA: ::nl_item = 0x2002C;
+pub const ERA_D_FMT: ::nl_item = 0x2002E;
+pub const ALT_DIGITS: ::nl_item = 0x2002F;
+pub const ERA_D_T_FMT: ::nl_item = 0x20030;
+pub const ERA_T_FMT: ::nl_item = 0x20031;
+
+pub const CODESET: ::nl_item = 14;
+pub const CRNCYSTR: ::nl_item = 0x4000F;
+pub const RADIXCHAR: ::nl_item = 0x10000;
+pub const THOUSEP: ::nl_item = 0x10001;
+pub const YESEXPR: ::nl_item = 0x50000;
+pub const NOEXPR: ::nl_item = 0x50001;
+pub const YESSTR: ::nl_item = 0x50002;
+pub const NOSTR: ::nl_item = 0x50003;
+
+#[cfg_attr(
+    feature = "rustc-dep-of-std",
+    link(
+        name = "c",
+        kind = "static",
+        modifiers = "-bundle",
+        cfg(target_feature = "crt-static")
+    )
+)]
+#[cfg_attr(
+    feature = "rustc-dep-of-std",
+    link(name = "c", cfg(not(target_feature = "crt-static")))
+)]
+extern "C" {
+    pub fn _Exit(code: c_int) -> !;
+    pub fn _exit(code: c_int) -> !;
+    pub fn abort() -> !;
+    pub fn aligned_alloc(a: size_t, b: size_t) -> *mut c_void;
+    pub fn calloc(amt: size_t, amt2: size_t) -> *mut c_void;
+    pub fn exit(code: c_int) -> !;
+    pub fn free(ptr: *mut c_void);
+    pub fn getenv(s: *const c_char) -> *mut c_char;
+    pub fn malloc(amt: size_t) -> *mut c_void;
+    pub fn malloc_usable_size(ptr: *mut c_void) -> size_t;
+    pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
+    pub fn rand() -> c_int;
+    pub fn read(fd: c_int, ptr: *mut c_void, size: size_t) -> ssize_t;
+    pub fn realloc(ptr: *mut c_void, amt: size_t) -> *mut c_void;
+    pub fn setenv(k: *const c_char, v: *const c_char, a: c_int) -> c_int;
+    pub fn unsetenv(k: *const c_char) -> c_int;
+    pub fn clearenv() -> ::c_int;
+    pub fn write(fd: c_int, ptr: *const c_void, size: size_t) -> ssize_t;
+    pub static mut environ: *mut *mut c_char;
+    pub fn fopen(a: *const c_char, b: *const c_char) -> *mut FILE;
+    pub fn freopen(a: *const c_char, b: *const c_char, f: *mut FILE) -> *mut FILE;
+    pub fn fclose(f: *mut FILE) -> c_int;
+    pub fn remove(a: *const c_char) -> c_int;
+    pub fn rename(a: *const c_char, b: *const c_char) -> c_int;
+    pub fn feof(f: *mut FILE) -> c_int;
+    pub fn ferror(f: *mut FILE) -> c_int;
+    pub fn fflush(f: *mut FILE) -> c_int;
+    pub fn clearerr(f: *mut FILE);
+    pub fn fseek(f: *mut FILE, b: c_long, c: c_int) -> c_int;
+    pub fn ftell(f: *mut FILE) -> c_long;
+    pub fn rewind(f: *mut FILE);
+    pub fn fgetpos(f: *mut FILE, pos: *mut fpos_t) -> c_int;
+    pub fn fsetpos(f: *mut FILE, pos: *const fpos_t) -> c_int;
+    pub fn fread(buf: *mut c_void, a: size_t, b: size_t, f: *mut FILE) -> size_t;
+    pub fn fwrite(buf: *const c_void, a: size_t, b: size_t, f: *mut FILE) -> size_t;
+    pub fn fgetc(f: *mut FILE) -> c_int;
+    pub fn getc(f: *mut FILE) -> c_int;
+    pub fn getchar() -> c_int;
+    pub fn ungetc(a: c_int, f: *mut FILE) -> c_int;
+    pub fn fputc(a: c_int, f: *mut FILE) -> c_int;
+    pub fn putc(a: c_int, f: *mut FILE) -> c_int;
+    pub fn putchar(a: c_int) -> c_int;
+    pub fn fputs(a: *const c_char, f: *mut FILE) -> c_int;
+    pub fn puts(a: *const c_char) -> c_int;
+    pub fn perror(a: *const c_char);
+    pub fn srand(a: c_uint);
+    pub fn atexit(a: extern "C" fn()) -> c_int;
+    pub fn at_quick_exit(a: extern "C" fn()) -> c_int;
+    pub fn quick_exit(a: c_int) -> !;
+    pub fn posix_memalign(a: *mut *mut c_void, b: size_t, c: size_t) -> c_int;
+    pub fn rand_r(a: *mut c_uint) -> c_int;
+    pub fn random() -> c_long;
+    pub fn srandom(a: c_uint);
+    pub fn putenv(a: *mut c_char) -> c_int;
+    pub fn clock() -> clock_t;
+    pub fn time(a: *mut time_t) -> time_t;
+    pub fn difftime(a: time_t, b: time_t) -> c_double;
+    pub fn mktime(a: *mut tm) -> time_t;
+    pub fn strftime(a: *mut c_char, b: size_t, c: *const c_char, d: *const tm) -> size_t;
+    pub fn gmtime(a: *const time_t) -> *mut tm;
+    pub fn gmtime_r(a: *const time_t, b: *mut tm) -> *mut tm;
+    pub fn localtime(a: *const time_t) -> *mut tm;
+    pub fn localtime_r(a: *const time_t, b: *mut tm) -> *mut tm;
+    pub fn asctime_r(a: *const tm, b: *mut c_char) -> *mut c_char;
+    pub fn ctime_r(a: *const time_t, b: *mut c_char) -> *mut c_char;
+
+    static _CLOCK_MONOTONIC: u8;
+    static _CLOCK_PROCESS_CPUTIME_ID: u8;
+    static _CLOCK_REALTIME: u8;
+    static _CLOCK_THREAD_CPUTIME_ID: u8;
+    pub fn nanosleep(a: *const timespec, b: *mut timespec) -> c_int;
+    pub fn clock_getres(a: clockid_t, b: *mut timespec) -> c_int;
+    pub fn clock_gettime(a: clockid_t, b: *mut timespec) -> c_int;
+    pub fn clock_nanosleep(a: clockid_t, a2: c_int, b: *const timespec, c: *mut timespec) -> c_int;
+
+    pub fn isalnum(c: c_int) -> c_int;
+    pub fn isalpha(c: c_int) -> c_int;
+    pub fn iscntrl(c: c_int) -> c_int;
+    pub fn isdigit(c: c_int) -> c_int;
+    pub fn isgraph(c: c_int) -> c_int;
+    pub fn islower(c: c_int) -> c_int;
+    pub fn isprint(c: c_int) -> c_int;
+    pub fn ispunct(c: c_int) -> c_int;
+    pub fn isspace(c: c_int) -> c_int;
+    pub fn isupper(c: c_int) -> c_int;
+    pub fn isxdigit(c: c_int) -> c_int;
+    pub fn isblank(c: c_int) -> c_int;
+    pub fn tolower(c: c_int) -> c_int;
+    pub fn toupper(c: c_int) -> c_int;
+    pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int;
+    pub fn setbuf(stream: *mut FILE, buf: *mut c_char);
+    pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char;
+    pub fn atof(s: *const c_char) -> c_double;
+    pub fn atoi(s: *const c_char) -> c_int;
+    pub fn atol(s: *const c_char) -> c_long;
+    pub fn atoll(s: *const c_char) -> c_longlong;
+    pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
+    pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
+    pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
+    pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
+    pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
+    pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
+
+    pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char;
+    pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
+    pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char;
+    pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char;
+    pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int;
+    pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int;
+    pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int;
+    pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char;
+    pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char;
+    pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t;
+    pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t;
+    pub fn strdup(cs: *const c_char) -> *mut c_char;
+    pub fn strndup(cs: *const c_char, n: size_t) -> *mut c_char;
+    pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char;
+    pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
+    pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int;
+    pub fn strncasecmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int;
+    pub fn strlen(cs: *const c_char) -> size_t;
+    pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t;
+    pub fn strerror(n: c_int) -> *mut c_char;
+    pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char;
+    pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t;
+
+    pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
+    pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
+    pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
+    pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
+    pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
+
+    pub fn fprintf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
+    pub fn printf(format: *const ::c_char, ...) -> ::c_int;
+    pub fn snprintf(s: *mut ::c_char, n: ::size_t, format: *const ::c_char, ...) -> ::c_int;
+    pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int;
+    pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
+    pub fn scanf(format: *const ::c_char, ...) -> ::c_int;
+    pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int;
+    pub fn getchar_unlocked() -> ::c_int;
+    pub fn putchar_unlocked(c: ::c_int) -> ::c_int;
+
+    pub fn shutdown(socket: ::c_int, how: ::c_int) -> ::c_int;
+    pub fn fstat(fildes: ::c_int, buf: *mut stat) -> ::c_int;
+    pub fn mkdir(path: *const c_char, mode: mode_t) -> ::c_int;
+    pub fn stat(path: *const c_char, buf: *mut stat) -> ::c_int;
+    pub fn fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE;
+    pub fn fileno(stream: *mut ::FILE) -> ::c_int;
+    pub fn open(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
+    pub fn creat(path: *const c_char, mode: mode_t) -> ::c_int;
+    pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int;
+    pub fn opendir(dirname: *const c_char) -> *mut ::DIR;
+    pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
+    pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent;
+    pub fn closedir(dirp: *mut ::DIR) -> ::c_int;
+    pub fn rewinddir(dirp: *mut ::DIR);
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+    pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
+
+    pub fn openat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int, ...) -> ::c_int;
+    pub fn fstatat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        buf: *mut stat,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn linkat(
+        olddirfd: ::c_int,
+        oldpath: *const ::c_char,
+        newdirfd: ::c_int,
+        newpath: *const ::c_char,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
+    pub fn readlinkat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        buf: *mut ::c_char,
+        bufsiz: ::size_t,
+    ) -> ::ssize_t;
+    pub fn renameat(
+        olddirfd: ::c_int,
+        oldpath: *const ::c_char,
+        newdirfd: ::c_int,
+        newpath: *const ::c_char,
+    ) -> ::c_int;
+    pub fn symlinkat(
+        target: *const ::c_char,
+        newdirfd: ::c_int,
+        linkpath: *const ::c_char,
+    ) -> ::c_int;
+    pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int) -> ::c_int;
+
+    pub fn access(path: *const c_char, amode: ::c_int) -> ::c_int;
+    pub fn close(fd: ::c_int) -> ::c_int;
+    pub fn fpathconf(filedes: ::c_int, name: ::c_int) -> c_long;
+    pub fn getopt(argc: ::c_int, argv: *const *mut c_char, optstr: *const c_char) -> ::c_int;
+    pub fn isatty(fd: ::c_int) -> ::c_int;
+    pub fn link(src: *const c_char, dst: *const c_char) -> ::c_int;
+    pub fn lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t;
+    pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long;
+    pub fn rmdir(path: *const c_char) -> ::c_int;
+    pub fn sleep(secs: ::c_uint) -> ::c_uint;
+    pub fn unlink(c: *const c_char) -> ::c_int;
+    pub fn pread(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
+    pub fn pwrite(fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
+
+    pub fn lstat(path: *const c_char, buf: *mut stat) -> ::c_int;
+
+    pub fn fsync(fd: ::c_int) -> ::c_int;
+    pub fn fdatasync(fd: ::c_int) -> ::c_int;
+
+    pub fn symlink(path1: *const c_char, path2: *const c_char) -> ::c_int;
+
+    pub fn truncate(path: *const c_char, length: off_t) -> ::c_int;
+    pub fn ftruncate(fd: ::c_int, length: off_t) -> ::c_int;
+
+    pub fn getrusage(resource: ::c_int, usage: *mut rusage) -> ::c_int;
+
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
+    pub fn times(buf: *mut ::tms) -> ::clock_t;
+
+    pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
+
+    pub fn usleep(secs: ::c_uint) -> ::c_int;
+    pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
+    pub fn recv(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
+    pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int;
+    pub fn setlocale(category: ::c_int, locale: *const ::c_char) -> *mut ::c_char;
+    pub fn localeconv() -> *mut lconv;
+
+    pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::ssize_t;
+
+    pub fn timegm(tm: *mut ::tm) -> time_t;
+
+    pub fn sysconf(name: ::c_int) -> ::c_long;
+
+    pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
+
+    pub fn fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int;
+    pub fn ftello(stream: *mut ::FILE) -> ::off_t;
+    pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
+
+    pub fn strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
+    pub fn getline(lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t;
+
+    pub fn faccessat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::c_int,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
+        -> ::ssize_t;
+    pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
+    pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
+    pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
+    pub fn utimensat(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::timespec,
+        flag: ::c_int,
+    ) -> ::c_int;
+    pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
+    pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
+    pub fn abs(i: c_int) -> c_int;
+    pub fn labs(i: c_long) -> c_long;
+    pub fn duplocale(base: ::locale_t) -> ::locale_t;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+    pub fn uselocale(loc: ::locale_t) -> ::locale_t;
+    pub fn sched_yield() -> ::c_int;
+    pub fn getcwd(buf: *mut c_char, size: ::size_t) -> *mut c_char;
+    pub fn chdir(dir: *const c_char) -> ::c_int;
+
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+    pub fn nl_langinfo_l(item: ::nl_item, loc: ::locale_t) -> *mut ::c_char;
+
+    pub fn __wasilibc_register_preopened_fd(fd: c_int, path: *const c_char) -> c_int;
+    pub fn __wasilibc_fd_renumber(fd: c_int, newfd: c_int) -> c_int;
+    pub fn __wasilibc_unlinkat(fd: c_int, path: *const c_char) -> c_int;
+    pub fn __wasilibc_rmdirat(fd: c_int, path: *const c_char) -> c_int;
+    pub fn __wasilibc_find_relpath(
+        path: *const c_char,
+        abs_prefix: *mut *const c_char,
+        relative_path: *mut *mut c_char,
+        relative_path_len: usize,
+    ) -> c_int;
+    pub fn __wasilibc_tell(fd: c_int) -> ::off_t;
+    pub fn __wasilibc_nocwd___wasilibc_unlinkat(dirfd: c_int, path: *const c_char) -> c_int;
+    pub fn __wasilibc_nocwd___wasilibc_rmdirat(dirfd: c_int, path: *const c_char) -> c_int;
+    pub fn __wasilibc_nocwd_linkat(
+        olddirfd: c_int,
+        oldpath: *const c_char,
+        newdirfd: c_int,
+        newpath: *const c_char,
+        flags: c_int,
+    ) -> c_int;
+    pub fn __wasilibc_nocwd_symlinkat(
+        target: *const c_char,
+        dirfd: c_int,
+        path: *const c_char,
+    ) -> c_int;
+    pub fn __wasilibc_nocwd_readlinkat(
+        dirfd: c_int,
+        path: *const c_char,
+        buf: *mut c_char,
+        bufsize: usize,
+    ) -> isize;
+    pub fn __wasilibc_nocwd_faccessat(
+        dirfd: c_int,
+        path: *const c_char,
+        mode: c_int,
+        flags: c_int,
+    ) -> c_int;
+    pub fn __wasilibc_nocwd_renameat(
+        olddirfd: c_int,
+        oldpath: *const c_char,
+        newdirfd: c_int,
+        newpath: *const c_char,
+    ) -> c_int;
+    pub fn __wasilibc_nocwd_openat_nomode(dirfd: c_int, path: *const c_char, flags: c_int)
+        -> c_int;
+    pub fn __wasilibc_nocwd_fstatat(
+        dirfd: c_int,
+        path: *const c_char,
+        buf: *mut stat,
+        flags: c_int,
+    ) -> c_int;
+    pub fn __wasilibc_nocwd_mkdirat_nomode(dirfd: c_int, path: *const c_char) -> c_int;
+    pub fn __wasilibc_nocwd_utimensat(
+        dirfd: c_int,
+        path: *const c_char,
+        times: *const ::timespec,
+        flags: c_int,
+    ) -> c_int;
+    pub fn __wasilibc_nocwd_opendirat(dirfd: c_int, path: *const c_char) -> *mut ::DIR;
+    pub fn __wasilibc_access(pathname: *const c_char, mode: c_int, flags: c_int) -> c_int;
+    pub fn __wasilibc_stat(pathname: *const c_char, buf: *mut stat, flags: c_int) -> c_int;
+    pub fn __wasilibc_utimens(
+        pathname: *const c_char,
+        times: *const ::timespec,
+        flags: c_int,
+    ) -> c_int;
+    pub fn __wasilibc_link(oldpath: *const c_char, newpath: *const c_char, flags: c_int) -> c_int;
+    pub fn __wasilibc_link_oldat(
+        olddirfd: c_int,
+        oldpath: *const c_char,
+        newpath: *const c_char,
+        flags: c_int,
+    ) -> c_int;
+    pub fn __wasilibc_link_newat(
+        oldpath: *const c_char,
+        newdirfd: c_int,
+        newpath: *const c_char,
+        flags: c_int,
+    ) -> c_int;
+    pub fn __wasilibc_rename_oldat(
+        olddirfd: c_int,
+        oldpath: *const c_char,
+        newpath: *const c_char,
+    ) -> c_int;
+    pub fn __wasilibc_rename_newat(
+        oldpath: *const c_char,
+        newdirfd: c_int,
+        newpath: *const c_char,
+    ) -> c_int;
+
+    pub fn arc4random() -> u32;
+    pub fn arc4random_buf(a: *mut c_void, b: size_t);
+    pub fn arc4random_uniform(a: u32) -> u32;
+
+    pub fn __errno_location() -> *mut ::c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/windows/gnu/align.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/windows/gnu/align.rs
--- 43.0.0-1/rust-vendor/libc/src/windows/gnu/align.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/windows/gnu/align.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,19 @@
+cfg_if! {
+    if #[cfg(target_pointer_width = "64")] {
+        s_no_extra_traits! {
+            #[allow(missing_debug_implementations)]
+            #[repr(align(16))]
+            pub struct max_align_t {
+                priv_: [f64; 4]
+            }
+        }
+    } else if #[cfg(target_pointer_width = "32")] {
+        s_no_extra_traits! {
+            #[allow(missing_debug_implementations)]
+            #[repr(align(16))]
+            pub struct max_align_t {
+                priv_: [i64; 6]
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/windows/gnu/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/windows/gnu/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/windows/gnu/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/windows/gnu/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,23 @@
+pub const L_tmpnam: ::c_uint = 14;
+pub const TMP_MAX: ::c_uint = 0x7fff;
+
+// stdio file descriptor numbers
+pub const STDIN_FILENO: ::c_int = 0;
+pub const STDOUT_FILENO: ::c_int = 1;
+pub const STDERR_FILENO: ::c_int = 2;
+
+extern "C" {
+    pub fn strcasecmp(s1: *const ::c_char, s2: *const ::c_char) -> ::c_int;
+    pub fn strncasecmp(s1: *const ::c_char, s2: *const ::c_char, n: ::size_t) -> ::c_int;
+
+    // NOTE: For MSVC target, `wmemchr` is only a inline function in `<wchar.h>`
+    //      header file. We cannot find a way to link to that symbol from Rust.
+    pub fn wmemchr(cx: *const ::wchar_t, c: ::wchar_t, n: ::size_t) -> *mut ::wchar_t;
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/windows/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/windows/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/windows/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/windows/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,601 @@
+//! Windows CRT definitions
+
+pub type c_schar = i8;
+pub type c_uchar = u8;
+pub type c_short = i16;
+pub type c_ushort = u16;
+pub type c_int = i32;
+pub type c_uint = u32;
+pub type c_float = f32;
+pub type c_double = f64;
+pub type c_longlong = i64;
+pub type c_ulonglong = u64;
+pub type intmax_t = i64;
+pub type uintmax_t = u64;
+
+pub type size_t = usize;
+pub type ptrdiff_t = isize;
+pub type intptr_t = isize;
+pub type uintptr_t = usize;
+pub type ssize_t = isize;
+pub type sighandler_t = usize;
+
+pub type c_char = i8;
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type wchar_t = u16;
+
+pub type clock_t = i32;
+
+pub type errno_t = ::c_int;
+
+cfg_if! {
+    if #[cfg(all(target_arch = "x86", target_env = "gnu"))] {
+        pub type time_t = i32;
+    } else {
+        pub type time_t = i64;
+    }
+}
+
+pub type off_t = i32;
+pub type dev_t = u32;
+pub type ino_t = u16;
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum timezone {}
+impl ::Copy for timezone {}
+impl ::Clone for timezone {
+    fn clone(&self) -> timezone {
+        *self
+    }
+}
+pub type time64_t = i64;
+
+pub type SOCKET = ::uintptr_t;
+
+s! {
+    // note this is the struct called stat64 in Windows. Not stat, nor stati64.
+    pub struct stat {
+        pub st_dev: dev_t,
+        pub st_ino: ino_t,
+        pub st_mode: u16,
+        pub st_nlink: ::c_short,
+        pub st_uid: ::c_short,
+        pub st_gid: ::c_short,
+        pub st_rdev: dev_t,
+        pub st_size: i64,
+        pub st_atime: time64_t,
+        pub st_mtime: time64_t,
+        pub st_ctime: time64_t,
+    }
+
+    // note that this is called utimbuf64 in Windows
+    pub struct utimbuf {
+        pub actime: time64_t,
+        pub modtime: time64_t,
+    }
+
+    pub struct tm {
+        pub tm_sec: ::c_int,
+        pub tm_min: ::c_int,
+        pub tm_hour: ::c_int,
+        pub tm_mday: ::c_int,
+        pub tm_mon: ::c_int,
+        pub tm_year: ::c_int,
+        pub tm_wday: ::c_int,
+        pub tm_yday: ::c_int,
+        pub tm_isdst: ::c_int,
+    }
+
+    pub struct timeval {
+        pub tv_sec: c_long,
+        pub tv_usec: c_long,
+    }
+
+    pub struct timespec {
+        pub tv_sec: time_t,
+        pub tv_nsec: c_long,
+    }
+
+    pub struct sockaddr {
+        pub sa_family: c_ushort,
+        pub sa_data: [c_char; 14],
+    }
+}
+
+pub const INT_MIN: c_int = -2147483648;
+pub const INT_MAX: c_int = 2147483647;
+
+pub const EXIT_FAILURE: ::c_int = 1;
+pub const EXIT_SUCCESS: ::c_int = 0;
+pub const RAND_MAX: ::c_int = 32767;
+pub const EOF: ::c_int = -1;
+pub const SEEK_SET: ::c_int = 0;
+pub const SEEK_CUR: ::c_int = 1;
+pub const SEEK_END: ::c_int = 2;
+pub const _IOFBF: ::c_int = 0;
+pub const _IONBF: ::c_int = 4;
+pub const _IOLBF: ::c_int = 64;
+pub const BUFSIZ: ::c_uint = 512;
+pub const FOPEN_MAX: ::c_uint = 20;
+pub const FILENAME_MAX: ::c_uint = 260;
+
+// fcntl.h
+pub const O_RDONLY: ::c_int = 0x0000;
+pub const O_WRONLY: ::c_int = 0x0001;
+pub const O_RDWR: ::c_int = 0x0002;
+pub const O_APPEND: ::c_int = 0x0008;
+pub const O_CREAT: ::c_int = 0x0100;
+pub const O_TRUNC: ::c_int = 0x0200;
+pub const O_EXCL: ::c_int = 0x0400;
+pub const O_TEXT: ::c_int = 0x4000;
+pub const O_BINARY: ::c_int = 0x8000;
+pub const _O_WTEXT: ::c_int = 0x10000;
+pub const _O_U16TEXT: ::c_int = 0x20000;
+pub const _O_U8TEXT: ::c_int = 0x40000;
+pub const O_RAW: ::c_int = O_BINARY;
+pub const O_NOINHERIT: ::c_int = 0x0080;
+pub const O_TEMPORARY: ::c_int = 0x0040;
+pub const _O_SHORT_LIVED: ::c_int = 0x1000;
+pub const _O_OBTAIN_DIR: ::c_int = 0x2000;
+pub const O_SEQUENTIAL: ::c_int = 0x0020;
+pub const O_RANDOM: ::c_int = 0x0010;
+
+pub const S_IFCHR: ::c_int = 8192;
+pub const S_IFDIR: ::c_int = 16384;
+pub const S_IFREG: ::c_int = 32768;
+pub const S_IFMT: ::c_int = 61440;
+pub const S_IEXEC: ::c_int = 64;
+pub const S_IWRITE: ::c_int = 128;
+pub const S_IREAD: ::c_int = 256;
+
+pub const LC_ALL: ::c_int = 0;
+pub const LC_COLLATE: ::c_int = 1;
+pub const LC_CTYPE: ::c_int = 2;
+pub const LC_MONETARY: ::c_int = 3;
+pub const LC_NUMERIC: ::c_int = 4;
+pub const LC_TIME: ::c_int = 5;
+
+pub const EPERM: ::c_int = 1;
+pub const ENOENT: ::c_int = 2;
+pub const ESRCH: ::c_int = 3;
+pub const EINTR: ::c_int = 4;
+pub const EIO: ::c_int = 5;
+pub const ENXIO: ::c_int = 6;
+pub const E2BIG: ::c_int = 7;
+pub const ENOEXEC: ::c_int = 8;
+pub const EBADF: ::c_int = 9;
+pub const ECHILD: ::c_int = 10;
+pub const EAGAIN: ::c_int = 11;
+pub const ENOMEM: ::c_int = 12;
+pub const EACCES: ::c_int = 13;
+pub const EFAULT: ::c_int = 14;
+pub const EBUSY: ::c_int = 16;
+pub const EEXIST: ::c_int = 17;
+pub const EXDEV: ::c_int = 18;
+pub const ENODEV: ::c_int = 19;
+pub const ENOTDIR: ::c_int = 20;
+pub const EISDIR: ::c_int = 21;
+pub const EINVAL: ::c_int = 22;
+pub const ENFILE: ::c_int = 23;
+pub const EMFILE: ::c_int = 24;
+pub const ENOTTY: ::c_int = 25;
+pub const EFBIG: ::c_int = 27;
+pub const ENOSPC: ::c_int = 28;
+pub const ESPIPE: ::c_int = 29;
+pub const EROFS: ::c_int = 30;
+pub const EMLINK: ::c_int = 31;
+pub const EPIPE: ::c_int = 32;
+pub const EDOM: ::c_int = 33;
+pub const ERANGE: ::c_int = 34;
+pub const EDEADLK: ::c_int = 36;
+pub const EDEADLOCK: ::c_int = 36;
+pub const ENAMETOOLONG: ::c_int = 38;
+pub const ENOLCK: ::c_int = 39;
+pub const ENOSYS: ::c_int = 40;
+pub const ENOTEMPTY: ::c_int = 41;
+pub const EILSEQ: ::c_int = 42;
+pub const STRUNCATE: ::c_int = 80;
+
+// POSIX Supplement (from errno.h)
+pub const EADDRINUSE: ::c_int = 100;
+pub const EADDRNOTAVAIL: ::c_int = 101;
+pub const EAFNOSUPPORT: ::c_int = 102;
+pub const EALREADY: ::c_int = 103;
+pub const EBADMSG: ::c_int = 104;
+pub const ECANCELED: ::c_int = 105;
+pub const ECONNABORTED: ::c_int = 106;
+pub const ECONNREFUSED: ::c_int = 107;
+pub const ECONNRESET: ::c_int = 108;
+pub const EDESTADDRREQ: ::c_int = 109;
+pub const EHOSTUNREACH: ::c_int = 110;
+pub const EIDRM: ::c_int = 111;
+pub const EINPROGRESS: ::c_int = 112;
+pub const EISCONN: ::c_int = 113;
+pub const ELOOP: ::c_int = 114;
+pub const EMSGSIZE: ::c_int = 115;
+pub const ENETDOWN: ::c_int = 116;
+pub const ENETRESET: ::c_int = 117;
+pub const ENETUNREACH: ::c_int = 118;
+pub const ENOBUFS: ::c_int = 119;
+pub const ENODATA: ::c_int = 120;
+pub const ENOLINK: ::c_int = 121;
+pub const ENOMSG: ::c_int = 122;
+pub const ENOPROTOOPT: ::c_int = 123;
+pub const ENOSR: ::c_int = 124;
+pub const ENOSTR: ::c_int = 125;
+pub const ENOTCONN: ::c_int = 126;
+pub const ENOTRECOVERABLE: ::c_int = 127;
+pub const ENOTSOCK: ::c_int = 128;
+pub const ENOTSUP: ::c_int = 129;
+pub const EOPNOTSUPP: ::c_int = 130;
+pub const EOVERFLOW: ::c_int = 132;
+pub const EOWNERDEAD: ::c_int = 133;
+pub const EPROTO: ::c_int = 134;
+pub const EPROTONOSUPPORT: ::c_int = 135;
+pub const EPROTOTYPE: ::c_int = 136;
+pub const ETIME: ::c_int = 137;
+pub const ETIMEDOUT: ::c_int = 138;
+pub const ETXTBSY: ::c_int = 139;
+pub const EWOULDBLOCK: ::c_int = 140;
+
+// signal codes
+pub const SIGINT: ::c_int = 2;
+pub const SIGILL: ::c_int = 4;
+pub const SIGFPE: ::c_int = 8;
+pub const SIGSEGV: ::c_int = 11;
+pub const SIGTERM: ::c_int = 15;
+pub const SIGABRT: ::c_int = 22;
+pub const NSIG: ::c_int = 23;
+
+pub const SIG_ERR: ::c_int = -1;
+pub const SIG_DFL: ::sighandler_t = 0;
+pub const SIG_IGN: ::sighandler_t = 1;
+pub const SIG_GET: ::sighandler_t = 2;
+pub const SIG_SGE: ::sighandler_t = 3;
+pub const SIG_ACK: ::sighandler_t = 4;
+
+// inline comment below appeases style checker
+#[cfg(all(target_env = "msvc", feature = "rustc-dep-of-std"))] // " if "
+#[link(name = "msvcrt", cfg(not(target_feature = "crt-static")))]
+#[link(name = "libcmt", cfg(target_feature = "crt-static"))]
+extern "C" {}
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum FILE {}
+impl ::Copy for FILE {}
+impl ::Clone for FILE {
+    fn clone(&self) -> FILE {
+        *self
+    }
+}
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum fpos_t {} // FIXME: fill this out with a struct
+impl ::Copy for fpos_t {}
+impl ::Clone for fpos_t {
+    fn clone(&self) -> fpos_t {
+        *self
+    }
+}
+
+// Special handling for all print and scan type functions because of https://github.com/rust-lang/libc/issues/2860
+cfg_if! {
+    if #[cfg(not(feature = "rustc-dep-of-std"))] {
+        #[cfg_attr(
+            all(windows, target_env = "msvc"),
+            link(name = "legacy_stdio_definitions")
+        )]
+        extern "C" {
+            pub fn printf(format: *const c_char, ...) -> ::c_int;
+            pub fn fprintf(stream: *mut FILE, format: *const c_char, ...) -> ::c_int;
+        }
+    }
+}
+
+extern "C" {
+    pub fn isalnum(c: c_int) -> c_int;
+    pub fn isalpha(c: c_int) -> c_int;
+    pub fn iscntrl(c: c_int) -> c_int;
+    pub fn isdigit(c: c_int) -> c_int;
+    pub fn isgraph(c: c_int) -> c_int;
+    pub fn islower(c: c_int) -> c_int;
+    pub fn isprint(c: c_int) -> c_int;
+    pub fn ispunct(c: c_int) -> c_int;
+    pub fn isspace(c: c_int) -> c_int;
+    pub fn isupper(c: c_int) -> c_int;
+    pub fn isxdigit(c: c_int) -> c_int;
+    pub fn isblank(c: c_int) -> c_int;
+    pub fn tolower(c: c_int) -> c_int;
+    pub fn toupper(c: c_int) -> c_int;
+    pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE;
+    pub fn freopen(filename: *const c_char, mode: *const c_char, file: *mut FILE) -> *mut FILE;
+    pub fn fflush(file: *mut FILE) -> c_int;
+    pub fn fclose(file: *mut FILE) -> c_int;
+    pub fn remove(filename: *const c_char) -> c_int;
+    pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int;
+    pub fn tmpfile() -> *mut FILE;
+    pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int;
+    pub fn setbuf(stream: *mut FILE, buf: *mut c_char);
+    pub fn getchar() -> c_int;
+    pub fn putchar(c: c_int) -> c_int;
+    pub fn fgetc(stream: *mut FILE) -> c_int;
+    pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char;
+    pub fn fputc(c: c_int, stream: *mut FILE) -> c_int;
+    pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int;
+    pub fn puts(s: *const c_char) -> c_int;
+    pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int;
+    pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
+    pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
+    pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int;
+    pub fn ftell(stream: *mut FILE) -> c_long;
+    pub fn rewind(stream: *mut FILE);
+    pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int;
+    pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int;
+    pub fn feof(stream: *mut FILE) -> c_int;
+    pub fn ferror(stream: *mut FILE) -> c_int;
+    pub fn perror(s: *const c_char);
+    pub fn atof(s: *const c_char) -> c_double;
+    pub fn atoi(s: *const c_char) -> c_int;
+    pub fn atol(s: *const c_char) -> c_long;
+    pub fn atoll(s: *const c_char) -> c_longlong;
+    pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
+    pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
+    pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
+    pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
+    pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
+    pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
+    pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
+    pub fn malloc(size: size_t) -> *mut c_void;
+    pub fn _msize(p: *mut c_void) -> size_t;
+    pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
+    pub fn free(p: *mut c_void);
+    pub fn abort() -> !;
+    pub fn exit(status: c_int) -> !;
+    pub fn _exit(status: c_int) -> !;
+    pub fn atexit(cb: extern "C" fn()) -> c_int;
+    pub fn system(s: *const c_char) -> c_int;
+    pub fn getenv(s: *const c_char) -> *mut c_char;
+
+    pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char;
+    pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
+    pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char;
+    pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char;
+    pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int;
+    pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int;
+    pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int;
+    pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char;
+    pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char;
+    pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t;
+    pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t;
+    pub fn strdup(cs: *const c_char) -> *mut c_char;
+    pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char;
+    pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
+    pub fn strlen(cs: *const c_char) -> size_t;
+    pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t;
+    pub fn strerror(n: c_int) -> *mut c_char;
+    pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char;
+    pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t;
+    pub fn wcslen(buf: *const wchar_t) -> size_t;
+    pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> ::size_t;
+
+    pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
+    pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
+    pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
+    pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
+    pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
+
+    pub fn abs(i: c_int) -> c_int;
+    pub fn labs(i: c_long) -> c_long;
+    pub fn rand() -> c_int;
+    pub fn srand(seed: c_uint);
+
+    pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t;
+    pub fn raise(signum: c_int) -> c_int;
+
+    #[link_name = "_gmtime64_s"]
+    pub fn gmtime_s(destTime: *mut tm, srcTime: *const time_t) -> ::c_int;
+    #[link_name = "_localtime64_s"]
+    pub fn localtime_s(tmDest: *mut tm, sourceTime: *const time_t) -> ::errno_t;
+    #[link_name = "_time64"]
+    pub fn time(destTime: *mut time_t) -> time_t;
+    #[link_name = "_chmod"]
+    pub fn chmod(path: *const c_char, mode: ::c_int) -> ::c_int;
+    #[link_name = "_wchmod"]
+    pub fn wchmod(path: *const wchar_t, mode: ::c_int) -> ::c_int;
+    #[link_name = "_mkdir"]
+    pub fn mkdir(path: *const c_char) -> ::c_int;
+    #[link_name = "_wrmdir"]
+    pub fn wrmdir(path: *const wchar_t) -> ::c_int;
+    #[link_name = "_fstat64"]
+    pub fn fstat(fildes: ::c_int, buf: *mut stat) -> ::c_int;
+    #[link_name = "_stat64"]
+    pub fn stat(path: *const c_char, buf: *mut stat) -> ::c_int;
+    #[link_name = "_wstat64"]
+    pub fn wstat(path: *const wchar_t, buf: *mut stat) -> ::c_int;
+    #[link_name = "_wutime64"]
+    pub fn wutime(file: *const wchar_t, buf: *mut utimbuf) -> ::c_int;
+    #[link_name = "_popen"]
+    pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
+    #[link_name = "_pclose"]
+    pub fn pclose(stream: *mut ::FILE) -> ::c_int;
+    #[link_name = "_fdopen"]
+    pub fn fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE;
+    #[link_name = "_fileno"]
+    pub fn fileno(stream: *mut ::FILE) -> ::c_int;
+    #[link_name = "_open"]
+    pub fn open(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
+    #[link_name = "_wopen"]
+    pub fn wopen(path: *const wchar_t, oflag: ::c_int, ...) -> ::c_int;
+    #[link_name = "_creat"]
+    pub fn creat(path: *const c_char, mode: ::c_int) -> ::c_int;
+    #[link_name = "_access"]
+    pub fn access(path: *const c_char, amode: ::c_int) -> ::c_int;
+    #[link_name = "_chdir"]
+    pub fn chdir(dir: *const c_char) -> ::c_int;
+    #[link_name = "_close"]
+    pub fn close(fd: ::c_int) -> ::c_int;
+    #[link_name = "_dup"]
+    pub fn dup(fd: ::c_int) -> ::c_int;
+    #[link_name = "_dup2"]
+    pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int;
+    #[link_name = "_execl"]
+    pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> intptr_t;
+    #[link_name = "_wexecl"]
+    pub fn wexecl(path: *const wchar_t, arg0: *const wchar_t, ...) -> intptr_t;
+    #[link_name = "_execle"]
+    pub fn execle(path: *const c_char, arg0: *const c_char, ...) -> intptr_t;
+    #[link_name = "_wexecle"]
+    pub fn wexecle(path: *const wchar_t, arg0: *const wchar_t, ...) -> intptr_t;
+    #[link_name = "_execlp"]
+    pub fn execlp(path: *const c_char, arg0: *const c_char, ...) -> intptr_t;
+    #[link_name = "_wexeclp"]
+    pub fn wexeclp(path: *const wchar_t, arg0: *const wchar_t, ...) -> intptr_t;
+    #[link_name = "_execlpe"]
+    pub fn execlpe(path: *const c_char, arg0: *const c_char, ...) -> intptr_t;
+    #[link_name = "_wexeclpe"]
+    pub fn wexeclpe(path: *const wchar_t, arg0: *const wchar_t, ...) -> intptr_t;
+    #[link_name = "_execv"]
+    pub fn execv(prog: *const c_char, argv: *const *const c_char) -> ::intptr_t;
+    #[link_name = "_execve"]
+    pub fn execve(
+        prog: *const c_char,
+        argv: *const *const c_char,
+        envp: *const *const c_char,
+    ) -> ::c_int;
+    #[link_name = "_execvp"]
+    pub fn execvp(c: *const c_char, argv: *const *const c_char) -> ::c_int;
+    #[link_name = "_execvpe"]
+    pub fn execvpe(
+        c: *const c_char,
+        argv: *const *const c_char,
+        envp: *const *const c_char,
+    ) -> ::c_int;
+    #[link_name = "_wexecv"]
+    pub fn wexecv(prog: *const wchar_t, argv: *const *const wchar_t) -> ::intptr_t;
+    #[link_name = "_wexecve"]
+    pub fn wexecve(
+        prog: *const wchar_t,
+        argv: *const *const wchar_t,
+        envp: *const *const wchar_t,
+    ) -> ::intptr_t;
+    #[link_name = "_wexecvp"]
+    pub fn wexecvp(c: *const wchar_t, argv: *const *const wchar_t) -> ::intptr_t;
+    #[link_name = "_wexecvpe"]
+    pub fn wexecvpe(
+        c: *const wchar_t,
+        argv: *const *const wchar_t,
+        envp: *const *const wchar_t,
+    ) -> ::intptr_t;
+    #[link_name = "_getcwd"]
+    pub fn getcwd(buf: *mut c_char, size: ::c_int) -> *mut c_char;
+    #[link_name = "_getpid"]
+    pub fn getpid() -> ::c_int;
+    #[link_name = "_isatty"]
+    pub fn isatty(fd: ::c_int) -> ::c_int;
+    #[link_name = "_lseek"]
+    pub fn lseek(fd: ::c_int, offset: c_long, origin: ::c_int) -> c_long;
+    #[link_name = "_lseeki64"]
+    pub fn lseek64(fd: ::c_int, offset: c_longlong, origin: ::c_int) -> c_longlong;
+    #[link_name = "_pipe"]
+    pub fn pipe(fds: *mut ::c_int, psize: ::c_uint, textmode: ::c_int) -> ::c_int;
+    #[link_name = "_read"]
+    pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::c_uint) -> ::c_int;
+    #[link_name = "_rmdir"]
+    pub fn rmdir(path: *const c_char) -> ::c_int;
+    #[link_name = "_unlink"]
+    pub fn unlink(c: *const c_char) -> ::c_int;
+    #[link_name = "_write"]
+    pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::c_uint) -> ::c_int;
+    #[link_name = "_commit"]
+    pub fn commit(fd: ::c_int) -> ::c_int;
+    #[link_name = "_get_osfhandle"]
+    pub fn get_osfhandle(fd: ::c_int) -> ::intptr_t;
+    #[link_name = "_open_osfhandle"]
+    pub fn open_osfhandle(osfhandle: ::intptr_t, flags: ::c_int) -> ::c_int;
+    pub fn setlocale(category: ::c_int, locale: *const c_char) -> *mut c_char;
+    #[link_name = "_wsetlocale"]
+    pub fn wsetlocale(category: ::c_int, locale: *const wchar_t) -> *mut wchar_t;
+    #[link_name = "_aligned_malloc"]
+    pub fn aligned_malloc(size: size_t, alignment: size_t) -> *mut c_void;
+    #[link_name = "_aligned_free"]
+    pub fn aligned_free(ptr: *mut ::c_void);
+    #[link_name = "_putenv"]
+    pub fn putenv(envstring: *const ::c_char) -> ::c_int;
+    #[link_name = "_wputenv"]
+    pub fn wputenv(envstring: *const ::wchar_t) -> ::c_int;
+    #[link_name = "_putenv_s"]
+    pub fn putenv_s(envstring: *const ::c_char, value_string: *const ::c_char) -> ::errno_t;
+    #[link_name = "_wputenv_s"]
+    pub fn wputenv_s(envstring: *const ::wchar_t, value_string: *const ::wchar_t) -> ::errno_t;
+}
+
+extern "system" {
+    pub fn listen(s: SOCKET, backlog: ::c_int) -> ::c_int;
+    pub fn accept(s: SOCKET, addr: *mut ::sockaddr, addrlen: *mut ::c_int) -> SOCKET;
+    pub fn bind(s: SOCKET, name: *const ::sockaddr, namelen: ::c_int) -> ::c_int;
+    pub fn connect(s: SOCKET, name: *const ::sockaddr, namelen: ::c_int) -> ::c_int;
+    pub fn getpeername(s: SOCKET, name: *mut ::sockaddr, nameln: *mut ::c_int) -> ::c_int;
+    pub fn getsockname(s: SOCKET, name: *mut ::sockaddr, nameln: *mut ::c_int) -> ::c_int;
+    pub fn getsockopt(
+        s: SOCKET,
+        level: ::c_int,
+        optname: ::c_int,
+        optval: *mut ::c_char,
+        optlen: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn recvfrom(
+        s: SOCKET,
+        buf: *mut ::c_char,
+        len: ::c_int,
+        flags: ::c_int,
+        from: *mut ::sockaddr,
+        fromlen: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn sendto(
+        s: SOCKET,
+        buf: *const ::c_char,
+        len: ::c_int,
+        flags: ::c_int,
+        to: *const ::sockaddr,
+        tolen: ::c_int,
+    ) -> ::c_int;
+    pub fn setsockopt(
+        s: SOCKET,
+        level: ::c_int,
+        optname: ::c_int,
+        optval: *const ::c_char,
+        optlen: ::c_int,
+    ) -> ::c_int;
+    pub fn socket(af: ::c_int, socket_type: ::c_int, protocol: ::c_int) -> SOCKET;
+}
+
+cfg_if! {
+    if #[cfg(libc_core_cvoid)] {
+        pub use ::ffi::c_void;
+    } else {
+        // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
+        // enable more optimization opportunities around it recognizing things
+        // like malloc/free.
+        #[repr(u8)]
+        #[allow(missing_copy_implementations)]
+        #[allow(missing_debug_implementations)]
+        pub enum c_void {
+            // Two dummy variants so the #[repr] attribute can be used.
+            #[doc(hidden)]
+            __variant1,
+            #[doc(hidden)]
+            __variant2,
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(all(target_env = "gnu"))] {
+        mod gnu;
+        pub use self::gnu::*;
+    } else if #[cfg(all(target_env = "msvc"))] {
+        mod msvc;
+        pub use self::msvc::*;
+    } else {
+        // Unknown target_env
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/windows/msvc/mod.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/windows/msvc/mod.rs
--- 43.0.0-1/rust-vendor/libc/src/windows/msvc/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/windows/msvc/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,20 @@
+pub const L_tmpnam: ::c_uint = 260;
+pub const TMP_MAX: ::c_uint = 0x7fff_ffff;
+
+// POSIX Supplement (from errno.h)
+// This particular error code is only currently available in msvc toolchain
+pub const EOTHER: ::c_int = 131;
+
+extern "C" {
+    #[link_name = "_stricmp"]
+    pub fn stricmp(s1: *const ::c_char, s2: *const ::c_char) -> ::c_int;
+    #[link_name = "_strnicmp"]
+    pub fn strnicmp(s1: *const ::c_char, s2: *const ::c_char, n: ::size_t) -> ::c_int;
+    #[link_name = "_memccpy"]
+    pub fn memccpy(
+        dest: *mut ::c_void,
+        src: *const ::c_void,
+        c: ::c_int,
+        count: ::size_t,
+    ) -> *mut ::c_void;
+}
diff -pruN 43.0.0-1/rust-vendor/libc/src/xous.rs 43.0.0-1ubuntu1/rust-vendor/libc/src/xous.rs
--- 43.0.0-1/rust-vendor/libc/src/xous.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/src/xous.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,49 @@
+//! Xous C type definitions
+
+pub type c_schar = i8;
+pub type c_uchar = u8;
+pub type c_short = i16;
+pub type c_ushort = u16;
+pub type c_int = i32;
+pub type c_uint = u32;
+pub type c_float = f32;
+pub type c_double = f64;
+pub type c_longlong = i64;
+pub type c_ulonglong = u64;
+pub type intmax_t = i64;
+pub type uintmax_t = u64;
+
+pub type size_t = usize;
+pub type ptrdiff_t = isize;
+pub type intptr_t = isize;
+pub type uintptr_t = usize;
+pub type ssize_t = isize;
+
+pub type off_t = i64;
+pub type c_char = u8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type wchar_t = u32;
+
+pub const INT_MIN: c_int = -2147483648;
+pub const INT_MAX: c_int = 2147483647;
+
+cfg_if! {
+    if #[cfg(libc_core_cvoid)] {
+        pub use ::ffi::c_void;
+    } else {
+        // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
+        // enable more optimization opportunities around it recognizing things
+        // like malloc/free.
+        #[repr(u8)]
+        #[allow(missing_copy_implementations)]
+        #[allow(missing_debug_implementations)]
+        pub enum c_void {
+            // Two dummy variants so the #[repr] attribute can be used.
+            #[doc(hidden)]
+            __variant1,
+            #[doc(hidden)]
+            __variant2,
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/libc/tests/const_fn.rs 43.0.0-1ubuntu1/rust-vendor/libc/tests/const_fn.rs
--- 43.0.0-1/rust-vendor/libc/tests/const_fn.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/libc/tests/const_fn.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+#![cfg(libc_const_extern_fn)] // If this does not hold, the file is empty
+
+#[cfg(target_os = "linux")]
+const _FOO: libc::c_uint = unsafe { libc::CMSG_SPACE(1) };
+//^ if CMSG_SPACE is not const, this will fail to compile
diff -pruN 43.0.0-1/rust-vendor/memoffset/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/memoffset/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/memoffset/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/memoffset/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"CHANGELOG.md":"badae1c4dc22e994d6e29d892bd925083d948d941f11ee7b767a535bd4ff5f9a","Cargo.toml":"772e523da630871e710cc229f36282205713bba853d4d3f78e5a5d099bb3a814","LICENSE":"3234ac55816264ee7b6c7ee27efd61cf0a1fe775806870e3d9b4c41ea73c5cb1","README.md":"c04d939e7dc8bc21010cae6d22bf7f16e019960c0adbae4f894f47c24c54e109","build.rs":"0ddaae191a4091fe1318177d12244ff0dbabc17a18f25a54059f4badc9a20876","src/lib.rs":"c4034868e7f7b5c03848a735589081bc763f62f6fe8eb4175873c97db1f855a3","src/offset_of.rs":"fdd36253329210293cc867d7fb0a5bca2ec7f12befa9a30c88b85932ead4cd34","src/raw_field.rs":"95a17510c77b11ecb68b170f724ca1c71517ff1476024bcba48c70ca712c21cc","src/span_of.rs":"268505154f4ae3df1a961da047fef50200339f4d75d8e4d6b9340ee14028943a"},"package":"488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/memoffset/CHANGELOG.md 43.0.0-1ubuntu1/rust-vendor/memoffset/CHANGELOG.md
--- 43.0.0-1/rust-vendor/memoffset/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/memoffset/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,32 @@
+# Changelog
+
+## Unreleased
+
+## v0.9.1 (26/03/2024)
+### Added
+ - Added changelog
+
+### Changed
+ - Clarify documentation about macro indirection
+ - Turn the crate into a thin stdlib wrapper on rustc>=1.77
+ - Turn `unstable_offset_of` and `unstable_const` into NOPs; they are not needed any more on recent nightlies
+
+## v0.9.0 (18/05/2023)
+### Added
+ - Cargo feature `unstable_offset_of` which turns the crate into a stdlib polyfill
+
+## v0.8.0 (15/12/2022)
+### Changed
+ - Constant-evaluation is automatically enabled
+
+## v0.7.1 (17/10/2022)
+### Changed
+ - Version in `README.md`
+
+## v0.7.0 (17/10/2022)
+### Added
+ - `offset_of_union!`
+
+## v0.6.5 (03/12/2021)
+### Removed
+ - [nightly] `#![feature(const_raw_ptr_deref, const_maybe_uninit_as_ptr)]`
diff -pruN 43.0.0-1/rust-vendor/memoffset/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/memoffset/Cargo.toml
--- 43.0.0-1/rust-vendor/memoffset/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/memoffset/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,37 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+name = "memoffset"
+version = "0.9.1"
+authors = ["Gilad Naaman <gilad.naaman@gmail.com>"]
+description = "offset_of functionality for Rust structs."
+readme = "README.md"
+keywords = [
+    "mem",
+    "offset",
+    "offset_of",
+    "offsetof",
+]
+categories = ["no-std"]
+license = "MIT"
+repository = "https://github.com/Gilnaa/memoffset"
+
+[dev-dependencies.doc-comment]
+version = "0.3"
+
+[build-dependencies.autocfg]
+version = "1"
+
+[features]
+default = []
+unstable_const = []
+unstable_offset_of = []
diff -pruN 43.0.0-1/rust-vendor/memoffset/LICENSE 43.0.0-1ubuntu1/rust-vendor/memoffset/LICENSE
--- 43.0.0-1/rust-vendor/memoffset/LICENSE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/memoffset/LICENSE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,19 @@
+Copyright (c) 2017 Gilad Naaman
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/memoffset/README.md 43.0.0-1ubuntu1/rust-vendor/memoffset/README.md
--- 43.0.0-1/rust-vendor/memoffset/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/memoffset/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,55 @@
+# memoffset #
+
+[![](https://img.shields.io/crates/v/memoffset.svg)](https://crates.io/crates/memoffset)
+
+C-Like `offset_of` functionality for Rust structs.
+
+Introduces the following macros:
+ * `offset_of!` for obtaining the offset of a member of a struct.
+ * `offset_of_tuple!` for obtaining the offset of a member of a tuple. (Requires Rust 1.20+)
+ * `offset_of_union!` for obtaining the offset of a member of a union.
+ * `span_of!` for obtaining the range that a field, or fields, span.
+
+`memoffset` works under `no_std` environments.
+
+If you're using a rustc version greater or equal to 1.77, this crate's `offset_of!()` macro simply forwards to `core::mem::offset_of!()`.
+
+## Usage ##
+Add the following dependency to your `Cargo.toml`:
+
+```toml
+[dependencies]
+memoffset = "0.9"
+```
+
+These versions will compile fine with rustc versions greater or equal to 1.19.
+
+## Examples ##
+```rust
+use memoffset::{offset_of, span_of};
+
+#[repr(C, packed)]
+struct Foo {
+    a: u32,
+    b: u32,
+    c: [u8; 5],
+    d: u32,
+}
+
+fn main() {
+    assert_eq!(offset_of!(Foo, b), 4);
+    assert_eq!(offset_of!(Foo, d), 4+4+5);
+
+    assert_eq!(span_of!(Foo, a),        0..4);
+    assert_eq!(span_of!(Foo, a ..  c),  0..8);
+    assert_eq!(span_of!(Foo, a ..= c),  0..13);
+    assert_eq!(span_of!(Foo, ..= d),    0..17);
+    assert_eq!(span_of!(Foo, b ..),     4..17);
+}
+```
+
+## Usage in constants ##
+`memoffset` has support for compile-time `offset_of!` on rust>=1.65.
+
+On versions below 1.77, this is an incomplete implementation with one caveat:
+Due to dependence on [`#![feature(const_refs_to_cell)]`](https://github.com/rust-lang/rust/issues/80384), you cannot get the offset of a `Cell` field in a const-context.
diff -pruN 43.0.0-1/rust-vendor/memoffset/build.rs 43.0.0-1ubuntu1/rust-vendor/memoffset/build.rs
--- 43.0.0-1/rust-vendor/memoffset/build.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/memoffset/build.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,28 @@
+extern crate autocfg;
+
+fn main() {
+    let ac = autocfg::new();
+
+    // Check for a minimum version for a few features
+    if ac.probe_rustc_version(1, 20) {
+        println!("cargo:rustc-cfg=tuple_ty");
+    }
+    if ac.probe_rustc_version(1, 31) {
+        println!("cargo:rustc-cfg=allow_clippy");
+    }
+    if ac.probe_rustc_version(1, 36) {
+        println!("cargo:rustc-cfg=maybe_uninit");
+    }
+    if ac.probe_rustc_version(1, 40) {
+        println!("cargo:rustc-cfg=doctests");
+    }
+    if ac.probe_rustc_version(1, 51) {
+        println!("cargo:rustc-cfg=raw_ref_macros");
+    }
+    if ac.probe_rustc_version(1, 65) {
+        println!("cargo:rustc-cfg=stable_const");
+    }
+    if ac.probe_rustc_version(1, 77) {
+        println!("cargo:rustc-cfg=stable_offset_of");
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/memoffset/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/memoffset/src/lib.rs
--- 43.0.0-1/rust-vendor/memoffset/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/memoffset/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,86 @@
+// Copyright (c) 2017 Gilad Naaman
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+
+//! A crate used for calculating offsets of struct members and their spans.
+//!
+//! This functionality currently can not be used in compile time code such as `const` or `const fn` definitions.
+//!
+//! ## Examples
+//! ```
+//! use memoffset::{offset_of, span_of};
+//!
+//! #[repr(C, packed)]
+//! struct HelpMeIAmTrappedInAStructFactory {
+//!     help_me_before_they_: [u8; 15],
+//!     a: u32
+//! }
+//!
+//! assert_eq!(offset_of!(HelpMeIAmTrappedInAStructFactory, a), 15);
+//! assert_eq!(span_of!(HelpMeIAmTrappedInAStructFactory, a), 15..19);
+//! assert_eq!(span_of!(HelpMeIAmTrappedInAStructFactory, help_me_before_they_ .. a), 0..15);
+//! ```
+//!
+//! This functionality can be useful, for example, for checksum calculations:
+//!
+//! ```ignore
+//! #[repr(C, packed)]
+//! struct Message {
+//!     header: MessageHeader,
+//!     fragment_index: u32,
+//!     fragment_count: u32,
+//!     payload: [u8; 1024],
+//!     checksum: u16
+//! }
+//!
+//! let checksum_range = &raw[span_of!(Message, header..checksum)];
+//! let checksum = crc16(checksum_range);
+//! ```
+
+#![no_std]
+
+#[macro_use]
+#[cfg(doctests)]
+#[cfg(doctest)]
+extern crate doc_comment;
+#[cfg(doctests)]
+#[cfg(doctest)]
+doctest!("../README.md");
+
+/// Hidden module for things the macros need to access.
+#[doc(hidden)]
+pub mod __priv {
+    #[doc(hidden)]
+    pub use core::mem;
+    #[doc(hidden)]
+    pub use core::ptr;
+
+    /// Use type inference to obtain the size of the pointee (without actually using the pointer).
+    #[doc(hidden)]
+    pub fn size_of_pointee<T>(_ptr: *const T) -> usize {
+        mem::size_of::<T>()
+    }
+}
+
+#[macro_use]
+mod raw_field;
+#[macro_use]
+mod offset_of;
+#[macro_use]
+mod span_of;
diff -pruN 43.0.0-1/rust-vendor/memoffset/src/offset_of.rs 43.0.0-1ubuntu1/rust-vendor/memoffset/src/offset_of.rs
--- 43.0.0-1/rust-vendor/memoffset/src/offset_of.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/memoffset/src/offset_of.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,411 @@
+// Copyright (c) 2017 Gilad Naaman
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+
+/// Macro to create a local `base_ptr` raw pointer of the given type, avoiding UB as
+/// much as is possible currently.
+#[cfg(maybe_uninit)]
+#[macro_export]
+#[doc(hidden)]
+macro_rules! _memoffset__let_base_ptr {
+    ($name:ident, $type:ty) => {
+        // No UB here, and the pointer does not dangle, either.
+        // But we have to make sure that `uninit` lives long enough,
+        // so it has to be in the same scope as `$name`. That's why
+        // `let_base_ptr` declares a variable (several, actually)
+        // instead of returning one.
+        let uninit = $crate::__priv::mem::MaybeUninit::<$type>::uninit();
+        let $name: *const $type = uninit.as_ptr();
+    };
+}
+#[cfg(not(maybe_uninit))]
+#[macro_export]
+#[doc(hidden)]
+macro_rules! _memoffset__let_base_ptr {
+    ($name:ident, $type:ty) => {
+        // No UB right here, but we will later dereference this pointer to
+        // offset into a field, and that is UB because the pointer is dangling.
+        let $name = $crate::__priv::mem::align_of::<$type>() as *const $type;
+    };
+}
+
+/// Macro to compute the distance between two pointers.
+#[cfg(stable_const)]
+#[macro_export]
+#[doc(hidden)]
+macro_rules! _memoffset_offset_from_unsafe {
+    ($field:expr, $base:expr) => {{
+        let field = $field; // evaluate $field outside the `unsafe` block
+        let base = $base; // evaluate $base outside the `unsafe` block
+        // Compute offset, with unstable `offset_from` for const-compatibility.
+        // (Requires the pointers to not dangle, but we already need that for `raw_field!` anyway.)
+        unsafe { (field as *const u8).offset_from(base as *const u8) as usize }
+    }};
+}
+#[cfg(not(stable_const))]
+#[macro_export]
+#[doc(hidden)]
+macro_rules! _memoffset_offset_from_unsafe {
+    ($field:expr, $base:expr) => {
+        // Compute offset.
+        ($field as usize) - ($base as usize)
+    };
+}
+#[cfg(not(stable_offset_of))]
+#[macro_export(local_inner_macros)]
+#[doc(hidden)]
+macro_rules! _memoffset__offset_of_impl {
+    ($parent:path, $field:tt) => {{
+        // Get a base pointer (non-dangling if rustc supports `MaybeUninit`).
+        _memoffset__let_base_ptr!(base_ptr, $parent);
+        // Get field pointer.
+        let field_ptr = raw_field!(base_ptr, $parent, $field);
+        // Compute offset.
+        _memoffset_offset_from_unsafe!(field_ptr, base_ptr)
+    }};
+}
+#[cfg(stable_offset_of)]
+#[macro_export]
+#[doc(hidden)]
+macro_rules! _memoffset__offset_of_impl {
+    ($parent:path, $field:tt) => {{
+        $crate::__priv::mem::offset_of!($parent, $field)
+    }};
+}
+
+/// Calculates the offset of the specified field from the start of the named struct.
+///
+/// ## Examples
+/// ```
+/// use memoffset::offset_of;
+///
+/// #[repr(C, packed)]
+/// struct Foo {
+///     a: u32,
+///     b: u64,
+///     c: [u8; 5]
+/// }
+///
+/// assert_eq!(offset_of!(Foo, a), 0);
+/// assert_eq!(offset_of!(Foo, b), 4);
+/// ```
+///
+/// ## Notes
+/// Rust's ABI is unstable, and [type layout can be changed with each
+/// compilation](https://doc.rust-lang.org/reference/type-layout.html).
+///
+/// Using `offset_of!` with a `repr(Rust)` struct will return the correct offset of the
+/// specified `field` for a particular compilation, but the exact value may change
+/// based on the compiler version, concrete struct type, time of day, or rustc's mood.
+///
+/// As a result, the value should not be retained and used between different compilations.
+#[macro_export(local_inner_macros)]
+macro_rules! offset_of {
+    ($parent:path, $field:tt) => {
+        // Macro implementation is delegated to another macro to have a
+        // single top-level macro to attach documentation to.
+        _memoffset__offset_of_impl!($parent, $field)
+    };
+}
+
+#[cfg(tuple_ty)]
+#[cfg(not(stable_offset_of))]
+#[macro_export(local_inner_macros)]
+#[doc(hidden)]
+macro_rules! _memoffset__offset_of_tuple_impl {
+    ($parent:ty, $field:tt) => {{
+        // Get a base pointer (non-dangling if rustc supports `MaybeUninit`).
+        _memoffset__let_base_ptr!(base_ptr, $parent);
+        // Get field pointer.
+        let field_ptr = raw_field_tuple!(base_ptr, $parent, $field);
+        // Compute offset.
+        _memoffset_offset_from_unsafe!(field_ptr, base_ptr)
+    }};
+}
+
+#[cfg(tuple_ty)]
+#[cfg(stable_offset_of)]
+#[macro_export(local_inner_macros)]
+#[doc(hidden)]
+macro_rules! _memoffset__offset_of_tuple_impl {
+    ($parent:ty, $field:tt) => {{
+        $crate::__priv::mem::offset_of!($parent, $field)
+    }};
+}
+
+/// Calculates the offset of the specified field from the start of the tuple.
+///
+/// ## Examples
+/// ```
+/// use memoffset::offset_of_tuple;
+///
+/// assert!(offset_of_tuple!((u8, u32), 1) >= 0, "Tuples do not have a defined layout");
+/// ```
+#[cfg(tuple_ty)]
+#[macro_export(local_inner_macros)]
+macro_rules! offset_of_tuple {
+    ($parent:ty, $field:tt) => {{
+        // Macro implementation is delegated to another macro to have a
+        // single top-level macro to attach documentation to.
+        _memoffset__offset_of_tuple_impl!($parent, $field)
+    }};
+}
+
+#[cfg(not(stable_offset_of))]
+#[macro_export(local_inner_macros)]
+#[doc(hidden)]
+macro_rules! _memoffset__offset_of_union_impl {
+    ($parent:path, $field:tt) => {{
+        // Get a base pointer (non-dangling if rustc supports `MaybeUninit`).
+        _memoffset__let_base_ptr!(base_ptr, $parent);
+        // Get field pointer.
+        let field_ptr = raw_field_union!(base_ptr, $parent, $field);
+        // Compute offset.
+        _memoffset_offset_from_unsafe!(field_ptr, base_ptr)
+    }};
+}
+
+#[cfg(stable_offset_of)]
+#[macro_export(local_inner_macros)]
+#[doc(hidden)]
+macro_rules! _memoffset__offset_of_union_impl {
+    ($parent:path, $field:tt) => {{
+        $crate::__priv::mem::offset_of!($parent, $field)
+    }};
+}
+
+/// Calculates the offset of the specified union member from the start of the union.
+///
+/// ## Examples
+/// ```
+/// use memoffset::offset_of_union;
+///
+/// #[repr(C, packed)]
+/// union Foo {
+///     foo32: i32,
+///     foo64: i64,
+/// }
+///
+/// assert!(offset_of_union!(Foo, foo64) == 0);
+/// ```
+///
+/// ## Note
+/// Due to `macro_rules!` limitations, this macro will accept structs with a single field as well as unions.
+/// This is not a stable guarantee, and future versions of this crate might fail
+/// on any use of this macro with a struct, without a semver bump.
+#[macro_export(local_inner_macros)]
+macro_rules! offset_of_union {
+    ($parent:path, $field:tt) => {{
+        // Macro implementation is delegated to another macro to have a
+        // single top-level macro to attach documentation to.
+        _memoffset__offset_of_union_impl!($parent, $field)
+    }};
+}
+
+#[cfg(test)]
+mod tests {
+    #![cfg_attr(allow_clippy, allow(clippy::identity_op))] // For `... + 0` constructs below.
+
+    #[test]
+    fn offset_simple() {
+        #[repr(C)]
+        struct Foo {
+            a: u32,
+            b: [u8; 2],
+            c: i64,
+        }
+
+        assert_eq!(offset_of!(Foo, a), 0);
+        assert_eq!(offset_of!(Foo, b), 4);
+        assert_eq!(offset_of!(Foo, c), 8);
+    }
+
+    #[test]
+    fn offset_simple_packed() {
+        #[repr(C, packed)]
+        struct Foo {
+            a: u32,
+            b: [u8; 2],
+            c: i64,
+        }
+
+        assert_eq!(offset_of!(Foo, a), 0);
+        assert_eq!(offset_of!(Foo, b), 4);
+        assert_eq!(offset_of!(Foo, c), 6);
+    }
+
+    #[test]
+    fn tuple_struct() {
+        #[repr(C)]
+        struct Tup(i32, i32);
+
+        assert_eq!(offset_of!(Tup, 0), 0);
+        assert_eq!(offset_of!(Tup, 1), 4);
+    }
+
+    #[test]
+    fn offset_union() {
+        // Since we're specifying repr(C), all fields are supposed to be at offset 0
+        #[repr(C)]
+        union Foo {
+            a: u32,
+            b: [u8; 2],
+            c: i64,
+        }
+
+        assert_eq!(offset_of_union!(Foo, a), 0);
+        assert_eq!(offset_of_union!(Foo, b), 0);
+        assert_eq!(offset_of_union!(Foo, c), 0);
+    }
+
+    #[test]
+    fn path() {
+        mod sub {
+            #[repr(C)]
+            pub struct Foo {
+                pub x: u32,
+            }
+        }
+
+        assert_eq!(offset_of!(sub::Foo, x), 0);
+    }
+
+    #[test]
+    fn inside_generic_method() {
+        struct Pair<T, U>(T, U);
+
+        fn foo<T, U>(_: Pair<T, U>) -> usize {
+            offset_of!(Pair<T, U>, 1)
+        }
+
+        assert_eq!(foo(Pair(0, 0)), 4);
+    }
+
+    #[cfg(tuple_ty)]
+    #[test]
+    fn test_tuple_offset() {
+        let f = (0i32, 0.0f32, 0u8);
+        let f_ptr = &f as *const _;
+        let f1_ptr = &f.1 as *const _;
+
+        assert_eq!(
+            f1_ptr as usize - f_ptr as usize,
+            offset_of_tuple!((i32, f32, u8), 1)
+        );
+    }
+
+    #[test]
+    fn test_raw_field() {
+        #[repr(C)]
+        struct Foo {
+            a: u32,
+            b: [u8; 2],
+            c: i64,
+        }
+
+        let f: Foo = Foo {
+            a: 0,
+            b: [0, 0],
+            c: 0,
+        };
+        let f_ptr = &f as *const _;
+        assert_eq!(f_ptr as usize + 0, raw_field!(f_ptr, Foo, a) as usize);
+        assert_eq!(f_ptr as usize + 4, raw_field!(f_ptr, Foo, b) as usize);
+        assert_eq!(f_ptr as usize + 8, raw_field!(f_ptr, Foo, c) as usize);
+    }
+
+    #[cfg(tuple_ty)]
+    #[test]
+    fn test_raw_field_tuple() {
+        let t = (0u32, 0u8, false);
+        let t_ptr = &t as *const _;
+        let t_addr = t_ptr as usize;
+
+        assert_eq!(
+            &t.0 as *const _ as usize - t_addr,
+            raw_field_tuple!(t_ptr, (u32, u8, bool), 0) as usize - t_addr
+        );
+        assert_eq!(
+            &t.1 as *const _ as usize - t_addr,
+            raw_field_tuple!(t_ptr, (u32, u8, bool), 1) as usize - t_addr
+        );
+        assert_eq!(
+            &t.2 as *const _ as usize - t_addr,
+            raw_field_tuple!(t_ptr, (u32, u8, bool), 2) as usize - t_addr
+        );
+    }
+
+    #[test]
+    fn test_raw_field_union() {
+        #[repr(C)]
+        union Foo {
+            a: u32,
+            b: [u8; 2],
+            c: i64,
+        }
+
+        let f = Foo { a: 0 };
+        let f_ptr = &f as *const _;
+        assert_eq!(f_ptr as usize + 0, raw_field_union!(f_ptr, Foo, a) as usize);
+        assert_eq!(f_ptr as usize + 0, raw_field_union!(f_ptr, Foo, b) as usize);
+        assert_eq!(f_ptr as usize + 0, raw_field_union!(f_ptr, Foo, c) as usize);
+    }
+
+    #[cfg(any(stable_offset_of, stable_const))]
+    #[test]
+    fn const_offset() {
+        #[repr(C)]
+        struct Foo {
+            a: u32,
+            b: [u8; 2],
+            c: i64,
+        }
+
+        assert_eq!([0; offset_of!(Foo, b)].len(), 4);
+    }
+
+    #[cfg(stable_offset_of)]
+    #[test]
+    fn const_offset_interior_mutable() {
+        #[repr(C)]
+        struct Foo {
+            a: u32,
+            b: core::cell::Cell<u32>,
+        }
+
+        assert_eq!([0; offset_of!(Foo, b)].len(), 4);
+    }
+
+    #[cfg(any(stable_offset_of, stable_const))]
+    #[test]
+    fn const_fn_offset() {
+        const fn test_fn() -> usize {
+            #[repr(C)]
+            struct Foo {
+                a: u32,
+                b: [u8; 2],
+                c: i64,
+            }
+
+            offset_of!(Foo, b)
+        }
+
+        assert_eq!([0; test_fn()].len(), 4);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/memoffset/src/raw_field.rs 43.0.0-1ubuntu1/rust-vendor/memoffset/src/raw_field.rs
--- 43.0.0-1/rust-vendor/memoffset/src/raw_field.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/memoffset/src/raw_field.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,226 @@
+// Copyright (c) 2020 Gilad Naaman, Ralf Jung
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+
+/// `addr_of!`, or just ref-then-cast when that is not available.
+#[cfg(raw_ref_macros)]
+#[macro_export]
+#[doc(hidden)]
+macro_rules! _memoffset__addr_of {
+    ($path:expr) => {{
+        $crate::__priv::ptr::addr_of!($path)
+    }};
+}
+#[cfg(not(raw_ref_macros))]
+#[macro_export]
+#[doc(hidden)]
+macro_rules! _memoffset__addr_of {
+    ($path:expr) => {{
+        // This is UB because we create an intermediate reference to uninitialized memory.
+        // Nothing we can do about that without `addr_of!` though.
+        &$path as *const _
+    }};
+}
+
+/// Deref-coercion protection macro.
+///
+/// Prevents compilation if the specified field name is not a part of the
+/// struct definition.
+///
+/// ```compile_fail
+/// use memoffset::_memoffset__field_check;
+///
+/// struct Foo {
+///     foo: i32,
+/// }
+///
+/// type BoxedFoo = Box<Foo>;
+///
+/// _memoffset__field_check!(BoxedFoo, foo);
+/// ```
+#[cfg(allow_clippy)]
+#[macro_export]
+#[doc(hidden)]
+macro_rules! _memoffset__field_check {
+    ($type:path, $field:tt) => {
+        // Make sure the field actually exists. This line ensures that a
+        // compile-time error is generated if $field is accessed through a
+        // Deref impl.
+        #[allow(clippy::unneeded_field_pattern)]
+        let $type { $field: _, .. };
+    };
+}
+#[cfg(not(allow_clippy))]
+#[macro_export]
+#[doc(hidden)]
+macro_rules! _memoffset__field_check {
+    ($type:path, $field:tt) => {
+        // Make sure the field actually exists. This line ensures that a
+        // compile-time error is generated if $field is accessed through a
+        // Deref impl.
+        let $type { $field: _, .. };
+    };
+}
+
+/// Deref-coercion protection macro.
+///
+/// Prevents compilation if the specified type is not a tuple.
+///
+/// ```compile_fail
+/// use memoffset::_memoffset__field_check_tuple;
+///
+/// _memoffset__field_check_tuple!(i32, 0);
+/// ```
+#[cfg(allow_clippy)]
+#[macro_export]
+#[doc(hidden)]
+macro_rules! _memoffset__field_check_tuple {
+    ($type:ty, $field:tt) => {
+        // Make sure the type argument is a tuple
+        #[allow(clippy::unneeded_wildcard_pattern)]
+        let (_, ..): $type;
+    };
+}
+#[cfg(not(allow_clippy))]
+#[macro_export]
+#[doc(hidden)]
+macro_rules! _memoffset__field_check_tuple {
+    ($type:ty, $field:tt) => {
+        // Make sure the type argument is a tuple
+        let (_, ..): $type;
+    };
+}
+
+/// Deref-coercion protection macro for unions.
+/// Unfortunately accepts single-field structs as well, which is not ideal,
+/// but ultimately pretty harmless.
+///
+/// ```compile_fail
+/// use memoffset::_memoffset__field_check_union;
+///
+/// union Foo {
+///     variant_a: i32,
+/// }
+///
+/// type BoxedFoo = Box<Foo>;
+///
+/// _memoffset__field_check_union!(BoxedFoo, variant_a);
+/// ```
+#[cfg(allow_clippy)]
+#[macro_export]
+#[doc(hidden)]
+macro_rules! _memoffset__field_check_union {
+    ($type:path, $field:tt) => {
+        // Make sure the field actually exists. This line ensures that a
+        // compile-time error is generated if $field is accessed through a
+        // Deref impl.
+        #[allow(clippy::unneeded_wildcard_pattern)]
+        // rustc1.19 requires unsafe here for the pattern; not needed in newer versions
+        #[allow(unused_unsafe)]
+        unsafe {
+            let $type { $field: _ };
+        }
+    };
+}
+#[cfg(not(allow_clippy))]
+#[macro_export]
+#[doc(hidden)]
+macro_rules! _memoffset__field_check_union {
+    ($type:path, $field:tt) => {
+        // Make sure the field actually exists. This line ensures that a
+        // compile-time error is generated if $field is accessed through a
+        // Deref impl.
+        // rustc1.19 requires unsafe here for the pattern; not needed in newer versions
+        #[allow(unused_unsafe)]
+        unsafe {
+            let $type { $field: _ };
+        }
+    };
+}
+
+/// Computes a const raw pointer to the given field of the given base pointer
+/// to the given parent type.
+///
+/// The `base` pointer *must not* be dangling, but it *may* point to
+/// uninitialized memory.
+#[macro_export(local_inner_macros)]
+macro_rules! raw_field {
+    ($base:expr, $parent:path, $field:tt) => {{
+        _memoffset__field_check!($parent, $field);
+        let base = $base; // evaluate $base outside the `unsafe` block
+
+        // Get the field address.
+        // Crucially, we know that this will not trigger a deref coercion because
+        // of the field check we did above.
+        #[allow(unused_unsafe)] // for when the macro is used in an unsafe block
+        unsafe {
+            _memoffset__addr_of!((*(base as *const $parent)).$field)
+        }
+    }};
+}
+
+/// Computes a const raw pointer to the given field of the given base pointer
+/// to the given parent tuple type.
+///
+/// The `base` pointer *must not* be dangling, but it *may* point to
+/// uninitialized memory.
+#[cfg(tuple_ty)]
+#[macro_export(local_inner_macros)]
+macro_rules! raw_field_tuple {
+    ($base:expr, $parent:ty, $field:tt) => {{
+        _memoffset__field_check_tuple!($parent, $field);
+        let base = $base; // evaluate $base outside the `unsafe` block
+
+        // Get the field address.
+        // Crucially, we know that this will not trigger a deref coercion because
+        // of the field check we did above.
+        #[allow(unused_unsafe)] // for when the macro is used in an unsafe block
+        unsafe {
+            _memoffset__addr_of!((*(base as *const $parent)).$field)
+        }
+    }};
+}
+
+/// Computes a const raw pointer to the given field of the given base pointer
+/// to the given parent tuple type.
+///
+/// The `base` pointer *must not* be dangling, but it *may* point to
+/// uninitialized memory.
+///
+/// ## Note
+/// This macro is the same as `raw_field`, except for a different Deref-coercion check that
+/// supports unions.
+/// Due to `macro_rules!` limitations, this check will accept structs with a single field as well as unions.
+/// This is not a stable guarantee, and future versions of this crate might fail
+/// on any use of this macro with a struct, without a semver bump.
+#[macro_export(local_inner_macros)]
+macro_rules! raw_field_union {
+    ($base:expr, $parent:path, $field:tt) => {{
+        _memoffset__field_check_union!($parent, $field);
+        let base = $base; // evaluate $base outside the `unsafe` block
+
+        // Get the field address.
+        // Crucially, we know that this will not trigger a deref coercion because
+        // of the field check we did above.
+        #[allow(unused_unsafe)] // for when the macro is used in an unsafe block
+        unsafe {
+            _memoffset__addr_of!((*(base as *const $parent)).$field)
+        }
+    }};
+}
diff -pruN 43.0.0-1/rust-vendor/memoffset/src/span_of.rs 43.0.0-1ubuntu1/rust-vendor/memoffset/src/span_of.rs
--- 43.0.0-1/rust-vendor/memoffset/src/span_of.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/memoffset/src/span_of.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,261 @@
+// Copyright (c) 2017 Gilad Naaman
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+
+/// Reexport for `local_inner_macros`; see
+/// <https://doc.rust-lang.org/edition-guide/rust-2018/macros/macro-changes.html#macros-using-local_inner_macros>.
+#[doc(hidden)]
+#[macro_export]
+macro_rules! _memoffset__compile_error {
+    ($($inner:tt)*) => {
+        compile_error! { $($inner)* }
+    }
+}
+
+/// Produces a range instance representing the sub-slice containing the specified member.
+///
+/// This macro provides 2 forms of differing functionalities.
+///
+/// The first form is identical to the appearance of the `offset_of!` macro.
+///
+/// ```ignore
+/// span_of!(Struct, member)
+/// ```
+///
+/// The second form of `span_of!` returns a sub-slice which starts at one field, and ends at another.
+/// The general pattern of this form is:
+///
+/// ```ignore
+/// // Exclusive
+/// span_of!(Struct, member_a .. member_b)
+/// // Inclusive
+/// span_of!(Struct, member_a ..= member_b)
+///
+/// // Open-ended ranges
+/// span_of!(Struct, .. end)
+/// span_of!(Struct, start ..)
+/// ```
+///
+/// ### Note
+/// This macro uses recursion in order to resolve the range expressions, so there is a limit to
+/// the complexity of the expression.
+/// In order to raise the limit, the compiler's recursion limit should be lifted.
+///
+/// ### Safety
+/// The inter-field form mentioned above assumes that the first field is positioned before the
+/// second.
+/// This is only guaranteed for `repr(C)` structs.
+/// Usage with `repr(Rust)` structs may yield unexpected results, like downward-going ranges,
+/// spans that include unexpected fields, empty spans, or spans that include *unexpected* padding bytes.
+///
+/// ## Examples
+/// ```
+/// use memoffset::span_of;
+///
+/// #[repr(C)]
+/// struct Florp {
+///     a: u32
+/// }
+///
+/// #[repr(C)]
+/// struct Blarg {
+///     x: [u32; 2],
+///     y: [u8; 56],
+///     z: Florp,
+///     egg: [[u8; 4]; 4]
+/// }
+///
+/// assert_eq!(0..84,  span_of!(Blarg, ..));
+/// assert_eq!(0..8,   span_of!(Blarg, .. y));
+/// assert_eq!(0..64,  span_of!(Blarg, ..= y));
+/// assert_eq!(0..8,   span_of!(Blarg, x));
+/// assert_eq!(8..84,  span_of!(Blarg, y ..));
+/// assert_eq!(0..8,   span_of!(Blarg, x .. y));
+/// assert_eq!(0..64,  span_of!(Blarg, x ..= y));
+/// ```
+#[macro_export(local_inner_macros)]
+macro_rules! span_of {
+    (@helper  $root:ident, [] ..=) => {
+        _memoffset__compile_error!("Expected a range, found '..='")
+    };
+    (@helper $root:ident, [] ..) => {
+        _memoffset__compile_error!("Expected a range, found '..'")
+    };
+    // No explicit begin for range.
+    (@helper $root:ident, $parent:path, [] ..) => {{
+        ($root as usize,
+         $root as usize + $crate::__priv::size_of_pointee($root))
+    }};
+    (@helper $root:ident, $parent:path, [] ..= $end:tt) => {{
+        let end = raw_field!($root, $parent, $end);
+        ($root as usize, end as usize + $crate::__priv::size_of_pointee(end))
+    }};
+    (@helper $root:ident, $parent:path, [] .. $end:tt) => {{
+        ($root as usize, raw_field!($root, $parent, $end) as usize)
+    }};
+    // Explicit begin and end for range.
+    (@helper $root:ident, $parent:path, # $begin:tt [] ..= $end:tt) => {{
+        let begin = raw_field!($root, $parent, $begin);
+        let end = raw_field!($root, $parent, $end);
+        (begin as usize, end as usize + $crate::__priv::size_of_pointee(end))
+    }};
+    (@helper $root:ident, $parent:path, # $begin:tt [] .. $end:tt) => {{
+        (raw_field!($root, $parent, $begin) as usize,
+         raw_field!($root, $parent, $end) as usize)
+    }};
+    // No explicit end for range.
+    (@helper $root:ident, $parent:path, # $begin:tt [] ..) => {{
+        (raw_field!($root, $parent, $begin) as usize,
+         $root as usize + $crate::__priv::size_of_pointee($root))
+    }};
+    (@helper $root:ident, $parent:path, # $begin:tt [] ..=) => {{
+        _memoffset__compile_error!(
+            "Found inclusive range to the end of a struct. Did you mean '..' instead of '..='?")
+    }};
+    // Just one field.
+    (@helper $root:ident, $parent:path, # $field:tt []) => {{
+        let field = raw_field!($root, $parent, $field);
+        (field as usize, field as usize + $crate::__priv::size_of_pointee(field))
+    }};
+    // Parsing.
+    (@helper $root:ident, $parent:path, $(# $begin:tt)+ [] $tt:tt $($rest:tt)*) => {{
+        span_of!(@helper $root, $parent, $(#$begin)* #$tt [] $($rest)*)
+    }};
+    (@helper $root:ident, $parent:path, [] $tt:tt $($rest:tt)*) => {{
+        span_of!(@helper $root, $parent, #$tt [] $($rest)*)
+    }};
+
+    // Entry point.
+    ($sty:path, $($exp:tt)+) => ({
+        // Get a base pointer.
+        _memoffset__let_base_ptr!(root, $sty);
+        let base = root as usize;
+        let (begin, end) = span_of!(@helper root, $sty, [] $($exp)*);
+        begin-base..end-base
+    });
+}
+
+#[cfg(test)]
+mod tests {
+    use core::mem;
+
+    #[test]
+    fn span_simple() {
+        #[repr(C)]
+        struct Foo {
+            a: u32,
+            b: [u8; 2],
+            c: i64,
+        }
+
+        assert_eq!(span_of!(Foo, a), 0..4);
+        assert_eq!(span_of!(Foo, b), 4..6);
+        assert_eq!(span_of!(Foo, c), 8..8 + 8);
+    }
+
+    #[test]
+    #[cfg_attr(miri, ignore)] // this creates unaligned references
+    fn span_simple_packed() {
+        #[repr(C, packed)]
+        struct Foo {
+            a: u32,
+            b: [u8; 2],
+            c: i64,
+        }
+
+        assert_eq!(span_of!(Foo, a), 0..4);
+        assert_eq!(span_of!(Foo, b), 4..6);
+        assert_eq!(span_of!(Foo, c), 6..6 + 8);
+    }
+
+    #[test]
+    fn span_forms() {
+        #[repr(C)]
+        struct Florp {
+            a: u32,
+        }
+
+        #[repr(C)]
+        struct Blarg {
+            x: u64,
+            y: [u8; 56],
+            z: Florp,
+            egg: [[u8; 4]; 5],
+        }
+
+        // Love me some brute force
+        assert_eq!(0..8, span_of!(Blarg, x));
+        assert_eq!(64..68, span_of!(Blarg, z));
+        assert_eq!(68..mem::size_of::<Blarg>(), span_of!(Blarg, egg));
+
+        assert_eq!(8..64, span_of!(Blarg, y..z));
+        assert_eq!(0..64, span_of!(Blarg, x..=y));
+    }
+
+    #[test]
+    fn ig_test() {
+        #[repr(C)]
+        struct Member {
+            foo: u32,
+        }
+
+        #[repr(C)]
+        struct Test {
+            x: u64,
+            y: [u8; 56],
+            z: Member,
+            egg: [[u8; 4]; 4],
+        }
+
+        assert_eq!(span_of!(Test, ..x), 0..0);
+        assert_eq!(span_of!(Test, ..=x), 0..8);
+        assert_eq!(span_of!(Test, ..y), 0..8);
+        assert_eq!(span_of!(Test, ..=y), 0..64);
+        assert_eq!(span_of!(Test, ..z), 0..64);
+        assert_eq!(span_of!(Test, ..=z), 0..68);
+        assert_eq!(span_of!(Test, ..egg), 0..68);
+        assert_eq!(span_of!(Test, ..=egg), 0..84);
+        assert_eq!(span_of!(Test, ..), 0..mem::size_of::<Test>());
+        assert_eq!(
+            span_of!(Test, x..),
+            offset_of!(Test, x)..mem::size_of::<Test>()
+        );
+        assert_eq!(
+            span_of!(Test, y..),
+            offset_of!(Test, y)..mem::size_of::<Test>()
+        );
+
+        assert_eq!(
+            span_of!(Test, z..),
+            offset_of!(Test, z)..mem::size_of::<Test>()
+        );
+        assert_eq!(
+            span_of!(Test, egg..),
+            offset_of!(Test, egg)..mem::size_of::<Test>()
+        );
+        assert_eq!(
+            span_of!(Test, x..y),
+            offset_of!(Test, x)..offset_of!(Test, y)
+        );
+        assert_eq!(
+            span_of!(Test, x..=y),
+            offset_of!(Test, x)..offset_of!(Test, y) + mem::size_of::<[u8; 56]>()
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/once_cell/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/once_cell/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/once_cell/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"CHANGELOG.md":"cc4e490ceb3a92be753f3ffee297921a341faf67b304e1e0e63833aba4c3d529","Cargo.lock":"57fb641115940cc1870a3460ebb53ca921461c38894a68e62bf0fc4438825fa8","Cargo.toml":"b0c4dcab027bb78093c9cd0e643b778303bb113fed7f3ab251252141d2b6735d","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"2331182c8b5a6971fd0d04a0ca711d5839e93b3de6b2003108940a8c93850aaf","bors.toml":"ebd69f714a49dceb8fd10ebadfea6e2767be4732fdef49eddf6239151b4bc78c","examples/bench.rs":"1597a52529f75d6c5ad0b86759a775b1d723dfa810e2016317283b13594219da","examples/bench_acquire.rs":"9f4912ca262194cb55e893c33739c85c2f4868d07905b9dd3238552b6ce8a6e4","examples/lazy_static.rs":"8bca1b264da21eceb1ccaf30477fc941bc71bedd030f1c6982ed3a7804abfb4f","examples/reentrant_init_deadlocks.rs":"ff84929de27a848e5b155549caa96db5db5f030afca975f8ba3f3da640083001","examples/regex.rs":"4a2e0fb093c7f5bbe0fff8689fc0c670c5334344a1bfda376f5faa98a05d459f","examples/test_synchronization.rs":"88abd5c16275bb2f2d77eaecf369d97681404a77b8edd0021f24bfd377c46be3","src/imp_cs.rs":"32ee2c252d176726e62cf1f81a270d3738cb06784c47d4064e62350d9f7672cd","src/imp_pl.rs":"6a97f60a91ab44192dcaf028e987f6be0328b5d4d69216dcdaec93bc39401f68","src/imp_std.rs":"1c130f83be5c1360dfd379911f97797c1e4c730b845f465c8c2630467ca317d2","src/lib.rs":"60fe685113e11203ec32876b5dad9c8e1eb705da5854eff8f044d3f4651a7d0f","src/race.rs":"e8400987cc44b3e4b1a321d1e0506df07be7034a7d1c16be641dc75b44fee05c","tests/it/main.rs":"e6e9987e053af84b9d76052602995b1e777efb5bc06cd5f49009e6f03b18626c","tests/it/race.rs":"8dfe38563b6d0be890ab076be1fc1122d41a7c7792354cd7f60bc4454666b968","tests/it/race_once_box.rs":"1c2fe9e2988ec38d60c93c797fceb4c7a65d1b2e48a6a1e78db78ab91388e844","tests/it/sync_lazy.rs":"a36c5d66340b3d6d20aad331a499858a2125dfdfd624c5bf3b4b06a0b157c75c","tests/it/sync_once_cell.rs":"0d04beeb394eb53dd3fc0309fcfc382d56350e72b89d22356e0047d6c7bfef58","tests/it/unsync_lazy.rs":"51a1ffd411770d1e32399ec23feb5f61be362bbed34e100eb7509f8496224e1a","tests/it/unsync_once_cell.rs":"82b72936d7bd4090db25cfc543c01ef3206d6917ac56f09d17d4110a65deb30a"},"package":"3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/once_cell/CHANGELOG.md 43.0.0-1ubuntu1/rust-vendor/once_cell/CHANGELOG.md
--- 43.0.0-1/rust-vendor/once_cell/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,229 @@
+# Changelog
+
+## Unreleased
+
+- 
+
+## 1.19.0
+
+- Use `portable-atomic` instead of `atomic-polyfill`, [#251](https://github.com/matklad/once_cell/pull/251).
+
+## 1.18.0
+
+- `MSRV` is updated to 1.60.0 to take advantage of `dep:` syntax for cargo features,
+  removing "implementation details" from publicly visible surface.
+
+## 1.17.2
+
+- Avoid unnecessary synchronization in `Lazy::{force,deref}_mut()`, [#231](https://github.com/matklad/once_cell/pull/231).
+
+## 1.17.1
+
+- Make `OnceRef` implementation compliant with [strict provenance](https://github.com/rust-lang/rust/issues/95228).
+
+## 1.17.0
+
+- Add `race::OnceRef` for storing a `&'a T`.
+
+## 1.16.0
+
+- Add `no_std` implementation based on `critical-section`,
+  [#195](https://github.com/matklad/once_cell/pull/195).
+- Deprecate `atomic-polyfill` feature (use the new `critical-section` instead)
+
+## 1.15.0
+
+- Increase minimal supported Rust version to 1.56.0.
+- Implement `UnwindSafe` even if the `std` feature is disabled.
+
+## 1.14.0
+
+- Add extension to `unsync` and `sync` `Lazy` mut API:
+  - `force_mut`
+  - `get_mut`
+
+
+## 1.13.1
+
+- Make implementation compliant with [strict provenance](https://github.com/rust-lang/rust/issues/95228).
+- Upgrade `atomic-polyfill` to `1.0`
+
+## 1.13.0
+
+- Add `Lazy::get`, similar to `OnceCell::get`.
+
+## 1.12.1
+
+- Remove incorrect `debug_assert`.
+
+## 1.12.0
+
+- Add `OnceCell::wait`, a blocking variant of `get`.
+
+## 1.11.0
+
+- Add `OnceCell::with_value` to create initialized `OnceCell` in `const` context.
+- Improve `Clone` implementation for `OnceCell`.
+- Rewrite `parking_lot` version on top of `parking_lot_core`, for even smaller cells!
+
+## 1.10.0
+
+- upgrade `parking_lot` to `0.12.0` (note that this bumps MSRV with `parking_lot` feature enabled to `1.49.0`).
+
+## 1.9.0
+
+- Added an `atomic-polyfill` optional dependency to compile `race` on platforms without atomics
+
+## 1.8.0
+
+- Add `try_insert` API -- a version of `set` that returns a reference.
+
+## 1.7.2
+
+- Improve code size when using parking_lot feature.
+
+## 1.7.1
+
+- Fix `race::OnceBox<T>` to also impl `Default` even if `T` doesn't impl `Default`.
+
+## 1.7.0
+
+- Hide the `race` module behind (default) `race` feature.
+  Turns out that adding `race` by default was a breaking change on some platforms without atomics.
+  In this release, we make the module opt-out.
+  Technically, this is a breaking change for those who use `race` with `no_default_features`.
+  Given that the `race` module itself only several days old, the breakage is deemed acceptable.
+
+## 1.6.0
+
+- Add `Lazy::into_value`
+- Stabilize `once_cell::race` module for "first one wins" no_std-compatible initialization flavor.
+- Migrate from deprecated `compare_and_swap` to `compare_exchange`.
+
+## 1.5.2
+
+- `OnceBox` API uses `Box<T>`.
+  This a breaking change to unstable API.
+
+## 1.5.1
+
+- MSRV is increased to `1.36.0`.
+- document `once_cell::race` module.
+- introduce `alloc` feature for `OnceBox`.
+- fix `OnceBox::set`.
+
+## 1.5.0
+
+- add new `once_cell::race` module for "first one wins" no_std-compatible initialization flavor.
+  The API is provisional, subject to change and is gated by the `unstable` cargo feature.
+
+## 1.4.1
+
+- upgrade `parking_lot` to `0.11.0`
+- make `sync::OnceCell<T>` pass https://doc.rust-lang.org/nomicon/dropck.html#an-escape-hatch[dropck] with `parking_lot` feature enabled.
+  This fixes a (minor) semver-incompatible changed introduced in `1.4.0`
+
+## 1.4.0
+
+- upgrade `parking_lot` to `0.10` (note that this bumps MSRV with `parking_lot` feature enabled to `1.36.0`).
+- add `OnceCell::take`.
+- upgrade crossbeam utils (private dependency) to `0.7`.
+
+## 1.3.1
+
+- remove unnecessary `F: fmt::Debug` bound from `impl fmt::Debug for Lazy<T, F>`.
+
+## 1.3.0
+
+- `Lazy<T>` now implements `DerefMut`.
+- update implementation according to the latest changes in `std`.
+
+## 1.2.0
+
+- add `sync::OnceCell::get_unchecked`.
+
+## 1.1.0
+
+- implement `Default` for `Lazy`: it creates an empty `Lazy<T>` which is initialized with `T::default` on first access.
+- add `OnceCell::get_mut`.
+
+## 1.0.2
+
+- actually add `#![no_std]` attribute if std feature is not enabled.
+
+## 1.0.1
+
+- fix unsoundness in `Lazy<T>` if the initializing function panics. Thanks [@xfix](https://github.com/xfix)!
+- implement `RefUnwindSafe` for `Lazy`.
+- share more code between `std` and `parking_lot` implementations.
+- add F.A.Q section to the docs.
+
+## 1.0.0
+
+- remove `parking_lot` from the list of default features.
+- add `std` default feature. Without `std`, only `unsync` module is supported.
+- implement `Eq` for `OnceCell`.
+- fix wrong `Sync` bound on `sync::Lazy`.
+- run the whole test suite with miri.
+
+## 0.2.7
+
+- New implementation of `sync::OnceCell` if `parking_lot` feature is disabled.
+  It now employs a hand-rolled variant of `std::sync::Once`.
+- `sync::OnceCell::get_or_try_init` works without `parking_lot` as well!
+- document the effects of `parking_lot` feature: same performance but smaller types.
+
+## 0.2.6
+
+- Updated `Lazy`'s `Deref` impl to requires only `FnOnce` instead of `Fn`
+
+## 0.2.5
+
+- `Lazy` requires only `FnOnce` instead of `Fn`
+
+## 0.2.4
+
+- nicer `fmt::Debug` implementation
+
+## 0.2.3
+
+- update `parking_lot` to `0.9.0`
+- fix stacked borrows violation in `unsync::OnceCell::get`
+- implement `Clone` for `sync::OnceCell<T> where T: Clone`
+
+## 0.2.2
+
+- add `OnceCell::into_inner` which consumes a cell and returns an option
+
+## 0.2.1
+
+- implement `sync::OnceCell::get_or_try_init` if `parking_lot` feature is enabled
+- switch internal `unsafe` implementation of `sync::OnceCell` from `Once` to `Mutex`
+- `sync::OnceCell::get_or_init` is twice as fast if cell is already initialized
+- implement `std::panic::RefUnwindSafe` and `std::panic::UnwindSafe` for `OnceCell`
+- better document behavior around panics
+
+## 0.2.0
+
+- MSRV is now 1.31.1
+- `Lazy::new` and `OnceCell::new` are now const-fns
+- `unsync_lazy` and `sync_lazy` macros are removed
+
+## 0.1.8
+
+- update crossbeam-utils to 0.6
+- enable bors-ng
+
+## 0.1.7
+
+- cells implement `PartialEq` and `From`
+- MSRV is down to 1.24.1
+- update `parking_lot` to `0.7.1`
+
+## 0.1.6
+
+- `unsync::OnceCell<T>` is `Clone` if `T` is `Clone`.
+
+## 0.1.5
+
+- No changelog until this point :(
diff -pruN 43.0.0-1/rust-vendor/once_cell/Cargo.lock 43.0.0-1ubuntu1/rust-vendor/once_cell/Cargo.lock
--- 43.0.0-1/rust-vendor/once_cell/Cargo.lock	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/Cargo.lock	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,169 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "aho-corasick"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "bitflags"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "critical-section"
+version = "1.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6548a0ad5d2549e111e1f6a11a6c2e2d00ce6a3dafe22948d67c2b443f775e52"
+
+[[package]]
+name = "libc"
+version = "0.2.144"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1"
+
+[[package]]
+name = "memchr"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
+
+[[package]]
+name = "once_cell"
+version = "1.19.0"
+dependencies = [
+ "critical-section",
+ "parking_lot_core",
+ "portable-atomic",
+ "regex",
+]
+
+[[package]]
+name = "parking_lot_core"
+version = "0.9.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "redox_syscall",
+ "smallvec",
+ "windows-sys",
+]
+
+[[package]]
+name = "portable-atomic"
+version = "1.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0"
+
+[[package]]
+name = "redox_syscall"
+version = "0.2.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
+dependencies = [
+ "bitflags",
+]
+
+[[package]]
+name = "regex"
+version = "1.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.7.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78"
+
+[[package]]
+name = "smallvec"
+version = "1.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
+
+[[package]]
+name = "windows-sys"
+version = "0.45.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
+dependencies = [
+ "windows-targets",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071"
+dependencies = [
+ "windows_aarch64_gnullvm",
+ "windows_aarch64_msvc",
+ "windows_i686_gnu",
+ "windows_i686_msvc",
+ "windows_x86_64_gnu",
+ "windows_x86_64_gnullvm",
+ "windows_x86_64_msvc",
+]
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
diff -pruN 43.0.0-1/rust-vendor/once_cell/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/once_cell/Cargo.toml
--- 43.0.0-1/rust-vendor/once_cell/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,97 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2021"
+rust-version = "1.60"
+name = "once_cell"
+version = "1.19.0"
+authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
+exclude = [
+    "*.png",
+    "*.svg",
+    "/Cargo.lock.msrv",
+    "rustfmt.toml",
+]
+description = "Single assignment cells and lazy values."
+documentation = "https://docs.rs/once_cell"
+readme = "README.md"
+keywords = [
+    "lazy",
+    "static",
+]
+categories = [
+    "rust-patterns",
+    "memory-management",
+]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/matklad/once_cell"
+
+[package.metadata.docs.rs]
+all-features = true
+rustdoc-args = ["--generate-link-to-definition"]
+
+[[example]]
+name = "bench"
+required-features = ["std"]
+
+[[example]]
+name = "bench_acquire"
+required-features = ["std"]
+
+[[example]]
+name = "lazy_static"
+required-features = ["std"]
+
+[[example]]
+name = "reentrant_init_deadlocks"
+required-features = ["std"]
+
+[[example]]
+name = "regex"
+required-features = ["std"]
+
+[[example]]
+name = "test_synchronization"
+required-features = ["std"]
+
+[dependencies.critical-section]
+version = "1"
+optional = true
+
+[dependencies.parking_lot_core]
+version = "0.9.3"
+optional = true
+default_features = false
+
+[dependencies.portable-atomic]
+version = "1"
+optional = true
+
+[dev-dependencies.critical-section]
+version = "1.1.1"
+features = ["std"]
+
+[dev-dependencies.regex]
+version = "1.2.0"
+
+[features]
+alloc = ["race"]
+atomic-polyfill = ["critical-section"]
+critical-section = [
+    "dep:critical-section",
+    "portable-atomic",
+]
+default = ["std"]
+parking_lot = ["dep:parking_lot_core"]
+race = []
+std = ["alloc"]
+unstable = []
diff -pruN 43.0.0-1/rust-vendor/once_cell/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/once_cell/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/once_cell/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,201 @@
+                              Apache License
+                        Version 2.0, January 2004
+                     http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+   "License" shall mean the terms and conditions for use, reproduction,
+   and distribution as defined by Sections 1 through 9 of this document.
+
+   "Licensor" shall mean the copyright owner or entity authorized by
+   the copyright owner that is granting the License.
+
+   "Legal Entity" shall mean the union of the acting entity and all
+   other entities that control, are controlled by, or are under common
+   control with that entity. For the purposes of this definition,
+   "control" means (i) the power, direct or indirect, to cause the
+   direction or management of such entity, whether by contract or
+   otherwise, or (ii) ownership of fifty percent (50%) or more of the
+   outstanding shares, or (iii) beneficial ownership of such entity.
+
+   "You" (or "Your") shall mean an individual or Legal Entity
+   exercising permissions granted by this License.
+
+   "Source" form shall mean the preferred form for making modifications,
+   including but not limited to software source code, documentation
+   source, and configuration files.
+
+   "Object" form shall mean any form resulting from mechanical
+   transformation or translation of a Source form, including but
+   not limited to compiled object code, generated documentation,
+   and conversions to other media types.
+
+   "Work" shall mean the work of authorship, whether in Source or
+   Object form, made available under the License, as indicated by a
+   copyright notice that is included in or attached to the work
+   (an example is provided in the Appendix below).
+
+   "Derivative Works" shall mean any work, whether in Source or Object
+   form, that is based on (or derived from) the Work and for which the
+   editorial revisions, annotations, elaborations, or other modifications
+   represent, as a whole, an original work of authorship. For the purposes
+   of this License, Derivative Works shall not include works that remain
+   separable from, or merely link (or bind by name) to the interfaces of,
+   the Work and Derivative Works thereof.
+
+   "Contribution" shall mean any work of authorship, including
+   the original version of the Work and any modifications or additions
+   to that Work or Derivative Works thereof, that is intentionally
+   submitted to Licensor for inclusion in the Work by the copyright owner
+   or by an individual or Legal Entity authorized to submit on behalf of
+   the copyright owner. For the purposes of this definition, "submitted"
+   means any form of electronic, verbal, or written communication sent
+   to the Licensor or its representatives, including but not limited to
+   communication on electronic mailing lists, source code control systems,
+   and issue tracking systems that are managed by, or on behalf of, the
+   Licensor for the purpose of discussing and improving the Work, but
+   excluding communication that is conspicuously marked or otherwise
+   designated in writing by the copyright owner as "Not a Contribution."
+
+   "Contributor" shall mean Licensor and any individual or Legal Entity
+   on behalf of whom a Contribution has been received by Licensor and
+   subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   copyright license to reproduce, prepare Derivative Works of,
+   publicly display, publicly perform, sublicense, and distribute the
+   Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   (except as stated in this section) patent license to make, have made,
+   use, offer to sell, sell, import, and otherwise transfer the Work,
+   where such license applies only to those patent claims licensable
+   by such Contributor that are necessarily infringed by their
+   Contribution(s) alone or by combination of their Contribution(s)
+   with the Work to which such Contribution(s) was submitted. If You
+   institute patent litigation against any entity (including a
+   cross-claim or counterclaim in a lawsuit) alleging that the Work
+   or a Contribution incorporated within the Work constitutes direct
+   or contributory patent infringement, then any patent licenses
+   granted to You under this License for that Work shall terminate
+   as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+   Work or Derivative Works thereof in any medium, with or without
+   modifications, and in Source or Object form, provided that You
+   meet the following conditions:
+
+   (a) You must give any other recipients of the Work or
+       Derivative Works a copy of this License; and
+
+   (b) You must cause any modified files to carry prominent notices
+       stating that You changed the files; and
+
+   (c) You must retain, in the Source form of any Derivative Works
+       that You distribute, all copyright, patent, trademark, and
+       attribution notices from the Source form of the Work,
+       excluding those notices that do not pertain to any part of
+       the Derivative Works; and
+
+   (d) If the Work includes a "NOTICE" text file as part of its
+       distribution, then any Derivative Works that You distribute must
+       include a readable copy of the attribution notices contained
+       within such NOTICE file, excluding those notices that do not
+       pertain to any part of the Derivative Works, in at least one
+       of the following places: within a NOTICE text file distributed
+       as part of the Derivative Works; within the Source form or
+       documentation, if provided along with the Derivative Works; or,
+       within a display generated by the Derivative Works, if and
+       wherever such third-party notices normally appear. The contents
+       of the NOTICE file are for informational purposes only and
+       do not modify the License. You may add Your own attribution
+       notices within Derivative Works that You distribute, alongside
+       or as an addendum to the NOTICE text from the Work, provided
+       that such additional attribution notices cannot be construed
+       as modifying the License.
+
+   You may add Your own copyright statement to Your modifications and
+   may provide additional or different license terms and conditions
+   for use, reproduction, or distribution of Your modifications, or
+   for any such Derivative Works as a whole, provided Your use,
+   reproduction, and distribution of the Work otherwise complies with
+   the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+   any Contribution intentionally submitted for inclusion in the Work
+   by You to the Licensor shall be under the terms and conditions of
+   this License, without any additional terms or conditions.
+   Notwithstanding the above, nothing herein shall supersede or modify
+   the terms of any separate license agreement you may have executed
+   with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+   names, trademarks, service marks, or product names of the Licensor,
+   except as required for reasonable and customary use in describing the
+   origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+   agreed to in writing, Licensor provides the Work (and each
+   Contributor provides its Contributions) on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+   implied, including, without limitation, any warranties or conditions
+   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+   PARTICULAR PURPOSE. You are solely responsible for determining the
+   appropriateness of using or redistributing the Work and assume any
+   risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+   whether in tort (including negligence), contract, or otherwise,
+   unless required by applicable law (such as deliberate and grossly
+   negligent acts) or agreed to in writing, shall any Contributor be
+   liable to You for damages, including any direct, indirect, special,
+   incidental, or consequential damages of any character arising as a
+   result of this License or out of the use or inability to use the
+   Work (including but not limited to damages for loss of goodwill,
+   work stoppage, computer failure or malfunction, or any and all
+   other commercial damages or losses), even if such Contributor
+   has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+   the Work or Derivative Works thereof, You may choose to offer,
+   and charge a fee for, acceptance of support, warranty, indemnity,
+   or other liability obligations and/or rights consistent with this
+   License. However, in accepting such obligations, You may act only
+   on Your own behalf and on Your sole responsibility, not on behalf
+   of any other Contributor, and only if You agree to indemnify,
+   defend, and hold each Contributor harmless for any liability
+   incurred by, or claims asserted against, such Contributor by reason
+   of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+   To apply the Apache License to your work, attach the following
+   boilerplate notice, with the fields enclosed by brackets "[]"
+   replaced with your own identifying information. (Don't include
+   the brackets!)  The text should be enclosed in the appropriate
+   comment syntax for the file format. We also recommend that a
+   file or class name and description of purpose be included on the
+   same "printed page" as the copyright notice for easier
+   identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+	http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff -pruN 43.0.0-1/rust-vendor/once_cell/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/once_cell/LICENSE-MIT
--- 43.0.0-1/rust-vendor/once_cell/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,23 @@
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/once_cell/README.md 43.0.0-1ubuntu1/rust-vendor/once_cell/README.md
--- 43.0.0-1/rust-vendor/once_cell/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,57 @@
+<p align="center"><img src="design/logo.png" alt="once_cell"></p>
+
+
+[![Build Status](https://github.com/matklad/once_cell/actions/workflows/ci.yaml/badge.svg)](https://github.com/matklad/once_cell/actions)
+[![Crates.io](https://img.shields.io/crates/v/once_cell.svg)](https://crates.io/crates/once_cell)
+[![API reference](https://docs.rs/once_cell/badge.svg)](https://docs.rs/once_cell/)
+
+# Overview
+
+`once_cell` provides two new cell-like types, `unsync::OnceCell` and `sync::OnceCell`. `OnceCell`
+might store arbitrary non-`Copy` types, can be assigned to at most once and provide direct access
+to the stored contents. In a nutshell, API looks *roughly* like this:
+
+```rust
+impl OnceCell<T> {
+    fn new() -> OnceCell<T> { ... }
+    fn set(&self, value: T) -> Result<(), T> { ... }
+    fn get(&self) -> Option<&T> { ... }
+}
+```
+
+Note that, like with `RefCell` and `Mutex`, the `set` method requires only a shared reference.
+Because of the single assignment restriction `get` can return an `&T` instead of `Ref<T>`
+or `MutexGuard<T>`.
+
+`once_cell` also has a `Lazy<T>` type, build on top of `OnceCell` which provides the same API as
+the `lazy_static!` macro, but without using any macros:
+
+```rust
+use std::{sync::Mutex, collections::HashMap};
+use once_cell::sync::Lazy;
+
+static GLOBAL_DATA: Lazy<Mutex<HashMap<i32, String>>> = Lazy::new(|| {
+    let mut m = HashMap::new();
+    m.insert(13, "Spica".to_string());
+    m.insert(74, "Hoyten".to_string());
+    Mutex::new(m)
+});
+
+fn main() {
+    println!("{:?}", GLOBAL_DATA.lock().unwrap());
+}
+```
+
+More patterns and use-cases are in the [docs](https://docs.rs/once_cell/)!
+
+# Related crates
+
+* [double-checked-cell](https://github.com/niklasf/double-checked-cell)
+* [lazy-init](https://crates.io/crates/lazy-init)
+* [lazycell](https://crates.io/crates/lazycell)
+* [mitochondria](https://crates.io/crates/mitochondria)
+* [lazy_static](https://crates.io/crates/lazy_static)
+* [async_once_cell](https://crates.io/crates/async_once_cell)
+* [generic_once_cell](https://crates.io/crates/generic_once_cell) (bring your own mutex)
+
+Parts of `once_cell` API are included into `std` [as of Rust 1.70.0](https://github.com/rust-lang/rust/pull/105587).
diff -pruN 43.0.0-1/rust-vendor/once_cell/bors.toml 43.0.0-1ubuntu1/rust-vendor/once_cell/bors.toml
--- 43.0.0-1/rust-vendor/once_cell/bors.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/bors.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,2 @@
+status = [ "Rust" ]
+delete_merged_branches = true
diff -pruN 43.0.0-1/rust-vendor/once_cell/examples/bench.rs 43.0.0-1ubuntu1/rust-vendor/once_cell/examples/bench.rs
--- 43.0.0-1/rust-vendor/once_cell/examples/bench.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/examples/bench.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,28 @@
+use std::mem::size_of;
+
+use once_cell::sync::OnceCell;
+
+const N_THREADS: usize = 32;
+const N_ROUNDS: usize = 100_000_000;
+
+static CELL: OnceCell<usize> = OnceCell::new();
+
+fn main() {
+    let start = std::time::Instant::now();
+    let threads =
+        (0..N_THREADS).map(|i| std::thread::spawn(move || thread_main(i))).collect::<Vec<_>>();
+    for thread in threads {
+        thread.join().unwrap();
+    }
+    println!("{:?}", start.elapsed());
+    println!("size_of::<OnceCell<()>>()   = {:?}", size_of::<OnceCell<()>>());
+    println!("size_of::<OnceCell<bool>>() = {:?}", size_of::<OnceCell<bool>>());
+    println!("size_of::<OnceCell<u32>>()  = {:?}", size_of::<OnceCell<u32>>());
+}
+
+fn thread_main(i: usize) {
+    for _ in 0..N_ROUNDS {
+        let &value = CELL.get_or_init(|| i);
+        assert!(value < N_THREADS)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/once_cell/examples/bench_acquire.rs 43.0.0-1ubuntu1/rust-vendor/once_cell/examples/bench_acquire.rs
--- 43.0.0-1/rust-vendor/once_cell/examples/bench_acquire.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/examples/bench_acquire.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,39 @@
+//! Benchmark the overhead that the synchronization of `OnceCell::get` causes.
+//! We do some other operations that write to memory to get an imprecise but somewhat realistic
+//! measurement.
+
+use once_cell::sync::OnceCell;
+use std::sync::atomic::{AtomicUsize, Ordering};
+
+const N_THREADS: usize = 16;
+const N_ROUNDS: usize = 1_000_000;
+
+static CELL: OnceCell<usize> = OnceCell::new();
+static OTHER: AtomicUsize = AtomicUsize::new(0);
+
+fn main() {
+    let start = std::time::Instant::now();
+    let threads =
+        (0..N_THREADS).map(|i| std::thread::spawn(move || thread_main(i))).collect::<Vec<_>>();
+    for thread in threads {
+        thread.join().unwrap();
+    }
+    println!("{:?}", start.elapsed());
+    println!("{:?}", OTHER.load(Ordering::Relaxed));
+}
+
+#[inline(never)]
+fn thread_main(i: usize) {
+    // The operations we do here don't really matter, as long as we do multiple writes, and
+    // everything is messy enough to prevent the compiler from optimizing the loop away.
+    let mut data = [i; 128];
+    let mut accum = 0usize;
+    for _ in 0..N_ROUNDS {
+        let _value = CELL.get_or_init(|| i + 1);
+        let k = OTHER.fetch_add(data[accum & 0x7F] as usize, Ordering::Relaxed);
+        for j in data.iter_mut() {
+            *j = (*j).wrapping_add(accum);
+            accum = accum.wrapping_add(k);
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/once_cell/examples/lazy_static.rs 43.0.0-1ubuntu1/rust-vendor/once_cell/examples/lazy_static.rs
--- 43.0.0-1/rust-vendor/once_cell/examples/lazy_static.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/examples/lazy_static.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,36 @@
+extern crate once_cell;
+
+use once_cell::sync::{Lazy, OnceCell};
+use std::collections::HashMap;
+
+static HASHMAP: Lazy<HashMap<u32, &'static str>> = Lazy::new(|| {
+    let mut m = HashMap::new();
+    m.insert(0, "foo");
+    m.insert(1, "bar");
+    m.insert(2, "baz");
+    m
+});
+
+// Same, but completely without macros
+fn hashmap() -> &'static HashMap<u32, &'static str> {
+    static INSTANCE: OnceCell<HashMap<u32, &'static str>> = OnceCell::new();
+    INSTANCE.get_or_init(|| {
+        let mut m = HashMap::new();
+        m.insert(0, "foo");
+        m.insert(1, "bar");
+        m.insert(2, "baz");
+        m
+    })
+}
+
+fn main() {
+    // First access to `HASHMAP` initializes it
+    println!("The entry for `0` is \"{}\".", HASHMAP.get(&0).unwrap());
+
+    // Any further access to `HASHMAP` just returns the computed value
+    println!("The entry for `1` is \"{}\".", HASHMAP.get(&1).unwrap());
+
+    // The same works for function-style:
+    assert_eq!(hashmap().get(&0), Some(&"foo"));
+    assert_eq!(hashmap().get(&1), Some(&"bar"));
+}
diff -pruN 43.0.0-1/rust-vendor/once_cell/examples/reentrant_init_deadlocks.rs 43.0.0-1ubuntu1/rust-vendor/once_cell/examples/reentrant_init_deadlocks.rs
--- 43.0.0-1/rust-vendor/once_cell/examples/reentrant_init_deadlocks.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/examples/reentrant_init_deadlocks.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,14 @@
+fn main() {
+    let cell = once_cell::sync::OnceCell::<u32>::new();
+    cell.get_or_init(|| {
+        cell.get_or_init(|| 1);
+        2
+    });
+}
+
+/// Dummy test to make it seem hang when compiled as `--test`
+/// See https://github.com/matklad/once_cell/issues/79
+#[test]
+fn dummy_test() {
+    std::thread::sleep(std::time::Duration::from_secs(4));
+}
diff -pruN 43.0.0-1/rust-vendor/once_cell/examples/regex.rs 43.0.0-1ubuntu1/rust-vendor/once_cell/examples/regex.rs
--- 43.0.0-1/rust-vendor/once_cell/examples/regex.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/examples/regex.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,49 @@
+use std::{str::FromStr, time::Instant};
+
+use regex::Regex;
+
+macro_rules! regex {
+    ($re:literal $(,)?) => {{
+        static RE: once_cell::sync::OnceCell<regex::Regex> = once_cell::sync::OnceCell::new();
+        RE.get_or_init(|| regex::Regex::new($re).unwrap())
+    }};
+}
+
+fn slow() {
+    let s = r##"13.28.24.13 - - [10/Mar/2016:19:29:25 +0100] "GET /etc/lib/pChart2/examples/index.php?Action=View&Script=../../../../cnf/db.php HTTP/1.1" 404 151 "-" "HTTP_Request2/2.2.1 (http://pear.php.net/package/http_request2) PHP/5.3.16""##;
+
+    let mut total = 0;
+    for _ in 0..1000 {
+        let re = Regex::new(
+            r##"^(\S+) (\S+) (\S+) \[([^]]+)\] "([^"]*)" (\d+) (\d+) "([^"]*)" "([^"]*)"$"##,
+        )
+        .unwrap();
+        let size = usize::from_str(re.captures(s).unwrap().get(7).unwrap().as_str()).unwrap();
+        total += size;
+    }
+    println!("{}", total);
+}
+
+fn fast() {
+    let s = r##"13.28.24.13 - - [10/Mar/2016:19:29:25 +0100] "GET /etc/lib/pChart2/examples/index.php?Action=View&Script=../../../../cnf/db.php HTTP/1.1" 404 151 "-" "HTTP_Request2/2.2.1 (http://pear.php.net/package/http_request2) PHP/5.3.16""##;
+
+    let mut total = 0;
+    for _ in 0..1000 {
+        let re: &Regex = regex!(
+            r##"^(\S+) (\S+) (\S+) \[([^]]+)\] "([^"]*)" (\d+) (\d+) "([^"]*)" "([^"]*)"$"##,
+        );
+        let size = usize::from_str(re.captures(s).unwrap().get(7).unwrap().as_str()).unwrap();
+        total += size;
+    }
+    println!("{}", total);
+}
+
+fn main() {
+    let t = Instant::now();
+    slow();
+    println!("slow: {:?}", t.elapsed());
+
+    let t = Instant::now();
+    fast();
+    println!("fast: {:?}", t.elapsed());
+}
diff -pruN 43.0.0-1/rust-vendor/once_cell/examples/test_synchronization.rs 43.0.0-1ubuntu1/rust-vendor/once_cell/examples/test_synchronization.rs
--- 43.0.0-1/rust-vendor/once_cell/examples/test_synchronization.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/examples/test_synchronization.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,38 @@
+//! Test if the OnceCell properly synchronizes.
+//! Needs to be run in release mode.
+//!
+//! We create a `Vec` with `N_ROUNDS` of `OnceCell`s. All threads will walk the `Vec`, and race to
+//! be the first one to initialize a cell.
+//! Every thread adds the results of the cells it sees to an accumulator, which is compared at the
+//! end.
+//! All threads should end up with the same result.
+
+use once_cell::sync::OnceCell;
+
+const N_THREADS: usize = 32;
+const N_ROUNDS: usize = 1_000_000;
+
+static CELLS: OnceCell<Vec<OnceCell<usize>>> = OnceCell::new();
+static RESULT: OnceCell<usize> = OnceCell::new();
+
+fn main() {
+    let start = std::time::Instant::now();
+    CELLS.get_or_init(|| vec![OnceCell::new(); N_ROUNDS]);
+    let threads =
+        (0..N_THREADS).map(|i| std::thread::spawn(move || thread_main(i))).collect::<Vec<_>>();
+    for thread in threads {
+        thread.join().unwrap();
+    }
+    println!("{:?}", start.elapsed());
+    println!("No races detected");
+}
+
+fn thread_main(i: usize) {
+    let cells = CELLS.get().unwrap();
+    let mut accum = 0;
+    for cell in cells.iter() {
+        let &value = cell.get_or_init(|| i);
+        accum += value;
+    }
+    assert_eq!(RESULT.get_or_init(|| accum), &accum);
+}
diff -pruN 43.0.0-1/rust-vendor/once_cell/src/imp_cs.rs 43.0.0-1ubuntu1/rust-vendor/once_cell/src/imp_cs.rs
--- 43.0.0-1/rust-vendor/once_cell/src/imp_cs.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/src/imp_cs.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,78 @@
+use core::panic::{RefUnwindSafe, UnwindSafe};
+
+use portable_atomic::{AtomicBool, Ordering};
+use critical_section::{CriticalSection, Mutex};
+
+use crate::unsync;
+
+pub(crate) struct OnceCell<T> {
+    initialized: AtomicBool,
+    // Use `unsync::OnceCell` internally since `Mutex` does not provide
+    // interior mutability and to be able to re-use `get_or_try_init`.
+    value: Mutex<unsync::OnceCell<T>>,
+}
+
+// Why do we need `T: Send`?
+// Thread A creates a `OnceCell` and shares it with
+// scoped thread B, which fills the cell, which is
+// then destroyed by A. That is, destructor observes
+// a sent value.
+unsafe impl<T: Sync + Send> Sync for OnceCell<T> {}
+unsafe impl<T: Send> Send for OnceCell<T> {}
+
+impl<T: RefUnwindSafe + UnwindSafe> RefUnwindSafe for OnceCell<T> {}
+impl<T: UnwindSafe> UnwindSafe for OnceCell<T> {}
+
+impl<T> OnceCell<T> {
+    pub(crate) const fn new() -> OnceCell<T> {
+        OnceCell { initialized: AtomicBool::new(false), value: Mutex::new(unsync::OnceCell::new()) }
+    }
+
+    pub(crate) const fn with_value(value: T) -> OnceCell<T> {
+        OnceCell {
+            initialized: AtomicBool::new(true),
+            value: Mutex::new(unsync::OnceCell::with_value(value)),
+        }
+    }
+
+    #[inline]
+    pub(crate) fn is_initialized(&self) -> bool {
+        self.initialized.load(Ordering::Acquire)
+    }
+
+    #[cold]
+    pub(crate) fn initialize<F, E>(&self, f: F) -> Result<(), E>
+    where
+        F: FnOnce() -> Result<T, E>,
+    {
+        critical_section::with(|cs| {
+            let cell = self.value.borrow(cs);
+            cell.get_or_try_init(f).map(|_| {
+                self.initialized.store(true, Ordering::Release);
+            })
+        })
+    }
+
+    /// Get the reference to the underlying value, without checking if the cell
+    /// is initialized.
+    ///
+    /// # Safety
+    ///
+    /// Caller must ensure that the cell is in initialized state, and that
+    /// the contents are acquired by (synchronized to) this thread.
+    pub(crate) unsafe fn get_unchecked(&self) -> &T {
+        debug_assert!(self.is_initialized());
+        // SAFETY: The caller ensures that the value is initialized and access synchronized.
+        self.value.borrow(CriticalSection::new()).get().unwrap_unchecked()
+    }
+
+    #[inline]
+    pub(crate) fn get_mut(&mut self) -> Option<&mut T> {
+        self.value.get_mut().get_mut()
+    }
+
+    #[inline]
+    pub(crate) fn into_inner(self) -> Option<T> {
+        self.value.into_inner().into_inner()
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/once_cell/src/imp_pl.rs 43.0.0-1ubuntu1/rust-vendor/once_cell/src/imp_pl.rs
--- 43.0.0-1/rust-vendor/once_cell/src/imp_pl.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/src/imp_pl.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,174 @@
+use std::{
+    cell::UnsafeCell,
+    panic::{RefUnwindSafe, UnwindSafe},
+    sync::atomic::{AtomicU8, Ordering},
+};
+
+pub(crate) struct OnceCell<T> {
+    state: AtomicU8,
+    value: UnsafeCell<Option<T>>,
+}
+
+const INCOMPLETE: u8 = 0x0;
+const RUNNING: u8 = 0x1;
+const COMPLETE: u8 = 0x2;
+
+// Why do we need `T: Send`?
+// Thread A creates a `OnceCell` and shares it with
+// scoped thread B, which fills the cell, which is
+// then destroyed by A. That is, destructor observes
+// a sent value.
+unsafe impl<T: Sync + Send> Sync for OnceCell<T> {}
+unsafe impl<T: Send> Send for OnceCell<T> {}
+
+impl<T: RefUnwindSafe + UnwindSafe> RefUnwindSafe for OnceCell<T> {}
+impl<T: UnwindSafe> UnwindSafe for OnceCell<T> {}
+
+impl<T> OnceCell<T> {
+    pub(crate) const fn new() -> OnceCell<T> {
+        OnceCell { state: AtomicU8::new(INCOMPLETE), value: UnsafeCell::new(None) }
+    }
+
+    pub(crate) const fn with_value(value: T) -> OnceCell<T> {
+        OnceCell { state: AtomicU8::new(COMPLETE), value: UnsafeCell::new(Some(value)) }
+    }
+
+    /// Safety: synchronizes with store to value via Release/Acquire.
+    #[inline]
+    pub(crate) fn is_initialized(&self) -> bool {
+        self.state.load(Ordering::Acquire) == COMPLETE
+    }
+
+    /// Safety: synchronizes with store to value via `is_initialized` or mutex
+    /// lock/unlock, writes value only once because of the mutex.
+    #[cold]
+    pub(crate) fn initialize<F, E>(&self, f: F) -> Result<(), E>
+    where
+        F: FnOnce() -> Result<T, E>,
+    {
+        let mut f = Some(f);
+        let mut res: Result<(), E> = Ok(());
+        let slot: *mut Option<T> = self.value.get();
+        initialize_inner(&self.state, &mut || {
+            // We are calling user-supplied function and need to be careful.
+            // - if it returns Err, we unlock mutex and return without touching anything
+            // - if it panics, we unlock mutex and propagate panic without touching anything
+            // - if it calls `set` or `get_or_try_init` re-entrantly, we get a deadlock on
+            //   mutex, which is important for safety. We *could* detect this and panic,
+            //   but that is more complicated
+            // - finally, if it returns Ok, we store the value and store the flag with
+            //   `Release`, which synchronizes with `Acquire`s.
+            let f = unsafe { f.take().unwrap_unchecked() };
+            match f() {
+                Ok(value) => unsafe {
+                    // Safe b/c we have a unique access and no panic may happen
+                    // until the cell is marked as initialized.
+                    debug_assert!((*slot).is_none());
+                    *slot = Some(value);
+                    true
+                },
+                Err(err) => {
+                    res = Err(err);
+                    false
+                }
+            }
+        });
+        res
+    }
+
+    #[cold]
+    pub(crate) fn wait(&self) {
+        let key = &self.state as *const _ as usize;
+        unsafe {
+            parking_lot_core::park(
+                key,
+                || self.state.load(Ordering::Acquire) != COMPLETE,
+                || (),
+                |_, _| (),
+                parking_lot_core::DEFAULT_PARK_TOKEN,
+                None,
+            );
+        }
+    }
+
+    /// Get the reference to the underlying value, without checking if the cell
+    /// is initialized.
+    ///
+    /// # Safety
+    ///
+    /// Caller must ensure that the cell is in initialized state, and that
+    /// the contents are acquired by (synchronized to) this thread.
+    pub(crate) unsafe fn get_unchecked(&self) -> &T {
+        debug_assert!(self.is_initialized());
+        let slot = &*self.value.get();
+        slot.as_ref().unwrap_unchecked()
+    }
+
+    /// Gets the mutable reference to the underlying value.
+    /// Returns `None` if the cell is empty.
+    pub(crate) fn get_mut(&mut self) -> Option<&mut T> {
+        // Safe b/c we have an exclusive access
+        let slot: &mut Option<T> = unsafe { &mut *self.value.get() };
+        slot.as_mut()
+    }
+
+    /// Consumes this `OnceCell`, returning the wrapped value.
+    /// Returns `None` if the cell was empty.
+    pub(crate) fn into_inner(self) -> Option<T> {
+        self.value.into_inner()
+    }
+}
+
+struct Guard<'a> {
+    state: &'a AtomicU8,
+    new_state: u8,
+}
+
+impl<'a> Drop for Guard<'a> {
+    fn drop(&mut self) {
+        self.state.store(self.new_state, Ordering::Release);
+        unsafe {
+            let key = self.state as *const AtomicU8 as usize;
+            parking_lot_core::unpark_all(key, parking_lot_core::DEFAULT_UNPARK_TOKEN);
+        }
+    }
+}
+
+// Note: this is intentionally monomorphic
+#[inline(never)]
+fn initialize_inner(state: &AtomicU8, init: &mut dyn FnMut() -> bool) {
+    loop {
+        let exchange =
+            state.compare_exchange_weak(INCOMPLETE, RUNNING, Ordering::Acquire, Ordering::Acquire);
+        match exchange {
+            Ok(_) => {
+                let mut guard = Guard { state, new_state: INCOMPLETE };
+                if init() {
+                    guard.new_state = COMPLETE;
+                }
+                return;
+            }
+            Err(COMPLETE) => return,
+            Err(RUNNING) => unsafe {
+                let key = state as *const AtomicU8 as usize;
+                parking_lot_core::park(
+                    key,
+                    || state.load(Ordering::Relaxed) == RUNNING,
+                    || (),
+                    |_, _| (),
+                    parking_lot_core::DEFAULT_PARK_TOKEN,
+                    None,
+                );
+            },
+            Err(INCOMPLETE) => (),
+            Err(_) => debug_assert!(false),
+        }
+    }
+}
+
+#[test]
+fn test_size() {
+    use std::mem::size_of;
+
+    assert_eq!(size_of::<OnceCell<bool>>(), 1 * size_of::<bool>() + size_of::<u8>());
+}
diff -pruN 43.0.0-1/rust-vendor/once_cell/src/imp_std.rs 43.0.0-1ubuntu1/rust-vendor/once_cell/src/imp_std.rs
--- 43.0.0-1/rust-vendor/once_cell/src/imp_std.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/src/imp_std.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,415 @@
+// There's a lot of scary concurrent code in this module, but it is copied from
+// `std::sync::Once` with two changes:
+//   * no poisoning
+//   * init function can fail
+
+use std::{
+    cell::{Cell, UnsafeCell},
+    panic::{RefUnwindSafe, UnwindSafe},
+    sync::atomic::{AtomicBool, AtomicPtr, Ordering},
+    thread::{self, Thread},
+};
+
+#[derive(Debug)]
+pub(crate) struct OnceCell<T> {
+    // This `queue` field is the core of the implementation. It encodes two
+    // pieces of information:
+    //
+    // * The current state of the cell (`INCOMPLETE`, `RUNNING`, `COMPLETE`)
+    // * Linked list of threads waiting for the current cell.
+    //
+    // State is encoded in two low bits. Only `INCOMPLETE` and `RUNNING` states
+    // allow waiters.
+    queue: AtomicPtr<Waiter>,
+    value: UnsafeCell<Option<T>>,
+}
+
+// Why do we need `T: Send`?
+// Thread A creates a `OnceCell` and shares it with
+// scoped thread B, which fills the cell, which is
+// then destroyed by A. That is, destructor observes
+// a sent value.
+unsafe impl<T: Sync + Send> Sync for OnceCell<T> {}
+unsafe impl<T: Send> Send for OnceCell<T> {}
+
+impl<T: RefUnwindSafe + UnwindSafe> RefUnwindSafe for OnceCell<T> {}
+impl<T: UnwindSafe> UnwindSafe for OnceCell<T> {}
+
+impl<T> OnceCell<T> {
+    pub(crate) const fn new() -> OnceCell<T> {
+        OnceCell { queue: AtomicPtr::new(INCOMPLETE_PTR), value: UnsafeCell::new(None) }
+    }
+
+    pub(crate) const fn with_value(value: T) -> OnceCell<T> {
+        OnceCell { queue: AtomicPtr::new(COMPLETE_PTR), value: UnsafeCell::new(Some(value)) }
+    }
+
+    /// Safety: synchronizes with store to value via Release/(Acquire|SeqCst).
+    #[inline]
+    pub(crate) fn is_initialized(&self) -> bool {
+        // An `Acquire` load is enough because that makes all the initialization
+        // operations visible to us, and, this being a fast path, weaker
+        // ordering helps with performance. This `Acquire` synchronizes with
+        // `SeqCst` operations on the slow path.
+        self.queue.load(Ordering::Acquire) == COMPLETE_PTR
+    }
+
+    /// Safety: synchronizes with store to value via SeqCst read from state,
+    /// writes value only once because we never get to INCOMPLETE state after a
+    /// successful write.
+    #[cold]
+    pub(crate) fn initialize<F, E>(&self, f: F) -> Result<(), E>
+    where
+        F: FnOnce() -> Result<T, E>,
+    {
+        let mut f = Some(f);
+        let mut res: Result<(), E> = Ok(());
+        let slot: *mut Option<T> = self.value.get();
+        initialize_or_wait(
+            &self.queue,
+            Some(&mut || {
+                let f = unsafe { f.take().unwrap_unchecked() };
+                match f() {
+                    Ok(value) => {
+                        unsafe { *slot = Some(value) };
+                        true
+                    }
+                    Err(err) => {
+                        res = Err(err);
+                        false
+                    }
+                }
+            }),
+        );
+        res
+    }
+
+    #[cold]
+    pub(crate) fn wait(&self) {
+        initialize_or_wait(&self.queue, None);
+    }
+
+    /// Get the reference to the underlying value, without checking if the cell
+    /// is initialized.
+    ///
+    /// # Safety
+    ///
+    /// Caller must ensure that the cell is in initialized state, and that
+    /// the contents are acquired by (synchronized to) this thread.
+    pub(crate) unsafe fn get_unchecked(&self) -> &T {
+        debug_assert!(self.is_initialized());
+        let slot = &*self.value.get();
+        slot.as_ref().unwrap_unchecked()
+    }
+
+    /// Gets the mutable reference to the underlying value.
+    /// Returns `None` if the cell is empty.
+    pub(crate) fn get_mut(&mut self) -> Option<&mut T> {
+        // Safe b/c we have a unique access.
+        unsafe { &mut *self.value.get() }.as_mut()
+    }
+
+    /// Consumes this `OnceCell`, returning the wrapped value.
+    /// Returns `None` if the cell was empty.
+    #[inline]
+    pub(crate) fn into_inner(self) -> Option<T> {
+        // Because `into_inner` takes `self` by value, the compiler statically
+        // verifies that it is not currently borrowed.
+        // So, it is safe to move out `Option<T>`.
+        self.value.into_inner()
+    }
+}
+
+// Three states that a OnceCell can be in, encoded into the lower bits of `queue` in
+// the OnceCell structure.
+const INCOMPLETE: usize = 0x0;
+const RUNNING: usize = 0x1;
+const COMPLETE: usize = 0x2;
+const INCOMPLETE_PTR: *mut Waiter = INCOMPLETE as *mut Waiter;
+const COMPLETE_PTR: *mut Waiter = COMPLETE as *mut Waiter;
+
+// Mask to learn about the state. All other bits are the queue of waiters if
+// this is in the RUNNING state.
+const STATE_MASK: usize = 0x3;
+
+/// Representation of a node in the linked list of waiters in the RUNNING state.
+/// A waiters is stored on the stack of the waiting threads.
+#[repr(align(4))] // Ensure the two lower bits are free to use as state bits.
+struct Waiter {
+    thread: Cell<Option<Thread>>,
+    signaled: AtomicBool,
+    next: *mut Waiter,
+}
+
+/// Drains and notifies the queue of waiters on drop.
+struct Guard<'a> {
+    queue: &'a AtomicPtr<Waiter>,
+    new_queue: *mut Waiter,
+}
+
+impl Drop for Guard<'_> {
+    fn drop(&mut self) {
+        let queue = self.queue.swap(self.new_queue, Ordering::AcqRel);
+
+        let state = strict::addr(queue) & STATE_MASK;
+        assert_eq!(state, RUNNING);
+
+        unsafe {
+            let mut waiter = strict::map_addr(queue, |q| q & !STATE_MASK);
+            while !waiter.is_null() {
+                let next = (*waiter).next;
+                let thread = (*waiter).thread.take().unwrap();
+                (*waiter).signaled.store(true, Ordering::Release);
+                waiter = next;
+                thread.unpark();
+            }
+        }
+    }
+}
+
+// Corresponds to `std::sync::Once::call_inner`.
+//
+// Originally copied from std, but since modified to remove poisoning and to
+// support wait.
+//
+// Note: this is intentionally monomorphic
+#[inline(never)]
+fn initialize_or_wait(queue: &AtomicPtr<Waiter>, mut init: Option<&mut dyn FnMut() -> bool>) {
+    let mut curr_queue = queue.load(Ordering::Acquire);
+
+    loop {
+        let curr_state = strict::addr(curr_queue) & STATE_MASK;
+        match (curr_state, &mut init) {
+            (COMPLETE, _) => return,
+            (INCOMPLETE, Some(init)) => {
+                let exchange = queue.compare_exchange(
+                    curr_queue,
+                    strict::map_addr(curr_queue, |q| (q & !STATE_MASK) | RUNNING),
+                    Ordering::Acquire,
+                    Ordering::Acquire,
+                );
+                if let Err(new_queue) = exchange {
+                    curr_queue = new_queue;
+                    continue;
+                }
+                let mut guard = Guard { queue, new_queue: INCOMPLETE_PTR };
+                if init() {
+                    guard.new_queue = COMPLETE_PTR;
+                }
+                return;
+            }
+            (INCOMPLETE, None) | (RUNNING, _) => {
+                wait(queue, curr_queue);
+                curr_queue = queue.load(Ordering::Acquire);
+            }
+            _ => debug_assert!(false),
+        }
+    }
+}
+
+fn wait(queue: &AtomicPtr<Waiter>, mut curr_queue: *mut Waiter) {
+    let curr_state = strict::addr(curr_queue) & STATE_MASK;
+    loop {
+        let node = Waiter {
+            thread: Cell::new(Some(thread::current())),
+            signaled: AtomicBool::new(false),
+            next: strict::map_addr(curr_queue, |q| q & !STATE_MASK),
+        };
+        let me = &node as *const Waiter as *mut Waiter;
+
+        let exchange = queue.compare_exchange(
+            curr_queue,
+            strict::map_addr(me, |q| q | curr_state),
+            Ordering::Release,
+            Ordering::Relaxed,
+        );
+        if let Err(new_queue) = exchange {
+            if strict::addr(new_queue) & STATE_MASK != curr_state {
+                return;
+            }
+            curr_queue = new_queue;
+            continue;
+        }
+
+        while !node.signaled.load(Ordering::Acquire) {
+            thread::park();
+        }
+        break;
+    }
+}
+
+// Polyfill of strict provenance from https://crates.io/crates/sptr.
+//
+// Use free-standing function rather than a trait to keep things simple and
+// avoid any potential conflicts with future stabile std API.
+mod strict {
+    #[must_use]
+    #[inline]
+    pub(crate) fn addr<T>(ptr: *mut T) -> usize
+    where
+        T: Sized,
+    {
+        // FIXME(strict_provenance_magic): I am magic and should be a compiler intrinsic.
+        // SAFETY: Pointer-to-integer transmutes are valid (if you are okay with losing the
+        // provenance).
+        unsafe { core::mem::transmute(ptr) }
+    }
+
+    #[must_use]
+    #[inline]
+    pub(crate) fn with_addr<T>(ptr: *mut T, addr: usize) -> *mut T
+    where
+        T: Sized,
+    {
+        // FIXME(strict_provenance_magic): I am magic and should be a compiler intrinsic.
+        //
+        // In the mean-time, this operation is defined to be "as if" it was
+        // a wrapping_offset, so we can emulate it as such. This should properly
+        // restore pointer provenance even under today's compiler.
+        let self_addr = self::addr(ptr) as isize;
+        let dest_addr = addr as isize;
+        let offset = dest_addr.wrapping_sub(self_addr);
+
+        // This is the canonical desugarring of this operation,
+        // but `pointer::cast` was only stabilized in 1.38.
+        // self.cast::<u8>().wrapping_offset(offset).cast::<T>()
+        (ptr as *mut u8).wrapping_offset(offset) as *mut T
+    }
+
+    #[must_use]
+    #[inline]
+    pub(crate) fn map_addr<T>(ptr: *mut T, f: impl FnOnce(usize) -> usize) -> *mut T
+    where
+        T: Sized,
+    {
+        self::with_addr(ptr, f(addr(ptr)))
+    }
+}
+
+// These test are snatched from std as well.
+#[cfg(test)]
+mod tests {
+    use std::panic;
+    use std::{sync::mpsc::channel, thread};
+
+    use super::OnceCell;
+
+    impl<T> OnceCell<T> {
+        fn init(&self, f: impl FnOnce() -> T) {
+            enum Void {}
+            let _ = self.initialize(|| Ok::<T, Void>(f()));
+        }
+    }
+
+    #[test]
+    fn smoke_once() {
+        static O: OnceCell<()> = OnceCell::new();
+        let mut a = 0;
+        O.init(|| a += 1);
+        assert_eq!(a, 1);
+        O.init(|| a += 1);
+        assert_eq!(a, 1);
+    }
+
+    #[test]
+    fn stampede_once() {
+        static O: OnceCell<()> = OnceCell::new();
+        static mut RUN: bool = false;
+
+        let (tx, rx) = channel();
+        for _ in 0..10 {
+            let tx = tx.clone();
+            thread::spawn(move || {
+                for _ in 0..4 {
+                    thread::yield_now()
+                }
+                unsafe {
+                    O.init(|| {
+                        assert!(!RUN);
+                        RUN = true;
+                    });
+                    assert!(RUN);
+                }
+                tx.send(()).unwrap();
+            });
+        }
+
+        unsafe {
+            O.init(|| {
+                assert!(!RUN);
+                RUN = true;
+            });
+            assert!(RUN);
+        }
+
+        for _ in 0..10 {
+            rx.recv().unwrap();
+        }
+    }
+
+    #[test]
+    fn poison_bad() {
+        static O: OnceCell<()> = OnceCell::new();
+
+        // poison the once
+        let t = panic::catch_unwind(|| {
+            O.init(|| panic!());
+        });
+        assert!(t.is_err());
+
+        // we can subvert poisoning, however
+        let mut called = false;
+        O.init(|| {
+            called = true;
+        });
+        assert!(called);
+
+        // once any success happens, we stop propagating the poison
+        O.init(|| {});
+    }
+
+    #[test]
+    fn wait_for_force_to_finish() {
+        static O: OnceCell<()> = OnceCell::new();
+
+        // poison the once
+        let t = panic::catch_unwind(|| {
+            O.init(|| panic!());
+        });
+        assert!(t.is_err());
+
+        // make sure someone's waiting inside the once via a force
+        let (tx1, rx1) = channel();
+        let (tx2, rx2) = channel();
+        let t1 = thread::spawn(move || {
+            O.init(|| {
+                tx1.send(()).unwrap();
+                rx2.recv().unwrap();
+            });
+        });
+
+        rx1.recv().unwrap();
+
+        // put another waiter on the once
+        let t2 = thread::spawn(|| {
+            let mut called = false;
+            O.init(|| {
+                called = true;
+            });
+            assert!(!called);
+        });
+
+        tx2.send(()).unwrap();
+
+        assert!(t1.join().is_ok());
+        assert!(t2.join().is_ok());
+    }
+
+    #[test]
+    #[cfg(target_pointer_width = "64")]
+    fn test_size() {
+        use std::mem::size_of;
+
+        assert_eq!(size_of::<OnceCell<u32>>(), 4 * size_of::<u32>());
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/once_cell/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/once_cell/src/lib.rs
--- 43.0.0-1/rust-vendor/once_cell/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1412 @@
+//! # Overview
+//!
+//! `once_cell` provides two new cell-like types, [`unsync::OnceCell`] and
+//! [`sync::OnceCell`]. A `OnceCell` might store arbitrary non-`Copy` types, can
+//! be assigned to at most once and provides direct access to the stored
+//! contents. The core API looks *roughly* like this (and there's much more
+//! inside, read on!):
+//!
+//! ```rust,ignore
+//! impl<T> OnceCell<T> {
+//!     const fn new() -> OnceCell<T> { ... }
+//!     fn set(&self, value: T) -> Result<(), T> { ... }
+//!     fn get(&self) -> Option<&T> { ... }
+//! }
+//! ```
+//!
+//! Note that, like with [`RefCell`] and [`Mutex`], the `set` method requires
+//! only a shared reference. Because of the single assignment restriction `get`
+//! can return a `&T` instead of `Ref<T>` or `MutexGuard<T>`.
+//!
+//! The `sync` flavor is thread-safe (that is, implements the [`Sync`] trait),
+//! while the `unsync` one is not.
+//!
+//! [`unsync::OnceCell`]: unsync/struct.OnceCell.html
+//! [`sync::OnceCell`]: sync/struct.OnceCell.html
+//! [`RefCell`]: https://doc.rust-lang.org/std/cell/struct.RefCell.html
+//! [`Mutex`]: https://doc.rust-lang.org/std/sync/struct.Mutex.html
+//! [`Sync`]: https://doc.rust-lang.org/std/marker/trait.Sync.html
+//!
+//! # Recipes
+//!
+//! `OnceCell` might be useful for a variety of patterns.
+//!
+//! ## Safe Initialization of Global Data
+//!
+//! ```rust
+//! use std::{env, io};
+//!
+//! use once_cell::sync::OnceCell;
+//!
+//! #[derive(Debug)]
+//! pub struct Logger {
+//!     // ...
+//! }
+//! static INSTANCE: OnceCell<Logger> = OnceCell::new();
+//!
+//! impl Logger {
+//!     pub fn global() -> &'static Logger {
+//!         INSTANCE.get().expect("logger is not initialized")
+//!     }
+//!
+//!     fn from_cli(args: env::Args) -> Result<Logger, std::io::Error> {
+//!        // ...
+//! #      Ok(Logger {})
+//!     }
+//! }
+//!
+//! fn main() {
+//!     let logger = Logger::from_cli(env::args()).unwrap();
+//!     INSTANCE.set(logger).unwrap();
+//!     // use `Logger::global()` from now on
+//! }
+//! ```
+//!
+//! ## Lazy Initialized Global Data
+//!
+//! This is essentially the `lazy_static!` macro, but without a macro.
+//!
+//! ```rust
+//! use std::{sync::Mutex, collections::HashMap};
+//!
+//! use once_cell::sync::OnceCell;
+//!
+//! fn global_data() -> &'static Mutex<HashMap<i32, String>> {
+//!     static INSTANCE: OnceCell<Mutex<HashMap<i32, String>>> = OnceCell::new();
+//!     INSTANCE.get_or_init(|| {
+//!         let mut m = HashMap::new();
+//!         m.insert(13, "Spica".to_string());
+//!         m.insert(74, "Hoyten".to_string());
+//!         Mutex::new(m)
+//!     })
+//! }
+//! ```
+//!
+//! There are also the [`sync::Lazy`] and [`unsync::Lazy`] convenience types to
+//! streamline this pattern:
+//!
+//! ```rust
+//! use std::{sync::Mutex, collections::HashMap};
+//! use once_cell::sync::Lazy;
+//!
+//! static GLOBAL_DATA: Lazy<Mutex<HashMap<i32, String>>> = Lazy::new(|| {
+//!     let mut m = HashMap::new();
+//!     m.insert(13, "Spica".to_string());
+//!     m.insert(74, "Hoyten".to_string());
+//!     Mutex::new(m)
+//! });
+//!
+//! fn main() {
+//!     println!("{:?}", GLOBAL_DATA.lock().unwrap());
+//! }
+//! ```
+//!
+//! Note that the variable that holds `Lazy` is declared as `static`, *not*
+//! `const`. This is important: using `const` instead compiles, but works wrong.
+//!
+//! [`sync::Lazy`]: sync/struct.Lazy.html
+//! [`unsync::Lazy`]: unsync/struct.Lazy.html
+//!
+//! ## General purpose lazy evaluation
+//!
+//! Unlike `lazy_static!`, `Lazy` works with local variables.
+//!
+//! ```rust
+//! use once_cell::unsync::Lazy;
+//!
+//! fn main() {
+//!     let ctx = vec![1, 2, 3];
+//!     let thunk = Lazy::new(|| {
+//!         ctx.iter().sum::<i32>()
+//!     });
+//!     assert_eq!(*thunk, 6);
+//! }
+//! ```
+//!
+//! If you need a lazy field in a struct, you probably should use `OnceCell`
+//! directly, because that will allow you to access `self` during
+//! initialization.
+//!
+//! ```rust
+//! use std::{fs, path::PathBuf};
+//!
+//! use once_cell::unsync::OnceCell;
+//!
+//! struct Ctx {
+//!     config_path: PathBuf,
+//!     config: OnceCell<String>,
+//! }
+//!
+//! impl Ctx {
+//!     pub fn get_config(&self) -> Result<&str, std::io::Error> {
+//!         let cfg = self.config.get_or_try_init(|| {
+//!             fs::read_to_string(&self.config_path)
+//!         })?;
+//!         Ok(cfg.as_str())
+//!     }
+//! }
+//! ```
+//!
+//! ## Lazily Compiled Regex
+//!
+//! This is a `regex!` macro which takes a string literal and returns an
+//! *expression* that evaluates to a `&'static Regex`:
+//!
+//! ```
+//! macro_rules! regex {
+//!     ($re:literal $(,)?) => {{
+//!         static RE: once_cell::sync::OnceCell<regex::Regex> = once_cell::sync::OnceCell::new();
+//!         RE.get_or_init(|| regex::Regex::new($re).unwrap())
+//!     }};
+//! }
+//! ```
+//!
+//! This macro can be useful to avoid the "compile regex on every loop
+//! iteration" problem.
+//!
+//! ## Runtime `include_bytes!`
+//!
+//! The `include_bytes` macro is useful to include test resources, but it slows
+//! down test compilation a lot. An alternative is to load the resources at
+//! runtime:
+//!
+//! ```
+//! use std::path::Path;
+//!
+//! use once_cell::sync::OnceCell;
+//!
+//! pub struct TestResource {
+//!     path: &'static str,
+//!     cell: OnceCell<Vec<u8>>,
+//! }
+//!
+//! impl TestResource {
+//!     pub const fn new(path: &'static str) -> TestResource {
+//!         TestResource { path, cell: OnceCell::new() }
+//!     }
+//!     pub fn bytes(&self) -> &[u8] {
+//!         self.cell.get_or_init(|| {
+//!             let dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
+//!             let path = Path::new(dir.as_str()).join(self.path);
+//!             std::fs::read(&path).unwrap_or_else(|_err| {
+//!                 panic!("failed to load test resource: {}", path.display())
+//!             })
+//!         }).as_slice()
+//!     }
+//! }
+//!
+//! static TEST_IMAGE: TestResource = TestResource::new("test_data/lena.png");
+//!
+//! #[test]
+//! fn test_sobel_filter() {
+//!     let rgb: &[u8] = TEST_IMAGE.bytes();
+//!     // ...
+//! # drop(rgb);
+//! }
+//! ```
+//!
+//! ## `lateinit`
+//!
+//! `LateInit` type for delayed initialization. It is reminiscent of Kotlin's
+//! `lateinit` keyword and allows construction of cyclic data structures:
+//!
+//!
+//! ```
+//! use once_cell::sync::OnceCell;
+//!
+//! pub struct LateInit<T> { cell: OnceCell<T> }
+//!
+//! impl<T> LateInit<T> {
+//!     pub fn init(&self, value: T) {
+//!         assert!(self.cell.set(value).is_ok())
+//!     }
+//! }
+//!
+//! impl<T> Default for LateInit<T> {
+//!     fn default() -> Self { LateInit { cell: OnceCell::default() } }
+//! }
+//!
+//! impl<T> std::ops::Deref for LateInit<T> {
+//!     type Target = T;
+//!     fn deref(&self) -> &T {
+//!         self.cell.get().unwrap()
+//!     }
+//! }
+//!
+//! #[derive(Default)]
+//! struct A<'a> {
+//!     b: LateInit<&'a B<'a>>,
+//! }
+//!
+//! #[derive(Default)]
+//! struct B<'a> {
+//!     a: LateInit<&'a A<'a>>
+//! }
+//!
+//!
+//! fn build_cycle() {
+//!     let a = A::default();
+//!     let b = B::default();
+//!     a.b.init(&b);
+//!     b.a.init(&a);
+//!
+//!     let _a = &a.b.a.b.a;
+//! }
+//! ```
+//!
+//! # Comparison with std
+//!
+//! |`!Sync` types         | Access Mode            | Drawbacks                                     |
+//! |----------------------|------------------------|-----------------------------------------------|
+//! |`Cell<T>`             | `T`                    | requires `T: Copy` for `get`                  |
+//! |`RefCell<T>`          | `RefMut<T>` / `Ref<T>` | may panic at runtime                          |
+//! |`unsync::OnceCell<T>` | `&T`                   | assignable only once                          |
+//!
+//! |`Sync` types          | Access Mode            | Drawbacks                                     |
+//! |----------------------|------------------------|-----------------------------------------------|
+//! |`AtomicT`             | `T`                    | works only with certain `Copy` types          |
+//! |`Mutex<T>`            | `MutexGuard<T>`        | may deadlock at runtime, may block the thread |
+//! |`sync::OnceCell<T>`   | `&T`                   | assignable only once, may block the thread    |
+//!
+//! Technically, calling `get_or_init` will also cause a panic or a deadlock if
+//! it recursively calls itself. However, because the assignment can happen only
+//! once, such cases should be more rare than equivalents with `RefCell` and
+//! `Mutex`.
+//!
+//! # Minimum Supported `rustc` Version
+//!
+//! If only the `std`, `alloc`, or `race` features are enabled, MSRV will be
+//! updated conservatively, supporting at least latest 8 versions of the compiler.
+//! When using other features, like `parking_lot`, MSRV might be updated more
+//! frequently, up to the latest stable. In both cases, increasing MSRV is *not*
+//! considered a semver-breaking change and requires only a minor version bump.
+//!
+//! # Implementation details
+//!
+//! The implementation is based on the
+//! [`lazy_static`](https://github.com/rust-lang-nursery/lazy-static.rs/) and
+//! [`lazy_cell`](https://github.com/indiv0/lazycell/) crates and
+//! [`std::sync::Once`]. In some sense, `once_cell` just streamlines and unifies
+//! those APIs.
+//!
+//! To implement a sync flavor of `OnceCell`, this crates uses either a custom
+//! re-implementation of `std::sync::Once` or `parking_lot::Mutex`. This is
+//! controlled by the `parking_lot` feature (disabled by default). Performance
+//! is the same for both cases, but the `parking_lot` based `OnceCell<T>` is
+//! smaller by up to 16 bytes.
+//!
+//! This crate uses `unsafe`.
+//!
+//! [`std::sync::Once`]: https://doc.rust-lang.org/std/sync/struct.Once.html
+//!
+//! # F.A.Q.
+//!
+//! **Should I use the sync or unsync flavor?**
+//!
+//! Because Rust compiler checks thread safety for you, it's impossible to
+//! accidentally use `unsync` where `sync` is required. So, use `unsync` in
+//! single-threaded code and `sync` in multi-threaded. It's easy to switch
+//! between the two if code becomes multi-threaded later.
+//!
+//! At the moment, `unsync` has an additional benefit that reentrant
+//! initialization causes a panic, which might be easier to debug than a
+//! deadlock.
+//!
+//! **Does this crate support async?**
+//!
+//! No, but you can use
+//! [`async_once_cell`](https://crates.io/crates/async_once_cell) instead.
+//!
+//! **Does this crate support `no_std`?**
+//!
+//! Yes, but with caveats. `OnceCell` is a synchronization primitive which
+//! _semantically_ relies on blocking. `OnceCell` guarantees that at most one
+//! `f` will be called to compute the value. If two threads of execution call
+//! `get_or_init` concurrently, one of them has to wait.
+//!
+//! Waiting fundamentally requires OS support. Execution environment needs to
+//! understand who waits on whom to prevent deadlocks due to priority inversion.
+//! You _could_ make code to compile by blindly using pure spinlocks, but the
+//! runtime behavior would be subtly wrong.
+//!
+//! Given these constraints, `once_cell` provides the following options:
+//!
+//! - The `race` module provides similar, but distinct synchronization primitive
+//!   which is compatible with `no_std`. With `race`, the `f` function can be
+//!   called multiple times by different threads, but only one thread will win
+//!   to install the value.
+//! - `critical-section` feature (with a `-`, not `_`) uses `critical_section`
+//!   to implement blocking.
+//!
+//! **Can I bring my own mutex?**
+//!
+//! There is [generic_once_cell](https://crates.io/crates/generic_once_cell) to
+//! allow just that.
+//!
+//! **Should I use `std::cell::OnceCell`, `once_cell`, or `lazy_static`?**
+//!
+//! If you can use `std` version (your MSRV is at least 1.70, and you don't need
+//! extra features `once_cell` provides), use `std`. Otherwise, use `once_cell`.
+//! Don't use `lazy_static`.
+//!
+//! # Related crates
+//!
+//! * Most of this crate's functionality is available in `std` starting with
+//!   Rust 1.70. See `std::cell::OnceCell` and `std::sync::OnceLock`.
+//! * [double-checked-cell](https://github.com/niklasf/double-checked-cell)
+//! * [lazy-init](https://crates.io/crates/lazy-init)
+//! * [lazycell](https://crates.io/crates/lazycell)
+//! * [mitochondria](https://crates.io/crates/mitochondria)
+//! * [lazy_static](https://crates.io/crates/lazy_static)
+//! * [async_once_cell](https://crates.io/crates/async_once_cell)
+//! * [generic_once_cell](https://crates.io/crates/generic_once_cell) (bring
+//!   your own mutex)
+
+#![cfg_attr(not(feature = "std"), no_std)]
+
+#[cfg(feature = "alloc")]
+extern crate alloc;
+
+#[cfg(all(feature = "critical-section", not(feature = "std")))]
+#[path = "imp_cs.rs"]
+mod imp;
+
+#[cfg(all(feature = "std", feature = "parking_lot"))]
+#[path = "imp_pl.rs"]
+mod imp;
+
+#[cfg(all(feature = "std", not(feature = "parking_lot")))]
+#[path = "imp_std.rs"]
+mod imp;
+
+/// Single-threaded version of `OnceCell`.
+pub mod unsync {
+    use core::{
+        cell::{Cell, UnsafeCell},
+        fmt, mem,
+        ops::{Deref, DerefMut},
+        panic::{RefUnwindSafe, UnwindSafe},
+    };
+
+    /// A cell which can be written to only once. It is not thread safe.
+    ///
+    /// Unlike [`std::cell::RefCell`], a `OnceCell` provides simple `&`
+    /// references to the contents.
+    ///
+    /// [`std::cell::RefCell`]: https://doc.rust-lang.org/std/cell/struct.RefCell.html
+    ///
+    /// # Example
+    /// ```
+    /// use once_cell::unsync::OnceCell;
+    ///
+    /// let cell = OnceCell::new();
+    /// assert!(cell.get().is_none());
+    ///
+    /// let value: &String = cell.get_or_init(|| {
+    ///     "Hello, World!".to_string()
+    /// });
+    /// assert_eq!(value, "Hello, World!");
+    /// assert!(cell.get().is_some());
+    /// ```
+    pub struct OnceCell<T> {
+        // Invariant: written to at most once.
+        inner: UnsafeCell<Option<T>>,
+    }
+
+    // Similarly to a `Sync` bound on `sync::OnceCell`, we can use
+    // `&unsync::OnceCell` to sneak a `T` through `catch_unwind`,
+    // by initializing the cell in closure and extracting the value in the
+    // `Drop`.
+    impl<T: RefUnwindSafe + UnwindSafe> RefUnwindSafe for OnceCell<T> {}
+    impl<T: UnwindSafe> UnwindSafe for OnceCell<T> {}
+
+    impl<T> Default for OnceCell<T> {
+        fn default() -> Self {
+            Self::new()
+        }
+    }
+
+    impl<T: fmt::Debug> fmt::Debug for OnceCell<T> {
+        fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+            match self.get() {
+                Some(v) => f.debug_tuple("OnceCell").field(v).finish(),
+                None => f.write_str("OnceCell(Uninit)"),
+            }
+        }
+    }
+
+    impl<T: Clone> Clone for OnceCell<T> {
+        fn clone(&self) -> OnceCell<T> {
+            match self.get() {
+                Some(value) => OnceCell::with_value(value.clone()),
+                None => OnceCell::new(),
+            }
+        }
+
+        fn clone_from(&mut self, source: &Self) {
+            match (self.get_mut(), source.get()) {
+                (Some(this), Some(source)) => this.clone_from(source),
+                _ => *self = source.clone(),
+            }
+        }
+    }
+
+    impl<T: PartialEq> PartialEq for OnceCell<T> {
+        fn eq(&self, other: &Self) -> bool {
+            self.get() == other.get()
+        }
+    }
+
+    impl<T: Eq> Eq for OnceCell<T> {}
+
+    impl<T> From<T> for OnceCell<T> {
+        fn from(value: T) -> Self {
+            OnceCell::with_value(value)
+        }
+    }
+
+    impl<T> OnceCell<T> {
+        /// Creates a new empty cell.
+        pub const fn new() -> OnceCell<T> {
+            OnceCell { inner: UnsafeCell::new(None) }
+        }
+
+        /// Creates a new initialized cell.
+        pub const fn with_value(value: T) -> OnceCell<T> {
+            OnceCell { inner: UnsafeCell::new(Some(value)) }
+        }
+
+        /// Gets a reference to the underlying value.
+        ///
+        /// Returns `None` if the cell is empty.
+        #[inline]
+        pub fn get(&self) -> Option<&T> {
+            // Safe due to `inner`'s invariant of being written to at most once.
+            // Had multiple writes to `inner` been allowed, a reference to the
+            // value we return now would become dangling by a write of a
+            // different value later.
+            unsafe { &*self.inner.get() }.as_ref()
+        }
+
+        /// Gets a mutable reference to the underlying value.
+        ///
+        /// Returns `None` if the cell is empty.
+        ///
+        /// This method is allowed to violate the invariant of writing to a `OnceCell`
+        /// at most once because it requires `&mut` access to `self`. As with all
+        /// interior mutability, `&mut` access permits arbitrary modification:
+        ///
+        /// ```
+        /// use once_cell::unsync::OnceCell;
+        ///
+        /// let mut cell: OnceCell<u32> = OnceCell::new();
+        /// cell.set(92).unwrap();
+        /// *cell.get_mut().unwrap() = 93;
+        /// assert_eq!(cell.get(), Some(&93));
+        /// ```
+        #[inline]
+        pub fn get_mut(&mut self) -> Option<&mut T> {
+            // Safe because we have unique access
+            unsafe { &mut *self.inner.get() }.as_mut()
+        }
+
+        /// Sets the contents of this cell to `value`.
+        ///
+        /// Returns `Ok(())` if the cell was empty and `Err(value)` if it was
+        /// full.
+        ///
+        /// # Example
+        /// ```
+        /// use once_cell::unsync::OnceCell;
+        ///
+        /// let cell = OnceCell::new();
+        /// assert!(cell.get().is_none());
+        ///
+        /// assert_eq!(cell.set(92), Ok(()));
+        /// assert_eq!(cell.set(62), Err(62));
+        ///
+        /// assert!(cell.get().is_some());
+        /// ```
+        pub fn set(&self, value: T) -> Result<(), T> {
+            match self.try_insert(value) {
+                Ok(_) => Ok(()),
+                Err((_, value)) => Err(value),
+            }
+        }
+
+        /// Like [`set`](Self::set), but also returns a reference to the final cell value.
+        ///
+        /// # Example
+        /// ```
+        /// use once_cell::unsync::OnceCell;
+        ///
+        /// let cell = OnceCell::new();
+        /// assert!(cell.get().is_none());
+        ///
+        /// assert_eq!(cell.try_insert(92), Ok(&92));
+        /// assert_eq!(cell.try_insert(62), Err((&92, 62)));
+        ///
+        /// assert!(cell.get().is_some());
+        /// ```
+        pub fn try_insert(&self, value: T) -> Result<&T, (&T, T)> {
+            if let Some(old) = self.get() {
+                return Err((old, value));
+            }
+
+            let slot = unsafe { &mut *self.inner.get() };
+            // This is the only place where we set the slot, no races
+            // due to reentrancy/concurrency are possible, and we've
+            // checked that slot is currently `None`, so this write
+            // maintains the `inner`'s invariant.
+            *slot = Some(value);
+            Ok(unsafe { slot.as_ref().unwrap_unchecked() })
+        }
+
+        /// Gets the contents of the cell, initializing it with `f`
+        /// if the cell was empty.
+        ///
+        /// # Panics
+        ///
+        /// If `f` panics, the panic is propagated to the caller, and the cell
+        /// remains uninitialized.
+        ///
+        /// It is an error to reentrantly initialize the cell from `f`. Doing
+        /// so results in a panic.
+        ///
+        /// # Example
+        /// ```
+        /// use once_cell::unsync::OnceCell;
+        ///
+        /// let cell = OnceCell::new();
+        /// let value = cell.get_or_init(|| 92);
+        /// assert_eq!(value, &92);
+        /// let value = cell.get_or_init(|| unreachable!());
+        /// assert_eq!(value, &92);
+        /// ```
+        pub fn get_or_init<F>(&self, f: F) -> &T
+        where
+            F: FnOnce() -> T,
+        {
+            enum Void {}
+            match self.get_or_try_init(|| Ok::<T, Void>(f())) {
+                Ok(val) => val,
+                Err(void) => match void {},
+            }
+        }
+
+        /// Gets the contents of the cell, initializing it with `f` if
+        /// the cell was empty. If the cell was empty and `f` failed, an
+        /// error is returned.
+        ///
+        /// # Panics
+        ///
+        /// If `f` panics, the panic is propagated to the caller, and the cell
+        /// remains uninitialized.
+        ///
+        /// It is an error to reentrantly initialize the cell from `f`. Doing
+        /// so results in a panic.
+        ///
+        /// # Example
+        /// ```
+        /// use once_cell::unsync::OnceCell;
+        ///
+        /// let cell = OnceCell::new();
+        /// assert_eq!(cell.get_or_try_init(|| Err(())), Err(()));
+        /// assert!(cell.get().is_none());
+        /// let value = cell.get_or_try_init(|| -> Result<i32, ()> {
+        ///     Ok(92)
+        /// });
+        /// assert_eq!(value, Ok(&92));
+        /// assert_eq!(cell.get(), Some(&92))
+        /// ```
+        pub fn get_or_try_init<F, E>(&self, f: F) -> Result<&T, E>
+        where
+            F: FnOnce() -> Result<T, E>,
+        {
+            if let Some(val) = self.get() {
+                return Ok(val);
+            }
+            let val = f()?;
+            // Note that *some* forms of reentrant initialization might lead to
+            // UB (see `reentrant_init` test). I believe that just removing this
+            // `assert`, while keeping `set/get` would be sound, but it seems
+            // better to panic, rather than to silently use an old value.
+            assert!(self.set(val).is_ok(), "reentrant init");
+            Ok(unsafe { self.get().unwrap_unchecked() })
+        }
+
+        /// Takes the value out of this `OnceCell`, moving it back to an uninitialized state.
+        ///
+        /// Has no effect and returns `None` if the `OnceCell` hasn't been initialized.
+        ///
+        /// # Examples
+        ///
+        /// ```
+        /// use once_cell::unsync::OnceCell;
+        ///
+        /// let mut cell: OnceCell<String> = OnceCell::new();
+        /// assert_eq!(cell.take(), None);
+        ///
+        /// let mut cell = OnceCell::new();
+        /// cell.set("hello".to_string()).unwrap();
+        /// assert_eq!(cell.take(), Some("hello".to_string()));
+        /// assert_eq!(cell.get(), None);
+        /// ```
+        ///
+        /// This method is allowed to violate the invariant of writing to a `OnceCell`
+        /// at most once because it requires `&mut` access to `self`. As with all
+        /// interior mutability, `&mut` access permits arbitrary modification:
+        ///
+        /// ```
+        /// use once_cell::unsync::OnceCell;
+        ///
+        /// let mut cell: OnceCell<u32> = OnceCell::new();
+        /// cell.set(92).unwrap();
+        /// cell = OnceCell::new();
+        /// ```
+        pub fn take(&mut self) -> Option<T> {
+            mem::take(self).into_inner()
+        }
+
+        /// Consumes the `OnceCell`, returning the wrapped value.
+        ///
+        /// Returns `None` if the cell was empty.
+        ///
+        /// # Examples
+        ///
+        /// ```
+        /// use once_cell::unsync::OnceCell;
+        ///
+        /// let cell: OnceCell<String> = OnceCell::new();
+        /// assert_eq!(cell.into_inner(), None);
+        ///
+        /// let cell = OnceCell::new();
+        /// cell.set("hello".to_string()).unwrap();
+        /// assert_eq!(cell.into_inner(), Some("hello".to_string()));
+        /// ```
+        pub fn into_inner(self) -> Option<T> {
+            // Because `into_inner` takes `self` by value, the compiler statically verifies
+            // that it is not currently borrowed. So it is safe to move out `Option<T>`.
+            self.inner.into_inner()
+        }
+    }
+
+    /// A value which is initialized on the first access.
+    ///
+    /// # Example
+    /// ```
+    /// use once_cell::unsync::Lazy;
+    ///
+    /// let lazy: Lazy<i32> = Lazy::new(|| {
+    ///     println!("initializing");
+    ///     92
+    /// });
+    /// println!("ready");
+    /// println!("{}", *lazy);
+    /// println!("{}", *lazy);
+    ///
+    /// // Prints:
+    /// //   ready
+    /// //   initializing
+    /// //   92
+    /// //   92
+    /// ```
+    pub struct Lazy<T, F = fn() -> T> {
+        cell: OnceCell<T>,
+        init: Cell<Option<F>>,
+    }
+
+    impl<T, F: RefUnwindSafe> RefUnwindSafe for Lazy<T, F> where OnceCell<T>: RefUnwindSafe {}
+
+    impl<T: fmt::Debug, F> fmt::Debug for Lazy<T, F> {
+        fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+            f.debug_struct("Lazy").field("cell", &self.cell).field("init", &"..").finish()
+        }
+    }
+
+    impl<T, F> Lazy<T, F> {
+        /// Creates a new lazy value with the given initializing function.
+        ///
+        /// # Example
+        /// ```
+        /// # fn main() {
+        /// use once_cell::unsync::Lazy;
+        ///
+        /// let hello = "Hello, World!".to_string();
+        ///
+        /// let lazy = Lazy::new(|| hello.to_uppercase());
+        ///
+        /// assert_eq!(&*lazy, "HELLO, WORLD!");
+        /// # }
+        /// ```
+        pub const fn new(init: F) -> Lazy<T, F> {
+            Lazy { cell: OnceCell::new(), init: Cell::new(Some(init)) }
+        }
+
+        /// Consumes this `Lazy` returning the stored value.
+        ///
+        /// Returns `Ok(value)` if `Lazy` is initialized and `Err(f)` otherwise.
+        pub fn into_value(this: Lazy<T, F>) -> Result<T, F> {
+            let cell = this.cell;
+            let init = this.init;
+            cell.into_inner().ok_or_else(|| {
+                init.take().unwrap_or_else(|| panic!("Lazy instance has previously been poisoned"))
+            })
+        }
+    }
+
+    impl<T, F: FnOnce() -> T> Lazy<T, F> {
+        /// Forces the evaluation of this lazy value and returns a reference to
+        /// the result.
+        ///
+        /// This is equivalent to the `Deref` impl, but is explicit.
+        ///
+        /// # Example
+        /// ```
+        /// use once_cell::unsync::Lazy;
+        ///
+        /// let lazy = Lazy::new(|| 92);
+        ///
+        /// assert_eq!(Lazy::force(&lazy), &92);
+        /// assert_eq!(&*lazy, &92);
+        /// ```
+        pub fn force(this: &Lazy<T, F>) -> &T {
+            this.cell.get_or_init(|| match this.init.take() {
+                Some(f) => f(),
+                None => panic!("Lazy instance has previously been poisoned"),
+            })
+        }
+
+        /// Forces the evaluation of this lazy value and returns a mutable reference to
+        /// the result.
+        ///
+        /// This is equivalent to the `DerefMut` impl, but is explicit.
+        ///
+        /// # Example
+        /// ```
+        /// use once_cell::unsync::Lazy;
+        ///
+        /// let mut lazy = Lazy::new(|| 92);
+        ///
+        /// assert_eq!(Lazy::force_mut(&mut lazy), &92);
+        /// assert_eq!(*lazy, 92);
+        /// ```
+        pub fn force_mut(this: &mut Lazy<T, F>) -> &mut T {
+            if this.cell.get_mut().is_none() {
+                let value = match this.init.get_mut().take() {
+                    Some(f) => f(),
+                    None => panic!("Lazy instance has previously been poisoned"),
+                };
+                this.cell = OnceCell::with_value(value);
+            }
+            this.cell.get_mut().unwrap_or_else(|| unreachable!())
+        }
+
+        /// Gets the reference to the result of this lazy value if
+        /// it was initialized, otherwise returns `None`.
+        ///
+        /// # Example
+        /// ```
+        /// use once_cell::unsync::Lazy;
+        ///
+        /// let lazy = Lazy::new(|| 92);
+        ///
+        /// assert_eq!(Lazy::get(&lazy), None);
+        /// assert_eq!(&*lazy, &92);
+        /// assert_eq!(Lazy::get(&lazy), Some(&92));
+        /// ```
+        pub fn get(this: &Lazy<T, F>) -> Option<&T> {
+            this.cell.get()
+        }
+
+        /// Gets the mutable reference to the result of this lazy value if
+        /// it was initialized, otherwise returns `None`.
+        ///
+        /// # Example
+        /// ```
+        /// use once_cell::unsync::Lazy;
+        ///
+        /// let mut lazy = Lazy::new(|| 92);
+        ///
+        /// assert_eq!(Lazy::get_mut(&mut lazy), None);
+        /// assert_eq!(*lazy, 92);
+        /// assert_eq!(Lazy::get_mut(&mut lazy), Some(&mut 92));
+        /// ```
+        pub fn get_mut(this: &mut Lazy<T, F>) -> Option<&mut T> {
+            this.cell.get_mut()
+        }
+    }
+
+    impl<T, F: FnOnce() -> T> Deref for Lazy<T, F> {
+        type Target = T;
+        fn deref(&self) -> &T {
+            Lazy::force(self)
+        }
+    }
+
+    impl<T, F: FnOnce() -> T> DerefMut for Lazy<T, F> {
+        fn deref_mut(&mut self) -> &mut T {
+            Lazy::force_mut(self)
+        }
+    }
+
+    impl<T: Default> Default for Lazy<T> {
+        /// Creates a new lazy value using `Default` as the initializing function.
+        fn default() -> Lazy<T> {
+            Lazy::new(T::default)
+        }
+    }
+}
+
+/// Thread-safe, blocking version of `OnceCell`.
+#[cfg(any(feature = "std", feature = "critical-section"))]
+pub mod sync {
+    use core::{
+        cell::Cell,
+        fmt, mem,
+        ops::{Deref, DerefMut},
+        panic::RefUnwindSafe,
+    };
+
+    use super::imp::OnceCell as Imp;
+
+    /// A thread-safe cell which can be written to only once.
+    ///
+    /// `OnceCell` provides `&` references to the contents without RAII guards.
+    ///
+    /// Reading a non-`None` value out of `OnceCell` establishes a
+    /// happens-before relationship with a corresponding write. For example, if
+    /// thread A initializes the cell with `get_or_init(f)`, and thread B
+    /// subsequently reads the result of this call, B also observes all the side
+    /// effects of `f`.
+    ///
+    /// # Example
+    /// ```
+    /// use once_cell::sync::OnceCell;
+    ///
+    /// static CELL: OnceCell<String> = OnceCell::new();
+    /// assert!(CELL.get().is_none());
+    ///
+    /// std::thread::spawn(|| {
+    ///     let value: &String = CELL.get_or_init(|| {
+    ///         "Hello, World!".to_string()
+    ///     });
+    ///     assert_eq!(value, "Hello, World!");
+    /// }).join().unwrap();
+    ///
+    /// let value: Option<&String> = CELL.get();
+    /// assert!(value.is_some());
+    /// assert_eq!(value.unwrap().as_str(), "Hello, World!");
+    /// ```
+    pub struct OnceCell<T>(Imp<T>);
+
+    impl<T> Default for OnceCell<T> {
+        fn default() -> OnceCell<T> {
+            OnceCell::new()
+        }
+    }
+
+    impl<T: fmt::Debug> fmt::Debug for OnceCell<T> {
+        fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+            match self.get() {
+                Some(v) => f.debug_tuple("OnceCell").field(v).finish(),
+                None => f.write_str("OnceCell(Uninit)"),
+            }
+        }
+    }
+
+    impl<T: Clone> Clone for OnceCell<T> {
+        fn clone(&self) -> OnceCell<T> {
+            match self.get() {
+                Some(value) => Self::with_value(value.clone()),
+                None => Self::new(),
+            }
+        }
+
+        fn clone_from(&mut self, source: &Self) {
+            match (self.get_mut(), source.get()) {
+                (Some(this), Some(source)) => this.clone_from(source),
+                _ => *self = source.clone(),
+            }
+        }
+    }
+
+    impl<T> From<T> for OnceCell<T> {
+        fn from(value: T) -> Self {
+            Self::with_value(value)
+        }
+    }
+
+    impl<T: PartialEq> PartialEq for OnceCell<T> {
+        fn eq(&self, other: &OnceCell<T>) -> bool {
+            self.get() == other.get()
+        }
+    }
+
+    impl<T: Eq> Eq for OnceCell<T> {}
+
+    impl<T> OnceCell<T> {
+        /// Creates a new empty cell.
+        pub const fn new() -> OnceCell<T> {
+            OnceCell(Imp::new())
+        }
+
+        /// Creates a new initialized cell.
+        pub const fn with_value(value: T) -> OnceCell<T> {
+            OnceCell(Imp::with_value(value))
+        }
+
+        /// Gets the reference to the underlying value.
+        ///
+        /// Returns `None` if the cell is empty, or being initialized. This
+        /// method never blocks.
+        pub fn get(&self) -> Option<&T> {
+            if self.0.is_initialized() {
+                // Safe b/c value is initialized.
+                Some(unsafe { self.get_unchecked() })
+            } else {
+                None
+            }
+        }
+
+        /// Gets the reference to the underlying value, blocking the current
+        /// thread until it is set.
+        ///
+        /// ```
+        /// use once_cell::sync::OnceCell;
+        ///
+        /// let mut cell = std::sync::Arc::new(OnceCell::new());
+        /// let t = std::thread::spawn({
+        ///     let cell = std::sync::Arc::clone(&cell);
+        ///     move || cell.set(92).unwrap()
+        /// });
+        ///
+        /// // Returns immediately, but might return None.
+        /// let _value_or_none = cell.get();
+        ///
+        /// // Will return 92, but might block until the other thread does `.set`.
+        /// let value: &u32 = cell.wait();
+        /// assert_eq!(*value, 92);
+        /// t.join().unwrap();
+        /// ```
+        #[cfg(feature = "std")]
+        pub fn wait(&self) -> &T {
+            if !self.0.is_initialized() {
+                self.0.wait()
+            }
+            debug_assert!(self.0.is_initialized());
+            // Safe b/c of the wait call above and the fact that we didn't
+            // relinquish our borrow.
+            unsafe { self.get_unchecked() }
+        }
+
+        /// Gets the mutable reference to the underlying value.
+        ///
+        /// Returns `None` if the cell is empty.
+        ///
+        /// This method is allowed to violate the invariant of writing to a `OnceCell`
+        /// at most once because it requires `&mut` access to `self`. As with all
+        /// interior mutability, `&mut` access permits arbitrary modification:
+        ///
+        /// ```
+        /// use once_cell::sync::OnceCell;
+        ///
+        /// let mut cell: OnceCell<u32> = OnceCell::new();
+        /// cell.set(92).unwrap();
+        /// cell = OnceCell::new();
+        /// ```
+        #[inline]
+        pub fn get_mut(&mut self) -> Option<&mut T> {
+            self.0.get_mut()
+        }
+
+        /// Get the reference to the underlying value, without checking if the
+        /// cell is initialized.
+        ///
+        /// # Safety
+        ///
+        /// Caller must ensure that the cell is in initialized state, and that
+        /// the contents are acquired by (synchronized to) this thread.
+        #[inline]
+        pub unsafe fn get_unchecked(&self) -> &T {
+            self.0.get_unchecked()
+        }
+
+        /// Sets the contents of this cell to `value`.
+        ///
+        /// Returns `Ok(())` if the cell was empty and `Err(value)` if it was
+        /// full.
+        ///
+        /// # Example
+        ///
+        /// ```
+        /// use once_cell::sync::OnceCell;
+        ///
+        /// static CELL: OnceCell<i32> = OnceCell::new();
+        ///
+        /// fn main() {
+        ///     assert!(CELL.get().is_none());
+        ///
+        ///     std::thread::spawn(|| {
+        ///         assert_eq!(CELL.set(92), Ok(()));
+        ///     }).join().unwrap();
+        ///
+        ///     assert_eq!(CELL.set(62), Err(62));
+        ///     assert_eq!(CELL.get(), Some(&92));
+        /// }
+        /// ```
+        pub fn set(&self, value: T) -> Result<(), T> {
+            match self.try_insert(value) {
+                Ok(_) => Ok(()),
+                Err((_, value)) => Err(value),
+            }
+        }
+
+        /// Like [`set`](Self::set), but also returns a reference to the final cell value.
+        ///
+        /// # Example
+        ///
+        /// ```
+        /// use once_cell::unsync::OnceCell;
+        ///
+        /// let cell = OnceCell::new();
+        /// assert!(cell.get().is_none());
+        ///
+        /// assert_eq!(cell.try_insert(92), Ok(&92));
+        /// assert_eq!(cell.try_insert(62), Err((&92, 62)));
+        ///
+        /// assert!(cell.get().is_some());
+        /// ```
+        pub fn try_insert(&self, value: T) -> Result<&T, (&T, T)> {
+            let mut value = Some(value);
+            let res = self.get_or_init(|| unsafe { value.take().unwrap_unchecked() });
+            match value {
+                None => Ok(res),
+                Some(value) => Err((res, value)),
+            }
+        }
+
+        /// Gets the contents of the cell, initializing it with `f` if the cell
+        /// was empty.
+        ///
+        /// Many threads may call `get_or_init` concurrently with different
+        /// initializing functions, but it is guaranteed that only one function
+        /// will be executed.
+        ///
+        /// # Panics
+        ///
+        /// If `f` panics, the panic is propagated to the caller, and the cell
+        /// remains uninitialized.
+        ///
+        /// It is an error to reentrantly initialize the cell from `f`. The
+        /// exact outcome is unspecified. Current implementation deadlocks, but
+        /// this may be changed to a panic in the future.
+        ///
+        /// # Example
+        /// ```
+        /// use once_cell::sync::OnceCell;
+        ///
+        /// let cell = OnceCell::new();
+        /// let value = cell.get_or_init(|| 92);
+        /// assert_eq!(value, &92);
+        /// let value = cell.get_or_init(|| unreachable!());
+        /// assert_eq!(value, &92);
+        /// ```
+        pub fn get_or_init<F>(&self, f: F) -> &T
+        where
+            F: FnOnce() -> T,
+        {
+            enum Void {}
+            match self.get_or_try_init(|| Ok::<T, Void>(f())) {
+                Ok(val) => val,
+                Err(void) => match void {},
+            }
+        }
+
+        /// Gets the contents of the cell, initializing it with `f` if
+        /// the cell was empty. If the cell was empty and `f` failed, an
+        /// error is returned.
+        ///
+        /// # Panics
+        ///
+        /// If `f` panics, the panic is propagated to the caller, and
+        /// the cell remains uninitialized.
+        ///
+        /// It is an error to reentrantly initialize the cell from `f`.
+        /// The exact outcome is unspecified. Current implementation
+        /// deadlocks, but this may be changed to a panic in the future.
+        ///
+        /// # Example
+        /// ```
+        /// use once_cell::sync::OnceCell;
+        ///
+        /// let cell = OnceCell::new();
+        /// assert_eq!(cell.get_or_try_init(|| Err(())), Err(()));
+        /// assert!(cell.get().is_none());
+        /// let value = cell.get_or_try_init(|| -> Result<i32, ()> {
+        ///     Ok(92)
+        /// });
+        /// assert_eq!(value, Ok(&92));
+        /// assert_eq!(cell.get(), Some(&92))
+        /// ```
+        pub fn get_or_try_init<F, E>(&self, f: F) -> Result<&T, E>
+        where
+            F: FnOnce() -> Result<T, E>,
+        {
+            // Fast path check
+            if let Some(value) = self.get() {
+                return Ok(value);
+            }
+
+            self.0.initialize(f)?;
+
+            // Safe b/c value is initialized.
+            debug_assert!(self.0.is_initialized());
+            Ok(unsafe { self.get_unchecked() })
+        }
+
+        /// Takes the value out of this `OnceCell`, moving it back to an uninitialized state.
+        ///
+        /// Has no effect and returns `None` if the `OnceCell` hasn't been initialized.
+        ///
+        /// # Examples
+        ///
+        /// ```
+        /// use once_cell::sync::OnceCell;
+        ///
+        /// let mut cell: OnceCell<String> = OnceCell::new();
+        /// assert_eq!(cell.take(), None);
+        ///
+        /// let mut cell = OnceCell::new();
+        /// cell.set("hello".to_string()).unwrap();
+        /// assert_eq!(cell.take(), Some("hello".to_string()));
+        /// assert_eq!(cell.get(), None);
+        /// ```
+        ///
+        /// This method is allowed to violate the invariant of writing to a `OnceCell`
+        /// at most once because it requires `&mut` access to `self`. As with all
+        /// interior mutability, `&mut` access permits arbitrary modification:
+        ///
+        /// ```
+        /// use once_cell::sync::OnceCell;
+        ///
+        /// let mut cell: OnceCell<u32> = OnceCell::new();
+        /// cell.set(92).unwrap();
+        /// cell = OnceCell::new();
+        /// ```
+        pub fn take(&mut self) -> Option<T> {
+            mem::take(self).into_inner()
+        }
+
+        /// Consumes the `OnceCell`, returning the wrapped value. Returns
+        /// `None` if the cell was empty.
+        ///
+        /// # Examples
+        ///
+        /// ```
+        /// use once_cell::sync::OnceCell;
+        ///
+        /// let cell: OnceCell<String> = OnceCell::new();
+        /// assert_eq!(cell.into_inner(), None);
+        ///
+        /// let cell = OnceCell::new();
+        /// cell.set("hello".to_string()).unwrap();
+        /// assert_eq!(cell.into_inner(), Some("hello".to_string()));
+        /// ```
+        #[inline]
+        pub fn into_inner(self) -> Option<T> {
+            self.0.into_inner()
+        }
+    }
+
+    /// A value which is initialized on the first access.
+    ///
+    /// This type is thread-safe and can be used in statics.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use std::collections::HashMap;
+    ///
+    /// use once_cell::sync::Lazy;
+    ///
+    /// static HASHMAP: Lazy<HashMap<i32, String>> = Lazy::new(|| {
+    ///     println!("initializing");
+    ///     let mut m = HashMap::new();
+    ///     m.insert(13, "Spica".to_string());
+    ///     m.insert(74, "Hoyten".to_string());
+    ///     m
+    /// });
+    ///
+    /// fn main() {
+    ///     println!("ready");
+    ///     std::thread::spawn(|| {
+    ///         println!("{:?}", HASHMAP.get(&13));
+    ///     }).join().unwrap();
+    ///     println!("{:?}", HASHMAP.get(&74));
+    ///
+    ///     // Prints:
+    ///     //   ready
+    ///     //   initializing
+    ///     //   Some("Spica")
+    ///     //   Some("Hoyten")
+    /// }
+    /// ```
+    pub struct Lazy<T, F = fn() -> T> {
+        cell: OnceCell<T>,
+        init: Cell<Option<F>>,
+    }
+
+    impl<T: fmt::Debug, F> fmt::Debug for Lazy<T, F> {
+        fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+            f.debug_struct("Lazy").field("cell", &self.cell).field("init", &"..").finish()
+        }
+    }
+
+    // We never create a `&F` from a `&Lazy<T, F>` so it is fine to not impl
+    // `Sync` for `F`. We do create a `&mut Option<F>` in `force`, but this is
+    // properly synchronized, so it only happens once so it also does not
+    // contribute to this impl.
+    unsafe impl<T, F: Send> Sync for Lazy<T, F> where OnceCell<T>: Sync {}
+    // auto-derived `Send` impl is OK.
+
+    impl<T, F: RefUnwindSafe> RefUnwindSafe for Lazy<T, F> where OnceCell<T>: RefUnwindSafe {}
+
+    impl<T, F> Lazy<T, F> {
+        /// Creates a new lazy value with the given initializing
+        /// function.
+        pub const fn new(f: F) -> Lazy<T, F> {
+            Lazy { cell: OnceCell::new(), init: Cell::new(Some(f)) }
+        }
+
+        /// Consumes this `Lazy` returning the stored value.
+        ///
+        /// Returns `Ok(value)` if `Lazy` is initialized and `Err(f)` otherwise.
+        pub fn into_value(this: Lazy<T, F>) -> Result<T, F> {
+            let cell = this.cell;
+            let init = this.init;
+            cell.into_inner().ok_or_else(|| {
+                init.take().unwrap_or_else(|| panic!("Lazy instance has previously been poisoned"))
+            })
+        }
+    }
+
+    impl<T, F: FnOnce() -> T> Lazy<T, F> {
+        /// Forces the evaluation of this lazy value and
+        /// returns a reference to the result. This is equivalent
+        /// to the `Deref` impl, but is explicit.
+        ///
+        /// # Example
+        /// ```
+        /// use once_cell::sync::Lazy;
+        ///
+        /// let lazy = Lazy::new(|| 92);
+        ///
+        /// assert_eq!(Lazy::force(&lazy), &92);
+        /// assert_eq!(&*lazy, &92);
+        /// ```
+        pub fn force(this: &Lazy<T, F>) -> &T {
+            this.cell.get_or_init(|| match this.init.take() {
+                Some(f) => f(),
+                None => panic!("Lazy instance has previously been poisoned"),
+            })
+        }
+
+        /// Forces the evaluation of this lazy value and
+        /// returns a mutable reference to the result. This is equivalent
+        /// to the `Deref` impl, but is explicit.
+        ///
+        /// # Example
+        /// ```
+        /// use once_cell::sync::Lazy;
+        ///
+        /// let mut lazy = Lazy::new(|| 92);
+        ///
+        /// assert_eq!(Lazy::force_mut(&mut lazy), &mut 92);
+        /// ```
+        pub fn force_mut(this: &mut Lazy<T, F>) -> &mut T {
+            if this.cell.get_mut().is_none() {
+                let value = match this.init.get_mut().take() {
+                    Some(f) => f(),
+                    None => panic!("Lazy instance has previously been poisoned"),
+                };
+                this.cell = OnceCell::with_value(value);
+            }
+            this.cell.get_mut().unwrap_or_else(|| unreachable!())
+        }
+
+        /// Gets the reference to the result of this lazy value if
+        /// it was initialized, otherwise returns `None`.
+        ///
+        /// # Example
+        /// ```
+        /// use once_cell::sync::Lazy;
+        ///
+        /// let lazy = Lazy::new(|| 92);
+        ///
+        /// assert_eq!(Lazy::get(&lazy), None);
+        /// assert_eq!(&*lazy, &92);
+        /// assert_eq!(Lazy::get(&lazy), Some(&92));
+        /// ```
+        pub fn get(this: &Lazy<T, F>) -> Option<&T> {
+            this.cell.get()
+        }
+
+        /// Gets the reference to the result of this lazy value if
+        /// it was initialized, otherwise returns `None`.
+        ///
+        /// # Example
+        /// ```
+        /// use once_cell::sync::Lazy;
+        ///
+        /// let mut lazy = Lazy::new(|| 92);
+        ///
+        /// assert_eq!(Lazy::get_mut(&mut lazy), None);
+        /// assert_eq!(&*lazy, &92);
+        /// assert_eq!(Lazy::get_mut(&mut lazy), Some(&mut 92));
+        /// ```
+        pub fn get_mut(this: &mut Lazy<T, F>) -> Option<&mut T> {
+            this.cell.get_mut()
+        }
+    }
+
+    impl<T, F: FnOnce() -> T> Deref for Lazy<T, F> {
+        type Target = T;
+        fn deref(&self) -> &T {
+            Lazy::force(self)
+        }
+    }
+
+    impl<T, F: FnOnce() -> T> DerefMut for Lazy<T, F> {
+        fn deref_mut(&mut self) -> &mut T {
+            Lazy::force_mut(self)
+        }
+    }
+
+    impl<T: Default> Default for Lazy<T> {
+        /// Creates a new lazy value using `Default` as the initializing function.
+        fn default() -> Lazy<T> {
+            Lazy::new(T::default)
+        }
+    }
+
+    /// ```compile_fail
+    /// struct S(*mut ());
+    /// unsafe impl Sync for S {}
+    ///
+    /// fn share<T: Sync>(_: &T) {}
+    /// share(&once_cell::sync::OnceCell::<S>::new());
+    /// ```
+    ///
+    /// ```compile_fail
+    /// struct S(*mut ());
+    /// unsafe impl Sync for S {}
+    ///
+    /// fn share<T: Sync>(_: &T) {}
+    /// share(&once_cell::sync::Lazy::<S>::new(|| unimplemented!()));
+    /// ```
+    fn _dummy() {}
+}
+
+#[cfg(feature = "race")]
+pub mod race;
diff -pruN 43.0.0-1/rust-vendor/once_cell/src/race.rs 43.0.0-1ubuntu1/rust-vendor/once_cell/src/race.rs
--- 43.0.0-1/rust-vendor/once_cell/src/race.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/src/race.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,419 @@
+//! Thread-safe, non-blocking, "first one wins" flavor of `OnceCell`.
+//!
+//! If two threads race to initialize a type from the `race` module, they
+//! don't block, execute initialization function together, but only one of
+//! them stores the result.
+//!
+//! This module does not require `std` feature.
+//!
+//! # Atomic orderings
+//!
+//! All types in this module use `Acquire` and `Release`
+//! [atomic orderings](Ordering) for all their operations. While this is not
+//! strictly necessary for types other than `OnceBox`, it is useful for users as
+//! it allows them to be certain that after `get` or `get_or_init` returns on
+//! one thread, any side-effects caused by the setter thread prior to them
+//! calling `set` or `get_or_init` will be made visible to that thread; without
+//! it, it's possible for it to appear as if they haven't happened yet from the
+//! getter thread's perspective. This is an acceptable tradeoff to make since
+//! `Acquire` and `Release` have very little performance overhead on most
+//! architectures versus `Relaxed`.
+
+#[cfg(feature = "critical-section")]
+use portable_atomic as atomic;
+#[cfg(not(feature = "critical-section"))]
+use core::sync::atomic;
+
+use atomic::{AtomicPtr, AtomicUsize, Ordering};
+use core::cell::UnsafeCell;
+use core::marker::PhantomData;
+use core::num::NonZeroUsize;
+use core::ptr;
+
+/// A thread-safe cell which can be written to only once.
+#[derive(Default, Debug)]
+pub struct OnceNonZeroUsize {
+    inner: AtomicUsize,
+}
+
+impl OnceNonZeroUsize {
+    /// Creates a new empty cell.
+    #[inline]
+    pub const fn new() -> OnceNonZeroUsize {
+        OnceNonZeroUsize { inner: AtomicUsize::new(0) }
+    }
+
+    /// Gets the underlying value.
+    #[inline]
+    pub fn get(&self) -> Option<NonZeroUsize> {
+        let val = self.inner.load(Ordering::Acquire);
+        NonZeroUsize::new(val)
+    }
+
+    /// Sets the contents of this cell to `value`.
+    ///
+    /// Returns `Ok(())` if the cell was empty and `Err(())` if it was
+    /// full.
+    #[inline]
+    pub fn set(&self, value: NonZeroUsize) -> Result<(), ()> {
+        let exchange =
+            self.inner.compare_exchange(0, value.get(), Ordering::AcqRel, Ordering::Acquire);
+        match exchange {
+            Ok(_) => Ok(()),
+            Err(_) => Err(()),
+        }
+    }
+
+    /// Gets the contents of the cell, initializing it with `f` if the cell was
+    /// empty.
+    ///
+    /// If several threads concurrently run `get_or_init`, more than one `f` can
+    /// be called. However, all threads will return the same value, produced by
+    /// some `f`.
+    pub fn get_or_init<F>(&self, f: F) -> NonZeroUsize
+    where
+        F: FnOnce() -> NonZeroUsize,
+    {
+        enum Void {}
+        match self.get_or_try_init(|| Ok::<NonZeroUsize, Void>(f())) {
+            Ok(val) => val,
+            Err(void) => match void {},
+        }
+    }
+
+    /// Gets the contents of the cell, initializing it with `f` if
+    /// the cell was empty. If the cell was empty and `f` failed, an
+    /// error is returned.
+    ///
+    /// If several threads concurrently run `get_or_init`, more than one `f` can
+    /// be called. However, all threads will return the same value, produced by
+    /// some `f`.
+    pub fn get_or_try_init<F, E>(&self, f: F) -> Result<NonZeroUsize, E>
+    where
+        F: FnOnce() -> Result<NonZeroUsize, E>,
+    {
+        let val = self.inner.load(Ordering::Acquire);
+        let res = match NonZeroUsize::new(val) {
+            Some(it) => it,
+            None => {
+                let mut val = f()?.get();
+                let exchange =
+                    self.inner.compare_exchange(0, val, Ordering::AcqRel, Ordering::Acquire);
+                if let Err(old) = exchange {
+                    val = old;
+                }
+                unsafe { NonZeroUsize::new_unchecked(val) }
+            }
+        };
+        Ok(res)
+    }
+}
+
+/// A thread-safe cell which can be written to only once.
+#[derive(Default, Debug)]
+pub struct OnceBool {
+    inner: OnceNonZeroUsize,
+}
+
+impl OnceBool {
+    /// Creates a new empty cell.
+    #[inline]
+    pub const fn new() -> OnceBool {
+        OnceBool { inner: OnceNonZeroUsize::new() }
+    }
+
+    /// Gets the underlying value.
+    #[inline]
+    pub fn get(&self) -> Option<bool> {
+        self.inner.get().map(OnceBool::from_usize)
+    }
+
+    /// Sets the contents of this cell to `value`.
+    ///
+    /// Returns `Ok(())` if the cell was empty and `Err(())` if it was
+    /// full.
+    #[inline]
+    pub fn set(&self, value: bool) -> Result<(), ()> {
+        self.inner.set(OnceBool::to_usize(value))
+    }
+
+    /// Gets the contents of the cell, initializing it with `f` if the cell was
+    /// empty.
+    ///
+    /// If several threads concurrently run `get_or_init`, more than one `f` can
+    /// be called. However, all threads will return the same value, produced by
+    /// some `f`.
+    pub fn get_or_init<F>(&self, f: F) -> bool
+    where
+        F: FnOnce() -> bool,
+    {
+        OnceBool::from_usize(self.inner.get_or_init(|| OnceBool::to_usize(f())))
+    }
+
+    /// Gets the contents of the cell, initializing it with `f` if
+    /// the cell was empty. If the cell was empty and `f` failed, an
+    /// error is returned.
+    ///
+    /// If several threads concurrently run `get_or_init`, more than one `f` can
+    /// be called. However, all threads will return the same value, produced by
+    /// some `f`.
+    pub fn get_or_try_init<F, E>(&self, f: F) -> Result<bool, E>
+    where
+        F: FnOnce() -> Result<bool, E>,
+    {
+        self.inner.get_or_try_init(|| f().map(OnceBool::to_usize)).map(OnceBool::from_usize)
+    }
+
+    #[inline]
+    fn from_usize(value: NonZeroUsize) -> bool {
+        value.get() == 1
+    }
+
+    #[inline]
+    fn to_usize(value: bool) -> NonZeroUsize {
+        unsafe { NonZeroUsize::new_unchecked(if value { 1 } else { 2 }) }
+    }
+}
+
+/// A thread-safe cell which can be written to only once.
+pub struct OnceRef<'a, T> {
+    inner: AtomicPtr<T>,
+    ghost: PhantomData<UnsafeCell<&'a T>>,
+}
+
+// TODO: Replace UnsafeCell with SyncUnsafeCell once stabilized
+unsafe impl<'a, T: Sync> Sync for OnceRef<'a, T> {}
+
+impl<'a, T> core::fmt::Debug for OnceRef<'a, T> {
+    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+        write!(f, "OnceRef({:?})", self.inner)
+    }
+}
+
+impl<'a, T> Default for OnceRef<'a, T> {
+    fn default() -> Self {
+        Self::new()
+    }
+}
+
+impl<'a, T> OnceRef<'a, T> {
+    /// Creates a new empty cell.
+    pub const fn new() -> OnceRef<'a, T> {
+        OnceRef { inner: AtomicPtr::new(ptr::null_mut()), ghost: PhantomData }
+    }
+
+    /// Gets a reference to the underlying value.
+    pub fn get(&self) -> Option<&'a T> {
+        let ptr = self.inner.load(Ordering::Acquire);
+        unsafe { ptr.as_ref() }
+    }
+
+    /// Sets the contents of this cell to `value`.
+    ///
+    /// Returns `Ok(())` if the cell was empty and `Err(value)` if it was
+    /// full.
+    pub fn set(&self, value: &'a T) -> Result<(), ()> {
+        let ptr = value as *const T as *mut T;
+        let exchange =
+            self.inner.compare_exchange(ptr::null_mut(), ptr, Ordering::AcqRel, Ordering::Acquire);
+        match exchange {
+            Ok(_) => Ok(()),
+            Err(_) => Err(()),
+        }
+    }
+
+    /// Gets the contents of the cell, initializing it with `f` if the cell was
+    /// empty.
+    ///
+    /// If several threads concurrently run `get_or_init`, more than one `f` can
+    /// be called. However, all threads will return the same value, produced by
+    /// some `f`.
+    pub fn get_or_init<F>(&self, f: F) -> &'a T
+    where
+        F: FnOnce() -> &'a T,
+    {
+        enum Void {}
+        match self.get_or_try_init(|| Ok::<&'a T, Void>(f())) {
+            Ok(val) => val,
+            Err(void) => match void {},
+        }
+    }
+
+    /// Gets the contents of the cell, initializing it with `f` if
+    /// the cell was empty. If the cell was empty and `f` failed, an
+    /// error is returned.
+    ///
+    /// If several threads concurrently run `get_or_init`, more than one `f` can
+    /// be called. However, all threads will return the same value, produced by
+    /// some `f`.
+    pub fn get_or_try_init<F, E>(&self, f: F) -> Result<&'a T, E>
+    where
+        F: FnOnce() -> Result<&'a T, E>,
+    {
+        let mut ptr = self.inner.load(Ordering::Acquire);
+
+        if ptr.is_null() {
+            // TODO replace with `cast_mut` when MSRV reaches 1.65.0 (also in `set`)
+            ptr = f()? as *const T as *mut T;
+            let exchange = self.inner.compare_exchange(
+                ptr::null_mut(),
+                ptr,
+                Ordering::AcqRel,
+                Ordering::Acquire,
+            );
+            if let Err(old) = exchange {
+                ptr = old;
+            }
+        }
+
+        Ok(unsafe { &*ptr })
+    }
+
+    /// ```compile_fail
+    /// use once_cell::race::OnceRef;
+    ///
+    /// let mut l = OnceRef::new();
+    ///
+    /// {
+    ///     let y = 2;
+    ///     let mut r = OnceRef::new();
+    ///     r.set(&y).unwrap();
+    ///     core::mem::swap(&mut l, &mut r);
+    /// }
+    ///
+    /// // l now contains a dangling reference to y
+    /// eprintln!("uaf: {}", l.get().unwrap());
+    /// ```
+    fn _dummy() {}
+}
+
+#[cfg(feature = "alloc")]
+pub use self::once_box::OnceBox;
+
+#[cfg(feature = "alloc")]
+mod once_box {
+    use super::atomic::{AtomicPtr, Ordering};
+    use core::{marker::PhantomData, ptr};
+
+    use alloc::boxed::Box;
+
+    /// A thread-safe cell which can be written to only once.
+    pub struct OnceBox<T> {
+        inner: AtomicPtr<T>,
+        ghost: PhantomData<Option<Box<T>>>,
+    }
+
+    impl<T> core::fmt::Debug for OnceBox<T> {
+        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+            write!(f, "OnceBox({:?})", self.inner.load(Ordering::Relaxed))
+        }
+    }
+
+    impl<T> Default for OnceBox<T> {
+        fn default() -> Self {
+            Self::new()
+        }
+    }
+
+    impl<T> Drop for OnceBox<T> {
+        fn drop(&mut self) {
+            let ptr = *self.inner.get_mut();
+            if !ptr.is_null() {
+                drop(unsafe { Box::from_raw(ptr) })
+            }
+        }
+    }
+
+    impl<T> OnceBox<T> {
+        /// Creates a new empty cell.
+        pub const fn new() -> OnceBox<T> {
+            OnceBox { inner: AtomicPtr::new(ptr::null_mut()), ghost: PhantomData }
+        }
+
+        /// Gets a reference to the underlying value.
+        pub fn get(&self) -> Option<&T> {
+            let ptr = self.inner.load(Ordering::Acquire);
+            if ptr.is_null() {
+                return None;
+            }
+            Some(unsafe { &*ptr })
+        }
+
+        /// Sets the contents of this cell to `value`.
+        ///
+        /// Returns `Ok(())` if the cell was empty and `Err(value)` if it was
+        /// full.
+        pub fn set(&self, value: Box<T>) -> Result<(), Box<T>> {
+            let ptr = Box::into_raw(value);
+            let exchange = self.inner.compare_exchange(
+                ptr::null_mut(),
+                ptr,
+                Ordering::AcqRel,
+                Ordering::Acquire,
+            );
+            if exchange.is_err() {
+                let value = unsafe { Box::from_raw(ptr) };
+                return Err(value);
+            }
+            Ok(())
+        }
+
+        /// Gets the contents of the cell, initializing it with `f` if the cell was
+        /// empty.
+        ///
+        /// If several threads concurrently run `get_or_init`, more than one `f` can
+        /// be called. However, all threads will return the same value, produced by
+        /// some `f`.
+        pub fn get_or_init<F>(&self, f: F) -> &T
+        where
+            F: FnOnce() -> Box<T>,
+        {
+            enum Void {}
+            match self.get_or_try_init(|| Ok::<Box<T>, Void>(f())) {
+                Ok(val) => val,
+                Err(void) => match void {},
+            }
+        }
+
+        /// Gets the contents of the cell, initializing it with `f` if
+        /// the cell was empty. If the cell was empty and `f` failed, an
+        /// error is returned.
+        ///
+        /// If several threads concurrently run `get_or_init`, more than one `f` can
+        /// be called. However, all threads will return the same value, produced by
+        /// some `f`.
+        pub fn get_or_try_init<F, E>(&self, f: F) -> Result<&T, E>
+        where
+            F: FnOnce() -> Result<Box<T>, E>,
+        {
+            let mut ptr = self.inner.load(Ordering::Acquire);
+
+            if ptr.is_null() {
+                let val = f()?;
+                ptr = Box::into_raw(val);
+                let exchange = self.inner.compare_exchange(
+                    ptr::null_mut(),
+                    ptr,
+                    Ordering::AcqRel,
+                    Ordering::Acquire,
+                );
+                if let Err(old) = exchange {
+                    drop(unsafe { Box::from_raw(ptr) });
+                    ptr = old;
+                }
+            };
+            Ok(unsafe { &*ptr })
+        }
+    }
+
+    unsafe impl<T: Sync + Send> Sync for OnceBox<T> {}
+
+    /// ```compile_fail
+    /// struct S(*mut ());
+    /// unsafe impl Sync for S {}
+    ///
+    /// fn share<T: Sync>(_: &T) {}
+    /// share(&once_cell::race::OnceBox::<S>::new());
+    /// ```
+    fn _dummy() {}
+}
diff -pruN 43.0.0-1/rust-vendor/once_cell/tests/it/main.rs 43.0.0-1ubuntu1/rust-vendor/once_cell/tests/it/main.rs
--- 43.0.0-1/rust-vendor/once_cell/tests/it/main.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/tests/it/main.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,12 @@
+mod unsync_once_cell;
+#[cfg(any(feature = "std", feature = "critical-section"))]
+mod sync_once_cell;
+
+mod unsync_lazy;
+#[cfg(any(feature = "std", feature = "critical-section"))]
+mod sync_lazy;
+
+#[cfg(feature = "race")]
+mod race;
+#[cfg(all(feature = "race", feature = "alloc"))]
+mod race_once_box;
diff -pruN 43.0.0-1/rust-vendor/once_cell/tests/it/race.rs 43.0.0-1ubuntu1/rust-vendor/once_cell/tests/it/race.rs
--- 43.0.0-1/rust-vendor/once_cell/tests/it/race.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/tests/it/race.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,128 @@
+#[cfg(feature = "std")]
+use std::sync::Barrier;
+use std::{
+    num::NonZeroUsize,
+    sync::atomic::{AtomicUsize, Ordering::SeqCst},
+    thread::scope,
+};
+
+use once_cell::race::{OnceBool, OnceNonZeroUsize};
+
+#[test]
+fn once_non_zero_usize_smoke_test() {
+    let cnt = AtomicUsize::new(0);
+    let cell = OnceNonZeroUsize::new();
+    let val = NonZeroUsize::new(92).unwrap();
+    scope(|s| {
+        s.spawn(|| {
+            assert_eq!(
+                cell.get_or_init(|| {
+                    cnt.fetch_add(1, SeqCst);
+                    val
+                }),
+                val
+            );
+            assert_eq!(cnt.load(SeqCst), 1);
+
+            assert_eq!(
+                cell.get_or_init(|| {
+                    cnt.fetch_add(1, SeqCst);
+                    val
+                }),
+                val
+            );
+            assert_eq!(cnt.load(SeqCst), 1);
+        });
+    });
+    assert_eq!(cell.get(), Some(val));
+    assert_eq!(cnt.load(SeqCst), 1);
+}
+
+#[test]
+fn once_non_zero_usize_set() {
+    let val1 = NonZeroUsize::new(92).unwrap();
+    let val2 = NonZeroUsize::new(62).unwrap();
+
+    let cell = OnceNonZeroUsize::new();
+
+    assert!(cell.set(val1).is_ok());
+    assert_eq!(cell.get(), Some(val1));
+
+    assert!(cell.set(val2).is_err());
+    assert_eq!(cell.get(), Some(val1));
+}
+
+#[cfg(feature = "std")]
+#[test]
+fn once_non_zero_usize_first_wins() {
+    let val1 = NonZeroUsize::new(92).unwrap();
+    let val2 = NonZeroUsize::new(62).unwrap();
+
+    let cell = OnceNonZeroUsize::new();
+
+    let b1 = Barrier::new(2);
+    let b2 = Barrier::new(2);
+    let b3 = Barrier::new(2);
+    scope(|s| {
+        s.spawn(|| {
+            let r1 = cell.get_or_init(|| {
+                b1.wait();
+                b2.wait();
+                val1
+            });
+            assert_eq!(r1, val1);
+            b3.wait();
+        });
+        b1.wait();
+        s.spawn(|| {
+            let r2 = cell.get_or_init(|| {
+                b2.wait();
+                b3.wait();
+                val2
+            });
+            assert_eq!(r2, val1);
+        });
+    });
+
+    assert_eq!(cell.get(), Some(val1));
+}
+
+#[test]
+fn once_bool_smoke_test() {
+    let cnt = AtomicUsize::new(0);
+    let cell = OnceBool::new();
+    scope(|s| {
+        s.spawn(|| {
+            assert_eq!(
+                cell.get_or_init(|| {
+                    cnt.fetch_add(1, SeqCst);
+                    false
+                }),
+                false
+            );
+            assert_eq!(cnt.load(SeqCst), 1);
+
+            assert_eq!(
+                cell.get_or_init(|| {
+                    cnt.fetch_add(1, SeqCst);
+                    false
+                }),
+                false
+            );
+            assert_eq!(cnt.load(SeqCst), 1);
+        });
+    });
+    assert_eq!(cell.get(), Some(false));
+    assert_eq!(cnt.load(SeqCst), 1);
+}
+
+#[test]
+fn once_bool_set() {
+    let cell = OnceBool::new();
+
+    assert!(cell.set(false).is_ok());
+    assert_eq!(cell.get(), Some(false));
+
+    assert!(cell.set(true).is_err());
+    assert_eq!(cell.get(), Some(false));
+}
diff -pruN 43.0.0-1/rust-vendor/once_cell/tests/it/race_once_box.rs 43.0.0-1ubuntu1/rust-vendor/once_cell/tests/it/race_once_box.rs
--- 43.0.0-1/rust-vendor/once_cell/tests/it/race_once_box.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/tests/it/race_once_box.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,145 @@
+#[cfg(feature = "std")]
+use std::sync::Barrier;
+use std::sync::{
+    atomic::{AtomicUsize, Ordering::SeqCst},
+    Arc,
+};
+
+use once_cell::race::OnceBox;
+
+#[derive(Default)]
+struct Heap {
+    total: Arc<AtomicUsize>,
+}
+
+#[derive(Debug)]
+struct Pebble<T> {
+    val: T,
+    total: Arc<AtomicUsize>,
+}
+
+impl<T> Drop for Pebble<T> {
+    fn drop(&mut self) {
+        self.total.fetch_sub(1, SeqCst);
+    }
+}
+
+impl Heap {
+    fn total(&self) -> usize {
+        self.total.load(SeqCst)
+    }
+    fn new_pebble<T>(&self, val: T) -> Pebble<T> {
+        self.total.fetch_add(1, SeqCst);
+        Pebble { val, total: Arc::clone(&self.total) }
+    }
+}
+
+#[cfg(feature = "std")]
+#[test]
+fn once_box_smoke_test() {
+    use std::thread::scope;
+
+    let heap = Heap::default();
+    let global_cnt = AtomicUsize::new(0);
+    let cell = OnceBox::new();
+    let b = Barrier::new(128);
+    scope(|s| {
+        for _ in 0..128 {
+            s.spawn(|| {
+                let local_cnt = AtomicUsize::new(0);
+                cell.get_or_init(|| {
+                    global_cnt.fetch_add(1, SeqCst);
+                    local_cnt.fetch_add(1, SeqCst);
+                    b.wait();
+                    Box::new(heap.new_pebble(()))
+                });
+                assert_eq!(local_cnt.load(SeqCst), 1);
+
+                cell.get_or_init(|| {
+                    global_cnt.fetch_add(1, SeqCst);
+                    local_cnt.fetch_add(1, SeqCst);
+                    Box::new(heap.new_pebble(()))
+                });
+                assert_eq!(local_cnt.load(SeqCst), 1);
+            });
+        }
+    });
+    assert!(cell.get().is_some());
+    assert!(global_cnt.load(SeqCst) > 10);
+
+    assert_eq!(heap.total(), 1);
+    drop(cell);
+    assert_eq!(heap.total(), 0);
+}
+
+#[test]
+fn once_box_set() {
+    let heap = Heap::default();
+    let cell = OnceBox::new();
+    assert!(cell.get().is_none());
+
+    assert!(cell.set(Box::new(heap.new_pebble("hello"))).is_ok());
+    assert_eq!(cell.get().unwrap().val, "hello");
+    assert_eq!(heap.total(), 1);
+
+    assert!(cell.set(Box::new(heap.new_pebble("world"))).is_err());
+    assert_eq!(cell.get().unwrap().val, "hello");
+    assert_eq!(heap.total(), 1);
+
+    drop(cell);
+    assert_eq!(heap.total(), 0);
+}
+
+#[cfg(feature = "std")]
+#[test]
+fn once_box_first_wins() {
+    use std::thread::scope;
+
+    let cell = OnceBox::new();
+    let val1 = 92;
+    let val2 = 62;
+
+    let b1 = Barrier::new(2);
+    let b2 = Barrier::new(2);
+    let b3 = Barrier::new(2);
+    scope(|s| {
+        s.spawn(|| {
+            let r1 = cell.get_or_init(|| {
+                b1.wait();
+                b2.wait();
+                Box::new(val1)
+            });
+            assert_eq!(*r1, val1);
+            b3.wait();
+        });
+        b1.wait();
+        s.spawn(|| {
+            let r2 = cell.get_or_init(|| {
+                b2.wait();
+                b3.wait();
+                Box::new(val2)
+            });
+            assert_eq!(*r2, val1);
+        });
+    });
+
+    assert_eq!(cell.get(), Some(&val1));
+}
+
+#[test]
+fn once_box_reentrant() {
+    let cell = OnceBox::new();
+    let res = cell.get_or_init(|| {
+        cell.get_or_init(|| Box::new("hello".to_string()));
+        Box::new("world".to_string())
+    });
+    assert_eq!(res, "hello");
+}
+
+#[test]
+fn once_box_default() {
+    struct Foo;
+
+    let cell: OnceBox<Foo> = Default::default();
+    assert!(cell.get().is_none());
+}
diff -pruN 43.0.0-1/rust-vendor/once_cell/tests/it/sync_lazy.rs 43.0.0-1ubuntu1/rust-vendor/once_cell/tests/it/sync_lazy.rs
--- 43.0.0-1/rust-vendor/once_cell/tests/it/sync_lazy.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/tests/it/sync_lazy.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,176 @@
+use std::{
+    cell::Cell,
+    sync::atomic::{AtomicUsize, Ordering::SeqCst},
+    thread::scope,
+};
+
+use once_cell::sync::{Lazy, OnceCell};
+
+#[test]
+fn lazy_new() {
+    let called = AtomicUsize::new(0);
+    let x = Lazy::new(|| {
+        called.fetch_add(1, SeqCst);
+        92
+    });
+
+    assert_eq!(called.load(SeqCst), 0);
+
+    scope(|s| {
+        s.spawn(|| {
+            let y = *x - 30;
+            assert_eq!(y, 62);
+            assert_eq!(called.load(SeqCst), 1);
+        });
+    });
+
+    let y = *x - 30;
+    assert_eq!(y, 62);
+    assert_eq!(called.load(SeqCst), 1);
+}
+
+#[test]
+fn lazy_deref_mut() {
+    let called = AtomicUsize::new(0);
+    let mut x = Lazy::new(|| {
+        called.fetch_add(1, SeqCst);
+        92
+    });
+
+    assert_eq!(called.load(SeqCst), 0);
+
+    let y = *x - 30;
+    assert_eq!(y, 62);
+    assert_eq!(called.load(SeqCst), 1);
+
+    *x /= 2;
+    assert_eq!(*x, 46);
+    assert_eq!(called.load(SeqCst), 1);
+}
+
+#[test]
+fn lazy_force_mut() {
+    let called = Cell::new(0);
+    let mut x = Lazy::new(|| {
+        called.set(called.get() + 1);
+        92
+    });
+    assert_eq!(called.get(), 0);
+    let v = Lazy::force_mut(&mut x);
+    assert_eq!(called.get(), 1);
+
+    *v /= 2;
+    assert_eq!(*x, 46);
+    assert_eq!(called.get(), 1);
+}
+
+#[test]
+fn lazy_get_mut() {
+    let called = Cell::new(0);
+    let mut x: Lazy<u32, _> = Lazy::new(|| {
+        called.set(called.get() + 1);
+        92
+    });
+
+    assert_eq!(called.get(), 0);
+    assert_eq!(*x, 92);
+
+    let mut_ref: &mut u32 = Lazy::get_mut(&mut x).unwrap();
+    assert_eq!(called.get(), 1);
+
+    *mut_ref /= 2;
+    assert_eq!(*x, 46);
+    assert_eq!(called.get(), 1);
+}
+
+#[test]
+fn lazy_default() {
+    static CALLED: AtomicUsize = AtomicUsize::new(0);
+
+    struct Foo(u8);
+    impl Default for Foo {
+        fn default() -> Self {
+            CALLED.fetch_add(1, SeqCst);
+            Foo(42)
+        }
+    }
+
+    let lazy: Lazy<std::sync::Mutex<Foo>> = <_>::default();
+
+    assert_eq!(CALLED.load(SeqCst), 0);
+
+    assert_eq!(lazy.lock().unwrap().0, 42);
+    assert_eq!(CALLED.load(SeqCst), 1);
+
+    lazy.lock().unwrap().0 = 21;
+
+    assert_eq!(lazy.lock().unwrap().0, 21);
+    assert_eq!(CALLED.load(SeqCst), 1);
+}
+
+#[test]
+fn static_lazy() {
+    static XS: Lazy<Vec<i32>> = Lazy::new(|| {
+        let mut xs = Vec::new();
+        xs.push(1);
+        xs.push(2);
+        xs.push(3);
+        xs
+    });
+    scope(|s| {
+        s.spawn(|| {
+            assert_eq!(&*XS, &vec![1, 2, 3]);
+        });
+    });
+    assert_eq!(&*XS, &vec![1, 2, 3]);
+}
+
+#[test]
+fn static_lazy_via_fn() {
+    fn xs() -> &'static Vec<i32> {
+        static XS: OnceCell<Vec<i32>> = OnceCell::new();
+        XS.get_or_init(|| {
+            let mut xs = Vec::new();
+            xs.push(1);
+            xs.push(2);
+            xs.push(3);
+            xs
+        })
+    }
+    assert_eq!(xs(), &vec![1, 2, 3]);
+}
+
+#[test]
+fn lazy_into_value() {
+    let l: Lazy<i32, _> = Lazy::new(|| panic!());
+    assert!(matches!(Lazy::into_value(l), Err(_)));
+    let l = Lazy::new(|| -> i32 { 92 });
+    Lazy::force(&l);
+    assert!(matches!(Lazy::into_value(l), Ok(92)));
+}
+
+#[test]
+fn lazy_poisoning() {
+    let x: Lazy<String> = Lazy::new(|| panic!("kaboom"));
+    for _ in 0..2 {
+        let res = std::panic::catch_unwind(|| x.len());
+        assert!(res.is_err());
+    }
+}
+
+#[test]
+// https://github.com/rust-lang/rust/issues/34761#issuecomment-256320669
+fn arrrrrrrrrrrrrrrrrrrrrr() {
+    let lazy: Lazy<&String, _>;
+    {
+        let s = String::new();
+        lazy = Lazy::new(|| &s);
+        _ = *lazy;
+    }
+}
+
+#[test]
+fn lazy_is_sync_send() {
+    fn assert_traits<T: Send + Sync>() {}
+    assert_traits::<Lazy<String>>();
+}
diff -pruN 43.0.0-1/rust-vendor/once_cell/tests/it/sync_once_cell.rs 43.0.0-1ubuntu1/rust-vendor/once_cell/tests/it/sync_once_cell.rs
--- 43.0.0-1/rust-vendor/once_cell/tests/it/sync_once_cell.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/tests/it/sync_once_cell.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,309 @@
+use std::{
+    sync::atomic::{AtomicUsize, Ordering::SeqCst},
+    thread::scope,
+};
+
+#[cfg(feature = "std")]
+use std::sync::Barrier;
+
+#[cfg(not(feature = "std"))]
+use core::cell::Cell;
+
+use once_cell::sync::{Lazy, OnceCell};
+
+#[test]
+fn once_cell() {
+    let c = OnceCell::new();
+    assert!(c.get().is_none());
+    scope(|s| {
+        s.spawn(|| {
+            c.get_or_init(|| 92);
+            assert_eq!(c.get(), Some(&92));
+        });
+    });
+    c.get_or_init(|| panic!("Kabom!"));
+    assert_eq!(c.get(), Some(&92));
+}
+
+#[test]
+fn once_cell_with_value() {
+    static CELL: OnceCell<i32> = OnceCell::with_value(12);
+    assert_eq!(CELL.get(), Some(&12));
+}
+
+#[test]
+fn once_cell_get_mut() {
+    let mut c = OnceCell::new();
+    assert!(c.get_mut().is_none());
+    c.set(90).unwrap();
+    *c.get_mut().unwrap() += 2;
+    assert_eq!(c.get_mut(), Some(&mut 92));
+}
+
+#[test]
+fn once_cell_get_unchecked() {
+    let c = OnceCell::new();
+    c.set(92).unwrap();
+    unsafe {
+        assert_eq!(c.get_unchecked(), &92);
+    }
+}
+
+#[test]
+fn once_cell_drop() {
+    static DROP_CNT: AtomicUsize = AtomicUsize::new(0);
+    struct Dropper;
+    impl Drop for Dropper {
+        fn drop(&mut self) {
+            DROP_CNT.fetch_add(1, SeqCst);
+        }
+    }
+
+    let x = OnceCell::new();
+    scope(|s| {
+        s.spawn(|| {
+            x.get_or_init(|| Dropper);
+            assert_eq!(DROP_CNT.load(SeqCst), 0);
+            drop(x);
+        });
+    });
+    assert_eq!(DROP_CNT.load(SeqCst), 1);
+}
+
+#[test]
+fn once_cell_drop_empty() {
+    let x = OnceCell::<String>::new();
+    drop(x);
+}
+
+#[test]
+fn clone() {
+    let s = OnceCell::new();
+    let c = s.clone();
+    assert!(c.get().is_none());
+
+    s.set("hello".to_string()).unwrap();
+    let c = s.clone();
+    assert_eq!(c.get().map(String::as_str), Some("hello"));
+}
+
+#[test]
+fn get_or_try_init() {
+    let cell: OnceCell<String> = OnceCell::new();
+    assert!(cell.get().is_none());
+
+    let res = std::panic::catch_unwind(|| cell.get_or_try_init(|| -> Result<_, ()> { panic!() }));
+    assert!(res.is_err());
+    assert!(cell.get().is_none());
+
+    assert_eq!(cell.get_or_try_init(|| Err(())), Err(()));
+
+    assert_eq!(cell.get_or_try_init(|| Ok::<_, ()>("hello".to_string())), Ok(&"hello".to_string()));
+    assert_eq!(cell.get(), Some(&"hello".to_string()));
+}
+
+#[cfg(feature = "std")]
+#[test]
+fn wait() {
+    let cell: OnceCell<String> = OnceCell::new();
+    scope(|s| {
+        s.spawn(|| cell.set("hello".to_string()));
+        let greeting = cell.wait();
+        assert_eq!(greeting, "hello")
+    });
+}
+
+#[cfg(feature = "std")]
+#[test]
+fn get_or_init_stress() {
+    let n_threads = if cfg!(miri) { 30 } else { 1_000 };
+    let n_cells = if cfg!(miri) { 30 } else { 1_000 };
+    let cells: Vec<_> = std::iter::repeat_with(|| (Barrier::new(n_threads), OnceCell::new()))
+        .take(n_cells)
+        .collect();
+    scope(|s| {
+        for t in 0..n_threads {
+            let cells = &cells;
+            s.spawn(move || {
+                for (i, (b, s)) in cells.iter().enumerate() {
+                    b.wait();
+                    let j = if t % 2 == 0 { s.wait() } else { s.get_or_init(|| i) };
+                    assert_eq!(*j, i);
+                }
+            });
+        }
+    });
+}
+
+#[test]
+fn from_impl() {
+    assert_eq!(OnceCell::from("value").get(), Some(&"value"));
+    assert_ne!(OnceCell::from("foo").get(), Some(&"bar"));
+}
+
+#[test]
+fn partialeq_impl() {
+    assert!(OnceCell::from("value") == OnceCell::from("value"));
+    assert!(OnceCell::from("foo") != OnceCell::from("bar"));
+
+    assert!(OnceCell::<String>::new() == OnceCell::new());
+    assert!(OnceCell::<String>::new() != OnceCell::from("value".to_owned()));
+}
+
+#[test]
+fn into_inner() {
+    let cell: OnceCell<String> = OnceCell::new();
+    assert_eq!(cell.into_inner(), None);
+    let cell = OnceCell::new();
+    cell.set("hello".to_string()).unwrap();
+    assert_eq!(cell.into_inner(), Some("hello".to_string()));
+}
+
+#[test]
+fn debug_impl() {
+    let cell = OnceCell::new();
+    assert_eq!(format!("{:#?}", cell), "OnceCell(Uninit)");
+    cell.set(vec!["hello", "world"]).unwrap();
+    assert_eq!(
+        format!("{:#?}", cell),
+        r#"OnceCell(
+    [
+        "hello",
+        "world",
+    ],
+)"#
+    );
+}
+
+#[test]
+#[cfg_attr(miri, ignore)] // miri doesn't support processes
+#[cfg(feature = "std")]
+fn reentrant_init() {
+    let examples_dir = {
+        let mut exe = std::env::current_exe().unwrap();
+        exe.pop();
+        exe.pop();
+        exe.push("examples");
+        exe
+    };
+    let bin = examples_dir
+        .join("reentrant_init_deadlocks")
+        .with_extension(std::env::consts::EXE_EXTENSION);
+    let mut guard = Guard { child: std::process::Command::new(bin).spawn().unwrap() };
+    std::thread::sleep(std::time::Duration::from_secs(2));
+    let status = guard.child.try_wait().unwrap();
+    assert!(status.is_none());
+
+    struct Guard {
+        child: std::process::Child,
+    }
+
+    impl Drop for Guard {
+        fn drop(&mut self) {
+            let _ = self.child.kill();
+        }
+    }
+}
+
+#[cfg(not(feature = "std"))]
+#[test]
+#[should_panic(expected = "reentrant init")]
+fn reentrant_init() {
+    let x: OnceCell<Box<i32>> = OnceCell::new();
+    let dangling_ref: Cell<Option<&i32>> = Cell::new(None);
+    x.get_or_init(|| {
+        let r = x.get_or_init(|| Box::new(92));
+        dangling_ref.set(Some(r));
+        Box::new(62)
+    });
+    eprintln!("use after free: {:?}", dangling_ref.get().unwrap());
+}
+
+#[test]
+fn eval_once_macro() {
+    macro_rules! eval_once {
+        (|| -> $ty:ty {
+            $($body:tt)*
+        }) => {{
+            static ONCE_CELL: OnceCell<$ty> = OnceCell::new();
+            fn init() -> $ty {
+                $($body)*
+            }
+            ONCE_CELL.get_or_init(init)
+        }};
+    }
+
+    let fib: &'static Vec<i32> = eval_once! {
+        || -> Vec<i32> {
+            let mut res = vec![1, 1];
+            for i in 0..10 {
+                let next = res[i] + res[i + 1];
+                res.push(next);
+            }
+            res
+        }
+    };
+    assert_eq!(fib[5], 8)
+}
+
+#[test]
+fn once_cell_does_not_leak_partially_constructed_boxes() {
+    let n_tries = if cfg!(miri) { 10 } else { 100 };
+    let n_readers = 10;
+    let n_writers = 3;
+    const MSG: &str = "Hello, World";
+
+    for _ in 0..n_tries {
+        let cell: OnceCell<String> = OnceCell::new();
+        scope(|scope| {
+            for _ in 0..n_readers {
+                scope.spawn(|| loop {
+                    if let Some(msg) = cell.get() {
+                        assert_eq!(msg, MSG);
+                        break;
+                    }
+                });
+            }
+            for _ in 0..n_writers {
+                let _ = scope.spawn(|| cell.set(MSG.to_owned()));
+            }
+        });
+    }
+}
+
+#[cfg(feature = "std")]
+#[test]
+fn get_does_not_block() {
+    let cell = OnceCell::new();
+    let barrier = Barrier::new(2);
+    scope(|scope| {
+        scope.spawn(|| {
+            cell.get_or_init(|| {
+                barrier.wait();
+                barrier.wait();
+                "hello".to_string()
+            });
+        });
+        barrier.wait();
+        assert_eq!(cell.get(), None);
+        barrier.wait();
+    });
+    assert_eq!(cell.get(), Some(&"hello".to_string()));
+}
+
+#[test]
+// https://github.com/rust-lang/rust/issues/34761#issuecomment-256320669
+fn arrrrrrrrrrrrrrrrrrrrrr() {
+    let cell = OnceCell::new();
+    {
+        let s = String::new();
+        cell.set(&s).unwrap();
+    }
+}
+
+#[test]
+fn once_cell_is_sync_send() {
+    fn assert_traits<T: Send + Sync>() {}
+    assert_traits::<OnceCell<String>>();
+    assert_traits::<Lazy<String>>();
+}
diff -pruN 43.0.0-1/rust-vendor/once_cell/tests/it/unsync_lazy.rs 43.0.0-1ubuntu1/rust-vendor/once_cell/tests/it/unsync_lazy.rs
--- 43.0.0-1/rust-vendor/once_cell/tests/it/unsync_lazy.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/tests/it/unsync_lazy.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,134 @@
+use core::{
+    cell::Cell,
+    sync::atomic::{AtomicUsize, Ordering::SeqCst},
+};
+
+use once_cell::unsync::Lazy;
+
+#[test]
+fn lazy_new() {
+    let called = Cell::new(0);
+    let x = Lazy::new(|| {
+        called.set(called.get() + 1);
+        92
+    });
+
+    assert_eq!(called.get(), 0);
+
+    let y = *x - 30;
+    assert_eq!(y, 62);
+    assert_eq!(called.get(), 1);
+
+    let y = *x - 30;
+    assert_eq!(y, 62);
+    assert_eq!(called.get(), 1);
+}
+
+#[test]
+fn lazy_deref_mut() {
+    let called = Cell::new(0);
+    let mut x = Lazy::new(|| {
+        called.set(called.get() + 1);
+        92
+    });
+
+    assert_eq!(called.get(), 0);
+
+    let y = *x - 30;
+    assert_eq!(y, 62);
+    assert_eq!(called.get(), 1);
+
+    *x /= 2;
+    assert_eq!(*x, 46);
+    assert_eq!(called.get(), 1);
+}
+
+#[test]
+fn lazy_force_mut() {
+    let called = Cell::new(0);
+    let mut x = Lazy::new(|| {
+        called.set(called.get() + 1);
+        92
+    });
+    assert_eq!(called.get(), 0);
+    let v = Lazy::force_mut(&mut x);
+    assert_eq!(called.get(), 1);
+
+    *v /= 2;
+    assert_eq!(*x, 46);
+    assert_eq!(called.get(), 1);
+}
+
+#[test]
+fn lazy_get_mut() {
+    let called = Cell::new(0);
+    let mut x: Lazy<u32, _> = Lazy::new(|| {
+        called.set(called.get() + 1);
+        92
+    });
+
+    assert_eq!(called.get(), 0);
+    assert_eq!(*x, 92);
+
+    let mut_ref: &mut u32 = Lazy::get_mut(&mut x).unwrap();
+    assert_eq!(called.get(), 1);
+
+    *mut_ref /= 2;
+    assert_eq!(*x, 46);
+    assert_eq!(called.get(), 1);
+}
+
+#[test]
+fn lazy_default() {
+    static CALLED: AtomicUsize = AtomicUsize::new(0);
+
+    struct Foo(u8);
+    impl Default for Foo {
+        fn default() -> Self {
+            CALLED.fetch_add(1, SeqCst);
+            Foo(42)
+        }
+    }
+
+    let lazy: Lazy<std::sync::Mutex<Foo>> = <_>::default();
+
+    assert_eq!(CALLED.load(SeqCst), 0);
+
+    assert_eq!(lazy.lock().unwrap().0, 42);
+    assert_eq!(CALLED.load(SeqCst), 1);
+
+    lazy.lock().unwrap().0 = 21;
+
+    assert_eq!(lazy.lock().unwrap().0, 21);
+    assert_eq!(CALLED.load(SeqCst), 1);
+}
+
+#[test]
+fn lazy_into_value() {
+    let l: Lazy<i32, _> = Lazy::new(|| panic!());
+    assert!(matches!(Lazy::into_value(l), Err(_)));
+    let l = Lazy::new(|| -> i32 { 92 });
+    Lazy::force(&l);
+    assert!(matches!(Lazy::into_value(l), Ok(92)));
+}
+
+#[test]
+#[cfg(feature = "std")]
+fn lazy_poisoning() {
+    let x: Lazy<String> = Lazy::new(|| panic!("kaboom"));
+    for _ in 0..2 {
+        let res = std::panic::catch_unwind(|| x.len());
+        assert!(res.is_err());
+    }
+}
+
+#[test]
+// https://github.com/rust-lang/rust/issues/34761#issuecomment-256320669
+fn arrrrrrrrrrrrrrrrrrrrrr() {
+    let lazy: Lazy<&String, _>;
+    {
+        let s = String::new();
+        lazy = Lazy::new(|| &s);
+        _ = *lazy;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/once_cell/tests/it/unsync_once_cell.rs 43.0.0-1ubuntu1/rust-vendor/once_cell/tests/it/unsync_once_cell.rs
--- 43.0.0-1/rust-vendor/once_cell/tests/it/unsync_once_cell.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/once_cell/tests/it/unsync_once_cell.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,154 @@
+use core::{
+    cell::Cell,
+    sync::atomic::{AtomicUsize, Ordering::SeqCst},
+};
+
+use once_cell::unsync::OnceCell;
+
+#[test]
+fn once_cell() {
+    let c = OnceCell::new();
+    assert!(c.get().is_none());
+    c.get_or_init(|| 92);
+    assert_eq!(c.get(), Some(&92));
+
+    c.get_or_init(|| panic!("Kabom!"));
+    assert_eq!(c.get(), Some(&92));
+}
+
+#[test]
+fn once_cell_with_value() {
+    const CELL: OnceCell<i32> = OnceCell::with_value(12);
+    let cell = CELL;
+    assert_eq!(cell.get(), Some(&12));
+}
+
+#[test]
+fn once_cell_get_mut() {
+    let mut c = OnceCell::new();
+    assert!(c.get_mut().is_none());
+    c.set(90).unwrap();
+    *c.get_mut().unwrap() += 2;
+    assert_eq!(c.get_mut(), Some(&mut 92));
+}
+
+#[test]
+fn once_cell_drop() {
+    static DROP_CNT: AtomicUsize = AtomicUsize::new(0);
+    struct Dropper;
+    impl Drop for Dropper {
+        fn drop(&mut self) {
+            DROP_CNT.fetch_add(1, SeqCst);
+        }
+    }
+
+    let x = OnceCell::new();
+    x.get_or_init(|| Dropper);
+    assert_eq!(DROP_CNT.load(SeqCst), 0);
+    drop(x);
+    assert_eq!(DROP_CNT.load(SeqCst), 1);
+}
+
+#[test]
+fn once_cell_drop_empty() {
+    let x = OnceCell::<String>::new();
+    drop(x);
+}
+
+#[test]
+fn clone() {
+    let s = OnceCell::new();
+    let c = s.clone();
+    assert!(c.get().is_none());
+
+    s.set("hello".to_string()).unwrap();
+    let c = s.clone();
+    assert_eq!(c.get().map(String::as_str), Some("hello"));
+}
+
+#[test]
+fn get_or_try_init() {
+    let cell: OnceCell<String> = OnceCell::new();
+    assert!(cell.get().is_none());
+
+    let res = std::panic::catch_unwind(|| cell.get_or_try_init(|| -> Result<_, ()> { panic!() }));
+    assert!(res.is_err());
+    assert!(cell.get().is_none());
+
+    assert_eq!(cell.get_or_try_init(|| Err(())), Err(()));
+
+    assert_eq!(cell.get_or_try_init(|| Ok::<_, ()>("hello".to_string())), Ok(&"hello".to_string()));
+    assert_eq!(cell.get(), Some(&"hello".to_string()));
+}
+
+#[test]
+fn from_impl() {
+    assert_eq!(OnceCell::from("value").get(), Some(&"value"));
+    assert_ne!(OnceCell::from("foo").get(), Some(&"bar"));
+}
+
+#[test]
+fn partialeq_impl() {
+    assert!(OnceCell::from("value") == OnceCell::from("value"));
+    assert!(OnceCell::from("foo") != OnceCell::from("bar"));
+
+    assert!(OnceCell::<String>::new() == OnceCell::new());
+    assert!(OnceCell::<String>::new() != OnceCell::from("value".to_owned()));
+}
+
+#[test]
+fn into_inner() {
+    let cell: OnceCell<String> = OnceCell::new();
+    assert_eq!(cell.into_inner(), None);
+    let cell = OnceCell::new();
+    cell.set("hello".to_string()).unwrap();
+    assert_eq!(cell.into_inner(), Some("hello".to_string()));
+}
+
+#[test]
+fn debug_impl() {
+    let cell = OnceCell::new();
+    assert_eq!(format!("{:#?}", cell), "OnceCell(Uninit)");
+    cell.set(vec!["hello", "world"]).unwrap();
+    assert_eq!(
+        format!("{:#?}", cell),
+        r#"OnceCell(
+    [
+        "hello",
+        "world",
+    ],
+)"#
+    );
+}
+
+#[test]
+#[should_panic(expected = "reentrant init")]
+fn reentrant_init() {
+    let x: OnceCell<Box<i32>> = OnceCell::new();
+    let dangling_ref: Cell<Option<&i32>> = Cell::new(None);
+    x.get_or_init(|| {
+        let r = x.get_or_init(|| Box::new(92));
+        dangling_ref.set(Some(r));
+        Box::new(62)
+    });
+    eprintln!("use after free: {:?}", dangling_ref.get().unwrap());
+}
+
+#[test]
+fn aliasing_in_get() {
+    let x = OnceCell::new();
+    x.set(42).unwrap();
+    let at_x = x.get().unwrap(); // --- (shared) borrow of inner `Option<T>` --+
+    let _ = x.set(27); // <-- temporary (unique) borrow of inner `Option<T>`   |
+    println!("{}", at_x); // <------- up until here ---------------------------+
+}
+
+#[test]
+// https://github.com/rust-lang/rust/issues/34761#issuecomment-256320669
+fn arrrrrrrrrrrrrrrrrrrrrr() {
+    let cell = OnceCell::new();
+    {
+        let s = String::new();
+        cell.set(&s).unwrap();
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/openssl/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/openssl/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"CHANGELOG.md":"a87e31ce42295007fa8b41bcb91686a8eeb6044c21a7603cdea55fb82d29dc45","Cargo.lock":"86b49eee718319a4ad605b2c0593312c1e79c933a7e71c34e2da87227ba11664","Cargo.toml":"944775f0bf07e0edb3f1d923b79c59494a5f9f586e974cbf4796e1cba17b895f","LICENSE":"f3d4287b4a21c5176fea2f9bd4ae800696004e2fb8e05cbc818be513f188a941","README.md":"c5ddde25c2756a1115daaa671fb4297cdc83bf23009c8356ba65b5311d0dd30d","build.rs":"04a0d492f539b96444229d03c977386fc6360a03eca34bdb2a064e439ee45b85","examples/mk_certs.rs":"012569fc734c314c5d3c1c9dc8ae64a32db4cfa917e8fbc363c1eef118600d0a","src/aes.rs":"c1ad71fc0a76dd7fbb07864583e47c7da8764f8e6029a4ff8c310bf2fde63e15","src/asn1.rs":"d250233df5913879a6dc205e16f2404bd7512e29a2b8dab2b9ea83c670ee85be","src/base64.rs":"9087b546206c3a824aec3af6cf0e54d890515cc62d859951fd46ef72fbeba3aa","src/bio.rs":"41ba3b55f3e8ddd29615029ab86661df8d26be0ff4aeef374138aca63d0334b9","src/bn.rs":"42c3a1798f70b9f797de78a238d0b05a706df71c980714611ff53888ec7315eb","src/cipher.rs":"3bf4595773be7c5f292b671c9272979d2b300b0e2961e14d3aa0d1c03a24b83d","src/cipher_ctx.rs":"01ffd0005693695c41e5dd1d86b448bca4808e43d5778c5b9f707c1e867a75bb","src/cms.rs":"0dfa2f1134b84de1c7c9a8ad78ad2b8cd773cea75c9b80cf57bcf181f7ed4573","src/conf.rs":"c374003c606c331fedbe9075abfaf41eba38bfbbbefe9c9f2d2a1d445e4b1606","src/derive.rs":"963694c3cf7b0b70802b5b2b3f93f857ed7b320d5db331b57c2ff11bcb0891ad","src/dh.rs":"e9fc6d5910241a6cba0b7c6ce4139ba8cbd04be7de5c92a479406ddc79a581cd","src/dsa.rs":"10b6aca140fe332cb35c78cb3b0e9f1aa7cf18971059ac93a9a458481de26f85","src/ec.rs":"43142ab898dd4dc25efd7cd5c081be4f1a65c39d48e715fa3a208c7a2c5cb534","src/ecdsa.rs":"895136cad2a938f6a274e56fe2218e0bf066d4df33f5ad77c98d50921a25f50a","src/encrypt.rs":"d1c6de4f5998f06d33de66005a1926eab895f0ecff01396b46dc697dc1593b26","src/envelope.rs":"d842c52a3297620121446514b57b6441e88faf5c48d98ae723f4e05164ea0a2b","src/error.rs":"ede27beebf1594a9165f16aa8732816f28501a8454d3125b6eb5ce98756e0255","src/ex_data.rs":"0a58a3a274a4ef2251dadb64cbcd44b43710d252201b137ecfb91cf14373c04f","src/fips.rs":"761cd7cdfbc16af88fbfefd38e54cb77b4ba8e2f49221607e145bc541f089d7e","src/hash.rs":"f8c18f3095236d7ea9ee5be244032207b6bf5b97ddfbb960ab0800c5f72a6244","src/lib.rs":"a4e1994538c5a18371edf46439a253a488fff0b94692208796b782d6ab0b0030","src/lib_ctx.rs":"ec6431adad53f3a9621b011506678104bd4f62bdea38ef9d1b731334507ab068","src/macros.rs":"fc83887358d36f7edd61f2718e0d7a83161b1c23eccbf782fd2918b34a8f5a12","src/md.rs":"fd241588f1c5860ee43b1abd74952a74e2c0432c045ded4b2950a419bb4597ee","src/md_ctx.rs":"a00fbe465477fd1209fffd7b83eebb1e86af2bfd3acf2c1ca691f19da1a5b35f","src/memcmp.rs":"f48e0e29f372db2d0eb2239290abec8819300eb3e01e3bb1030783d6f6a8b2c9","src/nid.rs":"8ed819d454abb0e531d5dd359bc6ca8c16c7c48ec8cf07dd52e59a7bebd1d77a","src/ocsp.rs":"bfb378fa87945eee583521e350f427406888bbb8a804a90aeb06bdbf1b656ddf","src/pkcs12.rs":"b4171fa4423eaf8e1b060cf68f9b85fe0bc84d6c5fe23dabf3ddb0fed9a8cb23","src/pkcs5.rs":"5afbbb784714cde2fb39b34c867db7a600c0cd0f1173d1971ec645f9c3376caf","src/pkcs7.rs":"24431303749047c08aad278f53ea47d6e47130318d368dd5213194e27bd58620","src/pkey.rs":"c500536756324354aa698509ca03f488cf180e3eba9c3b1ba198e68b991eb22f","src/pkey_ctx.rs":"0da4de8cc6cd814133a96a941ace5dbc76ea8b19f145ae71a150f32e2397aa8a","src/provider.rs":"5ab0b25e8866ecea327ad764d44594912f1dc09eb73c3ed5db134714e9f4b73e","src/rand.rs":"4007c6e88a8e875fb8eb475895ba5579e2e789634536303ea8e99ec1866b71a3","src/rsa.rs":"b972ab6ee3c3ad70314959eb5cda6a2251f514bf12d88551ce7746b4e9024294","src/sha.rs":"c34f2f9df5fb52b578022568e195e011d0967f9f5ff57b559d7d2a235951a5b9","src/sign.rs":"9af5544b9c5d81c494ba055c247c8d152e5853a26efa60ff7c1788b569225fd9","src/srtp.rs":"3defe1815cfc790e2407ff935f8ca7b0e8d504242886e8841715279e0d85f721","src/ssl/bio.rs":"4677c018ebc35a1c31fc92a3fd180e03b00fdc031aa7464d4ee53d0e4d5c78d3","src/ssl/callbacks.rs":"3b5530c06709705b1a216913f2f5a900ea6d9baa9d497d7c8bd5f2fefa53c8d5","src/ssl/connector.rs":"32afe0925584b349b3595aaabd0dadbf6ab383b5879c49c68ad2d0fddf0b0e4a","src/ssl/error.rs":"f39ac3e1037a35ae5cccbf5cf5976044614a6368c9ffe3f1b96bead63c0c4231","src/ssl/mod.rs":"ede8850d07edf6033d0b3b34ef001ff5b621eb6f9c5ed1d02eadc75f5297b4e7","src/ssl/test/mod.rs":"0bf87ab47287ce40f1317016beeb54602a9a5836d00e0424072e67bedafa9c35","src/ssl/test/server.rs":"4276ba970a0fac5c9cae21d7df7af36389c377472f3546ce597678ffc6ad5b38","src/stack.rs":"ce68f06b3fa7135798d9af3489a2412823cfcd39984931b39d68be387f8fb5ac","src/string.rs":"8276d719b35cd74ee0efbecce9e58e754d50d8cc96111f2febd3c0d8849847a8","src/symm.rs":"87abe78720dc89710369a4fe8c74faa52c4226a118add635bc6458cb7db03c66","src/util.rs":"e6794bf0643d0c29e96325653f2bb4a00221de55bb5b3c6c96d5dbae3debe238","src/version.rs":"e3acbb0db2095ab616870055c7c7a902fb7b1439520574fd20b7c1164b1178b7","src/x509/extension.rs":"26a265248eb0e54c3b106708f8fce7d5fb5b91b7195f17a97e1b8b1d3b6fa119","src/x509/mod.rs":"1de4893a55ca91296216a052d14d1319fe180cd7b792fa3593de3fa7cc4f1dee","src/x509/store.rs":"e42823f931ce2b6e4bac5f7314f3790c70dd12002398da03a2ebecd96f248c98","src/x509/tests.rs":"efd1573171de75b70416a8d2f708e457601fc64c472fdb5507e32f74f4968fd0","src/x509/verify.rs":"9db665ffccecfd8a29874f8f4b0b3c09d195899daaa927dffdf57d6e9d32403e","test/aia_test_cert.pem":"9eaf52b5d0023f3be7911938d937ed16fc75d43d14dbe41557a800b0a82f4b1b","test/alt_name_cert.pem":"f3cc0a1d21657164918dffab0dac8f1c499fc1cf5717805420a0134b3aee128c","test/authority_key_identifier.pem":"4644b83bbcd36a6e1917d1f7bd3b8ff913bf86cc74917c07dd78b6731b4d5bec","test/ca.crt":"70bcf52acc79191409801e72371db3a0cd8a27c0fc24eacb3fb8f8ab3e558f67","test/cert.pem":"53c8b338be254490c71a6b13da90dc5a59ba596587c548be5673657e04824afb","test/certs.pem":"106d5d22c86e26c3db619b9525567f22333d22de82e4d2850ed379150c638008","test/certv3.pem":"c230b76b6efb973816d0e3096ae95cdcf4941ec928c01c31b6537d01743fcd8a","test/certv3_extfile":"610fdc10edac2da398a582895e53d288d3e47a9d4f3868c2c7f7662c212b60bd","test/cms.p12":"d33fc5edd6b9caa672e7570b869135235bb2583580a273f6e88c6a6c68fd5a8a","test/cms_pubkey.der":"03682a732e1fd861f5fa687915a8e6f5c935d10273b0f6f73f3db52a8d71fc6d","test/crl-ca.crt":"911360ccdf700fd7d6091bd78c4138da0e9f027ca211f7ed80b394e570eb897c","test/csr.pem":"24423008144c43cf33f56ebcc245931b2d61bcd4eee17b476d7adb6f7416e24d","test/dhparams.pem":"14d9461949d9ae8ca50a393b008ee2168254f14342b0e17b56c0a62d2905b963","test/dsa.pem":"826d513234205fd3dee0bbbf844f0b6fea501145bdf05ea3b14e14df98cbe090","test/dsa.pem.pub":"721677bebf9ab28b8650f98a0cd27658de0c1acd867a4b6e985fe1df95a8bd37","test/dsaparam.pem":"94a1284bdd7d7566151cfde0c7f245e84f7b99ba840f202e3f27ea0160f82988","test/entry_extensions.crl":"bee73d33a326bde92d3c38f275b3f94943e46cf778d7043e1176e84413dc22e9","test/identity.p12":"aceeb3e5516471bd5af9a44bbeffc9559c4f228f67c677d29f36a4b368e2779f","test/intermediate-ca.key":"a5f3d331af87c1305843e235841e494a0669a95d3824a6c766d09371f62c3bab","test/intermediate-ca.pem":"5ff8055325d0cbb60586f4e20bd2df7718e4d94f5261f2ee05ba52a8fb9223f0","test/key.der":"e8842cd6674b5c77a83e0283cd876a91de404561dfc86d79ce525f6e55b28197","test/key.der.pub":"e559d56bb6ec57ad743dbf972bbcaf263a9fa7d320433baa71b04f849d987060","test/key.pem":"12d9105a92bf39b615ccb4820c5c1e38c61905483cd30be13f9ab99b98af64ed","test/key.pem.pub":"f5d030df843ddbaba5bf316ae18f1434de5a63a955be66442429dd4f16f161ef","test/keystore-empty-chain.p12":"bbea280f6fe10556d7470df7072ef0e4ee3997e2c0b3666197f423430c0e6b61","test/leaf.pem":"4f2c3fd02f73b3f49a1e05cf0622669ed014ba019876d89d3f21c788457c1e01","test/nid_test_cert.pem":"7047e8d317e284c6b698eee4a0f1a629d50cd4615ad7da85fe90a2ffb6c21611","test/nid_uid_test_cert.pem":"a735211f3b40edbde7084337138fb0aea06aea6c78369c52015253e4b7a17d83","test/pkcs1.pem.pub":"4d446864b63c4178ec2c7dc8df9b7121d9271851c1f4701231fccb8b07c94918","test/pkcs8-nocrypt.der":"5590d03cc0d037c6c27d78fafc937f48defb226e9a52cde84d54df68086d0575","test/pkcs8.der":"8719fc002d59313fb97e46e068ae40db4d9acc0e2debd308ac9eb46329bea487","test/root-ca.key":"b37cf88614980c38e43c4329cdf7162bae48cc8af1fafd54db2fe0d17e458e1d","test/root-ca.pem":"59b9200c35e818bf21be4aaa97ba87bb6a18fd780527a9f9c51cc74212c631a0","test/rsa-encrypted.pem":"ea41b0f1816056672de6abbab43d0e8089da047c329ceed14aace5a5bde713f1","test/rsa.pem":"f866a5506ea9a37ed2f73f62f503e1aff32f7e4145be62b023535f4da1c24416","test/rsa.pem.pub":"2c5eeea39708e90396f9f09d920f2af8b7e9f84ace963c1319072224dd3d302b","test/subca.crt":"70bcf52acc79191409801e72371db3a0cd8a27c0fc24eacb3fb8f8ab3e558f67","test/test.crl":"ac8443257214f9e82543871c3df48694ea39f2b16bd6c4ef5998a161edbb8fba"},"package":"c2823eb4c6453ed64055057ea8bd416eda38c71018723869dd043a3b1186115e"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/openssl/CHANGELOG.md 43.0.0-1ubuntu1/rust-vendor/openssl/CHANGELOG.md
--- 43.0.0-1/rust-vendor/openssl/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,972 @@
+# Change Log
+
+## [Unreleased]
+
+## [v0.10.65] - 2024-07-20
+
+### Fixed
+
+* Ensure we are initialized in `MessageDigest::from_nid`, `Md::from_nid`, `Md::fetch`
+
+### Changed
+
+* Expose `SslContextBuilder::set_keylog_callback` on BoringSSL
+
+## [v0.10.64] - 2024-02-19
+
+### Added
+
+* Added `PkeyCtxRef::{nonce_type, set_nonce_type}`.
+* Added `X509Ref::alias`.
+
+
+## [v0.10.63] - 2024-01-19
+
+### Added
+
+* Added `Pkcs7Ref::{type_,signed}`.
+* Added `Pkcs7SignedRef::certificates`.
+* Added `Cipher::{aes_256_xts,des_ede3_ecb,des_ede3_cfb8,des_ede3_ofb,camellia128_ofb,camellia192_ofb,camellia256_ofb,cast5_ofb,idea_ofb}`
+* Added `PKey::from_dhx`
+* Added `PKey::{public_key_from_pem_passphrase,public_key_from_pem_callback}`.
+
+### Changed
+
+* `Cipher::aes_128_ofb` is now available on BoringSSL
+* `Nid::{BRAINPOOL_P256R1,BRAINPOOL_P320R1,BRAINPOOL_P384R1,BRAINPOOL_P512R1}` are now available on LibreSSL.
+
+## [v0.10.62] - 2023-12-22
+
+### Added
+
+* Added `Nid::BRAINPOOL_P320R1`
+* Added `rand_priv_bytes`
+
+### Fixed
+
+* Fixed building on the latest version of BoringSSL
+
+## [v0.10.61] - 2023-12-04
+
+### Changed
+
+* `SslStream` now uses `SSL_read_ex`, `SSL_write_ex`, and `SSL_peek_ex` when available
+
+### Added
+
+* Added `SslStream::{read_uninit, ssl_read_uninit}`.
+
+## [v0.10.60] - 2023-11-22
+
+### Deprecated
+
+* Deprecated `X509StoreRef::objects`. It is unsound. All callers should migrate to using `X509StoreRef::all_certificates` instead.
+
+### Fixed
+
+* Fixed a memory leak when calling `SslContextBuilder::set_ex_data` and `SslRef::set_ex_data` multiple times with the same index.
+
+### Added
+
+* Added `X509StoreRef::all_certificates`
+* Added `cipher::Cipher::{camellia128_cbc,camellia192_cbc,camellia256_cbc,cast5_cbc,idea_cbc}`
+* Added `symm::Cipher::{des_ede3_ecb,des_ede3_cfb8,des_ede3_ofb,camellia_128_ecb,camellia_128_ofb,camellia_128_cfb128,camellia_192_ecb,camellia_192_ofb,camellia_192_cfb128,camellia_256_ecb,camellia_256_ofb,camellia_256_cfb128,cast5_ecb,cast5_ofb,cast5_cfb64,idea_ecb,idea_ofb,idea_cfb64}`
+* Added `Crypter::update_unchecked`
+* Added `SslRef::{peer_tmp_key,tmp_key}`
+
+### Changed
+
+* `cipher::Cipher::chacha20` is now available on LibreSSL
+* `symm::Cipher::chacha20` is now available on LibreSSL
+
+## [v0.10.59] - 2023-11-03
+
+### Added
+
+* Added `Nid::CHACHA20_POLY1305`
+
+### Changed
+
+* Fixed the availability of `Id::RSA_PSS` on OpenSSL
+
+## [v0.10.58] - 2023-11-01
+
+### Added
+
+* Added `Id::{RSA_PSS,DHX}` constants
+* Added `SslContextBuilder::set_security_level`
+* Added `SslContextRef::security_level`
+* Added `SslRef::set_security_level`, `SslRef::security_level`
+* Added `Cipher::{camellia_128_cbc, camellia_192_cbc, camellia_256_cbc, cast5_cbc, idea_cbc}`
+* Added `X509CrlRef::extension`
+* Added `X509PurposeId::CODE_SIGN`
+
+### Changed
+
+* `Pkey` HKDF functionality now works on LibreSSL
+* `BigNum::mod_sqrt` is now available on all OpenSSLs
+* `MessageDigest::sha3*` are now available on LibreSSL
+
+## [v0.10.57] - 2023-08-27
+
+### Added
+* Added `X509VerifyParam::set_email`
+* `Cipher::chacha20_poly1305` is now available on LibreSSL
+* Added `CipherCtx::copy`
+
+### Changed
+* Updated `bitflags` dependecy to the 2.x series
+
+## [v0.10.56] - 2023-08-06
+
+## Added
+
+* Added `BigNumRef::mod_sqrt`.
+* Added `PkeyCtxRef::set_signature_md` and `PkeyCtxRef::set_rsa_pss_saltlen`.
+* Added `PkeyCtxRef::verify_recover_init` and `PkeyCtxRef::verify_recover`.
+* Added `BigNumRef::is_even` and `BigNumRef::is_odd`.
+* Added `EcPointRef::to_hex_str` and `EcPoint::from_hex_str`.
+* Added support for AES key wrap and wrap pad.
+
+## [v0.10.55] - 2023-06-20
+
+### Fixed
+
+* Fixed compilation with the latest version of BoringSSL.
+* Fixed compilation when OpenSSL is compiled with `OPENSSL_NO_OCB`.
+* Fixed a segfault in `X509VerifyParamRef::set_host` when called with an empty string.
+
+### Added
+
+* Added `Deriver::set_peer_ex`.
+* Added `EcGroupRef::asn1_flag`.
+* Exposed `EcPointRef::affine_coordinates` on BoringSSL and LibreSSL.
+* Added `Nid::SM2` and `Id::SM2`
+
+## [v0.10.54] - 2023-05-31
+
+### Fixed
+
+* `PKey::private_key_to_pkcs8_passphrase` no longer panics if a `passphrase` contains a NUL byte.
+
+## [v0.10.53] - 2023-05-30
+
+### Added
+
+* Added `Dsa::from_pqg`, `Dsa::generate_key`, and `Dsa::generate_params`.
+* Added `SslRef::bytes_to_cipher_list`.
+* Added `SubjectAlternativeName::other_name2`
+
+## [v0.10.52] - 2023-04-24
+
+### Added
+
+* Added `DhRef::check_key`.
+* Added `Id::POLY1305`.
+* Added `X509Ref::subject_key_id`, `X509Ref::authority_key_id`, `X509Ref::authority_issuer`, and `X509Ref::authority_serial`.
+
+
+## [v0.10.51] - 2023-04-20
+
+### Added
+
+* Added `X509RevokedRef::issuer_name` and `X509RevokedRef::reason_code`.
+* Added `Dh::set_key` and `Dh::set_public_key`
+* Added `Asn1OctetString` and `Asn1OctetStringRef1`
+* Added `X509Extension::new_from_der`
+
+### Deprecated
+
+* Deprecated `X509Extension::new` and `X509Extension::new_nid` in favor of `X509Extension::new_from_der` and the `extensions` module.
+* Deprecated `X509Extension::add_alias`, it is not required with `new_from_der` or the `extensions` module.
+
+## [v0.10.50] - 2023-04-09
+
+### Added
+
+* Added `CipherCtxRef::cipher_update_inplace`.
+
+## [v0.10.49] - 2023-04-01
+
+### Fixed
+
+* `SslConnector` no longer sets the SNI extension when connecting to an IP address.
+
+### Added
+
+* Implemented `Ord`, `PartialOrd`, `Eq`, and `PartialEq` for `Asn1Integer` and `Asn1IntegerRef`.
+* Added `X509Ref::crl_distribution_points`, and `DistPoint`.
+
+## [v0.10.48] - 2023-03-23
+
+### Fixed
+
+* Fixed injection vulnerabilities where OpenSSL's configuration mini-language could be used via `x509::extension::SubjectAlternativeName` and `x509::extension::ExtendedKeyUsage`. The mini-language can read arbitrary files amongst other things.
+  * As part of fixing this `SubjectAlternativeName::dir_name` and `SubjectAlternativeName::other_name` are deprecated and their implementations always `panic!`. If you have a use case for these, please file an issue.
+* Fixed several NULL pointer dereferences in OpenSSL that could be triggered via `x509::X509Extension::new` and `x509::X509Extension::new_nid`. Note that these methods still accept OpenSSL's configuration mini-language, and therefore should not be used with untrusted data.
+* Fixed a data-race with `x509::X509Name` that are created with `x509::X509NameBuilder` and then used concurrently.
+* Fixed LibreSSL version checking. More functions should now be correctly available on LibreSSL.
+
+## [v0.10.47] - 2023-03-19
+
+### Added
+
+* Added support for X25519 and Ed25519 on LibreSSL and BoringSSL.
+* Added `Error::library_code` and `Error::reason_code`.
+
+## [v0.10.46] - 2023-03-14
+
+### Fixed
+
+* Fixed a potential null-pointer deref when parsing a PKCS#12 archive with no identity.
+* Fixed builds against OpenSSL built with `no-cast`.
+* Fixed debug formatting of `GeneralName`.
+
+### Deprecated
+
+* Deprecated `PKcs12Ref::parse` in favor of `Pkcs12Ref::parse2`.
+* Deprecated `ParsedPkcs12` in favor of `ParsedPkcs12_2`.
+* Deprecated `Pkcs12Builder::build` in favor of `Pkcs12Builder::build2`.
+
+### Added
+
+* Added `X509VerifyParamRef::set_auth_level`, `X509VerifyParamRef::auth_level`, and `X509VerifyParamRef::set_purpose`.
+* Added `X509PurposeId` and `X509Purpose`.
+* Added `X509NameBuilder::append_entry`.
+* Added `PKeyRef::private_key_to_pkcs8`.
+* Added `X509LookupRef::load_crl_file`.
+* Added `Pkcs12Builder::name`, `Pkcs12Builder::pkey`, and `Pkcs12Builder::cert`.
+* Added `SslRef::set_method`, `SslRef::set_private_key_file`, `SslRef::set_private_key`, `SslRef::set_certificate`, `SslRef::set_certificate_chain_file`, `SslRef::add_client_ca`, `SslRef::set_client_ca_list`, `SslRef::set_min_proto_version`, `SslREf::set_max_proto_version`, `SslRef::set_ciphersuites`, `SslRef::set_cipher_list`, `SslRef::set_verify_cert_store`.
+* Added `X509NameRef::to_owned`.
+* Added `SslContextBuilder::set_num_tickets`, `SslContextRef::num_tickets`, `SslRef::set_num_tickets`, and `SslRef::num_tickets`.
+* Added `CmsContentInfo::verify`.
+
+## [v0.10.45] - 2022-12-20
+
+### Fixed
+
+* Removed the newly added `CipherCtxRef::minimal_output_size` method, which did not work properly.
+* Added `NO_DEPRECATED_3_0` cfg checks for more APIs.
+
+### Added
+
+* Added `SslRef::add_chain_cert`.
+* Added `PKeyRef::security_bits`.
+* Added `Provider::set_default_search_path`.
+* Added `CipherCtxRef::cipher_final_unchecked`.
+
+## [v0.10.44] - 2022-12-06
+
+### Added
+
+* Added `CipherCtxRef::num`, `CipherCtxRef::minimal_output_size`, and `CipherCtxRef::cipher_update_unchecked`.
+* Improved output buffer size checks in `CipherCtxRef::cipher_update`.
+* Added `X509Lookup::file` and `X509LookupRef::load_cert_file`.
+
+## [v0.10.43] - 2022-11-23
+
+### Added
+
+* Added `Nid::BRAINPOOL_P256R1`, `Nid::BRAINPOOL_P384R1`, `Nid::BRAINPOOL_P512R1`.
+* Added `BigNumRef::copy_from_slice`.
+* Added `Cipher` constructors for Camellia, CAST5, and IDEA ciphers.
+* Added `DsaSig`.
+* Added `X509StoreBuilderRef::set_param`.
+* Added `X509VerifyParam::new`, `X509VerifyParamRef::set_time`, and `X509VerifyParamRef::set_depth`.
+
+## [v0.10.42] - 2022-09-26
+
+### Added
+
+* Added `SslRef::psk_identity_hint` and  `SslRef::psk_identity`.
+* Added SHA-3 constants to `Nid`.
+* Added `SslOptions::PRIORITIZE_CHACHA`.
+* Added `X509ReqRef::to_text`.
+* Added `MdCtxRef::size`.
+* Added `X509NameRef::try_cmp`.
+* Added `MdCtxRef::reset`.
+* Added experimental, unstable support for BoringSSL.
+
+### Fixed
+
+* Fixed `MdCtxRef::digest_verify_init` to support `PKey`s with only public components.
+
+## [v0.10.41] - 2022-06-09
+
+### Fixed
+
+* Fixed a use-after-free in `Error::function` and `Error::file` with OpenSSL 3.x.
+
+### Added
+
+* Added `MessageDigest::block_size` and `MdRef::block_size`.
+* Implemented `Ord` and `Eq` for `X509` and `X509Ref`.
+* Added `X509Extension::add_alias`.
+* Added SM4 support.
+* Added `EcGroup::from_components` `EcGropuRef::set_generator`, and `EcPointRef::set_affine_coordinates_gfp`.
+
+## [v0.10.40] - 2022-05-04
+
+### Fixed
+
+* Fixed the openssl-sys dependency version.
+
+## [v0.10.39] - 2022-05-02
+
+### Deprecated
+
+* Deprecated `SslContextBuilder::set_tmp_ecdh_callback` and `SslRef::set_tmp_ecdh_callback`.
+
+### Added
+
+* Added `SslRef::extms_support`.
+* Added `Nid::create`.
+* Added `CipherCtx`, which exposes a more direct interface to `EVP_CIPHER_CTX`.
+* Added `PkeyCtx`, which exposes a more direct interface to `EVP_PKEY_CTX`.
+* Added `MdCtx`, which exposes a more direct interface to `EVP_MD_CTX`.
+* Added `Pkcs12Builder::mac_md`.
+* Added `Provider`.
+* Added `X509Ref::issuer_name_hash`.
+* Added `Decrypter::set_rsa_oaep_label`.
+* Added `X509Ref::to_text`.
+
+## [v0.10.38] - 2021-10-31
+
+### Added
+
+* Added `Pkey::ec_gen`.
+
+## [v0.10.37] - 2021-10-27
+
+### Fixed
+
+* Fixed linkage against OpenSSL distributions built with `no-chacha`.
+
+### Added
+
+* Added `BigNumRef::to_vec_padded`.
+* Added `X509Name::from_der` and `X509NameRef::to_der`.
+* Added `BigNum::new_secure`, `BigNumReef::set_const_time`, `BigNumref::is_const_time`, and `BigNumRef::is_secure`.
+
+## [v0.10.36] - 2021-08-17
+
+### Added
+
+* Added `Asn1Object::as_slice`.
+* Added `PKeyRef::{raw_public_key, raw_private_key, private_key_to_pkcs8_passphrase}` and
+    `PKey::{private_key_from_raw_bytes, public_key_from_raw_bytes}`.
+* Added `Cipher::{seed_cbc, seed_cfb128, seed_ecb, seed_ofb}`.
+
+## [v0.10.35] - 2021-06-18
+
+### Fixed
+
+* Fixed a memory leak in `Deriver`.
+
+### Added
+
+* Added support for OpenSSL 3.x.x.
+* Added `SslStream::peek`.
+
+## [v0.10.34] - 2021-04-28
+
+### Added
+
+* Added `Dh::set_private_key` and `DhRef::private_key`.
+* Added `EcPointRef::affine_coordinates`.
+* Added `TryFrom` implementations to convert between `PKey` and specific key types.
+* Added `X509StoreBuilderRef::set_flags`.
+
+## [v0.10.33] - 2021-03-13
+
+### Fixed
+
+* `Dh::generate_params` now uses `DH_generate_params_ex` rather than the deprecated `DH_generated_params` function.
+
+### Added
+
+* Added `Asn1Type`.
+* Added `CmsContentInfoRef::decrypt_without_cert_check`.
+* Added `EcPointRef::{is_infinity, is_on_curve}`.
+* Added `Encrypter::set_rsa_oaep_label`.
+* Added `MessageDigest::sm3`.
+* Added `Pkcs7Ref::signers`.
+* Added `Cipher::nid`.
+* Added `X509Ref::authority_info` and `AccessDescription::{method, location}`.
+* Added `X509NameBuilder::{append_entry_by_text_with_type, append_entry_by_nid_with_type}`.
+
+## [v0.10.32] - 2020-12-24
+
+### Fixed
+
+* Fixed `Ssl::new` to take a `&SslContextRef` rather than `&SslContext`.
+
+### Added
+
+* Added the `encrypt` module to support asymmetric encryption and decryption with `PKey`s.
+* Added `MessageDigest::from_name`.
+* Added `ConnectConfiguration::into_ssl`.
+* Added the ability to create unconnected `SslStream`s directly from an `Ssl` and transport stream
+    without performing any part of the handshake with `SslStream::new`.
+* Added `SslStream::{read_early_data, write_early_data, connect, accept, do_handshake, stateless}`.
+* Implemented `ToOwned` for `SslContextRef`.
+* Added `SslRef::{set_connect_state, set_accept_state}`.
+
+### Deprecated
+
+* Deprecated `SslStream::from_raw_parts` in favor of `Ssl::from_ptr` and `SslStream::new`.
+* Deprecated `SslStreamBuilder` in favor of methods on `Ssl` and `SslStream`.
+
+## [v0.10.31] - 2020-12-09
+
+### Added
+
+* Added `Asn1Object::from_str`.
+* Added `Dh::from_pgq`, `DhRef::prime_p`, `DhRef::prime_q`, `DhRef::generator`, `DhRef::generate_params`,
+    `DhRef::generate_key`, `DhRef::public_key`, and `DhRef::compute_key`.
+* Added `Pkcs7::from_der` and `Pkcs7Ref::to_der`.
+* Added `Id::X25519`, `Id::X448`, `PKey::generate_x25519`, and `PKey::generate_x448`.
+* Added `SrtpProfileId::SRTP_AEAD_AES_128_GCM` and `SrtpProfileId::SRTP_AEAD_AES_256_GCM`.
+* Added `SslContextBuilder::verify_param` and `SslContextBuilder::verify_param_mut`.
+* Added `X509Ref::subject_name_hash` and `X509Ref::version`.
+* Added `X509StoreBuilderRef::add_lookup`, and the `X509Lookup` type.
+* Added `X509VerifyFlags`, `X509VerifyParamRef::set_flags`, `X509VerifyParamRef::clear_flags`
+    `X509VerifyParamRef::get_flags`.
+
+## [v0.10.30] - 2020-06-25
+
+### Fixed
+
+* `DsaRef::private_key_to_pem` can no longer be called without a private key.
+
+### Changed
+
+* Improved the `Debug` implementations of many types.
+
+### Added
+
+* Added `is_empty` implementations for `Asn1StringRef` and `Asn1BitStringRef`.
+* Added `EcPointRef::{to_pem, to_dir}` and `EcKeyRef::{public_key_from_pem, public_key_from_der}`.
+* Added `Default` implementations for many types.
+* Added `Debug` implementations for many types.
+* Added `SslStream::from_raw_parts`.
+* Added `SslRef::set_mtu`.
+* Added `Cipher::{aes_128_ocb, aes_192_ocb, aes_256_ocb}`.
+
+### Deprecated
+
+* Deprecated `SslStreamBuilder::set_dtls_mtu_size` in favor of `SslRef::set_mtu`.
+
+## [v0.10.29] - 2020-04-07
+
+### Fixed
+
+* Fixed a memory leak in `X509Builder::append_extension`.
+
+### Added
+
+* Added `SslConnector::into_context` and `SslConnector::context`.
+* Added `SslAcceptor::into_context` and `SslAcceptor::context`.
+* Added `SslMethod::tls_client` and `SslMethod::tls_server`.
+* Added `SslContextBuilder::set_cert_store`.
+* Added `SslContextRef::verify_mode` and `SslRef::verify_mode`.
+* Added `SslRef::is_init_finished`.
+* Added `X509Object`.
+* Added `X509StoreRef::objects`.
+
+## [v0.10.28] - 2020-02-04
+
+### Fixed
+
+* Fixed the mutability of `Signer::sign_oneshot` and `Verifier::verify_oneshot`. This is unfortunately a breaking
+    change, but a necessary soundness fix.
+
+## [v0.10.27] - 2020-01-29
+
+### Added
+
+* Added `MessageDigest::null`.
+* Added `PKey::private_key_from_pkcs8`.
+* Added `SslOptions::NO_RENEGOTIATION`.
+* Added `SslStreamBuilder::set_dtls_mtu_size`.
+
+## [v0.10.26] - 2019-11-22
+
+### Fixed
+
+* Fixed improper handling of the IV buffer in `envelope::{Seal, Unseal}`.
+
+### Added
+
+* Added `Asn1TimeRef::{diff, compare}`.
+* Added `Asn1Time::from_unix`.
+* Added `PartialEq` and `PartialOrd` implementations for `Asn1Time` and `Asn1TimeRef`.
+* Added `base64::{encode_block, decode_block}`.
+* Added `EcGroupRef::order_bits`.
+* Added `Clone` implementations for `Sha1`, `Sha224`, `Sha256`, `Sha384`, and `Sha512`.
+* Added `SslContextBuilder::{set_sigalgs_list, set_groups_list}`.
+
+## [v0.10.25] - 2019-10-02
+
+### Fixed
+
+* Fixed a memory leak in `EcdsaSig::from_private_components` when using OpenSSL 1.0.x.
+
+### Added
+
+* Added support for Ed25519 and Ed448 keys.
+* Implemented `ToOwned` for `PKeyRef` and `Clone` for `PKey`.
+
+## [v0.10.24] - 2019-07-19
+
+### Fixed
+
+* Worked around an OpenSSL 1.0.x bug triggered by code calling `SSL_set_app_data`.
+
+### Added
+
+* Added `aes::{wrap_key, unwrap_key}`.
+* Added `CmsContentInfoRef::to_pem` and `CmsContentInfo::from_pem`.
+* Added `DsaRef::private_key_to_pem`.
+* Added `EcGroupRef::{cofactor, generator}`.
+* Added `EcPointRef::to_owned`.
+* Added a `Debug` implementation for `EcKey`.
+* Added `SslAcceptor::{mozilla_intermediate_v5, mozilla_modern_v5}`.
+* Added `Cipher::{aes_128_ofb, aes_192_ecb, aes_192_cbc, aes_192_ctr, aes_192_cfb1, aes_192_cfb128, aes_192_cfb8,
+    aes_192_gcm, aes_192_ccm, aes_192_ofb, aes_256_ofb}`.
+
+## [v0.10.23] - 2019-05-18
+
+### Fixed
+
+* Fixed session callbacks when an `Ssl`'s context is replaced.
+
+### Added
+
+* Added `SslContextBuilder::add_client_ca`.
+
+## [v0.10.22] - 2019-05-08
+
+### Added
+
+* Added support for the LibreSSL 2.9.x series.
+
+## [v0.10.21] - 2019-04-30
+
+### Fixed
+
+* Fixed overly conservatifve buffer size checks in `Crypter` when using stream ciphers.
+
+### Added
+
+* Added bindings to envelope encryption APIs.
+* Added `PkeyRef::size`.
+
+## [v0.10.20] - 2019-03-20
+
+### Added
+
+* Added `CmsContentInfo::from_der` and `CmsContentInfo::encrypt`.
+* Added `X509Ref::verify` and `X509ReqRef::verify`.
+* Implemented `PartialEq` and `Eq` for `MessageDigest`.
+* Added `MessageDigest::type_` and `EcGroupRef::curve_name`.
+
+## [v0.10.19] - 2019-03-01
+
+### Added
+
+* The openssl-sys build script now logs the values of environment variables.
+* Added `ERR_PACK` to openssl-sys.
+* The `ERR_*` functions in openssl-sys are const functions when building against newer Rust versions.
+* Implemented `Clone` for `Dsa`.
+* Added `SslContextRef::add_session` and `SslContextRef::remove_session`.
+* Added `SslSessionRef::time`, `SslSessionRef::timeout`, and `SslSessionRef::protocol_version`.
+* Added `SslContextBuilder::set_session_cache_size` and `SslContextRef::session_cache_size`.
+
+## [v0.10.18] - 2019-02-22
+
+### Fixed
+
+* Fixed the return type of `ssl::cipher_name`.
+
+## [v0.10.17] - 2019-02-22
+
+### Added
+
+* Implemented `AsRef<str>` and `AsRef<[u8]>` for `OpenSslString`.
+* Added `Asn1Integer::from_bn`.
+* Added `RsaRef::check_key`.
+* Added `Asn1Time::from_str` and `Asn1Time::from_str_x509`.
+* Added `Rsa::generate_with_e`.
+* Added `Cipher::des_ede3_cfb64`.
+* Added `SslCipherRef::standard_name` and `ssl::cipher_name`.
+
+## [v0.10.16] - 2018-12-16
+
+### Added
+
+* Added SHA3 and SHAKE to `MessageDigest`.
+* Added `rand::keep_random_devices_open`.
+* Added support for LibreSSL 2.9.0.
+
+## [v0.10.15] - 2018-10-22
+
+### Added
+
+* Implemented `DoubleEndedIterator` for stack iterators.
+
+## [v0.10.14] - 2018-10-18
+
+### Fixed
+
+* Made some accidentally exposed internal functions private.
+
+### Added
+
+* Added support for LibreSSL 2.8.
+
+### Changed
+
+* The OpenSSL version used with the `vendored` feature has been upgraded from 1.1.0 to 1.1.1.
+
+## [v0.10.13] - 2018-10-14
+
+### Fixed
+
+* Fixed a double-free in the `SslContextBuilder::set_get_session_callback` API.
+
+### Added
+
+* Added `SslContextBuilder::set_client_hello_callback`.
+* Added support for LibreSSL 2.8.1.
+* Added `EcdsaSig::from_der` and `EcdsaSig::to_der`.
+* Added PKCS#7 support.
+
+## [v0.10.12] - 2018-09-13
+
+### Fixed
+
+* Fixed handling of SNI callbacks during renegotiation.
+
+### Added
+
+* Added `SslRef::get_shutdown` and `SslRef::set_shutdown`.
+* Added support for SRTP in DTLS sessions.
+* Added support for LibreSSL 2.8.0.
+
+## [v0.10.11] - 2018-08-04
+
+### Added
+
+* The new `vendored` cargo feature will cause openssl-sys to compile and statically link to a
+    vendored copy of OpenSSL.
+* Added `SslContextBuilder::set_psk_server_callback`.
+* Added `DsaRef::pub_key` and `DsaRef::priv_key`.
+* Added `Dsa::from_private_components` and `Dsa::from_public_components`.
+* Added `X509NameRef::entries`.
+
+### Deprecated
+
+* `SslContextBuilder::set_psk_callback` has been renamed to
+    `SslContextBuilder::set_psk_client_callback` and deprecated.
+
+## [v0.10.10] - 2018-06-06
+
+### Added
+
+* Added `SslRef::set_alpn_protos`.
+* Added `SslContextBuilder::set_ciphersuites`.
+
+## [v0.10.9] - 2018-06-01
+
+### Fixed
+
+* Fixed a use-after-free in `CmsContentInfo::sign`.
+* `SslRef::servername` now returns `None` rather than panicking on a non-UTF8 name.
+
+### Added
+
+* Added `MessageDigest::from_nid`.
+* Added `Nid::signature_algorithms`, `Nid::long_name`, and `Nid::short_name`.
+* Added early data and early keying material export support for TLS 1.3.
+* Added `SslRef::verified_chain`.
+* Added `SslRef::servername_raw` which returns a `&[u8]` rather than `&str`.
+* Added `SslRef::finished` and `SslRef::peer_finished`.
+* Added `X509Ref::digest` to replace `X509Ref::fingerprint`.
+* `X509StoreBuilder` and `X509Store` now implement `Sync` and `Send`.
+
+### Deprecated
+
+* `X509Ref::fingerprint` has been deprecated in favor of `X509Ref::digest`.
+
+## [v0.10.8] - 2018-05-20
+
+### Fixed
+
+* `openssl-sys` will now detect Homebrew-installed OpenSSL when installed to a non-default
+    directory.
+* The `X509_V_ERR_INVALID_CALL`, `X509_V_ERR_STORE_LOOKUP`, and
+    `X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION` constants in `openssl-sys` are now only present when
+    building against 1.1.0g and up rather than 1.1.0.
+* `SslContextBuilder::max_proto_version` and `SslContextBuilder::min_proto_version` are only present
+    when building against 1.1.0g and up rather than 1.1.0.
+
+### Added
+
+* Added `CmsContentInfo::sign`.
+* Added `Clone` and `ToOwned` implementations to `Rsa` and `RsaRef` respectively.
+* The `min_proto_version` and `max_proto_version` methods are available when linking against
+    LibreSSL 2.6.1 and up in addition to OpenSSL.
+* `X509VerifyParam` is available when linking against LibreSSL 2.6.1 and up in addition to OpenSSL.
+* ALPN support is available when linking against LibreSSL 2.6.1 and up in addition to OpenSSL.
+* `Stack` and `StackRef` are now `Sync` and `Send`.
+
+## [v0.10.7] - 2018-04-30
+
+### Added
+
+* Added `X509Req::public_key` and `X509Req::extensions`.
+* Added `RsaPrivateKeyBuilder` to allow control over initialization of optional components of an RSA
+    private key.
+* Added DER encode/decode support to `SslSession`.
+* openssl-sys now provides the `DEP_OPENSSL_VERSION_NUMBER` and
+    `DEP_OPENSSL_LIBRESSL_VERSION_NUMBER` environment variables to downstream build scripts which
+    contains the hex-encoded version number of the OpenSSL or LibreSSL distribution being built
+    against. The other variables are deprecated.
+
+## [v0.10.6] - 2018-03-05
+
+### Added
+
+* Added `SslOptions::ENABLE_MIDDLEBOX_COMPAT`.
+* Added more `Sync` and `Send` implementations.
+* Added `PKeyRef::id`.
+* Added `Padding::PKCS1_PSS`.
+* Added `Signer::set_rsa_pss_saltlen`, `Signer::set_rsa_mgf1_md`, `Signer::set_rsa_pss_saltlen`, and
+    `Signer::set_rsa_mgf1_md`
+* Added `X509StoreContextRef::verify` to directly verify certificates.
+* Added low level ECDSA support.
+* Added support for TLSv1.3 custom extensions. (OpenSSL 1.1.1 only)
+* Added AES-CCM support.
+* Added `EcKey::from_private_components`.
+* Added CMAC support.
+* Added support for LibreSSL 2.7.
+* Added `X509Ref::serial_number`.
+* Added `Asn1IntegerRef::to_bn`.
+* Added support for TLSv1.3 stateless handshakes. (OpenSSL 1.1.1 only)
+
+### Changed
+
+* The Cargo features previously used to gate access to version-specific OpenSSL APIs have been
+    removed. Those APIs will be available automatically when building against an appropriate OpenSSL
+    version.
+* Fixed `PKey::private_key_from_der` to return a `PKey<Private>` rather than a `PKey<Public>`. This
+    is technically a breaking change but the function was pretty useless previously.
+
+### Deprecated
+
+* `X509CheckFlags::FLAG_NO_WILDCARDS` has been renamed to `X509CheckFlags::NO_WILDCARDS` and the old
+    name deprecated.
+
+## [v0.10.5] - 2018-02-28
+
+### Fixed
+
+* `ErrorStack`'s `Display` implementation no longer writes an empty string if it contains no errors.
+
+### Added
+
+* Added `SslRef::version2`.
+* Added `Cipher::des_ede3_cbc`.
+* Added `SslRef::export_keying_material`.
+* Added the ability to push an `Error` or `ErrorStack` back onto OpenSSL's error stack. Various
+    callback bindings use this to propagate errors properly.
+* Added `SslContextBuilder::set_cookie_generate_cb` and `SslContextBuilder::set_cookie_verify_cb`.
+* Added `SslContextBuilder::set_max_proto_version`, `SslContextBuilder::set_min_proto_version`,
+    `SslContextBuilder::max_proto_version`, and `SslContextBuilder::min_proto_version`.
+
+### Changed
+
+* Updated `SslConnector`'s default cipher list to match Python's.
+
+### Deprecated
+
+* `SslRef::version` has been deprecated. Use `SslRef::version_str` instead.
+
+## [v0.10.4] - 2018-02-18
+
+### Added
+
+* Added OpenSSL 1.1.1 support.
+* Added `Rsa::public_key_from_pem_pkcs1`.
+* Added `SslOptions::NO_TLSV1_3`. (OpenSSL 1.1.1 only)
+* Added `SslVersion`.
+* Added `SslSessionCacheMode` and `SslContextBuilder::set_session_cache_mode`.
+* Added `SslContextBuilder::set_new_session_callback`,
+    `SslContextBuilder::set_remove_session_callback`, and
+    `SslContextBuilder::set_get_session_callback`.
+* Added `SslContextBuilder::set_keylog_callback`. (OpenSSL 1.1.1 only)
+* Added `SslRef::client_random` and `SslRef::server_random`. (OpenSSL 1.1.0+ only)
+
+### Fixed
+
+* The `SslAcceptorBuilder::mozilla_modern` constructor now disables TLSv1.0 and TLSv1.1 in
+    accordance with Mozilla's recommendations.
+
+## [v0.10.3] - 2018-02-12
+
+### Added
+
+* OpenSSL is now automatically detected on FreeBSD systems.
+* Added `GeneralName` accessors for `rfc822Name` and `uri` variants.
+* Added DES-EDE3 support.
+
+### Fixed
+
+* Fixed a memory leak in `X509StoreBuilder::add_cert`.
+
+## [v0.10.2] - 2018-01-11
+
+### Added
+
+* Added `ConnectConfiguration::set_use_server_name_indication` and
+    `ConnectConfiguration::set_verify_hostname` for use in contexts where you don't have ownership
+    of the `ConnectConfiguration`.
+
+## [v0.10.1] - 2018-01-10
+
+### Added
+
+* Added a `From<ErrorStack> for ssl::Error` implementation.
+
+## [v0.10.0] - 2018-01-10
+
+### Compatibility
+
+* openssl 0.10 still uses openssl-sys 0.9, so openssl 0.9 and 0.10 can coexist without issue.
+
+### Added
+
+* The `ssl::select_next_proto` function can be used to easily implement the ALPN selection callback
+    in a "standard" way.
+* FIPS mode support is available in the `fips` module.
+* Accessors for the Issuer and Issuer Alternative Name fields of X509 certificates have been added.
+* The `X509VerifyResult` can now be set in the certificate verification callback via
+    `X509StoreContextRef::set_error`.
+
+### Changed
+
+* All constants have been moved to associated constants of their type. For example, `bn::MSB_ONE`
+    is now `bn::MsbOption::ONE`.
+* Asymmetric key types are now parameterized over what they contain. In OpenSSL, the same type is
+    used for key parameters, public keys, and private keys. Unfortunately, some APIs simply assume
+    that certain components are present and will segfault trying to use things that aren't there.
+
+    The `pkey` module contains new tag types named `Params`, `Public`, and `Private`, and the
+    `Dh`, `Dsa`, `EcKey`, `Rsa`, and `PKey` have a type parameter set to one of those values. This
+    allows the `Signer` constructor to indicate that it requires a private key at compile time for
+    example. Previously, `Signer` would simply segfault if provided a key without private
+    components.
+* ALPN support has been changed to more directly model OpenSSL's own APIs. Instead of a single
+    method used for both the server and client sides which performed everything automatically, the
+    `SslContextBuilder::set_alpn_protos` and `SslContextBuilder::set_alpn_select_callback` handle
+    the client and server sides respectively.
+* `SslConnector::danger_connect_without_providing_domain_for_certificate_verification_and_server_name_indication`
+    has been removed in favor of new methods which provide more control. The
+    `ConnectConfiguration::use_server_name_indication` method controls the use of Server Name
+    Indication (SNI), and the `ConnectConfiguration::verify_hostname` method controls the use of
+    hostname verification. These can be controlled independently, and if both are disabled, the
+    domain argument to `ConnectConfiguration::connect` is ignored.
+* Shared secret derivation is now handled by the new `derive::Deriver` type rather than
+    `pkey::PKeyContext`, which has been removed.
+* `ssl::Error` is now no longer an enum, and provides more direct access to the relevant state.
+* `SslConnectorBuilder::new` has been moved and renamed to `SslConnector::builder`.
+* `SslAcceptorBuilder::mozilla_intermediate` and `SslAcceptorBuilder::mozilla_modern` have been
+    moved to `SslAcceptor` and no longer take the private key and certificate chain. Install those
+    manually after creating the builder.
+* `X509VerifyError` is now `X509VerifyResult` and can now have the "ok" value in addition to error
+    values.
+* `x509::X509FileType` is now `ssl::SslFiletype`.
+* Asymmetric key serialization and deserialization methods now document the formats that they
+    correspond to, and some have been renamed to better indicate that.
+
+### Removed
+
+* All deprecated APIs have been removed.
+* NPN support has been removed. It has been supersceded by ALPN, and is hopefully no longer being
+    used in practice. If you still depend on it, please file an issue!
+* `SslRef::compression` has been removed.
+* Some `ssl::SslOptions` flags have been removed as they no longer do anything.
+
+## Older
+
+Look at the [release tags] for information about older releases.
+
+[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.65...master
+[v0.10.65]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.64...openssl-v0.10.65
+[v0.10.64]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.63...openssl-v0.10.64
+[v0.10.63]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.62...openssl-v0.10.63
+[v0.10.62]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.61...openssl-v0.10.62
+[v0.10.61]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.60...openssl-v0.10.61
+[v0.10.60]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.59...openssl-v0.10.60
+[v0.10.59]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.58...openssl-v0.10.59
+[v0.10.58]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.57...openssl-v0.10.58
+[v0.10.57]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.56...openssl-v0.10.57
+[v0.10.56]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.55...openssl-v0.10.56
+[v0.10.55]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.54...openssl-v0.10.55
+[v0.10.54]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.53...openssl-v0.10.54
+[v0.10.53]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.52...openssl-v0.10.53
+[v0.10.52]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.51...openssl-v0.10.52
+[v0.10.51]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.50...openssl-v0.10.51
+[v0.10.50]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.49...openssl-v0.10.50
+[v0.10.49]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.48...openssl-v0.10.49
+[v0.10.48]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.47...openssl-v0.10.48
+[v0.10.47]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.46...openssl-v0.10.47
+[v0.10.46]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.45...openssl-v0.10.46
+[v0.10.45]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.44...openssl-v0.10.45
+[v0.10.44]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.43...openssl-v0.10.44
+[v0.10.43]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.42...openssl-v0.10.43
+[v0.10.42]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.41...openssl-v0.10.42
+[v0.10.41]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.40...openssl-v0.10.41
+[v0.10.40]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.39...openssl-v0.10.40
+[v0.10.39]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.38...openssl-v0.10.39
+[v0.10.38]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.37...openssl-v0.10.38
+[v0.10.37]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.36...openssl-v0.10.37
+[v0.10.36]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.35...openssl-v0.10.36
+[v0.10.35]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.34...openssl-v0.10.35
+[v0.10.34]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.33...openssl-v0.10.34
+[v0.10.33]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.32...openssl-v0.10.33
+[v0.10.32]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.31...openssl-v0.10.32
+[v0.10.31]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.30...openssl-v0.10.31
+[v0.10.30]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.29...openssl-v0.10.30
+[v0.10.29]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.28...openssl-v0.10.29
+[v0.10.28]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.27...openssl-v0.10.28
+[v0.10.27]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.26...openssl-v0.10.27
+[v0.10.26]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.25...openssl-v0.10.26
+[v0.10.25]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.24...openssl-v0.10.25
+[v0.10.24]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.23...openssl-v0.10.24
+[v0.10.23]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.22...openssl-v0.10.23
+[v0.10.22]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.21...openssl-v0.10.22
+[v0.10.21]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.20...openssl-v0.10.21
+[v0.10.20]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.19...openssl-v0.10.20
+[v0.10.19]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.18...openssl-v0.10.19
+[v0.10.18]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.17...openssl-v0.10.18
+[v0.10.17]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.16...openssl-v0.10.17
+[v0.10.16]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.15...openssl-v0.10.16
+[v0.10.15]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.14...openssl-v0.10.15
+[v0.10.14]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.13...openssl-v0.10.14
+[v0.10.13]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.12...openssl-v0.10.13
+[v0.10.12]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.11...openssl-v0.10.12
+[v0.10.11]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.10...openssl-v0.10.11
+[v0.10.10]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.9...openssl-v0.10.10
+[v0.10.9]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.8...openssl-v0.10.9
+[v0.10.8]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.7...openssl-v0.10.8
+[v0.10.7]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.6...openssl-v0.10.7
+[v0.10.6]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.5...openssl-v0.10.6
+[v0.10.5]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.4...openssl-v0.10.5
+[v0.10.4]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.3...openssl-v0.10.4
+[v0.10.3]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.2...openssl-v0.10.3
+[v0.10.2]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.1...openssl-v0.10.2
+[v0.10.1]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.0...openssl-v0.10.1
+[v0.10.0]: https://github.com/sfackler/rust-openssl/compare/v0.9.23...openssl-v0.10.0
+[release tags]: https://github.com/sfackler/rust-openssl/releases
diff -pruN 43.0.0-1/rust-vendor/openssl/Cargo.lock 43.0.0-1ubuntu1/rust-vendor/openssl/Cargo.lock
--- 43.0.0-1/rust-vendor/openssl/Cargo.lock	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/Cargo.lock	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,504 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "aho-corasick"
+version = "1.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "annotate-snippets"
+version = "0.9.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ccaf7e9dfbb6ab22c82e473cd1a8a7bd313c19a5b7e40970f3d89ef5a5c9e81e"
+dependencies = [
+ "unicode-width",
+ "yansi-term",
+]
+
+[[package]]
+name = "bindgen"
+version = "0.65.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5"
+dependencies = [
+ "annotate-snippets",
+ "bitflags 1.3.2",
+ "cexpr",
+ "clang-sys",
+ "lazy_static",
+ "lazycell",
+ "log",
+ "peeking_take_while",
+ "prettyplease",
+ "proc-macro2",
+ "quote",
+ "regex",
+ "rustc-hash",
+ "shlex",
+ "syn",
+ "which",
+]
+
+[[package]]
+name = "bitflags"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+
+[[package]]
+name = "bitflags"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1"
+
+[[package]]
+name = "bssl-sys"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "312d12393c060384f2e6ed14c7b4be37b3dd90249857485613c1a91b9a1abb5c"
+
+[[package]]
+name = "cc"
+version = "1.0.94"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7"
+
+[[package]]
+name = "cexpr"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
+dependencies = [
+ "nom",
+]
+
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "clang-sys"
+version = "1.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1"
+dependencies = [
+ "glob",
+ "libc",
+ "libloading",
+]
+
+[[package]]
+name = "either"
+version = "1.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2"
+
+[[package]]
+name = "errno"
+version = "0.3.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245"
+dependencies = [
+ "libc",
+ "windows-sys",
+]
+
+[[package]]
+name = "foreign-types"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
+dependencies = [
+ "foreign-types-shared",
+]
+
+[[package]]
+name = "foreign-types-shared"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
+
+[[package]]
+name = "glob"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
+
+[[package]]
+name = "hex"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77"
+
+[[package]]
+name = "home"
+version = "0.5.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5"
+dependencies = [
+ "windows-sys",
+]
+
+[[package]]
+name = "lazy_static"
+version = "1.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
+
+[[package]]
+name = "lazycell"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
+
+[[package]]
+name = "libc"
+version = "0.2.153"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
+
+[[package]]
+name = "libloading"
+version = "0.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19"
+dependencies = [
+ "cfg-if",
+ "windows-targets",
+]
+
+[[package]]
+name = "linux-raw-sys"
+version = "0.4.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c"
+
+[[package]]
+name = "log"
+version = "0.4.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
+
+[[package]]
+name = "memchr"
+version = "2.7.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d"
+
+[[package]]
+name = "minimal-lexical"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
+
+[[package]]
+name = "nom"
+version = "7.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
+dependencies = [
+ "memchr",
+ "minimal-lexical",
+]
+
+[[package]]
+name = "once_cell"
+version = "1.19.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
+
+[[package]]
+name = "openssl"
+version = "0.10.65"
+dependencies = [
+ "bitflags 2.5.0",
+ "cfg-if",
+ "foreign-types",
+ "hex",
+ "libc",
+ "once_cell",
+ "openssl-macros",
+ "openssl-sys",
+]
+
+[[package]]
+name = "openssl-macros"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "openssl-src"
+version = "300.2.3+3.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5cff92b6f71555b61bb9315f7c64da3ca43d87531622120fea0195fc761b4843"
+dependencies = [
+ "cc",
+]
+
+[[package]]
+name = "openssl-sys"
+version = "0.9.103"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6"
+dependencies = [
+ "bindgen",
+ "bssl-sys",
+ "cc",
+ "libc",
+ "openssl-src",
+ "pkg-config",
+ "vcpkg",
+]
+
+[[package]]
+name = "peeking_take_while"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
+
+[[package]]
+name = "pkg-config"
+version = "0.3.30"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec"
+
+[[package]]
+name = "prettyplease"
+version = "0.2.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5ac2cf0f2e4f42b49f5ffd07dae8d746508ef7526c13940e5f524012ae6c6550"
+dependencies = [
+ "proc-macro2",
+ "syn",
+]
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.81"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.36"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "regex"
+version = "1.10.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-automata",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-automata"
+version = "0.4.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56"
+
+[[package]]
+name = "rustc-hash"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
+
+[[package]]
+name = "rustix"
+version = "0.38.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f"
+dependencies = [
+ "bitflags 2.5.0",
+ "errno",
+ "libc",
+ "linux-raw-sys",
+ "windows-sys",
+]
+
+[[package]]
+name = "shlex"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
+
+[[package]]
+name = "syn"
+version = "2.0.60"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
+
+[[package]]
+name = "unicode-width"
+version = "0.1.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6"
+
+[[package]]
+name = "vcpkg"
+version = "0.2.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
+
+[[package]]
+name = "which"
+version = "4.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7"
+dependencies = [
+ "either",
+ "home",
+ "once_cell",
+ "rustix",
+]
+
+[[package]]
+name = "winapi"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
+dependencies = [
+ "winapi-i686-pc-windows-gnu",
+ "winapi-x86_64-pc-windows-gnu",
+]
+
+[[package]]
+name = "winapi-i686-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
+
+[[package]]
+name = "winapi-x86_64-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
+
+[[package]]
+name = "windows-sys"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
+dependencies = [
+ "windows-targets",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
+dependencies = [
+ "windows_aarch64_gnullvm",
+ "windows_aarch64_msvc",
+ "windows_i686_gnu",
+ "windows_i686_gnullvm",
+ "windows_i686_msvc",
+ "windows_x86_64_gnu",
+ "windows_x86_64_gnullvm",
+ "windows_x86_64_msvc",
+]
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
+
+[[package]]
+name = "windows_i686_gnullvm"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
+
+[[package]]
+name = "yansi-term"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fe5c30ade05e61656247b2e334a031dfd0cc466fadef865bdcdea8d537951bf1"
+dependencies = [
+ "winapi",
+]
diff -pruN 43.0.0-1/rust-vendor/openssl/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/openssl/Cargo.toml
--- 43.0.0-1/rust-vendor/openssl/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,65 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2018"
+name = "openssl"
+version = "0.10.65"
+authors = ["Steven Fackler <sfackler@gmail.com>"]
+description = "OpenSSL bindings"
+readme = "README.md"
+keywords = [
+    "crypto",
+    "tls",
+    "ssl",
+    "dtls",
+]
+categories = [
+    "cryptography",
+    "api-bindings",
+]
+license = "Apache-2.0"
+repository = "https://github.com/sfackler/rust-openssl"
+
+[dependencies.bitflags]
+version = "2.2.1"
+
+[dependencies.cfg-if]
+version = "1.0"
+
+[dependencies.ffi]
+version = "0.9.103"
+package = "openssl-sys"
+
+[dependencies.foreign-types]
+version = "0.3.1"
+
+[dependencies.libc]
+version = "0.2"
+
+[dependencies.once_cell]
+version = "1.5.2"
+
+[dependencies.openssl-macros]
+version = "0.1.0"
+
+[dev-dependencies.hex]
+version = "0.3"
+
+[features]
+bindgen = ["ffi/bindgen"]
+default = []
+unstable_boringssl = ["ffi/unstable_boringssl"]
+v101 = []
+v102 = []
+v110 = []
+v111 = []
+vendored = ["ffi/vendored"]
diff -pruN 43.0.0-1/rust-vendor/openssl/LICENSE 43.0.0-1ubuntu1/rust-vendor/openssl/LICENSE
--- 43.0.0-1/rust-vendor/openssl/LICENSE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/LICENSE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,15 @@
+Copyright 2011-2017 Google Inc.
+          2013 Jack Lloyd
+          2013-2014 Steven Fackler
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff -pruN 43.0.0-1/rust-vendor/openssl/README.md 43.0.0-1ubuntu1/rust-vendor/openssl/README.md
--- 43.0.0-1/rust-vendor/openssl/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,22 @@
+# rust-openssl
+
+[![crates.io](https://img.shields.io/crates/v/openssl.svg)](https://crates.io/crates/openssl)
+
+OpenSSL bindings for the Rust programming language.
+
+[Documentation](https://docs.rs/openssl).
+
+## Release Support
+
+The current supported release of `openssl` is 0.10 and `openssl-sys` is 0.9.
+
+New major versions will be published at most once per year. After a new
+release, the previous major version will be partially supported with bug
+fixes for 3 months, after which support will be dropped entirely.
+
+### Contribution
+
+Unless you explicitly state otherwise, any contribution intentionally
+submitted for inclusion in the work by you, as defined in the Apache-2.0
+license, shall be dual licensed under the terms of both the Apache License,
+Version 2.0 and the MIT license without any additional terms or conditions.
diff -pruN 43.0.0-1/rust-vendor/openssl/build.rs 43.0.0-1ubuntu1/rust-vendor/openssl/build.rs
--- 43.0.0-1/rust-vendor/openssl/build.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/build.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,160 @@
+#![allow(
+    clippy::inconsistent_digit_grouping,
+    clippy::uninlined_format_args,
+    clippy::unusual_byte_groupings
+)]
+
+use std::env;
+
+fn main() {
+    println!("cargo:rustc-check-cfg=cfg(osslconf, values(\"OPENSSL_NO_OCB\", \"OPENSSL_NO_SM4\", \"OPENSSL_NO_SEED\", \"OPENSSL_NO_CHACHA\", \"OPENSSL_NO_CAST\", \"OPENSSL_NO_IDEA\", \"OPENSSL_NO_CAMELLIA\", \"OPENSSL_NO_RC4\", \"OPENSSL_NO_BF\", \"OPENSSL_NO_PSK\", \"OPENSSL_NO_DEPRECATED_3_0\", \"OPENSSL_NO_SCRYPT\", \"OPENSSL_NO_SM3\", \"OPENSSL_NO_RMD160\", \"OPENSSL_NO_EC2M\", \"OPENSSL_NO_OCSP\", \"OPENSSL_NO_CMS\"))");
+
+    println!("cargo:rustc-check-cfg=cfg(libressl)");
+    println!("cargo:rustc-check-cfg=cfg(boringssl)");
+
+    println!("cargo:rustc-check-cfg=cfg(libressl250)");
+    println!("cargo:rustc-check-cfg=cfg(libressl251)");
+    println!("cargo:rustc-check-cfg=cfg(libressl261)");
+    println!("cargo:rustc-check-cfg=cfg(libressl270)");
+    println!("cargo:rustc-check-cfg=cfg(libressl271)");
+    println!("cargo:rustc-check-cfg=cfg(libressl273)");
+    println!("cargo:rustc-check-cfg=cfg(libressl280)");
+    println!("cargo:rustc-check-cfg=cfg(libressl291)");
+    println!("cargo:rustc-check-cfg=cfg(libressl310)");
+    println!("cargo:rustc-check-cfg=cfg(libressl321)");
+    println!("cargo:rustc-check-cfg=cfg(libressl332)");
+    println!("cargo:rustc-check-cfg=cfg(libressl340)");
+    println!("cargo:rustc-check-cfg=cfg(libressl350)");
+    println!("cargo:rustc-check-cfg=cfg(libressl360)");
+    println!("cargo:rustc-check-cfg=cfg(libressl361)");
+    println!("cargo:rustc-check-cfg=cfg(libressl370)");
+    println!("cargo:rustc-check-cfg=cfg(libressl380)");
+    println!("cargo:rustc-check-cfg=cfg(libressl382)");
+    println!("cargo:rustc-check-cfg=cfg(libressl390)");
+
+    println!("cargo:rustc-check-cfg=cfg(ossl101)");
+    println!("cargo:rustc-check-cfg=cfg(ossl102)");
+    println!("cargo:rustc-check-cfg=cfg(ossl110)");
+    println!("cargo:rustc-check-cfg=cfg(ossl110g)");
+    println!("cargo:rustc-check-cfg=cfg(ossl110h)");
+    println!("cargo:rustc-check-cfg=cfg(ossl111)");
+    println!("cargo:rustc-check-cfg=cfg(ossl111d)");
+    println!("cargo:rustc-check-cfg=cfg(ossl300)");
+    println!("cargo:rustc-check-cfg=cfg(ossl310)");
+    println!("cargo:rustc-check-cfg=cfg(ossl320)");
+    println!("cargo:rustc-check-cfg=cfg(ossl330)");
+
+    if env::var("DEP_OPENSSL_LIBRESSL").is_ok() {
+        println!("cargo:rustc-cfg=libressl");
+    }
+
+    if env::var("DEP_OPENSSL_BORINGSSL").is_ok() {
+        println!("cargo:rustc-cfg=boringssl");
+    }
+
+    if let Ok(v) = env::var("DEP_OPENSSL_LIBRESSL_VERSION_NUMBER") {
+        let version = u64::from_str_radix(&v, 16).unwrap();
+
+        if version >= 0x2_05_00_00_0 {
+            println!("cargo:rustc-cfg=libressl250");
+        }
+        if version >= 0x2_05_01_00_0 {
+            println!("cargo:rustc-cfg=libressl251");
+        }
+        if version >= 0x2_06_01_00_0 {
+            println!("cargo:rustc-cfg=libressl261");
+        }
+        if version >= 0x2_07_00_00_0 {
+            println!("cargo:rustc-cfg=libressl270");
+        }
+        if version >= 0x2_07_01_00_0 {
+            println!("cargo:rustc-cfg=libressl271");
+        }
+        if version >= 0x2_07_03_00_0 {
+            println!("cargo:rustc-cfg=libressl273");
+        }
+        if version >= 0x2_08_00_00_0 {
+            println!("cargo:rustc-cfg=libressl280");
+        }
+        if version >= 0x2_09_01_00_0 {
+            println!("cargo:rustc-cfg=libressl291");
+        }
+        if version >= 0x3_01_00_00_0 {
+            println!("cargo:rustc-cfg=libressl310");
+        }
+        if version >= 0x3_02_01_00_0 {
+            println!("cargo:rustc-cfg=libressl321");
+        }
+        if version >= 0x3_03_02_00_0 {
+            println!("cargo:rustc-cfg=libressl332");
+        }
+        if version >= 0x3_04_00_00_0 {
+            println!("cargo:rustc-cfg=libressl340");
+        }
+        if version >= 0x3_05_00_00_0 {
+            println!("cargo:rustc-cfg=libressl350");
+        }
+        if version >= 0x3_06_00_00_0 {
+            println!("cargo:rustc-cfg=libressl360");
+        }
+        if version >= 0x3_06_01_00_0 {
+            println!("cargo:rustc-cfg=libressl361");
+        }
+        if version >= 0x3_07_00_00_0 {
+            println!("cargo:rustc-cfg=libressl370");
+        }
+        if version >= 0x3_08_00_00_0 {
+            println!("cargo:rustc-cfg=libressl380");
+        }
+        if version >= 0x3_08_02_00_0 {
+            println!("cargo:rustc-cfg=libressl382");
+        }
+        if version >= 0x3_09_00_00_0 {
+            println!("cargo:rustc-cfg=libressl390");
+        }
+    }
+
+    if let Ok(vars) = env::var("DEP_OPENSSL_CONF") {
+        for var in vars.split(',') {
+            println!("cargo:rustc-cfg=osslconf=\"{}\"", var);
+        }
+    }
+
+    if let Ok(version) = env::var("DEP_OPENSSL_VERSION_NUMBER") {
+        let version = u64::from_str_radix(&version, 16).unwrap();
+
+        if version >= 0x1_00_01_00_0 {
+            println!("cargo:rustc-cfg=ossl101");
+        }
+        if version >= 0x1_00_02_00_0 {
+            println!("cargo:rustc-cfg=ossl102");
+        }
+        if version >= 0x1_01_00_00_0 {
+            println!("cargo:rustc-cfg=ossl110");
+        }
+        if version >= 0x1_01_00_07_0 {
+            println!("cargo:rustc-cfg=ossl110g");
+        }
+        if version >= 0x1_01_00_08_0 {
+            println!("cargo:rustc-cfg=ossl110h");
+        }
+        if version >= 0x1_01_01_00_0 {
+            println!("cargo:rustc-cfg=ossl111");
+        }
+        if version >= 0x1_01_01_04_0 {
+            println!("cargo:rustc-cfg=ossl111d");
+        }
+        if version >= 0x3_00_00_00_0 {
+            println!("cargo:rustc-cfg=ossl300");
+        }
+        if version >= 0x3_01_00_00_0 {
+            println!("cargo:rustc-cfg=ossl310");
+        }
+        if version >= 0x3_02_00_00_0 {
+            println!("cargo:rustc-cfg=ossl320");
+        }
+        if version >= 0x3_03_00_00_0 {
+            println!("cargo:rustc-cfg=ossl330");
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/examples/mk_certs.rs 43.0.0-1ubuntu1/rust-vendor/openssl/examples/mk_certs.rs
--- 43.0.0-1/rust-vendor/openssl/examples/mk_certs.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/examples/mk_certs.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,160 @@
+#![allow(clippy::uninlined_format_args)]
+
+//! A program that generates ca certs, certs verified by the ca, and public
+//! and private keys.
+
+use openssl::asn1::Asn1Time;
+use openssl::bn::{BigNum, MsbOption};
+use openssl::error::ErrorStack;
+use openssl::hash::MessageDigest;
+use openssl::pkey::{PKey, PKeyRef, Private};
+use openssl::rsa::Rsa;
+use openssl::x509::extension::{
+    AuthorityKeyIdentifier, BasicConstraints, KeyUsage, SubjectAlternativeName,
+    SubjectKeyIdentifier,
+};
+use openssl::x509::{X509NameBuilder, X509Ref, X509Req, X509ReqBuilder, X509VerifyResult, X509};
+
+/// Make a CA certificate and private key
+fn mk_ca_cert() -> Result<(X509, PKey<Private>), ErrorStack> {
+    let rsa = Rsa::generate(2048)?;
+    let key_pair = PKey::from_rsa(rsa)?;
+
+    let mut x509_name = X509NameBuilder::new()?;
+    x509_name.append_entry_by_text("C", "US")?;
+    x509_name.append_entry_by_text("ST", "TX")?;
+    x509_name.append_entry_by_text("O", "Some CA organization")?;
+    x509_name.append_entry_by_text("CN", "ca test")?;
+    let x509_name = x509_name.build();
+
+    let mut cert_builder = X509::builder()?;
+    cert_builder.set_version(2)?;
+    let serial_number = {
+        let mut serial = BigNum::new()?;
+        serial.rand(159, MsbOption::MAYBE_ZERO, false)?;
+        serial.to_asn1_integer()?
+    };
+    cert_builder.set_serial_number(&serial_number)?;
+    cert_builder.set_subject_name(&x509_name)?;
+    cert_builder.set_issuer_name(&x509_name)?;
+    cert_builder.set_pubkey(&key_pair)?;
+    let not_before = Asn1Time::days_from_now(0)?;
+    cert_builder.set_not_before(&not_before)?;
+    let not_after = Asn1Time::days_from_now(365)?;
+    cert_builder.set_not_after(&not_after)?;
+
+    cert_builder.append_extension(BasicConstraints::new().critical().ca().build()?)?;
+    cert_builder.append_extension(
+        KeyUsage::new()
+            .critical()
+            .key_cert_sign()
+            .crl_sign()
+            .build()?,
+    )?;
+
+    let subject_key_identifier =
+        SubjectKeyIdentifier::new().build(&cert_builder.x509v3_context(None, None))?;
+    cert_builder.append_extension(subject_key_identifier)?;
+
+    cert_builder.sign(&key_pair, MessageDigest::sha256())?;
+    let cert = cert_builder.build();
+
+    Ok((cert, key_pair))
+}
+
+/// Make a X509 request with the given private key
+fn mk_request(key_pair: &PKey<Private>) -> Result<X509Req, ErrorStack> {
+    let mut req_builder = X509ReqBuilder::new()?;
+    req_builder.set_pubkey(key_pair)?;
+
+    let mut x509_name = X509NameBuilder::new()?;
+    x509_name.append_entry_by_text("C", "US")?;
+    x509_name.append_entry_by_text("ST", "TX")?;
+    x509_name.append_entry_by_text("O", "Some organization")?;
+    x509_name.append_entry_by_text("CN", "www.example.com")?;
+    let x509_name = x509_name.build();
+    req_builder.set_subject_name(&x509_name)?;
+
+    req_builder.sign(key_pair, MessageDigest::sha256())?;
+    let req = req_builder.build();
+    Ok(req)
+}
+
+/// Make a certificate and private key signed by the given CA cert and private key
+fn mk_ca_signed_cert(
+    ca_cert: &X509Ref,
+    ca_key_pair: &PKeyRef<Private>,
+) -> Result<(X509, PKey<Private>), ErrorStack> {
+    let rsa = Rsa::generate(2048)?;
+    let key_pair = PKey::from_rsa(rsa)?;
+
+    let req = mk_request(&key_pair)?;
+
+    let mut cert_builder = X509::builder()?;
+    cert_builder.set_version(2)?;
+    let serial_number = {
+        let mut serial = BigNum::new()?;
+        serial.rand(159, MsbOption::MAYBE_ZERO, false)?;
+        serial.to_asn1_integer()?
+    };
+    cert_builder.set_serial_number(&serial_number)?;
+    cert_builder.set_subject_name(req.subject_name())?;
+    cert_builder.set_issuer_name(ca_cert.subject_name())?;
+    cert_builder.set_pubkey(&key_pair)?;
+    let not_before = Asn1Time::days_from_now(0)?;
+    cert_builder.set_not_before(&not_before)?;
+    let not_after = Asn1Time::days_from_now(365)?;
+    cert_builder.set_not_after(&not_after)?;
+
+    cert_builder.append_extension(BasicConstraints::new().build()?)?;
+
+    cert_builder.append_extension(
+        KeyUsage::new()
+            .critical()
+            .non_repudiation()
+            .digital_signature()
+            .key_encipherment()
+            .build()?,
+    )?;
+
+    let subject_key_identifier =
+        SubjectKeyIdentifier::new().build(&cert_builder.x509v3_context(Some(ca_cert), None))?;
+    cert_builder.append_extension(subject_key_identifier)?;
+
+    let auth_key_identifier = AuthorityKeyIdentifier::new()
+        .keyid(false)
+        .issuer(false)
+        .build(&cert_builder.x509v3_context(Some(ca_cert), None))?;
+    cert_builder.append_extension(auth_key_identifier)?;
+
+    let subject_alt_name = SubjectAlternativeName::new()
+        .dns("*.example.com")
+        .dns("hello.com")
+        .build(&cert_builder.x509v3_context(Some(ca_cert), None))?;
+    cert_builder.append_extension(subject_alt_name)?;
+
+    cert_builder.sign(ca_key_pair, MessageDigest::sha256())?;
+    let cert = cert_builder.build();
+
+    Ok((cert, key_pair))
+}
+
+fn real_main() -> Result<(), ErrorStack> {
+    let (ca_cert, ca_key_pair) = mk_ca_cert()?;
+    let (cert, _key_pair) = mk_ca_signed_cert(&ca_cert, &ca_key_pair)?;
+
+    // Verify that this cert was issued by this ca
+    match ca_cert.issued(&cert) {
+        X509VerifyResult::OK => println!("Certificate verified!"),
+        ver_err => println!("Failed to verify certificate: {}", ver_err),
+    };
+
+    Ok(())
+}
+
+fn main() {
+    match real_main() {
+        Ok(()) => println!("Finished."),
+        Err(e) => println!("Error: {}", e),
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/aes.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/aes.rs
--- 43.0.0-1/rust-vendor/openssl/src/aes.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/aes.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,319 @@
+//! Low level AES IGE and key wrapping functionality
+//!
+//! AES ECB, CBC, XTS, CTR, CFB, GCM and other conventional symmetric encryption
+//! modes are found in [`symm`].  This is the implementation of AES IGE and key wrapping
+//!
+//! Advanced Encryption Standard (AES) provides symmetric key cipher that
+//! the same key is used to encrypt and decrypt data.  This implementation
+//! uses 128, 192, or 256 bit keys.  This module provides functions to
+//! create a new key with [`new_encrypt`] and perform an encryption/decryption
+//! using that key with [`aes_ige`].
+//!
+//! [`new_encrypt`]: struct.AesKey.html#method.new_encrypt
+//! [`aes_ige`]: fn.aes_ige.html
+//!
+//! The [`symm`] module should be used in preference to this module in most cases.
+//! The IGE block cipher is a non-traditional cipher mode.  More traditional AES
+//! encryption methods are found in the [`Crypter`] and [`Cipher`] structs.
+//!
+//! [`symm`]: ../symm/index.html
+//! [`Crypter`]: ../symm/struct.Crypter.html
+//! [`Cipher`]: ../symm/struct.Cipher.html
+//!
+//! # Examples
+
+#![cfg_attr(
+    all(not(boringssl), not(osslconf = "OPENSSL_NO_DEPRECATED_3_0")),
+    doc = r#"\
+## AES IGE
+```rust
+use openssl::aes::{AesKey, aes_ige};
+use openssl::symm::Mode;
+
+let key = b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F";
+let plaintext = b"\x12\x34\x56\x78\x90\x12\x34\x56\x12\x34\x56\x78\x90\x12\x34\x56";
+let mut iv = *b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\
+                \x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F";
+
+ let key = AesKey::new_encrypt(key).unwrap();
+ let mut output = [0u8; 16];
+ aes_ige(plaintext, &mut output, &key, &mut iv, Mode::Encrypt);
+ assert_eq!(output, *b"\xa6\xad\x97\x4d\x5c\xea\x1d\x36\xd2\xf3\x67\x98\x09\x07\xed\x32");
+```"#
+)]
+
+//!
+//! ## Key wrapping
+//! ```rust
+//! use openssl::aes::{AesKey, unwrap_key, wrap_key};
+//!
+//! let kek = b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F";
+//! let key_to_wrap = b"\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xAA\xBB\xCC\xDD\xEE\xFF";
+//!
+//! let enc_key = AesKey::new_encrypt(kek).unwrap();
+//! let mut ciphertext = [0u8; 24];
+//! wrap_key(&enc_key, None, &mut ciphertext, &key_to_wrap[..]).unwrap();
+//! let dec_key = AesKey::new_decrypt(kek).unwrap();
+//! let mut orig_key = [0u8; 16];
+//! unwrap_key(&dec_key, None, &mut orig_key, &ciphertext[..]).unwrap();
+//!
+//! assert_eq!(&orig_key[..], &key_to_wrap[..]);
+//! ```
+//!
+use cfg_if::cfg_if;
+use libc::{c_int, c_uint};
+use std::mem::MaybeUninit;
+use std::ptr;
+
+#[cfg(not(boringssl))]
+use crate::symm::Mode;
+use openssl_macros::corresponds;
+
+/// Provides Error handling for parsing keys.
+#[derive(Debug)]
+pub struct KeyError(());
+
+/// The key used to encrypt or decrypt cipher blocks.
+pub struct AesKey(ffi::AES_KEY);
+
+cfg_if! {
+    if #[cfg(boringssl)] {
+        type AesBitType = c_uint;
+        type AesSizeType = usize;
+    } else {
+        type AesBitType = c_int;
+        type AesSizeType = c_uint;
+    }
+}
+
+impl AesKey {
+    /// Prepares a key for encryption.
+    ///
+    /// # Failure
+    ///
+    /// Returns an error if the key is not 128, 192, or 256 bits.
+    #[corresponds(AES_set_encrypt_key)]
+    pub fn new_encrypt(key: &[u8]) -> Result<AesKey, KeyError> {
+        unsafe {
+            assert!(key.len() <= c_int::MAX as usize / 8);
+
+            let mut aes_key = MaybeUninit::uninit();
+            let r = ffi::AES_set_encrypt_key(
+                key.as_ptr() as *const _,
+                key.len() as AesBitType * 8,
+                aes_key.as_mut_ptr(),
+            );
+            if r == 0 {
+                Ok(AesKey(aes_key.assume_init()))
+            } else {
+                Err(KeyError(()))
+            }
+        }
+    }
+
+    /// Prepares a key for decryption.
+    ///
+    /// # Failure
+    ///
+    /// Returns an error if the key is not 128, 192, or 256 bits.
+    #[corresponds(AES_set_decrypt_key)]
+    pub fn new_decrypt(key: &[u8]) -> Result<AesKey, KeyError> {
+        unsafe {
+            assert!(key.len() <= c_int::MAX as usize / 8);
+
+            let mut aes_key = MaybeUninit::uninit();
+            let r = ffi::AES_set_decrypt_key(
+                key.as_ptr() as *const _,
+                key.len() as AesBitType * 8,
+                aes_key.as_mut_ptr(),
+            );
+
+            if r == 0 {
+                Ok(AesKey(aes_key.assume_init()))
+            } else {
+                Err(KeyError(()))
+            }
+        }
+    }
+}
+
+/// Performs AES IGE encryption or decryption
+///
+/// AES IGE (Infinite Garble Extension) is a form of AES block cipher utilized in
+/// OpenSSL.  Infinite Garble refers to propagating forward errors.  IGE, like other
+/// block ciphers implemented for AES requires an initialization vector.  The IGE mode
+/// allows a stream of blocks to be encrypted or decrypted without having the entire
+/// plaintext available.  For more information, visit [AES IGE Encryption].
+///
+/// This block cipher uses 16 byte blocks.  The rust implementation will panic
+/// if the input or output does not meet this 16-byte boundary.  Attention must
+/// be made in this low level implementation to pad the value to the 128-bit boundary.
+///
+/// [AES IGE Encryption]: http://www.links.org/files/openssl-ige.pdf
+///
+/// # Panics
+///
+/// Panics if `in_` is not the same length as `out`, if that length is not a multiple of 16, or if
+/// `iv` is not at least 32 bytes.
+#[cfg(not(boringssl))]
+#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+#[corresponds(AES_ige_encrypt)]
+pub fn aes_ige(in_: &[u8], out: &mut [u8], key: &AesKey, iv: &mut [u8], mode: Mode) {
+    unsafe {
+        assert!(in_.len() == out.len());
+        assert!(in_.len() % ffi::AES_BLOCK_SIZE as usize == 0);
+        assert!(iv.len() >= ffi::AES_BLOCK_SIZE as usize * 2);
+
+        let mode = match mode {
+            Mode::Encrypt => ffi::AES_ENCRYPT,
+            Mode::Decrypt => ffi::AES_DECRYPT,
+        };
+        ffi::AES_ige_encrypt(
+            in_.as_ptr() as *const _,
+            out.as_mut_ptr() as *mut _,
+            in_.len(),
+            &key.0,
+            iv.as_mut_ptr() as *mut _,
+            mode,
+        );
+    }
+}
+
+/// Wrap a key, according to [RFC 3394](https://tools.ietf.org/html/rfc3394)
+///
+/// * `key`: The key-encrypting-key to use. Must be a encrypting key
+/// * `iv`: The IV to use. You must use the same IV for both wrapping and unwrapping
+/// * `out`: The output buffer to store the ciphertext
+/// * `in_`: The input buffer, storing the key to be wrapped
+///
+/// Returns the number of bytes written into `out`
+///
+/// # Panics
+///
+/// Panics if either `out` or `in_` do not have sizes that are a multiple of 8, or if
+/// `out` is not 8 bytes longer than `in_`
+#[corresponds(AES_wrap_key)]
+pub fn wrap_key(
+    key: &AesKey,
+    iv: Option<[u8; 8]>,
+    out: &mut [u8],
+    in_: &[u8],
+) -> Result<usize, KeyError> {
+    unsafe {
+        assert!(out.len() >= in_.len() + 8); // Ciphertext is 64 bits longer (see 2.2.1)
+
+        let written = ffi::AES_wrap_key(
+            &key.0 as *const _ as *mut _, // this is safe, the implementation only uses the key as a const pointer.
+            iv.as_ref()
+                .map_or(ptr::null(), |iv| iv.as_ptr() as *const _),
+            out.as_ptr() as *mut _,
+            in_.as_ptr() as *const _,
+            in_.len() as AesSizeType,
+        );
+        if written <= 0 {
+            Err(KeyError(()))
+        } else {
+            Ok(written as usize)
+        }
+    }
+}
+
+/// Unwrap a key, according to [RFC 3394](https://tools.ietf.org/html/rfc3394)
+///
+/// * `key`: The key-encrypting-key to decrypt the wrapped key. Must be a decrypting key
+/// * `iv`: The same IV used for wrapping the key
+/// * `out`: The buffer to write the unwrapped key to
+/// * `in_`: The input ciphertext
+///
+/// Returns the number of bytes written into `out`
+///
+/// # Panics
+///
+/// Panics if either `out` or `in_` do not have sizes that are a multiple of 8, or
+/// if `in_` is not 8 bytes longer than `out`
+#[corresponds(AES_unwrap_key)]
+pub fn unwrap_key(
+    key: &AesKey,
+    iv: Option<[u8; 8]>,
+    out: &mut [u8],
+    in_: &[u8],
+) -> Result<usize, KeyError> {
+    unsafe {
+        assert!(out.len() + 8 <= in_.len());
+
+        let written = ffi::AES_unwrap_key(
+            &key.0 as *const _ as *mut _, // this is safe, the implementation only uses the key as a const pointer.
+            iv.as_ref()
+                .map_or(ptr::null(), |iv| iv.as_ptr() as *const _),
+            out.as_ptr() as *mut _,
+            in_.as_ptr() as *const _,
+            in_.len() as AesSizeType,
+        );
+
+        if written <= 0 {
+            Err(KeyError(()))
+        } else {
+            Ok(written as usize)
+        }
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use hex::FromHex;
+
+    use super::*;
+    #[cfg(not(boringssl))]
+    use crate::symm::Mode;
+
+    // From https://www.mgp25.com/AESIGE/
+    #[test]
+    #[cfg(not(boringssl))]
+    #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+    fn ige_vector_1() {
+        let raw_key = "000102030405060708090A0B0C0D0E0F";
+        let raw_iv = "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F";
+        let raw_pt = "0000000000000000000000000000000000000000000000000000000000000000";
+        let raw_ct = "1A8519A6557BE652E9DA8E43DA4EF4453CF456B4CA488AA383C79C98B34797CB";
+
+        let key = AesKey::new_encrypt(&Vec::from_hex(raw_key).unwrap()).unwrap();
+        let mut iv = Vec::from_hex(raw_iv).unwrap();
+        let pt = Vec::from_hex(raw_pt).unwrap();
+        let ct = Vec::from_hex(raw_ct).unwrap();
+
+        let mut ct_actual = vec![0; ct.len()];
+        aes_ige(&pt, &mut ct_actual, &key, &mut iv, Mode::Encrypt);
+        assert_eq!(ct_actual, ct);
+
+        let key = AesKey::new_decrypt(&Vec::from_hex(raw_key).unwrap()).unwrap();
+        let mut iv = Vec::from_hex(raw_iv).unwrap();
+        let mut pt_actual = vec![0; pt.len()];
+        aes_ige(&ct, &mut pt_actual, &key, &mut iv, Mode::Decrypt);
+        assert_eq!(pt_actual, pt);
+    }
+
+    // from the RFC https://tools.ietf.org/html/rfc3394#section-2.2.3
+    #[test]
+    fn test_wrap_unwrap() {
+        let raw_key = Vec::from_hex("000102030405060708090A0B0C0D0E0F").unwrap();
+        let key_data = Vec::from_hex("00112233445566778899AABBCCDDEEFF").unwrap();
+        let expected_ciphertext =
+            Vec::from_hex("1FA68B0A8112B447AEF34BD8FB5A7B829D3E862371D2CFE5").unwrap();
+
+        let enc_key = AesKey::new_encrypt(&raw_key).unwrap();
+        let mut wrapped = [0; 24];
+        assert_eq!(
+            wrap_key(&enc_key, None, &mut wrapped, &key_data).unwrap(),
+            24
+        );
+        assert_eq!(&wrapped[..], &expected_ciphertext[..]);
+
+        let dec_key = AesKey::new_decrypt(&raw_key).unwrap();
+        let mut unwrapped = [0; 16];
+        assert_eq!(
+            unwrap_key(&dec_key, None, &mut unwrapped, &wrapped).unwrap(),
+            16
+        );
+        assert_eq!(&unwrapped[..], &key_data[..]);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/asn1.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/asn1.rs
--- 43.0.0-1/rust-vendor/openssl/src/asn1.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/asn1.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,911 @@
+#![deny(missing_docs)]
+
+//! Defines the format of certificates
+//!
+//! This module is used by [`x509`] and other certificate building functions
+//! to describe time, strings, and objects.
+//!
+//! Abstract Syntax Notation One is an interface description language.
+//! The specification comes from [X.208] by OSI, and rewritten in X.680.
+//! ASN.1 describes properties of an object with a type set.  Those types
+//! can be atomic, structured, choice, and other (CHOICE and ANY).  These
+//! types are expressed as a number and the assignment operator ::=  gives
+//! the type a name.
+//!
+//! The implementation here provides a subset of the ASN.1 types that OpenSSL
+//! uses, especially in the properties of a certificate used in HTTPS.
+//!
+//! [X.208]: https://www.itu.int/rec/T-REC-X.208-198811-W/en
+//! [`x509`]: ../x509/struct.X509Builder.html
+//!
+//! ## Examples
+//!
+//! ```
+//! use openssl::asn1::Asn1Time;
+//! let tomorrow = Asn1Time::days_from_now(1);
+//! ```
+use cfg_if::cfg_if;
+use foreign_types::{ForeignType, ForeignTypeRef};
+use libc::{c_char, c_int, c_long, time_t};
+use std::cmp::Ordering;
+use std::convert::TryInto;
+use std::ffi::CString;
+use std::fmt;
+use std::ptr;
+use std::slice;
+use std::str;
+
+use crate::bio::MemBio;
+use crate::bn::{BigNum, BigNumRef};
+use crate::error::ErrorStack;
+use crate::nid::Nid;
+use crate::stack::Stackable;
+use crate::string::OpensslString;
+use crate::{cvt, cvt_p};
+use openssl_macros::corresponds;
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::ASN1_GENERALIZEDTIME;
+    fn drop = ffi::ASN1_GENERALIZEDTIME_free;
+
+    /// Non-UTC representation of time
+    ///
+    /// If a time can be represented by UTCTime, UTCTime is used
+    /// otherwise, ASN1_GENERALIZEDTIME is used.  This would be, for
+    /// example outside the year range of 1950-2049.
+    ///
+    /// [ASN1_GENERALIZEDTIME_set] documentation from OpenSSL provides
+    /// further details of implementation.  Note: these docs are from the master
+    /// branch as documentation on the 1.1.0 branch did not include this page.
+    ///
+    /// [ASN1_GENERALIZEDTIME_set]: https://www.openssl.org/docs/manmaster/man3/ASN1_GENERALIZEDTIME_set.html
+    pub struct Asn1GeneralizedTime;
+    /// Reference to a [`Asn1GeneralizedTime`]
+    ///
+    /// [`Asn1GeneralizedTime`]: struct.Asn1GeneralizedTime.html
+    pub struct Asn1GeneralizedTimeRef;
+}
+
+impl fmt::Display for Asn1GeneralizedTimeRef {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        unsafe {
+            let mem_bio = match MemBio::new() {
+                Err(_) => return f.write_str("error"),
+                Ok(m) => m,
+            };
+            let print_result = cvt(ffi::ASN1_GENERALIZEDTIME_print(
+                mem_bio.as_ptr(),
+                self.as_ptr(),
+            ));
+            match print_result {
+                Err(_) => f.write_str("error"),
+                Ok(_) => f.write_str(str::from_utf8_unchecked(mem_bio.get_buf())),
+            }
+        }
+    }
+}
+
+/// The type of an ASN.1 value.
+#[derive(Debug, Copy, Clone, PartialEq, Eq)]
+pub struct Asn1Type(c_int);
+
+#[allow(missing_docs)] // no need to document the constants
+impl Asn1Type {
+    pub const EOC: Asn1Type = Asn1Type(ffi::V_ASN1_EOC);
+
+    pub const BOOLEAN: Asn1Type = Asn1Type(ffi::V_ASN1_BOOLEAN);
+
+    pub const INTEGER: Asn1Type = Asn1Type(ffi::V_ASN1_INTEGER);
+
+    pub const BIT_STRING: Asn1Type = Asn1Type(ffi::V_ASN1_BIT_STRING);
+
+    pub const OCTET_STRING: Asn1Type = Asn1Type(ffi::V_ASN1_OCTET_STRING);
+
+    pub const NULL: Asn1Type = Asn1Type(ffi::V_ASN1_NULL);
+
+    pub const OBJECT: Asn1Type = Asn1Type(ffi::V_ASN1_OBJECT);
+
+    pub const OBJECT_DESCRIPTOR: Asn1Type = Asn1Type(ffi::V_ASN1_OBJECT_DESCRIPTOR);
+
+    pub const EXTERNAL: Asn1Type = Asn1Type(ffi::V_ASN1_EXTERNAL);
+
+    pub const REAL: Asn1Type = Asn1Type(ffi::V_ASN1_REAL);
+
+    pub const ENUMERATED: Asn1Type = Asn1Type(ffi::V_ASN1_ENUMERATED);
+
+    pub const UTF8STRING: Asn1Type = Asn1Type(ffi::V_ASN1_UTF8STRING);
+
+    pub const SEQUENCE: Asn1Type = Asn1Type(ffi::V_ASN1_SEQUENCE);
+
+    pub const SET: Asn1Type = Asn1Type(ffi::V_ASN1_SET);
+
+    pub const NUMERICSTRING: Asn1Type = Asn1Type(ffi::V_ASN1_NUMERICSTRING);
+
+    pub const PRINTABLESTRING: Asn1Type = Asn1Type(ffi::V_ASN1_PRINTABLESTRING);
+
+    pub const T61STRING: Asn1Type = Asn1Type(ffi::V_ASN1_T61STRING);
+
+    pub const TELETEXSTRING: Asn1Type = Asn1Type(ffi::V_ASN1_TELETEXSTRING);
+
+    pub const VIDEOTEXSTRING: Asn1Type = Asn1Type(ffi::V_ASN1_VIDEOTEXSTRING);
+
+    pub const IA5STRING: Asn1Type = Asn1Type(ffi::V_ASN1_IA5STRING);
+
+    pub const UTCTIME: Asn1Type = Asn1Type(ffi::V_ASN1_UTCTIME);
+
+    pub const GENERALIZEDTIME: Asn1Type = Asn1Type(ffi::V_ASN1_GENERALIZEDTIME);
+
+    pub const GRAPHICSTRING: Asn1Type = Asn1Type(ffi::V_ASN1_GRAPHICSTRING);
+
+    pub const ISO64STRING: Asn1Type = Asn1Type(ffi::V_ASN1_ISO64STRING);
+
+    pub const VISIBLESTRING: Asn1Type = Asn1Type(ffi::V_ASN1_VISIBLESTRING);
+
+    pub const GENERALSTRING: Asn1Type = Asn1Type(ffi::V_ASN1_GENERALSTRING);
+
+    pub const UNIVERSALSTRING: Asn1Type = Asn1Type(ffi::V_ASN1_UNIVERSALSTRING);
+
+    pub const BMPSTRING: Asn1Type = Asn1Type(ffi::V_ASN1_BMPSTRING);
+
+    /// Constructs an `Asn1Type` from a raw OpenSSL value.
+    pub fn from_raw(value: c_int) -> Self {
+        Asn1Type(value)
+    }
+
+    /// Returns the raw OpenSSL value represented by this type.
+    pub fn as_raw(&self) -> c_int {
+        self.0
+    }
+}
+
+/// Difference between two ASN1 times.
+///
+/// This `struct` is created by the [`diff`] method on [`Asn1TimeRef`]. See its
+/// documentation for more.
+///
+/// [`diff`]: struct.Asn1TimeRef.html#method.diff
+/// [`Asn1TimeRef`]: struct.Asn1TimeRef.html
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+#[cfg(any(ossl102, boringssl))]
+pub struct TimeDiff {
+    /// Difference in days
+    pub days: c_int,
+    /// Difference in seconds.
+    ///
+    /// This is always less than the number of seconds in a day.
+    pub secs: c_int,
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::ASN1_TIME;
+    fn drop = ffi::ASN1_TIME_free;
+    /// Time storage and comparison
+    ///
+    /// Asn1Time should be used to store and share time information
+    /// using certificates.  If Asn1Time is set using a string, it must
+    /// be in either YYMMDDHHMMSSZ, YYYYMMDDHHMMSSZ, or another ASN.1 format.
+    ///
+    /// [ASN_TIME_set] documentation at OpenSSL explains the ASN.1 implementation
+    /// used by OpenSSL.
+    ///
+    /// [ASN_TIME_set]: https://www.openssl.org/docs/manmaster/crypto/ASN1_TIME_set.html
+    pub struct Asn1Time;
+    /// Reference to an [`Asn1Time`]
+    ///
+    /// [`Asn1Time`]: struct.Asn1Time.html
+    pub struct Asn1TimeRef;
+}
+
+impl Asn1TimeRef {
+    /// Find difference between two times
+    #[corresponds(ASN1_TIME_diff)]
+    #[cfg(any(ossl102, boringssl))]
+    pub fn diff(&self, compare: &Self) -> Result<TimeDiff, ErrorStack> {
+        let mut days = 0;
+        let mut secs = 0;
+        let other = compare.as_ptr();
+
+        let err = unsafe { ffi::ASN1_TIME_diff(&mut days, &mut secs, self.as_ptr(), other) };
+
+        match err {
+            0 => Err(ErrorStack::get()),
+            _ => Ok(TimeDiff { days, secs }),
+        }
+    }
+
+    /// Compare two times
+    #[corresponds(ASN1_TIME_compare)]
+    #[cfg(any(ossl102, boringssl))]
+    pub fn compare(&self, other: &Self) -> Result<Ordering, ErrorStack> {
+        let d = self.diff(other)?;
+        if d.days > 0 || d.secs > 0 {
+            return Ok(Ordering::Less);
+        }
+        if d.days < 0 || d.secs < 0 {
+            return Ok(Ordering::Greater);
+        }
+
+        Ok(Ordering::Equal)
+    }
+}
+
+#[cfg(any(ossl102, boringssl))]
+impl PartialEq for Asn1TimeRef {
+    fn eq(&self, other: &Asn1TimeRef) -> bool {
+        self.diff(other)
+            .map(|t| t.days == 0 && t.secs == 0)
+            .unwrap_or(false)
+    }
+}
+
+#[cfg(any(ossl102, boringssl))]
+impl PartialEq<Asn1Time> for Asn1TimeRef {
+    fn eq(&self, other: &Asn1Time) -> bool {
+        self.diff(other)
+            .map(|t| t.days == 0 && t.secs == 0)
+            .unwrap_or(false)
+    }
+}
+
+#[cfg(any(ossl102, boringssl))]
+impl<'a> PartialEq<Asn1Time> for &'a Asn1TimeRef {
+    fn eq(&self, other: &Asn1Time) -> bool {
+        self.diff(other)
+            .map(|t| t.days == 0 && t.secs == 0)
+            .unwrap_or(false)
+    }
+}
+
+#[cfg(any(ossl102, boringssl))]
+impl PartialOrd for Asn1TimeRef {
+    fn partial_cmp(&self, other: &Asn1TimeRef) -> Option<Ordering> {
+        self.compare(other).ok()
+    }
+}
+
+#[cfg(any(ossl102, boringssl))]
+impl PartialOrd<Asn1Time> for Asn1TimeRef {
+    fn partial_cmp(&self, other: &Asn1Time) -> Option<Ordering> {
+        self.compare(other).ok()
+    }
+}
+
+#[cfg(any(ossl102, boringssl))]
+impl<'a> PartialOrd<Asn1Time> for &'a Asn1TimeRef {
+    fn partial_cmp(&self, other: &Asn1Time) -> Option<Ordering> {
+        self.compare(other).ok()
+    }
+}
+
+impl fmt::Display for Asn1TimeRef {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        unsafe {
+            let mem_bio = match MemBio::new() {
+                Err(_) => return f.write_str("error"),
+                Ok(m) => m,
+            };
+            let print_result = cvt(ffi::ASN1_TIME_print(mem_bio.as_ptr(), self.as_ptr()));
+            match print_result {
+                Err(_) => f.write_str("error"),
+                Ok(_) => f.write_str(str::from_utf8_unchecked(mem_bio.get_buf())),
+            }
+        }
+    }
+}
+
+impl fmt::Debug for Asn1TimeRef {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.write_str(&self.to_string())
+    }
+}
+
+impl Asn1Time {
+    #[corresponds(ASN1_TIME_new)]
+    fn new() -> Result<Asn1Time, ErrorStack> {
+        ffi::init();
+
+        unsafe {
+            let handle = cvt_p(ffi::ASN1_TIME_new())?;
+            Ok(Asn1Time::from_ptr(handle))
+        }
+    }
+
+    #[corresponds(X509_gmtime_adj)]
+    fn from_period(period: c_long) -> Result<Asn1Time, ErrorStack> {
+        ffi::init();
+
+        unsafe {
+            let handle = cvt_p(ffi::X509_gmtime_adj(ptr::null_mut(), period))?;
+            Ok(Asn1Time::from_ptr(handle))
+        }
+    }
+
+    /// Creates a new time on specified interval in days from now
+    pub fn days_from_now(days: u32) -> Result<Asn1Time, ErrorStack> {
+        Asn1Time::from_period(days as c_long * 60 * 60 * 24)
+    }
+
+    /// Creates a new time from the specified `time_t` value
+    #[corresponds(ASN1_TIME_set)]
+    pub fn from_unix(time: time_t) -> Result<Asn1Time, ErrorStack> {
+        ffi::init();
+
+        unsafe {
+            let handle = cvt_p(ffi::ASN1_TIME_set(ptr::null_mut(), time))?;
+            Ok(Asn1Time::from_ptr(handle))
+        }
+    }
+
+    /// Creates a new time corresponding to the specified ASN1 time string.
+    #[corresponds(ASN1_TIME_set_string)]
+    #[allow(clippy::should_implement_trait)]
+    pub fn from_str(s: &str) -> Result<Asn1Time, ErrorStack> {
+        unsafe {
+            let s = CString::new(s).unwrap();
+
+            let time = Asn1Time::new()?;
+            cvt(ffi::ASN1_TIME_set_string(time.as_ptr(), s.as_ptr()))?;
+
+            Ok(time)
+        }
+    }
+
+    /// Creates a new time corresponding to the specified X509 time string.
+    ///
+    /// Requires BoringSSL or OpenSSL 1.1.1 or newer.
+    #[corresponds(ASN1_TIME_set_string_X509)]
+    #[cfg(any(ossl111, boringssl))]
+    pub fn from_str_x509(s: &str) -> Result<Asn1Time, ErrorStack> {
+        unsafe {
+            let s = CString::new(s).unwrap();
+
+            let time = Asn1Time::new()?;
+            cvt(ffi::ASN1_TIME_set_string_X509(time.as_ptr(), s.as_ptr()))?;
+
+            Ok(time)
+        }
+    }
+}
+
+#[cfg(any(ossl102, boringssl))]
+impl PartialEq for Asn1Time {
+    fn eq(&self, other: &Asn1Time) -> bool {
+        self.diff(other)
+            .map(|t| t.days == 0 && t.secs == 0)
+            .unwrap_or(false)
+    }
+}
+
+#[cfg(any(ossl102, boringssl))]
+impl PartialEq<Asn1TimeRef> for Asn1Time {
+    fn eq(&self, other: &Asn1TimeRef) -> bool {
+        self.diff(other)
+            .map(|t| t.days == 0 && t.secs == 0)
+            .unwrap_or(false)
+    }
+}
+
+#[cfg(any(ossl102, boringssl))]
+impl<'a> PartialEq<&'a Asn1TimeRef> for Asn1Time {
+    fn eq(&self, other: &&'a Asn1TimeRef) -> bool {
+        self.diff(other)
+            .map(|t| t.days == 0 && t.secs == 0)
+            .unwrap_or(false)
+    }
+}
+
+#[cfg(any(ossl102, boringssl))]
+impl PartialOrd for Asn1Time {
+    fn partial_cmp(&self, other: &Asn1Time) -> Option<Ordering> {
+        self.compare(other).ok()
+    }
+}
+
+#[cfg(any(ossl102, boringssl))]
+impl PartialOrd<Asn1TimeRef> for Asn1Time {
+    fn partial_cmp(&self, other: &Asn1TimeRef) -> Option<Ordering> {
+        self.compare(other).ok()
+    }
+}
+
+#[cfg(any(ossl102, boringssl))]
+impl<'a> PartialOrd<&'a Asn1TimeRef> for Asn1Time {
+    fn partial_cmp(&self, other: &&'a Asn1TimeRef) -> Option<Ordering> {
+        self.compare(other).ok()
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::ASN1_STRING;
+    fn drop = ffi::ASN1_STRING_free;
+    /// Primary ASN.1 type used by OpenSSL
+    ///
+    /// Almost all ASN.1 types in OpenSSL are represented by ASN1_STRING
+    /// structures.  This implementation uses [ASN1_STRING-to_UTF8] to preserve
+    /// compatibility with Rust's String.
+    ///
+    /// [ASN1_STRING-to_UTF8]: https://www.openssl.org/docs/manmaster/crypto/ASN1_STRING_to_UTF8.html
+    pub struct Asn1String;
+    /// A reference to an [`Asn1String`].
+    pub struct Asn1StringRef;
+}
+
+impl Asn1StringRef {
+    /// Converts the ASN.1 underlying format to UTF8
+    ///
+    /// ASN.1 strings may utilize UTF-16, ASCII, BMP, or UTF8.  This is important to
+    /// consume the string in a meaningful way without knowing the underlying
+    /// format.
+    #[corresponds(ASN1_STRING_to_UTF8)]
+    pub fn as_utf8(&self) -> Result<OpensslString, ErrorStack> {
+        unsafe {
+            let mut ptr = ptr::null_mut();
+            let len = ffi::ASN1_STRING_to_UTF8(&mut ptr, self.as_ptr());
+            if len < 0 {
+                return Err(ErrorStack::get());
+            }
+
+            Ok(OpensslString::from_ptr(ptr as *mut c_char))
+        }
+    }
+
+    /// Return the string as an array of bytes.
+    ///
+    /// The bytes do not directly correspond to UTF-8 encoding.  To interact with
+    /// strings in rust, it is preferable to use [`as_utf8`]
+    ///
+    /// [`as_utf8`]: struct.Asn1String.html#method.as_utf8
+    #[corresponds(ASN1_STRING_get0_data)]
+    pub fn as_slice(&self) -> &[u8] {
+        unsafe { slice::from_raw_parts(ASN1_STRING_get0_data(self.as_ptr()), self.len()) }
+    }
+
+    /// Returns the number of bytes in the string.
+    #[corresponds(ASN1_STRING_length)]
+    pub fn len(&self) -> usize {
+        unsafe { ffi::ASN1_STRING_length(self.as_ptr()) as usize }
+    }
+
+    /// Determines if the string is empty.
+    pub fn is_empty(&self) -> bool {
+        self.len() == 0
+    }
+}
+
+impl fmt::Debug for Asn1StringRef {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
+        match self.as_utf8() {
+            Ok(openssl_string) => openssl_string.fmt(fmt),
+            Err(_) => fmt.write_str("error"),
+        }
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::ASN1_INTEGER;
+    fn drop = ffi::ASN1_INTEGER_free;
+
+    /// Numeric representation
+    ///
+    /// Integers in ASN.1 may include BigNum, int64 or uint64.  BigNum implementation
+    /// can be found within [`bn`] module.
+    ///
+    /// OpenSSL documentation includes [`ASN1_INTEGER_set`].
+    ///
+    /// [`bn`]: ../bn/index.html
+    /// [`ASN1_INTEGER_set`]: https://www.openssl.org/docs/manmaster/crypto/ASN1_INTEGER_set.html
+    pub struct Asn1Integer;
+    /// A reference to an [`Asn1Integer`].
+    pub struct Asn1IntegerRef;
+}
+
+impl Asn1Integer {
+    /// Converts a bignum to an `Asn1Integer`.
+    ///
+    /// Corresponds to [`BN_to_ASN1_INTEGER`]. Also see
+    /// [`BigNumRef::to_asn1_integer`].
+    ///
+    /// [`BN_to_ASN1_INTEGER`]: https://www.openssl.org/docs/manmaster/crypto/BN_to_ASN1_INTEGER.html
+    /// [`BigNumRef::to_asn1_integer`]: ../bn/struct.BigNumRef.html#method.to_asn1_integer
+    pub fn from_bn(bn: &BigNumRef) -> Result<Self, ErrorStack> {
+        bn.to_asn1_integer()
+    }
+}
+
+impl Ord for Asn1Integer {
+    fn cmp(&self, other: &Self) -> Ordering {
+        Asn1IntegerRef::cmp(self, other)
+    }
+}
+impl PartialOrd for Asn1Integer {
+    fn partial_cmp(&self, other: &Asn1Integer) -> Option<Ordering> {
+        Some(self.cmp(other))
+    }
+}
+impl Eq for Asn1Integer {}
+impl PartialEq for Asn1Integer {
+    fn eq(&self, other: &Asn1Integer) -> bool {
+        Asn1IntegerRef::eq(self, other)
+    }
+}
+
+impl Asn1IntegerRef {
+    #[allow(missing_docs, clippy::unnecessary_cast)]
+    #[deprecated(since = "0.10.6", note = "use to_bn instead")]
+    pub fn get(&self) -> i64 {
+        unsafe { ffi::ASN1_INTEGER_get(self.as_ptr()) as i64 }
+    }
+
+    /// Converts the integer to a `BigNum`.
+    #[corresponds(ASN1_INTEGER_to_BN)]
+    pub fn to_bn(&self) -> Result<BigNum, ErrorStack> {
+        unsafe {
+            cvt_p(ffi::ASN1_INTEGER_to_BN(self.as_ptr(), ptr::null_mut()))
+                .map(|p| BigNum::from_ptr(p))
+        }
+    }
+
+    /// Sets the ASN.1 value to the value of a signed 32-bit integer, for larger numbers
+    /// see [`bn`].
+    ///
+    /// [`bn`]: ../bn/struct.BigNumRef.html#method.to_asn1_integer
+    #[corresponds(ASN1_INTEGER_set)]
+    pub fn set(&mut self, value: i32) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::ASN1_INTEGER_set(self.as_ptr(), value as c_long)).map(|_| ()) }
+    }
+
+    /// Creates a new Asn1Integer with the same value.
+    #[corresponds(ASN1_INTEGER_dup)]
+    pub fn to_owned(&self) -> Result<Asn1Integer, ErrorStack> {
+        unsafe { cvt_p(ffi::ASN1_INTEGER_dup(self.as_ptr())).map(|p| Asn1Integer::from_ptr(p)) }
+    }
+}
+
+impl Ord for Asn1IntegerRef {
+    fn cmp(&self, other: &Self) -> Ordering {
+        let res = unsafe { ffi::ASN1_INTEGER_cmp(self.as_ptr(), other.as_ptr()) };
+        res.cmp(&0)
+    }
+}
+impl PartialOrd for Asn1IntegerRef {
+    fn partial_cmp(&self, other: &Asn1IntegerRef) -> Option<Ordering> {
+        Some(self.cmp(other))
+    }
+}
+impl Eq for Asn1IntegerRef {}
+impl PartialEq for Asn1IntegerRef {
+    fn eq(&self, other: &Asn1IntegerRef) -> bool {
+        self.cmp(other) == Ordering::Equal
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::ASN1_BIT_STRING;
+    fn drop = ffi::ASN1_BIT_STRING_free;
+    /// Sequence of bytes
+    ///
+    /// Asn1BitString is used in [`x509`] certificates for the signature.
+    /// The bit string acts as a collection of bytes.
+    ///
+    /// [`x509`]: ../x509/struct.X509.html#method.signature
+    pub struct Asn1BitString;
+    /// A reference to an [`Asn1BitString`].
+    pub struct Asn1BitStringRef;
+}
+
+impl Asn1BitStringRef {
+    /// Returns the Asn1BitString as a slice.
+    #[corresponds(ASN1_STRING_get0_data)]
+    pub fn as_slice(&self) -> &[u8] {
+        unsafe { slice::from_raw_parts(ASN1_STRING_get0_data(self.as_ptr() as *mut _), self.len()) }
+    }
+
+    /// Returns the number of bytes in the string.
+    #[corresponds(ASN1_STRING_length)]
+    pub fn len(&self) -> usize {
+        unsafe { ffi::ASN1_STRING_length(self.as_ptr() as *const _) as usize }
+    }
+
+    /// Determines if the string is empty.
+    pub fn is_empty(&self) -> bool {
+        self.len() == 0
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::ASN1_OCTET_STRING;
+    fn drop = ffi::ASN1_OCTET_STRING_free;
+    /// ASN.1 OCTET STRING type
+    pub struct Asn1OctetString;
+    /// A reference to an [`Asn1OctetString`].
+    pub struct Asn1OctetStringRef;
+}
+
+impl Asn1OctetString {
+    /// Creates an Asn1OctetString from bytes
+    pub fn new_from_bytes(value: &[u8]) -> Result<Self, ErrorStack> {
+        ffi::init();
+        unsafe {
+            let s = cvt_p(ffi::ASN1_OCTET_STRING_new())?;
+            ffi::ASN1_OCTET_STRING_set(s, value.as_ptr(), value.len().try_into().unwrap());
+            Ok(Self::from_ptr(s))
+        }
+    }
+}
+
+impl Asn1OctetStringRef {
+    /// Returns the octet string as an array of bytes.
+    #[corresponds(ASN1_STRING_get0_data)]
+    pub fn as_slice(&self) -> &[u8] {
+        unsafe { slice::from_raw_parts(ASN1_STRING_get0_data(self.as_ptr().cast()), self.len()) }
+    }
+
+    /// Returns the number of bytes in the octet string.
+    #[corresponds(ASN1_STRING_length)]
+    pub fn len(&self) -> usize {
+        unsafe { ffi::ASN1_STRING_length(self.as_ptr().cast()) as usize }
+    }
+
+    /// Determines if the string is empty.
+    pub fn is_empty(&self) -> bool {
+        self.len() == 0
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::ASN1_OBJECT;
+    fn drop = ffi::ASN1_OBJECT_free;
+    fn clone = ffi::OBJ_dup;
+
+    /// Object Identifier
+    ///
+    /// Represents an ASN.1 Object.  Typically, NIDs, or numeric identifiers
+    /// are stored as a table within the [`Nid`] module.  These constants are
+    /// used to determine attributes of a certificate, such as mapping the
+    /// attribute "CommonName" to "CN" which is represented as the OID of 13.
+    /// This attribute is a constant in the [`nid::COMMONNAME`].
+    ///
+    /// OpenSSL documentation at [`OBJ_nid2obj`]
+    ///
+    /// [`Nid`]: ../nid/index.html
+    /// [`nid::COMMONNAME`]: ../nid/constant.COMMONNAME.html
+    /// [`OBJ_nid2obj`]: https://www.openssl.org/docs/manmaster/crypto/OBJ_obj2nid.html
+    pub struct Asn1Object;
+    /// A reference to an [`Asn1Object`].
+    pub struct Asn1ObjectRef;
+}
+
+impl Stackable for Asn1Object {
+    type StackType = ffi::stack_st_ASN1_OBJECT;
+}
+
+impl Asn1Object {
+    /// Constructs an ASN.1 Object Identifier from a string representation of the OID.
+    #[corresponds(OBJ_txt2obj)]
+    #[allow(clippy::should_implement_trait)]
+    pub fn from_str(txt: &str) -> Result<Asn1Object, ErrorStack> {
+        unsafe {
+            ffi::init();
+            let txt = CString::new(txt).unwrap();
+            let obj: *mut ffi::ASN1_OBJECT = cvt_p(ffi::OBJ_txt2obj(txt.as_ptr() as *const _, 0))?;
+            Ok(Asn1Object::from_ptr(obj))
+        }
+    }
+
+    /// Return the OID as an DER encoded array of bytes. This is the ASN.1
+    /// value, not including tag or length.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(OBJ_get0_data)]
+    #[cfg(ossl111)]
+    pub fn as_slice(&self) -> &[u8] {
+        unsafe {
+            let len = ffi::OBJ_length(self.as_ptr());
+            slice::from_raw_parts(ffi::OBJ_get0_data(self.as_ptr()), len)
+        }
+    }
+}
+
+impl Asn1ObjectRef {
+    /// Returns the NID associated with this OID.
+    pub fn nid(&self) -> Nid {
+        unsafe { Nid::from_raw(ffi::OBJ_obj2nid(self.as_ptr())) }
+    }
+}
+
+impl fmt::Display for Asn1ObjectRef {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
+        unsafe {
+            let mut buf = [0; 80];
+            let len = ffi::OBJ_obj2txt(
+                buf.as_mut_ptr() as *mut _,
+                buf.len() as c_int,
+                self.as_ptr(),
+                0,
+            );
+            match str::from_utf8(&buf[..len as usize]) {
+                Err(_) => fmt.write_str("error"),
+                Ok(s) => fmt.write_str(s),
+            }
+        }
+    }
+}
+
+impl fmt::Debug for Asn1ObjectRef {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
+        fmt.write_str(self.to_string().as_str())
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl273, boringssl))] {
+        use ffi::ASN1_STRING_get0_data;
+    } else {
+        #[allow(bad_style)]
+        unsafe fn ASN1_STRING_get0_data(s: *mut ffi::ASN1_STRING) -> *const ::libc::c_uchar {
+            ffi::ASN1_STRING_data(s)
+        }
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::ASN1_ENUMERATED;
+    fn drop = ffi::ASN1_ENUMERATED_free;
+
+    /// An ASN.1 enumerated.
+    pub struct Asn1Enumerated;
+    /// A reference to an [`Asn1Enumerated`].
+    pub struct Asn1EnumeratedRef;
+}
+
+impl Asn1EnumeratedRef {
+    /// Get the value, if it fits in the required bounds.
+    #[corresponds(ASN1_ENUMERATED_get_int64)]
+    #[cfg(ossl110)]
+    pub fn get_i64(&self) -> Result<i64, ErrorStack> {
+        let mut crl_reason = 0;
+        unsafe {
+            cvt(ffi::ASN1_ENUMERATED_get_int64(
+                &mut crl_reason,
+                self.as_ptr(),
+            ))?;
+        }
+        Ok(crl_reason)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    use crate::bn::BigNum;
+    use crate::nid::Nid;
+
+    /// Tests conversion between BigNum and Asn1Integer.
+    #[test]
+    fn bn_cvt() {
+        fn roundtrip(bn: BigNum) {
+            let large = Asn1Integer::from_bn(&bn).unwrap();
+            assert_eq!(large.to_bn().unwrap(), bn);
+        }
+
+        roundtrip(BigNum::from_dec_str("1000000000000000000000000000000000").unwrap());
+        roundtrip(-BigNum::from_dec_str("1000000000000000000000000000000000").unwrap());
+        roundtrip(BigNum::from_u32(1234).unwrap());
+        roundtrip(-BigNum::from_u32(1234).unwrap());
+    }
+
+    #[test]
+    fn time_from_str() {
+        Asn1Time::from_str("99991231235959Z").unwrap();
+        #[cfg(ossl111)]
+        Asn1Time::from_str_x509("99991231235959Z").unwrap();
+    }
+
+    #[test]
+    fn time_from_unix() {
+        let t = Asn1Time::from_unix(0).unwrap();
+        assert_eq!("Jan  1 00:00:00 1970 GMT", t.to_string());
+    }
+
+    #[test]
+    #[cfg(any(ossl102, boringssl))]
+    fn time_eq() {
+        let a = Asn1Time::from_str("99991231235959Z").unwrap();
+        let b = Asn1Time::from_str("99991231235959Z").unwrap();
+        let c = Asn1Time::from_str("99991231235958Z").unwrap();
+        let a_ref = a.as_ref();
+        let b_ref = b.as_ref();
+        let c_ref = c.as_ref();
+        assert!(a == b);
+        assert!(a != c);
+        assert!(a == b_ref);
+        assert!(a != c_ref);
+        assert!(b_ref == a);
+        assert!(c_ref != a);
+        assert!(a_ref == b_ref);
+        assert!(a_ref != c_ref);
+    }
+
+    #[test]
+    #[cfg(any(ossl102, boringssl))]
+    fn time_ord() {
+        let a = Asn1Time::from_str("99991231235959Z").unwrap();
+        let b = Asn1Time::from_str("99991231235959Z").unwrap();
+        let c = Asn1Time::from_str("99991231235958Z").unwrap();
+        let a_ref = a.as_ref();
+        let b_ref = b.as_ref();
+        let c_ref = c.as_ref();
+        assert!(a >= b);
+        assert!(a > c);
+        assert!(b <= a);
+        assert!(c < a);
+
+        assert!(a_ref >= b);
+        assert!(a_ref > c);
+        assert!(b_ref <= a);
+        assert!(c_ref < a);
+
+        assert!(a >= b_ref);
+        assert!(a > c_ref);
+        assert!(b <= a_ref);
+        assert!(c < a_ref);
+
+        assert!(a_ref >= b_ref);
+        assert!(a_ref > c_ref);
+        assert!(b_ref <= a_ref);
+        assert!(c_ref < a_ref);
+    }
+
+    #[test]
+    fn integer_to_owned() {
+        let a = Asn1Integer::from_bn(&BigNum::from_dec_str("42").unwrap()).unwrap();
+        let b = a.to_owned().unwrap();
+        assert_eq!(
+            a.to_bn().unwrap().to_dec_str().unwrap().to_string(),
+            b.to_bn().unwrap().to_dec_str().unwrap().to_string(),
+        );
+        assert_ne!(a.as_ptr(), b.as_ptr());
+    }
+
+    #[test]
+    fn integer_cmp() {
+        let a = Asn1Integer::from_bn(&BigNum::from_dec_str("42").unwrap()).unwrap();
+        let b = Asn1Integer::from_bn(&BigNum::from_dec_str("42").unwrap()).unwrap();
+        let c = Asn1Integer::from_bn(&BigNum::from_dec_str("43").unwrap()).unwrap();
+        assert!(a == b);
+        assert!(a != c);
+        assert!(a < c);
+        assert!(c > b);
+    }
+
+    #[test]
+    fn object_from_str() {
+        let object = Asn1Object::from_str("2.16.840.1.101.3.4.2.1").unwrap();
+        assert_eq!(object.nid(), Nid::SHA256);
+    }
+
+    #[test]
+    fn object_from_str_with_invalid_input() {
+        Asn1Object::from_str("NOT AN OID")
+            .map(|object| object.to_string())
+            .expect_err("parsing invalid OID should fail");
+    }
+
+    #[test]
+    #[cfg(ossl111)]
+    fn object_to_slice() {
+        let object = Asn1Object::from_str("2.16.840.1.101.3.4.2.1").unwrap();
+        assert_eq!(
+            object.as_slice(),
+            &[0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01],
+        );
+    }
+
+    #[test]
+    fn asn1_octet_string() {
+        let octet_string = Asn1OctetString::new_from_bytes(b"hello world").unwrap();
+        assert_eq!(octet_string.as_slice(), b"hello world");
+        assert_eq!(octet_string.len(), 11);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/base64.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/base64.rs
--- 43.0.0-1/rust-vendor/openssl/src/base64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/base64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,128 @@
+//! Base64 encoding support.
+use crate::error::ErrorStack;
+use crate::{cvt_n, LenType};
+use libc::c_int;
+use openssl_macros::corresponds;
+
+/// Encodes a slice of bytes to a base64 string.
+///
+/// # Panics
+///
+/// Panics if the input length or computed output length overflow a signed C integer.
+#[corresponds(EVP_EncodeBlock)]
+pub fn encode_block(src: &[u8]) -> String {
+    assert!(src.len() <= c_int::MAX as usize);
+    let src_len = src.len() as LenType;
+
+    let len = encoded_len(src_len).unwrap();
+    let mut out = Vec::with_capacity(len as usize);
+
+    // SAFETY: `encoded_len` ensures space for 4 output characters
+    // for every 3 input bytes including padding and nul terminator.
+    // `EVP_EncodeBlock` will write only single byte ASCII characters.
+    // `EVP_EncodeBlock` will only write to not read from `out`.
+    unsafe {
+        let out_len = ffi::EVP_EncodeBlock(out.as_mut_ptr(), src.as_ptr(), src_len);
+        out.set_len(out_len as usize);
+        String::from_utf8_unchecked(out)
+    }
+}
+
+/// Decodes a base64-encoded string to bytes.
+///
+/// # Panics
+///
+/// Panics if the input length or computed output length overflow a signed C integer.
+#[corresponds(EVP_DecodeBlock)]
+pub fn decode_block(src: &str) -> Result<Vec<u8>, ErrorStack> {
+    let src = src.trim();
+
+    // https://github.com/openssl/openssl/issues/12143
+    if src.is_empty() {
+        return Ok(vec![]);
+    }
+
+    assert!(src.len() <= c_int::MAX as usize);
+    let src_len = src.len() as LenType;
+
+    let len = decoded_len(src_len).unwrap();
+    let mut out = Vec::with_capacity(len as usize);
+
+    // SAFETY: `decoded_len` ensures space for 3 output bytes
+    // for every 4 input characters including padding.
+    // `EVP_DecodeBlock` can write fewer bytes after stripping
+    // leading and trailing whitespace, but never more.
+    // `EVP_DecodeBlock` will only write to not read from `out`.
+    unsafe {
+        let out_len = cvt_n(ffi::EVP_DecodeBlock(
+            out.as_mut_ptr(),
+            src.as_ptr(),
+            src_len,
+        ))?;
+        out.set_len(out_len as usize);
+    }
+
+    if src.ends_with('=') {
+        out.pop();
+        if src.ends_with("==") {
+            out.pop();
+        }
+    }
+
+    Ok(out)
+}
+
+fn encoded_len(src_len: LenType) -> Option<LenType> {
+    let mut len = (src_len / 3).checked_mul(4)?;
+
+    if src_len % 3 != 0 {
+        len = len.checked_add(4)?;
+    }
+
+    len = len.checked_add(1)?;
+
+    Some(len)
+}
+
+fn decoded_len(src_len: LenType) -> Option<LenType> {
+    let mut len = (src_len / 4).checked_mul(3)?;
+
+    if src_len % 4 != 0 {
+        len = len.checked_add(3)?;
+    }
+
+    Some(len)
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test_encode_block() {
+        assert_eq!("".to_string(), encode_block(b""));
+        assert_eq!("Zg==".to_string(), encode_block(b"f"));
+        assert_eq!("Zm8=".to_string(), encode_block(b"fo"));
+        assert_eq!("Zm9v".to_string(), encode_block(b"foo"));
+        assert_eq!("Zm9vYg==".to_string(), encode_block(b"foob"));
+        assert_eq!("Zm9vYmE=".to_string(), encode_block(b"fooba"));
+        assert_eq!("Zm9vYmFy".to_string(), encode_block(b"foobar"));
+    }
+
+    #[test]
+    fn test_decode_block() {
+        assert_eq!(b"".to_vec(), decode_block("").unwrap());
+        assert_eq!(b"f".to_vec(), decode_block("Zg==").unwrap());
+        assert_eq!(b"fo".to_vec(), decode_block("Zm8=").unwrap());
+        assert_eq!(b"foo".to_vec(), decode_block("Zm9v").unwrap());
+        assert_eq!(b"foob".to_vec(), decode_block("Zm9vYg==").unwrap());
+        assert_eq!(b"fooba".to_vec(), decode_block("Zm9vYmE=").unwrap());
+        assert_eq!(b"foobar".to_vec(), decode_block("Zm9vYmFy").unwrap());
+    }
+
+    #[test]
+    fn test_strip_whitespace() {
+        assert_eq!(b"foobar".to_vec(), decode_block(" Zm9vYmFy\n").unwrap());
+        assert_eq!(b"foob".to_vec(), decode_block(" Zm9vYg==\n").unwrap());
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/bio.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/bio.rs
--- 43.0.0-1/rust-vendor/openssl/src/bio.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/bio.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,85 @@
+use cfg_if::cfg_if;
+use libc::c_int;
+use std::marker::PhantomData;
+use std::ptr;
+use std::slice;
+
+use crate::cvt_p;
+use crate::error::ErrorStack;
+
+pub struct MemBioSlice<'a>(*mut ffi::BIO, PhantomData<&'a [u8]>);
+
+impl<'a> Drop for MemBioSlice<'a> {
+    fn drop(&mut self) {
+        unsafe {
+            ffi::BIO_free_all(self.0);
+        }
+    }
+}
+
+impl<'a> MemBioSlice<'a> {
+    pub fn new(buf: &'a [u8]) -> Result<MemBioSlice<'a>, ErrorStack> {
+        ffi::init();
+
+        assert!(buf.len() <= c_int::MAX as usize);
+        let bio = unsafe {
+            cvt_p(BIO_new_mem_buf(
+                buf.as_ptr() as *const _,
+                buf.len() as crate::SLenType,
+            ))?
+        };
+
+        Ok(MemBioSlice(bio, PhantomData))
+    }
+
+    pub fn as_ptr(&self) -> *mut ffi::BIO {
+        self.0
+    }
+}
+
+pub struct MemBio(*mut ffi::BIO);
+
+impl Drop for MemBio {
+    fn drop(&mut self) {
+        unsafe {
+            ffi::BIO_free_all(self.0);
+        }
+    }
+}
+
+impl MemBio {
+    pub fn new() -> Result<MemBio, ErrorStack> {
+        ffi::init();
+
+        let bio = unsafe { cvt_p(ffi::BIO_new(ffi::BIO_s_mem()))? };
+        Ok(MemBio(bio))
+    }
+
+    pub fn as_ptr(&self) -> *mut ffi::BIO {
+        self.0
+    }
+
+    pub fn get_buf(&self) -> &[u8] {
+        unsafe {
+            let mut ptr = ptr::null_mut();
+            let len = ffi::BIO_get_mem_data(self.0, &mut ptr);
+            slice::from_raw_parts(ptr as *const _ as *const _, len as usize)
+        }
+    }
+
+    #[cfg(not(boringssl))]
+    pub unsafe fn from_ptr(bio: *mut ffi::BIO) -> MemBio {
+        MemBio(bio)
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(ossl102, boringssl))] {
+        use ffi::BIO_new_mem_buf;
+    } else {
+        #[allow(bad_style)]
+        unsafe fn BIO_new_mem_buf(buf: *const ::libc::c_void, len: ::libc::c_int) -> *mut ffi::BIO {
+            ffi::BIO_new_mem_buf(buf as *mut _, len)
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/bn.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/bn.rs
--- 43.0.0-1/rust-vendor/openssl/src/bn.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/bn.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1523 @@
+//! BigNum implementation
+//!
+//! Large numbers are important for a cryptographic library.  OpenSSL implementation
+//! of BigNum uses dynamically assigned memory to store an array of bit chunks.  This
+//! allows numbers of any size to be compared and mathematical functions performed.
+//!
+//! OpenSSL wiki describes the [`BIGNUM`] data structure.
+//!
+//! # Examples
+//!
+//! ```
+//! use openssl::bn::BigNum;
+//! use openssl::error::ErrorStack;
+//!
+//! fn main() -> Result<(), ErrorStack> {
+//!   let a = BigNum::new()?; // a = 0
+//!   let b = BigNum::from_dec_str("1234567890123456789012345")?;
+//!   let c = &a * &b;
+//!   assert_eq!(a, c);
+//!   Ok(())
+//! }
+//! ```
+//!
+//! [`BIGNUM`]: https://wiki.openssl.org/index.php/Manual:Bn_internal(3)
+use cfg_if::cfg_if;
+use foreign_types::{ForeignType, ForeignTypeRef};
+use libc::c_int;
+use std::cmp::Ordering;
+use std::ffi::CString;
+use std::ops::{Add, Deref, Div, Mul, Neg, Rem, Shl, Shr, Sub};
+use std::{fmt, ptr};
+
+use crate::asn1::Asn1Integer;
+use crate::error::ErrorStack;
+use crate::string::OpensslString;
+use crate::{cvt, cvt_n, cvt_p, LenType};
+use openssl_macros::corresponds;
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl350))] {
+        use ffi::{
+            BN_get_rfc2409_prime_1024, BN_get_rfc2409_prime_768, BN_get_rfc3526_prime_1536,
+            BN_get_rfc3526_prime_2048, BN_get_rfc3526_prime_3072, BN_get_rfc3526_prime_4096,
+            BN_get_rfc3526_prime_6144, BN_get_rfc3526_prime_8192, BN_is_negative,
+        };
+    } else if #[cfg(boringssl)] {
+        use ffi::BN_is_negative;
+    } else {
+        use ffi::{
+            get_rfc2409_prime_1024 as BN_get_rfc2409_prime_1024,
+            get_rfc2409_prime_768 as BN_get_rfc2409_prime_768,
+            get_rfc3526_prime_1536 as BN_get_rfc3526_prime_1536,
+            get_rfc3526_prime_2048 as BN_get_rfc3526_prime_2048,
+            get_rfc3526_prime_3072 as BN_get_rfc3526_prime_3072,
+            get_rfc3526_prime_4096 as BN_get_rfc3526_prime_4096,
+            get_rfc3526_prime_6144 as BN_get_rfc3526_prime_6144,
+            get_rfc3526_prime_8192 as BN_get_rfc3526_prime_8192,
+        };
+
+        #[allow(bad_style)]
+        unsafe fn BN_is_negative(bn: *const ffi::BIGNUM) -> c_int {
+            (*bn).neg
+        }
+    }
+}
+
+/// Options for the most significant bits of a randomly generated `BigNum`.
+pub struct MsbOption(c_int);
+
+impl MsbOption {
+    /// The most significant bit of the number may be 0.
+    pub const MAYBE_ZERO: MsbOption = MsbOption(-1);
+
+    /// The most significant bit of the number must be 1.
+    pub const ONE: MsbOption = MsbOption(0);
+
+    /// The most significant two bits of the number must be 1.
+    ///
+    /// The number of bits in the product of two such numbers will always be exactly twice the
+    /// number of bits in the original numbers.
+    pub const TWO_ONES: MsbOption = MsbOption(1);
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::BN_CTX;
+    fn drop = ffi::BN_CTX_free;
+
+    /// Temporary storage for BigNums on the secure heap
+    ///
+    /// BigNum values are stored dynamically and therefore can be expensive
+    /// to allocate.  BigNumContext and the OpenSSL [`BN_CTX`] structure are used
+    /// internally when passing BigNum values between subroutines.
+    ///
+    /// [`BN_CTX`]: https://www.openssl.org/docs/manmaster/crypto/BN_CTX_new.html
+    pub struct BigNumContext;
+    /// Reference to [`BigNumContext`]
+    ///
+    /// [`BigNumContext`]: struct.BigNumContext.html
+    pub struct BigNumContextRef;
+}
+
+impl BigNumContext {
+    /// Returns a new `BigNumContext`.
+    #[corresponds(BN_CTX_new)]
+    pub fn new() -> Result<BigNumContext, ErrorStack> {
+        unsafe {
+            ffi::init();
+            cvt_p(ffi::BN_CTX_new()).map(BigNumContext)
+        }
+    }
+
+    /// Returns a new secure `BigNumContext`.
+    #[corresponds(BN_CTX_secure_new)]
+    #[cfg(ossl110)]
+    pub fn new_secure() -> Result<BigNumContext, ErrorStack> {
+        unsafe {
+            ffi::init();
+            cvt_p(ffi::BN_CTX_secure_new()).map(BigNumContext)
+        }
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::BIGNUM;
+    fn drop = ffi::BN_free;
+
+    /// Dynamically sized large number implementation
+    ///
+    /// Perform large number mathematics.  Create a new BigNum
+    /// with [`new`].  Perform standard mathematics on large numbers using
+    /// methods from [`Dref<Target = BigNumRef>`]
+    ///
+    /// OpenSSL documentation at [`BN_new`].
+    ///
+    /// [`new`]: struct.BigNum.html#method.new
+    /// [`Dref<Target = BigNumRef>`]: struct.BigNum.html#deref-methods
+    /// [`BN_new`]: https://www.openssl.org/docs/manmaster/crypto/BN_new.html
+    ///
+    /// # Examples
+    /// ```
+    /// use openssl::bn::BigNum;
+    /// # use openssl::error::ErrorStack;
+    /// # fn bignums() -> Result< (), ErrorStack > {
+    /// let little_big = BigNum::from_u32(std::u32::MAX)?;
+    /// assert_eq!(*&little_big.num_bytes(), 4);
+    /// # Ok(())
+    /// # }
+    /// # fn main () { bignums(); }
+    /// ```
+    pub struct BigNum;
+    /// Reference to a [`BigNum`]
+    ///
+    /// [`BigNum`]: struct.BigNum.html
+    pub struct BigNumRef;
+}
+
+impl BigNumRef {
+    /// Erases the memory used by this `BigNum`, resetting its value to 0.
+    ///
+    /// This can be used to destroy sensitive data such as keys when they are no longer needed.
+    #[corresponds(BN_clear)]
+    pub fn clear(&mut self) {
+        unsafe { ffi::BN_clear(self.as_ptr()) }
+    }
+
+    /// Adds a `u32` to `self`.
+    #[corresponds(BN_add_word)]
+    pub fn add_word(&mut self, w: u32) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::BN_add_word(self.as_ptr(), w as ffi::BN_ULONG)).map(|_| ()) }
+    }
+
+    /// Subtracts a `u32` from `self`.
+    #[corresponds(BN_sub_word)]
+    pub fn sub_word(&mut self, w: u32) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::BN_sub_word(self.as_ptr(), w as ffi::BN_ULONG)).map(|_| ()) }
+    }
+
+    /// Multiplies a `u32` by `self`.
+    #[corresponds(BN_mul_word)]
+    pub fn mul_word(&mut self, w: u32) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::BN_mul_word(self.as_ptr(), w as ffi::BN_ULONG)).map(|_| ()) }
+    }
+
+    /// Divides `self` by a `u32`, returning the remainder.
+    #[corresponds(BN_div_word)]
+    #[allow(clippy::useless_conversion)]
+    pub fn div_word(&mut self, w: u32) -> Result<u64, ErrorStack> {
+        unsafe {
+            let r = ffi::BN_div_word(self.as_ptr(), w.into());
+            if r == ffi::BN_ULONG::MAX {
+                Err(ErrorStack::get())
+            } else {
+                Ok(r.into())
+            }
+        }
+    }
+
+    /// Returns the result of `self` modulo `w`.
+    #[corresponds(BN_mod_word)]
+    #[allow(clippy::useless_conversion)]
+    pub fn mod_word(&self, w: u32) -> Result<u64, ErrorStack> {
+        unsafe {
+            let r = ffi::BN_mod_word(self.as_ptr(), w.into());
+            if r == ffi::BN_ULONG::MAX {
+                Err(ErrorStack::get())
+            } else {
+                Ok(r.into())
+            }
+        }
+    }
+
+    /// Places a cryptographically-secure pseudo-random nonnegative
+    /// number less than `self` in `rnd`.
+    #[corresponds(BN_rand_range)]
+    pub fn rand_range(&self, rnd: &mut BigNumRef) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::BN_rand_range(rnd.as_ptr(), self.as_ptr())).map(|_| ()) }
+    }
+
+    /// The cryptographically weak counterpart to `rand_in_range`.
+    #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+    #[corresponds(BN_pseudo_rand_range)]
+    pub fn pseudo_rand_range(&self, rnd: &mut BigNumRef) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::BN_pseudo_rand_range(rnd.as_ptr(), self.as_ptr())).map(|_| ()) }
+    }
+
+    /// Sets bit `n`. Equivalent to `self |= (1 << n)`.
+    ///
+    /// When setting a bit outside of `self`, it is expanded.
+    #[corresponds(BN_set_bit)]
+    #[allow(clippy::useless_conversion)]
+    pub fn set_bit(&mut self, n: i32) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::BN_set_bit(self.as_ptr(), n.into())).map(|_| ()) }
+    }
+
+    /// Clears bit `n`, setting it to 0. Equivalent to `self &= ~(1 << n)`.
+    ///
+    /// When clearing a bit outside of `self`, an error is returned.
+    #[corresponds(BN_clear_bit)]
+    #[allow(clippy::useless_conversion)]
+    pub fn clear_bit(&mut self, n: i32) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::BN_clear_bit(self.as_ptr(), n.into())).map(|_| ()) }
+    }
+
+    /// Returns `true` if the `n`th bit of `self` is set to 1, `false` otherwise.
+    #[corresponds(BN_is_bit_set)]
+    #[allow(clippy::useless_conversion)]
+    pub fn is_bit_set(&self, n: i32) -> bool {
+        unsafe { ffi::BN_is_bit_set(self.as_ptr(), n.into()) == 1 }
+    }
+
+    /// Truncates `self` to the lowest `n` bits.
+    ///
+    /// An error occurs if `self` is already shorter than `n` bits.
+    #[corresponds(BN_mask_bits)]
+    #[allow(clippy::useless_conversion)]
+    pub fn mask_bits(&mut self, n: i32) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::BN_mask_bits(self.as_ptr(), n.into())).map(|_| ()) }
+    }
+
+    /// Places `a << 1` in `self`.  Equivalent to `self * 2`.
+    #[corresponds(BN_lshift1)]
+    pub fn lshift1(&mut self, a: &BigNumRef) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::BN_lshift1(self.as_ptr(), a.as_ptr())).map(|_| ()) }
+    }
+
+    /// Places `a >> 1` in `self`. Equivalent to `self / 2`.
+    #[corresponds(BN_rshift1)]
+    pub fn rshift1(&mut self, a: &BigNumRef) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::BN_rshift1(self.as_ptr(), a.as_ptr())).map(|_| ()) }
+    }
+
+    /// Places `a + b` in `self`.  [`core::ops::Add`] is also implemented for `BigNumRef`.
+    ///
+    /// [`core::ops::Add`]: struct.BigNumRef.html#method.add
+    #[corresponds(BN_add)]
+    pub fn checked_add(&mut self, a: &BigNumRef, b: &BigNumRef) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::BN_add(self.as_ptr(), a.as_ptr(), b.as_ptr())).map(|_| ()) }
+    }
+
+    /// Places `a - b` in `self`. [`core::ops::Sub`] is also implemented for `BigNumRef`.
+    ///
+    /// [`core::ops::Sub`]: struct.BigNumRef.html#method.sub
+    #[corresponds(BN_sub)]
+    pub fn checked_sub(&mut self, a: &BigNumRef, b: &BigNumRef) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::BN_sub(self.as_ptr(), a.as_ptr(), b.as_ptr())).map(|_| ()) }
+    }
+
+    /// Places `a << n` in `self`.  Equivalent to `a * 2 ^ n`.
+    #[corresponds(BN_lshift)]
+    #[allow(clippy::useless_conversion)]
+    pub fn lshift(&mut self, a: &BigNumRef, n: i32) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::BN_lshift(self.as_ptr(), a.as_ptr(), n.into())).map(|_| ()) }
+    }
+
+    /// Places `a >> n` in `self`. Equivalent to `a / 2 ^ n`.
+    #[corresponds(BN_rshift)]
+    #[allow(clippy::useless_conversion)]
+    pub fn rshift(&mut self, a: &BigNumRef, n: i32) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::BN_rshift(self.as_ptr(), a.as_ptr(), n.into())).map(|_| ()) }
+    }
+
+    /// Creates a new BigNum with the same value.
+    #[corresponds(BN_dup)]
+    pub fn to_owned(&self) -> Result<BigNum, ErrorStack> {
+        unsafe { cvt_p(ffi::BN_dup(self.as_ptr())).map(|b| BigNum::from_ptr(b)) }
+    }
+
+    /// Sets the sign of `self`.  Pass true to set `self` to a negative.  False sets
+    /// `self` positive.
+    #[corresponds(BN_set_negative)]
+    pub fn set_negative(&mut self, negative: bool) {
+        unsafe { ffi::BN_set_negative(self.as_ptr(), negative as c_int) }
+    }
+
+    /// Compare the absolute values of `self` and `oth`.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # use openssl::bn::BigNum;
+    /// # use std::cmp::Ordering;
+    /// let s = -BigNum::from_u32(8).unwrap();
+    /// let o = BigNum::from_u32(8).unwrap();
+    ///
+    /// assert_eq!(s.ucmp(&o), Ordering::Equal);
+    /// ```
+    #[corresponds(BN_ucmp)]
+    pub fn ucmp(&self, oth: &BigNumRef) -> Ordering {
+        unsafe { ffi::BN_ucmp(self.as_ptr(), oth.as_ptr()).cmp(&0) }
+    }
+
+    /// Returns `true` if `self` is negative.
+    #[corresponds(BN_is_negative)]
+    pub fn is_negative(&self) -> bool {
+        unsafe { BN_is_negative(self.as_ptr()) == 1 }
+    }
+
+    /// Returns `true` is `self` is even.
+    #[corresponds(BN_is_even)]
+    #[cfg(any(ossl110, boringssl, libressl350))]
+    pub fn is_even(&self) -> bool {
+        !self.is_odd()
+    }
+
+    /// Returns `true` is `self` is odd.
+    #[corresponds(BN_is_odd)]
+    #[cfg(any(ossl110, boringssl, libressl350))]
+    pub fn is_odd(&self) -> bool {
+        unsafe { ffi::BN_is_odd(self.as_ptr()) == 1 }
+    }
+
+    /// Returns the number of significant bits in `self`.
+    #[corresponds(BN_num_bits)]
+    #[allow(clippy::unnecessary_cast)]
+    pub fn num_bits(&self) -> i32 {
+        unsafe { ffi::BN_num_bits(self.as_ptr()) as i32 }
+    }
+
+    /// Returns the size of `self` in bytes. Implemented natively.
+    pub fn num_bytes(&self) -> i32 {
+        (self.num_bits() + 7) / 8
+    }
+
+    /// Generates a cryptographically strong pseudo-random `BigNum`, placing it in `self`.
+    ///
+    /// # Parameters
+    ///
+    /// * `bits`: Length of the number in bits.
+    /// * `msb`: The desired properties of the most significant bit. See [`constants`].
+    /// * `odd`: If `true`, the generated number will be odd.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use openssl::bn::{BigNum, MsbOption};
+    /// use openssl::error::ErrorStack;
+    ///
+    /// fn generate_random() -> Result< BigNum, ErrorStack > {
+    ///    let mut big = BigNum::new()?;
+    ///
+    ///    // Generates a 128-bit odd random number
+    ///    big.rand(128, MsbOption::MAYBE_ZERO, true);
+    ///    Ok((big))
+    /// }
+    /// ```
+    ///
+    /// [`constants`]: index.html#constants
+    #[corresponds(BN_rand)]
+    #[allow(clippy::useless_conversion)]
+    pub fn rand(&mut self, bits: i32, msb: MsbOption, odd: bool) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::BN_rand(
+                self.as_ptr(),
+                bits.into(),
+                msb.0,
+                odd as c_int,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// The cryptographically weak counterpart to `rand`.  Not suitable for key generation.
+    #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+    #[corresponds(BN_pseudo_rand)]
+    #[allow(clippy::useless_conversion)]
+    pub fn pseudo_rand(&mut self, bits: i32, msb: MsbOption, odd: bool) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::BN_pseudo_rand(
+                self.as_ptr(),
+                bits.into(),
+                msb.0,
+                odd as c_int,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Generates a prime number, placing it in `self`.
+    ///
+    /// # Parameters
+    ///
+    /// * `bits`: The length of the prime in bits (lower bound).
+    /// * `safe`: If true, returns a "safe" prime `p` so that `(p-1)/2` is also prime.
+    /// * `add`/`rem`: If `add` is set to `Some(add)`, `p % add == rem` will hold, where `p` is the
+    ///   generated prime and `rem` is `1` if not specified (`None`).
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use openssl::bn::BigNum;
+    /// use openssl::error::ErrorStack;
+    ///
+    /// fn generate_weak_prime() -> Result< BigNum, ErrorStack > {
+    ///    let mut big = BigNum::new()?;
+    ///
+    ///    // Generates a 128-bit simple prime number
+    ///    big.generate_prime(128, false, None, None);
+    ///    Ok((big))
+    /// }
+    /// ```
+    #[corresponds(BN_generate_prime_ex)]
+    pub fn generate_prime(
+        &mut self,
+        bits: i32,
+        safe: bool,
+        add: Option<&BigNumRef>,
+        rem: Option<&BigNumRef>,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::BN_generate_prime_ex(
+                self.as_ptr(),
+                bits as c_int,
+                safe as c_int,
+                add.map(|n| n.as_ptr()).unwrap_or(ptr::null_mut()),
+                rem.map(|n| n.as_ptr()).unwrap_or(ptr::null_mut()),
+                ptr::null_mut(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Places the result of `a * b` in `self`.
+    /// [`core::ops::Mul`] is also implemented for `BigNumRef`.
+    ///
+    /// [`core::ops::Mul`]: struct.BigNumRef.html#method.mul
+    #[corresponds(BN_mul)]
+    pub fn checked_mul(
+        &mut self,
+        a: &BigNumRef,
+        b: &BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::BN_mul(
+                self.as_ptr(),
+                a.as_ptr(),
+                b.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Places the result of `a / b` in `self`. The remainder is discarded.
+    /// [`core::ops::Div`] is also implemented for `BigNumRef`.
+    ///
+    /// [`core::ops::Div`]: struct.BigNumRef.html#method.div
+    #[corresponds(BN_div)]
+    pub fn checked_div(
+        &mut self,
+        a: &BigNumRef,
+        b: &BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::BN_div(
+                self.as_ptr(),
+                ptr::null_mut(),
+                a.as_ptr(),
+                b.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Places the result of `a % b` in `self`.
+    #[corresponds(BN_div)]
+    pub fn checked_rem(
+        &mut self,
+        a: &BigNumRef,
+        b: &BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::BN_div(
+                ptr::null_mut(),
+                self.as_ptr(),
+                a.as_ptr(),
+                b.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Places the result of `a / b` in `self` and `a % b` in `rem`.
+    #[corresponds(BN_div)]
+    pub fn div_rem(
+        &mut self,
+        rem: &mut BigNumRef,
+        a: &BigNumRef,
+        b: &BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::BN_div(
+                self.as_ptr(),
+                rem.as_ptr(),
+                a.as_ptr(),
+                b.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Places the result of `a²` in `self`.
+    #[corresponds(BN_sqr)]
+    pub fn sqr(&mut self, a: &BigNumRef, ctx: &mut BigNumContextRef) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::BN_sqr(self.as_ptr(), a.as_ptr(), ctx.as_ptr())).map(|_| ()) }
+    }
+
+    /// Places the result of `a mod m` in `self`.  As opposed to `div_rem`
+    /// the result is non-negative.
+    #[corresponds(BN_nnmod)]
+    pub fn nnmod(
+        &mut self,
+        a: &BigNumRef,
+        m: &BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::BN_nnmod(
+                self.as_ptr(),
+                a.as_ptr(),
+                m.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Places the result of `(a + b) mod m` in `self`.
+    #[corresponds(BN_mod_add)]
+    pub fn mod_add(
+        &mut self,
+        a: &BigNumRef,
+        b: &BigNumRef,
+        m: &BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::BN_mod_add(
+                self.as_ptr(),
+                a.as_ptr(),
+                b.as_ptr(),
+                m.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Places the result of `(a - b) mod m` in `self`.
+    #[corresponds(BN_mod_sub)]
+    pub fn mod_sub(
+        &mut self,
+        a: &BigNumRef,
+        b: &BigNumRef,
+        m: &BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::BN_mod_sub(
+                self.as_ptr(),
+                a.as_ptr(),
+                b.as_ptr(),
+                m.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Places the result of `(a * b) mod m` in `self`.
+    #[corresponds(BN_mod_mul)]
+    pub fn mod_mul(
+        &mut self,
+        a: &BigNumRef,
+        b: &BigNumRef,
+        m: &BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::BN_mod_mul(
+                self.as_ptr(),
+                a.as_ptr(),
+                b.as_ptr(),
+                m.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Places the result of `a² mod m` in `self`.
+    #[corresponds(BN_mod_sqr)]
+    pub fn mod_sqr(
+        &mut self,
+        a: &BigNumRef,
+        m: &BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::BN_mod_sqr(
+                self.as_ptr(),
+                a.as_ptr(),
+                m.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Places into `self` the modular square root of `a` such that `self^2 = a (mod p)`
+    #[corresponds(BN_mod_sqrt)]
+    pub fn mod_sqrt(
+        &mut self,
+        a: &BigNumRef,
+        p: &BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt_p(ffi::BN_mod_sqrt(
+                self.as_ptr(),
+                a.as_ptr(),
+                p.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Places the result of `a^p` in `self`.
+    #[corresponds(BN_exp)]
+    pub fn exp(
+        &mut self,
+        a: &BigNumRef,
+        p: &BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::BN_exp(
+                self.as_ptr(),
+                a.as_ptr(),
+                p.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Places the result of `a^p mod m` in `self`.
+    #[corresponds(BN_mod_exp)]
+    pub fn mod_exp(
+        &mut self,
+        a: &BigNumRef,
+        p: &BigNumRef,
+        m: &BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::BN_mod_exp(
+                self.as_ptr(),
+                a.as_ptr(),
+                p.as_ptr(),
+                m.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Places the inverse of `a` modulo `n` in `self`.
+    #[corresponds(BN_mod_inverse)]
+    pub fn mod_inverse(
+        &mut self,
+        a: &BigNumRef,
+        n: &BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt_p(ffi::BN_mod_inverse(
+                self.as_ptr(),
+                a.as_ptr(),
+                n.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Places the greatest common denominator of `a` and `b` in `self`.
+    #[corresponds(BN_gcd)]
+    pub fn gcd(
+        &mut self,
+        a: &BigNumRef,
+        b: &BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::BN_gcd(
+                self.as_ptr(),
+                a.as_ptr(),
+                b.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Checks whether `self` is prime.
+    ///
+    /// Performs a Miller-Rabin probabilistic primality test with `checks` iterations.
+    ///
+    /// # Return Value
+    ///
+    /// Returns `true` if `self` is prime with an error probability of less than `0.25 ^ checks`.
+    #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+    #[corresponds(BN_is_prime_ex)]
+    #[allow(clippy::useless_conversion)]
+    pub fn is_prime(&self, checks: i32, ctx: &mut BigNumContextRef) -> Result<bool, ErrorStack> {
+        unsafe {
+            cvt_n(ffi::BN_is_prime_ex(
+                self.as_ptr(),
+                checks.into(),
+                ctx.as_ptr(),
+                ptr::null_mut(),
+            ))
+            .map(|r| r != 0)
+        }
+    }
+
+    /// Checks whether `self` is prime with optional trial division.
+    ///
+    /// If `do_trial_division` is `true`, first performs trial division by a number of small primes.
+    /// Then, like `is_prime`, performs a Miller-Rabin probabilistic primality test with `checks`
+    /// iterations.
+    ///
+    /// # Return Value
+    ///
+    /// Returns `true` if `self` is prime with an error probability of less than `0.25 ^ checks`.
+    #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+    #[corresponds(BN_is_prime_fasttest_ex)]
+    #[allow(clippy::useless_conversion)]
+    pub fn is_prime_fasttest(
+        &self,
+        checks: i32,
+        ctx: &mut BigNumContextRef,
+        do_trial_division: bool,
+    ) -> Result<bool, ErrorStack> {
+        unsafe {
+            cvt_n(ffi::BN_is_prime_fasttest_ex(
+                self.as_ptr(),
+                checks.into(),
+                ctx.as_ptr(),
+                do_trial_division as c_int,
+                ptr::null_mut(),
+            ))
+            .map(|r| r != 0)
+        }
+    }
+
+    /// Returns a big-endian byte vector representation of the absolute value of `self`.
+    ///
+    /// `self` can be recreated by using `from_slice`.
+    ///
+    /// ```
+    /// # use openssl::bn::BigNum;
+    /// let s = -BigNum::from_u32(4543).unwrap();
+    /// let r = BigNum::from_u32(4543).unwrap();
+    ///
+    /// let s_vec = s.to_vec();
+    /// assert_eq!(BigNum::from_slice(&s_vec).unwrap(), r);
+    /// ```
+    #[corresponds(BN_bn2bin)]
+    pub fn to_vec(&self) -> Vec<u8> {
+        let size = self.num_bytes() as usize;
+        let mut v = Vec::with_capacity(size);
+        unsafe {
+            ffi::BN_bn2bin(self.as_ptr(), v.as_mut_ptr());
+            v.set_len(size);
+        }
+        v
+    }
+
+    /// Returns a big-endian byte vector representation of the absolute value of `self` padded
+    /// to `pad_to` bytes.
+    ///
+    /// If `pad_to` is less than `self.num_bytes()` then an error is returned.
+    ///
+    /// `self` can be recreated by using `from_slice`.
+    ///
+    /// ```
+    /// # use openssl::bn::BigNum;
+    /// let bn = BigNum::from_u32(0x4543).unwrap();
+    ///
+    /// let bn_vec = bn.to_vec_padded(4).unwrap();
+    /// assert_eq!(&bn_vec, &[0, 0, 0x45, 0x43]);
+    ///
+    /// let r = bn.to_vec_padded(1);
+    /// assert!(r.is_err());
+    ///
+    /// let bn = -BigNum::from_u32(0x4543).unwrap();
+    /// let bn_vec = bn.to_vec_padded(4).unwrap();
+    /// assert_eq!(&bn_vec, &[0, 0, 0x45, 0x43]);
+    /// ```
+    #[corresponds(BN_bn2binpad)]
+    #[cfg(any(ossl110, libressl340, boringssl))]
+    pub fn to_vec_padded(&self, pad_to: i32) -> Result<Vec<u8>, ErrorStack> {
+        let mut v = Vec::with_capacity(pad_to as usize);
+        unsafe {
+            cvt(ffi::BN_bn2binpad(self.as_ptr(), v.as_mut_ptr(), pad_to))?;
+            v.set_len(pad_to as usize);
+        }
+        Ok(v)
+    }
+
+    /// Returns a decimal string representation of `self`.
+    ///
+    /// ```
+    /// # use openssl::bn::BigNum;
+    /// let s = -BigNum::from_u32(12345).unwrap();
+    ///
+    /// assert_eq!(&**s.to_dec_str().unwrap(), "-12345");
+    /// ```
+    #[corresponds(BN_bn2dec)]
+    pub fn to_dec_str(&self) -> Result<OpensslString, ErrorStack> {
+        unsafe {
+            let buf = cvt_p(ffi::BN_bn2dec(self.as_ptr()))?;
+            Ok(OpensslString::from_ptr(buf))
+        }
+    }
+
+    /// Returns a hexadecimal string representation of `self`.
+    ///
+    /// ```
+    /// # use openssl::bn::BigNum;
+    /// let s = -BigNum::from_u32(0x99ff).unwrap();
+    ///
+    /// assert_eq!(s.to_hex_str().unwrap().to_uppercase(), "-99FF");
+    /// ```
+    #[corresponds(BN_bn2hex)]
+    pub fn to_hex_str(&self) -> Result<OpensslString, ErrorStack> {
+        unsafe {
+            let buf = cvt_p(ffi::BN_bn2hex(self.as_ptr()))?;
+            Ok(OpensslString::from_ptr(buf))
+        }
+    }
+
+    /// Returns an `Asn1Integer` containing the value of `self`.
+    #[corresponds(BN_to_ASN1_INTEGER)]
+    pub fn to_asn1_integer(&self) -> Result<Asn1Integer, ErrorStack> {
+        unsafe {
+            cvt_p(ffi::BN_to_ASN1_INTEGER(self.as_ptr(), ptr::null_mut()))
+                .map(|p| Asn1Integer::from_ptr(p))
+        }
+    }
+
+    /// Force constant time computation on this value.
+    #[corresponds(BN_set_flags)]
+    #[cfg(ossl110)]
+    pub fn set_const_time(&mut self) {
+        unsafe { ffi::BN_set_flags(self.as_ptr(), ffi::BN_FLG_CONSTTIME) }
+    }
+
+    /// Returns true if `self` is in const time mode.
+    #[corresponds(BN_get_flags)]
+    #[cfg(ossl110)]
+    pub fn is_const_time(&self) -> bool {
+        unsafe {
+            let ret = ffi::BN_get_flags(self.as_ptr(), ffi::BN_FLG_CONSTTIME);
+            ret == ffi::BN_FLG_CONSTTIME
+        }
+    }
+
+    /// Returns true if `self` was created with [`BigNum::new_secure`].
+    #[corresponds(BN_get_flags)]
+    #[cfg(ossl110)]
+    pub fn is_secure(&self) -> bool {
+        unsafe {
+            let ret = ffi::BN_get_flags(self.as_ptr(), ffi::BN_FLG_SECURE);
+            ret == ffi::BN_FLG_SECURE
+        }
+    }
+}
+
+impl BigNum {
+    /// Creates a new `BigNum` with the value 0.
+    #[corresponds(BN_new)]
+    pub fn new() -> Result<BigNum, ErrorStack> {
+        unsafe {
+            ffi::init();
+            let v = cvt_p(ffi::BN_new())?;
+            Ok(BigNum::from_ptr(v))
+        }
+    }
+
+    /// Returns a new secure `BigNum`.
+    #[corresponds(BN_secure_new)]
+    #[cfg(ossl110)]
+    pub fn new_secure() -> Result<BigNum, ErrorStack> {
+        unsafe {
+            ffi::init();
+            let v = cvt_p(ffi::BN_secure_new())?;
+            Ok(BigNum::from_ptr(v))
+        }
+    }
+
+    /// Creates a new `BigNum` with the given value.
+    #[corresponds(BN_set_word)]
+    pub fn from_u32(n: u32) -> Result<BigNum, ErrorStack> {
+        BigNum::new().and_then(|v| unsafe {
+            cvt(ffi::BN_set_word(v.as_ptr(), n as ffi::BN_ULONG)).map(|_| v)
+        })
+    }
+
+    /// Creates a `BigNum` from a decimal string.
+    #[corresponds(BN_dec2bn)]
+    pub fn from_dec_str(s: &str) -> Result<BigNum, ErrorStack> {
+        unsafe {
+            ffi::init();
+            let c_str = CString::new(s.as_bytes()).unwrap();
+            let mut bn = ptr::null_mut();
+            cvt(ffi::BN_dec2bn(&mut bn, c_str.as_ptr() as *const _))?;
+            Ok(BigNum::from_ptr(bn))
+        }
+    }
+
+    /// Creates a `BigNum` from a hexadecimal string.
+    #[corresponds(BN_hex2bn)]
+    pub fn from_hex_str(s: &str) -> Result<BigNum, ErrorStack> {
+        unsafe {
+            ffi::init();
+            let c_str = CString::new(s.as_bytes()).unwrap();
+            let mut bn = ptr::null_mut();
+            cvt(ffi::BN_hex2bn(&mut bn, c_str.as_ptr() as *const _))?;
+            Ok(BigNum::from_ptr(bn))
+        }
+    }
+
+    /// Returns a constant used in IKE as defined in [`RFC 2409`].  This prime number is in
+    /// the order of magnitude of `2 ^ 768`.  This number is used during calculated key
+    /// exchanges such as Diffie-Hellman.  This number is labeled Oakley group id 1.
+    ///
+    /// [`RFC 2409`]: https://tools.ietf.org/html/rfc2409#page-21
+    #[corresponds(BN_get_rfc2409_prime_768)]
+    #[cfg(not(boringssl))]
+    pub fn get_rfc2409_prime_768() -> Result<BigNum, ErrorStack> {
+        unsafe {
+            ffi::init();
+            cvt_p(BN_get_rfc2409_prime_768(ptr::null_mut())).map(BigNum)
+        }
+    }
+
+    /// Returns a constant used in IKE as defined in [`RFC 2409`].  This prime number is in
+    /// the order of magnitude of `2 ^ 1024`.  This number is used during calculated key
+    /// exchanges such as Diffie-Hellman.  This number is labeled Oakly group 2.
+    ///
+    /// [`RFC 2409`]: https://tools.ietf.org/html/rfc2409#page-21
+    #[corresponds(BN_get_rfc2409_prime_1024)]
+    #[cfg(not(boringssl))]
+    pub fn get_rfc2409_prime_1024() -> Result<BigNum, ErrorStack> {
+        unsafe {
+            ffi::init();
+            cvt_p(BN_get_rfc2409_prime_1024(ptr::null_mut())).map(BigNum)
+        }
+    }
+
+    /// Returns a constant used in IKE as defined in [`RFC 3526`].  The prime is in the order
+    /// of magnitude of `2 ^ 1536`.  This number is used during calculated key
+    /// exchanges such as Diffie-Hellman.  This number is labeled MODP group 5.
+    ///
+    /// [`RFC 3526`]: https://tools.ietf.org/html/rfc3526#page-3
+    #[corresponds(BN_get_rfc3526_prime_1536)]
+    #[cfg(not(boringssl))]
+    pub fn get_rfc3526_prime_1536() -> Result<BigNum, ErrorStack> {
+        unsafe {
+            ffi::init();
+            cvt_p(BN_get_rfc3526_prime_1536(ptr::null_mut())).map(BigNum)
+        }
+    }
+
+    /// Returns a constant used in IKE as defined in [`RFC 3526`].  The prime is in the order
+    /// of magnitude of `2 ^ 2048`.  This number is used during calculated key
+    /// exchanges such as Diffie-Hellman.  This number is labeled MODP group 14.
+    ///
+    /// [`RFC 3526`]: https://tools.ietf.org/html/rfc3526#page-3
+    #[corresponds(BN_get_rfc3526_prime_2048)]
+    #[cfg(not(boringssl))]
+    pub fn get_rfc3526_prime_2048() -> Result<BigNum, ErrorStack> {
+        unsafe {
+            ffi::init();
+            cvt_p(BN_get_rfc3526_prime_2048(ptr::null_mut())).map(BigNum)
+        }
+    }
+
+    /// Returns a constant used in IKE as defined in [`RFC 3526`].  The prime is in the order
+    /// of magnitude of `2 ^ 3072`.  This number is used during calculated key
+    /// exchanges such as Diffie-Hellman.  This number is labeled MODP group 15.
+    ///
+    /// [`RFC 3526`]: https://tools.ietf.org/html/rfc3526#page-4
+    #[corresponds(BN_get_rfc3526_prime_3072)]
+    #[cfg(not(boringssl))]
+    pub fn get_rfc3526_prime_3072() -> Result<BigNum, ErrorStack> {
+        unsafe {
+            ffi::init();
+            cvt_p(BN_get_rfc3526_prime_3072(ptr::null_mut())).map(BigNum)
+        }
+    }
+
+    /// Returns a constant used in IKE as defined in [`RFC 3526`].  The prime is in the order
+    /// of magnitude of `2 ^ 4096`.  This number is used during calculated key
+    /// exchanges such as Diffie-Hellman.  This number is labeled MODP group 16.
+    ///
+    /// [`RFC 3526`]: https://tools.ietf.org/html/rfc3526#page-4
+    #[corresponds(BN_get_rfc3526_prime_4096)]
+    #[cfg(not(boringssl))]
+    pub fn get_rfc3526_prime_4096() -> Result<BigNum, ErrorStack> {
+        unsafe {
+            ffi::init();
+            cvt_p(BN_get_rfc3526_prime_4096(ptr::null_mut())).map(BigNum)
+        }
+    }
+
+    /// Returns a constant used in IKE as defined in [`RFC 3526`].  The prime is in the order
+    /// of magnitude of `2 ^ 6144`.  This number is used during calculated key
+    /// exchanges such as Diffie-Hellman.  This number is labeled MODP group 17.
+    ///
+    /// [`RFC 3526`]: https://tools.ietf.org/html/rfc3526#page-6
+    #[corresponds(BN_get_rfc3526_prime_6114)]
+    #[cfg(not(boringssl))]
+    pub fn get_rfc3526_prime_6144() -> Result<BigNum, ErrorStack> {
+        unsafe {
+            ffi::init();
+            cvt_p(BN_get_rfc3526_prime_6144(ptr::null_mut())).map(BigNum)
+        }
+    }
+
+    /// Returns a constant used in IKE as defined in [`RFC 3526`].  The prime is in the order
+    /// of magnitude of `2 ^ 8192`.  This number is used during calculated key
+    /// exchanges such as Diffie-Hellman.  This number is labeled MODP group 18.
+    ///
+    /// [`RFC 3526`]: https://tools.ietf.org/html/rfc3526#page-6
+    #[corresponds(BN_get_rfc3526_prime_8192)]
+    #[cfg(not(boringssl))]
+    pub fn get_rfc3526_prime_8192() -> Result<BigNum, ErrorStack> {
+        unsafe {
+            ffi::init();
+            cvt_p(BN_get_rfc3526_prime_8192(ptr::null_mut())).map(BigNum)
+        }
+    }
+
+    /// Creates a new `BigNum` from an unsigned, big-endian encoded number of arbitrary length.
+    ///
+    /// OpenSSL documentation at [`BN_bin2bn`]
+    ///
+    /// [`BN_bin2bn`]: https://www.openssl.org/docs/manmaster/crypto/BN_bin2bn.html
+    ///
+    /// ```
+    /// # use openssl::bn::BigNum;
+    /// let bignum = BigNum::from_slice(&[0x12, 0x00, 0x34]).unwrap();
+    ///
+    /// assert_eq!(bignum, BigNum::from_u32(0x120034).unwrap());
+    /// ```
+    #[corresponds(BN_bin2bn)]
+    pub fn from_slice(n: &[u8]) -> Result<BigNum, ErrorStack> {
+        unsafe {
+            ffi::init();
+            assert!(n.len() <= LenType::MAX as usize);
+
+            cvt_p(ffi::BN_bin2bn(
+                n.as_ptr(),
+                n.len() as LenType,
+                ptr::null_mut(),
+            ))
+            .map(|p| BigNum::from_ptr(p))
+        }
+    }
+
+    /// Copies data from a slice overwriting what was in the BigNum.
+    ///
+    /// This function can be used to copy data from a slice to a
+    /// [secure BigNum][`BigNum::new_secure`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # use openssl::bn::BigNum;
+    /// let mut bignum = BigNum::new().unwrap();
+    /// bignum.copy_from_slice(&[0x12, 0x00, 0x34]).unwrap();
+    ///
+    /// assert_eq!(bignum, BigNum::from_u32(0x120034).unwrap());
+    /// ```
+    #[corresponds(BN_bin2bn)]
+    pub fn copy_from_slice(&mut self, n: &[u8]) -> Result<(), ErrorStack> {
+        unsafe {
+            assert!(n.len() <= LenType::MAX as usize);
+
+            cvt_p(ffi::BN_bin2bn(n.as_ptr(), n.len() as LenType, self.0))?;
+            Ok(())
+        }
+    }
+}
+
+impl fmt::Debug for BigNumRef {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        match self.to_dec_str() {
+            Ok(s) => f.write_str(&s),
+            Err(e) => Err(e.into()),
+        }
+    }
+}
+
+impl fmt::Debug for BigNum {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        match self.to_dec_str() {
+            Ok(s) => f.write_str(&s),
+            Err(e) => Err(e.into()),
+        }
+    }
+}
+
+impl fmt::Display for BigNumRef {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        match self.to_dec_str() {
+            Ok(s) => f.write_str(&s),
+            Err(e) => Err(e.into()),
+        }
+    }
+}
+
+impl fmt::Display for BigNum {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        match self.to_dec_str() {
+            Ok(s) => f.write_str(&s),
+            Err(e) => Err(e.into()),
+        }
+    }
+}
+
+impl PartialEq<BigNumRef> for BigNumRef {
+    fn eq(&self, oth: &BigNumRef) -> bool {
+        self.cmp(oth) == Ordering::Equal
+    }
+}
+
+impl PartialEq<BigNum> for BigNumRef {
+    fn eq(&self, oth: &BigNum) -> bool {
+        self.eq(oth.deref())
+    }
+}
+
+impl Eq for BigNumRef {}
+
+impl PartialEq for BigNum {
+    fn eq(&self, oth: &BigNum) -> bool {
+        self.deref().eq(oth)
+    }
+}
+
+impl PartialEq<BigNumRef> for BigNum {
+    fn eq(&self, oth: &BigNumRef) -> bool {
+        self.deref().eq(oth)
+    }
+}
+
+impl Eq for BigNum {}
+
+impl PartialOrd<BigNumRef> for BigNumRef {
+    fn partial_cmp(&self, oth: &BigNumRef) -> Option<Ordering> {
+        Some(self.cmp(oth))
+    }
+}
+
+impl PartialOrd<BigNum> for BigNumRef {
+    fn partial_cmp(&self, oth: &BigNum) -> Option<Ordering> {
+        Some(self.cmp(oth.deref()))
+    }
+}
+
+impl Ord for BigNumRef {
+    fn cmp(&self, oth: &BigNumRef) -> Ordering {
+        unsafe { ffi::BN_cmp(self.as_ptr(), oth.as_ptr()).cmp(&0) }
+    }
+}
+
+impl PartialOrd for BigNum {
+    fn partial_cmp(&self, oth: &BigNum) -> Option<Ordering> {
+        Some(self.cmp(oth))
+    }
+}
+
+impl PartialOrd<BigNumRef> for BigNum {
+    fn partial_cmp(&self, oth: &BigNumRef) -> Option<Ordering> {
+        self.deref().partial_cmp(oth)
+    }
+}
+
+impl Ord for BigNum {
+    fn cmp(&self, oth: &BigNum) -> Ordering {
+        self.deref().cmp(oth.deref())
+    }
+}
+
+macro_rules! delegate {
+    ($t:ident, $m:ident) => {
+        impl<'a, 'b> $t<&'b BigNum> for &'a BigNumRef {
+            type Output = BigNum;
+
+            fn $m(self, oth: &BigNum) -> BigNum {
+                $t::$m(self, oth.deref())
+            }
+        }
+
+        impl<'a, 'b> $t<&'b BigNumRef> for &'a BigNum {
+            type Output = BigNum;
+
+            fn $m(self, oth: &BigNumRef) -> BigNum {
+                $t::$m(self.deref(), oth)
+            }
+        }
+
+        impl<'a, 'b> $t<&'b BigNum> for &'a BigNum {
+            type Output = BigNum;
+
+            fn $m(self, oth: &BigNum) -> BigNum {
+                $t::$m(self.deref(), oth.deref())
+            }
+        }
+    };
+}
+
+impl<'a, 'b> Add<&'b BigNumRef> for &'a BigNumRef {
+    type Output = BigNum;
+
+    fn add(self, oth: &BigNumRef) -> BigNum {
+        let mut r = BigNum::new().unwrap();
+        r.checked_add(self, oth).unwrap();
+        r
+    }
+}
+
+delegate!(Add, add);
+
+impl<'a, 'b> Sub<&'b BigNumRef> for &'a BigNumRef {
+    type Output = BigNum;
+
+    fn sub(self, oth: &BigNumRef) -> BigNum {
+        let mut r = BigNum::new().unwrap();
+        r.checked_sub(self, oth).unwrap();
+        r
+    }
+}
+
+delegate!(Sub, sub);
+
+impl<'a, 'b> Mul<&'b BigNumRef> for &'a BigNumRef {
+    type Output = BigNum;
+
+    fn mul(self, oth: &BigNumRef) -> BigNum {
+        let mut ctx = BigNumContext::new().unwrap();
+        let mut r = BigNum::new().unwrap();
+        r.checked_mul(self, oth, &mut ctx).unwrap();
+        r
+    }
+}
+
+delegate!(Mul, mul);
+
+impl<'a, 'b> Div<&'b BigNumRef> for &'a BigNumRef {
+    type Output = BigNum;
+
+    fn div(self, oth: &'b BigNumRef) -> BigNum {
+        let mut ctx = BigNumContext::new().unwrap();
+        let mut r = BigNum::new().unwrap();
+        r.checked_div(self, oth, &mut ctx).unwrap();
+        r
+    }
+}
+
+delegate!(Div, div);
+
+impl<'a, 'b> Rem<&'b BigNumRef> for &'a BigNumRef {
+    type Output = BigNum;
+
+    fn rem(self, oth: &'b BigNumRef) -> BigNum {
+        let mut ctx = BigNumContext::new().unwrap();
+        let mut r = BigNum::new().unwrap();
+        r.checked_rem(self, oth, &mut ctx).unwrap();
+        r
+    }
+}
+
+delegate!(Rem, rem);
+
+impl<'a> Shl<i32> for &'a BigNumRef {
+    type Output = BigNum;
+
+    fn shl(self, n: i32) -> BigNum {
+        let mut r = BigNum::new().unwrap();
+        r.lshift(self, n).unwrap();
+        r
+    }
+}
+
+impl<'a> Shl<i32> for &'a BigNum {
+    type Output = BigNum;
+
+    fn shl(self, n: i32) -> BigNum {
+        self.deref().shl(n)
+    }
+}
+
+impl<'a> Shr<i32> for &'a BigNumRef {
+    type Output = BigNum;
+
+    fn shr(self, n: i32) -> BigNum {
+        let mut r = BigNum::new().unwrap();
+        r.rshift(self, n).unwrap();
+        r
+    }
+}
+
+impl<'a> Shr<i32> for &'a BigNum {
+    type Output = BigNum;
+
+    fn shr(self, n: i32) -> BigNum {
+        self.deref().shr(n)
+    }
+}
+
+impl<'a> Neg for &'a BigNumRef {
+    type Output = BigNum;
+
+    fn neg(self) -> BigNum {
+        self.to_owned().unwrap().neg()
+    }
+}
+
+impl<'a> Neg for &'a BigNum {
+    type Output = BigNum;
+
+    fn neg(self) -> BigNum {
+        self.deref().neg()
+    }
+}
+
+impl Neg for BigNum {
+    type Output = BigNum;
+
+    fn neg(mut self) -> BigNum {
+        let negative = self.is_negative();
+        self.set_negative(!negative);
+        self
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::bn::{BigNum, BigNumContext};
+
+    #[test]
+    fn test_to_from_slice() {
+        let v0 = BigNum::from_u32(10_203_004).unwrap();
+        let vec = v0.to_vec();
+        let v1 = BigNum::from_slice(&vec).unwrap();
+
+        assert_eq!(v0, v1);
+    }
+
+    #[test]
+    fn test_negation() {
+        let a = BigNum::from_u32(909_829_283).unwrap();
+
+        assert!(!a.is_negative());
+        assert!((-a).is_negative());
+    }
+
+    #[test]
+    fn test_shift() {
+        let a = BigNum::from_u32(909_829_283).unwrap();
+
+        assert_eq!(a, &(&a << 1) >> 1);
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+    #[test]
+    fn test_rand_range() {
+        let range = BigNum::from_u32(909_829_283).unwrap();
+        let mut result = BigNum::from_dec_str(&range.to_dec_str().unwrap()).unwrap();
+        range.rand_range(&mut result).unwrap();
+        assert!(result >= BigNum::from_u32(0).unwrap() && result < range);
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+    #[test]
+    fn test_pseudo_rand_range() {
+        let range = BigNum::from_u32(909_829_283).unwrap();
+        let mut result = BigNum::from_dec_str(&range.to_dec_str().unwrap()).unwrap();
+        range.pseudo_rand_range(&mut result).unwrap();
+        assert!(result >= BigNum::from_u32(0).unwrap() && result < range);
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+    #[test]
+    fn test_prime_numbers() {
+        let a = BigNum::from_u32(19_029_017).unwrap();
+        let mut p = BigNum::new().unwrap();
+        p.generate_prime(128, true, None, Some(&a)).unwrap();
+
+        let mut ctx = BigNumContext::new().unwrap();
+        assert!(p.is_prime(100, &mut ctx).unwrap());
+        assert!(p.is_prime_fasttest(100, &mut ctx, true).unwrap());
+    }
+
+    #[cfg(ossl110)]
+    #[test]
+    fn test_secure_bn_ctx() {
+        let mut cxt = BigNumContext::new_secure().unwrap();
+        let a = BigNum::from_u32(8).unwrap();
+        let b = BigNum::from_u32(3).unwrap();
+
+        let mut remainder = BigNum::new().unwrap();
+        remainder.nnmod(&a, &b, &mut cxt).unwrap();
+
+        assert!(remainder.eq(&BigNum::from_u32(2).unwrap()));
+    }
+
+    #[cfg(ossl110)]
+    #[test]
+    fn test_secure_bn() {
+        let a = BigNum::new().unwrap();
+        assert!(!a.is_secure());
+
+        let b = BigNum::new_secure().unwrap();
+        assert!(b.is_secure())
+    }
+
+    #[cfg(ossl110)]
+    #[test]
+    fn test_const_time_bn() {
+        let a = BigNum::new().unwrap();
+        assert!(!a.is_const_time());
+
+        let mut b = BigNum::new().unwrap();
+        b.set_const_time();
+        assert!(b.is_const_time())
+    }
+
+    #[test]
+    fn test_mod_sqrt() {
+        let mut ctx = BigNumContext::new().unwrap();
+
+        let s = BigNum::from_hex_str("2").unwrap();
+        let p = BigNum::from_hex_str("7DEB1").unwrap();
+        let mut sqrt = BigNum::new().unwrap();
+        let mut out = BigNum::new().unwrap();
+
+        // Square the root because OpenSSL randomly returns one of 2E42C or 4FA85
+        sqrt.mod_sqrt(&s, &p, &mut ctx).unwrap();
+        out.mod_sqr(&sqrt, &p, &mut ctx).unwrap();
+        assert!(out == s);
+
+        let s = BigNum::from_hex_str("3").unwrap();
+        let p = BigNum::from_hex_str("5").unwrap();
+        assert!(out.mod_sqrt(&s, &p, &mut ctx).is_err());
+    }
+
+    #[test]
+    #[cfg(any(ossl110, boringssl, libressl350))]
+    fn test_odd_even() {
+        let a = BigNum::from_u32(17).unwrap();
+        let b = BigNum::from_u32(18).unwrap();
+
+        assert!(a.is_odd());
+        assert!(!b.is_odd());
+
+        assert!(!a.is_even());
+        assert!(b.is_even());
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/cipher.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/cipher.rs
--- 43.0.0-1/rust-vendor/openssl/src/cipher.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/cipher.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,597 @@
+//! Symmetric ciphers.
+
+#[cfg(ossl300)]
+use crate::cvt_p;
+#[cfg(ossl300)]
+use crate::error::ErrorStack;
+#[cfg(ossl300)]
+use crate::lib_ctx::LibCtxRef;
+use crate::nid::Nid;
+use cfg_if::cfg_if;
+use foreign_types::{ForeignTypeRef, Opaque};
+use openssl_macros::corresponds;
+#[cfg(ossl300)]
+use std::ffi::CString;
+use std::ops::{Deref, DerefMut};
+#[cfg(ossl300)]
+use std::ptr;
+
+cfg_if! {
+    if #[cfg(any(boringssl, ossl110, libressl273))] {
+        use ffi::{EVP_CIPHER_block_size, EVP_CIPHER_iv_length, EVP_CIPHER_key_length};
+    } else {
+        use libc::c_int;
+
+        #[allow(bad_style)]
+        pub unsafe fn EVP_CIPHER_iv_length(ptr: *const ffi::EVP_CIPHER) -> c_int {
+            (*ptr).iv_len
+        }
+
+        #[allow(bad_style)]
+        pub unsafe fn EVP_CIPHER_block_size(ptr: *const ffi::EVP_CIPHER) -> c_int {
+            (*ptr).block_size
+        }
+
+        #[allow(bad_style)]
+        pub unsafe fn EVP_CIPHER_key_length(ptr: *const ffi::EVP_CIPHER) -> c_int {
+            (*ptr).key_len
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        use foreign_types::ForeignType;
+
+        type Inner = *mut ffi::EVP_CIPHER;
+
+        impl Drop for Cipher {
+            #[inline]
+            fn drop(&mut self) {
+                unsafe {
+                    ffi::EVP_CIPHER_free(self.as_ptr());
+                }
+            }
+        }
+
+        impl ForeignType for Cipher {
+            type CType = ffi::EVP_CIPHER;
+            type Ref = CipherRef;
+
+            #[inline]
+            unsafe fn from_ptr(ptr: *mut Self::CType) -> Self {
+                Cipher(ptr)
+            }
+
+            #[inline]
+            fn as_ptr(&self) -> *mut Self::CType {
+                self.0
+            }
+        }
+
+        impl Deref for Cipher {
+            type Target = CipherRef;
+
+            #[inline]
+            fn deref(&self) -> &Self::Target {
+                unsafe {
+                    CipherRef::from_ptr(self.as_ptr())
+                }
+            }
+        }
+
+        impl DerefMut for Cipher {
+            #[inline]
+            fn deref_mut(&mut self) -> &mut Self::Target {
+                unsafe {
+                    CipherRef::from_ptr_mut(self.as_ptr())
+                }
+            }
+        }
+    } else {
+        enum Inner {}
+
+        impl Deref for Cipher {
+            type Target = CipherRef;
+
+            #[inline]
+            fn deref(&self) -> &Self::Target {
+                match self.0 {}
+            }
+        }
+
+        impl DerefMut for Cipher {
+            #[inline]
+            fn deref_mut(&mut self) -> &mut Self::Target {
+                match self.0 {}
+            }
+        }
+    }
+}
+
+/// A symmetric cipher.
+pub struct Cipher(Inner);
+
+unsafe impl Sync for Cipher {}
+unsafe impl Send for Cipher {}
+
+impl Cipher {
+    /// Looks up the cipher for a certain nid.
+    #[corresponds(EVP_get_cipherbynid)]
+    pub fn from_nid(nid: Nid) -> Option<&'static CipherRef> {
+        unsafe {
+            let ptr = ffi::EVP_get_cipherbyname(ffi::OBJ_nid2sn(nid.as_raw()));
+            if ptr.is_null() {
+                None
+            } else {
+                Some(CipherRef::from_ptr(ptr as *mut _))
+            }
+        }
+    }
+
+    /// Fetches a cipher object corresponding to the specified algorithm name and properties.
+    ///
+    /// Requires OpenSSL 3.0.0 or newer.
+    #[corresponds(EVP_CIPHER_fetch)]
+    #[cfg(ossl300)]
+    pub fn fetch(
+        ctx: Option<&LibCtxRef>,
+        algorithm: &str,
+        properties: Option<&str>,
+    ) -> Result<Self, ErrorStack> {
+        let algorithm = CString::new(algorithm).unwrap();
+        let properties = properties.map(|s| CString::new(s).unwrap());
+
+        unsafe {
+            let ptr = cvt_p(ffi::EVP_CIPHER_fetch(
+                ctx.map_or(ptr::null_mut(), ForeignTypeRef::as_ptr),
+                algorithm.as_ptr(),
+                properties.map_or(ptr::null_mut(), |s| s.as_ptr()),
+            ))?;
+
+            Ok(Cipher::from_ptr(ptr))
+        }
+    }
+
+    pub fn aes_128_ecb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_128_ecb() as *mut _) }
+    }
+
+    pub fn aes_128_cbc() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_128_cbc() as *mut _) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_128_xts() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_128_xts() as *mut _) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_256_xts() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_256_xts() as *mut _) }
+    }
+
+    pub fn aes_128_ctr() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_128_ctr() as *mut _) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_128_cfb1() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_128_cfb1() as *mut _) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_128_cfb128() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_128_cfb128() as *mut _) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_128_cfb8() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_128_cfb8() as *mut _) }
+    }
+
+    pub fn aes_128_gcm() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_128_gcm() as *mut _) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_128_ccm() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_128_ccm() as *mut _) }
+    }
+
+    pub fn aes_128_ofb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_128_ofb() as *mut _) }
+    }
+
+    /// Requires OpenSSL 1.1.0 or newer.
+    #[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_OCB")))]
+    pub fn aes_128_ocb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_128_ocb() as *mut _) }
+    }
+
+    /// Requires OpenSSL 1.0.2 or newer.
+    #[cfg(ossl102)]
+    pub fn aes_128_wrap() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_128_wrap() as *mut _) }
+    }
+
+    /// Requires OpenSSL 1.1.0 or newer.
+    #[cfg(ossl110)]
+    pub fn aes_128_wrap_pad() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_128_wrap_pad() as *mut _) }
+    }
+
+    pub fn aes_192_ecb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_192_ecb() as *mut _) }
+    }
+
+    pub fn aes_192_cbc() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_192_cbc() as *mut _) }
+    }
+
+    pub fn aes_192_ctr() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_192_ctr() as *mut _) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_192_cfb1() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_192_cfb1() as *mut _) }
+    }
+
+    pub fn aes_192_cfb128() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_192_cfb128() as *mut _) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_192_cfb8() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_192_cfb8() as *mut _) }
+    }
+
+    pub fn aes_192_gcm() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_192_gcm() as *mut _) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_192_ccm() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_192_ccm() as *mut _) }
+    }
+
+    pub fn aes_192_ofb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_192_ofb() as *mut _) }
+    }
+
+    /// Requires OpenSSL 1.1.0 or newer.
+    #[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_OCB")))]
+    pub fn aes_192_ocb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_192_ocb() as *mut _) }
+    }
+
+    /// Requires OpenSSL 1.0.2 or newer.
+    #[cfg(ossl102)]
+    pub fn aes_192_wrap() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_192_wrap() as *mut _) }
+    }
+
+    /// Requires OpenSSL 1.1.0 or newer.
+    #[cfg(ossl110)]
+    pub fn aes_192_wrap_pad() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_192_wrap_pad() as *mut _) }
+    }
+
+    pub fn aes_256_ecb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_256_ecb() as *mut _) }
+    }
+
+    pub fn aes_256_cbc() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_256_cbc() as *mut _) }
+    }
+
+    pub fn aes_256_ctr() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_256_ctr() as *mut _) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_256_cfb1() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_256_cfb1() as *mut _) }
+    }
+
+    pub fn aes_256_cfb128() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_256_cfb128() as *mut _) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_256_cfb8() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_256_cfb8() as *mut _) }
+    }
+
+    pub fn aes_256_gcm() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_256_gcm() as *mut _) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_256_ccm() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_256_ccm() as *mut _) }
+    }
+
+    pub fn aes_256_ofb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_256_ofb() as *mut _) }
+    }
+
+    /// Requires OpenSSL 1.1.0 or newer.
+    #[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_OCB")))]
+    pub fn aes_256_ocb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_256_ocb() as *mut _) }
+    }
+
+    /// Requires OpenSSL 1.0.2 or newer.
+    #[cfg(ossl102)]
+    pub fn aes_256_wrap() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_256_wrap() as *mut _) }
+    }
+
+    /// Requires OpenSSL 1.1.0 or newer.
+    #[cfg(ossl110)]
+    pub fn aes_256_wrap_pad() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_aes_256_wrap_pad() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_BF"))]
+    pub fn bf_cbc() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_bf_cbc() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_BF"))]
+    pub fn bf_ecb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_bf_ecb() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_BF"))]
+    pub fn bf_cfb64() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_bf_cfb64() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_BF"))]
+    pub fn bf_ofb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_bf_ofb() as *mut _) }
+    }
+
+    pub fn des_cbc() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_des_cbc() as *mut _) }
+    }
+
+    pub fn des_ecb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_des_ecb() as *mut _) }
+    }
+
+    pub fn des_ede3() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_des_ede3() as *mut _) }
+    }
+
+    pub fn des_ede3_ecb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_des_ede3_ecb() as *mut _) }
+    }
+
+    pub fn des_ede3_cbc() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_des_ede3_cbc() as *mut _) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn des_ede3_cfb8() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_des_ede3_cfb8() as *mut _) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn des_ede3_cfb64() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_des_ede3_cfb64() as *mut _) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn des_ede3_ofb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_des_ede3_ofb() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_RC4"))]
+    pub fn rc4() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_rc4() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia128_cfb128() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_camellia_128_cfb128() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia128_ecb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_camellia_128_ecb() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia128_cbc() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_camellia_128_cbc() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia128_ofb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_camellia_128_ofb() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia192_cfb128() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_camellia_192_cfb128() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia192_ecb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_camellia_192_ecb() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia192_cbc() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_camellia_192_cbc() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia192_ofb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_camellia_192_ofb() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia256_cfb128() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_camellia_256_cfb128() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia256_ecb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_camellia_256_ecb() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia256_cbc() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_camellia_256_cbc() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia256_ofb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_camellia_256_ofb() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
+    pub fn cast5_cfb64() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_cast5_cfb64() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
+    pub fn cast5_ecb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_cast5_ecb() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
+    pub fn cast5_cbc() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_cast5_cbc() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
+    pub fn cast5_ofb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_cast5_ofb() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
+    pub fn idea_cfb64() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_idea_cfb64() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
+    pub fn idea_ecb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_idea_ecb() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
+    pub fn idea_cbc() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_idea_cbc() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
+    pub fn idea_ofb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_idea_ofb() as *mut _) }
+    }
+
+    #[cfg(all(any(ossl110, libressl310), not(osslconf = "OPENSSL_NO_CHACHA")))]
+    pub fn chacha20() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_chacha20() as *mut _) }
+    }
+
+    #[cfg(all(any(ossl110, libressl360), not(osslconf = "OPENSSL_NO_CHACHA")))]
+    pub fn chacha20_poly1305() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_chacha20_poly1305() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_SEED"))]
+    pub fn seed_cbc() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_seed_cbc() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_SEED"))]
+    pub fn seed_cfb128() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_seed_cfb128() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_SEED"))]
+    pub fn seed_ecb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_seed_ecb() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_SEED"))]
+    pub fn seed_ofb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_seed_ofb() as *mut _) }
+    }
+
+    #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM4")))]
+    pub fn sm4_ecb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_sm4_ecb() as *mut _) }
+    }
+
+    #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM4")))]
+    pub fn sm4_cbc() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_sm4_cbc() as *mut _) }
+    }
+
+    #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM4")))]
+    pub fn sm4_ctr() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_sm4_ctr() as *mut _) }
+    }
+
+    #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM4")))]
+    pub fn sm4_cfb128() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_sm4_cfb128() as *mut _) }
+    }
+
+    #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM4")))]
+    pub fn sm4_ofb() -> &'static CipherRef {
+        unsafe { CipherRef::from_ptr(ffi::EVP_sm4_ofb() as *mut _) }
+    }
+}
+
+/// A reference to a [`Cipher`].
+pub struct CipherRef(Opaque);
+
+impl ForeignTypeRef for CipherRef {
+    type CType = ffi::EVP_CIPHER;
+}
+
+unsafe impl Sync for CipherRef {}
+unsafe impl Send for CipherRef {}
+
+impl CipherRef {
+    /// Returns the cipher's Nid.
+    #[corresponds(EVP_CIPHER_nid)]
+    pub fn nid(&self) -> Nid {
+        let nid = unsafe { ffi::EVP_CIPHER_nid(self.as_ptr()) };
+        Nid::from_raw(nid)
+    }
+
+    /// Returns the length of keys used with this cipher.
+    #[corresponds(EVP_CIPHER_key_length)]
+    pub fn key_length(&self) -> usize {
+        unsafe { EVP_CIPHER_key_length(self.as_ptr()) as usize }
+    }
+
+    /// Returns the length of the IV used with this cipher.
+    ///
+    /// # Note
+    ///
+    /// Ciphers that do not use an IV have an IV length of 0.
+    #[corresponds(EVP_CIPHER_iv_length)]
+    pub fn iv_length(&self) -> usize {
+        unsafe { EVP_CIPHER_iv_length(self.as_ptr()) as usize }
+    }
+
+    /// Returns the block size of the cipher.
+    ///
+    /// # Note
+    ///
+    /// Stream ciphers have a block size of 1.
+    #[corresponds(EVP_CIPHER_block_size)]
+    pub fn block_size(&self) -> usize {
+        unsafe { EVP_CIPHER_block_size(self.as_ptr()) as usize }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/cipher_ctx.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/cipher_ctx.rs
--- 43.0.0-1/rust-vendor/openssl/src/cipher_ctx.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/cipher_ctx.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1110 @@
+//! The symmetric encryption context.
+//!
+//! # Examples
+//!
+//! Encrypt data with AES128 CBC
+//!
+//! ```
+//! use openssl::cipher::Cipher;
+//! use openssl::cipher_ctx::CipherCtx;
+//!
+//! let cipher = Cipher::aes_128_cbc();
+//! let data = b"Some Crypto Text";
+//! let key = b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F";
+//! let iv = b"\x00\x01\x02\x03\x04\x05\x06\x07\x00\x01\x02\x03\x04\x05\x06\x07";
+//!
+//! let mut ctx = CipherCtx::new().unwrap();
+//! ctx.encrypt_init(Some(cipher), Some(key), Some(iv)).unwrap();
+//!
+//! let mut ciphertext = vec![];
+//! ctx.cipher_update_vec(data, &mut ciphertext).unwrap();
+//! ctx.cipher_final_vec(&mut ciphertext).unwrap();
+//!
+//! assert_eq!(
+//!     b"\xB4\xB9\xE7\x30\xD6\xD6\xF7\xDE\x77\x3F\x1C\xFF\xB3\x3E\x44\x5A\x91\xD7\x27\x62\x87\x4D\
+//!       \xFB\x3C\x5E\xC4\x59\x72\x4A\xF4\x7C\xA1",
+//!     &ciphertext[..],
+//! );
+//! ```
+//!
+//! Decrypt data with AES128 CBC
+//!
+//! ```
+//! use openssl::cipher::Cipher;
+//! use openssl::cipher_ctx::CipherCtx;
+//!
+//! let cipher = Cipher::aes_128_cbc();
+//! let data = b"\xB4\xB9\xE7\x30\xD6\xD6\xF7\xDE\x77\x3F\x1C\xFF\xB3\x3E\x44\x5A\x91\xD7\x27\x62\
+//!              \x87\x4D\xFB\x3C\x5E\xC4\x59\x72\x4A\xF4\x7C\xA1";
+//! let key = b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F";
+//! let iv = b"\x00\x01\x02\x03\x04\x05\x06\x07\x00\x01\x02\x03\x04\x05\x06\x07";
+//!
+//! let mut ctx = CipherCtx::new().unwrap();
+//! ctx.decrypt_init(Some(cipher), Some(key), Some(iv)).unwrap();
+//!
+//! let mut plaintext = vec![];
+//! ctx.cipher_update_vec(data, &mut plaintext).unwrap();
+//! ctx.cipher_final_vec(&mut plaintext).unwrap();
+//!
+//! assert_eq!(b"Some Crypto Text", &plaintext[..]);
+//! ```
+#![warn(missing_docs)]
+
+use crate::cipher::CipherRef;
+use crate::error::ErrorStack;
+#[cfg(not(boringssl))]
+use crate::pkey::{HasPrivate, HasPublic, PKey, PKeyRef};
+use crate::{cvt, cvt_p};
+#[cfg(ossl102)]
+use bitflags::bitflags;
+use cfg_if::cfg_if;
+use foreign_types::{ForeignType, ForeignTypeRef};
+use libc::{c_int, c_uchar};
+use openssl_macros::corresponds;
+use std::convert::{TryFrom, TryInto};
+use std::ptr;
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        use ffi::EVP_CIPHER_CTX_get0_cipher;
+    } else {
+        use ffi::EVP_CIPHER_CTX_cipher as EVP_CIPHER_CTX_get0_cipher;
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::EVP_CIPHER_CTX;
+    fn drop = ffi::EVP_CIPHER_CTX_free;
+
+    /// A context object used to perform symmetric encryption operations.
+    pub struct CipherCtx;
+    /// A reference to a [`CipherCtx`].
+    pub struct CipherCtxRef;
+}
+
+#[cfg(ossl102)]
+bitflags! {
+    /// Flags for `EVP_CIPHER_CTX`.
+    pub struct CipherCtxFlags : c_int {
+        /// The flag used to opt into AES key wrap ciphers.
+        const FLAG_WRAP_ALLOW = ffi::EVP_CIPHER_CTX_FLAG_WRAP_ALLOW;
+    }
+}
+
+impl CipherCtx {
+    /// Creates a new context.
+    #[corresponds(EVP_CIPHER_CTX_new)]
+    pub fn new() -> Result<Self, ErrorStack> {
+        ffi::init();
+
+        unsafe {
+            let ptr = cvt_p(ffi::EVP_CIPHER_CTX_new())?;
+            Ok(CipherCtx::from_ptr(ptr))
+        }
+    }
+}
+
+impl CipherCtxRef {
+    #[corresponds(EVP_CIPHER_CTX_copy)]
+    pub fn copy(&mut self, src: &CipherCtxRef) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_CIPHER_CTX_copy(self.as_ptr(), src.as_ptr()))?;
+            Ok(())
+        }
+    }
+
+    /// Initializes the context for encryption.
+    ///
+    /// Normally this is called once to set all of the cipher, key, and IV. However, this process can be split up
+    /// by first setting the cipher with no key or IV and then setting the key and IV with no cipher. This can be used
+    /// to, for example, use a nonstandard IV size.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the key buffer is smaller than the key size of the cipher, the IV buffer is smaller than the IV size
+    /// of the cipher, or if a key or IV is provided before a cipher.
+    #[corresponds(EVP_EncryptInit_ex)]
+    pub fn encrypt_init(
+        &mut self,
+        type_: Option<&CipherRef>,
+        key: Option<&[u8]>,
+        iv: Option<&[u8]>,
+    ) -> Result<(), ErrorStack> {
+        self.cipher_init(type_, key, iv, ffi::EVP_EncryptInit_ex)
+    }
+
+    /// Initializes the context for decryption.
+    ///
+    /// Normally this is called once to set all of the cipher, key, and IV. However, this process can be split up
+    /// by first setting the cipher with no key or IV and then setting the key and IV with no cipher. This can be used
+    /// to, for example, use a nonstandard IV size.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the key buffer is smaller than the key size of the cipher, the IV buffer is smaller than the IV size
+    /// of the cipher, or if a key or IV is provided before a cipher.
+    #[corresponds(EVP_DecryptInit_ex)]
+    pub fn decrypt_init(
+        &mut self,
+        type_: Option<&CipherRef>,
+        key: Option<&[u8]>,
+        iv: Option<&[u8]>,
+    ) -> Result<(), ErrorStack> {
+        self.cipher_init(type_, key, iv, ffi::EVP_DecryptInit_ex)
+    }
+
+    fn cipher_init(
+        &mut self,
+        type_: Option<&CipherRef>,
+        key: Option<&[u8]>,
+        iv: Option<&[u8]>,
+        f: unsafe extern "C" fn(
+            *mut ffi::EVP_CIPHER_CTX,
+            *const ffi::EVP_CIPHER,
+            *mut ffi::ENGINE,
+            *const c_uchar,
+            *const c_uchar,
+        ) -> c_int,
+    ) -> Result<(), ErrorStack> {
+        if let Some(key) = key {
+            let key_len = type_.map_or_else(|| self.key_length(), |c| c.key_length());
+            assert!(key_len <= key.len());
+        }
+
+        if let Some(iv) = iv {
+            let iv_len = type_.map_or_else(|| self.iv_length(), |c| c.iv_length());
+            assert!(iv_len <= iv.len());
+        }
+
+        unsafe {
+            cvt(f(
+                self.as_ptr(),
+                type_.map_or(ptr::null(), |p| p.as_ptr()),
+                ptr::null_mut(),
+                key.map_or(ptr::null(), |k| k.as_ptr()),
+                iv.map_or(ptr::null(), |iv| iv.as_ptr()),
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Initializes the context to perform envelope encryption.
+    ///
+    /// Normally this is called once to set both the cipher and public keys. However, this process may be split up by
+    /// first providing the cipher with no public keys and then setting the public keys with no cipher.
+    ///
+    /// `encrypted_keys` will contain the generated symmetric key encrypted with each corresponding asymmetric private
+    /// key. The generated IV will be written to `iv`.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `pub_keys` is not the same size as `encrypted_keys`, the IV buffer is smaller than the cipher's IV
+    /// size, or if an IV is provided before the cipher.
+    #[corresponds(EVP_SealInit)]
+    #[cfg(not(boringssl))]
+    pub fn seal_init<T>(
+        &mut self,
+        type_: Option<&CipherRef>,
+        pub_keys: &[PKey<T>],
+        encrypted_keys: &mut [Vec<u8>],
+        iv: Option<&mut [u8]>,
+    ) -> Result<(), ErrorStack>
+    where
+        T: HasPublic,
+    {
+        assert_eq!(pub_keys.len(), encrypted_keys.len());
+        if !pub_keys.is_empty() {
+            let iv_len = type_.map_or_else(|| self.iv_length(), |c| c.iv_length());
+            assert!(iv.as_ref().map_or(0, |b| b.len()) >= iv_len);
+        }
+
+        for (pub_key, buf) in pub_keys.iter().zip(&mut *encrypted_keys) {
+            buf.resize(pub_key.size(), 0);
+        }
+
+        let mut keys = encrypted_keys
+            .iter_mut()
+            .map(|b| b.as_mut_ptr())
+            .collect::<Vec<_>>();
+        let mut key_lengths = vec![0; pub_keys.len()];
+        let pub_keys_len = i32::try_from(pub_keys.len()).unwrap();
+
+        unsafe {
+            cvt(ffi::EVP_SealInit(
+                self.as_ptr(),
+                type_.map_or(ptr::null(), |p| p.as_ptr()),
+                keys.as_mut_ptr(),
+                key_lengths.as_mut_ptr(),
+                iv.map_or(ptr::null_mut(), |b| b.as_mut_ptr()),
+                pub_keys.as_ptr() as *mut _,
+                pub_keys_len,
+            ))?;
+        }
+
+        for (buf, len) in encrypted_keys.iter_mut().zip(key_lengths) {
+            buf.truncate(len as usize);
+        }
+
+        Ok(())
+    }
+
+    /// Initializes the context to perform envelope decryption.
+    ///
+    /// Normally this is called once with all of the arguments present. However, this process may be split up by first
+    /// providing the cipher alone and then after providing the rest of the arguments in a second call.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the IV buffer is smaller than the cipher's required IV size or if the IV is provided before the
+    /// cipher.
+    #[corresponds(EVP_OpenInit)]
+    #[cfg(not(boringssl))]
+    pub fn open_init<T>(
+        &mut self,
+        type_: Option<&CipherRef>,
+        encrypted_key: &[u8],
+        iv: Option<&[u8]>,
+        priv_key: Option<&PKeyRef<T>>,
+    ) -> Result<(), ErrorStack>
+    where
+        T: HasPrivate,
+    {
+        if priv_key.is_some() {
+            let iv_len = type_.map_or_else(|| self.iv_length(), |c| c.iv_length());
+            assert!(iv.map_or(0, |b| b.len()) >= iv_len);
+        }
+
+        let len = c_int::try_from(encrypted_key.len()).unwrap();
+        unsafe {
+            cvt(ffi::EVP_OpenInit(
+                self.as_ptr(),
+                type_.map_or(ptr::null(), |p| p.as_ptr()),
+                encrypted_key.as_ptr(),
+                len,
+                iv.map_or(ptr::null(), |b| b.as_ptr()),
+                priv_key.map_or(ptr::null_mut(), ForeignTypeRef::as_ptr),
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    fn assert_cipher(&self) {
+        unsafe {
+            assert!(!EVP_CIPHER_CTX_get0_cipher(self.as_ptr()).is_null());
+        }
+    }
+
+    /// Returns the block size of the context's cipher.
+    ///
+    /// Stream ciphers will report a block size of 1.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the context has not been initialized with a cipher.
+    #[corresponds(EVP_CIPHER_CTX_block_size)]
+    pub fn block_size(&self) -> usize {
+        self.assert_cipher();
+
+        unsafe { ffi::EVP_CIPHER_CTX_block_size(self.as_ptr()) as usize }
+    }
+
+    /// Returns the key length of the context's cipher.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the context has not been initialized with a cipher.
+    #[corresponds(EVP_CIPHER_CTX_key_length)]
+    pub fn key_length(&self) -> usize {
+        self.assert_cipher();
+
+        unsafe { ffi::EVP_CIPHER_CTX_key_length(self.as_ptr()) as usize }
+    }
+
+    /// Generates a random key based on the configured cipher.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the context has not been initialized with a cipher or if the buffer is smaller than the cipher's key
+    /// length.
+    ///
+    /// This corresponds to [`EVP_CIPHER_CTX_rand_key`].
+    ///
+    /// [`EVP_CIPHER_CTX_rand_key`]: https://www.openssl.org/docs/manmaster/man3/EVP_CIPHER_CTX_rand_key.html
+    #[corresponds(EVP_CIPHER_CTX_rand_key)]
+    #[cfg(not(boringssl))]
+    pub fn rand_key(&self, buf: &mut [u8]) -> Result<(), ErrorStack> {
+        assert!(buf.len() >= self.key_length());
+
+        unsafe {
+            cvt(ffi::EVP_CIPHER_CTX_rand_key(
+                self.as_ptr(),
+                buf.as_mut_ptr(),
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Sets the length of the key expected by the context.
+    ///
+    /// Only some ciphers support configurable key lengths.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the context has not been initialized with a cipher.
+    #[corresponds(EVP_CIPHER_CTX_set_key_length)]
+    pub fn set_key_length(&mut self, len: usize) -> Result<(), ErrorStack> {
+        self.assert_cipher();
+
+        unsafe {
+            cvt(ffi::EVP_CIPHER_CTX_set_key_length(
+                self.as_ptr(),
+                len.try_into().unwrap(),
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Returns the length of the IV expected by this context.
+    ///
+    /// Returns 0 if the cipher does not use an IV.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the context has not been initialized with a cipher.
+    #[corresponds(EVP_CIPHER_CTX_iv_length)]
+    pub fn iv_length(&self) -> usize {
+        self.assert_cipher();
+
+        unsafe { ffi::EVP_CIPHER_CTX_iv_length(self.as_ptr()) as usize }
+    }
+
+    /// Returns the `num` parameter of the cipher.
+    ///
+    /// Built-in ciphers typically use this to track how much of the
+    /// current underlying block has been "used" already.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the context has not been initialized with a cipher.
+    #[corresponds(EVP_CIPHER_CTX_num)]
+    #[cfg(ossl110)]
+    pub fn num(&self) -> usize {
+        self.assert_cipher();
+
+        unsafe { ffi::EVP_CIPHER_CTX_num(self.as_ptr()) as usize }
+    }
+
+    /// Sets the length of the IV expected by this context.
+    ///
+    /// Only some ciphers support configurable IV lengths.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the context has not been initialized with a cipher.
+    #[corresponds(EVP_CIPHER_CTX_ctrl)]
+    pub fn set_iv_length(&mut self, len: usize) -> Result<(), ErrorStack> {
+        self.assert_cipher();
+
+        let len = c_int::try_from(len).unwrap();
+
+        unsafe {
+            cvt(ffi::EVP_CIPHER_CTX_ctrl(
+                self.as_ptr(),
+                ffi::EVP_CTRL_GCM_SET_IVLEN,
+                len,
+                ptr::null_mut(),
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Returns the length of the authentication tag expected by this context.
+    ///
+    /// Returns 0 if the cipher is not authenticated.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the context has not been initialized with a cipher.
+    ///
+    /// Requires OpenSSL 3.0.0 or newer.
+    #[corresponds(EVP_CIPHER_CTX_get_tag_length)]
+    #[cfg(ossl300)]
+    pub fn tag_length(&self) -> usize {
+        self.assert_cipher();
+
+        unsafe { ffi::EVP_CIPHER_CTX_get_tag_length(self.as_ptr()) as usize }
+    }
+
+    /// Retrieves the calculated authentication tag from the context.
+    ///
+    /// This should be called after [`Self::cipher_final`], and is only supported by authenticated ciphers.
+    ///
+    /// The size of the buffer indicates the size of the tag. While some ciphers support a range of tag sizes, it is
+    /// recommended to pick the maximum size.
+    #[corresponds(EVP_CIPHER_CTX_ctrl)]
+    pub fn tag(&self, tag: &mut [u8]) -> Result<(), ErrorStack> {
+        let len = c_int::try_from(tag.len()).unwrap();
+
+        unsafe {
+            cvt(ffi::EVP_CIPHER_CTX_ctrl(
+                self.as_ptr(),
+                ffi::EVP_CTRL_GCM_GET_TAG,
+                len,
+                tag.as_mut_ptr() as *mut _,
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Sets the length of the generated authentication tag.
+    ///
+    /// This must be called when encrypting with a cipher in CCM mode to use a tag size other than the default.
+    #[corresponds(EVP_CIPHER_CTX_ctrl)]
+    pub fn set_tag_length(&mut self, len: usize) -> Result<(), ErrorStack> {
+        let len = c_int::try_from(len).unwrap();
+
+        unsafe {
+            cvt(ffi::EVP_CIPHER_CTX_ctrl(
+                self.as_ptr(),
+                ffi::EVP_CTRL_GCM_SET_TAG,
+                len,
+                ptr::null_mut(),
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Sets the authentication tag for verification during decryption.
+    #[corresponds(EVP_CIPHER_CTX_ctrl)]
+    pub fn set_tag(&mut self, tag: &[u8]) -> Result<(), ErrorStack> {
+        let len = c_int::try_from(tag.len()).unwrap();
+
+        unsafe {
+            cvt(ffi::EVP_CIPHER_CTX_ctrl(
+                self.as_ptr(),
+                ffi::EVP_CTRL_GCM_SET_TAG,
+                len,
+                tag.as_ptr() as *mut _,
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Enables or disables padding.
+    ///
+    /// If padding is disabled, the plaintext must be an exact multiple of the cipher's block size.
+    #[corresponds(EVP_CIPHER_CTX_set_padding)]
+    pub fn set_padding(&mut self, padding: bool) {
+        unsafe {
+            ffi::EVP_CIPHER_CTX_set_padding(self.as_ptr(), padding as c_int);
+        }
+    }
+
+    /// Sets the total length of plaintext data.
+    ///
+    /// This is required for ciphers operating in CCM mode.
+    #[corresponds(EVP_CipherUpdate)]
+    pub fn set_data_len(&mut self, len: usize) -> Result<(), ErrorStack> {
+        let len = c_int::try_from(len).unwrap();
+
+        unsafe {
+            cvt(ffi::EVP_CipherUpdate(
+                self.as_ptr(),
+                ptr::null_mut(),
+                &mut 0,
+                ptr::null(),
+                len,
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Set ctx flags.
+    ///
+    /// This function is currently used to enable AES key wrap feature supported by OpenSSL 1.0.2 or newer.
+    #[corresponds(EVP_CIPHER_CTX_set_flags)]
+    #[cfg(ossl102)]
+    pub fn set_flags(&mut self, flags: CipherCtxFlags) {
+        unsafe {
+            ffi::EVP_CIPHER_CTX_set_flags(self.as_ptr(), flags.bits());
+        }
+    }
+
+    /// Writes data into the context.
+    ///
+    /// Providing no output buffer will cause the input to be considered additional authenticated data (AAD).
+    ///
+    /// Returns the number of bytes written to `output`.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `output` doesn't contain enough space for data to be
+    /// written.
+    #[corresponds(EVP_CipherUpdate)]
+    pub fn cipher_update(
+        &mut self,
+        input: &[u8],
+        output: Option<&mut [u8]>,
+    ) -> Result<usize, ErrorStack> {
+        if let Some(output) = &output {
+            let mut block_size = self.block_size();
+            if block_size == 1 {
+                block_size = 0;
+            }
+            let min_output_size = input.len() + block_size;
+            assert!(
+                output.len() >= min_output_size,
+                "Output buffer size should be at least {} bytes.",
+                min_output_size
+            );
+        }
+
+        unsafe { self.cipher_update_unchecked(input, output) }
+    }
+
+    /// Writes data into the context.
+    ///
+    /// Providing no output buffer will cause the input to be considered additional authenticated data (AAD).
+    ///
+    /// Returns the number of bytes written to `output`.
+    ///
+    /// This function is the same as [`Self::cipher_update`] but with the
+    /// output size check removed. It can be used when the exact
+    /// buffer size control is maintained by the caller.
+    ///
+    /// # Safety
+    ///
+    /// The caller is expected to provide `output` buffer
+    /// large enough to contain correct number of bytes. For streaming
+    /// ciphers the output buffer size should be at least as big as
+    /// the input buffer. For block ciphers the size of the output
+    /// buffer depends on the state of partially updated blocks.
+    #[corresponds(EVP_CipherUpdate)]
+    pub unsafe fn cipher_update_unchecked(
+        &mut self,
+        input: &[u8],
+        output: Option<&mut [u8]>,
+    ) -> Result<usize, ErrorStack> {
+        let inlen = c_int::try_from(input.len()).unwrap();
+
+        let mut outlen = 0;
+
+        cvt(ffi::EVP_CipherUpdate(
+            self.as_ptr(),
+            output.map_or(ptr::null_mut(), |b| b.as_mut_ptr()),
+            &mut outlen,
+            input.as_ptr(),
+            inlen,
+        ))?;
+
+        Ok(outlen as usize)
+    }
+
+    /// Like [`Self::cipher_update`] except that it appends output to a [`Vec`].
+    pub fn cipher_update_vec(
+        &mut self,
+        input: &[u8],
+        output: &mut Vec<u8>,
+    ) -> Result<usize, ErrorStack> {
+        let base = output.len();
+        output.resize(base + input.len() + self.block_size(), 0);
+        let len = self.cipher_update(input, Some(&mut output[base..]))?;
+        output.truncate(base + len);
+
+        Ok(len)
+    }
+
+    /// Like [`Self::cipher_update`] except that it writes output into the
+    /// `data` buffer. The `inlen` parameter specifies the number of bytes in
+    /// `data` that are considered the input. For streaming ciphers, the size of
+    /// `data` must be at least the input size. Otherwise, it must be at least
+    /// an additional block size larger.
+    ///
+    /// Note: Use [`Self::cipher_update`] with no output argument to write AAD.
+    ///
+    /// # Panics
+    ///
+    /// This function panics if the input size cannot be represented as `int` or
+    /// exceeds the buffer size, or if the output buffer does not contain enough
+    /// additional space.
+    #[corresponds(EVP_CipherUpdate)]
+    pub fn cipher_update_inplace(
+        &mut self,
+        data: &mut [u8],
+        inlen: usize,
+    ) -> Result<usize, ErrorStack> {
+        assert!(inlen <= data.len(), "Input size may not exceed buffer size");
+        let block_size = self.block_size();
+        if block_size != 1 {
+            assert!(
+                data.len() >= inlen + block_size,
+                "Output buffer size must be at least {} bytes.",
+                inlen + block_size
+            );
+        }
+
+        let inlen = c_int::try_from(inlen).unwrap();
+        let mut outlen = 0;
+        unsafe {
+            cvt(ffi::EVP_CipherUpdate(
+                self.as_ptr(),
+                data.as_mut_ptr(),
+                &mut outlen,
+                data.as_ptr(),
+                inlen,
+            ))
+        }?;
+
+        Ok(outlen as usize)
+    }
+
+    /// Finalizes the encryption or decryption process.
+    ///
+    /// Any remaining data will be written to the output buffer.
+    ///
+    /// Returns the number of bytes written to `output`.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `output` is smaller than the cipher's block size.
+    #[corresponds(EVP_CipherFinal)]
+    pub fn cipher_final(&mut self, output: &mut [u8]) -> Result<usize, ErrorStack> {
+        let block_size = self.block_size();
+        if block_size > 1 {
+            assert!(output.len() >= block_size);
+        }
+
+        unsafe { self.cipher_final_unchecked(output) }
+    }
+
+    /// Finalizes the encryption or decryption process.
+    ///
+    /// Any remaining data will be written to the output buffer.
+    ///
+    /// Returns the number of bytes written to `output`.
+    ///
+    /// This function is the same as [`Self::cipher_final`] but with
+    /// the output buffer size check removed.
+    ///
+    /// # Safety
+    ///
+    /// The caller is expected to provide `output` buffer
+    /// large enough to contain correct number of bytes. For streaming
+    /// ciphers the output buffer can be empty, for block ciphers the
+    /// output buffer should be at least as big as the block.
+    #[corresponds(EVP_CipherFinal)]
+    pub unsafe fn cipher_final_unchecked(
+        &mut self,
+        output: &mut [u8],
+    ) -> Result<usize, ErrorStack> {
+        let mut outl = 0;
+
+        cvt(ffi::EVP_CipherFinal(
+            self.as_ptr(),
+            output.as_mut_ptr(),
+            &mut outl,
+        ))?;
+
+        Ok(outl as usize)
+    }
+
+    /// Like [`Self::cipher_final`] except that it appends output to a [`Vec`].
+    pub fn cipher_final_vec(&mut self, output: &mut Vec<u8>) -> Result<usize, ErrorStack> {
+        let base = output.len();
+        output.resize(base + self.block_size(), 0);
+        let len = self.cipher_final(&mut output[base..])?;
+        output.truncate(base + len);
+
+        Ok(len)
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+    use crate::{cipher::Cipher, rand::rand_bytes};
+    #[cfg(not(boringssl))]
+    use std::slice;
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn seal_open() {
+        let private_pem = include_bytes!("../test/rsa.pem");
+        let public_pem = include_bytes!("../test/rsa.pem.pub");
+        let private_key = PKey::private_key_from_pem(private_pem).unwrap();
+        let public_key = PKey::public_key_from_pem(public_pem).unwrap();
+        let cipher = Cipher::aes_256_cbc();
+        let secret = b"My secret message";
+
+        let mut ctx = CipherCtx::new().unwrap();
+        let mut encrypted_key = vec![];
+        let mut iv = vec![0; cipher.iv_length()];
+        let mut encrypted = vec![];
+        ctx.seal_init(
+            Some(cipher),
+            &[public_key],
+            slice::from_mut(&mut encrypted_key),
+            Some(&mut iv),
+        )
+        .unwrap();
+        ctx.cipher_update_vec(secret, &mut encrypted).unwrap();
+        ctx.cipher_final_vec(&mut encrypted).unwrap();
+
+        let mut decrypted = vec![];
+        ctx.open_init(Some(cipher), &encrypted_key, Some(&iv), Some(&private_key))
+            .unwrap();
+        ctx.cipher_update_vec(&encrypted, &mut decrypted).unwrap();
+        ctx.cipher_final_vec(&mut decrypted).unwrap();
+
+        assert_eq!(secret, &decrypted[..]);
+    }
+
+    fn aes_128_cbc(cipher: &CipherRef) {
+        // from https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38a.pdf
+        let key = hex::decode("2b7e151628aed2a6abf7158809cf4f3c").unwrap();
+        let iv = hex::decode("000102030405060708090a0b0c0d0e0f").unwrap();
+        let pt = hex::decode("6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51")
+            .unwrap();
+        let ct = hex::decode("7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b2")
+            .unwrap();
+
+        let mut ctx = CipherCtx::new().unwrap();
+
+        ctx.encrypt_init(Some(cipher), Some(&key), Some(&iv))
+            .unwrap();
+        ctx.set_padding(false);
+
+        let mut buf = vec![];
+        ctx.cipher_update_vec(&pt, &mut buf).unwrap();
+        ctx.cipher_final_vec(&mut buf).unwrap();
+
+        assert_eq!(buf, ct);
+
+        ctx.decrypt_init(Some(cipher), Some(&key), Some(&iv))
+            .unwrap();
+        ctx.set_padding(false);
+
+        let mut buf = vec![];
+        ctx.cipher_update_vec(&ct, &mut buf).unwrap();
+        ctx.cipher_final_vec(&mut buf).unwrap();
+
+        assert_eq!(buf, pt);
+    }
+
+    #[test]
+    #[cfg(ossl300)]
+    fn fetched_aes_128_cbc() {
+        let cipher = Cipher::fetch(None, "AES-128-CBC", None).unwrap();
+        aes_128_cbc(&cipher);
+    }
+
+    #[test]
+    fn default_aes_128_cbc() {
+        let cipher = Cipher::aes_128_cbc();
+        aes_128_cbc(cipher);
+    }
+
+    #[test]
+    fn test_stream_ciphers() {
+        test_stream_cipher(Cipher::aes_192_ctr());
+        test_stream_cipher(Cipher::aes_256_ctr());
+    }
+
+    fn test_stream_cipher(cipher: &'static CipherRef) {
+        let mut key = vec![0; cipher.key_length()];
+        rand_bytes(&mut key).unwrap();
+        let mut iv = vec![0; cipher.iv_length()];
+        rand_bytes(&mut iv).unwrap();
+
+        let mut ctx = CipherCtx::new().unwrap();
+
+        ctx.encrypt_init(Some(cipher), Some(&key), Some(&iv))
+            .unwrap();
+        ctx.set_padding(false);
+
+        assert_eq!(
+            1,
+            cipher.block_size(),
+            "Need a stream cipher, not a block cipher"
+        );
+
+        // update cipher with non-full block
+        // this is a streaming cipher so the number of output bytes
+        // will be the same as the number of input bytes
+        let mut output = vec![0; 32];
+        let outlen = ctx
+            .cipher_update(&[1; 15], Some(&mut output[0..15]))
+            .unwrap();
+        assert_eq!(15, outlen);
+
+        // update cipher with missing bytes from the previous block
+        // as previously it will output the same number of bytes as
+        // the input
+        let outlen = ctx
+            .cipher_update(&[1; 17], Some(&mut output[15..]))
+            .unwrap();
+        assert_eq!(17, outlen);
+
+        ctx.cipher_final_vec(&mut vec![0; 0]).unwrap();
+
+        // encrypt again, but use in-place encryption this time
+        // First reset the IV
+        ctx.encrypt_init(None, None, Some(&iv)).unwrap();
+        ctx.set_padding(false);
+        let mut data_inplace: [u8; 32] = [1; 32];
+        let outlen = ctx
+            .cipher_update_inplace(&mut data_inplace[0..15], 15)
+            .unwrap();
+        assert_eq!(15, outlen);
+
+        let outlen = ctx
+            .cipher_update_inplace(&mut data_inplace[15..32], 17)
+            .unwrap();
+        assert_eq!(17, outlen);
+
+        ctx.cipher_final(&mut [0u8; 0]).unwrap();
+
+        // Check that the resulting data is encrypted in the same manner
+        assert_eq!(data_inplace.as_slice(), output.as_slice());
+
+        // try to decrypt
+        ctx.decrypt_init(Some(cipher), Some(&key), Some(&iv))
+            .unwrap();
+        ctx.set_padding(false);
+
+        // update cipher with non-full block
+        // expect that the output for stream cipher will contain
+        // the same number of bytes as the input
+        let mut output_decrypted = vec![0; 32];
+        let outlen = ctx
+            .cipher_update(&output[0..15], Some(&mut output_decrypted[0..15]))
+            .unwrap();
+        assert_eq!(15, outlen);
+
+        let outlen = ctx
+            .cipher_update(&output[15..], Some(&mut output_decrypted[15..]))
+            .unwrap();
+        assert_eq!(17, outlen);
+
+        ctx.cipher_final_vec(&mut vec![0; 0]).unwrap();
+        // check if the decrypted blocks are the same as input (all ones)
+        assert_eq!(output_decrypted, vec![1; 32]);
+
+        // decrypt again, but now the output in-place
+        ctx.decrypt_init(None, None, Some(&iv)).unwrap();
+        ctx.set_padding(false);
+
+        let outlen = ctx.cipher_update_inplace(&mut output[0..15], 15).unwrap();
+        assert_eq!(15, outlen);
+
+        let outlen = ctx.cipher_update_inplace(&mut output[15..], 17).unwrap();
+        assert_eq!(17, outlen);
+
+        ctx.cipher_final_vec(&mut vec![0; 0]).unwrap();
+        assert_eq!(output_decrypted, output);
+    }
+
+    #[test]
+    #[should_panic(expected = "Output buffer size should be at least 33 bytes.")]
+    fn full_block_updates_aes_128() {
+        output_buffer_too_small(Cipher::aes_128_cbc());
+    }
+
+    #[test]
+    #[should_panic(expected = "Output buffer size should be at least 33 bytes.")]
+    fn full_block_updates_aes_256() {
+        output_buffer_too_small(Cipher::aes_256_cbc());
+    }
+
+    #[test]
+    #[should_panic(expected = "Output buffer size should be at least 17 bytes.")]
+    fn full_block_updates_3des() {
+        output_buffer_too_small(Cipher::des_ede3_cbc());
+    }
+
+    fn output_buffer_too_small(cipher: &'static CipherRef) {
+        let mut key = vec![0; cipher.key_length()];
+        rand_bytes(&mut key).unwrap();
+        let mut iv = vec![0; cipher.iv_length()];
+        rand_bytes(&mut iv).unwrap();
+
+        let mut ctx = CipherCtx::new().unwrap();
+
+        ctx.encrypt_init(Some(cipher), Some(&key), Some(&iv))
+            .unwrap();
+        ctx.set_padding(false);
+
+        let block_size = cipher.block_size();
+        assert!(block_size > 1, "Need a block cipher, not a stream cipher");
+
+        ctx.cipher_update(&vec![0; block_size + 1], Some(&mut vec![0; block_size - 1]))
+            .unwrap();
+    }
+
+    #[cfg(ossl102)]
+    fn cipher_wrap_test(cipher: &CipherRef, pt: &str, ct: &str, key: &str, iv: Option<&str>) {
+        let pt = hex::decode(pt).unwrap();
+        let key = hex::decode(key).unwrap();
+        let expected = hex::decode(ct).unwrap();
+        let iv = iv.map(|v| hex::decode(v).unwrap());
+        let padding = 8 - pt.len() % 8;
+        let mut computed = vec![0; pt.len() + padding + cipher.block_size() * 2];
+        let mut ctx = CipherCtx::new().unwrap();
+
+        ctx.set_flags(CipherCtxFlags::FLAG_WRAP_ALLOW);
+        ctx.encrypt_init(Some(cipher), Some(&key), iv.as_deref())
+            .unwrap();
+
+        let count = ctx.cipher_update(&pt, Some(&mut computed)).unwrap();
+        let rest = ctx.cipher_final(&mut computed[count..]).unwrap();
+        computed.truncate(count + rest);
+
+        if computed != expected {
+            println!("Computed: {}", hex::encode(&computed));
+            println!("Expected: {}", hex::encode(&expected));
+            if computed.len() != expected.len() {
+                println!(
+                    "Lengths differ: {} in computed vs {} expected",
+                    computed.len(),
+                    expected.len()
+                );
+            }
+            panic!("test failure");
+        }
+    }
+
+    #[test]
+    #[cfg(ossl102)]
+    fn test_aes128_wrap() {
+        let pt = "00112233445566778899aabbccddeeff";
+        let ct = "7940ff694448b5bb5139c959a4896832e55d69aa04daa27e";
+        let key = "2b7e151628aed2a6abf7158809cf4f3c";
+        let iv = "0001020304050607";
+
+        cipher_wrap_test(Cipher::aes_128_wrap(), pt, ct, key, Some(iv));
+    }
+
+    #[test]
+    #[cfg(ossl102)]
+    fn test_aes128_wrap_default_iv() {
+        let pt = "00112233445566778899aabbccddeeff";
+        let ct = "38f1215f0212526f8a70b51955b9fbdc9fe3041d9832306e";
+        let key = "2b7e151628aed2a6abf7158809cf4f3c";
+
+        cipher_wrap_test(Cipher::aes_128_wrap(), pt, ct, key, None);
+    }
+
+    #[test]
+    #[cfg(ossl110)]
+    fn test_aes128_wrap_pad() {
+        let pt = "00112233445566778899aabbccddee";
+        let ct = "f13998f5ab32ef82a1bdbcbe585e1d837385b529572a1e1b";
+        let key = "2b7e151628aed2a6abf7158809cf4f3c";
+        let iv = "00010203";
+
+        cipher_wrap_test(Cipher::aes_128_wrap_pad(), pt, ct, key, Some(iv));
+    }
+
+    #[test]
+    #[cfg(ossl110)]
+    fn test_aes128_wrap_pad_default_iv() {
+        let pt = "00112233445566778899aabbccddee";
+        let ct = "3a501085fb8cf66f4186b7df851914d471ed823411598add";
+        let key = "2b7e151628aed2a6abf7158809cf4f3c";
+
+        cipher_wrap_test(Cipher::aes_128_wrap_pad(), pt, ct, key, None);
+    }
+
+    #[test]
+    #[cfg(ossl102)]
+    fn test_aes192_wrap() {
+        let pt = "9f6dee187d35302116aecbfd059657efd9f7589c4b5e7f5b";
+        let ct = "83b89142dfeeb4871e078bfb81134d33e23fedc19b03a1cf689973d3831b6813";
+        let key = "8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b";
+        let iv = "0001020304050607";
+
+        cipher_wrap_test(Cipher::aes_192_wrap(), pt, ct, key, Some(iv));
+    }
+
+    #[test]
+    #[cfg(ossl102)]
+    fn test_aes192_wrap_default_iv() {
+        let pt = "9f6dee187d35302116aecbfd059657efd9f7589c4b5e7f5b";
+        let ct = "c02c2cf11505d3e4851030d5534cbf5a1d7eca7ba8839adbf239756daf1b43e6";
+        let key = "8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b";
+
+        cipher_wrap_test(Cipher::aes_192_wrap(), pt, ct, key, None);
+    }
+
+    #[test]
+    #[cfg(ossl110)]
+    fn test_aes192_wrap_pad() {
+        let pt = "00112233445566778899aabbccddee";
+        let ct = "b4f6bb167ef7caf061a74da82b36ad038ca057ab51e98d3a";
+        let key = "8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b";
+        let iv = "00010203";
+
+        cipher_wrap_test(Cipher::aes_192_wrap_pad(), pt, ct, key, Some(iv));
+    }
+
+    #[test]
+    #[cfg(ossl110)]
+    fn test_aes192_wrap_pad_default_iv() {
+        let pt = "00112233445566778899aabbccddee";
+        let ct = "b2c37a28cc602753a7c944a4c2555a2df9c98b2eded5312e";
+        let key = "8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b";
+
+        cipher_wrap_test(Cipher::aes_192_wrap_pad(), pt, ct, key, None);
+    }
+
+    #[test]
+    #[cfg(ossl102)]
+    fn test_aes256_wrap() {
+        let pt = "6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51";
+        let ct = "cc05da2a7f56f7dd0c144231f90bce58648fa20a8278f5a6b7d13bba6aa57a33229d4333866b7fd6";
+        let key = "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4";
+        let iv = "0001020304050607";
+
+        cipher_wrap_test(Cipher::aes_256_wrap(), pt, ct, key, Some(iv));
+    }
+
+    #[test]
+    #[cfg(ossl102)]
+    fn test_aes256_wrap_default_iv() {
+        let pt = "6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51";
+        let ct = "0b24f068b50e52bc6987868411c36e1b03900866ed12af81eb87cef70a8d1911731c1d7abf789d88";
+        let key = "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4";
+
+        cipher_wrap_test(Cipher::aes_256_wrap(), pt, ct, key, None);
+    }
+
+    #[test]
+    #[cfg(ossl110)]
+    fn test_aes256_wrap_pad() {
+        let pt = "00112233445566778899aabbccddee";
+        let ct = "91594e044ccc06130d60e6c84a996aa4f96a9faff8c5f6e7";
+        let key = "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4";
+        let iv = "00010203";
+
+        cipher_wrap_test(Cipher::aes_256_wrap_pad(), pt, ct, key, Some(iv));
+    }
+
+    #[test]
+    #[cfg(ossl110)]
+    fn test_aes256_wrap_pad_default_iv() {
+        let pt = "00112233445566778899aabbccddee";
+        let ct = "dc3c166a854afd68aea624a4272693554bf2e4fcbae602cd";
+        let key = "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4";
+
+        cipher_wrap_test(Cipher::aes_256_wrap_pad(), pt, ct, key, None);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/cms.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/cms.rs
--- 43.0.0-1/rust-vendor/openssl/src/cms.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/cms.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,484 @@
+//! SMIME implementation using CMS
+//!
+//! CMS (PKCS#7) is an encryption standard.  It allows signing and encrypting data using
+//! X.509 certificates.  The OpenSSL implementation of CMS is used in email encryption
+//! generated from a `Vec` of bytes.  This `Vec` follows the smime protocol standards.
+//! Data accepted by this module will be smime type `enveloped-data`.
+
+use bitflags::bitflags;
+use foreign_types::{ForeignType, ForeignTypeRef};
+use libc::c_uint;
+use std::ptr;
+
+use crate::bio::{MemBio, MemBioSlice};
+use crate::error::ErrorStack;
+use crate::pkey::{HasPrivate, PKeyRef};
+use crate::stack::StackRef;
+use crate::symm::Cipher;
+use crate::x509::{store::X509StoreRef, X509Ref, X509};
+use crate::{cvt, cvt_p};
+use openssl_macros::corresponds;
+
+bitflags! {
+    #[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+    #[repr(transparent)]
+    pub struct CMSOptions : c_uint {
+        const TEXT = ffi::CMS_TEXT;
+        const CMS_NOCERTS = ffi::CMS_NOCERTS;
+        const NO_CONTENT_VERIFY = ffi::CMS_NO_CONTENT_VERIFY;
+        const NO_ATTR_VERIFY = ffi::CMS_NO_ATTR_VERIFY;
+        const NOSIGS = ffi::CMS_NOSIGS;
+        const NOINTERN = ffi::CMS_NOINTERN;
+        const NO_SIGNER_CERT_VERIFY = ffi::CMS_NO_SIGNER_CERT_VERIFY;
+        const NOVERIFY = ffi::CMS_NOVERIFY;
+        const DETACHED = ffi::CMS_DETACHED;
+        const BINARY = ffi::CMS_BINARY;
+        const NOATTR = ffi::CMS_NOATTR;
+        const NOSMIMECAP = ffi::CMS_NOSMIMECAP;
+        const NOOLDMIMETYPE = ffi::CMS_NOOLDMIMETYPE;
+        const CRLFEOL = ffi::CMS_CRLFEOL;
+        const STREAM = ffi::CMS_STREAM;
+        const NOCRL = ffi::CMS_NOCRL;
+        const PARTIAL = ffi::CMS_PARTIAL;
+        const REUSE_DIGEST = ffi::CMS_REUSE_DIGEST;
+        const USE_KEYID = ffi::CMS_USE_KEYID;
+        const DEBUG_DECRYPT = ffi::CMS_DEBUG_DECRYPT;
+        #[cfg(all(not(libressl), not(ossl101)))]
+        const KEY_PARAM = ffi::CMS_KEY_PARAM;
+        #[cfg(all(not(libressl), not(ossl101), not(ossl102)))]
+        const ASCIICRLF = ffi::CMS_ASCIICRLF;
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::CMS_ContentInfo;
+    fn drop = ffi::CMS_ContentInfo_free;
+
+    /// High level CMS wrapper
+    ///
+    /// CMS supports nesting various types of data, including signatures, certificates,
+    /// encrypted data, smime messages (encrypted email), and data digest.  The ContentInfo
+    /// content type is the encapsulation of all those content types.  [`RFC 5652`] describes
+    /// CMS and OpenSSL follows this RFC's implementation.
+    ///
+    /// [`RFC 5652`]: https://tools.ietf.org/html/rfc5652#page-6
+    pub struct CmsContentInfo;
+    /// Reference to [`CMSContentInfo`]
+    ///
+    /// [`CMSContentInfo`]:struct.CmsContentInfo.html
+    pub struct CmsContentInfoRef;
+}
+
+impl CmsContentInfoRef {
+    /// Given the sender's private key, `pkey` and the recipient's certificate, `cert`,
+    /// decrypt the data in `self`.
+    #[corresponds(CMS_decrypt)]
+    pub fn decrypt<T>(&self, pkey: &PKeyRef<T>, cert: &X509) -> Result<Vec<u8>, ErrorStack>
+    where
+        T: HasPrivate,
+    {
+        unsafe {
+            let pkey = pkey.as_ptr();
+            let cert = cert.as_ptr();
+            let out = MemBio::new()?;
+
+            cvt(ffi::CMS_decrypt(
+                self.as_ptr(),
+                pkey,
+                cert,
+                ptr::null_mut(),
+                out.as_ptr(),
+                0,
+            ))?;
+
+            Ok(out.get_buf().to_owned())
+        }
+    }
+
+    /// Given the sender's private key, `pkey`,
+    /// decrypt the data in `self` without validating the recipient certificate.
+    ///
+    /// *Warning*: Not checking the recipient certificate may leave you vulnerable to Bleichenbacher's attack on PKCS#1 v1.5 RSA padding.
+    #[corresponds(CMS_decrypt)]
+    // FIXME merge into decrypt
+    pub fn decrypt_without_cert_check<T>(&self, pkey: &PKeyRef<T>) -> Result<Vec<u8>, ErrorStack>
+    where
+        T: HasPrivate,
+    {
+        unsafe {
+            let pkey = pkey.as_ptr();
+            let out = MemBio::new()?;
+
+            cvt(ffi::CMS_decrypt(
+                self.as_ptr(),
+                pkey,
+                ptr::null_mut(),
+                ptr::null_mut(),
+                out.as_ptr(),
+                0,
+            ))?;
+
+            Ok(out.get_buf().to_owned())
+        }
+    }
+
+    to_der! {
+        /// Serializes this CmsContentInfo using DER.
+        #[corresponds(i2d_CMS_ContentInfo)]
+        to_der,
+        ffi::i2d_CMS_ContentInfo
+    }
+
+    to_pem! {
+        /// Serializes this CmsContentInfo using DER.
+        #[corresponds(PEM_write_bio_CMS)]
+        to_pem,
+        ffi::PEM_write_bio_CMS
+    }
+}
+
+impl CmsContentInfo {
+    /// Parses a smime formatted `vec` of bytes into a `CmsContentInfo`.
+    #[corresponds(SMIME_read_CMS)]
+    pub fn smime_read_cms(smime: &[u8]) -> Result<CmsContentInfo, ErrorStack> {
+        unsafe {
+            let bio = MemBioSlice::new(smime)?;
+
+            let cms = cvt_p(ffi::SMIME_read_CMS(bio.as_ptr(), ptr::null_mut()))?;
+
+            Ok(CmsContentInfo::from_ptr(cms))
+        }
+    }
+
+    from_der! {
+        /// Deserializes a DER-encoded ContentInfo structure.
+        #[corresponds(d2i_CMS_ContentInfo)]
+        from_der,
+        CmsContentInfo,
+        ffi::d2i_CMS_ContentInfo
+    }
+
+    from_pem! {
+        /// Deserializes a PEM-encoded ContentInfo structure.
+        #[corresponds(PEM_read_bio_CMS)]
+        from_pem,
+        CmsContentInfo,
+        ffi::PEM_read_bio_CMS
+    }
+
+    /// Given a signing cert `signcert`, private key `pkey`, a certificate stack `certs`,
+    /// data `data` and flags `flags`, create a CmsContentInfo struct.
+    ///
+    /// All arguments are optional.
+    #[corresponds(CMS_sign)]
+    pub fn sign<T>(
+        signcert: Option<&X509Ref>,
+        pkey: Option<&PKeyRef<T>>,
+        certs: Option<&StackRef<X509>>,
+        data: Option<&[u8]>,
+        flags: CMSOptions,
+    ) -> Result<CmsContentInfo, ErrorStack>
+    where
+        T: HasPrivate,
+    {
+        unsafe {
+            let signcert = signcert.map_or(ptr::null_mut(), |p| p.as_ptr());
+            let pkey = pkey.map_or(ptr::null_mut(), |p| p.as_ptr());
+            let data_bio = match data {
+                Some(data) => Some(MemBioSlice::new(data)?),
+                None => None,
+            };
+            let data_bio_ptr = data_bio.as_ref().map_or(ptr::null_mut(), |p| p.as_ptr());
+            let certs = certs.map_or(ptr::null_mut(), |p| p.as_ptr());
+
+            let cms = cvt_p(ffi::CMS_sign(
+                signcert,
+                pkey,
+                certs,
+                data_bio_ptr,
+                flags.bits(),
+            ))?;
+
+            Ok(CmsContentInfo::from_ptr(cms))
+        }
+    }
+
+    /// Given a certificate stack `certs`, data `data`, cipher `cipher` and flags `flags`,
+    /// create a CmsContentInfo struct.
+    ///
+    /// OpenSSL documentation at [`CMS_encrypt`]
+    ///
+    /// [`CMS_encrypt`]: https://www.openssl.org/docs/manmaster/man3/CMS_encrypt.html
+    #[corresponds(CMS_encrypt)]
+    pub fn encrypt(
+        certs: &StackRef<X509>,
+        data: &[u8],
+        cipher: Cipher,
+        flags: CMSOptions,
+    ) -> Result<CmsContentInfo, ErrorStack> {
+        unsafe {
+            let data_bio = MemBioSlice::new(data)?;
+
+            let cms = cvt_p(ffi::CMS_encrypt(
+                certs.as_ptr(),
+                data_bio.as_ptr(),
+                cipher.as_ptr(),
+                flags.bits(),
+            ))?;
+
+            Ok(CmsContentInfo::from_ptr(cms))
+        }
+    }
+
+    /// Verify this CmsContentInfo's signature,
+    /// This will search the 'certs' list for the signing certificate.      
+    /// Additional certificates, needed for building the certificate chain, may be
+    /// given in 'store' as well as additional CRLs.
+    /// A detached signature may be passed in `detached_data`. The signed content
+    /// without signature, will be copied into output_data if it is present.
+    ///
+    #[corresponds(CMS_verify)]
+    pub fn verify(
+        &mut self,
+        certs: Option<&StackRef<X509>>,
+        store: Option<&X509StoreRef>,
+        detached_data: Option<&[u8]>,
+        output_data: Option<&mut Vec<u8>>,
+        flags: CMSOptions,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            let certs_ptr = certs.map_or(ptr::null_mut(), |p| p.as_ptr());
+            let store_ptr = store.map_or(ptr::null_mut(), |p| p.as_ptr());
+            let detached_data_bio = match detached_data {
+                Some(data) => Some(MemBioSlice::new(data)?),
+                None => None,
+            };
+            let detached_data_bio_ptr = detached_data_bio
+                .as_ref()
+                .map_or(ptr::null_mut(), |p| p.as_ptr());
+            let out_bio = MemBio::new()?;
+
+            cvt(ffi::CMS_verify(
+                self.as_ptr(),
+                certs_ptr,
+                store_ptr,
+                detached_data_bio_ptr,
+                out_bio.as_ptr(),
+                flags.bits(),
+            ))?;
+
+            if let Some(data) = output_data {
+                data.clear();
+                data.extend_from_slice(out_bio.get_buf());
+            };
+
+            Ok(())
+        }
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+
+    use crate::pkcs12::Pkcs12;
+    use crate::pkey::PKey;
+    use crate::stack::Stack;
+    use crate::x509::{
+        store::{X509Store, X509StoreBuilder},
+        X509,
+    };
+
+    #[test]
+    fn cms_encrypt_decrypt() {
+        #[cfg(ossl300)]
+        let _provider = crate::provider::Provider::try_load(None, "legacy", true).unwrap();
+
+        // load cert with public key only
+        let pub_cert_bytes = include_bytes!("../test/cms_pubkey.der");
+        let pub_cert = X509::from_der(pub_cert_bytes).expect("failed to load pub cert");
+
+        // load cert with private key
+        let priv_cert_bytes = include_bytes!("../test/cms.p12");
+        let priv_cert = Pkcs12::from_der(priv_cert_bytes).expect("failed to load priv cert");
+        let priv_cert = priv_cert
+            .parse2("mypass")
+            .expect("failed to parse priv cert");
+
+        // encrypt cms message using public key cert
+        let input = String::from("My Message");
+        let mut cert_stack = Stack::new().expect("failed to create stack");
+        cert_stack
+            .push(pub_cert)
+            .expect("failed to add pub cert to stack");
+
+        let encrypt = CmsContentInfo::encrypt(
+            &cert_stack,
+            input.as_bytes(),
+            Cipher::des_ede3_cbc(),
+            CMSOptions::empty(),
+        )
+        .expect("failed create encrypted cms");
+
+        // decrypt cms message using private key cert (DER)
+        {
+            let encrypted_der = encrypt.to_der().expect("failed to create der from cms");
+            let decrypt =
+                CmsContentInfo::from_der(&encrypted_der).expect("failed read cms from der");
+
+            let decrypt_with_cert_check = decrypt
+                .decrypt(
+                    priv_cert.pkey.as_ref().unwrap(),
+                    priv_cert.cert.as_ref().unwrap(),
+                )
+                .expect("failed to decrypt cms");
+            let decrypt_with_cert_check = String::from_utf8(decrypt_with_cert_check)
+                .expect("failed to create string from cms content");
+
+            let decrypt_without_cert_check = decrypt
+                .decrypt_without_cert_check(priv_cert.pkey.as_ref().unwrap())
+                .expect("failed to decrypt cms");
+            let decrypt_without_cert_check = String::from_utf8(decrypt_without_cert_check)
+                .expect("failed to create string from cms content");
+
+            assert_eq!(input, decrypt_with_cert_check);
+            assert_eq!(input, decrypt_without_cert_check);
+        }
+
+        // decrypt cms message using private key cert (PEM)
+        {
+            let encrypted_pem = encrypt.to_pem().expect("failed to create pem from cms");
+            let decrypt =
+                CmsContentInfo::from_pem(&encrypted_pem).expect("failed read cms from pem");
+
+            let decrypt_with_cert_check = decrypt
+                .decrypt(
+                    priv_cert.pkey.as_ref().unwrap(),
+                    priv_cert.cert.as_ref().unwrap(),
+                )
+                .expect("failed to decrypt cms");
+            let decrypt_with_cert_check = String::from_utf8(decrypt_with_cert_check)
+                .expect("failed to create string from cms content");
+
+            let decrypt_without_cert_check = decrypt
+                .decrypt_without_cert_check(priv_cert.pkey.as_ref().unwrap())
+                .expect("failed to decrypt cms");
+            let decrypt_without_cert_check = String::from_utf8(decrypt_without_cert_check)
+                .expect("failed to create string from cms content");
+
+            assert_eq!(input, decrypt_with_cert_check);
+            assert_eq!(input, decrypt_without_cert_check);
+        }
+    }
+
+    fn cms_sign_verify_generic_helper(is_detached: bool) {
+        // load cert with private key
+        let cert_bytes = include_bytes!("../test/cert.pem");
+        let cert = X509::from_pem(cert_bytes).expect("failed to load cert.pem");
+
+        let key_bytes = include_bytes!("../test/key.pem");
+        let key = PKey::private_key_from_pem(key_bytes).expect("failed to load key.pem");
+
+        let root_bytes = include_bytes!("../test/root-ca.pem");
+        let root = X509::from_pem(root_bytes).expect("failed to load root-ca.pem");
+
+        // sign cms message using public key cert
+        let data = b"Hello world!";
+
+        let (opt, ext_data): (CMSOptions, Option<&[u8]>) = if is_detached {
+            (CMSOptions::DETACHED | CMSOptions::BINARY, Some(data))
+        } else {
+            (CMSOptions::empty(), None)
+        };
+
+        let mut cms = CmsContentInfo::sign(Some(&cert), Some(&key), None, Some(data), opt)
+            .expect("failed to CMS sign a message");
+
+        // check CMS signature length
+        let pem_cms = cms
+            .to_pem()
+            .expect("failed to pack CmsContentInfo into PEM");
+        assert!(!pem_cms.is_empty());
+
+        // verify CMS signature
+        let mut builder = X509StoreBuilder::new().expect("failed to create X509StoreBuilder");
+        builder
+            .add_cert(root)
+            .expect("failed to add root-ca into X509StoreBuilder");
+        let store: X509Store = builder.build();
+        let mut out_data: Vec<u8> = Vec::new();
+        let res = cms.verify(
+            None,
+            Some(&store),
+            ext_data,
+            Some(&mut out_data),
+            CMSOptions::empty(),
+        );
+
+        // check verification result -  valid signature
+        res.unwrap();
+        assert_eq!(data.to_vec(), out_data);
+    }
+
+    #[test]
+    fn cms_sign_verify_ok() {
+        cms_sign_verify_generic_helper(false);
+    }
+
+    #[test]
+    fn cms_sign_verify_detached_ok() {
+        cms_sign_verify_generic_helper(true);
+    }
+
+    #[test]
+    fn cms_sign_verify_error() {
+        #[cfg(ossl300)]
+        let _provider = crate::provider::Provider::try_load(None, "legacy", true).unwrap();
+
+        // load cert with private key
+        let priv_cert_bytes = include_bytes!("../test/cms.p12");
+        let priv_cert = Pkcs12::from_der(priv_cert_bytes).expect("failed to load priv cert");
+        let priv_cert = priv_cert
+            .parse2("mypass")
+            .expect("failed to parse priv cert");
+
+        // sign cms message using public key cert
+        let data = b"Hello world!";
+        let mut cms = CmsContentInfo::sign(
+            Some(&priv_cert.cert.unwrap()),
+            Some(&priv_cert.pkey.unwrap()),
+            None,
+            Some(data),
+            CMSOptions::empty(),
+        )
+        .expect("failed to CMS sign a message");
+
+        // check CMS signature length
+        let pem_cms = cms
+            .to_pem()
+            .expect("failed to pack CmsContentInfo into PEM");
+        assert!(!pem_cms.is_empty());
+
+        let empty_store = X509StoreBuilder::new()
+            .expect("failed to create X509StoreBuilder")
+            .build();
+
+        // verify CMS signature
+        let res = cms.verify(
+            None,
+            Some(&empty_store),
+            Some(data),
+            None,
+            CMSOptions::empty(),
+        );
+
+        // check verification result - this is an invalid signature
+        // defined in openssl crypto/cms/cms.h
+        const CMS_R_CERTIFICATE_VERIFY_ERROR: i32 = 100;
+        let es = res.unwrap_err();
+        let error_array = es.errors();
+        assert_eq!(1, error_array.len());
+        let code = error_array[0].reason_code();
+        assert_eq!(code, CMS_R_CERTIFICATE_VERIFY_ERROR);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/conf.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/conf.rs
--- 43.0.0-1/rust-vendor/openssl/src/conf.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/conf.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,65 @@
+//! Interface for processing OpenSSL configuration files.
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::CONF;
+    fn drop = ffi::NCONF_free;
+
+    pub struct Conf;
+    pub struct ConfRef;
+}
+
+#[cfg(not(boringssl))]
+mod methods {
+    use super::Conf;
+    use crate::cvt_p;
+    use crate::error::ErrorStack;
+    use openssl_macros::corresponds;
+
+    pub struct ConfMethod(*mut ffi::CONF_METHOD);
+
+    impl ConfMethod {
+        /// Retrieve handle to the default OpenSSL configuration file processing function.
+        #[corresponds(NCONF_default)]
+        #[allow(clippy::should_implement_trait)]
+        pub fn default() -> ConfMethod {
+            unsafe {
+                ffi::init();
+                // `NCONF` stands for "New Conf", as described in crypto/conf/conf_lib.c. This is
+                // a newer API than the "CONF classic" functions.
+                ConfMethod(ffi::NCONF_default())
+            }
+        }
+
+        /// Construct from raw pointer.
+        ///
+        /// # Safety
+        ///
+        /// The caller must ensure that the pointer is valid.
+        pub unsafe fn from_ptr(ptr: *mut ffi::CONF_METHOD) -> ConfMethod {
+            ConfMethod(ptr)
+        }
+
+        /// Convert to raw pointer.
+        pub fn as_ptr(&self) -> *mut ffi::CONF_METHOD {
+            self.0
+        }
+    }
+
+    impl Conf {
+        /// Create a configuration parser.
+        ///
+        /// # Examples
+        ///
+        /// ```
+        /// use openssl::conf::{Conf, ConfMethod};
+        ///
+        /// let conf = Conf::new(ConfMethod::default());
+        /// ```
+        #[corresponds(NCONF_new)]
+        pub fn new(method: ConfMethod) -> Result<Conf, ErrorStack> {
+            unsafe { cvt_p(ffi::NCONF_new(method.as_ptr())).map(Conf) }
+        }
+    }
+}
+#[cfg(not(boringssl))]
+pub use methods::*;
diff -pruN 43.0.0-1/rust-vendor/openssl/src/derive.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/derive.rs
--- 43.0.0-1/rust-vendor/openssl/src/derive.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/derive.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,217 @@
+//! Shared secret derivation.
+//!
+//! # Example
+//!
+//! The following example implements [ECDH] using `NIST P-384` keys:
+//!
+//! ```
+//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
+//! # use std::convert::TryInto;
+//! use openssl::bn::BigNumContext;
+//! use openssl::pkey::PKey;
+//! use openssl::derive::Deriver;
+//! use openssl::ec::{EcGroup, EcKey, EcPoint, PointConversionForm};
+//! use openssl::nid::Nid;
+//!
+//! let group = EcGroup::from_curve_name(Nid::SECP384R1)?;
+//!
+//! let first: PKey<_> = EcKey::generate(&group)?.try_into()?;
+//!
+//! // second party generates an ephemeral key and derives
+//! // a shared secret using first party's public key
+//! let shared_key = EcKey::generate(&group)?;
+//! // shared_public is sent to first party
+//! let mut ctx = BigNumContext::new()?;
+//! let shared_public = shared_key.public_key().to_bytes(
+//!        &group,
+//!        PointConversionForm::COMPRESSED,
+//!        &mut ctx,
+//!    )?;
+//!
+//! let shared_key: PKey<_> = shared_key.try_into()?;
+//! let mut deriver = Deriver::new(&shared_key)?;
+//! deriver.set_peer(&first)?;
+//! // secret can be used e.g. as a symmetric encryption key
+//! let secret = deriver.derive_to_vec()?;
+//! # drop(deriver);
+//!
+//! // first party derives the same shared secret using
+//! // shared_public
+//! let point = EcPoint::from_bytes(&group, &shared_public, &mut ctx)?;
+//! let recipient_key: PKey<_> = EcKey::from_public_key(&group, &point)?.try_into()?;
+//! let mut deriver = Deriver::new(&first)?;
+//! deriver.set_peer(&recipient_key)?;
+//! let first_secret = deriver.derive_to_vec()?;
+//!
+//! assert_eq!(secret, first_secret);
+//! # Ok(()) }
+//! ```
+//!
+//! [ECDH]: https://wiki.openssl.org/index.php/Elliptic_Curve_Diffie_Hellman
+
+use foreign_types::ForeignTypeRef;
+use std::marker::PhantomData;
+use std::ptr;
+
+use crate::error::ErrorStack;
+use crate::pkey::{HasPrivate, HasPublic, PKeyRef};
+use crate::{cvt, cvt_p};
+use openssl_macros::corresponds;
+
+/// A type used to derive a shared secret between two keys.
+pub struct Deriver<'a>(*mut ffi::EVP_PKEY_CTX, PhantomData<&'a ()>);
+
+unsafe impl<'a> Sync for Deriver<'a> {}
+unsafe impl<'a> Send for Deriver<'a> {}
+
+#[allow(clippy::len_without_is_empty)]
+impl<'a> Deriver<'a> {
+    /// Creates a new `Deriver` using the provided private key.
+    ///
+    /// This corresponds to [`EVP_PKEY_derive_init`].
+    ///
+    /// [`EVP_PKEY_derive_init`]: https://www.openssl.org/docs/manmaster/crypto/EVP_PKEY_derive_init.html
+    pub fn new<T>(key: &'a PKeyRef<T>) -> Result<Deriver<'a>, ErrorStack>
+    where
+        T: HasPrivate,
+    {
+        unsafe {
+            cvt_p(ffi::EVP_PKEY_CTX_new(key.as_ptr(), ptr::null_mut()))
+                .map(|p| Deriver(p, PhantomData))
+                .and_then(|ctx| cvt(ffi::EVP_PKEY_derive_init(ctx.0)).map(|_| ctx))
+        }
+    }
+
+    /// Sets the peer key used for secret derivation.
+    #[corresponds(EVP_PKEY_derive_set_peer)]
+    pub fn set_peer<T>(&mut self, key: &'a PKeyRef<T>) -> Result<(), ErrorStack>
+    where
+        T: HasPublic,
+    {
+        unsafe { cvt(ffi::EVP_PKEY_derive_set_peer(self.0, key.as_ptr())).map(|_| ()) }
+    }
+
+    /// Sets the peer key used for secret derivation along with optionally validating the peer public key.
+    ///
+    /// Requires OpenSSL 3.0.0 or newer.
+    #[corresponds(EVP_PKEY_derive_set_peer_ex)]
+    #[cfg(ossl300)]
+    pub fn set_peer_ex<T>(
+        &mut self,
+        key: &'a PKeyRef<T>,
+        validate_peer: bool,
+    ) -> Result<(), ErrorStack>
+    where
+        T: HasPublic,
+    {
+        unsafe {
+            cvt(ffi::EVP_PKEY_derive_set_peer_ex(
+                self.0,
+                key.as_ptr(),
+                validate_peer as i32,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Returns the size of the shared secret.
+    ///
+    /// It can be used to size the buffer passed to [`Deriver::derive`].
+    ///
+    /// This corresponds to [`EVP_PKEY_derive`].
+    ///
+    /// [`Deriver::derive`]: #method.derive
+    /// [`EVP_PKEY_derive`]: https://www.openssl.org/docs/manmaster/crypto/EVP_PKEY_derive_init.html
+    pub fn len(&mut self) -> Result<usize, ErrorStack> {
+        unsafe {
+            let mut len = 0;
+            cvt(ffi::EVP_PKEY_derive(self.0, ptr::null_mut(), &mut len)).map(|_| len)
+        }
+    }
+
+    /// Derives a shared secret between the two keys, writing it into the buffer.
+    ///
+    /// Returns the number of bytes written.
+    ///
+    /// This corresponds to [`EVP_PKEY_derive`].
+    ///
+    /// [`EVP_PKEY_derive`]: https://www.openssl.org/docs/manmaster/crypto/EVP_PKEY_derive_init.html
+    pub fn derive(&mut self, buf: &mut [u8]) -> Result<usize, ErrorStack> {
+        let mut len = buf.len();
+        unsafe {
+            cvt(ffi::EVP_PKEY_derive(
+                self.0,
+                buf.as_mut_ptr() as *mut _,
+                &mut len,
+            ))
+            .map(|_| len)
+        }
+    }
+
+    /// A convenience function which derives a shared secret and returns it in a new buffer.
+    ///
+    /// This simply wraps [`Deriver::len`] and [`Deriver::derive`].
+    ///
+    /// [`Deriver::len`]: #method.len
+    /// [`Deriver::derive`]: #method.derive
+    pub fn derive_to_vec(&mut self) -> Result<Vec<u8>, ErrorStack> {
+        let len = self.len()?;
+        let mut buf = vec![0; len];
+        let len = self.derive(&mut buf)?;
+        buf.truncate(len);
+        Ok(buf)
+    }
+}
+
+impl<'a> Drop for Deriver<'a> {
+    fn drop(&mut self) {
+        unsafe {
+            ffi::EVP_PKEY_CTX_free(self.0);
+        }
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+
+    use crate::ec::{EcGroup, EcKey};
+    use crate::nid::Nid;
+    use crate::pkey::PKey;
+
+    #[test]
+    fn derive_without_peer() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let ec_key = EcKey::generate(&group).unwrap();
+        let pkey = PKey::from_ec_key(ec_key).unwrap();
+        let mut deriver = Deriver::new(&pkey).unwrap();
+        deriver.derive_to_vec().unwrap_err();
+    }
+
+    #[test]
+    fn test_ec_key_derive() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let ec_key = EcKey::generate(&group).unwrap();
+        let ec_key2 = EcKey::generate(&group).unwrap();
+        let pkey = PKey::from_ec_key(ec_key).unwrap();
+        let pkey2 = PKey::from_ec_key(ec_key2).unwrap();
+        let mut deriver = Deriver::new(&pkey).unwrap();
+        deriver.set_peer(&pkey2).unwrap();
+        let shared = deriver.derive_to_vec().unwrap();
+        assert!(!shared.is_empty());
+    }
+
+    #[test]
+    #[cfg(ossl300)]
+    fn test_ec_key_derive_ex() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let ec_key = EcKey::generate(&group).unwrap();
+        let ec_key2 = EcKey::generate(&group).unwrap();
+        let pkey = PKey::from_ec_key(ec_key).unwrap();
+        let pkey2 = PKey::from_ec_key(ec_key2).unwrap();
+        let mut deriver = Deriver::new(&pkey).unwrap();
+        deriver.set_peer_ex(&pkey2, true).unwrap();
+        let shared = deriver.derive_to_vec().unwrap();
+        assert!(!shared.is_empty());
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/dh.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/dh.rs
--- 43.0.0-1/rust-vendor/openssl/src/dh.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/dh.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,499 @@
+//! Diffie-Hellman key agreement.
+
+use cfg_if::cfg_if;
+use foreign_types::{ForeignType, ForeignTypeRef};
+use std::mem;
+use std::ptr;
+
+use crate::bn::{BigNum, BigNumRef};
+use crate::error::ErrorStack;
+use crate::pkey::{HasParams, HasPrivate, HasPublic, Params, Private, Public};
+use crate::{cvt, cvt_p};
+use openssl_macros::corresponds;
+
+generic_foreign_type_and_impl_send_sync! {
+    type CType = ffi::DH;
+    fn drop = ffi::DH_free;
+
+    pub struct Dh<T>;
+
+    pub struct DhRef<T>;
+}
+
+impl<T> DhRef<T>
+where
+    T: HasParams,
+{
+    to_pem! {
+        /// Serializes the parameters into a PEM-encoded PKCS#3 DHparameter structure.
+        ///
+        /// The output will have a header of `-----BEGIN DH PARAMETERS-----`.
+        #[corresponds(PEM_write_bio_DHparams)]
+        params_to_pem,
+        ffi::PEM_write_bio_DHparams
+    }
+
+    to_der! {
+        /// Serializes the parameters into a DER-encoded PKCS#3 DHparameter structure.
+        #[corresponds(i2d_DHparams)]
+        params_to_der,
+        ffi::i2d_DHparams
+    }
+
+    /// Validates DH parameters for correctness
+    #[corresponds(DH_check_key)]
+    pub fn check_key(&self) -> Result<bool, ErrorStack> {
+        unsafe {
+            let mut codes = 0;
+            cvt(ffi::DH_check(self.as_ptr(), &mut codes))?;
+            Ok(codes == 0)
+        }
+    }
+}
+
+impl Dh<Params> {
+    pub fn from_params(p: BigNum, g: BigNum, q: BigNum) -> Result<Dh<Params>, ErrorStack> {
+        Self::from_pqg(p, Some(q), g)
+    }
+
+    /// Creates a DH instance based upon the given primes and generator params.
+    #[corresponds(DH_set0_pqg)]
+    pub fn from_pqg(
+        prime_p: BigNum,
+        prime_q: Option<BigNum>,
+        generator: BigNum,
+    ) -> Result<Dh<Params>, ErrorStack> {
+        unsafe {
+            let dh = Dh::from_ptr(cvt_p(ffi::DH_new())?);
+            cvt(DH_set0_pqg(
+                dh.0,
+                prime_p.as_ptr(),
+                prime_q.as_ref().map_or(ptr::null_mut(), |q| q.as_ptr()),
+                generator.as_ptr(),
+            ))?;
+            mem::forget((prime_p, prime_q, generator));
+            Ok(dh)
+        }
+    }
+
+    /// Sets the public key on the DH object.
+    pub fn set_public_key(self, pub_key: BigNum) -> Result<Dh<Public>, ErrorStack> {
+        unsafe {
+            let dh_ptr = self.0;
+            cvt(DH_set0_key(dh_ptr, pub_key.as_ptr(), ptr::null_mut()))?;
+            mem::forget((self, pub_key));
+            Ok(Dh::from_ptr(dh_ptr))
+        }
+    }
+
+    /// Sets the private key on the DH object and recomputes the public key.
+    pub fn set_private_key(self, priv_key: BigNum) -> Result<Dh<Private>, ErrorStack> {
+        unsafe {
+            let dh_ptr = self.0;
+            cvt(DH_set0_key(dh_ptr, ptr::null_mut(), priv_key.as_ptr()))?;
+            mem::forget(priv_key);
+
+            cvt(ffi::DH_generate_key(dh_ptr))?;
+            mem::forget(self);
+            Ok(Dh::from_ptr(dh_ptr))
+        }
+    }
+
+    /// Sets the public and private keys on the DH object.
+    pub fn set_key(self, pub_key: BigNum, priv_key: BigNum) -> Result<Dh<Private>, ErrorStack> {
+        unsafe {
+            let dh_ptr = self.0;
+            cvt(DH_set0_key(dh_ptr, pub_key.as_ptr(), priv_key.as_ptr()))?;
+            mem::forget((self, pub_key, priv_key));
+            Ok(Dh::from_ptr(dh_ptr))
+        }
+    }
+
+    /// Generates DH params based on the given `prime_len` and a fixed `generator` value.
+    #[corresponds(DH_generate_parameters_ex)]
+    pub fn generate_params(prime_len: u32, generator: u32) -> Result<Dh<Params>, ErrorStack> {
+        unsafe {
+            let dh = Dh::from_ptr(cvt_p(ffi::DH_new())?);
+            cvt(ffi::DH_generate_parameters_ex(
+                dh.0,
+                prime_len as i32,
+                generator as i32,
+                ptr::null_mut(),
+            ))?;
+            Ok(dh)
+        }
+    }
+
+    /// Generates a public and a private key based on the DH params.
+    #[corresponds(DH_generate_key)]
+    pub fn generate_key(self) -> Result<Dh<Private>, ErrorStack> {
+        unsafe {
+            let dh_ptr = self.0;
+            cvt(ffi::DH_generate_key(dh_ptr))?;
+            mem::forget(self);
+            Ok(Dh::from_ptr(dh_ptr))
+        }
+    }
+
+    from_pem! {
+        /// Deserializes a PEM-encoded PKCS#3 DHpararameters structure.
+        ///
+        /// The input should have a header of `-----BEGIN DH PARAMETERS-----`.
+        #[corresponds(PEM_read_bio_DHparams)]
+        params_from_pem,
+        Dh<Params>,
+        ffi::PEM_read_bio_DHparams
+    }
+
+    from_der! {
+        /// Deserializes a DER-encoded PKCS#3 DHparameters structure.
+        #[corresponds(d2i_DHparams)]
+        params_from_der,
+        Dh<Params>,
+        ffi::d2i_DHparams
+    }
+
+    /// Requires OpenSSL 1.0.2 or newer.
+    #[corresponds(DH_get_1024_160)]
+    #[cfg(any(ossl102, ossl110))]
+    pub fn get_1024_160() -> Result<Dh<Params>, ErrorStack> {
+        unsafe {
+            ffi::init();
+            cvt_p(ffi::DH_get_1024_160()).map(|p| Dh::from_ptr(p))
+        }
+    }
+
+    /// Requires OpenSSL 1.0.2 or newer.
+    #[corresponds(DH_get_2048_224)]
+    #[cfg(any(ossl102, ossl110))]
+    pub fn get_2048_224() -> Result<Dh<Params>, ErrorStack> {
+        unsafe {
+            ffi::init();
+            cvt_p(ffi::DH_get_2048_224()).map(|p| Dh::from_ptr(p))
+        }
+    }
+
+    /// Requires OpenSSL 1.0.2 or newer.
+    #[corresponds(DH_get_2048_256)]
+    #[cfg(any(ossl102, ossl110))]
+    pub fn get_2048_256() -> Result<Dh<Params>, ErrorStack> {
+        unsafe {
+            ffi::init();
+            cvt_p(ffi::DH_get_2048_256()).map(|p| Dh::from_ptr(p))
+        }
+    }
+}
+
+impl<T> Dh<T>
+where
+    T: HasParams,
+{
+    /// Returns the prime `p` from the DH instance.
+    #[corresponds(DH_get0_pqg)]
+    pub fn prime_p(&self) -> &BigNumRef {
+        let mut p = ptr::null();
+        unsafe {
+            DH_get0_pqg(self.as_ptr(), &mut p, ptr::null_mut(), ptr::null_mut());
+            BigNumRef::from_ptr(p as *mut _)
+        }
+    }
+
+    /// Returns the prime `q` from the DH instance.
+    #[corresponds(DH_get0_pqg)]
+    pub fn prime_q(&self) -> Option<&BigNumRef> {
+        let mut q = ptr::null();
+        unsafe {
+            DH_get0_pqg(self.as_ptr(), ptr::null_mut(), &mut q, ptr::null_mut());
+            if q.is_null() {
+                None
+            } else {
+                Some(BigNumRef::from_ptr(q as *mut _))
+            }
+        }
+    }
+
+    /// Returns the generator from the DH instance.
+    #[corresponds(DH_get0_pqg)]
+    pub fn generator(&self) -> &BigNumRef {
+        let mut g = ptr::null();
+        unsafe {
+            DH_get0_pqg(self.as_ptr(), ptr::null_mut(), ptr::null_mut(), &mut g);
+            BigNumRef::from_ptr(g as *mut _)
+        }
+    }
+}
+
+impl<T> DhRef<T>
+where
+    T: HasPublic,
+{
+    /// Returns the public key from the DH instance.
+    #[corresponds(DH_get0_key)]
+    pub fn public_key(&self) -> &BigNumRef {
+        let mut pub_key = ptr::null();
+        unsafe {
+            DH_get0_key(self.as_ptr(), &mut pub_key, ptr::null_mut());
+            BigNumRef::from_ptr(pub_key as *mut _)
+        }
+    }
+}
+
+impl<T> DhRef<T>
+where
+    T: HasPrivate,
+{
+    /// Computes a shared secret from the own private key and the given `public_key`.
+    #[corresponds(DH_compute_key)]
+    pub fn compute_key(&self, public_key: &BigNumRef) -> Result<Vec<u8>, ErrorStack> {
+        unsafe {
+            let key_len = ffi::DH_size(self.as_ptr());
+            let mut key = vec![0u8; key_len as usize];
+            cvt(ffi::DH_compute_key(
+                key.as_mut_ptr(),
+                public_key.as_ptr(),
+                self.as_ptr(),
+            ))?;
+            Ok(key)
+        }
+    }
+
+    /// Returns the private key from the DH instance.
+    #[corresponds(DH_get0_key)]
+    pub fn private_key(&self) -> &BigNumRef {
+        let mut priv_key = ptr::null();
+        unsafe {
+            DH_get0_key(self.as_ptr(), ptr::null_mut(), &mut priv_key);
+            BigNumRef::from_ptr(priv_key as *mut _)
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl270, boringssl))] {
+        use ffi::{DH_set0_pqg, DH_get0_pqg, DH_get0_key, DH_set0_key};
+    } else {
+        #[allow(bad_style)]
+        unsafe fn DH_set0_pqg(
+            dh: *mut ffi::DH,
+            p: *mut ffi::BIGNUM,
+            q: *mut ffi::BIGNUM,
+            g: *mut ffi::BIGNUM,
+        ) -> ::libc::c_int {
+            (*dh).p = p;
+            (*dh).q = q;
+            (*dh).g = g;
+            1
+        }
+
+        #[allow(bad_style)]
+        unsafe fn DH_get0_pqg(
+            dh: *mut ffi::DH,
+            p: *mut *const ffi::BIGNUM,
+            q: *mut *const ffi::BIGNUM,
+            g: *mut *const ffi::BIGNUM,
+        ) {
+            if !p.is_null() {
+                *p = (*dh).p;
+            }
+            if !q.is_null() {
+                *q = (*dh).q;
+            }
+            if !g.is_null() {
+                *g = (*dh).g;
+            }
+        }
+
+        #[allow(bad_style)]
+        unsafe fn DH_set0_key(
+            dh: *mut ffi::DH,
+            pub_key: *mut ffi::BIGNUM,
+            priv_key: *mut ffi::BIGNUM,
+        ) -> ::libc::c_int {
+            (*dh).pub_key = pub_key;
+            (*dh).priv_key = priv_key;
+            1
+        }
+
+        #[allow(bad_style)]
+        unsafe fn DH_get0_key(
+            dh: *mut ffi::DH,
+            pub_key: *mut *const ffi::BIGNUM,
+            priv_key: *mut *const ffi::BIGNUM,
+        ) {
+            if !pub_key.is_null() {
+                *pub_key = (*dh).pub_key;
+            }
+            if !priv_key.is_null() {
+                *priv_key = (*dh).priv_key;
+            }
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::bn::BigNum;
+    use crate::dh::Dh;
+    #[cfg(all(not(boringssl), ossl110))]
+    use crate::pkey::PKey;
+    use crate::ssl::{SslContext, SslMethod};
+
+    #[test]
+    #[cfg(ossl102)]
+    fn test_dh_rfc5114() {
+        let mut ctx = SslContext::builder(SslMethod::tls()).unwrap();
+        let dh2 = Dh::get_2048_224().unwrap();
+        ctx.set_tmp_dh(&dh2).unwrap();
+        let dh3 = Dh::get_2048_256().unwrap();
+        ctx.set_tmp_dh(&dh3).unwrap();
+    }
+
+    #[test]
+    fn test_dh_params() {
+        let mut ctx = SslContext::builder(SslMethod::tls()).unwrap();
+        let prime_p = BigNum::from_hex_str(
+            "87A8E61DB4B6663CFFBBD19C651959998CEEF608660DD0F25D2CEED4435E3B00E00DF8F1D61957D4FAF7DF\
+             4561B2AA3016C3D91134096FAA3BF4296D830E9A7C209E0C6497517ABD5A8A9D306BCF67ED91F9E6725B47\
+             58C022E0B1EF4275BF7B6C5BFC11D45F9088B941F54EB1E59BB8BC39A0BF12307F5C4FDB70C581B23F76B6\
+             3ACAE1CAA6B7902D52526735488A0EF13C6D9A51BFA4AB3AD8347796524D8EF6A167B5A41825D967E144E5\
+             140564251CCACB83E6B486F6B3CA3F7971506026C0B857F689962856DED4010ABD0BE621C3A3960A54E710\
+             C375F26375D7014103A4B54330C198AF126116D2276E11715F693877FAD7EF09CADB094AE91E1A1597",
+        ).unwrap();
+        let prime_q = BigNum::from_hex_str(
+            "3FB32C9B73134D0B2E77506660EDBD484CA7B18F21EF205407F4793A1A0BA12510DBC15077BE463FFF4FED\
+             4AAC0BB555BE3A6C1B0C6B47B1BC3773BF7E8C6F62901228F8C28CBB18A55AE31341000A650196F931C77A\
+             57F2DDF463E5E9EC144B777DE62AAAB8A8628AC376D282D6ED3864E67982428EBC831D14348F6F2F9193B5\
+             045AF2767164E1DFC967C1FB3F2E55A4BD1BFFE83B9C80D052B985D182EA0ADB2A3B7313D3FE14C8484B1E\
+             052588B9B7D2BBD2DF016199ECD06E1557CD0915B3353BBB64E0EC377FD028370DF92B52C7891428CDC67E\
+             B6184B523D1DB246C32F63078490F00EF8D647D148D47954515E2327CFEF98C582664B4C0F6CC41659",
+        ).unwrap();
+        let generator = BigNum::from_hex_str(
+            "8CF83642A709A097B447997640129DA299B1A47D1EB3750BA308B0FE64F5FBD3",
+        )
+        .unwrap();
+        let dh = Dh::from_params(
+            prime_p.to_owned().unwrap(),
+            generator.to_owned().unwrap(),
+            prime_q.to_owned().unwrap(),
+        )
+        .unwrap();
+        ctx.set_tmp_dh(&dh).unwrap();
+
+        assert_eq!(dh.prime_p(), &prime_p);
+        assert_eq!(dh.prime_q().unwrap(), &prime_q);
+        assert_eq!(dh.generator(), &generator);
+    }
+
+    #[test]
+    #[cfg(all(not(boringssl), ossl110))]
+    fn test_from_dhx_serializes_q() {
+        let p = BigNum::from_hex_str("00ad107e1e9123a9d0d660faa79559c51fa20d64e5683b9fd1b54b1597b61d0a75e6fa141df95a56dbaf9a3c407ba1df15eb3d688a309c180e1de6b85a1274a0a66d3f8152ad6ac2129037c9edefda4df8d91e8fef55b7394b7ad5b7d0b6c12207c9f98d11ed34dbf6c6ba0b2c8bbc27be6a00e0a0b9c49708b3bf8a317091883681286130bc8985db1602e714415d9330278273c7de31efdc7310f7121fd5a07415987d9adc0a486dcdf93acc44328387315d75e198c641a480cd86a1b9e587e8be60e69cc928b2b9c52172e413042e9b23f10b0e16e79763c9b53dcf4ba80a29e3fb73c16b8e75b97ef363e2ffa31f71cf9de5384e71b81c0ac4dffe0c10e64f").unwrap();
+        let g = BigNum::from_hex_str("00ac4032ef4f2d9ae39df30b5c8ffdac506cdebe7b89998caf74866a08cfe4ffe3a6824a4e10b9a6f0dd921f01a70c4afaab739d7700c29f52c57db17c620a8652be5e9001a8d66ad7c17669101999024af4d027275ac1348bb8a762d0521bc98ae247150422ea1ed409939d54da7460cdb5f6c6b250717cbef180eb34118e98d119529a45d6f834566e3025e316a330efbb77a86f0c1ab15b051ae3d428c8f8acb70a8137150b8eeb10e183edd19963ddd9e263e4770589ef6aa21e7f5f2ff381b539cce3409d13cd566afbb48d6c019181e1bcfe94b30269edfe72fe9b6aa4bd7b5a0f1c71cfff4c19c418e1f6ec017981bc087f2a7065b384b890d3191f2bfa").unwrap();
+        let q = BigNum::from_hex_str("00801c0d34c58d93fe997177101f80535a4738cebcbf389a99b36371eb")
+            .unwrap();
+        let y = BigNum::from_hex_str("0082c165bb576243ecf46d58c3d1501616955fca0320fa95ea11d2e6c1b9cf217676720dc1c08c85bf20c4d232b60a29a1e51c7b773bc645014587c525c86151b30d75486ec7b6c98efb5f74955b83116d01d0af1232af89213c2de574369d701aba9357300b920d3d8b98252d46c46952c16a5f33554b38317809c7b9add4701f5c158c1b7035e9fe39366ececb90d2896b78c523c4a577287ef5ba7a2663ed58aa20b5ec66e30f316610dfaa38583e495ab6af771c284387e660edbef4edb872e2e80e1d244ee95622e76d028e61c1e887c2aa792717362139f4dd26eafd49b2366eeb2350b01fe1b56022a2809e379559c37b375ba01c4eaacc14fd1b247837").unwrap();
+
+        let dh = Dh::from_params(p, g, q).unwrap();
+        let dh = dh.set_public_key(y).unwrap();
+
+        // Verify that 'q' is serialized in the public key.
+        let pkey = PKey::from_dhx(dh).unwrap();
+        assert_eq!(pkey.public_key_to_der().unwrap(), b"\x30\x82\x03\x44\x30\x82\x02\x36\x06\x07\x2a\x86\x48\xce\x3e\x02\x01\x30\x82\x02\x29\x02\x82\x01\x01\x00\xad\x10\x7e\x1e\x91\x23\xa9\xd0\xd6\x60\xfa\xa7\x95\x59\xc5\x1f\xa2\x0d\x64\xe5\x68\x3b\x9f\xd1\xb5\x4b\x15\x97\xb6\x1d\x0a\x75\xe6\xfa\x14\x1d\xf9\x5a\x56\xdb\xaf\x9a\x3c\x40\x7b\xa1\xdf\x15\xeb\x3d\x68\x8a\x30\x9c\x18\x0e\x1d\xe6\xb8\x5a\x12\x74\xa0\xa6\x6d\x3f\x81\x52\xad\x6a\xc2\x12\x90\x37\xc9\xed\xef\xda\x4d\xf8\xd9\x1e\x8f\xef\x55\xb7\x39\x4b\x7a\xd5\xb7\xd0\xb6\xc1\x22\x07\xc9\xf9\x8d\x11\xed\x34\xdb\xf6\xc6\xba\x0b\x2c\x8b\xbc\x27\xbe\x6a\x00\xe0\xa0\xb9\xc4\x97\x08\xb3\xbf\x8a\x31\x70\x91\x88\x36\x81\x28\x61\x30\xbc\x89\x85\xdb\x16\x02\xe7\x14\x41\x5d\x93\x30\x27\x82\x73\xc7\xde\x31\xef\xdc\x73\x10\xf7\x12\x1f\xd5\xa0\x74\x15\x98\x7d\x9a\xdc\x0a\x48\x6d\xcd\xf9\x3a\xcc\x44\x32\x83\x87\x31\x5d\x75\xe1\x98\xc6\x41\xa4\x80\xcd\x86\xa1\xb9\xe5\x87\xe8\xbe\x60\xe6\x9c\xc9\x28\xb2\xb9\xc5\x21\x72\xe4\x13\x04\x2e\x9b\x23\xf1\x0b\x0e\x16\xe7\x97\x63\xc9\xb5\x3d\xcf\x4b\xa8\x0a\x29\xe3\xfb\x73\xc1\x6b\x8e\x75\xb9\x7e\xf3\x63\xe2\xff\xa3\x1f\x71\xcf\x9d\xe5\x38\x4e\x71\xb8\x1c\x0a\xc4\xdf\xfe\x0c\x10\xe6\x4f\x02\x82\x01\x01\x00\xac\x40\x32\xef\x4f\x2d\x9a\xe3\x9d\xf3\x0b\x5c\x8f\xfd\xac\x50\x6c\xde\xbe\x7b\x89\x99\x8c\xaf\x74\x86\x6a\x08\xcf\xe4\xff\xe3\xa6\x82\x4a\x4e\x10\xb9\xa6\xf0\xdd\x92\x1f\x01\xa7\x0c\x4a\xfa\xab\x73\x9d\x77\x00\xc2\x9f\x52\xc5\x7d\xb1\x7c\x62\x0a\x86\x52\xbe\x5e\x90\x01\xa8\xd6\x6a\xd7\xc1\x76\x69\x10\x19\x99\x02\x4a\xf4\xd0\x27\x27\x5a\xc1\x34\x8b\xb8\xa7\x62\xd0\x52\x1b\xc9\x8a\xe2\x47\x15\x04\x22\xea\x1e\xd4\x09\x93\x9d\x54\xda\x74\x60\xcd\xb5\xf6\xc6\xb2\x50\x71\x7c\xbe\xf1\x80\xeb\x34\x11\x8e\x98\xd1\x19\x52\x9a\x45\xd6\xf8\x34\x56\x6e\x30\x25\xe3\x16\xa3\x30\xef\xbb\x77\xa8\x6f\x0c\x1a\xb1\x5b\x05\x1a\xe3\xd4\x28\xc8\xf8\xac\xb7\x0a\x81\x37\x15\x0b\x8e\xeb\x10\xe1\x83\xed\xd1\x99\x63\xdd\xd9\xe2\x63\xe4\x77\x05\x89\xef\x6a\xa2\x1e\x7f\x5f\x2f\xf3\x81\xb5\x39\xcc\xe3\x40\x9d\x13\xcd\x56\x6a\xfb\xb4\x8d\x6c\x01\x91\x81\xe1\xbc\xfe\x94\xb3\x02\x69\xed\xfe\x72\xfe\x9b\x6a\xa4\xbd\x7b\x5a\x0f\x1c\x71\xcf\xff\x4c\x19\xc4\x18\xe1\xf6\xec\x01\x79\x81\xbc\x08\x7f\x2a\x70\x65\xb3\x84\xb8\x90\xd3\x19\x1f\x2b\xfa\x02\x1d\x00\x80\x1c\x0d\x34\xc5\x8d\x93\xfe\x99\x71\x77\x10\x1f\x80\x53\x5a\x47\x38\xce\xbc\xbf\x38\x9a\x99\xb3\x63\x71\xeb\x03\x82\x01\x06\x00\x02\x82\x01\x01\x00\x82\xc1\x65\xbb\x57\x62\x43\xec\xf4\x6d\x58\xc3\xd1\x50\x16\x16\x95\x5f\xca\x03\x20\xfa\x95\xea\x11\xd2\xe6\xc1\xb9\xcf\x21\x76\x76\x72\x0d\xc1\xc0\x8c\x85\xbf\x20\xc4\xd2\x32\xb6\x0a\x29\xa1\xe5\x1c\x7b\x77\x3b\xc6\x45\x01\x45\x87\xc5\x25\xc8\x61\x51\xb3\x0d\x75\x48\x6e\xc7\xb6\xc9\x8e\xfb\x5f\x74\x95\x5b\x83\x11\x6d\x01\xd0\xaf\x12\x32\xaf\x89\x21\x3c\x2d\xe5\x74\x36\x9d\x70\x1a\xba\x93\x57\x30\x0b\x92\x0d\x3d\x8b\x98\x25\x2d\x46\xc4\x69\x52\xc1\x6a\x5f\x33\x55\x4b\x38\x31\x78\x09\xc7\xb9\xad\xd4\x70\x1f\x5c\x15\x8c\x1b\x70\x35\xe9\xfe\x39\x36\x6e\xce\xcb\x90\xd2\x89\x6b\x78\xc5\x23\xc4\xa5\x77\x28\x7e\xf5\xba\x7a\x26\x63\xed\x58\xaa\x20\xb5\xec\x66\xe3\x0f\x31\x66\x10\xdf\xaa\x38\x58\x3e\x49\x5a\xb6\xaf\x77\x1c\x28\x43\x87\xe6\x60\xed\xbe\xf4\xed\xb8\x72\xe2\xe8\x0e\x1d\x24\x4e\xe9\x56\x22\xe7\x6d\x02\x8e\x61\xc1\xe8\x87\xc2\xaa\x79\x27\x17\x36\x21\x39\xf4\xdd\x26\xea\xfd\x49\xb2\x36\x6e\xeb\x23\x50\xb0\x1f\xe1\xb5\x60\x22\xa2\x80\x9e\x37\x95\x59\xc3\x7b\x37\x5b\xa0\x1c\x4e\xaa\xcc\x14\xfd\x1b\x24\x78\x37");
+    }
+
+    #[test]
+    #[cfg(ossl102)]
+    fn test_dh_stored_restored() {
+        let dh1 = Dh::get_2048_256().unwrap();
+        let key1 = dh1.generate_key().unwrap();
+
+        let dh2 = Dh::get_2048_256().unwrap();
+        let key2 = dh2
+            .set_private_key(key1.private_key().to_owned().unwrap())
+            .unwrap();
+
+        assert_eq!(key1.public_key(), key2.public_key());
+        assert_eq!(key1.private_key(), key2.private_key());
+    }
+
+    #[test]
+    #[cfg(ossl102)]
+    fn test_set_keys() {
+        let dh1 = Dh::get_2048_256().unwrap();
+        let key1 = dh1.generate_key().unwrap();
+
+        let dh2 = Dh::get_2048_256().unwrap();
+        let key2 = dh2
+            .set_public_key(key1.public_key().to_owned().unwrap())
+            .unwrap();
+
+        assert_eq!(key1.public_key(), key2.public_key());
+
+        let dh3 = Dh::get_2048_256().unwrap();
+        let key3 = dh3
+            .set_key(
+                key1.public_key().to_owned().unwrap(),
+                key1.private_key().to_owned().unwrap(),
+            )
+            .unwrap();
+        assert_eq!(key1.public_key(), key3.public_key());
+        assert_eq!(key1.private_key(), key3.private_key());
+    }
+
+    #[test]
+    fn test_dh_from_pem() {
+        let mut ctx = SslContext::builder(SslMethod::tls()).unwrap();
+        let params = include_bytes!("../test/dhparams.pem");
+        let dh = Dh::params_from_pem(params).unwrap();
+        ctx.set_tmp_dh(&dh).unwrap();
+    }
+
+    #[test]
+    fn test_dh_from_der() {
+        let params = include_bytes!("../test/dhparams.pem");
+        let dh = Dh::params_from_pem(params).unwrap();
+        let der = dh.params_to_der().unwrap();
+        Dh::params_from_der(&der).unwrap();
+    }
+
+    #[test]
+    #[cfg(ossl102)]
+    fn test_dh_generate_key_compute_key() {
+        let dh1 = Dh::get_2048_224().unwrap().generate_key().unwrap();
+        let dh2 = Dh::get_2048_224().unwrap().generate_key().unwrap();
+
+        let shared_a = dh1.compute_key(dh2.public_key()).unwrap();
+        let shared_b = dh2.compute_key(dh1.public_key()).unwrap();
+
+        assert_eq!(shared_a, shared_b);
+    }
+
+    #[test]
+    fn test_dh_generate_params_generate_key_compute_key() {
+        let dh_params1 = Dh::generate_params(512, 2).unwrap();
+        let dh_params2 = Dh::from_pqg(
+            dh_params1.prime_p().to_owned().unwrap(),
+            None,
+            dh_params1.generator().to_owned().unwrap(),
+        )
+        .unwrap();
+
+        let dh1 = dh_params1.generate_key().unwrap();
+        let dh2 = dh_params2.generate_key().unwrap();
+
+        let shared_a = dh1.compute_key(dh2.public_key()).unwrap();
+        let shared_b = dh2.compute_key(dh1.public_key()).unwrap();
+
+        assert_eq!(shared_a, shared_b);
+    }
+
+    #[test]
+    fn test_dh_check_key() {
+        let dh1 = Dh::generate_params(512, 2).unwrap();
+        let p = BigNum::from_hex_str("04").unwrap();
+        let g = BigNum::from_hex_str("02").unwrap();
+        let dh2 = Dh::from_pqg(p, None, g).unwrap();
+        assert!(dh1.check_key().unwrap());
+        assert!(matches!(dh2.check_key(), Ok(false) | Err(_)));
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/dsa.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/dsa.rs
--- 43.0.0-1/rust-vendor/openssl/src/dsa.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/dsa.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,697 @@
+//! Digital Signatures
+//!
+//! DSA ensures a message originated from a known sender, and was not modified.
+//! DSA uses asymmetrical keys and an algorithm to output a signature of the message
+//! using the private key that can be validated with the public key but not be generated
+//! without the private key.
+
+use cfg_if::cfg_if;
+use foreign_types::{ForeignType, ForeignTypeRef};
+#[cfg(not(boringssl))]
+use libc::c_int;
+use std::fmt;
+use std::mem;
+use std::ptr;
+
+use crate::bn::{BigNum, BigNumRef};
+use crate::error::ErrorStack;
+use crate::pkey::{HasParams, HasPrivate, HasPublic, Params, Private, Public};
+use crate::util::ForeignTypeRefExt;
+use crate::{cvt, cvt_p};
+use openssl_macros::corresponds;
+
+generic_foreign_type_and_impl_send_sync! {
+    type CType = ffi::DSA;
+    fn drop = ffi::DSA_free;
+
+    /// Object representing DSA keys.
+    ///
+    /// A DSA object contains the parameters p, q, and g.  There is a private
+    /// and public key.  The values p, g, and q are:
+    ///
+    /// * `p`: DSA prime parameter
+    /// * `q`: DSA sub-prime parameter
+    /// * `g`: DSA base parameter
+    ///
+    /// These values are used to calculate a pair of asymmetrical keys used for
+    /// signing.
+    ///
+    /// OpenSSL documentation at [`DSA_new`]
+    ///
+    /// [`DSA_new`]: https://www.openssl.org/docs/manmaster/crypto/DSA_new.html
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use openssl::dsa::Dsa;
+    /// use openssl::error::ErrorStack;
+    /// use openssl::pkey::Private;
+    ///
+    /// fn create_dsa() -> Result<Dsa<Private>, ErrorStack> {
+    ///     let sign = Dsa::generate(2048)?;
+    ///     Ok(sign)
+    /// }
+    /// # fn main() {
+    /// #    create_dsa();
+    /// # }
+    /// ```
+    pub struct Dsa<T>;
+    /// Reference to [`Dsa`].
+    ///
+    /// [`Dsa`]: struct.Dsa.html
+    pub struct DsaRef<T>;
+}
+
+impl<T> Clone for Dsa<T> {
+    fn clone(&self) -> Dsa<T> {
+        (**self).to_owned()
+    }
+}
+
+impl<T> ToOwned for DsaRef<T> {
+    type Owned = Dsa<T>;
+
+    fn to_owned(&self) -> Dsa<T> {
+        unsafe {
+            ffi::DSA_up_ref(self.as_ptr());
+            Dsa::from_ptr(self.as_ptr())
+        }
+    }
+}
+
+impl<T> DsaRef<T>
+where
+    T: HasPublic,
+{
+    to_pem! {
+        /// Serializes the public key into a PEM-encoded SubjectPublicKeyInfo structure.
+        ///
+        /// The output will have a header of `-----BEGIN PUBLIC KEY-----`.
+        #[corresponds(PEM_write_bio_DSA_PUBKEY)]
+        public_key_to_pem,
+        ffi::PEM_write_bio_DSA_PUBKEY
+    }
+
+    to_der! {
+        /// Serializes the public key into a DER-encoded SubjectPublicKeyInfo structure.
+        #[corresponds(i2d_DSA_PUBKEY)]
+        public_key_to_der,
+        ffi::i2d_DSA_PUBKEY
+    }
+
+    /// Returns a reference to the public key component of `self`.
+    #[corresponds(DSA_get0_key)]
+    pub fn pub_key(&self) -> &BigNumRef {
+        unsafe {
+            let mut pub_key = ptr::null();
+            DSA_get0_key(self.as_ptr(), &mut pub_key, ptr::null_mut());
+            BigNumRef::from_const_ptr(pub_key)
+        }
+    }
+}
+
+impl<T> DsaRef<T>
+where
+    T: HasPrivate,
+{
+    private_key_to_pem! {
+        /// Serializes the private key to a PEM-encoded DSAPrivateKey structure.
+        ///
+        /// The output will have a header of `-----BEGIN DSA PRIVATE KEY-----`.
+        #[corresponds(PEM_write_bio_DSAPrivateKey)]
+        private_key_to_pem,
+        /// Serializes the private key to a PEM-encoded encrypted DSAPrivateKey structure.
+        ///
+        /// The output will have a header of `-----BEGIN DSA PRIVATE KEY-----`.
+        #[corresponds(PEM_write_bio_DSAPrivateKey)]
+        private_key_to_pem_passphrase,
+        ffi::PEM_write_bio_DSAPrivateKey
+    }
+
+    to_der! {
+        /// Serializes the private_key to a DER-encoded `DSAPrivateKey` structure.
+        #[corresponds(i2d_DSAPrivateKey)]
+        private_key_to_der,
+        ffi::i2d_DSAPrivateKey
+    }
+
+    /// Returns a reference to the private key component of `self`.
+    #[corresponds(DSA_get0_key)]
+    pub fn priv_key(&self) -> &BigNumRef {
+        unsafe {
+            let mut priv_key = ptr::null();
+            DSA_get0_key(self.as_ptr(), ptr::null_mut(), &mut priv_key);
+            BigNumRef::from_const_ptr(priv_key)
+        }
+    }
+}
+
+impl<T> DsaRef<T>
+where
+    T: HasParams,
+{
+    /// Returns the maximum size of the signature output by `self` in bytes.
+    #[corresponds(DSA_size)]
+    pub fn size(&self) -> u32 {
+        unsafe { ffi::DSA_size(self.as_ptr()) as u32 }
+    }
+
+    /// Returns the DSA prime parameter of `self`.
+    #[corresponds(DSA_get0_pqg)]
+    pub fn p(&self) -> &BigNumRef {
+        unsafe {
+            let mut p = ptr::null();
+            DSA_get0_pqg(self.as_ptr(), &mut p, ptr::null_mut(), ptr::null_mut());
+            BigNumRef::from_const_ptr(p)
+        }
+    }
+
+    /// Returns the DSA sub-prime parameter of `self`.
+    #[corresponds(DSA_get0_pqg)]
+    pub fn q(&self) -> &BigNumRef {
+        unsafe {
+            let mut q = ptr::null();
+            DSA_get0_pqg(self.as_ptr(), ptr::null_mut(), &mut q, ptr::null_mut());
+            BigNumRef::from_const_ptr(q)
+        }
+    }
+
+    /// Returns the DSA base parameter of `self`.
+    #[corresponds(DSA_get0_pqg)]
+    pub fn g(&self) -> &BigNumRef {
+        unsafe {
+            let mut g = ptr::null();
+            DSA_get0_pqg(self.as_ptr(), ptr::null_mut(), ptr::null_mut(), &mut g);
+            BigNumRef::from_const_ptr(g)
+        }
+    }
+}
+#[cfg(boringssl)]
+type BitType = libc::c_uint;
+#[cfg(not(boringssl))]
+type BitType = c_int;
+
+impl Dsa<Params> {
+    /// Creates a DSA params based upon the given parameters.
+    #[corresponds(DSA_set0_pqg)]
+    pub fn from_pqg(p: BigNum, q: BigNum, g: BigNum) -> Result<Dsa<Params>, ErrorStack> {
+        unsafe {
+            let dsa = Dsa::from_ptr(cvt_p(ffi::DSA_new())?);
+            cvt(DSA_set0_pqg(dsa.0, p.as_ptr(), q.as_ptr(), g.as_ptr()))?;
+            mem::forget((p, q, g));
+            Ok(dsa)
+        }
+    }
+
+    /// Generates DSA params based on the given number of bits.
+    #[corresponds(DSA_generate_parameters_ex)]
+    pub fn generate_params(bits: u32) -> Result<Dsa<Params>, ErrorStack> {
+        ffi::init();
+        unsafe {
+            let dsa = Dsa::from_ptr(cvt_p(ffi::DSA_new())?);
+            cvt(ffi::DSA_generate_parameters_ex(
+                dsa.0,
+                bits as BitType,
+                ptr::null(),
+                0,
+                ptr::null_mut(),
+                ptr::null_mut(),
+                ptr::null_mut(),
+            ))?;
+            Ok(dsa)
+        }
+    }
+
+    /// Generates a private key based on the DSA params.
+    #[corresponds(DSA_generate_key)]
+    pub fn generate_key(self) -> Result<Dsa<Private>, ErrorStack> {
+        unsafe {
+            let dsa_ptr = self.0;
+            cvt(ffi::DSA_generate_key(dsa_ptr))?;
+            mem::forget(self);
+            Ok(Dsa::from_ptr(dsa_ptr))
+        }
+    }
+}
+
+impl Dsa<Private> {
+    /// Generate a DSA key pair.
+    ///
+    /// The `bits` parameter corresponds to the length of the prime `p`.
+    pub fn generate(bits: u32) -> Result<Dsa<Private>, ErrorStack> {
+        let params = Dsa::generate_params(bits)?;
+        params.generate_key()
+    }
+
+    /// Create a DSA key pair with the given parameters
+    ///
+    /// `p`, `q` and `g` are the common parameters.
+    /// `priv_key` is the private component of the key pair.
+    /// `pub_key` is the public component of the key. Can be computed via `g^(priv_key) mod p`
+    pub fn from_private_components(
+        p: BigNum,
+        q: BigNum,
+        g: BigNum,
+        priv_key: BigNum,
+        pub_key: BigNum,
+    ) -> Result<Dsa<Private>, ErrorStack> {
+        ffi::init();
+        unsafe {
+            let dsa = Dsa::from_ptr(cvt_p(ffi::DSA_new())?);
+            cvt(DSA_set0_pqg(dsa.0, p.as_ptr(), q.as_ptr(), g.as_ptr()))?;
+            mem::forget((p, q, g));
+            cvt(DSA_set0_key(dsa.0, pub_key.as_ptr(), priv_key.as_ptr()))?;
+            mem::forget((pub_key, priv_key));
+            Ok(dsa)
+        }
+    }
+}
+
+impl Dsa<Public> {
+    from_pem! {
+        /// Decodes a PEM-encoded SubjectPublicKeyInfo structure containing a DSA key.
+        ///
+        /// The input should have a header of `-----BEGIN PUBLIC KEY-----`.
+        #[corresponds(PEM_read_bio_DSA_PUBKEY)]
+        public_key_from_pem,
+        Dsa<Public>,
+        ffi::PEM_read_bio_DSA_PUBKEY
+    }
+
+    from_der! {
+        /// Decodes a DER-encoded SubjectPublicKeyInfo structure containing a DSA key.
+        #[corresponds(d2i_DSA_PUBKEY)]
+        public_key_from_der,
+        Dsa<Public>,
+        ffi::d2i_DSA_PUBKEY
+    }
+
+    /// Create a new DSA key with only public components.
+    ///
+    /// `p`, `q` and `g` are the common parameters.
+    /// `pub_key` is the public component of the key.
+    pub fn from_public_components(
+        p: BigNum,
+        q: BigNum,
+        g: BigNum,
+        pub_key: BigNum,
+    ) -> Result<Dsa<Public>, ErrorStack> {
+        ffi::init();
+        unsafe {
+            let dsa = Dsa::from_ptr(cvt_p(ffi::DSA_new())?);
+            cvt(DSA_set0_pqg(dsa.0, p.as_ptr(), q.as_ptr(), g.as_ptr()))?;
+            mem::forget((p, q, g));
+            cvt(DSA_set0_key(dsa.0, pub_key.as_ptr(), ptr::null_mut()))?;
+            mem::forget(pub_key);
+            Ok(dsa)
+        }
+    }
+}
+
+impl<T> fmt::Debug for Dsa<T> {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        write!(f, "DSA")
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl273, boringssl))] {
+        use ffi::{DSA_get0_key, DSA_get0_pqg, DSA_set0_key, DSA_set0_pqg};
+    } else {
+        #[allow(bad_style)]
+        unsafe fn DSA_get0_pqg(
+            d: *mut ffi::DSA,
+            p: *mut *const ffi::BIGNUM,
+            q: *mut *const ffi::BIGNUM,
+            g: *mut *const ffi::BIGNUM)
+        {
+            if !p.is_null() {
+                *p = (*d).p;
+            }
+            if !q.is_null() {
+                *q = (*d).q;
+            }
+            if !g.is_null() {
+                *g = (*d).g;
+            }
+        }
+
+        #[allow(bad_style)]
+        unsafe fn DSA_get0_key(
+            d: *mut ffi::DSA,
+            pub_key: *mut *const ffi::BIGNUM,
+            priv_key: *mut *const ffi::BIGNUM)
+        {
+            if !pub_key.is_null() {
+                *pub_key = (*d).pub_key;
+            }
+            if !priv_key.is_null() {
+                *priv_key = (*d).priv_key;
+            }
+        }
+
+        #[allow(bad_style)]
+        unsafe fn DSA_set0_key(
+            d: *mut ffi::DSA,
+            pub_key: *mut ffi::BIGNUM,
+            priv_key: *mut ffi::BIGNUM) -> c_int
+        {
+            (*d).pub_key = pub_key;
+            (*d).priv_key = priv_key;
+            1
+        }
+
+        #[allow(bad_style)]
+        unsafe fn DSA_set0_pqg(
+            d: *mut ffi::DSA,
+            p: *mut ffi::BIGNUM,
+            q: *mut ffi::BIGNUM,
+            g: *mut ffi::BIGNUM) -> c_int
+        {
+            (*d).p = p;
+            (*d).q = q;
+            (*d).g = g;
+            1
+        }
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::DSA_SIG;
+    fn drop = ffi::DSA_SIG_free;
+
+    /// Object representing DSA signature.
+    ///
+    /// DSA signatures consist of two components: `r` and `s`.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::convert::TryInto;
+    ///
+    /// use openssl::bn::BigNum;
+    /// use openssl::dsa::{Dsa, DsaSig};
+    /// use openssl::hash::MessageDigest;
+    /// use openssl::pkey::PKey;
+    /// use openssl::sign::{Signer, Verifier};
+    ///
+    /// const TEST_DATA: &[u8] = &[0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
+    /// let dsa_ref = Dsa::generate(1024).unwrap();
+    ///
+    /// let pub_key: PKey<_> = dsa_ref.clone().try_into().unwrap();
+    /// let priv_key: PKey<_> = dsa_ref.try_into().unwrap();
+    ///
+    /// let mut signer = if let Ok(signer) = Signer::new(MessageDigest::sha256(), &priv_key) {
+    ///     signer
+    /// } else {
+    ///     // DSA signing is not supported (eg. BoringSSL)
+    ///     return;
+    /// };
+    ///
+    /// signer.update(TEST_DATA).unwrap();
+    ///
+    /// let signature = signer.sign_to_vec().unwrap();
+    /// // Parse DER-encoded DSA signature
+    /// let signature = DsaSig::from_der(&signature).unwrap();
+    ///
+    /// // Extract components `r` and `s`
+    /// let r = BigNum::from_slice(&signature.r().to_vec()).unwrap();
+    /// let s = BigNum::from_slice(&signature.s().to_vec()).unwrap();
+    ///
+    /// // Construct new DSA signature from components
+    /// let signature = DsaSig::from_private_components(r, s).unwrap();
+    ///
+    /// // Serialize DSA signature to DER
+    /// let signature = signature.to_der().unwrap();
+    ///
+    /// let mut verifier = Verifier::new(MessageDigest::sha256(), &pub_key).unwrap();
+    /// verifier.update(TEST_DATA).unwrap();
+    /// assert!(verifier.verify(&signature[..]).unwrap());
+    /// ```
+    pub struct DsaSig;
+
+    /// Reference to a [`DsaSig`].
+    pub struct DsaSigRef;
+}
+
+impl DsaSig {
+    /// Returns a new `DsaSig` by setting the `r` and `s` values associated with an DSA signature.
+    #[corresponds(DSA_SIG_set0)]
+    pub fn from_private_components(r: BigNum, s: BigNum) -> Result<Self, ErrorStack> {
+        unsafe {
+            let sig = cvt_p(ffi::DSA_SIG_new())?;
+            DSA_SIG_set0(sig, r.as_ptr(), s.as_ptr());
+            mem::forget((r, s));
+            Ok(DsaSig::from_ptr(sig))
+        }
+    }
+
+    from_der! {
+        /// Decodes a DER-encoded DSA signature.
+        #[corresponds(d2i_DSA_SIG)]
+        from_der,
+        DsaSig,
+        ffi::d2i_DSA_SIG
+    }
+}
+
+impl fmt::Debug for DsaSig {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.debug_struct("DsaSig")
+            .field("r", self.r())
+            .field("s", self.s())
+            .finish()
+    }
+}
+
+impl DsaSigRef {
+    to_der! {
+        /// Serializes the DSA signature into a DER-encoded `DSASignature` structure.
+        #[corresponds(i2d_DSA_SIG)]
+        to_der,
+        ffi::i2d_DSA_SIG
+    }
+
+    /// Returns internal component `r` of an `DsaSig`.
+    #[corresponds(DSA_SIG_get0)]
+    pub fn r(&self) -> &BigNumRef {
+        unsafe {
+            let mut r = ptr::null();
+            DSA_SIG_get0(self.as_ptr(), &mut r, ptr::null_mut());
+            BigNumRef::from_const_ptr(r)
+        }
+    }
+
+    /// Returns internal component `s` of an `DsaSig`.
+    #[corresponds(DSA_SIG_get0)]
+    pub fn s(&self) -> &BigNumRef {
+        unsafe {
+            let mut s = ptr::null();
+            DSA_SIG_get0(self.as_ptr(), ptr::null_mut(), &mut s);
+            BigNumRef::from_const_ptr(s)
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl273, boringssl))] {
+        use ffi::{DSA_SIG_set0, DSA_SIG_get0};
+    } else {
+        #[allow(bad_style)]
+        unsafe fn DSA_SIG_set0(
+            sig: *mut ffi::DSA_SIG,
+            r: *mut ffi::BIGNUM,
+            s: *mut ffi::BIGNUM,
+        ) -> c_int {
+            if r.is_null() || s.is_null() {
+                return 0;
+            }
+            ffi::BN_clear_free((*sig).r);
+            ffi::BN_clear_free((*sig).s);
+            (*sig).r = r;
+            (*sig).s = s;
+            1
+        }
+
+        #[allow(bad_style)]
+        unsafe fn DSA_SIG_get0(
+            sig: *const ffi::DSA_SIG,
+            pr: *mut *const ffi::BIGNUM,
+            ps: *mut *const ffi::BIGNUM)
+        {
+            if !pr.is_null() {
+                (*pr) = (*sig).r;
+            }
+            if !ps.is_null() {
+                (*ps) = (*sig).s;
+            }
+        }
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+    use crate::bn::BigNumContext;
+    #[cfg(not(boringssl))]
+    use crate::hash::MessageDigest;
+    #[cfg(not(boringssl))]
+    use crate::pkey::PKey;
+    #[cfg(not(boringssl))]
+    use crate::sign::{Signer, Verifier};
+
+    #[test]
+    pub fn test_generate() {
+        Dsa::generate(1024).unwrap();
+    }
+
+    #[test]
+    fn test_pubkey_generation() {
+        let dsa = Dsa::generate(1024).unwrap();
+        let p = dsa.p();
+        let g = dsa.g();
+        let priv_key = dsa.priv_key();
+        let pub_key = dsa.pub_key();
+        let mut ctx = BigNumContext::new().unwrap();
+        let mut calc = BigNum::new().unwrap();
+        calc.mod_exp(g, priv_key, p, &mut ctx).unwrap();
+        assert_eq!(&calc, pub_key)
+    }
+
+    #[test]
+    fn test_priv_key_from_parts() {
+        let p = BigNum::from_u32(283).unwrap();
+        let q = BigNum::from_u32(47).unwrap();
+        let g = BigNum::from_u32(60).unwrap();
+        let priv_key = BigNum::from_u32(15).unwrap();
+        let pub_key = BigNum::from_u32(207).unwrap();
+
+        let dsa = Dsa::from_private_components(p, q, g, priv_key, pub_key).unwrap();
+        assert_eq!(dsa.pub_key(), &BigNum::from_u32(207).unwrap());
+        assert_eq!(dsa.priv_key(), &BigNum::from_u32(15).unwrap());
+        assert_eq!(dsa.p(), &BigNum::from_u32(283).unwrap());
+        assert_eq!(dsa.q(), &BigNum::from_u32(47).unwrap());
+        assert_eq!(dsa.g(), &BigNum::from_u32(60).unwrap());
+    }
+
+    #[test]
+    fn test_pub_key_from_parts() {
+        let p = BigNum::from_u32(283).unwrap();
+        let q = BigNum::from_u32(47).unwrap();
+        let g = BigNum::from_u32(60).unwrap();
+        let pub_key = BigNum::from_u32(207).unwrap();
+
+        let dsa = Dsa::from_public_components(p, q, g, pub_key).unwrap();
+        assert_eq!(dsa.pub_key(), &BigNum::from_u32(207).unwrap());
+        assert_eq!(dsa.p(), &BigNum::from_u32(283).unwrap());
+        assert_eq!(dsa.q(), &BigNum::from_u32(47).unwrap());
+        assert_eq!(dsa.g(), &BigNum::from_u32(60).unwrap());
+    }
+
+    #[test]
+    fn test_params() {
+        let params = Dsa::generate_params(1024).unwrap();
+        let p = params.p().to_owned().unwrap();
+        let q = params.q().to_owned().unwrap();
+        let g = params.g().to_owned().unwrap();
+        let key = params.generate_key().unwrap();
+        let params2 = Dsa::from_pqg(
+            key.p().to_owned().unwrap(),
+            key.q().to_owned().unwrap(),
+            key.g().to_owned().unwrap(),
+        )
+        .unwrap();
+        assert_eq!(p, *params2.p());
+        assert_eq!(q, *params2.q());
+        assert_eq!(g, *params2.g());
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn test_signature() {
+        const TEST_DATA: &[u8] = &[0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
+        let dsa_ref = Dsa::generate(1024).unwrap();
+
+        let p = dsa_ref.p();
+        let q = dsa_ref.q();
+        let g = dsa_ref.g();
+
+        let pub_key = dsa_ref.pub_key();
+        let priv_key = dsa_ref.priv_key();
+
+        let priv_key = Dsa::from_private_components(
+            BigNumRef::to_owned(p).unwrap(),
+            BigNumRef::to_owned(q).unwrap(),
+            BigNumRef::to_owned(g).unwrap(),
+            BigNumRef::to_owned(priv_key).unwrap(),
+            BigNumRef::to_owned(pub_key).unwrap(),
+        )
+        .unwrap();
+        let priv_key = PKey::from_dsa(priv_key).unwrap();
+
+        let pub_key = Dsa::from_public_components(
+            BigNumRef::to_owned(p).unwrap(),
+            BigNumRef::to_owned(q).unwrap(),
+            BigNumRef::to_owned(g).unwrap(),
+            BigNumRef::to_owned(pub_key).unwrap(),
+        )
+        .unwrap();
+        let pub_key = PKey::from_dsa(pub_key).unwrap();
+
+        let mut signer = Signer::new(MessageDigest::sha256(), &priv_key).unwrap();
+        signer.update(TEST_DATA).unwrap();
+
+        let signature = signer.sign_to_vec().unwrap();
+        let mut verifier = Verifier::new(MessageDigest::sha256(), &pub_key).unwrap();
+        verifier.update(TEST_DATA).unwrap();
+        assert!(verifier.verify(&signature[..]).unwrap());
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn test_signature_der() {
+        use std::convert::TryInto;
+
+        const TEST_DATA: &[u8] = &[0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
+        let dsa_ref = Dsa::generate(1024).unwrap();
+
+        let pub_key: PKey<_> = dsa_ref.clone().try_into().unwrap();
+        let priv_key: PKey<_> = dsa_ref.try_into().unwrap();
+
+        let mut signer = Signer::new(MessageDigest::sha256(), &priv_key).unwrap();
+        signer.update(TEST_DATA).unwrap();
+
+        let signature = signer.sign_to_vec().unwrap();
+        eprintln!("{:?}", signature);
+        let signature = DsaSig::from_der(&signature).unwrap();
+
+        let r = BigNum::from_slice(&signature.r().to_vec()).unwrap();
+        let s = BigNum::from_slice(&signature.s().to_vec()).unwrap();
+
+        let signature = DsaSig::from_private_components(r, s).unwrap();
+        let signature = signature.to_der().unwrap();
+
+        let mut verifier = Verifier::new(MessageDigest::sha256(), &pub_key).unwrap();
+        verifier.update(TEST_DATA).unwrap();
+        assert!(verifier.verify(&signature[..]).unwrap());
+    }
+
+    #[test]
+    #[allow(clippy::redundant_clone)]
+    fn clone() {
+        let key = Dsa::generate(2048).unwrap();
+        drop(key.clone());
+    }
+
+    #[test]
+    fn dsa_sig_debug() {
+        let sig = DsaSig::from_der(&[
+            48, 46, 2, 21, 0, 135, 169, 24, 58, 153, 37, 175, 248, 200, 45, 251, 112, 238, 238, 89,
+            172, 177, 182, 166, 237, 2, 21, 0, 159, 146, 151, 237, 187, 8, 82, 115, 14, 183, 103,
+            12, 203, 46, 161, 208, 251, 167, 123, 131,
+        ])
+        .unwrap();
+        let s = format!("{:?}", sig);
+        assert_eq!(s, "DsaSig { r: 774484690634577222213819810519929266740561094381, s: 910998676210681457251421818099943952372231273347 }");
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/ec.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/ec.rs
--- 43.0.0-1/rust-vendor/openssl/src/ec.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/ec.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1345 @@
+//! Elliptic Curve
+//!
+//! Cryptography relies on the difficulty of solving mathematical problems, such as the factor
+//! of large integers composed of two large prime numbers and the discrete logarithm of a
+//! random elliptic curve.  This module provides low-level features of the latter.
+//! Elliptic Curve protocols can provide the same security with smaller keys.
+//!
+//! There are 2 forms of elliptic curves, `Fp` and `F2^m`.  These curves use irreducible
+//! trinomial or pentanomial.  Being a generic interface to a wide range of algorithms,
+//! the curves are generally referenced by [`EcGroup`].  There are many built-in groups
+//! found in [`Nid`].
+//!
+//! OpenSSL Wiki explains the fields and curves in detail at [Elliptic Curve Cryptography].
+//!
+//! [`EcGroup`]: struct.EcGroup.html
+//! [`Nid`]: ../nid/struct.Nid.html
+//! [Elliptic Curve Cryptography]: https://wiki.openssl.org/index.php/Elliptic_Curve_Cryptography
+use cfg_if::cfg_if;
+use foreign_types::{ForeignType, ForeignTypeRef};
+use libc::c_int;
+use std::fmt;
+use std::ptr;
+
+use crate::bn::{BigNum, BigNumContextRef, BigNumRef};
+use crate::error::ErrorStack;
+use crate::nid::Nid;
+use crate::pkey::{HasParams, HasPrivate, HasPublic, Params, Private, Public};
+use crate::util::ForeignTypeRefExt;
+use crate::{cvt, cvt_n, cvt_p, init};
+use openssl_macros::corresponds;
+
+cfg_if! {
+    if #[cfg(not(boringssl))] {
+        use std::ffi::CString;
+        use crate::string::OpensslString;
+    }
+}
+
+/// Compressed or Uncompressed conversion
+///
+/// Conversion from the binary value of the point on the curve is performed in one of
+/// compressed, uncompressed, or hybrid conversions.  The default is compressed, except
+/// for binary curves.
+///
+/// Further documentation is available in the [X9.62] standard.
+///
+/// [X9.62]: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.202.2977&rep=rep1&type=pdf
+#[derive(Copy, Clone)]
+pub struct PointConversionForm(ffi::point_conversion_form_t);
+
+impl PointConversionForm {
+    /// Compressed conversion from point value.
+    pub const COMPRESSED: PointConversionForm =
+        PointConversionForm(ffi::point_conversion_form_t::POINT_CONVERSION_COMPRESSED);
+
+    /// Uncompressed conversion from point value.
+    pub const UNCOMPRESSED: PointConversionForm =
+        PointConversionForm(ffi::point_conversion_form_t::POINT_CONVERSION_UNCOMPRESSED);
+
+    /// Performs both compressed and uncompressed conversions.
+    pub const HYBRID: PointConversionForm =
+        PointConversionForm(ffi::point_conversion_form_t::POINT_CONVERSION_HYBRID);
+}
+
+/// Named Curve or Explicit
+///
+/// This type acts as a boolean as to whether the `EcGroup` is named or explicit.
+#[derive(Copy, Clone, Debug, PartialEq)]
+pub struct Asn1Flag(c_int);
+
+impl Asn1Flag {
+    /// Curve defined using polynomial parameters
+    ///
+    /// Most applications use a named EC_GROUP curve, however, support
+    /// is included to explicitly define the curve used to calculate keys
+    /// This information would need to be known by both endpoint to make communication
+    /// effective.
+    ///
+    /// OPENSSL_EC_EXPLICIT_CURVE, but that was only added in 1.1.
+    /// Man page documents that 0 can be used in older versions.
+    ///
+    /// OpenSSL documentation at [`EC_GROUP`]
+    ///
+    /// [`EC_GROUP`]: https://www.openssl.org/docs/manmaster/crypto/EC_GROUP_get_seed_len.html
+    pub const EXPLICIT_CURVE: Asn1Flag = Asn1Flag(0);
+
+    /// Standard Curves
+    ///
+    /// Curves that make up the typical encryption use cases.  The collection of curves
+    /// are well known but extensible.
+    ///
+    /// OpenSSL documentation at [`EC_GROUP`]
+    ///
+    /// [`EC_GROUP`]: https://www.openssl.org/docs/manmaster/man3/EC_GROUP_order_bits.html
+    pub const NAMED_CURVE: Asn1Flag = Asn1Flag(ffi::OPENSSL_EC_NAMED_CURVE);
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::EC_GROUP;
+    fn drop = ffi::EC_GROUP_free;
+
+    /// Describes the curve
+    ///
+    /// A curve can be of the named curve type.  These curves can be discovered
+    /// using openssl binary `openssl ecparam -list_curves`.  Other operations
+    /// are available in the [wiki].  These named curves are available in the
+    /// [`Nid`] module.
+    ///
+    /// Curves can also be generated using prime field parameters or a binary field.
+    ///
+    /// Prime fields use the formula `y^2 mod p = x^3 + ax + b mod p`.  Binary
+    /// fields use the formula `y^2 + xy = x^3 + ax^2 + b`.  Named curves have
+    /// assured security.  To prevent accidental vulnerabilities, they should
+    /// be preferred.
+    ///
+    /// [wiki]: https://wiki.openssl.org/index.php/Command_Line_Elliptic_Curve_Operations
+    /// [`Nid`]: ../nid/index.html
+    pub struct EcGroup;
+    /// Reference to [`EcGroup`]
+    ///
+    /// [`EcGroup`]: struct.EcGroup.html
+    pub struct EcGroupRef;
+}
+
+impl EcGroup {
+    /// Returns the group of a standard named curve.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # fn main() -> Result<(), Box<dyn std::error::Error>> {
+    /// use openssl::nid::Nid;
+    /// use openssl::ec::{EcGroup, EcKey};
+    ///
+    /// let nid = Nid::X9_62_PRIME256V1; // NIST P-256 curve
+    /// let group = EcGroup::from_curve_name(nid)?;
+    /// let key = EcKey::generate(&group)?;
+    /// # Ok(()) }
+    /// ```
+    #[corresponds(EC_GROUP_new_by_curve_name)]
+    pub fn from_curve_name(nid: Nid) -> Result<EcGroup, ErrorStack> {
+        unsafe {
+            init();
+            cvt_p(ffi::EC_GROUP_new_by_curve_name(nid.as_raw())).map(EcGroup)
+        }
+    }
+
+    /// Returns the group for given parameters
+    #[corresponds(EC_GROUP_new_curve_GFp)]
+    pub fn from_components(
+        p: BigNum,
+        a: BigNum,
+        b: BigNum,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<EcGroup, ErrorStack> {
+        unsafe {
+            cvt_p(ffi::EC_GROUP_new_curve_GFp(
+                p.as_ptr(),
+                a.as_ptr(),
+                b.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(EcGroup)
+        }
+    }
+}
+
+impl EcGroupRef {
+    /// Places the components of a curve over a prime field in the provided `BigNum`s.
+    /// The components make up the formula `y^2 mod p = x^3 + ax + b mod p`.
+    #[corresponds(EC_GROUP_get_curve_GFp)]
+    pub fn components_gfp(
+        &self,
+        p: &mut BigNumRef,
+        a: &mut BigNumRef,
+        b: &mut BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EC_GROUP_get_curve_GFp(
+                self.as_ptr(),
+                p.as_ptr(),
+                a.as_ptr(),
+                b.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Places the components of a curve over a binary field in the provided `BigNum`s.
+    /// The components make up the formula `y^2 + xy = x^3 + ax^2 + b`.
+    ///
+    /// In this form `p` relates to the irreducible polynomial.  Each bit represents
+    /// a term in the polynomial.  It will be set to 3 `1`s or 5 `1`s depending on
+    /// using a trinomial or pentanomial.
+    #[corresponds(EC_GROUP_get_curve_GF2m)]
+    #[cfg(not(osslconf = "OPENSSL_NO_EC2M"))]
+    pub fn components_gf2m(
+        &self,
+        p: &mut BigNumRef,
+        a: &mut BigNumRef,
+        b: &mut BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EC_GROUP_get_curve_GF2m(
+                self.as_ptr(),
+                p.as_ptr(),
+                a.as_ptr(),
+                b.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Places the cofactor of the group in the provided `BigNum`.
+    #[corresponds(EC_GROUP_get_cofactor)]
+    pub fn cofactor(
+        &self,
+        cofactor: &mut BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EC_GROUP_get_cofactor(
+                self.as_ptr(),
+                cofactor.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Returns the degree of the curve.
+    #[corresponds(EC_GROUP_get_degree)]
+    pub fn degree(&self) -> u32 {
+        unsafe { ffi::EC_GROUP_get_degree(self.as_ptr()) as u32 }
+    }
+
+    /// Returns the number of bits in the group order.
+    #[corresponds(EC_GROUP_order_bits)]
+    #[cfg(ossl110)]
+    pub fn order_bits(&self) -> u32 {
+        unsafe { ffi::EC_GROUP_order_bits(self.as_ptr()) as u32 }
+    }
+
+    /// Returns the generator for the given curve as an [`EcPoint`].
+    #[corresponds(EC_GROUP_get0_generator)]
+    pub fn generator(&self) -> &EcPointRef {
+        unsafe {
+            let ptr = ffi::EC_GROUP_get0_generator(self.as_ptr());
+            EcPointRef::from_const_ptr(ptr)
+        }
+    }
+
+    /// Sets the generator point for the given curve
+    #[corresponds(EC_GROUP_set_generator)]
+    pub fn set_generator(
+        &mut self,
+        generator: EcPoint,
+        order: BigNum,
+        cofactor: BigNum,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EC_GROUP_set_generator(
+                self.as_ptr(),
+                generator.as_ptr(),
+                order.as_ptr(),
+                cofactor.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Places the order of the curve in the provided `BigNum`.
+    #[corresponds(EC_GROUP_get_order)]
+    pub fn order(
+        &self,
+        order: &mut BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EC_GROUP_get_order(
+                self.as_ptr(),
+                order.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the flag determining if the group corresponds to a named curve or must be explicitly
+    /// parameterized.
+    ///
+    /// This defaults to `EXPLICIT_CURVE` in OpenSSL 1.0.1 and 1.0.2, but `NAMED_CURVE` in OpenSSL
+    /// 1.1.0.
+    #[corresponds(EC_GROUP_set_asn1_flag)]
+    pub fn set_asn1_flag(&mut self, flag: Asn1Flag) {
+        unsafe {
+            ffi::EC_GROUP_set_asn1_flag(self.as_ptr(), flag.0);
+        }
+    }
+
+    /// Gets the flag determining if the group corresponds to a named curve.
+    #[corresponds(EC_GROUP_get_asn1_flag)]
+    pub fn asn1_flag(&self) -> Asn1Flag {
+        unsafe { Asn1Flag(ffi::EC_GROUP_get_asn1_flag(self.as_ptr())) }
+    }
+
+    /// Returns the name of the curve, if a name is associated.
+    #[corresponds(EC_GROUP_get_curve_name)]
+    pub fn curve_name(&self) -> Option<Nid> {
+        let nid = unsafe { ffi::EC_GROUP_get_curve_name(self.as_ptr()) };
+        if nid > 0 {
+            Some(Nid::from_raw(nid))
+        } else {
+            None
+        }
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::EC_POINT;
+    fn drop = ffi::EC_POINT_free;
+
+    /// Represents a point on the curve
+    pub struct EcPoint;
+    /// A reference a borrowed [`EcPoint`].
+    pub struct EcPointRef;
+}
+
+impl EcPointRef {
+    /// Computes `a + b`, storing the result in `self`.
+    #[corresponds(EC_POINT_add)]
+    pub fn add(
+        &mut self,
+        group: &EcGroupRef,
+        a: &EcPointRef,
+        b: &EcPointRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EC_POINT_add(
+                group.as_ptr(),
+                self.as_ptr(),
+                a.as_ptr(),
+                b.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Computes `q * m`, storing the result in `self`.
+    #[corresponds(EC_POINT_mul)]
+    pub fn mul(
+        &mut self,
+        group: &EcGroupRef,
+        q: &EcPointRef,
+        m: &BigNumRef,
+        // FIXME should be &mut
+        ctx: &BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EC_POINT_mul(
+                group.as_ptr(),
+                self.as_ptr(),
+                ptr::null(),
+                q.as_ptr(),
+                m.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Computes `generator * n`, storing the result in `self`.
+    #[corresponds(EC_POINT_mul)]
+    pub fn mul_generator(
+        &mut self,
+        group: &EcGroupRef,
+        n: &BigNumRef,
+        // FIXME should be &mut
+        ctx: &BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EC_POINT_mul(
+                group.as_ptr(),
+                self.as_ptr(),
+                n.as_ptr(),
+                ptr::null(),
+                ptr::null(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Computes `generator * n + q * m`, storing the result in `self`.
+    #[corresponds(EC_POINT_mul)]
+    pub fn mul_full(
+        &mut self,
+        group: &EcGroupRef,
+        n: &BigNumRef,
+        q: &EcPointRef,
+        m: &BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EC_POINT_mul(
+                group.as_ptr(),
+                self.as_ptr(),
+                n.as_ptr(),
+                q.as_ptr(),
+                m.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Inverts `self`.
+    #[corresponds(EC_POINT_invert)]
+    // FIXME should be mutable
+    pub fn invert(&mut self, group: &EcGroupRef, ctx: &BigNumContextRef) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EC_POINT_invert(
+                group.as_ptr(),
+                self.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Serializes the point to a binary representation.
+    #[corresponds(EC_POINT_point2oct)]
+    pub fn to_bytes(
+        &self,
+        group: &EcGroupRef,
+        form: PointConversionForm,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<Vec<u8>, ErrorStack> {
+        unsafe {
+            let len = ffi::EC_POINT_point2oct(
+                group.as_ptr(),
+                self.as_ptr(),
+                form.0,
+                ptr::null_mut(),
+                0,
+                ctx.as_ptr(),
+            );
+            if len == 0 {
+                return Err(ErrorStack::get());
+            }
+            let mut buf = vec![0; len];
+            let len = ffi::EC_POINT_point2oct(
+                group.as_ptr(),
+                self.as_ptr(),
+                form.0,
+                buf.as_mut_ptr(),
+                len,
+                ctx.as_ptr(),
+            );
+            if len == 0 {
+                Err(ErrorStack::get())
+            } else {
+                Ok(buf)
+            }
+        }
+    }
+
+    /// Serializes the point to a hexadecimal string representation.
+    #[corresponds(EC_POINT_point2hex)]
+    #[cfg(not(boringssl))]
+    pub fn to_hex_str(
+        &self,
+        group: &EcGroupRef,
+        form: PointConversionForm,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<OpensslString, ErrorStack> {
+        unsafe {
+            let buf = cvt_p(ffi::EC_POINT_point2hex(
+                group.as_ptr(),
+                self.as_ptr(),
+                form.0,
+                ctx.as_ptr(),
+            ))?;
+            Ok(OpensslString::from_ptr(buf))
+        }
+    }
+
+    /// Creates a new point on the specified curve with the same value.
+    #[corresponds(EC_POINT_dup)]
+    pub fn to_owned(&self, group: &EcGroupRef) -> Result<EcPoint, ErrorStack> {
+        unsafe { cvt_p(ffi::EC_POINT_dup(self.as_ptr(), group.as_ptr())).map(EcPoint) }
+    }
+
+    /// Determines if this point is equal to another.
+    #[corresponds(EC_POINT_cmp)]
+    pub fn eq(
+        &self,
+        group: &EcGroupRef,
+        other: &EcPointRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<bool, ErrorStack> {
+        unsafe {
+            let res = cvt_n(ffi::EC_POINT_cmp(
+                group.as_ptr(),
+                self.as_ptr(),
+                other.as_ptr(),
+                ctx.as_ptr(),
+            ))?;
+            Ok(res == 0)
+        }
+    }
+
+    /// Places affine coordinates of a curve over a prime field in the provided
+    /// `x` and `y` `BigNum`s.
+    #[corresponds(EC_POINT_get_affine_coordinates)]
+    #[cfg(any(ossl111, boringssl, libressl350))]
+    pub fn affine_coordinates(
+        &self,
+        group: &EcGroupRef,
+        x: &mut BigNumRef,
+        y: &mut BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EC_POINT_get_affine_coordinates(
+                group.as_ptr(),
+                self.as_ptr(),
+                x.as_ptr(),
+                y.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Places affine coordinates of a curve over a prime field in the provided
+    /// `x` and `y` `BigNum`s
+    #[corresponds(EC_POINT_get_affine_coordinates_GFp)]
+    pub fn affine_coordinates_gfp(
+        &self,
+        group: &EcGroupRef,
+        x: &mut BigNumRef,
+        y: &mut BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EC_POINT_get_affine_coordinates_GFp(
+                group.as_ptr(),
+                self.as_ptr(),
+                x.as_ptr(),
+                y.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets affine coordinates of a curve over a prime field using the provided
+    /// `x` and `y` `BigNum`s
+    #[corresponds(EC_POINT_set_affine_coordinates_GFp)]
+    pub fn set_affine_coordinates_gfp(
+        &mut self,
+        group: &EcGroupRef,
+        x: &BigNumRef,
+        y: &BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EC_POINT_set_affine_coordinates_GFp(
+                group.as_ptr(),
+                self.as_ptr(),
+                x.as_ptr(),
+                y.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Places affine coordinates of a curve over a binary field in the provided
+    /// `x` and `y` `BigNum`s
+    #[corresponds(EC_POINT_get_affine_coordinates_GF2m)]
+    #[cfg(not(osslconf = "OPENSSL_NO_EC2M"))]
+    pub fn affine_coordinates_gf2m(
+        &self,
+        group: &EcGroupRef,
+        x: &mut BigNumRef,
+        y: &mut BigNumRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EC_POINT_get_affine_coordinates_GF2m(
+                group.as_ptr(),
+                self.as_ptr(),
+                x.as_ptr(),
+                y.as_ptr(),
+                ctx.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Checks if point is infinity
+    #[corresponds(EC_POINT_is_at_infinity)]
+    pub fn is_infinity(&self, group: &EcGroupRef) -> bool {
+        unsafe {
+            let res = ffi::EC_POINT_is_at_infinity(group.as_ptr(), self.as_ptr());
+            res == 1
+        }
+    }
+
+    /// Checks if point is on a given curve
+    #[corresponds(EC_POINT_is_on_curve)]
+    pub fn is_on_curve(
+        &self,
+        group: &EcGroupRef,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<bool, ErrorStack> {
+        unsafe {
+            let res = cvt_n(ffi::EC_POINT_is_on_curve(
+                group.as_ptr(),
+                self.as_ptr(),
+                ctx.as_ptr(),
+            ))?;
+            Ok(res == 1)
+        }
+    }
+}
+
+impl EcPoint {
+    /// Creates a new point on the specified curve.
+    #[corresponds(EC_POINT_new)]
+    pub fn new(group: &EcGroupRef) -> Result<EcPoint, ErrorStack> {
+        unsafe { cvt_p(ffi::EC_POINT_new(group.as_ptr())).map(EcPoint) }
+    }
+
+    /// Creates point from a binary representation
+    #[corresponds(EC_POINT_oct2point)]
+    pub fn from_bytes(
+        group: &EcGroupRef,
+        buf: &[u8],
+        ctx: &mut BigNumContextRef,
+    ) -> Result<EcPoint, ErrorStack> {
+        let point = EcPoint::new(group)?;
+        unsafe {
+            cvt(ffi::EC_POINT_oct2point(
+                group.as_ptr(),
+                point.as_ptr(),
+                buf.as_ptr(),
+                buf.len(),
+                ctx.as_ptr(),
+            ))?;
+        }
+        Ok(point)
+    }
+
+    /// Creates point from a hexadecimal string representation
+    #[corresponds(EC_POINT_hex2point)]
+    #[cfg(not(boringssl))]
+    pub fn from_hex_str(
+        group: &EcGroupRef,
+        s: &str,
+        ctx: &mut BigNumContextRef,
+    ) -> Result<EcPoint, ErrorStack> {
+        let point = EcPoint::new(group)?;
+        unsafe {
+            let c_str = CString::new(s.as_bytes()).unwrap();
+            cvt_p(ffi::EC_POINT_hex2point(
+                group.as_ptr(),
+                c_str.as_ptr() as *const _,
+                point.as_ptr(),
+                ctx.as_ptr(),
+            ))?;
+        }
+        Ok(point)
+    }
+}
+
+generic_foreign_type_and_impl_send_sync! {
+    type CType = ffi::EC_KEY;
+    fn drop = ffi::EC_KEY_free;
+
+    /// Public and optional private key on the given curve.
+    pub struct EcKey<T>;
+    /// A reference to an [`EcKey`].
+    pub struct EcKeyRef<T>;
+}
+
+impl<T> EcKeyRef<T>
+where
+    T: HasPrivate,
+{
+    private_key_to_pem! {
+        /// Serializes the private key to a PEM-encoded ECPrivateKey structure.
+        ///
+        /// The output will have a header of `-----BEGIN EC PRIVATE KEY-----`.
+        #[corresponds(PEM_write_bio_ECPrivateKey)]
+        private_key_to_pem,
+        /// Serializes the private key to a PEM-encoded encrypted ECPrivateKey structure.
+        ///
+        /// The output will have a header of `-----BEGIN EC PRIVATE KEY-----`.
+        #[corresponds(PEM_write_bio_ECPrivateKey)]
+        private_key_to_pem_passphrase,
+        ffi::PEM_write_bio_ECPrivateKey
+    }
+
+    to_der! {
+        /// Serializes the private key into a DER-encoded ECPrivateKey structure.
+        #[corresponds(i2d_ECPrivateKey)]
+        private_key_to_der,
+        ffi::i2d_ECPrivateKey
+    }
+
+    /// Returns the private key value.
+    #[corresponds(EC_KEY_get0_private_key)]
+    pub fn private_key(&self) -> &BigNumRef {
+        unsafe {
+            let ptr = ffi::EC_KEY_get0_private_key(self.as_ptr());
+            BigNumRef::from_const_ptr(ptr)
+        }
+    }
+}
+
+impl<T> EcKeyRef<T>
+where
+    T: HasPublic,
+{
+    /// Returns the public key.
+    #[corresponds(EC_KEY_get0_public_key)]
+    pub fn public_key(&self) -> &EcPointRef {
+        unsafe {
+            let ptr = ffi::EC_KEY_get0_public_key(self.as_ptr());
+            EcPointRef::from_const_ptr(ptr)
+        }
+    }
+
+    to_pem! {
+        /// Serializes the public key into a PEM-encoded SubjectPublicKeyInfo structure.
+        ///
+        /// The output will have a header of `-----BEGIN PUBLIC KEY-----`.
+        #[corresponds(PEM_write_bio_EC_PUBKEY)]
+        public_key_to_pem,
+        ffi::PEM_write_bio_EC_PUBKEY
+    }
+
+    to_der! {
+        /// Serializes the public key into a DER-encoded SubjectPublicKeyInfo structure.
+        #[corresponds(i2d_EC_PUBKEY)]
+        public_key_to_der,
+        ffi::i2d_EC_PUBKEY
+    }
+}
+
+impl<T> EcKeyRef<T>
+where
+    T: HasParams,
+{
+    /// Returns the key's group.
+    #[corresponds(EC_KEY_get0_group)]
+    pub fn group(&self) -> &EcGroupRef {
+        unsafe {
+            let ptr = ffi::EC_KEY_get0_group(self.as_ptr());
+            EcGroupRef::from_const_ptr(ptr)
+        }
+    }
+
+    /// Checks the key for validity.
+    #[corresponds(EC_KEY_check_key)]
+    pub fn check_key(&self) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::EC_KEY_check_key(self.as_ptr())).map(|_| ()) }
+    }
+}
+
+impl<T> ToOwned for EcKeyRef<T> {
+    type Owned = EcKey<T>;
+
+    fn to_owned(&self) -> EcKey<T> {
+        unsafe {
+            let r = ffi::EC_KEY_up_ref(self.as_ptr());
+            assert!(r == 1);
+            EcKey::from_ptr(self.as_ptr())
+        }
+    }
+}
+
+impl EcKey<Params> {
+    /// Constructs an `EcKey` corresponding to a known curve.
+    ///
+    /// It will not have an associated public or private key. This kind of key is primarily useful
+    /// to be provided to the `set_tmp_ecdh` methods on `Ssl` and `SslContextBuilder`.
+    #[corresponds(EC_KEY_new_by_curve_name)]
+    pub fn from_curve_name(nid: Nid) -> Result<EcKey<Params>, ErrorStack> {
+        unsafe {
+            init();
+            cvt_p(ffi::EC_KEY_new_by_curve_name(nid.as_raw())).map(|p| EcKey::from_ptr(p))
+        }
+    }
+
+    /// Constructs an `EcKey` corresponding to a curve.
+    #[corresponds(EC_KEY_set_group)]
+    pub fn from_group(group: &EcGroupRef) -> Result<EcKey<Params>, ErrorStack> {
+        unsafe {
+            cvt_p(ffi::EC_KEY_new())
+                .map(|p| EcKey::from_ptr(p))
+                .and_then(|key| {
+                    cvt(ffi::EC_KEY_set_group(key.as_ptr(), group.as_ptr())).map(|_| key)
+                })
+        }
+    }
+}
+
+impl EcKey<Public> {
+    /// Constructs an `EcKey` from the specified group with the associated [`EcPoint`]: `public_key`.
+    ///
+    /// This will only have the associated `public_key`.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// # fn main() -> Result<(), Box<dyn std::error::Error>> {
+    /// use openssl::bn::BigNumContext;
+    /// use openssl::ec::*;
+    /// use openssl::nid::Nid;
+    /// use openssl::pkey::PKey;
+    ///
+    /// let group = EcGroup::from_curve_name(Nid::SECP384R1)?;
+    /// let mut ctx = BigNumContext::new()?;
+    ///
+    /// // get bytes from somewhere
+    /// let public_key = // ...
+    /// # EcKey::generate(&group)?.public_key().to_bytes(&group,
+    /// # PointConversionForm::COMPRESSED, &mut ctx)?;
+    ///
+    /// // create an EcKey from the binary form of a EcPoint
+    /// let point = EcPoint::from_bytes(&group, &public_key, &mut ctx)?;
+    /// let key = EcKey::from_public_key(&group, &point)?;
+    /// key.check_key()?;
+    /// # Ok(()) }
+    /// ```
+    #[corresponds(EC_KEY_set_public_key)]
+    pub fn from_public_key(
+        group: &EcGroupRef,
+        public_key: &EcPointRef,
+    ) -> Result<EcKey<Public>, ErrorStack> {
+        unsafe {
+            cvt_p(ffi::EC_KEY_new())
+                .map(|p| EcKey::from_ptr(p))
+                .and_then(|key| {
+                    cvt(ffi::EC_KEY_set_group(key.as_ptr(), group.as_ptr())).map(|_| key)
+                })
+                .and_then(|key| {
+                    cvt(ffi::EC_KEY_set_public_key(
+                        key.as_ptr(),
+                        public_key.as_ptr(),
+                    ))
+                    .map(|_| key)
+                })
+        }
+    }
+
+    /// Constructs a public key from its affine coordinates.
+    #[corresponds(EC_KEY_set_public_key_affine_coordinates)]
+    pub fn from_public_key_affine_coordinates(
+        group: &EcGroupRef,
+        x: &BigNumRef,
+        y: &BigNumRef,
+    ) -> Result<EcKey<Public>, ErrorStack> {
+        unsafe {
+            cvt_p(ffi::EC_KEY_new())
+                .map(|p| EcKey::from_ptr(p))
+                .and_then(|key| {
+                    cvt(ffi::EC_KEY_set_group(key.as_ptr(), group.as_ptr())).map(|_| key)
+                })
+                .and_then(|key| {
+                    cvt(ffi::EC_KEY_set_public_key_affine_coordinates(
+                        key.as_ptr(),
+                        x.as_ptr(),
+                        y.as_ptr(),
+                    ))
+                    .map(|_| key)
+                })
+        }
+    }
+
+    from_pem! {
+        /// Decodes a PEM-encoded SubjectPublicKeyInfo structure containing a EC key.
+        ///
+        /// The input should have a header of `-----BEGIN PUBLIC KEY-----`.
+        #[corresponds(PEM_read_bio_EC_PUBKEY)]
+        public_key_from_pem,
+        EcKey<Public>,
+        ffi::PEM_read_bio_EC_PUBKEY
+    }
+
+    from_der! {
+        /// Decodes a DER-encoded SubjectPublicKeyInfo structure containing a EC key.
+        #[corresponds(d2i_EC_PUBKEY)]
+        public_key_from_der,
+        EcKey<Public>,
+        ffi::d2i_EC_PUBKEY
+    }
+}
+
+impl EcKey<Private> {
+    /// Generates a new public/private key pair on the specified curve.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # fn main() -> Result<(), Box<dyn std::error::Error>> {
+    /// use openssl::bn::BigNumContext;
+    /// use openssl::nid::Nid;
+    /// use openssl::ec::{EcGroup, EcKey, PointConversionForm};
+    ///
+    /// let nid = Nid::X9_62_PRIME256V1; // NIST P-256 curve
+    /// let group = EcGroup::from_curve_name(nid)?;
+    /// let key = EcKey::generate(&group)?;
+    ///
+    /// let mut ctx = BigNumContext::new()?;
+    ///
+    /// let public_key = &key.public_key().to_bytes(
+    ///     &group,
+    ///     PointConversionForm::COMPRESSED,
+    ///     &mut ctx,
+    /// )?;
+    /// assert_eq!(public_key.len(), 33);
+    /// assert_ne!(public_key[0], 0x04);
+    ///
+    /// let private_key = key.private_key().to_vec();
+    /// assert!(private_key.len() >= 31);
+    /// # Ok(()) }
+    /// ```
+    #[corresponds(EC_KEY_generate_key)]
+    pub fn generate(group: &EcGroupRef) -> Result<EcKey<Private>, ErrorStack> {
+        unsafe {
+            cvt_p(ffi::EC_KEY_new())
+                .map(|p| EcKey::from_ptr(p))
+                .and_then(|key| {
+                    cvt(ffi::EC_KEY_set_group(key.as_ptr(), group.as_ptr())).map(|_| key)
+                })
+                .and_then(|key| cvt(ffi::EC_KEY_generate_key(key.as_ptr())).map(|_| key))
+        }
+    }
+
+    /// Constructs an public/private key pair given a curve, a private key and a public key point.
+    #[corresponds(EC_KEY_set_private_key)]
+    pub fn from_private_components(
+        group: &EcGroupRef,
+        private_number: &BigNumRef,
+        public_key: &EcPointRef,
+    ) -> Result<EcKey<Private>, ErrorStack> {
+        unsafe {
+            cvt_p(ffi::EC_KEY_new())
+                .map(|p| EcKey::from_ptr(p))
+                .and_then(|key| {
+                    cvt(ffi::EC_KEY_set_group(key.as_ptr(), group.as_ptr())).map(|_| key)
+                })
+                .and_then(|key| {
+                    cvt(ffi::EC_KEY_set_private_key(
+                        key.as_ptr(),
+                        private_number.as_ptr(),
+                    ))
+                    .map(|_| key)
+                })
+                .and_then(|key| {
+                    cvt(ffi::EC_KEY_set_public_key(
+                        key.as_ptr(),
+                        public_key.as_ptr(),
+                    ))
+                    .map(|_| key)
+                })
+        }
+    }
+
+    private_key_from_pem! {
+        /// Deserializes a private key from a PEM-encoded ECPrivateKey structure.
+        ///
+        /// The input should have a header of `-----BEGIN EC PRIVATE KEY-----`.
+        #[corresponds(PEM_read_bio_ECPrivateKey)]
+        private_key_from_pem,
+
+        /// Deserializes a private key from a PEM-encoded encrypted ECPrivateKey structure.
+        ///
+        /// The input should have a header of `-----BEGIN EC PRIVATE KEY-----`.
+        #[corresponds(PEM_read_bio_ECPrivateKey)]
+        private_key_from_pem_passphrase,
+
+        /// Deserializes a private key from a PEM-encoded encrypted ECPrivateKey structure.
+        ///
+        /// The callback should fill the password into the provided buffer and return its length.
+        ///
+        /// The input should have a header of `-----BEGIN EC PRIVATE KEY-----`.
+        #[corresponds(PEM_read_bio_ECPrivateKey)]
+        private_key_from_pem_callback,
+        EcKey<Private>,
+        ffi::PEM_read_bio_ECPrivateKey
+    }
+
+    from_der! {
+        /// Decodes a DER-encoded elliptic curve private key structure.
+        #[corresponds(d2i_ECPrivateKey)]
+        private_key_from_der,
+        EcKey<Private>,
+        ffi::d2i_ECPrivateKey
+    }
+}
+
+impl<T> Clone for EcKey<T> {
+    fn clone(&self) -> EcKey<T> {
+        (**self).to_owned()
+    }
+}
+
+impl<T> fmt::Debug for EcKey<T> {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        write!(f, "EcKey")
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use hex::FromHex;
+
+    use super::*;
+    use crate::bn::{BigNum, BigNumContext};
+    use crate::nid::Nid;
+
+    #[test]
+    fn key_new_by_curve_name() {
+        EcKey::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+    }
+
+    #[test]
+    fn generate() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        EcKey::generate(&group).unwrap();
+    }
+
+    #[test]
+    fn ec_group_from_components() {
+        // parameters are from secp256r1
+        let p = BigNum::from_hex_str(
+            "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF",
+        )
+        .unwrap();
+        let a = BigNum::from_hex_str(
+            "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC",
+        )
+        .unwrap();
+        let b = BigNum::from_hex_str(
+            "5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B",
+        )
+        .unwrap();
+        let mut ctx = BigNumContext::new().unwrap();
+
+        let _curve = EcGroup::from_components(p, a, b, &mut ctx).unwrap();
+    }
+
+    #[test]
+    fn ec_point_set_affine() {
+        // parameters are from secp256r1
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let mut ctx = BigNumContext::new().unwrap();
+        let mut gen_point = EcPoint::new(&group).unwrap();
+        let gen_x = BigNum::from_hex_str(
+            "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296",
+        )
+        .unwrap();
+        let gen_y = BigNum::from_hex_str(
+            "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",
+        )
+        .unwrap();
+        gen_point
+            .set_affine_coordinates_gfp(&group, &gen_x, &gen_y, &mut ctx)
+            .unwrap();
+        assert!(gen_point.is_on_curve(&group, &mut ctx).unwrap());
+    }
+
+    #[test]
+    fn ec_group_set_generator() {
+        // parameters are from secp256r1
+        let mut ctx = BigNumContext::new().unwrap();
+        let p = BigNum::from_hex_str(
+            "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF",
+        )
+        .unwrap();
+        let a = BigNum::from_hex_str(
+            "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC",
+        )
+        .unwrap();
+        let b = BigNum::from_hex_str(
+            "5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B",
+        )
+        .unwrap();
+
+        let mut group = EcGroup::from_components(p, a, b, &mut ctx).unwrap();
+
+        let mut gen_point = EcPoint::new(&group).unwrap();
+        let gen_x = BigNum::from_hex_str(
+            "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296",
+        )
+        .unwrap();
+        let gen_y = BigNum::from_hex_str(
+            "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",
+        )
+        .unwrap();
+        gen_point
+            .set_affine_coordinates_gfp(&group, &gen_x, &gen_y, &mut ctx)
+            .unwrap();
+
+        let order = BigNum::from_hex_str(
+            "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551",
+        )
+        .unwrap();
+        let cofactor = BigNum::from_hex_str("01").unwrap();
+        group.set_generator(gen_point, order, cofactor).unwrap();
+        let mut constructed_order = BigNum::new().unwrap();
+        group.order(&mut constructed_order, &mut ctx).unwrap();
+
+        let named_group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let mut named_order = BigNum::new().unwrap();
+        named_group.order(&mut named_order, &mut ctx).unwrap();
+
+        assert_eq!(
+            constructed_order.ucmp(&named_order),
+            std::cmp::Ordering::Equal
+        );
+    }
+
+    #[test]
+    fn cofactor() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let mut ctx = BigNumContext::new().unwrap();
+        let mut cofactor = BigNum::new().unwrap();
+        group.cofactor(&mut cofactor, &mut ctx).unwrap();
+        let one = BigNum::from_u32(1).unwrap();
+        assert_eq!(cofactor, one);
+    }
+
+    #[test]
+    #[allow(clippy::redundant_clone)]
+    fn dup() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let key = EcKey::generate(&group).unwrap();
+        drop(key.clone());
+    }
+
+    #[test]
+    fn point_new() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        EcPoint::new(&group).unwrap();
+    }
+
+    #[test]
+    fn point_bytes() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let key = EcKey::generate(&group).unwrap();
+        let point = key.public_key();
+        let mut ctx = BigNumContext::new().unwrap();
+        let bytes = point
+            .to_bytes(&group, PointConversionForm::COMPRESSED, &mut ctx)
+            .unwrap();
+        let point2 = EcPoint::from_bytes(&group, &bytes, &mut ctx).unwrap();
+        assert!(point.eq(&group, &point2, &mut ctx).unwrap());
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn point_hex_str() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let key = EcKey::generate(&group).unwrap();
+        let point = key.public_key();
+        let mut ctx = BigNumContext::new().unwrap();
+        let hex = point
+            .to_hex_str(&group, PointConversionForm::COMPRESSED, &mut ctx)
+            .unwrap();
+        let point2 = EcPoint::from_hex_str(&group, &hex, &mut ctx).unwrap();
+        assert!(point.eq(&group, &point2, &mut ctx).unwrap());
+    }
+
+    #[test]
+    fn point_owned() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let key = EcKey::generate(&group).unwrap();
+        let point = key.public_key();
+        let owned = point.to_owned(&group).unwrap();
+        let mut ctx = BigNumContext::new().unwrap();
+        assert!(owned.eq(&group, point, &mut ctx).unwrap());
+    }
+
+    #[test]
+    fn mul_generator() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let key = EcKey::generate(&group).unwrap();
+        let mut ctx = BigNumContext::new().unwrap();
+        let mut public_key = EcPoint::new(&group).unwrap();
+        public_key
+            .mul_generator(&group, key.private_key(), &ctx)
+            .unwrap();
+        assert!(public_key.eq(&group, key.public_key(), &mut ctx).unwrap());
+    }
+
+    #[test]
+    fn generator() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let gen = group.generator();
+        let one = BigNum::from_u32(1).unwrap();
+        let mut ctx = BigNumContext::new().unwrap();
+        let mut ecp = EcPoint::new(&group).unwrap();
+        ecp.mul_generator(&group, &one, &ctx).unwrap();
+        assert!(ecp.eq(&group, gen, &mut ctx).unwrap());
+    }
+
+    #[test]
+    fn key_from_public_key() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let key = EcKey::generate(&group).unwrap();
+        let mut ctx = BigNumContext::new().unwrap();
+        let bytes = key
+            .public_key()
+            .to_bytes(&group, PointConversionForm::COMPRESSED, &mut ctx)
+            .unwrap();
+
+        drop(key);
+        let public_key = EcPoint::from_bytes(&group, &bytes, &mut ctx).unwrap();
+        let ec_key = EcKey::from_public_key(&group, &public_key).unwrap();
+        assert!(ec_key.check_key().is_ok());
+    }
+
+    #[test]
+    fn key_from_private_components() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let key = EcKey::generate(&group).unwrap();
+
+        let dup_key =
+            EcKey::from_private_components(&group, key.private_key(), key.public_key()).unwrap();
+        dup_key.check_key().unwrap();
+
+        assert!(key.private_key() == dup_key.private_key());
+    }
+
+    #[test]
+    fn key_from_affine_coordinates() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let x = Vec::from_hex("30a0424cd21c2944838a2d75c92b37e76ea20d9f00893a3b4eee8a3c0aafec3e")
+            .unwrap();
+        let y = Vec::from_hex("e04b65e92456d9888b52b379bdfbd51ee869ef1f0fc65b6659695b6cce081723")
+            .unwrap();
+
+        let xbn = BigNum::from_slice(&x).unwrap();
+        let ybn = BigNum::from_slice(&y).unwrap();
+
+        let ec_key = EcKey::from_public_key_affine_coordinates(&group, &xbn, &ybn).unwrap();
+        assert!(ec_key.check_key().is_ok());
+    }
+
+    #[cfg(any(ossl111, boringssl, libressl350))]
+    #[test]
+    fn get_affine_coordinates() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let x = Vec::from_hex("30a0424cd21c2944838a2d75c92b37e76ea20d9f00893a3b4eee8a3c0aafec3e")
+            .unwrap();
+        let y = Vec::from_hex("e04b65e92456d9888b52b379bdfbd51ee869ef1f0fc65b6659695b6cce081723")
+            .unwrap();
+
+        let xbn = BigNum::from_slice(&x).unwrap();
+        let ybn = BigNum::from_slice(&y).unwrap();
+
+        let ec_key = EcKey::from_public_key_affine_coordinates(&group, &xbn, &ybn).unwrap();
+
+        let mut xbn2 = BigNum::new().unwrap();
+        let mut ybn2 = BigNum::new().unwrap();
+        let mut ctx = BigNumContext::new().unwrap();
+        let ec_key_pk = ec_key.public_key();
+        ec_key_pk
+            .affine_coordinates(&group, &mut xbn2, &mut ybn2, &mut ctx)
+            .unwrap();
+        assert_eq!(xbn2, xbn);
+        assert_eq!(ybn2, ybn);
+    }
+
+    #[test]
+    fn get_affine_coordinates_gfp() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let x = Vec::from_hex("30a0424cd21c2944838a2d75c92b37e76ea20d9f00893a3b4eee8a3c0aafec3e")
+            .unwrap();
+        let y = Vec::from_hex("e04b65e92456d9888b52b379bdfbd51ee869ef1f0fc65b6659695b6cce081723")
+            .unwrap();
+
+        let xbn = BigNum::from_slice(&x).unwrap();
+        let ybn = BigNum::from_slice(&y).unwrap();
+
+        let ec_key = EcKey::from_public_key_affine_coordinates(&group, &xbn, &ybn).unwrap();
+
+        let mut xbn2 = BigNum::new().unwrap();
+        let mut ybn2 = BigNum::new().unwrap();
+        let mut ctx = BigNumContext::new().unwrap();
+        let ec_key_pk = ec_key.public_key();
+        ec_key_pk
+            .affine_coordinates_gfp(&group, &mut xbn2, &mut ybn2, &mut ctx)
+            .unwrap();
+        assert_eq!(xbn2, xbn);
+        assert_eq!(ybn2, ybn);
+    }
+
+    #[test]
+    fn is_infinity() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let mut ctx = BigNumContext::new().unwrap();
+        let g = group.generator();
+        assert!(!g.is_infinity(&group));
+
+        let mut order = BigNum::new().unwrap();
+        group.order(&mut order, &mut ctx).unwrap();
+        let mut inf = EcPoint::new(&group).unwrap();
+        inf.mul_generator(&group, &order, &ctx).unwrap();
+        assert!(inf.is_infinity(&group));
+    }
+
+    #[test]
+    #[cfg(not(osslconf = "OPENSSL_NO_EC2M"))]
+    fn is_on_curve() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let mut ctx = BigNumContext::new().unwrap();
+        let g = group.generator();
+        assert!(g.is_on_curve(&group, &mut ctx).unwrap());
+
+        let group2 = EcGroup::from_curve_name(Nid::X9_62_PRIME239V3).unwrap();
+        assert!(!g.is_on_curve(&group2, &mut ctx).unwrap());
+    }
+
+    #[test]
+    #[cfg(any(boringssl, ossl111, libressl350))]
+    fn asn1_flag() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let flag = group.asn1_flag();
+        assert_eq!(flag, Asn1Flag::NAMED_CURVE);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/ecdsa.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/ecdsa.rs
--- 43.0.0-1/rust-vendor/openssl/src/ecdsa.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/ecdsa.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,224 @@
+//! Low level Elliptic Curve Digital Signature Algorithm (ECDSA) functions.
+
+use cfg_if::cfg_if;
+use foreign_types::{ForeignType, ForeignTypeRef};
+use libc::c_int;
+use std::mem;
+use std::ptr;
+
+use crate::bn::{BigNum, BigNumRef};
+use crate::ec::EcKeyRef;
+use crate::error::ErrorStack;
+use crate::pkey::{HasPrivate, HasPublic};
+use crate::util::ForeignTypeRefExt;
+use crate::{cvt_n, cvt_p, LenType};
+use openssl_macros::corresponds;
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::ECDSA_SIG;
+    fn drop = ffi::ECDSA_SIG_free;
+
+    /// A low level interface to ECDSA.
+    pub struct EcdsaSig;
+    /// A reference to an [`EcdsaSig`].
+    pub struct EcdsaSigRef;
+}
+
+impl EcdsaSig {
+    /// Computes a digital signature of the hash value `data` using the private EC key eckey.
+    #[corresponds(ECDSA_do_sign)]
+    pub fn sign<T>(data: &[u8], eckey: &EcKeyRef<T>) -> Result<EcdsaSig, ErrorStack>
+    where
+        T: HasPrivate,
+    {
+        unsafe {
+            assert!(data.len() <= c_int::MAX as usize);
+            let sig = cvt_p(ffi::ECDSA_do_sign(
+                data.as_ptr(),
+                data.len() as LenType,
+                eckey.as_ptr(),
+            ))?;
+            Ok(EcdsaSig::from_ptr(sig))
+        }
+    }
+
+    /// Returns a new `EcdsaSig` by setting the `r` and `s` values associated with an ECDSA signature.
+    #[corresponds(ECDSA_SIG_set0)]
+    pub fn from_private_components(r: BigNum, s: BigNum) -> Result<EcdsaSig, ErrorStack> {
+        unsafe {
+            let sig = cvt_p(ffi::ECDSA_SIG_new())?;
+            ECDSA_SIG_set0(sig, r.as_ptr(), s.as_ptr());
+            mem::forget((r, s));
+            Ok(EcdsaSig::from_ptr(sig))
+        }
+    }
+
+    from_der! {
+        /// Decodes a DER-encoded ECDSA signature.
+        #[corresponds(d2i_ECDSA_SIG)]
+        from_der,
+        EcdsaSig,
+        ffi::d2i_ECDSA_SIG
+    }
+}
+
+impl EcdsaSigRef {
+    to_der! {
+        /// Serializes the ECDSA signature into a DER-encoded ECDSASignature structure.
+        #[corresponds(i2d_ECDSA_SIG)]
+        to_der,
+        ffi::i2d_ECDSA_SIG
+    }
+
+    /// Verifies if the signature is a valid ECDSA signature using the given public key.
+    #[corresponds(ECDSA_do_verify)]
+    pub fn verify<T>(&self, data: &[u8], eckey: &EcKeyRef<T>) -> Result<bool, ErrorStack>
+    where
+        T: HasPublic,
+    {
+        unsafe {
+            assert!(data.len() <= c_int::MAX as usize);
+            cvt_n(ffi::ECDSA_do_verify(
+                data.as_ptr(),
+                data.len() as LenType,
+                self.as_ptr(),
+                eckey.as_ptr(),
+            ))
+            .map(|x| x == 1)
+        }
+    }
+
+    /// Returns internal component: `r` of an `EcdsaSig`. (See X9.62 or FIPS 186-2)
+    #[corresponds(ECDSA_SIG_get0)]
+    pub fn r(&self) -> &BigNumRef {
+        unsafe {
+            let mut r = ptr::null();
+            ECDSA_SIG_get0(self.as_ptr(), &mut r, ptr::null_mut());
+            BigNumRef::from_const_ptr(r)
+        }
+    }
+
+    /// Returns internal components: `s` of an `EcdsaSig`. (See X9.62 or FIPS 186-2)
+    #[corresponds(ECDSA_SIG_get0)]
+    pub fn s(&self) -> &BigNumRef {
+        unsafe {
+            let mut s = ptr::null();
+            ECDSA_SIG_get0(self.as_ptr(), ptr::null_mut(), &mut s);
+            BigNumRef::from_const_ptr(s)
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl273, boringssl))] {
+        use ffi::{ECDSA_SIG_set0, ECDSA_SIG_get0};
+    } else {
+        #[allow(bad_style)]
+        unsafe fn ECDSA_SIG_set0(
+            sig: *mut ffi::ECDSA_SIG,
+            r: *mut ffi::BIGNUM,
+            s: *mut ffi::BIGNUM,
+        ) -> c_int {
+            if r.is_null() || s.is_null() {
+                return 0;
+            }
+            ffi::BN_clear_free((*sig).r);
+            ffi::BN_clear_free((*sig).s);
+            (*sig).r = r;
+            (*sig).s = s;
+            1
+        }
+
+        #[allow(bad_style)]
+        unsafe fn ECDSA_SIG_get0(
+            sig: *const ffi::ECDSA_SIG,
+            pr: *mut *const ffi::BIGNUM,
+            ps: *mut *const ffi::BIGNUM)
+        {
+            if !pr.is_null() {
+                (*pr) = (*sig).r;
+            }
+            if !ps.is_null() {
+                (*ps) = (*sig).s;
+            }
+        }
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+    use crate::ec::EcGroup;
+    use crate::ec::EcKey;
+    use crate::nid::Nid;
+    use crate::pkey::{Private, Public};
+
+    fn get_public_key(group: &EcGroup, x: &EcKey<Private>) -> Result<EcKey<Public>, ErrorStack> {
+        EcKey::from_public_key(group, x.public_key())
+    }
+
+    #[test]
+    #[cfg_attr(osslconf = "OPENSSL_NO_EC", ignore)]
+    fn sign_and_verify() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let private_key = EcKey::generate(&group).unwrap();
+        let public_key = get_public_key(&group, &private_key).unwrap();
+
+        let private_key2 = EcKey::generate(&group).unwrap();
+        let public_key2 = get_public_key(&group, &private_key2).unwrap();
+
+        let data = String::from("hello");
+        let res = EcdsaSig::sign(data.as_bytes(), &private_key).unwrap();
+
+        // Signature can be verified using the correct data & correct public key
+        let verification = res.verify(data.as_bytes(), &public_key).unwrap();
+        assert!(verification);
+
+        // Signature will not be verified using the incorrect data but the correct public key
+        let verification2 = res
+            .verify(String::from("hello2").as_bytes(), &public_key)
+            .unwrap();
+        assert!(!verification2);
+
+        // Signature will not be verified using the correct data but the incorrect public key
+        let verification3 = res.verify(data.as_bytes(), &public_key2).unwrap();
+        assert!(!verification3);
+    }
+
+    #[test]
+    #[cfg_attr(osslconf = "OPENSSL_NO_EC", ignore)]
+    fn check_private_components() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let private_key = EcKey::generate(&group).unwrap();
+        let public_key = get_public_key(&group, &private_key).unwrap();
+        let data = String::from("hello");
+        let res = EcdsaSig::sign(data.as_bytes(), &private_key).unwrap();
+
+        let verification = res.verify(data.as_bytes(), &public_key).unwrap();
+        assert!(verification);
+
+        let r = res.r().to_owned().unwrap();
+        let s = res.s().to_owned().unwrap();
+
+        let res2 = EcdsaSig::from_private_components(r, s).unwrap();
+        let verification2 = res2.verify(data.as_bytes(), &public_key).unwrap();
+        assert!(verification2);
+    }
+
+    #[test]
+    #[cfg_attr(osslconf = "OPENSSL_NO_EC", ignore)]
+    fn serialize_deserialize() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let private_key = EcKey::generate(&group).unwrap();
+        let public_key = get_public_key(&group, &private_key).unwrap();
+
+        let data = String::from("hello");
+        let res = EcdsaSig::sign(data.as_bytes(), &private_key).unwrap();
+
+        let der = res.to_der().unwrap();
+        let sig = EcdsaSig::from_der(&der).unwrap();
+
+        let verification = sig.verify(data.as_bytes(), &public_key).unwrap();
+        assert!(verification);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/encrypt.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/encrypt.rs
--- 43.0.0-1/rust-vendor/openssl/src/encrypt.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/encrypt.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,578 @@
+//! Message encryption.
+//!
+//! The [`Encrypter`] allows for encryption of data given a public key. The [`Decrypter`] can be
+//! used with the corresponding private key to decrypt the data.
+//!
+//! # Examples
+//!
+//! Encrypt and decrypt data given an RSA keypair:
+//!
+//! ```rust
+//! use openssl::encrypt::{Encrypter, Decrypter};
+//! use openssl::rsa::{Rsa, Padding};
+//! use openssl::pkey::PKey;
+//!
+//! // Generate a keypair
+//! let keypair = Rsa::generate(2048).unwrap();
+//! let keypair = PKey::from_rsa(keypair).unwrap();
+//!
+//! let data = b"hello, world!";
+//!
+//! // Encrypt the data with RSA PKCS1
+//! let mut encrypter = Encrypter::new(&keypair).unwrap();
+//! encrypter.set_rsa_padding(Padding::PKCS1).unwrap();
+//! // Create an output buffer
+//! let buffer_len = encrypter.encrypt_len(data).unwrap();
+//! let mut encrypted = vec![0; buffer_len];
+//! // Encrypt and truncate the buffer
+//! let encrypted_len = encrypter.encrypt(data, &mut encrypted).unwrap();
+//! encrypted.truncate(encrypted_len);
+//!
+//! // Decrypt the data
+//! let mut decrypter = Decrypter::new(&keypair).unwrap();
+//! decrypter.set_rsa_padding(Padding::PKCS1).unwrap();
+//! // Create an output buffer
+//! let buffer_len = decrypter.decrypt_len(&encrypted).unwrap();
+//! let mut decrypted = vec![0; buffer_len];
+//! // Encrypt and truncate the buffer
+//! let decrypted_len = decrypter.decrypt(&encrypted, &mut decrypted).unwrap();
+//! decrypted.truncate(decrypted_len);
+//! assert_eq!(&*decrypted, data);
+//! ```
+#[cfg(any(ossl102, libressl310))]
+use libc::c_int;
+use std::{marker::PhantomData, ptr};
+
+use crate::error::ErrorStack;
+use crate::hash::MessageDigest;
+use crate::pkey::{HasPrivate, HasPublic, PKeyRef};
+use crate::rsa::Padding;
+use crate::{cvt, cvt_p};
+use foreign_types::ForeignTypeRef;
+
+/// A type which encrypts data.
+pub struct Encrypter<'a> {
+    pctx: *mut ffi::EVP_PKEY_CTX,
+    _p: PhantomData<&'a ()>,
+}
+
+unsafe impl<'a> Sync for Encrypter<'a> {}
+unsafe impl<'a> Send for Encrypter<'a> {}
+
+impl<'a> Drop for Encrypter<'a> {
+    fn drop(&mut self) {
+        unsafe {
+            ffi::EVP_PKEY_CTX_free(self.pctx);
+        }
+    }
+}
+
+impl<'a> Encrypter<'a> {
+    /// Creates a new `Encrypter`.
+    ///
+    /// OpenSSL documentation at [`EVP_PKEY_encrypt_init`].
+    ///
+    /// [`EVP_PKEY_encrypt_init`]: https://www.openssl.org/docs/manmaster/man3/EVP_PKEY_encrypt_init.html
+    pub fn new<T>(pkey: &'a PKeyRef<T>) -> Result<Encrypter<'a>, ErrorStack>
+    where
+        T: HasPublic,
+    {
+        unsafe {
+            ffi::init();
+
+            let pctx = cvt_p(ffi::EVP_PKEY_CTX_new(pkey.as_ptr(), ptr::null_mut()))?;
+            let r = ffi::EVP_PKEY_encrypt_init(pctx);
+            if r != 1 {
+                ffi::EVP_PKEY_CTX_free(pctx);
+                return Err(ErrorStack::get());
+            }
+
+            Ok(Encrypter {
+                pctx,
+                _p: PhantomData,
+            })
+        }
+    }
+
+    /// Returns the RSA padding mode in use.
+    ///
+    /// This is only useful for RSA keys.
+    ///
+    /// This corresponds to `EVP_PKEY_CTX_get_rsa_padding`.
+    pub fn rsa_padding(&self) -> Result<Padding, ErrorStack> {
+        unsafe {
+            let mut pad = 0;
+            cvt(ffi::EVP_PKEY_CTX_get_rsa_padding(self.pctx, &mut pad))
+                .map(|_| Padding::from_raw(pad))
+        }
+    }
+
+    /// Sets the RSA padding mode.
+    ///
+    /// This is only useful for RSA keys.
+    ///
+    /// This corresponds to [`EVP_PKEY_CTX_set_rsa_padding`].
+    ///
+    /// [`EVP_PKEY_CTX_set_rsa_padding`]: https://www.openssl.org/docs/manmaster/crypto/EVP_PKEY_CTX_set_rsa_padding.html
+    pub fn set_rsa_padding(&mut self, padding: Padding) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set_rsa_padding(
+                self.pctx,
+                padding.as_raw(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the RSA MGF1 algorithm.
+    ///
+    /// This is only useful for RSA keys.
+    ///
+    /// This corresponds to [`EVP_PKEY_CTX_set_rsa_mgf1_md`].
+    ///
+    /// [`EVP_PKEY_CTX_set_rsa_mgf1_md`]: https://www.openssl.org/docs/manmaster/man7/RSA-PSS.html
+    pub fn set_rsa_mgf1_md(&mut self, md: MessageDigest) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set_rsa_mgf1_md(
+                self.pctx,
+                md.as_ptr() as *mut _,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the RSA OAEP algorithm.
+    ///
+    /// This is only useful for RSA keys.
+    ///
+    /// This corresponds to [`EVP_PKEY_CTX_set_rsa_oaep_md`].
+    ///
+    /// [`EVP_PKEY_CTX_set_rsa_oaep_md`]: https://www.openssl.org/docs/manmaster/man3/EVP_PKEY_CTX_set_rsa_oaep_md.html
+    #[cfg(any(ossl102, libressl310))]
+    pub fn set_rsa_oaep_md(&mut self, md: MessageDigest) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set_rsa_oaep_md(
+                self.pctx,
+                md.as_ptr() as *mut _,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the RSA OAEP label.
+    ///
+    /// This is only useful for RSA keys.
+    ///
+    /// This corresponds to [`EVP_PKEY_CTX_set0_rsa_oaep_label`].
+    ///
+    /// [`EVP_PKEY_CTX_set0_rsa_oaep_label`]: https://www.openssl.org/docs/manmaster/man3/EVP_PKEY_CTX_set0_rsa_oaep_label.html
+    #[cfg(any(ossl102, libressl310))]
+    pub fn set_rsa_oaep_label(&mut self, label: &[u8]) -> Result<(), ErrorStack> {
+        unsafe {
+            let p = cvt_p(ffi::OPENSSL_malloc(label.len() as _))?;
+            ptr::copy_nonoverlapping(label.as_ptr(), p as *mut u8, label.len());
+
+            cvt(ffi::EVP_PKEY_CTX_set0_rsa_oaep_label(
+                self.pctx,
+                p,
+                label.len() as c_int,
+            ))
+            .map(|_| ())
+            .map_err(|e| {
+                ffi::OPENSSL_free(p);
+                e
+            })
+        }
+    }
+
+    /// Performs public key encryption.
+    ///
+    /// In order to know the size needed for the output buffer, use [`encrypt_len`](Encrypter::encrypt_len).
+    /// Note that the length of the output buffer can be greater of the length of the encoded data.
+    /// ```
+    /// # use openssl::{
+    /// #   encrypt::Encrypter,
+    /// #   pkey::PKey,
+    /// #   rsa::{Rsa, Padding},
+    /// # };
+    /// #
+    /// # let key = include_bytes!("../test/rsa.pem");
+    /// # let private_key = Rsa::private_key_from_pem(key).unwrap();
+    /// # let pkey = PKey::from_rsa(private_key).unwrap();
+    /// # let input = b"hello world".to_vec();
+    /// #
+    /// let mut encrypter = Encrypter::new(&pkey).unwrap();
+    /// encrypter.set_rsa_padding(Padding::PKCS1).unwrap();
+    ///
+    /// // Get the length of the output buffer
+    /// let buffer_len = encrypter.encrypt_len(&input).unwrap();
+    /// let mut encoded = vec![0u8; buffer_len];
+    ///
+    /// // Encode the data and get its length
+    /// let encoded_len = encrypter.encrypt(&input, &mut encoded).unwrap();
+    ///
+    /// // Use only the part of the buffer with the encoded data
+    /// let encoded = &encoded[..encoded_len];
+    /// ```
+    ///
+    /// This corresponds to [`EVP_PKEY_encrypt`].
+    ///
+    /// [`EVP_PKEY_encrypt`]: https://www.openssl.org/docs/manmaster/man3/EVP_PKEY_encrypt.html
+    pub fn encrypt(&self, from: &[u8], to: &mut [u8]) -> Result<usize, ErrorStack> {
+        let mut written = to.len();
+        unsafe {
+            cvt(ffi::EVP_PKEY_encrypt(
+                self.pctx,
+                to.as_mut_ptr(),
+                &mut written,
+                from.as_ptr(),
+                from.len(),
+            ))?;
+        }
+
+        Ok(written)
+    }
+
+    /// Gets the size of the buffer needed to encrypt the input data.
+    ///
+    /// This corresponds to [`EVP_PKEY_encrypt`] called with a null pointer as output argument.
+    ///
+    /// [`EVP_PKEY_encrypt`]: https://www.openssl.org/docs/manmaster/man3/EVP_PKEY_encrypt.html
+    pub fn encrypt_len(&self, from: &[u8]) -> Result<usize, ErrorStack> {
+        let mut written = 0;
+        unsafe {
+            cvt(ffi::EVP_PKEY_encrypt(
+                self.pctx,
+                ptr::null_mut(),
+                &mut written,
+                from.as_ptr(),
+                from.len(),
+            ))?;
+        }
+
+        Ok(written)
+    }
+}
+
+/// A type which decrypts data.
+pub struct Decrypter<'a> {
+    pctx: *mut ffi::EVP_PKEY_CTX,
+    _p: PhantomData<&'a ()>,
+}
+
+unsafe impl<'a> Sync for Decrypter<'a> {}
+unsafe impl<'a> Send for Decrypter<'a> {}
+
+impl<'a> Drop for Decrypter<'a> {
+    fn drop(&mut self) {
+        unsafe {
+            ffi::EVP_PKEY_CTX_free(self.pctx);
+        }
+    }
+}
+
+impl<'a> Decrypter<'a> {
+    /// Creates a new `Decrypter`.
+    ///
+    /// OpenSSL documentation at [`EVP_PKEY_decrypt_init`].
+    ///
+    /// [`EVP_PKEY_decrypt_init`]: https://www.openssl.org/docs/manmaster/man3/EVP_PKEY_decrypt_init.html
+    pub fn new<T>(pkey: &'a PKeyRef<T>) -> Result<Decrypter<'a>, ErrorStack>
+    where
+        T: HasPrivate,
+    {
+        unsafe {
+            ffi::init();
+
+            let pctx = cvt_p(ffi::EVP_PKEY_CTX_new(pkey.as_ptr(), ptr::null_mut()))?;
+            let r = ffi::EVP_PKEY_decrypt_init(pctx);
+            if r != 1 {
+                ffi::EVP_PKEY_CTX_free(pctx);
+                return Err(ErrorStack::get());
+            }
+
+            Ok(Decrypter {
+                pctx,
+                _p: PhantomData,
+            })
+        }
+    }
+
+    /// Returns the RSA padding mode in use.
+    ///
+    /// This is only useful for RSA keys.
+    ///
+    /// This corresponds to `EVP_PKEY_CTX_get_rsa_padding`.
+    pub fn rsa_padding(&self) -> Result<Padding, ErrorStack> {
+        unsafe {
+            let mut pad = 0;
+            cvt(ffi::EVP_PKEY_CTX_get_rsa_padding(self.pctx, &mut pad))
+                .map(|_| Padding::from_raw(pad))
+        }
+    }
+
+    /// Sets the RSA padding mode.
+    ///
+    /// This is only useful for RSA keys.
+    ///
+    /// This corresponds to [`EVP_PKEY_CTX_set_rsa_padding`].
+    ///
+    /// [`EVP_PKEY_CTX_set_rsa_padding`]: https://www.openssl.org/docs/manmaster/crypto/EVP_PKEY_CTX_set_rsa_padding.html
+    pub fn set_rsa_padding(&mut self, padding: Padding) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set_rsa_padding(
+                self.pctx,
+                padding.as_raw(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the RSA MGF1 algorithm.
+    ///
+    /// This is only useful for RSA keys.
+    ///
+    /// This corresponds to [`EVP_PKEY_CTX_set_rsa_mgf1_md`].
+    ///
+    /// [`EVP_PKEY_CTX_set_rsa_mgf1_md`]: https://www.openssl.org/docs/manmaster/man7/RSA-PSS.html
+    pub fn set_rsa_mgf1_md(&mut self, md: MessageDigest) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set_rsa_mgf1_md(
+                self.pctx,
+                md.as_ptr() as *mut _,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the RSA OAEP algorithm.
+    ///
+    /// This is only useful for RSA keys.
+    ///
+    /// This corresponds to [`EVP_PKEY_CTX_set_rsa_oaep_md`].
+    ///
+    /// [`EVP_PKEY_CTX_set_rsa_oaep_md`]: https://www.openssl.org/docs/manmaster/man3/EVP_PKEY_CTX_set_rsa_oaep_md.html
+    #[cfg(any(ossl102, libressl310))]
+    pub fn set_rsa_oaep_md(&mut self, md: MessageDigest) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set_rsa_oaep_md(
+                self.pctx,
+                md.as_ptr() as *mut _,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the RSA OAEP label.
+    ///
+    /// This is only useful for RSA keys.
+    ///
+    /// This corresponds to [`EVP_PKEY_CTX_set0_rsa_oaep_label`].
+    ///
+    /// [`EVP_PKEY_CTX_set0_rsa_oaep_label`]: https://www.openssl.org/docs/manmaster/man3/EVP_PKEY_CTX_set0_rsa_oaep_label.html
+    #[cfg(any(ossl102, libressl310))]
+    pub fn set_rsa_oaep_label(&mut self, label: &[u8]) -> Result<(), ErrorStack> {
+        unsafe {
+            let p = cvt_p(ffi::OPENSSL_malloc(label.len() as _))?;
+            ptr::copy_nonoverlapping(label.as_ptr(), p as *mut u8, label.len());
+
+            cvt(ffi::EVP_PKEY_CTX_set0_rsa_oaep_label(
+                self.pctx,
+                p,
+                label.len() as c_int,
+            ))
+            .map(|_| ())
+            .map_err(|e| {
+                ffi::OPENSSL_free(p);
+                e
+            })
+        }
+    }
+
+    /// Performs public key decryption.
+    ///
+    /// In order to know the size needed for the output buffer, use [`decrypt_len`](Decrypter::decrypt_len).
+    /// Note that the length of the output buffer can be greater of the length of the decoded data.
+    /// ```
+    /// # use openssl::{
+    /// #   encrypt::Decrypter,
+    /// #   pkey::PKey,
+    /// #   rsa::{Rsa, Padding},
+    /// # };
+    /// #
+    /// # const INPUT: &[u8] = b"\
+    /// #     \x26\xa1\xc1\x13\xc5\x7f\xb4\x9f\xa0\xb4\xde\x61\x5e\x2e\xc6\xfb\x76\x5c\xd1\x2b\x5f\
+    /// #     \x1d\x36\x60\xfa\xf8\xe8\xb3\x21\xf4\x9c\x70\xbc\x03\xea\xea\xac\xce\x4b\xb3\xf6\x45\
+    /// #     \xcc\xb3\x80\x9e\xa8\xf7\xc3\x5d\x06\x12\x7a\xa3\x0c\x30\x67\xf1\xe7\x94\x6c\xf6\x26\
+    /// #     \xac\x28\x17\x59\x69\xe1\xdc\xed\x7e\xc0\xe9\x62\x57\x49\xce\xdd\x13\x07\xde\x18\x03\
+    /// #     \x0f\x9d\x61\x65\xb9\x23\x8c\x78\x4b\xad\x23\x49\x75\x47\x64\xa0\xa0\xa2\x90\xc1\x49\
+    /// #     \x1b\x05\x24\xc2\xe9\x2c\x0d\x49\x78\x72\x61\x72\xed\x8b\x6f\x8a\xe8\xca\x05\x5c\x58\
+    /// #     \xd6\x95\xd6\x7b\xe3\x2d\x0d\xaa\x3e\x6d\x3c\x9a\x1c\x1d\xb4\x6c\x42\x9d\x9a\x82\x55\
+    /// #     \xd9\xde\xc8\x08\x7b\x17\xac\xd7\xaf\x86\x7b\x69\x9e\x3c\xf4\x5e\x1c\x39\x52\x6d\x62\
+    /// #     \x50\x51\xbd\xa6\xc8\x4e\xe9\x34\xf0\x37\x0d\xa9\xa9\x77\xe6\xf5\xc2\x47\x2d\xa8\xee\
+    /// #     \x3f\x69\x78\xff\xa9\xdc\x70\x22\x20\x9a\x5c\x9b\x70\x15\x90\xd3\xb4\x0e\x54\x9e\x48\
+    /// #     \xed\xb6\x2c\x88\xfc\xb4\xa9\x37\x10\xfa\x71\xb2\xec\x75\xe7\xe7\x0e\xf4\x60\x2c\x7b\
+    /// #     \x58\xaf\xa0\x53\xbd\x24\xf1\x12\xe3\x2e\x99\x25\x0a\x54\x54\x9d\xa1\xdb\xca\x41\x85\
+    /// #     \xf4\x62\x78\x64";
+    /// #
+    /// # let key = include_bytes!("../test/rsa.pem");
+    /// # let private_key = Rsa::private_key_from_pem(key).unwrap();
+    /// # let pkey = PKey::from_rsa(private_key).unwrap();
+    /// # let input = INPUT.to_vec();
+    /// #
+    /// let mut decrypter = Decrypter::new(&pkey).unwrap();
+    /// decrypter.set_rsa_padding(Padding::PKCS1).unwrap();
+    ///
+    /// // Get the length of the output buffer
+    /// let buffer_len = decrypter.decrypt_len(&input).unwrap();
+    /// let mut decoded = vec![0u8; buffer_len];
+    ///
+    /// // Decrypt the data and get its length
+    /// let decoded_len = decrypter.decrypt(&input, &mut decoded).unwrap();
+    ///
+    /// // Use only the part of the buffer with the decrypted data
+    /// let decoded = &decoded[..decoded_len];
+    /// ```
+    ///
+    /// This corresponds to [`EVP_PKEY_decrypt`].
+    ///
+    /// [`EVP_PKEY_decrypt`]: https://www.openssl.org/docs/manmaster/man3/EVP_PKEY_decrypt.html
+    pub fn decrypt(&self, from: &[u8], to: &mut [u8]) -> Result<usize, ErrorStack> {
+        let mut written = to.len();
+        unsafe {
+            cvt(ffi::EVP_PKEY_decrypt(
+                self.pctx,
+                to.as_mut_ptr(),
+                &mut written,
+                from.as_ptr(),
+                from.len(),
+            ))?;
+        }
+
+        Ok(written)
+    }
+
+    /// Gets the size of the buffer needed to decrypt the input data.
+    ///
+    /// This corresponds to [`EVP_PKEY_decrypt`] called with a null pointer as output argument.
+    ///
+    /// [`EVP_PKEY_decrypt`]: https://www.openssl.org/docs/manmaster/man3/EVP_PKEY_decrypt.html
+    pub fn decrypt_len(&self, from: &[u8]) -> Result<usize, ErrorStack> {
+        let mut written = 0;
+        unsafe {
+            cvt(ffi::EVP_PKEY_decrypt(
+                self.pctx,
+                ptr::null_mut(),
+                &mut written,
+                from.as_ptr(),
+                from.len(),
+            ))?;
+        }
+
+        Ok(written)
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use hex::FromHex;
+
+    use crate::encrypt::{Decrypter, Encrypter};
+    #[cfg(any(ossl102, libressl310))]
+    use crate::hash::MessageDigest;
+    use crate::pkey::PKey;
+    use crate::rsa::{Padding, Rsa};
+
+    const INPUT: &str =
+        "65794a68624763694f694a53557a49314e694a392e65794a7063334d694f694a71623255694c41304b49434a6c\
+         654841694f6a457a4d4441344d546b7a4f44417344516f67496d6830644841364c79396c654746746347786c4c\
+         6d4e76625339706331397962323930496a7030636e566c6651";
+
+    #[test]
+    fn rsa_encrypt_decrypt() {
+        let key = include_bytes!("../test/rsa.pem");
+        let private_key = Rsa::private_key_from_pem(key).unwrap();
+        let pkey = PKey::from_rsa(private_key).unwrap();
+
+        let mut encrypter = Encrypter::new(&pkey).unwrap();
+        encrypter.set_rsa_padding(Padding::PKCS1).unwrap();
+        let input = Vec::from_hex(INPUT).unwrap();
+        let buffer_len = encrypter.encrypt_len(&input).unwrap();
+        let mut encoded = vec![0u8; buffer_len];
+        let encoded_len = encrypter.encrypt(&input, &mut encoded).unwrap();
+        let encoded = &encoded[..encoded_len];
+
+        let mut decrypter = Decrypter::new(&pkey).unwrap();
+        decrypter.set_rsa_padding(Padding::PKCS1).unwrap();
+        let buffer_len = decrypter.decrypt_len(encoded).unwrap();
+        let mut decoded = vec![0u8; buffer_len];
+        let decoded_len = decrypter.decrypt(encoded, &mut decoded).unwrap();
+        let decoded = &decoded[..decoded_len];
+
+        assert_eq!(decoded, &*input);
+    }
+
+    #[test]
+    #[cfg(any(ossl102, libressl310))]
+    fn rsa_encrypt_decrypt_with_sha256() {
+        let key = include_bytes!("../test/rsa.pem");
+        let private_key = Rsa::private_key_from_pem(key).unwrap();
+        let pkey = PKey::from_rsa(private_key).unwrap();
+
+        let md = MessageDigest::sha256();
+
+        let mut encrypter = Encrypter::new(&pkey).unwrap();
+        encrypter.set_rsa_padding(Padding::PKCS1_OAEP).unwrap();
+        encrypter.set_rsa_oaep_md(md).unwrap();
+        encrypter.set_rsa_mgf1_md(md).unwrap();
+        let input = Vec::from_hex(INPUT).unwrap();
+        let buffer_len = encrypter.encrypt_len(&input).unwrap();
+        let mut encoded = vec![0u8; buffer_len];
+        let encoded_len = encrypter.encrypt(&input, &mut encoded).unwrap();
+        let encoded = &encoded[..encoded_len];
+
+        let mut decrypter = Decrypter::new(&pkey).unwrap();
+        decrypter.set_rsa_padding(Padding::PKCS1_OAEP).unwrap();
+        decrypter.set_rsa_oaep_md(md).unwrap();
+        decrypter.set_rsa_mgf1_md(md).unwrap();
+        let buffer_len = decrypter.decrypt_len(encoded).unwrap();
+        let mut decoded = vec![0u8; buffer_len];
+        let decoded_len = decrypter.decrypt(encoded, &mut decoded).unwrap();
+        let decoded = &decoded[..decoded_len];
+
+        assert_eq!(decoded, &*input);
+    }
+
+    #[test]
+    #[cfg(any(ossl102, libressl310))]
+    fn rsa_encrypt_decrypt_oaep_label() {
+        let key = include_bytes!("../test/rsa.pem");
+        let private_key = Rsa::private_key_from_pem(key).unwrap();
+        let pkey = PKey::from_rsa(private_key).unwrap();
+
+        let mut encrypter = Encrypter::new(&pkey).unwrap();
+        encrypter.set_rsa_padding(Padding::PKCS1_OAEP).unwrap();
+        encrypter.set_rsa_oaep_label(b"test_oaep_label").unwrap();
+        let input = Vec::from_hex(INPUT).unwrap();
+        let buffer_len = encrypter.encrypt_len(&input).unwrap();
+        let mut encoded = vec![0u8; buffer_len];
+        let encoded_len = encrypter.encrypt(&input, &mut encoded).unwrap();
+        let encoded = &encoded[..encoded_len];
+
+        let mut decrypter = Decrypter::new(&pkey).unwrap();
+        decrypter.set_rsa_padding(Padding::PKCS1_OAEP).unwrap();
+        decrypter.set_rsa_oaep_label(b"test_oaep_label").unwrap();
+        let buffer_len = decrypter.decrypt_len(encoded).unwrap();
+        let mut decoded = vec![0u8; buffer_len];
+        let decoded_len = decrypter.decrypt(encoded, &mut decoded).unwrap();
+        let decoded = &decoded[..decoded_len];
+
+        assert_eq!(decoded, &*input);
+
+        decrypter.set_rsa_oaep_label(b"wrong_oaep_label").unwrap();
+        let buffer_len = decrypter.decrypt_len(encoded).unwrap();
+        let mut decoded = vec![0u8; buffer_len];
+
+        assert!(decrypter.decrypt(encoded, &mut decoded).is_err());
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/envelope.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/envelope.rs
--- 43.0.0-1/rust-vendor/openssl/src/envelope.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/envelope.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,181 @@
+//! Envelope encryption.
+//!
+//! # Example
+//!
+//! ```rust
+//! use openssl::rsa::Rsa;
+//! use openssl::envelope::Seal;
+//! use openssl::pkey::PKey;
+//! use openssl::symm::Cipher;
+//!
+//! let rsa = Rsa::generate(2048).unwrap();
+//! let key = PKey::from_rsa(rsa).unwrap();
+//!
+//! let cipher = Cipher::aes_256_cbc();
+//! let mut seal = Seal::new(cipher, &[key]).unwrap();
+//!
+//! let secret = b"My secret message";
+//! let mut encrypted = vec![0; secret.len() + cipher.block_size()];
+//!
+//! let mut enc_len = seal.update(secret, &mut encrypted).unwrap();
+//! enc_len += seal.finalize(&mut encrypted[enc_len..]).unwrap();
+//! encrypted.truncate(enc_len);
+//! ```
+use crate::cipher::CipherRef;
+use crate::cipher_ctx::CipherCtx;
+use crate::error::ErrorStack;
+use crate::pkey::{HasPrivate, HasPublic, PKey, PKeyRef};
+use crate::symm::Cipher;
+use foreign_types::ForeignTypeRef;
+
+/// Represents an EVP_Seal context.
+pub struct Seal {
+    ctx: CipherCtx,
+    iv: Option<Vec<u8>>,
+    enc_keys: Vec<Vec<u8>>,
+}
+
+impl Seal {
+    /// Creates a new `Seal`.
+    pub fn new<T>(cipher: Cipher, pub_keys: &[PKey<T>]) -> Result<Seal, ErrorStack>
+    where
+        T: HasPublic,
+    {
+        let mut iv = cipher.iv_len().map(|len| vec![0; len]);
+        let mut enc_keys = vec![vec![]; pub_keys.len()];
+
+        let mut ctx = CipherCtx::new()?;
+        ctx.seal_init(
+            Some(unsafe { CipherRef::from_ptr(cipher.as_ptr() as *mut _) }),
+            pub_keys,
+            &mut enc_keys,
+            iv.as_deref_mut(),
+        )?;
+
+        Ok(Seal { ctx, iv, enc_keys })
+    }
+
+    /// Returns the initialization vector, if the cipher uses one.
+    #[allow(clippy::option_as_ref_deref)]
+    pub fn iv(&self) -> Option<&[u8]> {
+        self.iv.as_ref().map(|v| &**v)
+    }
+
+    /// Returns the encrypted keys.
+    pub fn encrypted_keys(&self) -> &[Vec<u8>] {
+        &self.enc_keys
+    }
+
+    /// Feeds data from `input` through the cipher, writing encrypted bytes into `output`.
+    ///
+    /// The number of bytes written to `output` is returned. Note that this may
+    /// not be equal to the length of `input`.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `output.len() < input.len() + block_size` where `block_size` is
+    /// the block size of the cipher (see `Cipher::block_size`), or if
+    /// `output.len() > c_int::MAX`.
+    pub fn update(&mut self, input: &[u8], output: &mut [u8]) -> Result<usize, ErrorStack> {
+        self.ctx.cipher_update(input, Some(output))
+    }
+
+    /// Finishes the encryption process, writing any remaining data to `output`.
+    ///
+    /// The number of bytes written to `output` is returned.
+    ///
+    /// `update` should not be called after this method.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `output` is less than the cipher's block size.
+    pub fn finalize(&mut self, output: &mut [u8]) -> Result<usize, ErrorStack> {
+        self.ctx.cipher_final(output)
+    }
+}
+
+/// Represents an EVP_Open context.
+pub struct Open {
+    ctx: CipherCtx,
+}
+
+impl Open {
+    /// Creates a new `Open`.
+    pub fn new<T>(
+        cipher: Cipher,
+        priv_key: &PKeyRef<T>,
+        iv: Option<&[u8]>,
+        encrypted_key: &[u8],
+    ) -> Result<Open, ErrorStack>
+    where
+        T: HasPrivate,
+    {
+        let mut ctx = CipherCtx::new()?;
+        ctx.open_init(
+            Some(unsafe { CipherRef::from_ptr(cipher.as_ptr() as *mut _) }),
+            encrypted_key,
+            iv,
+            Some(priv_key),
+        )?;
+
+        Ok(Open { ctx })
+    }
+
+    /// Feeds data from `input` through the cipher, writing decrypted bytes into `output`.
+    ///
+    /// The number of bytes written to `output` is returned. Note that this may
+    /// not be equal to the length of `input`.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `output.len() < input.len() + block_size` where
+    /// `block_size` is the block size of the cipher (see `Cipher::block_size`),
+    /// or if `output.len() > c_int::MAX`.
+    pub fn update(&mut self, input: &[u8], output: &mut [u8]) -> Result<usize, ErrorStack> {
+        self.ctx.cipher_update(input, Some(output))
+    }
+
+    /// Finishes the decryption process, writing any remaining data to `output`.
+    ///
+    /// The number of bytes written to `output` is returned.
+    ///
+    /// `update` should not be called after this method.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `output` is less than the cipher's block size.
+    pub fn finalize(&mut self, output: &mut [u8]) -> Result<usize, ErrorStack> {
+        self.ctx.cipher_final(output)
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+    use crate::pkey::PKey;
+    use crate::symm::Cipher;
+
+    #[test]
+    fn public_encrypt_private_decrypt() {
+        let private_pem = include_bytes!("../test/rsa.pem");
+        let public_pem = include_bytes!("../test/rsa.pem.pub");
+        let private_key = PKey::private_key_from_pem(private_pem).unwrap();
+        let public_key = PKey::public_key_from_pem(public_pem).unwrap();
+        let cipher = Cipher::aes_256_cbc();
+        let secret = b"My secret message";
+
+        let mut seal = Seal::new(cipher, &[public_key]).unwrap();
+        let mut encrypted = vec![0; secret.len() + cipher.block_size()];
+        let mut enc_len = seal.update(secret, &mut encrypted).unwrap();
+        enc_len += seal.finalize(&mut encrypted[enc_len..]).unwrap();
+        let iv = seal.iv();
+        let encrypted_key = &seal.encrypted_keys()[0];
+
+        let mut open = Open::new(cipher, &private_key, iv, encrypted_key).unwrap();
+        let mut decrypted = vec![0; enc_len + cipher.block_size()];
+        let mut dec_len = open.update(&encrypted[..enc_len], &mut decrypted).unwrap();
+        dec_len += open.finalize(&mut decrypted[dec_len..]).unwrap();
+
+        assert_eq!(&secret[..], &decrypted[..dec_len]);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/error.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/error.rs
--- 43.0.0-1/rust-vendor/openssl/src/error.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/error.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,418 @@
+//! Errors returned by OpenSSL library.
+//!
+//! OpenSSL errors are stored in an `ErrorStack`.  Most methods in the crate
+//! returns a `Result<T, ErrorStack>` type.
+//!
+//! # Examples
+//!
+//! ```
+//! use openssl::error::ErrorStack;
+//! use openssl::bn::BigNum;
+//!
+//! let an_error = BigNum::from_dec_str("Cannot parse letters");
+//! match an_error {
+//!     Ok(_)  => (),
+//!     Err(e) => println!("Parsing Error: {:?}", e),
+//! }
+//! ```
+use cfg_if::cfg_if;
+use libc::{c_char, c_int};
+use std::borrow::Cow;
+#[cfg(boringssl)]
+use std::convert::TryInto;
+use std::error;
+use std::ffi::CStr;
+use std::fmt;
+use std::io;
+use std::ptr;
+use std::str;
+
+#[cfg(not(boringssl))]
+type ErrType = libc::c_ulong;
+#[cfg(boringssl)]
+type ErrType = libc::c_uint;
+
+/// Collection of [`Error`]s from OpenSSL.
+///
+/// [`Error`]: struct.Error.html
+#[derive(Debug, Clone)]
+pub struct ErrorStack(Vec<Error>);
+
+impl ErrorStack {
+    /// Returns the contents of the OpenSSL error stack.
+    pub fn get() -> ErrorStack {
+        let mut vec = vec![];
+        while let Some(err) = Error::get() {
+            vec.push(err);
+        }
+        ErrorStack(vec)
+    }
+
+    /// Pushes the errors back onto the OpenSSL error stack.
+    pub fn put(&self) {
+        for error in self.errors() {
+            error.put();
+        }
+    }
+}
+
+impl ErrorStack {
+    /// Returns the errors in the stack.
+    pub fn errors(&self) -> &[Error] {
+        &self.0
+    }
+}
+
+impl fmt::Display for ErrorStack {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
+        if self.0.is_empty() {
+            return fmt.write_str("OpenSSL error");
+        }
+
+        let mut first = true;
+        for err in &self.0 {
+            if !first {
+                fmt.write_str(", ")?;
+            }
+            write!(fmt, "{}", err)?;
+            first = false;
+        }
+        Ok(())
+    }
+}
+
+impl error::Error for ErrorStack {}
+
+impl From<ErrorStack> for io::Error {
+    fn from(e: ErrorStack) -> io::Error {
+        io::Error::new(io::ErrorKind::Other, e)
+    }
+}
+
+impl From<ErrorStack> for fmt::Error {
+    fn from(_: ErrorStack) -> fmt::Error {
+        fmt::Error
+    }
+}
+
+/// An error reported from OpenSSL.
+#[derive(Clone)]
+pub struct Error {
+    code: ErrType,
+    file: ShimStr,
+    line: c_int,
+    func: Option<ShimStr>,
+    data: Option<Cow<'static, str>>,
+}
+
+unsafe impl Sync for Error {}
+unsafe impl Send for Error {}
+
+impl Error {
+    /// Returns the first error on the OpenSSL error stack.
+    pub fn get() -> Option<Error> {
+        unsafe {
+            ffi::init();
+
+            let mut file = ptr::null();
+            let mut line = 0;
+            let mut func = ptr::null();
+            let mut data = ptr::null();
+            let mut flags = 0;
+            match ERR_get_error_all(&mut file, &mut line, &mut func, &mut data, &mut flags) {
+                0 => None,
+                code => {
+                    // The memory referenced by data is only valid until that slot is overwritten
+                    // in the error stack, so we'll need to copy it off if it's dynamic
+                    let data = if flags & ffi::ERR_TXT_STRING != 0 {
+                        let bytes = CStr::from_ptr(data as *const _).to_bytes();
+                        let data = str::from_utf8(bytes).unwrap();
+                        #[cfg(not(boringssl))]
+                        let data = if flags & ffi::ERR_TXT_MALLOCED != 0 {
+                            Cow::Owned(data.to_string())
+                        } else {
+                            Cow::Borrowed(data)
+                        };
+                        #[cfg(boringssl)]
+                        let data = Cow::Borrowed(data);
+                        Some(data)
+                    } else {
+                        None
+                    };
+
+                    let file = ShimStr::new(file);
+
+                    let func = if func.is_null() {
+                        None
+                    } else {
+                        Some(ShimStr::new(func))
+                    };
+
+                    Some(Error {
+                        code,
+                        file,
+                        line,
+                        func,
+                        data,
+                    })
+                }
+            }
+        }
+    }
+
+    /// Pushes the error back onto the OpenSSL error stack.
+    pub fn put(&self) {
+        self.put_error();
+
+        unsafe {
+            let data = match self.data {
+                Some(Cow::Borrowed(data)) => Some((data.as_ptr() as *mut c_char, 0)),
+                Some(Cow::Owned(ref data)) => {
+                    let ptr = ffi::CRYPTO_malloc(
+                        (data.len() + 1) as _,
+                        concat!(file!(), "\0").as_ptr() as _,
+                        line!() as _,
+                    ) as *mut c_char;
+                    if ptr.is_null() {
+                        None
+                    } else {
+                        ptr::copy_nonoverlapping(data.as_ptr(), ptr as *mut u8, data.len());
+                        *ptr.add(data.len()) = 0;
+                        Some((ptr, ffi::ERR_TXT_MALLOCED))
+                    }
+                }
+                None => None,
+            };
+            if let Some((ptr, flags)) = data {
+                ffi::ERR_set_error_data(ptr, flags | ffi::ERR_TXT_STRING);
+            }
+        }
+    }
+
+    #[cfg(ossl300)]
+    fn put_error(&self) {
+        unsafe {
+            ffi::ERR_new();
+            ffi::ERR_set_debug(
+                self.file.as_ptr(),
+                self.line,
+                self.func.as_ref().map_or(ptr::null(), |s| s.as_ptr()),
+            );
+            ffi::ERR_set_error(self.library_code(), self.reason_code(), ptr::null());
+        }
+    }
+
+    #[cfg(not(ossl300))]
+    fn put_error(&self) {
+        #[cfg(not(boringssl))]
+        let line = self.line;
+        #[cfg(boringssl)]
+        let line = self.line.try_into().unwrap();
+        unsafe {
+            ffi::ERR_put_error(
+                self.library_code(),
+                ffi::ERR_GET_FUNC(self.code),
+                self.reason_code(),
+                self.file.as_ptr(),
+                line,
+            );
+        }
+    }
+
+    /// Returns the raw OpenSSL error code for this error.
+    pub fn code(&self) -> ErrType {
+        self.code
+    }
+
+    /// Returns the name of the library reporting the error, if available.
+    pub fn library(&self) -> Option<&'static str> {
+        unsafe {
+            let cstr = ffi::ERR_lib_error_string(self.code);
+            if cstr.is_null() {
+                return None;
+            }
+            let bytes = CStr::from_ptr(cstr as *const _).to_bytes();
+            Some(str::from_utf8(bytes).unwrap())
+        }
+    }
+
+    /// Returns the raw OpenSSL error constant for the library reporting the
+    /// error.
+    // On BoringSSL ERR_GET_{LIB,FUNC,REASON} are `unsafe`, but on
+    // OpenSSL/LibreSSL they're safe.
+    #[allow(unused_unsafe)]
+    pub fn library_code(&self) -> libc::c_int {
+        unsafe { ffi::ERR_GET_LIB(self.code) }
+    }
+
+    /// Returns the name of the function reporting the error.
+    pub fn function(&self) -> Option<RetStr<'_>> {
+        self.func.as_ref().map(|s| s.as_str())
+    }
+
+    /// Returns the reason for the error.
+    pub fn reason(&self) -> Option<&'static str> {
+        unsafe {
+            let cstr = ffi::ERR_reason_error_string(self.code);
+            if cstr.is_null() {
+                return None;
+            }
+            let bytes = CStr::from_ptr(cstr as *const _).to_bytes();
+            Some(str::from_utf8(bytes).unwrap())
+        }
+    }
+
+    /// Returns the raw OpenSSL error constant for the reason for the error.
+    // On BoringSSL ERR_GET_{LIB,FUNC,REASON} are `unsafe`, but on
+    // OpenSSL/LibreSSL they're safe.
+    #[allow(unused_unsafe)]
+    pub fn reason_code(&self) -> libc::c_int {
+        unsafe { ffi::ERR_GET_REASON(self.code) }
+    }
+
+    /// Returns the name of the source file which encountered the error.
+    pub fn file(&self) -> RetStr<'_> {
+        self.file.as_str()
+    }
+
+    /// Returns the line in the source file which encountered the error.
+    pub fn line(&self) -> u32 {
+        self.line as u32
+    }
+
+    /// Returns additional data describing the error.
+    #[allow(clippy::option_as_ref_deref)]
+    pub fn data(&self) -> Option<&str> {
+        self.data.as_ref().map(|s| &**s)
+    }
+}
+
+impl fmt::Debug for Error {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
+        let mut builder = fmt.debug_struct("Error");
+        builder.field("code", &self.code());
+        if let Some(library) = self.library() {
+            builder.field("library", &library);
+        }
+        if let Some(function) = self.function() {
+            builder.field("function", &function);
+        }
+        if let Some(reason) = self.reason() {
+            builder.field("reason", &reason);
+        }
+        builder.field("file", &self.file());
+        builder.field("line", &self.line());
+        if let Some(data) = self.data() {
+            builder.field("data", &data);
+        }
+        builder.finish()
+    }
+}
+
+impl fmt::Display for Error {
+    // On BoringSSL ERR_GET_{LIB,FUNC,REASON} are `unsafe`, but on
+    // OpenSSL/LibreSSL they're safe.
+    #[allow(unused_unsafe)]
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
+        write!(fmt, "error:{:08X}", self.code())?;
+        match self.library() {
+            Some(l) => write!(fmt, ":{}", l)?,
+            None => write!(fmt, ":lib({})", self.library_code())?,
+        }
+        match self.function() {
+            Some(f) => write!(fmt, ":{}", f)?,
+            None => write!(fmt, ":func({})", unsafe { ffi::ERR_GET_FUNC(self.code()) })?,
+        }
+        match self.reason() {
+            Some(r) => write!(fmt, ":{}", r)?,
+            None => write!(fmt, ":reason({})", self.reason_code())?,
+        }
+        write!(
+            fmt,
+            ":{}:{}:{}",
+            self.file(),
+            self.line(),
+            self.data().unwrap_or("")
+        )
+    }
+}
+
+impl error::Error for Error {}
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        use std::ffi::{CString};
+        use ffi::ERR_get_error_all;
+
+        type RetStr<'a> = &'a str;
+
+        #[derive(Clone)]
+        struct ShimStr(CString);
+
+        impl ShimStr {
+            unsafe fn new(s: *const c_char) -> Self {
+                ShimStr(CStr::from_ptr(s).to_owned())
+            }
+
+            fn as_ptr(&self) -> *const c_char {
+                self.0.as_ptr()
+            }
+
+            fn as_str(&self) -> &str {
+                self.0.to_str().unwrap()
+            }
+        }
+    } else {
+        #[allow(bad_style)]
+        unsafe extern "C" fn ERR_get_error_all(
+            file: *mut *const c_char,
+            line: *mut c_int,
+            func: *mut *const c_char,
+            data: *mut *const c_char,
+            flags: *mut c_int,
+        ) -> ErrType {
+            let code = ffi::ERR_get_error_line_data(file, line, data, flags);
+            *func = ffi::ERR_func_error_string(code);
+            code
+        }
+
+        type RetStr<'a> = &'static str;
+
+        #[derive(Clone)]
+        struct ShimStr(*const c_char);
+
+        impl ShimStr {
+            unsafe fn new(s: *const c_char) -> Self {
+                ShimStr(s)
+            }
+
+            fn as_ptr(&self) -> *const c_char {
+                self.0
+            }
+
+            fn as_str(&self) -> &'static str {
+                unsafe {
+                    CStr::from_ptr(self.0).to_str().unwrap()
+                }
+            }
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    #[cfg(not(ossl310))]
+    use crate::nid::Nid;
+
+    #[test]
+    // Due to a bug in OpenSSL 3.1.0, this test can hang there. Skip for now.
+    #[cfg(not(ossl310))]
+    fn test_error_library_code() {
+        let stack = Nid::create("not-an-oid", "invalid", "invalid").unwrap_err();
+        let errors = stack.errors();
+        #[cfg(not(boringssl))]
+        assert_eq!(errors[0].library_code(), ffi::ERR_LIB_ASN1);
+        #[cfg(boringssl)]
+        assert_eq!(errors[0].library_code(), ffi::ERR_LIB_OBJ as libc::c_int);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/ex_data.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/ex_data.rs
--- 43.0.0-1/rust-vendor/openssl/src/ex_data.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/ex_data.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,32 @@
+use libc::c_int;
+use std::marker::PhantomData;
+
+/// A slot in a type's "extra data" structure.
+///
+/// It is parameterized over the type containing the extra data as well as the
+/// type of the data in the slot.
+pub struct Index<T, U>(c_int, PhantomData<(T, U)>);
+
+impl<T, U> Copy for Index<T, U> {}
+
+impl<T, U> Clone for Index<T, U> {
+    fn clone(&self) -> Index<T, U> {
+        *self
+    }
+}
+
+impl<T, U> Index<T, U> {
+    /// Creates an `Index` from a raw integer index.
+    ///
+    /// # Safety
+    ///
+    /// The caller must ensure that the index correctly maps to a `U` value stored in a `T`.
+    pub unsafe fn from_raw(idx: c_int) -> Index<T, U> {
+        Index(idx, PhantomData)
+    }
+
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn as_raw(&self) -> c_int {
+        self.0
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/fips.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/fips.rs
--- 43.0.0-1/rust-vendor/openssl/src/fips.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/fips.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,21 @@
+//! FIPS 140-2 support.
+//!
+//! See [OpenSSL's documentation] for details.
+//!
+//! [OpenSSL's documentation]: https://www.openssl.org/docs/fips/UserGuide-2.0.pdf
+use crate::cvt;
+use crate::error::ErrorStack;
+use openssl_macros::corresponds;
+
+/// Moves the library into or out of the FIPS 140-2 mode of operation.
+#[corresponds(FIPS_mode_set)]
+pub fn enable(enabled: bool) -> Result<(), ErrorStack> {
+    ffi::init();
+    unsafe { cvt(ffi::FIPS_mode_set(enabled as _)).map(|_| ()) }
+}
+
+/// Determines if the library is running in the FIPS 140-2 mode of operation.
+#[corresponds(FIPS_mode)]
+pub fn enabled() -> bool {
+    unsafe { ffi::FIPS_mode() != 0 }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/hash.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/hash.rs
--- 43.0.0-1/rust-vendor/openssl/src/hash.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/hash.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,801 @@
+//! Message digest (hash) computation support.
+//!
+//! # Examples
+//!
+//! Calculate a hash in one go:
+//!
+//! ```
+//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
+//! use openssl::hash::{hash, MessageDigest};
+//!
+//! let data = b"\x42\xF4\x97\xE0";
+//! let spec = b"\x7c\x43\x0f\x17\x8a\xef\xdf\x14\x87\xfe\xe7\x14\x4e\x96\x41\xe2";
+//! let res = hash(MessageDigest::md5(), data)?;
+//! assert_eq!(&*res, spec);
+//! # Ok(()) }
+//! ```
+//!
+//! Supply the input in chunks:
+//!
+//! ```
+//! use openssl::hash::{Hasher, MessageDigest};
+//!
+//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
+//! let mut hasher = Hasher::new(MessageDigest::sha256())?;
+//! hasher.update(b"test")?;
+//! hasher.update(b"this")?;
+//! let digest: &[u8] = &hasher.finish()?;
+//!
+//! let expected = hex::decode("9740e652ab5b4acd997a7cca13d6696702ccb2d441cca59fc6e285127f28cfe6")?;
+//! assert_eq!(digest, expected);
+//! # Ok(()) }
+//! ```
+use cfg_if::cfg_if;
+use std::ffi::CString;
+use std::fmt;
+use std::io;
+use std::io::prelude::*;
+use std::ops::{Deref, DerefMut};
+use std::ptr;
+
+use crate::error::ErrorStack;
+use crate::nid::Nid;
+use crate::{cvt, cvt_p};
+
+cfg_if! {
+    if #[cfg(any(ossl110, boringssl, libressl382))] {
+        use ffi::{EVP_MD_CTX_free, EVP_MD_CTX_new};
+    } else {
+        use ffi::{EVP_MD_CTX_create as EVP_MD_CTX_new, EVP_MD_CTX_destroy as EVP_MD_CTX_free};
+    }
+}
+
+/// A message digest algorithm.
+#[derive(Copy, Clone, PartialEq, Eq)]
+pub struct MessageDigest(*const ffi::EVP_MD);
+
+impl MessageDigest {
+    /// Creates a `MessageDigest` from a raw OpenSSL pointer.
+    ///
+    /// # Safety
+    ///
+    /// The caller must ensure the pointer is valid.
+    pub unsafe fn from_ptr(x: *const ffi::EVP_MD) -> Self {
+        MessageDigest(x)
+    }
+
+    /// Returns the `MessageDigest` corresponding to an `Nid`.
+    ///
+    /// This corresponds to [`EVP_get_digestbynid`].
+    ///
+    /// [`EVP_get_digestbynid`]: https://www.openssl.org/docs/manmaster/crypto/EVP_DigestInit.html
+    pub fn from_nid(type_: Nid) -> Option<MessageDigest> {
+        ffi::init();
+        unsafe {
+            let ptr = ffi::EVP_get_digestbynid(type_.as_raw());
+            if ptr.is_null() {
+                None
+            } else {
+                Some(MessageDigest(ptr))
+            }
+        }
+    }
+
+    /// Returns the `MessageDigest` corresponding to an algorithm name.
+    ///
+    /// This corresponds to [`EVP_get_digestbyname`].
+    ///
+    /// [`EVP_get_digestbyname`]: https://www.openssl.org/docs/manmaster/crypto/EVP_DigestInit.html
+    pub fn from_name(name: &str) -> Option<MessageDigest> {
+        ffi::init();
+        let name = CString::new(name).ok()?;
+        unsafe {
+            let ptr = ffi::EVP_get_digestbyname(name.as_ptr());
+            if ptr.is_null() {
+                None
+            } else {
+                Some(MessageDigest(ptr))
+            }
+        }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn null() -> MessageDigest {
+        unsafe { MessageDigest(ffi::EVP_md_null()) }
+    }
+
+    pub fn md5() -> MessageDigest {
+        unsafe { MessageDigest(ffi::EVP_md5()) }
+    }
+
+    pub fn sha1() -> MessageDigest {
+        unsafe { MessageDigest(ffi::EVP_sha1()) }
+    }
+
+    pub fn sha224() -> MessageDigest {
+        unsafe { MessageDigest(ffi::EVP_sha224()) }
+    }
+
+    pub fn sha256() -> MessageDigest {
+        unsafe { MessageDigest(ffi::EVP_sha256()) }
+    }
+
+    pub fn sha384() -> MessageDigest {
+        unsafe { MessageDigest(ffi::EVP_sha384()) }
+    }
+
+    pub fn sha512() -> MessageDigest {
+        unsafe { MessageDigest(ffi::EVP_sha512()) }
+    }
+
+    #[cfg(any(ossl111, libressl380))]
+    pub fn sha3_224() -> MessageDigest {
+        unsafe { MessageDigest(ffi::EVP_sha3_224()) }
+    }
+
+    #[cfg(any(ossl111, libressl380))]
+    pub fn sha3_256() -> MessageDigest {
+        unsafe { MessageDigest(ffi::EVP_sha3_256()) }
+    }
+
+    #[cfg(any(ossl111, libressl380))]
+    pub fn sha3_384() -> MessageDigest {
+        unsafe { MessageDigest(ffi::EVP_sha3_384()) }
+    }
+
+    #[cfg(any(ossl111, libressl380))]
+    pub fn sha3_512() -> MessageDigest {
+        unsafe { MessageDigest(ffi::EVP_sha3_512()) }
+    }
+
+    #[cfg(ossl111)]
+    pub fn shake_128() -> MessageDigest {
+        unsafe { MessageDigest(ffi::EVP_shake128()) }
+    }
+
+    #[cfg(ossl111)]
+    pub fn shake_256() -> MessageDigest {
+        unsafe { MessageDigest(ffi::EVP_shake256()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_RMD160"))]
+    pub fn ripemd160() -> MessageDigest {
+        unsafe { MessageDigest(ffi::EVP_ripemd160()) }
+    }
+
+    #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM3")))]
+    pub fn sm3() -> MessageDigest {
+        unsafe { MessageDigest(ffi::EVP_sm3()) }
+    }
+
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn as_ptr(&self) -> *const ffi::EVP_MD {
+        self.0
+    }
+
+    /// The block size of the digest in bytes.
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn block_size(&self) -> usize {
+        unsafe { ffi::EVP_MD_block_size(self.0) as usize }
+    }
+
+    /// The size of the digest in bytes.
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn size(&self) -> usize {
+        unsafe { ffi::EVP_MD_size(self.0) as usize }
+    }
+
+    /// The name of the digest.
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn type_(&self) -> Nid {
+        Nid::from_raw(unsafe { ffi::EVP_MD_type(self.0) })
+    }
+}
+
+unsafe impl Sync for MessageDigest {}
+unsafe impl Send for MessageDigest {}
+
+#[derive(PartialEq, Copy, Clone)]
+enum State {
+    Reset,
+    Updated,
+    Finalized,
+}
+
+use self::State::*;
+
+/// Provides message digest (hash) computation.
+///
+/// # Examples
+///
+/// ```
+/// use openssl::hash::{Hasher, MessageDigest};
+///
+/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
+/// let data = [b"\x42\xF4", b"\x97\xE0"];
+/// let spec = b"\x7c\x43\x0f\x17\x8a\xef\xdf\x14\x87\xfe\xe7\x14\x4e\x96\x41\xe2";
+/// let mut h = Hasher::new(MessageDigest::md5())?;
+/// h.update(data[0])?;
+/// h.update(data[1])?;
+/// let res = h.finish()?;
+/// assert_eq!(&*res, spec);
+/// # Ok(()) }
+/// ```
+///
+/// # Warning
+///
+/// Don't actually use MD5 and SHA-1 hashes, they're not secure anymore.
+///
+/// Don't ever hash passwords, use the functions in the `pkcs5` module or bcrypt/scrypt instead.
+///
+/// For extendable output functions (XOFs, i.e. SHAKE128/SHAKE256),
+/// you must use [`Hasher::finish_xof`] instead of [`Hasher::finish`]
+/// and provide a `buf` to store the hash. The hash will be as long as
+/// the `buf`.
+pub struct Hasher {
+    ctx: *mut ffi::EVP_MD_CTX,
+    md: *const ffi::EVP_MD,
+    type_: MessageDigest,
+    state: State,
+}
+
+unsafe impl Sync for Hasher {}
+unsafe impl Send for Hasher {}
+
+impl Hasher {
+    /// Creates a new `Hasher` with the specified hash type.
+    pub fn new(ty: MessageDigest) -> Result<Hasher, ErrorStack> {
+        ffi::init();
+
+        let ctx = unsafe { cvt_p(EVP_MD_CTX_new())? };
+
+        let mut h = Hasher {
+            ctx,
+            md: ty.as_ptr(),
+            type_: ty,
+            state: Finalized,
+        };
+        h.init()?;
+        Ok(h)
+    }
+
+    fn init(&mut self) -> Result<(), ErrorStack> {
+        match self.state {
+            Reset => return Ok(()),
+            Updated => {
+                self.finish()?;
+            }
+            Finalized => (),
+        }
+        unsafe {
+            cvt(ffi::EVP_DigestInit_ex(self.ctx, self.md, ptr::null_mut()))?;
+        }
+        self.state = Reset;
+        Ok(())
+    }
+
+    /// Feeds data into the hasher.
+    pub fn update(&mut self, data: &[u8]) -> Result<(), ErrorStack> {
+        if self.state == Finalized {
+            self.init()?;
+        }
+        unsafe {
+            cvt(ffi::EVP_DigestUpdate(
+                self.ctx,
+                data.as_ptr() as *mut _,
+                data.len(),
+            ))?;
+        }
+        self.state = Updated;
+        Ok(())
+    }
+
+    /// Returns the hash of the data written and resets the non-XOF hasher.
+    pub fn finish(&mut self) -> Result<DigestBytes, ErrorStack> {
+        if self.state == Finalized {
+            self.init()?;
+        }
+        unsafe {
+            #[cfg(not(boringssl))]
+            let mut len = ffi::EVP_MAX_MD_SIZE;
+            #[cfg(boringssl)]
+            let mut len = ffi::EVP_MAX_MD_SIZE as u32;
+            let mut buf = [0; ffi::EVP_MAX_MD_SIZE as usize];
+            cvt(ffi::EVP_DigestFinal_ex(
+                self.ctx,
+                buf.as_mut_ptr(),
+                &mut len,
+            ))?;
+            self.state = Finalized;
+            Ok(DigestBytes {
+                buf,
+                len: len as usize,
+            })
+        }
+    }
+
+    /// Writes the hash of the data into the supplied buf and resets the XOF hasher.
+    /// The hash will be as long as the buf.
+    #[cfg(ossl111)]
+    pub fn finish_xof(&mut self, buf: &mut [u8]) -> Result<(), ErrorStack> {
+        if self.state == Finalized {
+            self.init()?;
+        }
+        unsafe {
+            cvt(ffi::EVP_DigestFinalXOF(
+                self.ctx,
+                buf.as_mut_ptr(),
+                buf.len(),
+            ))?;
+            self.state = Finalized;
+            Ok(())
+        }
+    }
+}
+
+impl Write for Hasher {
+    #[inline]
+    fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
+        self.update(buf)?;
+        Ok(buf.len())
+    }
+
+    fn flush(&mut self) -> io::Result<()> {
+        Ok(())
+    }
+}
+
+impl Clone for Hasher {
+    fn clone(&self) -> Hasher {
+        let ctx = unsafe {
+            let ctx = EVP_MD_CTX_new();
+            assert!(!ctx.is_null());
+            let r = ffi::EVP_MD_CTX_copy_ex(ctx, self.ctx);
+            assert_eq!(r, 1);
+            ctx
+        };
+        Hasher {
+            ctx,
+            md: self.md,
+            type_: self.type_,
+            state: self.state,
+        }
+    }
+}
+
+impl Drop for Hasher {
+    fn drop(&mut self) {
+        unsafe {
+            if self.state != Finalized {
+                drop(self.finish());
+            }
+            EVP_MD_CTX_free(self.ctx);
+        }
+    }
+}
+
+/// The resulting bytes of a digest.
+///
+/// This type derefs to a byte slice - it exists to avoid allocating memory to
+/// store the digest data.
+#[derive(Copy)]
+pub struct DigestBytes {
+    pub(crate) buf: [u8; ffi::EVP_MAX_MD_SIZE as usize],
+    pub(crate) len: usize,
+}
+
+impl Clone for DigestBytes {
+    #[inline]
+    fn clone(&self) -> DigestBytes {
+        *self
+    }
+}
+
+impl Deref for DigestBytes {
+    type Target = [u8];
+
+    #[inline]
+    fn deref(&self) -> &[u8] {
+        &self.buf[..self.len]
+    }
+}
+
+impl DerefMut for DigestBytes {
+    #[inline]
+    fn deref_mut(&mut self) -> &mut [u8] {
+        &mut self.buf[..self.len]
+    }
+}
+
+impl AsRef<[u8]> for DigestBytes {
+    #[inline]
+    fn as_ref(&self) -> &[u8] {
+        self.deref()
+    }
+}
+
+impl fmt::Debug for DigestBytes {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
+        fmt::Debug::fmt(&**self, fmt)
+    }
+}
+
+/// Computes the hash of the `data` with the non-XOF hasher `t`.
+///
+/// # Examples
+///
+/// ```
+/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
+/// use openssl::hash::{hash, MessageDigest};
+///
+/// let data = b"\x42\xF4\x97\xE0";
+/// let spec = b"\x7c\x43\x0f\x17\x8a\xef\xdf\x14\x87\xfe\xe7\x14\x4e\x96\x41\xe2";
+/// let res = hash(MessageDigest::md5(), data)?;
+/// assert_eq!(&*res, spec);
+/// # Ok(()) }
+/// ```
+pub fn hash(t: MessageDigest, data: &[u8]) -> Result<DigestBytes, ErrorStack> {
+    let mut h = Hasher::new(t)?;
+    h.update(data)?;
+    h.finish()
+}
+
+/// Computes the hash of the `data` with the XOF hasher `t` and stores it in `buf`.
+///
+/// # Examples
+///
+/// ```
+/// use openssl::hash::{hash_xof, MessageDigest};
+///
+/// let data = b"\x41\x6c\x6c\x20\x79\x6f\x75\x72\x20\x62\x61\x73\x65\x20\x61\x72\x65\x20\x62\x65\x6c\x6f\x6e\x67\x20\x74\x6f\x20\x75\x73";
+/// let spec = b"\x49\xd0\x69\x7f\xf5\x08\x11\x1d\x8b\x84\xf1\x5e\x46\xda\xf1\x35";
+/// let mut buf = vec![0; 16];
+/// hash_xof(MessageDigest::shake_128(), data, buf.as_mut_slice()).unwrap();
+/// assert_eq!(buf, spec);
+/// ```
+///
+#[cfg(ossl111)]
+pub fn hash_xof(t: MessageDigest, data: &[u8], buf: &mut [u8]) -> Result<(), ErrorStack> {
+    let mut h = Hasher::new(t)?;
+    h.update(data)?;
+    h.finish_xof(buf)
+}
+
+#[cfg(test)]
+mod tests {
+    use hex::{self, FromHex};
+    use std::io::prelude::*;
+
+    use super::*;
+
+    fn hash_test(hashtype: MessageDigest, hashtest: &(&str, &str)) {
+        let res = hash(hashtype, &Vec::from_hex(hashtest.0).unwrap()).unwrap();
+        assert_eq!(hex::encode(res), hashtest.1);
+    }
+
+    #[cfg(ossl111)]
+    fn hash_xof_test(hashtype: MessageDigest, hashtest: &(&str, &str)) {
+        let expected = Vec::from_hex(hashtest.1).unwrap();
+        let mut buf = vec![0; expected.len()];
+        hash_xof(
+            hashtype,
+            &Vec::from_hex(hashtest.0).unwrap(),
+            buf.as_mut_slice(),
+        )
+        .unwrap();
+        assert_eq!(buf, expected);
+    }
+
+    fn hash_recycle_test(h: &mut Hasher, hashtest: &(&str, &str)) {
+        h.write_all(&Vec::from_hex(hashtest.0).unwrap()).unwrap();
+        let res = h.finish().unwrap();
+        assert_eq!(hex::encode(res), hashtest.1);
+    }
+
+    // Test vectors from http://www.nsrl.nist.gov/testdata/
+    const MD5_TESTS: [(&str, &str); 13] = [
+        ("", "d41d8cd98f00b204e9800998ecf8427e"),
+        ("7F", "83acb6e67e50e31db6ed341dd2de1595"),
+        ("EC9C", "0b07f0d4ca797d8ac58874f887cb0b68"),
+        ("FEE57A", "e0d583171eb06d56198fc0ef22173907"),
+        ("42F497E0", "7c430f178aefdf1487fee7144e9641e2"),
+        ("C53B777F1C", "75ef141d64cb37ec423da2d9d440c925"),
+        ("89D5B576327B", "ebbaf15eb0ed784c6faa9dc32831bf33"),
+        ("5D4CCE781EB190", "ce175c4b08172019f05e6b5279889f2c"),
+        ("81901FE94932D7B9", "cd4d2f62b8cdb3a0cf968a735a239281"),
+        ("C9FFDEE7788EFB4EC9", "e0841a231ab698db30c6c0f3f246c014"),
+        ("66AC4B7EBA95E53DC10B", "a3b3cea71910d9af56742aa0bb2fe329"),
+        ("A510CD18F7A56852EB0319", "577e216843dd11573574d3fb209b97d8"),
+        (
+            "AAED18DBE8938C19ED734A8D",
+            "6f80fb775f27e0a4ce5c2f42fc72c5f1",
+        ),
+    ];
+
+    #[test]
+    fn test_md5() {
+        for test in MD5_TESTS.iter() {
+            hash_test(MessageDigest::md5(), test);
+        }
+
+        assert_eq!(MessageDigest::md5().block_size(), 64);
+        assert_eq!(MessageDigest::md5().size(), 16);
+        assert_eq!(MessageDigest::md5().type_().as_raw(), Nid::MD5.as_raw());
+    }
+
+    #[test]
+    fn test_md5_recycle() {
+        let mut h = Hasher::new(MessageDigest::md5()).unwrap();
+        for test in MD5_TESTS.iter() {
+            hash_recycle_test(&mut h, test);
+        }
+    }
+
+    #[test]
+    fn test_finish_twice() {
+        let mut h = Hasher::new(MessageDigest::md5()).unwrap();
+        h.write_all(&Vec::from_hex(MD5_TESTS[6].0).unwrap())
+            .unwrap();
+        h.finish().unwrap();
+        let res = h.finish().unwrap();
+        let null = hash(MessageDigest::md5(), &[]).unwrap();
+        assert_eq!(&*res, &*null);
+    }
+
+    #[test]
+    #[allow(clippy::redundant_clone)]
+    fn test_clone() {
+        let i = 7;
+        let inp = Vec::from_hex(MD5_TESTS[i].0).unwrap();
+        assert!(inp.len() > 2);
+        let p = inp.len() / 2;
+        let h0 = Hasher::new(MessageDigest::md5()).unwrap();
+
+        println!("Clone a new hasher");
+        let mut h1 = h0.clone();
+        h1.write_all(&inp[..p]).unwrap();
+        {
+            println!("Clone an updated hasher");
+            let mut h2 = h1.clone();
+            h2.write_all(&inp[p..]).unwrap();
+            let res = h2.finish().unwrap();
+            assert_eq!(hex::encode(res), MD5_TESTS[i].1);
+        }
+        h1.write_all(&inp[p..]).unwrap();
+        let res = h1.finish().unwrap();
+        assert_eq!(hex::encode(res), MD5_TESTS[i].1);
+
+        println!("Clone a finished hasher");
+        let mut h3 = h1.clone();
+        h3.write_all(&Vec::from_hex(MD5_TESTS[i + 1].0).unwrap())
+            .unwrap();
+        let res = h3.finish().unwrap();
+        assert_eq!(hex::encode(res), MD5_TESTS[i + 1].1);
+    }
+
+    #[test]
+    fn test_sha1() {
+        let tests = [("616263", "a9993e364706816aba3e25717850c26c9cd0d89d")];
+
+        for test in tests.iter() {
+            hash_test(MessageDigest::sha1(), test);
+        }
+
+        assert_eq!(MessageDigest::sha1().block_size(), 64);
+        assert_eq!(MessageDigest::sha1().size(), 20);
+        assert_eq!(MessageDigest::sha1().type_().as_raw(), Nid::SHA1.as_raw());
+    }
+
+    #[test]
+    fn test_sha256() {
+        let tests = [(
+            "616263",
+            "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad",
+        )];
+
+        for test in tests.iter() {
+            hash_test(MessageDigest::sha256(), test);
+        }
+
+        assert_eq!(MessageDigest::sha256().block_size(), 64);
+        assert_eq!(MessageDigest::sha256().size(), 32);
+        assert_eq!(
+            MessageDigest::sha256().type_().as_raw(),
+            Nid::SHA256.as_raw()
+        );
+    }
+
+    #[test]
+    fn test_sha512() {
+        let tests = [(
+            "737465766566696e647365766572797468696e67",
+            "ba61d1f1af0f2dd80729f6cc900f19c0966bd38ba5c75e4471ef11b771dfe7551afab7fcbd300fdc4418f2\
+            b07a028fcd99e7b6446a566f2d9bcd7c604a1ea801",
+        )];
+
+        for test in tests.iter() {
+            hash_test(MessageDigest::sha512(), test);
+        }
+
+        assert_eq!(MessageDigest::sha512().block_size(), 128);
+        assert_eq!(MessageDigest::sha512().size(), 64);
+        assert_eq!(
+            MessageDigest::sha512().type_().as_raw(),
+            Nid::SHA512.as_raw()
+        );
+    }
+
+    #[cfg(any(ossl111, libressl380))]
+    #[test]
+    fn test_sha3_224() {
+        let tests = [(
+            "416c6c20796f75722062617365206172652062656c6f6e6720746f207573",
+            "1de092dd9fbcbbf450f26264f4778abd48af851f2832924554c56913",
+        )];
+
+        for test in tests.iter() {
+            hash_test(MessageDigest::sha3_224(), test);
+        }
+
+        assert_eq!(MessageDigest::sha3_224().block_size(), 144);
+        assert_eq!(MessageDigest::sha3_224().size(), 28);
+        assert_eq!(
+            MessageDigest::sha3_224().type_().as_raw(),
+            Nid::SHA3_224.as_raw()
+        );
+    }
+
+    #[cfg(any(ossl111, libressl380))]
+    #[test]
+    fn test_sha3_256() {
+        let tests = [(
+            "416c6c20796f75722062617365206172652062656c6f6e6720746f207573",
+            "b38e38f08bc1c0091ed4b5f060fe13e86aa4179578513ad11a6e3abba0062f61",
+        )];
+
+        for test in tests.iter() {
+            hash_test(MessageDigest::sha3_256(), test);
+        }
+
+        assert_eq!(MessageDigest::sha3_256().block_size(), 136);
+        assert_eq!(MessageDigest::sha3_256().size(), 32);
+        assert_eq!(
+            MessageDigest::sha3_256().type_().as_raw(),
+            Nid::SHA3_256.as_raw()
+        );
+    }
+
+    #[cfg(any(ossl111, libressl380))]
+    #[test]
+    fn test_sha3_384() {
+        let tests = [("416c6c20796f75722062617365206172652062656c6f6e6720746f207573",
+            "966ee786ab3482dd811bf7c8fa8db79aa1f52f6c3c369942ef14240ebd857c6ff626ec35d9e131ff64d328\
+            ef2008ff16"
+        )];
+
+        for test in tests.iter() {
+            hash_test(MessageDigest::sha3_384(), test);
+        }
+
+        assert_eq!(MessageDigest::sha3_384().block_size(), 104);
+        assert_eq!(MessageDigest::sha3_384().size(), 48);
+        assert_eq!(
+            MessageDigest::sha3_384().type_().as_raw(),
+            Nid::SHA3_384.as_raw()
+        );
+    }
+
+    #[cfg(any(ossl111, libressl380))]
+    #[test]
+    fn test_sha3_512() {
+        let tests = [("416c6c20796f75722062617365206172652062656c6f6e6720746f207573",
+            "c072288ef728cd53a029c47687960b9225893532f42b923156e37020bdc1eda753aafbf30af859d4f4c3a1\
+            807caee3a79f8eb02dcd61589fbbdf5f40c8787a72"
+        )];
+
+        for test in tests.iter() {
+            hash_test(MessageDigest::sha3_512(), test);
+        }
+
+        assert_eq!(MessageDigest::sha3_512().block_size(), 72);
+        assert_eq!(MessageDigest::sha3_512().size(), 64);
+        assert_eq!(
+            MessageDigest::sha3_512().type_().as_raw(),
+            Nid::SHA3_512.as_raw()
+        );
+    }
+
+    #[cfg(ossl111)]
+    #[test]
+    fn test_shake_128() {
+        let tests = [(
+            "416c6c20796f75722062617365206172652062656c6f6e6720746f207573",
+            "49d0697ff508111d8b84f15e46daf135",
+        )];
+
+        for test in tests.iter() {
+            hash_xof_test(MessageDigest::shake_128(), test);
+        }
+
+        assert_eq!(MessageDigest::shake_128().block_size(), 168);
+        assert_eq!(MessageDigest::shake_128().size(), 16);
+        assert_eq!(
+            MessageDigest::shake_128().type_().as_raw(),
+            Nid::SHAKE128.as_raw()
+        );
+    }
+
+    #[cfg(ossl111)]
+    #[test]
+    fn test_shake_256() {
+        let tests = [(
+            "416c6c20796f75722062617365206172652062656c6f6e6720746f207573",
+            "4e2dfdaa75d1e049d0eaeffe28e76b17cea47b650fb8826fe48b94664326a697",
+        )];
+
+        for test in tests.iter() {
+            hash_xof_test(MessageDigest::shake_256(), test);
+        }
+
+        assert_eq!(MessageDigest::shake_256().block_size(), 136);
+        assert_eq!(MessageDigest::shake_256().size(), 32);
+        assert_eq!(
+            MessageDigest::shake_256().type_().as_raw(),
+            Nid::SHAKE256.as_raw()
+        );
+    }
+
+    #[test]
+    #[cfg(not(osslconf = "OPENSSL_NO_RMD160"))]
+    #[cfg_attr(ossl300, ignore)]
+    fn test_ripemd160() {
+        #[cfg(ossl300)]
+        let _provider = crate::provider::Provider::try_load(None, "legacy", true).unwrap();
+
+        let tests = [("616263", "8eb208f7e05d987a9b044a8e98c6b087f15a0bfc")];
+
+        for test in tests.iter() {
+            hash_test(MessageDigest::ripemd160(), test);
+        }
+
+        assert_eq!(MessageDigest::ripemd160().block_size(), 64);
+        assert_eq!(MessageDigest::ripemd160().size(), 20);
+        assert_eq!(
+            MessageDigest::ripemd160().type_().as_raw(),
+            Nid::RIPEMD160.as_raw()
+        );
+    }
+
+    #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM3")))]
+    #[test]
+    fn test_sm3() {
+        let tests = [(
+            "616263",
+            "66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0",
+        )];
+
+        for test in tests.iter() {
+            hash_test(MessageDigest::sm3(), test);
+        }
+
+        assert_eq!(MessageDigest::sm3().block_size(), 64);
+        assert_eq!(MessageDigest::sm3().size(), 32);
+        assert_eq!(MessageDigest::sm3().type_().as_raw(), Nid::SM3.as_raw());
+    }
+
+    #[test]
+    fn from_nid() {
+        assert_eq!(
+            MessageDigest::from_nid(Nid::SHA256).unwrap().as_ptr(),
+            MessageDigest::sha256().as_ptr()
+        );
+    }
+
+    #[test]
+    fn from_name() {
+        assert_eq!(
+            MessageDigest::from_name("SHA256").unwrap().as_ptr(),
+            MessageDigest::sha256().as_ptr()
+        )
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/lib.rs
--- 43.0.0-1/rust-vendor/openssl/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,256 @@
+//! Bindings to OpenSSL
+//!
+//! This crate provides a safe interface to the popular OpenSSL cryptography library. OpenSSL versions 1.0.1 through
+//! 3.x.x and LibreSSL versions 2.5 through 3.7.x are supported.
+//!
+//! # Building
+//!
+//! Both OpenSSL libraries and headers are required to build this crate. There are multiple options available to locate
+//! OpenSSL.
+//!
+//! ## Vendored
+//!
+//! If the `vendored` Cargo feature is enabled, the `openssl-src` crate will be used to compile and statically link to
+//! a copy of OpenSSL. The build process requires a C compiler, perl (and perl-core), and make. The OpenSSL version will generally track
+//! the newest OpenSSL release, and changes to the version are *not* considered breaking changes.
+//!
+//! ```toml
+//! [dependencies]
+//! openssl = { version = "0.10", features = ["vendored"] }
+//! ```
+//!
+//! The vendored copy will be configured to automatically find a configuration and root certificates at `/usr/local/ssl`.
+//! This path can be overridden with an environment variable (see the manual section below).
+//! Alternatively, the `openssl-probe` crate can be used to find root certificates at runtime.
+//!
+//! ## Automatic
+//!
+//! The `openssl-sys` crate will automatically detect OpenSSL installations via Homebrew on macOS and vcpkg on Windows.
+//! Additionally, it will use `pkg-config` on Unix-like systems to find the system installation.
+//!
+//! ```not_rust
+//! # macOS (Homebrew)
+//! $ brew install openssl@3
+//!
+//! # macOS (MacPorts)
+//! $ sudo port install openssl
+//!
+//! # macOS (pkgsrc)
+//! $ sudo pkgin install openssl
+//!
+//! # Arch Linux
+//! $ sudo pacman -S pkgconf openssl
+//!
+//! # Debian and Ubuntu
+//! $ sudo apt-get install pkg-config libssl-dev
+//!
+//! # Fedora
+//! $ sudo dnf install pkgconf perl-FindBin perl-IPC-Cmd openssl-devel
+//!
+//! # Alpine Linux
+//! $ apk add pkgconf openssl-dev
+//!
+//! # openSUSE
+//! $ sudo zypper in libopenssl-devel
+//! ```
+//!
+//! ## Manual
+//!
+//! A set of environment variables can be used to point `openssl-sys` towards an OpenSSL installation. They will
+//! override the automatic detection logic.
+//!
+//! * `OPENSSL_DIR` - If specified, the directory of an OpenSSL installation. The directory should contain `lib` and
+//!     `include` subdirectories containing the libraries and headers respectively.
+//! * `OPENSSL_LIB_DIR` and `OPENSSL_INCLUDE_DIR` - If specified, the directories containing the OpenSSL libraries and
+//!     headers respectively. This can be used if the OpenSSL installation is split in a nonstandard directory layout.
+//! * `OPENSSL_STATIC` - If set, the crate will statically link to OpenSSL rather than dynamically link.
+//! * `OPENSSL_LIBS` - If set, a `:`-separated list of library names to link to (e.g. `ssl:crypto`). This can be used
+//!     if nonstandard library names were used for whatever reason.
+//! * `OPENSSL_NO_VENDOR` - If set, always find OpenSSL in the system, even if the `vendored` feature is enabled.
+//!
+//! If the `vendored` Cargo feature is enabled, the following environment variable can also be used to further configure
+//! the OpenSSL build.
+//!
+//! * `OPENSSL_CONFIG_DIR` - If set, the copy of OpenSSL built by the `openssl-src` crate will be configured to look for
+//!     configuration files and root certificates in this directory.
+//!
+//! Additionally, these variables can be prefixed with the upper-cased target architecture (e.g.
+//!     `X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR`), which can be useful when cross compiling.
+//!
+//! # Feature Detection
+//!
+//! APIs have been added to and removed from the various supported OpenSSL versions, and this library exposes the
+//! functionality available in the version being linked against. This means that methods, constants, and even modules
+//! will be present when building against one version of OpenSSL but not when building against another! APIs will
+//! document any version-specific availability restrictions.
+//!
+//! A build script can be used to detect the OpenSSL or LibreSSL version at compile time if needed. The `openssl-sys`
+//! crate propagates the version via the `DEP_OPENSSL_VERSION_NUMBER` and `DEP_OPENSSL_LIBRESSL_VERSION_NUMBER`
+//! environment variables to build scripts. The version format is a hex-encoding of the OpenSSL release version:
+//! `0xMNNFFPPS`. For example, version 1.0.2g's encoding is `0x1_00_02_07_0`.
+//!
+//! For example, let's say we want to adjust the TLSv1.3 cipher suites used by a client, but also want to compile
+//! against OpenSSL versions that don't support TLSv1.3:
+//!
+//! Cargo.toml:
+//!
+//! ```toml
+//! [dependencies]
+//! openssl-sys = "0.9"
+//! openssl = "0.10"
+//! ```
+//!
+//! build.rs:
+//!
+//! ```
+//! use std::env;
+//!
+//! fn main() {
+//!     if let Ok(v) = env::var("DEP_OPENSSL_VERSION_NUMBER") {
+//!         let version = u64::from_str_radix(&v, 16).unwrap();
+//!
+//!         if version >= 0x1_01_01_00_0 {
+//!             println!("cargo:rustc-cfg=openssl111");
+//!         }
+//!     }
+//! }
+//! ```
+//!
+//! lib.rs:
+//!
+//! ```
+//! use openssl::ssl::{SslConnector, SslMethod};
+//!
+//! let mut ctx = SslConnector::builder(SslMethod::tls()).unwrap();
+//!
+//! // set_ciphersuites was added in OpenSSL 1.1.1, so we can only call it when linking against that version
+//! #[cfg(openssl111)]
+//! ctx.set_ciphersuites("TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256").unwrap();
+//! ```
+#![doc(html_root_url = "https://docs.rs/openssl/0.10")]
+#![warn(rust_2018_idioms)]
+#![allow(clippy::uninlined_format_args, clippy::needless_doctest_main)]
+
+#[doc(inline)]
+pub use ffi::init;
+
+use libc::c_int;
+#[cfg(ossl300)]
+use libc::c_long;
+
+use crate::error::ErrorStack;
+
+#[macro_use]
+mod macros;
+
+mod bio;
+#[macro_use]
+mod util;
+pub mod aes;
+pub mod asn1;
+pub mod base64;
+pub mod bn;
+pub mod cipher;
+pub mod cipher_ctx;
+#[cfg(all(not(libressl), not(osslconf = "OPENSSL_NO_CMS")))]
+pub mod cms;
+pub mod conf;
+pub mod derive;
+pub mod dh;
+pub mod dsa;
+pub mod ec;
+pub mod ecdsa;
+pub mod encrypt;
+#[cfg(not(boringssl))]
+pub mod envelope;
+pub mod error;
+pub mod ex_data;
+#[cfg(not(any(libressl, ossl300)))]
+pub mod fips;
+pub mod hash;
+#[cfg(ossl300)]
+pub mod lib_ctx;
+pub mod md;
+pub mod md_ctx;
+pub mod memcmp;
+pub mod nid;
+#[cfg(not(osslconf = "OPENSSL_NO_OCSP"))]
+pub mod ocsp;
+pub mod pkcs12;
+pub mod pkcs5;
+#[cfg(not(boringssl))]
+pub mod pkcs7;
+pub mod pkey;
+pub mod pkey_ctx;
+#[cfg(ossl300)]
+pub mod provider;
+pub mod rand;
+pub mod rsa;
+pub mod sha;
+pub mod sign;
+pub mod srtp;
+pub mod ssl;
+pub mod stack;
+pub mod string;
+pub mod symm;
+pub mod version;
+pub mod x509;
+
+#[cfg(boringssl)]
+type LenType = libc::size_t;
+#[cfg(not(boringssl))]
+type LenType = libc::c_int;
+
+#[cfg(boringssl)]
+type SLenType = libc::ssize_t;
+#[cfg(not(boringssl))]
+type SLenType = libc::c_int;
+
+#[inline]
+fn cvt_p<T>(r: *mut T) -> Result<*mut T, ErrorStack> {
+    if r.is_null() {
+        Err(ErrorStack::get())
+    } else {
+        Ok(r)
+    }
+}
+
+#[inline]
+fn cvt_p_const<T>(r: *const T) -> Result<*const T, ErrorStack> {
+    if r.is_null() {
+        Err(ErrorStack::get())
+    } else {
+        Ok(r)
+    }
+}
+
+#[inline]
+fn cvt(r: c_int) -> Result<c_int, ErrorStack> {
+    if r <= 0 {
+        Err(ErrorStack::get())
+    } else {
+        Ok(r)
+    }
+}
+
+// cvt_long is currently only used in functions that require openssl >= 3.0.0,
+// so this cfg statement is used to avoid "unused function" errors when
+// compiling with openssl < 3.0.0
+#[inline]
+#[cfg(ossl300)]
+fn cvt_long(r: c_long) -> Result<c_long, ErrorStack> {
+    if r <= 0 {
+        Err(ErrorStack::get())
+    } else {
+        Ok(r)
+    }
+}
+
+#[inline]
+fn cvt_n(r: c_int) -> Result<c_int, ErrorStack> {
+    if r < 0 {
+        Err(ErrorStack::get())
+    } else {
+        Ok(r)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/lib_ctx.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/lib_ctx.rs
--- 43.0.0-1/rust-vendor/openssl/src/lib_ctx.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/lib_ctx.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,22 @@
+use crate::cvt_p;
+use crate::error::ErrorStack;
+use foreign_types::ForeignType;
+use openssl_macros::corresponds;
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::OSSL_LIB_CTX;
+    fn drop = ffi::OSSL_LIB_CTX_free;
+
+    pub struct LibCtx;
+    pub struct LibCtxRef;
+}
+
+impl LibCtx {
+    #[corresponds(OSSL_LIB_CTX_new)]
+    pub fn new() -> Result<Self, ErrorStack> {
+        unsafe {
+            let ptr = cvt_p(ffi::OSSL_LIB_CTX_new())?;
+            Ok(LibCtx::from_ptr(ptr))
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/macros.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/macros.rs
--- 43.0.0-1/rust-vendor/openssl/src/macros.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/macros.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,270 @@
+macro_rules! private_key_from_pem {
+    ($(#[$m:meta])* $n:ident, $(#[$m2:meta])* $n2:ident, $(#[$m3:meta])* $n3:ident, $t:ty, $f:path) => {
+        from_pem!($(#[$m])* $n, $t, $f);
+
+        $(#[$m2])*
+        pub fn $n2(pem: &[u8], passphrase: &[u8]) -> Result<$t, crate::error::ErrorStack> {
+            unsafe {
+                ffi::init();
+                let bio = crate::bio::MemBioSlice::new(pem)?;
+                let passphrase = ::std::ffi::CString::new(passphrase).unwrap();
+                cvt_p($f(bio.as_ptr(),
+                         ptr::null_mut(),
+                         None,
+                         passphrase.as_ptr() as *const _ as *mut _))
+                    .map(|p| ::foreign_types::ForeignType::from_ptr(p))
+            }
+        }
+
+        $(#[$m3])*
+        pub fn $n3<F>(pem: &[u8], callback: F) -> Result<$t, crate::error::ErrorStack>
+            where F: FnOnce(&mut [u8]) -> Result<usize, crate::error::ErrorStack>
+        {
+            unsafe {
+                ffi::init();
+                let mut cb = crate::util::CallbackState::new(callback);
+                let bio = crate::bio::MemBioSlice::new(pem)?;
+                cvt_p($f(bio.as_ptr(),
+                         ptr::null_mut(),
+                         Some(crate::util::invoke_passwd_cb::<F>),
+                         &mut cb as *mut _ as *mut _))
+                    .map(|p| ::foreign_types::ForeignType::from_ptr(p))
+            }
+        }
+    }
+}
+
+macro_rules! private_key_to_pem {
+    ($(#[$m:meta])* $n:ident, $(#[$m2:meta])* $n2:ident, $f:path) => {
+        $(#[$m])*
+        pub fn $n(&self) -> Result<Vec<u8>, crate::error::ErrorStack> {
+            unsafe {
+                let bio = crate::bio::MemBio::new()?;
+                cvt($f(bio.as_ptr(),
+                        self.as_ptr(),
+                        ptr::null(),
+                        ptr::null_mut(),
+                        -1,
+                        None,
+                        ptr::null_mut()))?;
+                Ok(bio.get_buf().to_owned())
+            }
+        }
+
+        $(#[$m2])*
+        pub fn $n2(
+            &self,
+            cipher: crate::symm::Cipher,
+            passphrase: &[u8]
+        ) -> Result<Vec<u8>, crate::error::ErrorStack> {
+            unsafe {
+                let bio = crate::bio::MemBio::new()?;
+                assert!(passphrase.len() <= ::libc::c_int::MAX as usize);
+                cvt($f(bio.as_ptr(),
+                        self.as_ptr(),
+                        cipher.as_ptr(),
+                        passphrase.as_ptr() as *const _ as *mut _,
+                        passphrase.len() as ::libc::c_int,
+                        None,
+                        ptr::null_mut()))?;
+                Ok(bio.get_buf().to_owned())
+            }
+        }
+    }
+}
+
+macro_rules! to_pem {
+    ($(#[$m:meta])* $n:ident, $f:path) => {
+        $(#[$m])*
+        pub fn $n(&self) -> Result<Vec<u8>, crate::error::ErrorStack> {
+            unsafe {
+                let bio = crate::bio::MemBio::new()?;
+                cvt($f(bio.as_ptr(), self.as_ptr()))?;
+                Ok(bio.get_buf().to_owned())
+            }
+        }
+    }
+}
+
+macro_rules! to_der {
+    ($(#[$m:meta])* $n:ident, $f:path) => {
+        $(#[$m])*
+        pub fn $n(&self) -> Result<Vec<u8>, crate::error::ErrorStack> {
+            unsafe {
+                let len = crate::cvt($f(::foreign_types::ForeignTypeRef::as_ptr(self),
+                                        ptr::null_mut()))?;
+                let mut buf = vec![0; len as usize];
+                crate::cvt($f(::foreign_types::ForeignTypeRef::as_ptr(self),
+                              &mut buf.as_mut_ptr()))?;
+                Ok(buf)
+            }
+        }
+    };
+}
+
+macro_rules! from_der {
+    ($(#[$m:meta])* $n:ident, $t:ty, $f:path) => {
+        $(#[$m])*
+        pub fn $n(der: &[u8]) -> Result<$t, crate::error::ErrorStack> {
+            use std::convert::TryInto;
+            unsafe {
+                ffi::init();
+                let len = ::std::cmp::min(der.len(), ::libc::c_long::MAX as usize) as ::libc::c_long;
+                crate::cvt_p($f(::std::ptr::null_mut(), &mut der.as_ptr(), len.try_into().unwrap()))
+                    .map(|p| ::foreign_types::ForeignType::from_ptr(p))
+            }
+        }
+    }
+}
+
+macro_rules! from_pem {
+    ($(#[$m:meta])* $n:ident, $t:ty, $f:path) => {
+        $(#[$m])*
+        pub fn $n(pem: &[u8]) -> Result<$t, crate::error::ErrorStack> {
+            unsafe {
+                crate::init();
+                let bio = crate::bio::MemBioSlice::new(pem)?;
+                cvt_p($f(bio.as_ptr(), ::std::ptr::null_mut(), None, ::std::ptr::null_mut()))
+                    .map(|p| ::foreign_types::ForeignType::from_ptr(p))
+            }
+        }
+    }
+}
+
+macro_rules! foreign_type_and_impl_send_sync {
+    (
+        $(#[$impl_attr:meta])*
+        type CType = $ctype:ty;
+        fn drop = $drop:expr;
+        $(fn clone = $clone:expr;)*
+
+        $(#[$owned_attr:meta])*
+        pub struct $owned:ident;
+        $(#[$borrowed_attr:meta])*
+        pub struct $borrowed:ident;
+    )
+        => {
+            ::foreign_types::foreign_type! {
+                $(#[$impl_attr])*
+                type CType = $ctype;
+                fn drop = $drop;
+                $(fn clone = $clone;)*
+                $(#[$owned_attr])*
+                pub struct $owned;
+                $(#[$borrowed_attr])*
+                pub struct $borrowed;
+            }
+
+            unsafe impl Send for $owned{}
+            unsafe impl Send for $borrowed{}
+            unsafe impl Sync for $owned{}
+            unsafe impl Sync for $borrowed{}
+        };
+}
+
+macro_rules! generic_foreign_type_and_impl_send_sync {
+    (
+        $(#[$impl_attr:meta])*
+        type CType = $ctype:ty;
+        fn drop = $drop:expr;
+        $(fn clone = $clone:expr;)*
+
+        $(#[$owned_attr:meta])*
+        pub struct $owned:ident<T>;
+        $(#[$borrowed_attr:meta])*
+        pub struct $borrowed:ident<T>;
+    ) => {
+        $(#[$owned_attr])*
+        pub struct $owned<T>(*mut $ctype, ::std::marker::PhantomData<T>);
+
+        $(#[$impl_attr])*
+        impl<T> ::foreign_types::ForeignType for $owned<T> {
+            type CType = $ctype;
+            type Ref = $borrowed<T>;
+
+            #[inline]
+            unsafe fn from_ptr(ptr: *mut $ctype) -> $owned<T> {
+                $owned(ptr, ::std::marker::PhantomData)
+            }
+
+            #[inline]
+            fn as_ptr(&self) -> *mut $ctype {
+                self.0
+            }
+        }
+
+        impl<T> Drop for $owned<T> {
+            #[inline]
+            fn drop(&mut self) {
+                unsafe { $drop(self.0) }
+            }
+        }
+
+        $(
+            impl<T> Clone for $owned<T> {
+                #[inline]
+                fn clone(&self) -> $owned<T> {
+                    unsafe {
+                        let handle: *mut $ctype = $clone(self.0);
+                        ::foreign_types::ForeignType::from_ptr(handle)
+                    }
+                }
+            }
+
+            impl<T> ::std::borrow::ToOwned for $borrowed<T> {
+                type Owned = $owned<T>;
+                #[inline]
+                fn to_owned(&self) -> $owned<T> {
+                    unsafe {
+                        let handle: *mut $ctype =
+                            $clone(::foreign_types::ForeignTypeRef::as_ptr(self));
+                        $crate::ForeignType::from_ptr(handle)
+                    }
+                }
+            }
+        )*
+
+        impl<T> ::std::ops::Deref for $owned<T> {
+            type Target = $borrowed<T>;
+
+            #[inline]
+            fn deref(&self) -> &$borrowed<T> {
+                unsafe { ::foreign_types::ForeignTypeRef::from_ptr(self.0) }
+            }
+        }
+
+        impl<T> ::std::ops::DerefMut for $owned<T> {
+            #[inline]
+            fn deref_mut(&mut self) -> &mut $borrowed<T> {
+                unsafe { ::foreign_types::ForeignTypeRef::from_ptr_mut(self.0) }
+            }
+        }
+
+        impl<T> ::std::borrow::Borrow<$borrowed<T>> for $owned<T> {
+            #[inline]
+            fn borrow(&self) -> &$borrowed<T> {
+                &**self
+            }
+        }
+
+        impl<T> ::std::convert::AsRef<$borrowed<T>> for $owned<T> {
+            #[inline]
+            fn as_ref(&self) -> &$borrowed<T> {
+                &**self
+            }
+        }
+
+        $(#[$borrowed_attr])*
+        pub struct $borrowed<T>(::foreign_types::Opaque, ::std::marker::PhantomData<T>);
+
+        $(#[$impl_attr])*
+        impl<T> ::foreign_types::ForeignTypeRef for $borrowed<T> {
+            type CType = $ctype;
+        }
+
+        unsafe impl<T> Send for $owned<T>{}
+        unsafe impl<T> Send for $borrowed<T>{}
+        unsafe impl<T> Sync for $owned<T>{}
+        unsafe impl<T> Sync for $borrowed<T>{}
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/md.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/md.rs
--- 43.0.0-1/rust-vendor/openssl/src/md.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/md.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,235 @@
+//! Message digest algorithms.
+
+#[cfg(ossl300)]
+use crate::cvt_p;
+#[cfg(ossl300)]
+use crate::error::ErrorStack;
+#[cfg(ossl300)]
+use crate::lib_ctx::LibCtxRef;
+use crate::nid::Nid;
+use cfg_if::cfg_if;
+use foreign_types::{ForeignTypeRef, Opaque};
+use openssl_macros::corresponds;
+#[cfg(ossl300)]
+use std::ffi::CString;
+#[cfg(ossl300)]
+use std::ptr;
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        use foreign_types::ForeignType;
+        use std::ops::{Deref, DerefMut};
+
+        type Inner = *mut ffi::EVP_MD;
+
+        impl Drop for Md {
+            #[inline]
+            fn drop(&mut self) {
+                unsafe {
+                    ffi::EVP_MD_free(self.as_ptr());
+                }
+            }
+        }
+
+        impl ForeignType for Md {
+            type CType = ffi::EVP_MD;
+            type Ref = MdRef;
+
+            #[inline]
+            unsafe fn from_ptr(ptr: *mut Self::CType) -> Self {
+                Md(ptr)
+            }
+
+            #[inline]
+            fn as_ptr(&self) -> *mut Self::CType {
+                self.0
+            }
+        }
+
+        impl Deref for Md {
+            type Target = MdRef;
+
+            #[inline]
+            fn deref(&self) -> &Self::Target {
+                unsafe {
+                    MdRef::from_ptr(self.as_ptr())
+                }
+            }
+        }
+
+        impl DerefMut for Md {
+            #[inline]
+            fn deref_mut(&mut self) -> &mut Self::Target {
+                unsafe {
+                    MdRef::from_ptr_mut(self.as_ptr())
+                }
+            }
+        }
+    } else {
+        enum Inner {}
+    }
+}
+
+/// A message digest algorithm.
+pub struct Md(Inner);
+
+unsafe impl Sync for Md {}
+unsafe impl Send for Md {}
+
+impl Md {
+    /// Returns the `Md` corresponding to an [`Nid`].
+    #[corresponds(EVP_get_digestbynid)]
+    pub fn from_nid(type_: Nid) -> Option<&'static MdRef> {
+        ffi::init();
+        unsafe {
+            let ptr = ffi::EVP_get_digestbynid(type_.as_raw());
+            if ptr.is_null() {
+                None
+            } else {
+                Some(MdRef::from_ptr(ptr as *mut _))
+            }
+        }
+    }
+
+    /// Fetches an `Md` object corresponding to the specified algorithm name and properties.
+    ///
+    /// Requires OpenSSL 3.0.0 or newer.
+    #[corresponds(EVP_MD_fetch)]
+    #[cfg(ossl300)]
+    pub fn fetch(
+        ctx: Option<&LibCtxRef>,
+        algorithm: &str,
+        properties: Option<&str>,
+    ) -> Result<Self, ErrorStack> {
+        ffi::init();
+        let algorithm = CString::new(algorithm).unwrap();
+        let properties = properties.map(|s| CString::new(s).unwrap());
+
+        unsafe {
+            let ptr = cvt_p(ffi::EVP_MD_fetch(
+                ctx.map_or(ptr::null_mut(), ForeignTypeRef::as_ptr),
+                algorithm.as_ptr(),
+                properties.map_or(ptr::null_mut(), |s| s.as_ptr()),
+            ))?;
+
+            Ok(Md::from_ptr(ptr))
+        }
+    }
+
+    #[inline]
+    #[cfg(not(boringssl))]
+    pub fn null() -> &'static MdRef {
+        unsafe { MdRef::from_ptr(ffi::EVP_md_null() as *mut _) }
+    }
+
+    #[inline]
+    pub fn md5() -> &'static MdRef {
+        unsafe { MdRef::from_ptr(ffi::EVP_md5() as *mut _) }
+    }
+
+    #[inline]
+    pub fn sha1() -> &'static MdRef {
+        unsafe { MdRef::from_ptr(ffi::EVP_sha1() as *mut _) }
+    }
+
+    #[inline]
+    pub fn sha224() -> &'static MdRef {
+        unsafe { MdRef::from_ptr(ffi::EVP_sha224() as *mut _) }
+    }
+
+    #[inline]
+    pub fn sha256() -> &'static MdRef {
+        unsafe { MdRef::from_ptr(ffi::EVP_sha256() as *mut _) }
+    }
+
+    #[inline]
+    pub fn sha384() -> &'static MdRef {
+        unsafe { MdRef::from_ptr(ffi::EVP_sha384() as *mut _) }
+    }
+
+    #[inline]
+    pub fn sha512() -> &'static MdRef {
+        unsafe { MdRef::from_ptr(ffi::EVP_sha512() as *mut _) }
+    }
+
+    #[cfg(any(ossl111, libressl380))]
+    #[inline]
+    pub fn sha3_224() -> &'static MdRef {
+        unsafe { MdRef::from_ptr(ffi::EVP_sha3_224() as *mut _) }
+    }
+
+    #[cfg(any(ossl111, libressl380))]
+    #[inline]
+    pub fn sha3_256() -> &'static MdRef {
+        unsafe { MdRef::from_ptr(ffi::EVP_sha3_256() as *mut _) }
+    }
+
+    #[cfg(any(ossl111, libressl380))]
+    #[inline]
+    pub fn sha3_384() -> &'static MdRef {
+        unsafe { MdRef::from_ptr(ffi::EVP_sha3_384() as *mut _) }
+    }
+
+    #[cfg(any(ossl111, libressl380))]
+    #[inline]
+    pub fn sha3_512() -> &'static MdRef {
+        unsafe { MdRef::from_ptr(ffi::EVP_sha3_512() as *mut _) }
+    }
+
+    #[cfg(ossl111)]
+    #[inline]
+    pub fn shake128() -> &'static MdRef {
+        unsafe { MdRef::from_ptr(ffi::EVP_shake128() as *mut _) }
+    }
+
+    #[cfg(ossl111)]
+    #[inline]
+    pub fn shake256() -> &'static MdRef {
+        unsafe { MdRef::from_ptr(ffi::EVP_shake256() as *mut _) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_RMD160"))]
+    #[inline]
+    pub fn ripemd160() -> &'static MdRef {
+        unsafe { MdRef::from_ptr(ffi::EVP_ripemd160() as *mut _) }
+    }
+
+    #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM3")))]
+    #[inline]
+    pub fn sm3() -> &'static MdRef {
+        unsafe { MdRef::from_ptr(ffi::EVP_sm3() as *mut _) }
+    }
+}
+
+/// A reference to an [`Md`].
+pub struct MdRef(Opaque);
+
+impl ForeignTypeRef for MdRef {
+    type CType = ffi::EVP_MD;
+}
+
+unsafe impl Sync for MdRef {}
+unsafe impl Send for MdRef {}
+
+impl MdRef {
+    /// Returns the block size of the digest in bytes.
+    #[corresponds(EVP_MD_block_size)]
+    #[inline]
+    pub fn block_size(&self) -> usize {
+        unsafe { ffi::EVP_MD_block_size(self.as_ptr()) as usize }
+    }
+
+    /// Returns the size of the digest in bytes.
+    #[corresponds(EVP_MD_size)]
+    #[inline]
+    pub fn size(&self) -> usize {
+        unsafe { ffi::EVP_MD_size(self.as_ptr()) as usize }
+    }
+
+    /// Returns the [`Nid`] of the digest.
+    #[corresponds(EVP_MD_type)]
+    #[inline]
+    pub fn type_(&self) -> Nid {
+        unsafe { Nid::from_raw(ffi::EVP_MD_type(self.as_ptr())) }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/md_ctx.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/md_ctx.rs
--- 43.0.0-1/rust-vendor/openssl/src/md_ctx.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/md_ctx.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,540 @@
+//! The message digest context.
+//!
+//! # Examples
+//!
+//! Compute the SHA256 checksum of data
+//!
+//! ```
+//! use openssl::md::Md;
+//! use openssl::md_ctx::MdCtx;
+//!
+//! let mut ctx = MdCtx::new().unwrap();
+//! ctx.digest_init(Md::sha256()).unwrap();
+//! ctx.digest_update(b"Some Crypto Text").unwrap();
+//! let mut digest = [0; 32];
+//! ctx.digest_final(&mut digest).unwrap();
+//!
+//! assert_eq!(
+//!     digest,
+//!     *b"\x60\x78\x56\x38\x8a\xca\x5c\x51\x83\xc4\xd1\x4d\xc8\xf9\xcc\xf2\
+//!        \xa5\x21\xb3\x10\x93\x72\xfa\xd6\x7c\x55\xf5\xc9\xe3\xd1\x83\x19",
+//! );
+//! ```
+//!
+//! Sign and verify data with RSA and SHA256
+//!
+//! ```
+//! use openssl::md::Md;
+//! use openssl::md_ctx::MdCtx;
+//! use openssl::pkey::PKey;
+//! use openssl::rsa::Rsa;
+//!
+//! // Generate a random RSA key.
+//! let key = Rsa::generate(4096).unwrap();
+//! let key = PKey::from_rsa(key).unwrap();
+//!
+//! let text = b"Some Crypto Text";
+//!
+//! // Create the signature.
+//! let mut ctx = MdCtx::new().unwrap();
+//! ctx.digest_sign_init(Some(Md::sha256()), &key).unwrap();
+//! ctx.digest_sign_update(text).unwrap();
+//! let mut signature = vec![];
+//! ctx.digest_sign_final_to_vec(&mut signature).unwrap();
+//!
+//! // Verify the signature.
+//! let mut ctx = MdCtx::new().unwrap();
+//! ctx.digest_verify_init(Some(Md::sha256()), &key).unwrap();
+//! ctx.digest_verify_update(text).unwrap();
+//! let valid = ctx.digest_verify_final(&signature).unwrap();
+//! assert!(valid);
+//! ```
+//!
+
+#![cfg_attr(
+    not(boringssl),
+    doc = r#"\
+Compute and verify an HMAC-SHA256
+
+```
+use openssl::md::Md;
+use openssl::md_ctx::MdCtx;
+use openssl::memcmp;
+use openssl::pkey::PKey;
+
+// Create a key with the HMAC secret.
+let key = PKey::hmac(b"my secret").unwrap();
+
+let text = b"Some Crypto Text";
+
+// Compute the HMAC.
+let mut ctx = MdCtx::new().unwrap();
+ctx.digest_sign_init(Some(Md::sha256()), &key).unwrap();
+ctx.digest_sign_update(text).unwrap();
+let mut hmac = vec![];
+ctx.digest_sign_final_to_vec(&mut hmac).unwrap();
+
+// Verify the HMAC. You can't use MdCtx to do this; instead use a constant time equality check.
+# let target = hmac.clone();
+let valid = memcmp::eq(&hmac, &target);
+assert!(valid);
+```"#
+)]
+
+use crate::error::ErrorStack;
+use crate::md::MdRef;
+use crate::pkey::{HasPrivate, HasPublic, PKeyRef};
+use crate::pkey_ctx::PkeyCtxRef;
+use crate::{cvt, cvt_n, cvt_p};
+use cfg_if::cfg_if;
+use foreign_types::{ForeignType, ForeignTypeRef};
+use openssl_macros::corresponds;
+use std::convert::TryFrom;
+use std::ptr;
+
+cfg_if! {
+    if #[cfg(any(ossl110, boringssl, libressl382))] {
+        use ffi::{EVP_MD_CTX_free, EVP_MD_CTX_new};
+    } else {
+        use ffi::{EVP_MD_CTX_create as EVP_MD_CTX_new, EVP_MD_CTX_destroy as EVP_MD_CTX_free};
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::EVP_MD_CTX;
+    fn drop = EVP_MD_CTX_free;
+
+    pub struct MdCtx;
+    /// A reference to an [`MdCtx`].
+    pub struct MdCtxRef;
+}
+
+impl MdCtx {
+    /// Creates a new context.
+    #[corresponds(EVP_MD_CTX_new)]
+    #[inline]
+    pub fn new() -> Result<Self, ErrorStack> {
+        ffi::init();
+
+        unsafe {
+            let ptr = cvt_p(EVP_MD_CTX_new())?;
+            Ok(MdCtx::from_ptr(ptr))
+        }
+    }
+}
+
+impl MdCtxRef {
+    /// Initializes the context to compute the digest of data.
+    #[corresponds(EVP_DigestInit_ex)]
+    #[inline]
+    pub fn digest_init(&mut self, digest: &MdRef) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_DigestInit_ex(
+                self.as_ptr(),
+                digest.as_ptr(),
+                ptr::null_mut(),
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Initializes the context to compute the signature of data.
+    ///
+    /// A reference to the context's inner `PkeyCtx` is returned, allowing signature settings to be configured.
+    #[corresponds(EVP_DigestSignInit)]
+    #[inline]
+    pub fn digest_sign_init<'a, T>(
+        &'a mut self,
+        digest: Option<&MdRef>,
+        pkey: &PKeyRef<T>,
+    ) -> Result<&'a mut PkeyCtxRef<T>, ErrorStack>
+    where
+        T: HasPrivate,
+    {
+        unsafe {
+            let mut p = ptr::null_mut();
+            cvt(ffi::EVP_DigestSignInit(
+                self.as_ptr(),
+                &mut p,
+                digest.map_or(ptr::null(), |p| p.as_ptr()),
+                ptr::null_mut(),
+                pkey.as_ptr(),
+            ))?;
+            Ok(PkeyCtxRef::from_ptr_mut(p))
+        }
+    }
+
+    /// Initializes the context to verify the signature of data.
+    ///
+    /// A reference to the context's inner `PkeyCtx` is returned, allowing signature settings to be configured.
+    #[corresponds(EVP_DigestVerifyInit)]
+    #[inline]
+    pub fn digest_verify_init<'a, T>(
+        &'a mut self,
+        digest: Option<&MdRef>,
+        pkey: &PKeyRef<T>,
+    ) -> Result<&'a mut PkeyCtxRef<T>, ErrorStack>
+    where
+        T: HasPublic,
+    {
+        unsafe {
+            let mut p = ptr::null_mut();
+            cvt(ffi::EVP_DigestVerifyInit(
+                self.as_ptr(),
+                &mut p,
+                digest.map_or(ptr::null(), |p| p.as_ptr()),
+                ptr::null_mut(),
+                pkey.as_ptr(),
+            ))?;
+            Ok(PkeyCtxRef::from_ptr_mut(p))
+        }
+    }
+
+    /// Updates the context with more data.
+    #[corresponds(EVP_DigestUpdate)]
+    #[inline]
+    pub fn digest_update(&mut self, data: &[u8]) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_DigestUpdate(
+                self.as_ptr(),
+                data.as_ptr() as *const _,
+                data.len(),
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Updates the context with more data.
+    #[corresponds(EVP_DigestSignUpdate)]
+    #[inline]
+    pub fn digest_sign_update(&mut self, data: &[u8]) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_DigestSignUpdate(
+                self.as_ptr(),
+                data.as_ptr() as *const _,
+                data.len(),
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Updates the context with more data.
+    #[corresponds(EVP_DigestVerifyUpdate)]
+    #[inline]
+    pub fn digest_verify_update(&mut self, data: &[u8]) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_DigestVerifyUpdate(
+                self.as_ptr(),
+                data.as_ptr() as *const _,
+                data.len(),
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Copies the computed digest into the buffer, returning the number of bytes written.
+    #[corresponds(EVP_DigestFinal)]
+    #[inline]
+    pub fn digest_final(&mut self, out: &mut [u8]) -> Result<usize, ErrorStack> {
+        let mut len = u32::try_from(out.len()).unwrap_or(u32::MAX);
+
+        unsafe {
+            cvt(ffi::EVP_DigestFinal(
+                self.as_ptr(),
+                out.as_mut_ptr(),
+                &mut len,
+            ))?;
+        }
+
+        Ok(len as usize)
+    }
+
+    /// Copies the computed digest into the buffer.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(EVP_DigestFinalXOF)]
+    #[inline]
+    #[cfg(ossl111)]
+    pub fn digest_final_xof(&mut self, out: &mut [u8]) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_DigestFinalXOF(
+                self.as_ptr(),
+                out.as_mut_ptr(),
+                out.len(),
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Signs the computed digest.
+    ///
+    /// If `out` is set to `None`, an upper bound on the number of bytes required for the output buffer will be
+    /// returned.
+    #[corresponds(EVP_DigestSignFinal)]
+    #[inline]
+    pub fn digest_sign_final(&mut self, out: Option<&mut [u8]>) -> Result<usize, ErrorStack> {
+        let mut len = out.as_ref().map_or(0, |b| b.len());
+
+        unsafe {
+            cvt(ffi::EVP_DigestSignFinal(
+                self.as_ptr(),
+                out.map_or(ptr::null_mut(), |b| b.as_mut_ptr()),
+                &mut len,
+            ))?;
+        }
+
+        Ok(len)
+    }
+
+    /// Like [`Self::digest_sign_final`] but appends the signature to a [`Vec`].
+    pub fn digest_sign_final_to_vec(&mut self, out: &mut Vec<u8>) -> Result<usize, ErrorStack> {
+        let base = out.len();
+        let len = self.digest_sign_final(None)?;
+        out.resize(base + len, 0);
+        let len = self.digest_sign_final(Some(&mut out[base..]))?;
+        out.truncate(base + len);
+        Ok(len)
+    }
+
+    /// Verifies the provided signature.
+    ///
+    /// Returns `Ok(true)` if the signature is valid, `Ok(false)` if the signature is invalid, and `Err` if an error
+    /// occurred.
+    #[corresponds(EVP_DigestVerifyFinal)]
+    #[inline]
+    pub fn digest_verify_final(&mut self, signature: &[u8]) -> Result<bool, ErrorStack> {
+        unsafe {
+            let r = cvt_n(ffi::EVP_DigestVerifyFinal(
+                self.as_ptr(),
+                signature.as_ptr() as *mut _,
+                signature.len(),
+            ))?;
+            Ok(r == 1)
+        }
+    }
+
+    /// Computes the signature of the data in `from`.
+    ///
+    /// If `to` is set to `None`, an upper bound on the number of bytes required for the output buffer will be
+    /// returned.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(EVP_DigestSign)]
+    #[cfg(ossl111)]
+    #[inline]
+    pub fn digest_sign(&mut self, from: &[u8], to: Option<&mut [u8]>) -> Result<usize, ErrorStack> {
+        let mut len = to.as_ref().map_or(0, |b| b.len());
+
+        unsafe {
+            cvt(ffi::EVP_DigestSign(
+                self.as_ptr(),
+                to.map_or(ptr::null_mut(), |b| b.as_mut_ptr()),
+                &mut len,
+                from.as_ptr(),
+                from.len(),
+            ))?;
+        }
+
+        Ok(len)
+    }
+
+    /// Like [`Self::digest_sign`] but appends the signature to a [`Vec`].
+    #[cfg(ossl111)]
+    pub fn digest_sign_to_vec(
+        &mut self,
+        from: &[u8],
+        to: &mut Vec<u8>,
+    ) -> Result<usize, ErrorStack> {
+        let base = to.len();
+        let len = self.digest_sign(from, None)?;
+        to.resize(base + len, 0);
+        let len = self.digest_sign(from, Some(&mut to[base..]))?;
+        to.truncate(base + len);
+        Ok(len)
+    }
+
+    /// Verifies the signature of the data in `data`.
+    ///
+    /// Returns `Ok(true)` if the signature is valid, `Ok(false)` if the signature is invalid, and `Err` if an error
+    /// occurred.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(EVP_DigestVerify)]
+    #[cfg(ossl111)]
+    #[inline]
+    pub fn digest_verify(&mut self, data: &[u8], signature: &[u8]) -> Result<bool, ErrorStack> {
+        unsafe {
+            let r = cvt(ffi::EVP_DigestVerify(
+                self.as_ptr(),
+                signature.as_ptr(),
+                signature.len(),
+                data.as_ptr(),
+                data.len(),
+            ))?;
+            Ok(r == 1)
+        }
+    }
+
+    /// Returns the size of the message digest, i.e. the size of the hash
+    #[corresponds(EVP_MD_CTX_size)]
+    #[inline]
+    pub fn size(&self) -> usize {
+        unsafe { ffi::EVP_MD_CTX_size(self.as_ptr()) as usize }
+    }
+
+    /// Resets the underlying EVP_MD_CTX instance
+    #[corresponds(EVP_MD_CTX_reset)]
+    #[cfg(ossl111)]
+    #[inline]
+    pub fn reset(&mut self) -> Result<(), ErrorStack> {
+        unsafe {
+            let _ = cvt(ffi::EVP_MD_CTX_reset(self.as_ptr()))?;
+            Ok(())
+        }
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+    use crate::md::Md;
+    use crate::pkey::PKey;
+    use crate::rsa::Rsa;
+
+    #[test]
+    fn verify_fail() {
+        let key1 = Rsa::generate(4096).unwrap();
+        let key1 = PKey::from_rsa(key1).unwrap();
+
+        let md = Md::sha256();
+        let data = b"Some Crypto Text";
+
+        let mut ctx = MdCtx::new().unwrap();
+        ctx.digest_sign_init(Some(md), &key1).unwrap();
+        ctx.digest_sign_update(data).unwrap();
+        let mut signature = vec![];
+        ctx.digest_sign_final_to_vec(&mut signature).unwrap();
+
+        let bad_data = b"Some Crypto text";
+
+        ctx.digest_verify_init(Some(md), &key1).unwrap();
+        ctx.digest_verify_update(bad_data).unwrap();
+        let valid = ctx.digest_verify_final(&signature).unwrap();
+        assert!(!valid);
+    }
+
+    #[test]
+    fn verify_success() {
+        let key1 = Rsa::generate(2048).unwrap();
+        let key1 = PKey::from_rsa(key1).unwrap();
+
+        let md = Md::sha256();
+        let data = b"Some Crypto Text";
+
+        let mut ctx = MdCtx::new().unwrap();
+        ctx.digest_sign_init(Some(md), &key1).unwrap();
+        ctx.digest_sign_update(data).unwrap();
+        let mut signature = vec![];
+        ctx.digest_sign_final_to_vec(&mut signature).unwrap();
+
+        let good_data = b"Some Crypto Text";
+
+        ctx.digest_verify_init(Some(md), &key1).unwrap();
+        ctx.digest_verify_update(good_data).unwrap();
+        let valid = ctx.digest_verify_final(&signature).unwrap();
+        assert!(valid);
+    }
+
+    #[test]
+    fn verify_with_public_success() {
+        let rsa = Rsa::generate(2048).unwrap();
+        let key1 = PKey::from_rsa(rsa.clone()).unwrap();
+
+        let md = Md::sha256();
+        let data = b"Some Crypto Text";
+
+        let mut ctx = MdCtx::new().unwrap();
+        ctx.digest_sign_init(Some(md), &key1).unwrap();
+        ctx.digest_sign_update(data).unwrap();
+        let mut signature = vec![];
+        ctx.digest_sign_final_to_vec(&mut signature).unwrap();
+
+        let good_data = b"Some Crypto Text";
+
+        // try to verify using only public components of the key
+        let n = rsa.n().to_owned().unwrap();
+        let e = rsa.e().to_owned().unwrap();
+
+        let rsa = Rsa::from_public_components(n, e).unwrap();
+        let key1 = PKey::from_rsa(rsa).unwrap();
+
+        ctx.digest_verify_init(Some(md), &key1).unwrap();
+        ctx.digest_verify_update(good_data).unwrap();
+        let valid = ctx.digest_verify_final(&signature).unwrap();
+        assert!(valid);
+    }
+
+    #[test]
+    fn verify_md_ctx_size() {
+        let mut ctx = MdCtx::new().unwrap();
+        ctx.digest_init(Md::sha224()).unwrap();
+        assert_eq!(Md::sha224().size(), ctx.size());
+        assert_eq!(Md::sha224().size(), 28);
+
+        let mut ctx = MdCtx::new().unwrap();
+        ctx.digest_init(Md::sha256()).unwrap();
+        assert_eq!(Md::sha256().size(), ctx.size());
+        assert_eq!(Md::sha256().size(), 32);
+
+        let mut ctx = MdCtx::new().unwrap();
+        ctx.digest_init(Md::sha384()).unwrap();
+        assert_eq!(Md::sha384().size(), ctx.size());
+        assert_eq!(Md::sha384().size(), 48);
+
+        let mut ctx = MdCtx::new().unwrap();
+        ctx.digest_init(Md::sha512()).unwrap();
+        assert_eq!(Md::sha512().size(), ctx.size());
+        assert_eq!(Md::sha512().size(), 64);
+    }
+
+    #[test]
+    #[cfg(ossl111)]
+    fn verify_md_ctx_reset() {
+        let hello_expected =
+            hex::decode("185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969")
+                .unwrap();
+        let world_expected =
+            hex::decode("78ae647dc5544d227130a0682a51e30bc7777fbb6d8a8f17007463a3ecd1d524")
+                .unwrap();
+        // Calculate SHA-256 digest of "Hello"
+        let mut ctx = MdCtx::new().unwrap();
+        ctx.digest_init(Md::sha256()).unwrap();
+        ctx.digest_update(b"Hello").unwrap();
+        let mut result = vec![0; 32];
+        let result_len = ctx.digest_final(result.as_mut_slice()).unwrap();
+        assert_eq!(result_len, result.len());
+        // Validate result of "Hello"
+        assert_eq!(result, hello_expected);
+
+        // Create new context
+        let mut ctx = MdCtx::new().unwrap();
+        // Initialize and update to "Hello"
+        ctx.digest_init(Md::sha256()).unwrap();
+        ctx.digest_update(b"Hello").unwrap();
+        // Now reset, init to SHA-256 and use "World"
+        ctx.reset().unwrap();
+        ctx.digest_init(Md::sha256()).unwrap();
+        ctx.digest_update(b"World").unwrap();
+
+        let mut reset_result = vec![0; 32];
+        let result_len = ctx.digest_final(reset_result.as_mut_slice()).unwrap();
+        assert_eq!(result_len, reset_result.len());
+        // Validate result of digest of "World"
+        assert_eq!(reset_result, world_expected);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/memcmp.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/memcmp.rs
--- 43.0.0-1/rust-vendor/openssl/src/memcmp.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/memcmp.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,93 @@
+//! Utilities to safely compare cryptographic values.
+//!
+//! Extra care must be taken when comparing values in
+//! cryptographic code. If done incorrectly, it can lead
+//! to a [timing attack](https://en.wikipedia.org/wiki/Timing_attack).
+//! By analyzing the time taken to execute parts of a cryptographic
+//! algorithm, and attacker can attempt to compromise the
+//! cryptosystem.
+//!
+//! The utilities in this module are designed to be resistant
+//! to this type of attack.
+//!
+//! # Examples
+//!
+//! To perform a constant-time comparison of two arrays of the same length but different
+//! values:
+//!
+//! ```
+//! use openssl::memcmp::eq;
+//!
+//! // We want to compare `a` to `b` and `c`, without giving
+//! // away through timing analysis that `c` is more similar to `a`
+//! // than `b`.
+//! let a = [0, 0, 0];
+//! let b = [1, 1, 1];
+//! let c = [0, 0, 1];
+//!
+//! // These statements will execute in the same amount of time.
+//! assert!(!eq(&a, &b));
+//! assert!(!eq(&a, &c));
+//! ```
+use libc::size_t;
+use openssl_macros::corresponds;
+
+/// Returns `true` iff `a` and `b` contain the same bytes.
+///
+/// This operation takes an amount of time dependent on the length of the two
+/// arrays given, but is independent of the contents of a and b.
+///
+/// # Panics
+///
+/// This function will panic the current task if `a` and `b` do not have the same
+/// length.
+///
+/// # Examples
+///
+/// To perform a constant-time comparison of two arrays of the same length but different
+/// values:
+///
+/// ```
+/// use openssl::memcmp::eq;
+///
+/// // We want to compare `a` to `b` and `c`, without giving
+/// // away through timing analysis that `c` is more similar to `a`
+/// // than `b`.
+/// let a = [0, 0, 0];
+/// let b = [1, 1, 1];
+/// let c = [0, 0, 1];
+///
+/// // These statements will execute in the same amount of time.
+/// assert!(!eq(&a, &b));
+/// assert!(!eq(&a, &c));
+/// ```
+#[corresponds(CRYPTO_memcmp)]
+pub fn eq(a: &[u8], b: &[u8]) -> bool {
+    assert!(a.len() == b.len());
+    let ret = unsafe {
+        ffi::CRYPTO_memcmp(
+            a.as_ptr() as *const _,
+            b.as_ptr() as *const _,
+            a.len() as size_t,
+        )
+    };
+    ret == 0
+}
+
+#[cfg(test)]
+mod tests {
+    use super::eq;
+
+    #[test]
+    fn test_eq() {
+        assert!(eq(&[], &[]));
+        assert!(eq(&[1], &[1]));
+        assert!(!eq(&[1, 2, 3], &[1, 2, 4]));
+    }
+
+    #[test]
+    #[should_panic]
+    fn test_diff_lens() {
+        eq(&[], &[1]);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/nid.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/nid.rs
--- 43.0.0-1/rust-vendor/openssl/src/nid.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/nid.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1183 @@
+//! A collection of numerical identifiers for OpenSSL objects.
+use libc::{c_char, c_int};
+
+use std::ffi::CStr;
+use std::ffi::CString;
+use std::str;
+
+use crate::cvt_p;
+use crate::error::ErrorStack;
+use openssl_macros::corresponds;
+
+/// The digest and public-key algorithms associated with a signature.
+pub struct SignatureAlgorithms {
+    /// The signature's digest.
+    ///
+    /// If the signature does not specify a digest, this will be `NID::UNDEF`.
+    pub digest: Nid,
+
+    /// The signature's public-key.
+    pub pkey: Nid,
+}
+
+/// A numerical identifier for an OpenSSL object.
+///
+/// Objects in OpenSSL can have a short name, a long name, and
+/// a numerical identifier (NID). For convenience, objects
+/// are usually represented in source code using these numeric
+/// identifiers.
+///
+/// Users should generally not need to create new `Nid`s.
+///
+/// # Examples
+///
+/// To view the integer representation of a `Nid`:
+///
+/// ```
+/// use openssl::nid::Nid;
+///
+/// assert!(Nid::AES_256_GCM.as_raw() == 901);
+/// ```
+///
+/// # External Documentation
+///
+/// The following documentation provides context about `Nid`s and their usage
+/// in OpenSSL.
+///
+/// - [Obj_nid2obj](https://www.openssl.org/docs/manmaster/crypto/OBJ_create.html)
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
+pub struct Nid(c_int);
+
+#[allow(non_snake_case)]
+impl Nid {
+    /// Create a `Nid` from an integer representation.
+    pub const fn from_raw(raw: c_int) -> Nid {
+        Nid(raw)
+    }
+
+    /// Return the integer representation of a `Nid`.
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub const fn as_raw(&self) -> c_int {
+        self.0
+    }
+
+    /// Creates a new `Nid` for the `oid` with short name `sn` and long name `ln`.
+    #[corresponds(OBJ_create)]
+    pub fn create(oid: &str, sn: &str, ln: &str) -> Result<Nid, ErrorStack> {
+        unsafe {
+            ffi::init();
+            let oid = CString::new(oid).unwrap();
+            let sn = CString::new(sn).unwrap();
+            let ln = CString::new(ln).unwrap();
+            let raw = ffi::OBJ_create(oid.as_ptr(), sn.as_ptr(), ln.as_ptr());
+            if raw == ffi::NID_undef {
+                Err(ErrorStack::get())
+            } else {
+                Ok(Nid(raw))
+            }
+        }
+    }
+
+    /// Returns the `Nid`s of the digest and public key algorithms associated with a signature ID.
+    ///
+    /// This corresponds to `OBJ_find_sigid_algs`.
+    #[corresponds(OBJ_find_sigid_algs)]
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn signature_algorithms(&self) -> Option<SignatureAlgorithms> {
+        unsafe {
+            let mut digest = 0;
+            let mut pkey = 0;
+            if ffi::OBJ_find_sigid_algs(self.0, &mut digest, &mut pkey) == 1 {
+                Some(SignatureAlgorithms {
+                    digest: Nid(digest),
+                    pkey: Nid(pkey),
+                })
+            } else {
+                None
+            }
+        }
+    }
+
+    /// Returns the string representation of a `Nid` (long).
+    #[corresponds(OBJ_nid2ln)]
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn long_name(&self) -> Result<&'static str, ErrorStack> {
+        unsafe {
+            cvt_p(ffi::OBJ_nid2ln(self.0) as *mut c_char)
+                .map(|nameptr| str::from_utf8(CStr::from_ptr(nameptr).to_bytes()).unwrap())
+        }
+    }
+
+    /// Returns the string representation of a `Nid` (short).
+    #[corresponds(OBJ_nid2sn)]
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn short_name(&self) -> Result<&'static str, ErrorStack> {
+        unsafe {
+            cvt_p(ffi::OBJ_nid2sn(self.0) as *mut c_char)
+                .map(|nameptr| str::from_utf8(CStr::from_ptr(nameptr).to_bytes()).unwrap())
+        }
+    }
+
+    pub const UNDEF: Nid = Nid(ffi::NID_undef);
+    pub const ITU_T: Nid = Nid(ffi::NID_itu_t);
+    #[cfg(not(boringssl))]
+    pub const CCITT: Nid = Nid(ffi::NID_ccitt);
+    pub const ISO: Nid = Nid(ffi::NID_iso);
+    pub const JOINT_ISO_ITU_T: Nid = Nid(ffi::NID_joint_iso_itu_t);
+    #[cfg(not(boringssl))]
+    pub const JOINT_ISO_CCITT: Nid = Nid(ffi::NID_joint_iso_ccitt);
+    pub const MEMBER_BODY: Nid = Nid(ffi::NID_member_body);
+    pub const IDENTIFIED_ORGANIZATION: Nid = Nid(ffi::NID_identified_organization);
+    pub const HMAC_MD5: Nid = Nid(ffi::NID_hmac_md5);
+    pub const HMAC_SHA1: Nid = Nid(ffi::NID_hmac_sha1);
+    pub const CERTICOM_ARC: Nid = Nid(ffi::NID_certicom_arc);
+    pub const INTERNATIONAL_ORGANIZATIONS: Nid = Nid(ffi::NID_international_organizations);
+    pub const WAP: Nid = Nid(ffi::NID_wap);
+    pub const WAP_WSG: Nid = Nid(ffi::NID_wap_wsg);
+    pub const SELECTED_ATTRIBUTE_TYPES: Nid = Nid(ffi::NID_selected_attribute_types);
+    pub const CLEARANCE: Nid = Nid(ffi::NID_clearance);
+    pub const ISO_US: Nid = Nid(ffi::NID_ISO_US);
+    pub const X9_57: Nid = Nid(ffi::NID_X9_57);
+    pub const X9CM: Nid = Nid(ffi::NID_X9cm);
+    pub const DSA: Nid = Nid(ffi::NID_dsa);
+    pub const DSAWITHSHA1: Nid = Nid(ffi::NID_dsaWithSHA1);
+    pub const ANSI_X9_62: Nid = Nid(ffi::NID_ansi_X9_62);
+    pub const X9_62_PRIME_FIELD: Nid = Nid(ffi::NID_X9_62_prime_field);
+    pub const X9_62_CHARACTERISTIC_TWO_FIELD: Nid = Nid(ffi::NID_X9_62_characteristic_two_field);
+    pub const X9_62_ID_CHARACTERISTIC_TWO_BASIS: Nid =
+        Nid(ffi::NID_X9_62_id_characteristic_two_basis);
+    pub const X9_62_ONBASIS: Nid = Nid(ffi::NID_X9_62_onBasis);
+    pub const X9_62_TPBASIS: Nid = Nid(ffi::NID_X9_62_tpBasis);
+    pub const X9_62_PPBASIS: Nid = Nid(ffi::NID_X9_62_ppBasis);
+    pub const X9_62_ID_ECPUBLICKEY: Nid = Nid(ffi::NID_X9_62_id_ecPublicKey);
+    pub const X9_62_C2PNB163V1: Nid = Nid(ffi::NID_X9_62_c2pnb163v1);
+    pub const X9_62_C2PNB163V2: Nid = Nid(ffi::NID_X9_62_c2pnb163v2);
+    pub const X9_62_C2PNB163V3: Nid = Nid(ffi::NID_X9_62_c2pnb163v3);
+    pub const X9_62_C2PNB176V1: Nid = Nid(ffi::NID_X9_62_c2pnb176v1);
+    pub const X9_62_C2TNB191V1: Nid = Nid(ffi::NID_X9_62_c2tnb191v1);
+    pub const X9_62_C2TNB191V2: Nid = Nid(ffi::NID_X9_62_c2tnb191v2);
+    pub const X9_62_C2TNB191V3: Nid = Nid(ffi::NID_X9_62_c2tnb191v3);
+    pub const X9_62_C2ONB191V4: Nid = Nid(ffi::NID_X9_62_c2onb191v4);
+    pub const X9_62_C2ONB191V5: Nid = Nid(ffi::NID_X9_62_c2onb191v5);
+    pub const X9_62_C2PNB208W1: Nid = Nid(ffi::NID_X9_62_c2pnb208w1);
+    pub const X9_62_C2TNB239V1: Nid = Nid(ffi::NID_X9_62_c2tnb239v1);
+    pub const X9_62_C2TNB239V2: Nid = Nid(ffi::NID_X9_62_c2tnb239v2);
+    pub const X9_62_C2TNB239V3: Nid = Nid(ffi::NID_X9_62_c2tnb239v3);
+    pub const X9_62_C2ONB239V4: Nid = Nid(ffi::NID_X9_62_c2onb239v4);
+    pub const X9_62_C2ONB239V5: Nid = Nid(ffi::NID_X9_62_c2onb239v5);
+    pub const X9_62_C2PNB272W1: Nid = Nid(ffi::NID_X9_62_c2pnb272w1);
+    pub const X9_62_C2PNB304W1: Nid = Nid(ffi::NID_X9_62_c2pnb304w1);
+    pub const X9_62_C2TNB359V1: Nid = Nid(ffi::NID_X9_62_c2tnb359v1);
+    pub const X9_62_C2PNB368W1: Nid = Nid(ffi::NID_X9_62_c2pnb368w1);
+    pub const X9_62_C2TNB431R1: Nid = Nid(ffi::NID_X9_62_c2tnb431r1);
+    pub const X9_62_PRIME192V1: Nid = Nid(ffi::NID_X9_62_prime192v1);
+    pub const X9_62_PRIME192V2: Nid = Nid(ffi::NID_X9_62_prime192v2);
+    pub const X9_62_PRIME192V3: Nid = Nid(ffi::NID_X9_62_prime192v3);
+    pub const X9_62_PRIME239V1: Nid = Nid(ffi::NID_X9_62_prime239v1);
+    pub const X9_62_PRIME239V2: Nid = Nid(ffi::NID_X9_62_prime239v2);
+    pub const X9_62_PRIME239V3: Nid = Nid(ffi::NID_X9_62_prime239v3);
+    pub const X9_62_PRIME256V1: Nid = Nid(ffi::NID_X9_62_prime256v1);
+    pub const ECDSA_WITH_SHA1: Nid = Nid(ffi::NID_ecdsa_with_SHA1);
+    pub const ECDSA_WITH_RECOMMENDED: Nid = Nid(ffi::NID_ecdsa_with_Recommended);
+    pub const ECDSA_WITH_SPECIFIED: Nid = Nid(ffi::NID_ecdsa_with_Specified);
+    pub const ECDSA_WITH_SHA224: Nid = Nid(ffi::NID_ecdsa_with_SHA224);
+    pub const ECDSA_WITH_SHA256: Nid = Nid(ffi::NID_ecdsa_with_SHA256);
+    pub const ECDSA_WITH_SHA384: Nid = Nid(ffi::NID_ecdsa_with_SHA384);
+    pub const ECDSA_WITH_SHA512: Nid = Nid(ffi::NID_ecdsa_with_SHA512);
+    pub const SECP112R1: Nid = Nid(ffi::NID_secp112r1);
+    pub const SECP112R2: Nid = Nid(ffi::NID_secp112r2);
+    pub const SECP128R1: Nid = Nid(ffi::NID_secp128r1);
+    pub const SECP128R2: Nid = Nid(ffi::NID_secp128r2);
+    pub const SECP160K1: Nid = Nid(ffi::NID_secp160k1);
+    pub const SECP160R1: Nid = Nid(ffi::NID_secp160r1);
+    pub const SECP160R2: Nid = Nid(ffi::NID_secp160r2);
+    pub const SECP192K1: Nid = Nid(ffi::NID_secp192k1);
+    pub const SECP224K1: Nid = Nid(ffi::NID_secp224k1);
+    pub const SECP224R1: Nid = Nid(ffi::NID_secp224r1);
+    pub const SECP256K1: Nid = Nid(ffi::NID_secp256k1);
+    pub const SECP384R1: Nid = Nid(ffi::NID_secp384r1);
+    pub const SECP521R1: Nid = Nid(ffi::NID_secp521r1);
+    pub const SECT113R1: Nid = Nid(ffi::NID_sect113r1);
+    pub const SECT113R2: Nid = Nid(ffi::NID_sect113r2);
+    pub const SECT131R1: Nid = Nid(ffi::NID_sect131r1);
+    pub const SECT131R2: Nid = Nid(ffi::NID_sect131r2);
+    pub const SECT163K1: Nid = Nid(ffi::NID_sect163k1);
+    pub const SECT163R1: Nid = Nid(ffi::NID_sect163r1);
+    pub const SECT163R2: Nid = Nid(ffi::NID_sect163r2);
+    pub const SECT193R1: Nid = Nid(ffi::NID_sect193r1);
+    pub const SECT193R2: Nid = Nid(ffi::NID_sect193r2);
+    pub const SECT233K1: Nid = Nid(ffi::NID_sect233k1);
+    pub const SECT233R1: Nid = Nid(ffi::NID_sect233r1);
+    pub const SECT239K1: Nid = Nid(ffi::NID_sect239k1);
+    pub const SECT283K1: Nid = Nid(ffi::NID_sect283k1);
+    pub const SECT283R1: Nid = Nid(ffi::NID_sect283r1);
+    pub const SECT409K1: Nid = Nid(ffi::NID_sect409k1);
+    pub const SECT409R1: Nid = Nid(ffi::NID_sect409r1);
+    pub const SECT571K1: Nid = Nid(ffi::NID_sect571k1);
+    pub const SECT571R1: Nid = Nid(ffi::NID_sect571r1);
+    #[cfg(any(ossl110, libressl))]
+    pub const BRAINPOOL_P256R1: Nid = Nid(ffi::NID_brainpoolP256r1);
+    #[cfg(any(ossl110, libressl))]
+    pub const BRAINPOOL_P320R1: Nid = Nid(ffi::NID_brainpoolP320r1);
+    #[cfg(any(ossl110, libressl))]
+    pub const BRAINPOOL_P384R1: Nid = Nid(ffi::NID_brainpoolP384r1);
+    #[cfg(any(ossl110, libressl))]
+    pub const BRAINPOOL_P512R1: Nid = Nid(ffi::NID_brainpoolP512r1);
+    pub const WAP_WSG_IDM_ECID_WTLS1: Nid = Nid(ffi::NID_wap_wsg_idm_ecid_wtls1);
+    pub const WAP_WSG_IDM_ECID_WTLS3: Nid = Nid(ffi::NID_wap_wsg_idm_ecid_wtls3);
+    pub const WAP_WSG_IDM_ECID_WTLS4: Nid = Nid(ffi::NID_wap_wsg_idm_ecid_wtls4);
+    pub const WAP_WSG_IDM_ECID_WTLS5: Nid = Nid(ffi::NID_wap_wsg_idm_ecid_wtls5);
+    pub const WAP_WSG_IDM_ECID_WTLS6: Nid = Nid(ffi::NID_wap_wsg_idm_ecid_wtls6);
+    pub const WAP_WSG_IDM_ECID_WTLS7: Nid = Nid(ffi::NID_wap_wsg_idm_ecid_wtls7);
+    pub const WAP_WSG_IDM_ECID_WTLS8: Nid = Nid(ffi::NID_wap_wsg_idm_ecid_wtls8);
+    pub const WAP_WSG_IDM_ECID_WTLS9: Nid = Nid(ffi::NID_wap_wsg_idm_ecid_wtls9);
+    pub const WAP_WSG_IDM_ECID_WTLS10: Nid = Nid(ffi::NID_wap_wsg_idm_ecid_wtls10);
+    pub const WAP_WSG_IDM_ECID_WTLS11: Nid = Nid(ffi::NID_wap_wsg_idm_ecid_wtls11);
+    pub const WAP_WSG_IDM_ECID_WTLS12: Nid = Nid(ffi::NID_wap_wsg_idm_ecid_wtls12);
+    pub const CAST5_CBC: Nid = Nid(ffi::NID_cast5_cbc);
+    pub const CAST5_ECB: Nid = Nid(ffi::NID_cast5_ecb);
+    pub const CAST5_CFB64: Nid = Nid(ffi::NID_cast5_cfb64);
+    pub const CAST5_OFB64: Nid = Nid(ffi::NID_cast5_ofb64);
+    pub const PBEWITHMD5ANDCAST5_CBC: Nid = Nid(ffi::NID_pbeWithMD5AndCast5_CBC);
+    pub const ID_PASSWORDBASEDMAC: Nid = Nid(ffi::NID_id_PasswordBasedMAC);
+    pub const ID_DHBASEDMAC: Nid = Nid(ffi::NID_id_DHBasedMac);
+    pub const RSADSI: Nid = Nid(ffi::NID_rsadsi);
+    pub const PKCS: Nid = Nid(ffi::NID_pkcs);
+    pub const PKCS1: Nid = Nid(ffi::NID_pkcs1);
+    pub const RSAENCRYPTION: Nid = Nid(ffi::NID_rsaEncryption);
+    pub const MD2WITHRSAENCRYPTION: Nid = Nid(ffi::NID_md2WithRSAEncryption);
+    pub const MD4WITHRSAENCRYPTION: Nid = Nid(ffi::NID_md4WithRSAEncryption);
+    pub const MD5WITHRSAENCRYPTION: Nid = Nid(ffi::NID_md5WithRSAEncryption);
+    pub const SHA1WITHRSAENCRYPTION: Nid = Nid(ffi::NID_sha1WithRSAEncryption);
+    pub const RSAESOAEP: Nid = Nid(ffi::NID_rsaesOaep);
+    pub const MGF1: Nid = Nid(ffi::NID_mgf1);
+    pub const RSASSAPSS: Nid = Nid(ffi::NID_rsassaPss);
+    pub const SHA256WITHRSAENCRYPTION: Nid = Nid(ffi::NID_sha256WithRSAEncryption);
+    pub const SHA384WITHRSAENCRYPTION: Nid = Nid(ffi::NID_sha384WithRSAEncryption);
+    pub const SHA512WITHRSAENCRYPTION: Nid = Nid(ffi::NID_sha512WithRSAEncryption);
+    pub const SHA224WITHRSAENCRYPTION: Nid = Nid(ffi::NID_sha224WithRSAEncryption);
+    pub const PKCS3: Nid = Nid(ffi::NID_pkcs3);
+    pub const DHKEYAGREEMENT: Nid = Nid(ffi::NID_dhKeyAgreement);
+    pub const PKCS5: Nid = Nid(ffi::NID_pkcs5);
+    pub const PBEWITHMD2ANDDES_CBC: Nid = Nid(ffi::NID_pbeWithMD2AndDES_CBC);
+    pub const PBEWITHMD5ANDDES_CBC: Nid = Nid(ffi::NID_pbeWithMD5AndDES_CBC);
+    pub const PBEWITHMD2ANDRC2_CBC: Nid = Nid(ffi::NID_pbeWithMD2AndRC2_CBC);
+    pub const PBEWITHMD5ANDRC2_CBC: Nid = Nid(ffi::NID_pbeWithMD5AndRC2_CBC);
+    pub const PBEWITHSHA1ANDDES_CBC: Nid = Nid(ffi::NID_pbeWithSHA1AndDES_CBC);
+    pub const PBEWITHSHA1ANDRC2_CBC: Nid = Nid(ffi::NID_pbeWithSHA1AndRC2_CBC);
+    pub const ID_PBKDF2: Nid = Nid(ffi::NID_id_pbkdf2);
+    pub const PBES2: Nid = Nid(ffi::NID_pbes2);
+    pub const PBMAC1: Nid = Nid(ffi::NID_pbmac1);
+    pub const PKCS7: Nid = Nid(ffi::NID_pkcs7);
+    pub const PKCS7_DATA: Nid = Nid(ffi::NID_pkcs7_data);
+    pub const PKCS7_SIGNED: Nid = Nid(ffi::NID_pkcs7_signed);
+    pub const PKCS7_ENVELOPED: Nid = Nid(ffi::NID_pkcs7_enveloped);
+    pub const PKCS7_SIGNEDANDENVELOPED: Nid = Nid(ffi::NID_pkcs7_signedAndEnveloped);
+    pub const PKCS7_DIGEST: Nid = Nid(ffi::NID_pkcs7_digest);
+    pub const PKCS7_ENCRYPTED: Nid = Nid(ffi::NID_pkcs7_encrypted);
+    pub const PKCS9: Nid = Nid(ffi::NID_pkcs9);
+    pub const PKCS9_EMAILADDRESS: Nid = Nid(ffi::NID_pkcs9_emailAddress);
+    pub const PKCS9_UNSTRUCTUREDNAME: Nid = Nid(ffi::NID_pkcs9_unstructuredName);
+    pub const PKCS9_CONTENTTYPE: Nid = Nid(ffi::NID_pkcs9_contentType);
+    pub const PKCS9_MESSAGEDIGEST: Nid = Nid(ffi::NID_pkcs9_messageDigest);
+    pub const PKCS9_SIGNINGTIME: Nid = Nid(ffi::NID_pkcs9_signingTime);
+    pub const PKCS9_COUNTERSIGNATURE: Nid = Nid(ffi::NID_pkcs9_countersignature);
+    pub const PKCS9_CHALLENGEPASSWORD: Nid = Nid(ffi::NID_pkcs9_challengePassword);
+    pub const PKCS9_UNSTRUCTUREDADDRESS: Nid = Nid(ffi::NID_pkcs9_unstructuredAddress);
+    pub const PKCS9_EXTCERTATTRIBUTES: Nid = Nid(ffi::NID_pkcs9_extCertAttributes);
+    pub const EXT_REQ: Nid = Nid(ffi::NID_ext_req);
+    pub const SMIMECAPABILITIES: Nid = Nid(ffi::NID_SMIMECapabilities);
+    pub const SMIME: Nid = Nid(ffi::NID_SMIME);
+    pub const ID_SMIME_MOD: Nid = Nid(ffi::NID_id_smime_mod);
+    pub const ID_SMIME_CT: Nid = Nid(ffi::NID_id_smime_ct);
+    pub const ID_SMIME_AA: Nid = Nid(ffi::NID_id_smime_aa);
+    pub const ID_SMIME_ALG: Nid = Nid(ffi::NID_id_smime_alg);
+    pub const ID_SMIME_CD: Nid = Nid(ffi::NID_id_smime_cd);
+    pub const ID_SMIME_SPQ: Nid = Nid(ffi::NID_id_smime_spq);
+    pub const ID_SMIME_CTI: Nid = Nid(ffi::NID_id_smime_cti);
+    pub const ID_SMIME_MOD_CMS: Nid = Nid(ffi::NID_id_smime_mod_cms);
+    pub const ID_SMIME_MOD_ESS: Nid = Nid(ffi::NID_id_smime_mod_ess);
+    pub const ID_SMIME_MOD_OID: Nid = Nid(ffi::NID_id_smime_mod_oid);
+    pub const ID_SMIME_MOD_MSG_V3: Nid = Nid(ffi::NID_id_smime_mod_msg_v3);
+    pub const ID_SMIME_MOD_ETS_ESIGNATURE_88: Nid = Nid(ffi::NID_id_smime_mod_ets_eSignature_88);
+    pub const ID_SMIME_MOD_ETS_ESIGNATURE_97: Nid = Nid(ffi::NID_id_smime_mod_ets_eSignature_97);
+    pub const ID_SMIME_MOD_ETS_ESIGPOLICY_88: Nid = Nid(ffi::NID_id_smime_mod_ets_eSigPolicy_88);
+    pub const ID_SMIME_MOD_ETS_ESIGPOLICY_97: Nid = Nid(ffi::NID_id_smime_mod_ets_eSigPolicy_97);
+    pub const ID_SMIME_CT_RECEIPT: Nid = Nid(ffi::NID_id_smime_ct_receipt);
+    pub const ID_SMIME_CT_AUTHDATA: Nid = Nid(ffi::NID_id_smime_ct_authData);
+    pub const ID_SMIME_CT_PUBLISHCERT: Nid = Nid(ffi::NID_id_smime_ct_publishCert);
+    pub const ID_SMIME_CT_TSTINFO: Nid = Nid(ffi::NID_id_smime_ct_TSTInfo);
+    pub const ID_SMIME_CT_TDTINFO: Nid = Nid(ffi::NID_id_smime_ct_TDTInfo);
+    pub const ID_SMIME_CT_CONTENTINFO: Nid = Nid(ffi::NID_id_smime_ct_contentInfo);
+    pub const ID_SMIME_CT_DVCSREQUESTDATA: Nid = Nid(ffi::NID_id_smime_ct_DVCSRequestData);
+    pub const ID_SMIME_CT_DVCSRESPONSEDATA: Nid = Nid(ffi::NID_id_smime_ct_DVCSResponseData);
+    pub const ID_SMIME_CT_COMPRESSEDDATA: Nid = Nid(ffi::NID_id_smime_ct_compressedData);
+    pub const ID_CT_ASCIITEXTWITHCRLF: Nid = Nid(ffi::NID_id_ct_asciiTextWithCRLF);
+    pub const ID_SMIME_AA_RECEIPTREQUEST: Nid = Nid(ffi::NID_id_smime_aa_receiptRequest);
+    pub const ID_SMIME_AA_SECURITYLABEL: Nid = Nid(ffi::NID_id_smime_aa_securityLabel);
+    pub const ID_SMIME_AA_MLEXPANDHISTORY: Nid = Nid(ffi::NID_id_smime_aa_mlExpandHistory);
+    pub const ID_SMIME_AA_CONTENTHINT: Nid = Nid(ffi::NID_id_smime_aa_contentHint);
+    pub const ID_SMIME_AA_MSGSIGDIGEST: Nid = Nid(ffi::NID_id_smime_aa_msgSigDigest);
+    pub const ID_SMIME_AA_ENCAPCONTENTTYPE: Nid = Nid(ffi::NID_id_smime_aa_encapContentType);
+    pub const ID_SMIME_AA_CONTENTIDENTIFIER: Nid = Nid(ffi::NID_id_smime_aa_contentIdentifier);
+    pub const ID_SMIME_AA_MACVALUE: Nid = Nid(ffi::NID_id_smime_aa_macValue);
+    pub const ID_SMIME_AA_EQUIVALENTLABELS: Nid = Nid(ffi::NID_id_smime_aa_equivalentLabels);
+    pub const ID_SMIME_AA_CONTENTREFERENCE: Nid = Nid(ffi::NID_id_smime_aa_contentReference);
+    pub const ID_SMIME_AA_ENCRYPKEYPREF: Nid = Nid(ffi::NID_id_smime_aa_encrypKeyPref);
+    pub const ID_SMIME_AA_SIGNINGCERTIFICATE: Nid = Nid(ffi::NID_id_smime_aa_signingCertificate);
+    pub const ID_SMIME_AA_SMIMEENCRYPTCERTS: Nid = Nid(ffi::NID_id_smime_aa_smimeEncryptCerts);
+    pub const ID_SMIME_AA_TIMESTAMPTOKEN: Nid = Nid(ffi::NID_id_smime_aa_timeStampToken);
+    pub const ID_SMIME_AA_ETS_SIGPOLICYID: Nid = Nid(ffi::NID_id_smime_aa_ets_sigPolicyId);
+    pub const ID_SMIME_AA_ETS_COMMITMENTTYPE: Nid = Nid(ffi::NID_id_smime_aa_ets_commitmentType);
+    pub const ID_SMIME_AA_ETS_SIGNERLOCATION: Nid = Nid(ffi::NID_id_smime_aa_ets_signerLocation);
+    pub const ID_SMIME_AA_ETS_SIGNERATTR: Nid = Nid(ffi::NID_id_smime_aa_ets_signerAttr);
+    pub const ID_SMIME_AA_ETS_OTHERSIGCERT: Nid = Nid(ffi::NID_id_smime_aa_ets_otherSigCert);
+    pub const ID_SMIME_AA_ETS_CONTENTTIMESTAMP: Nid =
+        Nid(ffi::NID_id_smime_aa_ets_contentTimestamp);
+    pub const ID_SMIME_AA_ETS_CERTIFICATEREFS: Nid = Nid(ffi::NID_id_smime_aa_ets_CertificateRefs);
+    pub const ID_SMIME_AA_ETS_REVOCATIONREFS: Nid = Nid(ffi::NID_id_smime_aa_ets_RevocationRefs);
+    pub const ID_SMIME_AA_ETS_CERTVALUES: Nid = Nid(ffi::NID_id_smime_aa_ets_certValues);
+    pub const ID_SMIME_AA_ETS_REVOCATIONVALUES: Nid =
+        Nid(ffi::NID_id_smime_aa_ets_revocationValues);
+    pub const ID_SMIME_AA_ETS_ESCTIMESTAMP: Nid = Nid(ffi::NID_id_smime_aa_ets_escTimeStamp);
+    pub const ID_SMIME_AA_ETS_CERTCRLTIMESTAMP: Nid =
+        Nid(ffi::NID_id_smime_aa_ets_certCRLTimestamp);
+    pub const ID_SMIME_AA_ETS_ARCHIVETIMESTAMP: Nid =
+        Nid(ffi::NID_id_smime_aa_ets_archiveTimeStamp);
+    pub const ID_SMIME_AA_SIGNATURETYPE: Nid = Nid(ffi::NID_id_smime_aa_signatureType);
+    pub const ID_SMIME_AA_DVCS_DVC: Nid = Nid(ffi::NID_id_smime_aa_dvcs_dvc);
+    pub const ID_SMIME_ALG_ESDHWITH3DES: Nid = Nid(ffi::NID_id_smime_alg_ESDHwith3DES);
+    pub const ID_SMIME_ALG_ESDHWITHRC2: Nid = Nid(ffi::NID_id_smime_alg_ESDHwithRC2);
+    pub const ID_SMIME_ALG_3DESWRAP: Nid = Nid(ffi::NID_id_smime_alg_3DESwrap);
+    pub const ID_SMIME_ALG_RC2WRAP: Nid = Nid(ffi::NID_id_smime_alg_RC2wrap);
+    pub const ID_SMIME_ALG_ESDH: Nid = Nid(ffi::NID_id_smime_alg_ESDH);
+    pub const ID_SMIME_ALG_CMS3DESWRAP: Nid = Nid(ffi::NID_id_smime_alg_CMS3DESwrap);
+    pub const ID_SMIME_ALG_CMSRC2WRAP: Nid = Nid(ffi::NID_id_smime_alg_CMSRC2wrap);
+    pub const ID_ALG_PWRI_KEK: Nid = Nid(ffi::NID_id_alg_PWRI_KEK);
+    pub const ID_SMIME_CD_LDAP: Nid = Nid(ffi::NID_id_smime_cd_ldap);
+    pub const ID_SMIME_SPQ_ETS_SQT_URI: Nid = Nid(ffi::NID_id_smime_spq_ets_sqt_uri);
+    pub const ID_SMIME_SPQ_ETS_SQT_UNOTICE: Nid = Nid(ffi::NID_id_smime_spq_ets_sqt_unotice);
+    pub const ID_SMIME_CTI_ETS_PROOFOFORIGIN: Nid = Nid(ffi::NID_id_smime_cti_ets_proofOfOrigin);
+    pub const ID_SMIME_CTI_ETS_PROOFOFRECEIPT: Nid = Nid(ffi::NID_id_smime_cti_ets_proofOfReceipt);
+    pub const ID_SMIME_CTI_ETS_PROOFOFDELIVERY: Nid =
+        Nid(ffi::NID_id_smime_cti_ets_proofOfDelivery);
+    pub const ID_SMIME_CTI_ETS_PROOFOFSENDER: Nid = Nid(ffi::NID_id_smime_cti_ets_proofOfSender);
+    pub const ID_SMIME_CTI_ETS_PROOFOFAPPROVAL: Nid =
+        Nid(ffi::NID_id_smime_cti_ets_proofOfApproval);
+    pub const ID_SMIME_CTI_ETS_PROOFOFCREATION: Nid =
+        Nid(ffi::NID_id_smime_cti_ets_proofOfCreation);
+    pub const FRIENDLYNAME: Nid = Nid(ffi::NID_friendlyName);
+    pub const LOCALKEYID: Nid = Nid(ffi::NID_localKeyID);
+    pub const MS_CSP_NAME: Nid = Nid(ffi::NID_ms_csp_name);
+    pub const LOCALKEYSET: Nid = Nid(ffi::NID_LocalKeySet);
+    pub const X509CERTIFICATE: Nid = Nid(ffi::NID_x509Certificate);
+    pub const SDSICERTIFICATE: Nid = Nid(ffi::NID_sdsiCertificate);
+    pub const X509CRL: Nid = Nid(ffi::NID_x509Crl);
+    pub const PBE_WITHSHA1AND128BITRC4: Nid = Nid(ffi::NID_pbe_WithSHA1And128BitRC4);
+    pub const PBE_WITHSHA1AND40BITRC4: Nid = Nid(ffi::NID_pbe_WithSHA1And40BitRC4);
+    pub const PBE_WITHSHA1AND3_KEY_TRIPLEDES_CBC: Nid =
+        Nid(ffi::NID_pbe_WithSHA1And3_Key_TripleDES_CBC);
+    pub const PBE_WITHSHA1AND2_KEY_TRIPLEDES_CBC: Nid =
+        Nid(ffi::NID_pbe_WithSHA1And2_Key_TripleDES_CBC);
+    pub const PBE_WITHSHA1AND128BITRC2_CBC: Nid = Nid(ffi::NID_pbe_WithSHA1And128BitRC2_CBC);
+    pub const PBE_WITHSHA1AND40BITRC2_CBC: Nid = Nid(ffi::NID_pbe_WithSHA1And40BitRC2_CBC);
+    pub const KEYBAG: Nid = Nid(ffi::NID_keyBag);
+    pub const PKCS8SHROUDEDKEYBAG: Nid = Nid(ffi::NID_pkcs8ShroudedKeyBag);
+    pub const CERTBAG: Nid = Nid(ffi::NID_certBag);
+    pub const CRLBAG: Nid = Nid(ffi::NID_crlBag);
+    pub const SECRETBAG: Nid = Nid(ffi::NID_secretBag);
+    pub const SAFECONTENTSBAG: Nid = Nid(ffi::NID_safeContentsBag);
+    pub const MD2: Nid = Nid(ffi::NID_md2);
+    pub const MD4: Nid = Nid(ffi::NID_md4);
+    pub const MD5: Nid = Nid(ffi::NID_md5);
+    pub const MD5_SHA1: Nid = Nid(ffi::NID_md5_sha1);
+    pub const HMACWITHMD5: Nid = Nid(ffi::NID_hmacWithMD5);
+    pub const HMACWITHSHA1: Nid = Nid(ffi::NID_hmacWithSHA1);
+    pub const HMACWITHSHA224: Nid = Nid(ffi::NID_hmacWithSHA224);
+    pub const HMACWITHSHA256: Nid = Nid(ffi::NID_hmacWithSHA256);
+    pub const HMACWITHSHA384: Nid = Nid(ffi::NID_hmacWithSHA384);
+    pub const HMACWITHSHA512: Nid = Nid(ffi::NID_hmacWithSHA512);
+    pub const RC2_CBC: Nid = Nid(ffi::NID_rc2_cbc);
+    pub const RC2_ECB: Nid = Nid(ffi::NID_rc2_ecb);
+    pub const RC2_CFB64: Nid = Nid(ffi::NID_rc2_cfb64);
+    pub const RC2_OFB64: Nid = Nid(ffi::NID_rc2_ofb64);
+    pub const RC2_40_CBC: Nid = Nid(ffi::NID_rc2_40_cbc);
+    pub const RC2_64_CBC: Nid = Nid(ffi::NID_rc2_64_cbc);
+    pub const RC4: Nid = Nid(ffi::NID_rc4);
+    pub const RC4_40: Nid = Nid(ffi::NID_rc4_40);
+    pub const DES_EDE3_CBC: Nid = Nid(ffi::NID_des_ede3_cbc);
+    pub const RC5_CBC: Nid = Nid(ffi::NID_rc5_cbc);
+    pub const RC5_ECB: Nid = Nid(ffi::NID_rc5_ecb);
+    pub const RC5_CFB64: Nid = Nid(ffi::NID_rc5_cfb64);
+    pub const RC5_OFB64: Nid = Nid(ffi::NID_rc5_ofb64);
+    pub const MS_EXT_REQ: Nid = Nid(ffi::NID_ms_ext_req);
+    pub const MS_CODE_IND: Nid = Nid(ffi::NID_ms_code_ind);
+    pub const MS_CODE_COM: Nid = Nid(ffi::NID_ms_code_com);
+    pub const MS_CTL_SIGN: Nid = Nid(ffi::NID_ms_ctl_sign);
+    pub const MS_SGC: Nid = Nid(ffi::NID_ms_sgc);
+    pub const MS_EFS: Nid = Nid(ffi::NID_ms_efs);
+    pub const MS_SMARTCARD_LOGIN: Nid = Nid(ffi::NID_ms_smartcard_login);
+    pub const MS_UPN: Nid = Nid(ffi::NID_ms_upn);
+    pub const IDEA_CBC: Nid = Nid(ffi::NID_idea_cbc);
+    pub const IDEA_ECB: Nid = Nid(ffi::NID_idea_ecb);
+    pub const IDEA_CFB64: Nid = Nid(ffi::NID_idea_cfb64);
+    pub const IDEA_OFB64: Nid = Nid(ffi::NID_idea_ofb64);
+    pub const BF_CBC: Nid = Nid(ffi::NID_bf_cbc);
+    pub const BF_ECB: Nid = Nid(ffi::NID_bf_ecb);
+    pub const BF_CFB64: Nid = Nid(ffi::NID_bf_cfb64);
+    pub const BF_OFB64: Nid = Nid(ffi::NID_bf_ofb64);
+    pub const ID_PKIX: Nid = Nid(ffi::NID_id_pkix);
+    pub const ID_PKIX_MOD: Nid = Nid(ffi::NID_id_pkix_mod);
+    pub const ID_PE: Nid = Nid(ffi::NID_id_pe);
+    pub const ID_QT: Nid = Nid(ffi::NID_id_qt);
+    pub const ID_KP: Nid = Nid(ffi::NID_id_kp);
+    pub const ID_IT: Nid = Nid(ffi::NID_id_it);
+    pub const ID_PKIP: Nid = Nid(ffi::NID_id_pkip);
+    pub const ID_ALG: Nid = Nid(ffi::NID_id_alg);
+    pub const ID_CMC: Nid = Nid(ffi::NID_id_cmc);
+    pub const ID_ON: Nid = Nid(ffi::NID_id_on);
+    pub const ID_PDA: Nid = Nid(ffi::NID_id_pda);
+    pub const ID_ACA: Nid = Nid(ffi::NID_id_aca);
+    pub const ID_QCS: Nid = Nid(ffi::NID_id_qcs);
+    pub const ID_CCT: Nid = Nid(ffi::NID_id_cct);
+    pub const ID_PPL: Nid = Nid(ffi::NID_id_ppl);
+    pub const ID_AD: Nid = Nid(ffi::NID_id_ad);
+    pub const ID_PKIX1_EXPLICIT_88: Nid = Nid(ffi::NID_id_pkix1_explicit_88);
+    pub const ID_PKIX1_IMPLICIT_88: Nid = Nid(ffi::NID_id_pkix1_implicit_88);
+    pub const ID_PKIX1_EXPLICIT_93: Nid = Nid(ffi::NID_id_pkix1_explicit_93);
+    pub const ID_PKIX1_IMPLICIT_93: Nid = Nid(ffi::NID_id_pkix1_implicit_93);
+    pub const ID_MOD_CRMF: Nid = Nid(ffi::NID_id_mod_crmf);
+    pub const ID_MOD_CMC: Nid = Nid(ffi::NID_id_mod_cmc);
+    pub const ID_MOD_KEA_PROFILE_88: Nid = Nid(ffi::NID_id_mod_kea_profile_88);
+    pub const ID_MOD_KEA_PROFILE_93: Nid = Nid(ffi::NID_id_mod_kea_profile_93);
+    pub const ID_MOD_CMP: Nid = Nid(ffi::NID_id_mod_cmp);
+    pub const ID_MOD_QUALIFIED_CERT_88: Nid = Nid(ffi::NID_id_mod_qualified_cert_88);
+    pub const ID_MOD_QUALIFIED_CERT_93: Nid = Nid(ffi::NID_id_mod_qualified_cert_93);
+    pub const ID_MOD_ATTRIBUTE_CERT: Nid = Nid(ffi::NID_id_mod_attribute_cert);
+    pub const ID_MOD_TIMESTAMP_PROTOCOL: Nid = Nid(ffi::NID_id_mod_timestamp_protocol);
+    pub const ID_MOD_OCSP: Nid = Nid(ffi::NID_id_mod_ocsp);
+    pub const ID_MOD_DVCS: Nid = Nid(ffi::NID_id_mod_dvcs);
+    pub const ID_MOD_CMP2000: Nid = Nid(ffi::NID_id_mod_cmp2000);
+    pub const INFO_ACCESS: Nid = Nid(ffi::NID_info_access);
+    pub const BIOMETRICINFO: Nid = Nid(ffi::NID_biometricInfo);
+    pub const QCSTATEMENTS: Nid = Nid(ffi::NID_qcStatements);
+    pub const AC_AUDITENTITY: Nid = Nid(ffi::NID_ac_auditEntity);
+    pub const AC_TARGETING: Nid = Nid(ffi::NID_ac_targeting);
+    pub const AACONTROLS: Nid = Nid(ffi::NID_aaControls);
+    pub const SBGP_IPADDRBLOCK: Nid = Nid(ffi::NID_sbgp_ipAddrBlock);
+    pub const SBGP_AUTONOMOUSSYSNUM: Nid = Nid(ffi::NID_sbgp_autonomousSysNum);
+    pub const SBGP_ROUTERIDENTIFIER: Nid = Nid(ffi::NID_sbgp_routerIdentifier);
+    pub const AC_PROXYING: Nid = Nid(ffi::NID_ac_proxying);
+    pub const SINFO_ACCESS: Nid = Nid(ffi::NID_sinfo_access);
+    pub const PROXYCERTINFO: Nid = Nid(ffi::NID_proxyCertInfo);
+    pub const ID_QT_CPS: Nid = Nid(ffi::NID_id_qt_cps);
+    pub const ID_QT_UNOTICE: Nid = Nid(ffi::NID_id_qt_unotice);
+    pub const TEXTNOTICE: Nid = Nid(ffi::NID_textNotice);
+    pub const SERVER_AUTH: Nid = Nid(ffi::NID_server_auth);
+    pub const CLIENT_AUTH: Nid = Nid(ffi::NID_client_auth);
+    pub const CODE_SIGN: Nid = Nid(ffi::NID_code_sign);
+    pub const EMAIL_PROTECT: Nid = Nid(ffi::NID_email_protect);
+    pub const IPSECENDSYSTEM: Nid = Nid(ffi::NID_ipsecEndSystem);
+    pub const IPSECTUNNEL: Nid = Nid(ffi::NID_ipsecTunnel);
+    pub const IPSECUSER: Nid = Nid(ffi::NID_ipsecUser);
+    pub const TIME_STAMP: Nid = Nid(ffi::NID_time_stamp);
+    pub const OCSP_SIGN: Nid = Nid(ffi::NID_OCSP_sign);
+    pub const DVCS: Nid = Nid(ffi::NID_dvcs);
+    pub const ID_IT_CAPROTENCCERT: Nid = Nid(ffi::NID_id_it_caProtEncCert);
+    pub const ID_IT_SIGNKEYPAIRTYPES: Nid = Nid(ffi::NID_id_it_signKeyPairTypes);
+    pub const ID_IT_ENCKEYPAIRTYPES: Nid = Nid(ffi::NID_id_it_encKeyPairTypes);
+    pub const ID_IT_PREFERREDSYMMALG: Nid = Nid(ffi::NID_id_it_preferredSymmAlg);
+    pub const ID_IT_CAKEYUPDATEINFO: Nid = Nid(ffi::NID_id_it_caKeyUpdateInfo);
+    pub const ID_IT_CURRENTCRL: Nid = Nid(ffi::NID_id_it_currentCRL);
+    pub const ID_IT_UNSUPPORTEDOIDS: Nid = Nid(ffi::NID_id_it_unsupportedOIDs);
+    pub const ID_IT_SUBSCRIPTIONREQUEST: Nid = Nid(ffi::NID_id_it_subscriptionRequest);
+    pub const ID_IT_SUBSCRIPTIONRESPONSE: Nid = Nid(ffi::NID_id_it_subscriptionResponse);
+    pub const ID_IT_KEYPAIRPARAMREQ: Nid = Nid(ffi::NID_id_it_keyPairParamReq);
+    pub const ID_IT_KEYPAIRPARAMREP: Nid = Nid(ffi::NID_id_it_keyPairParamRep);
+    pub const ID_IT_REVPASSPHRASE: Nid = Nid(ffi::NID_id_it_revPassphrase);
+    pub const ID_IT_IMPLICITCONFIRM: Nid = Nid(ffi::NID_id_it_implicitConfirm);
+    pub const ID_IT_CONFIRMWAITTIME: Nid = Nid(ffi::NID_id_it_confirmWaitTime);
+    pub const ID_IT_ORIGPKIMESSAGE: Nid = Nid(ffi::NID_id_it_origPKIMessage);
+    pub const ID_IT_SUPPLANGTAGS: Nid = Nid(ffi::NID_id_it_suppLangTags);
+    pub const ID_REGCTRL: Nid = Nid(ffi::NID_id_regCtrl);
+    pub const ID_REGINFO: Nid = Nid(ffi::NID_id_regInfo);
+    pub const ID_REGCTRL_REGTOKEN: Nid = Nid(ffi::NID_id_regCtrl_regToken);
+    pub const ID_REGCTRL_AUTHENTICATOR: Nid = Nid(ffi::NID_id_regCtrl_authenticator);
+    pub const ID_REGCTRL_PKIPUBLICATIONINFO: Nid = Nid(ffi::NID_id_regCtrl_pkiPublicationInfo);
+    pub const ID_REGCTRL_PKIARCHIVEOPTIONS: Nid = Nid(ffi::NID_id_regCtrl_pkiArchiveOptions);
+    pub const ID_REGCTRL_OLDCERTID: Nid = Nid(ffi::NID_id_regCtrl_oldCertID);
+    pub const ID_REGCTRL_PROTOCOLENCRKEY: Nid = Nid(ffi::NID_id_regCtrl_protocolEncrKey);
+    pub const ID_REGINFO_UTF8PAIRS: Nid = Nid(ffi::NID_id_regInfo_utf8Pairs);
+    pub const ID_REGINFO_CERTREQ: Nid = Nid(ffi::NID_id_regInfo_certReq);
+    pub const ID_ALG_DES40: Nid = Nid(ffi::NID_id_alg_des40);
+    pub const ID_ALG_NOSIGNATURE: Nid = Nid(ffi::NID_id_alg_noSignature);
+    pub const ID_ALG_DH_SIG_HMAC_SHA1: Nid = Nid(ffi::NID_id_alg_dh_sig_hmac_sha1);
+    pub const ID_ALG_DH_POP: Nid = Nid(ffi::NID_id_alg_dh_pop);
+    pub const ID_CMC_STATUSINFO: Nid = Nid(ffi::NID_id_cmc_statusInfo);
+    pub const ID_CMC_IDENTIFICATION: Nid = Nid(ffi::NID_id_cmc_identification);
+    pub const ID_CMC_IDENTITYPROOF: Nid = Nid(ffi::NID_id_cmc_identityProof);
+    pub const ID_CMC_DATARETURN: Nid = Nid(ffi::NID_id_cmc_dataReturn);
+    pub const ID_CMC_TRANSACTIONID: Nid = Nid(ffi::NID_id_cmc_transactionId);
+    pub const ID_CMC_SENDERNONCE: Nid = Nid(ffi::NID_id_cmc_senderNonce);
+    pub const ID_CMC_RECIPIENTNONCE: Nid = Nid(ffi::NID_id_cmc_recipientNonce);
+    pub const ID_CMC_ADDEXTENSIONS: Nid = Nid(ffi::NID_id_cmc_addExtensions);
+    pub const ID_CMC_ENCRYPTEDPOP: Nid = Nid(ffi::NID_id_cmc_encryptedPOP);
+    pub const ID_CMC_DECRYPTEDPOP: Nid = Nid(ffi::NID_id_cmc_decryptedPOP);
+    pub const ID_CMC_LRAPOPWITNESS: Nid = Nid(ffi::NID_id_cmc_lraPOPWitness);
+    pub const ID_CMC_GETCERT: Nid = Nid(ffi::NID_id_cmc_getCert);
+    pub const ID_CMC_GETCRL: Nid = Nid(ffi::NID_id_cmc_getCRL);
+    pub const ID_CMC_REVOKEREQUEST: Nid = Nid(ffi::NID_id_cmc_revokeRequest);
+    pub const ID_CMC_REGINFO: Nid = Nid(ffi::NID_id_cmc_regInfo);
+    pub const ID_CMC_RESPONSEINFO: Nid = Nid(ffi::NID_id_cmc_responseInfo);
+    pub const ID_CMC_QUERYPENDING: Nid = Nid(ffi::NID_id_cmc_queryPending);
+    pub const ID_CMC_POPLINKRANDOM: Nid = Nid(ffi::NID_id_cmc_popLinkRandom);
+    pub const ID_CMC_POPLINKWITNESS: Nid = Nid(ffi::NID_id_cmc_popLinkWitness);
+    pub const ID_CMC_CONFIRMCERTACCEPTANCE: Nid = Nid(ffi::NID_id_cmc_confirmCertAcceptance);
+    pub const ID_ON_PERSONALDATA: Nid = Nid(ffi::NID_id_on_personalData);
+    pub const ID_ON_PERMANENTIDENTIFIER: Nid = Nid(ffi::NID_id_on_permanentIdentifier);
+    pub const ID_PDA_DATEOFBIRTH: Nid = Nid(ffi::NID_id_pda_dateOfBirth);
+    pub const ID_PDA_PLACEOFBIRTH: Nid = Nid(ffi::NID_id_pda_placeOfBirth);
+    pub const ID_PDA_GENDER: Nid = Nid(ffi::NID_id_pda_gender);
+    pub const ID_PDA_COUNTRYOFCITIZENSHIP: Nid = Nid(ffi::NID_id_pda_countryOfCitizenship);
+    pub const ID_PDA_COUNTRYOFRESIDENCE: Nid = Nid(ffi::NID_id_pda_countryOfResidence);
+    pub const ID_ACA_AUTHENTICATIONINFO: Nid = Nid(ffi::NID_id_aca_authenticationInfo);
+    pub const ID_ACA_ACCESSIDENTITY: Nid = Nid(ffi::NID_id_aca_accessIdentity);
+    pub const ID_ACA_CHARGINGIDENTITY: Nid = Nid(ffi::NID_id_aca_chargingIdentity);
+    pub const ID_ACA_GROUP: Nid = Nid(ffi::NID_id_aca_group);
+    pub const ID_ACA_ROLE: Nid = Nid(ffi::NID_id_aca_role);
+    pub const ID_ACA_ENCATTRS: Nid = Nid(ffi::NID_id_aca_encAttrs);
+    pub const ID_QCS_PKIXQCSYNTAX_V1: Nid = Nid(ffi::NID_id_qcs_pkixQCSyntax_v1);
+    pub const ID_CCT_CRS: Nid = Nid(ffi::NID_id_cct_crs);
+    pub const ID_CCT_PKIDATA: Nid = Nid(ffi::NID_id_cct_PKIData);
+    pub const ID_CCT_PKIRESPONSE: Nid = Nid(ffi::NID_id_cct_PKIResponse);
+    pub const ID_PPL_ANYLANGUAGE: Nid = Nid(ffi::NID_id_ppl_anyLanguage);
+    pub const ID_PPL_INHERITALL: Nid = Nid(ffi::NID_id_ppl_inheritAll);
+    pub const INDEPENDENT: Nid = Nid(ffi::NID_Independent);
+    pub const AD_OCSP: Nid = Nid(ffi::NID_ad_OCSP);
+    pub const AD_CA_ISSUERS: Nid = Nid(ffi::NID_ad_ca_issuers);
+    pub const AD_TIMESTAMPING: Nid = Nid(ffi::NID_ad_timeStamping);
+    pub const AD_DVCS: Nid = Nid(ffi::NID_ad_dvcs);
+    pub const CAREPOSITORY: Nid = Nid(ffi::NID_caRepository);
+    pub const ID_PKIX_OCSP_BASIC: Nid = Nid(ffi::NID_id_pkix_OCSP_basic);
+    pub const ID_PKIX_OCSP_NONCE: Nid = Nid(ffi::NID_id_pkix_OCSP_Nonce);
+    pub const ID_PKIX_OCSP_CRLID: Nid = Nid(ffi::NID_id_pkix_OCSP_CrlID);
+    pub const ID_PKIX_OCSP_ACCEPTABLERESPONSES: Nid =
+        Nid(ffi::NID_id_pkix_OCSP_acceptableResponses);
+    pub const ID_PKIX_OCSP_NOCHECK: Nid = Nid(ffi::NID_id_pkix_OCSP_noCheck);
+    pub const ID_PKIX_OCSP_ARCHIVECUTOFF: Nid = Nid(ffi::NID_id_pkix_OCSP_archiveCutoff);
+    pub const ID_PKIX_OCSP_SERVICELOCATOR: Nid = Nid(ffi::NID_id_pkix_OCSP_serviceLocator);
+    pub const ID_PKIX_OCSP_EXTENDEDSTATUS: Nid = Nid(ffi::NID_id_pkix_OCSP_extendedStatus);
+    pub const ID_PKIX_OCSP_VALID: Nid = Nid(ffi::NID_id_pkix_OCSP_valid);
+    pub const ID_PKIX_OCSP_PATH: Nid = Nid(ffi::NID_id_pkix_OCSP_path);
+    pub const ID_PKIX_OCSP_TRUSTROOT: Nid = Nid(ffi::NID_id_pkix_OCSP_trustRoot);
+    pub const ALGORITHM: Nid = Nid(ffi::NID_algorithm);
+    pub const MD5WITHRSA: Nid = Nid(ffi::NID_md5WithRSA);
+    pub const DES_ECB: Nid = Nid(ffi::NID_des_ecb);
+    pub const DES_CBC: Nid = Nid(ffi::NID_des_cbc);
+    pub const DES_OFB64: Nid = Nid(ffi::NID_des_ofb64);
+    pub const DES_CFB64: Nid = Nid(ffi::NID_des_cfb64);
+    pub const RSASIGNATURE: Nid = Nid(ffi::NID_rsaSignature);
+    pub const DSA_2: Nid = Nid(ffi::NID_dsa_2);
+    pub const DSAWITHSHA: Nid = Nid(ffi::NID_dsaWithSHA);
+    pub const SHAWITHRSAENCRYPTION: Nid = Nid(ffi::NID_shaWithRSAEncryption);
+    pub const DES_EDE_ECB: Nid = Nid(ffi::NID_des_ede_ecb);
+    pub const DES_EDE3_ECB: Nid = Nid(ffi::NID_des_ede3_ecb);
+    pub const DES_EDE_CBC: Nid = Nid(ffi::NID_des_ede_cbc);
+    pub const DES_EDE_CFB64: Nid = Nid(ffi::NID_des_ede_cfb64);
+    pub const DES_EDE3_CFB64: Nid = Nid(ffi::NID_des_ede3_cfb64);
+    pub const DES_EDE_OFB64: Nid = Nid(ffi::NID_des_ede_ofb64);
+    pub const DES_EDE3_OFB64: Nid = Nid(ffi::NID_des_ede3_ofb64);
+    pub const DESX_CBC: Nid = Nid(ffi::NID_desx_cbc);
+    pub const SHA: Nid = Nid(ffi::NID_sha);
+    pub const SHA1: Nid = Nid(ffi::NID_sha1);
+    pub const DSAWITHSHA1_2: Nid = Nid(ffi::NID_dsaWithSHA1_2);
+    pub const SHA1WITHRSA: Nid = Nid(ffi::NID_sha1WithRSA);
+    pub const RIPEMD160: Nid = Nid(ffi::NID_ripemd160);
+    pub const RIPEMD160WITHRSA: Nid = Nid(ffi::NID_ripemd160WithRSA);
+    pub const SXNET: Nid = Nid(ffi::NID_sxnet);
+    pub const X500: Nid = Nid(ffi::NID_X500);
+    pub const X509: Nid = Nid(ffi::NID_X509);
+    pub const COMMONNAME: Nid = Nid(ffi::NID_commonName);
+    pub const SURNAME: Nid = Nid(ffi::NID_surname);
+    pub const SERIALNUMBER: Nid = Nid(ffi::NID_serialNumber);
+    pub const COUNTRYNAME: Nid = Nid(ffi::NID_countryName);
+    pub const LOCALITYNAME: Nid = Nid(ffi::NID_localityName);
+    pub const STATEORPROVINCENAME: Nid = Nid(ffi::NID_stateOrProvinceName);
+    pub const STREETADDRESS: Nid = Nid(ffi::NID_streetAddress);
+    pub const ORGANIZATIONNAME: Nid = Nid(ffi::NID_organizationName);
+    pub const ORGANIZATIONALUNITNAME: Nid = Nid(ffi::NID_organizationalUnitName);
+    pub const TITLE: Nid = Nid(ffi::NID_title);
+    pub const DESCRIPTION: Nid = Nid(ffi::NID_description);
+    pub const SEARCHGUIDE: Nid = Nid(ffi::NID_searchGuide);
+    pub const BUSINESSCATEGORY: Nid = Nid(ffi::NID_businessCategory);
+    pub const POSTALADDRESS: Nid = Nid(ffi::NID_postalAddress);
+    pub const POSTALCODE: Nid = Nid(ffi::NID_postalCode);
+    pub const POSTOFFICEBOX: Nid = Nid(ffi::NID_postOfficeBox);
+    pub const PHYSICALDELIVERYOFFICENAME: Nid = Nid(ffi::NID_physicalDeliveryOfficeName);
+    pub const TELEPHONENUMBER: Nid = Nid(ffi::NID_telephoneNumber);
+    pub const TELEXNUMBER: Nid = Nid(ffi::NID_telexNumber);
+    pub const TELETEXTERMINALIDENTIFIER: Nid = Nid(ffi::NID_teletexTerminalIdentifier);
+    pub const FACSIMILETELEPHONENUMBER: Nid = Nid(ffi::NID_facsimileTelephoneNumber);
+    pub const X121ADDRESS: Nid = Nid(ffi::NID_x121Address);
+    pub const INTERNATIONALISDNNUMBER: Nid = Nid(ffi::NID_internationaliSDNNumber);
+    pub const REGISTEREDADDRESS: Nid = Nid(ffi::NID_registeredAddress);
+    pub const DESTINATIONINDICATOR: Nid = Nid(ffi::NID_destinationIndicator);
+    pub const PREFERREDDELIVERYMETHOD: Nid = Nid(ffi::NID_preferredDeliveryMethod);
+    pub const PRESENTATIONADDRESS: Nid = Nid(ffi::NID_presentationAddress);
+    pub const SUPPORTEDAPPLICATIONCONTEXT: Nid = Nid(ffi::NID_supportedApplicationContext);
+    pub const MEMBER: Nid = Nid(ffi::NID_member);
+    pub const OWNER: Nid = Nid(ffi::NID_owner);
+    pub const ROLEOCCUPANT: Nid = Nid(ffi::NID_roleOccupant);
+    pub const SEEALSO: Nid = Nid(ffi::NID_seeAlso);
+    pub const USERPASSWORD: Nid = Nid(ffi::NID_userPassword);
+    pub const USERCERTIFICATE: Nid = Nid(ffi::NID_userCertificate);
+    pub const CACERTIFICATE: Nid = Nid(ffi::NID_cACertificate);
+    pub const AUTHORITYREVOCATIONLIST: Nid = Nid(ffi::NID_authorityRevocationList);
+    pub const CERTIFICATEREVOCATIONLIST: Nid = Nid(ffi::NID_certificateRevocationList);
+    pub const CROSSCERTIFICATEPAIR: Nid = Nid(ffi::NID_crossCertificatePair);
+    pub const NAME: Nid = Nid(ffi::NID_name);
+    pub const GIVENNAME: Nid = Nid(ffi::NID_givenName);
+    pub const INITIALS: Nid = Nid(ffi::NID_initials);
+    pub const GENERATIONQUALIFIER: Nid = Nid(ffi::NID_generationQualifier);
+    pub const X500UNIQUEIDENTIFIER: Nid = Nid(ffi::NID_x500UniqueIdentifier);
+    pub const DNQUALIFIER: Nid = Nid(ffi::NID_dnQualifier);
+    pub const ENHANCEDSEARCHGUIDE: Nid = Nid(ffi::NID_enhancedSearchGuide);
+    pub const PROTOCOLINFORMATION: Nid = Nid(ffi::NID_protocolInformation);
+    pub const DISTINGUISHEDNAME: Nid = Nid(ffi::NID_distinguishedName);
+    pub const UNIQUEMEMBER: Nid = Nid(ffi::NID_uniqueMember);
+    pub const HOUSEIDENTIFIER: Nid = Nid(ffi::NID_houseIdentifier);
+    pub const SUPPORTEDALGORITHMS: Nid = Nid(ffi::NID_supportedAlgorithms);
+    pub const DELTAREVOCATIONLIST: Nid = Nid(ffi::NID_deltaRevocationList);
+    pub const DMDNAME: Nid = Nid(ffi::NID_dmdName);
+    pub const PSEUDONYM: Nid = Nid(ffi::NID_pseudonym);
+    pub const ROLE: Nid = Nid(ffi::NID_role);
+    pub const X500ALGORITHMS: Nid = Nid(ffi::NID_X500algorithms);
+    pub const RSA: Nid = Nid(ffi::NID_rsa);
+    pub const MDC2WITHRSA: Nid = Nid(ffi::NID_mdc2WithRSA);
+    pub const MDC2: Nid = Nid(ffi::NID_mdc2);
+    pub const ID_CE: Nid = Nid(ffi::NID_id_ce);
+    pub const SUBJECT_DIRECTORY_ATTRIBUTES: Nid = Nid(ffi::NID_subject_directory_attributes);
+    pub const SUBJECT_KEY_IDENTIFIER: Nid = Nid(ffi::NID_subject_key_identifier);
+    pub const KEY_USAGE: Nid = Nid(ffi::NID_key_usage);
+    pub const PRIVATE_KEY_USAGE_PERIOD: Nid = Nid(ffi::NID_private_key_usage_period);
+    pub const SUBJECT_ALT_NAME: Nid = Nid(ffi::NID_subject_alt_name);
+    pub const ISSUER_ALT_NAME: Nid = Nid(ffi::NID_issuer_alt_name);
+    pub const BASIC_CONSTRAINTS: Nid = Nid(ffi::NID_basic_constraints);
+    pub const CRL_NUMBER: Nid = Nid(ffi::NID_crl_number);
+    pub const CRL_REASON: Nid = Nid(ffi::NID_crl_reason);
+    pub const INVALIDITY_DATE: Nid = Nid(ffi::NID_invalidity_date);
+    pub const DELTA_CRL: Nid = Nid(ffi::NID_delta_crl);
+    pub const ISSUING_DISTRIBUTION_POINT: Nid = Nid(ffi::NID_issuing_distribution_point);
+    pub const CERTIFICATE_ISSUER: Nid = Nid(ffi::NID_certificate_issuer);
+    pub const NAME_CONSTRAINTS: Nid = Nid(ffi::NID_name_constraints);
+    pub const CRL_DISTRIBUTION_POINTS: Nid = Nid(ffi::NID_crl_distribution_points);
+    pub const CERTIFICATE_POLICIES: Nid = Nid(ffi::NID_certificate_policies);
+    pub const ANY_POLICY: Nid = Nid(ffi::NID_any_policy);
+    pub const POLICY_MAPPINGS: Nid = Nid(ffi::NID_policy_mappings);
+    pub const AUTHORITY_KEY_IDENTIFIER: Nid = Nid(ffi::NID_authority_key_identifier);
+    pub const POLICY_CONSTRAINTS: Nid = Nid(ffi::NID_policy_constraints);
+    pub const EXT_KEY_USAGE: Nid = Nid(ffi::NID_ext_key_usage);
+    pub const FRESHEST_CRL: Nid = Nid(ffi::NID_freshest_crl);
+    pub const INHIBIT_ANY_POLICY: Nid = Nid(ffi::NID_inhibit_any_policy);
+    pub const TARGET_INFORMATION: Nid = Nid(ffi::NID_target_information);
+    pub const NO_REV_AVAIL: Nid = Nid(ffi::NID_no_rev_avail);
+    pub const ANYEXTENDEDKEYUSAGE: Nid = Nid(ffi::NID_anyExtendedKeyUsage);
+    pub const NETSCAPE: Nid = Nid(ffi::NID_netscape);
+    pub const NETSCAPE_CERT_EXTENSION: Nid = Nid(ffi::NID_netscape_cert_extension);
+    pub const NETSCAPE_DATA_TYPE: Nid = Nid(ffi::NID_netscape_data_type);
+    pub const NETSCAPE_CERT_TYPE: Nid = Nid(ffi::NID_netscape_cert_type);
+    pub const NETSCAPE_BASE_URL: Nid = Nid(ffi::NID_netscape_base_url);
+    pub const NETSCAPE_REVOCATION_URL: Nid = Nid(ffi::NID_netscape_revocation_url);
+    pub const NETSCAPE_CA_REVOCATION_URL: Nid = Nid(ffi::NID_netscape_ca_revocation_url);
+    pub const NETSCAPE_RENEWAL_URL: Nid = Nid(ffi::NID_netscape_renewal_url);
+    pub const NETSCAPE_CA_POLICY_URL: Nid = Nid(ffi::NID_netscape_ca_policy_url);
+    pub const NETSCAPE_SSL_SERVER_NAME: Nid = Nid(ffi::NID_netscape_ssl_server_name);
+    pub const NETSCAPE_COMMENT: Nid = Nid(ffi::NID_netscape_comment);
+    pub const NETSCAPE_CERT_SEQUENCE: Nid = Nid(ffi::NID_netscape_cert_sequence);
+    pub const NS_SGC: Nid = Nid(ffi::NID_ns_sgc);
+    pub const ORG: Nid = Nid(ffi::NID_org);
+    pub const DOD: Nid = Nid(ffi::NID_dod);
+    pub const IANA: Nid = Nid(ffi::NID_iana);
+    pub const DIRECTORY: Nid = Nid(ffi::NID_Directory);
+    pub const MANAGEMENT: Nid = Nid(ffi::NID_Management);
+    pub const EXPERIMENTAL: Nid = Nid(ffi::NID_Experimental);
+    pub const PRIVATE: Nid = Nid(ffi::NID_Private);
+    pub const SECURITY: Nid = Nid(ffi::NID_Security);
+    pub const SNMPV2: Nid = Nid(ffi::NID_SNMPv2);
+    pub const MAIL: Nid = Nid(ffi::NID_Mail);
+    pub const ENTERPRISES: Nid = Nid(ffi::NID_Enterprises);
+    pub const DCOBJECT: Nid = Nid(ffi::NID_dcObject);
+    pub const MIME_MHS: Nid = Nid(ffi::NID_mime_mhs);
+    pub const MIME_MHS_HEADINGS: Nid = Nid(ffi::NID_mime_mhs_headings);
+    pub const MIME_MHS_BODIES: Nid = Nid(ffi::NID_mime_mhs_bodies);
+    pub const ID_HEX_PARTIAL_MESSAGE: Nid = Nid(ffi::NID_id_hex_partial_message);
+    pub const ID_HEX_MULTIPART_MESSAGE: Nid = Nid(ffi::NID_id_hex_multipart_message);
+    pub const ZLIB_COMPRESSION: Nid = Nid(ffi::NID_zlib_compression);
+    pub const AES_128_ECB: Nid = Nid(ffi::NID_aes_128_ecb);
+    pub const AES_128_CBC: Nid = Nid(ffi::NID_aes_128_cbc);
+    pub const AES_128_OFB128: Nid = Nid(ffi::NID_aes_128_ofb128);
+    pub const AES_128_CFB128: Nid = Nid(ffi::NID_aes_128_cfb128);
+    pub const ID_AES128_WRAP: Nid = Nid(ffi::NID_id_aes128_wrap);
+    pub const AES_128_GCM: Nid = Nid(ffi::NID_aes_128_gcm);
+    pub const AES_128_CCM: Nid = Nid(ffi::NID_aes_128_ccm);
+    pub const ID_AES128_WRAP_PAD: Nid = Nid(ffi::NID_id_aes128_wrap_pad);
+    pub const AES_192_ECB: Nid = Nid(ffi::NID_aes_192_ecb);
+    pub const AES_192_CBC: Nid = Nid(ffi::NID_aes_192_cbc);
+    pub const AES_192_OFB128: Nid = Nid(ffi::NID_aes_192_ofb128);
+    pub const AES_192_CFB128: Nid = Nid(ffi::NID_aes_192_cfb128);
+    pub const ID_AES192_WRAP: Nid = Nid(ffi::NID_id_aes192_wrap);
+    pub const AES_192_GCM: Nid = Nid(ffi::NID_aes_192_gcm);
+    pub const AES_192_CCM: Nid = Nid(ffi::NID_aes_192_ccm);
+    pub const ID_AES192_WRAP_PAD: Nid = Nid(ffi::NID_id_aes192_wrap_pad);
+    pub const AES_256_ECB: Nid = Nid(ffi::NID_aes_256_ecb);
+    pub const AES_256_CBC: Nid = Nid(ffi::NID_aes_256_cbc);
+    pub const AES_256_OFB128: Nid = Nid(ffi::NID_aes_256_ofb128);
+    pub const AES_256_CFB128: Nid = Nid(ffi::NID_aes_256_cfb128);
+    pub const ID_AES256_WRAP: Nid = Nid(ffi::NID_id_aes256_wrap);
+    pub const AES_256_GCM: Nid = Nid(ffi::NID_aes_256_gcm);
+    pub const AES_256_CCM: Nid = Nid(ffi::NID_aes_256_ccm);
+    pub const ID_AES256_WRAP_PAD: Nid = Nid(ffi::NID_id_aes256_wrap_pad);
+    pub const AES_128_CFB1: Nid = Nid(ffi::NID_aes_128_cfb1);
+    pub const AES_192_CFB1: Nid = Nid(ffi::NID_aes_192_cfb1);
+    pub const AES_256_CFB1: Nid = Nid(ffi::NID_aes_256_cfb1);
+    pub const AES_128_CFB8: Nid = Nid(ffi::NID_aes_128_cfb8);
+    pub const AES_192_CFB8: Nid = Nid(ffi::NID_aes_192_cfb8);
+    pub const AES_256_CFB8: Nid = Nid(ffi::NID_aes_256_cfb8);
+    pub const AES_128_CTR: Nid = Nid(ffi::NID_aes_128_ctr);
+    pub const AES_192_CTR: Nid = Nid(ffi::NID_aes_192_ctr);
+    pub const AES_256_CTR: Nid = Nid(ffi::NID_aes_256_ctr);
+    pub const AES_128_XTS: Nid = Nid(ffi::NID_aes_128_xts);
+    pub const AES_256_XTS: Nid = Nid(ffi::NID_aes_256_xts);
+    pub const DES_CFB1: Nid = Nid(ffi::NID_des_cfb1);
+    pub const DES_CFB8: Nid = Nid(ffi::NID_des_cfb8);
+    pub const DES_EDE3_CFB1: Nid = Nid(ffi::NID_des_ede3_cfb1);
+    pub const DES_EDE3_CFB8: Nid = Nid(ffi::NID_des_ede3_cfb8);
+    pub const SHA256: Nid = Nid(ffi::NID_sha256);
+    pub const SHA384: Nid = Nid(ffi::NID_sha384);
+    pub const SHA512: Nid = Nid(ffi::NID_sha512);
+    pub const SHA224: Nid = Nid(ffi::NID_sha224);
+    pub const DSA_WITH_SHA224: Nid = Nid(ffi::NID_dsa_with_SHA224);
+    pub const DSA_WITH_SHA256: Nid = Nid(ffi::NID_dsa_with_SHA256);
+    pub const HOLD_INSTRUCTION_CODE: Nid = Nid(ffi::NID_hold_instruction_code);
+    pub const HOLD_INSTRUCTION_NONE: Nid = Nid(ffi::NID_hold_instruction_none);
+    pub const HOLD_INSTRUCTION_CALL_ISSUER: Nid = Nid(ffi::NID_hold_instruction_call_issuer);
+    pub const HOLD_INSTRUCTION_REJECT: Nid = Nid(ffi::NID_hold_instruction_reject);
+    pub const DATA: Nid = Nid(ffi::NID_data);
+    pub const PSS: Nid = Nid(ffi::NID_pss);
+    pub const UCL: Nid = Nid(ffi::NID_ucl);
+    pub const PILOT: Nid = Nid(ffi::NID_pilot);
+    pub const PILOTATTRIBUTETYPE: Nid = Nid(ffi::NID_pilotAttributeType);
+    pub const PILOTATTRIBUTESYNTAX: Nid = Nid(ffi::NID_pilotAttributeSyntax);
+    pub const PILOTOBJECTCLASS: Nid = Nid(ffi::NID_pilotObjectClass);
+    pub const PILOTGROUPS: Nid = Nid(ffi::NID_pilotGroups);
+    pub const IA5STRINGSYNTAX: Nid = Nid(ffi::NID_iA5StringSyntax);
+    pub const CASEIGNOREIA5STRINGSYNTAX: Nid = Nid(ffi::NID_caseIgnoreIA5StringSyntax);
+    pub const PILOTOBJECT: Nid = Nid(ffi::NID_pilotObject);
+    pub const PILOTPERSON: Nid = Nid(ffi::NID_pilotPerson);
+    pub const ACCOUNT: Nid = Nid(ffi::NID_account);
+    pub const DOCUMENT: Nid = Nid(ffi::NID_document);
+    pub const ROOM: Nid = Nid(ffi::NID_room);
+    pub const DOCUMENTSERIES: Nid = Nid(ffi::NID_documentSeries);
+    pub const DOMAIN: Nid = Nid(ffi::NID_Domain);
+    pub const RFC822LOCALPART: Nid = Nid(ffi::NID_rFC822localPart);
+    pub const DNSDOMAIN: Nid = Nid(ffi::NID_dNSDomain);
+    pub const DOMAINRELATEDOBJECT: Nid = Nid(ffi::NID_domainRelatedObject);
+    pub const FRIENDLYCOUNTRY: Nid = Nid(ffi::NID_friendlyCountry);
+    pub const SIMPLESECURITYOBJECT: Nid = Nid(ffi::NID_simpleSecurityObject);
+    pub const PILOTORGANIZATION: Nid = Nid(ffi::NID_pilotOrganization);
+    pub const PILOTDSA: Nid = Nid(ffi::NID_pilotDSA);
+    pub const QUALITYLABELLEDDATA: Nid = Nid(ffi::NID_qualityLabelledData);
+    pub const USERID: Nid = Nid(ffi::NID_userId);
+    pub const TEXTENCODEDORADDRESS: Nid = Nid(ffi::NID_textEncodedORAddress);
+    pub const RFC822MAILBOX: Nid = Nid(ffi::NID_rfc822Mailbox);
+    pub const INFO: Nid = Nid(ffi::NID_info);
+    pub const FAVOURITEDRINK: Nid = Nid(ffi::NID_favouriteDrink);
+    pub const ROOMNUMBER: Nid = Nid(ffi::NID_roomNumber);
+    pub const PHOTO: Nid = Nid(ffi::NID_photo);
+    pub const USERCLASS: Nid = Nid(ffi::NID_userClass);
+    pub const HOST: Nid = Nid(ffi::NID_host);
+    pub const MANAGER: Nid = Nid(ffi::NID_manager);
+    pub const DOCUMENTIDENTIFIER: Nid = Nid(ffi::NID_documentIdentifier);
+    pub const DOCUMENTTITLE: Nid = Nid(ffi::NID_documentTitle);
+    pub const DOCUMENTVERSION: Nid = Nid(ffi::NID_documentVersion);
+    pub const DOCUMENTAUTHOR: Nid = Nid(ffi::NID_documentAuthor);
+    pub const DOCUMENTLOCATION: Nid = Nid(ffi::NID_documentLocation);
+    pub const HOMETELEPHONENUMBER: Nid = Nid(ffi::NID_homeTelephoneNumber);
+    pub const SECRETARY: Nid = Nid(ffi::NID_secretary);
+    pub const OTHERMAILBOX: Nid = Nid(ffi::NID_otherMailbox);
+    pub const LASTMODIFIEDTIME: Nid = Nid(ffi::NID_lastModifiedTime);
+    pub const LASTMODIFIEDBY: Nid = Nid(ffi::NID_lastModifiedBy);
+    pub const DOMAINCOMPONENT: Nid = Nid(ffi::NID_domainComponent);
+    pub const ARECORD: Nid = Nid(ffi::NID_aRecord);
+    pub const PILOTATTRIBUTETYPE27: Nid = Nid(ffi::NID_pilotAttributeType27);
+    pub const MXRECORD: Nid = Nid(ffi::NID_mXRecord);
+    pub const NSRECORD: Nid = Nid(ffi::NID_nSRecord);
+    pub const SOARECORD: Nid = Nid(ffi::NID_sOARecord);
+    pub const CNAMERECORD: Nid = Nid(ffi::NID_cNAMERecord);
+    pub const ASSOCIATEDDOMAIN: Nid = Nid(ffi::NID_associatedDomain);
+    pub const ASSOCIATEDNAME: Nid = Nid(ffi::NID_associatedName);
+    pub const HOMEPOSTALADDRESS: Nid = Nid(ffi::NID_homePostalAddress);
+    pub const PERSONALTITLE: Nid = Nid(ffi::NID_personalTitle);
+    pub const MOBILETELEPHONENUMBER: Nid = Nid(ffi::NID_mobileTelephoneNumber);
+    pub const PAGERTELEPHONENUMBER: Nid = Nid(ffi::NID_pagerTelephoneNumber);
+    pub const FRIENDLYCOUNTRYNAME: Nid = Nid(ffi::NID_friendlyCountryName);
+    pub const ORGANIZATIONALSTATUS: Nid = Nid(ffi::NID_organizationalStatus);
+    pub const JANETMAILBOX: Nid = Nid(ffi::NID_janetMailbox);
+    pub const MAILPREFERENCEOPTION: Nid = Nid(ffi::NID_mailPreferenceOption);
+    pub const BUILDINGNAME: Nid = Nid(ffi::NID_buildingName);
+    pub const DSAQUALITY: Nid = Nid(ffi::NID_dSAQuality);
+    pub const SINGLELEVELQUALITY: Nid = Nid(ffi::NID_singleLevelQuality);
+    pub const SUBTREEMINIMUMQUALITY: Nid = Nid(ffi::NID_subtreeMinimumQuality);
+    pub const SUBTREEMAXIMUMQUALITY: Nid = Nid(ffi::NID_subtreeMaximumQuality);
+    pub const PERSONALSIGNATURE: Nid = Nid(ffi::NID_personalSignature);
+    pub const DITREDIRECT: Nid = Nid(ffi::NID_dITRedirect);
+    pub const AUDIO: Nid = Nid(ffi::NID_audio);
+    pub const DOCUMENTPUBLISHER: Nid = Nid(ffi::NID_documentPublisher);
+    pub const ID_SET: Nid = Nid(ffi::NID_id_set);
+    pub const SET_CTYPE: Nid = Nid(ffi::NID_set_ctype);
+    pub const SET_MSGEXT: Nid = Nid(ffi::NID_set_msgExt);
+    pub const SET_ATTR: Nid = Nid(ffi::NID_set_attr);
+    pub const SET_POLICY: Nid = Nid(ffi::NID_set_policy);
+    pub const SET_CERTEXT: Nid = Nid(ffi::NID_set_certExt);
+    pub const SET_BRAND: Nid = Nid(ffi::NID_set_brand);
+    pub const SETCT_PANDATA: Nid = Nid(ffi::NID_setct_PANData);
+    pub const SETCT_PANTOKEN: Nid = Nid(ffi::NID_setct_PANToken);
+    pub const SETCT_PANONLY: Nid = Nid(ffi::NID_setct_PANOnly);
+    pub const SETCT_OIDATA: Nid = Nid(ffi::NID_setct_OIData);
+    pub const SETCT_PI: Nid = Nid(ffi::NID_setct_PI);
+    pub const SETCT_PIDATA: Nid = Nid(ffi::NID_setct_PIData);
+    pub const SETCT_PIDATAUNSIGNED: Nid = Nid(ffi::NID_setct_PIDataUnsigned);
+    pub const SETCT_HODINPUT: Nid = Nid(ffi::NID_setct_HODInput);
+    pub const SETCT_AUTHRESBAGGAGE: Nid = Nid(ffi::NID_setct_AuthResBaggage);
+    pub const SETCT_AUTHREVREQBAGGAGE: Nid = Nid(ffi::NID_setct_AuthRevReqBaggage);
+    pub const SETCT_AUTHREVRESBAGGAGE: Nid = Nid(ffi::NID_setct_AuthRevResBaggage);
+    pub const SETCT_CAPTOKENSEQ: Nid = Nid(ffi::NID_setct_CapTokenSeq);
+    pub const SETCT_PINITRESDATA: Nid = Nid(ffi::NID_setct_PInitResData);
+    pub const SETCT_PI_TBS: Nid = Nid(ffi::NID_setct_PI_TBS);
+    pub const SETCT_PRESDATA: Nid = Nid(ffi::NID_setct_PResData);
+    pub const SETCT_AUTHREQTBS: Nid = Nid(ffi::NID_setct_AuthReqTBS);
+    pub const SETCT_AUTHRESTBS: Nid = Nid(ffi::NID_setct_AuthResTBS);
+    pub const SETCT_AUTHRESTBSX: Nid = Nid(ffi::NID_setct_AuthResTBSX);
+    pub const SETCT_AUTHTOKENTBS: Nid = Nid(ffi::NID_setct_AuthTokenTBS);
+    pub const SETCT_CAPTOKENDATA: Nid = Nid(ffi::NID_setct_CapTokenData);
+    pub const SETCT_CAPTOKENTBS: Nid = Nid(ffi::NID_setct_CapTokenTBS);
+    pub const SETCT_ACQCARDCODEMSG: Nid = Nid(ffi::NID_setct_AcqCardCodeMsg);
+    pub const SETCT_AUTHREVREQTBS: Nid = Nid(ffi::NID_setct_AuthRevReqTBS);
+    pub const SETCT_AUTHREVRESDATA: Nid = Nid(ffi::NID_setct_AuthRevResData);
+    pub const SETCT_AUTHREVRESTBS: Nid = Nid(ffi::NID_setct_AuthRevResTBS);
+    pub const SETCT_CAPREQTBS: Nid = Nid(ffi::NID_setct_CapReqTBS);
+    pub const SETCT_CAPREQTBSX: Nid = Nid(ffi::NID_setct_CapReqTBSX);
+    pub const SETCT_CAPRESDATA: Nid = Nid(ffi::NID_setct_CapResData);
+    pub const SETCT_CAPREVREQTBS: Nid = Nid(ffi::NID_setct_CapRevReqTBS);
+    pub const SETCT_CAPREVREQTBSX: Nid = Nid(ffi::NID_setct_CapRevReqTBSX);
+    pub const SETCT_CAPREVRESDATA: Nid = Nid(ffi::NID_setct_CapRevResData);
+    pub const SETCT_CREDREQTBS: Nid = Nid(ffi::NID_setct_CredReqTBS);
+    pub const SETCT_CREDREQTBSX: Nid = Nid(ffi::NID_setct_CredReqTBSX);
+    pub const SETCT_CREDRESDATA: Nid = Nid(ffi::NID_setct_CredResData);
+    pub const SETCT_CREDREVREQTBS: Nid = Nid(ffi::NID_setct_CredRevReqTBS);
+    pub const SETCT_CREDREVREQTBSX: Nid = Nid(ffi::NID_setct_CredRevReqTBSX);
+    pub const SETCT_CREDREVRESDATA: Nid = Nid(ffi::NID_setct_CredRevResData);
+    pub const SETCT_PCERTREQDATA: Nid = Nid(ffi::NID_setct_PCertReqData);
+    pub const SETCT_PCERTRESTBS: Nid = Nid(ffi::NID_setct_PCertResTBS);
+    pub const SETCT_BATCHADMINREQDATA: Nid = Nid(ffi::NID_setct_BatchAdminReqData);
+    pub const SETCT_BATCHADMINRESDATA: Nid = Nid(ffi::NID_setct_BatchAdminResData);
+    pub const SETCT_CARDCINITRESTBS: Nid = Nid(ffi::NID_setct_CardCInitResTBS);
+    pub const SETCT_MEAQCINITRESTBS: Nid = Nid(ffi::NID_setct_MeAqCInitResTBS);
+    pub const SETCT_REGFORMRESTBS: Nid = Nid(ffi::NID_setct_RegFormResTBS);
+    pub const SETCT_CERTREQDATA: Nid = Nid(ffi::NID_setct_CertReqData);
+    pub const SETCT_CERTREQTBS: Nid = Nid(ffi::NID_setct_CertReqTBS);
+    pub const SETCT_CERTRESDATA: Nid = Nid(ffi::NID_setct_CertResData);
+    pub const SETCT_CERTINQREQTBS: Nid = Nid(ffi::NID_setct_CertInqReqTBS);
+    pub const SETCT_ERRORTBS: Nid = Nid(ffi::NID_setct_ErrorTBS);
+    pub const SETCT_PIDUALSIGNEDTBE: Nid = Nid(ffi::NID_setct_PIDualSignedTBE);
+    pub const SETCT_PIUNSIGNEDTBE: Nid = Nid(ffi::NID_setct_PIUnsignedTBE);
+    pub const SETCT_AUTHREQTBE: Nid = Nid(ffi::NID_setct_AuthReqTBE);
+    pub const SETCT_AUTHRESTBE: Nid = Nid(ffi::NID_setct_AuthResTBE);
+    pub const SETCT_AUTHRESTBEX: Nid = Nid(ffi::NID_setct_AuthResTBEX);
+    pub const SETCT_AUTHTOKENTBE: Nid = Nid(ffi::NID_setct_AuthTokenTBE);
+    pub const SETCT_CAPTOKENTBE: Nid = Nid(ffi::NID_setct_CapTokenTBE);
+    pub const SETCT_CAPTOKENTBEX: Nid = Nid(ffi::NID_setct_CapTokenTBEX);
+    pub const SETCT_ACQCARDCODEMSGTBE: Nid = Nid(ffi::NID_setct_AcqCardCodeMsgTBE);
+    pub const SETCT_AUTHREVREQTBE: Nid = Nid(ffi::NID_setct_AuthRevReqTBE);
+    pub const SETCT_AUTHREVRESTBE: Nid = Nid(ffi::NID_setct_AuthRevResTBE);
+    pub const SETCT_AUTHREVRESTBEB: Nid = Nid(ffi::NID_setct_AuthRevResTBEB);
+    pub const SETCT_CAPREQTBE: Nid = Nid(ffi::NID_setct_CapReqTBE);
+    pub const SETCT_CAPREQTBEX: Nid = Nid(ffi::NID_setct_CapReqTBEX);
+    pub const SETCT_CAPRESTBE: Nid = Nid(ffi::NID_setct_CapResTBE);
+    pub const SETCT_CAPREVREQTBE: Nid = Nid(ffi::NID_setct_CapRevReqTBE);
+    pub const SETCT_CAPREVREQTBEX: Nid = Nid(ffi::NID_setct_CapRevReqTBEX);
+    pub const SETCT_CAPREVRESTBE: Nid = Nid(ffi::NID_setct_CapRevResTBE);
+    pub const SETCT_CREDREQTBE: Nid = Nid(ffi::NID_setct_CredReqTBE);
+    pub const SETCT_CREDREQTBEX: Nid = Nid(ffi::NID_setct_CredReqTBEX);
+    pub const SETCT_CREDRESTBE: Nid = Nid(ffi::NID_setct_CredResTBE);
+    pub const SETCT_CREDREVREQTBE: Nid = Nid(ffi::NID_setct_CredRevReqTBE);
+    pub const SETCT_CREDREVREQTBEX: Nid = Nid(ffi::NID_setct_CredRevReqTBEX);
+    pub const SETCT_CREDREVRESTBE: Nid = Nid(ffi::NID_setct_CredRevResTBE);
+    pub const SETCT_BATCHADMINREQTBE: Nid = Nid(ffi::NID_setct_BatchAdminReqTBE);
+    pub const SETCT_BATCHADMINRESTBE: Nid = Nid(ffi::NID_setct_BatchAdminResTBE);
+    pub const SETCT_REGFORMREQTBE: Nid = Nid(ffi::NID_setct_RegFormReqTBE);
+    pub const SETCT_CERTREQTBE: Nid = Nid(ffi::NID_setct_CertReqTBE);
+    pub const SETCT_CERTREQTBEX: Nid = Nid(ffi::NID_setct_CertReqTBEX);
+    pub const SETCT_CERTRESTBE: Nid = Nid(ffi::NID_setct_CertResTBE);
+    pub const SETCT_CRLNOTIFICATIONTBS: Nid = Nid(ffi::NID_setct_CRLNotificationTBS);
+    pub const SETCT_CRLNOTIFICATIONRESTBS: Nid = Nid(ffi::NID_setct_CRLNotificationResTBS);
+    pub const SETCT_BCIDISTRIBUTIONTBS: Nid = Nid(ffi::NID_setct_BCIDistributionTBS);
+    pub const SETEXT_GENCRYPT: Nid = Nid(ffi::NID_setext_genCrypt);
+    pub const SETEXT_MIAUTH: Nid = Nid(ffi::NID_setext_miAuth);
+    pub const SETEXT_PINSECURE: Nid = Nid(ffi::NID_setext_pinSecure);
+    pub const SETEXT_PINANY: Nid = Nid(ffi::NID_setext_pinAny);
+    pub const SETEXT_TRACK2: Nid = Nid(ffi::NID_setext_track2);
+    pub const SETEXT_CV: Nid = Nid(ffi::NID_setext_cv);
+    pub const SET_POLICY_ROOT: Nid = Nid(ffi::NID_set_policy_root);
+    pub const SETCEXT_HASHEDROOT: Nid = Nid(ffi::NID_setCext_hashedRoot);
+    pub const SETCEXT_CERTTYPE: Nid = Nid(ffi::NID_setCext_certType);
+    pub const SETCEXT_MERCHDATA: Nid = Nid(ffi::NID_setCext_merchData);
+    pub const SETCEXT_CCERTREQUIRED: Nid = Nid(ffi::NID_setCext_cCertRequired);
+    pub const SETCEXT_TUNNELING: Nid = Nid(ffi::NID_setCext_tunneling);
+    pub const SETCEXT_SETEXT: Nid = Nid(ffi::NID_setCext_setExt);
+    pub const SETCEXT_SETQUALF: Nid = Nid(ffi::NID_setCext_setQualf);
+    pub const SETCEXT_PGWYCAPABILITIES: Nid = Nid(ffi::NID_setCext_PGWYcapabilities);
+    pub const SETCEXT_TOKENIDENTIFIER: Nid = Nid(ffi::NID_setCext_TokenIdentifier);
+    pub const SETCEXT_TRACK2DATA: Nid = Nid(ffi::NID_setCext_Track2Data);
+    pub const SETCEXT_TOKENTYPE: Nid = Nid(ffi::NID_setCext_TokenType);
+    pub const SETCEXT_ISSUERCAPABILITIES: Nid = Nid(ffi::NID_setCext_IssuerCapabilities);
+    pub const SETATTR_CERT: Nid = Nid(ffi::NID_setAttr_Cert);
+    pub const SETATTR_PGWYCAP: Nid = Nid(ffi::NID_setAttr_PGWYcap);
+    pub const SETATTR_TOKENTYPE: Nid = Nid(ffi::NID_setAttr_TokenType);
+    pub const SETATTR_ISSCAP: Nid = Nid(ffi::NID_setAttr_IssCap);
+    pub const SET_ROOTKEYTHUMB: Nid = Nid(ffi::NID_set_rootKeyThumb);
+    pub const SET_ADDPOLICY: Nid = Nid(ffi::NID_set_addPolicy);
+    pub const SETATTR_TOKEN_EMV: Nid = Nid(ffi::NID_setAttr_Token_EMV);
+    pub const SETATTR_TOKEN_B0PRIME: Nid = Nid(ffi::NID_setAttr_Token_B0Prime);
+    pub const SETATTR_ISSCAP_CVM: Nid = Nid(ffi::NID_setAttr_IssCap_CVM);
+    pub const SETATTR_ISSCAP_T2: Nid = Nid(ffi::NID_setAttr_IssCap_T2);
+    pub const SETATTR_ISSCAP_SIG: Nid = Nid(ffi::NID_setAttr_IssCap_Sig);
+    pub const SETATTR_GENCRYPTGRM: Nid = Nid(ffi::NID_setAttr_GenCryptgrm);
+    pub const SETATTR_T2ENC: Nid = Nid(ffi::NID_setAttr_T2Enc);
+    pub const SETATTR_T2CLEARTXT: Nid = Nid(ffi::NID_setAttr_T2cleartxt);
+    pub const SETATTR_TOKICCSIG: Nid = Nid(ffi::NID_setAttr_TokICCsig);
+    pub const SETATTR_SECDEVSIG: Nid = Nid(ffi::NID_setAttr_SecDevSig);
+    pub const SET_BRAND_IATA_ATA: Nid = Nid(ffi::NID_set_brand_IATA_ATA);
+    pub const SET_BRAND_DINERS: Nid = Nid(ffi::NID_set_brand_Diners);
+    pub const SET_BRAND_AMERICANEXPRESS: Nid = Nid(ffi::NID_set_brand_AmericanExpress);
+    pub const SET_BRAND_JCB: Nid = Nid(ffi::NID_set_brand_JCB);
+    pub const SET_BRAND_VISA: Nid = Nid(ffi::NID_set_brand_Visa);
+    pub const SET_BRAND_MASTERCARD: Nid = Nid(ffi::NID_set_brand_MasterCard);
+    pub const SET_BRAND_NOVUS: Nid = Nid(ffi::NID_set_brand_Novus);
+    pub const DES_CDMF: Nid = Nid(ffi::NID_des_cdmf);
+    pub const RSAOAEPENCRYPTIONSET: Nid = Nid(ffi::NID_rsaOAEPEncryptionSET);
+    pub const IPSEC3: Nid = Nid(ffi::NID_ipsec3);
+    pub const IPSEC4: Nid = Nid(ffi::NID_ipsec4);
+    pub const WHIRLPOOL: Nid = Nid(ffi::NID_whirlpool);
+    pub const CRYPTOPRO: Nid = Nid(ffi::NID_cryptopro);
+    pub const CRYPTOCOM: Nid = Nid(ffi::NID_cryptocom);
+    pub const ID_GOSTR3411_94_WITH_GOSTR3410_2001: Nid =
+        Nid(ffi::NID_id_GostR3411_94_with_GostR3410_2001);
+    pub const ID_GOSTR3411_94_WITH_GOSTR3410_94: Nid =
+        Nid(ffi::NID_id_GostR3411_94_with_GostR3410_94);
+    pub const ID_GOSTR3411_94: Nid = Nid(ffi::NID_id_GostR3411_94);
+    pub const ID_HMACGOSTR3411_94: Nid = Nid(ffi::NID_id_HMACGostR3411_94);
+    pub const ID_GOSTR3410_2001: Nid = Nid(ffi::NID_id_GostR3410_2001);
+    pub const ID_GOSTR3410_94: Nid = Nid(ffi::NID_id_GostR3410_94);
+    pub const ID_GOST28147_89: Nid = Nid(ffi::NID_id_Gost28147_89);
+    pub const GOST89_CNT: Nid = Nid(ffi::NID_gost89_cnt);
+    pub const ID_GOST28147_89_MAC: Nid = Nid(ffi::NID_id_Gost28147_89_MAC);
+    pub const ID_GOSTR3411_94_PRF: Nid = Nid(ffi::NID_id_GostR3411_94_prf);
+    pub const ID_GOSTR3410_2001DH: Nid = Nid(ffi::NID_id_GostR3410_2001DH);
+    pub const ID_GOSTR3410_94DH: Nid = Nid(ffi::NID_id_GostR3410_94DH);
+    pub const ID_GOST28147_89_CRYPTOPRO_KEYMESHING: Nid =
+        Nid(ffi::NID_id_Gost28147_89_CryptoPro_KeyMeshing);
+    pub const ID_GOST28147_89_NONE_KEYMESHING: Nid = Nid(ffi::NID_id_Gost28147_89_None_KeyMeshing);
+    pub const ID_GOSTR3411_94_TESTPARAMSET: Nid = Nid(ffi::NID_id_GostR3411_94_TestParamSet);
+    pub const ID_GOSTR3411_94_CRYPTOPROPARAMSET: Nid =
+        Nid(ffi::NID_id_GostR3411_94_CryptoProParamSet);
+    pub const ID_GOST28147_89_TESTPARAMSET: Nid = Nid(ffi::NID_id_Gost28147_89_TestParamSet);
+    pub const ID_GOST28147_89_CRYPTOPRO_A_PARAMSET: Nid =
+        Nid(ffi::NID_id_Gost28147_89_CryptoPro_A_ParamSet);
+    pub const ID_GOST28147_89_CRYPTOPRO_B_PARAMSET: Nid =
+        Nid(ffi::NID_id_Gost28147_89_CryptoPro_B_ParamSet);
+    pub const ID_GOST28147_89_CRYPTOPRO_C_PARAMSET: Nid =
+        Nid(ffi::NID_id_Gost28147_89_CryptoPro_C_ParamSet);
+    pub const ID_GOST28147_89_CRYPTOPRO_D_PARAMSET: Nid =
+        Nid(ffi::NID_id_Gost28147_89_CryptoPro_D_ParamSet);
+    pub const ID_GOST28147_89_CRYPTOPRO_OSCAR_1_1_PARAMSET: Nid =
+        Nid(ffi::NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet);
+    pub const ID_GOST28147_89_CRYPTOPRO_OSCAR_1_0_PARAMSET: Nid =
+        Nid(ffi::NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet);
+    pub const ID_GOST28147_89_CRYPTOPRO_RIC_1_PARAMSET: Nid =
+        Nid(ffi::NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet);
+    pub const ID_GOSTR3410_94_TESTPARAMSET: Nid = Nid(ffi::NID_id_GostR3410_94_TestParamSet);
+    pub const ID_GOSTR3410_94_CRYPTOPRO_A_PARAMSET: Nid =
+        Nid(ffi::NID_id_GostR3410_94_CryptoPro_A_ParamSet);
+    pub const ID_GOSTR3410_94_CRYPTOPRO_B_PARAMSET: Nid =
+        Nid(ffi::NID_id_GostR3410_94_CryptoPro_B_ParamSet);
+    pub const ID_GOSTR3410_94_CRYPTOPRO_C_PARAMSET: Nid =
+        Nid(ffi::NID_id_GostR3410_94_CryptoPro_C_ParamSet);
+    pub const ID_GOSTR3410_94_CRYPTOPRO_D_PARAMSET: Nid =
+        Nid(ffi::NID_id_GostR3410_94_CryptoPro_D_ParamSet);
+    pub const ID_GOSTR3410_94_CRYPTOPRO_XCHA_PARAMSET: Nid =
+        Nid(ffi::NID_id_GostR3410_94_CryptoPro_XchA_ParamSet);
+    pub const ID_GOSTR3410_94_CRYPTOPRO_XCHB_PARAMSET: Nid =
+        Nid(ffi::NID_id_GostR3410_94_CryptoPro_XchB_ParamSet);
+    pub const ID_GOSTR3410_94_CRYPTOPRO_XCHC_PARAMSET: Nid =
+        Nid(ffi::NID_id_GostR3410_94_CryptoPro_XchC_ParamSet);
+    pub const ID_GOSTR3410_2001_TESTPARAMSET: Nid = Nid(ffi::NID_id_GostR3410_2001_TestParamSet);
+    pub const ID_GOSTR3410_2001_CRYPTOPRO_A_PARAMSET: Nid =
+        Nid(ffi::NID_id_GostR3410_2001_CryptoPro_A_ParamSet);
+    pub const ID_GOSTR3410_2001_CRYPTOPRO_B_PARAMSET: Nid =
+        Nid(ffi::NID_id_GostR3410_2001_CryptoPro_B_ParamSet);
+    pub const ID_GOSTR3410_2001_CRYPTOPRO_C_PARAMSET: Nid =
+        Nid(ffi::NID_id_GostR3410_2001_CryptoPro_C_ParamSet);
+    pub const ID_GOSTR3410_2001_CRYPTOPRO_XCHA_PARAMSET: Nid =
+        Nid(ffi::NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet);
+    pub const ID_GOSTR3410_2001_CRYPTOPRO_XCHB_PARAMSET: Nid =
+        Nid(ffi::NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet);
+    pub const ID_GOSTR3410_94_A: Nid = Nid(ffi::NID_id_GostR3410_94_a);
+    pub const ID_GOSTR3410_94_ABIS: Nid = Nid(ffi::NID_id_GostR3410_94_aBis);
+    pub const ID_GOSTR3410_94_B: Nid = Nid(ffi::NID_id_GostR3410_94_b);
+    pub const ID_GOSTR3410_94_BBIS: Nid = Nid(ffi::NID_id_GostR3410_94_bBis);
+    pub const ID_GOST28147_89_CC: Nid = Nid(ffi::NID_id_Gost28147_89_cc);
+    pub const ID_GOSTR3410_94_CC: Nid = Nid(ffi::NID_id_GostR3410_94_cc);
+    pub const ID_GOSTR3410_2001_CC: Nid = Nid(ffi::NID_id_GostR3410_2001_cc);
+    pub const ID_GOSTR3411_94_WITH_GOSTR3410_94_CC: Nid =
+        Nid(ffi::NID_id_GostR3411_94_with_GostR3410_94_cc);
+    pub const ID_GOSTR3411_94_WITH_GOSTR3410_2001_CC: Nid =
+        Nid(ffi::NID_id_GostR3411_94_with_GostR3410_2001_cc);
+    pub const ID_GOSTR3410_2001_PARAMSET_CC: Nid = Nid(ffi::NID_id_GostR3410_2001_ParamSet_cc);
+    pub const CAMELLIA_128_CBC: Nid = Nid(ffi::NID_camellia_128_cbc);
+    pub const CAMELLIA_192_CBC: Nid = Nid(ffi::NID_camellia_192_cbc);
+    pub const CAMELLIA_256_CBC: Nid = Nid(ffi::NID_camellia_256_cbc);
+    pub const ID_CAMELLIA128_WRAP: Nid = Nid(ffi::NID_id_camellia128_wrap);
+    pub const ID_CAMELLIA192_WRAP: Nid = Nid(ffi::NID_id_camellia192_wrap);
+    pub const ID_CAMELLIA256_WRAP: Nid = Nid(ffi::NID_id_camellia256_wrap);
+    pub const CAMELLIA_128_ECB: Nid = Nid(ffi::NID_camellia_128_ecb);
+    pub const CAMELLIA_128_OFB128: Nid = Nid(ffi::NID_camellia_128_ofb128);
+    pub const CAMELLIA_128_CFB128: Nid = Nid(ffi::NID_camellia_128_cfb128);
+    pub const CAMELLIA_192_ECB: Nid = Nid(ffi::NID_camellia_192_ecb);
+    pub const CAMELLIA_192_OFB128: Nid = Nid(ffi::NID_camellia_192_ofb128);
+    pub const CAMELLIA_192_CFB128: Nid = Nid(ffi::NID_camellia_192_cfb128);
+    pub const CAMELLIA_256_ECB: Nid = Nid(ffi::NID_camellia_256_ecb);
+    pub const CAMELLIA_256_OFB128: Nid = Nid(ffi::NID_camellia_256_ofb128);
+    pub const CAMELLIA_256_CFB128: Nid = Nid(ffi::NID_camellia_256_cfb128);
+    pub const CAMELLIA_128_CFB1: Nid = Nid(ffi::NID_camellia_128_cfb1);
+    pub const CAMELLIA_192_CFB1: Nid = Nid(ffi::NID_camellia_192_cfb1);
+    pub const CAMELLIA_256_CFB1: Nid = Nid(ffi::NID_camellia_256_cfb1);
+    pub const CAMELLIA_128_CFB8: Nid = Nid(ffi::NID_camellia_128_cfb8);
+    pub const CAMELLIA_192_CFB8: Nid = Nid(ffi::NID_camellia_192_cfb8);
+    pub const CAMELLIA_256_CFB8: Nid = Nid(ffi::NID_camellia_256_cfb8);
+    pub const KISA: Nid = Nid(ffi::NID_kisa);
+    pub const SEED_ECB: Nid = Nid(ffi::NID_seed_ecb);
+    pub const SEED_CBC: Nid = Nid(ffi::NID_seed_cbc);
+    pub const SEED_CFB128: Nid = Nid(ffi::NID_seed_cfb128);
+    pub const SEED_OFB128: Nid = Nid(ffi::NID_seed_ofb128);
+    pub const HMAC: Nid = Nid(ffi::NID_hmac);
+    pub const CMAC: Nid = Nid(ffi::NID_cmac);
+    pub const RC4_HMAC_MD5: Nid = Nid(ffi::NID_rc4_hmac_md5);
+    pub const AES_128_CBC_HMAC_SHA1: Nid = Nid(ffi::NID_aes_128_cbc_hmac_sha1);
+    pub const AES_192_CBC_HMAC_SHA1: Nid = Nid(ffi::NID_aes_192_cbc_hmac_sha1);
+    pub const AES_256_CBC_HMAC_SHA1: Nid = Nid(ffi::NID_aes_256_cbc_hmac_sha1);
+    #[cfg(ossl111)]
+    pub const SM2: Nid = Nid(ffi::NID_sm2);
+    #[cfg(any(ossl111, libressl291))]
+    pub const SM3: Nid = Nid(ffi::NID_sm3);
+    #[cfg(any(ossl111, libressl380))]
+    pub const SHA3_224: Nid = Nid(ffi::NID_sha3_224);
+    #[cfg(any(ossl111, libressl380))]
+    pub const SHA3_256: Nid = Nid(ffi::NID_sha3_256);
+    #[cfg(any(ossl111, libressl380))]
+    pub const SHA3_384: Nid = Nid(ffi::NID_sha3_384);
+    #[cfg(any(ossl111, libressl380))]
+    pub const SHA3_512: Nid = Nid(ffi::NID_sha3_512);
+    #[cfg(ossl111)]
+    pub const SHAKE128: Nid = Nid(ffi::NID_shake128);
+    #[cfg(ossl111)]
+    pub const SHAKE256: Nid = Nid(ffi::NID_shake256);
+    #[cfg(any(ossl110, libressl271))]
+    pub const CHACHA20_POLY1305: Nid = Nid(ffi::NID_chacha20_poly1305);
+}
+
+#[cfg(test)]
+mod test {
+    use super::Nid;
+
+    #[test]
+    fn signature_digest() {
+        let algs = Nid::SHA256WITHRSAENCRYPTION.signature_algorithms().unwrap();
+        assert_eq!(algs.digest, Nid::SHA256);
+        assert_eq!(algs.pkey, Nid::RSAENCRYPTION);
+    }
+
+    #[test]
+    fn test_long_name_conversion() {
+        let common_name = Nid::COMMONNAME;
+        let organizational_unit_name = Nid::ORGANIZATIONALUNITNAME;
+        let aes256_cbc_hmac_sha1 = Nid::AES_256_CBC_HMAC_SHA1;
+        let id_cmc_lrapopwitness = Nid::ID_CMC_LRAPOPWITNESS;
+        let ms_ctl_sign = Nid::MS_CTL_SIGN;
+        let undefined_nid = Nid::from_raw(118);
+
+        assert_eq!(common_name.long_name().unwrap(), "commonName");
+        assert_eq!(
+            organizational_unit_name.long_name().unwrap(),
+            "organizationalUnitName"
+        );
+        assert_eq!(
+            aes256_cbc_hmac_sha1.long_name().unwrap(),
+            "aes-256-cbc-hmac-sha1"
+        );
+        assert_eq!(
+            id_cmc_lrapopwitness.long_name().unwrap(),
+            "id-cmc-lraPOPWitness"
+        );
+        assert_eq!(
+            ms_ctl_sign.long_name().unwrap(),
+            "Microsoft Trust List Signing"
+        );
+        assert!(
+            undefined_nid.long_name().is_err(),
+            "undefined_nid should not return a valid value"
+        );
+    }
+
+    #[test]
+    fn test_short_name_conversion() {
+        let common_name = Nid::COMMONNAME;
+        let organizational_unit_name = Nid::ORGANIZATIONALUNITNAME;
+        let aes256_cbc_hmac_sha1 = Nid::AES_256_CBC_HMAC_SHA1;
+        let id_cmc_lrapopwitness = Nid::ID_CMC_LRAPOPWITNESS;
+        let ms_ctl_sign = Nid::MS_CTL_SIGN;
+        let undefined_nid = Nid::from_raw(118);
+
+        assert_eq!(common_name.short_name().unwrap(), "CN");
+        assert_eq!(organizational_unit_name.short_name().unwrap(), "OU");
+        assert_eq!(
+            aes256_cbc_hmac_sha1.short_name().unwrap(),
+            "AES-256-CBC-HMAC-SHA1"
+        );
+        assert_eq!(
+            id_cmc_lrapopwitness.short_name().unwrap(),
+            "id-cmc-lraPOPWitness"
+        );
+        assert_eq!(ms_ctl_sign.short_name().unwrap(), "msCTLSign");
+        assert!(
+            undefined_nid.short_name().is_err(),
+            "undefined_nid should not return a valid value"
+        );
+    }
+
+    #[test]
+    fn test_create() {
+        let nid = Nid::create("1.2.3.4", "foo", "foobar").unwrap();
+        assert_eq!(nid.short_name().unwrap(), "foo");
+        assert_eq!(nid.long_name().unwrap(), "foobar");
+
+        // Due to a bug in OpenSSL 3.1.0, this test crashes on Windows
+        if !cfg!(ossl310) {
+            let invalid_oid = Nid::create("invalid_oid", "invalid", "invalid");
+            assert!(
+                invalid_oid.is_err(),
+                "invalid_oid should not return a valid value"
+            );
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/ocsp.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/ocsp.rs
--- 43.0.0-1/rust-vendor/openssl/src/ocsp.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/ocsp.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,352 @@
+use bitflags::bitflags;
+use foreign_types::ForeignTypeRef;
+use libc::{c_int, c_long, c_ulong};
+use std::mem;
+use std::ptr;
+
+use crate::asn1::Asn1GeneralizedTimeRef;
+use crate::error::ErrorStack;
+use crate::hash::MessageDigest;
+use crate::stack::StackRef;
+use crate::util::ForeignTypeRefExt;
+use crate::x509::store::X509StoreRef;
+use crate::x509::{X509Ref, X509};
+use crate::{cvt, cvt_p};
+use openssl_macros::corresponds;
+
+bitflags! {
+    #[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+    #[repr(transparent)]
+    pub struct OcspFlag: c_ulong {
+        const NO_CERTS = ffi::OCSP_NOCERTS;
+        const NO_INTERN = ffi::OCSP_NOINTERN;
+        const NO_CHAIN = ffi::OCSP_NOCHAIN;
+        const NO_VERIFY = ffi::OCSP_NOVERIFY;
+        const NO_EXPLICIT = ffi::OCSP_NOEXPLICIT;
+        const NO_CA_SIGN = ffi::OCSP_NOCASIGN;
+        const NO_DELEGATED = ffi::OCSP_NODELEGATED;
+        const NO_CHECKS = ffi::OCSP_NOCHECKS;
+        const TRUST_OTHER = ffi::OCSP_TRUSTOTHER;
+        const RESPID_KEY = ffi::OCSP_RESPID_KEY;
+        const NO_TIME = ffi::OCSP_NOTIME;
+    }
+}
+
+#[derive(Copy, Clone, Debug, PartialEq, Eq)]
+pub struct OcspResponseStatus(c_int);
+
+impl OcspResponseStatus {
+    pub const SUCCESSFUL: OcspResponseStatus =
+        OcspResponseStatus(ffi::OCSP_RESPONSE_STATUS_SUCCESSFUL);
+    pub const MALFORMED_REQUEST: OcspResponseStatus =
+        OcspResponseStatus(ffi::OCSP_RESPONSE_STATUS_MALFORMEDREQUEST);
+    pub const INTERNAL_ERROR: OcspResponseStatus =
+        OcspResponseStatus(ffi::OCSP_RESPONSE_STATUS_INTERNALERROR);
+    pub const TRY_LATER: OcspResponseStatus =
+        OcspResponseStatus(ffi::OCSP_RESPONSE_STATUS_TRYLATER);
+    pub const SIG_REQUIRED: OcspResponseStatus =
+        OcspResponseStatus(ffi::OCSP_RESPONSE_STATUS_SIGREQUIRED);
+    pub const UNAUTHORIZED: OcspResponseStatus =
+        OcspResponseStatus(ffi::OCSP_RESPONSE_STATUS_UNAUTHORIZED);
+
+    pub fn from_raw(raw: c_int) -> OcspResponseStatus {
+        OcspResponseStatus(raw)
+    }
+
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn as_raw(&self) -> c_int {
+        self.0
+    }
+}
+
+#[derive(Copy, Clone, Debug, PartialEq, Eq)]
+pub struct OcspCertStatus(c_int);
+
+impl OcspCertStatus {
+    pub const GOOD: OcspCertStatus = OcspCertStatus(ffi::V_OCSP_CERTSTATUS_GOOD);
+    pub const REVOKED: OcspCertStatus = OcspCertStatus(ffi::V_OCSP_CERTSTATUS_REVOKED);
+    pub const UNKNOWN: OcspCertStatus = OcspCertStatus(ffi::V_OCSP_CERTSTATUS_UNKNOWN);
+
+    pub fn from_raw(raw: c_int) -> OcspCertStatus {
+        OcspCertStatus(raw)
+    }
+
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn as_raw(&self) -> c_int {
+        self.0
+    }
+}
+
+#[derive(Copy, Clone, Debug, PartialEq, Eq)]
+pub struct OcspRevokedStatus(c_int);
+
+impl OcspRevokedStatus {
+    pub const NO_STATUS: OcspRevokedStatus = OcspRevokedStatus(ffi::OCSP_REVOKED_STATUS_NOSTATUS);
+    pub const UNSPECIFIED: OcspRevokedStatus =
+        OcspRevokedStatus(ffi::OCSP_REVOKED_STATUS_UNSPECIFIED);
+    pub const KEY_COMPROMISE: OcspRevokedStatus =
+        OcspRevokedStatus(ffi::OCSP_REVOKED_STATUS_KEYCOMPROMISE);
+    pub const CA_COMPROMISE: OcspRevokedStatus =
+        OcspRevokedStatus(ffi::OCSP_REVOKED_STATUS_CACOMPROMISE);
+    pub const AFFILIATION_CHANGED: OcspRevokedStatus =
+        OcspRevokedStatus(ffi::OCSP_REVOKED_STATUS_AFFILIATIONCHANGED);
+    pub const STATUS_SUPERSEDED: OcspRevokedStatus =
+        OcspRevokedStatus(ffi::OCSP_REVOKED_STATUS_SUPERSEDED);
+    pub const STATUS_CESSATION_OF_OPERATION: OcspRevokedStatus =
+        OcspRevokedStatus(ffi::OCSP_REVOKED_STATUS_CESSATIONOFOPERATION);
+    pub const STATUS_CERTIFICATE_HOLD: OcspRevokedStatus =
+        OcspRevokedStatus(ffi::OCSP_REVOKED_STATUS_CERTIFICATEHOLD);
+    pub const REMOVE_FROM_CRL: OcspRevokedStatus =
+        OcspRevokedStatus(ffi::OCSP_REVOKED_STATUS_REMOVEFROMCRL);
+
+    pub fn from_raw(raw: c_int) -> OcspRevokedStatus {
+        OcspRevokedStatus(raw)
+    }
+
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn as_raw(&self) -> c_int {
+        self.0
+    }
+}
+
+pub struct OcspStatus<'a> {
+    /// The overall status of the response.
+    pub status: OcspCertStatus,
+    /// If `status` is `CERT_STATUS_REVOKED`, the reason for the revocation.
+    pub reason: OcspRevokedStatus,
+    /// If `status` is `CERT_STATUS_REVOKED`, the time at which the certificate was revoked.
+    pub revocation_time: Option<&'a Asn1GeneralizedTimeRef>,
+    /// The time that this revocation check was performed.
+    pub this_update: &'a Asn1GeneralizedTimeRef,
+    /// The time at which this revocation check expires.
+    pub next_update: &'a Asn1GeneralizedTimeRef,
+}
+
+impl<'a> OcspStatus<'a> {
+    /// Checks validity of the `this_update` and `next_update` fields.
+    ///
+    /// The `nsec` parameter specifies an amount of slack time that will be used when comparing
+    /// those times with the current time to account for delays and clock skew.
+    ///
+    /// The `maxsec` parameter limits the maximum age of the `this_update` parameter to prohibit
+    /// very old responses.
+    #[corresponds(OCSP_check_validity)]
+    pub fn check_validity(&self, nsec: u32, maxsec: Option<u32>) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::OCSP_check_validity(
+                self.this_update.as_ptr(),
+                self.next_update.as_ptr(),
+                nsec as c_long,
+                maxsec.map(|n| n as c_long).unwrap_or(-1),
+            ))
+            .map(|_| ())
+        }
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::OCSP_BASICRESP;
+    fn drop = ffi::OCSP_BASICRESP_free;
+
+    pub struct OcspBasicResponse;
+    pub struct OcspBasicResponseRef;
+}
+
+impl OcspBasicResponseRef {
+    /// Verifies the validity of the response.
+    ///
+    /// The `certs` parameter contains a set of certificates that will be searched when locating the
+    /// OCSP response signing certificate. Some responders do not include this in the response.
+    #[corresponds(OCSP_basic_verify)]
+    pub fn verify(
+        &self,
+        certs: &StackRef<X509>,
+        store: &X509StoreRef,
+        flags: OcspFlag,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::OCSP_basic_verify(
+                self.as_ptr(),
+                certs.as_ptr(),
+                store.as_ptr(),
+                flags.bits(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Looks up the status for the specified certificate ID.
+    #[corresponds(OCSP_resp_find_status)]
+    pub fn find_status<'a>(&'a self, id: &OcspCertIdRef) -> Option<OcspStatus<'a>> {
+        unsafe {
+            let mut status = ffi::V_OCSP_CERTSTATUS_UNKNOWN;
+            let mut reason = ffi::OCSP_REVOKED_STATUS_NOSTATUS;
+            let mut revocation_time = ptr::null_mut();
+            let mut this_update = ptr::null_mut();
+            let mut next_update = ptr::null_mut();
+
+            let r = ffi::OCSP_resp_find_status(
+                self.as_ptr(),
+                id.as_ptr(),
+                &mut status,
+                &mut reason,
+                &mut revocation_time,
+                &mut this_update,
+                &mut next_update,
+            );
+            if r == 1 {
+                let revocation_time = Asn1GeneralizedTimeRef::from_const_ptr_opt(revocation_time);
+
+                Some(OcspStatus {
+                    status: OcspCertStatus(status),
+                    reason: OcspRevokedStatus(status),
+                    revocation_time,
+                    this_update: Asn1GeneralizedTimeRef::from_ptr(this_update),
+                    next_update: Asn1GeneralizedTimeRef::from_ptr(next_update),
+                })
+            } else {
+                None
+            }
+        }
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::OCSP_CERTID;
+    fn drop = ffi::OCSP_CERTID_free;
+
+    pub struct OcspCertId;
+    pub struct OcspCertIdRef;
+}
+
+impl OcspCertId {
+    /// Constructs a certificate ID for certificate `subject`.
+    #[corresponds(OCSP_cert_to_id)]
+    pub fn from_cert(
+        digest: MessageDigest,
+        subject: &X509Ref,
+        issuer: &X509Ref,
+    ) -> Result<OcspCertId, ErrorStack> {
+        unsafe {
+            cvt_p(ffi::OCSP_cert_to_id(
+                digest.as_ptr(),
+                subject.as_ptr(),
+                issuer.as_ptr(),
+            ))
+            .map(OcspCertId)
+        }
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::OCSP_RESPONSE;
+    fn drop = ffi::OCSP_RESPONSE_free;
+
+    pub struct OcspResponse;
+    pub struct OcspResponseRef;
+}
+
+impl OcspResponse {
+    /// Creates an OCSP response from the status and optional body.
+    ///
+    /// A body should only be provided if `status` is `RESPONSE_STATUS_SUCCESSFUL`.
+    #[corresponds(OCSP_response_create)]
+    pub fn create(
+        status: OcspResponseStatus,
+        body: Option<&OcspBasicResponseRef>,
+    ) -> Result<OcspResponse, ErrorStack> {
+        unsafe {
+            ffi::init();
+
+            cvt_p(ffi::OCSP_response_create(
+                status.as_raw(),
+                body.map(|r| r.as_ptr()).unwrap_or(ptr::null_mut()),
+            ))
+            .map(OcspResponse)
+        }
+    }
+
+    from_der! {
+        /// Deserializes a DER-encoded OCSP response.
+        #[corresponds(d2i_OCSP_RESPONSE)]
+        from_der,
+        OcspResponse,
+        ffi::d2i_OCSP_RESPONSE
+    }
+}
+
+impl OcspResponseRef {
+    to_der! {
+        /// Serializes the response to its standard DER encoding.
+        #[corresponds(i2d_OCSP_RESPONSE)]
+        to_der,
+        ffi::i2d_OCSP_RESPONSE
+    }
+
+    /// Returns the status of the response.
+    #[corresponds(OCSP_response_status)]
+    pub fn status(&self) -> OcspResponseStatus {
+        unsafe { OcspResponseStatus(ffi::OCSP_response_status(self.as_ptr())) }
+    }
+
+    /// Returns the basic response.
+    ///
+    /// This will only succeed if `status()` returns `RESPONSE_STATUS_SUCCESSFUL`.
+    #[corresponds(OCSP_response_get1_basic)]
+    pub fn basic(&self) -> Result<OcspBasicResponse, ErrorStack> {
+        unsafe { cvt_p(ffi::OCSP_response_get1_basic(self.as_ptr())).map(OcspBasicResponse) }
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::OCSP_REQUEST;
+    fn drop = ffi::OCSP_REQUEST_free;
+
+    pub struct OcspRequest;
+    pub struct OcspRequestRef;
+}
+
+impl OcspRequest {
+    #[corresponds(OCSP_REQUEST_new)]
+    pub fn new() -> Result<OcspRequest, ErrorStack> {
+        unsafe {
+            ffi::init();
+
+            cvt_p(ffi::OCSP_REQUEST_new()).map(OcspRequest)
+        }
+    }
+
+    from_der! {
+        /// Deserializes a DER-encoded OCSP request.
+        #[corresponds(d2i_OCSP_REQUEST)]
+        from_der,
+        OcspRequest,
+        ffi::d2i_OCSP_REQUEST
+    }
+}
+
+impl OcspRequestRef {
+    to_der! {
+        /// Serializes the request to its standard DER encoding.
+        #[corresponds(i2d_OCSP_REQUEST)]
+        to_der,
+        ffi::i2d_OCSP_REQUEST
+    }
+
+    #[corresponds(OCSP_request_add0_id)]
+    pub fn add_id(&mut self, id: OcspCertId) -> Result<&mut OcspOneReqRef, ErrorStack> {
+        unsafe {
+            let ptr = cvt_p(ffi::OCSP_request_add0_id(self.as_ptr(), id.as_ptr()))?;
+            mem::forget(id);
+            Ok(OcspOneReqRef::from_ptr_mut(ptr))
+        }
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::OCSP_ONEREQ;
+    fn drop = ffi::OCSP_ONEREQ_free;
+
+    pub struct OcspOneReq;
+    pub struct OcspOneReqRef;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/pkcs12.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/pkcs12.rs
--- 43.0.0-1/rust-vendor/openssl/src/pkcs12.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/pkcs12.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,403 @@
+//! PKCS #12 archives.
+
+use foreign_types::{ForeignType, ForeignTypeRef};
+use libc::c_int;
+use std::ffi::CString;
+use std::ptr;
+
+use crate::error::ErrorStack;
+#[cfg(not(boringssl))]
+use crate::hash::MessageDigest;
+use crate::nid::Nid;
+use crate::pkey::{HasPrivate, PKey, PKeyRef, Private};
+use crate::stack::Stack;
+use crate::util::ForeignTypeExt;
+use crate::x509::{X509Ref, X509};
+use crate::{cvt, cvt_p};
+use openssl_macros::corresponds;
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::PKCS12;
+    fn drop = ffi::PKCS12_free;
+
+    pub struct Pkcs12;
+    pub struct Pkcs12Ref;
+}
+
+impl Pkcs12Ref {
+    to_der! {
+        /// Serializes the `Pkcs12` to its standard DER encoding.
+        #[corresponds(i2d_PKCS12)]
+        to_der,
+        ffi::i2d_PKCS12
+    }
+
+    /// Deprecated.
+    #[deprecated(note = "Use parse2 instead", since = "0.10.46")]
+    #[allow(deprecated)]
+    pub fn parse(&self, pass: &str) -> Result<ParsedPkcs12, ErrorStack> {
+        let parsed = self.parse2(pass)?;
+
+        Ok(ParsedPkcs12 {
+            pkey: parsed.pkey.unwrap(),
+            cert: parsed.cert.unwrap(),
+            chain: parsed.ca,
+        })
+    }
+
+    /// Extracts the contents of the `Pkcs12`.
+    #[corresponds(PKCS12_parse)]
+    pub fn parse2(&self, pass: &str) -> Result<ParsedPkcs12_2, ErrorStack> {
+        unsafe {
+            let pass = CString::new(pass.as_bytes()).unwrap();
+
+            let mut pkey = ptr::null_mut();
+            let mut cert = ptr::null_mut();
+            let mut ca = ptr::null_mut();
+
+            cvt(ffi::PKCS12_parse(
+                self.as_ptr(),
+                pass.as_ptr(),
+                &mut pkey,
+                &mut cert,
+                &mut ca,
+            ))?;
+
+            let pkey = PKey::from_ptr_opt(pkey);
+            let cert = X509::from_ptr_opt(cert);
+            let ca = Stack::from_ptr_opt(ca);
+
+            Ok(ParsedPkcs12_2 { pkey, cert, ca })
+        }
+    }
+}
+
+impl Pkcs12 {
+    from_der! {
+        /// Deserializes a DER-encoded PKCS#12 archive.
+        #[corresponds(d2i_PKCS12)]
+        from_der,
+        Pkcs12,
+        ffi::d2i_PKCS12
+    }
+
+    /// Creates a new builder for a protected pkcs12 certificate.
+    ///
+    /// This uses the defaults from the OpenSSL library:
+    ///
+    /// * `nid_key` - `AES_256_CBC` (3.0.0+) or `PBE_WITHSHA1AND3_KEY_TRIPLEDES_CBC`
+    /// * `nid_cert` - `AES_256_CBC` (3.0.0+) or `PBE_WITHSHA1AND40BITRC2_CBC`
+    /// * `iter` - `2048`
+    /// * `mac_iter` - `2048`
+    /// * `mac_md` - `SHA-256` (3.0.0+) or `SHA-1` (`SHA-1` only for BoringSSL)
+    pub fn builder() -> Pkcs12Builder {
+        ffi::init();
+
+        Pkcs12Builder {
+            name: None,
+            pkey: None,
+            cert: None,
+            ca: None,
+            nid_key: Nid::UNDEF,
+            nid_cert: Nid::UNDEF,
+            iter: ffi::PKCS12_DEFAULT_ITER,
+            mac_iter: ffi::PKCS12_DEFAULT_ITER,
+            #[cfg(not(boringssl))]
+            mac_md: None,
+        }
+    }
+}
+
+#[deprecated(note = "Use ParsedPkcs12_2 instead", since = "0.10.46")]
+pub struct ParsedPkcs12 {
+    pub pkey: PKey<Private>,
+    pub cert: X509,
+    pub chain: Option<Stack<X509>>,
+}
+
+pub struct ParsedPkcs12_2 {
+    pub pkey: Option<PKey<Private>>,
+    pub cert: Option<X509>,
+    pub ca: Option<Stack<X509>>,
+}
+
+pub struct Pkcs12Builder {
+    // FIXME borrow
+    name: Option<CString>,
+    pkey: Option<PKey<Private>>,
+    cert: Option<X509>,
+    ca: Option<Stack<X509>>,
+    nid_key: Nid,
+    nid_cert: Nid,
+    iter: c_int,
+    mac_iter: c_int,
+    // FIXME remove
+    #[cfg(not(boringssl))]
+    mac_md: Option<MessageDigest>,
+}
+
+impl Pkcs12Builder {
+    /// The `friendlyName` used for the certificate and private key.
+    pub fn name(&mut self, name: &str) -> &mut Self {
+        self.name = Some(CString::new(name).unwrap());
+        self
+    }
+
+    /// The private key.
+    pub fn pkey<T>(&mut self, pkey: &PKeyRef<T>) -> &mut Self
+    where
+        T: HasPrivate,
+    {
+        let new_pkey = unsafe { PKeyRef::from_ptr(pkey.as_ptr()) };
+        self.pkey = Some(new_pkey.to_owned());
+        self
+    }
+
+    /// The certificate.
+    pub fn cert(&mut self, cert: &X509Ref) -> &mut Self {
+        self.cert = Some(cert.to_owned());
+        self
+    }
+
+    /// An additional set of certificates to include in the archive beyond the one provided to
+    /// `build`.
+    pub fn ca(&mut self, ca: Stack<X509>) -> &mut Self {
+        self.ca = Some(ca);
+        self
+    }
+
+    /// The encryption algorithm that should be used for the key
+    pub fn key_algorithm(&mut self, nid: Nid) -> &mut Self {
+        self.nid_key = nid;
+        self
+    }
+
+    /// The encryption algorithm that should be used for the cert
+    pub fn cert_algorithm(&mut self, nid: Nid) -> &mut Self {
+        self.nid_cert = nid;
+        self
+    }
+
+    /// Key iteration count, default is 2048 as of this writing
+    pub fn key_iter(&mut self, iter: u32) -> &mut Self {
+        self.iter = iter as c_int;
+        self
+    }
+
+    /// MAC iteration count, default is the same as key_iter.
+    ///
+    /// Old implementations don't understand MAC iterations greater than 1, (pre 1.0.1?), if such
+    /// compatibility is required this should be set to 1.
+    pub fn mac_iter(&mut self, mac_iter: u32) -> &mut Self {
+        self.mac_iter = mac_iter as c_int;
+        self
+    }
+
+    /// MAC message digest type
+    #[cfg(not(boringssl))]
+    pub fn mac_md(&mut self, md: MessageDigest) -> &mut Self {
+        self.mac_md = Some(md);
+        self
+    }
+
+    /// Deprecated.
+    #[deprecated(
+        note = "Use Self::{name, pkey, cert, build2} instead.",
+        since = "0.10.46"
+    )]
+    pub fn build<T>(
+        mut self,
+        password: &str,
+        friendly_name: &str,
+        pkey: &PKeyRef<T>,
+        cert: &X509Ref,
+    ) -> Result<Pkcs12, ErrorStack>
+    where
+        T: HasPrivate,
+    {
+        self.name(friendly_name)
+            .pkey(pkey)
+            .cert(cert)
+            .build2(password)
+    }
+
+    /// Builds the PKCS#12 object.
+    #[corresponds(PKCS12_create)]
+    pub fn build2(&self, password: &str) -> Result<Pkcs12, ErrorStack> {
+        unsafe {
+            let pass = CString::new(password).unwrap();
+            let pass = pass.as_ptr();
+            let friendly_name = self.name.as_ref().map_or(ptr::null(), |p| p.as_ptr());
+            let pkey = self.pkey.as_ref().map_or(ptr::null(), |p| p.as_ptr());
+            let cert = self.cert.as_ref().map_or(ptr::null(), |p| p.as_ptr());
+            let ca = self
+                .ca
+                .as_ref()
+                .map(|ca| ca.as_ptr())
+                .unwrap_or(ptr::null_mut());
+            let nid_key = self.nid_key.as_raw();
+            let nid_cert = self.nid_cert.as_raw();
+
+            // According to the OpenSSL docs, keytype is a non-standard extension for MSIE,
+            // It's values are KEY_SIG or KEY_EX, see the OpenSSL docs for more information:
+            // https://www.openssl.org/docs/manmaster/crypto/PKCS12_create.html
+            let keytype = 0;
+
+            let pkcs12 = cvt_p(ffi::PKCS12_create(
+                pass as *mut _,
+                friendly_name as *mut _,
+                pkey as *mut _,
+                cert as *mut _,
+                ca,
+                nid_key,
+                nid_cert,
+                self.iter,
+                self.mac_iter,
+                keytype,
+            ))
+            .map(Pkcs12)?;
+
+            #[cfg(not(boringssl))]
+            // BoringSSL does not support overriding the MAC and will always
+            // use SHA-1
+            {
+                let md_type = self
+                    .mac_md
+                    .map(|md_type| md_type.as_ptr())
+                    .unwrap_or(ptr::null());
+
+                cvt(ffi::PKCS12_set_mac(
+                    pkcs12.as_ptr(),
+                    pass,
+                    -1,
+                    ptr::null_mut(),
+                    0,
+                    self.mac_iter,
+                    md_type,
+                ))?;
+            }
+
+            Ok(pkcs12)
+        }
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use crate::asn1::Asn1Time;
+    use crate::hash::MessageDigest;
+    use crate::nid::Nid;
+    use crate::pkey::PKey;
+    use crate::rsa::Rsa;
+    use crate::x509::extension::KeyUsage;
+    use crate::x509::{X509Name, X509};
+
+    use super::*;
+
+    #[test]
+    fn parse() {
+        #[cfg(ossl300)]
+        let _provider = crate::provider::Provider::try_load(None, "legacy", true).unwrap();
+
+        let der = include_bytes!("../test/identity.p12");
+        let pkcs12 = Pkcs12::from_der(der).unwrap();
+        let parsed = pkcs12.parse2("mypass").unwrap();
+
+        assert_eq!(
+            hex::encode(
+                parsed
+                    .cert
+                    .as_ref()
+                    .unwrap()
+                    .digest(MessageDigest::sha1())
+                    .unwrap()
+            ),
+            "59172d9313e84459bcff27f967e79e6e9217e584"
+        );
+        assert_eq!(
+            parsed.cert.as_ref().unwrap().alias(),
+            Some(b"foobar.com" as &[u8])
+        );
+
+        let chain = parsed.ca.unwrap();
+        assert_eq!(chain.len(), 1);
+        assert_eq!(
+            hex::encode(chain[0].digest(MessageDigest::sha1()).unwrap()),
+            "c0cbdf7cdd03c9773e5468e1f6d2da7d5cbb1875"
+        );
+    }
+
+    #[test]
+    fn parse_empty_chain() {
+        #[cfg(ossl300)]
+        let _provider = crate::provider::Provider::try_load(None, "legacy", true).unwrap();
+
+        let der = include_bytes!("../test/keystore-empty-chain.p12");
+        let pkcs12 = Pkcs12::from_der(der).unwrap();
+        let parsed = pkcs12.parse2("cassandra").unwrap();
+        if let Some(stack) = parsed.ca {
+            assert_eq!(stack.len(), 0);
+        }
+    }
+
+    #[test]
+    fn create() {
+        let subject_name = "ns.example.com";
+        let rsa = Rsa::generate(2048).unwrap();
+        let pkey = PKey::from_rsa(rsa).unwrap();
+
+        let mut name = X509Name::builder().unwrap();
+        name.append_entry_by_nid(Nid::COMMONNAME, subject_name)
+            .unwrap();
+        let name = name.build();
+
+        let key_usage = KeyUsage::new().digital_signature().build().unwrap();
+
+        let mut builder = X509::builder().unwrap();
+        builder.set_version(2).unwrap();
+        builder
+            .set_not_before(&Asn1Time::days_from_now(0).unwrap())
+            .unwrap();
+        builder
+            .set_not_after(&Asn1Time::days_from_now(365).unwrap())
+            .unwrap();
+        builder.set_subject_name(&name).unwrap();
+        builder.set_issuer_name(&name).unwrap();
+        builder.append_extension(key_usage).unwrap();
+        builder.set_pubkey(&pkey).unwrap();
+        builder.sign(&pkey, MessageDigest::sha256()).unwrap();
+        let cert = builder.build();
+
+        let pkcs12 = Pkcs12::builder()
+            .name(subject_name)
+            .pkey(&pkey)
+            .cert(&cert)
+            .build2("mypass")
+            .unwrap();
+        let der = pkcs12.to_der().unwrap();
+
+        let pkcs12 = Pkcs12::from_der(&der).unwrap();
+        let parsed = pkcs12.parse2("mypass").unwrap();
+
+        assert_eq!(
+            &*parsed.cert.unwrap().digest(MessageDigest::sha1()).unwrap(),
+            &*cert.digest(MessageDigest::sha1()).unwrap()
+        );
+        assert!(parsed.pkey.unwrap().public_eq(&pkey));
+    }
+
+    #[test]
+    fn create_only_ca() {
+        let ca = include_bytes!("../test/root-ca.pem");
+        let ca = X509::from_pem(ca).unwrap();
+        let mut chain = Stack::new().unwrap();
+        chain.push(ca).unwrap();
+
+        let pkcs12 = Pkcs12::builder().ca(chain).build2("hunter2").unwrap();
+        let parsed = pkcs12.parse2("hunter2").unwrap();
+
+        assert!(parsed.cert.is_none());
+        assert!(parsed.pkey.is_none());
+        assert_eq!(parsed.ca.unwrap().len(), 1);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/pkcs5.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/pkcs5.rs
--- 43.0.0-1/rust-vendor/openssl/src/pkcs5.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/pkcs5.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,310 @@
+#[cfg(not(boringssl))]
+use libc::c_int;
+use std::convert::TryInto;
+#[cfg(not(boringssl))]
+use std::ptr;
+
+use crate::cvt;
+use crate::error::ErrorStack;
+use crate::hash::MessageDigest;
+#[cfg(not(boringssl))]
+use crate::symm::Cipher;
+use openssl_macros::corresponds;
+
+#[derive(Clone, Eq, PartialEq, Hash, Debug)]
+pub struct KeyIvPair {
+    pub key: Vec<u8>,
+    pub iv: Option<Vec<u8>>,
+}
+
+/// Derives a key and an IV from various parameters.
+///
+/// If specified, `salt` must be 8 bytes in length.
+///
+/// If the total key and IV length is less than 16 bytes and MD5 is used then
+/// the algorithm is compatible with the key derivation algorithm from PKCS#5
+/// v1.5 or PBKDF1 from PKCS#5 v2.0.
+///
+/// New applications should not use this and instead use
+/// `pbkdf2_hmac` or another more modern key derivation algorithm.
+#[corresponds(EVP_BytesToKey)]
+#[allow(clippy::useless_conversion)]
+#[cfg(not(boringssl))]
+pub fn bytes_to_key(
+    cipher: Cipher,
+    digest: MessageDigest,
+    data: &[u8],
+    salt: Option<&[u8]>,
+    count: i32,
+) -> Result<KeyIvPair, ErrorStack> {
+    unsafe {
+        assert!(data.len() <= c_int::MAX as usize);
+        let salt_ptr = match salt {
+            Some(salt) => {
+                assert_eq!(salt.len(), ffi::PKCS5_SALT_LEN as usize);
+                salt.as_ptr()
+            }
+            None => ptr::null(),
+        };
+
+        ffi::init();
+
+        let mut iv = cipher.iv_len().map(|l| vec![0; l]);
+
+        let cipher = cipher.as_ptr();
+        let digest = digest.as_ptr();
+
+        let len = cvt(ffi::EVP_BytesToKey(
+            cipher,
+            digest,
+            salt_ptr,
+            ptr::null(),
+            data.len() as c_int,
+            count.into(),
+            ptr::null_mut(),
+            ptr::null_mut(),
+        ))?;
+
+        let mut key = vec![0; len as usize];
+        let iv_ptr = iv
+            .as_mut()
+            .map(|v| v.as_mut_ptr())
+            .unwrap_or(ptr::null_mut());
+
+        cvt(ffi::EVP_BytesToKey(
+            cipher,
+            digest,
+            salt_ptr,
+            data.as_ptr(),
+            data.len() as c_int,
+            count as c_int,
+            key.as_mut_ptr(),
+            iv_ptr,
+        ))?;
+
+        Ok(KeyIvPair { key, iv })
+    }
+}
+
+/// Derives a key from a password and salt using the PBKDF2-HMAC algorithm with a digest function.
+#[corresponds(PKCS5_PBKDF2_HMAC)]
+pub fn pbkdf2_hmac(
+    pass: &[u8],
+    salt: &[u8],
+    iter: usize,
+    hash: MessageDigest,
+    key: &mut [u8],
+) -> Result<(), ErrorStack> {
+    unsafe {
+        ffi::init();
+        cvt(ffi::PKCS5_PBKDF2_HMAC(
+            pass.as_ptr() as *const _,
+            pass.len().try_into().unwrap(),
+            salt.as_ptr(),
+            salt.len().try_into().unwrap(),
+            iter.try_into().unwrap(),
+            hash.as_ptr(),
+            key.len().try_into().unwrap(),
+            key.as_mut_ptr(),
+        ))
+        .map(|_| ())
+    }
+}
+
+/// Derives a key from a password and salt using the scrypt algorithm.
+///
+/// Requires OpenSSL 1.1.0 or newer.
+#[corresponds(EVP_PBE_scrypt)]
+#[cfg(all(any(ossl110, boringssl), not(osslconf = "OPENSSL_NO_SCRYPT")))]
+#[allow(clippy::useless_conversion)]
+pub fn scrypt(
+    pass: &[u8],
+    salt: &[u8],
+    n: u64,
+    r: u64,
+    p: u64,
+    maxmem: u64,
+    key: &mut [u8],
+) -> Result<(), ErrorStack> {
+    unsafe {
+        ffi::init();
+        cvt(ffi::EVP_PBE_scrypt(
+            pass.as_ptr() as *const _,
+            pass.len(),
+            salt.as_ptr() as *const _,
+            salt.len(),
+            n,
+            r,
+            p,
+            maxmem.try_into().unwrap(),
+            key.as_mut_ptr() as *mut _,
+            key.len(),
+        ))
+        .map(|_| ())
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::hash::MessageDigest;
+    #[cfg(not(boringssl))]
+    use crate::symm::Cipher;
+
+    // Test vectors from
+    // https://git.lysator.liu.se/nettle/nettle/blob/nettle_3.1.1_release_20150424/testsuite/pbkdf2-test.c
+    #[test]
+    fn pbkdf2_hmac_sha256() {
+        let mut buf = [0; 16];
+
+        super::pbkdf2_hmac(b"passwd", b"salt", 1, MessageDigest::sha256(), &mut buf).unwrap();
+        assert_eq!(
+            buf,
+            &[
+                0x55_u8, 0xac_u8, 0x04_u8, 0x6e_u8, 0x56_u8, 0xe3_u8, 0x08_u8, 0x9f_u8, 0xec_u8,
+                0x16_u8, 0x91_u8, 0xc2_u8, 0x25_u8, 0x44_u8, 0xb6_u8, 0x05_u8,
+            ][..]
+        );
+
+        super::pbkdf2_hmac(
+            b"Password",
+            b"NaCl",
+            80000,
+            MessageDigest::sha256(),
+            &mut buf,
+        )
+        .unwrap();
+        assert_eq!(
+            buf,
+            &[
+                0x4d_u8, 0xdc_u8, 0xd8_u8, 0xf6_u8, 0x0b_u8, 0x98_u8, 0xbe_u8, 0x21_u8, 0x83_u8,
+                0x0c_u8, 0xee_u8, 0x5e_u8, 0xf2_u8, 0x27_u8, 0x01_u8, 0xf9_u8,
+            ][..]
+        );
+    }
+
+    // Test vectors from
+    // https://git.lysator.liu.se/nettle/nettle/blob/nettle_3.1.1_release_20150424/testsuite/pbkdf2-test.c
+    #[test]
+    fn pbkdf2_hmac_sha512() {
+        let mut buf = [0; 64];
+
+        super::pbkdf2_hmac(b"password", b"NaCL", 1, MessageDigest::sha512(), &mut buf).unwrap();
+        assert_eq!(
+            &buf[..],
+            &[
+                0x73_u8, 0xde_u8, 0xcf_u8, 0xa5_u8, 0x8a_u8, 0xa2_u8, 0xe8_u8, 0x4f_u8, 0x94_u8,
+                0x77_u8, 0x1a_u8, 0x75_u8, 0x73_u8, 0x6b_u8, 0xb8_u8, 0x8b_u8, 0xd3_u8, 0xc7_u8,
+                0xb3_u8, 0x82_u8, 0x70_u8, 0xcf_u8, 0xb5_u8, 0x0c_u8, 0xb3_u8, 0x90_u8, 0xed_u8,
+                0x78_u8, 0xb3_u8, 0x05_u8, 0x65_u8, 0x6a_u8, 0xf8_u8, 0x14_u8, 0x8e_u8, 0x52_u8,
+                0x45_u8, 0x2b_u8, 0x22_u8, 0x16_u8, 0xb2_u8, 0xb8_u8, 0x09_u8, 0x8b_u8, 0x76_u8,
+                0x1f_u8, 0xc6_u8, 0x33_u8, 0x60_u8, 0x60_u8, 0xa0_u8, 0x9f_u8, 0x76_u8, 0x41_u8,
+                0x5e_u8, 0x9f_u8, 0x71_u8, 0xea_u8, 0x47_u8, 0xf9_u8, 0xe9_u8, 0x06_u8, 0x43_u8,
+                0x06_u8,
+            ][..]
+        );
+
+        super::pbkdf2_hmac(
+            b"pass\0word",
+            b"sa\0lt",
+            1,
+            MessageDigest::sha512(),
+            &mut buf,
+        )
+        .unwrap();
+        assert_eq!(
+            &buf[..],
+            &[
+                0x71_u8, 0xa0_u8, 0xec_u8, 0x84_u8, 0x2a_u8, 0xbd_u8, 0x5c_u8, 0x67_u8, 0x8b_u8,
+                0xcf_u8, 0xd1_u8, 0x45_u8, 0xf0_u8, 0x9d_u8, 0x83_u8, 0x52_u8, 0x2f_u8, 0x93_u8,
+                0x36_u8, 0x15_u8, 0x60_u8, 0x56_u8, 0x3c_u8, 0x4d_u8, 0x0d_u8, 0x63_u8, 0xb8_u8,
+                0x83_u8, 0x29_u8, 0x87_u8, 0x10_u8, 0x90_u8, 0xe7_u8, 0x66_u8, 0x04_u8, 0xa4_u8,
+                0x9a_u8, 0xf0_u8, 0x8f_u8, 0xe7_u8, 0xc9_u8, 0xf5_u8, 0x71_u8, 0x56_u8, 0xc8_u8,
+                0x79_u8, 0x09_u8, 0x96_u8, 0xb2_u8, 0x0f_u8, 0x06_u8, 0xbc_u8, 0x53_u8, 0x5e_u8,
+                0x5a_u8, 0xb5_u8, 0x44_u8, 0x0d_u8, 0xf7_u8, 0xe8_u8, 0x78_u8, 0x29_u8, 0x6f_u8,
+                0xa7_u8,
+            ][..]
+        );
+
+        super::pbkdf2_hmac(
+            b"passwordPASSWORDpassword",
+            b"salt\0\0\0",
+            50,
+            MessageDigest::sha512(),
+            &mut buf,
+        )
+        .unwrap();
+        assert_eq!(
+            &buf[..],
+            &[
+                0x01_u8, 0x68_u8, 0x71_u8, 0xa4_u8, 0xc4_u8, 0xb7_u8, 0x5f_u8, 0x96_u8, 0x85_u8,
+                0x7f_u8, 0xd2_u8, 0xb9_u8, 0xf8_u8, 0xca_u8, 0x28_u8, 0x02_u8, 0x3b_u8, 0x30_u8,
+                0xee_u8, 0x2a_u8, 0x39_u8, 0xf5_u8, 0xad_u8, 0xca_u8, 0xc8_u8, 0xc9_u8, 0x37_u8,
+                0x5f_u8, 0x9b_u8, 0xda_u8, 0x1c_u8, 0xcd_u8, 0x1b_u8, 0x6f_u8, 0x0b_u8, 0x2f_u8,
+                0xc3_u8, 0xad_u8, 0xda_u8, 0x50_u8, 0x54_u8, 0x12_u8, 0xe7_u8, 0x9d_u8, 0x89_u8,
+                0x00_u8, 0x56_u8, 0xc6_u8, 0x2e_u8, 0x52_u8, 0x4c_u8, 0x7d_u8, 0x51_u8, 0x15_u8,
+                0x4b_u8, 0x1a_u8, 0x85_u8, 0x34_u8, 0x57_u8, 0x5b_u8, 0xd0_u8, 0x2d_u8, 0xee_u8,
+                0x39_u8,
+            ][..]
+        );
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn bytes_to_key() {
+        let salt = [16_u8, 34_u8, 19_u8, 23_u8, 141_u8, 4_u8, 207_u8, 221_u8];
+
+        let data = [
+            143_u8, 210_u8, 75_u8, 63_u8, 214_u8, 179_u8, 155_u8, 241_u8, 242_u8, 31_u8, 154_u8,
+            56_u8, 198_u8, 145_u8, 192_u8, 64_u8, 2_u8, 245_u8, 167_u8, 220_u8, 55_u8, 119_u8,
+            233_u8, 136_u8, 139_u8, 27_u8, 71_u8, 242_u8, 119_u8, 175_u8, 65_u8, 207_u8,
+        ];
+
+        let expected_key = vec![
+            249_u8, 115_u8, 114_u8, 97_u8, 32_u8, 213_u8, 165_u8, 146_u8, 58_u8, 87_u8, 234_u8,
+            3_u8, 43_u8, 250_u8, 97_u8, 114_u8, 26_u8, 98_u8, 245_u8, 246_u8, 238_u8, 177_u8,
+            229_u8, 161_u8, 183_u8, 224_u8, 174_u8, 3_u8, 6_u8, 244_u8, 236_u8, 255_u8,
+        ];
+        let expected_iv = vec![
+            4_u8, 223_u8, 153_u8, 219_u8, 28_u8, 142_u8, 234_u8, 68_u8, 227_u8, 69_u8, 98_u8,
+            107_u8, 208_u8, 14_u8, 236_u8, 60_u8,
+        ];
+
+        assert_eq!(
+            super::bytes_to_key(
+                Cipher::aes_256_cbc(),
+                MessageDigest::sha1(),
+                &data,
+                Some(&salt),
+                1,
+            )
+            .unwrap(),
+            super::KeyIvPair {
+                key: expected_key,
+                iv: Some(expected_iv),
+            }
+        );
+    }
+
+    #[test]
+    #[cfg(any(ossl110, boringssl))]
+    fn scrypt() {
+        let pass = "pleaseletmein";
+        let salt = "SodiumChloride";
+        let expected =
+            "7023bdcb3afd7348461c06cd81fd38ebfda8fbba904f8e3ea9b543f6545da1f2d5432955613\
+             f0fcf62d49705242a9af9e61e85dc0d651e40dfcf017b45575887";
+
+        let mut actual = [0; 64];
+        super::scrypt(
+            pass.as_bytes(),
+            salt.as_bytes(),
+            16384,
+            8,
+            1,
+            0,
+            &mut actual,
+        )
+        .unwrap();
+        assert_eq!(hex::encode(&actual[..]), expected);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/pkcs7.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/pkcs7.rs
--- 43.0.0-1/rust-vendor/openssl/src/pkcs7.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/pkcs7.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,573 @@
+use bitflags::bitflags;
+use foreign_types::{ForeignType, ForeignTypeRef};
+use libc::c_int;
+use std::mem;
+use std::ptr;
+
+use crate::asn1::Asn1ObjectRef;
+use crate::bio::{MemBio, MemBioSlice};
+use crate::error::ErrorStack;
+use crate::nid::Nid;
+use crate::pkey::{HasPrivate, PKeyRef};
+use crate::stack::{Stack, StackRef, Stackable};
+use crate::symm::Cipher;
+use crate::util::ForeignTypeRefExt;
+use crate::x509::store::X509StoreRef;
+use crate::x509::{X509Ref, X509};
+use crate::{cvt, cvt_p};
+use openssl_macros::corresponds;
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::PKCS7_SIGNER_INFO;
+    fn drop = ffi::PKCS7_SIGNER_INFO_free;
+
+    pub struct Pkcs7SignerInfo;
+    pub struct Pkcs7SignerInfoRef;
+}
+
+impl Stackable for Pkcs7SignerInfo {
+    type StackType = ffi::stack_st_PKCS7_SIGNER_INFO;
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::PKCS7;
+    fn drop = ffi::PKCS7_free;
+
+    /// A PKCS#7 structure.
+    ///
+    /// Contains signed and/or encrypted data.
+    pub struct Pkcs7;
+
+    /// Reference to `Pkcs7`
+    pub struct Pkcs7Ref;
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::PKCS7_SIGNED;
+    fn drop = ffi::PKCS7_SIGNED_free;
+
+    /// A PKCS#7 signed data structure.
+    ///
+    /// Contains signed data.
+    pub struct Pkcs7Signed;
+
+    /// Reference to `Pkcs7Signed`
+    pub struct Pkcs7SignedRef;
+}
+
+bitflags! {
+    #[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+    #[repr(transparent)]
+    pub struct Pkcs7Flags: c_int {
+        const TEXT = ffi::PKCS7_TEXT;
+        const NOCERTS = ffi::PKCS7_NOCERTS;
+        const NOSIGS = ffi::PKCS7_NOSIGS;
+        const NOCHAIN = ffi::PKCS7_NOCHAIN;
+        const NOINTERN = ffi::PKCS7_NOINTERN;
+        const NOVERIFY = ffi::PKCS7_NOVERIFY;
+        const DETACHED = ffi::PKCS7_DETACHED;
+        const BINARY = ffi::PKCS7_BINARY;
+        const NOATTR = ffi::PKCS7_NOATTR;
+        const NOSMIMECAP = ffi::PKCS7_NOSMIMECAP;
+        const NOOLDMIMETYPE = ffi::PKCS7_NOOLDMIMETYPE;
+        const CRLFEOL = ffi::PKCS7_CRLFEOL;
+        const STREAM = ffi::PKCS7_STREAM;
+        const NOCRL = ffi::PKCS7_NOCRL;
+        const PARTIAL = ffi::PKCS7_PARTIAL;
+        const REUSE_DIGEST = ffi::PKCS7_REUSE_DIGEST;
+        #[cfg(not(any(ossl101, ossl102, libressl)))]
+        const NO_DUAL_CONTENT = ffi::PKCS7_NO_DUAL_CONTENT;
+    }
+}
+
+impl Pkcs7 {
+    from_pem! {
+        /// Deserializes a PEM-encoded PKCS#7 signature
+        ///
+        /// The input should have a header of `-----BEGIN PKCS7-----`.
+        #[corresponds(PEM_read_bio_PKCS7)]
+        from_pem,
+        Pkcs7,
+        ffi::PEM_read_bio_PKCS7
+    }
+
+    from_der! {
+        /// Deserializes a DER-encoded PKCS#7 signature
+        #[corresponds(d2i_PKCS7)]
+        from_der,
+        Pkcs7,
+        ffi::d2i_PKCS7
+    }
+
+    /// Parses a message in S/MIME format.
+    ///
+    /// Returns the loaded signature, along with the cleartext message (if
+    /// available).
+    #[corresponds(SMIME_read_PKCS7)]
+    pub fn from_smime(input: &[u8]) -> Result<(Pkcs7, Option<Vec<u8>>), ErrorStack> {
+        ffi::init();
+
+        let input_bio = MemBioSlice::new(input)?;
+        let mut bcont_bio = ptr::null_mut();
+        unsafe {
+            let pkcs7 =
+                cvt_p(ffi::SMIME_read_PKCS7(input_bio.as_ptr(), &mut bcont_bio)).map(Pkcs7)?;
+            let out = if !bcont_bio.is_null() {
+                let bcont_bio = MemBio::from_ptr(bcont_bio);
+                Some(bcont_bio.get_buf().to_vec())
+            } else {
+                None
+            };
+            Ok((pkcs7, out))
+        }
+    }
+
+    /// Creates and returns a PKCS#7 `envelopedData` structure.
+    ///
+    /// `certs` is a list of recipient certificates. `input` is the content to be
+    /// encrypted. `cipher` is the symmetric cipher to use. `flags` is an optional
+    /// set of flags.
+    #[corresponds(PKCS7_encrypt)]
+    pub fn encrypt(
+        certs: &StackRef<X509>,
+        input: &[u8],
+        cipher: Cipher,
+        flags: Pkcs7Flags,
+    ) -> Result<Pkcs7, ErrorStack> {
+        let input_bio = MemBioSlice::new(input)?;
+
+        unsafe {
+            cvt_p(ffi::PKCS7_encrypt(
+                certs.as_ptr(),
+                input_bio.as_ptr(),
+                cipher.as_ptr(),
+                flags.bits(),
+            ))
+            .map(Pkcs7)
+        }
+    }
+
+    /// Creates and returns a PKCS#7 `signedData` structure.
+    ///
+    /// `signcert` is the certificate to sign with, `pkey` is the corresponding
+    /// private key. `certs` is an optional additional set of certificates to
+    /// include in the PKCS#7 structure (for example any intermediate CAs in the
+    /// chain).
+    #[corresponds(PKCS7_sign)]
+    pub fn sign<PT>(
+        signcert: &X509Ref,
+        pkey: &PKeyRef<PT>,
+        certs: &StackRef<X509>,
+        input: &[u8],
+        flags: Pkcs7Flags,
+    ) -> Result<Pkcs7, ErrorStack>
+    where
+        PT: HasPrivate,
+    {
+        let input_bio = MemBioSlice::new(input)?;
+        unsafe {
+            cvt_p(ffi::PKCS7_sign(
+                signcert.as_ptr(),
+                pkey.as_ptr(),
+                certs.as_ptr(),
+                input_bio.as_ptr(),
+                flags.bits(),
+            ))
+            .map(Pkcs7)
+        }
+    }
+}
+
+impl Pkcs7Ref {
+    /// Converts PKCS#7 structure to S/MIME format
+    #[corresponds(SMIME_write_PKCS7)]
+    pub fn to_smime(&self, input: &[u8], flags: Pkcs7Flags) -> Result<Vec<u8>, ErrorStack> {
+        let input_bio = MemBioSlice::new(input)?;
+        let output = MemBio::new()?;
+        unsafe {
+            cvt(ffi::SMIME_write_PKCS7(
+                output.as_ptr(),
+                self.as_ptr(),
+                input_bio.as_ptr(),
+                flags.bits(),
+            ))
+            .map(|_| output.get_buf().to_owned())
+        }
+    }
+
+    to_pem! {
+        /// Serializes the data into a PEM-encoded PKCS#7 structure.
+        ///
+        /// The output will have a header of `-----BEGIN PKCS7-----`.
+        #[corresponds(PEM_write_bio_PKCS7)]
+        to_pem,
+        ffi::PEM_write_bio_PKCS7
+    }
+
+    to_der! {
+        /// Serializes the data into a DER-encoded PKCS#7 structure.
+        #[corresponds(i2d_PKCS7)]
+        to_der,
+        ffi::i2d_PKCS7
+    }
+
+    /// Decrypts data using the provided private key.
+    ///
+    /// `pkey` is the recipient's private key, and `cert` is the recipient's
+    /// certificate.
+    ///
+    /// Returns the decrypted message.
+    #[corresponds(PKCS7_decrypt)]
+    pub fn decrypt<PT>(
+        &self,
+        pkey: &PKeyRef<PT>,
+        cert: &X509Ref,
+        flags: Pkcs7Flags,
+    ) -> Result<Vec<u8>, ErrorStack>
+    where
+        PT: HasPrivate,
+    {
+        let output = MemBio::new()?;
+
+        unsafe {
+            cvt(ffi::PKCS7_decrypt(
+                self.as_ptr(),
+                pkey.as_ptr(),
+                cert.as_ptr(),
+                output.as_ptr(),
+                flags.bits(),
+            ))
+            .map(|_| output.get_buf().to_owned())
+        }
+    }
+
+    /// Verifies the PKCS#7 `signedData` structure contained by `&self`.
+    ///
+    /// `certs` is a set of certificates in which to search for the signer's
+    /// certificate. `store` is a trusted certificate store (used for chain
+    /// verification). `indata` is the signed data if the content is not present
+    /// in `&self`. The content is written to `out` if it is not `None`.
+    #[corresponds(PKCS7_verify)]
+    pub fn verify(
+        &self,
+        certs: &StackRef<X509>,
+        store: &X509StoreRef,
+        indata: Option<&[u8]>,
+        out: Option<&mut Vec<u8>>,
+        flags: Pkcs7Flags,
+    ) -> Result<(), ErrorStack> {
+        let out_bio = MemBio::new()?;
+
+        let indata_bio = match indata {
+            Some(data) => Some(MemBioSlice::new(data)?),
+            None => None,
+        };
+        let indata_bio_ptr = indata_bio.as_ref().map_or(ptr::null_mut(), |p| p.as_ptr());
+
+        unsafe {
+            cvt(ffi::PKCS7_verify(
+                self.as_ptr(),
+                certs.as_ptr(),
+                store.as_ptr(),
+                indata_bio_ptr,
+                out_bio.as_ptr(),
+                flags.bits(),
+            ))
+            .map(|_| ())?
+        }
+
+        if let Some(data) = out {
+            data.clear();
+            data.extend_from_slice(out_bio.get_buf());
+        }
+
+        Ok(())
+    }
+
+    /// Retrieve the signer's certificates from the PKCS#7 structure without verifying them.
+    #[corresponds(PKCS7_get0_signers)]
+    pub fn signers(
+        &self,
+        certs: &StackRef<X509>,
+        flags: Pkcs7Flags,
+    ) -> Result<Stack<X509>, ErrorStack> {
+        unsafe {
+            let ptr = cvt_p(ffi::PKCS7_get0_signers(
+                self.as_ptr(),
+                certs.as_ptr(),
+                flags.bits(),
+            ))?;
+
+            // The returned stack is owned by the caller, but the certs inside are not! Our stack interface can't deal
+            // with that, so instead we just manually bump the refcount of the certs so that the whole stack is properly
+            // owned.
+            let stack = Stack::<X509>::from_ptr(ptr);
+            for cert in &stack {
+                mem::forget(cert.to_owned());
+            }
+
+            Ok(stack)
+        }
+    }
+
+    /// Return the type of a PKCS#7 structure as an Asn1Object
+    pub fn type_(&self) -> Option<&Asn1ObjectRef> {
+        unsafe {
+            let ptr = (*self.as_ptr()).type_;
+            Asn1ObjectRef::from_const_ptr_opt(ptr)
+        }
+    }
+
+    /// Get the signed data of a PKCS#7 structure of type PKCS7_SIGNED
+    pub fn signed(&self) -> Option<&Pkcs7SignedRef> {
+        unsafe {
+            if self.type_().map(|x| x.nid()) != Some(Nid::PKCS7_SIGNED) {
+                return None;
+            }
+            let signed_data = (*self.as_ptr()).d.sign;
+            Pkcs7SignedRef::from_const_ptr_opt(signed_data)
+        }
+    }
+}
+
+impl Pkcs7SignedRef {
+    /// Get the stack of certificates from the PKCS7_SIGNED object
+    pub fn certificates(&self) -> Option<&StackRef<X509>> {
+        unsafe {
+            self.as_ptr()
+                .as_ref()
+                .and_then(|x| x.cert.as_mut())
+                .and_then(|x| StackRef::<X509>::from_const_ptr_opt(x))
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::hash::MessageDigest;
+    use crate::nid::Nid;
+    use crate::pkcs7::{Pkcs7, Pkcs7Flags};
+    use crate::pkey::PKey;
+    use crate::stack::Stack;
+    use crate::symm::Cipher;
+    use crate::x509::store::X509StoreBuilder;
+    use crate::x509::X509;
+
+    #[test]
+    fn encrypt_decrypt_test() {
+        let cert = include_bytes!("../test/certs.pem");
+        let cert = X509::from_pem(cert).unwrap();
+        let mut certs = Stack::new().unwrap();
+        certs.push(cert.clone()).unwrap();
+        let message: String = String::from("foo");
+        let cipher = Cipher::des_ede3_cbc();
+        let flags = Pkcs7Flags::STREAM;
+        let pkey = include_bytes!("../test/key.pem");
+        let pkey = PKey::private_key_from_pem(pkey).unwrap();
+
+        let pkcs7 =
+            Pkcs7::encrypt(&certs, message.as_bytes(), cipher, flags).expect("should succeed");
+        assert_eq!(
+            pkcs7.type_().expect("PKCS7 should have a type").nid(),
+            Nid::PKCS7_ENVELOPED
+        );
+
+        let encrypted = pkcs7
+            .to_smime(message.as_bytes(), flags)
+            .expect("should succeed");
+
+        let (pkcs7_decoded, _) = Pkcs7::from_smime(encrypted.as_slice()).expect("should succeed");
+
+        let decoded = pkcs7_decoded
+            .decrypt(&pkey, &cert, Pkcs7Flags::empty())
+            .expect("should succeed");
+
+        assert_eq!(decoded, message.into_bytes());
+    }
+
+    #[test]
+    fn sign_verify_test_detached() {
+        let cert = include_bytes!("../test/cert.pem");
+        let cert = X509::from_pem(cert).unwrap();
+        let certs = Stack::new().unwrap();
+        let message = "foo";
+        let flags = Pkcs7Flags::STREAM | Pkcs7Flags::DETACHED;
+        let pkey = include_bytes!("../test/key.pem");
+        let pkey = PKey::private_key_from_pem(pkey).unwrap();
+        let mut store_builder = X509StoreBuilder::new().expect("should succeed");
+
+        let root_ca = include_bytes!("../test/root-ca.pem");
+        let root_ca = X509::from_pem(root_ca).unwrap();
+        store_builder.add_cert(root_ca).expect("should succeed");
+
+        let store = store_builder.build();
+
+        let pkcs7 =
+            Pkcs7::sign(&cert, &pkey, &certs, message.as_bytes(), flags).expect("should succeed");
+        assert_eq!(
+            pkcs7.type_().expect("PKCS7 should have a type").nid(),
+            Nid::PKCS7_SIGNED
+        );
+
+        let signed = pkcs7
+            .to_smime(message.as_bytes(), flags)
+            .expect("should succeed");
+        println!("{:?}", String::from_utf8(signed.clone()).unwrap());
+        let (pkcs7_decoded, content) =
+            Pkcs7::from_smime(signed.as_slice()).expect("should succeed");
+
+        let mut output = Vec::new();
+        pkcs7_decoded
+            .verify(
+                &certs,
+                &store,
+                Some(message.as_bytes()),
+                Some(&mut output),
+                flags,
+            )
+            .expect("should succeed");
+
+        assert_eq!(output, message.as_bytes());
+        assert_eq!(content.expect("should be non-empty"), message.as_bytes());
+    }
+
+    /// https://marc.info/?l=openbsd-cvs&m=166602943014106&w=2
+    #[test]
+    #[cfg_attr(all(libressl360, not(libressl361)), ignore)]
+    fn sign_verify_test_normal() {
+        let cert = include_bytes!("../test/cert.pem");
+        let cert = X509::from_pem(cert).unwrap();
+        let certs = Stack::new().unwrap();
+        let message = "foo";
+        let flags = Pkcs7Flags::STREAM;
+        let pkey = include_bytes!("../test/key.pem");
+        let pkey = PKey::private_key_from_pem(pkey).unwrap();
+        let mut store_builder = X509StoreBuilder::new().expect("should succeed");
+
+        let root_ca = include_bytes!("../test/root-ca.pem");
+        let root_ca = X509::from_pem(root_ca).unwrap();
+        store_builder.add_cert(root_ca).expect("should succeed");
+
+        let store = store_builder.build();
+
+        let pkcs7 =
+            Pkcs7::sign(&cert, &pkey, &certs, message.as_bytes(), flags).expect("should succeed");
+        assert_eq!(
+            pkcs7.type_().expect("PKCS7 should have a type").nid(),
+            Nid::PKCS7_SIGNED
+        );
+
+        let signed = pkcs7
+            .to_smime(message.as_bytes(), flags)
+            .expect("should succeed");
+
+        let (pkcs7_decoded, content) =
+            Pkcs7::from_smime(signed.as_slice()).expect("should succeed");
+
+        let mut output = Vec::new();
+        pkcs7_decoded
+            .verify(&certs, &store, None, Some(&mut output), flags)
+            .expect("should succeed");
+
+        assert_eq!(output, message.as_bytes());
+        assert!(content.is_none());
+    }
+
+    /// https://marc.info/?l=openbsd-cvs&m=166602943014106&w=2
+    #[test]
+    #[cfg_attr(all(libressl360, not(libressl361)), ignore)]
+    fn signers() {
+        let cert = include_bytes!("../test/cert.pem");
+        let cert = X509::from_pem(cert).unwrap();
+        let cert_digest = cert.digest(MessageDigest::sha256()).unwrap();
+        let certs = Stack::new().unwrap();
+        let message = "foo";
+        let flags = Pkcs7Flags::STREAM;
+        let pkey = include_bytes!("../test/key.pem");
+        let pkey = PKey::private_key_from_pem(pkey).unwrap();
+        let mut store_builder = X509StoreBuilder::new().expect("should succeed");
+
+        let root_ca = include_bytes!("../test/root-ca.pem");
+        let root_ca = X509::from_pem(root_ca).unwrap();
+        store_builder.add_cert(root_ca).expect("should succeed");
+
+        let pkcs7 =
+            Pkcs7::sign(&cert, &pkey, &certs, message.as_bytes(), flags).expect("should succeed");
+        assert_eq!(
+            pkcs7.type_().expect("PKCS7 should have a type").nid(),
+            Nid::PKCS7_SIGNED
+        );
+
+        let signed = pkcs7
+            .to_smime(message.as_bytes(), flags)
+            .expect("should succeed");
+
+        let (pkcs7_decoded, _) = Pkcs7::from_smime(signed.as_slice()).expect("should succeed");
+
+        let empty_certs = Stack::new().unwrap();
+        let signer_certs = pkcs7_decoded
+            .signers(&empty_certs, flags)
+            .expect("should succeed");
+        assert_eq!(empty_certs.len(), 0);
+        assert_eq!(signer_certs.len(), 1);
+        let signer_digest = signer_certs[0].digest(MessageDigest::sha256()).unwrap();
+        assert_eq!(*cert_digest, *signer_digest);
+    }
+
+    #[test]
+    fn invalid_from_smime() {
+        let input = String::from("Invalid SMIME Message");
+        let result = Pkcs7::from_smime(input.as_bytes());
+
+        assert!(result.is_err());
+    }
+
+    #[test]
+    fn signed_data_certificates() {
+        let cert = include_bytes!("../test/cert.pem");
+        let cert = X509::from_pem(cert).unwrap();
+        let mut extra_certs = Stack::<X509>::new().unwrap();
+        for cert in
+            X509::stack_from_pem(include_bytes!("../test/certs.pem")).expect("should succeed")
+        {
+            extra_certs.push(cert).expect("should succeed");
+        }
+
+        let message = "foo";
+        let flags = Pkcs7Flags::STREAM;
+        let pkey = include_bytes!("../test/key.pem");
+        let pkey = PKey::private_key_from_pem(pkey).unwrap();
+
+        let pkcs7 = Pkcs7::sign(&cert, &pkey, &extra_certs, message.as_bytes(), flags)
+            .expect("should succeed");
+        assert_eq!(
+            pkcs7.type_().expect("PKCS7 should have a type").nid(),
+            Nid::PKCS7_SIGNED
+        );
+        let signed_data_certs = pkcs7.signed().and_then(|x| x.certificates());
+        assert_eq!(signed_data_certs.expect("should succeed").len(), 3);
+    }
+
+    #[test]
+    fn signed_data_certificates_no_signed_data() {
+        let cert = include_bytes!("../test/certs.pem");
+        let cert = X509::from_pem(cert).unwrap();
+        let mut certs = Stack::new().unwrap();
+        certs.push(cert).unwrap();
+        let message: String = String::from("foo");
+        let cipher = Cipher::des_ede3_cbc();
+        let flags = Pkcs7Flags::STREAM;
+
+        // Use `Pkcs7::encrypt` since it populates the PKCS7_ENVELOPE struct rather than
+        // PKCS7_SIGNED
+        let pkcs7 =
+            Pkcs7::encrypt(&certs, message.as_bytes(), cipher, flags).expect("should succeed");
+        assert_eq!(
+            pkcs7.type_().expect("PKCS7 should have a type").nid(),
+            Nid::PKCS7_ENVELOPED
+        );
+
+        let signed_data_certs = pkcs7.signed().and_then(|x| x.certificates());
+        assert!(signed_data_certs.is_none())
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/pkey.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/pkey.rs
--- 43.0.0-1/rust-vendor/openssl/src/pkey.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/pkey.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1202 @@
+//! Public/private key processing.
+//!
+//! Asymmetric public key algorithms solve the problem of establishing and sharing
+//! secret keys to securely send and receive messages.
+//! This system uses a pair of keys: a public key, which can be freely
+//! distributed, and a private key, which is kept to oneself. An entity may
+//! encrypt information using a user's public key. The encrypted information can
+//! only be deciphered using that user's private key.
+//!
+//! This module offers support for five popular algorithms:
+//!
+//! * RSA
+//!
+//! * DSA
+//!
+//! * Diffie-Hellman
+//!
+//! * Elliptic Curves
+//!
+//! * HMAC
+//!
+//! These algorithms rely on hard mathematical problems - namely integer factorization,
+//! discrete logarithms, and elliptic curve relationships - that currently do not
+//! yield efficient solutions. This property ensures the security of these
+//! cryptographic algorithms.
+//!
+//! # Example
+//!
+//! Generate a 2048-bit RSA public/private key pair and print the public key.
+//!
+//! ```rust
+//! use openssl::rsa::Rsa;
+//! use openssl::pkey::PKey;
+//! use std::str;
+//!
+//! let rsa = Rsa::generate(2048).unwrap();
+//! let pkey = PKey::from_rsa(rsa).unwrap();
+//!
+//! let pub_key: Vec<u8> = pkey.public_key_to_pem().unwrap();
+//! println!("{:?}", str::from_utf8(pub_key.as_slice()).unwrap());
+//! ```
+#![allow(clippy::missing_safety_doc)]
+use crate::bio::{MemBio, MemBioSlice};
+#[cfg(ossl110)]
+use crate::cipher::CipherRef;
+use crate::dh::Dh;
+use crate::dsa::Dsa;
+use crate::ec::EcKey;
+use crate::error::ErrorStack;
+#[cfg(any(ossl110, boringssl, libressl370))]
+use crate::pkey_ctx::PkeyCtx;
+use crate::rsa::Rsa;
+use crate::symm::Cipher;
+use crate::util::{invoke_passwd_cb, CallbackState};
+use crate::{cvt, cvt_p};
+use cfg_if::cfg_if;
+use foreign_types::{ForeignType, ForeignTypeRef};
+use libc::{c_int, c_long};
+use openssl_macros::corresponds;
+use std::convert::{TryFrom, TryInto};
+use std::ffi::CString;
+use std::fmt;
+#[cfg(all(not(boringssl), ossl110))]
+use std::mem;
+use std::ptr;
+
+/// A tag type indicating that a key only has parameters.
+pub enum Params {}
+
+/// A tag type indicating that a key only has public components.
+pub enum Public {}
+
+/// A tag type indicating that a key has private components.
+pub enum Private {}
+
+/// An identifier of a kind of key.
+#[derive(Debug, Copy, Clone, PartialEq, Eq)]
+pub struct Id(c_int);
+
+impl Id {
+    pub const RSA: Id = Id(ffi::EVP_PKEY_RSA);
+    #[cfg(any(ossl111, libressl310, boringssl))]
+    pub const RSA_PSS: Id = Id(ffi::EVP_PKEY_RSA_PSS);
+    #[cfg(not(boringssl))]
+    pub const HMAC: Id = Id(ffi::EVP_PKEY_HMAC);
+    #[cfg(not(boringssl))]
+    pub const CMAC: Id = Id(ffi::EVP_PKEY_CMAC);
+    pub const DSA: Id = Id(ffi::EVP_PKEY_DSA);
+    pub const DH: Id = Id(ffi::EVP_PKEY_DH);
+    #[cfg(ossl110)]
+    pub const DHX: Id = Id(ffi::EVP_PKEY_DHX);
+    pub const EC: Id = Id(ffi::EVP_PKEY_EC);
+    #[cfg(ossl111)]
+    pub const SM2: Id = Id(ffi::EVP_PKEY_SM2);
+
+    #[cfg(any(ossl110, boringssl, libressl360))]
+    pub const HKDF: Id = Id(ffi::EVP_PKEY_HKDF);
+
+    #[cfg(any(ossl111, boringssl, libressl370))]
+    pub const ED25519: Id = Id(ffi::EVP_PKEY_ED25519);
+    #[cfg(ossl111)]
+    pub const ED448: Id = Id(ffi::EVP_PKEY_ED448);
+    #[cfg(any(ossl111, boringssl, libressl370))]
+    pub const X25519: Id = Id(ffi::EVP_PKEY_X25519);
+    #[cfg(ossl111)]
+    pub const X448: Id = Id(ffi::EVP_PKEY_X448);
+    #[cfg(ossl111)]
+    pub const POLY1305: Id = Id(ffi::EVP_PKEY_POLY1305);
+
+    /// Creates a `Id` from an integer representation.
+    pub fn from_raw(value: c_int) -> Id {
+        Id(value)
+    }
+
+    /// Returns the integer representation of the `Id`.
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn as_raw(&self) -> c_int {
+        self.0
+    }
+}
+
+/// A trait indicating that a key has parameters.
+pub unsafe trait HasParams {}
+
+unsafe impl HasParams for Params {}
+
+unsafe impl<T> HasParams for T where T: HasPublic {}
+
+/// A trait indicating that a key has public components.
+pub unsafe trait HasPublic {}
+
+unsafe impl HasPublic for Public {}
+
+unsafe impl<T> HasPublic for T where T: HasPrivate {}
+
+/// A trait indicating that a key has private components.
+pub unsafe trait HasPrivate {}
+
+unsafe impl HasPrivate for Private {}
+
+generic_foreign_type_and_impl_send_sync! {
+    type CType = ffi::EVP_PKEY;
+    fn drop = ffi::EVP_PKEY_free;
+
+    /// A public or private key.
+    pub struct PKey<T>;
+    /// Reference to `PKey`.
+    pub struct PKeyRef<T>;
+}
+
+impl<T> ToOwned for PKeyRef<T> {
+    type Owned = PKey<T>;
+
+    fn to_owned(&self) -> PKey<T> {
+        unsafe {
+            EVP_PKEY_up_ref(self.as_ptr());
+            PKey::from_ptr(self.as_ptr())
+        }
+    }
+}
+
+impl<T> PKeyRef<T> {
+    /// Returns a copy of the internal RSA key.
+    #[corresponds(EVP_PKEY_get1_RSA)]
+    pub fn rsa(&self) -> Result<Rsa<T>, ErrorStack> {
+        unsafe {
+            let rsa = cvt_p(ffi::EVP_PKEY_get1_RSA(self.as_ptr()))?;
+            Ok(Rsa::from_ptr(rsa))
+        }
+    }
+
+    /// Returns a copy of the internal DSA key.
+    #[corresponds(EVP_PKEY_get1_DSA)]
+    pub fn dsa(&self) -> Result<Dsa<T>, ErrorStack> {
+        unsafe {
+            let dsa = cvt_p(ffi::EVP_PKEY_get1_DSA(self.as_ptr()))?;
+            Ok(Dsa::from_ptr(dsa))
+        }
+    }
+
+    /// Returns a copy of the internal DH key.
+    #[corresponds(EVP_PKEY_get1_DH)]
+    pub fn dh(&self) -> Result<Dh<T>, ErrorStack> {
+        unsafe {
+            let dh = cvt_p(ffi::EVP_PKEY_get1_DH(self.as_ptr()))?;
+            Ok(Dh::from_ptr(dh))
+        }
+    }
+
+    /// Returns a copy of the internal elliptic curve key.
+    #[corresponds(EVP_PKEY_get1_EC_KEY)]
+    pub fn ec_key(&self) -> Result<EcKey<T>, ErrorStack> {
+        unsafe {
+            let ec_key = cvt_p(ffi::EVP_PKEY_get1_EC_KEY(self.as_ptr()))?;
+            Ok(EcKey::from_ptr(ec_key))
+        }
+    }
+
+    /// Returns the `Id` that represents the type of this key.
+    #[corresponds(EVP_PKEY_id)]
+    pub fn id(&self) -> Id {
+        unsafe { Id::from_raw(ffi::EVP_PKEY_id(self.as_ptr())) }
+    }
+
+    /// Returns the maximum size of a signature in bytes.
+    #[corresponds(EVP_PKEY_size)]
+    pub fn size(&self) -> usize {
+        unsafe { ffi::EVP_PKEY_size(self.as_ptr()) as usize }
+    }
+}
+
+impl<T> PKeyRef<T>
+where
+    T: HasPublic,
+{
+    to_pem! {
+        /// Serializes the public key into a PEM-encoded SubjectPublicKeyInfo structure.
+        ///
+        /// The output will have a header of `-----BEGIN PUBLIC KEY-----`.
+        #[corresponds(PEM_write_bio_PUBKEY)]
+        public_key_to_pem,
+        ffi::PEM_write_bio_PUBKEY
+    }
+
+    to_der! {
+        /// Serializes the public key into a DER-encoded SubjectPublicKeyInfo structure.
+        #[corresponds(i2d_PUBKEY)]
+        public_key_to_der,
+        ffi::i2d_PUBKEY
+    }
+
+    /// Returns the size of the key.
+    ///
+    /// This corresponds to the bit length of the modulus of an RSA key, and the bit length of the
+    /// group order for an elliptic curve key, for example.
+    #[corresponds(EVP_PKEY_bits)]
+    pub fn bits(&self) -> u32 {
+        unsafe { ffi::EVP_PKEY_bits(self.as_ptr()) as u32 }
+    }
+
+    ///Returns the number of security bits.
+    ///
+    ///Bits of security is defined in NIST SP800-57.
+    #[corresponds(EVP_PKEY_security_bits)]
+    #[cfg(any(ossl110, libressl360))]
+    pub fn security_bits(&self) -> u32 {
+        unsafe { ffi::EVP_PKEY_security_bits(self.as_ptr()) as u32 }
+    }
+
+    /// Compares the public component of this key with another.
+    #[corresponds(EVP_PKEY_cmp)]
+    pub fn public_eq<U>(&self, other: &PKeyRef<U>) -> bool
+    where
+        U: HasPublic,
+    {
+        let res = unsafe { ffi::EVP_PKEY_cmp(self.as_ptr(), other.as_ptr()) == 1 };
+        // Clear the stack. OpenSSL will put an error on the stack when the
+        // keys are different types in some situations.
+        let _ = ErrorStack::get();
+        res
+    }
+
+    /// Raw byte representation of a public key.
+    ///
+    /// This function only works for algorithms that support raw public keys.
+    /// Currently this is: [`Id::X25519`], [`Id::ED25519`], [`Id::X448`] or [`Id::ED448`].
+    #[corresponds(EVP_PKEY_get_raw_public_key)]
+    #[cfg(any(ossl111, boringssl, libressl370))]
+    pub fn raw_public_key(&self) -> Result<Vec<u8>, ErrorStack> {
+        unsafe {
+            let mut len = 0;
+            cvt(ffi::EVP_PKEY_get_raw_public_key(
+                self.as_ptr(),
+                ptr::null_mut(),
+                &mut len,
+            ))?;
+            let mut buf = vec![0u8; len];
+            cvt(ffi::EVP_PKEY_get_raw_public_key(
+                self.as_ptr(),
+                buf.as_mut_ptr(),
+                &mut len,
+            ))?;
+            buf.truncate(len);
+            Ok(buf)
+        }
+    }
+}
+
+impl<T> PKeyRef<T>
+where
+    T: HasPrivate,
+{
+    private_key_to_pem! {
+        /// Serializes the private key to a PEM-encoded PKCS#8 PrivateKeyInfo structure.
+        ///
+        /// The output will have a header of `-----BEGIN PRIVATE KEY-----`.
+        #[corresponds(PEM_write_bio_PKCS8PrivateKey)]
+        private_key_to_pem_pkcs8,
+        /// Serializes the private key to a PEM-encoded PKCS#8 EncryptedPrivateKeyInfo structure.
+        ///
+        /// The output will have a header of `-----BEGIN ENCRYPTED PRIVATE KEY-----`.
+        #[corresponds(PEM_write_bio_PKCS8PrivateKey)]
+        private_key_to_pem_pkcs8_passphrase,
+        ffi::PEM_write_bio_PKCS8PrivateKey
+    }
+
+    to_der! {
+        /// Serializes the private key to a DER-encoded key type specific format.
+        #[corresponds(i2d_PrivateKey)]
+        private_key_to_der,
+        ffi::i2d_PrivateKey
+    }
+
+    /// Raw byte representation of a private key.
+    ///
+    /// This function only works for algorithms that support raw private keys.
+    /// Currently this is: [`Id::HMAC`], [`Id::X25519`], [`Id::ED25519`], [`Id::X448`] or [`Id::ED448`].
+    #[corresponds(EVP_PKEY_get_raw_private_key)]
+    #[cfg(any(ossl111, boringssl, libressl370))]
+    pub fn raw_private_key(&self) -> Result<Vec<u8>, ErrorStack> {
+        unsafe {
+            let mut len = 0;
+            cvt(ffi::EVP_PKEY_get_raw_private_key(
+                self.as_ptr(),
+                ptr::null_mut(),
+                &mut len,
+            ))?;
+            let mut buf = vec![0u8; len];
+            cvt(ffi::EVP_PKEY_get_raw_private_key(
+                self.as_ptr(),
+                buf.as_mut_ptr(),
+                &mut len,
+            ))?;
+            buf.truncate(len);
+            Ok(buf)
+        }
+    }
+
+    /// Serializes a private key into an unencrypted DER-formatted PKCS#8
+    #[corresponds(i2d_PKCS8PrivateKey_bio)]
+    pub fn private_key_to_pkcs8(&self) -> Result<Vec<u8>, ErrorStack> {
+        unsafe {
+            let bio = MemBio::new()?;
+            cvt(ffi::i2d_PKCS8PrivateKey_bio(
+                bio.as_ptr(),
+                self.as_ptr(),
+                ptr::null(),
+                ptr::null_mut(),
+                0,
+                None,
+                ptr::null_mut(),
+            ))?;
+
+            Ok(bio.get_buf().to_owned())
+        }
+    }
+
+    /// Serializes a private key into a DER-formatted PKCS#8, using the supplied password to
+    /// encrypt the key.
+    #[corresponds(i2d_PKCS8PrivateKey_bio)]
+    pub fn private_key_to_pkcs8_passphrase(
+        &self,
+        cipher: Cipher,
+        passphrase: &[u8],
+    ) -> Result<Vec<u8>, ErrorStack> {
+        unsafe {
+            let bio = MemBio::new()?;
+            cvt(ffi::i2d_PKCS8PrivateKey_bio(
+                bio.as_ptr(),
+                self.as_ptr(),
+                cipher.as_ptr(),
+                passphrase.as_ptr() as *const _ as *mut _,
+                passphrase.len().try_into().unwrap(),
+                None,
+                ptr::null_mut(),
+            ))?;
+
+            Ok(bio.get_buf().to_owned())
+        }
+    }
+}
+
+impl<T> fmt::Debug for PKey<T> {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
+        let alg = match self.id() {
+            Id::RSA => "RSA",
+            #[cfg(not(boringssl))]
+            Id::HMAC => "HMAC",
+            Id::DSA => "DSA",
+            Id::DH => "DH",
+            Id::EC => "EC",
+            #[cfg(ossl111)]
+            Id::ED25519 => "Ed25519",
+            #[cfg(ossl111)]
+            Id::ED448 => "Ed448",
+            _ => "unknown",
+        };
+        fmt.debug_struct("PKey").field("algorithm", &alg).finish()
+        // TODO: Print details for each specific type of key
+    }
+}
+
+impl<T> Clone for PKey<T> {
+    fn clone(&self) -> PKey<T> {
+        PKeyRef::to_owned(self)
+    }
+}
+
+impl<T> PKey<T> {
+    /// Creates a new `PKey` containing an RSA key.
+    #[corresponds(EVP_PKEY_set1_RSA)]
+    pub fn from_rsa(rsa: Rsa<T>) -> Result<PKey<T>, ErrorStack> {
+        // TODO: Next time we make backwards incompatible changes, this could
+        // become an `&RsaRef<T>`. Same for all the other `from_*` methods.
+        unsafe {
+            let evp = cvt_p(ffi::EVP_PKEY_new())?;
+            let pkey = PKey::from_ptr(evp);
+            cvt(ffi::EVP_PKEY_set1_RSA(pkey.0, rsa.as_ptr()))?;
+            Ok(pkey)
+        }
+    }
+
+    /// Creates a new `PKey` containing a DSA key.
+    #[corresponds(EVP_PKEY_set1_DSA)]
+    pub fn from_dsa(dsa: Dsa<T>) -> Result<PKey<T>, ErrorStack> {
+        unsafe {
+            let evp = cvt_p(ffi::EVP_PKEY_new())?;
+            let pkey = PKey::from_ptr(evp);
+            cvt(ffi::EVP_PKEY_set1_DSA(pkey.0, dsa.as_ptr()))?;
+            Ok(pkey)
+        }
+    }
+
+    /// Creates a new `PKey` containing a Diffie-Hellman key.
+    #[corresponds(EVP_PKEY_set1_DH)]
+    #[cfg(not(boringssl))]
+    pub fn from_dh(dh: Dh<T>) -> Result<PKey<T>, ErrorStack> {
+        unsafe {
+            let evp = cvt_p(ffi::EVP_PKEY_new())?;
+            let pkey = PKey::from_ptr(evp);
+            cvt(ffi::EVP_PKEY_set1_DH(pkey.0, dh.as_ptr()))?;
+            Ok(pkey)
+        }
+    }
+
+    /// Creates a new `PKey` containing a Diffie-Hellman key with type DHX.
+    #[cfg(all(not(boringssl), ossl110))]
+    pub fn from_dhx(dh: Dh<T>) -> Result<PKey<T>, ErrorStack> {
+        unsafe {
+            let evp = cvt_p(ffi::EVP_PKEY_new())?;
+            let pkey = PKey::from_ptr(evp);
+            cvt(ffi::EVP_PKEY_assign(
+                pkey.0,
+                ffi::EVP_PKEY_DHX,
+                dh.as_ptr().cast(),
+            ))?;
+            mem::forget(dh);
+            Ok(pkey)
+        }
+    }
+
+    /// Creates a new `PKey` containing an elliptic curve key.
+    #[corresponds(EVP_PKEY_set1_EC_KEY)]
+    pub fn from_ec_key(ec_key: EcKey<T>) -> Result<PKey<T>, ErrorStack> {
+        unsafe {
+            let evp = cvt_p(ffi::EVP_PKEY_new())?;
+            let pkey = PKey::from_ptr(evp);
+            cvt(ffi::EVP_PKEY_set1_EC_KEY(pkey.0, ec_key.as_ptr()))?;
+            Ok(pkey)
+        }
+    }
+}
+
+impl PKey<Private> {
+    /// Creates a new `PKey` containing an HMAC key.
+    ///
+    /// # Note
+    ///
+    /// To compute HMAC values, use the `sign` module.
+    #[corresponds(EVP_PKEY_new_mac_key)]
+    #[cfg(not(boringssl))]
+    pub fn hmac(key: &[u8]) -> Result<PKey<Private>, ErrorStack> {
+        unsafe {
+            assert!(key.len() <= c_int::MAX as usize);
+            let key = cvt_p(ffi::EVP_PKEY_new_mac_key(
+                ffi::EVP_PKEY_HMAC,
+                ptr::null_mut(),
+                key.as_ptr() as *const _,
+                key.len() as c_int,
+            ))?;
+            Ok(PKey::from_ptr(key))
+        }
+    }
+
+    /// Creates a new `PKey` containing a CMAC key.
+    ///
+    /// Requires OpenSSL 1.1.0 or newer.
+    ///
+    /// # Note
+    ///
+    /// To compute CMAC values, use the `sign` module.
+    #[cfg(all(not(boringssl), ossl110))]
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn cmac(cipher: &Cipher, key: &[u8]) -> Result<PKey<Private>, ErrorStack> {
+        let mut ctx = PkeyCtx::new_id(Id::CMAC)?;
+        ctx.keygen_init()?;
+        ctx.set_keygen_cipher(unsafe { CipherRef::from_ptr(cipher.as_ptr() as *mut _) })?;
+        ctx.set_keygen_mac_key(key)?;
+        ctx.keygen()
+    }
+
+    #[cfg(any(ossl111, boringssl, libressl370))]
+    fn generate_eddsa(id: Id) -> Result<PKey<Private>, ErrorStack> {
+        let mut ctx = PkeyCtx::new_id(id)?;
+        ctx.keygen_init()?;
+        ctx.keygen()
+    }
+
+    /// Generates a new private X25519 key.
+    ///
+    /// To import a private key from raw bytes see [`PKey::private_key_from_raw_bytes`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # fn main() -> Result<(), Box<dyn std::error::Error>> {
+    /// use openssl::pkey::{PKey, Id};
+    /// use openssl::derive::Deriver;
+    ///
+    /// let public = // ...
+    /// # &PKey::generate_x25519()?.raw_public_key()?;
+    /// let public_key = PKey::public_key_from_raw_bytes(public, Id::X25519)?;
+    ///
+    /// let key = PKey::generate_x25519()?;
+    /// let mut deriver = Deriver::new(&key)?;
+    /// deriver.set_peer(&public_key)?;
+    ///
+    /// let secret = deriver.derive_to_vec()?;
+    /// assert_eq!(secret.len(), 32);
+    /// # Ok(()) }
+    /// ```
+    #[cfg(any(ossl111, boringssl, libressl370))]
+    pub fn generate_x25519() -> Result<PKey<Private>, ErrorStack> {
+        PKey::generate_eddsa(Id::X25519)
+    }
+
+    /// Generates a new private X448 key.
+    ///
+    /// To import a private key from raw bytes see [`PKey::private_key_from_raw_bytes`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # fn main() -> Result<(), Box<dyn std::error::Error>> {
+    /// use openssl::pkey::{PKey, Id};
+    /// use openssl::derive::Deriver;
+    ///
+    /// let public = // ...
+    /// # &PKey::generate_x448()?.raw_public_key()?;
+    /// let public_key = PKey::public_key_from_raw_bytes(public, Id::X448)?;
+    ///
+    /// let key = PKey::generate_x448()?;
+    /// let mut deriver = Deriver::new(&key)?;
+    /// deriver.set_peer(&public_key)?;
+    ///
+    /// let secret = deriver.derive_to_vec()?;
+    /// assert_eq!(secret.len(), 56);
+    /// # Ok(()) }
+    /// ```
+    #[cfg(ossl111)]
+    pub fn generate_x448() -> Result<PKey<Private>, ErrorStack> {
+        PKey::generate_eddsa(Id::X448)
+    }
+
+    /// Generates a new private Ed25519 key.
+    ///
+    /// To import a private key from raw bytes see [`PKey::private_key_from_raw_bytes`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # fn main() -> Result<(), Box<dyn std::error::Error>> {
+    /// use openssl::pkey::{PKey, Id};
+    /// use openssl::sign::Signer;
+    ///
+    /// let key = PKey::generate_ed25519()?;
+    /// let public_key = key.raw_public_key()?;
+    ///
+    /// let mut signer = Signer::new_without_digest(&key)?;
+    /// let digest = // ...
+    /// # &vec![0; 32];
+    /// let signature = signer.sign_oneshot_to_vec(digest)?;
+    /// assert_eq!(signature.len(), 64);
+    /// # Ok(()) }
+    /// ```
+    #[cfg(any(ossl111, boringssl, libressl370))]
+    pub fn generate_ed25519() -> Result<PKey<Private>, ErrorStack> {
+        PKey::generate_eddsa(Id::ED25519)
+    }
+
+    /// Generates a new private Ed448 key.
+    ///
+    /// To import a private key from raw bytes see [`PKey::private_key_from_raw_bytes`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # fn main() -> Result<(), Box<dyn std::error::Error>> {
+    /// use openssl::pkey::{PKey, Id};
+    /// use openssl::sign::Signer;
+    ///
+    /// let key = PKey::generate_ed448()?;
+    /// let public_key = key.raw_public_key()?;
+    ///
+    /// let mut signer = Signer::new_without_digest(&key)?;
+    /// let digest = // ...
+    /// # &vec![0; 32];
+    /// let signature = signer.sign_oneshot_to_vec(digest)?;
+    /// assert_eq!(signature.len(), 114);
+    /// # Ok(()) }
+    /// ```
+    #[cfg(ossl111)]
+    pub fn generate_ed448() -> Result<PKey<Private>, ErrorStack> {
+        PKey::generate_eddsa(Id::ED448)
+    }
+
+    /// Generates a new EC key using the provided curve.
+    ///
+    /// Requires OpenSSL 3.0.0 or newer.
+    #[corresponds(EVP_EC_gen)]
+    #[cfg(ossl300)]
+    pub fn ec_gen(curve: &str) -> Result<PKey<Private>, ErrorStack> {
+        ffi::init();
+
+        let curve = CString::new(curve).unwrap();
+        unsafe {
+            let ptr = cvt_p(ffi::EVP_EC_gen(curve.as_ptr()))?;
+            Ok(PKey::from_ptr(ptr))
+        }
+    }
+
+    private_key_from_pem! {
+        /// Deserializes a private key from a PEM-encoded key type specific format.
+        #[corresponds(PEM_read_bio_PrivateKey)]
+        private_key_from_pem,
+
+        /// Deserializes a private key from a PEM-encoded encrypted key type specific format.
+        #[corresponds(PEM_read_bio_PrivateKey)]
+        private_key_from_pem_passphrase,
+
+        /// Deserializes a private key from a PEM-encoded encrypted key type specific format.
+        ///
+        /// The callback should fill the password into the provided buffer and return its length.
+        #[corresponds(PEM_read_bio_PrivateKey)]
+        private_key_from_pem_callback,
+        PKey<Private>,
+        ffi::PEM_read_bio_PrivateKey
+    }
+
+    from_der! {
+        /// Decodes a DER-encoded private key.
+        ///
+        /// This function will attempt to automatically detect the underlying key format, and
+        /// supports the unencrypted PKCS#8 PrivateKeyInfo structures as well as key type specific
+        /// formats.
+        #[corresponds(d2i_AutoPrivateKey)]
+        private_key_from_der,
+        PKey<Private>,
+        ffi::d2i_AutoPrivateKey
+    }
+
+    /// Deserializes a DER-formatted PKCS#8 unencrypted private key.
+    ///
+    /// This method is mainly for interoperability reasons. Encrypted keyfiles should be preferred.
+    pub fn private_key_from_pkcs8(der: &[u8]) -> Result<PKey<Private>, ErrorStack> {
+        unsafe {
+            ffi::init();
+            let len = der.len().min(c_long::MAX as usize) as c_long;
+            let p8inf = cvt_p(ffi::d2i_PKCS8_PRIV_KEY_INFO(
+                ptr::null_mut(),
+                &mut der.as_ptr(),
+                len,
+            ))?;
+            let res = cvt_p(ffi::EVP_PKCS82PKEY(p8inf)).map(|p| PKey::from_ptr(p));
+            ffi::PKCS8_PRIV_KEY_INFO_free(p8inf);
+            res
+        }
+    }
+
+    /// Deserializes a DER-formatted PKCS#8 private key, using a callback to retrieve the password
+    /// if the key is encrypted.
+    ///
+    /// The callback should copy the password into the provided buffer and return the number of
+    /// bytes written.
+    #[corresponds(d2i_PKCS8PrivateKey_bio)]
+    pub fn private_key_from_pkcs8_callback<F>(
+        der: &[u8],
+        callback: F,
+    ) -> Result<PKey<Private>, ErrorStack>
+    where
+        F: FnOnce(&mut [u8]) -> Result<usize, ErrorStack>,
+    {
+        unsafe {
+            ffi::init();
+            let mut cb = CallbackState::new(callback);
+            let bio = MemBioSlice::new(der)?;
+            cvt_p(ffi::d2i_PKCS8PrivateKey_bio(
+                bio.as_ptr(),
+                ptr::null_mut(),
+                Some(invoke_passwd_cb::<F>),
+                &mut cb as *mut _ as *mut _,
+            ))
+            .map(|p| PKey::from_ptr(p))
+        }
+    }
+
+    /// Deserializes a DER-formatted PKCS#8 private key, using the supplied password if the key is
+    /// encrypted.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `passphrase` contains an embedded null.
+    #[corresponds(d2i_PKCS8PrivateKey_bio)]
+    pub fn private_key_from_pkcs8_passphrase(
+        der: &[u8],
+        passphrase: &[u8],
+    ) -> Result<PKey<Private>, ErrorStack> {
+        unsafe {
+            ffi::init();
+            let bio = MemBioSlice::new(der)?;
+            let passphrase = CString::new(passphrase).unwrap();
+            cvt_p(ffi::d2i_PKCS8PrivateKey_bio(
+                bio.as_ptr(),
+                ptr::null_mut(),
+                None,
+                passphrase.as_ptr() as *const _ as *mut _,
+            ))
+            .map(|p| PKey::from_ptr(p))
+        }
+    }
+
+    /// Creates a private key from its raw byte representation
+    ///
+    /// Algorithm types that support raw private keys are HMAC, X25519, ED25519, X448 or ED448
+    #[corresponds(EVP_PKEY_new_raw_private_key)]
+    #[cfg(any(ossl111, boringssl, libressl370))]
+    pub fn private_key_from_raw_bytes(
+        bytes: &[u8],
+        key_type: Id,
+    ) -> Result<PKey<Private>, ErrorStack> {
+        unsafe {
+            ffi::init();
+            cvt_p(ffi::EVP_PKEY_new_raw_private_key(
+                key_type.as_raw(),
+                ptr::null_mut(),
+                bytes.as_ptr(),
+                bytes.len(),
+            ))
+            .map(|p| PKey::from_ptr(p))
+        }
+    }
+}
+
+impl PKey<Public> {
+    private_key_from_pem! {
+        /// Decodes a PEM-encoded SubjectPublicKeyInfo structure.
+        ///
+        /// The input should have a header of `-----BEGIN PUBLIC KEY-----`.
+        #[corresponds(PEM_read_bio_PUBKEY)]
+        public_key_from_pem,
+
+        /// Decodes a PEM-encoded SubjectPublicKeyInfo structure.
+        #[corresponds(PEM_read_bio_PUBKEY)]
+        public_key_from_pem_passphrase,
+
+        /// Decodes a PEM-encoded SubjectPublicKeyInfo structure.
+        ///
+        /// The callback should fill the password into the provided buffer and return its length.
+        #[corresponds(PEM_read_bio_PrivateKey)]
+        public_key_from_pem_callback,
+        PKey<Public>,
+        ffi::PEM_read_bio_PUBKEY
+    }
+
+    from_der! {
+        /// Decodes a DER-encoded SubjectPublicKeyInfo structure.
+        #[corresponds(d2i_PUBKEY)]
+        public_key_from_der,
+        PKey<Public>,
+        ffi::d2i_PUBKEY
+    }
+
+    /// Creates a public key from its raw byte representation
+    ///
+    /// Algorithm types that support raw public keys are X25519, ED25519, X448 or ED448
+    #[corresponds(EVP_PKEY_new_raw_public_key)]
+    #[cfg(any(ossl111, boringssl, libressl370))]
+    pub fn public_key_from_raw_bytes(
+        bytes: &[u8],
+        key_type: Id,
+    ) -> Result<PKey<Public>, ErrorStack> {
+        unsafe {
+            ffi::init();
+            cvt_p(ffi::EVP_PKEY_new_raw_public_key(
+                key_type.as_raw(),
+                ptr::null_mut(),
+                bytes.as_ptr(),
+                bytes.len(),
+            ))
+            .map(|p| PKey::from_ptr(p))
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(boringssl, ossl110, libressl270))] {
+        use ffi::EVP_PKEY_up_ref;
+    } else {
+        #[allow(bad_style)]
+        unsafe extern "C" fn EVP_PKEY_up_ref(pkey: *mut ffi::EVP_PKEY) {
+            ffi::CRYPTO_add_lock(
+                &mut (*pkey).references,
+                1,
+                ffi::CRYPTO_LOCK_EVP_PKEY,
+                "pkey.rs\0".as_ptr() as *const _,
+                line!() as c_int,
+            );
+        }
+    }
+}
+
+impl<T> TryFrom<EcKey<T>> for PKey<T> {
+    type Error = ErrorStack;
+
+    fn try_from(ec_key: EcKey<T>) -> Result<PKey<T>, ErrorStack> {
+        PKey::from_ec_key(ec_key)
+    }
+}
+
+impl<T> TryFrom<PKey<T>> for EcKey<T> {
+    type Error = ErrorStack;
+
+    fn try_from(pkey: PKey<T>) -> Result<EcKey<T>, ErrorStack> {
+        pkey.ec_key()
+    }
+}
+
+impl<T> TryFrom<Rsa<T>> for PKey<T> {
+    type Error = ErrorStack;
+
+    fn try_from(rsa: Rsa<T>) -> Result<PKey<T>, ErrorStack> {
+        PKey::from_rsa(rsa)
+    }
+}
+
+impl<T> TryFrom<PKey<T>> for Rsa<T> {
+    type Error = ErrorStack;
+
+    fn try_from(pkey: PKey<T>) -> Result<Rsa<T>, ErrorStack> {
+        pkey.rsa()
+    }
+}
+
+impl<T> TryFrom<Dsa<T>> for PKey<T> {
+    type Error = ErrorStack;
+
+    fn try_from(dsa: Dsa<T>) -> Result<PKey<T>, ErrorStack> {
+        PKey::from_dsa(dsa)
+    }
+}
+
+impl<T> TryFrom<PKey<T>> for Dsa<T> {
+    type Error = ErrorStack;
+
+    fn try_from(pkey: PKey<T>) -> Result<Dsa<T>, ErrorStack> {
+        pkey.dsa()
+    }
+}
+
+#[cfg(not(boringssl))]
+impl<T> TryFrom<Dh<T>> for PKey<T> {
+    type Error = ErrorStack;
+
+    fn try_from(dh: Dh<T>) -> Result<PKey<T>, ErrorStack> {
+        PKey::from_dh(dh)
+    }
+}
+
+impl<T> TryFrom<PKey<T>> for Dh<T> {
+    type Error = ErrorStack;
+
+    fn try_from(pkey: PKey<T>) -> Result<Dh<T>, ErrorStack> {
+        pkey.dh()
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use std::convert::TryInto;
+
+    #[cfg(not(boringssl))]
+    use crate::dh::Dh;
+    use crate::dsa::Dsa;
+    use crate::ec::EcKey;
+    use crate::error::Error;
+    use crate::nid::Nid;
+    use crate::rsa::Rsa;
+    use crate::symm::Cipher;
+
+    use super::*;
+
+    #[cfg(ossl111)]
+    use crate::rand::rand_bytes;
+
+    #[test]
+    fn test_to_password() {
+        let rsa = Rsa::generate(2048).unwrap();
+        let pkey = PKey::from_rsa(rsa).unwrap();
+        let pem = pkey
+            .private_key_to_pem_pkcs8_passphrase(Cipher::aes_128_cbc(), b"foobar")
+            .unwrap();
+        PKey::private_key_from_pem_passphrase(&pem, b"foobar").unwrap();
+        assert!(PKey::private_key_from_pem_passphrase(&pem, b"fizzbuzz").is_err());
+    }
+
+    #[test]
+    fn test_unencrypted_pkcs8() {
+        let key = include_bytes!("../test/pkcs8-nocrypt.der");
+        let pkey = PKey::private_key_from_pkcs8(key).unwrap();
+        let serialized = pkey.private_key_to_pkcs8().unwrap();
+        let pkey2 = PKey::private_key_from_pkcs8(&serialized).unwrap();
+
+        assert_eq!(
+            pkey2.private_key_to_der().unwrap(),
+            pkey.private_key_to_der().unwrap()
+        );
+    }
+
+    #[test]
+    fn test_encrypted_pkcs8_passphrase() {
+        let key = include_bytes!("../test/pkcs8.der");
+        PKey::private_key_from_pkcs8_passphrase(key, b"mypass").unwrap();
+
+        let rsa = Rsa::generate(2048).unwrap();
+        let pkey = PKey::from_rsa(rsa).unwrap();
+        let der = pkey
+            .private_key_to_pkcs8_passphrase(Cipher::aes_128_cbc(), b"mypass")
+            .unwrap();
+        let pkey2 = PKey::private_key_from_pkcs8_passphrase(&der, b"mypass").unwrap();
+        assert_eq!(
+            pkey.private_key_to_der().unwrap(),
+            pkey2.private_key_to_der().unwrap()
+        );
+    }
+
+    #[test]
+    fn test_encrypted_pkcs8_callback() {
+        let mut password_queried = false;
+        let key = include_bytes!("../test/pkcs8.der");
+        PKey::private_key_from_pkcs8_callback(key, |password| {
+            password_queried = true;
+            password[..6].copy_from_slice(b"mypass");
+            Ok(6)
+        })
+        .unwrap();
+        assert!(password_queried);
+    }
+
+    #[test]
+    fn test_private_key_from_pem() {
+        let key = include_bytes!("../test/key.pem");
+        PKey::private_key_from_pem(key).unwrap();
+    }
+
+    #[test]
+    fn test_public_key_from_pem() {
+        let key = include_bytes!("../test/key.pem.pub");
+        PKey::public_key_from_pem(key).unwrap();
+    }
+
+    #[test]
+    fn test_public_key_from_der() {
+        let key = include_bytes!("../test/key.der.pub");
+        PKey::public_key_from_der(key).unwrap();
+    }
+
+    #[test]
+    fn test_private_key_from_der() {
+        let key = include_bytes!("../test/key.der");
+        PKey::private_key_from_der(key).unwrap();
+    }
+
+    #[test]
+    fn test_pem() {
+        let key = include_bytes!("../test/key.pem");
+        let key = PKey::private_key_from_pem(key).unwrap();
+
+        let priv_key = key.private_key_to_pem_pkcs8().unwrap();
+        let pub_key = key.public_key_to_pem().unwrap();
+
+        // As a super-simple verification, just check that the buffers contain
+        // the `PRIVATE KEY` or `PUBLIC KEY` strings.
+        assert!(priv_key.windows(11).any(|s| s == b"PRIVATE KEY"));
+        assert!(pub_key.windows(10).any(|s| s == b"PUBLIC KEY"));
+    }
+
+    #[test]
+    fn test_rsa_accessor() {
+        let rsa = Rsa::generate(2048).unwrap();
+        let pkey = PKey::from_rsa(rsa).unwrap();
+        pkey.rsa().unwrap();
+        assert_eq!(pkey.id(), Id::RSA);
+        assert!(pkey.dsa().is_err());
+    }
+
+    #[test]
+    fn test_dsa_accessor() {
+        let dsa = Dsa::generate(2048).unwrap();
+        let pkey = PKey::from_dsa(dsa).unwrap();
+        pkey.dsa().unwrap();
+        assert_eq!(pkey.id(), Id::DSA);
+        assert!(pkey.rsa().is_err());
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn test_dh_accessor() {
+        let dh = include_bytes!("../test/dhparams.pem");
+        let dh = Dh::params_from_pem(dh).unwrap();
+        let pkey = PKey::from_dh(dh).unwrap();
+        pkey.dh().unwrap();
+        assert_eq!(pkey.id(), Id::DH);
+        assert!(pkey.rsa().is_err());
+    }
+
+    #[test]
+    fn test_ec_key_accessor() {
+        let ec_key = EcKey::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let pkey = PKey::from_ec_key(ec_key).unwrap();
+        pkey.ec_key().unwrap();
+        assert_eq!(pkey.id(), Id::EC);
+        assert!(pkey.rsa().is_err());
+    }
+
+    #[test]
+    fn test_rsa_conversion() {
+        let rsa = Rsa::generate(2048).unwrap();
+        let pkey: PKey<Private> = rsa.clone().try_into().unwrap();
+        let rsa_: Rsa<Private> = pkey.try_into().unwrap();
+        // Eq is missing
+        assert_eq!(rsa.p(), rsa_.p());
+        assert_eq!(rsa.q(), rsa_.q());
+    }
+
+    #[test]
+    fn test_dsa_conversion() {
+        let dsa = Dsa::generate(2048).unwrap();
+        let pkey: PKey<Private> = dsa.clone().try_into().unwrap();
+        let dsa_: Dsa<Private> = pkey.try_into().unwrap();
+        // Eq is missing
+        assert_eq!(dsa.priv_key(), dsa_.priv_key());
+    }
+
+    #[test]
+    fn test_ec_key_conversion() {
+        let group = crate::ec::EcGroup::from_curve_name(crate::nid::Nid::X9_62_PRIME256V1).unwrap();
+        let ec_key = EcKey::generate(&group).unwrap();
+        let pkey: PKey<Private> = ec_key.clone().try_into().unwrap();
+        let ec_key_: EcKey<Private> = pkey.try_into().unwrap();
+        // Eq is missing
+        assert_eq!(ec_key.private_key(), ec_key_.private_key());
+    }
+
+    #[test]
+    #[cfg(any(ossl110, libressl360))]
+    fn test_security_bits() {
+        let group = crate::ec::EcGroup::from_curve_name(crate::nid::Nid::SECP521R1).unwrap();
+        let ec_key = EcKey::generate(&group).unwrap();
+        let pkey: PKey<Private> = ec_key.try_into().unwrap();
+
+        assert_eq!(pkey.security_bits(), 256);
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn test_dh_conversion() {
+        let dh_params = include_bytes!("../test/dhparams.pem");
+        let dh_params = Dh::params_from_pem(dh_params).unwrap();
+        let dh = dh_params.generate_key().unwrap();
+
+        // Clone is missing for Dh, save the parameters
+        let p = dh.prime_p().to_owned().unwrap();
+        let q = dh.prime_q().map(|q| q.to_owned().unwrap());
+        let g = dh.generator().to_owned().unwrap();
+
+        let pkey: PKey<Private> = dh.try_into().unwrap();
+        let dh_: Dh<Private> = pkey.try_into().unwrap();
+
+        // Eq is missing
+        assert_eq!(&p, dh_.prime_p());
+        assert_eq!(q, dh_.prime_q().map(|q| q.to_owned().unwrap()));
+        assert_eq!(&g, dh_.generator());
+    }
+
+    #[cfg(any(ossl111, boringssl, libressl370))]
+    fn test_raw_public_key(gen: fn() -> Result<PKey<Private>, ErrorStack>, key_type: Id) {
+        // Generate a new key
+        let key = gen().unwrap();
+
+        // Get the raw bytes, and create a new key from the raw bytes
+        let raw = key.raw_public_key().unwrap();
+        let from_raw = PKey::public_key_from_raw_bytes(&raw, key_type).unwrap();
+
+        // Compare the der encoding of the original and raw / restored public key
+        assert_eq!(
+            key.public_key_to_der().unwrap(),
+            from_raw.public_key_to_der().unwrap()
+        );
+    }
+
+    #[cfg(any(ossl111, boringssl, libressl370))]
+    fn test_raw_private_key(gen: fn() -> Result<PKey<Private>, ErrorStack>, key_type: Id) {
+        // Generate a new key
+        let key = gen().unwrap();
+
+        // Get the raw bytes, and create a new key from the raw bytes
+        let raw = key.raw_private_key().unwrap();
+        let from_raw = PKey::private_key_from_raw_bytes(&raw, key_type).unwrap();
+
+        // Compare the der encoding of the original and raw / restored public key
+        assert_eq!(
+            key.private_key_to_pkcs8().unwrap(),
+            from_raw.private_key_to_pkcs8().unwrap()
+        );
+    }
+
+    #[cfg(any(ossl111, boringssl, libressl370))]
+    #[test]
+    fn test_raw_public_key_bytes() {
+        test_raw_public_key(PKey::generate_x25519, Id::X25519);
+        test_raw_public_key(PKey::generate_ed25519, Id::ED25519);
+        #[cfg(all(not(boringssl), not(libressl370)))]
+        test_raw_public_key(PKey::generate_x448, Id::X448);
+        #[cfg(all(not(boringssl), not(libressl370)))]
+        test_raw_public_key(PKey::generate_ed448, Id::ED448);
+    }
+
+    #[cfg(any(ossl111, boringssl, libressl370))]
+    #[test]
+    fn test_raw_private_key_bytes() {
+        test_raw_private_key(PKey::generate_x25519, Id::X25519);
+        test_raw_private_key(PKey::generate_ed25519, Id::ED25519);
+        #[cfg(all(not(boringssl), not(libressl370)))]
+        test_raw_private_key(PKey::generate_x448, Id::X448);
+        #[cfg(all(not(boringssl), not(libressl370)))]
+        test_raw_private_key(PKey::generate_ed448, Id::ED448);
+    }
+
+    #[cfg(ossl111)]
+    #[test]
+    fn test_raw_hmac() {
+        let mut test_bytes = vec![0u8; 32];
+        rand_bytes(&mut test_bytes).unwrap();
+
+        let hmac_key = PKey::hmac(&test_bytes).unwrap();
+        assert!(hmac_key.raw_public_key().is_err());
+
+        let key_bytes = hmac_key.raw_private_key().unwrap();
+        assert_eq!(key_bytes, test_bytes);
+    }
+
+    #[cfg(ossl111)]
+    #[test]
+    fn test_raw_key_fail() {
+        // Getting a raw byte representation will not work with Nist curves
+        let group = crate::ec::EcGroup::from_curve_name(Nid::SECP256K1).unwrap();
+        let ec_key = EcKey::generate(&group).unwrap();
+        let pkey = PKey::from_ec_key(ec_key).unwrap();
+        assert!(pkey.raw_private_key().is_err());
+        assert!(pkey.raw_public_key().is_err());
+    }
+
+    #[cfg(ossl300)]
+    #[test]
+    fn test_ec_gen() {
+        let key = PKey::ec_gen("prime256v1").unwrap();
+        assert!(key.ec_key().is_ok());
+    }
+
+    #[test]
+    fn test_public_eq() {
+        let rsa = Rsa::generate(2048).unwrap();
+        let pkey1 = PKey::from_rsa(rsa).unwrap();
+
+        let group = crate::ec::EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let ec_key = EcKey::generate(&group).unwrap();
+        let pkey2 = PKey::from_ec_key(ec_key).unwrap();
+
+        assert!(!pkey1.public_eq(&pkey2));
+        assert!(Error::get().is_none());
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/pkey_ctx.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/pkey_ctx.rs
--- 43.0.0-1/rust-vendor/openssl/src/pkey_ctx.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/pkey_ctx.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1110 @@
+//! The asymmetric encryption context.
+//!
+//! # Examples
+//!
+//! Encrypt data with RSA
+//!
+//! ```
+//! use openssl::rsa::Rsa;
+//! use openssl::pkey::PKey;
+//! use openssl::pkey_ctx::PkeyCtx;
+//!
+//! let key = Rsa::generate(4096).unwrap();
+//! let key = PKey::from_rsa(key).unwrap();
+//!
+//! let mut ctx = PkeyCtx::new(&key).unwrap();
+//! ctx.encrypt_init().unwrap();
+//!
+//! let data = b"Some Crypto Text";
+//! let mut ciphertext = vec![];
+//! ctx.encrypt_to_vec(data, &mut ciphertext).unwrap();
+//! ```
+
+#![cfg_attr(
+    not(boringssl),
+    doc = r#"\
+Generate a CMAC key
+
+```
+use openssl::pkey_ctx::PkeyCtx;
+use openssl::pkey::Id;
+use openssl::cipher::Cipher;
+
+let mut ctx = PkeyCtx::new_id(Id::CMAC).unwrap();
+ctx.keygen_init().unwrap();
+ctx.set_keygen_cipher(Cipher::aes_128_cbc()).unwrap();
+ctx.set_keygen_mac_key(b"0123456789abcdef").unwrap();
+let cmac_key = ctx.keygen().unwrap();
+```"#
+)]
+
+//!
+//! Sign and verify data with RSA
+//!
+//! ```
+//! use openssl::pkey_ctx::PkeyCtx;
+//! use openssl::pkey::PKey;
+//! use openssl::rsa::Rsa;
+//!
+//! // Generate a random RSA key.
+//! let key = Rsa::generate(4096).unwrap();
+//! let key = PKey::from_rsa(key).unwrap();
+//!
+//! let text = b"Some Crypto Text";
+//!
+//! // Create the signature.
+//! let mut ctx = PkeyCtx::new(&key).unwrap();
+//! ctx.sign_init().unwrap();
+//! let mut signature = vec![];
+//! ctx.sign_to_vec(text, &mut signature).unwrap();
+//!
+//! // Verify the signature.
+//! let mut ctx = PkeyCtx::new(&key).unwrap();
+//! ctx.verify_init().unwrap();
+//! let valid = ctx.verify(text, &signature).unwrap();
+//! assert!(valid);
+//! ```
+#[cfg(not(boringssl))]
+use crate::cipher::CipherRef;
+use crate::error::ErrorStack;
+use crate::md::MdRef;
+use crate::pkey::{HasPrivate, HasPublic, Id, PKey, PKeyRef, Private};
+use crate::rsa::Padding;
+use crate::sign::RsaPssSaltlen;
+use crate::{cvt, cvt_p};
+use foreign_types::{ForeignType, ForeignTypeRef};
+#[cfg(not(boringssl))]
+use libc::c_int;
+#[cfg(ossl320)]
+use libc::c_uint;
+use openssl_macros::corresponds;
+use std::convert::TryFrom;
+#[cfg(ossl320)]
+use std::ffi::CStr;
+use std::ptr;
+
+/// HKDF modes of operation.
+#[cfg(any(ossl111, libressl360))]
+pub struct HkdfMode(c_int);
+
+#[cfg(any(ossl111, libressl360))]
+impl HkdfMode {
+    /// This is the default mode. Calling [`derive`][PkeyCtxRef::derive] on a [`PkeyCtxRef`] set up
+    /// for HKDF will perform an extract followed by an expand operation in one go. The derived key
+    /// returned will be the result after the expand operation. The intermediate fixed-length
+    /// pseudorandom key K is not returned.
+    pub const EXTRACT_THEN_EXPAND: Self = HkdfMode(ffi::EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND);
+
+    /// In this mode calling [`derive`][PkeyCtxRef::derive] will just perform the extract operation.
+    /// The value returned will be the intermediate fixed-length pseudorandom key K.
+    ///
+    /// The digest, key and salt values must be set before a key is derived or an error occurs.
+    pub const EXTRACT_ONLY: Self = HkdfMode(ffi::EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY);
+
+    /// In this mode calling [`derive`][PkeyCtxRef::derive] will just perform the expand operation.
+    /// The input key should be set to the intermediate fixed-length pseudorandom key K returned
+    /// from a previous extract operation.
+    ///
+    /// The digest, key and info values must be set before a key is derived or an error occurs.
+    pub const EXPAND_ONLY: Self = HkdfMode(ffi::EVP_PKEY_HKDEF_MODE_EXPAND_ONLY);
+}
+
+/// Nonce type for ECDSA and DSA.
+#[cfg(ossl320)]
+#[derive(Debug, PartialEq)]
+pub struct NonceType(c_uint);
+
+#[cfg(ossl320)]
+impl NonceType {
+    /// This is the default mode. It uses a random value for the nonce k as defined in FIPS 186-4 Section 6.3
+    /// “Secret Number Generation”.
+    pub const RANDOM_K: Self = NonceType(0);
+
+    /// Uses a deterministic value for the nonce k as defined in RFC #6979 (See Section 3.2 “Generation of k”).
+    pub const DETERMINISTIC_K: Self = NonceType(1);
+}
+
+generic_foreign_type_and_impl_send_sync! {
+    type CType = ffi::EVP_PKEY_CTX;
+    fn drop = ffi::EVP_PKEY_CTX_free;
+
+    /// A context object which can perform asymmetric cryptography operations.
+    pub struct PkeyCtx<T>;
+    /// A reference to a [`PkeyCtx`].
+    pub struct PkeyCtxRef<T>;
+}
+
+impl<T> PkeyCtx<T> {
+    /// Creates a new pkey context using the provided key.
+    #[corresponds(EVP_PKEY_CTX_new)]
+    #[inline]
+    pub fn new(pkey: &PKeyRef<T>) -> Result<Self, ErrorStack> {
+        unsafe {
+            let ptr = cvt_p(ffi::EVP_PKEY_CTX_new(pkey.as_ptr(), ptr::null_mut()))?;
+            Ok(PkeyCtx::from_ptr(ptr))
+        }
+    }
+}
+
+impl PkeyCtx<()> {
+    /// Creates a new pkey context for the specified algorithm ID.
+    #[corresponds(EVP_PKEY_new_id)]
+    #[inline]
+    pub fn new_id(id: Id) -> Result<Self, ErrorStack> {
+        unsafe {
+            let ptr = cvt_p(ffi::EVP_PKEY_CTX_new_id(id.as_raw(), ptr::null_mut()))?;
+            Ok(PkeyCtx::from_ptr(ptr))
+        }
+    }
+}
+
+impl<T> PkeyCtxRef<T>
+where
+    T: HasPublic,
+{
+    /// Prepares the context for encryption using the public key.
+    #[corresponds(EVP_PKEY_encrypt_init)]
+    #[inline]
+    pub fn encrypt_init(&mut self) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_encrypt_init(self.as_ptr()))?;
+        }
+
+        Ok(())
+    }
+
+    /// Prepares the context for signature verification using the public key.
+    #[corresponds(EVP_PKEY_verify_init)]
+    #[inline]
+    pub fn verify_init(&mut self) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_verify_init(self.as_ptr()))?;
+        }
+
+        Ok(())
+    }
+
+    /// Prepares the context for signature recovery using the public key.
+    #[corresponds(EVP_PKEY_verify_recover_init)]
+    #[inline]
+    pub fn verify_recover_init(&mut self) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_verify_recover_init(self.as_ptr()))?;
+        }
+
+        Ok(())
+    }
+
+    /// Encrypts data using the public key.
+    ///
+    /// If `to` is set to `None`, an upper bound on the number of bytes required for the output buffer will be
+    /// returned.
+    #[corresponds(EVP_PKEY_encrypt)]
+    #[inline]
+    pub fn encrypt(&mut self, from: &[u8], to: Option<&mut [u8]>) -> Result<usize, ErrorStack> {
+        let mut written = to.as_ref().map_or(0, |b| b.len());
+        unsafe {
+            cvt(ffi::EVP_PKEY_encrypt(
+                self.as_ptr(),
+                to.map_or(ptr::null_mut(), |b| b.as_mut_ptr()),
+                &mut written,
+                from.as_ptr(),
+                from.len(),
+            ))?;
+        }
+
+        Ok(written)
+    }
+
+    /// Like [`Self::encrypt`] but appends ciphertext to a [`Vec`].
+    pub fn encrypt_to_vec(&mut self, from: &[u8], out: &mut Vec<u8>) -> Result<usize, ErrorStack> {
+        let base = out.len();
+        let len = self.encrypt(from, None)?;
+        out.resize(base + len, 0);
+        let len = self.encrypt(from, Some(&mut out[base..]))?;
+        out.truncate(base + len);
+        Ok(len)
+    }
+
+    /// Verifies the signature of data using the public key.
+    ///
+    /// Returns `Ok(true)` if the signature is valid, `Ok(false)` if the signature is invalid, and `Err` if an error
+    /// occurred.
+    ///
+    /// # Note
+    ///
+    /// This verifies the signature of the *raw* data. It is more common to compute and verify the signature of the
+    /// cryptographic hash of an arbitrary amount of data. The [`MdCtx`](crate::md_ctx::MdCtx) type can be used to do
+    /// that.
+    #[corresponds(EVP_PKEY_verify)]
+    #[inline]
+    pub fn verify(&mut self, data: &[u8], sig: &[u8]) -> Result<bool, ErrorStack> {
+        unsafe {
+            let r = ffi::EVP_PKEY_verify(
+                self.as_ptr(),
+                sig.as_ptr(),
+                sig.len(),
+                data.as_ptr(),
+                data.len(),
+            );
+            // `EVP_PKEY_verify` is not terribly consistent about how it,
+            // reports errors. It does not clearly distinguish between 0 and
+            // -1, and may put errors on the stack in both cases. If there's
+            // errors on the stack, we return `Err()`, else we return
+            // `Ok(false)`.
+            if r <= 0 {
+                let errors = ErrorStack::get();
+                if !errors.errors().is_empty() {
+                    return Err(errors);
+                }
+            }
+
+            Ok(r == 1)
+        }
+    }
+
+    /// Recovers the original data signed by the private key. You almost
+    /// always want `verify` instead.
+    ///
+    /// Returns the number of bytes written to `to`, or the number of bytes
+    /// that would be written, if `to` is `None.
+    #[corresponds(EVP_PKEY_verify_recover)]
+    #[inline]
+    pub fn verify_recover(
+        &mut self,
+        sig: &[u8],
+        to: Option<&mut [u8]>,
+    ) -> Result<usize, ErrorStack> {
+        let mut written = to.as_ref().map_or(0, |b| b.len());
+        unsafe {
+            cvt(ffi::EVP_PKEY_verify_recover(
+                self.as_ptr(),
+                to.map_or(ptr::null_mut(), |b| b.as_mut_ptr()),
+                &mut written,
+                sig.as_ptr(),
+                sig.len(),
+            ))?;
+        }
+
+        Ok(written)
+    }
+}
+
+impl<T> PkeyCtxRef<T>
+where
+    T: HasPrivate,
+{
+    /// Prepares the context for decryption using the private key.
+    #[corresponds(EVP_PKEY_decrypt_init)]
+    #[inline]
+    pub fn decrypt_init(&mut self) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_decrypt_init(self.as_ptr()))?;
+        }
+
+        Ok(())
+    }
+
+    /// Prepares the context for signing using the private key.
+    #[corresponds(EVP_PKEY_sign_init)]
+    #[inline]
+    pub fn sign_init(&mut self) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_sign_init(self.as_ptr()))?;
+        }
+
+        Ok(())
+    }
+
+    /// Sets the peer key used for secret derivation.
+    #[corresponds(EVP_PKEY_derive_set_peer)]
+    pub fn derive_set_peer<U>(&mut self, key: &PKeyRef<U>) -> Result<(), ErrorStack>
+    where
+        U: HasPublic,
+    {
+        unsafe {
+            cvt(ffi::EVP_PKEY_derive_set_peer(self.as_ptr(), key.as_ptr()))?;
+        }
+
+        Ok(())
+    }
+
+    /// Decrypts data using the private key.
+    ///
+    /// If `to` is set to `None`, an upper bound on the number of bytes required for the output buffer will be
+    /// returned.
+    #[corresponds(EVP_PKEY_decrypt)]
+    #[inline]
+    pub fn decrypt(&mut self, from: &[u8], to: Option<&mut [u8]>) -> Result<usize, ErrorStack> {
+        let mut written = to.as_ref().map_or(0, |b| b.len());
+        unsafe {
+            cvt(ffi::EVP_PKEY_decrypt(
+                self.as_ptr(),
+                to.map_or(ptr::null_mut(), |b| b.as_mut_ptr()),
+                &mut written,
+                from.as_ptr(),
+                from.len(),
+            ))?;
+        }
+
+        Ok(written)
+    }
+
+    /// Like [`Self::decrypt`] but appends plaintext to a [`Vec`].
+    pub fn decrypt_to_vec(&mut self, from: &[u8], out: &mut Vec<u8>) -> Result<usize, ErrorStack> {
+        let base = out.len();
+        let len = self.decrypt(from, None)?;
+        out.resize(base + len, 0);
+        let len = self.decrypt(from, Some(&mut out[base..]))?;
+        out.truncate(base + len);
+        Ok(len)
+    }
+
+    /// Signs the contents of `data`.
+    ///
+    /// If `sig` is set to `None`, an upper bound on the number of bytes required for the output buffer will be
+    /// returned.
+    ///
+    /// # Note
+    ///
+    /// This computes the signature of the *raw* bytes of `data`. It is more common to sign the cryptographic hash of
+    /// an arbitrary amount of data. The [`MdCtx`](crate::md_ctx::MdCtx) type can be used to do that.
+    #[corresponds(EVP_PKEY_sign)]
+    #[inline]
+    pub fn sign(&mut self, data: &[u8], sig: Option<&mut [u8]>) -> Result<usize, ErrorStack> {
+        let mut written = sig.as_ref().map_or(0, |b| b.len());
+        unsafe {
+            cvt(ffi::EVP_PKEY_sign(
+                self.as_ptr(),
+                sig.map_or(ptr::null_mut(), |b| b.as_mut_ptr()),
+                &mut written,
+                data.as_ptr(),
+                data.len(),
+            ))?;
+        }
+
+        Ok(written)
+    }
+
+    /// Like [`Self::sign`] but appends the signature to a [`Vec`].
+    pub fn sign_to_vec(&mut self, data: &[u8], sig: &mut Vec<u8>) -> Result<usize, ErrorStack> {
+        let base = sig.len();
+        let len = self.sign(data, None)?;
+        sig.resize(base + len, 0);
+        let len = self.sign(data, Some(&mut sig[base..]))?;
+        sig.truncate(base + len);
+        Ok(len)
+    }
+}
+
+impl<T> PkeyCtxRef<T> {
+    /// Prepares the context for shared secret derivation.
+    #[corresponds(EVP_PKEY_derive_init)]
+    #[inline]
+    pub fn derive_init(&mut self) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_derive_init(self.as_ptr()))?;
+        }
+
+        Ok(())
+    }
+
+    /// Prepares the context for key generation.
+    #[corresponds(EVP_PKEY_keygen_init)]
+    #[inline]
+    pub fn keygen_init(&mut self) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_keygen_init(self.as_ptr()))?;
+        }
+
+        Ok(())
+    }
+
+    /// Sets which algorithm was used to compute the digest used in a
+    /// signature. With RSA signatures this causes the signature to be wrapped
+    /// in a `DigestInfo` structure. This is almost always what you want with
+    /// RSA signatures.
+    #[corresponds(EVP_PKEY_CTX_set_signature_md)]
+    #[inline]
+    pub fn set_signature_md(&self, md: &MdRef) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set_signature_md(
+                self.as_ptr(),
+                md.as_ptr(),
+            ))?;
+        }
+        Ok(())
+    }
+
+    /// Returns the RSA padding mode in use.
+    ///
+    /// This is only useful for RSA keys.
+    #[corresponds(EVP_PKEY_CTX_get_rsa_padding)]
+    #[inline]
+    pub fn rsa_padding(&self) -> Result<Padding, ErrorStack> {
+        let mut pad = 0;
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_get_rsa_padding(self.as_ptr(), &mut pad))?;
+        }
+
+        Ok(Padding::from_raw(pad))
+    }
+
+    /// Sets the RSA padding mode.
+    ///
+    /// This is only useful for RSA keys.
+    #[corresponds(EVP_PKEY_CTX_set_rsa_padding)]
+    #[inline]
+    pub fn set_rsa_padding(&mut self, padding: Padding) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set_rsa_padding(
+                self.as_ptr(),
+                padding.as_raw(),
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Sets the RSA PSS salt length.
+    ///
+    /// This is only useful for RSA keys.
+    #[corresponds(EVP_PKEY_CTX_set_rsa_pss_saltlen)]
+    #[inline]
+    pub fn set_rsa_pss_saltlen(&mut self, len: RsaPssSaltlen) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set_rsa_pss_saltlen(
+                self.as_ptr(),
+                len.as_raw(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the RSA MGF1 algorithm.
+    ///
+    /// This is only useful for RSA keys.
+    #[corresponds(EVP_PKEY_CTX_set_rsa_mgf1_md)]
+    #[inline]
+    pub fn set_rsa_mgf1_md(&mut self, md: &MdRef) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set_rsa_mgf1_md(
+                self.as_ptr(),
+                md.as_ptr(),
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Sets the RSA OAEP algorithm.
+    ///
+    /// This is only useful for RSA keys.
+    #[corresponds(EVP_PKEY_CTX_set_rsa_oaep_md)]
+    #[cfg(any(ossl102, libressl310, boringssl))]
+    #[inline]
+    pub fn set_rsa_oaep_md(&mut self, md: &MdRef) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set_rsa_oaep_md(
+                self.as_ptr(),
+                md.as_ptr() as *mut _,
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Sets the RSA OAEP label.
+    ///
+    /// This is only useful for RSA keys.
+    #[corresponds(EVP_PKEY_CTX_set0_rsa_oaep_label)]
+    #[cfg(any(ossl102, libressl310, boringssl))]
+    pub fn set_rsa_oaep_label(&mut self, label: &[u8]) -> Result<(), ErrorStack> {
+        use crate::LenType;
+        let len = LenType::try_from(label.len()).unwrap();
+
+        unsafe {
+            let p = ffi::OPENSSL_malloc(label.len() as _);
+            ptr::copy_nonoverlapping(label.as_ptr(), p as *mut _, label.len());
+
+            let r = cvt(ffi::EVP_PKEY_CTX_set0_rsa_oaep_label(
+                self.as_ptr(),
+                p as *mut _,
+                len,
+            ));
+            if r.is_err() {
+                ffi::OPENSSL_free(p);
+            }
+            r?;
+        }
+
+        Ok(())
+    }
+
+    /// Sets the cipher used during key generation.
+    #[cfg(not(boringssl))]
+    #[corresponds(EVP_PKEY_CTX_ctrl)]
+    #[inline]
+    pub fn set_keygen_cipher(&mut self, cipher: &CipherRef) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_ctrl(
+                self.as_ptr(),
+                -1,
+                ffi::EVP_PKEY_OP_KEYGEN,
+                ffi::EVP_PKEY_CTRL_CIPHER,
+                0,
+                cipher.as_ptr() as *mut _,
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Sets the key MAC key used during key generation.
+    #[cfg(not(boringssl))]
+    #[corresponds(EVP_PKEY_CTX_ctrl)]
+    #[inline]
+    pub fn set_keygen_mac_key(&mut self, key: &[u8]) -> Result<(), ErrorStack> {
+        let len = c_int::try_from(key.len()).unwrap();
+
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_ctrl(
+                self.as_ptr(),
+                -1,
+                ffi::EVP_PKEY_OP_KEYGEN,
+                ffi::EVP_PKEY_CTRL_SET_MAC_KEY,
+                len,
+                key.as_ptr() as *mut _,
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Sets the digest used for HKDF derivation.
+    ///
+    /// Requires OpenSSL 1.1.0 or newer.
+    #[corresponds(EVP_PKEY_CTX_set_hkdf_md)]
+    #[cfg(any(ossl110, boringssl, libressl360))]
+    #[inline]
+    pub fn set_hkdf_md(&mut self, digest: &MdRef) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set_hkdf_md(
+                self.as_ptr(),
+                digest.as_ptr(),
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Sets the HKDF mode of operation.
+    ///
+    /// Defaults to [`HkdfMode::EXTRACT_THEN_EXPAND`].
+    ///
+    /// WARNING: Although this API calls it a "mode", HKDF-Extract and HKDF-Expand are distinct
+    /// operations with distinct inputs and distinct kinds of keys. Callers should not pass input
+    /// secrets for one operation into the other.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(EVP_PKEY_CTX_set_hkdf_mode)]
+    #[cfg(any(ossl111, libressl360))]
+    #[inline]
+    pub fn set_hkdf_mode(&mut self, mode: HkdfMode) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set_hkdf_mode(self.as_ptr(), mode.0))?;
+        }
+
+        Ok(())
+    }
+
+    /// Sets the input material for HKDF generation as the "key".
+    ///
+    /// Which input is the key depends on the "mode" (see [`set_hkdf_mode`][Self::set_hkdf_mode]).
+    /// If [`HkdfMode::EXTRACT_THEN_EXPAND`] or [`HkdfMode::EXTRACT_ONLY`], this function specifies
+    /// the input keying material (IKM) for HKDF-Extract. If [`HkdfMode::EXPAND_ONLY`], it instead
+    /// specifies the pseudorandom key (PRK) for HKDF-Expand.
+    ///
+    /// Requires OpenSSL 1.1.0 or newer.
+    #[corresponds(EVP_PKEY_CTX_set1_hkdf_key)]
+    #[cfg(any(ossl110, boringssl, libressl360))]
+    #[inline]
+    pub fn set_hkdf_key(&mut self, key: &[u8]) -> Result<(), ErrorStack> {
+        #[cfg(not(boringssl))]
+        let len = c_int::try_from(key.len()).unwrap();
+        #[cfg(boringssl)]
+        let len = key.len();
+
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set1_hkdf_key(
+                self.as_ptr(),
+                key.as_ptr(),
+                len,
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Sets the salt value for HKDF generation.
+    ///
+    /// If performing HKDF-Expand only, this parameter is ignored.
+    ///
+    /// Requires OpenSSL 1.1.0 or newer.
+    #[corresponds(EVP_PKEY_CTX_set1_hkdf_salt)]
+    #[cfg(any(ossl110, boringssl, libressl360))]
+    #[inline]
+    pub fn set_hkdf_salt(&mut self, salt: &[u8]) -> Result<(), ErrorStack> {
+        #[cfg(not(boringssl))]
+        let len = c_int::try_from(salt.len()).unwrap();
+        #[cfg(boringssl)]
+        let len = salt.len();
+
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set1_hkdf_salt(
+                self.as_ptr(),
+                salt.as_ptr(),
+                len,
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Appends info bytes for HKDF generation.
+    ///
+    /// If performing HKDF-Extract only, this parameter is ignored.
+    ///
+    /// Requires OpenSSL 1.1.0 or newer.
+    #[corresponds(EVP_PKEY_CTX_add1_hkdf_info)]
+    #[cfg(any(ossl110, boringssl, libressl360))]
+    #[inline]
+    pub fn add_hkdf_info(&mut self, info: &[u8]) -> Result<(), ErrorStack> {
+        #[cfg(not(boringssl))]
+        let len = c_int::try_from(info.len()).unwrap();
+        #[cfg(boringssl)]
+        let len = info.len();
+
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_add1_hkdf_info(
+                self.as_ptr(),
+                info.as_ptr(),
+                len,
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Derives a shared secret between two keys.
+    ///
+    /// If `buf` is set to `None`, an upper bound on the number of bytes required for the buffer will be returned.
+    #[corresponds(EVP_PKEY_derive)]
+    pub fn derive(&mut self, buf: Option<&mut [u8]>) -> Result<usize, ErrorStack> {
+        let mut len = buf.as_ref().map_or(0, |b| b.len());
+        unsafe {
+            cvt(ffi::EVP_PKEY_derive(
+                self.as_ptr(),
+                buf.map_or(ptr::null_mut(), |b| b.as_mut_ptr()),
+                &mut len,
+            ))?;
+        }
+
+        Ok(len)
+    }
+
+    /// Like [`Self::derive`] but appends the secret to a [`Vec`].
+    pub fn derive_to_vec(&mut self, buf: &mut Vec<u8>) -> Result<usize, ErrorStack> {
+        let base = buf.len();
+        let len = self.derive(None)?;
+        buf.resize(base + len, 0);
+        let len = self.derive(Some(&mut buf[base..]))?;
+        buf.truncate(base + len);
+        Ok(len)
+    }
+
+    /// Generates a new public/private keypair.
+    #[corresponds(EVP_PKEY_keygen)]
+    #[inline]
+    pub fn keygen(&mut self) -> Result<PKey<Private>, ErrorStack> {
+        unsafe {
+            let mut key = ptr::null_mut();
+            cvt(ffi::EVP_PKEY_keygen(self.as_ptr(), &mut key))?;
+            Ok(PKey::from_ptr(key))
+        }
+    }
+
+    /// Sets the nonce type for a private key context.
+    ///
+    /// The nonce for DSA and ECDSA can be either random (the default) or deterministic (as defined by RFC 6979).
+    ///
+    /// This is only useful for DSA and ECDSA.
+    /// Requires OpenSSL 3.2.0 or newer.
+    #[cfg(ossl320)]
+    #[corresponds(EVP_PKEY_CTX_set_params)]
+    pub fn set_nonce_type(&mut self, nonce_type: NonceType) -> Result<(), ErrorStack> {
+        let nonce_field_name = CStr::from_bytes_with_nul(b"nonce-type\0").unwrap();
+        let mut nonce_type = nonce_type.0;
+        unsafe {
+            let param_nonce =
+                ffi::OSSL_PARAM_construct_uint(nonce_field_name.as_ptr(), &mut nonce_type);
+            let param_end = ffi::OSSL_PARAM_construct_end();
+
+            let params = [param_nonce, param_end];
+            cvt(ffi::EVP_PKEY_CTX_set_params(self.as_ptr(), params.as_ptr()))?;
+        }
+        Ok(())
+    }
+
+    /// Gets the nonce type for a private key context.
+    ///
+    /// The nonce for DSA and ECDSA can be either random (the default) or deterministic (as defined by RFC 6979).
+    ///
+    /// This is only useful for DSA and ECDSA.
+    /// Requires OpenSSL 3.2.0 or newer.
+    #[cfg(ossl320)]
+    #[corresponds(EVP_PKEY_CTX_get_params)]
+    pub fn nonce_type(&mut self) -> Result<NonceType, ErrorStack> {
+        let nonce_field_name = CStr::from_bytes_with_nul(b"nonce-type\0").unwrap();
+        let mut nonce_type: c_uint = 0;
+        unsafe {
+            let param_nonce =
+                ffi::OSSL_PARAM_construct_uint(nonce_field_name.as_ptr(), &mut nonce_type);
+            let param_end = ffi::OSSL_PARAM_construct_end();
+
+            let mut params = [param_nonce, param_end];
+            cvt(ffi::EVP_PKEY_CTX_get_params(
+                self.as_ptr(),
+                params.as_mut_ptr(),
+            ))?;
+        }
+        Ok(NonceType(nonce_type))
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+    #[cfg(not(boringssl))]
+    use crate::cipher::Cipher;
+    use crate::ec::{EcGroup, EcKey};
+    use crate::hash::{hash, MessageDigest};
+    use crate::md::Md;
+    use crate::nid::Nid;
+    use crate::pkey::PKey;
+    use crate::rsa::Rsa;
+    use crate::sign::Verifier;
+
+    #[test]
+    fn rsa() {
+        let key = include_bytes!("../test/rsa.pem");
+        let rsa = Rsa::private_key_from_pem(key).unwrap();
+        let pkey = PKey::from_rsa(rsa).unwrap();
+
+        let mut ctx = PkeyCtx::new(&pkey).unwrap();
+        ctx.encrypt_init().unwrap();
+        ctx.set_rsa_padding(Padding::PKCS1).unwrap();
+
+        let pt = "hello world".as_bytes();
+        let mut ct = vec![];
+        ctx.encrypt_to_vec(pt, &mut ct).unwrap();
+
+        ctx.decrypt_init().unwrap();
+        ctx.set_rsa_padding(Padding::PKCS1).unwrap();
+
+        let mut out = vec![];
+        ctx.decrypt_to_vec(&ct, &mut out).unwrap();
+
+        assert_eq!(pt, out);
+    }
+
+    #[test]
+    #[cfg(any(ossl102, libressl310, boringssl))]
+    fn rsa_oaep() {
+        let key = include_bytes!("../test/rsa.pem");
+        let rsa = Rsa::private_key_from_pem(key).unwrap();
+        let pkey = PKey::from_rsa(rsa).unwrap();
+
+        let mut ctx = PkeyCtx::new(&pkey).unwrap();
+        ctx.encrypt_init().unwrap();
+        ctx.set_rsa_padding(Padding::PKCS1_OAEP).unwrap();
+        ctx.set_rsa_oaep_md(Md::sha256()).unwrap();
+        ctx.set_rsa_mgf1_md(Md::sha256()).unwrap();
+
+        let pt = "hello world".as_bytes();
+        let mut ct = vec![];
+        ctx.encrypt_to_vec(pt, &mut ct).unwrap();
+
+        ctx.decrypt_init().unwrap();
+        ctx.set_rsa_padding(Padding::PKCS1_OAEP).unwrap();
+        ctx.set_rsa_oaep_md(Md::sha256()).unwrap();
+        ctx.set_rsa_mgf1_md(Md::sha256()).unwrap();
+
+        let mut out = vec![];
+        ctx.decrypt_to_vec(&ct, &mut out).unwrap();
+
+        assert_eq!(pt, out);
+    }
+
+    #[test]
+    fn rsa_sign() {
+        let key = include_bytes!("../test/rsa.pem");
+        let rsa = Rsa::private_key_from_pem(key).unwrap();
+        let pkey = PKey::from_rsa(rsa).unwrap();
+
+        let mut ctx = PkeyCtx::new(&pkey).unwrap();
+        ctx.sign_init().unwrap();
+        ctx.set_rsa_padding(Padding::PKCS1).unwrap();
+        ctx.set_signature_md(Md::sha384()).unwrap();
+
+        let msg = b"hello world";
+        let digest = hash(MessageDigest::sha384(), msg).unwrap();
+        let mut signature = vec![];
+        ctx.sign_to_vec(&digest, &mut signature).unwrap();
+
+        let mut verifier = Verifier::new(MessageDigest::sha384(), &pkey).unwrap();
+        verifier.update(msg).unwrap();
+        assert!(matches!(verifier.verify(&signature), Ok(true)));
+    }
+
+    #[test]
+    fn rsa_sign_pss() {
+        let key = include_bytes!("../test/rsa.pem");
+        let rsa = Rsa::private_key_from_pem(key).unwrap();
+        let pkey = PKey::from_rsa(rsa).unwrap();
+
+        let mut ctx = PkeyCtx::new(&pkey).unwrap();
+        ctx.sign_init().unwrap();
+        ctx.set_rsa_padding(Padding::PKCS1_PSS).unwrap();
+        ctx.set_signature_md(Md::sha384()).unwrap();
+        ctx.set_rsa_pss_saltlen(RsaPssSaltlen::custom(14)).unwrap();
+
+        let msg = b"hello world";
+        let digest = hash(MessageDigest::sha384(), msg).unwrap();
+        let mut signature = vec![];
+        ctx.sign_to_vec(&digest, &mut signature).unwrap();
+
+        let mut verifier = Verifier::new(MessageDigest::sha384(), &pkey).unwrap();
+        verifier.set_rsa_padding(Padding::PKCS1_PSS).unwrap();
+        verifier
+            .set_rsa_pss_saltlen(RsaPssSaltlen::custom(14))
+            .unwrap();
+        verifier.update(msg).unwrap();
+        assert!(matches!(verifier.verify(&signature), Ok(true)));
+    }
+
+    #[test]
+    fn derive() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let key1 = EcKey::generate(&group).unwrap();
+        let key1 = PKey::from_ec_key(key1).unwrap();
+        let key2 = EcKey::generate(&group).unwrap();
+        let key2 = PKey::from_ec_key(key2).unwrap();
+
+        let mut ctx = PkeyCtx::new(&key1).unwrap();
+        ctx.derive_init().unwrap();
+        ctx.derive_set_peer(&key2).unwrap();
+
+        let mut buf = vec![];
+        ctx.derive_to_vec(&mut buf).unwrap();
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn cmac_keygen() {
+        let mut ctx = PkeyCtx::new_id(Id::CMAC).unwrap();
+        ctx.keygen_init().unwrap();
+        ctx.set_keygen_cipher(Cipher::aes_128_cbc()).unwrap();
+        ctx.set_keygen_mac_key(&hex::decode("9294727a3638bb1c13f48ef8158bfc9d").unwrap())
+            .unwrap();
+        ctx.keygen().unwrap();
+    }
+
+    #[test]
+    #[cfg(any(ossl110, boringssl, libressl360))]
+    fn hkdf() {
+        let mut ctx = PkeyCtx::new_id(Id::HKDF).unwrap();
+        ctx.derive_init().unwrap();
+        ctx.set_hkdf_md(Md::sha256()).unwrap();
+        ctx.set_hkdf_key(&hex::decode("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b").unwrap())
+            .unwrap();
+        ctx.set_hkdf_salt(&hex::decode("000102030405060708090a0b0c").unwrap())
+            .unwrap();
+        ctx.add_hkdf_info(&hex::decode("f0f1f2f3f4f5f6f7f8f9").unwrap())
+            .unwrap();
+        let mut out = [0; 42];
+        ctx.derive(Some(&mut out)).unwrap();
+
+        assert_eq!(
+            &out[..],
+            hex::decode("3cb25f25faacd57a90434f64d0362f2a2d2d0a90cf1a5a4c5db02d56ecc4c5bf34007208d5b887185865")
+                .unwrap()
+        );
+    }
+
+    #[test]
+    #[cfg(any(ossl111, libressl360))]
+    fn hkdf_expand() {
+        let mut ctx = PkeyCtx::new_id(Id::HKDF).unwrap();
+        ctx.derive_init().unwrap();
+        ctx.set_hkdf_mode(HkdfMode::EXPAND_ONLY).unwrap();
+        ctx.set_hkdf_md(Md::sha256()).unwrap();
+        ctx.set_hkdf_key(
+            &hex::decode("077709362c2e32df0ddc3f0dc47bba6390b6c73bb50f9c3122ec844ad7c2b3e5")
+                .unwrap(),
+        )
+        .unwrap();
+        ctx.add_hkdf_info(&hex::decode("f0f1f2f3f4f5f6f7f8f9").unwrap())
+            .unwrap();
+        let mut out = [0; 42];
+        ctx.derive(Some(&mut out)).unwrap();
+
+        assert_eq!(
+            &out[..],
+            hex::decode("3cb25f25faacd57a90434f64d0362f2a2d2d0a90cf1a5a4c5db02d56ecc4c5bf34007208d5b887185865")
+                .unwrap()
+        );
+    }
+
+    #[test]
+    #[cfg(any(ossl111, libressl360))]
+    fn hkdf_extract() {
+        let mut ctx = PkeyCtx::new_id(Id::HKDF).unwrap();
+        ctx.derive_init().unwrap();
+        ctx.set_hkdf_mode(HkdfMode::EXTRACT_ONLY).unwrap();
+        ctx.set_hkdf_md(Md::sha256()).unwrap();
+        ctx.set_hkdf_key(&hex::decode("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b").unwrap())
+            .unwrap();
+        ctx.set_hkdf_salt(&hex::decode("000102030405060708090a0b0c").unwrap())
+            .unwrap();
+        let mut out = vec![];
+        ctx.derive_to_vec(&mut out).unwrap();
+
+        assert_eq!(
+            &out[..],
+            hex::decode("077709362c2e32df0ddc3f0dc47bba6390b6c73bb50f9c3122ec844ad7c2b3e5")
+                .unwrap()
+        );
+    }
+
+    #[test]
+    fn verify_fail() {
+        let key1 = Rsa::generate(4096).unwrap();
+        let key1 = PKey::from_rsa(key1).unwrap();
+
+        let data = b"Some Crypto Text";
+
+        let mut ctx = PkeyCtx::new(&key1).unwrap();
+        ctx.sign_init().unwrap();
+        let mut signature = vec![];
+        ctx.sign_to_vec(data, &mut signature).unwrap();
+
+        let bad_data = b"Some Crypto text";
+
+        ctx.verify_init().unwrap();
+        let valid = ctx.verify(bad_data, &signature);
+        assert!(matches!(valid, Ok(false) | Err(_)));
+        assert!(ErrorStack::get().errors().is_empty());
+    }
+
+    #[test]
+    fn verify_fail_ec() {
+        let key1 =
+            EcKey::generate(&EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap()).unwrap();
+        let key1 = PKey::from_ec_key(key1).unwrap();
+
+        let data = b"Some Crypto Text";
+        let mut ctx = PkeyCtx::new(&key1).unwrap();
+        ctx.verify_init().unwrap();
+        assert!(matches!(ctx.verify(data, &[0; 64]), Ok(false) | Err(_)));
+        assert!(ErrorStack::get().errors().is_empty());
+    }
+
+    #[test]
+    fn test_verify_recover() {
+        let key = Rsa::generate(2048).unwrap();
+        let key = PKey::from_rsa(key).unwrap();
+
+        let digest = [
+            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
+            24, 25, 26, 27, 28, 29, 30, 31,
+        ];
+
+        let mut ctx = PkeyCtx::new(&key).unwrap();
+        ctx.sign_init().unwrap();
+        ctx.set_rsa_padding(Padding::PKCS1).unwrap();
+        ctx.set_signature_md(Md::sha256()).unwrap();
+        let mut signature = vec![];
+        ctx.sign_to_vec(&digest, &mut signature).unwrap();
+
+        // Attempt recovery of just the digest.
+        let mut ctx = PkeyCtx::new(&key).unwrap();
+        ctx.verify_recover_init().unwrap();
+        ctx.set_rsa_padding(Padding::PKCS1).unwrap();
+        ctx.set_signature_md(Md::sha256()).unwrap();
+        let length = ctx.verify_recover(&signature, None).unwrap();
+        let mut result_buf = vec![0; length];
+        let length = ctx
+            .verify_recover(&signature, Some(&mut result_buf))
+            .unwrap();
+        assert_eq!(length, digest.len());
+        // result_buf contains the digest
+        assert_eq!(result_buf[..length], digest);
+
+        // Attempt recovery of teh entire DigestInfo
+        let mut ctx = PkeyCtx::new(&key).unwrap();
+        ctx.verify_recover_init().unwrap();
+        ctx.set_rsa_padding(Padding::PKCS1).unwrap();
+        let length = ctx.verify_recover(&signature, None).unwrap();
+        let mut result_buf = vec![0; length];
+        let length = ctx
+            .verify_recover(&signature, Some(&mut result_buf))
+            .unwrap();
+        // 32-bytes of SHA256 digest + the ASN.1 DigestInfo structure == 51 bytes
+        assert_eq!(length, 51);
+        // The digest is the end of the DigestInfo structure.
+        assert_eq!(result_buf[length - digest.len()..length], digest);
+    }
+
+    #[test]
+    #[cfg(ossl320)]
+    fn set_nonce_type() {
+        let key1 =
+            EcKey::generate(&EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap()).unwrap();
+        let key1 = PKey::from_ec_key(key1).unwrap();
+
+        let mut ctx = PkeyCtx::new(&key1).unwrap();
+        ctx.sign_init().unwrap();
+        ctx.set_nonce_type(NonceType::DETERMINISTIC_K).unwrap();
+        let nonce_type = ctx.nonce_type().unwrap();
+        assert_eq!(nonce_type, NonceType::DETERMINISTIC_K);
+        assert!(ErrorStack::get().errors().is_empty());
+    }
+
+    // Test vector from
+    // https://github.com/openssl/openssl/blob/openssl-3.2.0/test/recipes/30-test_evp_data/evppkey_ecdsa_rfc6979.txt
+    #[test]
+    #[cfg(ossl320)]
+    fn ecdsa_deterministic_signature() {
+        let private_key_pem = "-----BEGIN PRIVATE KEY-----
+MDkCAQAwEwYHKoZIzj0CAQYIKoZIzj0DAQEEHzAdAgEBBBhvqwNJNOTA/Jrmf1tWWanX0f79GH7g
+n9Q=
+-----END PRIVATE KEY-----";
+
+        let key1 = EcKey::private_key_from_pem(private_key_pem.as_bytes()).unwrap();
+        let key1 = PKey::from_ec_key(key1).unwrap();
+        let input = "sample";
+        let expected_output = hex::decode("303502190098C6BD12B23EAF5E2A2045132086BE3EB8EBD62ABF6698FF021857A22B07DEA9530F8DE9471B1DC6624472E8E2844BC25B64").unwrap();
+
+        let hashed_input = hash(MessageDigest::sha1(), input.as_bytes()).unwrap();
+        let mut ctx = PkeyCtx::new(&key1).unwrap();
+        ctx.sign_init().unwrap();
+        ctx.set_signature_md(Md::sha1()).unwrap();
+        ctx.set_nonce_type(NonceType::DETERMINISTIC_K).unwrap();
+
+        let mut output = vec![];
+        ctx.sign_to_vec(&hashed_input, &mut output).unwrap();
+        assert_eq!(output, expected_output);
+        assert!(ErrorStack::get().errors().is_empty());
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/provider.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/provider.rs
--- 43.0.0-1/rust-vendor/openssl/src/provider.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/provider.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,81 @@
+use crate::error::ErrorStack;
+use crate::lib_ctx::LibCtxRef;
+use crate::{cvt, cvt_p};
+use foreign_types::{ForeignType, ForeignTypeRef};
+use openssl_macros::corresponds;
+use std::ffi::CString;
+use std::ptr;
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::OSSL_PROVIDER;
+    fn drop = ossl_provider_free;
+
+    pub struct Provider;
+    /// A reference to a [`Provider`].
+    pub struct ProviderRef;
+}
+
+#[inline]
+unsafe fn ossl_provider_free(p: *mut ffi::OSSL_PROVIDER) {
+    ffi::OSSL_PROVIDER_unload(p);
+}
+
+impl Provider {
+    /// Loads a new provider into the specified library context, disabling the fallback providers.
+    ///
+    /// If `ctx` is `None`, the provider will be loaded in to the default library context.
+    #[corresponds(OSSL_provider_load)]
+    pub fn load(ctx: Option<&LibCtxRef>, name: &str) -> Result<Self, ErrorStack> {
+        let name = CString::new(name).unwrap();
+        unsafe {
+            let p = cvt_p(ffi::OSSL_PROVIDER_load(
+                ctx.map_or(ptr::null_mut(), ForeignTypeRef::as_ptr),
+                name.as_ptr(),
+            ))?;
+
+            Ok(Provider::from_ptr(p))
+        }
+    }
+
+    /// Loads a new provider into the specified library context, disabling the fallback providers if `retain_fallbacks`
+    /// is `false` and the load succeeds.
+    ///
+    /// If `ctx` is `None`, the provider will be loaded into the default library context.
+    #[corresponds(OSSL_provider_try_load)]
+    pub fn try_load(
+        ctx: Option<&LibCtxRef>,
+        name: &str,
+        retain_fallbacks: bool,
+    ) -> Result<Self, ErrorStack> {
+        let name = CString::new(name).unwrap();
+        unsafe {
+            let p = cvt_p(ffi::OSSL_PROVIDER_try_load(
+                ctx.map_or(ptr::null_mut(), ForeignTypeRef::as_ptr),
+                name.as_ptr(),
+                retain_fallbacks as _,
+            ))?;
+
+            // OSSL_PROVIDER_try_load seems to leave errors on the stack, even
+            // when it succeeds.
+            let _ = ErrorStack::get();
+
+            Ok(Provider::from_ptr(p))
+        }
+    }
+
+    /// Specifies the default search path that is to be used for looking for providers in the specified library context.
+    /// If left unspecified, an environment variable and a fall back default value will be used instead
+    ///
+    /// If `ctx` is `None`, the provider will be loaded into the default library context.
+    #[corresponds(OSSL_PROVIDER_set_default_search_path)]
+    pub fn set_default_search_path(ctx: Option<&LibCtxRef>, path: &str) -> Result<(), ErrorStack> {
+        let path = CString::new(path).unwrap();
+        unsafe {
+            cvt(ffi::OSSL_PROVIDER_set_default_search_path(
+                ctx.map_or(ptr::null_mut(), ForeignTypeRef::as_ptr),
+                path.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/rand.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/rand.rs
--- 43.0.0-1/rust-vendor/openssl/src/rand.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/rand.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,90 @@
+//! Utilities for secure random number generation.
+//!
+//! # Examples
+//!
+//! To generate a buffer with cryptographically strong bytes:
+//!
+//! ```
+//! use openssl::rand::rand_bytes;
+//!
+//! let mut buf = [0; 256];
+//! rand_bytes(&mut buf).unwrap();
+//! ```
+use libc::c_int;
+
+use crate::error::ErrorStack;
+use crate::{cvt, LenType};
+use openssl_macros::corresponds;
+
+/// Fill buffer with cryptographically strong pseudo-random bytes.
+///
+/// # Examples
+///
+/// To generate a buffer with cryptographically strong random bytes:
+///
+/// ```
+/// use openssl::rand::rand_bytes;
+///
+/// let mut buf = [0; 256];
+/// rand_bytes(&mut buf).unwrap();
+/// ```
+#[corresponds(RAND_bytes)]
+pub fn rand_bytes(buf: &mut [u8]) -> Result<(), ErrorStack> {
+    unsafe {
+        ffi::init();
+        assert!(buf.len() <= c_int::MAX as usize);
+        cvt(ffi::RAND_bytes(buf.as_mut_ptr(), buf.len() as LenType)).map(|_| ())
+    }
+}
+
+/// Fill buffer with cryptographically strong pseudo-random bytes. It is
+/// intended to be used for generating values that should remain private.
+///
+/// # Examples
+///
+/// To generate a buffer with cryptographically strong random bytes:
+///
+/// ```
+/// use openssl::rand::rand_priv_bytes;
+///
+/// let mut buf = [0; 256];
+/// rand_priv_bytes(&mut buf).unwrap();
+/// ```
+///
+/// Requires OpenSSL 1.1.1 or newer.
+#[corresponds(RAND_priv_bytes)]
+#[cfg(ossl111)]
+pub fn rand_priv_bytes(buf: &mut [u8]) -> Result<(), ErrorStack> {
+    unsafe {
+        ffi::init();
+        assert!(buf.len() <= c_int::MAX as usize);
+        cvt(ffi::RAND_priv_bytes(buf.as_mut_ptr(), buf.len() as LenType)).map(|_| ())
+    }
+}
+
+/// Controls random device file descriptor behavior.
+///
+/// Requires OpenSSL 1.1.1 or newer.
+#[corresponds(RAND_keep_random_devices_open)]
+#[cfg(ossl111)]
+pub fn keep_random_devices_open(keep: bool) {
+    unsafe {
+        ffi::RAND_keep_random_devices_open(keep as LenType);
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    #[test]
+    fn test_rand_bytes() {
+        let mut buf = [0; 32];
+        super::rand_bytes(&mut buf).unwrap();
+    }
+
+    #[test]
+    #[cfg(ossl111)]
+    fn test_rand_priv_bytes() {
+        let mut buf = [0; 32];
+        super::rand_priv_bytes(&mut buf).unwrap();
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/rsa.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/rsa.rs
--- 43.0.0-1/rust-vendor/openssl/src/rsa.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/rsa.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,852 @@
+//! Rivest–Shamir–Adleman cryptosystem
+//!
+//! RSA is one of the earliest asymmetric public key encryption schemes.
+//! Like many other cryptosystems, RSA relies on the presumed difficulty of a hard
+//! mathematical problem, namely factorization of the product of two large prime
+//! numbers. At the moment there does not exist an algorithm that can factor such
+//! large numbers in reasonable time. RSA is used in a wide variety of
+//! applications including digital signatures and key exchanges such as
+//! establishing a TLS/SSL connection.
+//!
+//! The RSA acronym is derived from the first letters of the surnames of the
+//! algorithm's founding trio.
+//!
+//! # Example
+//!
+//! Generate a 2048-bit RSA key pair and use the public key to encrypt some data.
+//!
+//! ```rust
+//! use openssl::rsa::{Rsa, Padding};
+//!
+//! let rsa = Rsa::generate(2048).unwrap();
+//! let data = b"foobar";
+//! let mut buf = vec![0; rsa.size() as usize];
+//! let encrypted_len = rsa.public_encrypt(data, &mut buf, Padding::PKCS1).unwrap();
+//! ```
+use cfg_if::cfg_if;
+use foreign_types::{ForeignType, ForeignTypeRef};
+use libc::c_int;
+use std::fmt;
+use std::mem;
+use std::ptr;
+
+use crate::bn::{BigNum, BigNumRef};
+use crate::error::ErrorStack;
+use crate::pkey::{HasPrivate, HasPublic, Private, Public};
+use crate::util::ForeignTypeRefExt;
+use crate::{cvt, cvt_n, cvt_p, LenType};
+use openssl_macros::corresponds;
+
+/// Type of encryption padding to use.
+///
+/// Random length padding is primarily used to prevent attackers from
+/// predicting or knowing the exact length of a plaintext message that
+/// can possibly lead to breaking encryption.
+#[derive(Debug, Copy, Clone, PartialEq, Eq)]
+pub struct Padding(c_int);
+
+impl Padding {
+    pub const NONE: Padding = Padding(ffi::RSA_NO_PADDING);
+    pub const PKCS1: Padding = Padding(ffi::RSA_PKCS1_PADDING);
+    pub const PKCS1_OAEP: Padding = Padding(ffi::RSA_PKCS1_OAEP_PADDING);
+    pub const PKCS1_PSS: Padding = Padding(ffi::RSA_PKCS1_PSS_PADDING);
+
+    /// Creates a `Padding` from an integer representation.
+    pub fn from_raw(value: c_int) -> Padding {
+        Padding(value)
+    }
+
+    /// Returns the integer representation of `Padding`.
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn as_raw(&self) -> c_int {
+        self.0
+    }
+}
+
+generic_foreign_type_and_impl_send_sync! {
+    type CType = ffi::RSA;
+    fn drop = ffi::RSA_free;
+
+    /// An RSA key.
+    pub struct Rsa<T>;
+
+    /// Reference to `RSA`
+    pub struct RsaRef<T>;
+}
+
+impl<T> Clone for Rsa<T> {
+    fn clone(&self) -> Rsa<T> {
+        (**self).to_owned()
+    }
+}
+
+impl<T> ToOwned for RsaRef<T> {
+    type Owned = Rsa<T>;
+
+    fn to_owned(&self) -> Rsa<T> {
+        unsafe {
+            ffi::RSA_up_ref(self.as_ptr());
+            Rsa::from_ptr(self.as_ptr())
+        }
+    }
+}
+
+impl<T> RsaRef<T>
+where
+    T: HasPrivate,
+{
+    private_key_to_pem! {
+        /// Serializes the private key to a PEM-encoded PKCS#1 RSAPrivateKey structure.
+        ///
+        /// The output will have a header of `-----BEGIN RSA PRIVATE KEY-----`.
+        #[corresponds(PEM_write_bio_RSAPrivateKey)]
+        private_key_to_pem,
+        /// Serializes the private key to a PEM-encoded encrypted PKCS#1 RSAPrivateKey structure.
+        ///
+        /// The output will have a header of `-----BEGIN RSA PRIVATE KEY-----`.
+        #[corresponds(PEM_write_bio_RSAPrivateKey)]
+        private_key_to_pem_passphrase,
+        ffi::PEM_write_bio_RSAPrivateKey
+    }
+
+    to_der! {
+        /// Serializes the private key to a DER-encoded PKCS#1 RSAPrivateKey structure.
+        #[corresponds(i2d_RSAPrivateKey)]
+        private_key_to_der,
+        ffi::i2d_RSAPrivateKey
+    }
+
+    /// Decrypts data using the private key, returning the number of decrypted bytes.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `self` has no private components, or if `to` is smaller
+    /// than `self.size()`.
+    #[corresponds(RSA_private_decrypt)]
+    pub fn private_decrypt(
+        &self,
+        from: &[u8],
+        to: &mut [u8],
+        padding: Padding,
+    ) -> Result<usize, ErrorStack> {
+        assert!(from.len() <= i32::MAX as usize);
+        assert!(to.len() >= self.size() as usize);
+
+        unsafe {
+            let len = cvt_n(ffi::RSA_private_decrypt(
+                from.len() as LenType,
+                from.as_ptr(),
+                to.as_mut_ptr(),
+                self.as_ptr(),
+                padding.0,
+            ))?;
+            Ok(len as usize)
+        }
+    }
+
+    /// Encrypts data using the private key, returning the number of encrypted bytes.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `self` has no private components, or if `to` is smaller
+    /// than `self.size()`.
+    #[corresponds(RSA_private_encrypt)]
+    pub fn private_encrypt(
+        &self,
+        from: &[u8],
+        to: &mut [u8],
+        padding: Padding,
+    ) -> Result<usize, ErrorStack> {
+        assert!(from.len() <= i32::MAX as usize);
+        assert!(to.len() >= self.size() as usize);
+
+        unsafe {
+            let len = cvt_n(ffi::RSA_private_encrypt(
+                from.len() as LenType,
+                from.as_ptr(),
+                to.as_mut_ptr(),
+                self.as_ptr(),
+                padding.0,
+            ))?;
+            Ok(len as usize)
+        }
+    }
+
+    /// Returns a reference to the private exponent of the key.
+    #[corresponds(RSA_get0_key)]
+    pub fn d(&self) -> &BigNumRef {
+        unsafe {
+            let mut d = ptr::null();
+            RSA_get0_key(self.as_ptr(), ptr::null_mut(), ptr::null_mut(), &mut d);
+            BigNumRef::from_const_ptr(d)
+        }
+    }
+
+    /// Returns a reference to the first factor of the exponent of the key.
+    #[corresponds(RSA_get0_factors)]
+    pub fn p(&self) -> Option<&BigNumRef> {
+        unsafe {
+            let mut p = ptr::null();
+            RSA_get0_factors(self.as_ptr(), &mut p, ptr::null_mut());
+            BigNumRef::from_const_ptr_opt(p)
+        }
+    }
+
+    /// Returns a reference to the second factor of the exponent of the key.
+    #[corresponds(RSA_get0_factors)]
+    pub fn q(&self) -> Option<&BigNumRef> {
+        unsafe {
+            let mut q = ptr::null();
+            RSA_get0_factors(self.as_ptr(), ptr::null_mut(), &mut q);
+            BigNumRef::from_const_ptr_opt(q)
+        }
+    }
+
+    /// Returns a reference to the first exponent used for CRT calculations.
+    #[corresponds(RSA_get0_crt_params)]
+    pub fn dmp1(&self) -> Option<&BigNumRef> {
+        unsafe {
+            let mut dp = ptr::null();
+            RSA_get0_crt_params(self.as_ptr(), &mut dp, ptr::null_mut(), ptr::null_mut());
+            BigNumRef::from_const_ptr_opt(dp)
+        }
+    }
+
+    /// Returns a reference to the second exponent used for CRT calculations.
+    #[corresponds(RSA_get0_crt_params)]
+    pub fn dmq1(&self) -> Option<&BigNumRef> {
+        unsafe {
+            let mut dq = ptr::null();
+            RSA_get0_crt_params(self.as_ptr(), ptr::null_mut(), &mut dq, ptr::null_mut());
+            BigNumRef::from_const_ptr_opt(dq)
+        }
+    }
+
+    /// Returns a reference to the coefficient used for CRT calculations.
+    #[corresponds(RSA_get0_crt_params)]
+    pub fn iqmp(&self) -> Option<&BigNumRef> {
+        unsafe {
+            let mut qi = ptr::null();
+            RSA_get0_crt_params(self.as_ptr(), ptr::null_mut(), ptr::null_mut(), &mut qi);
+            BigNumRef::from_const_ptr_opt(qi)
+        }
+    }
+
+    /// Validates RSA parameters for correctness
+    #[corresponds(RSA_check_key)]
+    #[allow(clippy::unnecessary_cast)]
+    pub fn check_key(&self) -> Result<bool, ErrorStack> {
+        unsafe {
+            let result = ffi::RSA_check_key(self.as_ptr()) as i32;
+            if result == -1 {
+                Err(ErrorStack::get())
+            } else {
+                Ok(result == 1)
+            }
+        }
+    }
+}
+
+impl<T> RsaRef<T>
+where
+    T: HasPublic,
+{
+    to_pem! {
+        /// Serializes the public key into a PEM-encoded SubjectPublicKeyInfo structure.
+        ///
+        /// The output will have a header of `-----BEGIN PUBLIC KEY-----`.
+        #[corresponds(PEM_write_bio_RSA_PUBKEY)]
+        public_key_to_pem,
+        ffi::PEM_write_bio_RSA_PUBKEY
+    }
+
+    to_der! {
+        /// Serializes the public key into a DER-encoded SubjectPublicKeyInfo structure.
+        #[corresponds(i2d_RSA_PUBKEY)]
+        public_key_to_der,
+        ffi::i2d_RSA_PUBKEY
+    }
+
+    to_pem! {
+        /// Serializes the public key into a PEM-encoded PKCS#1 RSAPublicKey structure.
+        ///
+        /// The output will have a header of `-----BEGIN RSA PUBLIC KEY-----`.
+        #[corresponds(PEM_write_bio_RSAPublicKey)]
+        public_key_to_pem_pkcs1,
+        ffi::PEM_write_bio_RSAPublicKey
+    }
+
+    to_der! {
+        /// Serializes the public key into a DER-encoded PKCS#1 RSAPublicKey structure.
+        #[corresponds(i2d_RSAPublicKey)]
+        public_key_to_der_pkcs1,
+        ffi::i2d_RSAPublicKey
+    }
+
+    /// Returns the size of the modulus in bytes.
+    #[corresponds(RSA_size)]
+    pub fn size(&self) -> u32 {
+        unsafe { ffi::RSA_size(self.as_ptr()) as u32 }
+    }
+
+    /// Decrypts data using the public key, returning the number of decrypted bytes.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `to` is smaller than `self.size()`.
+    #[corresponds(RSA_public_decrypt)]
+    pub fn public_decrypt(
+        &self,
+        from: &[u8],
+        to: &mut [u8],
+        padding: Padding,
+    ) -> Result<usize, ErrorStack> {
+        assert!(from.len() <= i32::MAX as usize);
+        assert!(to.len() >= self.size() as usize);
+
+        unsafe {
+            let len = cvt_n(ffi::RSA_public_decrypt(
+                from.len() as LenType,
+                from.as_ptr(),
+                to.as_mut_ptr(),
+                self.as_ptr(),
+                padding.0,
+            ))?;
+            Ok(len as usize)
+        }
+    }
+
+    /// Encrypts data using the public key, returning the number of encrypted bytes.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `to` is smaller than `self.size()`.
+    #[corresponds(RSA_public_encrypt)]
+    pub fn public_encrypt(
+        &self,
+        from: &[u8],
+        to: &mut [u8],
+        padding: Padding,
+    ) -> Result<usize, ErrorStack> {
+        assert!(from.len() <= i32::MAX as usize);
+        assert!(to.len() >= self.size() as usize);
+
+        unsafe {
+            let len = cvt_n(ffi::RSA_public_encrypt(
+                from.len() as LenType,
+                from.as_ptr(),
+                to.as_mut_ptr(),
+                self.as_ptr(),
+                padding.0,
+            ))?;
+            Ok(len as usize)
+        }
+    }
+
+    /// Returns a reference to the modulus of the key.
+    #[corresponds(RSA_get0_key)]
+    pub fn n(&self) -> &BigNumRef {
+        unsafe {
+            let mut n = ptr::null();
+            RSA_get0_key(self.as_ptr(), &mut n, ptr::null_mut(), ptr::null_mut());
+            BigNumRef::from_const_ptr(n)
+        }
+    }
+
+    /// Returns a reference to the public exponent of the key.
+    #[corresponds(RSA_get0_key)]
+    pub fn e(&self) -> &BigNumRef {
+        unsafe {
+            let mut e = ptr::null();
+            RSA_get0_key(self.as_ptr(), ptr::null_mut(), &mut e, ptr::null_mut());
+            BigNumRef::from_const_ptr(e)
+        }
+    }
+}
+
+impl Rsa<Public> {
+    /// Creates a new RSA key with only public components.
+    ///
+    /// `n` is the modulus common to both public and private key.
+    /// `e` is the public exponent.
+    ///
+    /// This corresponds to [`RSA_new`] and uses [`RSA_set0_key`].
+    ///
+    /// [`RSA_new`]: https://www.openssl.org/docs/manmaster/crypto/RSA_new.html
+    /// [`RSA_set0_key`]: https://www.openssl.org/docs/manmaster/crypto/RSA_set0_key.html
+    pub fn from_public_components(n: BigNum, e: BigNum) -> Result<Rsa<Public>, ErrorStack> {
+        unsafe {
+            let rsa = cvt_p(ffi::RSA_new())?;
+            RSA_set0_key(rsa, n.as_ptr(), e.as_ptr(), ptr::null_mut());
+            mem::forget((n, e));
+            Ok(Rsa::from_ptr(rsa))
+        }
+    }
+
+    from_pem! {
+        /// Decodes a PEM-encoded SubjectPublicKeyInfo structure containing an RSA key.
+        ///
+        /// The input should have a header of `-----BEGIN PUBLIC KEY-----`.
+        #[corresponds(PEM_read_bio_RSA_PUBKEY)]
+        public_key_from_pem,
+        Rsa<Public>,
+        ffi::PEM_read_bio_RSA_PUBKEY
+    }
+
+    from_pem! {
+        /// Decodes a PEM-encoded PKCS#1 RSAPublicKey structure.
+        ///
+        /// The input should have a header of `-----BEGIN RSA PUBLIC KEY-----`.
+        #[corresponds(PEM_read_bio_RSAPublicKey)]
+        public_key_from_pem_pkcs1,
+        Rsa<Public>,
+        ffi::PEM_read_bio_RSAPublicKey
+    }
+
+    from_der! {
+        /// Decodes a DER-encoded SubjectPublicKeyInfo structure containing an RSA key.
+        #[corresponds(d2i_RSA_PUBKEY)]
+        public_key_from_der,
+        Rsa<Public>,
+        ffi::d2i_RSA_PUBKEY
+    }
+
+    from_der! {
+        /// Decodes a DER-encoded PKCS#1 RSAPublicKey structure.
+        #[corresponds(d2i_RSAPublicKey)]
+        public_key_from_der_pkcs1,
+        Rsa<Public>,
+        ffi::d2i_RSAPublicKey
+    }
+}
+
+pub struct RsaPrivateKeyBuilder {
+    rsa: Rsa<Private>,
+}
+
+impl RsaPrivateKeyBuilder {
+    /// Creates a new `RsaPrivateKeyBuilder`.
+    ///
+    /// `n` is the modulus common to both public and private key.
+    /// `e` is the public exponent and `d` is the private exponent.
+    ///
+    /// This corresponds to [`RSA_new`] and uses [`RSA_set0_key`].
+    ///
+    /// [`RSA_new`]: https://www.openssl.org/docs/manmaster/crypto/RSA_new.html
+    /// [`RSA_set0_key`]: https://www.openssl.org/docs/manmaster/crypto/RSA_set0_key.html
+    pub fn new(n: BigNum, e: BigNum, d: BigNum) -> Result<RsaPrivateKeyBuilder, ErrorStack> {
+        unsafe {
+            let rsa = cvt_p(ffi::RSA_new())?;
+            RSA_set0_key(rsa, n.as_ptr(), e.as_ptr(), d.as_ptr());
+            mem::forget((n, e, d));
+            Ok(RsaPrivateKeyBuilder {
+                rsa: Rsa::from_ptr(rsa),
+            })
+        }
+    }
+
+    /// Sets the factors of the Rsa key.
+    ///
+    /// `p` and `q` are the first and second factors of `n`.
+    #[corresponds(RSA_set0_factors)]
+    // FIXME should be infallible
+    pub fn set_factors(self, p: BigNum, q: BigNum) -> Result<RsaPrivateKeyBuilder, ErrorStack> {
+        unsafe {
+            RSA_set0_factors(self.rsa.as_ptr(), p.as_ptr(), q.as_ptr());
+            mem::forget((p, q));
+        }
+        Ok(self)
+    }
+
+    /// Sets the Chinese Remainder Theorem params of the Rsa key.
+    ///
+    /// `dmp1`, `dmq1`, and `iqmp` are the exponents and coefficient for
+    /// CRT calculations which is used to speed up RSA operations.
+    #[corresponds(RSA_set0_crt_params)]
+    // FIXME should be infallible
+    pub fn set_crt_params(
+        self,
+        dmp1: BigNum,
+        dmq1: BigNum,
+        iqmp: BigNum,
+    ) -> Result<RsaPrivateKeyBuilder, ErrorStack> {
+        unsafe {
+            RSA_set0_crt_params(
+                self.rsa.as_ptr(),
+                dmp1.as_ptr(),
+                dmq1.as_ptr(),
+                iqmp.as_ptr(),
+            );
+            mem::forget((dmp1, dmq1, iqmp));
+        }
+        Ok(self)
+    }
+
+    /// Returns the Rsa key.
+    pub fn build(self) -> Rsa<Private> {
+        self.rsa
+    }
+}
+
+impl Rsa<Private> {
+    /// Creates a new RSA key with private components (public components are assumed).
+    ///
+    /// This a convenience method over:
+    /// ```
+    /// # use openssl::rsa::RsaPrivateKeyBuilder;
+    /// # fn main() -> Result<(), Box<dyn std::error::Error>> {
+    /// # let bn = || openssl::bn::BigNum::new().unwrap();
+    /// # let (n, e, d, p, q, dmp1, dmq1, iqmp) = (bn(), bn(), bn(), bn(), bn(), bn(), bn(), bn());
+    /// RsaPrivateKeyBuilder::new(n, e, d)?
+    ///     .set_factors(p, q)?
+    ///     .set_crt_params(dmp1, dmq1, iqmp)?
+    ///     .build();
+    /// # Ok(()) }
+    /// ```
+    #[allow(clippy::too_many_arguments, clippy::many_single_char_names)]
+    pub fn from_private_components(
+        n: BigNum,
+        e: BigNum,
+        d: BigNum,
+        p: BigNum,
+        q: BigNum,
+        dmp1: BigNum,
+        dmq1: BigNum,
+        iqmp: BigNum,
+    ) -> Result<Rsa<Private>, ErrorStack> {
+        Ok(RsaPrivateKeyBuilder::new(n, e, d)?
+            .set_factors(p, q)?
+            .set_crt_params(dmp1, dmq1, iqmp)?
+            .build())
+    }
+
+    /// Generates a public/private key pair with the specified size.
+    ///
+    /// The public exponent will be 65537.
+    #[corresponds(RSA_generate_key_ex)]
+    pub fn generate(bits: u32) -> Result<Rsa<Private>, ErrorStack> {
+        let e = BigNum::from_u32(ffi::RSA_F4 as u32)?;
+        Rsa::generate_with_e(bits, &e)
+    }
+
+    /// Generates a public/private key pair with the specified size and a custom exponent.
+    ///
+    /// Unless you have specific needs and know what you're doing, use `Rsa::generate` instead.
+    #[corresponds(RSA_generate_key_ex)]
+    pub fn generate_with_e(bits: u32, e: &BigNumRef) -> Result<Rsa<Private>, ErrorStack> {
+        unsafe {
+            let rsa = Rsa::from_ptr(cvt_p(ffi::RSA_new())?);
+            cvt(ffi::RSA_generate_key_ex(
+                rsa.0,
+                bits as c_int,
+                e.as_ptr(),
+                ptr::null_mut(),
+            ))?;
+            Ok(rsa)
+        }
+    }
+
+    // FIXME these need to identify input formats
+    private_key_from_pem! {
+        /// Deserializes a private key from a PEM-encoded PKCS#1 RSAPrivateKey structure.
+        #[corresponds(PEM_read_bio_RSAPrivateKey)]
+        private_key_from_pem,
+
+        /// Deserializes a private key from a PEM-encoded encrypted PKCS#1 RSAPrivateKey structure.
+        #[corresponds(PEM_read_bio_RSAPrivateKey)]
+        private_key_from_pem_passphrase,
+
+        /// Deserializes a private key from a PEM-encoded encrypted PKCS#1 RSAPrivateKey structure.
+        ///
+        /// The callback should fill the password into the provided buffer and return its length.
+        #[corresponds(PEM_read_bio_RSAPrivateKey)]
+        private_key_from_pem_callback,
+        Rsa<Private>,
+        ffi::PEM_read_bio_RSAPrivateKey
+    }
+
+    from_der! {
+        /// Decodes a DER-encoded PKCS#1 RSAPrivateKey structure.
+        #[corresponds(d2i_RSAPrivateKey)]
+        private_key_from_der,
+        Rsa<Private>,
+        ffi::d2i_RSAPrivateKey
+    }
+}
+
+impl<T> fmt::Debug for Rsa<T> {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        write!(f, "Rsa")
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl273, boringssl))] {
+        use ffi::{
+            RSA_get0_key, RSA_get0_factors, RSA_get0_crt_params, RSA_set0_key, RSA_set0_factors,
+            RSA_set0_crt_params,
+        };
+    } else {
+        #[allow(bad_style)]
+        unsafe fn RSA_get0_key(
+            r: *const ffi::RSA,
+            n: *mut *const ffi::BIGNUM,
+            e: *mut *const ffi::BIGNUM,
+            d: *mut *const ffi::BIGNUM,
+        ) {
+            if !n.is_null() {
+                *n = (*r).n;
+            }
+            if !e.is_null() {
+                *e = (*r).e;
+            }
+            if !d.is_null() {
+                *d = (*r).d;
+            }
+        }
+
+        #[allow(bad_style)]
+        unsafe fn RSA_get0_factors(
+            r: *const ffi::RSA,
+            p: *mut *const ffi::BIGNUM,
+            q: *mut *const ffi::BIGNUM,
+        ) {
+            if !p.is_null() {
+                *p = (*r).p;
+            }
+            if !q.is_null() {
+                *q = (*r).q;
+            }
+        }
+
+        #[allow(bad_style)]
+        unsafe fn RSA_get0_crt_params(
+            r: *const ffi::RSA,
+            dmp1: *mut *const ffi::BIGNUM,
+            dmq1: *mut *const ffi::BIGNUM,
+            iqmp: *mut *const ffi::BIGNUM,
+        ) {
+            if !dmp1.is_null() {
+                *dmp1 = (*r).dmp1;
+            }
+            if !dmq1.is_null() {
+                *dmq1 = (*r).dmq1;
+            }
+            if !iqmp.is_null() {
+                *iqmp = (*r).iqmp;
+            }
+        }
+
+        #[allow(bad_style)]
+        unsafe fn RSA_set0_key(
+            r: *mut ffi::RSA,
+            n: *mut ffi::BIGNUM,
+            e: *mut ffi::BIGNUM,
+            d: *mut ffi::BIGNUM,
+        ) -> c_int {
+            (*r).n = n;
+            (*r).e = e;
+            (*r).d = d;
+            1
+        }
+
+        #[allow(bad_style)]
+        unsafe fn RSA_set0_factors(
+            r: *mut ffi::RSA,
+            p: *mut ffi::BIGNUM,
+            q: *mut ffi::BIGNUM,
+        ) -> c_int {
+            (*r).p = p;
+            (*r).q = q;
+            1
+        }
+
+        #[allow(bad_style)]
+        unsafe fn RSA_set0_crt_params(
+            r: *mut ffi::RSA,
+            dmp1: *mut ffi::BIGNUM,
+            dmq1: *mut ffi::BIGNUM,
+            iqmp: *mut ffi::BIGNUM,
+        ) -> c_int {
+            (*r).dmp1 = dmp1;
+            (*r).dmq1 = dmq1;
+            (*r).iqmp = iqmp;
+            1
+        }
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use crate::symm::Cipher;
+
+    use super::*;
+
+    #[test]
+    fn test_from_password() {
+        let key = include_bytes!("../test/rsa-encrypted.pem");
+        Rsa::private_key_from_pem_passphrase(key, b"mypass").unwrap();
+    }
+
+    #[test]
+    fn test_from_password_callback() {
+        let mut password_queried = false;
+        let key = include_bytes!("../test/rsa-encrypted.pem");
+        Rsa::private_key_from_pem_callback(key, |password| {
+            password_queried = true;
+            password[..6].copy_from_slice(b"mypass");
+            Ok(6)
+        })
+        .unwrap();
+
+        assert!(password_queried);
+    }
+
+    #[test]
+    fn test_to_password() {
+        let key = Rsa::generate(2048).unwrap();
+        let pem = key
+            .private_key_to_pem_passphrase(Cipher::aes_128_cbc(), b"foobar")
+            .unwrap();
+        Rsa::private_key_from_pem_passphrase(&pem, b"foobar").unwrap();
+        assert!(Rsa::private_key_from_pem_passphrase(&pem, b"fizzbuzz").is_err());
+    }
+
+    #[test]
+    fn test_public_encrypt_private_decrypt_with_padding() {
+        let key = include_bytes!("../test/rsa.pem.pub");
+        let public_key = Rsa::public_key_from_pem(key).unwrap();
+
+        let mut result = vec![0; public_key.size() as usize];
+        let original_data = b"This is test";
+        let len = public_key
+            .public_encrypt(original_data, &mut result, Padding::PKCS1)
+            .unwrap();
+        assert_eq!(len, 256);
+
+        let pkey = include_bytes!("../test/rsa.pem");
+        let private_key = Rsa::private_key_from_pem(pkey).unwrap();
+        let mut dec_result = vec![0; private_key.size() as usize];
+        let len = private_key
+            .private_decrypt(&result, &mut dec_result, Padding::PKCS1)
+            .unwrap();
+
+        assert_eq!(&dec_result[..len], original_data);
+    }
+
+    #[test]
+    fn test_private_encrypt() {
+        let k0 = super::Rsa::generate(512).unwrap();
+        let k0pkey = k0.public_key_to_pem().unwrap();
+        let k1 = super::Rsa::public_key_from_pem(&k0pkey).unwrap();
+
+        let msg = vec![0xdeu8, 0xadu8, 0xd0u8, 0x0du8];
+
+        let mut emesg = vec![0; k0.size() as usize];
+        k0.private_encrypt(&msg, &mut emesg, Padding::PKCS1)
+            .unwrap();
+        let mut dmesg = vec![0; k1.size() as usize];
+        let len = k1
+            .public_decrypt(&emesg, &mut dmesg, Padding::PKCS1)
+            .unwrap();
+        assert_eq!(msg, &dmesg[..len]);
+    }
+
+    #[test]
+    fn test_public_encrypt() {
+        let k0 = super::Rsa::generate(512).unwrap();
+        let k0pkey = k0.private_key_to_pem().unwrap();
+        let k1 = super::Rsa::private_key_from_pem(&k0pkey).unwrap();
+
+        let msg = vec![0xdeu8, 0xadu8, 0xd0u8, 0x0du8];
+
+        let mut emesg = vec![0; k0.size() as usize];
+        k0.public_encrypt(&msg, &mut emesg, Padding::PKCS1).unwrap();
+        let mut dmesg = vec![0; k1.size() as usize];
+        let len = k1
+            .private_decrypt(&emesg, &mut dmesg, Padding::PKCS1)
+            .unwrap();
+        assert_eq!(msg, &dmesg[..len]);
+    }
+
+    #[test]
+    fn test_public_key_from_pem_pkcs1() {
+        let key = include_bytes!("../test/pkcs1.pem.pub");
+        Rsa::public_key_from_pem_pkcs1(key).unwrap();
+    }
+
+    #[test]
+    #[should_panic]
+    fn test_public_key_from_pem_pkcs1_file_panic() {
+        let key = include_bytes!("../test/key.pem.pub");
+        Rsa::public_key_from_pem_pkcs1(key).unwrap();
+    }
+
+    #[test]
+    fn test_public_key_to_pem_pkcs1() {
+        let keypair = super::Rsa::generate(512).unwrap();
+        let pubkey_pem = keypair.public_key_to_pem_pkcs1().unwrap();
+        super::Rsa::public_key_from_pem_pkcs1(&pubkey_pem).unwrap();
+    }
+
+    #[test]
+    #[should_panic]
+    fn test_public_key_from_pem_pkcs1_generate_panic() {
+        let keypair = super::Rsa::generate(512).unwrap();
+        let pubkey_pem = keypair.public_key_to_pem().unwrap();
+        super::Rsa::public_key_from_pem_pkcs1(&pubkey_pem).unwrap();
+    }
+
+    #[test]
+    fn test_pem_pkcs1_encrypt() {
+        let keypair = super::Rsa::generate(2048).unwrap();
+        let pubkey_pem = keypair.public_key_to_pem_pkcs1().unwrap();
+        let pubkey = super::Rsa::public_key_from_pem_pkcs1(&pubkey_pem).unwrap();
+        let msg = b"Hello, world!";
+
+        let mut encrypted = vec![0; pubkey.size() as usize];
+        let len = pubkey
+            .public_encrypt(msg, &mut encrypted, Padding::PKCS1)
+            .unwrap();
+        assert!(len > msg.len());
+        let mut decrypted = vec![0; keypair.size() as usize];
+        let len = keypair
+            .private_decrypt(&encrypted, &mut decrypted, Padding::PKCS1)
+            .unwrap();
+        assert_eq!(len, msg.len());
+        assert_eq!(&decrypted[..len], msg);
+    }
+
+    #[test]
+    fn test_pem_pkcs1_padding() {
+        let keypair = super::Rsa::generate(2048).unwrap();
+        let pubkey_pem = keypair.public_key_to_pem_pkcs1().unwrap();
+        let pubkey = super::Rsa::public_key_from_pem_pkcs1(&pubkey_pem).unwrap();
+        let msg = b"foo";
+
+        let mut encrypted1 = vec![0; pubkey.size() as usize];
+        let mut encrypted2 = vec![0; pubkey.size() as usize];
+        let len1 = pubkey
+            .public_encrypt(msg, &mut encrypted1, Padding::PKCS1)
+            .unwrap();
+        let len2 = pubkey
+            .public_encrypt(msg, &mut encrypted2, Padding::PKCS1)
+            .unwrap();
+        assert!(len1 > (msg.len() + 1));
+        assert_eq!(len1, len2);
+        assert_ne!(encrypted1, encrypted2);
+    }
+
+    #[test]
+    #[allow(clippy::redundant_clone)]
+    fn clone() {
+        let key = Rsa::generate(2048).unwrap();
+        drop(key.clone());
+    }
+
+    #[test]
+    fn generate_with_e() {
+        let e = BigNum::from_u32(0x10001).unwrap();
+        Rsa::generate_with_e(2048, &e).unwrap();
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/sha.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/sha.rs
--- 43.0.0-1/rust-vendor/openssl/src/sha.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/sha.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,463 @@
+//! The SHA family of hashes.
+//!
+//! SHA, or Secure Hash Algorithms, are a family of cryptographic hashing algorithms published by
+//! the National Institute of Standards and Technology (NIST).  Hash algorithms such as those in
+//! the SHA family are used to map data of an arbitrary size to a fixed-size string of bytes.
+//! As cryptographic hashing algorithms, these mappings have the property of being irreversible.
+//! This property makes hash algorithms like these excellent for uses such as verifying the
+//! contents of a file- if you know the hash you expect beforehand, then you can verify that the
+//! data you have is correct if it hashes to the same value.
+//!
+//! # Examples
+//!
+//! When dealing with data that becomes available in chunks, such as while buffering data from IO,
+//! you can create a hasher that you can repeatedly update to add bytes to.
+//!
+//! ```rust
+//! use openssl::sha;
+//!
+//! let mut hasher = sha::Sha256::new();
+//!
+//! hasher.update(b"Hello, ");
+//! hasher.update(b"world");
+//!
+//! let hash = hasher.finish();
+//! println!("Hashed \"Hello, world\" to {}", hex::encode(hash));
+//! ```
+//!
+//! On the other hand, if you already have access to all of the data you would like to hash, you
+//! may prefer to use the slightly simpler method of simply calling the hash function corresponding
+//! to the algorithm you want to use.
+//!
+//! ```rust
+//! use openssl::sha::sha256;
+//!
+//! let hash = sha256(b"your data or message");
+//! println!("Hash = {}", hex::encode(hash));
+//! ```
+use cfg_if::cfg_if;
+use libc::c_void;
+use openssl_macros::corresponds;
+use std::mem::MaybeUninit;
+
+/// Computes the SHA1 hash of some data.
+///
+/// # Warning
+///
+/// SHA1 is known to be insecure - it should not be used unless required for
+/// compatibility with existing systems.
+#[corresponds(SHA1)]
+#[inline]
+pub fn sha1(data: &[u8]) -> [u8; 20] {
+    unsafe {
+        let mut hash = MaybeUninit::<[u8; 20]>::uninit();
+        ffi::SHA1(data.as_ptr(), data.len(), hash.as_mut_ptr() as *mut _);
+        hash.assume_init()
+    }
+}
+
+/// Computes the SHA224 hash of some data.
+#[corresponds(SHA224)]
+#[inline]
+pub fn sha224(data: &[u8]) -> [u8; 28] {
+    unsafe {
+        let mut hash = MaybeUninit::<[u8; 28]>::uninit();
+        ffi::SHA224(data.as_ptr(), data.len(), hash.as_mut_ptr() as *mut _);
+        hash.assume_init()
+    }
+}
+
+/// Computes the SHA256 hash of some data.
+#[corresponds(SHA256)]
+#[inline]
+pub fn sha256(data: &[u8]) -> [u8; 32] {
+    unsafe {
+        let mut hash = MaybeUninit::<[u8; 32]>::uninit();
+        ffi::SHA256(data.as_ptr(), data.len(), hash.as_mut_ptr() as *mut _);
+        hash.assume_init()
+    }
+}
+
+/// Computes the SHA384 hash of some data.
+#[corresponds(SHA384)]
+#[inline]
+pub fn sha384(data: &[u8]) -> [u8; 48] {
+    unsafe {
+        let mut hash = MaybeUninit::<[u8; 48]>::uninit();
+        ffi::SHA384(data.as_ptr(), data.len(), hash.as_mut_ptr() as *mut _);
+        hash.assume_init()
+    }
+}
+
+/// Computes the SHA512 hash of some data.
+#[corresponds(SHA512)]
+#[inline]
+pub fn sha512(data: &[u8]) -> [u8; 64] {
+    unsafe {
+        let mut hash = MaybeUninit::<[u8; 64]>::uninit();
+        ffi::SHA512(data.as_ptr(), data.len(), hash.as_mut_ptr() as *mut _);
+        hash.assume_init()
+    }
+}
+
+cfg_if! {
+    if #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))] {
+        /// An object which calculates a SHA1 hash of some data.
+        ///
+        /// # Warning
+        ///
+        /// SHA1 is known to be insecure - it should not be used unless required for
+        /// compatibility with existing systems.
+        #[derive(Clone)]
+        pub struct Sha1(ffi::SHA_CTX);
+
+        impl Default for Sha1 {
+            #[inline]
+            fn default() -> Sha1 {
+                Sha1::new()
+            }
+        }
+
+        impl Sha1 {
+            /// Creates a new hasher.
+            #[corresponds(SHA1_Init)]
+            #[inline]
+            pub fn new() -> Sha1 {
+                unsafe {
+                    let mut ctx = MaybeUninit::uninit();
+                    ffi::SHA1_Init( ctx.as_mut_ptr());
+                    Sha1(ctx.assume_init())
+                }
+            }
+
+            /// Feeds some data into the hasher.
+            ///
+            /// This can be called multiple times.
+            #[corresponds(SHA1_Update)]
+            #[inline]
+            pub fn update(&mut self, buf: &[u8]) {
+                unsafe {
+                    ffi::SHA1_Update(&mut self.0, buf.as_ptr() as *const c_void, buf.len());
+                }
+            }
+
+            /// Returns the hash of the data.
+            #[corresponds(SHA1_Final)]
+            #[inline]
+            pub fn finish(mut self) -> [u8; 20] {
+                unsafe {
+                    let mut hash = MaybeUninit::<[u8; 20]>::uninit();
+                    ffi::SHA1_Final(hash.as_mut_ptr() as *mut _, &mut self.0);
+                    hash.assume_init()
+                }
+            }
+        }
+
+        /// An object which calculates a SHA224 hash of some data.
+        #[derive(Clone)]
+        pub struct Sha224(ffi::SHA256_CTX);
+
+        impl Default for Sha224 {
+            #[inline]
+            fn default() -> Sha224 {
+                Sha224::new()
+            }
+        }
+
+        impl Sha224 {
+            /// Creates a new hasher.
+            #[corresponds(SHA224_Init)]
+            #[inline]
+            pub fn new() -> Sha224 {
+                unsafe {
+                    let mut ctx = MaybeUninit::uninit();
+                    ffi::SHA224_Init(ctx.as_mut_ptr());
+                    Sha224(ctx.assume_init())
+                }
+            }
+
+            /// Feeds some data into the hasher.
+            ///
+            /// This can be called multiple times.
+            #[corresponds(SHA224_Update)]
+            #[inline]
+            pub fn update(&mut self, buf: &[u8]) {
+                unsafe {
+                    ffi::SHA224_Update(&mut self.0, buf.as_ptr() as *const c_void, buf.len());
+                }
+            }
+
+            /// Returns the hash of the data.
+            #[corresponds(SHA224_Final)]
+            #[inline]
+            pub fn finish(mut self) -> [u8; 28] {
+                unsafe {
+                    let mut hash = MaybeUninit::<[u8; 28]>::uninit();
+                    ffi::SHA224_Final(hash.as_mut_ptr() as *mut _, &mut self.0);
+                    hash.assume_init()
+                }
+            }
+        }
+
+        /// An object which calculates a SHA256 hash of some data.
+        #[derive(Clone)]
+        pub struct Sha256(ffi::SHA256_CTX);
+
+        impl Default for Sha256 {
+            #[inline]
+            fn default() -> Sha256 {
+                Sha256::new()
+            }
+        }
+
+        impl Sha256 {
+            /// Creates a new hasher.
+            #[corresponds(SHA256_Init)]
+            #[inline]
+            pub fn new() -> Sha256 {
+                unsafe {
+                    let mut ctx = MaybeUninit::uninit();
+                    ffi::SHA256_Init(ctx.as_mut_ptr());
+                    Sha256(ctx.assume_init())
+                }
+            }
+
+            /// Feeds some data into the hasher.
+            ///
+            /// This can be called multiple times.
+            #[corresponds(SHA256_Update)]
+            #[inline]
+            pub fn update(&mut self, buf: &[u8]) {
+                unsafe {
+                    ffi::SHA256_Update(&mut self.0, buf.as_ptr() as *const c_void, buf.len());
+                }
+            }
+
+            /// Returns the hash of the data.
+            #[corresponds(SHA256_Final)]
+            #[inline]
+            pub fn finish(mut self) -> [u8; 32] {
+                unsafe {
+                    let mut hash = MaybeUninit::<[u8; 32]>::uninit();
+                    ffi::SHA256_Final(hash.as_mut_ptr() as *mut _, &mut self.0);
+                    hash.assume_init()
+                }
+            }
+        }
+
+        /// An object which calculates a SHA384 hash of some data.
+        #[derive(Clone)]
+        pub struct Sha384(ffi::SHA512_CTX);
+
+        impl Default for Sha384 {
+            #[inline]
+            fn default() -> Sha384 {
+                Sha384::new()
+            }
+        }
+
+        impl Sha384 {
+            /// Creates a new hasher.
+            #[corresponds(SHA384_Init)]
+            #[inline]
+            pub fn new() -> Sha384 {
+                unsafe {
+                    let mut ctx = MaybeUninit::uninit();
+                    ffi::SHA384_Init(ctx.as_mut_ptr());
+                    Sha384(ctx.assume_init())
+                }
+            }
+
+            /// Feeds some data into the hasher.
+            ///
+            /// This can be called multiple times.
+            #[corresponds(SHA384_Update)]
+            #[inline]
+            pub fn update(&mut self, buf: &[u8]) {
+                unsafe {
+                    ffi::SHA384_Update(&mut self.0, buf.as_ptr() as *const c_void, buf.len());
+                }
+            }
+
+            /// Returns the hash of the data.
+            #[corresponds(SHA384_Final)]
+            #[inline]
+            pub fn finish(mut self) -> [u8; 48] {
+                unsafe {
+                    let mut hash = MaybeUninit::<[u8; 48]>::uninit();
+                    ffi::SHA384_Final(hash.as_mut_ptr() as *mut _, &mut self.0);
+                    hash.assume_init()
+                }
+            }
+        }
+
+        /// An object which calculates a SHA512 hash of some data.
+        #[derive(Clone)]
+        pub struct Sha512(ffi::SHA512_CTX);
+
+        impl Default for Sha512 {
+            #[inline]
+            fn default() -> Sha512 {
+                Sha512::new()
+            }
+        }
+
+        impl Sha512 {
+            /// Creates a new hasher.
+            #[corresponds(SHA512_Init)]
+            #[inline]
+            pub fn new() -> Sha512 {
+                unsafe {
+                    let mut ctx = MaybeUninit::uninit();
+                    ffi::SHA512_Init(ctx.as_mut_ptr());
+                    Sha512(ctx.assume_init())
+                }
+            }
+
+            /// Feeds some data into the hasher.
+            ///
+            /// This can be called multiple times.
+            #[corresponds(SHA512_Update)]
+            #[inline]
+            pub fn update(&mut self, buf: &[u8]) {
+                unsafe {
+                    ffi::SHA512_Update(&mut self.0, buf.as_ptr() as *const c_void, buf.len());
+                }
+            }
+
+            /// Returns the hash of the data.
+            #[corresponds(SHA512_Final)]
+            #[inline]
+            pub fn finish(mut self) -> [u8; 64] {
+                unsafe {
+                    let mut hash= MaybeUninit::<[u8; 64]>::uninit();
+                ffi::SHA512_Final(hash.as_mut_ptr() as *mut _, &mut self.0);
+                hash.assume_init()
+            }
+        }
+    }
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+
+    #[test]
+    fn standalone_1() {
+        let data = b"abc";
+        let expected = "a9993e364706816aba3e25717850c26c9cd0d89d";
+
+        assert_eq!(hex::encode(sha1(data)), expected);
+    }
+
+    #[test]
+    #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+    fn struct_1() {
+        let expected = "a9993e364706816aba3e25717850c26c9cd0d89d";
+
+        let mut hasher = Sha1::new();
+        hasher.update(b"a");
+        hasher.update(b"bc");
+        assert_eq!(hex::encode(hasher.finish()), expected);
+    }
+
+    #[test]
+    #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+    fn cloning_allows_incremental_hashing() {
+        let expected = "a9993e364706816aba3e25717850c26c9cd0d89d";
+
+        let mut hasher = Sha1::new();
+        hasher.update(b"a");
+
+        let mut incr_hasher = hasher.clone();
+        incr_hasher.update(b"bc");
+
+        assert_eq!(hex::encode(incr_hasher.finish()), expected);
+        assert_ne!(hex::encode(hasher.finish()), expected);
+    }
+
+    #[test]
+    fn standalone_224() {
+        let data = b"abc";
+        let expected = "23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7";
+
+        assert_eq!(hex::encode(sha224(data)), expected);
+    }
+
+    #[test]
+    #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+    fn struct_224() {
+        let expected = "23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7";
+
+        let mut hasher = Sha224::new();
+        hasher.update(b"a");
+        hasher.update(b"bc");
+        assert_eq!(hex::encode(hasher.finish()), expected);
+    }
+
+    #[test]
+    fn standalone_256() {
+        let data = b"abc";
+        let expected = "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad";
+
+        assert_eq!(hex::encode(sha256(data)), expected);
+    }
+
+    #[test]
+    #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+    fn struct_256() {
+        let expected = "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad";
+
+        let mut hasher = Sha256::new();
+        hasher.update(b"a");
+        hasher.update(b"bc");
+        assert_eq!(hex::encode(hasher.finish()), expected);
+    }
+
+    #[test]
+    fn standalone_384() {
+        let data = b"abc";
+        let expected =
+            "cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e\
+             7cc2358baeca134c825a7";
+
+        assert_eq!(hex::encode(&sha384(data)[..]), expected);
+    }
+
+    #[test]
+    #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+    fn struct_384() {
+        let expected =
+            "cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e\
+             7cc2358baeca134c825a7";
+
+        let mut hasher = Sha384::new();
+        hasher.update(b"a");
+        hasher.update(b"bc");
+        assert_eq!(hex::encode(&hasher.finish()[..]), expected);
+    }
+
+    #[test]
+    fn standalone_512() {
+        let data = b"abc";
+        let expected =
+            "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274\
+             fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f";
+
+        assert_eq!(hex::encode(&sha512(data)[..]), expected);
+    }
+
+    #[test]
+    #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+    fn struct_512() {
+        let expected =
+            "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274\
+             fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f";
+
+        let mut hasher = Sha512::new();
+        hasher.update(b"a");
+        hasher.update(b"bc");
+        assert_eq!(hex::encode(&hasher.finish()[..]), expected);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/sign.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/sign.rs
--- 43.0.0-1/rust-vendor/openssl/src/sign.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/sign.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,886 @@
+//! Message signatures.
+//!
+//! The `Signer` allows for the computation of cryptographic signatures of
+//! data given a private key. The `Verifier` can then be used with the
+//! corresponding public key to verify the integrity and authenticity of that
+//! data given the signature.
+//!
+//! # Examples
+//!
+//! Sign and verify data given an RSA keypair:
+//!
+//! ```rust
+//! use openssl::sign::{Signer, Verifier};
+//! use openssl::rsa::Rsa;
+//! use openssl::pkey::PKey;
+//! use openssl::hash::MessageDigest;
+//!
+//! // Generate a keypair
+//! let keypair = Rsa::generate(2048).unwrap();
+//! let keypair = PKey::from_rsa(keypair).unwrap();
+//!
+//! let data = b"hello, world!";
+//! let data2 = b"hola, mundo!";
+//!
+//! // Sign the data
+//! let mut signer = Signer::new(MessageDigest::sha256(), &keypair).unwrap();
+//! signer.update(data).unwrap();
+//! signer.update(data2).unwrap();
+//! let signature = signer.sign_to_vec().unwrap();
+//!
+//! // Verify the data
+//! let mut verifier = Verifier::new(MessageDigest::sha256(), &keypair).unwrap();
+//! verifier.update(data).unwrap();
+//! verifier.update(data2).unwrap();
+//! assert!(verifier.verify(&signature).unwrap());
+//! ```
+
+#![cfg_attr(
+    not(boringssl),
+    doc = r#"\
+
+Compute an HMAC:
+
+```rust
+use openssl::hash::MessageDigest;
+use openssl::memcmp;
+use openssl::pkey::PKey;
+use openssl::sign::Signer;
+
+// Create a PKey
+let key = PKey::hmac(b"my secret").unwrap();
+
+let data = b"hello, world!";
+let data2 = b"hola, mundo!";
+
+// Compute the HMAC
+let mut signer = Signer::new(MessageDigest::sha256(), &key).unwrap();
+signer.update(data).unwrap();
+signer.update(data2).unwrap();
+let hmac = signer.sign_to_vec().unwrap();
+
+// `Verifier` cannot be used with HMACs; use the `memcmp::eq` function instead
+//
+// Do not simply check for equality with `==`!
+# let target = hmac.clone();
+assert!(memcmp::eq(&hmac, &target));
+```"#
+)]
+
+use cfg_if::cfg_if;
+use foreign_types::ForeignTypeRef;
+use libc::c_int;
+use std::io::{self, Write};
+use std::marker::PhantomData;
+use std::ptr;
+
+use crate::error::ErrorStack;
+use crate::hash::MessageDigest;
+use crate::pkey::{HasPrivate, HasPublic, PKeyRef};
+use crate::rsa::Padding;
+use crate::{cvt, cvt_p};
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl382))] {
+        use ffi::{EVP_MD_CTX_free, EVP_MD_CTX_new};
+    } else {
+        use ffi::{EVP_MD_CTX_create as EVP_MD_CTX_new, EVP_MD_CTX_destroy as EVP_MD_CTX_free};
+    }
+}
+
+/// Salt lengths that must be used with `set_rsa_pss_saltlen`.
+pub struct RsaPssSaltlen(c_int);
+
+impl RsaPssSaltlen {
+    /// Returns the integer representation of `RsaPssSaltlen`.
+    pub(crate) fn as_raw(&self) -> c_int {
+        self.0
+    }
+
+    /// Sets the salt length to the given value.
+    pub fn custom(val: c_int) -> RsaPssSaltlen {
+        RsaPssSaltlen(val)
+    }
+
+    /// The salt length is set to the digest length.
+    /// Corresponds to the special value `-1`.
+    pub const DIGEST_LENGTH: RsaPssSaltlen = RsaPssSaltlen(-1);
+    /// The salt length is set to the maximum permissible value.
+    /// Corresponds to the special value `-2`.
+    pub const MAXIMUM_LENGTH: RsaPssSaltlen = RsaPssSaltlen(-2);
+}
+
+/// A type which computes cryptographic signatures of data.
+pub struct Signer<'a> {
+    md_ctx: *mut ffi::EVP_MD_CTX,
+    pctx: *mut ffi::EVP_PKEY_CTX,
+    _p: PhantomData<&'a ()>,
+}
+
+unsafe impl Sync for Signer<'_> {}
+unsafe impl Send for Signer<'_> {}
+
+impl Drop for Signer<'_> {
+    fn drop(&mut self) {
+        // pkey_ctx is owned by the md_ctx, so no need to explicitly free it.
+        unsafe {
+            EVP_MD_CTX_free(self.md_ctx);
+        }
+    }
+}
+
+#[allow(clippy::len_without_is_empty)]
+impl Signer<'_> {
+    /// Creates a new `Signer`.
+    ///
+    /// This cannot be used with Ed25519 or Ed448 keys. Please refer to
+    /// `new_without_digest`.
+    ///
+    /// OpenSSL documentation at [`EVP_DigestSignInit`].
+    ///
+    /// [`EVP_DigestSignInit`]: https://www.openssl.org/docs/manmaster/man3/EVP_DigestSignInit.html
+    pub fn new<'a, T>(type_: MessageDigest, pkey: &PKeyRef<T>) -> Result<Signer<'a>, ErrorStack>
+    where
+        T: HasPrivate,
+    {
+        Self::new_intern(Some(type_), pkey)
+    }
+
+    /// Creates a new `Signer` without a digest.
+    ///
+    /// This is the only way to create a `Verifier` for Ed25519 or Ed448 keys.
+    /// It can also be used to create a CMAC.
+    ///
+    /// OpenSSL documentation at [`EVP_DigestSignInit`].
+    ///
+    /// [`EVP_DigestSignInit`]: https://www.openssl.org/docs/manmaster/man3/EVP_DigestSignInit.html
+    pub fn new_without_digest<'a, T>(pkey: &PKeyRef<T>) -> Result<Signer<'a>, ErrorStack>
+    where
+        T: HasPrivate,
+    {
+        Self::new_intern(None, pkey)
+    }
+
+    fn new_intern<'a, T>(
+        type_: Option<MessageDigest>,
+        pkey: &PKeyRef<T>,
+    ) -> Result<Signer<'a>, ErrorStack>
+    where
+        T: HasPrivate,
+    {
+        unsafe {
+            ffi::init();
+
+            let ctx = cvt_p(EVP_MD_CTX_new())?;
+            let mut pctx: *mut ffi::EVP_PKEY_CTX = ptr::null_mut();
+            let r = ffi::EVP_DigestSignInit(
+                ctx,
+                &mut pctx,
+                type_.map(|t| t.as_ptr()).unwrap_or(ptr::null()),
+                ptr::null_mut(),
+                pkey.as_ptr(),
+            );
+            if r != 1 {
+                EVP_MD_CTX_free(ctx);
+                return Err(ErrorStack::get());
+            }
+
+            assert!(!pctx.is_null());
+
+            Ok(Signer {
+                md_ctx: ctx,
+                pctx,
+                _p: PhantomData,
+            })
+        }
+    }
+
+    /// Returns the RSA padding mode in use.
+    ///
+    /// This is only useful for RSA keys.
+    ///
+    /// This corresponds to `EVP_PKEY_CTX_get_rsa_padding`.
+    pub fn rsa_padding(&self) -> Result<Padding, ErrorStack> {
+        unsafe {
+            let mut pad = 0;
+            cvt(ffi::EVP_PKEY_CTX_get_rsa_padding(self.pctx, &mut pad))
+                .map(|_| Padding::from_raw(pad))
+        }
+    }
+
+    /// Sets the RSA padding mode.
+    ///
+    /// This is only useful for RSA keys.
+    ///
+    /// This corresponds to [`EVP_PKEY_CTX_set_rsa_padding`].
+    ///
+    /// [`EVP_PKEY_CTX_set_rsa_padding`]: https://www.openssl.org/docs/manmaster/crypto/EVP_PKEY_CTX_set_rsa_padding.html
+    pub fn set_rsa_padding(&mut self, padding: Padding) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set_rsa_padding(
+                self.pctx,
+                padding.as_raw(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the RSA PSS salt length.
+    ///
+    /// This is only useful for RSA keys.
+    ///
+    /// This corresponds to [`EVP_PKEY_CTX_set_rsa_pss_saltlen`].
+    ///
+    /// [`EVP_PKEY_CTX_set_rsa_pss_saltlen`]: https://www.openssl.org/docs/manmaster/crypto/EVP_PKEY_CTX_set_rsa_pss_saltlen.html
+    pub fn set_rsa_pss_saltlen(&mut self, len: RsaPssSaltlen) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set_rsa_pss_saltlen(
+                self.pctx,
+                len.as_raw(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the RSA MGF1 algorithm.
+    ///
+    /// This is only useful for RSA keys.
+    ///
+    /// This corresponds to [`EVP_PKEY_CTX_set_rsa_mgf1_md`].
+    ///
+    /// [`EVP_PKEY_CTX_set_rsa_mgf1_md`]: https://www.openssl.org/docs/manmaster/man7/RSA-PSS.html
+    pub fn set_rsa_mgf1_md(&mut self, md: MessageDigest) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set_rsa_mgf1_md(
+                self.pctx,
+                md.as_ptr() as *mut _,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Feeds more data into the `Signer`.
+    ///
+    /// Please note that PureEdDSA (Ed25519 and Ed448 keys) do not support streaming.
+    /// Use `sign_oneshot` instead.
+    ///
+    /// OpenSSL documentation at [`EVP_DigestUpdate`].
+    ///
+    /// [`EVP_DigestUpdate`]: https://www.openssl.org/docs/manmaster/man3/EVP_DigestInit.html
+    pub fn update(&mut self, buf: &[u8]) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_DigestUpdate(
+                self.md_ctx,
+                buf.as_ptr() as *const _,
+                buf.len(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Computes an upper bound on the signature length.
+    ///
+    /// The actual signature may be shorter than this value. Check the return value of
+    /// `sign` to get the exact length.
+    ///
+    /// OpenSSL documentation at [`EVP_DigestSignFinal`].
+    ///
+    /// [`EVP_DigestSignFinal`]: https://www.openssl.org/docs/manmaster/crypto/EVP_DigestSignFinal.html
+    pub fn len(&self) -> Result<usize, ErrorStack> {
+        self.len_intern()
+    }
+
+    #[cfg(all(not(ossl111), not(boringssl), not(libressl370)))]
+    fn len_intern(&self) -> Result<usize, ErrorStack> {
+        unsafe {
+            let mut len = 0;
+            cvt(ffi::EVP_DigestSignFinal(
+                self.md_ctx,
+                ptr::null_mut(),
+                &mut len,
+            ))?;
+            Ok(len)
+        }
+    }
+
+    #[cfg(any(ossl111, boringssl, libressl370))]
+    fn len_intern(&self) -> Result<usize, ErrorStack> {
+        unsafe {
+            let mut len = 0;
+            cvt(ffi::EVP_DigestSign(
+                self.md_ctx,
+                ptr::null_mut(),
+                &mut len,
+                ptr::null(),
+                0,
+            ))?;
+            Ok(len)
+        }
+    }
+
+    /// Writes the signature into the provided buffer, returning the number of bytes written.
+    ///
+    /// This method will fail if the buffer is not large enough for the signature. Use the `len`
+    /// method to get an upper bound on the required size.
+    ///
+    /// OpenSSL documentation at [`EVP_DigestSignFinal`].
+    ///
+    /// [`EVP_DigestSignFinal`]: https://www.openssl.org/docs/manmaster/crypto/EVP_DigestSignFinal.html
+    pub fn sign(&self, buf: &mut [u8]) -> Result<usize, ErrorStack> {
+        unsafe {
+            let mut len = buf.len();
+            cvt(ffi::EVP_DigestSignFinal(
+                self.md_ctx,
+                buf.as_mut_ptr() as *mut _,
+                &mut len,
+            ))?;
+            Ok(len)
+        }
+    }
+
+    /// Returns the signature.
+    ///
+    /// This is a simple convenience wrapper over `len` and `sign`.
+    pub fn sign_to_vec(&self) -> Result<Vec<u8>, ErrorStack> {
+        let mut buf = vec![0; self.len()?];
+        let len = self.sign(&mut buf)?;
+        // The advertised length is not always equal to the real length for things like DSA
+        buf.truncate(len);
+        Ok(buf)
+    }
+
+    /// Signs the data in `data_buf` and writes the signature into the buffer `sig_buf`, returning the
+    /// number of bytes written.
+    ///
+    /// For PureEdDSA (Ed25519 and Ed448 keys), this is the only way to sign data.
+    ///
+    /// This method will fail if the buffer is not large enough for the signature. Use the `len`
+    /// method to get an upper bound on the required size.
+    ///
+    /// OpenSSL documentation at [`EVP_DigestSign`].
+    ///
+    /// [`EVP_DigestSign`]: https://www.openssl.org/docs/man1.1.1/man3/EVP_DigestSign.html
+    #[cfg(any(ossl111, boringssl, libressl370))]
+    pub fn sign_oneshot(
+        &mut self,
+        sig_buf: &mut [u8],
+        data_buf: &[u8],
+    ) -> Result<usize, ErrorStack> {
+        unsafe {
+            let mut sig_len = sig_buf.len();
+            cvt(ffi::EVP_DigestSign(
+                self.md_ctx,
+                sig_buf.as_mut_ptr() as *mut _,
+                &mut sig_len,
+                data_buf.as_ptr() as *const _,
+                data_buf.len(),
+            ))?;
+            Ok(sig_len)
+        }
+    }
+
+    /// Returns the signature.
+    ///
+    /// This is a simple convenience wrapper over `len` and `sign_oneshot`.
+    #[cfg(any(ossl111, boringssl, libressl370))]
+    pub fn sign_oneshot_to_vec(&mut self, data_buf: &[u8]) -> Result<Vec<u8>, ErrorStack> {
+        let mut sig_buf = vec![0; self.len()?];
+        let len = self.sign_oneshot(&mut sig_buf, data_buf)?;
+        // The advertised length is not always equal to the real length for things like DSA
+        sig_buf.truncate(len);
+        Ok(sig_buf)
+    }
+}
+
+impl<'a> Write for Signer<'a> {
+    fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
+        self.update(buf)?;
+        Ok(buf.len())
+    }
+
+    fn flush(&mut self) -> io::Result<()> {
+        Ok(())
+    }
+}
+
+/// A type which can be used to verify the integrity and authenticity
+/// of data given the signature.
+pub struct Verifier<'a> {
+    md_ctx: *mut ffi::EVP_MD_CTX,
+    pctx: *mut ffi::EVP_PKEY_CTX,
+    pkey_pd: PhantomData<&'a ()>,
+}
+
+unsafe impl<'a> Sync for Verifier<'a> {}
+unsafe impl<'a> Send for Verifier<'a> {}
+
+impl<'a> Drop for Verifier<'a> {
+    fn drop(&mut self) {
+        // pkey_ctx is owned by the md_ctx, so no need to explicitly free it.
+        unsafe {
+            EVP_MD_CTX_free(self.md_ctx);
+        }
+    }
+}
+
+/// A type which verifies cryptographic signatures of data.
+impl<'a> Verifier<'a> {
+    /// Creates a new `Verifier`.
+    ///
+    /// This cannot be used with Ed25519 or Ed448 keys. Please refer to
+    /// [`Verifier::new_without_digest`].
+    ///
+    /// OpenSSL documentation at [`EVP_DigestVerifyInit`].
+    ///
+    /// [`EVP_DigestVerifyInit`]: https://www.openssl.org/docs/manmaster/man3/EVP_DigestVerifyInit.html
+    pub fn new<T>(type_: MessageDigest, pkey: &'a PKeyRef<T>) -> Result<Verifier<'a>, ErrorStack>
+    where
+        T: HasPublic,
+    {
+        Verifier::new_intern(Some(type_), pkey)
+    }
+
+    /// Creates a new `Verifier` without a digest.
+    ///
+    /// This is the only way to create a `Verifier` for Ed25519 or Ed448 keys.
+    ///
+    /// OpenSSL documentation at [`EVP_DigestVerifyInit`].
+    ///
+    /// [`EVP_DigestVerifyInit`]: https://www.openssl.org/docs/manmaster/man3/EVP_DigestVerifyInit.html
+    pub fn new_without_digest<T>(pkey: &'a PKeyRef<T>) -> Result<Verifier<'a>, ErrorStack>
+    where
+        T: HasPublic,
+    {
+        Verifier::new_intern(None, pkey)
+    }
+
+    fn new_intern<T>(
+        type_: Option<MessageDigest>,
+        pkey: &'a PKeyRef<T>,
+    ) -> Result<Verifier<'a>, ErrorStack>
+    where
+        T: HasPublic,
+    {
+        unsafe {
+            ffi::init();
+
+            let ctx = cvt_p(EVP_MD_CTX_new())?;
+            let mut pctx: *mut ffi::EVP_PKEY_CTX = ptr::null_mut();
+            let r = ffi::EVP_DigestVerifyInit(
+                ctx,
+                &mut pctx,
+                type_.map(|t| t.as_ptr()).unwrap_or(ptr::null()),
+                ptr::null_mut(),
+                pkey.as_ptr(),
+            );
+            if r != 1 {
+                EVP_MD_CTX_free(ctx);
+                return Err(ErrorStack::get());
+            }
+
+            assert!(!pctx.is_null());
+
+            Ok(Verifier {
+                md_ctx: ctx,
+                pctx,
+                pkey_pd: PhantomData,
+            })
+        }
+    }
+
+    /// Returns the RSA padding mode in use.
+    ///
+    /// This is only useful for RSA keys.
+    ///
+    /// This corresponds to `EVP_PKEY_CTX_get_rsa_padding`.
+    pub fn rsa_padding(&self) -> Result<Padding, ErrorStack> {
+        unsafe {
+            let mut pad = 0;
+            cvt(ffi::EVP_PKEY_CTX_get_rsa_padding(self.pctx, &mut pad))
+                .map(|_| Padding::from_raw(pad))
+        }
+    }
+
+    /// Sets the RSA padding mode.
+    ///
+    /// This is only useful for RSA keys.
+    ///
+    /// This corresponds to [`EVP_PKEY_CTX_set_rsa_padding`].
+    ///
+    /// [`EVP_PKEY_CTX_set_rsa_padding`]: https://www.openssl.org/docs/manmaster/crypto/EVP_PKEY_CTX_set_rsa_padding.html
+    pub fn set_rsa_padding(&mut self, padding: Padding) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set_rsa_padding(
+                self.pctx,
+                padding.as_raw(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the RSA PSS salt length.
+    ///
+    /// This is only useful for RSA keys.
+    ///
+    /// This corresponds to [`EVP_PKEY_CTX_set_rsa_pss_saltlen`].
+    ///
+    /// [`EVP_PKEY_CTX_set_rsa_pss_saltlen`]: https://www.openssl.org/docs/manmaster/crypto/EVP_PKEY_CTX_set_rsa_pss_saltlen.html
+    pub fn set_rsa_pss_saltlen(&mut self, len: RsaPssSaltlen) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set_rsa_pss_saltlen(
+                self.pctx,
+                len.as_raw(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the RSA MGF1 algorithm.
+    ///
+    /// This is only useful for RSA keys.
+    ///
+    /// This corresponds to [`EVP_PKEY_CTX_set_rsa_mgf1_md`].
+    ///
+    /// [`EVP_PKEY_CTX_set_rsa_mgf1_md`]: https://www.openssl.org/docs/manmaster/man7/RSA-PSS.html
+    pub fn set_rsa_mgf1_md(&mut self, md: MessageDigest) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_PKEY_CTX_set_rsa_mgf1_md(
+                self.pctx,
+                md.as_ptr() as *mut _,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Feeds more data into the `Verifier`.
+    ///
+    /// Please note that PureEdDSA (Ed25519 and Ed448 keys) do not support streaming.
+    /// Use [`Verifier::verify_oneshot`] instead.
+    ///
+    /// OpenSSL documentation at [`EVP_DigestUpdate`].
+    ///
+    /// [`EVP_DigestUpdate`]: https://www.openssl.org/docs/manmaster/man3/EVP_DigestInit.html
+    pub fn update(&mut self, buf: &[u8]) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::EVP_DigestUpdate(
+                self.md_ctx,
+                buf.as_ptr() as *const _,
+                buf.len(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Determines if the data fed into the `Verifier` matches the provided signature.
+    ///
+    /// OpenSSL documentation at [`EVP_DigestVerifyFinal`].
+    ///
+    /// [`EVP_DigestVerifyFinal`]: https://www.openssl.org/docs/manmaster/man3/EVP_DigestVerifyFinal.html
+    pub fn verify(&self, signature: &[u8]) -> Result<bool, ErrorStack> {
+        unsafe {
+            let r =
+                EVP_DigestVerifyFinal(self.md_ctx, signature.as_ptr() as *mut _, signature.len());
+            match r {
+                1 => Ok(true),
+                0 => {
+                    ErrorStack::get(); // discard error stack
+                    Ok(false)
+                }
+                _ => Err(ErrorStack::get()),
+            }
+        }
+    }
+
+    /// Determines if the data given in `buf` matches the provided signature.
+    ///
+    /// OpenSSL documentation at [`EVP_DigestVerify`].
+    ///
+    /// [`EVP_DigestVerify`]: https://www.openssl.org/docs/man1.1.1/man3/EVP_DigestVerify.html
+    #[cfg(any(ossl111, boringssl, libressl370))]
+    pub fn verify_oneshot(&mut self, signature: &[u8], buf: &[u8]) -> Result<bool, ErrorStack> {
+        unsafe {
+            let r = ffi::EVP_DigestVerify(
+                self.md_ctx,
+                signature.as_ptr() as *const _,
+                signature.len(),
+                buf.as_ptr() as *const _,
+                buf.len(),
+            );
+            match r {
+                1 => Ok(true),
+                0 => {
+                    ErrorStack::get();
+                    Ok(false)
+                }
+                _ => Err(ErrorStack::get()),
+            }
+        }
+    }
+}
+
+impl<'a> Write for Verifier<'a> {
+    fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
+        self.update(buf)?;
+        Ok(buf.len())
+    }
+
+    fn flush(&mut self) -> io::Result<()> {
+        Ok(())
+    }
+}
+
+#[cfg(not(ossl101))]
+use ffi::EVP_DigestVerifyFinal;
+
+#[cfg(ossl101)]
+#[allow(bad_style)]
+unsafe fn EVP_DigestVerifyFinal(
+    ctx: *mut ffi::EVP_MD_CTX,
+    sigret: *const ::libc::c_uchar,
+    siglen: ::libc::size_t,
+) -> ::libc::c_int {
+    ffi::EVP_DigestVerifyFinal(ctx, sigret as *mut _, siglen)
+}
+
+#[cfg(test)]
+mod test {
+    use hex::{self, FromHex};
+    #[cfg(not(boringssl))]
+    use std::iter;
+
+    use crate::ec::{EcGroup, EcKey};
+    use crate::hash::MessageDigest;
+    use crate::nid::Nid;
+    use crate::pkey::PKey;
+    use crate::rsa::{Padding, Rsa};
+    #[cfg(ossl111)]
+    use crate::sign::RsaPssSaltlen;
+    use crate::sign::{Signer, Verifier};
+
+    const INPUT: &str =
+        "65794a68624763694f694a53557a49314e694a392e65794a7063334d694f694a71623255694c41304b49434a6c\
+         654841694f6a457a4d4441344d546b7a4f44417344516f67496d6830644841364c79396c654746746347786c4c\
+         6d4e76625339706331397962323930496a7030636e566c6651";
+
+    const SIGNATURE: &str =
+        "702e218943e88fd11eb5d82dbf7845f34106ae1b81fff7731116add1717d83656d420afd3c96eedd73a2663e51\
+         66687b000b87226e0187ed1073f945e582adfcef16d85a798ee8c66ddb3db8975b17d09402beedd5d9d9700710\
+         8db28160d5f8040ca7445762b81fbe7ff9d92e0ae76f24f25b33bbe6f44ae61eb1040acb20044d3ef9128ed401\
+         30795bd4bd3b41eecad066ab651981fde48df77f372dc38b9fafdd3befb18b5da3cc3c2eb02f9e3a41d612caad\
+         15911273a05f23b9e838faaf849d698429ef5a1e88798236c3d40e604522a544c8f27a7a2db80663d16cf7caea\
+         56de405cb2215a45b2c25566b55ac1a748a070dfc8a32a469543d019eefb47";
+
+    #[test]
+    fn rsa_sign() {
+        let key = include_bytes!("../test/rsa.pem");
+        let private_key = Rsa::private_key_from_pem(key).unwrap();
+        let pkey = PKey::from_rsa(private_key).unwrap();
+
+        let mut signer = Signer::new(MessageDigest::sha256(), &pkey).unwrap();
+        assert_eq!(signer.rsa_padding().unwrap(), Padding::PKCS1);
+        signer.set_rsa_padding(Padding::PKCS1).unwrap();
+        signer.update(&Vec::from_hex(INPUT).unwrap()).unwrap();
+        let result = signer.sign_to_vec().unwrap();
+
+        assert_eq!(hex::encode(result), SIGNATURE);
+    }
+
+    #[test]
+    fn rsa_verify_ok() {
+        let key = include_bytes!("../test/rsa.pem");
+        let private_key = Rsa::private_key_from_pem(key).unwrap();
+        let pkey = PKey::from_rsa(private_key).unwrap();
+
+        let mut verifier = Verifier::new(MessageDigest::sha256(), &pkey).unwrap();
+        assert_eq!(verifier.rsa_padding().unwrap(), Padding::PKCS1);
+        verifier.update(&Vec::from_hex(INPUT).unwrap()).unwrap();
+        assert!(verifier.verify(&Vec::from_hex(SIGNATURE).unwrap()).unwrap());
+    }
+
+    #[test]
+    fn rsa_verify_invalid() {
+        let key = include_bytes!("../test/rsa.pem");
+        let private_key = Rsa::private_key_from_pem(key).unwrap();
+        let pkey = PKey::from_rsa(private_key).unwrap();
+
+        let mut verifier = Verifier::new(MessageDigest::sha256(), &pkey).unwrap();
+        verifier.update(&Vec::from_hex(INPUT).unwrap()).unwrap();
+        verifier.update(b"foobar").unwrap();
+        assert!(!verifier.verify(&Vec::from_hex(SIGNATURE).unwrap()).unwrap());
+    }
+
+    #[cfg(not(boringssl))]
+    fn test_hmac(ty: MessageDigest, tests: &[(Vec<u8>, Vec<u8>, Vec<u8>)]) {
+        for (key, data, res) in tests.iter() {
+            let pkey = PKey::hmac(key).unwrap();
+            let mut signer = Signer::new(ty, &pkey).unwrap();
+            signer.update(data).unwrap();
+            assert_eq!(signer.sign_to_vec().unwrap(), *res);
+        }
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn hmac_md5() {
+        // test vectors from RFC 2202
+        let tests: [(Vec<u8>, Vec<u8>, Vec<u8>); 7] = [
+            (
+                iter::repeat(0x0b_u8).take(16).collect(),
+                b"Hi There".to_vec(),
+                Vec::from_hex("9294727a3638bb1c13f48ef8158bfc9d").unwrap(),
+            ),
+            (
+                b"Jefe".to_vec(),
+                b"what do ya want for nothing?".to_vec(),
+                Vec::from_hex("750c783e6ab0b503eaa86e310a5db738").unwrap(),
+            ),
+            (
+                iter::repeat(0xaa_u8).take(16).collect(),
+                iter::repeat(0xdd_u8).take(50).collect(),
+                Vec::from_hex("56be34521d144c88dbb8c733f0e8b3f6").unwrap(),
+            ),
+            (
+                Vec::from_hex("0102030405060708090a0b0c0d0e0f10111213141516171819").unwrap(),
+                iter::repeat(0xcd_u8).take(50).collect(),
+                Vec::from_hex("697eaf0aca3a3aea3a75164746ffaa79").unwrap(),
+            ),
+            (
+                iter::repeat(0x0c_u8).take(16).collect(),
+                b"Test With Truncation".to_vec(),
+                Vec::from_hex("56461ef2342edc00f9bab995690efd4c").unwrap(),
+            ),
+            (
+                iter::repeat(0xaa_u8).take(80).collect(),
+                b"Test Using Larger Than Block-Size Key - Hash Key First".to_vec(),
+                Vec::from_hex("6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd").unwrap(),
+            ),
+            (
+                iter::repeat(0xaa_u8).take(80).collect(),
+                b"Test Using Larger Than Block-Size Key \
+              and Larger Than One Block-Size Data"
+                    .to_vec(),
+                Vec::from_hex("6f630fad67cda0ee1fb1f562db3aa53e").unwrap(),
+            ),
+        ];
+
+        test_hmac(MessageDigest::md5(), &tests);
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn hmac_sha1() {
+        // test vectors from RFC 2202
+        let tests: [(Vec<u8>, Vec<u8>, Vec<u8>); 7] = [
+            (
+                iter::repeat(0x0b_u8).take(20).collect(),
+                b"Hi There".to_vec(),
+                Vec::from_hex("b617318655057264e28bc0b6fb378c8ef146be00").unwrap(),
+            ),
+            (
+                b"Jefe".to_vec(),
+                b"what do ya want for nothing?".to_vec(),
+                Vec::from_hex("effcdf6ae5eb2fa2d27416d5f184df9c259a7c79").unwrap(),
+            ),
+            (
+                iter::repeat(0xaa_u8).take(20).collect(),
+                iter::repeat(0xdd_u8).take(50).collect(),
+                Vec::from_hex("125d7342b9ac11cd91a39af48aa17b4f63f175d3").unwrap(),
+            ),
+            (
+                Vec::from_hex("0102030405060708090a0b0c0d0e0f10111213141516171819").unwrap(),
+                iter::repeat(0xcd_u8).take(50).collect(),
+                Vec::from_hex("4c9007f4026250c6bc8414f9bf50c86c2d7235da").unwrap(),
+            ),
+            (
+                iter::repeat(0x0c_u8).take(20).collect(),
+                b"Test With Truncation".to_vec(),
+                Vec::from_hex("4c1a03424b55e07fe7f27be1d58bb9324a9a5a04").unwrap(),
+            ),
+            (
+                iter::repeat(0xaa_u8).take(80).collect(),
+                b"Test Using Larger Than Block-Size Key - Hash Key First".to_vec(),
+                Vec::from_hex("aa4ae5e15272d00e95705637ce8a3b55ed402112").unwrap(),
+            ),
+            (
+                iter::repeat(0xaa_u8).take(80).collect(),
+                b"Test Using Larger Than Block-Size Key \
+              and Larger Than One Block-Size Data"
+                    .to_vec(),
+                Vec::from_hex("e8e99d0f45237d786d6bbaa7965c7808bbff1a91").unwrap(),
+            ),
+        ];
+
+        test_hmac(MessageDigest::sha1(), &tests);
+    }
+
+    #[test]
+    #[cfg(ossl110)]
+    fn test_cmac() {
+        let cipher = crate::symm::Cipher::aes_128_cbc();
+        let key = Vec::from_hex("9294727a3638bb1c13f48ef8158bfc9d").unwrap();
+        let pkey = PKey::cmac(&cipher, &key).unwrap();
+        let mut signer = Signer::new_without_digest(&pkey).unwrap();
+
+        let data = b"Hi There";
+        signer.update(data as &[u8]).unwrap();
+
+        let expected = vec![
+            136, 101, 61, 167, 61, 30, 248, 234, 124, 166, 196, 157, 203, 52, 171, 19,
+        ];
+        assert_eq!(signer.sign_to_vec().unwrap(), expected);
+    }
+
+    #[test]
+    fn ec() {
+        let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap();
+        let key = EcKey::generate(&group).unwrap();
+        let key = PKey::from_ec_key(key).unwrap();
+
+        let mut signer = Signer::new(MessageDigest::sha256(), &key).unwrap();
+        signer.update(b"hello world").unwrap();
+        let signature = signer.sign_to_vec().unwrap();
+
+        let mut verifier = Verifier::new(MessageDigest::sha256(), &key).unwrap();
+        verifier.update(b"hello world").unwrap();
+        assert!(verifier.verify(&signature).unwrap());
+    }
+
+    #[test]
+    #[cfg(any(ossl111, boringssl, libressl370))]
+    fn eddsa() {
+        let key = PKey::generate_ed25519().unwrap();
+
+        let mut signer = Signer::new_without_digest(&key).unwrap();
+        let signature = signer.sign_oneshot_to_vec(b"hello world").unwrap();
+
+        let mut verifier = Verifier::new_without_digest(&key).unwrap();
+        assert!(verifier.verify_oneshot(&signature, b"hello world").unwrap());
+    }
+
+    #[test]
+    #[cfg(ossl111)]
+    fn rsa_sign_verify() {
+        let key = include_bytes!("../test/rsa.pem");
+        let private_key = Rsa::private_key_from_pem(key).unwrap();
+        let pkey = PKey::from_rsa(private_key).unwrap();
+
+        let mut signer = Signer::new(MessageDigest::sha256(), &pkey).unwrap();
+        signer.set_rsa_padding(Padding::PKCS1_PSS).unwrap();
+        assert_eq!(signer.rsa_padding().unwrap(), Padding::PKCS1_PSS);
+        signer
+            .set_rsa_pss_saltlen(RsaPssSaltlen::DIGEST_LENGTH)
+            .unwrap();
+        signer.set_rsa_mgf1_md(MessageDigest::sha256()).unwrap();
+        signer.update(&Vec::from_hex(INPUT).unwrap()).unwrap();
+        let signature = signer.sign_to_vec().unwrap();
+
+        let mut verifier = Verifier::new(MessageDigest::sha256(), &pkey).unwrap();
+        verifier.set_rsa_padding(Padding::PKCS1_PSS).unwrap();
+        verifier
+            .set_rsa_pss_saltlen(RsaPssSaltlen::DIGEST_LENGTH)
+            .unwrap();
+        verifier.set_rsa_mgf1_md(MessageDigest::sha256()).unwrap();
+        verifier.update(&Vec::from_hex(INPUT).unwrap()).unwrap();
+        assert!(verifier.verify(&signature).unwrap());
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/srtp.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/srtp.rs
--- 43.0.0-1/rust-vendor/openssl/src/srtp.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/srtp.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,66 @@
+use crate::stack::Stackable;
+use foreign_types::ForeignTypeRef;
+use libc::c_ulong;
+use std::ffi::CStr;
+use std::str;
+
+/// fake free method, since SRTP_PROTECTION_PROFILE is static
+unsafe fn free(_profile: *mut ffi::SRTP_PROTECTION_PROFILE) {}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::SRTP_PROTECTION_PROFILE;
+    fn drop = free;
+
+    pub struct SrtpProtectionProfile;
+    /// Reference to `SrtpProtectionProfile`.
+    pub struct SrtpProtectionProfileRef;
+}
+
+impl Stackable for SrtpProtectionProfile {
+    type StackType = ffi::stack_st_SRTP_PROTECTION_PROFILE;
+}
+
+impl SrtpProtectionProfileRef {
+    pub fn id(&self) -> SrtpProfileId {
+        SrtpProfileId::from_raw(unsafe { (*self.as_ptr()).id })
+    }
+    pub fn name(&self) -> &'static str {
+        unsafe { CStr::from_ptr((*self.as_ptr()).name as *const _) }
+            .to_str()
+            .expect("should be UTF-8")
+    }
+}
+
+/// An identifier of an SRTP protection profile.
+#[derive(Debug, Copy, Clone, PartialEq, Eq)]
+pub struct SrtpProfileId(c_ulong);
+
+impl SrtpProfileId {
+    pub const SRTP_AES128_CM_SHA1_80: SrtpProfileId =
+        SrtpProfileId(ffi::SRTP_AES128_CM_SHA1_80 as c_ulong);
+    pub const SRTP_AES128_CM_SHA1_32: SrtpProfileId =
+        SrtpProfileId(ffi::SRTP_AES128_CM_SHA1_32 as c_ulong);
+    pub const SRTP_AES128_F8_SHA1_80: SrtpProfileId =
+        SrtpProfileId(ffi::SRTP_AES128_F8_SHA1_80 as c_ulong);
+    pub const SRTP_AES128_F8_SHA1_32: SrtpProfileId =
+        SrtpProfileId(ffi::SRTP_AES128_F8_SHA1_32 as c_ulong);
+    pub const SRTP_NULL_SHA1_80: SrtpProfileId = SrtpProfileId(ffi::SRTP_NULL_SHA1_80 as c_ulong);
+    pub const SRTP_NULL_SHA1_32: SrtpProfileId = SrtpProfileId(ffi::SRTP_NULL_SHA1_32 as c_ulong);
+    #[cfg(any(boringssl, ossl110))]
+    pub const SRTP_AEAD_AES_128_GCM: SrtpProfileId =
+        SrtpProfileId(ffi::SRTP_AEAD_AES_128_GCM as c_ulong);
+    #[cfg(any(boringssl, ossl110))]
+    pub const SRTP_AEAD_AES_256_GCM: SrtpProfileId =
+        SrtpProfileId(ffi::SRTP_AEAD_AES_256_GCM as c_ulong);
+
+    /// Creates a `SrtpProfileId` from an integer representation.
+    pub fn from_raw(value: c_ulong) -> SrtpProfileId {
+        SrtpProfileId(value)
+    }
+
+    /// Returns the integer representation of `SrtpProfileId`.
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn as_raw(&self) -> c_ulong {
+        self.0
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/ssl/bio.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/ssl/bio.rs
--- 43.0.0-1/rust-vendor/openssl/src/ssl/bio.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/ssl/bio.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,290 @@
+use cfg_if::cfg_if;
+use ffi::{
+    self, BIO_clear_retry_flags, BIO_new, BIO_set_retry_read, BIO_set_retry_write, BIO,
+    BIO_CTRL_DGRAM_QUERY_MTU, BIO_CTRL_FLUSH,
+};
+use libc::{c_char, c_int, c_long, c_void, strlen};
+use std::any::Any;
+use std::io;
+use std::io::prelude::*;
+use std::panic::{catch_unwind, AssertUnwindSafe};
+use std::ptr;
+use std::slice;
+
+use crate::cvt_p;
+use crate::error::ErrorStack;
+
+pub struct StreamState<S> {
+    pub stream: S,
+    pub error: Option<io::Error>,
+    pub panic: Option<Box<dyn Any + Send>>,
+    pub dtls_mtu_size: c_long,
+}
+
+/// Safe wrapper for `BIO_METHOD`
+pub struct BioMethod(BIO_METHOD);
+
+impl BioMethod {
+    fn new<S: Read + Write>() -> Result<BioMethod, ErrorStack> {
+        BIO_METHOD::new::<S>().map(BioMethod)
+    }
+}
+
+unsafe impl Sync for BioMethod {}
+unsafe impl Send for BioMethod {}
+
+pub fn new<S: Read + Write>(stream: S) -> Result<(*mut BIO, BioMethod), ErrorStack> {
+    let method = BioMethod::new::<S>()?;
+
+    let state = Box::new(StreamState {
+        stream,
+        error: None,
+        panic: None,
+        dtls_mtu_size: 0,
+    });
+
+    unsafe {
+        let bio = cvt_p(BIO_new(method.0.get()))?;
+        BIO_set_data(bio, Box::into_raw(state) as *mut _);
+        BIO_set_init(bio, 1);
+
+        Ok((bio, method))
+    }
+}
+
+pub unsafe fn take_error<S>(bio: *mut BIO) -> Option<io::Error> {
+    let state = state::<S>(bio);
+    state.error.take()
+}
+
+pub unsafe fn take_panic<S>(bio: *mut BIO) -> Option<Box<dyn Any + Send>> {
+    let state = state::<S>(bio);
+    state.panic.take()
+}
+
+pub unsafe fn get_ref<'a, S: 'a>(bio: *mut BIO) -> &'a S {
+    let state = &*(BIO_get_data(bio) as *const StreamState<S>);
+    &state.stream
+}
+
+pub unsafe fn get_mut<'a, S: 'a>(bio: *mut BIO) -> &'a mut S {
+    &mut state(bio).stream
+}
+
+pub unsafe fn set_dtls_mtu_size<S>(bio: *mut BIO, mtu_size: usize) {
+    if mtu_size as u64 > c_long::MAX as u64 {
+        panic!(
+            "Given MTU size {} can't be represented in a positive `c_long` range",
+            mtu_size
+        )
+    }
+    state::<S>(bio).dtls_mtu_size = mtu_size as c_long;
+}
+
+unsafe fn state<'a, S: 'a>(bio: *mut BIO) -> &'a mut StreamState<S> {
+    &mut *(BIO_get_data(bio) as *mut _)
+}
+
+unsafe extern "C" fn bwrite<S: Write>(bio: *mut BIO, buf: *const c_char, len: c_int) -> c_int {
+    BIO_clear_retry_flags(bio);
+
+    let state = state::<S>(bio);
+    let buf = slice::from_raw_parts(buf as *const _, len as usize);
+
+    match catch_unwind(AssertUnwindSafe(|| state.stream.write(buf))) {
+        Ok(Ok(len)) => len as c_int,
+        Ok(Err(err)) => {
+            if retriable_error(&err) {
+                BIO_set_retry_write(bio);
+            }
+            state.error = Some(err);
+            -1
+        }
+        Err(err) => {
+            state.panic = Some(err);
+            -1
+        }
+    }
+}
+
+unsafe extern "C" fn bread<S: Read>(bio: *mut BIO, buf: *mut c_char, len: c_int) -> c_int {
+    BIO_clear_retry_flags(bio);
+
+    let state = state::<S>(bio);
+    let buf = slice::from_raw_parts_mut(buf as *mut _, len as usize);
+
+    match catch_unwind(AssertUnwindSafe(|| state.stream.read(buf))) {
+        Ok(Ok(len)) => len as c_int,
+        Ok(Err(err)) => {
+            if retriable_error(&err) {
+                BIO_set_retry_read(bio);
+            }
+            state.error = Some(err);
+            -1
+        }
+        Err(err) => {
+            state.panic = Some(err);
+            -1
+        }
+    }
+}
+
+#[allow(clippy::match_like_matches_macro)] // matches macro requires rust 1.42.0
+fn retriable_error(err: &io::Error) -> bool {
+    match err.kind() {
+        io::ErrorKind::WouldBlock | io::ErrorKind::NotConnected => true,
+        _ => false,
+    }
+}
+
+unsafe extern "C" fn bputs<S: Write>(bio: *mut BIO, s: *const c_char) -> c_int {
+    bwrite::<S>(bio, s, strlen(s) as c_int)
+}
+
+unsafe extern "C" fn ctrl<S: Write>(
+    bio: *mut BIO,
+    cmd: c_int,
+    _num: c_long,
+    _ptr: *mut c_void,
+) -> c_long {
+    let state = state::<S>(bio);
+
+    if cmd == BIO_CTRL_FLUSH {
+        match catch_unwind(AssertUnwindSafe(|| state.stream.flush())) {
+            Ok(Ok(())) => 1,
+            Ok(Err(err)) => {
+                state.error = Some(err);
+                0
+            }
+            Err(err) => {
+                state.panic = Some(err);
+                0
+            }
+        }
+    } else if cmd == BIO_CTRL_DGRAM_QUERY_MTU {
+        state.dtls_mtu_size
+    } else {
+        0
+    }
+}
+
+unsafe extern "C" fn create(bio: *mut BIO) -> c_int {
+    BIO_set_init(bio, 0);
+    BIO_set_num(bio, 0);
+    BIO_set_data(bio, ptr::null_mut());
+    BIO_set_flags(bio, 0);
+    1
+}
+
+unsafe extern "C" fn destroy<S>(bio: *mut BIO) -> c_int {
+    if bio.is_null() {
+        return 0;
+    }
+
+    let data = BIO_get_data(bio);
+    assert!(!data.is_null());
+    let _ = Box::<StreamState<S>>::from_raw(data as *mut _);
+    BIO_set_data(bio, ptr::null_mut());
+    BIO_set_init(bio, 0);
+    1
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl273))] {
+        use ffi::{BIO_get_data, BIO_set_data, BIO_set_flags, BIO_set_init};
+        use crate::cvt;
+
+        #[allow(bad_style)]
+        unsafe fn BIO_set_num(_bio: *mut ffi::BIO, _num: c_int) {}
+
+        #[allow(bad_style, clippy::upper_case_acronyms)]
+        struct BIO_METHOD(*mut ffi::BIO_METHOD);
+
+        impl BIO_METHOD {
+            fn new<S: Read + Write>() -> Result<BIO_METHOD, ErrorStack> {
+                unsafe {
+                    let ptr = cvt_p(ffi::BIO_meth_new(ffi::BIO_TYPE_NONE, b"rust\0".as_ptr() as *const _))?;
+                    let method = BIO_METHOD(ptr);
+                    cvt(ffi::BIO_meth_set_write__fixed_rust(method.0, Some(bwrite::<S>)))?;
+                    cvt(ffi::BIO_meth_set_read__fixed_rust(method.0, Some(bread::<S>)))?;
+                    cvt(ffi::BIO_meth_set_puts__fixed_rust(method.0, Some(bputs::<S>)))?;
+                    cvt(ffi::BIO_meth_set_ctrl__fixed_rust(method.0, Some(ctrl::<S>)))?;
+                    cvt(ffi::BIO_meth_set_create__fixed_rust(method.0, Some(create)))?;
+                    cvt(ffi::BIO_meth_set_destroy__fixed_rust(method.0, Some(destroy::<S>)))?;
+                    Ok(method)
+                }
+            }
+
+            fn get(&self) -> *mut ffi::BIO_METHOD {
+                self.0
+            }
+        }
+
+        impl Drop for BIO_METHOD {
+            fn drop(&mut self) {
+                unsafe {
+                    ffi::BIO_meth_free(self.0);
+                }
+            }
+        }
+    } else {
+        #[allow(bad_style, clippy::upper_case_acronyms)]
+        struct BIO_METHOD(*mut ffi::BIO_METHOD);
+
+        impl BIO_METHOD {
+            fn new<S: Read + Write>() -> Result<BIO_METHOD, ErrorStack> {
+                let ptr = Box::new(ffi::BIO_METHOD {
+                    type_: ffi::BIO_TYPE_NONE,
+                    name: b"rust\0".as_ptr() as *const _,
+                    bwrite: Some(bwrite::<S>),
+                    bread: Some(bread::<S>),
+                    bputs: Some(bputs::<S>),
+                    bgets: None,
+                    ctrl: Some(ctrl::<S>),
+                    create: Some(create),
+                    destroy: Some(destroy::<S>),
+                    callback_ctrl: None,
+                });
+
+                Ok(BIO_METHOD(Box::into_raw(ptr)))
+            }
+
+            fn get(&self) -> *mut ffi::BIO_METHOD {
+                self.0
+            }
+        }
+
+        impl Drop for BIO_METHOD {
+            fn drop(&mut self) {
+                unsafe {
+                    let _ = Box::<ffi::BIO_METHOD>::from_raw(self.0);
+                }
+            }
+        }
+
+        #[allow(bad_style)]
+        unsafe fn BIO_set_init(bio: *mut ffi::BIO, init: c_int) {
+            (*bio).init = init;
+        }
+
+        #[allow(bad_style)]
+        unsafe fn BIO_set_flags(bio: *mut ffi::BIO, flags: c_int) {
+            (*bio).flags = flags;
+        }
+
+        #[allow(bad_style)]
+        unsafe fn BIO_get_data(bio: *mut ffi::BIO) -> *mut c_void {
+            (*bio).ptr
+        }
+
+        #[allow(bad_style)]
+        unsafe fn BIO_set_data(bio: *mut ffi::BIO, data: *mut c_void) {
+            (*bio).ptr = data;
+        }
+
+        #[allow(bad_style)]
+        unsafe fn BIO_set_num(bio: *mut ffi::BIO, num: c_int) {
+            (*bio).num = num;
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/ssl/callbacks.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/ssl/callbacks.rs
--- 43.0.0-1/rust-vendor/openssl/src/ssl/callbacks.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/ssl/callbacks.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,707 @@
+use cfg_if::cfg_if;
+use foreign_types::ForeignType;
+use foreign_types::ForeignTypeRef;
+#[cfg(any(ossl111, not(osslconf = "OPENSSL_NO_PSK")))]
+use libc::c_char;
+#[cfg(ossl111)]
+use libc::size_t;
+use libc::{c_int, c_uchar, c_uint, c_void};
+#[cfg(any(ossl111, not(osslconf = "OPENSSL_NO_PSK")))]
+use std::ffi::CStr;
+use std::mem;
+use std::ptr;
+use std::slice;
+#[cfg(any(ossl111, boringssl))]
+use std::str;
+use std::sync::Arc;
+
+use crate::dh::Dh;
+#[cfg(all(ossl101, not(ossl110)))]
+use crate::ec::EcKey;
+use crate::error::ErrorStack;
+use crate::pkey::Params;
+#[cfg(any(ossl102, libressl261))]
+use crate::ssl::AlpnError;
+use crate::ssl::{
+    try_get_session_ctx_index, SniError, Ssl, SslAlert, SslContext, SslContextRef, SslRef,
+    SslSession, SslSessionRef,
+};
+#[cfg(ossl111)]
+use crate::ssl::{ClientHelloResponse, ExtensionContext};
+#[cfg(any(ossl111, boringssl))]
+use crate::util::ForeignTypeRefExt;
+#[cfg(ossl111)]
+use crate::x509::X509Ref;
+use crate::x509::{X509StoreContext, X509StoreContextRef};
+
+pub extern "C" fn raw_verify<F>(preverify_ok: c_int, x509_ctx: *mut ffi::X509_STORE_CTX) -> c_int
+where
+    F: Fn(bool, &mut X509StoreContextRef) -> bool + 'static + Sync + Send,
+{
+    unsafe {
+        let ctx = X509StoreContextRef::from_ptr_mut(x509_ctx);
+        let ssl_idx = X509StoreContext::ssl_idx().expect("BUG: store context ssl index missing");
+        let verify_idx = SslContext::cached_ex_index::<F>();
+
+        // raw pointer shenanigans to break the borrow of ctx
+        // the callback can't mess with its own ex_data slot so this is safe
+        let verify = ctx
+            .ex_data(ssl_idx)
+            .expect("BUG: store context missing ssl")
+            .ssl_context()
+            .ex_data(verify_idx)
+            .expect("BUG: verify callback missing") as *const F;
+
+        (*verify)(preverify_ok != 0, ctx) as c_int
+    }
+}
+
+#[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
+pub extern "C" fn raw_client_psk<F>(
+    ssl: *mut ffi::SSL,
+    hint: *const c_char,
+    identity: *mut c_char,
+    max_identity_len: c_uint,
+    psk: *mut c_uchar,
+    max_psk_len: c_uint,
+) -> c_uint
+where
+    F: Fn(&mut SslRef, Option<&[u8]>, &mut [u8], &mut [u8]) -> Result<usize, ErrorStack>
+        + 'static
+        + Sync
+        + Send,
+{
+    unsafe {
+        let ssl = SslRef::from_ptr_mut(ssl);
+        let callback_idx = SslContext::cached_ex_index::<F>();
+
+        let callback = ssl
+            .ssl_context()
+            .ex_data(callback_idx)
+            .expect("BUG: psk callback missing") as *const F;
+        let hint = if !hint.is_null() {
+            Some(CStr::from_ptr(hint).to_bytes())
+        } else {
+            None
+        };
+        // Give the callback mutable slices into which it can write the identity and psk.
+        let identity_sl = slice::from_raw_parts_mut(identity as *mut u8, max_identity_len as usize);
+        #[allow(clippy::unnecessary_cast)]
+        let psk_sl = slice::from_raw_parts_mut(psk as *mut u8, max_psk_len as usize);
+        match (*callback)(ssl, hint, identity_sl, psk_sl) {
+            Ok(psk_len) => psk_len as u32,
+            Err(e) => {
+                e.put();
+                0
+            }
+        }
+    }
+}
+
+#[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
+pub extern "C" fn raw_server_psk<F>(
+    ssl: *mut ffi::SSL,
+    identity: *const c_char,
+    psk: *mut c_uchar,
+    max_psk_len: c_uint,
+) -> c_uint
+where
+    F: Fn(&mut SslRef, Option<&[u8]>, &mut [u8]) -> Result<usize, ErrorStack>
+        + 'static
+        + Sync
+        + Send,
+{
+    unsafe {
+        let ssl = SslRef::from_ptr_mut(ssl);
+        let callback_idx = SslContext::cached_ex_index::<F>();
+
+        let callback = ssl
+            .ssl_context()
+            .ex_data(callback_idx)
+            .expect("BUG: psk callback missing") as *const F;
+        let identity = if identity.is_null() {
+            None
+        } else {
+            Some(CStr::from_ptr(identity).to_bytes())
+        };
+        // Give the callback mutable slices into which it can write the psk.
+        #[allow(clippy::unnecessary_cast)]
+        let psk_sl = slice::from_raw_parts_mut(psk as *mut u8, max_psk_len as usize);
+        match (*callback)(ssl, identity, psk_sl) {
+            Ok(psk_len) => psk_len as u32,
+            Err(e) => {
+                e.put();
+                0
+            }
+        }
+    }
+}
+
+pub extern "C" fn ssl_raw_verify<F>(
+    preverify_ok: c_int,
+    x509_ctx: *mut ffi::X509_STORE_CTX,
+) -> c_int
+where
+    F: Fn(bool, &mut X509StoreContextRef) -> bool + 'static + Sync + Send,
+{
+    unsafe {
+        let ctx = X509StoreContextRef::from_ptr_mut(x509_ctx);
+        let ssl_idx = X509StoreContext::ssl_idx().expect("BUG: store context ssl index missing");
+        let callback_idx = Ssl::cached_ex_index::<Arc<F>>();
+
+        let callback = ctx
+            .ex_data(ssl_idx)
+            .expect("BUG: store context missing ssl")
+            .ex_data(callback_idx)
+            .expect("BUG: ssl verify callback missing")
+            .clone();
+
+        callback(preverify_ok != 0, ctx) as c_int
+    }
+}
+
+pub extern "C" fn raw_sni<F>(ssl: *mut ffi::SSL, al: *mut c_int, arg: *mut c_void) -> c_int
+where
+    F: Fn(&mut SslRef, &mut SslAlert) -> Result<(), SniError> + 'static + Sync + Send,
+{
+    unsafe {
+        let ssl = SslRef::from_ptr_mut(ssl);
+        let callback = arg as *const F;
+        let mut alert = SslAlert(*al);
+
+        let r = (*callback)(ssl, &mut alert);
+        *al = alert.0;
+        match r {
+            Ok(()) => ffi::SSL_TLSEXT_ERR_OK,
+            Err(e) => e.0,
+        }
+    }
+}
+
+#[cfg(any(ossl102, libressl261))]
+pub extern "C" fn raw_alpn_select<F>(
+    ssl: *mut ffi::SSL,
+    out: *mut *const c_uchar,
+    outlen: *mut c_uchar,
+    inbuf: *const c_uchar,
+    inlen: c_uint,
+    _arg: *mut c_void,
+) -> c_int
+where
+    F: for<'a> Fn(&mut SslRef, &'a [u8]) -> Result<&'a [u8], AlpnError> + 'static + Sync + Send,
+{
+    unsafe {
+        let ssl = SslRef::from_ptr_mut(ssl);
+        let callback = ssl
+            .ssl_context()
+            .ex_data(SslContext::cached_ex_index::<F>())
+            .expect("BUG: alpn callback missing") as *const F;
+        #[allow(clippy::unnecessary_cast)]
+        let protos = slice::from_raw_parts(inbuf as *const u8, inlen as usize);
+
+        match (*callback)(ssl, protos) {
+            Ok(proto) => {
+                *out = proto.as_ptr() as *const c_uchar;
+                *outlen = proto.len() as c_uchar;
+                ffi::SSL_TLSEXT_ERR_OK
+            }
+            Err(e) => e.0,
+        }
+    }
+}
+
+pub unsafe extern "C" fn raw_tmp_dh<F>(
+    ssl: *mut ffi::SSL,
+    is_export: c_int,
+    keylength: c_int,
+) -> *mut ffi::DH
+where
+    F: Fn(&mut SslRef, bool, u32) -> Result<Dh<Params>, ErrorStack> + 'static + Sync + Send,
+{
+    let ssl = SslRef::from_ptr_mut(ssl);
+    let callback = ssl
+        .ssl_context()
+        .ex_data(SslContext::cached_ex_index::<F>())
+        .expect("BUG: tmp dh callback missing") as *const F;
+
+    match (*callback)(ssl, is_export != 0, keylength as u32) {
+        Ok(dh) => {
+            let ptr = dh.as_ptr();
+            mem::forget(dh);
+            ptr
+        }
+        Err(e) => {
+            e.put();
+            ptr::null_mut()
+        }
+    }
+}
+
+#[cfg(all(ossl101, not(ossl110)))]
+pub unsafe extern "C" fn raw_tmp_ecdh<F>(
+    ssl: *mut ffi::SSL,
+    is_export: c_int,
+    keylength: c_int,
+) -> *mut ffi::EC_KEY
+where
+    F: Fn(&mut SslRef, bool, u32) -> Result<EcKey<Params>, ErrorStack> + 'static + Sync + Send,
+{
+    let ssl = SslRef::from_ptr_mut(ssl);
+    let callback = ssl
+        .ssl_context()
+        .ex_data(SslContext::cached_ex_index::<F>())
+        .expect("BUG: tmp ecdh callback missing") as *const F;
+
+    match (*callback)(ssl, is_export != 0, keylength as u32) {
+        Ok(ec_key) => {
+            let ptr = ec_key.as_ptr();
+            mem::forget(ec_key);
+            ptr
+        }
+        Err(e) => {
+            e.put();
+            ptr::null_mut()
+        }
+    }
+}
+
+pub unsafe extern "C" fn raw_tmp_dh_ssl<F>(
+    ssl: *mut ffi::SSL,
+    is_export: c_int,
+    keylength: c_int,
+) -> *mut ffi::DH
+where
+    F: Fn(&mut SslRef, bool, u32) -> Result<Dh<Params>, ErrorStack> + 'static + Sync + Send,
+{
+    let ssl = SslRef::from_ptr_mut(ssl);
+    let callback = ssl
+        .ex_data(Ssl::cached_ex_index::<Arc<F>>())
+        .expect("BUG: ssl tmp dh callback missing")
+        .clone();
+
+    match callback(ssl, is_export != 0, keylength as u32) {
+        Ok(dh) => {
+            let ptr = dh.as_ptr();
+            mem::forget(dh);
+            ptr
+        }
+        Err(e) => {
+            e.put();
+            ptr::null_mut()
+        }
+    }
+}
+
+#[cfg(all(ossl101, not(ossl110)))]
+pub unsafe extern "C" fn raw_tmp_ecdh_ssl<F>(
+    ssl: *mut ffi::SSL,
+    is_export: c_int,
+    keylength: c_int,
+) -> *mut ffi::EC_KEY
+where
+    F: Fn(&mut SslRef, bool, u32) -> Result<EcKey<Params>, ErrorStack> + 'static + Sync + Send,
+{
+    let ssl = SslRef::from_ptr_mut(ssl);
+    let callback = ssl
+        .ex_data(Ssl::cached_ex_index::<Arc<F>>())
+        .expect("BUG: ssl tmp ecdh callback missing")
+        .clone();
+
+    match callback(ssl, is_export != 0, keylength as u32) {
+        Ok(ec_key) => {
+            let ptr = ec_key.as_ptr();
+            mem::forget(ec_key);
+            ptr
+        }
+        Err(e) => {
+            e.put();
+            ptr::null_mut()
+        }
+    }
+}
+
+pub unsafe extern "C" fn raw_tlsext_status<F>(ssl: *mut ffi::SSL, _: *mut c_void) -> c_int
+where
+    F: Fn(&mut SslRef) -> Result<bool, ErrorStack> + 'static + Sync + Send,
+{
+    let ssl = SslRef::from_ptr_mut(ssl);
+    let callback = ssl
+        .ssl_context()
+        .ex_data(SslContext::cached_ex_index::<F>())
+        .expect("BUG: ocsp callback missing") as *const F;
+    let ret = (*callback)(ssl);
+
+    if ssl.is_server() {
+        match ret {
+            Ok(true) => ffi::SSL_TLSEXT_ERR_OK,
+            Ok(false) => ffi::SSL_TLSEXT_ERR_NOACK,
+            Err(e) => {
+                e.put();
+                ffi::SSL_TLSEXT_ERR_ALERT_FATAL
+            }
+        }
+    } else {
+        match ret {
+            Ok(true) => 1,
+            Ok(false) => 0,
+            Err(e) => {
+                e.put();
+                -1
+            }
+        }
+    }
+}
+
+pub unsafe extern "C" fn raw_new_session<F>(
+    ssl: *mut ffi::SSL,
+    session: *mut ffi::SSL_SESSION,
+) -> c_int
+where
+    F: Fn(&mut SslRef, SslSession) + 'static + Sync + Send,
+{
+    let session_ctx_index =
+        try_get_session_ctx_index().expect("BUG: session context index initialization failed");
+    let ssl = SslRef::from_ptr_mut(ssl);
+    let callback = ssl
+        .ex_data(*session_ctx_index)
+        .expect("BUG: session context missing")
+        .ex_data(SslContext::cached_ex_index::<F>())
+        .expect("BUG: new session callback missing") as *const F;
+    let session = SslSession::from_ptr(session);
+
+    (*callback)(ssl, session);
+
+    // the return code doesn't indicate error vs success, but whether or not we consumed the session
+    1
+}
+
+pub unsafe extern "C" fn raw_remove_session<F>(
+    ctx: *mut ffi::SSL_CTX,
+    session: *mut ffi::SSL_SESSION,
+) where
+    F: Fn(&SslContextRef, &SslSessionRef) + 'static + Sync + Send,
+{
+    let ctx = SslContextRef::from_ptr(ctx);
+    let callback = ctx
+        .ex_data(SslContext::cached_ex_index::<F>())
+        .expect("BUG: remove session callback missing");
+    let session = SslSessionRef::from_ptr(session);
+
+    callback(ctx, session)
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl280, boringssl))] {
+        type DataPtr = *const c_uchar;
+    } else {
+        type DataPtr = *mut c_uchar;
+    }
+}
+
+pub unsafe extern "C" fn raw_get_session<F>(
+    ssl: *mut ffi::SSL,
+    data: DataPtr,
+    len: c_int,
+    copy: *mut c_int,
+) -> *mut ffi::SSL_SESSION
+where
+    F: Fn(&mut SslRef, &[u8]) -> Option<SslSession> + 'static + Sync + Send,
+{
+    let session_ctx_index =
+        try_get_session_ctx_index().expect("BUG: session context index initialization failed");
+    let ssl = SslRef::from_ptr_mut(ssl);
+    let callback = ssl
+        .ex_data(*session_ctx_index)
+        .expect("BUG: session context missing")
+        .ex_data(SslContext::cached_ex_index::<F>())
+        .expect("BUG: get session callback missing") as *const F;
+    #[allow(clippy::unnecessary_cast)]
+    let data = slice::from_raw_parts(data as *const u8, len as usize);
+
+    match (*callback)(ssl, data) {
+        Some(session) => {
+            let p = session.as_ptr();
+            mem::forget(session);
+            *copy = 0;
+            p
+        }
+        None => ptr::null_mut(),
+    }
+}
+
+#[cfg(any(ossl111, boringssl))]
+pub unsafe extern "C" fn raw_keylog<F>(ssl: *const ffi::SSL, line: *const c_char)
+where
+    F: Fn(&SslRef, &str) + 'static + Sync + Send,
+{
+    let ssl = SslRef::from_const_ptr(ssl);
+    let callback = ssl
+        .ssl_context()
+        .ex_data(SslContext::cached_ex_index::<F>())
+        .expect("BUG: get session callback missing");
+    let line = CStr::from_ptr(line).to_bytes();
+    let line = str::from_utf8_unchecked(line);
+
+    callback(ssl, line);
+}
+
+#[cfg(ossl111)]
+pub unsafe extern "C" fn raw_stateless_cookie_generate<F>(
+    ssl: *mut ffi::SSL,
+    cookie: *mut c_uchar,
+    cookie_len: *mut size_t,
+) -> c_int
+where
+    F: Fn(&mut SslRef, &mut [u8]) -> Result<usize, ErrorStack> + 'static + Sync + Send,
+{
+    let ssl = SslRef::from_ptr_mut(ssl);
+    let callback = ssl
+        .ssl_context()
+        .ex_data(SslContext::cached_ex_index::<F>())
+        .expect("BUG: stateless cookie generate callback missing") as *const F;
+    #[allow(clippy::unnecessary_cast)]
+    let slice = slice::from_raw_parts_mut(cookie as *mut u8, ffi::SSL_COOKIE_LENGTH as usize);
+    match (*callback)(ssl, slice) {
+        Ok(len) => {
+            *cookie_len = len as size_t;
+            1
+        }
+        Err(e) => {
+            e.put();
+            0
+        }
+    }
+}
+
+#[cfg(ossl111)]
+pub unsafe extern "C" fn raw_stateless_cookie_verify<F>(
+    ssl: *mut ffi::SSL,
+    cookie: *const c_uchar,
+    cookie_len: size_t,
+) -> c_int
+where
+    F: Fn(&mut SslRef, &[u8]) -> bool + 'static + Sync + Send,
+{
+    let ssl = SslRef::from_ptr_mut(ssl);
+    let callback = ssl
+        .ssl_context()
+        .ex_data(SslContext::cached_ex_index::<F>())
+        .expect("BUG: stateless cookie verify callback missing") as *const F;
+    #[allow(clippy::unnecessary_cast)]
+    let slice = slice::from_raw_parts(cookie as *const c_uchar as *const u8, cookie_len);
+    (*callback)(ssl, slice) as c_int
+}
+
+#[cfg(not(boringssl))]
+pub extern "C" fn raw_cookie_generate<F>(
+    ssl: *mut ffi::SSL,
+    cookie: *mut c_uchar,
+    cookie_len: *mut c_uint,
+) -> c_int
+where
+    F: Fn(&mut SslRef, &mut [u8]) -> Result<usize, ErrorStack> + 'static + Sync + Send,
+{
+    unsafe {
+        let ssl = SslRef::from_ptr_mut(ssl);
+        let callback = ssl
+            .ssl_context()
+            .ex_data(SslContext::cached_ex_index::<F>())
+            .expect("BUG: cookie generate callback missing") as *const F;
+        // We subtract 1 from DTLS1_COOKIE_LENGTH as the ostensible value, 256, is erroneous but retained for
+        // compatibility. See comments in dtls1.h.
+        #[allow(clippy::unnecessary_cast)]
+        let slice =
+            slice::from_raw_parts_mut(cookie as *mut u8, ffi::DTLS1_COOKIE_LENGTH as usize - 1);
+        match (*callback)(ssl, slice) {
+            Ok(len) => {
+                *cookie_len = len as c_uint;
+                1
+            }
+            Err(e) => {
+                e.put();
+                0
+            }
+        }
+    }
+}
+
+#[cfg(not(boringssl))]
+cfg_if! {
+    if #[cfg(any(ossl110, libressl280))] {
+        type CookiePtr = *const c_uchar;
+    } else {
+        type CookiePtr = *mut c_uchar;
+    }
+}
+
+#[cfg(not(boringssl))]
+pub extern "C" fn raw_cookie_verify<F>(
+    ssl: *mut ffi::SSL,
+    cookie: CookiePtr,
+    cookie_len: c_uint,
+) -> c_int
+where
+    F: Fn(&mut SslRef, &[u8]) -> bool + 'static + Sync + Send,
+{
+    unsafe {
+        let ssl = SslRef::from_ptr_mut(ssl);
+        let callback = ssl
+            .ssl_context()
+            .ex_data(SslContext::cached_ex_index::<F>())
+            .expect("BUG: cookie verify callback missing") as *const F;
+        #[allow(clippy::unnecessary_cast)]
+        let slice =
+            slice::from_raw_parts(cookie as *const c_uchar as *const u8, cookie_len as usize);
+        (*callback)(ssl, slice) as c_int
+    }
+}
+
+#[cfg(ossl111)]
+pub struct CustomExtAddState<T>(Option<T>);
+
+#[cfg(ossl111)]
+pub extern "C" fn raw_custom_ext_add<F, T>(
+    ssl: *mut ffi::SSL,
+    _: c_uint,
+    context: c_uint,
+    out: *mut *const c_uchar,
+    outlen: *mut size_t,
+    x: *mut ffi::X509,
+    chainidx: size_t,
+    al: *mut c_int,
+    _: *mut c_void,
+) -> c_int
+where
+    F: Fn(&mut SslRef, ExtensionContext, Option<(usize, &X509Ref)>) -> Result<Option<T>, SslAlert>
+        + 'static
+        + Sync
+        + Send,
+    T: AsRef<[u8]> + 'static + Sync + Send,
+{
+    unsafe {
+        let ssl = SslRef::from_ptr_mut(ssl);
+        let callback = ssl
+            .ssl_context()
+            .ex_data(SslContext::cached_ex_index::<F>())
+            .expect("BUG: custom ext add callback missing") as *const F;
+        let ectx = ExtensionContext::from_bits_truncate(context);
+        let cert = if ectx.contains(ExtensionContext::TLS1_3_CERTIFICATE) {
+            Some((chainidx, X509Ref::from_ptr(x)))
+        } else {
+            None
+        };
+        match (*callback)(ssl, ectx, cert) {
+            Ok(None) => 0,
+            Ok(Some(buf)) => {
+                *outlen = buf.as_ref().len();
+                *out = buf.as_ref().as_ptr();
+
+                let idx = Ssl::cached_ex_index::<CustomExtAddState<T>>();
+                let mut buf = Some(buf);
+                let new = match ssl.ex_data_mut(idx) {
+                    Some(state) => {
+                        state.0 = buf.take();
+                        false
+                    }
+                    None => true,
+                };
+                if new {
+                    ssl.set_ex_data(idx, CustomExtAddState(buf));
+                }
+                1
+            }
+            Err(alert) => {
+                *al = alert.0;
+                -1
+            }
+        }
+    }
+}
+
+#[cfg(ossl111)]
+pub extern "C" fn raw_custom_ext_free<T>(
+    ssl: *mut ffi::SSL,
+    _: c_uint,
+    _: c_uint,
+    _: *const c_uchar,
+    _: *mut c_void,
+) where
+    T: 'static + Sync + Send,
+{
+    unsafe {
+        let ssl = SslRef::from_ptr_mut(ssl);
+        let idx = Ssl::cached_ex_index::<CustomExtAddState<T>>();
+        if let Some(state) = ssl.ex_data_mut(idx) {
+            state.0 = None;
+        }
+    }
+}
+
+#[cfg(ossl111)]
+pub extern "C" fn raw_custom_ext_parse<F>(
+    ssl: *mut ffi::SSL,
+    _: c_uint,
+    context: c_uint,
+    input: *const c_uchar,
+    inlen: size_t,
+    x: *mut ffi::X509,
+    chainidx: size_t,
+    al: *mut c_int,
+    _: *mut c_void,
+) -> c_int
+where
+    F: Fn(&mut SslRef, ExtensionContext, &[u8], Option<(usize, &X509Ref)>) -> Result<(), SslAlert>
+        + 'static
+        + Sync
+        + Send,
+{
+    unsafe {
+        let ssl = SslRef::from_ptr_mut(ssl);
+        let callback = ssl
+            .ssl_context()
+            .ex_data(SslContext::cached_ex_index::<F>())
+            .expect("BUG: custom ext parse callback missing") as *const F;
+        let ectx = ExtensionContext::from_bits_truncate(context);
+        #[allow(clippy::unnecessary_cast)]
+        let slice = slice::from_raw_parts(input as *const u8, inlen);
+        let cert = if ectx.contains(ExtensionContext::TLS1_3_CERTIFICATE) {
+            Some((chainidx, X509Ref::from_ptr(x)))
+        } else {
+            None
+        };
+        match (*callback)(ssl, ectx, slice, cert) {
+            Ok(()) => 1,
+            Err(alert) => {
+                *al = alert.0;
+                0
+            }
+        }
+    }
+}
+
+#[cfg(ossl111)]
+pub unsafe extern "C" fn raw_client_hello<F>(
+    ssl: *mut ffi::SSL,
+    al: *mut c_int,
+    arg: *mut c_void,
+) -> c_int
+where
+    F: Fn(&mut SslRef, &mut SslAlert) -> Result<ClientHelloResponse, ErrorStack>
+        + 'static
+        + Sync
+        + Send,
+{
+    let ssl = SslRef::from_ptr_mut(ssl);
+    let callback = arg as *const F;
+    let mut alert = SslAlert(*al);
+
+    let r = (*callback)(ssl, &mut alert);
+    *al = alert.0;
+    match r {
+        Ok(c) => c.0,
+        Err(e) => {
+            e.put();
+            ffi::SSL_CLIENT_HELLO_ERROR
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/ssl/connector.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/ssl/connector.rs
--- 43.0.0-1/rust-vendor/openssl/src/ssl/connector.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/ssl/connector.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,605 @@
+use cfg_if::cfg_if;
+use std::io::{Read, Write};
+use std::ops::{Deref, DerefMut};
+
+use crate::dh::Dh;
+use crate::error::ErrorStack;
+#[cfg(any(ossl111, libressl340))]
+use crate::ssl::SslVersion;
+use crate::ssl::{
+    HandshakeError, Ssl, SslContext, SslContextBuilder, SslContextRef, SslMethod, SslMode,
+    SslOptions, SslRef, SslStream, SslVerifyMode,
+};
+use crate::version;
+use std::net::IpAddr;
+
+const FFDHE_2048: &str = "
+-----BEGIN DH PARAMETERS-----
+MIIBCAKCAQEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz
++8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a
+87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7
+YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi
+7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD
+ssbzSibBsu/6iGtCOGEoXJf//////////wIBAg==
+-----END DH PARAMETERS-----
+";
+
+#[allow(clippy::inconsistent_digit_grouping, clippy::unusual_byte_groupings)]
+fn ctx(method: SslMethod) -> Result<SslContextBuilder, ErrorStack> {
+    let mut ctx = SslContextBuilder::new(method)?;
+
+    cfg_if! {
+        if #[cfg(not(boringssl))] {
+            let mut opts = SslOptions::ALL
+                | SslOptions::NO_COMPRESSION
+                | SslOptions::NO_SSLV2
+                | SslOptions::NO_SSLV3
+                | SslOptions::SINGLE_DH_USE
+                | SslOptions::SINGLE_ECDH_USE;
+            opts &= !SslOptions::DONT_INSERT_EMPTY_FRAGMENTS;
+
+            ctx.set_options(opts);
+        }
+    }
+
+    let mut mode =
+        SslMode::AUTO_RETRY | SslMode::ACCEPT_MOVING_WRITE_BUFFER | SslMode::ENABLE_PARTIAL_WRITE;
+
+    // This is quite a useful optimization for saving memory, but historically
+    // caused CVEs in OpenSSL pre-1.0.1h, according to
+    // https://bugs.python.org/issue25672
+    if version::number() >= 0x1_00_01_08_0 {
+        mode |= SslMode::RELEASE_BUFFERS;
+    }
+
+    ctx.set_mode(mode);
+
+    Ok(ctx)
+}
+
+/// A type which wraps client-side streams in a TLS session.
+///
+/// OpenSSL's default configuration is highly insecure. This connector manages the OpenSSL
+/// structures, configuring cipher suites, session options, hostname verification, and more.
+///
+/// OpenSSL's built-in hostname verification is used when linking against OpenSSL 1.0.2 or 1.1.0,
+/// and a custom implementation is used when linking against OpenSSL 1.0.1.
+#[derive(Clone, Debug)]
+pub struct SslConnector(SslContext);
+
+impl SslConnector {
+    /// Creates a new builder for TLS connections.
+    ///
+    /// The default configuration is subject to change, and is currently derived from Python.
+    pub fn builder(method: SslMethod) -> Result<SslConnectorBuilder, ErrorStack> {
+        let mut ctx = ctx(method)?;
+        ctx.set_default_verify_paths()?;
+        ctx.set_cipher_list(
+            "DEFAULT:!aNULL:!eNULL:!MD5:!3DES:!DES:!RC4:!IDEA:!SEED:!aDSS:!SRP:!PSK",
+        )?;
+        setup_verify(&mut ctx);
+
+        Ok(SslConnectorBuilder(ctx))
+    }
+
+    /// Initiates a client-side TLS session on a stream.
+    ///
+    /// The domain is used for SNI and hostname verification.
+    pub fn connect<S>(&self, domain: &str, stream: S) -> Result<SslStream<S>, HandshakeError<S>>
+    where
+        S: Read + Write,
+    {
+        self.configure()?.connect(domain, stream)
+    }
+
+    /// Returns a structure allowing for configuration of a single TLS session before connection.
+    pub fn configure(&self) -> Result<ConnectConfiguration, ErrorStack> {
+        Ssl::new(&self.0).map(|ssl| ConnectConfiguration {
+            ssl,
+            sni: true,
+            verify_hostname: true,
+        })
+    }
+
+    /// Consumes the `SslConnector`, returning the inner raw `SslContext`.
+    pub fn into_context(self) -> SslContext {
+        self.0
+    }
+
+    /// Returns a shared reference to the inner raw `SslContext`.
+    pub fn context(&self) -> &SslContextRef {
+        &self.0
+    }
+}
+
+/// A builder for `SslConnector`s.
+pub struct SslConnectorBuilder(SslContextBuilder);
+
+impl SslConnectorBuilder {
+    /// Consumes the builder, returning an `SslConnector`.
+    pub fn build(self) -> SslConnector {
+        SslConnector(self.0.build())
+    }
+}
+
+impl Deref for SslConnectorBuilder {
+    type Target = SslContextBuilder;
+
+    fn deref(&self) -> &SslContextBuilder {
+        &self.0
+    }
+}
+
+impl DerefMut for SslConnectorBuilder {
+    fn deref_mut(&mut self) -> &mut SslContextBuilder {
+        &mut self.0
+    }
+}
+
+/// A type which allows for configuration of a client-side TLS session before connection.
+pub struct ConnectConfiguration {
+    ssl: Ssl,
+    sni: bool,
+    verify_hostname: bool,
+}
+
+impl ConnectConfiguration {
+    /// A builder-style version of `set_use_server_name_indication`.
+    pub fn use_server_name_indication(mut self, use_sni: bool) -> ConnectConfiguration {
+        self.set_use_server_name_indication(use_sni);
+        self
+    }
+
+    /// Configures the use of Server Name Indication (SNI) when connecting.
+    ///
+    /// Defaults to `true`.
+    pub fn set_use_server_name_indication(&mut self, use_sni: bool) {
+        self.sni = use_sni;
+    }
+
+    /// A builder-style version of `set_verify_hostname`.
+    pub fn verify_hostname(mut self, verify_hostname: bool) -> ConnectConfiguration {
+        self.set_verify_hostname(verify_hostname);
+        self
+    }
+
+    /// Configures the use of hostname verification when connecting.
+    ///
+    /// Defaults to `true`.
+    ///
+    /// # Warning
+    ///
+    /// You should think very carefully before you use this method. If hostname verification is not
+    /// used, *any* valid certificate for *any* site will be trusted for use from any other. This
+    /// introduces a significant vulnerability to man-in-the-middle attacks.
+    pub fn set_verify_hostname(&mut self, verify_hostname: bool) {
+        self.verify_hostname = verify_hostname;
+    }
+
+    /// Returns an `Ssl` configured to connect to the provided domain.
+    ///
+    /// The domain is used for SNI (if it is not an IP address) and hostname verification if enabled.
+    pub fn into_ssl(mut self, domain: &str) -> Result<Ssl, ErrorStack> {
+        if self.sni && domain.parse::<IpAddr>().is_err() {
+            self.ssl.set_hostname(domain)?;
+        }
+
+        if self.verify_hostname {
+            setup_verify_hostname(&mut self.ssl, domain)?;
+        }
+
+        Ok(self.ssl)
+    }
+
+    /// Initiates a client-side TLS session on a stream.
+    ///
+    /// The domain is used for SNI and hostname verification if enabled.
+    pub fn connect<S>(self, domain: &str, stream: S) -> Result<SslStream<S>, HandshakeError<S>>
+    where
+        S: Read + Write,
+    {
+        self.into_ssl(domain)?.connect(stream)
+    }
+}
+
+impl Deref for ConnectConfiguration {
+    type Target = SslRef;
+
+    fn deref(&self) -> &SslRef {
+        &self.ssl
+    }
+}
+
+impl DerefMut for ConnectConfiguration {
+    fn deref_mut(&mut self) -> &mut SslRef {
+        &mut self.ssl
+    }
+}
+
+/// A type which wraps server-side streams in a TLS session.
+///
+/// OpenSSL's default configuration is highly insecure. This connector manages the OpenSSL
+/// structures, configuring cipher suites, session options, and more.
+#[derive(Clone)]
+pub struct SslAcceptor(SslContext);
+
+impl SslAcceptor {
+    /// Creates a new builder configured to connect to non-legacy clients. This should generally be
+    /// considered a reasonable default choice.
+    ///
+    /// This corresponds to the intermediate configuration of version 5 of Mozilla's server side TLS
+    /// recommendations. See its [documentation][docs] for more details on specifics.
+    ///
+    /// [docs]: https://wiki.mozilla.org/Security/Server_Side_TLS
+    pub fn mozilla_intermediate_v5(method: SslMethod) -> Result<SslAcceptorBuilder, ErrorStack> {
+        let mut ctx = ctx(method)?;
+        ctx.set_options(SslOptions::NO_TLSV1 | SslOptions::NO_TLSV1_1);
+        let dh = Dh::params_from_pem(FFDHE_2048.as_bytes())?;
+        ctx.set_tmp_dh(&dh)?;
+        setup_curves(&mut ctx)?;
+        ctx.set_cipher_list(
+            "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:\
+             ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:\
+             DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384"
+        )?;
+        #[cfg(any(ossl111, libressl340))]
+        ctx.set_ciphersuites(
+            "TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256",
+        )?;
+        Ok(SslAcceptorBuilder(ctx))
+    }
+
+    /// Creates a new builder configured to connect to modern clients.
+    ///
+    /// This corresponds to the modern configuration of version 5 of Mozilla's server side TLS recommendations.
+    /// See its [documentation][docs] for more details on specifics.
+    ///
+    /// Requires OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
+    ///
+    /// [docs]: https://wiki.mozilla.org/Security/Server_Side_TLS
+    #[cfg(any(ossl111, libressl340))]
+    pub fn mozilla_modern_v5(method: SslMethod) -> Result<SslAcceptorBuilder, ErrorStack> {
+        let mut ctx = ctx(method)?;
+        ctx.set_min_proto_version(Some(SslVersion::TLS1_3))?;
+        ctx.set_ciphersuites(
+            "TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256",
+        )?;
+        Ok(SslAcceptorBuilder(ctx))
+    }
+
+    /// Creates a new builder configured to connect to non-legacy clients. This should generally be
+    /// considered a reasonable default choice.
+    ///
+    /// This corresponds to the intermediate configuration of version 4 of Mozilla's server side TLS
+    /// recommendations. See its [documentation][docs] for more details on specifics.
+    ///
+    /// [docs]: https://wiki.mozilla.org/Security/Server_Side_TLS
+    // FIXME remove in next major version
+    pub fn mozilla_intermediate(method: SslMethod) -> Result<SslAcceptorBuilder, ErrorStack> {
+        let mut ctx = ctx(method)?;
+        ctx.set_options(SslOptions::CIPHER_SERVER_PREFERENCE);
+        #[cfg(any(ossl111, libressl340))]
+        ctx.set_options(SslOptions::NO_TLSV1_3);
+        let dh = Dh::params_from_pem(FFDHE_2048.as_bytes())?;
+        ctx.set_tmp_dh(&dh)?;
+        setup_curves(&mut ctx)?;
+        ctx.set_cipher_list(
+            "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:\
+             ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:\
+             DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:\
+             ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:\
+             ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:\
+             DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:\
+             EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:\
+             AES256-SHA:DES-CBC3-SHA:!DSS",
+        )?;
+        Ok(SslAcceptorBuilder(ctx))
+    }
+
+    /// Creates a new builder configured to connect to modern clients.
+    ///
+    /// This corresponds to the modern configuration of version 4 of Mozilla's server side TLS recommendations.
+    /// See its [documentation][docs] for more details on specifics.
+    ///
+    /// [docs]: https://wiki.mozilla.org/Security/Server_Side_TLS
+    // FIXME remove in next major version
+    pub fn mozilla_modern(method: SslMethod) -> Result<SslAcceptorBuilder, ErrorStack> {
+        let mut ctx = ctx(method)?;
+        ctx.set_options(
+            SslOptions::CIPHER_SERVER_PREFERENCE | SslOptions::NO_TLSV1 | SslOptions::NO_TLSV1_1,
+        );
+        #[cfg(any(ossl111, libressl340))]
+        ctx.set_options(SslOptions::NO_TLSV1_3);
+        setup_curves(&mut ctx)?;
+        ctx.set_cipher_list(
+            "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:\
+             ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:\
+             ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256",
+        )?;
+        Ok(SslAcceptorBuilder(ctx))
+    }
+
+    /// Initiates a server-side TLS session on a stream.
+    pub fn accept<S>(&self, stream: S) -> Result<SslStream<S>, HandshakeError<S>>
+    where
+        S: Read + Write,
+    {
+        let ssl = Ssl::new(&self.0)?;
+        ssl.accept(stream)
+    }
+
+    /// Consumes the `SslAcceptor`, returning the inner raw `SslContext`.
+    pub fn into_context(self) -> SslContext {
+        self.0
+    }
+
+    /// Returns a shared reference to the inner raw `SslContext`.
+    pub fn context(&self) -> &SslContextRef {
+        &self.0
+    }
+}
+
+/// A builder for `SslAcceptor`s.
+pub struct SslAcceptorBuilder(SslContextBuilder);
+
+impl SslAcceptorBuilder {
+    /// Consumes the builder, returning a `SslAcceptor`.
+    pub fn build(self) -> SslAcceptor {
+        SslAcceptor(self.0.build())
+    }
+}
+
+impl Deref for SslAcceptorBuilder {
+    type Target = SslContextBuilder;
+
+    fn deref(&self) -> &SslContextBuilder {
+        &self.0
+    }
+}
+
+impl DerefMut for SslAcceptorBuilder {
+    fn deref_mut(&mut self) -> &mut SslContextBuilder {
+        &mut self.0
+    }
+}
+
+cfg_if! {
+    if #[cfg(ossl110)] {
+        #[allow(clippy::unnecessary_wraps)]
+        fn setup_curves(_: &mut SslContextBuilder) -> Result<(), ErrorStack> {
+            Ok(())
+        }
+    } else if #[cfg(any(ossl102, libressl))] {
+        fn setup_curves(ctx: &mut SslContextBuilder) -> Result<(), ErrorStack> {
+            ctx.set_ecdh_auto(true)
+        }
+    } else {
+        fn setup_curves(ctx: &mut SslContextBuilder) -> Result<(), ErrorStack> {
+            use crate::ec::EcKey;
+            use crate::nid::Nid;
+
+            let curve = EcKey::from_curve_name(Nid::X9_62_PRIME256V1)?;
+            ctx.set_tmp_ecdh(&curve)
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(ossl102, libressl261))] {
+        fn setup_verify(ctx: &mut SslContextBuilder) {
+            ctx.set_verify(SslVerifyMode::PEER);
+        }
+
+        fn setup_verify_hostname(ssl: &mut SslRef, domain: &str) -> Result<(), ErrorStack> {
+            use crate::x509::verify::X509CheckFlags;
+
+            let param = ssl.param_mut();
+            param.set_hostflags(X509CheckFlags::NO_PARTIAL_WILDCARDS);
+            match domain.parse() {
+                Ok(ip) => param.set_ip(ip),
+                Err(_) => param.set_host(domain),
+            }
+        }
+    } else {
+        fn setup_verify(ctx: &mut SslContextBuilder) {
+            ctx.set_verify_callback(SslVerifyMode::PEER, verify::verify_callback);
+        }
+
+        fn setup_verify_hostname(ssl: &mut Ssl, domain: &str) -> Result<(), ErrorStack> {
+            let domain = domain.to_string();
+            let hostname_idx = verify::try_get_hostname_idx()?;
+            ssl.set_ex_data(*hostname_idx, domain);
+            Ok(())
+        }
+
+        mod verify {
+            use std::net::IpAddr;
+            use std::str;
+            use once_cell::sync::OnceCell;
+
+            use crate::error::ErrorStack;
+            use crate::ex_data::Index;
+            use crate::nid::Nid;
+            use crate::ssl::Ssl;
+            use crate::stack::Stack;
+            use crate::x509::{
+                GeneralName, X509NameRef, X509Ref, X509StoreContext, X509StoreContextRef,
+                X509VerifyResult,
+            };
+
+            static HOSTNAME_IDX: OnceCell<Index<Ssl, String>> = OnceCell::new();
+
+            pub fn try_get_hostname_idx() -> Result<&'static Index<Ssl, String>, ErrorStack> {
+                HOSTNAME_IDX.get_or_try_init(Ssl::new_ex_index)
+            }
+
+            pub fn verify_callback(preverify_ok: bool, x509_ctx: &mut X509StoreContextRef) -> bool {
+                if !preverify_ok || x509_ctx.error_depth() != 0 {
+                    return preverify_ok;
+                }
+
+                let hostname_idx =
+                    try_get_hostname_idx().expect("failed to initialize hostname index");
+                let ok = match (
+                    x509_ctx.current_cert(),
+                    X509StoreContext::ssl_idx()
+                        .ok()
+                        .and_then(|idx| x509_ctx.ex_data(idx))
+                        .and_then(|ssl| ssl.ex_data(*hostname_idx)),
+                ) {
+                    (Some(x509), Some(domain)) => verify_hostname(domain, &x509),
+                    _ => true,
+                };
+
+                if !ok {
+                    x509_ctx.set_error(X509VerifyResult::APPLICATION_VERIFICATION);
+                }
+
+                ok
+            }
+
+            fn verify_hostname(domain: &str, cert: &X509Ref) -> bool {
+                match cert.subject_alt_names() {
+                    Some(names) => verify_subject_alt_names(domain, names),
+                    None => verify_subject_name(domain, &cert.subject_name()),
+                }
+            }
+
+            fn verify_subject_alt_names(domain: &str, names: Stack<GeneralName>) -> bool {
+                let ip = domain.parse();
+
+                for name in &names {
+                    match ip {
+                        Ok(ip) => {
+                            if let Some(actual) = name.ipaddress() {
+                                if matches_ip(&ip, actual) {
+                                    return true;
+                                }
+                            }
+                        }
+                        Err(_) => {
+                            if let Some(pattern) = name.dnsname() {
+                                if matches_dns(pattern, domain) {
+                                    return true;
+                                }
+                            }
+                        }
+                    }
+                }
+
+                false
+            }
+
+            fn verify_subject_name(domain: &str, subject_name: &X509NameRef) -> bool {
+                match subject_name.entries_by_nid(Nid::COMMONNAME).next() {
+                    Some(pattern) => {
+                        let pattern = match str::from_utf8(pattern.data().as_slice()) {
+                            Ok(pattern) => pattern,
+                            Err(_) => return false,
+                        };
+
+                        // Unlike SANs, IP addresses in the subject name don't have a
+                        // different encoding.
+                        match domain.parse::<IpAddr>() {
+                            Ok(ip) => pattern
+                                .parse::<IpAddr>()
+                                .ok()
+                                .map_or(false, |pattern| pattern == ip),
+                            Err(_) => matches_dns(pattern, domain),
+                        }
+                    }
+                    None => false,
+                }
+            }
+
+            fn matches_dns(mut pattern: &str, mut hostname: &str) -> bool {
+                // first strip trailing . off of pattern and hostname to normalize
+                if pattern.ends_with('.') {
+                    pattern = &pattern[..pattern.len() - 1];
+                }
+                if hostname.ends_with('.') {
+                    hostname = &hostname[..hostname.len() - 1];
+                }
+
+                matches_wildcard(pattern, hostname).unwrap_or_else(|| pattern.eq_ignore_ascii_case(hostname))
+            }
+
+            fn matches_wildcard(pattern: &str, hostname: &str) -> Option<bool> {
+                let wildcard_location = match pattern.find('*') {
+                    Some(l) => l,
+                    None => return None,
+                };
+
+                let mut dot_idxs = pattern.match_indices('.').map(|(l, _)| l);
+                let wildcard_end = match dot_idxs.next() {
+                    Some(l) => l,
+                    None => return None,
+                };
+
+                // Never match wildcards if the pattern has less than 2 '.'s (no *.com)
+                //
+                // This is a bit dubious, as it doesn't disallow other TLDs like *.co.uk.
+                // Chrome has a black- and white-list for this, but Firefox (via NSS) does
+                // the same thing we do here.
+                //
+                // The Public Suffix (https://www.publicsuffix.org/) list could
+                // potentially be used here, but it's both huge and updated frequently
+                // enough that management would be a PITA.
+                if dot_idxs.next().is_none() {
+                    return None;
+                }
+
+                // Wildcards can only be in the first component, and must be the entire first label
+                if wildcard_location != 0 || wildcard_end != wildcard_location + 1 {
+                    return None;
+                }
+
+                let hostname_label_end = match hostname.find('.') {
+                    Some(l) => l,
+                    None => return None,
+                };
+
+                let pattern_after_wildcard = &pattern[wildcard_end..];
+                let hostname_after_wildcard = &hostname[hostname_label_end..];
+
+                Some(pattern_after_wildcard.eq_ignore_ascii_case(hostname_after_wildcard))
+            }
+
+            fn matches_ip(expected: &IpAddr, actual: &[u8]) -> bool {
+                match *expected {
+                    IpAddr::V4(ref addr) => actual == addr.octets(),
+                    IpAddr::V6(ref addr) => actual == addr.octets(),
+                }
+            }
+
+            #[test]
+            fn test_dns_match() {
+                use crate::ssl::connector::verify::matches_dns;
+                assert!(matches_dns("website.tld", "website.tld")); // A name should match itself.
+                assert!(matches_dns("website.tld", "wEbSiTe.tLd")); // DNS name matching ignores case of hostname.
+                assert!(matches_dns("wEbSiTe.TlD", "website.tld")); // DNS name matching ignores case of subject.
+
+                assert!(matches_dns("xn--bcher-kva.tld", "xn--bcher-kva.tld")); // Likewise, nothing special to punycode names.
+                assert!(matches_dns("xn--bcher-kva.tld", "xn--BcHer-Kva.tLd")); // And punycode must be compared similarly case-insensitively.
+
+                assert!(matches_dns("*.example.com", "subdomain.example.com")); // Wildcard matching works.
+                assert!(matches_dns("*.eXaMpLe.cOm", "subdomain.example.com")); // Wildcard matching ignores case of subject.
+                assert!(matches_dns("*.example.com", "sUbDoMaIn.eXaMpLe.cOm")); // Wildcard matching ignores case of hostname.
+
+                assert!(!matches_dns("prefix*.example.com", "p.example.com")); // Prefix longer than the label works and does not match.
+                assert!(!matches_dns("*suffix.example.com", "s.example.com")); // Suffix longer than the label works and does not match.
+
+                assert!(!matches_dns("prefix*.example.com", "prefix.example.com")); // Partial wildcards do not work.
+                assert!(!matches_dns("*suffix.example.com", "suffix.example.com")); // Partial wildcards do not work.
+
+                assert!(!matches_dns("prefix*.example.com", "prefixdomain.example.com")); // Partial wildcards do not work.
+                assert!(!matches_dns("*suffix.example.com", "domainsuffix.example.com")); // Partial wildcards do not work.
+
+                assert!(!matches_dns("xn--*.example.com", "subdomain.example.com")); // Punycode domains with wildcard parts do not match.
+                assert!(!matches_dns("xN--*.example.com", "subdomain.example.com")); // And we can't bypass a punycode test with weird casing.
+                assert!(!matches_dns("Xn--*.example.com", "subdomain.example.com")); // And we can't bypass a punycode test with weird casing.
+                assert!(!matches_dns("XN--*.example.com", "subdomain.example.com")); // And we can't bypass a punycode test with weird casing.
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/ssl/error.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/ssl/error.rs
--- 43.0.0-1/rust-vendor/openssl/src/ssl/error.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/ssl/error.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,185 @@
+use libc::c_int;
+use std::error;
+use std::error::Error as StdError;
+use std::fmt;
+use std::io;
+
+use crate::error::ErrorStack;
+use crate::ssl::MidHandshakeSslStream;
+use crate::x509::X509VerifyResult;
+
+/// An error code returned from SSL functions.
+#[derive(Debug, Copy, Clone, PartialEq, Eq)]
+pub struct ErrorCode(c_int);
+
+impl ErrorCode {
+    /// The SSL session has been closed.
+    pub const ZERO_RETURN: ErrorCode = ErrorCode(ffi::SSL_ERROR_ZERO_RETURN);
+
+    /// An attempt to read data from the underlying socket returned `WouldBlock`.
+    ///
+    /// Wait for read readiness and retry the operation.
+    pub const WANT_READ: ErrorCode = ErrorCode(ffi::SSL_ERROR_WANT_READ);
+
+    /// An attempt to write data to the underlying socket returned `WouldBlock`.
+    ///
+    /// Wait for write readiness and retry the operation.
+    pub const WANT_WRITE: ErrorCode = ErrorCode(ffi::SSL_ERROR_WANT_WRITE);
+
+    /// A non-recoverable IO error occurred.
+    pub const SYSCALL: ErrorCode = ErrorCode(ffi::SSL_ERROR_SYSCALL);
+
+    /// An error occurred in the SSL library.
+    pub const SSL: ErrorCode = ErrorCode(ffi::SSL_ERROR_SSL);
+
+    /// The client hello callback indicated that it needed to be retried.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[cfg(ossl111)]
+    pub const WANT_CLIENT_HELLO_CB: ErrorCode = ErrorCode(ffi::SSL_ERROR_WANT_CLIENT_HELLO_CB);
+
+    pub fn from_raw(raw: c_int) -> ErrorCode {
+        ErrorCode(raw)
+    }
+
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn as_raw(&self) -> c_int {
+        self.0
+    }
+}
+
+#[derive(Debug)]
+pub(crate) enum InnerError {
+    Io(io::Error),
+    Ssl(ErrorStack),
+}
+
+/// An SSL error.
+#[derive(Debug)]
+pub struct Error {
+    pub(crate) code: ErrorCode,
+    pub(crate) cause: Option<InnerError>,
+}
+
+impl Error {
+    pub fn code(&self) -> ErrorCode {
+        self.code
+    }
+
+    pub fn io_error(&self) -> Option<&io::Error> {
+        match self.cause {
+            Some(InnerError::Io(ref e)) => Some(e),
+            _ => None,
+        }
+    }
+
+    pub fn into_io_error(self) -> Result<io::Error, Error> {
+        match self.cause {
+            Some(InnerError::Io(e)) => Ok(e),
+            _ => Err(self),
+        }
+    }
+
+    pub fn ssl_error(&self) -> Option<&ErrorStack> {
+        match self.cause {
+            Some(InnerError::Ssl(ref e)) => Some(e),
+            _ => None,
+        }
+    }
+}
+
+impl From<ErrorStack> for Error {
+    fn from(e: ErrorStack) -> Error {
+        Error {
+            code: ErrorCode::SSL,
+            cause: Some(InnerError::Ssl(e)),
+        }
+    }
+}
+
+impl fmt::Display for Error {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
+        match self.code {
+            ErrorCode::ZERO_RETURN => fmt.write_str("the SSL session has been shut down"),
+            ErrorCode::WANT_READ => match self.io_error() {
+                Some(_) => fmt.write_str("a nonblocking read call would have blocked"),
+                None => fmt.write_str("the operation should be retried"),
+            },
+            ErrorCode::WANT_WRITE => match self.io_error() {
+                Some(_) => fmt.write_str("a nonblocking write call would have blocked"),
+                None => fmt.write_str("the operation should be retried"),
+            },
+            ErrorCode::SYSCALL => match self.io_error() {
+                Some(err) => write!(fmt, "{}", err),
+                None => fmt.write_str("unexpected EOF"),
+            },
+            ErrorCode::SSL => match self.ssl_error() {
+                Some(e) => write!(fmt, "{}", e),
+                None => fmt.write_str("OpenSSL error"),
+            },
+            ErrorCode(code) => write!(fmt, "unknown error code {}", code),
+        }
+    }
+}
+
+impl error::Error for Error {
+    fn source(&self) -> Option<&(dyn error::Error + 'static)> {
+        match self.cause {
+            Some(InnerError::Io(ref e)) => Some(e),
+            Some(InnerError::Ssl(ref e)) => Some(e),
+            None => None,
+        }
+    }
+}
+
+/// An error or intermediate state after a TLS handshake attempt.
+// FIXME overhaul
+#[derive(Debug)]
+pub enum HandshakeError<S> {
+    /// Setup failed.
+    SetupFailure(ErrorStack),
+    /// The handshake failed.
+    Failure(MidHandshakeSslStream<S>),
+    /// The handshake encountered a `WouldBlock` error midway through.
+    ///
+    /// This error will never be returned for blocking streams.
+    WouldBlock(MidHandshakeSslStream<S>),
+}
+
+impl<S: fmt::Debug> StdError for HandshakeError<S> {
+    fn source(&self) -> Option<&(dyn StdError + 'static)> {
+        match *self {
+            HandshakeError::SetupFailure(ref e) => Some(e),
+            HandshakeError::Failure(ref s) | HandshakeError::WouldBlock(ref s) => Some(s.error()),
+        }
+    }
+}
+
+impl<S: fmt::Debug> fmt::Display for HandshakeError<S> {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        match *self {
+            HandshakeError::SetupFailure(ref e) => write!(f, "stream setup failed: {}", e)?,
+            HandshakeError::Failure(ref s) => {
+                write!(f, "the handshake failed: {}", s.error())?;
+                let verify = s.ssl().verify_result();
+                if verify != X509VerifyResult::OK {
+                    write!(f, ": {}", verify)?;
+                }
+            }
+            HandshakeError::WouldBlock(ref s) => {
+                write!(f, "the handshake was interrupted: {}", s.error())?;
+                let verify = s.ssl().verify_result();
+                if verify != X509VerifyResult::OK {
+                    write!(f, ": {}", verify)?;
+                }
+            }
+        }
+        Ok(())
+    }
+}
+
+impl<S> From<ErrorStack> for HandshakeError<S> {
+    fn from(e: ErrorStack) -> HandshakeError<S> {
+        HandshakeError::SetupFailure(e)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/ssl/mod.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/ssl/mod.rs
--- 43.0.0-1/rust-vendor/openssl/src/ssl/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/ssl/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4386 @@
+//! SSL/TLS support.
+//!
+//! `SslConnector` and `SslAcceptor` should be used in most cases - they handle
+//! configuration of the OpenSSL primitives for you.
+//!
+//! # Examples
+//!
+//! To connect as a client to a remote server:
+//!
+//! ```no_run
+//! use openssl::ssl::{SslMethod, SslConnector};
+//! use std::io::{Read, Write};
+//! use std::net::TcpStream;
+//!
+//! let connector = SslConnector::builder(SslMethod::tls()).unwrap().build();
+//!
+//! let stream = TcpStream::connect("google.com:443").unwrap();
+//! let mut stream = connector.connect("google.com", stream).unwrap();
+//!
+//! stream.write_all(b"GET / HTTP/1.0\r\n\r\n").unwrap();
+//! let mut res = vec![];
+//! stream.read_to_end(&mut res).unwrap();
+//! println!("{}", String::from_utf8_lossy(&res));
+//! ```
+//!
+//! To accept connections as a server from remote clients:
+//!
+//! ```no_run
+//! use openssl::ssl::{SslMethod, SslAcceptor, SslStream, SslFiletype};
+//! use std::net::{TcpListener, TcpStream};
+//! use std::sync::Arc;
+//! use std::thread;
+//!
+//!
+//! let mut acceptor = SslAcceptor::mozilla_intermediate(SslMethod::tls()).unwrap();
+//! acceptor.set_private_key_file("key.pem", SslFiletype::PEM).unwrap();
+//! acceptor.set_certificate_chain_file("certs.pem").unwrap();
+//! acceptor.check_private_key().unwrap();
+//! let acceptor = Arc::new(acceptor.build());
+//!
+//! let listener = TcpListener::bind("0.0.0.0:8443").unwrap();
+//!
+//! fn handle_client(stream: SslStream<TcpStream>) {
+//!     // ...
+//! }
+//!
+//! for stream in listener.incoming() {
+//!     match stream {
+//!         Ok(stream) => {
+//!             let acceptor = acceptor.clone();
+//!             thread::spawn(move || {
+//!                 let stream = acceptor.accept(stream).unwrap();
+//!                 handle_client(stream);
+//!             });
+//!         }
+//!         Err(e) => { /* connection failed */ }
+//!     }
+//! }
+//! ```
+#[cfg(ossl300)]
+use crate::cvt_long;
+use crate::dh::{Dh, DhRef};
+#[cfg(all(ossl101, not(ossl110)))]
+use crate::ec::EcKey;
+use crate::ec::EcKeyRef;
+use crate::error::ErrorStack;
+use crate::ex_data::Index;
+#[cfg(ossl111)]
+use crate::hash::MessageDigest;
+#[cfg(any(ossl110, libressl270))]
+use crate::nid::Nid;
+use crate::pkey::{HasPrivate, PKeyRef, Params, Private};
+#[cfg(ossl300)]
+use crate::pkey::{PKey, Public};
+use crate::srtp::{SrtpProtectionProfile, SrtpProtectionProfileRef};
+use crate::ssl::bio::BioMethod;
+use crate::ssl::callbacks::*;
+use crate::ssl::error::InnerError;
+use crate::stack::{Stack, StackRef, Stackable};
+use crate::util::{ForeignTypeExt, ForeignTypeRefExt};
+use crate::x509::store::{X509Store, X509StoreBuilderRef, X509StoreRef};
+#[cfg(any(ossl102, boringssl, libressl261))]
+use crate::x509::verify::X509VerifyParamRef;
+use crate::x509::{X509Name, X509Ref, X509StoreContextRef, X509VerifyResult, X509};
+use crate::{cvt, cvt_n, cvt_p, init};
+use bitflags::bitflags;
+use cfg_if::cfg_if;
+use foreign_types::{ForeignType, ForeignTypeRef, Opaque};
+use libc::{c_char, c_int, c_long, c_uchar, c_uint, c_void};
+use once_cell::sync::{Lazy, OnceCell};
+use openssl_macros::corresponds;
+use std::any::TypeId;
+use std::collections::HashMap;
+use std::ffi::{CStr, CString};
+use std::fmt;
+use std::io;
+use std::io::prelude::*;
+use std::marker::PhantomData;
+use std::mem::{self, ManuallyDrop, MaybeUninit};
+use std::ops::{Deref, DerefMut};
+use std::panic::resume_unwind;
+use std::path::Path;
+use std::ptr;
+use std::slice;
+use std::str;
+use std::sync::{Arc, Mutex};
+
+pub use crate::ssl::connector::{
+    ConnectConfiguration, SslAcceptor, SslAcceptorBuilder, SslConnector, SslConnectorBuilder,
+};
+pub use crate::ssl::error::{Error, ErrorCode, HandshakeError};
+
+mod bio;
+mod callbacks;
+mod connector;
+mod error;
+#[cfg(test)]
+mod test;
+
+/// Returns the OpenSSL name of a cipher corresponding to an RFC-standard cipher name.
+///
+/// If the cipher has no corresponding OpenSSL name, the string `(NONE)` is returned.
+///
+/// Requires OpenSSL 1.1.1 or newer.
+#[corresponds(OPENSSL_cipher_name)]
+#[cfg(ossl111)]
+pub fn cipher_name(std_name: &str) -> &'static str {
+    unsafe {
+        ffi::init();
+
+        let s = CString::new(std_name).unwrap();
+        let ptr = ffi::OPENSSL_cipher_name(s.as_ptr());
+        CStr::from_ptr(ptr).to_str().unwrap()
+    }
+}
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        type SslOptionsRepr = u64;
+    } else if #[cfg(boringssl)] {
+        type SslOptionsRepr = u32;
+    } else {
+        type SslOptionsRepr = libc::c_ulong;
+    }
+}
+
+bitflags! {
+    /// Options controlling the behavior of an `SslContext`.
+    #[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+    #[repr(transparent)]
+    pub struct SslOptions: SslOptionsRepr {
+        /// Disables a countermeasure against an SSLv3/TLSv1.0 vulnerability affecting CBC ciphers.
+        const DONT_INSERT_EMPTY_FRAGMENTS = ffi::SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS as SslOptionsRepr;
+
+        /// A "reasonable default" set of options which enables compatibility flags.
+        #[cfg(not(boringssl))]
+        const ALL = ffi::SSL_OP_ALL as SslOptionsRepr;
+
+        /// Do not query the MTU.
+        ///
+        /// Only affects DTLS connections.
+        const NO_QUERY_MTU = ffi::SSL_OP_NO_QUERY_MTU as SslOptionsRepr;
+
+        /// Enables Cookie Exchange as described in [RFC 4347 Section 4.2.1].
+        ///
+        /// Only affects DTLS connections.
+        ///
+        /// [RFC 4347 Section 4.2.1]: https://tools.ietf.org/html/rfc4347#section-4.2.1
+        #[cfg(not(boringssl))]
+        const COOKIE_EXCHANGE = ffi::SSL_OP_COOKIE_EXCHANGE as SslOptionsRepr;
+
+        /// Disables the use of session tickets for session resumption.
+        const NO_TICKET = ffi::SSL_OP_NO_TICKET as SslOptionsRepr;
+
+        /// Always start a new session when performing a renegotiation on the server side.
+        #[cfg(not(boringssl))]
+        const NO_SESSION_RESUMPTION_ON_RENEGOTIATION =
+            ffi::SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION as SslOptionsRepr;
+
+        /// Disables the use of TLS compression.
+        #[cfg(not(boringssl))]
+        const NO_COMPRESSION = ffi::SSL_OP_NO_COMPRESSION as SslOptionsRepr;
+
+        /// Allow legacy insecure renegotiation with servers or clients that do not support secure
+        /// renegotiation.
+        const ALLOW_UNSAFE_LEGACY_RENEGOTIATION =
+            ffi::SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION as SslOptionsRepr;
+
+        /// Creates a new key for each session when using ECDHE.
+        ///
+        /// This is always enabled in OpenSSL 1.1.0.
+        const SINGLE_ECDH_USE = ffi::SSL_OP_SINGLE_ECDH_USE as SslOptionsRepr;
+
+        /// Creates a new key for each session when using DHE.
+        ///
+        /// This is always enabled in OpenSSL 1.1.0.
+        const SINGLE_DH_USE = ffi::SSL_OP_SINGLE_DH_USE as SslOptionsRepr;
+
+        /// Use the server's preferences rather than the client's when selecting a cipher.
+        ///
+        /// This has no effect on the client side.
+        const CIPHER_SERVER_PREFERENCE = ffi::SSL_OP_CIPHER_SERVER_PREFERENCE as SslOptionsRepr;
+
+        /// Disables version rollback attach detection.
+        const TLS_ROLLBACK_BUG = ffi::SSL_OP_TLS_ROLLBACK_BUG as SslOptionsRepr;
+
+        /// Disables the use of SSLv2.
+        const NO_SSLV2 = ffi::SSL_OP_NO_SSLv2 as SslOptionsRepr;
+
+        /// Disables the use of SSLv3.
+        const NO_SSLV3 = ffi::SSL_OP_NO_SSLv3 as SslOptionsRepr;
+
+        /// Disables the use of TLSv1.0.
+        const NO_TLSV1 = ffi::SSL_OP_NO_TLSv1 as SslOptionsRepr;
+
+        /// Disables the use of TLSv1.1.
+        const NO_TLSV1_1 = ffi::SSL_OP_NO_TLSv1_1 as SslOptionsRepr;
+
+        /// Disables the use of TLSv1.2.
+        const NO_TLSV1_2 = ffi::SSL_OP_NO_TLSv1_2 as SslOptionsRepr;
+
+        /// Disables the use of TLSv1.3.
+        ///
+        /// Requires OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
+        #[cfg(any(boringssl, ossl111, libressl340))]
+        const NO_TLSV1_3 = ffi::SSL_OP_NO_TLSv1_3 as SslOptionsRepr;
+
+        /// Disables the use of DTLSv1.0
+        ///
+        /// Requires OpenSSL 1.0.2 or LibreSSL 3.3.2 or newer.
+        #[cfg(any(boringssl, ossl102, ossl110, libressl332))]
+        const NO_DTLSV1 = ffi::SSL_OP_NO_DTLSv1 as SslOptionsRepr;
+
+        /// Disables the use of DTLSv1.2.
+        ///
+        /// Requires OpenSSL 1.0.2 or LibreSSL 3.3.2 or newer.
+        #[cfg(any(boringssl, ossl102, ossl110, libressl332))]
+        const NO_DTLSV1_2 = ffi::SSL_OP_NO_DTLSv1_2 as SslOptionsRepr;
+
+        /// Disables the use of all (D)TLS protocol versions.
+        ///
+        /// This can be used as a mask when whitelisting protocol versions.
+        ///
+        /// Requires OpenSSL 1.0.2 or newer.
+        ///
+        /// # Examples
+        ///
+        /// Only support TLSv1.2:
+        ///
+        /// ```rust
+        /// use openssl::ssl::SslOptions;
+        ///
+        /// let options = SslOptions::NO_SSL_MASK & !SslOptions::NO_TLSV1_2;
+        /// ```
+        #[cfg(any(ossl102, ossl110))]
+        const NO_SSL_MASK = ffi::SSL_OP_NO_SSL_MASK as SslOptionsRepr;
+
+        /// Disallow all renegotiation in TLSv1.2 and earlier.
+        ///
+        /// Requires OpenSSL 1.1.0h or newer.
+        #[cfg(any(boringssl, ossl110h))]
+        const NO_RENEGOTIATION = ffi::SSL_OP_NO_RENEGOTIATION as SslOptionsRepr;
+
+        /// Enable TLSv1.3 Compatibility mode.
+        ///
+        /// Requires OpenSSL 1.1.1 or newer. This is on by default in 1.1.1, but a future version
+        /// may have this disabled by default.
+        #[cfg(ossl111)]
+        const ENABLE_MIDDLEBOX_COMPAT = ffi::SSL_OP_ENABLE_MIDDLEBOX_COMPAT as SslOptionsRepr;
+
+        /// Prioritize ChaCha ciphers when preferred by clients.
+        ///
+        /// Temporarily reprioritize ChaCha20-Poly1305 ciphers to the top of the server cipher list
+        /// if a ChaCha20-Poly1305 cipher is at the top of the client cipher list. This helps those
+        /// clients (e.g. mobile) use ChaCha20-Poly1305 if that cipher is anywhere in the server
+        /// cipher list; but still allows other clients to use AES and other ciphers.
+        ///
+        /// Requires enable [`SslOptions::CIPHER_SERVER_PREFERENCE`].
+        /// Requires OpenSSL 1.1.1 or newer.
+        ///
+        /// [`SslOptions::CIPHER_SERVER_PREFERENCE`]: struct.SslOptions.html#associatedconstant.CIPHER_SERVER_PREFERENCE
+        #[cfg(ossl111)]
+        const PRIORITIZE_CHACHA = ffi::SSL_OP_PRIORITIZE_CHACHA as SslOptionsRepr;
+    }
+}
+
+bitflags! {
+    /// Options controlling the behavior of an `SslContext`.
+    #[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+    #[repr(transparent)]
+    pub struct SslMode: SslBitType {
+        /// Enables "short writes".
+        ///
+        /// Normally, a write in OpenSSL will always write out all of the requested data, even if it
+        /// requires more than one TLS record or write to the underlying stream. This option will
+        /// cause a write to return after writing a single TLS record instead.
+        const ENABLE_PARTIAL_WRITE = ffi::SSL_MODE_ENABLE_PARTIAL_WRITE;
+
+        /// Disables a check that the data buffer has not moved between calls when operating in a
+        /// non-blocking context.
+        const ACCEPT_MOVING_WRITE_BUFFER = ffi::SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER;
+
+        /// Enables automatic retries after TLS session events such as renegotiations or heartbeats.
+        ///
+        /// By default, OpenSSL will return a `WantRead` error after a renegotiation or heartbeat.
+        /// This option will cause OpenSSL to automatically continue processing the requested
+        /// operation instead.
+        ///
+        /// Note that `SslStream::read` and `SslStream::write` will automatically retry regardless
+        /// of the state of this option. It only affects `SslStream::ssl_read` and
+        /// `SslStream::ssl_write`.
+        const AUTO_RETRY = ffi::SSL_MODE_AUTO_RETRY;
+
+        /// Disables automatic chain building when verifying a peer's certificate.
+        ///
+        /// TLS peers are responsible for sending the entire certificate chain from the leaf to a
+        /// trusted root, but some will incorrectly not do so. OpenSSL will try to build the chain
+        /// out of certificates it knows of, and this option will disable that behavior.
+        const NO_AUTO_CHAIN = ffi::SSL_MODE_NO_AUTO_CHAIN;
+
+        /// Release memory buffers when the session does not need them.
+        ///
+        /// This saves ~34 KiB of memory for idle streams.
+        const RELEASE_BUFFERS = ffi::SSL_MODE_RELEASE_BUFFERS;
+
+        /// Sends the fake `TLS_FALLBACK_SCSV` cipher suite in the ClientHello message of a
+        /// handshake.
+        ///
+        /// This should only be enabled if a client has failed to connect to a server which
+        /// attempted to downgrade the protocol version of the session.
+        ///
+        /// Do not use this unless you know what you're doing!
+        #[cfg(not(libressl))]
+        const SEND_FALLBACK_SCSV = ffi::SSL_MODE_SEND_FALLBACK_SCSV;
+    }
+}
+
+/// A type specifying the kind of protocol an `SslContext` will speak.
+#[derive(Copy, Clone)]
+pub struct SslMethod(*const ffi::SSL_METHOD);
+
+impl SslMethod {
+    /// Support all versions of the TLS protocol.
+    #[corresponds(TLS_method)]
+    pub fn tls() -> SslMethod {
+        unsafe { SslMethod(TLS_method()) }
+    }
+
+    /// Support all versions of the DTLS protocol.
+    #[corresponds(DTLS_method)]
+    pub fn dtls() -> SslMethod {
+        unsafe { SslMethod(DTLS_method()) }
+    }
+
+    /// Support all versions of the TLS protocol, explicitly as a client.
+    #[corresponds(TLS_client_method)]
+    pub fn tls_client() -> SslMethod {
+        unsafe { SslMethod(TLS_client_method()) }
+    }
+
+    /// Support all versions of the TLS protocol, explicitly as a server.
+    #[corresponds(TLS_server_method)]
+    pub fn tls_server() -> SslMethod {
+        unsafe { SslMethod(TLS_server_method()) }
+    }
+
+    /// Constructs an `SslMethod` from a pointer to the underlying OpenSSL value.
+    ///
+    /// # Safety
+    ///
+    /// The caller must ensure the pointer is valid.
+    pub unsafe fn from_ptr(ptr: *const ffi::SSL_METHOD) -> SslMethod {
+        SslMethod(ptr)
+    }
+
+    /// Returns a pointer to the underlying OpenSSL value.
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn as_ptr(&self) -> *const ffi::SSL_METHOD {
+        self.0
+    }
+}
+
+unsafe impl Sync for SslMethod {}
+unsafe impl Send for SslMethod {}
+
+bitflags! {
+    /// Options controlling the behavior of certificate verification.
+    #[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+    #[repr(transparent)]
+    pub struct SslVerifyMode: i32 {
+        /// Verifies that the peer's certificate is trusted.
+        ///
+        /// On the server side, this will cause OpenSSL to request a certificate from the client.
+        const PEER = ffi::SSL_VERIFY_PEER;
+
+        /// Disables verification of the peer's certificate.
+        ///
+        /// On the server side, this will cause OpenSSL to not request a certificate from the
+        /// client. On the client side, the certificate will be checked for validity, but the
+        /// negotiation will continue regardless of the result of that check.
+        const NONE = ffi::SSL_VERIFY_NONE;
+
+        /// On the server side, abort the handshake if the client did not send a certificate.
+        ///
+        /// This should be paired with `SSL_VERIFY_PEER`. It has no effect on the client side.
+        const FAIL_IF_NO_PEER_CERT = ffi::SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
+    }
+}
+
+#[cfg(boringssl)]
+type SslBitType = c_int;
+#[cfg(not(boringssl))]
+type SslBitType = c_long;
+
+#[cfg(boringssl)]
+type SslTimeTy = u64;
+#[cfg(not(boringssl))]
+type SslTimeTy = c_long;
+
+bitflags! {
+    /// Options controlling the behavior of session caching.
+    #[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+    #[repr(transparent)]
+    pub struct SslSessionCacheMode: SslBitType {
+        /// No session caching for the client or server takes place.
+        const OFF = ffi::SSL_SESS_CACHE_OFF;
+
+        /// Enable session caching on the client side.
+        ///
+        /// OpenSSL has no way of identifying the proper session to reuse automatically, so the
+        /// application is responsible for setting it explicitly via [`SslRef::set_session`].
+        ///
+        /// [`SslRef::set_session`]: struct.SslRef.html#method.set_session
+        const CLIENT = ffi::SSL_SESS_CACHE_CLIENT;
+
+        /// Enable session caching on the server side.
+        ///
+        /// This is the default mode.
+        const SERVER = ffi::SSL_SESS_CACHE_SERVER;
+
+        /// Enable session caching on both the client and server side.
+        const BOTH = ffi::SSL_SESS_CACHE_BOTH;
+
+        /// Disable automatic removal of expired sessions from the session cache.
+        const NO_AUTO_CLEAR = ffi::SSL_SESS_CACHE_NO_AUTO_CLEAR;
+
+        /// Disable use of the internal session cache for session lookups.
+        const NO_INTERNAL_LOOKUP = ffi::SSL_SESS_CACHE_NO_INTERNAL_LOOKUP;
+
+        /// Disable use of the internal session cache for session storage.
+        const NO_INTERNAL_STORE = ffi::SSL_SESS_CACHE_NO_INTERNAL_STORE;
+
+        /// Disable use of the internal session cache for storage and lookup.
+        const NO_INTERNAL = ffi::SSL_SESS_CACHE_NO_INTERNAL;
+    }
+}
+
+#[cfg(ossl111)]
+bitflags! {
+    /// Which messages and under which conditions an extension should be added or expected.
+    #[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+    #[repr(transparent)]
+    pub struct ExtensionContext: c_uint {
+        /// This extension is only allowed in TLS
+        const TLS_ONLY = ffi::SSL_EXT_TLS_ONLY;
+        /// This extension is only allowed in DTLS
+        const DTLS_ONLY = ffi::SSL_EXT_DTLS_ONLY;
+        /// Some extensions may be allowed in DTLS but we don't implement them for it
+        const TLS_IMPLEMENTATION_ONLY = ffi::SSL_EXT_TLS_IMPLEMENTATION_ONLY;
+        /// Most extensions are not defined for SSLv3 but EXT_TYPE_renegotiate is
+        const SSL3_ALLOWED = ffi::SSL_EXT_SSL3_ALLOWED;
+        /// Extension is only defined for TLS1.2 and below
+        const TLS1_2_AND_BELOW_ONLY = ffi::SSL_EXT_TLS1_2_AND_BELOW_ONLY;
+        /// Extension is only defined for TLS1.3 and above
+        const TLS1_3_ONLY = ffi::SSL_EXT_TLS1_3_ONLY;
+        /// Ignore this extension during parsing if we are resuming
+        const IGNORE_ON_RESUMPTION = ffi::SSL_EXT_IGNORE_ON_RESUMPTION;
+        const CLIENT_HELLO = ffi::SSL_EXT_CLIENT_HELLO;
+        /// Really means TLS1.2 or below
+        const TLS1_2_SERVER_HELLO = ffi::SSL_EXT_TLS1_2_SERVER_HELLO;
+        const TLS1_3_SERVER_HELLO = ffi::SSL_EXT_TLS1_3_SERVER_HELLO;
+        const TLS1_3_ENCRYPTED_EXTENSIONS = ffi::SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS;
+        const TLS1_3_HELLO_RETRY_REQUEST = ffi::SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST;
+        const TLS1_3_CERTIFICATE = ffi::SSL_EXT_TLS1_3_CERTIFICATE;
+        const TLS1_3_NEW_SESSION_TICKET = ffi::SSL_EXT_TLS1_3_NEW_SESSION_TICKET;
+        const TLS1_3_CERTIFICATE_REQUEST = ffi::SSL_EXT_TLS1_3_CERTIFICATE_REQUEST;
+    }
+}
+
+/// An identifier of the format of a certificate or key file.
+#[derive(Copy, Clone)]
+pub struct SslFiletype(c_int);
+
+impl SslFiletype {
+    /// The PEM format.
+    ///
+    /// This corresponds to `SSL_FILETYPE_PEM`.
+    pub const PEM: SslFiletype = SslFiletype(ffi::SSL_FILETYPE_PEM);
+
+    /// The ASN1 format.
+    ///
+    /// This corresponds to `SSL_FILETYPE_ASN1`.
+    pub const ASN1: SslFiletype = SslFiletype(ffi::SSL_FILETYPE_ASN1);
+
+    /// Constructs an `SslFiletype` from a raw OpenSSL value.
+    pub fn from_raw(raw: c_int) -> SslFiletype {
+        SslFiletype(raw)
+    }
+
+    /// Returns the raw OpenSSL value represented by this type.
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn as_raw(&self) -> c_int {
+        self.0
+    }
+}
+
+/// An identifier of a certificate status type.
+#[derive(Copy, Clone)]
+pub struct StatusType(c_int);
+
+impl StatusType {
+    /// An OSCP status.
+    pub const OCSP: StatusType = StatusType(ffi::TLSEXT_STATUSTYPE_ocsp);
+
+    /// Constructs a `StatusType` from a raw OpenSSL value.
+    pub fn from_raw(raw: c_int) -> StatusType {
+        StatusType(raw)
+    }
+
+    /// Returns the raw OpenSSL value represented by this type.
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn as_raw(&self) -> c_int {
+        self.0
+    }
+}
+
+/// An identifier of a session name type.
+#[derive(Copy, Clone)]
+pub struct NameType(c_int);
+
+impl NameType {
+    /// A host name.
+    pub const HOST_NAME: NameType = NameType(ffi::TLSEXT_NAMETYPE_host_name);
+
+    /// Constructs a `StatusType` from a raw OpenSSL value.
+    pub fn from_raw(raw: c_int) -> StatusType {
+        StatusType(raw)
+    }
+
+    /// Returns the raw OpenSSL value represented by this type.
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn as_raw(&self) -> c_int {
+        self.0
+    }
+}
+
+static INDEXES: Lazy<Mutex<HashMap<TypeId, c_int>>> = Lazy::new(|| Mutex::new(HashMap::new()));
+static SSL_INDEXES: Lazy<Mutex<HashMap<TypeId, c_int>>> = Lazy::new(|| Mutex::new(HashMap::new()));
+static SESSION_CTX_INDEX: OnceCell<Index<Ssl, SslContext>> = OnceCell::new();
+
+fn try_get_session_ctx_index() -> Result<&'static Index<Ssl, SslContext>, ErrorStack> {
+    SESSION_CTX_INDEX.get_or_try_init(Ssl::new_ex_index)
+}
+
+unsafe extern "C" fn free_data_box<T>(
+    _parent: *mut c_void,
+    ptr: *mut c_void,
+    _ad: *mut ffi::CRYPTO_EX_DATA,
+    _idx: c_int,
+    _argl: c_long,
+    _argp: *mut c_void,
+) {
+    if !ptr.is_null() {
+        let _ = Box::<T>::from_raw(ptr as *mut T);
+    }
+}
+
+/// An error returned from the SNI callback.
+#[derive(Debug, Copy, Clone, PartialEq, Eq)]
+pub struct SniError(c_int);
+
+impl SniError {
+    /// Abort the handshake with a fatal alert.
+    pub const ALERT_FATAL: SniError = SniError(ffi::SSL_TLSEXT_ERR_ALERT_FATAL);
+
+    /// Send a warning alert to the client and continue the handshake.
+    pub const ALERT_WARNING: SniError = SniError(ffi::SSL_TLSEXT_ERR_ALERT_WARNING);
+
+    pub const NOACK: SniError = SniError(ffi::SSL_TLSEXT_ERR_NOACK);
+}
+
+/// An SSL/TLS alert.
+#[derive(Debug, Copy, Clone, PartialEq, Eq)]
+pub struct SslAlert(c_int);
+
+impl SslAlert {
+    /// Alert 112 - `unrecognized_name`.
+    pub const UNRECOGNIZED_NAME: SslAlert = SslAlert(ffi::SSL_AD_UNRECOGNIZED_NAME);
+    pub const ILLEGAL_PARAMETER: SslAlert = SslAlert(ffi::SSL_AD_ILLEGAL_PARAMETER);
+    pub const DECODE_ERROR: SslAlert = SslAlert(ffi::SSL_AD_DECODE_ERROR);
+}
+
+/// An error returned from an ALPN selection callback.
+///
+/// Requires OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer.
+#[cfg(any(ossl102, libressl261))]
+#[derive(Debug, Copy, Clone, PartialEq, Eq)]
+pub struct AlpnError(c_int);
+
+#[cfg(any(ossl102, libressl261))]
+impl AlpnError {
+    /// Terminate the handshake with a fatal alert.
+    ///
+    /// Requires OpenSSL 1.1.0 or newer.
+    #[cfg(ossl110)]
+    pub const ALERT_FATAL: AlpnError = AlpnError(ffi::SSL_TLSEXT_ERR_ALERT_FATAL);
+
+    /// Do not select a protocol, but continue the handshake.
+    pub const NOACK: AlpnError = AlpnError(ffi::SSL_TLSEXT_ERR_NOACK);
+}
+
+/// The result of a client hello callback.
+///
+/// Requires OpenSSL 1.1.1 or newer.
+#[cfg(ossl111)]
+#[derive(Debug, Copy, Clone, PartialEq, Eq)]
+pub struct ClientHelloResponse(c_int);
+
+#[cfg(ossl111)]
+impl ClientHelloResponse {
+    /// Continue the handshake.
+    pub const SUCCESS: ClientHelloResponse = ClientHelloResponse(ffi::SSL_CLIENT_HELLO_SUCCESS);
+
+    /// Return from the handshake with an `ErrorCode::WANT_CLIENT_HELLO_CB` error.
+    pub const RETRY: ClientHelloResponse = ClientHelloResponse(ffi::SSL_CLIENT_HELLO_RETRY);
+}
+
+/// An SSL/TLS protocol version.
+#[derive(Debug, Copy, Clone, PartialEq, Eq)]
+pub struct SslVersion(c_int);
+
+impl SslVersion {
+    /// SSLv3
+    pub const SSL3: SslVersion = SslVersion(ffi::SSL3_VERSION);
+
+    /// TLSv1.0
+    pub const TLS1: SslVersion = SslVersion(ffi::TLS1_VERSION);
+
+    /// TLSv1.1
+    pub const TLS1_1: SslVersion = SslVersion(ffi::TLS1_1_VERSION);
+
+    /// TLSv1.2
+    pub const TLS1_2: SslVersion = SslVersion(ffi::TLS1_2_VERSION);
+
+    /// TLSv1.3
+    ///
+    /// Requires BoringSSL or OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
+    #[cfg(any(ossl111, libressl340, boringssl))]
+    pub const TLS1_3: SslVersion = SslVersion(ffi::TLS1_3_VERSION);
+
+    /// DTLSv1.0
+    ///
+    /// DTLS 1.0 corresponds to TLS 1.1.
+    pub const DTLS1: SslVersion = SslVersion(ffi::DTLS1_VERSION);
+
+    /// DTLSv1.2
+    ///
+    /// DTLS 1.2 corresponds to TLS 1.2 to harmonize versions. There was never a DTLS 1.1.
+    #[cfg(any(ossl102, libressl332, boringssl))]
+    pub const DTLS1_2: SslVersion = SslVersion(ffi::DTLS1_2_VERSION);
+}
+
+cfg_if! {
+    if #[cfg(boringssl)] {
+        type SslCacheTy = i64;
+        type SslCacheSize = libc::c_ulong;
+        type MtuTy = u32;
+        type SizeTy = usize;
+    } else {
+        type SslCacheTy = i64;
+        type SslCacheSize = c_long;
+        type MtuTy = c_long;
+        type SizeTy = u32;
+    }
+}
+
+/// A standard implementation of protocol selection for Application Layer Protocol Negotiation
+/// (ALPN).
+///
+/// `server` should contain the server's list of supported protocols and `client` the client's. They
+/// must both be in the ALPN wire format. See the documentation for
+/// [`SslContextBuilder::set_alpn_protos`] for details.
+///
+/// It will select the first protocol supported by the server which is also supported by the client.
+///
+/// [`SslContextBuilder::set_alpn_protos`]: struct.SslContextBuilder.html#method.set_alpn_protos
+#[corresponds(SSL_select_next_proto)]
+pub fn select_next_proto<'a>(server: &[u8], client: &'a [u8]) -> Option<&'a [u8]> {
+    unsafe {
+        let mut out = ptr::null_mut();
+        let mut outlen = 0;
+        let r = ffi::SSL_select_next_proto(
+            &mut out,
+            &mut outlen,
+            server.as_ptr(),
+            server.len() as c_uint,
+            client.as_ptr(),
+            client.len() as c_uint,
+        );
+        if r == ffi::OPENSSL_NPN_NEGOTIATED {
+            Some(slice::from_raw_parts(out as *const u8, outlen as usize))
+        } else {
+            None
+        }
+    }
+}
+
+/// A builder for `SslContext`s.
+pub struct SslContextBuilder(SslContext);
+
+impl SslContextBuilder {
+    /// Creates a new `SslContextBuilder`.
+    #[corresponds(SSL_CTX_new)]
+    pub fn new(method: SslMethod) -> Result<SslContextBuilder, ErrorStack> {
+        unsafe {
+            init();
+            let ctx = cvt_p(ffi::SSL_CTX_new(method.as_ptr()))?;
+
+            Ok(SslContextBuilder::from_ptr(ctx))
+        }
+    }
+
+    /// Creates an `SslContextBuilder` from a pointer to a raw OpenSSL value.
+    ///
+    /// # Safety
+    ///
+    /// The caller must ensure that the pointer is valid and uniquely owned by the builder.
+    pub unsafe fn from_ptr(ctx: *mut ffi::SSL_CTX) -> SslContextBuilder {
+        SslContextBuilder(SslContext::from_ptr(ctx))
+    }
+
+    /// Returns a pointer to the raw OpenSSL value.
+    pub fn as_ptr(&self) -> *mut ffi::SSL_CTX {
+        self.0.as_ptr()
+    }
+
+    /// Configures the certificate verification method for new connections.
+    #[corresponds(SSL_CTX_set_verify)]
+    pub fn set_verify(&mut self, mode: SslVerifyMode) {
+        unsafe {
+            ffi::SSL_CTX_set_verify(self.as_ptr(), mode.bits() as c_int, None);
+        }
+    }
+
+    /// Configures the certificate verification method for new connections and
+    /// registers a verification callback.
+    ///
+    /// The callback is passed a boolean indicating if OpenSSL's internal verification succeeded as
+    /// well as a reference to the `X509StoreContext` which can be used to examine the certificate
+    /// chain. It should return a boolean indicating if verification succeeded.
+    #[corresponds(SSL_CTX_set_verify)]
+    pub fn set_verify_callback<F>(&mut self, mode: SslVerifyMode, verify: F)
+    where
+        F: Fn(bool, &mut X509StoreContextRef) -> bool + 'static + Sync + Send,
+    {
+        unsafe {
+            self.set_ex_data(SslContext::cached_ex_index::<F>(), verify);
+            ffi::SSL_CTX_set_verify(self.as_ptr(), mode.bits() as c_int, Some(raw_verify::<F>));
+        }
+    }
+
+    /// Configures the server name indication (SNI) callback for new connections.
+    ///
+    /// SNI is used to allow a single server to handle requests for multiple domains, each of which
+    /// has its own certificate chain and configuration.
+    ///
+    /// Obtain the server name with the `servername` method and then set the corresponding context
+    /// with `set_ssl_context`
+    #[corresponds(SSL_CTX_set_tlsext_servername_callback)]
+    // FIXME tlsext prefix?
+    pub fn set_servername_callback<F>(&mut self, callback: F)
+    where
+        F: Fn(&mut SslRef, &mut SslAlert) -> Result<(), SniError> + 'static + Sync + Send,
+    {
+        unsafe {
+            // The SNI callback is somewhat unique in that the callback associated with the original
+            // context associated with an SSL can be used even if the SSL's context has been swapped
+            // out. When that happens, we wouldn't be able to look up the callback's state in the
+            // context's ex data. Instead, pass the pointer directly as the servername arg. It's
+            // still stored in ex data to manage the lifetime.
+            let arg = self.set_ex_data_inner(SslContext::cached_ex_index::<F>(), callback);
+            ffi::SSL_CTX_set_tlsext_servername_arg(self.as_ptr(), arg);
+            #[cfg(boringssl)]
+            ffi::SSL_CTX_set_tlsext_servername_callback(self.as_ptr(), Some(raw_sni::<F>));
+            #[cfg(not(boringssl))]
+            ffi::SSL_CTX_set_tlsext_servername_callback__fixed_rust(
+                self.as_ptr(),
+                Some(raw_sni::<F>),
+            );
+        }
+    }
+
+    /// Sets the certificate verification depth.
+    ///
+    /// If the peer's certificate chain is longer than this value, verification will fail.
+    #[corresponds(SSL_CTX_set_verify_depth)]
+    pub fn set_verify_depth(&mut self, depth: u32) {
+        unsafe {
+            ffi::SSL_CTX_set_verify_depth(self.as_ptr(), depth as c_int);
+        }
+    }
+
+    /// Sets a custom certificate store for verifying peer certificates.
+    ///
+    /// Requires OpenSSL 1.0.2 or newer.
+    #[corresponds(SSL_CTX_set0_verify_cert_store)]
+    #[cfg(ossl102)]
+    pub fn set_verify_cert_store(&mut self, cert_store: X509Store) -> Result<(), ErrorStack> {
+        unsafe {
+            let ptr = cert_store.as_ptr();
+            cvt(ffi::SSL_CTX_set0_verify_cert_store(self.as_ptr(), ptr) as c_int)?;
+            mem::forget(cert_store);
+
+            Ok(())
+        }
+    }
+
+    /// Replaces the context's certificate store.
+    #[corresponds(SSL_CTX_set_cert_store)]
+    pub fn set_cert_store(&mut self, cert_store: X509Store) {
+        unsafe {
+            ffi::SSL_CTX_set_cert_store(self.as_ptr(), cert_store.as_ptr());
+            mem::forget(cert_store);
+        }
+    }
+
+    /// Controls read ahead behavior.
+    ///
+    /// If enabled, OpenSSL will read as much data as is available from the underlying stream,
+    /// instead of a single record at a time.
+    ///
+    /// It has no effect when used with DTLS.
+    #[corresponds(SSL_CTX_set_read_ahead)]
+    pub fn set_read_ahead(&mut self, read_ahead: bool) {
+        unsafe {
+            ffi::SSL_CTX_set_read_ahead(self.as_ptr(), read_ahead as SslBitType);
+        }
+    }
+
+    /// Sets the mode used by the context, returning the previous mode.
+    #[corresponds(SSL_CTX_set_mode)]
+    pub fn set_mode(&mut self, mode: SslMode) -> SslMode {
+        unsafe {
+            let bits = ffi::SSL_CTX_set_mode(self.as_ptr(), mode.bits() as MtuTy) as SslBitType;
+            SslMode::from_bits_retain(bits)
+        }
+    }
+
+    /// Sets the parameters to be used during ephemeral Diffie-Hellman key exchange.
+    #[corresponds(SSL_CTX_set_tmp_dh)]
+    pub fn set_tmp_dh(&mut self, dh: &DhRef<Params>) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::SSL_CTX_set_tmp_dh(self.as_ptr(), dh.as_ptr()) as c_int).map(|_| ()) }
+    }
+
+    /// Sets the callback which will generate parameters to be used during ephemeral Diffie-Hellman
+    /// key exchange.
+    ///
+    /// The callback is provided with a reference to the `Ssl` for the session, as well as a boolean
+    /// indicating if the selected cipher is export-grade, and the key length. The export and key
+    /// length options are archaic and should be ignored in almost all cases.
+    #[corresponds(SSL_CTX_set_tmp_dh_callback)]
+    pub fn set_tmp_dh_callback<F>(&mut self, callback: F)
+    where
+        F: Fn(&mut SslRef, bool, u32) -> Result<Dh<Params>, ErrorStack> + 'static + Sync + Send,
+    {
+        unsafe {
+            self.set_ex_data(SslContext::cached_ex_index::<F>(), callback);
+
+            #[cfg(not(boringssl))]
+            ffi::SSL_CTX_set_tmp_dh_callback__fixed_rust(self.as_ptr(), Some(raw_tmp_dh::<F>));
+            #[cfg(boringssl)]
+            ffi::SSL_CTX_set_tmp_dh_callback(self.as_ptr(), Some(raw_tmp_dh::<F>));
+        }
+    }
+
+    /// Sets the parameters to be used during ephemeral elliptic curve Diffie-Hellman key exchange.
+    #[corresponds(SSL_CTX_set_tmp_ecdh)]
+    pub fn set_tmp_ecdh(&mut self, key: &EcKeyRef<Params>) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::SSL_CTX_set_tmp_ecdh(self.as_ptr(), key.as_ptr()) as c_int).map(|_| ()) }
+    }
+
+    /// Sets the callback which will generate parameters to be used during ephemeral elliptic curve
+    /// Diffie-Hellman key exchange.
+    ///
+    /// The callback is provided with a reference to the `Ssl` for the session, as well as a boolean
+    /// indicating if the selected cipher is export-grade, and the key length. The export and key
+    /// length options are archaic and should be ignored in almost all cases.
+    ///
+    /// Requires OpenSSL 1.0.1 or 1.0.2.
+    #[corresponds(SSL_CTX_set_tmp_ecdh_callback)]
+    #[cfg(all(ossl101, not(ossl110)))]
+    #[deprecated(note = "this function leaks memory and does not exist on newer OpenSSL versions")]
+    pub fn set_tmp_ecdh_callback<F>(&mut self, callback: F)
+    where
+        F: Fn(&mut SslRef, bool, u32) -> Result<EcKey<Params>, ErrorStack> + 'static + Sync + Send,
+    {
+        unsafe {
+            self.set_ex_data(SslContext::cached_ex_index::<F>(), callback);
+            ffi::SSL_CTX_set_tmp_ecdh_callback__fixed_rust(self.as_ptr(), Some(raw_tmp_ecdh::<F>));
+        }
+    }
+
+    /// Use the default locations of trusted certificates for verification.
+    ///
+    /// These locations are read from the `SSL_CERT_FILE` and `SSL_CERT_DIR` environment variables
+    /// if present, or defaults specified at OpenSSL build time otherwise.
+    #[corresponds(SSL_CTX_set_default_verify_paths)]
+    pub fn set_default_verify_paths(&mut self) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::SSL_CTX_set_default_verify_paths(self.as_ptr())).map(|_| ()) }
+    }
+
+    /// Loads trusted root certificates from a file.
+    ///
+    /// The file should contain a sequence of PEM-formatted CA certificates.
+    #[corresponds(SSL_CTX_load_verify_locations)]
+    pub fn set_ca_file<P: AsRef<Path>>(&mut self, file: P) -> Result<(), ErrorStack> {
+        let file = CString::new(file.as_ref().as_os_str().to_str().unwrap()).unwrap();
+        unsafe {
+            cvt(ffi::SSL_CTX_load_verify_locations(
+                self.as_ptr(),
+                file.as_ptr() as *const _,
+                ptr::null(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the list of CA names sent to the client.
+    ///
+    /// The CA certificates must still be added to the trust root - they are not automatically set
+    /// as trusted by this method.
+    #[corresponds(SSL_CTX_set_client_CA_list)]
+    pub fn set_client_ca_list(&mut self, list: Stack<X509Name>) {
+        unsafe {
+            ffi::SSL_CTX_set_client_CA_list(self.as_ptr(), list.as_ptr());
+            mem::forget(list);
+        }
+    }
+
+    /// Add the provided CA certificate to the list sent by the server to the client when
+    /// requesting client-side TLS authentication.
+    #[corresponds(SSL_CTX_add_client_CA)]
+    pub fn add_client_ca(&mut self, cacert: &X509Ref) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::SSL_CTX_add_client_CA(self.as_ptr(), cacert.as_ptr())).map(|_| ()) }
+    }
+
+    /// Set the context identifier for sessions.
+    ///
+    /// This value identifies the server's session cache to clients, telling them when they're
+    /// able to reuse sessions. It should be set to a unique value per server, unless multiple
+    /// servers share a session cache.
+    ///
+    /// This value should be set when using client certificates, or each request will fail its
+    /// handshake and need to be restarted.
+    #[corresponds(SSL_CTX_set_session_id_context)]
+    pub fn set_session_id_context(&mut self, sid_ctx: &[u8]) -> Result<(), ErrorStack> {
+        unsafe {
+            assert!(sid_ctx.len() <= c_uint::MAX as usize);
+            cvt(ffi::SSL_CTX_set_session_id_context(
+                self.as_ptr(),
+                sid_ctx.as_ptr(),
+                sid_ctx.len() as SizeTy,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Loads a leaf certificate from a file.
+    ///
+    /// Only a single certificate will be loaded - use `add_extra_chain_cert` to add the remainder
+    /// of the certificate chain, or `set_certificate_chain_file` to load the entire chain from a
+    /// single file.
+    #[corresponds(SSL_CTX_use_certificate_file)]
+    pub fn set_certificate_file<P: AsRef<Path>>(
+        &mut self,
+        file: P,
+        file_type: SslFiletype,
+    ) -> Result<(), ErrorStack> {
+        let file = CString::new(file.as_ref().as_os_str().to_str().unwrap()).unwrap();
+        unsafe {
+            cvt(ffi::SSL_CTX_use_certificate_file(
+                self.as_ptr(),
+                file.as_ptr() as *const _,
+                file_type.as_raw(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Loads a certificate chain from a file.
+    ///
+    /// The file should contain a sequence of PEM-formatted certificates, the first being the leaf
+    /// certificate, and the remainder forming the chain of certificates up to and including the
+    /// trusted root certificate.
+    #[corresponds(SSL_CTX_use_certificate_chain_file)]
+    pub fn set_certificate_chain_file<P: AsRef<Path>>(
+        &mut self,
+        file: P,
+    ) -> Result<(), ErrorStack> {
+        let file = CString::new(file.as_ref().as_os_str().to_str().unwrap()).unwrap();
+        unsafe {
+            cvt(ffi::SSL_CTX_use_certificate_chain_file(
+                self.as_ptr(),
+                file.as_ptr() as *const _,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the leaf certificate.
+    ///
+    /// Use `add_extra_chain_cert` to add the remainder of the certificate chain.
+    #[corresponds(SSL_CTX_use_certificate)]
+    pub fn set_certificate(&mut self, cert: &X509Ref) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::SSL_CTX_use_certificate(self.as_ptr(), cert.as_ptr())).map(|_| ()) }
+    }
+
+    /// Appends a certificate to the certificate chain.
+    ///
+    /// This chain should contain all certificates necessary to go from the certificate specified by
+    /// `set_certificate` to a trusted root.
+    #[corresponds(SSL_CTX_add_extra_chain_cert)]
+    pub fn add_extra_chain_cert(&mut self, cert: X509) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::SSL_CTX_add_extra_chain_cert(self.as_ptr(), cert.as_ptr()) as c_int)?;
+            mem::forget(cert);
+            Ok(())
+        }
+    }
+
+    /// Loads the private key from a file.
+    #[corresponds(SSL_CTX_use_PrivateKey_file)]
+    pub fn set_private_key_file<P: AsRef<Path>>(
+        &mut self,
+        file: P,
+        file_type: SslFiletype,
+    ) -> Result<(), ErrorStack> {
+        let file = CString::new(file.as_ref().as_os_str().to_str().unwrap()).unwrap();
+        unsafe {
+            cvt(ffi::SSL_CTX_use_PrivateKey_file(
+                self.as_ptr(),
+                file.as_ptr() as *const _,
+                file_type.as_raw(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the private key.
+    #[corresponds(SSL_CTX_use_PrivateKey)]
+    pub fn set_private_key<T>(&mut self, key: &PKeyRef<T>) -> Result<(), ErrorStack>
+    where
+        T: HasPrivate,
+    {
+        unsafe { cvt(ffi::SSL_CTX_use_PrivateKey(self.as_ptr(), key.as_ptr())).map(|_| ()) }
+    }
+
+    /// Sets the list of supported ciphers for protocols before TLSv1.3.
+    ///
+    /// The `set_ciphersuites` method controls the cipher suites for TLSv1.3.
+    ///
+    /// See [`ciphers`] for details on the format.
+    ///
+    /// [`ciphers`]: https://www.openssl.org/docs/manmaster/apps/ciphers.html
+    #[corresponds(SSL_CTX_set_cipher_list)]
+    pub fn set_cipher_list(&mut self, cipher_list: &str) -> Result<(), ErrorStack> {
+        let cipher_list = CString::new(cipher_list).unwrap();
+        unsafe {
+            cvt(ffi::SSL_CTX_set_cipher_list(
+                self.as_ptr(),
+                cipher_list.as_ptr() as *const _,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the list of supported ciphers for the TLSv1.3 protocol.
+    ///
+    /// The `set_cipher_list` method controls the cipher suites for protocols before TLSv1.3.
+    ///
+    /// The format consists of TLSv1.3 cipher suite names separated by `:` characters in order of
+    /// preference.
+    ///
+    /// Requires OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
+    #[corresponds(SSL_CTX_set_ciphersuites)]
+    #[cfg(any(ossl111, libressl340))]
+    pub fn set_ciphersuites(&mut self, cipher_list: &str) -> Result<(), ErrorStack> {
+        let cipher_list = CString::new(cipher_list).unwrap();
+        unsafe {
+            cvt(ffi::SSL_CTX_set_ciphersuites(
+                self.as_ptr(),
+                cipher_list.as_ptr() as *const _,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Enables ECDHE key exchange with an automatically chosen curve list.
+    ///
+    /// Requires OpenSSL 1.0.2.
+    #[corresponds(SSL_CTX_set_ecdh_auto)]
+    #[cfg(any(libressl, all(ossl102, not(ossl110))))]
+    pub fn set_ecdh_auto(&mut self, onoff: bool) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::SSL_CTX_set_ecdh_auto(self.as_ptr(), onoff as c_int)).map(|_| ()) }
+    }
+
+    /// Sets the options used by the context, returning the old set.
+    ///
+    /// # Note
+    ///
+    /// This *enables* the specified options, but does not disable unspecified options. Use
+    /// `clear_options` for that.
+    #[corresponds(SSL_CTX_set_options)]
+    pub fn set_options(&mut self, option: SslOptions) -> SslOptions {
+        let bits =
+            unsafe { ffi::SSL_CTX_set_options(self.as_ptr(), option.bits()) } as SslOptionsRepr;
+        SslOptions::from_bits_retain(bits)
+    }
+
+    /// Returns the options used by the context.
+    #[corresponds(SSL_CTX_get_options)]
+    pub fn options(&self) -> SslOptions {
+        let bits = unsafe { ffi::SSL_CTX_get_options(self.as_ptr()) } as SslOptionsRepr;
+        SslOptions::from_bits_retain(bits)
+    }
+
+    /// Clears the options used by the context, returning the old set.
+    #[corresponds(SSL_CTX_clear_options)]
+    pub fn clear_options(&mut self, option: SslOptions) -> SslOptions {
+        let bits =
+            unsafe { ffi::SSL_CTX_clear_options(self.as_ptr(), option.bits()) } as SslOptionsRepr;
+        SslOptions::from_bits_retain(bits)
+    }
+
+    /// Sets the minimum supported protocol version.
+    ///
+    /// A value of `None` will enable protocol versions down to the lowest version supported by
+    /// OpenSSL.
+    ///
+    /// Requires BoringSSL or OpenSSL 1.1.0 or LibreSSL 2.6.1 or newer.
+    #[corresponds(SSL_CTX_set_min_proto_version)]
+    #[cfg(any(ossl110, libressl261, boringssl))]
+    pub fn set_min_proto_version(&mut self, version: Option<SslVersion>) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::SSL_CTX_set_min_proto_version(
+                self.as_ptr(),
+                version.map_or(0, |v| v.0 as _),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the maximum supported protocol version.
+    ///
+    /// A value of `None` will enable protocol versions up to the highest version supported by
+    /// OpenSSL.
+    ///
+    /// Requires BoringSSL or OpenSSL 1.1.0 or or LibreSSL 2.6.1 or newer.
+    #[corresponds(SSL_CTX_set_max_proto_version)]
+    #[cfg(any(ossl110, libressl261, boringssl))]
+    pub fn set_max_proto_version(&mut self, version: Option<SslVersion>) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::SSL_CTX_set_max_proto_version(
+                self.as_ptr(),
+                version.map_or(0, |v| v.0 as _),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Gets the minimum supported protocol version.
+    ///
+    /// A value of `None` indicates that all versions down to the lowest version supported by
+    /// OpenSSL are enabled.
+    ///
+    /// Requires OpenSSL 1.1.0g or LibreSSL 2.7.0 or newer.
+    #[corresponds(SSL_CTX_get_min_proto_version)]
+    #[cfg(any(ossl110g, libressl270))]
+    pub fn min_proto_version(&mut self) -> Option<SslVersion> {
+        unsafe {
+            let r = ffi::SSL_CTX_get_min_proto_version(self.as_ptr());
+            if r == 0 {
+                None
+            } else {
+                Some(SslVersion(r))
+            }
+        }
+    }
+
+    /// Gets the maximum supported protocol version.
+    ///
+    /// A value of `None` indicates that all versions up to the highest version supported by
+    /// OpenSSL are enabled.
+    ///
+    /// Requires OpenSSL 1.1.0g or LibreSSL 2.7.0 or newer.
+    #[corresponds(SSL_CTX_get_max_proto_version)]
+    #[cfg(any(ossl110g, libressl270))]
+    pub fn max_proto_version(&mut self) -> Option<SslVersion> {
+        unsafe {
+            let r = ffi::SSL_CTX_get_max_proto_version(self.as_ptr());
+            if r == 0 {
+                None
+            } else {
+                Some(SslVersion(r))
+            }
+        }
+    }
+
+    /// Sets the protocols to sent to the server for Application Layer Protocol Negotiation (ALPN).
+    ///
+    /// The input must be in ALPN "wire format". It consists of a sequence of supported protocol
+    /// names prefixed by their byte length. For example, the protocol list consisting of `spdy/1`
+    /// and `http/1.1` is encoded as `b"\x06spdy/1\x08http/1.1"`. The protocols are ordered by
+    /// preference.
+    ///
+    /// Requires BoringSSL or OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer.
+    #[corresponds(SSL_CTX_set_alpn_protos)]
+    #[cfg(any(ossl102, libressl261, boringssl))]
+    pub fn set_alpn_protos(&mut self, protocols: &[u8]) -> Result<(), ErrorStack> {
+        unsafe {
+            assert!(protocols.len() <= c_uint::MAX as usize);
+            let r = ffi::SSL_CTX_set_alpn_protos(
+                self.as_ptr(),
+                protocols.as_ptr(),
+                protocols.len() as _,
+            );
+            // fun fact, SSL_CTX_set_alpn_protos has a reversed return code D:
+            if r == 0 {
+                Ok(())
+            } else {
+                Err(ErrorStack::get())
+            }
+        }
+    }
+
+    /// Enables the DTLS extension "use_srtp" as defined in RFC5764.
+    #[corresponds(SSL_CTX_set_tlsext_use_srtp)]
+    pub fn set_tlsext_use_srtp(&mut self, protocols: &str) -> Result<(), ErrorStack> {
+        unsafe {
+            let cstr = CString::new(protocols).unwrap();
+
+            let r = ffi::SSL_CTX_set_tlsext_use_srtp(self.as_ptr(), cstr.as_ptr());
+            // fun fact, set_tlsext_use_srtp has a reversed return code D:
+            if r == 0 {
+                Ok(())
+            } else {
+                Err(ErrorStack::get())
+            }
+        }
+    }
+
+    /// Sets the callback used by a server to select a protocol for Application Layer Protocol
+    /// Negotiation (ALPN).
+    ///
+    /// The callback is provided with the client's protocol list in ALPN wire format. See the
+    /// documentation for [`SslContextBuilder::set_alpn_protos`] for details. It should return one
+    /// of those protocols on success. The [`select_next_proto`] function implements the standard
+    /// protocol selection algorithm.
+    ///
+    /// Requires OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer.
+    ///
+    /// [`SslContextBuilder::set_alpn_protos`]: struct.SslContextBuilder.html#method.set_alpn_protos
+    /// [`select_next_proto`]: fn.select_next_proto.html
+    #[corresponds(SSL_CTX_set_alpn_select_cb)]
+    #[cfg(any(ossl102, libressl261))]
+    pub fn set_alpn_select_callback<F>(&mut self, callback: F)
+    where
+        F: for<'a> Fn(&mut SslRef, &'a [u8]) -> Result<&'a [u8], AlpnError> + 'static + Sync + Send,
+    {
+        unsafe {
+            self.set_ex_data(SslContext::cached_ex_index::<F>(), callback);
+            ffi::SSL_CTX_set_alpn_select_cb__fixed_rust(
+                self.as_ptr(),
+                Some(callbacks::raw_alpn_select::<F>),
+                ptr::null_mut(),
+            );
+        }
+    }
+
+    /// Checks for consistency between the private key and certificate.
+    #[corresponds(SSL_CTX_check_private_key)]
+    pub fn check_private_key(&self) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::SSL_CTX_check_private_key(self.as_ptr())).map(|_| ()) }
+    }
+
+    /// Returns a shared reference to the context's certificate store.
+    #[corresponds(SSL_CTX_get_cert_store)]
+    pub fn cert_store(&self) -> &X509StoreBuilderRef {
+        unsafe { X509StoreBuilderRef::from_ptr(ffi::SSL_CTX_get_cert_store(self.as_ptr())) }
+    }
+
+    /// Returns a mutable reference to the context's certificate store.
+    #[corresponds(SSL_CTX_get_cert_store)]
+    pub fn cert_store_mut(&mut self) -> &mut X509StoreBuilderRef {
+        unsafe { X509StoreBuilderRef::from_ptr_mut(ffi::SSL_CTX_get_cert_store(self.as_ptr())) }
+    }
+
+    /// Returns a reference to the X509 verification configuration.
+    ///
+    /// Requires BoringSSL or OpenSSL 1.0.2 or newer.
+    #[corresponds(SSL_CTX_get0_param)]
+    #[cfg(any(ossl102, boringssl, libressl261))]
+    pub fn verify_param(&self) -> &X509VerifyParamRef {
+        unsafe { X509VerifyParamRef::from_ptr(ffi::SSL_CTX_get0_param(self.as_ptr())) }
+    }
+
+    /// Returns a mutable reference to the X509 verification configuration.
+    ///
+    /// Requires BoringSSL or OpenSSL 1.0.2 or newer.
+    #[corresponds(SSL_CTX_get0_param)]
+    #[cfg(any(ossl102, boringssl, libressl261))]
+    pub fn verify_param_mut(&mut self) -> &mut X509VerifyParamRef {
+        unsafe { X509VerifyParamRef::from_ptr_mut(ffi::SSL_CTX_get0_param(self.as_ptr())) }
+    }
+
+    /// Sets the callback dealing with OCSP stapling.
+    ///
+    /// On the client side, this callback is responsible for validating the OCSP status response
+    /// returned by the server. The status may be retrieved with the `SslRef::ocsp_status` method.
+    /// A response of `Ok(true)` indicates that the OCSP status is valid, and a response of
+    /// `Ok(false)` indicates that the OCSP status is invalid and the handshake should be
+    /// terminated.
+    ///
+    /// On the server side, this callback is responsible for setting the OCSP status response to be
+    /// returned to clients. The status may be set with the `SslRef::set_ocsp_status` method. A
+    /// response of `Ok(true)` indicates that the OCSP status should be returned to the client, and
+    /// `Ok(false)` indicates that the status should not be returned to the client.
+    #[corresponds(SSL_CTX_set_tlsext_status_cb)]
+    pub fn set_status_callback<F>(&mut self, callback: F) -> Result<(), ErrorStack>
+    where
+        F: Fn(&mut SslRef) -> Result<bool, ErrorStack> + 'static + Sync + Send,
+    {
+        unsafe {
+            self.set_ex_data(SslContext::cached_ex_index::<F>(), callback);
+            cvt(
+                ffi::SSL_CTX_set_tlsext_status_cb(self.as_ptr(), Some(raw_tlsext_status::<F>))
+                    as c_int,
+            )
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the callback for providing an identity and pre-shared key for a TLS-PSK client.
+    ///
+    /// The callback will be called with the SSL context, an identity hint if one was provided
+    /// by the server, a mutable slice for each of the identity and pre-shared key bytes. The
+    /// identity must be written as a null-terminated C string.
+    #[corresponds(SSL_CTX_set_psk_client_callback)]
+    #[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
+    pub fn set_psk_client_callback<F>(&mut self, callback: F)
+    where
+        F: Fn(&mut SslRef, Option<&[u8]>, &mut [u8], &mut [u8]) -> Result<usize, ErrorStack>
+            + 'static
+            + Sync
+            + Send,
+    {
+        unsafe {
+            self.set_ex_data(SslContext::cached_ex_index::<F>(), callback);
+            ffi::SSL_CTX_set_psk_client_callback(self.as_ptr(), Some(raw_client_psk::<F>));
+        }
+    }
+
+    #[deprecated(since = "0.10.10", note = "renamed to `set_psk_client_callback`")]
+    #[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
+    pub fn set_psk_callback<F>(&mut self, callback: F)
+    where
+        F: Fn(&mut SslRef, Option<&[u8]>, &mut [u8], &mut [u8]) -> Result<usize, ErrorStack>
+            + 'static
+            + Sync
+            + Send,
+    {
+        self.set_psk_client_callback(callback)
+    }
+
+    /// Sets the callback for providing an identity and pre-shared key for a TLS-PSK server.
+    ///
+    /// The callback will be called with the SSL context, an identity provided by the client,
+    /// and, a mutable slice for the pre-shared key bytes. The callback returns the number of
+    /// bytes in the pre-shared key.
+    #[corresponds(SSL_CTX_set_psk_server_callback)]
+    #[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
+    pub fn set_psk_server_callback<F>(&mut self, callback: F)
+    where
+        F: Fn(&mut SslRef, Option<&[u8]>, &mut [u8]) -> Result<usize, ErrorStack>
+            + 'static
+            + Sync
+            + Send,
+    {
+        unsafe {
+            self.set_ex_data(SslContext::cached_ex_index::<F>(), callback);
+            ffi::SSL_CTX_set_psk_server_callback(self.as_ptr(), Some(raw_server_psk::<F>));
+        }
+    }
+
+    /// Sets the callback which is called when new sessions are negotiated.
+    ///
+    /// This can be used by clients to implement session caching. While in TLSv1.2 the session is
+    /// available to access via [`SslRef::session`] immediately after the handshake completes, this
+    /// is not the case for TLSv1.3. There, a session is not generally available immediately, and
+    /// the server may provide multiple session tokens to the client over a single session. The new
+    /// session callback is a portable way to deal with both cases.
+    ///
+    /// Note that session caching must be enabled for the callback to be invoked, and it defaults
+    /// off for clients. [`set_session_cache_mode`] controls that behavior.
+    ///
+    /// [`SslRef::session`]: struct.SslRef.html#method.session
+    /// [`set_session_cache_mode`]: #method.set_session_cache_mode
+    #[corresponds(SSL_CTX_sess_set_new_cb)]
+    pub fn set_new_session_callback<F>(&mut self, callback: F)
+    where
+        F: Fn(&mut SslRef, SslSession) + 'static + Sync + Send,
+    {
+        unsafe {
+            self.set_ex_data(SslContext::cached_ex_index::<F>(), callback);
+            ffi::SSL_CTX_sess_set_new_cb(self.as_ptr(), Some(callbacks::raw_new_session::<F>));
+        }
+    }
+
+    /// Sets the callback which is called when sessions are removed from the context.
+    ///
+    /// Sessions can be removed because they have timed out or because they are considered faulty.
+    #[corresponds(SSL_CTX_sess_set_remove_cb)]
+    pub fn set_remove_session_callback<F>(&mut self, callback: F)
+    where
+        F: Fn(&SslContextRef, &SslSessionRef) + 'static + Sync + Send,
+    {
+        unsafe {
+            self.set_ex_data(SslContext::cached_ex_index::<F>(), callback);
+            ffi::SSL_CTX_sess_set_remove_cb(
+                self.as_ptr(),
+                Some(callbacks::raw_remove_session::<F>),
+            );
+        }
+    }
+
+    /// Sets the callback which is called when a client proposed to resume a session but it was not
+    /// found in the internal cache.
+    ///
+    /// The callback is passed a reference to the session ID provided by the client. It should
+    /// return the session corresponding to that ID if available. This is only used for servers, not
+    /// clients.
+    ///
+    /// # Safety
+    ///
+    /// The returned `SslSession` must not be associated with a different `SslContext`.
+    #[corresponds(SSL_CTX_sess_set_get_cb)]
+    pub unsafe fn set_get_session_callback<F>(&mut self, callback: F)
+    where
+        F: Fn(&mut SslRef, &[u8]) -> Option<SslSession> + 'static + Sync + Send,
+    {
+        self.set_ex_data(SslContext::cached_ex_index::<F>(), callback);
+        ffi::SSL_CTX_sess_set_get_cb(self.as_ptr(), Some(callbacks::raw_get_session::<F>));
+    }
+
+    /// Sets the TLS key logging callback.
+    ///
+    /// The callback is invoked whenever TLS key material is generated, and is passed a line of NSS
+    /// SSLKEYLOGFILE-formatted text. This can be used by tools like Wireshark to decrypt message
+    /// traffic. The line does not contain a trailing newline.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(SSL_CTX_set_keylog_callback)]
+    #[cfg(any(ossl111, boringssl))]
+    pub fn set_keylog_callback<F>(&mut self, callback: F)
+    where
+        F: Fn(&SslRef, &str) + 'static + Sync + Send,
+    {
+        unsafe {
+            self.set_ex_data(SslContext::cached_ex_index::<F>(), callback);
+            ffi::SSL_CTX_set_keylog_callback(self.as_ptr(), Some(callbacks::raw_keylog::<F>));
+        }
+    }
+
+    /// Sets the session caching mode use for connections made with the context.
+    ///
+    /// Returns the previous session caching mode.
+    #[corresponds(SSL_CTX_set_session_cache_mode)]
+    pub fn set_session_cache_mode(&mut self, mode: SslSessionCacheMode) -> SslSessionCacheMode {
+        unsafe {
+            let bits = ffi::SSL_CTX_set_session_cache_mode(self.as_ptr(), mode.bits());
+            SslSessionCacheMode::from_bits_retain(bits)
+        }
+    }
+
+    /// Sets the callback for generating an application cookie for TLS1.3
+    /// stateless handshakes.
+    ///
+    /// The callback will be called with the SSL context and a slice into which the cookie
+    /// should be written. The callback should return the number of bytes written.
+    #[corresponds(SSL_CTX_set_stateless_cookie_generate_cb)]
+    #[cfg(ossl111)]
+    pub fn set_stateless_cookie_generate_cb<F>(&mut self, callback: F)
+    where
+        F: Fn(&mut SslRef, &mut [u8]) -> Result<usize, ErrorStack> + 'static + Sync + Send,
+    {
+        unsafe {
+            self.set_ex_data(SslContext::cached_ex_index::<F>(), callback);
+            ffi::SSL_CTX_set_stateless_cookie_generate_cb(
+                self.as_ptr(),
+                Some(raw_stateless_cookie_generate::<F>),
+            );
+        }
+    }
+
+    /// Sets the callback for verifying an application cookie for TLS1.3
+    /// stateless handshakes.
+    ///
+    /// The callback will be called with the SSL context and the cookie supplied by the
+    /// client. It should return true if and only if the cookie is valid.
+    ///
+    /// Note that the OpenSSL implementation independently verifies the integrity of
+    /// application cookies using an HMAC before invoking the supplied callback.
+    #[corresponds(SSL_CTX_set_stateless_cookie_verify_cb)]
+    #[cfg(ossl111)]
+    pub fn set_stateless_cookie_verify_cb<F>(&mut self, callback: F)
+    where
+        F: Fn(&mut SslRef, &[u8]) -> bool + 'static + Sync + Send,
+    {
+        unsafe {
+            self.set_ex_data(SslContext::cached_ex_index::<F>(), callback);
+            ffi::SSL_CTX_set_stateless_cookie_verify_cb(
+                self.as_ptr(),
+                Some(raw_stateless_cookie_verify::<F>),
+            )
+        }
+    }
+
+    /// Sets the callback for generating a DTLSv1 cookie
+    ///
+    /// The callback will be called with the SSL context and a slice into which the cookie
+    /// should be written. The callback should return the number of bytes written.
+    #[corresponds(SSL_CTX_set_cookie_generate_cb)]
+    #[cfg(not(boringssl))]
+    pub fn set_cookie_generate_cb<F>(&mut self, callback: F)
+    where
+        F: Fn(&mut SslRef, &mut [u8]) -> Result<usize, ErrorStack> + 'static + Sync + Send,
+    {
+        unsafe {
+            self.set_ex_data(SslContext::cached_ex_index::<F>(), callback);
+            ffi::SSL_CTX_set_cookie_generate_cb(self.as_ptr(), Some(raw_cookie_generate::<F>));
+        }
+    }
+
+    /// Sets the callback for verifying a DTLSv1 cookie
+    ///
+    /// The callback will be called with the SSL context and the cookie supplied by the
+    /// client. It should return true if and only if the cookie is valid.
+    #[corresponds(SSL_CTX_set_cookie_verify_cb)]
+    #[cfg(not(boringssl))]
+    pub fn set_cookie_verify_cb<F>(&mut self, callback: F)
+    where
+        F: Fn(&mut SslRef, &[u8]) -> bool + 'static + Sync + Send,
+    {
+        unsafe {
+            self.set_ex_data(SslContext::cached_ex_index::<F>(), callback);
+            ffi::SSL_CTX_set_cookie_verify_cb(self.as_ptr(), Some(raw_cookie_verify::<F>));
+        }
+    }
+
+    /// Sets the extra data at the specified index.
+    ///
+    /// This can be used to provide data to callbacks registered with the context. Use the
+    /// `SslContext::new_ex_index` method to create an `Index`.
+    // FIXME should return a result
+    #[corresponds(SSL_CTX_set_ex_data)]
+    pub fn set_ex_data<T>(&mut self, index: Index<SslContext, T>, data: T) {
+        self.set_ex_data_inner(index, data);
+    }
+
+    fn set_ex_data_inner<T>(&mut self, index: Index<SslContext, T>, data: T) -> *mut c_void {
+        match self.ex_data_mut(index) {
+            Some(v) => {
+                *v = data;
+                (v as *mut T).cast()
+            }
+            _ => unsafe {
+                let data = Box::into_raw(Box::new(data)) as *mut c_void;
+                ffi::SSL_CTX_set_ex_data(self.as_ptr(), index.as_raw(), data);
+                data
+            },
+        }
+    }
+
+    fn ex_data_mut<T>(&mut self, index: Index<SslContext, T>) -> Option<&mut T> {
+        unsafe {
+            let data = ffi::SSL_CTX_get_ex_data(self.as_ptr(), index.as_raw());
+            if data.is_null() {
+                None
+            } else {
+                Some(&mut *data.cast())
+            }
+        }
+    }
+
+    /// Adds a custom extension for a TLS/DTLS client or server for all supported protocol versions.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(SSL_CTX_add_custom_ext)]
+    #[cfg(ossl111)]
+    pub fn add_custom_ext<AddFn, ParseFn, T>(
+        &mut self,
+        ext_type: u16,
+        context: ExtensionContext,
+        add_cb: AddFn,
+        parse_cb: ParseFn,
+    ) -> Result<(), ErrorStack>
+    where
+        AddFn: Fn(
+                &mut SslRef,
+                ExtensionContext,
+                Option<(usize, &X509Ref)>,
+            ) -> Result<Option<T>, SslAlert>
+            + 'static
+            + Sync
+            + Send,
+        T: AsRef<[u8]> + 'static + Sync + Send,
+        ParseFn: Fn(
+                &mut SslRef,
+                ExtensionContext,
+                &[u8],
+                Option<(usize, &X509Ref)>,
+            ) -> Result<(), SslAlert>
+            + 'static
+            + Sync
+            + Send,
+    {
+        let ret = unsafe {
+            self.set_ex_data(SslContext::cached_ex_index::<AddFn>(), add_cb);
+            self.set_ex_data(SslContext::cached_ex_index::<ParseFn>(), parse_cb);
+
+            ffi::SSL_CTX_add_custom_ext(
+                self.as_ptr(),
+                ext_type as c_uint,
+                context.bits(),
+                Some(raw_custom_ext_add::<AddFn, T>),
+                Some(raw_custom_ext_free::<T>),
+                ptr::null_mut(),
+                Some(raw_custom_ext_parse::<ParseFn>),
+                ptr::null_mut(),
+            )
+        };
+        if ret == 1 {
+            Ok(())
+        } else {
+            Err(ErrorStack::get())
+        }
+    }
+
+    /// Sets the maximum amount of early data that will be accepted on incoming connections.
+    ///
+    /// Defaults to 0.
+    ///
+    /// Requires OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
+    #[corresponds(SSL_CTX_set_max_early_data)]
+    #[cfg(any(ossl111, libressl340))]
+    pub fn set_max_early_data(&mut self, bytes: u32) -> Result<(), ErrorStack> {
+        if unsafe { ffi::SSL_CTX_set_max_early_data(self.as_ptr(), bytes) } == 1 {
+            Ok(())
+        } else {
+            Err(ErrorStack::get())
+        }
+    }
+
+    /// Sets a callback which will be invoked just after the client's hello message is received.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(SSL_CTX_set_client_hello_cb)]
+    #[cfg(ossl111)]
+    pub fn set_client_hello_callback<F>(&mut self, callback: F)
+    where
+        F: Fn(&mut SslRef, &mut SslAlert) -> Result<ClientHelloResponse, ErrorStack>
+            + 'static
+            + Sync
+            + Send,
+    {
+        unsafe {
+            let ptr = self.set_ex_data_inner(SslContext::cached_ex_index::<F>(), callback);
+            ffi::SSL_CTX_set_client_hello_cb(
+                self.as_ptr(),
+                Some(callbacks::raw_client_hello::<F>),
+                ptr,
+            );
+        }
+    }
+
+    /// Sets the context's session cache size limit, returning the previous limit.
+    ///
+    /// A value of 0 means that the cache size is unbounded.
+    #[corresponds(SSL_CTX_sess_set_cache_size)]
+    #[allow(clippy::useless_conversion)]
+    pub fn set_session_cache_size(&mut self, size: i32) -> i64 {
+        unsafe {
+            ffi::SSL_CTX_sess_set_cache_size(self.as_ptr(), size as SslCacheSize) as SslCacheTy
+        }
+    }
+
+    /// Sets the context's supported signature algorithms.
+    ///
+    /// Requires OpenSSL 1.0.2 or newer.
+    #[corresponds(SSL_CTX_set1_sigalgs_list)]
+    #[cfg(ossl102)]
+    pub fn set_sigalgs_list(&mut self, sigalgs: &str) -> Result<(), ErrorStack> {
+        let sigalgs = CString::new(sigalgs).unwrap();
+        unsafe {
+            cvt(ffi::SSL_CTX_set1_sigalgs_list(self.as_ptr(), sigalgs.as_ptr()) as c_int)
+                .map(|_| ())
+        }
+    }
+
+    /// Sets the context's supported elliptic curve groups.
+    ///
+    /// Requires BoringSSL or OpenSSL 1.1.1 or LibreSSL 2.5.1 or newer.
+    #[corresponds(SSL_CTX_set1_groups_list)]
+    #[cfg(any(ossl111, boringssl, libressl251))]
+    pub fn set_groups_list(&mut self, groups: &str) -> Result<(), ErrorStack> {
+        let groups = CString::new(groups).unwrap();
+        unsafe {
+            cvt(ffi::SSL_CTX_set1_groups_list(self.as_ptr(), groups.as_ptr()) as c_int).map(|_| ())
+        }
+    }
+
+    /// Sets the number of TLS 1.3 session tickets that will be sent to a client after a full
+    /// handshake.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(SSL_CTX_set_num_tickets)]
+    #[cfg(ossl111)]
+    pub fn set_num_tickets(&mut self, num_tickets: usize) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::SSL_CTX_set_num_tickets(self.as_ptr(), num_tickets)).map(|_| ()) }
+    }
+
+    /// Set the context's security level to a value between 0 and 5, inclusive.
+    /// A security value of 0 allows allows all parameters and algorithms.
+    ///
+    /// Requires OpenSSL 1.1.0 or newer.
+    #[corresponds(SSL_CTX_set_security_level)]
+    #[cfg(any(ossl110, libressl360))]
+    pub fn set_security_level(&mut self, level: u32) {
+        unsafe { ffi::SSL_CTX_set_security_level(self.as_ptr(), level as c_int) }
+    }
+
+    /// Consumes the builder, returning a new `SslContext`.
+    pub fn build(self) -> SslContext {
+        self.0
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::SSL_CTX;
+    fn drop = ffi::SSL_CTX_free;
+
+    /// A context object for TLS streams.
+    ///
+    /// Applications commonly configure a single `SslContext` that is shared by all of its
+    /// `SslStreams`.
+    pub struct SslContext;
+
+    /// Reference to [`SslContext`]
+    ///
+    /// [`SslContext`]: struct.SslContext.html
+    pub struct SslContextRef;
+}
+
+impl Clone for SslContext {
+    fn clone(&self) -> Self {
+        (**self).to_owned()
+    }
+}
+
+impl ToOwned for SslContextRef {
+    type Owned = SslContext;
+
+    fn to_owned(&self) -> Self::Owned {
+        unsafe {
+            SSL_CTX_up_ref(self.as_ptr());
+            SslContext::from_ptr(self.as_ptr())
+        }
+    }
+}
+
+// TODO: add useful info here
+impl fmt::Debug for SslContext {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
+        write!(fmt, "SslContext")
+    }
+}
+
+impl SslContext {
+    /// Creates a new builder object for an `SslContext`.
+    pub fn builder(method: SslMethod) -> Result<SslContextBuilder, ErrorStack> {
+        SslContextBuilder::new(method)
+    }
+
+    /// Returns a new extra data index.
+    ///
+    /// Each invocation of this function is guaranteed to return a distinct index. These can be used
+    /// to store data in the context that can be retrieved later by callbacks, for example.
+    #[corresponds(SSL_CTX_get_ex_new_index)]
+    pub fn new_ex_index<T>() -> Result<Index<SslContext, T>, ErrorStack>
+    where
+        T: 'static + Sync + Send,
+    {
+        unsafe {
+            ffi::init();
+            #[cfg(boringssl)]
+            let idx = cvt_n(get_new_idx(Some(free_data_box::<T>)))?;
+            #[cfg(not(boringssl))]
+            let idx = cvt_n(get_new_idx(free_data_box::<T>))?;
+            Ok(Index::from_raw(idx))
+        }
+    }
+
+    // FIXME should return a result?
+    fn cached_ex_index<T>() -> Index<SslContext, T>
+    where
+        T: 'static + Sync + Send,
+    {
+        unsafe {
+            let idx = *INDEXES
+                .lock()
+                .unwrap_or_else(|e| e.into_inner())
+                .entry(TypeId::of::<T>())
+                .or_insert_with(|| SslContext::new_ex_index::<T>().unwrap().as_raw());
+            Index::from_raw(idx)
+        }
+    }
+}
+
+impl SslContextRef {
+    /// Returns the certificate associated with this `SslContext`, if present.
+    ///
+    /// Requires OpenSSL 1.0.2 or LibreSSL 2.7.0 or newer.
+    #[corresponds(SSL_CTX_get0_certificate)]
+    #[cfg(any(ossl102, libressl270))]
+    pub fn certificate(&self) -> Option<&X509Ref> {
+        unsafe {
+            let ptr = ffi::SSL_CTX_get0_certificate(self.as_ptr());
+            X509Ref::from_const_ptr_opt(ptr)
+        }
+    }
+
+    /// Returns the private key associated with this `SslContext`, if present.
+    ///
+    /// Requires OpenSSL 1.0.2 or LibreSSL 3.4.0 or newer.
+    #[corresponds(SSL_CTX_get0_privatekey)]
+    #[cfg(any(ossl102, libressl340))]
+    pub fn private_key(&self) -> Option<&PKeyRef<Private>> {
+        unsafe {
+            let ptr = ffi::SSL_CTX_get0_privatekey(self.as_ptr());
+            PKeyRef::from_const_ptr_opt(ptr)
+        }
+    }
+
+    /// Returns a shared reference to the certificate store used for verification.
+    #[corresponds(SSL_CTX_get_cert_store)]
+    pub fn cert_store(&self) -> &X509StoreRef {
+        unsafe { X509StoreRef::from_ptr(ffi::SSL_CTX_get_cert_store(self.as_ptr())) }
+    }
+
+    /// Returns a shared reference to the stack of certificates making up the chain from the leaf.
+    #[corresponds(SSL_CTX_get_extra_chain_certs)]
+    pub fn extra_chain_certs(&self) -> &StackRef<X509> {
+        unsafe {
+            let mut chain = ptr::null_mut();
+            ffi::SSL_CTX_get_extra_chain_certs(self.as_ptr(), &mut chain);
+            StackRef::from_const_ptr_opt(chain).expect("extra chain certs must not be null")
+        }
+    }
+
+    /// Returns a reference to the extra data at the specified index.
+    #[corresponds(SSL_CTX_get_ex_data)]
+    pub fn ex_data<T>(&self, index: Index<SslContext, T>) -> Option<&T> {
+        unsafe {
+            let data = ffi::SSL_CTX_get_ex_data(self.as_ptr(), index.as_raw());
+            if data.is_null() {
+                None
+            } else {
+                Some(&*(data as *const T))
+            }
+        }
+    }
+
+    /// Gets the maximum amount of early data that will be accepted on incoming connections.
+    ///
+    /// Requires OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
+    #[corresponds(SSL_CTX_get_max_early_data)]
+    #[cfg(any(ossl111, libressl340))]
+    pub fn max_early_data(&self) -> u32 {
+        unsafe { ffi::SSL_CTX_get_max_early_data(self.as_ptr()) }
+    }
+
+    /// Adds a session to the context's cache.
+    ///
+    /// Returns `true` if the session was successfully added to the cache, and `false` if it was already present.
+    ///
+    /// # Safety
+    ///
+    /// The caller of this method is responsible for ensuring that the session has never been used with another
+    /// `SslContext` than this one.
+    #[corresponds(SSL_CTX_add_session)]
+    pub unsafe fn add_session(&self, session: &SslSessionRef) -> bool {
+        ffi::SSL_CTX_add_session(self.as_ptr(), session.as_ptr()) != 0
+    }
+
+    /// Removes a session from the context's cache and marks it as non-resumable.
+    ///
+    /// Returns `true` if the session was successfully found and removed, and `false` otherwise.
+    ///
+    /// # Safety
+    ///
+    /// The caller of this method is responsible for ensuring that the session has never been used with another
+    /// `SslContext` than this one.
+    #[corresponds(SSL_CTX_remove_session)]
+    pub unsafe fn remove_session(&self, session: &SslSessionRef) -> bool {
+        ffi::SSL_CTX_remove_session(self.as_ptr(), session.as_ptr()) != 0
+    }
+
+    /// Returns the context's session cache size limit.
+    ///
+    /// A value of 0 means that the cache size is unbounded.
+    #[corresponds(SSL_CTX_sess_get_cache_size)]
+    #[allow(clippy::unnecessary_cast)]
+    pub fn session_cache_size(&self) -> i64 {
+        unsafe { ffi::SSL_CTX_sess_get_cache_size(self.as_ptr()) as i64 }
+    }
+
+    /// Returns the verify mode that was set on this context from [`SslContextBuilder::set_verify`].
+    ///
+    /// [`SslContextBuilder::set_verify`]: struct.SslContextBuilder.html#method.set_verify
+    #[corresponds(SSL_CTX_get_verify_mode)]
+    pub fn verify_mode(&self) -> SslVerifyMode {
+        let mode = unsafe { ffi::SSL_CTX_get_verify_mode(self.as_ptr()) };
+        SslVerifyMode::from_bits(mode).expect("SSL_CTX_get_verify_mode returned invalid mode")
+    }
+
+    /// Gets the number of TLS 1.3 session tickets that will be sent to a client after a full
+    /// handshake.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(SSL_CTX_get_num_tickets)]
+    #[cfg(ossl111)]
+    pub fn num_tickets(&self) -> usize {
+        unsafe { ffi::SSL_CTX_get_num_tickets(self.as_ptr()) }
+    }
+
+    /// Get the context's security level, which controls the allowed parameters
+    /// and algorithms.
+    ///
+    /// Requires OpenSSL 1.1.0 or newer.
+    #[corresponds(SSL_CTX_get_security_level)]
+    #[cfg(any(ossl110, libressl360))]
+    pub fn security_level(&self) -> u32 {
+        unsafe { ffi::SSL_CTX_get_security_level(self.as_ptr()) as u32 }
+    }
+}
+
+/// Information about the state of a cipher.
+pub struct CipherBits {
+    /// The number of secret bits used for the cipher.
+    pub secret: i32,
+
+    /// The number of bits processed by the chosen algorithm.
+    pub algorithm: i32,
+}
+
+/// Information about a cipher.
+pub struct SslCipher(*mut ffi::SSL_CIPHER);
+
+impl ForeignType for SslCipher {
+    type CType = ffi::SSL_CIPHER;
+    type Ref = SslCipherRef;
+
+    #[inline]
+    unsafe fn from_ptr(ptr: *mut ffi::SSL_CIPHER) -> SslCipher {
+        SslCipher(ptr)
+    }
+
+    #[inline]
+    fn as_ptr(&self) -> *mut ffi::SSL_CIPHER {
+        self.0
+    }
+}
+
+impl Stackable for SslCipher {
+    type StackType = ffi::stack_st_SSL_CIPHER;
+}
+
+impl Deref for SslCipher {
+    type Target = SslCipherRef;
+
+    fn deref(&self) -> &SslCipherRef {
+        unsafe { SslCipherRef::from_ptr(self.0) }
+    }
+}
+
+impl DerefMut for SslCipher {
+    fn deref_mut(&mut self) -> &mut SslCipherRef {
+        unsafe { SslCipherRef::from_ptr_mut(self.0) }
+    }
+}
+
+/// Reference to an [`SslCipher`].
+///
+/// [`SslCipher`]: struct.SslCipher.html
+pub struct SslCipherRef(Opaque);
+
+impl ForeignTypeRef for SslCipherRef {
+    type CType = ffi::SSL_CIPHER;
+}
+
+impl SslCipherRef {
+    /// Returns the name of the cipher.
+    #[corresponds(SSL_CIPHER_get_name)]
+    pub fn name(&self) -> &'static str {
+        unsafe {
+            let ptr = ffi::SSL_CIPHER_get_name(self.as_ptr());
+            CStr::from_ptr(ptr).to_str().unwrap()
+        }
+    }
+
+    /// Returns the RFC-standard name of the cipher, if one exists.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(SSL_CIPHER_standard_name)]
+    #[cfg(ossl111)]
+    pub fn standard_name(&self) -> Option<&'static str> {
+        unsafe {
+            let ptr = ffi::SSL_CIPHER_standard_name(self.as_ptr());
+            if ptr.is_null() {
+                None
+            } else {
+                Some(CStr::from_ptr(ptr).to_str().unwrap())
+            }
+        }
+    }
+
+    /// Returns the SSL/TLS protocol version that first defined the cipher.
+    #[corresponds(SSL_CIPHER_get_version)]
+    pub fn version(&self) -> &'static str {
+        let version = unsafe {
+            let ptr = ffi::SSL_CIPHER_get_version(self.as_ptr());
+            CStr::from_ptr(ptr as *const _)
+        };
+
+        str::from_utf8(version.to_bytes()).unwrap()
+    }
+
+    /// Returns the number of bits used for the cipher.
+    #[corresponds(SSL_CIPHER_get_bits)]
+    #[allow(clippy::useless_conversion)]
+    pub fn bits(&self) -> CipherBits {
+        unsafe {
+            let mut algo_bits = 0;
+            let secret_bits = ffi::SSL_CIPHER_get_bits(self.as_ptr(), &mut algo_bits);
+            CipherBits {
+                secret: secret_bits.into(),
+                algorithm: algo_bits.into(),
+            }
+        }
+    }
+
+    /// Returns a textual description of the cipher.
+    #[corresponds(SSL_CIPHER_description)]
+    pub fn description(&self) -> String {
+        unsafe {
+            // SSL_CIPHER_description requires a buffer of at least 128 bytes.
+            let mut buf = [0; 128];
+            let ptr = ffi::SSL_CIPHER_description(self.as_ptr(), buf.as_mut_ptr(), 128);
+            String::from_utf8(CStr::from_ptr(ptr as *const _).to_bytes().to_vec()).unwrap()
+        }
+    }
+
+    /// Returns the handshake digest of the cipher.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(SSL_CIPHER_get_handshake_digest)]
+    #[cfg(ossl111)]
+    pub fn handshake_digest(&self) -> Option<MessageDigest> {
+        unsafe {
+            let ptr = ffi::SSL_CIPHER_get_handshake_digest(self.as_ptr());
+            if ptr.is_null() {
+                None
+            } else {
+                Some(MessageDigest::from_ptr(ptr))
+            }
+        }
+    }
+
+    /// Returns the NID corresponding to the cipher.
+    ///
+    /// Requires OpenSSL 1.1.0 or LibreSSL 2.7.0 or newer.
+    #[corresponds(SSL_CIPHER_get_cipher_nid)]
+    #[cfg(any(ossl110, libressl270))]
+    pub fn cipher_nid(&self) -> Option<Nid> {
+        let n = unsafe { ffi::SSL_CIPHER_get_cipher_nid(self.as_ptr()) };
+        if n == 0 {
+            None
+        } else {
+            Some(Nid::from_raw(n))
+        }
+    }
+}
+
+impl fmt::Debug for SslCipherRef {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
+        write!(fmt, "{}", self.name())
+    }
+}
+
+/// A stack of selected ciphers, and a stack of selected signalling cipher suites
+#[derive(Debug)]
+pub struct CipherLists {
+    pub suites: Stack<SslCipher>,
+    pub signalling_suites: Stack<SslCipher>,
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::SSL_SESSION;
+    fn drop = ffi::SSL_SESSION_free;
+
+    /// An encoded SSL session.
+    ///
+    /// These can be cached to share sessions across connections.
+    pub struct SslSession;
+
+    /// Reference to [`SslSession`].
+    ///
+    /// [`SslSession`]: struct.SslSession.html
+    pub struct SslSessionRef;
+}
+
+impl Clone for SslSession {
+    fn clone(&self) -> SslSession {
+        SslSessionRef::to_owned(self)
+    }
+}
+
+impl SslSession {
+    from_der! {
+        /// Deserializes a DER-encoded session structure.
+        #[corresponds(d2i_SSL_SESSION)]
+        from_der,
+        SslSession,
+        ffi::d2i_SSL_SESSION
+    }
+}
+
+impl ToOwned for SslSessionRef {
+    type Owned = SslSession;
+
+    fn to_owned(&self) -> SslSession {
+        unsafe {
+            SSL_SESSION_up_ref(self.as_ptr());
+            SslSession(self.as_ptr())
+        }
+    }
+}
+
+impl SslSessionRef {
+    /// Returns the SSL session ID.
+    #[corresponds(SSL_SESSION_get_id)]
+    pub fn id(&self) -> &[u8] {
+        unsafe {
+            let mut len = 0;
+            let p = ffi::SSL_SESSION_get_id(self.as_ptr(), &mut len);
+            #[allow(clippy::unnecessary_cast)]
+            slice::from_raw_parts(p as *const u8, len as usize)
+        }
+    }
+
+    /// Returns the length of the master key.
+    #[corresponds(SSL_SESSION_get_master_key)]
+    pub fn master_key_len(&self) -> usize {
+        unsafe { SSL_SESSION_get_master_key(self.as_ptr(), ptr::null_mut(), 0) }
+    }
+
+    /// Copies the master key into the provided buffer.
+    ///
+    /// Returns the number of bytes written, or the size of the master key if the buffer is empty.
+    #[corresponds(SSL_SESSION_get_master_key)]
+    pub fn master_key(&self, buf: &mut [u8]) -> usize {
+        unsafe { SSL_SESSION_get_master_key(self.as_ptr(), buf.as_mut_ptr(), buf.len()) }
+    }
+
+    /// Gets the maximum amount of early data that can be sent on this session.
+    ///
+    /// Requires OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
+    #[corresponds(SSL_SESSION_get_max_early_data)]
+    #[cfg(any(ossl111, libressl340))]
+    pub fn max_early_data(&self) -> u32 {
+        unsafe { ffi::SSL_SESSION_get_max_early_data(self.as_ptr()) }
+    }
+
+    /// Returns the time at which the session was established, in seconds since the Unix epoch.
+    #[corresponds(SSL_SESSION_get_time)]
+    #[allow(clippy::useless_conversion)]
+    pub fn time(&self) -> SslTimeTy {
+        unsafe { ffi::SSL_SESSION_get_time(self.as_ptr()) }
+    }
+
+    /// Returns the sessions timeout, in seconds.
+    ///
+    /// A session older than this time should not be used for session resumption.
+    #[corresponds(SSL_SESSION_get_timeout)]
+    #[allow(clippy::useless_conversion)]
+    pub fn timeout(&self) -> i64 {
+        unsafe { ffi::SSL_SESSION_get_timeout(self.as_ptr()).into() }
+    }
+
+    /// Returns the session's TLS protocol version.
+    ///
+    /// Requires OpenSSL 1.1.0 or LibreSSL 2.7.0 or newer.
+    #[corresponds(SSL_SESSION_get_protocol_version)]
+    #[cfg(any(ossl110, libressl270))]
+    pub fn protocol_version(&self) -> SslVersion {
+        unsafe {
+            let version = ffi::SSL_SESSION_get_protocol_version(self.as_ptr());
+            SslVersion(version)
+        }
+    }
+
+    to_der! {
+        /// Serializes the session into a DER-encoded structure.
+        #[corresponds(i2d_SSL_SESSION)]
+        to_der,
+        ffi::i2d_SSL_SESSION
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::SSL;
+    fn drop = ffi::SSL_free;
+
+    /// The state of an SSL/TLS session.
+    ///
+    /// `Ssl` objects are created from an [`SslContext`], which provides configuration defaults.
+    /// These defaults can be overridden on a per-`Ssl` basis, however.
+    ///
+    /// [`SslContext`]: struct.SslContext.html
+    pub struct Ssl;
+
+    /// Reference to an [`Ssl`].
+    ///
+    /// [`Ssl`]: struct.Ssl.html
+    pub struct SslRef;
+}
+
+impl fmt::Debug for Ssl {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
+        fmt::Debug::fmt(&**self, fmt)
+    }
+}
+
+impl Ssl {
+    /// Returns a new extra data index.
+    ///
+    /// Each invocation of this function is guaranteed to return a distinct index. These can be used
+    /// to store data in the context that can be retrieved later by callbacks, for example.
+    #[corresponds(SSL_get_ex_new_index)]
+    pub fn new_ex_index<T>() -> Result<Index<Ssl, T>, ErrorStack>
+    where
+        T: 'static + Sync + Send,
+    {
+        unsafe {
+            ffi::init();
+            #[cfg(boringssl)]
+            let idx = cvt_n(get_new_ssl_idx(Some(free_data_box::<T>)))?;
+            #[cfg(not(boringssl))]
+            let idx = cvt_n(get_new_ssl_idx(free_data_box::<T>))?;
+            Ok(Index::from_raw(idx))
+        }
+    }
+
+    // FIXME should return a result?
+    fn cached_ex_index<T>() -> Index<Ssl, T>
+    where
+        T: 'static + Sync + Send,
+    {
+        unsafe {
+            let idx = *SSL_INDEXES
+                .lock()
+                .unwrap_or_else(|e| e.into_inner())
+                .entry(TypeId::of::<T>())
+                .or_insert_with(|| Ssl::new_ex_index::<T>().unwrap().as_raw());
+            Index::from_raw(idx)
+        }
+    }
+
+    /// Creates a new `Ssl`.
+    ///
+    /// This corresponds to [`SSL_new`].
+    ///
+    /// [`SSL_new`]: https://www.openssl.org/docs/manmaster/ssl/SSL_new.html
+    #[corresponds(SSL_new)]
+    pub fn new(ctx: &SslContextRef) -> Result<Ssl, ErrorStack> {
+        let session_ctx_index = try_get_session_ctx_index()?;
+        unsafe {
+            let ptr = cvt_p(ffi::SSL_new(ctx.as_ptr()))?;
+            let mut ssl = Ssl::from_ptr(ptr);
+            ssl.set_ex_data(*session_ctx_index, ctx.to_owned());
+
+            Ok(ssl)
+        }
+    }
+
+    /// Initiates a client-side TLS handshake.
+    ///
+    /// This corresponds to [`SSL_connect`].
+    ///
+    /// # Warning
+    ///
+    /// OpenSSL's default configuration is insecure. It is highly recommended to use
+    /// `SslConnector` rather than `Ssl` directly, as it manages that configuration.
+    ///
+    /// [`SSL_connect`]: https://www.openssl.org/docs/manmaster/man3/SSL_connect.html
+    #[corresponds(SSL_connect)]
+    #[allow(deprecated)]
+    pub fn connect<S>(self, stream: S) -> Result<SslStream<S>, HandshakeError<S>>
+    where
+        S: Read + Write,
+    {
+        SslStreamBuilder::new(self, stream).connect()
+    }
+
+    /// Initiates a server-side TLS handshake.
+    ///
+    /// This corresponds to [`SSL_accept`].
+    ///
+    /// # Warning
+    ///
+    /// OpenSSL's default configuration is insecure. It is highly recommended to use
+    /// `SslAcceptor` rather than `Ssl` directly, as it manages that configuration.
+    ///
+    /// [`SSL_accept`]: https://www.openssl.org/docs/manmaster/man3/SSL_accept.html
+    #[corresponds(SSL_accept)]
+    #[allow(deprecated)]
+    pub fn accept<S>(self, stream: S) -> Result<SslStream<S>, HandshakeError<S>>
+    where
+        S: Read + Write,
+    {
+        SslStreamBuilder::new(self, stream).accept()
+    }
+}
+
+impl fmt::Debug for SslRef {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
+        fmt.debug_struct("Ssl")
+            .field("state", &self.state_string_long())
+            .field("verify_result", &self.verify_result())
+            .finish()
+    }
+}
+
+impl SslRef {
+    fn get_raw_rbio(&self) -> *mut ffi::BIO {
+        unsafe { ffi::SSL_get_rbio(self.as_ptr()) }
+    }
+
+    fn get_error(&self, ret: c_int) -> ErrorCode {
+        unsafe { ErrorCode::from_raw(ffi::SSL_get_error(self.as_ptr(), ret)) }
+    }
+
+    /// Configure as an outgoing stream from a client.
+    #[corresponds(SSL_set_connect_state)]
+    pub fn set_connect_state(&mut self) {
+        unsafe { ffi::SSL_set_connect_state(self.as_ptr()) }
+    }
+
+    /// Configure as an incoming stream to a server.
+    #[corresponds(SSL_set_accept_state)]
+    pub fn set_accept_state(&mut self) {
+        unsafe { ffi::SSL_set_accept_state(self.as_ptr()) }
+    }
+
+    /// Like [`SslContextBuilder::set_verify`].
+    ///
+    /// [`SslContextBuilder::set_verify`]: struct.SslContextBuilder.html#method.set_verify
+    #[corresponds(SSL_set_verify)]
+    pub fn set_verify(&mut self, mode: SslVerifyMode) {
+        unsafe { ffi::SSL_set_verify(self.as_ptr(), mode.bits() as c_int, None) }
+    }
+
+    /// Returns the verify mode that was set using `set_verify`.
+    #[corresponds(SSL_set_verify_mode)]
+    pub fn verify_mode(&self) -> SslVerifyMode {
+        let mode = unsafe { ffi::SSL_get_verify_mode(self.as_ptr()) };
+        SslVerifyMode::from_bits(mode).expect("SSL_get_verify_mode returned invalid mode")
+    }
+
+    /// Like [`SslContextBuilder::set_verify_callback`].
+    ///
+    /// [`SslContextBuilder::set_verify_callback`]: struct.SslContextBuilder.html#method.set_verify_callback
+    #[corresponds(SSL_set_verify)]
+    pub fn set_verify_callback<F>(&mut self, mode: SslVerifyMode, verify: F)
+    where
+        F: Fn(bool, &mut X509StoreContextRef) -> bool + 'static + Sync + Send,
+    {
+        unsafe {
+            // this needs to be in an Arc since the callback can register a new callback!
+            self.set_ex_data(Ssl::cached_ex_index(), Arc::new(verify));
+            ffi::SSL_set_verify(
+                self.as_ptr(),
+                mode.bits() as c_int,
+                Some(ssl_raw_verify::<F>),
+            );
+        }
+    }
+
+    /// Like [`SslContextBuilder::set_tmp_dh`].
+    ///
+    /// [`SslContextBuilder::set_tmp_dh`]: struct.SslContextBuilder.html#method.set_tmp_dh
+    #[corresponds(SSL_set_tmp_dh)]
+    pub fn set_tmp_dh(&mut self, dh: &DhRef<Params>) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::SSL_set_tmp_dh(self.as_ptr(), dh.as_ptr()) as c_int).map(|_| ()) }
+    }
+
+    /// Like [`SslContextBuilder::set_tmp_dh_callback`].
+    ///
+    /// [`SslContextBuilder::set_tmp_dh_callback`]: struct.SslContextBuilder.html#method.set_tmp_dh_callback
+    #[corresponds(SSL_set_tmp_dh_callback)]
+    pub fn set_tmp_dh_callback<F>(&mut self, callback: F)
+    where
+        F: Fn(&mut SslRef, bool, u32) -> Result<Dh<Params>, ErrorStack> + 'static + Sync + Send,
+    {
+        unsafe {
+            // this needs to be in an Arc since the callback can register a new callback!
+            self.set_ex_data(Ssl::cached_ex_index(), Arc::new(callback));
+            #[cfg(boringssl)]
+            ffi::SSL_set_tmp_dh_callback(self.as_ptr(), Some(raw_tmp_dh_ssl::<F>));
+            #[cfg(not(boringssl))]
+            ffi::SSL_set_tmp_dh_callback__fixed_rust(self.as_ptr(), Some(raw_tmp_dh_ssl::<F>));
+        }
+    }
+
+    /// Like [`SslContextBuilder::set_tmp_ecdh`].
+    ///
+    /// [`SslContextBuilder::set_tmp_ecdh`]: struct.SslContextBuilder.html#method.set_tmp_ecdh
+    #[corresponds(SSL_set_tmp_ecdh)]
+    pub fn set_tmp_ecdh(&mut self, key: &EcKeyRef<Params>) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::SSL_set_tmp_ecdh(self.as_ptr(), key.as_ptr()) as c_int).map(|_| ()) }
+    }
+
+    /// Like [`SslContextBuilder::set_tmp_ecdh_callback`].
+    ///
+    /// Requires OpenSSL 1.0.1 or 1.0.2.
+    #[corresponds(SSL_set_tmp_ecdh_callback)]
+    #[cfg(all(ossl101, not(ossl110)))]
+    #[deprecated(note = "this function leaks memory and does not exist on newer OpenSSL versions")]
+    pub fn set_tmp_ecdh_callback<F>(&mut self, callback: F)
+    where
+        F: Fn(&mut SslRef, bool, u32) -> Result<EcKey<Params>, ErrorStack> + 'static + Sync + Send,
+    {
+        unsafe {
+            // this needs to be in an Arc since the callback can register a new callback!
+            self.set_ex_data(Ssl::cached_ex_index(), Arc::new(callback));
+            ffi::SSL_set_tmp_ecdh_callback__fixed_rust(self.as_ptr(), Some(raw_tmp_ecdh_ssl::<F>));
+        }
+    }
+
+    /// Like [`SslContextBuilder::set_ecdh_auto`].
+    ///
+    /// Requires OpenSSL 1.0.2 or LibreSSL.
+    ///
+    /// [`SslContextBuilder::set_tmp_ecdh`]: struct.SslContextBuilder.html#method.set_tmp_ecdh
+    #[corresponds(SSL_set_ecdh_auto)]
+    #[cfg(any(all(ossl102, not(ossl110)), libressl))]
+    pub fn set_ecdh_auto(&mut self, onoff: bool) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::SSL_set_ecdh_auto(self.as_ptr(), onoff as c_int)).map(|_| ()) }
+    }
+
+    /// Like [`SslContextBuilder::set_alpn_protos`].
+    ///
+    /// Requires BoringSSL or OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer.
+    ///
+    /// [`SslContextBuilder::set_alpn_protos`]: struct.SslContextBuilder.html#method.set_alpn_protos
+    #[corresponds(SSL_set_alpn_protos)]
+    #[cfg(any(ossl102, libressl261, boringssl))]
+    pub fn set_alpn_protos(&mut self, protocols: &[u8]) -> Result<(), ErrorStack> {
+        unsafe {
+            assert!(protocols.len() <= c_uint::MAX as usize);
+            let r =
+                ffi::SSL_set_alpn_protos(self.as_ptr(), protocols.as_ptr(), protocols.len() as _);
+            // fun fact, SSL_set_alpn_protos has a reversed return code D:
+            if r == 0 {
+                Ok(())
+            } else {
+                Err(ErrorStack::get())
+            }
+        }
+    }
+
+    /// Returns the current cipher if the session is active.
+    #[corresponds(SSL_get_current_cipher)]
+    pub fn current_cipher(&self) -> Option<&SslCipherRef> {
+        unsafe {
+            let ptr = ffi::SSL_get_current_cipher(self.as_ptr());
+
+            SslCipherRef::from_const_ptr_opt(ptr)
+        }
+    }
+
+    /// Returns a short string describing the state of the session.
+    #[corresponds(SSL_state_string)]
+    pub fn state_string(&self) -> &'static str {
+        let state = unsafe {
+            let ptr = ffi::SSL_state_string(self.as_ptr());
+            CStr::from_ptr(ptr as *const _)
+        };
+
+        str::from_utf8(state.to_bytes()).unwrap()
+    }
+
+    /// Returns a longer string describing the state of the session.
+    #[corresponds(SSL_state_string_long)]
+    pub fn state_string_long(&self) -> &'static str {
+        let state = unsafe {
+            let ptr = ffi::SSL_state_string_long(self.as_ptr());
+            CStr::from_ptr(ptr as *const _)
+        };
+
+        str::from_utf8(state.to_bytes()).unwrap()
+    }
+
+    /// Sets the host name to be sent to the server for Server Name Indication (SNI).
+    ///
+    /// It has no effect for a server-side connection.
+    #[corresponds(SSL_set_tlsext_host_name)]
+    pub fn set_hostname(&mut self, hostname: &str) -> Result<(), ErrorStack> {
+        let cstr = CString::new(hostname).unwrap();
+        unsafe {
+            cvt(ffi::SSL_set_tlsext_host_name(self.as_ptr(), cstr.as_ptr() as *mut _) as c_int)
+                .map(|_| ())
+        }
+    }
+
+    /// Returns the peer's certificate, if present.
+    #[corresponds(SSL_get_peer_certificate)]
+    pub fn peer_certificate(&self) -> Option<X509> {
+        unsafe {
+            let ptr = SSL_get1_peer_certificate(self.as_ptr());
+            X509::from_ptr_opt(ptr)
+        }
+    }
+
+    /// Returns the certificate chain of the peer, if present.
+    ///
+    /// On the client side, the chain includes the leaf certificate, but on the server side it does
+    /// not. Fun!
+    #[corresponds(SSL_get_peer_cert_chain)]
+    pub fn peer_cert_chain(&self) -> Option<&StackRef<X509>> {
+        unsafe {
+            let ptr = ffi::SSL_get_peer_cert_chain(self.as_ptr());
+            StackRef::from_const_ptr_opt(ptr)
+        }
+    }
+
+    /// Returns the verified certificate chain of the peer, including the leaf certificate.
+    ///
+    /// If verification was not successful (i.e. [`verify_result`] does not return
+    /// [`X509VerifyResult::OK`]), this chain may be incomplete or invalid.
+    ///
+    /// Requires OpenSSL 1.1.0 or newer.
+    ///
+    /// [`verify_result`]: #method.verify_result
+    /// [`X509VerifyResult::OK`]: ../x509/struct.X509VerifyResult.html#associatedconstant.OK
+    #[corresponds(SSL_get0_verified_chain)]
+    #[cfg(ossl110)]
+    pub fn verified_chain(&self) -> Option<&StackRef<X509>> {
+        unsafe {
+            let ptr = ffi::SSL_get0_verified_chain(self.as_ptr());
+            StackRef::from_const_ptr_opt(ptr)
+        }
+    }
+
+    /// Like [`SslContext::certificate`].
+    #[corresponds(SSL_get_certificate)]
+    pub fn certificate(&self) -> Option<&X509Ref> {
+        unsafe {
+            let ptr = ffi::SSL_get_certificate(self.as_ptr());
+            X509Ref::from_const_ptr_opt(ptr)
+        }
+    }
+
+    /// Like [`SslContext::private_key`].
+    ///
+    /// [`SslContext::private_key`]: struct.SslContext.html#method.private_key
+    #[corresponds(SSL_get_privatekey)]
+    pub fn private_key(&self) -> Option<&PKeyRef<Private>> {
+        unsafe {
+            let ptr = ffi::SSL_get_privatekey(self.as_ptr());
+            PKeyRef::from_const_ptr_opt(ptr)
+        }
+    }
+
+    #[deprecated(since = "0.10.5", note = "renamed to `version_str`")]
+    pub fn version(&self) -> &str {
+        self.version_str()
+    }
+
+    /// Returns the protocol version of the session.
+    #[corresponds(SSL_version)]
+    pub fn version2(&self) -> Option<SslVersion> {
+        unsafe {
+            let r = ffi::SSL_version(self.as_ptr());
+            if r == 0 {
+                None
+            } else {
+                Some(SslVersion(r))
+            }
+        }
+    }
+
+    /// Returns a string describing the protocol version of the session.
+    #[corresponds(SSL_get_version)]
+    pub fn version_str(&self) -> &'static str {
+        let version = unsafe {
+            let ptr = ffi::SSL_get_version(self.as_ptr());
+            CStr::from_ptr(ptr as *const _)
+        };
+
+        str::from_utf8(version.to_bytes()).unwrap()
+    }
+
+    /// Returns the protocol selected via Application Layer Protocol Negotiation (ALPN).
+    ///
+    /// The protocol's name is returned is an opaque sequence of bytes. It is up to the client
+    /// to interpret it.
+    ///
+    /// Requires BoringSSL or OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer.
+    #[corresponds(SSL_get0_alpn_selected)]
+    #[cfg(any(ossl102, libressl261, boringssl))]
+    pub fn selected_alpn_protocol(&self) -> Option<&[u8]> {
+        unsafe {
+            let mut data: *const c_uchar = ptr::null();
+            let mut len: c_uint = 0;
+            // Get the negotiated protocol from the SSL instance.
+            // `data` will point at a `c_uchar` array; `len` will contain the length of this array.
+            ffi::SSL_get0_alpn_selected(self.as_ptr(), &mut data, &mut len);
+
+            if data.is_null() {
+                None
+            } else {
+                Some(slice::from_raw_parts(data, len as usize))
+            }
+        }
+    }
+
+    /// Enables the DTLS extension "use_srtp" as defined in RFC5764.
+    ///
+    /// This corresponds to [`SSL_set_tlsext_use_srtp`].
+    ///
+    /// [`SSL_set_tlsext_use_srtp`]: https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_tlsext_use_srtp.html
+    #[corresponds(SSL_set_tlsext_use_srtp)]
+    pub fn set_tlsext_use_srtp(&mut self, protocols: &str) -> Result<(), ErrorStack> {
+        unsafe {
+            let cstr = CString::new(protocols).unwrap();
+
+            let r = ffi::SSL_set_tlsext_use_srtp(self.as_ptr(), cstr.as_ptr());
+            // fun fact, set_tlsext_use_srtp has a reversed return code D:
+            if r == 0 {
+                Ok(())
+            } else {
+                Err(ErrorStack::get())
+            }
+        }
+    }
+
+    /// Gets all SRTP profiles that are enabled for handshake via set_tlsext_use_srtp
+    ///
+    /// DTLS extension "use_srtp" as defined in RFC5764 has to be enabled.
+    ///
+    /// This corresponds to [`SSL_get_srtp_profiles`].
+    ///
+    /// [`SSL_get_srtp_profiles`]: https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_tlsext_use_srtp.html
+    #[corresponds(SSL_get_srtp_profiles)]
+    pub fn srtp_profiles(&self) -> Option<&StackRef<SrtpProtectionProfile>> {
+        unsafe {
+            let chain = ffi::SSL_get_srtp_profiles(self.as_ptr());
+
+            StackRef::from_const_ptr_opt(chain)
+        }
+    }
+
+    /// Gets the SRTP profile selected by handshake.
+    ///
+    /// DTLS extension "use_srtp" as defined in RFC5764 has to be enabled.
+    #[corresponds(SSL_get_selected_srtp_profile)]
+    pub fn selected_srtp_profile(&self) -> Option<&SrtpProtectionProfileRef> {
+        unsafe {
+            let profile = ffi::SSL_get_selected_srtp_profile(self.as_ptr());
+
+            SrtpProtectionProfileRef::from_const_ptr_opt(profile)
+        }
+    }
+
+    /// Returns the number of bytes remaining in the currently processed TLS record.
+    ///
+    /// If this is greater than 0, the next call to `read` will not call down to the underlying
+    /// stream.
+    #[corresponds(SSL_pending)]
+    pub fn pending(&self) -> usize {
+        unsafe { ffi::SSL_pending(self.as_ptr()) as usize }
+    }
+
+    /// Returns the servername sent by the client via Server Name Indication (SNI).
+    ///
+    /// It is only useful on the server side.
+    ///
+    /// # Note
+    ///
+    /// While the SNI specification requires that servernames be valid domain names (and therefore
+    /// ASCII), OpenSSL does not enforce this restriction. If the servername provided by the client
+    /// is not valid UTF-8, this function will return `None`. The `servername_raw` method returns
+    /// the raw bytes and does not have this restriction.
+    ///
+    /// [`SSL_get_servername`]: https://www.openssl.org/docs/manmaster/man3/SSL_get_servername.html
+    #[corresponds(SSL_get_servername)]
+    // FIXME maybe rethink in 0.11?
+    pub fn servername(&self, type_: NameType) -> Option<&str> {
+        self.servername_raw(type_)
+            .and_then(|b| str::from_utf8(b).ok())
+    }
+
+    /// Returns the servername sent by the client via Server Name Indication (SNI).
+    ///
+    /// It is only useful on the server side.
+    ///
+    /// # Note
+    ///
+    /// Unlike `servername`, this method does not require the name be valid UTF-8.
+    #[corresponds(SSL_get_servername)]
+    pub fn servername_raw(&self, type_: NameType) -> Option<&[u8]> {
+        unsafe {
+            let name = ffi::SSL_get_servername(self.as_ptr(), type_.0);
+            if name.is_null() {
+                None
+            } else {
+                Some(CStr::from_ptr(name as *const _).to_bytes())
+            }
+        }
+    }
+
+    /// Changes the context corresponding to the current connection.
+    ///
+    /// It is most commonly used in the Server Name Indication (SNI) callback.
+    #[corresponds(SSL_set_SSL_CTX)]
+    pub fn set_ssl_context(&mut self, ctx: &SslContextRef) -> Result<(), ErrorStack> {
+        unsafe { cvt_p(ffi::SSL_set_SSL_CTX(self.as_ptr(), ctx.as_ptr())).map(|_| ()) }
+    }
+
+    /// Returns the context corresponding to the current connection.
+    #[corresponds(SSL_get_SSL_CTX)]
+    pub fn ssl_context(&self) -> &SslContextRef {
+        unsafe {
+            let ssl_ctx = ffi::SSL_get_SSL_CTX(self.as_ptr());
+            SslContextRef::from_ptr(ssl_ctx)
+        }
+    }
+
+    /// Returns a mutable reference to the X509 verification configuration.
+    ///
+    /// Requires BoringSSL or OpenSSL 1.0.2 or newer.
+    #[corresponds(SSL_get0_param)]
+    #[cfg(any(ossl102, boringssl, libressl261))]
+    pub fn param_mut(&mut self) -> &mut X509VerifyParamRef {
+        unsafe { X509VerifyParamRef::from_ptr_mut(ffi::SSL_get0_param(self.as_ptr())) }
+    }
+
+    /// Returns the certificate verification result.
+    #[corresponds(SSL_get_verify_result)]
+    pub fn verify_result(&self) -> X509VerifyResult {
+        unsafe { X509VerifyResult::from_raw(ffi::SSL_get_verify_result(self.as_ptr()) as c_int) }
+    }
+
+    /// Returns a shared reference to the SSL session.
+    #[corresponds(SSL_get_session)]
+    pub fn session(&self) -> Option<&SslSessionRef> {
+        unsafe {
+            let p = ffi::SSL_get_session(self.as_ptr());
+            SslSessionRef::from_const_ptr_opt(p)
+        }
+    }
+
+    /// Copies the `client_random` value sent by the client in the TLS handshake into a buffer.
+    ///
+    /// Returns the number of bytes copied, or if the buffer is empty, the size of the `client_random`
+    /// value.
+    ///
+    /// Requires OpenSSL 1.1.0 or LibreSSL 2.7.0 or newer.
+    #[corresponds(SSL_get_client_random)]
+    #[cfg(any(ossl110, libressl270))]
+    pub fn client_random(&self, buf: &mut [u8]) -> usize {
+        unsafe {
+            ffi::SSL_get_client_random(self.as_ptr(), buf.as_mut_ptr() as *mut c_uchar, buf.len())
+        }
+    }
+
+    /// Copies the `server_random` value sent by the server in the TLS handshake into a buffer.
+    ///
+    /// Returns the number of bytes copied, or if the buffer is empty, the size of the `server_random`
+    /// value.
+    ///
+    /// Requires OpenSSL 1.1.0 or LibreSSL 2.7.0 or newer.
+    #[corresponds(SSL_get_server_random)]
+    #[cfg(any(ossl110, libressl270))]
+    pub fn server_random(&self, buf: &mut [u8]) -> usize {
+        unsafe {
+            ffi::SSL_get_server_random(self.as_ptr(), buf.as_mut_ptr() as *mut c_uchar, buf.len())
+        }
+    }
+
+    /// Derives keying material for application use in accordance to RFC 5705.
+    #[corresponds(SSL_export_keying_material)]
+    pub fn export_keying_material(
+        &self,
+        out: &mut [u8],
+        label: &str,
+        context: Option<&[u8]>,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            let (context, contextlen, use_context) = match context {
+                Some(context) => (context.as_ptr() as *const c_uchar, context.len(), 1),
+                None => (ptr::null(), 0, 0),
+            };
+            cvt(ffi::SSL_export_keying_material(
+                self.as_ptr(),
+                out.as_mut_ptr() as *mut c_uchar,
+                out.len(),
+                label.as_ptr() as *const c_char,
+                label.len(),
+                context,
+                contextlen,
+                use_context,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Derives keying material for application use in accordance to RFC 5705.
+    ///
+    /// This function is only usable with TLSv1.3, wherein there is no distinction between an empty context and no
+    /// context. Therefore, unlike `export_keying_material`, `context` must always be supplied.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(SSL_export_keying_material_early)]
+    #[cfg(ossl111)]
+    pub fn export_keying_material_early(
+        &self,
+        out: &mut [u8],
+        label: &str,
+        context: &[u8],
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::SSL_export_keying_material_early(
+                self.as_ptr(),
+                out.as_mut_ptr() as *mut c_uchar,
+                out.len(),
+                label.as_ptr() as *const c_char,
+                label.len(),
+                context.as_ptr() as *const c_uchar,
+                context.len(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the session to be used.
+    ///
+    /// This should be called before the handshake to attempt to reuse a previously established
+    /// session. If the server is not willing to reuse the session, a new one will be transparently
+    /// negotiated.
+    ///
+    /// # Safety
+    ///
+    /// The caller of this method is responsible for ensuring that the session is associated
+    /// with the same `SslContext` as this `Ssl`.
+    #[corresponds(SSL_set_session)]
+    pub unsafe fn set_session(&mut self, session: &SslSessionRef) -> Result<(), ErrorStack> {
+        cvt(ffi::SSL_set_session(self.as_ptr(), session.as_ptr())).map(|_| ())
+    }
+
+    /// Determines if the session provided to `set_session` was successfully reused.
+    #[corresponds(SSL_session_reused)]
+    pub fn session_reused(&self) -> bool {
+        unsafe { ffi::SSL_session_reused(self.as_ptr()) != 0 }
+    }
+
+    /// Sets the status response a client wishes the server to reply with.
+    #[corresponds(SSL_set_tlsext_status_type)]
+    pub fn set_status_type(&mut self, type_: StatusType) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::SSL_set_tlsext_status_type(self.as_ptr(), type_.as_raw()) as c_int).map(|_| ())
+        }
+    }
+
+    /// Determines if current session used Extended Master Secret
+    ///
+    /// Returns `None` if the handshake is still in-progress.
+    #[corresponds(SSL_get_extms_support)]
+    #[cfg(ossl110)]
+    pub fn extms_support(&self) -> Option<bool> {
+        unsafe {
+            match ffi::SSL_get_extms_support(self.as_ptr()) {
+                -1 => None,
+                ret => Some(ret != 0),
+            }
+        }
+    }
+
+    /// Returns the server's OCSP response, if present.
+    #[corresponds(SSL_get_tlsext_status_ocsp_resp)]
+    #[cfg(not(boringssl))]
+    pub fn ocsp_status(&self) -> Option<&[u8]> {
+        unsafe {
+            let mut p = ptr::null_mut();
+            let len = ffi::SSL_get_tlsext_status_ocsp_resp(self.as_ptr(), &mut p);
+
+            if len < 0 {
+                None
+            } else {
+                Some(slice::from_raw_parts(p as *const u8, len as usize))
+            }
+        }
+    }
+
+    /// Sets the OCSP response to be returned to the client.
+    #[corresponds(SSL_set_tlsext_status_oscp_resp)]
+    #[cfg(not(boringssl))]
+    pub fn set_ocsp_status(&mut self, response: &[u8]) -> Result<(), ErrorStack> {
+        unsafe {
+            assert!(response.len() <= c_int::MAX as usize);
+            let p = cvt_p(ffi::OPENSSL_malloc(response.len() as _))?;
+            ptr::copy_nonoverlapping(response.as_ptr(), p as *mut u8, response.len());
+            cvt(ffi::SSL_set_tlsext_status_ocsp_resp(
+                self.as_ptr(),
+                p as *mut c_uchar,
+                response.len() as c_long,
+            ) as c_int)
+            .map(|_| ())
+            .map_err(|e| {
+                ffi::OPENSSL_free(p);
+                e
+            })
+        }
+    }
+
+    /// Determines if this `Ssl` is configured for server-side or client-side use.
+    #[corresponds(SSL_is_server)]
+    pub fn is_server(&self) -> bool {
+        unsafe { SSL_is_server(self.as_ptr()) != 0 }
+    }
+
+    /// Sets the extra data at the specified index.
+    ///
+    /// This can be used to provide data to callbacks registered with the context. Use the
+    /// `Ssl::new_ex_index` method to create an `Index`.
+    // FIXME should return a result
+    #[corresponds(SSL_set_ex_data)]
+    pub fn set_ex_data<T>(&mut self, index: Index<Ssl, T>, data: T) {
+        match self.ex_data_mut(index) {
+            Some(v) => *v = data,
+            None => unsafe {
+                let data = Box::new(data);
+                ffi::SSL_set_ex_data(
+                    self.as_ptr(),
+                    index.as_raw(),
+                    Box::into_raw(data) as *mut c_void,
+                );
+            },
+        }
+    }
+
+    /// Returns a reference to the extra data at the specified index.
+    #[corresponds(SSL_get_ex_data)]
+    pub fn ex_data<T>(&self, index: Index<Ssl, T>) -> Option<&T> {
+        unsafe {
+            let data = ffi::SSL_get_ex_data(self.as_ptr(), index.as_raw());
+            if data.is_null() {
+                None
+            } else {
+                Some(&*(data as *const T))
+            }
+        }
+    }
+
+    /// Returns a mutable reference to the extra data at the specified index.
+    #[corresponds(SSL_get_ex_data)]
+    pub fn ex_data_mut<T>(&mut self, index: Index<Ssl, T>) -> Option<&mut T> {
+        unsafe {
+            let data = ffi::SSL_get_ex_data(self.as_ptr(), index.as_raw());
+            if data.is_null() {
+                None
+            } else {
+                Some(&mut *(data as *mut T))
+            }
+        }
+    }
+
+    /// Sets the maximum amount of early data that will be accepted on this connection.
+    ///
+    /// Requires OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
+    #[corresponds(SSL_set_max_early_data)]
+    #[cfg(any(ossl111, libressl340))]
+    pub fn set_max_early_data(&mut self, bytes: u32) -> Result<(), ErrorStack> {
+        if unsafe { ffi::SSL_set_max_early_data(self.as_ptr(), bytes) } == 1 {
+            Ok(())
+        } else {
+            Err(ErrorStack::get())
+        }
+    }
+
+    /// Gets the maximum amount of early data that can be sent on this connection.
+    ///
+    /// Requires OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
+    #[corresponds(SSL_get_max_early_data)]
+    #[cfg(any(ossl111, libressl340))]
+    pub fn max_early_data(&self) -> u32 {
+        unsafe { ffi::SSL_get_max_early_data(self.as_ptr()) }
+    }
+
+    /// Copies the contents of the last Finished message sent to the peer into the provided buffer.
+    ///
+    /// The total size of the message is returned, so this can be used to determine the size of the
+    /// buffer required.
+    #[corresponds(SSL_get_finished)]
+    pub fn finished(&self, buf: &mut [u8]) -> usize {
+        unsafe { ffi::SSL_get_finished(self.as_ptr(), buf.as_mut_ptr() as *mut c_void, buf.len()) }
+    }
+
+    /// Copies the contents of the last Finished message received from the peer into the provided
+    /// buffer.
+    ///
+    /// The total size of the message is returned, so this can be used to determine the size of the
+    /// buffer required.
+    #[corresponds(SSL_get_peer_finished)]
+    pub fn peer_finished(&self, buf: &mut [u8]) -> usize {
+        unsafe {
+            ffi::SSL_get_peer_finished(self.as_ptr(), buf.as_mut_ptr() as *mut c_void, buf.len())
+        }
+    }
+
+    /// Determines if the initial handshake has been completed.
+    #[corresponds(SSL_is_init_finished)]
+    #[cfg(ossl110)]
+    pub fn is_init_finished(&self) -> bool {
+        unsafe { ffi::SSL_is_init_finished(self.as_ptr()) != 0 }
+    }
+
+    /// Determines if the client's hello message is in the SSLv2 format.
+    ///
+    /// This can only be used inside of the client hello callback. Otherwise, `false` is returned.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(SSL_client_hello_isv2)]
+    #[cfg(ossl111)]
+    pub fn client_hello_isv2(&self) -> bool {
+        unsafe { ffi::SSL_client_hello_isv2(self.as_ptr()) != 0 }
+    }
+
+    /// Returns the legacy version field of the client's hello message.
+    ///
+    /// This can only be used inside of the client hello callback. Otherwise, `None` is returned.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(SSL_client_hello_get0_legacy_version)]
+    #[cfg(ossl111)]
+    pub fn client_hello_legacy_version(&self) -> Option<SslVersion> {
+        unsafe {
+            let version = ffi::SSL_client_hello_get0_legacy_version(self.as_ptr());
+            if version == 0 {
+                None
+            } else {
+                Some(SslVersion(version as c_int))
+            }
+        }
+    }
+
+    /// Returns the random field of the client's hello message.
+    ///
+    /// This can only be used inside of the client hello callback. Otherwise, `None` is returned.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(SSL_client_hello_get0_random)]
+    #[cfg(ossl111)]
+    pub fn client_hello_random(&self) -> Option<&[u8]> {
+        unsafe {
+            let mut ptr = ptr::null();
+            let len = ffi::SSL_client_hello_get0_random(self.as_ptr(), &mut ptr);
+            if len == 0 {
+                None
+            } else {
+                Some(slice::from_raw_parts(ptr, len))
+            }
+        }
+    }
+
+    /// Returns the session ID field of the client's hello message.
+    ///
+    /// This can only be used inside of the client hello callback. Otherwise, `None` is returned.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(SSL_client_hello_get0_session_id)]
+    #[cfg(ossl111)]
+    pub fn client_hello_session_id(&self) -> Option<&[u8]> {
+        unsafe {
+            let mut ptr = ptr::null();
+            let len = ffi::SSL_client_hello_get0_session_id(self.as_ptr(), &mut ptr);
+            if len == 0 {
+                None
+            } else {
+                Some(slice::from_raw_parts(ptr, len))
+            }
+        }
+    }
+
+    /// Returns the ciphers field of the client's hello message.
+    ///
+    /// This can only be used inside of the client hello callback. Otherwise, `None` is returned.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(SSL_client_hello_get0_ciphers)]
+    #[cfg(ossl111)]
+    pub fn client_hello_ciphers(&self) -> Option<&[u8]> {
+        unsafe {
+            let mut ptr = ptr::null();
+            let len = ffi::SSL_client_hello_get0_ciphers(self.as_ptr(), &mut ptr);
+            if len == 0 {
+                None
+            } else {
+                Some(slice::from_raw_parts(ptr, len))
+            }
+        }
+    }
+
+    /// Decodes a slice of wire-format cipher suite specification bytes. Unsupported cipher suites
+    /// are ignored.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(SSL_bytes_to_cipher_list)]
+    #[cfg(ossl111)]
+    pub fn bytes_to_cipher_list(
+        &self,
+        bytes: &[u8],
+        isv2format: bool,
+    ) -> Result<CipherLists, ErrorStack> {
+        unsafe {
+            let ptr = bytes.as_ptr();
+            let len = bytes.len();
+            let mut sk = ptr::null_mut();
+            let mut scsvs = ptr::null_mut();
+            let res = ffi::SSL_bytes_to_cipher_list(
+                self.as_ptr(),
+                ptr,
+                len,
+                isv2format as c_int,
+                &mut sk,
+                &mut scsvs,
+            );
+            if res == 1 {
+                Ok(CipherLists {
+                    suites: Stack::from_ptr(sk),
+                    signalling_suites: Stack::from_ptr(scsvs),
+                })
+            } else {
+                Err(ErrorStack::get())
+            }
+        }
+    }
+
+    /// Returns the compression methods field of the client's hello message.
+    ///
+    /// This can only be used inside of the client hello callback. Otherwise, `None` is returned.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(SSL_client_hello_get0_compression_methods)]
+    #[cfg(ossl111)]
+    pub fn client_hello_compression_methods(&self) -> Option<&[u8]> {
+        unsafe {
+            let mut ptr = ptr::null();
+            let len = ffi::SSL_client_hello_get0_compression_methods(self.as_ptr(), &mut ptr);
+            if len == 0 {
+                None
+            } else {
+                Some(slice::from_raw_parts(ptr, len))
+            }
+        }
+    }
+
+    /// Sets the MTU used for DTLS connections.
+    #[corresponds(SSL_set_mtu)]
+    pub fn set_mtu(&mut self, mtu: u32) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::SSL_set_mtu(self.as_ptr(), mtu as MtuTy) as c_int).map(|_| ()) }
+    }
+
+    /// Returns the PSK identity hint used during connection setup.
+    ///
+    /// May return `None` if no PSK identity hint was used during the connection setup.
+    #[corresponds(SSL_get_psk_identity_hint)]
+    #[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
+    pub fn psk_identity_hint(&self) -> Option<&[u8]> {
+        unsafe {
+            let ptr = ffi::SSL_get_psk_identity_hint(self.as_ptr());
+            if ptr.is_null() {
+                None
+            } else {
+                Some(CStr::from_ptr(ptr).to_bytes())
+            }
+        }
+    }
+
+    /// Returns the PSK identity used during connection setup.
+    #[corresponds(SSL_get_psk_identity)]
+    #[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
+    pub fn psk_identity(&self) -> Option<&[u8]> {
+        unsafe {
+            let ptr = ffi::SSL_get_psk_identity(self.as_ptr());
+            if ptr.is_null() {
+                None
+            } else {
+                Some(CStr::from_ptr(ptr).to_bytes())
+            }
+        }
+    }
+
+    #[corresponds(SSL_add0_chain_cert)]
+    #[cfg(ossl102)]
+    pub fn add_chain_cert(&mut self, chain: X509) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::SSL_add0_chain_cert(self.as_ptr(), chain.as_ptr()) as c_int).map(|_| ())?;
+            mem::forget(chain);
+        }
+        Ok(())
+    }
+
+    /// Sets a new default TLS/SSL method for SSL objects
+    #[cfg(not(boringssl))]
+    pub fn set_method(&mut self, method: SslMethod) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::SSL_set_ssl_method(self.as_ptr(), method.as_ptr()))?;
+        };
+        Ok(())
+    }
+
+    /// Loads the private key from a file.
+    #[corresponds(SSL_use_Private_Key_file)]
+    pub fn set_private_key_file<P: AsRef<Path>>(
+        &mut self,
+        path: P,
+        ssl_file_type: SslFiletype,
+    ) -> Result<(), ErrorStack> {
+        let p = path.as_ref().as_os_str().to_str().unwrap();
+        let key_file = CString::new(p).unwrap();
+        unsafe {
+            cvt(ffi::SSL_use_PrivateKey_file(
+                self.as_ptr(),
+                key_file.as_ptr(),
+                ssl_file_type.as_raw(),
+            ))?;
+        };
+        Ok(())
+    }
+
+    /// Sets the private key.
+    #[corresponds(SSL_use_PrivateKey)]
+    pub fn set_private_key(&mut self, pkey: &PKeyRef<Private>) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::SSL_use_PrivateKey(self.as_ptr(), pkey.as_ptr()))?;
+        };
+        Ok(())
+    }
+
+    /// Sets the certificate
+    #[corresponds(SSL_use_certificate)]
+    pub fn set_certificate(&mut self, cert: &X509Ref) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::SSL_use_certificate(self.as_ptr(), cert.as_ptr()))?;
+        };
+        Ok(())
+    }
+
+    /// Loads a certificate chain from a file.
+    ///
+    /// The file should contain a sequence of PEM-formatted certificates, the first being the leaf
+    /// certificate, and the remainder forming the chain of certificates up to and including the
+    /// trusted root certificate.
+    #[corresponds(SSL_use_certificate_chain_file)]
+    #[cfg(any(ossl110, libressl332))]
+    pub fn set_certificate_chain_file<P: AsRef<Path>>(
+        &mut self,
+        path: P,
+    ) -> Result<(), ErrorStack> {
+        let p = path.as_ref().as_os_str().to_str().unwrap();
+        let cert_file = CString::new(p).unwrap();
+        unsafe {
+            cvt(ffi::SSL_use_certificate_chain_file(
+                self.as_ptr(),
+                cert_file.as_ptr(),
+            ))?;
+        };
+        Ok(())
+    }
+
+    /// Sets ca certificate that client trusted
+    #[corresponds(SSL_add_client_CA)]
+    pub fn add_client_ca(&mut self, cacert: &X509Ref) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::SSL_add_client_CA(self.as_ptr(), cacert.as_ptr()))?;
+        };
+        Ok(())
+    }
+
+    // Sets the list of CAs sent to the client when requesting a client certificate for the chosen ssl
+    #[corresponds(SSL_set_client_CA_list)]
+    pub fn set_client_ca_list(&mut self, list: Stack<X509Name>) {
+        unsafe { ffi::SSL_set_client_CA_list(self.as_ptr(), list.as_ptr()) }
+        mem::forget(list);
+    }
+
+    /// Sets the minimum supported protocol version.
+    ///
+    /// A value of `None` will enable protocol versions down to the lowest version supported by
+    /// OpenSSL.
+    ///
+    /// Requires BoringSSL or OpenSSL 1.1.0 or LibreSSL 2.6.1 or newer.
+    #[corresponds(SSL_set_min_proto_version)]
+    #[cfg(any(ossl110, libressl261, boringssl))]
+    pub fn set_min_proto_version(&mut self, version: Option<SslVersion>) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::SSL_set_min_proto_version(
+                self.as_ptr(),
+                version.map_or(0, |v| v.0 as _),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the maximum supported protocol version.
+    ///
+    /// A value of `None` will enable protocol versions up to the highest version supported by
+    /// OpenSSL.
+    ///
+    /// Requires BoringSSL or OpenSSL 1.1.0 or or LibreSSL 2.6.1 or newer.
+    #[corresponds(SSL_set_max_proto_version)]
+    #[cfg(any(ossl110, libressl261, boringssl))]
+    pub fn set_max_proto_version(&mut self, version: Option<SslVersion>) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::SSL_set_max_proto_version(
+                self.as_ptr(),
+                version.map_or(0, |v| v.0 as _),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the list of supported ciphers for the TLSv1.3 protocol.
+    ///
+    /// The `set_cipher_list` method controls the cipher suites for protocols before TLSv1.3.
+    ///
+    /// The format consists of TLSv1.3 cipher suite names separated by `:` characters in order of
+    /// preference.
+    ///
+    /// Requires OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
+    #[corresponds(SSL_set_ciphersuites)]
+    #[cfg(any(ossl111, libressl340))]
+    pub fn set_ciphersuites(&mut self, cipher_list: &str) -> Result<(), ErrorStack> {
+        let cipher_list = CString::new(cipher_list).unwrap();
+        unsafe {
+            cvt(ffi::SSL_set_ciphersuites(
+                self.as_ptr(),
+                cipher_list.as_ptr() as *const _,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the list of supported ciphers for protocols before TLSv1.3.
+    ///
+    /// The `set_ciphersuites` method controls the cipher suites for TLSv1.3.
+    ///
+    /// See [`ciphers`] for details on the format.
+    ///
+    /// [`ciphers`]: https://www.openssl.org/docs/manmaster/apps/ciphers.html
+    #[corresponds(SSL_set_cipher_list)]
+    pub fn set_cipher_list(&mut self, cipher_list: &str) -> Result<(), ErrorStack> {
+        let cipher_list = CString::new(cipher_list).unwrap();
+        unsafe {
+            cvt(ffi::SSL_set_cipher_list(
+                self.as_ptr(),
+                cipher_list.as_ptr() as *const _,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Set the certificate store used for certificate verification
+    #[corresponds(SSL_set_cert_store)]
+    #[cfg(ossl102)]
+    pub fn set_verify_cert_store(&mut self, cert_store: X509Store) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::SSL_set0_verify_cert_store(self.as_ptr(), cert_store.as_ptr()) as c_int)?;
+            mem::forget(cert_store);
+            Ok(())
+        }
+    }
+
+    /// Sets the number of TLS 1.3 session tickets that will be sent to a client after a full
+    /// handshake.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(SSL_set_num_tickets)]
+    #[cfg(ossl111)]
+    pub fn set_num_tickets(&mut self, num_tickets: usize) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::SSL_set_num_tickets(self.as_ptr(), num_tickets)).map(|_| ()) }
+    }
+
+    /// Gets the number of TLS 1.3 session tickets that will be sent to a client after a full
+    /// handshake.
+    ///
+    /// Requires OpenSSL 1.1.1 or newer.
+    #[corresponds(SSL_get_num_tickets)]
+    #[cfg(ossl111)]
+    pub fn num_tickets(&self) -> usize {
+        unsafe { ffi::SSL_get_num_tickets(self.as_ptr()) }
+    }
+
+    /// Set the context's security level to a value between 0 and 5, inclusive.
+    /// A security value of 0 allows allows all parameters and algorithms.
+    ///
+    /// Requires OpenSSL 1.1.0 or newer.
+    #[corresponds(SSL_set_security_level)]
+    #[cfg(any(ossl110, libressl360))]
+    pub fn set_security_level(&mut self, level: u32) {
+        unsafe { ffi::SSL_set_security_level(self.as_ptr(), level as c_int) }
+    }
+
+    /// Get the connection's security level, which controls the allowed parameters
+    /// and algorithms.
+    ///
+    /// Requires OpenSSL 1.1.0 or newer.
+    #[corresponds(SSL_get_security_level)]
+    #[cfg(any(ossl110, libressl360))]
+    pub fn security_level(&self) -> u32 {
+        unsafe { ffi::SSL_get_security_level(self.as_ptr()) as u32 }
+    }
+
+    /// Get the temporary key provided by the peer that is used during key
+    /// exchange.
+    // We use an owned value because EVP_KEY free need to be called when it is
+    // dropped
+    #[corresponds(SSL_get_peer_tmp_key)]
+    #[cfg(ossl300)]
+    pub fn peer_tmp_key(&self) -> Result<PKey<Public>, ErrorStack> {
+        unsafe {
+            let mut key = ptr::null_mut();
+            match cvt_long(ffi::SSL_get_peer_tmp_key(self.as_ptr(), &mut key)) {
+                Ok(_) => Ok(PKey::<Public>::from_ptr(key)),
+                Err(e) => Err(e),
+            }
+        }
+    }
+
+    /// Returns the temporary key from the local end of the connection that is
+    /// used during key exchange.
+    // We use an owned value because EVP_KEY free need to be called when it is
+    // dropped
+    #[corresponds(SSL_get_tmp_key)]
+    #[cfg(ossl300)]
+    pub fn tmp_key(&self) -> Result<PKey<Private>, ErrorStack> {
+        unsafe {
+            let mut key = ptr::null_mut();
+            match cvt_long(ffi::SSL_get_tmp_key(self.as_ptr(), &mut key)) {
+                Ok(_) => Ok(PKey::<Private>::from_ptr(key)),
+                Err(e) => Err(e),
+            }
+        }
+    }
+}
+
+/// An SSL stream midway through the handshake process.
+#[derive(Debug)]
+pub struct MidHandshakeSslStream<S> {
+    stream: SslStream<S>,
+    error: Error,
+}
+
+impl<S> MidHandshakeSslStream<S> {
+    /// Returns a shared reference to the inner stream.
+    pub fn get_ref(&self) -> &S {
+        self.stream.get_ref()
+    }
+
+    /// Returns a mutable reference to the inner stream.
+    pub fn get_mut(&mut self) -> &mut S {
+        self.stream.get_mut()
+    }
+
+    /// Returns a shared reference to the `Ssl` of the stream.
+    pub fn ssl(&self) -> &SslRef {
+        self.stream.ssl()
+    }
+
+    /// Returns the underlying error which interrupted this handshake.
+    pub fn error(&self) -> &Error {
+        &self.error
+    }
+
+    /// Consumes `self`, returning its error.
+    pub fn into_error(self) -> Error {
+        self.error
+    }
+}
+
+impl<S> MidHandshakeSslStream<S>
+where
+    S: Read + Write,
+{
+    /// Restarts the handshake process.
+    ///
+    /// This corresponds to [`SSL_do_handshake`].
+    ///
+    /// [`SSL_do_handshake`]: https://www.openssl.org/docs/manmaster/man3/SSL_do_handshake.html
+    pub fn handshake(mut self) -> Result<SslStream<S>, HandshakeError<S>> {
+        match self.stream.do_handshake() {
+            Ok(()) => Ok(self.stream),
+            Err(error) => {
+                self.error = error;
+                match self.error.code() {
+                    ErrorCode::WANT_READ | ErrorCode::WANT_WRITE => {
+                        Err(HandshakeError::WouldBlock(self))
+                    }
+                    _ => Err(HandshakeError::Failure(self)),
+                }
+            }
+        }
+    }
+}
+
+/// A TLS session over a stream.
+pub struct SslStream<S> {
+    ssl: ManuallyDrop<Ssl>,
+    method: ManuallyDrop<BioMethod>,
+    _p: PhantomData<S>,
+}
+
+impl<S> Drop for SslStream<S> {
+    fn drop(&mut self) {
+        // ssl holds a reference to method internally so it has to drop first
+        unsafe {
+            ManuallyDrop::drop(&mut self.ssl);
+            ManuallyDrop::drop(&mut self.method);
+        }
+    }
+}
+
+impl<S> fmt::Debug for SslStream<S>
+where
+    S: fmt::Debug,
+{
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
+        fmt.debug_struct("SslStream")
+            .field("stream", &self.get_ref())
+            .field("ssl", &self.ssl())
+            .finish()
+    }
+}
+
+impl<S: Read + Write> SslStream<S> {
+    /// Creates a new `SslStream`.
+    ///
+    /// This function performs no IO; the stream will not have performed any part of the handshake
+    /// with the peer. If the `Ssl` was configured with [`SslRef::set_connect_state`] or
+    /// [`SslRef::set_accept_state`], the handshake can be performed automatically during the first
+    /// call to read or write. Otherwise the `connect` and `accept` methods can be used to
+    /// explicitly perform the handshake.
+    #[corresponds(SSL_set_bio)]
+    pub fn new(ssl: Ssl, stream: S) -> Result<Self, ErrorStack> {
+        let (bio, method) = bio::new(stream)?;
+        unsafe {
+            ffi::SSL_set_bio(ssl.as_ptr(), bio, bio);
+        }
+
+        Ok(SslStream {
+            ssl: ManuallyDrop::new(ssl),
+            method: ManuallyDrop::new(method),
+            _p: PhantomData,
+        })
+    }
+
+    /// Constructs an `SslStream` from a pointer to the underlying OpenSSL `SSL` struct.
+    ///
+    /// This is useful if the handshake has already been completed elsewhere.
+    ///
+    /// # Safety
+    ///
+    /// The caller must ensure the pointer is valid.
+    #[deprecated(
+        since = "0.10.32",
+        note = "use Ssl::from_ptr and SslStream::new instead"
+    )]
+    pub unsafe fn from_raw_parts(ssl: *mut ffi::SSL, stream: S) -> Self {
+        let ssl = Ssl::from_ptr(ssl);
+        Self::new(ssl, stream).unwrap()
+    }
+
+    /// Read application data transmitted by a client before handshake completion.
+    ///
+    /// Useful for reducing latency, but vulnerable to replay attacks. Call
+    /// [`SslRef::set_accept_state`] first.
+    ///
+    /// Returns `Ok(0)` if all early data has been read.
+    ///
+    /// Requires OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
+    #[corresponds(SSL_read_early_data)]
+    #[cfg(any(ossl111, libressl340))]
+    pub fn read_early_data(&mut self, buf: &mut [u8]) -> Result<usize, Error> {
+        let mut read = 0;
+        let ret = unsafe {
+            ffi::SSL_read_early_data(
+                self.ssl.as_ptr(),
+                buf.as_ptr() as *mut c_void,
+                buf.len(),
+                &mut read,
+            )
+        };
+        match ret {
+            ffi::SSL_READ_EARLY_DATA_ERROR => Err(self.make_error(ret)),
+            ffi::SSL_READ_EARLY_DATA_SUCCESS => Ok(read),
+            ffi::SSL_READ_EARLY_DATA_FINISH => Ok(0),
+            _ => unreachable!(),
+        }
+    }
+
+    /// Send data to the server without blocking on handshake completion.
+    ///
+    /// Useful for reducing latency, but vulnerable to replay attacks. Call
+    /// [`SslRef::set_connect_state`] first.
+    ///
+    /// Requires OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
+    #[corresponds(SSL_write_early_data)]
+    #[cfg(any(ossl111, libressl340))]
+    pub fn write_early_data(&mut self, buf: &[u8]) -> Result<usize, Error> {
+        let mut written = 0;
+        let ret = unsafe {
+            ffi::SSL_write_early_data(
+                self.ssl.as_ptr(),
+                buf.as_ptr() as *const c_void,
+                buf.len(),
+                &mut written,
+            )
+        };
+        if ret > 0 {
+            Ok(written)
+        } else {
+            Err(self.make_error(ret))
+        }
+    }
+
+    /// Initiates a client-side TLS handshake.
+    ///
+    /// # Warning
+    ///
+    /// OpenSSL's default configuration is insecure. It is highly recommended to use
+    /// `SslConnector` rather than `Ssl` directly, as it manages that configuration.
+    #[corresponds(SSL_connect)]
+    pub fn connect(&mut self) -> Result<(), Error> {
+        let ret = unsafe { ffi::SSL_connect(self.ssl.as_ptr()) };
+        if ret > 0 {
+            Ok(())
+        } else {
+            Err(self.make_error(ret))
+        }
+    }
+
+    /// Initiates a server-side TLS handshake.
+    ///
+    /// # Warning
+    ///
+    /// OpenSSL's default configuration is insecure. It is highly recommended to use
+    /// `SslAcceptor` rather than `Ssl` directly, as it manages that configuration.
+    #[corresponds(SSL_accept)]
+    pub fn accept(&mut self) -> Result<(), Error> {
+        let ret = unsafe { ffi::SSL_accept(self.ssl.as_ptr()) };
+        if ret > 0 {
+            Ok(())
+        } else {
+            Err(self.make_error(ret))
+        }
+    }
+
+    /// Initiates the handshake.
+    ///
+    /// This will fail if `set_accept_state` or `set_connect_state` was not called first.
+    #[corresponds(SSL_do_handshake)]
+    pub fn do_handshake(&mut self) -> Result<(), Error> {
+        let ret = unsafe { ffi::SSL_do_handshake(self.ssl.as_ptr()) };
+        if ret > 0 {
+            Ok(())
+        } else {
+            Err(self.make_error(ret))
+        }
+    }
+
+    /// Perform a stateless server-side handshake.
+    ///
+    /// Requires that cookie generation and verification callbacks were
+    /// set on the SSL context.
+    ///
+    /// Returns `Ok(true)` if a complete ClientHello containing a valid cookie
+    /// was read, in which case the handshake should be continued via
+    /// `accept`. If a HelloRetryRequest containing a fresh cookie was
+    /// transmitted, `Ok(false)` is returned instead. If the handshake cannot
+    /// proceed at all, `Err` is returned.
+    #[corresponds(SSL_stateless)]
+    #[cfg(ossl111)]
+    pub fn stateless(&mut self) -> Result<bool, ErrorStack> {
+        match unsafe { ffi::SSL_stateless(self.ssl.as_ptr()) } {
+            1 => Ok(true),
+            0 => Ok(false),
+            -1 => Err(ErrorStack::get()),
+            _ => unreachable!(),
+        }
+    }
+
+    /// Like `read`, but takes a possibly-uninitialized slice.
+    ///
+    /// # Safety
+    ///
+    /// No portion of `buf` will be de-initialized by this method. If the method returns `Ok(n)`,
+    /// then the first `n` bytes of `buf` are guaranteed to be initialized.
+    #[corresponds(SSL_read_ex)]
+    pub fn read_uninit(&mut self, buf: &mut [MaybeUninit<u8>]) -> io::Result<usize> {
+        loop {
+            match self.ssl_read_uninit(buf) {
+                Ok(n) => return Ok(n),
+                Err(ref e) if e.code() == ErrorCode::ZERO_RETURN => return Ok(0),
+                Err(ref e) if e.code() == ErrorCode::SYSCALL && e.io_error().is_none() => {
+                    return Ok(0);
+                }
+                Err(ref e) if e.code() == ErrorCode::WANT_READ && e.io_error().is_none() => {}
+                Err(e) => {
+                    return Err(e
+                        .into_io_error()
+                        .unwrap_or_else(|e| io::Error::new(io::ErrorKind::Other, e)));
+                }
+            }
+        }
+    }
+
+    /// Like `read`, but returns an `ssl::Error` rather than an `io::Error`.
+    ///
+    /// It is particularly useful with a non-blocking socket, where the error value will identify if
+    /// OpenSSL is waiting on read or write readiness.
+    #[corresponds(SSL_read_ex)]
+    pub fn ssl_read(&mut self, buf: &mut [u8]) -> Result<usize, Error> {
+        // SAFETY: `ssl_read_uninit` does not de-initialize the buffer.
+        unsafe {
+            self.ssl_read_uninit(slice::from_raw_parts_mut(
+                buf.as_mut_ptr().cast::<MaybeUninit<u8>>(),
+                buf.len(),
+            ))
+        }
+    }
+
+    /// Like `read_ssl`, but takes a possibly-uninitialized slice.
+    ///
+    /// # Safety
+    ///
+    /// No portion of `buf` will be de-initialized by this method. If the method returns `Ok(n)`,
+    /// then the first `n` bytes of `buf` are guaranteed to be initialized.
+    #[corresponds(SSL_read_ex)]
+    pub fn ssl_read_uninit(&mut self, buf: &mut [MaybeUninit<u8>]) -> Result<usize, Error> {
+        cfg_if! {
+            if #[cfg(any(ossl111, libressl350))] {
+                let mut readbytes = 0;
+                let ret = unsafe {
+                    ffi::SSL_read_ex(
+                        self.ssl().as_ptr(),
+                        buf.as_mut_ptr().cast(),
+                        buf.len(),
+                        &mut readbytes,
+                    )
+                };
+
+                if ret > 0 {
+                    Ok(readbytes)
+                } else {
+                    Err(self.make_error(ret))
+                }
+            } else {
+                if buf.is_empty() {
+                    return Ok(0);
+                }
+
+                let len = usize::min(c_int::MAX as usize, buf.len()) as c_int;
+                let ret = unsafe {
+                    ffi::SSL_read(self.ssl().as_ptr(), buf.as_mut_ptr().cast(), len)
+                };
+                if ret > 0 {
+                    Ok(ret as usize)
+                } else {
+                    Err(self.make_error(ret))
+                }
+            }
+        }
+    }
+
+    /// Like `write`, but returns an `ssl::Error` rather than an `io::Error`.
+    ///
+    /// It is particularly useful with a non-blocking socket, where the error value will identify if
+    /// OpenSSL is waiting on read or write readiness.
+    #[corresponds(SSL_write_ex)]
+    pub fn ssl_write(&mut self, buf: &[u8]) -> Result<usize, Error> {
+        cfg_if! {
+            if #[cfg(any(ossl111, libressl350))] {
+                let mut written = 0;
+                let ret = unsafe {
+                    ffi::SSL_write_ex(
+                        self.ssl().as_ptr(),
+                        buf.as_ptr().cast(),
+                        buf.len(),
+                        &mut written,
+                    )
+                };
+
+                if ret > 0 {
+                    Ok(written)
+                } else {
+                    Err(self.make_error(ret))
+                }
+            } else {
+                if buf.is_empty() {
+                    return Ok(0);
+                }
+
+                let len = usize::min(c_int::MAX as usize, buf.len()) as c_int;
+                let ret = unsafe {
+                    ffi::SSL_write(self.ssl().as_ptr(), buf.as_ptr().cast(), len)
+                };
+                if ret > 0 {
+                    Ok(ret as usize)
+                } else {
+                    Err(self.make_error(ret))
+                }
+            }
+        }
+    }
+
+    /// Reads data from the stream, without removing it from the queue.
+    #[corresponds(SSL_peek_ex)]
+    pub fn ssl_peek(&mut self, buf: &mut [u8]) -> Result<usize, Error> {
+        cfg_if! {
+            if #[cfg(any(ossl111, libressl350))] {
+                let mut readbytes = 0;
+                let ret = unsafe {
+                    ffi::SSL_peek_ex(
+                        self.ssl().as_ptr(),
+                        buf.as_mut_ptr().cast(),
+                        buf.len(),
+                        &mut readbytes,
+                    )
+                };
+
+                if ret > 0 {
+                    Ok(readbytes)
+                } else {
+                    Err(self.make_error(ret))
+                }
+            } else {
+                if buf.is_empty() {
+                    return Ok(0);
+                }
+
+                let len = usize::min(c_int::MAX as usize, buf.len()) as c_int;
+                let ret = unsafe {
+                    ffi::SSL_peek(self.ssl().as_ptr(), buf.as_mut_ptr().cast(), len)
+                };
+                if ret > 0 {
+                    Ok(ret as usize)
+                } else {
+                    Err(self.make_error(ret))
+                }
+            }
+        }
+    }
+
+    /// Shuts down the session.
+    ///
+    /// The shutdown process consists of two steps. The first step sends a close notify message to
+    /// the peer, after which `ShutdownResult::Sent` is returned. The second step awaits the receipt
+    /// of a close notify message from the peer, after which `ShutdownResult::Received` is returned.
+    ///
+    /// While the connection may be closed after the first step, it is recommended to fully shut the
+    /// session down. In particular, it must be fully shut down if the connection is to be used for
+    /// further communication in the future.
+    #[corresponds(SSL_shutdown)]
+    pub fn shutdown(&mut self) -> Result<ShutdownResult, Error> {
+        match unsafe { ffi::SSL_shutdown(self.ssl.as_ptr()) } {
+            0 => Ok(ShutdownResult::Sent),
+            1 => Ok(ShutdownResult::Received),
+            n => Err(self.make_error(n)),
+        }
+    }
+
+    /// Returns the session's shutdown state.
+    #[corresponds(SSL_get_shutdown)]
+    pub fn get_shutdown(&mut self) -> ShutdownState {
+        unsafe {
+            let bits = ffi::SSL_get_shutdown(self.ssl.as_ptr());
+            ShutdownState::from_bits_retain(bits)
+        }
+    }
+
+    /// Sets the session's shutdown state.
+    ///
+    /// This can be used to tell OpenSSL that the session should be cached even if a full two-way
+    /// shutdown was not completed.
+    #[corresponds(SSL_set_shutdown)]
+    pub fn set_shutdown(&mut self, state: ShutdownState) {
+        unsafe { ffi::SSL_set_shutdown(self.ssl.as_ptr(), state.bits()) }
+    }
+}
+
+impl<S> SslStream<S> {
+    fn make_error(&mut self, ret: c_int) -> Error {
+        self.check_panic();
+
+        let code = self.ssl.get_error(ret);
+
+        let cause = match code {
+            ErrorCode::SSL => Some(InnerError::Ssl(ErrorStack::get())),
+            ErrorCode::SYSCALL => {
+                let errs = ErrorStack::get();
+                if errs.errors().is_empty() {
+                    self.get_bio_error().map(InnerError::Io)
+                } else {
+                    Some(InnerError::Ssl(errs))
+                }
+            }
+            ErrorCode::ZERO_RETURN => None,
+            ErrorCode::WANT_READ | ErrorCode::WANT_WRITE => {
+                self.get_bio_error().map(InnerError::Io)
+            }
+            _ => None,
+        };
+
+        Error { code, cause }
+    }
+
+    fn check_panic(&mut self) {
+        if let Some(err) = unsafe { bio::take_panic::<S>(self.ssl.get_raw_rbio()) } {
+            resume_unwind(err)
+        }
+    }
+
+    fn get_bio_error(&mut self) -> Option<io::Error> {
+        unsafe { bio::take_error::<S>(self.ssl.get_raw_rbio()) }
+    }
+
+    /// Returns a shared reference to the underlying stream.
+    pub fn get_ref(&self) -> &S {
+        unsafe {
+            let bio = self.ssl.get_raw_rbio();
+            bio::get_ref(bio)
+        }
+    }
+
+    /// Returns a mutable reference to the underlying stream.
+    ///
+    /// # Warning
+    ///
+    /// It is inadvisable to read from or write to the underlying stream as it
+    /// will most likely corrupt the SSL session.
+    pub fn get_mut(&mut self) -> &mut S {
+        unsafe {
+            let bio = self.ssl.get_raw_rbio();
+            bio::get_mut(bio)
+        }
+    }
+
+    /// Returns a shared reference to the `Ssl` object associated with this stream.
+    pub fn ssl(&self) -> &SslRef {
+        &self.ssl
+    }
+}
+
+impl<S: Read + Write> Read for SslStream<S> {
+    fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
+        // SAFETY: `read_uninit` does not de-initialize the buffer
+        unsafe {
+            self.read_uninit(slice::from_raw_parts_mut(
+                buf.as_mut_ptr().cast::<MaybeUninit<u8>>(),
+                buf.len(),
+            ))
+        }
+    }
+}
+
+impl<S: Read + Write> Write for SslStream<S> {
+    fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
+        loop {
+            match self.ssl_write(buf) {
+                Ok(n) => return Ok(n),
+                Err(ref e) if e.code() == ErrorCode::WANT_READ && e.io_error().is_none() => {}
+                Err(e) => {
+                    return Err(e
+                        .into_io_error()
+                        .unwrap_or_else(|e| io::Error::new(io::ErrorKind::Other, e)));
+                }
+            }
+        }
+    }
+
+    fn flush(&mut self) -> io::Result<()> {
+        self.get_mut().flush()
+    }
+}
+
+/// A partially constructed `SslStream`, useful for unusual handshakes.
+#[deprecated(
+    since = "0.10.32",
+    note = "use the methods directly on Ssl/SslStream instead"
+)]
+pub struct SslStreamBuilder<S> {
+    inner: SslStream<S>,
+}
+
+#[allow(deprecated)]
+impl<S> SslStreamBuilder<S>
+where
+    S: Read + Write,
+{
+    /// Begin creating an `SslStream` atop `stream`
+    pub fn new(ssl: Ssl, stream: S) -> Self {
+        Self {
+            inner: SslStream::new(ssl, stream).unwrap(),
+        }
+    }
+
+    /// Perform a stateless server-side handshake
+    ///
+    /// Requires that cookie generation and verification callbacks were
+    /// set on the SSL context.
+    ///
+    /// Returns `Ok(true)` if a complete ClientHello containing a valid cookie
+    /// was read, in which case the handshake should be continued via
+    /// `accept`. If a HelloRetryRequest containing a fresh cookie was
+    /// transmitted, `Ok(false)` is returned instead. If the handshake cannot
+    /// proceed at all, `Err` is returned.
+    ///
+    /// This corresponds to [`SSL_stateless`]
+    ///
+    /// [`SSL_stateless`]: https://www.openssl.org/docs/manmaster/man3/SSL_stateless.html
+    #[cfg(ossl111)]
+    pub fn stateless(&mut self) -> Result<bool, ErrorStack> {
+        match unsafe { ffi::SSL_stateless(self.inner.ssl.as_ptr()) } {
+            1 => Ok(true),
+            0 => Ok(false),
+            -1 => Err(ErrorStack::get()),
+            _ => unreachable!(),
+        }
+    }
+
+    /// Configure as an outgoing stream from a client.
+    ///
+    /// This corresponds to [`SSL_set_connect_state`].
+    ///
+    /// [`SSL_set_connect_state`]: https://www.openssl.org/docs/manmaster/man3/SSL_set_connect_state.html
+    pub fn set_connect_state(&mut self) {
+        unsafe { ffi::SSL_set_connect_state(self.inner.ssl.as_ptr()) }
+    }
+
+    /// Configure as an incoming stream to a server.
+    ///
+    /// This corresponds to [`SSL_set_accept_state`].
+    ///
+    /// [`SSL_set_accept_state`]: https://www.openssl.org/docs/manmaster/man3/SSL_set_accept_state.html
+    pub fn set_accept_state(&mut self) {
+        unsafe { ffi::SSL_set_accept_state(self.inner.ssl.as_ptr()) }
+    }
+
+    /// See `Ssl::connect`
+    pub fn connect(mut self) -> Result<SslStream<S>, HandshakeError<S>> {
+        match self.inner.connect() {
+            Ok(()) => Ok(self.inner),
+            Err(error) => match error.code() {
+                ErrorCode::WANT_READ | ErrorCode::WANT_WRITE => {
+                    Err(HandshakeError::WouldBlock(MidHandshakeSslStream {
+                        stream: self.inner,
+                        error,
+                    }))
+                }
+                _ => Err(HandshakeError::Failure(MidHandshakeSslStream {
+                    stream: self.inner,
+                    error,
+                })),
+            },
+        }
+    }
+
+    /// See `Ssl::accept`
+    pub fn accept(mut self) -> Result<SslStream<S>, HandshakeError<S>> {
+        match self.inner.accept() {
+            Ok(()) => Ok(self.inner),
+            Err(error) => match error.code() {
+                ErrorCode::WANT_READ | ErrorCode::WANT_WRITE => {
+                    Err(HandshakeError::WouldBlock(MidHandshakeSslStream {
+                        stream: self.inner,
+                        error,
+                    }))
+                }
+                _ => Err(HandshakeError::Failure(MidHandshakeSslStream {
+                    stream: self.inner,
+                    error,
+                })),
+            },
+        }
+    }
+
+    /// Initiates the handshake.
+    ///
+    /// This will fail if `set_accept_state` or `set_connect_state` was not called first.
+    ///
+    /// This corresponds to [`SSL_do_handshake`].
+    ///
+    /// [`SSL_do_handshake`]: https://www.openssl.org/docs/manmaster/man3/SSL_do_handshake.html
+    pub fn handshake(mut self) -> Result<SslStream<S>, HandshakeError<S>> {
+        match self.inner.do_handshake() {
+            Ok(()) => Ok(self.inner),
+            Err(error) => match error.code() {
+                ErrorCode::WANT_READ | ErrorCode::WANT_WRITE => {
+                    Err(HandshakeError::WouldBlock(MidHandshakeSslStream {
+                        stream: self.inner,
+                        error,
+                    }))
+                }
+                _ => Err(HandshakeError::Failure(MidHandshakeSslStream {
+                    stream: self.inner,
+                    error,
+                })),
+            },
+        }
+    }
+
+    /// Read application data transmitted by a client before handshake
+    /// completion.
+    ///
+    /// Useful for reducing latency, but vulnerable to replay attacks. Call
+    /// `set_accept_state` first.
+    ///
+    /// Returns `Ok(0)` if all early data has been read.
+    ///
+    /// Requires OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
+    ///
+    /// This corresponds to [`SSL_read_early_data`].
+    ///
+    /// [`SSL_read_early_data`]: https://www.openssl.org/docs/manmaster/man3/SSL_read_early_data.html
+    #[cfg(any(ossl111, libressl340))]
+    pub fn read_early_data(&mut self, buf: &mut [u8]) -> Result<usize, Error> {
+        self.inner.read_early_data(buf)
+    }
+
+    /// Send data to the server without blocking on handshake completion.
+    ///
+    /// Useful for reducing latency, but vulnerable to replay attacks. Call
+    /// `set_connect_state` first.
+    ///
+    /// Requires OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
+    ///
+    /// This corresponds to [`SSL_write_early_data`].
+    ///
+    /// [`SSL_write_early_data`]: https://www.openssl.org/docs/manmaster/man3/SSL_write_early_data.html
+    #[cfg(any(ossl111, libressl340))]
+    pub fn write_early_data(&mut self, buf: &[u8]) -> Result<usize, Error> {
+        self.inner.write_early_data(buf)
+    }
+}
+
+#[allow(deprecated)]
+impl<S> SslStreamBuilder<S> {
+    /// Returns a shared reference to the underlying stream.
+    pub fn get_ref(&self) -> &S {
+        unsafe {
+            let bio = self.inner.ssl.get_raw_rbio();
+            bio::get_ref(bio)
+        }
+    }
+
+    /// Returns a mutable reference to the underlying stream.
+    ///
+    /// # Warning
+    ///
+    /// It is inadvisable to read from or write to the underlying stream as it
+    /// will most likely corrupt the SSL session.
+    pub fn get_mut(&mut self) -> &mut S {
+        unsafe {
+            let bio = self.inner.ssl.get_raw_rbio();
+            bio::get_mut(bio)
+        }
+    }
+
+    /// Returns a shared reference to the `Ssl` object associated with this builder.
+    pub fn ssl(&self) -> &SslRef {
+        &self.inner.ssl
+    }
+
+    /// Set the DTLS MTU size.
+    ///
+    /// It will be ignored if the value is smaller than the minimum packet size
+    /// the DTLS protocol requires.
+    ///
+    /// # Panics
+    /// This function panics if the given mtu size can't be represented in a positive `c_long` range
+    #[deprecated(note = "Use SslRef::set_mtu instead", since = "0.10.30")]
+    pub fn set_dtls_mtu_size(&mut self, mtu_size: usize) {
+        unsafe {
+            let bio = self.inner.ssl.get_raw_rbio();
+            bio::set_dtls_mtu_size::<S>(bio, mtu_size);
+        }
+    }
+}
+
+/// The result of a shutdown request.
+#[derive(Copy, Clone, Debug, PartialEq, Eq)]
+pub enum ShutdownResult {
+    /// A close notify message has been sent to the peer.
+    Sent,
+
+    /// A close notify response message has been received from the peer.
+    Received,
+}
+
+bitflags! {
+    /// The shutdown state of a session.
+    #[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+    #[repr(transparent)]
+    pub struct ShutdownState: c_int {
+        /// A close notify message has been sent to the peer.
+        const SENT = ffi::SSL_SENT_SHUTDOWN;
+        /// A close notify message has been received from the peer.
+        const RECEIVED = ffi::SSL_RECEIVED_SHUTDOWN;
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(boringssl, ossl110, libressl273))] {
+        use ffi::{SSL_CTX_up_ref, SSL_SESSION_get_master_key, SSL_SESSION_up_ref, SSL_is_server};
+    } else {
+        #[allow(bad_style)]
+        pub unsafe fn SSL_CTX_up_ref(ssl: *mut ffi::SSL_CTX) -> c_int {
+            ffi::CRYPTO_add_lock(
+                &mut (*ssl).references,
+                1,
+                ffi::CRYPTO_LOCK_SSL_CTX,
+                "mod.rs\0".as_ptr() as *const _,
+                line!() as c_int,
+            );
+            0
+        }
+
+        #[allow(bad_style)]
+        pub unsafe fn SSL_SESSION_get_master_key(
+            session: *const ffi::SSL_SESSION,
+            out: *mut c_uchar,
+            mut outlen: usize,
+        ) -> usize {
+            if outlen == 0 {
+                return (*session).master_key_length as usize;
+            }
+            if outlen > (*session).master_key_length as usize {
+                outlen = (*session).master_key_length as usize;
+            }
+            ptr::copy_nonoverlapping((*session).master_key.as_ptr(), out, outlen);
+            outlen
+        }
+
+        #[allow(bad_style)]
+        pub unsafe fn SSL_is_server(s: *mut ffi::SSL) -> c_int {
+            (*s).server
+        }
+
+        #[allow(bad_style)]
+        pub unsafe fn SSL_SESSION_up_ref(ses: *mut ffi::SSL_SESSION) -> c_int {
+            ffi::CRYPTO_add_lock(
+                &mut (*ses).references,
+                1,
+                ffi::CRYPTO_LOCK_SSL_CTX,
+                "mod.rs\0".as_ptr() as *const _,
+                line!() as c_int,
+            );
+            0
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        use ffi::SSL_get1_peer_certificate;
+    } else {
+        use ffi::SSL_get_peer_certificate as SSL_get1_peer_certificate;
+    }
+}
+cfg_if! {
+    if #[cfg(any(boringssl, ossl110, libressl291))] {
+        use ffi::{TLS_method, DTLS_method, TLS_client_method, TLS_server_method};
+    } else {
+        use ffi::{
+            SSLv23_method as TLS_method, DTLSv1_method as DTLS_method, SSLv23_client_method as TLS_client_method,
+            SSLv23_server_method as TLS_server_method,
+        };
+    }
+}
+cfg_if! {
+    if #[cfg(ossl110)] {
+        unsafe fn get_new_idx(f: ffi::CRYPTO_EX_free) -> c_int {
+            ffi::CRYPTO_get_ex_new_index(
+                ffi::CRYPTO_EX_INDEX_SSL_CTX,
+                0,
+                ptr::null_mut(),
+                None,
+                None,
+                Some(f),
+            )
+        }
+
+        unsafe fn get_new_ssl_idx(f: ffi::CRYPTO_EX_free) -> c_int {
+            ffi::CRYPTO_get_ex_new_index(
+                ffi::CRYPTO_EX_INDEX_SSL,
+                0,
+                ptr::null_mut(),
+                None,
+                None,
+                Some(f),
+            )
+        }
+    } else {
+        use std::sync::Once;
+
+        unsafe fn get_new_idx(f: ffi::CRYPTO_EX_free) -> c_int {
+            // hack around https://rt.openssl.org/Ticket/Display.html?id=3710&user=guest&pass=guest
+            static ONCE: Once = Once::new();
+            ONCE.call_once(|| {
+                cfg_if! {
+                    if #[cfg(not(boringssl))] {
+                        ffi::SSL_CTX_get_ex_new_index(0, ptr::null_mut(), None, None, None);
+                    } else {
+                        ffi::SSL_CTX_get_ex_new_index(0, ptr::null_mut(), ptr::null_mut(), None, None);
+                    }
+                }
+            });
+
+            cfg_if! {
+                if #[cfg(not(boringssl))] {
+                    ffi::SSL_CTX_get_ex_new_index(0, ptr::null_mut(), None, None, Some(f))
+                } else {
+                    ffi::SSL_CTX_get_ex_new_index(0, ptr::null_mut(), ptr::null_mut(), None, f)
+                }
+            }
+        }
+
+        unsafe fn get_new_ssl_idx(f: ffi::CRYPTO_EX_free) -> c_int {
+            // hack around https://rt.openssl.org/Ticket/Display.html?id=3710&user=guest&pass=guest
+            static ONCE: Once = Once::new();
+            ONCE.call_once(|| {
+                #[cfg(not(boringssl))]
+                ffi::SSL_get_ex_new_index(0, ptr::null_mut(), None, None, None);
+                #[cfg(boringssl)]
+                ffi::SSL_get_ex_new_index(0, ptr::null_mut(), ptr::null_mut(), None, None);
+            });
+
+            #[cfg(not(boringssl))]
+            return ffi::SSL_get_ex_new_index(0, ptr::null_mut(), None, None, Some(f));
+            #[cfg(boringssl)]
+            return ffi::SSL_get_ex_new_index(0, ptr::null_mut(), ptr::null_mut(), None, f);
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/ssl/test/mod.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/ssl/test/mod.rs
--- 43.0.0-1/rust-vendor/openssl/src/ssl/test/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/ssl/test/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1687 @@
+#![allow(unused_imports)]
+
+use std::env;
+use std::fs::File;
+use std::io::prelude::*;
+use std::io::{self, BufReader};
+use std::iter;
+use std::mem;
+use std::net::UdpSocket;
+use std::net::{SocketAddr, TcpListener, TcpStream};
+use std::path::Path;
+use std::process::{Child, ChildStdin, Command, Stdio};
+use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
+use std::thread;
+use std::time::Duration;
+
+use crate::dh::Dh;
+use crate::error::ErrorStack;
+use crate::hash::MessageDigest;
+#[cfg(not(boringssl))]
+use crate::ocsp::{OcspResponse, OcspResponseStatus};
+use crate::pkey::{Id, PKey};
+use crate::srtp::SrtpProfileId;
+use crate::ssl::test::server::Server;
+#[cfg(any(ossl110, ossl111, libressl261))]
+use crate::ssl::SslVersion;
+use crate::ssl::{self, NameType, SslConnectorBuilder};
+#[cfg(ossl111)]
+use crate::ssl::{ClientHelloResponse, ExtensionContext};
+use crate::ssl::{
+    Error, HandshakeError, MidHandshakeSslStream, ShutdownResult, ShutdownState, Ssl, SslAcceptor,
+    SslAcceptorBuilder, SslConnector, SslContext, SslContextBuilder, SslFiletype, SslMethod,
+    SslOptions, SslSessionCacheMode, SslStream, SslVerifyMode, StatusType,
+};
+#[cfg(ossl102)]
+use crate::x509::store::X509StoreBuilder;
+#[cfg(ossl102)]
+use crate::x509::verify::X509CheckFlags;
+use crate::x509::{X509Name, X509StoreContext, X509VerifyResult, X509};
+
+mod server;
+
+static ROOT_CERT: &[u8] = include_bytes!("../../../test/root-ca.pem");
+static CERT: &[u8] = include_bytes!("../../../test/cert.pem");
+static KEY: &[u8] = include_bytes!("../../../test/key.pem");
+
+#[test]
+fn verify_untrusted() {
+    let mut server = Server::builder();
+    server.should_error();
+    let server = server.build();
+
+    let mut client = server.client();
+    client.ctx().set_verify(SslVerifyMode::PEER);
+
+    client.connect_err();
+}
+
+#[test]
+fn verify_trusted() {
+    let server = Server::builder().build();
+
+    let mut client = server.client();
+    client.ctx().set_ca_file("test/root-ca.pem").unwrap();
+
+    client.connect();
+}
+
+#[test]
+#[cfg(ossl102)]
+fn verify_trusted_with_set_cert() {
+    let server = Server::builder().build();
+
+    let mut store = X509StoreBuilder::new().unwrap();
+    let x509 = X509::from_pem(ROOT_CERT).unwrap();
+    store.add_cert(x509).unwrap();
+
+    let mut client = server.client();
+    client.ctx().set_verify(SslVerifyMode::PEER);
+    client.ctx().set_verify_cert_store(store.build()).unwrap();
+
+    client.connect();
+}
+
+#[test]
+fn verify_untrusted_callback_override_ok() {
+    static CALLED_BACK: AtomicBool = AtomicBool::new(false);
+
+    let server = Server::builder().build();
+
+    let mut client = server.client();
+    client
+        .ctx()
+        .set_verify_callback(SslVerifyMode::PEER, |_, x509| {
+            CALLED_BACK.store(true, Ordering::SeqCst);
+            assert!(x509.current_cert().is_some());
+            true
+        });
+
+    client.connect();
+    assert!(CALLED_BACK.load(Ordering::SeqCst));
+}
+
+#[test]
+fn verify_untrusted_callback_override_bad() {
+    let mut server = Server::builder();
+    server.should_error();
+    let server = server.build();
+
+    let mut client = server.client();
+    client
+        .ctx()
+        .set_verify_callback(SslVerifyMode::PEER, |_, _| false);
+
+    client.connect_err();
+}
+
+#[test]
+fn verify_trusted_callback_override_ok() {
+    static CALLED_BACK: AtomicBool = AtomicBool::new(false);
+
+    let server = Server::builder().build();
+
+    let mut client = server.client();
+    client.ctx().set_ca_file("test/root-ca.pem").unwrap();
+    client
+        .ctx()
+        .set_verify_callback(SslVerifyMode::PEER, |_, x509| {
+            CALLED_BACK.store(true, Ordering::SeqCst);
+            assert!(x509.current_cert().is_some());
+            true
+        });
+
+    client.connect();
+    assert!(CALLED_BACK.load(Ordering::SeqCst));
+}
+
+#[test]
+fn verify_trusted_callback_override_bad() {
+    let mut server = Server::builder();
+    server.should_error();
+    let server = server.build();
+
+    let mut client = server.client();
+    client.ctx().set_ca_file("test/root-ca.pem").unwrap();
+    client
+        .ctx()
+        .set_verify_callback(SslVerifyMode::PEER, |_, _| false);
+
+    client.connect_err();
+}
+
+#[test]
+fn verify_callback_load_certs() {
+    static CALLED_BACK: AtomicBool = AtomicBool::new(false);
+
+    let server = Server::builder().build();
+
+    let mut client = server.client();
+    client
+        .ctx()
+        .set_verify_callback(SslVerifyMode::PEER, |_, x509| {
+            CALLED_BACK.store(true, Ordering::SeqCst);
+            assert!(x509.current_cert().is_some());
+            true
+        });
+
+    client.connect();
+    assert!(CALLED_BACK.load(Ordering::SeqCst));
+}
+
+#[test]
+fn verify_trusted_get_error_ok() {
+    static CALLED_BACK: AtomicBool = AtomicBool::new(false);
+
+    let server = Server::builder().build();
+
+    let mut client = server.client();
+    client.ctx().set_ca_file("test/root-ca.pem").unwrap();
+    client
+        .ctx()
+        .set_verify_callback(SslVerifyMode::PEER, |_, x509| {
+            CALLED_BACK.store(true, Ordering::SeqCst);
+            assert_eq!(x509.error(), X509VerifyResult::OK);
+            true
+        });
+
+    client.connect();
+    assert!(CALLED_BACK.load(Ordering::SeqCst));
+}
+
+#[test]
+fn verify_trusted_get_error_err() {
+    let mut server = Server::builder();
+    server.should_error();
+    let server = server.build();
+
+    let mut client = server.client();
+    client
+        .ctx()
+        .set_verify_callback(SslVerifyMode::PEER, |_, x509| {
+            assert_ne!(x509.error(), X509VerifyResult::OK);
+            false
+        });
+
+    client.connect_err();
+}
+
+#[test]
+fn verify_callback() {
+    static CALLED_BACK: AtomicBool = AtomicBool::new(false);
+
+    let server = Server::builder().build();
+
+    let mut client = server.client();
+    let expected = "59172d9313e84459bcff27f967e79e6e9217e584";
+    client
+        .ctx()
+        .set_verify_callback(SslVerifyMode::PEER, move |_, x509| {
+            CALLED_BACK.store(true, Ordering::SeqCst);
+            let cert = x509.current_cert().unwrap();
+            let digest = cert.digest(MessageDigest::sha1()).unwrap();
+            assert_eq!(hex::encode(digest), expected);
+            true
+        });
+
+    client.connect();
+    assert!(CALLED_BACK.load(Ordering::SeqCst));
+}
+
+#[test]
+fn ssl_verify_callback() {
+    static CALLED_BACK: AtomicBool = AtomicBool::new(false);
+
+    let server = Server::builder().build();
+
+    let mut client = server.client().build().builder();
+    let expected = "59172d9313e84459bcff27f967e79e6e9217e584";
+    client
+        .ssl()
+        .set_verify_callback(SslVerifyMode::PEER, move |_, x509| {
+            CALLED_BACK.store(true, Ordering::SeqCst);
+            let cert = x509.current_cert().unwrap();
+            let digest = cert.digest(MessageDigest::sha1()).unwrap();
+            assert_eq!(hex::encode(digest), expected);
+            true
+        });
+
+    client.connect();
+    assert!(CALLED_BACK.load(Ordering::SeqCst));
+}
+
+#[test]
+fn get_ctx_options() {
+    let ctx = SslContext::builder(SslMethod::tls()).unwrap();
+    ctx.options();
+}
+
+#[test]
+fn set_ctx_options() {
+    let mut ctx = SslContext::builder(SslMethod::tls()).unwrap();
+    let opts = ctx.set_options(SslOptions::NO_TICKET);
+    assert!(opts.contains(SslOptions::NO_TICKET));
+}
+
+#[test]
+#[cfg(not(boringssl))]
+fn clear_ctx_options() {
+    let mut ctx = SslContext::builder(SslMethod::tls()).unwrap();
+    ctx.set_options(SslOptions::ALL);
+    let opts = ctx.clear_options(SslOptions::ALL);
+    assert!(!opts.contains(SslOptions::ALL));
+}
+
+#[test]
+fn zero_length_buffers() {
+    let server = Server::builder().build();
+
+    let mut s = server.client().connect();
+    assert_eq!(s.write(&[]).unwrap(), 0);
+    assert_eq!(s.read(&mut []).unwrap(), 0);
+}
+
+#[test]
+fn peer_certificate() {
+    let server = Server::builder().build();
+
+    let s = server.client().connect();
+    let cert = s.ssl().peer_certificate().unwrap();
+    let fingerprint = cert.digest(MessageDigest::sha1()).unwrap();
+    assert_eq!(
+        hex::encode(fingerprint),
+        "59172d9313e84459bcff27f967e79e6e9217e584"
+    );
+}
+
+#[test]
+fn pending() {
+    let mut server = Server::builder();
+    server.io_cb(|mut s| s.write_all(&[0; 10]).unwrap());
+    let server = server.build();
+
+    let mut s = server.client().connect();
+    s.read_exact(&mut [0]).unwrap();
+
+    assert_eq!(s.ssl().pending(), 9);
+    assert_eq!(s.read(&mut [0; 10]).unwrap(), 9);
+}
+
+#[test]
+fn state() {
+    let server = Server::builder().build();
+
+    let s = server.client().connect();
+    #[cfg(not(boringssl))]
+    assert_eq!(s.ssl().state_string().trim(), "SSLOK");
+    #[cfg(boringssl)]
+    assert_eq!(s.ssl().state_string(), "!!!!!!");
+    assert_eq!(
+        s.ssl().state_string_long(),
+        "SSL negotiation finished successfully"
+    );
+}
+
+// when a connection uses ECDHE P-384 key exchange, then the temp key APIs
+// return P-384 keys, and the peer and local keys are different.
+#[test]
+#[cfg(ossl300)]
+fn peer_tmp_key_p384() {
+    let mut server = Server::builder();
+    server.ctx().set_groups_list("P-384").unwrap();
+    let server = server.build();
+    let s = server.client().connect();
+    let peer_temp = s.ssl().peer_tmp_key().unwrap();
+    assert_eq!(peer_temp.id(), Id::EC);
+    assert_eq!(peer_temp.bits(), 384);
+
+    let local_temp = s.ssl().tmp_key().unwrap();
+    assert_eq!(local_temp.id(), Id::EC);
+    assert_eq!(local_temp.bits(), 384);
+
+    assert_ne!(
+        peer_temp.ec_key().unwrap().public_key_to_der().unwrap(),
+        local_temp.ec_key().unwrap().public_key_to_der().unwrap(),
+    );
+}
+
+// when a connection uses RSA key exchange, then the peer (server) temp key is
+// an Error because there is no temp key, and the local (client) temp key is the
+// temp key sent in the initial key share.
+#[test]
+#[cfg(ossl300)]
+fn peer_tmp_key_rsa() {
+    let mut server = Server::builder();
+    server.ctx().set_cipher_list("RSA").unwrap();
+    // RSA key exchange is not allowed in TLS 1.3, so force the connection
+    // to negotiate TLS 1.2
+    server
+        .ctx()
+        .set_max_proto_version(Some(SslVersion::TLS1_2))
+        .unwrap();
+    let server = server.build();
+    let mut client = server.client();
+    client.ctx().set_groups_list("P-521").unwrap();
+    let s = client.connect();
+    let peer_temp = s.ssl().peer_tmp_key();
+    assert!(peer_temp.is_err());
+
+    // this is the temp key that the client sent in the initial key share
+    let local_temp = s.ssl().tmp_key().unwrap();
+    assert_eq!(local_temp.id(), Id::EC);
+    assert_eq!(local_temp.bits(), 521);
+}
+
+/// Tests that when both the client as well as the server use SRTP and their
+/// lists of supported protocols have an overlap -- with only ONE protocol
+/// being valid for both.
+#[test]
+fn test_connect_with_srtp_ctx() {
+    let listener = TcpListener::bind("127.0.0.1:0").unwrap();
+    let addr = listener.local_addr().unwrap();
+
+    let guard = thread::spawn(move || {
+        let stream = listener.accept().unwrap().0;
+        let mut ctx = SslContext::builder(SslMethod::dtls()).unwrap();
+        ctx.set_tlsext_use_srtp("SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32")
+            .unwrap();
+        ctx.set_certificate_file(Path::new("test/cert.pem"), SslFiletype::PEM)
+            .unwrap();
+        ctx.set_private_key_file(Path::new("test/key.pem"), SslFiletype::PEM)
+            .unwrap();
+        let mut ssl = Ssl::new(&ctx.build()).unwrap();
+        ssl.set_mtu(1500).unwrap();
+        let mut stream = ssl.accept(stream).unwrap();
+
+        let mut buf = [0; 60];
+        stream
+            .ssl()
+            .export_keying_material(&mut buf, "EXTRACTOR-dtls_srtp", None)
+            .unwrap();
+
+        stream.write_all(&[0]).unwrap();
+
+        buf
+    });
+
+    let stream = TcpStream::connect(addr).unwrap();
+    let mut ctx = SslContext::builder(SslMethod::dtls()).unwrap();
+    ctx.set_tlsext_use_srtp("SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32")
+        .unwrap();
+    let mut ssl = Ssl::new(&ctx.build()).unwrap();
+    ssl.set_mtu(1500).unwrap();
+    let mut stream = ssl.connect(stream).unwrap();
+
+    let mut buf = [1; 60];
+    {
+        let srtp_profile = stream.ssl().selected_srtp_profile().unwrap();
+        assert_eq!("SRTP_AES128_CM_SHA1_80", srtp_profile.name());
+        assert_eq!(SrtpProfileId::SRTP_AES128_CM_SHA1_80, srtp_profile.id());
+    }
+    stream
+        .ssl()
+        .export_keying_material(&mut buf, "EXTRACTOR-dtls_srtp", None)
+        .expect("extract");
+
+    stream.read_exact(&mut [0]).unwrap();
+
+    let buf2 = guard.join().unwrap();
+
+    assert_eq!(buf[..], buf2[..]);
+}
+
+/// Tests that when both the client as well as the server use SRTP and their
+/// lists of supported protocols have an overlap -- with only ONE protocol
+/// being valid for both.
+#[test]
+fn test_connect_with_srtp_ssl() {
+    let listener = TcpListener::bind("127.0.0.1:0").unwrap();
+    let addr = listener.local_addr().unwrap();
+
+    let guard = thread::spawn(move || {
+        let stream = listener.accept().unwrap().0;
+        let mut ctx = SslContext::builder(SslMethod::dtls()).unwrap();
+        ctx.set_certificate_file(Path::new("test/cert.pem"), SslFiletype::PEM)
+            .unwrap();
+        ctx.set_private_key_file(Path::new("test/key.pem"), SslFiletype::PEM)
+            .unwrap();
+        let mut ssl = Ssl::new(&ctx.build()).unwrap();
+        ssl.set_tlsext_use_srtp("SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32")
+            .unwrap();
+        let mut profilenames = String::new();
+        for profile in ssl.srtp_profiles().unwrap() {
+            if !profilenames.is_empty() {
+                profilenames.push(':');
+            }
+            profilenames += profile.name();
+        }
+        assert_eq!(
+            "SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32",
+            profilenames
+        );
+        ssl.set_mtu(1500).unwrap();
+        let mut stream = ssl.accept(stream).unwrap();
+
+        let mut buf = [0; 60];
+        stream
+            .ssl()
+            .export_keying_material(&mut buf, "EXTRACTOR-dtls_srtp", None)
+            .unwrap();
+
+        stream.write_all(&[0]).unwrap();
+
+        buf
+    });
+
+    let stream = TcpStream::connect(addr).unwrap();
+    let ctx = SslContext::builder(SslMethod::dtls()).unwrap();
+    let mut ssl = Ssl::new(&ctx.build()).unwrap();
+    ssl.set_tlsext_use_srtp("SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32")
+        .unwrap();
+    ssl.set_mtu(1500).unwrap();
+    let mut stream = ssl.connect(stream).unwrap();
+
+    let mut buf = [1; 60];
+    {
+        let srtp_profile = stream.ssl().selected_srtp_profile().unwrap();
+        assert_eq!("SRTP_AES128_CM_SHA1_80", srtp_profile.name());
+        assert_eq!(SrtpProfileId::SRTP_AES128_CM_SHA1_80, srtp_profile.id());
+    }
+    stream
+        .ssl()
+        .export_keying_material(&mut buf, "EXTRACTOR-dtls_srtp", None)
+        .expect("extract");
+
+    stream.read_exact(&mut [0]).unwrap();
+
+    let buf2 = guard.join().unwrap();
+
+    assert_eq!(buf[..], buf2[..]);
+}
+
+/// Tests that when the `SslStream` is created as a server stream, the protocols
+/// are correctly advertised to the client.
+#[test]
+#[cfg(any(ossl102, libressl261))]
+fn test_alpn_server_advertise_multiple() {
+    let mut server = Server::builder();
+    server.ctx().set_alpn_select_callback(|_, client| {
+        ssl::select_next_proto(b"\x08http/1.1\x08spdy/3.1", client).ok_or(ssl::AlpnError::NOACK)
+    });
+    let server = server.build();
+
+    let mut client = server.client();
+    client.ctx().set_alpn_protos(b"\x08spdy/3.1").unwrap();
+    let s = client.connect();
+    assert_eq!(s.ssl().selected_alpn_protocol(), Some(&b"spdy/3.1"[..]));
+}
+
+#[test]
+#[cfg(ossl110)]
+fn test_alpn_server_select_none_fatal() {
+    let mut server = Server::builder();
+    server.ctx().set_alpn_select_callback(|_, client| {
+        ssl::select_next_proto(b"\x08http/1.1\x08spdy/3.1", client)
+            .ok_or(ssl::AlpnError::ALERT_FATAL)
+    });
+    server.should_error();
+    let server = server.build();
+
+    let mut client = server.client();
+    client.ctx().set_alpn_protos(b"\x06http/2").unwrap();
+    client.connect_err();
+}
+
+#[test]
+#[cfg(any(ossl102, libressl261))]
+fn test_alpn_server_select_none() {
+    static CALLED_BACK: AtomicBool = AtomicBool::new(false);
+
+    let mut server = Server::builder();
+    server.ctx().set_alpn_select_callback(|_, client| {
+        CALLED_BACK.store(true, Ordering::SeqCst);
+        ssl::select_next_proto(b"\x08http/1.1\x08spdy/3.1", client).ok_or(ssl::AlpnError::NOACK)
+    });
+    let server = server.build();
+
+    let mut client = server.client();
+    client.ctx().set_alpn_protos(b"\x06http/2").unwrap();
+    let s = client.connect();
+    assert_eq!(None, s.ssl().selected_alpn_protocol());
+    assert!(CALLED_BACK.load(Ordering::SeqCst));
+}
+
+#[test]
+#[cfg(any(boringssl, ossl102, libressl261))]
+fn test_alpn_server_unilateral() {
+    let server = Server::builder().build();
+
+    let mut client = server.client();
+    client.ctx().set_alpn_protos(b"\x06http/2").unwrap();
+    let s = client.connect();
+    assert_eq!(None, s.ssl().selected_alpn_protocol());
+}
+
+#[test]
+#[should_panic(expected = "blammo")]
+fn write_panic() {
+    struct ExplodingStream(TcpStream);
+
+    impl Read for ExplodingStream {
+        fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
+            self.0.read(buf)
+        }
+    }
+
+    impl Write for ExplodingStream {
+        fn write(&mut self, _: &[u8]) -> io::Result<usize> {
+            panic!("blammo");
+        }
+
+        fn flush(&mut self) -> io::Result<()> {
+            self.0.flush()
+        }
+    }
+
+    let mut server = Server::builder();
+    server.should_error();
+    let server = server.build();
+
+    let stream = ExplodingStream(server.connect_tcp());
+
+    let ctx = SslContext::builder(SslMethod::tls()).unwrap();
+    let _ = Ssl::new(&ctx.build()).unwrap().connect(stream);
+}
+
+#[test]
+#[should_panic(expected = "blammo")]
+fn read_panic() {
+    struct ExplodingStream(TcpStream);
+
+    impl Read for ExplodingStream {
+        fn read(&mut self, _: &mut [u8]) -> io::Result<usize> {
+            panic!("blammo");
+        }
+    }
+
+    impl Write for ExplodingStream {
+        fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
+            self.0.write(buf)
+        }
+
+        fn flush(&mut self) -> io::Result<()> {
+            self.0.flush()
+        }
+    }
+
+    let mut server = Server::builder();
+    server.should_error();
+    let server = server.build();
+
+    let stream = ExplodingStream(server.connect_tcp());
+
+    let ctx = SslContext::builder(SslMethod::tls()).unwrap();
+    let _ = Ssl::new(&ctx.build()).unwrap().connect(stream);
+}
+
+#[test]
+#[cfg_attr(all(libressl321, not(libressl340)), ignore)]
+#[should_panic(expected = "blammo")]
+fn flush_panic() {
+    struct ExplodingStream(TcpStream);
+
+    impl Read for ExplodingStream {
+        fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
+            self.0.read(buf)
+        }
+    }
+
+    impl Write for ExplodingStream {
+        fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
+            self.0.write(buf)
+        }
+
+        fn flush(&mut self) -> io::Result<()> {
+            panic!("blammo");
+        }
+    }
+
+    let mut server = Server::builder();
+    server.should_error();
+    let server = server.build();
+
+    let stream = ExplodingStream(server.connect_tcp());
+
+    let ctx = SslContext::builder(SslMethod::tls()).unwrap();
+    let _ = Ssl::new(&ctx.build()).unwrap().connect(stream);
+}
+
+#[test]
+fn refcount_ssl_context() {
+    let mut ssl = {
+        let ctx = SslContext::builder(SslMethod::tls()).unwrap();
+        ssl::Ssl::new(&ctx.build()).unwrap()
+    };
+
+    {
+        let new_ctx_a = SslContext::builder(SslMethod::tls()).unwrap().build();
+        ssl.set_ssl_context(&new_ctx_a).unwrap();
+    }
+}
+
+#[test]
+#[cfg_attr(libressl250, ignore)]
+#[cfg_attr(target_os = "windows", ignore)]
+#[cfg_attr(all(target_os = "macos", feature = "vendored"), ignore)]
+fn default_verify_paths() {
+    let mut ctx = SslContext::builder(SslMethod::tls()).unwrap();
+    ctx.set_default_verify_paths().unwrap();
+    ctx.set_verify(SslVerifyMode::PEER);
+    let ctx = ctx.build();
+    let s = match TcpStream::connect("google.com:443") {
+        Ok(s) => s,
+        Err(_) => return,
+    };
+    let mut ssl = Ssl::new(&ctx).unwrap();
+    ssl.set_hostname("google.com").unwrap();
+    let mut socket = ssl.connect(s).unwrap();
+
+    socket.write_all(b"GET / HTTP/1.0\r\n\r\n").unwrap();
+    let mut result = vec![];
+    socket.read_to_end(&mut result).unwrap();
+
+    println!("{}", String::from_utf8_lossy(&result));
+    assert!(result.starts_with(b"HTTP/1.0"));
+    assert!(result.ends_with(b"</HTML>\r\n") || result.ends_with(b"</html>"));
+}
+
+#[test]
+fn add_extra_chain_cert() {
+    let cert = X509::from_pem(CERT).unwrap();
+    let mut ctx = SslContext::builder(SslMethod::tls()).unwrap();
+    ctx.add_extra_chain_cert(cert).unwrap();
+}
+
+#[test]
+#[cfg(ossl102)]
+fn verify_valid_hostname() {
+    let server = Server::builder().build();
+
+    let mut client = server.client();
+    client.ctx().set_ca_file("test/root-ca.pem").unwrap();
+    client.ctx().set_verify(SslVerifyMode::PEER);
+
+    let mut client = client.build().builder();
+    client
+        .ssl()
+        .param_mut()
+        .set_hostflags(X509CheckFlags::NO_PARTIAL_WILDCARDS);
+    client.ssl().param_mut().set_host("foobar.com").unwrap();
+    client.connect();
+}
+
+#[test]
+#[cfg(ossl102)]
+fn verify_invalid_hostname() {
+    let mut server = Server::builder();
+    server.should_error();
+    let server = server.build();
+
+    let mut client = server.client();
+    client.ctx().set_ca_file("test/root-ca.pem").unwrap();
+    client.ctx().set_verify(SslVerifyMode::PEER);
+
+    let mut client = client.build().builder();
+    client
+        .ssl()
+        .param_mut()
+        .set_hostflags(X509CheckFlags::NO_PARTIAL_WILDCARDS);
+    client.ssl().param_mut().set_host("bogus.com").unwrap();
+    client.connect_err();
+}
+
+#[test]
+fn connector_valid_hostname() {
+    let server = Server::builder().build();
+
+    let mut connector = SslConnector::builder(SslMethod::tls()).unwrap();
+    connector.set_ca_file("test/root-ca.pem").unwrap();
+
+    let s = server.connect_tcp();
+    let mut s = connector.build().connect("foobar.com", s).unwrap();
+    s.read_exact(&mut [0]).unwrap();
+}
+
+#[test]
+fn connector_invalid_hostname() {
+    let mut server = Server::builder();
+    server.should_error();
+    let server = server.build();
+
+    let mut connector = SslConnector::builder(SslMethod::tls()).unwrap();
+    connector.set_ca_file("test/root-ca.pem").unwrap();
+
+    let s = server.connect_tcp();
+    connector.build().connect("bogus.com", s).unwrap_err();
+}
+
+#[test]
+fn connector_invalid_no_hostname_verification() {
+    let server = Server::builder().build();
+
+    let mut connector = SslConnector::builder(SslMethod::tls()).unwrap();
+    connector.set_ca_file("test/root-ca.pem").unwrap();
+
+    let s = server.connect_tcp();
+    let mut s = connector
+        .build()
+        .configure()
+        .unwrap()
+        .verify_hostname(false)
+        .connect("bogus.com", s)
+        .unwrap();
+    s.read_exact(&mut [0]).unwrap();
+}
+
+#[test]
+fn connector_no_hostname_still_verifies() {
+    let mut server = Server::builder();
+    server.should_error();
+    let server = server.build();
+
+    let connector = SslConnector::builder(SslMethod::tls()).unwrap().build();
+
+    let s = server.connect_tcp();
+    assert!(connector
+        .configure()
+        .unwrap()
+        .verify_hostname(false)
+        .connect("fizzbuzz.com", s)
+        .is_err());
+}
+
+#[test]
+fn connector_can_disable_verify() {
+    let server = Server::builder().build();
+
+    let mut connector = SslConnector::builder(SslMethod::tls()).unwrap();
+    connector.set_verify(SslVerifyMode::NONE);
+    let connector = connector.build();
+
+    let s = server.connect_tcp();
+    let mut s = connector
+        .configure()
+        .unwrap()
+        .connect("fizzbuzz.com", s)
+        .unwrap();
+    s.read_exact(&mut [0]).unwrap();
+}
+
+#[test]
+fn connector_does_use_sni_with_dnsnames() {
+    static CALLED_BACK: AtomicBool = AtomicBool::new(false);
+
+    let mut builder = Server::builder();
+    builder.ctx().set_servername_callback(|ssl, _| {
+        assert_eq!(ssl.servername(NameType::HOST_NAME), Some("foobar.com"));
+        CALLED_BACK.store(true, Ordering::SeqCst);
+        Ok(())
+    });
+    let server = builder.build();
+
+    let mut connector = SslConnector::builder(SslMethod::tls()).unwrap();
+    connector.set_ca_file("test/root-ca.pem").unwrap();
+
+    let s = server.connect_tcp();
+    let mut s = connector
+        .build()
+        .configure()
+        .unwrap()
+        .connect("foobar.com", s)
+        .unwrap();
+    s.read_exact(&mut [0]).unwrap();
+
+    assert!(CALLED_BACK.load(Ordering::SeqCst));
+}
+
+#[test]
+fn connector_doesnt_use_sni_with_ips() {
+    static CALLED_BACK: AtomicBool = AtomicBool::new(false);
+
+    let mut builder = Server::builder();
+    builder.ctx().set_servername_callback(|ssl, _| {
+        assert_eq!(ssl.servername(NameType::HOST_NAME), None);
+        CALLED_BACK.store(true, Ordering::SeqCst);
+        Ok(())
+    });
+    let server = builder.build();
+
+    let mut connector = SslConnector::builder(SslMethod::tls()).unwrap();
+    // The server's cert isn't issued for 127.0.0.1 but we don't care for this test.
+    connector.set_verify(SslVerifyMode::NONE);
+
+    let s = server.connect_tcp();
+    let mut s = connector
+        .build()
+        .configure()
+        .unwrap()
+        .connect("127.0.0.1", s)
+        .unwrap();
+    s.read_exact(&mut [0]).unwrap();
+
+    assert!(CALLED_BACK.load(Ordering::SeqCst));
+}
+
+fn test_mozilla_server(new: fn(SslMethod) -> Result<SslAcceptorBuilder, ErrorStack>) {
+    let listener = TcpListener::bind("127.0.0.1:0").unwrap();
+    let port = listener.local_addr().unwrap().port();
+
+    let t = thread::spawn(move || {
+        let key = PKey::private_key_from_pem(KEY).unwrap();
+        let cert = X509::from_pem(CERT).unwrap();
+        let mut acceptor = new(SslMethod::tls()).unwrap();
+        acceptor.set_private_key(&key).unwrap();
+        acceptor.set_certificate(&cert).unwrap();
+        let acceptor = acceptor.build();
+        let stream = listener.accept().unwrap().0;
+        let mut stream = acceptor.accept(stream).unwrap();
+
+        stream.write_all(b"hello").unwrap();
+    });
+
+    let mut connector = SslConnector::builder(SslMethod::tls()).unwrap();
+    connector.set_ca_file("test/root-ca.pem").unwrap();
+    let connector = connector.build();
+
+    let stream = TcpStream::connect(("127.0.0.1", port)).unwrap();
+    let mut stream = connector.connect("foobar.com", stream).unwrap();
+
+    let mut buf = [0; 5];
+    stream.read_exact(&mut buf).unwrap();
+    assert_eq!(b"hello", &buf);
+
+    t.join().unwrap();
+}
+
+#[test]
+fn connector_client_server_mozilla_intermediate() {
+    test_mozilla_server(SslAcceptor::mozilla_intermediate);
+}
+
+#[test]
+fn connector_client_server_mozilla_modern() {
+    test_mozilla_server(SslAcceptor::mozilla_modern);
+}
+
+#[test]
+fn connector_client_server_mozilla_intermediate_v5() {
+    test_mozilla_server(SslAcceptor::mozilla_intermediate_v5);
+}
+
+#[test]
+#[cfg(any(ossl111, libressl340))]
+fn connector_client_server_mozilla_modern_v5() {
+    test_mozilla_server(SslAcceptor::mozilla_modern_v5);
+}
+
+#[test]
+fn shutdown() {
+    let mut server = Server::builder();
+    server.io_cb(|mut s| {
+        assert_eq!(s.read(&mut [0]).unwrap(), 0);
+        assert_eq!(s.shutdown().unwrap(), ShutdownResult::Received);
+    });
+    let server = server.build();
+
+    let mut s = server.client().connect();
+
+    assert_eq!(s.get_shutdown(), ShutdownState::empty());
+    assert_eq!(s.shutdown().unwrap(), ShutdownResult::Sent);
+    assert_eq!(s.get_shutdown(), ShutdownState::SENT);
+    assert_eq!(s.shutdown().unwrap(), ShutdownResult::Received);
+    assert_eq!(
+        s.get_shutdown(),
+        ShutdownState::SENT | ShutdownState::RECEIVED
+    );
+}
+
+#[test]
+fn client_ca_list() {
+    let names = X509Name::load_client_ca_file("test/root-ca.pem").unwrap();
+    assert_eq!(names.len(), 1);
+
+    let mut ctx = SslContext::builder(SslMethod::tls()).unwrap();
+    ctx.set_client_ca_list(names);
+}
+
+#[test]
+fn cert_store() {
+    let server = Server::builder().build();
+
+    let mut client = server.client();
+    let cert = X509::from_pem(ROOT_CERT).unwrap();
+    client.ctx().cert_store_mut().add_cert(cert).unwrap();
+    client.ctx().set_verify(SslVerifyMode::PEER);
+
+    client.connect();
+}
+
+#[test]
+#[cfg_attr(any(all(libressl321, not(libressl340)), boringssl), ignore)]
+fn tmp_dh_callback() {
+    static CALLED_BACK: AtomicBool = AtomicBool::new(false);
+
+    let mut server = Server::builder();
+    server.ctx().set_tmp_dh_callback(|_, _, _| {
+        CALLED_BACK.store(true, Ordering::SeqCst);
+        let dh = include_bytes!("../../../test/dhparams.pem");
+        Dh::params_from_pem(dh)
+    });
+
+    let server = server.build();
+
+    let mut client = server.client();
+    // TLS 1.3 has no DH suites, so make sure we don't pick that version
+    #[cfg(any(ossl111, libressl340))]
+    client.ctx().set_options(super::SslOptions::NO_TLSV1_3);
+    client.ctx().set_cipher_list("EDH").unwrap();
+    client.connect();
+
+    assert!(CALLED_BACK.load(Ordering::SeqCst));
+}
+
+#[test]
+#[cfg(all(ossl101, not(ossl110)))]
+#[allow(deprecated)]
+fn tmp_ecdh_callback() {
+    use crate::ec::EcKey;
+    use crate::nid::Nid;
+
+    static CALLED_BACK: AtomicBool = AtomicBool::new(false);
+
+    let mut server = Server::builder();
+    server.ctx().set_tmp_ecdh_callback(|_, _, _| {
+        CALLED_BACK.store(true, Ordering::SeqCst);
+        EcKey::from_curve_name(Nid::X9_62_PRIME256V1)
+    });
+
+    let server = server.build();
+
+    let mut client = server.client();
+    client.ctx().set_cipher_list("ECDH").unwrap();
+    client.connect();
+
+    assert!(CALLED_BACK.load(Ordering::SeqCst));
+}
+
+#[test]
+#[cfg_attr(any(all(libressl321, not(libressl340)), boringssl), ignore)]
+fn tmp_dh_callback_ssl() {
+    static CALLED_BACK: AtomicBool = AtomicBool::new(false);
+
+    let mut server = Server::builder();
+    server.ssl_cb(|ssl| {
+        ssl.set_tmp_dh_callback(|_, _, _| {
+            CALLED_BACK.store(true, Ordering::SeqCst);
+            let dh = include_bytes!("../../../test/dhparams.pem");
+            Dh::params_from_pem(dh)
+        });
+    });
+
+    let server = server.build();
+
+    let mut client = server.client();
+    // TLS 1.3 has no DH suites, so make sure we don't pick that version
+    #[cfg(any(ossl111, libressl340))]
+    client.ctx().set_options(super::SslOptions::NO_TLSV1_3);
+    client.ctx().set_cipher_list("EDH").unwrap();
+    client.connect();
+
+    assert!(CALLED_BACK.load(Ordering::SeqCst));
+}
+
+#[test]
+#[cfg(all(ossl101, not(ossl110)))]
+#[allow(deprecated)]
+fn tmp_ecdh_callback_ssl() {
+    use crate::ec::EcKey;
+    use crate::nid::Nid;
+
+    static CALLED_BACK: AtomicBool = AtomicBool::new(false);
+
+    let mut server = Server::builder();
+    server.ssl_cb(|ssl| {
+        ssl.set_tmp_ecdh_callback(|_, _, _| {
+            CALLED_BACK.store(true, Ordering::SeqCst);
+            EcKey::from_curve_name(Nid::X9_62_PRIME256V1)
+        });
+    });
+
+    let server = server.build();
+
+    let mut client = server.client();
+    client.ctx().set_cipher_list("ECDH").unwrap();
+    client.connect();
+
+    assert!(CALLED_BACK.load(Ordering::SeqCst));
+}
+
+#[test]
+fn idle_session() {
+    let ctx = SslContext::builder(SslMethod::tls()).unwrap().build();
+    let ssl = Ssl::new(&ctx).unwrap();
+    assert!(ssl.session().is_none());
+}
+
+/// LibreSSL 3.2.1 enabled TLSv1.3 by default for clients and sessions do
+/// not work due to lack of PSK support. The test passes with NO_TLSV1_3,
+/// but let's ignore it until LibreSSL supports it out of the box.
+#[test]
+#[cfg_attr(libressl321, ignore)]
+fn active_session() {
+    let server = Server::builder().build();
+
+    let s = server.client().connect();
+
+    let session = s.ssl().session().unwrap();
+    let len = session.master_key_len();
+    let mut buf = vec![0; len - 1];
+    let copied = session.master_key(&mut buf);
+    assert_eq!(copied, buf.len());
+    let mut buf = vec![0; len + 1];
+    let copied = session.master_key(&mut buf);
+    assert_eq!(copied, len);
+}
+
+#[test]
+#[cfg(not(boringssl))]
+fn status_callbacks() {
+    static CALLED_BACK_SERVER: AtomicBool = AtomicBool::new(false);
+    static CALLED_BACK_CLIENT: AtomicBool = AtomicBool::new(false);
+
+    let mut server = Server::builder();
+    server
+        .ctx()
+        .set_status_callback(|ssl| {
+            CALLED_BACK_SERVER.store(true, Ordering::SeqCst);
+            let response = OcspResponse::create(OcspResponseStatus::UNAUTHORIZED, None).unwrap();
+            let response = response.to_der().unwrap();
+            ssl.set_ocsp_status(&response).unwrap();
+            Ok(true)
+        })
+        .unwrap();
+
+    let server = server.build();
+
+    let mut client = server.client();
+    client
+        .ctx()
+        .set_status_callback(|ssl| {
+            CALLED_BACK_CLIENT.store(true, Ordering::SeqCst);
+            let response = OcspResponse::from_der(ssl.ocsp_status().unwrap()).unwrap();
+            assert_eq!(response.status(), OcspResponseStatus::UNAUTHORIZED);
+            Ok(true)
+        })
+        .unwrap();
+
+    let mut client = client.build().builder();
+    client.ssl().set_status_type(StatusType::OCSP).unwrap();
+
+    client.connect();
+
+    assert!(CALLED_BACK_SERVER.load(Ordering::SeqCst));
+    assert!(CALLED_BACK_CLIENT.load(Ordering::SeqCst));
+}
+
+/// LibreSSL 3.2.1 enabled TLSv1.3 by default for clients and sessions do
+/// not work due to lack of PSK support. The test passes with NO_TLSV1_3,
+/// but let's ignore it until LibreSSL supports it out of the box.
+#[test]
+#[cfg_attr(libressl321, ignore)]
+fn new_session_callback() {
+    static CALLED_BACK: AtomicBool = AtomicBool::new(false);
+
+    let mut server = Server::builder();
+    server.ctx().set_session_id_context(b"foo").unwrap();
+
+    let server = server.build();
+
+    let mut client = server.client();
+
+    client
+        .ctx()
+        .set_session_cache_mode(SslSessionCacheMode::CLIENT | SslSessionCacheMode::NO_INTERNAL);
+    client
+        .ctx()
+        .set_new_session_callback(|_, _| CALLED_BACK.store(true, Ordering::SeqCst));
+
+    client.connect();
+
+    assert!(CALLED_BACK.load(Ordering::SeqCst));
+}
+
+/// LibreSSL 3.2.1 enabled TLSv1.3 by default for clients and sessions do
+/// not work due to lack of PSK support. The test passes with NO_TLSV1_3,
+/// but let's ignore it until LibreSSL supports it out of the box.
+#[test]
+#[cfg_attr(libressl321, ignore)]
+fn new_session_callback_swapped_ctx() {
+    static CALLED_BACK: AtomicBool = AtomicBool::new(false);
+
+    let mut server = Server::builder();
+    server.ctx().set_session_id_context(b"foo").unwrap();
+
+    let server = server.build();
+
+    let mut client = server.client();
+
+    client
+        .ctx()
+        .set_session_cache_mode(SslSessionCacheMode::CLIENT | SslSessionCacheMode::NO_INTERNAL);
+    client
+        .ctx()
+        .set_new_session_callback(|_, _| CALLED_BACK.store(true, Ordering::SeqCst));
+
+    let mut client = client.build().builder();
+
+    let ctx = SslContextBuilder::new(SslMethod::tls()).unwrap().build();
+    client.ssl().set_ssl_context(&ctx).unwrap();
+
+    client.connect();
+
+    assert!(CALLED_BACK.load(Ordering::SeqCst));
+}
+
+#[test]
+fn keying_export() {
+    let listener = TcpListener::bind("127.0.0.1:0").unwrap();
+    let addr = listener.local_addr().unwrap();
+
+    let label = "EXPERIMENTAL test";
+    let context = b"my context";
+
+    let guard = thread::spawn(move || {
+        let stream = listener.accept().unwrap().0;
+        let mut ctx = SslContext::builder(SslMethod::tls()).unwrap();
+        ctx.set_certificate_file(Path::new("test/cert.pem"), SslFiletype::PEM)
+            .unwrap();
+        ctx.set_private_key_file(Path::new("test/key.pem"), SslFiletype::PEM)
+            .unwrap();
+        let ssl = Ssl::new(&ctx.build()).unwrap();
+        let mut stream = ssl.accept(stream).unwrap();
+
+        let mut buf = [0; 32];
+        stream
+            .ssl()
+            .export_keying_material(&mut buf, label, Some(context))
+            .unwrap();
+
+        stream.write_all(&[0]).unwrap();
+
+        buf
+    });
+
+    let stream = TcpStream::connect(addr).unwrap();
+    let ctx = SslContext::builder(SslMethod::tls()).unwrap();
+    let ssl = Ssl::new(&ctx.build()).unwrap();
+    let mut stream = ssl.connect(stream).unwrap();
+
+    let mut buf = [1; 32];
+    stream
+        .ssl()
+        .export_keying_material(&mut buf, label, Some(context))
+        .unwrap();
+
+    stream.read_exact(&mut [0]).unwrap();
+
+    let buf2 = guard.join().unwrap();
+
+    assert_eq!(buf, buf2);
+}
+
+#[test]
+#[cfg(any(ossl110, libressl261))]
+fn no_version_overlap() {
+    let mut server = Server::builder();
+    server.ctx().set_min_proto_version(None).unwrap();
+    server
+        .ctx()
+        .set_max_proto_version(Some(SslVersion::TLS1_1))
+        .unwrap();
+    #[cfg(any(ossl110g, libressl270))]
+    assert_eq!(server.ctx().max_proto_version(), Some(SslVersion::TLS1_1));
+    server.should_error();
+    let server = server.build();
+
+    let mut client = server.client();
+    client
+        .ctx()
+        .set_min_proto_version(Some(SslVersion::TLS1_2))
+        .unwrap();
+    #[cfg(ossl110g)]
+    assert_eq!(client.ctx().min_proto_version(), Some(SslVersion::TLS1_2));
+    client.ctx().set_max_proto_version(None).unwrap();
+
+    client.connect_err();
+}
+
+#[test]
+#[cfg(ossl111)]
+fn custom_extensions() {
+    static FOUND_EXTENSION: AtomicBool = AtomicBool::new(false);
+
+    let mut server = Server::builder();
+    server
+        .ctx()
+        .add_custom_ext(
+            12345,
+            ExtensionContext::CLIENT_HELLO,
+            |_, _, _| -> Result<Option<&'static [u8]>, _> { unreachable!() },
+            |_, _, data, _| {
+                FOUND_EXTENSION.store(data == b"hello", Ordering::SeqCst);
+                Ok(())
+            },
+        )
+        .unwrap();
+
+    let server = server.build();
+
+    let mut client = server.client();
+    client
+        .ctx()
+        .add_custom_ext(
+            12345,
+            ssl::ExtensionContext::CLIENT_HELLO,
+            |_, _, _| Ok(Some(b"hello")),
+            |_, _, _, _| unreachable!(),
+        )
+        .unwrap();
+
+    client.connect();
+
+    assert!(FOUND_EXTENSION.load(Ordering::SeqCst));
+}
+
+fn _check_kinds() {
+    fn is_send<T: Send>() {}
+    fn is_sync<T: Sync>() {}
+
+    is_send::<SslStream<TcpStream>>();
+    is_sync::<SslStream<TcpStream>>();
+}
+
+#[test]
+#[cfg(ossl111)]
+fn stateless() {
+    use super::SslOptions;
+
+    #[derive(Debug)]
+    struct MemoryStream {
+        incoming: io::Cursor<Vec<u8>>,
+        outgoing: Vec<u8>,
+    }
+
+    impl MemoryStream {
+        pub fn new() -> Self {
+            Self {
+                incoming: io::Cursor::new(Vec::new()),
+                outgoing: Vec::new(),
+            }
+        }
+
+        pub fn extend_incoming(&mut self, data: &[u8]) {
+            self.incoming.get_mut().extend_from_slice(data);
+        }
+
+        pub fn take_outgoing(&mut self) -> Outgoing<'_> {
+            Outgoing(&mut self.outgoing)
+        }
+    }
+
+    impl Read for MemoryStream {
+        fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
+            let n = self.incoming.read(buf)?;
+            if self.incoming.position() == self.incoming.get_ref().len() as u64 {
+                self.incoming.set_position(0);
+                self.incoming.get_mut().clear();
+            }
+            if n == 0 {
+                return Err(io::Error::new(
+                    io::ErrorKind::WouldBlock,
+                    "no data available",
+                ));
+            }
+            Ok(n)
+        }
+    }
+
+    impl Write for MemoryStream {
+        fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
+            self.outgoing.write(buf)
+        }
+
+        fn flush(&mut self) -> io::Result<()> {
+            Ok(())
+        }
+    }
+
+    pub struct Outgoing<'a>(&'a mut Vec<u8>);
+
+    impl<'a> Drop for Outgoing<'a> {
+        fn drop(&mut self) {
+            self.0.clear();
+        }
+    }
+
+    impl<'a> ::std::ops::Deref for Outgoing<'a> {
+        type Target = [u8];
+        fn deref(&self) -> &[u8] {
+            self.0
+        }
+    }
+
+    impl<'a> AsRef<[u8]> for Outgoing<'a> {
+        fn as_ref(&self) -> &[u8] {
+            self.0
+        }
+    }
+
+    fn send(from: &mut MemoryStream, to: &mut MemoryStream) {
+        to.extend_incoming(&from.take_outgoing());
+    }
+
+    //
+    // Setup
+    //
+
+    let mut client_ctx = SslContext::builder(SslMethod::tls()).unwrap();
+    client_ctx.clear_options(SslOptions::ENABLE_MIDDLEBOX_COMPAT);
+    let mut client_stream =
+        SslStream::new(Ssl::new(&client_ctx.build()).unwrap(), MemoryStream::new()).unwrap();
+
+    let mut server_ctx = SslContext::builder(SslMethod::tls()).unwrap();
+    server_ctx
+        .set_certificate_file(Path::new("test/cert.pem"), SslFiletype::PEM)
+        .unwrap();
+    server_ctx
+        .set_private_key_file(Path::new("test/key.pem"), SslFiletype::PEM)
+        .unwrap();
+    const COOKIE: &[u8] = b"chocolate chip";
+    server_ctx.set_stateless_cookie_generate_cb(|_tls, buf| {
+        buf[0..COOKIE.len()].copy_from_slice(COOKIE);
+        Ok(COOKIE.len())
+    });
+    server_ctx.set_stateless_cookie_verify_cb(|_tls, buf| buf == COOKIE);
+    let mut server_stream =
+        SslStream::new(Ssl::new(&server_ctx.build()).unwrap(), MemoryStream::new()).unwrap();
+
+    //
+    // Handshake
+    //
+
+    // Initial ClientHello
+    client_stream.connect().unwrap_err();
+    send(client_stream.get_mut(), server_stream.get_mut());
+    // HelloRetryRequest
+    assert!(!server_stream.stateless().unwrap());
+    send(server_stream.get_mut(), client_stream.get_mut());
+    // Second ClientHello
+    client_stream.do_handshake().unwrap_err();
+    send(client_stream.get_mut(), server_stream.get_mut());
+    // OldServerHello
+    assert!(server_stream.stateless().unwrap());
+    server_stream.accept().unwrap_err();
+    send(server_stream.get_mut(), client_stream.get_mut());
+    // Finished
+    client_stream.do_handshake().unwrap();
+    send(client_stream.get_mut(), server_stream.get_mut());
+    server_stream.do_handshake().unwrap();
+}
+
+#[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
+#[test]
+fn psk_ciphers() {
+    const CIPHER: &str = "PSK-AES256-CBC-SHA";
+    const PSK: &[u8] = b"thisisaverysecurekey";
+    const CLIENT_IDENT: &[u8] = b"thisisaclient";
+    static CLIENT_CALLED: AtomicBool = AtomicBool::new(false);
+    static SERVER_CALLED: AtomicBool = AtomicBool::new(false);
+
+    let mut server = Server::builder();
+    server.ctx().set_cipher_list(CIPHER).unwrap();
+    server.ctx().set_psk_server_callback(|_, identity, psk| {
+        assert!(identity.unwrap_or(&[]) == CLIENT_IDENT);
+        psk[..PSK.len()].copy_from_slice(PSK);
+        SERVER_CALLED.store(true, Ordering::SeqCst);
+        Ok(PSK.len())
+    });
+
+    let server = server.build();
+
+    let mut client = server.client();
+    // This test relies on TLS 1.2 suites
+    #[cfg(any(boringssl, ossl111))]
+    client.ctx().set_options(super::SslOptions::NO_TLSV1_3);
+    client.ctx().set_cipher_list(CIPHER).unwrap();
+    client
+        .ctx()
+        .set_psk_client_callback(move |_, _, identity, psk| {
+            identity[..CLIENT_IDENT.len()].copy_from_slice(CLIENT_IDENT);
+            identity[CLIENT_IDENT.len()] = 0;
+            psk[..PSK.len()].copy_from_slice(PSK);
+            CLIENT_CALLED.store(true, Ordering::SeqCst);
+            Ok(PSK.len())
+        });
+
+    client.connect();
+
+    assert!(SERVER_CALLED.load(Ordering::SeqCst));
+    assert!(CLIENT_CALLED.load(Ordering::SeqCst));
+}
+
+#[test]
+fn sni_callback_swapped_ctx() {
+    static CALLED_BACK: AtomicBool = AtomicBool::new(false);
+
+    let mut server = Server::builder();
+
+    let mut ctx = SslContext::builder(SslMethod::tls()).unwrap();
+    ctx.set_servername_callback(|_, _| {
+        CALLED_BACK.store(true, Ordering::SeqCst);
+        Ok(())
+    });
+
+    let keyed_ctx = mem::replace(server.ctx(), ctx).build();
+    server.ssl_cb(move |ssl| ssl.set_ssl_context(&keyed_ctx).unwrap());
+
+    let server = server.build();
+
+    server.client().connect();
+
+    assert!(CALLED_BACK.load(Ordering::SeqCst));
+}
+
+#[test]
+#[cfg(ossl111)]
+fn client_hello() {
+    static CALLED_BACK: AtomicBool = AtomicBool::new(false);
+
+    let mut server = Server::builder();
+    server.ctx().set_client_hello_callback(|ssl, _| {
+        assert!(!ssl.client_hello_isv2());
+        assert_eq!(ssl.client_hello_legacy_version(), Some(SslVersion::TLS1_2));
+        assert!(ssl.client_hello_random().is_some());
+        assert!(ssl.client_hello_session_id().is_some());
+        assert!(ssl.client_hello_ciphers().is_some());
+        assert!(ssl.client_hello_compression_methods().is_some());
+        assert!(ssl
+            .bytes_to_cipher_list(ssl.client_hello_ciphers().unwrap(), ssl.client_hello_isv2())
+            .is_ok());
+
+        CALLED_BACK.store(true, Ordering::SeqCst);
+        Ok(ClientHelloResponse::SUCCESS)
+    });
+
+    let server = server.build();
+    server.client().connect();
+
+    assert!(CALLED_BACK.load(Ordering::SeqCst));
+}
+
+#[test]
+#[cfg(ossl111)]
+fn openssl_cipher_name() {
+    assert_eq!(
+        super::cipher_name("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384"),
+        "ECDHE-RSA-AES256-SHA384",
+    );
+
+    assert_eq!(super::cipher_name("asdf"), "(NONE)");
+}
+
+#[test]
+fn session_cache_size() {
+    let mut ctx = SslContext::builder(SslMethod::tls()).unwrap();
+    ctx.set_session_cache_size(1234);
+    let ctx = ctx.build();
+    assert_eq!(ctx.session_cache_size(), 1234);
+}
+
+#[test]
+#[cfg(ossl102)]
+fn add_chain_cert() {
+    let ctx = SslContext::builder(SslMethod::tls()).unwrap().build();
+    let cert = X509::from_pem(CERT).unwrap();
+    let mut ssl = Ssl::new(&ctx).unwrap();
+    assert!(ssl.add_chain_cert(cert).is_ok());
+}
+#[test]
+#[cfg(ossl111)]
+fn set_ssl_certificate_key_related_api() {
+    let cert_str: &str = include_str!("../../../test/cert.pem");
+    let key_str: &str = include_str!("../../../test/key.pem");
+    let ctx = SslContext::builder(SslMethod::tls()).unwrap().build();
+    let cert_x509 = X509::from_pem(CERT).unwrap();
+    let mut ssl = Ssl::new(&ctx).unwrap();
+    assert!(ssl.set_method(SslMethod::tls()).is_ok());
+    ssl.set_private_key_file("test/key.pem", SslFiletype::PEM)
+        .unwrap();
+    {
+        let pkey = String::from_utf8(
+            ssl.private_key()
+                .unwrap()
+                .private_key_to_pem_pkcs8()
+                .unwrap(),
+        )
+        .unwrap();
+        assert!(pkey.lines().eq(key_str.lines()));
+    }
+    let pkey = PKey::private_key_from_pem(KEY).unwrap();
+    ssl.set_private_key(pkey.as_ref()).unwrap();
+    {
+        let pkey = String::from_utf8(
+            ssl.private_key()
+                .unwrap()
+                .private_key_to_pem_pkcs8()
+                .unwrap(),
+        )
+        .unwrap();
+        assert!(pkey.lines().eq(key_str.lines()));
+    }
+    ssl.set_certificate(cert_x509.as_ref()).unwrap();
+    let cert = String::from_utf8(ssl.certificate().unwrap().to_pem().unwrap()).unwrap();
+    assert!(cert.lines().eq(cert_str.lines()));
+    ssl.add_client_ca(cert_x509.as_ref()).unwrap();
+    ssl.set_min_proto_version(Some(SslVersion::TLS1_2)).unwrap();
+    ssl.set_max_proto_version(Some(SslVersion::TLS1_3)).unwrap();
+    ssl.set_cipher_list("HIGH:!aNULL:!MD5").unwrap();
+    ssl.set_ciphersuites("TLS_AES_128_GCM_SHA256").unwrap();
+    let x509 = X509::from_pem(ROOT_CERT).unwrap();
+    let mut builder = X509StoreBuilder::new().unwrap();
+    builder.add_cert(x509).unwrap();
+    let store = builder.build();
+    ssl.set_verify_cert_store(store).unwrap();
+}
+
+#[test]
+#[cfg(ossl110)]
+fn test_ssl_set_cert_chain_file() {
+    let ctx = SslContext::builder(SslMethod::tls()).unwrap().build();
+    let mut ssl = Ssl::new(&ctx).unwrap();
+    ssl.set_certificate_chain_file("test/cert.pem").unwrap();
+}
+
+#[test]
+#[cfg(ossl111)]
+fn set_num_tickets() {
+    let mut ctx = SslContext::builder(SslMethod::tls_server()).unwrap();
+    ctx.set_num_tickets(3).unwrap();
+    let ctx = ctx.build();
+    assert_eq!(3, ctx.num_tickets());
+
+    let mut ssl = Ssl::new(&ctx).unwrap();
+    ssl.set_num_tickets(5).unwrap();
+    let ssl = ssl;
+    assert_eq!(5, ssl.num_tickets());
+}
+
+#[test]
+#[cfg(ossl110)]
+fn set_security_level() {
+    let mut ctx = SslContext::builder(SslMethod::tls_server()).unwrap();
+    ctx.set_security_level(3);
+    let ctx = ctx.build();
+    assert_eq!(3, ctx.security_level());
+
+    let mut ssl = Ssl::new(&ctx).unwrap();
+    ssl.set_security_level(4);
+    let ssl = ssl;
+    assert_eq!(4, ssl.security_level());
+}
+
+#[test]
+fn ssl_ctx_ex_data_leak() {
+    static DROPS: AtomicUsize = AtomicUsize::new(0);
+
+    struct DropTest;
+
+    impl Drop for DropTest {
+        fn drop(&mut self) {
+            DROPS.fetch_add(1, Ordering::Relaxed);
+        }
+    }
+
+    let idx = SslContext::new_ex_index().unwrap();
+
+    let mut ctx = SslContext::builder(SslMethod::tls()).unwrap();
+    ctx.set_ex_data(idx, DropTest);
+    ctx.set_ex_data(idx, DropTest);
+    assert_eq!(DROPS.load(Ordering::Relaxed), 1);
+
+    drop(ctx);
+    assert_eq!(DROPS.load(Ordering::Relaxed), 2);
+}
+
+#[test]
+fn ssl_ex_data_leak() {
+    static DROPS: AtomicUsize = AtomicUsize::new(0);
+
+    struct DropTest;
+
+    impl Drop for DropTest {
+        fn drop(&mut self) {
+            DROPS.fetch_add(1, Ordering::Relaxed);
+        }
+    }
+
+    let idx = Ssl::new_ex_index().unwrap();
+
+    let ctx = SslContext::builder(SslMethod::tls()).unwrap().build();
+    let mut ssl = Ssl::new(&ctx).unwrap();
+    ssl.set_ex_data(idx, DropTest);
+    ssl.set_ex_data(idx, DropTest);
+    assert_eq!(DROPS.load(Ordering::Relaxed), 1);
+
+    drop(ssl);
+    assert_eq!(DROPS.load(Ordering::Relaxed), 2);
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/ssl/test/server.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/ssl/test/server.rs
--- 43.0.0-1/rust-vendor/openssl/src/ssl/test/server.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/ssl/test/server.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,167 @@
+use std::io::{Read, Write};
+use std::net::{SocketAddr, TcpListener, TcpStream};
+use std::thread::{self, JoinHandle};
+
+use crate::ssl::{Ssl, SslContext, SslContextBuilder, SslFiletype, SslMethod, SslRef, SslStream};
+
+pub struct Server {
+    handle: Option<JoinHandle<()>>,
+    addr: SocketAddr,
+}
+
+impl Drop for Server {
+    fn drop(&mut self) {
+        if !thread::panicking() {
+            self.handle.take().unwrap().join().unwrap();
+        }
+    }
+}
+
+impl Server {
+    pub fn builder() -> Builder {
+        let mut ctx = SslContext::builder(SslMethod::tls()).unwrap();
+        ctx.set_certificate_chain_file("test/cert.pem").unwrap();
+        ctx.set_private_key_file("test/key.pem", SslFiletype::PEM)
+            .unwrap();
+
+        Builder {
+            ctx,
+            ssl_cb: Box::new(|_| {}),
+            io_cb: Box::new(|_| {}),
+            should_error: false,
+        }
+    }
+
+    pub fn client(&self) -> ClientBuilder {
+        ClientBuilder {
+            ctx: SslContext::builder(SslMethod::tls()).unwrap(),
+            addr: self.addr,
+        }
+    }
+
+    pub fn connect_tcp(&self) -> TcpStream {
+        TcpStream::connect(self.addr).unwrap()
+    }
+}
+
+pub struct Builder {
+    ctx: SslContextBuilder,
+    ssl_cb: Box<dyn FnMut(&mut SslRef) + Send>,
+    io_cb: Box<dyn FnMut(SslStream<TcpStream>) + Send>,
+    should_error: bool,
+}
+
+impl Builder {
+    pub fn ctx(&mut self) -> &mut SslContextBuilder {
+        &mut self.ctx
+    }
+
+    pub fn ssl_cb<F>(&mut self, cb: F)
+    where
+        F: 'static + FnMut(&mut SslRef) + Send,
+    {
+        self.ssl_cb = Box::new(cb);
+    }
+
+    pub fn io_cb<F>(&mut self, cb: F)
+    where
+        F: 'static + FnMut(SslStream<TcpStream>) + Send,
+    {
+        self.io_cb = Box::new(cb);
+    }
+
+    pub fn should_error(&mut self) {
+        self.should_error = true;
+    }
+
+    pub fn build(self) -> Server {
+        let ctx = self.ctx.build();
+        let socket = TcpListener::bind("127.0.0.1:0").unwrap();
+        let addr = socket.local_addr().unwrap();
+        let mut ssl_cb = self.ssl_cb;
+        let mut io_cb = self.io_cb;
+        let should_error = self.should_error;
+
+        let handle = thread::spawn(move || {
+            let socket = socket.accept().unwrap().0;
+            let mut ssl = Ssl::new(&ctx).unwrap();
+            ssl_cb(&mut ssl);
+            let r = ssl.accept(socket);
+            if should_error {
+                r.unwrap_err();
+            } else {
+                let mut socket = r.unwrap();
+                socket.write_all(&[0]).unwrap();
+                io_cb(socket);
+            }
+        });
+
+        Server {
+            handle: Some(handle),
+            addr,
+        }
+    }
+}
+
+pub struct ClientBuilder {
+    ctx: SslContextBuilder,
+    addr: SocketAddr,
+}
+
+impl ClientBuilder {
+    pub fn ctx(&mut self) -> &mut SslContextBuilder {
+        &mut self.ctx
+    }
+
+    pub fn build(self) -> Client {
+        Client {
+            ctx: self.ctx.build(),
+            addr: self.addr,
+        }
+    }
+
+    pub fn connect(self) -> SslStream<TcpStream> {
+        self.build().builder().connect()
+    }
+
+    pub fn connect_err(self) {
+        self.build().builder().connect_err();
+    }
+}
+
+pub struct Client {
+    ctx: SslContext,
+    addr: SocketAddr,
+}
+
+impl Client {
+    pub fn builder(&self) -> ClientSslBuilder {
+        ClientSslBuilder {
+            ssl: Ssl::new(&self.ctx).unwrap(),
+            addr: self.addr,
+        }
+    }
+}
+
+pub struct ClientSslBuilder {
+    ssl: Ssl,
+    addr: SocketAddr,
+}
+
+impl ClientSslBuilder {
+    pub fn ssl(&mut self) -> &mut SslRef {
+        &mut self.ssl
+    }
+
+    pub fn connect(self) -> SslStream<TcpStream> {
+        let socket = TcpStream::connect(self.addr).unwrap();
+        let mut s = self.ssl.connect(socket).unwrap();
+        s.read_exact(&mut [0]).unwrap();
+        s
+    }
+
+    pub fn connect_err(self) {
+        let socket = TcpStream::connect(self.addr).unwrap();
+        self.ssl.connect(socket).unwrap_err();
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/stack.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/stack.rs
--- 43.0.0-1/rust-vendor/openssl/src/stack.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/stack.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,380 @@
+use cfg_if::cfg_if;
+use foreign_types::{ForeignType, ForeignTypeRef, Opaque};
+use libc::c_int;
+use std::borrow::Borrow;
+use std::convert::AsRef;
+use std::fmt;
+use std::iter;
+use std::marker::PhantomData;
+use std::mem;
+use std::ops::{Deref, DerefMut, Index, IndexMut, Range};
+
+use crate::error::ErrorStack;
+use crate::util::ForeignTypeExt;
+use crate::{cvt, cvt_p, LenType};
+
+cfg_if! {
+    if #[cfg(any(ossl110, boringssl))] {
+        use ffi::{
+            OPENSSL_sk_pop, OPENSSL_sk_free, OPENSSL_sk_num, OPENSSL_sk_value, OPENSSL_STACK,
+            OPENSSL_sk_new_null, OPENSSL_sk_push,
+        };
+    } else {
+        use ffi::{
+            sk_pop as OPENSSL_sk_pop, sk_free as OPENSSL_sk_free, sk_num as OPENSSL_sk_num,
+            sk_value as OPENSSL_sk_value, _STACK as OPENSSL_STACK,
+            sk_new_null as OPENSSL_sk_new_null, sk_push as OPENSSL_sk_push,
+        };
+    }
+}
+
+/// Trait implemented by types which can be placed in a stack.
+///
+/// It should not be implemented for any type outside of this crate.
+pub trait Stackable: ForeignType {
+    /// The C stack type for this element.
+    ///
+    /// Generally called `stack_st_{ELEMENT_TYPE}`, normally hidden by the
+    /// `STACK_OF(ELEMENT_TYPE)` macro in the OpenSSL API.
+    type StackType;
+}
+
+/// An owned stack of `T`.
+pub struct Stack<T: Stackable>(*mut T::StackType);
+
+unsafe impl<T: Stackable + Send> Send for Stack<T> {}
+unsafe impl<T: Stackable + Sync> Sync for Stack<T> {}
+
+impl<T> fmt::Debug for Stack<T>
+where
+    T: Stackable,
+    T::Ref: fmt::Debug,
+{
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
+        fmt.debug_list().entries(self).finish()
+    }
+}
+impl<T: Stackable> Drop for Stack<T> {
+    fn drop(&mut self) {
+        unsafe {
+            while self.pop().is_some() {}
+            OPENSSL_sk_free(self.0 as *mut _);
+        }
+    }
+}
+
+impl<T: Stackable> Stack<T> {
+    pub fn new() -> Result<Stack<T>, ErrorStack> {
+        unsafe {
+            ffi::init();
+            let ptr = cvt_p(OPENSSL_sk_new_null())?;
+            Ok(Stack(ptr as *mut _))
+        }
+    }
+}
+
+impl<T: Stackable> iter::IntoIterator for Stack<T> {
+    type IntoIter = IntoIter<T>;
+    type Item = T;
+
+    fn into_iter(self) -> IntoIter<T> {
+        let it = IntoIter {
+            stack: self.0,
+            idxs: 0..self.len() as LenType,
+        };
+        mem::forget(self);
+        it
+    }
+}
+
+impl<T: Stackable> AsRef<StackRef<T>> for Stack<T> {
+    fn as_ref(&self) -> &StackRef<T> {
+        self
+    }
+}
+
+impl<T: Stackable> Borrow<StackRef<T>> for Stack<T> {
+    fn borrow(&self) -> &StackRef<T> {
+        self
+    }
+}
+
+impl<T: Stackable> ForeignType for Stack<T> {
+    type CType = T::StackType;
+    type Ref = StackRef<T>;
+
+    #[inline]
+    unsafe fn from_ptr(ptr: *mut T::StackType) -> Stack<T> {
+        assert!(
+            !ptr.is_null(),
+            "Must not instantiate a Stack from a null-ptr - use Stack::new() in \
+             that case"
+        );
+        Stack(ptr)
+    }
+
+    #[inline]
+    fn as_ptr(&self) -> *mut T::StackType {
+        self.0
+    }
+}
+
+impl<T: Stackable> Deref for Stack<T> {
+    type Target = StackRef<T>;
+
+    fn deref(&self) -> &StackRef<T> {
+        unsafe { StackRef::from_ptr(self.0) }
+    }
+}
+
+impl<T: Stackable> DerefMut for Stack<T> {
+    fn deref_mut(&mut self) -> &mut StackRef<T> {
+        unsafe { StackRef::from_ptr_mut(self.0) }
+    }
+}
+
+pub struct IntoIter<T: Stackable> {
+    stack: *mut T::StackType,
+    idxs: Range<LenType>,
+}
+
+impl<T: Stackable> Drop for IntoIter<T> {
+    fn drop(&mut self) {
+        unsafe {
+            // https://github.com/rust-lang/rust-clippy/issues/7510
+            #[allow(clippy::while_let_on_iterator)]
+            while let Some(_) = self.next() {}
+            OPENSSL_sk_free(self.stack as *mut _);
+        }
+    }
+}
+
+impl<T: Stackable> Iterator for IntoIter<T> {
+    type Item = T;
+
+    fn next(&mut self) -> Option<T> {
+        unsafe {
+            self.idxs
+                .next()
+                .map(|i| T::from_ptr(OPENSSL_sk_value(self.stack as *mut _, i) as *mut _))
+        }
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        self.idxs.size_hint()
+    }
+}
+
+impl<T: Stackable> DoubleEndedIterator for IntoIter<T> {
+    fn next_back(&mut self) -> Option<T> {
+        unsafe {
+            self.idxs
+                .next_back()
+                .map(|i| T::from_ptr(OPENSSL_sk_value(self.stack as *mut _, i) as *mut _))
+        }
+    }
+}
+
+impl<T: Stackable> ExactSizeIterator for IntoIter<T> {}
+
+pub struct StackRef<T: Stackable>(Opaque, PhantomData<T>);
+
+unsafe impl<T: Stackable + Send> Send for StackRef<T> {}
+unsafe impl<T: Stackable + Sync> Sync for StackRef<T> {}
+
+impl<T: Stackable> ForeignTypeRef for StackRef<T> {
+    type CType = T::StackType;
+}
+
+impl<T: Stackable> StackRef<T> {
+    fn as_stack(&self) -> *mut OPENSSL_STACK {
+        self.as_ptr() as *mut _
+    }
+
+    /// Returns the number of items in the stack.
+    pub fn len(&self) -> usize {
+        unsafe { OPENSSL_sk_num(self.as_stack()) as usize }
+    }
+
+    /// Determines if the stack is empty.
+    pub fn is_empty(&self) -> bool {
+        self.len() == 0
+    }
+
+    pub fn iter(&self) -> Iter<'_, T> {
+        Iter {
+            stack: self,
+            idxs: 0..self.len() as LenType,
+        }
+    }
+
+    pub fn iter_mut(&mut self) -> IterMut<'_, T> {
+        IterMut {
+            idxs: 0..self.len() as LenType,
+            stack: self,
+        }
+    }
+
+    /// Returns a reference to the element at the given index in the
+    /// stack or `None` if the index is out of bounds
+    pub fn get(&self, idx: usize) -> Option<&T::Ref> {
+        unsafe {
+            if idx >= self.len() {
+                return None;
+            }
+
+            Some(T::Ref::from_ptr(self._get(idx)))
+        }
+    }
+
+    /// Returns a mutable reference to the element at the given index in the
+    /// stack or `None` if the index is out of bounds
+    pub fn get_mut(&mut self, idx: usize) -> Option<&mut T::Ref> {
+        unsafe {
+            if idx >= self.len() {
+                return None;
+            }
+
+            Some(T::Ref::from_ptr_mut(self._get(idx)))
+        }
+    }
+
+    /// Pushes a value onto the top of the stack.
+    pub fn push(&mut self, data: T) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(OPENSSL_sk_push(self.as_stack(), data.as_ptr() as *mut _) as c_int)?;
+            mem::forget(data);
+            Ok(())
+        }
+    }
+
+    /// Removes the last element from the stack and returns it.
+    pub fn pop(&mut self) -> Option<T> {
+        unsafe {
+            let ptr = OPENSSL_sk_pop(self.as_stack());
+            T::from_ptr_opt(ptr as *mut _)
+        }
+    }
+
+    unsafe fn _get(&self, idx: usize) -> *mut T::CType {
+        OPENSSL_sk_value(self.as_stack(), idx as LenType) as *mut _
+    }
+}
+
+impl<T: Stackable> Index<usize> for StackRef<T> {
+    type Output = T::Ref;
+
+    fn index(&self, index: usize) -> &T::Ref {
+        self.get(index).unwrap()
+    }
+}
+
+impl<T: Stackable> IndexMut<usize> for StackRef<T> {
+    fn index_mut(&mut self, index: usize) -> &mut T::Ref {
+        self.get_mut(index).unwrap()
+    }
+}
+
+impl<'a, T: Stackable> iter::IntoIterator for &'a StackRef<T> {
+    type Item = &'a T::Ref;
+    type IntoIter = Iter<'a, T>;
+
+    fn into_iter(self) -> Iter<'a, T> {
+        self.iter()
+    }
+}
+
+impl<'a, T: Stackable> iter::IntoIterator for &'a mut StackRef<T> {
+    type Item = &'a mut T::Ref;
+    type IntoIter = IterMut<'a, T>;
+
+    fn into_iter(self) -> IterMut<'a, T> {
+        self.iter_mut()
+    }
+}
+
+impl<'a, T: Stackable> iter::IntoIterator for &'a Stack<T> {
+    type Item = &'a T::Ref;
+    type IntoIter = Iter<'a, T>;
+
+    fn into_iter(self) -> Iter<'a, T> {
+        self.iter()
+    }
+}
+
+impl<'a, T: Stackable> iter::IntoIterator for &'a mut Stack<T> {
+    type Item = &'a mut T::Ref;
+    type IntoIter = IterMut<'a, T>;
+
+    fn into_iter(self) -> IterMut<'a, T> {
+        self.iter_mut()
+    }
+}
+
+/// An iterator over the stack's contents.
+pub struct Iter<'a, T: Stackable> {
+    stack: &'a StackRef<T>,
+    idxs: Range<LenType>,
+}
+
+impl<'a, T: Stackable> Iterator for Iter<'a, T> {
+    type Item = &'a T::Ref;
+
+    fn next(&mut self) -> Option<&'a T::Ref> {
+        unsafe {
+            self.idxs
+                .next()
+                .map(|i| T::Ref::from_ptr(OPENSSL_sk_value(self.stack.as_stack(), i) as *mut _))
+        }
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        self.idxs.size_hint()
+    }
+}
+
+impl<'a, T: Stackable> DoubleEndedIterator for Iter<'a, T> {
+    fn next_back(&mut self) -> Option<&'a T::Ref> {
+        unsafe {
+            self.idxs
+                .next_back()
+                .map(|i| T::Ref::from_ptr(OPENSSL_sk_value(self.stack.as_stack(), i) as *mut _))
+        }
+    }
+}
+
+impl<'a, T: Stackable> ExactSizeIterator for Iter<'a, T> {}
+
+/// A mutable iterator over the stack's contents.
+pub struct IterMut<'a, T: Stackable> {
+    stack: &'a mut StackRef<T>,
+    idxs: Range<LenType>,
+}
+
+impl<'a, T: Stackable> Iterator for IterMut<'a, T> {
+    type Item = &'a mut T::Ref;
+
+    fn next(&mut self) -> Option<&'a mut T::Ref> {
+        unsafe {
+            self.idxs
+                .next()
+                .map(|i| T::Ref::from_ptr_mut(OPENSSL_sk_value(self.stack.as_stack(), i) as *mut _))
+        }
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        self.idxs.size_hint()
+    }
+}
+
+impl<'a, T: Stackable> DoubleEndedIterator for IterMut<'a, T> {
+    fn next_back(&mut self) -> Option<&'a mut T::Ref> {
+        unsafe {
+            self.idxs
+                .next_back()
+                .map(|i| T::Ref::from_ptr_mut(OPENSSL_sk_value(self.stack.as_stack(), i) as *mut _))
+        }
+    }
+}
+
+impl<'a, T: Stackable> ExactSizeIterator for IterMut<'a, T> {}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/string.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/string.rs
--- 43.0.0-1/rust-vendor/openssl/src/string.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/string.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,96 @@
+use foreign_types::ForeignTypeRef;
+use libc::{c_char, c_void};
+use std::convert::AsRef;
+use std::ffi::CStr;
+use std::fmt;
+use std::ops::Deref;
+use std::str;
+
+use crate::stack::Stackable;
+
+foreign_type_and_impl_send_sync! {
+    type CType = c_char;
+    fn drop = free;
+
+    pub struct OpensslString;
+    pub struct OpensslStringRef;
+}
+
+impl fmt::Display for OpensslString {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        fmt::Display::fmt(&**self, f)
+    }
+}
+
+impl fmt::Debug for OpensslString {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        fmt::Debug::fmt(&**self, f)
+    }
+}
+
+impl Stackable for OpensslString {
+    type StackType = ffi::stack_st_OPENSSL_STRING;
+}
+
+impl AsRef<str> for OpensslString {
+    fn as_ref(&self) -> &str {
+        self
+    }
+}
+
+impl AsRef<[u8]> for OpensslString {
+    fn as_ref(&self) -> &[u8] {
+        self.as_bytes()
+    }
+}
+
+impl Deref for OpensslStringRef {
+    type Target = str;
+
+    fn deref(&self) -> &str {
+        unsafe {
+            let slice = CStr::from_ptr(self.as_ptr()).to_bytes();
+            str::from_utf8_unchecked(slice)
+        }
+    }
+}
+
+impl AsRef<str> for OpensslStringRef {
+    fn as_ref(&self) -> &str {
+        self
+    }
+}
+
+impl AsRef<[u8]> for OpensslStringRef {
+    fn as_ref(&self) -> &[u8] {
+        self.as_bytes()
+    }
+}
+
+impl fmt::Display for OpensslStringRef {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        fmt::Display::fmt(&**self, f)
+    }
+}
+
+impl fmt::Debug for OpensslStringRef {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        fmt::Debug::fmt(&**self, f)
+    }
+}
+
+#[inline]
+#[cfg(not(boringssl))]
+unsafe fn free(buf: *mut c_char) {
+    ffi::OPENSSL_free(buf as *mut c_void);
+}
+
+#[inline]
+#[cfg(boringssl)]
+unsafe fn free(buf: *mut c_char) {
+    ffi::CRYPTO_free(
+        buf as *mut c_void,
+        concat!(file!(), "\0").as_ptr() as *const c_char,
+        line!() as ::libc::c_int,
+    );
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/symm.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/symm.rs
--- 43.0.0-1/rust-vendor/openssl/src/symm.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/symm.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1768 @@
+//! High level interface to certain symmetric ciphers.
+//!
+//! # Examples
+//!
+//! Encrypt data in AES128 CBC mode
+//!
+//! ```
+//! use openssl::symm::{encrypt, Cipher};
+//!
+//! let cipher = Cipher::aes_128_cbc();
+//! let data = b"Some Crypto Text";
+//! let key = b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F";
+//! let iv = b"\x00\x01\x02\x03\x04\x05\x06\x07\x00\x01\x02\x03\x04\x05\x06\x07";
+//! let ciphertext = encrypt(
+//!     cipher,
+//!     key,
+//!     Some(iv),
+//!     data).unwrap();
+//!
+//! assert_eq!(
+//!     b"\xB4\xB9\xE7\x30\xD6\xD6\xF7\xDE\x77\x3F\x1C\xFF\xB3\x3E\x44\x5A\x91\xD7\x27\x62\x87\x4D\
+//!       \xFB\x3C\x5E\xC4\x59\x72\x4A\xF4\x7C\xA1",
+//!     &ciphertext[..]);
+//! ```
+//!
+//! Encrypting an asymmetric key with a symmetric cipher
+//!
+//! ```
+//! use openssl::rsa::{Padding, Rsa};
+//! use openssl::symm::Cipher;
+//!
+//! // Generate keypair and encrypt private key:
+//! let keypair = Rsa::generate(2048).unwrap();
+//! let cipher = Cipher::aes_256_cbc();
+//! let pubkey_pem = keypair.public_key_to_pem_pkcs1().unwrap();
+//! let privkey_pem = keypair.private_key_to_pem_passphrase(cipher, b"Rust").unwrap();
+//! // pubkey_pem and privkey_pem could be written to file here.
+//!
+//! // Load private and public key from string:
+//! let pubkey = Rsa::public_key_from_pem_pkcs1(&pubkey_pem).unwrap();
+//! let privkey = Rsa::private_key_from_pem_passphrase(&privkey_pem, b"Rust").unwrap();
+//!
+//! // Use the asymmetric keys to encrypt and decrypt a short message:
+//! let msg = b"Foo bar";
+//! let mut encrypted = vec![0; pubkey.size() as usize];
+//! let mut decrypted = vec![0; privkey.size() as usize];
+//! let len = pubkey.public_encrypt(msg, &mut encrypted, Padding::PKCS1).unwrap();
+//! assert!(len > msg.len());
+//! let len = privkey.private_decrypt(&encrypted, &mut decrypted, Padding::PKCS1).unwrap();
+//! let output_string = String::from_utf8(decrypted[..len].to_vec()).unwrap();
+//! assert_eq!("Foo bar", output_string);
+//! println!("Decrypted: '{}'", output_string);
+//! ```
+use crate::cipher::CipherRef;
+use crate::cipher_ctx::{CipherCtx, CipherCtxRef};
+use crate::error::ErrorStack;
+use crate::nid::Nid;
+use cfg_if::cfg_if;
+use foreign_types::ForeignTypeRef;
+
+#[derive(Copy, Clone)]
+pub enum Mode {
+    Encrypt,
+    Decrypt,
+}
+
+/// Represents a particular cipher algorithm.
+///
+/// See OpenSSL doc at [`EVP_EncryptInit`] for more information on each algorithms.
+///
+/// [`EVP_EncryptInit`]: https://www.openssl.org/docs/manmaster/crypto/EVP_EncryptInit.html
+#[derive(Copy, Clone, PartialEq, Eq)]
+pub struct Cipher(*const ffi::EVP_CIPHER);
+
+impl Cipher {
+    /// Looks up the cipher for a certain nid.
+    ///
+    /// This corresponds to [`EVP_get_cipherbynid`]
+    ///
+    /// [`EVP_get_cipherbynid`]: https://www.openssl.org/docs/manmaster/crypto/EVP_get_cipherbyname.html
+    pub fn from_nid(nid: Nid) -> Option<Cipher> {
+        let ptr = unsafe { ffi::EVP_get_cipherbyname(ffi::OBJ_nid2sn(nid.as_raw())) };
+        if ptr.is_null() {
+            None
+        } else {
+            Some(Cipher(ptr))
+        }
+    }
+
+    /// Returns the cipher's Nid.
+    ///
+    /// This corresponds to [`EVP_CIPHER_nid`]
+    ///
+    /// [`EVP_CIPHER_nid`]: https://www.openssl.org/docs/manmaster/crypto/EVP_CIPHER_nid.html
+    pub fn nid(&self) -> Nid {
+        let nid = unsafe { ffi::EVP_CIPHER_nid(self.0) };
+        Nid::from_raw(nid)
+    }
+
+    pub fn aes_128_ecb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_128_ecb()) }
+    }
+
+    pub fn aes_128_cbc() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_128_cbc()) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_128_xts() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_128_xts()) }
+    }
+
+    pub fn aes_128_ctr() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_128_ctr()) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_128_cfb1() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_128_cfb1()) }
+    }
+
+    pub fn aes_128_cfb128() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_128_cfb128()) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_128_cfb8() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_128_cfb8()) }
+    }
+
+    pub fn aes_128_gcm() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_128_gcm()) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_128_ccm() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_128_ccm()) }
+    }
+
+    pub fn aes_128_ofb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_128_ofb()) }
+    }
+
+    /// Requires OpenSSL 1.1.0 or newer.
+    #[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_OCB")))]
+    pub fn aes_128_ocb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_128_ocb()) }
+    }
+
+    pub fn aes_192_ecb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_192_ecb()) }
+    }
+
+    pub fn aes_192_cbc() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_192_cbc()) }
+    }
+
+    pub fn aes_192_ctr() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_192_ctr()) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_192_cfb1() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_192_cfb1()) }
+    }
+
+    pub fn aes_192_cfb128() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_192_cfb128()) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_192_cfb8() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_192_cfb8()) }
+    }
+
+    pub fn aes_192_gcm() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_192_gcm()) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_192_ccm() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_192_ccm()) }
+    }
+
+    pub fn aes_192_ofb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_192_ofb()) }
+    }
+
+    /// Requires OpenSSL 1.1.0 or newer.
+    #[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_OCB")))]
+    pub fn aes_192_ocb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_192_ocb()) }
+    }
+
+    pub fn aes_256_ecb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_256_ecb()) }
+    }
+
+    pub fn aes_256_cbc() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_256_cbc()) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_256_xts() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_256_xts()) }
+    }
+
+    pub fn aes_256_ctr() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_256_ctr()) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_256_cfb1() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_256_cfb1()) }
+    }
+
+    pub fn aes_256_cfb128() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_256_cfb128()) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_256_cfb8() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_256_cfb8()) }
+    }
+
+    pub fn aes_256_gcm() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_256_gcm()) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn aes_256_ccm() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_256_ccm()) }
+    }
+
+    pub fn aes_256_ofb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_256_ofb()) }
+    }
+
+    /// Requires OpenSSL 1.1.0 or newer.
+    #[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_OCB")))]
+    pub fn aes_256_ocb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_aes_256_ocb()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_BF"))]
+    pub fn bf_cbc() -> Cipher {
+        unsafe { Cipher(ffi::EVP_bf_cbc()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_BF"))]
+    pub fn bf_ecb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_bf_ecb()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_BF"))]
+    pub fn bf_cfb64() -> Cipher {
+        unsafe { Cipher(ffi::EVP_bf_cfb64()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_BF"))]
+    pub fn bf_ofb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_bf_ofb()) }
+    }
+
+    pub fn des_cbc() -> Cipher {
+        unsafe { Cipher(ffi::EVP_des_cbc()) }
+    }
+
+    pub fn des_ecb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_des_ecb()) }
+    }
+
+    pub fn des_ede3() -> Cipher {
+        unsafe { Cipher(ffi::EVP_des_ede3()) }
+    }
+
+    pub fn des_ede3_cbc() -> Cipher {
+        unsafe { Cipher(ffi::EVP_des_ede3_cbc()) }
+    }
+
+    pub fn des_ede3_ecb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_des_ede3_ecb()) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn des_ede3_cfb64() -> Cipher {
+        unsafe { Cipher(ffi::EVP_des_ede3_cfb64()) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn des_ede3_cfb8() -> Cipher {
+        unsafe { Cipher(ffi::EVP_des_ede3_cfb8()) }
+    }
+
+    #[cfg(not(boringssl))]
+    pub fn des_ede3_ofb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_des_ede3_ofb()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_RC4"))]
+    pub fn rc4() -> Cipher {
+        unsafe { Cipher(ffi::EVP_rc4()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia_128_cbc() -> Cipher {
+        unsafe { Cipher(ffi::EVP_camellia_128_cbc()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia_128_ecb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_camellia_128_ecb()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia_128_ofb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_camellia_128_ofb()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia_128_cfb128() -> Cipher {
+        unsafe { Cipher(ffi::EVP_camellia_128_cfb128()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia_192_cbc() -> Cipher {
+        unsafe { Cipher(ffi::EVP_camellia_192_cbc()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia_192_ecb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_camellia_192_ecb()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia_192_ofb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_camellia_192_ofb()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia_192_cfb128() -> Cipher {
+        unsafe { Cipher(ffi::EVP_camellia_192_cfb128()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia_256_cbc() -> Cipher {
+        unsafe { Cipher(ffi::EVP_camellia_256_cbc()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia_256_ecb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_camellia_256_ecb()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia_256_ofb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_camellia_256_ofb()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn camellia_256_cfb128() -> Cipher {
+        unsafe { Cipher(ffi::EVP_camellia_256_cfb128()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
+    pub fn cast5_cbc() -> Cipher {
+        unsafe { Cipher(ffi::EVP_cast5_cbc()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
+    pub fn cast5_ecb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_cast5_ecb()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
+    pub fn cast5_ofb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_cast5_ofb()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
+    pub fn cast5_cfb64() -> Cipher {
+        unsafe { Cipher(ffi::EVP_cast5_cfb64()) }
+    }
+
+    /// Requires OpenSSL 1.1.0 or newer.
+    #[cfg(all(any(ossl110, libressl310), not(osslconf = "OPENSSL_NO_CHACHA")))]
+    pub fn chacha20() -> Cipher {
+        unsafe { Cipher(ffi::EVP_chacha20()) }
+    }
+
+    /// Requires OpenSSL 1.1.0 or newer.
+    #[cfg(all(any(ossl110, libressl360), not(osslconf = "OPENSSL_NO_CHACHA")))]
+    pub fn chacha20_poly1305() -> Cipher {
+        unsafe { Cipher(ffi::EVP_chacha20_poly1305()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
+    pub fn idea_cbc() -> Cipher {
+        unsafe { Cipher(ffi::EVP_idea_cbc()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
+    pub fn idea_ecb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_idea_ecb()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
+    pub fn idea_ofb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_idea_ofb()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
+    pub fn idea_cfb64() -> Cipher {
+        unsafe { Cipher(ffi::EVP_idea_cfb64()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_SEED"))]
+    pub fn seed_cbc() -> Cipher {
+        unsafe { Cipher(ffi::EVP_seed_cbc()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_SEED"))]
+    pub fn seed_cfb128() -> Cipher {
+        unsafe { Cipher(ffi::EVP_seed_cfb128()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_SEED"))]
+    pub fn seed_ecb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_seed_ecb()) }
+    }
+
+    #[cfg(not(osslconf = "OPENSSL_NO_SEED"))]
+    pub fn seed_ofb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_seed_ofb()) }
+    }
+
+    #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM4")))]
+    pub fn sm4_ecb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_sm4_ecb()) }
+    }
+
+    #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM4")))]
+    pub fn sm4_cbc() -> Cipher {
+        unsafe { Cipher(ffi::EVP_sm4_cbc()) }
+    }
+
+    #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM4")))]
+    pub fn sm4_ctr() -> Cipher {
+        unsafe { Cipher(ffi::EVP_sm4_ctr()) }
+    }
+
+    #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM4")))]
+    pub fn sm4_cfb128() -> Cipher {
+        unsafe { Cipher(ffi::EVP_sm4_cfb128()) }
+    }
+
+    #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM4")))]
+    pub fn sm4_ofb() -> Cipher {
+        unsafe { Cipher(ffi::EVP_sm4_ofb()) }
+    }
+
+    /// Creates a `Cipher` from a raw pointer to its OpenSSL type.
+    ///
+    /// # Safety
+    ///
+    /// The caller must ensure the pointer is valid for the `'static` lifetime.
+    pub unsafe fn from_ptr(ptr: *const ffi::EVP_CIPHER) -> Cipher {
+        Cipher(ptr)
+    }
+
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn as_ptr(&self) -> *const ffi::EVP_CIPHER {
+        self.0
+    }
+
+    /// Returns the length of keys used with this cipher.
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn key_len(&self) -> usize {
+        unsafe { EVP_CIPHER_key_length(self.0) as usize }
+    }
+
+    /// Returns the length of the IV used with this cipher, or `None` if the
+    /// cipher does not use an IV.
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn iv_len(&self) -> Option<usize> {
+        unsafe {
+            let len = EVP_CIPHER_iv_length(self.0) as usize;
+            if len == 0 {
+                None
+            } else {
+                Some(len)
+            }
+        }
+    }
+
+    /// Returns the block size of the cipher.
+    ///
+    /// # Note
+    ///
+    /// Stream ciphers such as RC4 have a block size of 1.
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn block_size(&self) -> usize {
+        unsafe { EVP_CIPHER_block_size(self.0) as usize }
+    }
+
+    /// Determines whether the cipher is using CCM mode
+    #[cfg(not(boringssl))]
+    fn is_ccm(self) -> bool {
+        // NOTE: OpenSSL returns pointers to static structs, which makes this work as expected
+        self == Cipher::aes_128_ccm() || self == Cipher::aes_256_ccm()
+    }
+
+    #[cfg(boringssl)]
+    fn is_ccm(self) -> bool {
+        false
+    }
+
+    /// Determines whether the cipher is using OCB mode
+    #[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_OCB")))]
+    fn is_ocb(self) -> bool {
+        self == Cipher::aes_128_ocb()
+            || self == Cipher::aes_192_ocb()
+            || self == Cipher::aes_256_ocb()
+    }
+
+    #[cfg(any(not(ossl110), osslconf = "OPENSSL_NO_OCB"))]
+    const fn is_ocb(self) -> bool {
+        false
+    }
+}
+
+unsafe impl Sync for Cipher {}
+unsafe impl Send for Cipher {}
+
+/// Represents a symmetric cipher context.
+///
+/// Padding is enabled by default.
+///
+/// # Examples
+///
+/// Encrypt some plaintext in chunks, then decrypt the ciphertext back into plaintext, in AES 128
+/// CBC mode.
+///
+/// ```
+/// use openssl::symm::{Cipher, Mode, Crypter};
+///
+/// let plaintexts: [&[u8]; 2] = [b"Some Stream of", b" Crypto Text"];
+/// let key = b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F";
+/// let iv = b"\x00\x01\x02\x03\x04\x05\x06\x07\x00\x01\x02\x03\x04\x05\x06\x07";
+/// let data_len = plaintexts.iter().fold(0, |sum, x| sum + x.len());
+///
+/// // Create a cipher context for encryption.
+/// let mut encrypter = Crypter::new(
+///     Cipher::aes_128_cbc(),
+///     Mode::Encrypt,
+///     key,
+///     Some(iv)).unwrap();
+///
+/// let block_size = Cipher::aes_128_cbc().block_size();
+/// let mut ciphertext = vec![0; data_len + block_size];
+///
+/// // Encrypt 2 chunks of plaintexts successively.
+/// let mut count = encrypter.update(plaintexts[0], &mut ciphertext).unwrap();
+/// count += encrypter.update(plaintexts[1], &mut ciphertext[count..]).unwrap();
+/// count += encrypter.finalize(&mut ciphertext[count..]).unwrap();
+/// ciphertext.truncate(count);
+///
+/// assert_eq!(
+///     b"\x0F\x21\x83\x7E\xB2\x88\x04\xAF\xD9\xCC\xE2\x03\x49\xB4\x88\xF6\xC4\x61\x0E\x32\x1C\xF9\
+///       \x0D\x66\xB1\xE6\x2C\x77\x76\x18\x8D\x99",
+///     &ciphertext[..]
+/// );
+///
+///
+/// // Let's pretend we don't know the plaintext, and now decrypt the ciphertext.
+/// let data_len = ciphertext.len();
+/// let ciphertexts = [&ciphertext[..9], &ciphertext[9..]];
+///
+/// // Create a cipher context for decryption.
+/// let mut decrypter = Crypter::new(
+///     Cipher::aes_128_cbc(),
+///     Mode::Decrypt,
+///     key,
+///     Some(iv)).unwrap();
+/// let mut plaintext = vec![0; data_len + block_size];
+///
+/// // Decrypt 2 chunks of ciphertexts successively.
+/// let mut count = decrypter.update(ciphertexts[0], &mut plaintext).unwrap();
+/// count += decrypter.update(ciphertexts[1], &mut plaintext[count..]).unwrap();
+/// count += decrypter.finalize(&mut plaintext[count..]).unwrap();
+/// plaintext.truncate(count);
+///
+/// assert_eq!(b"Some Stream of Crypto Text", &plaintext[..]);
+/// ```
+pub struct Crypter {
+    ctx: CipherCtx,
+}
+
+impl Crypter {
+    /// Creates a new `Crypter`.  The initialisation vector, `iv`, is not necessary for certain
+    /// types of `Cipher`.
+    ///
+    /// # Panics
+    ///
+    /// Panics if an IV is required by the cipher but not provided.  Also make sure that the key
+    /// and IV size are appropriate for your cipher.
+    pub fn new(
+        t: Cipher,
+        mode: Mode,
+        key: &[u8],
+        iv: Option<&[u8]>,
+    ) -> Result<Crypter, ErrorStack> {
+        let mut ctx = CipherCtx::new()?;
+
+        let f = match mode {
+            Mode::Encrypt => CipherCtxRef::encrypt_init,
+            Mode::Decrypt => CipherCtxRef::decrypt_init,
+        };
+
+        f(
+            &mut ctx,
+            Some(unsafe { CipherRef::from_ptr(t.as_ptr() as *mut _) }),
+            None,
+            None,
+        )?;
+
+        ctx.set_key_length(key.len())?;
+
+        if let (Some(iv), Some(iv_len)) = (iv, t.iv_len()) {
+            if iv.len() != iv_len {
+                ctx.set_iv_length(iv.len())?;
+            }
+        }
+
+        f(&mut ctx, None, Some(key), iv)?;
+
+        Ok(Crypter { ctx })
+    }
+
+    /// Enables or disables padding.
+    ///
+    /// If padding is disabled, total amount of data encrypted/decrypted must
+    /// be a multiple of the cipher's block size.
+    pub fn pad(&mut self, padding: bool) {
+        self.ctx.set_padding(padding)
+    }
+
+    /// Sets the tag used to authenticate ciphertext in AEAD ciphers such as AES GCM.
+    ///
+    /// When decrypting cipher text using an AEAD cipher, this must be called before `finalize`.
+    pub fn set_tag(&mut self, tag: &[u8]) -> Result<(), ErrorStack> {
+        self.ctx.set_tag(tag)
+    }
+
+    /// Sets the length of the authentication tag to generate in AES CCM.
+    ///
+    /// When encrypting with AES CCM, the tag length needs to be explicitly set in order
+    /// to use a value different than the default 12 bytes.
+    pub fn set_tag_len(&mut self, tag_len: usize) -> Result<(), ErrorStack> {
+        self.ctx.set_tag_length(tag_len)
+    }
+
+    /// Feeds total plaintext length to the cipher.
+    ///
+    /// The total plaintext or ciphertext length MUST be passed to the cipher when it operates in
+    /// CCM mode.
+    pub fn set_data_len(&mut self, data_len: usize) -> Result<(), ErrorStack> {
+        self.ctx.set_data_len(data_len)
+    }
+
+    /// Feeds Additional Authenticated Data (AAD) through the cipher.
+    ///
+    /// This can only be used with AEAD ciphers such as AES GCM. Data fed in is not encrypted, but
+    /// is factored into the authentication tag. It must be called before the first call to
+    /// `update`.
+    pub fn aad_update(&mut self, input: &[u8]) -> Result<(), ErrorStack> {
+        self.ctx.cipher_update(input, None)?;
+        Ok(())
+    }
+
+    /// Feeds data from `input` through the cipher, writing encrypted/decrypted
+    /// bytes into `output`.
+    ///
+    /// The number of bytes written to `output` is returned. Note that this may
+    /// not be equal to the length of `input`.
+    ///
+    /// # Panics
+    ///
+    /// Panics for stream ciphers if `output.len() < input.len()`.
+    ///
+    /// Panics for block ciphers if `output.len() < input.len() + block_size`,
+    /// where `block_size` is the block size of the cipher (see `Cipher::block_size`).
+    ///
+    /// Panics if `output.len() > c_int::MAX`.
+    pub fn update(&mut self, input: &[u8], output: &mut [u8]) -> Result<usize, ErrorStack> {
+        self.ctx.cipher_update(input, Some(output))
+    }
+
+    /// Feeds data from `input` through the cipher, writing encrypted/decrypted
+    /// bytes into `output`.
+    ///
+    /// The number of bytes written to `output` is returned. Note that this may
+    /// not be equal to the length of `input`.
+    ///
+    /// # Safety
+    ///
+    /// The caller must provide an `output` buffer large enough to contain
+    /// correct number of bytes. For streaming ciphers the output buffer size
+    /// should be at least as big as the input buffer. For block ciphers the
+    /// size of the output buffer depends on the state of partially updated
+    /// blocks.
+    pub unsafe fn update_unchecked(
+        &mut self,
+        input: &[u8],
+        output: &mut [u8],
+    ) -> Result<usize, ErrorStack> {
+        self.ctx.cipher_update_unchecked(input, Some(output))
+    }
+
+    /// Finishes the encryption/decryption process, writing any remaining data
+    /// to `output`.
+    ///
+    /// The number of bytes written to `output` is returned.
+    ///
+    /// `update` should not be called after this method.
+    ///
+    /// # Panics
+    ///
+    /// Panics for block ciphers if `output.len() < block_size`,
+    /// where `block_size` is the block size of the cipher (see `Cipher::block_size`).
+    pub fn finalize(&mut self, output: &mut [u8]) -> Result<usize, ErrorStack> {
+        self.ctx.cipher_final(output)
+    }
+
+    /// Retrieves the authentication tag used to authenticate ciphertext in AEAD ciphers such
+    /// as AES GCM.
+    ///
+    /// When encrypting data with an AEAD cipher, this must be called after `finalize`.
+    ///
+    /// The size of the buffer indicates the required size of the tag. While some ciphers support a
+    /// range of tag sizes, it is recommended to pick the maximum size. For AES GCM, this is 16
+    /// bytes, for example.
+    pub fn get_tag(&self, tag: &mut [u8]) -> Result<(), ErrorStack> {
+        self.ctx.tag(tag)
+    }
+}
+
+/// Encrypts data in one go, and returns the encrypted data.
+///
+/// Data is encrypted using the specified cipher type `t` in encrypt mode with the specified `key`
+/// and initialization vector `iv`. Padding is enabled.
+///
+/// This is a convenient interface to `Crypter` to encrypt all data in one go.  To encrypt a stream
+/// of data incrementally , use `Crypter` instead.
+///
+/// # Examples
+///
+/// Encrypt data in AES128 CBC mode
+///
+/// ```
+/// use openssl::symm::{encrypt, Cipher};
+///
+/// let cipher = Cipher::aes_128_cbc();
+/// let data = b"Some Crypto Text";
+/// let key = b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F";
+/// let iv = b"\x00\x01\x02\x03\x04\x05\x06\x07\x00\x01\x02\x03\x04\x05\x06\x07";
+/// let ciphertext = encrypt(
+///     cipher,
+///     key,
+///     Some(iv),
+///     data).unwrap();
+///
+/// assert_eq!(
+///     b"\xB4\xB9\xE7\x30\xD6\xD6\xF7\xDE\x77\x3F\x1C\xFF\xB3\x3E\x44\x5A\x91\xD7\x27\x62\x87\x4D\
+///       \xFB\x3C\x5E\xC4\x59\x72\x4A\xF4\x7C\xA1",
+///     &ciphertext[..]);
+/// ```
+pub fn encrypt(
+    t: Cipher,
+    key: &[u8],
+    iv: Option<&[u8]>,
+    data: &[u8],
+) -> Result<Vec<u8>, ErrorStack> {
+    cipher(t, Mode::Encrypt, key, iv, data)
+}
+
+/// Decrypts data in one go, and returns the decrypted data.
+///
+/// Data is decrypted using the specified cipher type `t` in decrypt mode with the specified `key`
+/// and initialization vector `iv`. Padding is enabled.
+///
+/// This is a convenient interface to `Crypter` to decrypt all data in one go.  To decrypt a  stream
+/// of data incrementally , use `Crypter` instead.
+///
+/// # Examples
+///
+/// Decrypt data in AES128 CBC mode
+///
+/// ```
+/// use openssl::symm::{decrypt, Cipher};
+///
+/// let cipher = Cipher::aes_128_cbc();
+/// let data = b"\xB4\xB9\xE7\x30\xD6\xD6\xF7\xDE\x77\x3F\x1C\xFF\xB3\x3E\x44\x5A\x91\xD7\x27\x62\
+///              \x87\x4D\xFB\x3C\x5E\xC4\x59\x72\x4A\xF4\x7C\xA1";
+/// let key = b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F";
+/// let iv = b"\x00\x01\x02\x03\x04\x05\x06\x07\x00\x01\x02\x03\x04\x05\x06\x07";
+/// let ciphertext = decrypt(
+///     cipher,
+///     key,
+///     Some(iv),
+///     data).unwrap();
+///
+/// assert_eq!(
+///     b"Some Crypto Text",
+///     &ciphertext[..]);
+/// ```
+pub fn decrypt(
+    t: Cipher,
+    key: &[u8],
+    iv: Option<&[u8]>,
+    data: &[u8],
+) -> Result<Vec<u8>, ErrorStack> {
+    cipher(t, Mode::Decrypt, key, iv, data)
+}
+
+fn cipher(
+    t: Cipher,
+    mode: Mode,
+    key: &[u8],
+    iv: Option<&[u8]>,
+    data: &[u8],
+) -> Result<Vec<u8>, ErrorStack> {
+    let mut c = Crypter::new(t, mode, key, iv)?;
+    let mut out = vec![0; data.len() + t.block_size()];
+    let count = c.update(data, &mut out)?;
+    let rest = c.finalize(&mut out[count..])?;
+    out.truncate(count + rest);
+    Ok(out)
+}
+
+/// Like `encrypt`, but for AEAD ciphers such as AES GCM.
+///
+/// Additional Authenticated Data can be provided in the `aad` field, and the authentication tag
+/// will be copied into the `tag` field.
+///
+/// The size of the `tag` buffer indicates the required size of the tag. While some ciphers support
+/// a range of tag sizes, it is recommended to pick the maximum size. For AES GCM, this is 16 bytes,
+/// for example.
+pub fn encrypt_aead(
+    t: Cipher,
+    key: &[u8],
+    iv: Option<&[u8]>,
+    aad: &[u8],
+    data: &[u8],
+    tag: &mut [u8],
+) -> Result<Vec<u8>, ErrorStack> {
+    let mut c = Crypter::new(t, Mode::Encrypt, key, iv)?;
+    let mut out = vec![0; data.len() + t.block_size()];
+
+    let is_ccm = t.is_ccm();
+    if is_ccm || t.is_ocb() {
+        c.set_tag_len(tag.len())?;
+        if is_ccm {
+            c.set_data_len(data.len())?;
+        }
+    }
+
+    c.aad_update(aad)?;
+    let count = c.update(data, &mut out)?;
+    let rest = c.finalize(&mut out[count..])?;
+    c.get_tag(tag)?;
+    out.truncate(count + rest);
+    Ok(out)
+}
+
+/// Like `decrypt`, but for AEAD ciphers such as AES GCM.
+///
+/// Additional Authenticated Data can be provided in the `aad` field, and the authentication tag
+/// should be provided in the `tag` field.
+pub fn decrypt_aead(
+    t: Cipher,
+    key: &[u8],
+    iv: Option<&[u8]>,
+    aad: &[u8],
+    data: &[u8],
+    tag: &[u8],
+) -> Result<Vec<u8>, ErrorStack> {
+    let mut c = Crypter::new(t, Mode::Decrypt, key, iv)?;
+    let mut out = vec![0; data.len() + t.block_size()];
+
+    let is_ccm = t.is_ccm();
+    if is_ccm || t.is_ocb() {
+        c.set_tag(tag)?;
+        if is_ccm {
+            c.set_data_len(data.len())?;
+        }
+    }
+
+    c.aad_update(aad)?;
+    let count = c.update(data, &mut out)?;
+
+    let rest = if t.is_ccm() {
+        0
+    } else {
+        c.set_tag(tag)?;
+        c.finalize(&mut out[count..])?
+    };
+
+    out.truncate(count + rest);
+    Ok(out)
+}
+
+cfg_if! {
+    if #[cfg(any(boringssl, ossl110, libressl273))] {
+        use ffi::{EVP_CIPHER_block_size, EVP_CIPHER_iv_length, EVP_CIPHER_key_length};
+    } else {
+        use crate::LenType;
+
+        #[allow(bad_style)]
+        pub unsafe fn EVP_CIPHER_iv_length(ptr: *const ffi::EVP_CIPHER) -> LenType {
+            (*ptr).iv_len
+        }
+
+        #[allow(bad_style)]
+        pub unsafe fn EVP_CIPHER_block_size(ptr: *const ffi::EVP_CIPHER) -> LenType {
+            (*ptr).block_size
+        }
+
+        #[allow(bad_style)]
+        pub unsafe fn EVP_CIPHER_key_length(ptr: *const ffi::EVP_CIPHER) -> LenType {
+            (*ptr).key_len
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use hex::{self, FromHex};
+
+    #[test]
+    fn test_stream_cipher_output() {
+        let key = [0u8; 16];
+        let iv = [0u8; 16];
+        let mut c = super::Crypter::new(
+            super::Cipher::aes_128_ctr(),
+            super::Mode::Encrypt,
+            &key,
+            Some(&iv),
+        )
+        .unwrap();
+
+        assert_eq!(c.update(&[0u8; 15], &mut [0u8; 15]).unwrap(), 15);
+        assert_eq!(c.update(&[0u8; 1], &mut [0u8; 1]).unwrap(), 1);
+        assert_eq!(c.finalize(&mut [0u8; 0]).unwrap(), 0);
+    }
+
+    // Test vectors from FIPS-197:
+    // http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf
+    #[test]
+    fn test_aes_256_ecb() {
+        let k0 = [
+            0x00u8, 0x01u8, 0x02u8, 0x03u8, 0x04u8, 0x05u8, 0x06u8, 0x07u8, 0x08u8, 0x09u8, 0x0au8,
+            0x0bu8, 0x0cu8, 0x0du8, 0x0eu8, 0x0fu8, 0x10u8, 0x11u8, 0x12u8, 0x13u8, 0x14u8, 0x15u8,
+            0x16u8, 0x17u8, 0x18u8, 0x19u8, 0x1au8, 0x1bu8, 0x1cu8, 0x1du8, 0x1eu8, 0x1fu8,
+        ];
+        let p0 = [
+            0x00u8, 0x11u8, 0x22u8, 0x33u8, 0x44u8, 0x55u8, 0x66u8, 0x77u8, 0x88u8, 0x99u8, 0xaau8,
+            0xbbu8, 0xccu8, 0xddu8, 0xeeu8, 0xffu8,
+        ];
+        let c0 = [
+            0x8eu8, 0xa2u8, 0xb7u8, 0xcau8, 0x51u8, 0x67u8, 0x45u8, 0xbfu8, 0xeau8, 0xfcu8, 0x49u8,
+            0x90u8, 0x4bu8, 0x49u8, 0x60u8, 0x89u8,
+        ];
+        let mut c = super::Crypter::new(
+            super::Cipher::aes_256_ecb(),
+            super::Mode::Encrypt,
+            &k0,
+            None,
+        )
+        .unwrap();
+        c.pad(false);
+        let mut r0 = vec![0; c0.len() + super::Cipher::aes_256_ecb().block_size()];
+        let count = c.update(&p0, &mut r0).unwrap();
+        let rest = c.finalize(&mut r0[count..]).unwrap();
+        r0.truncate(count + rest);
+        assert_eq!(hex::encode(&r0), hex::encode(c0));
+
+        let mut c = super::Crypter::new(
+            super::Cipher::aes_256_ecb(),
+            super::Mode::Decrypt,
+            &k0,
+            None,
+        )
+        .unwrap();
+        c.pad(false);
+        let mut p1 = vec![0; r0.len() + super::Cipher::aes_256_ecb().block_size()];
+        let count = c.update(&r0, &mut p1).unwrap();
+        let rest = c.finalize(&mut p1[count..]).unwrap();
+        p1.truncate(count + rest);
+        assert_eq!(hex::encode(p1), hex::encode(p0));
+    }
+
+    #[test]
+    fn test_aes_256_cbc_decrypt() {
+        let iv = [
+            4_u8, 223_u8, 153_u8, 219_u8, 28_u8, 142_u8, 234_u8, 68_u8, 227_u8, 69_u8, 98_u8,
+            107_u8, 208_u8, 14_u8, 236_u8, 60_u8,
+        ];
+        let data = [
+            143_u8, 210_u8, 75_u8, 63_u8, 214_u8, 179_u8, 155_u8, 241_u8, 242_u8, 31_u8, 154_u8,
+            56_u8, 198_u8, 145_u8, 192_u8, 64_u8, 2_u8, 245_u8, 167_u8, 220_u8, 55_u8, 119_u8,
+            233_u8, 136_u8, 139_u8, 27_u8, 71_u8, 242_u8, 119_u8, 175_u8, 65_u8, 207_u8,
+        ];
+        let ciphered_data = [
+            0x4a_u8, 0x2e_u8, 0xe5_u8, 0x6_u8, 0xbf_u8, 0xcf_u8, 0xf2_u8, 0xd7_u8, 0xea_u8,
+            0x2d_u8, 0xb1_u8, 0x85_u8, 0x6c_u8, 0x93_u8, 0x65_u8, 0x6f_u8,
+        ];
+        let mut cr = super::Crypter::new(
+            super::Cipher::aes_256_cbc(),
+            super::Mode::Decrypt,
+            &data,
+            Some(&iv),
+        )
+        .unwrap();
+        cr.pad(false);
+        let mut unciphered_data = vec![0; data.len() + super::Cipher::aes_256_cbc().block_size()];
+        let count = cr.update(&ciphered_data, &mut unciphered_data).unwrap();
+        let rest = cr.finalize(&mut unciphered_data[count..]).unwrap();
+        unciphered_data.truncate(count + rest);
+
+        let expected_unciphered_data = b"I love turtles.\x01";
+
+        assert_eq!(&unciphered_data, expected_unciphered_data);
+    }
+
+    fn cipher_test(ciphertype: super::Cipher, pt: &str, ct: &str, key: &str, iv: &str) {
+        let pt = Vec::from_hex(pt).unwrap();
+        let ct = Vec::from_hex(ct).unwrap();
+        let key = Vec::from_hex(key).unwrap();
+        let iv = Vec::from_hex(iv).unwrap();
+
+        let computed = super::decrypt(ciphertype, &key, Some(&iv), &ct).unwrap();
+        let expected = pt;
+
+        if computed != expected {
+            println!("Computed: {}", hex::encode(&computed));
+            println!("Expected: {}", hex::encode(&expected));
+            if computed.len() != expected.len() {
+                println!(
+                    "Lengths differ: {} in computed vs {} expected",
+                    computed.len(),
+                    expected.len()
+                );
+            }
+            panic!("test failure");
+        }
+    }
+
+    #[cfg(not(boringssl))]
+    fn cipher_test_nopad(ciphertype: super::Cipher, pt: &str, ct: &str, key: &str, iv: &str) {
+        let pt = Vec::from_hex(pt).unwrap();
+        let ct = Vec::from_hex(ct).unwrap();
+        let key = Vec::from_hex(key).unwrap();
+        let iv = Vec::from_hex(iv).unwrap();
+
+        let computed = {
+            let mut c = Crypter::new(ciphertype, Mode::Decrypt, &key, Some(&iv)).unwrap();
+            c.pad(false);
+            let mut out = vec![0; ct.len() + ciphertype.block_size()];
+            let count = c.update(&ct, &mut out).unwrap();
+            let rest = c.finalize(&mut out[count..]).unwrap();
+            out.truncate(count + rest);
+            out
+        };
+        let expected = pt;
+
+        if computed != expected {
+            println!("Computed: {}", hex::encode(&computed));
+            println!("Expected: {}", hex::encode(&expected));
+            if computed.len() != expected.len() {
+                println!(
+                    "Lengths differ: {} in computed vs {} expected",
+                    computed.len(),
+                    expected.len()
+                );
+            }
+            panic!("test failure");
+        }
+    }
+
+    #[test]
+    fn test_rc4() {
+        #[cfg(ossl300)]
+        let _provider = crate::provider::Provider::try_load(None, "legacy", true).unwrap();
+
+        let pt = "0000000000000000000000000000000000000000000000000000000000000000000000000000";
+        let ct = "A68686B04D686AA107BD8D4CAB191A3EEC0A6294BC78B60F65C25CB47BD7BB3A48EFC4D26BE4";
+        let key = "97CD440324DA5FD1F7955C1C13B6B466";
+        let iv = "";
+
+        cipher_test(super::Cipher::rc4(), pt, ct, key, iv);
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn test_aes256_xts() {
+        // Test case 174 from
+        // http://csrc.nist.gov/groups/STM/cavp/documents/aes/XTSTestVectors.zip
+        let pt = "77f4ef63d734ebd028508da66c22cdebdd52ecd6ee2ab0a50bc8ad0cfd692ca5fcd4e6dedc45df7f\
+                  6503f462611dc542";
+        let ct = "ce7d905a7776ac72f240d22aafed5e4eb7566cdc7211220e970da634ce015f131a5ecb8d400bc9e8\
+                  4f0b81d8725dbbc7";
+        let key = "b6bfef891f83b5ff073f2231267be51eb084b791fa19a154399c0684c8b2dfcb37de77d28bbda3b\
+                   4180026ad640b74243b3133e7b9fae629403f6733423dae28";
+        let iv = "db200efb7eaaa737dbdf40babb68953f";
+
+        cipher_test(super::Cipher::aes_256_xts(), pt, ct, key, iv);
+    }
+
+    #[test]
+    fn test_aes128_ctr() {
+        let pt = "6BC1BEE22E409F96E93D7E117393172AAE2D8A571E03AC9C9EB76FAC45AF8E5130C81C46A35CE411\
+                  E5FBC1191A0A52EFF69F2445DF4F9B17AD2B417BE66C3710";
+        let ct = "874D6191B620E3261BEF6864990DB6CE9806F66B7970FDFF8617187BB9FFFDFF5AE4DF3EDBD5D35E\
+                  5B4F09020DB03EAB1E031DDA2FBE03D1792170A0F3009CEE";
+        let key = "2B7E151628AED2A6ABF7158809CF4F3C";
+        let iv = "F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF";
+
+        cipher_test(super::Cipher::aes_128_ctr(), pt, ct, key, iv);
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn test_aes128_cfb1() {
+        // Lifted from http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf
+
+        let pt = "6bc1";
+        let ct = "68b3";
+        let key = "2b7e151628aed2a6abf7158809cf4f3c";
+        let iv = "000102030405060708090a0b0c0d0e0f";
+
+        cipher_test(super::Cipher::aes_128_cfb1(), pt, ct, key, iv);
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn test_aes128_cfb128() {
+        let pt = "6bc1bee22e409f96e93d7e117393172a";
+        let ct = "3b3fd92eb72dad20333449f8e83cfb4a";
+        let key = "2b7e151628aed2a6abf7158809cf4f3c";
+        let iv = "000102030405060708090a0b0c0d0e0f";
+
+        cipher_test(super::Cipher::aes_128_cfb128(), pt, ct, key, iv);
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn test_aes128_cfb8() {
+        let pt = "6bc1bee22e409f96e93d7e117393172aae2d";
+        let ct = "3b79424c9c0dd436bace9e0ed4586a4f32b9";
+        let key = "2b7e151628aed2a6abf7158809cf4f3c";
+        let iv = "000102030405060708090a0b0c0d0e0f";
+
+        cipher_test(super::Cipher::aes_128_cfb8(), pt, ct, key, iv);
+    }
+
+    #[test]
+    fn test_aes128_ofb() {
+        // Lifted from http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf
+
+        let pt = "6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710";
+        let ct = "3b3fd92eb72dad20333449f8e83cfb4a7789508d16918f03f53c52dac54ed8259740051e9c5fecf64344f7a82260edcc304c6528f659c77866a510d9c1d6ae5e";
+        let key = "2b7e151628aed2a6abf7158809cf4f3c";
+        let iv = "000102030405060708090a0b0c0d0e0f";
+
+        cipher_test(super::Cipher::aes_128_ofb(), pt, ct, key, iv);
+    }
+
+    #[test]
+    fn test_aes192_ctr() {
+        // Lifted from http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf
+
+        let pt = "6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710";
+        let ct = "1abc932417521ca24f2b0459fe7e6e0b090339ec0aa6faefd5ccc2c6f4ce8e941e36b26bd1ebc670d1bd1d665620abf74f78a7f6d29809585a97daec58c6b050";
+        let key = "8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b";
+        let iv = "f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff";
+
+        cipher_test(super::Cipher::aes_192_ctr(), pt, ct, key, iv);
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn test_aes192_cfb1() {
+        // Lifted from http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf
+
+        let pt = "6bc1";
+        let ct = "9359";
+        let key = "8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b";
+        let iv = "000102030405060708090a0b0c0d0e0f";
+
+        cipher_test(super::Cipher::aes_192_cfb1(), pt, ct, key, iv);
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn test_aes192_cfb128() {
+        // Lifted from http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf
+
+        let pt = "6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710";
+        let ct = "cdc80d6fddf18cab34c25909c99a417467ce7f7f81173621961a2b70171d3d7a2e1e8a1dd59b88b1c8e60fed1efac4c9c05f9f9ca9834fa042ae8fba584b09ff";
+        let key = "8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b";
+        let iv = "000102030405060708090a0b0c0d0e0f";
+
+        cipher_test(super::Cipher::aes_192_cfb128(), pt, ct, key, iv);
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn test_aes192_cfb8() {
+        // Lifted from http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf
+
+        let pt = "6bc1bee22e409f96e93d7e117393172aae2d";
+        let ct = "cda2521ef0a905ca44cd057cbf0d47a0678a";
+        let key = "8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b";
+        let iv = "000102030405060708090a0b0c0d0e0f";
+
+        cipher_test(super::Cipher::aes_192_cfb8(), pt, ct, key, iv);
+    }
+
+    #[test]
+    fn test_aes192_ofb() {
+        // Lifted from http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf
+
+        let pt = "6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710";
+        let ct = "cdc80d6fddf18cab34c25909c99a4174fcc28b8d4c63837c09e81700c11004018d9a9aeac0f6596f559c6d4daf59a5f26d9f200857ca6c3e9cac524bd9acc92a";
+        let key = "8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b";
+        let iv = "000102030405060708090a0b0c0d0e0f";
+
+        cipher_test(super::Cipher::aes_192_ofb(), pt, ct, key, iv);
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn test_aes256_cfb1() {
+        let pt = "6bc1";
+        let ct = "9029";
+        let key = "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4";
+        let iv = "000102030405060708090a0b0c0d0e0f";
+
+        cipher_test(super::Cipher::aes_256_cfb1(), pt, ct, key, iv);
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn test_aes256_cfb128() {
+        let pt = "6bc1bee22e409f96e93d7e117393172a";
+        let ct = "dc7e84bfda79164b7ecd8486985d3860";
+        let key = "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4";
+        let iv = "000102030405060708090a0b0c0d0e0f";
+
+        cipher_test(super::Cipher::aes_256_cfb128(), pt, ct, key, iv);
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn test_aes256_cfb8() {
+        let pt = "6bc1bee22e409f96e93d7e117393172aae2d";
+        let ct = "dc1f1a8520a64db55fcc8ac554844e889700";
+        let key = "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4";
+        let iv = "000102030405060708090a0b0c0d0e0f";
+
+        cipher_test(super::Cipher::aes_256_cfb8(), pt, ct, key, iv);
+    }
+
+    #[test]
+    fn test_aes256_ofb() {
+        // Lifted from http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf
+
+        let pt = "6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710";
+        let ct = "dc7e84bfda79164b7ecd8486985d38604febdc6740d20b3ac88f6ad82a4fb08d71ab47a086e86eedf39d1c5bba97c4080126141d67f37be8538f5a8be740e484";
+        let key = "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4";
+        let iv = "000102030405060708090a0b0c0d0e0f";
+
+        cipher_test(super::Cipher::aes_256_ofb(), pt, ct, key, iv);
+    }
+
+    #[test]
+    #[cfg_attr(ossl300, ignore)]
+    #[cfg(not(boringssl))]
+    fn test_bf_cbc() {
+        #[cfg(ossl300)]
+        let _provider = crate::provider::Provider::try_load(None, "legacy", true).unwrap();
+
+        // https://www.schneier.com/code/vectors.txt
+
+        let pt = "37363534333231204E6F77206973207468652074696D6520666F722000000000";
+        let ct = "6B77B4D63006DEE605B156E27403979358DEB9E7154616D959F1652BD5FF92CC";
+        let key = "0123456789ABCDEFF0E1D2C3B4A59687";
+        let iv = "FEDCBA9876543210";
+
+        cipher_test_nopad(super::Cipher::bf_cbc(), pt, ct, key, iv);
+    }
+
+    #[test]
+    #[cfg_attr(ossl300, ignore)]
+    #[cfg(not(boringssl))]
+    fn test_bf_ecb() {
+        #[cfg(ossl300)]
+        let _provider = crate::provider::Provider::try_load(None, "legacy", true).unwrap();
+
+        let pt = "5CD54CA83DEF57DA";
+        let ct = "B1B8CC0B250F09A0";
+        let key = "0131D9619DC1376E";
+        let iv = "0000000000000000";
+
+        cipher_test_nopad(super::Cipher::bf_ecb(), pt, ct, key, iv);
+    }
+
+    #[test]
+    #[cfg_attr(ossl300, ignore)]
+    #[cfg(not(boringssl))]
+    fn test_bf_cfb64() {
+        #[cfg(ossl300)]
+        let _provider = crate::provider::Provider::try_load(None, "legacy", true).unwrap();
+
+        let pt = "37363534333231204E6F77206973207468652074696D6520666F722000";
+        let ct = "E73214A2822139CAF26ECF6D2EB9E76E3DA3DE04D1517200519D57A6C3";
+        let key = "0123456789ABCDEFF0E1D2C3B4A59687";
+        let iv = "FEDCBA9876543210";
+
+        cipher_test_nopad(super::Cipher::bf_cfb64(), pt, ct, key, iv);
+    }
+
+    #[test]
+    #[cfg_attr(ossl300, ignore)]
+    #[cfg(not(boringssl))]
+    fn test_bf_ofb() {
+        #[cfg(ossl300)]
+        let _provider = crate::provider::Provider::try_load(None, "legacy", true).unwrap();
+
+        let pt = "37363534333231204E6F77206973207468652074696D6520666F722000";
+        let ct = "E73214A2822139CA62B343CC5B65587310DD908D0C241B2263C2CF80DA";
+        let key = "0123456789ABCDEFF0E1D2C3B4A59687";
+        let iv = "FEDCBA9876543210";
+
+        cipher_test_nopad(super::Cipher::bf_ofb(), pt, ct, key, iv);
+    }
+
+    #[test]
+    fn test_des_cbc() {
+        #[cfg(ossl300)]
+        let _provider = crate::provider::Provider::try_load(None, "legacy", true).unwrap();
+
+        let pt = "54686973206973206120746573742e";
+        let ct = "6f2867cfefda048a4046ef7e556c7132";
+        let key = "7cb66337f3d3c0fe";
+        let iv = "0001020304050607";
+
+        cipher_test(super::Cipher::des_cbc(), pt, ct, key, iv);
+    }
+
+    #[test]
+    fn test_des_ecb() {
+        #[cfg(ossl300)]
+        let _provider = crate::provider::Provider::try_load(None, "legacy", true).unwrap();
+
+        let pt = "54686973206973206120746573742e";
+        let ct = "0050ab8aecec758843fe157b4dde938c";
+        let key = "7cb66337f3d3c0fe";
+        let iv = "0001020304050607";
+
+        cipher_test(super::Cipher::des_ecb(), pt, ct, key, iv);
+    }
+
+    #[test]
+    fn test_des_ede3() {
+        let pt = "9994f4c69d40ae4f34ff403b5cf39d4c8207ea5d3e19a5fd";
+        let ct = "9e5c4297d60582f81071ac8ab7d0698d4c79de8b94c519858207ea5d3e19a5fd";
+        let key = "010203040506070801020304050607080102030405060708";
+        let iv = "5cc118306dc702e4";
+
+        cipher_test(super::Cipher::des_ede3(), pt, ct, key, iv);
+    }
+
+    #[test]
+    fn test_des_ede3_cbc() {
+        let pt = "54686973206973206120746573742e";
+        let ct = "6f2867cfefda048a4046ef7e556c7132";
+        let key = "7cb66337f3d3c0fe7cb66337f3d3c0fe7cb66337f3d3c0fe";
+        let iv = "0001020304050607";
+
+        cipher_test(super::Cipher::des_ede3_cbc(), pt, ct, key, iv);
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn test_des_ede3_cfb64() {
+        let pt = "2b1773784b5889dc788477367daa98ad";
+        let ct = "6f2867cfefda048a4046ef7e556c7132";
+        let key = "7cb66337f3d3c0fe7cb66337f3d3c0fe7cb66337f3d3c0fe";
+        let iv = "0001020304050607";
+
+        cipher_test(super::Cipher::des_ede3_cfb64(), pt, ct, key, iv);
+    }
+
+    #[test]
+    fn test_aes128_gcm() {
+        let key = "23dc8d23d95b6fd1251741a64f7d4f41";
+        let iv = "f416f48ad44d9efa1179e167";
+        let pt = "6cb9b71dd0ccd42cdf87e8e396fc581fd8e0d700e360f590593b748e105390de";
+        let aad = "45074844c97d515c65bbe37c210a5a4b08c21c588efe5c5f73c4d9c17d34dacddc0bb6a8a53f7bf477b9780c1c2a928660df87016b2873fe876b2b887fb5886bfd63216b7eaecc046372a82c047eb043f0b063226ee52a12c69b";
+        let ct = "8ad20486778e87387efb3f2574e509951c0626816722018129e578b2787969d3";
+        let tag = "91e1bc09";
+
+        // this tag is smaller than you'd normally want, but I pulled this test from the part of
+        // the NIST test vectors that cover 4 byte tags.
+        let mut actual_tag = [0; 4];
+        let out = encrypt_aead(
+            Cipher::aes_128_gcm(),
+            &Vec::from_hex(key).unwrap(),
+            Some(&Vec::from_hex(iv).unwrap()),
+            &Vec::from_hex(aad).unwrap(),
+            &Vec::from_hex(pt).unwrap(),
+            &mut actual_tag,
+        )
+        .unwrap();
+        assert_eq!(ct, hex::encode(out));
+        assert_eq!(tag, hex::encode(actual_tag));
+
+        let out = decrypt_aead(
+            Cipher::aes_128_gcm(),
+            &Vec::from_hex(key).unwrap(),
+            Some(&Vec::from_hex(iv).unwrap()),
+            &Vec::from_hex(aad).unwrap(),
+            &Vec::from_hex(ct).unwrap(),
+            &Vec::from_hex(tag).unwrap(),
+        )
+        .unwrap();
+        assert_eq!(pt, hex::encode(out));
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn test_aes128_ccm() {
+        let key = "3ee186594f110fb788a8bf8aa8be5d4a";
+        let nonce = "44f705d52acf27b7f17196aa9b";
+        let aad = "2c16724296ff85e079627be3053ea95adf35722c21886baba343bd6c79b5cb57";
+
+        let pt = "d71864877f2578db092daba2d6a1f9f4698a9c356c7830a1";
+        let ct = "b4dd74e7a0cc51aea45dfb401a41d5822c96901a83247ea0";
+        let tag = "d6965f5aa6e31302a9cc2b36";
+
+        let mut actual_tag = [0; 12];
+        let out = encrypt_aead(
+            Cipher::aes_128_ccm(),
+            &Vec::from_hex(key).unwrap(),
+            Some(&Vec::from_hex(nonce).unwrap()),
+            &Vec::from_hex(aad).unwrap(),
+            &Vec::from_hex(pt).unwrap(),
+            &mut actual_tag,
+        )
+        .unwrap();
+
+        assert_eq!(ct, hex::encode(out));
+        assert_eq!(tag, hex::encode(actual_tag));
+
+        let out = decrypt_aead(
+            Cipher::aes_128_ccm(),
+            &Vec::from_hex(key).unwrap(),
+            Some(&Vec::from_hex(nonce).unwrap()),
+            &Vec::from_hex(aad).unwrap(),
+            &Vec::from_hex(ct).unwrap(),
+            &Vec::from_hex(tag).unwrap(),
+        )
+        .unwrap();
+        assert_eq!(pt, hex::encode(out));
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn test_aes128_ccm_verify_fail() {
+        let key = "3ee186594f110fb788a8bf8aa8be5d4a";
+        let nonce = "44f705d52acf27b7f17196aa9b";
+        let aad = "2c16724296ff85e079627be3053ea95adf35722c21886baba343bd6c79b5cb57";
+
+        let ct = "b4dd74e7a0cc51aea45dfb401a41d5822c96901a83247ea0";
+        let tag = "00005f5aa6e31302a9cc2b36";
+
+        let out = decrypt_aead(
+            Cipher::aes_128_ccm(),
+            &Vec::from_hex(key).unwrap(),
+            Some(&Vec::from_hex(nonce).unwrap()),
+            &Vec::from_hex(aad).unwrap(),
+            &Vec::from_hex(ct).unwrap(),
+            &Vec::from_hex(tag).unwrap(),
+        );
+        assert!(out.is_err());
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn test_aes256_ccm() {
+        let key = "7f4af6765cad1d511db07e33aaafd57646ec279db629048aa6770af24849aa0d";
+        let nonce = "dde2a362ce81b2b6913abc3095";
+        let aad = "404f5df97ece7431987bc098cce994fc3c063b519ffa47b0365226a0015ef695";
+
+        let pt = "7ebef26bf4ecf6f0ebb2eb860edbf900f27b75b4a6340fdb";
+        let ct = "353022db9c568bd7183a13c40b1ba30fcc768c54264aa2cd";
+        let tag = "2927a053c9244d3217a7ad05";
+
+        let mut actual_tag = [0; 12];
+        let out = encrypt_aead(
+            Cipher::aes_256_ccm(),
+            &Vec::from_hex(key).unwrap(),
+            Some(&Vec::from_hex(nonce).unwrap()),
+            &Vec::from_hex(aad).unwrap(),
+            &Vec::from_hex(pt).unwrap(),
+            &mut actual_tag,
+        )
+        .unwrap();
+
+        assert_eq!(ct, hex::encode(out));
+        assert_eq!(tag, hex::encode(actual_tag));
+
+        let out = decrypt_aead(
+            Cipher::aes_256_ccm(),
+            &Vec::from_hex(key).unwrap(),
+            Some(&Vec::from_hex(nonce).unwrap()),
+            &Vec::from_hex(aad).unwrap(),
+            &Vec::from_hex(ct).unwrap(),
+            &Vec::from_hex(tag).unwrap(),
+        )
+        .unwrap();
+        assert_eq!(pt, hex::encode(out));
+    }
+
+    #[test]
+    #[cfg(not(boringssl))]
+    fn test_aes256_ccm_verify_fail() {
+        let key = "7f4af6765cad1d511db07e33aaafd57646ec279db629048aa6770af24849aa0d";
+        let nonce = "dde2a362ce81b2b6913abc3095";
+        let aad = "404f5df97ece7431987bc098cce994fc3c063b519ffa47b0365226a0015ef695";
+
+        let ct = "353022db9c568bd7183a13c40b1ba30fcc768c54264aa2cd";
+        let tag = "0000a053c9244d3217a7ad05";
+
+        let out = decrypt_aead(
+            Cipher::aes_256_ccm(),
+            &Vec::from_hex(key).unwrap(),
+            Some(&Vec::from_hex(nonce).unwrap()),
+            &Vec::from_hex(aad).unwrap(),
+            &Vec::from_hex(ct).unwrap(),
+            &Vec::from_hex(tag).unwrap(),
+        );
+        assert!(out.is_err());
+    }
+
+    #[test]
+    #[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_OCB")))]
+    fn test_aes_128_ocb() {
+        let key = "000102030405060708090a0b0c0d0e0f";
+        let aad = "0001020304050607";
+        let tag = "16dc76a46d47e1ead537209e8a96d14e";
+        let iv = "000102030405060708090a0b";
+        let pt = "0001020304050607";
+        let ct = "92b657130a74b85a";
+
+        let mut actual_tag = [0; 16];
+        let out = encrypt_aead(
+            Cipher::aes_128_ocb(),
+            &Vec::from_hex(key).unwrap(),
+            Some(&Vec::from_hex(iv).unwrap()),
+            &Vec::from_hex(aad).unwrap(),
+            &Vec::from_hex(pt).unwrap(),
+            &mut actual_tag,
+        )
+        .unwrap();
+
+        assert_eq!(ct, hex::encode(out));
+        assert_eq!(tag, hex::encode(actual_tag));
+
+        let out = decrypt_aead(
+            Cipher::aes_128_ocb(),
+            &Vec::from_hex(key).unwrap(),
+            Some(&Vec::from_hex(iv).unwrap()),
+            &Vec::from_hex(aad).unwrap(),
+            &Vec::from_hex(ct).unwrap(),
+            &Vec::from_hex(tag).unwrap(),
+        )
+        .unwrap();
+        assert_eq!(pt, hex::encode(out));
+    }
+
+    #[test]
+    #[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_OCB")))]
+    fn test_aes_128_ocb_fail() {
+        let key = "000102030405060708090a0b0c0d0e0f";
+        let aad = "0001020304050607";
+        let tag = "16dc76a46d47e1ead537209e8a96d14e";
+        let iv = "000000000405060708090a0b";
+        let ct = "92b657130a74b85a";
+
+        let out = decrypt_aead(
+            Cipher::aes_128_ocb(),
+            &Vec::from_hex(key).unwrap(),
+            Some(&Vec::from_hex(iv).unwrap()),
+            &Vec::from_hex(aad).unwrap(),
+            &Vec::from_hex(ct).unwrap(),
+            &Vec::from_hex(tag).unwrap(),
+        );
+        assert!(out.is_err());
+    }
+
+    #[test]
+    #[cfg(any(ossl110, libressl310))]
+    fn test_chacha20() {
+        let key = "0000000000000000000000000000000000000000000000000000000000000000";
+        let iv = "00000000000000000000000000000000";
+        let pt =
+            "000000000000000000000000000000000000000000000000000000000000000000000000000000000\
+             00000000000000000000000000000000000000000000000";
+        let ct =
+            "76b8e0ada0f13d90405d6ae55386bd28bdd219b8a08ded1aa836efcc8b770dc7da41597c5157488d7\
+             724e03fb8d84a376a43b8f41518a11cc387b669b2ee6586";
+
+        cipher_test(Cipher::chacha20(), pt, ct, key, iv);
+    }
+
+    #[test]
+    #[cfg(any(ossl110, libressl360))]
+    fn test_chacha20_poly1305() {
+        let key = "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f";
+        let iv = "070000004041424344454647";
+        let aad = "50515253c0c1c2c3c4c5c6c7";
+        let pt =
+            "4c616469657320616e642047656e746c656d656e206f662074686520636c617373206f66202739393\
+             a204966204920636f756c64206f6666657220796f75206f6e6c79206f6e652074697020666f722074\
+             6865206675747572652c2073756e73637265656e20776f756c642062652069742e";
+        let ct =
+            "d31a8d34648e60db7b86afbc53ef7ec2a4aded51296e08fea9e2b5a736ee62d63dbea45e8ca967128\
+             2fafb69da92728b1a71de0a9e060b2905d6a5b67ecd3b3692ddbd7f2d778b8c9803aee328091b58fa\
+             b324e4fad675945585808b4831d7bc3ff4def08e4b7a9de576d26586cec64b6116";
+        let tag = "1ae10b594f09e26a7e902ecbd0600691";
+
+        let mut actual_tag = [0; 16];
+        let out = encrypt_aead(
+            Cipher::chacha20_poly1305(),
+            &Vec::from_hex(key).unwrap(),
+            Some(&Vec::from_hex(iv).unwrap()),
+            &Vec::from_hex(aad).unwrap(),
+            &Vec::from_hex(pt).unwrap(),
+            &mut actual_tag,
+        )
+        .unwrap();
+        assert_eq!(ct, hex::encode(out));
+        assert_eq!(tag, hex::encode(actual_tag));
+
+        let out = decrypt_aead(
+            Cipher::chacha20_poly1305(),
+            &Vec::from_hex(key).unwrap(),
+            Some(&Vec::from_hex(iv).unwrap()),
+            &Vec::from_hex(aad).unwrap(),
+            &Vec::from_hex(ct).unwrap(),
+            &Vec::from_hex(tag).unwrap(),
+        )
+        .unwrap();
+        assert_eq!(pt, hex::encode(out));
+    }
+
+    #[test]
+    #[cfg(not(any(osslconf = "OPENSSL_NO_SEED", ossl300)))]
+    fn test_seed_cbc() {
+        #[cfg(ossl300)]
+        let _provider = crate::provider::Provider::try_load(None, "legacy", true).unwrap();
+
+        let pt = "5363686f6b6f6c6164656e6b756368656e0a";
+        let ct = "c2edf0fb2eb11bf7b2f39417a8528896d34b24b6fd79e5923b116dfcd2aba5a4";
+        let key = "41414141414141414141414141414141";
+        let iv = "41414141414141414141414141414141";
+
+        cipher_test(super::Cipher::seed_cbc(), pt, ct, key, iv);
+    }
+
+    #[test]
+    #[cfg(not(any(osslconf = "OPENSSL_NO_SEED", ossl300)))]
+    fn test_seed_cfb128() {
+        #[cfg(ossl300)]
+        let _provider = crate::provider::Provider::try_load(None, "legacy", true).unwrap();
+
+        let pt = "5363686f6b6f6c6164656e6b756368656e0a";
+        let ct = "71d4d25fc1750cb7789259e7f34061939a41";
+        let key = "41414141414141414141414141414141";
+        let iv = "41414141414141414141414141414141";
+
+        cipher_test(super::Cipher::seed_cfb128(), pt, ct, key, iv);
+    }
+
+    #[test]
+    #[cfg(not(any(osslconf = "OPENSSL_NO_SEED", ossl300)))]
+    fn test_seed_ecb() {
+        #[cfg(ossl300)]
+        let _provider = crate::provider::Provider::try_load(None, "legacy", true).unwrap();
+
+        let pt = "5363686f6b6f6c6164656e6b756368656e0a";
+        let ct = "0263a9cd498cf0edb0ef72a3231761d00ce601f7d08ad19ad74f0815f2c77f7e";
+        let key = "41414141414141414141414141414141";
+        let iv = "41414141414141414141414141414141";
+
+        cipher_test(super::Cipher::seed_ecb(), pt, ct, key, iv);
+    }
+
+    #[test]
+    #[cfg(not(any(osslconf = "OPENSSL_NO_SEED", ossl300)))]
+    fn test_seed_ofb() {
+        #[cfg(ossl300)]
+        let _provider = crate::provider::Provider::try_load(None, "legacy", true).unwrap();
+
+        let pt = "5363686f6b6f6c6164656e6b756368656e0a";
+        let ct = "71d4d25fc1750cb7789259e7f34061930afd";
+        let key = "41414141414141414141414141414141";
+        let iv = "41414141414141414141414141414141";
+
+        cipher_test(super::Cipher::seed_ofb(), pt, ct, key, iv);
+    }
+
+    // GB/T 32907-2016
+    // http://openstd.samr.gov.cn/bzgk/gb/newGbInfo?hcno=7803DE42D3BC5E80B0C3E5D8E873D56A
+    #[test]
+    #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM4")))]
+    fn test_sm4_ecb() {
+        use std::mem;
+
+        let key = vec![
+            0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54,
+            0x32, 0x10,
+        ];
+        let pt = vec![
+            0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54,
+            0x32, 0x10,
+        ];
+        let ct = vec![
+            0x68, 0x1e, 0xdf, 0x34, 0xd2, 0x06, 0x96, 0x5e, 0x86, 0xb3, 0xe9, 0x4f, 0x53, 0x6e,
+            0x42, 0x46,
+        ];
+        let ct1 = vec![
+            0x59, 0x52, 0x98, 0xc7, 0xc6, 0xfd, 0x27, 0x1f, 0x04, 0x02, 0xf8, 0x04, 0xc3, 0x3d,
+            0x3f, 0x66,
+        ];
+
+        let block_size = Cipher::sm4_ecb().block_size();
+        let mut c = Crypter::new(Cipher::sm4_ecb(), Mode::Encrypt, &key, None).unwrap();
+        c.pad(false);
+
+        // 1 round
+        let mut r = vec![0; pt.len() + Cipher::sm4_ecb().block_size()];
+        let count = c.update(&pt, &mut r).unwrap();
+        assert_eq!(ct, &r[..count]);
+
+        // 1000000 rounds
+        let mut r1 = vec![0; pt.len() + Cipher::sm4_ecb().block_size()];
+        for _ in 0..999999 {
+            c.update(&r[..block_size], &mut r1).unwrap();
+            mem::swap(&mut r, &mut r1);
+        }
+        assert_eq!(ct1, &r[..count]);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/util.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/util.rs
--- 43.0.0-1/rust-vendor/openssl/src/util.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/util.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,93 @@
+use crate::error::ErrorStack;
+use foreign_types::{ForeignType, ForeignTypeRef};
+use libc::{c_char, c_int, c_void};
+use std::any::Any;
+use std::panic::{self, AssertUnwindSafe};
+use std::slice;
+
+/// Wraps a user-supplied callback and a slot for panics thrown inside the callback (while FFI
+/// frames are on the stack).
+///
+/// When dropped, checks if the callback has panicked, and resumes unwinding if so.
+pub struct CallbackState<F> {
+    /// The user callback. Taken out of the `Option` when called.
+    cb: Option<F>,
+    /// If the callback panics, we place the panic object here, to be re-thrown once OpenSSL
+    /// returns.
+    panic: Option<Box<dyn Any + Send + 'static>>,
+}
+
+impl<F> CallbackState<F> {
+    pub fn new(callback: F) -> Self {
+        CallbackState {
+            cb: Some(callback),
+            panic: None,
+        }
+    }
+}
+
+impl<F> Drop for CallbackState<F> {
+    fn drop(&mut self) {
+        if let Some(panic) = self.panic.take() {
+            panic::resume_unwind(panic);
+        }
+    }
+}
+
+/// Password callback function, passed to private key loading functions.
+///
+/// `cb_state` is expected to be a pointer to a `CallbackState`.
+pub unsafe extern "C" fn invoke_passwd_cb<F>(
+    buf: *mut c_char,
+    size: c_int,
+    _rwflag: c_int,
+    cb_state: *mut c_void,
+) -> c_int
+where
+    F: FnOnce(&mut [u8]) -> Result<usize, ErrorStack>,
+{
+    let callback = &mut *(cb_state as *mut CallbackState<F>);
+
+    let result = panic::catch_unwind(AssertUnwindSafe(|| {
+        let pass_slice = slice::from_raw_parts_mut(buf as *mut u8, size as usize);
+        callback.cb.take().unwrap()(pass_slice)
+    }));
+
+    match result {
+        Ok(Ok(len)) => len as c_int,
+        Ok(Err(_)) => {
+            // FIXME restore error stack
+            0
+        }
+        Err(err) => {
+            callback.panic = Some(err);
+            0
+        }
+    }
+}
+
+pub trait ForeignTypeExt: ForeignType {
+    unsafe fn from_ptr_opt(ptr: *mut Self::CType) -> Option<Self> {
+        if ptr.is_null() {
+            None
+        } else {
+            Some(Self::from_ptr(ptr))
+        }
+    }
+}
+impl<FT: ForeignType> ForeignTypeExt for FT {}
+
+pub trait ForeignTypeRefExt: ForeignTypeRef {
+    unsafe fn from_const_ptr<'a>(ptr: *const Self::CType) -> &'a Self {
+        Self::from_ptr(ptr as *mut Self::CType)
+    }
+
+    unsafe fn from_const_ptr_opt<'a>(ptr: *const Self::CType) -> Option<&'a Self> {
+        if ptr.is_null() {
+            None
+        } else {
+            Some(Self::from_const_ptr(ptr as *mut Self::CType))
+        }
+    }
+}
+impl<FT: ForeignTypeRef> ForeignTypeRefExt for FT {}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/version.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/version.rs
--- 43.0.0-1/rust-vendor/openssl/src/version.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/version.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,135 @@
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+//! Build and version information.
+
+use cfg_if::cfg_if;
+use openssl_macros::corresponds;
+use std::ffi::CStr;
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl271))] {
+        use ffi::{
+            OPENSSL_VERSION, OPENSSL_CFLAGS, OPENSSL_BUILT_ON, OPENSSL_PLATFORM, OPENSSL_DIR,
+            OpenSSL_version_num, OpenSSL_version,
+        };
+    } else {
+        use ffi::{
+            SSLEAY_VERSION as OPENSSL_VERSION, SSLEAY_CFLAGS as OPENSSL_CFLAGS,
+            SSLEAY_BUILT_ON as OPENSSL_BUILT_ON, SSLEAY_PLATFORM as OPENSSL_PLATFORM,
+            SSLEAY_DIR as OPENSSL_DIR, SSLeay as OpenSSL_version_num,
+            SSLeay_version as OpenSSL_version,
+        };
+    }
+}
+
+/// OPENSSL_VERSION_NUMBER is a numeric release version identifier:
+///
+/// `MNNFFPPS: major minor fix patch status`
+///
+/// The status nibble has one of the values 0 for development, 1 to e for betas 1 to 14, and f for release.
+///
+/// for example
+///
+/// `0x000906000 == 0.9.6 dev`
+/// `0x000906023 == 0.9.6b beta 3`
+/// `0x00090605f == 0.9.6e release`
+#[corresponds(OpenSSL_version_num)]
+pub fn number() -> i64 {
+    unsafe { OpenSSL_version_num() as i64 }
+}
+
+/// The text variant of the version number and the release date. For example, "OpenSSL 0.9.5a 1 Apr 2000".
+#[corresponds(OpenSSL_version)]
+pub fn version() -> &'static str {
+    unsafe {
+        CStr::from_ptr(OpenSSL_version(OPENSSL_VERSION))
+            .to_str()
+            .unwrap()
+    }
+}
+
+/// The compiler flags set for the compilation process in the form "compiler: ..." if available or
+/// "compiler: information not available" otherwise.
+#[corresponds(OpenSSL_version)]
+pub fn c_flags() -> &'static str {
+    unsafe {
+        CStr::from_ptr(OpenSSL_version(OPENSSL_CFLAGS))
+            .to_str()
+            .unwrap()
+    }
+}
+
+/// The date of the build process in the form "built on: ..." if available or "built on: date not available" otherwise.
+#[corresponds(OpenSSL_version)]
+pub fn built_on() -> &'static str {
+    unsafe {
+        CStr::from_ptr(OpenSSL_version(OPENSSL_BUILT_ON))
+            .to_str()
+            .unwrap()
+    }
+}
+
+/// The "Configure" target of the library build in the form "platform: ..." if available or "platform: information not available" otherwise.
+#[corresponds(OpenSSL_version)]
+pub fn platform() -> &'static str {
+    unsafe {
+        CStr::from_ptr(OpenSSL_version(OPENSSL_PLATFORM))
+            .to_str()
+            .unwrap()
+    }
+}
+
+/// The "OPENSSLDIR" setting of the library build in the form "OPENSSLDIR: "..."" if available or "OPENSSLDIR: N/A" otherwise.
+#[corresponds(OpenSSL_version)]
+pub fn dir() -> &'static str {
+    unsafe {
+        CStr::from_ptr(OpenSSL_version(OPENSSL_DIR))
+            .to_str()
+            .unwrap()
+    }
+}
+
+/// This test ensures that we do not segfault when calling the functions of this module
+/// and that the strings respect a reasonable format.
+#[test]
+fn test_versions() {
+    println!("Number: '{}'", number());
+    println!("Version: '{}'", version());
+    println!("C flags: '{}'", c_flags());
+    println!("Built on: '{}'", built_on());
+    println!("Platform: '{}'", platform());
+    println!("Dir: '{}'", dir());
+
+    #[cfg(not(any(libressl, boringssl)))]
+    fn expected_name() -> &'static str {
+        "OpenSSL"
+    }
+    #[cfg(libressl)]
+    fn expected_name() -> &'static str {
+        "LibreSSL"
+    }
+    #[cfg(boringssl)]
+    fn expected_name() -> &'static str {
+        "BoringSSL"
+    }
+
+    assert!(number() > 0);
+    assert!(version().starts_with(expected_name()));
+    assert!(c_flags().starts_with("compiler:"));
+    // some distributions patch out dates out of openssl so that the builds are reproducible
+    if !built_on().is_empty() {
+        assert!(built_on().starts_with("built on:"));
+    }
+    assert!(dir().starts_with("OPENSSLDIR:"));
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/x509/extension.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/x509/extension.rs
--- 43.0.0-1/rust-vendor/openssl/src/x509/extension.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/x509/extension.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,562 @@
+//! Add extensions to an `X509` certificate or certificate request.
+//!
+//! The extensions defined for X.509 v3 certificates provide methods for
+//! associating additional attributes with users or public keys and for
+//! managing relationships between CAs. The extensions created using this
+//! module can be used with `X509v3Context` objects.
+//!
+//! # Example
+//!
+//! ```rust
+//! use openssl::x509::extension::BasicConstraints;
+//! use openssl::x509::X509Extension;
+//!
+//! let mut bc = BasicConstraints::new();
+//! let bc = bc.critical().ca().pathlen(1);
+//!
+//! let extension: X509Extension = bc.build().unwrap();
+//! ```
+use std::fmt::Write;
+
+use crate::asn1::Asn1Object;
+use crate::error::ErrorStack;
+use crate::nid::Nid;
+use crate::x509::{GeneralName, Stack, X509Extension, X509v3Context};
+use foreign_types::ForeignType;
+
+/// An extension which indicates whether a certificate is a CA certificate.
+pub struct BasicConstraints {
+    critical: bool,
+    ca: bool,
+    pathlen: Option<u32>,
+}
+
+impl Default for BasicConstraints {
+    fn default() -> BasicConstraints {
+        BasicConstraints::new()
+    }
+}
+
+impl BasicConstraints {
+    /// Construct a new `BasicConstraints` extension.
+    pub fn new() -> BasicConstraints {
+        BasicConstraints {
+            critical: false,
+            ca: false,
+            pathlen: None,
+        }
+    }
+
+    /// Sets the `critical` flag to `true`. The extension will be critical.
+    pub fn critical(&mut self) -> &mut BasicConstraints {
+        self.critical = true;
+        self
+    }
+
+    /// Sets the `ca` flag to `true`.
+    pub fn ca(&mut self) -> &mut BasicConstraints {
+        self.ca = true;
+        self
+    }
+
+    /// Sets the `pathlen` to an optional non-negative value. The `pathlen` is the
+    /// maximum number of CAs that can appear below this one in a chain.
+    pub fn pathlen(&mut self, pathlen: u32) -> &mut BasicConstraints {
+        self.pathlen = Some(pathlen);
+        self
+    }
+
+    /// Return the `BasicConstraints` extension as an `X509Extension`.
+    // Temporarily silence the deprecation warning - this should be ported to
+    // `X509Extension::new_internal`.
+    #[allow(deprecated)]
+    pub fn build(&self) -> Result<X509Extension, ErrorStack> {
+        let mut value = String::new();
+        if self.critical {
+            value.push_str("critical,");
+        }
+        value.push_str("CA:");
+        if self.ca {
+            value.push_str("TRUE");
+        } else {
+            value.push_str("FALSE");
+        }
+        if let Some(pathlen) = self.pathlen {
+            write!(value, ",pathlen:{}", pathlen).unwrap();
+        }
+        X509Extension::new_nid(None, None, Nid::BASIC_CONSTRAINTS, &value)
+    }
+}
+
+/// An extension consisting of a list of names of the permitted key usages.
+pub struct KeyUsage {
+    critical: bool,
+    digital_signature: bool,
+    non_repudiation: bool,
+    key_encipherment: bool,
+    data_encipherment: bool,
+    key_agreement: bool,
+    key_cert_sign: bool,
+    crl_sign: bool,
+    encipher_only: bool,
+    decipher_only: bool,
+}
+
+impl Default for KeyUsage {
+    fn default() -> KeyUsage {
+        KeyUsage::new()
+    }
+}
+
+impl KeyUsage {
+    /// Construct a new `KeyUsage` extension.
+    pub fn new() -> KeyUsage {
+        KeyUsage {
+            critical: false,
+            digital_signature: false,
+            non_repudiation: false,
+            key_encipherment: false,
+            data_encipherment: false,
+            key_agreement: false,
+            key_cert_sign: false,
+            crl_sign: false,
+            encipher_only: false,
+            decipher_only: false,
+        }
+    }
+
+    /// Sets the `critical` flag to `true`. The extension will be critical.
+    pub fn critical(&mut self) -> &mut KeyUsage {
+        self.critical = true;
+        self
+    }
+
+    /// Sets the `digitalSignature` flag to `true`.
+    pub fn digital_signature(&mut self) -> &mut KeyUsage {
+        self.digital_signature = true;
+        self
+    }
+
+    /// Sets the `nonRepudiation` flag to `true`.
+    pub fn non_repudiation(&mut self) -> &mut KeyUsage {
+        self.non_repudiation = true;
+        self
+    }
+
+    /// Sets the `keyEncipherment` flag to `true`.
+    pub fn key_encipherment(&mut self) -> &mut KeyUsage {
+        self.key_encipherment = true;
+        self
+    }
+
+    /// Sets the `dataEncipherment` flag to `true`.
+    pub fn data_encipherment(&mut self) -> &mut KeyUsage {
+        self.data_encipherment = true;
+        self
+    }
+
+    /// Sets the `keyAgreement` flag to `true`.
+    pub fn key_agreement(&mut self) -> &mut KeyUsage {
+        self.key_agreement = true;
+        self
+    }
+
+    /// Sets the `keyCertSign` flag to `true`.
+    pub fn key_cert_sign(&mut self) -> &mut KeyUsage {
+        self.key_cert_sign = true;
+        self
+    }
+
+    /// Sets the `cRLSign` flag to `true`.
+    pub fn crl_sign(&mut self) -> &mut KeyUsage {
+        self.crl_sign = true;
+        self
+    }
+
+    /// Sets the `encipherOnly` flag to `true`.
+    pub fn encipher_only(&mut self) -> &mut KeyUsage {
+        self.encipher_only = true;
+        self
+    }
+
+    /// Sets the `decipherOnly` flag to `true`.
+    pub fn decipher_only(&mut self) -> &mut KeyUsage {
+        self.decipher_only = true;
+        self
+    }
+
+    /// Return the `KeyUsage` extension as an `X509Extension`.
+    // Temporarily silence the deprecation warning - this should be ported to
+    // `X509Extension::new_internal`.
+    #[allow(deprecated)]
+    pub fn build(&self) -> Result<X509Extension, ErrorStack> {
+        let mut value = String::new();
+        let mut first = true;
+        append(&mut value, &mut first, self.critical, "critical");
+        append(
+            &mut value,
+            &mut first,
+            self.digital_signature,
+            "digitalSignature",
+        );
+        append(
+            &mut value,
+            &mut first,
+            self.non_repudiation,
+            "nonRepudiation",
+        );
+        append(
+            &mut value,
+            &mut first,
+            self.key_encipherment,
+            "keyEncipherment",
+        );
+        append(
+            &mut value,
+            &mut first,
+            self.data_encipherment,
+            "dataEncipherment",
+        );
+        append(&mut value, &mut first, self.key_agreement, "keyAgreement");
+        append(&mut value, &mut first, self.key_cert_sign, "keyCertSign");
+        append(&mut value, &mut first, self.crl_sign, "cRLSign");
+        append(&mut value, &mut first, self.encipher_only, "encipherOnly");
+        append(&mut value, &mut first, self.decipher_only, "decipherOnly");
+        X509Extension::new_nid(None, None, Nid::KEY_USAGE, &value)
+    }
+}
+
+/// An extension consisting of a list of usages indicating purposes
+/// for which the certificate public key can be used for.
+pub struct ExtendedKeyUsage {
+    critical: bool,
+    items: Vec<String>,
+}
+
+impl Default for ExtendedKeyUsage {
+    fn default() -> ExtendedKeyUsage {
+        ExtendedKeyUsage::new()
+    }
+}
+
+impl ExtendedKeyUsage {
+    /// Construct a new `ExtendedKeyUsage` extension.
+    pub fn new() -> ExtendedKeyUsage {
+        ExtendedKeyUsage {
+            critical: false,
+            items: vec![],
+        }
+    }
+
+    /// Sets the `critical` flag to `true`. The extension will be critical.
+    pub fn critical(&mut self) -> &mut ExtendedKeyUsage {
+        self.critical = true;
+        self
+    }
+
+    /// Sets the `serverAuth` flag to `true`.
+    pub fn server_auth(&mut self) -> &mut ExtendedKeyUsage {
+        self.other("serverAuth")
+    }
+
+    /// Sets the `clientAuth` flag to `true`.
+    pub fn client_auth(&mut self) -> &mut ExtendedKeyUsage {
+        self.other("clientAuth")
+    }
+
+    /// Sets the `codeSigning` flag to `true`.
+    pub fn code_signing(&mut self) -> &mut ExtendedKeyUsage {
+        self.other("codeSigning")
+    }
+
+    /// Sets the `emailProtection` flag to `true`.
+    pub fn email_protection(&mut self) -> &mut ExtendedKeyUsage {
+        self.other("emailProtection")
+    }
+
+    /// Sets the `timeStamping` flag to `true`.
+    pub fn time_stamping(&mut self) -> &mut ExtendedKeyUsage {
+        self.other("timeStamping")
+    }
+
+    /// Sets the `msCodeInd` flag to `true`.
+    pub fn ms_code_ind(&mut self) -> &mut ExtendedKeyUsage {
+        self.other("msCodeInd")
+    }
+
+    /// Sets the `msCodeCom` flag to `true`.
+    pub fn ms_code_com(&mut self) -> &mut ExtendedKeyUsage {
+        self.other("msCodeCom")
+    }
+
+    /// Sets the `msCTLSign` flag to `true`.
+    pub fn ms_ctl_sign(&mut self) -> &mut ExtendedKeyUsage {
+        self.other("msCTLSign")
+    }
+
+    /// Sets the `msSGC` flag to `true`.
+    pub fn ms_sgc(&mut self) -> &mut ExtendedKeyUsage {
+        self.other("msSGC")
+    }
+
+    /// Sets the `msEFS` flag to `true`.
+    pub fn ms_efs(&mut self) -> &mut ExtendedKeyUsage {
+        self.other("msEFS")
+    }
+
+    /// Sets the `nsSGC` flag to `true`.
+    pub fn ns_sgc(&mut self) -> &mut ExtendedKeyUsage {
+        self.other("nsSGC")
+    }
+
+    /// Sets a flag not already defined.
+    pub fn other(&mut self, other: &str) -> &mut ExtendedKeyUsage {
+        self.items.push(other.to_string());
+        self
+    }
+
+    /// Return the `ExtendedKeyUsage` extension as an `X509Extension`.
+    pub fn build(&self) -> Result<X509Extension, ErrorStack> {
+        let mut stack = Stack::new()?;
+        for item in &self.items {
+            stack.push(Asn1Object::from_str(item)?)?;
+        }
+        unsafe {
+            X509Extension::new_internal(Nid::EXT_KEY_USAGE, self.critical, stack.as_ptr().cast())
+        }
+    }
+}
+
+/// An extension that provides a means of identifying certificates that contain a
+/// particular public key.
+pub struct SubjectKeyIdentifier {
+    critical: bool,
+}
+
+impl Default for SubjectKeyIdentifier {
+    fn default() -> SubjectKeyIdentifier {
+        SubjectKeyIdentifier::new()
+    }
+}
+
+impl SubjectKeyIdentifier {
+    /// Construct a new `SubjectKeyIdentifier` extension.
+    pub fn new() -> SubjectKeyIdentifier {
+        SubjectKeyIdentifier { critical: false }
+    }
+
+    /// Sets the `critical` flag to `true`. The extension will be critical.
+    pub fn critical(&mut self) -> &mut SubjectKeyIdentifier {
+        self.critical = true;
+        self
+    }
+
+    /// Return a `SubjectKeyIdentifier` extension as an `X509Extension`.
+    // Temporarily silence the deprecation warning - this should be ported to
+    // `X509Extension::new_internal`.
+    #[allow(deprecated)]
+    pub fn build(&self, ctx: &X509v3Context<'_>) -> Result<X509Extension, ErrorStack> {
+        let mut value = String::new();
+        let mut first = true;
+        append(&mut value, &mut first, self.critical, "critical");
+        append(&mut value, &mut first, true, "hash");
+        X509Extension::new_nid(None, Some(ctx), Nid::SUBJECT_KEY_IDENTIFIER, &value)
+    }
+}
+
+/// An extension that provides a means of identifying the public key corresponding
+/// to the private key used to sign a CRL.
+pub struct AuthorityKeyIdentifier {
+    critical: bool,
+    keyid: Option<bool>,
+    issuer: Option<bool>,
+}
+
+impl Default for AuthorityKeyIdentifier {
+    fn default() -> AuthorityKeyIdentifier {
+        AuthorityKeyIdentifier::new()
+    }
+}
+
+impl AuthorityKeyIdentifier {
+    /// Construct a new `AuthorityKeyIdentifier` extension.
+    pub fn new() -> AuthorityKeyIdentifier {
+        AuthorityKeyIdentifier {
+            critical: false,
+            keyid: None,
+            issuer: None,
+        }
+    }
+
+    /// Sets the `critical` flag to `true`. The extension will be critical.
+    pub fn critical(&mut self) -> &mut AuthorityKeyIdentifier {
+        self.critical = true;
+        self
+    }
+
+    /// Sets the `keyid` flag.
+    pub fn keyid(&mut self, always: bool) -> &mut AuthorityKeyIdentifier {
+        self.keyid = Some(always);
+        self
+    }
+
+    /// Sets the `issuer` flag.
+    pub fn issuer(&mut self, always: bool) -> &mut AuthorityKeyIdentifier {
+        self.issuer = Some(always);
+        self
+    }
+
+    /// Return a `AuthorityKeyIdentifier` extension as an `X509Extension`.
+    // Temporarily silence the deprecation warning - this should be ported to
+    // `X509Extension::new_internal`.
+    #[allow(deprecated)]
+    pub fn build(&self, ctx: &X509v3Context<'_>) -> Result<X509Extension, ErrorStack> {
+        let mut value = String::new();
+        let mut first = true;
+        append(&mut value, &mut first, self.critical, "critical");
+        match self.keyid {
+            Some(true) => append(&mut value, &mut first, true, "keyid:always"),
+            Some(false) => append(&mut value, &mut first, true, "keyid"),
+            None => {}
+        }
+        match self.issuer {
+            Some(true) => append(&mut value, &mut first, true, "issuer:always"),
+            Some(false) => append(&mut value, &mut first, true, "issuer"),
+            None => {}
+        }
+        X509Extension::new_nid(None, Some(ctx), Nid::AUTHORITY_KEY_IDENTIFIER, &value)
+    }
+}
+
+enum RustGeneralName {
+    Dns(String),
+    Email(String),
+    Uri(String),
+    Ip(String),
+    Rid(String),
+    OtherName(Asn1Object, Vec<u8>),
+}
+
+/// An extension that allows additional identities to be bound to the subject
+/// of the certificate.
+pub struct SubjectAlternativeName {
+    critical: bool,
+    items: Vec<RustGeneralName>,
+}
+
+impl Default for SubjectAlternativeName {
+    fn default() -> SubjectAlternativeName {
+        SubjectAlternativeName::new()
+    }
+}
+
+impl SubjectAlternativeName {
+    /// Construct a new `SubjectAlternativeName` extension.
+    pub fn new() -> SubjectAlternativeName {
+        SubjectAlternativeName {
+            critical: false,
+            items: vec![],
+        }
+    }
+
+    /// Sets the `critical` flag to `true`. The extension will be critical.
+    pub fn critical(&mut self) -> &mut SubjectAlternativeName {
+        self.critical = true;
+        self
+    }
+
+    /// Sets the `email` flag.
+    pub fn email(&mut self, email: &str) -> &mut SubjectAlternativeName {
+        self.items.push(RustGeneralName::Email(email.to_string()));
+        self
+    }
+
+    /// Sets the `uri` flag.
+    pub fn uri(&mut self, uri: &str) -> &mut SubjectAlternativeName {
+        self.items.push(RustGeneralName::Uri(uri.to_string()));
+        self
+    }
+
+    /// Sets the `dns` flag.
+    pub fn dns(&mut self, dns: &str) -> &mut SubjectAlternativeName {
+        self.items.push(RustGeneralName::Dns(dns.to_string()));
+        self
+    }
+
+    /// Sets the `rid` flag.
+    pub fn rid(&mut self, rid: &str) -> &mut SubjectAlternativeName {
+        self.items.push(RustGeneralName::Rid(rid.to_string()));
+        self
+    }
+
+    /// Sets the `ip` flag.
+    pub fn ip(&mut self, ip: &str) -> &mut SubjectAlternativeName {
+        self.items.push(RustGeneralName::Ip(ip.to_string()));
+        self
+    }
+
+    /// Sets the `dirName` flag.
+    ///
+    /// Not currently actually supported, always panics.
+    #[deprecated = "dir_name is deprecated and always panics. Please file a bug if you have a use case for this."]
+    pub fn dir_name(&mut self, _dir_name: &str) -> &mut SubjectAlternativeName {
+        unimplemented!(
+            "This has not yet been adapted for the new internals. File a bug if you need this."
+        );
+    }
+
+    /// Sets the `otherName` flag.
+    ///
+    /// Not currently actually supported, always panics. Please use other_name2
+    #[deprecated = "other_name is deprecated and always panics. Please use other_name2."]
+    pub fn other_name(&mut self, _other_name: &str) -> &mut SubjectAlternativeName {
+        unimplemented!("This has not yet been adapted for the new internals. Use other_name2.");
+    }
+
+    /// Sets the `otherName` flag.
+    ///
+    /// `content` must be a valid der encoded ASN1_TYPE
+    ///
+    /// If you want to add just a ia5string use `other_name_ia5string`
+    pub fn other_name2(&mut self, oid: Asn1Object, content: &[u8]) -> &mut SubjectAlternativeName {
+        self.items
+            .push(RustGeneralName::OtherName(oid, content.into()));
+        self
+    }
+
+    /// Return a `SubjectAlternativeName` extension as an `X509Extension`.
+    pub fn build(&self, _ctx: &X509v3Context<'_>) -> Result<X509Extension, ErrorStack> {
+        let mut stack = Stack::new()?;
+        for item in &self.items {
+            let gn = match item {
+                RustGeneralName::Dns(s) => GeneralName::new_dns(s.as_bytes())?,
+                RustGeneralName::Email(s) => GeneralName::new_email(s.as_bytes())?,
+                RustGeneralName::Uri(s) => GeneralName::new_uri(s.as_bytes())?,
+                RustGeneralName::Ip(s) => {
+                    GeneralName::new_ip(s.parse().map_err(|_| ErrorStack::get())?)?
+                }
+                RustGeneralName::Rid(s) => GeneralName::new_rid(Asn1Object::from_str(s)?)?,
+                RustGeneralName::OtherName(oid, content) => {
+                    GeneralName::new_other_name(oid.clone(), content)?
+                }
+            };
+            stack.push(gn)?;
+        }
+
+        unsafe {
+            X509Extension::new_internal(Nid::SUBJECT_ALT_NAME, self.critical, stack.as_ptr().cast())
+        }
+    }
+}
+
+fn append(value: &mut String, first: &mut bool, should: bool, element: &str) {
+    if !should {
+        return;
+    }
+
+    if !*first {
+        value.push(',');
+    }
+    *first = false;
+    value.push_str(element);
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/x509/mod.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/x509/mod.rs
--- 43.0.0-1/rust-vendor/openssl/src/x509/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/x509/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,2595 @@
+//! The standard defining the format of public key certificates.
+//!
+//! An `X509` certificate binds an identity to a public key, and is either
+//! signed by a certificate authority (CA) or self-signed. An entity that gets
+//! a hold of a certificate can both verify your identity (via a CA) and encrypt
+//! data with the included public key. `X509` certificates are used in many
+//! Internet protocols, including SSL/TLS, which is the basis for HTTPS,
+//! the secure protocol for browsing the web.
+
+use cfg_if::cfg_if;
+use foreign_types::{ForeignType, ForeignTypeRef, Opaque};
+use libc::{c_int, c_long, c_uint, c_void};
+use std::cmp::{self, Ordering};
+use std::convert::{TryFrom, TryInto};
+use std::error::Error;
+use std::ffi::{CStr, CString};
+use std::fmt;
+use std::marker::PhantomData;
+use std::mem;
+use std::net::IpAddr;
+use std::path::Path;
+use std::ptr;
+use std::slice;
+use std::str;
+
+use crate::asn1::{
+    Asn1BitStringRef, Asn1Enumerated, Asn1IntegerRef, Asn1Object, Asn1ObjectRef,
+    Asn1OctetStringRef, Asn1StringRef, Asn1TimeRef, Asn1Type,
+};
+use crate::bio::MemBioSlice;
+use crate::conf::ConfRef;
+use crate::error::ErrorStack;
+use crate::ex_data::Index;
+use crate::hash::{DigestBytes, MessageDigest};
+use crate::nid::Nid;
+use crate::pkey::{HasPrivate, HasPublic, PKey, PKeyRef, Public};
+use crate::ssl::SslRef;
+use crate::stack::{Stack, StackRef, Stackable};
+use crate::string::OpensslString;
+use crate::util::{ForeignTypeExt, ForeignTypeRefExt};
+use crate::{cvt, cvt_n, cvt_p, cvt_p_const};
+use openssl_macros::corresponds;
+
+#[cfg(any(ossl102, boringssl, libressl261))]
+pub mod verify;
+
+pub mod extension;
+pub mod store;
+
+#[cfg(test)]
+mod tests;
+
+/// A type of X509 extension.
+///
+/// # Safety
+/// The value of NID and Output must match those in OpenSSL so that
+/// `Output::from_ptr_opt(*_get_ext_d2i(*, NID, ...))` is valid.
+pub unsafe trait ExtensionType {
+    const NID: Nid;
+    type Output: ForeignType;
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::X509_STORE_CTX;
+    fn drop = ffi::X509_STORE_CTX_free;
+
+    /// An `X509` certificate store context.
+    pub struct X509StoreContext;
+
+    /// A reference to an [`X509StoreContext`].
+    pub struct X509StoreContextRef;
+}
+
+impl X509StoreContext {
+    /// Returns the index which can be used to obtain a reference to the `Ssl` associated with a
+    /// context.
+    #[corresponds(SSL_get_ex_data_X509_STORE_CTX_idx)]
+    pub fn ssl_idx() -> Result<Index<X509StoreContext, SslRef>, ErrorStack> {
+        unsafe { cvt_n(ffi::SSL_get_ex_data_X509_STORE_CTX_idx()).map(|idx| Index::from_raw(idx)) }
+    }
+
+    /// Creates a new `X509StoreContext` instance.
+    #[corresponds(X509_STORE_CTX_new)]
+    pub fn new() -> Result<X509StoreContext, ErrorStack> {
+        unsafe {
+            ffi::init();
+            cvt_p(ffi::X509_STORE_CTX_new()).map(X509StoreContext)
+        }
+    }
+}
+
+impl X509StoreContextRef {
+    /// Returns application data pertaining to an `X509` store context.
+    #[corresponds(X509_STORE_CTX_get_ex_data)]
+    pub fn ex_data<T>(&self, index: Index<X509StoreContext, T>) -> Option<&T> {
+        unsafe {
+            let data = ffi::X509_STORE_CTX_get_ex_data(self.as_ptr(), index.as_raw());
+            if data.is_null() {
+                None
+            } else {
+                Some(&*(data as *const T))
+            }
+        }
+    }
+
+    /// Returns the error code of the context.
+    #[corresponds(X509_STORE_CTX_get_error)]
+    pub fn error(&self) -> X509VerifyResult {
+        unsafe { X509VerifyResult::from_raw(ffi::X509_STORE_CTX_get_error(self.as_ptr())) }
+    }
+
+    /// Initializes this context with the given certificate, certificates chain and certificate
+    /// store. After initializing the context, the `with_context` closure is called with the prepared
+    /// context. As long as the closure is running, the context stays initialized and can be used
+    /// to e.g. verify a certificate. The context will be cleaned up, after the closure finished.
+    ///
+    /// * `trust` - The certificate store with the trusted certificates.
+    /// * `cert` - The certificate that should be verified.
+    /// * `cert_chain` - The certificates chain.
+    /// * `with_context` - The closure that is called with the initialized context.
+    ///
+    /// This corresponds to [`X509_STORE_CTX_init`] before calling `with_context` and to
+    /// [`X509_STORE_CTX_cleanup`] after calling `with_context`.
+    ///
+    /// [`X509_STORE_CTX_init`]:  https://www.openssl.org/docs/manmaster/crypto/X509_STORE_CTX_init.html
+    /// [`X509_STORE_CTX_cleanup`]:  https://www.openssl.org/docs/manmaster/crypto/X509_STORE_CTX_cleanup.html
+    pub fn init<F, T>(
+        &mut self,
+        trust: &store::X509StoreRef,
+        cert: &X509Ref,
+        cert_chain: &StackRef<X509>,
+        with_context: F,
+    ) -> Result<T, ErrorStack>
+    where
+        F: FnOnce(&mut X509StoreContextRef) -> Result<T, ErrorStack>,
+    {
+        struct Cleanup<'a>(&'a mut X509StoreContextRef);
+
+        impl<'a> Drop for Cleanup<'a> {
+            fn drop(&mut self) {
+                unsafe {
+                    ffi::X509_STORE_CTX_cleanup(self.0.as_ptr());
+                }
+            }
+        }
+
+        unsafe {
+            cvt(ffi::X509_STORE_CTX_init(
+                self.as_ptr(),
+                trust.as_ptr(),
+                cert.as_ptr(),
+                cert_chain.as_ptr(),
+            ))?;
+
+            let cleanup = Cleanup(self);
+            with_context(cleanup.0)
+        }
+    }
+
+    /// Verifies the stored certificate.
+    ///
+    /// Returns `true` if verification succeeds. The `error` method will return the specific
+    /// validation error if the certificate was not valid.
+    ///
+    /// This will only work inside of a call to `init`.
+    #[corresponds(X509_verify_cert)]
+    pub fn verify_cert(&mut self) -> Result<bool, ErrorStack> {
+        unsafe { cvt_n(ffi::X509_verify_cert(self.as_ptr())).map(|n| n != 0) }
+    }
+
+    /// Set the error code of the context.
+    #[corresponds(X509_STORE_CTX_set_error)]
+    pub fn set_error(&mut self, result: X509VerifyResult) {
+        unsafe {
+            ffi::X509_STORE_CTX_set_error(self.as_ptr(), result.as_raw());
+        }
+    }
+
+    /// Returns a reference to the certificate which caused the error or None if
+    /// no certificate is relevant to the error.
+    #[corresponds(X509_STORE_CTX_get_current_cert)]
+    pub fn current_cert(&self) -> Option<&X509Ref> {
+        unsafe {
+            let ptr = ffi::X509_STORE_CTX_get_current_cert(self.as_ptr());
+            X509Ref::from_const_ptr_opt(ptr)
+        }
+    }
+
+    /// Returns a non-negative integer representing the depth in the certificate
+    /// chain where the error occurred. If it is zero it occurred in the end
+    /// entity certificate, one if it is the certificate which signed the end
+    /// entity certificate and so on.
+    #[corresponds(X509_STORE_CTX_get_error_depth)]
+    pub fn error_depth(&self) -> u32 {
+        unsafe { ffi::X509_STORE_CTX_get_error_depth(self.as_ptr()) as u32 }
+    }
+
+    /// Returns a reference to a complete valid `X509` certificate chain.
+    #[corresponds(X509_STORE_CTX_get0_chain)]
+    pub fn chain(&self) -> Option<&StackRef<X509>> {
+        unsafe {
+            let chain = X509_STORE_CTX_get0_chain(self.as_ptr());
+
+            if chain.is_null() {
+                None
+            } else {
+                Some(StackRef::from_ptr(chain))
+            }
+        }
+    }
+}
+
+/// A builder used to construct an `X509`.
+pub struct X509Builder(X509);
+
+impl X509Builder {
+    /// Creates a new builder.
+    #[corresponds(X509_new)]
+    pub fn new() -> Result<X509Builder, ErrorStack> {
+        unsafe {
+            ffi::init();
+            cvt_p(ffi::X509_new()).map(|p| X509Builder(X509(p)))
+        }
+    }
+
+    /// Sets the notAfter constraint on the certificate.
+    #[corresponds(X509_set1_notAfter)]
+    pub fn set_not_after(&mut self, not_after: &Asn1TimeRef) -> Result<(), ErrorStack> {
+        unsafe { cvt(X509_set1_notAfter(self.0.as_ptr(), not_after.as_ptr())).map(|_| ()) }
+    }
+
+    /// Sets the notBefore constraint on the certificate.
+    #[corresponds(X509_set1_notBefore)]
+    pub fn set_not_before(&mut self, not_before: &Asn1TimeRef) -> Result<(), ErrorStack> {
+        unsafe { cvt(X509_set1_notBefore(self.0.as_ptr(), not_before.as_ptr())).map(|_| ()) }
+    }
+
+    /// Sets the version of the certificate.
+    ///
+    /// Note that the version is zero-indexed; that is, a certificate corresponding to version 3 of
+    /// the X.509 standard should pass `2` to this method.
+    #[corresponds(X509_set_version)]
+    #[allow(clippy::useless_conversion)]
+    pub fn set_version(&mut self, version: i32) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::X509_set_version(self.0.as_ptr(), version as c_long)).map(|_| ()) }
+    }
+
+    /// Sets the serial number of the certificate.
+    #[corresponds(X509_set_serialNumber)]
+    pub fn set_serial_number(&mut self, serial_number: &Asn1IntegerRef) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::X509_set_serialNumber(
+                self.0.as_ptr(),
+                serial_number.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the issuer name of the certificate.
+    #[corresponds(X509_set_issuer_name)]
+    pub fn set_issuer_name(&mut self, issuer_name: &X509NameRef) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::X509_set_issuer_name(
+                self.0.as_ptr(),
+                issuer_name.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the subject name of the certificate.
+    ///
+    /// When building certificates, the `C`, `ST`, and `O` options are common when using the openssl command line tools.
+    /// The `CN` field is used for the common name, such as a DNS name.
+    ///
+    /// ```
+    /// use openssl::x509::{X509, X509NameBuilder};
+    ///
+    /// let mut x509_name = openssl::x509::X509NameBuilder::new().unwrap();
+    /// x509_name.append_entry_by_text("C", "US").unwrap();
+    /// x509_name.append_entry_by_text("ST", "CA").unwrap();
+    /// x509_name.append_entry_by_text("O", "Some organization").unwrap();
+    /// x509_name.append_entry_by_text("CN", "www.example.com").unwrap();
+    /// let x509_name = x509_name.build();
+    ///
+    /// let mut x509 = openssl::x509::X509::builder().unwrap();
+    /// x509.set_subject_name(&x509_name).unwrap();
+    /// ```
+    #[corresponds(X509_set_subject_name)]
+    pub fn set_subject_name(&mut self, subject_name: &X509NameRef) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::X509_set_subject_name(
+                self.0.as_ptr(),
+                subject_name.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sets the public key associated with the certificate.
+    #[corresponds(X509_set_pubkey)]
+    pub fn set_pubkey<T>(&mut self, key: &PKeyRef<T>) -> Result<(), ErrorStack>
+    where
+        T: HasPublic,
+    {
+        unsafe { cvt(ffi::X509_set_pubkey(self.0.as_ptr(), key.as_ptr())).map(|_| ()) }
+    }
+
+    /// Returns a context object which is needed to create certain X509 extension values.
+    ///
+    /// Set `issuer` to `None` if the certificate will be self-signed.
+    #[corresponds(X509V3_set_ctx)]
+    pub fn x509v3_context<'a>(
+        &'a self,
+        issuer: Option<&'a X509Ref>,
+        conf: Option<&'a ConfRef>,
+    ) -> X509v3Context<'a> {
+        unsafe {
+            let mut ctx = mem::zeroed();
+
+            let issuer = match issuer {
+                Some(issuer) => issuer.as_ptr(),
+                None => self.0.as_ptr(),
+            };
+            let subject = self.0.as_ptr();
+            ffi::X509V3_set_ctx(
+                &mut ctx,
+                issuer,
+                subject,
+                ptr::null_mut(),
+                ptr::null_mut(),
+                0,
+            );
+
+            // nodb case taken care of since we zeroed ctx above
+            if let Some(conf) = conf {
+                ffi::X509V3_set_nconf(&mut ctx, conf.as_ptr());
+            }
+
+            X509v3Context(ctx, PhantomData)
+        }
+    }
+
+    /// Adds an X509 extension value to the certificate.
+    ///
+    /// This works just as `append_extension` except it takes ownership of the `X509Extension`.
+    pub fn append_extension(&mut self, extension: X509Extension) -> Result<(), ErrorStack> {
+        self.append_extension2(&extension)
+    }
+
+    /// Adds an X509 extension value to the certificate.
+    #[corresponds(X509_add_ext)]
+    pub fn append_extension2(&mut self, extension: &X509ExtensionRef) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::X509_add_ext(self.0.as_ptr(), extension.as_ptr(), -1))?;
+            Ok(())
+        }
+    }
+
+    /// Signs the certificate with a private key.
+    #[corresponds(X509_sign)]
+    pub fn sign<T>(&mut self, key: &PKeyRef<T>, hash: MessageDigest) -> Result<(), ErrorStack>
+    where
+        T: HasPrivate,
+    {
+        unsafe { cvt(ffi::X509_sign(self.0.as_ptr(), key.as_ptr(), hash.as_ptr())).map(|_| ()) }
+    }
+
+    /// Consumes the builder, returning the certificate.
+    pub fn build(self) -> X509 {
+        self.0
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::X509;
+    fn drop = ffi::X509_free;
+
+    /// An `X509` public key certificate.
+    pub struct X509;
+    /// Reference to `X509`.
+    pub struct X509Ref;
+}
+
+impl X509Ref {
+    /// Returns this certificate's subject name.
+    #[corresponds(X509_get_subject_name)]
+    pub fn subject_name(&self) -> &X509NameRef {
+        unsafe {
+            let name = ffi::X509_get_subject_name(self.as_ptr());
+            X509NameRef::from_const_ptr_opt(name).expect("subject name must not be null")
+        }
+    }
+
+    /// Returns the hash of the certificates subject
+    #[corresponds(X509_subject_name_hash)]
+    pub fn subject_name_hash(&self) -> u32 {
+        #[allow(clippy::unnecessary_cast)]
+        unsafe {
+            ffi::X509_subject_name_hash(self.as_ptr()) as u32
+        }
+    }
+
+    /// Returns this certificate's issuer name.
+    #[corresponds(X509_get_issuer_name)]
+    pub fn issuer_name(&self) -> &X509NameRef {
+        unsafe {
+            let name = ffi::X509_get_issuer_name(self.as_ptr());
+            X509NameRef::from_const_ptr_opt(name).expect("issuer name must not be null")
+        }
+    }
+
+    /// Returns the hash of the certificates issuer
+    #[corresponds(X509_issuer_name_hash)]
+    pub fn issuer_name_hash(&self) -> u32 {
+        #[allow(clippy::unnecessary_cast)]
+        unsafe {
+            ffi::X509_issuer_name_hash(self.as_ptr()) as u32
+        }
+    }
+
+    /// Returns this certificate's subject alternative name entries, if they exist.
+    #[corresponds(X509_get_ext_d2i)]
+    pub fn subject_alt_names(&self) -> Option<Stack<GeneralName>> {
+        unsafe {
+            let stack = ffi::X509_get_ext_d2i(
+                self.as_ptr(),
+                ffi::NID_subject_alt_name,
+                ptr::null_mut(),
+                ptr::null_mut(),
+            );
+            Stack::from_ptr_opt(stack as *mut _)
+        }
+    }
+
+    /// Returns this certificate's CRL distribution points, if they exist.
+    #[corresponds(X509_get_ext_d2i)]
+    pub fn crl_distribution_points(&self) -> Option<Stack<DistPoint>> {
+        unsafe {
+            let stack = ffi::X509_get_ext_d2i(
+                self.as_ptr(),
+                ffi::NID_crl_distribution_points,
+                ptr::null_mut(),
+                ptr::null_mut(),
+            );
+            Stack::from_ptr_opt(stack as *mut _)
+        }
+    }
+
+    /// Returns this certificate's issuer alternative name entries, if they exist.
+    #[corresponds(X509_get_ext_d2i)]
+    pub fn issuer_alt_names(&self) -> Option<Stack<GeneralName>> {
+        unsafe {
+            let stack = ffi::X509_get_ext_d2i(
+                self.as_ptr(),
+                ffi::NID_issuer_alt_name,
+                ptr::null_mut(),
+                ptr::null_mut(),
+            );
+            Stack::from_ptr_opt(stack as *mut _)
+        }
+    }
+
+    /// Returns this certificate's [`authority information access`] entries, if they exist.
+    ///
+    /// [`authority information access`]: https://tools.ietf.org/html/rfc5280#section-4.2.2.1
+    #[corresponds(X509_get_ext_d2i)]
+    pub fn authority_info(&self) -> Option<Stack<AccessDescription>> {
+        unsafe {
+            let stack = ffi::X509_get_ext_d2i(
+                self.as_ptr(),
+                ffi::NID_info_access,
+                ptr::null_mut(),
+                ptr::null_mut(),
+            );
+            Stack::from_ptr_opt(stack as *mut _)
+        }
+    }
+
+    /// Retrieves the path length extension from a certificate, if it exists.
+    #[corresponds(X509_get_pathlen)]
+    #[cfg(any(ossl110, boringssl))]
+    pub fn pathlen(&self) -> Option<u32> {
+        let v = unsafe { ffi::X509_get_pathlen(self.as_ptr()) };
+        u32::try_from(v).ok()
+    }
+
+    /// Returns this certificate's subject key id, if it exists.
+    #[corresponds(X509_get0_subject_key_id)]
+    #[cfg(any(ossl110, boringssl))]
+    pub fn subject_key_id(&self) -> Option<&Asn1OctetStringRef> {
+        unsafe {
+            let data = ffi::X509_get0_subject_key_id(self.as_ptr());
+            Asn1OctetStringRef::from_const_ptr_opt(data)
+        }
+    }
+
+    /// Returns this certificate's authority key id, if it exists.
+    #[corresponds(X509_get0_authority_key_id)]
+    #[cfg(any(ossl110, boringssl))]
+    pub fn authority_key_id(&self) -> Option<&Asn1OctetStringRef> {
+        unsafe {
+            let data = ffi::X509_get0_authority_key_id(self.as_ptr());
+            Asn1OctetStringRef::from_const_ptr_opt(data)
+        }
+    }
+
+    /// Returns this certificate's authority issuer name entries, if they exist.
+    #[corresponds(X509_get0_authority_issuer)]
+    #[cfg(ossl111d)]
+    pub fn authority_issuer(&self) -> Option<&StackRef<GeneralName>> {
+        unsafe {
+            let stack = ffi::X509_get0_authority_issuer(self.as_ptr());
+            StackRef::from_const_ptr_opt(stack)
+        }
+    }
+
+    /// Returns this certificate's authority serial number, if it exists.
+    #[corresponds(X509_get0_authority_serial)]
+    #[cfg(ossl111d)]
+    pub fn authority_serial(&self) -> Option<&Asn1IntegerRef> {
+        unsafe {
+            let r = ffi::X509_get0_authority_serial(self.as_ptr());
+            Asn1IntegerRef::from_const_ptr_opt(r)
+        }
+    }
+
+    #[corresponds(X509_get_pubkey)]
+    pub fn public_key(&self) -> Result<PKey<Public>, ErrorStack> {
+        unsafe {
+            let pkey = cvt_p(ffi::X509_get_pubkey(self.as_ptr()))?;
+            Ok(PKey::from_ptr(pkey))
+        }
+    }
+
+    /// Returns a digest of the DER representation of the certificate.
+    #[corresponds(X509_digest)]
+    pub fn digest(&self, hash_type: MessageDigest) -> Result<DigestBytes, ErrorStack> {
+        unsafe {
+            let mut digest = DigestBytes {
+                buf: [0; ffi::EVP_MAX_MD_SIZE as usize],
+                len: ffi::EVP_MAX_MD_SIZE as usize,
+            };
+            let mut len = ffi::EVP_MAX_MD_SIZE as c_uint;
+            cvt(ffi::X509_digest(
+                self.as_ptr(),
+                hash_type.as_ptr(),
+                digest.buf.as_mut_ptr() as *mut _,
+                &mut len,
+            ))?;
+            digest.len = len as usize;
+
+            Ok(digest)
+        }
+    }
+
+    #[deprecated(since = "0.10.9", note = "renamed to digest")]
+    pub fn fingerprint(&self, hash_type: MessageDigest) -> Result<Vec<u8>, ErrorStack> {
+        self.digest(hash_type).map(|b| b.to_vec())
+    }
+
+    /// Returns the certificate's Not After validity period.
+    #[corresponds(X509_getm_notAfter)]
+    pub fn not_after(&self) -> &Asn1TimeRef {
+        unsafe {
+            let date = X509_getm_notAfter(self.as_ptr());
+            Asn1TimeRef::from_const_ptr_opt(date).expect("not_after must not be null")
+        }
+    }
+
+    /// Returns the certificate's Not Before validity period.
+    #[corresponds(X509_getm_notBefore)]
+    pub fn not_before(&self) -> &Asn1TimeRef {
+        unsafe {
+            let date = X509_getm_notBefore(self.as_ptr());
+            Asn1TimeRef::from_const_ptr_opt(date).expect("not_before must not be null")
+        }
+    }
+
+    /// Returns the certificate's signature
+    #[corresponds(X509_get0_signature)]
+    pub fn signature(&self) -> &Asn1BitStringRef {
+        unsafe {
+            let mut signature = ptr::null();
+            X509_get0_signature(&mut signature, ptr::null_mut(), self.as_ptr());
+            Asn1BitStringRef::from_const_ptr_opt(signature).expect("signature must not be null")
+        }
+    }
+
+    /// Returns the certificate's signature algorithm.
+    #[corresponds(X509_get0_signature)]
+    pub fn signature_algorithm(&self) -> &X509AlgorithmRef {
+        unsafe {
+            let mut algor = ptr::null();
+            X509_get0_signature(ptr::null_mut(), &mut algor, self.as_ptr());
+            X509AlgorithmRef::from_const_ptr_opt(algor)
+                .expect("signature algorithm must not be null")
+        }
+    }
+
+    /// Returns the list of OCSP responder URLs specified in the certificate's Authority Information
+    /// Access field.
+    #[corresponds(X509_get1_ocsp)]
+    pub fn ocsp_responders(&self) -> Result<Stack<OpensslString>, ErrorStack> {
+        unsafe { cvt_p(ffi::X509_get1_ocsp(self.as_ptr())).map(|p| Stack::from_ptr(p)) }
+    }
+
+    /// Checks that this certificate issued `subject`.
+    #[corresponds(X509_check_issued)]
+    pub fn issued(&self, subject: &X509Ref) -> X509VerifyResult {
+        unsafe {
+            let r = ffi::X509_check_issued(self.as_ptr(), subject.as_ptr());
+            X509VerifyResult::from_raw(r)
+        }
+    }
+
+    /// Returns certificate version. If this certificate has no explicit version set, it defaults to
+    /// version 1.
+    ///
+    /// Note that `0` return value stands for version 1, `1` for version 2 and so on.
+    #[corresponds(X509_get_version)]
+    #[cfg(ossl110)]
+    #[allow(clippy::unnecessary_cast)]
+    pub fn version(&self) -> i32 {
+        unsafe { ffi::X509_get_version(self.as_ptr()) as i32 }
+    }
+
+    /// Check if the certificate is signed using the given public key.
+    ///
+    /// Only the signature is checked: no other checks (such as certificate chain validity)
+    /// are performed.
+    ///
+    /// Returns `true` if verification succeeds.
+    #[corresponds(X509_verify)]
+    pub fn verify<T>(&self, key: &PKeyRef<T>) -> Result<bool, ErrorStack>
+    where
+        T: HasPublic,
+    {
+        unsafe { cvt_n(ffi::X509_verify(self.as_ptr(), key.as_ptr())).map(|n| n != 0) }
+    }
+
+    /// Returns this certificate's serial number.
+    #[corresponds(X509_get_serialNumber)]
+    pub fn serial_number(&self) -> &Asn1IntegerRef {
+        unsafe {
+            let r = ffi::X509_get_serialNumber(self.as_ptr());
+            Asn1IntegerRef::from_const_ptr_opt(r).expect("serial number must not be null")
+        }
+    }
+
+    /// Returns this certificate's "alias". This field is populated by
+    /// OpenSSL in some situations -- specifically OpenSSL will store a
+    /// PKCS#12 `friendlyName` in this field. This is not a part of the X.509
+    /// certificate itself, OpenSSL merely attaches it to this structure in
+    /// memory.
+    #[corresponds(X509_alias_get0)]
+    pub fn alias(&self) -> Option<&[u8]> {
+        unsafe {
+            let mut len = 0;
+            let ptr = ffi::X509_alias_get0(self.as_ptr(), &mut len);
+            if ptr.is_null() {
+                None
+            } else {
+                Some(slice::from_raw_parts(ptr, len as usize))
+            }
+        }
+    }
+
+    to_pem! {
+        /// Serializes the certificate into a PEM-encoded X509 structure.
+        ///
+        /// The output will have a header of `-----BEGIN CERTIFICATE-----`.
+        #[corresponds(PEM_write_bio_X509)]
+        to_pem,
+        ffi::PEM_write_bio_X509
+    }
+
+    to_der! {
+        /// Serializes the certificate into a DER-encoded X509 structure.
+        #[corresponds(i2d_X509)]
+        to_der,
+        ffi::i2d_X509
+    }
+
+    to_pem! {
+        /// Converts the certificate to human readable text.
+        #[corresponds(X509_print)]
+        to_text,
+        ffi::X509_print
+    }
+}
+
+impl ToOwned for X509Ref {
+    type Owned = X509;
+
+    fn to_owned(&self) -> X509 {
+        unsafe {
+            X509_up_ref(self.as_ptr());
+            X509::from_ptr(self.as_ptr())
+        }
+    }
+}
+
+impl Ord for X509Ref {
+    fn cmp(&self, other: &Self) -> cmp::Ordering {
+        // X509_cmp returns a number <0 for less than, 0 for equal and >0 for greater than.
+        // It can't fail if both pointers are valid, which we know is true.
+        let cmp = unsafe { ffi::X509_cmp(self.as_ptr(), other.as_ptr()) };
+        cmp.cmp(&0)
+    }
+}
+
+impl PartialOrd for X509Ref {
+    fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
+        Some(self.cmp(other))
+    }
+}
+
+impl PartialOrd<X509> for X509Ref {
+    fn partial_cmp(&self, other: &X509) -> Option<cmp::Ordering> {
+        <X509Ref as PartialOrd<X509Ref>>::partial_cmp(self, other)
+    }
+}
+
+impl PartialEq for X509Ref {
+    fn eq(&self, other: &Self) -> bool {
+        self.cmp(other) == cmp::Ordering::Equal
+    }
+}
+
+impl PartialEq<X509> for X509Ref {
+    fn eq(&self, other: &X509) -> bool {
+        <X509Ref as PartialEq<X509Ref>>::eq(self, other)
+    }
+}
+
+impl Eq for X509Ref {}
+
+impl X509 {
+    /// Returns a new builder.
+    pub fn builder() -> Result<X509Builder, ErrorStack> {
+        X509Builder::new()
+    }
+
+    from_pem! {
+        /// Deserializes a PEM-encoded X509 structure.
+        ///
+        /// The input should have a header of `-----BEGIN CERTIFICATE-----`.
+        #[corresponds(PEM_read_bio_X509)]
+        from_pem,
+        X509,
+        ffi::PEM_read_bio_X509
+    }
+
+    from_der! {
+        /// Deserializes a DER-encoded X509 structure.
+        #[corresponds(d2i_X509)]
+        from_der,
+        X509,
+        ffi::d2i_X509
+    }
+
+    /// Deserializes a list of PEM-formatted certificates.
+    #[corresponds(PEM_read_bio_X509)]
+    pub fn stack_from_pem(pem: &[u8]) -> Result<Vec<X509>, ErrorStack> {
+        unsafe {
+            ffi::init();
+            let bio = MemBioSlice::new(pem)?;
+
+            let mut certs = vec![];
+            loop {
+                let r =
+                    ffi::PEM_read_bio_X509(bio.as_ptr(), ptr::null_mut(), None, ptr::null_mut());
+                if r.is_null() {
+                    let e = ErrorStack::get();
+
+                    if let Some(err) = e.errors().last() {
+                        if err.library_code() == ffi::ERR_LIB_PEM as libc::c_int
+                            && err.reason_code() == ffi::PEM_R_NO_START_LINE as libc::c_int
+                        {
+                            break;
+                        }
+                    }
+
+                    return Err(e);
+                } else {
+                    certs.push(X509(r));
+                }
+            }
+
+            Ok(certs)
+        }
+    }
+}
+
+impl Clone for X509 {
+    fn clone(&self) -> X509 {
+        X509Ref::to_owned(self)
+    }
+}
+
+impl fmt::Debug for X509 {
+    fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
+        let serial = match &self.serial_number().to_bn() {
+            Ok(bn) => match bn.to_hex_str() {
+                Ok(hex) => hex.to_string(),
+                Err(_) => "".to_string(),
+            },
+            Err(_) => "".to_string(),
+        };
+        let mut debug_struct = formatter.debug_struct("X509");
+        debug_struct.field("serial_number", &serial);
+        debug_struct.field("signature_algorithm", &self.signature_algorithm().object());
+        debug_struct.field("issuer", &self.issuer_name());
+        debug_struct.field("subject", &self.subject_name());
+        if let Some(subject_alt_names) = &self.subject_alt_names() {
+            debug_struct.field("subject_alt_names", subject_alt_names);
+        }
+        debug_struct.field("not_before", &self.not_before());
+        debug_struct.field("not_after", &self.not_after());
+
+        if let Ok(public_key) = &self.public_key() {
+            debug_struct.field("public_key", public_key);
+        };
+        // TODO: Print extensions once they are supported on the X509 struct.
+
+        debug_struct.finish()
+    }
+}
+
+impl AsRef<X509Ref> for X509Ref {
+    fn as_ref(&self) -> &X509Ref {
+        self
+    }
+}
+
+impl Stackable for X509 {
+    type StackType = ffi::stack_st_X509;
+}
+
+impl Ord for X509 {
+    fn cmp(&self, other: &Self) -> cmp::Ordering {
+        X509Ref::cmp(self, other)
+    }
+}
+
+impl PartialOrd for X509 {
+    fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
+        Some(self.cmp(other))
+    }
+}
+
+impl PartialOrd<X509Ref> for X509 {
+    fn partial_cmp(&self, other: &X509Ref) -> Option<cmp::Ordering> {
+        X509Ref::partial_cmp(self, other)
+    }
+}
+
+impl PartialEq for X509 {
+    fn eq(&self, other: &Self) -> bool {
+        X509Ref::eq(self, other)
+    }
+}
+
+impl PartialEq<X509Ref> for X509 {
+    fn eq(&self, other: &X509Ref) -> bool {
+        X509Ref::eq(self, other)
+    }
+}
+
+impl Eq for X509 {}
+
+/// A context object required to construct certain `X509` extension values.
+pub struct X509v3Context<'a>(ffi::X509V3_CTX, PhantomData<(&'a X509Ref, &'a ConfRef)>);
+
+impl<'a> X509v3Context<'a> {
+    pub fn as_ptr(&self) -> *mut ffi::X509V3_CTX {
+        &self.0 as *const _ as *mut _
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::X509_EXTENSION;
+    fn drop = ffi::X509_EXTENSION_free;
+
+    /// Permit additional fields to be added to an `X509` v3 certificate.
+    pub struct X509Extension;
+    /// Reference to `X509Extension`.
+    pub struct X509ExtensionRef;
+}
+
+impl Stackable for X509Extension {
+    type StackType = ffi::stack_st_X509_EXTENSION;
+}
+
+impl X509Extension {
+    /// Constructs an X509 extension value. See `man x509v3_config` for information on supported
+    /// names and their value formats.
+    ///
+    /// Some extension types, such as `subjectAlternativeName`, require an `X509v3Context` to be
+    /// provided.
+    ///
+    /// DO NOT CALL THIS WITH UNTRUSTED `value`: `value` is an OpenSSL
+    /// mini-language that can read arbitrary files.
+    ///
+    /// See the extension module for builder types which will construct certain common extensions.
+    ///
+    /// This function is deprecated, `X509Extension::new_from_der` or the
+    /// types in `x509::extension` should be used in its place.
+    #[deprecated(
+        note = "Use x509::extension types or new_from_der instead",
+        since = "0.10.51"
+    )]
+    pub fn new(
+        conf: Option<&ConfRef>,
+        context: Option<&X509v3Context<'_>>,
+        name: &str,
+        value: &str,
+    ) -> Result<X509Extension, ErrorStack> {
+        let name = CString::new(name).unwrap();
+        let value = CString::new(value).unwrap();
+        let mut ctx;
+        unsafe {
+            ffi::init();
+            let conf = conf.map_or(ptr::null_mut(), ConfRef::as_ptr);
+            let context_ptr = match context {
+                Some(c) => c.as_ptr(),
+                None => {
+                    ctx = mem::zeroed();
+
+                    ffi::X509V3_set_ctx(
+                        &mut ctx,
+                        ptr::null_mut(),
+                        ptr::null_mut(),
+                        ptr::null_mut(),
+                        ptr::null_mut(),
+                        0,
+                    );
+                    &mut ctx
+                }
+            };
+            let name = name.as_ptr() as *mut _;
+            let value = value.as_ptr() as *mut _;
+
+            cvt_p(ffi::X509V3_EXT_nconf(conf, context_ptr, name, value)).map(X509Extension)
+        }
+    }
+
+    /// Constructs an X509 extension value. See `man x509v3_config` for information on supported
+    /// extensions and their value formats.
+    ///
+    /// Some extension types, such as `nid::SUBJECT_ALTERNATIVE_NAME`, require an `X509v3Context` to
+    /// be provided.
+    ///
+    /// DO NOT CALL THIS WITH UNTRUSTED `value`: `value` is an OpenSSL
+    /// mini-language that can read arbitrary files.
+    ///
+    /// See the extension module for builder types which will construct certain common extensions.
+    ///
+    /// This function is deprecated, `X509Extension::new_from_der` or the
+    /// types in `x509::extension` should be used in its place.
+    #[deprecated(
+        note = "Use x509::extension types or new_from_der instead",
+        since = "0.10.51"
+    )]
+    pub fn new_nid(
+        conf: Option<&ConfRef>,
+        context: Option<&X509v3Context<'_>>,
+        name: Nid,
+        value: &str,
+    ) -> Result<X509Extension, ErrorStack> {
+        let value = CString::new(value).unwrap();
+        let mut ctx;
+        unsafe {
+            ffi::init();
+            let conf = conf.map_or(ptr::null_mut(), ConfRef::as_ptr);
+            let context_ptr = match context {
+                Some(c) => c.as_ptr(),
+                None => {
+                    ctx = mem::zeroed();
+
+                    ffi::X509V3_set_ctx(
+                        &mut ctx,
+                        ptr::null_mut(),
+                        ptr::null_mut(),
+                        ptr::null_mut(),
+                        ptr::null_mut(),
+                        0,
+                    );
+                    &mut ctx
+                }
+            };
+            let name = name.as_raw();
+            let value = value.as_ptr() as *mut _;
+
+            cvt_p(ffi::X509V3_EXT_nconf_nid(conf, context_ptr, name, value)).map(X509Extension)
+        }
+    }
+
+    /// Constructs a new X509 extension value from its OID, whether it's
+    /// critical, and its DER contents.
+    ///
+    /// The extent structure of the DER value will vary based on the
+    /// extension type, and can generally be found in the RFC defining the
+    /// extension.
+    ///
+    /// For common extension types, there are Rust APIs provided in
+    /// `openssl::x509::extensions` which are more ergonomic.
+    pub fn new_from_der(
+        oid: &Asn1ObjectRef,
+        critical: bool,
+        der_contents: &Asn1OctetStringRef,
+    ) -> Result<X509Extension, ErrorStack> {
+        unsafe {
+            cvt_p(ffi::X509_EXTENSION_create_by_OBJ(
+                ptr::null_mut(),
+                oid.as_ptr(),
+                critical as _,
+                der_contents.as_ptr(),
+            ))
+            .map(X509Extension)
+        }
+    }
+
+    pub(crate) unsafe fn new_internal(
+        nid: Nid,
+        critical: bool,
+        value: *mut c_void,
+    ) -> Result<X509Extension, ErrorStack> {
+        ffi::init();
+        cvt_p(ffi::X509V3_EXT_i2d(nid.as_raw(), critical as _, value)).map(X509Extension)
+    }
+
+    /// Adds an alias for an extension
+    ///
+    /// # Safety
+    ///
+    /// This method modifies global state without locking and therefore is not thread safe
+    #[cfg(not(libressl390))]
+    #[corresponds(X509V3_EXT_add_alias)]
+    #[deprecated(
+        note = "Use x509::extension types or new_from_der and then this is not necessary",
+        since = "0.10.51"
+    )]
+    pub unsafe fn add_alias(to: Nid, from: Nid) -> Result<(), ErrorStack> {
+        ffi::init();
+        cvt(ffi::X509V3_EXT_add_alias(to.as_raw(), from.as_raw())).map(|_| ())
+    }
+}
+
+impl X509ExtensionRef {
+    to_der! {
+        /// Serializes the Extension to its standard DER encoding.
+        #[corresponds(i2d_X509_EXTENSION)]
+        to_der,
+        ffi::i2d_X509_EXTENSION
+    }
+}
+
+/// A builder used to construct an `X509Name`.
+pub struct X509NameBuilder(X509Name);
+
+impl X509NameBuilder {
+    /// Creates a new builder.
+    pub fn new() -> Result<X509NameBuilder, ErrorStack> {
+        unsafe {
+            ffi::init();
+            cvt_p(ffi::X509_NAME_new()).map(|p| X509NameBuilder(X509Name(p)))
+        }
+    }
+
+    /// Add a name entry
+    #[corresponds(X509_NAME_add_entry)]
+    #[cfg(any(ossl101, libressl350))]
+    pub fn append_entry(&mut self, ne: &X509NameEntryRef) -> std::result::Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::X509_NAME_add_entry(
+                self.0.as_ptr(),
+                ne.as_ptr(),
+                -1,
+                0,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Add a field entry by str.
+    ///
+    /// This corresponds to [`X509_NAME_add_entry_by_txt`].
+    ///
+    /// [`X509_NAME_add_entry_by_txt`]: https://www.openssl.org/docs/manmaster/crypto/X509_NAME_add_entry_by_txt.html
+    pub fn append_entry_by_text(&mut self, field: &str, value: &str) -> Result<(), ErrorStack> {
+        unsafe {
+            let field = CString::new(field).unwrap();
+            assert!(value.len() <= crate::SLenType::MAX as usize);
+            cvt(ffi::X509_NAME_add_entry_by_txt(
+                self.0.as_ptr(),
+                field.as_ptr() as *mut _,
+                ffi::MBSTRING_UTF8,
+                value.as_ptr(),
+                value.len() as crate::SLenType,
+                -1,
+                0,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Add a field entry by str with a specific type.
+    ///
+    /// This corresponds to [`X509_NAME_add_entry_by_txt`].
+    ///
+    /// [`X509_NAME_add_entry_by_txt`]: https://www.openssl.org/docs/manmaster/crypto/X509_NAME_add_entry_by_txt.html
+    pub fn append_entry_by_text_with_type(
+        &mut self,
+        field: &str,
+        value: &str,
+        ty: Asn1Type,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            let field = CString::new(field).unwrap();
+            assert!(value.len() <= crate::SLenType::MAX as usize);
+            cvt(ffi::X509_NAME_add_entry_by_txt(
+                self.0.as_ptr(),
+                field.as_ptr() as *mut _,
+                ty.as_raw(),
+                value.as_ptr(),
+                value.len() as crate::SLenType,
+                -1,
+                0,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Add a field entry by NID.
+    ///
+    /// This corresponds to [`X509_NAME_add_entry_by_NID`].
+    ///
+    /// [`X509_NAME_add_entry_by_NID`]: https://www.openssl.org/docs/manmaster/crypto/X509_NAME_add_entry_by_NID.html
+    pub fn append_entry_by_nid(&mut self, field: Nid, value: &str) -> Result<(), ErrorStack> {
+        unsafe {
+            assert!(value.len() <= crate::SLenType::MAX as usize);
+            cvt(ffi::X509_NAME_add_entry_by_NID(
+                self.0.as_ptr(),
+                field.as_raw(),
+                ffi::MBSTRING_UTF8,
+                value.as_ptr() as *mut _,
+                value.len() as crate::SLenType,
+                -1,
+                0,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Add a field entry by NID with a specific type.
+    ///
+    /// This corresponds to [`X509_NAME_add_entry_by_NID`].
+    ///
+    /// [`X509_NAME_add_entry_by_NID`]: https://www.openssl.org/docs/manmaster/crypto/X509_NAME_add_entry_by_NID.html
+    pub fn append_entry_by_nid_with_type(
+        &mut self,
+        field: Nid,
+        value: &str,
+        ty: Asn1Type,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            assert!(value.len() <= crate::SLenType::MAX as usize);
+            cvt(ffi::X509_NAME_add_entry_by_NID(
+                self.0.as_ptr(),
+                field.as_raw(),
+                ty.as_raw(),
+                value.as_ptr() as *mut _,
+                value.len() as crate::SLenType,
+                -1,
+                0,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Return an `X509Name`.
+    pub fn build(self) -> X509Name {
+        // Round-trip through bytes because OpenSSL is not const correct and
+        // names in a "modified" state compute various things lazily. This can
+        // lead to data-races because OpenSSL doesn't have locks or anything.
+        X509Name::from_der(&self.0.to_der().unwrap()).unwrap()
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::X509_NAME;
+    fn drop = ffi::X509_NAME_free;
+
+    /// The names of an `X509` certificate.
+    pub struct X509Name;
+    /// Reference to `X509Name`.
+    pub struct X509NameRef;
+}
+
+impl X509Name {
+    /// Returns a new builder.
+    pub fn builder() -> Result<X509NameBuilder, ErrorStack> {
+        X509NameBuilder::new()
+    }
+
+    /// Loads subject names from a file containing PEM-formatted certificates.
+    ///
+    /// This is commonly used in conjunction with `SslContextBuilder::set_client_ca_list`.
+    pub fn load_client_ca_file<P: AsRef<Path>>(file: P) -> Result<Stack<X509Name>, ErrorStack> {
+        let file = CString::new(file.as_ref().as_os_str().to_str().unwrap()).unwrap();
+        unsafe { cvt_p(ffi::SSL_load_client_CA_file(file.as_ptr())).map(|p| Stack::from_ptr(p)) }
+    }
+
+    from_der! {
+        /// Deserializes a DER-encoded X509 name structure.
+        ///
+        /// This corresponds to [`d2i_X509_NAME`].
+        ///
+        /// [`d2i_X509_NAME`]: https://www.openssl.org/docs/manmaster/man3/d2i_X509_NAME.html
+        from_der,
+        X509Name,
+        ffi::d2i_X509_NAME
+    }
+}
+
+impl Stackable for X509Name {
+    type StackType = ffi::stack_st_X509_NAME;
+}
+
+impl X509NameRef {
+    /// Returns the name entries by the nid.
+    pub fn entries_by_nid(&self, nid: Nid) -> X509NameEntries<'_> {
+        X509NameEntries {
+            name: self,
+            nid: Some(nid),
+            loc: -1,
+        }
+    }
+
+    /// Returns an iterator over all `X509NameEntry` values
+    pub fn entries(&self) -> X509NameEntries<'_> {
+        X509NameEntries {
+            name: self,
+            nid: None,
+            loc: -1,
+        }
+    }
+
+    /// Compare two names, like [`Ord`] but it may fail.
+    ///
+    /// With OpenSSL versions from 3.0.0 this may return an error if the underlying `X509_NAME_cmp`
+    /// call fails.
+    /// For OpenSSL versions before 3.0.0 it will never return an error, but due to a bug it may
+    /// spuriously return `Ordering::Less` if the `X509_NAME_cmp` call fails.
+    #[corresponds(X509_NAME_cmp)]
+    pub fn try_cmp(&self, other: &X509NameRef) -> Result<Ordering, ErrorStack> {
+        let cmp = unsafe { ffi::X509_NAME_cmp(self.as_ptr(), other.as_ptr()) };
+        if cfg!(ossl300) && cmp == -2 {
+            return Err(ErrorStack::get());
+        }
+        Ok(cmp.cmp(&0))
+    }
+
+    /// Copies the name to a new `X509Name`.
+    #[corresponds(X509_NAME_dup)]
+    #[cfg(any(boringssl, ossl110, libressl270))]
+    pub fn to_owned(&self) -> Result<X509Name, ErrorStack> {
+        unsafe { cvt_p(ffi::X509_NAME_dup(self.as_ptr())).map(|n| X509Name::from_ptr(n)) }
+    }
+
+    to_der! {
+        /// Serializes the certificate into a DER-encoded X509 name structure.
+        ///
+        /// This corresponds to [`i2d_X509_NAME`].
+        ///
+        /// [`i2d_X509_NAME`]: https://www.openssl.org/docs/manmaster/crypto/i2d_X509_NAME.html
+        to_der,
+        ffi::i2d_X509_NAME
+    }
+}
+
+impl fmt::Debug for X509NameRef {
+    fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
+        formatter.debug_list().entries(self.entries()).finish()
+    }
+}
+
+/// A type to destructure and examine an `X509Name`.
+pub struct X509NameEntries<'a> {
+    name: &'a X509NameRef,
+    nid: Option<Nid>,
+    loc: c_int,
+}
+
+impl<'a> Iterator for X509NameEntries<'a> {
+    type Item = &'a X509NameEntryRef;
+
+    fn next(&mut self) -> Option<&'a X509NameEntryRef> {
+        unsafe {
+            match self.nid {
+                Some(nid) => {
+                    // There is a `Nid` specified to search for
+                    self.loc =
+                        ffi::X509_NAME_get_index_by_NID(self.name.as_ptr(), nid.as_raw(), self.loc);
+                    if self.loc == -1 {
+                        return None;
+                    }
+                }
+                None => {
+                    // Iterate over all `Nid`s
+                    self.loc += 1;
+                    if self.loc >= ffi::X509_NAME_entry_count(self.name.as_ptr()) {
+                        return None;
+                    }
+                }
+            }
+
+            let entry = ffi::X509_NAME_get_entry(self.name.as_ptr(), self.loc);
+
+            Some(X509NameEntryRef::from_const_ptr_opt(entry).expect("entry must not be null"))
+        }
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::X509_NAME_ENTRY;
+    fn drop = ffi::X509_NAME_ENTRY_free;
+
+    /// A name entry associated with a `X509Name`.
+    pub struct X509NameEntry;
+    /// Reference to `X509NameEntry`.
+    pub struct X509NameEntryRef;
+}
+
+impl X509NameEntryRef {
+    /// Returns the field value of an `X509NameEntry`.
+    ///
+    /// This corresponds to [`X509_NAME_ENTRY_get_data`].
+    ///
+    /// [`X509_NAME_ENTRY_get_data`]: https://www.openssl.org/docs/manmaster/crypto/X509_NAME_ENTRY_get_data.html
+    pub fn data(&self) -> &Asn1StringRef {
+        unsafe {
+            let data = ffi::X509_NAME_ENTRY_get_data(self.as_ptr());
+            Asn1StringRef::from_ptr(data)
+        }
+    }
+
+    /// Returns the `Asn1Object` value of an `X509NameEntry`.
+    /// This is useful for finding out about the actual `Nid` when iterating over all `X509NameEntries`.
+    ///
+    /// This corresponds to [`X509_NAME_ENTRY_get_object`].
+    ///
+    /// [`X509_NAME_ENTRY_get_object`]: https://www.openssl.org/docs/manmaster/crypto/X509_NAME_ENTRY_get_object.html
+    pub fn object(&self) -> &Asn1ObjectRef {
+        unsafe {
+            let object = ffi::X509_NAME_ENTRY_get_object(self.as_ptr());
+            Asn1ObjectRef::from_ptr(object)
+        }
+    }
+}
+
+impl fmt::Debug for X509NameEntryRef {
+    fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
+        formatter.write_fmt(format_args!("{:?} = {:?}", self.object(), self.data()))
+    }
+}
+
+/// A builder used to construct an `X509Req`.
+pub struct X509ReqBuilder(X509Req);
+
+impl X509ReqBuilder {
+    /// Returns a builder for a certificate request.
+    ///
+    /// This corresponds to [`X509_REQ_new`].
+    ///
+    ///[`X509_REQ_new`]: https://www.openssl.org/docs/manmaster/crypto/X509_REQ_new.html
+    pub fn new() -> Result<X509ReqBuilder, ErrorStack> {
+        unsafe {
+            ffi::init();
+            cvt_p(ffi::X509_REQ_new()).map(|p| X509ReqBuilder(X509Req(p)))
+        }
+    }
+
+    /// Set the numerical value of the version field.
+    ///
+    /// This corresponds to [`X509_REQ_set_version`].
+    ///
+    ///[`X509_REQ_set_version`]: https://www.openssl.org/docs/manmaster/crypto/X509_REQ_set_version.html
+    #[allow(clippy::useless_conversion)]
+    pub fn set_version(&mut self, version: i32) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::X509_REQ_set_version(
+                self.0.as_ptr(),
+                version as c_long,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Set the issuer name.
+    ///
+    /// This corresponds to [`X509_REQ_set_subject_name`].
+    ///
+    /// [`X509_REQ_set_subject_name`]: https://www.openssl.org/docs/manmaster/crypto/X509_REQ_set_subject_name.html
+    pub fn set_subject_name(&mut self, subject_name: &X509NameRef) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::X509_REQ_set_subject_name(
+                self.0.as_ptr(),
+                subject_name.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Set the public key.
+    ///
+    /// This corresponds to [`X509_REQ_set_pubkey`].
+    ///
+    /// [`X509_REQ_set_pubkey`]: https://www.openssl.org/docs/manmaster/crypto/X509_REQ_set_pubkey.html
+    pub fn set_pubkey<T>(&mut self, key: &PKeyRef<T>) -> Result<(), ErrorStack>
+    where
+        T: HasPublic,
+    {
+        unsafe { cvt(ffi::X509_REQ_set_pubkey(self.0.as_ptr(), key.as_ptr())).map(|_| ()) }
+    }
+
+    /// Return an `X509v3Context`. This context object can be used to construct
+    /// certain `X509` extensions.
+    pub fn x509v3_context<'a>(&'a self, conf: Option<&'a ConfRef>) -> X509v3Context<'a> {
+        unsafe {
+            let mut ctx = mem::zeroed();
+
+            ffi::X509V3_set_ctx(
+                &mut ctx,
+                ptr::null_mut(),
+                ptr::null_mut(),
+                self.0.as_ptr(),
+                ptr::null_mut(),
+                0,
+            );
+
+            // nodb case taken care of since we zeroed ctx above
+            if let Some(conf) = conf {
+                ffi::X509V3_set_nconf(&mut ctx, conf.as_ptr());
+            }
+
+            X509v3Context(ctx, PhantomData)
+        }
+    }
+
+    /// Permits any number of extension fields to be added to the certificate.
+    pub fn add_extensions(
+        &mut self,
+        extensions: &StackRef<X509Extension>,
+    ) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::X509_REQ_add_extensions(
+                self.0.as_ptr(),
+                extensions.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Sign the request using a private key.
+    ///
+    /// This corresponds to [`X509_REQ_sign`].
+    ///
+    /// [`X509_REQ_sign`]: https://www.openssl.org/docs/manmaster/crypto/X509_REQ_sign.html
+    pub fn sign<T>(&mut self, key: &PKeyRef<T>, hash: MessageDigest) -> Result<(), ErrorStack>
+    where
+        T: HasPrivate,
+    {
+        unsafe {
+            cvt(ffi::X509_REQ_sign(
+                self.0.as_ptr(),
+                key.as_ptr(),
+                hash.as_ptr(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Returns the `X509Req`.
+    pub fn build(self) -> X509Req {
+        self.0
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::X509_REQ;
+    fn drop = ffi::X509_REQ_free;
+
+    /// An `X509` certificate request.
+    pub struct X509Req;
+    /// Reference to `X509Req`.
+    pub struct X509ReqRef;
+}
+
+impl X509Req {
+    /// A builder for `X509Req`.
+    pub fn builder() -> Result<X509ReqBuilder, ErrorStack> {
+        X509ReqBuilder::new()
+    }
+
+    from_pem! {
+        /// Deserializes a PEM-encoded PKCS#10 certificate request structure.
+        ///
+        /// The input should have a header of `-----BEGIN CERTIFICATE REQUEST-----`.
+        ///
+        /// This corresponds to [`PEM_read_bio_X509_REQ`].
+        ///
+        /// [`PEM_read_bio_X509_REQ`]: https://www.openssl.org/docs/manmaster/crypto/PEM_read_bio_X509_REQ.html
+        from_pem,
+        X509Req,
+        ffi::PEM_read_bio_X509_REQ
+    }
+
+    from_der! {
+        /// Deserializes a DER-encoded PKCS#10 certificate request structure.
+        ///
+        /// This corresponds to [`d2i_X509_REQ`].
+        ///
+        /// [`d2i_X509_REQ`]: https://www.openssl.org/docs/manmaster/crypto/d2i_X509_REQ.html
+        from_der,
+        X509Req,
+        ffi::d2i_X509_REQ
+    }
+}
+
+impl X509ReqRef {
+    to_pem! {
+        /// Serializes the certificate request to a PEM-encoded PKCS#10 structure.
+        ///
+        /// The output will have a header of `-----BEGIN CERTIFICATE REQUEST-----`.
+        ///
+        /// This corresponds to [`PEM_write_bio_X509_REQ`].
+        ///
+        /// [`PEM_write_bio_X509_REQ`]: https://www.openssl.org/docs/manmaster/crypto/PEM_write_bio_X509_REQ.html
+        to_pem,
+        ffi::PEM_write_bio_X509_REQ
+    }
+
+    to_der! {
+        /// Serializes the certificate request to a DER-encoded PKCS#10 structure.
+        ///
+        /// This corresponds to [`i2d_X509_REQ`].
+        ///
+        /// [`i2d_X509_REQ`]: https://www.openssl.org/docs/manmaster/crypto/i2d_X509_REQ.html
+        to_der,
+        ffi::i2d_X509_REQ
+    }
+
+    to_pem! {
+        /// Converts the request to human readable text.
+        #[corresponds(X509_Req_print)]
+        to_text,
+        ffi::X509_REQ_print
+    }
+
+    /// Returns the numerical value of the version field of the certificate request.
+    ///
+    /// This corresponds to [`X509_REQ_get_version`]
+    ///
+    /// [`X509_REQ_get_version`]: https://www.openssl.org/docs/manmaster/crypto/X509_REQ_get_version.html
+    #[allow(clippy::unnecessary_cast)]
+    pub fn version(&self) -> i32 {
+        unsafe { X509_REQ_get_version(self.as_ptr()) as i32 }
+    }
+
+    /// Returns the subject name of the certificate request.
+    ///
+    /// This corresponds to [`X509_REQ_get_subject_name`]
+    ///
+    /// [`X509_REQ_get_subject_name`]: https://www.openssl.org/docs/manmaster/crypto/X509_REQ_get_subject_name.html
+    pub fn subject_name(&self) -> &X509NameRef {
+        unsafe {
+            let name = X509_REQ_get_subject_name(self.as_ptr());
+            X509NameRef::from_const_ptr_opt(name).expect("subject name must not be null")
+        }
+    }
+
+    /// Returns the public key of the certificate request.
+    ///
+    /// This corresponds to [`X509_REQ_get_pubkey"]
+    ///
+    /// [`X509_REQ_get_pubkey`]: https://www.openssl.org/docs/manmaster/crypto/X509_REQ_get_pubkey.html
+    pub fn public_key(&self) -> Result<PKey<Public>, ErrorStack> {
+        unsafe {
+            let key = cvt_p(ffi::X509_REQ_get_pubkey(self.as_ptr()))?;
+            Ok(PKey::from_ptr(key))
+        }
+    }
+
+    /// Check if the certificate request is signed using the given public key.
+    ///
+    /// Returns `true` if verification succeeds.
+    ///
+    /// This corresponds to [`X509_REQ_verify"].
+    ///
+    /// [`X509_REQ_verify`]: https://www.openssl.org/docs/manmaster/crypto/X509_REQ_verify.html
+    pub fn verify<T>(&self, key: &PKeyRef<T>) -> Result<bool, ErrorStack>
+    where
+        T: HasPublic,
+    {
+        unsafe { cvt_n(ffi::X509_REQ_verify(self.as_ptr(), key.as_ptr())).map(|n| n != 0) }
+    }
+
+    /// Returns the extensions of the certificate request.
+    ///
+    /// This corresponds to [`X509_REQ_get_extensions"]
+    pub fn extensions(&self) -> Result<Stack<X509Extension>, ErrorStack> {
+        unsafe {
+            let extensions = cvt_p(ffi::X509_REQ_get_extensions(self.as_ptr()))?;
+            Ok(Stack::from_ptr(extensions))
+        }
+    }
+}
+
+/// The reason that a certificate was revoked.
+#[derive(Debug, Copy, Clone, PartialEq, Eq)]
+pub struct CrlReason(c_int);
+
+#[allow(missing_docs)] // no need to document the constants
+impl CrlReason {
+    pub const UNSPECIFIED: CrlReason = CrlReason(ffi::CRL_REASON_UNSPECIFIED);
+    pub const KEY_COMPROMISE: CrlReason = CrlReason(ffi::CRL_REASON_KEY_COMPROMISE);
+    pub const CA_COMPROMISE: CrlReason = CrlReason(ffi::CRL_REASON_CA_COMPROMISE);
+    pub const AFFILIATION_CHANGED: CrlReason = CrlReason(ffi::CRL_REASON_AFFILIATION_CHANGED);
+    pub const SUPERSEDED: CrlReason = CrlReason(ffi::CRL_REASON_SUPERSEDED);
+    pub const CESSATION_OF_OPERATION: CrlReason = CrlReason(ffi::CRL_REASON_CESSATION_OF_OPERATION);
+    pub const CERTIFICATE_HOLD: CrlReason = CrlReason(ffi::CRL_REASON_CERTIFICATE_HOLD);
+    pub const REMOVE_FROM_CRL: CrlReason = CrlReason(ffi::CRL_REASON_REMOVE_FROM_CRL);
+    pub const PRIVILEGE_WITHDRAWN: CrlReason = CrlReason(ffi::CRL_REASON_PRIVILEGE_WITHDRAWN);
+    pub const AA_COMPROMISE: CrlReason = CrlReason(ffi::CRL_REASON_AA_COMPROMISE);
+
+    /// Constructs an `CrlReason` from a raw OpenSSL value.
+    pub const fn from_raw(value: c_int) -> Self {
+        CrlReason(value)
+    }
+
+    /// Returns the raw OpenSSL value represented by this type.
+    pub const fn as_raw(&self) -> c_int {
+        self.0
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::X509_REVOKED;
+    fn drop = ffi::X509_REVOKED_free;
+
+    /// An `X509` certificate revocation status.
+    pub struct X509Revoked;
+    /// Reference to `X509Revoked`.
+    pub struct X509RevokedRef;
+}
+
+impl Stackable for X509Revoked {
+    type StackType = ffi::stack_st_X509_REVOKED;
+}
+
+impl X509Revoked {
+    from_der! {
+        /// Deserializes a DER-encoded certificate revocation status
+        #[corresponds(d2i_X509_REVOKED)]
+        from_der,
+        X509Revoked,
+        ffi::d2i_X509_REVOKED
+    }
+}
+
+impl X509RevokedRef {
+    to_der! {
+        /// Serializes the certificate request to a DER-encoded certificate revocation status
+        #[corresponds(d2i_X509_REVOKED)]
+        to_der,
+        ffi::i2d_X509_REVOKED
+    }
+
+    /// Copies the entry to a new `X509Revoked`.
+    #[corresponds(X509_NAME_dup)]
+    #[cfg(any(boringssl, ossl110, libressl270))]
+    pub fn to_owned(&self) -> Result<X509Revoked, ErrorStack> {
+        unsafe { cvt_p(ffi::X509_REVOKED_dup(self.as_ptr())).map(|n| X509Revoked::from_ptr(n)) }
+    }
+
+    /// Get the date that the certificate was revoked
+    #[corresponds(X509_REVOKED_get0_revocationDate)]
+    pub fn revocation_date(&self) -> &Asn1TimeRef {
+        unsafe {
+            let r = X509_REVOKED_get0_revocationDate(self.as_ptr() as *const _);
+            assert!(!r.is_null());
+            Asn1TimeRef::from_ptr(r as *mut _)
+        }
+    }
+
+    /// Get the serial number of the revoked certificate
+    #[corresponds(X509_REVOKED_get0_serialNumber)]
+    pub fn serial_number(&self) -> &Asn1IntegerRef {
+        unsafe {
+            let r = X509_REVOKED_get0_serialNumber(self.as_ptr() as *const _);
+            assert!(!r.is_null());
+            Asn1IntegerRef::from_ptr(r as *mut _)
+        }
+    }
+
+    /// Get the criticality and value of an extension.
+    ///
+    /// This returns None if the extension is not present or occurs multiple times.
+    #[corresponds(X509_REVOKED_get_ext_d2i)]
+    pub fn extension<T: ExtensionType>(&self) -> Result<Option<(bool, T::Output)>, ErrorStack> {
+        let mut critical = -1;
+        let out = unsafe {
+            // SAFETY: self.as_ptr() is a valid pointer to an X509_REVOKED.
+            let ext = ffi::X509_REVOKED_get_ext_d2i(
+                self.as_ptr(),
+                T::NID.as_raw(),
+                &mut critical as *mut _,
+                ptr::null_mut(),
+            );
+            // SAFETY: Extensions's contract promises that the type returned by
+            // OpenSSL here is T::Output.
+            T::Output::from_ptr_opt(ext as *mut _)
+        };
+        match (critical, out) {
+            (0, Some(out)) => Ok(Some((false, out))),
+            (1, Some(out)) => Ok(Some((true, out))),
+            // -1 means the extension wasn't found, -2 means multiple were found.
+            (-1 | -2, _) => Ok(None),
+            // A critical value of 0 or 1 suggests success, but a null pointer
+            // was returned so something went wrong.
+            (0 | 1, None) => Err(ErrorStack::get()),
+            (c_int::MIN..=-2 | 2.., _) => panic!("OpenSSL should only return -2, -1, 0, or 1 for an extension's criticality but it returned {}", critical),
+        }
+    }
+}
+
+/// The CRL entry extension identifying the reason for revocation see [`CrlReason`],
+/// this is as defined in RFC 5280 Section 5.3.1.
+pub enum ReasonCode {}
+
+// SAFETY: CertificateIssuer is defined to be a stack of GeneralName in the RFC
+// and in OpenSSL.
+unsafe impl ExtensionType for ReasonCode {
+    const NID: Nid = Nid::from_raw(ffi::NID_crl_reason);
+
+    type Output = Asn1Enumerated;
+}
+
+/// The CRL entry extension identifying the issuer of a certificate used in
+/// indirect CRLs, as defined in RFC 5280 Section 5.3.3.
+pub enum CertificateIssuer {}
+
+// SAFETY: CertificateIssuer is defined to be a stack of GeneralName in the RFC
+// and in OpenSSL.
+unsafe impl ExtensionType for CertificateIssuer {
+    const NID: Nid = Nid::from_raw(ffi::NID_certificate_issuer);
+
+    type Output = Stack<GeneralName>;
+}
+
+/// The CRL extension identifying how to access information and services for the issuer of the CRL
+pub enum AuthorityInformationAccess {}
+
+// SAFETY: AuthorityInformationAccess is defined to be a stack of AccessDescription in the RFC
+// and in OpenSSL.
+unsafe impl ExtensionType for AuthorityInformationAccess {
+    const NID: Nid = Nid::from_raw(ffi::NID_info_access);
+
+    type Output = Stack<AccessDescription>;
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::X509_CRL;
+    fn drop = ffi::X509_CRL_free;
+
+    /// An `X509` certificate revocation list.
+    pub struct X509Crl;
+    /// Reference to `X509Crl`.
+    pub struct X509CrlRef;
+}
+
+/// The status of a certificate in a revoction list
+///
+/// Corresponds to the return value from the [`X509_CRL_get0_by_*`] methods.
+///
+/// [`X509_CRL_get0_by_*`]: https://www.openssl.org/docs/man1.1.0/man3/X509_CRL_get0_by_serial.html
+pub enum CrlStatus<'a> {
+    /// The certificate is not present in the list
+    NotRevoked,
+    /// The certificate is in the list and is revoked
+    Revoked(&'a X509RevokedRef),
+    /// The certificate is in the list, but has the "removeFromCrl" status.
+    ///
+    /// This can occur if the certificate was revoked with the "CertificateHold"
+    /// reason, and has since been unrevoked.
+    RemoveFromCrl(&'a X509RevokedRef),
+}
+
+impl<'a> CrlStatus<'a> {
+    // Helper used by the X509_CRL_get0_by_* methods to convert their return
+    // value to the status enum.
+    // Safety note: the returned CrlStatus must not outlive the owner of the
+    // revoked_entry pointer.
+    unsafe fn from_ffi_status(
+        status: c_int,
+        revoked_entry: *mut ffi::X509_REVOKED,
+    ) -> CrlStatus<'a> {
+        match status {
+            0 => CrlStatus::NotRevoked,
+            1 => {
+                assert!(!revoked_entry.is_null());
+                CrlStatus::Revoked(X509RevokedRef::from_ptr(revoked_entry))
+            }
+            2 => {
+                assert!(!revoked_entry.is_null());
+                CrlStatus::RemoveFromCrl(X509RevokedRef::from_ptr(revoked_entry))
+            }
+            _ => unreachable!(
+                "{}",
+                "X509_CRL_get0_by_{{serial,cert}} should only return 0, 1, or 2."
+            ),
+        }
+    }
+}
+
+impl X509Crl {
+    from_pem! {
+        /// Deserializes a PEM-encoded Certificate Revocation List
+        ///
+        /// The input should have a header of `-----BEGIN X509 CRL-----`.
+        #[corresponds(PEM_read_bio_X509_CRL)]
+        from_pem,
+        X509Crl,
+        ffi::PEM_read_bio_X509_CRL
+    }
+
+    from_der! {
+        /// Deserializes a DER-encoded Certificate Revocation List
+        #[corresponds(d2i_X509_CRL)]
+        from_der,
+        X509Crl,
+        ffi::d2i_X509_CRL
+    }
+}
+
+impl X509CrlRef {
+    to_pem! {
+        /// Serializes the certificate request to a PEM-encoded Certificate Revocation List.
+        ///
+        /// The output will have a header of `-----BEGIN X509 CRL-----`.
+        #[corresponds(PEM_write_bio_X509_CRL)]
+        to_pem,
+        ffi::PEM_write_bio_X509_CRL
+    }
+
+    to_der! {
+        /// Serializes the certificate request to a DER-encoded Certificate Revocation List.
+        #[corresponds(i2d_X509_CRL)]
+        to_der,
+        ffi::i2d_X509_CRL
+    }
+
+    /// Get the stack of revocation entries
+    pub fn get_revoked(&self) -> Option<&StackRef<X509Revoked>> {
+        unsafe {
+            let revoked = X509_CRL_get_REVOKED(self.as_ptr());
+            if revoked.is_null() {
+                None
+            } else {
+                Some(StackRef::from_ptr(revoked))
+            }
+        }
+    }
+
+    /// Returns the CRL's `lastUpdate` time.
+    #[corresponds(X509_CRL_get0_lastUpdate)]
+    pub fn last_update(&self) -> &Asn1TimeRef {
+        unsafe {
+            let date = X509_CRL_get0_lastUpdate(self.as_ptr());
+            assert!(!date.is_null());
+            Asn1TimeRef::from_ptr(date as *mut _)
+        }
+    }
+
+    /// Returns the CRL's `nextUpdate` time.
+    ///
+    /// If the `nextUpdate` field is missing, returns `None`.
+    #[corresponds(X509_CRL_get0_nextUpdate)]
+    pub fn next_update(&self) -> Option<&Asn1TimeRef> {
+        unsafe {
+            let date = X509_CRL_get0_nextUpdate(self.as_ptr());
+            Asn1TimeRef::from_const_ptr_opt(date)
+        }
+    }
+
+    /// Get the revocation status of a certificate by its serial number
+    #[corresponds(X509_CRL_get0_by_serial)]
+    pub fn get_by_serial<'a>(&'a self, serial: &Asn1IntegerRef) -> CrlStatus<'a> {
+        unsafe {
+            let mut ret = ptr::null_mut::<ffi::X509_REVOKED>();
+            let status =
+                ffi::X509_CRL_get0_by_serial(self.as_ptr(), &mut ret as *mut _, serial.as_ptr());
+            CrlStatus::from_ffi_status(status, ret)
+        }
+    }
+
+    /// Get the revocation status of a certificate
+    #[corresponds(X509_CRL_get0_by_cert)]
+    pub fn get_by_cert<'a>(&'a self, cert: &X509) -> CrlStatus<'a> {
+        unsafe {
+            let mut ret = ptr::null_mut::<ffi::X509_REVOKED>();
+            let status =
+                ffi::X509_CRL_get0_by_cert(self.as_ptr(), &mut ret as *mut _, cert.as_ptr());
+            CrlStatus::from_ffi_status(status, ret)
+        }
+    }
+
+    /// Get the issuer name from the revocation list.
+    #[corresponds(X509_CRL_get_issuer)]
+    pub fn issuer_name(&self) -> &X509NameRef {
+        unsafe {
+            let name = X509_CRL_get_issuer(self.as_ptr());
+            assert!(!name.is_null());
+            X509NameRef::from_ptr(name)
+        }
+    }
+
+    /// Check if the CRL is signed using the given public key.
+    ///
+    /// Only the signature is checked: no other checks (such as certificate chain validity)
+    /// are performed.
+    ///
+    /// Returns `true` if verification succeeds.
+    #[corresponds(X509_CRL_verify)]
+    pub fn verify<T>(&self, key: &PKeyRef<T>) -> Result<bool, ErrorStack>
+    where
+        T: HasPublic,
+    {
+        unsafe { cvt_n(ffi::X509_CRL_verify(self.as_ptr(), key.as_ptr())).map(|n| n != 0) }
+    }
+
+    /// Get the criticality and value of an extension.
+    ///
+    /// This returns None if the extension is not present or occurs multiple times.
+    #[corresponds(X509_CRL_get_ext_d2i)]
+    pub fn extension<T: ExtensionType>(&self) -> Result<Option<(bool, T::Output)>, ErrorStack> {
+        let mut critical = -1;
+        let out = unsafe {
+            // SAFETY: self.as_ptr() is a valid pointer to an X509_CRL.
+            let ext = ffi::X509_CRL_get_ext_d2i(
+                self.as_ptr(),
+                T::NID.as_raw(),
+                &mut critical as *mut _,
+                ptr::null_mut(),
+            );
+            // SAFETY: Extensions's contract promises that the type returned by
+            // OpenSSL here is T::Output.
+            T::Output::from_ptr_opt(ext as *mut _)
+        };
+        match (critical, out) {
+            (0, Some(out)) => Ok(Some((false, out))),
+            (1, Some(out)) => Ok(Some((true, out))),
+            // -1 means the extension wasn't found, -2 means multiple were found.
+            (-1 | -2, _) => Ok(None),
+            // A critical value of 0 or 1 suggests success, but a null pointer
+            // was returned so something went wrong.
+            (0 | 1, None) => Err(ErrorStack::get()),
+            (c_int::MIN..=-2 | 2.., _) => panic!("OpenSSL should only return -2, -1, 0, or 1 for an extension's criticality but it returned {}", critical),
+        }
+    }
+}
+
+/// The result of peer certificate verification.
+#[derive(Copy, Clone, PartialEq, Eq)]
+pub struct X509VerifyResult(c_int);
+
+impl fmt::Debug for X509VerifyResult {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
+        fmt.debug_struct("X509VerifyResult")
+            .field("code", &self.0)
+            .field("error", &self.error_string())
+            .finish()
+    }
+}
+
+impl fmt::Display for X509VerifyResult {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
+        fmt.write_str(self.error_string())
+    }
+}
+
+impl Error for X509VerifyResult {}
+
+impl X509VerifyResult {
+    /// Creates an `X509VerifyResult` from a raw error number.
+    ///
+    /// # Safety
+    ///
+    /// Some methods on `X509VerifyResult` are not thread safe if the error
+    /// number is invalid.
+    pub unsafe fn from_raw(err: c_int) -> X509VerifyResult {
+        X509VerifyResult(err)
+    }
+
+    /// Return the integer representation of an `X509VerifyResult`.
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn as_raw(&self) -> c_int {
+        self.0
+    }
+
+    /// Return a human readable error string from the verification error.
+    ///
+    /// This corresponds to [`X509_verify_cert_error_string`].
+    ///
+    /// [`X509_verify_cert_error_string`]: https://www.openssl.org/docs/manmaster/crypto/X509_verify_cert_error_string.html
+    #[allow(clippy::trivially_copy_pass_by_ref)]
+    pub fn error_string(&self) -> &'static str {
+        ffi::init();
+
+        unsafe {
+            let s = ffi::X509_verify_cert_error_string(self.0 as c_long);
+            str::from_utf8(CStr::from_ptr(s).to_bytes()).unwrap()
+        }
+    }
+
+    /// Successful peer certificate verification.
+    pub const OK: X509VerifyResult = X509VerifyResult(ffi::X509_V_OK);
+    /// Application verification failure.
+    pub const APPLICATION_VERIFICATION: X509VerifyResult =
+        X509VerifyResult(ffi::X509_V_ERR_APPLICATION_VERIFICATION);
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::GENERAL_NAME;
+    fn drop = ffi::GENERAL_NAME_free;
+
+    /// An `X509` certificate alternative names.
+    pub struct GeneralName;
+    /// Reference to `GeneralName`.
+    pub struct GeneralNameRef;
+}
+
+impl GeneralName {
+    unsafe fn new(
+        type_: c_int,
+        asn1_type: Asn1Type,
+        value: &[u8],
+    ) -> Result<GeneralName, ErrorStack> {
+        ffi::init();
+        let gn = GeneralName::from_ptr(cvt_p(ffi::GENERAL_NAME_new())?);
+        (*gn.as_ptr()).type_ = type_;
+        let s = cvt_p(ffi::ASN1_STRING_type_new(asn1_type.as_raw()))?;
+        ffi::ASN1_STRING_set(s, value.as_ptr().cast(), value.len().try_into().unwrap());
+
+        #[cfg(boringssl)]
+        {
+            (*gn.as_ptr()).d.ptr = s.cast();
+        }
+        #[cfg(not(boringssl))]
+        {
+            (*gn.as_ptr()).d = s.cast();
+        }
+
+        Ok(gn)
+    }
+
+    pub(crate) fn new_email(email: &[u8]) -> Result<GeneralName, ErrorStack> {
+        unsafe { GeneralName::new(ffi::GEN_EMAIL, Asn1Type::IA5STRING, email) }
+    }
+
+    pub(crate) fn new_dns(dns: &[u8]) -> Result<GeneralName, ErrorStack> {
+        unsafe { GeneralName::new(ffi::GEN_DNS, Asn1Type::IA5STRING, dns) }
+    }
+
+    pub(crate) fn new_uri(uri: &[u8]) -> Result<GeneralName, ErrorStack> {
+        unsafe { GeneralName::new(ffi::GEN_URI, Asn1Type::IA5STRING, uri) }
+    }
+
+    pub(crate) fn new_ip(ip: IpAddr) -> Result<GeneralName, ErrorStack> {
+        match ip {
+            IpAddr::V4(addr) => unsafe {
+                GeneralName::new(ffi::GEN_IPADD, Asn1Type::OCTET_STRING, &addr.octets())
+            },
+            IpAddr::V6(addr) => unsafe {
+                GeneralName::new(ffi::GEN_IPADD, Asn1Type::OCTET_STRING, &addr.octets())
+            },
+        }
+    }
+
+    pub(crate) fn new_rid(oid: Asn1Object) -> Result<GeneralName, ErrorStack> {
+        unsafe {
+            ffi::init();
+            let gn = cvt_p(ffi::GENERAL_NAME_new())?;
+            (*gn).type_ = ffi::GEN_RID;
+
+            #[cfg(boringssl)]
+            {
+                (*gn).d.registeredID = oid.as_ptr();
+            }
+            #[cfg(not(boringssl))]
+            {
+                (*gn).d = oid.as_ptr().cast();
+            }
+
+            mem::forget(oid);
+
+            Ok(GeneralName::from_ptr(gn))
+        }
+    }
+
+    pub(crate) fn new_other_name(oid: Asn1Object, value: &[u8]) -> Result<GeneralName, ErrorStack> {
+        unsafe {
+            ffi::init();
+
+            let typ = cvt_p(ffi::d2i_ASN1_TYPE(
+                ptr::null_mut(),
+                &mut value.as_ptr().cast(),
+                value.len().try_into().unwrap(),
+            ))?;
+
+            let gn = cvt_p(ffi::GENERAL_NAME_new())?;
+            (*gn).type_ = ffi::GEN_OTHERNAME;
+
+            if let Err(e) = cvt(ffi::GENERAL_NAME_set0_othername(
+                gn,
+                oid.as_ptr().cast(),
+                typ,
+            )) {
+                ffi::GENERAL_NAME_free(gn);
+                return Err(e);
+            }
+
+            mem::forget(oid);
+
+            Ok(GeneralName::from_ptr(gn))
+        }
+    }
+}
+
+impl GeneralNameRef {
+    fn ia5_string(&self, ffi_type: c_int) -> Option<&str> {
+        unsafe {
+            if (*self.as_ptr()).type_ != ffi_type {
+                return None;
+            }
+
+            #[cfg(boringssl)]
+            let d = (*self.as_ptr()).d.ptr;
+            #[cfg(not(boringssl))]
+            let d = (*self.as_ptr()).d;
+
+            let ptr = ASN1_STRING_get0_data(d as *mut _);
+            let len = ffi::ASN1_STRING_length(d as *mut _);
+
+            #[allow(clippy::unnecessary_cast)]
+            let slice = slice::from_raw_parts(ptr as *const u8, len as usize);
+            // IA5Strings are stated to be ASCII (specifically IA5). Hopefully
+            // OpenSSL checks that when loading a certificate but if not we'll
+            // use this instead of from_utf8_unchecked just in case.
+            str::from_utf8(slice).ok()
+        }
+    }
+
+    /// Returns the contents of this `GeneralName` if it is an `rfc822Name`.
+    pub fn email(&self) -> Option<&str> {
+        self.ia5_string(ffi::GEN_EMAIL)
+    }
+
+    /// Returns the contents of this `GeneralName` if it is a `directoryName`.
+    pub fn directory_name(&self) -> Option<&X509NameRef> {
+        unsafe {
+            if (*self.as_ptr()).type_ != ffi::GEN_DIRNAME {
+                return None;
+            }
+
+            #[cfg(boringssl)]
+            let d = (*self.as_ptr()).d.ptr;
+            #[cfg(not(boringssl))]
+            let d = (*self.as_ptr()).d;
+
+            Some(X509NameRef::from_const_ptr(d as *const _))
+        }
+    }
+
+    /// Returns the contents of this `GeneralName` if it is a `dNSName`.
+    pub fn dnsname(&self) -> Option<&str> {
+        self.ia5_string(ffi::GEN_DNS)
+    }
+
+    /// Returns the contents of this `GeneralName` if it is an `uniformResourceIdentifier`.
+    pub fn uri(&self) -> Option<&str> {
+        self.ia5_string(ffi::GEN_URI)
+    }
+
+    /// Returns the contents of this `GeneralName` if it is an `iPAddress`.
+    pub fn ipaddress(&self) -> Option<&[u8]> {
+        unsafe {
+            if (*self.as_ptr()).type_ != ffi::GEN_IPADD {
+                return None;
+            }
+            #[cfg(boringssl)]
+            let d: *const ffi::ASN1_STRING = std::mem::transmute((*self.as_ptr()).d);
+            #[cfg(not(boringssl))]
+            let d = (*self.as_ptr()).d;
+
+            let ptr = ASN1_STRING_get0_data(d as *mut _);
+            let len = ffi::ASN1_STRING_length(d as *mut _);
+
+            #[allow(clippy::unnecessary_cast)]
+            Some(slice::from_raw_parts(ptr as *const u8, len as usize))
+        }
+    }
+}
+
+impl fmt::Debug for GeneralNameRef {
+    fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
+        if let Some(email) = self.email() {
+            formatter.write_str(email)
+        } else if let Some(dnsname) = self.dnsname() {
+            formatter.write_str(dnsname)
+        } else if let Some(uri) = self.uri() {
+            formatter.write_str(uri)
+        } else if let Some(ipaddress) = self.ipaddress() {
+            let address = <[u8; 16]>::try_from(ipaddress)
+                .map(IpAddr::from)
+                .or_else(|_| <[u8; 4]>::try_from(ipaddress).map(IpAddr::from));
+            match address {
+                Ok(a) => fmt::Debug::fmt(&a, formatter),
+                Err(_) => fmt::Debug::fmt(ipaddress, formatter),
+            }
+        } else {
+            formatter.write_str("(empty)")
+        }
+    }
+}
+
+impl Stackable for GeneralName {
+    type StackType = ffi::stack_st_GENERAL_NAME;
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::DIST_POINT;
+    fn drop = ffi::DIST_POINT_free;
+
+    /// A `X509` distribution point.
+    pub struct DistPoint;
+    /// Reference to `DistPoint`.
+    pub struct DistPointRef;
+}
+
+impl DistPointRef {
+    /// Returns the name of this distribution point if it exists
+    pub fn distpoint(&self) -> Option<&DistPointNameRef> {
+        unsafe { DistPointNameRef::from_const_ptr_opt((*self.as_ptr()).distpoint) }
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::DIST_POINT_NAME;
+    fn drop = ffi::DIST_POINT_NAME_free;
+
+    /// A `X509` distribution point.
+    pub struct DistPointName;
+    /// Reference to `DistPointName`.
+    pub struct DistPointNameRef;
+}
+
+impl DistPointNameRef {
+    /// Returns the contents of this DistPointName if it is a fullname.
+    pub fn fullname(&self) -> Option<&StackRef<GeneralName>> {
+        unsafe {
+            if (*self.as_ptr()).type_ != 0 {
+                return None;
+            }
+            StackRef::from_const_ptr_opt((*self.as_ptr()).name.fullname)
+        }
+    }
+}
+
+impl Stackable for DistPoint {
+    type StackType = ffi::stack_st_DIST_POINT;
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::ACCESS_DESCRIPTION;
+    fn drop = ffi::ACCESS_DESCRIPTION_free;
+
+    /// `AccessDescription` of certificate authority information.
+    pub struct AccessDescription;
+    /// Reference to `AccessDescription`.
+    pub struct AccessDescriptionRef;
+}
+
+impl AccessDescriptionRef {
+    /// Returns the access method OID.
+    pub fn method(&self) -> &Asn1ObjectRef {
+        unsafe { Asn1ObjectRef::from_ptr((*self.as_ptr()).method) }
+    }
+
+    // Returns the access location.
+    pub fn location(&self) -> &GeneralNameRef {
+        unsafe { GeneralNameRef::from_ptr((*self.as_ptr()).location) }
+    }
+}
+
+impl Stackable for AccessDescription {
+    type StackType = ffi::stack_st_ACCESS_DESCRIPTION;
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::X509_ALGOR;
+    fn drop = ffi::X509_ALGOR_free;
+
+    /// An `X509` certificate signature algorithm.
+    pub struct X509Algorithm;
+    /// Reference to `X509Algorithm`.
+    pub struct X509AlgorithmRef;
+}
+
+impl X509AlgorithmRef {
+    /// Returns the ASN.1 OID of this algorithm.
+    pub fn object(&self) -> &Asn1ObjectRef {
+        unsafe {
+            let mut oid = ptr::null();
+            X509_ALGOR_get0(&mut oid, ptr::null_mut(), ptr::null_mut(), self.as_ptr());
+            Asn1ObjectRef::from_const_ptr_opt(oid).expect("algorithm oid must not be null")
+        }
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::X509_OBJECT;
+    fn drop = X509_OBJECT_free;
+
+    /// An `X509` or an X509 certificate revocation list.
+    pub struct X509Object;
+    /// Reference to `X509Object`
+    pub struct X509ObjectRef;
+}
+
+impl X509ObjectRef {
+    pub fn x509(&self) -> Option<&X509Ref> {
+        unsafe {
+            let ptr = X509_OBJECT_get0_X509(self.as_ptr());
+            X509Ref::from_const_ptr_opt(ptr)
+        }
+    }
+}
+
+impl Stackable for X509Object {
+    type StackType = ffi::stack_st_X509_OBJECT;
+}
+
+cfg_if! {
+    if #[cfg(any(boringssl, ossl110, libressl273))] {
+        use ffi::{X509_getm_notAfter, X509_getm_notBefore, X509_up_ref, X509_get0_signature};
+    } else {
+        #[allow(bad_style)]
+        unsafe fn X509_getm_notAfter(x: *mut ffi::X509) -> *mut ffi::ASN1_TIME {
+            (*(*(*x).cert_info).validity).notAfter
+        }
+
+        #[allow(bad_style)]
+        unsafe fn X509_getm_notBefore(x: *mut ffi::X509) -> *mut ffi::ASN1_TIME {
+            (*(*(*x).cert_info).validity).notBefore
+        }
+
+        #[allow(bad_style)]
+        unsafe fn X509_up_ref(x: *mut ffi::X509) {
+            ffi::CRYPTO_add_lock(
+                &mut (*x).references,
+                1,
+                ffi::CRYPTO_LOCK_X509,
+                "mod.rs\0".as_ptr() as *const _,
+                line!() as c_int,
+            );
+        }
+
+        #[allow(bad_style)]
+        unsafe fn X509_get0_signature(
+            psig: *mut *const ffi::ASN1_BIT_STRING,
+            palg: *mut *const ffi::X509_ALGOR,
+            x: *const ffi::X509,
+        ) {
+            if !psig.is_null() {
+                *psig = (*x).signature;
+            }
+            if !palg.is_null() {
+                *palg = (*x).sig_alg;
+            }
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(boringssl, ossl110, libressl350))] {
+        use ffi::{
+            X509_ALGOR_get0, ASN1_STRING_get0_data, X509_STORE_CTX_get0_chain, X509_set1_notAfter,
+            X509_set1_notBefore, X509_REQ_get_version, X509_REQ_get_subject_name,
+        };
+    } else {
+        use ffi::{
+            ASN1_STRING_data as ASN1_STRING_get0_data,
+            X509_STORE_CTX_get_chain as X509_STORE_CTX_get0_chain,
+            X509_set_notAfter as X509_set1_notAfter,
+            X509_set_notBefore as X509_set1_notBefore,
+        };
+
+        #[allow(bad_style)]
+        unsafe fn X509_REQ_get_version(x: *mut ffi::X509_REQ) -> ::libc::c_long {
+            ffi::ASN1_INTEGER_get((*(*x).req_info).version)
+        }
+
+        #[allow(bad_style)]
+        unsafe fn X509_REQ_get_subject_name(x: *mut ffi::X509_REQ) -> *mut ::ffi::X509_NAME {
+            (*(*x).req_info).subject
+        }
+
+        #[allow(bad_style)]
+        unsafe fn X509_ALGOR_get0(
+            paobj: *mut *const ffi::ASN1_OBJECT,
+            pptype: *mut c_int,
+            pval: *mut *mut ::libc::c_void,
+            alg: *const ffi::X509_ALGOR,
+        ) {
+            if !paobj.is_null() {
+                *paobj = (*alg).algorithm;
+            }
+            assert!(pptype.is_null());
+            assert!(pval.is_null());
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, boringssl, libressl270))] {
+        use ffi::X509_OBJECT_get0_X509;
+    } else {
+        #[allow(bad_style)]
+        unsafe fn X509_OBJECT_get0_X509(x: *mut ffi::X509_OBJECT) -> *mut ffi::X509 {
+            if (*x).type_ == ffi::X509_LU_X509 {
+                (*x).data.x509
+            } else {
+                ptr::null_mut()
+            }
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl350, boringssl))] {
+        use ffi::X509_OBJECT_free;
+    } else {
+        #[allow(bad_style)]
+        unsafe fn X509_OBJECT_free(x: *mut ffi::X509_OBJECT) {
+            ffi::X509_OBJECT_free_contents(x);
+            ffi::CRYPTO_free(x as *mut libc::c_void);
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl350, boringssl))] {
+        use ffi::{
+            X509_CRL_get_issuer, X509_CRL_get0_nextUpdate, X509_CRL_get0_lastUpdate,
+            X509_CRL_get_REVOKED,
+            X509_REVOKED_get0_revocationDate, X509_REVOKED_get0_serialNumber,
+        };
+    } else {
+        #[allow(bad_style)]
+        unsafe fn X509_CRL_get0_lastUpdate(x: *const ffi::X509_CRL) -> *mut ffi::ASN1_TIME {
+            (*(*x).crl).lastUpdate
+        }
+        #[allow(bad_style)]
+        unsafe fn X509_CRL_get0_nextUpdate(x: *const ffi::X509_CRL) -> *mut ffi::ASN1_TIME {
+            (*(*x).crl).nextUpdate
+        }
+        #[allow(bad_style)]
+        unsafe fn X509_CRL_get_issuer(x: *const ffi::X509_CRL) -> *mut ffi::X509_NAME {
+            (*(*x).crl).issuer
+        }
+        #[allow(bad_style)]
+        unsafe fn X509_CRL_get_REVOKED(x: *const ffi::X509_CRL) -> *mut ffi::stack_st_X509_REVOKED {
+            (*(*x).crl).revoked
+        }
+        #[allow(bad_style)]
+        unsafe fn X509_REVOKED_get0_serialNumber(x: *const ffi::X509_REVOKED) -> *mut ffi::ASN1_INTEGER {
+            (*x).serialNumber
+        }
+        #[allow(bad_style)]
+        unsafe fn X509_REVOKED_get0_revocationDate(x: *const ffi::X509_REVOKED) -> *mut ffi::ASN1_TIME {
+            (*x).revocationDate
+        }
+    }
+}
+
+#[derive(Copy, Clone, PartialEq, Eq)]
+pub struct X509PurposeId(c_int);
+
+impl X509PurposeId {
+    pub const SSL_CLIENT: X509PurposeId = X509PurposeId(ffi::X509_PURPOSE_SSL_CLIENT);
+    pub const SSL_SERVER: X509PurposeId = X509PurposeId(ffi::X509_PURPOSE_SSL_SERVER);
+    pub const NS_SSL_SERVER: X509PurposeId = X509PurposeId(ffi::X509_PURPOSE_NS_SSL_SERVER);
+    pub const SMIME_SIGN: X509PurposeId = X509PurposeId(ffi::X509_PURPOSE_SMIME_SIGN);
+    pub const SMIME_ENCRYPT: X509PurposeId = X509PurposeId(ffi::X509_PURPOSE_SMIME_ENCRYPT);
+    pub const CRL_SIGN: X509PurposeId = X509PurposeId(ffi::X509_PURPOSE_CRL_SIGN);
+    pub const ANY: X509PurposeId = X509PurposeId(ffi::X509_PURPOSE_ANY);
+    pub const OCSP_HELPER: X509PurposeId = X509PurposeId(ffi::X509_PURPOSE_OCSP_HELPER);
+    pub const TIMESTAMP_SIGN: X509PurposeId = X509PurposeId(ffi::X509_PURPOSE_TIMESTAMP_SIGN);
+    #[cfg(ossl320)]
+    pub const CODE_SIGN: X509PurposeId = X509PurposeId(ffi::X509_PURPOSE_CODE_SIGN);
+
+    /// Constructs an `X509PurposeId` from a raw OpenSSL value.
+    pub fn from_raw(id: c_int) -> Self {
+        X509PurposeId(id)
+    }
+
+    /// Returns the raw OpenSSL value represented by this type.
+    pub fn as_raw(&self) -> c_int {
+        self.0
+    }
+}
+
+/// A reference to an [`X509_PURPOSE`].
+pub struct X509PurposeRef(Opaque);
+
+/// Implements a wrapper type for the static `X509_PURPOSE` table in OpenSSL.
+impl ForeignTypeRef for X509PurposeRef {
+    type CType = ffi::X509_PURPOSE;
+}
+
+impl X509PurposeRef {
+    /// Get the internal table index of an X509_PURPOSE for a given short name. Valid short
+    /// names include
+    ///  - "sslclient",
+    ///  - "sslserver",
+    ///  - "nssslserver",
+    ///  - "smimesign",
+    ///  - "smimeencrypt",
+    ///  - "crlsign",
+    ///  - "any",
+    ///  - "ocsphelper",
+    ///  - "timestampsign"
+    /// The index can be used with `X509PurposeRef::from_idx()` to get the purpose.
+    #[allow(clippy::unnecessary_cast)]
+    pub fn get_by_sname(sname: &str) -> Result<c_int, ErrorStack> {
+        unsafe {
+            let sname = CString::new(sname).unwrap();
+            cfg_if! {
+                if #[cfg(any(ossl110, libressl280, boringssl))] {
+                    let purpose = cvt_n(ffi::X509_PURPOSE_get_by_sname(sname.as_ptr() as *const _))?;
+                } else {
+                    let purpose = cvt_n(ffi::X509_PURPOSE_get_by_sname(sname.as_ptr() as *mut _))?;
+                }
+            }
+            Ok(purpose)
+        }
+    }
+    /// Get an `X509PurposeRef` for a given index value. The index can be obtained from e.g.
+    /// `X509PurposeRef::get_by_sname()`.
+    #[corresponds(X509_PURPOSE_get0)]
+    pub fn from_idx(idx: c_int) -> Result<&'static X509PurposeRef, ErrorStack> {
+        unsafe {
+            let ptr = cvt_p_const(ffi::X509_PURPOSE_get0(idx))?;
+            Ok(X509PurposeRef::from_const_ptr(ptr))
+        }
+    }
+
+    /// Get the purpose value from an X509Purpose structure. This value is one of
+    /// - `X509_PURPOSE_SSL_CLIENT`
+    /// - `X509_PURPOSE_SSL_SERVER`
+    /// - `X509_PURPOSE_NS_SSL_SERVER`
+    /// - `X509_PURPOSE_SMIME_SIGN`
+    /// - `X509_PURPOSE_SMIME_ENCRYPT`
+    /// - `X509_PURPOSE_CRL_SIGN`
+    /// - `X509_PURPOSE_ANY`
+    /// - `X509_PURPOSE_OCSP_HELPER`
+    /// - `X509_PURPOSE_TIMESTAMP_SIGN`
+    pub fn purpose(&self) -> X509PurposeId {
+        unsafe {
+            cfg_if! {
+                if #[cfg(any(ossl110, libressl280, boringssl))] {
+                    let x509_purpose = self.as_ptr() as *const ffi::X509_PURPOSE;
+                } else {
+                    let x509_purpose = self.as_ptr() as *mut ffi::X509_PURPOSE;
+                }
+            }
+            X509PurposeId::from_raw(ffi::X509_PURPOSE_get_id(x509_purpose))
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/x509/store.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/x509/store.rs
--- 43.0.0-1/rust-vendor/openssl/src/x509/store.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/x509/store.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,304 @@
+//! Describe a context in which to verify an `X509` certificate.
+//!
+//! The `X509` certificate store holds trusted CA certificates used to verify
+//! peer certificates.
+//!
+//! # Example
+//!
+//! ```rust
+//! use openssl::x509::store::{X509StoreBuilder, X509Store};
+//! use openssl::x509::{X509, X509Name};
+//! use openssl::asn1::Asn1Time;
+//! use openssl::pkey::PKey;
+//! use openssl::hash::MessageDigest;
+//! use openssl::rsa::Rsa;
+//! use openssl::nid::Nid;
+//!
+//! let rsa = Rsa::generate(2048).unwrap();
+//! let pkey = PKey::from_rsa(rsa).unwrap();
+//!
+//! let mut name = X509Name::builder().unwrap();
+//! name.append_entry_by_nid(Nid::COMMONNAME, "foobar.com").unwrap();
+//! let name = name.build();
+//!
+//! // Sep 27th, 2016
+//! let sample_time = Asn1Time::from_unix(1474934400).unwrap();
+//!
+//! let mut builder = X509::builder().unwrap();
+//! builder.set_version(2).unwrap();
+//! builder.set_subject_name(&name).unwrap();
+//! builder.set_issuer_name(&name).unwrap();
+//! builder.set_pubkey(&pkey).unwrap();
+//! builder.set_not_before(&sample_time);
+//! builder.set_not_after(&sample_time);
+//! builder.sign(&pkey, MessageDigest::sha256()).unwrap();
+//!
+//! let certificate: X509 = builder.build();
+//!
+//! let mut builder = X509StoreBuilder::new().unwrap();
+//! let _ = builder.add_cert(certificate);
+//!
+//! let store: X509Store = builder.build();
+//! ```
+
+use cfg_if::cfg_if;
+use foreign_types::{ForeignType, ForeignTypeRef};
+use std::mem;
+
+use crate::error::ErrorStack;
+#[cfg(not(boringssl))]
+use crate::ssl::SslFiletype;
+#[cfg(ossl300)]
+use crate::stack::Stack;
+use crate::stack::StackRef;
+use crate::util::ForeignTypeRefExt;
+#[cfg(any(ossl102, boringssl, libressl261))]
+use crate::x509::verify::{X509VerifyFlags, X509VerifyParamRef};
+use crate::x509::{X509Object, X509PurposeId, X509};
+use crate::{cvt, cvt_p};
+use openssl_macros::corresponds;
+#[cfg(not(boringssl))]
+use std::ffi::CString;
+#[cfg(not(boringssl))]
+use std::path::Path;
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::X509_STORE;
+    fn drop = ffi::X509_STORE_free;
+
+    /// A builder type used to construct an `X509Store`.
+    pub struct X509StoreBuilder;
+    /// A reference to an [`X509StoreBuilder`].
+    pub struct X509StoreBuilderRef;
+}
+
+impl X509StoreBuilder {
+    /// Returns a builder for a certificate store.
+    ///
+    /// The store is initially empty.
+    #[corresponds(X509_STORE_new)]
+    pub fn new() -> Result<X509StoreBuilder, ErrorStack> {
+        unsafe {
+            ffi::init();
+
+            cvt_p(ffi::X509_STORE_new()).map(X509StoreBuilder)
+        }
+    }
+
+    /// Constructs the `X509Store`.
+    pub fn build(self) -> X509Store {
+        let store = X509Store(self.0);
+        mem::forget(self);
+        store
+    }
+}
+
+impl X509StoreBuilderRef {
+    /// Adds a certificate to the certificate store.
+    // FIXME should take an &X509Ref
+    #[corresponds(X509_STORE_add_cert)]
+    pub fn add_cert(&mut self, cert: X509) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::X509_STORE_add_cert(self.as_ptr(), cert.as_ptr())).map(|_| ()) }
+    }
+
+    /// Load certificates from their default locations.
+    ///
+    /// These locations are read from the `SSL_CERT_FILE` and `SSL_CERT_DIR`
+    /// environment variables if present, or defaults specified at OpenSSL
+    /// build time otherwise.
+    #[corresponds(X509_STORE_set_default_paths)]
+    pub fn set_default_paths(&mut self) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::X509_STORE_set_default_paths(self.as_ptr())).map(|_| ()) }
+    }
+
+    /// Adds a lookup method to the store.
+    #[corresponds(X509_STORE_add_lookup)]
+    pub fn add_lookup<T>(
+        &mut self,
+        method: &'static X509LookupMethodRef<T>,
+    ) -> Result<&mut X509LookupRef<T>, ErrorStack> {
+        let lookup = unsafe { ffi::X509_STORE_add_lookup(self.as_ptr(), method.as_ptr()) };
+        cvt_p(lookup).map(|ptr| unsafe { X509LookupRef::from_ptr_mut(ptr) })
+    }
+
+    /// Sets certificate chain validation related flags.
+    #[corresponds(X509_STORE_set_flags)]
+    #[cfg(any(ossl102, boringssl, libressl261))]
+    pub fn set_flags(&mut self, flags: X509VerifyFlags) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::X509_STORE_set_flags(self.as_ptr(), flags.bits())).map(|_| ()) }
+    }
+
+    /// Sets the certificate purpose.
+    /// The purpose value can be obtained by `X509PurposeRef::get_by_sname()`
+    #[corresponds(X509_STORE_set_purpose)]
+    pub fn set_purpose(&mut self, purpose: X509PurposeId) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::X509_STORE_set_purpose(self.as_ptr(), purpose.as_raw())).map(|_| ()) }
+    }
+
+    /// Sets certificate chain validation related parameters.
+    #[corresponds[X509_STORE_set1_param]]
+    #[cfg(any(ossl102, boringssl, libressl261))]
+    pub fn set_param(&mut self, param: &X509VerifyParamRef) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::X509_STORE_set1_param(self.as_ptr(), param.as_ptr())).map(|_| ()) }
+    }
+}
+
+generic_foreign_type_and_impl_send_sync! {
+    type CType = ffi::X509_LOOKUP;
+    fn drop = ffi::X509_LOOKUP_free;
+
+    /// Information used by an `X509Store` to look up certificates and CRLs.
+    pub struct X509Lookup<T>;
+    /// A reference to an [`X509Lookup`].
+    pub struct X509LookupRef<T>;
+}
+
+/// Marker type corresponding to the [`X509_LOOKUP_hash_dir`] lookup method.
+///
+/// [`X509_LOOKUP_hash_dir`]: https://www.openssl.org/docs/manmaster/crypto/X509_LOOKUP_hash_dir.html
+// FIXME should be an enum
+pub struct HashDir;
+
+impl X509Lookup<HashDir> {
+    /// Lookup method that loads certificates and CRLs on demand and caches
+    /// them in memory once they are loaded. It also checks for newer CRLs upon
+    /// each lookup, so that newer CRLs are used as soon as they appear in the
+    /// directory.
+    #[corresponds(X509_LOOKUP_hash_dir)]
+    pub fn hash_dir() -> &'static X509LookupMethodRef<HashDir> {
+        unsafe { X509LookupMethodRef::from_const_ptr(ffi::X509_LOOKUP_hash_dir()) }
+    }
+}
+
+#[cfg(not(boringssl))]
+impl X509LookupRef<HashDir> {
+    /// Specifies a directory from which certificates and CRLs will be loaded
+    /// on-demand. Must be used with `X509Lookup::hash_dir`.
+    #[corresponds(X509_LOOKUP_add_dir)]
+    pub fn add_dir(&mut self, name: &str, file_type: SslFiletype) -> Result<(), ErrorStack> {
+        let name = CString::new(name).unwrap();
+        unsafe {
+            cvt(ffi::X509_LOOKUP_add_dir(
+                self.as_ptr(),
+                name.as_ptr(),
+                file_type.as_raw(),
+            ))
+            .map(|_| ())
+        }
+    }
+}
+
+/// Marker type corresponding to the [`X509_LOOKUP_file`] lookup method.
+///
+/// [`X509_LOOKUP_file`]: https://www.openssl.org/docs/man1.1.1/man3/X509_LOOKUP_file.html
+pub struct File;
+
+impl X509Lookup<File> {
+    /// Lookup method loads all the certificates or CRLs present in a file
+    /// into memory at the time the file is added as a lookup source.
+    #[corresponds(X509_LOOKUP_file)]
+    pub fn file() -> &'static X509LookupMethodRef<File> {
+        unsafe { X509LookupMethodRef::from_const_ptr(ffi::X509_LOOKUP_file()) }
+    }
+}
+
+#[cfg(not(boringssl))]
+impl X509LookupRef<File> {
+    /// Specifies a file from which certificates will be loaded
+    #[corresponds(X509_load_cert_file)]
+    // FIXME should return 'Result<i32, ErrorStack' like load_crl_file
+    pub fn load_cert_file<P: AsRef<Path>>(
+        &mut self,
+        file: P,
+        file_type: SslFiletype,
+    ) -> Result<(), ErrorStack> {
+        let file = CString::new(file.as_ref().as_os_str().to_str().unwrap()).unwrap();
+        unsafe {
+            cvt(ffi::X509_load_cert_file(
+                self.as_ptr(),
+                file.as_ptr(),
+                file_type.as_raw(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Specifies a file from which certificate revocation lists will be loaded
+    #[corresponds(X509_load_crl_file)]
+    pub fn load_crl_file<P: AsRef<Path>>(
+        &mut self,
+        file: P,
+        file_type: SslFiletype,
+    ) -> Result<i32, ErrorStack> {
+        let file = CString::new(file.as_ref().as_os_str().to_str().unwrap()).unwrap();
+        unsafe {
+            cvt(ffi::X509_load_crl_file(
+                self.as_ptr(),
+                file.as_ptr(),
+                file_type.as_raw(),
+            ))
+        }
+    }
+}
+
+generic_foreign_type_and_impl_send_sync! {
+    type CType = ffi::X509_LOOKUP_METHOD;
+    fn drop = X509_LOOKUP_meth_free;
+
+    /// Method used to look up certificates and CRLs.
+    pub struct X509LookupMethod<T>;
+    /// A reference to an [`X509LookupMethod`].
+    pub struct X509LookupMethodRef<T>;
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::X509_STORE;
+    fn drop = ffi::X509_STORE_free;
+
+    /// A certificate store to hold trusted `X509` certificates.
+    pub struct X509Store;
+    /// Reference to an `X509Store`.
+    pub struct X509StoreRef;
+}
+
+impl X509StoreRef {
+    /// Get a reference to the cache of certificates in this store.
+    ///
+    /// This method is deprecated. It is **unsound** and will be removed in a
+    /// future version of rust-openssl. `X509StoreRef::all_certificates`
+    /// should be used instead.
+    #[deprecated(
+        note = "This method is unsound, and will be removed in a future version of rust-openssl. X509StoreRef::all_certificates should be used instead."
+    )]
+    #[corresponds(X509_STORE_get0_objects)]
+    pub fn objects(&self) -> &StackRef<X509Object> {
+        unsafe { StackRef::from_ptr(X509_STORE_get0_objects(self.as_ptr())) }
+    }
+
+    /// Returns a stack of all the certificates in this store.
+    #[corresponds(X509_STORE_get1_all_certs)]
+    #[cfg(ossl300)]
+    pub fn all_certificates(&self) -> Stack<X509> {
+        unsafe { Stack::from_ptr(ffi::X509_STORE_get1_all_certs(self.as_ptr())) }
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(boringssl, ossl110, libressl270))] {
+        use ffi::X509_STORE_get0_objects;
+    } else {
+        #[allow(bad_style)]
+        unsafe fn X509_STORE_get0_objects(x: *mut ffi::X509_STORE) -> *mut ffi::stack_st_X509_OBJECT {
+            (*x).objs
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(ossl110)] {
+        use ffi::X509_LOOKUP_meth_free;
+    } else {
+        #[allow(bad_style)]
+        unsafe fn X509_LOOKUP_meth_free(_x: *mut ffi::X509_LOOKUP_METHOD) {}
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/x509/tests.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/x509/tests.rs
--- 43.0.0-1/rust-vendor/openssl/src/x509/tests.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/x509/tests.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1194 @@
+use std::cmp::Ordering;
+
+use crate::asn1::{Asn1Object, Asn1OctetString, Asn1Time};
+use crate::bn::{BigNum, MsbOption};
+use crate::hash::MessageDigest;
+use crate::nid::Nid;
+use crate::pkey::{PKey, Private};
+use crate::rsa::Rsa;
+#[cfg(not(boringssl))]
+use crate::ssl::SslFiletype;
+use crate::stack::Stack;
+use crate::x509::extension::{
+    AuthorityKeyIdentifier, BasicConstraints, ExtendedKeyUsage, KeyUsage, SubjectAlternativeName,
+    SubjectKeyIdentifier,
+};
+#[cfg(not(boringssl))]
+use crate::x509::store::X509Lookup;
+use crate::x509::store::X509StoreBuilder;
+#[cfg(any(ossl102, boringssl, libressl261))]
+use crate::x509::verify::{X509VerifyFlags, X509VerifyParam};
+#[cfg(any(ossl102, boringssl))]
+use crate::x509::X509PurposeId;
+#[cfg(any(ossl102, boringssl, libressl261))]
+use crate::x509::X509PurposeRef;
+#[cfg(ossl110)]
+use crate::x509::{CrlReason, X509Builder};
+use crate::x509::{
+    CrlStatus, X509Crl, X509Extension, X509Name, X509Req, X509StoreContext, X509VerifyResult, X509,
+};
+
+#[cfg(ossl110)]
+use foreign_types::ForeignType;
+use hex::{self, FromHex};
+#[cfg(any(ossl102, boringssl, libressl261))]
+use libc::time_t;
+
+use super::{AuthorityInformationAccess, CertificateIssuer, ReasonCode};
+
+fn pkey() -> PKey<Private> {
+    let rsa = Rsa::generate(2048).unwrap();
+    PKey::from_rsa(rsa).unwrap()
+}
+
+#[test]
+fn test_cert_loading() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let fingerprint = cert.digest(MessageDigest::sha1()).unwrap();
+
+    let hash_str = "59172d9313e84459bcff27f967e79e6e9217e584";
+    let hash_vec = Vec::from_hex(hash_str).unwrap();
+
+    assert_eq!(hash_vec, &*fingerprint);
+}
+
+#[test]
+fn test_debug() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let debugged = format!("{:#?}", cert);
+    #[cfg(boringssl)]
+    assert!(debugged.contains(r#"serial_number: "8771f7bdee982fa5""#));
+    #[cfg(not(boringssl))]
+    assert!(debugged.contains(r#"serial_number: "8771F7BDEE982FA5""#));
+    assert!(debugged.contains(r#"signature_algorithm: sha256WithRSAEncryption"#));
+    assert!(debugged.contains(r#"countryName = "AU""#));
+    assert!(debugged.contains(r#"stateOrProvinceName = "Some-State""#));
+    assert!(debugged.contains(r#"not_before: Aug 14 17:00:03 2016 GMT"#));
+    assert!(debugged.contains(r#"not_after: Aug 12 17:00:03 2026 GMT"#));
+}
+
+#[test]
+fn test_cert_issue_validity() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let not_before = cert.not_before().to_string();
+    let not_after = cert.not_after().to_string();
+
+    assert_eq!(not_before, "Aug 14 17:00:03 2016 GMT");
+    assert_eq!(not_after, "Aug 12 17:00:03 2026 GMT");
+}
+
+#[test]
+fn test_save_der() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+
+    let der = cert.to_der().unwrap();
+    assert!(!der.is_empty());
+}
+
+#[test]
+fn test_subject_read_cn() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let subject = cert.subject_name();
+    let cn = subject.entries_by_nid(Nid::COMMONNAME).next().unwrap();
+    assert_eq!(cn.data().as_slice(), b"foobar.com")
+}
+
+#[test]
+fn test_nid_values() {
+    let cert = include_bytes!("../../test/nid_test_cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let subject = cert.subject_name();
+
+    let cn = subject.entries_by_nid(Nid::COMMONNAME).next().unwrap();
+    assert_eq!(cn.data().as_slice(), b"example.com");
+
+    let email = subject
+        .entries_by_nid(Nid::PKCS9_EMAILADDRESS)
+        .next()
+        .unwrap();
+    assert_eq!(email.data().as_slice(), b"test@example.com");
+
+    let friendly = subject.entries_by_nid(Nid::FRIENDLYNAME).next().unwrap();
+    assert_eq!(&**friendly.data().as_utf8().unwrap(), "Example");
+}
+
+#[test]
+fn test_nameref_iterator() {
+    let cert = include_bytes!("../../test/nid_test_cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let subject = cert.subject_name();
+    let mut all_entries = subject.entries();
+
+    let email = all_entries.next().unwrap();
+    assert_eq!(
+        email.object().nid().as_raw(),
+        Nid::PKCS9_EMAILADDRESS.as_raw()
+    );
+    assert_eq!(email.data().as_slice(), b"test@example.com");
+
+    let cn = all_entries.next().unwrap();
+    assert_eq!(cn.object().nid().as_raw(), Nid::COMMONNAME.as_raw());
+    assert_eq!(cn.data().as_slice(), b"example.com");
+
+    let friendly = all_entries.next().unwrap();
+    assert_eq!(friendly.object().nid().as_raw(), Nid::FRIENDLYNAME.as_raw());
+    assert_eq!(&**friendly.data().as_utf8().unwrap(), "Example");
+
+    if all_entries.next().is_some() {
+        panic!();
+    }
+}
+
+#[test]
+fn test_nid_uid_value() {
+    let cert = include_bytes!("../../test/nid_uid_test_cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let subject = cert.subject_name();
+
+    let cn = subject.entries_by_nid(Nid::USERID).next().unwrap();
+    assert_eq!(cn.data().as_slice(), b"this is the userId");
+}
+
+#[test]
+fn test_subject_alt_name() {
+    let cert = include_bytes!("../../test/alt_name_cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+
+    let subject_alt_names = cert.subject_alt_names().unwrap();
+    assert_eq!(5, subject_alt_names.len());
+    assert_eq!(Some("example.com"), subject_alt_names[0].dnsname());
+    assert_eq!(subject_alt_names[1].ipaddress(), Some(&[127, 0, 0, 1][..]));
+    assert_eq!(
+        subject_alt_names[2].ipaddress(),
+        Some(&b"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01"[..])
+    );
+    assert_eq!(Some("test@example.com"), subject_alt_names[3].email());
+    assert_eq!(Some("http://www.example.com"), subject_alt_names[4].uri());
+}
+
+#[test]
+#[cfg(any(ossl110, boringssl))]
+fn test_retrieve_pathlen() {
+    let cert = include_bytes!("../../test/root-ca.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    assert_eq!(cert.pathlen(), None);
+
+    let cert = include_bytes!("../../test/intermediate-ca.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    assert_eq!(cert.pathlen(), Some(0));
+
+    let cert = include_bytes!("../../test/alt_name_cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    assert_eq!(cert.pathlen(), None);
+}
+
+#[test]
+#[cfg(any(ossl110, boringssl))]
+fn test_subject_key_id() {
+    let cert = include_bytes!("../../test/certv3.pem");
+    let cert = X509::from_pem(cert).unwrap();
+
+    let subject_key_id = cert.subject_key_id().unwrap();
+    assert_eq!(
+        subject_key_id.as_slice(),
+        &b"\xB6\x73\x2F\x61\xA5\x4B\xA1\xEF\x48\x2C\x15\xB1\x9F\xF3\xDC\x34\x2F\xBC\xAC\x30"[..]
+    );
+}
+
+#[test]
+#[cfg(any(ossl110, boringssl))]
+fn test_authority_key_id() {
+    let cert = include_bytes!("../../test/certv3.pem");
+    let cert = X509::from_pem(cert).unwrap();
+
+    let authority_key_id = cert.authority_key_id().unwrap();
+    assert_eq!(
+        authority_key_id.as_slice(),
+        &b"\x6C\xD3\xA5\x03\xAB\x0D\x5F\x2C\xC9\x8D\x8A\x9C\x88\xA7\x88\x77\xB8\x37\xFD\x9A"[..]
+    );
+}
+
+#[test]
+#[cfg(ossl111d)]
+fn test_authority_issuer_and_serial() {
+    let cert = include_bytes!("../../test/authority_key_identifier.pem");
+    let cert = X509::from_pem(cert).unwrap();
+
+    let authority_issuer = cert.authority_issuer().unwrap();
+    assert_eq!(1, authority_issuer.len());
+    let dn = authority_issuer[0].directory_name().unwrap();
+    let mut o = dn.entries_by_nid(Nid::ORGANIZATIONNAME);
+    let o = o.next().unwrap().data().as_utf8().unwrap();
+    assert_eq!(o.as_bytes(), b"PyCA");
+    let mut cn = dn.entries_by_nid(Nid::COMMONNAME);
+    let cn = cn.next().unwrap().data().as_utf8().unwrap();
+    assert_eq!(cn.as_bytes(), b"cryptography.io");
+
+    let authority_serial = cert.authority_serial().unwrap();
+    let serial = authority_serial.to_bn().unwrap();
+    let expected = BigNum::from_u32(3).unwrap();
+    assert_eq!(serial, expected);
+}
+
+#[test]
+fn test_subject_alt_name_iter() {
+    let cert = include_bytes!("../../test/alt_name_cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+
+    let subject_alt_names = cert.subject_alt_names().unwrap();
+    let mut subject_alt_names_iter = subject_alt_names.iter();
+    assert_eq!(
+        subject_alt_names_iter.next().unwrap().dnsname(),
+        Some("example.com")
+    );
+    assert_eq!(
+        subject_alt_names_iter.next().unwrap().ipaddress(),
+        Some(&[127, 0, 0, 1][..])
+    );
+    assert_eq!(
+        subject_alt_names_iter.next().unwrap().ipaddress(),
+        Some(&b"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01"[..])
+    );
+    assert_eq!(
+        subject_alt_names_iter.next().unwrap().email(),
+        Some("test@example.com")
+    );
+    assert_eq!(
+        subject_alt_names_iter.next().unwrap().uri(),
+        Some("http://www.example.com")
+    );
+    assert!(subject_alt_names_iter.next().is_none());
+}
+
+#[test]
+fn test_aia_ca_issuer() {
+    // With AIA
+    let cert = include_bytes!("../../test/aia_test_cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let authority_info = cert.authority_info().unwrap();
+    assert_eq!(authority_info.len(), 1);
+    assert_eq!(authority_info[0].method().to_string(), "CA Issuers");
+    assert_eq!(
+        authority_info[0].location().uri(),
+        Some("http://www.example.com/cert.pem")
+    );
+    // Without AIA
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    assert!(cert.authority_info().is_none());
+}
+
+#[test]
+fn x509_builder() {
+    let pkey = pkey();
+
+    let mut name = X509Name::builder().unwrap();
+    name.append_entry_by_nid(Nid::COMMONNAME, "foobar.com")
+        .unwrap();
+    let name = name.build();
+
+    let mut builder = X509::builder().unwrap();
+    builder.set_version(2).unwrap();
+    builder.set_subject_name(&name).unwrap();
+    builder.set_issuer_name(&name).unwrap();
+    builder
+        .set_not_before(&Asn1Time::days_from_now(0).unwrap())
+        .unwrap();
+    builder
+        .set_not_after(&Asn1Time::days_from_now(365).unwrap())
+        .unwrap();
+    builder.set_pubkey(&pkey).unwrap();
+
+    let mut serial = BigNum::new().unwrap();
+    serial.rand(128, MsbOption::MAYBE_ZERO, false).unwrap();
+    builder
+        .set_serial_number(&serial.to_asn1_integer().unwrap())
+        .unwrap();
+
+    let basic_constraints = BasicConstraints::new().critical().ca().build().unwrap();
+    builder.append_extension(basic_constraints).unwrap();
+    let key_usage = KeyUsage::new()
+        .digital_signature()
+        .key_encipherment()
+        .build()
+        .unwrap();
+    builder.append_extension(key_usage).unwrap();
+    let ext_key_usage = ExtendedKeyUsage::new()
+        .client_auth()
+        .server_auth()
+        .other("2.999.1")
+        .build()
+        .unwrap();
+    builder.append_extension(ext_key_usage).unwrap();
+    let subject_key_identifier = SubjectKeyIdentifier::new()
+        .build(&builder.x509v3_context(None, None))
+        .unwrap();
+    builder.append_extension(subject_key_identifier).unwrap();
+    let authority_key_identifier = AuthorityKeyIdentifier::new()
+        .keyid(true)
+        .build(&builder.x509v3_context(None, None))
+        .unwrap();
+    builder.append_extension(authority_key_identifier).unwrap();
+    let subject_alternative_name = SubjectAlternativeName::new()
+        .dns("example.com")
+        .build(&builder.x509v3_context(None, None))
+        .unwrap();
+    builder.append_extension(subject_alternative_name).unwrap();
+
+    builder.sign(&pkey, MessageDigest::sha256()).unwrap();
+
+    let x509 = builder.build();
+
+    assert!(pkey.public_eq(&x509.public_key().unwrap()));
+    assert!(x509.verify(&pkey).unwrap());
+
+    let cn = x509
+        .subject_name()
+        .entries_by_nid(Nid::COMMONNAME)
+        .next()
+        .unwrap();
+    assert_eq!(cn.data().as_slice(), b"foobar.com");
+    assert_eq!(serial, x509.serial_number().to_bn().unwrap());
+}
+
+#[test]
+// This tests `X509Extension::new`, even though its deprecated.
+#[allow(deprecated)]
+fn x509_extension_new() {
+    assert!(X509Extension::new(None, None, "crlDistributionPoints", "section").is_err());
+    assert!(X509Extension::new(None, None, "proxyCertInfo", "").is_err());
+    assert!(X509Extension::new(None, None, "certificatePolicies", "").is_err());
+    assert!(X509Extension::new(None, None, "subjectAltName", "dirName:section").is_err());
+}
+
+#[test]
+fn x509_extension_new_from_der() {
+    let ext = X509Extension::new_from_der(
+        &Asn1Object::from_str("2.5.29.19").unwrap(),
+        true,
+        &Asn1OctetString::new_from_bytes(b"\x30\x03\x01\x01\xff").unwrap(),
+    )
+    .unwrap();
+    assert_eq!(
+        ext.to_der().unwrap(),
+        b"0\x0f\x06\x03U\x1d\x13\x01\x01\xff\x04\x050\x03\x01\x01\xff"
+    );
+}
+
+#[test]
+fn x509_extension_to_der() {
+    let builder = X509::builder().unwrap();
+
+    for (ext, expected) in [
+        (
+            BasicConstraints::new().critical().ca().build().unwrap(),
+            b"0\x0f\x06\x03U\x1d\x13\x01\x01\xff\x04\x050\x03\x01\x01\xff" as &[u8],
+        ),
+        (
+            SubjectAlternativeName::new()
+                .dns("example.com,DNS:example2.com")
+                .build(&builder.x509v3_context(None, None))
+                .unwrap(),
+            b"0'\x06\x03U\x1d\x11\x04 0\x1e\x82\x1cexample.com,DNS:example2.com",
+        ),
+        (
+            SubjectAlternativeName::new()
+                .rid("1.2.3.4")
+                .uri("https://example.com")
+                .build(&builder.x509v3_context(None, None))
+                .unwrap(),
+            b"0#\x06\x03U\x1d\x11\x04\x1c0\x1a\x88\x03*\x03\x04\x86\x13https://example.com",
+        ),
+        (
+            ExtendedKeyUsage::new()
+                .server_auth()
+                .other("2.999.1")
+                .other("clientAuth")
+                .build()
+                .unwrap(),
+            b"0\x22\x06\x03U\x1d%\x04\x1b0\x19\x06\x08+\x06\x01\x05\x05\x07\x03\x01\x06\x03\x887\x01\x06\x08+\x06\x01\x05\x05\x07\x03\x02",
+        ),
+    ] {
+        assert_eq!(&ext.to_der().unwrap(), expected);
+    }
+}
+
+#[test]
+fn eku_invalid_other() {
+    assert!(ExtendedKeyUsage::new()
+        .other("1.1.1.1.1,2.2.2.2.2")
+        .build()
+        .is_err());
+}
+
+#[test]
+fn x509_req_builder() {
+    let pkey = pkey();
+
+    let mut name = X509Name::builder().unwrap();
+    name.append_entry_by_nid(Nid::COMMONNAME, "foobar.com")
+        .unwrap();
+    let name = name.build();
+
+    let mut builder = X509Req::builder().unwrap();
+    builder.set_version(0).unwrap();
+    builder.set_subject_name(&name).unwrap();
+    builder.set_pubkey(&pkey).unwrap();
+
+    let mut extensions = Stack::new().unwrap();
+    let key_usage = KeyUsage::new()
+        .digital_signature()
+        .key_encipherment()
+        .build()
+        .unwrap();
+    extensions.push(key_usage).unwrap();
+    let subject_alternative_name = SubjectAlternativeName::new()
+        .dns("example.com")
+        .build(&builder.x509v3_context(None))
+        .unwrap();
+    extensions.push(subject_alternative_name).unwrap();
+    builder.add_extensions(&extensions).unwrap();
+
+    builder.sign(&pkey, MessageDigest::sha256()).unwrap();
+
+    let req = builder.build();
+    assert!(req.public_key().unwrap().public_eq(&pkey));
+    assert_eq!(req.extensions().unwrap().len(), extensions.len());
+    assert!(req.verify(&pkey).unwrap());
+}
+
+#[test]
+fn test_stack_from_pem() {
+    let certs = include_bytes!("../../test/certs.pem");
+    let certs = X509::stack_from_pem(certs).unwrap();
+
+    assert_eq!(certs.len(), 2);
+    assert_eq!(
+        hex::encode(certs[0].digest(MessageDigest::sha1()).unwrap()),
+        "59172d9313e84459bcff27f967e79e6e9217e584"
+    );
+    assert_eq!(
+        hex::encode(certs[1].digest(MessageDigest::sha1()).unwrap()),
+        "c0cbdf7cdd03c9773e5468e1f6d2da7d5cbb1875"
+    );
+}
+
+#[test]
+fn issued() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let ca = include_bytes!("../../test/root-ca.pem");
+    let ca = X509::from_pem(ca).unwrap();
+
+    assert_eq!(ca.issued(&cert), X509VerifyResult::OK);
+    assert_ne!(cert.issued(&cert), X509VerifyResult::OK);
+}
+
+#[test]
+fn signature() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let signature = cert.signature();
+    assert_eq!(
+        hex::encode(signature.as_slice()),
+        "4af607b889790b43470442cfa551cdb8b6d0b0340d2958f76b9e3ef6ad4992230cead6842587f0ecad5\
+         78e6e11a221521e940187e3d6652de14e84e82f6671f097cc47932e022add3c0cb54a26bf27fa84c107\
+         4971caa6bee2e42d34a5b066c427f2d452038082b8073993399548088429de034fdd589dcfb0dd33be7\
+         ebdfdf698a28d628a89568881d658151276bde333600969502c4e62e1d3470a683364dfb241f78d310a\
+         89c119297df093eb36b7fd7540224f488806780305d1e79ffc938fe2275441726522ab36d88348e6c51\
+         f13dcc46b5e1cdac23c974fd5ef86aa41e91c9311655090a52333bc79687c748d833595d4c5f987508f\
+         e121997410d37c"
+    );
+    let algorithm = cert.signature_algorithm();
+    assert_eq!(algorithm.object().nid(), Nid::SHA256WITHRSAENCRYPTION);
+    assert_eq!(algorithm.object().to_string(), "sha256WithRSAEncryption");
+}
+
+#[test]
+#[allow(clippy::redundant_clone)]
+fn clone_x509() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    drop(cert.clone());
+}
+
+#[test]
+fn test_verify_cert() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let ca = include_bytes!("../../test/root-ca.pem");
+    let ca = X509::from_pem(ca).unwrap();
+    let chain = Stack::new().unwrap();
+
+    let mut store_bldr = X509StoreBuilder::new().unwrap();
+    store_bldr.add_cert(ca).unwrap();
+    let store = store_bldr.build();
+
+    let mut context = X509StoreContext::new().unwrap();
+    assert!(context
+        .init(&store, &cert, &chain, |c| c.verify_cert())
+        .unwrap());
+    assert!(context
+        .init(&store, &cert, &chain, |c| c.verify_cert())
+        .unwrap());
+}
+
+#[test]
+fn test_verify_fails() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let ca = include_bytes!("../../test/alt_name_cert.pem");
+    let ca = X509::from_pem(ca).unwrap();
+    let chain = Stack::new().unwrap();
+
+    let mut store_bldr = X509StoreBuilder::new().unwrap();
+    store_bldr.add_cert(ca).unwrap();
+    let store = store_bldr.build();
+
+    let mut context = X509StoreContext::new().unwrap();
+    assert!(!context
+        .init(&store, &cert, &chain, |c| c.verify_cert())
+        .unwrap());
+}
+
+#[test]
+#[cfg(any(ossl102, boringssl, libressl261))]
+fn test_verify_fails_with_crl_flag_set_and_no_crl() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let ca = include_bytes!("../../test/root-ca.pem");
+    let ca = X509::from_pem(ca).unwrap();
+    let chain = Stack::new().unwrap();
+
+    let mut store_bldr = X509StoreBuilder::new().unwrap();
+    store_bldr.add_cert(ca).unwrap();
+    store_bldr.set_flags(X509VerifyFlags::CRL_CHECK).unwrap();
+    let store = store_bldr.build();
+
+    let mut context = X509StoreContext::new().unwrap();
+    assert_eq!(
+        context
+            .init(&store, &cert, &chain, |c| {
+                c.verify_cert()?;
+                Ok(c.error())
+            })
+            .unwrap()
+            .error_string(),
+        "unable to get certificate CRL"
+    )
+}
+
+#[test]
+#[cfg(any(ossl102, boringssl, libressl261))]
+fn test_verify_cert_with_purpose() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let ca = include_bytes!("../../test/root-ca.pem");
+    let ca = X509::from_pem(ca).unwrap();
+    let chain = Stack::new().unwrap();
+
+    let mut store_bldr = X509StoreBuilder::new().unwrap();
+    let purpose_idx = X509PurposeRef::get_by_sname("sslserver")
+        .expect("Getting certificate purpose 'sslserver' failed");
+    let x509_purposeref =
+        X509PurposeRef::from_idx(purpose_idx).expect("Getting certificate purpose failed");
+    store_bldr
+        .set_purpose(x509_purposeref.purpose())
+        .expect("Setting certificate purpose failed");
+    store_bldr.add_cert(ca).unwrap();
+
+    let store = store_bldr.build();
+
+    let mut context = X509StoreContext::new().unwrap();
+    assert!(context
+        .init(&store, &cert, &chain, |c| c.verify_cert())
+        .unwrap());
+}
+
+#[test]
+#[cfg(any(ossl102, boringssl, libressl261))]
+fn test_verify_cert_with_wrong_purpose_fails() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let ca = include_bytes!("../../test/root-ca.pem");
+    let ca = X509::from_pem(ca).unwrap();
+    let chain = Stack::new().unwrap();
+
+    let mut store_bldr = X509StoreBuilder::new().unwrap();
+    let purpose_idx = X509PurposeRef::get_by_sname("timestampsign")
+        .expect("Getting certificate purpose 'timestampsign' failed");
+    let x509_purpose =
+        X509PurposeRef::from_idx(purpose_idx).expect("Getting certificate purpose failed");
+    store_bldr
+        .set_purpose(x509_purpose.purpose())
+        .expect("Setting certificate purpose failed");
+    store_bldr.add_cert(ca).unwrap();
+
+    let store = store_bldr.build();
+
+    let expected_error = ffi::X509_V_ERR_INVALID_PURPOSE;
+    let mut context = X509StoreContext::new().unwrap();
+    assert_eq!(
+        context
+            .init(&store, &cert, &chain, |c| {
+                c.verify_cert()?;
+                Ok(c.error())
+            })
+            .unwrap()
+            .as_raw(),
+        expected_error
+    )
+}
+
+#[cfg(ossl110)]
+#[test]
+fn x509_ref_version() {
+    let mut builder = X509Builder::new().unwrap();
+    let expected_version = 2;
+    builder
+        .set_version(expected_version)
+        .expect("Failed to set certificate version");
+    let cert = builder.build();
+    let actual_version = cert.version();
+    assert_eq!(
+        expected_version, actual_version,
+        "Obtained certificate version is incorrect",
+    );
+}
+
+#[cfg(ossl110)]
+#[test]
+fn x509_ref_version_no_version_set() {
+    let cert = X509Builder::new().unwrap().build();
+    let actual_version = cert.version();
+    assert_eq!(
+        0, actual_version,
+        "Default certificate version is incorrect",
+    );
+}
+
+#[test]
+fn test_load_crl() {
+    let ca = include_bytes!("../../test/crl-ca.crt");
+    let ca = X509::from_pem(ca).unwrap();
+
+    let crl = include_bytes!("../../test/test.crl");
+    let crl = X509Crl::from_der(crl).unwrap();
+    assert!(crl.verify(&ca.public_key().unwrap()).unwrap());
+
+    let cert = include_bytes!("../../test/subca.crt");
+    let cert = X509::from_pem(cert).unwrap();
+
+    let revoked = match crl.get_by_cert(&cert) {
+        CrlStatus::Revoked(revoked) => revoked,
+        _ => panic!("cert should be revoked"),
+    };
+
+    assert_eq!(
+        revoked.serial_number().to_bn().unwrap(),
+        cert.serial_number().to_bn().unwrap(),
+        "revoked and cert serial numbers should match"
+    );
+}
+
+#[test]
+fn test_crl_entry_extensions() {
+    let crl = include_bytes!("../../test/entry_extensions.crl");
+    let crl = X509Crl::from_pem(crl).unwrap();
+
+    let (critical, access_info) = crl
+        .extension::<AuthorityInformationAccess>()
+        .unwrap()
+        .expect("Authority Information Access extension should be present");
+    assert!(
+        !critical,
+        "Authority Information Access extension is not critical"
+    );
+    assert_eq!(
+        access_info.len(),
+        1,
+        "Authority Information Access should have one entry"
+    );
+    assert_eq!(access_info[0].method().to_string(), "CA Issuers");
+    assert_eq!(
+        access_info[0].location().uri(),
+        Some("http://www.example.com/ca.crt")
+    );
+    let revoked_certs = crl.get_revoked().unwrap();
+    let entry = &revoked_certs[0];
+
+    let (critical, issuer) = entry
+        .extension::<CertificateIssuer>()
+        .unwrap()
+        .expect("Certificate issuer extension should be present");
+    assert!(critical, "Certificate issuer extension is critical");
+    assert_eq!(issuer.len(), 1, "Certificate issuer should have one entry");
+    let issuer = issuer[0]
+        .directory_name()
+        .expect("Issuer should be a directory name");
+    assert_eq!(
+        format!("{:?}", issuer),
+        r#"[countryName = "GB", commonName = "Test CA"]"#
+    );
+
+    // reason_code can't be inspected without ossl110
+    #[allow(unused_variables)]
+    let (critical, reason_code) = entry
+        .extension::<ReasonCode>()
+        .unwrap()
+        .expect("Reason code extension should be present");
+    assert!(!critical, "Reason code extension is not critical");
+    #[cfg(ossl110)]
+    assert_eq!(
+        CrlReason::KEY_COMPROMISE,
+        CrlReason::from_raw(reason_code.get_i64().unwrap() as ffi::c_int)
+    );
+}
+
+#[test]
+fn test_save_subject_der() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+
+    let der = cert.subject_name().to_der().unwrap();
+    println!("der: {:?}", der);
+    assert!(!der.is_empty());
+}
+
+#[test]
+fn test_load_subject_der() {
+    // The subject from ../../test/cert.pem
+    const SUBJECT_DER: &[u8] = &[
+        48, 90, 49, 11, 48, 9, 6, 3, 85, 4, 6, 19, 2, 65, 85, 49, 19, 48, 17, 6, 3, 85, 4, 8, 12,
+        10, 83, 111, 109, 101, 45, 83, 116, 97, 116, 101, 49, 33, 48, 31, 6, 3, 85, 4, 10, 12, 24,
+        73, 110, 116, 101, 114, 110, 101, 116, 32, 87, 105, 100, 103, 105, 116, 115, 32, 80, 116,
+        121, 32, 76, 116, 100, 49, 19, 48, 17, 6, 3, 85, 4, 3, 12, 10, 102, 111, 111, 98, 97, 114,
+        46, 99, 111, 109,
+    ];
+    X509Name::from_der(SUBJECT_DER).unwrap();
+}
+
+#[test]
+fn test_convert_to_text() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+
+    const SUBSTRINGS: &[&str] = &[
+        "Certificate:\n",
+        "Serial Number:",
+        "Signature Algorithm:",
+        "Issuer: C=AU, ST=Some-State, O=Internet Widgits Pty Ltd\n",
+        "Subject: C=AU, ST=Some-State, O=Internet Widgits Pty Ltd, CN=foobar.com\n",
+        "Subject Public Key Info:",
+    ];
+
+    let text = String::from_utf8(cert.to_text().unwrap()).unwrap();
+
+    for substring in SUBSTRINGS {
+        assert!(
+            text.contains(substring),
+            "{:?} not found inside {}",
+            substring,
+            text
+        );
+    }
+}
+
+#[test]
+fn test_convert_req_to_text() {
+    let csr = include_bytes!("../../test/csr.pem");
+    let csr = X509Req::from_pem(csr).unwrap();
+
+    const SUBSTRINGS: &[&str] = &[
+        "Certificate Request:\n",
+        "Version:",
+        "Subject: C=AU, ST=Some-State, O=Internet Widgits Pty Ltd, CN=foobar.com\n",
+        "Subject Public Key Info:",
+        "Signature Algorithm:",
+    ];
+
+    let text = String::from_utf8(csr.to_text().unwrap()).unwrap();
+
+    for substring in SUBSTRINGS {
+        assert!(
+            text.contains(substring),
+            "{:?} not found inside {}",
+            substring,
+            text
+        );
+    }
+}
+
+#[test]
+fn test_name_cmp() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+
+    let subject = cert.subject_name();
+    let issuer = cert.issuer_name();
+    assert_eq!(Ordering::Equal, subject.try_cmp(subject).unwrap());
+    assert_eq!(Ordering::Greater, subject.try_cmp(issuer).unwrap());
+}
+
+#[test]
+#[cfg(any(boringssl, ossl110, libressl270))]
+fn test_name_to_owned() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let name = cert.subject_name();
+    let copied_name = name.to_owned().unwrap();
+    assert_eq!(Ordering::Equal, name.try_cmp(&copied_name).unwrap());
+}
+
+#[test]
+#[cfg(any(ossl102, boringssl, libressl261))]
+fn test_verify_param_set_time_fails_verification() {
+    const TEST_T_2030: time_t = 1893456000;
+
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let ca = include_bytes!("../../test/root-ca.pem");
+    let ca = X509::from_pem(ca).unwrap();
+    let chain = Stack::new().unwrap();
+
+    let mut store_bldr = X509StoreBuilder::new().unwrap();
+    store_bldr.add_cert(ca).unwrap();
+    let mut verify_params = X509VerifyParam::new().unwrap();
+    verify_params.set_time(TEST_T_2030);
+    store_bldr.set_param(&verify_params).unwrap();
+    let store = store_bldr.build();
+
+    let mut context = X509StoreContext::new().unwrap();
+    assert_eq!(
+        context
+            .init(&store, &cert, &chain, |c| {
+                c.verify_cert()?;
+                Ok(c.error())
+            })
+            .unwrap()
+            .error_string(),
+        "certificate has expired"
+    )
+}
+
+#[test]
+#[cfg(any(ossl102, boringssl, libressl261))]
+fn test_verify_param_set_time() {
+    const TEST_T_2020: time_t = 1577836800;
+
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let ca = include_bytes!("../../test/root-ca.pem");
+    let ca = X509::from_pem(ca).unwrap();
+    let chain = Stack::new().unwrap();
+
+    let mut store_bldr = X509StoreBuilder::new().unwrap();
+    store_bldr.add_cert(ca).unwrap();
+    let mut verify_params = X509VerifyParam::new().unwrap();
+    verify_params.set_time(TEST_T_2020);
+    store_bldr.set_param(&verify_params).unwrap();
+    let store = store_bldr.build();
+
+    let mut context = X509StoreContext::new().unwrap();
+    assert!(context
+        .init(&store, &cert, &chain, |c| c.verify_cert())
+        .unwrap());
+}
+
+#[test]
+#[cfg(any(ossl102, boringssl, libressl261))]
+fn test_verify_param_set_depth() {
+    let cert = include_bytes!("../../test/leaf.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let intermediate_ca = include_bytes!("../../test/intermediate-ca.pem");
+    let intermediate_ca = X509::from_pem(intermediate_ca).unwrap();
+    let ca = include_bytes!("../../test/root-ca.pem");
+    let ca = X509::from_pem(ca).unwrap();
+    let mut chain = Stack::new().unwrap();
+    chain.push(intermediate_ca).unwrap();
+
+    let mut store_bldr = X509StoreBuilder::new().unwrap();
+    store_bldr.add_cert(ca).unwrap();
+    let mut verify_params = X509VerifyParam::new().unwrap();
+    // OpenSSL 1.1.0+ considers the root certificate to not be part of the chain, while 1.0.2 and LibreSSL do
+    let expected_depth = if cfg!(any(ossl110)) { 1 } else { 2 };
+    verify_params.set_depth(expected_depth);
+    store_bldr.set_param(&verify_params).unwrap();
+    let store = store_bldr.build();
+
+    let mut context = X509StoreContext::new().unwrap();
+    assert!(context
+        .init(&store, &cert, &chain, |c| c.verify_cert())
+        .unwrap());
+}
+
+#[test]
+#[cfg(any(ossl102, boringssl, libressl261))]
+#[allow(clippy::bool_to_int_with_if)]
+fn test_verify_param_set_depth_fails_verification() {
+    let cert = include_bytes!("../../test/leaf.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let intermediate_ca = include_bytes!("../../test/intermediate-ca.pem");
+    let intermediate_ca = X509::from_pem(intermediate_ca).unwrap();
+    let ca = include_bytes!("../../test/root-ca.pem");
+    let ca = X509::from_pem(ca).unwrap();
+    let mut chain = Stack::new().unwrap();
+    chain.push(intermediate_ca).unwrap();
+
+    let mut store_bldr = X509StoreBuilder::new().unwrap();
+    store_bldr.add_cert(ca).unwrap();
+    let mut verify_params = X509VerifyParam::new().unwrap();
+    // OpenSSL 1.1.0+ considers the root certificate to not be part of the chain, while 1.0.2 and LibreSSL do
+    let expected_depth = if cfg!(any(ossl110, boringssl)) { 0 } else { 1 };
+    verify_params.set_depth(expected_depth);
+    store_bldr.set_param(&verify_params).unwrap();
+    let store = store_bldr.build();
+
+    // OpenSSL 1.1.0+ added support for X509_V_ERR_CERT_CHAIN_TOO_LONG, while 1.0.2 simply ignores the intermediate
+    let expected_error = if cfg!(any(ossl110, libressl261)) {
+        "certificate chain too long"
+    } else {
+        "unable to get local issuer certificate"
+    };
+
+    let mut context = X509StoreContext::new().unwrap();
+    assert_eq!(
+        context
+            .init(&store, &cert, &chain, |c| {
+                c.verify_cert()?;
+                Ok(c.error())
+            })
+            .unwrap()
+            .error_string(),
+        expected_error
+    )
+}
+
+#[test]
+#[cfg(not(boringssl))]
+fn test_load_cert_file() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let chain = Stack::new().unwrap();
+
+    let mut store_bldr = X509StoreBuilder::new().unwrap();
+    let lookup = store_bldr.add_lookup(X509Lookup::file()).unwrap();
+    lookup
+        .load_cert_file("test/root-ca.pem", SslFiletype::PEM)
+        .unwrap();
+    let store = store_bldr.build();
+
+    let mut context = X509StoreContext::new().unwrap();
+    assert!(context
+        .init(&store, &cert, &chain, |c| c.verify_cert())
+        .unwrap());
+}
+
+#[test]
+#[cfg(ossl110)]
+fn test_verify_param_auth_level() {
+    let mut param = X509VerifyParam::new().unwrap();
+    let auth_lvl = 2;
+    let auth_lvl_default = -1;
+
+    assert_eq!(param.auth_level(), auth_lvl_default);
+
+    param.set_auth_level(auth_lvl);
+    assert_eq!(param.auth_level(), auth_lvl);
+}
+
+#[test]
+#[cfg(any(ossl102, boringssl))]
+fn test_set_purpose() {
+    let cert = include_bytes!("../../test/leaf.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let intermediate_ca = include_bytes!("../../test/intermediate-ca.pem");
+    let intermediate_ca = X509::from_pem(intermediate_ca).unwrap();
+    let ca = include_bytes!("../../test/root-ca.pem");
+    let ca = X509::from_pem(ca).unwrap();
+    let mut chain = Stack::new().unwrap();
+    chain.push(intermediate_ca).unwrap();
+
+    let mut store_bldr = X509StoreBuilder::new().unwrap();
+    store_bldr.add_cert(ca).unwrap();
+    let mut verify_params = X509VerifyParam::new().unwrap();
+    verify_params.set_purpose(X509PurposeId::ANY).unwrap();
+    store_bldr.set_param(&verify_params).unwrap();
+    let store = store_bldr.build();
+    let mut context = X509StoreContext::new().unwrap();
+
+    assert!(context
+        .init(&store, &cert, &chain, |c| c.verify_cert())
+        .unwrap());
+}
+
+#[test]
+#[cfg(any(ossl102, boringssl))]
+fn test_set_purpose_fails_verification() {
+    let cert = include_bytes!("../../test/leaf.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let intermediate_ca = include_bytes!("../../test/intermediate-ca.pem");
+    let intermediate_ca = X509::from_pem(intermediate_ca).unwrap();
+    let ca = include_bytes!("../../test/root-ca.pem");
+    let ca = X509::from_pem(ca).unwrap();
+    let mut chain = Stack::new().unwrap();
+    chain.push(intermediate_ca).unwrap();
+
+    let mut store_bldr = X509StoreBuilder::new().unwrap();
+    store_bldr.add_cert(ca).unwrap();
+    let mut verify_params = X509VerifyParam::new().unwrap();
+    verify_params
+        .set_purpose(X509PurposeId::TIMESTAMP_SIGN)
+        .unwrap();
+    store_bldr.set_param(&verify_params).unwrap();
+    let store = store_bldr.build();
+
+    let expected_error = ffi::X509_V_ERR_INVALID_PURPOSE;
+    let mut context = X509StoreContext::new().unwrap();
+    assert_eq!(
+        context
+            .init(&store, &cert, &chain, |c| {
+                c.verify_cert()?;
+                Ok(c.error())
+            })
+            .unwrap()
+            .as_raw(),
+        expected_error
+    )
+}
+
+#[test]
+#[cfg(any(ossl101, libressl350))]
+fn test_add_name_entry() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    let inp_name = cert.subject_name().entries().next().unwrap();
+
+    let mut names = X509Name::builder().unwrap();
+    names.append_entry(inp_name).unwrap();
+    let names = names.build();
+
+    let mut entries = names.entries();
+    let outp_name = entries.next().unwrap();
+    assert_eq!(outp_name.object().nid(), inp_name.object().nid());
+    assert_eq!(outp_name.data().as_slice(), inp_name.data().as_slice());
+    assert!(entries.next().is_none());
+}
+
+#[test]
+#[cfg(not(boringssl))]
+fn test_load_crl_file_fail() {
+    let mut store_bldr = X509StoreBuilder::new().unwrap();
+    let lookup = store_bldr.add_lookup(X509Lookup::file()).unwrap();
+    let res = lookup.load_crl_file("test/root-ca.pem", SslFiletype::PEM);
+    assert!(res.is_err());
+}
+
+#[cfg(ossl110)]
+fn ipaddress_as_subject_alternative_name_is_formatted_in_debug<T>(expected_ip: T)
+where
+    T: Into<std::net::IpAddr>,
+{
+    let expected_ip = format!("{:?}", expected_ip.into());
+    let mut builder = X509Builder::new().unwrap();
+    let san = SubjectAlternativeName::new()
+        .ip(&expected_ip)
+        .build(&builder.x509v3_context(None, None))
+        .unwrap();
+    builder.append_extension(san).unwrap();
+    let cert = builder.build();
+    let actual_ip = cert
+        .subject_alt_names()
+        .into_iter()
+        .flatten()
+        .map(|n| format!("{:?}", *n))
+        .next()
+        .unwrap();
+    assert_eq!(actual_ip, expected_ip);
+}
+
+#[cfg(ossl110)]
+#[test]
+fn ipv4_as_subject_alternative_name_is_formatted_in_debug() {
+    ipaddress_as_subject_alternative_name_is_formatted_in_debug([8u8, 8, 8, 128]);
+}
+
+#[cfg(ossl110)]
+#[test]
+fn ipv6_as_subject_alternative_name_is_formatted_in_debug() {
+    ipaddress_as_subject_alternative_name_is_formatted_in_debug([
+        8u8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 128,
+    ]);
+}
+
+#[cfg(ossl110)]
+#[test]
+fn other_name_as_subject_alternative_name() {
+    let oid = Asn1Object::from_str("1.3.6.1.5.5.7.8.11").unwrap();
+    // this is the hex representation of "test" encoded as a ia5string
+    let content = [0x16, 0x04, 0x74, 0x65, 0x73, 0x74];
+
+    let mut builder = X509Builder::new().unwrap();
+    let san = SubjectAlternativeName::new()
+        .other_name2(oid, &content)
+        .build(&builder.x509v3_context(None, None))
+        .unwrap();
+    builder.append_extension(san).unwrap();
+    let cert = builder.build();
+    let general_name = cert
+        .subject_alt_names()
+        .into_iter()
+        .flatten()
+        .next()
+        .unwrap();
+    unsafe {
+        assert_eq!((*general_name.as_ptr()).type_, 0);
+    }
+}
+
+#[test]
+fn test_dist_point() {
+    let cert = include_bytes!("../../test/certv3.pem");
+    let cert = X509::from_pem(cert).unwrap();
+
+    let dps = cert.crl_distribution_points().unwrap();
+    let dp = dps.get(0).unwrap();
+    let dp_nm = dp.distpoint().unwrap();
+    let dp_gns = dp_nm.fullname().unwrap();
+    let dp_gn = dp_gns.get(0).unwrap();
+    assert_eq!(dp_gn.uri().unwrap(), "http://example.com/crl.pem");
+
+    let dp = dps.get(1).unwrap();
+    let dp_nm = dp.distpoint().unwrap();
+    let dp_gns = dp_nm.fullname().unwrap();
+    let dp_gn = dp_gns.get(0).unwrap();
+    assert_eq!(dp_gn.uri().unwrap(), "http://example.com/crl2.pem");
+    assert!(dps.get(2).is_none())
+}
+
+#[test]
+fn test_dist_point_null() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+    assert!(cert.crl_distribution_points().is_none());
+}
+
+#[test]
+#[cfg(ossl300)]
+fn test_store_all_certificates() {
+    let cert = include_bytes!("../../test/cert.pem");
+    let cert = X509::from_pem(cert).unwrap();
+
+    let store = {
+        let mut b = X509StoreBuilder::new().unwrap();
+        b.add_cert(cert).unwrap();
+        b.build()
+    };
+
+    assert_eq!(store.all_certificates().len(), 1);
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/src/x509/verify.rs 43.0.0-1ubuntu1/rust-vendor/openssl/src/x509/verify.rs
--- 43.0.0-1/rust-vendor/openssl/src/x509/verify.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/src/x509/verify.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,215 @@
+use bitflags::bitflags;
+use foreign_types::ForeignTypeRef;
+use libc::{c_int, c_uint, c_ulong, time_t};
+use std::net::IpAddr;
+
+use crate::error::ErrorStack;
+#[cfg(any(ossl102, boringssl))]
+use crate::x509::X509PurposeId;
+use crate::{cvt, cvt_p};
+use openssl_macros::corresponds;
+
+bitflags! {
+    /// Flags used to check an `X509` certificate.
+    #[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+    #[repr(transparent)]
+    pub struct X509CheckFlags: c_uint {
+        const ALWAYS_CHECK_SUBJECT = ffi::X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT as _;
+        const NO_WILDCARDS = ffi::X509_CHECK_FLAG_NO_WILDCARDS as _;
+        const NO_PARTIAL_WILDCARDS = ffi::X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS as _;
+        const MULTI_LABEL_WILDCARDS = ffi::X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS as _;
+        const SINGLE_LABEL_SUBDOMAINS = ffi::X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS as _;
+        /// Requires OpenSSL 1.1.0 or newer.
+        #[cfg(any(ossl110))]
+        const NEVER_CHECK_SUBJECT = ffi::X509_CHECK_FLAG_NEVER_CHECK_SUBJECT;
+
+        #[deprecated(since = "0.10.6", note = "renamed to NO_WILDCARDS")]
+        const FLAG_NO_WILDCARDS = ffi::X509_CHECK_FLAG_NO_WILDCARDS as _;
+    }
+}
+
+bitflags! {
+    /// Flags used to verify an `X509` certificate chain.
+    #[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+    #[repr(transparent)]
+    pub struct X509VerifyFlags: c_ulong {
+        const CB_ISSUER_CHECK = ffi::X509_V_FLAG_CB_ISSUER_CHECK as _;
+        const USE_CHECK_TIME = ffi::X509_V_FLAG_USE_CHECK_TIME as _;
+        const CRL_CHECK = ffi::X509_V_FLAG_CRL_CHECK as _;
+        const CRL_CHECK_ALL = ffi::X509_V_FLAG_CRL_CHECK_ALL as _;
+        const IGNORE_CRITICAL = ffi::X509_V_FLAG_IGNORE_CRITICAL as _;
+        const X509_STRICT = ffi::X509_V_FLAG_X509_STRICT as _;
+        const ALLOW_PROXY_CERTS = ffi::X509_V_FLAG_ALLOW_PROXY_CERTS as _;
+        const POLICY_CHECK = ffi::X509_V_FLAG_POLICY_CHECK as _;
+        const EXPLICIT_POLICY = ffi::X509_V_FLAG_EXPLICIT_POLICY as _;
+        const INHIBIT_ANY = ffi::X509_V_FLAG_INHIBIT_ANY as _;
+        const INHIBIT_MAP = ffi::X509_V_FLAG_INHIBIT_MAP as _;
+        const NOTIFY_POLICY = ffi::X509_V_FLAG_NOTIFY_POLICY as _;
+        const EXTENDED_CRL_SUPPORT = ffi::X509_V_FLAG_EXTENDED_CRL_SUPPORT as _;
+        const USE_DELTAS = ffi::X509_V_FLAG_USE_DELTAS as _;
+        const CHECK_SS_SIGNATURE = ffi::X509_V_FLAG_CHECK_SS_SIGNATURE as _;
+        #[cfg(any(ossl102, boringssl))]
+        const TRUSTED_FIRST = ffi::X509_V_FLAG_TRUSTED_FIRST as _;
+        #[cfg(ossl102)]
+        const SUITEB_128_LOS_ONLY = ffi::X509_V_FLAG_SUITEB_128_LOS_ONLY;
+        #[cfg(ossl102)]
+        const SUITEB_192_LOS = ffi::X509_V_FLAG_SUITEB_128_LOS;
+        #[cfg(ossl102)]
+        const SUITEB_128_LOS = ffi::X509_V_FLAG_SUITEB_192_LOS;
+        #[cfg(any(ossl102, boringssl))]
+        const PARTIAL_CHAIN = ffi::X509_V_FLAG_PARTIAL_CHAIN as _;
+        #[cfg(any(ossl110, boringssl))]
+        const NO_ALT_CHAINS = ffi::X509_V_FLAG_NO_ALT_CHAINS as _;
+        #[cfg(any(ossl110, boringssl))]
+        const NO_CHECK_TIME = ffi::X509_V_FLAG_NO_CHECK_TIME as _;
+    }
+}
+
+foreign_type_and_impl_send_sync! {
+    type CType = ffi::X509_VERIFY_PARAM;
+    fn drop = ffi::X509_VERIFY_PARAM_free;
+
+    /// Adjust parameters associated with certificate verification.
+    pub struct X509VerifyParam;
+    /// Reference to `X509VerifyParam`.
+    pub struct X509VerifyParamRef;
+}
+
+impl X509VerifyParam {
+    /// Create an X509VerifyParam
+    #[corresponds(X509_VERIFY_PARAM_new)]
+    pub fn new() -> Result<X509VerifyParam, ErrorStack> {
+        unsafe {
+            ffi::init();
+            cvt_p(ffi::X509_VERIFY_PARAM_new()).map(X509VerifyParam)
+        }
+    }
+}
+
+impl X509VerifyParamRef {
+    /// Set the host flags.
+    #[corresponds(X509_VERIFY_PARAM_set_hostflags)]
+    pub fn set_hostflags(&mut self, hostflags: X509CheckFlags) {
+        unsafe {
+            ffi::X509_VERIFY_PARAM_set_hostflags(self.as_ptr(), hostflags.bits());
+        }
+    }
+
+    /// Set verification flags.
+    #[corresponds(X509_VERIFY_PARAM_set_flags)]
+    pub fn set_flags(&mut self, flags: X509VerifyFlags) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::X509_VERIFY_PARAM_set_flags(
+                self.as_ptr(),
+                flags.bits(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Clear verification flags.
+    #[corresponds(X509_VERIFY_PARAM_clear_flags)]
+    pub fn clear_flags(&mut self, flags: X509VerifyFlags) -> Result<(), ErrorStack> {
+        unsafe {
+            cvt(ffi::X509_VERIFY_PARAM_clear_flags(
+                self.as_ptr(),
+                flags.bits(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Gets verification flags.
+    #[corresponds(X509_VERIFY_PARAM_get_flags)]
+    pub fn flags(&mut self) -> X509VerifyFlags {
+        let bits = unsafe { ffi::X509_VERIFY_PARAM_get_flags(self.as_ptr()) };
+        X509VerifyFlags::from_bits_retain(bits)
+    }
+
+    /// Set the expected DNS hostname.
+    #[corresponds(X509_VERIFY_PARAM_set1_host)]
+    pub fn set_host(&mut self, host: &str) -> Result<(), ErrorStack> {
+        unsafe {
+            // len == 0 means "run strlen" :(
+            let raw_host = if host.is_empty() { "\0" } else { host };
+            cvt(ffi::X509_VERIFY_PARAM_set1_host(
+                self.as_ptr(),
+                raw_host.as_ptr() as *const _,
+                host.len(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Set the expected email address.
+    #[corresponds(X509_VERIFY_PARAM_set1_email)]
+    pub fn set_email(&mut self, email: &str) -> Result<(), ErrorStack> {
+        unsafe {
+            // len == 0 means "run strlen" :(
+            let raw_email = if email.is_empty() { "\0" } else { email };
+            cvt(ffi::X509_VERIFY_PARAM_set1_email(
+                self.as_ptr(),
+                raw_email.as_ptr() as *const _,
+                email.len(),
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Set the expected IPv4 or IPv6 address.
+    #[corresponds(X509_VERIFY_PARAM_set1_ip)]
+    pub fn set_ip(&mut self, ip: IpAddr) -> Result<(), ErrorStack> {
+        unsafe {
+            let mut buf = [0; 16];
+            let len = match ip {
+                IpAddr::V4(addr) => {
+                    buf[..4].copy_from_slice(&addr.octets());
+                    4
+                }
+                IpAddr::V6(addr) => {
+                    buf.copy_from_slice(&addr.octets());
+                    16
+                }
+            };
+            cvt(ffi::X509_VERIFY_PARAM_set1_ip(
+                self.as_ptr(),
+                buf.as_ptr() as *const _,
+                len,
+            ))
+            .map(|_| ())
+        }
+    }
+
+    /// Set the verification time, where time is of type time_t, traditionaly defined as seconds since the epoch
+    #[corresponds(X509_VERIFY_PARAM_set_time)]
+    pub fn set_time(&mut self, time: time_t) {
+        unsafe { ffi::X509_VERIFY_PARAM_set_time(self.as_ptr(), time) }
+    }
+
+    /// Set the verification depth
+    #[corresponds(X509_VERIFY_PARAM_set_depth)]
+    pub fn set_depth(&mut self, depth: c_int) {
+        unsafe { ffi::X509_VERIFY_PARAM_set_depth(self.as_ptr(), depth) }
+    }
+
+    /// Sets the authentication security level to auth_level
+    #[corresponds(X509_VERIFY_PARAM_set_auth_level)]
+    #[cfg(ossl110)]
+    pub fn set_auth_level(&mut self, lvl: c_int) {
+        unsafe { ffi::X509_VERIFY_PARAM_set_auth_level(self.as_ptr(), lvl) }
+    }
+
+    /// Gets the current authentication security level
+    #[corresponds(X509_VERIFY_PARAM_get_auth_level)]
+    #[cfg(ossl110)]
+    pub fn auth_level(&self) -> i32 {
+        unsafe { ffi::X509_VERIFY_PARAM_get_auth_level(self.as_ptr()) }
+    }
+
+    /// Sets the verification purpose
+    #[corresponds(X509_VERIFY_PARAM_set_purpose)]
+    #[cfg(any(ossl102, boringssl))]
+    pub fn set_purpose(&mut self, purpose: X509PurposeId) -> Result<(), ErrorStack> {
+        unsafe { cvt(ffi::X509_VERIFY_PARAM_set_purpose(self.as_ptr(), purpose.0)).map(|_| ()) }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl/test/aia_test_cert.pem 43.0.0-1ubuntu1/rust-vendor/openssl/test/aia_test_cert.pem
--- 43.0.0-1/rust-vendor/openssl/test/aia_test_cert.pem	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/aia_test_cert.pem	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDozCCAougAwIBAgIJAJayG40CARAjMA0GCSqGSIb3DQEBCwUAMA8xDTALBgNV
+BAMMBHRlc3QwHhcNMjEwMzAyMDA1NzQ3WhcNNDgwNzE4MDA1NzQ3WjBzMQswCQYD
+VQQGEwJYWDELMAkGA1UECAwCWFgxEDAOBgNVBAcMB25vd2hlcmUxEDAOBgNVBAoM
+B3Rlc3RvcmcxEjAQBgNVBAsMCXRlc3Rncm91cDEfMB0GA1UEAwwWbWFjaGluZS0w
+Lm15aG9zdC5teW5ldDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANKA
+3zhwC70hbxFVdC0dYk9BHaNntZ4LPUVwFSG2HBn34oO8zCp4wkH+VIi9vOhWiySK
+Gs3gW4qpjMbF82Gqc3dG2KfqUrOtWY+u54zAzqpgiJf08wmREHPoZmjqfCfgM3FO
+VMEA8g1BQxXEd+y7UEDoXhPIoeFnqzMu9sg4npnL9U5BLaQJiWnXHClnBrvAAKXW
+E8KDNmcavtFvo2xQVC09C6dJG5CrigWcZe4CaUl44rHiPaQd+jOp0HAccl/XLA0/
+QyHvW6ksjco/mb7ia1U9ohaC/3NHmzUA1S3kdq/qgnkPsjmy5v8k5vizowNc5rFO
+XsV86BIv44rh1Jut52ECAwEAAaOBnTCBmjAMBgNVHRMEBTADAQH/MAsGA1UdDwQE
+AwIF4DAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwIQYDVR0RBBowGIIW
+bWFjaGluZS0wLm15aG9zdC5teW5ldDA7BggrBgEFBQcBAQQvMC0wKwYIKwYBBQUH
+MAKGH2h0dHA6Ly93d3cuZXhhbXBsZS5jb20vY2VydC5wZW0wDQYJKoZIhvcNAQEL
+BQADggEBAH+ayx8qGvxzrG57jgXJudq+z783O6E2xGBJn1cT9Jhrg1VnlU+tHcNd
+fFcsp0gdQZCmm3pu3E0m/FsgTpfHUgdCOmZQp45QrxCz2oRdWQM71SSA/x1VfQ9w
+670iZOEY15/ss2nRl0woaYO7tBVadpZfymW5+OhsTKn5gL0pVmW3RciHuAmbIvQO
+bouUwzuZIJMfca7T1MqZYdrKoJrOBj0LaPTutjfQB7O/02vUCPjTTIH20aqsMe5K
+KXCrjiZO2jkxQ49Hz5uwfPx12dSVHNLpsnfOAH+MUToeW+SPx2OPvl/uAHcph2lj
+MLA6Wi64rSUxzkcFLFsGpKcK6QKcHUw=
+-----END CERTIFICATE-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/alt_name_cert.pem 43.0.0-1ubuntu1/rust-vendor/openssl/test/alt_name_cert.pem
--- 43.0.0-1/rust-vendor/openssl/test/alt_name_cert.pem	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/alt_name_cert.pem	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDsDCCApigAwIBAgIBATANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJBVTET
+MBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQ
+dHkgTHRkMB4XDTE4MDExNTExMDcwM1oXDTI4MDExMzExMDcwM1owfDELMAkGA1UE
+BhMCVVMxCzAJBgNVBAgMAk5ZMREwDwYDVQQHDAhOZXcgWW9yazEVMBMGA1UECgwM
+RXhhbXBsZSwgTExDMTYwNAYDVQQDDC1FeGFtcGxlIENvbXBhbnkvZW1haWxBZGRy
+ZXNzPXRlc3RAZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
+AoIBAQCo9CWMRLMXo1CF/iORh9B4NhtJF/8tR9PlG95sNvyWuQQ/8jfev+8zErpl
+xfLkt0pJqcoiZG8g9NU0kU6o5T+/1QgZclCAoZaS0Jqxmoo2Yk/1Qsj16pnMBc10
+uSDk6V9aJSX1vKwONVNSwiHA1MhX+i7Wf7/K0niq+k7hOkhleFkWgZtUq41gXh1V
+fOugka7UktYnk9mrBbAMjmaloZNn2pMMAQxVg4ThiLm3zvuWqvXASWzUZc7IAd1G
+bN4AtDuhs252eqE9E4iTHk7F14wAS1JWqv666hReGHrmZJGx0xQTM9vPD1HN5t2U
+3KTfhO/mTlAUWVyg9tCtOzboKgs1AgMBAAGjdDByMAkGA1UdEwQCMAAwCwYDVR0P
+BAQDAgWgMFgGA1UdEQRRME+CC2V4YW1wbGUuY29thwR/AAABhxAAAAAAAAAAAAAA
+AAAAAAABgRB0ZXN0QGV4YW1wbGUuY29thhZodHRwOi8vd3d3LmV4YW1wbGUuY29t
+MA0GCSqGSIb3DQEBCwUAA4IBAQAx14G99z/MnSbs8h5jSos+dgLvhc2IQB/3CChE
+hPyELc7iyw1iteRs7bS1m2NZx6gv6TZ6VydDrK1dnWSatQ7sskXTO+zfC6qjMwXl
+IV+u7T8EREwciniIA82d8GWs60BGyBL3zp2iUOr5ULG4+c/S6OLdlyJv+fDKv+Xo
+fKv1UGDi5rcvUBikeNkpEPTN9UsE9/A8XJfDyq+4RKuDW19EtzOOeVx4xpHOMnAy
+VVAQVMKJzhoXtLF4k2j409na+f6FIcZSBet+plmzfB+WZNIgUUi/7MQIXOFQRkj4
+zH3SnsPm/IYpJzlH2vHhlqIBdaSoTWpGVWPq7D+H8OS3mmXF
+-----END CERTIFICATE-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/authority_key_identifier.pem 43.0.0-1ubuntu1/rust-vendor/openssl/test/authority_key_identifier.pem
--- 43.0.0-1/rust-vendor/openssl/test/authority_key_identifier.pem	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/authority_key_identifier.pem	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDIjCCAgqgAwIBAgIBAzANBgkqhkiG9w0BAQUFADApMQ0wCwYDVQQKDARQeUNB
+MRgwFgYDVQQDDA9jcnlwdG9ncmFwaHkuaW8wHhcNMTUwNTAzMDk0OTU2WhcNMTYw
+NTAyMDk0OTU2WjApMQ0wCwYDVQQKDARQeUNBMRgwFgYDVQQDDA9jcnlwdG9ncmFw
+aHkuaW8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDCadi1UZioxdnP
+ajqlRZHeKsSxvXXhgrWvlt91P3gV0dBThRFhJsLOhjNLz6PO6KeRbjz9GhTA2hdk
+xtIpXrjvTv9dEJ1/k0xebsHWgFC43aTlgekw0U4cMwMe5NGeeg1tfzbJwldIN+cK
+vabc08ADlkmM6DMnUArkzA2yii0DErRFMSIGrkDr6E9puord3h6Mh8Jfnc3TDAq8
+Qo1DI2XM7oFSWNfecQ9KbIC5wzzT+7Shoyz7QmCk/XhRzt8Xcfc3yAXIwazvLf8b
+YP1auaSG11a5E+w6onj91h8UHKKOXu+rdq5YYPZ+qUYpxA7ZJ/VAGadMulYbXaO8
+Syi39HTpAgMBAAGjVTBTMFEGA1UdIwRKMEiAFDlFPso9Yh3qhkn2WqtAt6RwmPHs
+oS2kKzApMQ0wCwYDVQQKDARQeUNBMRgwFgYDVQQDDA9jcnlwdG9ncmFwaHkuaW+C
+AQMwDQYJKoZIhvcNAQEFBQADggEBAFbZYy6aZJUK/f7nJx2Rs/ht6hMbM32/RoXZ
+JGbYapNVqVu/vymcfc/se3FHS5OVmPsnRlo/FIKDn/r5DGl73Sn/FvDJiLJZFucT
+msyYuHZ+ZRYWzWmN2fcB3cfxj0s3qps6f5OoCOqoINOSe4HRGlw4X9keZSD+3xAt
+vHNwQdlPC7zWbPdrzLT+FqR0e/O81vFJJS6drHJWqPcR3NQVtZw+UF7A/HKwbfeL
+Nu2zj6165hzOi9HUxa2/mPr/eLUUV1sTzXp2+TFjt3rVCjW1XnpMLdwNBHzjpyAB
+dTOX3iw0+BPy3s2jtnCW1PLpc74kvSTaBwhg74sq39EXfIKax00=
+-----END CERTIFICATE-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/ca.crt 43.0.0-1ubuntu1/rust-vendor/openssl/test/ca.crt
--- 43.0.0-1/rust-vendor/openssl/test/ca.crt	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/ca.crt	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,88 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            13:ae:da:d8:f4:18:d7:73:b8:bd:35:c9:ce:8e:b3:fc
+        Signature Algorithm: sha256WithRSAEncryption
+        Issuer: CN=TestCA
+        Validity
+            Not Before: Jun  6 19:11:19 2019 GMT
+            Not After : May 21 19:11:19 2022 GMT
+        Subject: CN=SubCA
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                RSA Public-Key: (2048 bit)
+                Modulus:
+                    00:b0:09:fc:54:e7:6a:9f:0c:bd:ad:5a:8d:ef:94:
+                    4e:11:a6:87:19:4f:bf:a6:e1:62:a5:2d:b7:17:df:
+                    67:53:70:da:fe:7d:99:17:ee:13:47:0b:40:0b:a2:
+                    34:32:a9:d3:bf:20:fc:13:77:a1:d5:26:60:1f:f0:
+                    d4:be:dc:76:7c:1e:6c:b4:4c:01:7c:56:cd:5c:53:
+                    ec:81:b3:81:2a:b2:35:26:06:5a:79:e0:b3:9e:e4:
+                    57:e1:09:de:ad:7f:c8:cd:87:ee:49:93:30:52:58:
+                    b2:bc:0f:c1:b6:10:44:f8:85:d5:5b:0a:9b:28:fe:
+                    f4:f4:4a:16:a6:f7:25:e9:96:47:69:73:5b:33:77:
+                    92:7d:61:8d:2a:3d:d5:04:89:40:bf:6b:d2:fd:5d:
+                    e2:1a:80:a9:8e:c8:92:f6:e5:4c:00:84:f9:6e:2a:
+                    93:a3:23:ee:28:23:81:f4:54:f0:18:2c:ee:32:8e:
+                    38:9c:a0:c8:33:04:b0:fc:4c:43:1a:5c:04:84:9f:
+                    73:c6:08:c7:1d:64:39:fe:72:19:3b:cc:a5:fd:0b:
+                    43:25:0d:2b:a9:88:77:9e:62:e6:ac:c2:9a:60:42:
+                    4f:4a:54:47:bc:a0:29:72:7c:38:52:c9:ea:27:c5:
+                    3d:d0:81:4a:3e:b8:78:79:4b:89:b8:4e:6d:1b:24:
+                    15:bd
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 CRL Distribution Points: 
+
+                Full Name:
+                  URI:http://127.0.0.1:8081/pki/test.crl
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+            X509v3 Subject Key Identifier: 
+                FD:82:45:39:A1:91:41:F2:66:CC:0D:75:D5:0D:40:D5:81:A7:A1:43
+            X509v3 Authority Key Identifier: 
+                keyid:C5:CC:F5:A1:8C:D9:E4:A7:BA:EC:21:F5:D1:84:23:EA:0D:C2:C7:30
+                DirName:/CN=TestCA
+                serial:33:E7:04:87:09:32:87:21:D9:CD:7C:AA:4C:5A:BB:2C:6C:7B:54:28
+
+            X509v3 Key Usage: 
+                Certificate Sign, CRL Sign
+    Signature Algorithm: sha256WithRSAEncryption
+         96:a0:ff:8a:4b:bd:45:96:c9:72:3c:63:e3:48:c4:ab:ef:7e:
+         db:76:3f:d9:02:9e:69:c8:d9:36:55:e1:f5:9b:c9:69:d8:69:
+         02:ac:50:8c:60:94:2c:2e:b9:a8:65:ac:f5:00:b0:8b:96:25:
+         0b:8a:ef:94:21:57:e2:04:c2:c3:86:bf:06:4e:91:5c:e6:bc:
+         1b:03:31:8b:64:ea:c5:79:c3:5c:94:e5:aa:67:7e:74:12:07:
+         14:fd:cd:32:02:26:26:c9:0a:ed:d4:da:ee:2a:84:e3:f1:60:
+         b3:09:77:27:a1:3c:ac:ec:61:18:30:b5:6d:1f:16:0a:24:1a:
+         cf:1c:1b:60:a5:60:e5:2c:8b:cf:37:83:0c:15:e7:79:30:3f:
+         ee:50:45:7c:4b:c6:2c:cd:2c:81:0a:98:f1:65:44:7a:ca:2a:
+         20:1a:de:19:d9:4b:ca:a1:e2:a4:b5:14:47:bf:b4:68:15:03:
+         c0:55:e5:f4:47:0e:55:9f:fe:85:d8:2c:7d:d0:1a:96:11:b9:
+         68:b7:74:1e:61:94:c1:ae:87:52:2d:c6:26:ba:51:ed:f1:91:
+         c0:e6:4c:f8:ad:02:23:75:51:fc:f8:69:05:ec:cf:31:50:5a:
+         41:78:eb:3d:27:4d:9b:68:ef:ba:0e:ba:3a:7d:60:00:9d:53:
+         a5:08:3d:c6
+-----BEGIN CERTIFICATE-----
+MIIDbDCCAlSgAwIBAgIQE67a2PQY13O4vTXJzo6z/DANBgkqhkiG9w0BAQsFADAR
+MQ8wDQYDVQQDDAZUZXN0Q0EwHhcNMTkwNjA2MTkxMTE5WhcNMjIwNTIxMTkxMTE5
+WjAQMQ4wDAYDVQQDDAVTdWJDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
+ggEBALAJ/FTnap8Mva1aje+UThGmhxlPv6bhYqUttxffZ1Nw2v59mRfuE0cLQAui
+NDKp078g/BN3odUmYB/w1L7cdnwebLRMAXxWzVxT7IGzgSqyNSYGWnngs57kV+EJ
+3q1/yM2H7kmTMFJYsrwPwbYQRPiF1VsKmyj+9PRKFqb3JemWR2lzWzN3kn1hjSo9
+1QSJQL9r0v1d4hqAqY7IkvblTACE+W4qk6Mj7igjgfRU8Bgs7jKOOJygyDMEsPxM
+QxpcBISfc8YIxx1kOf5yGTvMpf0LQyUNK6mId55i5qzCmmBCT0pUR7ygKXJ8OFLJ
+6ifFPdCBSj64eHlLibhObRskFb0CAwEAAaOBwDCBvTAzBgNVHR8ELDAqMCigJqAk
+hiJodHRwOi8vMTI3LjAuMC4xOjgwODEvcGtpL3Rlc3QuY3JsMAwGA1UdEwQFMAMB
+Af8wHQYDVR0OBBYEFP2CRTmhkUHyZswNddUNQNWBp6FDMEwGA1UdIwRFMEOAFMXM
+9aGM2eSnuuwh9dGEI+oNwscwoRWkEzARMQ8wDQYDVQQDDAZUZXN0Q0GCFDPnBIcJ
+Moch2c18qkxauyxse1QoMAsGA1UdDwQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAQEA
+lqD/iku9RZbJcjxj40jEq+9+23Y/2QKeacjZNlXh9ZvJadhpAqxQjGCULC65qGWs
+9QCwi5YlC4rvlCFX4gTCw4a/Bk6RXOa8GwMxi2TqxXnDXJTlqmd+dBIHFP3NMgIm
+JskK7dTa7iqE4/Fgswl3J6E8rOxhGDC1bR8WCiQazxwbYKVg5SyLzzeDDBXneTA/
+7lBFfEvGLM0sgQqY8WVEesoqIBreGdlLyqHipLUUR7+0aBUDwFXl9EcOVZ/+hdgs
+fdAalhG5aLd0HmGUwa6HUi3GJrpR7fGRwOZM+K0CI3VR/PhpBezPMVBaQXjrPSdN
+m2jvug66On1gAJ1TpQg9xg==
+-----END CERTIFICATE-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/cert.pem 43.0.0-1ubuntu1/rust-vendor/openssl/test/cert.pem
--- 43.0.0-1/rust-vendor/openssl/test/cert.pem	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/cert.pem	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDGzCCAgMCCQCHcfe97pgvpTANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJB
+VTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0
+cyBQdHkgTHRkMB4XDTE2MDgxNDE3MDAwM1oXDTI2MDgxMjE3MDAwM1owWjELMAkG
+A1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0
+IFdpZGdpdHMgUHR5IEx0ZDETMBEGA1UEAwwKZm9vYmFyLmNvbTCCASIwDQYJKoZI
+hvcNAQEBBQADggEPADCCAQoCggEBAKj0JYxEsxejUIX+I5GH0Hg2G0kX/y1H0+Ub
+3mw2/Ja5BD/yN96/7zMSumXF8uS3SkmpyiJkbyD01TSRTqjlP7/VCBlyUIChlpLQ
+mrGaijZiT/VCyPXqmcwFzXS5IOTpX1olJfW8rA41U1LCIcDUyFf6LtZ/v8rSeKr6
+TuE6SGV4WRaBm1SrjWBeHVV866CRrtSS1ieT2asFsAyOZqWhk2fakwwBDFWDhOGI
+ubfO+5aq9cBJbNRlzsgB3UZs3gC0O6GzbnZ6oT0TiJMeTsXXjABLUlaq/rrqFF4Y
+euZkkbHTFBMz288PUc3m3ZTcpN+E7+ZOUBRZXKD20K07NugqCzUCAwEAATANBgkq
+hkiG9w0BAQsFAAOCAQEASvYHuIl5C0NHBELPpVHNuLbQsDQNKVj3a54+9q1JkiMM
+6taEJYfw7K1Xjm4RoiFSHpQBh+PWZS3hToToL2Zx8JfMR5MuAirdPAy1Sia/J/qE
+wQdJccqmvuLkLTSlsGbEJ/LUUgOAgrgHOZM5lUgIhCneA0/dWJ3PsN0zvn69/faY
+oo1iiolWiIHWWBUSdr3jM2AJaVAsTmLh00cKaDNk37JB940xConBGSl98JPrNrf9
+dUAiT0iIBngDBdHnn/yTj+InVEFyZSKrNtiDSObFHxPcxGteHNrCPJdP1e+GqkHp
+HJMRZVCQpSMzvHlofHSNgzWV1MX5h1CP4SGZdBDTfA==
+-----END CERTIFICATE-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/certs.pem 43.0.0-1ubuntu1/rust-vendor/openssl/test/certs.pem
--- 43.0.0-1/rust-vendor/openssl/test/certs.pem	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/certs.pem	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,40 @@
+-----BEGIN CERTIFICATE-----
+MIIDGzCCAgMCCQCHcfe97pgvpTANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJB
+VTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0
+cyBQdHkgTHRkMB4XDTE2MDgxNDE3MDAwM1oXDTI2MDgxMjE3MDAwM1owWjELMAkG
+A1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0
+IFdpZGdpdHMgUHR5IEx0ZDETMBEGA1UEAwwKZm9vYmFyLmNvbTCCASIwDQYJKoZI
+hvcNAQEBBQADggEPADCCAQoCggEBAKj0JYxEsxejUIX+I5GH0Hg2G0kX/y1H0+Ub
+3mw2/Ja5BD/yN96/7zMSumXF8uS3SkmpyiJkbyD01TSRTqjlP7/VCBlyUIChlpLQ
+mrGaijZiT/VCyPXqmcwFzXS5IOTpX1olJfW8rA41U1LCIcDUyFf6LtZ/v8rSeKr6
+TuE6SGV4WRaBm1SrjWBeHVV866CRrtSS1ieT2asFsAyOZqWhk2fakwwBDFWDhOGI
+ubfO+5aq9cBJbNRlzsgB3UZs3gC0O6GzbnZ6oT0TiJMeTsXXjABLUlaq/rrqFF4Y
+euZkkbHTFBMz288PUc3m3ZTcpN+E7+ZOUBRZXKD20K07NugqCzUCAwEAATANBgkq
+hkiG9w0BAQsFAAOCAQEASvYHuIl5C0NHBELPpVHNuLbQsDQNKVj3a54+9q1JkiMM
+6taEJYfw7K1Xjm4RoiFSHpQBh+PWZS3hToToL2Zx8JfMR5MuAirdPAy1Sia/J/qE
+wQdJccqmvuLkLTSlsGbEJ/LUUgOAgrgHOZM5lUgIhCneA0/dWJ3PsN0zvn69/faY
+oo1iiolWiIHWWBUSdr3jM2AJaVAsTmLh00cKaDNk37JB940xConBGSl98JPrNrf9
+dUAiT0iIBngDBdHnn/yTj+InVEFyZSKrNtiDSObFHxPcxGteHNrCPJdP1e+GqkHp
+HJMRZVCQpSMzvHlofHSNgzWV1MX5h1CP4SGZdBDTfA==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDXTCCAkWgAwIBAgIJAOIvDiVb18eVMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV
+BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX
+aWRnaXRzIFB0eSBMdGQwHhcNMTYwODE0MTY1NjExWhcNMjYwODEyMTY1NjExWjBF
+MQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50
+ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
+CgKCAQEArVHWFn52Lbl1l59exduZntVSZyDYpzDND+S2LUcO6fRBWhV/1Kzox+2G
+ZptbuMGmfI3iAnb0CFT4uC3kBkQQlXonGATSVyaFTFR+jq/lc0SP+9Bd7SBXieIV
+eIXlY1TvlwIvj3Ntw9zX+scTA4SXxH6M0rKv9gTOub2vCMSHeF16X8DQr4XsZuQr
+7Cp7j1I4aqOJyap5JTl5ijmG8cnu0n+8UcRlBzy99dLWJG0AfI3VRJdWpGTNVZ92
+aFff3RpK3F/WI2gp3qV1ynRAKuvmncGC3LDvYfcc2dgsc1N6Ffq8GIrkgRob6eBc
+klDHp1d023Lwre+VaVDSo1//Y72UFwIDAQABo1AwTjAdBgNVHQ4EFgQUbNOlA6sN
+XyzJjYqciKeId7g3/ZowHwYDVR0jBBgwFoAUbNOlA6sNXyzJjYqciKeId7g3/Zow
+DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAVVaR5QWLZIRR4Dw6TSBn
+BQiLpBSXN6oAxdDw6n4PtwW6CzydaA+creiK6LfwEsiifUfQe9f+T+TBSpdIYtMv
+Z2H2tjlFX8VrjUFvPrvn5c28CuLI0foBgY8XGSkR2YMYzWw2jPEq3Th/KM5Catn3
+AFm3bGKWMtGPR4v+90chEN0jzaAmJYRrVUh9vea27bOCn31Nse6XXQPmSI6Gyncy
+OAPUsvPClF3IjeL1tmBotWqSGn1cYxLo+Lwjk22A9h6vjcNQRyZF2VLVvtwYrNU3
+mwJ6GCLsLHpwW/yjyvn8iEltnJvByM/eeRnfXV6WDObyiZsE/n6DxIRJodQzFqy9
+GA==
+-----END CERTIFICATE-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/certv3.pem 43.0.0-1ubuntu1/rust-vendor/openssl/test/certv3.pem
--- 43.0.0-1/rust-vendor/openssl/test/certv3.pem	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/certv3.pem	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,23 @@
+-----BEGIN CERTIFICATE-----
+MIIDwTCCAqmgAwIBAgIUDeCGNunyJfBd3U/qUtmCcvbMyZwwDQYJKoZIhvcNAQEL
+BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
+GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMzAxMjMxMzMzNTJaFw0zMzAx
+MjAxMzMzNTJaMFoxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw
+HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxEzARBgNVBAMMCmZvb2Jh
+ci5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCo9CWMRLMXo1CF
+/iORh9B4NhtJF/8tR9PlG95sNvyWuQQ/8jfev+8zErplxfLkt0pJqcoiZG8g9NU0
+kU6o5T+/1QgZclCAoZaS0Jqxmoo2Yk/1Qsj16pnMBc10uSDk6V9aJSX1vKwONVNS
+wiHA1MhX+i7Wf7/K0niq+k7hOkhleFkWgZtUq41gXh1VfOugka7UktYnk9mrBbAM
+jmaloZNn2pMMAQxVg4ThiLm3zvuWqvXASWzUZc7IAd1GbN4AtDuhs252eqE9E4iT
+Hk7F14wAS1JWqv666hReGHrmZJGx0xQTM9vPD1HN5t2U3KTfhO/mTlAUWVyg9tCt
+OzboKgs1AgMBAAGjgZMwgZAwTgYDVR0fBEcwRTAgoB6gHIYaaHR0cDovL2V4YW1w
+bGUuY29tL2NybC5wZW0wIaAfoB2GG2h0dHA6Ly9leGFtcGxlLmNvbS9jcmwyLnBl
+bTAdBgNVHQ4EFgQUtnMvYaVLoe9ILBWxn/PcNC+8rDAwHwYDVR0jBBgwFoAUbNOl
+A6sNXyzJjYqciKeId7g3/ZowDQYJKoZIhvcNAQELBQADggEBAJZyk6Eo4p3JIyOt
+7t6ET3K18BKvlRilze+zrGkaQYvKRsP6YzbZWgcIq59hy5VeFCX5O2WP91CPG3MU
+I9eRiih66/ry3G4I8QEdpRKnn0N5unbGjb5qPT5wXrhU4IO+vn3sGZGM4uIM1/3K
+N/bOh9CTsu9YqrdHSGeDyNzCy/XZ/j5bP4aNm31ZDNCZDFsbjr3/yTLcpHPL0UP3
+mCX8D16BDu1Nep+wK9VRuOEw6Z9tlT/VjTImzoOUoJO/o2UHfSHahX+n2aC5OpI6
+BdhaFBuJ1vn+yTWf3zIjhWUdp9TlzgRyFiyetP2FcKwremVVGdDq/Y6dfXaq8CA1
+6Fr9KTY=
+-----END CERTIFICATE-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/certv3_extfile 43.0.0-1ubuntu1/rust-vendor/openssl/test/certv3_extfile
--- 43.0.0-1/rust-vendor/openssl/test/certv3_extfile	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/certv3_extfile	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+crlDistributionPoints=URI:http://example.com/crl.pem,URI:http://example.com/crl2.pem
Binary files 43.0.0-1/rust-vendor/openssl/test/cms.p12 and 43.0.0-1ubuntu1/rust-vendor/openssl/test/cms.p12 differ
Binary files 43.0.0-1/rust-vendor/openssl/test/cms_pubkey.der and 43.0.0-1ubuntu1/rust-vendor/openssl/test/cms_pubkey.der differ
diff -pruN 43.0.0-1/rust-vendor/openssl/test/crl-ca.crt 43.0.0-1ubuntu1/rust-vendor/openssl/test/crl-ca.crt
--- 43.0.0-1/rust-vendor/openssl/test/crl-ca.crt	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/crl-ca.crt	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,20 @@
+-----BEGIN CERTIFICATE-----
+MIIDPDCCAiSgAwIBAgIUM+cEhwkyhyHZzXyqTFq7LGx7VCgwDQYJKoZIhvcNAQEL
+BQAwETEPMA0GA1UEAwwGVGVzdENBMB4XDTE5MDYwNjE5MTA1NVoXDTI5MDYwMzE5
+MTA1NVowETEPMA0GA1UEAwwGVGVzdENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
+MIIBCgKCAQEAtNcFPtD1MHcolhgTHIAx/b9OyawCbVzvgasv8R9+94ZMhoGc/tNc
+dVg271pCSmj+zYAFYsIwjxW+iq2e5A/fiBc6uqtNfEbU7+77QzxFG5wIbXtmmqEb
+dVbqBT28NeKTR6X+EHlNgbw90CHy7byA7LMewxbTt2q1eY1RnB0ji8zdGZmIUPeC
+WxzkxXEd0fg+KwBFN3YHV9CJX2KJ10qv7DvbKHeIVBU7osm6tzvNglNnnT90GFSY
+zc59b+zS00axcY3Kn08Vt+1qWB9Sl8tixCTGqR538y/ambDr3NCWsiQYWys9KE1L
+g0nEaIjb84R7b+qNmPtOezd9tanx7j9UzQIDAQABo4GLMIGIMB0GA1UdDgQWBBTF
+zPWhjNnkp7rsIfXRhCPqDcLHMDBMBgNVHSMERTBDgBTFzPWhjNnkp7rsIfXRhCPq
+DcLHMKEVpBMwETEPMA0GA1UEAwwGVGVzdENBghQz5wSHCTKHIdnNfKpMWrssbHtU
+KDAMBgNVHRMEBTADAQH/MAsGA1UdDwQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAQEA
+gdyQq6F8DO5rn7rZSLehTFx6tbtfncC/BOXZEGLZO0ciTrQ9Q8xHwRhz0W09QE1A
+/GsBzb++PuvAl9i82WvunyPB5KZh+GPiaaqf466MdQrXj+IyqxeC9Lg9wEUjwRgp
+ANVd3moKap5IZ9WDvhyEng2Oy8/btP2iqVEmd58rGAodd671eOPD8QkIxSquiIwy
+Cu5s3IBZ0BOuSG9fWoyPTGMKAhzQPFiXGvWOabCkMz3TsPYVY5ENpq2K8cWn2D/r
+TD1yPPdINg6HrALGD3S0sD+k588oS7U5oj1L8V4KJQTLSbh6/XcBpasa5Jdv7ZZe
+lVgt69Gsn5Cf2BkbwhbF2Q==
+-----END CERTIFICATE-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/csr.pem 43.0.0-1ubuntu1/rust-vendor/openssl/test/csr.pem
--- 43.0.0-1/rust-vendor/openssl/test/csr.pem	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/csr.pem	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,62 @@
+Certificate Request:
+    Data:
+        Version: 1 (0x0)
+        Subject: C = AU, ST = Some-State, O = Internet Widgits Pty Ltd, CN = foobar.com
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                RSA Public-Key: (2048 bit)
+                Modulus:
+                    00:a8:f4:25:8c:44:b3:17:a3:50:85:fe:23:91:87:
+                    d0:78:36:1b:49:17:ff:2d:47:d3:e5:1b:de:6c:36:
+                    fc:96:b9:04:3f:f2:37:de:bf:ef:33:12:ba:65:c5:
+                    f2:e4:b7:4a:49:a9:ca:22:64:6f:20:f4:d5:34:91:
+                    4e:a8:e5:3f:bf:d5:08:19:72:50:80:a1:96:92:d0:
+                    9a:b1:9a:8a:36:62:4f:f5:42:c8:f5:ea:99:cc:05:
+                    cd:74:b9:20:e4:e9:5f:5a:25:25:f5:bc:ac:0e:35:
+                    53:52:c2:21:c0:d4:c8:57:fa:2e:d6:7f:bf:ca:d2:
+                    78:aa:fa:4e:e1:3a:48:65:78:59:16:81:9b:54:ab:
+                    8d:60:5e:1d:55:7c:eb:a0:91:ae:d4:92:d6:27:93:
+                    d9:ab:05:b0:0c:8e:66:a5:a1:93:67:da:93:0c:01:
+                    0c:55:83:84:e1:88:b9:b7:ce:fb:96:aa:f5:c0:49:
+                    6c:d4:65:ce:c8:01:dd:46:6c:de:00:b4:3b:a1:b3:
+                    6e:76:7a:a1:3d:13:88:93:1e:4e:c5:d7:8c:00:4b:
+                    52:56:aa:fe:ba:ea:14:5e:18:7a:e6:64:91:b1:d3:
+                    14:13:33:db:cf:0f:51:cd:e6:dd:94:dc:a4:df:84:
+                    ef:e6:4e:50:14:59:5c:a0:f6:d0:ad:3b:36:e8:2a:
+                    0b:35
+                Exponent: 65537 (0x10001)
+        Attributes:
+            a0:00
+    Signature Algorithm: sha256WithRSAEncryption
+         95:26:e1:84:56:e7:80:da:2c:a4:c0:b5:85:43:61:85:34:84:
+         37:83:c0:bc:cf:70:20:89:46:ce:3d:7e:23:8a:40:a4:a5:fa:
+         c5:e3:3d:ee:e5:05:16:58:93:f9:6c:f3:86:ee:99:cc:e1:04:
+         5c:68:99:da:66:72:a1:95:31:cd:13:6f:a5:6f:fc:a9:ec:75:
+         6a:f7:e5:cf:0e:7b:5f:2f:db:8d:45:e6:66:52:12:1d:c9:ac:
+         3a:86:35:bd:1f:7b:6e:b5:e1:f3:4f:80:6a:06:73:1c:a0:0d:
+         a3:63:b6:40:76:25:b0:e9:96:33:7a:9d:18:7e:5e:93:c0:47:
+         d7:0b:da:b3:03:17:94:d0:0c:78:18:f3:0e:cd:3c:f7:e8:25:
+         08:c2:13:0a:af:1e:5c:48:5f:17:41:b2:2d:d2:0f:37:2e:b3:
+         10:fd:2b:c0:77:e1:17:8a:57:0c:95:5e:c8:03:eb:63:14:2e:
+         46:fd:1e:14:13:9f:38:c1:2f:e9:9b:47:c3:60:a9:d7:6e:a3:
+         d0:af:0b:6f:df:6e:37:f6:d9:a0:1b:dd:1f:a5:a5:33:89:1f:
+         a5:a3:44:14:91:83:c3:c8:b2:6e:fb:3f:f1:6d:d2:51:21:f7:
+         98:20:0a:40:75:a5:60:c3:59:53:08:62:3d:39:e8:83:55:90:
+         1a:bf:51:57
+-----BEGIN CERTIFICATE REQUEST-----
+MIICnzCCAYcCAQAwWjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUx
+ITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDETMBEGA1UEAwwKZm9v
+YmFyLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKj0JYxEsxej
+UIX+I5GH0Hg2G0kX/y1H0+Ub3mw2/Ja5BD/yN96/7zMSumXF8uS3SkmpyiJkbyD0
+1TSRTqjlP7/VCBlyUIChlpLQmrGaijZiT/VCyPXqmcwFzXS5IOTpX1olJfW8rA41
+U1LCIcDUyFf6LtZ/v8rSeKr6TuE6SGV4WRaBm1SrjWBeHVV866CRrtSS1ieT2asF
+sAyOZqWhk2fakwwBDFWDhOGIubfO+5aq9cBJbNRlzsgB3UZs3gC0O6GzbnZ6oT0T
+iJMeTsXXjABLUlaq/rrqFF4YeuZkkbHTFBMz288PUc3m3ZTcpN+E7+ZOUBRZXKD2
+0K07NugqCzUCAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQCVJuGEVueA2iykwLWF
+Q2GFNIQ3g8C8z3AgiUbOPX4jikCkpfrF4z3u5QUWWJP5bPOG7pnM4QRcaJnaZnKh
+lTHNE2+lb/yp7HVq9+XPDntfL9uNReZmUhIdyaw6hjW9H3tuteHzT4BqBnMcoA2j
+Y7ZAdiWw6ZYzep0Yfl6TwEfXC9qzAxeU0Ax4GPMOzTz36CUIwhMKrx5cSF8XQbIt
+0g83LrMQ/SvAd+EXilcMlV7IA+tjFC5G/R4UE584wS/pm0fDYKnXbqPQrwtv3243
+9tmgG90fpaUziR+lo0QUkYPDyLJu+z/xbdJRIfeYIApAdaVgw1lTCGI9OeiDVZAa
+v1FX
+-----END CERTIFICATE REQUEST-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/dhparams.pem 43.0.0-1ubuntu1/rust-vendor/openssl/test/dhparams.pem
--- 43.0.0-1/rust-vendor/openssl/test/dhparams.pem	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/dhparams.pem	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,8 @@
+-----BEGIN DH PARAMETERS-----
+MIIBCAKCAQEAh3Betv+hf5jNsOmGXU8oxuABD2B8r0yU8FVgjnCZBSVo61qJ0A2d
+J6r8rYKbjtolnrZN/V4IPSzYvxurHbu8nbiFVyhOySPchI2Fu+YT/HsSe/0MH9bW
+gJTNzmutWoy9VxtWLCmXnOSZHep3MZ1ZNimno6Kh2qQ7VJr0+KF8GbxUKOPv4SqK
+NBwouIQXFc0pE9kGhcGKbr7TnHhyJFCRLNP1OVDQZbcoKjk1Vh+5sy7vM2VUTQmM
+yOToT2LEZVAUJXNumcYMki9MIwfYCwYZbNt0ZEolyHzUEesuyHfU1eJd6+sKEjUz
+5GteQIR7AehxZIS+cytu7BXO7B0owLJ2awIBAg==
+-----END DH PARAMETERS-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/dsa.pem 43.0.0-1ubuntu1/rust-vendor/openssl/test/dsa.pem
--- 43.0.0-1/rust-vendor/openssl/test/dsa.pem	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/dsa.pem	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,12 @@
+-----BEGIN DSA PRIVATE KEY-----
+MIIBuwIBAAKBgQCkKe/jtYKJNQafaE7kg2aaJOEPUV0Doi451jkXHp5UfLh6+t42
+eabSGkE9WBAlILgaB8yHckLe9+zozN39+SUDp94kb2r38/8w/9Ffhbsep9uiyOj2
+ZRQur6SkpKQDKcnAd6IMZXZcvdSgPC90A6qraYUZKq7Csjn63gbC+IvXHwIVAIgS
+PE43lXD8/rGYxos4cxCgGGAxAoGASMV56WhLvVQtWMVI36WSIxbZnC2EsnNIKeVW
+yXnP/OmPJ2mdezG7i1alcwsO2TnSLbvjvGPlyzIqZzHvWC8EmDqsfbU+n8we/Eal
+sm5nloC8m9ECWpbTzbNdvrAAj9UPVWjcDwg7grAGGysh6lGbBv5P+4zL/niq1UiE
+LnKcifgCgYEAo6mAasO0+MVcu8shxxUXXNeTLsZ8NB/BIx9EZ/dzE23ivNW8dq1A
+eecAAYhssI2m/CspQvyKw+seCvg4FccxJgB3+mGOe+blFHwO3eAwoyRn/t3DZDHh
+FjxKKRsQdy4BkZv+vhTyIYYCw0iPZ5Wfln+pyGGTveIDED1MPG+J6c8CFCJAUlEl
+4nHvbC15xLXXpd46zycY
+-----END DSA PRIVATE KEY-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/dsa.pem.pub 43.0.0-1ubuntu1/rust-vendor/openssl/test/dsa.pem.pub
--- 43.0.0-1/rust-vendor/openssl/test/dsa.pem.pub	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/dsa.pem.pub	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,12 @@
+-----BEGIN PUBLIC KEY-----
+MIIBtzCCASsGByqGSM44BAEwggEeAoGBAKQp7+O1gok1Bp9oTuSDZpok4Q9RXQOi
+LjnWORcenlR8uHr63jZ5ptIaQT1YECUguBoHzIdyQt737OjM3f35JQOn3iRvavfz
+/zD/0V+Fux6n26LI6PZlFC6vpKSkpAMpycB3ogxldly91KA8L3QDqqtphRkqrsKy
+OfreBsL4i9cfAhUAiBI8TjeVcPz+sZjGizhzEKAYYDECgYBIxXnpaEu9VC1YxUjf
+pZIjFtmcLYSyc0gp5VbJec/86Y8naZ17MbuLVqVzCw7ZOdItu+O8Y+XLMipnMe9Y
+LwSYOqx9tT6fzB78RqWybmeWgLyb0QJaltPNs12+sACP1Q9VaNwPCDuCsAYbKyHq
+UZsG/k/7jMv+eKrVSIQucpyJ+AOBhQACgYEAo6mAasO0+MVcu8shxxUXXNeTLsZ8
+NB/BIx9EZ/dzE23ivNW8dq1AeecAAYhssI2m/CspQvyKw+seCvg4FccxJgB3+mGO
+e+blFHwO3eAwoyRn/t3DZDHhFjxKKRsQdy4BkZv+vhTyIYYCw0iPZ5Wfln+pyGGT
+veIDED1MPG+J6c8=
+-----END PUBLIC KEY-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/dsaparam.pem 43.0.0-1ubuntu1/rust-vendor/openssl/test/dsaparam.pem
--- 43.0.0-1/rust-vendor/openssl/test/dsaparam.pem	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/dsaparam.pem	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,9 @@
+-----BEGIN DSA PARAMETERS-----
+MIIBHgKBgQCkKe/jtYKJNQafaE7kg2aaJOEPUV0Doi451jkXHp5UfLh6+t42eabS
+GkE9WBAlILgaB8yHckLe9+zozN39+SUDp94kb2r38/8w/9Ffhbsep9uiyOj2ZRQu
+r6SkpKQDKcnAd6IMZXZcvdSgPC90A6qraYUZKq7Csjn63gbC+IvXHwIVAIgSPE43
+lXD8/rGYxos4cxCgGGAxAoGASMV56WhLvVQtWMVI36WSIxbZnC2EsnNIKeVWyXnP
+/OmPJ2mdezG7i1alcwsO2TnSLbvjvGPlyzIqZzHvWC8EmDqsfbU+n8we/Ealsm5n
+loC8m9ECWpbTzbNdvrAAj9UPVWjcDwg7grAGGysh6lGbBv5P+4zL/niq1UiELnKc
+ifg=
+-----END DSA PARAMETERS-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/entry_extensions.crl 43.0.0-1ubuntu1/rust-vendor/openssl/test/entry_extensions.crl
--- 43.0.0-1/rust-vendor/openssl/test/entry_extensions.crl	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/entry_extensions.crl	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,11 @@
+-----BEGIN X509 CRL-----
+MIIBojCCAUkCAQEwCgYIKoZIzj0EAwIwHTEbMBkGA1UEAwwSY3J5cHRvZ3JhcGh5
+LmlvIENBFw0yMzA3MjUxNDA1MzlaFw0yMzA4MDExNDA1MzlaMIGAMH4CFE+Y95/1
+pOqa6c9fUEJ8c04kxu2PFw0yMzA3MjUxNDA1MzlaMFcwLwYDVR0dAQH/BCUwI6Qh
+MB8xCzAJBgNVBAYTAkdCMRAwDgYDVQQDDAdUZXN0IENBMAoGA1UdFQQDCgEBMBgG
+A1UdGAQRGA8yMDIzMDcyNTE0MDUzOVqgeDB2MB8GA1UdIwQYMBaAFK6qKNgsGefh
+XexO9WsIwiQ/73R8MAoGA1UdFAQDAgEUMAwGA1UdHAQFMAOEAf8wOQYIKwYBBQUH
+AQEELTArMCkGCCsGAQUFBzAChh1odHRwOi8vd3d3LmV4YW1wbGUuY29tL2NhLmNy
+dDAKBggqhkjOPQQDAgNHADBEAiB22SXxFnQUB41uxfyCvg2dAs2nFiR0r8jft/cd
+G8zcKAIgeYkNOzRn4lyopK6J94rhm8jIIuJRj3Ns9XcH+91N370=
+-----END X509 CRL-----
Binary files 43.0.0-1/rust-vendor/openssl/test/identity.p12 and 43.0.0-1ubuntu1/rust-vendor/openssl/test/identity.p12 differ
diff -pruN 43.0.0-1/rust-vendor/openssl/test/intermediate-ca.key 43.0.0-1ubuntu1/rust-vendor/openssl/test/intermediate-ca.key
--- 43.0.0-1/rust-vendor/openssl/test/intermediate-ca.key	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/intermediate-ca.key	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEA1HsHFTpgKeWL/y6oKtARZm0Dy6J/08E0CujmdpVp0xnkXi/A
+RARnbMEbOPfmBUMOkVtQT3+l5aCgIAX+Kg6K7sQvio8nQUgOxuO1YpGlYu9EMtc7
+5fNxA1T0CuXXx8ClfEqW1ZV7ziQV0J4gzvuI26A7XyUhdk1oP/Al3F/94TmH6dtP
+SQ2K901O2zknU+bpPheQy08SE20k/nUOJAsiwtsxqY8hHOL1sXZ4K+I311hl0QpD
+OYf7eBcBdo2Mc5Nzjd9LPGLk1lE3itAXpayFMmfuuA0IdH1gNfy18axFEEVnj6CS
+2epGpmAckUEWUOse1WBhDEt6ddowT1iw7X4mWwIDAQABAoIBAGMGXzuudAiymTc5
+OFiTlbhlkAJEXkyC201GU7nqUmJ2y651lKZeYxEVQimfpszG/rARnXEfbWKCJH4o
+LNbO5kL2na12n/XVrkVU9EDW3fwoxGDpXFoDxaSm4AGAMrs+diFh5b/upb9ho+UQ
+/PtZ0OOCXokuFdU7qB08P3jgJ8LhooqWnZ4AC0rhN85CMNIKs/nrUrnmS3FZLVd/
+NWI9Vfjsndd41Gkho0A7tgOSnwRupk/Bv1b0px31h8ucp9/nLuR8vbGSdS/R9Sta
+pB9KNYYQ3LrhQGjddnEU0gj8qsuWgnoPf7eaWsLVunPLHQzL2hNNKL1eBADm7Lhh
+avIlnrkCgYEA8Q8UhOeIO0sMU8sB4NPTUf2UT9xjURoowGsGgbDEk21eABH6VC33
+VYt5r5xwbZFQvVaTbe+EI1YDpjH1cvpmorEWI47Nm4Vbf9JujW/hoQwuwpzOpdUT
+2G4tfMQrmTw/9HJ0l9+1Ib+A93dB8GvR0NE1uueaWanWvXARInwGiscCgYEA4aZ9
+mbhuwx88sSRMXwxSZw+R5BRrjdC0CeoimGg4/P84bKgc0YsjAha5jWaC/h8xN2Pb
+w45b3hQ0/FP8xohP0bp/5eeiDbqb6JuO5bI3CnfBrVpu1CAuIrf7lhkar3a0wluB
+k03fVHuVLtydACDJBKrZm1F39lpiZiEqlBIp080CgYEAwRwYjwPAEefkHzhQ7+Ah
+uNwQtQ1TjsQLA2J5mumWAJirphjA1jDgo+oQ+Iq1UkEIUjWJ85bd30TntXruK0bH
+c+uzVZbvxXfGvhZAtBN9x/svdn4R2a1hsY9J51prpt0qStRp7MSsoTV9xkEGVOi6
+87K1fV5OOyggvC+Lunlq8D8CgYAVSCOObPOdWYPa3SaKzFm1OKW00iw2qtlgGgH7
+R9EgI14J+W0GYk4B82y6plFycDSvGa7vaazGbDd3GOC9RLvqduF7KHaDPvdXX9yB
+U2aXiSXuGJpdTU+snJeQ13tJ0zNHJWQ6JV0L1cADNHFmQrFSzF5LpMpgpLOlGDmw
+z2m8fQKBgQDclFeonyn0zcXqznun9kAKkMij4s6lSdRgi/5Zh1WbJwOso9oWfwz9
+SSTP2KBO8B+/yFvuo5SWrbNaTz9/KuzMTv4HXz5ukLbyN9Jjtk73fdBBRSjL+zF5
+jU56oXHrwBhEqWQ77Ps60r+FmDjUgUhyJl14ZfkzICUK7NLFxKrvMQ==
+-----END RSA PRIVATE KEY-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/intermediate-ca.pem 43.0.0-1ubuntu1/rust-vendor/openssl/test/intermediate-ca.pem
--- 43.0.0-1/rust-vendor/openssl/test/intermediate-ca.pem	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/intermediate-ca.pem	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDszCCApugAwIBAgIEFSQSITANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJB
+VTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0
+cyBQdHkgTHRkMB4XDTIyMTEwMzA3MDc0OVoXDTI2MDgxMTA3MDc0OVowgYkxCzAJ
+BgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5l
+dCBXaWRnaXRzIFB0eSBMdGQxIDAeBgNVBAsMF0ludGVybWVkaWF0ZSBEZXBhcnRt
+ZW50MSAwHgYDVQQDDBdpbnRlcm1lZGlhdGUuZm9vYmFyLmNvbTCCASIwDQYJKoZI
+hvcNAQEBBQADggEPADCCAQoCggEBANR7BxU6YCnli/8uqCrQEWZtA8uif9PBNAro
+5naVadMZ5F4vwEQEZ2zBGzj35gVDDpFbUE9/peWgoCAF/ioOiu7EL4qPJ0FIDsbj
+tWKRpWLvRDLXO+XzcQNU9Arl18fApXxKltWVe84kFdCeIM77iNugO18lIXZNaD/w
+Jdxf/eE5h+nbT0kNivdNTts5J1Pm6T4XkMtPEhNtJP51DiQLIsLbMamPIRzi9bF2
+eCviN9dYZdEKQzmH+3gXAXaNjHOTc43fSzxi5NZRN4rQF6WshTJn7rgNCHR9YDX8
+tfGsRRBFZ4+gktnqRqZgHJFBFlDrHtVgYQxLenXaME9YsO1+JlsCAwEAAaNmMGQw
+HQYDVR0OBBYEFAXJImmmxYXx6L1SRRhgP3Tyq2J6MB8GA1UdIwQYMBaAFGzTpQOr
+DV8syY2KnIiniHe4N/2aMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQD
+AgGGMA0GCSqGSIb3DQEBCwUAA4IBAQCnUh7iNbnFBjVa4sFx02r65syxUhcvM/ya
+DcSe1esGUwjZLyKVl9BTfQ6kfNa/6Z/t5cprp0R3etalN31dxka7xSDwzFNdBczB
+zYDIVOVlcGLL1Xjozacm6YHo773dqxZS36rVMk3NqNUY6GJJ+CGso2xZShcBg2KG
+fPlNPiRz3847E3dwouDYcP1MXf2ql/Y7dRbE+8kb3bWkSusJVb/4EHjpR7yZjKmh
+eXHVVx1dKnCGRldn3+dSNhN6mxNaSeBE2hb158+diQvL5u3f//va7SOpCi0f4d8E
+UCnLhieyrDlr42XXfz42BqRpqBO1SDjQwzIIc9Fbevwb916OSExp
+-----END CERTIFICATE-----
Binary files 43.0.0-1/rust-vendor/openssl/test/key.der and 43.0.0-1ubuntu1/rust-vendor/openssl/test/key.der differ
Binary files 43.0.0-1/rust-vendor/openssl/test/key.der.pub and 43.0.0-1ubuntu1/rust-vendor/openssl/test/key.der.pub differ
diff -pruN 43.0.0-1/rust-vendor/openssl/test/key.pem 43.0.0-1ubuntu1/rust-vendor/openssl/test/key.pem
--- 43.0.0-1/rust-vendor/openssl/test/key.pem	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/key.pem	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCo9CWMRLMXo1CF
+/iORh9B4NhtJF/8tR9PlG95sNvyWuQQ/8jfev+8zErplxfLkt0pJqcoiZG8g9NU0
+kU6o5T+/1QgZclCAoZaS0Jqxmoo2Yk/1Qsj16pnMBc10uSDk6V9aJSX1vKwONVNS
+wiHA1MhX+i7Wf7/K0niq+k7hOkhleFkWgZtUq41gXh1VfOugka7UktYnk9mrBbAM
+jmaloZNn2pMMAQxVg4ThiLm3zvuWqvXASWzUZc7IAd1GbN4AtDuhs252eqE9E4iT
+Hk7F14wAS1JWqv666hReGHrmZJGx0xQTM9vPD1HN5t2U3KTfhO/mTlAUWVyg9tCt
+OzboKgs1AgMBAAECggEBAKLj6IOJBKXolczpzb8UkyAjAkGBektcseV07gelJ/fk
+3z0LuWPv5p12E/HlXB24vU2x/ikUbbP3eMsawRzDEahQqmNmPEkYAYUAy/Qpi9GN
+DYvn3LqDec4jVgeQKS+p9H2DzUpTogp8zR2//yzbuWBg2+F//xh7vU0S0RQCziPM
+x7RSBgbhxSfChfEJbS2sDnzfh0jRQmoY95iFv7puet1FJtzdZ4fgCd1RqmC2lFM5
+H0eZtN/Cz19lieVs0b996DErdEBqClVZO00eYbRozCDaBzRU3ybB/dMrGJxhkkXm
+wb3kWMtziH9qOYsostuHIFu8eKFLloKxFnq2R4DGxOECgYEA2KUIZISOeGJSBcLJ
+JAUK2gvgXPNo4HHWIwOA9xeN3ZJlsnPlffXQNnm6t1st1V2gfMm9I2n0m/F0y2B/
+n/XGSa8bghfPA9l0c2h58lkL3JQJR/paa8ycTz+YZPrznEyN7Qa0RrJXUvZv9lQL
+Hc3+FHcSHgMqDV2f2bHAEu9YGi0CgYEAx6VEIPNvrHFgjo/jk1RTuk+m0xEWQsZL
+Cs+izQMr2TaeJn8LG+93AvFuYn0J0nT3WuStLPrUg8i4IhSS6lf1tId5ivIZPm4r
+YwMyblBJXhnHbk7Uqodjfw/3s6V2HAu++B7hTdyVr9DFuST9uv4m8bkPV8rfX1jE
+I2rAPVWvgikCgYB+wNAQP547wQrMZBLbCDg5KwmyWJfb+b6X7czexOEz6humNTjo
+YZHYzY/5B1fhpk3ntQD8X1nGg5caBvOk21+QbOtjShrM3cXMYCw5JvBRtitX+Zo9
+yBEMLOE0877ki8XeEDYZxu5gk98d+D4oygUGZEQtWxyXhVepPt5qNa8OYQKBgQDH
+RVgZI6KFlqzv3wMh3PutbS9wYQ+9GrtwUQuIYe/0YSW9+vSVr5E0qNKrD28sV39F
+hBauXLady0yvB6YUrjMbPFW+sCMuQzyfGWPO4+g3OrfqjFiM1ZIkE0YEU9Tt7XNx
+qTDtTI1D7bhNMnTnniI1B6ge0und+3XafAThs5L48QKBgQCTTpfqMt8kU3tcI9sf
+0MK03y7kA76d5uw0pZbWFy7KI4qnzWutCzb+FMPWWsoFtLJLPZy//u/ZCUVFVa4d
+0Y/ASNQIESVPXFLAltlLo4MSmsg1vCBsbviEEaPeEjvMrgki93pYtd/aOSgkYC1T
+mEq154s5rmqh+h+XRIf7Au0SLw==
+-----END PRIVATE KEY-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/key.pem.pub 43.0.0-1ubuntu1/rust-vendor/openssl/test/key.pem.pub
--- 43.0.0-1/rust-vendor/openssl/test/key.pem.pub	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/key.pem.pub	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,9 @@
+-----BEGIN PUBLIC KEY-----
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr1bXMptaIgOL9PVL8a7W
+KG/C8+IbxP018eMBQZT0SnPQmXp0Q8Aai/F+AEDE7b5sO5U7WdxU4GRYw0wqkQNF
+si78KNfoj2ZMlx6NRfl4UKuzrpGTPgQxuKDYedngPpWcbmW4P3zEL2Y7b18n9NJr
+atRUzH1Zh/ReRO525Xadu58aviPw1Mzgse7cKyzb03Gll9noLnYNIIpO8jL+QyrD
+8qNmfacmR20U0a6XDTtmsmk7AitGETICbTT0KRf+oAP0yIHoonllPpNLUEPZQjrp
+ClS/S/wKdj7gaq9TaMbHULhFMjbCV8cuPu//rUAuWp3riaznZGOVQyn3Dp2CB3ad
+yQIDAQAB
+-----END PUBLIC KEY-----
Binary files 43.0.0-1/rust-vendor/openssl/test/keystore-empty-chain.p12 and 43.0.0-1ubuntu1/rust-vendor/openssl/test/keystore-empty-chain.p12 differ
diff -pruN 43.0.0-1/rust-vendor/openssl/test/leaf.pem 43.0.0-1ubuntu1/rust-vendor/openssl/test/leaf.pem
--- 43.0.0-1/rust-vendor/openssl/test/leaf.pem	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/leaf.pem	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,21 @@
+-----BEGIN CERTIFICATE-----
+MIIDejCCAmICBBUkEiQwDQYJKoZIhvcNAQELBQAwgYkxCzAJBgNVBAYTAkFVMRMw
+EQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0
+eSBMdGQxIDAeBgNVBAsMF0ludGVybWVkaWF0ZSBEZXBhcnRtZW50MSAwHgYDVQQD
+DBdpbnRlcm1lZGlhdGUuZm9vYmFyLmNvbTAeFw0yMjExMDMwNzE3NTJaFw0yNjA4
+MTEwNzE3NTJaMHkxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw
+HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxGDAWBgNVBAsMD0xlYWYg
+RGVwYXJ0bWVudDEYMBYGA1UEAwwPbGVhZi5mb29iYXIuY29tMIIBIjANBgkqhkiG
+9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs9STUHGIcSOtioK6+02k9Jx4JuYVJ0SB7Ebd
+FAhGiOxBSoOljRVmmALti89QMmRiRqlyJnGJch7AloCCRsLJA0MfUYvauqmKHZFk
+iqtZ1HocHQ/LGNKfkILcclb4xp2nGYntKAyEqer3Qc6aPWAnQAV/+BshU1vlMfwU
+T6vOJRG69mft6dkHEWSzZd7++7HmFQGnDmIs5jBJVCOgKVttkN8Bk2EsTvJi9zl2
+SXLTcVrTAxEvuawv2ZXvdI/Cpt1WW0litXlFLcYBGwt/N93TX/L3Iyw5HcNd/xf9
+QwOr6RR66krQJzKxwcIY934uq6cyTQhexgnffb65qXL4bbV5fwIDAQABMA0GCSqG
+SIb3DQEBCwUAA4IBAQAZf0/r04AeKN2QhQ7Z0o2Iu/Yj3OD2tnbxVoltYk8CRfp3
+7VGl/5PUbmXXBSwMc4Udj88JlreU7iNEPAKtBqFczw0pwNfvxKG4Eh3vsfKrP+5g
+gtVwDG0mWeKJ7udrmFt8N0uwxVYDKp/gv5+Bw2eMew9Eoyenj6k2yg0nbFKzA3EH
+DqngETzX0dhdiYwVcoJFUK5ni3tVl9qi6FpmaTE6C5nTQLyH4CI+vo2x/QHINGaJ
+OzY/rx35iyVqXVqxN/gO/hp6g0nT5zLuMg2rfvcAhdDsD7htYcHiNkofrC8s0oQE
+W+r01EhxdEVvY1nYWanBCF6tktc5v5qf2WMS4ye5
+-----END CERTIFICATE-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/nid_test_cert.pem 43.0.0-1ubuntu1/rust-vendor/openssl/test/nid_test_cert.pem
--- 43.0.0-1/rust-vendor/openssl/test/nid_test_cert.pem	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/nid_test_cert.pem	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,12 @@
+-----BEGIN CERTIFICATE-----
+MIIB1DCCAX6gAwIBAgIJAMzXWZGWHleWMA0GCSqGSIb3DQEBCwUAMFYxHzAdBgkq
+hkiG9w0BCQEWEHRlc3RAZXhhbXBsZS5jb20xFDASBgNVBAMMC2V4YW1wbGUuY29t
+MR0wGwYJKoZIhvcNAQkUHg4ARQB4AGEAbQBwAGwAZTAeFw0xNTA3MDEwNjQ3NDRa
+Fw0xNTA3MzEwNjQ3NDRaMFYxHzAdBgkqhkiG9w0BCQEWEHRlc3RAZXhhbXBsZS5j
+b20xFDASBgNVBAMMC2V4YW1wbGUuY29tMR0wGwYJKoZIhvcNAQkUHg4ARQB4AGEA
+bQBwAGwAZTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQCmejzp4+o35FD0hAnx2trL
+08h07X5jZca9DgZH35hWXPh7fMucLt/IPXIRnz2zKEa/Mo6D2V/fx03Mqo0epid7
+AgMBAAGjLzAtMB0GA1UdDgQWBBRQa57tXz3rZNRz+fTbo3w3jQJMBTAMBgNVHRME
+BTADAQH/MA0GCSqGSIb3DQEBCwUAA0EAm0iY9cr+gvC+vcQIebdofpQ4GcDW8U6W
+Bxs8ZXinLl69P0jYLum3+XITNFRiyQqcivaxdxthxDNOX7P+aKwkJA==
+-----END CERTIFICATE-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/nid_uid_test_cert.pem 43.0.0-1ubuntu1/rust-vendor/openssl/test/nid_uid_test_cert.pem
--- 43.0.0-1/rust-vendor/openssl/test/nid_uid_test_cert.pem	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/nid_uid_test_cert.pem	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,24 @@
+-----BEGIN CERTIFICATE-----
+MIIEGTCCAwGgAwIBAgIJAItKTzcGfL1lMA0GCSqGSIb3DQEBCwUAMIGiMSIwIAYK
+CZImiZPyLGQBAQwSdGhpcyBpcyB0aGUgdXNlcklkMQswCQYDVQQGEwJVUzETMBEG
+A1UECAwKQ2FsaWZvcm5pYTESMBAGA1UEBwwJU3Vubnl2YWxlMRUwEwYDVQQKDAxS
+dXN0IE9wZW5TU0wxDDAKBgNVBAsMA09TUzEhMB8GA1UEAwwYcnVzdC1vcGVuc3Ns
+LmV4YW1wbGUuY29tMB4XDTE2MDIwMjE3MjIwMVoXDTE2MDMwMzE3MjIwMVowgaIx
+IjAgBgoJkiaJk/IsZAEBDBJ0aGlzIGlzIHRoZSB1c2VySWQxCzAJBgNVBAYTAlVT
+MRMwEQYDVQQIDApDYWxpZm9ybmlhMRIwEAYDVQQHDAlTdW5ueXZhbGUxFTATBgNV
+BAoMDFJ1c3QgT3BlblNTTDEMMAoGA1UECwwDT1NTMSEwHwYDVQQDDBhydXN0LW9w
+ZW5zc2wuZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
+AQDa3Gc+IE5DOhTv1m5DZW8qKiyNLd7v4DaAYLXSsDuLs+9wJ+Bs+wlBfrg+PT0t
+EJlPaLL9IfD5eR3WpFu62TUexYhnJh+3vhCGsFHOXcTjtM+wy/dzZtOVh2wTzvqE
+/FHBGw1eG3Ww+RkSFbwYmtm8JhIN8ffYxGn2O0yQpxypf5hNPYrC81zX+52X2w1h
+jDYLpYt55w+e6q+iRRFk0tKiWHEqqh/r6UQQRpj2EeS+xTloZlO6h0nl2NPkVF3r
+CXBoT8Ittxr7sqcYqf8TAA0I4qZRYXKYehFmv/VkSt85CcURJ/zXeoJ1TpxSvQie
+2R9cRDkYROrIOAFbB/0mmHLBAgMBAAGjUDBOMB0GA1UdDgQWBBRKfPqtgrbdbTmH
+XR6RC/p8t/65GjAfBgNVHSMEGDAWgBRKfPqtgrbdbTmHXR6RC/p8t/65GjAMBgNV
+HRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQCKfeGRduGsIwKNiGcDUNkNrc7Z
+f8SWAmb/R6xiDfgjbhrtfBDowIZ5natEkTgf6kQPMJKyjg2NEM2uJWBc55rLOHIv
+es1wQOlYjfEUmFD3lTIt2TM/IUgXn2j+zV1CRkJthQLVFChXsidd0Bqq2fBjd3ad
+Yjzrxf3uOTBAs27koh2INNHfcUZCRsx8hP739zz2kw/r5NB/9iyENEyJKQvxo0jb
+oN0JK2joGZrWetDukQrqf032TsdkboW5JresYybbAD3326Ljp+hlT/3WINc+3nZJ
+Dn+pPMdpuZ5BUZ+u+XyNEPum3k3P3K19AF+zWYGooX0J1cmuCBrrqce20Lwy
+-----END CERTIFICATE-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/pkcs1.pem.pub 43.0.0-1ubuntu1/rust-vendor/openssl/test/pkcs1.pem.pub
--- 43.0.0-1/rust-vendor/openssl/test/pkcs1.pem.pub	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/pkcs1.pem.pub	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,8 @@
+-----BEGIN RSA PUBLIC KEY-----
+MIIBCgKCAQEAyrcf7lv42BCoiDd3LYmF8eaGO4rhmGzGgi+NSZowkEuLhibHGQle
+FkZC7h1VKsxKFgy7Fx+GYHkv9OLm9H5fdp3HhYlo19bZVGvSJ66OJe/Bc4S02bBb
+Y8vwpc/N5O77m5J/nHLuL7XJtpfSKkX+3NPiX1X2L99iipt7F0a7hNws3G3Lxg6t
+P3Yc55TPjXzXvDIgjt/fag6iF8L/bR3augJJdDhLzNucR8A5HcvPtIVo51R631Zq
+MCh+dZvgz9zGCXwsvSky/iOJTHN3wnpsWuCAzS1iJMfjR783Tfv6sWFs19FH7pHP
+xBA3b2enPM9KBzINGOly0eM4h0fh+VBltQIDAQAB
+-----END RSA PUBLIC KEY-----
Binary files 43.0.0-1/rust-vendor/openssl/test/pkcs8-nocrypt.der and 43.0.0-1ubuntu1/rust-vendor/openssl/test/pkcs8-nocrypt.der differ
Binary files 43.0.0-1/rust-vendor/openssl/test/pkcs8.der and 43.0.0-1ubuntu1/rust-vendor/openssl/test/pkcs8.der differ
diff -pruN 43.0.0-1/rust-vendor/openssl/test/root-ca.key 43.0.0-1ubuntu1/rust-vendor/openssl/test/root-ca.key
--- 43.0.0-1/rust-vendor/openssl/test/root-ca.key	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/root-ca.key	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpQIBAAKCAQEArVHWFn52Lbl1l59exduZntVSZyDYpzDND+S2LUcO6fRBWhV/
+1Kzox+2GZptbuMGmfI3iAnb0CFT4uC3kBkQQlXonGATSVyaFTFR+jq/lc0SP+9Bd
+7SBXieIVeIXlY1TvlwIvj3Ntw9zX+scTA4SXxH6M0rKv9gTOub2vCMSHeF16X8DQ
+r4XsZuQr7Cp7j1I4aqOJyap5JTl5ijmG8cnu0n+8UcRlBzy99dLWJG0AfI3VRJdW
+pGTNVZ92aFff3RpK3F/WI2gp3qV1ynRAKuvmncGC3LDvYfcc2dgsc1N6Ffq8GIrk
+gRob6eBcklDHp1d023Lwre+VaVDSo1//Y72UFwIDAQABAoIBAGZrnd/dC2kp11uq
+Sg8SHk3GMdPPjTf/lq51sVJAU4fdV2Eso0XCiCzdKDcqR6F+jiu8jHp4YO0riW8N
+b1pkjohGjyOaddIaaVsZ80/OkgDz20Ird9XQ7uoEODvopA12+755BDH5PDwqHVeM
+nKfPiwAK6Jz6CxGO9bq9ZNoBiSyO1uofaB4Cpp8t74XVeAuPiI/Bb6WJ8TW5K5dt
+x0Jihdo46QgZR+z4PnyWIoACkhSoQmtTb9NUrpKceBcxdCrZ/kEmYpnPq/PuSw6g
+6HthjYP/H9Xulz69UR5Ez6z+1pU1rKFmQ46qK7X3zVHg233MlGekMzxdmShEjzCP
+BMGYpQECgYEA5tqTZsUJwx3HDhkaZ/XOtaQqwOnZm9wPwTjGbV1t4+NUJzsl5gjP
+ho+I8ZSGZ6MnNSh+ClpYhUHYBq0rTuAAYL2arcMOuOs1GrMmiZJbXm8zq8M7gYr5
+V99H/7akSx66WV/agPkLIvh/BWxlWgQcoVAIzZibbLUxr7Ye50pCLfECgYEAwDLn
+mFz0mFMvGtaSp8RnTDTFCz9czCeDt0GujCxG1epdvtuxlg/S1QH+mGzA/AHkiu7z
+uzCwGKWozNTdRkqVwYoJTB+AYHseSkuGP+a1zr39w+xBW/vESb2oP95GIwprXcG2
+b/qdeQVzuLQhYoqWI2u8CBwlHFfpQO4Bp2ea+ocCgYEAurIgLSfCqlpFpiAlG9hN
+8NYwgU1d4E+LKj+JMd8yRO+PGh8amjub4X3pST5NqDjpN3Nk42iHWFWUqGmZsbM0
+ewg7tLUgDeqiStKBoxaK8AdMqWc9k5lZ53e6mZISsnHKUQdVBaLjH8gJqdAs8yyK
+HudEB0mYwMSUxz6pJXIHrXECgYEAhJkaCpXm8chB8UQj/baUhZDKeI4IWZjRWHbq
+Ey7g1+hPMMOk6yCTlf1ARqyRH8u2ftuIL5bRhs+Te21IE5yVYOb4rxn0mZuXNC6S
+ujdTKwUMtESkeu9hZnaAQz/4J2ii1hY05WCDj+DhC4bKmY9/MYS8PuQb/kfwVqld
+Xr8tvrUCgYEAmslHocXBUFXyRDkEOx/aKo+t9fPBr95PBZzFUt9ejrTP4PXsLa46
+3/PNOCGdrQxh5qHHcvLwR4bPL++Dj+qMUTJXANrArKPDpE2WqH6pqWIC6yaZvzUk
+17QbpXR6bHcdJV045pWpw40UCStTocVynY1lBfOw8VqxBIBlpVBBzew=
+-----END RSA PRIVATE KEY-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/root-ca.pem 43.0.0-1ubuntu1/rust-vendor/openssl/test/root-ca.pem
--- 43.0.0-1/rust-vendor/openssl/test/root-ca.pem	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/root-ca.pem	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,21 @@
+-----BEGIN CERTIFICATE-----
+MIIDXTCCAkWgAwIBAgIJAOIvDiVb18eVMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV
+BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX
+aWRnaXRzIFB0eSBMdGQwHhcNMTYwODE0MTY1NjExWhcNMjYwODEyMTY1NjExWjBF
+MQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50
+ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
+CgKCAQEArVHWFn52Lbl1l59exduZntVSZyDYpzDND+S2LUcO6fRBWhV/1Kzox+2G
+ZptbuMGmfI3iAnb0CFT4uC3kBkQQlXonGATSVyaFTFR+jq/lc0SP+9Bd7SBXieIV
+eIXlY1TvlwIvj3Ntw9zX+scTA4SXxH6M0rKv9gTOub2vCMSHeF16X8DQr4XsZuQr
+7Cp7j1I4aqOJyap5JTl5ijmG8cnu0n+8UcRlBzy99dLWJG0AfI3VRJdWpGTNVZ92
+aFff3RpK3F/WI2gp3qV1ynRAKuvmncGC3LDvYfcc2dgsc1N6Ffq8GIrkgRob6eBc
+klDHp1d023Lwre+VaVDSo1//Y72UFwIDAQABo1AwTjAdBgNVHQ4EFgQUbNOlA6sN
+XyzJjYqciKeId7g3/ZowHwYDVR0jBBgwFoAUbNOlA6sNXyzJjYqciKeId7g3/Zow
+DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAVVaR5QWLZIRR4Dw6TSBn
+BQiLpBSXN6oAxdDw6n4PtwW6CzydaA+creiK6LfwEsiifUfQe9f+T+TBSpdIYtMv
+Z2H2tjlFX8VrjUFvPrvn5c28CuLI0foBgY8XGSkR2YMYzWw2jPEq3Th/KM5Catn3
+AFm3bGKWMtGPR4v+90chEN0jzaAmJYRrVUh9vea27bOCn31Nse6XXQPmSI6Gyncy
+OAPUsvPClF3IjeL1tmBotWqSGn1cYxLo+Lwjk22A9h6vjcNQRyZF2VLVvtwYrNU3
+mwJ6GCLsLHpwW/yjyvn8iEltnJvByM/eeRnfXV6WDObyiZsE/n6DxIRJodQzFqy9
+GA==
+-----END CERTIFICATE-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/rsa-encrypted.pem 43.0.0-1ubuntu1/rust-vendor/openssl/test/rsa-encrypted.pem
--- 43.0.0-1/rust-vendor/openssl/test/rsa-encrypted.pem	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/rsa-encrypted.pem	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,30 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: AES-128-CBC,E2F16153E2BA3D617285A68C896BA6AF
+
+vO9SnhtGjGe8pG1pN//vsONnvJr+DjU+lFCiSqGMPT7tezDnbehLfS+9kus2HV7r
+HmI14JvVG9O7NpF7zMyBRlHYdWcCCWED9Yar0NsWN9419e5pMe/bqIXAzAiJbtT4
+OB9U5XF3m+349zjN1dVXPPLGRmMC1pcHAlofeb5nIUFTvUi5xcsbe1itGjgkkvHb
+Bt8NioHTBun8kKrlsFQOuB55ylBU/eWG8DQBtvFOmQ7iWp0RnGQfh8k5e5rcZNpQ
+fD9ygc7UVISl0xTrIG4IH15g34H+nrBauKtIPOpNPuXQPOMHCZv3XH8wnhrWHHwT
+ZFnQBdXbSpQtMsRh0phG2G+VIlyCgSn4+CxjCJ+TgFtsoK/tU0unmRYc59QnTxxb
+qkHYsPs3E0NApQAgH1ENEGl1M+FGLYQH7gftjc3ophBTeRA17sRmD7Y4QBInggsq
+Gv6tImPVBdekAjz/Ls/EyMwjAvvrL5eAokqrIsAarGo+zmbJKHzknw2KUz2En0+k
+YYaxB4oy9u7bzuQlvio6xYHJEb4K197bby4Dldmqv7YCCJBJwhOBAInMD687viKv
+vcUwL8YuS6cW5E8MbvEENlY4+lvKKj3M8Bnyb79cYIPQe92EuCwXU9DZXPRMLwwM
+oFEJpF5E/PmNJzu+B52ahHtDrh83WSx71fWqjdTqwkPZhAYo3ztsfFkb/UqUcq8u
+rBSebeUjZh0XZ9B04eshZQ5vJUcXGtYIe/77beV3Pv89/fw+zTZjpiP9Q3sZALzf
+Qt0YGp0/6qBuqR1tcqdu65AS2hun7yFw7uRavqYKvww4axRiz2do+xWmZFuoCAwD
+EWktaUujltpvAc1lo7lg4C6nByefJB9Xqk22N/vpqOsWr1NbAntT42Qj/HF9BVWR
+osvN3yMnKYWYe6oSTVnNBDM5obWAIHd3I9gcxTOTb1KsEwt2RrDs5EpB5ptS3Fjo
+JfBRhNZQ3cXttrIIhsHgDn9BDNg865/xpIgktKj0gEd60Abx0PqkAIm6IZTh4Efg
+7uZwfzxB+saOcddbrW2gNdzVZMC0s2Ye3sqHhtLbAJ3BlXYTxE4CAvTg54Ny+5hF
+IjvjlOKgXceSG1cSfk21/wyp9RY3Ft0AEYvvp0kZScWZaoA2aSFDUrchXVhgrEbn
+lJ7UptjefwRFIreAlwbKSbIDDNWnyzvIWyHfQ2aYqgnb7W7XqNPSgH9cALCfzirI
+dlRHjha0bMUtrjPCC/YfMXzJBVniy0gG6Pd5uC7vz/Awn6/6HRQVNaTQASphPBQ7
+bJuz+JTfzI9OUVCMRMdnb6b35U4P9tibFmnPvzTIPe+3WUmf8aRsLS3NN3G1Webd
+PMYVZpMycPaAI0Ht87axhsOzlxCWHYWjdHa+WoNNc1J90TxLCmAHquh5BDaWvjMK
+0DySftJZjV7Tf1p2KosmU83LRl39B5NHMbZb1xOEZl9IWwhT/PVKTVZ25xdxWLfb
+hF4l8rfvKehIp5r4t8zW1bvI2Hl6vrUvmcUVWt3BfKjxlgwRVD0vvwonMt1INesF
+204vUBeXbDsUUicLwOyUgaFvJ3XU3dOyvL9MhOgM5OgoFRRhG+4AS8a5JCD8iLtq
+-----END RSA PRIVATE KEY-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/rsa.pem 43.0.0-1ubuntu1/rust-vendor/openssl/test/rsa.pem
--- 43.0.0-1/rust-vendor/openssl/test/rsa.pem	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/rsa.pem	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEAofgWCuLjybRlzo0tZWJjNiuSfb4p4fAkd/wWJcyQoTbji9k0
+l8W26mPddxHmfHQp+Vaw+4qPCJrcS2mJPMEzP1Pt0Bm4d4QlL+yRT+SFd2lZS+pC
+gNMsD1W/YpRPEwOWvG6b32690r2jZ47soMZo9wGzjb/7OMg0LOL+bSf63kpaSHSX
+ndS5z5rexMdbBYUsLA9e+KXBdQOS+UTo7WTBEMa2R2CapHg665xsmtdVMTBQY4uD
+Zlxvb3qCo5ZwKh9kG4LT6/I5IhlJH7aGhyxXFvUK+DWNmoudF8NAco9/h9iaGNj8
+q2ethFkMLs91kzk2PAcDTW9gb54h4FRWyuXpoQIDAQABAoIBABKucaRpzQorw35S
+bEUAVx8dYXUdZOlJcHtiWQ+dC6V8ljxAHj/PLyzTveyI5QO/xkObCyjIL303l2cf
+UhPu2MFaJdjVzqACXuOrLot/eSFvxjvqVidTtAZExqFRJ9mylUVAoLvhowVWmC1O
+n95fZCXxTUtxNEG1Xcc7m0rtzJKs45J+N/V9DP1edYH6USyPSWGp6wuA+KgHRnKK
+Vf9GRx80JQY7nVNkL17eHoTWEwga+lwi0FEoW9Y7lDtWXYmKBWhUE+U8PGxlJf8f
+40493HDw1WRQ/aSLoS4QTp3rn7gYgeHEvfJdkkf0UMhlknlo53M09EFPdadQ4TlU
+bjqKc50CgYEA4BzEEOtIpmVdVEZNCqS7baC4crd0pqnRH/5IB3jw3bcxGn6QLvnE
+tfdUdiYrqBdss1l58BQ3KhooKeQTa9AB0Hw/Py5PJdTJNPY8cQn7ouZ2KKDcmnPG
+BY5t7yLc1QlQ5xHdwW1VhvKn+nXqhJTBgIPgtldC+KDV5z+y2XDwGUcCgYEAuQPE
+fgmVtjL0Uyyx88GZFF1fOunH3+7cepKmtH4pxhtCoHqpWmT8YAmZxaewHgHAjLYs
+p1ZSe7zFYHj7C6ul7TjeLQeZD/YwD66t62wDmpe/HlB+TnBA+njbglfIsRLtXlnD
+zQkv5dTltRJ11BKBBypeeF6689rjcJIDEz9RWdcCgYAHAp9XcCSrn8wVkMVkKdb7
+DOX4IKjzdahm+ctDAJN4O/y7OW5FKebvUjdAIt2GuoTZ71iTG+7F0F+lP88jtjP4
+U4qe7VHoewl4MKOfXZKTe+YCS1XbNvfgwJ3Ltyl1OH9hWvu2yza7q+d5PCsDzqtm
+27kxuvULVeya+TEdAB1ijQKBgQCH/3r6YrVH/uCWGy6bzV1nGNOdjKc9tmkfOJmN
+54dxdixdpozCQ6U4OxZrsj3FcOhHBsqAHvX2uuYjagqvo3cOj1TRqNocX40omfCC
+Mx3bD1yPPf/6TI2XECva/ggqEY2mYzmIiA5LVVmc5nrybr+lssFKneeyxN2Wq93S
+0iJMdQKBgCGHewxzoa1r8ZMD0LETNrToK423K377UCYqXfg5XMclbrjPbEC3YI1Z
+NqMtuhdBJqUnBi6tjKMF+34Xf0CUN8ncuXGO2CAYvO8PdyCixHX52ybaDjy1FtCE
+6yUXjoKNXKvUm7MWGsAYH6f4IegOetN5NvmUMFStCSkh7ixZLkN1
+-----END RSA PRIVATE KEY-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/rsa.pem.pub 43.0.0-1ubuntu1/rust-vendor/openssl/test/rsa.pem.pub
--- 43.0.0-1/rust-vendor/openssl/test/rsa.pem.pub	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/rsa.pem.pub	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,9 @@
+-----BEGIN PUBLIC KEY-----
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAofgWCuLjybRlzo0tZWJj
+NiuSfb4p4fAkd/wWJcyQoTbji9k0l8W26mPddxHmfHQp+Vaw+4qPCJrcS2mJPMEz
+P1Pt0Bm4d4QlL+yRT+SFd2lZS+pCgNMsD1W/YpRPEwOWvG6b32690r2jZ47soMZo
+9wGzjb/7OMg0LOL+bSf63kpaSHSXndS5z5rexMdbBYUsLA9e+KXBdQOS+UTo7WTB
+EMa2R2CapHg665xsmtdVMTBQY4uDZlxvb3qCo5ZwKh9kG4LT6/I5IhlJH7aGhyxX
+FvUK+DWNmoudF8NAco9/h9iaGNj8q2ethFkMLs91kzk2PAcDTW9gb54h4FRWyuXp
+oQIDAQAB
+-----END PUBLIC KEY-----
diff -pruN 43.0.0-1/rust-vendor/openssl/test/subca.crt 43.0.0-1ubuntu1/rust-vendor/openssl/test/subca.crt
--- 43.0.0-1/rust-vendor/openssl/test/subca.crt	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl/test/subca.crt	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,88 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            13:ae:da:d8:f4:18:d7:73:b8:bd:35:c9:ce:8e:b3:fc
+        Signature Algorithm: sha256WithRSAEncryption
+        Issuer: CN=TestCA
+        Validity
+            Not Before: Jun  6 19:11:19 2019 GMT
+            Not After : May 21 19:11:19 2022 GMT
+        Subject: CN=SubCA
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                RSA Public-Key: (2048 bit)
+                Modulus:
+                    00:b0:09:fc:54:e7:6a:9f:0c:bd:ad:5a:8d:ef:94:
+                    4e:11:a6:87:19:4f:bf:a6:e1:62:a5:2d:b7:17:df:
+                    67:53:70:da:fe:7d:99:17:ee:13:47:0b:40:0b:a2:
+                    34:32:a9:d3:bf:20:fc:13:77:a1:d5:26:60:1f:f0:
+                    d4:be:dc:76:7c:1e:6c:b4:4c:01:7c:56:cd:5c:53:
+                    ec:81:b3:81:2a:b2:35:26:06:5a:79:e0:b3:9e:e4:
+                    57:e1:09:de:ad:7f:c8:cd:87:ee:49:93:30:52:58:
+                    b2:bc:0f:c1:b6:10:44:f8:85:d5:5b:0a:9b:28:fe:
+                    f4:f4:4a:16:a6:f7:25:e9:96:47:69:73:5b:33:77:
+                    92:7d:61:8d:2a:3d:d5:04:89:40:bf:6b:d2:fd:5d:
+                    e2:1a:80:a9:8e:c8:92:f6:e5:4c:00:84:f9:6e:2a:
+                    93:a3:23:ee:28:23:81:f4:54:f0:18:2c:ee:32:8e:
+                    38:9c:a0:c8:33:04:b0:fc:4c:43:1a:5c:04:84:9f:
+                    73:c6:08:c7:1d:64:39:fe:72:19:3b:cc:a5:fd:0b:
+                    43:25:0d:2b:a9:88:77:9e:62:e6:ac:c2:9a:60:42:
+                    4f:4a:54:47:bc:a0:29:72:7c:38:52:c9:ea:27:c5:
+                    3d:d0:81:4a:3e:b8:78:79:4b:89:b8:4e:6d:1b:24:
+                    15:bd
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 CRL Distribution Points: 
+
+                Full Name:
+                  URI:http://127.0.0.1:8081/pki/test.crl
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+            X509v3 Subject Key Identifier: 
+                FD:82:45:39:A1:91:41:F2:66:CC:0D:75:D5:0D:40:D5:81:A7:A1:43
+            X509v3 Authority Key Identifier: 
+                keyid:C5:CC:F5:A1:8C:D9:E4:A7:BA:EC:21:F5:D1:84:23:EA:0D:C2:C7:30
+                DirName:/CN=TestCA
+                serial:33:E7:04:87:09:32:87:21:D9:CD:7C:AA:4C:5A:BB:2C:6C:7B:54:28
+
+            X509v3 Key Usage: 
+                Certificate Sign, CRL Sign
+    Signature Algorithm: sha256WithRSAEncryption
+         96:a0:ff:8a:4b:bd:45:96:c9:72:3c:63:e3:48:c4:ab:ef:7e:
+         db:76:3f:d9:02:9e:69:c8:d9:36:55:e1:f5:9b:c9:69:d8:69:
+         02:ac:50:8c:60:94:2c:2e:b9:a8:65:ac:f5:00:b0:8b:96:25:
+         0b:8a:ef:94:21:57:e2:04:c2:c3:86:bf:06:4e:91:5c:e6:bc:
+         1b:03:31:8b:64:ea:c5:79:c3:5c:94:e5:aa:67:7e:74:12:07:
+         14:fd:cd:32:02:26:26:c9:0a:ed:d4:da:ee:2a:84:e3:f1:60:
+         b3:09:77:27:a1:3c:ac:ec:61:18:30:b5:6d:1f:16:0a:24:1a:
+         cf:1c:1b:60:a5:60:e5:2c:8b:cf:37:83:0c:15:e7:79:30:3f:
+         ee:50:45:7c:4b:c6:2c:cd:2c:81:0a:98:f1:65:44:7a:ca:2a:
+         20:1a:de:19:d9:4b:ca:a1:e2:a4:b5:14:47:bf:b4:68:15:03:
+         c0:55:e5:f4:47:0e:55:9f:fe:85:d8:2c:7d:d0:1a:96:11:b9:
+         68:b7:74:1e:61:94:c1:ae:87:52:2d:c6:26:ba:51:ed:f1:91:
+         c0:e6:4c:f8:ad:02:23:75:51:fc:f8:69:05:ec:cf:31:50:5a:
+         41:78:eb:3d:27:4d:9b:68:ef:ba:0e:ba:3a:7d:60:00:9d:53:
+         a5:08:3d:c6
+-----BEGIN CERTIFICATE-----
+MIIDbDCCAlSgAwIBAgIQE67a2PQY13O4vTXJzo6z/DANBgkqhkiG9w0BAQsFADAR
+MQ8wDQYDVQQDDAZUZXN0Q0EwHhcNMTkwNjA2MTkxMTE5WhcNMjIwNTIxMTkxMTE5
+WjAQMQ4wDAYDVQQDDAVTdWJDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
+ggEBALAJ/FTnap8Mva1aje+UThGmhxlPv6bhYqUttxffZ1Nw2v59mRfuE0cLQAui
+NDKp078g/BN3odUmYB/w1L7cdnwebLRMAXxWzVxT7IGzgSqyNSYGWnngs57kV+EJ
+3q1/yM2H7kmTMFJYsrwPwbYQRPiF1VsKmyj+9PRKFqb3JemWR2lzWzN3kn1hjSo9
+1QSJQL9r0v1d4hqAqY7IkvblTACE+W4qk6Mj7igjgfRU8Bgs7jKOOJygyDMEsPxM
+QxpcBISfc8YIxx1kOf5yGTvMpf0LQyUNK6mId55i5qzCmmBCT0pUR7ygKXJ8OFLJ
+6ifFPdCBSj64eHlLibhObRskFb0CAwEAAaOBwDCBvTAzBgNVHR8ELDAqMCigJqAk
+hiJodHRwOi8vMTI3LjAuMC4xOjgwODEvcGtpL3Rlc3QuY3JsMAwGA1UdEwQFMAMB
+Af8wHQYDVR0OBBYEFP2CRTmhkUHyZswNddUNQNWBp6FDMEwGA1UdIwRFMEOAFMXM
+9aGM2eSnuuwh9dGEI+oNwscwoRWkEzARMQ8wDQYDVQQDDAZUZXN0Q0GCFDPnBIcJ
+Moch2c18qkxauyxse1QoMAsGA1UdDwQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAQEA
+lqD/iku9RZbJcjxj40jEq+9+23Y/2QKeacjZNlXh9ZvJadhpAqxQjGCULC65qGWs
+9QCwi5YlC4rvlCFX4gTCw4a/Bk6RXOa8GwMxi2TqxXnDXJTlqmd+dBIHFP3NMgIm
+JskK7dTa7iqE4/Fgswl3J6E8rOxhGDC1bR8WCiQazxwbYKVg5SyLzzeDDBXneTA/
+7lBFfEvGLM0sgQqY8WVEesoqIBreGdlLyqHipLUUR7+0aBUDwFXl9EcOVZ/+hdgs
+fdAalhG5aLd0HmGUwa6HUi3GJrpR7fGRwOZM+K0CI3VR/PhpBezPMVBaQXjrPSdN
+m2jvug66On1gAJ1TpQg9xg==
+-----END CERTIFICATE-----
Binary files 43.0.0-1/rust-vendor/openssl/test/test.crl and 43.0.0-1ubuntu1/rust-vendor/openssl/test/test.crl differ
diff -pruN 43.0.0-1/rust-vendor/openssl-macros/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/openssl-macros/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/openssl-macros/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-macros/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"Cargo.toml":"a0f4f5f613ead670c0512bf5f42c0426c8c3ab119f3737c6119190a5a34b657d","LICENSE-APACHE":"c6596eb7be8581c18be736c846fb9173b69eccf6ef94c5135893ec56bd92ba08","LICENSE-MIT":"ea5ab440900ab271811d5c2dc02a9de6e03a6956ac5727e85c11d76df5883d30","src/lib.rs":"a53de10a52f0870e854ed7575d35eba46165f9eaf9f69d1abfff141d2e2aaf33"},"package":"a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/openssl-macros/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/openssl-macros/Cargo.toml
--- 43.0.0-1/rust-vendor/openssl-macros/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-macros/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,30 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2018"
+name = "openssl-macros"
+version = "0.1.1"
+description = "Internal macros used by the openssl crate."
+license = "MIT/Apache-2.0"
+
+[lib]
+proc-macro = true
+
+[dependencies.proc-macro2]
+version = "1"
+
+[dependencies.quote]
+version = "1"
+
+[dependencies.syn]
+version = "2"
+features = ["full"]
diff -pruN 43.0.0-1/rust-vendor/openssl-macros/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/openssl-macros/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/openssl-macros/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-macros/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,202 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "{}"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright {yyyy} {name of copyright owner}
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
diff -pruN 43.0.0-1/rust-vendor/openssl-macros/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/openssl-macros/LICENSE-MIT
--- 43.0.0-1/rust-vendor/openssl-macros/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-macros/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,19 @@
+Copyright (c) 2022 Steven Fackler
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/openssl-macros/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/openssl-macros/src/lib.rs
--- 43.0.0-1/rust-vendor/openssl-macros/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-macros/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,32 @@
+#![allow(clippy::uninlined_format_args)]
+
+use proc_macro::TokenStream;
+use proc_macro2::Ident;
+use quote::quote;
+use syn::{parse_macro_input, ItemFn};
+
+#[proc_macro_attribute]
+pub fn corresponds(attr: TokenStream, item: TokenStream) -> TokenStream {
+    let function = parse_macro_input!(attr as Ident);
+    let item = parse_macro_input!(item as ItemFn);
+
+    let function = function.to_string();
+    let line = format!(
+        "This corresponds to [`{0}`](https://www.openssl.org/docs/manmaster/man3/{0}.html).",
+        function
+    );
+
+    let attrs = item.attrs;
+    let vis = item.vis;
+    let sig = item.sig;
+    let block = item.block;
+
+    let out = quote! {
+        #(#attrs)*
+        #[doc = ""]
+        #[doc = #line]
+        #[doc(alias = #function)]
+        #vis #sig #block
+    };
+    out.into()
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/openssl-sys/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/openssl-sys/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4 @@
+{
+  "files": {},
+  "package": "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6"
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/CHANGELOG.md 43.0.0-1ubuntu1/rust-vendor/openssl-sys/CHANGELOG.md
--- 43.0.0-1/rust-vendor/openssl-sys/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,671 @@
+# Change Log
+
+## [Unreleased]
+
+## [v0.9.103] - 2024-07-20
+
+### Added
+
+* Added several functions and constants for datagram `BIO`s.
+* Added `EVP_PKEY_set1_DSA`, `EVP_PKEY_set1_DH`, and `EVP_PKEY_set1_EC_KEY`.
+* Added several functions related to QUIC support.
+
+## [v0.9.102] - 2024-03-28
+
+### Added
+
+* Added support for LibreSSL 3.9.x.
+
+## [v0.9.101] - 2024-02-21
+
+### Fixed
+
+* Fixed a bug where, when building with the `vendored` feature, this crate always needed to be rebuilt.
+
+## [v0.9.100] - 2024-02-19
+
+### Added
+
+* Added `OSSL_PARAM`, `OSSL_PARAM_construct_uint` , `OSSL_PARAM_construct_end`.
+* Added `EVP_PKEY_CTX_set_params` and `EVP_PKEY_CTX_get_params`.
+* Added `X509_alias_get0`.
+* Added `EVP_default_properties_enable_fips`.
+
+## [v0.9.99] - 2024-01-19
+
+### Added
+
+* On macOS added Homebrew's `openssl@3.0` to the list of candidates to build against.
+* `NID_brainpoolP256r1`, `NID_brainpoolP320r1`, `NID_brainpoolP384r1`, and `NID_brainpoolP512r1` are now available on LibreSSL.
+
+### Changed
+
+* `X509_PURPOSE` is now opaque on LibreSSL 3.9.0+.
+
+## [v0.9.98] - 2023-12-22
+
+### Added
+
+* Added `RAND_priv_bytes`.
+* Added `NID_brainpoolP320r1`.
+
+### Changed
+
+* `X509_PURPOSE_get0` now returns a `const` pointer on LibreSSL 3.9.0+.
+* `X509V3_EXT_add_alias` is removed on LibreSSL 3.9.0+.
+
+## [v0.9.97] - 2023-12-04
+
+### Changed
+
+* libatomic is no longer dynamically linked for 32 bit ARM targets.
+
+### Added
+
+* Added `SSL_read_ex`, `SSL_peek_ex`, and `SSL_write_ex`.
+
+## [v0.9.96] - 2023-11-22
+
+### Changed
+
+* `EVP_chacha20` is now available on LibreSSL
+
+### Added
+
+* Added `EVP_des_ede3_ecb`, `EVP_des_ede3_cfb8`, `EVP_des_ede3_ofb`, `EVP_camellia_128_ofb`, `EVP_camellia_192_ofb`, `EVP_camellia_256_ofb`, `EVP_cast5_ofb`, `EVP_idea_ofb`
+* Added `X509_STORE_get1_all_certs`
+* Added `SSL_CTRL_GET_PEER_TMP_KEY`, `SSL_CTRL_GET_TMP_KEY`, `SSL_get_peer_tmp_key`, `SSL_get_tmp_key`
+
+## [v0.9.95] - 2023-11-03
+
+### Changed
+
+* Fixed the availability of `EVP_PKEY_RSA_PSS` on OpenSSL
+
+### Added
+
+* Added support for LibreSSL 3.8.x.
+* Added `NID_chacha20_poly1305`
+
+## [v0.9.94] - 2023-11-01
+
+### Changed
+
+* `X509_ALGOR` is now opaque on new LibreSSL releases
+
+### Added
+
+* Added support for building with `OPENSSL_NO_SCRYPT`
+* Added `EVP_PKEY_RSA_PSS` and `EVP_PKEY_DHX`
+* Functions and constants for using HKDF `EVP_PKEY` are now available on LibreSSL.
+* Added `SSL_CTX_set_security_level`, `SSL_set_security_level`, `SSL_CTX_get_security_level`, `SSL_get_security_level`
+* Added `X509_check_host`, `X509_check_email`, `X509_check_ip`, `X509_check_ip_asc`
+
+## [v0.9.93] - 2023-09-04
+
+### Changed
+
+* The `vendored` Cargo feature now builds OpenSSL 3.1, as 1.1.1 is reaching its EOL.
+
+### Added
+
+* Added support for LibreSSL 3.8.1.
+
+## [v0.9.92] - 2023-08-27
+
+### Added
+
+* Added `EVP_CIPHER_CTX_copy`
+* Expose `EVP_chacha20_poly1305` on LibreSSL
+* Added `X509_VERIFY_PARAM_set1_email`
+
+## [v0.9.91] - 2023-08-06
+
+### Added
+
+* Expose `poly1305_state`, `CRYPTO_poly1305_init`, `CRYPTO_poly1305_update`, and `CRYPTO_poly1305_finish` on BoringSSL and LibreSSL.
+* Fix detection of libraries on OpenBSD.
+* Added `EC_POINT_point2hex` and `EC_POINT_hex2point`.
+* Added `EVP_PKEY_verify_recover_init`, `EVP_PKEY_verify_recover`, and `EVP_PKEY_CTX_set_signature_md`.
+* Added `EVP_CIPHER_CTX_FLAG_WRAP_ALLOW` and `EVP_CTX_set_flags`.
+* Added `BN_mod_sqrt`.
+
+## [v0.9.90] - 2023-06-20
+
+### Fixed
+
+* Fixed compilation with BoringSSL when building with the bindgen CLI.
+
+## [v0.9.89] - 2023-06-20
+
+### Fixed
+
+* Fixed compilation with recent versions of BoringSSL.
+
+### Added
+
+* Added support for detecting OpenSSL compiled with `OPENSSL_NO_OCB`.
+* Added `EVP_PKEY_SM2` and `NID_sm2`.
+* Added `EVP_PKEY_assign_RSA`, `EVP_PKEY_assign_DSA`, `EVP_PKEY_assign_DH`, and `EVP_PKEY_assign_EC_KEY`.
+* Added `EC_GROUP_get_asn1_flag`.
+* Expose `EC_POINT_get_affine_coordinates` on BoringSSL and LibreSSL.
+* Added `EVP_PKEY_derive_set_peer_ex`.
+
+## [v0.9.88] - 2023-05-30
+
+### Added
+
+* Added support for the LibreSSL 3.8.0.
+* Added support for detecting `OPENSSL_NO_RC4`.
+* Added `OBJ_dup`.
+* Added `ASN1_TYPE_new`, `ASN1_TYPE_set`, `d2i_ASN1_TYPE`, and `i2d_ASN1_TYPE`.
+* Added `SSL_bytes_to_cipher_list`, `SSL_CTX_get_num_tickets`, and `SSL_get_num_tickets`.
+* Added `GENERAL_NAME_set0_othername`.
+* Added `X509_get_pathlen`.
+
+## [v0.9.87] - 2023-04-24
+
+### Added
+
+* Added `DH_CHECK`.
+* Added `CMAC_CTX_new`, `CMAC_CTX_free`, `CMAC_Init`, `CMAC_Update`, `CMAC_Final`, and `CMAC_CTX_copy`.
+* Added `EVP_default_properties_is_fips_enabled`.
+* Added `X509_get0_subject_key_id`, `X509_get0_authority_key_id`, `X509_get0_authority_issuer`, and `X509_get0_authority_serial`.
+* Added `NID_poly1305`.
+
+
+## [v0.9.86] - 2023-04-20
+
+### Fixed
+
+* Fixed BoringSSL support with the latest bindgen release.
+
+### Added
+
+* Added bindings for PKCS#7 functions and more X.509 functions.
+
+
+## [v0.9.85] - 2023-04-09
+
+### Added
+
+* Added support for LibreSSL 3.7.x.
+
+## [v0.9.84] - 2023-04-01
+
+### Added
+
+* Added `ASN1_INTEGER_dup` and `ASN1_INTEGER_cmp`.
+* Added `stack_st_X509_NAME_ENTRY`.
+* Added `DIST_POINT_NAME`, `DIST_POINT`, `stack_st_DIST_POINT`, `DIST_POINT_free`, and `DIST_POINT_NAME_free`.
+
+## [v0.9.83] - 2023-03-23
+
+### Fixed
+
+* Fixed version checks for LibreSSL.
+
+### Added
+
+* Added `i2d_X509_EXTENSION`.
+* Added `GENERAL_NAME_new`.
+
+## [v0.9.82] - 2023-03-19
+
+### Added
+
+* Added support for LibreSSL 3.7.1.
+* Added support for X25519 and Ed25519 on LibreSSL and BoringSSL.
+
+## [v0.9.81] - 2023-03-14
+
+### Fixed
+
+Fixed builds against OpenSSL built with `no-cast`.
+
+### Added
+
+* Added experimental bindgen support for BoringSSL.
+* Added `X509_VERIFY_PARAM_set_auth_level`, `X509_VERIFY_PARAM_get_auth_level`, and `X509_VERIFY_PARAM_set_purpose`.
+* Added `X509_PURPOSE_*` consts.
+* Added `X509_NAME_add_entry`.
+* Added `X509_load_crl_file`.
+* Added `SSL_set_cipher_list`, `SSL_set_ssl_method`, `SSL_use_PrivateKey_file`, `SSL_use_PrivateKey`, `SSL_use_certificate`, `SSL_use_certificate_chain_file`, `SSL_set_client_CA_list`, `SSL_add_client_CA`, and `SSL_set0_verify_cert_store`.
+* Added `X509_PURPOSE`, `X509_STORE_set_purpose`, and `X509_STORE_set_trust`.
+* Added `SSL_CTX_set_num_tickets`, `SSL_set_num_tickets`, `SSL_CTX_get_num_tickets`, and `SSL_get_num_tickets`.
+* Added `CMS_verify`.
+
+### Removed
+
+* Removed an unnecessary link to libatomic for 32-bit android targets.
+
+## [v0.9.80] - 2022-12-20
+
+### Fixed
+
+* Added `NO_DEPRECATED_3_0` cfg checks for more APIs.
+
+### Added
+
+* Added support for LibreSSL 3.7.0.
+* Added `SSL_CTRL_CHAIN_CERT` and `SSL_add0_chain_cert`.
+* Added `EVP_PKEY_get_security_bits` and `EVP_PKEY_security_bits`.
+* Added `OSSL_PROVIDER_set_default_search_path`.
+
+## [v0.9.79] - 2022-12-06
+
+### Added
+
+* Added `EVP_CIPHER_CTX_num`.
+* Added `X509_LOOKUP_file` and `X509_load_cert_file`.
+
+## [v0.9.78] - 2022-11-23
+
+### Added
+
+* Added support for LibreSSL 3.6.x.
+* Added `NID_brainpoolP256r1`, `NID_brainpoolP384r1`, and `NID_brainpool512r1`.
+* Added `EVP_camellia_128_cfb128`, `EVP_camellia_128_ecb`, `EVP_camellia_192_cfb128`, `EVP_camellia_192_ecb`,
+    `EVP_camellia_256_cfb128`, and `EVP_camellia_256_ecb`.
+* Added `EVP_cast5_cfb64` and `EVP_cast5_ecb`.
+* Added `EVP_idea_cfb64` and `EVP_idea_ecb`.
+* Added `DSA_SIG`, `d2i_DSA_SIG`, `i2d_DSA_SIG`, `DSA_SIG_new`, `DSA_SIG_free`, `DSA_SIG_get0`, and `DSA_SIG_set0`.
+* Added `X509_STORE_set1_param`, `X509_VERIFY_PARAM_new`, `X509_VERIFY_PARAM_set_time`, and
+    `X509_VERIFY_PARAM_set_depth`.
+
+## [v0.9.77] - 2022-10-22
+
+### Added
+
+* Added support for LibreSSL 3.6.0
+* Added `assume_init`.
+
+## [v0.9.76] - 2022-09-26
+
+### Added
+
+* Added `SSL_get_psk_identity_hint` and `SSL_get_psk_identity`.
+* Added SHA-3 NID constants.
+* Added `SSL_OP_PRIORITIZE_CHACHA`.
+* Added `X509_REQ_print`.
+* Added `EVP_MD_CTX_size` and `EVP_MD_CTX_get_size`
+* Added `EVP_MD_CTX_reset`.
+* Added experimental, unstable support for BoringSSL.
+
+### Fixed
+
+* Fixed the deprecation note on `SSL_CTX_set_alpn_select_cb`.
+
+## [v0.9.75] - 2022-07-09
+
+### Added
+
+* Added SM4 bindings.
+* Added `EC_GROUP_set_generator` and `EC_POINT_set_affine_coordinates_GFp`.
+
+## [v0.9.74] - 2022-06-01
+
+### Added
+
+* Added `EVP_MD_block_size`.
+* Added `X509V3_EXT_add_alias`.
+* Added `X509_V_ERR_INVALID_CA` back when building against OpenSSL 3.0.
+
+## [v0.9.73] - 2022-05-02
+
+### Added
+
+* Added support for installations that place libraries in `$OPENSSL_DIR/lib64` in addition to `$OPENSSL_DIR/lib`.
+* Added `X509_issuer_name_hash`.
+* Added `ASN1_string_set`.
+* Added `X509_CRL_dup`, `X509_REQ_dup`, `X509_NAME_dup`, and `X509_dup`.
+* Added `X509_print`.
+* Added support for LibreSSL 3.5.x.
+
+## [v0.9.72] - 2021-12-11
+
+### Changed
+
+* Temporarily downgraded the vendored OpenSSL back to 1.1.1 due to significant performance regressions. We will move
+    back to 3.0.0 when a future release resolves those issues.
+
+### Added
+
+* Added `PKCS12_set_mac`.
+* Added `EVP_PKEY_sign_init`, `EVP_PKEY_sign`, `EVP_PKEY_verify_init`, and `EVP_PKEY_verify`.
+* Added support for LibreSSL 3.4.x.
+
+## [v0.9.71]
+
+### Fixed
+
+* Fixed linkage to static OpenSSL 3.0.0 libraries on some 32 bit Android targets.
+
+### Added
+
+* Added support for LibreSSL 3.4.1.
+* Added `SSL_get_extms_support` and `SSL_CTRL_GET_EXTMS_SUPPORT`.
+* Added `OBJ_create`.
+* Added `EVP_CIPHER_CTX_get0_cipher`, `EVP_CIPHER_CTX_get_block_size`, `EVP_CIPHER_CTX_get_key_length`,
+    `EVP_CIPHER_CTX_get_iv_length`, and `EVP_CIPHER_CTX_get_tag_length`.
+* Added `EVP_CIPHER_free`.
+* Added `EVP_CIPHER_CTX_rand_key`.
+* Added `OSSL_LIB_CTX_new` and `OSSL_LIB_CTX_free`.
+* Added `EVP_CIPHER_fetch`.
+* Added `EVP_MD_fetch` and `EVP_MD_free`.
+* Added `OPENSSL_malloc` and `OPENSSL_free`.
+* Added `EVP_DigestSignUpdate` and `EVP_DigestVerifyUpdate`.
+
+## [v0.9.70] - 2021-10-31
+
+### Fixed
+
+* Fixed linkage to static 3.0.0 OpenSSL libraries on some 32 bit architectures.
+
+## [v0.9.69] - 2021-10-31
+
+### Changed
+
+* Upgraded the vendored OpenSSL to 3.0.0.
+
+### Added
+
+* Added support for automatic detection of Homebrew `openssl@3` installs.
+* Added `EVP_PKEY_Q_keygen` and `EVP_EC_gen`.
+
+## [v0.9.68] - 2021-10-27
+
+### Added
+
+* Added `BN_bn2binpad`.
+* Added `i2d_X509_NAME` and `d2i_X509_NAME`.
+* Added `BN_FLG_MALLOCED`, `BN_FLG_STATIC_DATA`, `BN_FLG_CONSTTIME`, and `BN_FLG_SECURE`.
+* Added `BN_CTX_secure_new`, `BN_secure_new`, `BN_set_flags`, and `BN_get_flags`.
+
+## [v0.9.67] - 2021-09-21
+
+### Added
+
+* Added support for LibreSSL 3.4.0
+
+## [v0.9.66] - 2021-08-17
+
+### Added
+
+* Added `EVP_seed_cbc`, `EVP_seed_cfb128`, `EVP_seed_ecb`, and `EVP_seed_ofb`.
+* Added `OBJ_length` and `OBJ_get0_data`.
+* Added `i2d_PKCS8PrivateKey_bio`.
+
+## [v0.9.65] - 2021-06-21
+
+### Fixed
+
+* Restored the accidentally deleted `PEM_read_bio_X509_CRL` function.
+
+## [v0.9.64] - 2021-06-18
+
+### Added
+
+* Added support for OpenSSL 3.x.x.
+* Added `SSL_peek`.
+* Added `ERR_LIB_ASN1` and `ASN1_R_HEADER_TOO_LONG`.
+* Added `d2i_X509_bio`.
+* Added `OBJ_nid2obj`.
+* Added `RAND_add`.
+* Added `SSL_CTX_set_post_handshake_auth`.
+* Added `COMP_get_type`.
+* Added `X509_get_default_cert_file_env`, `X509_get_default_cert_file`, `X509_get_default_cert_dir_env`, and
+    `X509_get_default_cirt_dir`.
+
+## [v0.9.63] - 2021-05-06
+
+### Added
+
+* Added support for LibreSSL 3.3.x.
+
+## [v0.9.62] - 2021-04-28
+
+### Added
+
+* Added support for LibreSSL 3.3.2.
+* Added `DH_set0_key`.
+* Added `EC_POINT_get_affine_coordinates`.
+
+## [v0.9.61] - 2021-03-13
+
+### Added
+
+* Added support for automatic detection of OpenSSL installations via pkgsrc and MacPorts on macOS.
+* Added various `V_ASN1_*` constants.
+* Added `DH_generate_parameters_ex`.
+* Added `EC_POINT_is_at_infinity` and `EC_POINT_is_on_curve`.
+* Added `EVP_CIPHER_nid`.
+* Added `EVP_sm3`.
+* Added `NID_*` constants related to SM3.
+* Added `PKCS7_get0_signers`.
+* Added `EVP_PKEY_CTX_set0_rsa_oaep_label`.
+* Added `ACCESS_DESCRIPTION` and `ACCESS_DESCRIPTION_free`.
+
+## [v0.9.60] - 2020-12-24
+
+### Added
+
+* Added support for the default Homebrew install directory on ARM.
+* Added `EVP_PKEY_CTX_set_rsa_oaep_md` and `EVP_PKEY_CTRL_RSA_OAEP_MD`.
+
+## [v0.9.59] - 2020-12-09
+
+### Added
+
+* Added support for LibreSSL 3.2.x, 3.3.0, and 3.3.1.
+* Added `DH_generate_parameters`, `DH_generate_key`, `DH_compute_key`, and `DH_size`.
+* Added `NID_X25519`, `NID_X448`, `EVP_PKEY_x25519` and `EVP_PKEY_x448`.
+* Added `OBJ_txt2obj`.
+* Added `d2i_PKCS7` and `i2d_PKCS7`.
+* Added `SRTP_AEAD_AES_128_GCM` and `SRTP_AEAD_AES_256_GCM`.
+
+## [v0.9.58] - 2020-06-05
+
+### Added
+
+* Added `SSL_set_mtu`.
+* Added support for LibreSSL 3.2.0.
+* Added `PEM_read_bio_EC_PUBKEY`, `PEM_write_bio_EC_PUBKEY`, `d2i_EC_PUBKEY`, and `i2d_EC_PUBKEY`.
+* Added `EVP_PKEY_encrypt_init`, `EVP_PKEY_encrypt`, `EVP_PKEY_decrypt_init`, `EVP_PKEY_decrypt`,
+    `EVP_PKEY_get_raw_public_key`, `EVP_PKEY_new_raw_public_key`, `EVP_PKEY_get_raw_private_key`,
+    and `EVP_PKEY_new_raw_private_key`.
+* Added `OBJ_sn2nid`.
+
+## [v0.9.57] - 2020-05-24
+
+### Added
+
+* Added support for LibreSSL 3.1.x.
+
+## [v0.9.56] - 2020-05-07
+
+### Fixed
+
+* Fixed vendored builds on windows-gnu targets.
+
+### Added
+
+* Added support for LibreSSL 3.0.0.
+
+## [v0.9.55] - 2020-04-07
+
+### Fixed
+
+* Fixed windows-msvc library names when using OpenSSL from vcpkg.
+
+### Added
+
+* If the `OPENSSL_NO_VENDOR` environment variable is set, vendoring will not be used even if enabled.
+* Added `SSL_CTX_get_verify_mode` and `SSL_get_verify_mode`.
+* Added `SSL_is_init_finished`.
+* Added `SSL_CTX_set_cert_store`.
+* Added `TLS_server_method` and `TLS_client_method`.
+* Added `X509_STORE_get0_objects`.
+* Added `X509_OBJECT_free`, `X509_OBJECT_get_type`, and `X509_OBJECT_get0_X509`.
+
+## [v0.9.54] - 2020-01-29
+
+### Added
+
+* Added `BIO_CTRL_DGRAM_QUERY_MTU`.
+* Added `EVP_EncryptInit_ex`, `EVP_EncryptFinal_ex`, `EVP_DecryptInit_ex`, and `EVP_DecryptFinal_ex`.
+* Added `EVP_md_null`.
+* Added `EVP_PKCS82PKEY`.
+* Added `PKCS8_PRIV_KEY_INFO`, `d2i_PKCS8_PRIV_KEY_INFO`, and `PKCS8_PRIV_KEY_INFO_free`.
+* Added `SSL_OP_NO_RENEGOTIATION`.
+
+## [v0.9.53] - 2019-11-22
+
+### Added
+
+* Added `ASN1_TIME_diff`.
+* Added `EC_GROUP_order_bits`.
+* Added `EVP_EncodeBlock` and `EVP_DecodeBlock`.
+* Added `SSL_CTRL_SET_GROUPS_LIST`, `SSL_CTRL_SET_SIGALGS_LIST`, `SSL_CTX_set1_groups_list`, and
+    `SSL_CTX_set1_sigalgs_list`.
+* Added `Clone` implementations to `SHA_CTX`, `SHA256_CTX`, and `SHA512_CTX`.
+
+## [v0.9.52] - 2019-10-19
+
+### Added
+
+* Added support for LibreSSL 3.0.x.
+
+## [v0.9.51] - 2019-10-02
+
+### Added
+
+* Added support for LibreSSL 3.0.1.
+
+## [v0.9.50] - 2019-10-02
+
+### Added
+
+* Added `CRYPTO_LOCK_EVP_PKEY`.
+* Added `EVP_PKEY_ED25519` and `EVP_PKEY_ED448`.
+* Added `EVP_DigestSign` and `EVP_DigestVerify`.
+* Added `EVP_PKEY_up_ref`.
+* Added `NID_ED25519` and `NID_ED448`.
+
+## [v0.9.49] - 2019-08-15
+
+### Added
+
+* Added support for LibreSSL 3.0.0.
+
+## [v0.9.48] - 2019-07-19
+
+### Added
+
+* Added `AES_wrap_key` and `AES_unwrap_key`.
+* Added `EC_GROUP_get_cofactor`, `EC_GROUP_get0_generator`, and `EC_POINT_dup`.
+* Added `EVP_aes_128_ofb`, `EVP_aes_192_ecb`, `EVP_aes_192_cbc`, `EVP_aes_192_cfb1`, `EVP_aes_192_cfb8`,
+    `EVP_aes_192_cfb_128`, `EVP_aes_192_ctr`, `EVP_aes_192_ccm`, `EVP_aes_192_gcm`, `EVP_aes_192_ofb`, and
+    `EVP_aes_256_ofb`.
+* Added `PEM_read_bio_CMS` and `PEM_write_bio_CMS`.
+
+## [v0.9.47] - 2019-05-18
+
+### Added
+
+* Added `SSL_CTX_add_client_CA`.
+
+## [v0.9.46] - 2019-05-08
+
+### Added
+
+* Added support for the LibreSSL 2.9.x series.
+
+## [v0.9.45] - 2019-05-03
+
+### Fixed
+
+* Reverted a change to windows-gnu library names that caused regressions.
+
+## [v0.9.44] - 2019-04-30
+
+### Added
+
+* The `DEP_OPENSSL_VENDORED` environment variable tells downstream build scripts if the vendored feature was enabled.
+* Added `EVP_SealInit`, `EVP_SealFinal`, `EVP_EncryptUpdate`, `EVP_OpenInit`, `EVP_OpenFinal`, and `EVP_DecryptUpdate`.
+* Added `EVP_PKEY_size`.
+
+### Fixed
+
+* Fixed library names when targeting windows-gnu and pkg-config fails.
+
+## [v0.9.43] - 2019-03-20
+
+### Added
+
+* Added `d2i_CMS_ContentInfo` and `CMS_encrypt`.
+* Added `X509_verify` and `X509_REQ_verify`.
+* Added `EVP_MD_type` and `EVP_GROUP_get_curve_name`.
+
+[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.103..master
+[v0.9.103]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.102...openssl-sys-v0.9.103
+[v0.9.102]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.101...openssl-sys-v0.9.102
+[v0.9.101]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.100...openssl-sys-v0.9.101
+[v0.9.100]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.99...openssl-sys-v0.9.100
+[v0.9.99]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.98...openssl-sys-v0.9.99
+[v0.9.98]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.97...openssl-sys-v0.9.98
+[v0.9.97]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.96...openssl-sys-v0.9.97
+[v0.9.96]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.95...openssl-sys-v0.9.96
+[v0.9.95]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.94...openssl-sys-v0.9.95
+[v0.9.94]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.93...openssl-sys-v0.9.94
+[v0.9.93]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.92...openssl-sys-v0.9.93
+[v0.9.92]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.91...openssl-sys-v0.9.92
+[v0.9.91]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.90...openssl-sys-v0.9.91
+[v0.9.90]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.89...openssl-sys-v0.9.90
+[v0.9.89]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.88...openssl-sys-v0.9.89
+[v0.9.88]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.87...openssl-sys-v0.9.88
+[v0.9.87]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.86...openssl-sys-v0.9.87
+[v0.9.86]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.85...openssl-sys-v0.9.86
+[v0.9.85]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.84...openssl-sys-v0.9.85
+[v0.9.84]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.83...openssl-sys-v0.9.84
+[v0.9.83]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.82...openssl-sys-v0.9.83
+[v0.9.82]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.81...openssl-sys-v0.9.82
+[v0.9.81]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.80...openssl-sys-v0.9.81
+[v0.9.80]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.79...openssl-sys-v0.9.80
+[v0.9.79]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.78...openssl-sys-v0.9.79
+[v0.9.78]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.77...openssl-sys-v0.9.78
+[v0.9.77]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.76...openssl-sys-v0.9.77
+[v0.9.76]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.75...openssl-sys-v0.9.76
+[v0.9.75]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.74...openssl-sys-v0.9.75
+[v0.9.74]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.73...openssl-sys-v0.9.74
+[v0.9.73]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.72...openssl-sys-v0.9.73
+[v0.9.72]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.71...openssl-sys-v0.9.72
+[v0.9.71]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.70...openssl-sys-v0.9.71
+[v0.9.70]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.69...openssl-sys-v0.9.70
+[v0.9.69]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.68...openssl-sys-v0.9.69
+[v0.9.68]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.67...openssl-sys-v0.9.68
+[v0.9.67]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.66...openssl-sys-v0.9.67
+[v0.9.66]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.65...openssl-sys-v0.9.66
+[v0.9.65]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.64...openssl-sys-v0.9.65
+[v0.9.64]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.63...openssl-sys-v0.9.64
+[v0.9.63]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.62...openssl-sys-v0.9.63
+[v0.9.62]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.61...openssl-sys-v0.9.62
+[v0.9.61]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.60...openssl-sys-v0.9.61
+[v0.9.60]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.59...openssl-sys-v0.9.60
+[v0.9.59]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.58...openssl-sys-v0.9.59
+[v0.9.58]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.57...openssl-sys-v0.9.58
+[v0.9.57]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.56...openssl-sys-v0.9.57
+[v0.9.56]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.55...openssl-sys-v0.9.56
+[v0.9.55]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.54...openssl-sys-v0.9.55
+[v0.9.54]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.53...openssl-sys-v0.9.54
+[v0.9.53]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.52...openssl-sys-v0.9.53
+[v0.9.52]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.51...openssl-sys-v0.9.52
+[v0.9.51]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.50...openssl-sys-v0.9.51
+[v0.9.50]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.49...openssl-sys-v0.9.50
+[v0.9.49]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.48...openssl-sys-v0.9.49
+[v0.9.48]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.47...openssl-sys-v0.9.48
+[v0.9.47]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.46...openssl-sys-v0.9.47
+[v0.9.46]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.45...openssl-sys-v0.9.46
+[v0.9.45]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.44...openssl-sys-v0.9.45
+[v0.9.44]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.43...openssl-sys-v0.9.44
+[v0.9.43]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.42...openssl-sys-v0.9.43
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/openssl-sys/Cargo.toml
--- 43.0.0-1/rust-vendor/openssl-sys/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,59 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2018"
+name = "openssl-sys"
+version = "0.9.103"
+authors = [
+    "Alex Crichton <alex@alexcrichton.com>",
+    "Steven Fackler <sfackler@gmail.com>",
+]
+build = "build/main.rs"
+links = "openssl"
+description = "FFI bindings to OpenSSL"
+readme = "README.md"
+categories = [
+    "cryptography",
+    "external-ffi-bindings",
+]
+license = "MIT"
+repository = "https://github.com/sfackler/rust-openssl"
+
+[package.metadata.pkg-config]
+openssl = "1.0.1"
+
+[dependencies.bssl-sys]
+version = "0.1.0"
+optional = true
+
+[dependencies.libc]
+version = "0.2"
+
+[build-dependencies.bindgen]
+version = "0.65.0"
+features = ["experimental"]
+optional = true
+
+[build-dependencies.cc]
+version = "1.0.61"
+
+[build-dependencies.openssl-src]
+version = "300.2.0"
+features = ["legacy"]
+optional = true
+
+[build-dependencies.pkg-config]
+version = "0.3.9"
+
+[features]
+unstable_boringssl = ["bssl-sys"]
+vendored = ["openssl-src"]
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/openssl-sys/LICENSE-MIT
--- 43.0.0-1/rust-vendor/openssl-sys/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,25 @@
+Copyright (c) 2014 Alex Crichton
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/README.md 43.0.0-1ubuntu1/rust-vendor/openssl-sys/README.md
--- 43.0.0-1/rust-vendor/openssl-sys/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,22 @@
+# rust-openssl
+
+[![crates.io](https://img.shields.io/crates/v/openssl.svg)](https://crates.io/crates/openssl)
+
+OpenSSL bindings for the Rust programming language.
+
+[Documentation](https://docs.rs/openssl).
+
+## Release Support
+
+The current supported release of `openssl` is 0.10 and `openssl-sys` is 0.9.
+
+New major versions will be published at most once per year. After a new
+release, the previous major version will be partially supported with bug
+fixes for 3 months, after which support will be dropped entirely.
+
+### Contribution
+
+Unless you explicitly state otherwise, any contribution intentionally
+submitted for inclusion in the work by you, as defined in the Apache-2.0
+license, shall be dual licensed under the terms of both the Apache License,
+Version 2.0 and the MIT license without any additional terms or conditions.
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/build/cfgs.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/build/cfgs.rs
--- 43.0.0-1/rust-vendor/openssl-sys/build/cfgs.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/build/cfgs.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,122 @@
+#[allow(clippy::unusual_byte_groupings)]
+pub fn get(openssl_version: Option<u64>, libressl_version: Option<u64>) -> Vec<&'static str> {
+    let mut cfgs = vec![];
+
+    if let Some(libressl_version) = libressl_version {
+        cfgs.push("libressl");
+
+        if libressl_version >= 0x2_05_01_00_0 {
+            cfgs.push("libressl251");
+        }
+        if libressl_version >= 0x2_05_02_00_0 {
+            cfgs.push("libressl252");
+        }
+        if libressl_version >= 0x2_06_01_00_0 {
+            cfgs.push("libressl261");
+        }
+        if libressl_version >= 0x2_07_00_00_0 {
+            cfgs.push("libressl270");
+        }
+        if libressl_version >= 0x2_07_01_00_0 {
+            cfgs.push("libressl271");
+        }
+        if libressl_version >= 0x2_07_03_00_0 {
+            cfgs.push("libressl273");
+        }
+        if libressl_version >= 0x2_08_00_00_0 {
+            cfgs.push("libressl280");
+        }
+        if libressl_version >= 0x2_08_01_00_0 {
+            cfgs.push("libressl281");
+        }
+        if libressl_version >= 0x2_09_01_00_0 {
+            cfgs.push("libressl291");
+        }
+        if libressl_version >= 0x3_01_00_00_0 {
+            cfgs.push("libressl310");
+        }
+        if libressl_version >= 0x3_02_01_00_0 {
+            cfgs.push("libressl321");
+        }
+        if libressl_version >= 0x3_03_02_00_0 {
+            cfgs.push("libressl332");
+        }
+        if libressl_version >= 0x3_04_00_00_0 {
+            cfgs.push("libressl340");
+        }
+        if libressl_version >= 0x3_05_00_00_0 {
+            cfgs.push("libressl350");
+        }
+        if libressl_version >= 0x3_06_00_00_0 {
+            cfgs.push("libressl360");
+        }
+        if libressl_version >= 0x3_07_00_00_0 {
+            cfgs.push("libressl370");
+        }
+        if libressl_version >= 0x3_08_00_00_0 {
+            cfgs.push("libressl380");
+        }
+        if libressl_version >= 0x3_08_01_00_0 {
+            cfgs.push("libressl381");
+        }
+        if libressl_version >= 0x3_08_02_00_0 {
+            cfgs.push("libressl382");
+        }
+        if libressl_version >= 0x3_09_00_00_0 {
+            cfgs.push("libressl390");
+        }
+        if libressl_version >= 0x4_00_00_00_0 {
+            cfgs.push("libressl400");
+        }
+    } else {
+        let openssl_version = openssl_version.unwrap();
+
+        if openssl_version >= 0x3_03_00_00_0 {
+            cfgs.push("ossl330");
+        }
+        if openssl_version >= 0x3_02_00_00_0 {
+            cfgs.push("ossl320");
+        }
+        if openssl_version >= 0x3_00_00_00_0 {
+            cfgs.push("ossl300");
+        }
+        if openssl_version >= 0x1_00_01_00_0 {
+            cfgs.push("ossl101");
+        }
+        if openssl_version >= 0x1_00_02_00_0 {
+            cfgs.push("ossl102");
+        }
+        if openssl_version >= 0x1_00_02_06_0 {
+            cfgs.push("ossl102f");
+        }
+        if openssl_version >= 0x1_00_02_08_0 {
+            cfgs.push("ossl102h");
+        }
+        if openssl_version >= 0x1_01_00_00_0 {
+            cfgs.push("ossl110");
+        }
+        if openssl_version >= 0x1_01_00_06_0 {
+            cfgs.push("ossl110f");
+        }
+        if openssl_version >= 0x1_01_00_07_0 {
+            cfgs.push("ossl110g");
+        }
+        if openssl_version >= 0x1_01_00_08_0 {
+            cfgs.push("ossl110h");
+        }
+        if openssl_version >= 0x1_01_01_00_0 {
+            cfgs.push("ossl111");
+        }
+        if openssl_version >= 0x1_01_01_02_0 {
+            cfgs.push("ossl111b");
+        }
+        if openssl_version >= 0x1_01_01_03_0 {
+            cfgs.push("ossl111c");
+        }
+        if openssl_version >= 0x1_01_01_04_0 {
+            cfgs.push("ossl111d");
+        }
+    }
+
+    cfgs
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/build/expando.c 43.0.0-1ubuntu1/rust-vendor/openssl-sys/build/expando.c
--- 43.0.0-1/rust-vendor/openssl-sys/build/expando.c	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/build/expando.c	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,140 @@
+#include <openssl/opensslv.h>
+#include <openssl/opensslconf.h>
+
+#define VERSION2(n, v) RUST_VERSION_##n##_##v
+#define VERSION(n, v) VERSION2(n, v)
+
+#define NEW_VERSION2(a, b, c) RUST_VERSION_NEW_OPENSSL_##a##_##b##_##c
+#define NEW_VERSION(a, b, c) NEW_VERSION2(a, b, c)
+
+#ifdef LIBRESSL_VERSION_NUMBER
+VERSION(LIBRESSL, LIBRESSL_VERSION_NUMBER)
+#elif defined OPENSSL_VERSION_MAJOR
+NEW_VERSION(OPENSSL_VERSION_MAJOR, OPENSSL_VERSION_MINOR, OPENSSL_VERSION_PATCH)
+#else
+VERSION(OPENSSL, OPENSSL_VERSION_NUMBER)
+#endif
+
+#ifdef OPENSSL_IS_BORINGSSL
+RUST_OPENSSL_IS_BORINGSSL
+#endif
+
+#ifdef OPENSSL_NO_BF
+RUST_CONF_OPENSSL_NO_BF
+#endif
+
+#ifdef OPENSSL_NO_BUF_FREELISTS
+RUST_CONF_OPENSSL_NO_BUF_FREELISTS
+#endif
+
+#ifdef OPENSSL_NO_CHACHA
+RUST_CONF_OPENSSL_NO_CHACHA
+#endif
+
+#ifdef OPENSSL_NO_IDEA
+RUST_CONF_OPENSSL_NO_IDEA
+#endif
+
+#ifdef OPENSSL_NO_CAMELLIA
+RUST_CONF_OPENSSL_NO_CAMELLIA
+#endif
+
+#ifdef OPENSSL_NO_CAST
+RUST_CONF_OPENSSL_NO_CAST
+#endif
+
+#ifdef OPENSSL_NO_CMS
+RUST_CONF_OPENSSL_NO_CMS
+#endif
+
+#ifdef OPENSSL_NO_COMP
+RUST_CONF_OPENSSL_NO_COMP
+#endif
+
+#ifdef OPENSSL_NO_EC
+RUST_CONF_OPENSSL_NO_EC
+#endif
+
+#ifdef OPENSSL_NO_EC2M
+RUST_CONF_OPENSSL_NO_EC2M
+#endif
+
+#ifdef OPENSSL_NO_ENGINE
+RUST_CONF_OPENSSL_NO_ENGINE
+#endif
+
+#ifdef OPENSSL_NO_KRB5
+RUST_CONF_OPENSSL_NO_KRB5
+#endif
+
+#ifdef OPENSSL_NO_NEXTPROTONEG
+RUST_CONF_OPENSSL_NO_NEXTPROTONEG
+#endif
+
+#ifdef OPENSSL_NO_OCSP
+RUST_CONF_OPENSSL_NO_OCSP
+#endif
+
+#ifdef OPENSSL_NO_OCB
+RUST_CONF_OPENSSL_NO_OCB
+#endif
+
+#ifdef OPENSSL_NO_PSK
+RUST_CONF_OPENSSL_NO_PSK
+#endif
+
+#ifdef OPENSSL_NO_RC4
+RUST_CONF_OPENSSL_NO_RC4
+#endif
+
+#ifdef OPENSSL_NO_RFC3779
+RUST_CONF_OPENSSL_NO_RFC3779
+#endif
+
+#ifdef OPENSSL_NO_RMD160
+RUST_CONF_OPENSSL_NO_RMD160
+#endif
+
+#ifdef OPENSSL_NO_SHA
+RUST_CONF_OPENSSL_NO_SHA
+#endif
+
+#ifdef OPENSSL_NO_SRP
+RUST_CONF_OPENSSL_NO_SRP
+#endif
+
+#ifdef OPENSSL_NO_SSL3_METHOD
+RUST_CONF_OPENSSL_NO_SSL3_METHOD
+#endif
+
+#ifdef OPENSSL_NO_TLSEXT
+RUST_CONF_OPENSSL_NO_TLSEXT
+#endif
+
+#ifdef OPENSSL_NO_SOCK
+RUST_CONF_OPENSSL_NO_SOCK
+#endif
+
+#ifdef OPENSSL_NO_STDIO
+RUST_CONF_OPENSSL_NO_STDIO
+#endif
+
+#ifdef OPENSSL_NO_SM3
+RUST_CONF_OPENSSL_NO_SM3
+#endif
+
+#ifdef OPENSSL_NO_SM4
+RUST_CONF_OPENSSL_NO_SM4
+#endif
+
+#ifdef OPENSSL_NO_DEPRECATED_3_0
+RUST_CONF_OPENSSL_NO_DEPRECATED_3_0
+#endif
+
+#ifdef OPENSSL_NO_SEED
+RUST_CONF_OPENSSL_NO_SEED
+#endif
+
+#ifdef OPENSSL_NO_SCRYPT
+RUST_CONF_OPENSSL_NO_SCRYPT
+#endif
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/build/find_normal.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/build/find_normal.rs
--- 43.0.0-1/rust-vendor/openssl-sys/build/find_normal.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/build/find_normal.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,245 @@
+use std::ffi::OsString;
+use std::path::{Path, PathBuf};
+use std::process::{self, Command};
+
+use super::env;
+
+pub fn get_openssl(target: &str) -> (Vec<PathBuf>, PathBuf) {
+    let lib_dir = env("OPENSSL_LIB_DIR").map(PathBuf::from);
+    let include_dir = env("OPENSSL_INCLUDE_DIR").map(PathBuf::from);
+
+    match (lib_dir, include_dir) {
+        (Some(lib_dir), Some(include_dir)) => (vec![lib_dir], include_dir),
+        (lib_dir, include_dir) => {
+            let openssl_dir = env("OPENSSL_DIR").unwrap_or_else(|| find_openssl_dir(target));
+            let openssl_dir = Path::new(&openssl_dir);
+            let lib_dir = lib_dir.map(|d| vec![d]).unwrap_or_else(|| {
+                let mut lib_dirs = vec![];
+                // OpenSSL 3.0 now puts it's libraries in lib64/ by default,
+                // check for both it and lib/.
+                if openssl_dir.join("lib64").exists() {
+                    lib_dirs.push(openssl_dir.join("lib64"));
+                }
+                if openssl_dir.join("lib").exists() {
+                    lib_dirs.push(openssl_dir.join("lib"));
+                }
+                lib_dirs
+            });
+            let include_dir = include_dir.unwrap_or_else(|| openssl_dir.join("include"));
+            (lib_dir, include_dir)
+        }
+    }
+}
+
+fn resolve_with_wellknown_homebrew_location(dir: &str) -> Option<PathBuf> {
+    let versions = ["openssl@3", "openssl@3.0", "openssl@1.1"];
+
+    // Check up default aarch 64 Homebrew installation location first
+    // for quick resolution if possible.
+    //  `pkg-config` on brew doesn't necessarily contain settings for openssl apparently.
+    for version in &versions {
+        let homebrew = Path::new(dir).join(format!("opt/{}", version));
+        if homebrew.exists() {
+            return Some(homebrew);
+        }
+    }
+
+    for version in &versions {
+        // Calling `brew --prefix <package>` command usually slow and
+        // takes seconds, and will be used only as a last resort.
+        let output = execute_command_and_get_output("brew", &["--prefix", version]);
+        if let Some(ref output) = output {
+            let homebrew = Path::new(&output);
+            if homebrew.exists() {
+                return Some(homebrew.to_path_buf());
+            }
+        }
+    }
+
+    None
+}
+
+fn resolve_with_wellknown_location(dir: &str) -> Option<PathBuf> {
+    let root_dir = Path::new(dir);
+    let include_openssl = root_dir.join("include/openssl");
+    if include_openssl.exists() {
+        Some(root_dir.to_path_buf())
+    } else {
+        None
+    }
+}
+
+fn find_openssl_dir(target: &str) -> OsString {
+    let host = env::var("HOST").unwrap();
+
+    if host == target && target.ends_with("-apple-darwin") {
+        let homebrew_dir = match target {
+            "aarch64-apple-darwin" => "/opt/homebrew",
+            _ => "/usr/local",
+        };
+
+        if let Some(dir) = resolve_with_wellknown_homebrew_location(homebrew_dir) {
+            return dir.into();
+        } else if let Some(dir) = resolve_with_wellknown_location("/opt/pkg") {
+            // pkgsrc
+            return dir.into();
+        } else if let Some(dir) = resolve_with_wellknown_location("/opt/local") {
+            // MacPorts
+            return dir.into();
+        }
+    }
+
+    try_pkg_config();
+
+    // FreeBSD and OpenBSD ship with Libre|OpenSSL but don't include a pkg-config file
+    if host == target && (target.contains("freebsd") || target.contains("openbsd")) {
+        return OsString::from("/usr");
+    }
+
+    // DragonFly has libressl (or openssl) in ports, but this doesn't include a pkg-config file
+    if host == target && target.contains("dragonfly") {
+        return OsString::from("/usr/local");
+    }
+
+    let mut msg = format!(
+        "
+
+Could not find directory of OpenSSL installation, and this `-sys` crate cannot
+proceed without this knowledge. If OpenSSL is installed and this crate had
+trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
+compilation process.
+
+Make sure you also have the development packages of openssl installed.
+For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.
+
+If you're in a situation where you think the directory *should* be found
+automatically, please open a bug at https://github.com/sfackler/rust-openssl
+and include information about your system as well as this message.
+
+$HOST = {}
+$TARGET = {}
+openssl-sys = {}
+
+",
+        host,
+        target,
+        env!("CARGO_PKG_VERSION")
+    );
+
+    if host.contains("apple-darwin") && target.contains("apple-darwin") {
+        let system = Path::new("/usr/lib/libssl.0.9.8.dylib");
+        if system.exists() {
+            msg.push_str(
+                "
+
+openssl-sys crate build failed: no supported version of OpenSSL found.
+
+Ways to fix it:
+- Use the `vendored` feature of openssl-sys crate to build OpenSSL from source.
+- Use Homebrew to install the `openssl` package.
+
+",
+            );
+        }
+    }
+
+    if host.contains("unknown-linux")
+        && target.contains("unknown-linux-gnu")
+        && Command::new("pkg-config").output().is_err()
+    {
+        msg.push_str(
+            "
+It looks like you're compiling on Linux and also targeting Linux. Currently this
+requires the `pkg-config` utility to find OpenSSL but unfortunately `pkg-config`
+could not be found. If you have OpenSSL installed you can likely fix this by
+installing `pkg-config`.
+
+",
+        );
+    }
+
+    if host.contains("windows") && target.contains("windows-gnu") {
+        msg.push_str(
+            "
+It looks like you're compiling for MinGW but you may not have either OpenSSL or
+pkg-config installed. You can install these two dependencies with:
+
+pacman -S openssl-devel pkgconf
+
+and try building this crate again.
+
+",
+        );
+    }
+
+    if host.contains("windows") && target.contains("windows-msvc") {
+        msg.push_str(
+            "
+It looks like you're compiling for MSVC but we couldn't detect an OpenSSL
+installation. If there isn't one installed then you can try the rust-openssl
+README for more information about how to download precompiled binaries of
+OpenSSL:
+
+https://github.com/sfackler/rust-openssl#windows
+
+",
+        );
+    }
+
+    panic!("{}", msg);
+}
+
+/// Attempt to find OpenSSL through pkg-config.
+///
+/// Note that if this succeeds then the function does not return as pkg-config
+/// typically tells us all the information that we need.
+fn try_pkg_config() {
+    let target = env::var("TARGET").unwrap();
+    let host = env::var("HOST").unwrap();
+
+    // FIXME we really shouldn't be automatically enabling this
+    if target.contains("windows-gnu") && host.contains("windows") {
+        env::set_var("PKG_CONFIG_ALLOW_CROSS", "1");
+    } else if target.contains("windows-msvc") {
+        // MSVC targets use vcpkg instead.
+        return;
+    }
+
+    let lib = match pkg_config::Config::new()
+        .print_system_libs(false)
+        .probe("openssl")
+    {
+        Ok(lib) => lib,
+        Err(e) => {
+            println!("run pkg_config fail: {:?}", e);
+            return;
+        }
+    };
+
+    super::postprocess(&lib.include_paths);
+
+    for include in lib.include_paths.iter() {
+        println!("cargo:include={}", include.display());
+    }
+
+    process::exit(0);
+}
+
+/// Attempt to find OpenSSL through vcpkg.
+///
+/// Note that if this succeeds then the function does not return as vcpkg
+/// should emit all of the cargo metadata that we need.
+
+fn execute_command_and_get_output(cmd: &str, args: &[&str]) -> Option<String> {
+    let out = Command::new(cmd).args(args).output();
+    if let Ok(ref r1) = out {
+        if r1.status.success() {
+            let r2 = String::from_utf8(r1.stdout.clone());
+            if let Ok(r3) = r2 {
+                return Some(r3.trim().to_string());
+            }
+        }
+    }
+
+    None
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/build/find_vendored.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/build/find_vendored.rs
--- 43.0.0-1/rust-vendor/openssl-sys/build/find_vendored.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/build/find_vendored.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,25 @@
+use openssl_src;
+use std::path::PathBuf;
+
+use super::env;
+
+pub fn get_openssl(_target: &str) -> (Vec<PathBuf>, PathBuf) {
+    let openssl_config_dir = env("OPENSSL_CONFIG_DIR");
+
+    let mut openssl_src_build = openssl_src::Build::new();
+    if let Some(value) = openssl_config_dir {
+        openssl_src_build.openssl_dir(PathBuf::from(value));
+    }
+
+    let artifacts = openssl_src_build.build();
+    println!("cargo:vendored=1");
+    println!(
+        "cargo:root={}",
+        artifacts.lib_dir().parent().unwrap().display()
+    );
+
+    (
+        vec![artifacts.lib_dir().to_path_buf()],
+        artifacts.include_dir().to_path_buf(),
+    )
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/build/main.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/build/main.rs
--- 43.0.0-1/rust-vendor/openssl-sys/build/main.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/build/main.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,504 @@
+#[cfg(feature = "bindgen")]
+extern crate bindgen;
+extern crate cc;
+#[cfg(feature = "vendored")]
+extern crate openssl_src;
+extern crate pkg_config;
+
+use std::collections::HashSet;
+use std::env;
+use std::ffi::OsString;
+use std::path::PathBuf;
+mod cfgs;
+
+mod find_normal;
+#[cfg(feature = "vendored")]
+mod find_vendored;
+mod run_bindgen;
+
+#[derive(PartialEq)]
+enum Version {
+    Openssl3xx,
+    Openssl11x,
+    Openssl10x,
+    Libressl,
+    Boringssl,
+}
+
+fn env_inner(name: &str) -> Option<OsString> {
+    let var = env::var_os(name);
+    println!("cargo:rerun-if-env-changed={}", name);
+
+    match var {
+        Some(ref v) => println!("{} = {}", name, v.to_string_lossy()),
+        None => println!("{} unset", name),
+    }
+
+    var
+}
+
+fn env(name: &str) -> Option<OsString> {
+    let prefix = env::var("TARGET").unwrap().to_uppercase().replace('-', "_");
+    let prefixed = format!("{}_{}", prefix, name);
+    env_inner(&prefixed).or_else(|| env_inner(name))
+}
+
+fn find_openssl(target: &str) -> (Vec<PathBuf>, PathBuf) {
+    #[cfg(feature = "vendored")]
+    {
+        // vendor if the feature is present, unless
+        // OPENSSL_NO_VENDOR exists and isn't `0`
+        if env("OPENSSL_NO_VENDOR").map_or(true, |s| s == "0") {
+            return find_vendored::get_openssl(target);
+        }
+    }
+    find_normal::get_openssl(target)
+}
+
+fn check_ssl_kind() {
+    if cfg!(feature = "unstable_boringssl") {
+        println!("cargo:rustc-cfg=boringssl");
+        println!("cargo:boringssl=true");
+
+        if let Ok(vars) = env::var("DEP_BSSL_CONF") {
+            for var in vars.split(',') {
+                println!("cargo:rustc-cfg=osslconf=\"{}\"", var);
+            }
+            println!("cargo:conf={}", vars);
+        }
+
+        // BoringSSL does not have any build logic, exit early
+        std::process::exit(0);
+    }
+}
+
+fn main() {
+    println!("cargo:rustc-check-cfg=cfg(osslconf, values(\"OPENSSL_NO_OCB\", \"OPENSSL_NO_SM4\", \"OPENSSL_NO_SEED\", \"OPENSSL_NO_CHACHA\", \"OPENSSL_NO_CAST\", \"OPENSSL_NO_IDEA\", \"OPENSSL_NO_CAMELLIA\", \"OPENSSL_NO_RC4\", \"OPENSSL_NO_BF\", \"OPENSSL_NO_PSK\", \"OPENSSL_NO_DEPRECATED_3_0\", \"OPENSSL_NO_SCRYPT\", \"OPENSSL_NO_SM3\", \"OPENSSL_NO_RMD160\", \"OPENSSL_NO_EC2M\", \"OPENSSL_NO_OCSP\", \"OPENSSL_NO_CMS\", \"OPENSSL_NO_COMP\", \"OPENSSL_NO_SOCK\", \"OPENSSL_NO_STDIO\"))");
+
+    println!("cargo:rustc-check-cfg=cfg(openssl)");
+    println!("cargo:rustc-check-cfg=cfg(libressl)");
+    println!("cargo:rustc-check-cfg=cfg(boringssl)");
+
+    println!("cargo:rustc-check-cfg=cfg(libressl250)");
+    println!("cargo:rustc-check-cfg=cfg(libressl251)");
+    println!("cargo:rustc-check-cfg=cfg(libressl252)");
+    println!("cargo:rustc-check-cfg=cfg(libressl261)");
+    println!("cargo:rustc-check-cfg=cfg(libressl270)");
+    println!("cargo:rustc-check-cfg=cfg(libressl271)");
+    println!("cargo:rustc-check-cfg=cfg(libressl273)");
+    println!("cargo:rustc-check-cfg=cfg(libressl280)");
+    println!("cargo:rustc-check-cfg=cfg(libressl281)");
+    println!("cargo:rustc-check-cfg=cfg(libressl291)");
+    println!("cargo:rustc-check-cfg=cfg(libressl310)");
+    println!("cargo:rustc-check-cfg=cfg(libressl321)");
+    println!("cargo:rustc-check-cfg=cfg(libressl332)");
+    println!("cargo:rustc-check-cfg=cfg(libressl340)");
+    println!("cargo:rustc-check-cfg=cfg(libressl350)");
+    println!("cargo:rustc-check-cfg=cfg(libressl360)");
+    println!("cargo:rustc-check-cfg=cfg(libressl361)");
+    println!("cargo:rustc-check-cfg=cfg(libressl370)");
+    println!("cargo:rustc-check-cfg=cfg(libressl380)");
+    println!("cargo:rustc-check-cfg=cfg(libressl381)");
+    println!("cargo:rustc-check-cfg=cfg(libressl382)");
+    println!("cargo:rustc-check-cfg=cfg(libressl390)");
+    println!("cargo:rustc-check-cfg=cfg(libressl400)");
+
+    println!("cargo:rustc-check-cfg=cfg(ossl101)");
+    println!("cargo:rustc-check-cfg=cfg(ossl102)");
+    println!("cargo:rustc-check-cfg=cfg(ossl102f)");
+    println!("cargo:rustc-check-cfg=cfg(ossl102h)");
+    println!("cargo:rustc-check-cfg=cfg(ossl110)");
+    println!("cargo:rustc-check-cfg=cfg(ossl110f)");
+    println!("cargo:rustc-check-cfg=cfg(ossl110g)");
+    println!("cargo:rustc-check-cfg=cfg(ossl110h)");
+    println!("cargo:rustc-check-cfg=cfg(ossl111)");
+    println!("cargo:rustc-check-cfg=cfg(ossl111b)");
+    println!("cargo:rustc-check-cfg=cfg(ossl111c)");
+    println!("cargo:rustc-check-cfg=cfg(ossl111d)");
+    println!("cargo:rustc-check-cfg=cfg(ossl300)");
+    println!("cargo:rustc-check-cfg=cfg(ossl310)");
+    println!("cargo:rustc-check-cfg=cfg(ossl320)");
+    println!("cargo:rustc-check-cfg=cfg(ossl330)");
+
+    check_ssl_kind();
+
+    let target = env::var("TARGET").unwrap();
+
+    let (lib_dirs, include_dir) = find_openssl(&target);
+    // rerun-if-changed causes openssl-sys to rebuild if the openssl include
+    // dir has changed since the last build. However, this causes a rebuild
+    // every time when vendoring so we disable it.
+    let potential_path = include_dir.join("openssl");
+    if potential_path.exists() && !cfg!(feature = "vendored") {
+        if let Some(printable_include) = potential_path.to_str() {
+            println!("cargo:rerun-if-changed={}", printable_include);
+        }
+    }
+
+    if !lib_dirs.iter().all(|p| p.exists()) {
+        panic!("OpenSSL library directory does not exist: {:?}", lib_dirs);
+    }
+    if !include_dir.exists() {
+        panic!(
+            "OpenSSL include directory does not exist: {}",
+            include_dir.to_string_lossy()
+        );
+    }
+
+    for lib_dir in lib_dirs.iter() {
+        println!(
+            "cargo:rustc-link-search=native={}",
+            lib_dir.to_string_lossy()
+        );
+    }
+    println!("cargo:include={}", include_dir.to_string_lossy());
+
+    let version = postprocess(&[include_dir]);
+
+    let libs_env = env("OPENSSL_LIBS");
+    let libs = match libs_env.as_ref().and_then(|s| s.to_str()) {
+        Some(v) => {
+            if v.is_empty() {
+                vec![]
+            } else {
+                v.split(':').collect()
+            }
+        }
+        None => match version {
+            Version::Openssl10x if target.contains("windows") => vec!["ssleay32", "libeay32"],
+            Version::Openssl3xx | Version::Openssl11x if target.contains("windows-msvc") => {
+                vec!["libssl", "libcrypto"]
+            }
+            _ => vec!["ssl", "crypto"],
+        },
+    };
+
+    let kind = determine_mode(&lib_dirs, &libs);
+    for lib in libs.into_iter() {
+        println!("cargo:rustc-link-lib={}={}", kind, lib);
+    }
+
+    // libssl in BoringSSL requires the C++ runtime, and static libraries do
+    // not carry dependency information. On unix-like platforms, the C++
+    // runtime and standard library are typically picked up by default via the
+    // C++ compiler, which has a platform-specific default. (See implementations
+    // of `GetDefaultCXXStdlibType` in Clang.) Builds may also choose to
+    // override this and specify their own with `-nostdinc++` and `-nostdlib++`
+    // flags. Some compilers also provide options like `-stdlib=libc++`.
+    //
+    // Typically, such information is carried all the way up the build graph,
+    // but Cargo is not an integrated cross-language build system, so it cannot
+    // safely handle any of these situations. As a result, we need to make
+    // guesses. Getting this wrong may result in symbol conflicts and memory
+    // errors, but this unsafety is inherent to driving builds with
+    // externally-built libraries using Cargo.
+    //
+    // For now, we guess that the build was made with the defaults. This too is
+    // difficult because Rust does not expose this information from Clang, but
+    // try to match the behavior for common platforms. For a more robust option,
+    // this likely needs to be deferred to the caller with an environment
+    // variable.
+    if version == Version::Boringssl && kind == "static" && env::var("CARGO_CFG_UNIX").is_ok() {
+        let cpp_lib = match env::var("CARGO_CFG_TARGET_OS").unwrap().as_ref() {
+            "macos" => "c++",
+            _ => "stdc++",
+        };
+        println!("cargo:rustc-link-lib={}", cpp_lib);
+    }
+
+    // https://github.com/openssl/openssl/pull/15086
+    if version == Version::Openssl3xx
+        && kind == "static"
+        && (env::var("CARGO_CFG_TARGET_OS").unwrap() == "linux"
+            || env::var("CARGO_CFG_TARGET_OS").unwrap() == "android")
+        && env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap() == "32"
+    {
+        println!("cargo:rustc-link-lib=atomic");
+    }
+
+    if kind == "static" && target.contains("windows") {
+        println!("cargo:rustc-link-lib=dylib=gdi32");
+        println!("cargo:rustc-link-lib=dylib=user32");
+        println!("cargo:rustc-link-lib=dylib=crypt32");
+        println!("cargo:rustc-link-lib=dylib=ws2_32");
+        println!("cargo:rustc-link-lib=dylib=advapi32");
+    }
+}
+
+fn postprocess(include_dirs: &[PathBuf]) -> Version {
+    let version = validate_headers(include_dirs);
+
+    // Never run bindgen for BoringSSL, if it was needed we already ran it.
+    if version != Version::Boringssl {
+        #[cfg(feature = "bindgen")]
+        run_bindgen::run(&include_dirs);
+    }
+
+    version
+}
+
+/// Validates the header files found in `include_dir` and then returns the
+/// version string of OpenSSL.
+#[allow(clippy::unusual_byte_groupings)]
+fn validate_headers(include_dirs: &[PathBuf]) -> Version {
+    // This `*-sys` crate only works with OpenSSL 1.0.1, 1.0.2, 1.1.0, 1.1.1 and 3.0.0.
+    // To correctly expose the right API from this crate, take a look at
+    // `opensslv.h` to see what version OpenSSL claims to be.
+    //
+    // OpenSSL has a number of build-time configuration options which affect
+    // various structs and such. Since OpenSSL 1.1.0 this isn't really a problem
+    // as the library is much more FFI-friendly, but 1.0.{1,2} suffer this problem.
+    //
+    // To handle all this conditional compilation we slurp up the configuration
+    // file of OpenSSL, `opensslconf.h`, and then dump out everything it defines
+    // as our own #[cfg] directives. That way the `ossl10x.rs` bindings can
+    // account for compile differences and such.
+    println!("cargo:rerun-if-changed=build/expando.c");
+    let mut gcc = cc::Build::new();
+    gcc.includes(include_dirs);
+    let expanded = match gcc.file("build/expando.c").try_expand() {
+        Ok(expanded) => expanded,
+        Err(e) => {
+            panic!(
+                "
+Header expansion error:
+{:?}
+
+Failed to find OpenSSL development headers.
+
+You can try fixing this setting the `OPENSSL_DIR` environment variable
+pointing to your OpenSSL installation or installing OpenSSL headers package
+specific to your distribution:
+
+    # On Ubuntu
+    sudo apt-get install pkg-config libssl-dev
+    # On Arch Linux
+    sudo pacman -S pkgconf openssl
+    # On Fedora
+    sudo dnf install pkgconf perl-FindBin perl-IPC-Cmd openssl-devel
+    # On Alpine Linux
+    apk add pkgconf openssl-dev
+
+See rust-openssl documentation for more information:
+
+    https://docs.rs/openssl
+",
+                e
+            );
+        }
+    };
+    let expanded = String::from_utf8(expanded).unwrap();
+
+    let mut enabled = vec![];
+    let mut openssl_version = None;
+    let mut libressl_version = None;
+    let mut is_boringssl = false;
+    for line in expanded.lines() {
+        let line = line.trim();
+
+        let openssl_prefix = "RUST_VERSION_OPENSSL_";
+        let new_openssl_prefix = "RUST_VERSION_NEW_OPENSSL_";
+        let libressl_prefix = "RUST_VERSION_LIBRESSL_";
+        let boringsl_prefix = "RUST_OPENSSL_IS_BORINGSSL";
+        let conf_prefix = "RUST_CONF_";
+        if let Some(version) = line.strip_prefix(openssl_prefix) {
+            openssl_version = Some(parse_version(version));
+        } else if let Some(version) = line.strip_prefix(new_openssl_prefix) {
+            openssl_version = Some(parse_new_version(version));
+        } else if let Some(version) = line.strip_prefix(libressl_prefix) {
+            libressl_version = Some(parse_version(version));
+        } else if let Some(conf) = line.strip_prefix(conf_prefix) {
+            enabled.push(conf);
+        } else if line.starts_with(boringsl_prefix) {
+            is_boringssl = true;
+        }
+    }
+
+    for enabled in &enabled {
+        println!("cargo:rustc-cfg=osslconf=\"{}\"", enabled);
+    }
+    println!("cargo:conf={}", enabled.join(","));
+
+    if is_boringssl {
+        println!("cargo:rustc-cfg=boringssl");
+        println!("cargo:boringssl=true");
+        run_bindgen::run_boringssl(include_dirs);
+        return Version::Boringssl;
+    }
+
+    // We set this for any non-BoringSSL lib.
+    println!("cargo:rustc-cfg=openssl");
+
+    for cfg in cfgs::get(openssl_version, libressl_version) {
+        println!("cargo:rustc-cfg={}", cfg);
+    }
+
+    if let Some(libressl_version) = libressl_version {
+        println!("cargo:libressl_version_number={:x}", libressl_version);
+
+        let major = (libressl_version >> 28) as u8;
+        let minor = (libressl_version >> 20) as u8;
+        let fix = (libressl_version >> 12) as u8;
+        let (major, minor, fix) = match (major, minor, fix) {
+            (2, 5, 0) => ('2', '5', '0'),
+            (2, 5, 1) => ('2', '5', '1'),
+            (2, 5, 2) => ('2', '5', '2'),
+            (2, 5, _) => ('2', '5', 'x'),
+            (2, 6, 0) => ('2', '6', '0'),
+            (2, 6, 1) => ('2', '6', '1'),
+            (2, 6, 2) => ('2', '6', '2'),
+            (2, 6, _) => ('2', '6', 'x'),
+            (2, 7, _) => ('2', '7', 'x'),
+            (2, 8, 0) => ('2', '8', '0'),
+            (2, 8, 1) => ('2', '8', '1'),
+            (2, 8, _) => ('2', '8', 'x'),
+            (2, 9, 0) => ('2', '9', '0'),
+            (2, 9, _) => ('2', '9', 'x'),
+            (3, 0, 0) => ('3', '0', '0'),
+            (3, 0, 1) => ('3', '0', '1'),
+            (3, 0, _) => ('3', '0', 'x'),
+            (3, 1, 0) => ('3', '1', '0'),
+            (3, 1, _) => ('3', '1', 'x'),
+            (3, 2, 0) => ('3', '2', '0'),
+            (3, 2, 1) => ('3', '2', '1'),
+            (3, 2, _) => ('3', '2', 'x'),
+            (3, 3, 0) => ('3', '3', '0'),
+            (3, 3, 1) => ('3', '3', '1'),
+            (3, 3, _) => ('3', '3', 'x'),
+            (3, 4, 0) => ('3', '4', '0'),
+            (3, 4, _) => ('3', '4', 'x'),
+            (3, 5, _) => ('3', '5', 'x'),
+            (3, 6, 0) => ('3', '6', '0'),
+            (3, 6, _) => ('3', '6', 'x'),
+            (3, 7, 0) => ('3', '7', '0'),
+            (3, 7, 1) => ('3', '7', '1'),
+            (3, 7, _) => ('3', '7', 'x'),
+            (3, 8, 0) => ('3', '8', '0'),
+            (3, 8, 1) => ('3', '8', '1'),
+            (3, 8, _) => ('3', '8', 'x'),
+            (3, 9, 0) => ('3', '9', '0'),
+            (3, 9, _) => ('3', '9', 'x'),
+            _ => version_error(),
+        };
+
+        println!("cargo:libressl=true");
+        println!("cargo:libressl_version={}{}{}", major, minor, fix);
+        println!("cargo:version=101");
+        Version::Libressl
+    } else {
+        let openssl_version = openssl_version.unwrap();
+        println!("cargo:version_number={:x}", openssl_version);
+
+        if openssl_version >= 0x4_00_00_00_0 {
+            version_error()
+        } else if openssl_version >= 0x3_00_00_00_0 {
+            Version::Openssl3xx
+        } else if openssl_version >= 0x1_01_01_00_0 {
+            println!("cargo:version=111");
+            Version::Openssl11x
+        } else if openssl_version >= 0x1_01_00_06_0 {
+            println!("cargo:version=110");
+            println!("cargo:patch=f");
+            Version::Openssl11x
+        } else if openssl_version >= 0x1_01_00_00_0 {
+            println!("cargo:version=110");
+            Version::Openssl11x
+        } else if openssl_version >= 0x1_00_02_00_0 {
+            println!("cargo:version=102");
+            Version::Openssl10x
+        } else if openssl_version >= 0x1_00_01_00_0 {
+            println!("cargo:version=101");
+            Version::Openssl10x
+        } else {
+            version_error()
+        }
+    }
+}
+
+fn version_error() -> ! {
+    panic!(
+        "
+
+This crate is only compatible with OpenSSL (version 1.0.1 through 1.1.1, or 3), or LibreSSL 2.5
+through 3.9.x, but a different version of OpenSSL was found. The build is now aborting
+due to this version mismatch.
+
+"
+    );
+}
+
+// parses a string that looks like "0x100020cfL"
+fn parse_version(version: &str) -> u64 {
+    // cut off the 0x prefix
+    assert!(version.starts_with("0x"));
+    let version = &version[2..];
+
+    // and the type specifier suffix
+    let version = version.trim_end_matches(|c: char| !c.is_ascii_hexdigit());
+
+    u64::from_str_radix(version, 16).unwrap()
+}
+
+// parses a string that looks like 3_0_0
+fn parse_new_version(version: &str) -> u64 {
+    println!("version: {}", version);
+    let mut it = version.split('_');
+    let major = it.next().unwrap().parse::<u64>().unwrap();
+    let minor = it.next().unwrap().parse::<u64>().unwrap();
+    let patch = it.next().unwrap().parse::<u64>().unwrap();
+
+    (major << 28) | (minor << 20) | (patch << 4)
+}
+
+/// Given a libdir for OpenSSL (where artifacts are located) as well as the name
+/// of the libraries we're linking to, figure out whether we should link them
+/// statically or dynamically.
+fn determine_mode(libdirs: &[PathBuf], libs: &[&str]) -> &'static str {
+    // First see if a mode was explicitly requested
+    let kind = env("OPENSSL_STATIC");
+    match kind.as_ref().and_then(|s| s.to_str()) {
+        Some("0") => return "dylib",
+        Some(_) => return "static",
+        None => {}
+    }
+
+    // Next, see what files we actually have to link against, and see what our
+    // possibilities even are.
+    let mut files = HashSet::new();
+    for dir in libdirs {
+        for path in dir
+            .read_dir()
+            .unwrap()
+            .map(|e| e.unwrap())
+            .map(|e| e.file_name())
+            .filter_map(|e| e.into_string().ok())
+        {
+            files.insert(path);
+        }
+    }
+    let can_static = libs
+        .iter()
+        .all(|l| files.contains(&format!("lib{}.a", l)) || files.contains(&format!("{}.lib", l)));
+    let can_dylib = libs.iter().all(|l| {
+        files.contains(&format!("lib{}.so", l))
+            || files.contains(&format!("{}.dll", l))
+            || files.contains(&format!("lib{}.dylib", l))
+    });
+    match (can_static, can_dylib) {
+        (true, false) => return "static",
+        (false, true) => return "dylib",
+        (false, false) => {
+            panic!(
+                "OpenSSL libdir at `{:?}` does not contain the required files \
+                 to either statically or dynamically link OpenSSL",
+                libdirs
+            );
+        }
+        (true, true) => {}
+    }
+
+    // Ok, we've got not explicit preference and can *either* link statically or
+    // link dynamically. In the interest of "security upgrades" and/or "best
+    // practices with security libs", let's link dynamically.
+    "dylib"
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/build/run_bindgen.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/build/run_bindgen.rs
--- 43.0.0-1/rust-vendor/openssl-sys/build/run_bindgen.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/build/run_bindgen.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,249 @@
+#[cfg(feature = "bindgen")]
+use bindgen::callbacks::{MacroParsingBehavior, ParseCallbacks};
+#[cfg(feature = "bindgen")]
+use bindgen::{MacroTypeVariation, RustTarget};
+use std::io::Write;
+use std::path::PathBuf;
+#[cfg(not(feature = "bindgen"))]
+use std::process;
+use std::{env, fs};
+
+const INCLUDES: &str = "
+#include <openssl/aes.h>
+#include <openssl/asn1.h>
+#include <openssl/bio.h>
+#include <openssl/cmac.h>
+#include <openssl/conf.h>
+#include <openssl/crypto.h>
+#include <openssl/dh.h>
+#include <openssl/dsa.h>
+#include <openssl/ec.h>
+#include <openssl/err.h>
+#include <openssl/evp.h>
+#include <openssl/hmac.h>
+#include <openssl/objects.h>
+#include <openssl/opensslv.h>
+#include <openssl/pem.h>
+#include <openssl/pkcs12.h>
+#include <openssl/pkcs7.h>
+#include <openssl/rand.h>
+#include <openssl/rsa.h>
+#include <openssl/safestack.h>
+#include <openssl/sha.h>
+#include <openssl/ssl.h>
+#include <openssl/stack.h>
+#include <openssl/x509.h>
+#include <openssl/x509_vfy.h>
+#include <openssl/x509v3.h>
+
+// this must be included after ssl.h for libressl!
+#include <openssl/srtp.h>
+
+#if !defined(LIBRESSL_VERSION_NUMBER) && !defined(OPENSSL_IS_BORINGSSL)
+#include <openssl/cms.h>
+#endif
+
+#if !defined(OPENSSL_IS_BORINGSSL)
+#include <openssl/comp.h>
+#include <openssl/ocsp.h>
+#endif
+
+#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000
+#include <openssl/kdf.h>
+#endif
+
+#if OPENSSL_VERSION_NUMBER >= 0x30000000
+#include <openssl/provider.h>
+#endif
+
+#if OPENSSL_VERSION_NUMBER >= 0x30200000
+#include <openssl/quic.h>
+#endif
+
+#if defined(LIBRESSL_VERSION_NUMBER) || defined(OPENSSL_IS_BORINGSSL)
+#include <openssl/poly1305.h>
+#endif
+";
+
+#[cfg(feature = "bindgen")]
+pub fn run(include_dirs: &[PathBuf]) {
+    let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());
+
+    let mut builder = bindgen::builder()
+        .parse_callbacks(Box::new(OpensslCallbacks))
+        .rust_target(RustTarget::Stable_1_47)
+        .ctypes_prefix("::libc")
+        .raw_line("use libc::*;")
+        .raw_line("#[cfg(windows)] use std::os::windows::raw::HANDLE;")
+        .raw_line("type evp_pkey_st = EVP_PKEY;")
+        .allowlist_file(".*[/\\\\]openssl/[^/\\\\]+\\.h")
+        .allowlist_recursively(false)
+        // libc is missing pthread_once_t on macOS
+        .blocklist_type("CRYPTO_ONCE")
+        .blocklist_function("CRYPTO_THREAD_run_once")
+        // we don't want to mess with va_list
+        .blocklist_function("BIO_vprintf")
+        .blocklist_function("BIO_vsnprintf")
+        .blocklist_function("ERR_vset_error")
+        .blocklist_function("ERR_add_error_vdata")
+        .blocklist_function("EVP_KDF_vctrl")
+        .blocklist_type("OSSL_FUNC_core_vset_error_fn")
+        .blocklist_type("OSSL_FUNC_BIO_vprintf_fn")
+        .blocklist_type("OSSL_FUNC_BIO_vsnprintf_fn")
+        // struct hostent * does not exist on Windows
+        .blocklist_function("BIO_gethostbyname")
+        // Maintain compatibility for existing enum definitions
+        .rustified_enum("point_conversion_form_t")
+        // Maintain compatibility for pre-union definitions
+        .blocklist_type("GENERAL_NAME")
+        .blocklist_type("GENERAL_NAME_st")
+        .blocklist_type("EVP_PKEY")
+        .blocklist_type("evp_pkey_st")
+        .layout_tests(false)
+        .header_contents("includes.h", INCLUDES);
+
+    for include_dir in include_dirs {
+        builder = builder
+            .clang_arg("-I")
+            .clang_arg(include_dir.display().to_string());
+    }
+
+    builder
+        .generate()
+        .unwrap()
+        .write_to_file(out_dir.join("bindgen.rs"))
+        .unwrap();
+}
+
+#[cfg(feature = "bindgen")]
+pub fn run_boringssl(include_dirs: &[PathBuf]) {
+    let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());
+
+    fs::File::create(out_dir.join("boring_static_wrapper.h"))
+        .expect("Failed to create boring_static_wrapper.h")
+        .write_all(INCLUDES.as_bytes())
+        .expect("Failed to write contents to boring_static_wrapper.h");
+
+    let mut builder = bindgen::builder()
+        .rust_target(RustTarget::Stable_1_47)
+        .ctypes_prefix("::libc")
+        .raw_line("use libc::*;")
+        .derive_default(false)
+        .enable_function_attribute_detection()
+        .default_macro_constant_type(MacroTypeVariation::Signed)
+        .rustified_enum("point_conversion_form_t")
+        .allowlist_file(".*[/\\\\]openssl/[^/]+\\.h")
+        .allowlist_recursively(false)
+        .blocklist_function("BIO_vsnprintf")
+        .blocklist_function("OPENSSL_vasprintf")
+        .wrap_static_fns(true)
+        .wrap_static_fns_path(out_dir.join("boring_static_wrapper").display().to_string())
+        .layout_tests(false)
+        .header(
+            out_dir
+                .join("boring_static_wrapper.h")
+                .display()
+                .to_string(),
+        );
+
+    for include_dir in include_dirs {
+        builder = builder
+            .clang_arg("-I")
+            .clang_arg(include_dir.display().to_string());
+    }
+
+    builder
+        .generate()
+        .unwrap()
+        .write_to_file(out_dir.join("bindgen.rs"))
+        .unwrap();
+
+    cc::Build::new()
+        .file(out_dir.join("boring_static_wrapper.c"))
+        .includes(include_dirs)
+        .compile("boring_static_wrapper");
+}
+
+#[cfg(not(feature = "bindgen"))]
+pub fn run_boringssl(include_dirs: &[PathBuf]) {
+    let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());
+
+    fs::File::create(out_dir.join("boring_static_wrapper.h"))
+        .expect("Failed to create boring_static_wrapper.h")
+        .write_all(INCLUDES.as_bytes())
+        .expect("Failed to write contents to boring_static_wrapper.h");
+
+    let mut bindgen_cmd = process::Command::new("bindgen");
+    bindgen_cmd
+        .arg("-o")
+        .arg(out_dir.join("bindgen.rs"))
+        // Must be a valid version from
+        // https://docs.rs/bindgen/latest/bindgen/enum.RustTarget.html
+        .arg("--rust-target=1.47")
+        .arg("--ctypes-prefix=::libc")
+        .arg("--raw-line=use libc::*;")
+        .arg("--no-derive-default")
+        .arg("--enable-function-attribute-detection")
+        .arg("--default-macro-constant-type=signed")
+        .arg("--rustified-enum=point_conversion_form_t")
+        .arg("--allowlist-file=.*[/\\\\]openssl/[^/]+\\.h")
+        .arg("--no-recursive-allowlist")
+        .arg("--blocklist-function=BIO_vsnprintf")
+        .arg("--blocklist-function=OPENSSL_vasprintf")
+        .arg("--experimental")
+        .arg("--wrap-static-fns")
+        .arg("--wrap-static-fns-path")
+        .arg(out_dir.join("boring_static_wrapper").display().to_string())
+        .arg("--no-layout-tests")
+        .arg(out_dir.join("boring_static_wrapper.h"))
+        .arg("--")
+        .arg(format!("--target={}", env::var("TARGET").unwrap()));
+
+    for include_dir in include_dirs {
+        bindgen_cmd.arg("-I").arg(include_dir.display().to_string());
+    }
+
+    let result = bindgen_cmd.status().expect("bindgen failed to execute");
+    assert!(result.success());
+
+    cc::Build::new()
+        .file(out_dir.join("boring_static_wrapper.c"))
+        .includes(include_dirs)
+        .compile("boring_static_wrapper");
+}
+
+#[cfg(feature = "bindgen")]
+#[derive(Debug)]
+struct OpensslCallbacks;
+
+#[cfg(feature = "bindgen")]
+impl ParseCallbacks for OpensslCallbacks {
+    // for now we'll continue hand-writing constants
+    fn will_parse_macro(&self, _name: &str) -> MacroParsingBehavior {
+        MacroParsingBehavior::Ignore
+    }
+
+    fn item_name(&self, original_item_name: &str) -> Option<String> {
+        match original_item_name {
+            // Our original definitions of these are wrong, so rename to avoid breakage
+            "CRYPTO_EX_new"
+            | "CRYPTO_EX_dup"
+            | "CRYPTO_EX_free"
+            | "BIO_meth_set_write"
+            | "BIO_meth_set_read"
+            | "BIO_meth_set_puts"
+            | "BIO_meth_set_ctrl"
+            | "BIO_meth_set_create"
+            | "BIO_meth_set_destroy"
+            | "CRYPTO_set_locking_callback"
+            | "CRYPTO_set_id_callback"
+            | "SSL_CTX_set_tmp_dh_callback"
+            | "SSL_set_tmp_dh_callback"
+            | "SSL_CTX_set_tmp_ecdh_callback"
+            | "SSL_set_tmp_ecdh_callback"
+            | "SSL_CTX_callback_ctrl"
+            | "SSL_CTX_set_alpn_select_cb" => Some(format!("{}__fixed_rust", original_item_name)),
+            _ => None,
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/aes.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/aes.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/aes.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/aes.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+use libc::*;
+
+pub const AES_ENCRYPT: c_int = 1;
+pub const AES_DECRYPT: c_int = 0;
+
+pub const AES_MAXNR: c_int = 14;
+pub const AES_BLOCK_SIZE: c_int = 16;
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/asn1.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/asn1.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/asn1.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/asn1.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,39 @@
+use libc::*;
+
+use super::*;
+
+// ASN.1 tag values
+pub const V_ASN1_EOC: c_int = 0;
+pub const V_ASN1_BOOLEAN: c_int = 1;
+pub const V_ASN1_INTEGER: c_int = 2;
+pub const V_ASN1_BIT_STRING: c_int = 3;
+pub const V_ASN1_OCTET_STRING: c_int = 4;
+pub const V_ASN1_NULL: c_int = 5;
+pub const V_ASN1_OBJECT: c_int = 6;
+pub const V_ASN1_OBJECT_DESCRIPTOR: c_int = 7;
+pub const V_ASN1_EXTERNAL: c_int = 8;
+pub const V_ASN1_REAL: c_int = 9;
+pub const V_ASN1_ENUMERATED: c_int = 10;
+pub const V_ASN1_UTF8STRING: c_int = 12;
+pub const V_ASN1_SEQUENCE: c_int = 16;
+pub const V_ASN1_SET: c_int = 17;
+pub const V_ASN1_NUMERICSTRING: c_int = 18;
+pub const V_ASN1_PRINTABLESTRING: c_int = 19;
+pub const V_ASN1_T61STRING: c_int = 20;
+pub const V_ASN1_TELETEXSTRING: c_int = 20; // alias
+pub const V_ASN1_VIDEOTEXSTRING: c_int = 21;
+pub const V_ASN1_IA5STRING: c_int = 22;
+pub const V_ASN1_UTCTIME: c_int = 23;
+pub const V_ASN1_GENERALIZEDTIME: c_int = 24;
+pub const V_ASN1_GRAPHICSTRING: c_int = 25;
+pub const V_ASN1_ISO64STRING: c_int = 26;
+pub const V_ASN1_VISIBLESTRING: c_int = 26; // alias
+pub const V_ASN1_GENERALSTRING: c_int = 27;
+pub const V_ASN1_UNIVERSALSTRING: c_int = 28;
+pub const V_ASN1_BMPSTRING: c_int = 30;
+
+pub const MBSTRING_FLAG: c_int = 0x1000;
+pub const MBSTRING_UTF8: c_int = MBSTRING_FLAG;
+pub const MBSTRING_ASC: c_int = MBSTRING_FLAG | 1;
+pub const MBSTRING_BMP: c_int = MBSTRING_FLAG | 2;
+pub const MBSTRING_UNIV: c_int = MBSTRING_FLAG | 4;
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/bio.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/bio.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/bio.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/bio.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,116 @@
+use libc::*;
+
+use super::*;
+
+pub const BIO_TYPE_NONE: c_int = 0;
+
+pub const BIO_CTRL_EOF: c_int = 2;
+pub const BIO_CTRL_INFO: c_int = 3;
+pub const BIO_CTRL_FLUSH: c_int = 11;
+pub const BIO_CTRL_DGRAM_QUERY_MTU: c_int = 40;
+pub const BIO_C_SET_BUF_MEM_EOF_RETURN: c_int = 130;
+
+pub unsafe fn BIO_set_retry_read(b: *mut BIO) {
+    BIO_set_flags(b, BIO_FLAGS_READ | BIO_FLAGS_SHOULD_RETRY)
+}
+
+pub unsafe fn BIO_set_retry_write(b: *mut BIO) {
+    BIO_set_flags(b, BIO_FLAGS_WRITE | BIO_FLAGS_SHOULD_RETRY)
+}
+
+pub unsafe fn BIO_clear_retry_flags(b: *mut BIO) {
+    BIO_clear_flags(b, BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY)
+}
+
+pub const BIO_FLAGS_READ: c_int = 0x01;
+pub const BIO_FLAGS_WRITE: c_int = 0x02;
+pub const BIO_FLAGS_IO_SPECIAL: c_int = 0x04;
+pub const BIO_FLAGS_RWS: c_int = BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL;
+pub const BIO_FLAGS_SHOULD_RETRY: c_int = 0x08;
+
+pub unsafe fn BIO_get_mem_data(b: *mut BIO, pp: *mut *mut c_char) -> c_long {
+    BIO_ctrl(b, BIO_CTRL_INFO, 0, pp as *mut c_void)
+}
+
+extern "C" {
+    #[deprecated(note = "use BIO_meth_set_write__fixed_rust instead")]
+    #[cfg(any(ossl110, libressl273))]
+    pub fn BIO_meth_set_write(
+        biom: *mut BIO_METHOD,
+        write: unsafe extern "C" fn(*mut BIO, *const c_char, c_int) -> c_int,
+    ) -> c_int;
+    #[deprecated(note = "use BIO_meth_set_read__fixed_rust instead")]
+    #[cfg(any(ossl110, libressl273))]
+    pub fn BIO_meth_set_read(
+        biom: *mut BIO_METHOD,
+        read: unsafe extern "C" fn(*mut BIO, *mut c_char, c_int) -> c_int,
+    ) -> c_int;
+    #[deprecated(note = "use BIO_meth_set_puts__fixed_rust instead")]
+    #[cfg(any(ossl110, libressl273))]
+    pub fn BIO_meth_set_puts(
+        biom: *mut BIO_METHOD,
+        read: unsafe extern "C" fn(*mut BIO, *const c_char) -> c_int,
+    ) -> c_int;
+    #[deprecated(note = "use BIO_meth_set_ctrl__fixed_rust instead")]
+    #[cfg(any(ossl110, libressl273))]
+    pub fn BIO_meth_set_ctrl(
+        biom: *mut BIO_METHOD,
+        read: unsafe extern "C" fn(*mut BIO, c_int, c_long, *mut c_void) -> c_long,
+    ) -> c_int;
+    #[deprecated(note = "use BIO_meth_set_create__fixed_rust instead")]
+    #[cfg(any(ossl110, libressl273))]
+    pub fn BIO_meth_set_create(
+        biom: *mut BIO_METHOD,
+        create: unsafe extern "C" fn(*mut BIO) -> c_int,
+    ) -> c_int;
+    #[deprecated(note = "use BIO_meth_set_destroy__fixed_rust instead")]
+    #[cfg(any(ossl110, libressl273))]
+    pub fn BIO_meth_set_destroy(
+        biom: *mut BIO_METHOD,
+        destroy: unsafe extern "C" fn(*mut BIO) -> c_int,
+    ) -> c_int;
+}
+
+cfg_if! {
+    if #[cfg(ossl320)] {
+        use std::ptr;
+
+        pub const BIO_CTRL_DGRAM_GET_MTU: c_int = 41;
+        pub const BIO_CTRL_DGRAM_SET_MTU: c_int = 42;
+        pub const BIO_CTRL_DGRAM_GET_LOCAL_ADDR_CAP: c_int = 82;
+        pub const BIO_CTRL_DGRAM_GET_LOCAL_ADDR_ENABLE: c_int = 83;
+        pub const BIO_CTRL_DGRAM_SET_LOCAL_ADDR_ENABLE: c_int = 84;
+        pub const BIO_CTRL_DGRAM_GET_CAPS: c_int = 86;
+        pub const BIO_CTRL_DGRAM_SET_CAPS: c_int = 87;
+        pub const BIO_CTRL_DGRAM_GET_NO_TRUNC: c_int = 88;
+        pub const BIO_CTRL_DGRAM_SET_NO_TRUNC: c_int = 89;
+
+        pub unsafe fn BIO_dgram_get_no_trunc(bio: *mut BIO) -> c_int {
+            BIO_ctrl(bio, BIO_CTRL_DGRAM_GET_NO_TRUNC, 0, ptr::null_mut()) as c_int
+        }
+        pub unsafe fn BIO_dgram_set_no_trunc(bio: *mut BIO, enable: c_int) -> c_int {
+            BIO_ctrl(bio, BIO_CTRL_DGRAM_SET_NO_TRUNC, enable as c_long, ptr::null_mut()) as c_int
+        }
+        pub unsafe fn BIO_dgram_get_cap(bio: *mut BIO) -> u32 {
+            BIO_ctrl(bio, BIO_CTRL_DGRAM_GET_CAPS, 0, ptr::null_mut()) as u32
+        }
+        pub unsafe fn BIO_dgram_set_cap(bio: *mut BIO, cap: u32) -> c_int {
+            BIO_ctrl(bio, BIO_CTRL_DGRAM_SET_CAPS, cap as c_long, ptr::null_mut()) as c_int
+        }
+        pub unsafe fn BIO_dgram_get_local_addr_cap(bio: *mut BIO) -> c_int {
+            BIO_ctrl(bio, BIO_CTRL_DGRAM_GET_LOCAL_ADDR_CAP, 0, ptr::null_mut()) as c_int
+        }
+        pub unsafe fn BIO_dgram_get_local_addr_enable(bio: *mut BIO, enable: *mut c_int) -> c_int {
+            BIO_ctrl(bio, BIO_CTRL_DGRAM_GET_LOCAL_ADDR_ENABLE, 0, enable as *mut c_void) as c_int
+        }
+        pub unsafe fn BIO_dgram_set_local_addr_enable(bio: *mut BIO, enable: c_int) -> c_int {
+            BIO_ctrl(bio, BIO_CTRL_DGRAM_SET_LOCAL_ADDR_ENABLE, enable as c_long, ptr::null_mut()) as c_int
+        }
+        pub unsafe fn BIO_dgram_get_mtu(bio: *mut BIO) -> c_uint {
+            BIO_ctrl(bio, BIO_CTRL_DGRAM_GET_MTU, 0, ptr::null_mut()) as c_uint
+        }
+        pub unsafe fn BIO_dgram_set_mtu(bio: *mut BIO, mtu: c_uint) -> c_int {
+            BIO_ctrl(bio, BIO_CTRL_DGRAM_SET_MTU, mtu as c_long, ptr::null_mut()) as c_int
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/bn.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/bn.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/bn.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/bn.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,15 @@
+use libc::*;
+
+#[cfg(target_pointer_width = "64")]
+pub type BN_ULONG = c_ulonglong;
+#[cfg(target_pointer_width = "32")]
+pub type BN_ULONG = c_uint;
+
+#[cfg(ossl110)]
+pub const BN_FLG_MALLOCED: c_int = 0x01;
+#[cfg(ossl110)]
+pub const BN_FLG_STATIC_DATA: c_int = 0x02;
+#[cfg(ossl110)]
+pub const BN_FLG_CONSTTIME: c_int = 0x04;
+#[cfg(ossl110)]
+pub const BN_FLG_SECURE: c_int = 0x08;
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/cms.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/cms.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/cms.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/cms.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,46 @@
+use libc::*;
+
+#[cfg(ossl101)]
+pub const CMS_TEXT: c_uint = 0x1;
+#[cfg(ossl101)]
+pub const CMS_NOCERTS: c_uint = 0x2;
+#[cfg(ossl101)]
+pub const CMS_NO_CONTENT_VERIFY: c_uint = 0x4;
+#[cfg(ossl101)]
+pub const CMS_NO_ATTR_VERIFY: c_uint = 0x8;
+#[cfg(ossl101)]
+pub const CMS_NOSIGS: c_uint = 0x4 | 0x8;
+#[cfg(ossl101)]
+pub const CMS_NOINTERN: c_uint = 0x10;
+#[cfg(ossl101)]
+pub const CMS_NO_SIGNER_CERT_VERIFY: c_uint = 0x20;
+#[cfg(ossl101)]
+pub const CMS_NOVERIFY: c_uint = 0x20;
+#[cfg(ossl101)]
+pub const CMS_DETACHED: c_uint = 0x40;
+#[cfg(ossl101)]
+pub const CMS_BINARY: c_uint = 0x80;
+#[cfg(ossl101)]
+pub const CMS_NOATTR: c_uint = 0x100;
+#[cfg(ossl101)]
+pub const CMS_NOSMIMECAP: c_uint = 0x200;
+#[cfg(ossl101)]
+pub const CMS_NOOLDMIMETYPE: c_uint = 0x400;
+#[cfg(ossl101)]
+pub const CMS_CRLFEOL: c_uint = 0x800;
+#[cfg(ossl101)]
+pub const CMS_STREAM: c_uint = 0x1000;
+#[cfg(ossl101)]
+pub const CMS_NOCRL: c_uint = 0x2000;
+#[cfg(ossl101)]
+pub const CMS_PARTIAL: c_uint = 0x4000;
+#[cfg(ossl101)]
+pub const CMS_REUSE_DIGEST: c_uint = 0x8000;
+#[cfg(ossl101)]
+pub const CMS_USE_KEYID: c_uint = 0x10000;
+#[cfg(ossl101)]
+pub const CMS_DEBUG_DECRYPT: c_uint = 0x20000;
+#[cfg(ossl102)]
+pub const CMS_KEY_PARAM: c_uint = 0x40000;
+#[cfg(ossl110)]
+pub const CMS_ASCIICRLF: c_uint = 0x80000;
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/crypto.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/crypto.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/crypto.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/crypto.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,134 @@
+use super::*;
+use libc::*;
+
+extern "C" {
+    #[deprecated(note = "use CRYPTO_set_locking_callback__fixed_rust instead")]
+    #[cfg(not(ossl110))]
+    pub fn CRYPTO_set_locking_callback(
+        func: unsafe extern "C" fn(mode: c_int, n: c_int, file: *const c_char, line: c_int),
+    );
+
+    #[deprecated(note = "use CRYPTO_set_id_callback__fixed_rust instead")]
+    #[cfg(not(ossl110))]
+    pub fn CRYPTO_set_id_callback(func: unsafe extern "C" fn() -> c_ulong);
+}
+
+cfg_if! {
+    if #[cfg(ossl110)] {
+        type CRYPTO_EX_new_ret = ();
+        type CRYPTO_EX_dup_from = *const CRYPTO_EX_DATA;
+    } else {
+        type CRYPTO_EX_new_ret = c_int;
+        type CRYPTO_EX_dup_from = *mut CRYPTO_EX_DATA;
+    }
+}
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        type CRYPTO_EX_dup_from_d = *mut *mut c_void;
+    } else {
+        type CRYPTO_EX_dup_from_d = *mut c_void;
+    }
+}
+
+// FIXME should be options
+pub type CRYPTO_EX_new = unsafe extern "C" fn(
+    parent: *mut c_void,
+    ptr: *mut c_void,
+    ad: *mut CRYPTO_EX_DATA,
+    idx: c_int,
+    argl: c_long,
+    argp: *mut c_void,
+) -> CRYPTO_EX_new_ret;
+pub type CRYPTO_EX_dup = unsafe extern "C" fn(
+    to: *mut CRYPTO_EX_DATA,
+    from: CRYPTO_EX_dup_from,
+    from_d: CRYPTO_EX_dup_from_d,
+    idx: c_int,
+    argl: c_long,
+    argp: *mut c_void,
+) -> c_int;
+pub type CRYPTO_EX_free = unsafe extern "C" fn(
+    parent: *mut c_void,
+    ptr: *mut c_void,
+    ad: *mut CRYPTO_EX_DATA,
+    idx: c_int,
+    argl: c_long,
+    argp: *mut c_void,
+);
+
+#[cfg(any(ossl110, libressl390))]
+#[inline]
+#[track_caller]
+pub unsafe fn OPENSSL_malloc(num: usize) -> *mut c_void {
+    CRYPTO_malloc(
+        num,
+        concat!(file!(), "\0").as_ptr() as *const _,
+        line!() as _,
+    )
+}
+
+#[cfg(not(any(ossl110, libressl390)))]
+#[inline]
+#[track_caller]
+pub unsafe fn OPENSSL_malloc(num: c_int) -> *mut c_void {
+    CRYPTO_malloc(
+        num,
+        concat!(file!(), "\0").as_ptr() as *const _,
+        line!() as _,
+    )
+}
+
+#[cfg(any(ossl110, libressl390))]
+#[inline]
+#[track_caller]
+pub unsafe fn OPENSSL_free(addr: *mut c_void) {
+    CRYPTO_free(
+        addr,
+        concat!(file!(), "\0").as_ptr() as *const _,
+        line!() as _,
+    )
+}
+
+#[cfg(not(any(ossl110, libressl390)))]
+#[inline]
+pub unsafe fn OPENSSL_free(addr: *mut c_void) {
+    CRYPTO_free(addr)
+}
+
+#[cfg(not(ossl110))]
+pub const CRYPTO_LOCK_X509: c_int = 3;
+#[cfg(not(ossl110))]
+pub const CRYPTO_LOCK_EVP_PKEY: c_int = 10;
+#[cfg(not(ossl110))]
+pub const CRYPTO_LOCK_SSL_CTX: c_int = 12;
+#[cfg(not(ossl110))]
+pub const CRYPTO_LOCK_SSL_SESSION: c_int = 14;
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl381))] {
+        pub const CRYPTO_EX_INDEX_SSL: c_int = 0;
+        pub const CRYPTO_EX_INDEX_SSL_CTX: c_int = 1;
+    } else if #[cfg(libressl)] {
+        pub const CRYPTO_EX_INDEX_SSL: c_int = 1;
+        pub const CRYPTO_EX_INDEX_SSL_CTX: c_int = 2;
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl271))] {
+        pub const OPENSSL_VERSION: c_int = 0;
+        pub const OPENSSL_CFLAGS: c_int = 1;
+        pub const OPENSSL_BUILT_ON: c_int = 2;
+        pub const OPENSSL_PLATFORM: c_int = 3;
+        pub const OPENSSL_DIR: c_int = 4;
+    } else {
+        pub const SSLEAY_VERSION: c_int = 0;
+        pub const SSLEAY_CFLAGS: c_int = 2;
+        pub const SSLEAY_BUILT_ON: c_int = 3;
+        pub const SSLEAY_PLATFORM: c_int = 4;
+        pub const SSLEAY_DIR: c_int = 5;
+    }
+}
+
+pub const CRYPTO_LOCK: c_int = 1;
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/dtls1.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/dtls1.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/dtls1.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/dtls1.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,9 @@
+use libc::*;
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        pub const DTLS1_COOKIE_LENGTH: c_uint = 255;
+    } else {
+        pub const DTLS1_COOKIE_LENGTH: c_uint = 256;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/ec.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/ec.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/ec.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/ec.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,16 @@
+use libc::*;
+use std::ptr;
+
+use super::*;
+
+pub const OPENSSL_EC_NAMED_CURVE: c_int = 1;
+
+#[cfg(ossl300)]
+pub unsafe fn EVP_EC_gen(curve: *const c_char) -> *mut EVP_PKEY {
+    EVP_PKEY_Q_keygen(
+        ptr::null_mut(),
+        ptr::null_mut(),
+        "EC\0".as_ptr().cast(),
+        curve,
+    )
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/err.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/err.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/err.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/err.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,66 @@
+use libc::*;
+
+pub const ERR_TXT_MALLOCED: c_int = 0x01;
+pub const ERR_TXT_STRING: c_int = 0x02;
+
+pub const ERR_LIB_SYS: c_int = 2;
+pub const ERR_LIB_PEM: c_int = 9;
+pub const ERR_LIB_ASN1: c_int = 13;
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        pub const ERR_SYSTEM_FLAG: c_ulong = c_int::MAX as c_ulong + 1;
+        pub const ERR_SYSTEM_MASK: c_ulong = c_int::MAX as c_ulong;
+
+        pub const ERR_LIB_OFFSET: c_ulong = 23;
+        pub const ERR_LIB_MASK: c_ulong = 0xff;
+        pub const ERR_RFLAGS_OFFSET: c_ulong = 18;
+        pub const ERR_RFLAGS_MASK: c_ulong = 0x1f;
+        pub const ERR_REASON_MASK: c_ulong = 0x7FFFFF;
+
+        pub const ERR_RFLAG_FATAL: c_ulong = 0x1 << ERR_RFLAGS_OFFSET;
+
+        pub const fn ERR_SYSTEM_ERROR(errcode: c_ulong) -> bool {
+            errcode & ERR_SYSTEM_FLAG != 0
+        }
+
+        pub const fn ERR_GET_LIB(errcode: c_ulong) -> c_int {
+            // hacks since `if` isn't yet stable in const functions :(
+            ((ERR_LIB_SYS as c_ulong * (ERR_SYSTEM_ERROR(errcode) as c_ulong)) |
+            (((errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK) * (!ERR_SYSTEM_ERROR(errcode) as c_ulong))) as c_int
+        }
+
+        pub const fn ERR_GET_FUNC(_errcode: c_ulong) -> c_int {
+            0
+        }
+
+        pub const fn ERR_GET_REASON(errcode: c_ulong) -> c_int {
+            // hacks since `if` isn't yet stable in const functions :(
+            ((ERR_LIB_SYS as c_ulong * (ERR_SYSTEM_ERROR(errcode) as c_ulong)) |
+            ((errcode & ERR_REASON_MASK) * (!ERR_SYSTEM_ERROR(errcode) as c_ulong))) as c_int
+        }
+
+        pub const fn ERR_PACK(lib: c_int, _func: c_int, reason: c_int) -> c_ulong {
+            ((lib as c_ulong & ERR_LIB_MASK) << ERR_LIB_OFFSET) |
+            (reason as c_ulong & ERR_REASON_MASK)
+        }
+    } else {
+        pub const fn ERR_PACK(l: c_int, f: c_int, r: c_int) -> c_ulong {
+            ((l as c_ulong & 0x0FF) << 24) |
+            ((f as c_ulong & 0xFFF) << 12) |
+            (r as c_ulong & 0xFFF)
+        }
+
+        pub const fn ERR_GET_LIB(l: c_ulong) -> c_int {
+            ((l >> 24) & 0x0FF) as c_int
+        }
+
+        pub const fn ERR_GET_FUNC(l: c_ulong) -> c_int {
+            ((l >> 12) & 0xFFF) as c_int
+        }
+
+        pub const fn ERR_GET_REASON(l: c_ulong) -> c_int {
+            (l & 0xFFF) as c_int
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/evp.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/evp.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/evp.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/evp.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,326 @@
+use super::*;
+use libc::*;
+
+pub const EVP_MAX_MD_SIZE: c_uint = 64;
+
+pub const PKCS5_SALT_LEN: c_int = 8;
+pub const PKCS12_DEFAULT_ITER: c_int = 2048;
+
+pub const EVP_PKEY_RSA: c_int = NID_rsaEncryption;
+#[cfg(any(ossl111, libressl310, boringssl))]
+pub const EVP_PKEY_RSA_PSS: c_int = NID_rsassaPss;
+pub const EVP_PKEY_DSA: c_int = NID_dsa;
+pub const EVP_PKEY_DH: c_int = NID_dhKeyAgreement;
+#[cfg(ossl110)]
+pub const EVP_PKEY_DHX: c_int = NID_dhpublicnumber;
+pub const EVP_PKEY_EC: c_int = NID_X9_62_id_ecPublicKey;
+#[cfg(ossl111)]
+pub const EVP_PKEY_SM2: c_int = NID_sm2;
+#[cfg(any(ossl111, libressl370))]
+pub const EVP_PKEY_X25519: c_int = NID_X25519;
+#[cfg(any(ossl111, libressl370))]
+pub const EVP_PKEY_ED25519: c_int = NID_ED25519;
+#[cfg(ossl111)]
+pub const EVP_PKEY_X448: c_int = NID_X448;
+#[cfg(ossl111)]
+pub const EVP_PKEY_ED448: c_int = NID_ED448;
+pub const EVP_PKEY_HMAC: c_int = NID_hmac;
+pub const EVP_PKEY_CMAC: c_int = NID_cmac;
+#[cfg(ossl111)]
+pub const EVP_PKEY_POLY1305: c_int = NID_poly1305;
+#[cfg(any(ossl110, libressl360))]
+pub const EVP_PKEY_HKDF: c_int = NID_hkdf;
+
+#[cfg(ossl102)]
+pub const EVP_CIPHER_CTX_FLAG_WRAP_ALLOW: c_int = 0x1;
+
+pub const EVP_CTRL_GCM_SET_IVLEN: c_int = 0x9;
+pub const EVP_CTRL_GCM_GET_TAG: c_int = 0x10;
+pub const EVP_CTRL_GCM_SET_TAG: c_int = 0x11;
+
+pub unsafe fn EVP_get_digestbynid(type_: c_int) -> *const EVP_MD {
+    EVP_get_digestbyname(OBJ_nid2sn(type_))
+}
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        #[inline]
+        pub unsafe fn EVP_MD_CTX_md(ctx: *const EVP_MD_CTX) -> *const EVP_MD {
+            EVP_MD_CTX_get0_md(ctx)
+        }
+
+        #[inline]
+        pub unsafe fn EVP_MD_CTX_get_size(ctx: *const EVP_MD_CTX) -> c_int {
+            EVP_MD_get_size(EVP_MD_CTX_get0_md(ctx))
+        }
+
+        #[inline]
+        pub unsafe fn EVP_MD_CTX_size(ctx: *const EVP_MD_CTX) -> c_int {
+            EVP_MD_CTX_get_size(ctx)
+        }
+
+        #[inline]
+        pub unsafe fn EVP_MD_block_size(md: *const EVP_MD) -> c_int {
+            EVP_MD_get_block_size(md)
+        }
+
+        #[inline]
+        pub unsafe fn EVP_MD_size(md: *const EVP_MD) -> c_int {
+            EVP_MD_get_size(md)
+        }
+
+        #[inline]
+        pub unsafe fn EVP_MD_type(md: *const EVP_MD) -> c_int {
+            EVP_MD_get_type(md)
+        }
+
+        #[inline]
+        pub unsafe fn EVP_CIPHER_key_length(cipher: *const EVP_CIPHER) -> c_int {
+            EVP_CIPHER_get_key_length(cipher)
+        }
+
+        #[inline]
+        pub unsafe fn EVP_CIPHER_block_size(cipher: *const EVP_CIPHER) -> c_int {
+            EVP_CIPHER_get_block_size(cipher)
+        }
+
+        #[inline]
+        pub unsafe fn EVP_CIPHER_iv_length(cipher: *const EVP_CIPHER) -> c_int {
+            EVP_CIPHER_get_iv_length(cipher)
+        }
+
+        #[inline]
+        pub unsafe fn EVP_CIPHER_nid(cipher: *const EVP_CIPHER) -> c_int {
+            EVP_CIPHER_get_nid(cipher)
+        }
+
+        #[inline]
+        pub unsafe fn EVP_CIPHER_CTX_block_size(ctx: *const EVP_CIPHER_CTX) -> c_int {
+            EVP_CIPHER_CTX_get_block_size(ctx)
+        }
+
+        #[inline]
+        pub unsafe fn EVP_CIPHER_CTX_key_length(ctx: *const EVP_CIPHER_CTX) -> c_int {
+            EVP_CIPHER_CTX_get_key_length(ctx)
+        }
+
+        #[inline]
+        pub unsafe fn EVP_CIPHER_CTX_iv_length(ctx: *const EVP_CIPHER_CTX) -> c_int {
+            EVP_CIPHER_CTX_get_iv_length(ctx)
+        }
+
+        #[inline]
+        pub unsafe fn EVP_CIPHER_CTX_num(ctx: *const EVP_CIPHER_CTX) -> c_int {
+            EVP_CIPHER_CTX_get_num(ctx)
+        }
+    } else {
+        pub unsafe fn EVP_MD_CTX_size(ctx: *const EVP_MD_CTX) -> c_int {
+            EVP_MD_size(EVP_MD_CTX_md(ctx))
+        }
+    }
+}
+#[cfg(not(ossl300))]
+#[inline]
+pub unsafe fn EVP_DigestSignUpdate(
+    ctx: *mut EVP_MD_CTX,
+    data: *const c_void,
+    dsize: size_t,
+) -> c_int {
+    EVP_DigestUpdate(ctx, data, dsize)
+}
+#[cfg(not(ossl300))]
+#[inline]
+pub unsafe fn EVP_DigestVerifyUpdate(
+    ctx: *mut EVP_MD_CTX,
+    data: *const c_void,
+    dsize: size_t,
+) -> c_int {
+    EVP_DigestUpdate(ctx, data, dsize)
+}
+#[cfg(ossl300)]
+#[inline]
+pub unsafe fn EVP_PKEY_size(pkey: *const EVP_PKEY) -> c_int {
+    EVP_PKEY_get_size(pkey)
+}
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        #[inline]
+        pub unsafe fn EVP_PKEY_id(pkey: *const EVP_PKEY) -> c_int {
+            EVP_PKEY_get_id(pkey)
+        }
+
+        #[inline]
+        pub unsafe fn EVP_PKEY_bits(pkey: *const EVP_PKEY) -> c_int {
+            EVP_PKEY_get_bits(pkey)
+        }
+
+        #[inline]
+        pub unsafe fn EVP_PKEY_security_bits(pkey: *const EVP_PKEY) -> c_int {
+            EVP_PKEY_get_security_bits(pkey)
+        }
+    }
+}
+
+pub const EVP_PKEY_OP_KEYGEN: c_int = 1 << 2;
+cfg_if! {
+    if #[cfg(ossl300)] {
+        pub const EVP_PKEY_OP_SIGN: c_int = 1 << 4;
+        pub const EVP_PKEY_OP_VERIFY: c_int = 1 << 5;
+        pub const EVP_PKEY_OP_VERIFYRECOVER: c_int = 1 << 6;
+        pub const EVP_PKEY_OP_SIGNCTX: c_int = 1 << 7;
+        pub const EVP_PKEY_OP_VERIFYCTX: c_int = 1 << 8;
+        pub const EVP_PKEY_OP_ENCRYPT: c_int = 1 << 9;
+        pub const EVP_PKEY_OP_DECRYPT: c_int = 1 << 10;
+        pub const EVP_PKEY_OP_DERIVE: c_int = 1 << 11;
+    } else {
+        pub const EVP_PKEY_OP_SIGN: c_int = 1 << 3;
+        pub const EVP_PKEY_OP_VERIFY: c_int = 1 << 4;
+        pub const EVP_PKEY_OP_VERIFYRECOVER: c_int = 1 << 5;
+        pub const EVP_PKEY_OP_SIGNCTX: c_int = 1 << 6;
+        pub const EVP_PKEY_OP_VERIFYCTX: c_int = 1 << 7;
+        pub const EVP_PKEY_OP_ENCRYPT: c_int = 1 << 8;
+        pub const EVP_PKEY_OP_DECRYPT: c_int = 1 << 9;
+        pub const EVP_PKEY_OP_DERIVE: c_int = 1 << 10;
+    }
+}
+
+pub const EVP_PKEY_OP_TYPE_SIG: c_int = EVP_PKEY_OP_SIGN
+    | EVP_PKEY_OP_VERIFY
+    | EVP_PKEY_OP_VERIFYRECOVER
+    | EVP_PKEY_OP_SIGNCTX
+    | EVP_PKEY_OP_VERIFYCTX;
+
+pub const EVP_PKEY_OP_TYPE_CRYPT: c_int = EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT;
+
+pub const EVP_PKEY_CTRL_MD: c_int = 1;
+
+pub const EVP_PKEY_CTRL_SET_MAC_KEY: c_int = 6;
+
+pub const EVP_PKEY_CTRL_CIPHER: c_int = 12;
+
+pub const EVP_PKEY_ALG_CTRL: c_int = 0x1000;
+
+#[cfg(any(ossl111, libressl360))]
+pub const EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND: c_int = 0;
+
+#[cfg(any(ossl111, libressl360))]
+pub const EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY: c_int = 1;
+
+#[cfg(any(ossl111, libressl360))]
+pub const EVP_PKEY_HKDEF_MODE_EXPAND_ONLY: c_int = 2;
+
+#[cfg(any(ossl110, libressl360))]
+pub const EVP_PKEY_CTRL_HKDF_MD: c_int = EVP_PKEY_ALG_CTRL + 3;
+
+#[cfg(any(ossl110, libressl360))]
+pub const EVP_PKEY_CTRL_HKDF_SALT: c_int = EVP_PKEY_ALG_CTRL + 4;
+
+#[cfg(any(ossl110, libressl360))]
+pub const EVP_PKEY_CTRL_HKDF_KEY: c_int = EVP_PKEY_ALG_CTRL + 5;
+
+#[cfg(any(ossl110, libressl360))]
+pub const EVP_PKEY_CTRL_HKDF_INFO: c_int = EVP_PKEY_ALG_CTRL + 6;
+
+#[cfg(any(ossl111, libressl360))]
+pub const EVP_PKEY_CTRL_HKDF_MODE: c_int = EVP_PKEY_ALG_CTRL + 7;
+
+#[cfg(any(all(ossl111, not(ossl300)), libressl360))]
+pub unsafe fn EVP_PKEY_CTX_set_hkdf_mode(ctx: *mut EVP_PKEY_CTX, mode: c_int) -> c_int {
+    EVP_PKEY_CTX_ctrl(
+        ctx,
+        -1,
+        EVP_PKEY_OP_DERIVE,
+        EVP_PKEY_CTRL_HKDF_MODE,
+        mode,
+        std::ptr::null_mut(),
+    )
+}
+
+#[cfg(any(all(ossl110, not(ossl300)), libressl360))]
+pub unsafe fn EVP_PKEY_CTX_set_hkdf_md(ctx: *mut EVP_PKEY_CTX, md: *const EVP_MD) -> c_int {
+    EVP_PKEY_CTX_ctrl(
+        ctx,
+        -1,
+        EVP_PKEY_OP_DERIVE,
+        EVP_PKEY_CTRL_HKDF_MD,
+        0,
+        md as *mut c_void,
+    )
+}
+
+#[cfg(any(all(ossl110, not(ossl300)), libressl360))]
+pub unsafe fn EVP_PKEY_CTX_set1_hkdf_salt(
+    ctx: *mut EVP_PKEY_CTX,
+    salt: *const u8,
+    saltlen: c_int,
+) -> c_int {
+    EVP_PKEY_CTX_ctrl(
+        ctx,
+        -1,
+        EVP_PKEY_OP_DERIVE,
+        EVP_PKEY_CTRL_HKDF_SALT,
+        saltlen,
+        salt as *mut c_void,
+    )
+}
+
+#[cfg(any(all(ossl110, not(ossl300)), libressl360))]
+pub unsafe fn EVP_PKEY_CTX_set1_hkdf_key(
+    ctx: *mut EVP_PKEY_CTX,
+    key: *const u8,
+    keylen: c_int,
+) -> c_int {
+    EVP_PKEY_CTX_ctrl(
+        ctx,
+        -1,
+        EVP_PKEY_OP_DERIVE,
+        EVP_PKEY_CTRL_HKDF_KEY,
+        keylen,
+        key as *mut c_void,
+    )
+}
+
+#[cfg(any(all(ossl110, not(ossl300)), libressl360))]
+pub unsafe fn EVP_PKEY_CTX_add1_hkdf_info(
+    ctx: *mut EVP_PKEY_CTX,
+    info: *const u8,
+    infolen: c_int,
+) -> c_int {
+    EVP_PKEY_CTX_ctrl(
+        ctx,
+        -1,
+        EVP_PKEY_OP_DERIVE,
+        EVP_PKEY_CTRL_HKDF_INFO,
+        infolen,
+        info as *mut c_void,
+    )
+}
+
+#[cfg(all(not(ossl300), not(boringssl)))]
+pub unsafe fn EVP_PKEY_CTX_set_signature_md(cxt: *mut EVP_PKEY_CTX, md: *mut EVP_MD) -> c_int {
+    EVP_PKEY_CTX_ctrl(
+        cxt,
+        -1,
+        EVP_PKEY_OP_TYPE_SIG,
+        EVP_PKEY_CTRL_MD,
+        0,
+        md as *mut c_void,
+    )
+}
+
+pub unsafe fn EVP_PKEY_assign_RSA(pkey: *mut EVP_PKEY, rsa: *mut RSA) -> c_int {
+    EVP_PKEY_assign(pkey, EVP_PKEY_RSA, rsa as *mut c_void)
+}
+
+pub unsafe fn EVP_PKEY_assign_DSA(pkey: *mut EVP_PKEY, dsa: *mut DSA) -> c_int {
+    EVP_PKEY_assign(pkey, EVP_PKEY_DSA, dsa as *mut c_void)
+}
+
+pub unsafe fn EVP_PKEY_assign_DH(pkey: *mut EVP_PKEY, dh: *mut DH) -> c_int {
+    EVP_PKEY_assign(pkey, EVP_PKEY_DH, dh as *mut c_void)
+}
+
+pub unsafe fn EVP_PKEY_assign_EC_KEY(pkey: *mut EVP_PKEY, ec_key: *mut EC_KEY) -> c_int {
+    EVP_PKEY_assign(pkey, EVP_PKEY_EC, ec_key as *mut c_void)
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/aes.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/aes.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/aes.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/aes.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,40 @@
+use super::super::*;
+use libc::*;
+
+#[repr(C)]
+pub struct AES_KEY {
+    // There is some business with AES_LONG which is there to ensure the values here are 32 bits
+    rd_key: [u32; 4 * (AES_MAXNR as usize + 1)],
+    rounds: c_int,
+}
+
+extern "C" {
+    pub fn AES_set_encrypt_key(userKey: *const c_uchar, bits: c_int, key: *mut AES_KEY) -> c_int;
+    pub fn AES_set_decrypt_key(userKey: *const c_uchar, bits: c_int, key: *mut AES_KEY) -> c_int;
+
+    #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+    pub fn AES_ige_encrypt(
+        in_: *const c_uchar,
+        out: *mut c_uchar,
+        length: size_t,
+        key: *const AES_KEY,
+        ivec: *mut c_uchar,
+        enc: c_int,
+    );
+
+    pub fn AES_wrap_key(
+        key: *mut AES_KEY,
+        iv: *const c_uchar,
+        out: *mut c_uchar,
+        in_: *const c_uchar,
+        inlen: c_uint,
+    ) -> c_int;
+
+    pub fn AES_unwrap_key(
+        key: *mut AES_KEY,
+        iv: *const c_uchar,
+        out: *mut c_uchar,
+        in_: *const c_uchar,
+        inlen: c_uint,
+    ) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/asn1.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/asn1.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/asn1.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/asn1.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,115 @@
+use super::super::*;
+use libc::*;
+
+#[repr(C)]
+pub struct ASN1_ENCODING {
+    pub enc: *mut c_uchar,
+    pub len: c_long,
+    pub modified: c_int,
+}
+
+extern "C" {
+    pub fn ASN1_OBJECT_free(x: *mut ASN1_OBJECT);
+    pub fn OBJ_dup(x: *const ASN1_OBJECT) -> *mut ASN1_OBJECT;
+}
+
+stack!(stack_st_ASN1_OBJECT);
+
+#[repr(C)]
+pub struct ASN1_TYPE {
+    pub type_: c_int,
+    pub value: ASN1_TYPE_value,
+}
+#[repr(C)]
+pub union ASN1_TYPE_value {
+    pub ptr: *mut c_char,
+    pub boolean: ASN1_BOOLEAN,
+    pub asn1_string: *mut ASN1_STRING,
+    pub object: *mut ASN1_OBJECT,
+    pub integer: *mut ASN1_INTEGER,
+    pub enumerated: *mut ASN1_ENUMERATED,
+    pub bit_string: *mut ASN1_BIT_STRING,
+    pub octet_string: *mut ASN1_OCTET_STRING,
+    pub printablestring: *mut ASN1_PRINTABLESTRING,
+    pub t61string: *mut ASN1_T61STRING,
+    pub ia5string: *mut ASN1_IA5STRING,
+    pub generalstring: *mut ASN1_GENERALSTRING,
+    pub bmpstring: *mut ASN1_BMPSTRING,
+    pub universalstring: *mut ASN1_UNIVERSALSTRING,
+    pub utctime: *mut ASN1_UTCTIME,
+    pub generalizedtime: *mut ASN1_GENERALIZEDTIME,
+    pub visiblestring: *mut ASN1_VISIBLESTRING,
+    pub utf8string: *mut ASN1_UTF8STRING,
+    pub set: *mut ASN1_STRING,
+    pub sequence: *mut ASN1_STRING,
+    pub asn1_value: *mut ASN1_VALUE,
+}
+
+extern "C" {
+    pub fn ASN1_STRING_type_new(ty: c_int) -> *mut ASN1_STRING;
+    #[cfg(any(ossl110, libressl273))]
+    pub fn ASN1_STRING_get0_data(x: *const ASN1_STRING) -> *const c_uchar;
+    #[cfg(any(all(ossl101, not(ossl110)), libressl))]
+    pub fn ASN1_STRING_data(x: *mut ASN1_STRING) -> *mut c_uchar;
+    pub fn ASN1_STRING_new() -> *mut ASN1_STRING;
+    pub fn ASN1_OCTET_STRING_new() -> *mut ASN1_OCTET_STRING;
+    pub fn ASN1_STRING_free(x: *mut ASN1_STRING);
+    pub fn ASN1_STRING_length(x: *const ASN1_STRING) -> c_int;
+    pub fn ASN1_STRING_set(x: *mut ASN1_STRING, data: *const c_void, len_in: c_int) -> c_int;
+    pub fn ASN1_OCTET_STRING_set(
+        x: *mut ASN1_OCTET_STRING,
+        data: *const c_uchar,
+        len_in: c_int,
+    ) -> c_int;
+
+    pub fn ASN1_BIT_STRING_free(x: *mut ASN1_BIT_STRING);
+    pub fn ASN1_OCTET_STRING_free(x: *mut ASN1_OCTET_STRING);
+
+    pub fn ASN1_GENERALIZEDTIME_free(tm: *mut ASN1_GENERALIZEDTIME);
+    pub fn ASN1_GENERALIZEDTIME_print(b: *mut BIO, tm: *const ASN1_GENERALIZEDTIME) -> c_int;
+    pub fn ASN1_TIME_new() -> *mut ASN1_TIME;
+    #[cfg(ossl102)]
+    pub fn ASN1_TIME_diff(
+        pday: *mut c_int,
+        psec: *mut c_int,
+        from: *const ASN1_TIME,
+        to: *const ASN1_TIME,
+    ) -> c_int;
+    pub fn ASN1_TIME_free(tm: *mut ASN1_TIME);
+    pub fn ASN1_TIME_print(b: *mut BIO, tm: *const ASN1_TIME) -> c_int;
+    pub fn ASN1_TIME_set(from: *mut ASN1_TIME, to: time_t) -> *mut ASN1_TIME;
+
+    pub fn ASN1_INTEGER_free(x: *mut ASN1_INTEGER);
+    pub fn ASN1_INTEGER_dup(a: *const ASN1_INTEGER) -> *mut ASN1_INTEGER;
+    pub fn ASN1_INTEGER_get(dest: *const ASN1_INTEGER) -> c_long;
+    pub fn ASN1_INTEGER_set(dest: *mut ASN1_INTEGER, value: c_long) -> c_int;
+    pub fn ASN1_INTEGER_cmp(a: *const ASN1_INTEGER, b: *const ASN1_INTEGER) -> c_int;
+    pub fn BN_to_ASN1_INTEGER(bn: *const BIGNUM, ai: *mut ASN1_INTEGER) -> *mut ASN1_INTEGER;
+    pub fn ASN1_INTEGER_to_BN(ai: *const ASN1_INTEGER, bn: *mut BIGNUM) -> *mut BIGNUM;
+
+    pub fn ASN1_TIME_set_string(s: *mut ASN1_TIME, str: *const c_char) -> c_int;
+    #[cfg(ossl111)]
+    pub fn ASN1_TIME_set_string_X509(s: *mut ASN1_TIME, str: *const c_char) -> c_int;
+
+    pub fn ASN1_ENUMERATED_free(a: *mut ASN1_ENUMERATED);
+    #[cfg(ossl110)]
+    pub fn ASN1_ENUMERATED_get_int64(pr: *mut i64, a: *const ASN1_ENUMERATED) -> c_int;
+
+    pub fn ASN1_TYPE_new() -> *mut ASN1_TYPE;
+    pub fn ASN1_TYPE_set(a: *mut ASN1_TYPE, type_: c_int, value: *mut c_void);
+    pub fn ASN1_TYPE_free(x: *mut ASN1_TYPE);
+    pub fn d2i_ASN1_TYPE(
+        k: *mut *mut ASN1_TYPE,
+        buf: *mut *const u8,
+        len: c_long,
+    ) -> *mut ASN1_TYPE;
+}
+
+const_ptr_api! {
+    extern "C" {
+        pub fn ASN1_STRING_to_UTF8(out: *mut *mut c_uchar, s: #[const_ptr_if(any(ossl110, libressl280))] ASN1_STRING) -> c_int;
+        pub fn ASN1_STRING_type(x: #[const_ptr_if(any(ossl110, libressl280))]  ASN1_STRING) -> c_int;
+        pub fn ASN1_generate_v3(str: #[const_ptr_if(any(ossl110, libressl280))] c_char, cnf: *mut X509V3_CTX) -> *mut ASN1_TYPE;
+        pub fn i2d_ASN1_TYPE(a: #[const_ptr_if(ossl300)] ASN1_TYPE, pp: *mut *mut c_uchar) -> c_int;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/bio.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/bio.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/bio.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/bio.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,165 @@
+use super::super::*;
+use libc::*;
+
+extern "C" {
+    pub fn BIO_set_flags(b: *mut BIO, flags: c_int);
+    pub fn BIO_clear_flags(b: *mut BIO, flags: c_int);
+}
+
+pub type bio_info_cb =
+    Option<unsafe extern "C" fn(*mut BIO, c_int, *const c_char, c_int, c_long, c_long)>;
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl280))] {
+        pub enum BIO_METHOD {}
+    } else {
+        #[repr(C)]
+        pub struct BIO_METHOD {
+            pub type_: c_int,
+            pub name: *const c_char,
+            pub bwrite: Option<unsafe extern "C" fn(*mut BIO, *const c_char, c_int) -> c_int>,
+            pub bread: Option<unsafe extern "C" fn(*mut BIO, *mut c_char, c_int) -> c_int>,
+            pub bputs: Option<unsafe extern "C" fn(*mut BIO, *const c_char) -> c_int>,
+            pub bgets: Option<unsafe extern "C" fn(*mut BIO, *mut c_char, c_int) -> c_int>,
+            pub ctrl: Option<unsafe extern "C" fn(*mut BIO, c_int, c_long, *mut c_void) -> c_long>,
+            pub create: Option<unsafe extern "C" fn(*mut BIO) -> c_int>,
+            pub destroy: Option<unsafe extern "C" fn(*mut BIO) -> c_int>,
+            pub callback_ctrl: Option<unsafe extern "C" fn(*mut BIO, c_int, bio_info_cb) -> c_long>,
+        }
+    }
+}
+
+const_ptr_api! {
+    extern "C" {
+        pub fn BIO_s_file() -> #[const_ptr_if(any(ossl110, libressl280))] BIO_METHOD;
+        pub fn BIO_new(type_: #[const_ptr_if(any(ossl110, libressl280))] BIO_METHOD) -> *mut BIO;
+    }
+}
+extern "C" {
+    #[cfg(not(osslconf = "OPENSSL_NO_STDIO"))]
+    pub fn BIO_new_fp(stream: *mut FILE, close_flag: c_int) -> *mut BIO;
+    #[cfg(any(ossl110, libressl273))]
+    pub fn BIO_set_data(a: *mut BIO, data: *mut c_void);
+    #[cfg(any(ossl110, libressl273))]
+    pub fn BIO_get_data(a: *mut BIO) -> *mut c_void;
+    #[cfg(any(ossl110, libressl273))]
+    pub fn BIO_set_init(a: *mut BIO, init: c_int);
+    pub fn BIO_write(b: *mut BIO, buf: *const c_void, len: c_int) -> c_int;
+    pub fn BIO_read(b: *mut BIO, buf: *mut c_void, len: c_int) -> c_int;
+    pub fn BIO_ctrl(b: *mut BIO, cmd: c_int, larg: c_long, parg: *mut c_void) -> c_long;
+    pub fn BIO_free_all(b: *mut BIO);
+}
+
+const_ptr_api! {
+    extern "C" {
+        pub fn BIO_s_mem() -> #[const_ptr_if(any(ossl110, libressl280))] BIO_METHOD;
+        pub fn BIO_new_mem_buf(buf: #[const_ptr_if(any(ossl102, libressl280))] c_void, len: c_int) -> *mut BIO;
+    }
+}
+
+extern "C" {
+    #[cfg(not(osslconf = "OPENSSL_NO_SOCK"))]
+    pub fn BIO_new_socket(sock: c_int, close_flag: c_int) -> *mut BIO;
+
+    #[cfg(any(ossl110, libressl273))]
+    pub fn BIO_meth_new(type_: c_int, name: *const c_char) -> *mut BIO_METHOD;
+    #[cfg(any(ossl110, libressl273))]
+    pub fn BIO_meth_free(biom: *mut BIO_METHOD);
+}
+
+#[allow(clashing_extern_declarations)]
+extern "C" {
+    #[cfg(any(ossl110, libressl273))]
+    #[link_name = "BIO_meth_set_write"]
+    pub fn BIO_meth_set_write__fixed_rust(
+        biom: *mut BIO_METHOD,
+        write: Option<unsafe extern "C" fn(*mut BIO, *const c_char, c_int) -> c_int>,
+    ) -> c_int;
+    #[cfg(any(ossl110, libressl273))]
+    #[link_name = "BIO_meth_set_read"]
+    pub fn BIO_meth_set_read__fixed_rust(
+        biom: *mut BIO_METHOD,
+        read: Option<unsafe extern "C" fn(*mut BIO, *mut c_char, c_int) -> c_int>,
+    ) -> c_int;
+    #[cfg(any(ossl110, libressl273))]
+    #[link_name = "BIO_meth_set_puts"]
+    pub fn BIO_meth_set_puts__fixed_rust(
+        biom: *mut BIO_METHOD,
+        read: Option<unsafe extern "C" fn(*mut BIO, *const c_char) -> c_int>,
+    ) -> c_int;
+    #[cfg(any(ossl110, libressl273))]
+    #[link_name = "BIO_meth_set_ctrl"]
+    pub fn BIO_meth_set_ctrl__fixed_rust(
+        biom: *mut BIO_METHOD,
+        read: Option<unsafe extern "C" fn(*mut BIO, c_int, c_long, *mut c_void) -> c_long>,
+    ) -> c_int;
+    #[cfg(any(ossl110, libressl273))]
+    #[link_name = "BIO_meth_set_create"]
+    pub fn BIO_meth_set_create__fixed_rust(
+        biom: *mut BIO_METHOD,
+        create: Option<unsafe extern "C" fn(*mut BIO) -> c_int>,
+    ) -> c_int;
+    #[cfg(any(ossl110, libressl273))]
+    #[link_name = "BIO_meth_set_destroy"]
+    pub fn BIO_meth_set_destroy__fixed_rust(
+        biom: *mut BIO_METHOD,
+        destroy: Option<unsafe extern "C" fn(*mut BIO) -> c_int>,
+    ) -> c_int;
+}
+
+#[cfg(ossl320)]
+extern "C" {
+    pub fn BIO_meth_set_sendmmsg(
+        biom: *mut BIO_METHOD,
+        f: Option<
+            unsafe extern "C" fn(
+                arg1: *mut BIO,
+                arg2: *mut BIO_MSG,
+                arg3: usize,
+                arg4: usize,
+                arg5: u64,
+                arg6: *mut usize,
+            ) -> c_int,
+        >,
+    ) -> c_int;
+    pub fn BIO_meth_set_recvmmsg(
+        biom: *mut BIO_METHOD,
+        f: Option<
+            unsafe extern "C" fn(
+                arg1: *mut BIO,
+                arg2: *mut BIO_MSG,
+                arg3: usize,
+                arg4: usize,
+                arg5: u64,
+                arg6: *mut usize,
+            ) -> c_int,
+        >,
+    ) -> c_int;
+    pub fn BIO_new_bio_dgram_pair(
+        bio1: *mut *mut BIO,
+        writebuf1: usize,
+        bio2: *mut *mut BIO,
+        writebuf2: usize,
+    ) -> c_int;
+    pub fn BIO_s_dgram_pair() -> *const BIO_METHOD;
+    pub fn BIO_s_datagram() -> *const BIO_METHOD;
+    pub fn BIO_get_rpoll_descriptor(b: *mut BIO, desc: *mut BIO_POLL_DESCRIPTOR) -> c_int;
+    pub fn BIO_get_wpoll_descriptor(b: *mut BIO, desc: *mut BIO_POLL_DESCRIPTOR) -> c_int;
+    pub fn BIO_sendmmsg(
+        b: *mut BIO,
+        msg: *mut BIO_MSG,
+        stride: usize,
+        num_msg: usize,
+        flags: u64,
+        msgs_processed: *mut usize,
+    ) -> c_int;
+    pub fn BIO_recvmmsg(
+        b: *mut BIO,
+        msg: *mut BIO_MSG,
+        stride: usize,
+        num_msg: usize,
+        flags: u64,
+        msgs_processed: *mut usize,
+    ) -> c_int;
+    pub fn BIO_err_is_non_fatal(errcode: c_uint) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/bn.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/bn.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/bn.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/bn.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,176 @@
+use super::super::*;
+use libc::*;
+
+extern "C" {
+    pub fn BN_CTX_new() -> *mut BN_CTX;
+    #[cfg(ossl110)]
+    pub fn BN_CTX_secure_new() -> *mut BN_CTX;
+    pub fn BN_CTX_free(ctx: *mut BN_CTX);
+    pub fn BN_rand(r: *mut BIGNUM, bits: c_int, top: c_int, bottom: c_int) -> c_int;
+    #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+    pub fn BN_pseudo_rand(r: *mut BIGNUM, bits: c_int, top: c_int, bottom: c_int) -> c_int;
+    pub fn BN_rand_range(r: *mut BIGNUM, range: *const BIGNUM) -> c_int;
+    #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+    pub fn BN_pseudo_rand_range(r: *mut BIGNUM, range: *const BIGNUM) -> c_int;
+    pub fn BN_new() -> *mut BIGNUM;
+    #[cfg(ossl110)]
+    pub fn BN_secure_new() -> *mut BIGNUM;
+    #[cfg(ossl110)]
+    pub fn BN_set_flags(b: *mut BIGNUM, n: c_int);
+    #[cfg(ossl110)]
+    pub fn BN_get_flags(b: *const BIGNUM, n: c_int) -> c_int;
+    pub fn BN_num_bits(bn: *const BIGNUM) -> c_int;
+    pub fn BN_clear_free(bn: *mut BIGNUM);
+    pub fn BN_bin2bn(s: *const u8, size: c_int, ret: *mut BIGNUM) -> *mut BIGNUM;
+    pub fn BN_bn2bin(a: *const BIGNUM, to: *mut u8) -> c_int;
+    #[cfg(any(ossl110, libressl340))]
+    pub fn BN_bn2binpad(a: *const BIGNUM, to: *mut u8, tolen: c_int) -> c_int;
+    pub fn BN_sub(r: *mut BIGNUM, a: *const BIGNUM, b: *const BIGNUM) -> c_int;
+    pub fn BN_add(r: *mut BIGNUM, a: *const BIGNUM, b: *const BIGNUM) -> c_int;
+    pub fn BN_mul(r: *mut BIGNUM, a: *const BIGNUM, b: *const BIGNUM, ctx: *mut BN_CTX) -> c_int;
+    pub fn BN_sqr(r: *mut BIGNUM, a: *const BIGNUM, ctx: *mut BN_CTX) -> c_int;
+    pub fn BN_set_negative(bn: *mut BIGNUM, n: c_int);
+    #[cfg(any(ossl110, libressl350))]
+    pub fn BN_is_negative(b: *const BIGNUM) -> c_int;
+    #[cfg(any(ossl110, libressl350))]
+    pub fn BN_is_odd(b: *const BIGNUM) -> c_int;
+
+    pub fn BN_div(
+        dv: *mut BIGNUM,
+        rem: *mut BIGNUM,
+        a: *const BIGNUM,
+        b: *const BIGNUM,
+        ctx: *mut BN_CTX,
+    ) -> c_int;
+    pub fn BN_nnmod(
+        rem: *mut BIGNUM,
+        a: *const BIGNUM,
+        m: *const BIGNUM,
+        ctx: *mut BN_CTX,
+    ) -> c_int;
+    pub fn BN_mod_add(
+        r: *mut BIGNUM,
+        a: *const BIGNUM,
+        b: *const BIGNUM,
+        m: *const BIGNUM,
+        ctx: *mut BN_CTX,
+    ) -> c_int;
+    pub fn BN_mod_sub(
+        r: *mut BIGNUM,
+        a: *const BIGNUM,
+        b: *const BIGNUM,
+        m: *const BIGNUM,
+        ctx: *mut BN_CTX,
+    ) -> c_int;
+    pub fn BN_mod_mul(
+        r: *mut BIGNUM,
+        a: *const BIGNUM,
+        b: *const BIGNUM,
+        m: *const BIGNUM,
+        ctx: *mut BN_CTX,
+    ) -> c_int;
+    pub fn BN_mod_sqr(
+        r: *mut BIGNUM,
+        a: *const BIGNUM,
+        m: *const BIGNUM,
+        ctx: *mut BN_CTX,
+    ) -> c_int;
+    pub fn BN_mod_sqrt(
+        ret: *mut BIGNUM,
+        a: *const BIGNUM,
+        p: *const BIGNUM,
+        ctx: *mut BN_CTX,
+    ) -> *mut BIGNUM;
+
+    pub fn BN_mod_word(r: *const BIGNUM, w: BN_ULONG) -> BN_ULONG;
+    pub fn BN_div_word(r: *mut BIGNUM, w: BN_ULONG) -> BN_ULONG;
+    pub fn BN_mul_word(r: *mut BIGNUM, w: BN_ULONG) -> c_int;
+    pub fn BN_add_word(r: *mut BIGNUM, w: BN_ULONG) -> c_int;
+    pub fn BN_sub_word(r: *mut BIGNUM, w: BN_ULONG) -> c_int;
+    pub fn BN_set_word(bn: *mut BIGNUM, n: BN_ULONG) -> c_int;
+
+    pub fn BN_cmp(a: *const BIGNUM, b: *const BIGNUM) -> c_int;
+    pub fn BN_free(bn: *mut BIGNUM);
+    pub fn BN_is_bit_set(a: *const BIGNUM, n: c_int) -> c_int;
+    pub fn BN_lshift(r: *mut BIGNUM, a: *const BIGNUM, n: c_int) -> c_int;
+    pub fn BN_lshift1(r: *mut BIGNUM, a: *const BIGNUM) -> c_int;
+    pub fn BN_exp(r: *mut BIGNUM, a: *const BIGNUM, p: *const BIGNUM, ctx: *mut BN_CTX) -> c_int;
+
+    pub fn BN_mod_exp(
+        r: *mut BIGNUM,
+        a: *const BIGNUM,
+        p: *const BIGNUM,
+        m: *const BIGNUM,
+        ctx: *mut BN_CTX,
+    ) -> c_int;
+
+    pub fn BN_mask_bits(a: *mut BIGNUM, n: c_int) -> c_int;
+    pub fn BN_rshift(r: *mut BIGNUM, a: *const BIGNUM, n: c_int) -> c_int;
+    pub fn BN_rshift1(r: *mut BIGNUM, a: *const BIGNUM) -> c_int;
+    pub fn BN_bn2hex(a: *const BIGNUM) -> *mut c_char;
+    pub fn BN_bn2dec(a: *const BIGNUM) -> *mut c_char;
+    pub fn BN_hex2bn(a: *mut *mut BIGNUM, s: *const c_char) -> c_int;
+    pub fn BN_dec2bn(a: *mut *mut BIGNUM, s: *const c_char) -> c_int;
+    pub fn BN_gcd(r: *mut BIGNUM, a: *const BIGNUM, b: *const BIGNUM, ctx: *mut BN_CTX) -> c_int;
+    pub fn BN_mod_inverse(
+        r: *mut BIGNUM,
+        a: *const BIGNUM,
+        n: *const BIGNUM,
+        ctx: *mut BN_CTX,
+    ) -> *mut BIGNUM;
+    pub fn BN_clear(bn: *mut BIGNUM);
+    pub fn BN_dup(n: *const BIGNUM) -> *mut BIGNUM;
+    pub fn BN_ucmp(a: *const BIGNUM, b: *const BIGNUM) -> c_int;
+    pub fn BN_set_bit(a: *mut BIGNUM, n: c_int) -> c_int;
+    pub fn BN_clear_bit(a: *mut BIGNUM, n: c_int) -> c_int;
+
+    pub fn BN_generate_prime_ex(
+        r: *mut BIGNUM,
+        bits: c_int,
+        safe: c_int,
+        add: *const BIGNUM,
+        rem: *const BIGNUM,
+        cb: *mut BN_GENCB,
+    ) -> c_int;
+    #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+    pub fn BN_is_prime_ex(
+        p: *const BIGNUM,
+        checks: c_int,
+        ctx: *mut BN_CTX,
+        cb: *mut BN_GENCB,
+    ) -> c_int;
+    #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+    pub fn BN_is_prime_fasttest_ex(
+        p: *const BIGNUM,
+        checks: c_int,
+        ctx: *mut BN_CTX,
+        do_trial_division: c_int,
+        cb: *mut BN_GENCB,
+    ) -> c_int;
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl350))] {
+        extern "C" {
+            pub fn BN_get_rfc2409_prime_768(bn: *mut BIGNUM) -> *mut BIGNUM;
+            pub fn BN_get_rfc2409_prime_1024(bn: *mut BIGNUM) -> *mut BIGNUM;
+            pub fn BN_get_rfc3526_prime_1536(bn: *mut BIGNUM) -> *mut BIGNUM;
+            pub fn BN_get_rfc3526_prime_2048(bn: *mut BIGNUM) -> *mut BIGNUM;
+            pub fn BN_get_rfc3526_prime_3072(bn: *mut BIGNUM) -> *mut BIGNUM;
+            pub fn BN_get_rfc3526_prime_4096(bn: *mut BIGNUM) -> *mut BIGNUM;
+            pub fn BN_get_rfc3526_prime_6144(bn: *mut BIGNUM) -> *mut BIGNUM;
+            pub fn BN_get_rfc3526_prime_8192(bn: *mut BIGNUM) -> *mut BIGNUM;
+        }
+    } else {
+        extern "C" {
+            pub fn get_rfc2409_prime_768(bn: *mut BIGNUM) -> *mut BIGNUM;
+            pub fn get_rfc2409_prime_1024(bn: *mut BIGNUM) -> *mut BIGNUM;
+            pub fn get_rfc3526_prime_1536(bn: *mut BIGNUM) -> *mut BIGNUM;
+            pub fn get_rfc3526_prime_2048(bn: *mut BIGNUM) -> *mut BIGNUM;
+            pub fn get_rfc3526_prime_3072(bn: *mut BIGNUM) -> *mut BIGNUM;
+            pub fn get_rfc3526_prime_4096(bn: *mut BIGNUM) -> *mut BIGNUM;
+            pub fn get_rfc3526_prime_6144(bn: *mut BIGNUM) -> *mut BIGNUM;
+            pub fn get_rfc3526_prime_8192(bn: *mut BIGNUM) -> *mut BIGNUM;
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/cmac.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/cmac.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/cmac.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/cmac.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,18 @@
+use libc::*;
+
+use super::super::*;
+
+extern "C" {
+    pub fn CMAC_CTX_new() -> *mut CMAC_CTX;
+    pub fn CMAC_CTX_free(ctx: *mut CMAC_CTX);
+    pub fn CMAC_Init(
+        ctx: *mut CMAC_CTX,
+        key: *const c_void,
+        len: size_t,
+        cipher: *const EVP_CIPHER,
+        impl_: *mut ENGINE,
+    ) -> c_int;
+    pub fn CMAC_Update(ctx: *mut CMAC_CTX, data: *const c_void, len: size_t) -> c_int;
+    pub fn CMAC_Final(ctx: *mut CMAC_CTX, out: *mut c_uchar, len: *mut size_t) -> c_int;
+    pub fn CMAC_CTX_copy(dst: *mut CMAC_CTX, src: *const CMAC_CTX) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/cms.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/cms.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/cms.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/cms.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,65 @@
+use super::super::*;
+use libc::*;
+
+pub enum CMS_ContentInfo {}
+
+extern "C" {
+    #[cfg(ossl101)]
+    pub fn CMS_ContentInfo_free(cms: *mut CMS_ContentInfo);
+}
+
+const_ptr_api! {
+    extern "C" {
+        #[cfg(ossl101)]
+        pub fn i2d_CMS_ContentInfo(a: #[const_ptr_if(ossl300)] CMS_ContentInfo, pp: *mut *mut c_uchar) -> c_int;
+    }
+}
+
+extern "C" {
+    #[cfg(ossl101)]
+    pub fn d2i_CMS_ContentInfo(
+        a: *mut *mut CMS_ContentInfo,
+        pp: *mut *const c_uchar,
+        length: c_long,
+    ) -> *mut CMS_ContentInfo;
+
+    #[cfg(ossl101)]
+    pub fn SMIME_read_CMS(bio: *mut BIO, bcont: *mut *mut BIO) -> *mut CMS_ContentInfo;
+
+    #[cfg(ossl101)]
+    pub fn CMS_sign(
+        signcert: *mut X509,
+        pkey: *mut EVP_PKEY,
+        certs: *mut stack_st_X509,
+        data: *mut BIO,
+        flags: c_uint,
+    ) -> *mut CMS_ContentInfo;
+
+    #[cfg(ossl101)]
+    pub fn CMS_verify(
+        cms: *mut CMS_ContentInfo,
+        certs: *mut stack_st_X509,
+        store: *mut X509_STORE,
+        detached_data: *mut BIO,
+        out: *mut BIO,
+        flags: c_uint,
+    ) -> c_int;
+
+    #[cfg(ossl101)]
+    pub fn CMS_encrypt(
+        certs: *mut stack_st_X509,
+        data: *mut BIO,
+        cipher: *const EVP_CIPHER,
+        flags: c_uint,
+    ) -> *mut CMS_ContentInfo;
+
+    #[cfg(ossl101)]
+    pub fn CMS_decrypt(
+        cms: *mut CMS_ContentInfo,
+        pkey: *mut EVP_PKEY,
+        cert: *mut X509,
+        dcont: *mut BIO,
+        out: *mut BIO,
+        flags: c_uint,
+    ) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/conf.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/conf.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/conf.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/conf.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+use super::super::*;
+
+extern "C" {
+    pub fn NCONF_new(meth: *mut CONF_METHOD) -> *mut CONF;
+    pub fn NCONF_default() -> *mut CONF_METHOD;
+    pub fn NCONF_free(conf: *mut CONF);
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/crypto.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/crypto.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/crypto.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/crypto.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,85 @@
+use super::super::*;
+use libc::*;
+
+stack!(stack_st_void);
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl271))] {
+        extern "C" {
+            pub fn OpenSSL_version_num() -> c_ulong;
+            pub fn OpenSSL_version(key: c_int) -> *const c_char;
+        }
+    } else {
+        extern "C" {
+            pub fn SSLeay() -> c_ulong;
+            pub fn SSLeay_version(key: c_int) -> *const c_char;
+        }
+    }
+}
+
+extern "C" {
+    #[cfg(any(ossl110, libressl))]
+    pub fn CRYPTO_get_ex_new_index(
+        class_index: c_int,
+        argl: c_long,
+        argp: *mut c_void,
+        new_func: Option<CRYPTO_EX_new>,
+        dup_func: Option<CRYPTO_EX_dup>,
+        free_func: Option<CRYPTO_EX_free>,
+    ) -> c_int;
+
+    #[cfg(not(ossl110))]
+    pub fn CRYPTO_num_locks() -> c_int;
+}
+
+#[allow(clashing_extern_declarations)]
+extern "C" {
+    #[cfg(not(ossl110))]
+    #[link_name = "CRYPTO_set_locking_callback"]
+    pub fn CRYPTO_set_locking_callback__fixed_rust(
+        func: Option<unsafe extern "C" fn(mode: c_int, n: c_int, file: *const c_char, line: c_int)>,
+    );
+
+    #[cfg(not(ossl110))]
+    #[link_name = "CRYPTO_set_id_callback"]
+    pub fn CRYPTO_set_id_callback__fixed_rust(func: Option<unsafe extern "C" fn() -> c_ulong>);
+}
+
+extern "C" {
+    #[cfg(not(ossl110))]
+    pub fn CRYPTO_add_lock(
+        pointer: *mut c_int,
+        amount: c_int,
+        type_: c_int,
+        file: *const c_char,
+        line: c_int,
+    ) -> c_int;
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl390))] {
+        extern "C" {
+            pub fn CRYPTO_malloc(num: size_t, file: *const c_char, line: c_int) -> *mut c_void;
+            pub fn CRYPTO_free(buf: *mut c_void, file: *const c_char, line: c_int);
+        }
+    } else {
+        extern "C" {
+            pub fn CRYPTO_malloc(num: c_int, file: *const c_char, line: c_int) -> *mut c_void;
+            pub fn CRYPTO_free(buf: *mut c_void);
+        }
+    }
+}
+
+extern "C" {
+    #[cfg(all(ossl101, not(ossl300)))]
+    pub fn FIPS_mode() -> c_int;
+    #[cfg(all(ossl101, not(ossl300)))]
+    pub fn FIPS_mode_set(onoff: c_int) -> c_int;
+
+    pub fn CRYPTO_memcmp(a: *const c_void, b: *const c_void, len: size_t) -> c_int;
+
+    #[cfg(ossl300)]
+    pub fn OSSL_LIB_CTX_new() -> *mut OSSL_LIB_CTX;
+    #[cfg(ossl300)]
+    pub fn OSSL_LIB_CTX_free(libcts: *mut OSSL_LIB_CTX);
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/dh.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/dh.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/dh.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/dh.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,52 @@
+use super::super::*;
+
+extern "C" {
+    pub fn DH_new() -> *mut DH;
+    pub fn DH_free(dh: *mut DH);
+    pub fn DH_check(dh: *const DH, codes: *mut c_int) -> c_int;
+
+    #[cfg(not(libressl382))]
+    pub fn DH_generate_parameters(
+        prime_len: c_int,
+        generator: c_int,
+        callback: Option<extern "C" fn(c_int, c_int, *mut c_void)>,
+        cb_arg: *mut c_void,
+    ) -> *mut DH;
+
+    pub fn DH_generate_parameters_ex(
+        dh: *mut DH,
+        prime_len: c_int,
+        generator: c_int,
+        cb: *mut BN_GENCB,
+    ) -> c_int;
+
+    pub fn DH_generate_key(dh: *mut DH) -> c_int;
+    pub fn DH_compute_key(key: *mut c_uchar, pub_key: *const BIGNUM, dh: *mut DH) -> c_int;
+    pub fn DH_size(dh: *const DH) -> c_int;
+
+    pub fn d2i_DHparams(k: *mut *mut DH, pp: *mut *const c_uchar, length: c_long) -> *mut DH;
+    pub fn i2d_DHparams(dh: *const DH, pp: *mut *mut c_uchar) -> c_int;
+
+    #[cfg(ossl102)]
+    pub fn DH_get_1024_160() -> *mut DH;
+    #[cfg(ossl102)]
+    pub fn DH_get_2048_224() -> *mut DH;
+    #[cfg(ossl102)]
+    pub fn DH_get_2048_256() -> *mut DH;
+
+    #[cfg(any(ossl110, libressl270))]
+    pub fn DH_set0_pqg(dh: *mut DH, p: *mut BIGNUM, q: *mut BIGNUM, g: *mut BIGNUM) -> c_int;
+    #[cfg(any(ossl110, libressl270))]
+    pub fn DH_get0_pqg(
+        dh: *const DH,
+        p: *mut *const BIGNUM,
+        q: *mut *const BIGNUM,
+        g: *mut *const BIGNUM,
+    );
+
+    #[cfg(any(ossl110, libressl270))]
+    pub fn DH_set0_key(dh: *mut DH, pub_key: *mut BIGNUM, priv_key: *mut BIGNUM) -> c_int;
+
+    #[cfg(any(ossl110, libressl270))]
+    pub fn DH_get0_key(dh: *const DH, pub_key: *mut *const BIGNUM, priv_key: *mut *const BIGNUM);
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/dsa.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/dsa.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/dsa.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/dsa.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,85 @@
+use libc::*;
+
+use super::super::*;
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl280))] {
+        pub enum DSA_SIG {}
+    } else {
+      #[repr(C)]
+      pub struct DSA_SIG {
+          pub r: *mut BIGNUM,
+          pub s: *mut BIGNUM,
+      }
+    }
+}
+
+extern "C" {
+    pub fn DSA_new() -> *mut DSA;
+    pub fn DSA_free(dsa: *mut DSA);
+    pub fn DSA_up_ref(dsa: *mut DSA) -> c_int;
+    pub fn DSA_size(dsa: *const DSA) -> c_int;
+    pub fn DSA_sign(
+        dummy: c_int,
+        dgst: *const c_uchar,
+        len: c_int,
+        sigret: *mut c_uchar,
+        siglen: *mut c_uint,
+        dsa: *mut DSA,
+    ) -> c_int;
+    pub fn DSA_verify(
+        dummy: c_int,
+        dgst: *const c_uchar,
+        len: c_int,
+        sigbuf: *const c_uchar,
+        siglen: c_int,
+        dsa: *mut DSA,
+    ) -> c_int;
+
+    pub fn d2i_DSAPublicKey(a: *mut *mut DSA, pp: *mut *const c_uchar, length: c_long) -> *mut DSA;
+    pub fn d2i_DSAPrivateKey(a: *mut *mut DSA, pp: *mut *const c_uchar, length: c_long)
+        -> *mut DSA;
+
+    pub fn DSA_generate_parameters_ex(
+        dsa: *mut DSA,
+        bits: c_int,
+        seed: *const c_uchar,
+        seed_len: c_int,
+        counter_ref: *mut c_int,
+        h_ret: *mut c_ulong,
+        cb: *mut BN_GENCB,
+    ) -> c_int;
+
+    pub fn DSA_generate_key(dsa: *mut DSA) -> c_int;
+    pub fn i2d_DSAPublicKey(a: *const DSA, pp: *mut *mut c_uchar) -> c_int;
+    pub fn i2d_DSAPrivateKey(a: *const DSA, pp: *mut *mut c_uchar) -> c_int;
+
+    #[cfg(any(ossl110, libressl273))]
+    pub fn DSA_get0_pqg(
+        d: *const DSA,
+        p: *mut *const BIGNUM,
+        q: *mut *const BIGNUM,
+        q: *mut *const BIGNUM,
+    );
+    #[cfg(any(ossl110, libressl273))]
+    pub fn DSA_set0_pqg(d: *mut DSA, p: *mut BIGNUM, q: *mut BIGNUM, q: *mut BIGNUM) -> c_int;
+    #[cfg(any(ossl110, libressl273))]
+    pub fn DSA_get0_key(d: *const DSA, pub_key: *mut *const BIGNUM, priv_key: *mut *const BIGNUM);
+    #[cfg(any(ossl110, libressl273))]
+    pub fn DSA_set0_key(d: *mut DSA, pub_key: *mut BIGNUM, priv_key: *mut BIGNUM) -> c_int;
+    pub fn d2i_DSA_SIG(
+        sig: *mut *mut DSA_SIG,
+        pp: *mut *const c_uchar,
+        length: c_long,
+    ) -> *mut DSA_SIG;
+    pub fn i2d_DSA_SIG(a: *const DSA_SIG, pp: *mut *mut c_uchar) -> c_int;
+
+    pub fn DSA_SIG_new() -> *mut DSA_SIG;
+    pub fn DSA_SIG_free(sig: *mut DSA_SIG);
+
+    #[cfg(any(ossl110, libressl273))]
+    pub fn DSA_SIG_get0(sig: *const DSA_SIG, pr: *mut *const BIGNUM, ps: *mut *const BIGNUM);
+
+    #[cfg(any(ossl110, libressl273))]
+    pub fn DSA_SIG_set0(sig: *mut DSA_SIG, pr: *mut BIGNUM, ps: *mut BIGNUM) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/ec.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/ec.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/ec.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/ec.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,271 @@
+use super::super::*;
+use libc::*;
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub enum point_conversion_form_t {
+    POINT_CONVERSION_COMPRESSED = 2,
+    POINT_CONVERSION_UNCOMPRESSED = 4,
+    POINT_CONVERSION_HYBRID = 6,
+}
+
+pub enum EC_METHOD {}
+pub enum EC_GROUP {}
+pub enum EC_POINT {}
+
+extern "C" {
+    #[cfg(not(osslconf = "OPENSSL_NO_EC2M"))]
+    pub fn EC_GF2m_simple_method() -> *const EC_METHOD;
+
+    pub fn EC_GROUP_new(meth: *const EC_METHOD) -> *mut EC_GROUP;
+
+    pub fn EC_GROUP_free(group: *mut EC_GROUP);
+
+    pub fn EC_GROUP_get_order(
+        group: *const EC_GROUP,
+        order: *mut BIGNUM,
+        ctx: *mut BN_CTX,
+    ) -> c_int;
+
+    pub fn EC_GROUP_get_cofactor(
+        group: *const EC_GROUP,
+        cofactor: *mut BIGNUM,
+        ctx: *mut BN_CTX,
+    ) -> c_int;
+
+    pub fn EC_GROUP_get0_generator(group: *const EC_GROUP) -> *const EC_POINT;
+
+    pub fn EC_GROUP_set_generator(
+        group: *mut EC_GROUP,
+        generator: *const EC_POINT,
+        order: *const BIGNUM,
+        cofactor: *const BIGNUM,
+    ) -> c_int;
+
+    pub fn EC_GROUP_get_curve_name(group: *const EC_GROUP) -> c_int;
+
+    pub fn EC_GROUP_set_asn1_flag(key: *mut EC_GROUP, flag: c_int);
+
+    pub fn EC_GROUP_get_asn1_flag(group: *const EC_GROUP) -> c_int;
+
+    pub fn EC_GROUP_get_curve_GFp(
+        group: *const EC_GROUP,
+        p: *mut BIGNUM,
+        a: *mut BIGNUM,
+        b: *mut BIGNUM,
+        ctx: *mut BN_CTX,
+    ) -> c_int;
+
+    #[cfg(not(osslconf = "OPENSSL_NO_EC2M"))]
+    pub fn EC_GROUP_get_curve_GF2m(
+        group: *const EC_GROUP,
+        p: *mut BIGNUM,
+        a: *mut BIGNUM,
+        b: *mut BIGNUM,
+        ctx: *mut BN_CTX,
+    ) -> c_int;
+
+    pub fn EC_GROUP_get_degree(group: *const EC_GROUP) -> c_int;
+
+    #[cfg(ossl110)]
+    pub fn EC_GROUP_order_bits(group: *const EC_GROUP) -> c_int;
+
+    pub fn EC_GROUP_new_curve_GFp(
+        p: *const BIGNUM,
+        a: *const BIGNUM,
+        b: *const BIGNUM,
+        ctx: *mut BN_CTX,
+    ) -> *mut EC_GROUP;
+
+    #[cfg(not(osslconf = "OPENSSL_NO_EC2M"))]
+    pub fn EC_GROUP_new_curve_GF2m(
+        p: *const BIGNUM,
+        a: *const BIGNUM,
+        b: *const BIGNUM,
+        ctx: *mut BN_CTX,
+    ) -> *mut EC_GROUP;
+
+    pub fn EC_GROUP_new_by_curve_name(nid: c_int) -> *mut EC_GROUP;
+
+    pub fn EC_POINT_is_at_infinity(group: *const EC_GROUP, point: *const EC_POINT) -> c_int;
+
+    pub fn EC_POINT_is_on_curve(
+        group: *const EC_GROUP,
+        point: *const EC_POINT,
+        ctx: *mut BN_CTX,
+    ) -> c_int;
+
+    pub fn EC_POINT_new(group: *const EC_GROUP) -> *mut EC_POINT;
+
+    pub fn EC_POINT_free(point: *mut EC_POINT);
+
+    pub fn EC_POINT_dup(p: *const EC_POINT, group: *const EC_GROUP) -> *mut EC_POINT;
+
+    #[cfg(any(ossl111, boringssl, libressl350))]
+    pub fn EC_POINT_get_affine_coordinates(
+        group: *const EC_GROUP,
+        p: *const EC_POINT,
+        x: *mut BIGNUM,
+        y: *mut BIGNUM,
+        ctx: *mut BN_CTX,
+    ) -> c_int;
+
+    pub fn EC_POINT_get_affine_coordinates_GFp(
+        group: *const EC_GROUP,
+        p: *const EC_POINT,
+        x: *mut BIGNUM,
+        y: *mut BIGNUM,
+        ctx: *mut BN_CTX,
+    ) -> c_int;
+
+    pub fn EC_POINT_set_affine_coordinates_GFp(
+        group: *const EC_GROUP,
+        p: *mut EC_POINT,
+        x: *const BIGNUM,
+        y: *const BIGNUM,
+        ctx: *mut BN_CTX,
+    ) -> c_int;
+
+    #[cfg(not(osslconf = "OPENSSL_NO_EC2M"))]
+    pub fn EC_POINT_get_affine_coordinates_GF2m(
+        group: *const EC_GROUP,
+        p: *const EC_POINT,
+        x: *mut BIGNUM,
+        y: *mut BIGNUM,
+        ctx: *mut BN_CTX,
+    ) -> c_int;
+
+    pub fn EC_POINT_point2oct(
+        group: *const EC_GROUP,
+        p: *const EC_POINT,
+        form: point_conversion_form_t,
+        buf: *mut c_uchar,
+        len: size_t,
+        ctx: *mut BN_CTX,
+    ) -> size_t;
+
+    pub fn EC_POINT_oct2point(
+        group: *const EC_GROUP,
+        p: *mut EC_POINT,
+        buf: *const c_uchar,
+        len: size_t,
+        ctx: *mut BN_CTX,
+    ) -> c_int;
+
+    pub fn EC_POINT_point2hex(
+        group: *const EC_GROUP,
+        p: *const EC_POINT,
+        form: point_conversion_form_t,
+        ctx: *mut BN_CTX,
+    ) -> *mut c_char;
+
+    pub fn EC_POINT_hex2point(
+        group: *const EC_GROUP,
+        s: *const c_char,
+        p: *mut EC_POINT,
+        ctx: *mut BN_CTX,
+    ) -> *mut EC_POINT;
+
+    pub fn EC_POINT_add(
+        group: *const EC_GROUP,
+        r: *mut EC_POINT,
+        a: *const EC_POINT,
+        b: *const EC_POINT,
+        ctx: *mut BN_CTX,
+    ) -> c_int;
+
+    pub fn EC_POINT_invert(group: *const EC_GROUP, r: *mut EC_POINT, ctx: *mut BN_CTX) -> c_int;
+
+    pub fn EC_POINT_cmp(
+        group: *const EC_GROUP,
+        a: *const EC_POINT,
+        b: *const EC_POINT,
+        ctx: *mut BN_CTX,
+    ) -> c_int;
+
+    pub fn EC_POINT_mul(
+        group: *const EC_GROUP,
+        r: *mut EC_POINT,
+        n: *const BIGNUM,
+        q: *const EC_POINT,
+        m: *const BIGNUM,
+        ctx: *mut BN_CTX,
+    ) -> c_int;
+
+    pub fn EC_KEY_new() -> *mut EC_KEY;
+
+    pub fn EC_KEY_new_by_curve_name(nid: c_int) -> *mut EC_KEY;
+
+    pub fn EC_KEY_free(key: *mut EC_KEY);
+
+    pub fn EC_KEY_dup(key: *const EC_KEY) -> *mut EC_KEY;
+
+    pub fn EC_KEY_up_ref(key: *mut EC_KEY) -> c_int;
+
+    pub fn EC_KEY_get0_group(key: *const EC_KEY) -> *const EC_GROUP;
+
+    pub fn EC_KEY_set_group(key: *mut EC_KEY, group: *const EC_GROUP) -> c_int;
+
+    pub fn EC_KEY_get0_private_key(key: *const EC_KEY) -> *const BIGNUM;
+
+    pub fn EC_KEY_set_private_key(key: *mut EC_KEY, key: *const BIGNUM) -> c_int;
+
+    pub fn EC_KEY_get0_public_key(key: *const EC_KEY) -> *const EC_POINT;
+
+    pub fn EC_KEY_set_public_key(key: *mut EC_KEY, key: *const EC_POINT) -> c_int;
+
+    pub fn EC_KEY_generate_key(key: *mut EC_KEY) -> c_int;
+
+    pub fn EC_KEY_check_key(key: *const EC_KEY) -> c_int;
+
+    pub fn EC_KEY_set_public_key_affine_coordinates(
+        key: *mut EC_KEY,
+        x: *mut BIGNUM,
+        y: *mut BIGNUM,
+    ) -> c_int;
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl280))] {
+        pub enum ECDSA_SIG {}
+    } else {
+        #[repr(C)]
+        pub struct ECDSA_SIG {
+            pub r: *mut BIGNUM,
+            pub s: *mut BIGNUM,
+        }
+    }
+}
+
+extern "C" {
+    pub fn ECDSA_SIG_new() -> *mut ECDSA_SIG;
+
+    pub fn ECDSA_SIG_free(sig: *mut ECDSA_SIG);
+
+    #[cfg(any(ossl110, libressl273))]
+    pub fn ECDSA_SIG_get0(sig: *const ECDSA_SIG, pr: *mut *const BIGNUM, ps: *mut *const BIGNUM);
+
+    #[cfg(any(ossl110, libressl273))]
+    pub fn ECDSA_SIG_set0(sig: *mut ECDSA_SIG, pr: *mut BIGNUM, ps: *mut BIGNUM) -> c_int;
+
+    pub fn ECDSA_do_sign(
+        dgst: *const c_uchar,
+        dgst_len: c_int,
+        eckey: *mut EC_KEY,
+    ) -> *mut ECDSA_SIG;
+
+    pub fn ECDSA_do_verify(
+        dgst: *const c_uchar,
+        dgst_len: c_int,
+        sig: *const ECDSA_SIG,
+        eckey: *mut EC_KEY,
+    ) -> c_int;
+
+    pub fn d2i_ECDSA_SIG(
+        sig: *mut *mut ECDSA_SIG,
+        inp: *mut *const c_uchar,
+        length: c_long,
+    ) -> *mut ECDSA_SIG;
+
+    pub fn i2d_ECDSA_SIG(sig: *const ECDSA_SIG, out: *mut *mut c_uchar) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/err.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/err.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/err.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/err.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,55 @@
+use super::super::*;
+use libc::*;
+
+#[repr(C)]
+pub struct ERR_STRING_DATA {
+    pub error: c_ulong,
+    pub string: *const c_char,
+}
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        extern "C" {
+            pub fn ERR_new();
+            pub fn ERR_set_debug(file: *const c_char, line: c_int, func: *const c_char);
+            pub fn ERR_set_error(lib: c_int, reason: c_int, fmt: *const c_char, ...);
+        }
+    } else {
+        extern "C" {
+            pub fn ERR_put_error(lib: c_int, func: c_int, reason: c_int, file: *const c_char, line: c_int);
+        }
+    }
+}
+
+extern "C" {
+    pub fn ERR_set_error_data(data: *mut c_char, flags: c_int);
+
+    pub fn ERR_get_error() -> c_ulong;
+    #[cfg(ossl300)]
+    pub fn ERR_get_error_all(
+        file: *mut *const c_char,
+        line: *mut c_int,
+        func: *mut *const c_char,
+        data: *mut *const c_char,
+        flags: *mut c_int,
+    ) -> c_ulong;
+    pub fn ERR_get_error_line_data(
+        file: *mut *const c_char,
+        line: *mut c_int,
+        data: *mut *const c_char,
+        flags: *mut c_int,
+    ) -> c_ulong;
+    pub fn ERR_peek_last_error() -> c_ulong;
+    pub fn ERR_clear_error();
+    pub fn ERR_lib_error_string(err: c_ulong) -> *const c_char;
+    pub fn ERR_func_error_string(err: c_ulong) -> *const c_char;
+    pub fn ERR_reason_error_string(err: c_ulong) -> *const c_char;
+    #[cfg(ossl110)]
+    pub fn ERR_load_strings(lib: c_int, str: *mut ERR_STRING_DATA) -> c_int;
+    #[cfg(not(ossl110))]
+    pub fn ERR_load_strings(lib: c_int, str: *mut ERR_STRING_DATA);
+    #[cfg(not(ossl110))]
+    pub fn ERR_load_crypto_strings();
+
+    pub fn ERR_get_next_error_library() -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/evp.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/evp.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/evp.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/evp.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,658 @@
+use super::super::*;
+use libc::*;
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        extern "C" {
+            pub fn EVP_MD_get_block_size(md: *const EVP_MD) -> c_int;
+            pub fn EVP_MD_get_size(md: *const EVP_MD) -> c_int;
+            pub fn EVP_MD_get_type(md: *const EVP_MD) -> c_int;
+
+            pub fn EVP_MD_CTX_get0_md(ctx: *const EVP_MD_CTX) -> *const EVP_MD;
+
+            pub fn EVP_CIPHER_get_key_length(cipher: *const EVP_CIPHER) -> c_int;
+            pub fn EVP_CIPHER_get_block_size(cipher: *const EVP_CIPHER) -> c_int;
+            pub fn EVP_CIPHER_get_iv_length(cipher: *const EVP_CIPHER) -> c_int;
+            pub fn EVP_CIPHER_get_nid(cipher: *const EVP_CIPHER) -> c_int;
+            pub fn EVP_CIPHER_fetch(
+                ctx: *mut OSSL_LIB_CTX,
+                algorithm: *const c_char,
+                properties: *const c_char,
+            ) -> *mut EVP_CIPHER;
+            pub fn EVP_CIPHER_free(cipher: *mut EVP_CIPHER);
+
+            pub fn EVP_CIPHER_CTX_get0_cipher(ctx: *const EVP_CIPHER_CTX) -> *const EVP_CIPHER;
+            pub fn EVP_CIPHER_CTX_get_block_size(ctx: *const EVP_CIPHER_CTX) -> c_int;
+            pub fn EVP_CIPHER_CTX_get_key_length(ctx: *const EVP_CIPHER_CTX) -> c_int;
+            pub fn EVP_CIPHER_CTX_get_iv_length(ctx: *const EVP_CIPHER_CTX) -> c_int;
+            pub fn EVP_CIPHER_CTX_get_tag_length(ctx: *const EVP_CIPHER_CTX) -> c_int;
+            pub fn EVP_CIPHER_CTX_get_num(ctx: *const EVP_CIPHER_CTX) -> c_int;
+        }
+    } else {
+        extern "C" {
+            pub fn EVP_MD_block_size(md: *const EVP_MD) -> c_int;
+            pub fn EVP_MD_size(md: *const EVP_MD) -> c_int;
+            pub fn EVP_MD_type(md: *const EVP_MD) -> c_int;
+
+            pub fn EVP_MD_CTX_md(ctx: *const EVP_MD_CTX) -> *const EVP_MD;
+
+            pub fn EVP_CIPHER_key_length(cipher: *const EVP_CIPHER) -> c_int;
+            pub fn EVP_CIPHER_block_size(cipher: *const EVP_CIPHER) -> c_int;
+            pub fn EVP_CIPHER_iv_length(cipher: *const EVP_CIPHER) -> c_int;
+            pub fn EVP_CIPHER_nid(cipher: *const EVP_CIPHER) -> c_int;
+
+            pub fn EVP_CIPHER_CTX_cipher(ctx: *const EVP_CIPHER_CTX) -> *const EVP_CIPHER;
+            pub fn EVP_CIPHER_CTX_block_size(ctx: *const EVP_CIPHER_CTX) -> c_int;
+            pub fn EVP_CIPHER_CTX_key_length(ctx: *const EVP_CIPHER_CTX) -> c_int;
+            pub fn EVP_CIPHER_CTX_iv_length(ctx: *const EVP_CIPHER_CTX) -> c_int;
+            #[cfg(ossl110)]
+            pub fn EVP_CIPHER_CTX_num(ctx: *const EVP_CIPHER_CTX) -> c_int;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl382))] {
+        extern "C" {
+            pub fn EVP_MD_CTX_new() -> *mut EVP_MD_CTX;
+            pub fn EVP_MD_CTX_free(ctx: *mut EVP_MD_CTX);
+        }
+    } else {
+        extern "C" {
+            pub fn EVP_MD_CTX_create() -> *mut EVP_MD_CTX;
+            pub fn EVP_MD_CTX_destroy(ctx: *mut EVP_MD_CTX);
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        extern "C" {
+            pub fn EVP_default_properties_is_fips_enabled(libctx: *mut OSSL_LIB_CTX) -> c_int;
+            pub fn EVP_default_properties_enable_fips(libctx: *mut OSSL_LIB_CTX, enable: c_int) -> c_int;
+        }
+    }
+}
+
+extern "C" {
+    pub fn EVP_DigestInit_ex(ctx: *mut EVP_MD_CTX, typ: *const EVP_MD, imple: *mut ENGINE)
+        -> c_int;
+    pub fn EVP_DigestUpdate(ctx: *mut EVP_MD_CTX, data: *const c_void, n: size_t) -> c_int;
+    pub fn EVP_DigestFinal_ex(ctx: *mut EVP_MD_CTX, res: *mut u8, n: *mut u32) -> c_int;
+    #[cfg(ossl300)]
+    pub fn EVP_Q_digest(
+        libctx: *mut OSSL_LIB_CTX,
+        name: *const c_char,
+        propq: *const c_char,
+        data: *const c_void,
+        count: size_t,
+        md: *mut c_uchar,
+        size: *mut size_t,
+    ) -> c_int;
+    pub fn EVP_DigestInit(ctx: *mut EVP_MD_CTX, typ: *const EVP_MD) -> c_int;
+    pub fn EVP_DigestFinal(ctx: *mut EVP_MD_CTX, res: *mut u8, n: *mut u32) -> c_int;
+    #[cfg(ossl111)]
+    pub fn EVP_DigestFinalXOF(ctx: *mut EVP_MD_CTX, res: *mut u8, len: usize) -> c_int;
+
+    #[cfg(ossl300)]
+    pub fn EVP_MD_fetch(
+        ctx: *mut OSSL_LIB_CTX,
+        algorithm: *const c_char,
+        properties: *const c_char,
+    ) -> *mut EVP_MD;
+
+    #[cfg(ossl300)]
+    pub fn EVP_MD_free(md: *mut EVP_MD);
+
+    pub fn EVP_BytesToKey(
+        typ: *const EVP_CIPHER,
+        md: *const EVP_MD,
+        salt: *const u8,
+        data: *const u8,
+        datalen: c_int,
+        count: c_int,
+        key: *mut u8,
+        iv: *mut u8,
+    ) -> c_int;
+
+    pub fn EVP_CipherInit(
+        ctx: *mut EVP_CIPHER_CTX,
+        evp: *const EVP_CIPHER,
+        key: *const u8,
+        iv: *const u8,
+        mode: c_int,
+    ) -> c_int;
+    pub fn EVP_CipherInit_ex(
+        ctx: *mut EVP_CIPHER_CTX,
+        type_: *const EVP_CIPHER,
+        impl_: *mut ENGINE,
+        key: *const c_uchar,
+        iv: *const c_uchar,
+        enc: c_int,
+    ) -> c_int;
+    pub fn EVP_CipherUpdate(
+        ctx: *mut EVP_CIPHER_CTX,
+        outbuf: *mut u8,
+        outlen: *mut c_int,
+        inbuf: *const u8,
+        inlen: c_int,
+    ) -> c_int;
+    pub fn EVP_CipherFinal(ctx: *mut EVP_CIPHER_CTX, res: *mut u8, len: *mut c_int) -> c_int;
+
+    pub fn EVP_DigestSignInit(
+        ctx: *mut EVP_MD_CTX,
+        pctx: *mut *mut EVP_PKEY_CTX,
+        type_: *const EVP_MD,
+        e: *mut ENGINE,
+        pkey: *mut EVP_PKEY,
+    ) -> c_int;
+
+    #[cfg(ossl300)]
+    pub fn EVP_DigestSignUpdate(ctx: *mut EVP_MD_CTX, data: *const c_void, dsize: size_t) -> c_int;
+    pub fn EVP_DigestSignFinal(
+        ctx: *mut EVP_MD_CTX,
+        sig: *mut c_uchar,
+        siglen: *mut size_t,
+    ) -> c_int;
+    pub fn EVP_DigestVerifyInit(
+        ctx: *mut EVP_MD_CTX,
+        pctx: *mut *mut EVP_PKEY_CTX,
+        type_: *const EVP_MD,
+        e: *mut ENGINE,
+        pkey: *mut EVP_PKEY,
+    ) -> c_int;
+    #[cfg(ossl300)]
+    pub fn EVP_DigestVerifyUpdate(
+        ctx: *mut EVP_MD_CTX,
+        data: *const c_void,
+        dsize: size_t,
+    ) -> c_int;
+    pub fn EVP_SealInit(
+        ctx: *mut EVP_CIPHER_CTX,
+        type_: *const EVP_CIPHER,
+        ek: *mut *mut c_uchar,
+        ekl: *mut c_int,
+        iv: *mut c_uchar,
+        pubk: *mut *mut EVP_PKEY,
+        npubk: c_int,
+    ) -> c_int;
+    pub fn EVP_SealFinal(ctx: *mut EVP_CIPHER_CTX, out: *mut c_uchar, outl: *mut c_int) -> c_int;
+    pub fn EVP_EncryptInit_ex(
+        ctx: *mut EVP_CIPHER_CTX,
+        cipher: *const EVP_CIPHER,
+        impl_: *mut ENGINE,
+        key: *const c_uchar,
+        iv: *const c_uchar,
+    ) -> c_int;
+    pub fn EVP_EncryptUpdate(
+        ctx: *mut EVP_CIPHER_CTX,
+        out: *mut c_uchar,
+        outl: *mut c_int,
+        in_: *const u8,
+        inl: c_int,
+    ) -> c_int;
+    pub fn EVP_EncryptFinal_ex(
+        ctx: *mut EVP_CIPHER_CTX,
+        out: *mut c_uchar,
+        outl: *mut c_int,
+    ) -> c_int;
+    pub fn EVP_OpenInit(
+        ctx: *mut EVP_CIPHER_CTX,
+        type_: *const EVP_CIPHER,
+        ek: *const c_uchar,
+        ekl: c_int,
+        iv: *const c_uchar,
+        priv_: *mut EVP_PKEY,
+    ) -> c_int;
+    pub fn EVP_OpenFinal(ctx: *mut EVP_CIPHER_CTX, out: *mut c_uchar, outl: *mut c_int) -> c_int;
+    pub fn EVP_DecryptInit_ex(
+        ctx: *mut EVP_CIPHER_CTX,
+        cipher: *const EVP_CIPHER,
+        impl_: *mut ENGINE,
+        key: *const c_uchar,
+        iv: *const c_uchar,
+    ) -> c_int;
+    pub fn EVP_DecryptUpdate(
+        ctx: *mut EVP_CIPHER_CTX,
+        out: *mut c_uchar,
+        outl: *mut c_int,
+        in_: *const u8,
+        inl: c_int,
+    ) -> c_int;
+    pub fn EVP_DecryptFinal_ex(
+        ctx: *mut EVP_CIPHER_CTX,
+        outm: *mut c_uchar,
+        outl: *mut c_int,
+    ) -> c_int;
+}
+cfg_if! {
+    if #[cfg(ossl300)] {
+        extern "C" {
+            pub fn EVP_PKEY_get_size(pkey: *const EVP_PKEY) -> c_int;
+        }
+    } else {
+        const_ptr_api! {
+            extern "C" {
+                pub fn EVP_PKEY_size(pkey: #[const_ptr_if(any(ossl111b, libressl280))] EVP_PKEY) -> c_int;
+            }
+        }
+    }
+}
+cfg_if! {
+    if #[cfg(any(ossl111, libressl370))] {
+        extern "C" {
+            pub fn EVP_DigestSign(
+                ctx: *mut EVP_MD_CTX,
+                sigret: *mut c_uchar,
+                siglen: *mut size_t,
+                tbs: *const c_uchar,
+                tbslen: size_t
+            ) -> c_int;
+
+            pub fn EVP_DigestVerify(
+                ctx: *mut EVP_MD_CTX,
+                sigret: *const c_uchar,
+                siglen: size_t,
+                tbs: *const c_uchar,
+                tbslen: size_t
+            ) -> c_int;
+        }
+    }
+}
+const_ptr_api! {
+    extern "C" {
+        pub fn EVP_DigestVerifyFinal(
+            ctx: *mut EVP_MD_CTX,
+            sigret: #[const_ptr_if(any(ossl102, libressl280))] c_uchar,
+            siglen: size_t,
+        ) -> c_int;
+    }
+}
+
+extern "C" {
+    pub fn EVP_CIPHER_CTX_new() -> *mut EVP_CIPHER_CTX;
+    pub fn EVP_CIPHER_CTX_free(ctx: *mut EVP_CIPHER_CTX);
+    pub fn EVP_CIPHER_CTX_copy(dst: *mut EVP_CIPHER_CTX, src: *const EVP_CIPHER_CTX) -> c_int;
+
+    pub fn EVP_MD_CTX_copy_ex(dst: *mut EVP_MD_CTX, src: *const EVP_MD_CTX) -> c_int;
+    #[cfg(ossl111)]
+    pub fn EVP_MD_CTX_reset(ctx: *mut EVP_MD_CTX) -> c_int;
+    pub fn EVP_CIPHER_CTX_set_key_length(ctx: *mut EVP_CIPHER_CTX, keylen: c_int) -> c_int;
+    pub fn EVP_CIPHER_CTX_set_padding(ctx: *mut EVP_CIPHER_CTX, padding: c_int) -> c_int;
+    pub fn EVP_CIPHER_CTX_ctrl(
+        ctx: *mut EVP_CIPHER_CTX,
+        type_: c_int,
+        arg: c_int,
+        ptr: *mut c_void,
+    ) -> c_int;
+    pub fn EVP_CIPHER_CTX_rand_key(ctx: *mut EVP_CIPHER_CTX, key: *mut c_uchar) -> c_int;
+    pub fn EVP_CIPHER_CTX_set_flags(ctx: *mut EVP_CIPHER_CTX, flags: c_int);
+
+    pub fn EVP_md_null() -> *const EVP_MD;
+    pub fn EVP_md5() -> *const EVP_MD;
+    pub fn EVP_sha1() -> *const EVP_MD;
+    pub fn EVP_sha224() -> *const EVP_MD;
+    pub fn EVP_sha256() -> *const EVP_MD;
+    pub fn EVP_sha384() -> *const EVP_MD;
+    pub fn EVP_sha512() -> *const EVP_MD;
+    #[cfg(any(ossl111, libressl380))]
+    pub fn EVP_sha3_224() -> *const EVP_MD;
+    #[cfg(any(ossl111, libressl380))]
+    pub fn EVP_sha3_256() -> *const EVP_MD;
+    #[cfg(any(ossl111, libressl380))]
+    pub fn EVP_sha3_384() -> *const EVP_MD;
+    #[cfg(any(ossl111, libressl380))]
+    pub fn EVP_sha3_512() -> *const EVP_MD;
+    #[cfg(ossl111)]
+    pub fn EVP_shake128() -> *const EVP_MD;
+    #[cfg(ossl111)]
+    pub fn EVP_shake256() -> *const EVP_MD;
+    pub fn EVP_ripemd160() -> *const EVP_MD;
+    #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM3")))]
+    pub fn EVP_sm3() -> *const EVP_MD;
+    pub fn EVP_des_ecb() -> *const EVP_CIPHER;
+    pub fn EVP_des_ede3() -> *const EVP_CIPHER;
+    pub fn EVP_des_ede3_cbc() -> *const EVP_CIPHER;
+    pub fn EVP_des_ede3_ecb() -> *const EVP_CIPHER;
+    pub fn EVP_des_ede3_cfb64() -> *const EVP_CIPHER;
+    pub fn EVP_des_ede3_cfb8() -> *const EVP_CIPHER;
+    pub fn EVP_des_ede3_ofb() -> *const EVP_CIPHER;
+    pub fn EVP_des_cbc() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_RC4"))]
+    pub fn EVP_rc4() -> *const EVP_CIPHER;
+    pub fn EVP_bf_ecb() -> *const EVP_CIPHER;
+    pub fn EVP_bf_cbc() -> *const EVP_CIPHER;
+    pub fn EVP_bf_cfb64() -> *const EVP_CIPHER;
+    pub fn EVP_bf_ofb() -> *const EVP_CIPHER;
+    pub fn EVP_aes_128_ecb() -> *const EVP_CIPHER;
+    pub fn EVP_aes_128_cbc() -> *const EVP_CIPHER;
+    pub fn EVP_aes_128_cfb1() -> *const EVP_CIPHER;
+    pub fn EVP_aes_128_cfb8() -> *const EVP_CIPHER;
+    pub fn EVP_aes_128_cfb128() -> *const EVP_CIPHER;
+    pub fn EVP_aes_128_ctr() -> *const EVP_CIPHER;
+    pub fn EVP_aes_128_ccm() -> *const EVP_CIPHER;
+    pub fn EVP_aes_128_gcm() -> *const EVP_CIPHER;
+    pub fn EVP_aes_128_xts() -> *const EVP_CIPHER;
+    pub fn EVP_aes_128_ofb() -> *const EVP_CIPHER;
+    #[cfg(ossl110)]
+    pub fn EVP_aes_128_ocb() -> *const EVP_CIPHER;
+    #[cfg(ossl102)]
+    pub fn EVP_aes_128_wrap() -> *const EVP_CIPHER;
+    #[cfg(ossl110)]
+    pub fn EVP_aes_128_wrap_pad() -> *const EVP_CIPHER;
+    pub fn EVP_aes_192_ecb() -> *const EVP_CIPHER;
+    pub fn EVP_aes_192_cbc() -> *const EVP_CIPHER;
+    pub fn EVP_aes_192_cfb1() -> *const EVP_CIPHER;
+    pub fn EVP_aes_192_cfb8() -> *const EVP_CIPHER;
+    pub fn EVP_aes_192_cfb128() -> *const EVP_CIPHER;
+    pub fn EVP_aes_192_ctr() -> *const EVP_CIPHER;
+    pub fn EVP_aes_192_ccm() -> *const EVP_CIPHER;
+    pub fn EVP_aes_192_gcm() -> *const EVP_CIPHER;
+    pub fn EVP_aes_192_ofb() -> *const EVP_CIPHER;
+    #[cfg(ossl110)]
+    pub fn EVP_aes_192_ocb() -> *const EVP_CIPHER;
+    #[cfg(ossl102)]
+    pub fn EVP_aes_192_wrap() -> *const EVP_CIPHER;
+    #[cfg(ossl110)]
+    pub fn EVP_aes_192_wrap_pad() -> *const EVP_CIPHER;
+    pub fn EVP_aes_256_ecb() -> *const EVP_CIPHER;
+    pub fn EVP_aes_256_cbc() -> *const EVP_CIPHER;
+    pub fn EVP_aes_256_cfb1() -> *const EVP_CIPHER;
+    pub fn EVP_aes_256_cfb8() -> *const EVP_CIPHER;
+    pub fn EVP_aes_256_cfb128() -> *const EVP_CIPHER;
+    pub fn EVP_aes_256_ctr() -> *const EVP_CIPHER;
+    pub fn EVP_aes_256_ccm() -> *const EVP_CIPHER;
+    pub fn EVP_aes_256_gcm() -> *const EVP_CIPHER;
+    pub fn EVP_aes_256_xts() -> *const EVP_CIPHER;
+    pub fn EVP_aes_256_ofb() -> *const EVP_CIPHER;
+    #[cfg(ossl110)]
+    pub fn EVP_aes_256_ocb() -> *const EVP_CIPHER;
+    #[cfg(ossl102)]
+    pub fn EVP_aes_256_wrap() -> *const EVP_CIPHER;
+    #[cfg(ossl110)]
+    pub fn EVP_aes_256_wrap_pad() -> *const EVP_CIPHER;
+    #[cfg(all(any(ossl110, libressl310), not(osslconf = "OPENSSL_NO_CHACHA")))]
+    pub fn EVP_chacha20() -> *const EVP_CIPHER;
+    #[cfg(all(any(ossl110, libressl360), not(osslconf = "OPENSSL_NO_CHACHA")))]
+    pub fn EVP_chacha20_poly1305() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_SEED"))]
+    pub fn EVP_seed_cbc() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_SEED"))]
+    pub fn EVP_seed_cfb128() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_SEED"))]
+    pub fn EVP_seed_ecb() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_SEED"))]
+    pub fn EVP_seed_ofb() -> *const EVP_CIPHER;
+
+    #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM4")))]
+    pub fn EVP_sm4_ecb() -> *const EVP_CIPHER;
+    #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM4")))]
+    pub fn EVP_sm4_cbc() -> *const EVP_CIPHER;
+    #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM4")))]
+    pub fn EVP_sm4_cfb128() -> *const EVP_CIPHER;
+    #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM4")))]
+    pub fn EVP_sm4_ofb() -> *const EVP_CIPHER;
+    #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM4")))]
+    pub fn EVP_sm4_ctr() -> *const EVP_CIPHER;
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn EVP_camellia_128_cfb128() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn EVP_camellia_128_ecb() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn EVP_camellia_128_cbc() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn EVP_camellia_128_ofb() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn EVP_camellia_192_cfb128() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn EVP_camellia_192_ecb() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn EVP_camellia_192_cbc() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn EVP_camellia_192_ofb() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn EVP_camellia_256_cfb128() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn EVP_camellia_256_ecb() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn EVP_camellia_256_cbc() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
+    pub fn EVP_camellia_256_ofb() -> *const EVP_CIPHER;
+
+    #[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
+    pub fn EVP_cast5_cfb64() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
+    pub fn EVP_cast5_ecb() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
+    pub fn EVP_cast5_cbc() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
+    pub fn EVP_cast5_ofb() -> *const EVP_CIPHER;
+
+    #[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
+    pub fn EVP_idea_cfb64() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
+    pub fn EVP_idea_ecb() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
+    pub fn EVP_idea_cbc() -> *const EVP_CIPHER;
+    #[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
+    pub fn EVP_idea_ofb() -> *const EVP_CIPHER;
+
+    #[cfg(not(ossl110))]
+    pub fn OPENSSL_add_all_algorithms_noconf();
+
+    pub fn EVP_get_digestbyname(name: *const c_char) -> *const EVP_MD;
+    pub fn EVP_get_cipherbyname(name: *const c_char) -> *const EVP_CIPHER;
+}
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        extern "C" {
+            pub fn EVP_PKEY_get_id(pkey: *const EVP_PKEY) -> c_int;
+            pub fn EVP_PKEY_get_bits(key: *const EVP_PKEY) -> c_int;
+            pub fn EVP_PKEY_get_security_bits(key: *const EVP_PKEY) -> c_int;
+        }
+    } else {
+        extern "C" {
+            pub fn EVP_PKEY_id(pkey: *const EVP_PKEY) -> c_int;
+        }
+        const_ptr_api! {
+            extern "C" {
+                pub fn EVP_PKEY_bits(key: #[const_ptr_if(any(ossl110, libressl280))] EVP_PKEY) -> c_int;
+                #[cfg(any(ossl110, libressl360))]
+                pub fn EVP_PKEY_security_bits(pkey: #[const_ptr_if(any(ossl110, libressl280))] EVP_PKEY) -> c_int;
+            }
+        }
+    }
+}
+extern "C" {
+    pub fn EVP_PKEY_assign(pkey: *mut EVP_PKEY, typ: c_int, key: *mut c_void) -> c_int;
+
+    pub fn EVP_PKEY_set1_RSA(k: *mut EVP_PKEY, r: *mut RSA) -> c_int;
+    pub fn EVP_PKEY_get1_RSA(k: *mut EVP_PKEY) -> *mut RSA;
+    pub fn EVP_PKEY_set1_DSA(k: *mut EVP_PKEY, k: *mut DSA) -> c_int;
+    pub fn EVP_PKEY_get1_DSA(k: *mut EVP_PKEY) -> *mut DSA;
+    pub fn EVP_PKEY_set1_DH(k: *mut EVP_PKEY, k: *mut DH) -> c_int;
+    pub fn EVP_PKEY_get1_DH(k: *mut EVP_PKEY) -> *mut DH;
+    pub fn EVP_PKEY_set1_EC_KEY(k: *mut EVP_PKEY, k: *mut EC_KEY) -> c_int;
+    pub fn EVP_PKEY_get1_EC_KEY(k: *mut EVP_PKEY) -> *mut EC_KEY;
+
+    pub fn EVP_PKEY_new() -> *mut EVP_PKEY;
+    pub fn EVP_PKEY_free(k: *mut EVP_PKEY);
+    #[cfg(any(ossl110, libressl270))]
+    pub fn EVP_PKEY_up_ref(pkey: *mut EVP_PKEY) -> c_int;
+
+    pub fn d2i_AutoPrivateKey(
+        a: *mut *mut EVP_PKEY,
+        pp: *mut *const c_uchar,
+        length: c_long,
+    ) -> *mut EVP_PKEY;
+
+    pub fn EVP_PKEY_cmp(a: *const EVP_PKEY, b: *const EVP_PKEY) -> c_int;
+
+    pub fn EVP_PKEY_copy_parameters(to: *mut EVP_PKEY, from: *const EVP_PKEY) -> c_int;
+
+    pub fn PKCS5_PBKDF2_HMAC_SHA1(
+        pass: *const c_char,
+        passlen: c_int,
+        salt: *const u8,
+        saltlen: c_int,
+        iter: c_int,
+        keylen: c_int,
+        out: *mut u8,
+    ) -> c_int;
+    pub fn PKCS5_PBKDF2_HMAC(
+        pass: *const c_char,
+        passlen: c_int,
+        salt: *const c_uchar,
+        saltlen: c_int,
+        iter: c_int,
+        digest: *const EVP_MD,
+        keylen: c_int,
+        out: *mut u8,
+    ) -> c_int;
+
+    #[cfg(ossl110)]
+    pub fn EVP_PBE_scrypt(
+        pass: *const c_char,
+        passlen: size_t,
+        salt: *const c_uchar,
+        saltlen: size_t,
+        N: u64,
+        r: u64,
+        p: u64,
+        maxmem: u64,
+        key: *mut c_uchar,
+        keylen: size_t,
+    ) -> c_int;
+
+    pub fn EVP_PKEY_CTX_new(k: *mut EVP_PKEY, e: *mut ENGINE) -> *mut EVP_PKEY_CTX;
+    pub fn EVP_PKEY_CTX_new_id(id: c_int, e: *mut ENGINE) -> *mut EVP_PKEY_CTX;
+    pub fn EVP_PKEY_CTX_free(ctx: *mut EVP_PKEY_CTX);
+
+    pub fn EVP_PKEY_CTX_ctrl(
+        ctx: *mut EVP_PKEY_CTX,
+        keytype: c_int,
+        optype: c_int,
+        cmd: c_int,
+        p1: c_int,
+        p2: *mut c_void,
+    ) -> c_int;
+
+    #[cfg(ossl300)]
+    pub fn EVP_PKEY_CTX_set_signature_md(ctx: *mut EVP_PKEY_CTX, md: *const EVP_MD) -> c_int;
+
+    #[cfg(ossl300)]
+    pub fn EVP_PKEY_CTX_set_params(ctx: *mut EVP_PKEY_CTX, params: *const OSSL_PARAM) -> c_int;
+
+    #[cfg(ossl300)]
+    pub fn EVP_PKEY_CTX_get_params(ctx: *mut EVP_PKEY_CTX, params: *mut OSSL_PARAM) -> c_int;
+
+    pub fn EVP_PKEY_new_mac_key(
+        type_: c_int,
+        e: *mut ENGINE,
+        key: *const c_uchar,
+        keylen: c_int,
+    ) -> *mut EVP_PKEY;
+
+    pub fn EVP_PKEY_derive_init(ctx: *mut EVP_PKEY_CTX) -> c_int;
+    pub fn EVP_PKEY_derive_set_peer(ctx: *mut EVP_PKEY_CTX, peer: *mut EVP_PKEY) -> c_int;
+    #[cfg(ossl300)]
+    pub fn EVP_PKEY_derive_set_peer_ex(
+        ctx: *mut EVP_PKEY_CTX,
+        peer: *mut EVP_PKEY,
+        validate_peer: c_int,
+    ) -> c_int;
+    pub fn EVP_PKEY_derive(ctx: *mut EVP_PKEY_CTX, key: *mut c_uchar, size: *mut size_t) -> c_int;
+
+    #[cfg(ossl300)]
+    pub fn EVP_PKEY_Q_keygen(
+        libctx: *mut OSSL_LIB_CTX,
+        propq: *const c_char,
+        type_: *const c_char,
+        ...
+    ) -> *mut EVP_PKEY;
+    pub fn EVP_PKEY_keygen_init(ctx: *mut EVP_PKEY_CTX) -> c_int;
+    pub fn EVP_PKEY_keygen(ctx: *mut EVP_PKEY_CTX, key: *mut *mut EVP_PKEY) -> c_int;
+
+    pub fn EVP_PKEY_sign_init(ctx: *mut EVP_PKEY_CTX) -> c_int;
+    pub fn EVP_PKEY_sign(
+        ctx: *mut EVP_PKEY_CTX,
+        sig: *mut c_uchar,
+        siglen: *mut size_t,
+        tbs: *const c_uchar,
+        tbslen: size_t,
+    ) -> c_int;
+    pub fn EVP_PKEY_verify_init(ctx: *mut EVP_PKEY_CTX) -> c_int;
+    pub fn EVP_PKEY_verify(
+        ctx: *mut EVP_PKEY_CTX,
+        sig: *const c_uchar,
+        siglen: size_t,
+        tbs: *const c_uchar,
+        tbslen: size_t,
+    ) -> c_int;
+    pub fn EVP_PKEY_encrypt_init(ctx: *mut EVP_PKEY_CTX) -> c_int;
+    pub fn EVP_PKEY_encrypt(
+        ctx: *mut EVP_PKEY_CTX,
+        pout: *mut c_uchar,
+        poutlen: *mut size_t,
+        pin: *const c_uchar,
+        pinlen: size_t,
+    ) -> c_int;
+    pub fn EVP_PKEY_decrypt_init(ctx: *mut EVP_PKEY_CTX) -> c_int;
+    pub fn EVP_PKEY_decrypt(
+        ctx: *mut EVP_PKEY_CTX,
+        pout: *mut c_uchar,
+        poutlen: *mut size_t,
+        pin: *const c_uchar,
+        pinlen: size_t,
+    ) -> c_int;
+    pub fn EVP_PKEY_verify_recover_init(ctx: *mut EVP_PKEY_CTX) -> c_int;
+    pub fn EVP_PKEY_verify_recover(
+        ctx: *mut EVP_PKEY_CTX,
+        rout: *mut c_uchar,
+        routlen: *mut size_t,
+        sig: *const c_uchar,
+        siglen: size_t,
+    ) -> c_int;
+}
+
+const_ptr_api! {
+    extern "C" {
+        pub fn EVP_PKCS82PKEY(p8: #[const_ptr_if(any(ossl110, libressl280))] PKCS8_PRIV_KEY_INFO) -> *mut EVP_PKEY;
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(ossl111, libressl370))] {
+        extern "C" {
+            pub fn EVP_PKEY_get_raw_public_key(
+                pkey: *const EVP_PKEY,
+                ppub: *mut c_uchar,
+                len: *mut size_t,
+            ) -> c_int;
+            pub fn EVP_PKEY_new_raw_public_key(
+                ttype: c_int,
+                e: *mut ENGINE,
+                key: *const c_uchar,
+                keylen: size_t,
+            ) -> *mut EVP_PKEY;
+            pub fn EVP_PKEY_get_raw_private_key(
+                pkey: *const EVP_PKEY,
+                ppriv: *mut c_uchar,
+                len: *mut size_t,
+            ) -> c_int;
+            pub fn EVP_PKEY_new_raw_private_key(
+                ttype: c_int,
+                e: *mut ENGINE,
+                key: *const c_uchar,
+                keylen: size_t,
+            ) -> *mut EVP_PKEY;
+        }
+    }
+}
+
+extern "C" {
+    pub fn EVP_EncodeBlock(dst: *mut c_uchar, src: *const c_uchar, src_len: c_int) -> c_int;
+    pub fn EVP_DecodeBlock(dst: *mut c_uchar, src: *const c_uchar, src_len: c_int) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/hmac.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/hmac.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/hmac.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/hmac.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,30 @@
+use libc::*;
+
+use super::super::*;
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl350))] {
+        extern "C" {
+            pub fn HMAC_CTX_new() -> *mut HMAC_CTX;
+            pub fn HMAC_CTX_free(ctx: *mut HMAC_CTX);
+        }
+    } else {
+        extern "C" {
+            pub fn HMAC_CTX_init(ctx: *mut HMAC_CTX);
+            pub fn HMAC_CTX_cleanup(ctx: *mut HMAC_CTX);
+        }
+    }
+}
+
+extern "C" {
+    pub fn HMAC_Init_ex(
+        ctx: *mut HMAC_CTX,
+        key: *const c_void,
+        len: c_int,
+        md: *const EVP_MD,
+        impl_: *mut ENGINE,
+    ) -> c_int;
+    pub fn HMAC_Update(ctx: *mut HMAC_CTX, data: *const c_uchar, len: size_t) -> c_int;
+    pub fn HMAC_Final(ctx: *mut HMAC_CTX, md: *mut c_uchar, len: *mut c_uint) -> c_int;
+    pub fn HMAC_CTX_copy(dst: *mut HMAC_CTX, src: *mut HMAC_CTX) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/kdf.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/kdf.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/kdf.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/kdf.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,26 @@
+use super::super::*;
+use libc::*;
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        extern "C" {
+            pub fn EVP_PKEY_CTX_set_hkdf_mode(ctx: *mut EVP_PKEY_CTX, mode: c_int) -> c_int;
+            pub fn EVP_PKEY_CTX_set_hkdf_md(ctx: *mut EVP_PKEY_CTX, md: *const EVP_MD) -> c_int;
+            pub fn EVP_PKEY_CTX_set1_hkdf_salt(
+                ctx: *mut EVP_PKEY_CTX,
+                salt: *const u8,
+                saltlen: c_int,
+            ) -> c_int;
+            pub fn EVP_PKEY_CTX_set1_hkdf_key(
+                ctx: *mut EVP_PKEY_CTX,
+                key: *const u8,
+                keylen: c_int,
+            ) -> c_int;
+            pub fn EVP_PKEY_CTX_add1_hkdf_info(
+                ctx: *mut EVP_PKEY_CTX,
+                info: *const u8,
+                infolen: c_int,
+            ) -> c_int;
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/mod.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/mod.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,73 @@
+pub use self::aes::*;
+pub use self::asn1::*;
+pub use self::bio::*;
+pub use self::bn::*;
+pub use self::cmac::*;
+pub use self::cms::*;
+pub use self::conf::*;
+pub use self::crypto::*;
+pub use self::dh::*;
+pub use self::dsa::*;
+pub use self::ec::*;
+pub use self::err::*;
+pub use self::evp::*;
+pub use self::hmac::*;
+pub use self::kdf::*;
+pub use self::object::*;
+pub use self::ocsp::*;
+pub use self::params::*;
+pub use self::pem::*;
+pub use self::pkcs12::*;
+pub use self::pkcs7::*;
+#[cfg(libressl)]
+pub use self::poly1305::*;
+pub use self::provider::*;
+pub use self::rand::*;
+pub use self::rsa::*;
+pub use self::safestack::*;
+pub use self::sha::*;
+pub use self::srtp::*;
+pub use self::ssl::*;
+pub use self::stack::*;
+pub use self::tls1::*;
+pub use self::types::*;
+pub use self::x509::*;
+pub use self::x509_vfy::*;
+pub use self::x509v3::*;
+
+mod aes;
+mod asn1;
+mod bio;
+mod bn;
+mod cmac;
+mod cms;
+mod conf;
+mod crypto;
+mod dh;
+mod dsa;
+mod ec;
+mod err;
+mod evp;
+mod hmac;
+mod kdf;
+mod object;
+mod ocsp;
+mod params;
+mod pem;
+mod pkcs12;
+mod pkcs7;
+#[cfg(libressl)]
+mod poly1305;
+mod provider;
+mod rand;
+mod rsa;
+mod safestack;
+mod sha;
+mod srtp;
+mod ssl;
+mod stack;
+mod tls1;
+mod types;
+mod x509;
+mod x509_vfy;
+mod x509v3;
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/object.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/object.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/object.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/object.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,31 @@
+use libc::*;
+
+use super::super::*;
+
+extern "C" {
+    pub fn OBJ_nid2ln(nid: c_int) -> *const c_char;
+    pub fn OBJ_nid2sn(nid: c_int) -> *const c_char;
+    pub fn OBJ_nid2obj(n: c_int) -> *mut ASN1_OBJECT;
+    pub fn OBJ_obj2nid(o: *const ASN1_OBJECT) -> c_int;
+    pub fn OBJ_obj2txt(
+        buf: *mut c_char,
+        buf_len: c_int,
+        a: *const ASN1_OBJECT,
+        no_name: c_int,
+    ) -> c_int;
+
+    pub fn OBJ_find_sigid_algs(signid: c_int, pdig_nid: *mut c_int, ppkey_nid: *mut c_int)
+        -> c_int;
+    pub fn OBJ_sn2nid(sn: *const libc::c_char) -> libc::c_int;
+    pub fn OBJ_txt2obj(s: *const libc::c_char, no_name: libc::c_int) -> *mut ASN1_OBJECT;
+    pub fn OBJ_create(
+        oid: *const libc::c_char,
+        sn: *const libc::c_char,
+        ln: *const libc::c_char,
+    ) -> c_int;
+    #[cfg(ossl111)]
+    pub fn OBJ_length(obj: *const ASN1_OBJECT) -> libc::size_t;
+    #[cfg(ossl111)]
+    pub fn OBJ_get0_data(obj: *const ASN1_OBJECT) -> *const c_uchar;
+    pub fn OBJ_cmp(a: *const ASN1_OBJECT, b: *const ASN1_OBJECT) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/ocsp.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/ocsp.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/ocsp.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/ocsp.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,89 @@
+use super::super::*;
+use libc::*;
+
+pub enum OCSP_CERTID {}
+
+pub enum OCSP_ONEREQ {}
+
+pub enum OCSP_REQUEST {}
+
+pub enum OCSP_BASICRESP {}
+
+const_ptr_api! {
+    extern "C" {
+        pub fn OCSP_cert_to_id(
+            dgst: *const EVP_MD,
+            subject: #[const_ptr_if(any(ossl110, libressl281))] X509,
+            issuer: #[const_ptr_if(any(ossl110, libressl281))] X509,
+        ) -> *mut OCSP_CERTID;
+    }
+}
+
+extern "C" {
+    pub fn OCSP_request_add0_id(r: *mut OCSP_REQUEST, id: *mut OCSP_CERTID) -> *mut OCSP_ONEREQ;
+
+    pub fn OCSP_resp_find_status(
+        bs: *mut OCSP_BASICRESP,
+        id: *mut OCSP_CERTID,
+        status: *mut c_int,
+        reason: *mut c_int,
+        revtime: *mut *mut ASN1_GENERALIZEDTIME,
+        thisupd: *mut *mut ASN1_GENERALIZEDTIME,
+        nextupd: *mut *mut ASN1_GENERALIZEDTIME,
+    ) -> c_int;
+    pub fn OCSP_check_validity(
+        thisupd: *mut ASN1_GENERALIZEDTIME,
+        nextupd: *mut ASN1_GENERALIZEDTIME,
+        sec: c_long,
+        maxsec: c_long,
+    ) -> c_int;
+
+    pub fn OCSP_response_status(resp: *mut OCSP_RESPONSE) -> c_int;
+    pub fn OCSP_response_get1_basic(resp: *mut OCSP_RESPONSE) -> *mut OCSP_BASICRESP;
+
+    pub fn OCSP_response_create(status: c_int, bs: *mut OCSP_BASICRESP) -> *mut OCSP_RESPONSE;
+
+    pub fn OCSP_BASICRESP_new() -> *mut OCSP_BASICRESP;
+    pub fn OCSP_BASICRESP_free(r: *mut OCSP_BASICRESP);
+    pub fn OCSP_RESPONSE_new() -> *mut OCSP_RESPONSE;
+    pub fn OCSP_RESPONSE_free(r: *mut OCSP_RESPONSE);
+}
+
+const_ptr_api! {
+    extern "C" {
+        pub fn i2d_OCSP_RESPONSE(a: #[const_ptr_if(ossl300)] OCSP_RESPONSE, pp: *mut *mut c_uchar) -> c_int;
+    }
+}
+
+extern "C" {
+    pub fn d2i_OCSP_RESPONSE(
+        a: *mut *mut OCSP_RESPONSE,
+        pp: *mut *const c_uchar,
+        length: c_long,
+    ) -> *mut OCSP_RESPONSE;
+    pub fn OCSP_ONEREQ_free(r: *mut OCSP_ONEREQ);
+    pub fn OCSP_CERTID_free(id: *mut OCSP_CERTID);
+    pub fn OCSP_REQUEST_new() -> *mut OCSP_REQUEST;
+    pub fn OCSP_REQUEST_free(r: *mut OCSP_REQUEST);
+}
+
+const_ptr_api! {
+    extern "C" {
+        pub fn i2d_OCSP_REQUEST(a: #[const_ptr_if(ossl300)] OCSP_REQUEST, pp: *mut *mut c_uchar) -> c_int;
+    }
+}
+
+extern "C" {
+    pub fn d2i_OCSP_REQUEST(
+        a: *mut *mut OCSP_REQUEST,
+        pp: *mut *const c_uchar,
+        length: c_long,
+    ) -> *mut OCSP_REQUEST;
+
+    pub fn OCSP_basic_verify(
+        bs: *mut OCSP_BASICRESP,
+        certs: *mut stack_st_X509,
+        st: *mut X509_STORE,
+        flags: c_ulong,
+    ) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/params.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/params.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/params.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/params.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,9 @@
+use super::super::*;
+use libc::*;
+
+extern "C" {
+    #[cfg(ossl300)]
+    pub fn OSSL_PARAM_construct_uint(key: *const c_char, buf: *mut c_uint) -> OSSL_PARAM;
+    #[cfg(ossl300)]
+    pub fn OSSL_PARAM_construct_end() -> OSSL_PARAM;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/pem.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/pem.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/pem.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/pem.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,191 @@
+use super::super::*;
+use libc::*;
+
+pub type pem_password_cb = Option<
+    unsafe extern "C" fn(
+        buf: *mut c_char,
+        size: c_int,
+        rwflag: c_int,
+        user_data: *mut c_void,
+    ) -> c_int,
+>;
+
+const_ptr_api! {
+    extern "C" {
+        pub fn PEM_write_bio_X509(bio: *mut BIO, x509: #[const_ptr_if(ossl300)] X509) -> c_int;
+        pub fn PEM_write_bio_X509_REQ(bio: *mut BIO, x509: #[const_ptr_if(ossl300)] X509_REQ) -> c_int;
+        pub fn PEM_write_bio_X509_CRL(bio: *mut BIO, x509: #[const_ptr_if(ossl300)] X509_CRL) -> c_int;
+        pub fn PEM_write_bio_RSAPrivateKey(
+            bp: *mut BIO,
+            rsa: #[const_ptr_if(ossl300)] RSA,
+            cipher: *const EVP_CIPHER,
+            kstr: #[const_ptr_if(ossl300)] c_uchar,
+            klen: c_int,
+            callback: pem_password_cb,
+            user_data: *mut c_void,
+        ) -> c_int;
+        pub fn PEM_write_bio_RSA_PUBKEY(bp: *mut BIO, rsa: #[const_ptr_if(ossl300)] RSA) -> c_int;
+        pub fn PEM_write_bio_DSAPrivateKey(
+            bp: *mut BIO,
+            dsa: #[const_ptr_if(ossl300)] DSA,
+            cipher: *const EVP_CIPHER,
+            kstr: #[const_ptr_if(ossl300)] c_uchar,
+            klen: c_int,
+            callback: pem_password_cb,
+            user_data: *mut c_void,
+        ) -> c_int;
+        pub fn PEM_write_bio_ECPrivateKey(
+            bio: *mut BIO,
+            key: #[const_ptr_if(ossl300)] EC_KEY,
+            cipher: *const EVP_CIPHER,
+            kstr: #[const_ptr_if(ossl300)] c_uchar,
+            klen: c_int,
+            callback: pem_password_cb,
+            user_data: *mut c_void,
+        ) -> c_int;
+        pub fn PEM_write_bio_DSA_PUBKEY(bp: *mut BIO, dsa: #[const_ptr_if(ossl300)] DSA) -> c_int;
+        pub fn PEM_write_bio_PrivateKey(
+            bio: *mut BIO,
+            pkey: #[const_ptr_if(ossl300)] EVP_PKEY,
+            cipher: *const EVP_CIPHER,
+            kstr: #[const_ptr_if(ossl300)] c_uchar,
+            klen: c_int,
+            callback: pem_password_cb,
+            user_data: *mut c_void,
+        ) -> c_int;
+        pub fn PEM_write_bio_PUBKEY(bp: *mut BIO, x: #[const_ptr_if(ossl300)] EVP_PKEY) -> c_int;
+        pub fn PEM_write_bio_PKCS8PrivateKey(
+            bio: *mut BIO,
+            pkey: #[const_ptr_if(ossl300)] EVP_PKEY,
+            cipher: *const EVP_CIPHER,
+            kstr: #[const_ptr_if(ossl300)] c_char,
+            klen: c_int,
+            callback: pem_password_cb,
+            user_data: *mut c_void,
+        ) -> c_int;
+        pub fn PEM_write_bio_PKCS7(bp: *mut BIO, x: #[const_ptr_if(ossl300)] PKCS7) -> c_int;
+        pub fn PEM_write_bio_EC_PUBKEY(bp: *mut BIO, ec: #[const_ptr_if(ossl300)] EC_KEY) -> c_int;
+        pub fn i2d_PKCS8PrivateKey_bio(
+            bp: *mut BIO,
+            x: #[const_ptr_if(ossl300)] EVP_PKEY,
+            enc: *const EVP_CIPHER,
+            kstr: #[const_ptr_if(ossl300)] c_char,
+            klen: c_int,
+            cb: pem_password_cb,
+            u: *mut c_void,
+        ) -> c_int;
+    }
+}
+
+extern "C" {
+    pub fn PEM_read_bio_X509(
+        bio: *mut BIO,
+        out: *mut *mut X509,
+        callback: pem_password_cb,
+        user_data: *mut c_void,
+    ) -> *mut X509;
+    pub fn PEM_read_bio_X509_REQ(
+        bio: *mut BIO,
+        out: *mut *mut X509_REQ,
+        callback: pem_password_cb,
+        user_data: *mut c_void,
+    ) -> *mut X509_REQ;
+    pub fn PEM_read_bio_X509_CRL(
+        bio: *mut BIO,
+        out: *mut *mut X509_CRL,
+        callback: pem_password_cb,
+        user_data: *mut c_void,
+    ) -> *mut X509_CRL;
+    pub fn PEM_read_bio_RSAPrivateKey(
+        bio: *mut BIO,
+        rsa: *mut *mut RSA,
+        callback: pem_password_cb,
+        user_data: *mut c_void,
+    ) -> *mut RSA;
+    pub fn PEM_read_bio_RSAPublicKey(
+        bio: *mut BIO,
+        rsa: *mut *mut RSA,
+        callback: pem_password_cb,
+        user_data: *mut c_void,
+    ) -> *mut RSA;
+    pub fn PEM_write_bio_RSAPublicKey(bp: *mut BIO, rsa: *const RSA) -> c_int;
+    pub fn PEM_read_bio_RSA_PUBKEY(
+        bio: *mut BIO,
+        rsa: *mut *mut RSA,
+        callback: pem_password_cb,
+        user_data: *mut c_void,
+    ) -> *mut RSA;
+    pub fn PEM_read_bio_DSAPrivateKey(
+        bp: *mut BIO,
+        dsa: *mut *mut DSA,
+        callback: pem_password_cb,
+        user_data: *mut c_void,
+    ) -> *mut DSA;
+    pub fn PEM_read_bio_DSA_PUBKEY(
+        bp: *mut BIO,
+        dsa: *mut *mut DSA,
+        callback: pem_password_cb,
+        user_data: *mut c_void,
+    ) -> *mut DSA;
+    pub fn PEM_read_bio_ECPrivateKey(
+        bio: *mut BIO,
+        key: *mut *mut EC_KEY,
+        callback: pem_password_cb,
+        user_data: *mut c_void,
+    ) -> *mut EC_KEY;
+    pub fn PEM_read_bio_EC_PUBKEY(
+        bp: *mut BIO,
+        ec: *mut *mut EC_KEY,
+        callback: pem_password_cb,
+        user_data: *mut c_void,
+    ) -> *mut EC_KEY;
+    pub fn PEM_read_bio_DHparams(
+        bio: *mut BIO,
+        out: *mut *mut DH,
+        callback: pem_password_cb,
+        user_data: *mut c_void,
+    ) -> *mut DH;
+    pub fn PEM_write_bio_DHparams(bio: *mut BIO, x: *const DH) -> c_int;
+    pub fn PEM_read_bio_PrivateKey(
+        bio: *mut BIO,
+        out: *mut *mut EVP_PKEY,
+        callback: pem_password_cb,
+        user_data: *mut c_void,
+    ) -> *mut EVP_PKEY;
+    pub fn PEM_read_bio_PUBKEY(
+        bio: *mut BIO,
+        out: *mut *mut EVP_PKEY,
+        callback: pem_password_cb,
+        user_data: *mut c_void,
+    ) -> *mut EVP_PKEY;
+
+    pub fn d2i_PKCS8PrivateKey_bio(
+        bp: *mut BIO,
+        x: *mut *mut EVP_PKEY,
+        cb: pem_password_cb,
+        u: *mut c_void,
+    ) -> *mut EVP_PKEY;
+    pub fn d2i_PKCS8_PRIV_KEY_INFO(
+        k: *mut *mut PKCS8_PRIV_KEY_INFO,
+        buf: *mut *const u8,
+        length: c_long,
+    ) -> *mut PKCS8_PRIV_KEY_INFO;
+    pub fn PKCS8_PRIV_KEY_INFO_free(p8inf: *mut PKCS8_PRIV_KEY_INFO);
+
+    pub fn PEM_read_bio_PKCS7(
+        bio: *mut BIO,
+        out: *mut *mut PKCS7,
+        cb: pem_password_cb,
+        u: *mut c_void,
+    ) -> *mut PKCS7;
+
+    #[cfg(ossl101)]
+    pub fn PEM_read_bio_CMS(
+        bio: *mut BIO,
+        out: *mut *mut CMS_ContentInfo,
+        callback: pem_password_cb,
+        user_data: *mut c_void,
+    ) -> *mut CMS_ContentInfo;
+    #[cfg(ossl101)]
+    pub fn PEM_write_bio_CMS(bio: *mut BIO, cms: *const CMS_ContentInfo) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/pkcs12.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/pkcs12.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/pkcs12.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/pkcs12.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,53 @@
+use libc::*;
+
+use super::super::*;
+
+pub enum PKCS12 {}
+
+extern "C" {
+    pub fn PKCS12_free(p12: *mut PKCS12);
+}
+const_ptr_api! {
+    extern "C" {
+        pub fn i2d_PKCS12(a: #[const_ptr_if(ossl300)] PKCS12, buf: *mut *mut u8) -> c_int;
+    }
+}
+extern "C" {
+    pub fn d2i_PKCS12(a: *mut *mut PKCS12, pp: *mut *const u8, length: c_long) -> *mut PKCS12;
+
+    pub fn PKCS12_parse(
+        p12: *mut PKCS12,
+        pass: *const c_char,
+        pkey: *mut *mut EVP_PKEY,
+        cert: *mut *mut X509,
+        ca: *mut *mut stack_st_X509,
+    ) -> c_int;
+
+    pub fn PKCS12_set_mac(
+        p12: *mut PKCS12,
+        pass: *const c_char,
+        passlen: c_int,
+        salt: *mut c_uchar,
+        saltlen: c_int,
+        iter: c_int,
+        md_type: *const EVP_MD,
+    ) -> c_int;
+}
+const_ptr_api! {
+    extern "C" {
+        pub fn PKCS12_create(
+            pass: #[const_ptr_if(any(ossl110, libressl280))] c_char,
+            friendly_name: #[const_ptr_if(any(ossl110, libressl280))] c_char,
+            pkey: *mut EVP_PKEY,
+            cert: *mut X509,
+            ca: *mut stack_st_X509,
+            nid_key: c_int,
+            nid_cert: c_int,
+            iter: c_int,
+            mac_iter: c_int,
+            keytype: c_int,
+        ) -> *mut PKCS12;
+
+        pub fn i2d_PKCS12_bio(b: *mut BIO, a: #[const_ptr_if(ossl300)] PKCS12) -> c_int;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/pkcs7.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/pkcs7.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/pkcs7.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/pkcs7.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,257 @@
+use super::super::*;
+use libc::*;
+
+#[cfg(ossl300)]
+#[repr(C)]
+pub struct PKCS7_CTX {
+    libctx: *mut OSSL_LIB_CTX,
+    propq: *mut c_char,
+}
+
+#[repr(C)]
+pub struct PKCS7_SIGNED {
+    pub version: *mut ASN1_INTEGER,        /* version 1 */
+    pub md_algs: *mut stack_st_X509_ALGOR, /* md used */
+    pub cert: *mut stack_st_X509,          /* [ 0 ] */
+    pub crl: *mut stack_st_X509_CRL,       /* [ 1 ] */
+    pub signer_info: *mut stack_st_PKCS7_SIGNER_INFO,
+    pub contents: *mut PKCS7,
+}
+#[repr(C)]
+pub struct PKCS7_ENC_CONTENT {
+    pub content_type: *mut ASN1_OBJECT,
+    pub algorithm: *mut X509_ALGOR,
+    pub enc_data: *mut ASN1_OCTET_STRING, /* [ 0 ] */
+    pub cipher: *const EVP_CIPHER,
+    #[cfg(ossl300)]
+    pub ctx: *const PKCS7_CTX,
+}
+#[repr(C)]
+pub struct PKCS7_ENVELOPE {
+    pub version: *mut ASN1_INTEGER, /* version 0 */
+    pub recipientinfo: *mut stack_st_PKCS7_RECIP_INFO,
+    pub enc_data: *mut PKCS7_ENC_CONTENT,
+}
+#[repr(C)]
+pub struct PKCS7_SIGN_ENVELOPE {
+    pub version: *mut ASN1_INTEGER,        /* version 1 */
+    pub md_algs: *mut stack_st_X509_ALGOR, /* md used */
+    pub cert: *mut stack_st_X509,          /* [ 0 ] */
+    pub crl: *mut stack_st_X509_CRL,       /* [ 1 ] */
+    pub signer_info: *mut stack_st_PKCS7_SIGNER_INFO,
+    pub enc_data: *mut PKCS7_ENC_CONTENT,
+    pub recipientinfo: *mut stack_st_PKCS7_RECIP_INFO,
+}
+#[repr(C)]
+pub struct PKCS7_DIGEST {
+    pub version: *mut ASN1_INTEGER, /* version 0 */
+    pub md: *mut X509_ALGOR,        /* md used */
+    pub contents: *mut PKCS7,
+    pub digest: *mut ASN1_OCTET_STRING,
+}
+#[repr(C)]
+pub struct PKCS7_ENCRYPT {
+    pub version: *mut ASN1_INTEGER, /* version 0 */
+    pub enc_data: *mut PKCS7_ENC_CONTENT,
+}
+
+extern "C" {
+    pub fn PKCS7_SIGNED_free(info: *mut PKCS7_SIGNED);
+    pub fn PKCS7_ENC_CONTENT_free(info: *mut PKCS7_ENC_CONTENT);
+    pub fn PKCS7_ENVELOPE_free(info: *mut PKCS7_ENVELOPE);
+    pub fn PKCS7_SIGN_ENVELOPE_free(info: *mut PKCS7_SIGN_ENVELOPE);
+    pub fn PKCS7_DIGEST_free(info: *mut PKCS7_DIGEST);
+    pub fn PKCS7_SIGNER_INFO_free(info: *mut PKCS7_SIGNER_INFO);
+    pub fn PKCS7_ENCRYPT_free(enc: *mut PKCS7_ENCRYPT);
+    pub fn PKCS7_ISSUER_AND_SERIAL_free(ias: *mut PKCS7_ISSUER_AND_SERIAL);
+    pub fn PKCS7_RECIP_INFO_free(info: *mut PKCS7_RECIP_INFO);
+}
+
+#[repr(C)]
+pub struct PKCS7 {
+    /*
+     * The following is non NULL if it contains ASN1 encoding of this
+     * structure
+     */
+    pub asn1: *mut c_uchar,
+    pub length: c_long,
+    // # define PKCS7_S_HEADER  0
+    // # define PKCS7_S_BODY    1
+    // # define PKCS7_S_TAIL    2
+    pub state: c_int, /* used during processing */
+    pub detached: c_int,
+    pub type_: *mut ASN1_OBJECT,
+    /* content as defined by the type */
+    /*
+     * all encryption/message digests are applied to the 'contents', leaving
+     * out the 'type' field.
+     */
+    pub d: PKCS7_data,
+    #[cfg(ossl300)]
+    pub ctx: PKCS7_CTX,
+}
+
+#[repr(C)]
+pub union PKCS7_data {
+    pub ptr: *mut c_char,
+    /* NID_pkcs7_data */
+    pub data: *mut ASN1_OCTET_STRING,
+    /* NID_pkcs7_signed */
+    pub sign: *mut PKCS7_SIGNED,
+    /* NID_pkcs7_enveloped */
+    pub enveloped: *mut PKCS7_ENVELOPE,
+    /* NID_pkcs7_signedAndEnveloped */
+    pub signed_and_enveloped: *mut PKCS7_SIGN_ENVELOPE,
+    /* NID_pkcs7_digest */
+    pub digest: *mut PKCS7_DIGEST,
+    /* NID_pkcs7_encrypted */
+    pub encrypted: *mut PKCS7_ENCRYPT,
+    /* Anything else */
+    pub other: *mut ASN1_TYPE,
+}
+
+#[repr(C)]
+pub struct PKCS7_ISSUER_AND_SERIAL {
+    pub issuer: *mut X509_NAME,
+    pub serial: *mut ASN1_INTEGER,
+}
+
+#[repr(C)]
+pub struct PKCS7_SIGNER_INFO {
+    pub version: *mut ASN1_INTEGER, /* version 1 */
+    pub issuer_and_serial: *mut PKCS7_ISSUER_AND_SERIAL,
+    pub digest_alg: *mut X509_ALGOR,
+    pub auth_attr: *mut stack_st_X509_ATTRIBUTE, /* [ 0 ] */
+    pub digest_enc_alg: *mut X509_ALGOR,
+    pub enc_digest: *mut ASN1_OCTET_STRING,
+    pub unauth_attr: *mut stack_st_X509_ATTRIBUTE, /* [ 1 ] */
+    pub pkey: *mut EVP_PKEY,                       /* The private key to sign with */
+    #[cfg(ossl300)]
+    pub ctx: *const PKCS7_CTX,
+}
+
+stack!(stack_st_PKCS7_SIGNER_INFO);
+
+#[repr(C)]
+pub struct PKCS7_RECIP_INFO {
+    pub version: *mut ASN1_INTEGER, /* version 0 */
+    pub issuer_and_serial: *mut PKCS7_ISSUER_AND_SERIAL,
+    pub key_enc_algor: *mut X509_ALGOR,
+    pub enc_key: *mut ASN1_OCTET_STRING,
+    pub cert: *mut X509, /* get the pub-key from this */
+    #[cfg(ossl300)]
+    pub ctx: *const PKCS7_CTX,
+}
+
+stack!(stack_st_PKCS7_RECIP_INFO);
+
+extern "C" {
+    pub fn d2i_PKCS7(a: *mut *mut PKCS7, pp: *mut *const c_uchar, length: c_long) -> *mut PKCS7;
+}
+
+const_ptr_api! {
+    extern "C" {
+        pub fn i2d_PKCS7(a: #[const_ptr_if(ossl300)] PKCS7, buf: *mut *mut u8) -> c_int;
+        pub fn i2d_PKCS7_bio(bio: *mut BIO, p7: #[const_ptr_if(ossl300)]  PKCS7) -> c_int;
+    }
+}
+
+extern "C" {
+    pub fn PKCS7_encrypt(
+        certs: *mut stack_st_X509,
+        b: *mut BIO,
+        cipher: *const EVP_CIPHER,
+        flags: c_int,
+    ) -> *mut PKCS7;
+
+    pub fn PKCS7_verify(
+        pkcs7: *mut PKCS7,
+        certs: *mut stack_st_X509,
+        store: *mut X509_STORE,
+        indata: *mut BIO,
+        out: *mut BIO,
+        flags: c_int,
+    ) -> c_int;
+
+    pub fn PKCS7_get0_signers(
+        pkcs7: *mut PKCS7,
+        certs: *mut stack_st_X509,
+        flags: c_int,
+    ) -> *mut stack_st_X509;
+
+    pub fn PKCS7_sign(
+        signcert: *mut X509,
+        pkey: *mut EVP_PKEY,
+        certs: *mut stack_st_X509,
+        data: *mut BIO,
+        flags: c_int,
+    ) -> *mut PKCS7;
+
+    pub fn PKCS7_decrypt(
+        pkcs7: *mut PKCS7,
+        pkey: *mut EVP_PKEY,
+        cert: *mut X509,
+        data: *mut BIO,
+        flags: c_int,
+    ) -> c_int;
+
+    pub fn PKCS7_free(pkcs7: *mut PKCS7);
+
+    pub fn SMIME_write_PKCS7(
+        out: *mut BIO,
+        pkcs7: *mut PKCS7,
+        data: *mut BIO,
+        flags: c_int,
+    ) -> c_int;
+
+    pub fn SMIME_read_PKCS7(bio: *mut BIO, bcont: *mut *mut BIO) -> *mut PKCS7;
+
+    pub fn PKCS7_new() -> *mut PKCS7;
+
+    pub fn PKCS7_set_type(p7: *mut PKCS7, nid_pkcs7: c_int) -> c_int;
+
+    pub fn PKCS7_add_certificate(p7: *mut PKCS7, x509: *mut X509) -> c_int;
+
+    pub fn PKCS7_add_signature(
+        p7: *mut PKCS7,
+        x509: *mut X509,
+        pkey: *mut EVP_PKEY,
+        digest: *const EVP_MD,
+    ) -> *mut PKCS7_SIGNER_INFO;
+
+    pub fn PKCS7_set_signed_attributes(
+        p7si: *mut PKCS7_SIGNER_INFO,
+        attributes: *mut stack_st_X509_ATTRIBUTE,
+    ) -> c_int;
+
+    pub fn PKCS7_add_signed_attribute(
+        p7si: *mut PKCS7_SIGNER_INFO,
+        nid: c_int,
+        attrtype: c_int,
+        data: *mut c_void,
+    ) -> c_int;
+
+    pub fn PKCS7_content_new(p7: *mut PKCS7, nid_pkcs7: c_int) -> c_int;
+
+    pub fn PKCS7_dataInit(p7: *mut PKCS7, bio: *mut BIO) -> *mut BIO;
+
+    pub fn PKCS7_dataFinal(p7: *mut PKCS7, bio: *mut BIO) -> c_int;
+
+    pub fn PKCS7_get_signer_info(p7: *mut PKCS7) -> *mut stack_st_PKCS7_SIGNER_INFO;
+
+    pub fn PKCS7_SIGNER_INFO_get0_algs(
+        si: *mut PKCS7_SIGNER_INFO,
+        pk: *mut *mut EVP_PKEY,
+        pdig: *mut *mut X509_ALGOR,
+        psig: *mut *mut X509_ALGOR,
+    );
+}
+
+const_ptr_api! {
+    extern "C" {
+        pub fn PKCS7_get_signed_attribute(
+            si: #[const_ptr_if(ossl300)] PKCS7_SIGNER_INFO,
+            nid: c_int
+        ) -> *mut ASN1_TYPE;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/poly1305.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/poly1305.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/poly1305.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/poly1305.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,23 @@
+use super::super::*;
+use libc::*;
+
+cfg_if! {
+    if #[cfg(libressl)] {
+        #[repr(C)]
+        #[derive(Debug, Copy, Clone)]
+        pub struct poly1305_context {
+            pub aligner: usize,
+            pub opaque: [::libc::c_uchar; 136usize],
+        }
+        pub type poly1305_state = poly1305_context;
+        extern "C" {
+            pub fn CRYPTO_poly1305_init(ctx: *mut poly1305_context, key: *const ::libc::c_uchar);
+            pub fn CRYPTO_poly1305_update(
+                ctx: *mut poly1305_context,
+                in_: *const ::libc::c_uchar,
+                len: usize,
+            );
+            pub fn CRYPTO_poly1305_finish(ctx: *mut poly1305_context, mac: *mut ::libc::c_uchar);
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/provider.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/provider.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/provider.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/provider.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,20 @@
+use super::super::*;
+use libc::*;
+
+extern "C" {
+    #[cfg(ossl300)]
+    pub fn OSSL_PROVIDER_load(ctx: *mut OSSL_LIB_CTX, name: *const c_char) -> *mut OSSL_PROVIDER;
+    #[cfg(ossl300)]
+    pub fn OSSL_PROVIDER_try_load(
+        ctx: *mut OSSL_LIB_CTX,
+        name: *const c_char,
+        retain_fallbacks: c_int,
+    ) -> *mut OSSL_PROVIDER;
+    #[cfg(ossl300)]
+    pub fn OSSL_PROVIDER_unload(prov: *mut OSSL_PROVIDER) -> c_int;
+    #[cfg(ossl300)]
+    pub fn OSSL_PROVIDER_set_default_search_path(
+        ctx: *mut OSSL_LIB_CTX,
+        path: *const c_char,
+    ) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/rand.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/rand.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/rand.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/rand.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,15 @@
+use libc::*;
+
+extern "C" {
+    pub fn RAND_bytes(buf: *mut u8, num: c_int) -> c_int;
+
+    #[cfg(ossl111)]
+    pub fn RAND_priv_bytes(buf: *mut u8, num: c_int) -> c_int;
+
+    #[cfg(ossl111)]
+    pub fn RAND_keep_random_devices_open(keep: c_int);
+
+    pub fn RAND_status() -> c_int;
+
+    pub fn RAND_add(buf: *const c_void, num: c_int, randomness: c_double);
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/rsa.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/rsa.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/rsa.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/rsa.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,124 @@
+use super::super::*;
+use libc::*;
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        extern "C" {
+            pub fn EVP_PKEY_CTX_set_rsa_padding(ctx: *mut EVP_PKEY_CTX, pad_mode: c_int) -> c_int;
+            pub fn EVP_PKEY_CTX_get_rsa_padding(ctx: *mut EVP_PKEY_CTX, pad_mode: *mut c_int) -> c_int;
+
+            pub fn EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx: *mut EVP_PKEY_CTX, len: c_int) -> c_int;
+            pub fn EVP_PKEY_CTX_set_rsa_mgf1_md(ctx: *mut EVP_PKEY_CTX, md: *const EVP_MD) -> c_int;
+        }
+    }
+}
+
+extern "C" {
+    pub fn RSA_new() -> *mut RSA;
+    pub fn RSA_size(k: *const RSA) -> c_int;
+
+    #[cfg(any(ossl110, libressl273))]
+    pub fn RSA_set0_key(r: *mut RSA, n: *mut BIGNUM, e: *mut BIGNUM, d: *mut BIGNUM) -> c_int;
+    #[cfg(any(ossl110, libressl273))]
+    pub fn RSA_set0_factors(r: *mut RSA, p: *mut BIGNUM, q: *mut BIGNUM) -> c_int;
+    #[cfg(any(ossl110, libressl273))]
+    pub fn RSA_set0_crt_params(
+        r: *mut RSA,
+        dmp1: *mut BIGNUM,
+        dmq1: *mut BIGNUM,
+        iqmp: *mut BIGNUM,
+    ) -> c_int;
+    #[cfg(any(ossl110, libressl273))]
+    pub fn RSA_get0_key(
+        r: *const RSA,
+        n: *mut *const BIGNUM,
+        e: *mut *const BIGNUM,
+        d: *mut *const BIGNUM,
+    );
+    #[cfg(any(ossl110, libressl273))]
+    pub fn RSA_get0_factors(r: *const RSA, p: *mut *const BIGNUM, q: *mut *const BIGNUM);
+    #[cfg(any(ossl110, libressl273))]
+    pub fn RSA_get0_crt_params(
+        r: *const RSA,
+        dmp1: *mut *const BIGNUM,
+        dmq1: *mut *const BIGNUM,
+        iqmp: *mut *const BIGNUM,
+    );
+
+    #[cfg(not(ossl110))]
+    pub fn RSA_generate_key(
+        modsz: c_int,
+        e: c_ulong,
+        cb: Option<extern "C" fn(c_int, c_int, *mut c_void)>,
+        cbarg: *mut c_void,
+    ) -> *mut RSA;
+
+    pub fn RSA_generate_key_ex(
+        rsa: *mut RSA,
+        bits: c_int,
+        e: *mut BIGNUM,
+        cb: *mut BN_GENCB,
+    ) -> c_int;
+
+    pub fn RSA_public_encrypt(
+        flen: c_int,
+        from: *const u8,
+        to: *mut u8,
+        k: *mut RSA,
+        pad: c_int,
+    ) -> c_int;
+    pub fn RSA_private_encrypt(
+        flen: c_int,
+        from: *const u8,
+        to: *mut u8,
+        k: *mut RSA,
+        pad: c_int,
+    ) -> c_int;
+    pub fn RSA_public_decrypt(
+        flen: c_int,
+        from: *const u8,
+        to: *mut u8,
+        k: *mut RSA,
+        pad: c_int,
+    ) -> c_int;
+    pub fn RSA_private_decrypt(
+        flen: c_int,
+        from: *const u8,
+        to: *mut u8,
+        k: *mut RSA,
+        pad: c_int,
+    ) -> c_int;
+    pub fn RSA_check_key(r: *const RSA) -> c_int;
+    pub fn RSA_free(rsa: *mut RSA);
+    pub fn RSA_up_ref(rsa: *mut RSA) -> c_int;
+
+    pub fn i2d_RSAPublicKey(k: *const RSA, buf: *mut *mut u8) -> c_int;
+    pub fn d2i_RSAPublicKey(k: *mut *mut RSA, buf: *mut *const u8, len: c_long) -> *mut RSA;
+    pub fn i2d_RSAPrivateKey(k: *const RSA, buf: *mut *mut u8) -> c_int;
+    pub fn d2i_RSAPrivateKey(k: *mut *mut RSA, buf: *mut *const u8, len: c_long) -> *mut RSA;
+
+    pub fn RSA_sign(
+        t: c_int,
+        m: *const u8,
+        mlen: c_uint,
+        sig: *mut u8,
+        siglen: *mut c_uint,
+        k: *mut RSA,
+    ) -> c_int;
+    pub fn RSA_verify(
+        t: c_int,
+        m: *const u8,
+        mlen: c_uint,
+        sig: *const u8,
+        siglen: c_uint,
+        k: *mut RSA,
+    ) -> c_int;
+
+    pub fn RSA_padding_check_PKCS1_type_2(
+        to: *mut c_uchar,
+        tlen: c_int,
+        f: *const c_uchar,
+        fl: c_int,
+        rsa_len: c_int,
+    ) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/safestack.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/safestack.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/safestack.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/safestack.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+stack!(stack_st_OPENSSL_STRING);
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/sha.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/sha.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/sha.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/sha.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,101 @@
+use super::super::*;
+use libc::*;
+
+cfg_if! {
+    if #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))] {
+        #[repr(C)]
+        #[derive(Clone)]
+        pub struct SHA_CTX {
+            pub h0: SHA_LONG,
+            pub h1: SHA_LONG,
+            pub h2: SHA_LONG,
+            pub h3: SHA_LONG,
+            pub h4: SHA_LONG,
+            pub Nl: SHA_LONG,
+            pub Nh: SHA_LONG,
+            pub data: [SHA_LONG; SHA_LBLOCK as usize],
+            pub num: c_uint,
+        }
+
+        extern "C" {
+            pub fn SHA1_Init(c: *mut SHA_CTX) -> c_int;
+            pub fn SHA1_Update(c: *mut SHA_CTX, data: *const c_void, len: size_t) -> c_int;
+            pub fn SHA1_Final(md: *mut c_uchar, c: *mut SHA_CTX) -> c_int;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(not(ossl300))] {
+        extern "C" {
+            pub fn SHA1(d: *const c_uchar, n: size_t, md: *mut c_uchar) -> *mut c_uchar;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))] {
+        #[repr(C)]
+        #[derive(Clone)]
+        pub struct SHA256_CTX {
+            pub h: [SHA_LONG; 8],
+            pub Nl: SHA_LONG,
+            pub Nh: SHA_LONG,
+            pub data: [SHA_LONG; SHA_LBLOCK as usize],
+            pub num: c_uint,
+            pub md_len: c_uint,
+        }
+
+        extern "C" {
+            pub fn SHA224_Init(c: *mut SHA256_CTX) -> c_int;
+            pub fn SHA224_Update(c: *mut SHA256_CTX, data: *const c_void, len: size_t) -> c_int;
+            pub fn SHA224_Final(md: *mut c_uchar, c: *mut SHA256_CTX) -> c_int;
+            pub fn SHA256_Init(c: *mut SHA256_CTX) -> c_int;
+            pub fn SHA256_Update(c: *mut SHA256_CTX, data: *const c_void, len: size_t) -> c_int;
+            pub fn SHA256_Final(md: *mut c_uchar, c: *mut SHA256_CTX) -> c_int;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(not(ossl300))] {
+        extern "C" {
+            pub fn SHA224(d: *const c_uchar, n: size_t, md: *mut c_uchar) -> *mut c_uchar;
+            pub fn SHA256(d: *const c_uchar, n: size_t, md: *mut c_uchar) -> *mut c_uchar;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))] {
+        #[repr(C)]
+        #[derive(Clone)]
+        pub struct SHA512_CTX {
+            pub h: [SHA_LONG64; 8],
+            pub Nl: SHA_LONG64,
+            pub Nh: SHA_LONG64,
+            // this is a union but we don't want to require 1.19
+            u: [SHA_LONG64; SHA_LBLOCK as usize],
+            pub num: c_uint,
+            pub md_len: c_uint,
+        }
+
+        extern "C" {
+            pub fn SHA384_Init(c: *mut SHA512_CTX) -> c_int;
+            pub fn SHA384_Update(c: *mut SHA512_CTX, data: *const c_void, len: size_t) -> c_int;
+            pub fn SHA384_Final(md: *mut c_uchar, c: *mut SHA512_CTX) -> c_int;
+            pub fn SHA512_Init(c: *mut SHA512_CTX) -> c_int;
+            pub fn SHA512_Update(c: *mut SHA512_CTX, data: *const c_void, len: size_t) -> c_int;
+            pub fn SHA512_Final(md: *mut c_uchar, c: *mut SHA512_CTX) -> c_int;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(not(ossl300))] {
+        extern "C" {
+            pub fn SHA384(d: *const c_uchar, n: size_t, md: *mut c_uchar) -> *mut c_uchar;
+            pub fn SHA512(d: *const c_uchar, n: size_t, md: *mut c_uchar) -> *mut c_uchar;
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/srtp.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/srtp.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/srtp.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/srtp.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,10 @@
+use super::super::*;
+use libc::*;
+
+extern "C" {
+    pub fn SSL_CTX_set_tlsext_use_srtp(ctx: *mut SSL_CTX, profiles: *const c_char) -> c_int;
+    pub fn SSL_set_tlsext_use_srtp(ssl: *mut SSL, profiles: *const c_char) -> c_int;
+
+    pub fn SSL_get_srtp_profiles(ssl: *mut SSL) -> *mut stack_st_SRTP_PROTECTION_PROFILE;
+    pub fn SSL_get_selected_srtp_profile(ssl: *mut SSL) -> *mut SRTP_PROTECTION_PROFILE;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/ssl.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/ssl.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/ssl.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/ssl.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1009 @@
+use super::super::*;
+use libc::*;
+
+pub enum SSL_METHOD {}
+pub enum SSL_CIPHER {}
+cfg_if! {
+    if #[cfg(any(ossl110, libressl280))] {
+        pub enum SSL_SESSION {}
+    } else if #[cfg(libressl251)] {
+        #[repr(C)]
+        pub struct SSL_SESSION {
+            ssl_version: c_int,
+            pub master_key_length: c_int,
+            pub master_key: [c_uchar; 48],
+            session_id_length: c_uint,
+            session_id: [c_uchar; SSL_MAX_SSL_SESSION_ID_LENGTH as usize],
+            sid_ctx_length: c_uint,
+            sid_ctx: [c_uchar; SSL_MAX_SID_CTX_LENGTH as usize],
+            peer: *mut X509,
+            verify_result: c_long,
+            timeout: c_long,
+            time: time_t,
+            pub references: c_int,
+            cipher: *const SSL_CIPHER,
+            cipher_id: c_long,
+            ciphers: *mut stack_st_SSL_CIPHER,
+            tlsext_hostname: *mut c_char,
+            tlsext_tick: *mut c_uchar,
+            tlsext_ticklen: size_t,
+            tlsext_tick_lifetime_int: c_long,
+            internal: *mut c_void,
+        }
+    } else if #[cfg(libressl)] {
+        #[repr(C)]
+        pub struct SSL_SESSION {
+            ssl_version: c_int,
+            pub master_key_length: c_int,
+            pub master_key: [c_uchar; 48],
+            session_id_length: c_uint,
+            session_id: [c_uchar; SSL_MAX_SSL_SESSION_ID_LENGTH as usize],
+            sid_ctx_length: c_uint,
+            sid_ctx: [c_uchar; SSL_MAX_SID_CTX_LENGTH as usize],
+            not_resumable: c_int,
+            sess_cert: *mut c_void,
+            peer: *mut X509,
+            verify_result: c_long,
+            timeout: c_long,
+            time: time_t,
+            pub references: c_int,
+            cipher: *const c_void,
+            cipher_id: c_ulong,
+            ciphers: *mut c_void,
+            ex_data: CRYPTO_EX_DATA,
+            prev: *mut c_void,
+            next: *mut c_void,
+            tlsext_hostname: *mut c_char,
+            tlsext_ecpointformatlist_length: size_t,
+            tlsext_ecpointformatlist: *mut u8,
+            tlsext_ellipticcurvelist_length: size_t,
+            tlsext_ellipticcurvelist: *mut u16,
+            tlsext_tick: *mut c_uchar,
+            tlsext_ticklen: size_t,
+            tlsext_tick_lifetime_hint: c_long,
+        }
+    } else {
+        #[repr(C)]
+        pub struct SSL_SESSION {
+            ssl_version: c_int,
+            key_arg_length: c_uint,
+            key_arg: [c_uchar; SSL_MAX_KEY_ARG_LENGTH as usize],
+            pub master_key_length: c_int,
+            pub master_key: [c_uchar; 48],
+            session_id_length: c_uint,
+            session_id: [c_uchar; SSL_MAX_SSL_SESSION_ID_LENGTH as usize],
+            sid_ctx_length: c_uint,
+            sid_ctx: [c_uchar; SSL_MAX_SID_CTX_LENGTH as usize],
+            #[cfg(not(osslconf = "OPENSSL_NO_KRB5"))]
+            krb5_client_princ_len: c_uint,
+            #[cfg(not(osslconf = "OPENSSL_NO_KRB5"))]
+            krb5_client_princ: [c_uchar; SSL_MAX_KRB5_PRINCIPAL_LENGTH as usize],
+            #[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
+            psk_identity_hint: *mut c_char,
+            #[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
+            psk_identity: *mut c_char,
+            not_resumable: c_int,
+            sess_cert: *mut c_void,
+            peer: *mut X509,
+            verify_result: c_long,
+            pub references: c_int,
+            timeout: c_long,
+            time: c_long,
+            compress_meth: c_uint,
+            cipher: *const c_void,
+            cipher_id: c_ulong,
+            ciphers: *mut c_void,
+            ex_data: CRYPTO_EX_DATA,
+            prev: *mut c_void,
+            next: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_hostname: *mut c_char,
+            #[cfg(all(
+                not(osslconf = "OPENSSL_NO_TLSEXT"),
+                not(osslconf = "OPENSSL_NO_EC")
+            ))]
+            tlsext_ecpointformatlist_length: size_t,
+            #[cfg(all(
+                not(osslconf = "OPENSSL_NO_TLSEXT"),
+                not(osslconf = "OPENSSL_NO_EC")
+            ))]
+            tlsext_ecpointformatlist: *mut c_uchar,
+            #[cfg(all(
+                not(osslconf = "OPENSSL_NO_TLSEXT"),
+                not(osslconf = "OPENSSL_NO_EC")
+            ))]
+            tlsext_ellipticcurvelist_length: size_t,
+            #[cfg(all(
+                not(osslconf = "OPENSSL_NO_TLSEXT"),
+                not(osslconf = "OPENSSL_NO_EC")
+            ))]
+            tlsext_ellipticcurvelist: *mut c_uchar,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_tick: *mut c_uchar,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_ticklen: size_t,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_tick_lifetime_hint: c_long,
+            #[cfg(not(osslconf = "OPENSSL_NO_SRP"))]
+            srp_username: *mut c_char,
+        }
+    }
+}
+
+stack!(stack_st_SSL_CIPHER);
+
+#[repr(C)]
+pub struct SRTP_PROTECTION_PROFILE {
+    pub name: *const c_char,
+    pub id: c_ulong,
+}
+
+stack!(stack_st_SRTP_PROTECTION_PROFILE);
+
+pub type tls_session_ticket_ext_cb_fn =
+    Option<unsafe extern "C" fn(*mut SSL, *const c_uchar, c_int, *mut c_void) -> c_int>;
+pub type tls_session_secret_cb_fn = Option<
+    unsafe extern "C" fn(
+        *mut SSL,
+        *mut c_void,
+        *mut c_int,
+        *mut stack_st_SSL_CIPHER,
+        *mut *mut SSL_CIPHER,
+        *mut c_void,
+    ) -> c_int,
+>;
+
+#[cfg(ossl111)]
+pub type SSL_custom_ext_add_cb_ex = Option<
+    unsafe extern "C" fn(
+        ssl: *mut SSL,
+        ext_type: c_uint,
+        context: c_uint,
+        out: *mut *const c_uchar,
+        outlen: *mut size_t,
+        x: *mut X509,
+        chainidx: size_t,
+        al: *mut c_int,
+        add_arg: *mut c_void,
+    ) -> c_int,
+>;
+
+#[cfg(ossl111)]
+pub type SSL_custom_ext_free_cb_ex = Option<
+    unsafe extern "C" fn(
+        ssl: *mut SSL,
+        ext_type: c_uint,
+        context: c_uint,
+        out: *const c_uchar,
+        add_arg: *mut c_void,
+    ),
+>;
+
+#[cfg(ossl111)]
+pub type SSL_custom_ext_parse_cb_ex = Option<
+    unsafe extern "C" fn(
+        ssl: *mut SSL,
+        ext_type: c_uint,
+        context: c_uint,
+        input: *const c_uchar,
+        inlen: size_t,
+        x: *mut X509,
+        chainidx: size_t,
+        al: *mut c_int,
+        parse_arg: *mut c_void,
+    ) -> c_int,
+>;
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        extern "C" {
+            pub fn SSL_CTX_get_options(ctx: *const SSL_CTX) -> u64;
+            pub fn SSL_CTX_set_options(ctx: *mut SSL_CTX, op: u64) -> u64;
+            pub fn SSL_CTX_clear_options(ctx: *mut SSL_CTX, op: u64) -> u64;
+        }
+    } else if #[cfg(ossl110)] {
+        extern "C" {
+            pub fn SSL_CTX_get_options(ctx: *const SSL_CTX) -> c_ulong;
+            pub fn SSL_CTX_set_options(ctx: *mut SSL_CTX, op: c_ulong) -> c_ulong;
+            pub fn SSL_CTX_clear_options(ctx: *mut SSL_CTX, op: c_ulong) -> c_ulong;
+        }
+    }
+}
+
+pub type GEN_SESSION_CB =
+    Option<unsafe extern "C" fn(*const SSL, *mut c_uchar, *mut c_uint) -> c_int>;
+
+extern "C" {
+    pub fn SSL_CTX_sess_set_new_cb(
+        ctx: *mut SSL_CTX,
+        new_session_cb: Option<unsafe extern "C" fn(*mut SSL, *mut SSL_SESSION) -> c_int>,
+    );
+    pub fn SSL_CTX_sess_set_remove_cb(
+        ctx: *mut SSL_CTX,
+        remove_session_cb: Option<unsafe extern "C" fn(*mut SSL_CTX, *mut SSL_SESSION)>,
+    );
+}
+cfg_if! {
+    // const change in passed function pointer signature
+    if #[cfg(any(ossl110, libressl280))] {
+        extern "C" {
+            pub fn SSL_CTX_sess_set_get_cb(
+                ctx: *mut SSL_CTX,
+                get_session_cb: Option<
+                    unsafe extern "C" fn(*mut SSL, *const c_uchar, c_int, *mut c_int) -> *mut SSL_SESSION,
+                >,
+            );
+        }
+    } else {
+        extern "C" {
+            pub fn SSL_CTX_sess_set_get_cb(
+                ctx: *mut SSL_CTX,
+                get_session_cb: Option<
+                    unsafe extern "C" fn(*mut SSL, *mut c_uchar, c_int, *mut c_int) -> *mut SSL_SESSION,
+                >,
+            );
+        }
+    }
+}
+extern "C" {
+    // FIXME change to unsafe extern "C" fn
+    pub fn SSL_CTX_set_cookie_generate_cb(
+        s: *mut SSL_CTX,
+        cb: Option<
+            extern "C" fn(ssl: *mut SSL, cookie: *mut c_uchar, cookie_len: *mut c_uint) -> c_int,
+        >,
+    );
+}
+
+cfg_if! {
+    // const change in passed function pointer signature
+    if #[cfg(any(ossl110, libressl280))] {
+        extern "C" {
+            pub fn SSL_CTX_set_cookie_verify_cb(
+                s: *mut SSL_CTX,
+                cb: Option<
+                    extern "C" fn(ssl: *mut SSL, cookie: *const c_uchar, cookie_len: c_uint) -> c_int,
+                >,
+            );
+        }
+    } else {
+        extern "C" {
+            pub fn SSL_CTX_set_cookie_verify_cb(
+                s: *mut SSL_CTX,
+                cb: Option<extern "C" fn(ssl: *mut SSL, cookie: *mut c_uchar, cookie_len: c_uint) -> c_int>,
+            );
+        }
+    }
+}
+
+extern "C" {
+    #[cfg(ossl111)]
+    pub fn SSL_CTX_set_stateless_cookie_generate_cb(
+        s: *mut SSL_CTX,
+        cb: Option<
+            unsafe extern "C" fn(
+                ssl: *mut SSL,
+                cookie: *mut c_uchar,
+                cookie_len: *mut size_t,
+            ) -> c_int,
+        >,
+    );
+    #[cfg(ossl111)]
+    pub fn SSL_CTX_set_stateless_cookie_verify_cb(
+        s: *mut SSL_CTX,
+        cb: Option<
+            unsafe extern "C" fn(
+                ssl: *mut SSL,
+                cookie: *const c_uchar,
+                cookie_len: size_t,
+            ) -> c_int,
+        >,
+    );
+
+    pub fn SSL_CTX_set_next_protos_advertised_cb(
+        ssl: *mut SSL_CTX,
+        cb: extern "C" fn(
+            ssl: *mut SSL,
+            out: *mut *const c_uchar,
+            outlen: *mut c_uint,
+            arg: *mut c_void,
+        ) -> c_int,
+        arg: *mut c_void,
+    );
+    pub fn SSL_CTX_set_next_proto_select_cb(
+        ssl: *mut SSL_CTX,
+        cb: extern "C" fn(
+            ssl: *mut SSL,
+            out: *mut *mut c_uchar,
+            outlen: *mut c_uchar,
+            inbuf: *const c_uchar,
+            inlen: c_uint,
+            arg: *mut c_void,
+        ) -> c_int,
+        arg: *mut c_void,
+    );
+    pub fn SSL_get0_next_proto_negotiated(
+        s: *const SSL,
+        data: *mut *const c_uchar,
+        len: *mut c_uint,
+    );
+
+    pub fn SSL_select_next_proto(
+        out: *mut *mut c_uchar,
+        outlen: *mut c_uchar,
+        inbuf: *const c_uchar,
+        inlen: c_uint,
+        client: *const c_uchar,
+        client_len: c_uint,
+    ) -> c_int;
+}
+
+extern "C" {
+    #[cfg(any(ossl102, libressl261))]
+    pub fn SSL_CTX_set_alpn_protos(s: *mut SSL_CTX, data: *const c_uchar, len: c_uint) -> c_int;
+    #[cfg(any(ossl102, libressl261))]
+    pub fn SSL_set_alpn_protos(s: *mut SSL, data: *const c_uchar, len: c_uint) -> c_int;
+    #[cfg(any(ossl102, libressl261))]
+    #[link_name = "SSL_CTX_set_alpn_select_cb"]
+    pub fn SSL_CTX_set_alpn_select_cb__fixed_rust(
+        ssl: *mut SSL_CTX,
+        cb: Option<
+            unsafe extern "C" fn(
+                ssl: *mut SSL,
+                out: *mut *const c_uchar,
+                outlen: *mut c_uchar,
+                inbuf: *const c_uchar,
+                inlen: c_uint,
+                arg: *mut c_void,
+            ) -> c_int,
+        >,
+        arg: *mut c_void,
+    );
+    #[cfg(any(ossl102, libressl261))]
+    pub fn SSL_get0_alpn_selected(s: *const SSL, data: *mut *const c_uchar, len: *mut c_uint);
+}
+
+#[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
+extern "C" {
+    pub fn SSL_CTX_set_psk_client_callback(
+        ssl: *mut SSL_CTX,
+        psk_client_cb: Option<
+            extern "C" fn(
+                *mut SSL,
+                *const c_char,
+                *mut c_char,
+                c_uint,
+                *mut c_uchar,
+                c_uint,
+            ) -> c_uint,
+        >,
+    );
+    pub fn SSL_CTX_set_psk_server_callback(
+        ssl: *mut SSL_CTX,
+        psk_server_cb: Option<
+            extern "C" fn(*mut SSL, *const c_char, *mut c_uchar, c_uint) -> c_uint,
+        >,
+    );
+    pub fn SSL_get_psk_identity_hint(ssl: *const SSL) -> *const c_char;
+    pub fn SSL_get_psk_identity(ssl: *const SSL) -> *const c_char;
+}
+
+extern "C" {
+    #[cfg(ossl111)]
+    pub fn SSL_CTX_add_custom_ext(
+        ctx: *mut SSL_CTX,
+        ext_type: c_uint,
+        context: c_uint,
+        add_cb: SSL_custom_ext_add_cb_ex,
+        free_cb: SSL_custom_ext_free_cb_ex,
+        add_arg: *mut c_void,
+        parse_cb: SSL_custom_ext_parse_cb_ex,
+        parse_arg: *mut c_void,
+    ) -> c_int;
+
+    #[cfg(ossl102)]
+    pub fn SSL_extension_supported(ext_type: c_uint) -> c_int;
+}
+
+#[cfg(ossl111)]
+pub type SSL_CTX_keylog_cb_func =
+    Option<unsafe extern "C" fn(ssl: *const SSL, line: *const c_char)>;
+
+extern "C" {
+    #[cfg(ossl111)]
+    pub fn SSL_CTX_set_keylog_callback(ctx: *mut SSL_CTX, cb: SSL_CTX_keylog_cb_func);
+
+    #[cfg(any(ossl111, libressl340))]
+    pub fn SSL_CTX_set_max_early_data(ctx: *mut SSL_CTX, max_early_data: u32) -> c_int;
+    #[cfg(any(ossl111, libressl340))]
+    pub fn SSL_CTX_get_max_early_data(ctx: *const SSL_CTX) -> u32;
+    #[cfg(any(ossl111, libressl340))]
+    pub fn SSL_set_max_early_data(ctx: *mut SSL, max_early_data: u32) -> c_int;
+    #[cfg(any(ossl111, libressl340))]
+    pub fn SSL_get_max_early_data(ctx: *const SSL) -> u32;
+
+    pub fn SSL_get_finished(s: *const SSL, buf: *mut c_void, count: size_t) -> size_t;
+    pub fn SSL_get_peer_finished(s: *const SSL, buf: *mut c_void, count: size_t) -> size_t;
+
+    pub fn SSL_CTX_get_verify_mode(ctx: *const SSL_CTX) -> c_int;
+    pub fn SSL_get_verify_mode(s: *const SSL) -> c_int;
+}
+
+const_ptr_api! {
+    extern "C" {
+        #[cfg(ossl110)]
+        pub fn SSL_is_init_finished(s: #[const_ptr_if(ossl111)] SSL) -> c_int;
+    }
+}
+
+cfg_if! {
+    if #[cfg(libressl261)] {
+        extern "C" {
+            pub fn SSL_CTX_set_min_proto_version(ctx: *mut SSL_CTX, version: u16) -> c_int;
+            pub fn SSL_CTX_set_max_proto_version(ctx: *mut SSL_CTX, version: u16) -> c_int;
+            pub fn SSL_set_min_proto_version(s: *mut SSL, version: u16) -> c_int;
+            pub fn SSL_set_max_proto_version(s: *mut SSL, version: u16) -> c_int;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(libressl270)] {
+        extern "C" {
+            pub fn SSL_CTX_get_min_proto_version(ctx: *mut SSL_CTX) -> c_int;
+            pub fn SSL_CTX_get_max_proto_version(ctx: *mut SSL_CTX) -> c_int;
+            pub fn SSL_get_min_proto_version(s: *mut SSL) -> c_int;
+            pub fn SSL_get_max_proto_version(s: *mut SSL) -> c_int;
+        }
+    }
+}
+
+extern "C" {
+    pub fn SSL_CTX_set_cipher_list(ssl: *mut SSL_CTX, s: *const c_char) -> c_int;
+    pub fn SSL_CTX_new(method: *const SSL_METHOD) -> *mut SSL_CTX;
+    pub fn SSL_CTX_free(ctx: *mut SSL_CTX);
+    #[cfg(any(ossl110, libressl273))]
+    pub fn SSL_CTX_up_ref(x: *mut SSL_CTX) -> c_int;
+    pub fn SSL_CTX_get_cert_store(ctx: *const SSL_CTX) -> *mut X509_STORE;
+    pub fn SSL_CTX_set_cert_store(ctx: *mut SSL_CTX, store: *mut X509_STORE);
+
+    pub fn SSL_get_current_cipher(ssl: *const SSL) -> *const SSL_CIPHER;
+    pub fn SSL_CIPHER_get_bits(cipher: *const SSL_CIPHER, alg_bits: *mut c_int) -> c_int;
+}
+const_ptr_api! {
+    extern "C" {
+        pub fn SSL_CIPHER_get_version(cipher: *const SSL_CIPHER) -> #[const_ptr_if(any(ossl110, libressl280))] c_char;
+    }
+}
+extern "C" {
+    #[cfg(ossl111)]
+    pub fn SSL_CIPHER_get_handshake_digest(cipher: *const SSL_CIPHER) -> *const EVP_MD;
+    pub fn SSL_CIPHER_get_name(cipher: *const SSL_CIPHER) -> *const c_char;
+    #[cfg(ossl111)]
+    pub fn SSL_CIPHER_standard_name(cipher: *const SSL_CIPHER) -> *const c_char;
+    #[cfg(ossl111)]
+    pub fn OPENSSL_cipher_name(rfc_name: *const c_char) -> *const c_char;
+
+    pub fn SSL_pending(ssl: *const SSL) -> c_int;
+    pub fn SSL_set_bio(ssl: *mut SSL, rbio: *mut BIO, wbio: *mut BIO);
+    pub fn SSL_get_rbio(ssl: *const SSL) -> *mut BIO;
+    pub fn SSL_get_wbio(ssl: *const SSL) -> *mut BIO;
+    #[cfg(any(ossl111, libressl340))]
+    pub fn SSL_CTX_set_ciphersuites(ctx: *mut SSL_CTX, str: *const c_char) -> c_int;
+    #[cfg(any(ossl111, libressl340))]
+    pub fn SSL_set_ciphersuites(ssl: *mut SSL, str: *const c_char) -> c_int;
+    pub fn SSL_set_cipher_list(ssl: *mut SSL, s: *const c_char) -> c_int;
+    pub fn SSL_set_ssl_method(s: *mut SSL, method: *const SSL_METHOD) -> c_int;
+    pub fn SSL_set_verify(
+        ssl: *mut SSL,
+        mode: c_int,
+        // FIXME should be unsafe
+        verify_callback: Option<extern "C" fn(c_int, *mut X509_STORE_CTX) -> c_int>,
+    );
+    pub fn SSL_CTX_use_PrivateKey(ctx: *mut SSL_CTX, key: *mut EVP_PKEY) -> c_int;
+    pub fn SSL_CTX_use_certificate(ctx: *mut SSL_CTX, cert: *mut X509) -> c_int;
+
+    pub fn SSL_CTX_use_PrivateKey_file(
+        ctx: *mut SSL_CTX,
+        key_file: *const c_char,
+        file_type: c_int,
+    ) -> c_int;
+    pub fn SSL_CTX_use_certificate_file(
+        ctx: *mut SSL_CTX,
+        cert_file: *const c_char,
+        file_type: c_int,
+    ) -> c_int;
+    pub fn SSL_CTX_use_certificate_chain_file(
+        ctx: *mut SSL_CTX,
+        cert_chain_file: *const c_char,
+    ) -> c_int;
+    pub fn SSL_use_PrivateKey_file(ssl: *mut SSL, file: *const c_char, type_: c_int) -> c_int;
+    pub fn SSL_use_PrivateKey(ssl: *mut SSL, pkey: *mut EVP_PKEY) -> c_int;
+    pub fn SSL_use_certificate(ssl: *mut SSL, x: *mut X509) -> c_int;
+    #[cfg(any(ossl110, libressl332))]
+    pub fn SSL_use_certificate_chain_file(ssl: *mut SSL, file: *const c_char) -> c_int;
+    pub fn SSL_set_client_CA_list(s: *mut SSL, name_list: *mut stack_st_X509_NAME);
+    pub fn SSL_add_client_CA(ssl: *mut SSL, x: *mut X509) -> c_int;
+    pub fn SSL_load_client_CA_file(file: *const c_char) -> *mut stack_st_X509_NAME;
+
+    #[cfg(not(ossl110))]
+    pub fn SSL_load_error_strings();
+    pub fn SSL_state_string(ssl: *const SSL) -> *const c_char;
+    pub fn SSL_state_string_long(ssl: *const SSL) -> *const c_char;
+
+    pub fn SSL_SESSION_get_time(s: *const SSL_SESSION) -> c_long;
+    pub fn SSL_SESSION_get_timeout(s: *const SSL_SESSION) -> c_long;
+    #[cfg(any(ossl110, libressl270))]
+    pub fn SSL_SESSION_get_protocol_version(s: *const SSL_SESSION) -> c_int;
+
+    #[cfg(any(ossl111, libressl340))]
+    pub fn SSL_SESSION_set_max_early_data(ctx: *mut SSL_SESSION, max_early_data: u32) -> c_int;
+    #[cfg(any(ossl111, libressl340))]
+    pub fn SSL_SESSION_get_max_early_data(ctx: *const SSL_SESSION) -> u32;
+
+    pub fn SSL_SESSION_get_id(s: *const SSL_SESSION, len: *mut c_uint) -> *const c_uchar;
+    #[cfg(any(ossl110, libressl273))]
+    pub fn SSL_SESSION_up_ref(ses: *mut SSL_SESSION) -> c_int;
+    pub fn SSL_SESSION_free(s: *mut SSL_SESSION);
+}
+const_ptr_api! {
+    extern "C" {
+        pub fn i2d_SSL_SESSION(s: #[const_ptr_if(ossl300)] SSL_SESSION, pp: *mut *mut c_uchar) -> c_int;
+    }
+}
+extern "C" {
+    pub fn SSL_set_session(ssl: *mut SSL, session: *mut SSL_SESSION) -> c_int;
+    pub fn SSL_CTX_add_session(ctx: *mut SSL_CTX, session: *mut SSL_SESSION) -> c_int;
+    pub fn SSL_CTX_remove_session(ctx: *mut SSL_CTX, session: *mut SSL_SESSION) -> c_int;
+    pub fn d2i_SSL_SESSION(
+        a: *mut *mut SSL_SESSION,
+        pp: *mut *const c_uchar,
+        len: c_long,
+    ) -> *mut SSL_SESSION;
+
+    #[cfg(not(ossl300))]
+    pub fn SSL_get_peer_certificate(ssl: *const SSL) -> *mut X509;
+    #[cfg(ossl300)]
+    pub fn SSL_get1_peer_certificate(ssl: *const SSL) -> *mut X509;
+
+    pub fn SSL_get_peer_cert_chain(ssl: *const SSL) -> *mut stack_st_X509;
+
+    pub fn SSL_CTX_set_verify(
+        ctx: *mut SSL_CTX,
+        mode: c_int,
+        verify_callback: Option<extern "C" fn(c_int, *mut X509_STORE_CTX) -> c_int>,
+    );
+    pub fn SSL_CTX_set_verify_depth(ctx: *mut SSL_CTX, depth: c_int);
+
+    #[cfg(any(ossl111, libressl340))]
+    pub fn SSL_CTX_set_post_handshake_auth(ctx: *mut SSL_CTX, val: c_int);
+
+    pub fn SSL_CTX_check_private_key(ctx: *const SSL_CTX) -> c_int;
+
+    pub fn SSL_CTX_set_session_id_context(
+        ssl: *mut SSL_CTX,
+        sid_ctx: *const c_uchar,
+        sid_ctx_len: c_uint,
+    ) -> c_int;
+
+    pub fn SSL_new(ctx: *mut SSL_CTX) -> *mut SSL;
+
+    #[cfg(any(ossl102, libressl261))]
+    pub fn SSL_CTX_get0_param(ctx: *mut SSL_CTX) -> *mut X509_VERIFY_PARAM;
+
+    #[cfg(any(ossl102, libressl261))]
+    pub fn SSL_get0_param(ssl: *mut SSL) -> *mut X509_VERIFY_PARAM;
+}
+
+#[cfg(ossl111)]
+pub type SSL_client_hello_cb_fn =
+    Option<unsafe extern "C" fn(s: *mut SSL, al: *mut c_int, arg: *mut c_void) -> c_int>;
+extern "C" {
+    #[cfg(ossl111)]
+    pub fn SSL_CTX_set_client_hello_cb(
+        c: *mut SSL_CTX,
+        cb: SSL_client_hello_cb_fn,
+        arg: *mut c_void,
+    );
+    #[cfg(ossl111)]
+    pub fn SSL_client_hello_isv2(s: *mut SSL) -> c_int;
+    #[cfg(ossl111)]
+    pub fn SSL_client_hello_get0_legacy_version(s: *mut SSL) -> c_uint;
+    #[cfg(ossl111)]
+    pub fn SSL_client_hello_get0_random(s: *mut SSL, out: *mut *const c_uchar) -> size_t;
+    #[cfg(ossl111)]
+    pub fn SSL_client_hello_get0_session_id(s: *mut SSL, out: *mut *const c_uchar) -> size_t;
+    #[cfg(ossl111)]
+    pub fn SSL_client_hello_get0_ciphers(s: *mut SSL, out: *mut *const c_uchar) -> size_t;
+    #[cfg(ossl111)]
+    pub fn SSL_client_hello_get0_compression_methods(
+        s: *mut SSL,
+        out: *mut *const c_uchar,
+    ) -> size_t;
+    #[cfg(ossl111)]
+    pub fn SSL_client_hello_get1_extensions_present(
+        s: *mut SSL,
+        out: *mut *mut c_int,
+        outlen: *mut size_t,
+    ) -> c_int;
+    #[cfg(ossl111)]
+    pub fn SSL_client_hello_get0_ext(
+        s: *mut SSL,
+        type_: c_uint,
+        out: *mut *const c_uchar,
+        outlen: *mut size_t,
+    ) -> c_int;
+
+    pub fn SSL_free(ssl: *mut SSL);
+    pub fn SSL_accept(ssl: *mut SSL) -> c_int;
+    #[cfg(ossl111)]
+    pub fn SSL_stateless(s: *mut SSL) -> c_int;
+    pub fn SSL_connect(ssl: *mut SSL) -> c_int;
+    pub fn SSL_read(ssl: *mut SSL, buf: *mut c_void, num: c_int) -> c_int;
+    #[cfg(any(ossl111, libressl350))]
+    pub fn SSL_read_ex(ssl: *mut SSL, buf: *mut c_void, num: usize, readbytes: *mut usize)
+        -> c_int;
+    pub fn SSL_peek(ssl: *mut SSL, buf: *mut c_void, num: c_int) -> c_int;
+    #[cfg(any(ossl111, libressl350))]
+    pub fn SSL_peek_ex(ssl: *mut SSL, buf: *mut c_void, num: usize, readbytes: *mut usize)
+        -> c_int;
+    #[cfg(any(ossl111, libressl340))]
+    pub fn SSL_read_early_data(
+        s: *mut SSL,
+        buf: *mut c_void,
+        num: size_t,
+        readbytes: *mut size_t,
+    ) -> c_int;
+    #[cfg(ossl111)]
+    pub fn SSL_bytes_to_cipher_list(
+        s: *mut SSL,
+        bytes: *const c_uchar,
+        len: size_t,
+        isv2format: c_int,
+        sk: *mut *mut stack_st_SSL_CIPHER,
+        scsvs: *mut *mut stack_st_SSL_CIPHER,
+    ) -> c_int;
+}
+
+extern "C" {
+    pub fn SSL_write(ssl: *mut SSL, buf: *const c_void, num: c_int) -> c_int;
+    #[cfg(any(ossl111, libressl350))]
+    pub fn SSL_write_ex(
+        ssl: *mut SSL,
+        buf: *const c_void,
+        num: size_t,
+        written: *mut size_t,
+    ) -> c_int;
+    #[cfg(any(ossl111, libressl340))]
+    pub fn SSL_write_early_data(
+        s: *mut SSL,
+        buf: *const c_void,
+        num: size_t,
+        written: *mut size_t,
+    ) -> c_int;
+    pub fn SSL_ctrl(ssl: *mut SSL, cmd: c_int, larg: c_long, parg: *mut c_void) -> c_long;
+    pub fn SSL_CTX_ctrl(ctx: *mut SSL_CTX, cmd: c_int, larg: c_long, parg: *mut c_void) -> c_long;
+    #[link_name = "SSL_CTX_callback_ctrl"]
+    pub fn SSL_CTX_callback_ctrl__fixed_rust(
+        ctx: *mut SSL_CTX,
+        cmd: c_int,
+        fp: Option<unsafe extern "C" fn()>,
+    ) -> c_long;
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl291))] {
+        extern "C" {
+            pub fn TLS_method() -> *const SSL_METHOD;
+
+            pub fn DTLS_method() -> *const SSL_METHOD;
+
+            pub fn TLS_server_method() -> *const SSL_METHOD;
+
+            pub fn TLS_client_method() -> *const SSL_METHOD;
+        }
+    } else {
+        extern "C" {
+            #[cfg(not(osslconf = "OPENSSL_NO_SSL3_METHOD"))]
+            pub fn SSLv3_method() -> *const SSL_METHOD;
+
+            pub fn SSLv23_method() -> *const SSL_METHOD;
+
+            pub fn SSLv23_client_method() -> *const SSL_METHOD;
+
+            pub fn SSLv23_server_method() -> *const SSL_METHOD;
+
+            pub fn TLSv1_method() -> *const SSL_METHOD;
+
+            pub fn TLSv1_1_method() -> *const SSL_METHOD;
+
+            pub fn TLSv1_2_method() -> *const SSL_METHOD;
+
+            pub fn DTLSv1_method() -> *const SSL_METHOD;
+
+            #[cfg(ossl102)]
+            pub fn DTLSv1_2_method() -> *const SSL_METHOD;
+        }
+    }
+}
+
+extern "C" {
+    pub fn SSL_get_error(ssl: *const SSL, ret: c_int) -> c_int;
+    pub fn SSL_get_version(ssl: *const SSL) -> *const c_char;
+
+    pub fn SSL_do_handshake(ssl: *mut SSL) -> c_int;
+    pub fn SSL_shutdown(ssl: *mut SSL) -> c_int;
+
+    pub fn SSL_CTX_set_client_CA_list(ctx: *mut SSL_CTX, list: *mut stack_st_X509_NAME);
+
+    pub fn SSL_CTX_add_client_CA(ctx: *mut SSL_CTX, cacert: *mut X509) -> c_int;
+
+    pub fn SSL_CTX_set_default_verify_paths(ctx: *mut SSL_CTX) -> c_int;
+    pub fn SSL_CTX_load_verify_locations(
+        ctx: *mut SSL_CTX,
+        CAfile: *const c_char,
+        CApath: *const c_char,
+    ) -> c_int;
+}
+
+const_ptr_api! {
+    extern "C" {
+        pub fn SSL_get_ssl_method(ssl: #[const_ptr_if(ossl111b)] SSL) -> *const SSL_METHOD;
+    }
+}
+
+extern "C" {
+    pub fn SSL_set_connect_state(s: *mut SSL);
+    pub fn SSL_set_accept_state(s: *mut SSL);
+
+    #[cfg(not(ossl110))]
+    pub fn SSL_library_init() -> c_int;
+
+    pub fn SSL_CIPHER_description(
+        cipher: *const SSL_CIPHER,
+        buf: *mut c_char,
+        size: c_int,
+    ) -> *mut c_char;
+
+    pub fn SSL_get_certificate(ssl: *const SSL) -> *mut X509;
+}
+const_ptr_api! {
+    extern "C" {
+        pub fn SSL_get_privatekey(ssl: #[const_ptr_if(any(ossl102, libressl280))] SSL) -> *mut EVP_PKEY;
+    }
+}
+
+extern "C" {
+    #[cfg(any(ossl102, libressl270))]
+    pub fn SSL_CTX_get0_certificate(ctx: *const SSL_CTX) -> *mut X509;
+    #[cfg(any(ossl102, libressl340))]
+    pub fn SSL_CTX_get0_privatekey(ctx: *const SSL_CTX) -> *mut EVP_PKEY;
+
+    pub fn SSL_set_shutdown(ss: *mut SSL, mode: c_int);
+    pub fn SSL_get_shutdown(ssl: *const SSL) -> c_int;
+    pub fn SSL_version(ssl: *const SSL) -> c_int;
+    pub fn SSL_get_session(s: *const SSL) -> *mut SSL_SESSION;
+    pub fn SSL_get_SSL_CTX(ssl: *const SSL) -> *mut SSL_CTX;
+    pub fn SSL_set_SSL_CTX(ssl: *mut SSL, ctx: *mut SSL_CTX) -> *mut SSL_CTX;
+
+    pub fn SSL_get_verify_result(ssl: *const SSL) -> c_long;
+    #[cfg(ossl110)]
+    pub fn SSL_get0_verified_chain(ssl: *const SSL) -> *mut stack_st_X509;
+
+    #[cfg(any(ossl110, libressl270))]
+    pub fn SSL_get_client_random(ssl: *const SSL, out: *mut c_uchar, len: size_t) -> size_t;
+    #[cfg(any(ossl110, libressl270))]
+    pub fn SSL_get_server_random(ssl: *const SSL, out: *mut c_uchar, len: size_t) -> size_t;
+    #[cfg(any(ossl110, libressl273))]
+    pub fn SSL_SESSION_get_master_key(
+        session: *const SSL_SESSION,
+        out: *mut c_uchar,
+        outlen: size_t,
+    ) -> size_t;
+}
+
+extern "C" {
+    #[cfg(not(ossl110))]
+    pub fn SSL_get_ex_new_index(
+        argl: c_long,
+        argp: *mut c_void,
+        new_func: Option<CRYPTO_EX_new>,
+        dup_func: Option<CRYPTO_EX_dup>,
+        free_func: Option<CRYPTO_EX_free>,
+    ) -> c_int;
+
+    pub fn SSL_set_ex_data(ssl: *mut SSL, idx: c_int, data: *mut c_void) -> c_int;
+    pub fn SSL_get_ex_data(ssl: *const SSL, idx: c_int) -> *mut c_void;
+
+    #[cfg(not(ossl110))]
+    pub fn SSL_CTX_get_ex_new_index(
+        argl: c_long,
+        argp: *mut c_void,
+        new_func: Option<CRYPTO_EX_new>,
+        dup_func: Option<CRYPTO_EX_dup>,
+        free_func: Option<CRYPTO_EX_free>,
+    ) -> c_int;
+
+    pub fn SSL_CTX_set_ex_data(ctx: *mut SSL_CTX, idx: c_int, data: *mut c_void) -> c_int;
+    pub fn SSL_CTX_get_ex_data(ctx: *const SSL_CTX, idx: c_int) -> *mut c_void;
+
+    pub fn SSL_get_ex_data_X509_STORE_CTX_idx() -> c_int;
+}
+
+extern "C" {
+    #[link_name = "SSL_CTX_set_tmp_dh_callback"]
+    pub fn SSL_CTX_set_tmp_dh_callback__fixed_rust(
+        ctx: *mut SSL_CTX,
+        dh: Option<
+            unsafe extern "C" fn(ssl: *mut SSL, is_export: c_int, keylength: c_int) -> *mut DH,
+        >,
+    );
+    #[link_name = "SSL_set_tmp_dh_callback"]
+    pub fn SSL_set_tmp_dh_callback__fixed_rust(
+        ctx: *mut SSL,
+        dh: Option<
+            unsafe extern "C" fn(ssl: *mut SSL, is_export: c_int, keylength: c_int) -> *mut DH,
+        >,
+    );
+    #[cfg(not(ossl110))]
+    #[link_name = "SSL_CTX_set_tmp_ecdh_callback"]
+    pub fn SSL_CTX_set_tmp_ecdh_callback__fixed_rust(
+        ctx: *mut SSL_CTX,
+        ecdh: Option<
+            unsafe extern "C" fn(ssl: *mut SSL, is_export: c_int, keylength: c_int) -> *mut EC_KEY,
+        >,
+    );
+    #[cfg(not(ossl110))]
+    #[link_name = "SSL_set_tmp_ecdh_callback"]
+    pub fn SSL_set_tmp_ecdh_callback__fixed_rust(
+        ssl: *mut SSL,
+        ecdh: Option<
+            unsafe extern "C" fn(ssl: *mut SSL, is_export: c_int, keylength: c_int) -> *mut EC_KEY,
+        >,
+    );
+}
+
+cfg_if! {
+    if #[cfg(libressl)] {
+        extern "C" {
+            pub fn SSL_get_current_compression(ssl: *mut SSL) -> *const libc::c_void;
+        }
+    } else if #[cfg(not(osslconf = "OPENSSL_NO_COMP"))] {
+        const_ptr_api! {
+            extern "C" {
+                pub fn SSL_get_current_compression(ssl: #[const_ptr_if(ossl111b)] SSL) -> *const COMP_METHOD;
+            }
+        }
+    }
+}
+cfg_if! {
+    if #[cfg(libressl)] {
+        extern "C" {
+            pub fn SSL_COMP_get_name(comp: *const libc::c_void) -> *const c_char;
+        }
+    } else if #[cfg(not(osslconf = "OPENSSL_NO_COMP"))] {
+        extern "C" {
+            pub fn SSL_COMP_get_name(comp: *const COMP_METHOD) -> *const c_char;
+        }
+    }
+}
+
+#[cfg(not(osslconf = "OPENSSL_NO_COMP"))]
+extern "C" {
+    #[cfg(ossl110)]
+    pub fn COMP_get_type(meth: *const COMP_METHOD) -> i32;
+}
+
+extern "C" {
+    #[cfg(any(ossl110, libressl270))]
+    pub fn SSL_CIPHER_get_cipher_nid(c: *const SSL_CIPHER) -> c_int;
+    #[cfg(any(ossl110, libressl270))]
+    pub fn SSL_CIPHER_get_digest_nid(c: *const SSL_CIPHER) -> c_int;
+}
+
+const_ptr_api! {
+    extern "C" {
+        #[cfg(ossl110)]
+        pub fn SSL_session_reused(ssl: #[const_ptr_if(ossl111c)] SSL) -> c_int;
+    }
+}
+
+const_ptr_api! {
+    extern "C" {
+        #[cfg(any(ossl102, libressl273))]
+        pub fn SSL_is_server(s: #[const_ptr_if(any(ossl110f, libressl273))] SSL) -> c_int;
+    }
+}
+
+extern "C" {
+    #[cfg(ossl110)]
+    pub fn OPENSSL_init_ssl(opts: u64, settings: *const OPENSSL_INIT_SETTINGS) -> c_int;
+}
+
+extern "C" {
+    #[cfg(ossl111)]
+    pub fn SSL_CTX_set_num_tickets(ctx: *mut SSL_CTX, num_tickets: size_t) -> c_int;
+
+    #[cfg(ossl111)]
+    pub fn SSL_set_num_tickets(s: *mut SSL, num_tickets: size_t) -> c_int;
+
+    #[cfg(ossl111b)]
+    pub fn SSL_CTX_get_num_tickets(ctx: *const SSL_CTX) -> size_t;
+    #[cfg(all(ossl111, not(ossl111b)))]
+    pub fn SSL_CTX_get_num_tickets(ctx: *mut SSL_CTX) -> size_t;
+
+    #[cfg(ossl111b)]
+    pub fn SSL_get_num_tickets(s: *const SSL) -> size_t;
+    #[cfg(all(ossl111, not(ossl111b)))]
+    pub fn SSL_get_num_tickets(s: *mut SSL) -> size_t;
+}
+
+extern "C" {
+    #[cfg(any(ossl110, libressl360))]
+    pub fn SSL_CTX_set_security_level(ctx: *mut SSL_CTX, level: c_int);
+
+    #[cfg(any(ossl110, libressl360))]
+    pub fn SSL_set_security_level(s: *mut SSL, level: c_int);
+
+    #[cfg(any(ossl110, libressl360))]
+    pub fn SSL_CTX_get_security_level(ctx: *const SSL_CTX) -> c_int;
+
+    #[cfg(any(ossl110, libressl360))]
+    pub fn SSL_get_security_level(s: *const SSL) -> c_int;
+}
+
+#[cfg(ossl320)]
+extern "C" {
+    pub fn OSSL_QUIC_client_method() -> *const SSL_METHOD;
+    pub fn OSSL_QUIC_client_thread_method() -> *const SSL_METHOD;
+    pub fn SSL_get_event_timeout(s: *mut SSL, tv: *mut timeval, is_infinite: *mut c_int) -> c_int;
+    pub fn SSL_handle_events(s: *mut SSL) -> c_int;
+    pub fn SSL_get_blocking_mode(s: *mut SSL) -> c_int;
+    pub fn SSL_set_blocking_mode(s: *mut SSL, blocking: c_int) -> c_int;
+    pub fn SSL_get_rpoll_descriptor(s: *mut SSL, desc: *mut BIO_POLL_DESCRIPTOR) -> c_int;
+    pub fn SSL_get_wpoll_descriptor(s: *mut SSL, desc: *mut BIO_POLL_DESCRIPTOR) -> c_int;
+    pub fn SSL_net_read_desired(s: *mut SSL) -> c_int;
+    pub fn SSL_net_write_desired(s: *mut SSL) -> c_int;
+    pub fn SSL_set1_initial_peer_addr(s: *mut SSL, peer_addr: *const BIO_ADDR) -> c_int;
+    pub fn SSL_shutdown_ex(
+        ssl: *mut SSL,
+        flags: u64,
+        args: *const SSL_SHUTDOWN_EX_ARGS,
+        args_len: usize,
+    ) -> c_int;
+    pub fn SSL_stream_conclude(ssl: *mut SSL, flags: u64) -> c_int;
+    pub fn SSL_stream_reset(
+        ssl: *mut SSL,
+        args: *const SSL_STREAM_RESET_ARGS,
+        args_len: usize,
+    ) -> c_int;
+    pub fn SSL_get_stream_read_state(ssl: *mut SSL) -> c_int;
+    pub fn SSL_get_stream_write_state(ssl: *mut SSL) -> c_int;
+    pub fn SSL_get_conn_close_info(
+        ssl: *mut SSL,
+        info: *mut SSL_CONN_CLOSE_INFO,
+        info_len: usize,
+    ) -> c_int;
+    pub fn SSL_get0_connection(s: *mut SSL) -> *mut SSL;
+    pub fn SSL_is_connection(s: *mut SSL) -> c_int;
+    pub fn SSL_get_stream_type(s: *mut SSL) -> c_int;
+    pub fn SSL_get_stream_id(s: *mut SSL) -> u64;
+    pub fn SSL_new_stream(s: *mut SSL, flags: u64) -> *mut SSL;
+    pub fn SSL_accept_stream(s: *mut SSL, flags: u64) -> *mut SSL;
+    pub fn SSL_set_incoming_stream_policy(s: *mut SSL, policy: c_int, aec: u64) -> c_int;
+    pub fn SSL_get_accept_stream_queue_len(s: *mut SSL) -> usize;
+    pub fn SSL_set_default_stream_mode(s: *mut SSL, mode: u32) -> c_int;
+}
+
+#[cfg(ossl330)]
+extern "C" {
+    pub fn SSL_write_ex2(
+        s: *mut SSL,
+        buf: *const c_void,
+        num: usize,
+        flags: u64,
+        written: *mut usize,
+    ) -> c_int;
+    pub fn SSL_get_value_uint(s: *mut SSL, class_: u32, id: u32, v: *mut u64) -> c_int;
+    pub fn SSL_set_value_uint(s: *mut SSL, class_: u32, id: u32, v: u64) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/stack.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/stack.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/stack.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/stack.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,47 @@
+use libc::*;
+
+cfg_if! {
+    if #[cfg(ossl110)] {
+        pub enum OPENSSL_STACK {}
+    } else if #[cfg(libressl390)] {
+        pub enum _STACK {}
+    } else {
+        #[repr(C)]
+        pub struct _STACK {
+            pub num: c_int,
+            pub data: *mut *mut c_char,
+            pub sorted: c_int,
+            pub num_alloc: c_int,
+            pub comp: Option<unsafe extern "C" fn(*const c_void, *const c_void) -> c_int>,
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(ossl110)] {
+        extern "C" {
+            pub fn OPENSSL_sk_num(stack: *const OPENSSL_STACK) -> c_int;
+            pub fn OPENSSL_sk_value(stack: *const OPENSSL_STACK, idx: c_int) -> *mut c_void;
+
+            pub fn OPENSSL_sk_new_null() -> *mut OPENSSL_STACK;
+            pub fn OPENSSL_sk_free(st: *mut OPENSSL_STACK);
+            pub fn OPENSSL_sk_pop_free(
+                st: *mut OPENSSL_STACK,
+                free: Option<unsafe extern "C" fn(*mut c_void)>,
+            );
+            pub fn OPENSSL_sk_push(st: *mut OPENSSL_STACK, data: *const c_void) -> c_int;
+            pub fn OPENSSL_sk_pop(st: *mut OPENSSL_STACK) -> *mut c_void;
+        }
+    } else {
+        extern "C" {
+            pub fn sk_num(st: *const _STACK) -> c_int;
+            pub fn sk_value(st: *const _STACK, n: c_int) -> *mut c_void;
+
+            pub fn sk_new_null() -> *mut _STACK;
+            pub fn sk_free(st: *mut _STACK);
+            pub fn sk_pop_free(st: *mut _STACK, free: Option<unsafe extern "C" fn(*mut c_void)>);
+            pub fn sk_push(st: *mut _STACK, data: *mut c_void) -> c_int;
+            pub fn sk_pop(st: *mut _STACK) -> *mut c_void;
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/tls1.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/tls1.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/tls1.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/tls1.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,28 @@
+use super::super::*;
+use libc::*;
+
+extern "C" {
+    pub fn SSL_get_servername(ssl: *const SSL, name_type: c_int) -> *const c_char;
+
+    pub fn SSL_export_keying_material(
+        s: *mut SSL,
+        out: *mut c_uchar,
+        olen: size_t,
+        label: *const c_char,
+        llen: size_t,
+        context: *const c_uchar,
+        contextlen: size_t,
+        use_context: c_int,
+    ) -> c_int;
+
+    #[cfg(ossl111)]
+    pub fn SSL_export_keying_material_early(
+        s: *mut SSL,
+        out: *mut c_uchar,
+        olen: size_t,
+        label: *const c_char,
+        llen: size_t,
+        context: *const c_uchar,
+        contextlen: size_t,
+    ) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/types.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/types.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/types.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/types.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1140 @@
+use libc::*;
+
+#[allow(unused_imports)]
+use super::super::*;
+
+pub enum ASN1_OBJECT {}
+pub enum ASN1_VALUE {}
+
+pub type ASN1_BOOLEAN = c_int;
+pub enum ASN1_INTEGER {}
+pub enum ASN1_ENUMERATED {}
+pub enum ASN1_GENERALIZEDTIME {}
+pub enum ASN1_STRING {}
+pub enum ASN1_BIT_STRING {}
+pub enum ASN1_TIME {}
+pub enum ASN1_OCTET_STRING {}
+pub enum ASN1_NULL {}
+pub enum ASN1_PRINTABLESTRING {}
+pub enum ASN1_T61STRING {}
+pub enum ASN1_IA5STRING {}
+pub enum ASN1_GENERALSTRING {}
+pub enum ASN1_BMPSTRING {}
+pub enum ASN1_UNIVERSALSTRING {}
+pub enum ASN1_UTCTIME {}
+pub enum ASN1_VISIBLESTRING {}
+pub enum ASN1_UTF8STRING {}
+
+pub enum bio_st {} // FIXME remove
+cfg_if! {
+    if #[cfg(any(ossl110, libressl280))] {
+        pub enum BIO {}
+    } else {
+        #[repr(C)]
+        pub struct BIO {
+            pub method: *mut BIO_METHOD,
+            pub callback: Option<
+                unsafe extern "C" fn(*mut BIO, c_int, *const c_char, c_int, c_long, c_long) -> c_long,
+            >,
+            pub cb_arg: *mut c_char,
+            pub init: c_int,
+            pub shutdown: c_int,
+            pub flags: c_int,
+            pub retry_reason: c_int,
+            pub num: c_int,
+            pub ptr: *mut c_void,
+            pub next_bio: *mut BIO,
+            pub prev_bio: *mut BIO,
+            pub references: c_int,
+            pub num_read: c_ulong,
+            pub num_write: c_ulong,
+            pub ex_data: CRYPTO_EX_DATA,
+        }
+    }
+}
+cfg_if! {
+    if #[cfg(ossl320)] {
+        pub enum BIO_ADDR {}
+        pub enum BIO_POLL_DESCRIPTOR {}
+        #[repr(C)]
+        pub struct BIO_MSG {
+            pub data: *mut c_void,
+            pub data_len: usize,
+            pub peer: *mut BIO_ADDR,
+            pub local: *mut BIO_ADDR,
+            pub flags: u64,
+        }
+    }
+}
+cfg_if! {
+    if #[cfg(any(ossl110, libressl350))] {
+        pub enum BIGNUM {}
+    } else {
+        #[repr(C)]
+        pub struct BIGNUM {
+            pub d: *mut BN_ULONG,
+            pub top: c_int,
+            pub dmax: c_int,
+            pub neg: c_int,
+            pub flags: c_int,
+        }
+    }
+}
+pub enum BN_BLINDING {}
+pub enum BN_MONT_CTX {}
+
+pub enum BN_CTX {}
+pub enum BN_GENCB {}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl280))] {
+        pub enum EVP_CIPHER {}
+    } else {
+        #[repr(C)]
+        pub struct EVP_CIPHER {
+            pub nid: c_int,
+            pub block_size: c_int,
+            pub key_len: c_int,
+            pub iv_len: c_int,
+            pub flags: c_ulong,
+            pub init: Option<
+                unsafe extern "C" fn(*mut EVP_CIPHER_CTX, *const c_uchar, *const c_uchar, c_int) -> c_int,
+            >,
+            pub do_cipher: Option<
+                unsafe extern "C" fn(*mut EVP_CIPHER_CTX, *mut c_uchar, *const c_uchar, size_t) -> c_int,
+            >,
+            pub cleanup: Option<unsafe extern "C" fn(*mut EVP_CIPHER_CTX) -> c_int>,
+            pub ctx_size: c_int,
+            pub set_asn1_parameters:
+                Option<unsafe extern "C" fn(*mut EVP_CIPHER_CTX, *mut ASN1_TYPE) -> c_int>,
+            pub get_asn1_parameters:
+                Option<unsafe extern "C" fn(*mut EVP_CIPHER_CTX, *mut ASN1_TYPE) -> c_int>,
+            pub ctrl:
+                Option<unsafe extern "C" fn(*mut EVP_CIPHER_CTX, c_int, c_int, *mut c_void) -> c_int>,
+            pub app_data: *mut c_void,
+        }
+    }
+}
+pub enum EVP_CIPHER_CTX {}
+pub enum EVP_MD {}
+cfg_if! {
+    if #[cfg(any(ossl110, libressl280))] {
+        pub enum EVP_MD_CTX {}
+    } else {
+        #[repr(C)]
+        pub struct EVP_MD_CTX {
+            digest: *mut EVP_MD,
+            engine: *mut ENGINE,
+            flags: c_ulong,
+            md_data: *mut c_void,
+            pctx: *mut EVP_PKEY_CTX,
+            update: *mut c_void,
+        }
+    }
+}
+
+pub enum PKCS8_PRIV_KEY_INFO {}
+
+pub enum EVP_PKEY_ASN1_METHOD {}
+
+pub enum EVP_PKEY_CTX {}
+
+pub enum CMAC_CTX {}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl280))] {
+        pub enum HMAC_CTX {}
+    } else {
+        #[repr(C)]
+        pub struct HMAC_CTX {
+            md: *mut EVP_MD,
+            md_ctx: EVP_MD_CTX,
+            i_ctx: EVP_MD_CTX,
+            o_ctx: EVP_MD_CTX,
+            key_length: c_uint,
+            key: [c_uchar; 128],
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl280))] {
+        pub enum DH {}
+    } else {
+        #[repr(C)]
+        pub struct DH {
+            pub pad: c_int,
+            pub version: c_int,
+            pub p: *mut BIGNUM,
+            pub g: *mut BIGNUM,
+            pub length: c_long,
+            pub pub_key: *mut BIGNUM,
+            pub priv_key: *mut BIGNUM,
+            pub flags: c_int,
+            pub method_mont_p: *mut BN_MONT_CTX,
+            pub q: *mut BIGNUM,
+            pub j: *mut BIGNUM,
+            pub seed: *mut c_uchar,
+            pub seedlen: c_int,
+            pub counter: *mut BIGNUM,
+            pub references: c_int,
+            pub ex_data: CRYPTO_EX_DATA,
+            pub meth: *const DH_METHOD,
+            pub engine: *mut ENGINE,
+        }
+    }
+}
+pub enum DH_METHOD {}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl280))] {
+        pub enum DSA {}
+    } else {
+        #[repr(C)]
+        pub struct DSA {
+            pub pad: c_int,
+            pub version: c_long,
+            pub write_params: c_int,
+
+            pub p: *mut BIGNUM,
+            pub q: *mut BIGNUM,
+            pub g: *mut BIGNUM,
+            pub pub_key: *mut BIGNUM,
+            pub priv_key: *mut BIGNUM,
+            pub kinv: *mut BIGNUM,
+            pub r: *mut BIGNUM,
+
+            pub flags: c_int,
+            pub method_mont_p: *mut BN_MONT_CTX,
+            pub references: c_int,
+            pub ex_data: CRYPTO_EX_DATA,
+            pub meth: *const DSA_METHOD,
+            pub engine: *mut ENGINE,
+        }
+    }
+}
+pub enum DSA_METHOD {}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl280))] {
+        pub enum RSA {}
+    } else if #[cfg(libressl)] {
+        #[repr(C)]
+        pub struct RSA {
+            pub pad: c_int,
+            pub version: c_long,
+            pub meth: *const RSA_METHOD,
+
+            pub engine: *mut ENGINE,
+            pub n: *mut BIGNUM,
+            pub e: *mut BIGNUM,
+            pub d: *mut BIGNUM,
+            pub p: *mut BIGNUM,
+            pub q: *mut BIGNUM,
+            pub dmp1: *mut BIGNUM,
+            pub dmq1: *mut BIGNUM,
+            pub iqmp: *mut BIGNUM,
+
+            pub ex_data: CRYPTO_EX_DATA,
+            pub references: c_int,
+            pub flags: c_int,
+
+            pub _method_mod_n: *mut BN_MONT_CTX,
+            pub _method_mod_p: *mut BN_MONT_CTX,
+            pub _method_mod_q: *mut BN_MONT_CTX,
+
+            pub blinding: *mut BN_BLINDING,
+            pub mt_blinding: *mut BN_BLINDING,
+        }
+    } else {
+        #[repr(C)]
+        pub struct RSA {
+            pub pad: c_int,
+            pub version: c_long,
+            pub meth: *const RSA_METHOD,
+
+            pub engine: *mut ENGINE,
+            pub n: *mut BIGNUM,
+            pub e: *mut BIGNUM,
+            pub d: *mut BIGNUM,
+            pub p: *mut BIGNUM,
+            pub q: *mut BIGNUM,
+            pub dmp1: *mut BIGNUM,
+            pub dmq1: *mut BIGNUM,
+            pub iqmp: *mut BIGNUM,
+
+            pub ex_data: CRYPTO_EX_DATA,
+            pub references: c_int,
+            pub flags: c_int,
+
+            pub _method_mod_n: *mut BN_MONT_CTX,
+            pub _method_mod_p: *mut BN_MONT_CTX,
+            pub _method_mod_q: *mut BN_MONT_CTX,
+
+            pub bignum_data: *mut c_char,
+            pub blinding: *mut BN_BLINDING,
+            pub mt_blinding: *mut BN_BLINDING,
+        }
+    }
+}
+pub enum RSA_METHOD {}
+
+pub enum EC_KEY {}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl280))] {
+        pub enum X509 {}
+    } else if #[cfg(libressl)] {
+        #[repr(C)]
+        pub struct X509 {
+            pub cert_info: *mut X509_CINF,
+            pub sig_alg: *mut X509_ALGOR,
+            pub signature: *mut ASN1_BIT_STRING,
+            pub valid: c_int,
+            pub references: c_int,
+            pub name: *mut c_char,
+            pub ex_data: CRYPTO_EX_DATA,
+            pub ex_pathlen: c_long,
+            pub ex_pcpathlen: c_long,
+            pub ex_flags: c_ulong,
+            pub ex_kusage: c_ulong,
+            pub ex_xkusage: c_ulong,
+            pub ex_nscert: c_ulong,
+            skid: *mut c_void,
+            akid: *mut c_void,
+            policy_cache: *mut c_void,
+            crldp: *mut c_void,
+            altname: *mut c_void,
+            nc: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_SHA"))]
+            sha1_hash: [c_uchar; 20],
+            aux: *mut c_void,
+        }
+    } else {
+        #[repr(C)]
+        pub struct X509 {
+            pub cert_info: *mut X509_CINF,
+            pub sig_alg: *mut X509_ALGOR,
+            pub signature: *mut ASN1_BIT_STRING,
+            pub valid: c_int,
+            pub references: c_int,
+            pub name: *mut c_char,
+            pub ex_data: CRYPTO_EX_DATA,
+            pub ex_pathlen: c_long,
+            pub ex_pcpathlen: c_long,
+            pub ex_flags: c_ulong,
+            pub ex_kusage: c_ulong,
+            pub ex_xkusage: c_ulong,
+            pub ex_nscert: c_ulong,
+            skid: *mut c_void,
+            akid: *mut c_void,
+            policy_cache: *mut c_void,
+            crldp: *mut c_void,
+            altname: *mut c_void,
+            nc: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_RFC3779"))]
+            rfc3779_addr: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_RFC3779"))]
+            rfc3779_asid: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_SHA"))]
+            sha1_hash: [c_uchar; 20],
+            aux: *mut c_void,
+        }
+    }
+}
+cfg_if! {
+    if #[cfg(any(ossl110, libressl382))] {
+        pub enum X509_ALGOR {}
+    } else {
+        #[repr(C)]
+        pub struct X509_ALGOR {
+            pub algorithm: *mut ASN1_OBJECT,
+            parameter: *mut c_void,
+        }
+    }
+}
+
+stack!(stack_st_X509_ALGOR);
+
+pub enum X509_LOOKUP_METHOD {}
+
+pub enum X509_NAME {}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl270))] {
+        pub enum X509_STORE {}
+    } else {
+        #[repr(C)]
+        pub struct X509_STORE {
+            cache: c_int,
+            pub objs: *mut stack_st_X509_OBJECT,
+            get_cert_methods: *mut stack_st_X509_LOOKUP,
+            param: *mut X509_VERIFY_PARAM,
+            verify: Option<extern "C" fn(ctx: *mut X509_STORE_CTX) -> c_int>,
+            verify_cb: Option<extern "C" fn(ok: c_int, ctx: *mut X509_STORE_CTX) -> c_int>,
+            get_issuer: Option<
+                extern "C" fn(issuer: *mut *mut X509, ctx: *mut X509_STORE_CTX, x: *mut X509) -> c_int,
+            >,
+            check_issued:
+                Option<extern "C" fn(ctx: *mut X509_STORE_CTX, x: *mut X509, issuer: *mut X509) -> c_int>,
+            check_revocation: Option<extern "C" fn(ctx: *mut X509_STORE_CTX) -> c_int>,
+            get_crl: Option<
+                extern "C" fn(ctx: *mut X509_STORE_CTX, crl: *mut *mut X509_CRL, x: *mut X509) -> c_int,
+            >,
+            check_crl: Option<extern "C" fn(ctx: *mut X509_STORE_CTX, crl: *mut X509_CRL) -> c_int>,
+            cert_crl:
+                Option<extern "C" fn(ctx: *mut X509_STORE_CTX, crl: *mut X509_CRL, x: *mut X509) -> c_int>,
+            lookup_certs:
+                Option<extern "C" fn(ctx: *mut X509_STORE_CTX, nm: *const X509_NAME) -> *mut stack_st_X509>,
+            lookup_crls: Option<
+                extern "C" fn(ctx: *const X509_STORE_CTX, nm: *const X509_NAME) -> *mut stack_st_X509_CRL,
+            >,
+            cleanup: Option<extern "C" fn(ctx: *mut X509_STORE_CTX) -> c_int>,
+            ex_data: CRYPTO_EX_DATA,
+            references: c_int,
+        }
+    }
+}
+
+pub enum X509_STORE_CTX {}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl280))] {
+        pub enum X509_VERIFY_PARAM {}
+    } else if #[cfg(libressl251)] {
+        #[repr(C)]
+        pub struct X509_VERIFY_PARAM {
+            pub name: *mut c_char,
+            pub check_time: time_t,
+            pub inh_flags: c_ulong,
+            pub flags: c_ulong,
+            pub purpose: c_int,
+            pub trust: c_int,
+            pub depth: c_int,
+            pub policies: *mut stack_st_ASN1_OBJECT,
+            id: *mut c_void,
+        }
+    } else if #[cfg(libressl)] {
+        #[repr(C)]
+        pub struct X509_VERIFY_PARAM {
+            pub name: *mut c_char,
+            pub check_time: time_t,
+            pub inh_flags: c_ulong,
+            pub flags: c_ulong,
+            pub purpose: c_int,
+            pub trust: c_int,
+            pub depth: c_int,
+            pub policies: *mut stack_st_ASN1_OBJECT,
+            //pub id: *mut X509_VERIFY_PARAM_ID,
+        }
+    } else {
+        #[repr(C)]
+        pub struct X509_VERIFY_PARAM {
+            pub name: *mut c_char,
+            pub check_time: time_t,
+            pub inh_flags: c_ulong,
+            pub flags: c_ulong,
+            pub purpose: c_int,
+            pub trust: c_int,
+            pub depth: c_int,
+            pub policies: *mut stack_st_ASN1_OBJECT,
+            #[cfg(ossl102)]
+            pub id: *mut X509_VERIFY_PARAM_ID,
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl270))] {
+        pub enum X509_OBJECT {}
+    } else {
+        #[repr(C)]
+        pub struct X509_OBJECT {
+            pub type_: c_int,
+            pub data: X509_OBJECT_data,
+        }
+        #[repr(C)]
+        pub union X509_OBJECT_data {
+            pub ptr: *mut c_char,
+            pub x509: *mut X509,
+            pub crl: *mut X509_CRL,
+            pub pkey: *mut EVP_PKEY,
+        }
+    }
+}
+
+pub enum X509_LOOKUP {}
+
+#[repr(C)]
+pub struct X509V3_CTX {
+    flags: c_int,
+    issuer_cert: *mut c_void,
+    subject_cert: *mut c_void,
+    subject_req: *mut c_void,
+    crl: *mut c_void,
+    db_meth: *mut c_void,
+    db: *mut c_void,
+    #[cfg(ossl300)]
+    issuer_pkey: *mut c_void,
+    // I like the last comment line, it is copied from OpenSSL sources:
+    // Maybe more here
+}
+pub enum CONF {}
+#[cfg(ossl110)]
+pub enum OPENSSL_INIT_SETTINGS {}
+
+pub enum ENGINE {}
+cfg_if! {
+    if #[cfg(any(ossl110, libressl280))] {
+        pub enum SSL {}
+    } else if #[cfg(libressl251)] {
+        #[repr(C)]
+        pub struct SSL {
+            version: c_int,
+            method: *const SSL_METHOD,
+            rbio: *mut BIO,
+            wbio: *mut BIO,
+            bbio: *mut BIO,
+            pub server: c_int,
+            s3: *mut c_void,
+            d1: *mut c_void,
+            param: *mut c_void,
+            cipher_list: *mut stack_st_SSL_CIPHER,
+            cert: *mut c_void,
+            sid_ctx_length: c_uint,
+            sid_ctx: [c_uchar; SSL_MAX_SID_CTX_LENGTH as usize],
+            session: *mut SSL_SESSION,
+            verify_mode: c_int,
+            error: c_int,
+            error_code: c_int,
+            ctx: *mut SSL_CTX,
+            verify_result: c_long,
+            references: c_int,
+            client_version: c_int,
+            max_send_fragment: c_uint,
+            tlsext_hostname: *mut c_char,
+            tlsext_status_type: c_int,
+            initial_ctx: *mut SSL_CTX,
+            enc_read_ctx: *mut EVP_CIPHER_CTX,
+            read_hash: *mut EVP_MD_CTX,
+            internal: *mut c_void,
+        }
+    } else if #[cfg(libressl)] {
+        #[repr(C)]
+        pub struct SSL {
+            version: c_int,
+            type_: c_int,
+            method: *const SSL_METHOD,
+            rbio: *mut c_void,
+            wbio: *mut c_void,
+            bbio: *mut c_void,
+            rwstate: c_int,
+            in_handshake: c_int,
+            handshake_func: Option<unsafe extern "C" fn(*mut SSL) -> c_int>,
+            pub server: c_int,
+            new_session: c_int,
+            quiet_shutdown: c_int,
+            shutdown: c_int,
+            state: c_int,
+            rstate: c_int,
+            init_buf: *mut c_void,
+            init_msg: *mut c_void,
+            init_num: c_int,
+            init_off: c_int,
+            packet: *mut c_uchar,
+            packet_length: c_uint,
+            s3: *mut c_void,
+            d1: *mut c_void,
+            read_ahead: c_int,
+            msg_callback: Option<
+                unsafe extern "C" fn(c_int,
+                                    c_int,
+                                    c_int,
+                                    *const c_void,
+                                    size_t,
+                                    *mut SSL,
+                                    *mut c_void),
+            >,
+            msg_callback_arg: *mut c_void,
+            hit: c_int,
+            param: *mut c_void,
+            cipher_list: *mut stack_st_SSL_CIPHER,
+            cipher_list_by_id: *mut stack_st_SSL_CIPHER,
+            mac_flags: c_int,
+            aead_read_ctx: *mut c_void,
+            enc_read_ctx: *mut EVP_CIPHER_CTX,
+            read_hash: *mut EVP_MD_CTX,
+            aead_write_ctx: *mut c_void,
+            enc_write_ctx: *mut EVP_CIPHER_CTX,
+            write_hash: *mut EVP_MD_CTX,
+            cert: *mut c_void,
+            sid_ctx_length: c_uint,
+            sid_ctx: [c_uchar; SSL_MAX_SID_CTX_LENGTH as usize],
+            session: *mut SSL_SESSION,
+            generate_session_id: GEN_SESSION_CB,
+            verify_mode: c_int,
+            verify_callback: Option<unsafe extern "C" fn(c_int, *mut X509_STORE_CTX) -> c_int>,
+            info_callback: Option<unsafe extern "C" fn(*mut SSL, c_int, c_int)>,
+            error: c_int,
+            error_code: c_int,
+            ctx: *mut SSL_CTX,
+            debug: c_int,
+            verify_result: c_long,
+            ex_data: CRYPTO_EX_DATA,
+            client_CA: *mut stack_st_X509_NAME,
+            references: c_int,
+            options: c_ulong,
+            mode: c_ulong,
+            max_cert_list: c_long,
+            first_packet: c_int,
+            client_version: c_int,
+            max_send_fragment: c_uint,
+            tlsext_debug_cb:
+                Option<unsafe extern "C" fn(*mut SSL, c_int, c_int, *mut c_uchar, c_int, *mut c_void)>,
+            tlsext_debug_arg: *mut c_void,
+            tlsext_hostname: *mut c_char,
+            servername_done: c_int,
+            tlsext_status_type: c_int,
+            tlsext_status_expected: c_int,
+            tlsext_ocsp_ids: *mut c_void,
+            tlsext_ocsp_exts: *mut c_void,
+            tlsext_ocsp_resp: *mut c_uchar,
+            tlsext_ocsp_resplen: c_int,
+            tlsext_ticket_expected: c_int,
+            tlsext_ecpointformatlist_length: size_t,
+            tlsext_ecpointformatlist: *mut c_uchar,
+            tlsext_ellipticcurvelist_length: size_t,
+            tlsext_ellipticcurvelist: *mut c_uchar,
+            tlsext_session_ticket: *mut c_void,
+            tlsext_session_ticket_ext_cb: tls_session_ticket_ext_cb_fn,
+            tls_session_ticket_ext_cb_arg: *mut c_void,
+            tls_session_secret_cb: tls_session_secret_cb_fn,
+            tls_session_secret_cb_arg: *mut c_void,
+            initial_ctx: *mut SSL_CTX,
+            next_proto_negotiated: *mut c_uchar,
+            next_proto_negotiated_len: c_uchar,
+            srtp_profiles: *mut c_void,
+            srtp_profile: *mut c_void,
+            tlsext_heartbeat: c_uint,
+            tlsext_hb_pending: c_uint,
+            tlsext_hb_seq: c_uint,
+            alpn_client_proto_list: *mut c_uchar,
+            alpn_client_proto_list_len: c_uint,
+            renegotiate: c_int,
+        }
+    } else {
+        #[repr(C)]
+        pub struct SSL {
+            version: c_int,
+            type_: c_int,
+            method: *const SSL_METHOD,
+            rbio: *mut c_void,
+            wbio: *mut c_void,
+            bbio: *mut c_void,
+            rwstate: c_int,
+            in_handshake: c_int,
+            handshake_func: Option<unsafe extern "C" fn(*mut SSL) -> c_int>,
+            pub server: c_int,
+            new_session: c_int,
+            quiet_session: c_int,
+            shutdown: c_int,
+            state: c_int,
+            rstate: c_int,
+            init_buf: *mut c_void,
+            init_msg: *mut c_void,
+            init_num: c_int,
+            init_off: c_int,
+            packet: *mut c_uchar,
+            packet_length: c_uint,
+            s2: *mut c_void,
+            s3: *mut c_void,
+            d1: *mut c_void,
+            read_ahead: c_int,
+            msg_callback: Option<
+                unsafe extern "C" fn(c_int, c_int, c_int, *const c_void, size_t, *mut SSL, *mut c_void),
+            >,
+            msg_callback_arg: *mut c_void,
+            hit: c_int,
+            param: *mut c_void,
+            cipher_list: *mut stack_st_SSL_CIPHER,
+            cipher_list_by_id: *mut stack_st_SSL_CIPHER,
+            mac_flags: c_int,
+            enc_read_ctx: *mut EVP_CIPHER_CTX,
+            read_hash: *mut EVP_MD_CTX,
+            expand: *mut c_void,
+            enc_write_ctx: *mut EVP_CIPHER_CTX,
+            write_hash: *mut EVP_MD_CTX,
+            compress: *mut c_void,
+            cert: *mut c_void,
+            sid_ctx_length: c_uint,
+            sid_ctx: [c_uchar; SSL_MAX_SID_CTX_LENGTH as usize],
+            session: *mut SSL_SESSION,
+            generate_session_id: GEN_SESSION_CB,
+            verify_mode: c_int,
+            verify_callback: Option<unsafe extern "C" fn(c_int, *mut X509_STORE_CTX) -> c_int>,
+            info_callback: Option<unsafe extern "C" fn(*mut SSL, c_int, c_int)>,
+            error: c_int,
+            error_code: c_int,
+            #[cfg(not(osslconf = "OPENSSL_NO_KRB5"))]
+            kssl_ctx: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
+            psk_client_callback: Option<
+                unsafe extern "C" fn(*mut SSL, *const c_char, *mut c_char, c_uint, *mut c_uchar, c_uint)
+                    -> c_uint,
+            >,
+            #[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
+            psk_server_callback:
+                Option<unsafe extern "C" fn(*mut SSL, *const c_char, *mut c_uchar, c_uint) -> c_uint>,
+            ctx: *mut SSL_CTX,
+            debug: c_int,
+            verify_result: c_long,
+            ex_data: CRYPTO_EX_DATA,
+            client_CA: *mut stack_st_X509_NAME,
+            references: c_int,
+            options: c_ulong,
+            mode: c_ulong,
+            max_cert_list: c_long,
+            first_packet: c_int,
+            client_version: c_int,
+            max_send_fragment: c_uint,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_debug_cb:
+                Option<unsafe extern "C" fn(*mut SSL, c_int, c_int, *mut c_uchar, c_int, *mut c_void)>,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_debug_arg: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_hostname: *mut c_char,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            servername_done: c_int,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_status_type: c_int,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_status_expected: c_int,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_ocsp_ids: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_ocsp_exts: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_ocsp_resp: *mut c_uchar,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_ocsp_resplen: c_int,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_ticket_expected: c_int,
+            #[cfg(all(
+                not(osslconf = "OPENSSL_NO_TLSEXT"),
+                not(osslconf = "OPENSSL_NO_EC")
+            ))]
+            tlsext_ecpointformatlist_length: size_t,
+            #[cfg(all(
+                not(osslconf = "OPENSSL_NO_TLSEXT"),
+                not(osslconf = "OPENSSL_NO_EC")
+            ))]
+            tlsext_ecpointformatlist: *mut c_uchar,
+            #[cfg(all(
+                not(osslconf = "OPENSSL_NO_TLSEXT"),
+                not(osslconf = "OPENSSL_NO_EC")
+            ))]
+            tlsext_ellipticcurvelist_length: size_t,
+            #[cfg(all(
+                not(osslconf = "OPENSSL_NO_TLSEXT"),
+                not(osslconf = "OPENSSL_NO_EC")
+            ))]
+            tlsext_ellipticcurvelist: *mut c_uchar,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_opaque_prf_input: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_opaque_prf_input_len: size_t,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_session_ticket: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_session_ticket_ext_cb: tls_session_ticket_ext_cb_fn,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tls_session_ticket_ext_cb_arg: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tls_session_secret_cb: tls_session_secret_cb_fn,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tls_session_secret_cb_arg: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            initial_ctx: *mut SSL_CTX,
+            #[cfg(all(
+                not(osslconf = "OPENSSL_NO_TLSEXT"),
+                not(osslconf = "OPENSSL_NO_NEXTPROTONEG")
+            ))]
+            next_proto_negotiated: *mut c_uchar,
+            #[cfg(all(
+                not(osslconf = "OPENSSL_NO_TLSEXT"),
+                not(osslconf = "OPENSSL_NO_NEXTPROTONEG")
+            ))]
+            next_proto_negotiated_len: c_uchar,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            srtp_profiles: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            srtp_profile: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_heartbeat: c_uint,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_hb_pending: c_uint,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_hb_seq: c_uint,
+            renegotiate: c_int,
+            #[cfg(not(osslconf = "OPENSSL_NO_SRP"))]
+            srp_ctx: SRP_CTX,
+            #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), ossl102))]
+            alpn_client_proto_list: *mut c_uchar,
+            #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), ossl102))]
+            alpn_client_proto_list_len: c_uint,
+        }
+    }
+}
+cfg_if! {
+    if #[cfg(any(ossl110, libressl280))] {
+        pub enum SSL_CTX {}
+    } else if #[cfg(libressl251)] {
+        #[repr(C)]
+        pub struct SSL_CTX {
+            method: *const SSL_METHOD,
+            cipher_list: *mut stack_st_SSL_CIPHER,
+            cert_store: *mut c_void,
+            session_timeout: c_long,
+            pub references: c_int,
+            extra_certs: *mut stack_st_X509,
+            verify_mode: c_int,
+            sid_ctx_length: c_uint,
+            sid_ctx: [c_uchar; SSL_MAX_SID_CTX_LENGTH as usize],
+            param: *mut X509_VERIFY_PARAM,
+            default_passwd_callback: *mut c_void,
+            default_passwd_callback_userdata: *mut c_void,
+            internal: *mut c_void,
+        }
+    } else if #[cfg(libressl)] {
+        #[repr(C)]
+        pub struct SSL_CTX {
+            method: *mut c_void,
+            cipher_list: *mut c_void,
+            cipher_list_by_id: *mut c_void,
+            cert_store: *mut c_void,
+            sessions: *mut c_void,
+            session_cache_size: c_ulong,
+            session_cache_head: *mut c_void,
+            session_cache_tail: *mut c_void,
+            session_cache_mode: c_int,
+            session_timeout: c_long,
+            new_session_cb: *mut c_void,
+            remove_session_cb: *mut c_void,
+            get_session_cb: *mut c_void,
+            stats: [c_int; 11],
+            pub references: c_int,
+            app_verify_callback: *mut c_void,
+            app_verify_arg: *mut c_void,
+            default_passwd_callback: *mut c_void,
+            default_passwd_callback_userdata: *mut c_void,
+            client_cert_cb: *mut c_void,
+            app_gen_cookie_cb: *mut c_void,
+            app_verify_cookie_cb: *mut c_void,
+            ex_dat: CRYPTO_EX_DATA,
+            rsa_md5: *mut c_void,
+            md5: *mut c_void,
+            sha1: *mut c_void,
+            extra_certs: *mut c_void,
+            comp_methods: *mut c_void,
+            info_callback: *mut c_void,
+            client_CA: *mut c_void,
+            options: c_ulong,
+            mode: c_ulong,
+            max_cert_list: c_long,
+            cert: *mut c_void,
+            read_ahead: c_int,
+            msg_callback: *mut c_void,
+            msg_callback_arg: *mut c_void,
+            verify_mode: c_int,
+            sid_ctx_length: c_uint,
+            sid_ctx: [c_uchar; 32],
+            default_verify_callback: *mut c_void,
+            generate_session_id: *mut c_void,
+            param: *mut c_void,
+            quiet_shutdown: c_int,
+            max_send_fragment: c_uint,
+
+            #[cfg(not(osslconf = "OPENSSL_NO_ENGINE"))]
+            client_cert_engine: *mut c_void,
+
+            tlsext_servername_callback: *mut c_void,
+            tlsect_servername_arg: *mut c_void,
+            tlsext_tick_key_name: [c_uchar; 16],
+            tlsext_tick_hmac_key: [c_uchar; 16],
+            tlsext_tick_aes_key: [c_uchar; 16],
+            tlsext_ticket_key_cb: *mut c_void,
+            tlsext_status_cb: *mut c_void,
+            tlsext_status_arg: *mut c_void,
+            tlsext_opaque_prf_input_callback: *mut c_void,
+            tlsext_opaque_prf_input_callback_arg: *mut c_void,
+
+            next_protos_advertised_cb: *mut c_void,
+            next_protos_advertised_cb_arg: *mut c_void,
+            next_proto_select_cb: *mut c_void,
+            next_proto_select_cb_arg: *mut c_void,
+
+            srtp_profiles: *mut c_void,
+        }
+    } else {
+        #[repr(C)]
+        pub struct SSL_CTX {
+            method: *mut c_void,
+            cipher_list: *mut c_void,
+            cipher_list_by_id: *mut c_void,
+            cert_store: *mut c_void,
+            sessions: *mut c_void,
+            session_cache_size: c_ulong,
+            session_cache_head: *mut c_void,
+            session_cache_tail: *mut c_void,
+            session_cache_mode: c_int,
+            session_timeout: c_long,
+            new_session_cb: *mut c_void,
+            remove_session_cb: *mut c_void,
+            get_session_cb: *mut c_void,
+            stats: [c_int; 11],
+            pub references: c_int,
+            app_verify_callback: *mut c_void,
+            app_verify_arg: *mut c_void,
+            default_passwd_callback: *mut c_void,
+            default_passwd_callback_userdata: *mut c_void,
+            client_cert_cb: *mut c_void,
+            app_gen_cookie_cb: *mut c_void,
+            app_verify_cookie_cb: *mut c_void,
+            ex_dat: CRYPTO_EX_DATA,
+            rsa_md5: *mut c_void,
+            md5: *mut c_void,
+            sha1: *mut c_void,
+            extra_certs: *mut c_void,
+            comp_methods: *mut c_void,
+            info_callback: *mut c_void,
+            client_CA: *mut c_void,
+            options: c_ulong,
+            mode: c_ulong,
+            max_cert_list: c_long,
+            cert: *mut c_void,
+            read_ahead: c_int,
+            msg_callback: *mut c_void,
+            msg_callback_arg: *mut c_void,
+            verify_mode: c_int,
+            sid_ctx_length: c_uint,
+            sid_ctx: [c_uchar; 32],
+            default_verify_callback: *mut c_void,
+            generate_session_id: *mut c_void,
+            param: *mut c_void,
+            quiet_shutdown: c_int,
+            max_send_fragment: c_uint,
+
+            #[cfg(not(osslconf = "OPENSSL_NO_ENGINE"))]
+            client_cert_engine: *mut c_void,
+
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_servername_callback: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsect_servername_arg: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_tick_key_name: [c_uchar; 16],
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_tick_hmac_key: [c_uchar; 16],
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_tick_aes_key: [c_uchar; 16],
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_ticket_key_cb: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_status_cb: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_status_arg: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_opaque_prf_input_callback: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
+            tlsext_opaque_prf_input_callback_arg: *mut c_void,
+
+            #[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
+            psk_identity_hint: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
+            psk_client_callback: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
+            psk_server_callback: *mut c_void,
+
+            #[cfg(not(osslconf = "OPENSSL_NO_BUF_FREELISTS"))]
+            freelist_max_len: c_uint,
+            #[cfg(not(osslconf = "OPENSSL_NO_BUF_FREELISTS"))]
+            wbuf_freelist: *mut c_void,
+            #[cfg(not(osslconf = "OPENSSL_NO_BUF_FREELISTS"))]
+            rbuf_freelist: *mut c_void,
+
+            #[cfg(not(osslconf = "OPENSSL_NO_SRP"))]
+            srp_ctx: SRP_CTX,
+
+            #[cfg(all(
+                not(osslconf = "OPENSSL_NO_TLSEXT"),
+                not(osslconf = "OPENSSL_NO_NEXTPROTONEG")
+            ))]
+            next_protos_advertised_cb: *mut c_void,
+            #[cfg(all(
+                not(osslconf = "OPENSSL_NO_TLSEXT"),
+                not(osslconf = "OPENSSL_NO_NEXTPROTONEG")
+            ))]
+            next_protos_advertised_cb_arg: *mut c_void,
+            #[cfg(all(
+                not(osslconf = "OPENSSL_NO_TLSEXT"),
+                not(osslconf = "OPENSSL_NO_NEXTPROTONEG")
+            ))]
+            next_proto_select_cb: *mut c_void,
+            #[cfg(all(
+                not(osslconf = "OPENSSL_NO_TLSEXT"),
+                not(osslconf = "OPENSSL_NO_NEXTPROTONEG")
+            ))]
+            next_proto_select_cb_arg: *mut c_void,
+
+            #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), ossl101))]
+            srtp_profiles: *mut c_void,
+            #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), ossl102))]
+            alpn_select_cb: *mut c_void,
+            #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), ossl102))]
+            alpn_select_cb_arg: *mut c_void,
+            #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), ossl102))]
+            alpn_client_proto_list: *mut c_void,
+            #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), ossl102))]
+            alpn_client_proto_list_len: c_uint,
+
+            #[cfg(all(
+                not(osslconf = "OPENSSL_NO_TLSEXT"),
+                not(osslconf = "OPENSSL_NO_EC"),
+                ossl102
+            ))]
+            tlsext_ecpointformatlist_length: size_t,
+            #[cfg(all(
+                not(osslconf = "OPENSSL_NO_TLSEXT"),
+                not(osslconf = "OPENSSL_NO_EC"),
+                ossl102
+            ))]
+            tlsext_ecpointformatlist: *mut c_uchar,
+            #[cfg(all(
+                not(osslconf = "OPENSSL_NO_TLSEXT"),
+                not(osslconf = "OPENSSL_NO_EC"),
+                ossl102
+            ))]
+            tlsext_ellipticcurvelist_length: size_t,
+            #[cfg(all(
+                not(osslconf = "OPENSSL_NO_TLSEXT"),
+                not(osslconf = "OPENSSL_NO_EC"),
+                ossl102
+            ))]
+            tlsext_ellipticcurvelist: *mut c_uchar,
+        }
+
+        #[repr(C)]
+        #[cfg(not(osslconf = "OPENSSL_NO_SRP"))]
+        pub struct SRP_CTX {
+            SRP_cb_arg: *mut c_void,
+            TLS_ext_srp_username_callback: *mut c_void,
+            SRP_verify_param_callback: *mut c_void,
+            SRP_give_srp_client_pwd_callback: *mut c_void,
+            login: *mut c_void,
+            N: *mut c_void,
+            g: *mut c_void,
+            s: *mut c_void,
+            B: *mut c_void,
+            A: *mut c_void,
+            a: *mut c_void,
+            b: *mut c_void,
+            v: *mut c_void,
+            info: *mut c_void,
+            stringth: c_int,
+            srp_Mask: c_ulong,
+        }
+    }
+}
+cfg_if! {
+    if #[cfg(ossl320)] {
+        #[repr(C)]
+        pub struct SSL_CONN_CLOSE_INFO {
+            pub error_code: u64,
+            pub frame_type: u64,
+            pub reason: *const ::libc::c_char,
+            pub reason_len: usize,
+            pub flags: u32,
+        }
+        #[repr(C)]
+        pub struct SSL_SHUTDOWN_EX_ARGS {
+            pub quic_error_code: u64,
+            pub quic_reason: *const c_char,
+        }
+        #[repr(C)]
+        pub struct SSL_STREAM_RESET_ARGS {
+            pub quic_error_code: u64,
+        }
+    }
+}
+
+pub enum COMP_CTX {}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl350))] {
+        pub enum COMP_METHOD {}
+    } else {
+        #[repr(C)]
+        pub struct COMP_METHOD {
+            pub type_: c_int,
+            pub name: *const c_char,
+            init: Option<unsafe extern "C" fn(*mut COMP_CTX) -> c_int>,
+            finish: Option<unsafe extern "C" fn(*mut COMP_CTX)>,
+            compress: Option<
+                unsafe extern "C" fn(
+                    *mut COMP_CTX,
+                    *mut c_uchar,
+                    c_uint,
+                    *mut c_uchar,
+                    c_uint,
+                ) -> c_int,
+            >,
+            expand: Option<
+                unsafe extern "C" fn(
+                    *mut COMP_CTX,
+                    *mut c_uchar,
+                    c_uint,
+                    *mut c_uchar,
+                    c_uint,
+                ) -> c_int,
+            >,
+            ctrl: Option<unsafe extern "C" fn() -> c_long>,
+            callback_ctrl: Option<unsafe extern "C" fn() -> c_long>,
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl280))] {
+        pub enum CRYPTO_EX_DATA {}
+    } else if #[cfg(libressl)] {
+        #[repr(C)]
+        pub struct CRYPTO_EX_DATA {
+            pub sk: *mut stack_st_void,
+        }
+    } else {
+        #[repr(C)]
+        pub struct CRYPTO_EX_DATA {
+            pub sk: *mut stack_st_void,
+            pub dummy: c_int,
+        }
+    }
+}
+
+pub enum OCSP_RESPONSE {}
+
+#[cfg(ossl300)]
+pub enum OSSL_PROVIDER {}
+
+#[cfg(ossl300)]
+pub enum OSSL_LIB_CTX {}
+
+#[cfg(ossl300)]
+#[repr(C)]
+pub struct OSSL_PARAM {
+    key: *const c_char,
+    data_type: c_uchar,
+    data: *mut c_void,
+    data_size: size_t,
+    return_size: size_t,
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/x509.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/x509.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/x509.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/x509.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,781 @@
+use super::super::*;
+use libc::*;
+
+cfg_if! {
+    if #[cfg(libressl400)] {
+        pub enum X509_VAL {}
+    } else {
+        #[repr(C)]
+        pub struct X509_VAL {
+            pub notBefore: *mut ASN1_TIME,
+            pub notAfter: *mut ASN1_TIME,
+        }
+    }
+}
+
+pub enum X509_NAME_ENTRY {}
+
+stack!(stack_st_X509_NAME_ENTRY);
+
+stack!(stack_st_X509_NAME);
+
+pub enum X509_EXTENSION {}
+
+stack!(stack_st_X509_EXTENSION);
+
+pub enum X509_ATTRIBUTE {}
+
+stack!(stack_st_X509_ATTRIBUTE);
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl350))] {
+        pub enum X509_REQ_INFO {}
+    } else {
+        #[repr(C)]
+        pub struct X509_REQ_INFO {
+            pub enc: ASN1_ENCODING,
+            pub version: *mut ASN1_INTEGER,
+            pub subject: *mut X509_NAME,
+            pubkey: *mut c_void,
+            pub attributes: *mut stack_st_X509_ATTRIBUTE,
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl350))] {
+        pub enum X509_CRL {}
+    } else {
+        #[repr(C)]
+        pub struct X509_CRL {
+            pub crl: *mut X509_CRL_INFO,
+            sig_alg: *mut X509_ALGOR,
+            signature: *mut c_void,
+            references: c_int,
+            flags: c_int,
+            akid: *mut c_void,
+            idp: *mut c_void,
+            idp_flags: c_int,
+            idp_reasons: c_int,
+            crl_number: *mut ASN1_INTEGER,
+            base_crl_number: *mut ASN1_INTEGER,
+            sha1_hash: [c_uchar; 20],
+            issuers: *mut c_void,
+            meth: *const c_void,
+            meth_data: *mut c_void,
+        }
+    }
+}
+
+stack!(stack_st_X509_CRL);
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl350))] {
+        pub enum X509_CRL_INFO {}
+    } else {
+        #[repr(C)]
+        pub struct X509_CRL_INFO {
+            version: *mut ASN1_INTEGER,
+            sig_alg: *mut X509_ALGOR,
+            pub issuer: *mut X509_NAME,
+            pub lastUpdate: *mut ASN1_TIME,
+            pub nextUpdate: *mut ASN1_TIME,
+            pub revoked: *mut stack_st_X509_REVOKED,
+            extensions: *mut stack_st_X509_EXTENSION,
+            enc: ASN1_ENCODING,
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl350))] {
+        pub enum X509_REVOKED {}
+    } else {
+        #[repr(C)]
+        pub struct X509_REVOKED {
+            pub serialNumber: *mut ASN1_INTEGER,
+            pub revocationDate: *mut ASN1_TIME,
+            pub extensions: *mut stack_st_X509_EXTENSION,
+            issuer: *mut stack_st_GENERAL_NAME,
+            reason: c_int,
+            sequence: c_int,
+        }
+    }
+}
+
+stack!(stack_st_X509_REVOKED);
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl350))] {
+        pub enum X509_REQ {}
+    } else {
+        #[repr(C)]
+        pub struct X509_REQ {
+            pub req_info: *mut X509_REQ_INFO,
+            sig_alg: *mut c_void,
+            signature: *mut c_void,
+            references: c_int,
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl350))] {
+        pub enum X509_CINF {}
+    } else {
+        #[repr(C)]
+        pub struct X509_CINF {
+            version: *mut c_void,
+            serialNumber: *mut c_void,
+            signature: *mut c_void,
+            issuer: *mut c_void,
+            pub validity: *mut X509_VAL,
+            subject: *mut c_void,
+            key: *mut c_void,
+            issuerUID: *mut c_void,
+            subjectUID: *mut c_void,
+            pub extensions: *mut stack_st_X509_EXTENSION,
+            enc: ASN1_ENCODING,
+        }
+    }
+}
+
+stack!(stack_st_X509);
+
+stack!(stack_st_X509_OBJECT);
+
+stack!(stack_st_X509_LOOKUP);
+
+extern "C" {
+    pub fn X509_verify_cert_error_string(n: c_long) -> *const c_char;
+
+    pub fn X509_sign(x: *mut X509, pkey: *mut EVP_PKEY, md: *const EVP_MD) -> c_int;
+
+    pub fn X509_digest(
+        x: *const X509,
+        digest: *const EVP_MD,
+        buf: *mut c_uchar,
+        len: *mut c_uint,
+    ) -> c_int;
+
+    pub fn X509_REQ_sign(x: *mut X509_REQ, pkey: *mut EVP_PKEY, md: *const EVP_MD) -> c_int;
+}
+
+const_ptr_api! {
+    extern "C" {
+        pub fn i2d_X509_bio(b: *mut BIO, x: #[const_ptr_if(ossl300)] X509) -> c_int;
+        pub fn i2d_X509_REQ_bio(b: *mut BIO, x: #[const_ptr_if(ossl300)] X509_REQ) -> c_int;
+        pub fn i2d_PrivateKey_bio(b: *mut BIO, x: #[const_ptr_if(ossl300)] EVP_PKEY) -> c_int;
+        pub fn i2d_PUBKEY_bio(b: *mut BIO, x: #[const_ptr_if(ossl300)] EVP_PKEY) -> c_int;
+
+        pub fn i2d_PUBKEY(k: #[const_ptr_if(ossl300)] EVP_PKEY, buf: *mut *mut u8) -> c_int;
+        pub fn i2d_RSA_PUBKEY(k: #[const_ptr_if(ossl300)] RSA, buf: *mut *mut u8) -> c_int;
+        pub fn i2d_DSA_PUBKEY(a: #[const_ptr_if(ossl300)] DSA, pp: *mut *mut c_uchar) -> c_int;
+        pub fn i2d_PrivateKey(k: #[const_ptr_if(ossl300)] EVP_PKEY, buf: *mut *mut u8) -> c_int;
+        pub fn i2d_ECPrivateKey(ec_key: #[const_ptr_if(ossl300)] EC_KEY, pp: *mut *mut c_uchar) -> c_int;
+        pub fn i2d_EC_PUBKEY(a: #[const_ptr_if(ossl300)] EC_KEY, pp: *mut *mut c_uchar) -> c_int;
+    }
+}
+extern "C" {
+    pub fn d2i_PUBKEY(k: *mut *mut EVP_PKEY, buf: *mut *const u8, len: c_long) -> *mut EVP_PKEY;
+    pub fn d2i_RSA_PUBKEY(k: *mut *mut RSA, buf: *mut *const u8, len: c_long) -> *mut RSA;
+    pub fn d2i_DSA_PUBKEY(k: *mut *mut DSA, pp: *mut *const c_uchar, length: c_long) -> *mut DSA;
+    pub fn d2i_EC_PUBKEY(
+        a: *mut *mut EC_KEY,
+        pp: *mut *const c_uchar,
+        length: c_long,
+    ) -> *mut EC_KEY;
+
+    pub fn d2i_ECPrivateKey(
+        k: *mut *mut EC_KEY,
+        pp: *mut *const c_uchar,
+        length: c_long,
+    ) -> *mut EC_KEY;
+}
+
+const_ptr_api! {
+    extern "C" {
+        #[cfg(any(ossl102, libressl350))]
+        pub fn X509_ALGOR_get0(
+            paobj: *mut #[const_ptr_if(any(ossl110, libressl350))] ASN1_OBJECT,
+            pptype: *mut c_int,
+            ppval: *mut #[const_ptr_if(any(ossl110, libressl350))] c_void,
+            alg: #[const_ptr_if(any(ossl110, libressl350))] X509_ALGOR,
+        );
+    }
+}
+
+extern "C" {
+    pub fn X509_gmtime_adj(time: *mut ASN1_TIME, adj: c_long) -> *mut ASN1_TIME;
+
+    pub fn X509_to_X509_REQ(x: *mut X509, pkey: *mut EVP_PKEY, md: *const EVP_MD) -> *mut X509_REQ;
+
+    pub fn X509_ALGOR_free(x: *mut X509_ALGOR);
+
+    pub fn X509_REVOKED_new() -> *mut X509_REVOKED;
+    pub fn X509_REVOKED_free(x: *mut X509_REVOKED);
+}
+const_ptr_api! {
+    extern "C" {
+        #[cfg(any(ossl110, libressl270))]
+        pub fn X509_REVOKED_dup(rev: #[const_ptr_if(ossl300)] X509_REVOKED) -> *mut X509_REVOKED;
+    }
+}
+
+extern "C" {
+    pub fn d2i_X509_REVOKED(
+        a: *mut *mut X509_REVOKED,
+        pp: *mut *const c_uchar,
+        length: c_long,
+    ) -> *mut X509_REVOKED;
+}
+const_ptr_api! {
+    extern "C" {
+        pub fn i2d_X509_REVOKED(x: #[const_ptr_if(ossl300)] X509_REVOKED, buf: *mut *mut u8) -> c_int;
+    }
+}
+extern "C" {
+    pub fn X509_CRL_new() -> *mut X509_CRL;
+    pub fn X509_CRL_free(x: *mut X509_CRL);
+    pub fn d2i_X509_CRL(
+        a: *mut *mut X509_CRL,
+        pp: *mut *const c_uchar,
+        length: c_long,
+    ) -> *mut X509_CRL;
+}
+const_ptr_api! {
+    extern "C" {
+        pub fn i2d_X509_CRL(x: #[const_ptr_if(ossl300)] X509_CRL, buf: *mut *mut u8) -> c_int;
+        #[cfg(any(ossl110, libressl270))]
+        pub fn X509_CRL_dup(x: #[const_ptr_if(ossl300)] X509_CRL) -> *mut X509_CRL;
+    }
+}
+
+extern "C" {
+    pub fn X509_REQ_new() -> *mut X509_REQ;
+    pub fn X509_REQ_free(x: *mut X509_REQ);
+    pub fn d2i_X509_REQ(
+        a: *mut *mut X509_REQ,
+        pp: *mut *const c_uchar,
+        length: c_long,
+    ) -> *mut X509_REQ;
+}
+const_ptr_api! {
+    extern "C" {
+        pub fn i2d_X509_REQ(x: #[const_ptr_if(ossl300)] X509_REQ, buf: *mut *mut u8) -> c_int;
+
+        #[cfg(any(ossl102, libressl273))]
+        pub fn X509_get0_signature(
+            psig: *mut #[const_ptr_if(any(ossl110, libressl273))] ASN1_BIT_STRING,
+            palg: *mut #[const_ptr_if(any(ossl110, libressl273))] X509_ALGOR,
+            x: *const X509,
+        );
+
+        #[cfg(any(ossl110, libressl270))]
+        pub fn X509_REQ_dup(x: #[const_ptr_if(ossl300)] X509_REQ) -> *mut X509_REQ;
+    }
+}
+extern "C" {
+    #[cfg(ossl102)]
+    pub fn X509_get_signature_nid(x: *const X509) -> c_int;
+
+    pub fn X509_EXTENSION_free(ext: *mut X509_EXTENSION);
+
+    pub fn X509_NAME_ENTRY_free(x: *mut X509_NAME_ENTRY);
+
+    pub fn X509_NAME_new() -> *mut X509_NAME;
+    pub fn X509_NAME_cmp(x: *const X509_NAME, y: *const X509_NAME) -> c_int;
+    pub fn X509_NAME_free(x: *mut X509_NAME);
+
+    pub fn X509_new() -> *mut X509;
+    pub fn X509_free(x: *mut X509);
+}
+const_ptr_api! {
+    extern "C" {
+        pub fn i2d_X509(x: #[const_ptr_if(ossl300)] X509, buf: *mut *mut u8) -> c_int;
+        #[cfg(any(ossl110, libressl270))]
+        pub fn X509_NAME_dup(x: #[const_ptr_if(ossl300)] X509_NAME) -> *mut X509_NAME;
+        #[cfg(any(ossl110, libressl270))]
+        pub fn X509_dup(x: #[const_ptr_if(ossl300)] X509) -> *mut X509;
+        #[cfg(any(ossl101, libressl350))]
+        pub fn X509_NAME_add_entry(
+            name: *mut X509_NAME,
+            ne: #[const_ptr_if(any(ossl110, libressl))] X509_NAME_ENTRY,
+            loc: c_int,
+            set: c_int,
+            ) -> c_int;
+    }
+}
+extern "C" {
+    pub fn d2i_X509(a: *mut *mut X509, pp: *mut *const c_uchar, length: c_long) -> *mut X509;
+    pub fn d2i_X509_bio(b: *mut BIO, a: *mut *mut X509) -> *mut X509;
+
+    pub fn X509_get_pubkey(x: *mut X509) -> *mut EVP_PKEY;
+
+    pub fn X509_set_version(x: *mut X509, version: c_long) -> c_int;
+    #[cfg(ossl110)]
+    pub fn X509_get_version(x: *const X509) -> c_long;
+    pub fn X509_set_serialNumber(x: *mut X509, sn: *mut ASN1_INTEGER) -> c_int;
+    pub fn X509_get_serialNumber(x: *mut X509) -> *mut ASN1_INTEGER;
+    pub fn X509_alias_get0(x: *mut X509, len: *mut c_int) -> *mut c_uchar;
+}
+const_ptr_api! {
+    extern "C" {
+        pub fn X509_set_issuer_name(x: *mut X509, name: #[const_ptr_if(ossl300)] X509_NAME) -> c_int;
+    }
+}
+extern "C" {
+    pub fn X509_issuer_name_hash(x: *mut X509) -> c_ulong;
+    pub fn X509_subject_name_hash(x: *mut X509) -> c_ulong;
+}
+const_ptr_api! {
+    extern "C" {
+        pub fn X509_get_issuer_name(x: #[const_ptr_if(any(ossl110, libressl280))] X509) -> *mut X509_NAME;
+        pub fn X509_set_subject_name(x: *mut X509, name: #[const_ptr_if(ossl300)] X509_NAME) -> c_int;
+        pub fn X509_get_subject_name(x: #[const_ptr_if(any(ossl110, libressl280))] X509) -> *mut X509_NAME;
+    }
+}
+cfg_if! {
+    if #[cfg(any(ossl110, libressl350))] {
+        extern "C" {
+            pub fn X509_set1_notBefore(x: *mut X509, tm: *const ASN1_TIME) -> c_int;
+            pub fn X509_set1_notAfter(x: *mut X509, tm: *const ASN1_TIME) -> c_int;
+        }
+    } else {
+        extern "C" {
+            pub fn X509_set_notBefore(x: *mut X509, tm: *const ASN1_TIME) -> c_int;
+            pub fn X509_set_notAfter(x: *mut X509, tm: *const ASN1_TIME) -> c_int;
+        }
+    }
+}
+extern "C" {
+    #[cfg(any(ossl110, libressl350))]
+    pub fn X509_REQ_get_version(req: *const X509_REQ) -> c_long;
+    pub fn X509_REQ_set_version(req: *mut X509_REQ, version: c_long) -> c_int;
+    #[cfg(any(ossl110, libressl350))]
+    pub fn X509_REQ_get_subject_name(req: *const X509_REQ) -> *mut X509_NAME;
+}
+const_ptr_api! {
+    extern "C" {
+        pub fn X509_REQ_set_subject_name(req: *mut X509_REQ, name: #[const_ptr_if(ossl300)] X509_NAME) -> c_int;
+    }
+}
+extern "C" {
+    pub fn X509_REQ_set_pubkey(req: *mut X509_REQ, pkey: *mut EVP_PKEY) -> c_int;
+    pub fn X509_REQ_get_pubkey(req: *mut X509_REQ) -> *mut EVP_PKEY;
+    pub fn X509_REQ_get_extensions(req: *mut X509_REQ) -> *mut stack_st_X509_EXTENSION;
+}
+const_ptr_api! {
+    extern "C" {
+        pub fn X509_REQ_add_extensions(req: *mut X509_REQ, exts: #[const_ptr_if(ossl300)] stack_st_X509_EXTENSION)
+            -> c_int;
+    }
+}
+extern "C" {
+    pub fn X509_REQ_get_attr_count(req: *const X509_REQ) -> c_int;
+    pub fn X509_REQ_get_attr_by_NID(req: *const X509_REQ, nid: c_int, lastpos: c_int) -> c_int;
+    pub fn X509_REQ_get_attr(req: *const X509_REQ, loc: c_int) -> *mut X509_ATTRIBUTE;
+    pub fn X509_REQ_delete_attr(req: *mut X509_REQ, loc: c_int) -> *mut X509_ATTRIBUTE;
+    pub fn X509_REQ_add1_attr_by_txt(
+        req: *mut X509_REQ,
+        attrname: *const c_char,
+        chtype: c_int,
+        bytes: *const c_uchar,
+        len: c_int,
+    ) -> c_int;
+    pub fn X509_REQ_add1_attr_by_NID(
+        req: *mut X509_REQ,
+        nid: c_int,
+        chtype: c_int,
+        bytes: *const c_uchar,
+        len: c_int,
+    ) -> c_int;
+    pub fn X509_REQ_add1_attr_by_OBJ(
+        req: *mut X509_REQ,
+        obj: *const ASN1_OBJECT,
+        chtype: c_int,
+        bytes: *const c_uchar,
+        len: c_int,
+    ) -> c_int;
+}
+extern "C" {
+    pub fn X509_set_pubkey(x: *mut X509, pkey: *mut EVP_PKEY) -> c_int;
+    pub fn X509_REQ_verify(req: *mut X509_REQ, pkey: *mut EVP_PKEY) -> c_int;
+    #[cfg(any(ossl110, libressl273))]
+    pub fn X509_getm_notBefore(x: *const X509) -> *mut ASN1_TIME;
+    #[cfg(any(ossl110, libressl273))]
+    pub fn X509_getm_notAfter(x: *const X509) -> *mut ASN1_TIME;
+    #[cfg(any(ossl110, libressl273))]
+    pub fn X509_up_ref(x: *mut X509) -> c_int;
+
+    #[cfg(any(ossl110, libressl270))]
+    pub fn X509_REVOKED_get0_serialNumber(req: *const X509_REVOKED) -> *const ASN1_INTEGER;
+    #[cfg(any(ossl110, libressl270))]
+    pub fn X509_REVOKED_get0_revocationDate(req: *const X509_REVOKED) -> *const ASN1_TIME;
+    #[cfg(any(ossl110, libressl270))]
+    pub fn X509_REVOKED_get0_extensions(r: *const X509_REVOKED) -> *const stack_st_X509_EXTENSION;
+
+    pub fn X509_REVOKED_set_serialNumber(r: *mut X509_REVOKED, serial: *mut ASN1_INTEGER) -> c_int;
+    pub fn X509_REVOKED_set_revocationDate(r: *mut X509_REVOKED, tm: *mut ASN1_TIME) -> c_int;
+
+    pub fn X509_CRL_sign(x: *mut X509_CRL, pkey: *mut EVP_PKEY, md: *const EVP_MD) -> c_int;
+    pub fn X509_CRL_digest(
+        x: *const X509_CRL,
+        digest: *const EVP_MD,
+        md: *mut c_uchar,
+        len: *mut c_uint,
+    ) -> c_int;
+    pub fn X509_CRL_verify(crl: *mut X509_CRL, pkey: *mut EVP_PKEY) -> c_int;
+    pub fn X509_CRL_get0_by_cert(
+        x: *mut X509_CRL,
+        ret: *mut *mut X509_REVOKED,
+        cert: *mut X509,
+    ) -> c_int;
+}
+const_ptr_api! {
+    extern "C" {
+        pub fn X509_CRL_get0_by_serial(
+            x: *mut X509_CRL,
+            ret: *mut *mut X509_REVOKED,
+            serial: #[const_ptr_if(ossl300)] ASN1_INTEGER,
+        ) -> c_int;
+    }
+}
+
+extern "C" {
+    #[cfg(any(ossl110, libressl281))]
+    pub fn X509_CRL_get_REVOKED(crl: *mut X509_CRL) -> *mut stack_st_X509_REVOKED;
+    #[cfg(any(ossl110, libressl281))]
+    pub fn X509_CRL_get0_nextUpdate(x: *const X509_CRL) -> *const ASN1_TIME;
+    #[cfg(any(ossl110, libressl281))]
+    pub fn X509_CRL_get0_lastUpdate(x: *const X509_CRL) -> *const ASN1_TIME;
+    #[cfg(any(ossl110, libressl281))]
+    pub fn X509_CRL_get_issuer(x: *const X509_CRL) -> *mut X509_NAME;
+
+    #[cfg(ossl110)]
+    pub fn X509_get0_extensions(req: *const X509) -> *const stack_st_X509_EXTENSION;
+
+    pub fn X509_CRL_set_version(crl: *mut X509_CRL, version: c_long) -> c_int;
+}
+const_ptr_api! {
+    extern "C" {
+        pub fn X509_CRL_set_issuer_name(crl: *mut X509_CRL, name: #[const_ptr_if(ossl300)] X509_NAME) -> c_int;
+    }
+}
+extern "C" {
+    pub fn X509_CRL_sort(crl: *mut X509_CRL) -> c_int;
+
+    #[cfg(any(ossl110, libressl270))]
+    pub fn X509_CRL_up_ref(crl: *mut X509_CRL) -> c_int;
+    pub fn X509_CRL_add0_revoked(crl: *mut X509_CRL, rev: *mut X509_REVOKED) -> c_int;
+}
+cfg_if! {
+    if #[cfg(any(ossl110, libressl270))] {
+        extern "C" {
+            pub fn X509_CRL_set1_lastUpdate(crl: *mut X509_CRL, tm: *const ASN1_TIME) -> c_int;
+            pub fn X509_CRL_set1_nextUpdate(crl: *mut X509_CRL, tm: *const ASN1_TIME) -> c_int;
+        }
+    } else {
+        // libressl270 kept them, ossl110 "#define"s them to the variants above
+        extern "C" {
+            pub fn X509_CRL_set_lastUpdate(crl: *mut X509_CRL, tm: *const ASN1_TIME) -> c_int;
+            pub fn X509_CRL_set_nextUpdate(crl: *mut X509_CRL, tm: *const ASN1_TIME) -> c_int;
+        }
+    }
+}
+
+const_ptr_api! {
+    extern "C" {
+        pub fn X509_NAME_entry_count(n: #[const_ptr_if(any(ossl110, libressl280))] X509_NAME) -> c_int;
+        pub fn X509_NAME_get_index_by_NID(n: #[const_ptr_if(any(ossl300, libressl280))] X509_NAME, nid: c_int, last_pos: c_int) -> c_int;
+        pub fn X509_NAME_get_entry(n: #[const_ptr_if(any(ossl110, libressl280))] X509_NAME, loc: c_int) -> *mut X509_NAME_ENTRY;
+        pub fn X509_NAME_add_entry_by_NID(
+            x: *mut X509_NAME,
+            field: c_int,
+            ty: c_int,
+            bytes: #[const_ptr_if(any(ossl110, libressl280))] c_uchar,
+            len: c_int,
+            loc: c_int,
+            set: c_int,
+        ) -> c_int;
+        pub fn i2d_X509_NAME(n: #[const_ptr_if(ossl300)] X509_NAME, buf: *mut *mut u8) -> c_int;
+        pub fn X509_NAME_ENTRY_get_object(ne: #[const_ptr_if(any(ossl110, libressl280))] X509_NAME_ENTRY) -> *mut ASN1_OBJECT;
+        pub fn X509_NAME_ENTRY_get_data(ne: #[const_ptr_if(any(ossl110, libressl280))] X509_NAME_ENTRY) -> *mut ASN1_STRING;
+    }
+}
+extern "C" {
+    pub fn X509_NAME_add_entry_by_txt(
+        x: *mut X509_NAME,
+        field: *const c_char,
+        ty: c_int,
+        bytes: *const c_uchar,
+        len: c_int,
+        loc: c_int,
+        set: c_int,
+    ) -> c_int;
+    pub fn d2i_X509_NAME(
+        n: *mut *mut X509_NAME,
+        pp: *mut *const c_uchar,
+        length: c_long,
+    ) -> *mut X509_NAME;
+}
+
+// "raw" X509_EXTENSION related functions
+extern "C" {
+    // in X509
+    pub fn X509_delete_ext(x: *mut X509, loc: c_int) -> *mut X509_EXTENSION;
+    pub fn X509_add_ext(x: *mut X509, ext: *mut X509_EXTENSION, loc: c_int) -> c_int;
+    pub fn X509_add1_ext_i2d(
+        x: *mut X509,
+        nid: c_int,
+        value: *mut c_void,
+        crit: c_int,
+        flags: c_ulong,
+    ) -> c_int;
+    // in X509_CRL
+    pub fn X509_CRL_delete_ext(x: *mut X509_CRL, loc: c_int) -> *mut X509_EXTENSION;
+    pub fn X509_CRL_add_ext(x: *mut X509_CRL, ext: *mut X509_EXTENSION, loc: c_int) -> c_int;
+    pub fn X509_CRL_add1_ext_i2d(
+        x: *mut X509_CRL,
+        nid: c_int,
+        value: *mut c_void,
+        crit: c_int,
+        flags: c_ulong,
+    ) -> c_int;
+    // in X509_REVOKED
+    pub fn X509_REVOKED_delete_ext(x: *mut X509_REVOKED, loc: c_int) -> *mut X509_EXTENSION;
+    pub fn X509_REVOKED_add_ext(
+        x: *mut X509_REVOKED,
+        ext: *mut X509_EXTENSION,
+        loc: c_int,
+    ) -> c_int;
+    pub fn X509_REVOKED_add1_ext_i2d(
+        x: *mut X509_REVOKED,
+        nid: c_int,
+        value: *mut c_void,
+        crit: c_int,
+        flags: c_ulong,
+    ) -> c_int;
+    // X509_EXTENSION stack
+    // - these getters always used *const STACK
+    pub fn X509v3_get_ext_count(x: *const stack_st_X509_EXTENSION) -> c_int;
+    pub fn X509v3_get_ext_by_NID(
+        x: *const stack_st_X509_EXTENSION,
+        nid: c_int,
+        lastpos: c_int,
+    ) -> c_int;
+    pub fn X509v3_get_ext_by_critical(
+        x: *const stack_st_X509_EXTENSION,
+        crit: c_int,
+        lastpos: c_int,
+    ) -> c_int;
+    pub fn X509v3_get_ext(x: *const stack_st_X509_EXTENSION, loc: c_int) -> *mut X509_EXTENSION;
+    pub fn X509v3_delete_ext(x: *mut stack_st_X509_EXTENSION, loc: c_int) -> *mut X509_EXTENSION;
+    pub fn X509v3_add_ext(
+        x: *mut *mut stack_st_X509_EXTENSION,
+        ex: *mut X509_EXTENSION,
+        loc: c_int,
+    ) -> *mut stack_st_X509_EXTENSION;
+    // - X509V3_add1_i2d in x509v3.rs
+    // X509_EXTENSION itself
+    pub fn X509_EXTENSION_create_by_NID(
+        ex: *mut *mut X509_EXTENSION,
+        nid: c_int,
+        crit: c_int,
+        data: *mut ASN1_OCTET_STRING,
+    ) -> *mut X509_EXTENSION;
+    pub fn X509_EXTENSION_set_critical(ex: *mut X509_EXTENSION, crit: c_int) -> c_int;
+    pub fn X509_EXTENSION_set_data(ex: *mut X509_EXTENSION, data: *mut ASN1_OCTET_STRING) -> c_int;
+    pub fn X509_EXTENSION_get_object(ext: *mut X509_EXTENSION) -> *mut ASN1_OBJECT;
+    pub fn X509_EXTENSION_get_data(ext: *mut X509_EXTENSION) -> *mut ASN1_OCTET_STRING;
+}
+
+const_ptr_api! {
+    extern "C" {
+        pub fn i2d_X509_EXTENSION(ext: #[const_ptr_if(ossl300)] X509_EXTENSION, pp: *mut *mut c_uchar) -> c_int;
+    }
+}
+
+const_ptr_api! {
+    extern "C" {
+        // in X509
+        pub fn X509_get_ext_count(x: #[const_ptr_if(any(ossl110, libressl280))] X509) -> c_int;
+        pub fn X509_get_ext_by_NID(x: #[const_ptr_if(any(ossl110, libressl280))] X509, nid: c_int, lastpos: c_int) -> c_int;
+        pub fn X509_get_ext_by_OBJ(x: #[const_ptr_if(any(ossl110, libressl280))] X509, obj: #[const_ptr_if(any(ossl110, libressl280))] ASN1_OBJECT, lastpos: c_int) -> c_int;
+        pub fn X509_get_ext_by_critical(x: #[const_ptr_if(any(ossl110, libressl280))] X509, crit: c_int, lastpos: c_int) -> c_int;
+        pub fn X509_get_ext(x: #[const_ptr_if(any(ossl110, libressl280))] X509, loc: c_int) -> *mut X509_EXTENSION;
+        pub fn X509_get_ext_d2i(
+            x: #[const_ptr_if(any(ossl110, libressl280))] X509,
+            nid: c_int,
+            crit: *mut c_int,
+            idx: *mut c_int,
+        ) -> *mut c_void;
+        // in X509_CRL
+        pub fn X509_CRL_get_ext_count(x: #[const_ptr_if(any(ossl110, libressl280))] X509_CRL) -> c_int;
+        pub fn X509_CRL_get_ext_by_NID(x: #[const_ptr_if(any(ossl110, libressl280))] X509_CRL, nid: c_int, lastpos: c_int) -> c_int;
+        pub fn X509_CRL_get_ext_by_OBJ(x: #[const_ptr_if(any(ossl110, libressl280))] X509_CRL, obj: #[const_ptr_if(any(ossl110, libressl280))] ASN1_OBJECT, lastpos: c_int) -> c_int;
+        pub fn X509_CRL_get_ext_by_critical(x: #[const_ptr_if(any(ossl110, libressl280))] X509_CRL, crit: c_int, lastpos: c_int) -> c_int;
+        pub fn X509_CRL_get_ext(x: #[const_ptr_if(any(ossl110, libressl280))] X509_CRL, loc: c_int) -> *mut X509_EXTENSION;
+        pub fn X509_CRL_get_ext_d2i(
+            x: #[const_ptr_if(any(ossl110, libressl280))] X509_CRL,
+            nid: c_int,
+            crit: *mut c_int,
+            idx: *mut c_int,
+        ) -> *mut c_void;
+        // in X509_REVOKED
+        pub fn X509_REVOKED_get_ext_count(x: #[const_ptr_if(any(ossl110, libressl280))] X509_REVOKED) -> c_int;
+        pub fn X509_REVOKED_get_ext_by_NID(x: #[const_ptr_if(any(ossl110, libressl280))] X509_REVOKED, nid: c_int, lastpos: c_int) -> c_int;
+        pub fn X509_REVOKED_get_ext_by_OBJ(x: #[const_ptr_if(any(ossl110, libressl280))] X509_REVOKED, obj: #[const_ptr_if(any(ossl110, libressl280))] ASN1_OBJECT, lastpos: c_int) -> c_int;
+        pub fn X509_REVOKED_get_ext_by_critical(x: #[const_ptr_if(any(ossl110, libressl280))] X509_REVOKED, crit: c_int, lastpos: c_int) -> c_int;
+        pub fn X509_REVOKED_get_ext(x: #[const_ptr_if(any(ossl110, libressl280))] X509_REVOKED, loc: c_int) -> *mut X509_EXTENSION;
+        pub fn X509_REVOKED_get_ext_d2i(
+            x: #[const_ptr_if(any(ossl110, libressl280))] X509_REVOKED,
+            nid: c_int,
+            crit: *mut c_int,
+            idx: *mut c_int,
+        ) -> *mut c_void;
+        // X509_EXTENSION stack
+        pub fn X509v3_get_ext_by_OBJ(x: *const stack_st_X509_EXTENSION, obj: #[const_ptr_if(any(ossl110, libressl280))] ASN1_OBJECT, lastpos: c_int) -> c_int;
+        // X509_EXTENSION itself
+        pub fn X509_EXTENSION_create_by_OBJ(ex: *mut *mut X509_EXTENSION, obj: #[const_ptr_if(any(ossl110, libressl280))] ASN1_OBJECT, crit: c_int, data: *mut ASN1_OCTET_STRING) -> *mut X509_EXTENSION;
+        pub fn X509_EXTENSION_set_object(ex: *mut X509_EXTENSION, obj: #[const_ptr_if(any(ossl110, libressl280))] ASN1_OBJECT) -> c_int;
+        pub fn X509_EXTENSION_get_critical(ex: #[const_ptr_if(any(ossl110, libressl280))] X509_EXTENSION) -> c_int;
+    }
+}
+
+extern "C" {
+    pub fn X509_verify_cert(ctx: *mut X509_STORE_CTX) -> c_int;
+}
+
+const_ptr_api! {
+    extern "C" {
+        #[cfg(any(ossl110, libressl270))]
+        pub fn X509_STORE_get0_objects(ctx: #[const_ptr_if(ossl300)] X509_STORE) -> *mut stack_st_X509_OBJECT;
+        #[cfg(ossl300)]
+        pub fn X509_STORE_get1_all_certs(ctx: *mut X509_STORE) -> *mut stack_st_X509;
+    }
+}
+
+#[cfg(any(ossl110, libressl270))]
+extern "C" {
+    pub fn X509_OBJECT_get0_X509(x: *const X509_OBJECT) -> *mut X509;
+}
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl350))] {
+        extern "C" {
+            pub fn X509_OBJECT_free(a: *mut X509_OBJECT);
+        }
+    } else {
+        extern "C" {
+            pub fn X509_OBJECT_free_contents(a: *mut X509_OBJECT);
+        }
+    }
+}
+
+extern "C" {
+    pub fn X509_get_default_cert_file_env() -> *const c_char;
+    pub fn X509_get_default_cert_file() -> *const c_char;
+    pub fn X509_get_default_cert_dir_env() -> *const c_char;
+    pub fn X509_get_default_cert_dir() -> *const c_char;
+}
+
+extern "C" {
+    pub fn X509_cmp(a: *const X509, b: *const X509) -> c_int;
+    pub fn X509_issuer_and_serial_cmp(a: *const X509, b: *const X509) -> c_int;
+    pub fn X509_issuer_name_cmp(a: *const X509, b: *const X509) -> c_int;
+    pub fn X509_subject_name_cmp(a: *const X509, b: *const X509) -> c_int;
+    pub fn X509_CRL_cmp(a: *const X509_CRL, b: *const X509_CRL) -> c_int;
+    pub fn X509_CRL_match(a: *const X509_CRL, b: *const X509_CRL) -> c_int;
+}
+
+extern "C" {
+    pub fn X509_print(bio: *mut BIO, x509: *mut X509) -> c_int;
+    pub fn X509_REQ_print(bio: *mut BIO, req: *mut X509_REQ) -> c_int;
+}
+
+cfg_if! {
+    if #[cfg(libressl390)] {
+        pub enum X509_PURPOSE {}
+    } else {
+        #[repr(C)]
+        pub struct X509_PURPOSE {
+            pub purpose: c_int,
+            pub trust: c_int, // Default trust ID
+            pub flags: c_int,
+            pub check_purpose:
+                Option<unsafe extern "C" fn(*const X509_PURPOSE, *const X509, c_int) -> c_int>,
+            pub name: *mut c_char,
+            pub sname: *mut c_char,
+            pub usr_data: *mut c_void,
+        }
+    }
+}
+
+const_ptr_api! {
+    extern "C" {
+        pub fn X509_PURPOSE_get_by_sname(sname: #[const_ptr_if(any(ossl110, libressl280))] c_char) -> c_int;
+        pub fn X509_PURPOSE_get_id(purpose: #[const_ptr_if(any(ossl110, libressl280))] X509_PURPOSE) -> c_int;
+        pub fn X509_PURPOSE_get0(idx: c_int) -> #[const_ptr_if(libressl390)] X509_PURPOSE;
+    }
+}
+
+extern "C" {
+    pub fn X509_ATTRIBUTE_new() -> *mut X509_ATTRIBUTE;
+    pub fn X509_ATTRIBUTE_free(attr: *mut X509_ATTRIBUTE);
+    pub fn X509_ATTRIBUTE_create(
+        nid: c_int,
+        atrtype: c_int,
+        value: *mut c_void,
+    ) -> *mut X509_ATTRIBUTE;
+    pub fn X509_ATTRIBUTE_create_by_NID(
+        attr: *mut *mut X509_ATTRIBUTE,
+        nid: c_int,
+        atrtype: c_int,
+        data: *const c_void,
+        len: c_int,
+    ) -> *mut X509_ATTRIBUTE;
+    pub fn X509_ATTRIBUTE_create_by_OBJ(
+        attr: *mut *mut X509_ATTRIBUTE,
+        obj: *const ASN1_OBJECT,
+        atrtype: c_int,
+        data: *const c_void,
+        len: c_int,
+    ) -> *mut X509_ATTRIBUTE;
+    pub fn X509_ATTRIBUTE_create_by_txt(
+        attr: *mut *mut X509_ATTRIBUTE,
+        atrname: *const c_char,
+        atrtype: c_int,
+        bytes: *const c_uchar,
+        len: c_int,
+    ) -> *mut X509_ATTRIBUTE;
+    pub fn X509_ATTRIBUTE_set1_object(attr: *mut X509_ATTRIBUTE, obj: *const ASN1_OBJECT) -> c_int;
+    pub fn X509_ATTRIBUTE_set1_data(
+        attr: *mut X509_ATTRIBUTE,
+        attrtype: c_int,
+        data: *const c_void,
+        len: c_int,
+    ) -> c_int;
+    pub fn X509_ATTRIBUTE_get0_data(
+        attr: *mut X509_ATTRIBUTE,
+        idx: c_int,
+        atrtype: c_int,
+        data: *mut c_void,
+    ) -> *mut c_void;
+    pub fn X509_ATTRIBUTE_get0_object(attr: *mut X509_ATTRIBUTE) -> *mut ASN1_OBJECT;
+    pub fn X509_ATTRIBUTE_get0_type(attr: *mut X509_ATTRIBUTE, idx: c_int) -> *mut ASN1_TYPE;
+    pub fn d2i_X509_ATTRIBUTE(
+        a: *mut *mut X509_ATTRIBUTE,
+        pp: *mut *const c_uchar,
+        length: c_long,
+    ) -> *mut X509_ATTRIBUTE;
+}
+const_ptr_api! {
+    extern "C" {
+        pub fn X509_ATTRIBUTE_count(
+            attr: #[const_ptr_if(any(ossl110, libressl280))] X509_ATTRIBUTE // const since OpenSSL v1.1.0
+        ) -> c_int;
+        pub fn i2d_X509_ATTRIBUTE(x: #[const_ptr_if(ossl300)] X509_ATTRIBUTE, buf: *mut *mut u8) -> c_int;
+        pub fn X509_ATTRIBUTE_dup(x: #[const_ptr_if(ossl300)] X509_ATTRIBUTE) -> *mut X509_ATTRIBUTE;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/x509_vfy.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/x509_vfy.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/x509_vfy.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/x509_vfy.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,138 @@
+use super::super::*;
+use libc::*;
+
+#[cfg(any(libressl, all(ossl102, not(ossl110))))]
+pub enum X509_VERIFY_PARAM_ID {}
+
+extern "C" {
+    #[cfg(ossl110)]
+    pub fn X509_LOOKUP_meth_free(method: *mut X509_LOOKUP_METHOD);
+}
+
+extern "C" {
+    pub fn X509_LOOKUP_free(ctx: *mut X509_LOOKUP);
+    pub fn X509_LOOKUP_hash_dir() -> *mut X509_LOOKUP_METHOD;
+    pub fn X509_LOOKUP_file() -> *mut X509_LOOKUP_METHOD;
+    pub fn X509_LOOKUP_ctrl(
+        ctx: *mut X509_LOOKUP,
+        cmd: c_int,
+        argc: *const c_char,
+        argl: c_long,
+        ret: *mut *mut c_char,
+    ) -> c_int;
+    pub fn X509_load_cert_file(ctx: *mut X509_LOOKUP, file: *const c_char, _type: c_int) -> c_int;
+    pub fn X509_load_crl_file(ctx: *mut X509_LOOKUP, file: *const c_char, _type: c_int) -> c_int;
+}
+
+extern "C" {
+    pub fn X509_STORE_new() -> *mut X509_STORE;
+    pub fn X509_STORE_free(store: *mut X509_STORE);
+
+    pub fn X509_STORE_CTX_new() -> *mut X509_STORE_CTX;
+
+    pub fn X509_STORE_CTX_free(ctx: *mut X509_STORE_CTX);
+    pub fn X509_STORE_CTX_init(
+        ctx: *mut X509_STORE_CTX,
+        store: *mut X509_STORE,
+        x509: *mut X509,
+        chain: *mut stack_st_X509,
+    ) -> c_int;
+    pub fn X509_STORE_CTX_cleanup(ctx: *mut X509_STORE_CTX);
+
+    pub fn X509_STORE_add_cert(store: *mut X509_STORE, x: *mut X509) -> c_int;
+
+    pub fn X509_STORE_add_lookup(
+        store: *mut X509_STORE,
+        meth: *mut X509_LOOKUP_METHOD,
+    ) -> *mut X509_LOOKUP;
+
+    pub fn X509_STORE_set_default_paths(store: *mut X509_STORE) -> c_int;
+    pub fn X509_STORE_set_flags(store: *mut X509_STORE, flags: c_ulong) -> c_int;
+    pub fn X509_STORE_set_purpose(ctx: *mut X509_STORE, purpose: c_int) -> c_int;
+    pub fn X509_STORE_set_trust(ctx: *mut X509_STORE, trust: c_int) -> c_int;
+
+}
+
+const_ptr_api! {
+    extern "C" {
+        pub fn X509_STORE_set1_param(store: *mut X509_STORE, pm: #[const_ptr_if(ossl300)] X509_VERIFY_PARAM) -> c_int;
+    }
+}
+
+const_ptr_api! {
+    extern "C" {
+        pub fn X509_STORE_CTX_get_ex_data(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX, idx: c_int) -> *mut c_void;
+        pub fn X509_STORE_CTX_get_error(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> c_int;
+        pub fn X509_STORE_CTX_get_error_depth(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> c_int;
+        pub fn X509_STORE_CTX_get_current_cert(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> *mut X509;
+    }
+}
+extern "C" {
+    pub fn X509_STORE_CTX_set_error(ctx: *mut X509_STORE_CTX, error: c_int);
+}
+cfg_if! {
+    if #[cfg(any(ossl110, libressl350))] {
+        const_ptr_api! {
+            extern "C" {
+                pub fn X509_STORE_CTX_get0_chain(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> *mut stack_st_X509;
+            }
+        }
+    } else {
+        extern "C" {
+            pub fn X509_STORE_CTX_get_chain(ctx: *mut X509_STORE_CTX) -> *mut stack_st_X509;
+        }
+    }
+}
+
+extern "C" {
+    #[cfg(any(ossl102, libressl261))]
+    pub fn X509_VERIFY_PARAM_new() -> *mut X509_VERIFY_PARAM;
+    #[cfg(any(ossl102, libressl261))]
+    pub fn X509_VERIFY_PARAM_free(param: *mut X509_VERIFY_PARAM);
+
+    #[cfg(any(ossl102, libressl261))]
+    pub fn X509_VERIFY_PARAM_set_flags(param: *mut X509_VERIFY_PARAM, flags: c_ulong) -> c_int;
+    #[cfg(any(ossl102, libressl261))]
+    pub fn X509_VERIFY_PARAM_clear_flags(param: *mut X509_VERIFY_PARAM, flags: c_ulong) -> c_int;
+
+    #[cfg(any(ossl102, libressl261))]
+    pub fn X509_VERIFY_PARAM_set_time(param: *mut X509_VERIFY_PARAM, t: time_t);
+
+    #[cfg(any(ossl102, libressl261))]
+    pub fn X509_VERIFY_PARAM_set_depth(param: *mut X509_VERIFY_PARAM, depth: c_int);
+}
+const_ptr_api! {
+    extern "C" {
+        #[cfg(any(ossl102, libressl261))]
+        pub fn X509_VERIFY_PARAM_get_flags(param: #[const_ptr_if(ossl300)] X509_VERIFY_PARAM) -> c_ulong;
+    }
+}
+
+extern "C" {
+    #[cfg(any(ossl102, libressl261))]
+    pub fn X509_VERIFY_PARAM_set1_host(
+        param: *mut X509_VERIFY_PARAM,
+        name: *const c_char,
+        namelen: size_t,
+    ) -> c_int;
+    #[cfg(any(ossl102, libressl261))]
+    pub fn X509_VERIFY_PARAM_set_hostflags(param: *mut X509_VERIFY_PARAM, flags: c_uint);
+    #[cfg(any(ossl102, libressl261))]
+    pub fn X509_VERIFY_PARAM_set1_email(
+        param: *mut X509_VERIFY_PARAM,
+        email: *const c_char,
+        emaillen: size_t,
+    ) -> c_int;
+    #[cfg(any(ossl102, libressl261))]
+    pub fn X509_VERIFY_PARAM_set1_ip(
+        param: *mut X509_VERIFY_PARAM,
+        ip: *const c_uchar,
+        iplen: size_t,
+    ) -> c_int;
+    #[cfg(ossl110)]
+    pub fn X509_VERIFY_PARAM_set_auth_level(param: *mut X509_VERIFY_PARAM, lvl: c_int);
+    #[cfg(ossl110)]
+    pub fn X509_VERIFY_PARAM_get_auth_level(param: *const X509_VERIFY_PARAM) -> c_int;
+    #[cfg(ossl102)]
+    pub fn X509_VERIFY_PARAM_set_purpose(param: *mut X509_VERIFY_PARAM, purpose: c_int) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/x509v3.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/x509v3.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/handwritten/x509v3.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/handwritten/x509v3.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,167 @@
+use super::super::*;
+use libc::*;
+
+pub enum CONF_METHOD {}
+
+extern "C" {
+    pub fn GENERAL_NAME_new() -> *mut GENERAL_NAME;
+    pub fn GENERAL_NAME_free(name: *mut GENERAL_NAME);
+    pub fn GENERAL_NAME_set0_othername(
+        gen: *mut GENERAL_NAME,
+        oid: *mut ASN1_OBJECT,
+        value: *mut ASN1_TYPE,
+    ) -> c_int;
+}
+
+#[repr(C)]
+pub struct ACCESS_DESCRIPTION {
+    pub method: *mut ASN1_OBJECT,
+    pub location: *mut GENERAL_NAME,
+}
+
+stack!(stack_st_ACCESS_DESCRIPTION);
+
+extern "C" {
+    pub fn ACCESS_DESCRIPTION_free(ad: *mut ACCESS_DESCRIPTION);
+}
+
+#[repr(C)]
+pub struct AUTHORITY_KEYID {
+    pub keyid: *mut ASN1_OCTET_STRING,
+    pub issuer: *mut stack_st_GENERAL_NAME,
+    pub serial: *mut ASN1_INTEGER,
+}
+
+extern "C" {
+    pub fn AUTHORITY_KEYID_free(akid: *mut AUTHORITY_KEYID);
+}
+
+const_ptr_api! {
+    extern "C" {
+        pub fn X509V3_EXT_nconf_nid(
+            conf: *mut CONF,
+            ctx: *mut X509V3_CTX,
+            ext_nid: c_int,
+            value: #[const_ptr_if(any(ossl110, libressl280))] c_char,
+        ) -> *mut X509_EXTENSION;
+        pub fn X509V3_EXT_nconf(
+            conf: *mut CONF,
+            ctx: *mut X509V3_CTX,
+            name: #[const_ptr_if(any(ossl110, libressl280))] c_char,
+            value: #[const_ptr_if(any(ossl110, libressl280))] c_char,
+        ) -> *mut X509_EXTENSION;
+    }
+}
+
+extern "C" {
+    pub fn X509_check_issued(issuer: *mut X509, subject: *mut X509) -> c_int;
+    pub fn X509_verify(req: *mut X509, pkey: *mut EVP_PKEY) -> c_int;
+
+    pub fn X509V3_set_nconf(ctx: *mut X509V3_CTX, conf: *mut CONF);
+
+    pub fn X509V3_set_ctx(
+        ctx: *mut X509V3_CTX,
+        issuer: *mut X509,
+        subject: *mut X509,
+        req: *mut X509_REQ,
+        crl: *mut X509_CRL,
+        flags: c_int,
+    );
+
+    pub fn X509_get1_ocsp(x: *mut X509) -> *mut stack_st_OPENSSL_STRING;
+}
+
+const_ptr_api! {
+    extern "C" {
+        pub fn X509V3_get_d2i(
+            x: #[const_ptr_if(any(ossl110, libressl280))] stack_st_X509_EXTENSION,
+            nid: c_int,
+            crit: *mut c_int,
+            idx: *mut c_int,
+        ) -> *mut c_void;
+        pub fn X509V3_extensions_print(out: *mut BIO, title: #[const_ptr_if(any(ossl110, libressl280))] c_char, exts: #[const_ptr_if(any(ossl110, libressl280))] stack_st_X509_EXTENSION, flag: c_ulong, indent: c_int) -> c_int;
+    }
+}
+
+extern "C" {
+    #[cfg(not(libressl390))]
+    pub fn X509V3_EXT_add_alias(nid_to: c_int, nid_from: c_int) -> c_int;
+    pub fn X509V3_EXT_d2i(ext: *mut X509_EXTENSION) -> *mut c_void;
+    pub fn X509V3_EXT_i2d(ext_nid: c_int, crit: c_int, ext: *mut c_void) -> *mut X509_EXTENSION;
+    pub fn X509V3_add1_i2d(
+        x: *mut *mut stack_st_X509_EXTENSION,
+        nid: c_int,
+        value: *mut c_void,
+        crit: c_int,
+        flags: c_ulong,
+    ) -> c_int;
+    pub fn X509V3_EXT_print(
+        out: *mut BIO,
+        ext: *mut X509_EXTENSION,
+        flag: c_ulong,
+        indent: c_int,
+    ) -> c_int;
+
+    #[cfg(ossl110)]
+    pub fn X509_get_pathlen(x: *mut X509) -> c_long;
+    #[cfg(ossl110)]
+    pub fn X509_get_extension_flags(x: *mut X509) -> u32;
+    #[cfg(ossl110)]
+    pub fn X509_get_key_usage(x: *mut X509) -> u32;
+    #[cfg(ossl110)]
+    pub fn X509_get_extended_key_usage(x: *mut X509) -> u32;
+    #[cfg(ossl110)]
+    pub fn X509_get0_subject_key_id(x: *mut X509) -> *const ASN1_OCTET_STRING;
+    #[cfg(ossl110)]
+    pub fn X509_get0_authority_key_id(x: *mut X509) -> *const ASN1_OCTET_STRING;
+    #[cfg(ossl111d)]
+    pub fn X509_get0_authority_issuer(x: *mut X509) -> *const stack_st_GENERAL_NAME;
+    #[cfg(ossl111d)]
+    pub fn X509_get0_authority_serial(x: *mut X509) -> *const ASN1_INTEGER;
+}
+
+#[repr(C)]
+pub struct DIST_POINT_NAME {
+    pub type_: c_int,
+    pub name: DIST_POINT_NAME_st_anon_union,
+    pub dpname: *mut X509_NAME,
+}
+
+#[repr(C)]
+pub union DIST_POINT_NAME_st_anon_union {
+    pub fullname: *mut stack_st_GENERAL_NAME,
+    pub relativename: *mut stack_st_X509_NAME_ENTRY,
+}
+
+#[repr(C)]
+pub struct DIST_POINT {
+    pub distpoint: *mut DIST_POINT_NAME,
+    pub reasons: *mut ASN1_BIT_STRING,
+    pub CRLissuer: *mut stack_st_GENERAL_NAME,
+    pub dp_reasons: c_int,
+}
+stack!(stack_st_DIST_POINT);
+
+extern "C" {
+    pub fn DIST_POINT_free(dist_point: *mut DIST_POINT);
+    pub fn DIST_POINT_NAME_free(dist_point: *mut DIST_POINT_NAME);
+}
+
+#[cfg(ossl102)]
+extern "C" {
+    pub fn X509_check_host(
+        x: *mut X509,
+        chk: *const c_char,
+        chklen: usize,
+        flags: c_uint,
+        peername: *mut *mut c_char,
+    ) -> c_int;
+    pub fn X509_check_email(
+        x: *mut X509,
+        chk: *const c_char,
+        chklen: usize,
+        flags: c_uint,
+    ) -> c_int;
+    pub fn X509_check_ip(x: *mut X509, chk: *const c_uchar, chklen: usize, flags: c_uint) -> c_int;
+    pub fn X509_check_ip_asc(x: *mut X509, ipasc: *const c_char, flags: c_uint) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/lib.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,209 @@
+#![allow(
+    clippy::missing_safety_doc,
+    dead_code,
+    non_camel_case_types,
+    non_snake_case,
+    non_upper_case_globals,
+    unused_imports
+)]
+#![cfg_attr(feature = "unstable_boringssl", allow(ambiguous_glob_reexports))]
+#![doc(html_root_url = "https://docs.rs/openssl-sys/0.9")]
+#![recursion_limit = "128"] // configure fixed limit across all rust versions
+
+extern crate libc;
+pub use libc::c_int;
+
+#[cfg(feature = "unstable_boringssl")]
+extern crate bssl_sys;
+#[cfg(feature = "unstable_boringssl")]
+pub use bssl_sys::*;
+
+#[cfg(all(boringssl, not(feature = "unstable_boringssl")))]
+#[path = "."]
+mod boringssl {
+    include!(concat!(env!("OUT_DIR"), "/bindgen.rs"));
+
+    pub fn init() {
+        unsafe {
+            CRYPTO_library_init();
+        }
+    }
+}
+#[cfg(all(boringssl, not(feature = "unstable_boringssl")))]
+pub use boringssl::*;
+
+#[cfg(openssl)]
+#[path = "."]
+mod openssl {
+    use libc::*;
+
+    #[cfg(feature = "bindgen")]
+    include!(concat!(env!("OUT_DIR"), "/bindgen.rs"));
+
+    pub use self::aes::*;
+    pub use self::asn1::*;
+    pub use self::bio::*;
+    pub use self::bn::*;
+    pub use self::cms::*;
+    pub use self::crypto::*;
+    pub use self::dtls1::*;
+    pub use self::ec::*;
+    pub use self::err::*;
+    pub use self::evp::*;
+    #[cfg(not(feature = "bindgen"))]
+    pub use self::handwritten::*;
+    pub use self::obj_mac::*;
+    pub use self::ocsp::*;
+    pub use self::pem::*;
+    pub use self::pkcs7::*;
+    pub use self::rsa::*;
+    pub use self::sha::*;
+    pub use self::srtp::*;
+    pub use self::ssl::*;
+    pub use self::ssl3::*;
+    pub use self::tls1::*;
+    pub use self::types::*;
+    pub use self::x509::*;
+    pub use self::x509_vfy::*;
+    pub use self::x509v3::*;
+
+    #[macro_use]
+    mod macros;
+
+    mod aes;
+    mod asn1;
+    mod bio;
+    mod bn;
+    mod cms;
+    mod crypto;
+    mod dtls1;
+    mod ec;
+    mod err;
+    mod evp;
+    #[cfg(not(feature = "bindgen"))]
+    mod handwritten;
+    mod obj_mac;
+    mod ocsp;
+    mod pem;
+    mod pkcs7;
+    mod rsa;
+    mod sha;
+    mod srtp;
+    mod ssl;
+    mod ssl3;
+    mod tls1;
+    mod types;
+    mod x509;
+    mod x509_vfy;
+    mod x509v3;
+
+    use std::sync::Once;
+    // explicitly initialize to work around https://github.com/openssl/openssl/issues/3505
+    static INIT: Once = Once::new();
+
+    // FIXME remove
+    pub type PasswordCallback = unsafe extern "C" fn(
+        buf: *mut c_char,
+        size: c_int,
+        rwflag: c_int,
+        user_data: *mut c_void,
+    ) -> c_int;
+
+    #[cfg(ossl110)]
+    pub fn init() {
+        use std::ptr;
+
+        #[cfg(not(ossl111b))]
+        let init_options = OPENSSL_INIT_LOAD_SSL_STRINGS;
+        #[cfg(ossl111b)]
+        let init_options = OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_NO_ATEXIT;
+
+        INIT.call_once(|| unsafe {
+            OPENSSL_init_ssl(init_options, ptr::null_mut());
+        })
+    }
+
+    #[cfg(not(ossl110))]
+    pub fn init() {
+        use std::io::{self, Write};
+        use std::mem;
+        use std::process;
+        use std::sync::{Mutex, MutexGuard};
+
+        static mut MUTEXES: *mut Vec<Mutex<()>> = 0 as *mut Vec<Mutex<()>>;
+        static mut GUARDS: *mut Vec<Option<MutexGuard<'static, ()>>> =
+            0 as *mut Vec<Option<MutexGuard<'static, ()>>>;
+
+        unsafe extern "C" fn locking_function(
+            mode: c_int,
+            n: c_int,
+            _file: *const c_char,
+            _line: c_int,
+        ) {
+            let mutex = &(*MUTEXES)[n as usize];
+
+            if mode & CRYPTO_LOCK != 0 {
+                (*GUARDS)[n as usize] = Some(mutex.lock().unwrap());
+            } else {
+                if let None = (*GUARDS)[n as usize].take() {
+                    let _ = writeln!(
+                        io::stderr(),
+                        "BUG: rust-openssl lock {} already unlocked, aborting",
+                        n
+                    );
+                    process::abort();
+                }
+            }
+        }
+
+        cfg_if! {
+            if #[cfg(unix)] {
+                fn set_id_callback() {
+                    unsafe extern "C" fn thread_id() -> c_ulong {
+                        ::libc::pthread_self() as c_ulong
+                    }
+
+                    unsafe {
+                        CRYPTO_set_id_callback__fixed_rust(Some(thread_id));
+                    }
+                }
+            } else {
+                fn set_id_callback() {}
+            }
+        }
+
+        INIT.call_once(|| unsafe {
+            SSL_library_init();
+            SSL_load_error_strings();
+            OPENSSL_add_all_algorithms_noconf();
+
+            let num_locks = CRYPTO_num_locks();
+            let mut mutexes = Box::new(Vec::new());
+            for _ in 0..num_locks {
+                mutexes.push(Mutex::new(()));
+            }
+            MUTEXES = mem::transmute(mutexes);
+            let guards: Box<Vec<Option<MutexGuard<()>>>> =
+                Box::new((0..num_locks).map(|_| None).collect());
+            GUARDS = mem::transmute(guards);
+
+            CRYPTO_set_locking_callback__fixed_rust(Some(locking_function));
+            set_id_callback();
+        })
+    }
+
+    /// Disable explicit initialization of the openssl libs.
+    ///
+    /// This is only appropriate to use if the openssl crate is being consumed by an application
+    /// that will be performing the initialization explicitly.
+    ///
+    /// # Safety
+    ///
+    /// In some versions of openssl, skipping initialization will fall back to the default procedure
+    /// while other will cause difficult to debug errors so care must be taken when calling this.
+    pub unsafe fn assume_init() {
+        INIT.call_once(|| {});
+    }
+}
+#[cfg(openssl)]
+pub use openssl::*;
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/macros.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/macros.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/macros.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/macros.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,280 @@
+#![allow(unused_macros)]
+
+// vendored from the cfg-if crate to avoid breaking ctest
+macro_rules! cfg_if {
+    // match if/else chains with a final `else`
+    ($(
+        if #[cfg($($meta:meta),*)] { $($it:item)* }
+    ) else * else {
+        $($it2:item)*
+    }) => {
+        cfg_if! {
+            @__items
+            () ;
+            $( ( ($($meta),*) ($($it)*) ), )*
+            ( () ($($it2)*) ),
+        }
+    };
+
+    // match if/else chains lacking a final `else`
+    (
+        if #[cfg($($i_met:meta),*)] { $($i_it:item)* }
+        $(
+            else if #[cfg($($e_met:meta),*)] { $($e_it:item)* }
+        )*
+    ) => {
+        cfg_if! {
+            @__items
+            () ;
+            ( ($($i_met),*) ($($i_it)*) ),
+            $( ( ($($e_met),*) ($($e_it)*) ), )*
+            ( () () ),
+        }
+    };
+
+    // Internal and recursive macro to emit all the items
+    //
+    // Collects all the negated cfgs in a list at the beginning and after the
+    // semicolon is all the remaining items
+    (@__items ($($not:meta,)*) ; ) => {};
+    (@__items ($($not:meta,)*) ; ( ($($m:meta),*) ($($it:item)*) ), $($rest:tt)*) => {
+        // Emit all items within one block, applying an appropriate #[cfg]. The
+        // #[cfg] will require all `$m` matchers specified and must also negate
+        // all previous matchers.
+        cfg_if! { @__apply cfg(all($($m,)* not(any($($not),*)))), $($it)* }
+
+        // Recurse to emit all other items in `$rest`, and when we do so add all
+        // our `$m` matchers to the list of `$not` matchers as future emissions
+        // will have to negate everything we just matched as well.
+        cfg_if! { @__items ($($not,)* $($m,)*) ; $($rest)* }
+    };
+
+    // Internal macro to Apply a cfg attribute to a list of items
+    (@__apply $m:meta, $($it:item)*) => {
+        $(#[$m] $it)*
+    };
+}
+
+macro_rules! stack {
+    ($t:ident) => {
+        cfg_if! {
+            if #[cfg(any(ossl110, libressl390))] {
+                pub enum $t {}
+            } else {
+                #[repr(C)]
+                pub struct $t {
+                    pub stack: $crate::_STACK,
+                }
+            }
+        }
+    };
+}
+
+// openssl changes `*mut` to `*const` in certain parameters in certain versions;
+// in C this is ABI and (mostly) API compatible.
+//
+// We need to handle this explicitly, and this macro helps annotate which
+// parameter got converted in which version.
+//
+// Input is:
+//    extern "C" {
+//        #[attributes...]
+//        pub fn name(args) -> rettype; // `-> rettype` optional
+//        // more functions...
+//    }
+//
+// This macro replaces `#[const_ptr_if(...)]` in types with `*const` or `*mut`
+// (depending on the inner cfg flags)
+//
+// Walks through all argument and return types, but only finds inner types of
+// `*const` and `*mut`; doesn't walk arrays or generics.
+//
+// NOTE: can't abstract `pub` as `$fn_vis:vis`, as ctest macro handling doesn't
+// support it (old syntax crate). But we really only need `pub` anyway.
+//
+// NOTE: ctest seams to simply ignore macros it can't expand (whatever the
+// reason)
+macro_rules! const_ptr_api {
+    // ----------------------------------------------------------------
+    // (partialarg): partial argument, waiting for "final" argument type
+    // MAGIC PART 1: hande conditional const ptr in argument type
+    ( (partialarg)
+        { $(#[$fn_attr:meta])* pub fn $fn_name:ident }
+        $args_packed:tt
+        [ $($part_arg:tt)* ]
+        [ #[const_ptr_if( $($cfg:tt)* )] $($arg_rem:tt)* ]
+        $ret_packed:tt
+    ) => {
+        const_ptr_api!( (partialarg) { #[cfg($($cfg)*)]      $(#[$fn_attr])* pub fn $fn_name } $args_packed [ $($part_arg)* *const ] [ $($arg_rem)* ] $ret_packed );
+        const_ptr_api!( (partialarg) { #[cfg(not($($cfg)*))] $(#[$fn_attr])* pub fn $fn_name } $args_packed [ $($part_arg)* *mut   ] [ $($arg_rem)* ] $ret_packed );
+    };
+    // continue partial argument with `*mut` pointer (might need special const handling in inner type)
+    ( (partialarg)
+        $def_packed:tt
+        $args_packed:tt
+        [ $($part_arg:tt)* ]
+        [ *mut $($arg_rem:tt)* ]
+        $ret_packed:tt
+    ) => {
+        const_ptr_api!( (partialarg) $def_packed $args_packed [ $($part_arg)* *mut ] [ $($arg_rem)* ] $ret_packed );
+    };
+    // continue partial argument with `*const` pointer (might need special const handling in inner type)
+    ( (partialarg)
+        $def_packed:tt
+        $args_packed:tt
+        [ $($part_arg:tt)* ]
+        [ *const $($arg_rem:tt)* ]
+        $ret_packed:tt
+    ) => {
+        const_ptr_api!( (partialarg) $def_packed $args_packed [ $($part_arg)* *const ] [ $($arg_rem)* ] $ret_packed );
+    };
+    // finish partial argument with trailing comma
+    ( (partialarg)
+        $def_packed:tt
+        { $($args_tt:tt)* }
+        [ $($part_arg:tt)* ]
+        [ $arg_ty:ty, $($arg_rem:tt)* ]
+        $ret_packed:tt
+    ) => {
+        const_ptr_api!( (parseargs) $def_packed { $($args_tt)* { $($part_arg)* $arg_ty } } [ $($arg_rem)* ] $ret_packed );
+    };
+    // finish final partial argument (no trailing comma)
+    ( (partialarg)
+        $def_packed:tt
+        { $($args_tt:tt)* }
+        [ $($part_arg:tt)* ]
+        [ $arg_ty:ty ]
+        $ret_packed:tt
+    ) => {
+        const_ptr_api!( (parseargs) $def_packed { $($args_tt)* { $($part_arg)* $arg_ty } } [ ] $ret_packed );
+    };
+
+    // ----------------------------------------------------------------
+    // (parseargs): parsing arguments
+    // start next argument
+    ( (parseargs)
+        $def_packed:tt
+        $args_packed:tt
+        [ $arg_name:ident : $($arg_rem:tt)* ]
+        $ret_packed:tt
+    ) => {
+        const_ptr_api!( (partialarg) $def_packed $args_packed [ $arg_name: ] [ $($arg_rem)* ] $ret_packed );
+    };
+    // end of arguments, there is a return type; start parsing it
+    ( (parseargs)
+        $def_packed:tt
+        $args_packed:tt
+        [ ]
+        [ -> $($rem:tt)* ]
+    ) => {
+        const_ptr_api!( (partialret) $def_packed $args_packed [] [ $($rem)* ] );
+    };
+    // end of arguments, no return type
+    ( (parseargs)
+        $def_packed:tt
+        $args_packed:tt
+        [ ]
+        [ ]
+    ) => {
+        const_ptr_api!( (generate) $def_packed $args_packed { () } );
+    };
+
+    // ----------------------------------------------------------------
+    // (partialret): have partial return type, waiting for final return type
+    // MAGIC PART 2: hande conditional const ptr in return type
+    ( (partialret)
+        { $(#[$fn_attr:meta])* pub fn $fn_name:ident }
+        $args_packed:tt
+        [ $($part_ret:tt)* ]
+        [ #[const_ptr_if( $($cfg:tt)* )] $($rem:tt)* ]
+    ) => {
+        const_ptr_api!( (partialret) { #[cfg($($cfg)*)]      $(#[$fn_attr])* pub fn $fn_name } $args_packed [ $($part_ret)* *const ] [ $($rem)* ] );
+        const_ptr_api!( (partialret) { #[cfg(not($($cfg)*))] $(#[$fn_attr])* pub fn $fn_name } $args_packed [ $($part_ret)* *mut   ] [ $($rem)* ] );
+    };
+    // `* mut` part in return type; continue parsing to find inner conditional const ptr
+    ( (partialret)
+        $def_packed:tt
+        $args_packed:tt
+        [ $($part_ret:tt)* ]
+        [ *mut $($rem:tt)* ]
+    ) => {
+        const_ptr_api!( (partialret) $def_packed $args_packed [ $($part_ret)* *mut ] [ $($rem)* ] );
+    };
+    // `* const` part in return type; continue parsing to find inner conditional const ptr
+    ( (partialret)
+        $def_packed:tt
+        $args_packed:tt
+        [ $($part_ret:tt)* ]
+        [ *const $($rem:tt)* ]
+    ) => {
+        const_ptr_api!( (partialret) $def_packed $args_packed [ $($part_ret)* *const ] [ $($rem)* ] );
+    };
+    // final part of return type
+    ( (partialret)
+        $def_packed:tt
+        $args_packed:tt
+        [ $($part_ret:tt)* ]
+        [ $ret_ty:ty ]
+    ) => {
+        const_ptr_api!( (generate) $def_packed $args_packed { $($part_ret)* $ret_ty } );
+    };
+
+    // ----------------------------------------------------------------
+    // generate
+    ( (generate)
+        { $(#[$fn_attr:meta])* pub fn $fn_name:ident }
+        { $({ $arg_name:ident: $($arg_ty:tt)* })* }
+        { $ret_ty:ty }
+    ) => {
+        extern "C" {
+            $(#[$fn_attr])*
+            pub fn $fn_name( $(
+                $arg_name: $($arg_ty)*
+            ),* ) -> $ret_ty;
+        }
+    };
+
+    // ----------------------------------------------------------------
+    // (fn): gather tokens for return type until ";"
+    // found end; start parsing current function, and parse remaining functions
+    ( (fn)
+        $def_packed:tt
+        $arg_tts_packed:tt
+        $ret_packed:tt
+        [ ; $($rem:tt)* ]
+    ) => {
+        const_ptr_api!( (parseargs) $def_packed {} $arg_tts_packed $ret_packed );
+        const_ptr_api!( (extern) [ $($rem)* ] );
+    };
+    // not ";" - all other tokens are part of the return type.
+    // don't expand return type yet; otherwise we'd have to remember in which branch `rem` needs
+    // to be used to parse further functions.
+    ( (fn)
+        $def_packed:tt
+        $arg_tts_packed:tt
+        [ $($ret_tt:tt)* ]
+        [ $tt:tt $($rem:tt)* ]
+    ) => {
+        const_ptr_api!( (fn) $def_packed $arg_tts_packed [ $($ret_tt)* $tt ] [ $($rem)* ] );
+    };
+
+    // ----------------------------------------------------------------
+    // (extern): in extern block, find next function
+    // try to split into functions as fast as possible to reduce recursion depth
+    ( (extern) [
+        $(#[$fn_attr:meta])*
+        pub fn $fn_name:ident( $($arg_rem:tt)* ) $($rem:tt)*
+    ] ) => {
+        const_ptr_api!( (fn)
+            { $(#[$fn_attr])* pub fn $fn_name } [ $($arg_rem)* ] [] [ $($rem)* ]
+        );
+    };
+    // end of extern block
+    ( (extern) [] ) => {};
+
+    // ----------------------------------------------------------------
+    // macro start; find extern block
+    ( extern "C" { $($rem:tt)* } ) => {
+        const_ptr_api!( (extern) [ $($rem)* ] );
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/obj_mac.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/obj_mac.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/obj_mac.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/obj_mac.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1017 @@
+use libc::*;
+
+pub const NID_undef: c_int = 0;
+pub const NID_itu_t: c_int = 645;
+pub const NID_ccitt: c_int = 404;
+pub const NID_iso: c_int = 181;
+pub const NID_joint_iso_itu_t: c_int = 646;
+pub const NID_joint_iso_ccitt: c_int = 393;
+pub const NID_member_body: c_int = 182;
+pub const NID_identified_organization: c_int = 676;
+pub const NID_hmac_md5: c_int = 780;
+pub const NID_hmac_sha1: c_int = 781;
+pub const NID_certicom_arc: c_int = 677;
+pub const NID_international_organizations: c_int = 647;
+pub const NID_wap: c_int = 678;
+pub const NID_wap_wsg: c_int = 679;
+pub const NID_selected_attribute_types: c_int = 394;
+pub const NID_clearance: c_int = 395;
+pub const NID_ISO_US: c_int = 183;
+pub const NID_X9_57: c_int = 184;
+pub const NID_X9cm: c_int = 185;
+pub const NID_dsa: c_int = 116;
+pub const NID_dsaWithSHA1: c_int = 113;
+pub const NID_ansi_X9_62: c_int = 405;
+pub const NID_X9_62_prime_field: c_int = 406;
+pub const NID_X9_62_characteristic_two_field: c_int = 407;
+pub const NID_X9_62_id_characteristic_two_basis: c_int = 680;
+pub const NID_X9_62_onBasis: c_int = 681;
+pub const NID_X9_62_tpBasis: c_int = 682;
+pub const NID_X9_62_ppBasis: c_int = 683;
+pub const NID_X9_62_id_ecPublicKey: c_int = 408;
+pub const NID_X9_62_c2pnb163v1: c_int = 684;
+pub const NID_X9_62_c2pnb163v2: c_int = 685;
+pub const NID_X9_62_c2pnb163v3: c_int = 686;
+pub const NID_X9_62_c2pnb176v1: c_int = 687;
+pub const NID_X9_62_c2tnb191v1: c_int = 688;
+pub const NID_X9_62_c2tnb191v2: c_int = 689;
+pub const NID_X9_62_c2tnb191v3: c_int = 690;
+pub const NID_X9_62_c2onb191v4: c_int = 691;
+pub const NID_X9_62_c2onb191v5: c_int = 692;
+pub const NID_X9_62_c2pnb208w1: c_int = 693;
+pub const NID_X9_62_c2tnb239v1: c_int = 694;
+pub const NID_X9_62_c2tnb239v2: c_int = 695;
+pub const NID_X9_62_c2tnb239v3: c_int = 696;
+pub const NID_X9_62_c2onb239v4: c_int = 697;
+pub const NID_X9_62_c2onb239v5: c_int = 698;
+pub const NID_X9_62_c2pnb272w1: c_int = 699;
+pub const NID_X9_62_c2pnb304w1: c_int = 700;
+pub const NID_X9_62_c2tnb359v1: c_int = 701;
+pub const NID_X9_62_c2pnb368w1: c_int = 702;
+pub const NID_X9_62_c2tnb431r1: c_int = 703;
+pub const NID_X9_62_prime192v1: c_int = 409;
+pub const NID_X9_62_prime192v2: c_int = 410;
+pub const NID_X9_62_prime192v3: c_int = 411;
+pub const NID_X9_62_prime239v1: c_int = 412;
+pub const NID_X9_62_prime239v2: c_int = 413;
+pub const NID_X9_62_prime239v3: c_int = 414;
+pub const NID_X9_62_prime256v1: c_int = 415;
+pub const NID_ecdsa_with_SHA1: c_int = 416;
+pub const NID_ecdsa_with_Recommended: c_int = 791;
+pub const NID_ecdsa_with_Specified: c_int = 792;
+pub const NID_ecdsa_with_SHA224: c_int = 793;
+pub const NID_ecdsa_with_SHA256: c_int = 794;
+pub const NID_ecdsa_with_SHA384: c_int = 795;
+pub const NID_ecdsa_with_SHA512: c_int = 796;
+pub const NID_secp112r1: c_int = 704;
+pub const NID_secp112r2: c_int = 705;
+pub const NID_secp128r1: c_int = 706;
+pub const NID_secp128r2: c_int = 707;
+pub const NID_secp160k1: c_int = 708;
+pub const NID_secp160r1: c_int = 709;
+pub const NID_secp160r2: c_int = 710;
+pub const NID_secp192k1: c_int = 711;
+pub const NID_secp224k1: c_int = 712;
+pub const NID_secp224r1: c_int = 713;
+pub const NID_secp256k1: c_int = 714;
+pub const NID_secp384r1: c_int = 715;
+pub const NID_secp521r1: c_int = 716;
+pub const NID_sect113r1: c_int = 717;
+pub const NID_sect113r2: c_int = 718;
+pub const NID_sect131r1: c_int = 719;
+pub const NID_sect131r2: c_int = 720;
+pub const NID_sect163k1: c_int = 721;
+pub const NID_sect163r1: c_int = 722;
+pub const NID_sect163r2: c_int = 723;
+pub const NID_sect193r1: c_int = 724;
+pub const NID_sect193r2: c_int = 725;
+pub const NID_sect233k1: c_int = 726;
+pub const NID_sect233r1: c_int = 727;
+pub const NID_sect239k1: c_int = 728;
+pub const NID_sect283k1: c_int = 729;
+pub const NID_sect283r1: c_int = 730;
+pub const NID_sect409k1: c_int = 731;
+pub const NID_sect409r1: c_int = 732;
+pub const NID_sect571k1: c_int = 733;
+pub const NID_sect571r1: c_int = 734;
+
+#[cfg(ossl110)]
+pub const NID_brainpoolP256r1: c_int = 927;
+#[cfg(libressl)]
+pub const NID_brainpoolP256r1: c_int = 928;
+
+#[cfg(ossl110)]
+pub const NID_brainpoolP320r1: c_int = 929;
+#[cfg(libressl)]
+pub const NID_brainpoolP320r1: c_int = 930;
+
+#[cfg(ossl110)]
+pub const NID_brainpoolP384r1: c_int = 931;
+#[cfg(libressl)]
+pub const NID_brainpoolP384r1: c_int = 932;
+
+#[cfg(ossl110)]
+pub const NID_brainpoolP512r1: c_int = 933;
+#[cfg(libressl)]
+pub const NID_brainpoolP512r1: c_int = 934;
+
+pub const NID_wap_wsg_idm_ecid_wtls1: c_int = 735;
+pub const NID_wap_wsg_idm_ecid_wtls3: c_int = 736;
+pub const NID_wap_wsg_idm_ecid_wtls4: c_int = 737;
+pub const NID_wap_wsg_idm_ecid_wtls5: c_int = 738;
+pub const NID_wap_wsg_idm_ecid_wtls6: c_int = 739;
+pub const NID_wap_wsg_idm_ecid_wtls7: c_int = 740;
+pub const NID_wap_wsg_idm_ecid_wtls8: c_int = 741;
+pub const NID_wap_wsg_idm_ecid_wtls9: c_int = 742;
+pub const NID_wap_wsg_idm_ecid_wtls10: c_int = 743;
+pub const NID_wap_wsg_idm_ecid_wtls11: c_int = 744;
+pub const NID_wap_wsg_idm_ecid_wtls12: c_int = 745;
+pub const NID_cast5_cbc: c_int = 108;
+pub const NID_cast5_ecb: c_int = 109;
+pub const NID_cast5_cfb64: c_int = 110;
+pub const NID_cast5_ofb64: c_int = 111;
+pub const NID_pbeWithMD5AndCast5_CBC: c_int = 112;
+pub const NID_id_PasswordBasedMAC: c_int = 782;
+pub const NID_id_DHBasedMac: c_int = 783;
+pub const NID_rsadsi: c_int = 1;
+pub const NID_pkcs: c_int = 2;
+pub const NID_pkcs1: c_int = 186;
+pub const NID_rsaEncryption: c_int = 6;
+pub const NID_md2WithRSAEncryption: c_int = 7;
+pub const NID_md4WithRSAEncryption: c_int = 396;
+pub const NID_md5WithRSAEncryption: c_int = 8;
+pub const NID_sha1WithRSAEncryption: c_int = 65;
+pub const NID_rsaesOaep: c_int = 919;
+pub const NID_mgf1: c_int = 911;
+pub const NID_rsassaPss: c_int = 912;
+pub const NID_sha256WithRSAEncryption: c_int = 668;
+pub const NID_sha384WithRSAEncryption: c_int = 669;
+pub const NID_sha512WithRSAEncryption: c_int = 670;
+pub const NID_sha224WithRSAEncryption: c_int = 671;
+pub const NID_pkcs3: c_int = 27;
+pub const NID_dhKeyAgreement: c_int = 28;
+#[cfg(ossl110)]
+pub const NID_dhpublicnumber: c_int = 920;
+pub const NID_pkcs5: c_int = 187;
+pub const NID_pbeWithMD2AndDES_CBC: c_int = 9;
+pub const NID_pbeWithMD5AndDES_CBC: c_int = 10;
+pub const NID_pbeWithMD2AndRC2_CBC: c_int = 168;
+pub const NID_pbeWithMD5AndRC2_CBC: c_int = 169;
+pub const NID_pbeWithSHA1AndDES_CBC: c_int = 170;
+pub const NID_pbeWithSHA1AndRC2_CBC: c_int = 68;
+pub const NID_id_pbkdf2: c_int = 69;
+pub const NID_pbes2: c_int = 161;
+pub const NID_pbmac1: c_int = 162;
+pub const NID_pkcs7: c_int = 20;
+pub const NID_pkcs7_data: c_int = 21;
+pub const NID_pkcs7_signed: c_int = 22;
+pub const NID_pkcs7_enveloped: c_int = 23;
+pub const NID_pkcs7_signedAndEnveloped: c_int = 24;
+pub const NID_pkcs7_digest: c_int = 25;
+pub const NID_pkcs7_encrypted: c_int = 26;
+pub const NID_pkcs9: c_int = 47;
+pub const NID_pkcs9_emailAddress: c_int = 48;
+pub const NID_pkcs9_unstructuredName: c_int = 49;
+pub const NID_pkcs9_contentType: c_int = 50;
+pub const NID_pkcs9_messageDigest: c_int = 51;
+pub const NID_pkcs9_signingTime: c_int = 52;
+pub const NID_pkcs9_countersignature: c_int = 53;
+pub const NID_pkcs9_challengePassword: c_int = 54;
+pub const NID_pkcs9_unstructuredAddress: c_int = 55;
+pub const NID_pkcs9_extCertAttributes: c_int = 56;
+pub const NID_ext_req: c_int = 172;
+pub const NID_SMIMECapabilities: c_int = 167;
+pub const NID_SMIME: c_int = 188;
+pub const NID_id_smime_mod: c_int = 189;
+pub const NID_id_smime_ct: c_int = 190;
+pub const NID_id_smime_aa: c_int = 191;
+pub const NID_id_smime_alg: c_int = 192;
+pub const NID_id_smime_cd: c_int = 193;
+pub const NID_id_smime_spq: c_int = 194;
+pub const NID_id_smime_cti: c_int = 195;
+pub const NID_id_smime_mod_cms: c_int = 196;
+pub const NID_id_smime_mod_ess: c_int = 197;
+pub const NID_id_smime_mod_oid: c_int = 198;
+pub const NID_id_smime_mod_msg_v3: c_int = 199;
+pub const NID_id_smime_mod_ets_eSignature_88: c_int = 200;
+pub const NID_id_smime_mod_ets_eSignature_97: c_int = 201;
+pub const NID_id_smime_mod_ets_eSigPolicy_88: c_int = 202;
+pub const NID_id_smime_mod_ets_eSigPolicy_97: c_int = 203;
+pub const NID_id_smime_ct_receipt: c_int = 204;
+pub const NID_id_smime_ct_authData: c_int = 205;
+pub const NID_id_smime_ct_publishCert: c_int = 206;
+pub const NID_id_smime_ct_TSTInfo: c_int = 207;
+pub const NID_id_smime_ct_TDTInfo: c_int = 208;
+pub const NID_id_smime_ct_contentInfo: c_int = 209;
+pub const NID_id_smime_ct_DVCSRequestData: c_int = 210;
+pub const NID_id_smime_ct_DVCSResponseData: c_int = 211;
+pub const NID_id_smime_ct_compressedData: c_int = 786;
+pub const NID_id_ct_asciiTextWithCRLF: c_int = 787;
+pub const NID_id_smime_aa_receiptRequest: c_int = 212;
+pub const NID_id_smime_aa_securityLabel: c_int = 213;
+pub const NID_id_smime_aa_mlExpandHistory: c_int = 214;
+pub const NID_id_smime_aa_contentHint: c_int = 215;
+pub const NID_id_smime_aa_msgSigDigest: c_int = 216;
+pub const NID_id_smime_aa_encapContentType: c_int = 217;
+pub const NID_id_smime_aa_contentIdentifier: c_int = 218;
+pub const NID_id_smime_aa_macValue: c_int = 219;
+pub const NID_id_smime_aa_equivalentLabels: c_int = 220;
+pub const NID_id_smime_aa_contentReference: c_int = 221;
+pub const NID_id_smime_aa_encrypKeyPref: c_int = 222;
+pub const NID_id_smime_aa_signingCertificate: c_int = 223;
+pub const NID_id_smime_aa_smimeEncryptCerts: c_int = 224;
+pub const NID_id_smime_aa_timeStampToken: c_int = 225;
+pub const NID_id_smime_aa_ets_sigPolicyId: c_int = 226;
+pub const NID_id_smime_aa_ets_commitmentType: c_int = 227;
+pub const NID_id_smime_aa_ets_signerLocation: c_int = 228;
+pub const NID_id_smime_aa_ets_signerAttr: c_int = 229;
+pub const NID_id_smime_aa_ets_otherSigCert: c_int = 230;
+pub const NID_id_smime_aa_ets_contentTimestamp: c_int = 231;
+pub const NID_id_smime_aa_ets_CertificateRefs: c_int = 232;
+pub const NID_id_smime_aa_ets_RevocationRefs: c_int = 233;
+pub const NID_id_smime_aa_ets_certValues: c_int = 234;
+pub const NID_id_smime_aa_ets_revocationValues: c_int = 235;
+pub const NID_id_smime_aa_ets_escTimeStamp: c_int = 236;
+pub const NID_id_smime_aa_ets_certCRLTimestamp: c_int = 237;
+pub const NID_id_smime_aa_ets_archiveTimeStamp: c_int = 238;
+pub const NID_id_smime_aa_signatureType: c_int = 239;
+pub const NID_id_smime_aa_dvcs_dvc: c_int = 240;
+pub const NID_id_smime_alg_ESDHwith3DES: c_int = 241;
+pub const NID_id_smime_alg_ESDHwithRC2: c_int = 242;
+pub const NID_id_smime_alg_3DESwrap: c_int = 243;
+pub const NID_id_smime_alg_RC2wrap: c_int = 244;
+pub const NID_id_smime_alg_ESDH: c_int = 245;
+pub const NID_id_smime_alg_CMS3DESwrap: c_int = 246;
+pub const NID_id_smime_alg_CMSRC2wrap: c_int = 247;
+pub const NID_id_alg_PWRI_KEK: c_int = 893;
+pub const NID_id_smime_cd_ldap: c_int = 248;
+pub const NID_id_smime_spq_ets_sqt_uri: c_int = 249;
+pub const NID_id_smime_spq_ets_sqt_unotice: c_int = 250;
+pub const NID_id_smime_cti_ets_proofOfOrigin: c_int = 251;
+pub const NID_id_smime_cti_ets_proofOfReceipt: c_int = 252;
+pub const NID_id_smime_cti_ets_proofOfDelivery: c_int = 253;
+pub const NID_id_smime_cti_ets_proofOfSender: c_int = 254;
+pub const NID_id_smime_cti_ets_proofOfApproval: c_int = 255;
+pub const NID_id_smime_cti_ets_proofOfCreation: c_int = 256;
+pub const NID_friendlyName: c_int = 156;
+pub const NID_localKeyID: c_int = 157;
+pub const NID_ms_csp_name: c_int = 417;
+pub const NID_LocalKeySet: c_int = 856;
+pub const NID_x509Certificate: c_int = 158;
+pub const NID_sdsiCertificate: c_int = 159;
+pub const NID_x509Crl: c_int = 160;
+pub const NID_pbe_WithSHA1And128BitRC4: c_int = 144;
+pub const NID_pbe_WithSHA1And40BitRC4: c_int = 145;
+pub const NID_pbe_WithSHA1And3_Key_TripleDES_CBC: c_int = 146;
+pub const NID_pbe_WithSHA1And2_Key_TripleDES_CBC: c_int = 147;
+pub const NID_pbe_WithSHA1And128BitRC2_CBC: c_int = 148;
+pub const NID_pbe_WithSHA1And40BitRC2_CBC: c_int = 149;
+pub const NID_keyBag: c_int = 150;
+pub const NID_pkcs8ShroudedKeyBag: c_int = 151;
+pub const NID_certBag: c_int = 152;
+pub const NID_crlBag: c_int = 153;
+pub const NID_secretBag: c_int = 154;
+pub const NID_safeContentsBag: c_int = 155;
+pub const NID_md2: c_int = 3;
+pub const NID_md4: c_int = 257;
+pub const NID_md5: c_int = 4;
+pub const NID_md5_sha1: c_int = 114;
+pub const NID_hmacWithMD5: c_int = 797;
+pub const NID_hmacWithSHA1: c_int = 163;
+pub const NID_hmacWithSHA224: c_int = 798;
+pub const NID_hmacWithSHA256: c_int = 799;
+pub const NID_hmacWithSHA384: c_int = 800;
+pub const NID_hmacWithSHA512: c_int = 801;
+pub const NID_rc2_cbc: c_int = 37;
+pub const NID_rc2_ecb: c_int = 38;
+pub const NID_rc2_cfb64: c_int = 39;
+pub const NID_rc2_ofb64: c_int = 40;
+pub const NID_rc2_40_cbc: c_int = 98;
+pub const NID_rc2_64_cbc: c_int = 166;
+pub const NID_rc4: c_int = 5;
+pub const NID_rc4_40: c_int = 97;
+pub const NID_des_ede3_cbc: c_int = 44;
+pub const NID_rc5_cbc: c_int = 120;
+pub const NID_rc5_ecb: c_int = 121;
+pub const NID_rc5_cfb64: c_int = 122;
+pub const NID_rc5_ofb64: c_int = 123;
+pub const NID_ms_ext_req: c_int = 171;
+pub const NID_ms_code_ind: c_int = 134;
+pub const NID_ms_code_com: c_int = 135;
+pub const NID_ms_ctl_sign: c_int = 136;
+pub const NID_ms_sgc: c_int = 137;
+pub const NID_ms_efs: c_int = 138;
+pub const NID_ms_smartcard_login: c_int = 648;
+pub const NID_ms_upn: c_int = 649;
+pub const NID_idea_cbc: c_int = 34;
+pub const NID_idea_ecb: c_int = 36;
+pub const NID_idea_cfb64: c_int = 35;
+pub const NID_idea_ofb64: c_int = 46;
+pub const NID_bf_cbc: c_int = 91;
+pub const NID_bf_ecb: c_int = 92;
+pub const NID_bf_cfb64: c_int = 93;
+pub const NID_bf_ofb64: c_int = 94;
+pub const NID_id_pkix: c_int = 127;
+pub const NID_id_pkix_mod: c_int = 258;
+pub const NID_id_pe: c_int = 175;
+pub const NID_id_qt: c_int = 259;
+pub const NID_id_kp: c_int = 128;
+pub const NID_id_it: c_int = 260;
+pub const NID_id_pkip: c_int = 261;
+pub const NID_id_alg: c_int = 262;
+pub const NID_id_cmc: c_int = 263;
+pub const NID_id_on: c_int = 264;
+pub const NID_id_pda: c_int = 265;
+pub const NID_id_aca: c_int = 266;
+pub const NID_id_qcs: c_int = 267;
+pub const NID_id_cct: c_int = 268;
+pub const NID_id_ppl: c_int = 662;
+pub const NID_id_ad: c_int = 176;
+pub const NID_id_pkix1_explicit_88: c_int = 269;
+pub const NID_id_pkix1_implicit_88: c_int = 270;
+pub const NID_id_pkix1_explicit_93: c_int = 271;
+pub const NID_id_pkix1_implicit_93: c_int = 272;
+pub const NID_id_mod_crmf: c_int = 273;
+pub const NID_id_mod_cmc: c_int = 274;
+pub const NID_id_mod_kea_profile_88: c_int = 275;
+pub const NID_id_mod_kea_profile_93: c_int = 276;
+pub const NID_id_mod_cmp: c_int = 277;
+pub const NID_id_mod_qualified_cert_88: c_int = 278;
+pub const NID_id_mod_qualified_cert_93: c_int = 279;
+pub const NID_id_mod_attribute_cert: c_int = 280;
+pub const NID_id_mod_timestamp_protocol: c_int = 281;
+pub const NID_id_mod_ocsp: c_int = 282;
+pub const NID_id_mod_dvcs: c_int = 283;
+pub const NID_id_mod_cmp2000: c_int = 284;
+pub const NID_info_access: c_int = 177;
+pub const NID_biometricInfo: c_int = 285;
+pub const NID_qcStatements: c_int = 286;
+pub const NID_ac_auditEntity: c_int = 287;
+pub const NID_ac_targeting: c_int = 288;
+pub const NID_aaControls: c_int = 289;
+pub const NID_sbgp_ipAddrBlock: c_int = 290;
+pub const NID_sbgp_autonomousSysNum: c_int = 291;
+pub const NID_sbgp_routerIdentifier: c_int = 292;
+pub const NID_ac_proxying: c_int = 397;
+pub const NID_sinfo_access: c_int = 398;
+pub const NID_proxyCertInfo: c_int = 663;
+pub const NID_id_qt_cps: c_int = 164;
+pub const NID_id_qt_unotice: c_int = 165;
+pub const NID_textNotice: c_int = 293;
+pub const NID_server_auth: c_int = 129;
+pub const NID_client_auth: c_int = 130;
+pub const NID_code_sign: c_int = 131;
+pub const NID_email_protect: c_int = 132;
+pub const NID_ipsecEndSystem: c_int = 294;
+pub const NID_ipsecTunnel: c_int = 295;
+pub const NID_ipsecUser: c_int = 296;
+pub const NID_time_stamp: c_int = 133;
+pub const NID_OCSP_sign: c_int = 180;
+pub const NID_dvcs: c_int = 297;
+pub const NID_id_it_caProtEncCert: c_int = 298;
+pub const NID_id_it_signKeyPairTypes: c_int = 299;
+pub const NID_id_it_encKeyPairTypes: c_int = 300;
+pub const NID_id_it_preferredSymmAlg: c_int = 301;
+pub const NID_id_it_caKeyUpdateInfo: c_int = 302;
+pub const NID_id_it_currentCRL: c_int = 303;
+pub const NID_id_it_unsupportedOIDs: c_int = 304;
+pub const NID_id_it_subscriptionRequest: c_int = 305;
+pub const NID_id_it_subscriptionResponse: c_int = 306;
+pub const NID_id_it_keyPairParamReq: c_int = 307;
+pub const NID_id_it_keyPairParamRep: c_int = 308;
+pub const NID_id_it_revPassphrase: c_int = 309;
+pub const NID_id_it_implicitConfirm: c_int = 310;
+pub const NID_id_it_confirmWaitTime: c_int = 311;
+pub const NID_id_it_origPKIMessage: c_int = 312;
+pub const NID_id_it_suppLangTags: c_int = 784;
+pub const NID_id_regCtrl: c_int = 313;
+pub const NID_id_regInfo: c_int = 314;
+pub const NID_id_regCtrl_regToken: c_int = 315;
+pub const NID_id_regCtrl_authenticator: c_int = 316;
+pub const NID_id_regCtrl_pkiPublicationInfo: c_int = 317;
+pub const NID_id_regCtrl_pkiArchiveOptions: c_int = 318;
+pub const NID_id_regCtrl_oldCertID: c_int = 319;
+pub const NID_id_regCtrl_protocolEncrKey: c_int = 320;
+pub const NID_id_regInfo_utf8Pairs: c_int = 321;
+pub const NID_id_regInfo_certReq: c_int = 322;
+pub const NID_id_alg_des40: c_int = 323;
+pub const NID_id_alg_noSignature: c_int = 324;
+pub const NID_id_alg_dh_sig_hmac_sha1: c_int = 325;
+pub const NID_id_alg_dh_pop: c_int = 326;
+pub const NID_id_cmc_statusInfo: c_int = 327;
+pub const NID_id_cmc_identification: c_int = 328;
+pub const NID_id_cmc_identityProof: c_int = 329;
+pub const NID_id_cmc_dataReturn: c_int = 330;
+pub const NID_id_cmc_transactionId: c_int = 331;
+pub const NID_id_cmc_senderNonce: c_int = 332;
+pub const NID_id_cmc_recipientNonce: c_int = 333;
+pub const NID_id_cmc_addExtensions: c_int = 334;
+pub const NID_id_cmc_encryptedPOP: c_int = 335;
+pub const NID_id_cmc_decryptedPOP: c_int = 336;
+pub const NID_id_cmc_lraPOPWitness: c_int = 337;
+pub const NID_id_cmc_getCert: c_int = 338;
+pub const NID_id_cmc_getCRL: c_int = 339;
+pub const NID_id_cmc_revokeRequest: c_int = 340;
+pub const NID_id_cmc_regInfo: c_int = 341;
+pub const NID_id_cmc_responseInfo: c_int = 342;
+pub const NID_id_cmc_queryPending: c_int = 343;
+pub const NID_id_cmc_popLinkRandom: c_int = 344;
+pub const NID_id_cmc_popLinkWitness: c_int = 345;
+pub const NID_id_cmc_confirmCertAcceptance: c_int = 346;
+pub const NID_id_on_personalData: c_int = 347;
+pub const NID_id_on_permanentIdentifier: c_int = 858;
+pub const NID_id_pda_dateOfBirth: c_int = 348;
+pub const NID_id_pda_placeOfBirth: c_int = 349;
+pub const NID_id_pda_gender: c_int = 351;
+pub const NID_id_pda_countryOfCitizenship: c_int = 352;
+pub const NID_id_pda_countryOfResidence: c_int = 353;
+pub const NID_id_aca_authenticationInfo: c_int = 354;
+pub const NID_id_aca_accessIdentity: c_int = 355;
+pub const NID_id_aca_chargingIdentity: c_int = 356;
+pub const NID_id_aca_group: c_int = 357;
+pub const NID_id_aca_role: c_int = 358;
+pub const NID_id_aca_encAttrs: c_int = 399;
+pub const NID_id_qcs_pkixQCSyntax_v1: c_int = 359;
+pub const NID_id_cct_crs: c_int = 360;
+pub const NID_id_cct_PKIData: c_int = 361;
+pub const NID_id_cct_PKIResponse: c_int = 362;
+pub const NID_id_ppl_anyLanguage: c_int = 664;
+pub const NID_id_ppl_inheritAll: c_int = 665;
+pub const NID_Independent: c_int = 667;
+pub const NID_ad_OCSP: c_int = 178;
+pub const NID_ad_ca_issuers: c_int = 179;
+pub const NID_ad_timeStamping: c_int = 363;
+pub const NID_ad_dvcs: c_int = 364;
+pub const NID_caRepository: c_int = 785;
+pub const NID_id_pkix_OCSP_basic: c_int = 365;
+pub const NID_id_pkix_OCSP_Nonce: c_int = 366;
+pub const NID_id_pkix_OCSP_CrlID: c_int = 367;
+pub const NID_id_pkix_OCSP_acceptableResponses: c_int = 368;
+pub const NID_id_pkix_OCSP_noCheck: c_int = 369;
+pub const NID_id_pkix_OCSP_archiveCutoff: c_int = 370;
+pub const NID_id_pkix_OCSP_serviceLocator: c_int = 371;
+pub const NID_id_pkix_OCSP_extendedStatus: c_int = 372;
+pub const NID_id_pkix_OCSP_valid: c_int = 373;
+pub const NID_id_pkix_OCSP_path: c_int = 374;
+pub const NID_id_pkix_OCSP_trustRoot: c_int = 375;
+pub const NID_algorithm: c_int = 376;
+pub const NID_md5WithRSA: c_int = 104;
+pub const NID_des_ecb: c_int = 29;
+pub const NID_des_cbc: c_int = 31;
+pub const NID_des_ofb64: c_int = 45;
+pub const NID_des_cfb64: c_int = 30;
+pub const NID_rsaSignature: c_int = 377;
+pub const NID_dsa_2: c_int = 67;
+pub const NID_dsaWithSHA: c_int = 66;
+pub const NID_shaWithRSAEncryption: c_int = 42;
+pub const NID_des_ede_ecb: c_int = 32;
+pub const NID_des_ede3_ecb: c_int = 33;
+pub const NID_des_ede_cbc: c_int = 43;
+pub const NID_des_ede_cfb64: c_int = 60;
+pub const NID_des_ede3_cfb64: c_int = 61;
+pub const NID_des_ede_ofb64: c_int = 62;
+pub const NID_des_ede3_ofb64: c_int = 63;
+pub const NID_desx_cbc: c_int = 80;
+pub const NID_sha: c_int = 41;
+pub const NID_sha1: c_int = 64;
+pub const NID_dsaWithSHA1_2: c_int = 70;
+pub const NID_sha1WithRSA: c_int = 115;
+pub const NID_ripemd160: c_int = 117;
+pub const NID_ripemd160WithRSA: c_int = 119;
+pub const NID_sxnet: c_int = 143;
+pub const NID_X500: c_int = 11;
+pub const NID_X509: c_int = 12;
+pub const NID_commonName: c_int = 13;
+pub const NID_surname: c_int = 100;
+pub const NID_serialNumber: c_int = 105;
+pub const NID_countryName: c_int = 14;
+pub const NID_localityName: c_int = 15;
+pub const NID_stateOrProvinceName: c_int = 16;
+pub const NID_streetAddress: c_int = 660;
+pub const NID_organizationName: c_int = 17;
+pub const NID_organizationalUnitName: c_int = 18;
+pub const NID_title: c_int = 106;
+pub const NID_description: c_int = 107;
+pub const NID_searchGuide: c_int = 859;
+pub const NID_businessCategory: c_int = 860;
+pub const NID_postalAddress: c_int = 861;
+pub const NID_postalCode: c_int = 661;
+pub const NID_postOfficeBox: c_int = 862;
+pub const NID_physicalDeliveryOfficeName: c_int = 863;
+pub const NID_telephoneNumber: c_int = 864;
+pub const NID_telexNumber: c_int = 865;
+pub const NID_teletexTerminalIdentifier: c_int = 866;
+pub const NID_facsimileTelephoneNumber: c_int = 867;
+pub const NID_x121Address: c_int = 868;
+pub const NID_internationaliSDNNumber: c_int = 869;
+pub const NID_registeredAddress: c_int = 870;
+pub const NID_destinationIndicator: c_int = 871;
+pub const NID_preferredDeliveryMethod: c_int = 872;
+pub const NID_presentationAddress: c_int = 873;
+pub const NID_supportedApplicationContext: c_int = 874;
+pub const NID_member: c_int = 875;
+pub const NID_owner: c_int = 876;
+pub const NID_roleOccupant: c_int = 877;
+pub const NID_seeAlso: c_int = 878;
+pub const NID_userPassword: c_int = 879;
+pub const NID_userCertificate: c_int = 880;
+pub const NID_cACertificate: c_int = 881;
+pub const NID_authorityRevocationList: c_int = 882;
+pub const NID_certificateRevocationList: c_int = 883;
+pub const NID_crossCertificatePair: c_int = 884;
+pub const NID_name: c_int = 173;
+pub const NID_givenName: c_int = 99;
+pub const NID_initials: c_int = 101;
+pub const NID_generationQualifier: c_int = 509;
+pub const NID_x500UniqueIdentifier: c_int = 503;
+pub const NID_dnQualifier: c_int = 174;
+pub const NID_enhancedSearchGuide: c_int = 885;
+pub const NID_protocolInformation: c_int = 886;
+pub const NID_distinguishedName: c_int = 887;
+pub const NID_uniqueMember: c_int = 888;
+pub const NID_houseIdentifier: c_int = 889;
+pub const NID_supportedAlgorithms: c_int = 890;
+pub const NID_deltaRevocationList: c_int = 891;
+pub const NID_dmdName: c_int = 892;
+pub const NID_pseudonym: c_int = 510;
+pub const NID_role: c_int = 400;
+pub const NID_X500algorithms: c_int = 378;
+pub const NID_rsa: c_int = 19;
+pub const NID_mdc2WithRSA: c_int = 96;
+pub const NID_mdc2: c_int = 95;
+pub const NID_id_ce: c_int = 81;
+pub const NID_subject_directory_attributes: c_int = 769;
+pub const NID_subject_key_identifier: c_int = 82;
+pub const NID_key_usage: c_int = 83;
+pub const NID_private_key_usage_period: c_int = 84;
+pub const NID_subject_alt_name: c_int = 85;
+pub const NID_issuer_alt_name: c_int = 86;
+pub const NID_basic_constraints: c_int = 87;
+pub const NID_crl_number: c_int = 88;
+pub const NID_crl_reason: c_int = 141;
+pub const NID_invalidity_date: c_int = 142;
+pub const NID_delta_crl: c_int = 140;
+pub const NID_issuing_distribution_point: c_int = 770;
+pub const NID_certificate_issuer: c_int = 771;
+pub const NID_name_constraints: c_int = 666;
+pub const NID_crl_distribution_points: c_int = 103;
+pub const NID_certificate_policies: c_int = 89;
+pub const NID_any_policy: c_int = 746;
+pub const NID_policy_mappings: c_int = 747;
+pub const NID_authority_key_identifier: c_int = 90;
+pub const NID_policy_constraints: c_int = 401;
+pub const NID_ext_key_usage: c_int = 126;
+pub const NID_freshest_crl: c_int = 857;
+pub const NID_inhibit_any_policy: c_int = 748;
+pub const NID_target_information: c_int = 402;
+pub const NID_no_rev_avail: c_int = 403;
+pub const NID_anyExtendedKeyUsage: c_int = 910;
+pub const NID_netscape: c_int = 57;
+pub const NID_netscape_cert_extension: c_int = 58;
+pub const NID_netscape_data_type: c_int = 59;
+pub const NID_netscape_cert_type: c_int = 71;
+pub const NID_netscape_base_url: c_int = 72;
+pub const NID_netscape_revocation_url: c_int = 73;
+pub const NID_netscape_ca_revocation_url: c_int = 74;
+pub const NID_netscape_renewal_url: c_int = 75;
+pub const NID_netscape_ca_policy_url: c_int = 76;
+pub const NID_netscape_ssl_server_name: c_int = 77;
+pub const NID_netscape_comment: c_int = 78;
+pub const NID_netscape_cert_sequence: c_int = 79;
+pub const NID_ns_sgc: c_int = 139;
+pub const NID_org: c_int = 379;
+pub const NID_dod: c_int = 380;
+pub const NID_iana: c_int = 381;
+pub const NID_Directory: c_int = 382;
+pub const NID_Management: c_int = 383;
+pub const NID_Experimental: c_int = 384;
+pub const NID_Private: c_int = 385;
+pub const NID_Security: c_int = 386;
+pub const NID_SNMPv2: c_int = 387;
+pub const NID_Mail: c_int = 388;
+pub const NID_Enterprises: c_int = 389;
+pub const NID_dcObject: c_int = 390;
+pub const NID_mime_mhs: c_int = 504;
+pub const NID_mime_mhs_headings: c_int = 505;
+pub const NID_mime_mhs_bodies: c_int = 506;
+pub const NID_id_hex_partial_message: c_int = 507;
+pub const NID_id_hex_multipart_message: c_int = 508;
+pub const NID_zlib_compression: c_int = 125;
+pub const NID_aes_128_ecb: c_int = 418;
+pub const NID_aes_128_cbc: c_int = 419;
+pub const NID_aes_128_ofb128: c_int = 420;
+pub const NID_aes_128_cfb128: c_int = 421;
+pub const NID_id_aes128_wrap: c_int = 788;
+pub const NID_aes_128_gcm: c_int = 895;
+pub const NID_aes_128_ccm: c_int = 896;
+pub const NID_id_aes128_wrap_pad: c_int = 897;
+pub const NID_aes_192_ecb: c_int = 422;
+pub const NID_aes_192_cbc: c_int = 423;
+pub const NID_aes_192_ofb128: c_int = 424;
+pub const NID_aes_192_cfb128: c_int = 425;
+pub const NID_id_aes192_wrap: c_int = 789;
+pub const NID_aes_192_gcm: c_int = 898;
+pub const NID_aes_192_ccm: c_int = 899;
+pub const NID_id_aes192_wrap_pad: c_int = 900;
+pub const NID_aes_256_ecb: c_int = 426;
+pub const NID_aes_256_cbc: c_int = 427;
+pub const NID_aes_256_ofb128: c_int = 428;
+pub const NID_aes_256_cfb128: c_int = 429;
+pub const NID_id_aes256_wrap: c_int = 790;
+pub const NID_aes_256_gcm: c_int = 901;
+pub const NID_aes_256_ccm: c_int = 902;
+pub const NID_id_aes256_wrap_pad: c_int = 903;
+pub const NID_aes_128_cfb1: c_int = 650;
+pub const NID_aes_192_cfb1: c_int = 651;
+pub const NID_aes_256_cfb1: c_int = 652;
+pub const NID_aes_128_cfb8: c_int = 653;
+pub const NID_aes_192_cfb8: c_int = 654;
+pub const NID_aes_256_cfb8: c_int = 655;
+pub const NID_aes_128_ctr: c_int = 904;
+pub const NID_aes_192_ctr: c_int = 905;
+pub const NID_aes_256_ctr: c_int = 906;
+pub const NID_aes_128_xts: c_int = 913;
+pub const NID_aes_256_xts: c_int = 914;
+pub const NID_des_cfb1: c_int = 656;
+pub const NID_des_cfb8: c_int = 657;
+pub const NID_des_ede3_cfb1: c_int = 658;
+pub const NID_des_ede3_cfb8: c_int = 659;
+pub const NID_sha256: c_int = 672;
+pub const NID_sha384: c_int = 673;
+pub const NID_sha512: c_int = 674;
+pub const NID_sha224: c_int = 675;
+pub const NID_dsa_with_SHA224: c_int = 802;
+pub const NID_dsa_with_SHA256: c_int = 803;
+pub const NID_hold_instruction_code: c_int = 430;
+pub const NID_hold_instruction_none: c_int = 431;
+pub const NID_hold_instruction_call_issuer: c_int = 432;
+pub const NID_hold_instruction_reject: c_int = 433;
+pub const NID_data: c_int = 434;
+pub const NID_pss: c_int = 435;
+pub const NID_ucl: c_int = 436;
+pub const NID_pilot: c_int = 437;
+pub const NID_pilotAttributeType: c_int = 438;
+pub const NID_pilotAttributeSyntax: c_int = 439;
+pub const NID_pilotObjectClass: c_int = 440;
+pub const NID_pilotGroups: c_int = 441;
+pub const NID_iA5StringSyntax: c_int = 442;
+pub const NID_caseIgnoreIA5StringSyntax: c_int = 443;
+pub const NID_pilotObject: c_int = 444;
+pub const NID_pilotPerson: c_int = 445;
+pub const NID_account: c_int = 446;
+pub const NID_document: c_int = 447;
+pub const NID_room: c_int = 448;
+pub const NID_documentSeries: c_int = 449;
+pub const NID_Domain: c_int = 392;
+pub const NID_rFC822localPart: c_int = 450;
+pub const NID_dNSDomain: c_int = 451;
+pub const NID_domainRelatedObject: c_int = 452;
+pub const NID_friendlyCountry: c_int = 453;
+pub const NID_simpleSecurityObject: c_int = 454;
+pub const NID_pilotOrganization: c_int = 455;
+pub const NID_pilotDSA: c_int = 456;
+pub const NID_qualityLabelledData: c_int = 457;
+pub const NID_userId: c_int = 458;
+pub const NID_textEncodedORAddress: c_int = 459;
+pub const NID_rfc822Mailbox: c_int = 460;
+pub const NID_info: c_int = 461;
+pub const NID_favouriteDrink: c_int = 462;
+pub const NID_roomNumber: c_int = 463;
+pub const NID_photo: c_int = 464;
+pub const NID_userClass: c_int = 465;
+pub const NID_host: c_int = 466;
+pub const NID_manager: c_int = 467;
+pub const NID_documentIdentifier: c_int = 468;
+pub const NID_documentTitle: c_int = 469;
+pub const NID_documentVersion: c_int = 470;
+pub const NID_documentAuthor: c_int = 471;
+pub const NID_documentLocation: c_int = 472;
+pub const NID_homeTelephoneNumber: c_int = 473;
+pub const NID_secretary: c_int = 474;
+pub const NID_otherMailbox: c_int = 475;
+pub const NID_lastModifiedTime: c_int = 476;
+pub const NID_lastModifiedBy: c_int = 477;
+pub const NID_domainComponent: c_int = 391;
+pub const NID_aRecord: c_int = 478;
+pub const NID_pilotAttributeType27: c_int = 479;
+pub const NID_mXRecord: c_int = 480;
+pub const NID_nSRecord: c_int = 481;
+pub const NID_sOARecord: c_int = 482;
+pub const NID_cNAMERecord: c_int = 483;
+pub const NID_associatedDomain: c_int = 484;
+pub const NID_associatedName: c_int = 485;
+pub const NID_homePostalAddress: c_int = 486;
+pub const NID_personalTitle: c_int = 487;
+pub const NID_mobileTelephoneNumber: c_int = 488;
+pub const NID_pagerTelephoneNumber: c_int = 489;
+pub const NID_friendlyCountryName: c_int = 490;
+pub const NID_organizationalStatus: c_int = 491;
+pub const NID_janetMailbox: c_int = 492;
+pub const NID_mailPreferenceOption: c_int = 493;
+pub const NID_buildingName: c_int = 494;
+pub const NID_dSAQuality: c_int = 495;
+pub const NID_singleLevelQuality: c_int = 496;
+pub const NID_subtreeMinimumQuality: c_int = 497;
+pub const NID_subtreeMaximumQuality: c_int = 498;
+pub const NID_personalSignature: c_int = 499;
+pub const NID_dITRedirect: c_int = 500;
+pub const NID_audio: c_int = 501;
+pub const NID_documentPublisher: c_int = 502;
+pub const NID_id_set: c_int = 512;
+pub const NID_set_ctype: c_int = 513;
+pub const NID_set_msgExt: c_int = 514;
+pub const NID_set_attr: c_int = 515;
+pub const NID_set_policy: c_int = 516;
+pub const NID_set_certExt: c_int = 517;
+pub const NID_set_brand: c_int = 518;
+pub const NID_setct_PANData: c_int = 519;
+pub const NID_setct_PANToken: c_int = 520;
+pub const NID_setct_PANOnly: c_int = 521;
+pub const NID_setct_OIData: c_int = 522;
+pub const NID_setct_PI: c_int = 523;
+pub const NID_setct_PIData: c_int = 524;
+pub const NID_setct_PIDataUnsigned: c_int = 525;
+pub const NID_setct_HODInput: c_int = 526;
+pub const NID_setct_AuthResBaggage: c_int = 527;
+pub const NID_setct_AuthRevReqBaggage: c_int = 528;
+pub const NID_setct_AuthRevResBaggage: c_int = 529;
+pub const NID_setct_CapTokenSeq: c_int = 530;
+pub const NID_setct_PInitResData: c_int = 531;
+pub const NID_setct_PI_TBS: c_int = 532;
+pub const NID_setct_PResData: c_int = 533;
+pub const NID_setct_AuthReqTBS: c_int = 534;
+pub const NID_setct_AuthResTBS: c_int = 535;
+pub const NID_setct_AuthResTBSX: c_int = 536;
+pub const NID_setct_AuthTokenTBS: c_int = 537;
+pub const NID_setct_CapTokenData: c_int = 538;
+pub const NID_setct_CapTokenTBS: c_int = 539;
+pub const NID_setct_AcqCardCodeMsg: c_int = 540;
+pub const NID_setct_AuthRevReqTBS: c_int = 541;
+pub const NID_setct_AuthRevResData: c_int = 542;
+pub const NID_setct_AuthRevResTBS: c_int = 543;
+pub const NID_setct_CapReqTBS: c_int = 544;
+pub const NID_setct_CapReqTBSX: c_int = 545;
+pub const NID_setct_CapResData: c_int = 546;
+pub const NID_setct_CapRevReqTBS: c_int = 547;
+pub const NID_setct_CapRevReqTBSX: c_int = 548;
+pub const NID_setct_CapRevResData: c_int = 549;
+pub const NID_setct_CredReqTBS: c_int = 550;
+pub const NID_setct_CredReqTBSX: c_int = 551;
+pub const NID_setct_CredResData: c_int = 552;
+pub const NID_setct_CredRevReqTBS: c_int = 553;
+pub const NID_setct_CredRevReqTBSX: c_int = 554;
+pub const NID_setct_CredRevResData: c_int = 555;
+pub const NID_setct_PCertReqData: c_int = 556;
+pub const NID_setct_PCertResTBS: c_int = 557;
+pub const NID_setct_BatchAdminReqData: c_int = 558;
+pub const NID_setct_BatchAdminResData: c_int = 559;
+pub const NID_setct_CardCInitResTBS: c_int = 560;
+pub const NID_setct_MeAqCInitResTBS: c_int = 561;
+pub const NID_setct_RegFormResTBS: c_int = 562;
+pub const NID_setct_CertReqData: c_int = 563;
+pub const NID_setct_CertReqTBS: c_int = 564;
+pub const NID_setct_CertResData: c_int = 565;
+pub const NID_setct_CertInqReqTBS: c_int = 566;
+pub const NID_setct_ErrorTBS: c_int = 567;
+pub const NID_setct_PIDualSignedTBE: c_int = 568;
+pub const NID_setct_PIUnsignedTBE: c_int = 569;
+pub const NID_setct_AuthReqTBE: c_int = 570;
+pub const NID_setct_AuthResTBE: c_int = 571;
+pub const NID_setct_AuthResTBEX: c_int = 572;
+pub const NID_setct_AuthTokenTBE: c_int = 573;
+pub const NID_setct_CapTokenTBE: c_int = 574;
+pub const NID_setct_CapTokenTBEX: c_int = 575;
+pub const NID_setct_AcqCardCodeMsgTBE: c_int = 576;
+pub const NID_setct_AuthRevReqTBE: c_int = 577;
+pub const NID_setct_AuthRevResTBE: c_int = 578;
+pub const NID_setct_AuthRevResTBEB: c_int = 579;
+pub const NID_setct_CapReqTBE: c_int = 580;
+pub const NID_setct_CapReqTBEX: c_int = 581;
+pub const NID_setct_CapResTBE: c_int = 582;
+pub const NID_setct_CapRevReqTBE: c_int = 583;
+pub const NID_setct_CapRevReqTBEX: c_int = 584;
+pub const NID_setct_CapRevResTBE: c_int = 585;
+pub const NID_setct_CredReqTBE: c_int = 586;
+pub const NID_setct_CredReqTBEX: c_int = 587;
+pub const NID_setct_CredResTBE: c_int = 588;
+pub const NID_setct_CredRevReqTBE: c_int = 589;
+pub const NID_setct_CredRevReqTBEX: c_int = 590;
+pub const NID_setct_CredRevResTBE: c_int = 591;
+pub const NID_setct_BatchAdminReqTBE: c_int = 592;
+pub const NID_setct_BatchAdminResTBE: c_int = 593;
+pub const NID_setct_RegFormReqTBE: c_int = 594;
+pub const NID_setct_CertReqTBE: c_int = 595;
+pub const NID_setct_CertReqTBEX: c_int = 596;
+pub const NID_setct_CertResTBE: c_int = 597;
+pub const NID_setct_CRLNotificationTBS: c_int = 598;
+pub const NID_setct_CRLNotificationResTBS: c_int = 599;
+pub const NID_setct_BCIDistributionTBS: c_int = 600;
+pub const NID_setext_genCrypt: c_int = 601;
+pub const NID_setext_miAuth: c_int = 602;
+pub const NID_setext_pinSecure: c_int = 603;
+pub const NID_setext_pinAny: c_int = 604;
+pub const NID_setext_track2: c_int = 605;
+pub const NID_setext_cv: c_int = 606;
+pub const NID_set_policy_root: c_int = 607;
+pub const NID_setCext_hashedRoot: c_int = 608;
+pub const NID_setCext_certType: c_int = 609;
+pub const NID_setCext_merchData: c_int = 610;
+pub const NID_setCext_cCertRequired: c_int = 611;
+pub const NID_setCext_tunneling: c_int = 612;
+pub const NID_setCext_setExt: c_int = 613;
+pub const NID_setCext_setQualf: c_int = 614;
+pub const NID_setCext_PGWYcapabilities: c_int = 615;
+pub const NID_setCext_TokenIdentifier: c_int = 616;
+pub const NID_setCext_Track2Data: c_int = 617;
+pub const NID_setCext_TokenType: c_int = 618;
+pub const NID_setCext_IssuerCapabilities: c_int = 619;
+pub const NID_setAttr_Cert: c_int = 620;
+pub const NID_setAttr_PGWYcap: c_int = 621;
+pub const NID_setAttr_TokenType: c_int = 622;
+pub const NID_setAttr_IssCap: c_int = 623;
+pub const NID_set_rootKeyThumb: c_int = 624;
+pub const NID_set_addPolicy: c_int = 625;
+pub const NID_setAttr_Token_EMV: c_int = 626;
+pub const NID_setAttr_Token_B0Prime: c_int = 627;
+pub const NID_setAttr_IssCap_CVM: c_int = 628;
+pub const NID_setAttr_IssCap_T2: c_int = 629;
+pub const NID_setAttr_IssCap_Sig: c_int = 630;
+pub const NID_setAttr_GenCryptgrm: c_int = 631;
+pub const NID_setAttr_T2Enc: c_int = 632;
+pub const NID_setAttr_T2cleartxt: c_int = 633;
+pub const NID_setAttr_TokICCsig: c_int = 634;
+pub const NID_setAttr_SecDevSig: c_int = 635;
+pub const NID_set_brand_IATA_ATA: c_int = 636;
+pub const NID_set_brand_Diners: c_int = 637;
+pub const NID_set_brand_AmericanExpress: c_int = 638;
+pub const NID_set_brand_JCB: c_int = 639;
+pub const NID_set_brand_Visa: c_int = 640;
+pub const NID_set_brand_MasterCard: c_int = 641;
+pub const NID_set_brand_Novus: c_int = 642;
+pub const NID_des_cdmf: c_int = 643;
+pub const NID_rsaOAEPEncryptionSET: c_int = 644;
+pub const NID_ipsec3: c_int = 749;
+pub const NID_ipsec4: c_int = 750;
+pub const NID_whirlpool: c_int = 804;
+pub const NID_cryptopro: c_int = 805;
+pub const NID_cryptocom: c_int = 806;
+pub const NID_id_GostR3411_94_with_GostR3410_2001: c_int = 807;
+pub const NID_id_GostR3411_94_with_GostR3410_94: c_int = 808;
+pub const NID_id_GostR3411_94: c_int = 809;
+pub const NID_id_HMACGostR3411_94: c_int = 810;
+pub const NID_id_GostR3410_2001: c_int = 811;
+pub const NID_id_GostR3410_94: c_int = 812;
+pub const NID_id_Gost28147_89: c_int = 813;
+pub const NID_gost89_cnt: c_int = 814;
+pub const NID_id_Gost28147_89_MAC: c_int = 815;
+pub const NID_id_GostR3411_94_prf: c_int = 816;
+pub const NID_id_GostR3410_2001DH: c_int = 817;
+pub const NID_id_GostR3410_94DH: c_int = 818;
+pub const NID_id_Gost28147_89_CryptoPro_KeyMeshing: c_int = 819;
+pub const NID_id_Gost28147_89_None_KeyMeshing: c_int = 820;
+pub const NID_id_GostR3411_94_TestParamSet: c_int = 821;
+pub const NID_id_GostR3411_94_CryptoProParamSet: c_int = 822;
+pub const NID_id_Gost28147_89_TestParamSet: c_int = 823;
+pub const NID_id_Gost28147_89_CryptoPro_A_ParamSet: c_int = 824;
+pub const NID_id_Gost28147_89_CryptoPro_B_ParamSet: c_int = 825;
+pub const NID_id_Gost28147_89_CryptoPro_C_ParamSet: c_int = 826;
+pub const NID_id_Gost28147_89_CryptoPro_D_ParamSet: c_int = 827;
+pub const NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet: c_int = 828;
+pub const NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet: c_int = 829;
+pub const NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet: c_int = 830;
+pub const NID_id_GostR3410_94_TestParamSet: c_int = 831;
+pub const NID_id_GostR3410_94_CryptoPro_A_ParamSet: c_int = 832;
+pub const NID_id_GostR3410_94_CryptoPro_B_ParamSet: c_int = 833;
+pub const NID_id_GostR3410_94_CryptoPro_C_ParamSet: c_int = 834;
+pub const NID_id_GostR3410_94_CryptoPro_D_ParamSet: c_int = 835;
+pub const NID_id_GostR3410_94_CryptoPro_XchA_ParamSet: c_int = 836;
+pub const NID_id_GostR3410_94_CryptoPro_XchB_ParamSet: c_int = 837;
+pub const NID_id_GostR3410_94_CryptoPro_XchC_ParamSet: c_int = 838;
+pub const NID_id_GostR3410_2001_TestParamSet: c_int = 839;
+pub const NID_id_GostR3410_2001_CryptoPro_A_ParamSet: c_int = 840;
+pub const NID_id_GostR3410_2001_CryptoPro_B_ParamSet: c_int = 841;
+pub const NID_id_GostR3410_2001_CryptoPro_C_ParamSet: c_int = 842;
+pub const NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet: c_int = 843;
+pub const NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet: c_int = 844;
+pub const NID_id_GostR3410_94_a: c_int = 845;
+pub const NID_id_GostR3410_94_aBis: c_int = 846;
+pub const NID_id_GostR3410_94_b: c_int = 847;
+pub const NID_id_GostR3410_94_bBis: c_int = 848;
+pub const NID_id_Gost28147_89_cc: c_int = 849;
+pub const NID_id_GostR3410_94_cc: c_int = 850;
+pub const NID_id_GostR3410_2001_cc: c_int = 851;
+pub const NID_id_GostR3411_94_with_GostR3410_94_cc: c_int = 852;
+pub const NID_id_GostR3411_94_with_GostR3410_2001_cc: c_int = 853;
+pub const NID_id_GostR3410_2001_ParamSet_cc: c_int = 854;
+pub const NID_camellia_128_cbc: c_int = 751;
+pub const NID_camellia_192_cbc: c_int = 752;
+pub const NID_camellia_256_cbc: c_int = 753;
+pub const NID_id_camellia128_wrap: c_int = 907;
+pub const NID_id_camellia192_wrap: c_int = 908;
+pub const NID_id_camellia256_wrap: c_int = 909;
+pub const NID_camellia_128_ecb: c_int = 754;
+pub const NID_camellia_128_ofb128: c_int = 766;
+pub const NID_camellia_128_cfb128: c_int = 757;
+pub const NID_camellia_192_ecb: c_int = 755;
+pub const NID_camellia_192_ofb128: c_int = 767;
+pub const NID_camellia_192_cfb128: c_int = 758;
+pub const NID_camellia_256_ecb: c_int = 756;
+pub const NID_camellia_256_ofb128: c_int = 768;
+pub const NID_camellia_256_cfb128: c_int = 759;
+pub const NID_camellia_128_cfb1: c_int = 760;
+pub const NID_camellia_192_cfb1: c_int = 761;
+pub const NID_camellia_256_cfb1: c_int = 762;
+pub const NID_camellia_128_cfb8: c_int = 763;
+pub const NID_camellia_192_cfb8: c_int = 764;
+pub const NID_camellia_256_cfb8: c_int = 765;
+pub const NID_kisa: c_int = 773;
+pub const NID_seed_ecb: c_int = 776;
+pub const NID_seed_cbc: c_int = 777;
+pub const NID_seed_cfb128: c_int = 779;
+pub const NID_seed_ofb128: c_int = 778;
+pub const NID_hmac: c_int = 855;
+pub const NID_cmac: c_int = 894;
+pub const NID_rc4_hmac_md5: c_int = 915;
+pub const NID_aes_128_cbc_hmac_sha1: c_int = 916;
+pub const NID_aes_192_cbc_hmac_sha1: c_int = 917;
+pub const NID_aes_256_cbc_hmac_sha1: c_int = 918;
+#[cfg(ossl111)]
+pub const NID_X25519: c_int = 1034;
+#[cfg(libressl370)]
+pub const NID_X25519: c_int = 950;
+#[cfg(ossl111)]
+pub const NID_X448: c_int = 1035;
+#[cfg(ossl110)]
+pub const NID_hkdf: c_int = 1036;
+#[cfg(libressl360)]
+pub const NID_hkdf: c_int = 1022;
+#[cfg(ossl111)]
+pub const NID_poly1305: c_int = 1061;
+#[cfg(ossl111)]
+pub const NID_ED25519: c_int = 1087;
+#[cfg(libressl370)]
+pub const NID_ED25519: c_int = 952;
+#[cfg(ossl111)]
+pub const NID_ED448: c_int = 1088;
+#[cfg(ossl111)]
+pub const NID_sm2: c_int = 1172;
+#[cfg(ossl111)]
+pub const NID_sm3: c_int = 1143;
+#[cfg(libressl291)]
+pub const NID_sm3: c_int = 968;
+#[cfg(ossl111)]
+pub const NID_sm3WithRSAEncryption: c_int = 1144;
+#[cfg(libressl291)]
+pub const NID_sm3WithRSAEncryption: c_int = 969;
+#[cfg(ossl111)]
+pub const NID_sm4_ecb: c_int = 1133;
+#[cfg(libressl291)]
+pub const NID_sm4_ecb: c_int = 973;
+#[cfg(ossl111)]
+pub const NID_sm4_cbc: c_int = 1134;
+#[cfg(libressl291)]
+pub const NID_sm4_cbc: c_int = 974;
+#[cfg(ossl111)]
+pub const NID_sm4_ofb128: c_int = 1135;
+#[cfg(libressl291)]
+pub const NID_sm4_ofb128: c_int = 975;
+#[cfg(ossl111)]
+pub const NID_sm4_cfb128: c_int = 1137;
+#[cfg(libressl291)]
+pub const NID_sm4_cfb128: c_int = 976;
+#[cfg(ossl111)]
+pub const NID_sm4_cfb1: c_int = 1136;
+#[cfg(libressl291)]
+pub const NID_sm4_cfb1: c_int = 977;
+#[cfg(ossl111)]
+pub const NID_sm4_cfb8: c_int = 1138;
+#[cfg(libressl291)]
+pub const NID_sm4_cfb8: c_int = 978;
+#[cfg(ossl111)]
+pub const NID_sm4_ctr: c_int = 1139;
+#[cfg(libressl291)]
+pub const NID_sm4_ctr: c_int = 979;
+#[cfg(ossl111)]
+pub const NID_sha3_224: c_int = 1096;
+#[cfg(libressl380)]
+pub const NID_sha3_224: c_int = 1031;
+#[cfg(ossl111)]
+pub const NID_sha3_256: c_int = 1097;
+#[cfg(libressl380)]
+pub const NID_sha3_256: c_int = 1032;
+#[cfg(ossl111)]
+pub const NID_sha3_384: c_int = 1098;
+#[cfg(libressl380)]
+pub const NID_sha3_384: c_int = 1033;
+#[cfg(ossl111)]
+pub const NID_sha3_512: c_int = 1099;
+#[cfg(libressl380)]
+pub const NID_sha3_512: c_int = 1034;
+#[cfg(ossl111)]
+pub const NID_shake128: c_int = 1100;
+#[cfg(ossl111)]
+pub const NID_shake256: c_int = 1101;
+#[cfg(ossl110)]
+pub const NID_chacha20_poly1305: c_int = 1018;
+#[cfg(libressl271)]
+pub const NID_chacha20_poly1305: c_int = 967;
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/ocsp.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/ocsp.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/ocsp.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/ocsp.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,35 @@
+use libc::*;
+
+pub const OCSP_REVOKED_STATUS_NOSTATUS: c_int = -1;
+pub const OCSP_REVOKED_STATUS_UNSPECIFIED: c_int = 0;
+pub const OCSP_REVOKED_STATUS_KEYCOMPROMISE: c_int = 1;
+pub const OCSP_REVOKED_STATUS_CACOMPROMISE: c_int = 2;
+pub const OCSP_REVOKED_STATUS_AFFILIATIONCHANGED: c_int = 3;
+pub const OCSP_REVOKED_STATUS_SUPERSEDED: c_int = 4;
+pub const OCSP_REVOKED_STATUS_CESSATIONOFOPERATION: c_int = 5;
+pub const OCSP_REVOKED_STATUS_CERTIFICATEHOLD: c_int = 6;
+pub const OCSP_REVOKED_STATUS_REMOVEFROMCRL: c_int = 8;
+
+pub const OCSP_NOCERTS: c_ulong = 0x1;
+pub const OCSP_NOINTERN: c_ulong = 0x2;
+pub const OCSP_NOSIGS: c_ulong = 0x4;
+pub const OCSP_NOCHAIN: c_ulong = 0x8;
+pub const OCSP_NOVERIFY: c_ulong = 0x10;
+pub const OCSP_NOEXPLICIT: c_ulong = 0x20;
+pub const OCSP_NOCASIGN: c_ulong = 0x40;
+pub const OCSP_NODELEGATED: c_ulong = 0x80;
+pub const OCSP_NOCHECKS: c_ulong = 0x100;
+pub const OCSP_TRUSTOTHER: c_ulong = 0x200;
+pub const OCSP_RESPID_KEY: c_ulong = 0x400;
+pub const OCSP_NOTIME: c_ulong = 0x800;
+
+pub const OCSP_RESPONSE_STATUS_SUCCESSFUL: c_int = 0;
+pub const OCSP_RESPONSE_STATUS_MALFORMEDREQUEST: c_int = 1;
+pub const OCSP_RESPONSE_STATUS_INTERNALERROR: c_int = 2;
+pub const OCSP_RESPONSE_STATUS_TRYLATER: c_int = 3;
+pub const OCSP_RESPONSE_STATUS_SIGREQUIRED: c_int = 5;
+pub const OCSP_RESPONSE_STATUS_UNAUTHORIZED: c_int = 6;
+
+pub const V_OCSP_CERTSTATUS_GOOD: c_int = 0;
+pub const V_OCSP_CERTSTATUS_REVOKED: c_int = 1;
+pub const V_OCSP_CERTSTATUS_UNKNOWN: c_int = 2;
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/pem.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/pem.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/pem.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/pem.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,3 @@
+use libc::*;
+
+pub const PEM_R_NO_START_LINE: c_int = 108;
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/pkcs7.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/pkcs7.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/pkcs7.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/pkcs7.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,20 @@
+use libc::*;
+
+pub const PKCS7_TEXT: c_int = 0x1;
+pub const PKCS7_NOCERTS: c_int = 0x2;
+pub const PKCS7_NOSIGS: c_int = 0x4;
+pub const PKCS7_NOCHAIN: c_int = 0x8;
+pub const PKCS7_NOINTERN: c_int = 0x10;
+pub const PKCS7_NOVERIFY: c_int = 0x20;
+pub const PKCS7_DETACHED: c_int = 0x40;
+pub const PKCS7_BINARY: c_int = 0x80;
+pub const PKCS7_NOATTR: c_int = 0x100;
+pub const PKCS7_NOSMIMECAP: c_int = 0x200;
+pub const PKCS7_NOOLDMIMETYPE: c_int = 0x400;
+pub const PKCS7_CRLFEOL: c_int = 0x800;
+pub const PKCS7_STREAM: c_int = 0x1000;
+pub const PKCS7_NOCRL: c_int = 0x2000;
+pub const PKCS7_PARTIAL: c_int = 0x4000;
+pub const PKCS7_REUSE_DIGEST: c_int = 0x8000;
+#[cfg(not(any(ossl101, ossl102, libressl)))]
+pub const PKCS7_NO_DUAL_CONTENT: c_int = 0x10000;
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/rsa.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/rsa.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/rsa.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/rsa.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,101 @@
+use libc::*;
+use std::ptr;
+
+use super::super::*;
+
+pub const RSA_F4: c_long = 0x10001;
+
+cfg_if! {
+    if #[cfg(not(ossl300))] {
+        pub unsafe fn EVP_PKEY_CTX_set_rsa_padding(ctx: *mut EVP_PKEY_CTX, pad: c_int) -> c_int {
+            EVP_PKEY_CTX_ctrl(
+                ctx,
+                EVP_PKEY_RSA,
+                -1,
+                EVP_PKEY_CTRL_RSA_PADDING,
+                pad,
+                ptr::null_mut(),
+            )
+        }
+        pub unsafe fn EVP_PKEY_CTX_get_rsa_padding(ctx: *mut EVP_PKEY_CTX, ppad: *mut c_int) -> c_int {
+            EVP_PKEY_CTX_ctrl(
+                ctx,
+                EVP_PKEY_RSA,
+                -1,
+                EVP_PKEY_CTRL_GET_RSA_PADDING,
+                0,
+                ppad as *mut c_void,
+            )
+        }
+
+        pub unsafe fn EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx: *mut EVP_PKEY_CTX, len: c_int) -> c_int {
+            EVP_PKEY_CTX_ctrl(
+                ctx,
+                EVP_PKEY_RSA,
+                EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY,
+                EVP_PKEY_CTRL_RSA_PSS_SALTLEN,
+                len,
+                ptr::null_mut(),
+            )
+        }
+
+        pub unsafe fn EVP_PKEY_CTX_set_rsa_mgf1_md(ctx: *mut EVP_PKEY_CTX, md: *mut EVP_MD) -> c_int {
+            EVP_PKEY_CTX_ctrl(
+                ctx,
+                EVP_PKEY_RSA,
+                EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT,
+                EVP_PKEY_CTRL_RSA_MGF1_MD,
+                0,
+                md as *mut c_void,
+            )
+        }
+    }
+}
+
+#[cfg(any(ossl102, libressl310))]
+pub unsafe fn EVP_PKEY_CTX_set_rsa_oaep_md(ctx: *mut EVP_PKEY_CTX, md: *mut EVP_MD) -> c_int {
+    EVP_PKEY_CTX_ctrl(
+        ctx,
+        EVP_PKEY_RSA,
+        EVP_PKEY_OP_TYPE_CRYPT,
+        EVP_PKEY_CTRL_RSA_OAEP_MD,
+        0,
+        md as *mut c_void,
+    )
+}
+
+#[cfg(any(ossl102, libressl310))]
+pub unsafe fn EVP_PKEY_CTX_set0_rsa_oaep_label(
+    ctx: *mut EVP_PKEY_CTX,
+    label: *mut c_void,
+    len: c_int,
+) -> c_int {
+    EVP_PKEY_CTX_ctrl(
+        ctx,
+        EVP_PKEY_RSA,
+        EVP_PKEY_OP_TYPE_CRYPT,
+        EVP_PKEY_CTRL_RSA_OAEP_LABEL,
+        len,
+        label,
+    )
+}
+
+pub const EVP_PKEY_CTRL_RSA_PADDING: c_int = EVP_PKEY_ALG_CTRL + 1;
+pub const EVP_PKEY_CTRL_RSA_PSS_SALTLEN: c_int = EVP_PKEY_ALG_CTRL + 2;
+
+pub const EVP_PKEY_CTRL_RSA_MGF1_MD: c_int = EVP_PKEY_ALG_CTRL + 5;
+
+pub const EVP_PKEY_CTRL_GET_RSA_PADDING: c_int = EVP_PKEY_ALG_CTRL + 6;
+
+#[cfg(any(ossl102, libressl310))]
+pub const EVP_PKEY_CTRL_RSA_OAEP_MD: c_int = EVP_PKEY_ALG_CTRL + 9;
+#[cfg(any(ossl102, libressl310))]
+pub const EVP_PKEY_CTRL_RSA_OAEP_LABEL: c_int = EVP_PKEY_ALG_CTRL + 10;
+
+pub const RSA_PKCS1_PADDING: c_int = 1;
+#[cfg(not(ossl300))]
+pub const RSA_SSLV23_PADDING: c_int = 2;
+pub const RSA_NO_PADDING: c_int = 3;
+pub const RSA_PKCS1_OAEP_PADDING: c_int = 4;
+pub const RSA_X931_PADDING: c_int = 5;
+pub const RSA_PKCS1_PSS_PADDING: c_int = 6;
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/sha.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/sha.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/sha.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/sha.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,103 @@
+use super::*;
+use libc::*;
+use std::ptr;
+
+#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+pub const SHA_LBLOCK: c_int = 16;
+
+#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+pub type SHA_LONG = c_uint;
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        #[cfg(ossl300)]
+        // Ideally we'd macro define these, but that crashes ctest :(
+        pub unsafe fn SHA1(d: *const c_uchar, n: size_t, md: *mut c_uchar) -> *mut c_uchar {
+            if EVP_Q_digest(
+                ptr::null_mut(),
+                "SHA1\0".as_ptr() as *const c_char,
+                ptr::null(),
+                d as *const c_void,
+                n,
+                md,
+                ptr::null_mut(),
+            ) != 0
+            {
+                md
+            } else {
+                ptr::null_mut()
+            }
+        }
+
+        pub unsafe fn SHA224(d: *const c_uchar, n: size_t, md: *mut c_uchar) -> *mut c_uchar {
+            if EVP_Q_digest(
+                ptr::null_mut(),
+                "SHA224\0".as_ptr() as *const c_char,
+                ptr::null(),
+                d as *const c_void,
+                n,
+                md,
+                ptr::null_mut(),
+            ) != 0 {
+                md
+            } else {
+                ptr::null_mut()
+            }
+        }
+
+        pub unsafe fn SHA256(d: *const c_uchar, n: size_t, md: *mut c_uchar) -> *mut c_uchar {
+            if EVP_Q_digest(
+                ptr::null_mut(),
+                "SHA256\0".as_ptr() as *const c_char,
+                ptr::null(),
+                d as *const c_void,
+                n,
+                md,
+                ptr::null_mut(),
+            ) != 0 {
+                md
+            } else {
+                ptr::null_mut()
+            }
+        }
+    }
+}
+
+#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))]
+pub type SHA_LONG64 = u64;
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        pub unsafe fn SHA384(d: *const c_uchar, n: size_t, md: *mut c_uchar) -> *mut c_uchar {
+            if EVP_Q_digest(
+                ptr::null_mut(),
+                "SHA384\0".as_ptr() as *const c_char,
+                ptr::null(),
+                d as *const c_void,
+                n,
+                md,
+                ptr::null_mut(),
+            ) != 0 {
+                md
+            } else {
+                ptr::null_mut()
+            }
+        }
+
+        pub unsafe fn SHA512(d: *const c_uchar, n: size_t, md: *mut c_uchar) -> *mut c_uchar {
+            if EVP_Q_digest(
+                ptr::null_mut(),
+                "SHA512\0".as_ptr() as *const c_char,
+                ptr::null(),
+                d as *const c_void,
+                n,
+                md,
+                ptr::null_mut(),
+            ) != 0 {
+                md
+            } else {
+                ptr::null_mut()
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/srtp.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/srtp.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/srtp.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/srtp.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,14 @@
+use libc::*;
+
+pub const SRTP_AES128_CM_SHA1_80: c_ulong = 0x0001;
+pub const SRTP_AES128_CM_SHA1_32: c_ulong = 0x0002;
+pub const SRTP_AES128_F8_SHA1_80: c_ulong = 0x0003;
+pub const SRTP_AES128_F8_SHA1_32: c_ulong = 0x0004;
+pub const SRTP_NULL_SHA1_80: c_ulong = 0x0005;
+pub const SRTP_NULL_SHA1_32: c_ulong = 0x0006;
+
+/* AEAD SRTP protection profiles from RFC 7714 */
+#[cfg(ossl110)]
+pub const SRTP_AEAD_AES_128_GCM: c_ulong = 0x0007;
+#[cfg(ossl110)]
+pub const SRTP_AEAD_AES_256_GCM: c_ulong = 0x0008;
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/ssl.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/ssl.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/ssl.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/ssl.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,716 @@
+use libc::*;
+use std::ptr;
+
+use super::*;
+
+#[cfg(not(ossl110))]
+pub const SSL_MAX_KRB5_PRINCIPAL_LENGTH: c_int = 256;
+
+#[cfg(not(ossl110))]
+pub const SSL_MAX_SSL_SESSION_ID_LENGTH: c_int = 32;
+#[cfg(not(ossl110))]
+pub const SSL_MAX_SID_CTX_LENGTH: c_int = 32;
+
+#[cfg(not(ossl110))]
+pub const SSL_MAX_KEY_ARG_LENGTH: c_int = 8;
+#[cfg(not(ossl110))]
+pub const SSL_MAX_MASTER_KEY_LENGTH: c_int = 48;
+
+pub const SSL_SENT_SHUTDOWN: c_int = 1;
+pub const SSL_RECEIVED_SHUTDOWN: c_int = 2;
+
+pub const SSL_FILETYPE_PEM: c_int = X509_FILETYPE_PEM;
+pub const SSL_FILETYPE_ASN1: c_int = X509_FILETYPE_ASN1;
+
+#[cfg(ossl111)]
+pub const SSL_EXT_TLS_ONLY: c_uint = 0x0001;
+/* This extension is only allowed in DTLS */
+#[cfg(ossl111)]
+pub const SSL_EXT_DTLS_ONLY: c_uint = 0x0002;
+/* Some extensions may be allowed in DTLS but we don't implement them for it */
+#[cfg(ossl111)]
+pub const SSL_EXT_TLS_IMPLEMENTATION_ONLY: c_uint = 0x0004;
+/* Most extensions are not defined for SSLv3 but EXT_TYPE_renegotiate is */
+#[cfg(ossl111)]
+pub const SSL_EXT_SSL3_ALLOWED: c_uint = 0x0008;
+/* Extension is only defined for TLS1.2 and below */
+#[cfg(ossl111)]
+pub const SSL_EXT_TLS1_2_AND_BELOW_ONLY: c_uint = 0x0010;
+/* Extension is only defined for TLS1.3 and above */
+#[cfg(ossl111)]
+pub const SSL_EXT_TLS1_3_ONLY: c_uint = 0x0020;
+/* Ignore this extension during parsing if we are resuming */
+#[cfg(ossl111)]
+pub const SSL_EXT_IGNORE_ON_RESUMPTION: c_uint = 0x0040;
+#[cfg(ossl111)]
+pub const SSL_EXT_CLIENT_HELLO: c_uint = 0x0080;
+/* Really means TLS1.2 or below */
+#[cfg(ossl111)]
+pub const SSL_EXT_TLS1_2_SERVER_HELLO: c_uint = 0x0100;
+#[cfg(ossl111)]
+pub const SSL_EXT_TLS1_3_SERVER_HELLO: c_uint = 0x0200;
+#[cfg(ossl111)]
+pub const SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS: c_uint = 0x0400;
+#[cfg(ossl111)]
+pub const SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST: c_uint = 0x0800;
+#[cfg(ossl111)]
+pub const SSL_EXT_TLS1_3_CERTIFICATE: c_uint = 0x1000;
+#[cfg(ossl111)]
+pub const SSL_EXT_TLS1_3_NEW_SESSION_TICKET: c_uint = 0x2000;
+#[cfg(ossl111)]
+pub const SSL_EXT_TLS1_3_CERTIFICATE_REQUEST: c_uint = 0x4000;
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        macro_rules! ssl_op_type {
+            () => {u64};
+        }
+    } else {
+        macro_rules! ssl_op_type {
+            () => {c_ulong};
+        }
+    }
+}
+
+pub const SSL_OP_LEGACY_SERVER_CONNECT: ssl_op_type!() = 0x00000004;
+cfg_if! {
+    if #[cfg(libressl261)] {
+        pub const SSL_OP_TLSEXT_PADDING: ssl_op_type!() = 0x0;
+    } else if #[cfg(any(ossl102, libressl))] {
+        pub const SSL_OP_TLSEXT_PADDING: ssl_op_type!() = 0x10;
+    }
+}
+#[cfg(ossl101)]
+pub const SSL_OP_SAFARI_ECDHE_ECDSA_BUG: ssl_op_type!() = 0x00000040;
+
+pub const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: ssl_op_type!() = 0x00000800;
+
+pub const SSL_OP_NO_QUERY_MTU: ssl_op_type!() = 0x00001000;
+pub const SSL_OP_COOKIE_EXCHANGE: ssl_op_type!() = 0x00002000;
+pub const SSL_OP_NO_TICKET: ssl_op_type!() = 0x00004000;
+cfg_if! {
+    if #[cfg(ossl101)] {
+        pub const SSL_OP_CISCO_ANYCONNECT: ssl_op_type!() = 0x00008000;
+    } else {
+        pub const SSL_OP_CISCO_ANYCONNECT: ssl_op_type!() = 0x0;
+    }
+}
+
+pub const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: ssl_op_type!() = 0x00010000;
+cfg_if! {
+    if #[cfg(ossl101)] {
+        pub const SSL_OP_NO_COMPRESSION: ssl_op_type!() = 0x00020000;
+        pub const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: ssl_op_type!() = 0x00040000;
+    } else {
+        pub const SSL_OP_NO_COMPRESSION: ssl_op_type!() = 0x0;
+        pub const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: ssl_op_type!() = 0x0;
+    }
+}
+
+#[cfg(ossl111)]
+pub const SSL_OP_ENABLE_MIDDLEBOX_COMPAT: ssl_op_type!() = 0x00100000;
+#[cfg(ossl111)]
+pub const SSL_OP_PRIORITIZE_CHACHA: ssl_op_type!() = 0x00200000;
+
+pub const SSL_OP_CIPHER_SERVER_PREFERENCE: ssl_op_type!() = 0x00400000;
+cfg_if! {
+    if #[cfg(libressl280)] {
+        pub const SSL_OP_TLS_ROLLBACK_BUG: ssl_op_type!() = 0;
+    } else {
+        pub const SSL_OP_TLS_ROLLBACK_BUG: ssl_op_type!() = 0x00800000;
+    }
+}
+
+cfg_if! {
+    if #[cfg(ossl101)] {
+        pub const SSL_OP_NO_SSLv3: ssl_op_type!() = 0x02000000;
+    } else {
+        pub const SSL_OP_NO_SSLv3: ssl_op_type!() = 0x0;
+    }
+}
+pub const SSL_OP_NO_TLSv1_1: ssl_op_type!() = 0x10000000;
+pub const SSL_OP_NO_TLSv1_2: ssl_op_type!() = 0x08000000;
+
+pub const SSL_OP_NO_TLSv1: ssl_op_type!() = 0x04000000;
+cfg_if! {
+    if #[cfg(ossl102)] {
+        pub const SSL_OP_NO_DTLSv1: ssl_op_type!() = 0x04000000;
+        pub const SSL_OP_NO_DTLSv1_2: ssl_op_type!() = 0x08000000;
+    } else if #[cfg(libressl332)] {
+        pub const SSL_OP_NO_DTLSv1: ssl_op_type!() = 0x40000000;
+        pub const SSL_OP_NO_DTLSv1_2: ssl_op_type!() = 0x80000000;
+    }
+}
+#[cfg(any(ossl111, libressl340))]
+pub const SSL_OP_NO_TLSv1_3: ssl_op_type!() = 0x20000000;
+
+#[cfg(ossl110h)]
+pub const SSL_OP_NO_RENEGOTIATION: ssl_op_type!() = 0x40000000;
+
+cfg_if! {
+    if #[cfg(ossl111)] {
+        pub const SSL_OP_NO_SSL_MASK: ssl_op_type!() = SSL_OP_NO_SSLv2
+            | SSL_OP_NO_SSLv3
+            | SSL_OP_NO_TLSv1
+            | SSL_OP_NO_TLSv1_1
+            | SSL_OP_NO_TLSv1_2
+            | SSL_OP_NO_TLSv1_3;
+    } else if #[cfg(ossl102)] {
+        pub const SSL_OP_NO_SSL_MASK: ssl_op_type!() =
+            SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2;
+    }
+}
+
+cfg_if! {
+    if #[cfg(libressl261)] {
+        pub const SSL_OP_CRYPTOPRO_TLSEXT_BUG: ssl_op_type!() = 0x0;
+    } else {
+        pub const SSL_OP_CRYPTOPRO_TLSEXT_BUG: ssl_op_type!() = 0x80000000;
+    }
+}
+
+cfg_if! {
+    if #[cfg(ossl300)] {
+        pub const SSL_OP_ALL: ssl_op_type!() = SSL_OP_CRYPTOPRO_TLSEXT_BUG
+            | SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
+            | SSL_OP_TLSEXT_PADDING
+            | SSL_OP_SAFARI_ECDHE_ECDSA_BUG;
+    } else if #[cfg(ossl110f)] {
+        pub const SSL_OP_ALL: ssl_op_type!() = SSL_OP_CRYPTOPRO_TLSEXT_BUG
+            | SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
+            | SSL_OP_LEGACY_SERVER_CONNECT
+            | SSL_OP_TLSEXT_PADDING
+            | SSL_OP_SAFARI_ECDHE_ECDSA_BUG;
+    } else if #[cfg(libressl261)] {
+        pub const SSL_OP_ALL: ssl_op_type!() = 0x4;
+    } else if #[cfg(libressl)] {
+        pub const SSL_OP_ALL: ssl_op_type!() = 0x80000014;
+    } else {
+        pub const SSL_OP_ALL: ssl_op_type!() = 0x80000BFF;
+    }
+}
+
+cfg_if! {
+    if #[cfg(ossl110)] {
+        pub const SSL_OP_MICROSOFT_SESS_ID_BUG: ssl_op_type!() = 0x00000000;
+        pub const SSL_OP_NETSCAPE_CHALLENGE_BUG: ssl_op_type!() = 0x00000000;
+        pub const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: ssl_op_type!() = 0x00000000;
+        pub const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: ssl_op_type!() = 0x00000000;
+        pub const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: ssl_op_type!() = 0x00000000;
+        pub const SSL_OP_TLS_D5_BUG: ssl_op_type!() = 0x00000000;
+        pub const SSL_OP_TLS_BLOCK_PADDING_BUG: ssl_op_type!() = 0x00000000;
+        pub const SSL_OP_SINGLE_ECDH_USE: ssl_op_type!() = 0x00000000;
+        pub const SSL_OP_SINGLE_DH_USE: ssl_op_type!() = 0x00000000;
+        pub const SSL_OP_NO_SSLv2: ssl_op_type!() = 0x00000000;
+    } else if #[cfg(ossl101)] {
+        pub const SSL_OP_MICROSOFT_SESS_ID_BUG: ssl_op_type!() = 0x00000001;
+        pub const SSL_OP_NETSCAPE_CHALLENGE_BUG: ssl_op_type!() = 0x00000002;
+        pub const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: ssl_op_type!() = 0x00000008;
+        pub const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: ssl_op_type!() = 0x00000020;
+        pub const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: ssl_op_type!() = 0x00000080;
+        pub const SSL_OP_TLS_D5_BUG: ssl_op_type!() = 0x00000100;
+        pub const SSL_OP_TLS_BLOCK_PADDING_BUG: ssl_op_type!() = 0x00000200;
+        pub const SSL_OP_SINGLE_ECDH_USE: ssl_op_type!() = 0x00080000;
+        pub const SSL_OP_SINGLE_DH_USE: ssl_op_type!() = 0x00100000;
+        pub const SSL_OP_NO_SSLv2: ssl_op_type!() = 0x01000000;
+    } else {
+        pub const SSL_OP_MICROSOFT_SESS_ID_BUG: ssl_op_type!() = 0x0;
+        pub const SSL_OP_NETSCAPE_CHALLENGE_BUG: ssl_op_type!() = 0x0;
+        pub const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: ssl_op_type!() = 0x0;
+        pub const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: ssl_op_type!() = 0x0;
+        pub const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: ssl_op_type!() = 0x0;
+        pub const SSL_OP_TLS_D5_BUG: ssl_op_type!() = 0x0;
+        pub const SSL_OP_TLS_BLOCK_PADDING_BUG: ssl_op_type!() = 0x0;
+        #[cfg(libressl261)]
+        pub const SSL_OP_SINGLE_ECDH_USE: ssl_op_type!() = 0x0;
+        #[cfg(not(libressl261))]
+        pub const SSL_OP_SINGLE_ECDH_USE: ssl_op_type!() = 0x00080000;
+        pub const SSL_OP_SINGLE_DH_USE: ssl_op_type!() = 0x00100000;
+        pub const SSL_OP_NO_SSLv2: ssl_op_type!() = 0x0;
+    }
+}
+
+pub const SSL_MODE_ENABLE_PARTIAL_WRITE: c_long = 0x1;
+pub const SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER: c_long = 0x2;
+pub const SSL_MODE_AUTO_RETRY: c_long = 0x4;
+pub const SSL_MODE_NO_AUTO_CHAIN: c_long = 0x8;
+pub const SSL_MODE_RELEASE_BUFFERS: c_long = 0x10;
+#[cfg(ossl101)]
+pub const SSL_MODE_SEND_CLIENTHELLO_TIME: c_long = 0x20;
+#[cfg(ossl101)]
+pub const SSL_MODE_SEND_SERVERHELLO_TIME: c_long = 0x40;
+#[cfg(ossl101)]
+pub const SSL_MODE_SEND_FALLBACK_SCSV: c_long = 0x80;
+
+pub unsafe fn SSL_CTX_set_mode(ctx: *mut SSL_CTX, op: c_long) -> c_long {
+    SSL_CTX_ctrl(ctx, SSL_CTRL_MODE, op, ptr::null_mut())
+}
+
+#[cfg(ossl111)]
+pub const SSL_COOKIE_LENGTH: c_int = 4096;
+
+cfg_if! {
+    if #[cfg(not(ossl110))] {
+        pub unsafe fn SSL_CTX_get_options(ctx: *const SSL_CTX) -> c_ulong {
+            SSL_CTX_ctrl(ctx as *mut _, SSL_CTRL_OPTIONS, 0, ptr::null_mut()) as c_ulong
+        }
+
+        pub unsafe fn SSL_CTX_set_options(ctx: *const SSL_CTX, op: c_ulong) -> c_ulong {
+            SSL_CTX_ctrl(
+                ctx as *mut _,
+                SSL_CTRL_OPTIONS,
+                op as c_long,
+                ptr::null_mut(),
+            ) as c_ulong
+        }
+
+        pub unsafe fn SSL_CTX_clear_options(ctx: *const SSL_CTX, op: c_ulong) -> c_ulong {
+            SSL_CTX_ctrl(
+                ctx as *mut _,
+                SSL_CTRL_CLEAR_OPTIONS,
+                op as c_long,
+                ptr::null_mut(),
+            ) as c_ulong
+        }
+    }
+}
+
+pub unsafe fn SSL_set_mtu(ssl: *mut SSL, mtu: c_long) -> c_long {
+    SSL_ctrl(ssl, SSL_CTRL_SET_MTU, mtu, ptr::null_mut())
+}
+
+#[cfg(ossl110)]
+pub unsafe fn SSL_get_extms_support(ssl: *mut SSL) -> c_long {
+    SSL_ctrl(ssl, SSL_CTRL_GET_EXTMS_SUPPORT, 0, ptr::null_mut())
+}
+
+pub const SSL_SESS_CACHE_OFF: c_long = 0x0;
+pub const SSL_SESS_CACHE_CLIENT: c_long = 0x1;
+pub const SSL_SESS_CACHE_SERVER: c_long = 0x2;
+pub const SSL_SESS_CACHE_BOTH: c_long = SSL_SESS_CACHE_CLIENT | SSL_SESS_CACHE_SERVER;
+pub const SSL_SESS_CACHE_NO_AUTO_CLEAR: c_long = 0x80;
+pub const SSL_SESS_CACHE_NO_INTERNAL_LOOKUP: c_long = 0x100;
+pub const SSL_SESS_CACHE_NO_INTERNAL_STORE: c_long = 0x200;
+pub const SSL_SESS_CACHE_NO_INTERNAL: c_long =
+    SSL_SESS_CACHE_NO_INTERNAL_LOOKUP | SSL_SESS_CACHE_NO_INTERNAL_STORE;
+
+pub const OPENSSL_NPN_UNSUPPORTED: c_int = 0;
+pub const OPENSSL_NPN_NEGOTIATED: c_int = 1;
+pub const OPENSSL_NPN_NO_OVERLAP: c_int = 2;
+
+pub const SSL_AD_ILLEGAL_PARAMETER: c_int = SSL3_AD_ILLEGAL_PARAMETER;
+pub const SSL_AD_DECODE_ERROR: c_int = TLS1_AD_DECODE_ERROR;
+pub const SSL_AD_UNRECOGNIZED_NAME: c_int = TLS1_AD_UNRECOGNIZED_NAME;
+pub const SSL_ERROR_NONE: c_int = 0;
+pub const SSL_ERROR_SSL: c_int = 1;
+pub const SSL_ERROR_SYSCALL: c_int = 5;
+pub const SSL_ERROR_WANT_ACCEPT: c_int = 8;
+pub const SSL_ERROR_WANT_CONNECT: c_int = 7;
+pub const SSL_ERROR_WANT_READ: c_int = 2;
+pub const SSL_ERROR_WANT_WRITE: c_int = 3;
+pub const SSL_ERROR_WANT_X509_LOOKUP: c_int = 4;
+pub const SSL_ERROR_ZERO_RETURN: c_int = 6;
+#[cfg(ossl111)]
+pub const SSL_ERROR_WANT_CLIENT_HELLO_CB: c_int = 11;
+pub const SSL_VERIFY_NONE: c_int = 0;
+pub const SSL_VERIFY_PEER: c_int = 1;
+pub const SSL_VERIFY_FAIL_IF_NO_PEER_CERT: c_int = 2;
+pub const SSL_CTRL_SET_TMP_DH: c_int = 3;
+pub const SSL_CTRL_SET_TMP_ECDH: c_int = 4;
+#[cfg(any(libressl, all(ossl101, not(ossl110))))]
+pub const SSL_CTRL_GET_SESSION_REUSED: c_int = 8;
+pub const SSL_CTRL_EXTRA_CHAIN_CERT: c_int = 14;
+pub const SSL_CTRL_SET_MTU: c_int = 17;
+#[cfg(any(libressl, all(ossl101, not(ossl110))))]
+pub const SSL_CTRL_OPTIONS: c_int = 32;
+pub const SSL_CTRL_MODE: c_int = 33;
+pub const SSL_CTRL_SET_READ_AHEAD: c_int = 41;
+pub const SSL_CTRL_SET_SESS_CACHE_SIZE: c_int = 42;
+pub const SSL_CTRL_GET_SESS_CACHE_SIZE: c_int = 43;
+pub const SSL_CTRL_SET_SESS_CACHE_MODE: c_int = 44;
+pub const SSL_CTRL_SET_TLSEXT_SERVERNAME_CB: c_int = 53;
+pub const SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG: c_int = 54;
+pub const SSL_CTRL_SET_TLSEXT_HOSTNAME: c_int = 55;
+pub const SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB: c_int = 63;
+pub const SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG: c_int = 64;
+pub const SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE: c_int = 65;
+pub const SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP: c_int = 70;
+pub const SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP: c_int = 71;
+#[cfg(any(libressl, all(ossl101, not(ossl110))))]
+pub const SSL_CTRL_CLEAR_OPTIONS: c_int = 77;
+pub const SSL_CTRL_GET_EXTRA_CHAIN_CERTS: c_int = 82;
+#[cfg(ossl102)]
+pub const SSL_CTRL_CHAIN_CERT: c_int = 89;
+#[cfg(any(ossl111, libressl252))]
+pub const SSL_CTRL_SET_GROUPS_LIST: c_int = 92;
+#[cfg(any(libressl, all(ossl102, not(ossl110))))]
+pub const SSL_CTRL_SET_ECDH_AUTO: c_int = 94;
+#[cfg(ossl102)]
+pub const SSL_CTRL_SET_SIGALGS_LIST: c_int = 98;
+#[cfg(ossl102)]
+pub const SSL_CTRL_SET_VERIFY_CERT_STORE: c_int = 106;
+#[cfg(ossl300)]
+pub const SSL_CTRL_GET_PEER_TMP_KEY: c_int = 109;
+#[cfg(ossl110)]
+pub const SSL_CTRL_GET_EXTMS_SUPPORT: c_int = 122;
+#[cfg(any(ossl110, libressl261))]
+pub const SSL_CTRL_SET_MIN_PROTO_VERSION: c_int = 123;
+#[cfg(any(ossl110, libressl261))]
+pub const SSL_CTRL_SET_MAX_PROTO_VERSION: c_int = 124;
+#[cfg(any(ossl110g, libressl270))]
+pub const SSL_CTRL_GET_MIN_PROTO_VERSION: c_int = 130;
+#[cfg(any(ossl110g, libressl270))]
+pub const SSL_CTRL_GET_MAX_PROTO_VERSION: c_int = 131;
+#[cfg(ossl300)]
+pub const SSL_CTRL_GET_TMP_KEY: c_int = 133;
+
+pub unsafe fn SSL_CTX_set_tmp_dh(ctx: *mut SSL_CTX, dh: *mut DH) -> c_long {
+    SSL_CTX_ctrl(ctx, SSL_CTRL_SET_TMP_DH, 0, dh as *mut c_void)
+}
+
+pub unsafe fn SSL_CTX_set_tmp_ecdh(ctx: *mut SSL_CTX, key: *mut EC_KEY) -> c_long {
+    SSL_CTX_ctrl(ctx, SSL_CTRL_SET_TMP_ECDH, 0, key as *mut c_void)
+}
+
+pub unsafe fn SSL_set_tmp_dh(ssl: *mut SSL, dh: *mut DH) -> c_long {
+    SSL_ctrl(ssl, SSL_CTRL_SET_TMP_DH, 0, dh as *mut c_void)
+}
+
+pub unsafe fn SSL_set_tmp_ecdh(ssl: *mut SSL, key: *mut EC_KEY) -> c_long {
+    SSL_ctrl(ssl, SSL_CTRL_SET_TMP_ECDH, 0, key as *mut c_void)
+}
+
+pub unsafe fn SSL_CTX_add_extra_chain_cert(ctx: *mut SSL_CTX, x509: *mut X509) -> c_long {
+    SSL_CTX_ctrl(ctx, SSL_CTRL_EXTRA_CHAIN_CERT, 0, x509 as *mut c_void)
+}
+
+pub unsafe fn SSL_CTX_get_extra_chain_certs(
+    ctx: *mut SSL_CTX,
+    chain: *mut *mut stack_st_X509,
+) -> c_long {
+    SSL_CTX_ctrl(ctx, SSL_CTRL_GET_EXTRA_CHAIN_CERTS, 0, chain as *mut c_void)
+}
+
+#[cfg(ossl102)]
+pub unsafe fn SSL_CTX_set0_verify_cert_store(ctx: *mut SSL_CTX, st: *mut X509_STORE) -> c_long {
+    SSL_CTX_ctrl(ctx, SSL_CTRL_SET_VERIFY_CERT_STORE, 0, st as *mut c_void)
+}
+
+#[cfg(ossl102)]
+pub unsafe fn SSL_set0_verify_cert_store(ssl: *mut SSL, st: *mut X509_STORE) -> c_long {
+    SSL_ctrl(ssl, SSL_CTRL_SET_VERIFY_CERT_STORE, 0, st as *mut c_void)
+}
+
+cfg_if! {
+    if #[cfg(ossl111)] {
+        pub unsafe fn SSL_CTX_set1_groups_list(ctx: *mut SSL_CTX, s: *const c_char) -> c_long {
+            SSL_CTX_ctrl(
+                ctx,
+                SSL_CTRL_SET_GROUPS_LIST,
+                0,
+                s as *const c_void as *mut c_void,
+            )
+        }
+    } else if #[cfg(libressl251)] {
+        extern "C" {
+            pub fn SSL_CTX_set1_groups_list(ctx: *mut SSL_CTX, s: *const c_char) -> c_int;
+        }
+    }
+}
+
+#[cfg(ossl102)]
+pub unsafe fn SSL_add0_chain_cert(ssl: *mut SSL, ptr: *mut X509) -> c_long {
+    SSL_ctrl(ssl, SSL_CTRL_CHAIN_CERT, 0, ptr as *mut c_void)
+}
+
+#[cfg(ossl102)]
+pub unsafe fn SSL_CTX_set1_sigalgs_list(ctx: *mut SSL_CTX, s: *const c_char) -> c_long {
+    SSL_CTX_ctrl(
+        ctx,
+        SSL_CTRL_SET_SIGALGS_LIST,
+        0,
+        s as *const c_void as *mut c_void,
+    )
+}
+
+#[cfg(any(libressl, all(ossl102, not(ossl110))))]
+pub unsafe fn SSL_CTX_set_ecdh_auto(ctx: *mut SSL_CTX, onoff: c_int) -> c_int {
+    SSL_CTX_ctrl(
+        ctx,
+        SSL_CTRL_SET_ECDH_AUTO,
+        onoff as c_long,
+        ptr::null_mut(),
+    ) as c_int
+}
+
+#[cfg(any(libressl, all(ossl102, not(ossl110))))]
+pub unsafe fn SSL_set_ecdh_auto(ssl: *mut SSL, onoff: c_int) -> c_int {
+    SSL_ctrl(
+        ssl,
+        SSL_CTRL_SET_ECDH_AUTO,
+        onoff as c_long,
+        ptr::null_mut(),
+    ) as c_int
+}
+
+cfg_if! {
+    if #[cfg(ossl110)] {
+        pub unsafe fn SSL_CTX_set_min_proto_version(ctx: *mut SSL_CTX, version: c_int) -> c_int {
+            SSL_CTX_ctrl(
+                ctx,
+                SSL_CTRL_SET_MIN_PROTO_VERSION,
+                version as c_long,
+                ptr::null_mut(),
+            ) as c_int
+        }
+
+        pub unsafe fn SSL_CTX_set_max_proto_version(ctx: *mut SSL_CTX, version: c_int) -> c_int {
+            SSL_CTX_ctrl(
+                ctx,
+                SSL_CTRL_SET_MAX_PROTO_VERSION,
+                version as c_long,
+                ptr::null_mut(),
+            ) as c_int
+        }
+
+        pub unsafe fn SSL_set_min_proto_version(s: *mut SSL, version: c_int) -> c_int {
+            SSL_ctrl(
+                s,
+                SSL_CTRL_SET_MIN_PROTO_VERSION,
+                version as c_long,
+                ptr::null_mut(),
+            ) as c_int
+        }
+
+        pub unsafe fn SSL_set_max_proto_version(s: *mut SSL, version: c_int) -> c_int {
+            SSL_ctrl(
+                s,
+                SSL_CTRL_SET_MAX_PROTO_VERSION,
+                version as c_long,
+                ptr::null_mut(),
+            ) as c_int
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(ossl110g)] {
+        pub unsafe fn SSL_CTX_get_min_proto_version(ctx: *mut SSL_CTX) -> c_int {
+            SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, ptr::null_mut()) as c_int
+        }
+
+        pub unsafe fn SSL_CTX_get_max_proto_version(ctx: *mut SSL_CTX) -> c_int {
+            SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, ptr::null_mut()) as c_int
+        }
+        pub unsafe fn SSL_get_min_proto_version(s: *mut SSL) -> c_int {
+            SSL_ctrl(s, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, ptr::null_mut()) as c_int
+        }
+        pub unsafe fn SSL_get_max_proto_version(s: *mut SSL) -> c_int {
+            SSL_ctrl(s, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, ptr::null_mut()) as c_int
+        }
+    }
+}
+cfg_if! {
+    if #[cfg(ossl300)] {
+        pub unsafe fn SSL_get_peer_tmp_key(ssl: *mut SSL, key: *mut *mut EVP_PKEY) -> c_long {
+            SSL_ctrl(ssl, SSL_CTRL_GET_PEER_TMP_KEY, 0, key as *mut c_void)
+        }
+
+        pub unsafe fn SSL_get_tmp_key(ssl: *mut SSL, key: *mut *mut EVP_PKEY) -> c_long {
+            SSL_ctrl(ssl, SSL_CTRL_GET_TMP_KEY, 0, key as *mut c_void)
+        }
+    }
+}
+
+#[cfg(ossl111)]
+pub const SSL_CLIENT_HELLO_SUCCESS: c_int = 1;
+#[cfg(ossl111)]
+pub const SSL_CLIENT_HELLO_ERROR: c_int = 0;
+#[cfg(ossl111)]
+pub const SSL_CLIENT_HELLO_RETRY: c_int = -1;
+
+#[cfg(any(ossl111, libressl340))]
+pub const SSL_READ_EARLY_DATA_ERROR: c_int = 0;
+#[cfg(any(ossl111, libressl340))]
+pub const SSL_READ_EARLY_DATA_SUCCESS: c_int = 1;
+#[cfg(any(ossl111, libressl340))]
+pub const SSL_READ_EARLY_DATA_FINISH: c_int = 2;
+
+cfg_if! {
+    if #[cfg(ossl110)] {
+        pub unsafe fn SSL_get_ex_new_index(
+            l: c_long,
+            p: *mut c_void,
+            newf: Option<CRYPTO_EX_new>,
+            dupf: Option<CRYPTO_EX_dup>,
+            freef: Option<CRYPTO_EX_free>,
+        ) -> c_int {
+            CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL, l, p, newf, dupf, freef)
+        }
+    }
+}
+cfg_if! {
+    if #[cfg(ossl110)] {
+        pub unsafe fn SSL_CTX_get_ex_new_index(
+            l: c_long,
+            p: *mut c_void,
+            newf: Option<CRYPTO_EX_new>,
+            dupf: Option<CRYPTO_EX_dup>,
+            freef: Option<CRYPTO_EX_free>,
+        ) -> c_int {
+            CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL_CTX, l, p, newf, dupf, freef)
+        }
+    }
+}
+
+pub unsafe fn SSL_CTX_sess_set_cache_size(ctx: *mut SSL_CTX, t: c_long) -> c_long {
+    SSL_CTX_ctrl(ctx, SSL_CTRL_SET_SESS_CACHE_SIZE, t, ptr::null_mut())
+}
+
+pub unsafe fn SSL_CTX_sess_get_cache_size(ctx: *mut SSL_CTX) -> c_long {
+    SSL_CTX_ctrl(ctx, SSL_CTRL_GET_SESS_CACHE_SIZE, 0, ptr::null_mut())
+}
+
+pub unsafe fn SSL_CTX_set_session_cache_mode(ctx: *mut SSL_CTX, m: c_long) -> c_long {
+    SSL_CTX_ctrl(ctx, SSL_CTRL_SET_SESS_CACHE_MODE, m, ptr::null_mut())
+}
+
+pub unsafe fn SSL_CTX_set_read_ahead(ctx: *mut SSL_CTX, m: c_long) -> c_long {
+    SSL_CTX_ctrl(ctx, SSL_CTRL_SET_READ_AHEAD, m, ptr::null_mut())
+}
+
+#[allow(clashing_extern_declarations)]
+extern "C" {
+    #[deprecated(note = "use SSL_CTX_set_tmp_dh_callback__fixed_rust instead")]
+    pub fn SSL_CTX_set_tmp_dh_callback(
+        ctx: *mut SSL_CTX,
+        dh: unsafe extern "C" fn(ssl: *mut SSL, is_export: c_int, keylength: c_int) -> *mut DH,
+    );
+    #[deprecated(note = "use SSL_set_tmp_dh_callback__fixed_rust instead")]
+    pub fn SSL_set_tmp_dh_callback(
+        ctx: *mut SSL,
+        dh: unsafe extern "C" fn(ssl: *mut SSL, is_export: c_int, keylength: c_int) -> *mut DH,
+    );
+    #[deprecated(note = "use SSL_CTX_set_tmp_ecdh_callback__fixed_rust instead")]
+    #[cfg(not(ossl110))]
+    pub fn SSL_CTX_set_tmp_ecdh_callback(
+        ctx: *mut SSL_CTX,
+        ecdh: unsafe extern "C" fn(
+            ssl: *mut SSL,
+            is_export: c_int,
+            keylength: c_int,
+        ) -> *mut EC_KEY,
+    );
+    #[deprecated(note = "use SSL_set_tmp_ecdh_callback__fixed_rust instead")]
+    #[cfg(not(ossl110))]
+    pub fn SSL_set_tmp_ecdh_callback(
+        ssl: *mut SSL,
+        ecdh: unsafe extern "C" fn(
+            ssl: *mut SSL,
+            is_export: c_int,
+            keylength: c_int,
+        ) -> *mut EC_KEY,
+    );
+
+    #[deprecated(note = "use SSL_CTX_callback_ctrl__fixed_rust instead")]
+    pub fn SSL_CTX_callback_ctrl(
+        ctx: *mut SSL_CTX,
+        cmd: c_int,
+        fp: Option<extern "C" fn()>,
+    ) -> c_long;
+
+    #[deprecated(note = "use SSL_CTX_set_alpn_select_cb__fixed_rust instead")]
+    #[cfg(any(ossl102, libressl261))]
+    pub fn SSL_CTX_set_alpn_select_cb(
+        ssl: *mut SSL_CTX,
+        cb: extern "C" fn(
+            ssl: *mut SSL,
+            out: *mut *const c_uchar,
+            outlen: *mut c_uchar,
+            inbuf: *const c_uchar,
+            inlen: c_uint,
+            arg: *mut c_void,
+        ) -> c_int,
+        arg: *mut c_void,
+    );
+}
+
+#[cfg(not(ossl110))]
+pub unsafe fn SSL_session_reused(ssl: *mut SSL) -> c_int {
+    SSL_ctrl(ssl, SSL_CTRL_GET_SESSION_REUSED, 0, ptr::null_mut()) as c_int
+}
+
+#[cfg(ossl110)]
+pub const OPENSSL_INIT_LOAD_SSL_STRINGS: u64 = 0x00200000;
+#[cfg(ossl111b)]
+pub const OPENSSL_INIT_NO_ATEXIT: u64 = 0x00080000;
+
+cfg_if! {
+    if #[cfg(ossl330)] {
+        pub const SSL_VALUE_CLASS_GENERIC: c_uint = 0;
+        pub const SSL_VALUE_CLASS_FEATURE_REQUEST: c_uint = 1;
+        pub const SSL_VALUE_CLASS_FEATURE_PEER_REQUEST: c_uint = 2;
+        pub const SSL_VALUE_CLASS_FEATURE_NEGOTIATED: c_uint = 3;
+
+        pub const SSL_VALUE_NONE: c_uint = 0;
+        pub const SSL_VALUE_QUIC_STREAM_BIDI_LOCAL_AVAIL: c_uint = 1;
+        pub const SSL_VALUE_QUIC_STREAM_BIDI_REMOTE_AVAIL: c_uint = 2;
+        pub const SSL_VALUE_QUIC_STREAM_UNI_LOCAL_AVAIL: c_uint = 3;
+        pub const SSL_VALUE_QUIC_STREAM_UNI_REMOTE_AVAIL: c_uint = 4;
+        pub const SSL_VALUE_QUIC_IDLE_TIMEOUT: c_uint = 5;
+        pub const SSL_VALUE_EVENT_HANDLING_MODE: c_uint = 6;
+        pub const SSL_VALUE_STREAM_WRITE_BUF_SIZE: c_uint = 7;
+        pub const SSL_VALUE_STREAM_WRITE_BUF_USED: c_uint = 8;
+        pub const SSL_VALUE_STREAM_WRITE_BUF_AVAIL: c_uint = 9;
+
+        pub const SSL_VALUE_EVENT_HANDLING_MODE_INHERIT: c_uint = 0;
+        pub const SSL_VALUE_EVENT_HANDLING_MODE_IMPLICIT: c_uint = 1;
+        pub const SSL_VALUE_EVENT_HANDLING_MODE_EXPLICIT: c_uint = 2;
+
+        pub unsafe fn SSL_get_generic_value_uint(ssl: *mut SSL, id: u32, value: *mut u64) -> c_int {
+            SSL_get_value_uint(ssl, SSL_VALUE_CLASS_GENERIC, id, value)
+        }
+        pub unsafe fn SSL_set_generic_value_uint(ssl: *mut SSL, id: u32, value: u64) -> c_int {
+            SSL_set_value_uint(ssl, SSL_VALUE_CLASS_GENERIC, id, value)
+        }
+        pub unsafe fn SSL_get_feature_request_uint(ssl: *mut SSL, id: u32, value: *mut u64) -> c_int {
+            SSL_get_value_uint(ssl, SSL_VALUE_CLASS_FEATURE_REQUEST, id, value)
+        }
+        pub unsafe fn SSL_set_feature_request_uint(ssl: *mut SSL, id: u32, value: u64) -> c_int {
+            SSL_set_value_uint(ssl, SSL_VALUE_CLASS_FEATURE_REQUEST, id, value)
+        }
+        pub unsafe fn SSL_get_feature_peer_request_uint(ssl: *mut SSL, id: u32, value: *mut u64) -> c_int {
+            SSL_get_value_uint(ssl, SSL_VALUE_CLASS_FEATURE_PEER_REQUEST, id, value)
+        }
+        pub unsafe fn SSL_get_feature_negotiated_uint(ssl: *mut SSL, id: u32, value: *mut u64) -> c_int {
+            SSL_get_value_uint(ssl, SSL_VALUE_CLASS_FEATURE_NEGOTIATED, id, value)
+        }
+        pub unsafe fn SSL_get_quic_stream_bidi_local_avail(ssl: *mut SSL, value: *mut u64) -> c_int {
+            SSL_get_generic_value_uint(ssl, SSL_VALUE_QUIC_STREAM_BIDI_LOCAL_AVAIL, value)
+        }
+        pub unsafe fn SSL_get_quic_stream_bidi_remote_avail(ssl: *mut SSL, value: *mut u64) -> c_int {
+            SSL_get_generic_value_uint(ssl, SSL_VALUE_QUIC_STREAM_BIDI_REMOTE_AVAIL, value)
+        }
+        pub unsafe fn SSL_get_quic_stream_uni_local_avail(ssl: *mut SSL, value: *mut u64) -> c_int {
+            SSL_get_generic_value_uint(ssl, SSL_VALUE_QUIC_STREAM_UNI_LOCAL_AVAIL, value)
+        }
+        pub unsafe fn SSL_get_quic_stream_uni_remote_avail(ssl: *mut SSL, value: *mut u64) -> c_int {
+            SSL_get_generic_value_uint(ssl, SSL_VALUE_QUIC_STREAM_UNI_REMOTE_AVAIL, value)
+        }
+        pub unsafe fn SSL_get_event_handling_mode(ssl: *mut SSL, value: *mut u64) -> c_int {
+            SSL_get_generic_value_uint(ssl, SSL_VALUE_EVENT_HANDLING_MODE, value)
+        }
+        pub unsafe fn SSL_set_event_handling_mode(ssl: *mut SSL, value: u64) -> c_int {
+            SSL_set_generic_value_uint(ssl, SSL_VALUE_EVENT_HANDLING_MODE, value)
+        }
+        pub unsafe fn SSL_get_stream_write_buf_size(ssl: *mut SSL, value: *mut u64) -> c_int {
+            SSL_get_generic_value_uint(ssl, SSL_VALUE_STREAM_WRITE_BUF_SIZE, value)
+        }
+        pub unsafe fn SSL_get_stream_write_buf_avail(ssl: *mut SSL, value: *mut u64) -> c_int {
+            SSL_get_generic_value_uint(ssl, SSL_VALUE_STREAM_WRITE_BUF_AVAIL, value)
+        }
+        pub unsafe fn SSL_get_stream_write_buf_used(ssl: *mut SSL, value: *mut u64) -> c_int {
+            SSL_get_generic_value_uint(ssl, SSL_VALUE_STREAM_WRITE_BUF_USED, value)
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/ssl3.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/ssl3.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/ssl3.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/ssl3.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+use libc::*;
+
+pub const SSL3_VERSION: c_int = 0x300;
+
+pub const SSL3_AD_ILLEGAL_PARAMETER: c_int = 47;
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/tls1.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/tls1.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/tls1.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/tls1.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,114 @@
+use libc::*;
+use std::mem;
+use std::ptr;
+
+use super::*;
+
+pub const TLS1_VERSION: c_int = 0x301;
+pub const TLS1_1_VERSION: c_int = 0x302;
+pub const TLS1_2_VERSION: c_int = 0x303;
+#[cfg(any(ossl111, libressl340))]
+pub const TLS1_3_VERSION: c_int = 0x304;
+
+pub const DTLS1_VERSION: c_int = 0xFEFF;
+#[cfg(any(ossl102, libressl332))]
+pub const DTLS1_2_VERSION: c_int = 0xFEFD;
+
+pub const TLS1_AD_DECODE_ERROR: c_int = 50;
+pub const TLS1_AD_UNRECOGNIZED_NAME: c_int = 112;
+
+pub const TLSEXT_NAMETYPE_host_name: c_int = 0;
+pub const TLSEXT_STATUSTYPE_ocsp: c_int = 1;
+
+pub unsafe fn SSL_set_tlsext_host_name(s: *mut SSL, name: *mut c_char) -> c_long {
+    SSL_ctrl(
+        s,
+        SSL_CTRL_SET_TLSEXT_HOSTNAME,
+        TLSEXT_NAMETYPE_host_name as c_long,
+        name as *mut c_void,
+    )
+}
+
+pub unsafe fn SSL_set_tlsext_status_type(s: *mut SSL, type_: c_int) -> c_long {
+    SSL_ctrl(
+        s,
+        SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,
+        type_ as c_long,
+        ptr::null_mut(),
+    )
+}
+
+pub unsafe fn SSL_get_tlsext_status_ocsp_resp(ssl: *mut SSL, resp: *mut *mut c_uchar) -> c_long {
+    SSL_ctrl(
+        ssl,
+        SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP,
+        0,
+        resp as *mut c_void,
+    )
+}
+
+pub unsafe fn SSL_set_tlsext_status_ocsp_resp(
+    ssl: *mut SSL,
+    resp: *mut c_uchar,
+    len: c_long,
+) -> c_long {
+    SSL_ctrl(
+        ssl,
+        SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP,
+        len,
+        resp as *mut c_void,
+    )
+}
+
+#[deprecated(note = "use SSL_CTX_set_tlsext_servername_callback__fixed_rust instead")]
+#[allow(deprecated)]
+pub unsafe fn SSL_CTX_set_tlsext_servername_callback(
+    ctx: *mut SSL_CTX,
+    // FIXME should have the right signature
+    cb: Option<extern "C" fn()>,
+) -> c_long {
+    SSL_CTX_callback_ctrl(ctx, SSL_CTRL_SET_TLSEXT_SERVERNAME_CB, cb)
+}
+
+pub unsafe fn SSL_CTX_set_tlsext_servername_callback__fixed_rust(
+    ctx: *mut SSL_CTX,
+    cb: Option<unsafe extern "C" fn(*mut SSL, *mut c_int, *mut c_void) -> c_int>,
+) -> c_long {
+    SSL_CTX_callback_ctrl__fixed_rust(
+        ctx,
+        SSL_CTRL_SET_TLSEXT_SERVERNAME_CB,
+        mem::transmute::<
+            std::option::Option<
+                unsafe extern "C" fn(*mut SSL, *mut c_int, *mut libc::c_void) -> i32,
+            >,
+            std::option::Option<unsafe extern "C" fn()>,
+        >(cb),
+    )
+}
+
+pub const SSL_TLSEXT_ERR_OK: c_int = 0;
+pub const SSL_TLSEXT_ERR_ALERT_WARNING: c_int = 1;
+pub const SSL_TLSEXT_ERR_ALERT_FATAL: c_int = 2;
+pub const SSL_TLSEXT_ERR_NOACK: c_int = 3;
+
+pub unsafe fn SSL_CTX_set_tlsext_servername_arg(ctx: *mut SSL_CTX, arg: *mut c_void) -> c_long {
+    SSL_CTX_ctrl(ctx, SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG, 0, arg)
+}
+
+pub unsafe fn SSL_CTX_set_tlsext_status_cb(
+    ctx: *mut SSL_CTX,
+    cb: Option<unsafe extern "C" fn(*mut SSL, *mut c_void) -> c_int>,
+) -> c_long {
+    SSL_CTX_callback_ctrl__fixed_rust(
+        ctx,
+        SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,
+        mem::transmute::<
+            std::option::Option<unsafe extern "C" fn(*mut SSL, *mut c_void) -> i32>,
+            std::option::Option<unsafe extern "C" fn()>,
+        >(cb),
+    )
+}
+
+pub unsafe fn SSL_CTX_set_tlsext_status_arg(ctx: *mut SSL_CTX, arg: *mut c_void) -> c_long {
+    SSL_CTX_ctrl(ctx, SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG, 0, arg)
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/types.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/types.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/types.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/types.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,21 @@
+use libc::*;
+
+use super::*;
+
+cfg_if! {
+    if #[cfg(any(ossl110, libressl280))] {
+        pub enum EVP_PKEY {}
+    } else {
+        #[repr(C)]
+        pub struct EVP_PKEY {
+            pub type_: c_int,
+            pub save_type: c_int,
+            pub references: c_int,
+            pub ameth: *const EVP_PKEY_ASN1_METHOD,
+            pub engine: *mut ENGINE,
+            pub pkey: *mut c_void,
+            pub save_parameters: c_int,
+            pub attributes: *mut stack_st_X509_ATTRIBUTE,
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/x509.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/x509.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/x509.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/x509.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,15 @@
+use libc::*;
+
+pub const X509_FILETYPE_PEM: c_int = 1;
+pub const X509_FILETYPE_ASN1: c_int = 2;
+pub const X509_FILETYPE_DEFAULT: c_int = 3;
+
+pub const ASN1_R_HEADER_TOO_LONG: c_int = 123;
+
+cfg_if! {
+    if #[cfg(not(any(ossl110, libressl350)))] {
+        pub const X509_LU_FAIL: c_int = 0;
+        pub const X509_LU_X509: c_int = 1;
+        pub const X509_LU_CRL: c_int = 2;
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/x509_vfy.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/x509_vfy.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/x509_vfy.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/x509_vfy.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,149 @@
+use libc::*;
+
+use super::*;
+
+pub const X509_V_OK: c_int = 0;
+#[cfg(ossl102f)]
+pub const X509_V_ERR_UNSPECIFIED: c_int = 1;
+pub const X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: c_int = 2;
+pub const X509_V_ERR_UNABLE_TO_GET_CRL: c_int = 3;
+pub const X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: c_int = 4;
+pub const X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE: c_int = 5;
+pub const X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY: c_int = 6;
+pub const X509_V_ERR_CERT_SIGNATURE_FAILURE: c_int = 7;
+pub const X509_V_ERR_CRL_SIGNATURE_FAILURE: c_int = 8;
+pub const X509_V_ERR_CERT_NOT_YET_VALID: c_int = 9;
+pub const X509_V_ERR_CERT_HAS_EXPIRED: c_int = 10;
+pub const X509_V_ERR_CRL_NOT_YET_VALID: c_int = 11;
+pub const X509_V_ERR_CRL_HAS_EXPIRED: c_int = 12;
+pub const X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: c_int = 13;
+pub const X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD: c_int = 14;
+pub const X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD: c_int = 15;
+pub const X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD: c_int = 16;
+pub const X509_V_ERR_OUT_OF_MEM: c_int = 17;
+pub const X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: c_int = 18;
+pub const X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: c_int = 19;
+pub const X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: c_int = 20;
+pub const X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: c_int = 21;
+pub const X509_V_ERR_CERT_CHAIN_TOO_LONG: c_int = 22;
+pub const X509_V_ERR_CERT_REVOKED: c_int = 23;
+cfg_if! {
+    if #[cfg(ossl300)] {
+        pub const X509_V_ERR_NO_ISSUER_PUBLIC_KEY: c_int = 24;
+    } else {
+        pub const X509_V_ERR_INVALID_CA: c_int = 24;
+    }
+}
+pub const X509_V_ERR_PATH_LENGTH_EXCEEDED: c_int = 25;
+pub const X509_V_ERR_INVALID_PURPOSE: c_int = 26;
+pub const X509_V_ERR_CERT_UNTRUSTED: c_int = 27;
+pub const X509_V_ERR_CERT_REJECTED: c_int = 28;
+pub const X509_V_ERR_SUBJECT_ISSUER_MISMATCH: c_int = 29;
+pub const X509_V_ERR_AKID_SKID_MISMATCH: c_int = 30;
+pub const X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH: c_int = 31;
+pub const X509_V_ERR_KEYUSAGE_NO_CERTSIGN: c_int = 32;
+pub const X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER: c_int = 33;
+pub const X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION: c_int = 34;
+pub const X509_V_ERR_KEYUSAGE_NO_CRL_SIGN: c_int = 35;
+pub const X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION: c_int = 36;
+pub const X509_V_ERR_INVALID_NON_CA: c_int = 37;
+pub const X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED: c_int = 38;
+pub const X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE: c_int = 39;
+pub const X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED: c_int = 40;
+pub const X509_V_ERR_INVALID_EXTENSION: c_int = 41;
+pub const X509_V_ERR_INVALID_POLICY_EXTENSION: c_int = 42;
+pub const X509_V_ERR_NO_EXPLICIT_POLICY: c_int = 43;
+pub const X509_V_ERR_DIFFERENT_CRL_SCOPE: c_int = 44;
+pub const X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE: c_int = 45;
+pub const X509_V_ERR_UNNESTED_RESOURCE: c_int = 46;
+pub const X509_V_ERR_PERMITTED_VIOLATION: c_int = 47;
+pub const X509_V_ERR_EXCLUDED_VIOLATION: c_int = 48;
+pub const X509_V_ERR_SUBTREE_MINMAX: c_int = 49;
+pub const X509_V_ERR_APPLICATION_VERIFICATION: c_int = 50;
+pub const X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE: c_int = 51;
+pub const X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX: c_int = 52;
+pub const X509_V_ERR_UNSUPPORTED_NAME_SYNTAX: c_int = 53;
+pub const X509_V_ERR_CRL_PATH_VALIDATION_ERROR: c_int = 54;
+#[cfg(ossl102)]
+pub const X509_V_ERR_SUITE_B_INVALID_VERSION: c_int = 56;
+#[cfg(ossl102)]
+pub const X509_V_ERR_SUITE_B_INVALID_ALGORITHM: c_int = 57;
+#[cfg(ossl102)]
+pub const X509_V_ERR_SUITE_B_INVALID_CURVE: c_int = 58;
+#[cfg(ossl102)]
+pub const X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM: c_int = 59;
+#[cfg(ossl102)]
+pub const X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED: c_int = 60;
+#[cfg(ossl102)]
+pub const X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256: c_int = 61;
+#[cfg(ossl102)]
+pub const X509_V_ERR_HOSTNAME_MISMATCH: c_int = 62;
+#[cfg(ossl102)]
+pub const X509_V_ERR_EMAIL_MISMATCH: c_int = 63;
+#[cfg(ossl102)]
+pub const X509_V_ERR_IP_ADDRESS_MISMATCH: c_int = 64;
+cfg_if! {
+    if #[cfg(ossl110)] {
+        pub const X509_V_ERR_DANE_NO_MATCH: c_int = 65;
+        pub const X509_V_ERR_EE_KEY_TOO_SMALL: c_int = 66;
+        pub const X509_V_ERR_CA_KEY_TOO_SMALL: c_int = 67;
+        pub const X509_V_ERR_CA_MD_TOO_WEAK: c_int = 68;
+        pub const X509_V_ERR_INVALID_CALL: c_int = 69;
+        pub const X509_V_ERR_STORE_LOOKUP: c_int = 70;
+        pub const X509_V_ERR_NO_VALID_SCTS: c_int = 71;
+    } else if #[cfg(ossl102h)] {
+        pub const X509_V_ERR_INVALID_CALL: c_int = 65;
+        pub const X509_V_ERR_STORE_LOOKUP: c_int = 66;
+        pub const X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION: c_int = 67;
+    }
+}
+#[cfg(ossl300)]
+pub const X509_V_ERR_INVALID_CA: c_int = 79;
+
+#[cfg(not(any(ossl110, libressl370)))]
+pub const X509_V_FLAG_CB_ISSUER_CHECK: c_ulong = 0x1;
+#[cfg(any(ossl110, libressl370))]
+pub const X509_V_FLAG_CB_ISSUER_CHECK: c_ulong = 0x0;
+pub const X509_V_FLAG_USE_CHECK_TIME: c_ulong = 0x2;
+pub const X509_V_FLAG_CRL_CHECK: c_ulong = 0x4;
+pub const X509_V_FLAG_CRL_CHECK_ALL: c_ulong = 0x8;
+pub const X509_V_FLAG_IGNORE_CRITICAL: c_ulong = 0x10;
+pub const X509_V_FLAG_X509_STRICT: c_ulong = 0x20;
+pub const X509_V_FLAG_ALLOW_PROXY_CERTS: c_ulong = 0x40;
+pub const X509_V_FLAG_POLICY_CHECK: c_ulong = 0x80;
+pub const X509_V_FLAG_EXPLICIT_POLICY: c_ulong = 0x100;
+pub const X509_V_FLAG_INHIBIT_ANY: c_ulong = 0x200;
+pub const X509_V_FLAG_INHIBIT_MAP: c_ulong = 0x400;
+pub const X509_V_FLAG_NOTIFY_POLICY: c_ulong = 0x800;
+pub const X509_V_FLAG_EXTENDED_CRL_SUPPORT: c_ulong = 0x1000;
+pub const X509_V_FLAG_USE_DELTAS: c_ulong = 0x2000;
+pub const X509_V_FLAG_CHECK_SS_SIGNATURE: c_ulong = 0x4000;
+#[cfg(ossl102)]
+pub const X509_V_FLAG_TRUSTED_FIRST: c_ulong = 0x8000;
+#[cfg(ossl102)]
+pub const X509_V_FLAG_SUITEB_128_LOS_ONLY: c_ulong = 0x10000;
+#[cfg(ossl102)]
+pub const X509_V_FLAG_SUITEB_192_LOS: c_ulong = 0x20000;
+#[cfg(ossl102)]
+pub const X509_V_FLAG_SUITEB_128_LOS: c_ulong = 0x30000;
+#[cfg(ossl102)]
+pub const X509_V_FLAG_PARTIAL_CHAIN: c_ulong = 0x80000;
+#[cfg(ossl110)]
+pub const X509_V_FLAG_NO_ALT_CHAINS: c_ulong = 0x100000;
+#[cfg(ossl110)]
+pub const X509_V_FLAG_NO_CHECK_TIME: c_ulong = 0x200000;
+
+pub unsafe fn X509_LOOKUP_add_dir(
+    ctx: *mut X509_LOOKUP,
+    name: *const c_char,
+    _type: c_int,
+) -> c_int {
+    const X509_L_ADD_DIR: c_int = 2;
+    X509_LOOKUP_ctrl(
+        ctx,
+        X509_L_ADD_DIR,
+        name,
+        _type as c_long,
+        std::ptr::null_mut(),
+    )
+}
diff -pruN 43.0.0-1/rust-vendor/openssl-sys/src/x509v3.rs 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/x509v3.rs
--- 43.0.0-1/rust-vendor/openssl-sys/src/x509v3.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/openssl-sys/src/x509v3.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,112 @@
+use libc::*;
+
+use super::*;
+
+#[repr(C)]
+pub struct GENERAL_NAME {
+    pub type_: c_int,
+    // FIXME should be a union
+    pub d: *mut c_void,
+}
+
+stack!(stack_st_GENERAL_NAME);
+
+pub const GEN_OTHERNAME: c_int = 0;
+pub const GEN_EMAIL: c_int = 1;
+pub const GEN_DNS: c_int = 2;
+pub const GEN_X400: c_int = 3;
+pub const GEN_DIRNAME: c_int = 4;
+pub const GEN_EDIPARTY: c_int = 5;
+pub const GEN_URI: c_int = 6;
+pub const GEN_IPADD: c_int = 7;
+pub const GEN_RID: c_int = 8;
+
+#[cfg(any(ossl102, libressl261))]
+pub const X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT: c_uint = 0x1;
+#[cfg(any(ossl102, libressl261))]
+pub const X509_CHECK_FLAG_NO_WILDCARDS: c_uint = 0x2;
+#[cfg(any(ossl102, libressl261))]
+pub const X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS: c_uint = 0x4;
+#[cfg(any(ossl102, libressl261))]
+pub const X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS: c_uint = 0x8;
+#[cfg(any(ossl102, libressl261))]
+pub const X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS: c_uint = 0x10;
+#[cfg(ossl110)]
+pub const X509_CHECK_FLAG_NEVER_CHECK_SUBJECT: c_uint = 0x20;
+
+pub const X509V3_ADD_DEFAULT: c_ulong = 0;
+pub const X509V3_ADD_APPEND: c_ulong = 1;
+pub const X509V3_ADD_REPLACE: c_ulong = 2;
+pub const X509V3_ADD_REPLACE_EXISTING: c_ulong = 3;
+pub const X509V3_ADD_KEEP_EXISTING: c_ulong = 4;
+pub const X509V3_ADD_DELETE: c_ulong = 5;
+pub const X509V3_ADD_SILENT: c_ulong = 0x10;
+
+pub const EXFLAG_BCONS: u32 = 0x1;
+pub const EXFLAG_KUSAGE: u32 = 0x2;
+pub const EXFLAG_XKUSAGE: u32 = 0x4;
+pub const EXFLAG_NSCERT: u32 = 0x8;
+pub const EXFLAG_CA: u32 = 0x10;
+pub const EXFLAG_SI: u32 = 0x20;
+pub const EXFLAG_V1: u32 = 0x40;
+pub const EXFLAG_INVALID: u32 = 0x80;
+pub const EXFLAG_SET: u32 = 0x100;
+pub const EXFLAG_CRITICAL: u32 = 0x200;
+pub const EXFLAG_PROXY: u32 = 0x400;
+pub const EXFLAG_INVALID_POLICY: u32 = 0x800;
+pub const EXFLAG_FRESHEST: u32 = 0x1000;
+#[cfg(any(ossl102, libressl261))]
+pub const EXFLAG_SS: u32 = 0x2000;
+
+pub const X509v3_KU_DIGITAL_SIGNATURE: u32 = 0x0080;
+pub const X509v3_KU_NON_REPUDIATION: u32 = 0x0040;
+pub const X509v3_KU_KEY_ENCIPHERMENT: u32 = 0x0020;
+pub const X509v3_KU_DATA_ENCIPHERMENT: u32 = 0x0010;
+pub const X509v3_KU_KEY_AGREEMENT: u32 = 0x0008;
+pub const X509v3_KU_KEY_CERT_SIGN: u32 = 0x0004;
+pub const X509v3_KU_CRL_SIGN: u32 = 0x0002;
+pub const X509v3_KU_ENCIPHER_ONLY: u32 = 0x0001;
+pub const X509v3_KU_DECIPHER_ONLY: u32 = 0x8000;
+pub const X509v3_KU_UNDEF: u32 = 0xffff;
+
+pub const XKU_SSL_SERVER: u32 = 0x1;
+pub const XKU_SSL_CLIENT: u32 = 0x2;
+pub const XKU_SMIME: u32 = 0x4;
+pub const XKU_CODE_SIGN: u32 = 0x8;
+pub const XKU_SGC: u32 = 0x10;
+pub const XKU_OCSP_SIGN: u32 = 0x20;
+pub const XKU_TIMESTAMP: u32 = 0x40;
+pub const XKU_DVCS: u32 = 0x80;
+#[cfg(ossl110)]
+pub const XKU_ANYEKU: u32 = 0x100;
+
+pub const X509_PURPOSE_SSL_CLIENT: c_int = 1;
+pub const X509_PURPOSE_SSL_SERVER: c_int = 2;
+pub const X509_PURPOSE_NS_SSL_SERVER: c_int = 3;
+pub const X509_PURPOSE_SMIME_SIGN: c_int = 4;
+pub const X509_PURPOSE_SMIME_ENCRYPT: c_int = 5;
+pub const X509_PURPOSE_CRL_SIGN: c_int = 6;
+pub const X509_PURPOSE_ANY: c_int = 7;
+pub const X509_PURPOSE_OCSP_HELPER: c_int = 8;
+pub const X509_PURPOSE_TIMESTAMP_SIGN: c_int = 9;
+#[cfg(ossl320)]
+pub const X509_PURPOSE_CODE_SIGN: c_int = 10;
+pub const X509_PURPOSE_MIN: c_int = 1;
+cfg_if! {
+    if #[cfg(ossl320)] {
+        pub const X509_PURPOSE_MAX: c_int = 10;
+    } else {
+        pub const X509_PURPOSE_MAX: c_int = 9;
+    }
+}
+
+pub const CRL_REASON_UNSPECIFIED: c_int = 0;
+pub const CRL_REASON_KEY_COMPROMISE: c_int = 1;
+pub const CRL_REASON_CA_COMPROMISE: c_int = 2;
+pub const CRL_REASON_AFFILIATION_CHANGED: c_int = 3;
+pub const CRL_REASON_SUPERSEDED: c_int = 4;
+pub const CRL_REASON_CESSATION_OF_OPERATION: c_int = 5;
+pub const CRL_REASON_CERTIFICATE_HOLD: c_int = 6;
+pub const CRL_REASON_REMOVE_FROM_CRL: c_int = 8;
+pub const CRL_REASON_PRIVILEGE_WITHDRAWN: c_int = 9;
+pub const CRL_REASON_AA_COMPROMISE: c_int = 10;
diff -pruN 43.0.0-1/rust-vendor/pem/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/pem/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/pem/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pem/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"CHANGELOG.md":"05cb31323de8f1b7b01950b6d16b995b7d2b9b1c1315cf9f9335082ed60f5ff8","Cargo.toml":"287ae22c47113e000026e879001edbace23295b92aa434eb001b827014d4b789","LICENSE.md":"b7c76ff4466a3aeb6a7d903e81b651335e97d64ecb857e2ee9812a36c6fd1acf","README.md":"0f96e3ccaadcaa6b59c2947e7148e12c762865db05802ba2d2f5e7edf3a7fc30","benches/pem_benchmark.rs":"4c35fa1f0e33c100b947721ebee4746a6c8a9a9e470ac1b3d4098b932d302b04","src/errors.rs":"0367aea7e78656a4cdea3ba93800c23362561f478198e98c23e7a4ead82630c1","src/lib.rs":"09b869616cb31c0dd6e8ef2d141a90134fbf3441345adead79100cf2820f902d","src/parser.rs":"3bc4a574604c14c6bf2e919d9df9cad74236a6fdf106a118a7f332441b900da7"},"package":"8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/pem/CHANGELOG.md 43.0.0-1ubuntu1/rust-vendor/pem/CHANGELOG.md
--- 43.0.0-1/rust-vendor/pem/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pem/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,42 @@
+# 3.0.3
+ - allow general whitespace separators instead of just newlines
+
+# 3.0.2
+ - allow EncodeConfig to be built in a const context
+
+# 3.0.1
+ - reduce allocations in `pem::encode`
+
+# 3.0.0
+ - trim `proptest` features to prevent an MSRV break for testing
+ - make EncodeConfig struct extendable and add a line_wrap config option
+
+# 2.0.1
+
+ - Fix serde support on no\_std
+ - Drop MSRV to 1.60
+
+# 2.0
+
+ - Add no\_std support
+ - Bump MSRV to 1.67
+ - Refactor API to prevent direct modification and access of elements and to
+   allow access to the optional rfc1421-described headers.
+
+# 1.1.1
+ - Allow PEM files to be parsed with the optional rfc1421-described headers
+   (although you cannot retrieve the headers)
+
+# 1.1.0
+ - Add optional serde support
+
+# 1.0.2
+ - Remove dependency on Regex in favor of a hand-rolled parser
+
+# 1.0.1
+
+ - hide the ASCII\_ARMOR symbol to work around a linking issue with 32-bit windows builds
+
+# 1.0
+
+ - `pem::parse_many` now returns a `Result<Vec<Pem>>` instead of a `Vec<Pem>` that silently discarded invalid sections.
diff -pruN 43.0.0-1/rust-vendor/pem/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/pem/Cargo.toml
--- 43.0.0-1/rust-vendor/pem/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pem/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,66 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2021"
+rust-version = "1.60.0"
+name = "pem"
+version = "3.0.4"
+authors = ["Jonathan Creekmore <jonathan@thecreekmores.org>"]
+description = "Parse and encode PEM-encoded data."
+homepage = "https://github.com/jcreekmore/pem-rs.git"
+documentation = "https://docs.rs/pem/"
+readme = "README.md"
+keywords = [
+    "no-std",
+    "no_std",
+    "pem",
+]
+categories = ["cryptography"]
+license = "MIT"
+repository = "https://github.com/jcreekmore/pem-rs.git"
+resolver = "2"
+
+[[bench]]
+name = "pem_benchmark"
+harness = false
+
+[dependencies.base64]
+version = "0.22.0"
+features = ["alloc"]
+default-features = false
+
+[dependencies.serde]
+version = "1"
+optional = true
+default-features = false
+
+[dev-dependencies.criterion]
+version = "0.3.0"
+
+[dev-dependencies.proptest]
+version = "1"
+features = ["std"]
+default-features = false
+
+[dev-dependencies.serde_json]
+version = "1"
+
+[features]
+default = ["std"]
+serde = ["dep:serde"]
+std = [
+    "base64/std",
+    "serde?/std",
+]
+
+[badges.travis-ci]
+repository = "jcreekmore/pem-rs"
diff -pruN 43.0.0-1/rust-vendor/pem/LICENSE.md 43.0.0-1ubuntu1/rust-vendor/pem/LICENSE.md
--- 43.0.0-1/rust-vendor/pem/LICENSE.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pem/LICENSE.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Jonathan Creekmore
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/pem/README.md 43.0.0-1ubuntu1/rust-vendor/pem/README.md
--- 43.0.0-1/rust-vendor/pem/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pem/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,40 @@
+pem
+===
+
+A Rust library for parsing and encoding PEM-encoded data.
+
+![Build Status](https://github.com/github/docs/actions/workflows/ci.yml/badge.svg)
+
+
+### Documentation
+[Module documentation with examples](https://docs.rs/pem/)
+
+### Usage
+
+Add this to your `Cargo.toml`:
+
+```toml
+[dependencies]
+pem = "3.0"
+```
+
+Here is a simple example that parse PEM-encoded data and prints the tag:
+
+```rust
+use pem::parse;
+
+const SAMPLE: &'static str = "-----BEGIN RSA PRIVATE KEY-----
+MIIBPQIBAAJBAOsfi5AGYhdRs/x6q5H7kScxA0Kzzqe6WI6gf6+tc6IvKQJo5rQc
+dWWSQ0nRGt2hOPDO+35NKhQEjBQxPh/v7n0CAwEAAQJBAOGaBAyuw0ICyENy5NsO
+2gkT00AWTSzM9Zns0HedY31yEabkuFvrMCHjscEF7u3Y6PB7An3IzooBHchsFDei
+AAECIQD/JahddzR5K3A6rzTidmAf1PBtqi7296EnWv8WvpfAAQIhAOvowIXZI4Un
+DXjgZ9ekuUjZN+GUQRAVlkEEohGLVy59AiEA90VtqDdQuWWpvJX0cM08V10tLXrT
+TTGsEtITid1ogAECIQDAaFl90ZgS5cMrL3wCeatVKzVUmuJmB/VAmlLFFGzK0QIh
+ANJGc7AFk4fyFD/OezhwGHbWmo/S+bfeAiIh2Ss2FxKJ
+-----END RSA PRIVATE KEY-----
+";
+
+let pem = parse(SAMPLE)?;
+println!("PEM tag: {}", pem.tag);
+
+```
diff -pruN 43.0.0-1/rust-vendor/pem/benches/pem_benchmark.rs 43.0.0-1ubuntu1/rust-vendor/pem/benches/pem_benchmark.rs
--- 43.0.0-1/rust-vendor/pem/benches/pem_benchmark.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pem/benches/pem_benchmark.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,124 @@
+use criterion::{criterion_group, criterion_main, Criterion};
+
+const SAMPLE: &str = "-----BEGIN RSA PRIVATE KEY-----\r
+MIIBPQIBAAJBAOsfi5AGYhdRs/x6q5H7kScxA0Kzzqe6WI6gf6+tc6IvKQJo5rQc\r
+dWWSQ0nRGt2hOPDO+35NKhQEjBQxPh/v7n0CAwEAAQJBAOGaBAyuw0ICyENy5NsO\r
+2gkT00AWTSzM9Zns0HedY31yEabkuFvrMCHjscEF7u3Y6PB7An3IzooBHchsFDei\r
+AAECIQD/JahddzR5K3A6rzTidmAf1PBtqi7296EnWv8WvpfAAQIhAOvowIXZI4Un\r
+DXjgZ9ekuUjZN+GUQRAVlkEEohGLVy59AiEA90VtqDdQuWWpvJX0cM08V10tLXrT\r
+TTGsEtITid1ogAECIQDAaFl90ZgS5cMrL3wCeatVKzVUmuJmB/VAmlLFFGzK0QIh\r
+ANJGc7AFk4fyFD/OezhwGHbWmo/S+bfeAiIh2Ss2FxKJ\r
+-----END RSA PRIVATE KEY-----\r
+\r
+-----BEGIN RSA PUBLIC KEY-----\r
+MIIBOgIBAAJBAMIeCnn9G/7g2Z6J+qHOE2XCLLuPoh5NHTO2Fm+PbzBvafBo0oYo\r
+QVVy7frzxmOqx6iIZBxTyfAQqBPO3Br59BMCAwEAAQJAX+PjHPuxdqiwF6blTkS0\r
+RFI1MrnzRbCmOkM6tgVO0cd6r5Z4bDGLusH9yjI9iI84gPRjK0AzymXFmBGuREHI\r
+sQIhAPKf4pp+Prvutgq2ayygleZChBr1DC4XnnufBNtaswyvAiEAzNGVKgNvzuhk\r
+ijoUXIDruJQEGFGvZTsi1D2RehXiT90CIQC4HOQUYKCydB7oWi1SHDokFW2yFyo6\r
+/+lf3fgNjPI6OQIgUPmTFXciXxT1msh3gFLf3qt2Kv8wbr9Ad9SXjULVpGkCIB+g\r
+RzHX0lkJl9Stshd/7Gbt65/QYq+v+xvAeT0CoyIg\r
+-----END RSA PUBLIC KEY-----\r
+";
+
+fn pem_parse() {
+    pem::parse(SAMPLE).unwrap();
+}
+
+fn pem_parse_many() {
+    pem::parse_many(SAMPLE).unwrap();
+}
+
+fn pem_encode(pem: &pem::Pem) {
+    pem::encode(pem);
+}
+
+fn pem_encode_many(pems: &[pem::Pem]) {
+    pem::encode_many(pems);
+}
+
+fn criterion_benchmark(c: &mut Criterion) {
+    // Parse
+    c.bench_function("pem::parse", |b| b.iter(pem_parse));
+    c.bench_function("pem::parse_many", |b| b.iter(pem_parse_many));
+
+    // Encode
+    let pem = pem::Pem::new(
+        "RSA PRIVATE KEY",
+        [
+            48, 130, 1, 61, 2, 1, 0, 2, 65, 0, 235, 31, 139, 144, 6, 98, 23, 81, 179, 252, 122,
+            171, 145, 251, 145, 39, 49, 3, 66, 179, 206, 167, 186, 88, 142, 160, 127, 175, 173,
+            115, 162, 47, 41, 2, 104, 230, 180, 28, 117, 101, 146, 67, 73, 209, 26, 221, 161, 56,
+            240, 206, 251, 126, 77, 42, 20, 4, 140, 20, 49, 62, 31, 239, 238, 125, 2, 3, 1, 0, 1,
+            2, 65, 0, 225, 154, 4, 12, 174, 195, 66, 2, 200, 67, 114, 228, 219, 14, 218, 9, 19,
+            211, 64, 22, 77, 44, 204, 245, 153, 236, 208, 119, 157, 99, 125, 114, 17, 166, 228,
+            184, 91, 235, 48, 33, 227, 177, 193, 5, 238, 237, 216, 232, 240, 123, 2, 125, 200, 206,
+            138, 1, 29, 200, 108, 20, 55, 162, 0, 1, 2, 33, 0, 255, 37, 168, 93, 119, 52, 121, 43,
+            112, 58, 175, 52, 226, 118, 96, 31, 212, 240, 109, 170, 46, 246, 247, 161, 39, 90, 255,
+            22, 190, 151, 192, 1, 2, 33, 0, 235, 232, 192, 133, 217, 35, 133, 39, 13, 120, 224,
+            103, 215, 164, 185, 72, 217, 55, 225, 148, 65, 16, 21, 150, 65, 4, 162, 17, 139, 87,
+            46, 125, 2, 33, 0, 247, 69, 109, 168, 55, 80, 185, 101, 169, 188, 149, 244, 112, 205,
+            60, 87, 93, 45, 45, 122, 211, 77, 49, 172, 18, 210, 19, 137, 221, 104, 128, 1, 2, 33,
+            0, 192, 104, 89, 125, 209, 152, 18, 229, 195, 43, 47, 124, 2, 121, 171, 85, 43, 53, 84,
+            154, 226, 102, 7, 245, 64, 154, 82, 197, 20, 108, 202, 209, 2, 33, 0, 210, 70, 115,
+            176, 5, 147, 135, 242, 20, 63, 206, 123, 56, 112, 24, 118, 214, 154, 143, 210, 249,
+            183, 222, 2, 34, 33, 217, 43, 54, 23, 18, 137,
+        ],
+    );
+    c.bench_function("pem::encode", move |b| b.iter(|| pem_encode(&pem)));
+
+    let pems = vec![
+        pem::Pem::new(
+            "RSA PRIVATE KEY",
+            vec![
+                48, 130, 1, 61, 2, 1, 0, 2, 65, 0, 235, 31, 139, 144, 6, 98, 23, 81, 179, 252, 122,
+                171, 145, 251, 145, 39, 49, 3, 66, 179, 206, 167, 186, 88, 142, 160, 127, 175, 173,
+                115, 162, 47, 41, 2, 104, 230, 180, 28, 117, 101, 146, 67, 73, 209, 26, 221, 161,
+                56, 240, 206, 251, 126, 77, 42, 20, 4, 140, 20, 49, 62, 31, 239, 238, 125, 2, 3, 1,
+                0, 1, 2, 65, 0, 225, 154, 4, 12, 174, 195, 66, 2, 200, 67, 114, 228, 219, 14, 218,
+                9, 19, 211, 64, 22, 77, 44, 204, 245, 153, 236, 208, 119, 157, 99, 125, 114, 17,
+                166, 228, 184, 91, 235, 48, 33, 227, 177, 193, 5, 238, 237, 216, 232, 240, 123, 2,
+                125, 200, 206, 138, 1, 29, 200, 108, 20, 55, 162, 0, 1, 2, 33, 0, 255, 37, 168, 93,
+                119, 52, 121, 43, 112, 58, 175, 52, 226, 118, 96, 31, 212, 240, 109, 170, 46, 246,
+                247, 161, 39, 90, 255, 22, 190, 151, 192, 1, 2, 33, 0, 235, 232, 192, 133, 217, 35,
+                133, 39, 13, 120, 224, 103, 215, 164, 185, 72, 217, 55, 225, 148, 65, 16, 21, 150,
+                65, 4, 162, 17, 139, 87, 46, 125, 2, 33, 0, 247, 69, 109, 168, 55, 80, 185, 101,
+                169, 188, 149, 244, 112, 205, 60, 87, 93, 45, 45, 122, 211, 77, 49, 172, 18, 210,
+                19, 137, 221, 104, 128, 1, 2, 33, 0, 192, 104, 89, 125, 209, 152, 18, 229, 195, 43,
+                47, 124, 2, 121, 171, 85, 43, 53, 84, 154, 226, 102, 7, 245, 64, 154, 82, 197, 20,
+                108, 202, 209, 2, 33, 0, 210, 70, 115, 176, 5, 147, 135, 242, 20, 63, 206, 123, 56,
+                112, 24, 118, 214, 154, 143, 210, 249, 183, 222, 2, 34, 33, 217, 43, 54, 23, 18,
+                137,
+            ],
+        ),
+        pem::Pem::new(
+            "RSA PUBLIC KEY",
+            vec![
+                48, 130, 1, 58, 2, 1, 0, 2, 65, 0, 194, 30, 10, 121, 253, 27, 254, 224, 217, 158,
+                137, 250, 161, 206, 19, 101, 194, 44, 187, 143, 162, 30, 77, 29, 51, 182, 22, 111,
+                143, 111, 48, 111, 105, 240, 104, 210, 134, 40, 65, 85, 114, 237, 250, 243, 198,
+                99, 170, 199, 168, 136, 100, 28, 83, 201, 240, 16, 168, 19, 206, 220, 26, 249, 244,
+                19, 2, 3, 1, 0, 1, 2, 64, 95, 227, 227, 28, 251, 177, 118, 168, 176, 23, 166, 229,
+                78, 68, 180, 68, 82, 53, 50, 185, 243, 69, 176, 166, 58, 67, 58, 182, 5, 78, 209,
+                199, 122, 175, 150, 120, 108, 49, 139, 186, 193, 253, 202, 50, 61, 136, 143, 56,
+                128, 244, 99, 43, 64, 51, 202, 101, 197, 152, 17, 174, 68, 65, 200, 177, 2, 33, 0,
+                242, 159, 226, 154, 126, 62, 187, 238, 182, 10, 182, 107, 44, 160, 149, 230, 66,
+                132, 26, 245, 12, 46, 23, 158, 123, 159, 4, 219, 90, 179, 12, 175, 2, 33, 0, 204,
+                209, 149, 42, 3, 111, 206, 232, 100, 138, 58, 20, 92, 128, 235, 184, 148, 4, 24,
+                81, 175, 101, 59, 34, 212, 61, 145, 122, 21, 226, 79, 221, 2, 33, 0, 184, 28, 228,
+                20, 96, 160, 178, 116, 30, 232, 90, 45, 82, 28, 58, 36, 21, 109, 178, 23, 42, 58,
+                255, 233, 95, 221, 248, 13, 140, 242, 58, 57, 2, 32, 80, 249, 147, 21, 119, 34, 95,
+                20, 245, 154, 200, 119, 128, 82, 223, 222, 171, 118, 42, 255, 48, 110, 191, 64,
+                119, 212, 151, 141, 66, 213, 164, 105, 2, 32, 31, 160, 71, 49, 215, 210, 89, 9,
+                151, 212, 173, 178, 23, 127, 236, 102, 237, 235, 159, 208, 98, 175, 175, 251, 27,
+                192, 121, 61, 2, 163, 34, 32,
+            ],
+        ),
+    ];
+    c.bench_function("pem::encode_many", move |b| {
+        b.iter(|| pem_encode_many(&pems))
+    });
+}
+
+criterion_group!(benches, criterion_benchmark);
+criterion_main!(benches);
diff -pruN 43.0.0-1/rust-vendor/pem/src/errors.rs 43.0.0-1ubuntu1/rust-vendor/pem/src/errors.rs
--- 43.0.0-1/rust-vendor/pem/src/errors.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pem/src/errors.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,69 @@
+// Copyright 2017 Jonathan Creekmore
+//
+// Licensed under the MIT license <LICENSE.md or
+// http://opensource.org/licenses/MIT>. This file may not be
+// copied, modified, or distributed except according to those terms.
+use core::fmt;
+
+#[cfg(any(feature = "std", test))]
+use std::error::Error;
+
+#[cfg(not(any(feature = "std", test)))]
+use alloc::string::String;
+
+/// The `pem` error type.
+#[derive(Debug, Eq, PartialEq)]
+#[allow(missing_docs)]
+pub enum PemError {
+    MismatchedTags(String, String),
+    MalformedFraming,
+    MissingBeginTag,
+    MissingEndTag,
+    MissingData,
+    InvalidData(::base64::DecodeError),
+    InvalidHeader(String),
+    NotUtf8(::core::str::Utf8Error),
+}
+
+impl fmt::Display for PemError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            PemError::MismatchedTags(b, e) => {
+                write!(f, "mismatching BEGIN (\"{b}\") and END (\"{e}\") tags")
+            }
+            PemError::MalformedFraming => write!(f, "malformedframing"),
+            PemError::MissingBeginTag => write!(f, "missing BEGIN tag"),
+            PemError::MissingEndTag => write!(f, "missing END tag"),
+            PemError::MissingData => write!(f, "missing data"),
+            PemError::InvalidData(e) => write!(f, "invalid data: {e}"),
+            PemError::InvalidHeader(hdr) => write!(f, "invalid header: {hdr}"),
+            PemError::NotUtf8(e) => write!(f, "invalid utf-8 value: {e}"),
+        }
+    }
+}
+
+#[cfg(any(feature = "std", test))]
+impl Error for PemError {
+    fn source(&self) -> Option<&(dyn Error + 'static)> {
+        match self {
+            // Errors originating from other libraries.
+            PemError::InvalidData(e) => Some(e),
+            PemError::NotUtf8(e) => Some(e),
+            // Errors directly originating from `pem-rs`.
+            _ => None,
+        }
+    }
+}
+
+/// The `pem` result type.
+pub type Result<T> = ::core::result::Result<T, PemError>;
+
+#[allow(missing_docs)]
+#[macro_export]
+macro_rules! ensure {
+    ($cond:expr, $err:expr) => {
+        if !$cond {
+            return Err($err);
+        }
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/pem/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/pem/src/lib.rs
--- 43.0.0-1/rust-vendor/pem/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pem/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1061 @@
+// Copyright 2016-2017 Jonathan Creekmore
+//
+// Licensed under the MIT license <LICENSE.md or
+// http://opensource.org/licenses/MIT>. This file may not be
+// copied, modified, or distributed except according to those terms.
+
+//! This crate provides a parser and encoder for PEM-encoded binary data.
+//! PEM-encoded binary data is essentially a beginning and matching end
+//! tag that encloses base64-encoded binary data (see:
+//! https://en.wikipedia.org/wiki/Privacy-enhanced_Electronic_Mail).
+//!
+//! This crate's documentation provides a few simple examples along with
+//! documentation on the public methods for the crate.
+//!
+//! # Usage
+//!
+//! This crate is [on crates.io](https://crates.io/crates/pem) and can be used
+//! by adding `pem` to your dependencies in your project's `Cargo.toml`.
+//!
+//! ```toml
+//! [dependencies]
+//! pem = "2"
+//! ```
+//!
+//! Using the `serde` feature will implement the serde traits for
+//! the `Pem` struct.
+//!
+//! # Example: parse a single chunk of PEM-encoded text
+//!
+//! Generally, PEM-encoded files contain a single chunk of PEM-encoded
+//! text. Commonly, this is in some sort of a key file or an x.509
+//! certificate.
+//!
+//! ```rust
+//!
+//! use pem::parse;
+//!
+//! const SAMPLE: &'static str = "-----BEGIN RSA PRIVATE KEY-----
+//! MIIBPQIBAAJBAOsfi5AGYhdRs/x6q5H7kScxA0Kzzqe6WI6gf6+tc6IvKQJo5rQc
+//! dWWSQ0nRGt2hOPDO+35NKhQEjBQxPh/v7n0CAwEAAQJBAOGaBAyuw0ICyENy5NsO
+//! 2gkT00AWTSzM9Zns0HedY31yEabkuFvrMCHjscEF7u3Y6PB7An3IzooBHchsFDei
+//! AAECIQD/JahddzR5K3A6rzTidmAf1PBtqi7296EnWv8WvpfAAQIhAOvowIXZI4Un
+//! DXjgZ9ekuUjZN+GUQRAVlkEEohGLVy59AiEA90VtqDdQuWWpvJX0cM08V10tLXrT
+//! TTGsEtITid1ogAECIQDAaFl90ZgS5cMrL3wCeatVKzVUmuJmB/VAmlLFFGzK0QIh
+//! ANJGc7AFk4fyFD/OezhwGHbWmo/S+bfeAiIh2Ss2FxKJ
+//! -----END RSA PRIVATE KEY-----
+//! ";
+//!
+//!  let pem = parse(SAMPLE).unwrap();
+//!  assert_eq!(pem.tag(), "RSA PRIVATE KEY");
+//! ```
+//!
+//! # Example: parse a set of PEM-encoded text
+//!
+//! Sometimes, PEM-encoded files contain multiple chunks of PEM-encoded
+//! text. You might see this if you have an x.509 certificate file that
+//! also includes intermediate certificates.
+//!
+//! ```rust
+//!
+//! use pem::parse_many;
+//!
+//! const SAMPLE: &'static str = "-----BEGIN INTERMEDIATE CERT-----
+//! MIIBPQIBAAJBAOsfi5AGYhdRs/x6q5H7kScxA0Kzzqe6WI6gf6+tc6IvKQJo5rQc
+//! dWWSQ0nRGt2hOPDO+35NKhQEjBQxPh/v7n0CAwEAAQJBAOGaBAyuw0ICyENy5NsO
+//! 2gkT00AWTSzM9Zns0HedY31yEabkuFvrMCHjscEF7u3Y6PB7An3IzooBHchsFDei
+//! AAECIQD/JahddzR5K3A6rzTidmAf1PBtqi7296EnWv8WvpfAAQIhAOvowIXZI4Un
+//! DXjgZ9ekuUjZN+GUQRAVlkEEohGLVy59AiEA90VtqDdQuWWpvJX0cM08V10tLXrT
+//! TTGsEtITid1ogAECIQDAaFl90ZgS5cMrL3wCeatVKzVUmuJmB/VAmlLFFGzK0QIh
+//! ANJGc7AFk4fyFD/OezhwGHbWmo/S+bfeAiIh2Ss2FxKJ
+//! -----END INTERMEDIATE CERT-----
+//!
+//! -----BEGIN CERTIFICATE-----
+//! MIIBPQIBAAJBAOsfi5AGYhdRs/x6q5H7kScxA0Kzzqe6WI6gf6+tc6IvKQJo5rQc
+//! dWWSQ0nRGt2hOPDO+35NKhQEjBQxPh/v7n0CAwEAAQJBAOGaBAyuw0ICyENy5NsO
+//! 2gkT00AWTSzM9Zns0HedY31yEabkuFvrMCHjscEF7u3Y6PB7An3IzooBHchsFDei
+//! AAECIQD/JahddzR5K3A6rzTidmAf1PBtqi7296EnWv8WvpfAAQIhAOvowIXZI4Un
+//! DXjgZ9ekuUjZN+GUQRAVlkEEohGLVy59AiEA90VtqDdQuWWpvJX0cM08V10tLXrT
+//! TTGsEtITid1ogAECIQDAaFl90ZgS5cMrL3wCeatVKzVUmuJmB/VAmlLFFGzK0QIh
+//! ANJGc7AFk4fyFD/OezhwGHbWmo/S+bfeAiIh2Ss2FxKJ
+//! -----END CERTIFICATE-----
+//! ";
+//!
+//!  let pems = parse_many(SAMPLE).unwrap();
+//!  assert_eq!(pems.len(), 2);
+//!  assert_eq!(pems[0].tag(), "INTERMEDIATE CERT");
+//!  assert_eq!(pems[1].tag(), "CERTIFICATE");
+//! ```
+//!
+//! # Features
+//!
+//! This crate supports two features: `std` and `serde`.
+//!
+//! The `std` feature is enabled by default. If you specify
+//! `default-features = false` to disable `std`, be aware that
+//! this crate still needs an allocator.
+//!
+//! The `serde` feature implements `serde::{Deserialize, Serialize}`
+//! for this crate's `Pem` struct.
+
+#![deny(
+    missing_docs,
+    missing_debug_implementations,
+    missing_copy_implementations,
+    trivial_casts,
+    trivial_numeric_casts,
+    unsafe_code,
+    unstable_features,
+    unused_import_braces,
+    unused_qualifications
+)]
+#![cfg_attr(not(feature = "std"), no_std)]
+
+#[cfg(not(any(feature = "std", test)))]
+extern crate alloc;
+#[cfg(not(any(feature = "std", test)))]
+use alloc::{
+    format,
+    string::{String, ToString},
+    vec::Vec,
+};
+
+mod errors;
+mod parser;
+use parser::{parse_captures, parse_captures_iter, Captures};
+
+pub use crate::errors::{PemError, Result};
+use base64::Engine as _;
+use core::fmt::Write;
+use core::{fmt, slice, str};
+
+/// The line length for PEM encoding
+const LINE_WRAP: usize = 64;
+
+/// Enum describing line endings
+#[derive(Debug, Clone, Copy)]
+pub enum LineEnding {
+    /// Windows-like (`\r\n`)
+    CRLF,
+    /// Unix-like (`\n`)
+    LF,
+}
+
+/// Configuration for Pem encoding
+#[derive(Debug, Clone, Copy)]
+pub struct EncodeConfig {
+    /// Line ending to use during encoding
+    line_ending: LineEnding,
+
+    /// Line length to use during encoding
+    line_wrap: usize,
+}
+
+/// A representation of Pem-encoded data
+#[derive(PartialEq, Debug, Clone)]
+pub struct Pem {
+    tag: String,
+    headers: HeaderMap,
+    contents: Vec<u8>,
+}
+
+/// Provides access to the headers that might be found in a Pem-encoded file
+#[derive(Clone, Debug, Default, PartialEq)]
+pub struct HeaderMap(Vec<String>);
+
+fn decode_data(raw_data: &str) -> Result<Vec<u8>> {
+    // We need to get rid of newlines/whitespaces for base64::decode
+    // As base64 requires an AsRef<[u8]>, this must involve a copy
+    let data: String = raw_data.chars().filter(|c| !c.is_whitespace()).collect();
+
+    // And decode it from Base64 into a vector of u8
+    let contents = base64::engine::general_purpose::STANDARD
+        .decode(data)
+        .map_err(PemError::InvalidData)?;
+
+    Ok(contents)
+}
+
+/// Iterator across all headers in the Pem-encoded data
+#[derive(Debug)]
+pub struct HeadersIter<'a> {
+    cur: slice::Iter<'a, String>,
+}
+
+impl<'a> Iterator for HeadersIter<'a> {
+    type Item = (&'a str, &'a str);
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.cur.next().and_then(HeaderMap::split_header)
+    }
+}
+
+impl<'a> DoubleEndedIterator for HeadersIter<'a> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.cur.next_back().and_then(HeaderMap::split_header)
+    }
+}
+
+impl HeaderMap {
+    #[allow(clippy::ptr_arg)]
+    fn split_header(header: &String) -> Option<(&str, &str)> {
+        header
+            .split_once(':')
+            .map(|(key, value)| (key.trim(), value.trim()))
+    }
+
+    fn parse(headers: Vec<String>) -> Result<HeaderMap> {
+        headers.iter().try_for_each(|hline| {
+            Self::split_header(hline)
+                .map(|_| ())
+                .ok_or_else(|| PemError::InvalidHeader(hline.to_string()))
+        })?;
+        Ok(HeaderMap(headers))
+    }
+
+    /// Get an iterator across all header key-value pairs
+    pub fn iter(&self) -> HeadersIter<'_> {
+        HeadersIter { cur: self.0.iter() }
+    }
+
+    /// Get the last set value corresponding to the header key
+    pub fn get(&self, key: &str) -> Option<&str> {
+        self.iter().rev().find(|(k, _)| *k == key).map(|(_, v)| v)
+    }
+
+    /// Get the last set value corresponding to the header key
+    pub fn add(&mut self, key: &str, value: &str) -> Result<()> {
+        ensure!(
+            !(key.contains(':') || key.contains('\n')),
+            PemError::InvalidHeader(key.to_string())
+        );
+        ensure!(
+            !(value.contains(':') || value.contains('\n')),
+            PemError::InvalidHeader(value.to_string())
+        );
+        self.0.push(format!("{}: {}", key.trim(), value.trim()));
+        Ok(())
+    }
+}
+
+impl EncodeConfig {
+    /// Create a new encode config with default values.
+    pub const fn new() -> Self {
+        Self {
+            line_ending: LineEnding::CRLF,
+            line_wrap: LINE_WRAP,
+        }
+    }
+
+    /// Set the line ending to use for the encoding.
+    pub const fn set_line_ending(mut self, line_ending: LineEnding) -> Self {
+        self.line_ending = line_ending;
+        self
+    }
+
+    /// Set the line length to use for the encoding.
+    pub const fn set_line_wrap(mut self, line_wrap: usize) -> Self {
+        self.line_wrap = line_wrap;
+        self
+    }
+}
+
+impl Default for EncodeConfig {
+    fn default() -> Self {
+        Self::new()
+    }
+}
+
+impl Pem {
+    /// Create a new Pem struct
+    pub fn new(tag: impl ToString, contents: impl Into<Vec<u8>>) -> Pem {
+        Pem {
+            tag: tag.to_string(),
+            headers: HeaderMap::default(),
+            contents: contents.into(),
+        }
+    }
+
+    /// Get the tag extracted from the Pem-encoded data
+    pub fn tag(&self) -> &str {
+        &self.tag
+    }
+
+    /// Get the binary contents extracted from the Pem-encoded data
+    pub fn contents(&self) -> &[u8] {
+        &self.contents
+    }
+
+    /// Consume the Pem struct to get an owned copy of the binary contents
+    pub fn into_contents(self) -> Vec<u8> {
+        self.contents
+    }
+
+    /// Get the header map for the headers in the Pem-encoded data
+    pub fn headers(&self) -> &HeaderMap {
+        &self.headers
+    }
+
+    /// Get the header map for modification
+    pub fn headers_mut(&mut self) -> &mut HeaderMap {
+        &mut self.headers
+    }
+
+    fn new_from_captures(caps: Captures) -> Result<Pem> {
+        fn as_utf8(bytes: &[u8]) -> Result<&str> {
+            str::from_utf8(bytes).map_err(PemError::NotUtf8)
+        }
+
+        // Verify that the begin section exists
+        let tag = as_utf8(caps.begin)?;
+        if tag.is_empty() {
+            return Err(PemError::MissingBeginTag);
+        }
+
+        // as well as the end section
+        let tag_end = as_utf8(caps.end)?;
+        if tag_end.is_empty() {
+            return Err(PemError::MissingEndTag);
+        }
+
+        // The beginning and the end sections must match
+        if tag != tag_end {
+            return Err(PemError::MismatchedTags(tag.into(), tag_end.into()));
+        }
+
+        // If they did, then we can grab the data section
+        let raw_data = as_utf8(caps.data)?;
+        let contents = decode_data(raw_data)?;
+        let headers: Vec<String> = as_utf8(caps.headers)?.lines().map(str::to_string).collect();
+        let headers = HeaderMap::parse(headers)?;
+
+        let mut file = Pem::new(tag, contents);
+        file.headers = headers;
+
+        Ok(file)
+    }
+}
+
+impl str::FromStr for Pem {
+    type Err = PemError;
+
+    fn from_str(s: &str) -> Result<Pem> {
+        parse(s)
+    }
+}
+
+impl TryFrom<&[u8]> for Pem {
+    type Error = PemError;
+
+    fn try_from(s: &[u8]) -> Result<Pem> {
+        parse(s)
+    }
+}
+
+impl fmt::Display for Pem {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "{}", encode(self))
+    }
+}
+
+/// Parses a single PEM-encoded data from a data-type that can be dereferenced as a [u8].
+///
+/// # Example: parse PEM-encoded data from a Vec<u8>
+/// ```rust
+///
+/// use pem::parse;
+///
+/// const SAMPLE: &'static str = "-----BEGIN RSA PRIVATE KEY-----
+/// MIIBPQIBAAJBAOsfi5AGYhdRs/x6q5H7kScxA0Kzzqe6WI6gf6+tc6IvKQJo5rQc
+/// dWWSQ0nRGt2hOPDO+35NKhQEjBQxPh/v7n0CAwEAAQJBAOGaBAyuw0ICyENy5NsO
+/// 2gkT00AWTSzM9Zns0HedY31yEabkuFvrMCHjscEF7u3Y6PB7An3IzooBHchsFDei
+/// AAECIQD/JahddzR5K3A6rzTidmAf1PBtqi7296EnWv8WvpfAAQIhAOvowIXZI4Un
+/// DXjgZ9ekuUjZN+GUQRAVlkEEohGLVy59AiEA90VtqDdQuWWpvJX0cM08V10tLXrT
+/// TTGsEtITid1ogAECIQDAaFl90ZgS5cMrL3wCeatVKzVUmuJmB/VAmlLFFGzK0QIh
+/// ANJGc7AFk4fyFD/OezhwGHbWmo/S+bfeAiIh2Ss2FxKJ
+/// -----END RSA PRIVATE KEY-----
+/// ";
+/// let SAMPLE_BYTES: Vec<u8> = SAMPLE.into();
+///
+///  let pem = parse(SAMPLE_BYTES).unwrap();
+///  assert_eq!(pem.tag(), "RSA PRIVATE KEY");
+/// ```
+///
+/// # Example: parse PEM-encoded data from a String
+/// ```rust
+///
+/// use pem::parse;
+///
+/// const SAMPLE: &'static str = "-----BEGIN RSA PRIVATE KEY-----
+/// MIIBPQIBAAJBAOsfi5AGYhdRs/x6q5H7kScxA0Kzzqe6WI6gf6+tc6IvKQJo5rQc
+/// dWWSQ0nRGt2hOPDO+35NKhQEjBQxPh/v7n0CAwEAAQJBAOGaBAyuw0ICyENy5NsO
+/// 2gkT00AWTSzM9Zns0HedY31yEabkuFvrMCHjscEF7u3Y6PB7An3IzooBHchsFDei
+/// AAECIQD/JahddzR5K3A6rzTidmAf1PBtqi7296EnWv8WvpfAAQIhAOvowIXZI4Un
+/// DXjgZ9ekuUjZN+GUQRAVlkEEohGLVy59AiEA90VtqDdQuWWpvJX0cM08V10tLXrT
+/// TTGsEtITid1ogAECIQDAaFl90ZgS5cMrL3wCeatVKzVUmuJmB/VAmlLFFGzK0QIh
+/// ANJGc7AFk4fyFD/OezhwGHbWmo/S+bfeAiIh2Ss2FxKJ
+/// -----END RSA PRIVATE KEY-----
+/// ";
+/// let SAMPLE_STRING: String = SAMPLE.into();
+///
+///  let pem = parse(SAMPLE_STRING).unwrap();
+///  assert_eq!(pem.tag(), "RSA PRIVATE KEY");
+/// ```
+pub fn parse<B: AsRef<[u8]>>(input: B) -> Result<Pem> {
+    parse_captures(input.as_ref())
+        .ok_or(PemError::MalformedFraming)
+        .and_then(Pem::new_from_captures)
+}
+
+/// Parses a set of PEM-encoded data from a data-type that can be dereferenced as a [u8].
+///
+/// # Example: parse a set of PEM-encoded data from a Vec<u8>
+///
+/// ```rust
+///
+/// use pem::parse_many;
+///
+/// const SAMPLE: &'static str = "-----BEGIN INTERMEDIATE CERT-----
+/// MIIBPQIBAAJBAOsfi5AGYhdRs/x6q5H7kScxA0Kzzqe6WI6gf6+tc6IvKQJo5rQc
+/// dWWSQ0nRGt2hOPDO+35NKhQEjBQxPh/v7n0CAwEAAQJBAOGaBAyuw0ICyENy5NsO
+/// 2gkT00AWTSzM9Zns0HedY31yEabkuFvrMCHjscEF7u3Y6PB7An3IzooBHchsFDei
+/// AAECIQD/JahddzR5K3A6rzTidmAf1PBtqi7296EnWv8WvpfAAQIhAOvowIXZI4Un
+/// DXjgZ9ekuUjZN+GUQRAVlkEEohGLVy59AiEA90VtqDdQuWWpvJX0cM08V10tLXrT
+/// TTGsEtITid1ogAECIQDAaFl90ZgS5cMrL3wCeatVKzVUmuJmB/VAmlLFFGzK0QIh
+/// ANJGc7AFk4fyFD/OezhwGHbWmo/S+bfeAiIh2Ss2FxKJ
+/// -----END INTERMEDIATE CERT-----
+///
+/// -----BEGIN CERTIFICATE-----
+/// MIIBPQIBAAJBAOsfi5AGYhdRs/x6q5H7kScxA0Kzzqe6WI6gf6+tc6IvKQJo5rQc
+/// dWWSQ0nRGt2hOPDO+35NKhQEjBQxPh/v7n0CAwEAAQJBAOGaBAyuw0ICyENy5NsO
+/// 2gkT00AWTSzM9Zns0HedY31yEabkuFvrMCHjscEF7u3Y6PB7An3IzooBHchsFDei
+/// AAECIQD/JahddzR5K3A6rzTidmAf1PBtqi7296EnWv8WvpfAAQIhAOvowIXZI4Un
+/// DXjgZ9ekuUjZN+GUQRAVlkEEohGLVy59AiEA90VtqDdQuWWpvJX0cM08V10tLXrT
+/// TTGsEtITid1ogAECIQDAaFl90ZgS5cMrL3wCeatVKzVUmuJmB/VAmlLFFGzK0QIh
+/// ANJGc7AFk4fyFD/OezhwGHbWmo/S+bfeAiIh2Ss2FxKJ
+/// -----END CERTIFICATE-----
+/// ";
+/// let SAMPLE_BYTES: Vec<u8> = SAMPLE.into();
+///
+///  let pems = parse_many(SAMPLE_BYTES).unwrap();
+///  assert_eq!(pems.len(), 2);
+///  assert_eq!(pems[0].tag(), "INTERMEDIATE CERT");
+///  assert_eq!(pems[1].tag(), "CERTIFICATE");
+/// ```
+///
+/// # Example: parse a set of PEM-encoded data from a String
+///
+/// ```rust
+///
+/// use pem::parse_many;
+///
+/// const SAMPLE: &'static str = "-----BEGIN INTERMEDIATE CERT-----
+/// MIIBPQIBAAJBAOsfi5AGYhdRs/x6q5H7kScxA0Kzzqe6WI6gf6+tc6IvKQJo5rQc
+/// dWWSQ0nRGt2hOPDO+35NKhQEjBQxPh/v7n0CAwEAAQJBAOGaBAyuw0ICyENy5NsO
+/// 2gkT00AWTSzM9Zns0HedY31yEabkuFvrMCHjscEF7u3Y6PB7An3IzooBHchsFDei
+/// AAECIQD/JahddzR5K3A6rzTidmAf1PBtqi7296EnWv8WvpfAAQIhAOvowIXZI4Un
+/// DXjgZ9ekuUjZN+GUQRAVlkEEohGLVy59AiEA90VtqDdQuWWpvJX0cM08V10tLXrT
+/// TTGsEtITid1ogAECIQDAaFl90ZgS5cMrL3wCeatVKzVUmuJmB/VAmlLFFGzK0QIh
+/// ANJGc7AFk4fyFD/OezhwGHbWmo/S+bfeAiIh2Ss2FxKJ
+/// -----END INTERMEDIATE CERT-----
+///
+/// -----BEGIN CERTIFICATE-----
+/// MIIBPQIBAAJBAOsfi5AGYhdRs/x6q5H7kScxA0Kzzqe6WI6gf6+tc6IvKQJo5rQc
+/// dWWSQ0nRGt2hOPDO+35NKhQEjBQxPh/v7n0CAwEAAQJBAOGaBAyuw0ICyENy5NsO
+/// 2gkT00AWTSzM9Zns0HedY31yEabkuFvrMCHjscEF7u3Y6PB7An3IzooBHchsFDei
+/// AAECIQD/JahddzR5K3A6rzTidmAf1PBtqi7296EnWv8WvpfAAQIhAOvowIXZI4Un
+/// DXjgZ9ekuUjZN+GUQRAVlkEEohGLVy59AiEA90VtqDdQuWWpvJX0cM08V10tLXrT
+/// TTGsEtITid1ogAECIQDAaFl90ZgS5cMrL3wCeatVKzVUmuJmB/VAmlLFFGzK0QIh
+/// ANJGc7AFk4fyFD/OezhwGHbWmo/S+bfeAiIh2Ss2FxKJ
+/// -----END CERTIFICATE-----
+/// ";
+///  let SAMPLE_STRING: Vec<u8> = SAMPLE.into();
+///
+///  let pems = parse_many(SAMPLE_STRING).unwrap();
+///  assert_eq!(pems.len(), 2);
+///  assert_eq!(pems[0].tag(), "INTERMEDIATE CERT");
+///  assert_eq!(pems[1].tag(), "CERTIFICATE");
+/// ```
+pub fn parse_many<B: AsRef<[u8]>>(input: B) -> Result<Vec<Pem>> {
+    // Each time our regex matches a PEM section, we need to decode it.
+    parse_captures_iter(input.as_ref())
+        .map(Pem::new_from_captures)
+        .collect()
+}
+
+/// Encode a PEM struct into a PEM-encoded data string
+///
+/// # Example
+/// ```rust
+///  use pem::{Pem, encode};
+///
+///  let pem = Pem::new("FOO", [1, 2, 3, 4]);
+///  encode(&pem);
+/// ```
+pub fn encode(pem: &Pem) -> String {
+    encode_config(pem, EncodeConfig::default())
+}
+
+/// Encode a PEM struct into a PEM-encoded data string with additional
+/// configuration options
+///
+/// # Example
+/// ```rust
+///  use pem::{Pem, encode_config, EncodeConfig, LineEnding};
+///
+///  let pem = Pem::new("FOO", [1, 2, 3, 4]);
+///  encode_config(&pem, EncodeConfig::new().set_line_ending(LineEnding::LF));
+/// ```
+pub fn encode_config(pem: &Pem, config: EncodeConfig) -> String {
+    let line_ending = match config.line_ending {
+        LineEnding::CRLF => "\r\n",
+        LineEnding::LF => "\n",
+    };
+
+    let mut output = String::new();
+
+    let contents = if pem.contents.is_empty() {
+        String::from("")
+    } else {
+        base64::engine::general_purpose::STANDARD.encode(&pem.contents)
+    };
+
+    write!(output, "-----BEGIN {}-----{}", pem.tag, line_ending).unwrap();
+    if !pem.headers.0.is_empty() {
+        for line in &pem.headers.0 {
+            write!(output, "{}{}", line.trim(), line_ending).unwrap();
+        }
+        output.push_str(line_ending);
+    }
+    for c in contents.as_bytes().chunks(config.line_wrap) {
+        write!(output, "{}{}", str::from_utf8(c).unwrap(), line_ending).unwrap();
+    }
+    write!(output, "-----END {}-----{}", pem.tag, line_ending).unwrap();
+
+    output
+}
+
+/// Encode multiple PEM structs into a PEM-encoded data string
+///
+/// # Example
+/// ```rust
+///  use pem::{Pem, encode_many};
+///
+///  let data = vec![
+///     Pem::new("FOO", [1, 2, 3, 4]),
+///     Pem::new("BAR", [5, 6, 7, 8]),
+///  ];
+///  encode_many(&data);
+/// ```
+pub fn encode_many(pems: &[Pem]) -> String {
+    pems.iter()
+        .map(encode)
+        .collect::<Vec<String>>()
+        .join("\r\n")
+}
+
+/// Encode multiple PEM structs into a PEM-encoded data string with additional
+/// configuration options
+///
+/// Same config will be used for each PEM struct.
+///
+/// # Example
+/// ```rust
+///  use pem::{Pem, encode_many_config, EncodeConfig, LineEnding};
+///
+///  let data = vec![
+///     Pem::new("FOO", [1, 2, 3, 4]),
+///     Pem::new("BAR", [5, 6, 7, 8]),
+///   ];
+///   encode_many_config(&data, EncodeConfig::new().set_line_ending(LineEnding::LF));
+/// ```
+pub fn encode_many_config(pems: &[Pem], config: EncodeConfig) -> String {
+    let line_ending = match config.line_ending {
+        LineEnding::CRLF => "\r\n",
+        LineEnding::LF => "\n",
+    };
+    pems.iter()
+        .map(|value| encode_config(value, config))
+        .collect::<Vec<String>>()
+        .join(line_ending)
+}
+
+#[cfg(feature = "serde")]
+mod serde_impl {
+    use super::{encode, parse, Pem};
+    use core::fmt;
+    use serde::{
+        de::{Error, Visitor},
+        Deserialize, Serialize,
+    };
+
+    impl Serialize for Pem {
+        fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+        where
+            S: serde::Serializer,
+        {
+            serializer.serialize_str(&encode(self))
+        }
+    }
+
+    struct PemVisitor;
+
+    impl<'de> Visitor<'de> for PemVisitor {
+        type Value = Pem;
+
+        fn expecting(&self, _formatter: &mut fmt::Formatter) -> fmt::Result {
+            Ok(())
+        }
+
+        fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
+        where
+            E: Error,
+        {
+            parse(v).map_err(Error::custom)
+        }
+    }
+
+    impl<'de> Deserialize<'de> for Pem {
+        fn deserialize<D>(deserializer: D) -> Result<Pem, D::Error>
+        where
+            D: serde::Deserializer<'de>,
+        {
+            deserializer.deserialize_str(PemVisitor)
+        }
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+    use proptest::prelude::*;
+    use std::error::Error;
+
+    const SAMPLE_CRLF: &str = "-----BEGIN RSA PRIVATE KEY-----\r
+MIIBPQIBAAJBAOsfi5AGYhdRs/x6q5H7kScxA0Kzzqe6WI6gf6+tc6IvKQJo5rQc\r
+dWWSQ0nRGt2hOPDO+35NKhQEjBQxPh/v7n0CAwEAAQJBAOGaBAyuw0ICyENy5NsO\r
+2gkT00AWTSzM9Zns0HedY31yEabkuFvrMCHjscEF7u3Y6PB7An3IzooBHchsFDei\r
+AAECIQD/JahddzR5K3A6rzTidmAf1PBtqi7296EnWv8WvpfAAQIhAOvowIXZI4Un\r
+DXjgZ9ekuUjZN+GUQRAVlkEEohGLVy59AiEA90VtqDdQuWWpvJX0cM08V10tLXrT\r
+TTGsEtITid1ogAECIQDAaFl90ZgS5cMrL3wCeatVKzVUmuJmB/VAmlLFFGzK0QIh\r
+ANJGc7AFk4fyFD/OezhwGHbWmo/S+bfeAiIh2Ss2FxKJ\r
+-----END RSA PRIVATE KEY-----\r
+\r
+-----BEGIN RSA PUBLIC KEY-----\r
+MIIBOgIBAAJBAMIeCnn9G/7g2Z6J+qHOE2XCLLuPoh5NHTO2Fm+PbzBvafBo0oYo\r
+QVVy7frzxmOqx6iIZBxTyfAQqBPO3Br59BMCAwEAAQJAX+PjHPuxdqiwF6blTkS0\r
+RFI1MrnzRbCmOkM6tgVO0cd6r5Z4bDGLusH9yjI9iI84gPRjK0AzymXFmBGuREHI\r
+sQIhAPKf4pp+Prvutgq2ayygleZChBr1DC4XnnufBNtaswyvAiEAzNGVKgNvzuhk\r
+ijoUXIDruJQEGFGvZTsi1D2RehXiT90CIQC4HOQUYKCydB7oWi1SHDokFW2yFyo6\r
+/+lf3fgNjPI6OQIgUPmTFXciXxT1msh3gFLf3qt2Kv8wbr9Ad9SXjULVpGkCIB+g\r
+RzHX0lkJl9Stshd/7Gbt65/QYq+v+xvAeT0CoyIg\r
+-----END RSA PUBLIC KEY-----\r
+";
+
+    const SAMPLE_LF: &str = "-----BEGIN RSA PRIVATE KEY-----
+MIIBPQIBAAJBAOsfi5AGYhdRs/x6q5H7kScxA0Kzzqe6WI6gf6+tc6IvKQJo5rQc
+dWWSQ0nRGt2hOPDO+35NKhQEjBQxPh/v7n0CAwEAAQJBAOGaBAyuw0ICyENy5NsO
+2gkT00AWTSzM9Zns0HedY31yEabkuFvrMCHjscEF7u3Y6PB7An3IzooBHchsFDei
+AAECIQD/JahddzR5K3A6rzTidmAf1PBtqi7296EnWv8WvpfAAQIhAOvowIXZI4Un
+DXjgZ9ekuUjZN+GUQRAVlkEEohGLVy59AiEA90VtqDdQuWWpvJX0cM08V10tLXrT
+TTGsEtITid1ogAECIQDAaFl90ZgS5cMrL3wCeatVKzVUmuJmB/VAmlLFFGzK0QIh
+ANJGc7AFk4fyFD/OezhwGHbWmo/S+bfeAiIh2Ss2FxKJ
+-----END RSA PRIVATE KEY-----
+
+-----BEGIN RSA PUBLIC KEY-----
+MIIBOgIBAAJBAMIeCnn9G/7g2Z6J+qHOE2XCLLuPoh5NHTO2Fm+PbzBvafBo0oYo
+QVVy7frzxmOqx6iIZBxTyfAQqBPO3Br59BMCAwEAAQJAX+PjHPuxdqiwF6blTkS0
+RFI1MrnzRbCmOkM6tgVO0cd6r5Z4bDGLusH9yjI9iI84gPRjK0AzymXFmBGuREHI
+sQIhAPKf4pp+Prvutgq2ayygleZChBr1DC4XnnufBNtaswyvAiEAzNGVKgNvzuhk
+ijoUXIDruJQEGFGvZTsi1D2RehXiT90CIQC4HOQUYKCydB7oWi1SHDokFW2yFyo6
+/+lf3fgNjPI6OQIgUPmTFXciXxT1msh3gFLf3qt2Kv8wbr9Ad9SXjULVpGkCIB+g
+RzHX0lkJl9Stshd/7Gbt65/QYq+v+xvAeT0CoyIg
+-----END RSA PUBLIC KEY-----
+";
+
+    const SAMPLE_WS: &str = "-----BEGIN RSA PRIVATE KEY-----
+MIIBPQIBAAJBAOsfi5AGYhdRs/x6q5H7kScxA0Kzzqe6WI6gf6+tc6IvKQJo5rQc \
+dWWSQ0nRGt2hOPDO+35NKhQEjBQxPh/v7n0CAwEAAQJBAOGaBAyuw0ICyENy5NsO \
+2gkT00AWTSzM9Zns0HedY31yEabkuFvrMCHjscEF7u3Y6PB7An3IzooBHchsFDei \
+AAECIQD/JahddzR5K3A6rzTidmAf1PBtqi7296EnWv8WvpfAAQIhAOvowIXZI4Un \
+DXjgZ9ekuUjZN+GUQRAVlkEEohGLVy59AiEA90VtqDdQuWWpvJX0cM08V10tLXrT \
+TTGsEtITid1ogAECIQDAaFl90ZgS5cMrL3wCeatVKzVUmuJmB/VAmlLFFGzK0QIh \
+ANJGc7AFk4fyFD/OezhwGHbWmo/S+bfeAiIh2Ss2FxKJ
+-----END RSA PRIVATE KEY-----
+
+-----BEGIN RSA PUBLIC KEY-----
+MIIBOgIBAAJBAMIeCnn9G/7g2Z6J+qHOE2XCLLuPoh5NHTO2Fm+PbzBvafBo0oYo \
+QVVy7frzxmOqx6iIZBxTyfAQqBPO3Br59BMCAwEAAQJAX+PjHPuxdqiwF6blTkS0 \
+RFI1MrnzRbCmOkM6tgVO0cd6r5Z4bDGLusH9yjI9iI84gPRjK0AzymXFmBGuREHI \
+sQIhAPKf4pp+Prvutgq2ayygleZChBr1DC4XnnufBNtaswyvAiEAzNGVKgNvzuhk \
+ijoUXIDruJQEGFGvZTsi1D2RehXiT90CIQC4HOQUYKCydB7oWi1SHDokFW2yFyo6 \
+/+lf3fgNjPI6OQIgUPmTFXciXxT1msh3gFLf3qt2Kv8wbr9Ad9SXjULVpGkCIB+g \
+RzHX0lkJl9Stshd/7Gbt65/QYq+v+xvAeT0CoyIg
+-----END RSA PUBLIC KEY-----
+";
+
+    const SAMPLE_DEFAULT_LINE_WRAP: &str = "-----BEGIN TEST-----\r
+AQIDBA==\r
+-----END TEST-----\r
+";
+
+    const SAMPLE_CUSTOM_LINE_WRAP_4: &str = "-----BEGIN TEST-----\r
+AQID\r
+BA==\r
+-----END TEST-----\r
+";
+
+    #[test]
+    fn test_parse_works() {
+        let pem = parse(SAMPLE_CRLF).unwrap();
+        assert_eq!(pem.tag(), "RSA PRIVATE KEY");
+    }
+
+    #[test]
+    fn test_parse_empty_space() {
+        let pem = parse(SAMPLE_WS).unwrap();
+        assert_eq!(pem.tag(), "RSA PRIVATE KEY");
+    }
+
+    #[test]
+    fn test_parse_invalid_framing() {
+        let input = "--BEGIN data-----
+        -----END data-----";
+        assert_eq!(parse(input), Err(PemError::MalformedFraming));
+    }
+
+    #[test]
+    fn test_parse_invalid_begin() {
+        let input = "-----BEGIN -----
+MIIBOgIBAAJBAMIeCnn9G/7g2Z6J+qHOE2XCLLuPoh5NHTO2Fm+PbzBvafBo0oYo
+QVVy7frzxmOqx6iIZBxTyfAQqBPO3Br59BMCAwEAAQJAX+PjHPuxdqiwF6blTkS0
+RFI1MrnzRbCmOkM6tgVO0cd6r5Z4bDGLusH9yjI9iI84gPRjK0AzymXFmBGuREHI
+sQIhAPKf4pp+Prvutgq2ayygleZChBr1DC4XnnufBNtaswyvAiEAzNGVKgNvzuhk
+ijoUXIDruJQEGFGvZTsi1D2RehXiT90CIQC4HOQUYKCydB7oWi1SHDokFW2yFyo6
+/+lf3fgNjPI6OQIgUPmTFXciXxT1msh3gFLf3qt2Kv8wbr9Ad9SXjULVpGkCIB+g
+RzHX0lkJl9Stshd/7Gbt65/QYq+v+xvAeT0CoyIg
+-----END RSA PUBLIC KEY-----";
+        assert_eq!(parse(input), Err(PemError::MissingBeginTag));
+    }
+
+    #[test]
+    fn test_parse_invalid_end() {
+        let input = "-----BEGIN DATA-----
+MIIBOgIBAAJBAMIeCnn9G/7g2Z6J+qHOE2XCLLuPoh5NHTO2Fm+PbzBvafBo0oYo
+QVVy7frzxmOqx6iIZBxTyfAQqBPO3Br59BMCAwEAAQJAX+PjHPuxdqiwF6blTkS0
+RFI1MrnzRbCmOkM6tgVO0cd6r5Z4bDGLusH9yjI9iI84gPRjK0AzymXFmBGuREHI
+sQIhAPKf4pp+Prvutgq2ayygleZChBr1DC4XnnufBNtaswyvAiEAzNGVKgNvzuhk
+ijoUXIDruJQEGFGvZTsi1D2RehXiT90CIQC4HOQUYKCydB7oWi1SHDokFW2yFyo6
+/+lf3fgNjPI6OQIgUPmTFXciXxT1msh3gFLf3qt2Kv8wbr9Ad9SXjULVpGkCIB+g
+RzHX0lkJl9Stshd/7Gbt65/QYq+v+xvAeT0CoyIg
+-----END -----";
+        assert_eq!(parse(input), Err(PemError::MissingEndTag));
+    }
+
+    #[test]
+    fn test_parse_invalid_data() {
+        let input = "-----BEGIN DATA-----
+MIIBOgIBAAJBAMIeCnn9G/7g2Z6J+qHOE2XCLLuPoh5NHTO2Fm+PbzBvafBo0oY?
+QVVy7frzxmOqx6iIZBxTyfAQqBPO3Br59BMCAwEAAQJAX+PjHPuxdqiwF6blTkS0
+RFI1MrnzRbCmOkM6tgVO0cd6r5Z4bDGLusH9yjI9iI84gPRjK0AzymXFmBGuREHI
+sQIhAPKf4pp+Prvutgq2ayygleZChBr1DC4XnnufBNtaswyvAiEAzNGVKgNvzuhk
+ijoUXIDruJQEGFGvZTsi1D2RehXiT90CIQC4HOQUYKCydB7oWi1SHDokFW2yFyo6
+/+lf3fgNjPI6OQIgUPmTFXciXxT1msh3gFLf3qt2Kv8wbr9Ad9SXjULVpGkCIB+g
+RzHX0lkJl9Stshd/7Gbt65/QYq+v+xvAeT0CoyIg
+-----END DATA-----";
+        match parse(input) {
+            Err(e @ PemError::InvalidData(_)) => {
+                assert_eq!(
+                    &format!("{}", e.source().unwrap()),
+                    "Invalid symbol 63, offset 63."
+                );
+            }
+            _ => unreachable!(),
+        }
+    }
+
+    #[test]
+    fn test_parse_empty_data() {
+        let input = "-----BEGIN DATA-----
+-----END DATA-----";
+        let pem = parse(input).unwrap();
+        assert_eq!(pem.contents().len(), 0);
+    }
+
+    #[test]
+    fn test_parse_many_works() {
+        let pems = parse_many(SAMPLE_CRLF).unwrap();
+        assert_eq!(pems.len(), 2);
+        assert_eq!(pems[0].tag(), "RSA PRIVATE KEY");
+        assert_eq!(pems[1].tag(), "RSA PUBLIC KEY");
+    }
+
+    #[test]
+    fn test_parse_many_errors_on_invalid_section() {
+        let input = SAMPLE_LF.to_owned() + "-----BEGIN -----\n-----END -----";
+        assert_eq!(parse_many(input), Err(PemError::MissingBeginTag));
+    }
+
+    #[test]
+    fn test_encode_default_line_wrap() {
+        let pem = Pem::new("TEST", vec![1, 2, 3, 4]);
+        assert_eq!(encode(&pem), SAMPLE_DEFAULT_LINE_WRAP);
+    }
+
+    #[test]
+    fn test_encode_custom_line_wrap_4() {
+        let pem = Pem::new("TEST", vec![1, 2, 3, 4]);
+        assert_eq!(
+            encode_config(&pem, EncodeConfig::default().set_line_wrap(4)),
+            SAMPLE_CUSTOM_LINE_WRAP_4
+        );
+    }
+    #[test]
+    fn test_encode_empty_contents() {
+        let pem = Pem::new("FOO", vec![]);
+        let encoded = encode(&pem);
+        assert!(!encoded.is_empty());
+
+        let pem_out = parse(&encoded).unwrap();
+        assert_eq!(&pem, &pem_out);
+    }
+
+    #[test]
+    fn test_encode_contents() {
+        let pem = Pem::new("FOO", [1, 2, 3, 4]);
+        let encoded = encode(&pem);
+        assert!(!encoded.is_empty());
+
+        let pem_out = parse(&encoded).unwrap();
+        assert_eq!(&pem, &pem_out);
+    }
+
+    #[test]
+    fn test_encode_many() {
+        let pems = parse_many(SAMPLE_CRLF).unwrap();
+        let encoded = encode_many(&pems);
+
+        assert_eq!(SAMPLE_CRLF, encoded);
+    }
+
+    #[test]
+    fn test_encode_config_contents() {
+        let pem = Pem::new("FOO", [1, 2, 3, 4]);
+        let config = EncodeConfig::default().set_line_ending(LineEnding::LF);
+        let encoded = encode_config(&pem, config);
+        assert!(!encoded.is_empty());
+
+        let pem_out = parse(&encoded).unwrap();
+        assert_eq!(&pem, &pem_out);
+    }
+
+    #[test]
+    fn test_encode_many_config() {
+        let pems = parse_many(SAMPLE_LF).unwrap();
+        let config = EncodeConfig::default().set_line_ending(LineEnding::LF);
+        let encoded = encode_many_config(&pems, config);
+
+        assert_eq!(SAMPLE_LF, encoded);
+    }
+
+    #[cfg(feature = "serde")]
+    #[test]
+    fn test_serde() {
+        let pem = Pem::new("Mock tag", "Mock contents".as_bytes());
+        let value = serde_json::to_string_pretty(&pem).unwrap();
+        let result = serde_json::from_str(&value).unwrap();
+        assert_eq!(pem, result);
+    }
+
+    const HEADER_CRLF: &str = "-----BEGIN CERTIFICATE-----\r
+MIIBPQIBAAJBAOsfi5AGYhdRs/x6q5H7kScxA0Kzzqe6WI6gf6+tc6IvKQJo5rQc\r
+dWWSQ0nRGt2hOPDO+35NKhQEjBQxPh/v7n0CAwEAAQJBAOGaBAyuw0ICyENy5NsO\r
+2gkT00AWTSzM9Zns0HedY31yEabkuFvrMCHjscEF7u3Y6PB7An3IzooBHchsFDei\r
+AAECIQD/JahddzR5K3A6rzTidmAf1PBtqi7296EnWv8WvpfAAQIhAOvowIXZI4Un\r
+DXjgZ9ekuUjZN+GUQRAVlkEEohGLVy59AiEA90VtqDdQuWWpvJX0cM08V10tLXrT\r
+TTGsEtITid1ogAECIQDAaFl90ZgS5cMrL3wCeatVKzVUmuJmB/VAmlLFFGzK0QIh\r
+ANJGc7AFk4fyFD/OezhwGHbWmo/S+bfeAiIh2Ss2FxKJ\r
+-----END CERTIFICATE-----\r
+-----BEGIN RSA PRIVATE KEY-----\r
+Proc-Type: 4,ENCRYPTED\r
+DEK-Info: AES-256-CBC,975C518B7D2CCD1164A3354D1F89C5A6\r
+\r
+MIIBOgIBAAJBAMIeCnn9G/7g2Z6J+qHOE2XCLLuPoh5NHTO2Fm+PbzBvafBo0oYo\r
+QVVy7frzxmOqx6iIZBxTyfAQqBPO3Br59BMCAwEAAQJAX+PjHPuxdqiwF6blTkS0\r
+RFI1MrnzRbCmOkM6tgVO0cd6r5Z4bDGLusH9yjI9iI84gPRjK0AzymXFmBGuREHI\r
+sQIhAPKf4pp+Prvutgq2ayygleZChBr1DC4XnnufBNtaswyvAiEAzNGVKgNvzuhk\r
+ijoUXIDruJQEGFGvZTsi1D2RehXiT90CIQC4HOQUYKCydB7oWi1SHDokFW2yFyo6\r
+/+lf3fgNjPI6OQIgUPmTFXciXxT1msh3gFLf3qt2Kv8wbr9Ad9SXjULVpGkCIB+g\r
+RzHX0lkJl9Stshd/7Gbt65/QYq+v+xvAeT0CoyIg\r
+-----END RSA PRIVATE KEY-----\r
+";
+    const HEADER_CRLF_DATA: [&str; 2] = [
+        "MIIBPQIBAAJBAOsfi5AGYhdRs/x6q5H7kScxA0Kzzqe6WI6gf6+tc6IvKQJo5rQc\r
+dWWSQ0nRGt2hOPDO+35NKhQEjBQxPh/v7n0CAwEAAQJBAOGaBAyuw0ICyENy5NsO\r
+2gkT00AWTSzM9Zns0HedY31yEabkuFvrMCHjscEF7u3Y6PB7An3IzooBHchsFDei\r
+AAECIQD/JahddzR5K3A6rzTidmAf1PBtqi7296EnWv8WvpfAAQIhAOvowIXZI4Un\r
+DXjgZ9ekuUjZN+GUQRAVlkEEohGLVy59AiEA90VtqDdQuWWpvJX0cM08V10tLXrT\r
+TTGsEtITid1ogAECIQDAaFl90ZgS5cMrL3wCeatVKzVUmuJmB/VAmlLFFGzK0QIh\r
+ANJGc7AFk4fyFD/OezhwGHbWmo/S+bfeAiIh2Ss2FxKJ\r",
+        "MIIBOgIBAAJBAMIeCnn9G/7g2Z6J+qHOE2XCLLuPoh5NHTO2Fm+PbzBvafBo0oYo\r
+QVVy7frzxmOqx6iIZBxTyfAQqBPO3Br59BMCAwEAAQJAX+PjHPuxdqiwF6blTkS0\r
+RFI1MrnzRbCmOkM6tgVO0cd6r5Z4bDGLusH9yjI9iI84gPRjK0AzymXFmBGuREHI\r
+sQIhAPKf4pp+Prvutgq2ayygleZChBr1DC4XnnufBNtaswyvAiEAzNGVKgNvzuhk\r
+ijoUXIDruJQEGFGvZTsi1D2RehXiT90CIQC4HOQUYKCydB7oWi1SHDokFW2yFyo6\r
+/+lf3fgNjPI6OQIgUPmTFXciXxT1msh3gFLf3qt2Kv8wbr9Ad9SXjULVpGkCIB+g\r
+RzHX0lkJl9Stshd/7Gbt65/QYq+v+xvAeT0CoyIg\r",
+    ];
+
+    const HEADER_LF: &str = "-----BEGIN CERTIFICATE-----
+MIIBPQIBAAJBAOsfi5AGYhdRs/x6q5H7kScxA0Kzzqe6WI6gf6+tc6IvKQJo5rQc
+dWWSQ0nRGt2hOPDO+35NKhQEjBQxPh/v7n0CAwEAAQJBAOGaBAyuw0ICyENy5NsO
+2gkT00AWTSzM9Zns0HedY31yEabkuFvrMCHjscEF7u3Y6PB7An3IzooBHchsFDei
+AAECIQD/JahddzR5K3A6rzTidmAf1PBtqi7296EnWv8WvpfAAQIhAOvowIXZI4Un
+DXjgZ9ekuUjZN+GUQRAVlkEEohGLVy59AiEA90VtqDdQuWWpvJX0cM08V10tLXrT
+TTGsEtITid1ogAECIQDAaFl90ZgS5cMrL3wCeatVKzVUmuJmB/VAmlLFFGzK0QIh
+ANJGc7AFk4fyFD/OezhwGHbWmo/S+bfeAiIh2Ss2FxKJ
+-----END CERTIFICATE-----
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: AES-256-CBC,975C518B7D2CCD1164A3354D1F89C5A6
+
+MIIBOgIBAAJBAMIeCnn9G/7g2Z6J+qHOE2XCLLuPoh5NHTO2Fm+PbzBvafBo0oYo
+QVVy7frzxmOqx6iIZBxTyfAQqBPO3Br59BMCAwEAAQJAX+PjHPuxdqiwF6blTkS0
+RFI1MrnzRbCmOkM6tgVO0cd6r5Z4bDGLusH9yjI9iI84gPRjK0AzymXFmBGuREHI
+sQIhAPKf4pp+Prvutgq2ayygleZChBr1DC4XnnufBNtaswyvAiEAzNGVKgNvzuhk
+ijoUXIDruJQEGFGvZTsi1D2RehXiT90CIQC4HOQUYKCydB7oWi1SHDokFW2yFyo6
+/+lf3fgNjPI6OQIgUPmTFXciXxT1msh3gFLf3qt2Kv8wbr9Ad9SXjULVpGkCIB+g
+RzHX0lkJl9Stshd/7Gbt65/QYq+v+xvAeT0CoyIg
+-----END RSA PRIVATE KEY-----
+";
+    const HEADER_LF_DATA: [&str; 2] = [
+        "MIIBPQIBAAJBAOsfi5AGYhdRs/x6q5H7kScxA0Kzzqe6WI6gf6+tc6IvKQJo5rQc
+dWWSQ0nRGt2hOPDO+35NKhQEjBQxPh/v7n0CAwEAAQJBAOGaBAyuw0ICyENy5NsO
+2gkT00AWTSzM9Zns0HedY31yEabkuFvrMCHjscEF7u3Y6PB7An3IzooBHchsFDei
+AAECIQD/JahddzR5K3A6rzTidmAf1PBtqi7296EnWv8WvpfAAQIhAOvowIXZI4Un
+DXjgZ9ekuUjZN+GUQRAVlkEEohGLVy59AiEA90VtqDdQuWWpvJX0cM08V10tLXrT
+TTGsEtITid1ogAECIQDAaFl90ZgS5cMrL3wCeatVKzVUmuJmB/VAmlLFFGzK0QIh
+ANJGc7AFk4fyFD/OezhwGHbWmo/S+bfeAiIh2Ss2FxKJ",
+        "MIIBOgIBAAJBAMIeCnn9G/7g2Z6J+qHOE2XCLLuPoh5NHTO2Fm+PbzBvafBo0oYo
+QVVy7frzxmOqx6iIZBxTyfAQqBPO3Br59BMCAwEAAQJAX+PjHPuxdqiwF6blTkS0
+RFI1MrnzRbCmOkM6tgVO0cd6r5Z4bDGLusH9yjI9iI84gPRjK0AzymXFmBGuREHI
+sQIhAPKf4pp+Prvutgq2ayygleZChBr1DC4XnnufBNtaswyvAiEAzNGVKgNvzuhk
+ijoUXIDruJQEGFGvZTsi1D2RehXiT90CIQC4HOQUYKCydB7oWi1SHDokFW2yFyo6
+/+lf3fgNjPI6OQIgUPmTFXciXxT1msh3gFLf3qt2Kv8wbr9Ad9SXjULVpGkCIB+g
+RzHX0lkJl9Stshd/7Gbt65/QYq+v+xvAeT0CoyIg",
+    ];
+
+    fn cmp_data(left: &[u8], right: &[u8]) -> bool {
+        if left.len() != right.len() {
+            false
+        } else {
+            left.iter()
+                .zip(right.iter())
+                .all(|(left, right)| left == right)
+        }
+    }
+
+    #[test]
+    fn test_parse_many_with_headers_crlf() {
+        let pems = parse_many(HEADER_CRLF).unwrap();
+        assert_eq!(pems.len(), 2);
+        assert_eq!(pems[0].tag(), "CERTIFICATE");
+        assert!(cmp_data(
+            pems[0].contents(),
+            &decode_data(HEADER_CRLF_DATA[0]).unwrap()
+        ));
+        assert_eq!(pems[1].tag(), "RSA PRIVATE KEY");
+        assert!(cmp_data(
+            pems[1].contents(),
+            &decode_data(HEADER_CRLF_DATA[1]).unwrap()
+        ));
+    }
+
+    #[test]
+    fn test_parse_many_with_headers_lf() {
+        let pems = parse_many(HEADER_LF).unwrap();
+        assert_eq!(pems.len(), 2);
+        assert_eq!(pems[0].tag(), "CERTIFICATE");
+        assert!(cmp_data(
+            pems[0].contents(),
+            &decode_data(HEADER_LF_DATA[0]).unwrap()
+        ));
+        assert_eq!(pems[1].tag(), "RSA PRIVATE KEY");
+        assert!(cmp_data(
+            pems[1].contents(),
+            &decode_data(HEADER_LF_DATA[1]).unwrap()
+        ));
+    }
+
+    proptest! {
+        #[test]
+        fn test_str_parse_and_display(tag in "[A-Z ]+", contents in prop::collection::vec(0..255u8, 0..200)) {
+            let pem = Pem::new(tag, contents);
+            prop_assert_eq!(&pem, &pem.to_string().parse::<Pem>().unwrap());
+        }
+
+        #[test]
+        fn test_str_parse_and_display_with_headers(tag in "[A-Z ]+",
+                                                   key in "[a-zA-Z]+",
+                                                   value in "[a-zA-A]+",
+                                                   contents in prop::collection::vec(0..255u8, 0..200)) {
+            let mut pem = Pem::new(tag, contents);
+            pem.headers_mut().add(&key, &value).unwrap();
+            prop_assert_eq!(&pem, &pem.to_string().parse::<Pem>().unwrap());
+        }
+    }
+
+    #[test]
+    fn test_extract_headers() {
+        let pems = parse_many(HEADER_CRLF).unwrap();
+        let headers = pems[1].headers().iter().collect::<Vec<_>>();
+        assert_eq!(headers.len(), 2);
+        assert_eq!(headers[0].0, "Proc-Type");
+        assert_eq!(headers[0].1, "4,ENCRYPTED");
+        assert_eq!(headers[1].0, "DEK-Info");
+        assert_eq!(headers[1].1, "AES-256-CBC,975C518B7D2CCD1164A3354D1F89C5A6");
+
+        let headers = pems[1].headers().iter().rev().collect::<Vec<_>>();
+        assert_eq!(headers.len(), 2);
+        assert_eq!(headers[1].0, "Proc-Type");
+        assert_eq!(headers[1].1, "4,ENCRYPTED");
+        assert_eq!(headers[0].0, "DEK-Info");
+        assert_eq!(headers[0].1, "AES-256-CBC,975C518B7D2CCD1164A3354D1F89C5A6");
+    }
+
+    #[test]
+    fn test_get_header() {
+        let pems = parse_many(HEADER_CRLF).unwrap();
+        let headers = pems[1].headers();
+        assert_eq!(headers.get("Proc-Type"), Some("4,ENCRYPTED"));
+        assert_eq!(
+            headers.get("DEK-Info"),
+            Some("AES-256-CBC,975C518B7D2CCD1164A3354D1F89C5A6")
+        );
+    }
+
+    #[test]
+    fn test_only_get_latest() {
+        const LATEST: &str = "-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: AES-256-CBC,975C518B7D2CCD1164A3354D1F89C5A6
+Proc-Type: 42,DECRYPTED
+
+MIIBOgIBAAJBAMIeCnn9G/7g2Z6J+qHOE2XCLLuPoh5NHTO2Fm+PbzBvafBo0oYo
+QVVy7frzxmOqx6iIZBxTyfAQqBPO3Br59BMCAwEAAQJAX+PjHPuxdqiwF6blTkS0
+RFI1MrnzRbCmOkM6tgVO0cd6r5Z4bDGLusH9yjI9iI84gPRjK0AzymXFmBGuREHI
+sQIhAPKf4pp+Prvutgq2ayygleZChBr1DC4XnnufBNtaswyvAiEAzNGVKgNvzuhk
+ijoUXIDruJQEGFGvZTsi1D2RehXiT90CIQC4HOQUYKCydB7oWi1SHDokFW2yFyo6
+/+lf3fgNjPI6OQIgUPmTFXciXxT1msh3gFLf3qt2Kv8wbr9Ad9SXjULVpGkCIB+g
+RzHX0lkJl9Stshd/7Gbt65/QYq+v+xvAeT0CoyIg
+-----END RSA PRIVATE KEY-----
+";
+        let pem = parse(LATEST).unwrap();
+        let headers = pem.headers();
+        assert_eq!(headers.get("Proc-Type"), Some("42,DECRYPTED"));
+        assert_eq!(
+            headers.get("DEK-Info"),
+            Some("AES-256-CBC,975C518B7D2CCD1164A3354D1F89C5A6")
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pem/src/parser.rs 43.0.0-1ubuntu1/rust-vendor/pem/src/parser.rs
--- 43.0.0-1/rust-vendor/pem/src/parser.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pem/src/parser.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,122 @@
+pub struct Captures<'a> {
+    pub begin: &'a [u8],
+    pub headers: &'a [u8],
+    pub data: &'a [u8],
+    pub end: &'a [u8],
+}
+
+pub fn parse_captures(input: &[u8]) -> Option<Captures<'_>> {
+    parser_inner(input).map(|(_, cap)| cap)
+}
+pub fn parse_captures_iter(input: &[u8]) -> CaptureMatches<'_> {
+    CaptureMatches { input }
+}
+
+pub struct CaptureMatches<'a> {
+    input: &'a [u8],
+}
+impl<'a> Iterator for CaptureMatches<'a> {
+    type Item = Captures<'a>;
+    fn next(&mut self) -> Option<Self::Item> {
+        if self.input.is_empty() {
+            return None;
+        }
+        match parser_inner(self.input) {
+            Some((remaining, captures)) => {
+                self.input = remaining;
+                Some(captures)
+            }
+            None => {
+                self.input = &[];
+                None
+            }
+        }
+    }
+}
+
+fn parse_begin(input: &[u8]) -> Option<(&[u8], &[u8])> {
+    let (input, _) = read_until(input, b"-----BEGIN ")?;
+    let (input, begin) = read_until(input, b"-----")?;
+    let input = skip_whitespace(input);
+    Some((input, begin))
+}
+
+fn parse_payload(input: &[u8]) -> Option<(&[u8], &[u8])> {
+    read_until(input, b"-----END ")
+}
+
+fn extract_headers_and_data(input: &[u8]) -> (&[u8], &[u8]) {
+    if let Some((rest, headers)) = read_until(input, b"\n\n") {
+        (headers, rest)
+    } else if let Some((rest, headers)) = read_until(input, b"\r\n\r\n") {
+        (headers, rest)
+    } else {
+        (&[], input)
+    }
+}
+
+fn parse_end(input: &[u8]) -> Option<(&[u8], &[u8])> {
+    let (remaining, end) = read_until(input, b"-----")?;
+    let remaining = skip_whitespace(remaining);
+    Some((remaining, end))
+}
+
+fn parser_inner(input: &[u8]) -> Option<(&[u8], Captures<'_>)> {
+    // Should be equivalent to the regex
+    // "(?s)-----BEGIN (?P<begin>.*?)-----[ \t\n\r]*(?P<data>.*?)-----END (?P<end>.*?)-----[ \t\n\r]*"
+
+    // (?s)                                      # Enable dotall (. matches all characters incl \n)
+    // -----BEGIN (?P<begin>.*?)-----[ \t\n\r]*  # Parse begin
+    // (?P<data>.*?)                             # Parse data
+    // -----END (?P<end>.*?)-----[ \t\n\r]*      # Parse end
+
+    let (input, begin) = parse_begin(input)?;
+    let (input, payload) = parse_payload(input)?;
+    let (headers, data) = extract_headers_and_data(payload);
+    let (remaining, end) = parse_end(input)?;
+
+    let captures = Captures {
+        begin,
+        headers,
+        data,
+        end,
+    };
+    Some((remaining, captures))
+}
+
+// Equivalent to the regex [ \t\n\r]*
+fn skip_whitespace(mut input: &[u8]) -> &[u8] {
+    while let Some(b) = input.first() {
+        match b {
+            b' ' | b'\t' | b'\n' | b'\r' => {
+                input = &input[1..];
+            }
+            _ => break,
+        }
+    }
+    input
+}
+// Equivalent to (.*?) followed by a string
+// Returns the remaining input (after the secondary matched string) and the matched data
+fn read_until<'a>(input: &'a [u8], marker: &[u8]) -> Option<(&'a [u8], &'a [u8])> {
+    // If there is no end condition, short circuit
+    if marker.is_empty() {
+        return Some((&[], input));
+    }
+    let mut index = 0;
+    let mut found = 0;
+    while input.len() - index >= marker.len() - found {
+        if input[index] == marker[found] {
+            found += 1;
+        } else {
+            found = 0;
+        }
+        index += 1;
+        if found == marker.len() {
+            let remaining = &input[index..];
+            let matched = &input[..index - found];
+            return Some((remaining, matched));
+        }
+    }
+    None
+}
diff -pruN 43.0.0-1/rust-vendor/pkg-config/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/pkg-config/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/pkg-config/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pkg-config/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"CHANGELOG.md":"2fe37f28eb49148058e6a6d5541cc4bbbc3bf44737a75293a5bb79b7dfd2c8de","Cargo.toml":"33caffada2adcc474d3dd6f2b3ccc0c672f953330af932128ad09ccb65628a50","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"37f11a56c969237dcfd15368e96bf686ec92b0254e38fb84636e178d632c0492","src/lib.rs":"c907a8e2e0226a81c8c7c8c4cd606ae2a0b2bfa6dd65c6f03ef2c3082c033403","tests/escape.pc":"00caa4136799dbe5bd504239ba90d1156c12def365c8d761da319fe8a83b398e","tests/foo.pc":"4a1c442c5d1c10761ea1644f8fd58f93cc5a706391bc67b04c243bbd35d70d79","tests/framework.pc":"304fdb6cea92973650e410ab1f70ce1ebeb7718af3f139e806efbf182acd565c","tests/rpath.pc":"424a844e844edfef02692492def9864833391f581338962946646989a69c1180","tests/test.rs":"d1e93c60096baa30fbd1ef961fd01a36ced36c7f05939171d1f58054c9c4b08a"},"package":"d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/pkg-config/CHANGELOG.md 43.0.0-1ubuntu1/rust-vendor/pkg-config/CHANGELOG.md
--- 43.0.0-1/rust-vendor/pkg-config/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pkg-config/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,203 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [0.3.30] - 2024-02-14
+
+### Changed
+
+- Update documentation for cross-compilation (#161).
+
+- Update GitHub Action CI (#160).
+
+## [0.3.29] - 2024-01-17
+
+### Fixed
+
+- Detection and usage of Windows static libraries (#154).
+
+- Passing `-Wl,-u` to the linker if specified in the pkg-config file (#154).
+
+## [0.3.28] - 2023-12-20
+
+### Fixed
+
+- Pass -l:libfoo.a to linker directly (#149).
+
+### Changed
+
+- Improve error message when library not found (#158).
+
+## [0.3.27] - 2023-05-03
+
+### Added
+
+- Support falling back to `pkgconf` if `pkg-config` is not available (#145).
+
+### Changed
+
+- Simplify running `pkg-config` (#144).
+
+- Document MSRV in `Cargo.toml` via `rust-version`.
+
+- Fix a couple of minor clippy warnings (#147).
+
+## [0.3.26] - 2022-10-26
+
+### Added
+
+- Support for handling full paths to libraries in addition to normal `-l`
+  linker flags (#134).
+
+## [0.3.25] - 2022-03-31
+
+### Added
+
+- Support for parsing `-Wl` linker arguments from the `Libs` lines and
+  passing them to the linker as well as making them available via
+  `Library::ld_args` (#131).
+
+### Changed
+
+- Use SPDX license format and remove obsolete badge info (#129).
+
+## [0.3.24] - 2021-12-11
+
+### Fixed
+
+- Re-add `target_supported()`, which was accidentally removed in 0.3.15 (#128).
+
+## [0.3.23] - 2021-12-06
+
+### Changed
+
+- Improve error messages when a `pkg-config` package can't be found (#127).
+
+## [0.3.22] - 2021-10-24
+
+### Fixed
+
+- `pkg-config` compiles again with Rust 1.30 or newer. 0.3.21 accidentally
+  made use of API only available since 1.40 (#124, #125).
+
+### Changed
+
+- Switched from Travis to GitHub Actions for the CI. Travis is dysfunctional
+  since quite some time (#126).
+
+## [0.3.21] - 2021-10-22
+
+### Fixed
+
+- Tests succeed again on macOS (#122).
+
+### Changed
+
+- Improve error message in case of missing pkg-config and provide instructions
+  how it can be installed (#121).
+
+## [0.3.20] - 2021-09-25
+
+### Fixed
+
+- Use target-specific pkg-config consistently everywhere (#121, #118).
+
+## [0.3.19] - 2020-10-13
+
+### Added
+
+- Add `README.md` to be displayed on crates.io (#111).
+
+- Support for `-isystem`, `-iquote` and `-idirafter` include flags (#115).
+
+### Changed
+
+- Improve documentation for cross-compilation (#113).
+
+- Allow overriding system root via the `PKG_CONFIG_SYSROOT_DIR` or `SYSROOT`
+  environment variable (#82).
+
+## [0.3.18] - 2020-07-11
+
+### Fixed
+
+- Use `env::var_os()` almost everywhere to handle non-UTF8 paths in
+  environment variables, and also improve error handling around environment
+  variable handling (#106).
+
+### Changed
+
+- Default the `env_metadata` build parameter to `true` instead of `false`.
+  Whenever a pkg-config related environment variable changes it would make
+  sense to rebuild crates that use pkg-config, or otherwise changes might not
+  be picked up. As such the previous default didn't make much sense (#105).
+
+## [0.3.17] - 2019-11-02
+
+### Fixed
+
+- Fix support for multiple version number constraints (#95)
+
+## [0.3.16] - 2019-09-09
+
+### Changed
+- Stop using deprecated functions and require Rust 1.30 (#84)
+
+### Fixed
+- Fix repository URL in README.md
+- Fix various clippy warnings
+
+### Added
+- Run `cargo fmt` as part of the CI (#89)
+- Derive `Clone` for `Library` and `Debug` for `Config (#91)
+- Add support for `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS` and enable by default (#93)
+
+## [0.3.15] - 2019-07-25
+
+### Changed
+- Changes minimum documented rust version to 1.28 (#76)
+
+### Fixed
+- Fix Travis CI badge url (#78)
+- Fix project name in README.md (#81)
+
+### Added
+- Support specifying range of versions (#75)
+- Allow cross-compilation if pkg-config is customized (#44, #86)
+
+## [0.3.14] - 2018-08-28
+
+### Fixed
+- Don't append .lib suffix on MSVC builds (#72)
+
+## [0.3.13] - 2018-08-06
+
+### Fixed
+- Fix MSVC support to actually work and consider library paths too (#71)
+
+## [0.3.12] - 2018-06-18
+
+### Added
+- Support for MSVC (#70)
+- Document and test Rust 1.13 as minimally supported version (#66)
+
+## [0.3.11] - 2018-04-24
+
+### Fixed
+- Re-added AsciiExt import (#65)
+
+## [0.3.10] - 2018-04-23
+
+### Added
+- Allow static linking of /usr/ on macOS (#42)
+- Add support for parsing `-Wl,` style framework flags (#48)
+- Parse defines in `pkg-config` output (#49)
+- Rerun on `PKG_CONFIG_PATH` changes (#50)
+- Introduce target-scoped variables (#58)
+- Respect pkg-config escaping rules used with --cflags and --libs (#61)
+
+### Changed
+- Use `?` instead of `try!()` in the codebase (#63)
diff -pruN 43.0.0-1/rust-vendor/pkg-config/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/pkg-config/Cargo.toml
--- 43.0.0-1/rust-vendor/pkg-config/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pkg-config/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,28 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+rust-version = "1.30"
+name = "pkg-config"
+version = "0.3.30"
+authors = ["Alex Crichton <alex@alexcrichton.com>"]
+description = """
+A library to run the pkg-config system tool at build time in order to be used in
+Cargo build scripts.
+"""
+documentation = "https://docs.rs/pkg-config"
+readme = "README.md"
+keywords = ["build-dependencies"]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/rust-lang/pkg-config-rs"
+
+[dev-dependencies.lazy_static]
+version = "1"
diff -pruN 43.0.0-1/rust-vendor/pkg-config/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/pkg-config/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/pkg-config/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pkg-config/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,201 @@
+                              Apache License
+                        Version 2.0, January 2004
+                     http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+   "License" shall mean the terms and conditions for use, reproduction,
+   and distribution as defined by Sections 1 through 9 of this document.
+
+   "Licensor" shall mean the copyright owner or entity authorized by
+   the copyright owner that is granting the License.
+
+   "Legal Entity" shall mean the union of the acting entity and all
+   other entities that control, are controlled by, or are under common
+   control with that entity. For the purposes of this definition,
+   "control" means (i) the power, direct or indirect, to cause the
+   direction or management of such entity, whether by contract or
+   otherwise, or (ii) ownership of fifty percent (50%) or more of the
+   outstanding shares, or (iii) beneficial ownership of such entity.
+
+   "You" (or "Your") shall mean an individual or Legal Entity
+   exercising permissions granted by this License.
+
+   "Source" form shall mean the preferred form for making modifications,
+   including but not limited to software source code, documentation
+   source, and configuration files.
+
+   "Object" form shall mean any form resulting from mechanical
+   transformation or translation of a Source form, including but
+   not limited to compiled object code, generated documentation,
+   and conversions to other media types.
+
+   "Work" shall mean the work of authorship, whether in Source or
+   Object form, made available under the License, as indicated by a
+   copyright notice that is included in or attached to the work
+   (an example is provided in the Appendix below).
+
+   "Derivative Works" shall mean any work, whether in Source or Object
+   form, that is based on (or derived from) the Work and for which the
+   editorial revisions, annotations, elaborations, or other modifications
+   represent, as a whole, an original work of authorship. For the purposes
+   of this License, Derivative Works shall not include works that remain
+   separable from, or merely link (or bind by name) to the interfaces of,
+   the Work and Derivative Works thereof.
+
+   "Contribution" shall mean any work of authorship, including
+   the original version of the Work and any modifications or additions
+   to that Work or Derivative Works thereof, that is intentionally
+   submitted to Licensor for inclusion in the Work by the copyright owner
+   or by an individual or Legal Entity authorized to submit on behalf of
+   the copyright owner. For the purposes of this definition, "submitted"
+   means any form of electronic, verbal, or written communication sent
+   to the Licensor or its representatives, including but not limited to
+   communication on electronic mailing lists, source code control systems,
+   and issue tracking systems that are managed by, or on behalf of, the
+   Licensor for the purpose of discussing and improving the Work, but
+   excluding communication that is conspicuously marked or otherwise
+   designated in writing by the copyright owner as "Not a Contribution."
+
+   "Contributor" shall mean Licensor and any individual or Legal Entity
+   on behalf of whom a Contribution has been received by Licensor and
+   subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   copyright license to reproduce, prepare Derivative Works of,
+   publicly display, publicly perform, sublicense, and distribute the
+   Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   (except as stated in this section) patent license to make, have made,
+   use, offer to sell, sell, import, and otherwise transfer the Work,
+   where such license applies only to those patent claims licensable
+   by such Contributor that are necessarily infringed by their
+   Contribution(s) alone or by combination of their Contribution(s)
+   with the Work to which such Contribution(s) was submitted. If You
+   institute patent litigation against any entity (including a
+   cross-claim or counterclaim in a lawsuit) alleging that the Work
+   or a Contribution incorporated within the Work constitutes direct
+   or contributory patent infringement, then any patent licenses
+   granted to You under this License for that Work shall terminate
+   as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+   Work or Derivative Works thereof in any medium, with or without
+   modifications, and in Source or Object form, provided that You
+   meet the following conditions:
+
+   (a) You must give any other recipients of the Work or
+       Derivative Works a copy of this License; and
+
+   (b) You must cause any modified files to carry prominent notices
+       stating that You changed the files; and
+
+   (c) You must retain, in the Source form of any Derivative Works
+       that You distribute, all copyright, patent, trademark, and
+       attribution notices from the Source form of the Work,
+       excluding those notices that do not pertain to any part of
+       the Derivative Works; and
+
+   (d) If the Work includes a "NOTICE" text file as part of its
+       distribution, then any Derivative Works that You distribute must
+       include a readable copy of the attribution notices contained
+       within such NOTICE file, excluding those notices that do not
+       pertain to any part of the Derivative Works, in at least one
+       of the following places: within a NOTICE text file distributed
+       as part of the Derivative Works; within the Source form or
+       documentation, if provided along with the Derivative Works; or,
+       within a display generated by the Derivative Works, if and
+       wherever such third-party notices normally appear. The contents
+       of the NOTICE file are for informational purposes only and
+       do not modify the License. You may add Your own attribution
+       notices within Derivative Works that You distribute, alongside
+       or as an addendum to the NOTICE text from the Work, provided
+       that such additional attribution notices cannot be construed
+       as modifying the License.
+
+   You may add Your own copyright statement to Your modifications and
+   may provide additional or different license terms and conditions
+   for use, reproduction, or distribution of Your modifications, or
+   for any such Derivative Works as a whole, provided Your use,
+   reproduction, and distribution of the Work otherwise complies with
+   the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+   any Contribution intentionally submitted for inclusion in the Work
+   by You to the Licensor shall be under the terms and conditions of
+   this License, without any additional terms or conditions.
+   Notwithstanding the above, nothing herein shall supersede or modify
+   the terms of any separate license agreement you may have executed
+   with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+   names, trademarks, service marks, or product names of the Licensor,
+   except as required for reasonable and customary use in describing the
+   origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+   agreed to in writing, Licensor provides the Work (and each
+   Contributor provides its Contributions) on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+   implied, including, without limitation, any warranties or conditions
+   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+   PARTICULAR PURPOSE. You are solely responsible for determining the
+   appropriateness of using or redistributing the Work and assume any
+   risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+   whether in tort (including negligence), contract, or otherwise,
+   unless required by applicable law (such as deliberate and grossly
+   negligent acts) or agreed to in writing, shall any Contributor be
+   liable to You for damages, including any direct, indirect, special,
+   incidental, or consequential damages of any character arising as a
+   result of this License or out of the use or inability to use the
+   Work (including but not limited to damages for loss of goodwill,
+   work stoppage, computer failure or malfunction, or any and all
+   other commercial damages or losses), even if such Contributor
+   has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+   the Work or Derivative Works thereof, You may choose to offer,
+   and charge a fee for, acceptance of support, warranty, indemnity,
+   or other liability obligations and/or rights consistent with this
+   License. However, in accepting such obligations, You may act only
+   on Your own behalf and on Your sole responsibility, not on behalf
+   of any other Contributor, and only if You agree to indemnify,
+   defend, and hold each Contributor harmless for any liability
+   incurred by, or claims asserted against, such Contributor by reason
+   of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+   To apply the Apache License to your work, attach the following
+   boilerplate notice, with the fields enclosed by brackets "[]"
+   replaced with your own identifying information. (Don't include
+   the brackets!)  The text should be enclosed in the appropriate
+   comment syntax for the file format. We also recommend that a
+   file or class name and description of purpose be included on the
+   same "printed page" as the copyright notice for easier
+   identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+	http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff -pruN 43.0.0-1/rust-vendor/pkg-config/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/pkg-config/LICENSE-MIT
--- 43.0.0-1/rust-vendor/pkg-config/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pkg-config/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,25 @@
+Copyright (c) 2014 Alex Crichton
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/pkg-config/README.md 43.0.0-1ubuntu1/rust-vendor/pkg-config/README.md
--- 43.0.0-1/rust-vendor/pkg-config/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pkg-config/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,79 @@
+# pkg-config-rs
+
+[![Build Status](https://github.com/rust-lang/pkg-config-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/rust-lang/pkg-config-rs/actions)
+[![Rust](https://img.shields.io/badge/rust-1.30%2B-blue.svg?maxAge=3600)](https://github.com/rust-lang/pkg-config-rs/)
+
+[Documentation](https://docs.rs/pkg-config)
+
+A simple library meant to be used as a build dependency with Cargo packages in
+order to use the system `pkg-config` tool (if available) to determine where a
+library is located.
+
+You can use this crate directly to probe for specific libraries, or use
+[system-deps](https://github.com/gdesmott/system-deps) to declare all your
+`pkg-config` dependencies in `Cargo.toml`.
+
+This library requires Rust 1.30+.
+
+# Example
+
+Find the system library named `foo`, with minimum version 1.2.3:
+
+```rust
+extern crate pkg_config;
+
+fn main() {
+    pkg_config::Config::new().atleast_version("1.2.3").probe("foo").unwrap();
+}
+```
+
+Find the system library named `foo`, with no version requirement (not
+recommended):
+
+```rust
+extern crate pkg_config;
+
+fn main() {
+    pkg_config::probe_library("foo").unwrap();
+}
+```
+
+# External configuration via target-scoped environment variables
+
+In cross-compilation context, it is useful to manage separately `PKG_CONFIG_PATH`
+and a few other variables for the `host` and the `target` platform.
+
+The supported variables are: `PKG_CONFIG_PATH`, `PKG_CONFIG_LIBDIR`, and
+`PKG_CONFIG_SYSROOT_DIR`.
+
+Each of these variables can also be supplied with certain prefixes and suffixes, in the following prioritized order:
+
+1. `<var>_<target>` - for example, `PKG_CONFIG_PATH_x86_64-unknown-linux-gnu`
+2. `<var>_<target_with_underscores>` - for example, `PKG_CONFIG_PATH_x86_64_unknown_linux_gnu`
+3. `<build-kind>_<var>` - for example, `HOST_PKG_CONFIG_PATH` or `TARGET_PKG_CONFIG_PATH`
+4. `<var>` - a plain `PKG_CONFIG_PATH`
+
+This crate will allow `pkg-config` to be used in cross-compilation
+if `PKG_CONFIG_SYSROOT_DIR` or `PKG_CONFIG` is set. You can set `PKG_CONFIG_ALLOW_CROSS=1`
+to bypass the compatibility check, but please note that enabling use of `pkg-config` in
+cross-compilation without appropriate sysroot and search paths set is likely to break builds.
+
+Some Rust sys crates support building vendored libraries from source, which may be a work
+around for lack of cross-compilation support in `pkg-config`.
+
+# License
+
+This project is licensed under either of
+
+ * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
+   https://www.apache.org/licenses/LICENSE-2.0)
+ * MIT license ([LICENSE-MIT](LICENSE-MIT) or
+   https://opensource.org/licenses/MIT)
+
+at your option.
+
+### Contribution
+
+Unless you explicitly state otherwise, any contribution intentionally submitted
+for inclusion in pkg-config-rs by you, as defined in the Apache-2.0 license, shall be
+dual licensed as above, without any additional terms or conditions.
diff -pruN 43.0.0-1/rust-vendor/pkg-config/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/pkg-config/src/lib.rs
--- 43.0.0-1/rust-vendor/pkg-config/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pkg-config/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1190 @@
+//! A build dependency for Cargo libraries to find system artifacts through the
+//! `pkg-config` utility.
+//!
+//! This library will shell out to `pkg-config` as part of build scripts and
+//! probe the system to determine how to link to a specified library. The
+//! `Config` structure serves as a method of configuring how `pkg-config` is
+//! invoked in a builder style.
+//!
+//! After running `pkg-config` all appropriate Cargo metadata will be printed on
+//! stdout if the search was successful.
+//!
+//! # Environment variables
+//!
+//! A number of environment variables are available to globally configure how
+//! this crate will invoke `pkg-config`:
+//!
+//! * `FOO_NO_PKG_CONFIG` - if set, this will disable running `pkg-config` when
+//!   probing for the library named `foo`.
+//!
+//! ### Linking
+//!
+//! There are also a number of environment variables which can configure how a
+//! library is linked to (dynamically vs statically). These variables control
+//! whether the `--static` flag is passed. Note that this behavior can be
+//! overridden by configuring explicitly on `Config`. The variables are checked
+//! in the following order:
+//!
+//! * `FOO_STATIC` - pass `--static` for the library `foo`
+//! * `FOO_DYNAMIC` - do not pass `--static` for the library `foo`
+//! * `PKG_CONFIG_ALL_STATIC` - pass `--static` for all libraries
+//! * `PKG_CONFIG_ALL_DYNAMIC` - do not pass `--static` for all libraries
+//!
+//! ### Cross-compilation
+//!
+//! In cross-compilation context, it is useful to manage separately
+//! `PKG_CONFIG_PATH` and a few other variables for the `host` and the `target`
+//! platform.
+//!
+//! The supported variables are: `PKG_CONFIG_PATH`, `PKG_CONFIG_LIBDIR`, and
+//! `PKG_CONFIG_SYSROOT_DIR`.
+//!
+//! Each of these variables can also be supplied with certain prefixes and
+//! suffixes, in the following prioritized order:
+//!
+//! 1. `<var>_<target>` - for example, `PKG_CONFIG_PATH_x86_64-unknown-linux-gnu`
+//! 2. `<var>_<target_with_underscores>` - for example,
+//!    `PKG_CONFIG_PATH_x86_64_unknown_linux_gnu`
+//! 3. `<build-kind>_<var>` - for example, `HOST_PKG_CONFIG_PATH` or
+//!    `TARGET_PKG_CONFIG_PATH`
+//! 4. `<var>` - a plain `PKG_CONFIG_PATH`
+//!
+//! This crate will allow `pkg-config` to be used in cross-compilation
+//! if `PKG_CONFIG_SYSROOT_DIR` or `PKG_CONFIG` is set. You can set
+//! `PKG_CONFIG_ALLOW_CROSS=1` to bypass the compatibility check, but please
+//! note that enabling use of `pkg-config` in cross-compilation without
+//! appropriate sysroot and search paths set is likely to break builds.
+//!
+//! # Example
+//!
+//! Find the system library named `foo`, with minimum version 1.2.3:
+//!
+//! ```no_run
+//! fn main() {
+//!     pkg_config::Config::new().atleast_version("1.2.3").probe("foo").unwrap();
+//! }
+//! ```
+//!
+//! Find the system library named `foo`, with no version requirement (not
+//! recommended):
+//!
+//! ```no_run
+//! fn main() {
+//!     pkg_config::probe_library("foo").unwrap();
+//! }
+//! ```
+//!
+//! Configure how library `foo` is linked to.
+//!
+//! ```no_run
+//! fn main() {
+//!     pkg_config::Config::new().atleast_version("1.2.3").statik(true).probe("foo").unwrap();
+//! }
+//! ```
+
+#![doc(html_root_url = "https://docs.rs/pkg-config/0.3")]
+
+use std::collections::HashMap;
+use std::env;
+use std::error;
+use std::ffi::{OsStr, OsString};
+use std::fmt;
+use std::fmt::Display;
+use std::io;
+use std::ops::{Bound, RangeBounds};
+use std::path::PathBuf;
+use std::process::{Command, Output};
+use std::str;
+
+/// Wrapper struct to polyfill methods introduced in 1.57 (`get_envs`, `get_args` etc).
+/// This is needed to reconstruct the pkg-config command for output in a copy-
+/// paste friendly format via `Display`.
+struct WrappedCommand {
+    inner: Command,
+    program: OsString,
+    env_vars: Vec<(OsString, OsString)>,
+    args: Vec<OsString>,
+}
+
+#[derive(Clone, Debug)]
+pub struct Config {
+    statik: Option<bool>,
+    min_version: Bound<String>,
+    max_version: Bound<String>,
+    extra_args: Vec<OsString>,
+    cargo_metadata: bool,
+    env_metadata: bool,
+    print_system_libs: bool,
+    print_system_cflags: bool,
+}
+
+#[derive(Clone, Debug)]
+pub struct Library {
+    /// Libraries specified by -l
+    pub libs: Vec<String>,
+    /// Library search paths specified by -L
+    pub link_paths: Vec<PathBuf>,
+    /// Library file paths specified without -l
+    pub link_files: Vec<PathBuf>,
+    /// Darwin frameworks specified by -framework
+    pub frameworks: Vec<String>,
+    /// Darwin framework search paths specified by -F
+    pub framework_paths: Vec<PathBuf>,
+    /// C/C++ header include paths specified by -I
+    pub include_paths: Vec<PathBuf>,
+    /// Linker options specified by -Wl
+    pub ld_args: Vec<Vec<String>>,
+    /// C/C++ definitions specified by -D
+    pub defines: HashMap<String, Option<String>>,
+    /// Version specified by .pc file's Version field
+    pub version: String,
+    /// Ensure that this struct can only be created via its private `[Library::new]` constructor.
+    /// Users of this crate can only access the struct via `[Config::probe]`.
+    _priv: (),
+}
+
+/// Represents all reasons `pkg-config` might not succeed or be run at all.
+pub enum Error {
+    /// Aborted because of `*_NO_PKG_CONFIG` environment variable.
+    ///
+    /// Contains the name of the responsible environment variable.
+    EnvNoPkgConfig(String),
+
+    /// Detected cross compilation without a custom sysroot.
+    ///
+    /// Ignore the error with `PKG_CONFIG_ALLOW_CROSS=1`,
+    /// which may let `pkg-config` select libraries
+    /// for the host's architecture instead of the target's.
+    CrossCompilation,
+
+    /// Failed to run `pkg-config`.
+    ///
+    /// Contains the command and the cause.
+    Command { command: String, cause: io::Error },
+
+    /// `pkg-config` did not exit successfully after probing a library.
+    ///
+    /// Contains the command and output.
+    Failure { command: String, output: Output },
+
+    /// `pkg-config` did not exit successfully on the first attempt to probe a library.
+    ///
+    /// Contains the command and output.
+    ProbeFailure {
+        name: String,
+        command: String,
+        output: Output,
+    },
+
+    #[doc(hidden)]
+    // please don't match on this, we're likely to add more variants over time
+    __Nonexhaustive,
+}
+
+impl WrappedCommand {
+    fn new<S: AsRef<OsStr>>(program: S) -> Self {
+        Self {
+            inner: Command::new(program.as_ref()),
+            program: program.as_ref().to_os_string(),
+            env_vars: Vec::new(),
+            args: Vec::new(),
+        }
+    }
+
+    fn args<I, S>(&mut self, args: I) -> &mut Self
+    where
+        I: IntoIterator<Item = S> + Clone,
+        S: AsRef<OsStr>,
+    {
+        self.inner.args(args.clone());
+        self.args
+            .extend(args.into_iter().map(|arg| arg.as_ref().to_os_string()));
+
+        self
+    }
+
+    fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self {
+        self.inner.arg(arg.as_ref());
+        self.args.push(arg.as_ref().to_os_string());
+
+        self
+    }
+
+    fn env<K, V>(&mut self, key: K, value: V) -> &mut Self
+    where
+        K: AsRef<OsStr>,
+        V: AsRef<OsStr>,
+    {
+        self.inner.env(key.as_ref(), value.as_ref());
+        self.env_vars
+            .push((key.as_ref().to_os_string(), value.as_ref().to_os_string()));
+
+        self
+    }
+
+    fn output(&mut self) -> io::Result<Output> {
+        self.inner.output()
+    }
+}
+
+/// Output a command invocation that can be copy-pasted into the terminal.
+/// `Command`'s existing debug implementation is not used for that reason,
+/// as it can sometimes lead to output such as:
+/// `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" PKG_CONFIG_ALLOW_SYSTEM_LIBS="1" "pkg-config" "--libs" "--cflags" "mylibrary"`
+/// Which cannot be copy-pasted into terminals such as nushell, and is a bit noisy.
+/// This will look something like:
+/// `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 pkg-config --libs --cflags mylibrary`
+impl Display for WrappedCommand {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        // Format all explicitly defined environment variables
+        let envs = self
+            .env_vars
+            .iter()
+            .map(|(env, arg)| format!("{}={}", env.to_string_lossy(), arg.to_string_lossy()))
+            .collect::<Vec<String>>()
+            .join(" ");
+
+        // Format all pkg-config arguments
+        let args = self
+            .args
+            .iter()
+            .map(|arg| arg.to_string_lossy().to_string())
+            .collect::<Vec<String>>()
+            .join(" ");
+
+        write!(f, "{} {} {}", envs, self.program.to_string_lossy(), args)
+    }
+}
+
+impl error::Error for Error {}
+
+impl fmt::Debug for Error {
+    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+        // Failed `unwrap()` prints Debug representation, but the default debug format lacks helpful instructions for the end users
+        <Error as fmt::Display>::fmt(self, f)
+    }
+}
+
+impl fmt::Display for Error {
+    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+        match *self {
+            Error::EnvNoPkgConfig(ref name) => write!(f, "Aborted because {} is set", name),
+            Error::CrossCompilation => f.write_str(
+                "pkg-config has not been configured to support cross-compilation.\n\
+                \n\
+                Install a sysroot for the target platform and configure it via\n\
+                PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH, or install a\n\
+                cross-compiling wrapper for pkg-config and set it via\n\
+                PKG_CONFIG environment variable.",
+            ),
+            Error::Command {
+                ref command,
+                ref cause,
+            } => {
+                match cause.kind() {
+                    io::ErrorKind::NotFound => {
+                        let crate_name =
+                            std::env::var("CARGO_PKG_NAME").unwrap_or_else(|_| "sys".to_owned());
+                        let instructions = if cfg!(target_os = "macos") || cfg!(target_os = "ios") {
+                            "Try `brew install pkg-config` if you have Homebrew.\n"
+                        } else if cfg!(unix) {
+                            "Try `apt install pkg-config`, or `yum install pkg-config`,\n\
+                            or `pkg install pkg-config`, or `apk add pkgconfig` \
+                            depending on your distribution.\n"
+                        } else {
+                            "" // There's no easy fix for Windows users
+                        };
+                        write!(f, "Could not run `{command}`\n\
+                        The pkg-config command could not be found.\n\
+                        \n\
+                        Most likely, you need to install a pkg-config package for your OS.\n\
+                        {instructions}\
+                        \n\
+                        If you've already installed it, ensure the pkg-config command is one of the\n\
+                        directories in the PATH environment variable.\n\
+                        \n\
+                        If you did not expect this build to link to a pre-installed system library,\n\
+                        then check documentation of the {crate_name} crate for an option to\n\
+                        build the library from source, or disable features or dependencies\n\
+                        that require pkg-config.", command = command, instructions = instructions, crate_name = crate_name)
+                    }
+                    _ => write!(f, "Failed to run command `{}`, because: {}", command, cause),
+                }
+            }
+            Error::ProbeFailure {
+                ref name,
+                ref command,
+                ref output,
+            } => {
+                let crate_name =
+                    env::var("CARGO_PKG_NAME").unwrap_or(String::from("<NO CRATE NAME>"));
+
+                writeln!(f, "")?;
+
+                // Give a short explanation of what the error is
+                writeln!(
+                    f,
+                    "pkg-config {}",
+                    match output.status.code() {
+                        Some(code) => format!("exited with status code {}", code),
+                        None => "was terminated by signal".to_string(),
+                    }
+                )?;
+
+                // Give the command run so users can reproduce the error
+                writeln!(f, "> {}\n", command)?;
+
+                // Explain how it was caused
+                writeln!(
+                    f,
+                    "The system library `{}` required by crate `{}` was not found.",
+                    name, crate_name
+                )?;
+                writeln!(
+                    f,
+                    "The file `{}.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.",
+                    name
+                )?;
+
+                // There will be no status code if terminated by signal
+                if let Some(_code) = output.status.code() {
+                    // Nix uses a wrapper script for pkg-config that sets the custom
+                    // environment variable PKG_CONFIG_PATH_FOR_TARGET
+                    let search_locations = ["PKG_CONFIG_PATH_FOR_TARGET", "PKG_CONFIG_PATH"];
+
+                    // Find a search path to use
+                    let mut search_data = None;
+                    for location in search_locations.iter() {
+                        if let Ok(search_path) = env::var(location) {
+                            search_data = Some((location, search_path));
+                            break;
+                        }
+                    }
+
+                    // Guess the most reasonable course of action
+                    let hint = if let Some((search_location, search_path)) = search_data {
+                        writeln!(
+                            f,
+                            "{} contains the following:\n{}",
+                            search_location,
+                            search_path
+                                .split(':')
+                                .map(|path| format!("    - {}", path))
+                                .collect::<Vec<String>>()
+                                .join("\n"),
+                        )?;
+
+                        format!("you may need to install a package such as {name}, {name}-dev or {name}-devel.", name=name)
+                    } else {
+                        // Even on Nix, setting PKG_CONFIG_PATH seems to be a viable option
+                        writeln!(f, "The PKG_CONFIG_PATH environment variable is not set.")?;
+
+                        format!(
+                            "if you have installed the library, try setting PKG_CONFIG_PATH to the directory containing `{}.pc`.",
+                            name
+                        )
+                    };
+
+                    // Try and nudge the user in the right direction so they don't get stuck
+                    writeln!(f, "\nHINT: {}", hint)?;
+                }
+
+                Ok(())
+            }
+            Error::Failure {
+                ref command,
+                ref output,
+            } => {
+                write!(
+                    f,
+                    "`{}` did not exit successfully: {}",
+                    command, output.status
+                )?;
+                format_output(output, f)
+            }
+            Error::__Nonexhaustive => panic!(),
+        }
+    }
+}
+
+fn format_output(output: &Output, f: &mut fmt::Formatter) -> fmt::Result {
+    let stdout = String::from_utf8_lossy(&output.stdout);
+    if !stdout.is_empty() {
+        write!(f, "\n--- stdout\n{}", stdout)?;
+    }
+    let stderr = String::from_utf8_lossy(&output.stderr);
+    if !stderr.is_empty() {
+        write!(f, "\n--- stderr\n{}", stderr)?;
+    }
+    Ok(())
+}
+
+/// Deprecated in favor of the probe_library function
+#[doc(hidden)]
+pub fn find_library(name: &str) -> Result<Library, String> {
+    probe_library(name).map_err(|e| e.to_string())
+}
+
+/// Simple shortcut for using all default options for finding a library.
+pub fn probe_library(name: &str) -> Result<Library, Error> {
+    Config::new().probe(name)
+}
+
+#[doc(hidden)]
+#[deprecated(note = "use config.target_supported() instance method instead")]
+pub fn target_supported() -> bool {
+    Config::new().target_supported()
+}
+
+/// Run `pkg-config` to get the value of a variable from a package using
+/// `--variable`.
+///
+/// The content of `PKG_CONFIG_SYSROOT_DIR` is not injected in paths that are
+/// returned by `pkg-config --variable`, which makes them unsuitable to use
+/// during cross-compilation unless specifically designed to be used
+/// at that time.
+pub fn get_variable(package: &str, variable: &str) -> Result<String, Error> {
+    let arg = format!("--variable={}", variable);
+    let cfg = Config::new();
+    let out = cfg.run(package, &[&arg])?;
+    Ok(str::from_utf8(&out).unwrap().trim_end().to_owned())
+}
+
+impl Config {
+    /// Creates a new set of configuration options which are all initially set
+    /// to "blank".
+    pub fn new() -> Config {
+        Config {
+            statik: None,
+            min_version: Bound::Unbounded,
+            max_version: Bound::Unbounded,
+            extra_args: vec![],
+            print_system_cflags: true,
+            print_system_libs: true,
+            cargo_metadata: true,
+            env_metadata: true,
+        }
+    }
+
+    /// Indicate whether the `--static` flag should be passed.
+    ///
+    /// This will override the inference from environment variables described in
+    /// the crate documentation.
+    pub fn statik(&mut self, statik: bool) -> &mut Config {
+        self.statik = Some(statik);
+        self
+    }
+
+    /// Indicate that the library must be at least version `vers`.
+    pub fn atleast_version(&mut self, vers: &str) -> &mut Config {
+        self.min_version = Bound::Included(vers.to_string());
+        self.max_version = Bound::Unbounded;
+        self
+    }
+
+    /// Indicate that the library must be equal to version `vers`.
+    pub fn exactly_version(&mut self, vers: &str) -> &mut Config {
+        self.min_version = Bound::Included(vers.to_string());
+        self.max_version = Bound::Included(vers.to_string());
+        self
+    }
+
+    /// Indicate that the library's version must be in `range`.
+    pub fn range_version<'a, R>(&mut self, range: R) -> &mut Config
+    where
+        R: RangeBounds<&'a str>,
+    {
+        self.min_version = match range.start_bound() {
+            Bound::Included(vers) => Bound::Included(vers.to_string()),
+            Bound::Excluded(vers) => Bound::Excluded(vers.to_string()),
+            Bound::Unbounded => Bound::Unbounded,
+        };
+        self.max_version = match range.end_bound() {
+            Bound::Included(vers) => Bound::Included(vers.to_string()),
+            Bound::Excluded(vers) => Bound::Excluded(vers.to_string()),
+            Bound::Unbounded => Bound::Unbounded,
+        };
+        self
+    }
+
+    /// Add an argument to pass to pkg-config.
+    ///
+    /// It's placed after all of the arguments generated by this library.
+    pub fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Config {
+        self.extra_args.push(arg.as_ref().to_os_string());
+        self
+    }
+
+    /// Define whether metadata should be emitted for cargo allowing it to
+    /// automatically link the binary. Defaults to `true`.
+    pub fn cargo_metadata(&mut self, cargo_metadata: bool) -> &mut Config {
+        self.cargo_metadata = cargo_metadata;
+        self
+    }
+
+    /// Define whether metadata should be emitted for cargo allowing to
+    /// automatically rebuild when environment variables change. Defaults to
+    /// `true`.
+    pub fn env_metadata(&mut self, env_metadata: bool) -> &mut Config {
+        self.env_metadata = env_metadata;
+        self
+    }
+
+    /// Enable or disable the `PKG_CONFIG_ALLOW_SYSTEM_LIBS` environment
+    /// variable.
+    ///
+    /// This env var is enabled by default.
+    pub fn print_system_libs(&mut self, print: bool) -> &mut Config {
+        self.print_system_libs = print;
+        self
+    }
+
+    /// Enable or disable the `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS` environment
+    /// variable.
+    ///
+    /// This env var is enabled by default.
+    pub fn print_system_cflags(&mut self, print: bool) -> &mut Config {
+        self.print_system_cflags = print;
+        self
+    }
+
+    /// Deprecated in favor fo the `probe` function
+    #[doc(hidden)]
+    pub fn find(&self, name: &str) -> Result<Library, String> {
+        self.probe(name).map_err(|e| e.to_string())
+    }
+
+    /// Run `pkg-config` to find the library `name`.
+    ///
+    /// This will use all configuration previously set to specify how
+    /// `pkg-config` is run.
+    pub fn probe(&self, name: &str) -> Result<Library, Error> {
+        let abort_var_name = format!("{}_NO_PKG_CONFIG", envify(name));
+        if self.env_var_os(&abort_var_name).is_some() {
+            return Err(Error::EnvNoPkgConfig(abort_var_name));
+        } else if !self.target_supported() {
+            return Err(Error::CrossCompilation);
+        }
+
+        let mut library = Library::new();
+
+        let output = self
+            .run(name, &["--libs", "--cflags"])
+            .map_err(|e| match e {
+                Error::Failure { command, output } => Error::ProbeFailure {
+                    name: name.to_owned(),
+                    command,
+                    output,
+                },
+                other => other,
+            })?;
+        library.parse_libs_cflags(name, &output, self);
+
+        let output = self.run(name, &["--modversion"])?;
+        library.parse_modversion(str::from_utf8(&output).unwrap());
+
+        Ok(library)
+    }
+
+    /// True if pkg-config is used for the host system, or configured for cross-compilation
+    pub fn target_supported(&self) -> bool {
+        let target = env::var_os("TARGET").unwrap_or_default();
+        let host = env::var_os("HOST").unwrap_or_default();
+
+        // Only use pkg-config in host == target situations by default (allowing an
+        // override).
+        if host == target {
+            return true;
+        }
+
+        // pkg-config may not be aware of cross-compilation, and require
+        // a wrapper script that sets up platform-specific prefixes.
+        match self.targeted_env_var("PKG_CONFIG_ALLOW_CROSS") {
+            // don't use pkg-config if explicitly disabled
+            Some(ref val) if val == "0" => false,
+            Some(_) => true,
+            None => {
+                // if not disabled, and pkg-config is customized,
+                // then assume it's prepared for cross-compilation
+                self.targeted_env_var("PKG_CONFIG").is_some()
+                    || self.targeted_env_var("PKG_CONFIG_SYSROOT_DIR").is_some()
+            }
+        }
+    }
+
+    /// Deprecated in favor of the top level `get_variable` function
+    #[doc(hidden)]
+    pub fn get_variable(package: &str, variable: &str) -> Result<String, String> {
+        get_variable(package, variable).map_err(|e| e.to_string())
+    }
+
+    fn targeted_env_var(&self, var_base: &str) -> Option<OsString> {
+        match (env::var("TARGET"), env::var("HOST")) {
+            (Ok(target), Ok(host)) => {
+                let kind = if host == target { "HOST" } else { "TARGET" };
+                let target_u = target.replace('-', "_");
+
+                self.env_var_os(&format!("{}_{}", var_base, target))
+                    .or_else(|| self.env_var_os(&format!("{}_{}", var_base, target_u)))
+                    .or_else(|| self.env_var_os(&format!("{}_{}", kind, var_base)))
+                    .or_else(|| self.env_var_os(var_base))
+            }
+            (Err(env::VarError::NotPresent), _) | (_, Err(env::VarError::NotPresent)) => {
+                self.env_var_os(var_base)
+            }
+            (Err(env::VarError::NotUnicode(s)), _) | (_, Err(env::VarError::NotUnicode(s))) => {
+                panic!(
+                    "HOST or TARGET environment variable is not valid unicode: {:?}",
+                    s
+                )
+            }
+        }
+    }
+
+    fn env_var_os(&self, name: &str) -> Option<OsString> {
+        if self.env_metadata {
+            println!("cargo:rerun-if-env-changed={}", name);
+        }
+        env::var_os(name)
+    }
+
+    fn is_static(&self, name: &str) -> bool {
+        self.statik.unwrap_or_else(|| self.infer_static(name))
+    }
+
+    fn run(&self, name: &str, args: &[&str]) -> Result<Vec<u8>, Error> {
+        let pkg_config_exe = self.targeted_env_var("PKG_CONFIG");
+        let fallback_exe = if pkg_config_exe.is_none() {
+            Some(OsString::from("pkgconf"))
+        } else {
+            None
+        };
+        let exe = pkg_config_exe.unwrap_or_else(|| OsString::from("pkg-config"));
+
+        let mut cmd = self.command(exe, name, args);
+
+        match cmd.output().or_else(|e| {
+            if let Some(exe) = fallback_exe {
+                self.command(exe, name, args).output()
+            } else {
+                Err(e)
+            }
+        }) {
+            Ok(output) => {
+                if output.status.success() {
+                    Ok(output.stdout)
+                } else {
+                    Err(Error::Failure {
+                        command: format!("{}", cmd),
+                        output,
+                    })
+                }
+            }
+            Err(cause) => Err(Error::Command {
+                command: format!("{}", cmd),
+                cause,
+            }),
+        }
+    }
+
+    fn command(&self, exe: OsString, name: &str, args: &[&str]) -> WrappedCommand {
+        let mut cmd = WrappedCommand::new(exe);
+        if self.is_static(name) {
+            cmd.arg("--static");
+        }
+        cmd.args(args).args(&self.extra_args);
+
+        if let Some(value) = self.targeted_env_var("PKG_CONFIG_PATH") {
+            cmd.env("PKG_CONFIG_PATH", value);
+        }
+        if let Some(value) = self.targeted_env_var("PKG_CONFIG_LIBDIR") {
+            cmd.env("PKG_CONFIG_LIBDIR", value);
+        }
+        if let Some(value) = self.targeted_env_var("PKG_CONFIG_SYSROOT_DIR") {
+            cmd.env("PKG_CONFIG_SYSROOT_DIR", value);
+        }
+        if self.print_system_libs {
+            cmd.env("PKG_CONFIG_ALLOW_SYSTEM_LIBS", "1");
+        }
+        if self.print_system_cflags {
+            cmd.env("PKG_CONFIG_ALLOW_SYSTEM_CFLAGS", "1");
+        }
+        cmd.arg(name);
+        match self.min_version {
+            Bound::Included(ref version) => {
+                cmd.arg(&format!("{} >= {}", name, version));
+            }
+            Bound::Excluded(ref version) => {
+                cmd.arg(&format!("{} > {}", name, version));
+            }
+            _ => (),
+        }
+        match self.max_version {
+            Bound::Included(ref version) => {
+                cmd.arg(&format!("{} <= {}", name, version));
+            }
+            Bound::Excluded(ref version) => {
+                cmd.arg(&format!("{} < {}", name, version));
+            }
+            _ => (),
+        }
+        cmd
+    }
+
+    fn print_metadata(&self, s: &str) {
+        if self.cargo_metadata {
+            println!("cargo:{}", s);
+        }
+    }
+
+    fn infer_static(&self, name: &str) -> bool {
+        let name = envify(name);
+        if self.env_var_os(&format!("{}_STATIC", name)).is_some() {
+            true
+        } else if self.env_var_os(&format!("{}_DYNAMIC", name)).is_some() {
+            false
+        } else if self.env_var_os("PKG_CONFIG_ALL_STATIC").is_some() {
+            true
+        } else if self.env_var_os("PKG_CONFIG_ALL_DYNAMIC").is_some() {
+            false
+        } else {
+            false
+        }
+    }
+}
+
+// Implement Default manually since Bound does not implement Default.
+impl Default for Config {
+    fn default() -> Config {
+        Config {
+            statik: None,
+            min_version: Bound::Unbounded,
+            max_version: Bound::Unbounded,
+            extra_args: vec![],
+            print_system_cflags: false,
+            print_system_libs: false,
+            cargo_metadata: false,
+            env_metadata: false,
+        }
+    }
+}
+
+impl Library {
+    fn new() -> Library {
+        Library {
+            libs: Vec::new(),
+            link_paths: Vec::new(),
+            link_files: Vec::new(),
+            include_paths: Vec::new(),
+            ld_args: Vec::new(),
+            frameworks: Vec::new(),
+            framework_paths: Vec::new(),
+            defines: HashMap::new(),
+            version: String::new(),
+            _priv: (),
+        }
+    }
+
+    /// Extract the &str to pass to cargo:rustc-link-lib from a filename (just the file name, not including directories)
+    /// using target-specific logic.
+    fn extract_lib_from_filename<'a>(target: &str, filename: &'a str) -> Option<&'a str> {
+        fn test_suffixes<'b>(filename: &'b str, suffixes: &[&str]) -> Option<&'b str> {
+            for suffix in suffixes {
+                if filename.ends_with(suffix) {
+                    return Some(&filename[..filename.len() - suffix.len()]);
+                }
+            }
+            None
+        }
+
+        let prefix = "lib";
+        if target.contains("windows") {
+            if target.contains("gnu") && filename.starts_with(prefix) {
+                // GNU targets for Windows, including gnullvm, use `LinkerFlavor::Gcc` internally in rustc,
+                // which tells rustc to use the GNU linker. rustc does not prepend/append to the string it
+                // receives via the -l command line argument before passing it to the linker:
+                // https://github.com/rust-lang/rust/blob/657f246812ab2684e3c3954b1c77f98fd59e0b21/compiler/rustc_codegen_ssa/src/back/linker.rs#L446
+                // https://github.com/rust-lang/rust/blob/657f246812ab2684e3c3954b1c77f98fd59e0b21/compiler/rustc_codegen_ssa/src/back/linker.rs#L457
+                // GNU ld can work with more types of files than just the .lib files that MSVC's link.exe needs.
+                // GNU ld will prepend the `lib` prefix to the filename if necessary, so it is okay to remove
+                // the `lib` prefix from the filename. The `.a` suffix *requires* the `lib` prefix.
+                // https://sourceware.org/binutils/docs-2.39/ld.html#index-direct-linking-to-a-dll
+                let filename = &filename[prefix.len()..];
+                return test_suffixes(filename, &[".dll.a", ".dll", ".lib", ".a"]);
+            } else {
+                // According to link.exe documentation:
+                // https://learn.microsoft.com/en-us/cpp/build/reference/link-input-files?view=msvc-170
+                //
+                //   LINK doesn't use file extensions to make assumptions about the contents of a file.
+                //   Instead, LINK examines each input file to determine what kind of file it is.
+                //
+                // However, rustc appends `.lib` to the string it receives from the -l command line argument,
+                // which it receives from Cargo via cargo:rustc-link-lib:
+                // https://github.com/rust-lang/rust/blob/657f246812ab2684e3c3954b1c77f98fd59e0b21/compiler/rustc_codegen_ssa/src/back/linker.rs#L828
+                // https://github.com/rust-lang/rust/blob/657f246812ab2684e3c3954b1c77f98fd59e0b21/compiler/rustc_codegen_ssa/src/back/linker.rs#L843
+                // So the only file extension that works for MSVC targets is `.lib`
+                // However, for externally created libraries, there's no
+                // guarantee that the extension is ".lib" so we need to
+                // consider all options.
+                // See:
+                // https://github.com/mesonbuild/meson/issues/8153
+                // https://github.com/rust-lang/rust/issues/114013
+                return test_suffixes(filename, &[".dll.a", ".dll", ".lib", ".a"]);
+            }
+        } else if target.contains("apple") {
+            if filename.starts_with(prefix) {
+                let filename = &filename[prefix.len()..];
+                return test_suffixes(filename, &[".a", ".so", ".dylib"]);
+            }
+            return None;
+        } else {
+            if filename.starts_with(prefix) {
+                let filename = &filename[prefix.len()..];
+                return test_suffixes(filename, &[".a", ".so"]);
+            }
+            return None;
+        }
+    }
+
+    fn parse_libs_cflags(&mut self, name: &str, output: &[u8], config: &Config) {
+        let mut is_msvc = false;
+        let target = env::var("TARGET");
+        if let Ok(target) = &target {
+            if target.contains("msvc") {
+                is_msvc = true;
+            }
+        }
+
+        let system_roots = if cfg!(target_os = "macos") {
+            vec![PathBuf::from("/Library"), PathBuf::from("/System")]
+        } else {
+            let sysroot = config
+                .env_var_os("PKG_CONFIG_SYSROOT_DIR")
+                .or_else(|| config.env_var_os("SYSROOT"))
+                .map(PathBuf::from);
+
+            if cfg!(target_os = "windows") {
+                if let Some(sysroot) = sysroot {
+                    vec![sysroot]
+                } else {
+                    vec![]
+                }
+            } else {
+                vec![sysroot.unwrap_or_else(|| PathBuf::from("/usr"))]
+            }
+        };
+
+        let mut dirs = Vec::new();
+        let statik = config.is_static(name);
+
+        let words = split_flags(output);
+
+        // Handle single-character arguments like `-I/usr/include`
+        let parts = words
+            .iter()
+            .filter(|l| l.len() > 2)
+            .map(|arg| (&arg[0..2], &arg[2..]));
+        for (flag, val) in parts {
+            match flag {
+                "-L" => {
+                    let meta = format!("rustc-link-search=native={}", val);
+                    config.print_metadata(&meta);
+                    dirs.push(PathBuf::from(val));
+                    self.link_paths.push(PathBuf::from(val));
+                }
+                "-F" => {
+                    let meta = format!("rustc-link-search=framework={}", val);
+                    config.print_metadata(&meta);
+                    self.framework_paths.push(PathBuf::from(val));
+                }
+                "-I" => {
+                    self.include_paths.push(PathBuf::from(val));
+                }
+                "-l" => {
+                    // These are provided by the CRT with MSVC
+                    if is_msvc && ["m", "c", "pthread"].contains(&val) {
+                        continue;
+                    }
+
+                    if val.starts_with(':') {
+                        // Pass this flag to linker directly.
+                        let meta = format!("cargo:rustc-link-arg={}{}", flag, val);
+                        config.print_metadata(&meta);
+                    } else if statik && is_static_available(val, &system_roots, &dirs) {
+                        let meta = format!("rustc-link-lib=static={}", val);
+                        config.print_metadata(&meta);
+                    } else {
+                        let meta = format!("rustc-link-lib={}", val);
+                        config.print_metadata(&meta);
+                    }
+
+                    self.libs.push(val.to_string());
+                }
+                "-D" => {
+                    let mut iter = val.split('=');
+                    self.defines.insert(
+                        iter.next().unwrap().to_owned(),
+                        iter.next().map(|s| s.to_owned()),
+                    );
+                }
+                "-u" => {
+                    let meta = format!("rustc-link-arg=-Wl,-u,{}", val);
+                    config.print_metadata(&meta);
+                }
+                _ => {}
+            }
+        }
+
+        // Handle multi-character arguments with space-separated value like `-framework foo`
+        let mut iter = words.iter().flat_map(|arg| {
+            if arg.starts_with("-Wl,") {
+                arg[4..].split(',').collect()
+            } else {
+                vec![arg.as_ref()]
+            }
+        });
+        while let Some(part) = iter.next() {
+            match part {
+                "-framework" => {
+                    if let Some(lib) = iter.next() {
+                        let meta = format!("rustc-link-lib=framework={}", lib);
+                        config.print_metadata(&meta);
+                        self.frameworks.push(lib.to_string());
+                    }
+                }
+                "-isystem" | "-iquote" | "-idirafter" => {
+                    if let Some(inc) = iter.next() {
+                        self.include_paths.push(PathBuf::from(inc));
+                    }
+                }
+                "-undefined" | "--undefined" => {
+                    if let Some(symbol) = iter.next() {
+                        let meta = format!("rustc-link-arg=-Wl,{},{}", part, symbol);
+                        config.print_metadata(&meta);
+                    }
+                }
+                _ => {
+                    let path = std::path::Path::new(part);
+                    if path.is_file() {
+                        // Cargo doesn't have a means to directly specify a file path to link,
+                        // so split up the path into the parent directory and library name.
+                        // TODO: pass file path directly when link-arg library type is stabilized
+                        // https://github.com/rust-lang/rust/issues/99427
+                        if let (Some(dir), Some(file_name), Ok(target)) =
+                            (path.parent(), path.file_name(), &target)
+                        {
+                            match Self::extract_lib_from_filename(
+                                target,
+                                &file_name.to_string_lossy(),
+                            ) {
+                                Some(lib_basename) => {
+                                    let link_search =
+                                        format!("rustc-link-search={}", dir.display());
+                                    config.print_metadata(&link_search);
+
+                                    let link_lib = format!("rustc-link-lib={}", lib_basename);
+                                    config.print_metadata(&link_lib);
+                                    self.link_files.push(PathBuf::from(path));
+                                }
+                                None => {
+                                    println!("cargo:warning=File path {} found in pkg-config file for {}, but could not extract library base name to pass to linker command line", path.display(), name);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        let linker_options = words.iter().filter(|arg| arg.starts_with("-Wl,"));
+        for option in linker_options {
+            let mut pop = false;
+            let mut ld_option = vec![];
+            for subopt in option[4..].split(',') {
+                if pop {
+                    pop = false;
+                    continue;
+                }
+
+                if subopt == "-framework" {
+                    pop = true;
+                    continue;
+                }
+
+                ld_option.push(subopt);
+            }
+
+            let meta = format!("rustc-link-arg=-Wl,{}", ld_option.join(","));
+            config.print_metadata(&meta);
+
+            self.ld_args
+                .push(ld_option.into_iter().map(String::from).collect());
+        }
+    }
+
+    fn parse_modversion(&mut self, output: &str) {
+        self.version.push_str(output.lines().next().unwrap().trim());
+    }
+}
+
+fn envify(name: &str) -> String {
+    name.chars()
+        .map(|c| c.to_ascii_uppercase())
+        .map(|c| if c == '-' { '_' } else { c })
+        .collect()
+}
+
+/// System libraries should only be linked dynamically
+fn is_static_available(name: &str, system_roots: &[PathBuf], dirs: &[PathBuf]) -> bool {
+    let libnames = {
+        let mut names = vec![format!("lib{}.a", name)];
+
+        if cfg!(target_os = "windows") {
+            names.push(format!("{}.lib", name));
+        }
+
+        names
+    };
+
+    dirs.iter().any(|dir| {
+        let library_exists = libnames.iter().any(|libname| dir.join(&libname).exists());
+        library_exists && !system_roots.iter().any(|sys| dir.starts_with(sys))
+    })
+}
+
+/// Split output produced by pkg-config --cflags and / or --libs into separate flags.
+///
+/// Backslash in output is used to preserve literal meaning of following byte.  Different words are
+/// separated by unescaped space. Other whitespace characters generally should not occur unescaped
+/// at all, apart from the newline at the end of output. For compatibility with what others
+/// consumers of pkg-config output would do in this scenario, they are used here for splitting as
+/// well.
+fn split_flags(output: &[u8]) -> Vec<String> {
+    let mut word = Vec::new();
+    let mut words = Vec::new();
+    let mut escaped = false;
+
+    for &b in output {
+        match b {
+            _ if escaped => {
+                escaped = false;
+                word.push(b);
+            }
+            b'\\' => escaped = true,
+            b'\t' | b'\n' | b'\r' | b' ' => {
+                if !word.is_empty() {
+                    words.push(String::from_utf8(word).unwrap());
+                    word = Vec::new();
+                }
+            }
+            _ => word.push(b),
+        }
+    }
+
+    if !word.is_empty() {
+        words.push(String::from_utf8(word).unwrap());
+    }
+
+    words
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    #[cfg(target_os = "macos")]
+    fn system_library_mac_test() {
+        use std::path::Path;
+
+        let system_roots = vec![PathBuf::from("/Library"), PathBuf::from("/System")];
+
+        assert!(!is_static_available(
+            "PluginManager",
+            &system_roots,
+            &[PathBuf::from("/Library/Frameworks")]
+        ));
+        assert!(!is_static_available(
+            "python2.7",
+            &system_roots,
+            &[PathBuf::from(
+                "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config"
+            )]
+        ));
+        assert!(!is_static_available(
+            "ffi_convenience",
+            &system_roots,
+            &[PathBuf::from(
+                "/Library/Ruby/Gems/2.0.0/gems/ffi-1.9.10/ext/ffi_c/libffi-x86_64/.libs"
+            )]
+        ));
+
+        // Homebrew is in /usr/local, and it's not a part of the OS
+        if Path::new("/usr/local/lib/libpng16.a").exists() {
+            assert!(is_static_available(
+                "png16",
+                &system_roots,
+                &[PathBuf::from("/usr/local/lib")]
+            ));
+
+            let libpng = Config::new()
+                .range_version("1".."99")
+                .probe("libpng16")
+                .unwrap();
+            assert!(libpng.version.find('\n').is_none());
+        }
+    }
+
+    #[test]
+    #[cfg(target_os = "linux")]
+    fn system_library_linux_test() {
+        assert!(!is_static_available(
+            "util",
+            &[PathBuf::from("/usr")],
+            &[PathBuf::from("/usr/lib/x86_64-linux-gnu")]
+        ));
+        assert!(!is_static_available(
+            "dialog",
+            &[PathBuf::from("/usr")],
+            &[PathBuf::from("/usr/lib")]
+        ));
+    }
+
+    fn test_library_filename(target: &str, filename: &str) {
+        assert_eq!(
+            Library::extract_lib_from_filename(target, filename),
+            Some("foo")
+        );
+    }
+
+    #[test]
+    fn link_filename_linux() {
+        let target = "x86_64-unknown-linux-gnu";
+        test_library_filename(target, "libfoo.a");
+        test_library_filename(target, "libfoo.so");
+    }
+
+    #[test]
+    fn link_filename_apple() {
+        let target = "x86_64-apple-darwin";
+        test_library_filename(target, "libfoo.a");
+        test_library_filename(target, "libfoo.so");
+        test_library_filename(target, "libfoo.dylib");
+    }
+
+    #[test]
+    fn link_filename_msvc() {
+        let target = "x86_64-pc-windows-msvc";
+        // static and dynamic libraries have the same .lib suffix
+        test_library_filename(target, "foo.lib");
+    }
+
+    #[test]
+    fn link_filename_mingw() {
+        let target = "x86_64-pc-windows-gnu";
+        test_library_filename(target, "foo.lib");
+        test_library_filename(target, "libfoo.a");
+        test_library_filename(target, "foo.dll");
+        test_library_filename(target, "foo.dll.a");
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pkg-config/tests/escape.pc 43.0.0-1ubuntu1/rust-vendor/pkg-config/tests/escape.pc
--- 43.0.0-1/rust-vendor/pkg-config/tests/escape.pc	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pkg-config/tests/escape.pc	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+Name: Escape
+Version: 4.2.0
+Description: Escape utility library
+Libs: -Llink\ path\ with\ spaces
+Cflags: -Iinclude\ path\ with\ spaces -DA=\"escaped\ string\'\ literal\" -DB=ESCAPED\ IDENTIFIER -DFOX=🦊
diff -pruN 43.0.0-1/rust-vendor/pkg-config/tests/foo.pc 43.0.0-1ubuntu1/rust-vendor/pkg-config/tests/foo.pc
--- 43.0.0-1/rust-vendor/pkg-config/tests/foo.pc	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pkg-config/tests/foo.pc	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,16 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include/valgrind
+arch=amd64
+os=linux
+platform=amd64-linux
+valt_load_address=0x38000000
+
+Name: Valgrind
+Description: A dynamic binary instrumentation framework
+Version: 3.10.0.SVN
+Requires:
+Libs: -L${libdir}/valgrind -lcoregrind-amd64-linux -lvex-amd64-linux -lgcc
+Cflags: -I${includedir} -isystem /usr/foo
+
diff -pruN 43.0.0-1/rust-vendor/pkg-config/tests/framework.pc 43.0.0-1ubuntu1/rust-vendor/pkg-config/tests/framework.pc
--- 43.0.0-1/rust-vendor/pkg-config/tests/framework.pc	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pkg-config/tests/framework.pc	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,16 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include/valgrind
+arch=amd64
+os=linux
+platform=amd64-linux
+valt_load_address=0x38000000
+
+Name: Valgrind
+Description: A dynamic binary instrumentation framework
+Version: 3.10.0.SVN
+Requires:
+Libs: -F${libdir} -framework foo -Wl,-framework,bar -Wl,-framework -Wl,baz -Wl,-framework,foobar,-framework,foobaz
+Cflags: -I${includedir}
+
diff -pruN 43.0.0-1/rust-vendor/pkg-config/tests/rpath.pc 43.0.0-1ubuntu1/rust-vendor/pkg-config/tests/rpath.pc
--- 43.0.0-1/rust-vendor/pkg-config/tests/rpath.pc	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pkg-config/tests/rpath.pc	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+prefix=/usr/local
+
+Name: rpath
+Version: 4.2.0
+Description: RPath example library
+Libs: -L${prefix}/lib -Wl,-rpath,${prefix}/lib -lrpath
+Cflags: -I${prefix}/include
diff -pruN 43.0.0-1/rust-vendor/pkg-config/tests/test.rs 43.0.0-1ubuntu1/rust-vendor/pkg-config/tests/test.rs
--- 43.0.0-1/rust-vendor/pkg-config/tests/test.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pkg-config/tests/test.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,320 @@
+extern crate pkg_config;
+#[macro_use]
+extern crate lazy_static;
+
+use pkg_config::Error;
+use std::env;
+use std::path::PathBuf;
+use std::sync::Mutex;
+
+lazy_static! {
+    static ref LOCK: Mutex<()> = Mutex::new(());
+}
+
+fn reset() {
+    for (k, _) in env::vars() {
+        if k.contains("DYNAMIC")
+            || k.contains("STATIC")
+            || k.contains("PKG_CONFIG_ALLOW_CROSS")
+            || k.contains("PKG_CONFIG_SYSROOT_DIR")
+            || k.contains("FOO_NO_PKG_CONFIG")
+        {
+            env::remove_var(&k);
+        }
+    }
+    env::remove_var("TARGET");
+    env::remove_var("HOST");
+    env::set_var("PKG_CONFIG_PATH", env::current_dir().unwrap().join("tests"));
+}
+
+fn find(name: &str) -> Result<pkg_config::Library, Error> {
+    pkg_config::probe_library(name)
+}
+
+#[test]
+fn cross_disabled() {
+    let _g = LOCK.lock();
+    reset();
+    env::set_var("TARGET", "foo");
+    env::set_var("HOST", "bar");
+    match find("foo") {
+        Err(Error::CrossCompilation) => {}
+        x => panic!("Error::CrossCompilation expected, found `{:?}`", x),
+    }
+}
+
+#[test]
+fn cross_enabled() {
+    let _g = LOCK.lock();
+    reset();
+    env::set_var("TARGET", "foo");
+    env::set_var("HOST", "bar");
+    env::set_var("PKG_CONFIG_ALLOW_CROSS", "1");
+    find("foo").unwrap();
+}
+
+#[test]
+fn cross_enabled_if_customized() {
+    let _g = LOCK.lock();
+    reset();
+    env::set_var("TARGET", "foo");
+    env::set_var("HOST", "bar");
+    env::set_var("PKG_CONFIG_SYSROOT_DIR", "/tmp/cross-test");
+    find("foo").unwrap();
+}
+
+#[test]
+fn cross_disabled_if_customized() {
+    let _g = LOCK.lock();
+    reset();
+    env::set_var("TARGET", "foo");
+    env::set_var("HOST", "bar");
+    env::set_var("PKG_CONFIG_ALLOW_CROSS", "0");
+    env::set_var("PKG_CONFIG_SYSROOT_DIR", "/tmp/cross-test");
+    match find("foo") {
+        Err(Error::CrossCompilation) => {}
+        _ => panic!("expected CrossCompilation failure"),
+    }
+}
+
+#[test]
+fn package_disabled() {
+    let _g = LOCK.lock();
+    reset();
+    env::set_var("FOO_NO_PKG_CONFIG", "1");
+    match find("foo") {
+        Err(Error::EnvNoPkgConfig(name)) => assert_eq!(name, "FOO_NO_PKG_CONFIG"),
+        x => panic!("Error::EnvNoPkgConfig expected, found `{:?}`", x),
+    }
+}
+
+#[test]
+fn output_ok() {
+    let _g = LOCK.lock();
+    reset();
+    let lib = find("foo").unwrap();
+    assert!(lib.libs.contains(&"gcc".to_string()));
+    assert!(lib.libs.contains(&"coregrind-amd64-linux".to_string()));
+    assert!(lib.link_paths.contains(&PathBuf::from("/usr/lib/valgrind")));
+    assert!(lib
+        .include_paths
+        .contains(&PathBuf::from("/usr/include/valgrind")));
+    assert!(lib.include_paths.contains(&PathBuf::from("/usr/foo")));
+}
+
+#[test]
+fn escapes() {
+    let _g = LOCK.lock();
+    reset();
+    let lib = find("escape").unwrap();
+    assert!(lib
+        .include_paths
+        .contains(&PathBuf::from("include path with spaces")));
+    assert!(lib
+        .link_paths
+        .contains(&PathBuf::from("link path with spaces")));
+    assert_eq!(
+        lib.defines.get("A"),
+        Some(&Some("\"escaped string' literal\"".to_owned()))
+    );
+    assert_eq!(
+        lib.defines.get("B"),
+        Some(&Some("ESCAPED IDENTIFIER".to_owned()))
+    );
+    assert_eq!(lib.defines.get("FOX"), Some(&Some("🦊".to_owned())));
+}
+
+#[test]
+fn framework() {
+    let _g = LOCK.lock();
+    reset();
+    let lib = find("framework").unwrap();
+    assert!(lib.frameworks.contains(&"foo".to_string()));
+    assert!(lib.frameworks.contains(&"bar".to_string()));
+    assert!(lib.frameworks.contains(&"baz".to_string()));
+    assert!(lib.frameworks.contains(&"foobar".to_string()));
+    assert!(lib.frameworks.contains(&"foobaz".to_string()));
+    assert!(lib.framework_paths.contains(&PathBuf::from("/usr/lib")));
+}
+
+#[test]
+fn get_variable() {
+    let _g = LOCK.lock();
+    reset();
+    let prefix = pkg_config::get_variable("foo", "prefix").unwrap();
+    assert_eq!(prefix, "/usr");
+}
+
+#[test]
+fn version() {
+    let _g = LOCK.lock();
+    reset();
+    assert_eq!(&find("foo").unwrap().version[..], "3.10.0.SVN");
+}
+
+#[test]
+fn atleast_version_ok() {
+    let _g = LOCK.lock();
+    reset();
+    pkg_config::Config::new()
+        .atleast_version("3.10")
+        .probe("foo")
+        .unwrap();
+}
+
+#[test]
+#[should_panic]
+fn atleast_version_ng() {
+    let _g = LOCK.lock();
+    reset();
+    pkg_config::Config::new()
+        .atleast_version("3.11")
+        .probe("foo")
+        .unwrap();
+}
+
+#[test]
+fn exactly_version_ok() {
+    let _g = LOCK.lock();
+    reset();
+    pkg_config::Config::new()
+        .exactly_version("3.10.0.SVN")
+        .probe("foo")
+        .unwrap();
+}
+
+#[test]
+#[should_panic]
+fn exactly_version_ng() {
+    let _g = LOCK.lock();
+    reset();
+    pkg_config::Config::new()
+        .exactly_version("3.10.0")
+        .probe("foo")
+        .unwrap();
+}
+
+#[test]
+fn range_version_range_ok() {
+    let _g = LOCK.lock();
+    reset();
+    pkg_config::Config::new()
+        .range_version("4.2.0".."4.4.0")
+        .probe("escape")
+        .unwrap();
+}
+
+#[test]
+#[should_panic]
+fn range_version_range_ng() {
+    let _g = LOCK.lock();
+    reset();
+    pkg_config::Config::new()
+        .range_version("4.0.0".."4.2.0")
+        .probe("escape")
+        .unwrap();
+}
+
+#[test]
+fn range_version_range_inclusive_ok() {
+    let _g = LOCK.lock();
+    reset();
+    pkg_config::Config::new()
+        .range_version("4.0.0"..="4.2.0")
+        .probe("escape")
+        .unwrap();
+}
+
+#[test]
+#[should_panic]
+fn range_version_range_inclusive_ng() {
+    let _g = LOCK.lock();
+    reset();
+    pkg_config::Config::new()
+        .range_version("3.8.0"..="4.0.0")
+        .probe("escape")
+        .unwrap();
+}
+
+#[test]
+fn range_version_range_from_ok() {
+    let _g = LOCK.lock();
+    reset();
+    pkg_config::Config::new()
+        .range_version("4.0.0"..)
+        .probe("escape")
+        .unwrap();
+}
+
+#[test]
+#[should_panic]
+fn range_version_range_from_ng() {
+    let _g = LOCK.lock();
+    reset();
+    pkg_config::Config::new()
+        .range_version("4.4.0"..)
+        .probe("escape")
+        .unwrap();
+}
+
+#[test]
+fn range_version_range_to_ok() {
+    let _g = LOCK.lock();
+    reset();
+    pkg_config::Config::new()
+        .range_version(.."4.4.0")
+        .probe("escape")
+        .unwrap();
+}
+
+#[test]
+#[should_panic]
+fn range_version_range_to_ng() {
+    let _g = LOCK.lock();
+    reset();
+    pkg_config::Config::new()
+        .range_version(.."4.2.0")
+        .probe("escape")
+        .unwrap();
+}
+
+#[test]
+fn range_version_range_to_inclusive_ok() {
+    let _g = LOCK.lock();
+    reset();
+    pkg_config::Config::new()
+        .range_version(..="4.2.0")
+        .probe("escape")
+        .unwrap();
+}
+
+#[test]
+#[should_panic]
+fn range_version_range_to_inclusive_ng() {
+    let _g = LOCK.lock();
+    reset();
+    pkg_config::Config::new()
+        .range_version(..="4.0.0")
+        .probe("escape")
+        .unwrap();
+}
+
+#[test]
+fn range_version_full() {
+    let _g = LOCK.lock();
+    reset();
+    pkg_config::Config::new()
+        .range_version(..)
+        .probe("escape")
+        .unwrap();
+}
+
+#[test]
+fn rpath() {
+    let _g = LOCK.lock();
+    reset();
+    let lib = find("rpath").unwrap();
+    assert!(lib
+        .ld_args
+        .contains(&vec!["-rpath".to_string(), "/usr/local/lib".to_string(),]));
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/portable-atomic/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/portable-atomic/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"CHANGELOG.md":"848112e9699780a90c28422a61b391b884d2aedba98ada2b27ff634ae275bc4c","Cargo.toml":"2906c12809ac3ba5a2e5a27375aa3d023ae0c544d06a3cbc77ca7707c54cfb36","LICENSE-APACHE":"0d542e0c8804e39aa7f37eb00da5a762149dc682d7829451287e11b938e94594","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"fca3ab3dee0a0a98bfeba2464441a10ce69e50db815cbca69719b3fe42b5f1d0","build.rs":"3e85d3f325301c8b9ce45df17a9b13ce6dba53cc66937ce27e9960e58c8edb50","no_atomic.rs":"f3cbde2210b7275786334ac8baa6900da591f7dc72c1c15f958b059a4faec9e2","src/cfgs.rs":"685613cb4d9b7b795f5c78001a4c6358ef8039be4445ba9f5f0e16596d479efa","src/gen/utils.rs":"4267901b431fa3666454d9b43db0b231e8f0850707f221d5bab7cbbcb1829d38","src/imp/arm_linux.rs":"82ca2022c5100fdafdc3b6f28b4382e34658a1753cfc97671657a9cd2bd502b8","src/imp/atomic128/README.md":"debf5b2ff2eab2e346c7c806496262c570feda9eacb444072e19b5a0e5ac970f","src/imp/atomic128/aarch64.rs":"8a65d802a0d569e81c4f9d5c4bf7260421d5f62d204fe8767ed3871038e5d037","src/imp/atomic128/detect/aarch64_aa64reg.rs":"9b58f4094b0f3cdb8e3bcd717f68529baec0ab527ec48d56fe265176757a63e1","src/imp/atomic128/detect/aarch64_fuchsia.rs":"4fa7ca4676a26b832b128f56c8fdf89509ebf500c79fce3261559cb3fab8d96f","src/imp/atomic128/detect/aarch64_macos.rs":"2dc7c6f435b47435f596a0152f43a1268d9240fc56dc1c0f45f3a2f836370bbd","src/imp/atomic128/detect/aarch64_windows.rs":"946d40c46cde3dc5fb752c663bdd55f8eb9da6786c2c55f4d0d63e65e336f773","src/imp/atomic128/detect/auxv.rs":"bf86f0f950fb44d7e19600c9cb7b9e0cf2e51a2322f04ae6d399e78ac8d616aa","src/imp/atomic128/detect/common.rs":"6bb792928d2169a3ef8892194910a594a6c91bea7c4c692251ef025db9f58589","src/imp/atomic128/detect/x86_64.rs":"2a666441b1da713d0fb0504bde0513b3c9be957af579aea436c21a3aef64097c","src/imp/atomic128/intrinsics.rs":"553a9abad66f3b5390b0eef493be6a3341d4e48249693e4f10ea7835b8f73bfd","src/imp/atomic128/macros.rs":"1f99a51f1726fdcd0dc43e922b859d0749ee3045c2fd28f62e655bfa79e6a1a5","src/imp/atomic128/powerpc64.rs":"d99b84384aae2e92b2beaa2e3924b934402babf114a4756b28e1de815e9da835","src/imp/atomic128/s390x.rs":"bcdb5af9838f0abe5048d2a85119338484f086d1bb06348decd8ec6c5fe56e76","src/imp/atomic128/x86_64.rs":"3b0669512a2e91ddeef24cd20f72c2687372252b45e42f82763b5b2534e5476d","src/imp/core_atomic.rs":"d8c917c5333e17247f035df488f85c2f335dec47f6149b861d7af6b3828512f8","src/imp/fallback/mod.rs":"9c69287fb9b44144422474a65af95a4eea8a04776c7cd6e617ec38796749e065","src/imp/fallback/outline_atomics.rs":"7f525f4747fdc76231c701734e888299793c829ffb1f12ff0c7de3998307ed53","src/imp/fallback/seq_lock.rs":"b591a77f202095e31c855f61932145e85206a489ee1a0b23b89e4411ef02807e","src/imp/fallback/seq_lock_wide.rs":"e8f22b7bda9eb7b55c4c216dd78a2c4e3ca3ba8fda3385d1a55605e302d39f53","src/imp/fallback/utils.rs":"4800db994c3995e44d1ce5ec31f741a212a64481bbd90f86cc4327f90e7d7b05","src/imp/float.rs":"f8b2e33ddb07defc8863540b5c4b6fdf47ee134101b2e357ee78035a5abdc495","src/imp/interrupt/README.md":"396d099bf7519755780fef3933657022bd5e9f41210cc4177e18e29bac6fede1","src/imp/interrupt/armv4t.rs":"2ab245614eb5f768453c153f9e566ceb1fe99c9a1d66c675ee69b219630498d3","src/imp/interrupt/armv6m.rs":"82abfe45a1f782339517fc9484d7175da226b983eb6dc1f106acc5032a1fd9be","src/imp/interrupt/avr.rs":"19c3264f1be0d92b818c5f9ee0c331c3e67d6c11d4dd688f858bd1da99cc80b2","src/imp/interrupt/mod.rs":"49e52544e0a68066a5df0d86ee54fc1d571f63023960f85e4b998fde32001a67","src/imp/interrupt/msp430.rs":"18bc58601eb34ca19112b8ac08a239ccf9cdf49a1da24e402bcf554f18804b7e","src/imp/interrupt/riscv.rs":"3d1f2e33a0a751a2206ba22786324a4eef19b0460edd2a3b0165486ee047fadb","src/imp/interrupt/xtensa.rs":"dcacc9f0014f81de0a3fc8a8af8ce95ccdb888da12793cef534ff5859298ea7f","src/imp/mod.rs":"502d4ba33b0d7d8aae93789026332f72acae8f9ff6071940b9796aadb84770df","src/imp/msp430.rs":"12e6ed42e5561d5b6fd38e76d128cd31ebc4746eb21c982c8ffbb9d2ec87c9c9","src/imp/riscv.rs":"b00b5000a82bcfbd585de252727ca6e4a1a7e7a3f391eae3564355eb296ab2a6","src/imp/x86.rs":"cda8a3f39cd0811dcf8d908d32c1ed8c7f7e420a74aa45759050daff38597ec7","src/lib.rs":"a9638b015d6dcce0d223163f64dae28c2e33564450d63a004ab2b3cba163f86a","src/tests/helper.rs":"018c13597fda273c8ab33fe9213fa8a6c10c15e33adaeb620b22ffd13632c95e","src/tests/mod.rs":"4db8e37341f590a5c795457af0632380a77983a95ad3615bcb260cb0d055d5b4","src/utils.rs":"ed9ea88f144973d607097b1b7e3c94b9eca1fc19291e4e5d9fe70ed67562b0bd","version.rs":"0e8b23d9708cf35f97c8e14cce1938b41c6e75a3b0b79a5d5d072d43e20dab0f"},"package":"da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/CHANGELOG.md 43.0.0-1ubuntu1/rust-vendor/portable-atomic/CHANGELOG.md
--- 43.0.0-1/rust-vendor/portable-atomic/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,468 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+This project adheres to [Semantic Versioning](https://semver.org).
+
+<!--
+Note: In this file, do not use the hard wrap in the middle of a sentence for compatibility with GitHub comment style markdown rendering.
+-->
+
+## [Unreleased]
+
+## [1.7.0] - 2024-07-19
+
+- Support run-time detection for cmpxchg16b on x86_64 on pre-1.69 rustc. ([#154](https://github.com/taiki-e/portable-atomic/pull/154))
+
+- Make `into_inner` `const fn` on Rust 1.56+. (align to the [std atomic change in Rust 1.79](https://github.com/rust-lang/rust/pull/123522)) ([dee1f89](https://github.com/taiki-e/portable-atomic/commit/dee1f89739594271e4f5b5d3f122d2762fcbbd7d))
+
+- Work around [rustc_codegen_gcc bug on x86_64](https://github.com/rust-lang/rustc_codegen_gcc/issues/485). ([d938f77](https://github.com/taiki-e/portable-atomic/commit/d938f77f3f2f353cbfb525ac23e63e880cd583df))
+
+- Optimize x86_64 atomics.
+  - Optimize 128-bit load/store on Zhaoxin CPU with AVX. ([86cee8f](https://github.com/taiki-e/portable-atomic/commit/86cee8fccf7deedb5b8cbcb3868ec2e43aca575f))
+  - Optimize 128-bit SeqCst store on Intel/AMD/Zhaoxin CPU with AVX. ([#156](https://github.com/taiki-e/portable-atomic/pull/156), [0483042](https://github.com/taiki-e/portable-atomic/commit/0483042671fad4ccd0bdb691424a967fc2a5cb8e))
+  - Remove needless test in CAS. ([573e025](https://github.com/taiki-e/portable-atomic/commit/573e02586f933a257c8e7383dcf64408b4708b85))
+
+- Make rustc version detection robust for custom toolchains. ([f8ea85e](https://github.com/taiki-e/portable-atomic/commit/f8ea85e1aa46fa00bc865633fb40b05f8a0c823b))
+
+- Respect `RUSTC_WRAPPER` in rustc version detection.
+
+- Our build script is now less likely to be [re-run unnecessarily](https://github.com/taiki-e/portable-atomic/issues/151) in versions where the cargo bug fix is available (cargo 1.79+). ([52c277b](https://github.com/taiki-e/portable-atomic/commit/52c277bc9a9a8031175aaed54987260da1750af4))
+
+## [1.6.0] - 2023-12-06
+
+- Add `cfg_{has,no}_atomic_{8,16,32,64,128,ptr}` macros to enable code when the corresponding atomic implementation is available/unavailable.
+
+- Add `cfg_{has,no}_atomic_cas` macros to enable code when atomic CAS/RMW implementation is available/unavailable.
+
+- Improve support for RISC-V targets without atomic CAS.
+
+## [1.5.1] - 2023-10-29
+
+- Fix bug in `i{8,16}` `fetch_{or,xor}` on RISC-V without A-extension where `unsafe-assume-single-core` and `force-amo` are enabled.
+
+- Optimize `swap` for targets that do not have native atomic CAS instructions.
+
+## [1.5.0] - 2023-10-23
+
+**Note:** This release has been yanked due to a bug fixed in 1.5.1.
+
+- Add `from_ptr`.
+
+- Add `force-amo` feature (`portable_atomic_force_amo` cfg) for single-core RISC-V without A-extension. ([#124](https://github.com/taiki-e/portable-atomic/pull/124))
+
+- Support run-time detection on AArch64 on pre-1.61 rustc. ([#98](https://github.com/taiki-e/portable-atomic/pull/98))
+
+  This also solves [a compatibility issue with rustc_codegen_cranelift](https://github.com/rust-lang/rustc_codegen_cranelift/issues/1400).
+
+- Support run-time detection of FEAT_LSE2. ([#126](https://github.com/taiki-e/portable-atomic/pull/126))
+
+- Support run-time detection of FEAT_LSE on AArch64 NetBSD. ([#66](https://github.com/taiki-e/portable-atomic/pull/66))
+
+- Acknowledge ESP-IDF targets' 64-bit atomics are not lock-free. See [#122](https://github.com/taiki-e/portable-atomic/issues/122) for more.
+
+- Optimize 128-bit weak CAS on powerpc64.
+
+- Optimize interrupt disable on no-std pre-v6 ARM where `unsafe-assume-single-core` and `disable-fiq` are enabled. ([771c45d](https://github.com/taiki-e/portable-atomic/commit/771c45da2d2afc4f83df033dd4bdf3f976d14a74))
+
+- Improve detection of Apple hardware. ([5c3a43b](https://github.com/taiki-e/portable-atomic/commit/5c3a43b53f1c4188f9dd597599633bc1a315bf44))
+
+- Improve compatibility with the future version of Miri.
+
+## [1.4.3] - 2023-08-25
+
+- Optimize AArch64 128-bit atomic store/swap/fetch_and/fetch_or when the `lse128` target feature is enabled at compile-time. ([#68](https://github.com/taiki-e/portable-atomic/pull/68))
+
+- Optimize AArch64 128-bit atomic load/store when the `rcpc3` target feature is enabled at compile-time. ([#68](https://github.com/taiki-e/portable-atomic/pull/68))
+
+- Optimize inline assemblies on ARM, AArch64, and MSP430.
+
+## [1.4.2] - 2023-07-27
+
+- Optimize `AtomicBool` on RISC-V/LoongArch64. This is the same as [rust-lang/rust#114034](https://github.com/rust-lang/rust/pull/114034), but is available for all rustc versions.
+
+## [1.4.1] - 2023-07-15
+
+- Improve compatibility with the future version of Miri.
+
+## [1.4.0] - 2023-07-11
+
+- Allow using embedded-related cfgs as Cargo features. ([#94](https://github.com/taiki-e/portable-atomic/pull/94), thanks @Dirbaio)
+
+  Originally, we were providing these as cfgs instead of features, but based on a strong request from the embedded ecosystem, we have agreed to provide them as features as well. See [#94](https://github.com/taiki-e/portable-atomic/pull/94) for more.
+
+  cfgs are kept and can be used as aliases for features.
+
+- Acknowledge all x86_64 Apple targets support 128-bit atomics.
+
+  Our code already recognizes this via `cfg(target_feature)`, so this only affects docs and users using pre-1.69 stable rustc.
+
+  See also [rust-lang/rust#112150](https://github.com/rust-lang/rust/pull/112150).
+
+- Optimize 128-bit atomics on aarch64/s390x.
+
+## [1.3.3] - 2023-05-31
+
+- Fix build error on aarch64 ILP32 ABI targets (tier 3).
+
+- Optimize 128-bit atomics on s390x.
+
+## [1.3.2] - 2023-05-09
+
+- Fix bug in powerpc64/s390x 128-bit atomic RMWs on old nightly.
+
+- Optimize 128-bit atomics on powerpc64/s390x.
+
+## [1.3.1] - 2023-05-07
+
+- Documentation improvements.
+
+## [1.3.0] - 2023-05-06
+
+- Add `require-cas` feature. ([#100](https://github.com/taiki-e/portable-atomic/pull/100))
+
+  If your crate supports no-std environment and requires atomic CAS, enabling this feature will allow the `portable-atomic` to display helpful error messages to users on targets requiring additional action on the user side to provide atomic CAS.
+
+  ```toml
+  [dependencies]
+  portable-atomic = { version = "1.3", default-features = false, features = ["require-cas"] }
+  ```
+
+  See [#100](https://github.com/taiki-e/portable-atomic/pull/100) for more.
+
+- Support `portable_atomic_unsafe_assume_single_core` cfg on Xtensa targets without atomic CAS. ([#86](https://github.com/taiki-e/portable-atomic/pull/86))
+
+- Fix bug in AArch64 128-bit SeqCst load when FEAT_LSE2 is enabled at compile-time. This is [the same bug that was fixed in the recently released GCC 13.1](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108891). LLVM also has the same bug, which had not yet been fixed when the patch was created; I will open a bug report if necessary after looking into the situation in LLVM. ([a29154b](https://github.com/taiki-e/portable-atomic/commit/a29154b21da270e90cb86f6865b591ab36eade7d))
+
+- Fix compile error on `bpf{eb,el}-unknown-none` (tier 3) and `mipsel-sony-psx` (tier 3) when `critical-section` feature is disabled.
+
+- Various optimizations
+  - Optimize x86_64 128-bit outline-atomics. This improves performance by up to 15% in concurrent RMW/store for cases where the `cmpxchg16b` target feature is not available at compile-time. ([40c4cd4](https://github.com/taiki-e/portable-atomic/commit/40c4cd4f682f1cb153f18d4d6a88795bafaf5667))
+  - Optimize x86_64 128-bit load that uses cmpxchg16b. ([40c4cd4](https://github.com/taiki-e/portable-atomic/commit/40c4cd4f682f1cb153f18d4d6a88795bafaf5667))
+  - Optimize aarch64 128-bit load that uses FEAT_LSE. ([40c4cd4](https://github.com/taiki-e/portable-atomic/commit/40c4cd4f682f1cb153f18d4d6a88795bafaf5667))
+  - Optimize pre-ARMv6 Linux/Android 64-bit atomics. ([efacc89](https://github.com/taiki-e/portable-atomic/commit/efacc89c210d7a34ef5e879821112189da5d1901))
+  - Support outline-atomics for powerpc64 128-bit atomics. This is currently disabled by default, and can be enabled by `--cfg portable_atomic_outline_atomics`. ([#90](https://github.com/taiki-e/portable-atomic/pull/90))
+  - Optimize aarch64 outline-atomics on linux-musl. On linux-musl, outline-atomics is enabled by default only when dynamic linking is enabled. When static linking is enabled, this can be enabled by `--cfg portable_atomic_outline_atomics`. See the [`atomic128` module's readme](https://github.com/taiki-e/portable-atomic/blob/HEAD/src/imp/atomic128/README.md#run-time-feature-detection) for more. ([8418235](https://github.com/taiki-e/portable-atomic/commit/84182354e4a149074e28bda4683d538e5fb617ce), [31d0862](https://github.com/taiki-e/portable-atomic/commit/31d08623d4e21af207ff2343f5553b9b5a030452))
+
+## [1.2.0] - 2023-03-25
+
+- Make 64-bit atomics lock-free on ARM Linux/Android targets that do not have 64-bit atomics (e.g., armv5te-unknown-linux-gnueabi, arm-linux-androideabi, etc.) when the kernel version is 3.1 or later. ([#82](https://github.com/taiki-e/portable-atomic/pull/82))
+
+- Fix aarch64 128-bit atomics performance regression on Apple hardware. ([#89](https://github.com/taiki-e/portable-atomic/pull/89))
+
+- Optimize 128-bit atomics on aarch64, x86_64, powerpc64, and s390x.
+
+## [1.1.0] - 2023-03-24
+
+- Add `Atomic{I,U}*::bit_{set,clear,toggle}` and `AtomicPtr::bit_{set,clear,toggle}`. ([#72](https://github.com/taiki-e/portable-atomic/pull/72))
+
+  They correspond to x86's `lock bt{s,r,c}`, and the implementation calls them on x86/x86_64.
+
+- Add `AtomicU*::{fetch_neg,neg}` methods. Previously it was only available on `AtomicI*` and `AtomicF*`.
+
+- Add `as_ptr` method to all atomic types. ([#79](https://github.com/taiki-e/portable-atomic/pull/79))
+
+- Make `AtomicF{32,64}::as_bits` `const fn` on Rust 1.58+. ([#79](https://github.com/taiki-e/portable-atomic/pull/79))
+
+- Relax ordering in `Serialize` impl to reflect the [upstream change](https://github.com/serde-rs/serde/pull/2263).
+
+- Optimize x86_64 outline-atomics for 128-bit atomics.
+  - Support outline-atomics for cmpxchg16b on Rust 1.69+ (i.e., on Rust 1.69+, x86_64 128-bit atomics is lock-free on all Intel chips and almost all AMD chips, even if cmpxchg16b is not available at compile-time.). Previously it was only nightly. ([#80](https://github.com/taiki-e/portable-atomic/pull/80))
+  - portable-atomic no longer enables outline-atomics on target where run-time feature detection is not available. ([#80](https://github.com/taiki-e/portable-atomic/pull/80))
+
+- Optimize aarch64 outline-atomics for 128-bit atomics.
+  - Support more targets and improve performance. ([#63](https://github.com/taiki-e/portable-atomic/pull/63), [#64](https://github.com/taiki-e/portable-atomic/pull/64), [#67](https://github.com/taiki-e/portable-atomic/pull/67), [#69](https://github.com/taiki-e/portable-atomic/pull/69), [#75](https://github.com/taiki-e/portable-atomic/pull/75), [#76](https://github.com/taiki-e/portable-atomic/pull/76), [#77](https://github.com/taiki-e/portable-atomic/pull/77))
+    See the [`atomic128` module's readme](https://github.com/taiki-e/portable-atomic/blob/HEAD/src/imp/atomic128/README.md#run-time-feature-detection) for a list of platforms that support outline-atomics.
+    Most of these improvements have already been [submitted and accepted in rust-lang/stdarch](https://github.com/rust-lang/stdarch/pulls?q=is%3Apr+author%3Ataiki-e+std_detect) and will soon be available in `std::arch::is_aarch64_feature_detected`.
+  - portable-atomic no longer enables outline-atomics on target where run-time feature detection is not available.
+
+- Performance improvements. ([#70](https://github.com/taiki-e/portable-atomic/pull/70), [#81](https://github.com/taiki-e/portable-atomic/pull/81), [6c189ae](https://github.com/taiki-e/portable-atomic/commit/6c189ae1792ce0c08b4f56b6e6c256c223475ce2), [13c92b0](https://github.com/taiki-e/portable-atomic/commit/13c92b015a8e8646a4b885229157547354d03b9e), etc.)
+
+- Improve support for old nightly. ([#73](https://github.com/taiki-e/portable-atomic/pull/73), [872feb9](https://github.com/taiki-e/portable-atomic/commit/872feb9d7f3a4ca7cf9b63935265d46498fcae99))
+
+- Documentation improvements.
+
+## [1.0.1] - 2023-01-21
+
+- Optimize `Atomic{I,U}*::{fetch_not,not}` methods. ([#62](https://github.com/taiki-e/portable-atomic/pull/62))
+
+## [1.0.0] - 2023-01-15
+
+- Add `critical-section` feature to use [critical-section](https://github.com/rust-embedded/critical-section) on targets where atomic CAS is not natively available. ([#51](https://github.com/taiki-e/portable-atomic/pull/51), thanks @Dirbaio)
+
+  This is useful to get atomic CAS when `--cfg portable_atomic_unsafe_assume_single_core` can't be used, such as multi-core targets, unprivileged code running under some RTOS, or environments where disabling interrupts needs extra care due to e.g. real-time requirements.
+
+  See [documentation](https://github.com/taiki-e/portable-atomic#optional-features-critical-section) for more.
+
+- Remove `outline-atomics` feature. This was no-op since 0.3.19.
+
+- Documentation improvements.
+
+## [0.3.20] - 2023-05-07
+
+The latest version of portable-atomic is 1.x. This release makes portable-atomic 0.3 is built on top of portable-atomic 1.x to make bug fixes and improvements such as [support for new targets](https://github.com/taiki-e/portable-atomic/pull/86) in 1.x available to the ecosystem that depends on older portable-atomic. portable-atomic 0.3 is still maintained passively, but upgrading to portable-atomic 1.x is recommended. (There are no breaking changes from 0.3, except that a deprecated no-op `outline-atomics` Cargo feature has been removed.) ([#99](https://github.com/taiki-e/portable-atomic/pull/99))
+
+## [0.3.19] - 2022-12-25
+
+- Add `AtomicI*::{fetch_neg,neg}` and `AtomicF*::fetch_neg` methods. ([#54](https://github.com/taiki-e/portable-atomic/pull/54))
+
+  `AtomicI*::neg` are equivalent to the corresponding `fetch_*` methods, but do not return the previous value. They are intended for optimization on platforms that have atomic instructions for the corresponding operation, such as x86's `lock neg`.
+
+  Currently, optimizations by these methods (`neg`) are only guaranteed for x86/x86_64.
+
+- Add `Atomic{I,U}*::{fetch_not,not}` methods. ([#54](https://github.com/taiki-e/portable-atomic/pull/54))
+
+  `Atomic{I,U}*::not` are equivalent to the corresponding `fetch_*` methods, but do not return the previous value. They are intended for optimization on platforms that have atomic instructions for the corresponding operation, such as x86's `lock not`, MSP430's `inv`.
+
+  Currently, optimizations by these methods (`not`) are only guaranteed for x86/x86_64 and MSP430.
+
+  (Note: `AtomicBool` already has `fetch_not` and `not` methods.)
+
+- Enable outline-atomics for 128-bit atomics by default. ([#57](https://github.com/taiki-e/portable-atomic/pull/57)) See [#57](https://github.com/taiki-e/portable-atomic/pull/57) for more.
+
+- Improve support for old nightly compilers.
+
+## [0.3.18] - 2022-12-15
+
+- Fix build error when not using `portable_atomic_unsafe_assume_single_core` cfg on AVR and MSP430 custom targets. ([#50](https://github.com/taiki-e/portable-atomic/pull/50))
+
+  Since 0.3.11, atomic CAS was supported without the cfg on AVR and MSP430 builtin targets, but that change was not applied to custom targets.
+
+## [0.3.17] - 2022-12-14
+
+- Optimize x86_64 128-bit atomic load/store on AMD CPU with AVX. ([#49](https://github.com/taiki-e/portable-atomic/pull/49))
+
+- Improve support for custom targets on old rustc.
+
+## [0.3.16] - 2022-12-09
+
+- Add `Atomic{I,U}*::{add,sub,and,or,xor}` and `AtomicBool::{and,or,xor}` methods. ([#47](https://github.com/taiki-e/portable-atomic/pull/47))
+
+  They are equivalent to the corresponding `fetch_*` methods, but do not return the previous value. They are intended for optimization on platforms that implement atomics using inline assembly, such as the MSP430.
+
+  Currently, optimizations by these methods (`add`,`sub`,`and`,`or`,`xor`) are only guaranteed for MSP430; on x86/x86_64, LLVM can optimize in most cases, so cases, where this would improve things, should be rare.
+
+- Various improvements to `portable_atomic_unsafe_assume_single_core` cfg. ([#44](https://github.com/taiki-e/portable-atomic/pull/44), [#40](https://github.com/taiki-e/portable-atomic/pull/40))
+
+  - Support disabling FIQs on pre-v6 ARM under `portable_atomic_disable_fiq` cfg.
+  - Support RISC-V supervisor mode under `portable_atomic_s_mode` cfg.
+  - Optimize interrupt restore on AVR and MSP430. ([#40](https://github.com/taiki-e/portable-atomic/pull/40))
+  - Documentation improvements.
+
+  See [#44](https://github.com/taiki-e/portable-atomic/pull/44) for more.
+
+## [0.3.15] - 2022-09-09
+
+- Implement workaround for std cpuid bug due to LLVM bug ([rust-lang/rust#101346](https://github.com/rust-lang/rust/issues/101346), [llvm/llvm-project#57550](https://github.com/llvm/llvm-project/issues/57550)).
+
+  - Our use case is likely not affected, but we implement this just in case.
+  - We've confirmed that the uses of inline assembly in this crate are not affected by this LLVM bug.
+
+## [0.3.14] - 2022-09-04
+
+- Optimize atomic load/store on no-std pre-v6 ARM when `portable_atomic_unsafe_assume_single_core` cfg is used. ([#36](https://github.com/taiki-e/portable-atomic/pull/36))
+
+- Support pre-power8 powerpc64le. powerpc64le's default cpu version is power8, but you can technically compile it for the old cpu using the unsafe `-C target-cpu` rustc flag.
+
+## [0.3.13] - 2022-08-15
+
+- Use track_caller when debug assertions are enabled on Rust 1.46+.
+
+- Make powerpc64 128-bit atomics compatible with Miri and ThreadSanitizer on LLVM 15+.
+
+- Document that 128-bit atomics are compatible with Miri and ThreadSanitizer on recent nightly.
+
+## [0.3.12] - 2022-08-13
+
+- Support atomic CAS on no-std pre-v6 ARM targets (e.g., thumbv4t-none-eabi) under unsafe cfg `portable_atomic_unsafe_assume_single_core`. ([#28](https://github.com/taiki-e/portable-atomic/pull/28))
+
+## [0.3.11] - 2022-08-12
+
+- Always provide atomic CAS for MSP430 and AVR. ([#31](https://github.com/taiki-e/portable-atomic/pull/31))
+
+  This previously required unsafe cfg `portable_atomic_unsafe_assume_single_core`, but since all MSP430 and AVR are single-core, we can safely provide atomic CAS based on disabling interrupts.
+
+- Support `fence` and `compiler_fence` on MSP430. (On MSP430, the standard library's fences are currently unavailable due to LLVM errors.)
+
+- Update safety requirements for unsafe cfg `portable_atomic_unsafe_assume_single_core` to mention use of privileged instructions to disable interrupts.
+
+- Atomic operations based on disabling interrupts on single-core systems are now considered lock-free.
+
+  The previous behavior was inconsistent because we consider the pre-v6 ARM Linux's atomic operations provided in a similar way by the Linux kernel to be lock-free.
+
+- Respect `-Z allow-features`.
+
+## [0.3.10] - 2022-08-03
+
+- Optimize AArch64 128-bit atomic load when the `lse` target feature is enabled at compile-time. ([#20](https://github.com/taiki-e/portable-atomic/pull/20))
+
+## [0.3.9] - 2022-08-03
+
+- Fix build error on old Miri.
+
+- Documentation improvements.
+
+## [0.3.8] - 2022-08-02
+
+- Make AArch64 and s390x 128-bit atomics compatible with Miri and ThreadSanitizer.
+
+## [0.3.7] - 2022-07-31
+
+- Provide stable equivalent of [`#![feature(strict_provenance_atomic_ptr)]`](https://github.com/rust-lang/rust/issues/99108). ([#23](https://github.com/taiki-e/portable-atomic/pull/23))
+
+  - `AtomicPtr::fetch_ptr_{add,sub}`
+  - `AtomicPtr::fetch_byte_{add,sub}`
+  - `AtomicPtr::fetch_{or,and,xor}`
+
+  These APIs are compatible with strict-provenance on `cfg(miri)`. Otherwise, they are compatible with permissive-provenance.
+  Once `#![feature(strict_provenance_atomic_ptr)]` is stabilized, these APIs will be strict-provenance compatible in all cases from the version in which it is stabilized.
+
+- Provide stable equivalent of [`#![feature(atomic_bool_fetch_not)]`](https://github.com/rust-lang/rust/issues/98485). ([#24](https://github.com/taiki-e/portable-atomic/pull/24))
+
+  - `AtomicBool::fetch_not`
+
+- Optimize x86_64 128-bit RMWs. ([#22](https://github.com/taiki-e/portable-atomic/pull/22))
+
+- Optimize x86_64 outline-atomics.
+
+- Optimize inline assemblies on ARM and AArch64.
+
+- Revert [thumbv6m atomic load/store changes made in 0.3.5](https://github.com/taiki-e/portable-atomic/pull/18). This is because [rust-lang/rust#99595](https://github.com/rust-lang/rust/pull/99595) has been reverted, so this is no longer needed.
+
+## [0.3.6] - 2022-07-26
+
+- Fix build failure due to the existence of the `specs` directory.
+
+- Documentation improvements.
+
+- Optimize inline assemblies on x86_64, RISC-V, and MSP430.
+
+## [0.3.5] - 2022-07-23
+
+**Note:** This release has been yanked due to a bug fixed in 0.3.6.
+
+- Provide thumbv6m atomic load/store which is planned to be removed from the standard library in [rust-lang/rust#99595](https://github.com/rust-lang/rust/pull/99595). ([#18](https://github.com/taiki-e/portable-atomic/pull/18))
+
+- Optimize inline assemblies on AArch64, RISC-V, and powerpc64.
+
+## [0.3.4] - 2022-06-25
+
+- Optimize x86_64 128-bit atomic store.
+
+## [0.3.3] - 2022-06-24
+
+- Allow CAS failure ordering stronger than success ordering. ([#17](https://github.com/taiki-e/portable-atomic/pull/17))
+
+## [0.3.2] - 2022-06-19
+
+- Optimize x86_64 128-bit atomic load/store on Intel CPU with AVX. ([#16](https://github.com/taiki-e/portable-atomic/pull/16))
+
+- Support native 128-bit atomic operations for powerpc64 (le or pwr8+, currently nightly-only).
+
+- Fix behavior differences between stable and nightly. ([#15](https://github.com/taiki-e/portable-atomic/pull/15))
+
+## [0.3.1] - 2022-06-16
+
+- Optimize AArch64 128-bit atomic load/store when the `lse2` target feature is enabled at compile-time. ([#11](https://github.com/taiki-e/portable-atomic/pull/11))
+
+- Relax ordering in `Debug` impl to reflect std changes. ([#12](https://github.com/taiki-e/portable-atomic/pull/12))
+
+## [0.3.0] - 2022-03-25
+
+- Support native 128-bit atomic operations for s390x (currently nightly-only).
+
+- Add `AtomicF{32,64}::fetch_abs`.
+
+- Add `#[must_use]` to constructors.
+
+- Use 128-bit atomic operation mappings same as LLVM on AArch64.
+
+- Remove `parking_lot` optional feature to allow the use of this crate within global allocators.
+
+## [0.2.1] - 2022-03-17
+
+- Implement AArch64 outline-atomics.
+
+## [0.2.0] - 2022-03-10
+
+- Remove `i128` feature. `Atomic{I,U}128` are now always enabled.
+
+- Add `outline-atomics` feature. Currently, this is the same as the 0.1's `i128-dynamic`, except that `fallback` feature is not implicitly enabled.
+
+- Remove `i128-dynamic` feature in favor of `outline-atomics` feature.
+
+- Add `AtomicF{32,64}::as_bits`.
+
+## [0.1.4] - 2022-03-02
+
+- Support native 128-bit atomic operations for AArch64 at Rust 1.59+. This was previously supported only on nightly. ([#6](https://github.com/taiki-e/portable-atomic/pull/6))
+
+## [0.1.3] - 2022-02-28
+
+- Fix inline assembly for RISC-V without A-extension.
+
+## [0.1.2] - 2022-02-26
+
+**Note:** This release has been yanked due to a bug fixed in 0.1.3.
+
+- Add `parking_lot` feature to use parking_lot in global locks of fallback implementation.
+
+- Fix bug in cmpxchg16b support. ([#5](https://github.com/taiki-e/portable-atomic/pull/5))
+
+## [0.1.1] - 2022-02-25
+
+**Note:** This release has been yanked due to a bug fixed in 0.1.3.
+
+- Fix doc cfg on `Atomic{I,U}128`.
+
+## [0.1.0] - 2022-02-24
+
+**Note:** This release has been yanked due to a bug fixed in 0.1.3.
+
+Initial release
+
+[Unreleased]: https://github.com/taiki-e/portable-atomic/compare/v1.7.0...HEAD
+[1.7.0]: https://github.com/taiki-e/portable-atomic/compare/v1.6.0...v1.7.0
+[1.6.0]: https://github.com/taiki-e/portable-atomic/compare/v1.5.1...v1.6.0
+[1.5.1]: https://github.com/taiki-e/portable-atomic/compare/v1.5.0...v1.5.1
+[1.5.0]: https://github.com/taiki-e/portable-atomic/compare/v1.4.3...v1.5.0
+[1.4.3]: https://github.com/taiki-e/portable-atomic/compare/v1.4.2...v1.4.3
+[1.4.2]: https://github.com/taiki-e/portable-atomic/compare/v1.4.1...v1.4.2
+[1.4.1]: https://github.com/taiki-e/portable-atomic/compare/v1.4.0...v1.4.1
+[1.4.0]: https://github.com/taiki-e/portable-atomic/compare/v1.3.3...v1.4.0
+[1.3.3]: https://github.com/taiki-e/portable-atomic/compare/v1.3.2...v1.3.3
+[1.3.2]: https://github.com/taiki-e/portable-atomic/compare/v1.3.1...v1.3.2
+[1.3.1]: https://github.com/taiki-e/portable-atomic/compare/v1.3.0...v1.3.1
+[1.3.0]: https://github.com/taiki-e/portable-atomic/compare/v1.2.0...v1.3.0
+[1.2.0]: https://github.com/taiki-e/portable-atomic/compare/v1.1.0...v1.2.0
+[1.1.0]: https://github.com/taiki-e/portable-atomic/compare/v1.0.1...v1.1.0
+[1.0.1]: https://github.com/taiki-e/portable-atomic/compare/v1.0.0...v1.0.1
+[1.0.0]: https://github.com/taiki-e/portable-atomic/compare/v0.3.19...v1.0.0
+[0.3.20]: https://github.com/taiki-e/portable-atomic/compare/v0.3.19...v0.3.20
+[0.3.19]: https://github.com/taiki-e/portable-atomic/compare/v0.3.18...v0.3.19
+[0.3.18]: https://github.com/taiki-e/portable-atomic/compare/v0.3.17...v0.3.18
+[0.3.17]: https://github.com/taiki-e/portable-atomic/compare/v0.3.16...v0.3.17
+[0.3.16]: https://github.com/taiki-e/portable-atomic/compare/v0.3.15...v0.3.16
+[0.3.15]: https://github.com/taiki-e/portable-atomic/compare/v0.3.14...v0.3.15
+[0.3.14]: https://github.com/taiki-e/portable-atomic/compare/v0.3.13...v0.3.14
+[0.3.13]: https://github.com/taiki-e/portable-atomic/compare/v0.3.12...v0.3.13
+[0.3.12]: https://github.com/taiki-e/portable-atomic/compare/v0.3.11...v0.3.12
+[0.3.11]: https://github.com/taiki-e/portable-atomic/compare/v0.3.10...v0.3.11
+[0.3.10]: https://github.com/taiki-e/portable-atomic/compare/v0.3.9...v0.3.10
+[0.3.9]: https://github.com/taiki-e/portable-atomic/compare/v0.3.8...v0.3.9
+[0.3.8]: https://github.com/taiki-e/portable-atomic/compare/v0.3.7...v0.3.8
+[0.3.7]: https://github.com/taiki-e/portable-atomic/compare/v0.3.6...v0.3.7
+[0.3.6]: https://github.com/taiki-e/portable-atomic/compare/v0.3.5...v0.3.6
+[0.3.5]: https://github.com/taiki-e/portable-atomic/compare/v0.3.4...v0.3.5
+[0.3.4]: https://github.com/taiki-e/portable-atomic/compare/v0.3.3...v0.3.4
+[0.3.3]: https://github.com/taiki-e/portable-atomic/compare/v0.3.2...v0.3.3
+[0.3.2]: https://github.com/taiki-e/portable-atomic/compare/v0.3.1...v0.3.2
+[0.3.1]: https://github.com/taiki-e/portable-atomic/compare/v0.3.0...v0.3.1
+[0.3.0]: https://github.com/taiki-e/portable-atomic/compare/v0.2.1...v0.3.0
+[0.2.1]: https://github.com/taiki-e/portable-atomic/compare/v0.2.0...v0.2.1
+[0.2.0]: https://github.com/taiki-e/portable-atomic/compare/v0.1.4...v0.2.0
+[0.1.4]: https://github.com/taiki-e/portable-atomic/compare/v0.1.3...v0.1.4
+[0.1.3]: https://github.com/taiki-e/portable-atomic/compare/v0.1.2...v0.1.3
+[0.1.2]: https://github.com/taiki-e/portable-atomic/compare/v0.1.1...v0.1.2
+[0.1.1]: https://github.com/taiki-e/portable-atomic/compare/v0.1.0...v0.1.1
+[0.1.0]: https://github.com/taiki-e/portable-atomic/releases/tag/v0.1.0
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/portable-atomic/Cargo.toml
--- 43.0.0-1/rust-vendor/portable-atomic/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,192 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2018"
+rust-version = "1.34"
+name = "portable-atomic"
+version = "1.7.0"
+exclude = [
+    "/.*",
+    "/tools",
+    "/target-specs",
+    "/DEVELOPMENT.md",
+]
+description = """
+Portable atomic types including support for 128-bit atomics, atomic float, etc.
+"""
+readme = "README.md"
+keywords = ["atomic"]
+categories = [
+    "concurrency",
+    "embedded",
+    "hardware-support",
+    "no-std",
+    "no-std::no-alloc",
+]
+license = "Apache-2.0 OR MIT"
+repository = "https://github.com/taiki-e/portable-atomic"
+
+[package.metadata.cargo_check_external_types]
+allowed_external_types = ["serde::*"]
+
+[package.metadata.docs.rs]
+features = [
+    "float",
+    "std",
+    "serde",
+    "critical-section",
+]
+targets = ["x86_64-unknown-linux-gnu"]
+
+[lib]
+doc-scrape-examples = false
+
+[dependencies.critical-section]
+version = "1"
+optional = true
+
+[dependencies.serde]
+version = "1.0.103"
+optional = true
+default-features = false
+
+[dev-dependencies.build-context]
+version = "0.1"
+
+[dev-dependencies.crossbeam-utils]
+version = "=0.8.16"
+
+[dev-dependencies.fastrand]
+version = "2"
+
+[dev-dependencies.paste]
+version = "1"
+
+[dev-dependencies.sptr]
+version = "0.3"
+
+[dev-dependencies.static_assertions]
+version = "1"
+
+[features]
+default = ["fallback"]
+disable-fiq = []
+fallback = []
+float = []
+force-amo = []
+require-cas = []
+s-mode = []
+std = []
+unsafe-assume-single-core = []
+
+[lints.clippy]
+all = "warn"
+as_ptr_cast_mut = "warn"
+as_underscore = "warn"
+default_union_representation = "warn"
+inline_asm_x86_att_syntax = "warn"
+pedantic = "warn"
+trailing_empty_array = "warn"
+transmute_undefined_repr = "warn"
+undocumented_unsafe_blocks = "warn"
+
+[lints.clippy.bool_assert_comparison]
+level = "allow"
+priority = 1
+
+[lints.clippy.borrow_as_ptr]
+level = "allow"
+priority = 1
+
+[lints.clippy.declare_interior_mutable_const]
+level = "allow"
+priority = 1
+
+[lints.clippy.doc_markdown]
+level = "allow"
+priority = 1
+
+[lints.clippy.float_cmp]
+level = "allow"
+priority = 1
+
+[lints.clippy.incompatible_msrv]
+level = "allow"
+priority = 1
+
+[lints.clippy.lint_groups_priority]
+level = "allow"
+priority = 1
+
+[lints.clippy.manual_assert]
+level = "allow"
+priority = 1
+
+[lints.clippy.manual_range_contains]
+level = "allow"
+priority = 1
+
+[lints.clippy.missing_errors_doc]
+level = "allow"
+priority = 1
+
+[lints.clippy.module_name_repetitions]
+level = "allow"
+priority = 1
+
+[lints.clippy.nonminimal_bool]
+level = "allow"
+priority = 1
+
+[lints.clippy.similar_names]
+level = "allow"
+priority = 1
+
+[lints.clippy.single_match]
+level = "allow"
+priority = 1
+
+[lints.clippy.single_match_else]
+level = "allow"
+priority = 1
+
+[lints.clippy.struct_excessive_bools]
+level = "allow"
+priority = 1
+
+[lints.clippy.struct_field_names]
+level = "allow"
+priority = 1
+
+[lints.clippy.too_many_arguments]
+level = "allow"
+priority = 1
+
+[lints.clippy.too_many_lines]
+level = "allow"
+priority = 1
+
+[lints.clippy.type_complexity]
+level = "allow"
+priority = 1
+
+[lints.rust]
+improper_ctypes = "warn"
+improper_ctypes_definitions = "warn"
+non_ascii_idents = "warn"
+rust_2018_idioms = "warn"
+single_use_lifetimes = "warn"
+unreachable_pub = "warn"
+
+[lints.rust.unexpected_cfgs]
+level = "warn"
+priority = 0
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/portable-atomic/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/portable-atomic/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,177 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/portable-atomic/LICENSE-MIT
--- 43.0.0-1/rust-vendor/portable-atomic/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,23 @@
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/README.md 43.0.0-1ubuntu1/rust-vendor/portable-atomic/README.md
--- 43.0.0-1/rust-vendor/portable-atomic/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,203 @@
+# portable-atomic
+
+[![crates.io](https://img.shields.io/crates/v/portable-atomic?style=flat-square&logo=rust)](https://crates.io/crates/portable-atomic)
+[![docs.rs](https://img.shields.io/badge/docs.rs-portable--atomic-blue?style=flat-square&logo=docs.rs)](https://docs.rs/portable-atomic)
+[![license](https://img.shields.io/badge/license-Apache--2.0_OR_MIT-blue?style=flat-square)](#license)
+[![msrv](https://img.shields.io/badge/msrv-1.34-blue?style=flat-square&logo=rust)](https://www.rust-lang.org)
+[![github actions](https://img.shields.io/github/actions/workflow/status/taiki-e/portable-atomic/ci.yml?branch=main&style=flat-square&logo=github)](https://github.com/taiki-e/portable-atomic/actions)
+[![cirrus ci](https://img.shields.io/cirrus/github/taiki-e/portable-atomic/main?style=flat-square&logo=cirrusci)](https://cirrus-ci.com/github/taiki-e/portable-atomic)
+
+<!-- tidy:crate-doc:start -->
+Portable atomic types including support for 128-bit atomics, atomic float, etc.
+
+<!-- TODO: move atomic_bool_fetch_not to "features that require newer compilers" group once 1.81 became stable: https://github.com/rust-lang/rust/pull/127204 -->
+- Provide all atomic integer types (`Atomic{I,U}{8,16,32,64}`) for all targets that can use atomic CAS. (i.e., all targets that can use `std`, and most no-std targets)
+- Provide `AtomicI128` and `AtomicU128`.
+- Provide `AtomicF32` and `AtomicF64`. ([optional, requires the `float` feature](#optional-features-float))
+- Provide atomic load/store for targets where atomic is not available at all in the standard library. (RISC-V without A-extension, MSP430, AVR)
+- Provide atomic CAS for targets where atomic CAS is not available in the standard library. (thumbv6m, pre-v6 ARM, RISC-V without A-extension, MSP430, AVR, Xtensa, etc.) (always enabled for MSP430 and AVR, [optional](#optional-features-critical-section) otherwise)
+- Provide stable equivalents of the standard library's atomic types' unstable APIs, such as [`AtomicPtr::fetch_*`](https://github.com/rust-lang/rust/issues/99108), [`AtomicBool::fetch_not`](https://github.com/rust-lang/rust/issues/98485).
+- Make features that require newer compilers, such as [`fetch_{max,min}`](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicUsize.html#method.fetch_max), [`fetch_update`](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicUsize.html#method.fetch_update), [`as_ptr`](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicUsize.html#method.as_ptr), [`from_ptr`](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicUsize.html#method.from_ptr) and [stronger CAS failure ordering](https://github.com/rust-lang/rust/pull/98383) available on Rust 1.34+.
+- Provide workaround for bugs in the standard library's atomic-related APIs, such as [rust-lang/rust#100650], `fence`/`compiler_fence` on MSP430 that cause LLVM error, etc.
+
+<!-- TODO:
+- mention Atomic{I,U}*::fetch_neg, Atomic{I*,U*,Ptr}::bit_*, etc.
+- mention optimizations not available in the standard library's equivalents
+-->
+
+portable-atomic version of `std::sync::Arc` is provided by the [portable-atomic-util](https://github.com/taiki-e/portable-atomic/tree/HEAD/portable-atomic-util) crate.
+
+## Usage
+
+Add this to your `Cargo.toml`:
+
+```toml
+[dependencies]
+portable-atomic = "1"
+```
+
+The default features are mainly for users who use atomics larger than the pointer width.
+If you don't need them, disabling the default features may reduce code size and compile time slightly.
+
+```toml
+[dependencies]
+portable-atomic = { version = "1", default-features = false }
+```
+
+If your crate supports no-std environment and requires atomic CAS, enabling the `require-cas` feature will allow the `portable-atomic` to display a [helpful error message](https://github.com/taiki-e/portable-atomic/pull/100) to users on targets requiring additional action on the user side to provide atomic CAS.
+
+```toml
+[dependencies]
+portable-atomic = { version = "1.3", default-features = false, features = ["require-cas"] }
+```
+
+## 128-bit atomics support
+
+Native 128-bit atomic operations are available on x86_64 (Rust 1.59+), aarch64 (Rust 1.59+), powerpc64 (nightly only), and s390x (nightly only), otherwise the fallback implementation is used.
+
+On x86_64, even if `cmpxchg16b` is not available at compile-time (note: `cmpxchg16b` target feature is enabled by default only on Apple and Windows (except Windows 7) targets), run-time detection checks whether `cmpxchg16b` is available. If `cmpxchg16b` is not available at either compile-time or run-time detection, the fallback implementation is used. See also [`portable_atomic_no_outline_atomics`](#optional-cfg-no-outline-atomics) cfg.
+
+They are usually implemented using inline assembly, and when using Miri or ThreadSanitizer that do not support inline assembly, core intrinsics are used instead of inline assembly if possible.
+
+See the [`atomic128` module's readme](https://github.com/taiki-e/portable-atomic/blob/HEAD/src/imp/atomic128/README.md) for details.
+
+## Optional features
+
+- **`fallback`** *(enabled by default)*<br>
+  Enable fallback implementations.
+
+  Disabling this allows only atomic types for which the platform natively supports atomic operations.
+
+- <a name="optional-features-float"></a>**`float`**<br>
+  Provide `AtomicF{32,64}`.
+
+  Note that most of `fetch_*` operations of atomic floats are implemented using CAS loops, which can be slower than equivalent operations of atomic integers. ([GPU targets have atomic instructions for float, so we plan to use these instructions for GPU targets in the future.](https://github.com/taiki-e/portable-atomic/issues/34))
+
+- **`std`**<br>
+  Use `std`.
+
+- <a name="optional-features-require-cas"></a>**`require-cas`**<br>
+  Emit compile error if atomic CAS is not available. See [Usage](#usage) section and [#100](https://github.com/taiki-e/portable-atomic/pull/100) for more.
+
+- <a name="optional-features-serde"></a>**`serde`**<br>
+  Implement `serde::{Serialize,Deserialize}` for atomic types.
+
+  Note:
+  - The MSRV when this feature is enabled depends on the MSRV of [serde].
+
+- <a name="optional-features-critical-section"></a>**`critical-section`**<br>
+  When this feature is enabled, this crate uses [critical-section] to provide atomic CAS for targets where
+  it is not natively available. When enabling it, you should provide a suitable critical section implementation
+  for the current target, see the [critical-section] documentation for details on how to do so.
+
+  `critical-section` support is useful to get atomic CAS when the [`unsafe-assume-single-core` feature](#optional-features-unsafe-assume-single-core) can't be used,
+  such as multi-core targets, unprivileged code running under some RTOS, or environments where disabling interrupts
+  needs extra care due to e.g. real-time requirements.
+
+  Note that with the `critical-section` feature, critical sections are taken for all atomic operations, while with
+  [`unsafe-assume-single-core` feature](#optional-features-unsafe-assume-single-core) some operations don't require disabling interrupts (loads and stores, but
+  additionally on MSP430 `add`, `sub`, `and`, `or`, `xor`, `not`). Therefore, for better performance, if
+  all the `critical-section` implementation for your target does is disable interrupts, prefer using
+  `unsafe-assume-single-core` feature instead.
+
+  Note:
+  - The MSRV when this feature is enabled depends on the MSRV of [critical-section].
+  - It is usually *not* recommended to always enable this feature in dependencies of the library.
+
+    Enabling this feature will prevent the end user from having the chance to take advantage of other (potentially) efficient implementations ([Implementations provided by `unsafe-assume-single-core` feature, default implementations on MSP430 and AVR](#optional-features-unsafe-assume-single-core), implementation proposed in [#60], etc. Other systems may also be supported in the future).
+
+    The recommended approach for libraries is to leave it up to the end user whether or not to enable this feature. (However, it may make sense to enable this feature by default for libraries specific to a platform where other implementations are known not to work.)
+
+    As an example, the end-user's `Cargo.toml` that uses a crate that provides a critical-section implementation and a crate that depends on portable-atomic as an option would be expected to look like this:
+
+    ```toml
+    [dependencies]
+    portable-atomic = { version = "1", default-features = false, features = ["critical-section"] }
+    crate-provides-critical-section-impl = "..."
+    crate-uses-portable-atomic-as-feature = { version = "...", features = ["portable-atomic"] }
+    ```
+
+- <a name="optional-features-unsafe-assume-single-core"></a>**`unsafe-assume-single-core`**<br>
+  Assume that the target is single-core.
+  When this feature is enabled, this crate provides atomic CAS for targets where atomic CAS is not available in the standard library by disabling interrupts.
+
+  This feature is `unsafe`, and note the following safety requirements:
+  - Enabling this feature for multi-core systems is always **unsound**.
+  - This uses privileged instructions to disable interrupts, so it usually doesn't work on unprivileged mode.
+    Enabling this feature in an environment where privileged instructions are not available, or if the instructions used are not sufficient to disable interrupts in the system, it is also usually considered **unsound**, although the details are system-dependent.
+
+    The following are known cases:
+    - On pre-v6 ARM, this disables only IRQs by default. For many systems (e.g., GBA) this is enough. If the system need to disable both IRQs and FIQs, you need to enable the `disable-fiq` feature together.
+    - On RISC-V without A-extension, this generates code for machine-mode (M-mode) by default. If you enable the `s-mode` together, this generates code for supervisor-mode (S-mode). In particular, `qemu-system-riscv*` uses [OpenSBI](https://github.com/riscv-software-src/opensbi) as the default firmware.
+
+    See also [the `interrupt` module's readme](https://github.com/taiki-e/portable-atomic/blob/HEAD/src/imp/interrupt/README.md).
+
+  Consider using the [`critical-section` feature](#optional-features-critical-section) for systems that cannot use this feature.
+
+  It is **very strongly discouraged** to enable this feature in libraries that depend on `portable-atomic`. The recommended approach for libraries is to leave it up to the end user whether or not to enable this feature. (However, it may make sense to enable this feature by default for libraries specific to a platform where it is guaranteed to always be sound, for example in a hardware abstraction layer targeting a single-core chip.)
+
+  ARMv6-M (thumbv6m), pre-v6 ARM (e.g., thumbv4t, thumbv5te), RISC-V without A-extension, and Xtensa are currently supported.
+
+  Since all MSP430 and AVR are single-core, we always provide atomic CAS for them without this feature.
+
+  Enabling this feature for targets that have atomic CAS will result in a compile error.
+
+  Feel free to submit an issue if your target is not supported yet.
+
+## Optional cfg
+
+One of the ways to enable cfg is to set [rustflags in the cargo config](https://doc.rust-lang.org/cargo/reference/config.html#targettriplerustflags):
+
+```toml
+# .cargo/config.toml
+[target.<target>]
+rustflags = ["--cfg", "portable_atomic_no_outline_atomics"]
+```
+
+Or set environment variable:
+
+```sh
+RUSTFLAGS="--cfg portable_atomic_no_outline_atomics" cargo ...
+```
+
+- <a name="optional-cfg-unsafe-assume-single-core"></a>**`--cfg portable_atomic_unsafe_assume_single_core`**<br>
+  Since 1.4.0, this cfg is an alias of [`unsafe-assume-single-core` feature](#optional-features-unsafe-assume-single-core).
+
+  Originally, we were providing these as cfgs instead of features, but based on a strong request from the embedded ecosystem, we have agreed to provide them as features as well. See [#94](https://github.com/taiki-e/portable-atomic/pull/94) for more.
+
+- <a name="optional-cfg-no-outline-atomics"></a>**`--cfg portable_atomic_no_outline_atomics`**<br>
+  Disable dynamic dispatching by run-time CPU feature detection.
+
+  If dynamic dispatching by run-time CPU feature detection is enabled, it allows maintaining support for older CPUs while using features that are not supported on older CPUs, such as CMPXCHG16B (x86_64) and FEAT_LSE/FEAT_LSE2 (aarch64).
+
+  Note:
+  - Dynamic detection is currently only enabled in Rust 1.59+ for aarch64 and x86_64, nightly only for powerpc64 (disabled by default), otherwise it works the same as when this cfg is set.
+  - If the required target features are enabled at compile-time, the atomic operations are inlined.
+  - This is compatible with no-std (as with all features except `std`).
+  - On some targets, run-time detection is disabled by default mainly for compatibility with older versions of operating systems or incomplete build environments, and can be enabled by `--cfg portable_atomic_outline_atomics`. (When both cfg are enabled, `*_no_*` cfg is preferred.)
+  - Some aarch64 targets enable LLVM's `outline-atomics` target feature by default, so if you set this cfg, you may want to disable that as well. (portable-atomic's outline-atomics does not depend on the compiler-rt symbols, so even if you need to disable LLVM's outline-atomics, you may not need to disable portable-atomic's outline-atomics.)
+
+  See also the [`atomic128` module's readme](https://github.com/taiki-e/portable-atomic/blob/HEAD/src/imp/atomic128/README.md).
+
+## Related Projects
+
+- [atomic-maybe-uninit]: Atomic operations on potentially uninitialized integers.
+- [atomic-memcpy]: Byte-wise atomic memcpy.
+
+[#60]: https://github.com/taiki-e/portable-atomic/issues/60
+[atomic-maybe-uninit]: https://github.com/taiki-e/atomic-maybe-uninit
+[atomic-memcpy]: https://github.com/taiki-e/atomic-memcpy
+[critical-section]: https://github.com/rust-embedded/critical-section
+[rust-lang/rust#100650]: https://github.com/rust-lang/rust/issues/100650
+[serde]: https://github.com/serde-rs/serde
+
+<!-- tidy:crate-doc:end -->
+
+## License
+
+Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or
+[MIT license](LICENSE-MIT) at your option.
+
+Unless you explicitly state otherwise, any contribution intentionally submitted
+for inclusion in the work by you, as defined in the Apache-2.0 license, shall
+be dual licensed as above, without any additional terms or conditions.
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/build.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/build.rs
--- 43.0.0-1/rust-vendor/portable-atomic/build.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/build.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,481 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// The rustc-cfg emitted by the build script are *not* public API.
+
+#![allow(clippy::match_same_arms)] // https://github.com/rust-lang/rust-clippy/issues/12044
+
+#[path = "version.rs"]
+mod version;
+use version::{rustc_version, Version};
+
+use std::{env, str};
+
+include!("no_atomic.rs");
+
+fn main() {
+    println!("cargo:rerun-if-changed=build.rs");
+    println!("cargo:rerun-if-changed=no_atomic.rs");
+    println!("cargo:rerun-if-changed=version.rs");
+
+    #[cfg(feature = "unsafe-assume-single-core")]
+    println!("cargo:rustc-cfg=portable_atomic_unsafe_assume_single_core");
+    #[cfg(feature = "s-mode")]
+    println!("cargo:rustc-cfg=portable_atomic_s_mode");
+    #[cfg(feature = "force-amo")]
+    println!("cargo:rustc-cfg=portable_atomic_force_amo");
+    #[cfg(feature = "disable-fiq")]
+    println!("cargo:rustc-cfg=portable_atomic_disable_fiq");
+
+    let target = &*env::var("TARGET").expect("TARGET not set");
+    let target_arch = &*env::var("CARGO_CFG_TARGET_ARCH").expect("CARGO_CFG_TARGET_ARCH not set");
+    let target_os = &*env::var("CARGO_CFG_TARGET_OS").expect("CARGO_CFG_TARGET_OS not set");
+
+    let version = match rustc_version() {
+        Some(version) => version,
+        None => {
+            if env::var_os("PORTABLE_ATOMIC_DENY_WARNINGS").unwrap_or_default() == "1" {
+                panic!("unable to determine rustc version")
+            }
+            println!(
+                "cargo:warning={}: unable to determine rustc version; assuming latest stable rustc (1.{})",
+                env!("CARGO_PKG_NAME"),
+                Version::LATEST.minor
+            );
+            Version::LATEST
+        }
+    };
+
+    if version.minor >= 80 {
+        println!(
+            r#"cargo:rustc-check-cfg=cfg(target_feature,values("lse2","lse128","rcpc3","quadword-atomics","fast-serialization","load-store-on-cond","distinct-ops","miscellaneous-extensions-3"))"#
+        );
+
+        // Custom cfgs set by build script. Not public API.
+        // grep -E 'cargo:rustc-cfg=' build.rs | grep -v '=//' | sed -E 's/^.*cargo:rustc-cfg=//; s/(=\\)?".*$//' | LC_ALL=C sort -u | tr '\n' ','
+        println!(
+            "cargo:rustc-check-cfg=cfg(portable_atomic_disable_fiq,portable_atomic_force_amo,portable_atomic_ll_sc_rmw,portable_atomic_llvm_15,portable_atomic_llvm_16,portable_atomic_llvm_18,portable_atomic_new_atomic_intrinsics,portable_atomic_no_asm,portable_atomic_no_asm_maybe_uninit,portable_atomic_no_atomic_64,portable_atomic_no_atomic_cas,portable_atomic_no_atomic_load_store,portable_atomic_no_atomic_min_max,portable_atomic_no_cfg_target_has_atomic,portable_atomic_no_cmpxchg16b_intrinsic,portable_atomic_no_cmpxchg16b_target_feature,portable_atomic_no_const_raw_ptr_deref,portable_atomic_no_const_transmute,portable_atomic_no_core_unwind_safe,portable_atomic_no_stronger_failure_ordering,portable_atomic_no_track_caller,portable_atomic_no_unsafe_op_in_unsafe_fn,portable_atomic_s_mode,portable_atomic_sanitize_thread,portable_atomic_target_feature,portable_atomic_unsafe_assume_single_core,portable_atomic_unstable_asm,portable_atomic_unstable_asm_experimental_arch,portable_atomic_unstable_cfg_target_has_atomic,portable_atomic_unstable_isa_attribute)"
+        );
+        // TODO: handle multi-line target_feature_fallback
+        // grep -E 'target_feature_fallback\("' build.rs | sed -E 's/^.*target_feature_fallback\(//; s/",.*$/"/' | LC_ALL=C sort -u | tr '\n' ','
+        println!(
+            r#"cargo:rustc-check-cfg=cfg(portable_atomic_target_feature,values("cmpxchg16b","distinct-ops","fast-serialization","load-store-on-cond","lse","lse128","lse2","mclass","miscellaneous-extensions-3","quadword-atomics","rcpc3","v6"))"#
+        );
+    }
+
+    // https://github.com/rust-lang/rust/pull/123745 (includes https://github.com/rust-lang/cargo/pull/13560) merged in Rust 1.79 (nightly-2024-04-11).
+    if !version.probe(79, 2024, 4, 10) {
+        // HACK: If --target is specified, rustflags is not applied to the build
+        // script itself, so the build script will not be recompiled when rustflags
+        // is changed. That in itself is not a problem, but the old Cargo does
+        // not rerun the build script as well, which can be problematic.
+        // https://github.com/rust-lang/cargo/issues/13003
+        // This problem has been fixed in 1.79 so only older versions need a workaround.
+        println!("cargo:rerun-if-env-changed=CARGO_ENCODED_RUSTFLAGS");
+        println!("cargo:rerun-if-env-changed=RUSTFLAGS");
+        println!("cargo:rerun-if-env-changed=CARGO_BUILD_RUSTFLAGS");
+        let mut target_upper = target.replace(|c: char| c == '-' || c == '.', "_");
+        target_upper.make_ascii_uppercase();
+        println!("cargo:rerun-if-env-changed=CARGO_TARGET_{}_RUSTFLAGS", target_upper);
+    }
+
+    // Note that this is `no_`*, not `has_*`. This allows treating as the latest
+    // stable rustc is used when the build script doesn't run. This is useful
+    // for non-cargo build systems that don't run the build script.
+    // atomic_min_max stabilized in Rust 1.45 (nightly-2020-05-30): https://github.com/rust-lang/rust/pull/72324
+    if !version.probe(45, 2020, 5, 29) {
+        println!("cargo:rustc-cfg=portable_atomic_no_atomic_min_max");
+    }
+    // track_caller stabilized in Rust 1.46 (nightly-2020-07-02): https://github.com/rust-lang/rust/pull/72445
+    if !version.probe(46, 2020, 7, 1) {
+        println!("cargo:rustc-cfg=portable_atomic_no_track_caller");
+    }
+    // unsafe_op_in_unsafe_fn stabilized in Rust 1.52 (nightly-2021-03-11): https://github.com/rust-lang/rust/pull/79208
+    if !version.probe(52, 2021, 3, 10) {
+        println!("cargo:rustc-cfg=portable_atomic_no_unsafe_op_in_unsafe_fn");
+    }
+    // const_transmute stabilized in Rust 1.56 (nightly-2021-07-29): https://github.com/rust-lang/rust/pull/85769
+    if !version.probe(56, 2021, 7, 28) {
+        println!("cargo:rustc-cfg=portable_atomic_no_const_transmute");
+    }
+    // https://github.com/rust-lang/rust/pull/84662 merged in Rust 1.56 (nightly-2021-08-02).
+    if !version.probe(56, 2021, 8, 1) {
+        println!("cargo:rustc-cfg=portable_atomic_no_core_unwind_safe");
+    }
+    // const_raw_ptr_deref stabilized in Rust 1.58 (nightly-2021-11-15): https://github.com/rust-lang/rust/pull/89551
+    if !version.probe(58, 2021, 11, 14) {
+        println!("cargo:rustc-cfg=portable_atomic_no_const_raw_ptr_deref");
+    }
+    // https://github.com/rust-lang/rust/pull/98383 merged in Rust 1.64 (nightly-2022-07-19).
+    if !version.probe(64, 2022, 7, 18) {
+        println!("cargo:rustc-cfg=portable_atomic_no_stronger_failure_ordering");
+    }
+    // https://github.com/rust-lang/rust/pull/114790 merged in nightly-2023-08-24
+    if !version.probe(74, 2023, 8, 23) {
+        println!("cargo:rustc-cfg=portable_atomic_no_asm_maybe_uninit");
+    }
+
+    // asm stabilized in Rust 1.59 (nightly-2021-12-16): https://github.com/rust-lang/rust/pull/91728
+    let no_asm = !version.probe(59, 2021, 12, 15);
+    if no_asm {
+        if version.nightly
+            && version.probe(46, 2020, 6, 20)
+            && ((target_arch != "x86" && target_arch != "x86_64") || version.llvm >= 10)
+            && is_allowed_feature("asm")
+        {
+            // This feature was added in Rust 1.45 (nightly-2020-05-20), but
+            // concat! in asm! requires Rust 1.46 (nightly-2020-06-21).
+            // x86 intel syntax requires LLVM 10 (since Rust 1.53, the minimum
+            // external LLVM version is 10+: https://github.com/rust-lang/rust/pull/83387).
+            // The part of this feature we use has not been changed since nightly-2020-06-21
+            // until it was stabilized in nightly-2021-12-16, so it can be safely enabled in
+            // nightly, which is older than nightly-2021-12-16.
+            println!("cargo:rustc-cfg=portable_atomic_unstable_asm");
+        }
+        println!("cargo:rustc-cfg=portable_atomic_no_asm");
+    }
+
+    // feature(cfg_target_has_atomic) stabilized in Rust 1.60 (nightly-2022-02-11): https://github.com/rust-lang/rust/pull/93824
+    if !version.probe(60, 2022, 2, 10) {
+        if version.nightly
+            && version.probe(40, 2019, 10, 13)
+            && is_allowed_feature("cfg_target_has_atomic")
+        {
+            // This feature has not been changed since the change in Rust 1.40 (nightly-2019-10-14)
+            // until it was stabilized in nightly-2022-02-11, so it can be safely enabled in
+            // nightly, which is older than nightly-2022-02-11.
+            println!("cargo:rustc-cfg=portable_atomic_unstable_cfg_target_has_atomic");
+        } else {
+            println!("cargo:rustc-cfg=portable_atomic_no_cfg_target_has_atomic");
+            let target = &*convert_custom_linux_target(target);
+            if NO_ATOMIC_CAS.contains(&target) {
+                println!("cargo:rustc-cfg=portable_atomic_no_atomic_cas");
+            }
+            if NO_ATOMIC_64.contains(&target) {
+                println!("cargo:rustc-cfg=portable_atomic_no_atomic_64");
+            } else {
+                // Otherwise, assuming `"max-atomic-width" == 64` or `"max-atomic-width" == 128`.
+            }
+        }
+    }
+    // We don't need to use convert_custom_linux_target here because all linux targets have atomics.
+    if NO_ATOMIC.contains(&target) {
+        println!("cargo:rustc-cfg=portable_atomic_no_atomic_load_store");
+    }
+
+    if version.llvm >= 16 {
+        println!("cargo:rustc-cfg=portable_atomic_llvm_16");
+    }
+    if version.nightly {
+        // `cfg(sanitize = "..")` is not stabilized.
+        let sanitize = env::var("CARGO_CFG_SANITIZE").unwrap_or_default();
+        if sanitize.contains("thread") {
+            // Most kinds of sanitizers are not compatible with asm
+            // (https://github.com/google/sanitizers/issues/192),
+            // but it seems that ThreadSanitizer is the only one that can cause
+            // false positives in our code.
+            println!("cargo:rustc-cfg=portable_atomic_sanitize_thread");
+        }
+
+        // https://github.com/rust-lang/rust/pull/93868 merged in Rust 1.60 (nightly-2022-02-13).
+        // https://github.com/rust-lang/rust/pull/111331 merged in Rust 1.71 (nightly-2023-05-09).
+        if !no_asm
+            && (target_arch == "powerpc64" && version.probe(60, 2022, 2, 12)
+                || target_arch == "s390x" && version.probe(71, 2023, 5, 8))
+            && is_allowed_feature("asm_experimental_arch")
+        {
+            println!("cargo:rustc-cfg=portable_atomic_unstable_asm_experimental_arch");
+        }
+    }
+
+    let is_macos = target_os == "macos";
+    let is_apple = is_macos
+        || target_os == "ios"
+        || target_os == "tvos"
+        || target_os == "watchos"
+        || target_os == "visionos";
+    match target_arch {
+        "x86_64" => {
+            // cmpxchg16b_target_feature stabilized in Rust 1.69 (nightly-2023-03-01): https://github.com/rust-lang/rust/pull/106774
+            if !version.probe(69, 2023, 2, 28) {
+                println!("cargo:rustc-cfg=portable_atomic_no_cmpxchg16b_target_feature");
+            }
+            // For Miri and ThreadSanitizer.
+            // https://github.com/rust-lang/rust/pull/109359 (includes https://github.com/rust-lang/stdarch/pull/1358) merged in Rust 1.70 (nightly-2023-03-24).
+            if version.nightly && !version.probe(70, 2023, 3, 23) {
+                println!("cargo:rustc-cfg=portable_atomic_no_cmpxchg16b_intrinsic");
+            }
+
+            // cmpxchg16b_target_feature stabilized in Rust 1.69.
+            if needs_target_feature_fallback(&version, Some(69)) {
+                // x86_64 Apple targets always support CMPXCHG16B:
+                // https://github.com/rust-lang/rust/blob/1.68.0/compiler/rustc_target/src/spec/x86_64_apple_darwin.rs#L8
+                // https://github.com/rust-lang/rust/blob/1.68.0/compiler/rustc_target/src/spec/apple_base.rs#L69-L70
+                // (Since Rust 1.78, Windows (except Windows 7) targets also enable CMPXCHG16B, but
+                // this branch is only used on pre-1.69 that cmpxchg16b_target_feature is unstable.)
+                // Script to get targets that support cmpxchg16b by default:
+                // $ (for target in $(rustc --print target-list); do [[ "${target}" == "x86_64"* ]] && rustc --print cfg --target "${target}" | grep -q cmpxchg16b && echo "${target}"; done)
+                let has_cmpxchg16b = is_apple;
+                // LLVM recognizes this also as cx16 target feature: https://godbolt.org/z/KM3jz616j
+                // However, it is unlikely that rustc will support that name, so we ignore it.
+                target_feature_fallback("cmpxchg16b", has_cmpxchg16b);
+            }
+        }
+        "aarch64" => {
+            // For Miri and ThreadSanitizer.
+            // https://github.com/rust-lang/rust/pull/97423 merged in Rust 1.64 (nightly-2022-06-30).
+            if version.nightly && version.probe(64, 2022, 6, 29) {
+                println!("cargo:rustc-cfg=portable_atomic_new_atomic_intrinsics");
+            }
+
+            // aarch64 macOS always supports FEAT_LSE and FEAT_LSE2 because it is armv8.5-a:
+            // https://github.com/llvm/llvm-project/blob/llvmorg-18.1.2/llvm/include/llvm/TargetParser/AArch64TargetParser.h#L728
+            let mut has_lse = is_macos;
+            // FEAT_LSE2 doesn't imply FEAT_LSE. FEAT_LSE128 implies FEAT_LSE but not FEAT_LSE2.
+            // As of rustc 1.78, target_feature "lse2"/"lse128"/"rcpc3" is not available on rustc side:
+            // https://github.com/rust-lang/rust/blob/1.78.0/compiler/rustc_target/src/target_features.rs#L87
+            target_feature_fallback("lse2", is_macos);
+            // LLVM supports FEAT_LRCPC3 and FEAT_LSE128 on LLVM 16+:
+            // https://github.com/llvm/llvm-project/commit/a6aaa969f7caec58a994142f8d855861cf3a1463
+            // https://github.com/llvm/llvm-project/commit/7fea6f2e0e606e5339c3359568f680eaf64aa306
+            if version.llvm >= 16 {
+                has_lse |= target_feature_fallback("lse128", false);
+                target_feature_fallback("rcpc3", false);
+            }
+            // aarch64_target_feature stabilized in Rust 1.61.
+            if needs_target_feature_fallback(&version, Some(61)) {
+                target_feature_fallback("lse", has_lse);
+            }
+
+            // As of Apple M1/M1 Pro, on Apple hardware, CAS-loop-based RMW is much slower than
+            // LL/SC-loop-based RMW: https://github.com/taiki-e/portable-atomic/pull/89
+            if is_apple || target_cpu().map_or(false, |cpu| cpu.starts_with("apple-")) {
+                println!("cargo:rustc-cfg=portable_atomic_ll_sc_rmw");
+            }
+        }
+        "arm" => {
+            // For non-Linux/Android pre-v6 ARM (tier 3) with unsafe_assume_single_core enabled.
+            // feature(isa_attribute) stabilized in Rust 1.67 (nightly-2022-11-06): https://github.com/rust-lang/rust/pull/102458
+            if version.nightly && !version.probe(67, 2022, 11, 5) {
+                println!("cargo:rustc-cfg=portable_atomic_unstable_isa_attribute");
+            }
+
+            if needs_target_feature_fallback(&version, None) {
+                // #[cfg(target_feature = "v7")] and others don't work on stable.
+                // armv7-unknown-linux-gnueabihf
+                //    ^^
+                let mut subarch =
+                    strip_prefix(target, "arm").or_else(|| strip_prefix(target, "thumb")).unwrap();
+                subarch = strip_prefix(subarch, "eb").unwrap_or(subarch); // ignore endianness
+                subarch = subarch.split('-').next().unwrap(); // ignore vender/os/env
+                subarch = subarch.split('.').next().unwrap(); // ignore .base/.main suffix
+                let mut known = true;
+                // See https://github.com/taiki-e/atomic-maybe-uninit/blob/HEAD/build.rs for details
+                let mut mclass = false;
+                match subarch {
+                    "v7" | "v7a" | "v7neon" | "v7s" | "v7k" | "v8" | "v8a" | "v9" | "v9a" => {} // aclass
+                    "v7r" | "v8r" | "v9r" => {} // rclass
+                    "v6m" | "v7em" | "v7m" | "v8m" => mclass = true,
+                    // arm-linux-androideabi is v5te
+                    // https://github.com/rust-lang/rust/blob/1.78.0/compiler/rustc_target/src/spec/targets/arm_linux_androideabi.rs#L18
+                    _ if target == "arm-linux-androideabi" => subarch = "v5te",
+                    // armeb-unknown-linux-gnueabi is v8 & aclass
+                    // https://github.com/rust-lang/rust/blob/1.78.0/compiler/rustc_target/src/spec/targets/armeb_unknown_linux_gnueabi.rs#L18
+                    _ if target == "armeb-unknown-linux-gnueabi" => subarch = "v8",
+                    // Legacy arm architectures (pre-v7 except v6m) don't have *class target feature.
+                    "" => subarch = "v6",
+                    "v4t" | "v5te" | "v6" | "v6k" => {}
+                    _ => {
+                        known = false;
+                        if env::var_os("PORTABLE_ATOMIC_DENY_WARNINGS").unwrap_or_default() == "1" {
+                            panic!("unrecognized arm subarch: {}", target)
+                        }
+                        println!(
+                            "cargo:warning={}: unrecognized arm subarch: {}",
+                            env!("CARGO_PKG_NAME"),
+                            target
+                        );
+                    }
+                }
+                let v6 = known
+                    && (subarch.starts_with("v6")
+                        || subarch.starts_with("v7")
+                        || subarch.starts_with("v8")
+                        || subarch.starts_with("v9"));
+                target_feature_fallback("v6", v6);
+                target_feature_fallback("mclass", mclass);
+            }
+        }
+        "powerpc64" => {
+            // For Miri and ThreadSanitizer.
+            if version.nightly && version.llvm >= 15 {
+                println!("cargo:rustc-cfg=portable_atomic_llvm_15");
+            }
+
+            let target_endian =
+                env::var("CARGO_CFG_TARGET_ENDIAN").expect("CARGO_CFG_TARGET_ENDIAN not set");
+            // powerpc64le is pwr8+ by default https://github.com/llvm/llvm-project/blob/llvmorg-18.1.2/llvm/lib/Target/PowerPC/PPC.td#L674
+            // See also https://github.com/rust-lang/rust/issues/59932
+            let mut has_pwr8_features = target_endian == "little";
+            // https://github.com/llvm/llvm-project/commit/549e118e93c666914a1045fde38a2cac33e1e445
+            if let Some(cpu) = &target_cpu() {
+                if let Some(mut cpu_version) = strip_prefix(cpu, "pwr") {
+                    cpu_version = strip_suffix(cpu_version, "x").unwrap_or(cpu_version); // for pwr5x and pwr6x
+                    if let Ok(cpu_version) = cpu_version.parse::<u32>() {
+                        has_pwr8_features = cpu_version >= 8;
+                    }
+                } else {
+                    // https://github.com/llvm/llvm-project/blob/llvmorg-18.1.2/llvm/lib/Target/PowerPC/PPC.td#L674
+                    // https://github.com/llvm/llvm-project/blob/llvmorg-18.1.2/llvm/lib/Target/PowerPC/PPC.td#L456
+                    has_pwr8_features = cpu == "ppc64le" || cpu == "future";
+                }
+            }
+            // As of rustc 1.78, target_feature "quadword-atomics" is not available on rustc side:
+            // https://github.com/rust-lang/rust/blob/1.78.0/compiler/rustc_target/src/target_features.rs#L255
+            // lqarx and stqcx.
+            target_feature_fallback("quadword-atomics", has_pwr8_features);
+        }
+        "s390x" => {
+            // For Miri and ThreadSanitizer.
+            if version.nightly && version.llvm >= 18 {
+                println!("cargo:rustc-cfg=portable_atomic_llvm_18");
+            }
+
+            // https://github.com/llvm/llvm-project/blob/llvmorg-18.1.2/llvm/lib/Target/SystemZ/SystemZFeatures.td
+            let mut arch9_features = false; // z196+
+            let mut arch13_features = false; // z15+
+            if let Some(cpu) = target_cpu() {
+                // https://github.com/llvm/llvm-project/blob/llvmorg-18.1.2/llvm/lib/Target/SystemZ/SystemZProcessors.td
+                match &*cpu {
+                    "arch9" | "z196" | "arch10" | "zEC12" | "arch11" | "z13" | "arch12" | "z14" => {
+                        arch9_features = true;
+                    }
+                    "arch13" | "z15" | "arch14" | "z16" => {
+                        arch9_features = true;
+                        arch13_features = true;
+                    }
+                    _ => {}
+                }
+            }
+            // As of rustc 1.78, target_feature "fast-serialization"/"load-store-on-cond"/"distinct-ops"/"miscellaneous-extensions-3" is not available on rustc side:
+            // https://github.com/rust-lang/rust/blob/1.78.0/compiler/rustc_target/src/target_features.rs
+            // bcr 14,0
+            target_feature_fallback("fast-serialization", arch9_features);
+            // {l,st}oc{,g}{,r}
+            target_feature_fallback("load-store-on-cond", arch9_features);
+            // {al,sl,n,o,x}{,g}rk
+            target_feature_fallback("distinct-ops", arch9_features);
+            // nand (nnr{,g}k), select (sel{,g}r), etc.
+            target_feature_fallback("miscellaneous-extensions-3", arch13_features);
+        }
+        _ => {}
+    }
+}
+
+// HACK: Currently, it seems that the only way to handle unstable target
+// features on the stable is to parse the `-C target-feature` in RUSTFLAGS.
+//
+// - #[cfg(target_feature = "unstable_target_feature")] doesn't work on stable.
+// - CARGO_CFG_TARGET_FEATURE excludes unstable target features on stable.
+//
+// As mentioned in the [RFC2045], unstable target features are also passed to LLVM
+// (e.g., https://godbolt.org/z/4rr7rMcfG), so this hack works properly on stable.
+//
+// [RFC2045]: https://rust-lang.github.io/rfcs/2045-target-feature.html#backend-compilation-options
+fn needs_target_feature_fallback(version: &Version, stable: Option<u32>) -> bool {
+    match stable {
+        // In these cases, cfg(target_feature = "...") would work, so skip emitting our own fallback target_feature cfg.
+        _ if version.nightly => false,
+        Some(stabilized) if version.minor >= stabilized => false,
+        _ => true,
+    }
+}
+fn target_feature_fallback(name: &str, mut has_target_feature: bool) -> bool {
+    if let Some(rustflags) = env::var_os("CARGO_ENCODED_RUSTFLAGS") {
+        for mut flag in rustflags.to_string_lossy().split('\x1f') {
+            flag = strip_prefix(flag, "-C").unwrap_or(flag);
+            if let Some(flag) = strip_prefix(flag, "target-feature=") {
+                for s in flag.split(',') {
+                    // TODO: Handles cases where a specific target feature
+                    // implicitly enables another target feature.
+                    match (s.as_bytes().first(), s.as_bytes().get(1..)) {
+                        (Some(b'+'), Some(f)) if f == name.as_bytes() => has_target_feature = true,
+                        (Some(b'-'), Some(f)) if f == name.as_bytes() => has_target_feature = false,
+                        _ => {}
+                    }
+                }
+            }
+        }
+    }
+    if has_target_feature {
+        println!("cargo:rustc-cfg=portable_atomic_target_feature=\"{}\"", name);
+    }
+    has_target_feature
+}
+
+fn target_cpu() -> Option<String> {
+    let rustflags = env::var_os("CARGO_ENCODED_RUSTFLAGS")?;
+    let rustflags = rustflags.to_string_lossy();
+    let mut cpu = None;
+    for mut flag in rustflags.split('\x1f') {
+        flag = strip_prefix(flag, "-C").unwrap_or(flag);
+        if let Some(flag) = strip_prefix(flag, "target-cpu=") {
+            cpu = Some(flag);
+        }
+    }
+    cpu.map(str::to_owned)
+}
+
+fn is_allowed_feature(name: &str) -> bool {
+    // https://github.com/dtolnay/thiserror/pull/248
+    if env::var_os("RUSTC_STAGE").is_some() {
+        return false;
+    }
+
+    // allowed by default
+    let mut allowed = true;
+    if let Some(rustflags) = env::var_os("CARGO_ENCODED_RUSTFLAGS") {
+        for mut flag in rustflags.to_string_lossy().split('\x1f') {
+            flag = strip_prefix(flag, "-Z").unwrap_or(flag);
+            if let Some(flag) = strip_prefix(flag, "allow-features=") {
+                // If it is specified multiple times, the last value will be preferred.
+                allowed = flag.split(',').any(|allowed| allowed == name);
+            }
+        }
+    }
+    allowed
+}
+
+// Adapted from https://github.com/crossbeam-rs/crossbeam/blob/crossbeam-utils-0.8.14/build-common.rs.
+//
+// The target triplets have the form of 'arch-vendor-system'.
+//
+// When building for Linux (e.g. the 'system' part is
+// 'linux-something'), replace the vendor with 'unknown'
+// so that mapping to rust standard targets happens correctly.
+fn convert_custom_linux_target(target: &str) -> String {
+    let mut parts: Vec<&str> = target.split('-').collect();
+    let system = parts.get(2);
+    if system == Some(&"linux") {
+        parts[1] = "unknown";
+    }
+    parts.join("-")
+}
+
+// str::strip_prefix requires Rust 1.45
+#[must_use]
+fn strip_prefix<'a>(s: &'a str, pat: &str) -> Option<&'a str> {
+    if s.starts_with(pat) {
+        Some(&s[pat.len()..])
+    } else {
+        None
+    }
+}
+// str::strip_suffix requires Rust 1.45
+#[must_use]
+fn strip_suffix<'a>(s: &'a str, pat: &str) -> Option<&'a str> {
+    if s.ends_with(pat) {
+        Some(&s[..s.len() - pat.len()])
+    } else {
+        None
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/no_atomic.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/no_atomic.rs
--- 43.0.0-1/rust-vendor/portable-atomic/no_atomic.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/no_atomic.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,76 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+// This file is @generated by no_atomic.sh.
+// It is not intended for manual editing.
+
+// Note: This is the list as of nightly-2022-02-10. We don't refer to this in
+// nightly-2022-02-11+ because feature(cfg_target_has_atomic) stabilized.
+#[rustfmt::skip]
+static NO_ATOMIC_CAS: &[&str] = &[
+    "avr-unknown-gnu-atmega328",
+    "bpfeb-unknown-none",
+    "bpfel-unknown-none",
+    "msp430-none-elf",
+    "riscv32i-unknown-none-elf",
+    "riscv32imc-unknown-none-elf",
+    "thumbv4t-none-eabi",
+    "thumbv6m-none-eabi",
+];
+
+// Note: This is the list as of nightly-2022-02-10. We don't refer to this in
+// nightly-2022-02-11+ because feature(cfg_target_has_atomic) stabilized.
+#[rustfmt::skip]
+static NO_ATOMIC_64: &[&str] = &[
+    "arm-linux-androideabi",
+    "armebv7r-none-eabi",
+    "armebv7r-none-eabihf",
+    "armv4t-unknown-linux-gnueabi",
+    "armv5te-unknown-linux-gnueabi",
+    "armv5te-unknown-linux-musleabi",
+    "armv5te-unknown-linux-uclibceabi",
+    "armv6k-nintendo-3ds",
+    "armv7r-none-eabi",
+    "armv7r-none-eabihf",
+    "avr-unknown-gnu-atmega328",
+    "hexagon-unknown-linux-musl",
+    "m68k-unknown-linux-gnu",
+    "mips-unknown-linux-gnu",
+    "mips-unknown-linux-musl",
+    "mips-unknown-linux-uclibc",
+    "mipsel-sony-psp",
+    "mipsel-unknown-linux-gnu",
+    "mipsel-unknown-linux-musl",
+    "mipsel-unknown-linux-uclibc",
+    "mipsel-unknown-none",
+    "mipsisa32r6-unknown-linux-gnu",
+    "mipsisa32r6el-unknown-linux-gnu",
+    "msp430-none-elf",
+    "powerpc-unknown-freebsd",
+    "powerpc-unknown-linux-gnu",
+    "powerpc-unknown-linux-gnuspe",
+    "powerpc-unknown-linux-musl",
+    "powerpc-unknown-netbsd",
+    "powerpc-unknown-openbsd",
+    "powerpc-wrs-vxworks",
+    "powerpc-wrs-vxworks-spe",
+    "riscv32gc-unknown-linux-gnu",
+    "riscv32gc-unknown-linux-musl",
+    "riscv32i-unknown-none-elf",
+    "riscv32imac-unknown-none-elf",
+    "riscv32imc-esp-espidf",
+    "riscv32imc-unknown-none-elf",
+    "thumbv4t-none-eabi",
+    "thumbv6m-none-eabi",
+    "thumbv7em-none-eabi",
+    "thumbv7em-none-eabihf",
+    "thumbv7m-none-eabi",
+    "thumbv8m.base-none-eabi",
+    "thumbv8m.main-none-eabi",
+    "thumbv8m.main-none-eabihf",
+];
+
+#[rustfmt::skip]
+static NO_ATOMIC: &[&str] = &[
+    "bpfeb-unknown-none",
+    "bpfel-unknown-none",
+    "mipsel-sony-psx",
+];
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/cfgs.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/cfgs.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/cfgs.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/cfgs.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,487 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+#![allow(missing_docs)]
+
+#[cfg(not(all(
+    portable_atomic_no_atomic_load_store,
+    not(any(
+        target_arch = "avr",
+        target_arch = "msp430",
+        target_arch = "riscv32",
+        target_arch = "riscv64",
+        feature = "critical-section",
+    )),
+)))]
+#[macro_use]
+mod atomic_8_16_macros {
+    #[macro_export]
+    macro_rules! cfg_has_atomic_8 {
+        ($($tt:tt)*) => {
+            $($tt)*
+        };
+    }
+    #[macro_export]
+    macro_rules! cfg_no_atomic_8 {
+        ($($tt:tt)*) => {};
+    }
+    #[macro_export]
+    macro_rules! cfg_has_atomic_16 {
+        ($($tt:tt)*) => {
+            $($tt)*
+        };
+    }
+    #[macro_export]
+    macro_rules! cfg_no_atomic_16 {
+        ($($tt:tt)*) => {};
+    }
+}
+#[cfg(all(
+    portable_atomic_no_atomic_load_store,
+    not(any(
+        target_arch = "avr",
+        target_arch = "msp430",
+        target_arch = "riscv32",
+        target_arch = "riscv64",
+        feature = "critical-section",
+    )),
+))]
+#[macro_use]
+mod atomic_8_16_macros {
+    #[macro_export]
+    macro_rules! cfg_has_atomic_8 {
+        ($($tt:tt)*) => {};
+    }
+    #[macro_export]
+    macro_rules! cfg_no_atomic_8 {
+        ($($tt:tt)*) => {
+            $($tt)*
+        };
+    }
+    #[macro_export]
+    macro_rules! cfg_has_atomic_16 {
+        ($($tt:tt)*) => {};
+    }
+    #[macro_export]
+    macro_rules! cfg_no_atomic_16 {
+        ($($tt:tt)*) => {
+            $($tt)*
+        };
+    }
+}
+
+#[cfg(all(
+    any(not(target_pointer_width = "16"), feature = "fallback"),
+    not(all(
+        portable_atomic_no_atomic_load_store,
+        not(any(
+            target_arch = "avr",
+            target_arch = "msp430",
+            target_arch = "riscv32",
+            target_arch = "riscv64",
+            feature = "critical-section",
+        )),
+    )),
+))]
+#[macro_use]
+mod atomic_32_macros {
+    #[macro_export]
+    macro_rules! cfg_has_atomic_32 {
+        ($($tt:tt)*) => {
+            $($tt)*
+        };
+    }
+    #[macro_export]
+    macro_rules! cfg_no_atomic_32 {
+        ($($tt:tt)*) => {};
+    }
+}
+#[cfg(not(all(
+    any(not(target_pointer_width = "16"), feature = "fallback"),
+    not(all(
+        portable_atomic_no_atomic_load_store,
+        not(any(
+            target_arch = "avr",
+            target_arch = "msp430",
+            target_arch = "riscv32",
+            target_arch = "riscv64",
+            feature = "critical-section",
+        )),
+    )),
+)))]
+#[macro_use]
+mod atomic_32_macros {
+    #[macro_export]
+    macro_rules! cfg_has_atomic_32 {
+        ($($tt:tt)*) => {};
+    }
+    #[macro_export]
+    macro_rules! cfg_no_atomic_32 {
+        ($($tt:tt)*) => {
+            $($tt)*
+        };
+    }
+}
+
+#[cfg_attr(
+    portable_atomic_no_cfg_target_has_atomic,
+    cfg(any(
+        all(
+            feature = "fallback",
+            any(
+                not(portable_atomic_no_atomic_cas),
+                portable_atomic_unsafe_assume_single_core,
+                feature = "critical-section",
+                target_arch = "avr",
+                target_arch = "msp430",
+            ),
+        ),
+        not(portable_atomic_no_atomic_64),
+        not(any(target_pointer_width = "16", target_pointer_width = "32")),
+    ))
+)]
+#[cfg_attr(
+    not(portable_atomic_no_cfg_target_has_atomic),
+    cfg(any(
+        all(
+            feature = "fallback",
+            any(
+                target_has_atomic = "ptr",
+                portable_atomic_unsafe_assume_single_core,
+                feature = "critical-section",
+                target_arch = "avr",
+                target_arch = "msp430",
+            ),
+        ),
+        target_has_atomic = "64",
+        not(any(target_pointer_width = "16", target_pointer_width = "32")),
+    ))
+)]
+#[macro_use]
+mod atomic_64_macros {
+    #[macro_export]
+    macro_rules! cfg_has_atomic_64 {
+        ($($tt:tt)*) => {
+            $($tt)*
+        };
+    }
+    #[macro_export]
+    macro_rules! cfg_no_atomic_64 {
+        ($($tt:tt)*) => {};
+    }
+}
+#[cfg_attr(
+    portable_atomic_no_cfg_target_has_atomic,
+    cfg(not(any(
+        all(
+            feature = "fallback",
+            any(
+                not(portable_atomic_no_atomic_cas),
+                portable_atomic_unsafe_assume_single_core,
+                feature = "critical-section",
+                target_arch = "avr",
+                target_arch = "msp430",
+            ),
+        ),
+        not(portable_atomic_no_atomic_64),
+        not(any(target_pointer_width = "16", target_pointer_width = "32")),
+    )))
+)]
+#[cfg_attr(
+    not(portable_atomic_no_cfg_target_has_atomic),
+    cfg(not(any(
+        all(
+            feature = "fallback",
+            any(
+                target_has_atomic = "ptr",
+                portable_atomic_unsafe_assume_single_core,
+                feature = "critical-section",
+                target_arch = "avr",
+                target_arch = "msp430",
+            ),
+        ),
+        target_has_atomic = "64",
+        not(any(target_pointer_width = "16", target_pointer_width = "32")),
+    )))
+)]
+#[macro_use]
+mod atomic_64_macros {
+    #[macro_export]
+    macro_rules! cfg_has_atomic_64 {
+        ($($tt:tt)*) => {};
+    }
+    #[macro_export]
+    macro_rules! cfg_no_atomic_64 {
+        ($($tt:tt)*) => {
+            $($tt)*
+        };
+    }
+}
+
+#[cfg_attr(
+    not(feature = "fallback"),
+    cfg(any(
+        all(
+            target_arch = "aarch64",
+            any(not(portable_atomic_no_asm), portable_atomic_unstable_asm),
+        ),
+        all(
+            target_arch = "x86_64",
+            not(all(
+                any(miri, portable_atomic_sanitize_thread),
+                portable_atomic_no_cmpxchg16b_intrinsic,
+            )),
+            any(not(portable_atomic_no_asm), portable_atomic_unstable_asm),
+            any(
+                target_feature = "cmpxchg16b",
+                portable_atomic_target_feature = "cmpxchg16b",
+                all(
+                    feature = "fallback",
+                    not(portable_atomic_no_outline_atomics),
+                    not(any(target_env = "sgx", miri)),
+                ),
+            ),
+        ),
+        all(
+            target_arch = "powerpc64",
+            portable_atomic_unstable_asm_experimental_arch,
+            any(
+                target_feature = "quadword-atomics",
+                portable_atomic_target_feature = "quadword-atomics",
+                all(
+                    feature = "fallback",
+                    not(portable_atomic_no_outline_atomics),
+                    portable_atomic_outline_atomics, // TODO(powerpc64): currently disabled by default
+                    any(
+                        all(
+                            target_os = "linux",
+                            any(
+                                target_env = "gnu",
+                                all(
+                                    any(target_env = "musl", target_env = "ohos"),
+                                    not(target_feature = "crt-static"),
+                                ),
+                                portable_atomic_outline_atomics,
+                            ),
+                        ),
+                        target_os = "android",
+                        target_os = "freebsd",
+                    ),
+                    not(any(miri, portable_atomic_sanitize_thread)),
+                ),
+            ),
+        ),
+        all(target_arch = "s390x", portable_atomic_unstable_asm_experimental_arch),
+    ))
+)]
+#[cfg_attr(
+    all(feature = "fallback", portable_atomic_no_cfg_target_has_atomic),
+    cfg(any(
+        not(portable_atomic_no_atomic_cas),
+        portable_atomic_unsafe_assume_single_core,
+        feature = "critical-section",
+        target_arch = "avr",
+        target_arch = "msp430",
+    ))
+)]
+#[cfg_attr(
+    all(feature = "fallback", not(portable_atomic_no_cfg_target_has_atomic)),
+    cfg(any(
+        target_has_atomic = "ptr",
+        portable_atomic_unsafe_assume_single_core,
+        feature = "critical-section",
+        target_arch = "avr",
+        target_arch = "msp430",
+    ))
+)]
+#[macro_use]
+mod atomic_128_macros {
+    #[macro_export]
+    macro_rules! cfg_has_atomic_128 {
+        ($($tt:tt)*) => {
+            $($tt)*
+        };
+    }
+    #[macro_export]
+    macro_rules! cfg_no_atomic_128 {
+        ($($tt:tt)*) => {};
+    }
+}
+#[cfg_attr(
+    not(feature = "fallback"),
+    cfg(not(any(
+        all(
+            target_arch = "aarch64",
+            any(not(portable_atomic_no_asm), portable_atomic_unstable_asm),
+        ),
+        all(
+            target_arch = "x86_64",
+            not(all(
+                any(miri, portable_atomic_sanitize_thread),
+                portable_atomic_no_cmpxchg16b_intrinsic,
+            )),
+            any(not(portable_atomic_no_asm), portable_atomic_unstable_asm),
+            any(
+                target_feature = "cmpxchg16b",
+                portable_atomic_target_feature = "cmpxchg16b",
+                all(
+                    feature = "fallback",
+                    not(portable_atomic_no_outline_atomics),
+                    not(any(target_env = "sgx", miri)),
+                ),
+            ),
+        ),
+        all(
+            target_arch = "powerpc64",
+            portable_atomic_unstable_asm_experimental_arch,
+            any(
+                target_feature = "quadword-atomics",
+                portable_atomic_target_feature = "quadword-atomics",
+                all(
+                    feature = "fallback",
+                    not(portable_atomic_no_outline_atomics),
+                    portable_atomic_outline_atomics, // TODO(powerpc64): currently disabled by default
+                    any(
+                        all(
+                            target_os = "linux",
+                            any(
+                                target_env = "gnu",
+                                all(
+                                    any(target_env = "musl", target_env = "ohos"),
+                                    not(target_feature = "crt-static"),
+                                ),
+                                portable_atomic_outline_atomics,
+                            ),
+                        ),
+                        target_os = "android",
+                        target_os = "freebsd",
+                    ),
+                    not(any(miri, portable_atomic_sanitize_thread)),
+                ),
+            ),
+        ),
+        all(target_arch = "s390x", portable_atomic_unstable_asm_experimental_arch),
+    )))
+)]
+#[cfg_attr(
+    all(feature = "fallback", portable_atomic_no_cfg_target_has_atomic),
+    cfg(not(any(
+        not(portable_atomic_no_atomic_cas),
+        portable_atomic_unsafe_assume_single_core,
+        feature = "critical-section",
+        target_arch = "avr",
+        target_arch = "msp430",
+    )))
+)]
+#[cfg_attr(
+    all(feature = "fallback", not(portable_atomic_no_cfg_target_has_atomic)),
+    cfg(not(any(
+        target_has_atomic = "ptr",
+        portable_atomic_unsafe_assume_single_core,
+        feature = "critical-section",
+        target_arch = "avr",
+        target_arch = "msp430",
+    )))
+)]
+#[macro_use]
+mod atomic_128_macros {
+    #[macro_export]
+    macro_rules! cfg_has_atomic_128 {
+        ($($tt:tt)*) => {};
+    }
+    #[macro_export]
+    macro_rules! cfg_no_atomic_128 {
+        ($($tt:tt)*) => {
+            $($tt)*
+        };
+    }
+}
+
+#[cfg_attr(
+    portable_atomic_no_cfg_target_has_atomic,
+    cfg(any(
+        not(portable_atomic_no_atomic_cas),
+        portable_atomic_unsafe_assume_single_core,
+        feature = "critical-section",
+        target_arch = "avr",
+        target_arch = "msp430",
+    ))
+)]
+#[cfg_attr(
+    not(portable_atomic_no_cfg_target_has_atomic),
+    cfg(any(
+        target_has_atomic = "ptr",
+        portable_atomic_unsafe_assume_single_core,
+        feature = "critical-section",
+        target_arch = "avr",
+        target_arch = "msp430",
+    ))
+)]
+#[macro_use]
+mod atomic_cas_macros {
+    #[macro_export]
+    macro_rules! cfg_has_atomic_cas {
+        ($($tt:tt)*) => {
+            $($tt)*
+        };
+    }
+    #[macro_export]
+    macro_rules! cfg_no_atomic_cas {
+        ($($tt:tt)*) => {};
+    }
+}
+#[cfg_attr(
+    portable_atomic_no_cfg_target_has_atomic,
+    cfg(not(any(
+        not(portable_atomic_no_atomic_cas),
+        portable_atomic_unsafe_assume_single_core,
+        feature = "critical-section",
+        target_arch = "avr",
+        target_arch = "msp430",
+    )))
+)]
+#[cfg_attr(
+    not(portable_atomic_no_cfg_target_has_atomic),
+    cfg(not(any(
+        target_has_atomic = "ptr",
+        portable_atomic_unsafe_assume_single_core,
+        feature = "critical-section",
+        target_arch = "avr",
+        target_arch = "msp430",
+    )))
+)]
+#[macro_use]
+mod atomic_cas_macros {
+    #[macro_export]
+    macro_rules! cfg_has_atomic_cas {
+        ($($tt:tt)*) => {};
+    }
+    #[macro_export]
+    macro_rules! cfg_no_atomic_cas {
+        ($($tt:tt)*) => {
+            $($tt)*
+        };
+    }
+}
+
+// Check that all cfg_ macros work.
+mod check {
+    crate::cfg_has_atomic_8! { type _Atomic8 = (); }
+    crate::cfg_no_atomic_8! { type _Atomic8 = (); }
+    crate::cfg_has_atomic_16! { type _Atomic16 = (); }
+    crate::cfg_no_atomic_16! { type _Atomic16 = (); }
+    crate::cfg_has_atomic_32! { type _Atomic32 = (); }
+    crate::cfg_no_atomic_32! { type _Atomic32 = (); }
+    crate::cfg_has_atomic_64! { type _Atomic64 = (); }
+    crate::cfg_no_atomic_64! { type _Atomic64 = (); }
+    crate::cfg_has_atomic_128! { type _Atomic128 = (); }
+    crate::cfg_no_atomic_128! { type _Atomic128 = (); }
+    crate::cfg_has_atomic_ptr! { type _AtomicPtr = (); }
+    crate::cfg_no_atomic_ptr! { type _AtomicPtr = (); }
+    crate::cfg_has_atomic_cas! { type __AtomicPtr = (); }
+    crate::cfg_no_atomic_cas! { type __AtomicPtr = (); }
+    #[allow(unused_imports)]
+    use {
+        _Atomic128 as _, _Atomic16 as _, _Atomic32 as _, _Atomic64 as _, _Atomic8 as _,
+        _AtomicPtr as _, __AtomicPtr as _,
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/gen/utils.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/gen/utils.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/gen/utils.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/gen/utils.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,151 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+// This file is @generated by target_spec.sh.
+// It is not intended for manual editing.
+
+#![allow(unused_macros)]
+
+// On AArch64, the base register of memory-related instructions must be 64-bit.
+// Passing a 32-bit value to `in(reg)` on AArch64 results in the upper bits
+// having an undefined value, but to work correctly with ILP32 ABI, the upper
+// bits must be zero, which is handled here by casting to u64. Another way to
+// handle this is to pass it as a pointer and clear the upper bits inside asm,
+// but it is easier to overlook than cast, which can catch overlooks by
+// asm_sub_register lint.
+// See also https://github.com/ARM-software/abi-aa/blob/2023Q3/aapcs64/aapcs64.rst#pointers
+//
+// Except for x86_64, which can use 32-bit registers in the destination operand
+// (on x86_64, we use the ptr_modifier macro to handle this), we need to do the
+// same for ILP32 ABI on other 64-bit architectures. (At least, as far as I can
+// see from the assembly generated by LLVM, this is also required for MIPS64 N32
+// ABI. I don't know about the RISC-V s64ilp32 ABI for which a patch was
+// recently submitted to the kernel, but in any case, this should be a safe
+// default for such ABIs).
+//
+// Known architectures that have such ABI are x86_64 (X32), aarch64 (ILP32),
+// mips64 (N32), and riscv64 (s64ilp32, not merged yet though). (As of
+// 2023-06-05, only the former two are supported by rustc.) However, we list all
+// known 64-bit architectures because similar ABIs may exist or future added for
+// other architectures.
+#[cfg(all(
+    target_pointer_width = "32",
+    any(
+        target_arch = "aarch64",
+        target_arch = "arm64ec",
+        target_arch = "bpf",
+        target_arch = "loongarch64",
+        target_arch = "mips64",
+        target_arch = "mips64r6",
+        target_arch = "nvptx64",
+        target_arch = "powerpc64",
+        target_arch = "riscv64",
+        target_arch = "s390x",
+        target_arch = "sparc64",
+        target_arch = "wasm64",
+        target_arch = "x86_64",
+    ),
+))]
+macro_rules! ptr_reg {
+    ($ptr:ident) => {{
+        let _: *const _ = $ptr; // ensure $ptr is a pointer (*mut _ or *const _)
+        #[cfg(not(portable_atomic_no_asm_maybe_uninit))]
+        #[allow(clippy::ptr_as_ptr)]
+        {
+            // If we cast to u64 here, the provenance will be lost,
+            // so we convert to MaybeUninit<u64> via zero extend helper.
+            crate::utils::zero_extend64_ptr($ptr as *mut ())
+        }
+        #[cfg(portable_atomic_no_asm_maybe_uninit)]
+        {
+            // Use cast on old rustc because it does not support MaybeUninit
+            // registers. This is still permissive-provenance compatible and
+            // is sound.
+            $ptr as u64
+        }
+    }};
+}
+#[cfg(not(all(
+    target_pointer_width = "32",
+    any(
+        target_arch = "aarch64",
+        target_arch = "arm64ec",
+        target_arch = "bpf",
+        target_arch = "loongarch64",
+        target_arch = "mips64",
+        target_arch = "mips64r6",
+        target_arch = "nvptx64",
+        target_arch = "powerpc64",
+        target_arch = "riscv64",
+        target_arch = "s390x",
+        target_arch = "sparc64",
+        target_arch = "wasm64",
+        target_arch = "x86_64",
+    ),
+)))]
+macro_rules! ptr_reg {
+    ($ptr:ident) => {{
+        let _: *const _ = $ptr; // ensure $ptr is a pointer (*mut _ or *const _)
+        $ptr // cast is unnecessary here.
+    }};
+}
+
+// Some 64-bit architectures have ABI with 32-bit pointer width (e.g., x86_64 X32 ABI,
+// AArch64 ILP32 ABI, MIPS64 N32 ABI). On those targets, AtomicU64 is available
+// and fast, so use it to implement normal sequence lock.
+//
+// See ptr_reg macro for the reason why all known 64-bit architectures are listed.
+#[cfg(feature = "fallback")]
+#[cfg(any(
+    not(any(target_pointer_width = "16", target_pointer_width = "32")), // i.e., 64-bit or greater
+    target_arch = "aarch64",
+    target_arch = "arm64ec",
+    target_arch = "bpf",
+    target_arch = "loongarch64",
+    target_arch = "mips64",
+    target_arch = "mips64r6",
+    target_arch = "nvptx64",
+    target_arch = "powerpc64",
+    target_arch = "riscv64",
+    target_arch = "s390x",
+    target_arch = "sparc64",
+    target_arch = "wasm64",
+    target_arch = "x86_64",
+))]
+#[macro_use]
+mod fast_atomic_64_macros {
+    macro_rules! cfg_has_fast_atomic_64 {
+        ($($tt:tt)*) => {
+            $($tt)*
+        };
+    }
+    macro_rules! cfg_no_fast_atomic_64 {
+        ($($tt:tt)*) => {};
+    }
+}
+#[cfg(feature = "fallback")]
+#[cfg(not(any(
+    not(any(target_pointer_width = "16", target_pointer_width = "32")), // i.e., 64-bit or greater
+    target_arch = "aarch64",
+    target_arch = "arm64ec",
+    target_arch = "bpf",
+    target_arch = "loongarch64",
+    target_arch = "mips64",
+    target_arch = "mips64r6",
+    target_arch = "nvptx64",
+    target_arch = "powerpc64",
+    target_arch = "riscv64",
+    target_arch = "s390x",
+    target_arch = "sparc64",
+    target_arch = "wasm64",
+    target_arch = "x86_64",
+)))]
+#[macro_use]
+mod fast_atomic_64_macros {
+    macro_rules! cfg_has_fast_atomic_64 {
+        ($($tt:tt)*) => {};
+    }
+    macro_rules! cfg_no_fast_atomic_64 {
+        ($($tt:tt)*) => {
+            $($tt)*
+        };
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/arm_linux.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/arm_linux.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/arm_linux.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/arm_linux.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,509 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// 64-bit atomic implementation using kuser_cmpxchg64 on pre-v6 ARM Linux/Android.
+//
+// Refs:
+// - https://www.kernel.org/doc/Documentation/arm/kernel_user_helpers.txt
+// - https://github.com/rust-lang/compiler-builtins/blob/0.1.88/src/arm_linux.rs
+//
+// Note: On Miri and ThreadSanitizer which do not support inline assembly, we don't use
+// this module and use fallback implementation instead.
+
+// TODO: Since Rust 1.64, the Linux kernel requirement for Rust when using std is 3.2+, so it should
+// be possible to omit the dynamic kernel version check if the std feature is enabled on Rust 1.64+.
+// https://blog.rust-lang.org/2022/08/01/Increasing-glibc-kernel-requirements.html
+
+#[path = "fallback/outline_atomics.rs"]
+mod fallback;
+
+use core::{arch::asm, cell::UnsafeCell, mem, sync::atomic::Ordering};
+
+use crate::utils::{Pair, U64};
+
+// https://www.kernel.org/doc/Documentation/arm/kernel_user_helpers.txt
+const KUSER_HELPER_VERSION: usize = 0xFFFF0FFC;
+// __kuser_helper_version >= 5 (kernel version 3.1+)
+const KUSER_CMPXCHG64: usize = 0xFFFF0F60;
+#[inline]
+fn __kuser_helper_version() -> i32 {
+    use core::sync::atomic::AtomicI32;
+
+    static CACHE: AtomicI32 = AtomicI32::new(0);
+    let mut v = CACHE.load(Ordering::Relaxed);
+    if v != 0 {
+        return v;
+    }
+    // SAFETY: core assumes that at least __kuser_memory_barrier (__kuser_helper_version >= 3) is
+    // available on this platform. __kuser_helper_version is always available on such a platform.
+    v = unsafe { (KUSER_HELPER_VERSION as *const i32).read() };
+    CACHE.store(v, Ordering::Relaxed);
+    v
+}
+#[inline]
+fn has_kuser_cmpxchg64() -> bool {
+    // Note: detect_false cfg is intended to make it easy for portable-atomic developers to
+    // test cases such as has_cmpxchg16b == false, has_lse == false,
+    // __kuser_helper_version < 5, etc., and is not a public API.
+    if cfg!(portable_atomic_test_outline_atomics_detect_false) {
+        return false;
+    }
+    __kuser_helper_version() >= 5
+}
+#[inline]
+unsafe fn __kuser_cmpxchg64(old_val: *const u64, new_val: *const u64, ptr: *mut u64) -> bool {
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        let f: extern "C" fn(*const u64, *const u64, *mut u64) -> u32 =
+            mem::transmute(KUSER_CMPXCHG64 as *const ());
+        f(old_val, new_val, ptr) == 0
+    }
+}
+
+// 64-bit atomic load by two 32-bit atomic loads.
+#[inline]
+unsafe fn byte_wise_atomic_load(src: *const u64) -> u64 {
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        let (out_lo, out_hi);
+        asm!(
+            "ldr {out_lo}, [{src}]",
+            "ldr {out_hi}, [{src}, #4]",
+            src = in(reg) src,
+            out_lo = out(reg) out_lo,
+            out_hi = out(reg) out_hi,
+            options(pure, nostack, preserves_flags, readonly),
+        );
+        U64 { pair: Pair { lo: out_lo, hi: out_hi } }.whole
+    }
+}
+
+#[inline(always)]
+unsafe fn atomic_update_kuser_cmpxchg64<F>(dst: *mut u64, mut f: F) -> u64
+where
+    F: FnMut(u64) -> u64,
+{
+    debug_assert!(dst as usize % 8 == 0);
+    debug_assert!(has_kuser_cmpxchg64());
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        loop {
+            // This is not single-copy atomic reads, but this is ok because subsequent
+            // CAS will check for consistency.
+            //
+            // ARM's memory model allow mixed-sized atomic access.
+            // https://github.com/rust-lang/unsafe-code-guidelines/issues/345#issuecomment-1172891466
+            //
+            // Note that the C++20 memory model does not allow mixed-sized atomic access,
+            // so we must use inline assembly to implement byte_wise_atomic_load.
+            // (i.e., byte-wise atomic based on the standard library's atomic types
+            // cannot be used here).
+            let prev = byte_wise_atomic_load(dst);
+            let next = f(prev);
+            if __kuser_cmpxchg64(&prev, &next, dst) {
+                return prev;
+            }
+        }
+    }
+}
+
+macro_rules! atomic_with_ifunc {
+    (
+        unsafe fn $name:ident($($arg:tt)*) $(-> $ret_ty:ty)? { $($kuser_cmpxchg64_fn_body:tt)* }
+        fallback = $seqcst_fallback_fn:ident
+    ) => {
+        #[inline]
+        unsafe fn $name($($arg)*) $(-> $ret_ty)? {
+            unsafe fn kuser_cmpxchg64_fn($($arg)*) $(-> $ret_ty)? {
+                $($kuser_cmpxchg64_fn_body)*
+            }
+            // SAFETY: the caller must uphold the safety contract.
+            // we only calls __kuser_cmpxchg64 if it is available.
+            unsafe {
+                ifunc!(unsafe fn($($arg)*) $(-> $ret_ty)? {
+                    if has_kuser_cmpxchg64() {
+                        kuser_cmpxchg64_fn
+                    } else {
+                        // Use SeqCst because __kuser_cmpxchg64 is always SeqCst.
+                        // https://github.com/torvalds/linux/blob/v6.1/arch/arm/kernel/entry-armv.S#L918-L925
+                        fallback::$seqcst_fallback_fn
+                    }
+                })
+            }
+        }
+    };
+}
+
+atomic_with_ifunc! {
+    unsafe fn atomic_load(src: *mut u64) -> u64 {
+        // SAFETY: the caller must uphold the safety contract.
+        unsafe { atomic_update_kuser_cmpxchg64(src, |old| old) }
+    }
+    fallback = atomic_load_seqcst
+}
+atomic_with_ifunc! {
+    unsafe fn atomic_store(dst: *mut u64, val: u64) {
+        // SAFETY: the caller must uphold the safety contract.
+        unsafe { atomic_update_kuser_cmpxchg64(dst, |_| val); }
+    }
+    fallback = atomic_store_seqcst
+}
+atomic_with_ifunc! {
+    unsafe fn atomic_swap(dst: *mut u64, val: u64) -> u64 {
+        // SAFETY: the caller must uphold the safety contract.
+        unsafe { atomic_update_kuser_cmpxchg64(dst, |_| val) }
+    }
+    fallback = atomic_swap_seqcst
+}
+atomic_with_ifunc! {
+    unsafe fn atomic_compare_exchange(dst: *mut u64, old: u64, new: u64) -> (u64, bool) {
+        // SAFETY: the caller must uphold the safety contract.
+        let prev = unsafe {
+            atomic_update_kuser_cmpxchg64(dst, |v| if v == old { new } else { v })
+        };
+        (prev, prev == old)
+    }
+    fallback = atomic_compare_exchange_seqcst
+}
+atomic_with_ifunc! {
+    unsafe fn atomic_add(dst: *mut u64, val: u64) -> u64 {
+        // SAFETY: the caller must uphold the safety contract.
+        unsafe { atomic_update_kuser_cmpxchg64(dst, |x| x.wrapping_add(val)) }
+    }
+    fallback = atomic_add_seqcst
+}
+atomic_with_ifunc! {
+    unsafe fn atomic_sub(dst: *mut u64, val: u64) -> u64 {
+        // SAFETY: the caller must uphold the safety contract.
+        unsafe { atomic_update_kuser_cmpxchg64(dst, |x| x.wrapping_sub(val)) }
+    }
+    fallback = atomic_sub_seqcst
+}
+atomic_with_ifunc! {
+    unsafe fn atomic_and(dst: *mut u64, val: u64) -> u64 {
+        // SAFETY: the caller must uphold the safety contract.
+        unsafe { atomic_update_kuser_cmpxchg64(dst, |x| x & val) }
+    }
+    fallback = atomic_and_seqcst
+}
+atomic_with_ifunc! {
+    unsafe fn atomic_nand(dst: *mut u64, val: u64) -> u64 {
+        // SAFETY: the caller must uphold the safety contract.
+        unsafe { atomic_update_kuser_cmpxchg64(dst, |x| !(x & val)) }
+    }
+    fallback = atomic_nand_seqcst
+}
+atomic_with_ifunc! {
+    unsafe fn atomic_or(dst: *mut u64, val: u64) -> u64 {
+        // SAFETY: the caller must uphold the safety contract.
+        unsafe { atomic_update_kuser_cmpxchg64(dst, |x| x | val) }
+    }
+    fallback = atomic_or_seqcst
+}
+atomic_with_ifunc! {
+    unsafe fn atomic_xor(dst: *mut u64, val: u64) -> u64 {
+        // SAFETY: the caller must uphold the safety contract.
+        unsafe { atomic_update_kuser_cmpxchg64(dst, |x| x ^ val) }
+    }
+    fallback = atomic_xor_seqcst
+}
+atomic_with_ifunc! {
+    unsafe fn atomic_max(dst: *mut u64, val: u64) -> u64 {
+        #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+        // SAFETY: the caller must uphold the safety contract.
+        unsafe {
+            atomic_update_kuser_cmpxchg64(dst, |x| core::cmp::max(x as i64, val as i64) as u64)
+        }
+    }
+    fallback = atomic_max_seqcst
+}
+atomic_with_ifunc! {
+    unsafe fn atomic_umax(dst: *mut u64, val: u64) -> u64 {
+        // SAFETY: the caller must uphold the safety contract.
+        unsafe { atomic_update_kuser_cmpxchg64(dst, |x| core::cmp::max(x, val)) }
+    }
+    fallback = atomic_umax_seqcst
+}
+atomic_with_ifunc! {
+    unsafe fn atomic_min(dst: *mut u64, val: u64) -> u64 {
+        #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+        // SAFETY: the caller must uphold the safety contract.
+        unsafe {
+            atomic_update_kuser_cmpxchg64(dst, |x| core::cmp::min(x as i64, val as i64) as u64)
+        }
+    }
+    fallback = atomic_min_seqcst
+}
+atomic_with_ifunc! {
+    unsafe fn atomic_umin(dst: *mut u64, val: u64) -> u64 {
+        // SAFETY: the caller must uphold the safety contract.
+        unsafe { atomic_update_kuser_cmpxchg64(dst, |x| core::cmp::min(x, val)) }
+    }
+    fallback = atomic_umin_seqcst
+}
+atomic_with_ifunc! {
+    unsafe fn atomic_not(dst: *mut u64) -> u64 {
+        // SAFETY: the caller must uphold the safety contract.
+        unsafe { atomic_update_kuser_cmpxchg64(dst, |x| !x) }
+    }
+    fallback = atomic_not_seqcst
+}
+atomic_with_ifunc! {
+    unsafe fn atomic_neg(dst: *mut u64) -> u64 {
+        // SAFETY: the caller must uphold the safety contract.
+        unsafe { atomic_update_kuser_cmpxchg64(dst, u64::wrapping_neg) }
+    }
+    fallback = atomic_neg_seqcst
+}
+
+macro_rules! atomic64 {
+    ($atomic_type:ident, $int_type:ident, $atomic_max:ident, $atomic_min:ident) => {
+        #[repr(C, align(8))]
+        pub(crate) struct $atomic_type {
+            v: UnsafeCell<$int_type>,
+        }
+
+        // Send is implicitly implemented.
+        // SAFETY: any data races are prevented by the kernel user helper or the lock.
+        unsafe impl Sync for $atomic_type {}
+
+        impl_default_no_fetch_ops!($atomic_type, $int_type);
+        impl_default_bit_opts!($atomic_type, $int_type);
+        impl $atomic_type {
+            #[inline]
+            pub(crate) const fn new(v: $int_type) -> Self {
+                Self { v: UnsafeCell::new(v) }
+            }
+
+            #[inline]
+            pub(crate) fn is_lock_free() -> bool {
+                has_kuser_cmpxchg64()
+            }
+            #[inline]
+            pub(crate) const fn is_always_lock_free() -> bool {
+                false
+            }
+
+            #[inline]
+            pub(crate) fn get_mut(&mut self) -> &mut $int_type {
+                // SAFETY: the mutable reference guarantees unique ownership.
+                // (UnsafeCell::get_mut requires Rust 1.50)
+                unsafe { &mut *self.v.get() }
+            }
+
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn load(&self, order: Ordering) -> $int_type {
+                crate::utils::assert_load_ordering(order);
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by the kernel user helper or the lock
+                // and the raw pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_load(self.v.get().cast::<u64>()) as $int_type
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn store(&self, val: $int_type, order: Ordering) {
+                crate::utils::assert_store_ordering(order);
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by the kernel user helper or the lock
+                // and the raw pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_store(self.v.get().cast::<u64>(), val as u64)
+                }
+            }
+
+            #[inline]
+            pub(crate) fn swap(&self, val: $int_type, _order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by the kernel user helper or the lock
+                // and the raw pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_swap(self.v.get().cast::<u64>(), val as u64) as $int_type
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn compare_exchange(
+                &self,
+                current: $int_type,
+                new: $int_type,
+                success: Ordering,
+                failure: Ordering,
+            ) -> Result<$int_type, $int_type> {
+                crate::utils::assert_compare_exchange_ordering(success, failure);
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by the kernel user helper or the lock
+                // and the raw pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    let (prev, ok) = atomic_compare_exchange(
+                        self.v.get().cast::<u64>(),
+                        current as u64,
+                        new as u64,
+                    );
+                    if ok {
+                        Ok(prev as $int_type)
+                    } else {
+                        Err(prev as $int_type)
+                    }
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn compare_exchange_weak(
+                &self,
+                current: $int_type,
+                new: $int_type,
+                success: Ordering,
+                failure: Ordering,
+            ) -> Result<$int_type, $int_type> {
+                self.compare_exchange(current, new, success, failure)
+            }
+
+            #[inline]
+            pub(crate) fn fetch_add(&self, val: $int_type, _order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by the kernel user helper or the lock
+                // and the raw pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_add(self.v.get().cast::<u64>(), val as u64) as $int_type
+                }
+            }
+
+            #[inline]
+            pub(crate) fn fetch_sub(&self, val: $int_type, _order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by the kernel user helper or the lock
+                // and the raw pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_sub(self.v.get().cast::<u64>(), val as u64) as $int_type
+                }
+            }
+
+            #[inline]
+            pub(crate) fn fetch_and(&self, val: $int_type, _order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by the kernel user helper or the lock
+                // and the raw pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_and(self.v.get().cast::<u64>(), val as u64) as $int_type
+                }
+            }
+
+            #[inline]
+            pub(crate) fn fetch_nand(&self, val: $int_type, _order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by the kernel user helper or the lock
+                // and the raw pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_nand(self.v.get().cast::<u64>(), val as u64) as $int_type
+                }
+            }
+
+            #[inline]
+            pub(crate) fn fetch_or(&self, val: $int_type, _order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by the kernel user helper or the lock
+                // and the raw pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_or(self.v.get().cast::<u64>(), val as u64) as $int_type
+                }
+            }
+
+            #[inline]
+            pub(crate) fn fetch_xor(&self, val: $int_type, _order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by the kernel user helper or the lock
+                // and the raw pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_xor(self.v.get().cast::<u64>(), val as u64) as $int_type
+                }
+            }
+
+            #[inline]
+            pub(crate) fn fetch_max(&self, val: $int_type, _order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by the kernel user helper or the lock
+                // and the raw pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    $atomic_max(self.v.get().cast::<u64>(), val as u64) as $int_type
+                }
+            }
+
+            #[inline]
+            pub(crate) fn fetch_min(&self, val: $int_type, _order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by the kernel user helper or the lock
+                // and the raw pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    $atomic_min(self.v.get().cast::<u64>(), val as u64) as $int_type
+                }
+            }
+
+            #[inline]
+            pub(crate) fn fetch_not(&self, _order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by the kernel user helper or the lock
+                // and the raw pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_not(self.v.get().cast::<u64>()) as $int_type
+                }
+            }
+            #[inline]
+            pub(crate) fn not(&self, order: Ordering) {
+                self.fetch_not(order);
+            }
+
+            #[inline]
+            pub(crate) fn fetch_neg(&self, _order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by the kernel user helper or the lock
+                // and the raw pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_neg(self.v.get().cast::<u64>()) as $int_type
+                }
+            }
+            #[inline]
+            pub(crate) fn neg(&self, order: Ordering) {
+                self.fetch_neg(order);
+            }
+
+            #[inline]
+            pub(crate) const fn as_ptr(&self) -> *mut $int_type {
+                self.v.get()
+            }
+        }
+    };
+}
+
+atomic64!(AtomicI64, i64, atomic_max, atomic_min);
+atomic64!(AtomicU64, u64, atomic_umax, atomic_umin);
+
+#[allow(
+    clippy::alloc_instead_of_core,
+    clippy::std_instead_of_alloc,
+    clippy::std_instead_of_core,
+    clippy::undocumented_unsafe_blocks,
+    clippy::wildcard_imports
+)]
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn kuser_helper_version() {
+        let version = __kuser_helper_version();
+        assert!(version >= 5, "{:?}", version);
+        assert_eq!(version, unsafe { (KUSER_HELPER_VERSION as *const i32).read() });
+    }
+
+    test_atomic_int!(i64);
+    test_atomic_int!(u64);
+
+    // load/store/swap implementation is not affected by signedness, so it is
+    // enough to test only unsigned types.
+    stress_test!(u64);
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/README.md 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/README.md
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,59 @@
+# Implementation of 128-bit atomics
+
+## 128-bit atomics instructions
+
+Here is the table of targets that support 128-bit atomics and the instructions used:
+
+| target_arch | load | store | CAS | RMW | note |
+| ----------- | ---- | ----- | --- | --- | ---- |
+| x86_64 | cmpxchg16b or vmovdqa | cmpxchg16b or vmovdqa | cmpxchg16b | cmpxchg16b | cmpxchg16b target feature required. vmovdqa requires Intel, AMD, or Zhaoxin CPU with AVX. <br> Both compile-time and run-time detection are supported for cmpxchg16b. vmovdqa is currently run-time detection only. <br> Requires rustc 1.59+ |
+| aarch64 | ldxp/stxp or casp or ldp/ldiapp | ldxp/stxp or casp or stp/stilp/swpp | ldxp/stxp or casp | ldxp/stxp or casp/swpp/ldclrp/ldsetp | casp requires lse target feature, ldp/stp requires lse2 target feature, ldiapp/stilp requires lse2 and rcpc3 target features, swpp/ldclrp/ldsetp requires lse128 target feature. <br> Both compile-time and run-time detection are supported for lse and lse2. Others are currently compile-time detection only. <br> Requires rustc 1.59+ |
+| powerpc64 | lq | stq | lqarx/stqcx. | lqarx/stqcx. | Requires target-cpu pwr8+ (powerpc64le is pwr8 by default). Both compile-time and run-time detection are supported (run-time detection is currently disabled by default). <br> Requires nightly |
+| s390x | lpq | stpq | cdsg | cdsg | Requires nightly |
+
+On compiler versions or platforms where these are not supported, the fallback implementation is used.
+
+See [aarch64.rs](aarch64.rs) module-level comments for more details on the instructions used on aarch64.
+
+## Comparison with core::intrinsics::atomic_\* (core::sync::atomic::Atomic{I,U}128)
+
+This directory has target-specific implementations with inline assembly ([aarch64.rs](aarch64.rs), [x86_64.rs](x86_64.rs), [powerpc64.rs](powerpc64.rs), [s390x.rs](s390x.rs)) and an implementation without inline assembly ([intrinsics.rs](intrinsics.rs)). The latter currently always needs nightly compilers and is only used for Miri and ThreadSanitizer, which do not support inline assembly.
+
+Implementations with inline assembly generate assemblies almost equivalent to the `core::intrinsics::atomic_*` (used in `core::sync::atomic::Atomic{I,U}128`) for many operations, but some operations may or may not generate more efficient code. For example:
+
+- On x86_64 and aarch64, implementation with inline assembly contains additional optimizations (e.g., [#16](https://github.com/taiki-e/portable-atomic/pull/16), [#126](https://github.com/taiki-e/portable-atomic/pull/126)) and is much faster for some operations.
+- On aarch64, implementation with inline assembly supports outline-atomics on more operating systems, and may be faster in environments where outline-atomics can improve performance.
+- On powerpc64, LLVM does not support generating some 128-bit atomic operations (see [intrinsics.rs](intrinsics.rs) module-level comments), and we use CAS loop to implement them, so implementation with inline assembly may be faster for those operations.
+- In implementations without inline assembly, the compiler may reuse condition flags that have changed as a result of the operation, or use immediate values instead of registers, depending on the situation.
+
+As 128-bit atomics-related APIs stabilize in the standard library, implementations with inline assembly are planned to be updated to get the benefits of both.
+
+## Run-time feature detection
+
+[detect](detect) module has run-time feature detection implementations.
+
+Here is the table of targets that support run-time feature detection and the instruction or API used:
+
+| target_arch | target_os/target_env | instruction/API | features | note |
+| ----------- | -------------------- | --------------- | -------- | ---- |
+| x86_64      | all (except for sgx) | cpuid           | all      | Enabled by default |
+| aarch64     | linux                | getauxval       | all      | Only enabled by default on `*-linux-gnu*`, and `*-linux-musl*"` (default is static linking)/`*-linux-ohos*` (default is dynamic linking) with dynamic linking enabled. |
+| aarch64     | android              | getauxval       | all      | Enabled by default |
+| aarch64     | freebsd              | elf_aux_info    | lse, lse2 | Enabled by default |
+| aarch64     | netbsd               | sysctl          | all      | Enabled by default |
+| aarch64     | openbsd              | sysctl          | lse      | Enabled by default |
+| aarch64     | macos                | sysctl          | all      | Currently only used in tests because FEAT_LSE and FEAT_LSE2 are always available at compile-time. |
+| aarch64     | windows              | IsProcessorFeaturePresent | lse | Enabled by default |
+| aarch64     | fuchsia              | zx_system_get_features | lse | Enabled by default |
+| powerpc64   | linux                | getauxval       | all      | Disabled by default |
+| powerpc64   | freebsd              | elf_aux_info    | all      | Disabled by default |
+
+Run-time detection is enabled by default on most targets and can be disabled with `--cfg portable_atomic_no_outline_atomics`.
+
+On some targets, run-time detection is disabled by default mainly for compatibility with older versions of operating systems or incomplete build environments, and can be enabled by `--cfg portable_atomic_outline_atomics`. (When both cfg are enabled, `*_no_*` cfg is preferred.)
+
+For targets not included in the above table, run-time detection is always disabled and works the same as when `--cfg portable_atomic_no_outline_atomics` is set.
+
+See [detect/auxv.rs](detect/auxv.rs) module-level comments for more details on Linux/Android/FreeBSD.
+
+See also [docs on `portable_atomic_no_outline_atomics`](https://github.com/taiki-e/portable-atomic/blob/HEAD/README.md#optional-cfg-no-outline-atomics) in the top-level readme.
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/aarch64.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/aarch64.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/aarch64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/aarch64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1708 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Atomic{I,U}128 implementation on AArch64.
+//
+// There are a few ways to implement 128-bit atomic operations in AArch64.
+//
+// - LDXP/STXP loop (DW LL/SC)
+// - CASP (DWCAS) added as FEAT_LSE (mandatory from armv8.1-a)
+// - LDP/STP (DW load/store) if FEAT_LSE2 (optional from armv8.2-a, mandatory from armv8.4-a) is available
+// - LDIAPP/STILP (DW acquire-load/release-store) added as FEAT_LRCPC3 (optional from armv8.9-a/armv9.4-a) (if FEAT_LSE2 is also available)
+// - LDCLRP/LDSETP/SWPP (DW RMW) added as FEAT_LSE128 (optional from armv9.4-a)
+//
+// If outline-atomics is not enabled and FEAT_LSE is not available at
+// compile-time, we use LDXP/STXP loop.
+// If outline-atomics is enabled and FEAT_LSE is not available at
+// compile-time, we use CASP for CAS if FEAT_LSE is available
+// at run-time, otherwise, use LDXP/STXP loop.
+// If FEAT_LSE is available at compile-time, we use CASP for load/store/CAS/RMW.
+// However, when portable_atomic_ll_sc_rmw cfg is set, use LDXP/STXP loop instead of CASP
+// loop for RMW (by default, it is set on Apple hardware; see build script for details).
+// If FEAT_LSE2 is available at compile-time, we use LDP/STP for load/store.
+// If FEAT_LSE128 is available at compile-time, we use LDCLRP/LDSETP/SWPP for fetch_and/fetch_or/swap/{release,seqcst}-store.
+// If FEAT_LSE2 and FEAT_LRCPC3 are available at compile-time, we use LDIAPP/STILP for acquire-load/release-store.
+//
+// Note: FEAT_LSE2 doesn't imply FEAT_LSE. FEAT_LSE128 implies FEAT_LSE but not FEAT_LSE2.
+//
+// Note that we do not separate LL and SC into separate functions, but handle
+// them within a single asm block. This is because it is theoretically possible
+// for the compiler to insert operations that might clear the reservation between
+// LL and SC. Considering the type of operations we are providing and the fact
+// that [progress64](https://github.com/ARM-software/progress64) uses such code,
+// this is probably not a problem for aarch64, but it seems that aarch64 doesn't
+// guarantee it and hexagon is the only architecture with hardware guarantees
+// that such code works. See also:
+//
+// - https://yarchive.net/comp/linux/cmpxchg_ll_sc_portability.html
+// - https://lists.llvm.org/pipermail/llvm-dev/2016-May/099490.html
+// - https://lists.llvm.org/pipermail/llvm-dev/2018-June/123993.html
+//
+// Also, even when using a CAS loop to implement atomic RMW, include the loop itself
+// in the asm block because it is more efficient for some codegen backends.
+// https://github.com/rust-lang/compiler-builtins/issues/339#issuecomment-1191260474
+//
+// Note: On Miri and ThreadSanitizer which do not support inline assembly, we don't use
+// this module and use intrinsics.rs instead.
+//
+// Refs:
+// - ARM Compiler armasm User Guide
+//   https://developer.arm.com/documentation/dui0801/latest
+// - Arm A-profile A64 Instruction Set Architecture
+//   https://developer.arm.com/documentation/ddi0602/latest
+// - Arm Architecture Reference Manual for A-profile architecture
+//   https://developer.arm.com/documentation/ddi0487/latest
+// - atomic-maybe-uninit https://github.com/taiki-e/atomic-maybe-uninit
+//
+// Generated asm:
+// - aarch64 https://godbolt.org/z/9Kq15oGs4
+// - aarch64 msvc https://godbolt.org/z/hsWo8eYh4
+// - aarch64 (+lse) https://godbolt.org/z/81TanrTGn
+// - aarch64 msvc (+lse) https://godbolt.org/z/KsannGvTY
+// - aarch64 (+lse,+lse2) https://godbolt.org/z/EzvodM6ca
+// - aarch64 (+lse,+lse2,+rcpc3) https://godbolt.org/z/3rEEs6KE6
+// - aarch64 (+lse2,+lse128) https://godbolt.org/z/PWhsPjGa7
+// - aarch64 (+lse2,+lse128,+rcpc3) https://godbolt.org/z/K8MMhfPT1
+
+include!("macros.rs");
+
+// On musl with static linking, it seems that getauxval is not always available.
+// See detect/auxv.rs for more.
+#[cfg(not(portable_atomic_no_outline_atomics))]
+#[cfg(any(
+    test,
+    not(all(
+        any(target_feature = "lse2", portable_atomic_target_feature = "lse2"),
+        any(target_feature = "lse", portable_atomic_target_feature = "lse"),
+    )),
+))]
+#[cfg(any(
+    all(
+        target_os = "linux",
+        any(
+            target_env = "gnu",
+            all(any(target_env = "musl", target_env = "ohos"), not(target_feature = "crt-static")),
+            portable_atomic_outline_atomics,
+        ),
+    ),
+    target_os = "android",
+    target_os = "freebsd",
+))]
+#[path = "detect/auxv.rs"]
+mod detect;
+#[cfg(not(portable_atomic_no_outline_atomics))]
+#[cfg_attr(
+    target_os = "netbsd",
+    cfg(any(
+        test,
+        not(all(
+            any(target_feature = "lse2", portable_atomic_target_feature = "lse2"),
+            any(target_feature = "lse", portable_atomic_target_feature = "lse"),
+        )),
+    ))
+)]
+#[cfg_attr(
+    target_os = "openbsd",
+    cfg(any(test, not(any(target_feature = "lse", portable_atomic_target_feature = "lse"))))
+)]
+#[cfg(any(target_os = "netbsd", target_os = "openbsd"))]
+#[path = "detect/aarch64_aa64reg.rs"]
+mod detect;
+#[cfg(not(portable_atomic_no_outline_atomics))]
+#[cfg(any(test, not(any(target_feature = "lse", portable_atomic_target_feature = "lse"))))]
+#[cfg(target_os = "fuchsia")]
+#[path = "detect/aarch64_fuchsia.rs"]
+mod detect;
+#[cfg(not(portable_atomic_no_outline_atomics))]
+#[cfg(any(test, not(any(target_feature = "lse", portable_atomic_target_feature = "lse"))))]
+#[cfg(target_os = "windows")]
+#[path = "detect/aarch64_windows.rs"]
+mod detect;
+
+// test only
+#[cfg(test)]
+#[cfg(not(qemu))]
+#[cfg(not(valgrind))]
+#[cfg(not(portable_atomic_no_outline_atomics))]
+#[cfg(any(target_os = "linux", target_os = "android", target_os = "freebsd"))]
+#[path = "detect/aarch64_aa64reg.rs"]
+mod detect_aa64reg;
+#[cfg(test)]
+#[cfg(not(portable_atomic_no_outline_atomics))]
+#[cfg(target_os = "macos")]
+#[path = "detect/aarch64_macos.rs"]
+mod detect_macos;
+
+#[cfg(not(portable_atomic_no_asm))]
+use core::arch::asm;
+use core::sync::atomic::Ordering;
+
+use crate::utils::{Pair, U128};
+
+#[cfg(any(
+    target_feature = "lse",
+    portable_atomic_target_feature = "lse",
+    not(portable_atomic_no_outline_atomics),
+))]
+macro_rules! debug_assert_lse {
+    () => {
+        #[cfg(all(
+            not(portable_atomic_no_outline_atomics),
+            any(
+                all(
+                    target_os = "linux",
+                    any(
+                        target_env = "gnu",
+                        all(
+                            any(target_env = "musl", target_env = "ohos"),
+                            not(target_feature = "crt-static"),
+                        ),
+                        portable_atomic_outline_atomics,
+                    ),
+                ),
+                target_os = "android",
+                target_os = "freebsd",
+                target_os = "netbsd",
+                target_os = "openbsd",
+                target_os = "fuchsia",
+                target_os = "windows",
+            ),
+        ))]
+        #[cfg(not(any(target_feature = "lse", portable_atomic_target_feature = "lse")))]
+        {
+            debug_assert!(detect::detect().has_lse());
+        }
+    };
+}
+#[rustfmt::skip]
+#[cfg(any(
+    target_feature = "lse2",
+    portable_atomic_target_feature = "lse2",
+    not(portable_atomic_no_outline_atomics),
+))]
+macro_rules! debug_assert_lse2 {
+    () => {
+        #[cfg(all(
+            not(portable_atomic_no_outline_atomics),
+            any(
+                all(
+                    target_os = "linux",
+                    any(
+                        target_env = "gnu",
+                        all(
+                            any(target_env = "musl", target_env = "ohos"),
+                            not(target_feature = "crt-static"),
+                        ),
+                        portable_atomic_outline_atomics,
+                    ),
+                ),
+                target_os = "android",
+                target_os = "freebsd",
+                target_os = "netbsd",
+                // These don't support detection of FEAT_LSE2.
+                // target_os = "openbsd",
+                // target_os = "fuchsia",
+                // target_os = "windows",
+            ),
+        ))]
+        #[cfg(not(any(target_feature = "lse2", portable_atomic_target_feature = "lse2")))]
+        {
+            debug_assert!(detect::detect().has_lse2());
+        }
+    };
+}
+
+// Refs: https://developer.arm.com/documentation/100067/0611/armclang-Integrated-Assembler/AArch32-Target-selection-directives?lang=en
+//
+// This is similar to #[target_feature(enable = "lse")], except that there are
+// no compiler guarantees regarding (un)inlining, and the scope is within an asm
+// block rather than a function. We use this directive to support outline-atomics
+// on pre-1.61 rustc (aarch64_target_feature stabilized in Rust 1.61).
+//
+// The .arch_extension directive is effective until the end of the assembly block and
+// is not propagated to subsequent code, so the end_lse macro is unneeded.
+// https://godbolt.org/z/o6EPndP94
+// https://github.com/torvalds/linux/commit/e0d5896bd356cd577f9710a02d7a474cdf58426b
+// https://github.com/torvalds/linux/commit/dd1f6308b28edf0452dd5dc7877992903ec61e69
+// (It seems GCC effectively ignores this directive and always allow FEAT_LSE instructions: https://godbolt.org/z/W9W6rensG)
+//
+// The .arch directive has a similar effect, but we don't use it due to the following issue:
+// https://github.com/torvalds/linux/commit/dd1f6308b28edf0452dd5dc7877992903ec61e69
+//
+// This is also needed for compatibility with rustc_codegen_cranelift:
+// https://github.com/rust-lang/rustc_codegen_cranelift/issues/1400#issuecomment-1774599775
+//
+// Note: If FEAT_LSE is not available at compile-time, we must guarantee that
+// the function that uses it is not inlined into a function where it is not
+// clear whether FEAT_LSE is available. Otherwise, (even if we checked whether
+// FEAT_LSE is available at run-time) optimizations that reorder its
+// instructions across the if condition might introduce undefined behavior.
+// (see also https://rust-lang.github.io/rfcs/2045-target-feature.html#safely-inlining-target_feature-functions-on-more-contexts)
+// However, our code uses the ifunc helper macro that works with function pointers,
+// so we don't have to worry about this unless calling without helper macro.
+#[cfg(any(
+    target_feature = "lse",
+    portable_atomic_target_feature = "lse",
+    not(portable_atomic_no_outline_atomics),
+))]
+macro_rules! start_lse {
+    () => {
+        ".arch_extension lse"
+    };
+}
+
+#[cfg(target_endian = "little")]
+macro_rules! select_le_or_be {
+    ($le:expr, $be:expr) => {
+        $le
+    };
+}
+#[cfg(target_endian = "big")]
+macro_rules! select_le_or_be {
+    ($le:expr, $be:expr) => {
+        $be
+    };
+}
+
+macro_rules! atomic_rmw {
+    ($op:ident, $order:ident) => {
+        atomic_rmw!($op, $order, write = $order)
+    };
+    ($op:ident, $order:ident, write = $write:ident) => {
+        match $order {
+            Ordering::Relaxed => $op!("", "", ""),
+            Ordering::Acquire => $op!("a", "", ""),
+            Ordering::Release => $op!("", "l", ""),
+            Ordering::AcqRel => $op!("a", "l", ""),
+            // In MSVC environments, SeqCst stores/writes needs fences after writes.
+            // https://reviews.llvm.org/D141748
+            #[cfg(target_env = "msvc")]
+            Ordering::SeqCst if $write == Ordering::SeqCst => $op!("a", "l", "dmb ish"),
+            // AcqRel and SeqCst RMWs are equivalent in non-MSVC environments.
+            Ordering::SeqCst => $op!("a", "l", ""),
+            _ => unreachable!(),
+        }
+    };
+}
+
+// cfg guarantee that the CPU supports FEAT_LSE2.
+#[cfg(any(target_feature = "lse2", portable_atomic_target_feature = "lse2"))]
+use _atomic_load_ldp as atomic_load;
+#[cfg(not(any(target_feature = "lse2", portable_atomic_target_feature = "lse2")))]
+#[inline]
+unsafe fn atomic_load(src: *mut u128, order: Ordering) -> u128 {
+    #[inline]
+    unsafe fn atomic_load_no_lse2(src: *mut u128, order: Ordering) -> u128 {
+        #[cfg(any(target_feature = "lse", portable_atomic_target_feature = "lse"))]
+        // SAFETY: the caller must uphold the safety contract.
+        // cfg guarantee that the CPU supports FEAT_LSE.
+        unsafe {
+            _atomic_load_casp(src, order)
+        }
+        #[cfg(not(any(target_feature = "lse", portable_atomic_target_feature = "lse")))]
+        // SAFETY: the caller must uphold the safety contract.
+        unsafe {
+            _atomic_load_ldxp_stxp(src, order)
+        }
+    }
+    #[cfg(not(all(
+        not(portable_atomic_no_outline_atomics),
+        any(
+            all(
+                target_os = "linux",
+                any(
+                    target_env = "gnu",
+                    all(
+                        any(target_env = "musl", target_env = "ohos"),
+                        not(target_feature = "crt-static"),
+                    ),
+                    portable_atomic_outline_atomics,
+                ),
+            ),
+            target_os = "android",
+            target_os = "freebsd",
+            target_os = "netbsd",
+            // These don't support detection of FEAT_LSE2.
+            // target_os = "openbsd",
+            // target_os = "fuchsia",
+            // target_os = "windows",
+        ),
+    )))]
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        atomic_load_no_lse2(src, order)
+    }
+    #[cfg(all(
+        not(portable_atomic_no_outline_atomics),
+        any(
+            all(
+                target_os = "linux",
+                any(
+                    target_env = "gnu",
+                    all(
+                        any(target_env = "musl", target_env = "ohos"),
+                        not(target_feature = "crt-static"),
+                    ),
+                    portable_atomic_outline_atomics,
+                ),
+            ),
+            target_os = "android",
+            target_os = "freebsd",
+            target_os = "netbsd",
+            // These don't support detection of FEAT_LSE2.
+            // target_os = "openbsd",
+            // target_os = "fuchsia",
+            // target_os = "windows",
+        ),
+    ))]
+    {
+        fn_alias! {
+            // inline(never) is just a hint and also not strictly necessary
+            // because we use ifunc helper macro, but used for clarity.
+            #[inline(never)]
+            unsafe fn(src: *mut u128) -> u128;
+            atomic_load_lse2_relaxed = _atomic_load_ldp(Ordering::Relaxed);
+            atomic_load_lse2_acquire = _atomic_load_ldp(Ordering::Acquire);
+            atomic_load_lse2_seqcst = _atomic_load_ldp(Ordering::SeqCst);
+        }
+        fn_alias! {
+            unsafe fn(src: *mut u128) -> u128;
+            atomic_load_no_lse2_relaxed = atomic_load_no_lse2(Ordering::Relaxed);
+            atomic_load_no_lse2_acquire = atomic_load_no_lse2(Ordering::Acquire);
+            atomic_load_no_lse2_seqcst = atomic_load_no_lse2(Ordering::SeqCst);
+        }
+        // SAFETY: the caller must uphold the safety contract.
+        // and we've checked if FEAT_LSE2 is available.
+        unsafe {
+            match order {
+                Ordering::Relaxed => {
+                    ifunc!(unsafe fn(src: *mut u128) -> u128 {
+                        let cpuinfo = detect::detect();
+                        if cpuinfo.has_lse2() {
+                            atomic_load_lse2_relaxed
+                        } else {
+                            atomic_load_no_lse2_relaxed
+                        }
+                    })
+                }
+                Ordering::Acquire => {
+                    ifunc!(unsafe fn(src: *mut u128) -> u128 {
+                        let cpuinfo = detect::detect();
+                        if cpuinfo.has_lse2() {
+                            atomic_load_lse2_acquire
+                        } else {
+                            atomic_load_no_lse2_acquire
+                        }
+                    })
+                }
+                Ordering::SeqCst => {
+                    ifunc!(unsafe fn(src: *mut u128) -> u128 {
+                        let cpuinfo = detect::detect();
+                        if cpuinfo.has_lse2() {
+                            atomic_load_lse2_seqcst
+                        } else {
+                            atomic_load_no_lse2_seqcst
+                        }
+                    })
+                }
+                _ => unreachable!(),
+            }
+        }
+    }
+}
+// If CPU supports FEAT_LSE2, LDP/LDIAPP is single-copy atomic reads,
+// otherwise it is two single-copy atomic reads.
+// Refs: B2.2.1 of the Arm Architecture Reference Manual Armv8, for Armv8-A architecture profile
+#[cfg(any(
+    target_feature = "lse2",
+    portable_atomic_target_feature = "lse2",
+    not(portable_atomic_no_outline_atomics),
+))]
+#[inline]
+unsafe fn _atomic_load_ldp(src: *mut u128, order: Ordering) -> u128 {
+    debug_assert!(src as usize % 16 == 0);
+    debug_assert_lse2!();
+
+    // SAFETY: the caller must guarantee that `dst` is valid for reads,
+    // 16-byte aligned, that there are no concurrent non-atomic operations.
+    //
+    // Refs:
+    // - LDP: https://developer.arm.com/documentation/dui0801/l/A64-Data-Transfer-Instructions/LDP--A64-
+    unsafe {
+        let (out_lo, out_hi);
+        macro_rules! atomic_load_relaxed {
+            ($acquire:tt $(, $readonly:tt)?) => {
+                asm!(
+                    "ldp {out_lo}, {out_hi}, [{src}]",
+                    $acquire,
+                    src = in(reg) ptr_reg!(src),
+                    out_hi = lateout(reg) out_hi,
+                    out_lo = lateout(reg) out_lo,
+                    options(nostack, preserves_flags $(, $readonly)?),
+                )
+            };
+        }
+        match order {
+            Ordering::Relaxed => atomic_load_relaxed!("", readonly),
+            #[cfg(any(target_feature = "rcpc3", portable_atomic_target_feature = "rcpc3"))]
+            Ordering::Acquire => {
+                // SAFETY: cfg guarantee that the CPU supports FEAT_LRCPC3.
+                // Refs: https://developer.arm.com/documentation/ddi0602/2023-03/Base-Instructions/LDIAPP--Load-Acquire-RCpc-ordered-Pair-of-registers-
+                asm!(
+                    "ldiapp {out_lo}, {out_hi}, [{src}]",
+                    src = in(reg) ptr_reg!(src),
+                    out_hi = lateout(reg) out_hi,
+                    out_lo = lateout(reg) out_lo,
+                    options(nostack, preserves_flags),
+                );
+            }
+            #[cfg(not(any(target_feature = "rcpc3", portable_atomic_target_feature = "rcpc3")))]
+            Ordering::Acquire => atomic_load_relaxed!("dmb ishld"),
+            Ordering::SeqCst => {
+                asm!(
+                    // ldar (or dmb ishld) is required to prevent reordering with preceding stlxp.
+                    // See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108891 for details.
+                    "ldar {tmp}, [{src}]",
+                    "ldp {out_lo}, {out_hi}, [{src}]",
+                    "dmb ishld",
+                    src = in(reg) ptr_reg!(src),
+                    out_hi = lateout(reg) out_hi,
+                    out_lo = lateout(reg) out_lo,
+                    tmp = out(reg) _,
+                    options(nostack, preserves_flags),
+                );
+            }
+            _ => unreachable!(),
+        }
+        U128 { pair: Pair { lo: out_lo, hi: out_hi } }.whole
+    }
+}
+// Do not use _atomic_compare_exchange_casp because it needs extra MOV to implement load.
+#[cfg(any(test, not(any(target_feature = "lse2", portable_atomic_target_feature = "lse2"))))]
+#[cfg(any(target_feature = "lse", portable_atomic_target_feature = "lse"))]
+#[inline]
+unsafe fn _atomic_load_casp(src: *mut u128, order: Ordering) -> u128 {
+    debug_assert!(src as usize % 16 == 0);
+    debug_assert_lse!();
+
+    // SAFETY: the caller must uphold the safety contract.
+    // cfg guarantee that the CPU supports FEAT_LSE.
+    unsafe {
+        let (out_lo, out_hi);
+        macro_rules! atomic_load {
+            ($acquire:tt, $release:tt) => {
+                asm!(
+                    start_lse!(),
+                    concat!("casp", $acquire, $release, " x2, x3, x2, x3, [{src}]"),
+                    src = in(reg) ptr_reg!(src),
+                    // must be allocated to even/odd register pair
+                    inout("x2") 0_u64 => out_lo,
+                    inout("x3") 0_u64 => out_hi,
+                    options(nostack, preserves_flags),
+                )
+            };
+        }
+        match order {
+            Ordering::Relaxed => atomic_load!("", ""),
+            Ordering::Acquire => atomic_load!("a", ""),
+            Ordering::SeqCst => atomic_load!("a", "l"),
+            _ => unreachable!(),
+        }
+        U128 { pair: Pair { lo: out_lo, hi: out_hi } }.whole
+    }
+}
+#[cfg(any(
+    test,
+    all(
+        not(any(target_feature = "lse2", portable_atomic_target_feature = "lse2")),
+        not(any(target_feature = "lse", portable_atomic_target_feature = "lse")),
+    ),
+))]
+#[inline]
+unsafe fn _atomic_load_ldxp_stxp(src: *mut u128, order: Ordering) -> u128 {
+    debug_assert!(src as usize % 16 == 0);
+
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        let (mut out_lo, mut out_hi);
+        macro_rules! atomic_load {
+            ($acquire:tt, $release:tt) => {
+                asm!(
+                    "2:",
+                        concat!("ld", $acquire, "xp {out_lo}, {out_hi}, [{src}]"),
+                        concat!("st", $release, "xp {r:w}, {out_lo}, {out_hi}, [{src}]"),
+                        // 0 if the store was successful, 1 if no store was performed
+                        "cbnz {r:w}, 2b",
+                    src = in(reg) ptr_reg!(src),
+                    out_lo = out(reg) out_lo,
+                    out_hi = out(reg) out_hi,
+                    r = out(reg) _,
+                    options(nostack, preserves_flags),
+                )
+            };
+        }
+        match order {
+            Ordering::Relaxed => atomic_load!("", ""),
+            Ordering::Acquire => atomic_load!("a", ""),
+            Ordering::SeqCst => atomic_load!("a", "l"),
+            _ => unreachable!(),
+        }
+        U128 { pair: Pair { lo: out_lo, hi: out_hi } }.whole
+    }
+}
+
+// cfg guarantee that the CPU supports FEAT_LSE2.
+#[cfg(any(target_feature = "lse2", portable_atomic_target_feature = "lse2"))]
+use _atomic_store_stp as atomic_store;
+#[cfg(not(any(target_feature = "lse2", portable_atomic_target_feature = "lse2")))]
+#[inline]
+unsafe fn atomic_store(dst: *mut u128, val: u128, order: Ordering) {
+    #[inline]
+    unsafe fn atomic_store_no_lse2(dst: *mut u128, val: u128, order: Ordering) {
+        // If FEAT_LSE is available at compile-time and portable_atomic_ll_sc_rmw cfg is not set,
+        // we use CAS-based atomic RMW.
+        #[cfg(all(
+            any(target_feature = "lse", portable_atomic_target_feature = "lse"),
+            not(portable_atomic_ll_sc_rmw),
+        ))]
+        // SAFETY: the caller must uphold the safety contract.
+        // cfg guarantee that the CPU supports FEAT_LSE.
+        unsafe {
+            _atomic_swap_casp(dst, val, order);
+        }
+        #[cfg(not(all(
+            any(target_feature = "lse", portable_atomic_target_feature = "lse"),
+            not(portable_atomic_ll_sc_rmw),
+        )))]
+        // SAFETY: the caller must uphold the safety contract.
+        unsafe {
+            _atomic_store_ldxp_stxp(dst, val, order);
+        }
+    }
+    #[cfg(not(all(
+        not(portable_atomic_no_outline_atomics),
+        any(
+            all(
+                target_os = "linux",
+                any(
+                    target_env = "gnu",
+                    all(
+                        any(target_env = "musl", target_env = "ohos"),
+                        not(target_feature = "crt-static"),
+                    ),
+                    portable_atomic_outline_atomics,
+                ),
+            ),
+            target_os = "android",
+            target_os = "freebsd",
+            target_os = "netbsd",
+            // These don't support detection of FEAT_LSE2.
+            // target_os = "openbsd",
+            // target_os = "fuchsia",
+            // target_os = "windows",
+        ),
+    )))]
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        atomic_store_no_lse2(dst, val, order);
+    }
+    #[cfg(all(
+        not(portable_atomic_no_outline_atomics),
+        any(
+            all(
+                target_os = "linux",
+                any(
+                    target_env = "gnu",
+                    all(
+                        any(target_env = "musl", target_env = "ohos"),
+                        not(target_feature = "crt-static"),
+                    ),
+                    portable_atomic_outline_atomics,
+                ),
+            ),
+            target_os = "android",
+            target_os = "freebsd",
+            target_os = "netbsd",
+            // These don't support detection of FEAT_LSE2.
+            // target_os = "openbsd",
+            // target_os = "fuchsia",
+            // target_os = "windows",
+        ),
+    ))]
+    {
+        fn_alias! {
+            // inline(never) is just a hint and also not strictly necessary
+            // because we use ifunc helper macro, but used for clarity.
+            #[inline(never)]
+            unsafe fn(dst: *mut u128, val: u128);
+            atomic_store_lse2_relaxed = _atomic_store_stp(Ordering::Relaxed);
+            atomic_store_lse2_release = _atomic_store_stp(Ordering::Release);
+            atomic_store_lse2_seqcst = _atomic_store_stp(Ordering::SeqCst);
+        }
+        fn_alias! {
+            unsafe fn(dst: *mut u128, val: u128);
+            atomic_store_no_lse2_relaxed = atomic_store_no_lse2(Ordering::Relaxed);
+            atomic_store_no_lse2_release = atomic_store_no_lse2(Ordering::Release);
+            atomic_store_no_lse2_seqcst = atomic_store_no_lse2(Ordering::SeqCst);
+        }
+        // SAFETY: the caller must uphold the safety contract.
+        // and we've checked if FEAT_LSE2 is available.
+        unsafe {
+            match order {
+                Ordering::Relaxed => {
+                    ifunc!(unsafe fn(dst: *mut u128, val: u128) {
+                        let cpuinfo = detect::detect();
+                        if cpuinfo.has_lse2() {
+                            atomic_store_lse2_relaxed
+                        } else {
+                            atomic_store_no_lse2_relaxed
+                        }
+                    });
+                }
+                Ordering::Release => {
+                    ifunc!(unsafe fn(dst: *mut u128, val: u128) {
+                        let cpuinfo = detect::detect();
+                        if cpuinfo.has_lse2() {
+                            atomic_store_lse2_release
+                        } else {
+                            atomic_store_no_lse2_release
+                        }
+                    });
+                }
+                Ordering::SeqCst => {
+                    ifunc!(unsafe fn(dst: *mut u128, val: u128) {
+                        let cpuinfo = detect::detect();
+                        if cpuinfo.has_lse2() {
+                            atomic_store_lse2_seqcst
+                        } else {
+                            atomic_store_no_lse2_seqcst
+                        }
+                    });
+                }
+                _ => unreachable!(),
+            }
+        }
+    }
+}
+// If CPU supports FEAT_LSE2, STP/STILP is single-copy atomic writes,
+// otherwise it is two single-copy atomic writes.
+// Refs: B2.2.1 of the Arm Architecture Reference Manual Armv8, for Armv8-A architecture profile
+#[cfg(any(
+    target_feature = "lse2",
+    portable_atomic_target_feature = "lse2",
+    not(portable_atomic_no_outline_atomics),
+))]
+#[inline]
+unsafe fn _atomic_store_stp(dst: *mut u128, val: u128, order: Ordering) {
+    debug_assert!(dst as usize % 16 == 0);
+    debug_assert_lse2!();
+
+    // SAFETY: the caller must guarantee that `dst` is valid for writes,
+    // 16-byte aligned, that there are no concurrent non-atomic operations.
+    //
+    // Refs:
+    // - STP: https://developer.arm.com/documentation/dui0801/l/A64-Data-Transfer-Instructions/STP--A64-
+    unsafe {
+        #[rustfmt::skip]
+        macro_rules! atomic_store {
+            ($acquire:tt, $release:tt) => {{
+                let val = U128 { whole: val };
+                asm!(
+                    $release,
+                    "stp {val_lo}, {val_hi}, [{dst}]",
+                    $acquire,
+                    dst = in(reg) ptr_reg!(dst),
+                    val_lo = in(reg) val.pair.lo,
+                    val_hi = in(reg) val.pair.hi,
+                    options(nostack, preserves_flags),
+                );
+            }};
+        }
+        match order {
+            Ordering::Relaxed => atomic_store!("", ""),
+            #[cfg(any(target_feature = "rcpc3", portable_atomic_target_feature = "rcpc3"))]
+            Ordering::Release => {
+                let val = U128 { whole: val };
+                // SAFETY: cfg guarantee that the CPU supports FEAT_LRCPC3.
+                // Refs: https://developer.arm.com/documentation/ddi0602/2023-03/Base-Instructions/STILP--Store-Release-ordered-Pair-of-registers-
+                asm!(
+                    "stilp {val_lo}, {val_hi}, [{dst}]",
+                    dst = in(reg) ptr_reg!(dst),
+                    val_lo = in(reg) val.pair.lo,
+                    val_hi = in(reg) val.pair.hi,
+                    options(nostack, preserves_flags),
+                );
+            }
+            #[cfg(not(any(target_feature = "rcpc3", portable_atomic_target_feature = "rcpc3")))]
+            #[cfg(any(target_feature = "lse128", portable_atomic_target_feature = "lse128"))]
+            Ordering::Release => {
+                // Use swpp if stp requires fences.
+                // https://reviews.llvm.org/D143506
+                // SAFETY: cfg guarantee that the CPU supports FEAT_LSE128.
+                _atomic_swap_swpp(dst, val, order);
+            }
+            #[cfg(not(any(target_feature = "rcpc3", portable_atomic_target_feature = "rcpc3")))]
+            #[cfg(not(any(target_feature = "lse128", portable_atomic_target_feature = "lse128")))]
+            Ordering::Release => atomic_store!("", "dmb ish"),
+            #[cfg(any(target_feature = "lse128", portable_atomic_target_feature = "lse128"))]
+            Ordering::SeqCst => {
+                // Use swpp if stp requires fences.
+                // https://reviews.llvm.org/D143506
+                // SAFETY: cfg guarantee that the CPU supports FEAT_LSE128.
+                _atomic_swap_swpp(dst, val, order);
+            }
+            #[cfg(not(any(target_feature = "lse128", portable_atomic_target_feature = "lse128")))]
+            Ordering::SeqCst => atomic_store!("dmb ish", "dmb ish"),
+            _ => unreachable!(),
+        }
+    }
+}
+// Do not use _atomic_swap_ldxp_stxp because it needs extra registers to implement store.
+#[cfg(any(
+    test,
+    not(all(
+        any(target_feature = "lse", portable_atomic_target_feature = "lse"),
+        not(portable_atomic_ll_sc_rmw),
+    ))
+))]
+#[inline]
+unsafe fn _atomic_store_ldxp_stxp(dst: *mut u128, val: u128, order: Ordering) {
+    debug_assert!(dst as usize % 16 == 0);
+
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        let val = U128 { whole: val };
+        macro_rules! store {
+            ($acquire:tt, $release:tt, $fence:tt) => {
+                asm!(
+                    "2:",
+                        concat!("ld", $acquire, "xp xzr, {tmp}, [{dst}]"),
+                        concat!("st", $release, "xp {tmp:w}, {val_lo}, {val_hi}, [{dst}]"),
+                        // 0 if the store was successful, 1 if no store was performed
+                        "cbnz {tmp:w}, 2b",
+                    $fence,
+                    dst = in(reg) ptr_reg!(dst),
+                    val_lo = in(reg) val.pair.lo,
+                    val_hi = in(reg) val.pair.hi,
+                    tmp = out(reg) _,
+                    options(nostack, preserves_flags),
+                )
+            };
+        }
+        atomic_rmw!(store, order);
+    }
+}
+
+#[inline]
+unsafe fn atomic_compare_exchange(
+    dst: *mut u128,
+    old: u128,
+    new: u128,
+    success: Ordering,
+    failure: Ordering,
+) -> Result<u128, u128> {
+    #[cfg(any(target_feature = "lse", portable_atomic_target_feature = "lse"))]
+    // SAFETY: the caller must uphold the safety contract.
+    // cfg guarantee that the CPU supports FEAT_LSE.
+    let prev = unsafe { _atomic_compare_exchange_casp(dst, old, new, success, failure) };
+    #[cfg(not(all(
+        not(portable_atomic_no_outline_atomics),
+        any(
+            all(
+                target_os = "linux",
+                any(
+                    target_env = "gnu",
+                    all(
+                        any(target_env = "musl", target_env = "ohos"),
+                        not(target_feature = "crt-static"),
+                    ),
+                    portable_atomic_outline_atomics,
+                ),
+            ),
+            target_os = "android",
+            target_os = "freebsd",
+            target_os = "netbsd",
+            target_os = "openbsd",
+            target_os = "fuchsia",
+            target_os = "windows",
+        ),
+    )))]
+    #[cfg(not(any(target_feature = "lse", portable_atomic_target_feature = "lse")))]
+    // SAFETY: the caller must uphold the safety contract.
+    let prev = unsafe { _atomic_compare_exchange_ldxp_stxp(dst, old, new, success, failure) };
+    #[cfg(all(
+        not(portable_atomic_no_outline_atomics),
+        any(
+            all(
+                target_os = "linux",
+                any(
+                    target_env = "gnu",
+                    all(
+                        any(target_env = "musl", target_env = "ohos"),
+                        not(target_feature = "crt-static"),
+                    ),
+                    portable_atomic_outline_atomics,
+                ),
+            ),
+            target_os = "android",
+            target_os = "freebsd",
+            target_os = "netbsd",
+            target_os = "openbsd",
+            target_os = "fuchsia",
+            target_os = "windows",
+        ),
+    ))]
+    #[cfg(not(any(target_feature = "lse", portable_atomic_target_feature = "lse")))]
+    let prev = {
+        fn_alias! {
+            // inline(never) is just a hint and also not strictly necessary
+            // because we use ifunc helper macro, but used for clarity.
+            #[inline(never)]
+            unsafe fn(dst: *mut u128, old: u128, new: u128) -> u128;
+            atomic_compare_exchange_casp_relaxed
+                = _atomic_compare_exchange_casp(Ordering::Relaxed, Ordering::Relaxed);
+            atomic_compare_exchange_casp_acquire
+                = _atomic_compare_exchange_casp(Ordering::Acquire, Ordering::Acquire);
+            atomic_compare_exchange_casp_release
+                = _atomic_compare_exchange_casp(Ordering::Release, Ordering::Relaxed);
+            atomic_compare_exchange_casp_acqrel
+                = _atomic_compare_exchange_casp(Ordering::AcqRel, Ordering::Acquire);
+            // AcqRel and SeqCst RMWs are equivalent in non-MSVC environments.
+            #[cfg(target_env = "msvc")]
+            atomic_compare_exchange_casp_seqcst
+                = _atomic_compare_exchange_casp(Ordering::SeqCst, Ordering::SeqCst);
+        }
+        fn_alias! {
+            unsafe fn(dst: *mut u128, old: u128, new: u128) -> u128;
+            atomic_compare_exchange_ldxp_stxp_relaxed
+                = _atomic_compare_exchange_ldxp_stxp(Ordering::Relaxed, Ordering::Relaxed);
+            atomic_compare_exchange_ldxp_stxp_acquire
+                = _atomic_compare_exchange_ldxp_stxp(Ordering::Acquire, Ordering::Acquire);
+            atomic_compare_exchange_ldxp_stxp_release
+                = _atomic_compare_exchange_ldxp_stxp(Ordering::Release, Ordering::Relaxed);
+            atomic_compare_exchange_ldxp_stxp_acqrel
+                = _atomic_compare_exchange_ldxp_stxp(Ordering::AcqRel, Ordering::Acquire);
+            // AcqRel and SeqCst RMWs are equivalent in non-MSVC environments.
+            #[cfg(target_env = "msvc")]
+            atomic_compare_exchange_ldxp_stxp_seqcst
+                = _atomic_compare_exchange_ldxp_stxp(Ordering::SeqCst, Ordering::SeqCst);
+        }
+        // SAFETY: the caller must guarantee that `dst` is valid for both writes and
+        // reads, 16-byte aligned, that there are no concurrent non-atomic operations,
+        // and we've checked if FEAT_LSE is available.
+        unsafe {
+            let success = crate::utils::upgrade_success_ordering(success, failure);
+            match success {
+                Ordering::Relaxed => {
+                    ifunc!(unsafe fn(dst: *mut u128, old: u128, new: u128) -> u128 {
+                        if detect::detect().has_lse() {
+                            atomic_compare_exchange_casp_relaxed
+                        } else {
+                            atomic_compare_exchange_ldxp_stxp_relaxed
+                        }
+                    })
+                }
+                Ordering::Acquire => {
+                    ifunc!(unsafe fn(dst: *mut u128, old: u128, new: u128) -> u128 {
+                        if detect::detect().has_lse() {
+                            atomic_compare_exchange_casp_acquire
+                        } else {
+                            atomic_compare_exchange_ldxp_stxp_acquire
+                        }
+                    })
+                }
+                Ordering::Release => {
+                    ifunc!(unsafe fn(dst: *mut u128, old: u128, new: u128) -> u128 {
+                        if detect::detect().has_lse() {
+                            atomic_compare_exchange_casp_release
+                        } else {
+                            atomic_compare_exchange_ldxp_stxp_release
+                        }
+                    })
+                }
+                // AcqRel and SeqCst RMWs are equivalent in both implementations in non-MSVC environments.
+                #[cfg(not(target_env = "msvc"))]
+                Ordering::AcqRel | Ordering::SeqCst => {
+                    ifunc!(unsafe fn(dst: *mut u128, old: u128, new: u128) -> u128 {
+                        if detect::detect().has_lse() {
+                            atomic_compare_exchange_casp_acqrel
+                        } else {
+                            atomic_compare_exchange_ldxp_stxp_acqrel
+                        }
+                    })
+                }
+                #[cfg(target_env = "msvc")]
+                Ordering::AcqRel => {
+                    ifunc!(unsafe fn(dst: *mut u128, old: u128, new: u128) -> u128 {
+                        if detect::detect().has_lse() {
+                            atomic_compare_exchange_casp_acqrel
+                        } else {
+                            atomic_compare_exchange_ldxp_stxp_acqrel
+                        }
+                    })
+                }
+                #[cfg(target_env = "msvc")]
+                Ordering::SeqCst => {
+                    ifunc!(unsafe fn(dst: *mut u128, old: u128, new: u128) -> u128 {
+                        if detect::detect().has_lse() {
+                            atomic_compare_exchange_casp_seqcst
+                        } else {
+                            atomic_compare_exchange_ldxp_stxp_seqcst
+                        }
+                    })
+                }
+                _ => unreachable!(),
+            }
+        }
+    };
+    if prev == old {
+        Ok(prev)
+    } else {
+        Err(prev)
+    }
+}
+#[cfg(any(
+    target_feature = "lse",
+    portable_atomic_target_feature = "lse",
+    not(portable_atomic_no_outline_atomics),
+))]
+#[inline]
+unsafe fn _atomic_compare_exchange_casp(
+    dst: *mut u128,
+    old: u128,
+    new: u128,
+    success: Ordering,
+    failure: Ordering,
+) -> u128 {
+    debug_assert!(dst as usize % 16 == 0);
+    debug_assert_lse!();
+    let order = crate::utils::upgrade_success_ordering(success, failure);
+
+    // SAFETY: the caller must guarantee that `dst` is valid for both writes and
+    // reads, 16-byte aligned, that there are no concurrent non-atomic operations,
+    // and the CPU supports FEAT_LSE.
+    //
+    // Refs:
+    // - https://developer.arm.com/documentation/dui0801/l/A64-Data-Transfer-Instructions/CASPA--CASPAL--CASP--CASPL--CASPAL--CASP--CASPL--A64-
+    // - https://developer.arm.com/documentation/ddi0602/2023-06/Base-Instructions/CASP--CASPA--CASPAL--CASPL--Compare-and-Swap-Pair-of-words-or-doublewords-in-memory-
+    unsafe {
+        let old = U128 { whole: old };
+        let new = U128 { whole: new };
+        let (prev_lo, prev_hi);
+        macro_rules! cmpxchg {
+            ($acquire:tt, $release:tt, $fence:tt) => {
+                asm!(
+                    start_lse!(),
+                    concat!("casp", $acquire, $release, " x6, x7, x4, x5, [{dst}]"),
+                    $fence,
+                    dst = in(reg) ptr_reg!(dst),
+                    // must be allocated to even/odd register pair
+                    inout("x6") old.pair.lo => prev_lo,
+                    inout("x7") old.pair.hi => prev_hi,
+                    // must be allocated to even/odd register pair
+                    in("x4") new.pair.lo,
+                    in("x5") new.pair.hi,
+                    options(nostack, preserves_flags),
+                )
+            };
+        }
+        atomic_rmw!(cmpxchg, order, write = success);
+        U128 { pair: Pair { lo: prev_lo, hi: prev_hi } }.whole
+    }
+}
+#[cfg(any(test, not(any(target_feature = "lse", portable_atomic_target_feature = "lse"))))]
+#[inline]
+unsafe fn _atomic_compare_exchange_ldxp_stxp(
+    dst: *mut u128,
+    old: u128,
+    new: u128,
+    success: Ordering,
+    failure: Ordering,
+) -> u128 {
+    debug_assert!(dst as usize % 16 == 0);
+    let order = crate::utils::upgrade_success_ordering(success, failure);
+
+    // SAFETY: the caller must guarantee that `dst` is valid for both writes and
+    // reads, 16-byte aligned, and that there are no concurrent non-atomic operations.
+    //
+    // Refs:
+    // - LDXP: https://developer.arm.com/documentation/dui0801/l/A64-Data-Transfer-Instructions/LDXP--A64-
+    // - LDAXP: https://developer.arm.com/documentation/dui0801/l/A64-Data-Transfer-Instructions/LDAXP--A64-
+    // - STXP: https://developer.arm.com/documentation/dui0801/l/A64-Data-Transfer-Instructions/STXP--A64-
+    // - STLXP: https://developer.arm.com/documentation/dui0801/l/A64-Data-Transfer-Instructions/STLXP--A64-
+    //
+    // Note: Load-Exclusive pair (by itself) does not guarantee atomicity; to complete an atomic
+    // operation (even load/store), a corresponding Store-Exclusive pair must succeed.
+    // See Arm Architecture Reference Manual for A-profile architecture
+    // Section B2.2.1 "Requirements for single-copy atomicity", and
+    // Section B2.9 "Synchronization and semaphores" for more.
+    unsafe {
+        let old = U128 { whole: old };
+        let new = U128 { whole: new };
+        let (mut prev_lo, mut prev_hi);
+        macro_rules! cmpxchg {
+            ($acquire:tt, $release:tt, $fence:tt) => {
+                asm!(
+                    "2:",
+                        concat!("ld", $acquire, "xp {prev_lo}, {prev_hi}, [{dst}]"),
+                        "cmp {prev_lo}, {old_lo}",
+                        "cset {r:w}, ne",
+                        "cmp {prev_hi}, {old_hi}",
+                        "cinc {r:w}, {r:w}, ne",
+                        "cbz {r:w}, 3f",
+                        concat!("st", $release, "xp {r:w}, {prev_lo}, {prev_hi}, [{dst}]"),
+                        // 0 if the store was successful, 1 if no store was performed
+                        "cbnz {r:w}, 2b",
+                        "b 4f",
+                    "3:",
+                        concat!("st", $release, "xp {r:w}, {new_lo}, {new_hi}, [{dst}]"),
+                        // 0 if the store was successful, 1 if no store was performed
+                        "cbnz {r:w}, 2b",
+                    "4:",
+                    $fence,
+                    dst = in(reg) ptr_reg!(dst),
+                    old_lo = in(reg) old.pair.lo,
+                    old_hi = in(reg) old.pair.hi,
+                    new_lo = in(reg) new.pair.lo,
+                    new_hi = in(reg) new.pair.hi,
+                    prev_lo = out(reg) prev_lo,
+                    prev_hi = out(reg) prev_hi,
+                    r = out(reg) _,
+                    // Do not use `preserves_flags` because CMP modifies the condition flags.
+                    options(nostack),
+                )
+            };
+        }
+        atomic_rmw!(cmpxchg, order, write = success);
+        U128 { pair: Pair { lo: prev_lo, hi: prev_hi } }.whole
+    }
+}
+
+// casp is always strong, and ldxp requires a corresponding (succeed) stxp for
+// its atomicity (see code comment in _atomic_compare_exchange_ldxp_stxp).
+// (i.e., aarch64 doesn't have 128-bit weak CAS)
+use self::atomic_compare_exchange as atomic_compare_exchange_weak;
+
+// If FEAT_LSE is available at compile-time and portable_atomic_ll_sc_rmw cfg is not set,
+// we use CAS-based atomic RMW.
+#[cfg(not(any(target_feature = "lse128", portable_atomic_target_feature = "lse128")))]
+#[cfg(all(
+    any(target_feature = "lse", portable_atomic_target_feature = "lse"),
+    not(portable_atomic_ll_sc_rmw),
+))]
+use _atomic_swap_casp as atomic_swap;
+#[cfg(not(any(target_feature = "lse128", portable_atomic_target_feature = "lse128")))]
+#[cfg(not(all(
+    any(target_feature = "lse", portable_atomic_target_feature = "lse"),
+    not(portable_atomic_ll_sc_rmw),
+)))]
+use _atomic_swap_ldxp_stxp as atomic_swap;
+#[cfg(any(target_feature = "lse128", portable_atomic_target_feature = "lse128"))]
+use _atomic_swap_swpp as atomic_swap;
+#[cfg(any(target_feature = "lse128", portable_atomic_target_feature = "lse128"))]
+#[inline]
+unsafe fn _atomic_swap_swpp(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+    debug_assert!(dst as usize % 16 == 0);
+
+    // SAFETY: the caller must guarantee that `dst` is valid for both writes and
+    // reads, 16-byte aligned, that there are no concurrent non-atomic operations,
+    // and the CPU supports FEAT_LSE128.
+    //
+    // Refs:
+    // - https://developer.arm.com/documentation/ddi0602/2023-03/Base-Instructions/SWPP--SWPPA--SWPPAL--SWPPL--Swap-quadword-in-memory-?lang=en
+    unsafe {
+        let val = U128 { whole: val };
+        let (prev_lo, prev_hi);
+        macro_rules! swap {
+            ($acquire:tt, $release:tt, $fence:tt) => {
+                asm!(
+                    concat!("swpp", $acquire, $release, " {val_lo}, {val_hi}, [{dst}]"),
+                    $fence,
+                    dst = in(reg) ptr_reg!(dst),
+                    val_lo = inout(reg) val.pair.lo => prev_lo,
+                    val_hi = inout(reg) val.pair.hi => prev_hi,
+                    options(nostack, preserves_flags),
+                )
+            };
+        }
+        atomic_rmw!(swap, order);
+        U128 { pair: Pair { lo: prev_lo, hi: prev_hi } }.whole
+    }
+}
+// Do not use atomic_rmw_cas_3 because it needs extra MOV to implement swap.
+#[cfg(any(test, not(portable_atomic_ll_sc_rmw)))]
+#[cfg(any(target_feature = "lse", portable_atomic_target_feature = "lse"))]
+#[inline]
+unsafe fn _atomic_swap_casp(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+    debug_assert!(dst as usize % 16 == 0);
+    debug_assert_lse!();
+
+    // SAFETY: the caller must uphold the safety contract.
+    // cfg guarantee that the CPU supports FEAT_LSE.
+    unsafe {
+        let val = U128 { whole: val };
+        let (mut prev_lo, mut prev_hi);
+        macro_rules! swap {
+            ($acquire:tt, $release:tt, $fence:tt) => {
+                asm!(
+                    start_lse!(),
+                    // If FEAT_LSE2 is not supported, this works like byte-wise atomic.
+                    // This is not single-copy atomic reads, but this is ok because subsequent
+                    // CAS will check for consistency.
+                    "ldp x4, x5, [{dst}]",
+                    "2:",
+                        // casp writes the current value to the first register pair,
+                        // so copy the `out`'s value for later comparison.
+                        "mov {tmp_lo}, x4",
+                        "mov {tmp_hi}, x5",
+                        concat!("casp", $acquire, $release, " x4, x5, x2, x3, [{dst}]"),
+                        "cmp {tmp_hi}, x5",
+                        "ccmp {tmp_lo}, x4, #0, eq",
+                        "b.ne 2b",
+                    $fence,
+                    dst = in(reg) ptr_reg!(dst),
+                    tmp_lo = out(reg) _,
+                    tmp_hi = out(reg) _,
+                    // must be allocated to even/odd register pair
+                    out("x4") prev_lo,
+                    out("x5") prev_hi,
+                    // must be allocated to even/odd register pair
+                    in("x2") val.pair.lo,
+                    in("x3") val.pair.hi,
+                    // Do not use `preserves_flags` because CMP and CCMP modify the condition flags.
+                    options(nostack),
+                )
+            };
+        }
+        atomic_rmw!(swap, order);
+        U128 { pair: Pair { lo: prev_lo, hi: prev_hi } }.whole
+    }
+}
+// Do not use atomic_rmw_ll_sc_3 because it needs extra MOV to implement swap.
+#[cfg(any(
+    test,
+    not(all(
+        any(target_feature = "lse", portable_atomic_target_feature = "lse"),
+        not(portable_atomic_ll_sc_rmw),
+    ))
+))]
+#[inline]
+unsafe fn _atomic_swap_ldxp_stxp(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+    debug_assert!(dst as usize % 16 == 0);
+
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        let val = U128 { whole: val };
+        let (mut prev_lo, mut prev_hi);
+        macro_rules! swap {
+            ($acquire:tt, $release:tt, $fence:tt) => {
+                asm!(
+                    "2:",
+                        concat!("ld", $acquire, "xp {prev_lo}, {prev_hi}, [{dst}]"),
+                        concat!("st", $release, "xp {r:w}, {val_lo}, {val_hi}, [{dst}]"),
+                        // 0 if the store was successful, 1 if no store was performed
+                        "cbnz {r:w}, 2b",
+                    $fence,
+                    dst = in(reg) ptr_reg!(dst),
+                    val_lo = in(reg) val.pair.lo,
+                    val_hi = in(reg) val.pair.hi,
+                    prev_lo = out(reg) prev_lo,
+                    prev_hi = out(reg) prev_hi,
+                    r = out(reg) _,
+                    options(nostack, preserves_flags),
+                )
+            };
+        }
+        atomic_rmw!(swap, order);
+        U128 { pair: Pair { lo: prev_lo, hi: prev_hi } }.whole
+    }
+}
+
+/// Atomic RMW by LL/SC loop (3 arguments)
+/// `unsafe fn(dst: *mut u128, val: u128, order: Ordering) -> u128;`
+///
+/// `$op` can use the following registers:
+/// - val_lo/val_hi pair: val argument (read-only for `$op`)
+/// - prev_lo/prev_hi pair: previous value loaded by ll (read-only for `$op`)
+/// - new_lo/new_hi pair: new value that will be stored by sc
+macro_rules! atomic_rmw_ll_sc_3 {
+    ($name:ident as $reexport_name:ident $(($preserves_flags:tt))?, $($op:tt)*) => {
+        // If FEAT_LSE is available at compile-time and portable_atomic_ll_sc_rmw cfg is not set,
+        // we use CAS-based atomic RMW generated by atomic_rmw_cas_3! macro instead.
+        #[cfg(not(all(
+            any(target_feature = "lse", portable_atomic_target_feature = "lse"),
+            not(portable_atomic_ll_sc_rmw),
+        )))]
+        use $name as $reexport_name;
+        #[cfg(any(
+            test,
+            not(all(
+                any(target_feature = "lse", portable_atomic_target_feature = "lse"),
+                not(portable_atomic_ll_sc_rmw),
+            ))
+        ))]
+        #[inline]
+        unsafe fn $name(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+            debug_assert!(dst as usize % 16 == 0);
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe {
+                let val = U128 { whole: val };
+                let (mut prev_lo, mut prev_hi);
+                macro_rules! op {
+                    ($acquire:tt, $release:tt, $fence:tt) => {
+                        asm!(
+                            "2:",
+                                concat!("ld", $acquire, "xp {prev_lo}, {prev_hi}, [{dst}]"),
+                                $($op)*
+                                concat!("st", $release, "xp {r:w}, {new_lo}, {new_hi}, [{dst}]"),
+                                // 0 if the store was successful, 1 if no store was performed
+                                "cbnz {r:w}, 2b",
+                            $fence,
+                            dst = in(reg) ptr_reg!(dst),
+                            val_lo = in(reg) val.pair.lo,
+                            val_hi = in(reg) val.pair.hi,
+                            prev_lo = out(reg) prev_lo,
+                            prev_hi = out(reg) prev_hi,
+                            new_lo = out(reg) _,
+                            new_hi = out(reg) _,
+                            r = out(reg) _,
+                            options(nostack $(, $preserves_flags)?),
+                        )
+                    };
+                }
+                atomic_rmw!(op, order);
+                U128 { pair: Pair { lo: prev_lo, hi: prev_hi } }.whole
+            }
+        }
+    };
+}
+/// Atomic RMW by CAS loop (3 arguments)
+/// `unsafe fn(dst: *mut u128, val: u128, order: Ordering) -> u128;`
+///
+/// `$op` can use the following registers:
+/// - val_lo/val_hi pair: val argument (read-only for `$op`)
+/// - x6/x7 pair: previous value loaded (read-only for `$op`)
+/// - x4/x5 pair: new value that will be stored
+macro_rules! atomic_rmw_cas_3 {
+    ($name:ident as $reexport_name:ident, $($op:tt)*) => {
+        // If FEAT_LSE is not available at compile-time or portable_atomic_ll_sc_rmw cfg is set,
+        // we use LL/SC-based atomic RMW generated by atomic_rmw_ll_sc_3! macro instead.
+        #[cfg(all(
+            any(target_feature = "lse", portable_atomic_target_feature = "lse"),
+            not(portable_atomic_ll_sc_rmw),
+        ))]
+        use $name as $reexport_name;
+        #[cfg(any(test, not(portable_atomic_ll_sc_rmw)))]
+        #[cfg(any(target_feature = "lse", portable_atomic_target_feature = "lse"))]
+        #[inline]
+        unsafe fn $name(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+            debug_assert!(dst as usize % 16 == 0);
+            debug_assert_lse!();
+            // SAFETY: the caller must uphold the safety contract.
+            // cfg guarantee that the CPU supports FEAT_LSE.
+            unsafe {
+                let val = U128 { whole: val };
+                let (mut prev_lo, mut prev_hi);
+                macro_rules! op {
+                    ($acquire:tt, $release:tt, $fence:tt) => {
+                        asm!(
+                            start_lse!(),
+                            // If FEAT_LSE2 is not supported, this works like byte-wise atomic.
+                            // This is not single-copy atomic reads, but this is ok because subsequent
+                            // CAS will check for consistency.
+                            "ldp x6, x7, [{dst}]",
+                            "2:",
+                                // casp writes the current value to the first register pair,
+                                // so copy the `out`'s value for later comparison.
+                                "mov {tmp_lo}, x6",
+                                "mov {tmp_hi}, x7",
+                                $($op)*
+                                concat!("casp", $acquire, $release, " x6, x7, x4, x5, [{dst}]"),
+                                "cmp {tmp_hi}, x7",
+                                "ccmp {tmp_lo}, x6, #0, eq",
+                                "b.ne 2b",
+                            $fence,
+                            dst = in(reg) ptr_reg!(dst),
+                            val_lo = in(reg) val.pair.lo,
+                            val_hi = in(reg) val.pair.hi,
+                            tmp_lo = out(reg) _,
+                            tmp_hi = out(reg) _,
+                            // must be allocated to even/odd register pair
+                            out("x6") prev_lo,
+                            out("x7") prev_hi,
+                            // must be allocated to even/odd register pair
+                            out("x4") _,
+                            out("x5") _,
+                            // Do not use `preserves_flags` because CMP and CCMP modify the condition flags.
+                            options(nostack),
+                        )
+                    };
+                }
+                atomic_rmw!(op, order);
+                U128 { pair: Pair { lo: prev_lo, hi: prev_hi } }.whole
+            }
+        }
+    };
+}
+
+/// Atomic RMW by LL/SC loop (2 arguments)
+/// `unsafe fn(dst: *mut u128, order: Ordering) -> u128;`
+///
+/// `$op` can use the following registers:
+/// - prev_lo/prev_hi pair: previous value loaded by ll (read-only for `$op`)
+/// - new_lo/new_hi pair: new value that will be stored by sc
+macro_rules! atomic_rmw_ll_sc_2 {
+    ($name:ident as $reexport_name:ident $(($preserves_flags:tt))?, $($op:tt)*) => {
+        // If FEAT_LSE is available at compile-time and portable_atomic_ll_sc_rmw cfg is not set,
+        // we use CAS-based atomic RMW generated by atomic_rmw_cas_2! macro instead.
+        #[cfg(not(all(
+            any(target_feature = "lse", portable_atomic_target_feature = "lse"),
+            not(portable_atomic_ll_sc_rmw),
+        )))]
+        use $name as $reexport_name;
+        #[cfg(any(
+            test,
+            not(all(
+                any(target_feature = "lse", portable_atomic_target_feature = "lse"),
+                not(portable_atomic_ll_sc_rmw),
+            ))
+        ))]
+        #[inline]
+        unsafe fn $name(dst: *mut u128, order: Ordering) -> u128 {
+            debug_assert!(dst as usize % 16 == 0);
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe {
+                let (mut prev_lo, mut prev_hi);
+                macro_rules! op {
+                    ($acquire:tt, $release:tt, $fence:tt) => {
+                        asm!(
+                            "2:",
+                                concat!("ld", $acquire, "xp {prev_lo}, {prev_hi}, [{dst}]"),
+                                $($op)*
+                                concat!("st", $release, "xp {r:w}, {new_lo}, {new_hi}, [{dst}]"),
+                                // 0 if the store was successful, 1 if no store was performed
+                                "cbnz {r:w}, 2b",
+                            $fence,
+                            dst = in(reg) ptr_reg!(dst),
+                            prev_lo = out(reg) prev_lo,
+                            prev_hi = out(reg) prev_hi,
+                            new_lo = out(reg) _,
+                            new_hi = out(reg) _,
+                            r = out(reg) _,
+                            options(nostack $(, $preserves_flags)?),
+                        )
+                    };
+                }
+                atomic_rmw!(op, order);
+                U128 { pair: Pair { lo: prev_lo, hi: prev_hi } }.whole
+            }
+        }
+    };
+}
+/// Atomic RMW by CAS loop (2 arguments)
+/// `unsafe fn(dst: *mut u128, order: Ordering) -> u128;`
+///
+/// `$op` can use the following registers:
+/// - x6/x7 pair: previous value loaded (read-only for `$op`)
+/// - x4/x5 pair: new value that will be stored
+macro_rules! atomic_rmw_cas_2 {
+    ($name:ident as $reexport_name:ident, $($op:tt)*) => {
+        // If FEAT_LSE is not available at compile-time or portable_atomic_ll_sc_rmw cfg is set,
+        // we use LL/SC-based atomic RMW generated by atomic_rmw_ll_sc_3! macro instead.
+        #[cfg(all(
+            any(target_feature = "lse", portable_atomic_target_feature = "lse"),
+            not(portable_atomic_ll_sc_rmw),
+        ))]
+        use $name as $reexport_name;
+        #[cfg(any(test, not(portable_atomic_ll_sc_rmw)))]
+        #[cfg(any(target_feature = "lse", portable_atomic_target_feature = "lse"))]
+        #[inline]
+        unsafe fn $name(dst: *mut u128, order: Ordering) -> u128 {
+            debug_assert!(dst as usize % 16 == 0);
+            debug_assert_lse!();
+            // SAFETY: the caller must uphold the safety contract.
+            // cfg guarantee that the CPU supports FEAT_LSE.
+            unsafe {
+                let (mut prev_lo, mut prev_hi);
+                macro_rules! op {
+                    ($acquire:tt, $release:tt, $fence:tt) => {
+                        asm!(
+                            start_lse!(),
+                            // If FEAT_LSE2 is not supported, this works like byte-wise atomic.
+                            // This is not single-copy atomic reads, but this is ok because subsequent
+                            // CAS will check for consistency.
+                            "ldp x6, x7, [{dst}]",
+                            "2:",
+                                // casp writes the current value to the first register pair,
+                                // so copy the `out`'s value for later comparison.
+                                "mov {tmp_lo}, x6",
+                                "mov {tmp_hi}, x7",
+                                $($op)*
+                                concat!("casp", $acquire, $release, " x6, x7, x4, x5, [{dst}]"),
+                                "cmp {tmp_hi}, x7",
+                                "ccmp {tmp_lo}, x6, #0, eq",
+                                "b.ne 2b",
+                            $fence,
+                            dst = in(reg) ptr_reg!(dst),
+                            tmp_lo = out(reg) _,
+                            tmp_hi = out(reg) _,
+                            // must be allocated to even/odd register pair
+                            out("x6") prev_lo,
+                            out("x7") prev_hi,
+                            // must be allocated to even/odd register pair
+                            out("x4") _,
+                            out("x5") _,
+                            // Do not use `preserves_flags` because CMP and CCMP modify the condition flags.
+                            options(nostack),
+                        )
+                    };
+                }
+                atomic_rmw!(op, order);
+                U128 { pair: Pair { lo: prev_lo, hi: prev_hi } }.whole
+            }
+        }
+    };
+}
+
+// Do not use `preserves_flags` because ADDS modifies the condition flags.
+atomic_rmw_ll_sc_3! {
+    _atomic_add_ldxp_stxp as atomic_add,
+    select_le_or_be!("adds {new_lo}, {prev_lo}, {val_lo}", "adds {new_hi}, {prev_hi}, {val_hi}"),
+    select_le_or_be!("adc {new_hi}, {prev_hi}, {val_hi}", "adc {new_lo}, {prev_lo}, {val_lo}"),
+}
+atomic_rmw_cas_3! {
+    _atomic_add_casp as atomic_add,
+    select_le_or_be!("adds x4, x6, {val_lo}", "adds x5, x7, {val_hi}"),
+    select_le_or_be!("adc x5, x7, {val_hi}", "adc x4, x6, {val_lo}"),
+}
+
+// Do not use `preserves_flags` because SUBS modifies the condition flags.
+atomic_rmw_ll_sc_3! {
+    _atomic_sub_ldxp_stxp as atomic_sub,
+    select_le_or_be!("subs {new_lo}, {prev_lo}, {val_lo}", "subs {new_hi}, {prev_hi}, {val_hi}"),
+    select_le_or_be!("sbc {new_hi}, {prev_hi}, {val_hi}", "sbc {new_lo}, {prev_lo}, {val_lo}"),
+}
+atomic_rmw_cas_3! {
+    _atomic_sub_casp as atomic_sub,
+    select_le_or_be!("subs x4, x6, {val_lo}", "subs x5, x7, {val_hi}"),
+    select_le_or_be!("sbc x5, x7, {val_hi}", "sbc x4, x6, {val_lo}"),
+}
+
+#[cfg(not(any(target_feature = "lse128", portable_atomic_target_feature = "lse128")))]
+atomic_rmw_ll_sc_3! {
+    _atomic_and_ldxp_stxp as atomic_and (preserves_flags),
+    "and {new_lo}, {prev_lo}, {val_lo}",
+    "and {new_hi}, {prev_hi}, {val_hi}",
+}
+#[cfg(not(any(target_feature = "lse128", portable_atomic_target_feature = "lse128")))]
+atomic_rmw_cas_3! {
+    _atomic_and_casp as atomic_and,
+    "and x4, x6, {val_lo}",
+    "and x5, x7, {val_hi}",
+}
+#[cfg(any(target_feature = "lse128", portable_atomic_target_feature = "lse128"))]
+#[inline]
+unsafe fn atomic_and(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+    debug_assert!(dst as usize % 16 == 0);
+
+    // SAFETY: the caller must guarantee that `dst` is valid for both writes and
+    // reads, 16-byte aligned, that there are no concurrent non-atomic operations,
+    // and the CPU supports FEAT_LSE128.
+    //
+    // Refs:
+    // - https://developer.arm.com/documentation/ddi0602/2023-03/Base-Instructions/LDCLRP--LDCLRPA--LDCLRPAL--LDCLRPL--Atomic-bit-clear-on-quadword-in-memory-?lang=en
+    unsafe {
+        let val = U128 { whole: !val };
+        let (prev_lo, prev_hi);
+        macro_rules! and {
+            ($acquire:tt, $release:tt, $fence:tt) => {
+                asm!(
+                    concat!("ldclrp", $acquire, $release, " {val_lo}, {val_hi}, [{dst}]"),
+                    $fence,
+                    dst = in(reg) ptr_reg!(dst),
+                    val_lo = inout(reg) val.pair.lo => prev_lo,
+                    val_hi = inout(reg) val.pair.hi => prev_hi,
+                    options(nostack, preserves_flags),
+                )
+            };
+        }
+        atomic_rmw!(and, order);
+        U128 { pair: Pair { lo: prev_lo, hi: prev_hi } }.whole
+    }
+}
+
+atomic_rmw_ll_sc_3! {
+    _atomic_nand_ldxp_stxp as atomic_nand (preserves_flags),
+    "and {new_lo}, {prev_lo}, {val_lo}",
+    "mvn {new_lo}, {new_lo}",
+    "and {new_hi}, {prev_hi}, {val_hi}",
+    "mvn {new_hi}, {new_hi}",
+}
+atomic_rmw_cas_3! {
+    _atomic_nand_casp as atomic_nand,
+    "and x4, x6, {val_lo}",
+    "mvn x4, x4",
+    "and x5, x7, {val_hi}",
+    "mvn x5, x5",
+}
+
+#[cfg(not(any(target_feature = "lse128", portable_atomic_target_feature = "lse128")))]
+atomic_rmw_ll_sc_3! {
+    _atomic_or_ldxp_stxp as atomic_or (preserves_flags),
+    "orr {new_lo}, {prev_lo}, {val_lo}",
+    "orr {new_hi}, {prev_hi}, {val_hi}",
+}
+#[cfg(not(any(target_feature = "lse128", portable_atomic_target_feature = "lse128")))]
+atomic_rmw_cas_3! {
+    _atomic_or_casp as atomic_or,
+    "orr x4, x6, {val_lo}",
+    "orr x5, x7, {val_hi}",
+}
+#[cfg(any(target_feature = "lse128", portable_atomic_target_feature = "lse128"))]
+#[inline]
+unsafe fn atomic_or(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+    debug_assert!(dst as usize % 16 == 0);
+
+    // SAFETY: the caller must guarantee that `dst` is valid for both writes and
+    // reads, 16-byte aligned, that there are no concurrent non-atomic operations,
+    // and the CPU supports FEAT_LSE128.
+    //
+    // Refs:
+    // - https://developer.arm.com/documentation/ddi0602/2023-03/Base-Instructions/LDSETP--LDSETPA--LDSETPAL--LDSETPL--Atomic-bit-set-on-quadword-in-memory-?lang=en
+    unsafe {
+        let val = U128 { whole: val };
+        let (prev_lo, prev_hi);
+        macro_rules! or {
+            ($acquire:tt, $release:tt, $fence:tt) => {
+                asm!(
+                    concat!("ldsetp", $acquire, $release, " {val_lo}, {val_hi}, [{dst}]"),
+                    $fence,
+                    dst = in(reg) ptr_reg!(dst),
+                    val_lo = inout(reg) val.pair.lo => prev_lo,
+                    val_hi = inout(reg) val.pair.hi => prev_hi,
+                    options(nostack, preserves_flags),
+                )
+            };
+        }
+        atomic_rmw!(or, order);
+        U128 { pair: Pair { lo: prev_lo, hi: prev_hi } }.whole
+    }
+}
+
+atomic_rmw_ll_sc_3! {
+    _atomic_xor_ldxp_stxp as atomic_xor (preserves_flags),
+    "eor {new_lo}, {prev_lo}, {val_lo}",
+    "eor {new_hi}, {prev_hi}, {val_hi}",
+}
+atomic_rmw_cas_3! {
+    _atomic_xor_casp as atomic_xor,
+    "eor x4, x6, {val_lo}",
+    "eor x5, x7, {val_hi}",
+}
+
+atomic_rmw_ll_sc_2! {
+    _atomic_not_ldxp_stxp as atomic_not (preserves_flags),
+    "mvn {new_lo}, {prev_lo}",
+    "mvn {new_hi}, {prev_hi}",
+}
+atomic_rmw_cas_2! {
+    _atomic_not_casp as atomic_not,
+    "mvn x4, x6",
+    "mvn x5, x7",
+}
+
+// Do not use `preserves_flags` because NEGS modifies the condition flags.
+atomic_rmw_ll_sc_2! {
+    _atomic_neg_ldxp_stxp as atomic_neg,
+    select_le_or_be!("negs {new_lo}, {prev_lo}", "negs {new_hi}, {prev_hi}"),
+    select_le_or_be!("ngc {new_hi}, {prev_hi}", "ngc {new_lo}, {prev_lo}"),
+}
+atomic_rmw_cas_2! {
+    _atomic_neg_casp as atomic_neg,
+    select_le_or_be!("negs x4, x6", "negs x5, x7"),
+    select_le_or_be!("ngc x5, x7", "ngc x4, x6"),
+}
+
+// Do not use `preserves_flags` because CMP and SBCS modify the condition flags.
+atomic_rmw_ll_sc_3! {
+    _atomic_max_ldxp_stxp as atomic_max,
+    select_le_or_be!("cmp {val_lo}, {prev_lo}", "cmp {val_hi}, {prev_hi}"),
+    select_le_or_be!("sbcs xzr, {val_hi}, {prev_hi}", "sbcs xzr, {val_lo}, {prev_lo}"),
+    "csel {new_hi}, {prev_hi}, {val_hi}, lt", // select hi 64-bit
+    "csel {new_lo}, {prev_lo}, {val_lo}, lt", // select lo 64-bit
+}
+atomic_rmw_cas_3! {
+    _atomic_max_casp as atomic_max,
+    select_le_or_be!("cmp {val_lo}, x6", "cmp {val_hi}, x7"),
+    select_le_or_be!("sbcs xzr, {val_hi}, x7", "sbcs xzr, {val_lo}, x6"),
+    "csel x5, x7, {val_hi}, lt", // select hi 64-bit
+    "csel x4, x6, {val_lo}, lt", // select lo 64-bit
+}
+
+// Do not use `preserves_flags` because CMP and SBCS modify the condition flags.
+atomic_rmw_ll_sc_3! {
+    _atomic_umax_ldxp_stxp as atomic_umax,
+    select_le_or_be!("cmp {val_lo}, {prev_lo}", "cmp {val_hi}, {prev_hi}"),
+    select_le_or_be!("sbcs xzr, {val_hi}, {prev_hi}", "sbcs xzr, {val_lo}, {prev_lo}"),
+    "csel {new_hi}, {prev_hi}, {val_hi}, lo", // select hi 64-bit
+    "csel {new_lo}, {prev_lo}, {val_lo}, lo", // select lo 64-bit
+}
+atomic_rmw_cas_3! {
+    _atomic_umax_casp as atomic_umax,
+    select_le_or_be!("cmp {val_lo}, x6", "cmp {val_hi}, x7"),
+    select_le_or_be!("sbcs xzr, {val_hi}, x7", "sbcs xzr, {val_lo}, x6"),
+    "csel x5, x7, {val_hi}, lo", // select hi 64-bit
+    "csel x4, x6, {val_lo}, lo", // select lo 64-bit
+}
+
+// Do not use `preserves_flags` because CMP and SBCS modify the condition flags.
+atomic_rmw_ll_sc_3! {
+    _atomic_min_ldxp_stxp as atomic_min,
+    select_le_or_be!("cmp {val_lo}, {prev_lo}", "cmp {val_hi}, {prev_hi}"),
+    select_le_or_be!("sbcs xzr, {val_hi}, {prev_hi}", "sbcs xzr, {val_lo}, {prev_lo}"),
+    "csel {new_hi}, {prev_hi}, {val_hi}, ge", // select hi 64-bit
+    "csel {new_lo}, {prev_lo}, {val_lo}, ge", // select lo 64-bit
+}
+atomic_rmw_cas_3! {
+    _atomic_min_casp as atomic_min,
+    select_le_or_be!("cmp {val_lo}, x6", "cmp {val_hi}, x7"),
+    select_le_or_be!("sbcs xzr, {val_hi}, x7", "sbcs xzr, {val_lo}, x6"),
+    "csel x5, x7, {val_hi}, ge", // select hi 64-bit
+    "csel x4, x6, {val_lo}, ge", // select lo 64-bit
+}
+
+// Do not use `preserves_flags` because CMP and SBCS modify the condition flags.
+atomic_rmw_ll_sc_3! {
+    _atomic_umin_ldxp_stxp as atomic_umin,
+    select_le_or_be!("cmp {val_lo}, {prev_lo}", "cmp {val_hi}, {prev_hi}"),
+    select_le_or_be!("sbcs xzr, {val_hi}, {prev_hi}", "sbcs xzr, {val_lo}, {prev_lo}"),
+    "csel {new_hi}, {prev_hi}, {val_hi}, hs", // select hi 64-bit
+    "csel {new_lo}, {prev_lo}, {val_lo}, hs", // select lo 64-bit
+}
+atomic_rmw_cas_3! {
+    _atomic_umin_casp as atomic_umin,
+    select_le_or_be!("cmp {val_lo}, x6", "cmp {val_hi}, x7"),
+    select_le_or_be!("sbcs xzr, {val_hi}, x7", "sbcs xzr, {val_lo}, x6"),
+    "csel x5, x7, {val_hi}, hs", // select hi 64-bit
+    "csel x4, x6, {val_lo}, hs", // select lo 64-bit
+}
+
+#[inline]
+const fn is_lock_free() -> bool {
+    IS_ALWAYS_LOCK_FREE
+}
+const IS_ALWAYS_LOCK_FREE: bool = true;
+
+atomic128!(AtomicI128, i128, atomic_max, atomic_min);
+atomic128!(AtomicU128, u128, atomic_umax, atomic_umin);
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    test_atomic_int!(i128);
+    test_atomic_int!(u128);
+
+    // load/store/swap implementation is not affected by signedness, so it is
+    // enough to test only unsigned types.
+    stress_test!(u128);
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/detect/aarch64_aa64reg.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/detect/aarch64_aa64reg.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/detect/aarch64_aa64reg.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/detect/aarch64_aa64reg.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,631 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Run-time feature detection on aarch64 Linux/FreeBSD/NetBSD/OpenBSD by parsing system registers.
+//
+// As of nightly-2023-01-23, is_aarch64_feature_detected doesn't support run-time detection on NetBSD/OpenBSD.
+// https://github.com/rust-lang/stdarch/blob/a0c30f3e3c75adcd6ee7efc94014ebcead61c507/crates/std_detect/src/detect/mod.rs
+// https://github.com/rust-lang/stdarch/pull/1374
+//
+// Refs:
+// - https://developer.arm.com/documentation/ddi0601/latest/AArch64-Registers
+// - https://www.kernel.org/doc/Documentation/arm64/cpu-feature-registers.txt
+// - https://github.com/rust-lang/stdarch/blob/a0c30f3e3c75adcd6ee7efc94014ebcead61c507/crates/std_detect/src/detect/os/aarch64.rs
+//
+// Supported platforms:
+// - Linux 4.11+ (emulate mrs instruction)
+//   https://github.com/torvalds/linux/commit/77c97b4ee21290f5f083173d957843b615abbff2
+// - FreeBSD 12.0+ (emulate mrs instruction)
+//   https://github.com/freebsd/freebsd-src/commit/398810619cb32abf349f8de23f29510b2ee0839b
+// - NetBSD 9.0+ (through sysctl)
+//   https://github.com/NetBSD/src/commit/0e9d25528729f7fea53e78275d1bc5039dfe8ffb
+// - OpenBSD 7.1+ (through sysctl)
+//   https://github.com/openbsd/src/commit/d335af936b9d7dd9cf655cae1ce19560c45de6c8
+//
+// For now, this module is only used on NetBSD/OpenBSD.
+// On Linux/FreeBSD, this module is test-only:
+// - On Linux, this approach requires a higher kernel version than Rust supports,
+//   and also does not work with qemu-user (as of QEMU 7.2) and Valgrind.
+//   (Looking into HWCAP_CPUID in auxvec, it appears that Valgrind is setting it
+//   to false correctly, but qemu-user is setting it to true.)
+// - On FreeBSD, this approach does not work on FreeBSD 12 on QEMU (confirmed on
+//   FreeBSD 12.{2,3,4}), and we got SIGILL (worked on FreeBSD 13 and 14).
+
+include!("common.rs");
+
+#[cfg_attr(test, derive(Debug, PartialEq))]
+struct AA64Reg {
+    aa64isar0: u64,
+    #[cfg(test)]
+    aa64isar1: u64,
+    // OpenBSD has an API to get this, but currently always returns 0.
+    // https://github.com/openbsd/src/blob/6a233889798dc3ecb18acc52dce1e57862af2957/sys/arch/arm64/arm64/machdep.c#L371-L377
+    #[cfg_attr(target_os = "openbsd", cfg(test))]
+    aa64mmfr2: u64,
+}
+
+#[cold]
+fn _detect(info: &mut CpuInfo) {
+    let AA64Reg {
+        aa64isar0,
+        #[cfg(test)]
+        aa64isar1,
+        #[cfg_attr(target_os = "openbsd", cfg(test))]
+        aa64mmfr2,
+    } = imp::aa64reg();
+
+    // ID_AA64ISAR0_EL1, Instruction Set Attribute Register 0
+    // https://developer.arm.com/documentation/ddi0601/2023-06/AArch64-Registers/ID-AA64ISAR0-EL1--AArch64-Instruction-Set-Attribute-Register-0?lang=en
+    let atomic = extract(aa64isar0, 23, 20);
+    if atomic >= 2 {
+        info.set(CpuInfo::HAS_LSE);
+        // we currently only use FEAT_LSE and FEAT_LSE2 in outline-atomics.
+        #[cfg(test)]
+        {
+            if atomic >= 3 {
+                info.set(CpuInfo::HAS_LSE128);
+            }
+        }
+    }
+    // we currently only use FEAT_LSE and FEAT_LSE2 in outline-atomics.
+    #[cfg(test)]
+    {
+        // ID_AA64ISAR1_EL1, Instruction Set Attribute Register 1
+        // https://developer.arm.com/documentation/ddi0601/2023-06/AArch64-Registers/ID-AA64ISAR1-EL1--AArch64-Instruction-Set-Attribute-Register-1?lang=en
+        if extract(aa64isar1, 23, 20) >= 3 {
+            info.set(CpuInfo::HAS_RCPC3);
+        }
+    }
+    // OpenBSD has an API to get AA64MMFR2, but currently always returns 0.
+    // https://github.com/openbsd/src/blob/1847475460684e4251d673e6b1bceb1b38e699c3/sys/arch/arm64/arm64/machdep.c#L367
+    #[cfg_attr(target_os = "openbsd", cfg(test))]
+    {
+        // ID_AA64MMFR2_EL1, AArch64 Memory Model Feature Register 2
+        // https://developer.arm.com/documentation/ddi0601/2023-06/AArch64-Registers/ID-AA64MMFR2-EL1--AArch64-Memory-Model-Feature-Register-2?lang=en
+        if extract(aa64mmfr2, 35, 32) >= 1 {
+            info.set(CpuInfo::HAS_LSE2);
+        }
+    }
+}
+
+fn extract(x: u64, high: usize, low: usize) -> u64 {
+    (x >> low) & ((1 << (high - low + 1)) - 1)
+}
+
+#[cfg(not(any(target_os = "netbsd", target_os = "openbsd")))]
+mod imp {
+    // This module is test-only. See parent module docs for details.
+
+    #[cfg(not(portable_atomic_no_asm))]
+    use core::arch::asm;
+
+    use super::AA64Reg;
+
+    pub(super) fn aa64reg() -> AA64Reg {
+        // SAFETY: This is safe on FreeBSD 12.0+. FreeBSD 11 was EoL on 2021-09-30.
+        // Note that stdarch has been doing the same thing since before FreeBSD 11 was EoL.
+        // https://github.com/rust-lang/stdarch/pull/611
+        unsafe {
+            let aa64isar0: u64;
+            asm!(
+                "mrs {0}, ID_AA64ISAR0_EL1",
+                out(reg) aa64isar0,
+                options(pure, nomem, nostack, preserves_flags),
+            );
+            #[cfg(test)]
+            let aa64isar1: u64;
+            #[cfg(test)]
+            {
+                asm!(
+                    "mrs {0}, ID_AA64ISAR1_EL1",
+                    out(reg) aa64isar1,
+                    options(pure, nomem, nostack, preserves_flags),
+                );
+            }
+            let aa64mmfr2: u64;
+            asm!(
+                "mrs {0}, ID_AA64MMFR2_EL1",
+                out(reg) aa64mmfr2,
+                options(pure, nomem, nostack, preserves_flags),
+            );
+            AA64Reg {
+                aa64isar0,
+                #[cfg(test)]
+                aa64isar1,
+                aa64mmfr2,
+            }
+        }
+    }
+}
+#[cfg(target_os = "netbsd")]
+mod imp {
+    // NetBSD doesn't trap the mrs instruction, but exposes the system registers through sysctl.
+    // https://github.com/NetBSD/src/commit/0e9d25528729f7fea53e78275d1bc5039dfe8ffb
+    // https://github.com/golang/sys/commit/ef9fd89ba245e184bdd308f7f2b4f3c551fa5b0f
+
+    use core::ptr;
+
+    use super::AA64Reg;
+
+    // core::ffi::c_* (except c_void) requires Rust 1.64, libc will soon require Rust 1.47
+    #[allow(non_camel_case_types)]
+    pub(super) mod ffi {
+        pub(crate) use super::super::c_types::{c_char, c_int, c_size_t, c_void};
+
+        extern "C" {
+            // Defined in sys/sysctl.h.
+            // https://man.netbsd.org/sysctl.3
+            // https://github.com/NetBSD/src/blob/167403557cf60bed09a63fc84d941a1a4bd7d52e/sys/sys/sysctl.h
+            // https://github.com/rust-lang/libc/blob/0.2.139/src/unix/bsd/netbsdlike/netbsd/mod.rs#L2582
+            pub(crate) fn sysctlbyname(
+                name: *const c_char,
+                old_p: *mut c_void,
+                old_len_p: *mut c_size_t,
+                new_p: *const c_void,
+                new_len: c_size_t,
+            ) -> c_int;
+        }
+
+        // Defined in aarch64/armreg.h.
+        // https://github.com/NetBSD/src/blob/167403557cf60bed09a63fc84d941a1a4bd7d52e/sys/arch/aarch64/include/armreg.h#L1626
+        #[derive(Clone, Copy)]
+        #[repr(C)]
+        pub(crate) struct aarch64_sysctl_cpu_id {
+            // NetBSD 9.0+
+            // https://github.com/NetBSD/src/commit/0e9d25528729f7fea53e78275d1bc5039dfe8ffb
+            pub(crate) midr: u64,
+            pub(crate) revidr: u64,
+            pub(crate) mpidr: u64,
+            pub(crate) aa64dfr0: u64,
+            pub(crate) aa64dfr1: u64,
+            pub(crate) aa64isar0: u64,
+            pub(crate) aa64isar1: u64,
+            pub(crate) aa64mmfr0: u64,
+            pub(crate) aa64mmfr1: u64,
+            pub(crate) aa64mmfr2: u64,
+            pub(crate) aa64pfr0: u64,
+            pub(crate) aa64pfr1: u64,
+            pub(crate) aa64zfr0: u64,
+            pub(crate) mvfr0: u32,
+            pub(crate) mvfr1: u32,
+            pub(crate) mvfr2: u32,
+            // NetBSD 10.0+
+            // https://github.com/NetBSD/src/commit/0c7bdc13f0e332cccec56e307f023b4888638973
+            pub(crate) pad: u32,
+            pub(crate) clidr: u64,
+            pub(crate) ctr: u64,
+        }
+    }
+
+    pub(super) unsafe fn sysctl_cpu_id(name: &[u8]) -> Option<AA64Reg> {
+        const OUT_LEN: ffi::c_size_t =
+            core::mem::size_of::<ffi::aarch64_sysctl_cpu_id>() as ffi::c_size_t;
+
+        debug_assert_eq!(name.last(), Some(&0), "{:?}", name);
+        debug_assert_eq!(name.iter().filter(|&&v| v == 0).count(), 1, "{:?}", name);
+
+        // SAFETY: all fields of aarch64_sysctl_cpu_id are zero-able and we use
+        // the result when machdep.cpuN.cpu_id sysctl was successful.
+        let mut buf: ffi::aarch64_sysctl_cpu_id = unsafe { core::mem::zeroed() };
+        let mut out_len = OUT_LEN;
+        // SAFETY:
+        // - the caller must guarantee that `name` is ` machdep.cpuN.cpu_id` in a C string.
+        // - `out_len` does not exceed the size of the value at `buf`.
+        // - `sysctlbyname` is thread-safe.
+        let res = unsafe {
+            ffi::sysctlbyname(
+                name.as_ptr().cast::<ffi::c_char>(),
+                (&mut buf as *mut ffi::aarch64_sysctl_cpu_id).cast::<ffi::c_void>(),
+                &mut out_len,
+                ptr::null_mut(),
+                0,
+            )
+        };
+        if res != 0 {
+            return None;
+        }
+        Some(AA64Reg {
+            aa64isar0: buf.aa64isar0,
+            #[cfg(test)]
+            aa64isar1: buf.aa64isar1,
+            aa64mmfr2: buf.aa64mmfr2,
+        })
+    }
+
+    pub(super) fn aa64reg() -> AA64Reg {
+        // Get system registers for cpu0.
+        // If failed, returns default because machdep.cpuN.cpu_id sysctl is not available.
+        // machdep.cpuN.cpu_id sysctl was added on NetBSD 9.0 so it is not available on older versions.
+        // SAFETY: we passed a valid name in a C string.
+        // It is ok to check only cpu0, even if there are more CPUs.
+        // https://github.com/NetBSD/src/commit/bd9707e06ea7d21b5c24df6dfc14cb37c2819416
+        // https://github.com/golang/sys/commit/ef9fd89ba245e184bdd308f7f2b4f3c551fa5b0f
+        match unsafe { sysctl_cpu_id(b"machdep.cpu0.cpu_id\0") } {
+            Some(cpu_id) => cpu_id,
+            None => AA64Reg {
+                aa64isar0: 0,
+                #[cfg(test)]
+                aa64isar1: 0,
+                aa64mmfr2: 0,
+            },
+        }
+    }
+}
+#[cfg(target_os = "openbsd")]
+mod imp {
+    // OpenBSD doesn't trap the mrs instruction, but exposes the system registers through sysctl.
+    // https://github.com/openbsd/src/commit/d335af936b9d7dd9cf655cae1ce19560c45de6c8
+    // https://github.com/golang/go/commit/cd54ef1f61945459486e9eea2f016d99ef1da925
+
+    use core::ptr;
+
+    use super::AA64Reg;
+
+    // core::ffi::c_* (except c_void) requires Rust 1.64, libc will soon require Rust 1.47
+    #[allow(non_camel_case_types)]
+    pub(super) mod ffi {
+        pub(crate) use super::super::c_types::{c_int, c_size_t, c_uint, c_void};
+
+        // Defined in sys/sysctl.h.
+        // https://github.com/openbsd/src/blob/72ccc03bd11da614f31f7ff76e3f6fce99bc1c79/sys/sys/sysctl.h#L82
+        pub(crate) const CTL_MACHDEP: c_int = 7;
+        // Defined in machine/cpu.h.
+        // https://github.com/openbsd/src/blob/72ccc03bd11da614f31f7ff76e3f6fce99bc1c79/sys/arch/arm64/include/cpu.h#L25-L40
+        pub(crate) const CPU_ID_AA64ISAR0: c_int = 2;
+        #[cfg(test)]
+        pub(crate) const CPU_ID_AA64ISAR1: c_int = 3;
+        // OpenBSD has an API to get this, but currently always returns 0.
+        // https://github.com/openbsd/src/blob/6a233889798dc3ecb18acc52dce1e57862af2957/sys/arch/arm64/arm64/machdep.c#L371-L377
+        #[cfg(test)]
+        pub(crate) const CPU_ID_AA64MMFR2: c_int = 7;
+
+        extern "C" {
+            // Defined in sys/sysctl.h.
+            // https://man.openbsd.org/sysctl.2
+            // https://github.com/openbsd/src/blob/72ccc03bd11da614f31f7ff76e3f6fce99bc1c79/sys/sys/sysctl.h
+            // https://github.com/rust-lang/libc/blob/0.2.139/src/unix/bsd/netbsdlike/openbsd/mod.rs#L1817-L1824
+            pub(crate) fn sysctl(
+                name: *const c_int,
+                name_len: c_uint,
+                old_p: *mut c_void,
+                old_len_p: *mut c_size_t,
+                new_p: *mut c_void,
+                new_len: c_size_t,
+            ) -> c_int;
+        }
+    }
+
+    // ID_AA64ISAR0_EL1 and ID_AA64ISAR1_EL1 are supported on OpenBSD 7.1+.
+    // https://github.com/openbsd/src/commit/d335af936b9d7dd9cf655cae1ce19560c45de6c8
+    // Others are supported on OpenBSD 7.3+.
+    // https://github.com/openbsd/src/commit/c7654cd65262d532212f65123ee3905ba200365c
+    // sysctl returns an unsupported error if operation is not supported,
+    // so we can safely use this function on older versions of OpenBSD.
+    pub(super) fn aa64reg() -> AA64Reg {
+        let aa64isar0 = sysctl64(&[ffi::CTL_MACHDEP, ffi::CPU_ID_AA64ISAR0]).unwrap_or(0);
+        #[cfg(test)]
+        let aa64isar1 = sysctl64(&[ffi::CTL_MACHDEP, ffi::CPU_ID_AA64ISAR1]).unwrap_or(0);
+        #[cfg(test)]
+        let aa64mmfr2 = sysctl64(&[ffi::CTL_MACHDEP, ffi::CPU_ID_AA64MMFR2]).unwrap_or(0);
+        AA64Reg {
+            aa64isar0,
+            #[cfg(test)]
+            aa64isar1,
+            #[cfg(test)]
+            aa64mmfr2,
+        }
+    }
+
+    fn sysctl64(mib: &[ffi::c_int]) -> Option<u64> {
+        const OUT_LEN: ffi::c_size_t = core::mem::size_of::<u64>() as ffi::c_size_t;
+        let mut out = 0_u64;
+        let mut out_len = OUT_LEN;
+        #[allow(clippy::cast_possible_truncation)]
+        let mib_len = mib.len() as ffi::c_uint;
+        // SAFETY:
+        // - `mib.len()` does not exceed the size of `mib`.
+        // - `out_len` does not exceed the size of `out`.
+        // - `sysctl` is thread-safe.
+        let res = unsafe {
+            ffi::sysctl(
+                mib.as_ptr(),
+                mib_len,
+                (&mut out as *mut u64).cast::<ffi::c_void>(),
+                &mut out_len,
+                ptr::null_mut(),
+                0,
+            )
+        };
+        if res == -1 {
+            return None;
+        }
+        debug_assert_eq!(out_len, OUT_LEN);
+        Some(out)
+    }
+}
+
+#[allow(
+    clippy::alloc_instead_of_core,
+    clippy::std_instead_of_alloc,
+    clippy::std_instead_of_core,
+    clippy::undocumented_unsafe_blocks,
+    clippy::wildcard_imports
+)]
+#[cfg(test)]
+mod tests {
+    use std::{
+        process::Command,
+        string::{String, ToString},
+    };
+
+    use super::*;
+
+    #[test]
+    fn test_aa64reg() {
+        let AA64Reg { aa64isar0, aa64isar1, aa64mmfr2 } = imp::aa64reg();
+        std::eprintln!("aa64isar0={}", aa64isar0);
+        std::eprintln!("aa64isar1={}", aa64isar1);
+        std::eprintln!("aa64mmfr2={}", aa64mmfr2);
+        if cfg!(target_os = "openbsd") {
+            let output = Command::new("sysctl").arg("machdep").output().unwrap();
+            assert!(output.status.success());
+            let stdout = String::from_utf8(output.stdout).unwrap();
+            // OpenBSD 7.1+
+            assert_eq!(
+                stdout.lines().find_map(|s| s.strip_prefix("machdep.id_aa64isar0=")).unwrap_or("0"),
+                aa64isar0.to_string(),
+            );
+            assert_eq!(
+                stdout.lines().find_map(|s| s.strip_prefix("machdep.id_aa64isar1=")).unwrap_or("0"),
+                aa64isar1.to_string(),
+            );
+            // OpenBSD 7.3+
+            assert_eq!(
+                stdout.lines().find_map(|s| s.strip_prefix("machdep.id_aa64mmfr2=")).unwrap_or("0"),
+                aa64mmfr2.to_string(),
+            );
+        }
+        if detect().test(CpuInfo::HAS_LSE) {
+            let atomic = extract(aa64isar0, 23, 20);
+            if detect().test(CpuInfo::HAS_LSE128) {
+                assert_eq!(atomic, 3);
+            } else {
+                assert_eq!(atomic, 2);
+            }
+        }
+        if detect().test(CpuInfo::HAS_LSE2) {
+            assert_eq!(extract(aa64mmfr2, 35, 32), 1);
+        }
+        if detect().test(CpuInfo::HAS_RCPC3) {
+            assert_eq!(extract(aa64isar1, 23, 20), 3);
+        }
+    }
+
+    #[allow(clippy::cast_possible_wrap)]
+    #[cfg(target_os = "netbsd")]
+    #[test]
+    fn test_netbsd() {
+        use c_types::*;
+        use imp::ffi;
+        use std::{arch::asm, mem, ptr, vec, vec::Vec};
+        use test_helper::sys;
+
+        // Call syscall using asm instead of libc.
+        // Note that NetBSD does not guarantee the stability of raw syscall as
+        // much as Linux does (It may actually be stable enough, though: https://lists.llvm.org/pipermail/llvm-dev/2019-June/133393.html).
+        //
+        // This is currently used only for testing.
+        unsafe fn sysctl_cpu_id_asm_syscall(name: &[&[u8]]) -> Result<AA64Reg, c_int> {
+            // https://github.com/golang/go/blob/4badad8d477ffd7a6b762c35bc69aed82faface7/src/syscall/asm_netbsd_arm64.s
+            #[inline]
+            unsafe fn sysctl(
+                name: *const c_int,
+                name_len: c_uint,
+                old_p: *mut c_void,
+                old_len_p: *mut c_size_t,
+                new_p: *const c_void,
+                new_len: c_size_t,
+            ) -> Result<c_int, c_int> {
+                // SAFETY: the caller must uphold the safety contract.
+                unsafe {
+                    let mut n = sys::SYS___sysctl as u64;
+                    let r: i64;
+                    asm!(
+                        "svc 0",
+                        "b.cc 2f",
+                        "mov x17, x0",
+                        "mov x0, #-1",
+                        "2:",
+                        inout("x17") n,
+                        inout("x0") ptr_reg!(name) => r,
+                        inout("x1") name_len as u64 => _,
+                        in("x2") ptr_reg!(old_p),
+                        in("x3") ptr_reg!(old_len_p),
+                        in("x4") ptr_reg!(new_p),
+                        in("x5") new_len as u64,
+                        options(nostack),
+                    );
+                    #[allow(clippy::cast_possible_truncation)]
+                    if r as c_int == -1 {
+                        Err(n as c_int)
+                    } else {
+                        Ok(r as c_int)
+                    }
+                }
+            }
+
+            // https://github.com/golang/sys/blob/4badad8d477ffd7a6b762c35bc69aed82faface7/cpu/cpu_netbsd_arm64.go.
+            fn sysctl_nodes(mib: &mut Vec<i32>) -> Result<Vec<sys::sysctlnode>, i32> {
+                mib.push(sys::CTL_QUERY);
+                let mut q_node = sys::sysctlnode {
+                    sysctl_flags: sys::SYSCTL_VERS_1,
+                    ..unsafe { mem::zeroed() }
+                };
+                let qp = (&mut q_node as *mut sys::sysctlnode).cast::<ffi::c_void>();
+                let sz = mem::size_of::<sys::sysctlnode>();
+                let mut olen = 0;
+                #[allow(clippy::cast_possible_truncation)]
+                let mib_len = mib.len() as c_uint;
+                unsafe {
+                    sysctl(mib.as_ptr(), mib_len, ptr::null_mut(), &mut olen, qp, sz)?;
+                }
+
+                let mut nodes = Vec::<sys::sysctlnode>::with_capacity(olen / sz);
+                let np = nodes.as_mut_ptr().cast::<ffi::c_void>();
+                unsafe {
+                    sysctl(mib.as_ptr(), mib_len, np, &mut olen, qp, sz)?;
+                    nodes.set_len(olen / sz);
+                }
+
+                mib.pop(); // pop CTL_QUERY
+                Ok(nodes)
+            }
+            fn name_to_mib(parts: &[&[u8]]) -> Result<Vec<i32>, i32> {
+                let mut mib = vec![];
+                for (part_no, &part) in parts.iter().enumerate() {
+                    let nodes = sysctl_nodes(&mut mib)?;
+                    for node in nodes {
+                        let mut n = vec![];
+                        for b in node.sysctl_name {
+                            if b != 0 {
+                                n.push(b);
+                            }
+                        }
+                        if n == part {
+                            mib.push(node.sysctl_num);
+                            break;
+                        }
+                    }
+                    if mib.len() != part_no + 1 {
+                        return Err(0);
+                    }
+                }
+
+                Ok(mib)
+            }
+
+            const OUT_LEN: ffi::c_size_t =
+                core::mem::size_of::<ffi::aarch64_sysctl_cpu_id>() as ffi::c_size_t;
+
+            let mib = name_to_mib(name)?;
+
+            let mut buf: ffi::aarch64_sysctl_cpu_id = unsafe { core::mem::zeroed() };
+            let mut out_len = OUT_LEN;
+            #[allow(clippy::cast_possible_truncation)]
+            let mib_len = mib.len() as c_uint;
+            unsafe {
+                sysctl(
+                    mib.as_ptr(),
+                    mib_len,
+                    (&mut buf as *mut ffi::aarch64_sysctl_cpu_id).cast::<ffi::c_void>(),
+                    &mut out_len,
+                    ptr::null_mut(),
+                    0,
+                )?;
+            }
+            Ok(AA64Reg {
+                aa64isar0: buf.aa64isar0,
+                #[cfg(test)]
+                aa64isar1: buf.aa64isar1,
+                #[cfg(test)]
+                aa64mmfr2: buf.aa64mmfr2,
+            })
+        }
+
+        unsafe {
+            assert_eq!(
+                imp::sysctl_cpu_id(b"machdep.cpu0.cpu_id\0").unwrap(),
+                sysctl_cpu_id_asm_syscall(&[b"machdep", b"cpu0", b"cpu_id"]).unwrap()
+            );
+        }
+    }
+
+    // Static assertions for FFI bindings.
+    // This checks that FFI bindings defined in this crate, FFI bindings defined
+    // in libc, and FFI bindings generated for the platform's latest header file
+    // using bindgen have compatible signatures (or the same values if constants).
+    // Since this is static assertion, we can detect problems with
+    // `cargo check --tests --target <target>` run in CI (via TESTS=1 build.sh)
+    // without actually running tests on these platforms.
+    // See also tools/codegen/src/ffi.rs.
+    // TODO(codegen): auto-generate this test
+    #[cfg(target_os = "netbsd")]
+    #[allow(
+        clippy::cast_possible_wrap,
+        clippy::cast_sign_loss,
+        clippy::no_effect_underscore_binding,
+        clippy::used_underscore_binding
+    )]
+    const _: fn() = || {
+        use imp::ffi;
+        use std::mem;
+        use test_helper::{libc, sys};
+        let mut _sysctlbyname: unsafe extern "C" fn(
+            *const ffi::c_char,
+            *mut ffi::c_void,
+            *mut ffi::c_size_t,
+            *const ffi::c_void,
+            ffi::c_size_t,
+        ) -> ffi::c_int = ffi::sysctlbyname;
+        _sysctlbyname = libc::sysctlbyname;
+        _sysctlbyname = sys::sysctlbyname;
+        // libc doesn't have this
+        // static_assert!(
+        //     mem::size_of::<ffi::aarch64_sysctl_cpu_id>()
+        //         == mem::size_of::<libc::aarch64_sysctl_cpu_id>()
+        // );
+        static_assert!(
+            mem::size_of::<ffi::aarch64_sysctl_cpu_id>()
+                == mem::size_of::<sys::aarch64_sysctl_cpu_id>()
+        );
+        let ffi: ffi::aarch64_sysctl_cpu_id = unsafe { mem::zeroed() };
+        let _ = sys::aarch64_sysctl_cpu_id {
+            ac_midr: ffi.midr,
+            ac_revidr: ffi.revidr,
+            ac_mpidr: ffi.mpidr,
+            ac_aa64dfr0: ffi.aa64dfr0,
+            ac_aa64dfr1: ffi.aa64dfr1,
+            ac_aa64isar0: ffi.aa64isar0,
+            ac_aa64isar1: ffi.aa64isar1,
+            ac_aa64mmfr0: ffi.aa64mmfr0,
+            ac_aa64mmfr1: ffi.aa64mmfr1,
+            ac_aa64mmfr2: ffi.aa64mmfr2,
+            ac_aa64pfr0: ffi.aa64pfr0,
+            ac_aa64pfr1: ffi.aa64pfr1,
+            ac_aa64zfr0: ffi.aa64zfr0,
+            ac_mvfr0: ffi.mvfr0,
+            ac_mvfr1: ffi.mvfr1,
+            ac_mvfr2: ffi.mvfr2,
+            ac_pad: ffi.pad,
+            ac_clidr: ffi.clidr,
+            ac_ctr: ffi.ctr,
+        };
+    };
+    #[cfg(target_os = "openbsd")]
+    #[allow(
+        clippy::cast_possible_wrap,
+        clippy::cast_sign_loss,
+        clippy::no_effect_underscore_binding
+    )]
+    const _: fn() = || {
+        use imp::ffi;
+        use test_helper::{libc, sys};
+        let mut _sysctl: unsafe extern "C" fn(
+            *const ffi::c_int,
+            ffi::c_uint,
+            *mut ffi::c_void,
+            *mut ffi::c_size_t,
+            *mut ffi::c_void,
+            ffi::c_size_t,
+        ) -> ffi::c_int = ffi::sysctl;
+        _sysctl = libc::sysctl;
+        _sysctl = sys::sysctl;
+        static_assert!(ffi::CTL_MACHDEP == libc::CTL_MACHDEP);
+        static_assert!(ffi::CTL_MACHDEP == sys::CTL_MACHDEP as ffi::c_int);
+        // static_assert!(ffi::CPU_ID_AA64ISAR0 == libc::CPU_ID_AA64ISAR0); // libc doesn't have this
+        static_assert!(ffi::CPU_ID_AA64ISAR0 == sys::CPU_ID_AA64ISAR0 as ffi::c_int);
+        // static_assert!(ffi::CPU_ID_AA64ISAR1 == libc::CPU_ID_AA64ISAR1); // libc doesn't have this
+        static_assert!(ffi::CPU_ID_AA64ISAR1 == sys::CPU_ID_AA64ISAR1 as ffi::c_int);
+        // static_assert!(ffi::CPU_ID_AA64MMFR2 == libc::CPU_ID_AA64MMFR2); // libc doesn't have this
+        static_assert!(ffi::CPU_ID_AA64MMFR2 == sys::CPU_ID_AA64MMFR2 as ffi::c_int);
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/detect/aarch64_fuchsia.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/detect/aarch64_fuchsia.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/detect/aarch64_fuchsia.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/detect/aarch64_fuchsia.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,91 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Run-time feature detection on aarch64 Fuchsia by using zx_system_get_features.
+//
+// As of nightly-2023-01-23, is_aarch64_feature_detected doesn't support run-time detection on Fuchsia.
+// https://github.com/rust-lang/stdarch/blob/a0c30f3e3c75adcd6ee7efc94014ebcead61c507/crates/std_detect/src/detect/mod.rs
+//
+// Refs:
+// - https://fuchsia.dev/fuchsia-src/reference/syscalls/system_get_features
+// - https://github.com/llvm/llvm-project/commit/4e731abc55681751b5d736b613f7720e50eb1ad4
+
+include!("common.rs");
+
+#[allow(non_camel_case_types)]
+mod ffi {
+    // https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/zircon/system/public/zircon/types.h
+    pub(crate) type zx_status_t = i32;
+
+    // https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/zircon/system/public/zircon/errors.h
+    pub(crate) const ZX_OK: zx_status_t = 0;
+    // https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/zircon/system/public/zircon/features.h
+    pub(crate) const ZX_FEATURE_KIND_CPU: u32 = 0;
+    pub(crate) const ZX_ARM64_FEATURE_ISA_ATOMICS: u32 = 1 << 8;
+
+    #[link(name = "zircon")]
+    extern "C" {
+        // https://fuchsia.dev/fuchsia-src/reference/syscalls/system_get_features
+        pub(crate) fn zx_system_get_features(kind: u32, features: *mut u32) -> zx_status_t;
+    }
+}
+
+fn zx_system_get_features(kind: u32) -> u32 {
+    let mut out = 0_u32;
+    // SAFETY: the pointer is valid because we got it from a reference.
+    let res = unsafe { ffi::zx_system_get_features(kind, &mut out) };
+    if res != ffi::ZX_OK {
+        return 0;
+    }
+    out
+}
+
+#[cold]
+fn _detect(info: &mut CpuInfo) {
+    let features = zx_system_get_features(ffi::ZX_FEATURE_KIND_CPU);
+    if features & ffi::ZX_ARM64_FEATURE_ISA_ATOMICS != 0 {
+        info.set(CpuInfo::HAS_LSE);
+    }
+}
+
+#[allow(
+    clippy::alloc_instead_of_core,
+    clippy::std_instead_of_alloc,
+    clippy::std_instead_of_core,
+    clippy::undocumented_unsafe_blocks,
+    clippy::wildcard_imports
+)]
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test_fuchsia() {
+        let features = zx_system_get_features(ffi::ZX_FEATURE_KIND_CPU);
+        assert_ne!(features, 0);
+        std::eprintln!("features: {:b}", features);
+    }
+
+    // Static assertions for FFI bindings.
+    // This checks that FFI bindings defined in this crate and FFI bindings
+    // generated for the platform's latest header file using bindgen have
+    // compatible signatures (or the same values if constants).
+    // Since this is static assertion, we can detect problems with
+    // `cargo check --tests --target <target>` run in CI (via TESTS=1 build.sh)
+    // without actually running tests on these platforms.
+    // See also tools/codegen/src/ffi.rs.
+    // TODO(codegen): auto-generate this test
+    #[allow(
+        clippy::cast_possible_wrap,
+        clippy::cast_sign_loss,
+        clippy::cast_possible_truncation,
+        clippy::no_effect_underscore_binding
+    )]
+    const _: fn() = || {
+        use test_helper::sys;
+        // TODO(codegen): zx_system_get_features
+        let _: ffi::zx_status_t = 0 as sys::zx_status_t;
+        static_assert!(ffi::ZX_OK == sys::ZX_OK as ffi::zx_status_t);
+        static_assert!(ffi::ZX_FEATURE_KIND_CPU == sys::ZX_FEATURE_KIND_CPU);
+        static_assert!(ffi::ZX_ARM64_FEATURE_ISA_ATOMICS == sys::ZX_ARM64_FEATURE_ISA_ATOMICS);
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/detect/aarch64_macos.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/detect/aarch64_macos.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/detect/aarch64_macos.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/detect/aarch64_macos.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,153 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Run-time feature detection on aarch64 macOS by using sysctl.
+//
+// This module is currently only enabled on tests because aarch64 macOS always supports FEAT_LSE and FEAT_LSE2.
+// https://github.com/llvm/llvm-project/blob/llvmorg-18.1.2/llvm/include/llvm/TargetParser/AArch64TargetParser.h#L728
+//
+// If macOS supporting FEAT_LSE128/FEAT_LRCPC3 becomes popular in the future, this module will
+// be used to support outline-atomics for FEAT_LSE128/FEAT_LRCPC3.
+// M4 is armv9.4-a but I don't know if it supports FEAT_LSE128/FEAT_LRCPC3.
+//
+// Refs: https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics
+//
+// Note that iOS doesn't support sysctl:
+// - https://developer.apple.com/forums/thread/9440
+// - https://nabla-c0d3.github.io/blog/2015/06/16/ios9-security-privacy
+
+include!("common.rs");
+
+use core::ptr;
+
+// core::ffi::c_* (except c_void) requires Rust 1.64, libc will soon require Rust 1.47
+#[allow(non_camel_case_types)]
+mod ffi {
+    pub(crate) use super::c_types::{c_char, c_int, c_size_t, c_void};
+
+    extern "C" {
+        // https://developer.apple.com/documentation/kernel/1387446-sysctlbyname
+        // https://github.com/apple-oss-distributions/xnu/blob/5c2921b07a2480ab43ec66f5b9e41cb872bc554f/bsd/sys/sysctl.h
+        // https://github.com/rust-lang/libc/blob/0.2.139/src/unix/bsd/apple/mod.rs#L5167-L5173
+        pub(crate) fn sysctlbyname(
+            name: *const c_char,
+            old_p: *mut c_void,
+            old_len_p: *mut c_size_t,
+            new_p: *mut c_void,
+            new_len: c_size_t,
+        ) -> c_int;
+    }
+}
+
+unsafe fn sysctlbyname32(name: &[u8]) -> Option<u32> {
+    const OUT_LEN: ffi::c_size_t = core::mem::size_of::<u32>() as ffi::c_size_t;
+
+    debug_assert_eq!(name.last(), Some(&0), "{:?}", name);
+    debug_assert_eq!(name.iter().filter(|&&v| v == 0).count(), 1, "{:?}", name);
+
+    let mut out = 0_u32;
+    let mut out_len = OUT_LEN;
+    // SAFETY:
+    // - the caller must guarantee that `name` a valid C string.
+    // - `out_len` does not exceed the size of `out`.
+    // - `sysctlbyname` is thread-safe.
+    let res = unsafe {
+        ffi::sysctlbyname(
+            name.as_ptr().cast::<ffi::c_char>(),
+            (&mut out as *mut u32).cast::<ffi::c_void>(),
+            &mut out_len,
+            ptr::null_mut(),
+            0,
+        )
+    };
+    if res != 0 {
+        return None;
+    }
+    debug_assert_eq!(out_len, OUT_LEN);
+    Some(out)
+}
+
+#[cold]
+fn _detect(info: &mut CpuInfo) {
+    // hw.optional.armv8_1_atomics is available on macOS 11+ (note: aarch64 support was added on macOS 11),
+    // hw.optional.arm.FEAT_* are only available on macOS 12+.
+    // Query both names in case future versions of macOS remove the old name.
+    // https://github.com/golang/go/commit/c15593197453b8bf90fc3a9080ba2afeaf7934ea
+    // https://github.com/google/boringssl/commit/91e0b11eba517d83b910b20fe3740eeb39ecb37e
+    // SAFETY: we passed a valid C string.
+    if unsafe {
+        sysctlbyname32(b"hw.optional.arm.FEAT_LSE\0").unwrap_or(0) != 0
+            || sysctlbyname32(b"hw.optional.armv8_1_atomics\0").unwrap_or(0) != 0
+    } {
+        info.set(CpuInfo::HAS_LSE);
+    }
+    // SAFETY: we passed a valid C string.
+    if unsafe { sysctlbyname32(b"hw.optional.arm.FEAT_LSE2\0").unwrap_or(0) != 0 } {
+        info.set(CpuInfo::HAS_LSE2);
+    }
+    // we currently only use FEAT_LSE and FEAT_LSE2 in outline-atomics.
+    #[cfg(test)]
+    {
+        // SAFETY: we passed a valid C string.
+        if unsafe { sysctlbyname32(b"hw.optional.arm.FEAT_LSE128\0").unwrap_or(0) != 0 } {
+            info.set(CpuInfo::HAS_LSE128);
+        }
+        // SAFETY: we passed a valid C string.
+        if unsafe { sysctlbyname32(b"hw.optional.arm.FEAT_LRCPC3\0").unwrap_or(0) != 0 } {
+            info.set(CpuInfo::HAS_RCPC3);
+        }
+    }
+}
+
+#[allow(
+    clippy::alloc_instead_of_core,
+    clippy::std_instead_of_alloc,
+    clippy::std_instead_of_core,
+    clippy::undocumented_unsafe_blocks,
+    clippy::wildcard_imports
+)]
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test_macos() {
+        unsafe {
+            assert_eq!(sysctlbyname32(b"hw.optional.armv8_1_atomics\0"), Some(1));
+            assert_eq!(sysctlbyname32(b"hw.optional.arm.FEAT_LSE\0"), Some(1));
+            assert_eq!(sysctlbyname32(b"hw.optional.arm.FEAT_LSE2\0"), Some(1));
+            assert_eq!(sysctlbyname32(b"hw.optional.arm.FEAT_LSE128\0"), None);
+            assert_eq!(std::io::Error::last_os_error().kind(), std::io::ErrorKind::NotFound);
+            assert_eq!(sysctlbyname32(b"hw.optional.arm.FEAT_LRCPC\0"), Some(1));
+            assert_eq!(sysctlbyname32(b"hw.optional.arm.FEAT_LRCPC2\0"), Some(1));
+            assert_eq!(sysctlbyname32(b"hw.optional.arm.FEAT_LRCPC3\0"), None);
+            assert_eq!(std::io::Error::last_os_error().kind(), std::io::ErrorKind::NotFound);
+        }
+    }
+
+    // Static assertions for FFI bindings.
+    // This checks that FFI bindings defined in this crate, FFI bindings defined
+    // in libc, and FFI bindings generated for the platform's latest header file
+    // using bindgen have compatible signatures (or the same values if constants).
+    // Since this is static assertion, we can detect problems with
+    // `cargo check --tests --target <target>` run in CI (via TESTS=1 build.sh)
+    // without actually running tests on these platforms.
+    // See also tools/codegen/src/ffi.rs.
+    // TODO(codegen): auto-generate this test
+    #[allow(
+        clippy::cast_possible_wrap,
+        clippy::cast_sign_loss,
+        clippy::no_effect_underscore_binding
+    )]
+    const _: fn() = || {
+        use test_helper::{libc, sys};
+        let mut _sysctlbyname: unsafe extern "C" fn(
+            *const ffi::c_char,
+            *mut ffi::c_void,
+            *mut ffi::c_size_t,
+            *mut ffi::c_void,
+            ffi::c_size_t,
+        ) -> ffi::c_int = ffi::sysctlbyname;
+        _sysctlbyname = libc::sysctlbyname;
+        _sysctlbyname = sys::sysctlbyname;
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/detect/aarch64_windows.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/detect/aarch64_windows.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/detect/aarch64_windows.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/detect/aarch64_windows.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,81 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Run-time feature detection on aarch64 Windows by using IsProcessorFeaturePresent.
+//
+// As of nightly-2023-01-23, is_aarch64_feature_detected doesn't support run-time detection of FEAT_LSE on Windows.
+// https://github.com/rust-lang/stdarch/blob/a0c30f3e3c75adcd6ee7efc94014ebcead61c507/crates/std_detect/src/detect/os/windows/aarch64.rs
+// https://github.com/rust-lang/stdarch/pull/1373
+//
+// Refs: https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-isprocessorfeaturepresent
+
+include!("common.rs");
+
+// windows-sys requires Rust 1.56
+#[allow(clippy::upper_case_acronyms)]
+mod ffi {
+    pub(crate) type DWORD = u32;
+    pub(crate) type BOOL = i32;
+
+    pub(crate) const FALSE: BOOL = 0;
+    // Defined in winnt.h of Windows SDK.
+    pub(crate) const PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE: DWORD = 34;
+
+    extern "system" {
+        // https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-isprocessorfeaturepresent
+        pub(crate) fn IsProcessorFeaturePresent(ProcessorFeature: DWORD) -> BOOL;
+    }
+}
+
+#[cold]
+fn _detect(info: &mut CpuInfo) {
+    // SAFETY: calling IsProcessorFeaturePresent is safe, and FALSE is also
+    // returned if the HAL does not support detection of the specified feature.
+    if unsafe {
+        ffi::IsProcessorFeaturePresent(ffi::PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE) != ffi::FALSE
+    } {
+        info.set(CpuInfo::HAS_LSE);
+    }
+}
+
+#[allow(
+    clippy::alloc_instead_of_core,
+    clippy::std_instead_of_alloc,
+    clippy::std_instead_of_core,
+    clippy::undocumented_unsafe_blocks,
+    clippy::wildcard_imports
+)]
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    // Static assertions for FFI bindings.
+    // This checks that FFI bindings defined in this crate and FFI bindings defined
+    // in windows-sys have compatible signatures (or the same values if constants).
+    // Since this is static assertion, we can detect problems with
+    // `cargo check --tests --target <target>` run in CI (via TESTS=1 build.sh)
+    // without actually running tests on these platforms.
+    // (Unlike libc, windows-sys programmatically generates bindings from Windows
+    // API metadata, so it should be enough to check compatibility with the
+    // windows-sys' signatures/values.)
+    // See also tools/codegen/src/ffi.rs.
+    // TODO(codegen): auto-generate this test
+    #[allow(
+        clippy::cast_possible_wrap,
+        clippy::cast_sign_loss,
+        clippy::cast_possible_truncation,
+        clippy::no_effect_underscore_binding
+    )]
+    const _: fn() = || {
+        use test_helper::windows_sys;
+        let _: ffi::DWORD = 0 as windows_sys::Win32::System::Threading::PROCESSOR_FEATURE_ID;
+        let _: ffi::BOOL = 0 as windows_sys::Win32::Foundation::BOOL;
+        let mut _sysctl: unsafe extern "system" fn(ffi::DWORD) -> ffi::BOOL =
+            ffi::IsProcessorFeaturePresent;
+        _sysctl = windows_sys::Win32::System::Threading::IsProcessorFeaturePresent;
+        static_assert!(ffi::FALSE == windows_sys::Win32::Foundation::FALSE);
+        static_assert!(
+            ffi::PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE
+                == windows_sys::Win32::System::Threading::PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE
+        );
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/detect/auxv.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/detect/auxv.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/detect/auxv.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/detect/auxv.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,727 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Run-time feature detection on aarch64/powerpc64 Linux/Android/FreeBSD by parsing ELF auxiliary vectors.
+//
+// # Linux/Android
+//
+// As of nightly-2023-01-23, is_aarch64_feature_detected always uses dlsym by default
+// on aarch64 Linux/Android, but on the following platforms, so we can safely assume
+// getauxval is linked to the binary.
+//
+// - On glibc (*-linux-gnu*), [aarch64 support is available on glibc 2.17+](https://sourceware.org/legacy-ml/libc-announce/2012/msg00001.html)
+//   and is newer than [glibc 2.16 that added getauxval](https://sourceware.org/legacy-ml/libc-announce/2012/msg00000.html).
+// - On musl (*-linux-musl*, *-linux-ohos*), [aarch64 support is available on musl 1.1.7+](https://git.musl-libc.org/cgit/musl/tree/WHATSNEW?h=v1.1.7#n1422)
+//   and is newer than [musl 1.1.0 that added getauxval](https://git.musl-libc.org/cgit/musl/tree/WHATSNEW?h=v1.1.0#n1197).
+//   https://github.com/rust-lang/rust/commit/9a04ae4997493e9260352064163285cddc43de3c
+// - On bionic (*-android*), [64-bit architecture support is available on Android 5.0+ (API level 21+)](https://android-developers.googleblog.com/2014/10/whats-new-in-android-50-lollipop.html)
+//   and is newer than [Android 4.3 (API level 18) that added getauxval](https://github.com/aosp-mirror/platform_bionic/blob/d3ebc2f7c49a9893b114124d4a6b315f3a328764/libc/include/sys/auxv.h#L49).
+//
+// However, on musl with static linking, it seems that getauxval is not always available, independent of version requirements: https://github.com/rust-lang/rust/issues/89626
+// (That problem may have been fixed in https://github.com/rust-lang/rust/commit/9a04ae4997493e9260352064163285cddc43de3c,
+// but even in the version containing that patch, [there is report](https://github.com/rust-lang/rust/issues/89626#issuecomment-1242636038)
+// of the same error.)
+//
+// On other Linux targets, we cannot assume that getauxval is always available, so we don't enable
+// outline-atomics by default (can be enabled by `--cfg portable_atomic_outline_atomics`).
+//
+// - On musl with static linking. See the above for more.
+//   Also, in this case, dlsym(getauxval) always returns null.
+// - On uClibc-ng (*-linux-uclibc*, *-l4re-uclibc*), [uClibc-ng 1.0.43 (released in 2023-04-05) added getauxval](https://github.com/wbx-github/uclibc-ng/commit/d869bb1600942c01a77539128f9ba5b5b55ad647).
+// - On Picolibc, [Picolibc 1.4.6 added getauxval stub](https://github.com/picolibc/picolibc#picolibc-version-146).
+//
+// See also https://github.com/rust-lang/stdarch/pull/1375
+//
+// See tests::test_linux_like and aarch64_aa64reg.rs for (test-only) alternative implementations.
+//
+// # FreeBSD
+//
+// As of nightly-2023-01-23, is_aarch64_feature_detected always uses mrs on
+// aarch64 FreeBSD. However, they do not work on FreeBSD 12 on QEMU (confirmed
+// on FreeBSD 12.{2,3,4}), and we got SIGILL (worked on FreeBSD 13 and 14).
+//
+// So use elf_aux_info instead of mrs like compiler-rt does.
+// https://man.freebsd.org/elf_aux_info(3)
+// https://reviews.llvm.org/D109330
+//
+// elf_aux_info is available on FreeBSD 12.0+ and 11.4+:
+// https://github.com/freebsd/freebsd-src/commit/0b08ae2120cdd08c20a2b806e2fcef4d0a36c470
+// https://github.com/freebsd/freebsd-src/blob/release/11.4.0/sys/sys/auxv.h
+// On FreeBSD, [aarch64 support is available on FreeBSD 11.0+](https://www.freebsd.org/releases/11.0R/relnotes/#hardware-arm),
+// but FreeBSD 11 (11.4) was EoL on 2021-09-30, and FreeBSD 11.3 was EoL on 2020-09-30:
+// https://www.freebsd.org/security/unsupported
+// See also https://github.com/rust-lang/stdarch/pull/611#issuecomment-445464613
+//
+// See tests::test_freebsd and aarch64_aa64reg.rs for (test-only) alternative implementations.
+//
+// # PowerPC64
+//
+// On PowerPC64, outline-atomics is currently disabled by default mainly for
+// compatibility with older versions of operating systems
+// (can be enabled by `--cfg portable_atomic_outline_atomics`).
+
+include!("common.rs");
+
+use os::ffi;
+#[cfg(any(target_os = "linux", target_os = "android"))]
+mod os {
+    // core::ffi::c_* (except c_void) requires Rust 1.64, libc will soon require Rust 1.47
+    #[cfg_attr(test, allow(dead_code))]
+    pub(super) mod ffi {
+        pub(crate) use super::super::c_types::c_ulong;
+        #[cfg(all(target_arch = "aarch64", target_os = "android"))]
+        pub(crate) use super::super::c_types::{c_char, c_int};
+
+        extern "C" {
+            // https://man7.org/linux/man-pages/man3/getauxval.3.html
+            // https://github.com/bminor/glibc/blob/801af9fafd4689337ebf27260aa115335a0cb2bc/misc/sys/auxv.h
+            // https://github.com/bminor/musl/blob/7d756e1c04de6eb3f2b3d3e1141a218bb329fcfb/include/sys/auxv.h
+            // https://github.com/wbx-github/uclibc-ng/blob/cdb07d2cd52af39feb425e6d36c02b30916b9f0a/include/sys/auxv.h
+            // https://github.com/aosp-mirror/platform_bionic/blob/d3ebc2f7c49a9893b114124d4a6b315f3a328764/libc/include/sys/auxv.h
+            // https://github.com/picolibc/picolibc/blob/7a8a58aeaa5946cb662577a518051091b691af3a/newlib/libc/picolib/getauxval.c
+            // https://github.com/rust-lang/libc/blob/0.2.139/src/unix/linux_like/linux/gnu/mod.rs#L1201
+            // https://github.com/rust-lang/libc/blob/0.2.139/src/unix/linux_like/linux/musl/mod.rs#L744
+            // https://github.com/rust-lang/libc/blob/0.2.139/src/unix/linux_like/android/b64/mod.rs#L333
+            pub(crate) fn getauxval(type_: c_ulong) -> c_ulong;
+
+            // Defined in sys/system_properties.h.
+            // https://github.com/aosp-mirror/platform_bionic/blob/d3ebc2f7c49a9893b114124d4a6b315f3a328764/libc/include/sys/system_properties.h
+            // https://github.com/rust-lang/libc/blob/0.2.139/src/unix/linux_like/android/mod.rs#L3471
+            #[cfg(all(target_arch = "aarch64", target_os = "android"))]
+            pub(crate) fn __system_property_get(name: *const c_char, value: *mut c_char) -> c_int;
+        }
+
+        // https://github.com/torvalds/linux/blob/v6.1/include/uapi/linux/auxvec.h
+        #[cfg(any(test, target_arch = "aarch64"))]
+        pub(crate) const AT_HWCAP: c_ulong = 16;
+        #[cfg(any(test, target_arch = "powerpc64"))]
+        pub(crate) const AT_HWCAP2: c_ulong = 26;
+
+        // Defined in sys/system_properties.h.
+        // https://github.com/aosp-mirror/platform_bionic/blob/d3ebc2f7c49a9893b114124d4a6b315f3a328764/libc/include/sys/system_properties.h
+        #[cfg(all(target_arch = "aarch64", target_os = "android"))]
+        pub(crate) const PROP_VALUE_MAX: c_int = 92;
+    }
+
+    pub(super) fn getauxval(type_: ffi::c_ulong) -> ffi::c_ulong {
+        #[cfg(all(target_arch = "aarch64", target_os = "android"))]
+        {
+            // Samsung Exynos 9810 has a bug that big and little cores have different
+            // ISAs. And on older Android (pre-9), the kernel incorrectly reports
+            // that features available only on some cores are available on all cores.
+            // https://reviews.llvm.org/D114523
+            let mut arch = [0_u8; ffi::PROP_VALUE_MAX as usize];
+            // SAFETY: we've passed a valid C string and a buffer with max length.
+            let len = unsafe {
+                ffi::__system_property_get(
+                    b"ro.arch\0".as_ptr().cast::<ffi::c_char>(),
+                    arch.as_mut_ptr().cast::<ffi::c_char>(),
+                )
+            };
+            // On Exynos, ro.arch is not available on Android 12+, but it is fine
+            // because Android 9+ includes the fix.
+            if len > 0 && arch.starts_with(b"exynos9810") {
+                return 0;
+            }
+        }
+
+        // SAFETY: `getauxval` is thread-safe. See also the module level docs.
+        unsafe { ffi::getauxval(type_) }
+    }
+}
+#[cfg(target_os = "freebsd")]
+mod os {
+    // core::ffi::c_* (except c_void) requires Rust 1.64, libc will soon require Rust 1.47
+    #[cfg_attr(test, allow(dead_code))]
+    pub(super) mod ffi {
+        pub(crate) use super::super::c_types::{c_int, c_ulong, c_void};
+
+        extern "C" {
+            // Defined in sys/auxv.h.
+            // https://man.freebsd.org/elf_aux_info(3)
+            // https://github.com/freebsd/freebsd-src/blob/deb63adf945d446ed91a9d84124c71f15ae571d1/sys/sys/auxv.h
+            pub(crate) fn elf_aux_info(aux: c_int, buf: *mut c_void, buf_len: c_int) -> c_int;
+        }
+
+        // Defined in sys/elf_common.h.
+        // https://github.com/freebsd/freebsd-src/blob/deb63adf945d446ed91a9d84124c71f15ae571d1/sys/sys/elf_common.h
+        #[cfg(any(test, target_arch = "aarch64"))]
+        pub(crate) const AT_HWCAP: c_int = 25;
+        #[cfg(any(test, target_arch = "powerpc64"))]
+        pub(crate) const AT_HWCAP2: c_int = 26;
+    }
+
+    pub(super) fn getauxval(aux: ffi::c_int) -> ffi::c_ulong {
+        #[allow(clippy::cast_possible_wrap, clippy::cast_possible_truncation)]
+        const OUT_LEN: ffi::c_int = core::mem::size_of::<ffi::c_ulong>() as ffi::c_int;
+        let mut out: ffi::c_ulong = 0;
+        // SAFETY:
+        // - the pointer is valid because we got it from a reference.
+        // - `OUT_LEN` is the same as the size of `out`.
+        // - `elf_aux_info` is thread-safe.
+        unsafe {
+            let res = ffi::elf_aux_info(
+                aux,
+                (&mut out as *mut ffi::c_ulong).cast::<ffi::c_void>(),
+                OUT_LEN,
+            );
+            // If elf_aux_info fails, `out` will be left at zero (which is the proper default value).
+            debug_assert!(res == 0 || out == 0);
+        }
+        out
+    }
+}
+
+// Basically, Linux and FreeBSD use the same hwcap values.
+// FreeBSD supports a subset of the hwcap values supported by Linux.
+use arch::_detect;
+#[cfg(target_arch = "aarch64")]
+mod arch {
+    use super::{ffi, os, CpuInfo};
+
+    // Linux
+    // https://github.com/torvalds/linux/blob/1c41041124bd14dd6610da256a3da4e5b74ce6b1/arch/arm64/include/uapi/asm/hwcap.h
+    // FreeBSD
+    // Defined in machine/elf.h.
+    // https://github.com/freebsd/freebsd-src/blob/deb63adf945d446ed91a9d84124c71f15ae571d1/sys/arm64/include/elf.h
+    // available on FreeBSD 13.0+ and 12.2+
+    // https://github.com/freebsd/freebsd-src/blob/release/13.0.0/sys/arm64/include/elf.h
+    // https://github.com/freebsd/freebsd-src/blob/release/12.2.0/sys/arm64/include/elf.h
+    pub(super) const HWCAP_ATOMICS: ffi::c_ulong = 1 << 8;
+    pub(super) const HWCAP_USCAT: ffi::c_ulong = 1 << 25;
+    #[cfg(any(target_os = "linux", target_os = "android"))]
+    #[cfg(target_pointer_width = "64")]
+    #[cfg(test)]
+    pub(super) const HWCAP2_LRCPC3: ffi::c_ulong = 1 << 46;
+    #[cfg(any(target_os = "linux", target_os = "android"))]
+    #[cfg(target_pointer_width = "64")]
+    #[cfg(test)]
+    pub(super) const HWCAP2_LSE128: ffi::c_ulong = 1 << 47;
+
+    #[cold]
+    pub(super) fn _detect(info: &mut CpuInfo) {
+        let hwcap = os::getauxval(ffi::AT_HWCAP);
+
+        if hwcap & HWCAP_ATOMICS != 0 {
+            info.set(CpuInfo::HAS_LSE);
+        }
+        if hwcap & HWCAP_USCAT != 0 {
+            info.set(CpuInfo::HAS_LSE2);
+        }
+        #[cfg(any(target_os = "linux", target_os = "android"))]
+        #[cfg(target_pointer_width = "64")]
+        #[cfg(test)]
+        {
+            let hwcap2 = os::getauxval(ffi::AT_HWCAP2);
+            if hwcap2 & HWCAP2_LRCPC3 != 0 {
+                info.set(CpuInfo::HAS_RCPC3);
+            }
+            if hwcap2 & HWCAP2_LSE128 != 0 {
+                info.set(CpuInfo::HAS_LSE128);
+            }
+        }
+    }
+}
+#[cfg(target_arch = "powerpc64")]
+mod arch {
+    use super::{ffi, os, CpuInfo};
+
+    // Linux
+    // https://github.com/torvalds/linux/blob/v6.1/arch/powerpc/include/uapi/asm/cputable.h
+    // FreeBSD
+    // Defined in machine/cpu.h.
+    // https://github.com/freebsd/freebsd-src/blob/deb63adf945d446ed91a9d84124c71f15ae571d1/sys/powerpc/include/cpu.h
+    // available on FreeBSD 11.0+
+    // https://github.com/freebsd/freebsd-src/commit/b0bf7fcd298133457991b27625bbed766e612730
+    pub(super) const PPC_FEATURE2_ARCH_2_07: ffi::c_ulong = 0x80000000;
+
+    #[cold]
+    pub(super) fn _detect(info: &mut CpuInfo) {
+        let hwcap2 = os::getauxval(ffi::AT_HWCAP2);
+
+        // power8
+        if hwcap2 & PPC_FEATURE2_ARCH_2_07 != 0 {
+            info.set(CpuInfo::HAS_QUADWORD_ATOMICS);
+        }
+    }
+}
+
+#[allow(
+    clippy::alloc_instead_of_core,
+    clippy::std_instead_of_alloc,
+    clippy::std_instead_of_core,
+    clippy::undocumented_unsafe_blocks,
+    clippy::wildcard_imports
+)]
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[cfg(any(target_os = "linux", target_os = "android"))]
+    #[cfg(target_pointer_width = "64")]
+    #[test]
+    fn test_linux_like() {
+        use c_types::*;
+        use std::{arch::asm, mem, vec};
+        use test_helper::{libc, sys};
+
+        // Linux kernel 6.4 has added a way to read auxv without depending on either libc or mrs trap.
+        // https://github.com/torvalds/linux/commit/ddc65971bb677aa9f6a4c21f76d3133e106f88eb
+        //
+        // This is currently used only for testing.
+        fn getauxval_pr_get_auxv(type_: ffi::c_ulong) -> Result<ffi::c_ulong, c_int> {
+            #[cfg(target_arch = "aarch64")]
+            unsafe fn prctl_get_auxv(out: *mut c_void, len: usize) -> Result<usize, c_int> {
+                let r: i64;
+                unsafe {
+                    asm!(
+                        "svc 0",
+                        in("x8") sys::__NR_prctl as u64,
+                        inout("x0") sys::PR_GET_AUXV as u64 => r,
+                        in("x1") ptr_reg!(out),
+                        in("x2") len as u64,
+                        // arg4 and arg5 must be zero.
+                        in("x3") 0_u64,
+                        in("x4") 0_u64,
+                        options(nostack, preserves_flags),
+                    );
+                }
+                #[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
+                if (r as c_int) < 0 {
+                    Err(r as c_int)
+                } else {
+                    Ok(r as usize)
+                }
+            }
+            #[cfg(target_arch = "powerpc64")]
+            unsafe fn prctl_get_auxv(out: *mut c_void, len: usize) -> Result<usize, c_int> {
+                let r: i64;
+                unsafe {
+                    asm!(
+                        "sc",
+                        "bns+ 2f",
+                        "neg %r3, %r3",
+                        "2:",
+                        inout("r0") sys::__NR_prctl as u64 => _,
+                        inout("r3") sys::PR_GET_AUXV as u64 => r,
+                        inout("r4") ptr_reg!(out) => _,
+                        inout("r5") len as u64 => _,
+                        // arg4 and arg5 must be zero.
+                        inout("r6") 0_u64 => _,
+                        inout("r7") 0_u64 => _,
+                        out("r8") _,
+                        out("r9") _,
+                        out("r10") _,
+                        out("r11") _,
+                        out("r12") _,
+                        out("cr0") _,
+                        options(nostack, preserves_flags),
+                    );
+                }
+                #[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
+                if (r as c_int) < 0 {
+                    Err(r as c_int)
+                } else {
+                    Ok(r as usize)
+                }
+            }
+
+            let mut auxv = vec![unsafe { mem::zeroed::<sys::Elf64_auxv_t>() }; 38];
+
+            let old_len = auxv.len() * mem::size_of::<sys::Elf64_auxv_t>();
+
+            // SAFETY:
+            // - `out_len` does not exceed the size of `auxv`.
+            let _len = unsafe { prctl_get_auxv(auxv.as_mut_ptr().cast::<c_void>(), old_len)? };
+
+            for aux in &auxv {
+                if aux.a_type == type_ {
+                    // SAFETY: aux.a_un is #[repr(C)] union and all fields have
+                    // the same size and can be safely transmuted to integers.
+                    return Ok(unsafe { aux.a_un.a_val });
+                }
+            }
+            Err(0)
+        }
+
+        unsafe {
+            let mut u = mem::zeroed();
+            assert_eq!(libc::uname(&mut u), 0);
+            let release = std::ffi::CStr::from_ptr(u.release.as_ptr());
+            let release = core::str::from_utf8(release.to_bytes()).unwrap();
+            let mut digits = release.split('.');
+            let major = digits.next().unwrap().parse::<u32>().unwrap();
+            let minor = digits.next().unwrap().parse::<u32>().unwrap();
+            // TODO: qemu-user bug?
+            if (major, minor) < (6, 4) || cfg!(qemu) {
+                std::eprintln!("kernel version: {major}.{minor} (no pr_get_auxv)");
+                assert_eq!(getauxval_pr_get_auxv(ffi::AT_HWCAP).unwrap_err(), -22);
+                assert_eq!(getauxval_pr_get_auxv(ffi::AT_HWCAP2).unwrap_err(), -22);
+            } else {
+                std::eprintln!("kernel version: {major}.{minor} (has pr_get_auxv)");
+                assert_eq!(
+                    os::getauxval(ffi::AT_HWCAP),
+                    getauxval_pr_get_auxv(ffi::AT_HWCAP).unwrap()
+                );
+                assert_eq!(
+                    os::getauxval(ffi::AT_HWCAP2),
+                    getauxval_pr_get_auxv(ffi::AT_HWCAP2).unwrap()
+                );
+            }
+        }
+    }
+
+    #[allow(clippy::cast_sign_loss)]
+    #[cfg(all(target_arch = "aarch64", target_os = "android"))]
+    #[test]
+    fn test_android() {
+        unsafe {
+            let mut arch = [1; ffi::PROP_VALUE_MAX as usize];
+            let len = ffi::__system_property_get(
+                b"ro.arch\0".as_ptr().cast::<ffi::c_char>(),
+                arch.as_mut_ptr().cast::<ffi::c_char>(),
+            );
+            assert!(len >= 0);
+            std::eprintln!("len={}", len);
+            std::eprintln!("arch={:?}", arch);
+            std::eprintln!(
+                "arch={:?}",
+                core::str::from_utf8(core::slice::from_raw_parts(arch.as_ptr(), len as usize))
+                    .unwrap()
+            );
+        }
+    }
+
+    #[allow(clippy::cast_possible_wrap)]
+    #[cfg(target_os = "freebsd")]
+    #[test]
+    fn test_freebsd() {
+        use c_types::*;
+        use std::{arch::asm, mem, ptr};
+        use test_helper::sys;
+
+        // This is almost equivalent to what elf_aux_info does.
+        // https://man.freebsd.org/elf_aux_info(3)
+        // On FreeBSD, [aarch64 support is available on FreeBSD 11.0+](https://www.freebsd.org/releases/11.0R/relnotes/#hardware-arm),
+        // but elf_aux_info is available on FreeBSD 12.0+ and 11.4+:
+        // https://github.com/freebsd/freebsd-src/commit/0b08ae2120cdd08c20a2b806e2fcef4d0a36c470
+        // https://github.com/freebsd/freebsd-src/blob/release/11.4.0/sys/sys/auxv.h
+        // so use sysctl instead of elf_aux_info.
+        // Note that FreeBSD 11 (11.4) was EoL on 2021-09-30, and FreeBSD 11.3 was EoL on 2020-09-30:
+        // https://www.freebsd.org/security/unsupported
+        //
+        // std_detect uses this way, but it appears to be somewhat incorrect
+        // (the type of arg4 of sysctl, auxv is smaller than AT_COUNT, etc.).
+        // https://github.com/rust-lang/stdarch/blob/a0c30f3e3c75adcd6ee7efc94014ebcead61c507/crates/std_detect/src/detect/os/freebsd/auxvec.rs#L52
+        //
+        // This is currently used only for testing.
+        // If you want us to use this implementation for compatibility with the older FreeBSD
+        // version that came to EoL a few years ago, please open an issue.
+        fn getauxval_sysctl_libc(type_: ffi::c_int) -> ffi::c_ulong {
+            let mut auxv: [sys::Elf64_Auxinfo; sys::AT_COUNT as usize] = unsafe { mem::zeroed() };
+
+            let mut len = core::mem::size_of_val(&auxv) as c_size_t;
+
+            // SAFETY: calling getpid is safe.
+            let pid = unsafe { sys::getpid() };
+            let mib = [
+                sys::CTL_KERN as c_int,
+                sys::KERN_PROC as c_int,
+                sys::KERN_PROC_AUXV as c_int,
+                pid,
+            ];
+
+            #[allow(clippy::cast_possible_truncation)]
+            // SAFETY:
+            // - `mib.len()` does not exceed the size of `mib`.
+            // - `len` does not exceed the size of `auxv`.
+            // - `sysctl` is thread-safe.
+            let res = unsafe {
+                sys::sysctl(
+                    mib.as_ptr(),
+                    mib.len() as c_uint,
+                    auxv.as_mut_ptr().cast::<c_void>(),
+                    &mut len,
+                    ptr::null_mut(),
+                    0,
+                )
+            };
+
+            if res != -1 {
+                for aux in &auxv {
+                    if aux.a_type == type_ as c_long {
+                        // SAFETY: aux.a_un is #[repr(C)] union and all fields have
+                        // the same size and can be safely transmuted to integers.
+                        return unsafe { aux.a_un.a_val as c_ulong };
+                    }
+                }
+            }
+            0
+        }
+        // Similar to the above, but call syscall using asm instead of libc.
+        // Note that FreeBSD does not guarantee the stability of raw syscall as
+        // much as Linux does (It may actually be stable enough, though:
+        // https://lists.llvm.org/pipermail/llvm-dev/2019-June/133393.html,
+        // https://github.com/ziglang/zig/issues/16590).
+        //
+        // This is currently used only for testing.
+        fn getauxval_sysctl_asm_syscall(type_: ffi::c_int) -> Result<ffi::c_ulong, c_int> {
+            #[allow(non_camel_case_types)]
+            type pid_t = c_int;
+
+            // https://github.com/freebsd/freebsd-src/blob/9888a79adad22ba06b5aff17d05abac0029c537a/lib/libc/aarch64/SYS.h
+            // https://github.com/golang/go/blob/4badad8d477ffd7a6b762c35bc69aed82faface7/src/syscall/asm_freebsd_arm64.s
+            #[cfg(target_arch = "aarch64")]
+            #[inline]
+            fn getpid() -> pid_t {
+                #[allow(clippy::cast_possible_truncation)]
+                // SAFETY: calling getpid is safe.
+                unsafe {
+                    let n = sys::SYS_getpid;
+                    let r: i64;
+                    asm!(
+                        "svc 0",
+                        in("x8") n as u64,
+                        out("x0") r,
+                        options(nostack, readonly),
+                    );
+                    r as pid_t
+                }
+            }
+            #[cfg(target_arch = "aarch64")]
+            #[inline]
+            unsafe fn sysctl(
+                name: *const c_int,
+                name_len: c_uint,
+                old_p: *mut c_void,
+                old_len_p: *mut c_size_t,
+                new_p: *const c_void,
+                new_len: c_size_t,
+            ) -> Result<c_int, c_int> {
+                #[allow(clippy::cast_possible_truncation)]
+                // SAFETY: the caller must uphold the safety contract.
+                unsafe {
+                    let mut n = sys::SYS___sysctl as u64;
+                    let r: i64;
+                    asm!(
+                        "svc 0",
+                        "b.cc 2f",
+                        "mov x8, x0",
+                        "mov x0, #-1",
+                        "2:",
+                        inout("x8") n,
+                        inout("x0") ptr_reg!(name) => r,
+                        inout("x1") name_len as u64 => _,
+                        in("x2") ptr_reg!(old_p),
+                        in("x3") ptr_reg!(old_len_p),
+                        in("x4") ptr_reg!(new_p),
+                        in("x5") new_len as u64,
+                        options(nostack),
+                    );
+                    if r as c_int == -1 {
+                        Err(n as c_int)
+                    } else {
+                        Ok(r as c_int)
+                    }
+                }
+            }
+
+            // https://github.com/freebsd/freebsd-src/blob/9888a79adad22ba06b5aff17d05abac0029c537a/lib/libc/powerpc64/SYS.h
+            #[cfg(target_arch = "powerpc64")]
+            #[inline]
+            fn getpid() -> pid_t {
+                #[allow(clippy::cast_possible_truncation)]
+                // SAFETY: calling getpid is safe.
+                unsafe {
+                    let n = sys::SYS_getpid;
+                    let r: i64;
+                    asm!(
+                        "sc",
+                        inout("r0") n as u64 => _,
+                        out("r3") r,
+                        out("r4") _,
+                        out("r5") _,
+                        out("r6") _,
+                        out("r7") _,
+                        out("r8") _,
+                        out("r9") _,
+                        out("r10") _,
+                        out("r11") _,
+                        out("r12") _,
+                        out("cr0") _,
+                        options(nostack, preserves_flags, readonly),
+                    );
+                    r as pid_t
+                }
+            }
+            #[cfg(target_arch = "powerpc64")]
+            #[inline]
+            unsafe fn sysctl(
+                name: *const c_int,
+                name_len: c_uint,
+                old_p: *mut c_void,
+                old_len_p: *mut c_size_t,
+                new_p: *const c_void,
+                new_len: c_size_t,
+            ) -> Result<c_int, c_int> {
+                #[allow(clippy::cast_possible_truncation)]
+                // SAFETY: the caller must uphold the safety contract.
+                unsafe {
+                    let mut n = sys::SYS___sysctl as u64;
+                    let r: i64;
+                    asm!(
+                        "sc",
+                        "bns+ 2f",
+                        "mr %r0, %r3",
+                        "li %r3, -1",
+                        "2:",
+                        inout("r0") n,
+                        inout("r3") ptr_reg!(name) => r,
+                        inout("r4") name_len as u64 => _,
+                        inout("r5") ptr_reg!(old_p) => _,
+                        inout("r6") ptr_reg!(old_len_p) => _,
+                        inout("r7") ptr_reg!(new_p) => _,
+                        inout("r8") new_len as u64 => _,
+                        out("r9") _,
+                        out("r10") _,
+                        out("r11") _,
+                        out("r12") _,
+                        out("cr0") _,
+                        options(nostack, preserves_flags),
+                    );
+                    if r as c_int == -1 {
+                        Err(n as c_int)
+                    } else {
+                        Ok(r as c_int)
+                    }
+                }
+            }
+
+            let mut auxv: [sys::Elf64_Auxinfo; sys::AT_COUNT as usize] = unsafe { mem::zeroed() };
+
+            let mut len = core::mem::size_of_val(&auxv) as c_size_t;
+
+            let pid = getpid();
+            let mib = [
+                sys::CTL_KERN as c_int,
+                sys::KERN_PROC as c_int,
+                sys::KERN_PROC_AUXV as c_int,
+                pid,
+            ];
+
+            #[allow(clippy::cast_possible_truncation)]
+            // SAFETY:
+            // - `mib.len()` does not exceed the size of `mib`.
+            // - `len` does not exceed the size of `auxv`.
+            // - `sysctl` is thread-safe.
+            unsafe {
+                sysctl(
+                    mib.as_ptr(),
+                    mib.len() as c_uint,
+                    auxv.as_mut_ptr().cast::<c_void>(),
+                    &mut len,
+                    ptr::null_mut(),
+                    0,
+                )?;
+            }
+
+            for aux in &auxv {
+                if aux.a_type == type_ as c_long {
+                    // SAFETY: aux.a_un is #[repr(C)] union and all fields have
+                    // the same size and can be safely transmuted to integers.
+                    return Ok(unsafe { aux.a_un.a_val as c_ulong });
+                }
+            }
+            Err(0)
+        }
+
+        assert_eq!(os::getauxval(ffi::AT_HWCAP), getauxval_sysctl_libc(ffi::AT_HWCAP));
+        assert_eq!(os::getauxval(ffi::AT_HWCAP2), getauxval_sysctl_libc(ffi::AT_HWCAP2));
+        assert_eq!(
+            os::getauxval(ffi::AT_HWCAP),
+            getauxval_sysctl_asm_syscall(ffi::AT_HWCAP).unwrap()
+        );
+        assert_eq!(
+            os::getauxval(ffi::AT_HWCAP2),
+            // AT_HWCAP2 is only available on FreeBSD 13+, at least for aarch64.
+            getauxval_sysctl_asm_syscall(ffi::AT_HWCAP2).unwrap_or(0)
+        );
+    }
+
+    // Static assertions for FFI bindings.
+    // This checks that FFI bindings defined in this crate, FFI bindings defined
+    // in libc, and FFI bindings generated for the platform's latest header file
+    // using bindgen have compatible signatures (or the same values if constants).
+    // Since this is static assertion, we can detect problems with
+    // `cargo check --tests --target <target>` run in CI (via TESTS=1 build.sh)
+    // without actually running tests on these platforms.
+    // See also tools/codegen/src/ffi.rs.
+    // TODO(codegen): auto-generate this test
+    #[allow(
+        clippy::cast_possible_wrap,
+        clippy::cast_sign_loss,
+        clippy::cast_possible_truncation,
+        clippy::no_effect_underscore_binding
+    )]
+    const _: fn() = || {
+        use test_helper::{libc, sys};
+        #[cfg(not(target_os = "freebsd"))]
+        type AtType = ffi::c_ulong;
+        #[cfg(target_os = "freebsd")]
+        type AtType = ffi::c_int;
+        #[cfg(any(target_os = "linux", target_os = "android"))]
+        {
+            let mut _getauxval: unsafe extern "C" fn(ffi::c_ulong) -> ffi::c_ulong = ffi::getauxval;
+            _getauxval = libc::getauxval;
+            _getauxval = sys::getauxval;
+        }
+        #[cfg(all(target_arch = "aarch64", target_os = "android"))]
+        {
+            let mut ___system_property_get: unsafe extern "C" fn(
+                *const ffi::c_char,
+                *mut ffi::c_char,
+            ) -> ffi::c_int = ffi::__system_property_get;
+            ___system_property_get = libc::__system_property_get;
+            ___system_property_get = sys::__system_property_get;
+            static_assert!(ffi::PROP_VALUE_MAX == libc::PROP_VALUE_MAX);
+            static_assert!(ffi::PROP_VALUE_MAX == sys::PROP_VALUE_MAX as ffi::c_int);
+        }
+        #[cfg(target_os = "freebsd")]
+        {
+            let mut _elf_aux_info: unsafe extern "C" fn(
+                ffi::c_int,
+                *mut ffi::c_void,
+                ffi::c_int,
+            ) -> ffi::c_int = ffi::elf_aux_info;
+            _elf_aux_info = libc::elf_aux_info;
+            _elf_aux_info = sys::elf_aux_info;
+        }
+        #[cfg(not(target_os = "freebsd"))] // libc doesn't have this on FreeBSD
+        static_assert!(ffi::AT_HWCAP == libc::AT_HWCAP);
+        static_assert!(ffi::AT_HWCAP == sys::AT_HWCAP as AtType);
+        #[cfg(not(target_os = "freebsd"))] // libc doesn't have this on FreeBSD
+        static_assert!(ffi::AT_HWCAP2 == libc::AT_HWCAP2);
+        static_assert!(ffi::AT_HWCAP2 == sys::AT_HWCAP2 as AtType);
+        #[cfg(target_arch = "aarch64")]
+        {
+            // static_assert!(arch::HWCAP_ATOMICS == libc::HWCAP_ATOMICS); // libc doesn't have this
+            static_assert!(arch::HWCAP_ATOMICS == sys::HWCAP_ATOMICS as ffi::c_ulong);
+            // static_assert!(HWCAP_USCAT == libc::HWCAP_USCAT); // libc doesn't have this
+            static_assert!(arch::HWCAP_USCAT == sys::HWCAP_USCAT as ffi::c_ulong);
+            #[cfg(any(target_os = "linux", target_os = "android"))]
+            #[cfg(target_pointer_width = "64")]
+            {
+                // static_assert!(HWCAP2_LRCPC3 == libc::HWCAP2_LRCPC3); // libc doesn't have this
+                static_assert!(arch::HWCAP2_LRCPC3 == sys::HWCAP2_LRCPC3 as ffi::c_ulong);
+                // static_assert!(HWCAP2_LSE128 == libc::HWCAP2_LSE128); // libc doesn't have this
+                static_assert!(arch::HWCAP2_LSE128 == sys::HWCAP2_LSE128 as ffi::c_ulong);
+            }
+        }
+        #[cfg(target_arch = "powerpc64")]
+        {
+            // static_assert!(arch::PPC_FEATURE2_ARCH_2_07 == libc::PPC_FEATURE2_ARCH_2_07); // libc doesn't have this
+            static_assert!(
+                arch::PPC_FEATURE2_ARCH_2_07 == sys::PPC_FEATURE2_ARCH_2_07 as ffi::c_ulong
+            );
+        }
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/detect/common.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/detect/common.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/detect/common.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/detect/common.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,401 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+#[derive(Clone, Copy)]
+pub(crate) struct CpuInfo(u32);
+
+impl CpuInfo {
+    const INIT: u32 = 0;
+
+    #[inline]
+    fn set(&mut self, bit: u32) {
+        self.0 = set(self.0, bit);
+    }
+    #[inline]
+    fn test(self, bit: u32) -> bool {
+        test(self.0, bit)
+    }
+}
+
+#[inline]
+fn set(x: u32, bit: u32) -> u32 {
+    x | 1 << bit
+}
+#[inline]
+fn test(x: u32, bit: u32) -> bool {
+    x & (1 << bit) != 0
+}
+
+#[inline]
+pub(crate) fn detect() -> CpuInfo {
+    use core::sync::atomic::{AtomicU32, Ordering};
+
+    static CACHE: AtomicU32 = AtomicU32::new(0);
+    let mut info = CpuInfo(CACHE.load(Ordering::Relaxed));
+    if info.0 != 0 {
+        return info;
+    }
+    info.set(CpuInfo::INIT);
+    // Note: detect_false cfg is intended to make it easy for portable-atomic developers to
+    // test cases such as has_cmpxchg16b == false, has_lse == false,
+    // __kuser_helper_version < 5, etc., and is not a public API.
+    if !cfg!(portable_atomic_test_outline_atomics_detect_false) {
+        _detect(&mut info);
+    }
+    CACHE.store(info.0, Ordering::Relaxed);
+    info
+}
+
+#[cfg(target_arch = "aarch64")]
+impl CpuInfo {
+    /// Whether FEAT_LSE is available
+    const HAS_LSE: u32 = 1;
+    /// Whether FEAT_LSE2 is available
+    #[cfg_attr(not(test), allow(dead_code))]
+    const HAS_LSE2: u32 = 2;
+    /// Whether FEAT_LSE128 is available
+    // This is currently only used in tests.
+    #[cfg(test)]
+    const HAS_LSE128: u32 = 3;
+    /// Whether FEAT_LRCPC3 is available
+    // This is currently only used in tests.
+    #[cfg(test)]
+    const HAS_RCPC3: u32 = 4;
+
+    #[cfg(any(test, not(any(target_feature = "lse", portable_atomic_target_feature = "lse"))))]
+    #[inline]
+    pub(crate) fn has_lse(self) -> bool {
+        self.test(CpuInfo::HAS_LSE)
+    }
+    #[cfg_attr(not(test), allow(dead_code))]
+    #[cfg(any(test, not(any(target_feature = "lse2", portable_atomic_target_feature = "lse2"))))]
+    #[inline]
+    pub(crate) fn has_lse2(self) -> bool {
+        self.test(CpuInfo::HAS_LSE2)
+    }
+    #[cfg(test)]
+    #[inline]
+    pub(crate) fn has_lse128(self) -> bool {
+        self.test(CpuInfo::HAS_LSE128)
+    }
+    #[cfg(test)]
+    #[inline]
+    pub(crate) fn has_rcpc3(self) -> bool {
+        self.test(CpuInfo::HAS_RCPC3)
+    }
+}
+
+#[cfg(target_arch = "x86_64")]
+impl CpuInfo {
+    /// Whether CMPXCHG16B is available
+    const HAS_CMPXCHG16B: u32 = 1;
+    /// Whether VMOVDQA is atomic
+    #[cfg(target_feature = "sse")]
+    const HAS_VMOVDQA_ATOMIC: u32 = 2;
+
+    #[cfg(any(
+        test,
+        not(any(target_feature = "cmpxchg16b", portable_atomic_target_feature = "cmpxchg16b")),
+    ))]
+    #[inline]
+    pub(crate) fn has_cmpxchg16b(self) -> bool {
+        self.test(CpuInfo::HAS_CMPXCHG16B)
+    }
+    #[cfg(target_feature = "sse")]
+    #[inline]
+    pub(crate) fn has_vmovdqa_atomic(self) -> bool {
+        self.test(CpuInfo::HAS_VMOVDQA_ATOMIC)
+    }
+}
+
+#[cfg(target_arch = "powerpc64")]
+impl CpuInfo {
+    /// Whether lqarx and stqcx. instructions are available
+    const HAS_QUADWORD_ATOMICS: u32 = 1;
+
+    #[cfg(any(
+        test,
+        not(any(
+            target_feature = "quadword-atomics",
+            portable_atomic_target_feature = "quadword-atomics",
+        )),
+    ))]
+    #[inline]
+    pub(crate) fn has_quadword_atomics(self) -> bool {
+        self.test(CpuInfo::HAS_QUADWORD_ATOMICS)
+    }
+}
+
+// core::ffi::c_* (except c_void) requires Rust 1.64, libc will soon require Rust 1.47
+#[cfg(any(target_arch = "aarch64", target_arch = "powerpc64"))]
+#[cfg(not(windows))]
+#[allow(dead_code, non_camel_case_types)]
+mod c_types {
+    pub(crate) type c_void = core::ffi::c_void;
+    // c_{,u}int is {i,u}32 on non-16-bit architectures
+    // https://github.com/rust-lang/rust/blob/1.70.0/library/core/src/ffi/mod.rs#L160
+    // (16-bit architectures currently don't use this module)
+    pub(crate) type c_int = i32;
+    pub(crate) type c_uint = u32;
+    // c_{,u}long is {i,u}64 on non-Windows 64-bit targets, otherwise is {i,u}32
+    // https://github.com/rust-lang/rust/blob/1.70.0/library/core/src/ffi/mod.rs#L176
+    // (Windows currently doesn't use this module - this module is cfg(not(windows)))
+    #[cfg(target_pointer_width = "64")]
+    pub(crate) type c_long = i64;
+    #[cfg(not(target_pointer_width = "64"))]
+    pub(crate) type c_long = i32;
+    #[cfg(target_pointer_width = "64")]
+    pub(crate) type c_ulong = u64;
+    #[cfg(not(target_pointer_width = "64"))]
+    pub(crate) type c_ulong = u32;
+    // c_size_t is currently always usize
+    // https://github.com/rust-lang/rust/blob/1.70.0/library/core/src/ffi/mod.rs#L88
+    pub(crate) type c_size_t = usize;
+    // c_char is u8 by default on most non-Apple/non-Windows ARM/PowerPC/RISC-V/s390x/Hexagon targets
+    // (Linux/Android/FreeBSD/NetBSD/OpenBSD/VxWorks/Fuchsia/QNX Neutrino/Horizon/AIX/z/OS)
+    // https://github.com/rust-lang/rust/blob/1.70.0/library/core/src/ffi/mod.rs#L104
+    // https://github.com/llvm/llvm-project/blob/llvmorg-18.1.2/lldb/source/Utility/ArchSpec.cpp#L712
+    // RISC-V https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/HEAD/riscv-cc.adoc#cc-type-representations
+    // Hexagon https://lists.llvm.org/pipermail/llvm-dev/attachments/20190916/21516a52/attachment-0001.pdf
+    // AIX https://www.ibm.com/docs/en/xl-c-aix/13.1.2?topic=descriptions-qchars
+    // z/OS https://www.ibm.com/docs/en/zos/2.5.0?topic=specifiers-character-types
+    // (macOS is currently the only Apple target that uses this module, and Windows currently doesn't use this module)
+    #[cfg(not(target_os = "macos"))]
+    pub(crate) type c_char = u8;
+    // c_char is i8 on all Apple targets
+    #[cfg(target_os = "macos")]
+    pub(crate) type c_char = i8;
+
+    // Static assertions for C type definitions.
+    #[cfg(test)]
+    const _: fn() = || {
+        use test_helper::{libc, sys};
+        let _: c_int = 0 as std::os::raw::c_int;
+        let _: c_uint = 0 as std::os::raw::c_uint;
+        let _: c_long = 0 as std::os::raw::c_long;
+        let _: c_ulong = 0 as std::os::raw::c_ulong;
+        let _: c_size_t = 0 as libc::size_t; // std::os::raw::c_size_t is unstable
+        let _: c_char = 0 as std::os::raw::c_char;
+        let _: c_char = 0 as sys::c_char;
+    };
+}
+
+#[allow(
+    clippy::alloc_instead_of_core,
+    clippy::std_instead_of_alloc,
+    clippy::std_instead_of_core,
+    clippy::undocumented_unsafe_blocks,
+    clippy::wildcard_imports
+)]
+#[cfg(test)]
+mod tests_common {
+    use super::*;
+
+    #[test]
+    fn test_bit_flags() {
+        let mut x = CpuInfo(0);
+        #[cfg(target_arch = "aarch64")]
+        {
+            assert!(!x.test(CpuInfo::INIT));
+            assert!(!x.test(CpuInfo::HAS_LSE));
+            assert!(!x.test(CpuInfo::HAS_LSE2));
+            assert!(!x.test(CpuInfo::HAS_LSE128));
+            assert!(!x.test(CpuInfo::HAS_RCPC3));
+            x.set(CpuInfo::INIT);
+            assert!(x.test(CpuInfo::INIT));
+            assert!(!x.test(CpuInfo::HAS_LSE));
+            assert!(!x.test(CpuInfo::HAS_LSE2));
+            assert!(!x.test(CpuInfo::HAS_LSE128));
+            assert!(!x.test(CpuInfo::HAS_RCPC3));
+            x.set(CpuInfo::HAS_LSE);
+            assert!(x.test(CpuInfo::INIT));
+            assert!(x.test(CpuInfo::HAS_LSE));
+            assert!(!x.test(CpuInfo::HAS_LSE2));
+            assert!(!x.test(CpuInfo::HAS_LSE128));
+            assert!(!x.test(CpuInfo::HAS_RCPC3));
+            x.set(CpuInfo::HAS_LSE2);
+            assert!(x.test(CpuInfo::INIT));
+            assert!(x.test(CpuInfo::HAS_LSE));
+            assert!(x.test(CpuInfo::HAS_LSE2));
+            assert!(!x.test(CpuInfo::HAS_LSE128));
+            assert!(!x.test(CpuInfo::HAS_RCPC3));
+            x.set(CpuInfo::HAS_LSE128);
+            assert!(x.test(CpuInfo::INIT));
+            assert!(x.test(CpuInfo::HAS_LSE));
+            assert!(x.test(CpuInfo::HAS_LSE2));
+            assert!(x.test(CpuInfo::HAS_LSE128));
+            assert!(!x.test(CpuInfo::HAS_RCPC3));
+            x.set(CpuInfo::HAS_RCPC3);
+            assert!(x.test(CpuInfo::INIT));
+            assert!(x.test(CpuInfo::HAS_LSE));
+            assert!(x.test(CpuInfo::HAS_LSE2));
+            assert!(x.test(CpuInfo::HAS_LSE128));
+            assert!(x.test(CpuInfo::HAS_RCPC3));
+        }
+        #[cfg(target_arch = "x86_64")]
+        {
+            assert!(!x.test(CpuInfo::INIT));
+            assert!(!x.test(CpuInfo::HAS_CMPXCHG16B));
+            assert!(!x.test(CpuInfo::HAS_VMOVDQA_ATOMIC));
+            x.set(CpuInfo::INIT);
+            assert!(x.test(CpuInfo::INIT));
+            assert!(!x.test(CpuInfo::HAS_CMPXCHG16B));
+            assert!(!x.test(CpuInfo::HAS_VMOVDQA_ATOMIC));
+            x.set(CpuInfo::HAS_CMPXCHG16B);
+            assert!(x.test(CpuInfo::INIT));
+            assert!(x.test(CpuInfo::HAS_CMPXCHG16B));
+            assert!(!x.test(CpuInfo::HAS_VMOVDQA_ATOMIC));
+            x.set(CpuInfo::HAS_VMOVDQA_ATOMIC);
+            assert!(x.test(CpuInfo::INIT));
+            assert!(x.test(CpuInfo::HAS_CMPXCHG16B));
+            assert!(x.test(CpuInfo::HAS_VMOVDQA_ATOMIC));
+        }
+        #[cfg(target_arch = "powerpc64")]
+        {
+            assert!(!x.test(CpuInfo::INIT));
+            assert!(!x.test(CpuInfo::HAS_QUADWORD_ATOMICS));
+            x.set(CpuInfo::INIT);
+            assert!(x.test(CpuInfo::INIT));
+            assert!(!x.test(CpuInfo::HAS_QUADWORD_ATOMICS));
+            x.set(CpuInfo::HAS_QUADWORD_ATOMICS);
+            assert!(x.test(CpuInfo::INIT));
+            assert!(x.test(CpuInfo::HAS_QUADWORD_ATOMICS));
+        }
+    }
+
+    #[test]
+    fn print_features() {
+        use std::{
+            fmt::Write as _,
+            io::{self, Write},
+            string::String,
+        };
+
+        let mut features = String::new();
+        macro_rules! print_feature {
+            ($name:expr, $enabled:expr $(,)?) => {{
+                let _ = writeln!(features, "  {}: {}", $name, $enabled);
+            }};
+        }
+        #[cfg(target_arch = "aarch64")]
+        {
+            features.push_str("run-time:\n");
+            print_feature!("lse", detect().test(CpuInfo::HAS_LSE));
+            print_feature!("lse2", detect().test(CpuInfo::HAS_LSE2));
+            print_feature!("lse128", detect().test(CpuInfo::HAS_LSE128));
+            print_feature!("rcpc3", detect().test(CpuInfo::HAS_RCPC3));
+            features.push_str("compile-time:\n");
+            print_feature!(
+                "lse",
+                cfg!(any(target_feature = "lse", portable_atomic_target_feature = "lse")),
+            );
+            print_feature!(
+                "lse2",
+                cfg!(any(target_feature = "lse2", portable_atomic_target_feature = "lse2")),
+            );
+        }
+        #[cfg(target_arch = "x86_64")]
+        {
+            features.push_str("run-time:\n");
+            print_feature!("cmpxchg16b", detect().test(CpuInfo::HAS_CMPXCHG16B));
+            print_feature!("vmovdqa-atomic", detect().test(CpuInfo::HAS_VMOVDQA_ATOMIC));
+            features.push_str("compile-time:\n");
+            print_feature!(
+                "cmpxchg16b",
+                cfg!(any(
+                    target_feature = "cmpxchg16b",
+                    portable_atomic_target_feature = "cmpxchg16b",
+                )),
+            );
+        }
+        #[cfg(target_arch = "powerpc64")]
+        {
+            features.push_str("run-time:\n");
+            print_feature!("quadword-atomics", detect().test(CpuInfo::HAS_QUADWORD_ATOMICS));
+            features.push_str("compile-time:\n");
+            print_feature!(
+                "quadword-atomics",
+                cfg!(any(
+                    target_feature = "quadword-atomics",
+                    portable_atomic_target_feature = "quadword-atomics",
+                )),
+            );
+        }
+        let stdout = io::stderr();
+        let mut stdout = stdout.lock();
+        let _ = stdout.write_all(features.as_bytes());
+    }
+
+    #[cfg(target_arch = "x86_64")]
+    #[test]
+    #[cfg_attr(portable_atomic_test_outline_atomics_detect_false, ignore)]
+    fn test_detect() {
+        if detect().has_cmpxchg16b() {
+            assert!(detect().test(CpuInfo::HAS_CMPXCHG16B));
+        } else {
+            assert!(!detect().test(CpuInfo::HAS_CMPXCHG16B));
+        }
+        if detect().has_vmovdqa_atomic() {
+            assert!(detect().test(CpuInfo::HAS_VMOVDQA_ATOMIC));
+        } else {
+            assert!(!detect().test(CpuInfo::HAS_VMOVDQA_ATOMIC));
+        }
+    }
+    #[cfg(target_arch = "aarch64")]
+    #[test]
+    #[cfg_attr(portable_atomic_test_outline_atomics_detect_false, ignore)]
+    fn test_detect() {
+        let proc_cpuinfo = test_helper::cpuinfo::ProcCpuinfo::new();
+        if detect().has_lse() {
+            assert!(detect().test(CpuInfo::HAS_LSE));
+            if let Ok(proc_cpuinfo) = proc_cpuinfo {
+                assert!(proc_cpuinfo.lse);
+            }
+        } else {
+            assert!(!detect().test(CpuInfo::HAS_LSE));
+            if let Ok(proc_cpuinfo) = proc_cpuinfo {
+                assert!(!proc_cpuinfo.lse);
+            }
+        }
+        if detect().has_lse2() {
+            assert!(detect().test(CpuInfo::HAS_LSE));
+            assert!(detect().test(CpuInfo::HAS_LSE2));
+            if let Ok(test_helper::cpuinfo::ProcCpuinfo { lse2: Some(lse2), .. }) = proc_cpuinfo {
+                assert!(lse2);
+            }
+        } else {
+            assert!(!detect().test(CpuInfo::HAS_LSE2));
+            if let Ok(test_helper::cpuinfo::ProcCpuinfo { lse2: Some(lse2), .. }) = proc_cpuinfo {
+                assert!(!lse2);
+            }
+        }
+        if detect().has_lse128() {
+            assert!(detect().test(CpuInfo::HAS_LSE));
+            assert!(detect().test(CpuInfo::HAS_LSE2));
+            assert!(detect().test(CpuInfo::HAS_LSE128));
+        } else {
+            assert!(!detect().test(CpuInfo::HAS_LSE128));
+        }
+        if detect().has_rcpc3() {
+            assert!(detect().test(CpuInfo::HAS_RCPC3));
+        } else {
+            assert!(!detect().test(CpuInfo::HAS_RCPC3));
+        }
+    }
+    #[cfg(target_arch = "powerpc64")]
+    #[test]
+    #[cfg_attr(portable_atomic_test_outline_atomics_detect_false, ignore)]
+    fn test_detect() {
+        let proc_cpuinfo = test_helper::cpuinfo::ProcCpuinfo::new();
+        if detect().has_quadword_atomics() {
+            assert!(detect().test(CpuInfo::HAS_QUADWORD_ATOMICS));
+            if let Ok(proc_cpuinfo) = proc_cpuinfo {
+                assert!(proc_cpuinfo.power8);
+            }
+        } else {
+            assert!(!detect().test(CpuInfo::HAS_QUADWORD_ATOMICS));
+            if let Ok(proc_cpuinfo) = proc_cpuinfo {
+                assert!(!proc_cpuinfo.power8);
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/detect/x86_64.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/detect/x86_64.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/detect/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/detect/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,133 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Adapted from https://github.com/rust-lang/stdarch.
+
+#![cfg_attr(portable_atomic_sanitize_thread, allow(dead_code))]
+
+// Miri doesn't support inline assembly used in __cpuid: https://github.com/rust-lang/miri/issues/932
+// SGX doesn't support CPUID: https://github.com/rust-lang/stdarch/blob/a0c30f3e3c75adcd6ee7efc94014ebcead61c507/crates/core_arch/src/x86/cpuid.rs#L102-L105
+#[cfg(any(target_env = "sgx", miri))]
+compile_error!("internal error: this module is not supported on this environment");
+
+include!("common.rs");
+
+#[cfg(not(portable_atomic_no_asm))]
+use core::arch::asm;
+use core::arch::x86_64::CpuidResult;
+
+// Workaround for https://github.com/rust-lang/rust/issues/101346
+// It is not clear if our use cases are affected, but we implement this just in case.
+//
+// Refs:
+// - https://www.felixcloutier.com/x86/cpuid
+// - https://en.wikipedia.org/wiki/CPUID
+// - https://github.com/rust-lang/stdarch/blob/a0c30f3e3c75adcd6ee7efc94014ebcead61c507/crates/core_arch/src/x86/cpuid.rs
+#[cfg(not(target_env = "sgx"))]
+fn __cpuid(leaf: u32) -> CpuidResult {
+    let eax;
+    let mut ebx;
+    let ecx;
+    let edx;
+    // SAFETY: Calling `__cpuid`` is safe on all x86_64 CPUs except for SGX,
+    // which doesn't support `cpuid`.
+    // https://github.com/rust-lang/stdarch/blob/a0c30f3e3c75adcd6ee7efc94014ebcead61c507/crates/core_arch/src/x86/cpuid.rs#L102-L109
+    unsafe {
+        asm!(
+            "mov {ebx_tmp:r}, rbx", // save rbx which is reserved by LLVM
+            "cpuid",
+            "xchg {ebx_tmp:r}, rbx", // restore rbx
+            ebx_tmp = out(reg) ebx,
+            inout("eax") leaf => eax,
+            inout("ecx") 0 => ecx,
+            out("edx") edx,
+            options(nostack, preserves_flags),
+        );
+    }
+    CpuidResult { eax, ebx, ecx, edx }
+}
+
+// https://en.wikipedia.org/wiki/CPUID
+const _VENDOR_ID_INTEL: [u8; 12] = *b"GenuineIntel"; // Intel
+const _VENDOR_ID_INTEL2: [u8; 12] = *b"GenuineIotel"; // Intel https://github.com/InstLatx64/InstLatx64/commit/8fdd319884c67d2c6ec1ca0c595b42c1c4b8d803
+const _VENDOR_ID_AMD: [u8; 12] = *b"AuthenticAMD"; // AMD
+const _VENDOR_ID_ZHAOXIN: [u8; 12] = *b"  Shanghai  "; // Zhaoxin
+fn _vendor_id() -> [u8; 12] {
+    // https://github.com/rust-lang/stdarch/blob/a0c30f3e3c75adcd6ee7efc94014ebcead61c507/crates/std_detect/src/detect/os/x86.rs#L40-L59
+    let CpuidResult { ebx, ecx, edx, .. } = __cpuid(0);
+    let vendor_id: [[u8; 4]; 3] = [ebx.to_ne_bytes(), edx.to_ne_bytes(), ecx.to_ne_bytes()];
+    // SAFETY: transmute is safe because `[u8; 12]` and `[[u8; 4]; 3]` has the same layout.
+    unsafe { core::mem::transmute(vendor_id) }
+}
+fn _vendor_has_vmovdqa_atomic(vendor_id: [u8; 12]) -> bool {
+    // VMOVDQA is atomic on Intel, AMD, and Zhaoxin CPUs with AVX.
+    // See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104688 for details.
+    vendor_id == _VENDOR_ID_INTEL
+        || vendor_id == _VENDOR_ID_INTEL2
+        || vendor_id == _VENDOR_ID_AMD
+        || vendor_id == _VENDOR_ID_ZHAOXIN
+}
+
+#[cold]
+fn _detect(info: &mut CpuInfo) {
+    let proc_info_ecx = __cpuid(0x0000_0001_u32).ecx;
+
+    // https://github.com/rust-lang/stdarch/blob/a0c30f3e3c75adcd6ee7efc94014ebcead61c507/crates/std_detect/src/detect/os/x86.rs#L111
+    if test(proc_info_ecx, 13) {
+        info.set(CpuInfo::HAS_CMPXCHG16B);
+    }
+
+    // We only use VMOVDQA when SSE is enabled. See atomic_load_vmovdqa() in atomic128/x86_64.rs for more.
+    #[cfg(target_feature = "sse")]
+    {
+        use core::arch::x86_64::_xgetbv;
+
+        // https://github.com/rust-lang/stdarch/blob/a0c30f3e3c75adcd6ee7efc94014ebcead61c507/crates/std_detect/src/detect/os/x86.rs#L131-L224
+        let cpu_xsave = test(proc_info_ecx, 26);
+        if cpu_xsave {
+            let cpu_osxsave = test(proc_info_ecx, 27);
+            if cpu_osxsave {
+                // SAFETY: Calling `_xgetbv`` is safe because the CPU has `xsave` support
+                // and OS has set `osxsave`.
+                let xcr0 = unsafe { _xgetbv(0) };
+                let os_avx_support = xcr0 & 6 == 6;
+                if os_avx_support && test(proc_info_ecx, 28) {
+                    let vendor_id = _vendor_id();
+                    if _vendor_has_vmovdqa_atomic(vendor_id) {
+                        info.set(CpuInfo::HAS_VMOVDQA_ATOMIC);
+                    }
+                }
+            }
+        }
+    }
+}
+
+#[allow(
+    clippy::alloc_instead_of_core,
+    clippy::std_instead_of_alloc,
+    clippy::std_instead_of_core,
+    clippy::undocumented_unsafe_blocks,
+    clippy::wildcard_imports
+)]
+#[cfg(test)]
+mod tests {
+    use std::io::{self, Write};
+
+    use super::*;
+
+    #[test]
+    #[cfg_attr(portable_atomic_test_outline_atomics_detect_false, ignore)]
+    fn test_cpuid() {
+        assert_eq!(std::is_x86_feature_detected!("cmpxchg16b"), detect().has_cmpxchg16b());
+        let vendor_id = _vendor_id();
+        {
+            let stdout = io::stderr();
+            let mut stdout = stdout.lock();
+            let _ = writeln!(stdout, "\n  vendor_id: {}", std::str::from_utf8(&vendor_id).unwrap());
+        }
+        if _vendor_has_vmovdqa_atomic(vendor_id) {
+            assert_eq!(std::is_x86_feature_detected!("avx"), detect().has_vmovdqa_atomic());
+        } else {
+            assert!(!detect().has_vmovdqa_atomic());
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/intrinsics.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/intrinsics.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/intrinsics.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/intrinsics.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,513 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Atomic{I,U}128 implementation without inline assembly.
+//
+// Note: This module is currently only enabled on Miri and ThreadSanitizer which
+// do not support inline assembly.
+//
+// This uses `core::arch::x86_64::cmpxchg16b` on x86_64 and
+// `core::intrinsics::atomic_*` on aarch64, powerpc64, and s390x.
+//
+// See README.md of this directory for performance comparison with the
+// implementation with inline assembly.
+//
+// Note:
+// - This currently needs Rust 1.70 on x86_64, otherwise nightly compilers.
+// - On powerpc64, this requires LLVM 15+ and pwr8+ (quadword-atomics LLVM target feature):
+//   https://github.com/llvm/llvm-project/commit/549e118e93c666914a1045fde38a2cac33e1e445
+// - On s390x, old LLVM (pre-18) generates libcalls for operations other than load/store/cmpxchg:
+//   https://github.com/llvm/llvm-project/commit/c568927f3e2e7d9804ea74ecbf11c16c014ddcbc
+// - On aarch64 big-endian, LLVM (as of 17) generates broken code. (wrong result in stress test)
+//   (on cfg(miri)/cfg(sanitize) it may be fine though)
+// - On powerpc64, LLVM (as of 17) doesn't support 128-bit atomic min/max:
+//   https://github.com/llvm/llvm-project/issues/68390
+// - On powerpc64le, LLVM (as of 17) generates broken code. (wrong result from fetch_add)
+//
+// Refs: https://github.com/rust-lang/rust/blob/1.70.0/library/core/src/sync/atomic.rs
+
+include!("macros.rs");
+
+#[allow(dead_code)] // we only use compare_exchange.
+#[cfg(target_arch = "x86_64")]
+#[cfg(not(target_feature = "cmpxchg16b"))]
+#[path = "../fallback/outline_atomics.rs"]
+mod fallback;
+
+#[cfg(target_arch = "x86_64")]
+#[cfg(not(target_feature = "cmpxchg16b"))]
+#[path = "detect/x86_64.rs"]
+mod detect;
+
+use core::sync::atomic::Ordering;
+#[cfg(not(target_arch = "x86_64"))]
+use core::{
+    intrinsics,
+    sync::atomic::Ordering::{AcqRel, Acquire, Relaxed, Release, SeqCst},
+};
+
+// https://github.com/rust-lang/rust/blob/1.70.0/library/core/src/sync/atomic.rs#L3128
+#[cfg(target_arch = "x86_64")]
+#[inline]
+fn strongest_failure_ordering(order: Ordering) -> Ordering {
+    match order {
+        Ordering::Release | Ordering::Relaxed => Ordering::Relaxed,
+        Ordering::SeqCst => Ordering::SeqCst,
+        Ordering::Acquire | Ordering::AcqRel => Ordering::Acquire,
+        _ => unreachable!(),
+    }
+}
+
+#[inline]
+#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+unsafe fn atomic_load(src: *mut u128, order: Ordering) -> u128 {
+    #[cfg(target_arch = "x86_64")]
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        let fail_order = strongest_failure_ordering(order);
+        match atomic_compare_exchange(src, 0, 0, order, fail_order) {
+            Ok(v) | Err(v) => v,
+        }
+    }
+    #[cfg(not(target_arch = "x86_64"))]
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        match order {
+            Acquire => intrinsics::atomic_load_acquire(src),
+            Relaxed => intrinsics::atomic_load_relaxed(src),
+            SeqCst => intrinsics::atomic_load_seqcst(src),
+            _ => unreachable!(),
+        }
+    }
+}
+
+#[inline]
+#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+unsafe fn atomic_store(dst: *mut u128, val: u128, order: Ordering) {
+    #[cfg(target_arch = "x86_64")]
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        atomic_swap(dst, val, order);
+    }
+    #[cfg(not(target_arch = "x86_64"))]
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        match order {
+            Release => intrinsics::atomic_store_release(dst, val),
+            Relaxed => intrinsics::atomic_store_relaxed(dst, val),
+            SeqCst => intrinsics::atomic_store_seqcst(dst, val),
+            _ => unreachable!(),
+        }
+    }
+}
+
+#[inline]
+#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+unsafe fn atomic_compare_exchange(
+    dst: *mut u128,
+    old: u128,
+    new: u128,
+    success: Ordering,
+    failure: Ordering,
+) -> Result<u128, u128> {
+    #[cfg(target_arch = "x86_64")]
+    let (val, ok) = {
+        #[target_feature(enable = "cmpxchg16b")]
+        #[cfg_attr(target_feature = "cmpxchg16b", inline)]
+        #[cfg_attr(not(target_feature = "cmpxchg16b"), inline(never))]
+        unsafe fn cmpxchg16b(
+            dst: *mut u128,
+            old: u128,
+            new: u128,
+            success: Ordering,
+            failure: Ordering,
+        ) -> (u128, bool) {
+            debug_assert!(dst as usize % 16 == 0);
+            #[cfg(not(target_feature = "cmpxchg16b"))]
+            {
+                debug_assert!(detect::detect().has_cmpxchg16b());
+            }
+            // SAFETY: the caller must guarantee that `dst` is valid for both writes and
+            // reads, 16-byte aligned (required by CMPXCHG16B), that there are no
+            // concurrent non-atomic operations, and that the CPU supports CMPXCHG16B.
+            let prev = unsafe { core::arch::x86_64::cmpxchg16b(dst, old, new, success, failure) };
+            (prev, prev == old)
+        }
+        #[cfg(target_feature = "cmpxchg16b")]
+        // SAFETY: the caller must guarantee that `dst` is valid for both writes and
+        // reads, 16-byte aligned, that there are no concurrent non-atomic operations,
+        // and cfg guarantees that CMPXCHG16B is available at compile-time.
+        unsafe {
+            cmpxchg16b(dst, old, new, success, failure)
+        }
+        #[cfg(not(target_feature = "cmpxchg16b"))]
+        // SAFETY: the caller must guarantee that `dst` is valid for both writes and
+        // reads, 16-byte aligned, and that there are no different kinds of concurrent accesses.
+        unsafe {
+            ifunc!(unsafe fn(
+                dst: *mut u128, old: u128, new: u128, success: Ordering, failure: Ordering
+            ) -> (u128, bool) {
+                if detect::detect().has_cmpxchg16b() {
+                    cmpxchg16b
+                } else {
+                    fallback::atomic_compare_exchange
+                }
+            })
+        }
+    };
+    #[cfg(not(target_arch = "x86_64"))]
+    // SAFETY: the caller must uphold the safety contract.
+    let (val, ok) = unsafe {
+        match (success, failure) {
+            (Relaxed, Relaxed) => intrinsics::atomic_cxchg_relaxed_relaxed(dst, old, new),
+            (Relaxed, Acquire) => intrinsics::atomic_cxchg_relaxed_acquire(dst, old, new),
+            (Relaxed, SeqCst) => intrinsics::atomic_cxchg_relaxed_seqcst(dst, old, new),
+            (Acquire, Relaxed) => intrinsics::atomic_cxchg_acquire_relaxed(dst, old, new),
+            (Acquire, Acquire) => intrinsics::atomic_cxchg_acquire_acquire(dst, old, new),
+            (Acquire, SeqCst) => intrinsics::atomic_cxchg_acquire_seqcst(dst, old, new),
+            (Release, Relaxed) => intrinsics::atomic_cxchg_release_relaxed(dst, old, new),
+            (Release, Acquire) => intrinsics::atomic_cxchg_release_acquire(dst, old, new),
+            (Release, SeqCst) => intrinsics::atomic_cxchg_release_seqcst(dst, old, new),
+            (AcqRel, Relaxed) => intrinsics::atomic_cxchg_acqrel_relaxed(dst, old, new),
+            (AcqRel, Acquire) => intrinsics::atomic_cxchg_acqrel_acquire(dst, old, new),
+            (AcqRel, SeqCst) => intrinsics::atomic_cxchg_acqrel_seqcst(dst, old, new),
+            (SeqCst, Relaxed) => intrinsics::atomic_cxchg_seqcst_relaxed(dst, old, new),
+            (SeqCst, Acquire) => intrinsics::atomic_cxchg_seqcst_acquire(dst, old, new),
+            (SeqCst, SeqCst) => intrinsics::atomic_cxchg_seqcst_seqcst(dst, old, new),
+            _ => unreachable!(),
+        }
+    };
+    if ok {
+        Ok(val)
+    } else {
+        Err(val)
+    }
+}
+
+#[cfg(target_arch = "x86_64")]
+use atomic_compare_exchange as atomic_compare_exchange_weak;
+#[cfg(not(target_arch = "x86_64"))]
+#[inline]
+#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+unsafe fn atomic_compare_exchange_weak(
+    dst: *mut u128,
+    old: u128,
+    new: u128,
+    success: Ordering,
+    failure: Ordering,
+) -> Result<u128, u128> {
+    // SAFETY: the caller must uphold the safety contract.
+    let (val, ok) = unsafe {
+        match (success, failure) {
+            (Relaxed, Relaxed) => intrinsics::atomic_cxchgweak_relaxed_relaxed(dst, old, new),
+            (Relaxed, Acquire) => intrinsics::atomic_cxchgweak_relaxed_acquire(dst, old, new),
+            (Relaxed, SeqCst) => intrinsics::atomic_cxchgweak_relaxed_seqcst(dst, old, new),
+            (Acquire, Relaxed) => intrinsics::atomic_cxchgweak_acquire_relaxed(dst, old, new),
+            (Acquire, Acquire) => intrinsics::atomic_cxchgweak_acquire_acquire(dst, old, new),
+            (Acquire, SeqCst) => intrinsics::atomic_cxchgweak_acquire_seqcst(dst, old, new),
+            (Release, Relaxed) => intrinsics::atomic_cxchgweak_release_relaxed(dst, old, new),
+            (Release, Acquire) => intrinsics::atomic_cxchgweak_release_acquire(dst, old, new),
+            (Release, SeqCst) => intrinsics::atomic_cxchgweak_release_seqcst(dst, old, new),
+            (AcqRel, Relaxed) => intrinsics::atomic_cxchgweak_acqrel_relaxed(dst, old, new),
+            (AcqRel, Acquire) => intrinsics::atomic_cxchgweak_acqrel_acquire(dst, old, new),
+            (AcqRel, SeqCst) => intrinsics::atomic_cxchgweak_acqrel_seqcst(dst, old, new),
+            (SeqCst, Relaxed) => intrinsics::atomic_cxchgweak_seqcst_relaxed(dst, old, new),
+            (SeqCst, Acquire) => intrinsics::atomic_cxchgweak_seqcst_acquire(dst, old, new),
+            (SeqCst, SeqCst) => intrinsics::atomic_cxchgweak_seqcst_seqcst(dst, old, new),
+            _ => unreachable!(),
+        }
+    };
+    if ok {
+        Ok(val)
+    } else {
+        Err(val)
+    }
+}
+
+#[inline(always)]
+#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+unsafe fn atomic_update<F>(dst: *mut u128, order: Ordering, mut f: F) -> u128
+where
+    F: FnMut(u128) -> u128,
+{
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        // This is a private function and all instances of `f` only operate on the value
+        // loaded, so there is no need to synchronize the first load/failed CAS.
+        let mut prev = atomic_load(dst, Ordering::Relaxed);
+        loop {
+            let next = f(prev);
+            match atomic_compare_exchange_weak(dst, prev, next, order, Ordering::Relaxed) {
+                Ok(x) => return x,
+                Err(x) => prev = x,
+            }
+        }
+    }
+}
+
+// On x86_64, we use core::arch::x86_64::cmpxchg16b instead of core::intrinsics.
+// - On s390x, old LLVM (pre-18) generates libcalls for operations other than load/store/cmpxchg (see also module-level comment).
+#[cfg(any(target_arch = "x86_64", all(target_arch = "s390x", not(portable_atomic_llvm_18))))]
+atomic_rmw_by_atomic_update!();
+// On powerpc64, LLVM doesn't support 128-bit atomic min/max (see also module-level comment).
+#[cfg(target_arch = "powerpc64")]
+atomic_rmw_by_atomic_update!(cmp);
+
+#[cfg(not(any(target_arch = "x86_64", all(target_arch = "s390x", not(portable_atomic_llvm_18)))))]
+#[inline]
+#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+unsafe fn atomic_swap(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        match order {
+            Acquire => intrinsics::atomic_xchg_acquire(dst, val),
+            Release => intrinsics::atomic_xchg_release(dst, val),
+            AcqRel => intrinsics::atomic_xchg_acqrel(dst, val),
+            Relaxed => intrinsics::atomic_xchg_relaxed(dst, val),
+            SeqCst => intrinsics::atomic_xchg_seqcst(dst, val),
+            _ => unreachable!(),
+        }
+    }
+}
+
+#[cfg(not(any(target_arch = "x86_64", all(target_arch = "s390x", not(portable_atomic_llvm_18)))))]
+#[inline]
+#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+unsafe fn atomic_add(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        match order {
+            Acquire => intrinsics::atomic_xadd_acquire(dst, val),
+            Release => intrinsics::atomic_xadd_release(dst, val),
+            AcqRel => intrinsics::atomic_xadd_acqrel(dst, val),
+            Relaxed => intrinsics::atomic_xadd_relaxed(dst, val),
+            SeqCst => intrinsics::atomic_xadd_seqcst(dst, val),
+            _ => unreachable!(),
+        }
+    }
+}
+
+#[cfg(not(any(target_arch = "x86_64", all(target_arch = "s390x", not(portable_atomic_llvm_18)))))]
+#[inline]
+#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+unsafe fn atomic_sub(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        match order {
+            Acquire => intrinsics::atomic_xsub_acquire(dst, val),
+            Release => intrinsics::atomic_xsub_release(dst, val),
+            AcqRel => intrinsics::atomic_xsub_acqrel(dst, val),
+            Relaxed => intrinsics::atomic_xsub_relaxed(dst, val),
+            SeqCst => intrinsics::atomic_xsub_seqcst(dst, val),
+            _ => unreachable!(),
+        }
+    }
+}
+
+#[cfg(not(any(target_arch = "x86_64", all(target_arch = "s390x", not(portable_atomic_llvm_18)))))]
+#[inline]
+#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+unsafe fn atomic_and(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        match order {
+            Acquire => intrinsics::atomic_and_acquire(dst, val),
+            Release => intrinsics::atomic_and_release(dst, val),
+            AcqRel => intrinsics::atomic_and_acqrel(dst, val),
+            Relaxed => intrinsics::atomic_and_relaxed(dst, val),
+            SeqCst => intrinsics::atomic_and_seqcst(dst, val),
+            _ => unreachable!(),
+        }
+    }
+}
+
+#[cfg(not(any(target_arch = "x86_64", all(target_arch = "s390x", not(portable_atomic_llvm_18)))))]
+#[inline]
+#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+unsafe fn atomic_nand(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        match order {
+            Acquire => intrinsics::atomic_nand_acquire(dst, val),
+            Release => intrinsics::atomic_nand_release(dst, val),
+            AcqRel => intrinsics::atomic_nand_acqrel(dst, val),
+            Relaxed => intrinsics::atomic_nand_relaxed(dst, val),
+            SeqCst => intrinsics::atomic_nand_seqcst(dst, val),
+            _ => unreachable!(),
+        }
+    }
+}
+
+#[cfg(not(any(target_arch = "x86_64", all(target_arch = "s390x", not(portable_atomic_llvm_18)))))]
+#[inline]
+#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+unsafe fn atomic_or(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        match order {
+            Acquire => intrinsics::atomic_or_acquire(dst, val),
+            Release => intrinsics::atomic_or_release(dst, val),
+            AcqRel => intrinsics::atomic_or_acqrel(dst, val),
+            Relaxed => intrinsics::atomic_or_relaxed(dst, val),
+            SeqCst => intrinsics::atomic_or_seqcst(dst, val),
+            _ => unreachable!(),
+        }
+    }
+}
+
+#[cfg(not(any(target_arch = "x86_64", all(target_arch = "s390x", not(portable_atomic_llvm_18)))))]
+#[inline]
+#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+unsafe fn atomic_xor(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        match order {
+            Acquire => intrinsics::atomic_xor_acquire(dst, val),
+            Release => intrinsics::atomic_xor_release(dst, val),
+            AcqRel => intrinsics::atomic_xor_acqrel(dst, val),
+            Relaxed => intrinsics::atomic_xor_relaxed(dst, val),
+            SeqCst => intrinsics::atomic_xor_seqcst(dst, val),
+            _ => unreachable!(),
+        }
+    }
+}
+
+#[cfg(not(any(
+    target_arch = "x86_64",
+    target_arch = "powerpc64",
+    all(target_arch = "s390x", not(portable_atomic_llvm_18)),
+)))]
+#[inline]
+#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+unsafe fn atomic_max(dst: *mut u128, val: u128, order: Ordering) -> i128 {
+    #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        match order {
+            Acquire => intrinsics::atomic_max_acquire(dst.cast::<i128>(), val as i128),
+            Release => intrinsics::atomic_max_release(dst.cast::<i128>(), val as i128),
+            AcqRel => intrinsics::atomic_max_acqrel(dst.cast::<i128>(), val as i128),
+            Relaxed => intrinsics::atomic_max_relaxed(dst.cast::<i128>(), val as i128),
+            SeqCst => intrinsics::atomic_max_seqcst(dst.cast::<i128>(), val as i128),
+            _ => unreachable!(),
+        }
+    }
+}
+
+#[cfg(not(any(
+    target_arch = "x86_64",
+    target_arch = "powerpc64",
+    all(target_arch = "s390x", not(portable_atomic_llvm_18)),
+)))]
+#[inline]
+#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+unsafe fn atomic_min(dst: *mut u128, val: u128, order: Ordering) -> i128 {
+    #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        match order {
+            Acquire => intrinsics::atomic_min_acquire(dst.cast::<i128>(), val as i128),
+            Release => intrinsics::atomic_min_release(dst.cast::<i128>(), val as i128),
+            AcqRel => intrinsics::atomic_min_acqrel(dst.cast::<i128>(), val as i128),
+            Relaxed => intrinsics::atomic_min_relaxed(dst.cast::<i128>(), val as i128),
+            SeqCst => intrinsics::atomic_min_seqcst(dst.cast::<i128>(), val as i128),
+            _ => unreachable!(),
+        }
+    }
+}
+
+#[cfg(not(any(
+    target_arch = "x86_64",
+    target_arch = "powerpc64",
+    all(target_arch = "s390x", not(portable_atomic_llvm_18)),
+)))]
+#[inline]
+#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+unsafe fn atomic_umax(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        match order {
+            Acquire => intrinsics::atomic_umax_acquire(dst, val),
+            Release => intrinsics::atomic_umax_release(dst, val),
+            AcqRel => intrinsics::atomic_umax_acqrel(dst, val),
+            Relaxed => intrinsics::atomic_umax_relaxed(dst, val),
+            SeqCst => intrinsics::atomic_umax_seqcst(dst, val),
+            _ => unreachable!(),
+        }
+    }
+}
+
+#[cfg(not(any(
+    target_arch = "x86_64",
+    target_arch = "powerpc64",
+    all(target_arch = "s390x", not(portable_atomic_llvm_18)),
+)))]
+#[inline]
+#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+unsafe fn atomic_umin(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        match order {
+            Acquire => intrinsics::atomic_umin_acquire(dst, val),
+            Release => intrinsics::atomic_umin_release(dst, val),
+            AcqRel => intrinsics::atomic_umin_acqrel(dst, val),
+            Relaxed => intrinsics::atomic_umin_relaxed(dst, val),
+            SeqCst => intrinsics::atomic_umin_seqcst(dst, val),
+            _ => unreachable!(),
+        }
+    }
+}
+
+#[cfg(not(any(target_arch = "x86_64", all(target_arch = "s390x", not(portable_atomic_llvm_18)))))]
+#[inline]
+#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+unsafe fn atomic_not(dst: *mut u128, order: Ordering) -> u128 {
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe { atomic_xor(dst, !0, order) }
+}
+
+#[cfg(not(any(target_arch = "x86_64", all(target_arch = "s390x", not(portable_atomic_llvm_18)))))]
+#[inline]
+#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+unsafe fn atomic_neg(dst: *mut u128, order: Ordering) -> u128 {
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe { atomic_update(dst, order, u128::wrapping_neg) }
+}
+
+#[cfg(not(target_arch = "x86_64"))]
+#[inline]
+const fn is_lock_free() -> bool {
+    IS_ALWAYS_LOCK_FREE
+}
+#[cfg(not(target_arch = "x86_64"))]
+const IS_ALWAYS_LOCK_FREE: bool = true;
+
+#[cfg(target_arch = "x86_64")]
+#[inline]
+fn is_lock_free() -> bool {
+    #[cfg(target_feature = "cmpxchg16b")]
+    {
+        // CMPXCHG16B is available at compile-time.
+        true
+    }
+    #[cfg(not(target_feature = "cmpxchg16b"))]
+    {
+        detect::detect().has_cmpxchg16b()
+    }
+}
+#[cfg(target_arch = "x86_64")]
+const IS_ALWAYS_LOCK_FREE: bool = cfg!(target_feature = "cmpxchg16b");
+
+atomic128!(AtomicI128, i128, atomic_max, atomic_min);
+atomic128!(AtomicU128, u128, atomic_umax, atomic_umin);
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    test_atomic_int!(i128);
+    test_atomic_int!(u128);
+
+    // load/store/swap implementation is not affected by signedness, so it is
+    // enough to test only unsigned types.
+    stress_test!(u128);
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/macros.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/macros.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/macros.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/macros.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,359 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+macro_rules! atomic128 {
+    ($atomic_type:ident, $int_type:ident, $atomic_max:ident, $atomic_min:ident) => {
+        #[repr(C, align(16))]
+        pub(crate) struct $atomic_type {
+            v: core::cell::UnsafeCell<$int_type>,
+        }
+
+        // Send is implicitly implemented.
+        // SAFETY: any data races are prevented by atomic intrinsics.
+        unsafe impl Sync for $atomic_type {}
+
+        impl_default_no_fetch_ops!($atomic_type, $int_type);
+        impl_default_bit_opts!($atomic_type, $int_type);
+        impl $atomic_type {
+            #[inline]
+            pub(crate) const fn new(v: $int_type) -> Self {
+                Self { v: core::cell::UnsafeCell::new(v) }
+            }
+
+            #[inline]
+            pub(crate) fn is_lock_free() -> bool {
+                is_lock_free()
+            }
+            #[inline]
+            pub(crate) const fn is_always_lock_free() -> bool {
+                IS_ALWAYS_LOCK_FREE
+            }
+
+            #[inline]
+            pub(crate) fn get_mut(&mut self) -> &mut $int_type {
+                // SAFETY: the mutable reference guarantees unique ownership.
+                // (UnsafeCell::get_mut requires Rust 1.50)
+                unsafe { &mut *self.v.get() }
+            }
+
+            #[inline]
+            #[cfg_attr(
+                any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                track_caller
+            )]
+            pub(crate) fn load(&self, order: Ordering) -> $int_type {
+                crate::utils::assert_load_ordering(order);
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_load(self.v.get().cast::<u128>(), order) as $int_type
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(
+                any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                track_caller
+            )]
+            pub(crate) fn store(&self, val: $int_type, order: Ordering) {
+                crate::utils::assert_store_ordering(order);
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_store(self.v.get().cast::<u128>(), val as u128, order)
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn swap(&self, val: $int_type, order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_swap(self.v.get().cast::<u128>(), val as u128, order) as $int_type
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(
+                any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                track_caller
+            )]
+            pub(crate) fn compare_exchange(
+                &self,
+                current: $int_type,
+                new: $int_type,
+                success: Ordering,
+                failure: Ordering,
+            ) -> Result<$int_type, $int_type> {
+                crate::utils::assert_compare_exchange_ordering(success, failure);
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    match atomic_compare_exchange(
+                        self.v.get().cast::<u128>(),
+                        current as u128,
+                        new as u128,
+                        success,
+                        failure,
+                    ) {
+                        Ok(v) => Ok(v as $int_type),
+                        Err(v) => Err(v as $int_type),
+                    }
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(
+                any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                track_caller
+            )]
+            pub(crate) fn compare_exchange_weak(
+                &self,
+                current: $int_type,
+                new: $int_type,
+                success: Ordering,
+                failure: Ordering,
+            ) -> Result<$int_type, $int_type> {
+                crate::utils::assert_compare_exchange_ordering(success, failure);
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    match atomic_compare_exchange_weak(
+                        self.v.get().cast::<u128>(),
+                        current as u128,
+                        new as u128,
+                        success,
+                        failure,
+                    ) {
+                        Ok(v) => Ok(v as $int_type),
+                        Err(v) => Err(v as $int_type),
+                    }
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn fetch_add(&self, val: $int_type, order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_add(self.v.get().cast::<u128>(), val as u128, order) as $int_type
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn fetch_sub(&self, val: $int_type, order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_sub(self.v.get().cast::<u128>(), val as u128, order) as $int_type
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn fetch_and(&self, val: $int_type, order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_and(self.v.get().cast::<u128>(), val as u128, order) as $int_type
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn fetch_nand(&self, val: $int_type, order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_nand(self.v.get().cast::<u128>(), val as u128, order) as $int_type
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn fetch_or(&self, val: $int_type, order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_or(self.v.get().cast::<u128>(), val as u128, order) as $int_type
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn fetch_xor(&self, val: $int_type, order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_xor(self.v.get().cast::<u128>(), val as u128, order) as $int_type
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn fetch_max(&self, val: $int_type, order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    $atomic_max(self.v.get().cast::<u128>(), val as u128, order) as $int_type
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn fetch_min(&self, val: $int_type, order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    $atomic_min(self.v.get().cast::<u128>(), val as u128, order) as $int_type
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn fetch_not(&self, order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_not(self.v.get().cast::<u128>(), order) as $int_type
+                }
+            }
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn not(&self, order: Ordering) {
+                self.fetch_not(order);
+            }
+
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn fetch_neg(&self, order: Ordering) -> $int_type {
+                #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    atomic_neg(self.v.get().cast::<u128>(), order) as $int_type
+                }
+            }
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn neg(&self, order: Ordering) {
+                self.fetch_neg(order);
+            }
+
+            #[inline]
+            pub(crate) const fn as_ptr(&self) -> *mut $int_type {
+                self.v.get()
+            }
+        }
+    };
+}
+
+#[cfg(any(target_arch = "powerpc64", target_arch = "s390x", target_arch = "x86_64"))]
+#[allow(unused_macros)] // also used by intrinsics.rs
+macro_rules! atomic_rmw_by_atomic_update {
+    () => {
+        #[inline]
+        #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+        unsafe fn atomic_swap(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe { atomic_update(dst, order, |_| val) }
+        }
+        #[inline]
+        #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+        unsafe fn atomic_add(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe { atomic_update(dst, order, |x| x.wrapping_add(val)) }
+        }
+        #[inline]
+        #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+        unsafe fn atomic_sub(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe { atomic_update(dst, order, |x| x.wrapping_sub(val)) }
+        }
+        #[inline]
+        #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+        unsafe fn atomic_and(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe { atomic_update(dst, order, |x| x & val) }
+        }
+        #[inline]
+        #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+        unsafe fn atomic_nand(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe { atomic_update(dst, order, |x| !(x & val)) }
+        }
+        #[inline]
+        #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+        unsafe fn atomic_or(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe { atomic_update(dst, order, |x| x | val) }
+        }
+        #[inline]
+        #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+        unsafe fn atomic_xor(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe { atomic_update(dst, order, |x| x ^ val) }
+        }
+        #[inline]
+        #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+        unsafe fn atomic_not(dst: *mut u128, order: Ordering) -> u128 {
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe { atomic_update(dst, order, |x| !x) }
+        }
+        #[inline]
+        #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+        unsafe fn atomic_neg(dst: *mut u128, order: Ordering) -> u128 {
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe { atomic_update(dst, order, u128::wrapping_neg) }
+        }
+        atomic_rmw_by_atomic_update!(cmp);
+    };
+    (cmp) => {
+        #[inline]
+        #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+        unsafe fn atomic_max(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+            #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe {
+                atomic_update(dst, order, |x| core::cmp::max(x as i128, val as i128) as u128)
+            }
+        }
+        #[inline]
+        #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+        unsafe fn atomic_umax(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe { atomic_update(dst, order, |x| core::cmp::max(x, val)) }
+        }
+        #[inline]
+        #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+        unsafe fn atomic_min(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+            #[allow(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe {
+                atomic_update(dst, order, |x| core::cmp::min(x as i128, val as i128) as u128)
+            }
+        }
+        #[inline]
+        #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+        unsafe fn atomic_umin(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe { atomic_update(dst, order, |x| core::cmp::min(x, val)) }
+        }
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/powerpc64.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/powerpc64.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/powerpc64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/powerpc64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,947 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Atomic{I,U}128 implementation on PowerPC64.
+//
+// powerpc64 on pwr8+ support 128-bit atomics (load/store/LL/SC):
+// https://github.com/llvm/llvm-project/commit/549e118e93c666914a1045fde38a2cac33e1e445
+// https://github.com/llvm/llvm-project/blob/llvmorg-18.1.2/llvm/test/CodeGen/PowerPC/atomics-i128-ldst.ll
+// https://github.com/llvm/llvm-project/blob/llvmorg-18.1.2/llvm/test/CodeGen/PowerPC/atomics-i128.ll
+//
+// powerpc64le is pwr8+ by default https://github.com/llvm/llvm-project/blob/llvmorg-18.1.2/llvm/lib/Target/PowerPC/PPC.td#L674
+// See also https://github.com/rust-lang/rust/issues/59932
+//
+// Note that we do not separate LL and SC into separate functions, but handle
+// them within a single asm block. This is because it is theoretically possible
+// for the compiler to insert operations that might clear the reservation between
+// LL and SC. See aarch64.rs for details.
+//
+// Note: On Miri and ThreadSanitizer which do not support inline assembly, we don't use
+// this module and use intrinsics.rs instead.
+//
+// Refs:
+// - Power ISA https://openpowerfoundation.org/specifications/isa
+// - AIX Assembler language reference https://www.ibm.com/docs/en/aix/7.3?topic=aix-assembler-language-reference
+// - atomic-maybe-uninit https://github.com/taiki-e/atomic-maybe-uninit
+//
+// Generated asm:
+// - powerpc64 (pwr8) https://godbolt.org/z/71xGhY9qf
+// - powerpc64le https://godbolt.org/z/4TexcjGEz
+
+include!("macros.rs");
+
+#[cfg(not(any(
+    target_feature = "quadword-atomics",
+    portable_atomic_target_feature = "quadword-atomics",
+)))]
+#[path = "../fallback/outline_atomics.rs"]
+mod fallback;
+
+// On musl with static linking, it seems that getauxval is not always available.
+// See detect/auxv.rs for more.
+#[cfg(not(portable_atomic_no_outline_atomics))]
+#[cfg(any(test, portable_atomic_outline_atomics))] // TODO(powerpc64): currently disabled by default
+#[cfg(any(
+    test,
+    not(any(
+        target_feature = "quadword-atomics",
+        portable_atomic_target_feature = "quadword-atomics",
+    )),
+))]
+#[cfg(any(
+    all(
+        target_os = "linux",
+        any(
+            target_env = "gnu",
+            all(any(target_env = "musl", target_env = "ohos"), not(target_feature = "crt-static")),
+            portable_atomic_outline_atomics,
+        ),
+    ),
+    target_os = "android",
+    target_os = "freebsd",
+))]
+#[path = "detect/auxv.rs"]
+mod detect;
+
+use core::{arch::asm, sync::atomic::Ordering};
+
+use crate::utils::{Pair, U128};
+
+macro_rules! debug_assert_pwr8 {
+    () => {
+        #[cfg(not(any(
+            target_feature = "quadword-atomics",
+            portable_atomic_target_feature = "quadword-atomics",
+        )))]
+        {
+            debug_assert!(detect::detect().has_quadword_atomics());
+        }
+    };
+}
+
+// Refs: https://www.ibm.com/docs/en/aix/7.3?topic=ops-machine-pseudo-op
+//
+// This is similar to #[target_feature(enable = "quadword-atomics")], except that there are
+// no compiler guarantees regarding (un)inlining, and the scope is within an asm
+// block rather than a function. We use this directive because #[target_feature(enable = "quadword-atomics")]
+// is not supported as of Rust 1.70-nightly.
+//
+// start_pwr8 and end_pwr8 must be used in pairs.
+//
+// Note: If power8 instructions are not available at compile-time, we must guarantee that
+// the function that uses it is not inlined into a function where it is not
+// clear whether power8 instructions are available. Otherwise, (even if we checked whether
+// power8 instructions are available at run-time) optimizations that reorder its
+// instructions across the if condition might introduce undefined behavior.
+// (see also https://rust-lang.github.io/rfcs/2045-target-feature.html#safely-inlining-target_feature-functions-on-more-contexts)
+// However, our code uses the ifunc helper macro that works with function pointers,
+// so we don't have to worry about this unless calling without helper macro.
+macro_rules! start_pwr8 {
+    () => {
+        ".machine push\n.machine power8"
+    };
+}
+macro_rules! end_pwr8 {
+    () => {
+        ".machine pop"
+    };
+}
+
+macro_rules! atomic_rmw {
+    ($op:ident, $order:ident) => {
+        match $order {
+            Ordering::Relaxed => $op!("", ""),
+            Ordering::Acquire => $op!("lwsync", ""),
+            Ordering::Release => $op!("", "lwsync"),
+            Ordering::AcqRel => $op!("lwsync", "lwsync"),
+            Ordering::SeqCst => $op!("lwsync", "sync"),
+            _ => unreachable!(),
+        }
+    };
+}
+
+// Extracts and checks the EQ bit of cr0.
+#[inline]
+fn extract_cr0(r: u64) -> bool {
+    r & 0x20000000 != 0
+}
+
+#[cfg(any(
+    target_feature = "quadword-atomics",
+    portable_atomic_target_feature = "quadword-atomics",
+))]
+use atomic_load_pwr8 as atomic_load;
+#[cfg(not(any(
+    target_feature = "quadword-atomics",
+    portable_atomic_target_feature = "quadword-atomics",
+)))]
+#[inline]
+unsafe fn atomic_load(src: *mut u128, order: Ordering) -> u128 {
+    fn_alias! {
+        // inline(never) is just a hint and also not strictly necessary
+        // because we use ifunc helper macro, but used for clarity.
+        #[inline(never)]
+        unsafe fn(src: *mut u128) -> u128;
+        atomic_load_pwr8_relaxed = atomic_load_pwr8(Ordering::Relaxed);
+        atomic_load_pwr8_acquire = atomic_load_pwr8(Ordering::Acquire);
+        atomic_load_pwr8_seqcst = atomic_load_pwr8(Ordering::SeqCst);
+    }
+    // SAFETY: the caller must uphold the safety contract.
+    // we only calls atomic_load_pwr8 if quadword-atomics is available.
+    unsafe {
+        match order {
+            Ordering::Relaxed => {
+                ifunc!(unsafe fn(src: *mut u128) -> u128 {
+                    if detect::detect().has_quadword_atomics() {
+                        atomic_load_pwr8_relaxed
+                    } else {
+                        fallback::atomic_load_non_seqcst
+                    }
+                })
+            }
+            Ordering::Acquire => {
+                ifunc!(unsafe fn(src: *mut u128) -> u128 {
+                    if detect::detect().has_quadword_atomics() {
+                        atomic_load_pwr8_acquire
+                    } else {
+                        fallback::atomic_load_non_seqcst
+                    }
+                })
+            }
+            Ordering::SeqCst => {
+                ifunc!(unsafe fn(src: *mut u128) -> u128 {
+                    if detect::detect().has_quadword_atomics() {
+                        atomic_load_pwr8_seqcst
+                    } else {
+                        fallback::atomic_load_seqcst
+                    }
+                })
+            }
+            _ => unreachable!(),
+        }
+    }
+}
+#[inline]
+unsafe fn atomic_load_pwr8(src: *mut u128, order: Ordering) -> u128 {
+    debug_assert!(src as usize % 16 == 0);
+    debug_assert_pwr8!();
+
+    // SAFETY: the caller must uphold the safety contract.
+    //
+    // Refs: "3.3.4 Fixed Point Load and Store Quadword Instructions" of Power ISA
+    unsafe {
+        let (out_hi, out_lo);
+        macro_rules! atomic_load_acquire {
+            ($release:tt) => {
+                asm!(
+                    start_pwr8!(),
+                    $release,
+                    "lq %r4, 0({src})",
+                    // Lightweight acquire sync
+                    // Refs: https://github.com/boostorg/atomic/blob/boost-1.79.0/include/boost/atomic/detail/core_arch_ops_gcc_ppc.hpp#L47-L62
+                    "cmpd %cr7, %r4, %r4",
+                    "bne- %cr7, 2f",
+                    "2:",
+                    "isync",
+                    end_pwr8!(),
+                    src = in(reg_nonzero) ptr_reg!(src),
+                    // Quadword atomic instructions work with even/odd pair of specified register and subsequent register.
+                    // We cannot use r1 (sp) and r2 (system reserved), so start with r4 or grater.
+                    out("r4") out_hi,
+                    out("r5") out_lo,
+                    out("cr7") _,
+                    options(nostack, preserves_flags),
+                )
+            };
+        }
+        match order {
+            Ordering::Relaxed => {
+                asm!(
+                    start_pwr8!(),
+                    "lq %r4, 0({src})",
+                    end_pwr8!(),
+                    src = in(reg_nonzero) ptr_reg!(src),
+                    // Quadword atomic instructions work with even/odd pair of specified register and subsequent register.
+                    // We cannot use r1 (sp) and r2 (system reserved), so start with r4 or grater.
+                    out("r4") out_hi,
+                    out("r5") out_lo,
+                    options(nostack, preserves_flags, readonly),
+                );
+            }
+            Ordering::Acquire => atomic_load_acquire!(""),
+            Ordering::SeqCst => atomic_load_acquire!("sync"),
+            _ => unreachable!(),
+        }
+        U128 { pair: Pair { hi: out_hi, lo: out_lo } }.whole
+    }
+}
+
+#[cfg(any(
+    target_feature = "quadword-atomics",
+    portable_atomic_target_feature = "quadword-atomics",
+))]
+use atomic_store_pwr8 as atomic_store;
+#[cfg(not(any(
+    target_feature = "quadword-atomics",
+    portable_atomic_target_feature = "quadword-atomics",
+)))]
+#[inline]
+unsafe fn atomic_store(dst: *mut u128, val: u128, order: Ordering) {
+    fn_alias! {
+        // inline(never) is just a hint and also not strictly necessary
+        // because we use ifunc helper macro, but used for clarity.
+        #[inline(never)]
+        unsafe fn(dst: *mut u128, val: u128);
+        atomic_store_pwr8_relaxed = atomic_store_pwr8(Ordering::Relaxed);
+        atomic_store_pwr8_release = atomic_store_pwr8(Ordering::Release);
+        atomic_store_pwr8_seqcst = atomic_store_pwr8(Ordering::SeqCst);
+    }
+    // SAFETY: the caller must uphold the safety contract.
+    // we only calls atomic_store_pwr8 if quadword-atomics is available.
+    unsafe {
+        match order {
+            Ordering::Relaxed => {
+                ifunc!(unsafe fn(dst: *mut u128, val: u128) {
+                    if detect::detect().has_quadword_atomics() {
+                        atomic_store_pwr8_relaxed
+                    } else {
+                        fallback::atomic_store_non_seqcst
+                    }
+                });
+            }
+            Ordering::Release => {
+                ifunc!(unsafe fn(dst: *mut u128, val: u128) {
+                    if detect::detect().has_quadword_atomics() {
+                        atomic_store_pwr8_release
+                    } else {
+                        fallback::atomic_store_non_seqcst
+                    }
+                });
+            }
+            Ordering::SeqCst => {
+                ifunc!(unsafe fn(dst: *mut u128, val: u128) {
+                    if detect::detect().has_quadword_atomics() {
+                        atomic_store_pwr8_seqcst
+                    } else {
+                        fallback::atomic_store_seqcst
+                    }
+                });
+            }
+            _ => unreachable!(),
+        }
+    }
+}
+#[inline]
+unsafe fn atomic_store_pwr8(dst: *mut u128, val: u128, order: Ordering) {
+    debug_assert!(dst as usize % 16 == 0);
+    debug_assert_pwr8!();
+
+    // SAFETY: the caller must uphold the safety contract.
+    //
+    // Refs: "3.3.4 Fixed Point Load and Store Quadword Instructions" of Power ISA
+    unsafe {
+        let val = U128 { whole: val };
+        macro_rules! atomic_store {
+            ($release:tt) => {
+                asm!(
+                    start_pwr8!(),
+                    $release,
+                    "stq %r4, 0({dst})",
+                    end_pwr8!(),
+                    dst = in(reg_nonzero) ptr_reg!(dst),
+                    // Quadword atomic instructions work with even/odd pair of specified register and subsequent register.
+                    // We cannot use r1 (sp) and r2 (system reserved), so start with r4 or grater.
+                    in("r4") val.pair.hi,
+                    in("r5") val.pair.lo,
+                    options(nostack, preserves_flags),
+                )
+            };
+        }
+        match order {
+            Ordering::Relaxed => atomic_store!(""),
+            Ordering::Release => atomic_store!("lwsync"),
+            Ordering::SeqCst => atomic_store!("sync"),
+            _ => unreachable!(),
+        }
+    }
+}
+
+#[inline]
+unsafe fn atomic_compare_exchange(
+    dst: *mut u128,
+    old: u128,
+    new: u128,
+    success: Ordering,
+    failure: Ordering,
+) -> Result<u128, u128> {
+    let success = crate::utils::upgrade_success_ordering(success, failure);
+
+    #[cfg(any(
+        target_feature = "quadword-atomics",
+        portable_atomic_target_feature = "quadword-atomics",
+    ))]
+    // SAFETY: the caller must uphold the safety contract.
+    // cfg guarantees that quadword atomics instructions are available at compile-time.
+    let (prev, ok) = unsafe { atomic_compare_exchange_pwr8(dst, old, new, success) };
+    #[cfg(not(any(
+        target_feature = "quadword-atomics",
+        portable_atomic_target_feature = "quadword-atomics",
+    )))]
+    // SAFETY: the caller must uphold the safety contract.
+    let (prev, ok) = unsafe { atomic_compare_exchange_ifunc(dst, old, new, success) };
+    if ok {
+        Ok(prev)
+    } else {
+        Err(prev)
+    }
+}
+#[inline]
+unsafe fn atomic_compare_exchange_pwr8(
+    dst: *mut u128,
+    old: u128,
+    new: u128,
+    order: Ordering,
+) -> (u128, bool) {
+    debug_assert!(dst as usize % 16 == 0);
+    debug_assert_pwr8!();
+
+    // SAFETY: the caller must uphold the safety contract.
+    //
+    // Refs: "4.6.2.2 128-bit Load And Reserve and Store Conditional Instructions" of Power ISA
+    unsafe {
+        let old = U128 { whole: old };
+        let new = U128 { whole: new };
+        let (mut prev_hi, mut prev_lo);
+        let mut r;
+        macro_rules! cmpxchg {
+            ($acquire:tt, $release:tt) => {
+                asm!(
+                    start_pwr8!(),
+                    $release,
+                    "2:",
+                        "lqarx %r8, 0, {dst}",
+                        "xor {tmp_lo}, %r9, {old_lo}",
+                        "xor {tmp_hi}, %r8, {old_hi}",
+                        "or. {tmp_lo}, {tmp_lo}, {tmp_hi}",
+                        "bne %cr0, 3f", // jump if compare failed
+                        "stqcx. %r6, 0, {dst}",
+                        "bne %cr0, 2b", // continue loop if store failed
+                    "3:",
+                    // if compare failed EQ bit is cleared, if stqcx succeeds EQ bit is set.
+                    "mfcr {tmp_lo}",
+                    $acquire,
+                    end_pwr8!(),
+                    dst = in(reg_nonzero) ptr_reg!(dst),
+                    old_hi = in(reg) old.pair.hi,
+                    old_lo = in(reg) old.pair.lo,
+                    tmp_hi = out(reg) _,
+                    tmp_lo = out(reg) r,
+                    // Quadword atomic instructions work with even/odd pair of specified register and subsequent register.
+                    // We cannot use r1 (sp) and r2 (system reserved), so start with r4 or grater.
+                    in("r6") new.pair.hi,
+                    in("r7") new.pair.lo,
+                    out("r8") prev_hi,
+                    out("r9") prev_lo,
+                    out("cr0") _,
+                    options(nostack, preserves_flags),
+                )
+            };
+        }
+        atomic_rmw!(cmpxchg, order);
+        (U128 { pair: Pair { hi: prev_hi, lo: prev_lo } }.whole, extract_cr0(r))
+    }
+}
+
+// Always use strong CAS for outline-atomics.
+#[cfg(not(any(
+    target_feature = "quadword-atomics",
+    portable_atomic_target_feature = "quadword-atomics",
+)))]
+use atomic_compare_exchange as atomic_compare_exchange_weak;
+#[cfg(any(
+    target_feature = "quadword-atomics",
+    portable_atomic_target_feature = "quadword-atomics",
+))]
+#[inline]
+unsafe fn atomic_compare_exchange_weak(
+    dst: *mut u128,
+    old: u128,
+    new: u128,
+    success: Ordering,
+    failure: Ordering,
+) -> Result<u128, u128> {
+    let success = crate::utils::upgrade_success_ordering(success, failure);
+
+    // SAFETY: the caller must uphold the safety contract.
+    // cfg guarantees that quadword atomics instructions are available at compile-time.
+    let (prev, ok) = unsafe { atomic_compare_exchange_weak_pwr8(dst, old, new, success) };
+    if ok {
+        Ok(prev)
+    } else {
+        Err(prev)
+    }
+}
+#[cfg(any(
+    target_feature = "quadword-atomics",
+    portable_atomic_target_feature = "quadword-atomics",
+))]
+#[inline]
+unsafe fn atomic_compare_exchange_weak_pwr8(
+    dst: *mut u128,
+    old: u128,
+    new: u128,
+    order: Ordering,
+) -> (u128, bool) {
+    debug_assert!(dst as usize % 16 == 0);
+    debug_assert_pwr8!();
+
+    // SAFETY: the caller must uphold the safety contract.
+    //
+    // Refs: "4.6.2.2 128-bit Load And Reserve and Store Conditional Instructions" of Power ISA
+    unsafe {
+        let old = U128 { whole: old };
+        let new = U128 { whole: new };
+        let (mut prev_hi, mut prev_lo);
+        let mut r;
+        macro_rules! cmpxchg_weak {
+            ($acquire:tt, $release:tt) => {
+                asm!(
+                    start_pwr8!(),
+                    $release,
+                    "lqarx %r8, 0, {dst}",
+                    "xor {tmp_lo}, %r9, {old_lo}",
+                    "xor {tmp_hi}, %r8, {old_hi}",
+                    "or. {tmp_lo}, {tmp_lo}, {tmp_hi}",
+                    "bne %cr0, 3f", // jump if compare failed
+                    "stqcx. %r6, 0, {dst}",
+                    "3:",
+                    // if compare or stqcx failed EQ bit is cleared, if stqcx succeeds EQ bit is set.
+                    "mfcr {tmp_lo}",
+                    $acquire,
+                    end_pwr8!(),
+                    dst = in(reg_nonzero) ptr_reg!(dst),
+                    old_hi = in(reg) old.pair.hi,
+                    old_lo = in(reg) old.pair.lo,
+                    tmp_hi = out(reg) _,
+                    tmp_lo = out(reg) r,
+                    // Quadword atomic instructions work with even/odd pair of specified register and subsequent register.
+                    // We cannot use r1 (sp) and r2 (system reserved), so start with r4 or grater.
+                    in("r6") new.pair.hi,
+                    in("r7") new.pair.lo,
+                    out("r8") prev_hi,
+                    out("r9") prev_lo,
+                    out("cr0") _,
+                    options(nostack, preserves_flags),
+                )
+            };
+        }
+        atomic_rmw!(cmpxchg_weak, order);
+        (U128 { pair: Pair { hi: prev_hi, lo: prev_lo } }.whole, extract_cr0(r))
+    }
+}
+
+#[cfg(any(
+    target_feature = "quadword-atomics",
+    portable_atomic_target_feature = "quadword-atomics",
+))]
+use atomic_swap_pwr8 as atomic_swap;
+// Do not use atomic_rmw_ll_sc_3 because it needs extra MR to implement swap.
+#[inline]
+unsafe fn atomic_swap_pwr8(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+    debug_assert!(dst as usize % 16 == 0);
+    debug_assert_pwr8!();
+
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        let val = U128 { whole: val };
+        let (mut prev_hi, mut prev_lo);
+        macro_rules! swap {
+            ($acquire:tt, $release:tt) => {
+                asm!(
+                    start_pwr8!(),
+                    $release,
+                    "2:",
+                        "lqarx %r6, 0, {dst}",
+                        "stqcx. %r8, 0, {dst}",
+                        "bne %cr0, 2b",
+                    $acquire,
+                    end_pwr8!(),
+                    dst = in(reg_nonzero) ptr_reg!(dst),
+                    // Quadword atomic instructions work with even/odd pair of specified register and subsequent register.
+                    // We cannot use r1 (sp) and r2 (system reserved), so start with r4 or grater.
+                    out("r6") prev_hi,
+                    out("r7") prev_lo,
+                    in("r8") val.pair.hi,
+                    in("r9") val.pair.lo,
+                    out("cr0") _,
+                    options(nostack, preserves_flags),
+                )
+            };
+        }
+        atomic_rmw!(swap, order);
+        U128 { pair: Pair { hi: prev_hi, lo: prev_lo } }.whole
+    }
+}
+
+/// Atomic RMW by LL/SC loop (3 arguments)
+/// `unsafe fn(dst: *mut u128, val: u128, order: Ordering) -> u128;`
+///
+/// $op can use the following registers:
+/// - val_hi/val_lo pair: val argument (read-only for `$op`)
+/// - r6/r7 pair: previous value loaded by ll (read-only for `$op`)
+/// - r8/r9 pair: new value that will be stored by sc
+macro_rules! atomic_rmw_ll_sc_3 {
+    ($name:ident as $reexport_name:ident, [$($reg:tt)*], $($op:tt)*) => {
+        #[cfg(any(
+            target_feature = "quadword-atomics",
+            portable_atomic_target_feature = "quadword-atomics",
+        ))]
+        use $name as $reexport_name;
+        #[inline]
+        unsafe fn $name(dst: *mut u128, val: u128, order: Ordering) -> u128 {
+            debug_assert!(dst as usize % 16 == 0);
+            debug_assert_pwr8!();
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe {
+                let val = U128 { whole: val };
+                let (mut prev_hi, mut prev_lo);
+                macro_rules! op {
+                    ($acquire:tt, $release:tt) => {
+                        asm!(
+                            start_pwr8!(),
+                            $release,
+                            "2:",
+                                "lqarx %r6, 0, {dst}",
+                                $($op)*
+                                "stqcx. %r8, 0, {dst}",
+                                "bne %cr0, 2b",
+                            $acquire,
+                            end_pwr8!(),
+                            dst = in(reg_nonzero) ptr_reg!(dst),
+                            val_hi = in(reg) val.pair.hi,
+                            val_lo = in(reg) val.pair.lo,
+                            $($reg)*
+                            // Quadword atomic instructions work with even/odd pair of specified register and subsequent register.
+                            // We cannot use r1 (sp) and r2 (system reserved), so start with r4 or grater.
+                            out("r6") prev_hi,
+                            out("r7") prev_lo,
+                            out("r8") _, // new (hi)
+                            out("r9") _, // new (lo)
+                            out("cr0") _,
+                            options(nostack, preserves_flags),
+                        )
+                    };
+                }
+                atomic_rmw!(op, order);
+                U128 { pair: Pair { hi: prev_hi, lo: prev_lo } }.whole
+            }
+        }
+    };
+}
+/// Atomic RMW by LL/SC loop (2 arguments)
+/// `unsafe fn(dst: *mut u128, order: Ordering) -> u128;`
+///
+/// $op can use the following registers:
+/// - r6/r7 pair: previous value loaded by ll (read-only for `$op`)
+/// - r8/r9 pair: new value that will be stored by sc
+macro_rules! atomic_rmw_ll_sc_2 {
+    ($name:ident as $reexport_name:ident, [$($reg:tt)*], $($op:tt)*) => {
+        #[cfg(any(
+            target_feature = "quadword-atomics",
+            portable_atomic_target_feature = "quadword-atomics",
+        ))]
+        use $name as $reexport_name;
+        #[inline]
+        unsafe fn $name(dst: *mut u128, order: Ordering) -> u128 {
+            debug_assert!(dst as usize % 16 == 0);
+            debug_assert_pwr8!();
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe {
+                let (mut prev_hi, mut prev_lo);
+                macro_rules! op {
+                    ($acquire:tt, $release:tt) => {
+                        asm!(
+                            start_pwr8!(),
+                            $release,
+                            "2:",
+                                "lqarx %r6, 0, {dst}",
+                                $($op)*
+                                "stqcx. %r8, 0, {dst}",
+                                "bne %cr0, 2b",
+                            $acquire,
+                            end_pwr8!(),
+                            dst = in(reg_nonzero) ptr_reg!(dst),
+                            $($reg)*
+                            // Quadword atomic instructions work with even/odd pair of specified register and subsequent register.
+                            // We cannot use r1 (sp) and r2 (system reserved), so start with r4 or grater.
+                            out("r6") prev_hi,
+                            out("r7") prev_lo,
+                            out("r8") _, // new (hi)
+                            out("r9") _, // new (lo)
+                            out("cr0") _,
+                            options(nostack, preserves_flags),
+                        )
+                    };
+                }
+                atomic_rmw!(op, order);
+                U128 { pair: Pair { hi: prev_hi, lo: prev_lo } }.whole
+            }
+        }
+    };
+}
+
+atomic_rmw_ll_sc_3! {
+    atomic_add_pwr8 as atomic_add, [out("xer") _,],
+    "addc %r9, {val_lo}, %r7",
+    "adde %r8, {val_hi}, %r6",
+}
+atomic_rmw_ll_sc_3! {
+    atomic_sub_pwr8 as atomic_sub, [out("xer") _,],
+    "subc %r9, %r7, {val_lo}",
+    "subfe %r8, {val_hi}, %r6",
+}
+atomic_rmw_ll_sc_3! {
+    atomic_and_pwr8 as atomic_and, [],
+    "and %r9, {val_lo}, %r7",
+    "and %r8, {val_hi}, %r6",
+}
+atomic_rmw_ll_sc_3! {
+    atomic_nand_pwr8 as atomic_nand, [],
+    "nand %r9, {val_lo}, %r7",
+    "nand %r8, {val_hi}, %r6",
+}
+atomic_rmw_ll_sc_3! {
+    atomic_or_pwr8 as atomic_or, [],
+    "or %r9, {val_lo}, %r7",
+    "or %r8, {val_hi}, %r6",
+}
+atomic_rmw_ll_sc_3! {
+    atomic_xor_pwr8 as atomic_xor, [],
+    "xor %r9, {val_lo}, %r7",
+    "xor %r8, {val_hi}, %r6",
+}
+atomic_rmw_ll_sc_3! {
+    atomic_max_pwr8 as atomic_max, [out("cr1") _,],
+    "cmpld %r7, {val_lo}",        // (unsigned) compare lo 64-bit, store result to cr0
+    "iselgt %r9, %r7, {val_lo}",  // select lo 64-bit based on GT bit in cr0
+    "cmpd %cr1, %r6, {val_hi}",   // (signed) compare hi 64-bit, store result to cr1
+    "isel %r8, %r7, {val_lo}, 5", // select lo 64-bit based on GT bit in cr1
+    "cmpld %r6, {val_hi}",        // (unsigned) compare hi 64-bit, store result to cr0
+    "iseleq %r9, %r9, %r8",       // select lo 64-bit based on EQ bit in cr0
+    "isel %r8, %r6, {val_hi}, 5", // select hi 64-bit based on GT bit in cr1
+}
+atomic_rmw_ll_sc_3! {
+    atomic_umax_pwr8 as atomic_umax, [],
+    "cmpld %r7, {val_lo}",       // compare lo 64-bit, store result to cr0
+    "iselgt %r9, %r7, {val_lo}", // select lo 64-bit based on GT bit in cr0
+    "cmpld %r6, {val_hi}",       // compare hi 64-bit, store result to cr0
+    "iselgt %r8, %r7, {val_lo}", // select lo 64-bit based on GT bit in cr0
+    "iseleq %r9, %r9, %r8",      // select lo 64-bit based on EQ bit in cr0
+    "iselgt %r8, %r6, {val_hi}", // select hi 64-bit based on GT bit in cr0
+}
+atomic_rmw_ll_sc_3! {
+    atomic_min_pwr8 as atomic_min, [out("cr1") _,],
+    "cmpld %r7, {val_lo}",        // (unsigned) compare lo 64-bit, store result to cr0
+    "isellt %r9, %r7, {val_lo}",  // select lo 64-bit based on LT bit in cr0
+    "cmpd %cr1, %r6, {val_hi}",   // (signed) compare hi 64-bit, store result to cr1
+    "isel %r8, %r7, {val_lo}, 4", // select lo 64-bit based on LT bit in cr1
+    "cmpld %r6, {val_hi}",        // (unsigned) compare hi 64-bit, store result to cr0
+    "iseleq %r9, %r9, %r8",       // select lo 64-bit based on EQ bit in cr0
+    "isel %r8, %r6, {val_hi}, 4", // select hi 64-bit based on LT bit in cr1
+}
+atomic_rmw_ll_sc_3! {
+    atomic_umin_pwr8 as atomic_umin, [],
+    "cmpld %r7, {val_lo}",       // compare lo 64-bit, store result to cr0
+    "isellt %r9, %r7, {val_lo}", // select lo 64-bit based on LT bit in cr0
+    "cmpld %r6, {val_hi}",       // compare hi 64-bit, store result to cr0
+    "isellt %r8, %r7, {val_lo}", // select lo 64-bit based on LT bit in cr0
+    "iseleq %r9, %r9, %r8",      // select lo 64-bit based on EQ bit in cr0
+    "isellt %r8, %r6, {val_hi}", // select hi 64-bit based on LT bit in cr0
+}
+
+#[cfg(any(
+    target_feature = "quadword-atomics",
+    portable_atomic_target_feature = "quadword-atomics",
+))]
+use atomic_not_pwr8 as atomic_not;
+#[inline]
+unsafe fn atomic_not_pwr8(dst: *mut u128, order: Ordering) -> u128 {
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe { atomic_xor_pwr8(dst, !0, order) }
+}
+
+#[cfg(portable_atomic_llvm_16)]
+atomic_rmw_ll_sc_2! {
+    atomic_neg_pwr8 as atomic_neg, [out("xer") _,],
+    "subfic %r9, %r7, 0",
+    "subfze %r8, %r6",
+}
+// LLVM 15 miscompiles subfic.
+#[cfg(not(portable_atomic_llvm_16))]
+atomic_rmw_ll_sc_2! {
+    atomic_neg_pwr8 as atomic_neg, [zero = in(reg) 0_u64, out("xer") _,],
+    "subc %r9, {zero}, %r7",
+    "subfze %r8, %r6",
+}
+
+macro_rules! atomic_rmw_with_ifunc {
+    (
+        unsafe fn $name:ident($($arg:tt)*) $(-> $ret_ty:ty)?;
+        pwr8 = $pwr8_fn:ident;
+        non_seqcst_fallback = $non_seqcst_fallback_fn:ident;
+        seqcst_fallback = $seqcst_fallback_fn:ident;
+    ) => {
+        #[cfg(not(any(
+            target_feature = "quadword-atomics",
+            portable_atomic_target_feature = "quadword-atomics",
+        )))]
+        #[inline]
+        unsafe fn $name($($arg)*, order: Ordering) $(-> $ret_ty)? {
+            fn_alias! {
+                // inline(never) is just a hint and also not strictly necessary
+                // because we use ifunc helper macro, but used for clarity.
+                #[inline(never)]
+                unsafe fn($($arg)*) $(-> $ret_ty)?;
+                pwr8_relaxed_fn = $pwr8_fn(Ordering::Relaxed);
+                pwr8_acquire_fn = $pwr8_fn(Ordering::Acquire);
+                pwr8_release_fn = $pwr8_fn(Ordering::Release);
+                pwr8_acqrel_fn = $pwr8_fn(Ordering::AcqRel);
+                pwr8_seqcst_fn = $pwr8_fn(Ordering::SeqCst);
+            }
+            // SAFETY: the caller must uphold the safety contract.
+            // we only calls pwr8_fn if quadword-atomics is available.
+            unsafe {
+                match order {
+                    Ordering::Relaxed => {
+                        ifunc!(unsafe fn($($arg)*) $(-> $ret_ty)? {
+                            if detect::detect().has_quadword_atomics() {
+                                pwr8_relaxed_fn
+                            } else {
+                                fallback::$non_seqcst_fallback_fn
+                            }
+                        })
+                    }
+                    Ordering::Acquire => {
+                        ifunc!(unsafe fn($($arg)*) $(-> $ret_ty)? {
+                            if detect::detect().has_quadword_atomics() {
+                                pwr8_acquire_fn
+                            } else {
+                                fallback::$non_seqcst_fallback_fn
+                            }
+                        })
+                    }
+                    Ordering::Release => {
+                        ifunc!(unsafe fn($($arg)*) $(-> $ret_ty)? {
+                            if detect::detect().has_quadword_atomics() {
+                                pwr8_release_fn
+                            } else {
+                                fallback::$non_seqcst_fallback_fn
+                            }
+                        })
+                    }
+                    Ordering::AcqRel => {
+                        ifunc!(unsafe fn($($arg)*) $(-> $ret_ty)? {
+                            if detect::detect().has_quadword_atomics() {
+                                pwr8_acqrel_fn
+                            } else {
+                                fallback::$non_seqcst_fallback_fn
+                            }
+                        })
+                    }
+                    Ordering::SeqCst => {
+                        ifunc!(unsafe fn($($arg)*) $(-> $ret_ty)? {
+                            if detect::detect().has_quadword_atomics() {
+                                pwr8_seqcst_fn
+                            } else {
+                                fallback::$seqcst_fallback_fn
+                            }
+                        })
+                    }
+                    _ => unreachable!(),
+                }
+            }
+        }
+    };
+}
+
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_compare_exchange_ifunc(dst: *mut u128, old: u128, new: u128) -> (u128, bool);
+    pwr8 = atomic_compare_exchange_pwr8;
+    non_seqcst_fallback = atomic_compare_exchange_non_seqcst;
+    seqcst_fallback = atomic_compare_exchange_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_swap(dst: *mut u128, val: u128) -> u128;
+    pwr8 = atomic_swap_pwr8;
+    non_seqcst_fallback = atomic_swap_non_seqcst;
+    seqcst_fallback = atomic_swap_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_add(dst: *mut u128, val: u128) -> u128;
+    pwr8 = atomic_add_pwr8;
+    non_seqcst_fallback = atomic_add_non_seqcst;
+    seqcst_fallback = atomic_add_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_sub(dst: *mut u128, val: u128) -> u128;
+    pwr8 = atomic_sub_pwr8;
+    non_seqcst_fallback = atomic_sub_non_seqcst;
+    seqcst_fallback = atomic_sub_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_and(dst: *mut u128, val: u128) -> u128;
+    pwr8 = atomic_and_pwr8;
+    non_seqcst_fallback = atomic_and_non_seqcst;
+    seqcst_fallback = atomic_and_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_nand(dst: *mut u128, val: u128) -> u128;
+    pwr8 = atomic_nand_pwr8;
+    non_seqcst_fallback = atomic_nand_non_seqcst;
+    seqcst_fallback = atomic_nand_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_or(dst: *mut u128, val: u128) -> u128;
+    pwr8 = atomic_or_pwr8;
+    non_seqcst_fallback = atomic_or_non_seqcst;
+    seqcst_fallback = atomic_or_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_xor(dst: *mut u128, val: u128) -> u128;
+    pwr8 = atomic_xor_pwr8;
+    non_seqcst_fallback = atomic_xor_non_seqcst;
+    seqcst_fallback = atomic_xor_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_max(dst: *mut u128, val: u128) -> u128;
+    pwr8 = atomic_max_pwr8;
+    non_seqcst_fallback = atomic_max_non_seqcst;
+    seqcst_fallback = atomic_max_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_umax(dst: *mut u128, val: u128) -> u128;
+    pwr8 = atomic_umax_pwr8;
+    non_seqcst_fallback = atomic_umax_non_seqcst;
+    seqcst_fallback = atomic_umax_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_min(dst: *mut u128, val: u128) -> u128;
+    pwr8 = atomic_min_pwr8;
+    non_seqcst_fallback = atomic_min_non_seqcst;
+    seqcst_fallback = atomic_min_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_umin(dst: *mut u128, val: u128) -> u128;
+    pwr8 = atomic_umin_pwr8;
+    non_seqcst_fallback = atomic_umin_non_seqcst;
+    seqcst_fallback = atomic_umin_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_not(dst: *mut u128) -> u128;
+    pwr8 = atomic_not_pwr8;
+    non_seqcst_fallback = atomic_not_non_seqcst;
+    seqcst_fallback = atomic_not_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_neg(dst: *mut u128) -> u128;
+    pwr8 = atomic_neg_pwr8;
+    non_seqcst_fallback = atomic_neg_non_seqcst;
+    seqcst_fallback = atomic_neg_seqcst;
+}
+
+#[inline]
+fn is_lock_free() -> bool {
+    #[cfg(any(
+        target_feature = "quadword-atomics",
+        portable_atomic_target_feature = "quadword-atomics",
+    ))]
+    {
+        // lqarx and stqcx. instructions are statically available.
+        true
+    }
+    #[cfg(not(any(
+        target_feature = "quadword-atomics",
+        portable_atomic_target_feature = "quadword-atomics",
+    )))]
+    {
+        detect::detect().has_quadword_atomics()
+    }
+}
+const IS_ALWAYS_LOCK_FREE: bool = cfg!(any(
+    target_feature = "quadword-atomics",
+    portable_atomic_target_feature = "quadword-atomics",
+));
+
+atomic128!(AtomicI128, i128, atomic_max, atomic_min);
+atomic128!(AtomicU128, u128, atomic_umax, atomic_umin);
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    test_atomic_int!(i128);
+    test_atomic_int!(u128);
+
+    // load/store/swap implementation is not affected by signedness, so it is
+    // enough to test only unsigned types.
+    stress_test!(u128);
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/s390x.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/s390x.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/s390x.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/s390x.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,462 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Atomic{I,U}128 implementation on s390x.
+//
+// s390x has 128-bit atomic load/store/CAS instructions and other operations are emulated by CAS loop.
+// https://github.com/llvm/llvm-project/commit/a11f63a952664f700f076fd754476a2b9eb158cc
+// https://github.com/llvm/llvm-project/commit/c568927f3e2e7d9804ea74ecbf11c16c014ddcbc
+//
+// LLVM's minimal supported architecture level is z10:
+// https://github.com/llvm/llvm-project/blob/llvmorg-18.1.2/llvm/lib/Target/SystemZ/SystemZProcessors.td)
+// This does not appear to have changed since the current s390x backend was added in LLVM 3.3:
+// https://github.com/llvm/llvm-project/commit/5f613dfd1f7edb0ae95d521b7107b582d9df5103#diff-cbaef692b3958312e80fd5507a7e2aff071f1acb086f10e8a96bc06a7bb289db
+//
+// Note: On Miri and ThreadSanitizer which do not support inline assembly, we don't use
+// this module and use intrinsics.rs instead.
+//
+// Refs:
+// - z/Architecture Principles of Operation https://publibfp.dhe.ibm.com/epubs/pdf/a227832d.pdf
+// - z/Architecture Reference Summary https://www.ibm.com/support/pages/zarchitecture-reference-summary
+// - atomic-maybe-uninit https://github.com/taiki-e/atomic-maybe-uninit
+//
+// Generated asm:
+// - s390x https://godbolt.org/z/sbvhjKrMT
+// - s390x (z196) https://godbolt.org/z/Erbqazhv7
+// - s390x (z15) https://godbolt.org/z/GEaePbbsT
+
+include!("macros.rs");
+
+use core::{arch::asm, sync::atomic::Ordering};
+
+use crate::utils::{Pair, U128};
+
+// Use distinct operands on z196 or later, otherwise split to lgr and $op.
+#[cfg(any(target_feature = "distinct-ops", portable_atomic_target_feature = "distinct-ops"))]
+macro_rules! distinct_op {
+    ($op:tt, $a0:tt, $a1:tt, $a2:tt) => {
+        concat!($op, "k ", $a0, ", ", $a1, ", ", $a2)
+    };
+}
+#[cfg(not(any(target_feature = "distinct-ops", portable_atomic_target_feature = "distinct-ops")))]
+macro_rules! distinct_op {
+    ($op:tt, $a0:tt, $a1:tt, $a2:tt) => {
+        concat!("lgr ", $a0, ", ", $a1, "\n", $op, " ", $a0, ", ", $a2)
+    };
+}
+
+// Use selgr$cond on z15 or later, otherwise split to locgr$cond and $op.
+#[cfg(any(
+    target_feature = "miscellaneous-extensions-3",
+    portable_atomic_target_feature = "miscellaneous-extensions-3",
+))]
+#[cfg(any(
+    target_feature = "load-store-on-cond",
+    portable_atomic_target_feature = "load-store-on-cond",
+))]
+macro_rules! select_op {
+    ($cond:tt, $a0:tt, $a1:tt, $a2:tt) => {
+        concat!("selgr", $cond, " ", $a0, ", ", $a1, ", ", $a2)
+    };
+}
+#[cfg(not(any(
+    target_feature = "miscellaneous-extensions-3",
+    portable_atomic_target_feature = "miscellaneous-extensions-3",
+)))]
+#[cfg(any(
+    target_feature = "load-store-on-cond",
+    portable_atomic_target_feature = "load-store-on-cond",
+))]
+macro_rules! select_op {
+    ($cond:tt, $a0:tt, $a1:tt, $a2:tt) => {
+        concat!("lgr ", $a0, ", ", $a2, "\n", "locgr", $cond, " ", $a0, ", ", $a1)
+    };
+}
+
+#[inline]
+unsafe fn atomic_load(src: *mut u128, _order: Ordering) -> u128 {
+    debug_assert!(src as usize % 16 == 0);
+
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        // atomic load is always SeqCst.
+        let (out_hi, out_lo);
+        asm!(
+            "lpq %r0, 0({src})",
+            src = in(reg) ptr_reg!(src),
+            // Quadword atomic instructions work with even/odd pair of specified register and subsequent register.
+            out("r0") out_hi,
+            out("r1") out_lo,
+            options(nostack, preserves_flags),
+        );
+        U128 { pair: Pair { hi: out_hi, lo: out_lo } }.whole
+    }
+}
+
+#[inline]
+unsafe fn atomic_store(dst: *mut u128, val: u128, order: Ordering) {
+    debug_assert!(dst as usize % 16 == 0);
+
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        let val = U128 { whole: val };
+        macro_rules! atomic_store {
+            ($fence:tt) => {
+                asm!(
+                    "stpq %r0, 0({dst})",
+                    $fence,
+                    dst = in(reg) ptr_reg!(dst),
+                    // Quadword atomic instructions work with even/odd pair of specified register and subsequent register.
+                    in("r0") val.pair.hi,
+                    in("r1") val.pair.lo,
+                    options(nostack, preserves_flags),
+                )
+            };
+        }
+        match order {
+            // Relaxed and Release stores are equivalent.
+            Ordering::Relaxed | Ordering::Release => atomic_store!(""),
+            // bcr 14,0 (fast-BCR-serialization) requires z196 or later.
+            #[cfg(any(
+                target_feature = "fast-serialization",
+                portable_atomic_target_feature = "fast-serialization",
+            ))]
+            Ordering::SeqCst => atomic_store!("bcr 14, 0"),
+            #[cfg(not(any(
+                target_feature = "fast-serialization",
+                portable_atomic_target_feature = "fast-serialization",
+            )))]
+            Ordering::SeqCst => atomic_store!("bcr 15, 0"),
+            _ => unreachable!(),
+        }
+    }
+}
+
+#[inline]
+unsafe fn atomic_compare_exchange(
+    dst: *mut u128,
+    old: u128,
+    new: u128,
+    _success: Ordering,
+    _failure: Ordering,
+) -> Result<u128, u128> {
+    debug_assert!(dst as usize % 16 == 0);
+
+    // SAFETY: the caller must uphold the safety contract.
+    let prev = unsafe {
+        // atomic CAS is always SeqCst.
+        let old = U128 { whole: old };
+        let new = U128 { whole: new };
+        let (prev_hi, prev_lo);
+        asm!(
+            "cdsg %r0, %r12, 0({dst})",
+            dst = in(reg) ptr_reg!(dst),
+            // Quadword atomic instructions work with even/odd pair of specified register and subsequent register.
+            inout("r0") old.pair.hi => prev_hi,
+            inout("r1") old.pair.lo => prev_lo,
+            in("r12") new.pair.hi,
+            in("r13") new.pair.lo,
+            // Do not use `preserves_flags` because CDSG modifies the condition code.
+            options(nostack),
+        );
+        U128 { pair: Pair { hi: prev_hi, lo: prev_lo } }.whole
+    };
+    if prev == old {
+        Ok(prev)
+    } else {
+        Err(prev)
+    }
+}
+
+// cdsg is always strong.
+use atomic_compare_exchange as atomic_compare_exchange_weak;
+
+#[cfg(not(any(
+    target_feature = "load-store-on-cond",
+    portable_atomic_target_feature = "load-store-on-cond",
+)))]
+#[inline(always)]
+unsafe fn atomic_update<F>(dst: *mut u128, order: Ordering, mut f: F) -> u128
+where
+    F: FnMut(u128) -> u128,
+{
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        // This is a private function and all instances of `f` only operate on the value
+        // loaded, so there is no need to synchronize the first load/failed CAS.
+        let mut prev = atomic_load(dst, Ordering::Relaxed);
+        loop {
+            let next = f(prev);
+            match atomic_compare_exchange_weak(dst, prev, next, order, Ordering::Relaxed) {
+                Ok(x) => return x,
+                Err(x) => prev = x,
+            }
+        }
+    }
+}
+
+#[inline]
+unsafe fn atomic_swap(dst: *mut u128, val: u128, _order: Ordering) -> u128 {
+    debug_assert!(dst as usize % 16 == 0);
+
+    // SAFETY: the caller must uphold the safety contract.
+    //
+    // We could use atomic_update here, but using an inline assembly allows omitting
+    // the comparison of results and the storing/comparing of condition flags.
+    //
+    // Do not use atomic_rmw_cas_3 because it needs extra LGR to implement swap.
+    unsafe {
+        // atomic swap is always SeqCst.
+        let val = U128 { whole: val };
+        let (mut prev_hi, mut prev_lo);
+        asm!(
+            "lpq %r0, 0({dst})",
+            "2:",
+                "cdsg %r0, %r12, 0({dst})",
+                "jl 2b",
+            dst = in(reg) ptr_reg!(dst),
+            // Quadword atomic instructions work with even/odd pair of specified register and subsequent register.
+            out("r0") prev_hi,
+            out("r1") prev_lo,
+            in("r12") val.pair.hi,
+            in("r13") val.pair.lo,
+            // Do not use `preserves_flags` because CDSG modifies the condition code.
+            options(nostack),
+        );
+        U128 { pair: Pair { hi: prev_hi, lo: prev_lo } }.whole
+    }
+}
+
+/// Atomic RMW by CAS loop (3 arguments)
+/// `unsafe fn(dst: *mut u128, val: u128, order: Ordering) -> u128;`
+///
+/// `$op` can use the following registers:
+/// - val_hi/val_lo pair: val argument (read-only for `$op`)
+/// - r0/r1 pair: previous value loaded (read-only for `$op`)
+/// - r12/r13 pair: new value that will be stored
+// We could use atomic_update here, but using an inline assembly allows omitting
+// the comparison of results and the storing/comparing of condition flags.
+macro_rules! atomic_rmw_cas_3 {
+    ($name:ident, [$($reg:tt)*], $($op:tt)*) => {
+        #[inline]
+        unsafe fn $name(dst: *mut u128, val: u128, _order: Ordering) -> u128 {
+            debug_assert!(dst as usize % 16 == 0);
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe {
+                // atomic RMW is always SeqCst.
+                let val = U128 { whole: val };
+                let (mut prev_hi, mut prev_lo);
+                asm!(
+                    "lpq %r0, 0({dst})",
+                    "2:",
+                        $($op)*
+                        "cdsg %r0, %r12, 0({dst})",
+                        "jl 2b",
+                    dst = in(reg) ptr_reg!(dst),
+                    val_hi = in(reg) val.pair.hi,
+                    val_lo = in(reg) val.pair.lo,
+                    $($reg)*
+                    // Quadword atomic instructions work with even/odd pair of specified register and subsequent register.
+                    out("r0") prev_hi,
+                    out("r1") prev_lo,
+                    out("r12") _,
+                    out("r13") _,
+                    // Do not use `preserves_flags` because CDSG modifies the condition code.
+                    options(nostack),
+                );
+                U128 { pair: Pair { hi: prev_hi, lo: prev_lo } }.whole
+            }
+        }
+    };
+}
+/// Atomic RMW by CAS loop (2 arguments)
+/// `unsafe fn(dst: *mut u128, order: Ordering) -> u128;`
+///
+/// `$op` can use the following registers:
+/// - r0/r1 pair: previous value loaded (read-only for `$op`)
+/// - r12/r13 pair: new value that will be stored
+// We could use atomic_update here, but using an inline assembly allows omitting
+// the comparison of results and the storing/comparing of condition flags.
+macro_rules! atomic_rmw_cas_2 {
+    ($name:ident, $($op:tt)*) => {
+        #[inline]
+        unsafe fn $name(dst: *mut u128, _order: Ordering) -> u128 {
+            debug_assert!(dst as usize % 16 == 0);
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe {
+                // atomic RMW is always SeqCst.
+                let (mut prev_hi, mut prev_lo);
+                asm!(
+                    "lpq %r0, 0({dst})",
+                    "2:",
+                        $($op)*
+                        "cdsg %r0, %r12, 0({dst})",
+                        "jl 2b",
+                    dst = in(reg) ptr_reg!(dst),
+                    // Quadword atomic instructions work with even/odd pair of specified register and subsequent register.
+                    out("r0") prev_hi,
+                    out("r1") prev_lo,
+                    out("r12") _,
+                    out("r13") _,
+                    // Do not use `preserves_flags` because CDSG modifies the condition code.
+                    options(nostack),
+                );
+                U128 { pair: Pair { hi: prev_hi, lo: prev_lo } }.whole
+            }
+        }
+    };
+}
+
+atomic_rmw_cas_3! {
+    atomic_add, [],
+    distinct_op!("algr", "%r13", "%r1", "{val_lo}"),
+    "lgr %r12, %r0",
+    "alcgr %r12, {val_hi}",
+}
+atomic_rmw_cas_3! {
+    atomic_sub, [],
+    distinct_op!("slgr", "%r13", "%r1", "{val_lo}"),
+    "lgr %r12, %r0",
+    "slbgr %r12, {val_hi}",
+}
+atomic_rmw_cas_3! {
+    atomic_and, [],
+    distinct_op!("ngr", "%r13", "%r1", "{val_lo}"),
+    distinct_op!("ngr", "%r12", "%r0", "{val_hi}"),
+}
+
+// Use nngrk on z15 or later.
+#[cfg(any(
+    target_feature = "miscellaneous-extensions-3",
+    portable_atomic_target_feature = "miscellaneous-extensions-3",
+))]
+atomic_rmw_cas_3! {
+    atomic_nand, [],
+    "nngrk %r13, %r1, {val_lo}",
+    "nngrk %r12, %r0, {val_hi}",
+}
+#[cfg(not(any(
+    target_feature = "miscellaneous-extensions-3",
+    portable_atomic_target_feature = "miscellaneous-extensions-3",
+)))]
+atomic_rmw_cas_3! {
+    atomic_nand, [],
+    distinct_op!("ngr", "%r13", "%r1", "{val_lo}"),
+    "xihf %r13, 4294967295",
+    "xilf %r13, 4294967295",
+    distinct_op!("ngr", "%r12", "%r0", "{val_hi}"),
+    "xihf %r12, 4294967295",
+    "xilf %r12, 4294967295",
+}
+
+atomic_rmw_cas_3! {
+    atomic_or, [],
+    distinct_op!("ogr", "%r13", "%r1", "{val_lo}"),
+    distinct_op!("ogr", "%r12", "%r0", "{val_hi}"),
+}
+atomic_rmw_cas_3! {
+    atomic_xor, [],
+    distinct_op!("xgr", "%r13", "%r1", "{val_lo}"),
+    distinct_op!("xgr", "%r12", "%r0", "{val_hi}"),
+}
+
+#[cfg(any(
+    target_feature = "load-store-on-cond",
+    portable_atomic_target_feature = "load-store-on-cond",
+))]
+atomic_rmw_cas_3! {
+    atomic_max, [],
+    "clgr %r1, {val_lo}",
+    select_op!("h", "%r12", "%r1", "{val_lo}"),
+    "cgr %r0, {val_hi}",
+    select_op!("h", "%r13", "%r1", "{val_lo}"),
+    "locgre %r13, %r12",
+    select_op!("h", "%r12", "%r0", "{val_hi}"),
+}
+#[cfg(any(
+    target_feature = "load-store-on-cond",
+    portable_atomic_target_feature = "load-store-on-cond",
+))]
+atomic_rmw_cas_3! {
+    atomic_umax, [tmp = out(reg) _,],
+    "clgr %r1, {val_lo}",
+    select_op!("h", "{tmp}", "%r1", "{val_lo}"),
+    "clgr %r0, {val_hi}",
+    select_op!("h", "%r12", "%r0", "{val_hi}"),
+    select_op!("h", "%r13", "%r1", "{val_lo}"),
+    "cgr %r0, {val_hi}",
+    "locgre %r13, {tmp}",
+}
+#[cfg(any(
+    target_feature = "load-store-on-cond",
+    portable_atomic_target_feature = "load-store-on-cond",
+))]
+atomic_rmw_cas_3! {
+    atomic_min, [],
+    "clgr %r1, {val_lo}",
+    select_op!("l", "%r12", "%r1", "{val_lo}"),
+    "cgr %r0, {val_hi}",
+    select_op!("l", "%r13", "%r1", "{val_lo}"),
+    "locgre %r13, %r12",
+    select_op!("l", "%r12", "%r0", "{val_hi}"),
+}
+#[cfg(any(
+    target_feature = "load-store-on-cond",
+    portable_atomic_target_feature = "load-store-on-cond",
+))]
+atomic_rmw_cas_3! {
+    atomic_umin, [tmp = out(reg) _,],
+    "clgr %r1, {val_lo}",
+    select_op!("l", "{tmp}", "%r1", "{val_lo}"),
+    "clgr %r0, {val_hi}",
+    select_op!("l", "%r12", "%r0", "{val_hi}"),
+    select_op!("l", "%r13", "%r1", "{val_lo}"),
+    "cgr %r0, {val_hi}",
+    "locgre %r13, {tmp}",
+}
+// We use atomic_update for atomic min/max on pre-z196 because
+// z10 doesn't seem to have a good way to implement 128-bit min/max.
+// loc{,g}r requires z196 or later.
+// https://godbolt.org/z/EqoMEP8b3
+#[cfg(not(any(
+    target_feature = "load-store-on-cond",
+    portable_atomic_target_feature = "load-store-on-cond",
+)))]
+atomic_rmw_by_atomic_update!(cmp);
+
+atomic_rmw_cas_2! {
+    atomic_not,
+    "lgr %r13, %r1",
+    "xihf %r13, 4294967295",
+    "xilf %r13, 4294967295",
+    "lgr %r12, %r0",
+    "xihf %r12, 4294967295",
+    "xilf %r12, 4294967295",
+}
+atomic_rmw_cas_2! {
+    atomic_neg,
+    "lghi %r13, 0",
+    "slgr %r13, %r1",
+    "lghi %r12, 0",
+    "slbgr %r12, %r0",
+}
+
+#[inline]
+const fn is_lock_free() -> bool {
+    IS_ALWAYS_LOCK_FREE
+}
+const IS_ALWAYS_LOCK_FREE: bool = true;
+
+atomic128!(AtomicI128, i128, atomic_max, atomic_min);
+atomic128!(AtomicU128, u128, atomic_umax, atomic_umin);
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    test_atomic_int!(i128);
+    test_atomic_int!(u128);
+
+    // load/store/swap implementation is not affected by signedness, so it is
+    // enough to test only unsigned types.
+    stress_test!(u128);
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/x86_64.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/x86_64.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/atomic128/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/atomic128/x86_64.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,876 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Atomic{I,U}128 implementation on x86_64 using CMPXCHG16B (DWCAS).
+//
+// Note: On Miri and ThreadSanitizer which do not support inline assembly, we don't use
+// this module and use intrinsics.rs instead.
+//
+// Refs:
+// - x86 and amd64 instruction reference https://www.felixcloutier.com/x86
+// - atomic-maybe-uninit https://github.com/taiki-e/atomic-maybe-uninit
+//
+// Generated asm:
+// - x86_64 (+cmpxchg16b) https://godbolt.org/z/r5x9M8PdK
+
+// TODO: use core::arch::x86_64::cmpxchg16b where available and efficient than asm
+
+include!("macros.rs");
+
+#[cfg(not(any(target_feature = "cmpxchg16b", portable_atomic_target_feature = "cmpxchg16b")))]
+#[path = "../fallback/outline_atomics.rs"]
+mod fallback;
+
+#[cfg(not(portable_atomic_no_outline_atomics))]
+#[cfg(not(target_env = "sgx"))]
+#[cfg_attr(not(target_feature = "sse"), cfg(not(target_feature = "cmpxchg16b")))]
+#[path = "detect/x86_64.rs"]
+mod detect;
+
+#[cfg(not(portable_atomic_no_asm))]
+use core::arch::asm;
+use core::sync::atomic::Ordering;
+
+use crate::utils::{Pair, U128};
+
+// Asserts that the function is called in the correct context.
+macro_rules! debug_assert_cmpxchg16b {
+    () => {
+        #[cfg(not(any(
+            target_feature = "cmpxchg16b",
+            portable_atomic_target_feature = "cmpxchg16b",
+        )))]
+        {
+            debug_assert!(detect::detect().has_cmpxchg16b());
+        }
+    };
+}
+#[cfg(not(any(portable_atomic_no_outline_atomics, target_env = "sgx")))]
+#[cfg(target_feature = "sse")]
+macro_rules! debug_assert_vmovdqa_atomic {
+    () => {{
+        debug_assert_cmpxchg16b!();
+        debug_assert!(detect::detect().has_vmovdqa_atomic());
+    }};
+}
+
+#[cfg(not(any(portable_atomic_no_outline_atomics, target_env = "sgx")))]
+#[cfg(target_feature = "sse")]
+#[cfg(target_pointer_width = "32")]
+macro_rules! ptr_modifier {
+    () => {
+        ":e"
+    };
+}
+#[cfg(not(any(portable_atomic_no_outline_atomics, target_env = "sgx")))]
+#[cfg(target_feature = "sse")]
+#[cfg(target_pointer_width = "64")]
+macro_rules! ptr_modifier {
+    () => {
+        ""
+    };
+}
+
+// Unlike AArch64 and RISC-V, x86's assembler doesn't check instruction
+// requirements for the currently enabled target features. In the first place,
+// there is no option in the x86 assembly for such case, like ARM .arch_extension,
+// RISC-V .option arch, PowerPC .machine, etc.
+// However, we set target_feature(enable) when available (Rust 1.69+) in case a
+// new codegen backend is added that checks for it in the future, or an option
+// is added to the assembler to check for it.
+#[cfg_attr(
+    not(portable_atomic_no_cmpxchg16b_target_feature),
+    target_feature(enable = "cmpxchg16b")
+)]
+#[inline]
+unsafe fn cmpxchg16b(dst: *mut u128, old: u128, new: u128) -> (u128, bool) {
+    debug_assert!(dst as usize % 16 == 0);
+    debug_assert_cmpxchg16b!();
+
+    // SAFETY: the caller must guarantee that `dst` is valid for both writes and
+    // reads, 16-byte aligned (required by CMPXCHG16B), that there are no
+    // concurrent non-atomic operations, and that the CPU supports CMPXCHG16B.
+    //
+    // If the value at `dst` (destination operand) and rdx:rax are equal, the
+    // 128-bit value in rcx:rbx is stored in the `dst`, otherwise the value at
+    // `dst` is loaded to rdx:rax.
+    //
+    // The ZF flag is set if the value at `dst` and rdx:rax are equal,
+    // otherwise it is cleared. Other flags are unaffected.
+    //
+    // Refs: https://www.felixcloutier.com/x86/cmpxchg8b:cmpxchg16b
+    unsafe {
+        // cmpxchg16b is always SeqCst.
+        let r: u8;
+        let old = U128 { whole: old };
+        let new = U128 { whole: new };
+        let (prev_lo, prev_hi);
+        macro_rules! cmpxchg16b {
+            ($rdi:tt) => {
+                asm!(
+                    "xchg {rbx_tmp}, rbx", // save rbx which is reserved by LLVM
+                    concat!("lock cmpxchg16b xmmword ptr [", $rdi, "]"),
+                    "sete cl",
+                    "mov rbx, {rbx_tmp}", // restore rbx
+                    rbx_tmp = inout(reg) new.pair.lo => _,
+                    in("rcx") new.pair.hi,
+                    inout("rax") old.pair.lo => prev_lo,
+                    inout("rdx") old.pair.hi => prev_hi,
+                    in($rdi) dst,
+                    lateout("cl") r,
+                    // Do not use `preserves_flags` because CMPXCHG16B modifies the ZF flag.
+                    options(nostack),
+                )
+            };
+        }
+        #[cfg(target_pointer_width = "32")]
+        cmpxchg16b!("edi");
+        #[cfg(target_pointer_width = "64")]
+        cmpxchg16b!("rdi");
+        crate::utils::assert_unchecked(r == 0 || r == 1); // needed to remove extra test
+        (U128 { pair: Pair { lo: prev_lo, hi: prev_hi } }.whole, r != 0)
+    }
+}
+
+// VMOVDQA is atomic on Intel, AMD, and Zhaoxin CPUs with AVX.
+// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104688 for details.
+//
+// Refs: https://www.felixcloutier.com/x86/movdqa:vmovdqa32:vmovdqa64
+//
+// Use cfg(target_feature = "sse") here -- SSE is included in the x86_64
+// baseline and is always available, but the SSE target feature is disabled for
+// use cases such as kernels and firmware that should not use vector registers.
+// So, do not use vector registers unless SSE target feature is enabled.
+// See also https://github.com/rust-lang/rust/blob/1.77.0/src/doc/rustc/src/platform-support/x86_64-unknown-none.md.
+#[cfg(not(any(portable_atomic_no_outline_atomics, target_env = "sgx")))]
+#[cfg(target_feature = "sse")]
+#[target_feature(enable = "avx")]
+#[inline]
+unsafe fn atomic_load_vmovdqa(src: *mut u128) -> u128 {
+    debug_assert!(src as usize % 16 == 0);
+    debug_assert_vmovdqa_atomic!();
+
+    // SAFETY: the caller must uphold the safety contract.
+    //
+    // atomic load by vmovdqa is always SeqCst.
+    unsafe {
+        let out: core::arch::x86_64::__m128i;
+        asm!(
+            concat!("vmovdqa {out}, xmmword ptr [{src", ptr_modifier!(), "}]"),
+            src = in(reg) src,
+            out = out(xmm_reg) out,
+            options(nostack, preserves_flags),
+        );
+        core::mem::transmute(out)
+    }
+}
+#[cfg(not(any(portable_atomic_no_outline_atomics, target_env = "sgx")))]
+#[cfg(target_feature = "sse")]
+#[target_feature(enable = "avx")]
+#[inline]
+unsafe fn atomic_store_vmovdqa(dst: *mut u128, val: u128, order: Ordering) {
+    debug_assert!(dst as usize % 16 == 0);
+    debug_assert_vmovdqa_atomic!();
+
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        let val: core::arch::x86_64::__m128i = core::mem::transmute(val);
+        match order {
+            // Relaxed and Release stores are equivalent.
+            Ordering::Relaxed | Ordering::Release => {
+                asm!(
+                    concat!("vmovdqa xmmword ptr [{dst", ptr_modifier!(), "}], {val}"),
+                    dst = in(reg) dst,
+                    val = in(xmm_reg) val,
+                    options(nostack, preserves_flags),
+                );
+            }
+            Ordering::SeqCst => {
+                let p = core::cell::UnsafeCell::new(core::mem::MaybeUninit::<u64>::uninit());
+                asm!(
+                    concat!("vmovdqa xmmword ptr [{dst", ptr_modifier!(), "}], {val}"),
+                    // Equivalent to mfence, but is up to 3.1x faster on Coffee Lake and up to 2.4x faster on Raptor Lake-H at least in simple cases.
+                    // - https://github.com/taiki-e/portable-atomic/pull/156
+                    // - LLVM uses lock or for x86_32 64-bit atomic SeqCst store using SSE https://godbolt.org/z/9sKEr8YWc
+                    // - Windows uses xchg for x86_32 for MemoryBarrier https://learn.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-memorybarrier
+                    // - MSVC STL uses lock inc https://github.com/microsoft/STL/pull/740
+                    // - boost uses lock or https://github.com/boostorg/atomic/commit/559eba81af71386cedd99f170dc6101c6ad7bf22
+                    concat!("xchg qword ptr [{p", ptr_modifier!(), "}], {tmp}"),
+                    dst = in(reg) dst,
+                    val = in(xmm_reg) val,
+                    p = inout(reg) p.get() => _,
+                    tmp = lateout(reg) _,
+                    options(nostack, preserves_flags),
+                );
+            }
+            _ => unreachable!(),
+        }
+    }
+}
+
+#[cfg(not(all(
+    any(target_feature = "cmpxchg16b", portable_atomic_target_feature = "cmpxchg16b"),
+    any(portable_atomic_no_outline_atomics, target_env = "sgx", not(target_feature = "sse")),
+)))]
+macro_rules! load_store_detect {
+    (
+        vmovdqa = $vmovdqa:ident
+        cmpxchg16b = $cmpxchg16b:ident
+        fallback = $fallback:ident
+    ) => {{
+        let cpuid = detect::detect();
+        #[cfg(not(any(
+            target_feature = "cmpxchg16b",
+            portable_atomic_target_feature = "cmpxchg16b",
+        )))]
+        {
+            // Check CMPXCHG16B first to prevent mixing atomic and non-atomic access.
+            if cpuid.has_cmpxchg16b() {
+                // We only use VMOVDQA when SSE is enabled. See atomic_load_vmovdqa() for more.
+                #[cfg(target_feature = "sse")]
+                {
+                    if cpuid.has_vmovdqa_atomic() {
+                        $vmovdqa
+                    } else {
+                        $cmpxchg16b
+                    }
+                }
+                #[cfg(not(target_feature = "sse"))]
+                {
+                    $cmpxchg16b
+                }
+            } else {
+                fallback::$fallback
+            }
+        }
+        #[cfg(any(target_feature = "cmpxchg16b", portable_atomic_target_feature = "cmpxchg16b"))]
+        {
+            if cpuid.has_vmovdqa_atomic() {
+                $vmovdqa
+            } else {
+                $cmpxchg16b
+            }
+        }
+    }};
+}
+
+#[inline]
+unsafe fn atomic_load(src: *mut u128, _order: Ordering) -> u128 {
+    // We only use VMOVDQA when SSE is enabled. See atomic_load_vmovdqa() for more.
+    // SGX doesn't support CPUID.
+    #[cfg(all(
+        any(target_feature = "cmpxchg16b", portable_atomic_target_feature = "cmpxchg16b"),
+        any(portable_atomic_no_outline_atomics, target_env = "sgx", not(target_feature = "sse")),
+    ))]
+    // SAFETY: the caller must uphold the safety contract.
+    // cfg guarantees that CMPXCHG16B is available at compile-time.
+    unsafe {
+        // cmpxchg16b is always SeqCst.
+        atomic_load_cmpxchg16b(src)
+    }
+    #[cfg(not(all(
+        any(target_feature = "cmpxchg16b", portable_atomic_target_feature = "cmpxchg16b"),
+        any(portable_atomic_no_outline_atomics, target_env = "sgx", not(target_feature = "sse")),
+    )))]
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        ifunc!(unsafe fn(src: *mut u128) -> u128 {
+            load_store_detect! {
+                vmovdqa = atomic_load_vmovdqa
+                cmpxchg16b = atomic_load_cmpxchg16b
+                // Use SeqCst because cmpxchg16b and atomic load by vmovdqa is always SeqCst.
+                fallback = atomic_load_seqcst
+            }
+        })
+    }
+}
+// See cmpxchg16b() for target_feature(enable).
+#[cfg_attr(
+    not(portable_atomic_no_cmpxchg16b_target_feature),
+    target_feature(enable = "cmpxchg16b")
+)]
+#[inline]
+unsafe fn atomic_load_cmpxchg16b(src: *mut u128) -> u128 {
+    debug_assert!(src as usize % 16 == 0);
+    debug_assert_cmpxchg16b!();
+
+    // SAFETY: the caller must guarantee that `src` is valid for both writes and
+    // reads, 16-byte aligned, and that there are no concurrent non-atomic operations.
+    // cfg guarantees that the CPU supports CMPXCHG16B.
+    //
+    // See cmpxchg16b function for more.
+    //
+    // We could use CAS loop by atomic_compare_exchange here, but using an inline assembly allows
+    // omitting the storing of condition flags and avoid use of xchg to handle rbx.
+    unsafe {
+        // cmpxchg16b is always SeqCst.
+        let (out_lo, out_hi);
+        macro_rules! cmpxchg16b {
+            ($rdi:tt) => {
+                asm!(
+                    "mov {rbx_tmp}, rbx", // save rbx which is reserved by LLVM
+                    "xor rbx, rbx", // zeroed rbx
+                    concat!("lock cmpxchg16b xmmword ptr [", $rdi, "]"),
+                    "mov rbx, {rbx_tmp}", // restore rbx
+                    // set old/new args of cmpxchg16b to 0 (rbx is zeroed after saved to rbx_tmp, to avoid xchg)
+                    rbx_tmp = out(reg) _,
+                    in("rcx") 0_u64,
+                    inout("rax") 0_u64 => out_lo,
+                    inout("rdx") 0_u64 => out_hi,
+                    in($rdi) src,
+                    // Do not use `preserves_flags` because CMPXCHG16B modifies the ZF flag.
+                    options(nostack),
+                )
+            };
+        }
+        #[cfg(target_pointer_width = "32")]
+        cmpxchg16b!("edi");
+        #[cfg(target_pointer_width = "64")]
+        cmpxchg16b!("rdi");
+        U128 { pair: Pair { lo: out_lo, hi: out_hi } }.whole
+    }
+}
+
+#[inline]
+unsafe fn atomic_store(dst: *mut u128, val: u128, order: Ordering) {
+    // We only use VMOVDQA when SSE is enabled. See atomic_load_vmovdqa() for more.
+    // SGX doesn't support CPUID.
+    #[cfg(all(
+        any(target_feature = "cmpxchg16b", portable_atomic_target_feature = "cmpxchg16b"),
+        any(portable_atomic_no_outline_atomics, target_env = "sgx", not(target_feature = "sse")),
+    ))]
+    // SAFETY: the caller must uphold the safety contract.
+    // cfg guarantees that CMPXCHG16B is available at compile-time.
+    unsafe {
+        // cmpxchg16b is always SeqCst.
+        let _ = order;
+        atomic_store_cmpxchg16b(dst, val);
+    }
+    #[cfg(not(all(
+        any(target_feature = "cmpxchg16b", portable_atomic_target_feature = "cmpxchg16b"),
+        any(portable_atomic_no_outline_atomics, target_env = "sgx", not(target_feature = "sse")),
+    )))]
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        #[cfg(target_feature = "sse")]
+        fn_alias! {
+            #[target_feature(enable = "avx")]
+            unsafe fn(dst: *mut u128, val: u128);
+            // atomic store by vmovdqa has at least release semantics.
+            atomic_store_vmovdqa_non_seqcst = atomic_store_vmovdqa(Ordering::Release);
+            atomic_store_vmovdqa_seqcst = atomic_store_vmovdqa(Ordering::SeqCst);
+        }
+        match order {
+            // Relaxed and Release stores are equivalent in all implementations
+            // that may be called here (vmovdqa, asm-based cmpxchg16b, and fallback).
+            // core::arch's cmpxchg16b will never called here.
+            Ordering::Relaxed | Ordering::Release => {
+                ifunc!(unsafe fn(dst: *mut u128, val: u128) {
+                    load_store_detect! {
+                        vmovdqa = atomic_store_vmovdqa_non_seqcst
+                        cmpxchg16b = atomic_store_cmpxchg16b
+                        fallback = atomic_store_non_seqcst
+                    }
+                });
+            }
+            Ordering::SeqCst => {
+                ifunc!(unsafe fn(dst: *mut u128, val: u128) {
+                    load_store_detect! {
+                        vmovdqa = atomic_store_vmovdqa_seqcst
+                        cmpxchg16b = atomic_store_cmpxchg16b
+                        fallback = atomic_store_seqcst
+                    }
+                });
+            }
+            _ => unreachable!(),
+        }
+    }
+}
+// See cmpxchg16b() for target_feature(enable).
+#[cfg_attr(
+    not(portable_atomic_no_cmpxchg16b_target_feature),
+    target_feature(enable = "cmpxchg16b")
+)]
+#[inline]
+unsafe fn atomic_store_cmpxchg16b(dst: *mut u128, val: u128) {
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        // cmpxchg16b is always SeqCst.
+        atomic_swap_cmpxchg16b(dst, val, Ordering::SeqCst);
+    }
+}
+
+#[inline]
+unsafe fn atomic_compare_exchange(
+    dst: *mut u128,
+    old: u128,
+    new: u128,
+    _success: Ordering,
+    _failure: Ordering,
+) -> Result<u128, u128> {
+    #[cfg(any(target_feature = "cmpxchg16b", portable_atomic_target_feature = "cmpxchg16b"))]
+    // SAFETY: the caller must guarantee that `dst` is valid for both writes and
+    // reads, 16-byte aligned, that there are no concurrent non-atomic operations,
+    // and cfg guarantees that CMPXCHG16B is available at compile-time.
+    let (prev, ok) = unsafe { cmpxchg16b(dst, old, new) };
+    #[cfg(not(any(target_feature = "cmpxchg16b", portable_atomic_target_feature = "cmpxchg16b")))]
+    // SAFETY: the caller must guarantee that `dst` is valid for both writes and
+    // reads, 16-byte aligned, and that there are no different kinds of concurrent accesses.
+    let (prev, ok) = unsafe {
+        ifunc!(unsafe fn(dst: *mut u128, old: u128, new: u128) -> (u128, bool) {
+            if detect::detect().has_cmpxchg16b() {
+                cmpxchg16b
+            } else {
+                // Use SeqCst because cmpxchg16b is always SeqCst.
+                fallback::atomic_compare_exchange_seqcst
+            }
+        })
+    };
+    if ok {
+        Ok(prev)
+    } else {
+        Err(prev)
+    }
+}
+
+// cmpxchg16b is always strong.
+use atomic_compare_exchange as atomic_compare_exchange_weak;
+
+#[cfg(any(target_feature = "cmpxchg16b", portable_atomic_target_feature = "cmpxchg16b"))]
+use atomic_swap_cmpxchg16b as atomic_swap;
+// See cmpxchg16b() for target_feature(enable).
+#[cfg_attr(
+    not(portable_atomic_no_cmpxchg16b_target_feature),
+    target_feature(enable = "cmpxchg16b")
+)]
+#[inline]
+unsafe fn atomic_swap_cmpxchg16b(dst: *mut u128, val: u128, _order: Ordering) -> u128 {
+    debug_assert!(dst as usize % 16 == 0);
+    debug_assert_cmpxchg16b!();
+
+    // SAFETY: the caller must guarantee that `dst` is valid for both writes and
+    // reads, 16-byte aligned, and that there are no concurrent non-atomic operations.
+    // cfg guarantees that the CPU supports CMPXCHG16B.
+    //
+    // See cmpxchg16b function for more.
+    //
+    // We could use CAS loop by atomic_compare_exchange here, but using an inline assembly allows
+    // omitting the storing/comparing of condition flags and reducing uses of xchg/mov to handle rbx.
+    //
+    // Do not use atomic_rmw_cas_3 because it needs extra MOV to implement swap.
+    unsafe {
+        // cmpxchg16b is always SeqCst.
+        let val = U128 { whole: val };
+        let (mut prev_lo, mut prev_hi);
+        macro_rules! cmpxchg16b {
+            ($rdi:tt) => {
+                asm!(
+                    "xchg {rbx_tmp}, rbx", // save rbx which is reserved by LLVM
+                    // This is not single-copy atomic reads, but this is ok because subsequent
+                    // CAS will check for consistency.
+                    //
+                    // This is based on the code generated for the first load in DW RMWs by LLVM.
+                    //
+                    // Note that the C++20 memory model does not allow mixed-sized atomic access,
+                    // so we must use inline assembly to implement this.
+                    // (i.e., byte-wise atomic based on the standard library's atomic types
+                    // cannot be used here).
+                    concat!("mov rax, qword ptr [", $rdi, "]"),
+                    concat!("mov rdx, qword ptr [", $rdi, " + 8]"),
+                    "2:",
+                        concat!("lock cmpxchg16b xmmword ptr [", $rdi, "]"),
+                        "jne 2b",
+                    "mov rbx, {rbx_tmp}", // restore rbx
+                    rbx_tmp = inout(reg) val.pair.lo => _,
+                    in("rcx") val.pair.hi,
+                    out("rax") prev_lo,
+                    out("rdx") prev_hi,
+                    in($rdi) dst,
+                    // Do not use `preserves_flags` because CMPXCHG16B modifies the ZF flag.
+                    options(nostack),
+                )
+            };
+        }
+        #[cfg(target_pointer_width = "32")]
+        cmpxchg16b!("edi");
+        #[cfg(target_pointer_width = "64")]
+        cmpxchg16b!("rdi");
+        U128 { pair: Pair { lo: prev_lo, hi: prev_hi } }.whole
+    }
+}
+
+/// Atomic RMW by CAS loop (3 arguments)
+/// `unsafe fn(dst: *mut u128, val: u128, order: Ordering) -> u128;`
+///
+/// `$op` can use the following registers:
+/// - rsi/r8 pair: val argument (read-only for `$op`)
+/// - rax/rdx pair: previous value loaded (read-only for `$op`)
+/// - rbx/rcx pair: new value that will be stored
+// We could use CAS loop by atomic_compare_exchange here, but using an inline assembly allows
+// omitting the storing/comparing of condition flags and reducing uses of xchg/mov to handle rbx.
+macro_rules! atomic_rmw_cas_3 {
+    ($name:ident as $reexport_name:ident, $($op:tt)*) => {
+        #[cfg(any(target_feature = "cmpxchg16b", portable_atomic_target_feature = "cmpxchg16b"))]
+        use $name as $reexport_name;
+        // See cmpxchg16b() for target_feature(enable).
+        #[cfg_attr(
+            not(portable_atomic_no_cmpxchg16b_target_feature),
+            target_feature(enable = "cmpxchg16b")
+        )]
+        #[inline]
+        unsafe fn $name(dst: *mut u128, val: u128, _order: Ordering) -> u128 {
+            debug_assert!(dst as usize % 16 == 0);
+            debug_assert_cmpxchg16b!();
+            // SAFETY: the caller must guarantee that `dst` is valid for both writes and
+            // reads, 16-byte aligned, and that there are no concurrent non-atomic operations.
+            // cfg guarantees that the CPU supports CMPXCHG16B.
+            //
+            // See cmpxchg16b function for more.
+            unsafe {
+                // cmpxchg16b is always SeqCst.
+                let val = U128 { whole: val };
+                let (mut prev_lo, mut prev_hi);
+                macro_rules! cmpxchg16b {
+                    ($rdi:tt) => {
+                        asm!(
+                            "mov {rbx_tmp}, rbx", // save rbx which is reserved by LLVM
+                            // This is not single-copy atomic reads, but this is ok because subsequent
+                            // CAS will check for consistency.
+                            //
+                            // This is based on the code generated for the first load in DW RMWs by LLVM.
+                            //
+                            // Note that the C++20 memory model does not allow mixed-sized atomic access,
+                            // so we must use inline assembly to implement this.
+                            // (i.e., byte-wise atomic based on the standard library's atomic types
+                            // cannot be used here).
+                            concat!("mov rax, qword ptr [", $rdi, "]"),
+                            concat!("mov rdx, qword ptr [", $rdi, " + 8]"),
+                            "2:",
+                                $($op)*
+                                concat!("lock cmpxchg16b xmmword ptr [", $rdi, "]"),
+                                "jne 2b",
+                            "mov rbx, {rbx_tmp}", // restore rbx
+                            rbx_tmp = out(reg) _,
+                            out("rcx") _,
+                            out("rax") prev_lo,
+                            out("rdx") prev_hi,
+                            in($rdi) dst,
+                            in("rsi") val.pair.lo,
+                            in("r8") val.pair.hi,
+                            // Do not use `preserves_flags` because CMPXCHG16B modifies the ZF flag.
+                            options(nostack),
+                        )
+                    };
+                }
+                #[cfg(target_pointer_width = "32")]
+                cmpxchg16b!("edi");
+                #[cfg(target_pointer_width = "64")]
+                cmpxchg16b!("rdi");
+                U128 { pair: Pair { lo: prev_lo, hi: prev_hi } }.whole
+            }
+        }
+    };
+}
+/// Atomic RMW by CAS loop (2 arguments)
+/// `unsafe fn(dst: *mut u128, order: Ordering) -> u128;`
+///
+/// `$op` can use the following registers:
+/// - rax/rdx pair: previous value loaded (read-only for `$op`)
+/// - rbx/rcx pair: new value that will be stored
+// We could use CAS loop by atomic_compare_exchange here, but using an inline assembly allows
+// omitting the storing of condition flags and avoid use of xchg to handle rbx.
+macro_rules! atomic_rmw_cas_2 {
+    ($name:ident as $reexport_name:ident, $($op:tt)*) => {
+        #[cfg(any(target_feature = "cmpxchg16b", portable_atomic_target_feature = "cmpxchg16b"))]
+        use $name as $reexport_name;
+        // See cmpxchg16b() for target_feature(enable).
+        #[cfg_attr(
+            not(portable_atomic_no_cmpxchg16b_target_feature),
+            target_feature(enable = "cmpxchg16b")
+        )]
+        #[inline]
+        unsafe fn $name(dst: *mut u128, _order: Ordering) -> u128 {
+            debug_assert!(dst as usize % 16 == 0);
+            debug_assert_cmpxchg16b!();
+            // SAFETY: the caller must guarantee that `dst` is valid for both writes and
+            // reads, 16-byte aligned, and that there are no concurrent non-atomic operations.
+            // cfg guarantees that the CPU supports CMPXCHG16B.
+            //
+            // See cmpxchg16b function for more.
+            unsafe {
+                // cmpxchg16b is always SeqCst.
+                let (mut prev_lo, mut prev_hi);
+                macro_rules! cmpxchg16b {
+                    ($rdi:tt) => {
+                        asm!(
+                            "mov {rbx_tmp}, rbx", // save rbx which is reserved by LLVM
+                            // This is not single-copy atomic reads, but this is ok because subsequent
+                            // CAS will check for consistency.
+                            //
+                            // This is based on the code generated for the first load in DW RMWs by LLVM.
+                            //
+                            // Note that the C++20 memory model does not allow mixed-sized atomic access,
+                            // so we must use inline assembly to implement this.
+                            // (i.e., byte-wise atomic based on the standard library's atomic types
+                            // cannot be used here).
+                            concat!("mov rax, qword ptr [", $rdi, "]"),
+                            concat!("mov rdx, qword ptr [", $rdi, " + 8]"),
+                            "2:",
+                                $($op)*
+                                concat!("lock cmpxchg16b xmmword ptr [", $rdi, "]"),
+                                "jne 2b",
+                            "mov rbx, {rbx_tmp}", // restore rbx
+                            rbx_tmp = out(reg) _,
+                            out("rcx") _,
+                            out("rax") prev_lo,
+                            out("rdx") prev_hi,
+                            in($rdi) dst,
+                            // Do not use `preserves_flags` because CMPXCHG16B modifies the ZF flag.
+                            options(nostack),
+                        )
+                    };
+                }
+                #[cfg(target_pointer_width = "32")]
+                cmpxchg16b!("edi");
+                #[cfg(target_pointer_width = "64")]
+                cmpxchg16b!("rdi");
+                U128 { pair: Pair { lo: prev_lo, hi: prev_hi } }.whole
+            }
+        }
+    };
+}
+
+atomic_rmw_cas_3! {
+    atomic_add_cmpxchg16b as atomic_add,
+    "mov rbx, rax",
+    "add rbx, rsi",
+    "mov rcx, rdx",
+    "adc rcx, r8",
+}
+atomic_rmw_cas_3! {
+    atomic_sub_cmpxchg16b as atomic_sub,
+    "mov rbx, rax",
+    "sub rbx, rsi",
+    "mov rcx, rdx",
+    "sbb rcx, r8",
+}
+atomic_rmw_cas_3! {
+    atomic_and_cmpxchg16b as atomic_and,
+    "mov rbx, rax",
+    "and rbx, rsi",
+    "mov rcx, rdx",
+    "and rcx, r8",
+}
+atomic_rmw_cas_3! {
+    atomic_nand_cmpxchg16b as atomic_nand,
+    "mov rbx, rax",
+    "and rbx, rsi",
+    "not rbx",
+    "mov rcx, rdx",
+    "and rcx, r8",
+    "not rcx",
+}
+atomic_rmw_cas_3! {
+    atomic_or_cmpxchg16b as atomic_or,
+    "mov rbx, rax",
+    "or rbx, rsi",
+    "mov rcx, rdx",
+    "or rcx, r8",
+}
+atomic_rmw_cas_3! {
+    atomic_xor_cmpxchg16b as atomic_xor,
+    "mov rbx, rax",
+    "xor rbx, rsi",
+    "mov rcx, rdx",
+    "xor rcx, r8",
+}
+
+atomic_rmw_cas_2! {
+    atomic_not_cmpxchg16b as atomic_not,
+    "mov rbx, rax",
+    "not rbx",
+    "mov rcx, rdx",
+    "not rcx",
+}
+atomic_rmw_cas_2! {
+    atomic_neg_cmpxchg16b as atomic_neg,
+    "mov rbx, rax",
+    "neg rbx",
+    "mov rcx, 0",
+    "sbb rcx, rdx",
+}
+
+atomic_rmw_cas_3! {
+    atomic_max_cmpxchg16b as atomic_max,
+    "cmp rsi, rax",
+    "mov rcx, r8",
+    "sbb rcx, rdx",
+    "mov rcx, r8",
+    "cmovl rcx, rdx",
+    "mov rbx, rsi",
+    "cmovl rbx, rax",
+}
+atomic_rmw_cas_3! {
+    atomic_umax_cmpxchg16b as atomic_umax,
+    "cmp rsi, rax",
+    "mov rcx, r8",
+    "sbb rcx, rdx",
+    "mov rcx, r8",
+    "cmovb rcx, rdx",
+    "mov rbx, rsi",
+    "cmovb rbx, rax",
+}
+atomic_rmw_cas_3! {
+    atomic_min_cmpxchg16b as atomic_min,
+    "cmp rsi, rax",
+    "mov rcx, r8",
+    "sbb rcx, rdx",
+    "mov rcx, r8",
+    "cmovge rcx, rdx",
+    "mov rbx, rsi",
+    "cmovge rbx, rax",
+}
+atomic_rmw_cas_3! {
+    atomic_umin_cmpxchg16b as atomic_umin,
+    "cmp rsi, rax",
+    "mov rcx, r8",
+    "sbb rcx, rdx",
+    "mov rcx, r8",
+    "cmovae rcx, rdx",
+    "mov rbx, rsi",
+    "cmovae rbx, rax",
+}
+
+macro_rules! atomic_rmw_with_ifunc {
+    (
+        unsafe fn $name:ident($($arg:tt)*) $(-> $ret_ty:ty)?;
+        cmpxchg16b = $cmpxchg16b_fn:ident;
+        fallback = $seqcst_fallback_fn:ident;
+    ) => {
+        #[cfg(not(any(
+            target_feature = "cmpxchg16b",
+            portable_atomic_target_feature = "cmpxchg16b",
+        )))]
+        #[inline]
+        unsafe fn $name($($arg)*, _order: Ordering) $(-> $ret_ty)? {
+            fn_alias! {
+                // See cmpxchg16b() for target_feature(enable).
+                #[cfg_attr(
+                    not(portable_atomic_no_cmpxchg16b_target_feature),
+                    target_feature(enable = "cmpxchg16b")
+                )]
+                unsafe fn($($arg)*) $(-> $ret_ty)?;
+                // cmpxchg16b is always SeqCst.
+                cmpxchg16b_seqcst_fn = $cmpxchg16b_fn(Ordering::SeqCst);
+            }
+            // SAFETY: the caller must uphold the safety contract.
+            // we only calls cmpxchg16b_fn if cmpxchg16b is available.
+            unsafe {
+                ifunc!(unsafe fn($($arg)*) $(-> $ret_ty)? {
+                    if detect::detect().has_cmpxchg16b() {
+                        cmpxchg16b_seqcst_fn
+                    } else {
+                        // Use SeqCst because cmpxchg16b is always SeqCst.
+                        fallback::$seqcst_fallback_fn
+                    }
+                })
+            }
+        }
+    };
+}
+
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_swap(dst: *mut u128, val: u128) -> u128;
+    cmpxchg16b = atomic_swap_cmpxchg16b;
+    fallback = atomic_swap_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_add(dst: *mut u128, val: u128) -> u128;
+    cmpxchg16b = atomic_add_cmpxchg16b;
+    fallback = atomic_add_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_sub(dst: *mut u128, val: u128) -> u128;
+    cmpxchg16b = atomic_sub_cmpxchg16b;
+    fallback = atomic_sub_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_and(dst: *mut u128, val: u128) -> u128;
+    cmpxchg16b = atomic_and_cmpxchg16b;
+    fallback = atomic_and_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_nand(dst: *mut u128, val: u128) -> u128;
+    cmpxchg16b = atomic_nand_cmpxchg16b;
+    fallback = atomic_nand_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_or(dst: *mut u128, val: u128) -> u128;
+    cmpxchg16b = atomic_or_cmpxchg16b;
+    fallback = atomic_or_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_xor(dst: *mut u128, val: u128) -> u128;
+    cmpxchg16b = atomic_xor_cmpxchg16b;
+    fallback = atomic_xor_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_max(dst: *mut u128, val: u128) -> u128;
+    cmpxchg16b = atomic_max_cmpxchg16b;
+    fallback = atomic_max_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_umax(dst: *mut u128, val: u128) -> u128;
+    cmpxchg16b = atomic_umax_cmpxchg16b;
+    fallback = atomic_umax_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_min(dst: *mut u128, val: u128) -> u128;
+    cmpxchg16b = atomic_min_cmpxchg16b;
+    fallback = atomic_min_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_umin(dst: *mut u128, val: u128) -> u128;
+    cmpxchg16b = atomic_umin_cmpxchg16b;
+    fallback = atomic_umin_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_not(dst: *mut u128) -> u128;
+    cmpxchg16b = atomic_not_cmpxchg16b;
+    fallback = atomic_not_seqcst;
+}
+atomic_rmw_with_ifunc! {
+    unsafe fn atomic_neg(dst: *mut u128) -> u128;
+    cmpxchg16b = atomic_neg_cmpxchg16b;
+    fallback = atomic_neg_seqcst;
+}
+
+#[inline]
+fn is_lock_free() -> bool {
+    #[cfg(any(target_feature = "cmpxchg16b", portable_atomic_target_feature = "cmpxchg16b"))]
+    {
+        // CMPXCHG16B is available at compile-time.
+        true
+    }
+    #[cfg(not(any(target_feature = "cmpxchg16b", portable_atomic_target_feature = "cmpxchg16b")))]
+    {
+        detect::detect().has_cmpxchg16b()
+    }
+}
+const IS_ALWAYS_LOCK_FREE: bool =
+    cfg!(any(target_feature = "cmpxchg16b", portable_atomic_target_feature = "cmpxchg16b"));
+
+atomic128!(AtomicI128, i128, atomic_max, atomic_min);
+atomic128!(AtomicU128, u128, atomic_umax, atomic_umin);
+
+#[allow(clippy::undocumented_unsafe_blocks, clippy::wildcard_imports)]
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    test_atomic_int!(i128);
+    test_atomic_int!(u128);
+
+    // load/store/swap implementation is not affected by signedness, so it is
+    // enough to test only unsigned types.
+    stress_test!(u128);
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/core_atomic.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/core_atomic.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/core_atomic.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/core_atomic.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,441 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Wrap the standard library's atomic types in newtype.
+//
+// This is not a reexport, because we want to backport changes like
+// https://github.com/rust-lang/rust/pull/98383 to old compilers.
+
+use core::{cell::UnsafeCell, marker::PhantomData, sync::atomic::Ordering};
+
+// core::panic::RefUnwindSafe is only available on Rust 1.56+, so on pre-1.56
+// Rust, we implement RefUnwindSafe when "std" feature is enabled.
+// However, on pre-1.56 Rust, the standard library's atomic types implement
+// RefUnwindSafe when "linked to std", and that's behavior that our other atomic
+// implementations can't emulate, so use PhantomData<NotRefUnwindSafe> to match
+// conditions where our other atomic implementations implement RefUnwindSafe.
+// If we do not do this, for example, downstream that is only tested on x86_64
+// may incorrectly assume that AtomicU64 always implements RefUnwindSafe even on
+// older rustc, and may be broken on platforms where std AtomicU64 is not available.
+struct NotRefUnwindSafe(UnsafeCell<()>);
+// SAFETY: this is a marker type and we'll never access the value.
+unsafe impl Sync for NotRefUnwindSafe {}
+
+#[repr(transparent)]
+pub(crate) struct AtomicPtr<T> {
+    inner: core::sync::atomic::AtomicPtr<T>,
+    // Prevent RefUnwindSafe from being propagated from the std atomic type. See NotRefUnwindSafe for more.
+    _not_ref_unwind_safe: PhantomData<NotRefUnwindSafe>,
+}
+impl<T> AtomicPtr<T> {
+    #[inline]
+    pub(crate) const fn new(v: *mut T) -> Self {
+        Self { inner: core::sync::atomic::AtomicPtr::new(v), _not_ref_unwind_safe: PhantomData }
+    }
+    #[inline]
+    pub(crate) fn is_lock_free() -> bool {
+        Self::is_always_lock_free()
+    }
+    #[inline]
+    pub(crate) const fn is_always_lock_free() -> bool {
+        true
+    }
+    #[inline]
+    pub(crate) fn get_mut(&mut self) -> &mut *mut T {
+        self.inner.get_mut()
+    }
+    #[inline]
+    #[cfg_attr(
+        any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+        track_caller
+    )]
+    pub(crate) fn load(&self, order: Ordering) -> *mut T {
+        crate::utils::assert_load_ordering(order); // for track_caller (compiler can omit double check)
+        self.inner.load(order)
+    }
+    #[inline]
+    #[cfg_attr(
+        any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+        track_caller
+    )]
+    pub(crate) fn store(&self, ptr: *mut T, order: Ordering) {
+        crate::utils::assert_store_ordering(order); // for track_caller (compiler can omit double check)
+        self.inner.store(ptr, order);
+    }
+    const_fn! {
+        const_if: #[cfg(not(portable_atomic_no_const_raw_ptr_deref))];
+        #[inline]
+        pub(crate) const fn as_ptr(&self) -> *mut *mut T {
+            // SAFETY: Self is #[repr(C)] and internally UnsafeCell<*mut T>.
+            // See also https://github.com/rust-lang/rust/pull/66705 and
+            // https://github.com/rust-lang/rust/issues/66136#issuecomment-557867116.
+            unsafe { (*(self as *const Self as *const UnsafeCell<*mut T>)).get() }
+        }
+    }
+}
+#[cfg_attr(portable_atomic_no_cfg_target_has_atomic, cfg(not(portable_atomic_no_atomic_cas)))]
+#[cfg_attr(not(portable_atomic_no_cfg_target_has_atomic), cfg(target_has_atomic = "ptr"))]
+impl<T> AtomicPtr<T> {
+    #[inline]
+    #[cfg_attr(
+        any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+        track_caller
+    )]
+    pub(crate) fn compare_exchange(
+        &self,
+        current: *mut T,
+        new: *mut T,
+        success: Ordering,
+        failure: Ordering,
+    ) -> Result<*mut T, *mut T> {
+        crate::utils::assert_compare_exchange_ordering(success, failure); // for track_caller (compiler can omit double check)
+        #[cfg(portable_atomic_no_stronger_failure_ordering)]
+        let success = crate::utils::upgrade_success_ordering(success, failure);
+        self.inner.compare_exchange(current, new, success, failure)
+    }
+    #[inline]
+    #[cfg_attr(
+        any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+        track_caller
+    )]
+    pub(crate) fn compare_exchange_weak(
+        &self,
+        current: *mut T,
+        new: *mut T,
+        success: Ordering,
+        failure: Ordering,
+    ) -> Result<*mut T, *mut T> {
+        crate::utils::assert_compare_exchange_ordering(success, failure); // for track_caller (compiler can omit double check)
+        #[cfg(portable_atomic_no_stronger_failure_ordering)]
+        let success = crate::utils::upgrade_success_ordering(success, failure);
+        self.inner.compare_exchange_weak(current, new, success, failure)
+    }
+}
+impl<T> core::ops::Deref for AtomicPtr<T> {
+    type Target = core::sync::atomic::AtomicPtr<T>;
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    fn deref(&self) -> &Self::Target {
+        &self.inner
+    }
+}
+
+macro_rules! atomic_int {
+    ($atomic_type:ident, $int_type:ident) => {
+        #[repr(transparent)]
+        pub(crate) struct $atomic_type {
+            inner: core::sync::atomic::$atomic_type,
+            // Prevent RefUnwindSafe from being propagated from the std atomic type. See NotRefUnwindSafe for more.
+            _not_ref_unwind_safe: PhantomData<NotRefUnwindSafe>,
+        }
+        #[cfg_attr(
+            portable_atomic_no_cfg_target_has_atomic,
+            cfg(not(portable_atomic_no_atomic_cas))
+        )]
+        #[cfg_attr(not(portable_atomic_no_cfg_target_has_atomic), cfg(target_has_atomic = "ptr"))]
+        impl_default_no_fetch_ops!($atomic_type, $int_type);
+        #[cfg(not(all(
+            any(target_arch = "x86", target_arch = "x86_64"),
+            not(any(miri, portable_atomic_sanitize_thread)),
+            not(portable_atomic_no_asm),
+        )))]
+        #[cfg_attr(
+            portable_atomic_no_cfg_target_has_atomic,
+            cfg(not(portable_atomic_no_atomic_cas))
+        )]
+        #[cfg_attr(not(portable_atomic_no_cfg_target_has_atomic), cfg(target_has_atomic = "ptr"))]
+        impl_default_bit_opts!($atomic_type, $int_type);
+        impl $atomic_type {
+            #[inline]
+            pub(crate) const fn new(v: $int_type) -> Self {
+                Self {
+                    inner: core::sync::atomic::$atomic_type::new(v),
+                    _not_ref_unwind_safe: PhantomData,
+                }
+            }
+            #[inline]
+            pub(crate) fn is_lock_free() -> bool {
+                Self::is_always_lock_free()
+            }
+            #[inline]
+            pub(crate) const fn is_always_lock_free() -> bool {
+                // ESP-IDF targets' 64-bit atomics are not lock-free.
+                // https://github.com/rust-lang/rust/pull/115577#issuecomment-1732259297
+                cfg!(not(all(
+                    any(target_arch = "riscv32", target_arch = "xtensa"),
+                    target_os = "espidf",
+                ))) | (core::mem::size_of::<$int_type>() < 8)
+            }
+            #[inline]
+            pub(crate) fn get_mut(&mut self) -> &mut $int_type {
+                self.inner.get_mut()
+            }
+            #[inline]
+            #[cfg_attr(
+                any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                track_caller
+            )]
+            pub(crate) fn load(&self, order: Ordering) -> $int_type {
+                crate::utils::assert_load_ordering(order); // for track_caller (compiler can omit double check)
+                self.inner.load(order)
+            }
+            #[inline]
+            #[cfg_attr(
+                any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                track_caller
+            )]
+            pub(crate) fn store(&self, val: $int_type, order: Ordering) {
+                crate::utils::assert_store_ordering(order); // for track_caller (compiler can omit double check)
+                self.inner.store(val, order);
+            }
+            const_fn! {
+                const_if: #[cfg(not(portable_atomic_no_const_raw_ptr_deref))];
+                #[inline]
+                pub(crate) const fn as_ptr(&self) -> *mut $int_type {
+                    // SAFETY: Self is #[repr(C)] and internally UnsafeCell<$int_type>.
+                    // See also https://github.com/rust-lang/rust/pull/66705 and
+                    // https://github.com/rust-lang/rust/issues/66136#issuecomment-557867116.
+                    unsafe {
+                        (*(self as *const Self as *const UnsafeCell<$int_type>)).get()
+                    }
+                }
+            }
+        }
+        #[cfg_attr(
+            portable_atomic_no_cfg_target_has_atomic,
+            cfg(not(portable_atomic_no_atomic_cas))
+        )]
+        #[cfg_attr(not(portable_atomic_no_cfg_target_has_atomic), cfg(target_has_atomic = "ptr"))]
+        impl $atomic_type {
+            #[inline]
+            #[cfg_attr(
+                any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                track_caller
+            )]
+            pub(crate) fn compare_exchange(
+                &self,
+                current: $int_type,
+                new: $int_type,
+                success: Ordering,
+                failure: Ordering,
+            ) -> Result<$int_type, $int_type> {
+                crate::utils::assert_compare_exchange_ordering(success, failure); // for track_caller (compiler can omit double check)
+                #[cfg(portable_atomic_no_stronger_failure_ordering)]
+                let success = crate::utils::upgrade_success_ordering(success, failure);
+                self.inner.compare_exchange(current, new, success, failure)
+            }
+            #[inline]
+            #[cfg_attr(
+                any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                track_caller
+            )]
+            pub(crate) fn compare_exchange_weak(
+                &self,
+                current: $int_type,
+                new: $int_type,
+                success: Ordering,
+                failure: Ordering,
+            ) -> Result<$int_type, $int_type> {
+                crate::utils::assert_compare_exchange_ordering(success, failure); // for track_caller (compiler can omit double check)
+                #[cfg(portable_atomic_no_stronger_failure_ordering)]
+                let success = crate::utils::upgrade_success_ordering(success, failure);
+                self.inner.compare_exchange_weak(current, new, success, failure)
+            }
+            #[allow(dead_code)]
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            fn fetch_update_<F>(&self, order: Ordering, mut f: F) -> $int_type
+            where
+                F: FnMut($int_type) -> $int_type,
+            {
+                // This is a private function and all instances of `f` only operate on the value
+                // loaded, so there is no need to synchronize the first load/failed CAS.
+                let mut prev = self.load(Ordering::Relaxed);
+                loop {
+                    let next = f(prev);
+                    match self.compare_exchange_weak(prev, next, order, Ordering::Relaxed) {
+                        Ok(x) => return x,
+                        Err(next_prev) => prev = next_prev,
+                    }
+                }
+            }
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn fetch_max(&self, val: $int_type, order: Ordering) -> $int_type {
+                #[cfg(not(portable_atomic_no_atomic_min_max))]
+                {
+                    #[cfg(any(
+                        all(
+                            target_arch = "aarch64",
+                            any(target_feature = "lse", portable_atomic_target_feature = "lse"),
+                        ),
+                        all(
+                            target_arch = "arm",
+                            not(any(
+                                target_feature = "v6",
+                                portable_atomic_target_feature = "v6",
+                            )),
+                        ),
+                        target_arch = "mips",
+                        target_arch = "mips32r6",
+                        target_arch = "mips64",
+                        target_arch = "mips64r6",
+                        target_arch = "powerpc",
+                        target_arch = "powerpc64",
+                    ))]
+                    {
+                        // HACK: the following operations are currently broken (at least on qemu-user):
+                        // - aarch64's `AtomicI{8,16}::fetch_{max,min}` (release mode + lse)
+                        // - armv5te's `Atomic{I,U}{8,16}::fetch_{max,min}`
+                        // - mips's `AtomicI8::fetch_{max,min}` (release mode)
+                        // - mipsel's `AtomicI{8,16}::fetch_{max,min}` (debug mode, at least)
+                        // - mips64's `AtomicI8::fetch_{max,min}` (release mode)
+                        // - mips64el's `AtomicI{8,16}::fetch_{max,min}` (debug mode, at least)
+                        // - powerpc's `AtomicI{8,16}::fetch_{max,min}`
+                        // - powerpc64's `AtomicI{8,16}::fetch_{max,min}` (debug mode, at least)
+                        // - powerpc64le's `AtomicU{8,16}::fetch_{max,min}` (release mode + fat LTO)
+                        // See also:
+                        // https://github.com/llvm/llvm-project/issues/61880
+                        // https://github.com/llvm/llvm-project/issues/61881
+                        // https://github.com/llvm/llvm-project/issues/61882
+                        // https://github.com/taiki-e/portable-atomic/issues/2
+                        // https://github.com/rust-lang/rust/issues/100650
+                        if core::mem::size_of::<$int_type>() <= 2 {
+                            return self.fetch_update_(order, |x| core::cmp::max(x, val));
+                        }
+                    }
+                    self.inner.fetch_max(val, order)
+                }
+                #[cfg(portable_atomic_no_atomic_min_max)]
+                {
+                    self.fetch_update_(order, |x| core::cmp::max(x, val))
+                }
+            }
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn fetch_min(&self, val: $int_type, order: Ordering) -> $int_type {
+                #[cfg(not(portable_atomic_no_atomic_min_max))]
+                {
+                    #[cfg(any(
+                        all(
+                            target_arch = "aarch64",
+                            any(target_feature = "lse", portable_atomic_target_feature = "lse"),
+                        ),
+                        all(
+                            target_arch = "arm",
+                            not(any(
+                                target_feature = "v6",
+                                portable_atomic_target_feature = "v6",
+                            )),
+                        ),
+                        target_arch = "mips",
+                        target_arch = "mips32r6",
+                        target_arch = "mips64",
+                        target_arch = "mips64r6",
+                        target_arch = "powerpc",
+                        target_arch = "powerpc64",
+                    ))]
+                    {
+                        // HACK: the following operations are currently broken (at least on qemu-user):
+                        // - aarch64's `AtomicI{8,16}::fetch_{max,min}` (release mode + lse)
+                        // - armv5te's `Atomic{I,U}{8,16}::fetch_{max,min}`
+                        // - mips's `AtomicI8::fetch_{max,min}` (release mode)
+                        // - mipsel's `AtomicI{8,16}::fetch_{max,min}` (debug mode, at least)
+                        // - mips64's `AtomicI8::fetch_{max,min}` (release mode)
+                        // - mips64el's `AtomicI{8,16}::fetch_{max,min}` (debug mode, at least)
+                        // - powerpc's `AtomicI{8,16}::fetch_{max,min}`
+                        // - powerpc64's `AtomicI{8,16}::fetch_{max,min}` (debug mode, at least)
+                        // - powerpc64le's `AtomicU{8,16}::fetch_{max,min}` (release mode + fat LTO)
+                        // See also:
+                        // https://github.com/llvm/llvm-project/issues/61880
+                        // https://github.com/llvm/llvm-project/issues/61881
+                        // https://github.com/llvm/llvm-project/issues/61882
+                        // https://github.com/taiki-e/portable-atomic/issues/2
+                        // https://github.com/rust-lang/rust/issues/100650
+                        if core::mem::size_of::<$int_type>() <= 2 {
+                            return self.fetch_update_(order, |x| core::cmp::min(x, val));
+                        }
+                    }
+                    self.inner.fetch_min(val, order)
+                }
+                #[cfg(portable_atomic_no_atomic_min_max)]
+                {
+                    self.fetch_update_(order, |x| core::cmp::min(x, val))
+                }
+            }
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn fetch_not(&self, order: Ordering) -> $int_type {
+                self.fetch_xor(!0, order)
+            }
+            #[cfg(not(all(
+                any(target_arch = "x86", target_arch = "x86_64"),
+                not(any(miri, portable_atomic_sanitize_thread)),
+                not(portable_atomic_no_asm),
+            )))]
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn not(&self, order: Ordering) {
+                self.fetch_not(order);
+            }
+            // TODO: provide asm-based implementation on AArch64, ARMv7, RISC-V, etc.
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn fetch_neg(&self, order: Ordering) -> $int_type {
+                self.fetch_update_(order, $int_type::wrapping_neg)
+            }
+            #[cfg(not(all(
+                any(target_arch = "x86", target_arch = "x86_64"),
+                not(any(miri, portable_atomic_sanitize_thread)),
+                not(portable_atomic_no_asm),
+            )))]
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn neg(&self, order: Ordering) {
+                self.fetch_neg(order);
+            }
+        }
+        impl core::ops::Deref for $atomic_type {
+            type Target = core::sync::atomic::$atomic_type;
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            fn deref(&self) -> &Self::Target {
+                &self.inner
+            }
+        }
+    };
+}
+
+atomic_int!(AtomicIsize, isize);
+atomic_int!(AtomicUsize, usize);
+#[cfg(not(portable_atomic_no_atomic_load_store))]
+atomic_int!(AtomicI8, i8);
+#[cfg(not(portable_atomic_no_atomic_load_store))]
+atomic_int!(AtomicU8, u8);
+#[cfg(not(portable_atomic_no_atomic_load_store))]
+atomic_int!(AtomicI16, i16);
+#[cfg(not(portable_atomic_no_atomic_load_store))]
+atomic_int!(AtomicU16, u16);
+#[cfg(not(portable_atomic_no_atomic_load_store))]
+#[cfg(not(target_pointer_width = "16"))]
+atomic_int!(AtomicI32, i32);
+#[cfg(not(portable_atomic_no_atomic_load_store))]
+#[cfg(not(target_pointer_width = "16"))]
+atomic_int!(AtomicU32, u32);
+#[cfg_attr(portable_atomic_no_cfg_target_has_atomic, cfg(not(portable_atomic_no_atomic_64)))]
+#[cfg_attr(
+    not(portable_atomic_no_cfg_target_has_atomic),
+    cfg(any(
+        target_has_atomic = "64",
+        not(any(target_pointer_width = "16", target_pointer_width = "32")),
+    ))
+)]
+atomic_int!(AtomicI64, i64);
+#[cfg_attr(portable_atomic_no_cfg_target_has_atomic, cfg(not(portable_atomic_no_atomic_64)))]
+#[cfg_attr(
+    not(portable_atomic_no_cfg_target_has_atomic),
+    cfg(any(
+        target_has_atomic = "64",
+        not(any(target_pointer_width = "16", target_pointer_width = "32")),
+    ))
+)]
+atomic_int!(AtomicU64, u64);
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/fallback/mod.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/fallback/mod.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/fallback/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/fallback/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,405 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Fallback implementation using global locks.
+//
+// This implementation uses seqlock for global locks.
+//
+// This is basically based on global locks in crossbeam-utils's `AtomicCell`,
+// but seqlock is implemented in a way that does not depend on UB
+// (see comments in optimistic_read method in atomic! macro for details).
+//
+// Note that we cannot use a lock per atomic type, since the in-memory representation of the atomic
+// type and the value type must be the same.
+
+#![cfg_attr(
+    any(
+        all(
+            target_arch = "x86_64",
+            not(portable_atomic_no_outline_atomics),
+            not(any(target_env = "sgx", miri)),
+        ),
+        all(
+            target_arch = "powerpc64",
+            feature = "fallback",
+            not(portable_atomic_no_outline_atomics),
+            portable_atomic_outline_atomics, // TODO(powerpc64): currently disabled by default
+            any(
+                all(
+                    target_os = "linux",
+                    any(
+                        target_env = "gnu",
+                        all(
+                            any(target_env = "musl", target_env = "ohos"),
+                            not(target_feature = "crt-static"),
+                        ),
+                        portable_atomic_outline_atomics,
+                    ),
+                ),
+                target_os = "android",
+                target_os = "freebsd",
+            ),
+            not(any(miri, portable_atomic_sanitize_thread)),
+        ),
+        all(
+            target_arch = "arm",
+            not(portable_atomic_no_asm),
+            any(target_os = "linux", target_os = "android"),
+            not(portable_atomic_no_outline_atomics),
+        ),
+    ),
+    allow(dead_code)
+)]
+
+#[macro_use]
+pub(crate) mod utils;
+
+// Use "wide" sequence lock if the pointer width <= 32 for preventing its counter against wrap
+// around.
+//
+// In narrow architectures (pointer width <= 16), the counter is still <= 32-bit and may be
+// vulnerable to wrap around. But it's mostly okay, since in such a primitive hardware, the
+// counter will not be increased that fast.
+//
+// Some 64-bit architectures have ABI with 32-bit pointer width (e.g., x86_64 X32 ABI,
+// aarch64 ILP32 ABI, mips64 N32 ABI). On those targets, AtomicU64 is available and fast,
+// so use it to implement normal sequence lock.
+cfg_has_fast_atomic_64! {
+    mod seq_lock;
+}
+cfg_no_fast_atomic_64! {
+    #[path = "seq_lock_wide.rs"]
+    mod seq_lock;
+}
+
+use core::{cell::UnsafeCell, mem, sync::atomic::Ordering};
+
+use seq_lock::{SeqLock, SeqLockWriteGuard};
+use utils::CachePadded;
+
+// Some 64-bit architectures have ABI with 32-bit pointer width (e.g., x86_64 X32 ABI,
+// aarch64 ILP32 ABI, mips64 N32 ABI). On those targets, AtomicU64 is fast,
+// so use it to reduce chunks of byte-wise atomic memcpy.
+use seq_lock::{AtomicChunk, Chunk};
+
+// Adapted from https://github.com/crossbeam-rs/crossbeam/blob/crossbeam-utils-0.8.7/crossbeam-utils/src/atomic/atomic_cell.rs#L969-L1016.
+#[inline]
+#[must_use]
+fn lock(addr: usize) -> &'static SeqLock {
+    // The number of locks is a prime number because we want to make sure `addr % LEN` gets
+    // dispersed across all locks.
+    //
+    // crossbeam-utils 0.8.7 uses 97 here but does not use CachePadded,
+    // so the actual concurrency level will be smaller.
+    const LEN: usize = 67;
+    const L: CachePadded<SeqLock> = CachePadded::new(SeqLock::new());
+    static LOCKS: [CachePadded<SeqLock>; LEN] = [
+        L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L,
+        L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L,
+        L, L, L, L, L, L, L,
+    ];
+
+    // If the modulus is a constant number, the compiler will use crazy math to transform this into
+    // a sequence of cheap arithmetic operations rather than using the slow modulo instruction.
+    &LOCKS[addr % LEN]
+}
+
+macro_rules! atomic {
+    ($atomic_type:ident, $int_type:ident, $align:literal) => {
+        #[repr(C, align($align))]
+        pub(crate) struct $atomic_type {
+            v: UnsafeCell<$int_type>,
+        }
+
+        impl $atomic_type {
+            const LEN: usize = mem::size_of::<$int_type>() / mem::size_of::<Chunk>();
+
+            #[inline]
+            unsafe fn chunks(&self) -> &[AtomicChunk; Self::LEN] {
+                static_assert!($atomic_type::LEN > 1);
+                static_assert!(mem::size_of::<$int_type>() % mem::size_of::<Chunk>() == 0);
+
+                // SAFETY: the caller must uphold the safety contract for `chunks`.
+                unsafe { &*(self.v.get() as *const $int_type as *const [AtomicChunk; Self::LEN]) }
+            }
+
+            #[inline]
+            fn optimistic_read(&self) -> $int_type {
+                // Using `MaybeUninit<[usize; Self::LEN]>` here doesn't change codegen: https://godbolt.org/z/86f8s733M
+                let mut dst: [Chunk; Self::LEN] = [0; Self::LEN];
+                // SAFETY:
+                // - There are no threads that perform non-atomic concurrent write operations.
+                // - There is no writer that updates the value using atomic operations of different granularity.
+                //
+                // If the atomic operation is not used here, it will cause a data race
+                // when `write` performs concurrent write operation.
+                // Such a data race is sometimes considered virtually unproblematic
+                // in SeqLock implementations:
+                //
+                // - https://github.com/Amanieu/seqlock/issues/2
+                // - https://github.com/crossbeam-rs/crossbeam/blob/crossbeam-utils-0.8.7/crossbeam-utils/src/atomic/atomic_cell.rs#L1111-L1116
+                // - https://rust-lang.zulipchat.com/#narrow/stream/136281-t-lang.2Fwg-unsafe-code-guidelines/topic/avoiding.20UB.20due.20to.20races.20by.20discarding.20result.3F
+                //
+                // However, in our use case, the implementation that loads/stores value as
+                // chunks of usize is enough fast and sound, so we use that implementation.
+                //
+                // See also atomic-memcpy crate, a generic implementation of this pattern:
+                // https://github.com/taiki-e/atomic-memcpy
+                let chunks = unsafe { self.chunks() };
+                for i in 0..Self::LEN {
+                    dst[i] = chunks[i].load(Ordering::Relaxed);
+                }
+                // SAFETY: integers are plain old data types so we can always transmute to them.
+                unsafe { mem::transmute::<[Chunk; Self::LEN], $int_type>(dst) }
+            }
+
+            #[inline]
+            fn read(&self, _guard: &SeqLockWriteGuard<'static>) -> $int_type {
+                // This calls optimistic_read that can return teared value, but the resulting value
+                // is guaranteed not to be teared because we hold the lock to write.
+                self.optimistic_read()
+            }
+
+            #[inline]
+            fn write(&self, val: $int_type, _guard: &SeqLockWriteGuard<'static>) {
+                // SAFETY: integers are plain old data types so we can always transmute them to arrays of integers.
+                let val = unsafe { mem::transmute::<$int_type, [Chunk; Self::LEN]>(val) };
+                // SAFETY:
+                // - The guard guarantees that we hold the lock to write.
+                // - There are no threads that perform non-atomic concurrent read or write operations.
+                //
+                // See optimistic_read for the reason that atomic operations are used here.
+                let chunks = unsafe { self.chunks() };
+                for i in 0..Self::LEN {
+                    chunks[i].store(val[i], Ordering::Relaxed);
+                }
+            }
+        }
+
+        // Send is implicitly implemented.
+        // SAFETY: any data races are prevented by the lock and atomic operation.
+        unsafe impl Sync for $atomic_type {}
+
+        impl_default_no_fetch_ops!($atomic_type, $int_type);
+        impl_default_bit_opts!($atomic_type, $int_type);
+        impl $atomic_type {
+            #[inline]
+            pub(crate) const fn new(v: $int_type) -> Self {
+                Self { v: UnsafeCell::new(v) }
+            }
+
+            #[inline]
+            pub(crate) fn is_lock_free() -> bool {
+                Self::is_always_lock_free()
+            }
+            #[inline]
+            pub(crate) const fn is_always_lock_free() -> bool {
+                false
+            }
+
+            #[inline]
+            pub(crate) fn get_mut(&mut self) -> &mut $int_type {
+                // SAFETY: the mutable reference guarantees unique ownership.
+                // (UnsafeCell::get_mut requires Rust 1.50)
+                unsafe { &mut *self.v.get() }
+            }
+
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn load(&self, order: Ordering) -> $int_type {
+                crate::utils::assert_load_ordering(order);
+                let lock = lock(self.v.get() as usize);
+
+                // Try doing an optimistic read first.
+                if let Some(stamp) = lock.optimistic_read() {
+                    let val = self.optimistic_read();
+
+                    if lock.validate_read(stamp) {
+                        return val;
+                    }
+                }
+
+                // Grab a regular write lock so that writers don't starve this load.
+                let guard = lock.write();
+                let val = self.read(&guard);
+                // The value hasn't been changed. Drop the guard without incrementing the stamp.
+                guard.abort();
+                val
+            }
+
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn store(&self, val: $int_type, order: Ordering) {
+                crate::utils::assert_store_ordering(order);
+                let guard = lock(self.v.get() as usize).write();
+                self.write(val, &guard)
+            }
+
+            #[inline]
+            pub(crate) fn swap(&self, val: $int_type, _order: Ordering) -> $int_type {
+                let guard = lock(self.v.get() as usize).write();
+                let prev = self.read(&guard);
+                self.write(val, &guard);
+                prev
+            }
+
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn compare_exchange(
+                &self,
+                current: $int_type,
+                new: $int_type,
+                success: Ordering,
+                failure: Ordering,
+            ) -> Result<$int_type, $int_type> {
+                crate::utils::assert_compare_exchange_ordering(success, failure);
+                let guard = lock(self.v.get() as usize).write();
+                let prev = self.read(&guard);
+                if prev == current {
+                    self.write(new, &guard);
+                    Ok(prev)
+                } else {
+                    // The value hasn't been changed. Drop the guard without incrementing the stamp.
+                    guard.abort();
+                    Err(prev)
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn compare_exchange_weak(
+                &self,
+                current: $int_type,
+                new: $int_type,
+                success: Ordering,
+                failure: Ordering,
+            ) -> Result<$int_type, $int_type> {
+                self.compare_exchange(current, new, success, failure)
+            }
+
+            #[inline]
+            pub(crate) fn fetch_add(&self, val: $int_type, _order: Ordering) -> $int_type {
+                let guard = lock(self.v.get() as usize).write();
+                let prev = self.read(&guard);
+                self.write(prev.wrapping_add(val), &guard);
+                prev
+            }
+
+            #[inline]
+            pub(crate) fn fetch_sub(&self, val: $int_type, _order: Ordering) -> $int_type {
+                let guard = lock(self.v.get() as usize).write();
+                let prev = self.read(&guard);
+                self.write(prev.wrapping_sub(val), &guard);
+                prev
+            }
+
+            #[inline]
+            pub(crate) fn fetch_and(&self, val: $int_type, _order: Ordering) -> $int_type {
+                let guard = lock(self.v.get() as usize).write();
+                let prev = self.read(&guard);
+                self.write(prev & val, &guard);
+                prev
+            }
+
+            #[inline]
+            pub(crate) fn fetch_nand(&self, val: $int_type, _order: Ordering) -> $int_type {
+                let guard = lock(self.v.get() as usize).write();
+                let prev = self.read(&guard);
+                self.write(!(prev & val), &guard);
+                prev
+            }
+
+            #[inline]
+            pub(crate) fn fetch_or(&self, val: $int_type, _order: Ordering) -> $int_type {
+                let guard = lock(self.v.get() as usize).write();
+                let prev = self.read(&guard);
+                self.write(prev | val, &guard);
+                prev
+            }
+
+            #[inline]
+            pub(crate) fn fetch_xor(&self, val: $int_type, _order: Ordering) -> $int_type {
+                let guard = lock(self.v.get() as usize).write();
+                let prev = self.read(&guard);
+                self.write(prev ^ val, &guard);
+                prev
+            }
+
+            #[inline]
+            pub(crate) fn fetch_max(&self, val: $int_type, _order: Ordering) -> $int_type {
+                let guard = lock(self.v.get() as usize).write();
+                let prev = self.read(&guard);
+                self.write(core::cmp::max(prev, val), &guard);
+                prev
+            }
+
+            #[inline]
+            pub(crate) fn fetch_min(&self, val: $int_type, _order: Ordering) -> $int_type {
+                let guard = lock(self.v.get() as usize).write();
+                let prev = self.read(&guard);
+                self.write(core::cmp::min(prev, val), &guard);
+                prev
+            }
+
+            #[inline]
+            pub(crate) fn fetch_not(&self, _order: Ordering) -> $int_type {
+                let guard = lock(self.v.get() as usize).write();
+                let prev = self.read(&guard);
+                self.write(!prev, &guard);
+                prev
+            }
+            #[inline]
+            pub(crate) fn not(&self, order: Ordering) {
+                self.fetch_not(order);
+            }
+
+            #[inline]
+            pub(crate) fn fetch_neg(&self, _order: Ordering) -> $int_type {
+                let guard = lock(self.v.get() as usize).write();
+                let prev = self.read(&guard);
+                self.write(prev.wrapping_neg(), &guard);
+                prev
+            }
+            #[inline]
+            pub(crate) fn neg(&self, order: Ordering) {
+                self.fetch_neg(order);
+            }
+
+            #[inline]
+            pub(crate) const fn as_ptr(&self) -> *mut $int_type {
+                self.v.get()
+            }
+        }
+    };
+}
+
+#[cfg_attr(portable_atomic_no_cfg_target_has_atomic, cfg(any(test, portable_atomic_no_atomic_64)))]
+#[cfg_attr(
+    not(portable_atomic_no_cfg_target_has_atomic),
+    cfg(any(test, not(target_has_atomic = "64")))
+)]
+cfg_no_fast_atomic_64! {
+    atomic!(AtomicI64, i64, 8);
+    atomic!(AtomicU64, u64, 8);
+}
+
+atomic!(AtomicI128, i128, 16);
+atomic!(AtomicU128, u128, 16);
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    cfg_no_fast_atomic_64! {
+        test_atomic_int!(i64);
+        test_atomic_int!(u64);
+    }
+    test_atomic_int!(i128);
+    test_atomic_int!(u128);
+
+    // load/store/swap implementation is not affected by signedness, so it is
+    // enough to test only unsigned types.
+    cfg_no_fast_atomic_64! {
+        stress_test!(u64);
+    }
+    stress_test!(u128);
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/fallback/outline_atomics.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/fallback/outline_atomics.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/fallback/outline_atomics.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/fallback/outline_atomics.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,177 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Helper for outline-atomics.
+//
+// On architectures where DW atomics are not supported on older CPUs, we use
+// fallback implementation when DW atomic instructions are not supported and
+// outline-atomics is enabled.
+//
+// This module provides helpers to implement them.
+
+use core::sync::atomic::Ordering;
+
+#[cfg(any(target_arch = "x86_64", target_arch = "powerpc64"))]
+pub(crate) type Udw = u128;
+#[cfg(any(target_arch = "x86_64", target_arch = "powerpc64"))]
+pub(crate) type AtomicUdw = super::super::fallback::AtomicU128;
+#[cfg(any(target_arch = "x86_64", target_arch = "powerpc64"))]
+pub(crate) type AtomicIdw = super::super::fallback::AtomicI128;
+
+#[cfg(target_arch = "arm")]
+pub(crate) type Udw = u64;
+#[cfg(target_arch = "arm")]
+pub(crate) type AtomicUdw = super::super::fallback::AtomicU64;
+#[cfg(target_arch = "arm")]
+pub(crate) type AtomicIdw = super::super::fallback::AtomicI64;
+
+// Asserts that the function is called in the correct context.
+macro_rules! debug_assert_outline_atomics {
+    () => {
+        #[cfg(target_arch = "x86_64")]
+        {
+            debug_assert!(!super::detect::detect().has_cmpxchg16b());
+        }
+        #[cfg(target_arch = "powerpc64")]
+        {
+            debug_assert!(!super::detect::detect().has_quadword_atomics());
+        }
+        #[cfg(target_arch = "arm")]
+        {
+            debug_assert!(!super::has_kuser_cmpxchg64());
+        }
+    };
+}
+
+#[cold]
+pub(crate) unsafe fn atomic_load(src: *mut Udw, order: Ordering) -> Udw {
+    debug_assert_outline_atomics!();
+    #[allow(clippy::cast_ptr_alignment)]
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        (*(src as *const AtomicUdw)).load(order)
+    }
+}
+fn_alias! {
+    #[cold]
+    pub(crate) unsafe fn(src: *mut Udw) -> Udw;
+    // fallback's atomic load has at least acquire semantics.
+    #[cfg(not(any(target_arch = "arm", target_arch = "x86_64")))]
+    atomic_load_non_seqcst = atomic_load(Ordering::Acquire);
+    atomic_load_seqcst = atomic_load(Ordering::SeqCst);
+}
+
+#[cold]
+pub(crate) unsafe fn atomic_store(dst: *mut Udw, val: Udw, order: Ordering) {
+    debug_assert_outline_atomics!();
+    #[allow(clippy::cast_ptr_alignment)]
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        (*(dst as *const AtomicUdw)).store(val, order);
+    }
+}
+fn_alias! {
+    #[cold]
+    pub(crate) unsafe fn(dst: *mut Udw, val: Udw);
+    // fallback's atomic store has at least release semantics.
+    #[cfg(not(target_arch = "arm"))]
+    atomic_store_non_seqcst = atomic_store(Ordering::Release);
+    atomic_store_seqcst = atomic_store(Ordering::SeqCst);
+}
+
+#[cold]
+pub(crate) unsafe fn atomic_compare_exchange(
+    dst: *mut Udw,
+    old: Udw,
+    new: Udw,
+    success: Ordering,
+    failure: Ordering,
+) -> (Udw, bool) {
+    debug_assert_outline_atomics!();
+    #[allow(clippy::cast_ptr_alignment)]
+    // SAFETY: the caller must uphold the safety contract.
+    unsafe {
+        match (*(dst as *const AtomicUdw)).compare_exchange(old, new, success, failure) {
+            Ok(v) => (v, true),
+            Err(v) => (v, false),
+        }
+    }
+}
+fn_alias! {
+    #[cold]
+    pub(crate) unsafe fn(dst: *mut Udw, old: Udw, new: Udw) -> (Udw, bool);
+    // fallback's atomic CAS has at least AcqRel semantics.
+    #[cfg(not(any(target_arch = "arm", target_arch = "x86_64")))]
+    atomic_compare_exchange_non_seqcst
+        = atomic_compare_exchange(Ordering::AcqRel, Ordering::Acquire);
+    atomic_compare_exchange_seqcst
+        = atomic_compare_exchange(Ordering::SeqCst, Ordering::SeqCst);
+}
+
+macro_rules! atomic_rmw_3 {
+    (
+        $name:ident($atomic_type:ident::$method_name:ident),
+        $non_seqcst_alias:ident, $seqcst_alias:ident
+    ) => {
+        #[cold]
+        pub(crate) unsafe fn $name(dst: *mut Udw, val: Udw, order: Ordering) -> Udw {
+            debug_assert_outline_atomics!();
+            #[allow(
+                clippy::as_underscore,
+                clippy::cast_possible_wrap,
+                clippy::cast_ptr_alignment,
+                clippy::cast_sign_loss
+            )]
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe {
+                (*(dst as *const $atomic_type)).$method_name(val as _, order) as Udw
+            }
+        }
+        fn_alias! {
+            #[cold]
+            pub(crate) unsafe fn(dst: *mut Udw, val: Udw) -> Udw;
+            // fallback's atomic RMW has at least AcqRel semantics.
+            #[cfg(not(any(target_arch = "arm", target_arch = "x86_64")))]
+            $non_seqcst_alias = $name(Ordering::AcqRel);
+            $seqcst_alias = $name(Ordering::SeqCst);
+        }
+    };
+}
+macro_rules! atomic_rmw_2 {
+    (
+        $name:ident($atomic_type:ident::$method_name:ident),
+        $non_seqcst_alias:ident, $seqcst_alias:ident
+    ) => {
+        #[cold]
+        pub(crate) unsafe fn $name(dst: *mut Udw, order: Ordering) -> Udw {
+            debug_assert_outline_atomics!();
+            #[allow(clippy::cast_ptr_alignment)]
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe {
+                (*(dst as *const $atomic_type)).$method_name(order) as Udw
+            }
+        }
+        fn_alias! {
+            #[cold]
+            pub(crate) unsafe fn(dst: *mut Udw) -> Udw;
+            // fallback's atomic RMW has at least AcqRel semantics.
+            #[cfg(not(any(target_arch = "arm", target_arch = "x86_64")))]
+            $non_seqcst_alias = $name(Ordering::AcqRel);
+            $seqcst_alias = $name(Ordering::SeqCst);
+        }
+    };
+}
+
+atomic_rmw_3!(atomic_swap(AtomicUdw::swap), atomic_swap_non_seqcst, atomic_swap_seqcst);
+atomic_rmw_3!(atomic_add(AtomicUdw::fetch_add), atomic_add_non_seqcst, atomic_add_seqcst);
+atomic_rmw_3!(atomic_sub(AtomicUdw::fetch_sub), atomic_sub_non_seqcst, atomic_sub_seqcst);
+atomic_rmw_3!(atomic_and(AtomicUdw::fetch_and), atomic_and_non_seqcst, atomic_and_seqcst);
+atomic_rmw_3!(atomic_nand(AtomicUdw::fetch_nand), atomic_nand_non_seqcst, atomic_nand_seqcst);
+atomic_rmw_3!(atomic_or(AtomicUdw::fetch_or), atomic_or_non_seqcst, atomic_or_seqcst);
+atomic_rmw_3!(atomic_xor(AtomicUdw::fetch_xor), atomic_xor_non_seqcst, atomic_xor_seqcst);
+atomic_rmw_3!(atomic_max(AtomicIdw::fetch_max), atomic_max_non_seqcst, atomic_max_seqcst);
+atomic_rmw_3!(atomic_umax(AtomicUdw::fetch_max), atomic_umax_non_seqcst, atomic_umax_seqcst);
+atomic_rmw_3!(atomic_min(AtomicIdw::fetch_min), atomic_min_non_seqcst, atomic_min_seqcst);
+atomic_rmw_3!(atomic_umin(AtomicUdw::fetch_min), atomic_umin_non_seqcst, atomic_umin_seqcst);
+
+atomic_rmw_2!(atomic_not(AtomicUdw::fetch_not), atomic_not_non_seqcst, atomic_not_seqcst);
+atomic_rmw_2!(atomic_neg(AtomicUdw::fetch_neg), atomic_neg_non_seqcst, atomic_neg_seqcst);
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/fallback/seq_lock.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/fallback/seq_lock.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/fallback/seq_lock.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/fallback/seq_lock.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,147 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Adapted from https://github.com/crossbeam-rs/crossbeam/blob/crossbeam-utils-0.8.7/crossbeam-utils/src/atomic/seq_lock.rs.
+
+use core::{
+    mem::ManuallyDrop,
+    sync::atomic::{self, Ordering},
+};
+
+use super::utils::Backoff;
+
+// See mod.rs for details.
+#[cfg(any(target_pointer_width = "16", target_pointer_width = "32"))]
+pub(super) use core::sync::atomic::AtomicU64 as AtomicStamp;
+#[cfg(not(any(target_pointer_width = "16", target_pointer_width = "32")))]
+pub(super) use core::sync::atomic::AtomicUsize as AtomicStamp;
+#[cfg(not(any(target_pointer_width = "16", target_pointer_width = "32")))]
+pub(super) type Stamp = usize;
+#[cfg(any(target_pointer_width = "16", target_pointer_width = "32"))]
+pub(super) type Stamp = u64;
+
+// See mod.rs for details.
+pub(super) type AtomicChunk = AtomicStamp;
+pub(super) type Chunk = Stamp;
+
+/// A simple stamped lock.
+pub(super) struct SeqLock {
+    /// The current state of the lock.
+    ///
+    /// All bits except the least significant one hold the current stamp. When locked, the state
+    /// equals 1 and doesn't contain a valid stamp.
+    state: AtomicStamp,
+}
+
+impl SeqLock {
+    #[inline]
+    pub(super) const fn new() -> Self {
+        Self { state: AtomicStamp::new(0) }
+    }
+
+    /// If not locked, returns the current stamp.
+    ///
+    /// This method should be called before optimistic reads.
+    #[inline]
+    pub(super) fn optimistic_read(&self) -> Option<Stamp> {
+        let state = self.state.load(Ordering::Acquire);
+        if state == 1 {
+            None
+        } else {
+            Some(state)
+        }
+    }
+
+    /// Returns `true` if the current stamp is equal to `stamp`.
+    ///
+    /// This method should be called after optimistic reads to check whether they are valid. The
+    /// argument `stamp` should correspond to the one returned by method `optimistic_read`.
+    #[inline]
+    pub(super) fn validate_read(&self, stamp: Stamp) -> bool {
+        atomic::fence(Ordering::Acquire);
+        self.state.load(Ordering::Relaxed) == stamp
+    }
+
+    /// Grabs the lock for writing.
+    #[inline]
+    pub(super) fn write(&self) -> SeqLockWriteGuard<'_> {
+        let mut backoff = Backoff::new();
+        loop {
+            let previous = self.state.swap(1, Ordering::Acquire);
+
+            if previous != 1 {
+                atomic::fence(Ordering::Release);
+
+                return SeqLockWriteGuard { lock: self, state: previous };
+            }
+
+            while self.state.load(Ordering::Relaxed) == 1 {
+                backoff.snooze();
+            }
+        }
+    }
+}
+
+/// An RAII guard that releases the lock and increments the stamp when dropped.
+#[must_use]
+pub(super) struct SeqLockWriteGuard<'a> {
+    /// The parent lock.
+    lock: &'a SeqLock,
+
+    /// The stamp before locking.
+    state: Stamp,
+}
+
+impl SeqLockWriteGuard<'_> {
+    /// Releases the lock without incrementing the stamp.
+    #[inline]
+    pub(super) fn abort(self) {
+        // We specifically don't want to call drop(), since that's
+        // what increments the stamp.
+        let this = ManuallyDrop::new(self);
+
+        // Restore the stamp.
+        //
+        // Release ordering for synchronizing with `optimistic_read`.
+        this.lock.state.store(this.state, Ordering::Release);
+    }
+}
+
+impl Drop for SeqLockWriteGuard<'_> {
+    #[inline]
+    fn drop(&mut self) {
+        // Release the lock and increment the stamp.
+        //
+        // Release ordering for synchronizing with `optimistic_read`.
+        self.lock.state.store(self.state.wrapping_add(2), Ordering::Release);
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::SeqLock;
+
+    #[test]
+    fn smoke() {
+        let lock = SeqLock::new();
+        let before = lock.optimistic_read().unwrap();
+        assert!(lock.validate_read(before));
+        {
+            let _guard = lock.write();
+        }
+        assert!(!lock.validate_read(before));
+        let after = lock.optimistic_read().unwrap();
+        assert_ne!(before, after);
+    }
+
+    #[test]
+    fn test_abort() {
+        let lock = SeqLock::new();
+        let before = lock.optimistic_read().unwrap();
+        {
+            let guard = lock.write();
+            guard.abort();
+        }
+        let after = lock.optimistic_read().unwrap();
+        assert_eq!(before, after, "aborted write does not update the stamp");
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/fallback/seq_lock_wide.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/fallback/seq_lock_wide.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/fallback/seq_lock_wide.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/fallback/seq_lock_wide.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,180 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Adapted from https://github.com/crossbeam-rs/crossbeam/blob/crossbeam-utils-0.8.7/crossbeam-utils/src/atomic/seq_lock_wide.rs.
+
+use core::{
+    mem::ManuallyDrop,
+    sync::atomic::{self, AtomicUsize, Ordering},
+};
+
+use super::utils::Backoff;
+
+// See mod.rs for details.
+pub(super) type AtomicChunk = AtomicUsize;
+pub(super) type Chunk = usize;
+
+/// A simple stamped lock.
+///
+/// The state is represented as two `AtomicUsize`: `state_hi` for high bits and `state_lo` for low
+/// bits.
+pub(super) struct SeqLock {
+    /// The high bits of the current state of the lock.
+    state_hi: AtomicUsize,
+
+    /// The low bits of the current state of the lock.
+    ///
+    /// All bits except the least significant one hold the current stamp. When locked, the state_lo
+    /// equals 1 and doesn't contain a valid stamp.
+    state_lo: AtomicUsize,
+}
+
+impl SeqLock {
+    #[inline]
+    pub(super) const fn new() -> Self {
+        Self { state_hi: AtomicUsize::new(0), state_lo: AtomicUsize::new(0) }
+    }
+
+    /// If not locked, returns the current stamp.
+    ///
+    /// This method should be called before optimistic reads.
+    #[inline]
+    pub(super) fn optimistic_read(&self) -> Option<(usize, usize)> {
+        // The acquire loads from `state_hi` and `state_lo` synchronize with the release stores in
+        // `SeqLockWriteGuard::drop` and `SeqLockWriteGuard::abort`.
+        //
+        // As a consequence, we can make sure that (1) all writes within the era of `state_hi - 1`
+        // happens before now; and therefore, (2) if `state_lo` is even, all writes within the
+        // critical section of (`state_hi`, `state_lo`) happens before now.
+        let state_hi = self.state_hi.load(Ordering::Acquire);
+        let state_lo = self.state_lo.load(Ordering::Acquire);
+        if state_lo == 1 {
+            None
+        } else {
+            Some((state_hi, state_lo))
+        }
+    }
+
+    /// Returns `true` if the current stamp is equal to `stamp`.
+    ///
+    /// This method should be called after optimistic reads to check whether they are valid. The
+    /// argument `stamp` should correspond to the one returned by method `optimistic_read`.
+    #[inline]
+    pub(super) fn validate_read(&self, stamp: (usize, usize)) -> bool {
+        // Thanks to the fence, if we're noticing any modification to the data at the critical
+        // section of `(stamp.0, stamp.1)`, then the critical section's write of 1 to state_lo should be
+        // visible.
+        atomic::fence(Ordering::Acquire);
+
+        // So if `state_lo` coincides with `stamp.1`, then either (1) we're noticing no modification
+        // to the data after the critical section of `(stamp.0, stamp.1)`, or (2) `state_lo` wrapped
+        // around.
+        //
+        // If (2) is the case, the acquire ordering ensures we see the new value of `state_hi`.
+        let state_lo = self.state_lo.load(Ordering::Acquire);
+
+        // If (2) is the case and `state_hi` coincides with `stamp.0`, then `state_hi` also wrapped
+        // around, which we give up to correctly validate the read.
+        let state_hi = self.state_hi.load(Ordering::Relaxed);
+
+        // Except for the case that both `state_hi` and `state_lo` wrapped around, the following
+        // condition implies that we're noticing no modification to the data after the critical
+        // section of `(stamp.0, stamp.1)`.
+        (state_hi, state_lo) == stamp
+    }
+
+    /// Grabs the lock for writing.
+    #[inline]
+    pub(super) fn write(&self) -> SeqLockWriteGuard<'_> {
+        let mut backoff = Backoff::new();
+        loop {
+            let previous = self.state_lo.swap(1, Ordering::Acquire);
+
+            if previous != 1 {
+                // To synchronize with the acquire fence in `validate_read` via any modification to
+                // the data at the critical section of `(state_hi, previous)`.
+                atomic::fence(Ordering::Release);
+
+                return SeqLockWriteGuard { lock: self, state_lo: previous };
+            }
+
+            while self.state_lo.load(Ordering::Relaxed) == 1 {
+                backoff.snooze();
+            }
+        }
+    }
+}
+
+/// An RAII guard that releases the lock and increments the stamp when dropped.
+#[must_use]
+pub(super) struct SeqLockWriteGuard<'a> {
+    /// The parent lock.
+    lock: &'a SeqLock,
+
+    /// The stamp before locking.
+    state_lo: usize,
+}
+
+impl SeqLockWriteGuard<'_> {
+    /// Releases the lock without incrementing the stamp.
+    #[inline]
+    pub(super) fn abort(self) {
+        // We specifically don't want to call drop(), since that's
+        // what increments the stamp.
+        let this = ManuallyDrop::new(self);
+
+        // Restore the stamp.
+        //
+        // Release ordering for synchronizing with `optimistic_read`.
+        this.lock.state_lo.store(this.state_lo, Ordering::Release);
+    }
+}
+
+impl Drop for SeqLockWriteGuard<'_> {
+    #[inline]
+    fn drop(&mut self) {
+        let state_lo = self.state_lo.wrapping_add(2);
+
+        // Increase the high bits if the low bits wrap around.
+        //
+        // Release ordering for synchronizing with `optimistic_read`.
+        if state_lo == 0 {
+            let state_hi = self.lock.state_hi.load(Ordering::Relaxed);
+            self.lock.state_hi.store(state_hi.wrapping_add(1), Ordering::Release);
+        }
+
+        // Release the lock and increment the stamp.
+        //
+        // Release ordering for synchronizing with `optimistic_read`.
+        self.lock.state_lo.store(state_lo, Ordering::Release);
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::SeqLock;
+
+    #[test]
+    fn smoke() {
+        let lock = SeqLock::new();
+        let before = lock.optimistic_read().unwrap();
+        assert!(lock.validate_read(before));
+        {
+            let _guard = lock.write();
+        }
+        assert!(!lock.validate_read(before));
+        let after = lock.optimistic_read().unwrap();
+        assert_ne!(before, after);
+    }
+
+    #[test]
+    fn test_abort() {
+        let lock = SeqLock::new();
+        let before = lock.optimistic_read().unwrap();
+        {
+            let guard = lock.write();
+            guard.abort();
+        }
+        let after = lock.optimistic_read().unwrap();
+        assert_eq!(before, after, "aborted write does not update the stamp");
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/fallback/utils.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/fallback/utils.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/fallback/utils.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/fallback/utils.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,141 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+use core::ops;
+
+// Adapted from https://github.com/crossbeam-rs/crossbeam/blob/9384f1eb2b356364e201ad38545e03c837d55f3a/crossbeam-utils/src/cache_padded.rs.
+/// Pads and aligns a value to the length of a cache line.
+// Starting from Intel's Sandy Bridge, spatial prefetcher is now pulling pairs of 64-byte cache
+// lines at a time, so we have to align to 128 bytes rather than 64.
+//
+// Sources:
+// - https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-optimization-manual.pdf
+// - https://github.com/facebook/folly/blob/1b5288e6eea6df074758f877c849b6e73bbb9fbb/folly/lang/Align.h#L107
+//
+// ARM's big.LITTLE architecture has asymmetric cores and "big" cores have 128-byte cache line size.
+//
+// Sources:
+// - https://www.mono-project.com/news/2016/09/12/arm64-icache/
+//
+// powerpc64 has 128-byte cache line size.
+//
+// Sources:
+// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_ppc64x.go#L9
+// - https://github.com/torvalds/linux/blob/3516bd729358a2a9b090c1905bd2a3fa926e24c6/arch/powerpc/include/asm/cache.h#L26
+#[cfg_attr(
+    any(target_arch = "x86_64", target_arch = "aarch64", target_arch = "powerpc64"),
+    repr(align(128))
+)]
+// arm, mips, mips64, sparc, and hexagon have 32-byte cache line size.
+//
+// Sources:
+// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_arm.go#L7
+// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mips.go#L7
+// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mipsle.go#L7
+// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mips64x.go#L9
+// - https://github.com/torvalds/linux/blob/3516bd729358a2a9b090c1905bd2a3fa926e24c6/arch/sparc/include/asm/cache.h#L17
+// - https://github.com/torvalds/linux/blob/3516bd729358a2a9b090c1905bd2a3fa926e24c6/arch/hexagon/include/asm/cache.h#L12
+#[cfg_attr(
+    any(
+        target_arch = "arm",
+        target_arch = "mips",
+        target_arch = "mips32r6",
+        target_arch = "mips64",
+        target_arch = "mips64r6",
+        target_arch = "sparc",
+        target_arch = "hexagon",
+    ),
+    repr(align(32))
+)]
+// m68k has 16-byte cache line size.
+//
+// Sources:
+// - https://github.com/torvalds/linux/blob/3516bd729358a2a9b090c1905bd2a3fa926e24c6/arch/m68k/include/asm/cache.h#L9
+#[cfg_attr(target_arch = "m68k", repr(align(16)))]
+// s390x has 256-byte cache line size.
+//
+// Sources:
+// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_s390x.go#L7
+// - https://github.com/torvalds/linux/blob/3516bd729358a2a9b090c1905bd2a3fa926e24c6/arch/s390/include/asm/cache.h#L13
+#[cfg_attr(target_arch = "s390x", repr(align(256)))]
+// x86, wasm, riscv, and sparc64 have 64-byte cache line size.
+//
+// Sources:
+// - https://github.com/golang/go/blob/dda2991c2ea0c5914714469c4defc2562a907230/src/internal/cpu/cpu_x86.go#L9
+// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_wasm.go#L7
+// - https://github.com/torvalds/linux/blob/3516bd729358a2a9b090c1905bd2a3fa926e24c6/arch/riscv/include/asm/cache.h#L10
+// - https://github.com/torvalds/linux/blob/3516bd729358a2a9b090c1905bd2a3fa926e24c6/arch/sparc/include/asm/cache.h#L19
+//
+// All others are assumed to have 64-byte cache line size.
+#[cfg_attr(
+    not(any(
+        target_arch = "x86_64",
+        target_arch = "aarch64",
+        target_arch = "powerpc64",
+        target_arch = "arm",
+        target_arch = "mips",
+        target_arch = "mips32r6",
+        target_arch = "mips64",
+        target_arch = "mips64r6",
+        target_arch = "sparc",
+        target_arch = "hexagon",
+        target_arch = "m68k",
+        target_arch = "s390x",
+    )),
+    repr(align(64))
+)]
+pub(crate) struct CachePadded<T> {
+    value: T,
+}
+
+impl<T> CachePadded<T> {
+    #[inline]
+    pub(crate) const fn new(value: T) -> Self {
+        Self { value }
+    }
+}
+
+impl<T> ops::Deref for CachePadded<T> {
+    type Target = T;
+
+    #[inline]
+    fn deref(&self) -> &Self::Target {
+        &self.value
+    }
+}
+
+// Adapted from https://github.com/crossbeam-rs/crossbeam/blob/crossbeam-utils-0.8.7/crossbeam-utils/src/backoff.rs.
+// Adjusted to reduce spinning.
+/// Performs exponential backoff in spin loops.
+pub(crate) struct Backoff {
+    step: u32,
+}
+
+// https://github.com/oneapi-src/oneTBB/blob/v2021.5.0/include/oneapi/tbb/detail/_utils.h#L46-L48
+const SPIN_LIMIT: u32 = 4;
+
+impl Backoff {
+    #[inline]
+    pub(crate) const fn new() -> Self {
+        Self { step: 0 }
+    }
+
+    #[inline]
+    pub(crate) fn snooze(&mut self) {
+        if self.step <= SPIN_LIMIT {
+            for _ in 0..1 << self.step {
+                #[allow(deprecated)]
+                core::sync::atomic::spin_loop_hint();
+            }
+            self.step += 1;
+        } else {
+            #[cfg(not(feature = "std"))]
+            for _ in 0..1 << self.step {
+                #[allow(deprecated)]
+                core::sync::atomic::spin_loop_hint();
+            }
+
+            #[cfg(feature = "std")]
+            std::thread::yield_now();
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/float.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/float.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/float.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/float.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,212 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// AtomicF{32,64} implementation based on AtomicU{32,64}.
+//
+// This module provides atomic float implementations using atomic integer.
+//
+// Note that most of `fetch_*` operations of atomic floats are implemented using
+// CAS loops, which can be slower than equivalent operations of atomic integers.
+//
+// GPU targets have atomic instructions for float, so GPU targets will use
+// architecture-specific implementations instead of this implementation in the
+// future: https://github.com/taiki-e/portable-atomic/issues/34
+//
+// TODO: fetch_{minimum,maximum}* https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3008r2.html
+
+#![cfg_attr(
+    all(target_pointer_width = "16", not(feature = "fallback")),
+    allow(unused_imports, unused_macros)
+)]
+
+use core::{cell::UnsafeCell, sync::atomic::Ordering};
+
+macro_rules! atomic_float {
+    (
+        $atomic_type:ident, $float_type:ident, $atomic_int_type:ident, $int_type:ident,
+        $align:literal
+    ) => {
+        #[repr(C, align($align))]
+        pub(crate) struct $atomic_type {
+            v: UnsafeCell<$float_type>,
+        }
+
+        // Send is implicitly implemented.
+        // SAFETY: any data races are prevented by atomic operations.
+        unsafe impl Sync for $atomic_type {}
+
+        impl $atomic_type {
+            #[inline]
+            pub(crate) const fn new(v: $float_type) -> Self {
+                Self { v: UnsafeCell::new(v) }
+            }
+
+            #[inline]
+            pub(crate) fn is_lock_free() -> bool {
+                crate::$atomic_int_type::is_lock_free()
+            }
+            #[inline]
+            pub(crate) const fn is_always_lock_free() -> bool {
+                crate::$atomic_int_type::is_always_lock_free()
+            }
+
+            #[inline]
+            pub(crate) fn get_mut(&mut self) -> &mut $float_type {
+                // SAFETY: the mutable reference guarantees unique ownership.
+                // (UnsafeCell::get_mut requires Rust 1.50)
+                unsafe { &mut *self.v.get() }
+            }
+
+            #[inline]
+            #[cfg_attr(
+                any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                track_caller
+            )]
+            pub(crate) fn load(&self, order: Ordering) -> $float_type {
+                $float_type::from_bits(self.as_bits().load(order))
+            }
+
+            #[inline]
+            #[cfg_attr(
+                any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                track_caller
+            )]
+            pub(crate) fn store(&self, val: $float_type, order: Ordering) {
+                self.as_bits().store(val.to_bits(), order)
+            }
+
+            const_fn! {
+                const_if: #[cfg(not(portable_atomic_no_const_raw_ptr_deref))];
+                #[inline]
+                pub(crate) const fn as_bits(&self) -> &crate::$atomic_int_type {
+                    // SAFETY: $atomic_type and $atomic_int_type have the same layout,
+                    // and there is no concurrent access to the value that does not go through this method.
+                    unsafe { &*(self as *const Self as *const crate::$atomic_int_type) }
+                }
+            }
+
+            #[inline]
+            pub(crate) const fn as_ptr(&self) -> *mut $float_type {
+                self.v.get()
+            }
+        }
+
+        cfg_has_atomic_cas! {
+        impl $atomic_type {
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn swap(&self, val: $float_type, order: Ordering) -> $float_type {
+                $float_type::from_bits(self.as_bits().swap(val.to_bits(), order))
+            }
+
+            #[inline]
+            #[cfg_attr(
+                any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                track_caller
+            )]
+            pub(crate) fn compare_exchange(
+                &self,
+                current: $float_type,
+                new: $float_type,
+                success: Ordering,
+                failure: Ordering,
+            ) -> Result<$float_type, $float_type> {
+                match self.as_bits().compare_exchange(
+                    current.to_bits(),
+                    new.to_bits(),
+                    success,
+                    failure,
+                ) {
+                    Ok(v) => Ok($float_type::from_bits(v)),
+                    Err(v) => Err($float_type::from_bits(v)),
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(
+                any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                track_caller
+            )]
+            pub(crate) fn compare_exchange_weak(
+                &self,
+                current: $float_type,
+                new: $float_type,
+                success: Ordering,
+                failure: Ordering,
+            ) -> Result<$float_type, $float_type> {
+                match self.as_bits().compare_exchange_weak(
+                    current.to_bits(),
+                    new.to_bits(),
+                    success,
+                    failure,
+                ) {
+                    Ok(v) => Ok($float_type::from_bits(v)),
+                    Err(v) => Err($float_type::from_bits(v)),
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn fetch_add(&self, val: $float_type, order: Ordering) -> $float_type {
+                self.fetch_update_(order, |x| x + val)
+            }
+
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn fetch_sub(&self, val: $float_type, order: Ordering) -> $float_type {
+                self.fetch_update_(order, |x| x - val)
+            }
+
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            fn fetch_update_<F>(&self, order: Ordering, mut f: F) -> $float_type
+            where
+                F: FnMut($float_type) -> $float_type,
+            {
+                // This is a private function and all instances of `f` only operate on the value
+                // loaded, so there is no need to synchronize the first load/failed CAS.
+                let mut prev = self.load(Ordering::Relaxed);
+                loop {
+                    let next = f(prev);
+                    match self.compare_exchange_weak(prev, next, order, Ordering::Relaxed) {
+                        Ok(x) => return x,
+                        Err(next_prev) => prev = next_prev,
+                    }
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn fetch_max(&self, val: $float_type, order: Ordering) -> $float_type {
+                self.fetch_update_(order, |x| x.max(val))
+            }
+
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn fetch_min(&self, val: $float_type, order: Ordering) -> $float_type {
+                self.fetch_update_(order, |x| x.min(val))
+            }
+
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn fetch_neg(&self, order: Ordering) -> $float_type {
+                const NEG_MASK: $int_type = !0 / 2 + 1;
+                $float_type::from_bits(self.as_bits().fetch_xor(NEG_MASK, order))
+            }
+
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn fetch_abs(&self, order: Ordering) -> $float_type {
+                const ABS_MASK: $int_type = !0 / 2;
+                $float_type::from_bits(self.as_bits().fetch_and(ABS_MASK, order))
+            }
+        }
+        } // cfg_has_atomic_cas!
+    };
+}
+
+cfg_has_atomic_32! {
+    atomic_float!(AtomicF32, f32, AtomicU32, u32, 4);
+}
+cfg_has_atomic_64! {
+    atomic_float!(AtomicF64, f64, AtomicU64, u64, 8);
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/interrupt/README.md 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/interrupt/README.md
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/interrupt/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/interrupt/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,27 @@
+# Implementation of disabling interrupts
+
+This module is used to provide atomic CAS for targets where atomic CAS is not available in the standard library.
+
+- On MSP430 and AVR, they are always single-core, so this module is always used.
+- On ARMv6-M (thumbv6m), pre-v6 ARM (e.g., thumbv4t, thumbv5te), RISC-V without A-extension, and Xtensa, they could be multi-core, so this module is used when the `unsafe-assume-single-core` feature is enabled.
+
+The implementation uses privileged instructions to disable interrupts, so it usually doesn't work on unprivileged mode.
+Enabling this feature in an environment where privileged instructions are not available, or if the instructions used are not sufficient to disable interrupts in the system, it is also usually considered **unsound**, although the details are system-dependent.
+
+Consider using the [`critical-section` feature](../../../README.md#optional-features-critical-section) for systems that cannot use the `unsafe-assume-single-core` feature.
+
+For some targets, the implementation can be changed by explicitly enabling features.
+
+- On ARMv6-M, this disables interrupts by modifying the PRIMASK register.
+- On pre-v6 ARM, this disables interrupts by modifying the I (IRQ mask) bit of the CPSR.
+- On pre-v6 ARM with the `disable-fiq` feature, this disables interrupts by modifying the I (IRQ mask) bit and F (FIQ mask) bit of the CPSR.
+- On RISC-V (without A-extension), this disables interrupts by modifying the MIE (Machine Interrupt Enable) bit of the `mstatus` register.
+- On RISC-V (without A-extension) with the `s-mode` feature, this disables interrupts by modifying the SIE (Supervisor Interrupt Enable) bit of the `sstatus` register.
+- On RISC-V (without A-extension) with the `force-amo` feature, this uses AMO instructions for RMWs that have corresponding AMO instructions even if A-extension is disabled. For other RMWs, this disables interrupts as usual.
+- On MSP430, this disables interrupts by modifying the GIE (Global Interrupt Enable) bit of the status register (SR).
+- On AVR, this disables interrupts by modifying the I (Global Interrupt Enable) bit of the status register (SREG).
+- On Xtensa, this disables interrupts by modifying the PS special register.
+
+Some operations don't require disabling interrupts (loads and stores on targets except for AVR, but additionally on MSP430 {8,16}-bit `add,sub,and,or,xor,not`, on RISC-V with the `force-amo` feature 32-bit(RV32)/{32,64}-bit(RV64) `swap,fetch_{add,sub,and,or,xor,not,max,min},add,sub,and,or,xor,not` and {8,16}-bit `fetch_{and,or,xor,not},and,or,xor,not`). However, when the `critical-section` feature is enabled, critical sections are taken for all atomic operations.
+
+Feel free to submit an issue if your target is not supported yet.
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/interrupt/armv4t.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/interrupt/armv4t.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/interrupt/armv4t.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/interrupt/armv4t.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,158 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Refs: https://developer.arm.com/documentation/ddi0406/cb/System-Level-Architecture/The-System-Level-Programmers--Model/ARM-processor-modes-and-ARM-core-registers/Program-Status-Registers--PSRs-?lang=en
+//
+// Generated asm:
+// - armv5te https://godbolt.org/z/fhaW3d9Kv
+
+#[cfg(not(portable_atomic_no_asm))]
+use core::arch::asm;
+
+// - 0x80 - I (IRQ mask) bit (1 << 7)
+// - 0x40 - F (FIQ mask) bit (1 << 6)
+// We disable only IRQs by default. See also https://github.com/taiki-e/portable-atomic/pull/28#issuecomment-1214146912.
+#[cfg(not(portable_atomic_disable_fiq))]
+macro_rules! mask {
+    () => {
+        "0x80"
+    };
+}
+#[cfg(portable_atomic_disable_fiq)]
+macro_rules! mask {
+    () => {
+        "0xC0" // 0x80 | 0x40
+    };
+}
+
+pub(super) type State = u32;
+
+/// Disables interrupts and returns the previous interrupt state.
+#[inline]
+#[instruction_set(arm::a32)]
+pub(super) fn disable() -> State {
+    let cpsr: State;
+    // SAFETY: reading CPSR and disabling interrupts are safe.
+    // (see module-level comments of interrupt/mod.rs on the safety of using privileged instructions)
+    unsafe {
+        asm!(
+            "mrs {prev}, cpsr",
+            concat!("orr {new}, {prev}, ", mask!()),
+            "msr cpsr_c, {new}",
+            prev = out(reg) cpsr,
+            new = out(reg) _,
+            // Do not use `nomem` and `readonly` because prevent subsequent memory accesses from being reordered before interrupts are disabled.
+            options(nostack, preserves_flags),
+        );
+    }
+    cpsr
+}
+
+/// Restores the previous interrupt state.
+///
+/// # Safety
+///
+/// The state must be the one retrieved by the previous `disable`.
+#[inline]
+#[instruction_set(arm::a32)]
+pub(super) unsafe fn restore(cpsr: State) {
+    // SAFETY: the caller must guarantee that the state was retrieved by the previous `disable`,
+    //
+    // This clobbers the control field mask byte of CPSR. See msp430.rs to safety on this.
+    // (preserves_flags is fine because we only clobber the I, F, T, and M bits of CPSR.)
+    //
+    // Refs: https://developer.arm.com/documentation/dui0473/m/arm-and-thumb-instructions/msr--general-purpose-register-to-psr-
+    unsafe {
+        // Do not use `nomem` and `readonly` because prevent preceding memory accesses from being reordered after interrupts are enabled.
+        asm!("msr cpsr_c, {0}", in(reg) cpsr, options(nostack, preserves_flags));
+    }
+}
+
+// On pre-v6 ARM, we cannot use core::sync::atomic here because they call the
+// `__sync_*` builtins for non-relaxed load/store (because pre-v6 ARM doesn't
+// have Data Memory Barrier).
+//
+// Generated asm:
+// - armv5te https://godbolt.org/z/Th3z1jevK
+pub(crate) mod atomic {
+    #[cfg(not(portable_atomic_no_asm))]
+    use core::arch::asm;
+    use core::{cell::UnsafeCell, sync::atomic::Ordering};
+
+    macro_rules! atomic {
+        ($([$($generics:tt)*])? $atomic_type:ident, $value_type:ty, $asm_suffix:tt) => {
+            #[repr(transparent)]
+            pub(crate) struct $atomic_type $(<$($generics)*>)? {
+                v: UnsafeCell<$value_type>,
+            }
+
+            // Send is implicitly implemented for atomic integers, but not for atomic pointers.
+            // SAFETY: any data races are prevented by atomic operations.
+            unsafe impl $(<$($generics)*>)? Send for $atomic_type $(<$($generics)*>)? {}
+            // SAFETY: any data races are prevented by atomic operations.
+            unsafe impl $(<$($generics)*>)? Sync for $atomic_type $(<$($generics)*>)? {}
+
+            impl $(<$($generics)*>)? $atomic_type $(<$($generics)*>)? {
+                #[inline]
+                pub(crate) fn load(&self, order: Ordering) -> $value_type {
+                    let src = self.v.get();
+                    // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                    // pointer passed in is valid because we got it from a reference.
+                    unsafe {
+                        let out;
+                        match order {
+                            Ordering::Relaxed => {
+                                asm!(
+                                    concat!("ldr", $asm_suffix, " {out}, [{src}]"),
+                                    src = in(reg) src,
+                                    out = lateout(reg) out,
+                                    options(nostack, preserves_flags, readonly),
+                                );
+                            }
+                            Ordering::Acquire | Ordering::SeqCst => {
+                                // inline asm without nomem/readonly implies compiler fence.
+                                // And compiler fence is fine because the user explicitly declares that
+                                // the system is single-core by using an unsafe cfg.
+                                asm!(
+                                    concat!("ldr", $asm_suffix, " {out}, [{src}]"),
+                                    src = in(reg) src,
+                                    out = lateout(reg) out,
+                                    options(nostack, preserves_flags),
+                                );
+                            }
+                            _ => unreachable!(),
+                        }
+                        out
+                    }
+                }
+
+                #[inline]
+                pub(crate) fn store(&self, val: $value_type, _order: Ordering) {
+                    let dst = self.v.get();
+                    // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                    // pointer passed in is valid because we got it from a reference.
+                    unsafe {
+                        // inline asm without nomem/readonly implies compiler fence.
+                        // And compiler fence is fine because the user explicitly declares that
+                        // the system is single-core by using an unsafe cfg.
+                        asm!(
+                            concat!("str", $asm_suffix, " {val}, [{dst}]"),
+                            dst = in(reg) dst,
+                            val = in(reg) val,
+                            options(nostack, preserves_flags),
+                        );
+                    }
+                }
+            }
+        };
+    }
+
+    atomic!(AtomicI8, i8, "b");
+    atomic!(AtomicU8, u8, "b");
+    atomic!(AtomicI16, i16, "h");
+    atomic!(AtomicU16, u16, "h");
+    atomic!(AtomicI32, i32, "");
+    atomic!(AtomicU32, u32, "");
+    atomic!(AtomicIsize, isize, "");
+    atomic!(AtomicUsize, usize, "");
+    atomic!([T] AtomicPtr, *mut T, "");
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/interrupt/armv6m.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/interrupt/armv6m.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/interrupt/armv6m.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/interrupt/armv6m.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,48 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Adapted from https://github.com/rust-embedded/cortex-m.
+//
+// Generated asm:
+// - armv6-m https://godbolt.org/z/1sqKnsY6n
+
+#[cfg(not(portable_atomic_no_asm))]
+use core::arch::asm;
+
+pub(super) use core::sync::atomic;
+
+pub(super) type State = u32;
+
+/// Disables interrupts and returns the previous interrupt state.
+#[inline]
+pub(super) fn disable() -> State {
+    let r: State;
+    // SAFETY: reading the priority mask register and disabling interrupts are safe.
+    // (see module-level comments of interrupt/mod.rs on the safety of using privileged instructions)
+    unsafe {
+        // Do not use `nomem` and `readonly` because prevent subsequent memory accesses from being reordered before interrupts are disabled.
+        asm!(
+            "mrs {0}, PRIMASK",
+            "cpsid i",
+            out(reg) r,
+            options(nostack, preserves_flags),
+        );
+    }
+    r
+}
+
+/// Restores the previous interrupt state.
+///
+/// # Safety
+///
+/// The state must be the one retrieved by the previous `disable`.
+#[inline]
+pub(super) unsafe fn restore(r: State) {
+    if r & 0x1 == 0 {
+        // SAFETY: the caller must guarantee that the state was retrieved by the previous `disable`,
+        // and we've checked that interrupts were enabled before disabling interrupts.
+        unsafe {
+            // Do not use `nomem` and `readonly` because prevent preceding memory accesses from being reordered after interrupts are enabled.
+            asm!("cpsie i", options(nostack, preserves_flags));
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/interrupt/avr.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/interrupt/avr.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/interrupt/avr.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/interrupt/avr.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,57 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Adapted from https://github.com/Rahix/avr-device.
+//
+// Refs:
+// - AVR Instruction Set Manual https://ww1.microchip.com/downloads/en/DeviceDoc/AVR-InstructionSet-Manual-DS40002198.pdf
+
+#[cfg(not(portable_atomic_no_asm))]
+use core::arch::asm;
+
+pub(super) type State = u8;
+
+/// Disables interrupts and returns the previous interrupt state.
+#[inline]
+pub(super) fn disable() -> State {
+    let sreg: State;
+    // SAFETY: reading the status register (SREG) and disabling interrupts are safe.
+    // (see module-level comments of interrupt/mod.rs on the safety of using privileged instructions)
+    unsafe {
+        // Do not use `nomem` and `readonly` because prevent subsequent memory accesses from being reordered before interrupts are disabled.
+        // Do not use `preserves_flags` because CLI modifies the I bit of the status register (SREG).
+        // Refs: https://ww1.microchip.com/downloads/en/DeviceDoc/AVR-InstructionSet-Manual-DS40002198.pdf#page=58
+        #[cfg(not(portable_atomic_no_asm))]
+        asm!(
+            "in {0}, 0x3F",
+            "cli",
+            out(reg) sreg,
+            options(nostack),
+        );
+        #[cfg(portable_atomic_no_asm)]
+        {
+            llvm_asm!("in $0, 0x3F" : "=r"(sreg) ::: "volatile");
+            llvm_asm!("cli" ::: "memory" : "volatile");
+        }
+    }
+    sreg
+}
+
+/// Restores the previous interrupt state.
+///
+/// # Safety
+///
+/// The state must be the one retrieved by the previous `disable`.
+#[inline]
+pub(super) unsafe fn restore(sreg: State) {
+    // SAFETY: the caller must guarantee that the state was retrieved by the previous `disable`,
+    unsafe {
+        // This clobbers the entire status register. See msp430.rs to safety on this.
+        //
+        // Do not use `nomem` and `readonly` because prevent preceding memory accesses from being reordered after interrupts are enabled.
+        // Do not use `preserves_flags` because OUT modifies the status register (SREG).
+        #[cfg(not(portable_atomic_no_asm))]
+        asm!("out 0x3F, {0}", in(reg) sreg, options(nostack));
+        #[cfg(portable_atomic_no_asm)]
+        llvm_asm!("out 0x3F, $0" :: "r"(sreg) : "memory" : "volatile");
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/interrupt/mod.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/interrupt/mod.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/interrupt/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/interrupt/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,893 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Critical section based fallback implementations
+//
+// This module supports two different critical section implementations:
+// - Built-in "disable all interrupts".
+// - Call into the `critical-section` crate (which allows the user to plug any implementation).
+//
+// The `critical-section`-based fallback is enabled when the user asks for it with the `critical-section`
+// Cargo feature.
+//
+// The "disable interrupts" fallback is not sound on multi-core systems.
+// Also, this uses privileged instructions to disable interrupts, so it usually
+// doesn't work on unprivileged mode. Using this fallback in an environment where privileged
+// instructions are not available is also usually considered **unsound**,
+// although the details are system-dependent.
+//
+// Therefore, this implementation will only be enabled in one of the following cases:
+//
+// - When the user explicitly declares that the system is single-core and that
+//   privileged instructions are available using an unsafe cfg.
+// - When we can safely assume that the system is single-core and that
+//   privileged instructions are available on the system.
+//
+// AVR, which is single core[^avr1] and LLVM also generates code that disables
+// interrupts [^avr2] in atomic ops by default, is considered the latter.
+// MSP430 as well.
+//
+// See also README.md of this directory.
+//
+// [^avr1]: https://github.com/llvm/llvm-project/blob/llvmorg-18.1.2/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp#L1074
+// [^avr2]: https://github.com/llvm/llvm-project/blob/llvmorg-18.1.2/llvm/test/CodeGen/AVR/atomics/load16.ll#L5
+
+// On some platforms, atomic load/store can be implemented in a more efficient
+// way than disabling interrupts. On MSP430, some RMWs that do not return the
+// previous value can also be optimized.
+//
+// Note: On single-core systems, it is okay to use critical session-based
+// CAS together with atomic load/store. The load/store will not be
+// called while interrupts are disabled, and since the load/store is
+// atomic, it is not affected by interrupts even if interrupts are enabled.
+#[cfg(not(any(target_arch = "avr", feature = "critical-section")))]
+use arch::atomic;
+
+#[cfg(not(feature = "critical-section"))]
+#[cfg_attr(
+    all(
+        target_arch = "arm",
+        any(target_feature = "mclass", portable_atomic_target_feature = "mclass"),
+    ),
+    path = "armv6m.rs"
+)]
+#[cfg_attr(
+    all(
+        target_arch = "arm",
+        not(any(target_feature = "mclass", portable_atomic_target_feature = "mclass")),
+    ),
+    path = "armv4t.rs"
+)]
+#[cfg_attr(target_arch = "avr", path = "avr.rs")]
+#[cfg_attr(target_arch = "msp430", path = "msp430.rs")]
+#[cfg_attr(any(target_arch = "riscv32", target_arch = "riscv64"), path = "riscv.rs")]
+#[cfg_attr(target_arch = "xtensa", path = "xtensa.rs")]
+mod arch;
+
+use core::{cell::UnsafeCell, sync::atomic::Ordering};
+
+// Critical section implementations might use locks internally.
+#[cfg(feature = "critical-section")]
+const IS_ALWAYS_LOCK_FREE: bool = false;
+
+// Consider atomic operations based on disabling interrupts on single-core
+// systems are lock-free. (We consider the pre-v6 ARM Linux's atomic operations
+// provided in a similar way by the Linux kernel to be lock-free.)
+#[cfg(not(feature = "critical-section"))]
+const IS_ALWAYS_LOCK_FREE: bool = true;
+
+#[cfg(feature = "critical-section")]
+#[inline]
+fn with<F, R>(f: F) -> R
+where
+    F: FnOnce() -> R,
+{
+    critical_section::with(|_| f())
+}
+
+#[cfg(not(feature = "critical-section"))]
+#[inline]
+fn with<F, R>(f: F) -> R
+where
+    F: FnOnce() -> R,
+{
+    // Get current interrupt state and disable interrupts
+    let state = arch::disable();
+
+    let r = f();
+
+    // Restore interrupt state
+    // SAFETY: the state was retrieved by the previous `disable`.
+    unsafe { arch::restore(state) }
+
+    r
+}
+
+#[cfg_attr(target_pointer_width = "16", repr(C, align(2)))]
+#[cfg_attr(target_pointer_width = "32", repr(C, align(4)))]
+#[cfg_attr(target_pointer_width = "64", repr(C, align(8)))]
+#[cfg_attr(target_pointer_width = "128", repr(C, align(16)))]
+pub(crate) struct AtomicPtr<T> {
+    p: UnsafeCell<*mut T>,
+}
+
+// SAFETY: any data races are prevented by disabling interrupts or
+// atomic intrinsics (see module-level comments).
+unsafe impl<T> Send for AtomicPtr<T> {}
+// SAFETY: any data races are prevented by disabling interrupts or
+// atomic intrinsics (see module-level comments).
+unsafe impl<T> Sync for AtomicPtr<T> {}
+
+impl<T> AtomicPtr<T> {
+    #[inline]
+    pub(crate) const fn new(p: *mut T) -> Self {
+        Self { p: UnsafeCell::new(p) }
+    }
+
+    #[inline]
+    pub(crate) fn is_lock_free() -> bool {
+        Self::is_always_lock_free()
+    }
+    #[inline]
+    pub(crate) const fn is_always_lock_free() -> bool {
+        IS_ALWAYS_LOCK_FREE
+    }
+
+    #[inline]
+    pub(crate) fn get_mut(&mut self) -> &mut *mut T {
+        // SAFETY: the mutable reference guarantees unique ownership.
+        // (UnsafeCell::get_mut requires Rust 1.50)
+        unsafe { &mut *self.p.get() }
+    }
+
+    #[inline]
+    #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+    pub(crate) fn load(&self, order: Ordering) -> *mut T {
+        crate::utils::assert_load_ordering(order);
+        #[cfg(not(any(target_arch = "avr", feature = "critical-section")))]
+        {
+            self.as_native().load(order)
+        }
+        #[cfg(any(target_arch = "avr", feature = "critical-section"))]
+        // SAFETY: any data races are prevented by disabling interrupts (see
+        // module-level comments) and the raw pointer is valid because we got it
+        // from a reference.
+        with(|| unsafe { self.p.get().read() })
+    }
+
+    #[inline]
+    #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+    pub(crate) fn store(&self, ptr: *mut T, order: Ordering) {
+        crate::utils::assert_store_ordering(order);
+        #[cfg(not(any(target_arch = "avr", feature = "critical-section")))]
+        {
+            self.as_native().store(ptr, order);
+        }
+        #[cfg(any(target_arch = "avr", feature = "critical-section"))]
+        // SAFETY: any data races are prevented by disabling interrupts (see
+        // module-level comments) and the raw pointer is valid because we got it
+        // from a reference.
+        with(|| unsafe { self.p.get().write(ptr) });
+    }
+
+    #[inline]
+    pub(crate) fn swap(&self, ptr: *mut T, order: Ordering) -> *mut T {
+        let _ = order;
+        #[cfg(portable_atomic_force_amo)]
+        {
+            self.as_native().swap(ptr, order)
+        }
+        #[cfg(not(portable_atomic_force_amo))]
+        // SAFETY: any data races are prevented by disabling interrupts (see
+        // module-level comments) and the raw pointer is valid because we got it
+        // from a reference.
+        with(|| unsafe {
+            let prev = self.p.get().read();
+            self.p.get().write(ptr);
+            prev
+        })
+    }
+
+    #[inline]
+    #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+    pub(crate) fn compare_exchange(
+        &self,
+        current: *mut T,
+        new: *mut T,
+        success: Ordering,
+        failure: Ordering,
+    ) -> Result<*mut T, *mut T> {
+        crate::utils::assert_compare_exchange_ordering(success, failure);
+        // SAFETY: any data races are prevented by disabling interrupts (see
+        // module-level comments) and the raw pointer is valid because we got it
+        // from a reference.
+        with(|| unsafe {
+            let prev = self.p.get().read();
+            if prev == current {
+                self.p.get().write(new);
+                Ok(prev)
+            } else {
+                Err(prev)
+            }
+        })
+    }
+
+    #[inline]
+    #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+    pub(crate) fn compare_exchange_weak(
+        &self,
+        current: *mut T,
+        new: *mut T,
+        success: Ordering,
+        failure: Ordering,
+    ) -> Result<*mut T, *mut T> {
+        self.compare_exchange(current, new, success, failure)
+    }
+
+    #[inline]
+    pub(crate) const fn as_ptr(&self) -> *mut *mut T {
+        self.p.get()
+    }
+
+    #[cfg(not(any(target_arch = "avr", feature = "critical-section")))]
+    #[inline]
+    fn as_native(&self) -> &atomic::AtomicPtr<T> {
+        // SAFETY: AtomicPtr and atomic::AtomicPtr have the same layout and
+        // guarantee atomicity in a compatible way. (see module-level comments)
+        unsafe { &*(self as *const Self as *const atomic::AtomicPtr<T>) }
+    }
+}
+
+macro_rules! atomic_int {
+    (base, $atomic_type:ident, $int_type:ident, $align:literal) => {
+        #[repr(C, align($align))]
+        pub(crate) struct $atomic_type {
+            v: UnsafeCell<$int_type>,
+        }
+
+        // Send is implicitly implemented.
+        // SAFETY: any data races are prevented by disabling interrupts or
+        // atomic intrinsics (see module-level comments).
+        unsafe impl Sync for $atomic_type {}
+
+        impl $atomic_type {
+            #[inline]
+            pub(crate) const fn new(v: $int_type) -> Self {
+                Self { v: UnsafeCell::new(v) }
+            }
+
+            #[inline]
+            pub(crate) fn is_lock_free() -> bool {
+                Self::is_always_lock_free()
+            }
+            #[inline]
+            pub(crate) const fn is_always_lock_free() -> bool {
+                IS_ALWAYS_LOCK_FREE
+            }
+
+            #[inline]
+            pub(crate) fn get_mut(&mut self) -> &mut $int_type {
+                // SAFETY: the mutable reference guarantees unique ownership.
+                // (UnsafeCell::get_mut requires Rust 1.50)
+                unsafe { &mut *self.v.get() }
+            }
+
+            #[inline]
+            pub(crate) const fn as_ptr(&self) -> *mut $int_type {
+                self.v.get()
+            }
+        }
+    };
+    (load_store_atomic $([$kind:ident])?, $atomic_type:ident, $int_type:ident, $align:literal) => {
+        atomic_int!(base, $atomic_type, $int_type, $align);
+        #[cfg(not(portable_atomic_force_amo))]
+        atomic_int!(cas[emulate], $atomic_type, $int_type);
+        #[cfg(portable_atomic_force_amo)]
+        atomic_int!(cas $([$kind])?, $atomic_type, $int_type);
+        impl $atomic_type {
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn load(&self, order: Ordering) -> $int_type {
+                crate::utils::assert_load_ordering(order);
+                #[cfg(not(any(target_arch = "avr", feature = "critical-section")))]
+                {
+                    self.as_native().load(order)
+                }
+                #[cfg(any(target_arch = "avr", feature = "critical-section"))]
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe { self.v.get().read() })
+            }
+
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn store(&self, val: $int_type, order: Ordering) {
+                crate::utils::assert_store_ordering(order);
+                #[cfg(not(any(target_arch = "avr", feature = "critical-section")))]
+                {
+                    self.as_native().store(val, order);
+                }
+                #[cfg(any(target_arch = "avr", feature = "critical-section"))]
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe { self.v.get().write(val) });
+            }
+
+            #[cfg(not(any(target_arch = "avr", feature = "critical-section")))]
+            #[inline]
+            fn as_native(&self) -> &atomic::$atomic_type {
+                // SAFETY: $atomic_type and atomic::$atomic_type have the same layout and
+                // guarantee atomicity in a compatible way. (see module-level comments)
+                unsafe { &*(self as *const Self as *const atomic::$atomic_type) }
+            }
+        }
+
+        #[cfg(not(all(target_arch = "msp430", not(feature = "critical-section"))))]
+        impl_default_no_fetch_ops!($atomic_type, $int_type);
+        impl_default_bit_opts!($atomic_type, $int_type);
+        #[cfg(not(all(target_arch = "msp430", not(feature = "critical-section"))))]
+        impl $atomic_type {
+            #[inline]
+            pub(crate) fn not(&self, order: Ordering) {
+                self.fetch_not(order);
+            }
+        }
+        #[cfg(all(target_arch = "msp430", not(feature = "critical-section")))]
+        impl $atomic_type {
+            #[inline]
+            pub(crate) fn add(&self, val: $int_type, order: Ordering) {
+                self.as_native().add(val, order);
+            }
+            #[inline]
+            pub(crate) fn sub(&self, val: $int_type, order: Ordering) {
+                self.as_native().sub(val, order);
+            }
+            #[inline]
+            pub(crate) fn and(&self, val: $int_type, order: Ordering) {
+                self.as_native().and(val, order);
+            }
+            #[inline]
+            pub(crate) fn or(&self, val: $int_type, order: Ordering) {
+                self.as_native().or(val, order);
+            }
+            #[inline]
+            pub(crate) fn xor(&self, val: $int_type, order: Ordering) {
+                self.as_native().xor(val, order);
+            }
+            #[inline]
+            pub(crate) fn not(&self, order: Ordering) {
+                self.as_native().not(order);
+            }
+        }
+    };
+    (load_store_critical_session, $atomic_type:ident, $int_type:ident, $align:literal) => {
+        atomic_int!(base, $atomic_type, $int_type, $align);
+        atomic_int!(cas[emulate], $atomic_type, $int_type);
+        impl_default_no_fetch_ops!($atomic_type, $int_type);
+        impl_default_bit_opts!($atomic_type, $int_type);
+        impl $atomic_type {
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn load(&self, order: Ordering) -> $int_type {
+                crate::utils::assert_load_ordering(order);
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe { self.v.get().read() })
+            }
+
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn store(&self, val: $int_type, order: Ordering) {
+                crate::utils::assert_store_ordering(order);
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe { self.v.get().write(val) });
+            }
+
+            #[inline]
+            pub(crate) fn not(&self, order: Ordering) {
+                self.fetch_not(order);
+            }
+        }
+    };
+    (cas[emulate], $atomic_type:ident, $int_type:ident) => {
+        impl $atomic_type {
+            #[inline]
+            pub(crate) fn swap(&self, val: $int_type, _order: Ordering) -> $int_type {
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    self.v.get().write(val);
+                    prev
+                })
+            }
+
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn compare_exchange(
+                &self,
+                current: $int_type,
+                new: $int_type,
+                success: Ordering,
+                failure: Ordering,
+            ) -> Result<$int_type, $int_type> {
+                crate::utils::assert_compare_exchange_ordering(success, failure);
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    if prev == current {
+                        self.v.get().write(new);
+                        Ok(prev)
+                    } else {
+                        Err(prev)
+                    }
+                })
+            }
+
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn compare_exchange_weak(
+                &self,
+                current: $int_type,
+                new: $int_type,
+                success: Ordering,
+                failure: Ordering,
+            ) -> Result<$int_type, $int_type> {
+                self.compare_exchange(current, new, success, failure)
+            }
+
+            #[inline]
+            pub(crate) fn fetch_add(&self, val: $int_type, _order: Ordering) -> $int_type {
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    self.v.get().write(prev.wrapping_add(val));
+                    prev
+                })
+            }
+
+            #[inline]
+            pub(crate) fn fetch_sub(&self, val: $int_type, _order: Ordering) -> $int_type {
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    self.v.get().write(prev.wrapping_sub(val));
+                    prev
+                })
+            }
+
+            #[inline]
+            pub(crate) fn fetch_and(&self, val: $int_type, _order: Ordering) -> $int_type {
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    self.v.get().write(prev & val);
+                    prev
+                })
+            }
+
+            #[inline]
+            pub(crate) fn fetch_nand(&self, val: $int_type, _order: Ordering) -> $int_type {
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    self.v.get().write(!(prev & val));
+                    prev
+                })
+            }
+
+            #[inline]
+            pub(crate) fn fetch_or(&self, val: $int_type, _order: Ordering) -> $int_type {
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    self.v.get().write(prev | val);
+                    prev
+                })
+            }
+
+            #[inline]
+            pub(crate) fn fetch_xor(&self, val: $int_type, _order: Ordering) -> $int_type {
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    self.v.get().write(prev ^ val);
+                    prev
+                })
+            }
+
+            #[inline]
+            pub(crate) fn fetch_max(&self, val: $int_type, _order: Ordering) -> $int_type {
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    self.v.get().write(core::cmp::max(prev, val));
+                    prev
+                })
+            }
+
+            #[inline]
+            pub(crate) fn fetch_min(&self, val: $int_type, _order: Ordering) -> $int_type {
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    self.v.get().write(core::cmp::min(prev, val));
+                    prev
+                })
+            }
+
+            #[inline]
+            pub(crate) fn fetch_not(&self, _order: Ordering) -> $int_type {
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    self.v.get().write(!prev);
+                    prev
+                })
+            }
+
+            #[inline]
+            pub(crate) fn fetch_neg(&self, _order: Ordering) -> $int_type {
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    self.v.get().write(prev.wrapping_neg());
+                    prev
+                })
+            }
+            #[inline]
+            pub(crate) fn neg(&self, order: Ordering) {
+                self.fetch_neg(order);
+            }
+        }
+    };
+    // cfg(portable_atomic_force_amo) 32-bit(RV32)/{32,64}-bit(RV64) RMW
+    (cas, $atomic_type:ident, $int_type:ident) => {
+        impl $atomic_type {
+            #[inline]
+            pub(crate) fn swap(&self, val: $int_type, order: Ordering) -> $int_type {
+                self.as_native().swap(val, order)
+            }
+
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn compare_exchange(
+                &self,
+                current: $int_type,
+                new: $int_type,
+                success: Ordering,
+                failure: Ordering,
+            ) -> Result<$int_type, $int_type> {
+                crate::utils::assert_compare_exchange_ordering(success, failure);
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    if prev == current {
+                        self.v.get().write(new);
+                        Ok(prev)
+                    } else {
+                        Err(prev)
+                    }
+                })
+            }
+
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn compare_exchange_weak(
+                &self,
+                current: $int_type,
+                new: $int_type,
+                success: Ordering,
+                failure: Ordering,
+            ) -> Result<$int_type, $int_type> {
+                self.compare_exchange(current, new, success, failure)
+            }
+
+            #[inline]
+            pub(crate) fn fetch_add(&self, val: $int_type, order: Ordering) -> $int_type {
+                self.as_native().fetch_add(val, order)
+            }
+            #[inline]
+            pub(crate) fn fetch_sub(&self, val: $int_type, order: Ordering) -> $int_type {
+                self.as_native().fetch_sub(val, order)
+            }
+            #[inline]
+            pub(crate) fn fetch_and(&self, val: $int_type, order: Ordering) -> $int_type {
+                self.as_native().fetch_and(val, order)
+            }
+
+            #[inline]
+            pub(crate) fn fetch_nand(&self, val: $int_type, _order: Ordering) -> $int_type {
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    self.v.get().write(!(prev & val));
+                    prev
+                })
+            }
+
+            #[inline]
+            pub(crate) fn fetch_or(&self, val: $int_type, order: Ordering) -> $int_type {
+                self.as_native().fetch_or(val, order)
+            }
+            #[inline]
+            pub(crate) fn fetch_xor(&self, val: $int_type, order: Ordering) -> $int_type {
+                self.as_native().fetch_xor(val, order)
+            }
+            #[inline]
+            pub(crate) fn fetch_max(&self, val: $int_type, order: Ordering) -> $int_type {
+                self.as_native().fetch_max(val, order)
+            }
+            #[inline]
+            pub(crate) fn fetch_min(&self, val: $int_type, order: Ordering) -> $int_type {
+                self.as_native().fetch_min(val, order)
+            }
+            #[inline]
+            pub(crate) fn fetch_not(&self, order: Ordering) -> $int_type {
+                self.as_native().fetch_not(order)
+            }
+
+            #[inline]
+            pub(crate) fn fetch_neg(&self, _order: Ordering) -> $int_type {
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    self.v.get().write(prev.wrapping_neg());
+                    prev
+                })
+            }
+            #[inline]
+            pub(crate) fn neg(&self, order: Ordering) {
+                self.fetch_neg(order);
+            }
+        }
+    };
+    // cfg(portable_atomic_force_amo) {8,16}-bit RMW
+    (cas[sub_word], $atomic_type:ident, $int_type:ident) => {
+        impl $atomic_type {
+            #[inline]
+            pub(crate) fn swap(&self, val: $int_type, _order: Ordering) -> $int_type {
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    self.v.get().write(val);
+                    prev
+                })
+            }
+
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn compare_exchange(
+                &self,
+                current: $int_type,
+                new: $int_type,
+                success: Ordering,
+                failure: Ordering,
+            ) -> Result<$int_type, $int_type> {
+                crate::utils::assert_compare_exchange_ordering(success, failure);
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    if prev == current {
+                        self.v.get().write(new);
+                        Ok(prev)
+                    } else {
+                        Err(prev)
+                    }
+                })
+            }
+
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn compare_exchange_weak(
+                &self,
+                current: $int_type,
+                new: $int_type,
+                success: Ordering,
+                failure: Ordering,
+            ) -> Result<$int_type, $int_type> {
+                self.compare_exchange(current, new, success, failure)
+            }
+
+            #[inline]
+            pub(crate) fn fetch_add(&self, val: $int_type, _order: Ordering) -> $int_type {
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    self.v.get().write(prev.wrapping_add(val));
+                    prev
+                })
+            }
+
+            #[inline]
+            pub(crate) fn fetch_sub(&self, val: $int_type, _order: Ordering) -> $int_type {
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    self.v.get().write(prev.wrapping_sub(val));
+                    prev
+                })
+            }
+
+            #[inline]
+            pub(crate) fn fetch_and(&self, val: $int_type, order: Ordering) -> $int_type {
+                self.as_native().fetch_and(val, order)
+            }
+
+            #[inline]
+            pub(crate) fn fetch_nand(&self, val: $int_type, _order: Ordering) -> $int_type {
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    self.v.get().write(!(prev & val));
+                    prev
+                })
+            }
+
+            #[inline]
+            pub(crate) fn fetch_or(&self, val: $int_type, order: Ordering) -> $int_type {
+                self.as_native().fetch_or(val, order)
+            }
+            #[inline]
+            pub(crate) fn fetch_xor(&self, val: $int_type, order: Ordering) -> $int_type {
+                self.as_native().fetch_xor(val, order)
+            }
+
+            #[inline]
+            pub(crate) fn fetch_max(&self, val: $int_type, _order: Ordering) -> $int_type {
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    self.v.get().write(core::cmp::max(prev, val));
+                    prev
+                })
+            }
+
+            #[inline]
+            pub(crate) fn fetch_min(&self, val: $int_type, _order: Ordering) -> $int_type {
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    self.v.get().write(core::cmp::min(prev, val));
+                    prev
+                })
+            }
+
+            #[inline]
+            pub(crate) fn fetch_not(&self, order: Ordering) -> $int_type {
+                self.as_native().fetch_not(order)
+            }
+
+            #[inline]
+            pub(crate) fn fetch_neg(&self, _order: Ordering) -> $int_type {
+                // SAFETY: any data races are prevented by disabling interrupts (see
+                // module-level comments) and the raw pointer is valid because we got it
+                // from a reference.
+                with(|| unsafe {
+                    let prev = self.v.get().read();
+                    self.v.get().write(prev.wrapping_neg());
+                    prev
+                })
+            }
+            #[inline]
+            pub(crate) fn neg(&self, order: Ordering) {
+                self.fetch_neg(order);
+            }
+        }
+    };
+}
+
+#[cfg(target_pointer_width = "16")]
+atomic_int!(load_store_atomic, AtomicIsize, isize, 2);
+#[cfg(target_pointer_width = "16")]
+atomic_int!(load_store_atomic, AtomicUsize, usize, 2);
+#[cfg(target_pointer_width = "32")]
+atomic_int!(load_store_atomic, AtomicIsize, isize, 4);
+#[cfg(target_pointer_width = "32")]
+atomic_int!(load_store_atomic, AtomicUsize, usize, 4);
+#[cfg(target_pointer_width = "64")]
+atomic_int!(load_store_atomic, AtomicIsize, isize, 8);
+#[cfg(target_pointer_width = "64")]
+atomic_int!(load_store_atomic, AtomicUsize, usize, 8);
+#[cfg(target_pointer_width = "128")]
+atomic_int!(load_store_atomic, AtomicIsize, isize, 16);
+#[cfg(target_pointer_width = "128")]
+atomic_int!(load_store_atomic, AtomicUsize, usize, 16);
+
+atomic_int!(load_store_atomic[sub_word], AtomicI8, i8, 1);
+atomic_int!(load_store_atomic[sub_word], AtomicU8, u8, 1);
+atomic_int!(load_store_atomic[sub_word], AtomicI16, i16, 2);
+atomic_int!(load_store_atomic[sub_word], AtomicU16, u16, 2);
+
+#[cfg(not(target_pointer_width = "16"))]
+atomic_int!(load_store_atomic, AtomicI32, i32, 4);
+#[cfg(not(target_pointer_width = "16"))]
+atomic_int!(load_store_atomic, AtomicU32, u32, 4);
+#[cfg(target_pointer_width = "16")]
+#[cfg(any(test, feature = "fallback"))]
+atomic_int!(load_store_critical_session, AtomicI32, i32, 4);
+#[cfg(target_pointer_width = "16")]
+#[cfg(any(test, feature = "fallback"))]
+atomic_int!(load_store_critical_session, AtomicU32, u32, 4);
+
+#[cfg(not(any(target_pointer_width = "16", target_pointer_width = "32")))]
+atomic_int!(load_store_atomic, AtomicI64, i64, 8);
+#[cfg(not(any(target_pointer_width = "16", target_pointer_width = "32")))]
+atomic_int!(load_store_atomic, AtomicU64, u64, 8);
+#[cfg(any(target_pointer_width = "16", target_pointer_width = "32"))]
+#[cfg(any(test, feature = "fallback"))]
+atomic_int!(load_store_critical_session, AtomicI64, i64, 8);
+#[cfg(any(target_pointer_width = "16", target_pointer_width = "32"))]
+#[cfg(any(test, feature = "fallback"))]
+atomic_int!(load_store_critical_session, AtomicU64, u64, 8);
+
+#[cfg(any(test, feature = "fallback"))]
+atomic_int!(load_store_critical_session, AtomicI128, i128, 16);
+#[cfg(any(test, feature = "fallback"))]
+atomic_int!(load_store_critical_session, AtomicU128, u128, 16);
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    test_atomic_ptr_single_thread!();
+    test_atomic_int_single_thread!(i8);
+    test_atomic_int_single_thread!(u8);
+    test_atomic_int_single_thread!(i16);
+    test_atomic_int_single_thread!(u16);
+    test_atomic_int_single_thread!(i32);
+    test_atomic_int_single_thread!(u32);
+    test_atomic_int_single_thread!(i64);
+    test_atomic_int_single_thread!(u64);
+    test_atomic_int_single_thread!(i128);
+    test_atomic_int_single_thread!(u128);
+    test_atomic_int_single_thread!(isize);
+    test_atomic_int_single_thread!(usize);
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/interrupt/msp430.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/interrupt/msp430.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/interrupt/msp430.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/interrupt/msp430.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,64 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Adapted from https://github.com/rust-embedded/msp430.
+//
+// See also src/imp/msp430.rs.
+//
+// Refs: https://www.ti.com/lit/ug/slau208q/slau208q.pdf
+
+#[cfg(not(portable_atomic_no_asm))]
+use core::arch::asm;
+
+pub(super) use super::super::msp430 as atomic;
+
+pub(super) type State = u16;
+
+/// Disables interrupts and returns the previous interrupt state.
+#[inline]
+pub(super) fn disable() -> State {
+    let r: State;
+    // SAFETY: reading the status register and disabling interrupts are safe.
+    // (see module-level comments of interrupt/mod.rs on the safety of using privileged instructions)
+    unsafe {
+        // Do not use `nomem` and `readonly` because prevent subsequent memory accesses from being reordered before interrupts are disabled.
+        // Do not use `preserves_flags` because DINT modifies the GIE (global interrupt enable) bit of the status register.
+        #[cfg(not(portable_atomic_no_asm))]
+        asm!(
+            "mov R2, {0}",
+            "dint {{ nop",
+            out(reg) r,
+            options(nostack),
+        );
+        #[cfg(portable_atomic_no_asm)]
+        {
+            llvm_asm!("mov R2, $0" : "=r"(r) ::: "volatile");
+            llvm_asm!("dint { nop" ::: "memory" : "volatile");
+        }
+    }
+    r
+}
+
+/// Restores the previous interrupt state.
+///
+/// # Safety
+///
+/// The state must be the one retrieved by the previous `disable`.
+#[inline]
+pub(super) unsafe fn restore(r: State) {
+    // SAFETY: the caller must guarantee that the state was retrieved by the previous `disable`,
+    unsafe {
+        // This clobbers the entire status register, but we never explicitly modify
+        // flags within a critical session, and the only flags that may be changed
+        // within a critical session are the arithmetic flags that are changed as
+        // a side effect of arithmetic operations, etc., which LLVM recognizes,
+        // so it is safe to clobber them here.
+        // See also the discussion at https://github.com/taiki-e/portable-atomic/pull/40.
+        //
+        // Do not use `nomem` and `readonly` because prevent preceding memory accesses from being reordered after interrupts are enabled.
+        // Do not use `preserves_flags` because MOV modifies the status register.
+        #[cfg(not(portable_atomic_no_asm))]
+        asm!("nop {{ mov {0}, R2 {{ nop", in(reg) r, options(nostack));
+        #[cfg(portable_atomic_no_asm)]
+        llvm_asm!("nop { mov $0, R2 { nop" :: "r"(r) : "memory" : "volatile");
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/interrupt/riscv.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/interrupt/riscv.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/interrupt/riscv.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/interrupt/riscv.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,81 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Refs:
+// - https://five-embeddev.com/riscv-isa-manual/latest/machine.html#machine-status-registers-mstatus-and-mstatush
+// - https://five-embeddev.com/riscv-isa-manual/latest/supervisor.html#sstatus
+//
+// Generated asm:
+// - riscv64gc https://godbolt.org/z/zTrzT1Ee7
+
+#[cfg(not(portable_atomic_no_asm))]
+use core::arch::asm;
+
+pub(super) use super::super::riscv as atomic;
+
+// Status register
+#[cfg(not(portable_atomic_s_mode))]
+macro_rules! status {
+    () => {
+        "mstatus"
+    };
+}
+#[cfg(portable_atomic_s_mode)]
+macro_rules! status {
+    () => {
+        "sstatus"
+    };
+}
+
+// MIE (Machine Interrupt Enable) bit (1 << 3)
+#[cfg(not(portable_atomic_s_mode))]
+const MASK: State = 0x8;
+#[cfg(not(portable_atomic_s_mode))]
+macro_rules! mask {
+    () => {
+        "0x8"
+    };
+}
+// SIE (Supervisor Interrupt Enable) bit (1 << 1)
+#[cfg(portable_atomic_s_mode)]
+const MASK: State = 0x2;
+#[cfg(portable_atomic_s_mode)]
+macro_rules! mask {
+    () => {
+        "0x2"
+    };
+}
+
+#[cfg(target_arch = "riscv32")]
+pub(super) type State = u32;
+#[cfg(target_arch = "riscv64")]
+pub(super) type State = u64;
+
+/// Disables interrupts and returns the previous interrupt state.
+#[inline]
+pub(super) fn disable() -> State {
+    let r: State;
+    // SAFETY: reading mstatus and disabling interrupts is safe.
+    // (see module-level comments of interrupt/mod.rs on the safety of using privileged instructions)
+    unsafe {
+        // Do not use `nomem` and `readonly` because prevent subsequent memory accesses from being reordered before interrupts are disabled.
+        asm!(concat!("csrrci {0}, ", status!(), ", ", mask!()), out(reg) r, options(nostack, preserves_flags));
+    }
+    r
+}
+
+/// Restores the previous interrupt state.
+///
+/// # Safety
+///
+/// The state must be the one retrieved by the previous `disable`.
+#[inline]
+pub(super) unsafe fn restore(r: State) {
+    if r & MASK != 0 {
+        // SAFETY: the caller must guarantee that the state was retrieved by the previous `disable`,
+        // and we've checked that interrupts were enabled before disabling interrupts.
+        unsafe {
+            // Do not use `nomem` and `readonly` because prevent preceding memory accesses from being reordered after interrupts are enabled.
+            asm!(concat!("csrsi ", status!(), ", ", mask!()), options(nostack, preserves_flags));
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/interrupt/xtensa.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/interrupt/xtensa.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/interrupt/xtensa.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/interrupt/xtensa.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,47 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Refs:
+// - Xtensa Instruction Set Architecture (ISA) Reference Manual https://0x04.net/~mwk/doc/xtensa.pdf
+// - Linux kernel's Xtensa atomic implementation https://github.com/torvalds/linux/blob/v6.1/arch/xtensa/include/asm/atomic.h
+
+use core::arch::asm;
+
+pub(super) use core::sync::atomic;
+
+pub(super) type State = u32;
+
+/// Disables interrupts and returns the previous interrupt state.
+#[inline]
+pub(super) fn disable() -> State {
+    let r: State;
+    // SAFETY: reading the PS special register and disabling all interrupts is safe.
+    // (see module-level comments of interrupt/mod.rs on the safety of using privileged instructions)
+    unsafe {
+        // Do not use `nomem` and `readonly` because prevent subsequent memory accesses from being reordered before interrupts are disabled.
+        // Interrupt level 15 to disable all interrupts.
+        // SYNC after RSIL is not required.
+        asm!("rsil {0}, 15", out(reg) r, options(nostack));
+    }
+    r
+}
+
+/// Restores the previous interrupt state.
+///
+/// # Safety
+///
+/// The state must be the one retrieved by the previous `disable`.
+#[inline]
+pub(super) unsafe fn restore(r: State) {
+    // SAFETY: the caller must guarantee that the state was retrieved by the previous `disable`,
+    // and we've checked that interrupts were enabled before disabling interrupts.
+    unsafe {
+        // Do not use `nomem` and `readonly` because prevent preceding memory accesses from being reordered after interrupts are enabled.
+        // SYNC after WSR is required to guarantee that subsequent RSIL read the written value.
+        asm!(
+            "wsr.ps {0}",
+            "rsync",
+            in(reg) r,
+            options(nostack),
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/mod.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/mod.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,452 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// -----------------------------------------------------------------------------
+// Lock-free implementations
+
+#[cfg(not(any(
+    all(
+        portable_atomic_no_atomic_load_store,
+        not(all(target_arch = "bpf", not(feature = "critical-section"))),
+    ),
+    portable_atomic_unsafe_assume_single_core,
+    target_arch = "avr",
+    target_arch = "msp430",
+)))]
+#[cfg_attr(
+    portable_atomic_no_cfg_target_has_atomic,
+    cfg(not(all(
+        any(target_arch = "riscv32", target_arch = "riscv64", feature = "critical-section"),
+        portable_atomic_no_atomic_cas,
+    )))
+)]
+#[cfg_attr(
+    not(portable_atomic_no_cfg_target_has_atomic),
+    cfg(not(all(
+        any(target_arch = "riscv32", target_arch = "riscv64", feature = "critical-section"),
+        not(target_has_atomic = "ptr"),
+    )))
+)]
+mod core_atomic;
+
+// aarch64 128-bit atomics
+#[cfg(all(
+    target_arch = "aarch64",
+    any(not(portable_atomic_no_asm), portable_atomic_unstable_asm),
+))]
+// Use intrinsics.rs on Miri and Sanitizer that do not support inline assembly.
+#[cfg_attr(
+    all(any(miri, portable_atomic_sanitize_thread), portable_atomic_new_atomic_intrinsics),
+    path = "atomic128/intrinsics.rs"
+)]
+#[cfg_attr(
+    not(all(any(miri, portable_atomic_sanitize_thread), portable_atomic_new_atomic_intrinsics)),
+    path = "atomic128/aarch64.rs"
+)]
+mod aarch64;
+
+// x86_64 128-bit atomics
+#[cfg(all(
+    target_arch = "x86_64",
+    not(all(any(miri, portable_atomic_sanitize_thread), portable_atomic_no_cmpxchg16b_intrinsic)),
+    any(not(portable_atomic_no_asm), portable_atomic_unstable_asm),
+    any(
+        target_feature = "cmpxchg16b",
+        portable_atomic_target_feature = "cmpxchg16b",
+        all(
+            feature = "fallback",
+            not(portable_atomic_no_outline_atomics),
+            not(any(target_env = "sgx", miri)),
+        ),
+    ),
+))]
+// Use intrinsics.rs on Miri and Sanitizer that do not support inline assembly.
+#[cfg_attr(any(miri, portable_atomic_sanitize_thread), path = "atomic128/intrinsics.rs")]
+#[cfg_attr(not(any(miri, portable_atomic_sanitize_thread)), path = "atomic128/x86_64.rs")]
+mod x86_64;
+
+// powerpc64 128-bit atomics
+#[cfg(all(
+    target_arch = "powerpc64",
+    portable_atomic_unstable_asm_experimental_arch,
+    any(
+        target_feature = "quadword-atomics",
+        portable_atomic_target_feature = "quadword-atomics",
+        all(
+            feature = "fallback",
+            not(portable_atomic_no_outline_atomics),
+            any(test, portable_atomic_outline_atomics), // TODO(powerpc64): currently disabled by default
+            any(
+                all(
+                    target_os = "linux",
+                    any(
+                        target_env = "gnu",
+                        all(
+                            any(target_env = "musl", target_env = "ohos"),
+                            not(target_feature = "crt-static"),
+                        ),
+                        portable_atomic_outline_atomics,
+                    ),
+                ),
+                target_os = "android",
+                target_os = "freebsd",
+            ),
+            not(any(miri, portable_atomic_sanitize_thread)),
+        ),
+    ),
+))]
+// Use intrinsics.rs on Miri and Sanitizer that do not support inline assembly.
+#[cfg_attr(
+    all(any(miri, portable_atomic_sanitize_thread), portable_atomic_llvm_15),
+    path = "atomic128/intrinsics.rs"
+)]
+#[cfg_attr(
+    not(all(any(miri, portable_atomic_sanitize_thread), portable_atomic_llvm_15)),
+    path = "atomic128/powerpc64.rs"
+)]
+mod powerpc64;
+
+// s390x 128-bit atomics
+#[cfg(all(target_arch = "s390x", portable_atomic_unstable_asm_experimental_arch))]
+// Use intrinsics.rs on Miri and Sanitizer that do not support inline assembly.
+#[cfg_attr(any(miri, portable_atomic_sanitize_thread), path = "atomic128/intrinsics.rs")]
+#[cfg_attr(not(any(miri, portable_atomic_sanitize_thread)), path = "atomic128/s390x.rs")]
+mod s390x;
+
+// pre-v6 ARM Linux 64-bit atomics
+#[cfg(feature = "fallback")]
+// Miri and Sanitizer do not support inline assembly.
+#[cfg(all(
+    target_arch = "arm",
+    not(any(miri, portable_atomic_sanitize_thread)),
+    not(portable_atomic_no_asm),
+    any(target_os = "linux", target_os = "android"),
+    not(any(target_feature = "v6", portable_atomic_target_feature = "v6")),
+    not(portable_atomic_no_outline_atomics),
+))]
+#[cfg_attr(portable_atomic_no_cfg_target_has_atomic, cfg(portable_atomic_no_atomic_64))]
+#[cfg_attr(not(portable_atomic_no_cfg_target_has_atomic), cfg(not(target_has_atomic = "64")))]
+mod arm_linux;
+
+// MSP430 atomics
+#[cfg(target_arch = "msp430")]
+pub(crate) mod msp430;
+
+// atomic load/store for RISC-V without A-extension
+#[cfg(any(test, not(feature = "critical-section")))]
+#[cfg_attr(portable_atomic_no_cfg_target_has_atomic, cfg(any(test, portable_atomic_no_atomic_cas)))]
+#[cfg_attr(
+    not(portable_atomic_no_cfg_target_has_atomic),
+    cfg(any(test, not(target_has_atomic = "ptr")))
+)]
+#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
+mod riscv;
+
+// x86-specific optimizations
+// Miri and Sanitizer do not support inline assembly.
+#[cfg(all(
+    any(target_arch = "x86", target_arch = "x86_64"),
+    not(any(miri, portable_atomic_sanitize_thread)),
+    not(portable_atomic_no_asm),
+))]
+mod x86;
+
+// -----------------------------------------------------------------------------
+// Lock-based fallback implementations
+
+#[cfg(feature = "fallback")]
+#[cfg_attr(portable_atomic_no_cfg_target_has_atomic, cfg(not(portable_atomic_no_atomic_cas)))]
+#[cfg_attr(not(portable_atomic_no_cfg_target_has_atomic), cfg(target_has_atomic = "ptr"))]
+#[cfg(any(
+    test,
+    not(any(
+        all(
+            target_arch = "aarch64",
+            any(not(portable_atomic_no_asm), portable_atomic_unstable_asm),
+        ),
+        all(
+            target_arch = "x86_64",
+            any(not(portable_atomic_no_asm), portable_atomic_unstable_asm),
+            any(target_feature = "cmpxchg16b", portable_atomic_target_feature = "cmpxchg16b"),
+        ),
+        all(
+            target_arch = "powerpc64",
+            portable_atomic_unstable_asm_experimental_arch,
+            any(
+                target_feature = "quadword-atomics",
+                portable_atomic_target_feature = "quadword-atomics",
+            ),
+        ),
+        all(target_arch = "s390x", portable_atomic_unstable_asm_experimental_arch),
+    ))
+))]
+mod fallback;
+
+// -----------------------------------------------------------------------------
+// Critical section based fallback implementations
+
+// On AVR, we always use critical section based fallback implementation.
+// AVR can be safely assumed to be single-core, so this is sound.
+// https://github.com/llvm/llvm-project/blob/llvmorg-18.1.2/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp#L1074
+// MSP430 as well.
+#[cfg(any(
+    all(test, target_os = "none"),
+    portable_atomic_unsafe_assume_single_core,
+    feature = "critical-section",
+    target_arch = "avr",
+    target_arch = "msp430",
+))]
+#[cfg_attr(portable_atomic_no_cfg_target_has_atomic, cfg(any(test, portable_atomic_no_atomic_cas)))]
+#[cfg_attr(
+    not(portable_atomic_no_cfg_target_has_atomic),
+    cfg(any(test, not(target_has_atomic = "ptr")))
+)]
+#[cfg(any(
+    target_arch = "arm",
+    target_arch = "avr",
+    target_arch = "msp430",
+    target_arch = "riscv32",
+    target_arch = "riscv64",
+    target_arch = "xtensa",
+    feature = "critical-section",
+))]
+mod interrupt;
+
+// -----------------------------------------------------------------------------
+// Atomic float implementations
+
+#[cfg(feature = "float")]
+pub(crate) mod float;
+
+// -----------------------------------------------------------------------------
+
+#[cfg(not(any(
+    portable_atomic_no_atomic_load_store,
+    portable_atomic_unsafe_assume_single_core,
+    target_arch = "avr",
+    target_arch = "msp430",
+)))]
+#[cfg_attr(
+    portable_atomic_no_cfg_target_has_atomic,
+    cfg(not(all(
+        any(target_arch = "riscv32", target_arch = "riscv64", feature = "critical-section"),
+        portable_atomic_no_atomic_cas,
+    )))
+)]
+#[cfg_attr(
+    not(portable_atomic_no_cfg_target_has_atomic),
+    cfg(not(all(
+        any(target_arch = "riscv32", target_arch = "riscv64", feature = "critical-section"),
+        not(target_has_atomic = "ptr"),
+    )))
+)]
+items! {
+    pub(crate) use self::core_atomic::{
+        AtomicI16, AtomicI32, AtomicI8, AtomicIsize, AtomicPtr, AtomicU16, AtomicU32, AtomicU8,
+        AtomicUsize,
+    };
+    #[cfg_attr(
+        portable_atomic_no_cfg_target_has_atomic,
+        cfg(any(
+            not(portable_atomic_no_atomic_64),
+            not(any(target_pointer_width = "16", target_pointer_width = "32")),
+        ))
+    )]
+    #[cfg_attr(
+        not(portable_atomic_no_cfg_target_has_atomic),
+        cfg(any(
+            target_has_atomic = "64",
+            not(any(target_pointer_width = "16", target_pointer_width = "32")),
+        ))
+    )]
+    pub(crate) use self::core_atomic::{AtomicI64, AtomicU64};
+}
+// bpf
+#[cfg(all(
+    target_arch = "bpf",
+    portable_atomic_no_atomic_load_store,
+    not(feature = "critical-section"),
+))]
+pub(crate) use self::core_atomic::{AtomicI64, AtomicIsize, AtomicPtr, AtomicU64, AtomicUsize};
+
+// RISC-V without A-extension & !(assume single core | critical section)
+#[cfg(not(any(portable_atomic_unsafe_assume_single_core, feature = "critical-section")))]
+#[cfg_attr(portable_atomic_no_cfg_target_has_atomic, cfg(portable_atomic_no_atomic_cas))]
+#[cfg_attr(not(portable_atomic_no_cfg_target_has_atomic), cfg(not(target_has_atomic = "ptr")))]
+#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
+items! {
+    pub(crate) use self::riscv::{
+        AtomicI16, AtomicI32, AtomicI8, AtomicIsize, AtomicPtr, AtomicU16, AtomicU32, AtomicU8,
+        AtomicUsize,
+    };
+    #[cfg(target_arch = "riscv64")]
+    pub(crate) use self::riscv::{AtomicI64, AtomicU64};
+}
+
+// no core atomic CAS & (assume single core | critical section) => critical section based fallback
+#[cfg(any(
+    portable_atomic_unsafe_assume_single_core,
+    feature = "critical-section",
+    target_arch = "avr",
+    target_arch = "msp430",
+))]
+#[cfg_attr(portable_atomic_no_cfg_target_has_atomic, cfg(portable_atomic_no_atomic_cas))]
+#[cfg_attr(not(portable_atomic_no_cfg_target_has_atomic), cfg(not(target_has_atomic = "ptr")))]
+items! {
+    pub(crate) use self::interrupt::{
+        AtomicI16, AtomicI8, AtomicIsize, AtomicPtr, AtomicU16, AtomicU8, AtomicUsize,
+    };
+    #[cfg(any(not(target_pointer_width = "16"), feature = "fallback"))]
+    pub(crate) use self::interrupt::{AtomicI32, AtomicU32};
+    #[cfg(any(
+        not(any(target_pointer_width = "16", target_pointer_width = "32")),
+        feature = "fallback",
+    ))]
+    pub(crate) use self::interrupt::{AtomicI64, AtomicU64};
+    #[cfg(feature = "fallback")]
+    pub(crate) use self::interrupt::{AtomicI128, AtomicU128};
+}
+
+// no core (64-bit | 128-bit) atomic & has CAS => use lock-base fallback
+#[cfg(feature = "fallback")]
+#[cfg_attr(portable_atomic_no_cfg_target_has_atomic, cfg(not(portable_atomic_no_atomic_cas)))]
+#[cfg_attr(not(portable_atomic_no_cfg_target_has_atomic), cfg(target_has_atomic = "ptr"))]
+items! {
+    #[cfg(not(all(
+        target_arch = "arm",
+        not(any(miri, portable_atomic_sanitize_thread)),
+        not(portable_atomic_no_asm),
+        any(target_os = "linux", target_os = "android"),
+        not(any(target_feature = "v6", portable_atomic_target_feature = "v6")),
+        not(portable_atomic_no_outline_atomics),
+    )))]
+    #[cfg_attr(portable_atomic_no_cfg_target_has_atomic, cfg(portable_atomic_no_atomic_64))]
+    #[cfg_attr(not(portable_atomic_no_cfg_target_has_atomic), cfg(not(target_has_atomic = "64")))]
+    pub(crate) use self::fallback::{AtomicI64, AtomicU64};
+    #[cfg(not(any(
+        all(
+            target_arch = "aarch64",
+            any(not(portable_atomic_no_asm), portable_atomic_unstable_asm),
+        ),
+        all(
+            target_arch = "x86_64",
+            not(all(
+                any(miri, portable_atomic_sanitize_thread),
+                portable_atomic_no_cmpxchg16b_intrinsic,
+            )),
+            any(not(portable_atomic_no_asm), portable_atomic_unstable_asm),
+            any(
+                target_feature = "cmpxchg16b",
+                portable_atomic_target_feature = "cmpxchg16b",
+                all(
+                    feature = "fallback",
+                    not(portable_atomic_no_outline_atomics),
+                    not(any(target_env = "sgx", miri)),
+                ),
+            ),
+        ),
+        all(
+            target_arch = "powerpc64",
+            portable_atomic_unstable_asm_experimental_arch,
+            any(
+                target_feature = "quadword-atomics",
+                portable_atomic_target_feature = "quadword-atomics",
+                all(
+                    feature = "fallback",
+                    not(portable_atomic_no_outline_atomics),
+                    portable_atomic_outline_atomics, // TODO(powerpc64): currently disabled by default
+                    any(
+                        all(
+                            target_os = "linux",
+                            any(
+                                target_env = "gnu",
+                                all(
+                                    any(target_env = "musl", target_env = "ohos"),
+                                    not(target_feature = "crt-static"),
+                                ),
+                                portable_atomic_outline_atomics,
+                            ),
+                        ),
+                        target_os = "android",
+                        target_os = "freebsd",
+                    ),
+                    not(any(miri, portable_atomic_sanitize_thread)),
+                ),
+            ),
+        ),
+        all(target_arch = "s390x", portable_atomic_unstable_asm_experimental_arch),
+    )))]
+    pub(crate) use self::fallback::{AtomicI128, AtomicU128};
+}
+
+// 64-bit atomics (platform-specific)
+// pre-v6 ARM Linux
+#[cfg(feature = "fallback")]
+#[cfg(all(
+    target_arch = "arm",
+    not(any(miri, portable_atomic_sanitize_thread)),
+    not(portable_atomic_no_asm),
+    any(target_os = "linux", target_os = "android"),
+    not(any(target_feature = "v6", portable_atomic_target_feature = "v6")),
+    not(portable_atomic_no_outline_atomics),
+))]
+#[cfg_attr(portable_atomic_no_cfg_target_has_atomic, cfg(portable_atomic_no_atomic_64))]
+#[cfg_attr(not(portable_atomic_no_cfg_target_has_atomic), cfg(not(target_has_atomic = "64")))]
+pub(crate) use self::arm_linux::{AtomicI64, AtomicU64};
+
+// 128-bit atomics (platform-specific)
+// aarch64
+#[cfg(all(
+    target_arch = "aarch64",
+    any(not(portable_atomic_no_asm), portable_atomic_unstable_asm),
+))]
+pub(crate) use self::aarch64::{AtomicI128, AtomicU128};
+// x86_64 & (cmpxchg16b | outline-atomics)
+#[cfg(all(
+    target_arch = "x86_64",
+    not(all(any(miri, portable_atomic_sanitize_thread), portable_atomic_no_cmpxchg16b_intrinsic)),
+    any(not(portable_atomic_no_asm), portable_atomic_unstable_asm),
+    any(
+        target_feature = "cmpxchg16b",
+        portable_atomic_target_feature = "cmpxchg16b",
+        all(
+            feature = "fallback",
+            not(portable_atomic_no_outline_atomics),
+            not(any(target_env = "sgx", miri)),
+        ),
+    ),
+))]
+pub(crate) use self::x86_64::{AtomicI128, AtomicU128};
+// powerpc64 & (pwr8 | outline-atomics)
+#[cfg(all(
+    target_arch = "powerpc64",
+    portable_atomic_unstable_asm_experimental_arch,
+    any(
+        target_feature = "quadword-atomics",
+        portable_atomic_target_feature = "quadword-atomics",
+        all(
+            feature = "fallback",
+            not(portable_atomic_no_outline_atomics),
+            portable_atomic_outline_atomics, // TODO(powerpc64): currently disabled by default
+            any(
+                all(
+                    target_os = "linux",
+                    any(
+                        target_env = "gnu",
+                        all(
+                            any(target_env = "musl", target_env = "ohos"),
+                            not(target_feature = "crt-static"),
+                        ),
+                        portable_atomic_outline_atomics,
+                    ),
+                ),
+                target_os = "android",
+                target_os = "freebsd",
+            ),
+            not(any(miri, portable_atomic_sanitize_thread)),
+        ),
+    ),
+))]
+pub(crate) use self::powerpc64::{AtomicI128, AtomicU128};
+// s390x
+#[cfg(all(target_arch = "s390x", portable_atomic_unstable_asm_experimental_arch))]
+pub(crate) use self::s390x::{AtomicI128, AtomicU128};
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/msp430.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/msp430.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/msp430.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/msp430.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,294 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Atomic load/store implementation on MSP430.
+//
+// Adapted from https://github.com/pftbest/msp430-atomic.
+// Including https://github.com/pftbest/msp430-atomic/pull/4 for a compile error fix.
+// Including https://github.com/pftbest/msp430-atomic/pull/5 for a soundness bug fix.
+//
+// Operations not supported here are provided by disabling interrupts.
+// See also src/imp/interrupt/msp430.rs.
+//
+// Note: Ordering is always SeqCst.
+//
+// Refs: https://www.ti.com/lit/ug/slau208q/slau208q.pdf
+
+#[cfg(not(portable_atomic_no_asm))]
+use core::arch::asm;
+#[cfg(any(test, not(feature = "critical-section")))]
+use core::cell::UnsafeCell;
+use core::sync::atomic::Ordering;
+
+/// An atomic fence.
+///
+/// # Panics
+///
+/// Panics if `order` is [`Relaxed`](Ordering::Relaxed).
+#[inline]
+#[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+pub fn fence(order: Ordering) {
+    match order {
+        Ordering::Relaxed => panic!("there is no such thing as a relaxed fence"),
+        // MSP430 is single-core and a compiler fence works as an atomic fence.
+        _ => compiler_fence(order),
+    }
+}
+
+/// A compiler memory fence.
+///
+/// # Panics
+///
+/// Panics if `order` is [`Relaxed`](Ordering::Relaxed).
+#[inline]
+#[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+pub fn compiler_fence(order: Ordering) {
+    match order {
+        Ordering::Relaxed => panic!("there is no such thing as a relaxed compiler fence"),
+        _ => {}
+    }
+    // SAFETY: using an empty asm is safe.
+    unsafe {
+        // Do not use `nomem` and `readonly` because prevent preceding and subsequent memory accesses from being reordered.
+        #[cfg(not(portable_atomic_no_asm))]
+        asm!("", options(nostack, preserves_flags));
+        #[cfg(portable_atomic_no_asm)]
+        llvm_asm!("" ::: "memory" : "volatile");
+    }
+}
+
+macro_rules! atomic {
+    (load_store, $([$($generics:tt)*])? $atomic_type:ident, $value_type:ty, $asm_suffix:tt) => {
+        #[cfg(any(test, not(feature = "critical-section")))]
+        #[repr(transparent)]
+        pub(crate) struct $atomic_type $(<$($generics)*>)? {
+            v: UnsafeCell<$value_type>,
+        }
+
+        #[cfg(any(test, not(feature = "critical-section")))]
+        // Send is implicitly implemented for atomic integers, but not for atomic pointers.
+        // SAFETY: any data races are prevented by atomic operations.
+        unsafe impl $(<$($generics)*>)? Send for $atomic_type $(<$($generics)*>)? {}
+        #[cfg(any(test, not(feature = "critical-section")))]
+        // SAFETY: any data races are prevented by atomic operations.
+        unsafe impl $(<$($generics)*>)? Sync for $atomic_type $(<$($generics)*>)? {}
+
+        #[cfg(any(test, not(feature = "critical-section")))]
+        impl $(<$($generics)*>)? $atomic_type $(<$($generics)*>)? {
+            #[cfg(test)]
+            #[inline]
+            pub(crate) const fn new(v: $value_type) -> Self {
+                Self { v: UnsafeCell::new(v) }
+            }
+
+            #[cfg(test)]
+            #[inline]
+            pub(crate) fn is_lock_free() -> bool {
+                Self::is_always_lock_free()
+            }
+            #[cfg(test)]
+            #[inline]
+            pub(crate) const fn is_always_lock_free() -> bool {
+                true
+            }
+
+            #[cfg(test)]
+            #[inline]
+            pub(crate) fn get_mut(&mut self) -> &mut $value_type {
+                // SAFETY: the mutable reference guarantees unique ownership.
+                // (UnsafeCell::get_mut requires Rust 1.50)
+                unsafe { &mut *self.v.get() }
+            }
+
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn load(&self, order: Ordering) -> $value_type {
+                crate::utils::assert_load_ordering(order);
+                let src = self.v.get();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    let out;
+                    #[cfg(not(portable_atomic_no_asm))]
+                    asm!(
+                        concat!("mov", $asm_suffix, " @{src}, {out}"),
+                        src = in(reg) src,
+                        out = lateout(reg) out,
+                        options(nostack, preserves_flags),
+                    );
+                    #[cfg(portable_atomic_no_asm)]
+                    llvm_asm!(
+                        concat!("mov", $asm_suffix, " $1, $0")
+                        : "=r"(out) : "*m"(src) : "memory" : "volatile"
+                    );
+                    out
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn store(&self, val: $value_type, order: Ordering) {
+                crate::utils::assert_store_ordering(order);
+                let dst = self.v.get();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    #[cfg(not(portable_atomic_no_asm))]
+                    asm!(
+                        concat!("mov", $asm_suffix, " {val}, 0({dst})"),
+                        dst = in(reg) dst,
+                        val = in(reg) val,
+                        options(nostack, preserves_flags),
+                    );
+                    #[cfg(portable_atomic_no_asm)]
+                    llvm_asm!(
+                        concat!("mov", $asm_suffix, " $1, $0")
+                        :: "*m"(dst), "ir"(val) : "memory" : "volatile"
+                    );
+                }
+            }
+        }
+    };
+    ($([$($generics:tt)*])? $atomic_type:ident, $value_type:ty, $asm_suffix:tt) => {
+        atomic!(load_store, $([$($generics)*])? $atomic_type, $value_type, $asm_suffix);
+        #[cfg(any(test, not(feature = "critical-section")))]
+        impl $(<$($generics)*>)? $atomic_type $(<$($generics)*>)? {
+            #[inline]
+            pub(crate) fn add(&self, val: $value_type, _order: Ordering) {
+                let dst = self.v.get();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    #[cfg(not(portable_atomic_no_asm))]
+                    asm!(
+                        concat!("add", $asm_suffix, " {val}, 0({dst})"),
+                        dst = in(reg) dst,
+                        val = in(reg) val,
+                        // Do not use `preserves_flags` because ADD modifies the V, N, Z, and C bits of the status register.
+                        options(nostack),
+                    );
+                    #[cfg(portable_atomic_no_asm)]
+                    llvm_asm!(
+                        concat!("add", $asm_suffix, " $1, $0")
+                        :: "*m"(dst), "ir"(val) : "memory" : "volatile"
+                    );
+                }
+            }
+
+            #[inline]
+            pub(crate) fn sub(&self, val: $value_type, _order: Ordering) {
+                let dst = self.v.get();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    #[cfg(not(portable_atomic_no_asm))]
+                    asm!(
+                        concat!("sub", $asm_suffix, " {val}, 0({dst})"),
+                        dst = in(reg) dst,
+                        val = in(reg) val,
+                        // Do not use `preserves_flags` because SUB modifies the V, N, Z, and C bits of the status register.
+                        options(nostack),
+                    );
+                    #[cfg(portable_atomic_no_asm)]
+                    llvm_asm!(
+                        concat!("sub", $asm_suffix, " $1, $0")
+                        :: "*m"(dst), "ir"(val) : "memory" : "volatile"
+                    );
+                }
+            }
+
+            #[inline]
+            pub(crate) fn and(&self, val: $value_type, _order: Ordering) {
+                let dst = self.v.get();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    #[cfg(not(portable_atomic_no_asm))]
+                    asm!(
+                        concat!("and", $asm_suffix, " {val}, 0({dst})"),
+                        dst = in(reg) dst,
+                        val = in(reg) val,
+                        // Do not use `preserves_flags` because AND modifies the V, N, Z, and C bits of the status register.
+                        options(nostack),
+                    );
+                    #[cfg(portable_atomic_no_asm)]
+                    llvm_asm!(
+                        concat!("and", $asm_suffix, " $1, $0")
+                        :: "*m"(dst), "ir"(val) : "memory" : "volatile"
+                    );
+                }
+            }
+
+            #[inline]
+            pub(crate) fn or(&self, val: $value_type, _order: Ordering) {
+                let dst = self.v.get();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    #[cfg(not(portable_atomic_no_asm))]
+                    asm!(
+                        concat!("bis", $asm_suffix, " {val}, 0({dst})"),
+                        dst = in(reg) dst,
+                        val = in(reg) val,
+                        options(nostack, preserves_flags),
+                    );
+                    #[cfg(portable_atomic_no_asm)]
+                    llvm_asm!(
+                        concat!("bis", $asm_suffix, " $1, $0")
+                        :: "*m"(dst), "ir"(val) : "memory" : "volatile"
+                    );
+                }
+            }
+
+            #[inline]
+            pub(crate) fn xor(&self, val: $value_type, _order: Ordering) {
+                let dst = self.v.get();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    #[cfg(not(portable_atomic_no_asm))]
+                    asm!(
+                        concat!("xor", $asm_suffix, " {val}, 0({dst})"),
+                        dst = in(reg) dst,
+                        val = in(reg) val,
+                        // Do not use `preserves_flags` because XOR modifies the V, N, Z, and C bits of the status register.
+                        options(nostack),
+                    );
+                    #[cfg(portable_atomic_no_asm)]
+                    llvm_asm!(
+                        concat!("xor", $asm_suffix, " $1, $0")
+                        :: "*m"(dst), "ir"(val) : "memory" : "volatile"
+                    );
+                }
+            }
+
+            #[inline]
+            pub(crate) fn not(&self, _order: Ordering) {
+                let dst = self.v.get();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    #[cfg(not(portable_atomic_no_asm))]
+                    asm!(
+                        concat!("inv", $asm_suffix, " 0({dst})"),
+                        dst = in(reg) dst,
+                        // Do not use `preserves_flags` because INV modifies the V, N, Z, and C bits of the status register.
+                        options(nostack),
+                    );
+                    #[cfg(portable_atomic_no_asm)]
+                    llvm_asm!(
+                        concat!("inv", $asm_suffix, " $0")
+                        :: "*m"(dst) : "memory" : "volatile"
+                    );
+                }
+            }
+        }
+    }
+}
+
+atomic!(AtomicI8, i8, ".b");
+atomic!(AtomicU8, u8, ".b");
+atomic!(AtomicI16, i16, ".w");
+atomic!(AtomicU16, u16, ".w");
+atomic!(AtomicIsize, isize, ".w");
+atomic!(AtomicUsize, usize, ".w");
+atomic!(load_store, [T] AtomicPtr, *mut T, ".w");
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/riscv.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/riscv.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/riscv.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/riscv.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,747 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Atomic load/store implementation on RISC-V.
+//
+// This is for RISC-V targets without atomic CAS. (rustc doesn't provide atomics
+// at all on such targets. https://github.com/rust-lang/rust/pull/114499)
+//
+// Also, optionally provides RMW implementation when force-amo is enabled.
+//
+// Refs:
+// - RISC-V Instruction Set Manual Volume I: Unprivileged ISA
+//   https://riscv.org/wp-content/uploads/2019/12/riscv-spec-20191213.pdf
+// - RISC-V Atomics ABI Specification
+//   https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/HEAD/riscv-atomic.adoc
+// - "Mappings from C/C++ primitives to RISC-V primitives." table in RISC-V Instruction Set Manual:
+//   https://five-embeddev.com/riscv-isa-manual/latest/memory.html#sec:memory:porting
+// - atomic-maybe-uninit https://github.com/taiki-e/atomic-maybe-uninit
+//
+// Generated asm:
+// - riscv64gc https://godbolt.org/z/x8bhEn39e
+// - riscv32imac https://godbolt.org/z/aG9157dhW
+
+#[cfg(not(portable_atomic_no_asm))]
+use core::arch::asm;
+use core::{cell::UnsafeCell, sync::atomic::Ordering};
+
+#[cfg(any(test, portable_atomic_force_amo))]
+#[cfg(target_arch = "riscv32")]
+macro_rules! w {
+    () => {
+        ""
+    };
+}
+#[cfg(any(test, portable_atomic_force_amo))]
+#[cfg(target_arch = "riscv64")]
+macro_rules! w {
+    () => {
+        "w"
+    };
+}
+
+#[cfg(any(test, portable_atomic_force_amo))]
+macro_rules! atomic_rmw_amo_order {
+    ($op:ident, $order:ident) => {
+        match $order {
+            Ordering::Relaxed => $op!(""),
+            Ordering::Acquire => $op!(".aq"),
+            Ordering::Release => $op!(".rl"),
+            // AcqRel and SeqCst RMWs are equivalent.
+            Ordering::AcqRel | Ordering::SeqCst => $op!(".aqrl"),
+            _ => unreachable!(),
+        }
+    };
+}
+#[cfg(any(test, portable_atomic_force_amo))]
+macro_rules! atomic_rmw_amo {
+    ($op:ident, $dst:ident, $val:ident, $order:ident, $asm_suffix:tt) => {{
+        let out;
+        macro_rules! op {
+            ($asm_order:tt) => {
+                // SAFETY: The user guaranteed that the AMO instruction is available in this
+                // system by setting the portable_atomic_force_amo and
+                // portable_atomic_unsafe_assume_single_core.
+                // The caller of this macro must guarantee the validity of the pointer.
+                asm!(
+                    ".option push",
+                    // https://github.com/riscv-non-isa/riscv-asm-manual/blob/HEAD/riscv-asm.md#arch
+                    ".option arch, +a",
+                    concat!("amo", stringify!($op), ".", $asm_suffix, $asm_order, " {out}, {val}, 0({dst})"),
+                    ".option pop",
+                    dst = in(reg) ptr_reg!($dst),
+                    val = in(reg) $val,
+                    out = lateout(reg) out,
+                    options(nostack, preserves_flags),
+                )
+            };
+        }
+        atomic_rmw_amo_order!(op, $order);
+        out
+    }};
+}
+// 32-bit val.wrapping_shl(shift) but no extra `& (u32::BITS - 1)`
+#[cfg(any(test, portable_atomic_force_amo))]
+#[inline]
+fn sllw(val: u32, shift: u32) -> u32 {
+    // SAFETY: Calling sll{,w} is safe.
+    unsafe {
+        let out;
+        asm!(
+            concat!("sll", w!(), " {out}, {val}, {shift}"),
+            out = lateout(reg) out,
+            val = in(reg) val,
+            shift = in(reg) shift,
+            options(pure, nomem, nostack, preserves_flags),
+        );
+        out
+    }
+}
+// 32-bit val.wrapping_shr(shift) but no extra `& (u32::BITS - 1)`
+#[cfg(any(test, portable_atomic_force_amo))]
+macro_rules! srlw {
+    ($val:expr, $shift:expr) => {
+        // SAFETY: Calling srl{,w} is safe.
+        unsafe {
+            let val: u32 = $val;
+            let shift: u32 = $shift;
+            let out;
+            asm!(
+                concat!("srl", w!(), " {out}, {val}, {shift}"),
+                out = lateout(reg) out,
+                val = in(reg) val,
+                shift = in(reg) shift,
+                options(pure, nomem, nostack, preserves_flags),
+            );
+            out
+        }
+    };
+}
+
+macro_rules! atomic_load_store {
+    ($([$($generics:tt)*])? $atomic_type:ident, $value_type:ty, $asm_suffix:tt) => {
+        #[repr(transparent)]
+        pub(crate) struct $atomic_type $(<$($generics)*>)? {
+            v: UnsafeCell<$value_type>,
+        }
+
+        // Send is implicitly implemented for atomic integers, but not for atomic pointers.
+        // SAFETY: any data races are prevented by atomic operations.
+        unsafe impl $(<$($generics)*>)? Send for $atomic_type $(<$($generics)*>)? {}
+        // SAFETY: any data races are prevented by atomic operations.
+        unsafe impl $(<$($generics)*>)? Sync for $atomic_type $(<$($generics)*>)? {}
+
+        #[cfg(any(test, not(portable_atomic_unsafe_assume_single_core)))]
+        impl $(<$($generics)*>)? $atomic_type $(<$($generics)*>)? {
+            #[inline]
+            pub(crate) const fn new(v: $value_type) -> Self {
+                Self { v: UnsafeCell::new(v) }
+            }
+
+            #[inline]
+            pub(crate) fn is_lock_free() -> bool {
+                Self::is_always_lock_free()
+            }
+            #[inline]
+            pub(crate) const fn is_always_lock_free() -> bool {
+                true
+            }
+
+            #[inline]
+            pub(crate) fn get_mut(&mut self) -> &mut $value_type {
+                // SAFETY: the mutable reference guarantees unique ownership.
+                // (UnsafeCell::get_mut requires Rust 1.50)
+                unsafe { &mut *self.v.get() }
+            }
+
+            #[inline]
+            pub(crate) const fn as_ptr(&self) -> *mut $value_type {
+                self.v.get()
+            }
+        }
+        impl $(<$($generics)*>)? $atomic_type $(<$($generics)*>)? {
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn load(&self, order: Ordering) -> $value_type {
+                crate::utils::assert_load_ordering(order);
+                let src = self.v.get();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    let out;
+                    match order {
+                        Ordering::Relaxed => {
+                            asm!(
+                                concat!("l", $asm_suffix, " {out}, 0({src})"),
+                                src = in(reg) ptr_reg!(src),
+                                out = lateout(reg) out,
+                                options(nostack, preserves_flags, readonly),
+                            );
+                        }
+                        Ordering::Acquire => {
+                            asm!(
+                                concat!("l", $asm_suffix, " {out}, 0({src})"),
+                                "fence r, rw",
+                                src = in(reg) ptr_reg!(src),
+                                out = lateout(reg) out,
+                                options(nostack, preserves_flags),
+                            );
+                        }
+                        Ordering::SeqCst => {
+                            asm!(
+                                "fence rw, rw",
+                                concat!("l", $asm_suffix, " {out}, 0({src})"),
+                                "fence r, rw",
+                                src = in(reg) ptr_reg!(src),
+                                out = lateout(reg) out,
+                                options(nostack, preserves_flags),
+                            );
+                        }
+                        _ => unreachable!(),
+                    }
+                    out
+                }
+            }
+
+            #[inline]
+            #[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+            pub(crate) fn store(&self, val: $value_type, order: Ordering) {
+                crate::utils::assert_store_ordering(order);
+                let dst = self.v.get();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe {
+                    match order {
+                        Ordering::Relaxed => {
+                            asm!(
+                                concat!("s", $asm_suffix, " {val}, 0({dst})"),
+                                dst = in(reg) ptr_reg!(dst),
+                                val = in(reg) val,
+                                options(nostack, preserves_flags),
+                            );
+                        }
+                        // Release and SeqCst stores are equivalent.
+                        Ordering::Release | Ordering::SeqCst => {
+                            asm!(
+                                "fence rw, w",
+                                concat!("s", $asm_suffix, " {val}, 0({dst})"),
+                                dst = in(reg) ptr_reg!(dst),
+                                val = in(reg) val,
+                                options(nostack, preserves_flags),
+                            );
+                        }
+                        _ => unreachable!(),
+                    }
+                }
+            }
+        }
+    };
+}
+
+macro_rules! atomic_ptr {
+    ($([$($generics:tt)*])? $atomic_type:ident, $value_type:ty, $asm_suffix:tt) => {
+        atomic_load_store!($([$($generics)*])? $atomic_type, $value_type, $asm_suffix);
+        #[cfg(portable_atomic_force_amo)]
+        impl $(<$($generics)*>)? $atomic_type $(<$($generics)*>)? {
+            #[inline]
+            pub(crate) fn swap(&self, val: $value_type, order: Ordering) -> $value_type {
+                let dst = self.v.get();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe { atomic_rmw_amo!(swap, dst, val, order, $asm_suffix) }
+            }
+        }
+    };
+}
+
+macro_rules! atomic {
+    ($atomic_type:ident, $value_type:ty, $asm_suffix:tt, $max:tt, $min:tt) => {
+        atomic_load_store!($atomic_type, $value_type, $asm_suffix);
+        // There is no amo{sub,nand,neg}.
+        #[cfg(any(test, portable_atomic_force_amo))]
+        impl $atomic_type {
+            #[inline]
+            pub(crate) fn swap(&self, val: $value_type, order: Ordering) -> $value_type {
+                let dst = self.v.get();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe { atomic_rmw_amo!(swap, dst, val, order, $asm_suffix) }
+            }
+
+            #[inline]
+            pub(crate) fn fetch_add(&self, val: $value_type, order: Ordering) -> $value_type {
+                let dst = self.v.get();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe { atomic_rmw_amo!(add, dst, val, order, $asm_suffix) }
+            }
+
+            #[inline]
+            pub(crate) fn fetch_sub(&self, val: $value_type, order: Ordering) -> $value_type {
+                self.fetch_add(val.wrapping_neg(), order)
+            }
+
+            #[inline]
+            pub(crate) fn fetch_and(&self, val: $value_type, order: Ordering) -> $value_type {
+                let dst = self.v.get();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe { atomic_rmw_amo!(and, dst, val, order, $asm_suffix) }
+            }
+
+            #[inline]
+            pub(crate) fn fetch_or(&self, val: $value_type, order: Ordering) -> $value_type {
+                let dst = self.v.get();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe { atomic_rmw_amo!(or, dst, val, order, $asm_suffix) }
+            }
+
+            #[inline]
+            pub(crate) fn fetch_xor(&self, val: $value_type, order: Ordering) -> $value_type {
+                let dst = self.v.get();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe { atomic_rmw_amo!(xor, dst, val, order, $asm_suffix) }
+            }
+
+            #[inline]
+            pub(crate) fn fetch_not(&self, order: Ordering) -> $value_type {
+                self.fetch_xor(!0, order)
+            }
+
+            #[inline]
+            pub(crate) fn fetch_max(&self, val: $value_type, order: Ordering) -> $value_type {
+                let dst = self.v.get();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe { atomic_rmw_amo!($max, dst, val, order, $asm_suffix) }
+            }
+
+            #[inline]
+            pub(crate) fn fetch_min(&self, val: $value_type, order: Ordering) -> $value_type {
+                let dst = self.v.get();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                unsafe { atomic_rmw_amo!($min, dst, val, order, $asm_suffix) }
+            }
+        }
+    };
+}
+
+#[cfg(any(test, portable_atomic_force_amo))]
+trait ZeroExtend: Copy {
+    /// Zero-extends `self` to `u32` if it is smaller than 32-bit.
+    fn zero_extend(self) -> u32;
+}
+macro_rules! zero_extend {
+    ($int:ident, $uint:ident) => {
+        #[cfg(any(test, portable_atomic_force_amo))]
+        impl ZeroExtend for $uint {
+            #[inline]
+            fn zero_extend(self) -> u32 {
+                self as u32
+            }
+        }
+        #[cfg(any(test, portable_atomic_force_amo))]
+        impl ZeroExtend for $int {
+            #[allow(clippy::cast_sign_loss)]
+            #[inline]
+            fn zero_extend(self) -> u32 {
+                self as $uint as u32
+            }
+        }
+    };
+}
+zero_extend!(i8, u8);
+zero_extend!(i16, u16);
+
+macro_rules! atomic_sub_word {
+    ($atomic_type:ident, $value_type:ty, $unsigned_type:ty, $asm_suffix:tt) => {
+        atomic_load_store!($atomic_type, $value_type, $asm_suffix);
+        #[cfg(any(test, portable_atomic_force_amo))]
+        impl $atomic_type {
+            #[inline]
+            pub(crate) fn fetch_and(&self, val: $value_type, order: Ordering) -> $value_type {
+                let dst = self.v.get();
+                let (dst, shift, mut mask) = crate::utils::create_sub_word_mask_values(dst);
+                mask = !sllw(mask, shift);
+                let mut val = sllw(ZeroExtend::zero_extend(val), shift);
+                val |= mask;
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                let out: u32 = unsafe { atomic_rmw_amo!(and, dst, val, order, "w") };
+                srlw!(out, shift)
+            }
+
+            #[inline]
+            pub(crate) fn fetch_or(&self, val: $value_type, order: Ordering) -> $value_type {
+                let dst = self.v.get();
+                let (dst, shift, _mask) = crate::utils::create_sub_word_mask_values(dst);
+                let val = sllw(ZeroExtend::zero_extend(val), shift);
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                let out: u32 = unsafe { atomic_rmw_amo!(or, dst, val, order, "w") };
+                srlw!(out, shift)
+            }
+
+            #[inline]
+            pub(crate) fn fetch_xor(&self, val: $value_type, order: Ordering) -> $value_type {
+                let dst = self.v.get();
+                let (dst, shift, _mask) = crate::utils::create_sub_word_mask_values(dst);
+                let val = sllw(ZeroExtend::zero_extend(val), shift);
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                let out: u32 = unsafe { atomic_rmw_amo!(xor, dst, val, order, "w") };
+                srlw!(out, shift)
+            }
+
+            #[inline]
+            pub(crate) fn fetch_not(&self, order: Ordering) -> $value_type {
+                self.fetch_xor(!0, order)
+            }
+        }
+    };
+}
+
+atomic_sub_word!(AtomicI8, i8, u8, "b");
+atomic_sub_word!(AtomicU8, u8, u8, "b");
+atomic_sub_word!(AtomicI16, i16, u16, "h");
+atomic_sub_word!(AtomicU16, u16, u16, "h");
+atomic!(AtomicI32, i32, "w", max, min);
+atomic!(AtomicU32, u32, "w", maxu, minu);
+#[cfg(target_arch = "riscv64")]
+atomic!(AtomicI64, i64, "d", max, min);
+#[cfg(target_arch = "riscv64")]
+atomic!(AtomicU64, u64, "d", maxu, minu);
+#[cfg(target_pointer_width = "32")]
+atomic!(AtomicIsize, isize, "w", max, min);
+#[cfg(target_pointer_width = "32")]
+atomic!(AtomicUsize, usize, "w", maxu, minu);
+#[cfg(target_pointer_width = "32")]
+atomic_ptr!([T] AtomicPtr, *mut T, "w");
+#[cfg(target_pointer_width = "64")]
+atomic!(AtomicIsize, isize, "d", max, min);
+#[cfg(target_pointer_width = "64")]
+atomic!(AtomicUsize, usize, "d", maxu, minu);
+#[cfg(target_pointer_width = "64")]
+atomic_ptr!([T] AtomicPtr, *mut T, "d");
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    test_atomic_ptr_load_store!();
+    test_atomic_int_load_store!(i8);
+    test_atomic_int_load_store!(u8);
+    test_atomic_int_load_store!(i16);
+    test_atomic_int_load_store!(u16);
+    test_atomic_int_load_store!(i32);
+    test_atomic_int_load_store!(u32);
+    #[cfg(target_arch = "riscv64")]
+    test_atomic_int_load_store!(i64);
+    #[cfg(target_arch = "riscv64")]
+    test_atomic_int_load_store!(u64);
+    test_atomic_int_load_store!(isize);
+    test_atomic_int_load_store!(usize);
+
+    macro_rules! test_atomic_int_amo {
+        ($int_type:ident) => {
+            paste::paste! {
+                #[allow(
+                    clippy::alloc_instead_of_core,
+                    clippy::std_instead_of_alloc,
+                    clippy::std_instead_of_core,
+                    clippy::undocumented_unsafe_blocks
+                )]
+                mod [<test_atomic_ $int_type _amo>] {
+                    use super::*;
+                    test_atomic_int_amo!([<Atomic $int_type:camel>], $int_type);
+                }
+            }
+        };
+        ($atomic_type:ty, $int_type:ident) => {
+            ::quickcheck::quickcheck! {
+                fn quickcheck_swap(x: $int_type, y: $int_type) -> bool {
+                    for &order in &test_helper::SWAP_ORDERINGS {
+                        let a = <$atomic_type>::new(x);
+                        assert_eq!(a.swap(y, order), x);
+                        assert_eq!(a.swap(x, order), y);
+                    }
+                    true
+                }
+                fn quickcheck_fetch_add(x: $int_type, y: $int_type) -> bool {
+                    for &order in &test_helper::SWAP_ORDERINGS {
+                        let a = <$atomic_type>::new(x);
+                        assert_eq!(a.fetch_add(y, order), x);
+                        assert_eq!(a.load(Ordering::Relaxed), x.wrapping_add(y));
+                        let a = <$atomic_type>::new(y);
+                        assert_eq!(a.fetch_add(x, order), y);
+                        assert_eq!(a.load(Ordering::Relaxed), y.wrapping_add(x));
+                    }
+                    true
+                }
+                fn quickcheck_fetch_sub(x: $int_type, y: $int_type) -> bool {
+                    for &order in &test_helper::SWAP_ORDERINGS {
+                        let a = <$atomic_type>::new(x);
+                        assert_eq!(a.fetch_sub(y, order), x);
+                        assert_eq!(a.load(Ordering::Relaxed), x.wrapping_sub(y));
+                        let a = <$atomic_type>::new(y);
+                        assert_eq!(a.fetch_sub(x, order), y);
+                        assert_eq!(a.load(Ordering::Relaxed), y.wrapping_sub(x));
+                    }
+                    true
+                }
+                fn quickcheck_fetch_and(x: $int_type, y: $int_type) -> bool {
+                    for &order in &test_helper::SWAP_ORDERINGS {
+                        let a = <$atomic_type>::new(x);
+                        assert_eq!(a.fetch_and(y, order), x);
+                        assert_eq!(a.load(Ordering::Relaxed), x & y);
+                        let a = <$atomic_type>::new(y);
+                        assert_eq!(a.fetch_and(x, order), y);
+                        assert_eq!(a.load(Ordering::Relaxed), y & x);
+                    }
+                    true
+                }
+                fn quickcheck_fetch_or(x: $int_type, y: $int_type) -> bool {
+                    for &order in &test_helper::SWAP_ORDERINGS {
+                        let a = <$atomic_type>::new(x);
+                        assert_eq!(a.fetch_or(y, order), x);
+                        assert_eq!(a.load(Ordering::Relaxed), x | y);
+                        let a = <$atomic_type>::new(y);
+                        assert_eq!(a.fetch_or(x, order), y);
+                        assert_eq!(a.load(Ordering::Relaxed), y | x);
+                    }
+                    true
+                }
+                fn quickcheck_fetch_xor(x: $int_type, y: $int_type) -> bool {
+                    for &order in &test_helper::SWAP_ORDERINGS {
+                        let a = <$atomic_type>::new(x);
+                        assert_eq!(a.fetch_xor(y, order), x);
+                        assert_eq!(a.load(Ordering::Relaxed), x ^ y);
+                        let a = <$atomic_type>::new(y);
+                        assert_eq!(a.fetch_xor(x, order), y);
+                        assert_eq!(a.load(Ordering::Relaxed), y ^ x);
+                    }
+                    true
+                }
+                fn quickcheck_fetch_max(x: $int_type, y: $int_type) -> bool {
+                    for &order in &test_helper::SWAP_ORDERINGS {
+                        let a = <$atomic_type>::new(x);
+                        assert_eq!(a.fetch_max(y, order), x);
+                        assert_eq!(a.load(Ordering::Relaxed), core::cmp::max(x, y));
+                        let a = <$atomic_type>::new(y);
+                        assert_eq!(a.fetch_max(x, order), y);
+                        assert_eq!(a.load(Ordering::Relaxed), core::cmp::max(y, x));
+                    }
+                    true
+                }
+                fn quickcheck_fetch_min(x: $int_type, y: $int_type) -> bool {
+                    for &order in &test_helper::SWAP_ORDERINGS {
+                        let a = <$atomic_type>::new(x);
+                        assert_eq!(a.fetch_min(y, order), x);
+                        assert_eq!(a.load(Ordering::Relaxed), core::cmp::min(x, y));
+                        let a = <$atomic_type>::new(y);
+                        assert_eq!(a.fetch_min(x, order), y);
+                        assert_eq!(a.load(Ordering::Relaxed), core::cmp::min(y, x));
+                    }
+                    true
+                }
+                fn quickcheck_fetch_not(x: $int_type) -> bool {
+                    for &order in &test_helper::SWAP_ORDERINGS {
+                        let a = <$atomic_type>::new(x);
+                        assert_eq!(a.fetch_not(order), x);
+                        assert_eq!(a.load(Ordering::Relaxed), !x);
+                        assert_eq!(a.fetch_not(order), !x);
+                        assert_eq!(a.load(Ordering::Relaxed), x);
+                    }
+                    true
+                }
+            }
+        };
+    }
+    macro_rules! test_atomic_int_amo_sub_word {
+        ($int_type:ident) => {
+            paste::paste! {
+                #[allow(
+                    clippy::alloc_instead_of_core,
+                    clippy::std_instead_of_alloc,
+                    clippy::std_instead_of_core,
+                    clippy::undocumented_unsafe_blocks
+                )]
+                mod [<test_atomic_ $int_type _amo>] {
+                    use super::*;
+                    test_atomic_int_amo_sub_word!([<Atomic $int_type:camel>], $int_type);
+                }
+            }
+        };
+        ($atomic_type:ty, $int_type:ident) => {
+            use crate::tests::helper::*;
+            ::quickcheck::quickcheck! {
+                fn quickcheck_fetch_and(x: $int_type, y: $int_type) -> bool {
+                    for &order in &test_helper::SWAP_ORDERINGS {
+                        for base in [0, !0] {
+                            let mut arr = Align16([
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                            ]);
+                            let a_idx = fastrand::usize(3..=6);
+                            arr.0[a_idx] = <$atomic_type>::new(x);
+                            let a = &arr.0[a_idx];
+                            assert_eq!(a.fetch_and(y, order), x);
+                            assert_eq!(a.load(Ordering::Relaxed), x & y);
+                            for i in 0..a_idx {
+                                assert_eq!(arr.0[i].load(Ordering::Relaxed), base, "invalid value written");
+                            }
+                            for i in a_idx + 1..arr.0.len() {
+                                assert_eq!(arr.0[i].load(Ordering::Relaxed), base, "invalid value written");
+                            }
+                            arr.0[a_idx] = <$atomic_type>::new(y);
+                            let a = &arr.0[a_idx];
+                            assert_eq!(a.fetch_and(x, order), y);
+                            assert_eq!(a.load(Ordering::Relaxed), y & x);
+                            for i in 0..a_idx {
+                                assert_eq!(arr.0[i].load(Ordering::Relaxed), base, "invalid value written");
+                            }
+                            for i in a_idx + 1..arr.0.len() {
+                                assert_eq!(arr.0[i].load(Ordering::Relaxed), base, "invalid value written");
+                            }
+                        }
+                    }
+                    true
+                }
+                fn quickcheck_fetch_or(x: $int_type, y: $int_type) -> bool {
+                    for &order in &test_helper::SWAP_ORDERINGS {
+                        for base in [0, !0] {
+                            let mut arr = Align16([
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                            ]);
+                            let a_idx = fastrand::usize(3..=6);
+                            arr.0[a_idx] = <$atomic_type>::new(x);
+                            let a = &arr.0[a_idx];
+                            assert_eq!(a.fetch_or(y, order), x);
+                            assert_eq!(a.load(Ordering::Relaxed), x | y);
+                            for i in 0..a_idx {
+                                assert_eq!(arr.0[i].load(Ordering::Relaxed), base, "invalid value written");
+                            }
+                            for i in a_idx + 1..arr.0.len() {
+                                assert_eq!(arr.0[i].load(Ordering::Relaxed), base, "invalid value written");
+                            }
+                            arr.0[a_idx] = <$atomic_type>::new(y);
+                            let a = &arr.0[a_idx];
+                            assert_eq!(a.fetch_or(x, order), y);
+                            assert_eq!(a.load(Ordering::Relaxed), y | x);
+                            for i in 0..a_idx {
+                                assert_eq!(arr.0[i].load(Ordering::Relaxed), base, "invalid value written");
+                            }
+                            for i in a_idx + 1..arr.0.len() {
+                                assert_eq!(arr.0[i].load(Ordering::Relaxed), base, "invalid value written");
+                            }
+                        }
+                    }
+                    true
+                }
+                fn quickcheck_fetch_xor(x: $int_type, y: $int_type) -> bool {
+                    for &order in &test_helper::SWAP_ORDERINGS {
+                        for base in [0, !0] {
+                            let mut arr = Align16([
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                            ]);
+                            let a_idx = fastrand::usize(3..=6);
+                            arr.0[a_idx] = <$atomic_type>::new(x);
+                            let a = &arr.0[a_idx];
+                            assert_eq!(a.fetch_xor(y, order), x);
+                            assert_eq!(a.load(Ordering::Relaxed), x ^ y);
+                            for i in 0..a_idx {
+                                assert_eq!(arr.0[i].load(Ordering::Relaxed), base, "invalid value written");
+                            }
+                            for i in a_idx + 1..arr.0.len() {
+                                assert_eq!(arr.0[i].load(Ordering::Relaxed), base, "invalid value written");
+                            }
+                            arr.0[a_idx] = <$atomic_type>::new(y);
+                            let a = &arr.0[a_idx];
+                            assert_eq!(a.fetch_xor(x, order), y);
+                            assert_eq!(a.load(Ordering::Relaxed), y ^ x);
+                            for i in 0..a_idx {
+                                assert_eq!(arr.0[i].load(Ordering::Relaxed), base, "invalid value written");
+                            }
+                            for i in a_idx + 1..arr.0.len() {
+                                assert_eq!(arr.0[i].load(Ordering::Relaxed), base, "invalid value written");
+                            }
+                        }
+                    }
+                    true
+                }
+                fn quickcheck_fetch_not(x: $int_type) -> bool {
+                    for &order in &test_helper::SWAP_ORDERINGS {
+                        for base in [0, !0] {
+                            let mut arr = Align16([
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                                <$atomic_type>::new(base),
+                            ]);
+                            let a_idx = fastrand::usize(3..=6);
+                            arr.0[a_idx] = <$atomic_type>::new(x);
+                            let a = &arr.0[a_idx];
+                            assert_eq!(a.fetch_not(order), x);
+                            assert_eq!(a.load(Ordering::Relaxed), !x);
+                            assert_eq!(a.fetch_not(order), !x);
+                            assert_eq!(a.load(Ordering::Relaxed), x);
+                            for i in 0..a_idx {
+                                assert_eq!(arr.0[i].load(Ordering::Relaxed), base, "invalid value written");
+                            }
+                            for i in a_idx + 1..arr.0.len() {
+                                assert_eq!(arr.0[i].load(Ordering::Relaxed), base, "invalid value written");
+                            }
+                        }
+                    }
+                    true
+                }
+            }
+        };
+    }
+    test_atomic_int_amo_sub_word!(i8);
+    test_atomic_int_amo_sub_word!(u8);
+    test_atomic_int_amo_sub_word!(i16);
+    test_atomic_int_amo_sub_word!(u16);
+    test_atomic_int_amo!(i32);
+    test_atomic_int_amo!(u32);
+    #[cfg(target_arch = "riscv64")]
+    test_atomic_int_amo!(i64);
+    #[cfg(target_arch = "riscv64")]
+    test_atomic_int_amo!(u64);
+    test_atomic_int_amo!(isize);
+    test_atomic_int_amo!(usize);
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/imp/x86.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/x86.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/imp/x86.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/imp/x86.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,230 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// Atomic operations implementation on x86/x86_64.
+//
+// This module provides atomic operations not supported by LLVM or optimizes
+// cases where LLVM code generation is not optimal.
+//
+// Note: On Miri and ThreadSanitizer which do not support inline assembly, we don't use
+// this module and use CAS loop instead.
+//
+// Refs:
+// - x86 and amd64 instruction reference https://www.felixcloutier.com/x86
+//
+// Generated asm:
+// - x86_64 https://godbolt.org/z/Kcsj1jd9c
+
+use core::{arch::asm, sync::atomic::Ordering};
+
+use super::core_atomic::{
+    AtomicI16, AtomicI32, AtomicI64, AtomicI8, AtomicIsize, AtomicU16, AtomicU32, AtomicU64,
+    AtomicU8, AtomicUsize,
+};
+
+#[cfg(target_pointer_width = "32")]
+macro_rules! ptr_modifier {
+    () => {
+        ":e"
+    };
+}
+#[cfg(target_pointer_width = "64")]
+macro_rules! ptr_modifier {
+    () => {
+        ""
+    };
+}
+
+macro_rules! atomic_int {
+    ($atomic_type:ident, $ptr_size:tt) => {
+        impl $atomic_type {
+            #[inline]
+            pub(crate) fn not(&self, _order: Ordering) {
+                let dst = self.as_ptr();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                //
+                // https://www.felixcloutier.com/x86/not
+                unsafe {
+                    // atomic RMW is always SeqCst.
+                    asm!(
+                        concat!("lock not ", $ptr_size, " ptr [{dst", ptr_modifier!(), "}]"),
+                        dst = in(reg) dst,
+                        options(nostack, preserves_flags),
+                    );
+                }
+            }
+            #[inline]
+            pub(crate) fn neg(&self, _order: Ordering) {
+                let dst = self.as_ptr();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                //
+                // https://www.felixcloutier.com/x86/neg
+                unsafe {
+                    // atomic RMW is always SeqCst.
+                    asm!(
+                        concat!("lock neg ", $ptr_size, " ptr [{dst", ptr_modifier!(), "}]"),
+                        dst = in(reg) dst,
+                        // Do not use `preserves_flags` because NEG modifies the CF, OF, SF, ZF, AF, and PF flag.
+                        options(nostack),
+                    );
+                }
+            }
+        }
+    };
+}
+
+atomic_int!(AtomicI8, "byte");
+atomic_int!(AtomicU8, "byte");
+atomic_int!(AtomicI16, "word");
+atomic_int!(AtomicU16, "word");
+atomic_int!(AtomicI32, "dword");
+atomic_int!(AtomicU32, "dword");
+#[cfg(target_arch = "x86_64")]
+atomic_int!(AtomicI64, "qword");
+#[cfg(target_arch = "x86_64")]
+atomic_int!(AtomicU64, "qword");
+#[cfg(target_pointer_width = "32")]
+atomic_int!(AtomicIsize, "dword");
+#[cfg(target_pointer_width = "32")]
+atomic_int!(AtomicUsize, "dword");
+#[cfg(target_pointer_width = "64")]
+atomic_int!(AtomicIsize, "qword");
+#[cfg(target_pointer_width = "64")]
+atomic_int!(AtomicUsize, "qword");
+
+#[cfg(target_arch = "x86")]
+impl AtomicI64 {
+    #[inline]
+    pub(crate) fn not(&self, order: Ordering) {
+        self.fetch_not(order);
+    }
+    #[inline]
+    pub(crate) fn neg(&self, order: Ordering) {
+        self.fetch_neg(order);
+    }
+}
+#[cfg(target_arch = "x86")]
+impl AtomicU64 {
+    #[inline]
+    pub(crate) fn not(&self, order: Ordering) {
+        self.fetch_not(order);
+    }
+    #[inline]
+    pub(crate) fn neg(&self, order: Ordering) {
+        self.fetch_neg(order);
+    }
+}
+
+macro_rules! atomic_bit_opts {
+    ($atomic_type:ident, $int_type:ident, $val_modifier:tt, $ptr_size:tt) => {
+        // LLVM 14 and older don't support generating `lock bt{s,r,c}`.
+        // LLVM 15 only supports generating `lock bt{s,r,c}` for immediate bit offsets.
+        // LLVM 16+ can generate `lock bt{s,r,c}` for both immediate and register bit offsets.
+        // https://godbolt.org/z/TGhr5z4ds
+        // So, use fetch_* based implementations on LLVM 16+, otherwise use asm based implementations.
+        #[cfg(portable_atomic_llvm_16)]
+        impl_default_bit_opts!($atomic_type, $int_type);
+        #[cfg(not(portable_atomic_llvm_16))]
+        impl $atomic_type {
+            #[inline]
+            pub(crate) fn bit_set(&self, bit: u32, _order: Ordering) -> bool {
+                let dst = self.as_ptr();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                // the masking by the bit size of the type ensures that we do not shift
+                // out of bounds.
+                //
+                // https://www.felixcloutier.com/x86/bts
+                unsafe {
+                    let r: u8;
+                    // atomic RMW is always SeqCst.
+                    asm!(
+                        concat!("lock bts ", $ptr_size, " ptr [{dst", ptr_modifier!(), "}], {bit", $val_modifier, "}"),
+                        "setb {r}",
+                        dst = in(reg) dst,
+                        bit = in(reg) (bit & ($int_type::BITS - 1)) as $int_type,
+                        r = out(reg_byte) r,
+                        // Do not use `preserves_flags` because BTS modifies the CF flag.
+                        options(nostack),
+                    );
+                    crate::utils::assert_unchecked(r == 0 || r == 1); // may help remove extra test
+                    r != 0
+                }
+            }
+            #[inline]
+            pub(crate) fn bit_clear(&self, bit: u32, _order: Ordering) -> bool {
+                let dst = self.as_ptr();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                // the masking by the bit size of the type ensures that we do not shift
+                // out of bounds.
+                //
+                // https://www.felixcloutier.com/x86/btr
+                unsafe {
+                    let r: u8;
+                    // atomic RMW is always SeqCst.
+                    asm!(
+                        concat!("lock btr ", $ptr_size, " ptr [{dst", ptr_modifier!(), "}], {bit", $val_modifier, "}"),
+                        "setb {r}",
+                        dst = in(reg) dst,
+                        bit = in(reg) (bit & ($int_type::BITS - 1)) as $int_type,
+                        r = out(reg_byte) r,
+                        // Do not use `preserves_flags` because BTR modifies the CF flag.
+                        options(nostack),
+                    );
+                    crate::utils::assert_unchecked(r == 0 || r == 1); // may help remove extra test
+                    r != 0
+                }
+            }
+            #[inline]
+            pub(crate) fn bit_toggle(&self, bit: u32, _order: Ordering) -> bool {
+                let dst = self.as_ptr();
+                // SAFETY: any data races are prevented by atomic intrinsics and the raw
+                // pointer passed in is valid because we got it from a reference.
+                // the masking by the bit size of the type ensures that we do not shift
+                // out of bounds.
+                //
+                // https://www.felixcloutier.com/x86/btc
+                unsafe {
+                    let r: u8;
+                    // atomic RMW is always SeqCst.
+                    asm!(
+                        concat!("lock btc ", $ptr_size, " ptr [{dst", ptr_modifier!(), "}], {bit", $val_modifier, "}"),
+                        "setb {r}",
+                        dst = in(reg) dst,
+                        bit = in(reg) (bit & ($int_type::BITS - 1)) as $int_type,
+                        r = out(reg_byte) r,
+                        // Do not use `preserves_flags` because BTC modifies the CF flag.
+                        options(nostack),
+                    );
+                    crate::utils::assert_unchecked(r == 0 || r == 1); // may help remove extra test
+                    r != 0
+                }
+            }
+        }
+    };
+}
+
+impl_default_bit_opts!(AtomicI8, i8);
+impl_default_bit_opts!(AtomicU8, u8);
+atomic_bit_opts!(AtomicI16, i16, ":x", "word");
+atomic_bit_opts!(AtomicU16, u16, ":x", "word");
+atomic_bit_opts!(AtomicI32, i32, ":e", "dword");
+atomic_bit_opts!(AtomicU32, u32, ":e", "dword");
+#[cfg(target_arch = "x86_64")]
+atomic_bit_opts!(AtomicI64, i64, "", "qword");
+#[cfg(target_arch = "x86_64")]
+atomic_bit_opts!(AtomicU64, u64, "", "qword");
+#[cfg(target_arch = "x86")]
+impl_default_bit_opts!(AtomicI64, i64);
+#[cfg(target_arch = "x86")]
+impl_default_bit_opts!(AtomicU64, u64);
+#[cfg(target_pointer_width = "32")]
+atomic_bit_opts!(AtomicIsize, isize, ":e", "dword");
+#[cfg(target_pointer_width = "32")]
+atomic_bit_opts!(AtomicUsize, usize, ":e", "dword");
+#[cfg(target_pointer_width = "64")]
+atomic_bit_opts!(AtomicIsize, isize, "", "qword");
+#[cfg(target_pointer_width = "64")]
+atomic_bit_opts!(AtomicUsize, usize, "", "qword");
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/lib.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4025 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+/*!
+<!-- tidy:crate-doc:start -->
+Portable atomic types including support for 128-bit atomics, atomic float, etc.
+
+<!-- TODO: move atomic_bool_fetch_not to "features that require newer compilers" group once 1.81 became stable: https://github.com/rust-lang/rust/pull/127204 -->
+- Provide all atomic integer types (`Atomic{I,U}{8,16,32,64}`) for all targets that can use atomic CAS. (i.e., all targets that can use `std`, and most no-std targets)
+- Provide `AtomicI128` and `AtomicU128`.
+- Provide `AtomicF32` and `AtomicF64`. ([optional, requires the `float` feature](#optional-features-float))
+- Provide atomic load/store for targets where atomic is not available at all in the standard library. (RISC-V without A-extension, MSP430, AVR)
+- Provide atomic CAS for targets where atomic CAS is not available in the standard library. (thumbv6m, pre-v6 ARM, RISC-V without A-extension, MSP430, AVR, Xtensa, etc.) (always enabled for MSP430 and AVR, [optional](#optional-features-critical-section) otherwise)
+- Provide stable equivalents of the standard library's atomic types' unstable APIs, such as [`AtomicPtr::fetch_*`](https://github.com/rust-lang/rust/issues/99108), [`AtomicBool::fetch_not`](https://github.com/rust-lang/rust/issues/98485).
+- Make features that require newer compilers, such as [`fetch_{max,min}`](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicUsize.html#method.fetch_max), [`fetch_update`](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicUsize.html#method.fetch_update), [`as_ptr`](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicUsize.html#method.as_ptr), [`from_ptr`](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicUsize.html#method.from_ptr) and [stronger CAS failure ordering](https://github.com/rust-lang/rust/pull/98383) available on Rust 1.34+.
+- Provide workaround for bugs in the standard library's atomic-related APIs, such as [rust-lang/rust#100650], `fence`/`compiler_fence` on MSP430 that cause LLVM error, etc.
+
+<!-- TODO:
+- mention Atomic{I,U}*::fetch_neg, Atomic{I*,U*,Ptr}::bit_*, etc.
+- mention optimizations not available in the standard library's equivalents
+-->
+
+portable-atomic version of `std::sync::Arc` is provided by the [portable-atomic-util](https://github.com/taiki-e/portable-atomic/tree/HEAD/portable-atomic-util) crate.
+
+## Usage
+
+Add this to your `Cargo.toml`:
+
+```toml
+[dependencies]
+portable-atomic = "1"
+```
+
+The default features are mainly for users who use atomics larger than the pointer width.
+If you don't need them, disabling the default features may reduce code size and compile time slightly.
+
+```toml
+[dependencies]
+portable-atomic = { version = "1", default-features = false }
+```
+
+If your crate supports no-std environment and requires atomic CAS, enabling the `require-cas` feature will allow the `portable-atomic` to display a [helpful error message](https://github.com/taiki-e/portable-atomic/pull/100) to users on targets requiring additional action on the user side to provide atomic CAS.
+
+```toml
+[dependencies]
+portable-atomic = { version = "1.3", default-features = false, features = ["require-cas"] }
+```
+
+## 128-bit atomics support
+
+Native 128-bit atomic operations are available on x86_64 (Rust 1.59+), aarch64 (Rust 1.59+), powerpc64 (nightly only), and s390x (nightly only), otherwise the fallback implementation is used.
+
+On x86_64, even if `cmpxchg16b` is not available at compile-time (note: `cmpxchg16b` target feature is enabled by default only on Apple and Windows (except Windows 7) targets), run-time detection checks whether `cmpxchg16b` is available. If `cmpxchg16b` is not available at either compile-time or run-time detection, the fallback implementation is used. See also [`portable_atomic_no_outline_atomics`](#optional-cfg-no-outline-atomics) cfg.
+
+They are usually implemented using inline assembly, and when using Miri or ThreadSanitizer that do not support inline assembly, core intrinsics are used instead of inline assembly if possible.
+
+See the [`atomic128` module's readme](https://github.com/taiki-e/portable-atomic/blob/HEAD/src/imp/atomic128/README.md) for details.
+
+## Optional features
+
+- **`fallback`** *(enabled by default)*<br>
+  Enable fallback implementations.
+
+  Disabling this allows only atomic types for which the platform natively supports atomic operations.
+
+- <a name="optional-features-float"></a>**`float`**<br>
+  Provide `AtomicF{32,64}`.
+
+  Note that most of `fetch_*` operations of atomic floats are implemented using CAS loops, which can be slower than equivalent operations of atomic integers. ([GPU targets have atomic instructions for float, so we plan to use these instructions for GPU targets in the future.](https://github.com/taiki-e/portable-atomic/issues/34))
+
+- **`std`**<br>
+  Use `std`.
+
+- <a name="optional-features-require-cas"></a>**`require-cas`**<br>
+  Emit compile error if atomic CAS is not available. See [Usage](#usage) section and [#100](https://github.com/taiki-e/portable-atomic/pull/100) for more.
+
+- <a name="optional-features-serde"></a>**`serde`**<br>
+  Implement `serde::{Serialize,Deserialize}` for atomic types.
+
+  Note:
+  - The MSRV when this feature is enabled depends on the MSRV of [serde].
+
+- <a name="optional-features-critical-section"></a>**`critical-section`**<br>
+  When this feature is enabled, this crate uses [critical-section] to provide atomic CAS for targets where
+  it is not natively available. When enabling it, you should provide a suitable critical section implementation
+  for the current target, see the [critical-section] documentation for details on how to do so.
+
+  `critical-section` support is useful to get atomic CAS when the [`unsafe-assume-single-core` feature](#optional-features-unsafe-assume-single-core) can't be used,
+  such as multi-core targets, unprivileged code running under some RTOS, or environments where disabling interrupts
+  needs extra care due to e.g. real-time requirements.
+
+  Note that with the `critical-section` feature, critical sections are taken for all atomic operations, while with
+  [`unsafe-assume-single-core` feature](#optional-features-unsafe-assume-single-core) some operations don't require disabling interrupts (loads and stores, but
+  additionally on MSP430 `add`, `sub`, `and`, `or`, `xor`, `not`). Therefore, for better performance, if
+  all the `critical-section` implementation for your target does is disable interrupts, prefer using
+  `unsafe-assume-single-core` feature instead.
+
+  Note:
+  - The MSRV when this feature is enabled depends on the MSRV of [critical-section].
+  - It is usually *not* recommended to always enable this feature in dependencies of the library.
+
+    Enabling this feature will prevent the end user from having the chance to take advantage of other (potentially) efficient implementations ([Implementations provided by `unsafe-assume-single-core` feature, default implementations on MSP430 and AVR](#optional-features-unsafe-assume-single-core), implementation proposed in [#60], etc. Other systems may also be supported in the future).
+
+    The recommended approach for libraries is to leave it up to the end user whether or not to enable this feature. (However, it may make sense to enable this feature by default for libraries specific to a platform where other implementations are known not to work.)
+
+    As an example, the end-user's `Cargo.toml` that uses a crate that provides a critical-section implementation and a crate that depends on portable-atomic as an option would be expected to look like this:
+
+    ```toml
+    [dependencies]
+    portable-atomic = { version = "1", default-features = false, features = ["critical-section"] }
+    crate-provides-critical-section-impl = "..."
+    crate-uses-portable-atomic-as-feature = { version = "...", features = ["portable-atomic"] }
+    ```
+
+- <a name="optional-features-unsafe-assume-single-core"></a>**`unsafe-assume-single-core`**<br>
+  Assume that the target is single-core.
+  When this feature is enabled, this crate provides atomic CAS for targets where atomic CAS is not available in the standard library by disabling interrupts.
+
+  This feature is `unsafe`, and note the following safety requirements:
+  - Enabling this feature for multi-core systems is always **unsound**.
+  - This uses privileged instructions to disable interrupts, so it usually doesn't work on unprivileged mode.
+    Enabling this feature in an environment where privileged instructions are not available, or if the instructions used are not sufficient to disable interrupts in the system, it is also usually considered **unsound**, although the details are system-dependent.
+
+    The following are known cases:
+    - On pre-v6 ARM, this disables only IRQs by default. For many systems (e.g., GBA) this is enough. If the system need to disable both IRQs and FIQs, you need to enable the `disable-fiq` feature together.
+    - On RISC-V without A-extension, this generates code for machine-mode (M-mode) by default. If you enable the `s-mode` together, this generates code for supervisor-mode (S-mode). In particular, `qemu-system-riscv*` uses [OpenSBI](https://github.com/riscv-software-src/opensbi) as the default firmware.
+
+    See also [the `interrupt` module's readme](https://github.com/taiki-e/portable-atomic/blob/HEAD/src/imp/interrupt/README.md).
+
+  Consider using the [`critical-section` feature](#optional-features-critical-section) for systems that cannot use this feature.
+
+  It is **very strongly discouraged** to enable this feature in libraries that depend on `portable-atomic`. The recommended approach for libraries is to leave it up to the end user whether or not to enable this feature. (However, it may make sense to enable this feature by default for libraries specific to a platform where it is guaranteed to always be sound, for example in a hardware abstraction layer targeting a single-core chip.)
+
+  ARMv6-M (thumbv6m), pre-v6 ARM (e.g., thumbv4t, thumbv5te), RISC-V without A-extension, and Xtensa are currently supported.
+
+  Since all MSP430 and AVR are single-core, we always provide atomic CAS for them without this feature.
+
+  Enabling this feature for targets that have atomic CAS will result in a compile error.
+
+  Feel free to submit an issue if your target is not supported yet.
+
+## Optional cfg
+
+One of the ways to enable cfg is to set [rustflags in the cargo config](https://doc.rust-lang.org/cargo/reference/config.html#targettriplerustflags):
+
+```toml
+# .cargo/config.toml
+[target.<target>]
+rustflags = ["--cfg", "portable_atomic_no_outline_atomics"]
+```
+
+Or set environment variable:
+
+```sh
+RUSTFLAGS="--cfg portable_atomic_no_outline_atomics" cargo ...
+```
+
+- <a name="optional-cfg-unsafe-assume-single-core"></a>**`--cfg portable_atomic_unsafe_assume_single_core`**<br>
+  Since 1.4.0, this cfg is an alias of [`unsafe-assume-single-core` feature](#optional-features-unsafe-assume-single-core).
+
+  Originally, we were providing these as cfgs instead of features, but based on a strong request from the embedded ecosystem, we have agreed to provide them as features as well. See [#94](https://github.com/taiki-e/portable-atomic/pull/94) for more.
+
+- <a name="optional-cfg-no-outline-atomics"></a>**`--cfg portable_atomic_no_outline_atomics`**<br>
+  Disable dynamic dispatching by run-time CPU feature detection.
+
+  If dynamic dispatching by run-time CPU feature detection is enabled, it allows maintaining support for older CPUs while using features that are not supported on older CPUs, such as CMPXCHG16B (x86_64) and FEAT_LSE/FEAT_LSE2 (aarch64).
+
+  Note:
+  - Dynamic detection is currently only enabled in Rust 1.59+ for aarch64 and x86_64, nightly only for powerpc64 (disabled by default), otherwise it works the same as when this cfg is set.
+  - If the required target features are enabled at compile-time, the atomic operations are inlined.
+  - This is compatible with no-std (as with all features except `std`).
+  - On some targets, run-time detection is disabled by default mainly for compatibility with older versions of operating systems or incomplete build environments, and can be enabled by `--cfg portable_atomic_outline_atomics`. (When both cfg are enabled, `*_no_*` cfg is preferred.)
+  - Some aarch64 targets enable LLVM's `outline-atomics` target feature by default, so if you set this cfg, you may want to disable that as well. (portable-atomic's outline-atomics does not depend on the compiler-rt symbols, so even if you need to disable LLVM's outline-atomics, you may not need to disable portable-atomic's outline-atomics.)
+
+  See also the [`atomic128` module's readme](https://github.com/taiki-e/portable-atomic/blob/HEAD/src/imp/atomic128/README.md).
+
+## Related Projects
+
+- [atomic-maybe-uninit]: Atomic operations on potentially uninitialized integers.
+- [atomic-memcpy]: Byte-wise atomic memcpy.
+
+[#60]: https://github.com/taiki-e/portable-atomic/issues/60
+[atomic-maybe-uninit]: https://github.com/taiki-e/atomic-maybe-uninit
+[atomic-memcpy]: https://github.com/taiki-e/atomic-memcpy
+[critical-section]: https://github.com/rust-embedded/critical-section
+[rust-lang/rust#100650]: https://github.com/rust-lang/rust/issues/100650
+[serde]: https://github.com/serde-rs/serde
+
+<!-- tidy:crate-doc:end -->
+*/
+
+#![no_std]
+#![doc(test(
+    no_crate_inject,
+    attr(
+        deny(warnings, rust_2018_idioms, single_use_lifetimes),
+        allow(dead_code, unused_variables)
+    )
+))]
+#![cfg_attr(not(portable_atomic_no_unsafe_op_in_unsafe_fn), warn(unsafe_op_in_unsafe_fn))] // unsafe_op_in_unsafe_fn requires Rust 1.52
+#![cfg_attr(portable_atomic_no_unsafe_op_in_unsafe_fn, allow(unused_unsafe))]
+#![warn(
+    // Lints that may help when writing public library.
+    missing_debug_implementations,
+    // missing_docs,
+    clippy::alloc_instead_of_core,
+    clippy::exhaustive_enums,
+    clippy::exhaustive_structs,
+    clippy::impl_trait_in_params,
+    clippy::missing_inline_in_public_items,
+    clippy::std_instead_of_alloc,
+    clippy::std_instead_of_core,
+)]
+#![cfg_attr(not(portable_atomic_no_asm), warn(missing_docs))] // module-level #![allow(missing_docs)] doesn't work for macros on old rustc
+#![allow(
+    clippy::cast_lossless,
+    clippy::inline_always,
+    clippy::naive_bytecount,
+    clippy::unreadable_literal
+)]
+// asm_experimental_arch
+// AVR, MSP430, and Xtensa are tier 3 platforms and require nightly anyway.
+// On tier 2 platforms (powerpc64 and s390x), we use cfg set by build script to
+// determine whether this feature is available or not.
+#![cfg_attr(
+    all(
+        not(portable_atomic_no_asm),
+        any(
+            target_arch = "avr",
+            target_arch = "msp430",
+            all(target_arch = "xtensa", portable_atomic_unsafe_assume_single_core),
+            all(target_arch = "powerpc64", portable_atomic_unstable_asm_experimental_arch),
+            all(target_arch = "s390x", portable_atomic_unstable_asm_experimental_arch),
+        ),
+    ),
+    feature(asm_experimental_arch)
+)]
+// Old nightly only
+// These features are already stabilized or have already been removed from compilers,
+// and can safely be enabled for old nightly as long as version detection works.
+// - cfg(target_has_atomic)
+// - asm! on ARM, AArch64, RISC-V, x86_64
+// - llvm_asm! on AVR (tier 3) and MSP430 (tier 3)
+// - #[instruction_set] on non-Linux/Android pre-v6 ARM (tier 3)
+#![cfg_attr(portable_atomic_unstable_cfg_target_has_atomic, feature(cfg_target_has_atomic))]
+#![cfg_attr(
+    all(
+        portable_atomic_unstable_asm,
+        any(
+            target_arch = "aarch64",
+            target_arch = "arm",
+            target_arch = "riscv32",
+            target_arch = "riscv64",
+            target_arch = "x86_64",
+        ),
+    ),
+    feature(asm)
+)]
+#![cfg_attr(
+    all(any(target_arch = "avr", target_arch = "msp430"), portable_atomic_no_asm),
+    feature(llvm_asm)
+)]
+#![cfg_attr(
+    all(
+        target_arch = "arm",
+        portable_atomic_unstable_isa_attribute,
+        any(test, portable_atomic_unsafe_assume_single_core),
+        not(any(target_feature = "v6", portable_atomic_target_feature = "v6")),
+        not(target_has_atomic = "ptr"),
+    ),
+    feature(isa_attribute)
+)]
+// Miri and/or ThreadSanitizer only
+// They do not support inline assembly, so we need to use unstable features instead.
+// Since they require nightly compilers anyway, we can use the unstable features.
+// This is not an ideal situation, but it is still better than always using lock-based
+// fallback and causing memory ordering problems to be missed by these checkers.
+#![cfg_attr(
+    all(
+        any(target_arch = "aarch64", target_arch = "powerpc64", target_arch = "s390x"),
+        any(miri, portable_atomic_sanitize_thread),
+    ),
+    allow(internal_features)
+)]
+#![cfg_attr(
+    all(
+        any(target_arch = "aarch64", target_arch = "powerpc64", target_arch = "s390x"),
+        any(miri, portable_atomic_sanitize_thread),
+    ),
+    feature(core_intrinsics)
+)]
+// docs.rs only (cfg is enabled by docs.rs, not build script)
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(
+    all(
+        portable_atomic_no_atomic_load_store,
+        not(any(
+            target_arch = "avr",
+            target_arch = "bpf",
+            target_arch = "msp430",
+            target_arch = "riscv32",
+            target_arch = "riscv64",
+            feature = "critical-section",
+        )),
+    ),
+    allow(unused_imports, unused_macros)
+)]
+
+// There are currently no 128-bit or higher builtin targets.
+// (Although some of our generic code is written with the future
+// addition of 128-bit targets in mind.)
+// Note that Rust (and C99) pointers must be at least 16-bit (i.e., 8-bit targets are impossible): https://github.com/rust-lang/rust/pull/49305
+#[cfg(not(any(
+    target_pointer_width = "16",
+    target_pointer_width = "32",
+    target_pointer_width = "64",
+)))]
+compile_error!(
+    "portable-atomic currently only supports targets with {16,32,64}-bit pointer width; \
+     if you need support for others, \
+     please submit an issue at <https://github.com/taiki-e/portable-atomic>"
+);
+
+#[cfg(portable_atomic_unsafe_assume_single_core)]
+#[cfg_attr(
+    portable_atomic_no_cfg_target_has_atomic,
+    cfg(any(
+        not(portable_atomic_no_atomic_cas),
+        not(any(
+            target_arch = "arm",
+            target_arch = "avr",
+            target_arch = "msp430",
+            target_arch = "riscv32",
+            target_arch = "riscv64",
+            target_arch = "xtensa",
+        )),
+    ))
+)]
+#[cfg_attr(
+    not(portable_atomic_no_cfg_target_has_atomic),
+    cfg(any(
+        target_has_atomic = "ptr",
+        not(any(
+            target_arch = "arm",
+            target_arch = "avr",
+            target_arch = "msp430",
+            target_arch = "riscv32",
+            target_arch = "riscv64",
+            target_arch = "xtensa",
+        )),
+    ))
+)]
+compile_error!(
+    "cfg(portable_atomic_unsafe_assume_single_core) does not compatible with this target;\n\
+     if you need cfg(portable_atomic_unsafe_assume_single_core) support for this target,\n\
+     please submit an issue at <https://github.com/taiki-e/portable-atomic>"
+);
+
+#[cfg(portable_atomic_no_outline_atomics)]
+#[cfg(not(any(
+    target_arch = "aarch64",
+    target_arch = "arm",
+    target_arch = "powerpc64",
+    target_arch = "x86_64",
+)))]
+compile_error!("cfg(portable_atomic_no_outline_atomics) does not compatible with this target");
+#[cfg(portable_atomic_outline_atomics)]
+#[cfg(not(any(target_arch = "aarch64", target_arch = "powerpc64")))]
+compile_error!("cfg(portable_atomic_outline_atomics) does not compatible with this target");
+#[cfg(portable_atomic_disable_fiq)]
+#[cfg(not(all(
+    target_arch = "arm",
+    not(any(target_feature = "mclass", portable_atomic_target_feature = "mclass")),
+)))]
+compile_error!("cfg(portable_atomic_disable_fiq) does not compatible with this target");
+#[cfg(portable_atomic_s_mode)]
+#[cfg(not(any(target_arch = "riscv32", target_arch = "riscv64")))]
+compile_error!("cfg(portable_atomic_s_mode) does not compatible with this target");
+#[cfg(portable_atomic_force_amo)]
+#[cfg(not(any(target_arch = "riscv32", target_arch = "riscv64")))]
+compile_error!("cfg(portable_atomic_force_amo) does not compatible with this target");
+
+#[cfg(portable_atomic_disable_fiq)]
+#[cfg(not(portable_atomic_unsafe_assume_single_core))]
+compile_error!(
+    "cfg(portable_atomic_disable_fiq) may only be used together with cfg(portable_atomic_unsafe_assume_single_core)"
+);
+#[cfg(portable_atomic_s_mode)]
+#[cfg(not(portable_atomic_unsafe_assume_single_core))]
+compile_error!(
+    "cfg(portable_atomic_s_mode) may only be used together with cfg(portable_atomic_unsafe_assume_single_core)"
+);
+#[cfg(portable_atomic_force_amo)]
+#[cfg(not(portable_atomic_unsafe_assume_single_core))]
+compile_error!(
+    "cfg(portable_atomic_force_amo) may only be used together with cfg(portable_atomic_unsafe_assume_single_core)"
+);
+
+#[cfg(all(portable_atomic_unsafe_assume_single_core, feature = "critical-section"))]
+compile_error!(
+    "you may not enable feature `critical-section` and cfg(portable_atomic_unsafe_assume_single_core) at the same time"
+);
+
+#[cfg(feature = "require-cas")]
+#[cfg_attr(
+    portable_atomic_no_cfg_target_has_atomic,
+    cfg(not(any(
+        not(portable_atomic_no_atomic_cas),
+        portable_atomic_unsafe_assume_single_core,
+        feature = "critical-section",
+        target_arch = "avr",
+        target_arch = "msp430",
+    )))
+)]
+#[cfg_attr(
+    not(portable_atomic_no_cfg_target_has_atomic),
+    cfg(not(any(
+        target_has_atomic = "ptr",
+        portable_atomic_unsafe_assume_single_core,
+        feature = "critical-section",
+        target_arch = "avr",
+        target_arch = "msp430",
+    )))
+)]
+compile_error!(
+    "dependents require atomic CAS but not available on this target by default;\n\
+    consider enabling one of the `unsafe-assume-single-core` or `critical-section` Cargo features.\n\
+    see <https://docs.rs/portable-atomic/latest/portable_atomic/#optional-features> for more."
+);
+
+#[cfg(any(test, feature = "std"))]
+extern crate std;
+
+#[macro_use]
+mod cfgs;
+#[cfg(target_pointer_width = "128")]
+pub use {cfg_has_atomic_128 as cfg_has_atomic_ptr, cfg_no_atomic_128 as cfg_no_atomic_ptr};
+#[cfg(target_pointer_width = "16")]
+pub use {cfg_has_atomic_16 as cfg_has_atomic_ptr, cfg_no_atomic_16 as cfg_no_atomic_ptr};
+#[cfg(target_pointer_width = "32")]
+pub use {cfg_has_atomic_32 as cfg_has_atomic_ptr, cfg_no_atomic_32 as cfg_no_atomic_ptr};
+#[cfg(target_pointer_width = "64")]
+pub use {cfg_has_atomic_64 as cfg_has_atomic_ptr, cfg_no_atomic_64 as cfg_no_atomic_ptr};
+
+#[macro_use]
+mod utils;
+
+#[cfg(test)]
+#[macro_use]
+mod tests;
+
+#[doc(no_inline)]
+pub use core::sync::atomic::Ordering;
+
+#[doc(no_inline)]
+// LLVM doesn't support fence/compiler_fence for MSP430.
+#[cfg(not(target_arch = "msp430"))]
+pub use core::sync::atomic::{compiler_fence, fence};
+#[cfg(target_arch = "msp430")]
+pub use imp::msp430::{compiler_fence, fence};
+
+mod imp;
+
+pub mod hint {
+    //! Re-export of the [`core::hint`] module.
+    //!
+    //! The only difference from the [`core::hint`] module is that [`spin_loop`]
+    //! is available in all rust versions that this crate supports.
+    //!
+    //! ```
+    //! use portable_atomic::hint;
+    //!
+    //! hint::spin_loop();
+    //! ```
+
+    #[doc(no_inline)]
+    pub use core::hint::*;
+
+    /// Emits a machine instruction to signal the processor that it is running in
+    /// a busy-wait spin-loop ("spin lock").
+    ///
+    /// Upon receiving the spin-loop signal the processor can optimize its behavior by,
+    /// for example, saving power or switching hyper-threads.
+    ///
+    /// This function is different from [`thread::yield_now`] which directly
+    /// yields to the system's scheduler, whereas `spin_loop` does not interact
+    /// with the operating system.
+    ///
+    /// A common use case for `spin_loop` is implementing bounded optimistic
+    /// spinning in a CAS loop in synchronization primitives. To avoid problems
+    /// like priority inversion, it is strongly recommended that the spin loop is
+    /// terminated after a finite amount of iterations and an appropriate blocking
+    /// syscall is made.
+    ///
+    /// **Note:** On platforms that do not support receiving spin-loop hints this
+    /// function does not do anything at all.
+    ///
+    /// [`thread::yield_now`]: https://doc.rust-lang.org/std/thread/fn.yield_now.html
+    #[inline]
+    pub fn spin_loop() {
+        #[allow(deprecated)]
+        core::sync::atomic::spin_loop_hint();
+    }
+}
+
+#[cfg(doc)]
+use core::sync::atomic::Ordering::{AcqRel, Acquire, Relaxed, Release, SeqCst};
+use core::{fmt, ptr};
+
+#[cfg(miri)]
+use crate::utils::strict;
+
+cfg_has_atomic_8! {
+cfg_has_atomic_cas! {
+// See https://github.com/rust-lang/rust/pull/114034 for details.
+// https://github.com/rust-lang/rust/blob/9339f446a5302cd5041d3f3b5e59761f36699167/library/core/src/sync/atomic.rs#L134
+// https://godbolt.org/z/Enh87Ph9b
+#[cfg(portable_atomic_no_cfg_target_has_atomic)]
+const EMULATE_ATOMIC_BOOL: bool = cfg!(all(
+    not(portable_atomic_no_atomic_cas),
+    any(target_arch = "riscv32", target_arch = "riscv64", target_arch = "loongarch64"),
+));
+#[cfg(not(portable_atomic_no_cfg_target_has_atomic))]
+const EMULATE_ATOMIC_BOOL: bool = cfg!(all(
+    target_has_atomic = "8",
+    any(target_arch = "riscv32", target_arch = "riscv64", target_arch = "loongarch64"),
+));
+} // cfg_has_atomic_cas!
+
+/// A boolean type which can be safely shared between threads.
+///
+/// This type has the same in-memory representation as a [`bool`].
+///
+/// If the compiler and the platform support atomic loads and stores of `u8`,
+/// this type is a wrapper for the standard library's
+/// [`AtomicBool`](core::sync::atomic::AtomicBool). If the platform supports it
+/// but the compiler does not, atomic operations are implemented using inline
+/// assembly.
+#[repr(C, align(1))]
+pub struct AtomicBool {
+    v: core::cell::UnsafeCell<u8>,
+}
+
+impl Default for AtomicBool {
+    /// Creates an `AtomicBool` initialized to `false`.
+    #[inline]
+    fn default() -> Self {
+        Self::new(false)
+    }
+}
+
+impl From<bool> for AtomicBool {
+    /// Converts a `bool` into an `AtomicBool`.
+    #[inline]
+    fn from(b: bool) -> Self {
+        Self::new(b)
+    }
+}
+
+// Send is implicitly implemented.
+// SAFETY: any data races are prevented by disabling interrupts or
+// atomic intrinsics (see module-level comments).
+unsafe impl Sync for AtomicBool {}
+
+// UnwindSafe is implicitly implemented.
+#[cfg(not(portable_atomic_no_core_unwind_safe))]
+impl core::panic::RefUnwindSafe for AtomicBool {}
+#[cfg(all(portable_atomic_no_core_unwind_safe, feature = "std"))]
+impl std::panic::RefUnwindSafe for AtomicBool {}
+
+impl_debug_and_serde!(AtomicBool);
+
+impl AtomicBool {
+    /// Creates a new `AtomicBool`.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::AtomicBool;
+    ///
+    /// let atomic_true = AtomicBool::new(true);
+    /// let atomic_false = AtomicBool::new(false);
+    /// ```
+    #[inline]
+    #[must_use]
+    pub const fn new(v: bool) -> Self {
+        static_assert_layout!(AtomicBool, bool);
+        Self { v: core::cell::UnsafeCell::new(v as u8) }
+    }
+
+    // TODO: update docs based on https://github.com/rust-lang/rust/pull/116762
+    /// Creates a new `AtomicBool` from a pointer.
+    ///
+    /// # Safety
+    ///
+    /// * `ptr` must be aligned to `align_of::<AtomicBool>()` (note that on some platforms this can
+    ///   be bigger than `align_of::<bool>()`).
+    /// * `ptr` must be [valid] for both reads and writes for the whole lifetime `'a`.
+    /// * If this atomic type is [lock-free](Self::is_lock_free), non-atomic accesses to the value
+    ///   behind `ptr` must have a happens-before relationship with atomic accesses via the returned
+    ///   value (or vice-versa).
+    ///   * In other words, time periods where the value is accessed atomically may not overlap
+    ///     with periods where the value is accessed non-atomically.
+    ///   * This requirement is trivially satisfied if `ptr` is never used non-atomically for the
+    ///     duration of lifetime `'a`. Most use cases should be able to follow this guideline.
+    ///   * This requirement is also trivially satisfied if all accesses (atomic or not) are done
+    ///     from the same thread.
+    /// * If this atomic type is *not* lock-free:
+    ///   * Any accesses to the value behind `ptr` must have a happens-before relationship
+    ///     with accesses via the returned value (or vice-versa).
+    ///   * Any concurrent accesses to the value behind `ptr` for the duration of lifetime `'a` must
+    ///     be compatible with operations performed by this atomic type.
+    /// * This method must not be used to create overlapping or mixed-size atomic accesses, as
+    ///   these are not supported by the memory model.
+    ///
+    /// [valid]: core::ptr#safety
+    #[inline]
+    #[must_use]
+    pub unsafe fn from_ptr<'a>(ptr: *mut bool) -> &'a Self {
+        #[allow(clippy::cast_ptr_alignment)]
+        // SAFETY: guaranteed by the caller
+        unsafe { &*(ptr as *mut Self) }
+    }
+
+    /// Returns `true` if operations on values of this type are lock-free.
+    ///
+    /// If the compiler or the platform doesn't support the necessary
+    /// atomic instructions, global locks for every potentially
+    /// concurrent atomic operation will be used.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::AtomicBool;
+    ///
+    /// let is_lock_free = AtomicBool::is_lock_free();
+    /// ```
+    #[inline]
+    #[must_use]
+    pub fn is_lock_free() -> bool {
+        imp::AtomicU8::is_lock_free()
+    }
+
+    /// Returns `true` if operations on values of this type are lock-free.
+    ///
+    /// If the compiler or the platform doesn't support the necessary
+    /// atomic instructions, global locks for every potentially
+    /// concurrent atomic operation will be used.
+    ///
+    /// **Note:** If the atomic operation relies on dynamic CPU feature detection,
+    /// this type may be lock-free even if the function returns false.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::AtomicBool;
+    ///
+    /// const IS_ALWAYS_LOCK_FREE: bool = AtomicBool::is_always_lock_free();
+    /// ```
+    #[inline]
+    #[must_use]
+    pub const fn is_always_lock_free() -> bool {
+        imp::AtomicU8::is_always_lock_free()
+    }
+
+    /// Returns a mutable reference to the underlying [`bool`].
+    ///
+    /// This is safe because the mutable reference guarantees that no other threads are
+    /// concurrently accessing the atomic data.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicBool, Ordering};
+    ///
+    /// let mut some_bool = AtomicBool::new(true);
+    /// assert_eq!(*some_bool.get_mut(), true);
+    /// *some_bool.get_mut() = false;
+    /// assert_eq!(some_bool.load(Ordering::SeqCst), false);
+    /// ```
+    #[inline]
+    pub fn get_mut(&mut self) -> &mut bool {
+        // SAFETY: the mutable reference guarantees unique ownership.
+        unsafe { &mut *(self.v.get() as *mut bool) }
+    }
+
+    // TODO: Add from_mut/get_mut_slice/from_mut_slice once it is stable on std atomic types.
+    // https://github.com/rust-lang/rust/issues/76314
+
+    const_fn! {
+        const_if: #[cfg(not(portable_atomic_no_const_transmute))];
+        /// Consumes the atomic and returns the contained value.
+        ///
+        /// This is safe because passing `self` by value guarantees that no other threads are
+        /// concurrently accessing the atomic data.
+        ///
+        /// This is `const fn` on Rust 1.56+.
+        ///
+        /// # Examples
+        ///
+        /// ```
+        /// use portable_atomic::AtomicBool;
+        ///
+        /// let some_bool = AtomicBool::new(true);
+        /// assert_eq!(some_bool.into_inner(), true);
+        /// ```
+        #[inline]
+        pub const fn into_inner(self) -> bool {
+            // SAFETY: AtomicBool and u8 have the same size and in-memory representations,
+            // so they can be safely transmuted.
+            // (const UnsafeCell::into_inner is unstable)
+            unsafe { core::mem::transmute::<AtomicBool, u8>(self) != 0 }
+        }
+    }
+
+    /// Loads a value from the bool.
+    ///
+    /// `load` takes an [`Ordering`] argument which describes the memory ordering
+    /// of this operation. Possible values are [`SeqCst`], [`Acquire`] and [`Relaxed`].
+    ///
+    /// # Panics
+    ///
+    /// Panics if `order` is [`Release`] or [`AcqRel`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicBool, Ordering};
+    ///
+    /// let some_bool = AtomicBool::new(true);
+    ///
+    /// assert_eq!(some_bool.load(Ordering::Relaxed), true);
+    /// ```
+    #[inline]
+    #[cfg_attr(
+        any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+        track_caller
+    )]
+    pub fn load(&self, order: Ordering) -> bool {
+        self.as_atomic_u8().load(order) != 0
+    }
+
+    /// Stores a value into the bool.
+    ///
+    /// `store` takes an [`Ordering`] argument which describes the memory ordering
+    /// of this operation. Possible values are [`SeqCst`], [`Release`] and [`Relaxed`].
+    ///
+    /// # Panics
+    ///
+    /// Panics if `order` is [`Acquire`] or [`AcqRel`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicBool, Ordering};
+    ///
+    /// let some_bool = AtomicBool::new(true);
+    ///
+    /// some_bool.store(false, Ordering::Relaxed);
+    /// assert_eq!(some_bool.load(Ordering::Relaxed), false);
+    /// ```
+    #[inline]
+    #[cfg_attr(
+        any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+        track_caller
+    )]
+    pub fn store(&self, val: bool, order: Ordering) {
+        self.as_atomic_u8().store(val as u8, order);
+    }
+
+    cfg_has_atomic_cas! {
+    /// Stores a value into the bool, returning the previous value.
+    ///
+    /// `swap` takes an [`Ordering`] argument which describes the memory ordering
+    /// of this operation. All ordering modes are possible. Note that using
+    /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+    /// using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicBool, Ordering};
+    ///
+    /// let some_bool = AtomicBool::new(true);
+    ///
+    /// assert_eq!(some_bool.swap(false, Ordering::Relaxed), true);
+    /// assert_eq!(some_bool.load(Ordering::Relaxed), false);
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn swap(&self, val: bool, order: Ordering) -> bool {
+        if EMULATE_ATOMIC_BOOL {
+            if val { self.fetch_or(true, order) } else { self.fetch_and(false, order) }
+        } else {
+            self.as_atomic_u8().swap(val as u8, order) != 0
+        }
+    }
+
+    /// Stores a value into the [`bool`] if the current value is the same as the `current` value.
+    ///
+    /// The return value is a result indicating whether the new value was written and containing
+    /// the previous value. On success this value is guaranteed to be equal to `current`.
+    ///
+    /// `compare_exchange` takes two [`Ordering`] arguments to describe the memory
+    /// ordering of this operation. `success` describes the required ordering for the
+    /// read-modify-write operation that takes place if the comparison with `current` succeeds.
+    /// `failure` describes the required ordering for the load operation that takes place when
+    /// the comparison fails. Using [`Acquire`] as success ordering makes the store part
+    /// of this operation [`Relaxed`], and using [`Release`] makes the successful load
+    /// [`Relaxed`]. The failure ordering can only be [`SeqCst`], [`Acquire`] or [`Relaxed`].
+    ///
+    /// # Panics
+    ///
+    /// Panics if `failure` is [`Release`], [`AcqRel`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicBool, Ordering};
+    ///
+    /// let some_bool = AtomicBool::new(true);
+    ///
+    /// assert_eq!(
+    ///     some_bool.compare_exchange(true, false, Ordering::Acquire, Ordering::Relaxed),
+    ///     Ok(true)
+    /// );
+    /// assert_eq!(some_bool.load(Ordering::Relaxed), false);
+    ///
+    /// assert_eq!(
+    ///     some_bool.compare_exchange(true, true, Ordering::SeqCst, Ordering::Acquire),
+    ///     Err(false)
+    /// );
+    /// assert_eq!(some_bool.load(Ordering::Relaxed), false);
+    /// ```
+    #[inline]
+    #[cfg_attr(docsrs, doc(alias = "compare_and_swap"))]
+    #[cfg_attr(
+        any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+        track_caller
+    )]
+    pub fn compare_exchange(
+        &self,
+        current: bool,
+        new: bool,
+        success: Ordering,
+        failure: Ordering,
+    ) -> Result<bool, bool> {
+        if EMULATE_ATOMIC_BOOL {
+            crate::utils::assert_compare_exchange_ordering(success, failure);
+            let order = crate::utils::upgrade_success_ordering(success, failure);
+            let old = if current == new {
+                // This is a no-op, but we still need to perform the operation
+                // for memory ordering reasons.
+                self.fetch_or(false, order)
+            } else {
+                // This sets the value to the new one and returns the old one.
+                self.swap(new, order)
+            };
+            if old == current { Ok(old) } else { Err(old) }
+        } else {
+            match self.as_atomic_u8().compare_exchange(current as u8, new as u8, success, failure) {
+                Ok(x) => Ok(x != 0),
+                Err(x) => Err(x != 0),
+            }
+        }
+    }
+
+    /// Stores a value into the [`bool`] if the current value is the same as the `current` value.
+    ///
+    /// Unlike [`AtomicBool::compare_exchange`], this function is allowed to spuriously fail even when the
+    /// comparison succeeds, which can result in more efficient code on some platforms. The
+    /// return value is a result indicating whether the new value was written and containing the
+    /// previous value.
+    ///
+    /// `compare_exchange_weak` takes two [`Ordering`] arguments to describe the memory
+    /// ordering of this operation. `success` describes the required ordering for the
+    /// read-modify-write operation that takes place if the comparison with `current` succeeds.
+    /// `failure` describes the required ordering for the load operation that takes place when
+    /// the comparison fails. Using [`Acquire`] as success ordering makes the store part
+    /// of this operation [`Relaxed`], and using [`Release`] makes the successful load
+    /// [`Relaxed`]. The failure ordering can only be [`SeqCst`], [`Acquire`] or [`Relaxed`].
+    ///
+    /// # Panics
+    ///
+    /// Panics if `failure` is [`Release`], [`AcqRel`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicBool, Ordering};
+    ///
+    /// let val = AtomicBool::new(false);
+    ///
+    /// let new = true;
+    /// let mut old = val.load(Ordering::Relaxed);
+    /// loop {
+    ///     match val.compare_exchange_weak(old, new, Ordering::SeqCst, Ordering::Relaxed) {
+    ///         Ok(_) => break,
+    ///         Err(x) => old = x,
+    ///     }
+    /// }
+    /// ```
+    #[inline]
+    #[cfg_attr(docsrs, doc(alias = "compare_and_swap"))]
+    #[cfg_attr(
+        any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+        track_caller
+    )]
+    pub fn compare_exchange_weak(
+        &self,
+        current: bool,
+        new: bool,
+        success: Ordering,
+        failure: Ordering,
+    ) -> Result<bool, bool> {
+        if EMULATE_ATOMIC_BOOL {
+            return self.compare_exchange(current, new, success, failure);
+        }
+
+        match self.as_atomic_u8().compare_exchange_weak(current as u8, new as u8, success, failure)
+        {
+            Ok(x) => Ok(x != 0),
+            Err(x) => Err(x != 0),
+        }
+    }
+
+    /// Logical "and" with a boolean value.
+    ///
+    /// Performs a logical "and" operation on the current value and the argument `val`, and sets
+    /// the new value to the result.
+    ///
+    /// Returns the previous value.
+    ///
+    /// `fetch_and` takes an [`Ordering`] argument which describes the memory ordering
+    /// of this operation. All ordering modes are possible. Note that using
+    /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+    /// using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicBool, Ordering};
+    ///
+    /// let foo = AtomicBool::new(true);
+    /// assert_eq!(foo.fetch_and(false, Ordering::SeqCst), true);
+    /// assert_eq!(foo.load(Ordering::SeqCst), false);
+    ///
+    /// let foo = AtomicBool::new(true);
+    /// assert_eq!(foo.fetch_and(true, Ordering::SeqCst), true);
+    /// assert_eq!(foo.load(Ordering::SeqCst), true);
+    ///
+    /// let foo = AtomicBool::new(false);
+    /// assert_eq!(foo.fetch_and(false, Ordering::SeqCst), false);
+    /// assert_eq!(foo.load(Ordering::SeqCst), false);
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn fetch_and(&self, val: bool, order: Ordering) -> bool {
+        self.as_atomic_u8().fetch_and(val as u8, order) != 0
+    }
+
+    /// Logical "and" with a boolean value.
+    ///
+    /// Performs a logical "and" operation on the current value and the argument `val`, and sets
+    /// the new value to the result.
+    ///
+    /// Unlike `fetch_and`, this does not return the previous value.
+    ///
+    /// `and` takes an [`Ordering`] argument which describes the memory ordering
+    /// of this operation. All ordering modes are possible. Note that using
+    /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+    /// using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// This function may generate more efficient code than `fetch_and` on some platforms.
+    ///
+    /// - x86/x86_64: `lock and` instead of `cmpxchg` loop
+    /// - MSP430: `and` instead of disabling interrupts
+    ///
+    /// Note: On x86/x86_64, the use of either function should not usually
+    /// affect the generated code, because LLVM can properly optimize the case
+    /// where the result is unused.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicBool, Ordering};
+    ///
+    /// let foo = AtomicBool::new(true);
+    /// foo.and(false, Ordering::SeqCst);
+    /// assert_eq!(foo.load(Ordering::SeqCst), false);
+    ///
+    /// let foo = AtomicBool::new(true);
+    /// foo.and(true, Ordering::SeqCst);
+    /// assert_eq!(foo.load(Ordering::SeqCst), true);
+    ///
+    /// let foo = AtomicBool::new(false);
+    /// foo.and(false, Ordering::SeqCst);
+    /// assert_eq!(foo.load(Ordering::SeqCst), false);
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn and(&self, val: bool, order: Ordering) {
+        self.as_atomic_u8().and(val as u8, order);
+    }
+
+    /// Logical "nand" with a boolean value.
+    ///
+    /// Performs a logical "nand" operation on the current value and the argument `val`, and sets
+    /// the new value to the result.
+    ///
+    /// Returns the previous value.
+    ///
+    /// `fetch_nand` takes an [`Ordering`] argument which describes the memory ordering
+    /// of this operation. All ordering modes are possible. Note that using
+    /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+    /// using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicBool, Ordering};
+    ///
+    /// let foo = AtomicBool::new(true);
+    /// assert_eq!(foo.fetch_nand(false, Ordering::SeqCst), true);
+    /// assert_eq!(foo.load(Ordering::SeqCst), true);
+    ///
+    /// let foo = AtomicBool::new(true);
+    /// assert_eq!(foo.fetch_nand(true, Ordering::SeqCst), true);
+    /// assert_eq!(foo.load(Ordering::SeqCst) as usize, 0);
+    /// assert_eq!(foo.load(Ordering::SeqCst), false);
+    ///
+    /// let foo = AtomicBool::new(false);
+    /// assert_eq!(foo.fetch_nand(false, Ordering::SeqCst), false);
+    /// assert_eq!(foo.load(Ordering::SeqCst), true);
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn fetch_nand(&self, val: bool, order: Ordering) -> bool {
+        // https://github.com/rust-lang/rust/blob/1.70.0/library/core/src/sync/atomic.rs#L811-L825
+        if val {
+            // !(x & true) == !x
+            // We must invert the bool.
+            self.fetch_xor(true, order)
+        } else {
+            // !(x & false) == true
+            // We must set the bool to true.
+            self.swap(true, order)
+        }
+    }
+
+    /// Logical "or" with a boolean value.
+    ///
+    /// Performs a logical "or" operation on the current value and the argument `val`, and sets the
+    /// new value to the result.
+    ///
+    /// Returns the previous value.
+    ///
+    /// `fetch_or` takes an [`Ordering`] argument which describes the memory ordering
+    /// of this operation. All ordering modes are possible. Note that using
+    /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+    /// using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicBool, Ordering};
+    ///
+    /// let foo = AtomicBool::new(true);
+    /// assert_eq!(foo.fetch_or(false, Ordering::SeqCst), true);
+    /// assert_eq!(foo.load(Ordering::SeqCst), true);
+    ///
+    /// let foo = AtomicBool::new(true);
+    /// assert_eq!(foo.fetch_or(true, Ordering::SeqCst), true);
+    /// assert_eq!(foo.load(Ordering::SeqCst), true);
+    ///
+    /// let foo = AtomicBool::new(false);
+    /// assert_eq!(foo.fetch_or(false, Ordering::SeqCst), false);
+    /// assert_eq!(foo.load(Ordering::SeqCst), false);
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn fetch_or(&self, val: bool, order: Ordering) -> bool {
+        self.as_atomic_u8().fetch_or(val as u8, order) != 0
+    }
+
+    /// Logical "or" with a boolean value.
+    ///
+    /// Performs a logical "or" operation on the current value and the argument `val`, and sets the
+    /// new value to the result.
+    ///
+    /// Unlike `fetch_or`, this does not return the previous value.
+    ///
+    /// `or` takes an [`Ordering`] argument which describes the memory ordering
+    /// of this operation. All ordering modes are possible. Note that using
+    /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+    /// using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// This function may generate more efficient code than `fetch_or` on some platforms.
+    ///
+    /// - x86/x86_64: `lock or` instead of `cmpxchg` loop
+    /// - MSP430: `bis` instead of disabling interrupts
+    ///
+    /// Note: On x86/x86_64, the use of either function should not usually
+    /// affect the generated code, because LLVM can properly optimize the case
+    /// where the result is unused.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicBool, Ordering};
+    ///
+    /// let foo = AtomicBool::new(true);
+    /// foo.or(false, Ordering::SeqCst);
+    /// assert_eq!(foo.load(Ordering::SeqCst), true);
+    ///
+    /// let foo = AtomicBool::new(true);
+    /// foo.or(true, Ordering::SeqCst);
+    /// assert_eq!(foo.load(Ordering::SeqCst), true);
+    ///
+    /// let foo = AtomicBool::new(false);
+    /// foo.or(false, Ordering::SeqCst);
+    /// assert_eq!(foo.load(Ordering::SeqCst), false);
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn or(&self, val: bool, order: Ordering) {
+        self.as_atomic_u8().or(val as u8, order);
+    }
+
+    /// Logical "xor" with a boolean value.
+    ///
+    /// Performs a logical "xor" operation on the current value and the argument `val`, and sets
+    /// the new value to the result.
+    ///
+    /// Returns the previous value.
+    ///
+    /// `fetch_xor` takes an [`Ordering`] argument which describes the memory ordering
+    /// of this operation. All ordering modes are possible. Note that using
+    /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+    /// using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicBool, Ordering};
+    ///
+    /// let foo = AtomicBool::new(true);
+    /// assert_eq!(foo.fetch_xor(false, Ordering::SeqCst), true);
+    /// assert_eq!(foo.load(Ordering::SeqCst), true);
+    ///
+    /// let foo = AtomicBool::new(true);
+    /// assert_eq!(foo.fetch_xor(true, Ordering::SeqCst), true);
+    /// assert_eq!(foo.load(Ordering::SeqCst), false);
+    ///
+    /// let foo = AtomicBool::new(false);
+    /// assert_eq!(foo.fetch_xor(false, Ordering::SeqCst), false);
+    /// assert_eq!(foo.load(Ordering::SeqCst), false);
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn fetch_xor(&self, val: bool, order: Ordering) -> bool {
+        self.as_atomic_u8().fetch_xor(val as u8, order) != 0
+    }
+
+    /// Logical "xor" with a boolean value.
+    ///
+    /// Performs a logical "xor" operation on the current value and the argument `val`, and sets
+    /// the new value to the result.
+    ///
+    /// Unlike `fetch_xor`, this does not return the previous value.
+    ///
+    /// `xor` takes an [`Ordering`] argument which describes the memory ordering
+    /// of this operation. All ordering modes are possible. Note that using
+    /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+    /// using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// This function may generate more efficient code than `fetch_xor` on some platforms.
+    ///
+    /// - x86/x86_64: `lock xor` instead of `cmpxchg` loop
+    /// - MSP430: `xor` instead of disabling interrupts
+    ///
+    /// Note: On x86/x86_64, the use of either function should not usually
+    /// affect the generated code, because LLVM can properly optimize the case
+    /// where the result is unused.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicBool, Ordering};
+    ///
+    /// let foo = AtomicBool::new(true);
+    /// foo.xor(false, Ordering::SeqCst);
+    /// assert_eq!(foo.load(Ordering::SeqCst), true);
+    ///
+    /// let foo = AtomicBool::new(true);
+    /// foo.xor(true, Ordering::SeqCst);
+    /// assert_eq!(foo.load(Ordering::SeqCst), false);
+    ///
+    /// let foo = AtomicBool::new(false);
+    /// foo.xor(false, Ordering::SeqCst);
+    /// assert_eq!(foo.load(Ordering::SeqCst), false);
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn xor(&self, val: bool, order: Ordering) {
+        self.as_atomic_u8().xor(val as u8, order);
+    }
+
+    /// Logical "not" with a boolean value.
+    ///
+    /// Performs a logical "not" operation on the current value, and sets
+    /// the new value to the result.
+    ///
+    /// Returns the previous value.
+    ///
+    /// `fetch_not` takes an [`Ordering`] argument which describes the memory ordering
+    /// of this operation. All ordering modes are possible. Note that using
+    /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+    /// using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicBool, Ordering};
+    ///
+    /// let foo = AtomicBool::new(true);
+    /// assert_eq!(foo.fetch_not(Ordering::SeqCst), true);
+    /// assert_eq!(foo.load(Ordering::SeqCst), false);
+    ///
+    /// let foo = AtomicBool::new(false);
+    /// assert_eq!(foo.fetch_not(Ordering::SeqCst), false);
+    /// assert_eq!(foo.load(Ordering::SeqCst), true);
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn fetch_not(&self, order: Ordering) -> bool {
+        self.fetch_xor(true, order)
+    }
+
+    /// Logical "not" with a boolean value.
+    ///
+    /// Performs a logical "not" operation on the current value, and sets
+    /// the new value to the result.
+    ///
+    /// Unlike `fetch_not`, this does not return the previous value.
+    ///
+    /// `not` takes an [`Ordering`] argument which describes the memory ordering
+    /// of this operation. All ordering modes are possible. Note that using
+    /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+    /// using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// This function may generate more efficient code than `fetch_not` on some platforms.
+    ///
+    /// - x86/x86_64: `lock xor` instead of `cmpxchg` loop
+    /// - MSP430: `xor` instead of disabling interrupts
+    ///
+    /// Note: On x86/x86_64, the use of either function should not usually
+    /// affect the generated code, because LLVM can properly optimize the case
+    /// where the result is unused.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicBool, Ordering};
+    ///
+    /// let foo = AtomicBool::new(true);
+    /// foo.not(Ordering::SeqCst);
+    /// assert_eq!(foo.load(Ordering::SeqCst), false);
+    ///
+    /// let foo = AtomicBool::new(false);
+    /// foo.not(Ordering::SeqCst);
+    /// assert_eq!(foo.load(Ordering::SeqCst), true);
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn not(&self, order: Ordering) {
+        self.xor(true, order);
+    }
+
+    /// Fetches the value, and applies a function to it that returns an optional
+    /// new value. Returns a `Result` of `Ok(previous_value)` if the function
+    /// returned `Some(_)`, else `Err(previous_value)`.
+    ///
+    /// Note: This may call the function multiple times if the value has been
+    /// changed from other threads in the meantime, as long as the function
+    /// returns `Some(_)`, but the function will have been applied only once to
+    /// the stored value.
+    ///
+    /// `fetch_update` takes two [`Ordering`] arguments to describe the memory
+    /// ordering of this operation. The first describes the required ordering for
+    /// when the operation finally succeeds while the second describes the
+    /// required ordering for loads. These correspond to the success and failure
+    /// orderings of [`compare_exchange`](Self::compare_exchange) respectively.
+    ///
+    /// Using [`Acquire`] as success ordering makes the store part of this
+    /// operation [`Relaxed`], and using [`Release`] makes the final successful
+    /// load [`Relaxed`]. The (failed) load ordering can only be [`SeqCst`],
+    /// [`Acquire`] or [`Relaxed`].
+    ///
+    /// # Considerations
+    ///
+    /// This method is not magic; it is not provided by the hardware.
+    /// It is implemented in terms of [`compare_exchange_weak`](Self::compare_exchange_weak),
+    /// and suffers from the same drawbacks.
+    /// In particular, this method will not circumvent the [ABA Problem].
+    ///
+    /// [ABA Problem]: https://en.wikipedia.org/wiki/ABA_problem
+    ///
+    /// # Panics
+    ///
+    /// Panics if `fetch_order` is [`Release`], [`AcqRel`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicBool, Ordering};
+    ///
+    /// let x = AtomicBool::new(false);
+    /// assert_eq!(x.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |_| None), Err(false));
+    /// assert_eq!(x.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |x| Some(!x)), Ok(false));
+    /// assert_eq!(x.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |x| Some(!x)), Ok(true));
+    /// assert_eq!(x.load(Ordering::SeqCst), false);
+    /// ```
+    #[inline]
+    #[cfg_attr(
+        any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+        track_caller
+    )]
+    pub fn fetch_update<F>(
+        &self,
+        set_order: Ordering,
+        fetch_order: Ordering,
+        mut f: F,
+    ) -> Result<bool, bool>
+    where
+        F: FnMut(bool) -> Option<bool>,
+    {
+        let mut prev = self.load(fetch_order);
+        while let Some(next) = f(prev) {
+            match self.compare_exchange_weak(prev, next, set_order, fetch_order) {
+                x @ Ok(_) => return x,
+                Err(next_prev) => prev = next_prev,
+            }
+        }
+        Err(prev)
+    }
+    } // cfg_has_atomic_cas!
+
+    const_fn! {
+        // This function is actually `const fn`-compatible on Rust 1.32+,
+        // but makes `const fn` only on Rust 1.58+ to match other atomic types.
+        const_if: #[cfg(not(portable_atomic_no_const_raw_ptr_deref))];
+        /// Returns a mutable pointer to the underlying [`bool`].
+        ///
+        /// Returning an `*mut` pointer from a shared reference to this atomic is
+        /// safe because the atomic types work with interior mutability. Any use of
+        /// the returned raw pointer requires an `unsafe` block and has to uphold
+        /// the safety requirements. If there is concurrent access, note the following
+        /// additional safety requirements:
+        ///
+        /// - If this atomic type is [lock-free](Self::is_lock_free), any concurrent
+        ///   operations on it must be atomic.
+        /// - Otherwise, any concurrent operations on it must be compatible with
+        ///   operations performed by this atomic type.
+        ///
+        /// This is `const fn` on Rust 1.58+.
+        #[inline]
+        pub const fn as_ptr(&self) -> *mut bool {
+            self.v.get() as *mut bool
+        }
+    }
+
+    #[inline]
+    fn as_atomic_u8(&self) -> &imp::AtomicU8 {
+        // SAFETY: AtomicBool and imp::AtomicU8 have the same layout,
+        // and both access data in the same way.
+        unsafe { &*(self as *const Self as *const imp::AtomicU8) }
+    }
+}
+} // cfg_has_atomic_8!
+
+cfg_has_atomic_ptr! {
+/// A raw pointer type which can be safely shared between threads.
+///
+/// This type has the same in-memory representation as a `*mut T`.
+///
+/// If the compiler and the platform support atomic loads and stores of pointers,
+/// this type is a wrapper for the standard library's
+/// [`AtomicPtr`](core::sync::atomic::AtomicPtr). If the platform supports it
+/// but the compiler does not, atomic operations are implemented using inline
+/// assembly.
+// We can use #[repr(transparent)] here, but #[repr(C, align(N))]
+// will show clearer docs.
+#[cfg_attr(target_pointer_width = "16", repr(C, align(2)))]
+#[cfg_attr(target_pointer_width = "32", repr(C, align(4)))]
+#[cfg_attr(target_pointer_width = "64", repr(C, align(8)))]
+#[cfg_attr(target_pointer_width = "128", repr(C, align(16)))]
+pub struct AtomicPtr<T> {
+    inner: imp::AtomicPtr<T>,
+}
+
+impl<T> Default for AtomicPtr<T> {
+    /// Creates a null `AtomicPtr<T>`.
+    #[inline]
+    fn default() -> Self {
+        Self::new(ptr::null_mut())
+    }
+}
+
+impl<T> From<*mut T> for AtomicPtr<T> {
+    #[inline]
+    fn from(p: *mut T) -> Self {
+        Self::new(p)
+    }
+}
+
+impl<T> fmt::Debug for AtomicPtr<T> {
+    #[inline] // fmt is not hot path, but #[inline] on fmt seems to still be useful: https://github.com/rust-lang/rust/pull/117727
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        // std atomic types use Relaxed in Debug::fmt: https://github.com/rust-lang/rust/blob/1.70.0/library/core/src/sync/atomic.rs#L2024
+        fmt::Debug::fmt(&self.load(Ordering::Relaxed), f)
+    }
+}
+
+impl<T> fmt::Pointer for AtomicPtr<T> {
+    #[inline] // fmt is not hot path, but #[inline] on fmt seems to still be useful: https://github.com/rust-lang/rust/pull/117727
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        // std atomic types use Relaxed in Debug::fmt: https://github.com/rust-lang/rust/blob/1.70.0/library/core/src/sync/atomic.rs#L2024
+        fmt::Pointer::fmt(&self.load(Ordering::Relaxed), f)
+    }
+}
+
+// UnwindSafe is implicitly implemented.
+#[cfg(not(portable_atomic_no_core_unwind_safe))]
+impl<T> core::panic::RefUnwindSafe for AtomicPtr<T> {}
+#[cfg(all(portable_atomic_no_core_unwind_safe, feature = "std"))]
+impl<T> std::panic::RefUnwindSafe for AtomicPtr<T> {}
+
+impl<T> AtomicPtr<T> {
+    /// Creates a new `AtomicPtr`.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::AtomicPtr;
+    ///
+    /// let ptr = &mut 5;
+    /// let atomic_ptr = AtomicPtr::new(ptr);
+    /// ```
+    #[inline]
+    #[must_use]
+    pub const fn new(p: *mut T) -> Self {
+        static_assert_layout!(AtomicPtr<()>, *mut ());
+        Self { inner: imp::AtomicPtr::new(p) }
+    }
+
+    // TODO: update docs based on https://github.com/rust-lang/rust/pull/116762
+    /// Creates a new `AtomicPtr` from a pointer.
+    ///
+    /// # Safety
+    ///
+    /// * `ptr` must be aligned to `align_of::<AtomicPtr<T>>()` (note that on some platforms this
+    ///   can be bigger than `align_of::<*mut T>()`).
+    /// * `ptr` must be [valid] for both reads and writes for the whole lifetime `'a`.
+    /// * If this atomic type is [lock-free](Self::is_lock_free), non-atomic accesses to the value
+    ///   behind `ptr` must have a happens-before relationship with atomic accesses via the returned
+    ///   value (or vice-versa).
+    ///   * In other words, time periods where the value is accessed atomically may not overlap
+    ///     with periods where the value is accessed non-atomically.
+    ///   * This requirement is trivially satisfied if `ptr` is never used non-atomically for the
+    ///     duration of lifetime `'a`. Most use cases should be able to follow this guideline.
+    ///   * This requirement is also trivially satisfied if all accesses (atomic or not) are done
+    ///     from the same thread.
+    /// * If this atomic type is *not* lock-free:
+    ///   * Any accesses to the value behind `ptr` must have a happens-before relationship
+    ///     with accesses via the returned value (or vice-versa).
+    ///   * Any concurrent accesses to the value behind `ptr` for the duration of lifetime `'a` must
+    ///     be compatible with operations performed by this atomic type.
+    /// * This method must not be used to create overlapping or mixed-size atomic accesses, as
+    ///   these are not supported by the memory model.
+    ///
+    /// [valid]: core::ptr#safety
+    #[inline]
+    #[must_use]
+    pub unsafe fn from_ptr<'a>(ptr: *mut *mut T) -> &'a Self {
+        #[allow(clippy::cast_ptr_alignment)]
+        // SAFETY: guaranteed by the caller
+        unsafe { &*(ptr as *mut Self) }
+    }
+
+    /// Returns `true` if operations on values of this type are lock-free.
+    ///
+    /// If the compiler or the platform doesn't support the necessary
+    /// atomic instructions, global locks for every potentially
+    /// concurrent atomic operation will be used.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::AtomicPtr;
+    ///
+    /// let is_lock_free = AtomicPtr::<()>::is_lock_free();
+    /// ```
+    #[inline]
+    #[must_use]
+    pub fn is_lock_free() -> bool {
+        <imp::AtomicPtr<T>>::is_lock_free()
+    }
+
+    /// Returns `true` if operations on values of this type are lock-free.
+    ///
+    /// If the compiler or the platform doesn't support the necessary
+    /// atomic instructions, global locks for every potentially
+    /// concurrent atomic operation will be used.
+    ///
+    /// **Note:** If the atomic operation relies on dynamic CPU feature detection,
+    /// this type may be lock-free even if the function returns false.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::AtomicPtr;
+    ///
+    /// const IS_ALWAYS_LOCK_FREE: bool = AtomicPtr::<()>::is_always_lock_free();
+    /// ```
+    #[inline]
+    #[must_use]
+    pub const fn is_always_lock_free() -> bool {
+        <imp::AtomicPtr<T>>::is_always_lock_free()
+    }
+
+    /// Returns a mutable reference to the underlying pointer.
+    ///
+    /// This is safe because the mutable reference guarantees that no other threads are
+    /// concurrently accessing the atomic data.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicPtr, Ordering};
+    ///
+    /// let mut data = 10;
+    /// let mut atomic_ptr = AtomicPtr::new(&mut data);
+    /// let mut other_data = 5;
+    /// *atomic_ptr.get_mut() = &mut other_data;
+    /// assert_eq!(unsafe { *atomic_ptr.load(Ordering::SeqCst) }, 5);
+    /// ```
+    #[inline]
+    pub fn get_mut(&mut self) -> &mut *mut T {
+        self.inner.get_mut()
+    }
+
+    // TODO: Add from_mut/get_mut_slice/from_mut_slice once it is stable on std atomic types.
+    // https://github.com/rust-lang/rust/issues/76314
+
+    const_fn! {
+        const_if: #[cfg(not(portable_atomic_no_const_transmute))];
+        /// Consumes the atomic and returns the contained value.
+        ///
+        /// This is safe because passing `self` by value guarantees that no other threads are
+        /// concurrently accessing the atomic data.
+        ///
+        /// This is `const fn` on Rust 1.56+.
+        ///
+        /// # Examples
+        ///
+        /// ```
+        /// use portable_atomic::AtomicPtr;
+        ///
+        /// let mut data = 5;
+        /// let atomic_ptr = AtomicPtr::new(&mut data);
+        /// assert_eq!(unsafe { *atomic_ptr.into_inner() }, 5);
+        /// ```
+        #[inline]
+        pub const fn into_inner(self) -> *mut T {
+            // SAFETY: AtomicPtr<T> and *mut T have the same size and in-memory representations,
+            // so they can be safely transmuted.
+            // (const UnsafeCell::into_inner is unstable)
+            unsafe { core::mem::transmute(self) }
+        }
+    }
+
+    /// Loads a value from the pointer.
+    ///
+    /// `load` takes an [`Ordering`] argument which describes the memory ordering
+    /// of this operation. Possible values are [`SeqCst`], [`Acquire`] and [`Relaxed`].
+    ///
+    /// # Panics
+    ///
+    /// Panics if `order` is [`Release`] or [`AcqRel`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicPtr, Ordering};
+    ///
+    /// let ptr = &mut 5;
+    /// let some_ptr = AtomicPtr::new(ptr);
+    ///
+    /// let value = some_ptr.load(Ordering::Relaxed);
+    /// ```
+    #[inline]
+    #[cfg_attr(
+        any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+        track_caller
+    )]
+    pub fn load(&self, order: Ordering) -> *mut T {
+        self.inner.load(order)
+    }
+
+    /// Stores a value into the pointer.
+    ///
+    /// `store` takes an [`Ordering`] argument which describes the memory ordering
+    /// of this operation. Possible values are [`SeqCst`], [`Release`] and [`Relaxed`].
+    ///
+    /// # Panics
+    ///
+    /// Panics if `order` is [`Acquire`] or [`AcqRel`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicPtr, Ordering};
+    ///
+    /// let ptr = &mut 5;
+    /// let some_ptr = AtomicPtr::new(ptr);
+    ///
+    /// let other_ptr = &mut 10;
+    ///
+    /// some_ptr.store(other_ptr, Ordering::Relaxed);
+    /// ```
+    #[inline]
+    #[cfg_attr(
+        any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+        track_caller
+    )]
+    pub fn store(&self, ptr: *mut T, order: Ordering) {
+        self.inner.store(ptr, order);
+    }
+
+    cfg_has_atomic_cas! {
+    /// Stores a value into the pointer, returning the previous value.
+    ///
+    /// `swap` takes an [`Ordering`] argument which describes the memory ordering
+    /// of this operation. All ordering modes are possible. Note that using
+    /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+    /// using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicPtr, Ordering};
+    ///
+    /// let ptr = &mut 5;
+    /// let some_ptr = AtomicPtr::new(ptr);
+    ///
+    /// let other_ptr = &mut 10;
+    ///
+    /// let value = some_ptr.swap(other_ptr, Ordering::Relaxed);
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn swap(&self, ptr: *mut T, order: Ordering) -> *mut T {
+        self.inner.swap(ptr, order)
+    }
+
+    /// Stores a value into the pointer if the current value is the same as the `current` value.
+    ///
+    /// The return value is a result indicating whether the new value was written and containing
+    /// the previous value. On success this value is guaranteed to be equal to `current`.
+    ///
+    /// `compare_exchange` takes two [`Ordering`] arguments to describe the memory
+    /// ordering of this operation. `success` describes the required ordering for the
+    /// read-modify-write operation that takes place if the comparison with `current` succeeds.
+    /// `failure` describes the required ordering for the load operation that takes place when
+    /// the comparison fails. Using [`Acquire`] as success ordering makes the store part
+    /// of this operation [`Relaxed`], and using [`Release`] makes the successful load
+    /// [`Relaxed`]. The failure ordering can only be [`SeqCst`], [`Acquire`] or [`Relaxed`].
+    ///
+    /// # Panics
+    ///
+    /// Panics if `failure` is [`Release`], [`AcqRel`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicPtr, Ordering};
+    ///
+    /// let ptr = &mut 5;
+    /// let some_ptr = AtomicPtr::new(ptr);
+    ///
+    /// let other_ptr = &mut 10;
+    ///
+    /// let value = some_ptr.compare_exchange(ptr, other_ptr, Ordering::SeqCst, Ordering::Relaxed);
+    /// ```
+    #[inline]
+    #[cfg_attr(docsrs, doc(alias = "compare_and_swap"))]
+    #[cfg_attr(
+        any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+        track_caller
+    )]
+    pub fn compare_exchange(
+        &self,
+        current: *mut T,
+        new: *mut T,
+        success: Ordering,
+        failure: Ordering,
+    ) -> Result<*mut T, *mut T> {
+        self.inner.compare_exchange(current, new, success, failure)
+    }
+
+    /// Stores a value into the pointer if the current value is the same as the `current` value.
+    ///
+    /// Unlike [`AtomicPtr::compare_exchange`], this function is allowed to spuriously fail even when the
+    /// comparison succeeds, which can result in more efficient code on some platforms. The
+    /// return value is a result indicating whether the new value was written and containing the
+    /// previous value.
+    ///
+    /// `compare_exchange_weak` takes two [`Ordering`] arguments to describe the memory
+    /// ordering of this operation. `success` describes the required ordering for the
+    /// read-modify-write operation that takes place if the comparison with `current` succeeds.
+    /// `failure` describes the required ordering for the load operation that takes place when
+    /// the comparison fails. Using [`Acquire`] as success ordering makes the store part
+    /// of this operation [`Relaxed`], and using [`Release`] makes the successful load
+    /// [`Relaxed`]. The failure ordering can only be [`SeqCst`], [`Acquire`] or [`Relaxed`].
+    ///
+    /// # Panics
+    ///
+    /// Panics if `failure` is [`Release`], [`AcqRel`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicPtr, Ordering};
+    ///
+    /// let some_ptr = AtomicPtr::new(&mut 5);
+    ///
+    /// let new = &mut 10;
+    /// let mut old = some_ptr.load(Ordering::Relaxed);
+    /// loop {
+    ///     match some_ptr.compare_exchange_weak(old, new, Ordering::SeqCst, Ordering::Relaxed) {
+    ///         Ok(_) => break,
+    ///         Err(x) => old = x,
+    ///     }
+    /// }
+    /// ```
+    #[inline]
+    #[cfg_attr(docsrs, doc(alias = "compare_and_swap"))]
+    #[cfg_attr(
+        any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+        track_caller
+    )]
+    pub fn compare_exchange_weak(
+        &self,
+        current: *mut T,
+        new: *mut T,
+        success: Ordering,
+        failure: Ordering,
+    ) -> Result<*mut T, *mut T> {
+        self.inner.compare_exchange_weak(current, new, success, failure)
+    }
+
+    /// Fetches the value, and applies a function to it that returns an optional
+    /// new value. Returns a `Result` of `Ok(previous_value)` if the function
+    /// returned `Some(_)`, else `Err(previous_value)`.
+    ///
+    /// Note: This may call the function multiple times if the value has been
+    /// changed from other threads in the meantime, as long as the function
+    /// returns `Some(_)`, but the function will have been applied only once to
+    /// the stored value.
+    ///
+    /// `fetch_update` takes two [`Ordering`] arguments to describe the memory
+    /// ordering of this operation. The first describes the required ordering for
+    /// when the operation finally succeeds while the second describes the
+    /// required ordering for loads. These correspond to the success and failure
+    /// orderings of [`compare_exchange`](Self::compare_exchange) respectively.
+    ///
+    /// Using [`Acquire`] as success ordering makes the store part of this
+    /// operation [`Relaxed`], and using [`Release`] makes the final successful
+    /// load [`Relaxed`]. The (failed) load ordering can only be [`SeqCst`],
+    /// [`Acquire`] or [`Relaxed`].
+    ///
+    /// # Panics
+    ///
+    /// Panics if `fetch_order` is [`Release`], [`AcqRel`].
+    ///
+    /// # Considerations
+    ///
+    /// This method is not magic; it is not provided by the hardware.
+    /// It is implemented in terms of [`compare_exchange_weak`](Self::compare_exchange_weak),
+    /// and suffers from the same drawbacks.
+    /// In particular, this method will not circumvent the [ABA Problem].
+    ///
+    /// [ABA Problem]: https://en.wikipedia.org/wiki/ABA_problem
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicPtr, Ordering};
+    ///
+    /// let ptr: *mut _ = &mut 5;
+    /// let some_ptr = AtomicPtr::new(ptr);
+    ///
+    /// let new: *mut _ = &mut 10;
+    /// assert_eq!(some_ptr.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |_| None), Err(ptr));
+    /// let result = some_ptr.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |x| {
+    ///     if x == ptr {
+    ///         Some(new)
+    ///     } else {
+    ///         None
+    ///     }
+    /// });
+    /// assert_eq!(result, Ok(ptr));
+    /// assert_eq!(some_ptr.load(Ordering::SeqCst), new);
+    /// ```
+    #[inline]
+    #[cfg_attr(
+        any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+        track_caller
+    )]
+    pub fn fetch_update<F>(
+        &self,
+        set_order: Ordering,
+        fetch_order: Ordering,
+        mut f: F,
+    ) -> Result<*mut T, *mut T>
+    where
+        F: FnMut(*mut T) -> Option<*mut T>,
+    {
+        let mut prev = self.load(fetch_order);
+        while let Some(next) = f(prev) {
+            match self.compare_exchange_weak(prev, next, set_order, fetch_order) {
+                x @ Ok(_) => return x,
+                Err(next_prev) => prev = next_prev,
+            }
+        }
+        Err(prev)
+    }
+
+    #[cfg(miri)]
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    fn fetch_update_<F>(&self, order: Ordering, mut f: F) -> *mut T
+    where
+        F: FnMut(*mut T) -> *mut T,
+    {
+        // This is a private function and all instances of `f` only operate on the value
+        // loaded, so there is no need to synchronize the first load/failed CAS.
+        let mut prev = self.load(Ordering::Relaxed);
+        loop {
+            let next = f(prev);
+            match self.compare_exchange_weak(prev, next, order, Ordering::Relaxed) {
+                Ok(x) => return x,
+                Err(next_prev) => prev = next_prev,
+            }
+        }
+    }
+
+    /// Offsets the pointer's address by adding `val` (in units of `T`),
+    /// returning the previous pointer.
+    ///
+    /// This is equivalent to using [`wrapping_add`] to atomically perform the
+    /// equivalent of `ptr = ptr.wrapping_add(val);`.
+    ///
+    /// This method operates in units of `T`, which means that it cannot be used
+    /// to offset the pointer by an amount which is not a multiple of
+    /// `size_of::<T>()`. This can sometimes be inconvenient, as you may want to
+    /// work with a deliberately misaligned pointer. In such cases, you may use
+    /// the [`fetch_byte_add`](Self::fetch_byte_add) method instead.
+    ///
+    /// `fetch_ptr_add` takes an [`Ordering`] argument which describes the
+    /// memory ordering of this operation. All ordering modes are possible. Note
+    /// that using [`Acquire`] makes the store part of this operation
+    /// [`Relaxed`], and using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// [`wrapping_add`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.wrapping_add
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # #![allow(unstable_name_collisions)]
+    /// use portable_atomic::{AtomicPtr, Ordering};
+    /// use sptr::Strict; // stable polyfill for strict provenance
+    ///
+    /// let atom = AtomicPtr::<i64>::new(core::ptr::null_mut());
+    /// assert_eq!(atom.fetch_ptr_add(1, Ordering::Relaxed).addr(), 0);
+    /// // Note: units of `size_of::<i64>()`.
+    /// assert_eq!(atom.load(Ordering::Relaxed).addr(), 8);
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn fetch_ptr_add(&self, val: usize, order: Ordering) -> *mut T {
+        self.fetch_byte_add(val.wrapping_mul(core::mem::size_of::<T>()), order)
+    }
+
+    /// Offsets the pointer's address by subtracting `val` (in units of `T`),
+    /// returning the previous pointer.
+    ///
+    /// This is equivalent to using [`wrapping_sub`] to atomically perform the
+    /// equivalent of `ptr = ptr.wrapping_sub(val);`.
+    ///
+    /// This method operates in units of `T`, which means that it cannot be used
+    /// to offset the pointer by an amount which is not a multiple of
+    /// `size_of::<T>()`. This can sometimes be inconvenient, as you may want to
+    /// work with a deliberately misaligned pointer. In such cases, you may use
+    /// the [`fetch_byte_sub`](Self::fetch_byte_sub) method instead.
+    ///
+    /// `fetch_ptr_sub` takes an [`Ordering`] argument which describes the memory
+    /// ordering of this operation. All ordering modes are possible. Note that
+    /// using [`Acquire`] makes the store part of this operation [`Relaxed`],
+    /// and using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// [`wrapping_sub`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.wrapping_sub
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use portable_atomic::{AtomicPtr, Ordering};
+    ///
+    /// let array = [1i32, 2i32];
+    /// let atom = AtomicPtr::new(array.as_ptr().wrapping_add(1) as *mut _);
+    ///
+    /// assert!(core::ptr::eq(atom.fetch_ptr_sub(1, Ordering::Relaxed), &array[1]));
+    /// assert!(core::ptr::eq(atom.load(Ordering::Relaxed), &array[0]));
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn fetch_ptr_sub(&self, val: usize, order: Ordering) -> *mut T {
+        self.fetch_byte_sub(val.wrapping_mul(core::mem::size_of::<T>()), order)
+    }
+
+    /// Offsets the pointer's address by adding `val` *bytes*, returning the
+    /// previous pointer.
+    ///
+    /// This is equivalent to using [`wrapping_add`] and [`cast`] to atomically
+    /// perform `ptr = ptr.cast::<u8>().wrapping_add(val).cast::<T>()`.
+    ///
+    /// `fetch_byte_add` takes an [`Ordering`] argument which describes the
+    /// memory ordering of this operation. All ordering modes are possible. Note
+    /// that using [`Acquire`] makes the store part of this operation
+    /// [`Relaxed`], and using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// [`wrapping_add`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.wrapping_add
+    /// [`cast`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.cast
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # #![allow(unstable_name_collisions)]
+    /// use portable_atomic::{AtomicPtr, Ordering};
+    /// use sptr::Strict; // stable polyfill for strict provenance
+    ///
+    /// let atom = AtomicPtr::<i64>::new(core::ptr::null_mut());
+    /// assert_eq!(atom.fetch_byte_add(1, Ordering::Relaxed).addr(), 0);
+    /// // Note: in units of bytes, not `size_of::<i64>()`.
+    /// assert_eq!(atom.load(Ordering::Relaxed).addr(), 1);
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn fetch_byte_add(&self, val: usize, order: Ordering) -> *mut T {
+        // Ideally, we would always use AtomicPtr::fetch_* since it is strict-provenance
+        // compatible, but it is unstable. So, for now emulate it only on cfg(miri).
+        // Code using AtomicUsize::fetch_* via casts is still permissive-provenance
+        // compatible and is sound.
+        // TODO: Once `#![feature(strict_provenance_atomic_ptr)]` is stabilized,
+        // use AtomicPtr::fetch_* in all cases from the version in which it is stabilized.
+        #[cfg(miri)]
+        {
+            self.fetch_update_(order, |x| strict::map_addr(x, |x| x.wrapping_add(val)))
+        }
+        #[cfg(not(miri))]
+        {
+            self.as_atomic_usize().fetch_add(val, order) as *mut T
+        }
+    }
+
+    /// Offsets the pointer's address by subtracting `val` *bytes*, returning the
+    /// previous pointer.
+    ///
+    /// This is equivalent to using [`wrapping_sub`] and [`cast`] to atomically
+    /// perform `ptr = ptr.cast::<u8>().wrapping_sub(val).cast::<T>()`.
+    ///
+    /// `fetch_byte_sub` takes an [`Ordering`] argument which describes the
+    /// memory ordering of this operation. All ordering modes are possible. Note
+    /// that using [`Acquire`] makes the store part of this operation
+    /// [`Relaxed`], and using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// [`wrapping_sub`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.wrapping_sub
+    /// [`cast`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.cast
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # #![allow(unstable_name_collisions)]
+    /// use portable_atomic::{AtomicPtr, Ordering};
+    /// use sptr::Strict; // stable polyfill for strict provenance
+    ///
+    /// let atom = AtomicPtr::<i64>::new(sptr::invalid_mut(1));
+    /// assert_eq!(atom.fetch_byte_sub(1, Ordering::Relaxed).addr(), 1);
+    /// assert_eq!(atom.load(Ordering::Relaxed).addr(), 0);
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn fetch_byte_sub(&self, val: usize, order: Ordering) -> *mut T {
+        // Ideally, we would always use AtomicPtr::fetch_* since it is strict-provenance
+        // compatible, but it is unstable. So, for now emulate it only on cfg(miri).
+        // Code using AtomicUsize::fetch_* via casts is still permissive-provenance
+        // compatible and is sound.
+        // TODO: Once `#![feature(strict_provenance_atomic_ptr)]` is stabilized,
+        // use AtomicPtr::fetch_* in all cases from the version in which it is stabilized.
+        #[cfg(miri)]
+        {
+            self.fetch_update_(order, |x| strict::map_addr(x, |x| x.wrapping_sub(val)))
+        }
+        #[cfg(not(miri))]
+        {
+            self.as_atomic_usize().fetch_sub(val, order) as *mut T
+        }
+    }
+
+    /// Performs a bitwise "or" operation on the address of the current pointer,
+    /// and the argument `val`, and stores a pointer with provenance of the
+    /// current pointer and the resulting address.
+    ///
+    /// This is equivalent to using [`map_addr`] to atomically perform
+    /// `ptr = ptr.map_addr(|a| a | val)`. This can be used in tagged
+    /// pointer schemes to atomically set tag bits.
+    ///
+    /// **Caveat**: This operation returns the previous value. To compute the
+    /// stored value without losing provenance, you may use [`map_addr`]. For
+    /// example: `a.fetch_or(val).map_addr(|a| a | val)`.
+    ///
+    /// `fetch_or` takes an [`Ordering`] argument which describes the memory
+    /// ordering of this operation. All ordering modes are possible. Note that
+    /// using [`Acquire`] makes the store part of this operation [`Relaxed`],
+    /// and using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// This API and its claimed semantics are part of the Strict Provenance
+    /// experiment, see the [module documentation for `ptr`][core::ptr] for
+    /// details.
+    ///
+    /// [`map_addr`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.map_addr
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # #![allow(unstable_name_collisions)]
+    /// use portable_atomic::{AtomicPtr, Ordering};
+    /// use sptr::Strict; // stable polyfill for strict provenance
+    ///
+    /// let pointer = &mut 3i64 as *mut i64;
+    ///
+    /// let atom = AtomicPtr::<i64>::new(pointer);
+    /// // Tag the bottom bit of the pointer.
+    /// assert_eq!(atom.fetch_or(1, Ordering::Relaxed).addr() & 1, 0);
+    /// // Extract and untag.
+    /// let tagged = atom.load(Ordering::Relaxed);
+    /// assert_eq!(tagged.addr() & 1, 1);
+    /// assert_eq!(tagged.map_addr(|p| p & !1), pointer);
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn fetch_or(&self, val: usize, order: Ordering) -> *mut T {
+        // Ideally, we would always use AtomicPtr::fetch_* since it is strict-provenance
+        // compatible, but it is unstable. So, for now emulate it only on cfg(miri).
+        // Code using AtomicUsize::fetch_* via casts is still permissive-provenance
+        // compatible and is sound.
+        // TODO: Once `#![feature(strict_provenance_atomic_ptr)]` is stabilized,
+        // use AtomicPtr::fetch_* in all cases from the version in which it is stabilized.
+        #[cfg(miri)]
+        {
+            self.fetch_update_(order, |x| strict::map_addr(x, |x| x | val))
+        }
+        #[cfg(not(miri))]
+        {
+            self.as_atomic_usize().fetch_or(val, order) as *mut T
+        }
+    }
+
+    /// Performs a bitwise "and" operation on the address of the current
+    /// pointer, and the argument `val`, and stores a pointer with provenance of
+    /// the current pointer and the resulting address.
+    ///
+    /// This is equivalent to using [`map_addr`] to atomically perform
+    /// `ptr = ptr.map_addr(|a| a & val)`. This can be used in tagged
+    /// pointer schemes to atomically unset tag bits.
+    ///
+    /// **Caveat**: This operation returns the previous value. To compute the
+    /// stored value without losing provenance, you may use [`map_addr`]. For
+    /// example: `a.fetch_and(val).map_addr(|a| a & val)`.
+    ///
+    /// `fetch_and` takes an [`Ordering`] argument which describes the memory
+    /// ordering of this operation. All ordering modes are possible. Note that
+    /// using [`Acquire`] makes the store part of this operation [`Relaxed`],
+    /// and using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// This API and its claimed semantics are part of the Strict Provenance
+    /// experiment, see the [module documentation for `ptr`][core::ptr] for
+    /// details.
+    ///
+    /// [`map_addr`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.map_addr
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # #![allow(unstable_name_collisions)]
+    /// use portable_atomic::{AtomicPtr, Ordering};
+    /// use sptr::Strict; // stable polyfill for strict provenance
+    ///
+    /// let pointer = &mut 3i64 as *mut i64;
+    /// // A tagged pointer
+    /// let atom = AtomicPtr::<i64>::new(pointer.map_addr(|a| a | 1));
+    /// assert_eq!(atom.fetch_or(1, Ordering::Relaxed).addr() & 1, 1);
+    /// // Untag, and extract the previously tagged pointer.
+    /// let untagged = atom.fetch_and(!1, Ordering::Relaxed).map_addr(|a| a & !1);
+    /// assert_eq!(untagged, pointer);
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn fetch_and(&self, val: usize, order: Ordering) -> *mut T {
+        // Ideally, we would always use AtomicPtr::fetch_* since it is strict-provenance
+        // compatible, but it is unstable. So, for now emulate it only on cfg(miri).
+        // Code using AtomicUsize::fetch_* via casts is still permissive-provenance
+        // compatible and is sound.
+        // TODO: Once `#![feature(strict_provenance_atomic_ptr)]` is stabilized,
+        // use AtomicPtr::fetch_* in all cases from the version in which it is stabilized.
+        #[cfg(miri)]
+        {
+            self.fetch_update_(order, |x| strict::map_addr(x, |x| x & val))
+        }
+        #[cfg(not(miri))]
+        {
+            self.as_atomic_usize().fetch_and(val, order) as *mut T
+        }
+    }
+
+    /// Performs a bitwise "xor" operation on the address of the current
+    /// pointer, and the argument `val`, and stores a pointer with provenance of
+    /// the current pointer and the resulting address.
+    ///
+    /// This is equivalent to using [`map_addr`] to atomically perform
+    /// `ptr = ptr.map_addr(|a| a ^ val)`. This can be used in tagged
+    /// pointer schemes to atomically toggle tag bits.
+    ///
+    /// **Caveat**: This operation returns the previous value. To compute the
+    /// stored value without losing provenance, you may use [`map_addr`]. For
+    /// example: `a.fetch_xor(val).map_addr(|a| a ^ val)`.
+    ///
+    /// `fetch_xor` takes an [`Ordering`] argument which describes the memory
+    /// ordering of this operation. All ordering modes are possible. Note that
+    /// using [`Acquire`] makes the store part of this operation [`Relaxed`],
+    /// and using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// This API and its claimed semantics are part of the Strict Provenance
+    /// experiment, see the [module documentation for `ptr`][core::ptr] for
+    /// details.
+    ///
+    /// [`map_addr`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.map_addr
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # #![allow(unstable_name_collisions)]
+    /// use portable_atomic::{AtomicPtr, Ordering};
+    /// use sptr::Strict; // stable polyfill for strict provenance
+    ///
+    /// let pointer = &mut 3i64 as *mut i64;
+    /// let atom = AtomicPtr::<i64>::new(pointer);
+    ///
+    /// // Toggle a tag bit on the pointer.
+    /// atom.fetch_xor(1, Ordering::Relaxed);
+    /// assert_eq!(atom.load(Ordering::Relaxed).addr() & 1, 1);
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn fetch_xor(&self, val: usize, order: Ordering) -> *mut T {
+        // Ideally, we would always use AtomicPtr::fetch_* since it is strict-provenance
+        // compatible, but it is unstable. So, for now emulate it only on cfg(miri).
+        // Code using AtomicUsize::fetch_* via casts is still permissive-provenance
+        // compatible and is sound.
+        // TODO: Once `#![feature(strict_provenance_atomic_ptr)]` is stabilized,
+        // use AtomicPtr::fetch_* in all cases from the version in which it is stabilized.
+        #[cfg(miri)]
+        {
+            self.fetch_update_(order, |x| strict::map_addr(x, |x| x ^ val))
+        }
+        #[cfg(not(miri))]
+        {
+            self.as_atomic_usize().fetch_xor(val, order) as *mut T
+        }
+    }
+
+    /// Sets the bit at the specified bit-position to 1.
+    ///
+    /// Returns `true` if the specified bit was previously set to 1.
+    ///
+    /// `bit_set` takes an [`Ordering`] argument which describes the memory ordering
+    /// of this operation. All ordering modes are possible. Note that using
+    /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+    /// using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// This corresponds to x86's `lock bts`, and the implementation calls them on x86/x86_64.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # #![allow(unstable_name_collisions)]
+    /// use portable_atomic::{AtomicPtr, Ordering};
+    /// use sptr::Strict; // stable polyfill for strict provenance
+    ///
+    /// let pointer = &mut 3i64 as *mut i64;
+    ///
+    /// let atom = AtomicPtr::<i64>::new(pointer);
+    /// // Tag the bottom bit of the pointer.
+    /// assert!(!atom.bit_set(0, Ordering::Relaxed));
+    /// // Extract and untag.
+    /// let tagged = atom.load(Ordering::Relaxed);
+    /// assert_eq!(tagged.addr() & 1, 1);
+    /// assert_eq!(tagged.map_addr(|p| p & !1), pointer);
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn bit_set(&self, bit: u32, order: Ordering) -> bool {
+        // Ideally, we would always use AtomicPtr::fetch_* since it is strict-provenance
+        // compatible, but it is unstable. So, for now emulate it only on cfg(miri).
+        // Code using AtomicUsize::fetch_* via casts is still permissive-provenance
+        // compatible and is sound.
+        // TODO: Once `#![feature(strict_provenance_atomic_ptr)]` is stabilized,
+        // use AtomicPtr::fetch_* in all cases from the version in which it is stabilized.
+        #[cfg(miri)]
+        {
+            let mask = 1_usize.wrapping_shl(bit);
+            self.fetch_or(mask, order) as usize & mask != 0
+        }
+        #[cfg(not(miri))]
+        {
+            self.as_atomic_usize().bit_set(bit, order)
+        }
+    }
+
+    /// Clears the bit at the specified bit-position to 1.
+    ///
+    /// Returns `true` if the specified bit was previously set to 1.
+    ///
+    /// `bit_clear` takes an [`Ordering`] argument which describes the memory ordering
+    /// of this operation. All ordering modes are possible. Note that using
+    /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+    /// using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// This corresponds to x86's `lock btr`, and the implementation calls them on x86/x86_64.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # #![allow(unstable_name_collisions)]
+    /// use portable_atomic::{AtomicPtr, Ordering};
+    /// use sptr::Strict; // stable polyfill for strict provenance
+    ///
+    /// let pointer = &mut 3i64 as *mut i64;
+    /// // A tagged pointer
+    /// let atom = AtomicPtr::<i64>::new(pointer.map_addr(|a| a | 1));
+    /// assert!(atom.bit_set(0, Ordering::Relaxed));
+    /// // Untag
+    /// assert!(atom.bit_clear(0, Ordering::Relaxed));
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn bit_clear(&self, bit: u32, order: Ordering) -> bool {
+        // Ideally, we would always use AtomicPtr::fetch_* since it is strict-provenance
+        // compatible, but it is unstable. So, for now emulate it only on cfg(miri).
+        // Code using AtomicUsize::fetch_* via casts is still permissive-provenance
+        // compatible and is sound.
+        // TODO: Once `#![feature(strict_provenance_atomic_ptr)]` is stabilized,
+        // use AtomicPtr::fetch_* in all cases from the version in which it is stabilized.
+        #[cfg(miri)]
+        {
+            let mask = 1_usize.wrapping_shl(bit);
+            self.fetch_and(!mask, order) as usize & mask != 0
+        }
+        #[cfg(not(miri))]
+        {
+            self.as_atomic_usize().bit_clear(bit, order)
+        }
+    }
+
+    /// Toggles the bit at the specified bit-position.
+    ///
+    /// Returns `true` if the specified bit was previously set to 1.
+    ///
+    /// `bit_toggle` takes an [`Ordering`] argument which describes the memory ordering
+    /// of this operation. All ordering modes are possible. Note that using
+    /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+    /// using [`Release`] makes the load part [`Relaxed`].
+    ///
+    /// This corresponds to x86's `lock btc`, and the implementation calls them on x86/x86_64.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # #![allow(unstable_name_collisions)]
+    /// use portable_atomic::{AtomicPtr, Ordering};
+    /// use sptr::Strict; // stable polyfill for strict provenance
+    ///
+    /// let pointer = &mut 3i64 as *mut i64;
+    /// let atom = AtomicPtr::<i64>::new(pointer);
+    ///
+    /// // Toggle a tag bit on the pointer.
+    /// atom.bit_toggle(0, Ordering::Relaxed);
+    /// assert_eq!(atom.load(Ordering::Relaxed).addr() & 1, 1);
+    /// ```
+    #[inline]
+    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+    pub fn bit_toggle(&self, bit: u32, order: Ordering) -> bool {
+        // Ideally, we would always use AtomicPtr::fetch_* since it is strict-provenance
+        // compatible, but it is unstable. So, for now emulate it only on cfg(miri).
+        // Code using AtomicUsize::fetch_* via casts is still permissive-provenance
+        // compatible and is sound.
+        // TODO: Once `#![feature(strict_provenance_atomic_ptr)]` is stabilized,
+        // use AtomicPtr::fetch_* in all cases from the version in which it is stabilized.
+        #[cfg(miri)]
+        {
+            let mask = 1_usize.wrapping_shl(bit);
+            self.fetch_xor(mask, order) as usize & mask != 0
+        }
+        #[cfg(not(miri))]
+        {
+            self.as_atomic_usize().bit_toggle(bit, order)
+        }
+    }
+
+    #[cfg(not(miri))]
+    #[inline]
+    fn as_atomic_usize(&self) -> &AtomicUsize {
+        static_assert!(
+            core::mem::size_of::<AtomicPtr<()>>() == core::mem::size_of::<AtomicUsize>()
+        );
+        static_assert!(
+            core::mem::align_of::<AtomicPtr<()>>() == core::mem::align_of::<AtomicUsize>()
+        );
+        // SAFETY: AtomicPtr and AtomicUsize have the same layout,
+        // and both access data in the same way.
+        unsafe { &*(self as *const Self as *const AtomicUsize) }
+    }
+    } // cfg_has_atomic_cas!
+
+    const_fn! {
+        const_if: #[cfg(not(portable_atomic_no_const_raw_ptr_deref))];
+        /// Returns a mutable pointer to the underlying pointer.
+        ///
+        /// Returning an `*mut` pointer from a shared reference to this atomic is
+        /// safe because the atomic types work with interior mutability. Any use of
+        /// the returned raw pointer requires an `unsafe` block and has to uphold
+        /// the safety requirements. If there is concurrent access, note the following
+        /// additional safety requirements:
+        ///
+        /// - If this atomic type is [lock-free](Self::is_lock_free), any concurrent
+        ///   operations on it must be atomic.
+        /// - Otherwise, any concurrent operations on it must be compatible with
+        ///   operations performed by this atomic type.
+        ///
+        /// This is `const fn` on Rust 1.58+.
+        #[inline]
+        pub const fn as_ptr(&self) -> *mut *mut T {
+            self.inner.as_ptr()
+        }
+    }
+}
+} // cfg_has_atomic_ptr!
+
+macro_rules! atomic_int {
+    // TODO: support AtomicF{16,128} once https://github.com/rust-lang/rust/issues/116909 stabilized.
+    (AtomicU32, $int_type:ident, $align:literal) => {
+        atomic_int!(int, AtomicU32, $int_type, $align);
+        #[cfg(feature = "float")]
+        atomic_int!(float, AtomicF32, f32, AtomicU32, $int_type, $align);
+    };
+    (AtomicU64, $int_type:ident, $align:literal) => {
+        atomic_int!(int, AtomicU64, $int_type, $align);
+        #[cfg(feature = "float")]
+        atomic_int!(float, AtomicF64, f64, AtomicU64, $int_type, $align);
+    };
+    ($atomic_type:ident, $int_type:ident, $align:literal) => {
+        atomic_int!(int, $atomic_type, $int_type, $align);
+    };
+
+    // Atomic{I,U}* impls
+    (int, $atomic_type:ident, $int_type:ident, $align:literal) => {
+        doc_comment! {
+            concat!("An integer type which can be safely shared between threads.
+
+This type has the same in-memory representation as the underlying integer type,
+[`", stringify!($int_type), "`].
+
+If the compiler and the platform support atomic loads and stores of [`", stringify!($int_type),
+"`], this type is a wrapper for the standard library's `", stringify!($atomic_type),
+"`. If the platform supports it but the compiler does not, atomic operations are implemented using
+inline assembly. Otherwise synchronizes using global locks.
+You can call [`", stringify!($atomic_type), "::is_lock_free()`] to check whether
+atomic instructions or locks will be used.
+"
+            ),
+            // We can use #[repr(transparent)] here, but #[repr(C, align(N))]
+            // will show clearer docs.
+            #[repr(C, align($align))]
+            pub struct $atomic_type {
+                inner: imp::$atomic_type,
+            }
+        }
+
+        impl Default for $atomic_type {
+            #[inline]
+            fn default() -> Self {
+                Self::new($int_type::default())
+            }
+        }
+
+        impl From<$int_type> for $atomic_type {
+            #[inline]
+            fn from(v: $int_type) -> Self {
+                Self::new(v)
+            }
+        }
+
+        // UnwindSafe is implicitly implemented.
+        #[cfg(not(portable_atomic_no_core_unwind_safe))]
+        impl core::panic::RefUnwindSafe for $atomic_type {}
+        #[cfg(all(portable_atomic_no_core_unwind_safe, feature = "std"))]
+        impl std::panic::RefUnwindSafe for $atomic_type {}
+
+        impl_debug_and_serde!($atomic_type);
+
+        impl $atomic_type {
+            doc_comment! {
+                concat!(
+                    "Creates a new atomic integer.
+
+# Examples
+
+```
+use portable_atomic::", stringify!($atomic_type), ";
+
+let atomic_forty_two = ", stringify!($atomic_type), "::new(42);
+```"
+                ),
+                #[inline]
+                #[must_use]
+                pub const fn new(v: $int_type) -> Self {
+                    static_assert_layout!($atomic_type, $int_type);
+                    Self { inner: imp::$atomic_type::new(v) }
+                }
+            }
+
+            // TODO: update docs based on https://github.com/rust-lang/rust/pull/116762
+            doc_comment! {
+                concat!("Creates a new reference to an atomic integer from a pointer.
+
+# Safety
+
+* `ptr` must be aligned to `align_of::<", stringify!($atomic_type), ">()` (note that on some platforms this
+  can be bigger than `align_of::<", stringify!($int_type), ">()`).
+* `ptr` must be [valid] for both reads and writes for the whole lifetime `'a`.
+* If this atomic type is [lock-free](Self::is_lock_free), non-atomic accesses to the value
+  behind `ptr` must have a happens-before relationship with atomic accesses via
+  the returned value (or vice-versa).
+  * In other words, time periods where the value is accessed atomically may not
+    overlap with periods where the value is accessed non-atomically.
+  * This requirement is trivially satisfied if `ptr` is never used non-atomically
+    for the duration of lifetime `'a`. Most use cases should be able to follow
+    this guideline.
+  * This requirement is also trivially satisfied if all accesses (atomic or not) are
+    done from the same thread.
+* If this atomic type is *not* lock-free:
+  * Any accesses to the value behind `ptr` must have a happens-before relationship
+    with accesses via the returned value (or vice-versa).
+  * Any concurrent accesses to the value behind `ptr` for the duration of lifetime `'a` must
+    be compatible with operations performed by this atomic type.
+* This method must not be used to create overlapping or mixed-size atomic
+  accesses, as these are not supported by the memory model.
+
+[valid]: core::ptr#safety"),
+                #[inline]
+                #[must_use]
+                pub unsafe fn from_ptr<'a>(ptr: *mut $int_type) -> &'a Self {
+                    #[allow(clippy::cast_ptr_alignment)]
+                    // SAFETY: guaranteed by the caller
+                    unsafe { &*(ptr as *mut Self) }
+                }
+            }
+
+            doc_comment! {
+                concat!("Returns `true` if operations on values of this type are lock-free.
+
+If the compiler or the platform doesn't support the necessary
+atomic instructions, global locks for every potentially
+concurrent atomic operation will be used.
+
+# Examples
+
+```
+use portable_atomic::", stringify!($atomic_type), ";
+
+let is_lock_free = ", stringify!($atomic_type), "::is_lock_free();
+```"),
+                #[inline]
+                #[must_use]
+                pub fn is_lock_free() -> bool {
+                    <imp::$atomic_type>::is_lock_free()
+                }
+            }
+
+            doc_comment! {
+                concat!("Returns `true` if operations on values of this type are lock-free.
+
+If the compiler or the platform doesn't support the necessary
+atomic instructions, global locks for every potentially
+concurrent atomic operation will be used.
+
+**Note:** If the atomic operation relies on dynamic CPU feature detection,
+this type may be lock-free even if the function returns false.
+
+# Examples
+
+```
+use portable_atomic::", stringify!($atomic_type), ";
+
+const IS_ALWAYS_LOCK_FREE: bool = ", stringify!($atomic_type), "::is_always_lock_free();
+```"),
+                #[inline]
+                #[must_use]
+                pub const fn is_always_lock_free() -> bool {
+                    <imp::$atomic_type>::is_always_lock_free()
+                }
+            }
+
+            doc_comment! {
+                concat!("Returns a mutable reference to the underlying integer.\n
+This is safe because the mutable reference guarantees that no other threads are
+concurrently accessing the atomic data.
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let mut some_var = ", stringify!($atomic_type), "::new(10);
+assert_eq!(*some_var.get_mut(), 10);
+*some_var.get_mut() = 5;
+assert_eq!(some_var.load(Ordering::SeqCst), 5);
+```"),
+                #[inline]
+                pub fn get_mut(&mut self) -> &mut $int_type {
+                    self.inner.get_mut()
+                }
+            }
+
+            // TODO: Add from_mut/get_mut_slice/from_mut_slice once it is stable on std atomic types.
+            // https://github.com/rust-lang/rust/issues/76314
+
+            #[cfg(not(portable_atomic_no_const_transmute))]
+            doc_comment! {
+                concat!("Consumes the atomic and returns the contained value.
+
+This is safe because passing `self` by value guarantees that no other threads are
+concurrently accessing the atomic data.
+
+This is `const fn` on Rust 1.56+.
+
+# Examples
+
+```
+use portable_atomic::", stringify!($atomic_type), ";
+
+let some_var = ", stringify!($atomic_type), "::new(5);
+assert_eq!(some_var.into_inner(), 5);
+```"),
+                #[inline]
+                pub const fn into_inner(self) -> $int_type {
+                    // SAFETY: $atomic_type and $int_type have the same size and in-memory representations,
+                    // so they can be safely transmuted.
+                    // (const UnsafeCell::into_inner is unstable)
+                    unsafe { core::mem::transmute(self) }
+                }
+            }
+            #[cfg(portable_atomic_no_const_transmute)]
+            doc_comment! {
+                concat!("Consumes the atomic and returns the contained value.
+
+This is safe because passing `self` by value guarantees that no other threads are
+concurrently accessing the atomic data.
+
+This is `const fn` on Rust 1.56+.
+
+# Examples
+
+```
+use portable_atomic::", stringify!($atomic_type), ";
+
+let some_var = ", stringify!($atomic_type), "::new(5);
+assert_eq!(some_var.into_inner(), 5);
+```"),
+                #[inline]
+                pub fn into_inner(self) -> $int_type {
+                    // SAFETY: $atomic_type and $int_type have the same size and in-memory representations,
+                    // so they can be safely transmuted.
+                    // (const UnsafeCell::into_inner is unstable)
+                    unsafe { core::mem::transmute(self) }
+                }
+            }
+
+            doc_comment! {
+                concat!("Loads a value from the atomic integer.
+
+`load` takes an [`Ordering`] argument which describes the memory ordering of this operation.
+Possible values are [`SeqCst`], [`Acquire`] and [`Relaxed`].
+
+# Panics
+
+Panics if `order` is [`Release`] or [`AcqRel`].
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let some_var = ", stringify!($atomic_type), "::new(5);
+
+assert_eq!(some_var.load(Ordering::Relaxed), 5);
+```"),
+                #[inline]
+                #[cfg_attr(
+                    any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                    track_caller
+                )]
+                pub fn load(&self, order: Ordering) -> $int_type {
+                    self.inner.load(order)
+                }
+            }
+
+            doc_comment! {
+                concat!("Stores a value into the atomic integer.
+
+`store` takes an [`Ordering`] argument which describes the memory ordering of this operation.
+Possible values are [`SeqCst`], [`Release`] and [`Relaxed`].
+
+# Panics
+
+Panics if `order` is [`Acquire`] or [`AcqRel`].
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let some_var = ", stringify!($atomic_type), "::new(5);
+
+some_var.store(10, Ordering::Relaxed);
+assert_eq!(some_var.load(Ordering::Relaxed), 10);
+```"),
+                #[inline]
+                #[cfg_attr(
+                    any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                    track_caller
+                )]
+                pub fn store(&self, val: $int_type, order: Ordering) {
+                    self.inner.store(val, order)
+                }
+            }
+
+            cfg_has_atomic_cas! {
+            doc_comment! {
+                concat!("Stores a value into the atomic integer, returning the previous value.
+
+`swap` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let some_var = ", stringify!($atomic_type), "::new(5);
+
+assert_eq!(some_var.swap(10, Ordering::Relaxed), 5);
+```"),
+                #[inline]
+                #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                pub fn swap(&self, val: $int_type, order: Ordering) -> $int_type {
+                    self.inner.swap(val, order)
+                }
+            }
+
+            doc_comment! {
+                concat!("Stores a value into the atomic integer if the current value is the same as
+the `current` value.
+
+The return value is a result indicating whether the new value was written and
+containing the previous value. On success this value is guaranteed to be equal to
+`current`.
+
+`compare_exchange` takes two [`Ordering`] arguments to describe the memory
+ordering of this operation. `success` describes the required ordering for the
+read-modify-write operation that takes place if the comparison with `current` succeeds.
+`failure` describes the required ordering for the load operation that takes place when
+the comparison fails. Using [`Acquire`] as success ordering makes the store part
+of this operation [`Relaxed`], and using [`Release`] makes the successful load
+[`Relaxed`]. The failure ordering can only be [`SeqCst`], [`Acquire`] or [`Relaxed`].
+
+# Panics
+
+Panics if `failure` is [`Release`], [`AcqRel`].
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let some_var = ", stringify!($atomic_type), "::new(5);
+
+assert_eq!(
+    some_var.compare_exchange(5, 10, Ordering::Acquire, Ordering::Relaxed),
+    Ok(5),
+);
+assert_eq!(some_var.load(Ordering::Relaxed), 10);
+
+assert_eq!(
+    some_var.compare_exchange(6, 12, Ordering::SeqCst, Ordering::Acquire),
+    Err(10),
+);
+assert_eq!(some_var.load(Ordering::Relaxed), 10);
+```"),
+                #[inline]
+                #[cfg_attr(docsrs, doc(alias = "compare_and_swap"))]
+                #[cfg_attr(
+                    any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                    track_caller
+                )]
+                pub fn compare_exchange(
+                    &self,
+                    current: $int_type,
+                    new: $int_type,
+                    success: Ordering,
+                    failure: Ordering,
+                ) -> Result<$int_type, $int_type> {
+                    self.inner.compare_exchange(current, new, success, failure)
+                }
+            }
+
+            doc_comment! {
+                concat!("Stores a value into the atomic integer if the current value is the same as
+the `current` value.
+Unlike [`compare_exchange`](Self::compare_exchange)
+this function is allowed to spuriously fail even
+when the comparison succeeds, which can result in more efficient code on some
+platforms. The return value is a result indicating whether the new value was
+written and containing the previous value.
+
+`compare_exchange_weak` takes two [`Ordering`] arguments to describe the memory
+ordering of this operation. `success` describes the required ordering for the
+read-modify-write operation that takes place if the comparison with `current` succeeds.
+`failure` describes the required ordering for the load operation that takes place when
+the comparison fails. Using [`Acquire`] as success ordering makes the store part
+of this operation [`Relaxed`], and using [`Release`] makes the successful load
+[`Relaxed`]. The failure ordering can only be [`SeqCst`], [`Acquire`] or [`Relaxed`].
+
+# Panics
+
+Panics if `failure` is [`Release`], [`AcqRel`].
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let val = ", stringify!($atomic_type), "::new(4);
+
+let mut old = val.load(Ordering::Relaxed);
+loop {
+    let new = old * 2;
+    match val.compare_exchange_weak(old, new, Ordering::SeqCst, Ordering::Relaxed) {
+        Ok(_) => break,
+        Err(x) => old = x,
+    }
+}
+```"),
+                #[inline]
+                #[cfg_attr(docsrs, doc(alias = "compare_and_swap"))]
+                #[cfg_attr(
+                    any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                    track_caller
+                )]
+                pub fn compare_exchange_weak(
+                    &self,
+                    current: $int_type,
+                    new: $int_type,
+                    success: Ordering,
+                    failure: Ordering,
+                ) -> Result<$int_type, $int_type> {
+                    self.inner.compare_exchange_weak(current, new, success, failure)
+                }
+            }
+
+            doc_comment! {
+                concat!("Adds to the current value, returning the previous value.
+
+This operation wraps around on overflow.
+
+`fetch_add` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(0);
+assert_eq!(foo.fetch_add(10, Ordering::SeqCst), 0);
+assert_eq!(foo.load(Ordering::SeqCst), 10);
+```"),
+                #[inline]
+                #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                pub fn fetch_add(&self, val: $int_type, order: Ordering) -> $int_type {
+                    self.inner.fetch_add(val, order)
+                }
+            }
+
+            doc_comment! {
+                concat!("Adds to the current value.
+
+This operation wraps around on overflow.
+
+Unlike `fetch_add`, this does not return the previous value.
+
+`add` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+This function may generate more efficient code than `fetch_add` on some platforms.
+
+- MSP430: `add` instead of disabling interrupts ({8,16}-bit atomics)
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(0);
+foo.add(10, Ordering::SeqCst);
+assert_eq!(foo.load(Ordering::SeqCst), 10);
+```"),
+                #[inline]
+                #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                pub fn add(&self, val: $int_type, order: Ordering) {
+                    self.inner.add(val, order);
+                }
+            }
+
+            doc_comment! {
+                concat!("Subtracts from the current value, returning the previous value.
+
+This operation wraps around on overflow.
+
+`fetch_sub` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(20);
+assert_eq!(foo.fetch_sub(10, Ordering::SeqCst), 20);
+assert_eq!(foo.load(Ordering::SeqCst), 10);
+```"),
+                #[inline]
+                #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                pub fn fetch_sub(&self, val: $int_type, order: Ordering) -> $int_type {
+                    self.inner.fetch_sub(val, order)
+                }
+            }
+
+            doc_comment! {
+                concat!("Subtracts from the current value.
+
+This operation wraps around on overflow.
+
+Unlike `fetch_sub`, this does not return the previous value.
+
+`sub` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+This function may generate more efficient code than `fetch_sub` on some platforms.
+
+- MSP430: `sub` instead of disabling interrupts ({8,16}-bit atomics)
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(20);
+foo.sub(10, Ordering::SeqCst);
+assert_eq!(foo.load(Ordering::SeqCst), 10);
+```"),
+                #[inline]
+                #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                pub fn sub(&self, val: $int_type, order: Ordering) {
+                    self.inner.sub(val, order);
+                }
+            }
+
+            doc_comment! {
+                concat!("Bitwise \"and\" with the current value.
+
+Performs a bitwise \"and\" operation on the current value and the argument `val`, and
+sets the new value to the result.
+
+Returns the previous value.
+
+`fetch_and` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(0b101101);
+assert_eq!(foo.fetch_and(0b110011, Ordering::SeqCst), 0b101101);
+assert_eq!(foo.load(Ordering::SeqCst), 0b100001);
+```"),
+                #[inline]
+                #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                pub fn fetch_and(&self, val: $int_type, order: Ordering) -> $int_type {
+                    self.inner.fetch_and(val, order)
+                }
+            }
+
+            doc_comment! {
+                concat!("Bitwise \"and\" with the current value.
+
+Performs a bitwise \"and\" operation on the current value and the argument `val`, and
+sets the new value to the result.
+
+Unlike `fetch_and`, this does not return the previous value.
+
+`and` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+This function may generate more efficient code than `fetch_and` on some platforms.
+
+- x86/x86_64: `lock and` instead of `cmpxchg` loop ({8,16,32}-bit atomics on x86, but additionally 64-bit atomics on x86_64)
+- MSP430: `and` instead of disabling interrupts ({8,16}-bit atomics)
+
+Note: On x86/x86_64, the use of either function should not usually
+affect the generated code, because LLVM can properly optimize the case
+where the result is unused.
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(0b101101);
+assert_eq!(foo.fetch_and(0b110011, Ordering::SeqCst), 0b101101);
+assert_eq!(foo.load(Ordering::SeqCst), 0b100001);
+```"),
+                #[inline]
+                #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                pub fn and(&self, val: $int_type, order: Ordering) {
+                    self.inner.and(val, order);
+                }
+            }
+
+            doc_comment! {
+                concat!("Bitwise \"nand\" with the current value.
+
+Performs a bitwise \"nand\" operation on the current value and the argument `val`, and
+sets the new value to the result.
+
+Returns the previous value.
+
+`fetch_nand` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(0x13);
+assert_eq!(foo.fetch_nand(0x31, Ordering::SeqCst), 0x13);
+assert_eq!(foo.load(Ordering::SeqCst), !(0x13 & 0x31));
+```"),
+                #[inline]
+                #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                pub fn fetch_nand(&self, val: $int_type, order: Ordering) -> $int_type {
+                    self.inner.fetch_nand(val, order)
+                }
+            }
+
+            doc_comment! {
+                concat!("Bitwise \"or\" with the current value.
+
+Performs a bitwise \"or\" operation on the current value and the argument `val`, and
+sets the new value to the result.
+
+Returns the previous value.
+
+`fetch_or` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(0b101101);
+assert_eq!(foo.fetch_or(0b110011, Ordering::SeqCst), 0b101101);
+assert_eq!(foo.load(Ordering::SeqCst), 0b111111);
+```"),
+                #[inline]
+                #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                pub fn fetch_or(&self, val: $int_type, order: Ordering) -> $int_type {
+                    self.inner.fetch_or(val, order)
+                }
+            }
+
+            doc_comment! {
+                concat!("Bitwise \"or\" with the current value.
+
+Performs a bitwise \"or\" operation on the current value and the argument `val`, and
+sets the new value to the result.
+
+Unlike `fetch_or`, this does not return the previous value.
+
+`or` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+This function may generate more efficient code than `fetch_or` on some platforms.
+
+- x86/x86_64: `lock or` instead of `cmpxchg` loop ({8,16,32}-bit atomics on x86, but additionally 64-bit atomics on x86_64)
+- MSP430: `or` instead of disabling interrupts ({8,16}-bit atomics)
+
+Note: On x86/x86_64, the use of either function should not usually
+affect the generated code, because LLVM can properly optimize the case
+where the result is unused.
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(0b101101);
+assert_eq!(foo.fetch_or(0b110011, Ordering::SeqCst), 0b101101);
+assert_eq!(foo.load(Ordering::SeqCst), 0b111111);
+```"),
+                #[inline]
+                #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                pub fn or(&self, val: $int_type, order: Ordering) {
+                    self.inner.or(val, order);
+                }
+            }
+
+            doc_comment! {
+                concat!("Bitwise \"xor\" with the current value.
+
+Performs a bitwise \"xor\" operation on the current value and the argument `val`, and
+sets the new value to the result.
+
+Returns the previous value.
+
+`fetch_xor` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(0b101101);
+assert_eq!(foo.fetch_xor(0b110011, Ordering::SeqCst), 0b101101);
+assert_eq!(foo.load(Ordering::SeqCst), 0b011110);
+```"),
+                #[inline]
+                #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                pub fn fetch_xor(&self, val: $int_type, order: Ordering) -> $int_type {
+                    self.inner.fetch_xor(val, order)
+                }
+            }
+
+            doc_comment! {
+                concat!("Bitwise \"xor\" with the current value.
+
+Performs a bitwise \"xor\" operation on the current value and the argument `val`, and
+sets the new value to the result.
+
+Unlike `fetch_xor`, this does not return the previous value.
+
+`xor` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+This function may generate more efficient code than `fetch_xor` on some platforms.
+
+- x86/x86_64: `lock xor` instead of `cmpxchg` loop ({8,16,32}-bit atomics on x86, but additionally 64-bit atomics on x86_64)
+- MSP430: `xor` instead of disabling interrupts ({8,16}-bit atomics)
+
+Note: On x86/x86_64, the use of either function should not usually
+affect the generated code, because LLVM can properly optimize the case
+where the result is unused.
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(0b101101);
+foo.xor(0b110011, Ordering::SeqCst);
+assert_eq!(foo.load(Ordering::SeqCst), 0b011110);
+```"),
+                #[inline]
+                #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                pub fn xor(&self, val: $int_type, order: Ordering) {
+                    self.inner.xor(val, order);
+                }
+            }
+
+            doc_comment! {
+                concat!("Fetches the value, and applies a function to it that returns an optional
+new value. Returns a `Result` of `Ok(previous_value)` if the function returned `Some(_)`, else
+`Err(previous_value)`.
+
+Note: This may call the function multiple times if the value has been changed from other threads in
+the meantime, as long as the function returns `Some(_)`, but the function will have been applied
+only once to the stored value.
+
+`fetch_update` takes two [`Ordering`] arguments to describe the memory ordering of this operation.
+The first describes the required ordering for when the operation finally succeeds while the second
+describes the required ordering for loads. These correspond to the success and failure orderings of
+[`compare_exchange`](Self::compare_exchange) respectively.
+
+Using [`Acquire`] as success ordering makes the store part
+of this operation [`Relaxed`], and using [`Release`] makes the final successful load
+[`Relaxed`]. The (failed) load ordering can only be [`SeqCst`], [`Acquire`] or [`Relaxed`].
+
+# Panics
+
+Panics if `fetch_order` is [`Release`], [`AcqRel`].
+
+# Considerations
+
+This method is not magic; it is not provided by the hardware.
+It is implemented in terms of [`compare_exchange_weak`](Self::compare_exchange_weak),
+and suffers from the same drawbacks.
+In particular, this method will not circumvent the [ABA Problem].
+
+[ABA Problem]: https://en.wikipedia.org/wiki/ABA_problem
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let x = ", stringify!($atomic_type), "::new(7);
+assert_eq!(x.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |_| None), Err(7));
+assert_eq!(x.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |x| Some(x + 1)), Ok(7));
+assert_eq!(x.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |x| Some(x + 1)), Ok(8));
+assert_eq!(x.load(Ordering::SeqCst), 9);
+```"),
+                #[inline]
+                #[cfg_attr(
+                    any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                    track_caller
+                )]
+                pub fn fetch_update<F>(
+                    &self,
+                    set_order: Ordering,
+                    fetch_order: Ordering,
+                    mut f: F,
+                ) -> Result<$int_type, $int_type>
+                where
+                    F: FnMut($int_type) -> Option<$int_type>,
+                {
+                    let mut prev = self.load(fetch_order);
+                    while let Some(next) = f(prev) {
+                        match self.compare_exchange_weak(prev, next, set_order, fetch_order) {
+                            x @ Ok(_) => return x,
+                            Err(next_prev) => prev = next_prev,
+                        }
+                    }
+                    Err(prev)
+                }
+            }
+
+            doc_comment! {
+                concat!("Maximum with the current value.
+
+Finds the maximum of the current value and the argument `val`, and
+sets the new value to the result.
+
+Returns the previous value.
+
+`fetch_max` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(23);
+assert_eq!(foo.fetch_max(42, Ordering::SeqCst), 23);
+assert_eq!(foo.load(Ordering::SeqCst), 42);
+```
+
+If you want to obtain the maximum value in one step, you can use the following:
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(23);
+let bar = 42;
+let max_foo = foo.fetch_max(bar, Ordering::SeqCst).max(bar);
+assert!(max_foo == 42);
+```"),
+                #[inline]
+                #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                pub fn fetch_max(&self, val: $int_type, order: Ordering) -> $int_type {
+                    self.inner.fetch_max(val, order)
+                }
+            }
+
+            doc_comment! {
+                concat!("Minimum with the current value.
+
+Finds the minimum of the current value and the argument `val`, and
+sets the new value to the result.
+
+Returns the previous value.
+
+`fetch_min` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(23);
+assert_eq!(foo.fetch_min(42, Ordering::Relaxed), 23);
+assert_eq!(foo.load(Ordering::Relaxed), 23);
+assert_eq!(foo.fetch_min(22, Ordering::Relaxed), 23);
+assert_eq!(foo.load(Ordering::Relaxed), 22);
+```
+
+If you want to obtain the minimum value in one step, you can use the following:
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(23);
+let bar = 12;
+let min_foo = foo.fetch_min(bar, Ordering::SeqCst).min(bar);
+assert_eq!(min_foo, 12);
+```"),
+                #[inline]
+                #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                pub fn fetch_min(&self, val: $int_type, order: Ordering) -> $int_type {
+                    self.inner.fetch_min(val, order)
+                }
+            }
+
+            doc_comment! {
+                concat!("Sets the bit at the specified bit-position to 1.
+
+Returns `true` if the specified bit was previously set to 1.
+
+`bit_set` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+This corresponds to x86's `lock bts`, and the implementation calls them on x86/x86_64.
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(0b0000);
+assert!(!foo.bit_set(0, Ordering::Relaxed));
+assert_eq!(foo.load(Ordering::Relaxed), 0b0001);
+assert!(foo.bit_set(0, Ordering::Relaxed));
+assert_eq!(foo.load(Ordering::Relaxed), 0b0001);
+```"),
+                #[inline]
+                #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                pub fn bit_set(&self, bit: u32, order: Ordering) -> bool {
+                    self.inner.bit_set(bit, order)
+                }
+            }
+
+            doc_comment! {
+                concat!("Clears the bit at the specified bit-position to 1.
+
+Returns `true` if the specified bit was previously set to 1.
+
+`bit_clear` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+This corresponds to x86's `lock btr`, and the implementation calls them on x86/x86_64.
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(0b0001);
+assert!(foo.bit_clear(0, Ordering::Relaxed));
+assert_eq!(foo.load(Ordering::Relaxed), 0b0000);
+```"),
+                #[inline]
+                #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                pub fn bit_clear(&self, bit: u32, order: Ordering) -> bool {
+                    self.inner.bit_clear(bit, order)
+                }
+            }
+
+            doc_comment! {
+                concat!("Toggles the bit at the specified bit-position.
+
+Returns `true` if the specified bit was previously set to 1.
+
+`bit_toggle` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+This corresponds to x86's `lock btc`, and the implementation calls them on x86/x86_64.
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(0b0000);
+assert!(!foo.bit_toggle(0, Ordering::Relaxed));
+assert_eq!(foo.load(Ordering::Relaxed), 0b0001);
+assert!(foo.bit_toggle(0, Ordering::Relaxed));
+assert_eq!(foo.load(Ordering::Relaxed), 0b0000);
+```"),
+                #[inline]
+                #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                pub fn bit_toggle(&self, bit: u32, order: Ordering) -> bool {
+                    self.inner.bit_toggle(bit, order)
+                }
+            }
+
+            doc_comment! {
+                concat!("Logical negates the current value, and sets the new value to the result.
+
+Returns the previous value.
+
+`fetch_not` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(0);
+assert_eq!(foo.fetch_not(Ordering::Relaxed), 0);
+assert_eq!(foo.load(Ordering::Relaxed), !0);
+```"),
+                #[inline]
+                #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                pub fn fetch_not(&self, order: Ordering) -> $int_type {
+                    self.inner.fetch_not(order)
+                }
+
+                doc_comment! {
+                    concat!("Logical negates the current value, and sets the new value to the result.
+
+Unlike `fetch_not`, this does not return the previous value.
+
+`not` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+This function may generate more efficient code than `fetch_not` on some platforms.
+
+- x86/x86_64: `lock not` instead of `cmpxchg` loop ({8,16,32}-bit atomics on x86, but additionally 64-bit atomics on x86_64)
+- MSP430: `inv` instead of disabling interrupts ({8,16}-bit atomics)
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(0);
+foo.not(Ordering::Relaxed);
+assert_eq!(foo.load(Ordering::Relaxed), !0);
+```"),
+                    #[inline]
+                    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                    pub fn not(&self, order: Ordering) {
+                        self.inner.not(order);
+                    }
+                }
+            }
+
+            doc_comment! {
+                concat!("Negates the current value, and sets the new value to the result.
+
+Returns the previous value.
+
+`fetch_neg` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(5);
+assert_eq!(foo.fetch_neg(Ordering::Relaxed), 5);
+assert_eq!(foo.load(Ordering::Relaxed), 5_", stringify!($int_type), ".wrapping_neg());
+assert_eq!(foo.fetch_neg(Ordering::Relaxed), 5_", stringify!($int_type), ".wrapping_neg());
+assert_eq!(foo.load(Ordering::Relaxed), 5);
+```"),
+                #[inline]
+                #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                pub fn fetch_neg(&self, order: Ordering) -> $int_type {
+                    self.inner.fetch_neg(order)
+                }
+
+                doc_comment! {
+                    concat!("Negates the current value, and sets the new value to the result.
+
+Unlike `fetch_neg`, this does not return the previous value.
+
+`neg` takes an [`Ordering`] argument which describes the memory ordering
+of this operation. All ordering modes are possible. Note that using
+[`Acquire`] makes the store part of this operation [`Relaxed`], and
+using [`Release`] makes the load part [`Relaxed`].
+
+This function may generate more efficient code than `fetch_neg` on some platforms.
+
+- x86/x86_64: `lock neg` instead of `cmpxchg` loop ({8,16,32}-bit atomics on x86, but additionally 64-bit atomics on x86_64)
+
+# Examples
+
+```
+use portable_atomic::{", stringify!($atomic_type), ", Ordering};
+
+let foo = ", stringify!($atomic_type), "::new(5);
+foo.neg(Ordering::Relaxed);
+assert_eq!(foo.load(Ordering::Relaxed), 5_", stringify!($int_type), ".wrapping_neg());
+foo.neg(Ordering::Relaxed);
+assert_eq!(foo.load(Ordering::Relaxed), 5);
+```"),
+                    #[inline]
+                    #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+                    pub fn neg(&self, order: Ordering) {
+                        self.inner.neg(order);
+                    }
+                }
+            }
+            } // cfg_has_atomic_cas!
+
+            const_fn! {
+                const_if: #[cfg(not(portable_atomic_no_const_raw_ptr_deref))];
+                /// Returns a mutable pointer to the underlying integer.
+                ///
+                /// Returning an `*mut` pointer from a shared reference to this atomic is
+                /// safe because the atomic types work with interior mutability. Any use of
+                /// the returned raw pointer requires an `unsafe` block and has to uphold
+                /// the safety requirements. If there is concurrent access, note the following
+                /// additional safety requirements:
+                ///
+                /// - If this atomic type is [lock-free](Self::is_lock_free), any concurrent
+                ///   operations on it must be atomic.
+                /// - Otherwise, any concurrent operations on it must be compatible with
+                ///   operations performed by this atomic type.
+                ///
+                /// This is `const fn` on Rust 1.58+.
+                #[inline]
+                pub const fn as_ptr(&self) -> *mut $int_type {
+                    self.inner.as_ptr()
+                }
+            }
+        }
+    };
+
+    // AtomicF* impls
+    (float,
+        $atomic_type:ident,
+        $float_type:ident,
+        $atomic_int_type:ident,
+        $int_type:ident,
+        $align:literal
+    ) => {
+        doc_comment! {
+            concat!("A floating point type which can be safely shared between threads.
+
+This type has the same in-memory representation as the underlying floating point type,
+[`", stringify!($float_type), "`].
+"
+            ),
+            #[cfg_attr(docsrs, doc(cfg(feature = "float")))]
+            // We can use #[repr(transparent)] here, but #[repr(C, align(N))]
+            // will show clearer docs.
+            #[repr(C, align($align))]
+            pub struct $atomic_type {
+                inner: imp::float::$atomic_type,
+            }
+        }
+
+        impl Default for $atomic_type {
+            #[inline]
+            fn default() -> Self {
+                Self::new($float_type::default())
+            }
+        }
+
+        impl From<$float_type> for $atomic_type {
+            #[inline]
+            fn from(v: $float_type) -> Self {
+                Self::new(v)
+            }
+        }
+
+        // UnwindSafe is implicitly implemented.
+        #[cfg(not(portable_atomic_no_core_unwind_safe))]
+        impl core::panic::RefUnwindSafe for $atomic_type {}
+        #[cfg(all(portable_atomic_no_core_unwind_safe, feature = "std"))]
+        impl std::panic::RefUnwindSafe for $atomic_type {}
+
+        impl_debug_and_serde!($atomic_type);
+
+        impl $atomic_type {
+            /// Creates a new atomic float.
+            #[inline]
+            #[must_use]
+            pub const fn new(v: $float_type) -> Self {
+                static_assert_layout!($atomic_type, $float_type);
+                Self { inner: imp::float::$atomic_type::new(v) }
+            }
+
+            // TODO: update docs based on https://github.com/rust-lang/rust/pull/116762
+            doc_comment! {
+                concat!("Creates a new reference to an atomic float from a pointer.
+
+# Safety
+
+* `ptr` must be aligned to `align_of::<", stringify!($atomic_type), ">()` (note that on some platforms this
+  can be bigger than `align_of::<", stringify!($float_type), ">()`).
+* `ptr` must be [valid] for both reads and writes for the whole lifetime `'a`.
+* If this atomic type is [lock-free](Self::is_lock_free), non-atomic accesses to the value
+  behind `ptr` must have a happens-before relationship with atomic accesses via
+  the returned value (or vice-versa).
+  * In other words, time periods where the value is accessed atomically may not
+    overlap with periods where the value is accessed non-atomically.
+  * This requirement is trivially satisfied if `ptr` is never used non-atomically
+    for the duration of lifetime `'a`. Most use cases should be able to follow
+    this guideline.
+  * This requirement is also trivially satisfied if all accesses (atomic or not) are
+    done from the same thread.
+* If this atomic type is *not* lock-free:
+  * Any accesses to the value behind `ptr` must have a happens-before relationship
+    with accesses via the returned value (or vice-versa).
+  * Any concurrent accesses to the value behind `ptr` for the duration of lifetime `'a` must
+    be compatible with operations performed by this atomic type.
+* This method must not be used to create overlapping or mixed-size atomic
+  accesses, as these are not supported by the memory model.
+
+[valid]: core::ptr#safety"),
+                #[inline]
+                #[must_use]
+                pub unsafe fn from_ptr<'a>(ptr: *mut $float_type) -> &'a Self {
+                    #[allow(clippy::cast_ptr_alignment)]
+                    // SAFETY: guaranteed by the caller
+                    unsafe { &*(ptr as *mut Self) }
+                }
+            }
+
+            /// Returns `true` if operations on values of this type are lock-free.
+            ///
+            /// If the compiler or the platform doesn't support the necessary
+            /// atomic instructions, global locks for every potentially
+            /// concurrent atomic operation will be used.
+            #[inline]
+            #[must_use]
+            pub fn is_lock_free() -> bool {
+                <imp::float::$atomic_type>::is_lock_free()
+            }
+
+            /// Returns `true` if operations on values of this type are lock-free.
+            ///
+            /// If the compiler or the platform doesn't support the necessary
+            /// atomic instructions, global locks for every potentially
+            /// concurrent atomic operation will be used.
+            ///
+            /// **Note:** If the atomic operation relies on dynamic CPU feature detection,
+            /// this type may be lock-free even if the function returns false.
+            #[inline]
+            #[must_use]
+            pub const fn is_always_lock_free() -> bool {
+                <imp::float::$atomic_type>::is_always_lock_free()
+            }
+
+            /// Returns a mutable reference to the underlying float.
+            ///
+            /// This is safe because the mutable reference guarantees that no other threads are
+            /// concurrently accessing the atomic data.
+            #[inline]
+            pub fn get_mut(&mut self) -> &mut $float_type {
+                self.inner.get_mut()
+            }
+
+            // TODO: Add from_mut/get_mut_slice/from_mut_slice once it is stable on std atomic types.
+            // https://github.com/rust-lang/rust/issues/76314
+
+            const_fn! {
+                const_if: #[cfg(not(portable_atomic_no_const_transmute))];
+                /// Consumes the atomic and returns the contained value.
+                ///
+                /// This is safe because passing `self` by value guarantees that no other threads are
+                /// concurrently accessing the atomic data.
+                ///
+                /// This is `const fn` on Rust 1.56+.
+                #[inline]
+                pub const fn into_inner(self) -> $float_type {
+                    // SAFETY: $atomic_type and $float_type have the same size and in-memory representations,
+                    // so they can be safely transmuted.
+                    // (const UnsafeCell::into_inner is unstable)
+                    unsafe { core::mem::transmute(self) }
+                }
+            }
+
+            /// Loads a value from the atomic float.
+            ///
+            /// `load` takes an [`Ordering`] argument which describes the memory ordering of this operation.
+            /// Possible values are [`SeqCst`], [`Acquire`] and [`Relaxed`].
+            ///
+            /// # Panics
+            ///
+            /// Panics if `order` is [`Release`] or [`AcqRel`].
+            #[inline]
+            #[cfg_attr(
+                any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                track_caller
+            )]
+            pub fn load(&self, order: Ordering) -> $float_type {
+                self.inner.load(order)
+            }
+
+            /// Stores a value into the atomic float.
+            ///
+            /// `store` takes an [`Ordering`] argument which describes the memory ordering of this operation.
+            ///  Possible values are [`SeqCst`], [`Release`] and [`Relaxed`].
+            ///
+            /// # Panics
+            ///
+            /// Panics if `order` is [`Acquire`] or [`AcqRel`].
+            #[inline]
+            #[cfg_attr(
+                any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                track_caller
+            )]
+            pub fn store(&self, val: $float_type, order: Ordering) {
+                self.inner.store(val, order)
+            }
+
+            cfg_has_atomic_cas! {
+            /// Stores a value into the atomic float, returning the previous value.
+            ///
+            /// `swap` takes an [`Ordering`] argument which describes the memory ordering
+            /// of this operation. All ordering modes are possible. Note that using
+            /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+            /// using [`Release`] makes the load part [`Relaxed`].
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub fn swap(&self, val: $float_type, order: Ordering) -> $float_type {
+                self.inner.swap(val, order)
+            }
+
+            /// Stores a value into the atomic float if the current value is the same as
+            /// the `current` value.
+            ///
+            /// The return value is a result indicating whether the new value was written and
+            /// containing the previous value. On success this value is guaranteed to be equal to
+            /// `current`.
+            ///
+            /// `compare_exchange` takes two [`Ordering`] arguments to describe the memory
+            /// ordering of this operation. `success` describes the required ordering for the
+            /// read-modify-write operation that takes place if the comparison with `current` succeeds.
+            /// `failure` describes the required ordering for the load operation that takes place when
+            /// the comparison fails. Using [`Acquire`] as success ordering makes the store part
+            /// of this operation [`Relaxed`], and using [`Release`] makes the successful load
+            /// [`Relaxed`]. The failure ordering can only be [`SeqCst`], [`Acquire`] or [`Relaxed`].
+            ///
+            /// # Panics
+            ///
+            /// Panics if `failure` is [`Release`], [`AcqRel`].
+            #[inline]
+            #[cfg_attr(docsrs, doc(alias = "compare_and_swap"))]
+            #[cfg_attr(
+                any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                track_caller
+            )]
+            pub fn compare_exchange(
+                &self,
+                current: $float_type,
+                new: $float_type,
+                success: Ordering,
+                failure: Ordering,
+            ) -> Result<$float_type, $float_type> {
+                self.inner.compare_exchange(current, new, success, failure)
+            }
+
+            /// Stores a value into the atomic float if the current value is the same as
+            /// the `current` value.
+            /// Unlike [`compare_exchange`](Self::compare_exchange)
+            /// this function is allowed to spuriously fail even
+            /// when the comparison succeeds, which can result in more efficient code on some
+            /// platforms. The return value is a result indicating whether the new value was
+            /// written and containing the previous value.
+            ///
+            /// `compare_exchange_weak` takes two [`Ordering`] arguments to describe the memory
+            /// ordering of this operation. `success` describes the required ordering for the
+            /// read-modify-write operation that takes place if the comparison with `current` succeeds.
+            /// `failure` describes the required ordering for the load operation that takes place when
+            /// the comparison fails. Using [`Acquire`] as success ordering makes the store part
+            /// of this operation [`Relaxed`], and using [`Release`] makes the successful load
+            /// [`Relaxed`]. The failure ordering can only be [`SeqCst`], [`Acquire`] or [`Relaxed`].
+            ///
+            /// # Panics
+            ///
+            /// Panics if `failure` is [`Release`], [`AcqRel`].
+            #[inline]
+            #[cfg_attr(docsrs, doc(alias = "compare_and_swap"))]
+            #[cfg_attr(
+                any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                track_caller
+            )]
+            pub fn compare_exchange_weak(
+                &self,
+                current: $float_type,
+                new: $float_type,
+                success: Ordering,
+                failure: Ordering,
+            ) -> Result<$float_type, $float_type> {
+                self.inner.compare_exchange_weak(current, new, success, failure)
+            }
+
+            /// Adds to the current value, returning the previous value.
+            ///
+            /// This operation wraps around on overflow.
+            ///
+            /// `fetch_add` takes an [`Ordering`] argument which describes the memory ordering
+            /// of this operation. All ordering modes are possible. Note that using
+            /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+            /// using [`Release`] makes the load part [`Relaxed`].
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub fn fetch_add(&self, val: $float_type, order: Ordering) -> $float_type {
+                self.inner.fetch_add(val, order)
+            }
+
+            /// Subtracts from the current value, returning the previous value.
+            ///
+            /// This operation wraps around on overflow.
+            ///
+            /// `fetch_sub` takes an [`Ordering`] argument which describes the memory ordering
+            /// of this operation. All ordering modes are possible. Note that using
+            /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+            /// using [`Release`] makes the load part [`Relaxed`].
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub fn fetch_sub(&self, val: $float_type, order: Ordering) -> $float_type {
+                self.inner.fetch_sub(val, order)
+            }
+
+            /// Fetches the value, and applies a function to it that returns an optional
+            /// new value. Returns a `Result` of `Ok(previous_value)` if the function returned `Some(_)`, else
+            /// `Err(previous_value)`.
+            ///
+            /// Note: This may call the function multiple times if the value has been changed from other threads in
+            /// the meantime, as long as the function returns `Some(_)`, but the function will have been applied
+            /// only once to the stored value.
+            ///
+            /// `fetch_update` takes two [`Ordering`] arguments to describe the memory ordering of this operation.
+            /// The first describes the required ordering for when the operation finally succeeds while the second
+            /// describes the required ordering for loads. These correspond to the success and failure orderings of
+            /// [`compare_exchange`](Self::compare_exchange) respectively.
+            ///
+            /// Using [`Acquire`] as success ordering makes the store part
+            /// of this operation [`Relaxed`], and using [`Release`] makes the final successful load
+            /// [`Relaxed`]. The (failed) load ordering can only be [`SeqCst`], [`Acquire`] or [`Relaxed`].
+            ///
+            /// # Panics
+            ///
+            /// Panics if `fetch_order` is [`Release`], [`AcqRel`].
+            ///
+            /// # Considerations
+            ///
+            /// This method is not magic; it is not provided by the hardware.
+            /// It is implemented in terms of [`compare_exchange_weak`](Self::compare_exchange_weak),
+            /// and suffers from the same drawbacks.
+            /// In particular, this method will not circumvent the [ABA Problem].
+            ///
+            /// [ABA Problem]: https://en.wikipedia.org/wiki/ABA_problem
+            #[inline]
+            #[cfg_attr(
+                any(all(debug_assertions, not(portable_atomic_no_track_caller)), miri),
+                track_caller
+            )]
+            pub fn fetch_update<F>(
+                &self,
+                set_order: Ordering,
+                fetch_order: Ordering,
+                mut f: F,
+            ) -> Result<$float_type, $float_type>
+            where
+                F: FnMut($float_type) -> Option<$float_type>,
+            {
+                let mut prev = self.load(fetch_order);
+                while let Some(next) = f(prev) {
+                    match self.compare_exchange_weak(prev, next, set_order, fetch_order) {
+                        x @ Ok(_) => return x,
+                        Err(next_prev) => prev = next_prev,
+                    }
+                }
+                Err(prev)
+            }
+
+            /// Maximum with the current value.
+            ///
+            /// Finds the maximum of the current value and the argument `val`, and
+            /// sets the new value to the result.
+            ///
+            /// Returns the previous value.
+            ///
+            /// `fetch_max` takes an [`Ordering`] argument which describes the memory ordering
+            /// of this operation. All ordering modes are possible. Note that using
+            /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+            /// using [`Release`] makes the load part [`Relaxed`].
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub fn fetch_max(&self, val: $float_type, order: Ordering) -> $float_type {
+                self.inner.fetch_max(val, order)
+            }
+
+            /// Minimum with the current value.
+            ///
+            /// Finds the minimum of the current value and the argument `val`, and
+            /// sets the new value to the result.
+            ///
+            /// Returns the previous value.
+            ///
+            /// `fetch_min` takes an [`Ordering`] argument which describes the memory ordering
+            /// of this operation. All ordering modes are possible. Note that using
+            /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+            /// using [`Release`] makes the load part [`Relaxed`].
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub fn fetch_min(&self, val: $float_type, order: Ordering) -> $float_type {
+                self.inner.fetch_min(val, order)
+            }
+
+            /// Negates the current value, and sets the new value to the result.
+            ///
+            /// Returns the previous value.
+            ///
+            /// `fetch_neg` takes an [`Ordering`] argument which describes the memory ordering
+            /// of this operation. All ordering modes are possible. Note that using
+            /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+            /// using [`Release`] makes the load part [`Relaxed`].
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub fn fetch_neg(&self, order: Ordering) -> $float_type {
+                self.inner.fetch_neg(order)
+            }
+
+            /// Computes the absolute value of the current value, and sets the
+            /// new value to the result.
+            ///
+            /// Returns the previous value.
+            ///
+            /// `fetch_abs` takes an [`Ordering`] argument which describes the memory ordering
+            /// of this operation. All ordering modes are possible. Note that using
+            /// [`Acquire`] makes the store part of this operation [`Relaxed`], and
+            /// using [`Release`] makes the load part [`Relaxed`].
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub fn fetch_abs(&self, order: Ordering) -> $float_type {
+                self.inner.fetch_abs(order)
+            }
+            } // cfg_has_atomic_cas!
+
+            #[cfg(not(portable_atomic_no_const_raw_ptr_deref))]
+            doc_comment! {
+                concat!("Raw transmutation to `&", stringify!($atomic_int_type), "`.
+
+See [`", stringify!($float_type) ,"::from_bits`] for some discussion of the
+portability of this operation (there are almost no issues).
+
+This is `const fn` on Rust 1.58+."),
+                #[inline]
+                pub const fn as_bits(&self) -> &$atomic_int_type {
+                    self.inner.as_bits()
+                }
+            }
+            #[cfg(portable_atomic_no_const_raw_ptr_deref)]
+            doc_comment! {
+                concat!("Raw transmutation to `&", stringify!($atomic_int_type), "`.
+
+See [`", stringify!($float_type) ,"::from_bits`] for some discussion of the
+portability of this operation (there are almost no issues).
+
+This is `const fn` on Rust 1.58+."),
+                #[inline]
+                pub fn as_bits(&self) -> &$atomic_int_type {
+                    self.inner.as_bits()
+                }
+            }
+
+            const_fn! {
+                const_if: #[cfg(not(portable_atomic_no_const_raw_ptr_deref))];
+                /// Returns a mutable pointer to the underlying float.
+                ///
+                /// Returning an `*mut` pointer from a shared reference to this atomic is
+                /// safe because the atomic types work with interior mutability. Any use of
+                /// the returned raw pointer requires an `unsafe` block and has to uphold
+                /// the safety requirements. If there is concurrent access, note the following
+                /// additional safety requirements:
+                ///
+                /// - If this atomic type is [lock-free](Self::is_lock_free), any concurrent
+                ///   operations on it must be atomic.
+                /// - Otherwise, any concurrent operations on it must be compatible with
+                ///   operations performed by this atomic type.
+                ///
+                /// This is `const fn` on Rust 1.58+.
+                #[inline]
+                pub const fn as_ptr(&self) -> *mut $float_type {
+                    self.inner.as_ptr()
+                }
+            }
+        }
+    };
+}
+
+cfg_has_atomic_ptr! {
+    #[cfg(target_pointer_width = "16")]
+    atomic_int!(AtomicIsize, isize, 2);
+    #[cfg(target_pointer_width = "16")]
+    atomic_int!(AtomicUsize, usize, 2);
+    #[cfg(target_pointer_width = "32")]
+    atomic_int!(AtomicIsize, isize, 4);
+    #[cfg(target_pointer_width = "32")]
+    atomic_int!(AtomicUsize, usize, 4);
+    #[cfg(target_pointer_width = "64")]
+    atomic_int!(AtomicIsize, isize, 8);
+    #[cfg(target_pointer_width = "64")]
+    atomic_int!(AtomicUsize, usize, 8);
+    #[cfg(target_pointer_width = "128")]
+    atomic_int!(AtomicIsize, isize, 16);
+    #[cfg(target_pointer_width = "128")]
+    atomic_int!(AtomicUsize, usize, 16);
+}
+
+cfg_has_atomic_8! {
+    atomic_int!(AtomicI8, i8, 1);
+    atomic_int!(AtomicU8, u8, 1);
+}
+cfg_has_atomic_16! {
+    atomic_int!(AtomicI16, i16, 2);
+    atomic_int!(AtomicU16, u16, 2);
+}
+cfg_has_atomic_32! {
+    atomic_int!(AtomicI32, i32, 4);
+    atomic_int!(AtomicU32, u32, 4);
+}
+cfg_has_atomic_64! {
+    atomic_int!(AtomicI64, i64, 8);
+    atomic_int!(AtomicU64, u64, 8);
+}
+cfg_has_atomic_128! {
+    atomic_int!(AtomicI128, i128, 16);
+    atomic_int!(AtomicU128, u128, 16);
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/tests/helper.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/tests/helper.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/tests/helper.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/tests/helper.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,2449 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+#![allow(unused_macros)]
+
+use core::sync::atomic::Ordering;
+
+macro_rules! __test_atomic_common {
+    ($atomic_type:ty, $value_type:ty) => {
+        #[test]
+        fn assert_auto_traits() {
+            fn _assert<T: Send + Sync + Unpin + std::panic::UnwindSafe>() {}
+            _assert::<$atomic_type>();
+        }
+        #[test]
+        fn alignment() {
+            // https://github.com/rust-lang/rust/blob/1.70.0/library/core/tests/atomic.rs#L250
+            assert_eq!(core::mem::align_of::<$atomic_type>(), core::mem::size_of::<$atomic_type>());
+            assert_eq!(core::mem::size_of::<$atomic_type>(), core::mem::size_of::<$value_type>());
+        }
+        #[test]
+        fn is_lock_free() {
+            const IS_ALWAYS_LOCK_FREE: bool = <$atomic_type>::is_always_lock_free();
+            assert_eq!(IS_ALWAYS_LOCK_FREE, <$atomic_type>::is_always_lock_free());
+            let is_lock_free = <$atomic_type>::is_lock_free();
+            if IS_ALWAYS_LOCK_FREE {
+                // If is_always_lock_free is true, then is_lock_free must always be true.
+                assert!(is_lock_free);
+            }
+        }
+    };
+}
+macro_rules! __test_atomic_pub_common {
+    ($atomic_type:ty, $value_type:ty) => {
+        #[test]
+        fn assert_ref_unwind_safe() {
+            #[cfg(not(all(portable_atomic_no_core_unwind_safe, not(feature = "std"))))]
+            static_assertions::assert_impl_all!($atomic_type: std::panic::RefUnwindSafe);
+            #[cfg(all(portable_atomic_no_core_unwind_safe, not(feature = "std")))]
+            static_assertions::assert_not_impl_all!($atomic_type: std::panic::RefUnwindSafe);
+        }
+    };
+}
+
+macro_rules! __test_atomic_int_load_store {
+    ($atomic_type:ty, $int_type:ident, single_thread) => {
+        __test_atomic_common!($atomic_type, $int_type);
+        use crate::tests::helper::*;
+        #[test]
+        fn accessor() {
+            let mut a = <$atomic_type>::new(10);
+            assert_eq!(*a.get_mut(), 10);
+            *a.get_mut() = 5;
+            assert_eq!(a.as_ptr() as *const (), &a as *const _ as *const ());
+            assert_eq!(*a.get_mut(), 5);
+        }
+        // https://bugs.llvm.org/show_bug.cgi?id=37061
+        #[test]
+        fn static_load_only() {
+            static VAR: $atomic_type = <$atomic_type>::new(10);
+            for &order in &test_helper::LOAD_ORDERINGS {
+                assert_eq!(VAR.load(order), 10);
+            }
+        }
+        #[test]
+        fn load_store() {
+            static VAR: $atomic_type = <$atomic_type>::new(10);
+            test_load_ordering(|order| VAR.load(order));
+            test_store_ordering(|order| VAR.store(10, order));
+            for (&load_order, &store_order) in
+                test_helper::LOAD_ORDERINGS.iter().zip(&test_helper::STORE_ORDERINGS)
+            {
+                assert_eq!(VAR.load(load_order), 10);
+                VAR.store(5, store_order);
+                assert_eq!(VAR.load(load_order), 5);
+                VAR.store(10, store_order);
+                let a = <$atomic_type>::new(1);
+                assert_eq!(a.load(load_order), 1);
+                a.store(2, store_order);
+                assert_eq!(a.load(load_order), 2);
+            }
+        }
+    };
+    ($atomic_type:ty, $int_type:ident) => {
+        __test_atomic_int_load_store!($atomic_type, $int_type, single_thread);
+        use crossbeam_utils::thread;
+        use std::{collections::BTreeSet, vec, vec::Vec};
+        #[test]
+        fn stress_load_store() {
+            let (iterations, threads) = stress_test_config();
+            let data1 = (0..iterations).map(|_| fastrand::$int_type(..)).collect::<Vec<_>>();
+            let set = data1.iter().copied().collect::<BTreeSet<_>>();
+            let a = <$atomic_type>::new(data1[fastrand::usize(0..iterations)]);
+            let now = &std::time::Instant::now();
+            thread::scope(|s| {
+                for _ in 0..threads {
+                    s.spawn(|_| {
+                        let now = *now;
+                        for i in 0..iterations {
+                            a.store(data1[i], rand_store_ordering());
+                        }
+                        std::eprintln!("store end={:?}", now.elapsed());
+                    });
+                    s.spawn(|_| {
+                        let now = *now;
+                        let mut v = vec![0; iterations];
+                        for i in 0..iterations {
+                            v[i] = a.load(rand_load_ordering());
+                        }
+                        std::eprintln!("load end={:?}", now.elapsed());
+                        for v in v {
+                            assert!(set.contains(&v), "v={}", v);
+                        }
+                    });
+                }
+            })
+            .unwrap();
+        }
+    };
+}
+macro_rules! __test_atomic_float_load_store {
+    ($atomic_type:ty, $float_type:ident, single_thread) => {
+        __test_atomic_common!($atomic_type, $float_type);
+        use crate::tests::helper::*;
+        #[test]
+        fn accessor() {
+            let mut a = <$atomic_type>::new(10.);
+            assert_eq!(*a.get_mut(), 10.);
+            *a.get_mut() = 5.;
+            assert_eq!(a.as_ptr() as *const (), &a as *const _ as *const ());
+            assert_eq!(*a.get_mut(), 5.);
+        }
+        // https://bugs.llvm.org/show_bug.cgi?id=37061
+        #[test]
+        fn static_load_only() {
+            static VAR: $atomic_type = <$atomic_type>::new(10.);
+            for &order in &test_helper::LOAD_ORDERINGS {
+                assert_eq!(VAR.load(order), 10.);
+            }
+        }
+        #[test]
+        fn load_store() {
+            static VAR: $atomic_type = <$atomic_type>::new(10.);
+            test_load_ordering(|order| VAR.load(order));
+            test_store_ordering(|order| VAR.store(10., order));
+            for (&load_order, &store_order) in
+                test_helper::LOAD_ORDERINGS.iter().zip(&test_helper::STORE_ORDERINGS)
+            {
+                assert_eq!(VAR.load(load_order), 10.);
+                VAR.store(5., store_order);
+                assert_eq!(VAR.load(load_order), 5.);
+                VAR.store(10., store_order);
+                let a = <$atomic_type>::new(1.);
+                assert_eq!(a.load(load_order), 1.);
+                a.store(2., store_order);
+                assert_eq!(a.load(load_order), 2.);
+            }
+        }
+    };
+    ($atomic_type:ty, $float_type:ident) => {
+        __test_atomic_float_load_store!($atomic_type, $float_type, single_thread);
+        // TODO: multi thread
+    };
+}
+macro_rules! __test_atomic_bool_load_store {
+    ($atomic_type:ty, single_thread) => {
+        __test_atomic_common!($atomic_type, bool);
+        use crate::tests::helper::*;
+        #[test]
+        fn accessor() {
+            let mut a = <$atomic_type>::new(false);
+            assert_eq!(*a.get_mut(), false);
+            *a.get_mut() = true;
+            assert_eq!(a.as_ptr() as *const (), &a as *const _ as *const ());
+            assert_eq!(*a.get_mut(), true);
+        }
+        // https://bugs.llvm.org/show_bug.cgi?id=37061
+        #[test]
+        fn static_load_only() {
+            static VAR: $atomic_type = <$atomic_type>::new(false);
+            for &order in &test_helper::LOAD_ORDERINGS {
+                assert_eq!(VAR.load(order), false);
+            }
+        }
+        #[test]
+        fn load_store() {
+            static VAR: $atomic_type = <$atomic_type>::new(false);
+            test_load_ordering(|order| VAR.load(order));
+            test_store_ordering(|order| VAR.store(false, order));
+            for (&load_order, &store_order) in
+                test_helper::LOAD_ORDERINGS.iter().zip(&test_helper::STORE_ORDERINGS)
+            {
+                assert_eq!(VAR.load(load_order), false);
+                VAR.store(true, store_order);
+                assert_eq!(VAR.load(load_order), true);
+                VAR.store(false, store_order);
+                let a = <$atomic_type>::new(true);
+                assert_eq!(a.load(load_order), true);
+                a.store(false, store_order);
+                assert_eq!(a.load(load_order), false);
+            }
+        }
+    };
+    ($atomic_type:ty) => {
+        __test_atomic_bool_load_store!($atomic_type, single_thread);
+        // TODO: multi thread
+    };
+}
+macro_rules! __test_atomic_ptr_load_store {
+    ($atomic_type:ty, single_thread) => {
+        __test_atomic_common!($atomic_type, *mut u8);
+        use crate::tests::helper::*;
+        use std::ptr;
+        #[test]
+        fn accessor() {
+            let mut v = 1;
+            let mut a = <$atomic_type>::new(ptr::null_mut());
+            assert!(a.get_mut().is_null());
+            *a.get_mut() = &mut v;
+            assert_eq!(a.as_ptr() as *const (), &a as *const _ as *const ());
+            assert!(!a.get_mut().is_null());
+        }
+        // https://bugs.llvm.org/show_bug.cgi?id=37061
+        #[test]
+        fn static_load_only() {
+            static VAR: $atomic_type = <$atomic_type>::new(ptr::null_mut());
+            for &order in &test_helper::LOAD_ORDERINGS {
+                assert_eq!(VAR.load(order), ptr::null_mut());
+            }
+        }
+        #[test]
+        fn load_store() {
+            static VAR: $atomic_type = <$atomic_type>::new(ptr::null_mut());
+            test_load_ordering(|order| VAR.load(order));
+            test_store_ordering(|order| VAR.store(ptr::null_mut(), order));
+            let mut v = 1_u8;
+            let p = &mut v as *mut u8;
+            for (&load_order, &store_order) in
+                test_helper::LOAD_ORDERINGS.iter().zip(&test_helper::STORE_ORDERINGS)
+            {
+                assert_eq!(VAR.load(load_order), ptr::null_mut());
+                VAR.store(p, store_order);
+                assert_eq!(VAR.load(load_order), p);
+                VAR.store(ptr::null_mut(), store_order);
+                let a = <$atomic_type>::new(p);
+                assert_eq!(a.load(load_order), p);
+                a.store(ptr::null_mut(), store_order);
+                assert_eq!(a.load(load_order), ptr::null_mut());
+            }
+        }
+    };
+    ($atomic_type:ty) => {
+        __test_atomic_ptr_load_store!($atomic_type, single_thread);
+        // TODO: multi thread
+    };
+}
+
+macro_rules! __test_atomic_int {
+    ($atomic_type:ty, $int_type:ident, single_thread) => {
+        #[test]
+        fn swap() {
+            let a = <$atomic_type>::new(5);
+            test_swap_ordering(|order| a.swap(5, order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                assert_eq!(a.swap(10, order), 5);
+                assert_eq!(a.swap(5, order), 10);
+            }
+        }
+        #[test]
+        fn compare_exchange() {
+            let a = <$atomic_type>::new(5);
+            test_compare_exchange_ordering(|success, failure| {
+                a.compare_exchange(5, 5, success, failure)
+            });
+            for &(success, failure) in &test_helper::COMPARE_EXCHANGE_ORDERINGS {
+                let a = <$atomic_type>::new(5);
+                assert_eq!(a.compare_exchange(5, 10, success, failure), Ok(5));
+                assert_eq!(a.load(Ordering::Relaxed), 10);
+                assert_eq!(a.compare_exchange(6, 12, success, failure), Err(10));
+                assert_eq!(a.load(Ordering::Relaxed), 10);
+            }
+        }
+        #[test]
+        fn compare_exchange_weak() {
+            let a = <$atomic_type>::new(4);
+            test_compare_exchange_ordering(|success, failure| {
+                a.compare_exchange_weak(4, 4, success, failure)
+            });
+            for &(success, failure) in &test_helper::COMPARE_EXCHANGE_ORDERINGS {
+                let a = <$atomic_type>::new(4);
+                assert_eq!(a.compare_exchange_weak(6, 8, success, failure), Err(4));
+                let mut old = a.load(Ordering::Relaxed);
+                loop {
+                    let new = old * 2;
+                    match a.compare_exchange_weak(old, new, success, failure) {
+                        Ok(_) => break,
+                        Err(x) => old = x,
+                    }
+                }
+                assert_eq!(a.load(Ordering::Relaxed), 8);
+            }
+        }
+        #[test]
+        fn fetch_add() {
+            let a = <$atomic_type>::new(0);
+            test_swap_ordering(|order| a.fetch_add(0, order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(0);
+                assert_eq!(a.fetch_add(10, order), 0);
+                assert_eq!(a.load(Ordering::Relaxed), 10);
+                let a = <$atomic_type>::new($int_type::MAX);
+                assert_eq!(a.fetch_add(1, order), $int_type::MAX);
+                assert_eq!(a.load(Ordering::Relaxed), $int_type::MAX.wrapping_add(1));
+            }
+        }
+        #[test]
+        fn add() {
+            let a = <$atomic_type>::new(0);
+            test_swap_ordering(|order| a.add(0, order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(0);
+                a.add(10, order);
+                assert_eq!(a.load(Ordering::Relaxed), 10);
+                let a = <$atomic_type>::new($int_type::MAX);
+                a.add(1, order);
+                assert_eq!(a.load(Ordering::Relaxed), $int_type::MAX.wrapping_add(1));
+            }
+        }
+        #[test]
+        fn fetch_sub() {
+            let a = <$atomic_type>::new(20);
+            test_swap_ordering(|order| a.fetch_sub(0, order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(20);
+                assert_eq!(a.fetch_sub(10, order), 20);
+                assert_eq!(a.load(Ordering::Relaxed), 10);
+                let a = <$atomic_type>::new($int_type::MIN);
+                assert_eq!(a.fetch_sub(1, order), $int_type::MIN);
+                assert_eq!(a.load(Ordering::Relaxed), $int_type::MIN.wrapping_sub(1));
+            }
+        }
+        #[test]
+        fn sub() {
+            let a = <$atomic_type>::new(20);
+            test_swap_ordering(|order| a.sub(0, order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(20);
+                a.sub(10, order);
+                assert_eq!(a.load(Ordering::Relaxed), 10);
+                let a = <$atomic_type>::new($int_type::MIN);
+                a.sub(1, order);
+                assert_eq!(a.load(Ordering::Relaxed), $int_type::MIN.wrapping_sub(1));
+            }
+        }
+        #[test]
+        fn fetch_and() {
+            let a = <$atomic_type>::new(0b101101);
+            test_swap_ordering(|order| a.fetch_and(0b101101, order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(0b101101);
+                assert_eq!(a.fetch_and(0b110011, order), 0b101101);
+                assert_eq!(a.load(Ordering::Relaxed), 0b100001);
+            }
+        }
+        #[test]
+        fn and() {
+            let a = <$atomic_type>::new(0b101101);
+            test_swap_ordering(|order| a.and(0b101101, order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(0b101101);
+                a.and(0b110011, order);
+                assert_eq!(a.load(Ordering::Relaxed), 0b100001);
+            }
+        }
+        #[test]
+        fn fetch_nand() {
+            let a = <$atomic_type>::new(0x13);
+            test_swap_ordering(|order| a.fetch_nand(0x31, order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(0x13);
+                assert_eq!(a.fetch_nand(0x31, order), 0x13);
+                assert_eq!(a.load(Ordering::Relaxed), !(0x13 & 0x31));
+            }
+        }
+        #[test]
+        fn fetch_or() {
+            let a = <$atomic_type>::new(0b101101);
+            test_swap_ordering(|order| a.fetch_or(0, order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(0b101101);
+                assert_eq!(a.fetch_or(0b110011, order), 0b101101);
+                assert_eq!(a.load(Ordering::Relaxed), 0b111111);
+            }
+        }
+        #[test]
+        fn or() {
+            let a = <$atomic_type>::new(0b101101);
+            test_swap_ordering(|order| a.or(0, order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(0b101101);
+                a.or(0b110011, order);
+                assert_eq!(a.load(Ordering::Relaxed), 0b111111);
+            }
+        }
+        #[test]
+        fn fetch_xor() {
+            let a = <$atomic_type>::new(0b101101);
+            test_swap_ordering(|order| a.fetch_xor(0, order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(0b101101);
+                assert_eq!(a.fetch_xor(0b110011, order), 0b101101);
+                assert_eq!(a.load(Ordering::Relaxed), 0b011110);
+            }
+        }
+        #[test]
+        fn xor() {
+            let a = <$atomic_type>::new(0b101101);
+            test_swap_ordering(|order| a.xor(0, order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(0b101101);
+                a.xor(0b110011, order);
+                assert_eq!(a.load(Ordering::Relaxed), 0b011110);
+            }
+        }
+        #[test]
+        fn fetch_max() {
+            let a = <$atomic_type>::new(23);
+            test_swap_ordering(|order| a.fetch_max(23, order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(23);
+                assert_eq!(a.fetch_max(22, order), 23);
+                assert_eq!(a.load(Ordering::Relaxed), 23);
+                assert_eq!(a.fetch_max(24, order), 23);
+                assert_eq!(a.load(Ordering::Relaxed), 24);
+                let a = <$atomic_type>::new(0);
+                assert_eq!(a.fetch_max(1, order), 0);
+                assert_eq!(a.load(Ordering::Relaxed), 1);
+                assert_eq!(a.fetch_max(0, order), 1);
+                assert_eq!(a.load(Ordering::Relaxed), 1);
+                let a = <$atomic_type>::new(!0);
+                assert_eq!(a.fetch_max(0, order), !0);
+                assert_eq!(a.load(Ordering::Relaxed), core::cmp::max(!0, 0));
+            }
+        }
+        #[test]
+        fn fetch_min() {
+            let a = <$atomic_type>::new(23);
+            test_swap_ordering(|order| a.fetch_min(23, order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(23);
+                assert_eq!(a.fetch_min(24, order), 23);
+                assert_eq!(a.load(Ordering::Relaxed), 23);
+                assert_eq!(a.fetch_min(22, order), 23);
+                assert_eq!(a.load(Ordering::Relaxed), 22);
+                let a = <$atomic_type>::new(1);
+                assert_eq!(a.fetch_min(0, order), 1);
+                assert_eq!(a.load(Ordering::Relaxed), 0);
+                assert_eq!(a.fetch_min(1, order), 0);
+                assert_eq!(a.load(Ordering::Relaxed), 0);
+                let a = <$atomic_type>::new(!0);
+                assert_eq!(a.fetch_min(0, order), !0);
+                assert_eq!(a.load(Ordering::Relaxed), core::cmp::min(!0, 0));
+            }
+        }
+        #[test]
+        fn fetch_not() {
+            let a = <$atomic_type>::new(1);
+            test_swap_ordering(|order| a.fetch_not(order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(1);
+                assert_eq!(a.fetch_not(order), 1);
+                assert_eq!(a.load(Ordering::Relaxed), !1);
+            }
+        }
+        #[test]
+        fn not() {
+            let a = <$atomic_type>::new(1);
+            test_swap_ordering(|order| a.not(order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(1);
+                a.not(order);
+                assert_eq!(a.load(Ordering::Relaxed), !1);
+            }
+        }
+        #[test]
+        fn fetch_neg() {
+            let a = <$atomic_type>::new(5);
+            test_swap_ordering(|order| a.fetch_neg(order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(5);
+                assert_eq!(a.fetch_neg(order), 5);
+                assert_eq!(a.load(Ordering::Relaxed), <$int_type>::wrapping_neg(5));
+                assert_eq!(a.fetch_neg(order), <$int_type>::wrapping_neg(5));
+                assert_eq!(a.load(Ordering::Relaxed), 5);
+                let a = <$atomic_type>::new(<$int_type>::MIN);
+                assert_eq!(a.fetch_neg(order), <$int_type>::MIN);
+                assert_eq!(a.load(Ordering::Relaxed), <$int_type>::MIN.wrapping_neg());
+                assert_eq!(a.fetch_neg(order), <$int_type>::MIN.wrapping_neg());
+                assert_eq!(a.load(Ordering::Relaxed), <$int_type>::MIN);
+            }
+        }
+        #[test]
+        fn neg() {
+            let a = <$atomic_type>::new(5);
+            test_swap_ordering(|order| a.neg(order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(5);
+                a.neg(order);
+                assert_eq!(a.load(Ordering::Relaxed), <$int_type>::wrapping_neg(5));
+                a.neg(order);
+                assert_eq!(a.load(Ordering::Relaxed), 5);
+                let a = <$atomic_type>::new(<$int_type>::MIN);
+                a.neg(order);
+                assert_eq!(a.load(Ordering::Relaxed), <$int_type>::MIN.wrapping_neg());
+                a.neg(order);
+                assert_eq!(a.load(Ordering::Relaxed), <$int_type>::MIN);
+            }
+        }
+        #[test]
+        fn bit_set() {
+            let a = <$atomic_type>::new(0b0001);
+            test_swap_ordering(|order| assert!(a.bit_set(0, order)));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(0b0000);
+                assert!(!a.bit_set(0, order));
+                assert_eq!(a.load(Ordering::Relaxed), 0b0001);
+                assert!(a.bit_set(0, order));
+                assert_eq!(a.load(Ordering::Relaxed), 0b0001);
+            }
+        }
+        #[test]
+        fn bit_clear() {
+            let a = <$atomic_type>::new(0b0000);
+            test_swap_ordering(|order| assert!(!a.bit_clear(0, order)));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(0b0001);
+                assert!(a.bit_clear(0, order));
+                assert_eq!(a.load(Ordering::Relaxed), 0b0000);
+                assert!(!a.bit_clear(0, order));
+                assert_eq!(a.load(Ordering::Relaxed), 0b0000);
+            }
+        }
+        #[test]
+        fn bit_toggle() {
+            let a = <$atomic_type>::new(0b0000);
+            test_swap_ordering(|order| a.bit_toggle(0, order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(0b0000);
+                assert!(!a.bit_toggle(0, order));
+                assert_eq!(a.load(Ordering::Relaxed), 0b0001);
+                assert!(a.bit_toggle(0, order));
+                assert_eq!(a.load(Ordering::Relaxed), 0b0000);
+            }
+        }
+        ::quickcheck::quickcheck! {
+            fn quickcheck_swap(x: $int_type, y: $int_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_eq!(a.swap(y, order), x);
+                    assert_eq!(a.swap(x, order), y);
+                }
+                true
+            }
+            fn quickcheck_compare_exchange(x: $int_type, y: $int_type) -> bool {
+                #[cfg(all(
+                    target_arch = "arm",
+                    not(any(target_feature = "v6", portable_atomic_target_feature = "v6")),
+                ))]
+                {
+                    // TODO: LLVM bug:
+                    // https://github.com/llvm/llvm-project/issues/61880
+                    // https://github.com/taiki-e/portable-atomic/issues/2
+                    if core::mem::size_of::<$int_type>() <= 2 {
+                        return true;
+                    }
+                }
+                let z = loop {
+                    let z = fastrand::$int_type(..);
+                    if z != y {
+                        break z;
+                    }
+                };
+                for &(success, failure) in &test_helper::COMPARE_EXCHANGE_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_eq!(a.compare_exchange(x, y, success, failure).unwrap(), x);
+                    assert_eq!(a.load(Ordering::Relaxed), y);
+                    assert_eq!(a.compare_exchange(z, x, success, failure).unwrap_err(), y);
+                    assert_eq!(a.load(Ordering::Relaxed), y);
+                }
+                true
+            }
+            fn quickcheck_fetch_add(x: $int_type, y: $int_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_eq!(a.fetch_add(y, order), x);
+                    assert_eq!(a.load(Ordering::Relaxed), x.wrapping_add(y));
+                    let a = <$atomic_type>::new(y);
+                    assert_eq!(a.fetch_add(x, order), y);
+                    assert_eq!(a.load(Ordering::Relaxed), y.wrapping_add(x));
+                }
+                true
+            }
+            fn quickcheck_add(x: $int_type, y: $int_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    a.add(y, order);
+                    assert_eq!(a.load(Ordering::Relaxed), x.wrapping_add(y));
+                    let a = <$atomic_type>::new(y);
+                    a.add(x, order);
+                    assert_eq!(a.load(Ordering::Relaxed), y.wrapping_add(x));
+                }
+                true
+            }
+            fn quickcheck_fetch_sub(x: $int_type, y: $int_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_eq!(a.fetch_sub(y, order), x);
+                    assert_eq!(a.load(Ordering::Relaxed), x.wrapping_sub(y));
+                    let a = <$atomic_type>::new(y);
+                    assert_eq!(a.fetch_sub(x, order), y);
+                    assert_eq!(a.load(Ordering::Relaxed), y.wrapping_sub(x));
+                }
+                true
+            }
+            fn quickcheck_sub(x: $int_type, y: $int_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    a.sub(y, order);
+                    assert_eq!(a.load(Ordering::Relaxed), x.wrapping_sub(y));
+                    let a = <$atomic_type>::new(y);
+                    a.sub(x, order);
+                    assert_eq!(a.load(Ordering::Relaxed), y.wrapping_sub(x));
+                }
+                true
+            }
+            fn quickcheck_fetch_and(x: $int_type, y: $int_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_eq!(a.fetch_and(y, order), x);
+                    assert_eq!(a.load(Ordering::Relaxed), x & y);
+                    let a = <$atomic_type>::new(y);
+                    assert_eq!(a.fetch_and(x, order), y);
+                    assert_eq!(a.load(Ordering::Relaxed), y & x);
+                }
+                true
+            }
+            fn quickcheck_and(x: $int_type, y: $int_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    a.and(y, order);
+                    assert_eq!(a.load(Ordering::Relaxed), x & y);
+                    let a = <$atomic_type>::new(y);
+                    a.and(x, order);
+                    assert_eq!(a.load(Ordering::Relaxed), y & x);
+                }
+                true
+            }
+            fn quickcheck_fetch_nand(x: $int_type, y: $int_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_eq!(a.fetch_nand(y, order), x);
+                    assert_eq!(a.load(Ordering::Relaxed), !(x & y));
+                    let a = <$atomic_type>::new(y);
+                    assert_eq!(a.fetch_nand(x, order), y);
+                    assert_eq!(a.load(Ordering::Relaxed), !(y & x));
+                }
+                true
+            }
+            fn quickcheck_fetch_or(x: $int_type, y: $int_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_eq!(a.fetch_or(y, order), x);
+                    assert_eq!(a.load(Ordering::Relaxed), x | y);
+                    let a = <$atomic_type>::new(y);
+                    assert_eq!(a.fetch_or(x, order), y);
+                    assert_eq!(a.load(Ordering::Relaxed), y | x);
+                }
+                true
+            }
+            fn quickcheck_or(x: $int_type, y: $int_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    a.or(y, order);
+                    assert_eq!(a.load(Ordering::Relaxed), x | y);
+                    let a = <$atomic_type>::new(y);
+                    a.or(x, order);
+                    assert_eq!(a.load(Ordering::Relaxed), y | x);
+                }
+                true
+            }
+            fn quickcheck_fetch_xor(x: $int_type, y: $int_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_eq!(a.fetch_xor(y, order), x);
+                    assert_eq!(a.load(Ordering::Relaxed), x ^ y);
+                    let a = <$atomic_type>::new(y);
+                    assert_eq!(a.fetch_xor(x, order), y);
+                    assert_eq!(a.load(Ordering::Relaxed), y ^ x);
+                }
+                true
+            }
+            fn quickcheck_xor(x: $int_type, y: $int_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    a.xor(y, order);
+                    assert_eq!(a.load(Ordering::Relaxed), x ^ y);
+                    let a = <$atomic_type>::new(y);
+                    a.xor(x, order);
+                    assert_eq!(a.load(Ordering::Relaxed), y ^ x);
+                }
+                true
+            }
+            fn quickcheck_fetch_max(x: $int_type, y: $int_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_eq!(a.fetch_max(y, order), x);
+                    assert_eq!(a.load(Ordering::Relaxed), core::cmp::max(x, y));
+                    let a = <$atomic_type>::new(y);
+                    assert_eq!(a.fetch_max(x, order), y);
+                    assert_eq!(a.load(Ordering::Relaxed), core::cmp::max(y, x));
+                }
+                true
+            }
+            fn quickcheck_fetch_min(x: $int_type, y: $int_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_eq!(a.fetch_min(y, order), x);
+                    assert_eq!(a.load(Ordering::Relaxed), core::cmp::min(x, y));
+                    let a = <$atomic_type>::new(y);
+                    assert_eq!(a.fetch_min(x, order), y);
+                    assert_eq!(a.load(Ordering::Relaxed), core::cmp::min(y, x));
+                }
+                true
+            }
+            fn quickcheck_fetch_not(x: $int_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_eq!(a.fetch_not(order), x);
+                    assert_eq!(a.load(Ordering::Relaxed), !x);
+                    assert_eq!(a.fetch_not(order), !x);
+                    assert_eq!(a.load(Ordering::Relaxed), x);
+                }
+                true
+            }
+            fn quickcheck_not(x: $int_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    a.not(order);
+                    assert_eq!(a.load(Ordering::Relaxed), !x);
+                    a.not(order);
+                    assert_eq!(a.load(Ordering::Relaxed), x);
+                }
+                true
+            }
+            fn quickcheck_fetch_neg(x: $int_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_eq!(a.fetch_neg(order), x);
+                    assert_eq!(a.load(Ordering::Relaxed), x.wrapping_neg());
+                    assert_eq!(a.fetch_neg(order), x.wrapping_neg());
+                    assert_eq!(a.load(Ordering::Relaxed), x);
+                }
+                true
+            }
+            fn quickcheck_neg(x: $int_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    a.neg(order);
+                    assert_eq!(a.load(Ordering::Relaxed), x.wrapping_neg());
+                    a.neg(order);
+                    assert_eq!(a.load(Ordering::Relaxed), x);
+                }
+                true
+            }
+            fn quickcheck_bit_set(x: $int_type, bit: u32) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    let b = a.bit_set(bit, order);
+                    let mask = <$int_type>::wrapping_shl(1, bit);
+                    assert_eq!(a.load(Ordering::Relaxed), x | mask);
+                    assert_eq!(b, x & mask != 0);
+                }
+                true
+            }
+            fn quickcheck_bit_clear(x: $int_type, bit: u32) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    let b = a.bit_clear(bit, order);
+                    let mask = <$int_type>::wrapping_shl(1, bit);
+                    assert_eq!(a.load(Ordering::Relaxed), x & !mask);
+                    assert_eq!(b, x & mask != 0);
+                }
+                true
+            }
+            fn quickcheck_bit_toggle(x: $int_type, bit: u32) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    let b = a.bit_toggle(bit, order);
+                    let mask = <$int_type>::wrapping_shl(1, bit);
+                    assert_eq!(a.load(Ordering::Relaxed), x ^ mask);
+                    assert_eq!(b, x & mask != 0);
+                }
+                true
+            }
+        }
+    };
+    ($atomic_type:ty, $int_type:ident) => {
+        __test_atomic_int!($atomic_type, $int_type, single_thread);
+
+        #[test]
+        fn stress_swap() {
+            let (iterations, threads) = stress_test_config();
+            let data1 = &(0..threads)
+                .map(|_| (0..iterations).map(|_| fastrand::$int_type(..)).collect::<Vec<_>>())
+                .collect::<Vec<_>>();
+            let data2 = &(0..threads)
+                .map(|_| (0..iterations).map(|_| fastrand::$int_type(..)).collect::<Vec<_>>())
+                .collect::<Vec<_>>();
+            let set = &data1
+                .iter()
+                .flat_map(|v| v.iter().copied())
+                .chain(data2.iter().flat_map(|v| v.iter().copied()))
+                .collect::<BTreeSet<_>>();
+            let a = &<$atomic_type>::new(data2[0][fastrand::usize(0..iterations)]);
+            let now = &std::time::Instant::now();
+            thread::scope(|s| {
+                for thread in 0..threads {
+                    if thread % 2 == 0 {
+                        s.spawn(move |_| {
+                            let now = *now;
+                            for i in 0..iterations {
+                                a.store(data1[thread][i], rand_store_ordering());
+                            }
+                            std::eprintln!("store end={:?}", now.elapsed());
+                        });
+                    } else {
+                        s.spawn(|_| {
+                            let now = *now;
+                            let mut v = vec![0; iterations];
+                            for i in 0..iterations {
+                                v[i] = a.load(rand_load_ordering());
+                            }
+                            std::eprintln!("load end={:?}", now.elapsed());
+                            for v in v {
+                                assert!(set.contains(&v), "v={}", v);
+                            }
+                        });
+                    }
+                    s.spawn(move |_| {
+                        let now = *now;
+                        let mut v = vec![0; iterations];
+                        for i in 0..iterations {
+                            v[i] = a.swap(data2[thread][i], rand_swap_ordering());
+                        }
+                        std::eprintln!("swap end={:?}", now.elapsed());
+                        for v in v {
+                            assert!(set.contains(&v), "v={}", v);
+                        }
+                    });
+                }
+            })
+            .unwrap();
+        }
+        #[test]
+        fn stress_compare_exchange() {
+            let (iterations, threads) = stress_test_config();
+            let data1 = &(0..threads)
+                .map(|_| (0..iterations).map(|_| fastrand::$int_type(..)).collect::<Vec<_>>())
+                .collect::<Vec<_>>();
+            let data2 = &(0..threads)
+                .map(|_| (0..iterations).map(|_| fastrand::$int_type(..)).collect::<Vec<_>>())
+                .collect::<Vec<_>>();
+            let set = &data1
+                .iter()
+                .flat_map(|v| v.iter().copied())
+                .chain(data2.iter().flat_map(|v| v.iter().copied()))
+                .collect::<BTreeSet<_>>();
+            let a = &<$atomic_type>::new(data2[0][fastrand::usize(0..iterations)]);
+            let now = &std::time::Instant::now();
+            thread::scope(|s| {
+                for thread in 0..threads {
+                    s.spawn(move |_| {
+                        let now = *now;
+                        for i in 0..iterations {
+                            a.store(data1[thread][i], rand_store_ordering());
+                        }
+                        std::eprintln!("store end={:?}", now.elapsed());
+                    });
+                    s.spawn(|_| {
+                        let now = *now;
+                        let mut v = vec![data2[0][0]; iterations];
+                        for i in 0..iterations {
+                            v[i] = a.load(rand_load_ordering());
+                        }
+                        std::eprintln!("load end={:?}", now.elapsed());
+                        for v in v {
+                            assert!(set.contains(&v), "v={}", v);
+                        }
+                    });
+                    s.spawn(move |_| {
+                        let now = *now;
+                        let mut v = vec![data2[0][0]; iterations];
+                        for i in 0..iterations {
+                            let old = if i % 2 == 0 {
+                                fastrand::$int_type(..)
+                            } else {
+                                a.load(Ordering::Relaxed)
+                            };
+                            let new = data2[thread][i];
+                            let o = rand_compare_exchange_ordering();
+                            match a.compare_exchange(old, new, o.0, o.1) {
+                                Ok(r) => assert_eq!(old, r),
+                                Err(r) => v[i] = r,
+                            }
+                        }
+                        std::eprintln!("compare_exchange end={:?}", now.elapsed());
+                        for v in v {
+                            assert!(set.contains(&v), "v={}", v);
+                        }
+                    });
+                }
+            })
+            .unwrap();
+        }
+    };
+}
+macro_rules! __test_atomic_float {
+    ($atomic_type:ty, $float_type:ident, single_thread) => {
+        #[test]
+        fn swap() {
+            let a = <$atomic_type>::new(5.);
+            test_swap_ordering(|order| a.swap(5., order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                assert_eq!(a.swap(10., order), 5.);
+                assert_eq!(a.swap(5., order), 10.);
+            }
+        }
+        #[test]
+        fn compare_exchange() {
+            let a = <$atomic_type>::new(5.);
+            test_compare_exchange_ordering(|success, failure| {
+                a.compare_exchange(5., 5., success, failure)
+            });
+            for &(success, failure) in &test_helper::COMPARE_EXCHANGE_ORDERINGS {
+                let a = <$atomic_type>::new(5.);
+                assert_eq!(a.compare_exchange(5., 10., success, failure), Ok(5.));
+                assert_eq!(a.load(Ordering::Relaxed), 10.);
+                assert_eq!(a.compare_exchange(6., 12., success, failure), Err(10.));
+                assert_eq!(a.load(Ordering::Relaxed), 10.);
+            }
+        }
+        #[test]
+        fn compare_exchange_weak() {
+            let a = <$atomic_type>::new(4.);
+            test_compare_exchange_ordering(|success, failure| {
+                a.compare_exchange_weak(4., 4., success, failure)
+            });
+            for &(success, failure) in &test_helper::COMPARE_EXCHANGE_ORDERINGS {
+                let a = <$atomic_type>::new(4.);
+                assert_eq!(a.compare_exchange_weak(6., 8., success, failure), Err(4.));
+                let mut old = a.load(Ordering::Relaxed);
+                loop {
+                    let new = old * 2.;
+                    match a.compare_exchange_weak(old, new, success, failure) {
+                        Ok(_) => break,
+                        Err(x) => old = x,
+                    }
+                }
+                assert_eq!(a.load(Ordering::Relaxed), 8.);
+            }
+        }
+        #[test]
+        fn fetch_add() {
+            let a = <$atomic_type>::new(0.);
+            test_swap_ordering(|order| a.fetch_add(0., order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(0.);
+                assert_eq!(a.fetch_add(10., order), 0.);
+                assert_eq!(a.load(Ordering::Relaxed), 10.);
+                let a = <$atomic_type>::new($float_type::MAX);
+                assert_eq!(a.fetch_add(1., order), $float_type::MAX);
+                assert_eq!(a.load(Ordering::Relaxed), $float_type::MAX + 1.);
+            }
+        }
+        #[test]
+        fn fetch_sub() {
+            let a = <$atomic_type>::new(20.);
+            test_swap_ordering(|order| a.fetch_sub(0., order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(20.);
+                assert_eq!(a.fetch_sub(10., order), 20.);
+                assert_eq!(a.load(Ordering::Relaxed), 10.);
+                let a = <$atomic_type>::new($float_type::MIN);
+                assert_eq!(a.fetch_sub(1., order), $float_type::MIN);
+                assert_eq!(a.load(Ordering::Relaxed), $float_type::MIN - 1.);
+            }
+        }
+        #[test]
+        fn fetch_max() {
+            let a = <$atomic_type>::new(23.);
+            test_swap_ordering(|order| a.fetch_max(23., order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(23.);
+                assert_eq!(a.fetch_max(22., order), 23.);
+                assert_eq!(a.load(Ordering::Relaxed), 23.);
+                assert_eq!(a.fetch_max(24., order), 23.);
+                assert_eq!(a.load(Ordering::Relaxed), 24.);
+            }
+        }
+        #[test]
+        fn fetch_min() {
+            let a = <$atomic_type>::new(23.);
+            test_swap_ordering(|order| a.fetch_min(23., order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(23.);
+                assert_eq!(a.fetch_min(24., order), 23.);
+                assert_eq!(a.load(Ordering::Relaxed), 23.);
+                assert_eq!(a.fetch_min(22., order), 23.);
+                assert_eq!(a.load(Ordering::Relaxed), 22.);
+            }
+        }
+        #[test]
+        fn fetch_neg() {
+            let a = <$atomic_type>::new(5.);
+            test_swap_ordering(|order| a.fetch_neg(order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(5.);
+                assert_eq!(a.fetch_neg(order), 5.);
+                assert_eq!(a.load(Ordering::Relaxed), -5.);
+                assert_eq!(a.fetch_neg(order), -5.);
+                assert_eq!(a.load(Ordering::Relaxed), 5.);
+            }
+        }
+        #[test]
+        fn fetch_abs() {
+            let a = <$atomic_type>::new(23.);
+            test_swap_ordering(|order| a.fetch_abs(order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(-23.);
+                assert_eq!(a.fetch_abs(order), -23.);
+                assert_eq!(a.load(Ordering::Relaxed), 23.);
+                assert_eq!(a.fetch_abs(order), 23.);
+                assert_eq!(a.load(Ordering::Relaxed), 23.);
+            }
+        }
+        ::quickcheck::quickcheck! {
+            fn quickcheck_swap(x: $float_type, y: $float_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_float_op_eq!(a.swap(y, order), x);
+                    assert_float_op_eq!(a.swap(x, order), y);
+                }
+                true
+            }
+            fn quickcheck_compare_exchange(x: $float_type, y: $float_type) -> bool {
+                let z = loop {
+                    let z = fastrand::$float_type();
+                    if z != y {
+                        break z;
+                    }
+                };
+                for &(success, failure) in &test_helper::COMPARE_EXCHANGE_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_float_op_eq!(a.compare_exchange(x, y, success, failure).unwrap(), x);
+                    assert_float_op_eq!(a.load(Ordering::Relaxed), y);
+                    assert_float_op_eq!(
+                        a.compare_exchange(z, x, success, failure).unwrap_err(),
+                        y,
+                    );
+                    assert_float_op_eq!(a.load(Ordering::Relaxed), y);
+                }
+                true
+            }
+            fn quickcheck_fetch_add(x: $float_type, y: $float_type) -> bool {
+                if cfg!(all(not(debug_assertions), target_arch = "x86", not(target_feature = "sse2"))) {
+                    // TODO: rustc bug:
+                    // https://github.com/rust-lang/rust/issues/72327
+                    // https://github.com/rust-lang/rust/issues/73288
+                    return true;
+                }
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_float_op_eq!(a.fetch_add(y, order), x);
+                    assert_float_op_eq!(a.load(Ordering::Relaxed), x + y);
+                    let a = <$atomic_type>::new(y);
+                    assert_float_op_eq!(a.fetch_add(x, order), y);
+                    assert_float_op_eq!(a.load(Ordering::Relaxed), y + x);
+                }
+                true
+            }
+            fn quickcheck_fetch_sub(x: $float_type, y: $float_type) -> bool {
+                if cfg!(all(not(debug_assertions), target_arch = "x86", not(target_feature = "sse2"))) {
+                    // TODO: rustc bug:
+                    // https://github.com/rust-lang/rust/issues/72327
+                    // https://github.com/rust-lang/rust/issues/73288
+                    return true;
+                }
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_float_op_eq!(a.fetch_sub(y, order), x);
+                    assert_float_op_eq!(a.load(Ordering::Relaxed), x - y);
+                    let a = <$atomic_type>::new(y);
+                    assert_float_op_eq!(a.fetch_sub(x, order), y);
+                    assert_float_op_eq!(a.load(Ordering::Relaxed), y - x);
+                }
+                true
+            }
+            fn quickcheck_fetch_max(x: $float_type, y: $float_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_float_op_eq!(a.fetch_max(y, order), x);
+                    assert_float_op_eq!(a.load(Ordering::Relaxed), x.max(y));
+                    let a = <$atomic_type>::new(y);
+                    assert_float_op_eq!(a.fetch_max(x, order), y);
+                    assert_float_op_eq!(a.load(Ordering::Relaxed), y.max(x));
+                }
+                true
+            }
+            fn quickcheck_fetch_min(x: $float_type, y: $float_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_float_op_eq!(a.fetch_min(y, order), x);
+                    assert_float_op_eq!(a.load(Ordering::Relaxed), x.min(y));
+                    let a = <$atomic_type>::new(y);
+                    assert_float_op_eq!(a.fetch_min(x, order), y);
+                    assert_float_op_eq!(a.load(Ordering::Relaxed), y.min(x));
+                }
+                true
+            }
+            fn quickcheck_fetch_neg(x: $float_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_float_op_eq!(a.fetch_neg(order), x);
+                    assert_float_op_eq!(a.load(Ordering::Relaxed), -x);
+                    assert_float_op_eq!(a.fetch_neg(order), -x);
+                    assert_float_op_eq!(a.load(Ordering::Relaxed), x);
+                }
+                true
+            }
+            fn quickcheck_fetch_abs(x: $float_type) -> bool {
+                for &order in &test_helper::SWAP_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_float_op_eq!(a.fetch_abs(order), x);
+                    assert_float_op_eq!(a.fetch_abs(order), x.abs());
+                    assert_float_op_eq!(a.load(Ordering::Relaxed), x.abs());
+                }
+                true
+            }
+        }
+    };
+    ($atomic_type:ty, $float_type:ident) => {
+        __test_atomic_float!($atomic_type, $float_type, single_thread);
+        // TODO: multi thread
+    };
+}
+macro_rules! __test_atomic_bool {
+    ($atomic_type:ty, single_thread) => {
+        #[test]
+        fn swap() {
+            let a = <$atomic_type>::new(true);
+            test_swap_ordering(|order| a.swap(true, order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                assert_eq!(a.swap(true, order), true);
+                assert_eq!(a.swap(false, order), true);
+                assert_eq!(a.swap(false, order), false);
+                assert_eq!(a.swap(true, order), false);
+            }
+        }
+        #[test]
+        fn compare_exchange() {
+            let a = <$atomic_type>::new(true);
+            test_compare_exchange_ordering(|success, failure| {
+                a.compare_exchange(true, true, success, failure)
+            });
+            for &(success, failure) in &test_helper::COMPARE_EXCHANGE_ORDERINGS {
+                let a = <$atomic_type>::new(true);
+                assert_eq!(a.compare_exchange(true, false, success, failure), Ok(true));
+                assert_eq!(a.load(Ordering::Relaxed), false);
+                assert_eq!(a.compare_exchange(true, true, success, failure), Err(false));
+                assert_eq!(a.load(Ordering::Relaxed), false);
+            }
+        }
+        #[test]
+        fn compare_exchange_weak() {
+            let a = <$atomic_type>::new(false);
+            test_compare_exchange_ordering(|success, failure| {
+                a.compare_exchange_weak(false, false, success, failure)
+            });
+            for &(success, failure) in &test_helper::COMPARE_EXCHANGE_ORDERINGS {
+                let a = <$atomic_type>::new(false);
+                assert_eq!(a.compare_exchange_weak(true, true, success, failure), Err(false));
+                let mut old = a.load(Ordering::Relaxed);
+                let new = true;
+                loop {
+                    match a.compare_exchange_weak(old, new, success, failure) {
+                        Ok(_) => break,
+                        Err(x) => old = x,
+                    }
+                }
+                assert_eq!(a.load(Ordering::Relaxed), true);
+            }
+        }
+        #[test]
+        fn fetch_and() {
+            let a = <$atomic_type>::new(true);
+            test_swap_ordering(|order| assert_eq!(a.fetch_and(true, order), true));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(true);
+                assert_eq!(a.fetch_and(false, order), true);
+                assert_eq!(a.load(Ordering::Relaxed), false);
+                let a = <$atomic_type>::new(true);
+                assert_eq!(a.fetch_and(true, order), true);
+                assert_eq!(a.load(Ordering::Relaxed), true);
+                let a = <$atomic_type>::new(false);
+                assert_eq!(a.fetch_and(false, order), false);
+                assert_eq!(a.load(Ordering::Relaxed), false);
+                let a = <$atomic_type>::new(false);
+                assert_eq!(a.fetch_and(true, order), false);
+                assert_eq!(a.load(Ordering::Relaxed), false);
+            }
+        }
+        #[test]
+        fn and() {
+            let a = <$atomic_type>::new(true);
+            test_swap_ordering(|order| a.and(true, order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(true);
+                a.and(false, order);
+                assert_eq!(a.load(Ordering::Relaxed), false);
+                let a = <$atomic_type>::new(true);
+                a.and(true, order);
+                assert_eq!(a.load(Ordering::Relaxed), true);
+                let a = <$atomic_type>::new(false);
+                a.and(false, order);
+                assert_eq!(a.load(Ordering::Relaxed), false);
+                let a = <$atomic_type>::new(false);
+                a.and(true, order);
+                assert_eq!(a.load(Ordering::Relaxed), false);
+            }
+        }
+        #[test]
+        fn fetch_or() {
+            let a = <$atomic_type>::new(true);
+            test_swap_ordering(|order| assert_eq!(a.fetch_or(false, order), true));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(true);
+                assert_eq!(a.fetch_or(false, order), true);
+                assert_eq!(a.load(Ordering::Relaxed), true);
+                let a = <$atomic_type>::new(true);
+                assert_eq!(a.fetch_or(true, order), true);
+                assert_eq!(a.load(Ordering::Relaxed), true);
+                let a = <$atomic_type>::new(false);
+                assert_eq!(a.fetch_or(false, order), false);
+                assert_eq!(a.load(Ordering::Relaxed), false);
+                let a = <$atomic_type>::new(false);
+                assert_eq!(a.fetch_or(true, order), false);
+                assert_eq!(a.load(Ordering::Relaxed), true);
+            }
+        }
+        #[test]
+        fn or() {
+            let a = <$atomic_type>::new(true);
+            test_swap_ordering(|order| a.or(false, order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(true);
+                a.or(false, order);
+                assert_eq!(a.load(Ordering::Relaxed), true);
+                let a = <$atomic_type>::new(true);
+                a.or(true, order);
+                assert_eq!(a.load(Ordering::Relaxed), true);
+                let a = <$atomic_type>::new(false);
+                a.or(false, order);
+                assert_eq!(a.load(Ordering::Relaxed), false);
+                let a = <$atomic_type>::new(false);
+                a.or(true, order);
+                assert_eq!(a.load(Ordering::Relaxed), true);
+            }
+        }
+        #[test]
+        fn fetch_xor() {
+            let a = <$atomic_type>::new(true);
+            test_swap_ordering(|order| assert_eq!(a.fetch_xor(false, order), true));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(true);
+                assert_eq!(a.fetch_xor(false, order), true);
+                assert_eq!(a.load(Ordering::Relaxed), true);
+                let a = <$atomic_type>::new(true);
+                assert_eq!(a.fetch_xor(true, order), true);
+                assert_eq!(a.load(Ordering::Relaxed), false);
+                let a = <$atomic_type>::new(false);
+                assert_eq!(a.fetch_xor(false, order), false);
+                assert_eq!(a.load(Ordering::Relaxed), false);
+                let a = <$atomic_type>::new(false);
+                assert_eq!(a.fetch_xor(true, order), false);
+                assert_eq!(a.load(Ordering::Relaxed), true);
+            }
+        }
+        #[test]
+        fn xor() {
+            let a = <$atomic_type>::new(true);
+            test_swap_ordering(|order| a.xor(false, order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(true);
+                a.xor(false, order);
+                assert_eq!(a.load(Ordering::Relaxed), true);
+                let a = <$atomic_type>::new(true);
+                a.xor(true, order);
+                assert_eq!(a.load(Ordering::Relaxed), false);
+                let a = <$atomic_type>::new(false);
+                a.xor(false, order);
+                assert_eq!(a.load(Ordering::Relaxed), false);
+                let a = <$atomic_type>::new(false);
+                a.xor(true, order);
+                assert_eq!(a.load(Ordering::Relaxed), true);
+            }
+        }
+        ::quickcheck::quickcheck! {
+            fn quickcheck_compare_exchange(x: bool, y: bool) -> bool {
+                let z = !y;
+                for &(success, failure) in &test_helper::COMPARE_EXCHANGE_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_eq!(a.compare_exchange(x, y, success, failure).unwrap(), x);
+                    assert_eq!(a.load(Ordering::Relaxed), y);
+                    assert_eq!(a.compare_exchange(z, x, success, failure).unwrap_err(), y);
+                    assert_eq!(a.load(Ordering::Relaxed), y);
+                }
+                true
+            }
+        }
+    };
+    ($atomic_type:ty) => {
+        __test_atomic_bool!($atomic_type, single_thread);
+        // TODO: multi thread
+    };
+}
+macro_rules! __test_atomic_ptr {
+    ($atomic_type:ty, single_thread) => {
+        #[test]
+        fn swap() {
+            let a = <$atomic_type>::new(ptr::null_mut());
+            test_swap_ordering(|order| a.swap(ptr::null_mut(), order));
+            let x = &mut 1;
+            for &order in &test_helper::SWAP_ORDERINGS {
+                assert_eq!(a.swap(x, order), ptr::null_mut());
+                assert_eq!(a.swap(ptr::null_mut(), order), x as *mut _);
+            }
+        }
+        #[test]
+        fn compare_exchange() {
+            let a = <$atomic_type>::new(ptr::null_mut());
+            test_compare_exchange_ordering(|success, failure| {
+                a.compare_exchange(ptr::null_mut(), ptr::null_mut(), success, failure)
+            });
+            for &(success, failure) in &test_helper::COMPARE_EXCHANGE_ORDERINGS {
+                let a = <$atomic_type>::new(ptr::null_mut());
+                let x = &mut 1;
+                assert_eq!(
+                    a.compare_exchange(ptr::null_mut(), x, success, failure),
+                    Ok(ptr::null_mut()),
+                );
+                assert_eq!(a.load(Ordering::Relaxed), x as *mut _);
+                assert_eq!(
+                    a.compare_exchange(ptr::null_mut(), ptr::null_mut(), success, failure),
+                    Err(x as *mut _),
+                );
+                assert_eq!(a.load(Ordering::Relaxed), x as *mut _);
+            }
+        }
+        #[test]
+        fn compare_exchange_weak() {
+            let a = <$atomic_type>::new(ptr::null_mut());
+            test_compare_exchange_ordering(|success, failure| {
+                a.compare_exchange_weak(ptr::null_mut(), ptr::null_mut(), success, failure)
+            });
+            for &(success, failure) in &test_helper::COMPARE_EXCHANGE_ORDERINGS {
+                let a = <$atomic_type>::new(ptr::null_mut());
+                let x = &mut 1;
+                assert_eq!(a.compare_exchange_weak(x, x, success, failure), Err(ptr::null_mut()));
+                let mut old = a.load(Ordering::Relaxed);
+                loop {
+                    match a.compare_exchange_weak(old, x, success, failure) {
+                        Ok(_) => break,
+                        Err(x) => old = x,
+                    }
+                }
+                assert_eq!(a.load(Ordering::Relaxed), x as *mut _);
+            }
+        }
+    };
+    ($atomic_type:ty) => {
+        __test_atomic_ptr!($atomic_type, single_thread);
+        // TODO: multi thread
+    };
+}
+
+macro_rules! __test_atomic_int_load_store_pub {
+    ($atomic_type:ty, $int_type:ident) => {
+        __test_atomic_pub_common!($atomic_type, $int_type);
+        use std::{boxed::Box, mem};
+        #[test]
+        fn impls() {
+            #[cfg(not(portable_atomic_no_const_transmute))]
+            const _: $int_type = {
+                let a = <$atomic_type>::new(10);
+                a.into_inner()
+            };
+            let a = <$atomic_type>::default();
+            let b = <$atomic_type>::from(0);
+            assert_eq!(a.load(Ordering::SeqCst), b.load(Ordering::SeqCst));
+            assert_eq!(std::format!("{:?}", a), std::format!("{:?}", a.load(Ordering::SeqCst)));
+            assert_eq!(a.into_inner(), 0);
+            assert_eq!(b.into_inner(), 0);
+
+            unsafe {
+                let ptr: *mut Align16<$int_type> = Box::into_raw(Box::new(Align16(0)));
+                assert!(ptr as usize % mem::align_of::<$atomic_type>() == 0);
+                {
+                    let a = <$atomic_type>::from_ptr(ptr.cast::<$int_type>());
+                    *a.as_ptr() = 1;
+                }
+                assert_eq!((*ptr).0, 1);
+                drop(Box::from_raw(ptr));
+            }
+        }
+    };
+}
+macro_rules! __test_atomic_int_pub {
+    ($atomic_type:ty, $int_type:ident) => {
+        #[test]
+        fn fetch_update() {
+            let a = <$atomic_type>::new(7);
+            test_compare_exchange_ordering(|set, fetch| a.fetch_update(set, fetch, |x| Some(x)));
+            for &(success, failure) in &test_helper::COMPARE_EXCHANGE_ORDERINGS {
+                let a = <$atomic_type>::new(7);
+                assert_eq!(a.fetch_update(success, failure, |_| None), Err(7));
+                assert_eq!(a.fetch_update(success, failure, |x| Some(x + 1)), Ok(7));
+                assert_eq!(a.fetch_update(success, failure, |x| Some(x + 1)), Ok(8));
+                assert_eq!(a.load(Ordering::SeqCst), 9);
+            }
+        }
+        ::quickcheck::quickcheck! {
+            fn quickcheck_fetch_update(x: $int_type, y: $int_type) -> bool {
+                let z = loop {
+                    let z = fastrand::$int_type(..);
+                    if z != y {
+                        break z;
+                    }
+                };
+                for &(success, failure) in &test_helper::COMPARE_EXCHANGE_ORDERINGS {
+                    let a = <$atomic_type>::new(x);
+                    assert_eq!(
+                        a.fetch_update(success, failure, |_| Some(y))
+                        .unwrap(),
+                        x
+                    );
+                    assert_eq!(
+                        a.fetch_update(success, failure, |_| Some(z))
+                        .unwrap(),
+                        y
+                    );
+                    assert_eq!(a.load(Ordering::Relaxed), z);
+                    assert_eq!(
+                        a.fetch_update(success, failure, |z| if z == y { Some(z) } else { None })
+                        .unwrap_err(),
+                        z
+                    );
+                    assert_eq!(a.load(Ordering::Relaxed), z);
+                }
+                true
+            }
+        }
+    };
+}
+macro_rules! __test_atomic_float_pub {
+    ($atomic_type:ty, $float_type:ident) => {
+        __test_atomic_pub_common!($atomic_type, $float_type);
+        use std::{boxed::Box, mem};
+        #[test]
+        fn fetch_update() {
+            let a = <$atomic_type>::new(7.);
+            test_compare_exchange_ordering(|set, fetch| a.fetch_update(set, fetch, |x| Some(x)));
+            for &(success, failure) in &test_helper::COMPARE_EXCHANGE_ORDERINGS {
+                let a = <$atomic_type>::new(7.);
+                assert_eq!(a.fetch_update(success, failure, |_| None), Err(7.));
+                assert_eq!(a.fetch_update(success, failure, |x| Some(x + 1.)), Ok(7.));
+                assert_eq!(a.fetch_update(success, failure, |x| Some(x + 1.)), Ok(8.));
+                assert_eq!(a.load(Ordering::SeqCst), 9.);
+            }
+        }
+        #[test]
+        fn impls() {
+            #[cfg(not(portable_atomic_no_const_transmute))]
+            const _: $float_type = {
+                let a = <$atomic_type>::new(10.);
+                a.into_inner()
+            };
+            let a = <$atomic_type>::default();
+            let b = <$atomic_type>::from(0.);
+            assert_eq!(a.load(Ordering::SeqCst), b.load(Ordering::SeqCst));
+            assert_eq!(std::format!("{:?}", a), std::format!("{:?}", a.load(Ordering::SeqCst)));
+            assert_eq!(a.into_inner(), 0.);
+            assert_eq!(b.into_inner(), 0.);
+
+            unsafe {
+                let ptr: *mut Align16<$float_type> = Box::into_raw(Box::new(Align16(0.)));
+                assert!(ptr as usize % mem::align_of::<$atomic_type>() == 0);
+                {
+                    let a = <$atomic_type>::from_ptr(ptr.cast::<$float_type>());
+                    *a.as_ptr() = 1.;
+                }
+                assert_eq!((*ptr).0, 1.);
+                drop(Box::from_raw(ptr));
+            }
+        }
+    };
+}
+macro_rules! __test_atomic_bool_pub {
+    ($atomic_type:ty) => {
+        __test_atomic_pub_common!($atomic_type, bool);
+        use std::{boxed::Box, mem};
+        #[test]
+        fn fetch_nand() {
+            let a = <$atomic_type>::new(true);
+            test_swap_ordering(|order| assert_eq!(a.fetch_nand(false, order), true));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(true);
+                assert_eq!(a.fetch_nand(false, order), true);
+                assert_eq!(a.load(Ordering::Relaxed), true);
+                let a = <$atomic_type>::new(true);
+                assert_eq!(a.fetch_nand(true, order), true);
+                assert_eq!(a.load(Ordering::Relaxed) as usize, 0);
+                assert_eq!(a.load(Ordering::Relaxed), false);
+                let a = <$atomic_type>::new(false);
+                assert_eq!(a.fetch_nand(false, order), false);
+                assert_eq!(a.load(Ordering::Relaxed), true);
+                let a = <$atomic_type>::new(false);
+                assert_eq!(a.fetch_nand(true, order), false);
+                assert_eq!(a.load(Ordering::Relaxed), true);
+            }
+        }
+        #[test]
+        fn fetch_not() {
+            let a = <$atomic_type>::new(true);
+            test_swap_ordering(|order| a.fetch_not(order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(true);
+                assert_eq!(a.fetch_not(order), true);
+                assert_eq!(a.load(Ordering::Relaxed), false);
+                let a = <$atomic_type>::new(false);
+                assert_eq!(a.fetch_not(order), false);
+                assert_eq!(a.load(Ordering::Relaxed), true);
+            }
+        }
+        #[test]
+        fn not() {
+            let a = <$atomic_type>::new(true);
+            test_swap_ordering(|order| a.fetch_not(order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let a = <$atomic_type>::new(true);
+                a.not(order);
+                assert_eq!(a.load(Ordering::Relaxed), false);
+                let a = <$atomic_type>::new(false);
+                a.not(order);
+                assert_eq!(a.load(Ordering::Relaxed), true);
+            }
+        }
+        #[test]
+        fn fetch_update() {
+            let a = <$atomic_type>::new(false);
+            test_compare_exchange_ordering(|set, fetch| a.fetch_update(set, fetch, |x| Some(x)));
+            for &(success, failure) in &test_helper::COMPARE_EXCHANGE_ORDERINGS {
+                let a = <$atomic_type>::new(false);
+                assert_eq!(a.fetch_update(success, failure, |_| None), Err(false));
+                assert_eq!(a.fetch_update(success, failure, |x| Some(!x)), Ok(false));
+                assert_eq!(a.fetch_update(success, failure, |x| Some(!x)), Ok(true));
+                assert_eq!(a.load(Ordering::SeqCst), false);
+            }
+        }
+        #[test]
+        fn impls() {
+            #[cfg(not(portable_atomic_no_const_transmute))]
+            const _: bool = {
+                let a = <$atomic_type>::new(true);
+                a.into_inner()
+            };
+            let a = <$atomic_type>::default();
+            let b = <$atomic_type>::from(false);
+            assert_eq!(a.load(Ordering::SeqCst), b.load(Ordering::SeqCst));
+            assert_eq!(std::format!("{:?}", a), std::format!("{:?}", a.load(Ordering::SeqCst)));
+            assert_eq!(a.into_inner(), false);
+            assert_eq!(b.into_inner(), false);
+
+            unsafe {
+                let ptr: *mut bool = Box::into_raw(Box::new(false));
+                assert!(ptr as usize % mem::align_of::<$atomic_type>() == 0);
+                {
+                    let a = <$atomic_type>::from_ptr(ptr);
+                    *a.as_ptr() = true;
+                }
+                assert_eq!((*ptr), true);
+                drop(Box::from_raw(ptr));
+            }
+        }
+    };
+}
+macro_rules! __test_atomic_ptr_pub {
+    ($atomic_type:ty) => {
+        __test_atomic_pub_common!($atomic_type, *mut u8);
+        use sptr::Strict;
+        use std::{boxed::Box, mem};
+        #[test]
+        fn fetch_update() {
+            let a = <$atomic_type>::new(ptr::null_mut());
+            test_compare_exchange_ordering(|set, fetch| a.fetch_update(set, fetch, |x| Some(x)));
+            for &(success, failure) in &test_helper::COMPARE_EXCHANGE_ORDERINGS {
+                let a = <$atomic_type>::new(ptr::null_mut());
+                assert_eq!(a.fetch_update(success, failure, |_| None), Err(ptr::null_mut()));
+                assert_eq!(
+                    a.fetch_update(success, failure, |_| Some(&a as *const _ as *mut _)),
+                    Ok(ptr::null_mut())
+                );
+                assert_eq!(a.load(Ordering::SeqCst), &a as *const _ as *mut _);
+            }
+        }
+        #[test]
+        fn impls() {
+            #[cfg(not(portable_atomic_no_const_transmute))]
+            const _: *mut u8 = {
+                let a = <$atomic_type>::new(ptr::null_mut());
+                a.into_inner()
+            };
+            let a = <$atomic_type>::default();
+            let b = <$atomic_type>::from(ptr::null_mut());
+            assert_eq!(a.load(Ordering::SeqCst), b.load(Ordering::SeqCst));
+            assert_eq!(std::format!("{:?}", a), std::format!("{:?}", a.load(Ordering::SeqCst)));
+            assert_eq!(std::format!("{:p}", a), std::format!("{:p}", a.load(Ordering::SeqCst)));
+            assert_eq!(a.into_inner(), ptr::null_mut());
+            assert_eq!(b.into_inner(), ptr::null_mut());
+
+            unsafe {
+                let ptr: *mut Align16<*mut u8> = Box::into_raw(Box::new(Align16(ptr::null_mut())));
+                assert!(ptr as usize % mem::align_of::<$atomic_type>() == 0);
+                {
+                    let a = <$atomic_type>::from_ptr(ptr.cast::<*mut u8>());
+                    *a.as_ptr() = ptr::null_mut::<u8>().wrapping_add(1);
+                }
+                assert_eq!((*ptr).0, ptr::null_mut::<u8>().wrapping_add(1));
+                drop(Box::from_raw(ptr));
+            }
+        }
+        // https://github.com/rust-lang/rust/blob/1.70.0/library/core/tests/atomic.rs#L130-L213
+        #[test]
+        fn ptr_add_null() {
+            let atom = AtomicPtr::<i64>::new(core::ptr::null_mut());
+            assert_eq!(atom.fetch_ptr_add(1, Ordering::SeqCst).addr(), 0);
+            assert_eq!(atom.load(Ordering::SeqCst).addr(), 8);
+
+            assert_eq!(atom.fetch_byte_add(1, Ordering::SeqCst).addr(), 8);
+            assert_eq!(atom.load(Ordering::SeqCst).addr(), 9);
+
+            assert_eq!(atom.fetch_ptr_sub(1, Ordering::SeqCst).addr(), 9);
+            assert_eq!(atom.load(Ordering::SeqCst).addr(), 1);
+
+            assert_eq!(atom.fetch_byte_sub(1, Ordering::SeqCst).addr(), 1);
+            assert_eq!(atom.load(Ordering::SeqCst).addr(), 0);
+        }
+        #[test]
+        fn ptr_add_data() {
+            let num = 0i64;
+            let n = &num as *const i64 as *mut _;
+            let atom = AtomicPtr::<i64>::new(n);
+            assert_eq!(atom.fetch_ptr_add(1, Ordering::SeqCst), n);
+            assert_eq!(atom.load(Ordering::SeqCst), n.wrapping_add(1));
+
+            assert_eq!(atom.fetch_ptr_sub(1, Ordering::SeqCst), n.wrapping_add(1));
+            assert_eq!(atom.load(Ordering::SeqCst), n);
+            #[allow(clippy::cast_ptr_alignment)]
+            let bytes_from_n = |b| n.cast::<u8>().wrapping_add(b).cast::<i64>();
+
+            assert_eq!(atom.fetch_byte_add(1, Ordering::SeqCst), n);
+            assert_eq!(atom.load(Ordering::SeqCst), bytes_from_n(1));
+
+            assert_eq!(atom.fetch_byte_add(5, Ordering::SeqCst), bytes_from_n(1));
+            assert_eq!(atom.load(Ordering::SeqCst), bytes_from_n(6));
+
+            assert_eq!(atom.fetch_byte_sub(1, Ordering::SeqCst), bytes_from_n(6));
+            assert_eq!(atom.load(Ordering::SeqCst), bytes_from_n(5));
+
+            assert_eq!(atom.fetch_byte_sub(5, Ordering::SeqCst), bytes_from_n(5));
+            assert_eq!(atom.load(Ordering::SeqCst), n);
+        }
+        #[test]
+        fn ptr_bitops() {
+            let atom = AtomicPtr::<i64>::new(core::ptr::null_mut());
+            assert_eq!(atom.fetch_or(0b0111, Ordering::SeqCst).addr(), 0);
+            assert_eq!(atom.load(Ordering::SeqCst).addr(), 0b0111);
+
+            assert_eq!(atom.fetch_and(0b1101, Ordering::SeqCst).addr(), 0b0111);
+            assert_eq!(atom.load(Ordering::SeqCst).addr(), 0b0101);
+
+            assert_eq!(atom.fetch_xor(0b1111, Ordering::SeqCst).addr(), 0b0101);
+            assert_eq!(atom.load(Ordering::SeqCst).addr(), 0b1010);
+        }
+        #[test]
+        fn ptr_bitops_tagging() {
+            const MASK_TAG: usize = 0b1111;
+            const MASK_PTR: usize = !MASK_TAG;
+
+            #[repr(align(16))]
+            struct Tagme(#[allow(dead_code)] u128);
+
+            let tagme = Tagme(1000);
+            let ptr = &tagme as *const Tagme as *mut Tagme;
+            let atom: AtomicPtr<Tagme> = AtomicPtr::new(ptr);
+
+            assert_eq!(ptr.addr() & MASK_TAG, 0);
+
+            assert_eq!(atom.fetch_or(0b0111, Ordering::SeqCst), ptr);
+            assert_eq!(atom.load(Ordering::SeqCst), ptr.map_addr(|a| a | 0b111));
+
+            assert_eq!(
+                atom.fetch_and(MASK_PTR | 0b0010, Ordering::SeqCst),
+                ptr.map_addr(|a| a | 0b111)
+            );
+            assert_eq!(atom.load(Ordering::SeqCst), ptr.map_addr(|a| a | 0b0010));
+
+            assert_eq!(atom.fetch_xor(0b1011, Ordering::SeqCst), ptr.map_addr(|a| a | 0b0010));
+            assert_eq!(atom.load(Ordering::SeqCst), ptr.map_addr(|a| a | 0b1001));
+
+            assert_eq!(atom.fetch_and(MASK_PTR, Ordering::SeqCst), ptr.map_addr(|a| a | 0b1001));
+            assert_eq!(atom.load(Ordering::SeqCst), ptr);
+        }
+        #[test]
+        fn bit_set() {
+            let a = <$atomic_type>::new(ptr::null_mut::<u64>().cast::<u8>().map_addr(|a| a | 1));
+            test_swap_ordering(|order| assert!(a.bit_set(0, order)));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let pointer = &mut 1u64 as *mut u64 as *mut u8;
+                let atom = <$atomic_type>::new(pointer);
+                // Tag the bottom bit of the pointer.
+                assert!(!atom.bit_set(0, order));
+                // Extract and untag.
+                let tagged = atom.load(Ordering::Relaxed);
+                assert_eq!(tagged.addr() & 1, 1);
+                assert_eq!(tagged.map_addr(|p| p & !1), pointer);
+            }
+        }
+        #[test]
+        fn bit_clear() {
+            let a = <$atomic_type>::new(ptr::null_mut::<u64>().cast::<u8>());
+            test_swap_ordering(|order| assert!(!a.bit_clear(0, order)));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let pointer = &mut 1u64 as *mut u64 as *mut u8;
+                // A tagged pointer
+                let atom = <$atomic_type>::new(pointer.map_addr(|a| a | 1));
+                assert!(atom.bit_set(0, order));
+                // Untag
+                assert!(atom.bit_clear(0, order));
+            }
+        }
+        #[test]
+        fn bit_toggle() {
+            let a = <$atomic_type>::new(ptr::null_mut::<u64>().cast::<u8>());
+            test_swap_ordering(|order| a.bit_toggle(0, order));
+            for &order in &test_helper::SWAP_ORDERINGS {
+                let pointer = &mut 1u64 as *mut u64 as *mut u8;
+                let atom = <$atomic_type>::new(pointer);
+                // Toggle a tag bit on the pointer.
+                atom.bit_toggle(0, order);
+                assert_eq!(atom.load(Ordering::Relaxed).addr() & 1, 1);
+            }
+        }
+    };
+}
+
+macro_rules! test_atomic_int_load_store {
+    ($int_type:ident) => {
+        paste::paste! {
+            #[allow(
+                clippy::alloc_instead_of_core,
+                clippy::std_instead_of_alloc,
+                clippy::std_instead_of_core,
+                clippy::undocumented_unsafe_blocks
+            )]
+            mod [<test_atomic_ $int_type>] {
+                use super::*;
+                __test_atomic_int_load_store!([<Atomic $int_type:camel>], $int_type);
+            }
+        }
+    };
+}
+macro_rules! test_atomic_bool_load_store {
+    () => {
+        #[allow(
+            clippy::alloc_instead_of_core,
+            clippy::std_instead_of_alloc,
+            clippy::std_instead_of_core,
+            clippy::undocumented_unsafe_blocks
+        )]
+        mod test_atomic_bool {
+            use super::*;
+            __test_atomic_bool_load_store!(AtomicBool);
+        }
+    };
+}
+macro_rules! test_atomic_ptr_load_store {
+    () => {
+        #[allow(
+            clippy::alloc_instead_of_core,
+            clippy::std_instead_of_alloc,
+            clippy::std_instead_of_core,
+            clippy::undocumented_unsafe_blocks
+        )]
+        mod test_atomic_ptr {
+            use super::*;
+            __test_atomic_ptr_load_store!(AtomicPtr<u8>);
+        }
+    };
+}
+
+macro_rules! test_atomic_int_single_thread {
+    ($int_type:ident) => {
+        paste::paste! {
+            #[allow(
+                clippy::alloc_instead_of_core,
+                clippy::std_instead_of_alloc,
+                clippy::std_instead_of_core,
+                clippy::undocumented_unsafe_blocks
+            )]
+            mod [<test_atomic_ $int_type>] {
+                use super::*;
+                __test_atomic_int_load_store!([<Atomic $int_type:camel>], $int_type, single_thread);
+                __test_atomic_int!([<Atomic $int_type:camel>], $int_type, single_thread);
+            }
+        }
+    };
+}
+macro_rules! test_atomic_bool_single_thread {
+    () => {
+        #[allow(
+            clippy::alloc_instead_of_core,
+            clippy::std_instead_of_alloc,
+            clippy::std_instead_of_core,
+            clippy::undocumented_unsafe_blocks
+        )]
+        mod test_atomic_bool {
+            use super::*;
+            __test_atomic_bool_load_store!(AtomicBool, single_thread);
+            __test_atomic_bool!(AtomicBool, single_thread);
+        }
+    };
+}
+macro_rules! test_atomic_ptr_single_thread {
+    () => {
+        #[allow(
+            clippy::alloc_instead_of_core,
+            clippy::std_instead_of_alloc,
+            clippy::std_instead_of_core,
+            clippy::undocumented_unsafe_blocks
+        )]
+        mod test_atomic_ptr {
+            use super::*;
+            __test_atomic_ptr_load_store!(AtomicPtr<u8>, single_thread);
+            __test_atomic_ptr!(AtomicPtr<u8>, single_thread);
+        }
+    };
+}
+
+macro_rules! test_atomic_int {
+    ($int_type:ident) => {
+        paste::paste! {
+            #[allow(
+                clippy::alloc_instead_of_core,
+                clippy::std_instead_of_alloc,
+                clippy::std_instead_of_core,
+                clippy::undocumented_unsafe_blocks
+            )]
+            mod [<test_atomic_ $int_type>] {
+                use super::*;
+                __test_atomic_int_load_store!([<Atomic $int_type:camel>], $int_type);
+                __test_atomic_int!([<Atomic $int_type:camel>], $int_type);
+            }
+        }
+    };
+}
+macro_rules! test_atomic_bool {
+    () => {
+        #[allow(
+            clippy::alloc_instead_of_core,
+            clippy::std_instead_of_alloc,
+            clippy::std_instead_of_core,
+            clippy::undocumented_unsafe_blocks
+        )]
+        mod test_atomic_bool {
+            use super::*;
+            __test_atomic_bool_load_store!(AtomicBool);
+            __test_atomic_bool!(AtomicBool);
+        }
+    };
+}
+macro_rules! test_atomic_ptr {
+    () => {
+        #[allow(
+            clippy::alloc_instead_of_core,
+            clippy::std_instead_of_alloc,
+            clippy::std_instead_of_core,
+            clippy::undocumented_unsafe_blocks
+        )]
+        #[allow(unstable_name_collisions)] // for sptr crate
+        mod test_atomic_ptr {
+            use super::*;
+            __test_atomic_ptr_load_store!(AtomicPtr<u8>);
+            __test_atomic_ptr!(AtomicPtr<u8>);
+        }
+    };
+}
+
+macro_rules! test_atomic_int_pub {
+    ($int_type:ident) => {
+        paste::paste! {
+            #[allow(
+                clippy::alloc_instead_of_core,
+                clippy::std_instead_of_alloc,
+                clippy::std_instead_of_core,
+                clippy::undocumented_unsafe_blocks
+            )]
+            mod [<test_atomic_ $int_type>] {
+                use super::*;
+                __test_atomic_int_load_store!([<Atomic $int_type:camel>], $int_type);
+                __test_atomic_int!([<Atomic $int_type:camel>], $int_type);
+                __test_atomic_int_load_store_pub!([<Atomic $int_type:camel>], $int_type);
+                __test_atomic_int_pub!([<Atomic $int_type:camel>], $int_type);
+            }
+        }
+    };
+}
+macro_rules! test_atomic_int_load_store_pub {
+    ($int_type:ident) => {
+        paste::paste! {
+            #[allow(
+                clippy::alloc_instead_of_core,
+                clippy::std_instead_of_alloc,
+                clippy::std_instead_of_core,
+                clippy::undocumented_unsafe_blocks
+            )]
+            mod [<test_atomic_ $int_type>] {
+                use super::*;
+                __test_atomic_int_load_store!([<Atomic $int_type:camel>], $int_type);
+                __test_atomic_int_load_store_pub!([<Atomic $int_type:camel>], $int_type);
+            }
+        }
+    };
+}
+#[cfg(feature = "float")]
+macro_rules! test_atomic_float_pub {
+    ($float_type:ident) => {
+        paste::paste! {
+            #[allow(
+                clippy::alloc_instead_of_core,
+                clippy::std_instead_of_alloc,
+                clippy::std_instead_of_core,
+                clippy::undocumented_unsafe_blocks
+            )]
+            mod [<test_atomic_ $float_type>] {
+                use super::*;
+                __test_atomic_float_load_store!([<Atomic $float_type:camel>], $float_type);
+                __test_atomic_float!([<Atomic $float_type:camel>], $float_type);
+                __test_atomic_float_pub!([<Atomic $float_type:camel>], $float_type);
+            }
+        }
+    };
+}
+macro_rules! test_atomic_bool_pub {
+    () => {
+        #[allow(
+            clippy::alloc_instead_of_core,
+            clippy::std_instead_of_alloc,
+            clippy::std_instead_of_core,
+            clippy::undocumented_unsafe_blocks
+        )]
+        mod test_atomic_bool {
+            use super::*;
+            __test_atomic_bool_load_store!(AtomicBool);
+            __test_atomic_bool!(AtomicBool);
+            __test_atomic_bool_pub!(AtomicBool);
+        }
+    };
+}
+macro_rules! test_atomic_ptr_pub {
+    () => {
+        #[allow(
+            clippy::alloc_instead_of_core,
+            clippy::std_instead_of_alloc,
+            clippy::std_instead_of_core,
+            clippy::undocumented_unsafe_blocks
+        )]
+        #[allow(unstable_name_collisions)] // for sptr crate
+        mod test_atomic_ptr {
+            use super::*;
+            __test_atomic_ptr_load_store!(AtomicPtr<u8>);
+            __test_atomic_ptr!(AtomicPtr<u8>);
+            __test_atomic_ptr_pub!(AtomicPtr<u8>);
+        }
+    };
+}
+
+// Asserts that `$a` and `$b` have performed equivalent operations.
+#[cfg(feature = "float")]
+macro_rules! assert_float_op_eq {
+    ($a:expr, $b:expr $(,)?) => {{
+        // See also:
+        // - https://github.com/rust-lang/unsafe-code-guidelines/issues/237.
+        // - https://github.com/rust-lang/portable-simd/issues/39.
+        let a = $a;
+        let b = $b;
+        if a.is_nan() && b.is_nan() // don't check sign of NaN: https://github.com/rust-lang/rust/issues/55131
+            || a.is_infinite()
+                && b.is_infinite()
+                && a.is_sign_positive() == b.is_sign_positive()
+                && a.is_sign_negative() == b.is_sign_negative()
+        {
+            // ok
+        } else {
+            assert_eq!(a, b);
+        }
+    }};
+}
+
+#[allow(clippy::disallowed_methods)] // set_var/remove_var is fine as we run tests with RUST_TEST_THREADS=1
+#[cfg_attr(not(portable_atomic_no_track_caller), track_caller)]
+pub(crate) fn assert_panic<T: std::fmt::Debug>(f: impl FnOnce() -> T) -> std::string::String {
+    let backtrace = std::env::var_os("RUST_BACKTRACE");
+    let hook = std::panic::take_hook();
+    std::env::set_var("RUST_BACKTRACE", "0"); // Suppress backtrace
+    std::panic::set_hook(std::boxed::Box::new(|_| {})); // Suppress panic msg
+    let res = std::panic::catch_unwind(std::panic::AssertUnwindSafe(f));
+    std::panic::set_hook(hook);
+    match backtrace {
+        Some(v) => std::env::set_var("RUST_BACKTRACE", v),
+        None => std::env::remove_var("RUST_BACKTRACE"),
+    }
+    let msg = res.unwrap_err();
+    msg.downcast_ref::<std::string::String>()
+        .cloned()
+        .unwrap_or_else(|| msg.downcast_ref::<&'static str>().copied().unwrap().into())
+}
+pub(crate) fn rand_load_ordering() -> Ordering {
+    test_helper::LOAD_ORDERINGS[fastrand::usize(0..test_helper::LOAD_ORDERINGS.len())]
+}
+pub(crate) fn test_load_ordering<T: std::fmt::Debug>(f: impl Fn(Ordering) -> T) {
+    for &order in &test_helper::LOAD_ORDERINGS {
+        f(order);
+    }
+
+    if !skip_should_panic_test() {
+        assert_eq!(
+            assert_panic(|| f(Ordering::Release)),
+            "there is no such thing as a release load"
+        );
+        assert_eq!(
+            assert_panic(|| f(Ordering::AcqRel)),
+            "there is no such thing as an acquire-release load"
+        );
+    }
+}
+pub(crate) fn rand_store_ordering() -> Ordering {
+    test_helper::STORE_ORDERINGS[fastrand::usize(0..test_helper::STORE_ORDERINGS.len())]
+}
+pub(crate) fn test_store_ordering<T: std::fmt::Debug>(f: impl Fn(Ordering) -> T) {
+    for &order in &test_helper::STORE_ORDERINGS {
+        f(order);
+    }
+
+    if !skip_should_panic_test() {
+        assert_eq!(
+            assert_panic(|| f(Ordering::Acquire)),
+            "there is no such thing as an acquire store"
+        );
+        assert_eq!(
+            assert_panic(|| f(Ordering::AcqRel)),
+            "there is no such thing as an acquire-release store"
+        );
+    }
+}
+pub(crate) fn rand_compare_exchange_ordering() -> (Ordering, Ordering) {
+    test_helper::COMPARE_EXCHANGE_ORDERINGS
+        [fastrand::usize(0..test_helper::COMPARE_EXCHANGE_ORDERINGS.len())]
+}
+pub(crate) fn test_compare_exchange_ordering<T: std::fmt::Debug>(
+    f: impl Fn(Ordering, Ordering) -> T,
+) {
+    for &(success, failure) in &test_helper::COMPARE_EXCHANGE_ORDERINGS {
+        f(success, failure);
+    }
+
+    if !skip_should_panic_test() {
+        for &order in &test_helper::SWAP_ORDERINGS {
+            let msg = assert_panic(|| f(order, Ordering::AcqRel));
+            assert!(
+                msg == "there is no such thing as an acquire-release failure ordering"
+                    || msg == "there is no such thing as an acquire-release load",
+                "{}",
+                msg
+            );
+            let msg = assert_panic(|| f(order, Ordering::Release));
+            assert!(
+                msg == "there is no such thing as a release failure ordering"
+                    || msg == "there is no such thing as a release load",
+                "{}",
+                msg
+            );
+        }
+    }
+}
+pub(crate) fn rand_swap_ordering() -> Ordering {
+    test_helper::SWAP_ORDERINGS[fastrand::usize(0..test_helper::SWAP_ORDERINGS.len())]
+}
+pub(crate) fn test_swap_ordering<T: std::fmt::Debug>(f: impl Fn(Ordering) -> T) {
+    for &order in &test_helper::SWAP_ORDERINGS {
+        f(order);
+    }
+}
+// for stress test generated by __test_atomic_* macros
+pub(crate) fn stress_test_config() -> (usize, usize) {
+    let iterations = if cfg!(miri) {
+        50
+    } else if cfg!(debug_assertions) {
+        5_000
+    } else {
+        25_000
+    };
+    let threads = if cfg!(debug_assertions) { 2 } else { fastrand::usize(2..=8) };
+    std::eprintln!("threads={}", threads);
+    (iterations, threads)
+}
+fn skip_should_panic_test() -> bool {
+    // Miri's panic handling is slow
+    // MSAN false positive: https://gist.github.com/taiki-e/dd6269a8ffec46284fdc764a4849f884
+    is_panic_abort()
+        || cfg!(miri)
+        || option_env!("CARGO_PROFILE_RELEASE_LTO").map_or(false, |v| v == "fat")
+            && build_context::SANITIZE.contains("memory")
+}
+
+// For -C panic=abort -Z panic_abort_tests: https://github.com/rust-lang/rust/issues/67650
+fn is_panic_abort() -> bool {
+    build_context::PANIC.contains("abort")
+}
+
+#[repr(C, align(16))]
+pub(crate) struct Align16<T>(pub(crate) T);
+
+// Test the cases that should not fail if the memory ordering is implemented correctly.
+// This is still not exhaustive and only tests a few cases.
+// This currently only supports 32-bit or more integers.
+macro_rules! __stress_test_acquire_release {
+    (should_pass, $int_type:ident, $write:ident, $load_order:ident, $store_order:ident) => {
+        paste::paste! {
+            #[test]
+            #[allow(clippy::cast_possible_truncation)]
+            fn [<load_ $load_order:lower _ $write _ $store_order:lower>]() {
+                __stress_test_acquire_release!([<Atomic $int_type:camel>],
+                    $int_type, $write, $load_order, $store_order);
+            }
+        }
+    };
+    (can_panic, $int_type:ident, $write:ident, $load_order:ident, $store_order:ident) => {
+        paste::paste! {
+            // Currently, to make this test work well enough outside of Miri, tens of thousands
+            // of iterations are needed, but this test is slow in some environments.
+            // So, ignore on non-Miri environments by default. See also catch_unwind_on_weak_memory_arch.
+            #[test]
+            #[cfg_attr(not(miri), ignore)]
+            #[allow(clippy::cast_possible_truncation)]
+            fn [<load_ $load_order:lower _ $write _ $store_order:lower>]() {
+                can_panic("a=", || __stress_test_acquire_release!([<Atomic $int_type:camel>],
+                    $int_type, $write, $load_order, $store_order));
+            }
+        }
+    };
+    ($atomic_type:ident, $int_type:ident, $write:ident, $load_order:ident, $store_order:ident) => {{
+        use super::*;
+        use crossbeam_utils::thread;
+        use std::{
+            convert::TryFrom,
+            sync::atomic::{AtomicUsize, Ordering},
+        };
+        let mut n: usize = if cfg!(miri) { 10 } else { 50_000 };
+        // This test is relatively fast because it spawns only one thread, but
+        // the iterations are limited to a maximum value of integers.
+        if $int_type::try_from(n).is_err() {
+            n = $int_type::MAX as usize;
+        }
+        let a = &$atomic_type::new(0);
+        let b = &AtomicUsize::new(0);
+        thread::scope(|s| {
+            s.spawn(|_| {
+                for i in 0..n {
+                    b.store(i, Ordering::Relaxed);
+                    a.$write(i as $int_type, Ordering::$store_order);
+                }
+            });
+            loop {
+                let a = a.load(Ordering::$load_order);
+                let b = b.load(Ordering::Relaxed);
+                assert!(a as usize <= b, "a={},b={}", a, b);
+                if a as usize == n - 1 {
+                    break;
+                }
+            }
+        })
+        .unwrap();
+    }};
+}
+macro_rules! __stress_test_seqcst {
+    (should_pass, $int_type:ident, $write:ident, $load_order:ident, $store_order:ident) => {
+        paste::paste! {
+            // Currently, to make this test work well enough outside of Miri, tens of thousands
+            // of iterations are needed, but this test is very slow in some environments because
+            // it creates two threads for each iteration.
+            // So, ignore on QEMU by default.
+            #[test]
+            #[cfg_attr(qemu, ignore)]
+            fn [<load_ $load_order:lower _ $write _ $store_order:lower>]() {
+                __stress_test_seqcst!([<Atomic $int_type:camel>],
+                    $write, $load_order, $store_order);
+            }
+        }
+    };
+    (can_panic, $int_type:ident, $write:ident, $load_order:ident, $store_order:ident) => {
+        paste::paste! {
+            // Currently, to make this test work well enough outside of Miri, tens of thousands
+            // of iterations are needed, but this test is very slow in some environments because
+            // it creates two threads for each iteration.
+            // So, ignore on non-Miri environments by default. See also catch_unwind_on_non_seqcst_arch.
+            #[test]
+            #[cfg_attr(not(miri), ignore)]
+            fn [<load_ $load_order:lower _ $write _ $store_order:lower>]() {
+                can_panic("c=2", || __stress_test_seqcst!([<Atomic $int_type:camel>],
+                    $write, $load_order, $store_order));
+            }
+        }
+    };
+    ($atomic_type:ident, $write:ident, $load_order:ident, $store_order:ident) => {{
+        use super::*;
+        use crossbeam_utils::thread;
+        use std::sync::atomic::{AtomicUsize, Ordering};
+        let n: usize = if cfg!(miri) {
+            8
+        } else if cfg!(valgrind)
+            || build_context::SANITIZE.contains("address")
+            || build_context::SANITIZE.contains("memory")
+        {
+            50
+        } else if option_env!("GITHUB_ACTIONS").is_some() && cfg!(not(target_os = "linux")) {
+            // GitHub Actions' macOS and Windows runners are slow.
+            5_000
+        } else {
+            50_000
+        };
+        let a = &$atomic_type::new(0);
+        let b = &$atomic_type::new(0);
+        let c = &AtomicUsize::new(0);
+        let ready = &AtomicUsize::new(0);
+        thread::scope(|s| {
+            for n in 0..n {
+                a.store(0, Ordering::Relaxed);
+                b.store(0, Ordering::Relaxed);
+                c.store(0, Ordering::Relaxed);
+                let h_a = s.spawn(|_| {
+                    while ready.load(Ordering::Relaxed) == 0 {}
+                    a.$write(1, Ordering::$store_order);
+                    if b.load(Ordering::$load_order) == 0 {
+                        c.fetch_add(1, Ordering::Relaxed);
+                    }
+                });
+                let h_b = s.spawn(|_| {
+                    while ready.load(Ordering::Relaxed) == 0 {}
+                    b.$write(1, Ordering::$store_order);
+                    if a.load(Ordering::$load_order) == 0 {
+                        c.fetch_add(1, Ordering::Relaxed);
+                    }
+                });
+                ready.store(1, Ordering::Relaxed);
+                h_a.join().unwrap();
+                h_b.join().unwrap();
+                let c = c.load(Ordering::Relaxed);
+                assert!(c == 0 || c == 1, "c={},n={}", c, n);
+            }
+        })
+        .unwrap();
+    }};
+}
+// Catches unwinding panic on architectures with weak memory models.
+#[allow(dead_code)]
+pub(crate) fn catch_unwind_on_weak_memory_arch(pat: &str, f: impl Fn()) {
+    // With x86 TSO, RISC-V TSO (optional, not default), SPARC TSO (optional, default),
+    // and IBM-370 memory models should never be a panic here.
+    // Miri emulates weak memory models regardless of target architectures.
+    if cfg!(all(
+        any(
+            target_arch = "x86",
+            target_arch = "x86_64",
+            target_arch = "s390x",
+            target_arch = "sparc",
+            target_arch = "sparc64",
+        ),
+        not(any(miri)),
+    )) {
+        f();
+    } else if !is_panic_abort() {
+        // This could be is_err on architectures with weak memory models.
+        // However, this does not necessarily mean that it will always be panic,
+        // and implementing it with stronger orderings is also okay.
+        match std::panic::catch_unwind(std::panic::AssertUnwindSafe(f)) {
+            Ok(()) => {
+                // panic!();
+            }
+            Err(msg) => {
+                let msg = msg
+                    .downcast_ref::<std::string::String>()
+                    .cloned()
+                    .unwrap_or_else(|| msg.downcast_ref::<&'static str>().copied().unwrap().into());
+                assert!(msg.contains(pat), "{}", msg);
+            }
+        }
+    }
+}
+// Catches unwinding panic on architectures with non-sequentially consistent memory models.
+#[allow(dead_code)]
+pub(crate) fn catch_unwind_on_non_seqcst_arch(pat: &str, f: impl Fn()) {
+    if !is_panic_abort() {
+        // This could be Err on architectures with non-sequentially consistent memory models.
+        // However, this does not necessarily mean that it will always be panic,
+        // and implementing it with stronger orderings is also okay.
+        match std::panic::catch_unwind(std::panic::AssertUnwindSafe(f)) {
+            Ok(()) => {
+                // panic!();
+            }
+            Err(msg) => {
+                let msg = msg
+                    .downcast_ref::<std::string::String>()
+                    .cloned()
+                    .unwrap_or_else(|| msg.downcast_ref::<&'static str>().copied().unwrap().into());
+                assert!(msg.contains(pat), "{}", msg);
+            }
+        }
+    }
+}
+macro_rules! stress_test_load_store {
+    ($int_type:ident) => {
+        // debug mode is slow.
+        #[cfg(any(not(debug_assertions), miri))]
+        paste::paste! {
+            #[allow(
+                clippy::alloc_instead_of_core,
+                clippy::std_instead_of_alloc,
+                clippy::std_instead_of_core,
+                clippy::undocumented_unsafe_blocks
+            )]
+            mod [<stress_acquire_release_load_store_ $int_type>] {
+                use crate::tests::helper::catch_unwind_on_weak_memory_arch as can_panic;
+                __stress_test_acquire_release!(can_panic, $int_type, store, Relaxed, Relaxed);
+                __stress_test_acquire_release!(can_panic, $int_type, store, Relaxed, Release);
+                __stress_test_acquire_release!(can_panic, $int_type, store, Relaxed, SeqCst);
+                __stress_test_acquire_release!(can_panic, $int_type, store, Acquire, Relaxed);
+                __stress_test_acquire_release!(should_pass, $int_type, store, Acquire, Release);
+                __stress_test_acquire_release!(should_pass, $int_type, store, Acquire, SeqCst);
+                __stress_test_acquire_release!(can_panic, $int_type, store, SeqCst, Relaxed);
+                __stress_test_acquire_release!(should_pass, $int_type, store, SeqCst, Release);
+                __stress_test_acquire_release!(should_pass, $int_type, store, SeqCst, SeqCst);
+            }
+            #[allow(
+                clippy::alloc_instead_of_core,
+                clippy::std_instead_of_alloc,
+                clippy::std_instead_of_core,
+                clippy::undocumented_unsafe_blocks
+            )]
+            mod [<stress_seqcst_load_store_ $int_type>] {
+                use crate::tests::helper::catch_unwind_on_non_seqcst_arch as can_panic;
+                __stress_test_seqcst!(can_panic, $int_type, store, Relaxed, Relaxed);
+                __stress_test_seqcst!(can_panic, $int_type, store, Relaxed, Release);
+                __stress_test_seqcst!(can_panic, $int_type, store, Relaxed, SeqCst);
+                __stress_test_seqcst!(can_panic, $int_type, store, Acquire, Relaxed);
+                __stress_test_seqcst!(can_panic, $int_type, store, Acquire, Release);
+                __stress_test_seqcst!(can_panic, $int_type, store, Acquire, SeqCst);
+                __stress_test_seqcst!(can_panic, $int_type, store, SeqCst, Relaxed);
+                __stress_test_seqcst!(can_panic, $int_type, store, SeqCst, Release);
+                __stress_test_seqcst!(should_pass, $int_type, store, SeqCst, SeqCst);
+            }
+        }
+    };
+}
+macro_rules! stress_test {
+    ($int_type:ident) => {
+        stress_test_load_store!($int_type);
+        // debug mode is slow.
+        #[cfg(any(not(debug_assertions), miri))]
+        paste::paste! {
+            #[allow(
+                clippy::alloc_instead_of_core,
+                clippy::std_instead_of_alloc,
+                clippy::std_instead_of_core,
+                clippy::undocumented_unsafe_blocks
+            )]
+            mod [<stress_acquire_release_load_swap_ $int_type>] {
+                use crate::tests::helper::catch_unwind_on_weak_memory_arch as can_panic;
+                __stress_test_acquire_release!(can_panic, $int_type, swap, Relaxed, Relaxed);
+                __stress_test_acquire_release!(can_panic, $int_type, swap, Relaxed, Acquire);
+                __stress_test_acquire_release!(can_panic, $int_type, swap, Relaxed, Release);
+                __stress_test_acquire_release!(can_panic, $int_type, swap, Relaxed, AcqRel);
+                __stress_test_acquire_release!(can_panic, $int_type, swap, Relaxed, SeqCst);
+                __stress_test_acquire_release!(can_panic, $int_type, swap, Acquire, Relaxed);
+                __stress_test_acquire_release!(can_panic, $int_type, swap, Acquire, Acquire);
+                __stress_test_acquire_release!(should_pass, $int_type, swap, Acquire, Release);
+                __stress_test_acquire_release!(should_pass, $int_type, swap, Acquire, AcqRel);
+                __stress_test_acquire_release!(should_pass, $int_type, swap, Acquire, SeqCst);
+                __stress_test_acquire_release!(can_panic, $int_type, swap, SeqCst, Relaxed);
+                __stress_test_acquire_release!(can_panic, $int_type, swap, SeqCst, Acquire);
+                __stress_test_acquire_release!(should_pass, $int_type, swap, SeqCst, Release);
+                __stress_test_acquire_release!(should_pass, $int_type, swap, SeqCst, AcqRel);
+                __stress_test_acquire_release!(should_pass, $int_type, swap, SeqCst, SeqCst);
+            }
+            #[allow(
+                clippy::alloc_instead_of_core,
+                clippy::std_instead_of_alloc,
+                clippy::std_instead_of_core,
+                clippy::undocumented_unsafe_blocks
+            )]
+            mod [<stress_seqcst_load_swap_ $int_type>] {
+                use crate::tests::helper::catch_unwind_on_non_seqcst_arch as can_panic;
+                __stress_test_seqcst!(can_panic, $int_type, swap, Relaxed, Relaxed);
+                __stress_test_seqcst!(can_panic, $int_type, swap, Relaxed, Acquire);
+                __stress_test_seqcst!(can_panic, $int_type, swap, Relaxed, Release);
+                __stress_test_seqcst!(can_panic, $int_type, swap, Relaxed, AcqRel);
+                __stress_test_seqcst!(can_panic, $int_type, swap, Relaxed, SeqCst);
+                __stress_test_seqcst!(can_panic, $int_type, swap, Acquire, Relaxed);
+                __stress_test_seqcst!(can_panic, $int_type, swap, Acquire, Acquire);
+                __stress_test_seqcst!(can_panic, $int_type, swap, Acquire, Release);
+                __stress_test_seqcst!(can_panic, $int_type, swap, Acquire, AcqRel);
+                __stress_test_seqcst!(can_panic, $int_type, swap, Acquire, SeqCst);
+                __stress_test_seqcst!(can_panic, $int_type, swap, SeqCst, Relaxed);
+                __stress_test_seqcst!(can_panic, $int_type, swap, SeqCst, Acquire);
+                __stress_test_seqcst!(can_panic, $int_type, swap, SeqCst, Release);
+                __stress_test_seqcst!(can_panic, $int_type, swap, SeqCst, AcqRel);
+                __stress_test_seqcst!(should_pass, $int_type, swap, SeqCst, SeqCst);
+            }
+        }
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/tests/mod.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/tests/mod.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/tests/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/tests/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,358 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+#![allow(
+    clippy::alloc_instead_of_core,
+    clippy::std_instead_of_alloc,
+    clippy::std_instead_of_core,
+    clippy::undocumented_unsafe_blocks,
+    clippy::wildcard_imports
+)]
+
+#[macro_use]
+pub(crate) mod helper;
+
+#[allow(dead_code)]
+#[path = "../../version.rs"]
+mod version;
+
+use super::*;
+
+test_atomic_bool_pub!();
+test_atomic_ptr_pub!();
+
+test_atomic_int_pub!(isize);
+test_atomic_int_pub!(usize);
+test_atomic_int_pub!(i8);
+test_atomic_int_pub!(u8);
+test_atomic_int_pub!(i16);
+test_atomic_int_pub!(u16);
+test_atomic_int_pub!(i32);
+test_atomic_int_pub!(u32);
+test_atomic_int_pub!(i64);
+test_atomic_int_pub!(u64);
+test_atomic_int_pub!(i128);
+test_atomic_int_pub!(u128);
+
+#[cfg(feature = "float")]
+test_atomic_float_pub!(f32);
+#[cfg(feature = "float")]
+test_atomic_float_pub!(f64);
+
+#[deny(improper_ctypes)]
+extern "C" {
+    fn _atomic_bool_ffi_safety(_: AtomicBool);
+    fn _atomic_ptr_ffi_safety(_: AtomicPtr<u8>);
+    fn _atomic_isize_ffi_safety(_: AtomicIsize);
+    fn _atomic_usize_ffi_safety(_: AtomicUsize);
+    fn _atomic_i8_ffi_safety(_: AtomicI8);
+    fn _atomic_u8_ffi_safety(_: AtomicU8);
+    fn _atomic_i16_ffi_safety(_: AtomicI16);
+    fn _atomic_u16_ffi_safety(_: AtomicU16);
+    fn _atomic_i32_ffi_safety(_: AtomicI32);
+    fn _atomic_u32_ffi_safety(_: AtomicU32);
+    fn _atomic_i64_ffi_safety(_: AtomicI64);
+    fn _atomic_u64_ffi_safety(_: AtomicU64);
+    // TODO: 128-bit integers are not FFI safe
+    // https://github.com/rust-lang/unsafe-code-guidelines/issues/119
+    // https://github.com/rust-lang/rust/issues/54341
+    // fn _atomic_i128_ffi_safety(_: AtomicI128);
+    // fn _atomic_u128_ffi_safety(_: AtomicU128);
+    #[cfg(feature = "float")]
+    fn _atomic_f32_ffi_safety(_: AtomicF32);
+    #[cfg(feature = "float")]
+    fn _atomic_f64_ffi_safety(_: AtomicF64);
+}
+
+#[test]
+fn test_is_lock_free() {
+    assert!(AtomicI8::is_always_lock_free());
+    assert!(AtomicI8::is_lock_free());
+    assert!(AtomicU8::is_always_lock_free());
+    assert!(AtomicU8::is_lock_free());
+    assert!(AtomicI16::is_always_lock_free());
+    assert!(AtomicI16::is_lock_free());
+    assert!(AtomicU16::is_always_lock_free());
+    assert!(AtomicU16::is_lock_free());
+    assert!(AtomicI32::is_always_lock_free());
+    assert!(AtomicI32::is_lock_free());
+    assert!(AtomicU32::is_always_lock_free());
+    assert!(AtomicU32::is_lock_free());
+    #[cfg(not(portable_atomic_no_cfg_target_has_atomic))]
+    {
+        if cfg!(all(
+            feature = "fallback",
+            target_arch = "arm",
+            not(any(miri, portable_atomic_sanitize_thread)),
+            not(portable_atomic_no_asm),
+            any(target_os = "linux", target_os = "android"),
+            not(any(target_feature = "v6", portable_atomic_target_feature = "v6")),
+            not(portable_atomic_no_outline_atomics),
+            not(target_has_atomic = "64"),
+            not(portable_atomic_test_outline_atomics_detect_false),
+        )) {
+            assert!(!AtomicI64::is_always_lock_free());
+            assert!(AtomicI64::is_lock_free());
+            assert!(!AtomicU64::is_always_lock_free());
+            assert!(AtomicU64::is_lock_free());
+        } else if cfg!(target_has_atomic = "64") {
+            assert!(AtomicI64::is_always_lock_free());
+            assert!(AtomicI64::is_lock_free());
+            assert!(AtomicU64::is_always_lock_free());
+            assert!(AtomicU64::is_lock_free());
+        } else {
+            assert!(!AtomicI64::is_always_lock_free());
+            assert!(!AtomicI64::is_lock_free());
+            assert!(!AtomicU64::is_always_lock_free());
+            assert!(!AtomicU64::is_lock_free());
+        }
+    }
+    if cfg!(portable_atomic_no_asm) && cfg!(not(portable_atomic_unstable_asm)) {
+        assert!(!AtomicI128::is_always_lock_free());
+        assert!(!AtomicI128::is_lock_free());
+        assert!(!AtomicU128::is_always_lock_free());
+        assert!(!AtomicU128::is_lock_free());
+    } else if cfg!(any(
+        target_arch = "aarch64",
+        all(
+            target_arch = "x86_64",
+            any(target_feature = "cmpxchg16b", portable_atomic_target_feature = "cmpxchg16b"),
+        ),
+        all(
+            target_arch = "powerpc64",
+            portable_atomic_unstable_asm_experimental_arch,
+            any(
+                target_feature = "quadword-atomics",
+                portable_atomic_target_feature = "quadword-atomics",
+            ),
+        ),
+        all(target_arch = "s390x", portable_atomic_unstable_asm_experimental_arch),
+    )) {
+        assert!(AtomicI128::is_always_lock_free());
+        assert!(AtomicI128::is_lock_free());
+        assert!(AtomicU128::is_always_lock_free());
+        assert!(AtomicU128::is_lock_free());
+    } else {
+        assert!(!AtomicI128::is_always_lock_free());
+        assert!(!AtomicU128::is_always_lock_free());
+        #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64")))]
+        {
+            assert!(!AtomicI128::is_lock_free());
+            assert!(!AtomicU128::is_lock_free());
+        }
+        #[cfg(target_arch = "x86_64")]
+        {
+            let has_cmpxchg16b = cfg!(all(
+                feature = "fallback",
+                not(portable_atomic_no_outline_atomics),
+                not(any(target_env = "sgx", miri)),
+                not(portable_atomic_test_outline_atomics_detect_false),
+            )) && std::is_x86_feature_detected!("cmpxchg16b");
+            assert_eq!(AtomicI128::is_lock_free(), has_cmpxchg16b);
+            assert_eq!(AtomicU128::is_lock_free(), has_cmpxchg16b);
+        }
+        #[cfg(target_arch = "powerpc64")]
+        {
+            // TODO(powerpc64): is_powerpc_feature_detected is unstable
+        }
+    }
+}
+
+// test version parsing code used in the build script.
+#[test]
+fn test_rustc_version() {
+    use version::Version;
+
+    // rustc 1.34 (rustup)
+    let v = Version::parse(
+        "rustc 1.34.2 (6c2484dc3 2019-05-13)
+binary: rustc
+commit-hash: 6c2484dc3c532c052f159264e970278d8b77cdc9
+commit-date: 2019-05-13
+host: x86_64-apple-darwin
+release: 1.34.2
+LLVM version: 8.0",
+    )
+    .unwrap();
+    assert_eq!(v, Version::stable(34, 8));
+
+    // rustc 1.67 (rustup)
+    let v = Version::parse(
+        "rustc 1.67.0 (fc594f156 2023-01-24)
+binary: rustc
+commit-hash: fc594f15669680fa70d255faec3ca3fb507c3405
+commit-date: 2023-01-24
+host: aarch64-apple-darwin
+release: 1.67.0
+LLVM version: 15.0.6",
+    )
+    .unwrap();
+    assert_eq!(v, Version::stable(67, 15));
+
+    // rustc 1.68-beta (rustup)
+    let v = Version::parse(
+        "rustc 1.68.0-beta.2 (10b73bf73 2023-02-01)
+binary: rustc
+commit-hash: 10b73bf73a6b770cd92ad8ff538173bc3298411c
+commit-date: 2023-02-01
+host: aarch64-apple-darwin
+release: 1.68.0-beta.2
+LLVM version: 15.0.6",
+    )
+    .unwrap();
+    // We do not distinguish between stable and beta because we are only
+    // interested in whether unstable features are potentially available.
+    assert_eq!(v, Version::stable(68, 15));
+
+    // rustc nightly-2019-01-27 (rustup)
+    let v = Version::parse(
+        "rustc 1.33.0-nightly (20c2cba61 2019-01-26)
+binary: rustc
+commit-hash: 20c2cba61dc83e612d25ed496025171caa3db30f
+commit-date: 2019-01-26
+host: x86_64-apple-darwin
+release: 1.33.0-nightly
+LLVM version: 8.0",
+    )
+    .unwrap();
+    assert_eq!(v.minor, 33);
+    assert!(v.nightly);
+    assert_eq!(v.llvm, 8);
+    assert_eq!(v.commit_date().year, 2019);
+    assert_eq!(v.commit_date().month, 1);
+    assert_eq!(v.commit_date().day, 26);
+
+    // rustc 1.69-nightly (rustup)
+    let v = Version::parse(
+        "rustc 1.69.0-nightly (bd39bbb4b 2023-02-07)
+binary: rustc
+commit-hash: bd39bbb4bb92df439bf6d85470e296cc6a47ffbd
+commit-date: 2023-02-07
+host: aarch64-apple-darwin
+release: 1.69.0-nightly
+LLVM version: 15.0.7",
+    )
+    .unwrap();
+    assert_eq!(v.minor, 69);
+    assert!(v.nightly);
+    assert_eq!(v.llvm, 15);
+    assert_eq!(v.commit_date().year, 2023);
+    assert_eq!(v.commit_date().month, 2);
+    assert_eq!(v.commit_date().day, 7);
+
+    // clippy-driver 1.69-nightly (rustup)
+    let v = Version::parse(
+        "rustc 1.69.0-nightly (bd39bbb4b 2023-02-07)
+binary: rustc
+commit-hash: bd39bbb4bb92df439bf6d85470e296cc6a47ffbd
+commit-date: 2023-02-07
+host: aarch64-apple-darwin
+release: 1.69.0-nightly
+LLVM version: 15.0.7",
+    )
+    .unwrap();
+    assert_eq!(v.minor, 69);
+    assert!(v.nightly);
+    assert_eq!(v.llvm, 15);
+    assert_eq!(v.commit_date().year, 2023);
+    assert_eq!(v.commit_date().month, 2);
+    assert_eq!(v.commit_date().day, 7);
+
+    // rustc 1.69-dev (from source: ./x.py build)
+    let v = Version::parse(
+        "rustc 1.69.0-dev
+binary: rustc
+commit-hash: unknown
+commit-date: unknown
+host: aarch64-unknown-linux-gnu
+release: 1.69.0-dev
+LLVM version: 16.0.0",
+    )
+    .unwrap();
+    assert_eq!(v.minor, 69);
+    assert!(v.nightly);
+    assert_eq!(v.llvm, 16);
+    assert_eq!(v.commit_date().year, 0);
+    assert_eq!(v.commit_date().month, 0);
+    assert_eq!(v.commit_date().day, 0);
+
+    // rustc 1.64 (debian 11: apt-get install cargo)
+    let v = Version::parse(
+        "rustc 1.48.0
+binary: rustc
+commit-hash: unknown
+commit-date: unknown
+host: aarch64-unknown-linux-gnu
+release: 1.48.0
+LLVM version: 11.0",
+    )
+    .unwrap();
+    assert_eq!(v, Version::stable(48, 11));
+
+    // rustc 1.67 (fedora: dnf install cargo)
+    let v = Version::parse(
+        "rustc 1.67.0 (fc594f156 2023-01-24) (Fedora 1.67.0-2.fc37)
+binary: rustc
+commit-hash: fc594f15669680fa70d255faec3ca3fb507c3405
+commit-date: 2023-01-24
+host: aarch64-unknown-linux-gnu
+release: 1.67.0
+LLVM version: 15.0.7",
+    )
+    .unwrap();
+    assert_eq!(v, Version::stable(67, 15));
+
+    // rustc 1.64 (alpine: apk add cargo)
+    let v = Version::parse(
+        "rustc 1.64.0
+binary: rustc
+commit-hash: unknown
+commit-date: unknown
+host: aarch64-alpine-linux-musl
+release: 1.64.0
+LLVM version: 15.0.3",
+    )
+    .unwrap();
+    assert_eq!(v, Version::stable(64, 15));
+}
+
+#[cfg(feature = "serde")]
+#[allow(clippy::as_underscore)]
+#[test]
+fn test_serde() {
+    use test_helper::serde::{assert_tokens, DebugPartialEq, Token};
+
+    macro_rules! t {
+        ($atomic_type:ty, $value_type:ident, $token_type:ident) => {
+            std::eprint!("test_serde {} ... ", stringify!($value_type));
+            assert_tokens(&DebugPartialEq(<$atomic_type>::new($value_type::MAX)), &[
+                Token::$token_type($value_type::MAX as _),
+            ]);
+            assert_tokens(&DebugPartialEq(<$atomic_type>::new($value_type::MIN)), &[
+                Token::$token_type($value_type::MIN as _),
+            ]);
+            std::eprintln!("ok");
+        };
+    }
+
+    assert_tokens(&DebugPartialEq(AtomicBool::new(true)), &[Token::Bool(true)]);
+    assert_tokens(&DebugPartialEq(AtomicBool::new(false)), &[Token::Bool(false)]);
+    t!(AtomicIsize, isize, I64);
+    t!(AtomicUsize, usize, U64);
+    t!(AtomicI8, i8, I8);
+    t!(AtomicU8, u8, U8);
+    t!(AtomicI16, i16, I16);
+    t!(AtomicU16, u16, U16);
+    t!(AtomicI32, i32, I32);
+    t!(AtomicU32, u32, U32);
+    t!(AtomicI64, i64, I64);
+    t!(AtomicU64, u64, U64);
+    // TODO: serde_test doesn't support Token::{I128,U128}: https://github.com/serde-rs/test/pull/6
+    // t!(AtomicI128, i128, I128);
+    // t!(AtomicU128, u128, U128);
+    #[cfg(feature = "float")]
+    t!(AtomicF32, f32, F32);
+    #[cfg(feature = "float")]
+    // TODO: fixed in LLVM 18?
+    #[cfg(not(target_arch = "mips"))] // LLVM 17 (nightly-2023-08-09) bug: assertion failed at core/src/num/diy_float.rs:78:9
+    t!(AtomicF64, f64, F64);
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/src/utils.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/utils.rs
--- 43.0.0-1/rust-vendor/portable-atomic/src/utils.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/src/utils.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,452 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+#![cfg_attr(not(all(test, feature = "float")), allow(dead_code, unused_macros))]
+
+#[macro_use]
+#[path = "gen/utils.rs"]
+mod gen;
+
+use core::sync::atomic::Ordering;
+
+macro_rules! static_assert {
+    ($cond:expr $(,)?) => {{
+        let [] = [(); true as usize - $crate::utils::_assert_is_bool($cond) as usize];
+    }};
+}
+pub(crate) const fn _assert_is_bool(v: bool) -> bool {
+    v
+}
+
+macro_rules! static_assert_layout {
+    ($atomic_type:ty, $value_type:ty) => {
+        static_assert!(
+            core::mem::align_of::<$atomic_type>() == core::mem::size_of::<$atomic_type>()
+        );
+        static_assert!(core::mem::size_of::<$atomic_type>() == core::mem::size_of::<$value_type>());
+    };
+}
+
+// #[doc = concat!(...)] requires Rust 1.54
+macro_rules! doc_comment {
+    ($doc:expr, $($tt:tt)*) => {
+        #[doc = $doc]
+        $($tt)*
+    };
+}
+
+// Adapted from https://github.com/BurntSushi/memchr/blob/2.4.1/src/memchr/x86/mod.rs#L9-L71.
+/// # Safety
+///
+/// - the caller must uphold the safety contract for the function returned by $detect_body.
+/// - the memory pointed by the function pointer returned by $detect_body must be visible from any threads.
+///
+/// The second requirement is always met if the function pointer is to the function definition.
+/// (Currently, all uses of this macro in our code are in this case.)
+#[allow(unused_macros)]
+#[cfg(not(portable_atomic_no_outline_atomics))]
+#[cfg(any(
+    target_arch = "aarch64",
+    target_arch = "arm",
+    target_arch = "powerpc64",
+    all(target_arch = "x86_64", not(any(target_env = "sgx", miri))),
+))]
+macro_rules! ifunc {
+    (unsafe fn($($arg_pat:ident: $arg_ty:ty),*) $(-> $ret_ty:ty)? { $($detect_body:tt)* }) => {{
+        type FnTy = unsafe fn($($arg_ty),*) $(-> $ret_ty)?;
+        static FUNC: core::sync::atomic::AtomicPtr<()>
+            = core::sync::atomic::AtomicPtr::new(detect as *mut ());
+        #[cold]
+        unsafe fn detect($($arg_pat: $arg_ty),*) $(-> $ret_ty)? {
+            let func: FnTy = { $($detect_body)* };
+            FUNC.store(func as *mut (), core::sync::atomic::Ordering::Relaxed);
+            // SAFETY: the caller must uphold the safety contract for the function returned by $detect_body.
+            unsafe { func($($arg_pat),*) }
+        }
+        // SAFETY: `FnTy` is a function pointer, which is always safe to transmute with a `*mut ()`.
+        // (To force the caller to use unsafe block for this macro, do not use
+        // unsafe block here.)
+        let func = {
+            core::mem::transmute::<*mut (), FnTy>(FUNC.load(core::sync::atomic::Ordering::Relaxed))
+        };
+        // SAFETY: the caller must uphold the safety contract for the function returned by $detect_body.
+        // (To force the caller to use unsafe block for this macro, do not use
+        // unsafe block here.)
+        func($($arg_pat),*)
+    }};
+}
+
+#[allow(unused_macros)]
+#[cfg(not(portable_atomic_no_outline_atomics))]
+#[cfg(any(
+    target_arch = "aarch64",
+    target_arch = "arm",
+    target_arch = "powerpc64",
+    all(target_arch = "x86_64", not(any(target_env = "sgx", miri))),
+))]
+macro_rules! fn_alias {
+    (
+        $(#[$($fn_attr:tt)*])*
+        $vis:vis unsafe fn($($arg_pat:ident: $arg_ty:ty),*) $(-> $ret_ty:ty)?;
+        $(#[$($alias_attr:tt)*])*
+        $new:ident = $from:ident($($last_args:tt)*);
+        $($rest:tt)*
+    ) => {
+        $(#[$($fn_attr)*])*
+        $(#[$($alias_attr)*])*
+        $vis unsafe fn $new($($arg_pat: $arg_ty),*) $(-> $ret_ty)? {
+            // SAFETY: the caller must uphold the safety contract.
+            unsafe { $from($($arg_pat,)* $($last_args)*) }
+        }
+        fn_alias! {
+            $(#[$($fn_attr)*])*
+            $vis unsafe fn($($arg_pat: $arg_ty),*) $(-> $ret_ty)?;
+            $($rest)*
+        }
+    };
+    (
+        $(#[$($attr:tt)*])*
+        $vis:vis unsafe fn($($arg_pat:ident: $arg_ty:ty),*) $(-> $ret_ty:ty)?;
+    ) => {}
+}
+
+/// Make the given function const if the given condition is true.
+macro_rules! const_fn {
+    (
+        const_if: #[cfg($($cfg:tt)+)];
+        $(#[$($attr:tt)*])*
+        $vis:vis const fn $($rest:tt)*
+    ) => {
+        #[cfg($($cfg)+)]
+        $(#[$($attr)*])*
+        $vis const fn $($rest)*
+        #[cfg(not($($cfg)+))]
+        $(#[$($attr)*])*
+        $vis fn $($rest)*
+    };
+}
+
+/// Implements `core::fmt::Debug` and `serde::{Serialize, Deserialize}` (when serde
+/// feature is enabled) for atomic bool, integer, or float.
+macro_rules! impl_debug_and_serde {
+    ($atomic_type:ident) => {
+        impl fmt::Debug for $atomic_type {
+            #[inline] // fmt is not hot path, but #[inline] on fmt seems to still be useful: https://github.com/rust-lang/rust/pull/117727
+            fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+                // std atomic types use Relaxed in Debug::fmt: https://github.com/rust-lang/rust/blob/1.70.0/library/core/src/sync/atomic.rs#L2024
+                fmt::Debug::fmt(&self.load(Ordering::Relaxed), f)
+            }
+        }
+        #[cfg(feature = "serde")]
+        #[cfg_attr(docsrs, doc(cfg(feature = "serde")))]
+        impl serde::ser::Serialize for $atomic_type {
+            #[allow(clippy::missing_inline_in_public_items)] // serde doesn't use inline on std atomic's Serialize/Deserialize impl
+            fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+            where
+                S: serde::ser::Serializer,
+            {
+                // https://github.com/serde-rs/serde/blob/v1.0.152/serde/src/ser/impls.rs#L958-L959
+                self.load(Ordering::Relaxed).serialize(serializer)
+            }
+        }
+        #[cfg(feature = "serde")]
+        #[cfg_attr(docsrs, doc(cfg(feature = "serde")))]
+        impl<'de> serde::de::Deserialize<'de> for $atomic_type {
+            #[allow(clippy::missing_inline_in_public_items)] // serde doesn't use inline on std atomic's Serialize/Deserialize impl
+            fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+            where
+                D: serde::de::Deserializer<'de>,
+            {
+                serde::de::Deserialize::deserialize(deserializer).map(Self::new)
+            }
+        }
+    };
+}
+
+// We do not provide `nand` because it cannot be optimized on neither x86 nor MSP430.
+// https://godbolt.org/z/ahWejchbT
+macro_rules! impl_default_no_fetch_ops {
+    ($atomic_type:ident, bool) => {
+        impl $atomic_type {
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn and(&self, val: bool, order: Ordering) {
+                self.fetch_and(val, order);
+            }
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn or(&self, val: bool, order: Ordering) {
+                self.fetch_or(val, order);
+            }
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn xor(&self, val: bool, order: Ordering) {
+                self.fetch_xor(val, order);
+            }
+        }
+    };
+    ($atomic_type:ident, $int_type:ident) => {
+        impl $atomic_type {
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn add(&self, val: $int_type, order: Ordering) {
+                self.fetch_add(val, order);
+            }
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn sub(&self, val: $int_type, order: Ordering) {
+                self.fetch_sub(val, order);
+            }
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn and(&self, val: $int_type, order: Ordering) {
+                self.fetch_and(val, order);
+            }
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn or(&self, val: $int_type, order: Ordering) {
+                self.fetch_or(val, order);
+            }
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn xor(&self, val: $int_type, order: Ordering) {
+                self.fetch_xor(val, order);
+            }
+        }
+    };
+}
+macro_rules! impl_default_bit_opts {
+    ($atomic_type:ident, $int_type:ident) => {
+        impl $atomic_type {
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn bit_set(&self, bit: u32, order: Ordering) -> bool {
+                let mask = <$int_type>::wrapping_shl(1, bit);
+                self.fetch_or(mask, order) & mask != 0
+            }
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn bit_clear(&self, bit: u32, order: Ordering) -> bool {
+                let mask = <$int_type>::wrapping_shl(1, bit);
+                self.fetch_and(!mask, order) & mask != 0
+            }
+            #[inline]
+            #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+            pub(crate) fn bit_toggle(&self, bit: u32, order: Ordering) -> bool {
+                let mask = <$int_type>::wrapping_shl(1, bit);
+                self.fetch_xor(mask, order) & mask != 0
+            }
+        }
+    };
+}
+
+// This just outputs the input as is, but can be used like an item-level block by using it with cfg.
+macro_rules! items {
+    ($($tt:tt)*) => {
+        $($tt)*
+    };
+}
+
+#[allow(dead_code)]
+#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
+// Stable version of https://doc.rust-lang.org/nightly/std/hint/fn.assert_unchecked.html.
+// TODO: use real core::hint::assert_unchecked on 1.81+ https://github.com/rust-lang/rust/pull/123588
+#[inline(always)]
+#[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+pub(crate) unsafe fn assert_unchecked(cond: bool) {
+    if !cond {
+        if cfg!(debug_assertions) {
+            unreachable!()
+        } else {
+            // SAFETY: the caller promised `cond` is true.
+            unsafe { core::hint::unreachable_unchecked() }
+        }
+    }
+}
+
+// https://github.com/rust-lang/rust/blob/1.70.0/library/core/src/sync/atomic.rs#L3155
+#[inline]
+#[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+pub(crate) fn assert_load_ordering(order: Ordering) {
+    match order {
+        Ordering::Acquire | Ordering::Relaxed | Ordering::SeqCst => {}
+        Ordering::Release => panic!("there is no such thing as a release load"),
+        Ordering::AcqRel => panic!("there is no such thing as an acquire-release load"),
+        _ => unreachable!(),
+    }
+}
+
+// https://github.com/rust-lang/rust/blob/1.70.0/library/core/src/sync/atomic.rs#L3140
+#[inline]
+#[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+pub(crate) fn assert_store_ordering(order: Ordering) {
+    match order {
+        Ordering::Release | Ordering::Relaxed | Ordering::SeqCst => {}
+        Ordering::Acquire => panic!("there is no such thing as an acquire store"),
+        Ordering::AcqRel => panic!("there is no such thing as an acquire-release store"),
+        _ => unreachable!(),
+    }
+}
+
+// https://github.com/rust-lang/rust/blob/1.70.0/library/core/src/sync/atomic.rs#L3221
+#[inline]
+#[cfg_attr(all(debug_assertions, not(portable_atomic_no_track_caller)), track_caller)]
+pub(crate) fn assert_compare_exchange_ordering(success: Ordering, failure: Ordering) {
+    match success {
+        Ordering::AcqRel
+        | Ordering::Acquire
+        | Ordering::Relaxed
+        | Ordering::Release
+        | Ordering::SeqCst => {}
+        _ => unreachable!(),
+    }
+    match failure {
+        Ordering::Acquire | Ordering::Relaxed | Ordering::SeqCst => {}
+        Ordering::Release => panic!("there is no such thing as a release failure ordering"),
+        Ordering::AcqRel => panic!("there is no such thing as an acquire-release failure ordering"),
+        _ => unreachable!(),
+    }
+}
+
+// https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0418r2.html
+// https://github.com/rust-lang/rust/pull/98383
+#[allow(dead_code)]
+#[inline]
+pub(crate) fn upgrade_success_ordering(success: Ordering, failure: Ordering) -> Ordering {
+    match (success, failure) {
+        (Ordering::Relaxed, Ordering::Acquire) => Ordering::Acquire,
+        (Ordering::Release, Ordering::Acquire) => Ordering::AcqRel,
+        (_, Ordering::SeqCst) => Ordering::SeqCst,
+        _ => success,
+    }
+}
+
+/// Zero-extends the given 32-bit pointer to `MaybeUninit<u64>`.
+/// This is used for 64-bit architecture's 32-bit ABI (e.g., AArch64 ILP32 ABI).
+/// See ptr_reg! macro in src/gen/utils.rs for details.
+#[cfg(not(portable_atomic_no_asm_maybe_uninit))]
+#[cfg(target_pointer_width = "32")]
+#[allow(dead_code)]
+#[inline]
+pub(crate) fn zero_extend64_ptr(v: *mut ()) -> core::mem::MaybeUninit<u64> {
+    #[repr(C)]
+    struct ZeroExtended {
+        #[cfg(target_endian = "big")]
+        pad: *mut (),
+        v: *mut (),
+        #[cfg(target_endian = "little")]
+        pad: *mut (),
+    }
+    // SAFETY: we can safely transmute any 64-bit value to MaybeUninit<u64>.
+    unsafe { core::mem::transmute(ZeroExtended { v, pad: core::ptr::null_mut() }) }
+}
+
+#[allow(dead_code)]
+#[cfg(any(
+    target_arch = "aarch64",
+    target_arch = "powerpc64",
+    target_arch = "s390x",
+    target_arch = "x86_64",
+))]
+/// A 128-bit value represented as a pair of 64-bit values.
+///
+/// This type is `#[repr(C)]`, both fields have the same in-memory representation
+/// and are plain old data types, so access to the fields is always safe.
+#[derive(Clone, Copy)]
+#[repr(C)]
+pub(crate) union U128 {
+    pub(crate) whole: u128,
+    pub(crate) pair: Pair<u64>,
+}
+#[allow(dead_code)]
+#[cfg(target_arch = "arm")]
+/// A 64-bit value represented as a pair of 32-bit values.
+///
+/// This type is `#[repr(C)]`, both fields have the same in-memory representation
+/// and are plain old data types, so access to the fields is always safe.
+#[derive(Clone, Copy)]
+#[repr(C)]
+pub(crate) union U64 {
+    pub(crate) whole: u64,
+    pub(crate) pair: Pair<u32>,
+}
+#[allow(dead_code)]
+#[derive(Clone, Copy)]
+#[repr(C)]
+pub(crate) struct Pair<T: Copy> {
+    // little endian order
+    #[cfg(any(target_endian = "little", target_arch = "aarch64", target_arch = "arm"))]
+    pub(crate) lo: T,
+    pub(crate) hi: T,
+    // big endian order
+    #[cfg(not(any(target_endian = "little", target_arch = "aarch64", target_arch = "arm")))]
+    pub(crate) lo: T,
+}
+
+#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
+type MinWord = u32;
+#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
+type RetInt = u32;
+// Adapted from https://github.com/taiki-e/atomic-maybe-uninit/blob/v0.3.0/src/utils.rs#L210.
+// Helper for implementing sub-word atomic operations using word-sized LL/SC loop or CAS loop.
+//
+// Refs: https://github.com/llvm/llvm-project/blob/llvmorg-18.1.2/llvm/lib/CodeGen/AtomicExpandPass.cpp#L691
+// (aligned_ptr, shift, mask)
+#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
+#[allow(dead_code)]
+#[inline]
+pub(crate) fn create_sub_word_mask_values<T>(ptr: *mut T) -> (*mut MinWord, RetInt, RetInt) {
+    use core::mem;
+    const SHIFT_MASK: bool = !cfg!(any(
+        target_arch = "riscv32",
+        target_arch = "riscv64",
+        target_arch = "loongarch64",
+        target_arch = "s390x",
+    ));
+    let ptr_mask = mem::size_of::<MinWord>() - 1;
+    let aligned_ptr = strict::with_addr(ptr, ptr as usize & !ptr_mask) as *mut MinWord;
+    let ptr_lsb = if SHIFT_MASK {
+        ptr as usize & ptr_mask
+    } else {
+        // We use 32-bit wrapping shift instructions in asm on these platforms.
+        ptr as usize
+    };
+    let shift = if cfg!(any(target_endian = "little", target_arch = "s390x")) {
+        ptr_lsb.wrapping_mul(8)
+    } else {
+        (ptr_lsb ^ (mem::size_of::<MinWord>() - mem::size_of::<T>())).wrapping_mul(8)
+    };
+    let mut mask: RetInt = (1 << (mem::size_of::<T>() * 8)) - 1; // !(0 as T) as RetInt
+    if SHIFT_MASK {
+        mask <<= shift;
+    }
+    (aligned_ptr, shift as RetInt, mask)
+}
+
+/// Emulate strict provenance.
+///
+/// Once strict_provenance is stable, migrate to the standard library's APIs.
+#[cfg(any(miri, target_arch = "riscv32", target_arch = "riscv64"))]
+#[allow(dead_code)]
+pub(crate) mod strict {
+    /// Replace the address portion of this pointer with a new address.
+    #[inline]
+    #[must_use]
+    pub(crate) fn with_addr<T>(ptr: *mut T, addr: usize) -> *mut T {
+        // FIXME(strict_provenance_magic): I am magic and should be a compiler intrinsic.
+        //
+        // In the mean-time, this operation is defined to be "as if" it was
+        // a wrapping_add, so we can emulate it as such. This should properly
+        // restore pointer provenance even under today's compiler.
+        let offset = addr.wrapping_sub(ptr as usize);
+
+        // This is the canonical desugaring of this operation.
+        (ptr as *mut u8).wrapping_add(offset) as *mut T
+    }
+
+    /// Run an operation of some kind on a pointer.
+    #[inline]
+    #[must_use]
+    pub(crate) fn map_addr<T>(ptr: *mut T, f: impl FnOnce(usize) -> usize) -> *mut T {
+        with_addr(ptr, f(ptr as usize))
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/portable-atomic/version.rs 43.0.0-1ubuntu1/rust-vendor/portable-atomic/version.rs
--- 43.0.0-1/rust-vendor/portable-atomic/version.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/portable-atomic/version.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,131 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+use std::{env, iter, process::Command, str};
+
+pub(crate) fn rustc_version() -> Option<Version> {
+    let rustc = env::var_os("RUSTC")?;
+    let rustc_wrapper = if env::var_os("CARGO_ENCODED_RUSTFLAGS").is_some() {
+        env::var_os("RUSTC_WRAPPER").filter(|v| !v.is_empty())
+    } else {
+        // Cargo sets environment variables for wrappers correctly only since https://github.com/rust-lang/cargo/pull/9601.
+        None
+    };
+    // Do not apply RUSTC_WORKSPACE_WRAPPER: https://github.com/cuviper/autocfg/issues/58#issuecomment-2067625980
+    let mut rustc = rustc_wrapper.into_iter().chain(iter::once(rustc));
+    let mut cmd = Command::new(rustc.next().unwrap());
+    cmd.args(rustc);
+    // Use verbose version output because the packagers add extra strings to the normal version output.
+    // Do not use long flags (--version --verbose) because clippy-deriver doesn't handle them properly.
+    // -vV is also matched with that cargo internally uses: https://github.com/rust-lang/cargo/blob/14b46ecc62aa671d7477beba237ad9c6a209cf5d/src/cargo/util/rustc.rs#L65
+    let output = cmd.arg("-vV").output().ok()?;
+    let verbose_version = str::from_utf8(&output.stdout).ok()?;
+    Version::parse(verbose_version)
+}
+
+#[cfg_attr(test, derive(Debug, PartialEq))]
+pub(crate) struct Version {
+    pub(crate) minor: u32,
+    pub(crate) nightly: bool,
+    commit_date: Date,
+    pub(crate) llvm: u32,
+}
+
+impl Version {
+    // The known latest stable version. If we unable to determine
+    // the rustc version, we assume this is the current version.
+    // It is no problem if this is older than the actual latest stable.
+    // LLVM version is assumed to be the minimum external LLVM version:
+    // https://github.com/rust-lang/rust/blob/1.79.0/src/bootstrap/src/core/build_steps/llvm.rs#L589
+    pub(crate) const LATEST: Self = Self::stable(79, 17);
+
+    pub(crate) const fn stable(rustc_minor: u32, llvm_major: u32) -> Self {
+        Self { minor: rustc_minor, nightly: false, commit_date: Date::UNKNOWN, llvm: llvm_major }
+    }
+
+    pub(crate) fn probe(&self, minor: u32, year: u16, month: u8, day: u8) -> bool {
+        if self.nightly {
+            self.minor > minor
+                || self.minor == minor && self.commit_date >= Date::new(year, month, day)
+        } else {
+            self.minor >= minor
+        }
+    }
+
+    #[cfg(test)]
+    pub(crate) fn commit_date(&self) -> &Date {
+        &self.commit_date
+    }
+
+    pub(crate) fn parse(verbose_version: &str) -> Option<Self> {
+        let mut release = verbose_version
+            .lines()
+            .find(|line| line.starts_with("release: "))
+            .map(|line| &line["release: ".len()..])?
+            .splitn(2, '-');
+        let version = release.next().unwrap();
+        let channel = release.next().unwrap_or_default();
+        let mut digits = version.splitn(3, '.');
+        let major = digits.next()?;
+        if major != "1" {
+            return None;
+        }
+        let minor = digits.next()?.parse::<u32>().ok()?;
+        let _patch = digits.next().unwrap_or("0").parse::<u32>().ok()?;
+        let nightly = channel == "nightly" || channel == "dev";
+
+        let llvm_major = (|| {
+            let version = verbose_version
+                .lines()
+                .find(|line| line.starts_with("LLVM version: "))
+                .map(|line| &line["LLVM version: ".len()..])?;
+            let mut digits = version.splitn(3, '.');
+            let major = digits.next()?.parse::<u32>().ok()?;
+            let _minor = digits.next()?.parse::<u32>().ok()?;
+            let _patch = digits.next().unwrap_or("0").parse::<u32>().ok()?;
+            Some(major)
+        })()
+        .unwrap_or(0);
+
+        // we don't refer commit date on stable/beta.
+        if nightly {
+            let commit_date = (|| {
+                let mut commit_date = verbose_version
+                    .lines()
+                    .find(|line| line.starts_with("commit-date: "))
+                    .map(|line| &line["commit-date: ".len()..])?
+                    .splitn(3, '-');
+                let year = commit_date.next()?.parse::<u16>().ok()?;
+                let month = commit_date.next()?.parse::<u8>().ok()?;
+                let day = commit_date.next()?.parse::<u8>().ok()?;
+                if month > 12 || day > 31 {
+                    return None;
+                }
+                Some(Date::new(year, month, day))
+            })();
+            Some(Self {
+                minor,
+                nightly,
+                commit_date: commit_date.unwrap_or(Date::UNKNOWN),
+                llvm: llvm_major,
+            })
+        } else {
+            Some(Self::stable(minor, llvm_major))
+        }
+    }
+}
+
+#[derive(PartialEq, PartialOrd)]
+#[cfg_attr(test, derive(Debug))]
+pub(crate) struct Date {
+    pub(crate) year: u16,
+    pub(crate) month: u8,
+    pub(crate) day: u8,
+}
+
+impl Date {
+    const UNKNOWN: Self = Self::new(0, 0, 0);
+
+    const fn new(year: u16, month: u8, day: u8) -> Self {
+        Self { year, month, day }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/proc-macro2/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/proc-macro2/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"Cargo.toml":"41a9465146a2b62a642e29f065718649e686d3c9585736596392dd941c9b0bef","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"c609b6865476d6c35879784e9155367a97a0da496aa5c3c61488440a20f59883","build.rs":"cf78c0005f11d54ca42dbaee77cb76a440e6fa2e0b64798d3f74c04770a0ad2b","build/probe.rs":"971fd2178dc506ccdc5c2065c37b77696a4aee8e00330ca52625db4a857f68d3","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/detection.rs":"ed9a5f9a979ab01247d7a68eeb1afa3c13209334c5bfff0f9289cb07e5bb4e8b","src/extra.rs":"29f094473279a29b71c3cc9f5fa27c2e2c30c670390cf7e4b7cf451486cc857e","src/fallback.rs":"be1ce5e32c88c29d41d2ab663375951817d52decce3dc9e335ec22378be8fa65","src/lib.rs":"97ca48f50ad15fbcef42b31fb4fbfb8e4a1c5f946d776aa44fd04b37d7c64b32","src/location.rs":"9225c5a55f03b56cce42bc55ceb509e8216a5e0b24c94aa1cd071b04e3d6c15f","src/marker.rs":"c11c5a1be8bdf18be3fcd224393f350a9aae7ce282e19ce583c84910c6903a8f","src/parse.rs":"4b77cddbc2752bc4d38a65acd8b96b6786c5220d19b1e1b37810257b5d24132d","src/rcvec.rs":"1c3c48c4f819927cc445ae15ca3bb06775feff2fd1cb21901ae4c40c7e6b4e82","src/wrapper.rs":"e41df9abc846b40f0cf01150d22b91944d07cde93bc72aa34798101652675844","tests/comments.rs":"31115b3a56c83d93eef2fb4c9566bf4543e302560732986161b98aef504785ed","tests/features.rs":"a86deb8644992a4eb64d9fd493eff16f9cf9c5cb6ade3a634ce0c990cf87d559","tests/marker.rs":"473e962ee1aa0633dd5cf9a973b3bbd0ef43b740d4b7f6d008ff455a6b89d386","tests/test.rs":"2e7106f582367d168638be7364d4e9aadbe0affca8b51dd80f0b3977cc2fcf83","tests/test_fmt.rs":"b7743b612af65f2c88cbe109d50a093db7aa7e87f9e37bf45b7bbaeb240aa020","tests/test_size.rs":"62d8373ea46b669b87bc90a9c49b6d02f90ff4c21f9a25acebf60c9926e01fb7"},"package":"5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/proc-macro2/Cargo.toml
--- 43.0.0-1/rust-vendor/proc-macro2/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,104 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2021"
+rust-version = "1.56"
+name = "proc-macro2"
+version = "1.0.86"
+authors = [
+    "David Tolnay <dtolnay@gmail.com>",
+    "Alex Crichton <alex@alexcrichton.com>",
+]
+build = "build.rs"
+autobins = false
+autoexamples = false
+autotests = false
+autobenches = false
+description = "A substitute implementation of the compiler's `proc_macro` API to decouple token-based libraries from the procedural macro use case."
+documentation = "https://docs.rs/proc-macro2"
+readme = "README.md"
+keywords = [
+    "macros",
+    "syn",
+]
+categories = ["development-tools::procedural-macro-helpers"]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/dtolnay/proc-macro2"
+
+[package.metadata.docs.rs]
+rustc-args = [
+    "--cfg",
+    "procmacro2_semver_exempt",
+]
+rustdoc-args = [
+    "--cfg",
+    "procmacro2_semver_exempt",
+    "--generate-link-to-definition",
+]
+targets = ["x86_64-unknown-linux-gnu"]
+
+[package.metadata.playground]
+features = ["span-locations"]
+
+[lib]
+name = "proc_macro2"
+path = "src/lib.rs"
+doc-scrape-examples = false
+
+[[test]]
+name = "comments"
+path = "tests/comments.rs"
+
+[[test]]
+name = "features"
+path = "tests/features.rs"
+
+[[test]]
+name = "marker"
+path = "tests/marker.rs"
+
+[[test]]
+name = "test"
+path = "tests/test.rs"
+
+[[test]]
+name = "test_fmt"
+path = "tests/test_fmt.rs"
+
+[[test]]
+name = "test_size"
+path = "tests/test_size.rs"
+
+[dependencies.unicode-ident]
+version = "1.0"
+
+[dev-dependencies.flate2]
+version = "1.0"
+
+[dev-dependencies.quote]
+version = "1.0"
+default-features = false
+
+[dev-dependencies.rayon]
+version = "1.0"
+
+[dev-dependencies.rustversion]
+version = "1"
+
+[dev-dependencies.tar]
+version = "0.4"
+
+[features]
+default = ["proc-macro"]
+nightly = []
+proc-macro = []
+span-locations = []
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/proc-macro2/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/proc-macro2/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,176 @@
+                              Apache License
+                        Version 2.0, January 2004
+                     http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+   "License" shall mean the terms and conditions for use, reproduction,
+   and distribution as defined by Sections 1 through 9 of this document.
+
+   "Licensor" shall mean the copyright owner or entity authorized by
+   the copyright owner that is granting the License.
+
+   "Legal Entity" shall mean the union of the acting entity and all
+   other entities that control, are controlled by, or are under common
+   control with that entity. For the purposes of this definition,
+   "control" means (i) the power, direct or indirect, to cause the
+   direction or management of such entity, whether by contract or
+   otherwise, or (ii) ownership of fifty percent (50%) or more of the
+   outstanding shares, or (iii) beneficial ownership of such entity.
+
+   "You" (or "Your") shall mean an individual or Legal Entity
+   exercising permissions granted by this License.
+
+   "Source" form shall mean the preferred form for making modifications,
+   including but not limited to software source code, documentation
+   source, and configuration files.
+
+   "Object" form shall mean any form resulting from mechanical
+   transformation or translation of a Source form, including but
+   not limited to compiled object code, generated documentation,
+   and conversions to other media types.
+
+   "Work" shall mean the work of authorship, whether in Source or
+   Object form, made available under the License, as indicated by a
+   copyright notice that is included in or attached to the work
+   (an example is provided in the Appendix below).
+
+   "Derivative Works" shall mean any work, whether in Source or Object
+   form, that is based on (or derived from) the Work and for which the
+   editorial revisions, annotations, elaborations, or other modifications
+   represent, as a whole, an original work of authorship. For the purposes
+   of this License, Derivative Works shall not include works that remain
+   separable from, or merely link (or bind by name) to the interfaces of,
+   the Work and Derivative Works thereof.
+
+   "Contribution" shall mean any work of authorship, including
+   the original version of the Work and any modifications or additions
+   to that Work or Derivative Works thereof, that is intentionally
+   submitted to Licensor for inclusion in the Work by the copyright owner
+   or by an individual or Legal Entity authorized to submit on behalf of
+   the copyright owner. For the purposes of this definition, "submitted"
+   means any form of electronic, verbal, or written communication sent
+   to the Licensor or its representatives, including but not limited to
+   communication on electronic mailing lists, source code control systems,
+   and issue tracking systems that are managed by, or on behalf of, the
+   Licensor for the purpose of discussing and improving the Work, but
+   excluding communication that is conspicuously marked or otherwise
+   designated in writing by the copyright owner as "Not a Contribution."
+
+   "Contributor" shall mean Licensor and any individual or Legal Entity
+   on behalf of whom a Contribution has been received by Licensor and
+   subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   copyright license to reproduce, prepare Derivative Works of,
+   publicly display, publicly perform, sublicense, and distribute the
+   Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   (except as stated in this section) patent license to make, have made,
+   use, offer to sell, sell, import, and otherwise transfer the Work,
+   where such license applies only to those patent claims licensable
+   by such Contributor that are necessarily infringed by their
+   Contribution(s) alone or by combination of their Contribution(s)
+   with the Work to which such Contribution(s) was submitted. If You
+   institute patent litigation against any entity (including a
+   cross-claim or counterclaim in a lawsuit) alleging that the Work
+   or a Contribution incorporated within the Work constitutes direct
+   or contributory patent infringement, then any patent licenses
+   granted to You under this License for that Work shall terminate
+   as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+   Work or Derivative Works thereof in any medium, with or without
+   modifications, and in Source or Object form, provided that You
+   meet the following conditions:
+
+   (a) You must give any other recipients of the Work or
+       Derivative Works a copy of this License; and
+
+   (b) You must cause any modified files to carry prominent notices
+       stating that You changed the files; and
+
+   (c) You must retain, in the Source form of any Derivative Works
+       that You distribute, all copyright, patent, trademark, and
+       attribution notices from the Source form of the Work,
+       excluding those notices that do not pertain to any part of
+       the Derivative Works; and
+
+   (d) If the Work includes a "NOTICE" text file as part of its
+       distribution, then any Derivative Works that You distribute must
+       include a readable copy of the attribution notices contained
+       within such NOTICE file, excluding those notices that do not
+       pertain to any part of the Derivative Works, in at least one
+       of the following places: within a NOTICE text file distributed
+       as part of the Derivative Works; within the Source form or
+       documentation, if provided along with the Derivative Works; or,
+       within a display generated by the Derivative Works, if and
+       wherever such third-party notices normally appear. The contents
+       of the NOTICE file are for informational purposes only and
+       do not modify the License. You may add Your own attribution
+       notices within Derivative Works that You distribute, alongside
+       or as an addendum to the NOTICE text from the Work, provided
+       that such additional attribution notices cannot be construed
+       as modifying the License.
+
+   You may add Your own copyright statement to Your modifications and
+   may provide additional or different license terms and conditions
+   for use, reproduction, or distribution of Your modifications, or
+   for any such Derivative Works as a whole, provided Your use,
+   reproduction, and distribution of the Work otherwise complies with
+   the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+   any Contribution intentionally submitted for inclusion in the Work
+   by You to the Licensor shall be under the terms and conditions of
+   this License, without any additional terms or conditions.
+   Notwithstanding the above, nothing herein shall supersede or modify
+   the terms of any separate license agreement you may have executed
+   with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+   names, trademarks, service marks, or product names of the Licensor,
+   except as required for reasonable and customary use in describing the
+   origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+   agreed to in writing, Licensor provides the Work (and each
+   Contributor provides its Contributions) on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+   implied, including, without limitation, any warranties or conditions
+   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+   PARTICULAR PURPOSE. You are solely responsible for determining the
+   appropriateness of using or redistributing the Work and assume any
+   risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+   whether in tort (including negligence), contract, or otherwise,
+   unless required by applicable law (such as deliberate and grossly
+   negligent acts) or agreed to in writing, shall any Contributor be
+   liable to You for damages, including any direct, indirect, special,
+   incidental, or consequential damages of any character arising as a
+   result of this License or out of the use or inability to use the
+   Work (including but not limited to damages for loss of goodwill,
+   work stoppage, computer failure or malfunction, or any and all
+   other commercial damages or losses), even if such Contributor
+   has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+   the Work or Derivative Works thereof, You may choose to offer,
+   and charge a fee for, acceptance of support, warranty, indemnity,
+   or other liability obligations and/or rights consistent with this
+   License. However, in accepting such obligations, You may act only
+   on Your own behalf and on Your sole responsibility, not on behalf
+   of any other Contributor, and only if You agree to indemnify,
+   defend, and hold each Contributor harmless for any liability
+   incurred by, or claims asserted against, such Contributor by reason
+   of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/proc-macro2/LICENSE-MIT
--- 43.0.0-1/rust-vendor/proc-macro2/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,23 @@
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/README.md 43.0.0-1ubuntu1/rust-vendor/proc-macro2/README.md
--- 43.0.0-1/rust-vendor/proc-macro2/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,94 @@
+# proc-macro2
+
+[<img alt="github" src="https://img.shields.io/badge/github-dtolnay/proc--macro2-8da0cb?style=for-the-badge&labelColor=555555&logo=github" height="20">](https://github.com/dtolnay/proc-macro2)
+[<img alt="crates.io" src="https://img.shields.io/crates/v/proc-macro2.svg?style=for-the-badge&color=fc8d62&logo=rust" height="20">](https://crates.io/crates/proc-macro2)
+[<img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-proc--macro2-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs" height="20">](https://docs.rs/proc-macro2)
+[<img alt="build status" src="https://img.shields.io/github/actions/workflow/status/dtolnay/proc-macro2/ci.yml?branch=master&style=for-the-badge" height="20">](https://github.com/dtolnay/proc-macro2/actions?query=branch%3Amaster)
+
+A wrapper around the procedural macro API of the compiler's `proc_macro` crate.
+This library serves two purposes:
+
+- **Bring proc-macro-like functionality to other contexts like build.rs and
+  main.rs.** Types from `proc_macro` are entirely specific to procedural macros
+  and cannot ever exist in code outside of a procedural macro. Meanwhile
+  `proc_macro2` types may exist anywhere including non-macro code. By developing
+  foundational libraries like [syn] and [quote] against `proc_macro2` rather
+  than `proc_macro`, the procedural macro ecosystem becomes easily applicable to
+  many other use cases and we avoid reimplementing non-macro equivalents of
+  those libraries.
+
+- **Make procedural macros unit testable.** As a consequence of being specific
+  to procedural macros, nothing that uses `proc_macro` can be executed from a
+  unit test. In order for helper libraries or components of a macro to be
+  testable in isolation, they must be implemented using `proc_macro2`.
+
+[syn]: https://github.com/dtolnay/syn
+[quote]: https://github.com/dtolnay/quote
+
+## Usage
+
+```toml
+[dependencies]
+proc-macro2 = "1.0"
+```
+
+The skeleton of a typical procedural macro typically looks like this:
+
+```rust
+extern crate proc_macro;
+
+#[proc_macro_derive(MyDerive)]
+pub fn my_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
+    let input = proc_macro2::TokenStream::from(input);
+
+    let output: proc_macro2::TokenStream = {
+        /* transform input */
+    };
+
+    proc_macro::TokenStream::from(output)
+}
+```
+
+If parsing with [Syn], you'll use [`parse_macro_input!`] instead to propagate
+parse errors correctly back to the compiler when parsing fails.
+
+[`parse_macro_input!`]: https://docs.rs/syn/2.0/syn/macro.parse_macro_input.html
+
+## Unstable features
+
+The default feature set of proc-macro2 tracks the most recent stable compiler
+API. Functionality in `proc_macro` that is not yet stable is not exposed by
+proc-macro2 by default.
+
+To opt into the additional APIs available in the most recent nightly compiler,
+the `procmacro2_semver_exempt` config flag must be passed to rustc. We will
+polyfill those nightly-only APIs back to Rust 1.56.0. As these are unstable APIs
+that track the nightly compiler, minor versions of proc-macro2 may make breaking
+changes to them at any time.
+
+```
+RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo build
+```
+
+Note that this must not only be done for your crate, but for any crate that
+depends on your crate. This infectious nature is intentional, as it serves as a
+reminder that you are outside of the normal semver guarantees.
+
+Semver exempt methods are marked as such in the proc-macro2 documentation.
+
+<br>
+
+#### License
+
+<sup>
+Licensed under either of <a href="LICENSE-APACHE">Apache License, Version
+2.0</a> or <a href="LICENSE-MIT">MIT license</a> at your option.
+</sup>
+
+<br>
+
+<sub>
+Unless you explicitly state otherwise, any contribution intentionally submitted
+for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
+be dual licensed as above, without any additional terms or conditions.
+</sub>
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/build/probe.rs 43.0.0-1ubuntu1/rust-vendor/proc-macro2/build/probe.rs
--- 43.0.0-1/rust-vendor/proc-macro2/build/probe.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/build/probe.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,25 @@
+// This code exercises the surface area that we expect of Span's unstable API.
+// If the current toolchain is able to compile it, then proc-macro2 is able to
+// offer these APIs too.
+
+#![feature(proc_macro_span)]
+
+extern crate proc_macro;
+
+use core::ops::{Range, RangeBounds};
+use proc_macro::{Literal, Span};
+
+pub fn byte_range(this: &Span) -> Range<usize> {
+    this.byte_range()
+}
+
+pub fn join(this: &Span, other: Span) -> Option<Span> {
+    this.join(other)
+}
+
+pub fn subspan<R: RangeBounds<usize>>(this: &Literal, range: R) -> Option<Span> {
+    this.subspan(range)
+}
+
+// Include in sccache cache key.
+const _: Option<&str> = option_env!("RUSTC_BOOTSTRAP");
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/build.rs 43.0.0-1ubuntu1/rust-vendor/proc-macro2/build.rs
--- 43.0.0-1/rust-vendor/proc-macro2/build.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/build.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,213 @@
+#![allow(unknown_lints)]
+#![allow(unexpected_cfgs)]
+
+use std::env;
+use std::ffi::OsString;
+use std::iter;
+use std::path::Path;
+use std::process::{self, Command, Stdio};
+use std::str;
+
+fn main() {
+    let rustc = rustc_minor_version().unwrap_or(u32::MAX);
+
+    if rustc >= 80 {
+        println!("cargo:rustc-check-cfg=cfg(fuzzing)");
+        println!("cargo:rustc-check-cfg=cfg(no_is_available)");
+        println!("cargo:rustc-check-cfg=cfg(no_literal_byte_character)");
+        println!("cargo:rustc-check-cfg=cfg(no_literal_c_string)");
+        println!("cargo:rustc-check-cfg=cfg(no_source_text)");
+        println!("cargo:rustc-check-cfg=cfg(proc_macro_span)");
+        println!("cargo:rustc-check-cfg=cfg(procmacro2_backtrace)");
+        println!("cargo:rustc-check-cfg=cfg(procmacro2_nightly_testing)");
+        println!("cargo:rustc-check-cfg=cfg(procmacro2_semver_exempt)");
+        println!("cargo:rustc-check-cfg=cfg(randomize_layout)");
+        println!("cargo:rustc-check-cfg=cfg(span_locations)");
+        println!("cargo:rustc-check-cfg=cfg(super_unstable)");
+        println!("cargo:rustc-check-cfg=cfg(wrap_proc_macro)");
+    }
+
+    let docs_rs = env::var_os("DOCS_RS").is_some();
+    let semver_exempt = cfg!(procmacro2_semver_exempt) || docs_rs;
+    if semver_exempt {
+        // https://github.com/dtolnay/proc-macro2/issues/147
+        println!("cargo:rustc-cfg=procmacro2_semver_exempt");
+    }
+
+    if semver_exempt || cfg!(feature = "span-locations") {
+        // Provide methods Span::start and Span::end which give the line/column
+        // location of a token. This is behind a cfg because tracking location
+        // inside spans is a performance hit.
+        println!("cargo:rustc-cfg=span_locations");
+    }
+
+    if rustc < 57 {
+        // Do not use proc_macro::is_available() to detect whether the proc
+        // macro API is available vs needs to be polyfilled. Instead, use the
+        // proc macro API unconditionally and catch the panic that occurs if it
+        // isn't available.
+        println!("cargo:rustc-cfg=no_is_available");
+    }
+
+    if rustc < 66 {
+        // Do not call libproc_macro's Span::source_text. Always return None.
+        println!("cargo:rustc-cfg=no_source_text");
+    }
+
+    if rustc < 79 {
+        // Do not call Literal::byte_character nor Literal::c_string. They can
+        // be emulated by way of Literal::from_str.
+        println!("cargo:rustc-cfg=no_literal_byte_character");
+        println!("cargo:rustc-cfg=no_literal_c_string");
+    }
+
+    if !cfg!(feature = "proc-macro") {
+        println!("cargo:rerun-if-changed=build.rs");
+        return;
+    }
+
+    println!("cargo:rerun-if-changed=build/probe.rs");
+
+    let proc_macro_span;
+    let consider_rustc_bootstrap;
+    if compile_probe(false) {
+        // This is a nightly or dev compiler, so it supports unstable features
+        // regardless of RUSTC_BOOTSTRAP. No need to rerun build script if
+        // RUSTC_BOOTSTRAP is changed.
+        proc_macro_span = true;
+        consider_rustc_bootstrap = false;
+    } else if let Some(rustc_bootstrap) = env::var_os("RUSTC_BOOTSTRAP") {
+        if compile_probe(true) {
+            // This is a stable or beta compiler for which the user has set
+            // RUSTC_BOOTSTRAP to turn on unstable features. Rerun build script
+            // if they change it.
+            proc_macro_span = true;
+            consider_rustc_bootstrap = true;
+        } else if rustc_bootstrap == "1" {
+            // This compiler does not support the proc macro Span API in the
+            // form that proc-macro2 expects. No need to pay attention to
+            // RUSTC_BOOTSTRAP.
+            proc_macro_span = false;
+            consider_rustc_bootstrap = false;
+        } else {
+            // This is a stable or beta compiler for which RUSTC_BOOTSTRAP is
+            // set to restrict the use of unstable features by this crate.
+            proc_macro_span = false;
+            consider_rustc_bootstrap = true;
+        }
+    } else {
+        // Without RUSTC_BOOTSTRAP, this compiler does not support the proc
+        // macro Span API in the form that proc-macro2 expects, but try again if
+        // the user turns on unstable features.
+        proc_macro_span = false;
+        consider_rustc_bootstrap = true;
+    }
+
+    if proc_macro_span || !semver_exempt {
+        // Wrap types from libproc_macro rather than polyfilling the whole API.
+        // Enabled as long as procmacro2_semver_exempt is not set, because we
+        // can't emulate the unstable API without emulating everything else.
+        // Also enabled unconditionally on nightly, in which case the
+        // procmacro2_semver_exempt surface area is implemented by using the
+        // nightly-only proc_macro API.
+        println!("cargo:rustc-cfg=wrap_proc_macro");
+    }
+
+    if proc_macro_span {
+        // Enable non-dummy behavior of Span::start and Span::end methods which
+        // requires an unstable compiler feature. Enabled when building with
+        // nightly, unless `-Z allow-feature` in RUSTFLAGS disallows unstable
+        // features.
+        println!("cargo:rustc-cfg=proc_macro_span");
+    }
+
+    if semver_exempt && proc_macro_span {
+        // Implement the semver exempt API in terms of the nightly-only
+        // proc_macro API.
+        println!("cargo:rustc-cfg=super_unstable");
+    }
+
+    if consider_rustc_bootstrap {
+        println!("cargo:rerun-if-env-changed=RUSTC_BOOTSTRAP");
+    }
+}
+
+fn compile_probe(rustc_bootstrap: bool) -> bool {
+    if env::var_os("RUSTC_STAGE").is_some() {
+        // We are running inside rustc bootstrap. This is a highly non-standard
+        // environment with issues such as:
+        //
+        //     https://github.com/rust-lang/cargo/issues/11138
+        //     https://github.com/rust-lang/rust/issues/114839
+        //
+        // Let's just not use nightly features here.
+        return false;
+    }
+
+    let rustc = cargo_env_var("RUSTC");
+    let out_dir = cargo_env_var("OUT_DIR");
+    let probefile = Path::new("build").join("probe.rs");
+
+    let rustc_wrapper = env::var_os("RUSTC_WRAPPER").filter(|wrapper| !wrapper.is_empty());
+    let rustc_workspace_wrapper =
+        env::var_os("RUSTC_WORKSPACE_WRAPPER").filter(|wrapper| !wrapper.is_empty());
+    let mut rustc = rustc_wrapper
+        .into_iter()
+        .chain(rustc_workspace_wrapper)
+        .chain(iter::once(rustc));
+    let mut cmd = Command::new(rustc.next().unwrap());
+    cmd.args(rustc);
+
+    if !rustc_bootstrap {
+        cmd.env_remove("RUSTC_BOOTSTRAP");
+    }
+
+    cmd.stderr(Stdio::null())
+        .arg("--edition=2021")
+        .arg("--crate-name=proc_macro2")
+        .arg("--crate-type=lib")
+        .arg("--cap-lints=allow")
+        .arg("--emit=dep-info,metadata")
+        .arg("--out-dir")
+        .arg(out_dir)
+        .arg(probefile);
+
+    if let Some(target) = env::var_os("TARGET") {
+        cmd.arg("--target").arg(target);
+    }
+
+    // If Cargo wants to set RUSTFLAGS, use that.
+    if let Ok(rustflags) = env::var("CARGO_ENCODED_RUSTFLAGS") {
+        if !rustflags.is_empty() {
+            for arg in rustflags.split('\x1f') {
+                cmd.arg(arg);
+            }
+        }
+    }
+
+    match cmd.status() {
+        Ok(status) => status.success(),
+        Err(_) => false,
+    }
+}
+
+fn rustc_minor_version() -> Option<u32> {
+    let rustc = cargo_env_var("RUSTC");
+    let output = Command::new(rustc).arg("--version").output().ok()?;
+    let version = str::from_utf8(&output.stdout).ok()?;
+    let mut pieces = version.split('.');
+    if pieces.next() != Some("rustc 1") {
+        return None;
+    }
+    pieces.next()?.parse().ok()
+}
+
+fn cargo_env_var(key: &str) -> OsString {
+    env::var_os(key).unwrap_or_else(|| {
+        eprintln!(
+            "Environment variable ${} is not set during execution of build script",
+            key,
+        );
+        process::exit(1);
+    })
+}
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/rust-toolchain.toml 43.0.0-1ubuntu1/rust-vendor/proc-macro2/rust-toolchain.toml
--- 43.0.0-1/rust-vendor/proc-macro2/rust-toolchain.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/rust-toolchain.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,2 @@
+[toolchain]
+components = ["rust-src"]
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/src/detection.rs 43.0.0-1ubuntu1/rust-vendor/proc-macro2/src/detection.rs
--- 43.0.0-1/rust-vendor/proc-macro2/src/detection.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/src/detection.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,75 @@
+use core::sync::atomic::{AtomicUsize, Ordering};
+use std::sync::Once;
+
+static WORKS: AtomicUsize = AtomicUsize::new(0);
+static INIT: Once = Once::new();
+
+pub(crate) fn inside_proc_macro() -> bool {
+    match WORKS.load(Ordering::Relaxed) {
+        1 => return false,
+        2 => return true,
+        _ => {}
+    }
+
+    INIT.call_once(initialize);
+    inside_proc_macro()
+}
+
+pub(crate) fn force_fallback() {
+    WORKS.store(1, Ordering::Relaxed);
+}
+
+pub(crate) fn unforce_fallback() {
+    initialize();
+}
+
+#[cfg(not(no_is_available))]
+fn initialize() {
+    let available = proc_macro::is_available();
+    WORKS.store(available as usize + 1, Ordering::Relaxed);
+}
+
+// Swap in a null panic hook to avoid printing "thread panicked" to stderr,
+// then use catch_unwind to determine whether the compiler's proc_macro is
+// working. When proc-macro2 is used from outside of a procedural macro all
+// of the proc_macro crate's APIs currently panic.
+//
+// The Once is to prevent the possibility of this ordering:
+//
+//     thread 1 calls take_hook, gets the user's original hook
+//     thread 1 calls set_hook with the null hook
+//     thread 2 calls take_hook, thinks null hook is the original hook
+//     thread 2 calls set_hook with the null hook
+//     thread 1 calls set_hook with the actual original hook
+//     thread 2 calls set_hook with what it thinks is the original hook
+//
+// in which the user's hook has been lost.
+//
+// There is still a race condition where a panic in a different thread can
+// happen during the interval that the user's original panic hook is
+// unregistered such that their hook is incorrectly not called. This is
+// sufficiently unlikely and less bad than printing panic messages to stderr
+// on correct use of this crate. Maybe there is a libstd feature request
+// here. For now, if a user needs to guarantee that this failure mode does
+// not occur, they need to call e.g. `proc_macro2::Span::call_site()` from
+// the main thread before launching any other threads.
+#[cfg(no_is_available)]
+fn initialize() {
+    use std::panic::{self, PanicInfo};
+
+    type PanicHook = dyn Fn(&PanicInfo) + Sync + Send + 'static;
+
+    let null_hook: Box<PanicHook> = Box::new(|_panic_info| { /* ignore */ });
+    let sanity_check = &*null_hook as *const PanicHook;
+    let original_hook = panic::take_hook();
+    panic::set_hook(null_hook);
+
+    let works = panic::catch_unwind(proc_macro::Span::call_site).is_ok();
+    WORKS.store(works as usize + 1, Ordering::Relaxed);
+
+    let hopefully_null_hook = panic::take_hook();
+    panic::set_hook(original_hook);
+    if sanity_check != &*hopefully_null_hook {
+        panic!("observed race condition in proc_macro2::inside_proc_macro");
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/src/extra.rs 43.0.0-1ubuntu1/rust-vendor/proc-macro2/src/extra.rs
--- 43.0.0-1/rust-vendor/proc-macro2/src/extra.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/src/extra.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,151 @@
+//! Items which do not have a correspondence to any API in the proc_macro crate,
+//! but are necessary to include in proc-macro2.
+
+use crate::fallback;
+use crate::imp;
+use crate::marker::{ProcMacroAutoTraits, MARKER};
+use crate::Span;
+use core::fmt::{self, Debug};
+
+/// Invalidate any `proc_macro2::Span` that exist on the current thread.
+///
+/// The implementation of `Span` uses thread-local data structures and this
+/// function clears them. Calling any method on a `Span` on the current thread
+/// created prior to the invalidation will return incorrect values or crash.
+///
+/// This function is useful for programs that process more than 2<sup>32</sup>
+/// bytes of Rust source code on the same thread. Just like rustc, proc-macro2
+/// uses 32-bit source locations, and these wrap around when the total source
+/// code processed by the same thread exceeds 2<sup>32</sup> bytes (4
+/// gigabytes). After a wraparound, `Span` methods such as `source_text()` can
+/// return wrong data.
+///
+/// # Example
+///
+/// As of late 2023, there is 200 GB of Rust code published on crates.io.
+/// Looking at just the newest version of every crate, it is 16 GB of code. So a
+/// workload that involves parsing it all would overflow a 32-bit source
+/// location unless spans are being invalidated.
+///
+/// ```
+/// use flate2::read::GzDecoder;
+/// use std::ffi::OsStr;
+/// use std::io::{BufReader, Read};
+/// use std::str::FromStr;
+/// use tar::Archive;
+///
+/// rayon::scope(|s| {
+///     for krate in every_version_of_every_crate() {
+///         s.spawn(move |_| {
+///             proc_macro2::extra::invalidate_current_thread_spans();
+///
+///             let reader = BufReader::new(krate);
+///             let tar = GzDecoder::new(reader);
+///             let mut archive = Archive::new(tar);
+///             for entry in archive.entries().unwrap() {
+///                 let mut entry = entry.unwrap();
+///                 let path = entry.path().unwrap();
+///                 if path.extension() != Some(OsStr::new("rs")) {
+///                     continue;
+///                 }
+///                 let mut content = String::new();
+///                 entry.read_to_string(&mut content).unwrap();
+///                 match proc_macro2::TokenStream::from_str(&content) {
+///                     Ok(tokens) => {/* ... */},
+///                     Err(_) => continue,
+///                 }
+///             }
+///         });
+///     }
+/// });
+/// #
+/// # fn every_version_of_every_crate() -> Vec<std::fs::File> {
+/// #     Vec::new()
+/// # }
+/// ```
+///
+/// # Panics
+///
+/// This function is not applicable to and will panic if called from a
+/// procedural macro.
+#[cfg(span_locations)]
+#[cfg_attr(docsrs, doc(cfg(feature = "span-locations")))]
+pub fn invalidate_current_thread_spans() {
+    crate::imp::invalidate_current_thread_spans();
+}
+
+/// An object that holds a [`Group`]'s `span_open()` and `span_close()` together
+/// in a more compact representation than holding those 2 spans individually.
+///
+/// [`Group`]: crate::Group
+#[derive(Copy, Clone)]
+pub struct DelimSpan {
+    inner: DelimSpanEnum,
+    _marker: ProcMacroAutoTraits,
+}
+
+#[derive(Copy, Clone)]
+enum DelimSpanEnum {
+    #[cfg(wrap_proc_macro)]
+    Compiler {
+        join: proc_macro::Span,
+        open: proc_macro::Span,
+        close: proc_macro::Span,
+    },
+    Fallback(fallback::Span),
+}
+
+impl DelimSpan {
+    pub(crate) fn new(group: &imp::Group) -> Self {
+        #[cfg(wrap_proc_macro)]
+        let inner = match group {
+            imp::Group::Compiler(group) => DelimSpanEnum::Compiler {
+                join: group.span(),
+                open: group.span_open(),
+                close: group.span_close(),
+            },
+            imp::Group::Fallback(group) => DelimSpanEnum::Fallback(group.span()),
+        };
+
+        #[cfg(not(wrap_proc_macro))]
+        let inner = DelimSpanEnum::Fallback(group.span());
+
+        DelimSpan {
+            inner,
+            _marker: MARKER,
+        }
+    }
+
+    /// Returns a span covering the entire delimited group.
+    pub fn join(&self) -> Span {
+        match &self.inner {
+            #[cfg(wrap_proc_macro)]
+            DelimSpanEnum::Compiler { join, .. } => Span::_new(imp::Span::Compiler(*join)),
+            DelimSpanEnum::Fallback(span) => Span::_new_fallback(*span),
+        }
+    }
+
+    /// Returns a span for the opening punctuation of the group only.
+    pub fn open(&self) -> Span {
+        match &self.inner {
+            #[cfg(wrap_proc_macro)]
+            DelimSpanEnum::Compiler { open, .. } => Span::_new(imp::Span::Compiler(*open)),
+            DelimSpanEnum::Fallback(span) => Span::_new_fallback(span.first_byte()),
+        }
+    }
+
+    /// Returns a span for the closing punctuation of the group only.
+    pub fn close(&self) -> Span {
+        match &self.inner {
+            #[cfg(wrap_proc_macro)]
+            DelimSpanEnum::Compiler { close, .. } => Span::_new(imp::Span::Compiler(*close)),
+            DelimSpanEnum::Fallback(span) => Span::_new_fallback(span.last_byte()),
+        }
+    }
+}
+
+impl Debug for DelimSpan {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.join(), f)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/src/fallback.rs 43.0.0-1ubuntu1/rust-vendor/proc-macro2/src/fallback.rs
--- 43.0.0-1/rust-vendor/proc-macro2/src/fallback.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/src/fallback.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1226 @@
+#[cfg(span_locations)]
+use crate::location::LineColumn;
+use crate::parse::{self, Cursor};
+use crate::rcvec::{RcVec, RcVecBuilder, RcVecIntoIter, RcVecMut};
+use crate::{Delimiter, Spacing, TokenTree};
+#[cfg(all(span_locations, not(fuzzing)))]
+use alloc::collections::BTreeMap;
+#[cfg(all(span_locations, not(fuzzing)))]
+use core::cell::RefCell;
+#[cfg(span_locations)]
+use core::cmp;
+use core::fmt::{self, Debug, Display, Write};
+use core::mem::ManuallyDrop;
+#[cfg(span_locations)]
+use core::ops::Range;
+use core::ops::RangeBounds;
+use core::ptr;
+use core::str::{self, FromStr};
+use std::ffi::CStr;
+#[cfg(procmacro2_semver_exempt)]
+use std::path::PathBuf;
+
+/// Force use of proc-macro2's fallback implementation of the API for now, even
+/// if the compiler's implementation is available.
+pub fn force() {
+    #[cfg(wrap_proc_macro)]
+    crate::detection::force_fallback();
+}
+
+/// Resume using the compiler's implementation of the proc macro API if it is
+/// available.
+pub fn unforce() {
+    #[cfg(wrap_proc_macro)]
+    crate::detection::unforce_fallback();
+}
+
+#[derive(Clone)]
+pub(crate) struct TokenStream {
+    inner: RcVec<TokenTree>,
+}
+
+#[derive(Debug)]
+pub(crate) struct LexError {
+    pub(crate) span: Span,
+}
+
+impl LexError {
+    pub(crate) fn span(&self) -> Span {
+        self.span
+    }
+
+    pub(crate) fn call_site() -> Self {
+        LexError {
+            span: Span::call_site(),
+        }
+    }
+}
+
+impl TokenStream {
+    pub fn new() -> Self {
+        TokenStream {
+            inner: RcVecBuilder::new().build(),
+        }
+    }
+
+    pub fn is_empty(&self) -> bool {
+        self.inner.len() == 0
+    }
+
+    fn take_inner(self) -> RcVecBuilder<TokenTree> {
+        let nodrop = ManuallyDrop::new(self);
+        unsafe { ptr::read(&nodrop.inner) }.make_owned()
+    }
+}
+
+fn push_token_from_proc_macro(mut vec: RcVecMut<TokenTree>, token: TokenTree) {
+    // https://github.com/dtolnay/proc-macro2/issues/235
+    match token {
+        TokenTree::Literal(crate::Literal {
+            #[cfg(wrap_proc_macro)]
+                inner: crate::imp::Literal::Fallback(literal),
+            #[cfg(not(wrap_proc_macro))]
+                inner: literal,
+            ..
+        }) if literal.repr.starts_with('-') => {
+            push_negative_literal(vec, literal);
+        }
+        _ => vec.push(token),
+    }
+
+    #[cold]
+    fn push_negative_literal(mut vec: RcVecMut<TokenTree>, mut literal: Literal) {
+        literal.repr.remove(0);
+        let mut punct = crate::Punct::new('-', Spacing::Alone);
+        punct.set_span(crate::Span::_new_fallback(literal.span));
+        vec.push(TokenTree::Punct(punct));
+        vec.push(TokenTree::Literal(crate::Literal::_new_fallback(literal)));
+    }
+}
+
+// Nonrecursive to prevent stack overflow.
+impl Drop for TokenStream {
+    fn drop(&mut self) {
+        let mut inner = match self.inner.get_mut() {
+            Some(inner) => inner,
+            None => return,
+        };
+        while let Some(token) = inner.pop() {
+            let group = match token {
+                TokenTree::Group(group) => group.inner,
+                _ => continue,
+            };
+            #[cfg(wrap_proc_macro)]
+            let group = match group {
+                crate::imp::Group::Fallback(group) => group,
+                crate::imp::Group::Compiler(_) => continue,
+            };
+            inner.extend(group.stream.take_inner());
+        }
+    }
+}
+
+pub(crate) struct TokenStreamBuilder {
+    inner: RcVecBuilder<TokenTree>,
+}
+
+impl TokenStreamBuilder {
+    pub fn new() -> Self {
+        TokenStreamBuilder {
+            inner: RcVecBuilder::new(),
+        }
+    }
+
+    pub fn with_capacity(cap: usize) -> Self {
+        TokenStreamBuilder {
+            inner: RcVecBuilder::with_capacity(cap),
+        }
+    }
+
+    pub fn push_token_from_parser(&mut self, tt: TokenTree) {
+        self.inner.push(tt);
+    }
+
+    pub fn build(self) -> TokenStream {
+        TokenStream {
+            inner: self.inner.build(),
+        }
+    }
+}
+
+#[cfg(span_locations)]
+fn get_cursor(src: &str) -> Cursor {
+    #[cfg(fuzzing)]
+    return Cursor { rest: src, off: 1 };
+
+    // Create a dummy file & add it to the source map
+    #[cfg(not(fuzzing))]
+    SOURCE_MAP.with(|sm| {
+        let mut sm = sm.borrow_mut();
+        let span = sm.add_file(src);
+        Cursor {
+            rest: src,
+            off: span.lo,
+        }
+    })
+}
+
+#[cfg(not(span_locations))]
+fn get_cursor(src: &str) -> Cursor {
+    Cursor { rest: src }
+}
+
+impl FromStr for TokenStream {
+    type Err = LexError;
+
+    fn from_str(src: &str) -> Result<TokenStream, LexError> {
+        // Create a dummy file & add it to the source map
+        let mut cursor = get_cursor(src);
+
+        // Strip a byte order mark if present
+        const BYTE_ORDER_MARK: &str = "\u{feff}";
+        if cursor.starts_with(BYTE_ORDER_MARK) {
+            cursor = cursor.advance(BYTE_ORDER_MARK.len());
+        }
+
+        parse::token_stream(cursor)
+    }
+}
+
+impl Display for LexError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str("cannot parse string into token stream")
+    }
+}
+
+impl Display for TokenStream {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let mut joint = false;
+        for (i, tt) in self.inner.iter().enumerate() {
+            if i != 0 && !joint {
+                write!(f, " ")?;
+            }
+            joint = false;
+            match tt {
+                TokenTree::Group(tt) => Display::fmt(tt, f),
+                TokenTree::Ident(tt) => Display::fmt(tt, f),
+                TokenTree::Punct(tt) => {
+                    joint = tt.spacing() == Spacing::Joint;
+                    Display::fmt(tt, f)
+                }
+                TokenTree::Literal(tt) => Display::fmt(tt, f),
+            }?;
+        }
+
+        Ok(())
+    }
+}
+
+impl Debug for TokenStream {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str("TokenStream ")?;
+        f.debug_list().entries(self.clone()).finish()
+    }
+}
+
+#[cfg(feature = "proc-macro")]
+impl From<proc_macro::TokenStream> for TokenStream {
+    fn from(inner: proc_macro::TokenStream) -> Self {
+        inner
+            .to_string()
+            .parse()
+            .expect("compiler token stream parse failed")
+    }
+}
+
+#[cfg(feature = "proc-macro")]
+impl From<TokenStream> for proc_macro::TokenStream {
+    fn from(inner: TokenStream) -> Self {
+        inner
+            .to_string()
+            .parse()
+            .expect("failed to parse to compiler tokens")
+    }
+}
+
+impl From<TokenTree> for TokenStream {
+    fn from(tree: TokenTree) -> Self {
+        let mut stream = RcVecBuilder::new();
+        push_token_from_proc_macro(stream.as_mut(), tree);
+        TokenStream {
+            inner: stream.build(),
+        }
+    }
+}
+
+impl FromIterator<TokenTree> for TokenStream {
+    fn from_iter<I: IntoIterator<Item = TokenTree>>(tokens: I) -> Self {
+        let mut stream = TokenStream::new();
+        stream.extend(tokens);
+        stream
+    }
+}
+
+impl FromIterator<TokenStream> for TokenStream {
+    fn from_iter<I: IntoIterator<Item = TokenStream>>(streams: I) -> Self {
+        let mut v = RcVecBuilder::new();
+
+        for stream in streams {
+            v.extend(stream.take_inner());
+        }
+
+        TokenStream { inner: v.build() }
+    }
+}
+
+impl Extend<TokenTree> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, tokens: I) {
+        let mut vec = self.inner.make_mut();
+        tokens
+            .into_iter()
+            .for_each(|token| push_token_from_proc_macro(vec.as_mut(), token));
+    }
+}
+
+impl Extend<TokenStream> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenStream>>(&mut self, streams: I) {
+        self.inner.make_mut().extend(streams.into_iter().flatten());
+    }
+}
+
+pub(crate) type TokenTreeIter = RcVecIntoIter<TokenTree>;
+
+impl IntoIterator for TokenStream {
+    type Item = TokenTree;
+    type IntoIter = TokenTreeIter;
+
+    fn into_iter(self) -> TokenTreeIter {
+        self.take_inner().into_iter()
+    }
+}
+
+#[cfg(procmacro2_semver_exempt)]
+#[derive(Clone, PartialEq, Eq)]
+pub(crate) struct SourceFile {
+    path: PathBuf,
+}
+
+#[cfg(procmacro2_semver_exempt)]
+impl SourceFile {
+    /// Get the path to this source file as a string.
+    pub fn path(&self) -> PathBuf {
+        self.path.clone()
+    }
+
+    pub fn is_real(&self) -> bool {
+        false
+    }
+}
+
+#[cfg(procmacro2_semver_exempt)]
+impl Debug for SourceFile {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("SourceFile")
+            .field("path", &self.path())
+            .field("is_real", &self.is_real())
+            .finish()
+    }
+}
+
+#[cfg(all(span_locations, not(fuzzing)))]
+thread_local! {
+    static SOURCE_MAP: RefCell<SourceMap> = RefCell::new(SourceMap {
+        // Start with a single dummy file which all call_site() and def_site()
+        // spans reference.
+        files: vec![FileInfo {
+            source_text: String::new(),
+            span: Span { lo: 0, hi: 0 },
+            lines: vec![0],
+            char_index_to_byte_offset: BTreeMap::new(),
+        }],
+    });
+}
+
+#[cfg(span_locations)]
+pub(crate) fn invalidate_current_thread_spans() {
+    #[cfg(not(fuzzing))]
+    SOURCE_MAP.with(|sm| sm.borrow_mut().files.truncate(1));
+}
+
+#[cfg(all(span_locations, not(fuzzing)))]
+struct FileInfo {
+    source_text: String,
+    span: Span,
+    lines: Vec<usize>,
+    char_index_to_byte_offset: BTreeMap<usize, usize>,
+}
+
+#[cfg(all(span_locations, not(fuzzing)))]
+impl FileInfo {
+    fn offset_line_column(&self, offset: usize) -> LineColumn {
+        assert!(self.span_within(Span {
+            lo: offset as u32,
+            hi: offset as u32,
+        }));
+        let offset = offset - self.span.lo as usize;
+        match self.lines.binary_search(&offset) {
+            Ok(found) => LineColumn {
+                line: found + 1,
+                column: 0,
+            },
+            Err(idx) => LineColumn {
+                line: idx,
+                column: offset - self.lines[idx - 1],
+            },
+        }
+    }
+
+    fn span_within(&self, span: Span) -> bool {
+        span.lo >= self.span.lo && span.hi <= self.span.hi
+    }
+
+    fn byte_range(&mut self, span: Span) -> Range<usize> {
+        let lo_char = (span.lo - self.span.lo) as usize;
+
+        // Look up offset of the largest already-computed char index that is
+        // less than or equal to the current requested one. We resume counting
+        // chars from that point.
+        let (&last_char_index, &last_byte_offset) = self
+            .char_index_to_byte_offset
+            .range(..=lo_char)
+            .next_back()
+            .unwrap_or((&0, &0));
+
+        let lo_byte = if last_char_index == lo_char {
+            last_byte_offset
+        } else {
+            let total_byte_offset = match self.source_text[last_byte_offset..]
+                .char_indices()
+                .nth(lo_char - last_char_index)
+            {
+                Some((additional_offset, _ch)) => last_byte_offset + additional_offset,
+                None => self.source_text.len(),
+            };
+            self.char_index_to_byte_offset
+                .insert(lo_char, total_byte_offset);
+            total_byte_offset
+        };
+
+        let trunc_lo = &self.source_text[lo_byte..];
+        let char_len = (span.hi - span.lo) as usize;
+        lo_byte..match trunc_lo.char_indices().nth(char_len) {
+            Some((offset, _ch)) => lo_byte + offset,
+            None => self.source_text.len(),
+        }
+    }
+
+    fn source_text(&mut self, span: Span) -> String {
+        let byte_range = self.byte_range(span);
+        self.source_text[byte_range].to_owned()
+    }
+}
+
+/// Computes the offsets of each line in the given source string
+/// and the total number of characters
+#[cfg(all(span_locations, not(fuzzing)))]
+fn lines_offsets(s: &str) -> (usize, Vec<usize>) {
+    let mut lines = vec![0];
+    let mut total = 0;
+
+    for ch in s.chars() {
+        total += 1;
+        if ch == '\n' {
+            lines.push(total);
+        }
+    }
+
+    (total, lines)
+}
+
+#[cfg(all(span_locations, not(fuzzing)))]
+struct SourceMap {
+    files: Vec<FileInfo>,
+}
+
+#[cfg(all(span_locations, not(fuzzing)))]
+impl SourceMap {
+    fn next_start_pos(&self) -> u32 {
+        // Add 1 so there's always space between files.
+        //
+        // We'll always have at least 1 file, as we initialize our files list
+        // with a dummy file.
+        self.files.last().unwrap().span.hi + 1
+    }
+
+    fn add_file(&mut self, src: &str) -> Span {
+        let (len, lines) = lines_offsets(src);
+        let lo = self.next_start_pos();
+        let span = Span {
+            lo,
+            hi: lo + (len as u32),
+        };
+
+        self.files.push(FileInfo {
+            source_text: src.to_owned(),
+            span,
+            lines,
+            // Populated lazily by source_text().
+            char_index_to_byte_offset: BTreeMap::new(),
+        });
+
+        span
+    }
+
+    #[cfg(procmacro2_semver_exempt)]
+    fn filepath(&self, span: Span) -> PathBuf {
+        for (i, file) in self.files.iter().enumerate() {
+            if file.span_within(span) {
+                return PathBuf::from(if i == 0 {
+                    "<unspecified>".to_owned()
+                } else {
+                    format!("<parsed string {}>", i)
+                });
+            }
+        }
+        unreachable!("Invalid span with no related FileInfo!");
+    }
+
+    fn fileinfo(&self, span: Span) -> &FileInfo {
+        for file in &self.files {
+            if file.span_within(span) {
+                return file;
+            }
+        }
+        unreachable!("Invalid span with no related FileInfo!");
+    }
+
+    fn fileinfo_mut(&mut self, span: Span) -> &mut FileInfo {
+        for file in &mut self.files {
+            if file.span_within(span) {
+                return file;
+            }
+        }
+        unreachable!("Invalid span with no related FileInfo!");
+    }
+}
+
+#[derive(Clone, Copy, PartialEq, Eq)]
+pub(crate) struct Span {
+    #[cfg(span_locations)]
+    pub(crate) lo: u32,
+    #[cfg(span_locations)]
+    pub(crate) hi: u32,
+}
+
+impl Span {
+    #[cfg(not(span_locations))]
+    pub fn call_site() -> Self {
+        Span {}
+    }
+
+    #[cfg(span_locations)]
+    pub fn call_site() -> Self {
+        Span { lo: 0, hi: 0 }
+    }
+
+    pub fn mixed_site() -> Self {
+        Span::call_site()
+    }
+
+    #[cfg(procmacro2_semver_exempt)]
+    pub fn def_site() -> Self {
+        Span::call_site()
+    }
+
+    pub fn resolved_at(&self, _other: Span) -> Span {
+        // Stable spans consist only of line/column information, so
+        // `resolved_at` and `located_at` only select which span the
+        // caller wants line/column information from.
+        *self
+    }
+
+    pub fn located_at(&self, other: Span) -> Span {
+        other
+    }
+
+    #[cfg(procmacro2_semver_exempt)]
+    pub fn source_file(&self) -> SourceFile {
+        #[cfg(fuzzing)]
+        return SourceFile {
+            path: PathBuf::from("<unspecified>"),
+        };
+
+        #[cfg(not(fuzzing))]
+        SOURCE_MAP.with(|sm| {
+            let sm = sm.borrow();
+            let path = sm.filepath(*self);
+            SourceFile { path }
+        })
+    }
+
+    #[cfg(span_locations)]
+    pub fn byte_range(&self) -> Range<usize> {
+        #[cfg(fuzzing)]
+        return 0..0;
+
+        #[cfg(not(fuzzing))]
+        {
+            if self.is_call_site() {
+                0..0
+            } else {
+                SOURCE_MAP.with(|sm| sm.borrow_mut().fileinfo_mut(*self).byte_range(*self))
+            }
+        }
+    }
+
+    #[cfg(span_locations)]
+    pub fn start(&self) -> LineColumn {
+        #[cfg(fuzzing)]
+        return LineColumn { line: 0, column: 0 };
+
+        #[cfg(not(fuzzing))]
+        SOURCE_MAP.with(|sm| {
+            let sm = sm.borrow();
+            let fi = sm.fileinfo(*self);
+            fi.offset_line_column(self.lo as usize)
+        })
+    }
+
+    #[cfg(span_locations)]
+    pub fn end(&self) -> LineColumn {
+        #[cfg(fuzzing)]
+        return LineColumn { line: 0, column: 0 };
+
+        #[cfg(not(fuzzing))]
+        SOURCE_MAP.with(|sm| {
+            let sm = sm.borrow();
+            let fi = sm.fileinfo(*self);
+            fi.offset_line_column(self.hi as usize)
+        })
+    }
+
+    #[cfg(not(span_locations))]
+    pub fn join(&self, _other: Span) -> Option<Span> {
+        Some(Span {})
+    }
+
+    #[cfg(span_locations)]
+    pub fn join(&self, other: Span) -> Option<Span> {
+        #[cfg(fuzzing)]
+        return {
+            let _ = other;
+            None
+        };
+
+        #[cfg(not(fuzzing))]
+        SOURCE_MAP.with(|sm| {
+            let sm = sm.borrow();
+            // If `other` is not within the same FileInfo as us, return None.
+            if !sm.fileinfo(*self).span_within(other) {
+                return None;
+            }
+            Some(Span {
+                lo: cmp::min(self.lo, other.lo),
+                hi: cmp::max(self.hi, other.hi),
+            })
+        })
+    }
+
+    #[cfg(not(span_locations))]
+    pub fn source_text(&self) -> Option<String> {
+        None
+    }
+
+    #[cfg(span_locations)]
+    pub fn source_text(&self) -> Option<String> {
+        #[cfg(fuzzing)]
+        return None;
+
+        #[cfg(not(fuzzing))]
+        {
+            if self.is_call_site() {
+                None
+            } else {
+                Some(SOURCE_MAP.with(|sm| sm.borrow_mut().fileinfo_mut(*self).source_text(*self)))
+            }
+        }
+    }
+
+    #[cfg(not(span_locations))]
+    pub(crate) fn first_byte(self) -> Self {
+        self
+    }
+
+    #[cfg(span_locations)]
+    pub(crate) fn first_byte(self) -> Self {
+        Span {
+            lo: self.lo,
+            hi: cmp::min(self.lo.saturating_add(1), self.hi),
+        }
+    }
+
+    #[cfg(not(span_locations))]
+    pub(crate) fn last_byte(self) -> Self {
+        self
+    }
+
+    #[cfg(span_locations)]
+    pub(crate) fn last_byte(self) -> Self {
+        Span {
+            lo: cmp::max(self.hi.saturating_sub(1), self.lo),
+            hi: self.hi,
+        }
+    }
+
+    #[cfg(span_locations)]
+    fn is_call_site(&self) -> bool {
+        self.lo == 0 && self.hi == 0
+    }
+}
+
+impl Debug for Span {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        #[cfg(span_locations)]
+        return write!(f, "bytes({}..{})", self.lo, self.hi);
+
+        #[cfg(not(span_locations))]
+        write!(f, "Span")
+    }
+}
+
+pub(crate) fn debug_span_field_if_nontrivial(debug: &mut fmt::DebugStruct, span: Span) {
+    #[cfg(span_locations)]
+    {
+        if span.is_call_site() {
+            return;
+        }
+    }
+
+    if cfg!(span_locations) {
+        debug.field("span", &span);
+    }
+}
+
+#[derive(Clone)]
+pub(crate) struct Group {
+    delimiter: Delimiter,
+    stream: TokenStream,
+    span: Span,
+}
+
+impl Group {
+    pub fn new(delimiter: Delimiter, stream: TokenStream) -> Self {
+        Group {
+            delimiter,
+            stream,
+            span: Span::call_site(),
+        }
+    }
+
+    pub fn delimiter(&self) -> Delimiter {
+        self.delimiter
+    }
+
+    pub fn stream(&self) -> TokenStream {
+        self.stream.clone()
+    }
+
+    pub fn span(&self) -> Span {
+        self.span
+    }
+
+    pub fn span_open(&self) -> Span {
+        self.span.first_byte()
+    }
+
+    pub fn span_close(&self) -> Span {
+        self.span.last_byte()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.span = span;
+    }
+}
+
+impl Display for Group {
+    // We attempt to match libproc_macro's formatting.
+    // Empty parens: ()
+    // Nonempty parens: (...)
+    // Empty brackets: []
+    // Nonempty brackets: [...]
+    // Empty braces: { }
+    // Nonempty braces: { ... }
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let (open, close) = match self.delimiter {
+            Delimiter::Parenthesis => ("(", ")"),
+            Delimiter::Brace => ("{ ", "}"),
+            Delimiter::Bracket => ("[", "]"),
+            Delimiter::None => ("", ""),
+        };
+
+        f.write_str(open)?;
+        Display::fmt(&self.stream, f)?;
+        if self.delimiter == Delimiter::Brace && !self.stream.inner.is_empty() {
+            f.write_str(" ")?;
+        }
+        f.write_str(close)?;
+
+        Ok(())
+    }
+}
+
+impl Debug for Group {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = fmt.debug_struct("Group");
+        debug.field("delimiter", &self.delimiter);
+        debug.field("stream", &self.stream);
+        debug_span_field_if_nontrivial(&mut debug, self.span);
+        debug.finish()
+    }
+}
+
+#[derive(Clone)]
+pub(crate) struct Ident {
+    sym: Box<str>,
+    span: Span,
+    raw: bool,
+}
+
+impl Ident {
+    #[track_caller]
+    pub fn new_checked(string: &str, span: Span) -> Self {
+        validate_ident(string);
+        Ident::new_unchecked(string, span)
+    }
+
+    pub fn new_unchecked(string: &str, span: Span) -> Self {
+        Ident {
+            sym: Box::from(string),
+            span,
+            raw: false,
+        }
+    }
+
+    #[track_caller]
+    pub fn new_raw_checked(string: &str, span: Span) -> Self {
+        validate_ident_raw(string);
+        Ident::new_raw_unchecked(string, span)
+    }
+
+    pub fn new_raw_unchecked(string: &str, span: Span) -> Self {
+        Ident {
+            sym: Box::from(string),
+            span,
+            raw: true,
+        }
+    }
+
+    pub fn span(&self) -> Span {
+        self.span
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.span = span;
+    }
+}
+
+pub(crate) fn is_ident_start(c: char) -> bool {
+    c == '_' || unicode_ident::is_xid_start(c)
+}
+
+pub(crate) fn is_ident_continue(c: char) -> bool {
+    unicode_ident::is_xid_continue(c)
+}
+
+#[track_caller]
+fn validate_ident(string: &str) {
+    if string.is_empty() {
+        panic!("Ident is not allowed to be empty; use Option<Ident>");
+    }
+
+    if string.bytes().all(|digit| b'0' <= digit && digit <= b'9') {
+        panic!("Ident cannot be a number; use Literal instead");
+    }
+
+    fn ident_ok(string: &str) -> bool {
+        let mut chars = string.chars();
+        let first = chars.next().unwrap();
+        if !is_ident_start(first) {
+            return false;
+        }
+        for ch in chars {
+            if !is_ident_continue(ch) {
+                return false;
+            }
+        }
+        true
+    }
+
+    if !ident_ok(string) {
+        panic!("{:?} is not a valid Ident", string);
+    }
+}
+
+#[track_caller]
+fn validate_ident_raw(string: &str) {
+    validate_ident(string);
+
+    match string {
+        "_" | "super" | "self" | "Self" | "crate" => {
+            panic!("`r#{}` cannot be a raw identifier", string);
+        }
+        _ => {}
+    }
+}
+
+impl PartialEq for Ident {
+    fn eq(&self, other: &Ident) -> bool {
+        self.sym == other.sym && self.raw == other.raw
+    }
+}
+
+impl<T> PartialEq<T> for Ident
+where
+    T: ?Sized + AsRef<str>,
+{
+    fn eq(&self, other: &T) -> bool {
+        let other = other.as_ref();
+        if self.raw {
+            other.starts_with("r#") && *self.sym == other[2..]
+        } else {
+            *self.sym == *other
+        }
+    }
+}
+
+impl Display for Ident {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        if self.raw {
+            f.write_str("r#")?;
+        }
+        Display::fmt(&self.sym, f)
+    }
+}
+
+#[allow(clippy::missing_fields_in_debug)]
+impl Debug for Ident {
+    // Ident(proc_macro), Ident(r#union)
+    #[cfg(not(span_locations))]
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = f.debug_tuple("Ident");
+        debug.field(&format_args!("{}", self));
+        debug.finish()
+    }
+
+    // Ident {
+    //     sym: proc_macro,
+    //     span: bytes(128..138)
+    // }
+    #[cfg(span_locations)]
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = f.debug_struct("Ident");
+        debug.field("sym", &format_args!("{}", self));
+        debug_span_field_if_nontrivial(&mut debug, self.span);
+        debug.finish()
+    }
+}
+
+#[derive(Clone)]
+pub(crate) struct Literal {
+    pub(crate) repr: String,
+    span: Span,
+}
+
+macro_rules! suffixed_numbers {
+    ($($name:ident => $kind:ident,)*) => ($(
+        pub fn $name(n: $kind) -> Literal {
+            Literal::_new(format!(concat!("{}", stringify!($kind)), n))
+        }
+    )*)
+}
+
+macro_rules! unsuffixed_numbers {
+    ($($name:ident => $kind:ident,)*) => ($(
+        pub fn $name(n: $kind) -> Literal {
+            Literal::_new(n.to_string())
+        }
+    )*)
+}
+
+impl Literal {
+    pub(crate) fn _new(repr: String) -> Self {
+        Literal {
+            repr,
+            span: Span::call_site(),
+        }
+    }
+
+    pub(crate) unsafe fn from_str_unchecked(repr: &str) -> Self {
+        Literal::_new(repr.to_owned())
+    }
+
+    suffixed_numbers! {
+        u8_suffixed => u8,
+        u16_suffixed => u16,
+        u32_suffixed => u32,
+        u64_suffixed => u64,
+        u128_suffixed => u128,
+        usize_suffixed => usize,
+        i8_suffixed => i8,
+        i16_suffixed => i16,
+        i32_suffixed => i32,
+        i64_suffixed => i64,
+        i128_suffixed => i128,
+        isize_suffixed => isize,
+
+        f32_suffixed => f32,
+        f64_suffixed => f64,
+    }
+
+    unsuffixed_numbers! {
+        u8_unsuffixed => u8,
+        u16_unsuffixed => u16,
+        u32_unsuffixed => u32,
+        u64_unsuffixed => u64,
+        u128_unsuffixed => u128,
+        usize_unsuffixed => usize,
+        i8_unsuffixed => i8,
+        i16_unsuffixed => i16,
+        i32_unsuffixed => i32,
+        i64_unsuffixed => i64,
+        i128_unsuffixed => i128,
+        isize_unsuffixed => isize,
+    }
+
+    pub fn f32_unsuffixed(f: f32) -> Literal {
+        let mut s = f.to_string();
+        if !s.contains('.') {
+            s.push_str(".0");
+        }
+        Literal::_new(s)
+    }
+
+    pub fn f64_unsuffixed(f: f64) -> Literal {
+        let mut s = f.to_string();
+        if !s.contains('.') {
+            s.push_str(".0");
+        }
+        Literal::_new(s)
+    }
+
+    pub fn string(string: &str) -> Literal {
+        let mut repr = String::with_capacity(string.len() + 2);
+        repr.push('"');
+        escape_utf8(string, &mut repr);
+        repr.push('"');
+        Literal::_new(repr)
+    }
+
+    pub fn character(ch: char) -> Literal {
+        let mut repr = String::new();
+        repr.push('\'');
+        if ch == '"' {
+            // escape_debug turns this into '\"' which is unnecessary.
+            repr.push(ch);
+        } else {
+            repr.extend(ch.escape_debug());
+        }
+        repr.push('\'');
+        Literal::_new(repr)
+    }
+
+    pub fn byte_character(byte: u8) -> Literal {
+        let mut repr = "b'".to_string();
+        #[allow(clippy::match_overlapping_arm)]
+        match byte {
+            b'\0' => repr.push_str(r"\0"),
+            b'\t' => repr.push_str(r"\t"),
+            b'\n' => repr.push_str(r"\n"),
+            b'\r' => repr.push_str(r"\r"),
+            b'\'' => repr.push_str(r"\'"),
+            b'\\' => repr.push_str(r"\\"),
+            b'\x20'..=b'\x7E' => repr.push(byte as char),
+            _ => {
+                let _ = write!(repr, r"\x{:02X}", byte);
+            }
+        }
+        repr.push('\'');
+        Literal::_new(repr)
+    }
+
+    pub fn byte_string(bytes: &[u8]) -> Literal {
+        let mut repr = "b\"".to_string();
+        let mut bytes = bytes.iter();
+        while let Some(&b) = bytes.next() {
+            #[allow(clippy::match_overlapping_arm)]
+            match b {
+                b'\0' => repr.push_str(match bytes.as_slice().first() {
+                    // circumvent clippy::octal_escapes lint
+                    Some(b'0'..=b'7') => r"\x00",
+                    _ => r"\0",
+                }),
+                b'\t' => repr.push_str(r"\t"),
+                b'\n' => repr.push_str(r"\n"),
+                b'\r' => repr.push_str(r"\r"),
+                b'"' => repr.push_str("\\\""),
+                b'\\' => repr.push_str(r"\\"),
+                b'\x20'..=b'\x7E' => repr.push(b as char),
+                _ => {
+                    let _ = write!(repr, r"\x{:02X}", b);
+                }
+            }
+        }
+        repr.push('"');
+        Literal::_new(repr)
+    }
+
+    pub fn c_string(string: &CStr) -> Literal {
+        let mut repr = "c\"".to_string();
+        let mut bytes = string.to_bytes();
+        while !bytes.is_empty() {
+            let (valid, invalid) = match str::from_utf8(bytes) {
+                Ok(all_valid) => {
+                    bytes = b"";
+                    (all_valid, bytes)
+                }
+                Err(utf8_error) => {
+                    let (valid, rest) = bytes.split_at(utf8_error.valid_up_to());
+                    let valid = str::from_utf8(valid).unwrap();
+                    let invalid = utf8_error
+                        .error_len()
+                        .map_or(rest, |error_len| &rest[..error_len]);
+                    bytes = &bytes[valid.len() + invalid.len()..];
+                    (valid, invalid)
+                }
+            };
+            escape_utf8(valid, &mut repr);
+            for &byte in invalid {
+                let _ = write!(repr, r"\x{:02X}", byte);
+            }
+        }
+        repr.push('"');
+        Literal::_new(repr)
+    }
+
+    pub fn span(&self) -> Span {
+        self.span
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.span = span;
+    }
+
+    pub fn subspan<R: RangeBounds<usize>>(&self, range: R) -> Option<Span> {
+        #[cfg(not(span_locations))]
+        {
+            let _ = range;
+            None
+        }
+
+        #[cfg(span_locations)]
+        {
+            use core::ops::Bound;
+
+            let lo = match range.start_bound() {
+                Bound::Included(start) => {
+                    let start = u32::try_from(*start).ok()?;
+                    self.span.lo.checked_add(start)?
+                }
+                Bound::Excluded(start) => {
+                    let start = u32::try_from(*start).ok()?;
+                    self.span.lo.checked_add(start)?.checked_add(1)?
+                }
+                Bound::Unbounded => self.span.lo,
+            };
+            let hi = match range.end_bound() {
+                Bound::Included(end) => {
+                    let end = u32::try_from(*end).ok()?;
+                    self.span.lo.checked_add(end)?.checked_add(1)?
+                }
+                Bound::Excluded(end) => {
+                    let end = u32::try_from(*end).ok()?;
+                    self.span.lo.checked_add(end)?
+                }
+                Bound::Unbounded => self.span.hi,
+            };
+            if lo <= hi && hi <= self.span.hi {
+                Some(Span { lo, hi })
+            } else {
+                None
+            }
+        }
+    }
+}
+
+impl FromStr for Literal {
+    type Err = LexError;
+
+    fn from_str(repr: &str) -> Result<Self, Self::Err> {
+        let mut cursor = get_cursor(repr);
+        #[cfg(span_locations)]
+        let lo = cursor.off;
+
+        let negative = cursor.starts_with_char('-');
+        if negative {
+            cursor = cursor.advance(1);
+            if !cursor.starts_with_fn(|ch| ch.is_ascii_digit()) {
+                return Err(LexError::call_site());
+            }
+        }
+
+        if let Ok((rest, mut literal)) = parse::literal(cursor) {
+            if rest.is_empty() {
+                if negative {
+                    literal.repr.insert(0, '-');
+                }
+                literal.span = Span {
+                    #[cfg(span_locations)]
+                    lo,
+                    #[cfg(span_locations)]
+                    hi: rest.off,
+                };
+                return Ok(literal);
+            }
+        }
+        Err(LexError::call_site())
+    }
+}
+
+impl Display for Literal {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.repr, f)
+    }
+}
+
+impl Debug for Literal {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = fmt.debug_struct("Literal");
+        debug.field("lit", &format_args!("{}", self.repr));
+        debug_span_field_if_nontrivial(&mut debug, self.span);
+        debug.finish()
+    }
+}
+
+fn escape_utf8(string: &str, repr: &mut String) {
+    let mut chars = string.chars();
+    while let Some(ch) = chars.next() {
+        if ch == '\0' {
+            repr.push_str(
+                if chars
+                    .as_str()
+                    .starts_with(|next| '0' <= next && next <= '7')
+                {
+                    // circumvent clippy::octal_escapes lint
+                    r"\x00"
+                } else {
+                    r"\0"
+                },
+            );
+        } else if ch == '\'' {
+            // escape_debug turns this into "\'" which is unnecessary.
+            repr.push(ch);
+        } else {
+            repr.extend(ch.escape_debug());
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/proc-macro2/src/lib.rs
--- 43.0.0-1/rust-vendor/proc-macro2/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1369 @@
+//! [![github]](https://github.com/dtolnay/proc-macro2)&ensp;[![crates-io]](https://crates.io/crates/proc-macro2)&ensp;[![docs-rs]](crate)
+//!
+//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
+//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust
+//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs
+//!
+//! <br>
+//!
+//! A wrapper around the procedural macro API of the compiler's [`proc_macro`]
+//! crate. This library serves two purposes:
+//!
+//! [`proc_macro`]: https://doc.rust-lang.org/proc_macro/
+//!
+//! - **Bring proc-macro-like functionality to other contexts like build.rs and
+//!   main.rs.** Types from `proc_macro` are entirely specific to procedural
+//!   macros and cannot ever exist in code outside of a procedural macro.
+//!   Meanwhile `proc_macro2` types may exist anywhere including non-macro code.
+//!   By developing foundational libraries like [syn] and [quote] against
+//!   `proc_macro2` rather than `proc_macro`, the procedural macro ecosystem
+//!   becomes easily applicable to many other use cases and we avoid
+//!   reimplementing non-macro equivalents of those libraries.
+//!
+//! - **Make procedural macros unit testable.** As a consequence of being
+//!   specific to procedural macros, nothing that uses `proc_macro` can be
+//!   executed from a unit test. In order for helper libraries or components of
+//!   a macro to be testable in isolation, they must be implemented using
+//!   `proc_macro2`.
+//!
+//! [syn]: https://github.com/dtolnay/syn
+//! [quote]: https://github.com/dtolnay/quote
+//!
+//! # Usage
+//!
+//! The skeleton of a typical procedural macro typically looks like this:
+//!
+//! ```
+//! extern crate proc_macro;
+//!
+//! # const IGNORE: &str = stringify! {
+//! #[proc_macro_derive(MyDerive)]
+//! # };
+//! # #[cfg(wrap_proc_macro)]
+//! pub fn my_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
+//!     let input = proc_macro2::TokenStream::from(input);
+//!
+//!     let output: proc_macro2::TokenStream = {
+//!         /* transform input */
+//!         # input
+//!     };
+//!
+//!     proc_macro::TokenStream::from(output)
+//! }
+//! ```
+//!
+//! If parsing with [Syn], you'll use [`parse_macro_input!`] instead to
+//! propagate parse errors correctly back to the compiler when parsing fails.
+//!
+//! [`parse_macro_input!`]: https://docs.rs/syn/2.0/syn/macro.parse_macro_input.html
+//!
+//! # Unstable features
+//!
+//! The default feature set of proc-macro2 tracks the most recent stable
+//! compiler API. Functionality in `proc_macro` that is not yet stable is not
+//! exposed by proc-macro2 by default.
+//!
+//! To opt into the additional APIs available in the most recent nightly
+//! compiler, the `procmacro2_semver_exempt` config flag must be passed to
+//! rustc. We will polyfill those nightly-only APIs back to Rust 1.56.0. As
+//! these are unstable APIs that track the nightly compiler, minor versions of
+//! proc-macro2 may make breaking changes to them at any time.
+//!
+//! ```sh
+//! RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo build
+//! ```
+//!
+//! Note that this must not only be done for your crate, but for any crate that
+//! depends on your crate. This infectious nature is intentional, as it serves
+//! as a reminder that you are outside of the normal semver guarantees.
+//!
+//! Semver exempt methods are marked as such in the proc-macro2 documentation.
+//!
+//! # Thread-Safety
+//!
+//! Most types in this crate are `!Sync` because the underlying compiler
+//! types make use of thread-local memory, meaning they cannot be accessed from
+//! a different thread.
+
+// Proc-macro2 types in rustdoc of other crates get linked to here.
+#![doc(html_root_url = "https://docs.rs/proc-macro2/1.0.86")]
+#![cfg_attr(any(proc_macro_span, super_unstable), feature(proc_macro_span))]
+#![cfg_attr(super_unstable, feature(proc_macro_def_site))]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![deny(unsafe_op_in_unsafe_fn)]
+#![allow(
+    clippy::cast_lossless,
+    clippy::cast_possible_truncation,
+    clippy::checked_conversions,
+    clippy::doc_markdown,
+    clippy::incompatible_msrv,
+    clippy::items_after_statements,
+    clippy::iter_without_into_iter,
+    clippy::let_underscore_untyped,
+    clippy::manual_assert,
+    clippy::manual_range_contains,
+    clippy::missing_safety_doc,
+    clippy::must_use_candidate,
+    clippy::needless_doctest_main,
+    clippy::new_without_default,
+    clippy::return_self_not_must_use,
+    clippy::shadow_unrelated,
+    clippy::trivially_copy_pass_by_ref,
+    clippy::unnecessary_wraps,
+    clippy::unused_self,
+    clippy::used_underscore_binding,
+    clippy::vec_init_then_push
+)]
+
+#[cfg(all(procmacro2_semver_exempt, wrap_proc_macro, not(super_unstable)))]
+compile_error! {"\
+    Something is not right. If you've tried to turn on \
+    procmacro2_semver_exempt, you need to ensure that it \
+    is turned on for the compilation of the proc-macro2 \
+    build script as well.
+"}
+
+#[cfg(all(
+    procmacro2_nightly_testing,
+    feature = "proc-macro",
+    not(proc_macro_span)
+))]
+compile_error! {"\
+    Build script probe failed to compile.
+"}
+
+extern crate alloc;
+
+#[cfg(feature = "proc-macro")]
+extern crate proc_macro;
+
+mod marker;
+mod parse;
+mod rcvec;
+
+#[cfg(wrap_proc_macro)]
+mod detection;
+
+// Public for proc_macro2::fallback::force() and unforce(), but those are quite
+// a niche use case so we omit it from rustdoc.
+#[doc(hidden)]
+pub mod fallback;
+
+pub mod extra;
+
+#[cfg(not(wrap_proc_macro))]
+use crate::fallback as imp;
+#[path = "wrapper.rs"]
+#[cfg(wrap_proc_macro)]
+mod imp;
+
+#[cfg(span_locations)]
+mod location;
+
+use crate::extra::DelimSpan;
+use crate::marker::{ProcMacroAutoTraits, MARKER};
+use core::cmp::Ordering;
+use core::fmt::{self, Debug, Display};
+use core::hash::{Hash, Hasher};
+#[cfg(span_locations)]
+use core::ops::Range;
+use core::ops::RangeBounds;
+use core::str::FromStr;
+use std::error::Error;
+use std::ffi::CStr;
+#[cfg(procmacro2_semver_exempt)]
+use std::path::PathBuf;
+
+#[cfg(span_locations)]
+#[cfg_attr(docsrs, doc(cfg(feature = "span-locations")))]
+pub use crate::location::LineColumn;
+
+/// An abstract stream of tokens, or more concretely a sequence of token trees.
+///
+/// This type provides interfaces for iterating over token trees and for
+/// collecting token trees into one stream.
+///
+/// Token stream is both the input and output of `#[proc_macro]`,
+/// `#[proc_macro_attribute]` and `#[proc_macro_derive]` definitions.
+#[derive(Clone)]
+pub struct TokenStream {
+    inner: imp::TokenStream,
+    _marker: ProcMacroAutoTraits,
+}
+
+/// Error returned from `TokenStream::from_str`.
+pub struct LexError {
+    inner: imp::LexError,
+    _marker: ProcMacroAutoTraits,
+}
+
+impl TokenStream {
+    fn _new(inner: imp::TokenStream) -> Self {
+        TokenStream {
+            inner,
+            _marker: MARKER,
+        }
+    }
+
+    fn _new_fallback(inner: fallback::TokenStream) -> Self {
+        TokenStream {
+            inner: inner.into(),
+            _marker: MARKER,
+        }
+    }
+
+    /// Returns an empty `TokenStream` containing no token trees.
+    pub fn new() -> Self {
+        TokenStream::_new(imp::TokenStream::new())
+    }
+
+    /// Checks if this `TokenStream` is empty.
+    pub fn is_empty(&self) -> bool {
+        self.inner.is_empty()
+    }
+}
+
+/// `TokenStream::default()` returns an empty stream,
+/// i.e. this is equivalent with `TokenStream::new()`.
+impl Default for TokenStream {
+    fn default() -> Self {
+        TokenStream::new()
+    }
+}
+
+/// Attempts to break the string into tokens and parse those tokens into a token
+/// stream.
+///
+/// May fail for a number of reasons, for example, if the string contains
+/// unbalanced delimiters or characters not existing in the language.
+///
+/// NOTE: Some errors may cause panics instead of returning `LexError`. We
+/// reserve the right to change these errors into `LexError`s later.
+impl FromStr for TokenStream {
+    type Err = LexError;
+
+    fn from_str(src: &str) -> Result<TokenStream, LexError> {
+        let e = src.parse().map_err(|e| LexError {
+            inner: e,
+            _marker: MARKER,
+        })?;
+        Ok(TokenStream::_new(e))
+    }
+}
+
+#[cfg(feature = "proc-macro")]
+#[cfg_attr(docsrs, doc(cfg(feature = "proc-macro")))]
+impl From<proc_macro::TokenStream> for TokenStream {
+    fn from(inner: proc_macro::TokenStream) -> Self {
+        TokenStream::_new(inner.into())
+    }
+}
+
+#[cfg(feature = "proc-macro")]
+#[cfg_attr(docsrs, doc(cfg(feature = "proc-macro")))]
+impl From<TokenStream> for proc_macro::TokenStream {
+    fn from(inner: TokenStream) -> Self {
+        inner.inner.into()
+    }
+}
+
+impl From<TokenTree> for TokenStream {
+    fn from(token: TokenTree) -> Self {
+        TokenStream::_new(imp::TokenStream::from(token))
+    }
+}
+
+impl Extend<TokenTree> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, streams: I) {
+        self.inner.extend(streams);
+    }
+}
+
+impl Extend<TokenStream> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenStream>>(&mut self, streams: I) {
+        self.inner
+            .extend(streams.into_iter().map(|stream| stream.inner));
+    }
+}
+
+/// Collects a number of token trees into a single stream.
+impl FromIterator<TokenTree> for TokenStream {
+    fn from_iter<I: IntoIterator<Item = TokenTree>>(streams: I) -> Self {
+        TokenStream::_new(streams.into_iter().collect())
+    }
+}
+impl FromIterator<TokenStream> for TokenStream {
+    fn from_iter<I: IntoIterator<Item = TokenStream>>(streams: I) -> Self {
+        TokenStream::_new(streams.into_iter().map(|i| i.inner).collect())
+    }
+}
+
+/// Prints the token stream as a string that is supposed to be losslessly
+/// convertible back into the same token stream (modulo spans), except for
+/// possibly `TokenTree::Group`s with `Delimiter::None` delimiters and negative
+/// numeric literals.
+impl Display for TokenStream {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.inner, f)
+    }
+}
+
+/// Prints token in a form convenient for debugging.
+impl Debug for TokenStream {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.inner, f)
+    }
+}
+
+impl LexError {
+    pub fn span(&self) -> Span {
+        Span::_new(self.inner.span())
+    }
+}
+
+impl Debug for LexError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.inner, f)
+    }
+}
+
+impl Display for LexError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.inner, f)
+    }
+}
+
+impl Error for LexError {}
+
+/// The source file of a given `Span`.
+///
+/// This type is semver exempt and not exposed by default.
+#[cfg(all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)))]
+#[cfg_attr(docsrs, doc(cfg(procmacro2_semver_exempt)))]
+#[derive(Clone, PartialEq, Eq)]
+pub struct SourceFile {
+    inner: imp::SourceFile,
+    _marker: ProcMacroAutoTraits,
+}
+
+#[cfg(all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)))]
+impl SourceFile {
+    fn _new(inner: imp::SourceFile) -> Self {
+        SourceFile {
+            inner,
+            _marker: MARKER,
+        }
+    }
+
+    /// Get the path to this source file.
+    ///
+    /// ### Note
+    ///
+    /// If the code span associated with this `SourceFile` was generated by an
+    /// external macro, this may not be an actual path on the filesystem. Use
+    /// [`is_real`] to check.
+    ///
+    /// Also note that even if `is_real` returns `true`, if
+    /// `--remap-path-prefix` was passed on the command line, the path as given
+    /// may not actually be valid.
+    ///
+    /// [`is_real`]: #method.is_real
+    pub fn path(&self) -> PathBuf {
+        self.inner.path()
+    }
+
+    /// Returns `true` if this source file is a real source file, and not
+    /// generated by an external macro's expansion.
+    pub fn is_real(&self) -> bool {
+        self.inner.is_real()
+    }
+}
+
+#[cfg(all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)))]
+impl Debug for SourceFile {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.inner, f)
+    }
+}
+
+/// A region of source code, along with macro expansion information.
+#[derive(Copy, Clone)]
+pub struct Span {
+    inner: imp::Span,
+    _marker: ProcMacroAutoTraits,
+}
+
+impl Span {
+    fn _new(inner: imp::Span) -> Self {
+        Span {
+            inner,
+            _marker: MARKER,
+        }
+    }
+
+    fn _new_fallback(inner: fallback::Span) -> Self {
+        Span {
+            inner: inner.into(),
+            _marker: MARKER,
+        }
+    }
+
+    /// The span of the invocation of the current procedural macro.
+    ///
+    /// Identifiers created with this span will be resolved as if they were
+    /// written directly at the macro call location (call-site hygiene) and
+    /// other code at the macro call site will be able to refer to them as well.
+    pub fn call_site() -> Self {
+        Span::_new(imp::Span::call_site())
+    }
+
+    /// The span located at the invocation of the procedural macro, but with
+    /// local variables, labels, and `$crate` resolved at the definition site
+    /// of the macro. This is the same hygiene behavior as `macro_rules`.
+    pub fn mixed_site() -> Self {
+        Span::_new(imp::Span::mixed_site())
+    }
+
+    /// A span that resolves at the macro definition site.
+    ///
+    /// This method is semver exempt and not exposed by default.
+    #[cfg(procmacro2_semver_exempt)]
+    #[cfg_attr(docsrs, doc(cfg(procmacro2_semver_exempt)))]
+    pub fn def_site() -> Self {
+        Span::_new(imp::Span::def_site())
+    }
+
+    /// Creates a new span with the same line/column information as `self` but
+    /// that resolves symbols as though it were at `other`.
+    pub fn resolved_at(&self, other: Span) -> Span {
+        Span::_new(self.inner.resolved_at(other.inner))
+    }
+
+    /// Creates a new span with the same name resolution behavior as `self` but
+    /// with the line/column information of `other`.
+    pub fn located_at(&self, other: Span) -> Span {
+        Span::_new(self.inner.located_at(other.inner))
+    }
+
+    /// Convert `proc_macro2::Span` to `proc_macro::Span`.
+    ///
+    /// This method is available when building with a nightly compiler, or when
+    /// building with rustc 1.29+ *without* semver exempt features.
+    ///
+    /// # Panics
+    ///
+    /// Panics if called from outside of a procedural macro. Unlike
+    /// `proc_macro2::Span`, the `proc_macro::Span` type can only exist within
+    /// the context of a procedural macro invocation.
+    #[cfg(wrap_proc_macro)]
+    pub fn unwrap(self) -> proc_macro::Span {
+        self.inner.unwrap()
+    }
+
+    // Soft deprecated. Please use Span::unwrap.
+    #[cfg(wrap_proc_macro)]
+    #[doc(hidden)]
+    pub fn unstable(self) -> proc_macro::Span {
+        self.unwrap()
+    }
+
+    /// The original source file into which this span points.
+    ///
+    /// This method is semver exempt and not exposed by default.
+    #[cfg(all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)))]
+    #[cfg_attr(docsrs, doc(cfg(procmacro2_semver_exempt)))]
+    pub fn source_file(&self) -> SourceFile {
+        SourceFile::_new(self.inner.source_file())
+    }
+
+    /// Returns the span's byte position range in the source file.
+    ///
+    /// This method requires the `"span-locations"` feature to be enabled.
+    ///
+    /// When executing in a procedural macro context, the returned range is only
+    /// accurate if compiled with a nightly toolchain. The stable toolchain does
+    /// not have this information available. When executing outside of a
+    /// procedural macro, such as main.rs or build.rs, the byte range is always
+    /// accurate regardless of toolchain.
+    #[cfg(span_locations)]
+    #[cfg_attr(docsrs, doc(cfg(feature = "span-locations")))]
+    pub fn byte_range(&self) -> Range<usize> {
+        self.inner.byte_range()
+    }
+
+    /// Get the starting line/column in the source file for this span.
+    ///
+    /// This method requires the `"span-locations"` feature to be enabled.
+    ///
+    /// When executing in a procedural macro context, the returned line/column
+    /// are only meaningful if compiled with a nightly toolchain. The stable
+    /// toolchain does not have this information available. When executing
+    /// outside of a procedural macro, such as main.rs or build.rs, the
+    /// line/column are always meaningful regardless of toolchain.
+    #[cfg(span_locations)]
+    #[cfg_attr(docsrs, doc(cfg(feature = "span-locations")))]
+    pub fn start(&self) -> LineColumn {
+        self.inner.start()
+    }
+
+    /// Get the ending line/column in the source file for this span.
+    ///
+    /// This method requires the `"span-locations"` feature to be enabled.
+    ///
+    /// When executing in a procedural macro context, the returned line/column
+    /// are only meaningful if compiled with a nightly toolchain. The stable
+    /// toolchain does not have this information available. When executing
+    /// outside of a procedural macro, such as main.rs or build.rs, the
+    /// line/column are always meaningful regardless of toolchain.
+    #[cfg(span_locations)]
+    #[cfg_attr(docsrs, doc(cfg(feature = "span-locations")))]
+    pub fn end(&self) -> LineColumn {
+        self.inner.end()
+    }
+
+    /// Create a new span encompassing `self` and `other`.
+    ///
+    /// Returns `None` if `self` and `other` are from different files.
+    ///
+    /// Warning: the underlying [`proc_macro::Span::join`] method is
+    /// nightly-only. When called from within a procedural macro not using a
+    /// nightly compiler, this method will always return `None`.
+    ///
+    /// [`proc_macro::Span::join`]: https://doc.rust-lang.org/proc_macro/struct.Span.html#method.join
+    pub fn join(&self, other: Span) -> Option<Span> {
+        self.inner.join(other.inner).map(Span::_new)
+    }
+
+    /// Compares two spans to see if they're equal.
+    ///
+    /// This method is semver exempt and not exposed by default.
+    #[cfg(procmacro2_semver_exempt)]
+    #[cfg_attr(docsrs, doc(cfg(procmacro2_semver_exempt)))]
+    pub fn eq(&self, other: &Span) -> bool {
+        self.inner.eq(&other.inner)
+    }
+
+    /// Returns the source text behind a span. This preserves the original
+    /// source code, including spaces and comments. It only returns a result if
+    /// the span corresponds to real source code.
+    ///
+    /// Note: The observable result of a macro should only rely on the tokens
+    /// and not on this source text. The result of this function is a best
+    /// effort to be used for diagnostics only.
+    pub fn source_text(&self) -> Option<String> {
+        self.inner.source_text()
+    }
+}
+
+/// Prints a span in a form convenient for debugging.
+impl Debug for Span {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.inner, f)
+    }
+}
+
+/// A single token or a delimited sequence of token trees (e.g. `[1, (), ..]`).
+#[derive(Clone)]
+pub enum TokenTree {
+    /// A token stream surrounded by bracket delimiters.
+    Group(Group),
+    /// An identifier.
+    Ident(Ident),
+    /// A single punctuation character (`+`, `,`, `$`, etc.).
+    Punct(Punct),
+    /// A literal character (`'a'`), string (`"hello"`), number (`2.3`), etc.
+    Literal(Literal),
+}
+
+impl TokenTree {
+    /// Returns the span of this tree, delegating to the `span` method of
+    /// the contained token or a delimited stream.
+    pub fn span(&self) -> Span {
+        match self {
+            TokenTree::Group(t) => t.span(),
+            TokenTree::Ident(t) => t.span(),
+            TokenTree::Punct(t) => t.span(),
+            TokenTree::Literal(t) => t.span(),
+        }
+    }
+
+    /// Configures the span for *only this token*.
+    ///
+    /// Note that if this token is a `Group` then this method will not configure
+    /// the span of each of the internal tokens, this will simply delegate to
+    /// the `set_span` method of each variant.
+    pub fn set_span(&mut self, span: Span) {
+        match self {
+            TokenTree::Group(t) => t.set_span(span),
+            TokenTree::Ident(t) => t.set_span(span),
+            TokenTree::Punct(t) => t.set_span(span),
+            TokenTree::Literal(t) => t.set_span(span),
+        }
+    }
+}
+
+impl From<Group> for TokenTree {
+    fn from(g: Group) -> Self {
+        TokenTree::Group(g)
+    }
+}
+
+impl From<Ident> for TokenTree {
+    fn from(g: Ident) -> Self {
+        TokenTree::Ident(g)
+    }
+}
+
+impl From<Punct> for TokenTree {
+    fn from(g: Punct) -> Self {
+        TokenTree::Punct(g)
+    }
+}
+
+impl From<Literal> for TokenTree {
+    fn from(g: Literal) -> Self {
+        TokenTree::Literal(g)
+    }
+}
+
+/// Prints the token tree as a string that is supposed to be losslessly
+/// convertible back into the same token tree (modulo spans), except for
+/// possibly `TokenTree::Group`s with `Delimiter::None` delimiters and negative
+/// numeric literals.
+impl Display for TokenTree {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            TokenTree::Group(t) => Display::fmt(t, f),
+            TokenTree::Ident(t) => Display::fmt(t, f),
+            TokenTree::Punct(t) => Display::fmt(t, f),
+            TokenTree::Literal(t) => Display::fmt(t, f),
+        }
+    }
+}
+
+/// Prints token tree in a form convenient for debugging.
+impl Debug for TokenTree {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        // Each of these has the name in the struct type in the derived debug,
+        // so don't bother with an extra layer of indirection
+        match self {
+            TokenTree::Group(t) => Debug::fmt(t, f),
+            TokenTree::Ident(t) => {
+                let mut debug = f.debug_struct("Ident");
+                debug.field("sym", &format_args!("{}", t));
+                imp::debug_span_field_if_nontrivial(&mut debug, t.span().inner);
+                debug.finish()
+            }
+            TokenTree::Punct(t) => Debug::fmt(t, f),
+            TokenTree::Literal(t) => Debug::fmt(t, f),
+        }
+    }
+}
+
+/// A delimited token stream.
+///
+/// A `Group` internally contains a `TokenStream` which is surrounded by
+/// `Delimiter`s.
+#[derive(Clone)]
+pub struct Group {
+    inner: imp::Group,
+}
+
+/// Describes how a sequence of token trees is delimited.
+#[derive(Copy, Clone, Debug, Eq, PartialEq)]
+pub enum Delimiter {
+    /// `( ... )`
+    Parenthesis,
+    /// `{ ... }`
+    Brace,
+    /// `[ ... ]`
+    Bracket,
+    /// `∅ ... ∅`
+    ///
+    /// An invisible delimiter, that may, for example, appear around tokens
+    /// coming from a "macro variable" `$var`. It is important to preserve
+    /// operator priorities in cases like `$var * 3` where `$var` is `1 + 2`.
+    /// Invisible delimiters may not survive roundtrip of a token stream through
+    /// a string.
+    ///
+    /// <div class="warning">
+    ///
+    /// Note: rustc currently can ignore the grouping of tokens delimited by `None` in the output
+    /// of a proc_macro. Only `None`-delimited groups created by a macro_rules macro in the input
+    /// of a proc_macro macro are preserved, and only in very specific circumstances.
+    /// Any `None`-delimited groups (re)created by a proc_macro will therefore not preserve
+    /// operator priorities as indicated above. The other `Delimiter` variants should be used
+    /// instead in this context. This is a rustc bug. For details, see
+    /// [rust-lang/rust#67062](https://github.com/rust-lang/rust/issues/67062).
+    ///
+    /// </div>
+    None,
+}
+
+impl Group {
+    fn _new(inner: imp::Group) -> Self {
+        Group { inner }
+    }
+
+    fn _new_fallback(inner: fallback::Group) -> Self {
+        Group {
+            inner: inner.into(),
+        }
+    }
+
+    /// Creates a new `Group` with the given delimiter and token stream.
+    ///
+    /// This constructor will set the span for this group to
+    /// `Span::call_site()`. To change the span you can use the `set_span`
+    /// method below.
+    pub fn new(delimiter: Delimiter, stream: TokenStream) -> Self {
+        Group {
+            inner: imp::Group::new(delimiter, stream.inner),
+        }
+    }
+
+    /// Returns the punctuation used as the delimiter for this group: a set of
+    /// parentheses, square brackets, or curly braces.
+    pub fn delimiter(&self) -> Delimiter {
+        self.inner.delimiter()
+    }
+
+    /// Returns the `TokenStream` of tokens that are delimited in this `Group`.
+    ///
+    /// Note that the returned token stream does not include the delimiter
+    /// returned above.
+    pub fn stream(&self) -> TokenStream {
+        TokenStream::_new(self.inner.stream())
+    }
+
+    /// Returns the span for the delimiters of this token stream, spanning the
+    /// entire `Group`.
+    ///
+    /// ```text
+    /// pub fn span(&self) -> Span {
+    ///            ^^^^^^^
+    /// ```
+    pub fn span(&self) -> Span {
+        Span::_new(self.inner.span())
+    }
+
+    /// Returns the span pointing to the opening delimiter of this group.
+    ///
+    /// ```text
+    /// pub fn span_open(&self) -> Span {
+    ///                 ^
+    /// ```
+    pub fn span_open(&self) -> Span {
+        Span::_new(self.inner.span_open())
+    }
+
+    /// Returns the span pointing to the closing delimiter of this group.
+    ///
+    /// ```text
+    /// pub fn span_close(&self) -> Span {
+    ///                        ^
+    /// ```
+    pub fn span_close(&self) -> Span {
+        Span::_new(self.inner.span_close())
+    }
+
+    /// Returns an object that holds this group's `span_open()` and
+    /// `span_close()` together (in a more compact representation than holding
+    /// those 2 spans individually).
+    pub fn delim_span(&self) -> DelimSpan {
+        DelimSpan::new(&self.inner)
+    }
+
+    /// Configures the span for this `Group`'s delimiters, but not its internal
+    /// tokens.
+    ///
+    /// This method will **not** set the span of all the internal tokens spanned
+    /// by this group, but rather it will only set the span of the delimiter
+    /// tokens at the level of the `Group`.
+    pub fn set_span(&mut self, span: Span) {
+        self.inner.set_span(span.inner);
+    }
+}
+
+/// Prints the group as a string that should be losslessly convertible back
+/// into the same group (modulo spans), except for possibly `TokenTree::Group`s
+/// with `Delimiter::None` delimiters.
+impl Display for Group {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.inner, formatter)
+    }
+}
+
+impl Debug for Group {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.inner, formatter)
+    }
+}
+
+/// A `Punct` is a single punctuation character like `+`, `-` or `#`.
+///
+/// Multicharacter operators like `+=` are represented as two instances of
+/// `Punct` with different forms of `Spacing` returned.
+#[derive(Clone)]
+pub struct Punct {
+    ch: char,
+    spacing: Spacing,
+    span: Span,
+}
+
+/// Whether a `Punct` is followed immediately by another `Punct` or followed by
+/// another token or whitespace.
+#[derive(Copy, Clone, Debug, Eq, PartialEq)]
+pub enum Spacing {
+    /// E.g. `+` is `Alone` in `+ =`, `+ident` or `+()`.
+    Alone,
+    /// E.g. `+` is `Joint` in `+=` or `'` is `Joint` in `'#`.
+    ///
+    /// Additionally, single quote `'` can join with identifiers to form
+    /// lifetimes `'ident`.
+    Joint,
+}
+
+impl Punct {
+    /// Creates a new `Punct` from the given character and spacing.
+    ///
+    /// The `ch` argument must be a valid punctuation character permitted by the
+    /// language, otherwise the function will panic.
+    ///
+    /// The returned `Punct` will have the default span of `Span::call_site()`
+    /// which can be further configured with the `set_span` method below.
+    pub fn new(ch: char, spacing: Spacing) -> Self {
+        Punct {
+            ch,
+            spacing,
+            span: Span::call_site(),
+        }
+    }
+
+    /// Returns the value of this punctuation character as `char`.
+    pub fn as_char(&self) -> char {
+        self.ch
+    }
+
+    /// Returns the spacing of this punctuation character, indicating whether
+    /// it's immediately followed by another `Punct` in the token stream, so
+    /// they can potentially be combined into a multicharacter operator
+    /// (`Joint`), or it's followed by some other token or whitespace (`Alone`)
+    /// so the operator has certainly ended.
+    pub fn spacing(&self) -> Spacing {
+        self.spacing
+    }
+
+    /// Returns the span for this punctuation character.
+    pub fn span(&self) -> Span {
+        self.span
+    }
+
+    /// Configure the span for this punctuation character.
+    pub fn set_span(&mut self, span: Span) {
+        self.span = span;
+    }
+}
+
+/// Prints the punctuation character as a string that should be losslessly
+/// convertible back into the same character.
+impl Display for Punct {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.ch, f)
+    }
+}
+
+impl Debug for Punct {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = fmt.debug_struct("Punct");
+        debug.field("char", &self.ch);
+        debug.field("spacing", &self.spacing);
+        imp::debug_span_field_if_nontrivial(&mut debug, self.span.inner);
+        debug.finish()
+    }
+}
+
+/// A word of Rust code, which may be a keyword or legal variable name.
+///
+/// An identifier consists of at least one Unicode code point, the first of
+/// which has the XID_Start property and the rest of which have the XID_Continue
+/// property.
+///
+/// - The empty string is not an identifier. Use `Option<Ident>`.
+/// - A lifetime is not an identifier. Use `syn::Lifetime` instead.
+///
+/// An identifier constructed with `Ident::new` is permitted to be a Rust
+/// keyword, though parsing one through its [`Parse`] implementation rejects
+/// Rust keywords. Use `input.call(Ident::parse_any)` when parsing to match the
+/// behaviour of `Ident::new`.
+///
+/// [`Parse`]: https://docs.rs/syn/2.0/syn/parse/trait.Parse.html
+///
+/// # Examples
+///
+/// A new ident can be created from a string using the `Ident::new` function.
+/// A span must be provided explicitly which governs the name resolution
+/// behavior of the resulting identifier.
+///
+/// ```
+/// use proc_macro2::{Ident, Span};
+///
+/// fn main() {
+///     let call_ident = Ident::new("calligraphy", Span::call_site());
+///
+///     println!("{}", call_ident);
+/// }
+/// ```
+///
+/// An ident can be interpolated into a token stream using the `quote!` macro.
+///
+/// ```
+/// use proc_macro2::{Ident, Span};
+/// use quote::quote;
+///
+/// fn main() {
+///     let ident = Ident::new("demo", Span::call_site());
+///
+///     // Create a variable binding whose name is this ident.
+///     let expanded = quote! { let #ident = 10; };
+///
+///     // Create a variable binding with a slightly different name.
+///     let temp_ident = Ident::new(&format!("new_{}", ident), Span::call_site());
+///     let expanded = quote! { let #temp_ident = 10; };
+/// }
+/// ```
+///
+/// A string representation of the ident is available through the `to_string()`
+/// method.
+///
+/// ```
+/// # use proc_macro2::{Ident, Span};
+/// #
+/// # let ident = Ident::new("another_identifier", Span::call_site());
+/// #
+/// // Examine the ident as a string.
+/// let ident_string = ident.to_string();
+/// if ident_string.len() > 60 {
+///     println!("Very long identifier: {}", ident_string)
+/// }
+/// ```
+#[derive(Clone)]
+pub struct Ident {
+    inner: imp::Ident,
+    _marker: ProcMacroAutoTraits,
+}
+
+impl Ident {
+    fn _new(inner: imp::Ident) -> Self {
+        Ident {
+            inner,
+            _marker: MARKER,
+        }
+    }
+
+    /// Creates a new `Ident` with the given `string` as well as the specified
+    /// `span`.
+    ///
+    /// The `string` argument must be a valid identifier permitted by the
+    /// language, otherwise the function will panic.
+    ///
+    /// Note that `span`, currently in rustc, configures the hygiene information
+    /// for this identifier.
+    ///
+    /// As of this time `Span::call_site()` explicitly opts-in to "call-site"
+    /// hygiene meaning that identifiers created with this span will be resolved
+    /// as if they were written directly at the location of the macro call, and
+    /// other code at the macro call site will be able to refer to them as well.
+    ///
+    /// Later spans like `Span::def_site()` will allow to opt-in to
+    /// "definition-site" hygiene meaning that identifiers created with this
+    /// span will be resolved at the location of the macro definition and other
+    /// code at the macro call site will not be able to refer to them.
+    ///
+    /// Due to the current importance of hygiene this constructor, unlike other
+    /// tokens, requires a `Span` to be specified at construction.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the input string is neither a keyword nor a legal variable
+    /// name. If you are not sure whether the string contains an identifier and
+    /// need to handle an error case, use
+    /// <a href="https://docs.rs/syn/2.0/syn/fn.parse_str.html"><code
+    ///   style="padding-right:0;">syn::parse_str</code></a><code
+    ///   style="padding-left:0;">::&lt;Ident&gt;</code>
+    /// rather than `Ident::new`.
+    #[track_caller]
+    pub fn new(string: &str, span: Span) -> Self {
+        Ident::_new(imp::Ident::new_checked(string, span.inner))
+    }
+
+    /// Same as `Ident::new`, but creates a raw identifier (`r#ident`). The
+    /// `string` argument must be a valid identifier permitted by the language
+    /// (including keywords, e.g. `fn`). Keywords which are usable in path
+    /// segments (e.g. `self`, `super`) are not supported, and will cause a
+    /// panic.
+    #[track_caller]
+    pub fn new_raw(string: &str, span: Span) -> Self {
+        Ident::_new(imp::Ident::new_raw_checked(string, span.inner))
+    }
+
+    /// Returns the span of this `Ident`.
+    pub fn span(&self) -> Span {
+        Span::_new(self.inner.span())
+    }
+
+    /// Configures the span of this `Ident`, possibly changing its hygiene
+    /// context.
+    pub fn set_span(&mut self, span: Span) {
+        self.inner.set_span(span.inner);
+    }
+}
+
+impl PartialEq for Ident {
+    fn eq(&self, other: &Ident) -> bool {
+        self.inner == other.inner
+    }
+}
+
+impl<T> PartialEq<T> for Ident
+where
+    T: ?Sized + AsRef<str>,
+{
+    fn eq(&self, other: &T) -> bool {
+        self.inner == other
+    }
+}
+
+impl Eq for Ident {}
+
+impl PartialOrd for Ident {
+    fn partial_cmp(&self, other: &Ident) -> Option<Ordering> {
+        Some(self.cmp(other))
+    }
+}
+
+impl Ord for Ident {
+    fn cmp(&self, other: &Ident) -> Ordering {
+        self.to_string().cmp(&other.to_string())
+    }
+}
+
+impl Hash for Ident {
+    fn hash<H: Hasher>(&self, hasher: &mut H) {
+        self.to_string().hash(hasher);
+    }
+}
+
+/// Prints the identifier as a string that should be losslessly convertible back
+/// into the same identifier.
+impl Display for Ident {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.inner, f)
+    }
+}
+
+impl Debug for Ident {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.inner, f)
+    }
+}
+
+/// A literal string (`"hello"`), byte string (`b"hello"`), character (`'a'`),
+/// byte character (`b'a'`), an integer or floating point number with or without
+/// a suffix (`1`, `1u8`, `2.3`, `2.3f32`).
+///
+/// Boolean literals like `true` and `false` do not belong here, they are
+/// `Ident`s.
+#[derive(Clone)]
+pub struct Literal {
+    inner: imp::Literal,
+    _marker: ProcMacroAutoTraits,
+}
+
+macro_rules! suffixed_int_literals {
+    ($($name:ident => $kind:ident,)*) => ($(
+        /// Creates a new suffixed integer literal with the specified value.
+        ///
+        /// This function will create an integer like `1u32` where the integer
+        /// value specified is the first part of the token and the integral is
+        /// also suffixed at the end. Literals created from negative numbers may
+        /// not survive roundtrips through `TokenStream` or strings and may be
+        /// broken into two tokens (`-` and positive literal).
+        ///
+        /// Literals created through this method have the `Span::call_site()`
+        /// span by default, which can be configured with the `set_span` method
+        /// below.
+        pub fn $name(n: $kind) -> Literal {
+            Literal::_new(imp::Literal::$name(n))
+        }
+    )*)
+}
+
+macro_rules! unsuffixed_int_literals {
+    ($($name:ident => $kind:ident,)*) => ($(
+        /// Creates a new unsuffixed integer literal with the specified value.
+        ///
+        /// This function will create an integer like `1` where the integer
+        /// value specified is the first part of the token. No suffix is
+        /// specified on this token, meaning that invocations like
+        /// `Literal::i8_unsuffixed(1)` are equivalent to
+        /// `Literal::u32_unsuffixed(1)`. Literals created from negative numbers
+        /// may not survive roundtrips through `TokenStream` or strings and may
+        /// be broken into two tokens (`-` and positive literal).
+        ///
+        /// Literals created through this method have the `Span::call_site()`
+        /// span by default, which can be configured with the `set_span` method
+        /// below.
+        pub fn $name(n: $kind) -> Literal {
+            Literal::_new(imp::Literal::$name(n))
+        }
+    )*)
+}
+
+impl Literal {
+    fn _new(inner: imp::Literal) -> Self {
+        Literal {
+            inner,
+            _marker: MARKER,
+        }
+    }
+
+    fn _new_fallback(inner: fallback::Literal) -> Self {
+        Literal {
+            inner: inner.into(),
+            _marker: MARKER,
+        }
+    }
+
+    suffixed_int_literals! {
+        u8_suffixed => u8,
+        u16_suffixed => u16,
+        u32_suffixed => u32,
+        u64_suffixed => u64,
+        u128_suffixed => u128,
+        usize_suffixed => usize,
+        i8_suffixed => i8,
+        i16_suffixed => i16,
+        i32_suffixed => i32,
+        i64_suffixed => i64,
+        i128_suffixed => i128,
+        isize_suffixed => isize,
+    }
+
+    unsuffixed_int_literals! {
+        u8_unsuffixed => u8,
+        u16_unsuffixed => u16,
+        u32_unsuffixed => u32,
+        u64_unsuffixed => u64,
+        u128_unsuffixed => u128,
+        usize_unsuffixed => usize,
+        i8_unsuffixed => i8,
+        i16_unsuffixed => i16,
+        i32_unsuffixed => i32,
+        i64_unsuffixed => i64,
+        i128_unsuffixed => i128,
+        isize_unsuffixed => isize,
+    }
+
+    /// Creates a new unsuffixed floating-point literal.
+    ///
+    /// This constructor is similar to those like `Literal::i8_unsuffixed` where
+    /// the float's value is emitted directly into the token but no suffix is
+    /// used, so it may be inferred to be a `f64` later in the compiler.
+    /// Literals created from negative numbers may not survive round-trips
+    /// through `TokenStream` or strings and may be broken into two tokens (`-`
+    /// and positive literal).
+    ///
+    /// # Panics
+    ///
+    /// This function requires that the specified float is finite, for example
+    /// if it is infinity or NaN this function will panic.
+    pub fn f64_unsuffixed(f: f64) -> Literal {
+        assert!(f.is_finite());
+        Literal::_new(imp::Literal::f64_unsuffixed(f))
+    }
+
+    /// Creates a new suffixed floating-point literal.
+    ///
+    /// This constructor will create a literal like `1.0f64` where the value
+    /// specified is the preceding part of the token and `f64` is the suffix of
+    /// the token. This token will always be inferred to be an `f64` in the
+    /// compiler. Literals created from negative numbers may not survive
+    /// round-trips through `TokenStream` or strings and may be broken into two
+    /// tokens (`-` and positive literal).
+    ///
+    /// # Panics
+    ///
+    /// This function requires that the specified float is finite, for example
+    /// if it is infinity or NaN this function will panic.
+    pub fn f64_suffixed(f: f64) -> Literal {
+        assert!(f.is_finite());
+        Literal::_new(imp::Literal::f64_suffixed(f))
+    }
+
+    /// Creates a new unsuffixed floating-point literal.
+    ///
+    /// This constructor is similar to those like `Literal::i8_unsuffixed` where
+    /// the float's value is emitted directly into the token but no suffix is
+    /// used, so it may be inferred to be a `f64` later in the compiler.
+    /// Literals created from negative numbers may not survive round-trips
+    /// through `TokenStream` or strings and may be broken into two tokens (`-`
+    /// and positive literal).
+    ///
+    /// # Panics
+    ///
+    /// This function requires that the specified float is finite, for example
+    /// if it is infinity or NaN this function will panic.
+    pub fn f32_unsuffixed(f: f32) -> Literal {
+        assert!(f.is_finite());
+        Literal::_new(imp::Literal::f32_unsuffixed(f))
+    }
+
+    /// Creates a new suffixed floating-point literal.
+    ///
+    /// This constructor will create a literal like `1.0f32` where the value
+    /// specified is the preceding part of the token and `f32` is the suffix of
+    /// the token. This token will always be inferred to be an `f32` in the
+    /// compiler. Literals created from negative numbers may not survive
+    /// round-trips through `TokenStream` or strings and may be broken into two
+    /// tokens (`-` and positive literal).
+    ///
+    /// # Panics
+    ///
+    /// This function requires that the specified float is finite, for example
+    /// if it is infinity or NaN this function will panic.
+    pub fn f32_suffixed(f: f32) -> Literal {
+        assert!(f.is_finite());
+        Literal::_new(imp::Literal::f32_suffixed(f))
+    }
+
+    /// String literal.
+    pub fn string(string: &str) -> Literal {
+        Literal::_new(imp::Literal::string(string))
+    }
+
+    /// Character literal.
+    pub fn character(ch: char) -> Literal {
+        Literal::_new(imp::Literal::character(ch))
+    }
+
+    /// Byte character literal.
+    pub fn byte_character(byte: u8) -> Literal {
+        Literal::_new(imp::Literal::byte_character(byte))
+    }
+
+    /// Byte string literal.
+    pub fn byte_string(bytes: &[u8]) -> Literal {
+        Literal::_new(imp::Literal::byte_string(bytes))
+    }
+
+    /// C string literal.
+    pub fn c_string(string: &CStr) -> Literal {
+        Literal::_new(imp::Literal::c_string(string))
+    }
+
+    /// Returns the span encompassing this literal.
+    pub fn span(&self) -> Span {
+        Span::_new(self.inner.span())
+    }
+
+    /// Configures the span associated for this literal.
+    pub fn set_span(&mut self, span: Span) {
+        self.inner.set_span(span.inner);
+    }
+
+    /// Returns a `Span` that is a subset of `self.span()` containing only
+    /// the source bytes in range `range`. Returns `None` if the would-be
+    /// trimmed span is outside the bounds of `self`.
+    ///
+    /// Warning: the underlying [`proc_macro::Literal::subspan`] method is
+    /// nightly-only. When called from within a procedural macro not using a
+    /// nightly compiler, this method will always return `None`.
+    ///
+    /// [`proc_macro::Literal::subspan`]: https://doc.rust-lang.org/proc_macro/struct.Literal.html#method.subspan
+    pub fn subspan<R: RangeBounds<usize>>(&self, range: R) -> Option<Span> {
+        self.inner.subspan(range).map(Span::_new)
+    }
+
+    // Intended for the `quote!` macro to use when constructing a proc-macro2
+    // token out of a macro_rules $:literal token, which is already known to be
+    // a valid literal. This avoids reparsing/validating the literal's string
+    // representation. This is not public API other than for quote.
+    #[doc(hidden)]
+    pub unsafe fn from_str_unchecked(repr: &str) -> Self {
+        Literal::_new(unsafe { imp::Literal::from_str_unchecked(repr) })
+    }
+}
+
+impl FromStr for Literal {
+    type Err = LexError;
+
+    fn from_str(repr: &str) -> Result<Self, LexError> {
+        repr.parse().map(Literal::_new).map_err(|inner| LexError {
+            inner,
+            _marker: MARKER,
+        })
+    }
+}
+
+impl Debug for Literal {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.inner, f)
+    }
+}
+
+impl Display for Literal {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.inner, f)
+    }
+}
+
+/// Public implementation details for the `TokenStream` type, such as iterators.
+pub mod token_stream {
+    use crate::marker::{ProcMacroAutoTraits, MARKER};
+    use crate::{imp, TokenTree};
+    use core::fmt::{self, Debug};
+
+    pub use crate::TokenStream;
+
+    /// An iterator over `TokenStream`'s `TokenTree`s.
+    ///
+    /// The iteration is "shallow", e.g. the iterator doesn't recurse into
+    /// delimited groups, and returns whole groups as token trees.
+    #[derive(Clone)]
+    pub struct IntoIter {
+        inner: imp::TokenTreeIter,
+        _marker: ProcMacroAutoTraits,
+    }
+
+    impl Iterator for IntoIter {
+        type Item = TokenTree;
+
+        fn next(&mut self) -> Option<TokenTree> {
+            self.inner.next()
+        }
+
+        fn size_hint(&self) -> (usize, Option<usize>) {
+            self.inner.size_hint()
+        }
+    }
+
+    impl Debug for IntoIter {
+        fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+            f.write_str("TokenStream ")?;
+            f.debug_list().entries(self.clone()).finish()
+        }
+    }
+
+    impl IntoIterator for TokenStream {
+        type Item = TokenTree;
+        type IntoIter = IntoIter;
+
+        fn into_iter(self) -> IntoIter {
+            IntoIter {
+                inner: self.inner.into_iter(),
+                _marker: MARKER,
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/src/location.rs 43.0.0-1ubuntu1/rust-vendor/proc-macro2/src/location.rs
--- 43.0.0-1/rust-vendor/proc-macro2/src/location.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/src/location.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,29 @@
+use core::cmp::Ordering;
+
+/// A line-column pair representing the start or end of a `Span`.
+///
+/// This type is semver exempt and not exposed by default.
+#[cfg_attr(docsrs, doc(cfg(feature = "span-locations")))]
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+pub struct LineColumn {
+    /// The 1-indexed line in the source file on which the span starts or ends
+    /// (inclusive).
+    pub line: usize,
+    /// The 0-indexed column (in UTF-8 characters) in the source file on which
+    /// the span starts or ends (inclusive).
+    pub column: usize,
+}
+
+impl Ord for LineColumn {
+    fn cmp(&self, other: &Self) -> Ordering {
+        self.line
+            .cmp(&other.line)
+            .then(self.column.cmp(&other.column))
+    }
+}
+
+impl PartialOrd for LineColumn {
+    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
+        Some(self.cmp(other))
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/src/marker.rs 43.0.0-1ubuntu1/rust-vendor/proc-macro2/src/marker.rs
--- 43.0.0-1/rust-vendor/proc-macro2/src/marker.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/src/marker.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,17 @@
+use alloc::rc::Rc;
+use core::marker::PhantomData;
+use core::panic::{RefUnwindSafe, UnwindSafe};
+
+// Zero sized marker with the correct set of autotrait impls we want all proc
+// macro types to have.
+#[derive(Copy, Clone)]
+#[cfg_attr(
+    all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)),
+    derive(PartialEq, Eq)
+)]
+pub(crate) struct ProcMacroAutoTraits(PhantomData<Rc<()>>);
+
+pub(crate) const MARKER: ProcMacroAutoTraits = ProcMacroAutoTraits(PhantomData);
+
+impl UnwindSafe for ProcMacroAutoTraits {}
+impl RefUnwindSafe for ProcMacroAutoTraits {}
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/src/parse.rs 43.0.0-1ubuntu1/rust-vendor/proc-macro2/src/parse.rs
--- 43.0.0-1/rust-vendor/proc-macro2/src/parse.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/src/parse.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,996 @@
+use crate::fallback::{
+    self, is_ident_continue, is_ident_start, Group, LexError, Literal, Span, TokenStream,
+    TokenStreamBuilder,
+};
+use crate::{Delimiter, Punct, Spacing, TokenTree};
+use core::char;
+use core::str::{Bytes, CharIndices, Chars};
+
+#[derive(Copy, Clone, Eq, PartialEq)]
+pub(crate) struct Cursor<'a> {
+    pub rest: &'a str,
+    #[cfg(span_locations)]
+    pub off: u32,
+}
+
+impl<'a> Cursor<'a> {
+    pub fn advance(&self, bytes: usize) -> Cursor<'a> {
+        let (_front, rest) = self.rest.split_at(bytes);
+        Cursor {
+            rest,
+            #[cfg(span_locations)]
+            off: self.off + _front.chars().count() as u32,
+        }
+    }
+
+    pub fn starts_with(&self, s: &str) -> bool {
+        self.rest.starts_with(s)
+    }
+
+    pub fn starts_with_char(&self, ch: char) -> bool {
+        self.rest.starts_with(ch)
+    }
+
+    pub fn starts_with_fn<Pattern>(&self, f: Pattern) -> bool
+    where
+        Pattern: FnMut(char) -> bool,
+    {
+        self.rest.starts_with(f)
+    }
+
+    pub fn is_empty(&self) -> bool {
+        self.rest.is_empty()
+    }
+
+    fn len(&self) -> usize {
+        self.rest.len()
+    }
+
+    fn as_bytes(&self) -> &'a [u8] {
+        self.rest.as_bytes()
+    }
+
+    fn bytes(&self) -> Bytes<'a> {
+        self.rest.bytes()
+    }
+
+    fn chars(&self) -> Chars<'a> {
+        self.rest.chars()
+    }
+
+    fn char_indices(&self) -> CharIndices<'a> {
+        self.rest.char_indices()
+    }
+
+    fn parse(&self, tag: &str) -> Result<Cursor<'a>, Reject> {
+        if self.starts_with(tag) {
+            Ok(self.advance(tag.len()))
+        } else {
+            Err(Reject)
+        }
+    }
+}
+
+pub(crate) struct Reject;
+type PResult<'a, O> = Result<(Cursor<'a>, O), Reject>;
+
+fn skip_whitespace(input: Cursor) -> Cursor {
+    let mut s = input;
+
+    while !s.is_empty() {
+        let byte = s.as_bytes()[0];
+        if byte == b'/' {
+            if s.starts_with("//")
+                && (!s.starts_with("///") || s.starts_with("////"))
+                && !s.starts_with("//!")
+            {
+                let (cursor, _) = take_until_newline_or_eof(s);
+                s = cursor;
+                continue;
+            } else if s.starts_with("/**/") {
+                s = s.advance(4);
+                continue;
+            } else if s.starts_with("/*")
+                && (!s.starts_with("/**") || s.starts_with("/***"))
+                && !s.starts_with("/*!")
+            {
+                match block_comment(s) {
+                    Ok((rest, _)) => {
+                        s = rest;
+                        continue;
+                    }
+                    Err(Reject) => return s,
+                }
+            }
+        }
+        match byte {
+            b' ' | 0x09..=0x0d => {
+                s = s.advance(1);
+                continue;
+            }
+            b if b.is_ascii() => {}
+            _ => {
+                let ch = s.chars().next().unwrap();
+                if is_whitespace(ch) {
+                    s = s.advance(ch.len_utf8());
+                    continue;
+                }
+            }
+        }
+        return s;
+    }
+    s
+}
+
+fn block_comment(input: Cursor) -> PResult<&str> {
+    if !input.starts_with("/*") {
+        return Err(Reject);
+    }
+
+    let mut depth = 0usize;
+    let bytes = input.as_bytes();
+    let mut i = 0usize;
+    let upper = bytes.len() - 1;
+
+    while i < upper {
+        if bytes[i] == b'/' && bytes[i + 1] == b'*' {
+            depth += 1;
+            i += 1; // eat '*'
+        } else if bytes[i] == b'*' && bytes[i + 1] == b'/' {
+            depth -= 1;
+            if depth == 0 {
+                return Ok((input.advance(i + 2), &input.rest[..i + 2]));
+            }
+            i += 1; // eat '/'
+        }
+        i += 1;
+    }
+
+    Err(Reject)
+}
+
+fn is_whitespace(ch: char) -> bool {
+    // Rust treats left-to-right mark and right-to-left mark as whitespace
+    ch.is_whitespace() || ch == '\u{200e}' || ch == '\u{200f}'
+}
+
+fn word_break(input: Cursor) -> Result<Cursor, Reject> {
+    match input.chars().next() {
+        Some(ch) if is_ident_continue(ch) => Err(Reject),
+        Some(_) | None => Ok(input),
+    }
+}
+
+// Rustc's representation of a macro expansion error in expression position or
+// type position.
+const ERROR: &str = "(/*ERROR*/)";
+
+pub(crate) fn token_stream(mut input: Cursor) -> Result<TokenStream, LexError> {
+    let mut trees = TokenStreamBuilder::new();
+    let mut stack = Vec::new();
+
+    loop {
+        input = skip_whitespace(input);
+
+        if let Ok((rest, ())) = doc_comment(input, &mut trees) {
+            input = rest;
+            continue;
+        }
+
+        #[cfg(span_locations)]
+        let lo = input.off;
+
+        let first = match input.bytes().next() {
+            Some(first) => first,
+            None => match stack.last() {
+                None => return Ok(trees.build()),
+                #[cfg(span_locations)]
+                Some((lo, _frame)) => {
+                    return Err(LexError {
+                        span: Span { lo: *lo, hi: *lo },
+                    })
+                }
+                #[cfg(not(span_locations))]
+                Some(_frame) => return Err(LexError { span: Span {} }),
+            },
+        };
+
+        if let Some(open_delimiter) = match first {
+            b'(' if !input.starts_with(ERROR) => Some(Delimiter::Parenthesis),
+            b'[' => Some(Delimiter::Bracket),
+            b'{' => Some(Delimiter::Brace),
+            _ => None,
+        } {
+            input = input.advance(1);
+            let frame = (open_delimiter, trees);
+            #[cfg(span_locations)]
+            let frame = (lo, frame);
+            stack.push(frame);
+            trees = TokenStreamBuilder::new();
+        } else if let Some(close_delimiter) = match first {
+            b')' => Some(Delimiter::Parenthesis),
+            b']' => Some(Delimiter::Bracket),
+            b'}' => Some(Delimiter::Brace),
+            _ => None,
+        } {
+            let frame = match stack.pop() {
+                Some(frame) => frame,
+                None => return Err(lex_error(input)),
+            };
+            #[cfg(span_locations)]
+            let (lo, frame) = frame;
+            let (open_delimiter, outer) = frame;
+            if open_delimiter != close_delimiter {
+                return Err(lex_error(input));
+            }
+            input = input.advance(1);
+            let mut g = Group::new(open_delimiter, trees.build());
+            g.set_span(Span {
+                #[cfg(span_locations)]
+                lo,
+                #[cfg(span_locations)]
+                hi: input.off,
+            });
+            trees = outer;
+            trees.push_token_from_parser(TokenTree::Group(crate::Group::_new_fallback(g)));
+        } else {
+            let (rest, mut tt) = match leaf_token(input) {
+                Ok((rest, tt)) => (rest, tt),
+                Err(Reject) => return Err(lex_error(input)),
+            };
+            tt.set_span(crate::Span::_new_fallback(Span {
+                #[cfg(span_locations)]
+                lo,
+                #[cfg(span_locations)]
+                hi: rest.off,
+            }));
+            trees.push_token_from_parser(tt);
+            input = rest;
+        }
+    }
+}
+
+fn lex_error(cursor: Cursor) -> LexError {
+    #[cfg(not(span_locations))]
+    let _ = cursor;
+    LexError {
+        span: Span {
+            #[cfg(span_locations)]
+            lo: cursor.off,
+            #[cfg(span_locations)]
+            hi: cursor.off,
+        },
+    }
+}
+
+fn leaf_token(input: Cursor) -> PResult<TokenTree> {
+    if let Ok((input, l)) = literal(input) {
+        // must be parsed before ident
+        Ok((input, TokenTree::Literal(crate::Literal::_new_fallback(l))))
+    } else if let Ok((input, p)) = punct(input) {
+        Ok((input, TokenTree::Punct(p)))
+    } else if let Ok((input, i)) = ident(input) {
+        Ok((input, TokenTree::Ident(i)))
+    } else if input.starts_with(ERROR) {
+        let rest = input.advance(ERROR.len());
+        let repr = crate::Literal::_new_fallback(Literal::_new(ERROR.to_owned()));
+        Ok((rest, TokenTree::Literal(repr)))
+    } else {
+        Err(Reject)
+    }
+}
+
+fn ident(input: Cursor) -> PResult<crate::Ident> {
+    if [
+        "r\"", "r#\"", "r##", "b\"", "b\'", "br\"", "br#", "c\"", "cr\"", "cr#",
+    ]
+    .iter()
+    .any(|prefix| input.starts_with(prefix))
+    {
+        Err(Reject)
+    } else {
+        ident_any(input)
+    }
+}
+
+fn ident_any(input: Cursor) -> PResult<crate::Ident> {
+    let raw = input.starts_with("r#");
+    let rest = input.advance((raw as usize) << 1);
+
+    let (rest, sym) = ident_not_raw(rest)?;
+
+    if !raw {
+        let ident = crate::Ident::_new(crate::imp::Ident::new_unchecked(
+            sym,
+            fallback::Span::call_site(),
+        ));
+        return Ok((rest, ident));
+    }
+
+    match sym {
+        "_" | "super" | "self" | "Self" | "crate" => return Err(Reject),
+        _ => {}
+    }
+
+    let ident = crate::Ident::_new(crate::imp::Ident::new_raw_unchecked(
+        sym,
+        fallback::Span::call_site(),
+    ));
+    Ok((rest, ident))
+}
+
+fn ident_not_raw(input: Cursor) -> PResult<&str> {
+    let mut chars = input.char_indices();
+
+    match chars.next() {
+        Some((_, ch)) if is_ident_start(ch) => {}
+        _ => return Err(Reject),
+    }
+
+    let mut end = input.len();
+    for (i, ch) in chars {
+        if !is_ident_continue(ch) {
+            end = i;
+            break;
+        }
+    }
+
+    Ok((input.advance(end), &input.rest[..end]))
+}
+
+pub(crate) fn literal(input: Cursor) -> PResult<Literal> {
+    let rest = literal_nocapture(input)?;
+    let end = input.len() - rest.len();
+    Ok((rest, Literal::_new(input.rest[..end].to_string())))
+}
+
+fn literal_nocapture(input: Cursor) -> Result<Cursor, Reject> {
+    if let Ok(ok) = string(input) {
+        Ok(ok)
+    } else if let Ok(ok) = byte_string(input) {
+        Ok(ok)
+    } else if let Ok(ok) = c_string(input) {
+        Ok(ok)
+    } else if let Ok(ok) = byte(input) {
+        Ok(ok)
+    } else if let Ok(ok) = character(input) {
+        Ok(ok)
+    } else if let Ok(ok) = float(input) {
+        Ok(ok)
+    } else if let Ok(ok) = int(input) {
+        Ok(ok)
+    } else {
+        Err(Reject)
+    }
+}
+
+fn literal_suffix(input: Cursor) -> Cursor {
+    match ident_not_raw(input) {
+        Ok((input, _)) => input,
+        Err(Reject) => input,
+    }
+}
+
+fn string(input: Cursor) -> Result<Cursor, Reject> {
+    if let Ok(input) = input.parse("\"") {
+        cooked_string(input)
+    } else if let Ok(input) = input.parse("r") {
+        raw_string(input)
+    } else {
+        Err(Reject)
+    }
+}
+
+fn cooked_string(mut input: Cursor) -> Result<Cursor, Reject> {
+    let mut chars = input.char_indices();
+
+    while let Some((i, ch)) = chars.next() {
+        match ch {
+            '"' => {
+                let input = input.advance(i + 1);
+                return Ok(literal_suffix(input));
+            }
+            '\r' => match chars.next() {
+                Some((_, '\n')) => {}
+                _ => break,
+            },
+            '\\' => match chars.next() {
+                Some((_, 'x')) => {
+                    backslash_x_char(&mut chars)?;
+                }
+                Some((_, 'n' | 'r' | 't' | '\\' | '\'' | '"' | '0')) => {}
+                Some((_, 'u')) => {
+                    backslash_u(&mut chars)?;
+                }
+                Some((newline, ch @ ('\n' | '\r'))) => {
+                    input = input.advance(newline + 1);
+                    trailing_backslash(&mut input, ch as u8)?;
+                    chars = input.char_indices();
+                }
+                _ => break,
+            },
+            _ch => {}
+        }
+    }
+    Err(Reject)
+}
+
+fn raw_string(input: Cursor) -> Result<Cursor, Reject> {
+    let (input, delimiter) = delimiter_of_raw_string(input)?;
+    let mut bytes = input.bytes().enumerate();
+    while let Some((i, byte)) = bytes.next() {
+        match byte {
+            b'"' if input.rest[i + 1..].starts_with(delimiter) => {
+                let rest = input.advance(i + 1 + delimiter.len());
+                return Ok(literal_suffix(rest));
+            }
+            b'\r' => match bytes.next() {
+                Some((_, b'\n')) => {}
+                _ => break,
+            },
+            _ => {}
+        }
+    }
+    Err(Reject)
+}
+
+fn byte_string(input: Cursor) -> Result<Cursor, Reject> {
+    if let Ok(input) = input.parse("b\"") {
+        cooked_byte_string(input)
+    } else if let Ok(input) = input.parse("br") {
+        raw_byte_string(input)
+    } else {
+        Err(Reject)
+    }
+}
+
+fn cooked_byte_string(mut input: Cursor) -> Result<Cursor, Reject> {
+    let mut bytes = input.bytes().enumerate();
+    while let Some((offset, b)) = bytes.next() {
+        match b {
+            b'"' => {
+                let input = input.advance(offset + 1);
+                return Ok(literal_suffix(input));
+            }
+            b'\r' => match bytes.next() {
+                Some((_, b'\n')) => {}
+                _ => break,
+            },
+            b'\\' => match bytes.next() {
+                Some((_, b'x')) => {
+                    backslash_x_byte(&mut bytes)?;
+                }
+                Some((_, b'n' | b'r' | b't' | b'\\' | b'0' | b'\'' | b'"')) => {}
+                Some((newline, b @ (b'\n' | b'\r'))) => {
+                    input = input.advance(newline + 1);
+                    trailing_backslash(&mut input, b)?;
+                    bytes = input.bytes().enumerate();
+                }
+                _ => break,
+            },
+            b if b.is_ascii() => {}
+            _ => break,
+        }
+    }
+    Err(Reject)
+}
+
+fn delimiter_of_raw_string(input: Cursor) -> PResult<&str> {
+    for (i, byte) in input.bytes().enumerate() {
+        match byte {
+            b'"' => {
+                if i > 255 {
+                    // https://github.com/rust-lang/rust/pull/95251
+                    return Err(Reject);
+                }
+                return Ok((input.advance(i + 1), &input.rest[..i]));
+            }
+            b'#' => {}
+            _ => break,
+        }
+    }
+    Err(Reject)
+}
+
+fn raw_byte_string(input: Cursor) -> Result<Cursor, Reject> {
+    let (input, delimiter) = delimiter_of_raw_string(input)?;
+    let mut bytes = input.bytes().enumerate();
+    while let Some((i, byte)) = bytes.next() {
+        match byte {
+            b'"' if input.rest[i + 1..].starts_with(delimiter) => {
+                let rest = input.advance(i + 1 + delimiter.len());
+                return Ok(literal_suffix(rest));
+            }
+            b'\r' => match bytes.next() {
+                Some((_, b'\n')) => {}
+                _ => break,
+            },
+            other => {
+                if !other.is_ascii() {
+                    break;
+                }
+            }
+        }
+    }
+    Err(Reject)
+}
+
+fn c_string(input: Cursor) -> Result<Cursor, Reject> {
+    if let Ok(input) = input.parse("c\"") {
+        cooked_c_string(input)
+    } else if let Ok(input) = input.parse("cr") {
+        raw_c_string(input)
+    } else {
+        Err(Reject)
+    }
+}
+
+fn raw_c_string(input: Cursor) -> Result<Cursor, Reject> {
+    let (input, delimiter) = delimiter_of_raw_string(input)?;
+    let mut bytes = input.bytes().enumerate();
+    while let Some((i, byte)) = bytes.next() {
+        match byte {
+            b'"' if input.rest[i + 1..].starts_with(delimiter) => {
+                let rest = input.advance(i + 1 + delimiter.len());
+                return Ok(literal_suffix(rest));
+            }
+            b'\r' => match bytes.next() {
+                Some((_, b'\n')) => {}
+                _ => break,
+            },
+            b'\0' => break,
+            _ => {}
+        }
+    }
+    Err(Reject)
+}
+
+fn cooked_c_string(mut input: Cursor) -> Result<Cursor, Reject> {
+    let mut chars = input.char_indices();
+
+    while let Some((i, ch)) = chars.next() {
+        match ch {
+            '"' => {
+                let input = input.advance(i + 1);
+                return Ok(literal_suffix(input));
+            }
+            '\r' => match chars.next() {
+                Some((_, '\n')) => {}
+                _ => break,
+            },
+            '\\' => match chars.next() {
+                Some((_, 'x')) => {
+                    backslash_x_nonzero(&mut chars)?;
+                }
+                Some((_, 'n' | 'r' | 't' | '\\' | '\'' | '"')) => {}
+                Some((_, 'u')) => {
+                    if backslash_u(&mut chars)? == '\0' {
+                        break;
+                    }
+                }
+                Some((newline, ch @ ('\n' | '\r'))) => {
+                    input = input.advance(newline + 1);
+                    trailing_backslash(&mut input, ch as u8)?;
+                    chars = input.char_indices();
+                }
+                _ => break,
+            },
+            '\0' => break,
+            _ch => {}
+        }
+    }
+    Err(Reject)
+}
+
+fn byte(input: Cursor) -> Result<Cursor, Reject> {
+    let input = input.parse("b'")?;
+    let mut bytes = input.bytes().enumerate();
+    let ok = match bytes.next().map(|(_, b)| b) {
+        Some(b'\\') => match bytes.next().map(|(_, b)| b) {
+            Some(b'x') => backslash_x_byte(&mut bytes).is_ok(),
+            Some(b'n' | b'r' | b't' | b'\\' | b'0' | b'\'' | b'"') => true,
+            _ => false,
+        },
+        b => b.is_some(),
+    };
+    if !ok {
+        return Err(Reject);
+    }
+    let (offset, _) = bytes.next().ok_or(Reject)?;
+    if !input.chars().as_str().is_char_boundary(offset) {
+        return Err(Reject);
+    }
+    let input = input.advance(offset).parse("'")?;
+    Ok(literal_suffix(input))
+}
+
+fn character(input: Cursor) -> Result<Cursor, Reject> {
+    let input = input.parse("'")?;
+    let mut chars = input.char_indices();
+    let ok = match chars.next().map(|(_, ch)| ch) {
+        Some('\\') => match chars.next().map(|(_, ch)| ch) {
+            Some('x') => backslash_x_char(&mut chars).is_ok(),
+            Some('u') => backslash_u(&mut chars).is_ok(),
+            Some('n' | 'r' | 't' | '\\' | '0' | '\'' | '"') => true,
+            _ => false,
+        },
+        ch => ch.is_some(),
+    };
+    if !ok {
+        return Err(Reject);
+    }
+    let (idx, _) = chars.next().ok_or(Reject)?;
+    let input = input.advance(idx).parse("'")?;
+    Ok(literal_suffix(input))
+}
+
+macro_rules! next_ch {
+    ($chars:ident @ $pat:pat) => {
+        match $chars.next() {
+            Some((_, ch)) => match ch {
+                $pat => ch,
+                _ => return Err(Reject),
+            },
+            None => return Err(Reject),
+        }
+    };
+}
+
+fn backslash_x_char<I>(chars: &mut I) -> Result<(), Reject>
+where
+    I: Iterator<Item = (usize, char)>,
+{
+    next_ch!(chars @ '0'..='7');
+    next_ch!(chars @ '0'..='9' | 'a'..='f' | 'A'..='F');
+    Ok(())
+}
+
+fn backslash_x_byte<I>(chars: &mut I) -> Result<(), Reject>
+where
+    I: Iterator<Item = (usize, u8)>,
+{
+    next_ch!(chars @ b'0'..=b'9' | b'a'..=b'f' | b'A'..=b'F');
+    next_ch!(chars @ b'0'..=b'9' | b'a'..=b'f' | b'A'..=b'F');
+    Ok(())
+}
+
+fn backslash_x_nonzero<I>(chars: &mut I) -> Result<(), Reject>
+where
+    I: Iterator<Item = (usize, char)>,
+{
+    let first = next_ch!(chars @ '0'..='9' | 'a'..='f' | 'A'..='F');
+    let second = next_ch!(chars @ '0'..='9' | 'a'..='f' | 'A'..='F');
+    if first == '0' && second == '0' {
+        Err(Reject)
+    } else {
+        Ok(())
+    }
+}
+
+fn backslash_u<I>(chars: &mut I) -> Result<char, Reject>
+where
+    I: Iterator<Item = (usize, char)>,
+{
+    next_ch!(chars @ '{');
+    let mut value = 0;
+    let mut len = 0;
+    for (_, ch) in chars {
+        let digit = match ch {
+            '0'..='9' => ch as u8 - b'0',
+            'a'..='f' => 10 + ch as u8 - b'a',
+            'A'..='F' => 10 + ch as u8 - b'A',
+            '_' if len > 0 => continue,
+            '}' if len > 0 => return char::from_u32(value).ok_or(Reject),
+            _ => break,
+        };
+        if len == 6 {
+            break;
+        }
+        value *= 0x10;
+        value += u32::from(digit);
+        len += 1;
+    }
+    Err(Reject)
+}
+
+fn trailing_backslash(input: &mut Cursor, mut last: u8) -> Result<(), Reject> {
+    let mut whitespace = input.bytes().enumerate();
+    loop {
+        if last == b'\r' && whitespace.next().map_or(true, |(_, b)| b != b'\n') {
+            return Err(Reject);
+        }
+        match whitespace.next() {
+            Some((_, b @ (b' ' | b'\t' | b'\n' | b'\r'))) => {
+                last = b;
+            }
+            Some((offset, _)) => {
+                *input = input.advance(offset);
+                return Ok(());
+            }
+            None => return Err(Reject),
+        }
+    }
+}
+
+fn float(input: Cursor) -> Result<Cursor, Reject> {
+    let mut rest = float_digits(input)?;
+    if let Some(ch) = rest.chars().next() {
+        if is_ident_start(ch) {
+            rest = ident_not_raw(rest)?.0;
+        }
+    }
+    word_break(rest)
+}
+
+fn float_digits(input: Cursor) -> Result<Cursor, Reject> {
+    let mut chars = input.chars().peekable();
+    match chars.next() {
+        Some(ch) if '0' <= ch && ch <= '9' => {}
+        _ => return Err(Reject),
+    }
+
+    let mut len = 1;
+    let mut has_dot = false;
+    let mut has_exp = false;
+    while let Some(&ch) = chars.peek() {
+        match ch {
+            '0'..='9' | '_' => {
+                chars.next();
+                len += 1;
+            }
+            '.' => {
+                if has_dot {
+                    break;
+                }
+                chars.next();
+                if chars
+                    .peek()
+                    .map_or(false, |&ch| ch == '.' || is_ident_start(ch))
+                {
+                    return Err(Reject);
+                }
+                len += 1;
+                has_dot = true;
+            }
+            'e' | 'E' => {
+                chars.next();
+                len += 1;
+                has_exp = true;
+                break;
+            }
+            _ => break,
+        }
+    }
+
+    if !(has_dot || has_exp) {
+        return Err(Reject);
+    }
+
+    if has_exp {
+        let token_before_exp = if has_dot {
+            Ok(input.advance(len - 1))
+        } else {
+            Err(Reject)
+        };
+        let mut has_sign = false;
+        let mut has_exp_value = false;
+        while let Some(&ch) = chars.peek() {
+            match ch {
+                '+' | '-' => {
+                    if has_exp_value {
+                        break;
+                    }
+                    if has_sign {
+                        return token_before_exp;
+                    }
+                    chars.next();
+                    len += 1;
+                    has_sign = true;
+                }
+                '0'..='9' => {
+                    chars.next();
+                    len += 1;
+                    has_exp_value = true;
+                }
+                '_' => {
+                    chars.next();
+                    len += 1;
+                }
+                _ => break,
+            }
+        }
+        if !has_exp_value {
+            return token_before_exp;
+        }
+    }
+
+    Ok(input.advance(len))
+}
+
+fn int(input: Cursor) -> Result<Cursor, Reject> {
+    let mut rest = digits(input)?;
+    if let Some(ch) = rest.chars().next() {
+        if is_ident_start(ch) {
+            rest = ident_not_raw(rest)?.0;
+        }
+    }
+    word_break(rest)
+}
+
+fn digits(mut input: Cursor) -> Result<Cursor, Reject> {
+    let base = if input.starts_with("0x") {
+        input = input.advance(2);
+        16
+    } else if input.starts_with("0o") {
+        input = input.advance(2);
+        8
+    } else if input.starts_with("0b") {
+        input = input.advance(2);
+        2
+    } else {
+        10
+    };
+
+    let mut len = 0;
+    let mut empty = true;
+    for b in input.bytes() {
+        match b {
+            b'0'..=b'9' => {
+                let digit = (b - b'0') as u64;
+                if digit >= base {
+                    return Err(Reject);
+                }
+            }
+            b'a'..=b'f' => {
+                let digit = 10 + (b - b'a') as u64;
+                if digit >= base {
+                    break;
+                }
+            }
+            b'A'..=b'F' => {
+                let digit = 10 + (b - b'A') as u64;
+                if digit >= base {
+                    break;
+                }
+            }
+            b'_' => {
+                if empty && base == 10 {
+                    return Err(Reject);
+                }
+                len += 1;
+                continue;
+            }
+            _ => break,
+        };
+        len += 1;
+        empty = false;
+    }
+    if empty {
+        Err(Reject)
+    } else {
+        Ok(input.advance(len))
+    }
+}
+
+fn punct(input: Cursor) -> PResult<Punct> {
+    let (rest, ch) = punct_char(input)?;
+    if ch == '\'' {
+        if ident_any(rest)?.0.starts_with_char('\'') {
+            Err(Reject)
+        } else {
+            Ok((rest, Punct::new('\'', Spacing::Joint)))
+        }
+    } else {
+        let kind = match punct_char(rest) {
+            Ok(_) => Spacing::Joint,
+            Err(Reject) => Spacing::Alone,
+        };
+        Ok((rest, Punct::new(ch, kind)))
+    }
+}
+
+fn punct_char(input: Cursor) -> PResult<char> {
+    if input.starts_with("//") || input.starts_with("/*") {
+        // Do not accept `/` of a comment as a punct.
+        return Err(Reject);
+    }
+
+    let mut chars = input.chars();
+    let first = match chars.next() {
+        Some(ch) => ch,
+        None => {
+            return Err(Reject);
+        }
+    };
+    let recognized = "~!@#$%^&*-=+|;:,<.>/?'";
+    if recognized.contains(first) {
+        Ok((input.advance(first.len_utf8()), first))
+    } else {
+        Err(Reject)
+    }
+}
+
+fn doc_comment<'a>(input: Cursor<'a>, trees: &mut TokenStreamBuilder) -> PResult<'a, ()> {
+    #[cfg(span_locations)]
+    let lo = input.off;
+    let (rest, (comment, inner)) = doc_comment_contents(input)?;
+    let fallback_span = Span {
+        #[cfg(span_locations)]
+        lo,
+        #[cfg(span_locations)]
+        hi: rest.off,
+    };
+    let span = crate::Span::_new_fallback(fallback_span);
+
+    let mut scan_for_bare_cr = comment;
+    while let Some(cr) = scan_for_bare_cr.find('\r') {
+        let rest = &scan_for_bare_cr[cr + 1..];
+        if !rest.starts_with('\n') {
+            return Err(Reject);
+        }
+        scan_for_bare_cr = rest;
+    }
+
+    let mut pound = Punct::new('#', Spacing::Alone);
+    pound.set_span(span);
+    trees.push_token_from_parser(TokenTree::Punct(pound));
+
+    if inner {
+        let mut bang = Punct::new('!', Spacing::Alone);
+        bang.set_span(span);
+        trees.push_token_from_parser(TokenTree::Punct(bang));
+    }
+
+    let doc_ident = crate::Ident::_new(crate::imp::Ident::new_unchecked("doc", fallback_span));
+    let mut equal = Punct::new('=', Spacing::Alone);
+    equal.set_span(span);
+    let mut literal = crate::Literal::string(comment);
+    literal.set_span(span);
+    let mut bracketed = TokenStreamBuilder::with_capacity(3);
+    bracketed.push_token_from_parser(TokenTree::Ident(doc_ident));
+    bracketed.push_token_from_parser(TokenTree::Punct(equal));
+    bracketed.push_token_from_parser(TokenTree::Literal(literal));
+    let group = Group::new(Delimiter::Bracket, bracketed.build());
+    let mut group = crate::Group::_new_fallback(group);
+    group.set_span(span);
+    trees.push_token_from_parser(TokenTree::Group(group));
+
+    Ok((rest, ()))
+}
+
+fn doc_comment_contents(input: Cursor) -> PResult<(&str, bool)> {
+    if input.starts_with("//!") {
+        let input = input.advance(3);
+        let (input, s) = take_until_newline_or_eof(input);
+        Ok((input, (s, true)))
+    } else if input.starts_with("/*!") {
+        let (input, s) = block_comment(input)?;
+        Ok((input, (&s[3..s.len() - 2], true)))
+    } else if input.starts_with("///") {
+        let input = input.advance(3);
+        if input.starts_with_char('/') {
+            return Err(Reject);
+        }
+        let (input, s) = take_until_newline_or_eof(input);
+        Ok((input, (s, false)))
+    } else if input.starts_with("/**") && !input.rest[3..].starts_with('*') {
+        let (input, s) = block_comment(input)?;
+        Ok((input, (&s[3..s.len() - 2], false)))
+    } else {
+        Err(Reject)
+    }
+}
+
+fn take_until_newline_or_eof(input: Cursor) -> (Cursor, &str) {
+    let chars = input.char_indices();
+
+    for (i, ch) in chars {
+        if ch == '\n' {
+            return (input.advance(i), &input.rest[..i]);
+        } else if ch == '\r' && input.rest[i + 1..].starts_with('\n') {
+            return (input.advance(i + 1), &input.rest[..i]);
+        }
+    }
+
+    (input.advance(input.len()), input.rest)
+}
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/src/rcvec.rs 43.0.0-1ubuntu1/rust-vendor/proc-macro2/src/rcvec.rs
--- 43.0.0-1/rust-vendor/proc-macro2/src/rcvec.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/src/rcvec.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,145 @@
+use alloc::rc::Rc;
+use alloc::vec;
+use core::mem;
+use core::panic::RefUnwindSafe;
+use core::slice;
+
+pub(crate) struct RcVec<T> {
+    inner: Rc<Vec<T>>,
+}
+
+pub(crate) struct RcVecBuilder<T> {
+    inner: Vec<T>,
+}
+
+pub(crate) struct RcVecMut<'a, T> {
+    inner: &'a mut Vec<T>,
+}
+
+#[derive(Clone)]
+pub(crate) struct RcVecIntoIter<T> {
+    inner: vec::IntoIter<T>,
+}
+
+impl<T> RcVec<T> {
+    pub fn is_empty(&self) -> bool {
+        self.inner.is_empty()
+    }
+
+    pub fn len(&self) -> usize {
+        self.inner.len()
+    }
+
+    pub fn iter(&self) -> slice::Iter<T> {
+        self.inner.iter()
+    }
+
+    pub fn make_mut(&mut self) -> RcVecMut<T>
+    where
+        T: Clone,
+    {
+        RcVecMut {
+            inner: Rc::make_mut(&mut self.inner),
+        }
+    }
+
+    pub fn get_mut(&mut self) -> Option<RcVecMut<T>> {
+        let inner = Rc::get_mut(&mut self.inner)?;
+        Some(RcVecMut { inner })
+    }
+
+    pub fn make_owned(mut self) -> RcVecBuilder<T>
+    where
+        T: Clone,
+    {
+        let vec = if let Some(owned) = Rc::get_mut(&mut self.inner) {
+            mem::take(owned)
+        } else {
+            Vec::clone(&self.inner)
+        };
+        RcVecBuilder { inner: vec }
+    }
+}
+
+impl<T> RcVecBuilder<T> {
+    pub fn new() -> Self {
+        RcVecBuilder { inner: Vec::new() }
+    }
+
+    pub fn with_capacity(cap: usize) -> Self {
+        RcVecBuilder {
+            inner: Vec::with_capacity(cap),
+        }
+    }
+
+    pub fn push(&mut self, element: T) {
+        self.inner.push(element);
+    }
+
+    pub fn extend(&mut self, iter: impl IntoIterator<Item = T>) {
+        self.inner.extend(iter);
+    }
+
+    pub fn as_mut(&mut self) -> RcVecMut<T> {
+        RcVecMut {
+            inner: &mut self.inner,
+        }
+    }
+
+    pub fn build(self) -> RcVec<T> {
+        RcVec {
+            inner: Rc::new(self.inner),
+        }
+    }
+}
+
+impl<'a, T> RcVecMut<'a, T> {
+    pub fn push(&mut self, element: T) {
+        self.inner.push(element);
+    }
+
+    pub fn extend(&mut self, iter: impl IntoIterator<Item = T>) {
+        self.inner.extend(iter);
+    }
+
+    pub fn pop(&mut self) -> Option<T> {
+        self.inner.pop()
+    }
+
+    pub fn as_mut(&mut self) -> RcVecMut<T> {
+        RcVecMut { inner: self.inner }
+    }
+}
+
+impl<T> Clone for RcVec<T> {
+    fn clone(&self) -> Self {
+        RcVec {
+            inner: Rc::clone(&self.inner),
+        }
+    }
+}
+
+impl<T> IntoIterator for RcVecBuilder<T> {
+    type Item = T;
+    type IntoIter = RcVecIntoIter<T>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        RcVecIntoIter {
+            inner: self.inner.into_iter(),
+        }
+    }
+}
+
+impl<T> Iterator for RcVecIntoIter<T> {
+    type Item = T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner.next()
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        self.inner.size_hint()
+    }
+}
+
+impl<T> RefUnwindSafe for RcVec<T> where T: RefUnwindSafe {}
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/src/wrapper.rs 43.0.0-1ubuntu1/rust-vendor/proc-macro2/src/wrapper.rs
--- 43.0.0-1/rust-vendor/proc-macro2/src/wrapper.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/src/wrapper.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,993 @@
+use crate::detection::inside_proc_macro;
+#[cfg(span_locations)]
+use crate::location::LineColumn;
+use crate::{fallback, Delimiter, Punct, Spacing, TokenTree};
+use core::fmt::{self, Debug, Display};
+#[cfg(span_locations)]
+use core::ops::Range;
+use core::ops::RangeBounds;
+use core::str::FromStr;
+use std::ffi::CStr;
+use std::panic;
+#[cfg(super_unstable)]
+use std::path::PathBuf;
+
+#[derive(Clone)]
+pub(crate) enum TokenStream {
+    Compiler(DeferredTokenStream),
+    Fallback(fallback::TokenStream),
+}
+
+// Work around https://github.com/rust-lang/rust/issues/65080.
+// In `impl Extend<TokenTree> for TokenStream` which is used heavily by quote,
+// we hold on to the appended tokens and do proc_macro::TokenStream::extend as
+// late as possible to batch together consecutive uses of the Extend impl.
+#[derive(Clone)]
+pub(crate) struct DeferredTokenStream {
+    stream: proc_macro::TokenStream,
+    extra: Vec<proc_macro::TokenTree>,
+}
+
+pub(crate) enum LexError {
+    Compiler(proc_macro::LexError),
+    Fallback(fallback::LexError),
+
+    // Rustc was supposed to return a LexError, but it panicked instead.
+    // https://github.com/rust-lang/rust/issues/58736
+    CompilerPanic,
+}
+
+#[cold]
+fn mismatch(line: u32) -> ! {
+    #[cfg(procmacro2_backtrace)]
+    {
+        let backtrace = std::backtrace::Backtrace::force_capture();
+        panic!("compiler/fallback mismatch #{}\n\n{}", line, backtrace)
+    }
+    #[cfg(not(procmacro2_backtrace))]
+    {
+        panic!("compiler/fallback mismatch #{}", line)
+    }
+}
+
+impl DeferredTokenStream {
+    fn new(stream: proc_macro::TokenStream) -> Self {
+        DeferredTokenStream {
+            stream,
+            extra: Vec::new(),
+        }
+    }
+
+    fn is_empty(&self) -> bool {
+        self.stream.is_empty() && self.extra.is_empty()
+    }
+
+    fn evaluate_now(&mut self) {
+        // If-check provides a fast short circuit for the common case of `extra`
+        // being empty, which saves a round trip over the proc macro bridge.
+        // Improves macro expansion time in winrt by 6% in debug mode.
+        if !self.extra.is_empty() {
+            self.stream.extend(self.extra.drain(..));
+        }
+    }
+
+    fn into_token_stream(mut self) -> proc_macro::TokenStream {
+        self.evaluate_now();
+        self.stream
+    }
+}
+
+impl TokenStream {
+    pub fn new() -> Self {
+        if inside_proc_macro() {
+            TokenStream::Compiler(DeferredTokenStream::new(proc_macro::TokenStream::new()))
+        } else {
+            TokenStream::Fallback(fallback::TokenStream::new())
+        }
+    }
+
+    pub fn is_empty(&self) -> bool {
+        match self {
+            TokenStream::Compiler(tts) => tts.is_empty(),
+            TokenStream::Fallback(tts) => tts.is_empty(),
+        }
+    }
+
+    fn unwrap_nightly(self) -> proc_macro::TokenStream {
+        match self {
+            TokenStream::Compiler(s) => s.into_token_stream(),
+            TokenStream::Fallback(_) => mismatch(line!()),
+        }
+    }
+
+    fn unwrap_stable(self) -> fallback::TokenStream {
+        match self {
+            TokenStream::Compiler(_) => mismatch(line!()),
+            TokenStream::Fallback(s) => s,
+        }
+    }
+}
+
+impl FromStr for TokenStream {
+    type Err = LexError;
+
+    fn from_str(src: &str) -> Result<TokenStream, LexError> {
+        if inside_proc_macro() {
+            Ok(TokenStream::Compiler(DeferredTokenStream::new(
+                proc_macro_parse(src)?,
+            )))
+        } else {
+            Ok(TokenStream::Fallback(src.parse()?))
+        }
+    }
+}
+
+// Work around https://github.com/rust-lang/rust/issues/58736.
+fn proc_macro_parse(src: &str) -> Result<proc_macro::TokenStream, LexError> {
+    let result = panic::catch_unwind(|| src.parse().map_err(LexError::Compiler));
+    result.unwrap_or_else(|_| Err(LexError::CompilerPanic))
+}
+
+impl Display for TokenStream {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            TokenStream::Compiler(tts) => Display::fmt(&tts.clone().into_token_stream(), f),
+            TokenStream::Fallback(tts) => Display::fmt(tts, f),
+        }
+    }
+}
+
+impl From<proc_macro::TokenStream> for TokenStream {
+    fn from(inner: proc_macro::TokenStream) -> Self {
+        TokenStream::Compiler(DeferredTokenStream::new(inner))
+    }
+}
+
+impl From<TokenStream> for proc_macro::TokenStream {
+    fn from(inner: TokenStream) -> Self {
+        match inner {
+            TokenStream::Compiler(inner) => inner.into_token_stream(),
+            TokenStream::Fallback(inner) => inner.to_string().parse().unwrap(),
+        }
+    }
+}
+
+impl From<fallback::TokenStream> for TokenStream {
+    fn from(inner: fallback::TokenStream) -> Self {
+        TokenStream::Fallback(inner)
+    }
+}
+
+// Assumes inside_proc_macro().
+fn into_compiler_token(token: TokenTree) -> proc_macro::TokenTree {
+    match token {
+        TokenTree::Group(tt) => tt.inner.unwrap_nightly().into(),
+        TokenTree::Punct(tt) => {
+            let spacing = match tt.spacing() {
+                Spacing::Joint => proc_macro::Spacing::Joint,
+                Spacing::Alone => proc_macro::Spacing::Alone,
+            };
+            let mut punct = proc_macro::Punct::new(tt.as_char(), spacing);
+            punct.set_span(tt.span().inner.unwrap_nightly());
+            punct.into()
+        }
+        TokenTree::Ident(tt) => tt.inner.unwrap_nightly().into(),
+        TokenTree::Literal(tt) => tt.inner.unwrap_nightly().into(),
+    }
+}
+
+impl From<TokenTree> for TokenStream {
+    fn from(token: TokenTree) -> Self {
+        if inside_proc_macro() {
+            TokenStream::Compiler(DeferredTokenStream::new(into_compiler_token(token).into()))
+        } else {
+            TokenStream::Fallback(token.into())
+        }
+    }
+}
+
+impl FromIterator<TokenTree> for TokenStream {
+    fn from_iter<I: IntoIterator<Item = TokenTree>>(trees: I) -> Self {
+        if inside_proc_macro() {
+            TokenStream::Compiler(DeferredTokenStream::new(
+                trees.into_iter().map(into_compiler_token).collect(),
+            ))
+        } else {
+            TokenStream::Fallback(trees.into_iter().collect())
+        }
+    }
+}
+
+impl FromIterator<TokenStream> for TokenStream {
+    fn from_iter<I: IntoIterator<Item = TokenStream>>(streams: I) -> Self {
+        let mut streams = streams.into_iter();
+        match streams.next() {
+            Some(TokenStream::Compiler(mut first)) => {
+                first.evaluate_now();
+                first.stream.extend(streams.map(|s| match s {
+                    TokenStream::Compiler(s) => s.into_token_stream(),
+                    TokenStream::Fallback(_) => mismatch(line!()),
+                }));
+                TokenStream::Compiler(first)
+            }
+            Some(TokenStream::Fallback(mut first)) => {
+                first.extend(streams.map(|s| match s {
+                    TokenStream::Fallback(s) => s,
+                    TokenStream::Compiler(_) => mismatch(line!()),
+                }));
+                TokenStream::Fallback(first)
+            }
+            None => TokenStream::new(),
+        }
+    }
+}
+
+impl Extend<TokenTree> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, stream: I) {
+        match self {
+            TokenStream::Compiler(tts) => {
+                // Here is the reason for DeferredTokenStream.
+                for token in stream {
+                    tts.extra.push(into_compiler_token(token));
+                }
+            }
+            TokenStream::Fallback(tts) => tts.extend(stream),
+        }
+    }
+}
+
+impl Extend<TokenStream> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenStream>>(&mut self, streams: I) {
+        match self {
+            TokenStream::Compiler(tts) => {
+                tts.evaluate_now();
+                tts.stream
+                    .extend(streams.into_iter().map(TokenStream::unwrap_nightly));
+            }
+            TokenStream::Fallback(tts) => {
+                tts.extend(streams.into_iter().map(TokenStream::unwrap_stable));
+            }
+        }
+    }
+}
+
+impl Debug for TokenStream {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            TokenStream::Compiler(tts) => Debug::fmt(&tts.clone().into_token_stream(), f),
+            TokenStream::Fallback(tts) => Debug::fmt(tts, f),
+        }
+    }
+}
+
+impl LexError {
+    pub(crate) fn span(&self) -> Span {
+        match self {
+            LexError::Compiler(_) | LexError::CompilerPanic => Span::call_site(),
+            LexError::Fallback(e) => Span::Fallback(e.span()),
+        }
+    }
+}
+
+impl From<proc_macro::LexError> for LexError {
+    fn from(e: proc_macro::LexError) -> Self {
+        LexError::Compiler(e)
+    }
+}
+
+impl From<fallback::LexError> for LexError {
+    fn from(e: fallback::LexError) -> Self {
+        LexError::Fallback(e)
+    }
+}
+
+impl Debug for LexError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            LexError::Compiler(e) => Debug::fmt(e, f),
+            LexError::Fallback(e) => Debug::fmt(e, f),
+            LexError::CompilerPanic => {
+                let fallback = fallback::LexError::call_site();
+                Debug::fmt(&fallback, f)
+            }
+        }
+    }
+}
+
+impl Display for LexError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            LexError::Compiler(e) => Display::fmt(e, f),
+            LexError::Fallback(e) => Display::fmt(e, f),
+            LexError::CompilerPanic => {
+                let fallback = fallback::LexError::call_site();
+                Display::fmt(&fallback, f)
+            }
+        }
+    }
+}
+
+#[derive(Clone)]
+pub(crate) enum TokenTreeIter {
+    Compiler(proc_macro::token_stream::IntoIter),
+    Fallback(fallback::TokenTreeIter),
+}
+
+impl IntoIterator for TokenStream {
+    type Item = TokenTree;
+    type IntoIter = TokenTreeIter;
+
+    fn into_iter(self) -> TokenTreeIter {
+        match self {
+            TokenStream::Compiler(tts) => {
+                TokenTreeIter::Compiler(tts.into_token_stream().into_iter())
+            }
+            TokenStream::Fallback(tts) => TokenTreeIter::Fallback(tts.into_iter()),
+        }
+    }
+}
+
+impl Iterator for TokenTreeIter {
+    type Item = TokenTree;
+
+    fn next(&mut self) -> Option<TokenTree> {
+        let token = match self {
+            TokenTreeIter::Compiler(iter) => iter.next()?,
+            TokenTreeIter::Fallback(iter) => return iter.next(),
+        };
+        Some(match token {
+            proc_macro::TokenTree::Group(tt) => crate::Group::_new(Group::Compiler(tt)).into(),
+            proc_macro::TokenTree::Punct(tt) => {
+                let spacing = match tt.spacing() {
+                    proc_macro::Spacing::Joint => Spacing::Joint,
+                    proc_macro::Spacing::Alone => Spacing::Alone,
+                };
+                let mut o = Punct::new(tt.as_char(), spacing);
+                o.set_span(crate::Span::_new(Span::Compiler(tt.span())));
+                o.into()
+            }
+            proc_macro::TokenTree::Ident(s) => crate::Ident::_new(Ident::Compiler(s)).into(),
+            proc_macro::TokenTree::Literal(l) => crate::Literal::_new(Literal::Compiler(l)).into(),
+        })
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        match self {
+            TokenTreeIter::Compiler(tts) => tts.size_hint(),
+            TokenTreeIter::Fallback(tts) => tts.size_hint(),
+        }
+    }
+}
+
+#[derive(Clone, PartialEq, Eq)]
+#[cfg(super_unstable)]
+pub(crate) enum SourceFile {
+    Compiler(proc_macro::SourceFile),
+    Fallback(fallback::SourceFile),
+}
+
+#[cfg(super_unstable)]
+impl SourceFile {
+    fn nightly(sf: proc_macro::SourceFile) -> Self {
+        SourceFile::Compiler(sf)
+    }
+
+    /// Get the path to this source file as a string.
+    pub fn path(&self) -> PathBuf {
+        match self {
+            SourceFile::Compiler(a) => a.path(),
+            SourceFile::Fallback(a) => a.path(),
+        }
+    }
+
+    pub fn is_real(&self) -> bool {
+        match self {
+            SourceFile::Compiler(a) => a.is_real(),
+            SourceFile::Fallback(a) => a.is_real(),
+        }
+    }
+}
+
+#[cfg(super_unstable)]
+impl Debug for SourceFile {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            SourceFile::Compiler(a) => Debug::fmt(a, f),
+            SourceFile::Fallback(a) => Debug::fmt(a, f),
+        }
+    }
+}
+
+#[derive(Copy, Clone)]
+pub(crate) enum Span {
+    Compiler(proc_macro::Span),
+    Fallback(fallback::Span),
+}
+
+impl Span {
+    pub fn call_site() -> Self {
+        if inside_proc_macro() {
+            Span::Compiler(proc_macro::Span::call_site())
+        } else {
+            Span::Fallback(fallback::Span::call_site())
+        }
+    }
+
+    pub fn mixed_site() -> Self {
+        if inside_proc_macro() {
+            Span::Compiler(proc_macro::Span::mixed_site())
+        } else {
+            Span::Fallback(fallback::Span::mixed_site())
+        }
+    }
+
+    #[cfg(super_unstable)]
+    pub fn def_site() -> Self {
+        if inside_proc_macro() {
+            Span::Compiler(proc_macro::Span::def_site())
+        } else {
+            Span::Fallback(fallback::Span::def_site())
+        }
+    }
+
+    pub fn resolved_at(&self, other: Span) -> Span {
+        match (self, other) {
+            (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.resolved_at(b)),
+            (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.resolved_at(b)),
+            (Span::Compiler(_), Span::Fallback(_)) => mismatch(line!()),
+            (Span::Fallback(_), Span::Compiler(_)) => mismatch(line!()),
+        }
+    }
+
+    pub fn located_at(&self, other: Span) -> Span {
+        match (self, other) {
+            (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.located_at(b)),
+            (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.located_at(b)),
+            (Span::Compiler(_), Span::Fallback(_)) => mismatch(line!()),
+            (Span::Fallback(_), Span::Compiler(_)) => mismatch(line!()),
+        }
+    }
+
+    pub fn unwrap(self) -> proc_macro::Span {
+        match self {
+            Span::Compiler(s) => s,
+            Span::Fallback(_) => panic!("proc_macro::Span is only available in procedural macros"),
+        }
+    }
+
+    #[cfg(super_unstable)]
+    pub fn source_file(&self) -> SourceFile {
+        match self {
+            Span::Compiler(s) => SourceFile::nightly(s.source_file()),
+            Span::Fallback(s) => SourceFile::Fallback(s.source_file()),
+        }
+    }
+
+    #[cfg(span_locations)]
+    pub fn byte_range(&self) -> Range<usize> {
+        match self {
+            #[cfg(proc_macro_span)]
+            Span::Compiler(s) => s.byte_range(),
+            #[cfg(not(proc_macro_span))]
+            Span::Compiler(_) => 0..0,
+            Span::Fallback(s) => s.byte_range(),
+        }
+    }
+
+    #[cfg(span_locations)]
+    pub fn start(&self) -> LineColumn {
+        match self {
+            Span::Compiler(_) => LineColumn { line: 0, column: 0 },
+            Span::Fallback(s) => s.start(),
+        }
+    }
+
+    #[cfg(span_locations)]
+    pub fn end(&self) -> LineColumn {
+        match self {
+            Span::Compiler(_) => LineColumn { line: 0, column: 0 },
+            Span::Fallback(s) => s.end(),
+        }
+    }
+
+    pub fn join(&self, other: Span) -> Option<Span> {
+        let ret = match (self, other) {
+            #[cfg(proc_macro_span)]
+            (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.join(b)?),
+            (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.join(b)?),
+            _ => return None,
+        };
+        Some(ret)
+    }
+
+    #[cfg(super_unstable)]
+    pub fn eq(&self, other: &Span) -> bool {
+        match (self, other) {
+            (Span::Compiler(a), Span::Compiler(b)) => a.eq(b),
+            (Span::Fallback(a), Span::Fallback(b)) => a.eq(b),
+            _ => false,
+        }
+    }
+
+    pub fn source_text(&self) -> Option<String> {
+        match self {
+            #[cfg(not(no_source_text))]
+            Span::Compiler(s) => s.source_text(),
+            #[cfg(no_source_text)]
+            Span::Compiler(_) => None,
+            Span::Fallback(s) => s.source_text(),
+        }
+    }
+
+    fn unwrap_nightly(self) -> proc_macro::Span {
+        match self {
+            Span::Compiler(s) => s,
+            Span::Fallback(_) => mismatch(line!()),
+        }
+    }
+}
+
+impl From<proc_macro::Span> for crate::Span {
+    fn from(proc_span: proc_macro::Span) -> Self {
+        crate::Span::_new(Span::Compiler(proc_span))
+    }
+}
+
+impl From<fallback::Span> for Span {
+    fn from(inner: fallback::Span) -> Self {
+        Span::Fallback(inner)
+    }
+}
+
+impl Debug for Span {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Span::Compiler(s) => Debug::fmt(s, f),
+            Span::Fallback(s) => Debug::fmt(s, f),
+        }
+    }
+}
+
+pub(crate) fn debug_span_field_if_nontrivial(debug: &mut fmt::DebugStruct, span: Span) {
+    match span {
+        Span::Compiler(s) => {
+            debug.field("span", &s);
+        }
+        Span::Fallback(s) => fallback::debug_span_field_if_nontrivial(debug, s),
+    }
+}
+
+#[derive(Clone)]
+pub(crate) enum Group {
+    Compiler(proc_macro::Group),
+    Fallback(fallback::Group),
+}
+
+impl Group {
+    pub fn new(delimiter: Delimiter, stream: TokenStream) -> Self {
+        match stream {
+            TokenStream::Compiler(tts) => {
+                let delimiter = match delimiter {
+                    Delimiter::Parenthesis => proc_macro::Delimiter::Parenthesis,
+                    Delimiter::Bracket => proc_macro::Delimiter::Bracket,
+                    Delimiter::Brace => proc_macro::Delimiter::Brace,
+                    Delimiter::None => proc_macro::Delimiter::None,
+                };
+                Group::Compiler(proc_macro::Group::new(delimiter, tts.into_token_stream()))
+            }
+            TokenStream::Fallback(stream) => {
+                Group::Fallback(fallback::Group::new(delimiter, stream))
+            }
+        }
+    }
+
+    pub fn delimiter(&self) -> Delimiter {
+        match self {
+            Group::Compiler(g) => match g.delimiter() {
+                proc_macro::Delimiter::Parenthesis => Delimiter::Parenthesis,
+                proc_macro::Delimiter::Bracket => Delimiter::Bracket,
+                proc_macro::Delimiter::Brace => Delimiter::Brace,
+                proc_macro::Delimiter::None => Delimiter::None,
+            },
+            Group::Fallback(g) => g.delimiter(),
+        }
+    }
+
+    pub fn stream(&self) -> TokenStream {
+        match self {
+            Group::Compiler(g) => TokenStream::Compiler(DeferredTokenStream::new(g.stream())),
+            Group::Fallback(g) => TokenStream::Fallback(g.stream()),
+        }
+    }
+
+    pub fn span(&self) -> Span {
+        match self {
+            Group::Compiler(g) => Span::Compiler(g.span()),
+            Group::Fallback(g) => Span::Fallback(g.span()),
+        }
+    }
+
+    pub fn span_open(&self) -> Span {
+        match self {
+            Group::Compiler(g) => Span::Compiler(g.span_open()),
+            Group::Fallback(g) => Span::Fallback(g.span_open()),
+        }
+    }
+
+    pub fn span_close(&self) -> Span {
+        match self {
+            Group::Compiler(g) => Span::Compiler(g.span_close()),
+            Group::Fallback(g) => Span::Fallback(g.span_close()),
+        }
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        match (self, span) {
+            (Group::Compiler(g), Span::Compiler(s)) => g.set_span(s),
+            (Group::Fallback(g), Span::Fallback(s)) => g.set_span(s),
+            (Group::Compiler(_), Span::Fallback(_)) => mismatch(line!()),
+            (Group::Fallback(_), Span::Compiler(_)) => mismatch(line!()),
+        }
+    }
+
+    fn unwrap_nightly(self) -> proc_macro::Group {
+        match self {
+            Group::Compiler(g) => g,
+            Group::Fallback(_) => mismatch(line!()),
+        }
+    }
+}
+
+impl From<fallback::Group> for Group {
+    fn from(g: fallback::Group) -> Self {
+        Group::Fallback(g)
+    }
+}
+
+impl Display for Group {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Group::Compiler(group) => Display::fmt(group, formatter),
+            Group::Fallback(group) => Display::fmt(group, formatter),
+        }
+    }
+}
+
+impl Debug for Group {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Group::Compiler(group) => Debug::fmt(group, formatter),
+            Group::Fallback(group) => Debug::fmt(group, formatter),
+        }
+    }
+}
+
+#[derive(Clone)]
+pub(crate) enum Ident {
+    Compiler(proc_macro::Ident),
+    Fallback(fallback::Ident),
+}
+
+impl Ident {
+    #[track_caller]
+    pub fn new_checked(string: &str, span: Span) -> Self {
+        match span {
+            Span::Compiler(s) => Ident::Compiler(proc_macro::Ident::new(string, s)),
+            Span::Fallback(s) => Ident::Fallback(fallback::Ident::new_checked(string, s)),
+        }
+    }
+
+    pub fn new_unchecked(string: &str, span: fallback::Span) -> Self {
+        Ident::Fallback(fallback::Ident::new_unchecked(string, span))
+    }
+
+    #[track_caller]
+    pub fn new_raw_checked(string: &str, span: Span) -> Self {
+        match span {
+            Span::Compiler(s) => Ident::Compiler(proc_macro::Ident::new_raw(string, s)),
+            Span::Fallback(s) => Ident::Fallback(fallback::Ident::new_raw_checked(string, s)),
+        }
+    }
+
+    pub fn new_raw_unchecked(string: &str, span: fallback::Span) -> Self {
+        Ident::Fallback(fallback::Ident::new_raw_unchecked(string, span))
+    }
+
+    pub fn span(&self) -> Span {
+        match self {
+            Ident::Compiler(t) => Span::Compiler(t.span()),
+            Ident::Fallback(t) => Span::Fallback(t.span()),
+        }
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        match (self, span) {
+            (Ident::Compiler(t), Span::Compiler(s)) => t.set_span(s),
+            (Ident::Fallback(t), Span::Fallback(s)) => t.set_span(s),
+            (Ident::Compiler(_), Span::Fallback(_)) => mismatch(line!()),
+            (Ident::Fallback(_), Span::Compiler(_)) => mismatch(line!()),
+        }
+    }
+
+    fn unwrap_nightly(self) -> proc_macro::Ident {
+        match self {
+            Ident::Compiler(s) => s,
+            Ident::Fallback(_) => mismatch(line!()),
+        }
+    }
+}
+
+impl PartialEq for Ident {
+    fn eq(&self, other: &Ident) -> bool {
+        match (self, other) {
+            (Ident::Compiler(t), Ident::Compiler(o)) => t.to_string() == o.to_string(),
+            (Ident::Fallback(t), Ident::Fallback(o)) => t == o,
+            (Ident::Compiler(_), Ident::Fallback(_)) => mismatch(line!()),
+            (Ident::Fallback(_), Ident::Compiler(_)) => mismatch(line!()),
+        }
+    }
+}
+
+impl<T> PartialEq<T> for Ident
+where
+    T: ?Sized + AsRef<str>,
+{
+    fn eq(&self, other: &T) -> bool {
+        let other = other.as_ref();
+        match self {
+            Ident::Compiler(t) => t.to_string() == other,
+            Ident::Fallback(t) => t == other,
+        }
+    }
+}
+
+impl Display for Ident {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Ident::Compiler(t) => Display::fmt(t, f),
+            Ident::Fallback(t) => Display::fmt(t, f),
+        }
+    }
+}
+
+impl Debug for Ident {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Ident::Compiler(t) => Debug::fmt(t, f),
+            Ident::Fallback(t) => Debug::fmt(t, f),
+        }
+    }
+}
+
+#[derive(Clone)]
+pub(crate) enum Literal {
+    Compiler(proc_macro::Literal),
+    Fallback(fallback::Literal),
+}
+
+macro_rules! suffixed_numbers {
+    ($($name:ident => $kind:ident,)*) => ($(
+        pub fn $name(n: $kind) -> Literal {
+            if inside_proc_macro() {
+                Literal::Compiler(proc_macro::Literal::$name(n))
+            } else {
+                Literal::Fallback(fallback::Literal::$name(n))
+            }
+        }
+    )*)
+}
+
+macro_rules! unsuffixed_integers {
+    ($($name:ident => $kind:ident,)*) => ($(
+        pub fn $name(n: $kind) -> Literal {
+            if inside_proc_macro() {
+                Literal::Compiler(proc_macro::Literal::$name(n))
+            } else {
+                Literal::Fallback(fallback::Literal::$name(n))
+            }
+        }
+    )*)
+}
+
+impl Literal {
+    pub unsafe fn from_str_unchecked(repr: &str) -> Self {
+        if inside_proc_macro() {
+            Literal::Compiler(proc_macro::Literal::from_str(repr).expect("invalid literal"))
+        } else {
+            Literal::Fallback(unsafe { fallback::Literal::from_str_unchecked(repr) })
+        }
+    }
+
+    suffixed_numbers! {
+        u8_suffixed => u8,
+        u16_suffixed => u16,
+        u32_suffixed => u32,
+        u64_suffixed => u64,
+        u128_suffixed => u128,
+        usize_suffixed => usize,
+        i8_suffixed => i8,
+        i16_suffixed => i16,
+        i32_suffixed => i32,
+        i64_suffixed => i64,
+        i128_suffixed => i128,
+        isize_suffixed => isize,
+
+        f32_suffixed => f32,
+        f64_suffixed => f64,
+    }
+
+    unsuffixed_integers! {
+        u8_unsuffixed => u8,
+        u16_unsuffixed => u16,
+        u32_unsuffixed => u32,
+        u64_unsuffixed => u64,
+        u128_unsuffixed => u128,
+        usize_unsuffixed => usize,
+        i8_unsuffixed => i8,
+        i16_unsuffixed => i16,
+        i32_unsuffixed => i32,
+        i64_unsuffixed => i64,
+        i128_unsuffixed => i128,
+        isize_unsuffixed => isize,
+    }
+
+    pub fn f32_unsuffixed(f: f32) -> Literal {
+        if inside_proc_macro() {
+            Literal::Compiler(proc_macro::Literal::f32_unsuffixed(f))
+        } else {
+            Literal::Fallback(fallback::Literal::f32_unsuffixed(f))
+        }
+    }
+
+    pub fn f64_unsuffixed(f: f64) -> Literal {
+        if inside_proc_macro() {
+            Literal::Compiler(proc_macro::Literal::f64_unsuffixed(f))
+        } else {
+            Literal::Fallback(fallback::Literal::f64_unsuffixed(f))
+        }
+    }
+
+    pub fn string(string: &str) -> Literal {
+        if inside_proc_macro() {
+            Literal::Compiler(proc_macro::Literal::string(string))
+        } else {
+            Literal::Fallback(fallback::Literal::string(string))
+        }
+    }
+
+    pub fn character(ch: char) -> Literal {
+        if inside_proc_macro() {
+            Literal::Compiler(proc_macro::Literal::character(ch))
+        } else {
+            Literal::Fallback(fallback::Literal::character(ch))
+        }
+    }
+
+    pub fn byte_character(byte: u8) -> Literal {
+        if inside_proc_macro() {
+            Literal::Compiler({
+                #[cfg(not(no_literal_byte_character))]
+                {
+                    proc_macro::Literal::byte_character(byte)
+                }
+
+                #[cfg(no_literal_byte_character)]
+                {
+                    let fallback = fallback::Literal::byte_character(byte);
+                    fallback.repr.parse::<proc_macro::Literal>().unwrap()
+                }
+            })
+        } else {
+            Literal::Fallback(fallback::Literal::byte_character(byte))
+        }
+    }
+
+    pub fn byte_string(bytes: &[u8]) -> Literal {
+        if inside_proc_macro() {
+            Literal::Compiler(proc_macro::Literal::byte_string(bytes))
+        } else {
+            Literal::Fallback(fallback::Literal::byte_string(bytes))
+        }
+    }
+
+    pub fn c_string(string: &CStr) -> Literal {
+        if inside_proc_macro() {
+            Literal::Compiler({
+                #[cfg(not(no_literal_c_string))]
+                {
+                    proc_macro::Literal::c_string(string)
+                }
+
+                #[cfg(no_literal_c_string)]
+                {
+                    let fallback = fallback::Literal::c_string(string);
+                    fallback.repr.parse::<proc_macro::Literal>().unwrap()
+                }
+            })
+        } else {
+            Literal::Fallback(fallback::Literal::c_string(string))
+        }
+    }
+
+    pub fn span(&self) -> Span {
+        match self {
+            Literal::Compiler(lit) => Span::Compiler(lit.span()),
+            Literal::Fallback(lit) => Span::Fallback(lit.span()),
+        }
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        match (self, span) {
+            (Literal::Compiler(lit), Span::Compiler(s)) => lit.set_span(s),
+            (Literal::Fallback(lit), Span::Fallback(s)) => lit.set_span(s),
+            (Literal::Compiler(_), Span::Fallback(_)) => mismatch(line!()),
+            (Literal::Fallback(_), Span::Compiler(_)) => mismatch(line!()),
+        }
+    }
+
+    pub fn subspan<R: RangeBounds<usize>>(&self, range: R) -> Option<Span> {
+        match self {
+            #[cfg(proc_macro_span)]
+            Literal::Compiler(lit) => lit.subspan(range).map(Span::Compiler),
+            #[cfg(not(proc_macro_span))]
+            Literal::Compiler(_lit) => None,
+            Literal::Fallback(lit) => lit.subspan(range).map(Span::Fallback),
+        }
+    }
+
+    fn unwrap_nightly(self) -> proc_macro::Literal {
+        match self {
+            Literal::Compiler(s) => s,
+            Literal::Fallback(_) => mismatch(line!()),
+        }
+    }
+}
+
+impl From<fallback::Literal> for Literal {
+    fn from(s: fallback::Literal) -> Self {
+        Literal::Fallback(s)
+    }
+}
+
+impl FromStr for Literal {
+    type Err = LexError;
+
+    fn from_str(repr: &str) -> Result<Self, Self::Err> {
+        if inside_proc_macro() {
+            let literal = proc_macro::Literal::from_str(repr)?;
+            Ok(Literal::Compiler(literal))
+        } else {
+            let literal = fallback::Literal::from_str(repr)?;
+            Ok(Literal::Fallback(literal))
+        }
+    }
+}
+
+impl Display for Literal {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Literal::Compiler(t) => Display::fmt(t, f),
+            Literal::Fallback(t) => Display::fmt(t, f),
+        }
+    }
+}
+
+impl Debug for Literal {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Literal::Compiler(t) => Debug::fmt(t, f),
+            Literal::Fallback(t) => Debug::fmt(t, f),
+        }
+    }
+}
+
+#[cfg(span_locations)]
+pub(crate) fn invalidate_current_thread_spans() {
+    if inside_proc_macro() {
+        panic!(
+            "proc_macro2::extra::invalidate_current_thread_spans is not available in procedural macros"
+        );
+    } else {
+        crate::fallback::invalidate_current_thread_spans();
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/tests/comments.rs 43.0.0-1ubuntu1/rust-vendor/proc-macro2/tests/comments.rs
--- 43.0.0-1/rust-vendor/proc-macro2/tests/comments.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/tests/comments.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,105 @@
+#![allow(clippy::assertions_on_result_states)]
+
+use proc_macro2::{Delimiter, Literal, Spacing, TokenStream, TokenTree};
+
+// #[doc = "..."] -> "..."
+fn lit_of_outer_doc_comment(tokens: &TokenStream) -> Literal {
+    lit_of_doc_comment(tokens, false)
+}
+
+// #![doc = "..."] -> "..."
+fn lit_of_inner_doc_comment(tokens: &TokenStream) -> Literal {
+    lit_of_doc_comment(tokens, true)
+}
+
+fn lit_of_doc_comment(tokens: &TokenStream, inner: bool) -> Literal {
+    let mut iter = tokens.clone().into_iter();
+    match iter.next().unwrap() {
+        TokenTree::Punct(punct) => {
+            assert_eq!(punct.as_char(), '#');
+            assert_eq!(punct.spacing(), Spacing::Alone);
+        }
+        _ => panic!("wrong token {:?}", tokens),
+    }
+    if inner {
+        match iter.next().unwrap() {
+            TokenTree::Punct(punct) => {
+                assert_eq!(punct.as_char(), '!');
+                assert_eq!(punct.spacing(), Spacing::Alone);
+            }
+            _ => panic!("wrong token {:?}", tokens),
+        }
+    }
+    iter = match iter.next().unwrap() {
+        TokenTree::Group(group) => {
+            assert_eq!(group.delimiter(), Delimiter::Bracket);
+            assert!(iter.next().is_none(), "unexpected token {:?}", tokens);
+            group.stream().into_iter()
+        }
+        _ => panic!("wrong token {:?}", tokens),
+    };
+    match iter.next().unwrap() {
+        TokenTree::Ident(ident) => assert_eq!(ident.to_string(), "doc"),
+        _ => panic!("wrong token {:?}", tokens),
+    }
+    match iter.next().unwrap() {
+        TokenTree::Punct(punct) => {
+            assert_eq!(punct.as_char(), '=');
+            assert_eq!(punct.spacing(), Spacing::Alone);
+        }
+        _ => panic!("wrong token {:?}", tokens),
+    }
+    match iter.next().unwrap() {
+        TokenTree::Literal(literal) => {
+            assert!(iter.next().is_none(), "unexpected token {:?}", tokens);
+            literal
+        }
+        _ => panic!("wrong token {:?}", tokens),
+    }
+}
+
+#[test]
+fn closed_immediately() {
+    let stream = "/**/".parse::<TokenStream>().unwrap();
+    let tokens = stream.into_iter().collect::<Vec<_>>();
+    assert!(tokens.is_empty(), "not empty -- {:?}", tokens);
+}
+
+#[test]
+fn incomplete() {
+    assert!("/*/".parse::<TokenStream>().is_err());
+}
+
+#[test]
+fn lit() {
+    let stream = "/// doc".parse::<TokenStream>().unwrap();
+    let lit = lit_of_outer_doc_comment(&stream);
+    assert_eq!(lit.to_string(), "\" doc\"");
+
+    let stream = "//! doc".parse::<TokenStream>().unwrap();
+    let lit = lit_of_inner_doc_comment(&stream);
+    assert_eq!(lit.to_string(), "\" doc\"");
+
+    let stream = "/** doc */".parse::<TokenStream>().unwrap();
+    let lit = lit_of_outer_doc_comment(&stream);
+    assert_eq!(lit.to_string(), "\" doc \"");
+
+    let stream = "/*! doc */".parse::<TokenStream>().unwrap();
+    let lit = lit_of_inner_doc_comment(&stream);
+    assert_eq!(lit.to_string(), "\" doc \"");
+}
+
+#[test]
+fn carriage_return() {
+    let stream = "///\r\n".parse::<TokenStream>().unwrap();
+    let lit = lit_of_outer_doc_comment(&stream);
+    assert_eq!(lit.to_string(), "\"\"");
+
+    let stream = "/**\r\n*/".parse::<TokenStream>().unwrap();
+    let lit = lit_of_outer_doc_comment(&stream);
+    assert_eq!(lit.to_string(), "\"\\r\\n\"");
+
+    "///\r".parse::<TokenStream>().unwrap_err();
+    "///\r \n".parse::<TokenStream>().unwrap_err();
+    "/**\r \n*/".parse::<TokenStream>().unwrap_err();
+}
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/tests/features.rs 43.0.0-1ubuntu1/rust-vendor/proc-macro2/tests/features.rs
--- 43.0.0-1/rust-vendor/proc-macro2/tests/features.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/tests/features.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,8 @@
+#[test]
+#[ignore]
+fn make_sure_no_proc_macro() {
+    assert!(
+        !cfg!(feature = "proc-macro"),
+        "still compiled with proc_macro?"
+    );
+}
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/tests/marker.rs 43.0.0-1ubuntu1/rust-vendor/proc-macro2/tests/marker.rs
--- 43.0.0-1/rust-vendor/proc-macro2/tests/marker.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/tests/marker.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,100 @@
+#![allow(clippy::extra_unused_type_parameters)]
+
+use proc_macro2::{
+    Delimiter, Group, Ident, LexError, Literal, Punct, Spacing, Span, TokenStream, TokenTree,
+};
+
+macro_rules! assert_impl {
+    ($ty:ident is $($marker:ident) and +) => {
+        #[test]
+        #[allow(non_snake_case)]
+        fn $ty() {
+            fn assert_implemented<T: $($marker +)+>() {}
+            assert_implemented::<$ty>();
+        }
+    };
+
+    ($ty:ident is not $($marker:ident) or +) => {
+        #[test]
+        #[allow(non_snake_case)]
+        fn $ty() {
+            $(
+                {
+                    // Implemented for types that implement $marker.
+                    #[allow(dead_code)]
+                    trait IsNotImplemented {
+                        fn assert_not_implemented() {}
+                    }
+                    impl<T: $marker> IsNotImplemented for T {}
+
+                    // Implemented for the type being tested.
+                    trait IsImplemented {
+                        fn assert_not_implemented() {}
+                    }
+                    impl IsImplemented for $ty {}
+
+                    // If $ty does not implement $marker, there is no ambiguity
+                    // in the following trait method call.
+                    <$ty>::assert_not_implemented();
+                }
+            )+
+        }
+    };
+}
+
+assert_impl!(Delimiter is Send and Sync);
+assert_impl!(Spacing is Send and Sync);
+
+assert_impl!(Group is not Send or Sync);
+assert_impl!(Ident is not Send or Sync);
+assert_impl!(LexError is not Send or Sync);
+assert_impl!(Literal is not Send or Sync);
+assert_impl!(Punct is not Send or Sync);
+assert_impl!(Span is not Send or Sync);
+assert_impl!(TokenStream is not Send or Sync);
+assert_impl!(TokenTree is not Send or Sync);
+
+#[cfg(procmacro2_semver_exempt)]
+mod semver_exempt {
+    use proc_macro2::{LineColumn, SourceFile};
+
+    assert_impl!(LineColumn is Send and Sync);
+
+    assert_impl!(SourceFile is not Send or Sync);
+}
+
+mod unwind_safe {
+    use proc_macro2::{
+        Delimiter, Group, Ident, LexError, Literal, Punct, Spacing, Span, TokenStream, TokenTree,
+    };
+    #[cfg(procmacro2_semver_exempt)]
+    use proc_macro2::{LineColumn, SourceFile};
+    use std::panic::{RefUnwindSafe, UnwindSafe};
+
+    macro_rules! assert_unwind_safe {
+        ($($types:ident)*) => {
+            $(
+                assert_impl!($types is UnwindSafe and RefUnwindSafe);
+            )*
+        };
+    }
+
+    assert_unwind_safe! {
+        Delimiter
+        Group
+        Ident
+        LexError
+        Literal
+        Punct
+        Spacing
+        Span
+        TokenStream
+        TokenTree
+    }
+
+    #[cfg(procmacro2_semver_exempt)]
+    assert_unwind_safe! {
+        LineColumn
+        SourceFile
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/tests/test.rs 43.0.0-1ubuntu1/rust-vendor/proc-macro2/tests/test.rs
--- 43.0.0-1/rust-vendor/proc-macro2/tests/test.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/tests/test.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,905 @@
+#![allow(
+    clippy::assertions_on_result_states,
+    clippy::items_after_statements,
+    clippy::needless_pass_by_value,
+    clippy::needless_raw_string_hashes,
+    clippy::non_ascii_literal,
+    clippy::octal_escapes
+)]
+
+use proc_macro2::{Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree};
+use std::ffi::CStr;
+use std::iter;
+use std::str::{self, FromStr};
+
+#[test]
+fn idents() {
+    assert_eq!(
+        Ident::new("String", Span::call_site()).to_string(),
+        "String"
+    );
+    assert_eq!(Ident::new("fn", Span::call_site()).to_string(), "fn");
+    assert_eq!(Ident::new("_", Span::call_site()).to_string(), "_");
+}
+
+#[test]
+fn raw_idents() {
+    assert_eq!(
+        Ident::new_raw("String", Span::call_site()).to_string(),
+        "r#String"
+    );
+    assert_eq!(Ident::new_raw("fn", Span::call_site()).to_string(), "r#fn");
+}
+
+#[test]
+#[should_panic(expected = "`r#_` cannot be a raw identifier")]
+fn ident_raw_underscore() {
+    Ident::new_raw("_", Span::call_site());
+}
+
+#[test]
+#[should_panic(expected = "`r#super` cannot be a raw identifier")]
+fn ident_raw_reserved() {
+    Ident::new_raw("super", Span::call_site());
+}
+
+#[test]
+#[should_panic(expected = "Ident is not allowed to be empty; use Option<Ident>")]
+fn ident_empty() {
+    Ident::new("", Span::call_site());
+}
+
+#[test]
+#[should_panic(expected = "Ident cannot be a number; use Literal instead")]
+fn ident_number() {
+    Ident::new("255", Span::call_site());
+}
+
+#[test]
+#[should_panic(expected = "\"a#\" is not a valid Ident")]
+fn ident_invalid() {
+    Ident::new("a#", Span::call_site());
+}
+
+#[test]
+#[should_panic(expected = "not a valid Ident")]
+fn raw_ident_empty() {
+    Ident::new("r#", Span::call_site());
+}
+
+#[test]
+#[should_panic(expected = "not a valid Ident")]
+fn raw_ident_number() {
+    Ident::new("r#255", Span::call_site());
+}
+
+#[test]
+#[should_panic(expected = "\"r#a#\" is not a valid Ident")]
+fn raw_ident_invalid() {
+    Ident::new("r#a#", Span::call_site());
+}
+
+#[test]
+#[should_panic(expected = "not a valid Ident")]
+fn lifetime_empty() {
+    Ident::new("'", Span::call_site());
+}
+
+#[test]
+#[should_panic(expected = "not a valid Ident")]
+fn lifetime_number() {
+    Ident::new("'255", Span::call_site());
+}
+
+#[test]
+#[should_panic(expected = r#""'a#" is not a valid Ident"#)]
+fn lifetime_invalid() {
+    Ident::new("'a#", Span::call_site());
+}
+
+#[test]
+fn literal_string() {
+    #[track_caller]
+    fn assert(literal: Literal, expected: &str) {
+        assert_eq!(literal.to_string(), expected.trim());
+    }
+
+    assert(Literal::string(""), r#"  ""  "#);
+    assert(Literal::string("aA"), r#"  "aA"  "#);
+    assert(Literal::string("\t"), r#"  "\t"  "#);
+    assert(Literal::string("❤"), r#"  "❤"  "#);
+    assert(Literal::string("'"), r#"  "'"  "#);
+    assert(Literal::string("\""), r#"  "\""  "#);
+    assert(Literal::string("\0"), r#"  "\0"  "#);
+    assert(Literal::string("\u{1}"), r#"  "\u{1}"  "#);
+    assert(
+        Literal::string("a\00b\07c\08d\0e\0"),
+        r#"  "a\x000b\x007c\08d\0e\0"  "#,
+    );
+
+    "\"\\\r\n    x\"".parse::<TokenStream>().unwrap();
+    "\"\\\r\n  \rx\"".parse::<TokenStream>().unwrap_err();
+}
+
+#[test]
+fn literal_raw_string() {
+    "r\"\r\n\"".parse::<TokenStream>().unwrap();
+
+    fn raw_string_literal_with_hashes(n: usize) -> String {
+        let mut literal = String::new();
+        literal.push('r');
+        literal.extend(iter::repeat('#').take(n));
+        literal.push('"');
+        literal.push('"');
+        literal.extend(iter::repeat('#').take(n));
+        literal
+    }
+
+    raw_string_literal_with_hashes(255)
+        .parse::<TokenStream>()
+        .unwrap();
+
+    // https://github.com/rust-lang/rust/pull/95251
+    raw_string_literal_with_hashes(256)
+        .parse::<TokenStream>()
+        .unwrap_err();
+}
+
+#[test]
+fn literal_byte_character() {
+    #[track_caller]
+    fn assert(literal: Literal, expected: &str) {
+        assert_eq!(literal.to_string(), expected.trim());
+    }
+
+    assert(Literal::byte_character(b'a'), r#"  b'a'  "#);
+    assert(Literal::byte_character(b'\0'), r#"  b'\0'  "#);
+    assert(Literal::byte_character(b'\t'), r#"  b'\t'  "#);
+    assert(Literal::byte_character(b'\n'), r#"  b'\n'  "#);
+    assert(Literal::byte_character(b'\r'), r#"  b'\r'  "#);
+    assert(Literal::byte_character(b'\''), r#"  b'\''  "#);
+    assert(Literal::byte_character(b'\\'), r#"  b'\\'  "#);
+    assert(Literal::byte_character(b'\x1f'), r#"  b'\x1F'  "#);
+    assert(Literal::byte_character(b'"'), r#"  b'"'  "#);
+}
+
+#[test]
+fn literal_byte_string() {
+    #[track_caller]
+    fn assert(literal: Literal, expected: &str) {
+        assert_eq!(literal.to_string(), expected.trim());
+    }
+
+    assert(Literal::byte_string(b""), r#"  b""  "#);
+    assert(Literal::byte_string(b"\0"), r#"  b"\0"  "#);
+    assert(Literal::byte_string(b"\t"), r#"  b"\t"  "#);
+    assert(Literal::byte_string(b"\n"), r#"  b"\n"  "#);
+    assert(Literal::byte_string(b"\r"), r#"  b"\r"  "#);
+    assert(Literal::byte_string(b"\""), r#"  b"\""  "#);
+    assert(Literal::byte_string(b"\\"), r#"  b"\\"  "#);
+    assert(Literal::byte_string(b"\x1f"), r#"  b"\x1F"  "#);
+    assert(Literal::byte_string(b"'"), r#"  b"'"  "#);
+    assert(
+        Literal::byte_string(b"a\00b\07c\08d\0e\0"),
+        r#"  b"a\x000b\x007c\08d\0e\0"  "#,
+    );
+
+    "b\"\\\r\n    x\"".parse::<TokenStream>().unwrap();
+    "b\"\\\r\n  \rx\"".parse::<TokenStream>().unwrap_err();
+    "b\"\\\r\n  \u{a0}x\"".parse::<TokenStream>().unwrap_err();
+    "br\"\u{a0}\"".parse::<TokenStream>().unwrap_err();
+}
+
+#[test]
+fn literal_c_string() {
+    #[track_caller]
+    fn assert(literal: Literal, expected: &str) {
+        assert_eq!(literal.to_string(), expected.trim());
+    }
+
+    assert(Literal::c_string(<&CStr>::default()), r#"  c""  "#);
+    assert(
+        Literal::c_string(CStr::from_bytes_with_nul(b"aA\0").unwrap()),
+        r#"  c"aA"  "#,
+    );
+    assert(
+        Literal::c_string(CStr::from_bytes_with_nul(b"aA\0").unwrap()),
+        r#"  c"aA"  "#,
+    );
+    assert(
+        Literal::c_string(CStr::from_bytes_with_nul(b"\t\0").unwrap()),
+        r#"  c"\t"  "#,
+    );
+    assert(
+        Literal::c_string(CStr::from_bytes_with_nul(b"\xE2\x9D\xA4\0").unwrap()),
+        r#"  c"❤"  "#,
+    );
+    assert(
+        Literal::c_string(CStr::from_bytes_with_nul(b"'\0").unwrap()),
+        r#"  c"'"  "#,
+    );
+    assert(
+        Literal::c_string(CStr::from_bytes_with_nul(b"\"\0").unwrap()),
+        r#"  c"\""  "#,
+    );
+    assert(
+        Literal::c_string(CStr::from_bytes_with_nul(b"\x7F\xFF\xFE\xCC\xB3\0").unwrap()),
+        r#"  c"\u{7f}\xFF\xFE\u{333}"  "#,
+    );
+
+    let strings = r###"
+        c"hello\x80我叫\u{1F980}"  // from the RFC
+        cr"\"
+        cr##"Hello "world"!"##
+        c"\t\n\r\"\\"
+    "###;
+
+    let mut tokens = strings.parse::<TokenStream>().unwrap().into_iter();
+
+    for expected in &[
+        r#"c"hello\x80我叫\u{1F980}""#,
+        r#"cr"\""#,
+        r###"cr##"Hello "world"!"##"###,
+        r#"c"\t\n\r\"\\""#,
+    ] {
+        match tokens.next().unwrap() {
+            TokenTree::Literal(literal) => {
+                assert_eq!(literal.to_string(), *expected);
+            }
+            unexpected => panic!("unexpected token: {:?}", unexpected),
+        }
+    }
+
+    if let Some(unexpected) = tokens.next() {
+        panic!("unexpected token: {:?}", unexpected);
+    }
+
+    for invalid in &[r#"c"\0""#, r#"c"\x00""#, r#"c"\u{0}""#, "c\"\0\""] {
+        if let Ok(unexpected) = invalid.parse::<TokenStream>() {
+            panic!("unexpected token: {:?}", unexpected);
+        }
+    }
+}
+
+#[test]
+fn literal_character() {
+    #[track_caller]
+    fn assert(literal: Literal, expected: &str) {
+        assert_eq!(literal.to_string(), expected.trim());
+    }
+
+    assert(Literal::character('a'), r#"  'a'  "#);
+    assert(Literal::character('\t'), r#"  '\t'  "#);
+    assert(Literal::character('❤'), r#"  '❤'  "#);
+    assert(Literal::character('\''), r#"  '\''  "#);
+    assert(Literal::character('"'), r#"  '"'  "#);
+    assert(Literal::character('\0'), r#"  '\0'  "#);
+    assert(Literal::character('\u{1}'), r#"  '\u{1}'  "#);
+}
+
+#[test]
+fn literal_integer() {
+    #[track_caller]
+    fn assert(literal: Literal, expected: &str) {
+        assert_eq!(literal.to_string(), expected);
+    }
+
+    assert(Literal::u8_suffixed(10), "10u8");
+    assert(Literal::u16_suffixed(10), "10u16");
+    assert(Literal::u32_suffixed(10), "10u32");
+    assert(Literal::u64_suffixed(10), "10u64");
+    assert(Literal::u128_suffixed(10), "10u128");
+    assert(Literal::usize_suffixed(10), "10usize");
+
+    assert(Literal::i8_suffixed(10), "10i8");
+    assert(Literal::i16_suffixed(10), "10i16");
+    assert(Literal::i32_suffixed(10), "10i32");
+    assert(Literal::i64_suffixed(10), "10i64");
+    assert(Literal::i128_suffixed(10), "10i128");
+    assert(Literal::isize_suffixed(10), "10isize");
+
+    assert(Literal::u8_unsuffixed(10), "10");
+    assert(Literal::u16_unsuffixed(10), "10");
+    assert(Literal::u32_unsuffixed(10), "10");
+    assert(Literal::u64_unsuffixed(10), "10");
+    assert(Literal::u128_unsuffixed(10), "10");
+    assert(Literal::usize_unsuffixed(10), "10");
+
+    assert(Literal::i8_unsuffixed(10), "10");
+    assert(Literal::i16_unsuffixed(10), "10");
+    assert(Literal::i32_unsuffixed(10), "10");
+    assert(Literal::i64_unsuffixed(10), "10");
+    assert(Literal::i128_unsuffixed(10), "10");
+    assert(Literal::isize_unsuffixed(10), "10");
+
+    assert(Literal::i32_suffixed(-10), "-10i32");
+    assert(Literal::i32_unsuffixed(-10), "-10");
+}
+
+#[test]
+fn literal_float() {
+    #[track_caller]
+    fn assert(literal: Literal, expected: &str) {
+        assert_eq!(literal.to_string(), expected);
+    }
+
+    assert(Literal::f32_suffixed(10.0), "10f32");
+    assert(Literal::f32_suffixed(-10.0), "-10f32");
+    assert(Literal::f64_suffixed(10.0), "10f64");
+    assert(Literal::f64_suffixed(-10.0), "-10f64");
+
+    assert(Literal::f32_unsuffixed(10.0), "10.0");
+    assert(Literal::f32_unsuffixed(-10.0), "-10.0");
+    assert(Literal::f64_unsuffixed(10.0), "10.0");
+    assert(Literal::f64_unsuffixed(-10.0), "-10.0");
+
+    assert(
+        Literal::f64_unsuffixed(1e100),
+        "10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0",
+    );
+}
+
+#[test]
+fn literal_suffix() {
+    fn token_count(p: &str) -> usize {
+        p.parse::<TokenStream>().unwrap().into_iter().count()
+    }
+
+    assert_eq!(token_count("999u256"), 1);
+    assert_eq!(token_count("999r#u256"), 3);
+    assert_eq!(token_count("1."), 1);
+    assert_eq!(token_count("1.f32"), 3);
+    assert_eq!(token_count("1.0_0"), 1);
+    assert_eq!(token_count("1._0"), 3);
+    assert_eq!(token_count("1._m"), 3);
+    assert_eq!(token_count("\"\"s"), 1);
+    assert_eq!(token_count("r\"\"r"), 1);
+    assert_eq!(token_count("r#\"\"#r"), 1);
+    assert_eq!(token_count("b\"\"b"), 1);
+    assert_eq!(token_count("br\"\"br"), 1);
+    assert_eq!(token_count("br#\"\"#br"), 1);
+    assert_eq!(token_count("c\"\"c"), 1);
+    assert_eq!(token_count("cr\"\"cr"), 1);
+    assert_eq!(token_count("cr#\"\"#cr"), 1);
+    assert_eq!(token_count("'c'c"), 1);
+    assert_eq!(token_count("b'b'b"), 1);
+    assert_eq!(token_count("0E"), 1);
+    assert_eq!(token_count("0o0A"), 1);
+    assert_eq!(token_count("0E--0"), 4);
+    assert_eq!(token_count("0.0ECMA"), 1);
+}
+
+#[test]
+fn literal_iter_negative() {
+    let negative_literal = Literal::i32_suffixed(-3);
+    let tokens = TokenStream::from(TokenTree::Literal(negative_literal));
+    let mut iter = tokens.into_iter();
+    match iter.next().unwrap() {
+        TokenTree::Punct(punct) => {
+            assert_eq!(punct.as_char(), '-');
+            assert_eq!(punct.spacing(), Spacing::Alone);
+        }
+        unexpected => panic!("unexpected token {:?}", unexpected),
+    }
+    match iter.next().unwrap() {
+        TokenTree::Literal(literal) => {
+            assert_eq!(literal.to_string(), "3i32");
+        }
+        unexpected => panic!("unexpected token {:?}", unexpected),
+    }
+    assert!(iter.next().is_none());
+}
+
+#[test]
+fn literal_parse() {
+    assert!("1".parse::<Literal>().is_ok());
+    assert!("-1".parse::<Literal>().is_ok());
+    assert!("-1u12".parse::<Literal>().is_ok());
+    assert!("1.0".parse::<Literal>().is_ok());
+    assert!("-1.0".parse::<Literal>().is_ok());
+    assert!("-1.0f12".parse::<Literal>().is_ok());
+    assert!("'a'".parse::<Literal>().is_ok());
+    assert!("\"\n\"".parse::<Literal>().is_ok());
+    assert!("0 1".parse::<Literal>().is_err());
+    assert!(" 0".parse::<Literal>().is_err());
+    assert!("0 ".parse::<Literal>().is_err());
+    assert!("/* comment */0".parse::<Literal>().is_err());
+    assert!("0/* comment */".parse::<Literal>().is_err());
+    assert!("0// comment".parse::<Literal>().is_err());
+    assert!("- 1".parse::<Literal>().is_err());
+    assert!("- 1.0".parse::<Literal>().is_err());
+    assert!("-\"\"".parse::<Literal>().is_err());
+}
+
+#[test]
+fn literal_span() {
+    let positive = "0.1".parse::<Literal>().unwrap();
+    let negative = "-0.1".parse::<Literal>().unwrap();
+    let subspan = positive.subspan(1..2);
+
+    #[cfg(not(span_locations))]
+    {
+        let _ = negative;
+        assert!(subspan.is_none());
+    }
+
+    #[cfg(span_locations)]
+    {
+        assert_eq!(positive.span().start().column, 0);
+        assert_eq!(positive.span().end().column, 3);
+        assert_eq!(negative.span().start().column, 0);
+        assert_eq!(negative.span().end().column, 4);
+        assert_eq!(subspan.unwrap().source_text().unwrap(), ".");
+    }
+
+    assert!(positive.subspan(1..4).is_none());
+}
+
+#[cfg(span_locations)]
+#[test]
+fn source_text() {
+    let input = "    𓀕 a z    ";
+    let mut tokens = input
+        .parse::<proc_macro2::TokenStream>()
+        .unwrap()
+        .into_iter();
+
+    let first = tokens.next().unwrap();
+    assert_eq!("𓀕", first.span().source_text().unwrap());
+
+    let second = tokens.next().unwrap();
+    let third = tokens.next().unwrap();
+    assert_eq!("z", third.span().source_text().unwrap());
+    assert_eq!("a", second.span().source_text().unwrap());
+}
+
+#[test]
+fn roundtrip() {
+    fn roundtrip(p: &str) {
+        println!("parse: {}", p);
+        let s = p.parse::<TokenStream>().unwrap().to_string();
+        println!("first: {}", s);
+        let s2 = s.parse::<TokenStream>().unwrap().to_string();
+        assert_eq!(s, s2);
+    }
+    roundtrip("a");
+    roundtrip("<<");
+    roundtrip("<<=");
+    roundtrip(
+        "
+        1
+        1.0
+        1f32
+        2f64
+        1usize
+        4isize
+        4e10
+        1_000
+        1_0i32
+        8u8
+        9
+        0
+        0xffffffffffffffffffffffffffffffff
+        1x
+        1u80
+        1f320
+    ",
+    );
+    roundtrip("'a");
+    roundtrip("'_");
+    roundtrip("'static");
+    roundtrip(r"'\u{10__FFFF}'");
+    roundtrip("\"\\u{10_F0FF__}foo\\u{1_0_0_0__}\"");
+}
+
+#[test]
+fn fail() {
+    fn fail(p: &str) {
+        if let Ok(s) = p.parse::<TokenStream>() {
+            panic!("should have failed to parse: {}\n{:#?}", p, s);
+        }
+    }
+    fail("' static");
+    fail("r#1");
+    fail("r#_");
+    fail("\"\\u{0000000}\""); // overlong unicode escape (rust allows at most 6 hex digits)
+    fail("\"\\u{999999}\""); // outside of valid range of char
+    fail("\"\\u{_0}\""); // leading underscore
+    fail("\"\\u{}\""); // empty
+    fail("b\"\r\""); // bare carriage return in byte string
+    fail("r\"\r\""); // bare carriage return in raw string
+    fail("\"\\\r  \""); // backslash carriage return
+    fail("'aa'aa");
+    fail("br##\"\"#");
+    fail("cr##\"\"#");
+    fail("\"\\\n\u{85}\r\"");
+}
+
+#[cfg(span_locations)]
+#[test]
+fn span_test() {
+    check_spans(
+        "\
+/// This is a document comment
+testing 123
+{
+  testing 234
+}",
+        &[
+            (1, 0, 1, 30),  // #
+            (1, 0, 1, 30),  // [ ... ]
+            (1, 0, 1, 30),  // doc
+            (1, 0, 1, 30),  // =
+            (1, 0, 1, 30),  // "This is..."
+            (2, 0, 2, 7),   // testing
+            (2, 8, 2, 11),  // 123
+            (3, 0, 5, 1),   // { ... }
+            (4, 2, 4, 9),   // testing
+            (4, 10, 4, 13), // 234
+        ],
+    );
+}
+
+#[cfg(procmacro2_semver_exempt)]
+#[test]
+fn default_span() {
+    let start = Span::call_site().start();
+    assert_eq!(start.line, 1);
+    assert_eq!(start.column, 0);
+    let end = Span::call_site().end();
+    assert_eq!(end.line, 1);
+    assert_eq!(end.column, 0);
+    let source_file = Span::call_site().source_file();
+    assert_eq!(source_file.path().to_string_lossy(), "<unspecified>");
+    assert!(!source_file.is_real());
+}
+
+#[cfg(procmacro2_semver_exempt)]
+#[test]
+fn span_join() {
+    let source1 = "aaa\nbbb"
+        .parse::<TokenStream>()
+        .unwrap()
+        .into_iter()
+        .collect::<Vec<_>>();
+    let source2 = "ccc\nddd"
+        .parse::<TokenStream>()
+        .unwrap()
+        .into_iter()
+        .collect::<Vec<_>>();
+
+    assert!(source1[0].span().source_file() != source2[0].span().source_file());
+    assert_eq!(
+        source1[0].span().source_file(),
+        source1[1].span().source_file()
+    );
+
+    let joined1 = source1[0].span().join(source1[1].span());
+    let joined2 = source1[0].span().join(source2[0].span());
+    assert!(joined1.is_some());
+    assert!(joined2.is_none());
+
+    let start = joined1.unwrap().start();
+    let end = joined1.unwrap().end();
+    assert_eq!(start.line, 1);
+    assert_eq!(start.column, 0);
+    assert_eq!(end.line, 2);
+    assert_eq!(end.column, 3);
+
+    assert_eq!(
+        joined1.unwrap().source_file(),
+        source1[0].span().source_file()
+    );
+}
+
+#[test]
+fn no_panic() {
+    let s = str::from_utf8(b"b\'\xc2\x86  \x00\x00\x00^\"").unwrap();
+    assert!(s.parse::<TokenStream>().is_err());
+}
+
+#[test]
+fn punct_before_comment() {
+    let mut tts = TokenStream::from_str("~// comment").unwrap().into_iter();
+    match tts.next().unwrap() {
+        TokenTree::Punct(tt) => {
+            assert_eq!(tt.as_char(), '~');
+            assert_eq!(tt.spacing(), Spacing::Alone);
+        }
+        wrong => panic!("wrong token {:?}", wrong),
+    }
+}
+
+#[test]
+fn joint_last_token() {
+    // This test verifies that we match the behavior of libproc_macro *not* in
+    // the range nightly-2020-09-06 through nightly-2020-09-10, in which this
+    // behavior was temporarily broken.
+    // See https://github.com/rust-lang/rust/issues/76399
+
+    let joint_punct = Punct::new(':', Spacing::Joint);
+    let stream = TokenStream::from(TokenTree::Punct(joint_punct));
+    let punct = match stream.into_iter().next().unwrap() {
+        TokenTree::Punct(punct) => punct,
+        _ => unreachable!(),
+    };
+    assert_eq!(punct.spacing(), Spacing::Joint);
+}
+
+#[test]
+fn raw_identifier() {
+    let mut tts = TokenStream::from_str("r#dyn").unwrap().into_iter();
+    match tts.next().unwrap() {
+        TokenTree::Ident(raw) => assert_eq!("r#dyn", raw.to_string()),
+        wrong => panic!("wrong token {:?}", wrong),
+    }
+    assert!(tts.next().is_none());
+}
+
+#[test]
+fn test_debug_ident() {
+    let ident = Ident::new("proc_macro", Span::call_site());
+
+    #[cfg(not(span_locations))]
+    let expected = "Ident(proc_macro)";
+
+    #[cfg(span_locations)]
+    let expected = "Ident { sym: proc_macro }";
+
+    assert_eq!(expected, format!("{:?}", ident));
+}
+
+#[test]
+fn test_debug_tokenstream() {
+    let tts = TokenStream::from_str("[a + 1]").unwrap();
+
+    #[cfg(not(span_locations))]
+    let expected = "\
+TokenStream [
+    Group {
+        delimiter: Bracket,
+        stream: TokenStream [
+            Ident {
+                sym: a,
+            },
+            Punct {
+                char: '+',
+                spacing: Alone,
+            },
+            Literal {
+                lit: 1,
+            },
+        ],
+    },
+]\
+    ";
+
+    #[cfg(not(span_locations))]
+    let expected_before_trailing_commas = "\
+TokenStream [
+    Group {
+        delimiter: Bracket,
+        stream: TokenStream [
+            Ident {
+                sym: a
+            },
+            Punct {
+                char: '+',
+                spacing: Alone
+            },
+            Literal {
+                lit: 1
+            }
+        ]
+    }
+]\
+    ";
+
+    #[cfg(span_locations)]
+    let expected = "\
+TokenStream [
+    Group {
+        delimiter: Bracket,
+        stream: TokenStream [
+            Ident {
+                sym: a,
+                span: bytes(2..3),
+            },
+            Punct {
+                char: '+',
+                spacing: Alone,
+                span: bytes(4..5),
+            },
+            Literal {
+                lit: 1,
+                span: bytes(6..7),
+            },
+        ],
+        span: bytes(1..8),
+    },
+]\
+    ";
+
+    #[cfg(span_locations)]
+    let expected_before_trailing_commas = "\
+TokenStream [
+    Group {
+        delimiter: Bracket,
+        stream: TokenStream [
+            Ident {
+                sym: a,
+                span: bytes(2..3)
+            },
+            Punct {
+                char: '+',
+                spacing: Alone,
+                span: bytes(4..5)
+            },
+            Literal {
+                lit: 1,
+                span: bytes(6..7)
+            }
+        ],
+        span: bytes(1..8)
+    }
+]\
+    ";
+
+    let actual = format!("{:#?}", tts);
+    if actual.ends_with(",\n]") {
+        assert_eq!(expected, actual);
+    } else {
+        assert_eq!(expected_before_trailing_commas, actual);
+    }
+}
+
+#[test]
+fn default_tokenstream_is_empty() {
+    let default_token_stream = <TokenStream as Default>::default();
+
+    assert!(default_token_stream.is_empty());
+}
+
+#[test]
+fn tokenstream_size_hint() {
+    let tokens = "a b (c d) e".parse::<TokenStream>().unwrap();
+
+    assert_eq!(tokens.into_iter().size_hint(), (4, Some(4)));
+}
+
+#[test]
+fn tuple_indexing() {
+    // This behavior may change depending on https://github.com/rust-lang/rust/pull/71322
+    let mut tokens = "tuple.0.0".parse::<TokenStream>().unwrap().into_iter();
+    assert_eq!("tuple", tokens.next().unwrap().to_string());
+    assert_eq!(".", tokens.next().unwrap().to_string());
+    assert_eq!("0.0", tokens.next().unwrap().to_string());
+    assert!(tokens.next().is_none());
+}
+
+#[cfg(span_locations)]
+#[test]
+fn non_ascii_tokens() {
+    check_spans("// abc", &[]);
+    check_spans("// ábc", &[]);
+    check_spans("// abc x", &[]);
+    check_spans("// ábc x", &[]);
+    check_spans("/* abc */ x", &[(1, 10, 1, 11)]);
+    check_spans("/* ábc */ x", &[(1, 10, 1, 11)]);
+    check_spans("/* ab\nc */ x", &[(2, 5, 2, 6)]);
+    check_spans("/* áb\nc */ x", &[(2, 5, 2, 6)]);
+    check_spans("/*** abc */ x", &[(1, 12, 1, 13)]);
+    check_spans("/*** ábc */ x", &[(1, 12, 1, 13)]);
+    check_spans(r#""abc""#, &[(1, 0, 1, 5)]);
+    check_spans(r#""ábc""#, &[(1, 0, 1, 5)]);
+    check_spans(r##"r#"abc"#"##, &[(1, 0, 1, 8)]);
+    check_spans(r##"r#"ábc"#"##, &[(1, 0, 1, 8)]);
+    check_spans("r#\"a\nc\"#", &[(1, 0, 2, 3)]);
+    check_spans("r#\"á\nc\"#", &[(1, 0, 2, 3)]);
+    check_spans("'a'", &[(1, 0, 1, 3)]);
+    check_spans("'á'", &[(1, 0, 1, 3)]);
+    check_spans("//! abc", &[(1, 0, 1, 7), (1, 0, 1, 7), (1, 0, 1, 7)]);
+    check_spans("//! ábc", &[(1, 0, 1, 7), (1, 0, 1, 7), (1, 0, 1, 7)]);
+    check_spans("//! abc\n", &[(1, 0, 1, 7), (1, 0, 1, 7), (1, 0, 1, 7)]);
+    check_spans("//! ábc\n", &[(1, 0, 1, 7), (1, 0, 1, 7), (1, 0, 1, 7)]);
+    check_spans("/*! abc */", &[(1, 0, 1, 10), (1, 0, 1, 10), (1, 0, 1, 10)]);
+    check_spans("/*! ábc */", &[(1, 0, 1, 10), (1, 0, 1, 10), (1, 0, 1, 10)]);
+    check_spans("/*! a\nc */", &[(1, 0, 2, 4), (1, 0, 2, 4), (1, 0, 2, 4)]);
+    check_spans("/*! á\nc */", &[(1, 0, 2, 4), (1, 0, 2, 4), (1, 0, 2, 4)]);
+    check_spans("abc", &[(1, 0, 1, 3)]);
+    check_spans("ábc", &[(1, 0, 1, 3)]);
+    check_spans("ábć", &[(1, 0, 1, 3)]);
+    check_spans("abc// foo", &[(1, 0, 1, 3)]);
+    check_spans("ábc// foo", &[(1, 0, 1, 3)]);
+    check_spans("ábć// foo", &[(1, 0, 1, 3)]);
+    check_spans("b\"a\\\n c\"", &[(1, 0, 2, 3)]);
+}
+
+#[cfg(span_locations)]
+fn check_spans(p: &str, mut lines: &[(usize, usize, usize, usize)]) {
+    let ts = p.parse::<TokenStream>().unwrap();
+    check_spans_internal(ts, &mut lines);
+    assert!(lines.is_empty(), "leftover ranges: {:?}", lines);
+}
+
+#[cfg(span_locations)]
+fn check_spans_internal(ts: TokenStream, lines: &mut &[(usize, usize, usize, usize)]) {
+    for i in ts {
+        if let Some((&(sline, scol, eline, ecol), rest)) = lines.split_first() {
+            *lines = rest;
+
+            let start = i.span().start();
+            assert_eq!(start.line, sline, "sline did not match for {}", i);
+            assert_eq!(start.column, scol, "scol did not match for {}", i);
+
+            let end = i.span().end();
+            assert_eq!(end.line, eline, "eline did not match for {}", i);
+            assert_eq!(end.column, ecol, "ecol did not match for {}", i);
+
+            if let TokenTree::Group(g) = i {
+                check_spans_internal(g.stream().clone(), lines);
+            }
+        }
+    }
+}
+
+#[test]
+fn whitespace() {
+    // space, horizontal tab, vertical tab, form feed, carriage return, line
+    // feed, non-breaking space, left-to-right mark, right-to-left mark
+    let various_spaces = " \t\u{b}\u{c}\r\n\u{a0}\u{200e}\u{200f}";
+    let tokens = various_spaces.parse::<TokenStream>().unwrap();
+    assert_eq!(tokens.into_iter().count(), 0);
+
+    let lone_carriage_returns = " \r \r\r\n ";
+    lone_carriage_returns.parse::<TokenStream>().unwrap();
+}
+
+#[test]
+fn byte_order_mark() {
+    let string = "\u{feff}foo";
+    let tokens = string.parse::<TokenStream>().unwrap();
+    match tokens.into_iter().next().unwrap() {
+        TokenTree::Ident(ident) => assert_eq!(ident, "foo"),
+        _ => unreachable!(),
+    }
+
+    let string = "foo\u{feff}";
+    string.parse::<TokenStream>().unwrap_err();
+}
+
+#[cfg(span_locations)]
+fn create_span() -> proc_macro2::Span {
+    let tts: TokenStream = "1".parse().unwrap();
+    match tts.into_iter().next().unwrap() {
+        TokenTree::Literal(literal) => literal.span(),
+        _ => unreachable!(),
+    }
+}
+
+#[cfg(span_locations)]
+#[test]
+fn test_invalidate_current_thread_spans() {
+    let actual = format!("{:#?}", create_span());
+    assert_eq!(actual, "bytes(1..2)");
+    let actual = format!("{:#?}", create_span());
+    assert_eq!(actual, "bytes(3..4)");
+
+    proc_macro2::extra::invalidate_current_thread_spans();
+
+    let actual = format!("{:#?}", create_span());
+    // Test that span offsets have been reset after the call
+    // to invalidate_current_thread_spans()
+    assert_eq!(actual, "bytes(1..2)");
+}
+
+#[cfg(span_locations)]
+#[test]
+#[should_panic(expected = "Invalid span with no related FileInfo!")]
+fn test_use_span_after_invalidation() {
+    let span = create_span();
+
+    proc_macro2::extra::invalidate_current_thread_spans();
+
+    span.source_text();
+}
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/tests/test_fmt.rs 43.0.0-1ubuntu1/rust-vendor/proc-macro2/tests/test_fmt.rs
--- 43.0.0-1/rust-vendor/proc-macro2/tests/test_fmt.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/tests/test_fmt.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,28 @@
+#![allow(clippy::from_iter_instead_of_collect)]
+
+use proc_macro2::{Delimiter, Group, Ident, Span, TokenStream, TokenTree};
+use std::iter;
+
+#[test]
+fn test_fmt_group() {
+    let ident = Ident::new("x", Span::call_site());
+    let inner = TokenStream::from_iter(iter::once(TokenTree::Ident(ident)));
+    let parens_empty = Group::new(Delimiter::Parenthesis, TokenStream::new());
+    let parens_nonempty = Group::new(Delimiter::Parenthesis, inner.clone());
+    let brackets_empty = Group::new(Delimiter::Bracket, TokenStream::new());
+    let brackets_nonempty = Group::new(Delimiter::Bracket, inner.clone());
+    let braces_empty = Group::new(Delimiter::Brace, TokenStream::new());
+    let braces_nonempty = Group::new(Delimiter::Brace, inner.clone());
+    let none_empty = Group::new(Delimiter::None, TokenStream::new());
+    let none_nonempty = Group::new(Delimiter::None, inner);
+
+    // Matches libproc_macro.
+    assert_eq!("()", parens_empty.to_string());
+    assert_eq!("(x)", parens_nonempty.to_string());
+    assert_eq!("[]", brackets_empty.to_string());
+    assert_eq!("[x]", brackets_nonempty.to_string());
+    assert_eq!("{ }", braces_empty.to_string());
+    assert_eq!("{ x }", braces_nonempty.to_string());
+    assert_eq!("", none_empty.to_string());
+    assert_eq!("x", none_nonempty.to_string());
+}
diff -pruN 43.0.0-1/rust-vendor/proc-macro2/tests/test_size.rs 43.0.0-1ubuntu1/rust-vendor/proc-macro2/tests/test_size.rs
--- 43.0.0-1/rust-vendor/proc-macro2/tests/test_size.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/proc-macro2/tests/test_size.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,81 @@
+#![allow(unused_attributes)]
+
+extern crate proc_macro;
+
+use std::mem;
+
+#[rustversion::attr(before(1.64), ignore = "requires Rust 1.64+")]
+#[cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit")]
+#[cfg_attr(randomize_layout, ignore = "disabled due to randomized layout")]
+#[test]
+fn test_proc_macro_size() {
+    assert_eq!(mem::size_of::<proc_macro::Span>(), 4);
+    assert_eq!(mem::size_of::<Option<proc_macro::Span>>(), 4);
+    assert_eq!(mem::size_of::<proc_macro::Group>(), 20);
+    assert_eq!(mem::size_of::<proc_macro::Ident>(), 12);
+    assert_eq!(mem::size_of::<proc_macro::Punct>(), 8);
+    assert_eq!(mem::size_of::<proc_macro::Literal>(), 16);
+    assert_eq!(mem::size_of::<proc_macro::TokenStream>(), 4);
+}
+
+#[cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit")]
+#[cfg_attr(randomize_layout, ignore = "disabled due to randomized layout")]
+#[cfg_attr(wrap_proc_macro, ignore = "wrapper mode")]
+#[cfg_attr(span_locations, ignore = "span locations are on")]
+#[test]
+fn test_proc_macro2_fallback_size_without_locations() {
+    assert_eq!(mem::size_of::<proc_macro2::Span>(), 0);
+    assert_eq!(mem::size_of::<Option<proc_macro2::Span>>(), 1);
+    assert_eq!(mem::size_of::<proc_macro2::Group>(), 16);
+    assert_eq!(mem::size_of::<proc_macro2::Ident>(), 24);
+    assert_eq!(mem::size_of::<proc_macro2::Punct>(), 8);
+    assert_eq!(mem::size_of::<proc_macro2::Literal>(), 24);
+    assert_eq!(mem::size_of::<proc_macro2::TokenStream>(), 8);
+}
+
+#[cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit")]
+#[cfg_attr(randomize_layout, ignore = "disabled due to randomized layout")]
+#[cfg_attr(wrap_proc_macro, ignore = "wrapper mode")]
+#[cfg_attr(not(span_locations), ignore = "span locations are off")]
+#[test]
+fn test_proc_macro2_fallback_size_with_locations() {
+    assert_eq!(mem::size_of::<proc_macro2::Span>(), 8);
+    assert_eq!(mem::size_of::<Option<proc_macro2::Span>>(), 12);
+    assert_eq!(mem::size_of::<proc_macro2::Group>(), 24);
+    assert_eq!(mem::size_of::<proc_macro2::Ident>(), 32);
+    assert_eq!(mem::size_of::<proc_macro2::Punct>(), 16);
+    assert_eq!(mem::size_of::<proc_macro2::Literal>(), 32);
+    assert_eq!(mem::size_of::<proc_macro2::TokenStream>(), 8);
+}
+
+#[rustversion::attr(before(1.71), ignore = "requires Rust 1.71+")]
+#[cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit")]
+#[cfg_attr(randomize_layout, ignore = "disabled due to randomized layout")]
+#[cfg_attr(not(wrap_proc_macro), ignore = "fallback mode")]
+#[cfg_attr(span_locations, ignore = "span locations are on")]
+#[test]
+fn test_proc_macro2_wrapper_size_without_locations() {
+    assert_eq!(mem::size_of::<proc_macro2::Span>(), 4);
+    assert_eq!(mem::size_of::<Option<proc_macro2::Span>>(), 8);
+    assert_eq!(mem::size_of::<proc_macro2::Group>(), 24);
+    assert_eq!(mem::size_of::<proc_macro2::Ident>(), 24);
+    assert_eq!(mem::size_of::<proc_macro2::Punct>(), 12);
+    assert_eq!(mem::size_of::<proc_macro2::Literal>(), 24);
+    assert_eq!(mem::size_of::<proc_macro2::TokenStream>(), 32);
+}
+
+#[rustversion::attr(before(1.65), ignore = "requires Rust 1.65+")]
+#[cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit")]
+#[cfg_attr(randomize_layout, ignore = "disabled due to randomized layout")]
+#[cfg_attr(not(wrap_proc_macro), ignore = "fallback mode")]
+#[cfg_attr(not(span_locations), ignore = "span locations are off")]
+#[test]
+fn test_proc_macro2_wrapper_size_with_locations() {
+    assert_eq!(mem::size_of::<proc_macro2::Span>(), 12);
+    assert_eq!(mem::size_of::<Option<proc_macro2::Span>>(), 12);
+    assert_eq!(mem::size_of::<proc_macro2::Group>(), 32);
+    assert_eq!(mem::size_of::<proc_macro2::Ident>(), 32);
+    assert_eq!(mem::size_of::<proc_macro2::Punct>(), 20);
+    assert_eq!(mem::size_of::<proc_macro2::Literal>(), 32);
+    assert_eq!(mem::size_of::<proc_macro2::TokenStream>(), 32);
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/pyo3/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/pyo3/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"Architecture.md":"0abd87d6c513b75f912a6b4169bd6bf0bc1e6ada4cc2bfb956ce37d5accc96cb","CHANGELOG.md":"204fec01e8e2f4d347c00af0c507c3d53e3204ce94844a994ab2ed618deb38fb","CITATION.cff":"2d5aa5df590c4e47799ac644d15c56f9a3c5b2f3ef3b8e96946d372903ac7270","Cargo.toml":"6c60771082bc95cb0912b2a8261664e24232d35162abb7b04d85e62dc5c3bc33","Code-of-Conduct.md":"92d4a344e60e7310c654de92a26d84c99dafbfd4fab149a85d4e22f38232bafb","Contributing.md":"5ba6ee6ee7878b62f6be9af29c70ed8a015d40ca9f758807761443f3709717a8","LICENSE-APACHE":"71073d492e996de196dbe1eb1e4c94c27c014c841b288161265b2efd06d0af28","LICENSE-MIT":"afcbe3b2e6b37172b5a9ca869ee4c0b8cdc09316e5d4384864154482c33e5af6","README.md":"5be595dd9fa487b49b23791489f896a03dcb38578990ebed132705a15337c19c","Releasing.md":"3e2cf797f83cf58d2244b84788f182c5a9e31ca88e981a7ecb87671c2f32d944","assets/script.py":"e269075461009f6d5c937427d3d63c1fb99ba214828c1bffadc7142cbc12afdb","build.rs":"84d2d9002206ec617159fed3437365121bf690ccef1367b865142ba2f51169be","emscripten/Makefile":"2de779cfe5cf0787830ccef090f80621bdf876db7cc9df1e3881fdaa99a7157f","emscripten/emscripten_patches/0001-Add-_gxx_personality_v0-stub-to-library.js.patch":"66cf2245a7452739d4d4b4f3e3f0f1985cc55581121708ab8341890c33834339","emscripten/env.sh":"e868d55070251ba643846fb4b3671ee73c30abf495ecac187b5e414e399987b9","emscripten/pybuilddir.txt":"47865a6fa77ecfc7fff126c06bb04a95a0c996f04b628d6ece7e059b9f68731f","emscripten/runner.py":"4e37c58b4b652c11108bce045c61adc8de8650cf88ada5052750ac708a884f2d","guide/book.toml":"5e468284a6b476f1b88c5b5ecacc9fb4623061b6a03271d34ceff593601c947f","guide/pyclass-parameters.md":"e1883eb2d6763c33b5ca75f6c0248382eb84c2103b1f4f613719e1925e753199","guide/pyo3_version.py":"6d6d4a97615612038371bc68c37a4e4dce826196375ad5db0ef9a5e46cc066ce","guide/src/SUMMARY.md":"5e990c7f8aa86df5bc653bc57d5e26fc82a1a2bef49675cb6418c219e89403ce","guide/src/advanced.md":"df2f8bb4eec77b8950f3f1b9dd558807629c34f4a3c561a6d5c702073237bd72","guide/src/async-await.md":"d2eb746b3f19f736186659e58231a970b9de76941909b8ccecf377e5ae57a9db","guide/src/building-and-distribution.md":"993aad1d61ddb05eb6159543f1d2814b2655f7a8946b0d864e909f38d027b95b","guide/src/building-and-distribution/multiple-python-versions.md":"19532e9000f54eb34234ec511ffe18e77f42dc32f8ca47ae8d29d007570eaaa8","guide/src/changelog.md":"439803753b2afb2157fbcb7384c4465684736c0a42d63ef8f4a5bd8356dbfa69","guide/src/class.md":"414b1c169703011eebe8ffd4c76da23771bfcc9624c4420da5ad740ef87ab01e","guide/src/class/call.md":"c62fcc6ddaac949308ef4510cf225f27351296b932475de4f0a90819f19a4c77","guide/src/class/numeric.md":"70006461e9813677fa8c18166f965180dbb7a20b1c12ba0571c0042c76b67884","guide/src/class/object.md":"b7bfa610e2a06fa8cc00a9bf1a4e130dc598f1ad56d5b327ba975fb9e0b652d7","guide/src/class/protocols.md":"d040ce387e46ece60e14a2375399a19dccdc5542fb9154bb5f70b45bcdc2dbf1","guide/src/contributing.md":"655723bc7de5aa185b05be39400e87000595bcf268dd3066f7fc091be0a1aac0","guide/src/conversions.md":"50b4d3bf31d73542c837de8138007d5ac9198ae75ac9b8691270a3827906ba51","guide/src/conversions/tables.md":"ab6ee60871568acfa1ef72cbe0b40ae56b722c44b661b3934d0e7c812c9b514c","guide/src/conversions/traits.md":"543a8d44c275f46f7dfb0b691dd25238116c1f11a4409ebe1383e6234bf97063","guide/src/debugging.md":"d8aa76f919b1db028691f80c0d4d35535456bad3507205434363039d07fe12f9","guide/src/ecosystem.md":"d2a663465d9842f91bee793899dd5dd51e5431b5ced03d8bbb205c0eeaf5cc1c","guide/src/ecosystem/async-await.md":"02a6e41537118857132adc46d6dd8edc5a8b3e79b3cb058d19b16616786686a5","guide/src/ecosystem/logging.md":"214b58b37a44b232204f3f1c114afb81e1e792521c15d8788f121e35409e879d","guide/src/exception.md":"8375121094c997aa4ac53661eb9a386fc3194e629f982eba2250a40d7106f73e","guide/src/faq.md":"c41f03d93f90947bc508a323d812b36d6c37429b3e6de26a2f7acc5b17d3bd87","guide/src/features.md":"4b44436bff0b8fa9c6e6a49ad65603c30f71d50ed10113411d77f7fcd3914b1e","guide/src/function-calls.md":"7a7f84b340f532210f5293656682a5c8087542e50774ab07e1096b2d350a4484","guide/src/function.md":"20cf96648c40b6bfa983738ebe7d8083c2c912f0f4b78a21559f5053ff250637","guide/src/function/error-handling.md":"846645c88dc72b87cfe1e8444a1bb0bdfc7d70ace9faf9f7ae3bfb4483b1937b","guide/src/function/signature.md":"220cb2a2dbdb67cc8e2adcce7d9f4fad5e1d35d30cb7b5396980bfe9c18074dd","guide/src/getting-started.md":"8cf4647ab2754994d0dca502e0221a4f9378f5844267dda606c5e97f095e0083","guide/src/index.md":"bec16d0c01c379d11c4784bda7e2414285fc559cffa05fa0ed87fb18479d685c","guide/src/memory.md":"447edfc2604536632c66b146601414bcb9cff01da10a3226f411b78b9655ac1c","guide/src/migration.md":"c5857cab16794f1dab96dcea5c471e8c844289ba48dc9d58f74bb228339051ac","guide/src/module.md":"64a719898339bd0d89b3af7fe6cb2cd1a06b0cb6850c11fdd1942a110d501115","guide/src/parallelism.md":"e780318d08ed7ba61d9845f76e1257c926736d7173636d379ed4e98832f23f59","guide/src/performance.md":"95b976f2ea6b0e92fc55b7b8e03a5393ca50f26b9fcef5f580222abbc83422a2","guide/src/python-from-rust.md":"308be9b3fc1a3e0b1cb353c2062eeb49708009fbc6eaa3345652d93a518dc7bd","guide/src/python-from-rust/calling-existing-code.md":"aa3bb99288eb4c8b2e189add9baffb76d23bc3044a935c1df1d1e12d8aba8f5f","guide/src/python-from-rust/function-calls.md":"2fbbe420b41051f8e4e8f908ea677f548a17dbfd6f7b694cae7090142d4e5dcf","guide/src/python-typing-hints.md":"a95b12016cea6d10359c7459a6e11abd756c91e27e03a7f9c2a22e9d5716e7e0","guide/src/rust-from-python.md":"4ef16eb5c25780a92a994d9ddda4f27096b5929cc05ef71a60842eeee1754e2f","guide/src/trait-bounds.md":"86b4e4a7a99acfabd9b81913234f345cef396d612eefc6a06a271b5749c1a9e1","guide/src/types.md":"6d004bc4e9576d22aab3731b6c583ce4ff49a5cc5551dde74c59c2ee4acad16f","netlify.toml":"3a495930da6a0b47a86e48a5dda1aff32c5fc93cf29a60236909e0a264a63635","pyo3-runtime/LICENSE-APACHE":"71073d492e996de196dbe1eb1e4c94c27c014c841b288161265b2efd06d0af28","pyo3-runtime/LICENSE-MIT":"afcbe3b2e6b37172b5a9ca869ee4c0b8cdc09316e5d4384864154482c33e5af6","pyo3-runtime/README.md":"022371b6e623237264fb9654101bc33288f8842b5dfb9b4f5dca7215125268ba","pyo3-runtime/pyproject.toml":"a0854ec67ee05a09432e622d268235e9416d82743261046b5424d37bedf0a7eb","pyo3-runtime/src/pyo3_runtime/__init__.py":"b172e1ee0dca0b84021717191814e91b6b1c47b866981b0c8eae8ba91a6d9118","pyo3-runtime/tests/__init__.py":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","src/buffer.rs":"374c7fd5e72b3da758540388ba8e8de1a9e0bec4943393d64351a9d0a2992a99","src/callback.rs":"17b858ed8acead9321112265eab405fcece8788d3109875519cdbf59af750ca9","src/conversion.rs":"2ecb80a6daf821ee32025f2e54d3486c8ef4c3930c5b567a5ad877a87f97b390","src/conversions/anyhow.rs":"28e5d5a8acf2818e6e4b1956dcf2bf5b24cd36fe5012b57531944776f0c31ccb","src/conversions/chrono.rs":"81ca658b97c5e12f1c3aacf429d5525066454dc640dceece4b8cbfb9703689db","src/conversions/chrono_tz.rs":"38b4443d0d72b193c705329a9dc976ffc38b3cbd0267e4b6475f2055bb030bbb","src/conversions/either.rs":"4d6b9f36f07fd6533b2303695660a411f38dc95317df478e4d407b08634a7f49","src/conversions/eyre.rs":"e740753b90f038ba9777f8aae0ab3c2f85b7c9f61ba9fa7ca240c5451764f066","src/conversions/hashbrown.rs":"24306e4c6e4e5a51d6f6e95ee78e25a16982bacb8bbf8297ff44d43c36873a8a","src/conversions/indexmap.rs":"d809edfb6cba055f81f023ed55cb805811f34e9084e46551796f9018bfe4f9aa","src/conversions/mod.rs":"a2a73a0a45420576c8ac7cf00b22f71ef80e77ea288aa6f3310ac8a5f3894a68","src/conversions/num_bigint.rs":"847acd49f55f797b9a9c0e52792383b992113a964642e4de3d62e7c79b83844e","src/conversions/num_complex.rs":"d25d5d8e4976e3b7bef80e31232b5d9e0981226d63e5f9fe8886fd3cfb2a6e07","src/conversions/num_rational.rs":"0cd7eeee40bf87222b353b988cf635cb5581e7ed0185f1454507fe1c377f9f54","src/conversions/rust_decimal.rs":"428539641bbb385534c1e6428e54311b30bf285e9575658637ea202ecf685d3d","src/conversions/serde.rs":"00617a9ddcc7b7c9d73c581b9fcc2ea370357a0eb78f4173d7e3f6e6db66ef30","src/conversions/smallvec.rs":"65d6fde17712c399dfd2fbeff256a34d917b55f63aa5f1a50faa2da1530f06da","src/conversions/std/array.rs":"6d97876b4f5d19a89e05d9d71157ef65fae0012c57348f2d0f0631d161cd5082","src/conversions/std/cell.rs":"b9405d3c3ed1c9527dc87b7ddb2bc4b3a284acb64e1c4818b7a6150896b3ad69","src/conversions/std/ipaddr.rs":"1b9266864c36eb9b3c8ce7440076c5973a8eea443435a5900a2433107708e612","src/conversions/std/map.rs":"103dc1b205180d4fcb50c23a36aa822cfb804a2f3c9f96e92df8b91e01105fc7","src/conversions/std/mod.rs":"586319954e53dbc7481f41c20ff57a7f1befd6cb237a668beb1ee5c4c313bee7","src/conversions/std/num.rs":"c5d5625ce5b11592e537331df471f99e9d0b1c2f2ae7bc8e66c759e4c08844f2","src/conversions/std/option.rs":"70a21fcbd75203545beec41409ae80e18d1ce139b50f848047c52dbbc320d246","src/conversions/std/osstr.rs":"0fc3aa98c87ee46b0f08ac87909b67007b51858420117e8d53fe32a814cdc560","src/conversions/std/path.rs":"ff1a3bc9253a49c92a1cd40a01a1647de7ca13d10e8653b5a3da27dee52818c1","src/conversions/std/set.rs":"33f52208d4d7e1af5576efc284c171621ac79fad8d3dee7ea7d8facdddd2bf15","src/conversions/std/slice.rs":"1ad6ea1326e0d7520109f10ff2b9c62a89f6d4dc6dcb2941ea7bb228ce547889","src/conversions/std/string.rs":"e46e9b619359f8955d27a56bcbe9e197a74cd684cfedb110a25def1c08c70fd4","src/conversions/std/time.rs":"706935179647db9b024b7b88f1b32b7c5be02ba67338814461c4e93a8d21c7f8","src/conversions/std/vec.rs":"cf01937f707baff69fbdeb30b912354588e14805bec02477c73f3e0af650e6fe","src/coroutine.rs":"c8dd08d2ab425452a205b9a49bfb23505cf2c1c5621d3f9dc2cf08d8409ea6d4","src/coroutine/cancel.rs":"c445e05535ff65bbdfaf9280579b63b16b5d4c57497e9a81f217fb52ccf72668","src/coroutine/waker.rs":"f032fcaadcf4c367617aec7b0f6a234b032aa0db4b30d1de17afa93b8318ab53","src/derive_utils.rs":"3feeffed67942f73749401a7e7c71192d2362c73484b73e34d35b4520ea6d30b","src/err/err_state.rs":"74c1117b4806a4a73e334b1d1f57882860f9f5fca9ca4046165bb135a8670210","src/err/impls.rs":"af3519c77cd59986412b67176b1156ce75402e6173496a4cf5bfd4bcbd859de6","src/err/mod.rs":"b9faa7bac1bb1f27146c06b458c2f7dd7226bc243a31a80e2b10f7a01204297d","src/exceptions.rs":"8a5aabfe41916b4854f689f3a9998a8cf8ff1eb248cecc5128fbbad9d84d8287","src/ffi/mod.rs":"e606a0eca1e527b16d7f93dcb73a1ec9ac1c323c59bcf5962d0b24790b542f24","src/ffi/tests.rs":"4a54efb1bf8902cde103146dae24c99f119d3a0e4819a62da67ff2f50904a430","src/ffi_ptr_ext.rs":"477489a497dcb49e3ea053c9e99b737116b2a603eb8124385b9501f7ffc7d6b0","src/gil.rs":"34360377c4a98d05b06647298579aac624b3e246a3b688cf6daef97bf9609146","src/impl_.rs":"c96fb12abf7f7f57879fe7e95c71f7cb8b0a9cfce20965ab227937f053770dee","src/impl_/coroutine.rs":"e3d2bd4d8049236b4120ddb21b576ec47f2346348dc57887734b95266f397628","src/impl_/deprecations.rs":"f7d1bdd207f5c6bc6fa481c227bbc0783ee358fddc63843eee8b4035f174ab3a","src/impl_/exceptions.rs":"6ecaaee3d7968adff7cf63058a907ef1c8c15010fc30a39e39cfbff80acbf404","src/impl_/extract_argument.rs":"54eb675d130a8ef5ecea99495e54710ef3e2b317edb36e8c8c4649b22475dc2b","src/impl_/freelist.rs":"9cba201857124d7ce87e2c874b7f221cb20c75bab551080e50e9289a771a8ba8","src/impl_/frompyobject.rs":"fa2a9224fa7a880620d0e327c736d9f4243dea9c1e4839dc24d337bd61cdf817","src/impl_/not_send.rs":"964be0adb1999a531a921c10183811280e240ee781e31dc8ae49175737c3b7b6","src/impl_/panic.rs":"bf0c60a4650bf7ae66088c4ce744f546ca197cb170eeef0f3f0a28c57be55007","src/impl_/pycell.rs":"14e44c723a44432df9e280a2c35f5ba67c4e472fb17270efb509c5737b60dc32","src/impl_/pyclass.rs":"35fe39a4d3fbf910ef8c08f5be31176c40a230201caf45ea586d85bbc39aee0f","src/impl_/pyclass/lazy_type_object.rs":"b1ef8615169ecf484d99055edb1198ff8e915dfb0f5f73276128780ed5dd7a33","src/impl_/pyfunction.rs":"796fbd52389fb92b3f21ac8b639fa85f825166ff3cb416f854dcd8ef9a403adf","src/impl_/pymethods.rs":"60bfa2b7e58e02109940dd5b9ec5a7caa012d1505ba535211e4165d49a013039","src/impl_/pymodule.rs":"1d8d2e9f48b4f5187c802eab32b98d91ab0f0123e8902d9d81581eff86f183f4","src/impl_/trampoline.rs":"466c9fc7672424f195247281de7cc4e82c3d33eba4e987e43671ff9606ce0435","src/impl_/wrap.rs":"e405d25a72a99f264c04fe4a5607565cbd9f00d3047ca573605c9e057d70467b","src/inspect/mod.rs":"4876e6d601ed56b33c8cf2723f0cf7198da3a69a26be8d4799d8c5a935c4dd49","src/inspect/types.rs":"8a1364529f473c793d2e3b5296a9be8bd92920d9da14debc3a69a452c17b85a8","src/instance.rs":"3d6f867bcc15203f2c9c9f6d15dda621e40768f2dde407f0060e41a2051d6b8a","src/internal_tricks.rs":"25814651accc87693ed5f98e5d09e8a412260c63079f23d6fa61a3dbea3be2bd","src/lib.rs":"7cdc3e65c18d81e31d3b412545e81f665ba34106506fb70066ed8c42871fa7c9","src/macros.rs":"b7340c47ec5c2a33e5445d345c5ab1f51065ade495f744c8f9b11ab677135a2a","src/marker.rs":"f1101adef376f91eb59d200a2fbc9ade03155cd06674ac5255bc92f52f779910","src/marshal.rs":"70efd4c2fe49df7cd283c636b8c696192369016b422f7f520ef792d5418eca07","src/panic.rs":"bc49ee5591b53bdc2e1f54da75bc6917ffc2e7399eaba986635a7d60c98edd3f","src/prelude.rs":"b31f4dc8e2149164b5d2d0017262e3ab8f29a64b180cacfe56c1f972fefb1481","src/py_result_ext.rs":"68f45c17efe430321d75323628df86d3f3b7827fdd513423181cbd56773e9f34","src/pybacked.rs":"6b85a3e8f20b85230b09df125500d8f3ed9c39d47c91cb9a1c2c6a0e6114309b","src/pycell.rs":"d746cf26d78720fc56487c07b69e5b824e09ad1af9af45c20a21597f86c36f34","src/pycell/impl_.rs":"292d9252193226e99f8fa0ca45956c6dd8d1339be6a540d729060a394ef2c780","src/pyclass.rs":"60aa212fc084ca5e8215c24908f31382615e3f375495394d8cf5f16564c1f013","src/pyclass/create_type_object.rs":"7f61874ab6070a4023ebf2f2b1b55408bda795e1bf4f30602937c79d4a3e8ac5","src/pyclass/gc.rs":"7d8c914600d1d725fc13f5558982ac2bc6ecbed7e145b09ffeb5c9bb1c629b0b","src/pyclass_init.rs":"fd8aef28918fd36b3552a3046d0695e586176087ccafb8f8238ab8d09b569df4","src/sealed.rs":"d06eb67d21216773fa83c669f8d98bc65138b660d2dafed220a27f8b78a822b2","src/sync.rs":"89a861f42500a13c2b6b0b071a1eec3aa0a6a696395b4c54605bfc907ad0cdaa","src/test_utils.rs":"2fe31e1211529dffa901b9efc28d24ac4f57f5c8248d80bf7069b4437e472655","src/tests/common.rs":"e38fdfc421416b756ced6825f6708e852e9ea79fad19db65384a222fa205ee99","src/tests/hygiene/misc.rs":"9ade9eb328ef91350e409b8ff5556ca51a051a53845e5b47d158a2a99a5b5e5d","src/tests/hygiene/mod.rs":"36a5fbef6f876c897d5bd811496bb6b8ae87bc7b8937b0e1f139f862fe788699","src/tests/hygiene/pyclass.rs":"55b65d231a67d56f22ae645a150698af2362fb178212276a20ef7981e3ed8b40","src/tests/hygiene/pyfunction.rs":"b0192245e36245756b413e292b48edb182c37550b0f74f46b3dd973e89519575","src/tests/hygiene/pymethods.rs":"242afed8479ff2510e91146a62431922fac81842c014fbe21c9ca80b83037102","src/tests/hygiene/pymodule.rs":"51bbd3bf2fefa198358d28899e54efc018370e48974126441ceacc5c107c333e","src/tests/mod.rs":"f0d1c300916ef0115fc2f203b36335c29f04f38c395004c791b00c0b05a6bbe9","src/type_object.rs":"c83d3af347294395a0803aa303fa96391ae2d6d63771ae48446c97207434a842","src/types/any.rs":"20193114de482c82da6c0cac744e85ba8cd8cf03298834eeae1bfe25d9846ff0","src/types/boolobject.rs":"000e809994bbbf7e9cffaa45bf03f2d131cfd871594be361d7f822c61092749b","src/types/bytearray.rs":"8e000c9391a2a78ec6661d670aa4e9882091c1ebc108f83b78312492f9bee55d","src/types/bytes.rs":"8bd0142bee2ef3cad665e3c8c38397334cd763c43391085ee909df5089eba7e2","src/types/capsule.rs":"ce9c2564c23ee885b4964710e444bda539b81d8cc5f7f4d9e8f7015953dfc6e0","src/types/code.rs":"41f1d862f152a9c9f9c9c883d53d49b0581a05c9ac1031d2b9bb98491c0a06db","src/types/complex.rs":"85d8f27ae003d956762a9a5477d3b6d9d971bc0430c92c1b6a668ed783ff7354","src/types/datetime.rs":"2fa1318cb2db7c948ef852538a1afce1de3536d37f7083fc7d55ead04f218283","src/types/dict.rs":"a6887971277c79211ae1a8f6b6070c14264005c55dc3eac454b478ff2ff7b718","src/types/ellipsis.rs":"03246bc9e6892872d3c109e5749edecea8d7a22efcbed89d155fc417e4e47f24","src/types/float.rs":"7b80390c7fd2911a42a3e9776c18986b40d7caffe2369701fd87a0e9ff3fc0d2","src/types/frame.rs":"b1ec3469af5f2e3fa1b3a6ff0511ea9bf0722b01ff6c0008bb181f5a6c38ec8d","src/types/frozenset.rs":"68c03d88b00f4d11fd139ebb1071479b1639d9c8972d98a8744ce96f284e4f7f","src/types/function.rs":"070de41f65acf61efac187420e4d999a7e30bf65ec940b5569caff010664faf3","src/types/iterator.rs":"40fc8dd3978eb6ea6522f3c1a3b63070698c721bdc54999047e41fdaa81f7b11","src/types/list.rs":"45cb49bc48e98fd2ec1b78223f067d9ef6b4212d003de778dbd550c1dde9830a","src/types/mapping.rs":"a2e8ba3d45f4ea48abbad4137fcf1e436a7d4213637b199de4cf7e5c321f495a","src/types/memoryview.rs":"9507c10a3940ef9c2d05d7a0d773ad2c26e2d6fcd944d18cd50aa8fd0c0f8ece","src/types/mod.rs":"9d46ca85a1cda8a12d4e01cff50fddcbdd090a39fb4ff3f7e669278bfd00ba8d","src/types/module.rs":"be65753994f333635650a79fc98c5e68e645e343c898b75f77496bccfaf6764a","src/types/none.rs":"d45db4d4f660388262e60a5fa8be8e8124321efcf358c9bbe59e6563208c82d5","src/types/notimplemented.rs":"7a52b2a0b72a37913437896372258d7cb04a6bd9e0a8d890a5f83d7a8858bde8","src/types/num.rs":"fbf7ca3b5630c8068ec664f5a68e189cbe13dd595b5ae53936501d58641ec515","src/types/pysuper.rs":"1f86d35dfc41cea6e3b11592421ed6d16913ac9a6549c01a93d5c8b47a544b95","src/types/sequence.rs":"f8ff436975ad865c19a1be05437619967b87058df4555edd05454303aa5cf7f6","src/types/set.rs":"97a6f3e82ce60ce1b13cdbc87a583f51ffcb428406d39a375aeb85f56af7067d","src/types/slice.rs":"98b816ce0cba904f08b335e53c8b3aadd80bdfd854047343bd6101b70c865b5d","src/types/string.rs":"0294101cfd99848166bf4c0ff0055036f093c3d13e387524d057bc8c358c4a98","src/types/traceback.rs":"c65cc0b084afc24758ba61778575d877ce82dbdae2768a3675a659e8b619c229","src/types/tuple.rs":"d46f2ede9c26e73cb8d0fd14d77b17f86dc875e2faf5033430a04012d4840a20","src/types/typeobject.rs":"496f92134a8d470023dc5a4341c603f60e1f047d1ee14b0b34abc9095eae4717","src/types/weakref/anyref.rs":"4db73387baf5c2537633ddb0a2efb23e0b969b4b397d23d5b2a50b74a89cf243","src/types/weakref/mod.rs":"411b8ae0ab077bf3c9e39917f046f775deb44f7cc8801370169f1d48c0f35b38","src/types/weakref/proxy.rs":"dace3ff3f04162d5e80131cc644f5a4fe8846c24535e968dcccb8bc22a7599a2","src/types/weakref/reference.rs":"cd4db6f16bbca7df71433db5fa90b6f7c865cd139cda86e21baab78f0715861a","src/version.rs":"baefa2aac7b4868ae01cfefcfaf31f6f568436b6ff51628e1c69bccee90cc4b2","tests/test_anyhow.rs":"de73a60f813b7dffd53ad89931c624cb67ad8204ecb27dab201c6e220ffe808e","tests/test_append_to_inittab.rs":"90dd63d6152f57e11a6b5d2fddb9b89df7319f65ce82a4d49724b026b4032ee4","tests/test_arithmetics.rs":"ce47abfe1a614254d9e891fc115da1370b109e8795b08da906a9dd7fd95ac1eb","tests/test_buffer.rs":"ef569dc24b7912a98b551f980d03adc0bc86ae0e5f93c24dbc6af5e3d0cf892b","tests/test_buffer_protocol.rs":"cdc02a070f087b2878d05f3b43a4fdfcd39cbceb421533135942ea42940c9b9e","tests/test_bytes.rs":"c73f7ab7d7aadabbae683f0c488659f1c7cbfb1ac6c995f9c1db03b31ecdde74","tests/test_class_attributes.rs":"308f9e5a72d726337e21b93729d22b771d357b3ce8aab9acc772aa03768c91f2","tests/test_class_basics.rs":"531e59a7519255e9784716038a3950112339e28050720c9ae3c55e636479ba0b","tests/test_class_comparisons.rs":"aeb20ac8e1eab550eae609a81d468b3e07f693a668ba5fdd5db8280c402917d4","tests/test_class_conversion.rs":"86b58ba35e8925a9835af1c27c48373080d6d3fd7b91e9383f73e11dab1b775f","tests/test_class_new.rs":"47a5f1d365aa952ca10b55ce97dda0eb8662a37d2daa338e2872e7cc6248af40","tests/test_coroutine.rs":"e2e2bf03a182cb6d5f2402f29a936c3bd1d20680bbbe9c8eb855d0a1d2a9e2d9","tests/test_datetime.rs":"403118a891777b2c035bfdcd87c9430a850b5ce7deed05a3ef145300a3e67b8a","tests/test_datetime_import.rs":"552b432651b05c1e3dde3727b8756b9649b07698c7aac00f0ec85e53eaaf28b9","tests/test_declarative_module.rs":"154d738ffeacb646c8c9e71d8146a6ef1d8082521aaace6ccfce9413a17764ec","tests/test_default_impls.rs":"f6d0d3aa3e06da742d73a44e69ba779b6628d1b3ed12d414343f9209482ef64e","tests/test_dict_iter.rs":"158f11ca9f427798be86ffc41821b97cb483d4d2f334a10b1757537ec22038b2","tests/test_enum.rs":"05ba2d58371dc9e8281cc4018af94cf16c0728bb8a1e2d184a161bcfd97cbf46","tests/test_exceptions.rs":"0c76200fd4eef81bdae54420126eb9a4516e785e0f9bab94fc280de93639b956","tests/test_field_cfg.rs":"7a1e858ecffc14fc4425b002baa79b5970a587de2299230cf1d6f35a4bb8fbbc","tests/test_frompyobject.rs":"956b07495ef88734f24b3c9df786ce4f3ec3f73b4d6ad956002f28e8c8d3bb7b","tests/test_gc.rs":"3134ea322189f52ceb3d46865e44f57668d9f063327d940503337d27b6c9b8fb","tests/test_getter_setter.rs":"1f8488e8a0050b56c283660785b32a70930b66330e18a959e3978cae36aea2a1","tests/test_inheritance.rs":"08250856c7c36e6dbd9411c17689fc06929d9124d74485d4530a2c31175d4097","tests/test_macro_docs.rs":"aeae98ff64d21a977affef52a30ee97c639f2b20c7787ebb246c76bbb4807030","tests/test_macros.rs":"d7378445fb31334a9e4d40ed5c71856f7a3e0713a6198e5f0744204388c83274","tests/test_mapping.rs":"c5b8f94c7556350b91aa9143057c3383c5437f40dc873736b9d0d7aaa42aca14","tests/test_methods.rs":"042834c3c9f65220ddf76df3d8cbc56e0eb805e7026f0a1903538703ed993992","tests/test_module.rs":"e3ab7cc1bdcbb522c9f1def6567982ba561d197691b068fcb786dce58f81b224","tests/test_multiple_pymethods.rs":"4dc62f348f3b2a9ecc4bb488da7a563f6764372f51d9ae58eba1b08958d567e9","tests/test_no_imports.rs":"57d340d6aeff07955eae00e8119f4af87eca8312200fb9cb2836719fc9cbafcc","tests/test_proto_methods.rs":"00d7e52509e04b4cdf116553b55a040b8613e1b4a6fa69015a573fe88dc6d385","tests/test_pyfunction.rs":"e5faf8fa2c1d4d358b7bc513c2404ebea8b34016af8ab3d36a8d5094db1ea0d1","tests/test_pyself.rs":"05b9d99098e3615067ec66c4ebeac35b966c74b88beeea9f95933e7190e1958c","tests/test_sequence.rs":"d3177d3c9b6f4f0477776354f9eff7aadfca939eb7a1e0bcd2b98edb455d9ccf","tests/test_serde.rs":"bfefb2263e5ee6a7b5375a2672557f58ef597d41db0c77a0661e38526de4f829","tests/test_static_slots.rs":"17362add8264e51d4be799b7af1686f08108411a945f6e52264c2c6b6910d218","tests/test_string.rs":"f298dcc53d884c881db3104a73b40a71a772314573fbc98780ac970558105795","tests/test_super.rs":"26e8a2e6d64285c146410408f7c1bc8f4a33d277a8e3dca4d0a4c5b8e1d2ad95","tests/test_text_signature.rs":"c405acfffaa8663da2d8baf555def7cd0e85021dc21db76f3dca8c229b52d811","tests/test_variable_arguments.rs":"e8384e6841579605f377f2e865e67337c376adf3feb4fd85d4cf01cbf942b4cc","tests/test_various.rs":"bcb8c87ec5c4c48773d30ec96a6c6fff17a42ad5a13b5ebe5a08fa2d5a8cedb9","tests/test_wrap_pyfunction_deduction.rs":"9665861aba05c9dc40a050c32db77a1317a9347243d0900c27cfd01cc81dea1a"},"package":"831e8e819a138c36e212f3af3fd9eeffed6bf1510a805af35b0edee5ffa59433"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/pyo3/Architecture.md 43.0.0-1ubuntu1/rust-vendor/pyo3/Architecture.md
--- 43.0.0-1/rust-vendor/pyo3/Architecture.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/Architecture.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,201 @@
+<!-- This file contains a rough overview of the PyO3 codebase. -->
+<!-- Please do not make descriptions too specific, so that we can easily -->
+<!-- keep this file in sync with the codebase. -->
+
+# PyO3: Architecture
+
+This document roughly describes the high-level architecture of PyO3.
+If you want to become familiar with the codebase you are in the right place!
+
+## Overview
+
+PyO3 provides a bridge between Rust and Python, based on the [Python/C API].
+Thus, PyO3 has low-level bindings of these API as its core.
+On top of that, we have higher-level bindings to operate Python objects safely.
+Also, to define Python classes and functions in Rust code, we have `trait PyClass` and a set of
+protocol traits (e.g., `PyIterProtocol`) for supporting object protocols (i.e., `__dunder__` methods).
+Since implementing `PyClass` requires lots of boilerplate, we have a proc-macro `#[pyclass]`.
+
+To summarize, there are six main parts to the PyO3 codebase.
+
+1. [Low-level bindings of Python/C API.](#1-low-level-bindings-of-python-capi)
+   - [`pyo3-ffi`] and [`src/ffi`]
+2. [Bindings to Python objects.](#2-bindings-to-python-objects)
+   - [`src/instance.rs`] and [`src/types`]
+3. [`PyClass` and related functionalities.](#3-pyclass-and-related-functionalities)
+   - [`src/pycell.rs`], [`src/pyclass.rs`], and more
+4. [Procedural macros to simplify usage for users.](#4-procedural-macros-to-simplify-usage-for-users)
+   - [`src/impl_`], [`pyo3-macros`] and [`pyo3-macros-backend`]
+5. [`build.rs` and `pyo3-build-config`](#5-buildrs-and-pyo3-build-config)
+   - [`build.rs`](https://github.com/PyO3/pyo3/tree/main/build.rs)
+   - [`pyo3-build-config`]
+
+## 1. Low-level bindings of Python/C API
+
+[`pyo3-ffi`] contains wrappers of the [Python/C API]. This is currently done by hand rather than
+automated tooling because:
+  - it gives us best control about how to adapt C conventions to Rust, and
+  - there are many Python interpreter versions we support in a single set of files.
+
+We aim to provide straight-forward Rust wrappers resembling the file structure of
+[`cpython/Include`](https://github.com/python/cpython/tree/v3.9.2/Include).
+
+However, we still lack some APIs and are continuously updating the module to match
+the file contents upstream in CPython.
+The tracking issue is [#1289](https://github.com/PyO3/pyo3/issues/1289), and contribution is welcome.
+
+In the [`pyo3-ffi`] crate, there is lots of conditional compilation such as `#[cfg(Py_LIMITED_API)]`,
+`#[cfg(Py_3_7)]`, and `#[cfg(PyPy)]`.
+`Py_LIMITED_API` corresponds to `#define Py_LIMITED_API` macro in Python/C API.
+With `Py_LIMITED_API`, we can build a Python-version-agnostic binary called an
+[abi3 wheel](https://pyo3.rs/latest/building-and-distribution.html#py_limited_apiabi3).
+`Py_3_7` means that the API is available from Python >= 3.7.
+There are also `Py_3_8`, `Py_3_9`, and so on.
+`PyPy` means that the API definition is for PyPy.
+Those flags are set in [`build.rs`](#6-buildrs-and-pyo3-build-config).
+
+## 2. Bindings to Python objects
+
+[`src/types`] contains bindings to [built-in types](https://docs.python.org/3/library/stdtypes.html)
+of Python, such as `dict` and `list`.
+For historical reasons, Python's `object` is called `PyAny` in PyO3 and located in [`src/types/any.rs`].
+
+Currently, `PyAny` is a straightforward wrapper of `ffi::PyObject`, defined as:
+
+```rust
+#[repr(transparent)]
+pub struct PyAny(UnsafeCell<ffi::PyObject>);
+```
+
+Concrete Python objects are implemented by wrapping `PyAny`, e.g.,:
+
+```rust
+#[repr(transparent)]
+pub struct PyDict(PyAny);
+```
+
+These types are not intended to be accessed directly, and instead are used through the `Py<T>` and `Bound<T>` smart pointers.
+
+We have some macros in [`src/types/mod.rs`] which make it easier to implement APIs for concrete Python types.
+
+## 3. `PyClass` and related functionalities
+
+[`src/pycell.rs`], [`src/pyclass.rs`], and [`src/type_object.rs`] contain types and
+traits to make `#[pyclass]` work.
+Also, [`src/pyclass_init.rs`] and [`src/impl_/pyclass.rs`] have related functionalities.
+
+To realize object-oriented programming in C, all Python objects have `ob_base: PyObject` as their
+first field in their structure definition. Thanks to this guarantee, casting `*mut A` to `*mut PyObject`
+is valid if `A` is a Python object.
+
+To ensure this guarantee, we have a wrapper struct `PyCell<T>` in [`src/pycell.rs`] which is roughly:
+
+```rust
+#[repr(C)]
+pub struct PyCell<T: PyClass> {
+    ob_base: crate::ffi::PyObject,
+    inner: T,
+}
+```
+
+Thus, when copying a Rust struct to a Python object, we first allocate `PyCell` on the Python heap and then
+move `T` into it.
+Also, `PyCell` provides [RefCell](https://doc.rust-lang.org/std/cell/struct.RefCell.html)-like methods
+to ensure Rust's borrow rules.
+See [the documentation](https://docs.rs/pyo3/latest/pyo3/pycell/struct.PyCell.html) for more.
+
+`PyCell<T>` requires that `T` implements `PyClass`.
+This trait is somewhat complex and derives many traits, but the most important one is `PyTypeInfo`
+in [`src/type_object.rs`].
+`PyTypeInfo` is also implemented for built-in types.
+In Python, all objects have their types, and types are also objects of `type`.
+For example, you can see `type({})` shows `dict` and `type(type({}))` shows `type` in Python REPL.
+`T: PyTypeInfo` implies that `T` has a corresponding type object.
+
+### Protocol methods
+
+Python has some built-in special methods called dunder methods, such as `__iter__`.
+They are called "slots" in the [abstract objects layer](https://docs.python.org/3/c-api/abstract.html) in
+Python/C API.
+We provide a way to implement those protocols similarly, by recognizing special
+names in `#[pymethods]`, with a few new ones for slots that can not be
+implemented in Python, such as GC support.
+
+## 4. Procedural macros to simplify usage for users.
+
+[`pyo3-macros`] provides five proc-macro APIs: `pymodule`, `pyfunction`, `pyclass`,
+`pymethods`, and `#[derive(FromPyObject)]`.
+[`pyo3-macros-backend`] has the actual implementations of these APIs.
+[`src/impl_`] contains `#[doc(hidden)]` functionality used in code generated by these proc-macros,
+such as parsing function arguments.
+
+## 5. `build.rs` and `pyo3-build-config`
+
+PyO3 supports a wide range of OSes, interpreters and use cases. The correct environment must be
+detected at build time in order to set up relevant conditional compilation correctly. This logic
+is captured in the [`pyo3-build-config`] crate, which is a `build-dependency` of `pyo3` and
+`pyo3-macros`, and can also be used by downstream users in the same way.
+
+In [`pyo3-build-config`]'s `build.rs` the build environment is detected and inlined into the crate
+as a "config file". This works in all cases except for cross-compiling, where it is necessary to
+capture this from the `pyo3` `build.rs` to get some extra environment variables that Cargo doesn't
+set for build dependencies.
+
+The `pyo3` `build.rs` also runs some safety checks such as ensuring the Python version detected is
+actually supported.
+
+Some of the functionality of `pyo3-build-config`:
+- Find the interpreter for build and detect the Python version.
+  - We have to set some version flags like `#[cfg(Py_3_7)]`.
+  - If the interpreter is PyPy, we set `#[cfg(PyPy)`.
+  - If the `PYO3_CONFIG_FILE` environment variable is set then that file's contents will be used
+    instead of any detected configuration.
+  - If the `PYO3_NO_PYTHON` environment variable is set then the interpreter detection is bypassed
+    entirely and only abi3 extensions can be built.
+- Check if we are building a Python extension.
+  - If we are building an extension (e.g., Python library installable by `pip`),
+    we don't link `libpython`.
+    Currently we use the `extension-module` feature for this purpose. This may change in the future.
+    See [#1123](https://github.com/PyO3/pyo3/pull/1123).
+- Cross-compiling configuration
+  - If `TARGET` architecture and `HOST` architecture differ, we can find cross compile information
+    from environment variables (`PYO3_CROSS_LIB_DIR`, `PYO3_CROSS_PYTHON_VERSION` and
+    `PYO3_CROSS_PYTHON_IMPLEMENTATION`) or system files.
+    When cross compiling extension modules it is often possible to make it work without any
+    additional user input.
+  - When an experimental feature `generate-import-lib` is enabled, the `pyo3-ffi` build script can
+    generate `python3.dll` import libraries for Windows targets automatically via an external
+    [`python3-dll-a`] crate. This enables the users to cross compile Python extensions for Windows without
+    having to install any Windows Python libraries.
+
+<!-- External Links -->
+
+[python/c api]: https://docs.python.org/3/c-api/
+[`python3-dll-a`]: https://docs.rs/python3-dll-a/latest/python3_dll_a/
+
+<!-- Crates -->
+
+[`pyo3-macros`]: https://github.com/PyO3/pyo3/tree/main/pyo3-macros
+[`pyo3-macros-backend`]: https://github.com/PyO3/pyo3/tree/main/pyo3-macros-backend
+[`pyo3-build-config`]: https://github.com/PyO3/pyo3/tree/main/pyo3-build-config
+[`pyo3-ffi`]: https://github.com/PyO3/pyo3/tree/main/pyo3-ffi
+
+<!-- Directories -->
+
+[`src/class`]: https://github.com/PyO3/pyo3/tree/main/src/class
+[`src/ffi`]: https://github.com/PyO3/pyo3/tree/main/src/ffi
+[`src/types`]: https://github.com/PyO3/pyo3/tree/main/src/types
+
+<!-- Files -->
+
+[`src/impl_`]: https://github.com/PyO3/pyo3/blob/main/src/impl_
+[`src/instance.rs`]: https://github.com/PyO3/pyo3/tree/main/src/instance.rs
+[`src/pycell.rs`]: https://github.com/PyO3/pyo3/tree/main/src/pycell.rs
+[`src/pyclass.rs`]: https://github.com/PyO3/pyo3/tree/main/src/pyclass.rs
+[`src/pyclass_init.rs`]: https://github.com/PyO3/pyo3/tree/main/src/pyclass_init.rs
+[`src/pyclass_slot.rs`]: https://github.com/PyO3/pyo3/tree/main/src/pyclass_slot.rs
+[`src/type_object.rs`]: https://github.com/PyO3/pyo3/tree/main/src/type_object.rs
+[`src/class/methods.rs`]: https://github.com/PyO3/pyo3/tree/main/src/class/methods.rs
+[`src/class/impl_.rs`]: https://github.com/PyO3/pyo3/tree/main/src/class/impl_.rs
+[`src/types/any.rs`]: https://github.com/PyO3/pyo3/tree/main/src/types/any.rs
+[`src/types/mod.rs`]: https://github.com/PyO3/pyo3/tree/main/src/types/mod.rs
diff -pruN 43.0.0-1/rust-vendor/pyo3/CHANGELOG.md 43.0.0-1ubuntu1/rust-vendor/pyo3/CHANGELOG.md
--- 43.0.0-1/rust-vendor/pyo3/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/CHANGELOG.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1923 @@
+# Changelog
+
+All notable changes to this project will be documented in this file. For help with updating to new
+PyO3 versions, please see the [migration guide](https://pyo3.rs/latest/migration.html).
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+To see unreleased changes, please see the [CHANGELOG on the main branch guide](https://pyo3.rs/main/changelog.html).
+
+<!-- towncrier release notes start -->
+
+## [0.22.2] - 2024-07-17
+
+### Packaging
+
+- Require opt-in to freethreaded Python using the `UNSAFE_PYO3_BUILD_FREE_THREADED=1` environment variable (it is not yet supported by PyO3). [#4327](https://github.com/PyO3/pyo3/pull/4327)
+
+### Changed
+
+- Use FFI function calls for reference counting on all abi3 versions. [#4324](https://github.com/PyO3/pyo3/pull/4324)
+- `#[pymodule(...)]` now directly accepts all relevant `#[pyo3(...)]` options. [#4330](https://github.com/PyO3/pyo3/pull/4330)
+
+### Fixed
+
+- Fix compile failure in declarative `#[pymodule]` under presence of `#![no_implicit_prelude]`. [#4328](https://github.com/PyO3/pyo3/pull/4328)
+- Fix compile failure due to c-string literals on Rust < 1.79. [#4353](https://github.com/PyO3/pyo3/pull/4353)
+
+
+## [0.22.1] - 2024-07-06
+
+### Added
+
+- Add `#[pyo3(submodule)]` option for declarative `#[pymodule]`s. [#4301](https://github.com/PyO3/pyo3/pull/4301)
+- Implement `PartialEq<bool>` for `Bound<'py, PyBool>`. [#4305](https://github.com/PyO3/pyo3/pull/4305)
+
+### Fixed
+
+- Return `NotImplemented` instead of raising `TypeError` from generated equality method when comparing different types. [#4287](https://github.com/PyO3/pyo3/pull/4287)
+- Handle full-path `#[pyo3::prelude::pymodule]` and similar for `#[pyclass]` and `#[pyfunction]` in declarative modules.[#4288](https://github.com/PyO3/pyo3/pull/4288)
+- Fix 128-bit int regression on big-endian platforms with Python <3.13. [#4291](https://github.com/PyO3/pyo3/pull/4291)
+- Stop generating code that will never be covered with declarative modules. [#4297](https://github.com/PyO3/pyo3/pull/4297)
+- Fix invalid deprecation warning for trailing optional on `#[setter]` function. [#4304](https://github.com/PyO3/pyo3/pull/4304)
+
+
+## [0.22.0] - 2024-06-24
+
+### Packaging
+
+- Update `heck` dependency to 0.5. [#3966](https://github.com/PyO3/pyo3/pull/3966)
+- Extend range of supported versions of `chrono-tz` optional dependency to include version 0.10. [#4061](https://github.com/PyO3/pyo3/pull/4061)
+- Update MSRV to 1.63. [#4129](https://github.com/PyO3/pyo3/pull/4129)
+- Add optional `num-rational` feature to add conversions with Python's `fractions.Fraction`. [#4148](https://github.com/PyO3/pyo3/pull/4148)
+- Support Python 3.13. [#4184](https://github.com/PyO3/pyo3/pull/4184)
+
+### Added
+
+- Add `PyWeakref`, `PyWeakrefReference` and `PyWeakrefProxy`. [#3835](https://github.com/PyO3/pyo3/pull/3835)
+- Support `#[pyclass]` on enums that have tuple variants. [#4072](https://github.com/PyO3/pyo3/pull/4072)
+- Add support for scientific notation in `Decimal` conversion. [#4079](https://github.com/PyO3/pyo3/pull/4079)
+- Add `pyo3_disable_reference_pool` conditional compilation flag to avoid the overhead of the global reference pool at the cost of known limitations as explained in the performance section of the guide. [#4095](https://github.com/PyO3/pyo3/pull/4095)
+- Add `#[pyo3(constructor = (...))]` to customize the generated constructors for complex enum variants. [#4158](https://github.com/PyO3/pyo3/pull/4158)
+- Add `PyType::module`, which always matches Python `__module__`. [#4196](https://github.com/PyO3/pyo3/pull/4196)
+- Add `PyType::fully_qualified_name` which matches the "fully qualified name" defined in [PEP 737](https://peps.python.org/pep-0737). [#4196](https://github.com/PyO3/pyo3/pull/4196)
+- Add `PyTypeMethods::mro` and `PyTypeMethods::bases`. [#4197](https://github.com/PyO3/pyo3/pull/4197)
+- Add `#[pyclass(ord)]` to implement ordering based on `PartialOrd`. [#4202](https://github.com/PyO3/pyo3/pull/4202)
+- Implement `ToPyObject` and `IntoPy<PyObject>` for `PyBackedStr` and `PyBackedBytes`. [#4205](https://github.com/PyO3/pyo3/pull/4205)
+- Add `#[pyclass(hash)]` option to implement `__hash__` in terms of the `Hash` implementation [#4206](https://github.com/PyO3/pyo3/pull/4206)
+- Add `#[pyclass(eq)]` option to generate `__eq__` based on `PartialEq`, and `#[pyclass(eq_int)]` for simple enums to implement equality based on their discriminants. [#4210](https://github.com/PyO3/pyo3/pull/4210)
+- Implement `From<Bound<'py, T>>` for `PyClassInitializer<T>`. [#4214](https://github.com/PyO3/pyo3/pull/4214)
+- Add `as_super` methods to `PyRef` and `PyRefMut` for accesing the base class by reference. [#4219](https://github.com/PyO3/pyo3/pull/4219)
+- Implement `PartialEq<str>` for `Bound<'py, PyString>`. [#4245](https://github.com/PyO3/pyo3/pull/4245)
+- Implement `PyModuleMethods::filename` on PyPy. [#4249](https://github.com/PyO3/pyo3/pull/4249)
+- Implement `PartialEq<[u8]>` for `Bound<'py, PyBytes>`. [#4250](https://github.com/PyO3/pyo3/pull/4250)
+- Add `pyo3_ffi::c_str` macro to create `&'static CStr` on Rust versions which don't have 1.77's `c""` literals. [#4255](https://github.com/PyO3/pyo3/pull/4255)
+- Support `bool` conversion with `numpy` 2.0's `numpy.bool` type [#4258](https://github.com/PyO3/pyo3/pull/4258)
+- Add `PyAnyMethods::{bitnot, matmul, floor_div, rem, divmod}`. [#4264](https://github.com/PyO3/pyo3/pull/4264)
+
+### Changed
+
+- Change the type of `PySliceIndices::slicelength` and the `length` parameter of `PySlice::indices()`. [#3761](https://github.com/PyO3/pyo3/pull/3761)
+- Deprecate implicit default for trailing optional arguments [#4078](https://github.com/PyO3/pyo3/pull/4078)
+- `Clone`ing pointers into the Python heap has been moved behind the `py-clone` feature, as it must panic without the GIL being held as a soundness fix. [#4095](https://github.com/PyO3/pyo3/pull/4095)
+- Add `#[track_caller]` to all `Py<T>`, `Bound<'py, T>` and `Borrowed<'a, 'py, T>` methods which can panic. [#4098](https://github.com/PyO3/pyo3/pull/4098)
+- Change `PyAnyMethods::dir` to be fallible and return `PyResult<Bound<'py, PyList>>` (and similar for `PyAny::dir`). [#4100](https://github.com/PyO3/pyo3/pull/4100)
+- The global reference pool (to track pending reference count decrements) is now initialized lazily to avoid the overhead of taking a mutex upon function entry when the functionality is not actually used. [#4178](https://github.com/PyO3/pyo3/pull/4178)
+- Emit error messages when using `weakref` or `dict` when compiling for `abi3` for Python older than 3.9. [#4194](https://github.com/PyO3/pyo3/pull/4194)
+- Change `PyType::name` to always match Python `__name__`. [#4196](https://github.com/PyO3/pyo3/pull/4196)
+- Remove CPython internal ffi call for complex number including: add, sub, mul, div, neg, abs, pow. Added PyAnyMethods::{abs, pos, neg} [#4201](https://github.com/PyO3/pyo3/pull/4201)
+- Deprecate implicit integer comparision for simple enums in favor of `#[pyclass(eq_int)]`. [#4210](https://github.com/PyO3/pyo3/pull/4210)
+- Set the `module=` attribute of declarative modules' child `#[pymodule]`s and `#[pyclass]`es. [#4213](https://github.com/PyO3/pyo3/pull/4213)
+- Set the `module` option for complex enum variants from the value set on the complex enum `module`. [#4228](https://github.com/PyO3/pyo3/pull/4228)
+- Respect the Python "limited API" when building for the `abi3` feature on PyPy or GraalPy. [#4237](https://github.com/PyO3/pyo3/pull/4237)
+- Optimize code generated by `#[pyo3(get)]` on `#[pyclass]` fields. [#4254](https://github.com/PyO3/pyo3/pull/4254)
+- `PyCFunction::new`, `PyCFunction::new_with_keywords` and `PyCFunction::new_closure` now take `&'static CStr` name and doc arguments (previously was `&'static str`). [#4255](https://github.com/PyO3/pyo3/pull/4255)
+- The `experimental-declarative-modules` feature is now stabilized and available by default. [#4257](https://github.com/PyO3/pyo3/pull/4257)
+
+### Fixed
+
+- Fix panic when `PYO3_CROSS_LIB_DIR` is set to a missing path. [#4043](https://github.com/PyO3/pyo3/pull/4043)
+- Fix a compile error when exporting an exception created with `create_exception!` living in a different Rust module using the `declarative-module` feature. [#4086](https://github.com/PyO3/pyo3/pull/4086)
+- Fix FFI definitions of `PY_VECTORCALL_ARGUMENTS_OFFSET` and `PyVectorcall_NARGS` to fix a false-positive assertion. [#4104](https://github.com/PyO3/pyo3/pull/4104)
+- Disable `PyUnicode_DATA` on PyPy: not exposed by PyPy. [#4116](https://github.com/PyO3/pyo3/pull/4116)
+- Correctly handle `#[pyo3(from_py_with = ...)]` attribute on dunder (`__magic__`) method arguments instead of silently ignoring it. [#4117](https://github.com/PyO3/pyo3/pull/4117)
+- Fix a compile error when declaring a standalone function or class method with a Python name that is a Rust keyword. [#4226](https://github.com/PyO3/pyo3/pull/4226)
+- Fix declarative modules discarding doc comments on the `mod` node. [#4236](https://github.com/PyO3/pyo3/pull/4236)
+- Fix `__dict__` attribute missing for `#[pyclass(dict)]` instances when building for `abi3` on Python 3.9. [#4251](https://github.com/PyO3/pyo3/pull/4251)
+
+## [0.21.2] - 2024-04-16
+
+### Changed
+
+- Deprecate the `PySet::empty()` gil-ref constructor. [#4082](https://github.com/PyO3/pyo3/pull/4082)
+
+### Fixed
+
+- Fix compile error for `async fn` in `#[pymethods]` with a `&self` receiver and more than one additional argument. [#4035](https://github.com/PyO3/pyo3/pull/4035)
+- Improve error message for wrong receiver type in `__traverse__`. [#4045](https://github.com/PyO3/pyo3/pull/4045)
+- Fix compile error when exporting a `#[pyclass]` living in a different Rust module using the `experimental-declarative-modules` feature. [#4054](https://github.com/PyO3/pyo3/pull/4054)
+- Fix `missing_docs` lint triggering on documented `#[pymodule]` functions. [#4067](https://github.com/PyO3/pyo3/pull/4067)
+- Fix undefined symbol errors for extension modules on AIX (by linking `libpython`). [#4073](https://github.com/PyO3/pyo3/pull/4073)
+
+## [0.21.1] - 2024-04-01
+
+### Added
+
+- Implement `Send` and `Sync` for `PyBackedStr` and `PyBackedBytes`. [#4007](https://github.com/PyO3/pyo3/pull/4007)
+- Implement `Clone`, `Debug`, `PartialEq`, `Eq`, `PartialOrd`, `Ord` and `Hash` implementation for `PyBackedBytes` and `PyBackedStr`, and `Display` for `PyBackedStr`. [#4020](https://github.com/PyO3/pyo3/pull/4020)
+- Add `import_exception_bound!` macro to import exception types without generating GIL Ref functionality for them. [#4027](https://github.com/PyO3/pyo3/pull/4027)
+
+### Changed
+
+- Emit deprecation warning for uses of GIL Refs as `#[setter]` function arguments. [#3998](https://github.com/PyO3/pyo3/pull/3998)
+- Add `#[inline]` hints on many `Bound` and `Borrowed` methods. [#4024](https://github.com/PyO3/pyo3/pull/4024)
+
+### Fixed
+
+- Handle `#[pyo3(from_py_with = "")]` in `#[setter]` methods [#3995](https://github.com/PyO3/pyo3/pull/3995)
+- Allow extraction of `&Bound` in `#[setter]` methods. [#3998](https://github.com/PyO3/pyo3/pull/3998)
+- Fix some uncovered code blocks emitted by `#[pymodule]`, `#[pyfunction]` and `#[pyclass]` macros. [#4009](https://github.com/PyO3/pyo3/pull/4009)
+- Fix typo in the panic message when a class referenced in `pyo3::import_exception!` does not exist. [#4012](https://github.com/PyO3/pyo3/pull/4012)
+- Fix compile error when using an async `#[pymethod]` with a receiver and additional arguments. [#4015](https://github.com/PyO3/pyo3/pull/4015)
+
+
+## [0.21.0] - 2024-03-25
+
+### Added
+
+- Add support for GraalPy (24.0 and up). [#3247](https://github.com/PyO3/pyo3/pull/3247)
+- Add `PyMemoryView` type. [#3514](https://github.com/PyO3/pyo3/pull/3514)
+- Allow `async fn` in for `#[pyfunction]` and `#[pymethods]`, with the `experimental-async` feature. [#3540](https://github.com/PyO3/pyo3/pull/3540) [#3588](https://github.com/PyO3/pyo3/pull/3588) [#3599](https://github.com/PyO3/pyo3/pull/3599) [#3931](https://github.com/PyO3/pyo3/pull/3931)
+- Implement `PyTypeInfo` for `PyEllipsis`, `PyNone` and `PyNotImplemented`. [#3577](https://github.com/PyO3/pyo3/pull/3577)
+- Support `#[pyclass]` on enums that have non-unit variants. [#3582](https://github.com/PyO3/pyo3/pull/3582)
+- Support `chrono` feature with `abi3` feature. [#3664](https://github.com/PyO3/pyo3/pull/3664)
+- `FromPyObject`, `IntoPy<PyObject>` and `ToPyObject` are implemented on `std::duration::Duration` [#3670](https://github.com/PyO3/pyo3/pull/3670)
+- Add `PyString::to_cow`. Add `Py<PyString>::to_str`, `Py<PyString>::to_cow`, and `Py<PyString>::to_string_lossy`, as ways to access Python string data safely beyond the GIL lifetime. [#3677](https://github.com/PyO3/pyo3/pull/3677)
+- Add `Bound<T>` and `Borrowed<T>` smart pointers as a new API for accessing Python objects. [#3686](https://github.com/PyO3/pyo3/pull/3686)
+- Add `PyNativeType::as_borrowed` to convert "GIL refs" to the new `Bound` smart pointer. [#3692](https://github.com/PyO3/pyo3/pull/3692)
+- Add `FromPyObject::extract_bound` method, to migrate `FromPyObject` implementations to the Bound API. [#3706](https://github.com/PyO3/pyo3/pull/3706)
+- Add `gil-refs` feature to allow continued use of the deprecated GIL Refs APIs. [#3707](https://github.com/PyO3/pyo3/pull/3707)
+- Add methods to `PyAnyMethods` for binary operators (`add`, `sub`, etc.) [#3712](https://github.com/PyO3/pyo3/pull/3712)
+- Add `chrono-tz` feature allowing conversion between `chrono_tz::Tz` and `zoneinfo.ZoneInfo` [#3730](https://github.com/PyO3/pyo3/pull/3730)
+- Add FFI definition `PyType_GetModuleByDef`. [#3734](https://github.com/PyO3/pyo3/pull/3734)
+- Conversion between `std::time::SystemTime` and `datetime.datetime` [#3736](https://github.com/PyO3/pyo3/pull/3736)
+- Add `Py::as_any` and `Py::into_any`. [#3785](https://github.com/PyO3/pyo3/pull/3785)
+- Add `PyStringMethods::encode_utf8`. [#3801](https://github.com/PyO3/pyo3/pull/3801)
+- Add `PyBackedStr` and `PyBackedBytes`, as alternatives to `&str` and `&bytes` where a Python object owns the data. [#3802](https://github.com/PyO3/pyo3/pull/3802) [#3991](https://github.com/PyO3/pyo3/pull/3991)
+- Allow `#[pymodule]` macro on Rust `mod` blocks, with the `experimental-declarative-modules` feature. [#3815](https://github.com/PyO3/pyo3/pull/3815)
+- Implement `ExactSizeIterator` for `set` and `frozenset` iterators on `abi3` feature. [#3849](https://github.com/PyO3/pyo3/pull/3849)
+- Add `Py::drop_ref` to explicitly drop a `Py`` and immediately decrease the Python reference count if the GIL is already held. [#3871](https://github.com/PyO3/pyo3/pull/3871)
+- Allow `#[pymodule]` macro on single argument functions that take `&Bound<'_, PyModule>`. [#3905](https://github.com/PyO3/pyo3/pull/3905)
+- Implement `FromPyObject` for `Cow<str>`. [#3928](https://github.com/PyO3/pyo3/pull/3928)
+- Implement `Default` for `GILOnceCell`. [#3971](https://github.com/PyO3/pyo3/pull/3971)
+- Add `PyDictMethods::into_mapping`, `PyListMethods::into_sequence` and `PyTupleMethods::into_sequence`. [#3982](https://github.com/PyO3/pyo3/pull/3982)
+
+### Changed
+
+- `PyDict::from_sequence` now takes a single argument of type `&PyAny` (previously took two arguments `Python` and `PyObject`). [#3532](https://github.com/PyO3/pyo3/pull/3532)
+- Deprecate `Py::is_ellipsis` and `PyAny::is_ellipsis` in favour of `any.is(py.Ellipsis())`. [#3577](https://github.com/PyO3/pyo3/pull/3577)
+- Split some `PyTypeInfo` functionality into new traits `HasPyGilRef` and `PyTypeCheck`. [#3600](https://github.com/PyO3/pyo3/pull/3600)
+- Deprecate `PyTryFrom` and `PyTryInto` traits in favor of `any.downcast()` via the `PyTypeCheck` and `PyTypeInfo` traits. [#3601](https://github.com/PyO3/pyo3/pull/3601)
+- Allow async methods to accept `&self`/`&mut self` [#3609](https://github.com/PyO3/pyo3/pull/3609)
+- `FromPyObject` for set types now also accept `frozenset` objects as input. [#3632](https://github.com/PyO3/pyo3/pull/3632)
+- `FromPyObject` for `bool` now also accepts NumPy's `bool_` as input. [#3638](https://github.com/PyO3/pyo3/pull/3638)
+- Add `AsRefSource` associated type to `PyNativeType`. [#3653](https://github.com/PyO3/pyo3/pull/3653)
+- Rename `.is_true` to `.is_truthy` on `PyAny` and `Py<PyAny>` to clarify that the test is not based on identity with or equality to the True singleton. [#3657](https://github.com/PyO3/pyo3/pull/3657)
+- `PyType::name` is now `PyType::qualname` whereas `PyType::name` efficiently accesses the full name which includes the module name. [#3660](https://github.com/PyO3/pyo3/pull/3660)
+- The `Iter(A)NextOutput` types are now deprecated and `__(a)next__` can directly return anything which can be converted into Python objects, i.e. awaitables do not need to be wrapped into `IterANextOutput` or `Option` any more. `Option` can still be used as well and returning `None` will trigger the fast path for `__next__`, stopping iteration without having to raise a `StopIteration` exception. [#3661](https://github.com/PyO3/pyo3/pull/3661)
+- Implement `FromPyObject` on `chrono::DateTime<Tz>` for all `Tz`, not just `FixedOffset` and `Utc`. [#3663](https://github.com/PyO3/pyo3/pull/3663)
+- Add lifetime parameter to `PyTzInfoAccess` trait. For the deprecated gil-ref API, the trait is now implemented for `&'py PyTime` and `&'py PyDateTime` instead of `PyTime` and `PyDate`. [#3679](https://github.com/PyO3/pyo3/pull/3679)
+- Calls to `__traverse__` become no-ops for unsendable pyclasses if on the wrong thread, thereby avoiding hard aborts at the cost of potential leakage. [#3689](https://github.com/PyO3/pyo3/pull/3689)
+- Include `PyNativeType` in `pyo3::prelude`. [#3692](https://github.com/PyO3/pyo3/pull/3692)
+- Improve performance of `extract::<i64>` (and other integer types) by avoiding call to `__index__()` converting the value to an integer for 3.10+. Gives performance improvement of around 30% for successful extraction. [#3742](https://github.com/PyO3/pyo3/pull/3742)
+- Relax bound of `FromPyObject` for `Py<T>` to just `T: PyTypeCheck`. [#3776](https://github.com/PyO3/pyo3/pull/3776)
+- `PySet` and `PyFrozenSet` iterators now always iterate the equivalent of `iter(set)`. (A "fast path" with no noticeable performance benefit was removed.) [#3849](https://github.com/PyO3/pyo3/pull/3849)
+- Move implementations of `FromPyObject` for `&str`, `Cow<str>`, `&[u8]` and `Cow<[u8]>` onto a temporary trait `FromPyObjectBound` when `gil-refs` feature is deactivated. [#3928](https://github.com/PyO3/pyo3/pull/3928)
+- Deprecate `GILPool`, `Python::with_pool`, and `Python::new_pool`. [#3947](https://github.com/PyO3/pyo3/pull/3947)
+
+### Removed
+
+- Remove all functionality deprecated in PyO3 0.19. [#3603](https://github.com/PyO3/pyo3/pull/3603)
+
+### Fixed
+
+- Match PyPy 7.3.14 in removing PyPy-only symbol `Py_MAX_NDIMS` in favour of `PyBUF_MAX_NDIM`. [#3757](https://github.com/PyO3/pyo3/pull/3757)
+- Fix segmentation fault using `datetime` types when an invalid `datetime` module is on sys.path. [#3818](https://github.com/PyO3/pyo3/pull/3818)
+- Fix `non_local_definitions` lint warning triggered by many PyO3 macros. [#3901](https://github.com/PyO3/pyo3/pull/3901)
+- Disable `PyCode` and `PyCode_Type` on PyPy: `PyCode_Type` is not exposed by PyPy. [#3934](https://github.com/PyO3/pyo3/pull/3934)
+
+## [0.21.0-beta.0] - 2024-03-10
+
+Prerelease of PyO3 0.21. See [the GitHub diff](https://github.com/pyo3/pyo3/compare/v0.21.0-beta.0...v0.21.0) for what changed between 0.21.0-beta.0 and the final release.
+
+## [0.20.3] - 2024-02-23
+
+### Packaging
+
+- Add `portable-atomic` dependency. [#3619](https://github.com/PyO3/pyo3/pull/3619)
+- Check maximum version of Python at build time and for versions not yet supported require opt-in to the `abi3` stable ABI by the environment variable `PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1`. [#3821](https://github.com/PyO3/pyo3/pull/3821)
+
+### Fixed
+
+- Use `portable-atomic` to support platforms without 64-bit atomics. [#3619](https://github.com/PyO3/pyo3/pull/3619)
+- Fix compilation failure with `either` feature enabled without `experimental-inspect` enabled. [#3834](https://github.com/PyO3/pyo3/pull/3834)
+
+## [0.20.2] - 2024-01-04
+
+### Packaging
+
+- Pin `pyo3` and `pyo3-ffi` dependencies on `pyo3-build-config` to require the same patch version, i.e. `pyo3` 0.20.2 requires _exactly_ `pyo3-build-config` 0.20.2. [#3721](https://github.com/PyO3/pyo3/pull/3721)
+
+### Fixed
+
+- Fix compile failure when building `pyo3` 0.20.0 with latest `pyo3-build-config` 0.20.X. [#3724](https://github.com/PyO3/pyo3/pull/3724)
+- Fix docs.rs build. [#3722](https://github.com/PyO3/pyo3/pull/3722)
+
+## [0.20.1] - 2023-12-30
+
+### Added
+
+- Add optional `either` feature to add conversions for `either::Either<L, R>` sum type. [#3456](https://github.com/PyO3/pyo3/pull/3456)
+- Add optional `smallvec` feature to add conversions for `smallvec::SmallVec`. [#3507](https://github.com/PyO3/pyo3/pull/3507)
+- Add `take` and `into_inner` methods to `GILOnceCell` [#3556](https://github.com/PyO3/pyo3/pull/3556)
+- `#[classmethod]` methods can now also receive `Py<PyType>` as their first argument. [#3587](https://github.com/PyO3/pyo3/pull/3587)
+- `#[pyfunction(pass_module)]` can now also receive `Py<PyModule>` as their first argument. [#3587](https://github.com/PyO3/pyo3/pull/3587)
+- Add `traverse` method to `GILProtected`. [#3616](https://github.com/PyO3/pyo3/pull/3616)
+- Added `abi3-py312` feature [#3687](https://github.com/PyO3/pyo3/pull/3687)
+
+### Fixed
+
+- Fix minimum version specification for optional `chrono` dependency. [#3512](https://github.com/PyO3/pyo3/pull/3512)
+- Silenced new `clippy::unnecessary_fallible_conversions` warning when using a `Py<Self>` `self` receiver. [#3564](https://github.com/PyO3/pyo3/pull/3564)
+
+
+## [0.20.0] - 2023-10-11
+
+### Packaging
+
+- Dual-license PyO3 under either the Apache 2.0 OR the MIT license. This makes the project GPLv2 compatible. [#3108](https://github.com/PyO3/pyo3/pull/3108)
+- Update MSRV to Rust 1.56. [#3208](https://github.com/PyO3/pyo3/pull/3208)
+- Bump `indoc` dependency to 2.0 and `unindent` dependency to 0.2. [#3237](https://github.com/PyO3/pyo3/pull/3237)
+- Bump `syn` dependency to 2.0. [#3239](https://github.com/PyO3/pyo3/pull/3239)
+- Drop support for debug builds of Python 3.7. [#3387](https://github.com/PyO3/pyo3/pull/3387)
+- Bump `chrono` optional dependency to require 0.4.25 or newer. [#3427](https://github.com/PyO3/pyo3/pull/3427)
+- Support Python 3.12. [#3488](https://github.com/PyO3/pyo3/pull/3488)
+
+### Added
+
+- Support `__lt__`, `__le__`, `__eq__`, `__ne__`, `__gt__` and `__ge__` in `#[pymethods]`. [#3203](https://github.com/PyO3/pyo3/pull/3203)
+- Add FFI definition `Py_GETENV`. [#3336](https://github.com/PyO3/pyo3/pull/3336)
+- Add `as_ptr` and `into_ptr` inherent methods for `Py`, `PyAny`, `PyRef`, and `PyRefMut`. [#3359](https://github.com/PyO3/pyo3/pull/3359)
+- Implement `DoubleEndedIterator` for `PyTupleIterator` and `PyListIterator`. [#3366](https://github.com/PyO3/pyo3/pull/3366)
+- Add `#[pyclass(rename_all = "...")]` option: this allows renaming all getters and setters of a struct, or all variants of an enum. Available renaming rules are: `"camelCase"`, `"kebab-case"`, `"lowercase"`, `"PascalCase"`, `"SCREAMING-KEBAB-CASE"`, `"SCREAMING_SNAKE_CASE"`, `"snake_case"`, `"UPPERCASE"`. [#3384](https://github.com/PyO3/pyo3/pull/3384)
+- Add FFI definitions `PyObject_GC_IsTracked` and `PyObject_GC_IsFinalized` on Python 3.9 and up (PyPy 3.10 and up). [#3403](https://github.com/PyO3/pyo3/pull/3403)
+- Add types for `None`, `Ellipsis`, and `NotImplemented`. [#3408](https://github.com/PyO3/pyo3/pull/3408)
+- Add FFI definitions for the `Py_mod_multiple_interpreters` constant and its possible values. [#3494](https://github.com/PyO3/pyo3/pull/3494)
+- Add FFI definitions for `PyInterpreterConfig` struct, its constants and `Py_NewInterpreterFromConfig`. [#3502](https://github.com/PyO3/pyo3/pull/3502)
+
+### Changed
+
+- Change `PySet::discard` to return `PyResult<bool>` (previously returned nothing). [#3281](https://github.com/PyO3/pyo3/pull/3281)
+- Optimize implmentation of `IntoPy` for Rust tuples to Python tuples. [#3321](https://github.com/PyO3/pyo3/pull/3321)
+- Change `PyDict::get_item` to no longer suppress arbitrary exceptions (the return type is now `PyResult<Option<&PyAny>>` instead of `Option<&PyAny>`), and deprecate `PyDict::get_item_with_error`. [#3330](https://github.com/PyO3/pyo3/pull/3330)
+- Deprecate FFI definitions which are deprecated in Python 3.12. [#3336](https://github.com/PyO3/pyo3/pull/3336)
+- `AsPyPointer` is now an `unsafe trait`. [#3358](https://github.com/PyO3/pyo3/pull/3358)
+- Accept all `os.PathLike` values in implementation of `FromPyObject` for `PathBuf`. [#3374](https://github.com/PyO3/pyo3/pull/3374)
+- Add `__builtins__` to globals in `py.run()` and `py.eval()` if they're missing. [#3378](https://github.com/PyO3/pyo3/pull/3378)
+- Optimize implementation of `FromPyObject` for `BigInt` and `BigUint`. [#3379](https://github.com/PyO3/pyo3/pull/3379)
+- `PyIterator::from_object` and `PyByteArray::from` now take a single argument of type `&PyAny` (previously took two arguments `Python` and `AsPyPointer`). [#3389](https://github.com/PyO3/pyo3/pull/3389)
+- Replace `AsPyPointer` with `AsRef<PyAny>` as a bound in the blanket implementation of `From<&T> for PyObject`. [#3391](https://github.com/PyO3/pyo3/pull/3391)
+- Replace blanket `impl IntoPy<PyObject> for &T where T: AsPyPointer` with implementations of `impl IntoPy<PyObject>` for `&PyAny`, `&T where T: AsRef<PyAny>`, and `&Py<T>`. [#3393](https://github.com/PyO3/pyo3/pull/3393)
+- Preserve `std::io::Error` kind in implementation of `From<std::io::IntoInnerError>` for `PyErr` [#3396](https://github.com/PyO3/pyo3/pull/3396)
+- Try to select a relevant `ErrorKind` in implementation of `From<PyErr>` for `OSError` subclass. [#3397](https://github.com/PyO3/pyo3/pull/3397)
+- Retrieve the original `PyErr` in implementation of `From<std::io::Error>` for `PyErr` if the `std::io::Error` has been built using a Python exception (previously would create a new exception wrapping the `std::io::Error`). [#3402](https://github.com/PyO3/pyo3/pull/3402)
+- `#[pymodule]` will now return the same module object on repeated import by the same Python interpreter, on Python 3.9 and up. [#3446](https://github.com/PyO3/pyo3/pull/3446)
+- Truncate leap-seconds and warn when converting `chrono` types to Python `datetime` types (`datetime` cannot represent leap-seconds). [#3458](https://github.com/PyO3/pyo3/pull/3458)
+- `Err` returned from `#[pyfunction]` will now have a non-None `__context__` if called from inside a `catch` block. [#3455](https://github.com/PyO3/pyo3/pull/3455)
+- Deprecate undocumented `#[__new__]` form of `#[new]` attribute. [#3505](https://github.com/PyO3/pyo3/pull/3505)
+
+### Removed
+
+- Remove all functionality deprecated in PyO3 0.18, including `#[args]` attribute for `#[pymethods]`. [#3232](https://github.com/PyO3/pyo3/pull/3232)
+- Remove `IntoPyPointer` trait in favour of `into_ptr` inherent methods. [#3385](https://github.com/PyO3/pyo3/pull/3385)
+
+### Fixed
+
+- Handle exceptions properly in `PySet::discard`. [#3281](https://github.com/PyO3/pyo3/pull/3281)
+- The `PyTupleIterator` type returned by `PyTuple::iter` is now public and hence can be named by downstream crates. [#3366](https://github.com/PyO3/pyo3/pull/3366)
+- Linking of `PyOS_FSPath` on PyPy. [#3374](https://github.com/PyO3/pyo3/pull/3374)
+- Fix memory leak in `PyTypeBuilder::build`. [#3401](https://github.com/PyO3/pyo3/pull/3401)
+- Disable removed FFI definitions `_Py_GetAllocatedBlocks`, `_PyObject_GC_Malloc`, and `_PyObject_GC_Calloc` on Python 3.11 and up. [#3403](https://github.com/PyO3/pyo3/pull/3403)
+- Fix `ResourceWarning` and crashes related to GC when running with debug builds of CPython. [#3404](https://github.com/PyO3/pyo3/pull/3404)
+- Some-wrapping of `Option<T>` default arguments will no longer re-wrap `Some(T)` or expressions evaluating to `None`. [#3461](https://github.com/PyO3/pyo3/pull/3461)
+- Fix `IterNextOutput::Return` not returning a value on PyPy. [#3471](https://github.com/PyO3/pyo3/pull/3471)
+- Emit compile errors instead of ignoring macro invocations inside `#[pymethods]` blocks. [#3491](https://github.com/PyO3/pyo3/pull/3491)
+- Emit error on invalid arguments to `#[new]`, `#[classmethod]`, `#[staticmethod]`, and `#[classattr]`. [#3484](https://github.com/PyO3/pyo3/pull/3484)
+- Disable `PyMarshal_WriteObjectToString` from `PyMarshal_ReadObjectFromString` with the `abi3` feature. [#3490](https://github.com/PyO3/pyo3/pull/3490)
+- Fix FFI definitions for `_PyFrameEvalFunction` on Python 3.11 and up (it now receives a `_PyInterpreterFrame` opaque struct). [#3500](https://github.com/PyO3/pyo3/pull/3500)
+
+
+## [0.19.2] - 2023-08-01
+
+### Added
+
+- Add FFI definitions `PyState_AddModule`, `PyState_RemoveModule` and `PyState_FindModule` for PyPy 3.9 and up. [#3295](https://github.com/PyO3/pyo3/pull/3295)
+- Add FFI definitions `_PyObject_CallFunction_SizeT` and `_PyObject_CallMethod_SizeT`. [#3297](https://github.com/PyO3/pyo3/pull/3297)
+- Add a "performance" section to the guide collecting performance-related tricks and problems. [#3304](https://github.com/PyO3/pyo3/pull/3304)
+- Add `PyErr::Display` for all Python versions, and FFI symbol `PyErr_DisplayException` for Python 3.12. [#3334](https://github.com/PyO3/pyo3/pull/3334)
+- Add FFI definition `PyType_GetDict()` for Python 3.12. [#3339](https://github.com/PyO3/pyo3/pull/3339)
+- Add `PyAny::downcast_exact`. [#3346](https://github.com/PyO3/pyo3/pull/3346)
+- Add `PySlice::full()` to construct a full slice (`::`). [#3353](https://github.com/PyO3/pyo3/pull/3353)
+
+### Changed
+
+- Update `PyErr` for 3.12 betas to avoid deprecated ffi methods. [#3306](https://github.com/PyO3/pyo3/pull/3306)
+- Update FFI definitions of `object.h` for Python 3.12.0b4. [#3335](https://github.com/PyO3/pyo3/pull/3335)
+- Update `pyo3::ffi` struct definitions to be compatible with 3.12.0b4. [#3342](https://github.com/PyO3/pyo3/pull/3342)
+- Optimize conversion of `float` to `f64` (and `PyFloat::value`) on non-abi3 builds. [#3345](https://github.com/PyO3/pyo3/pull/3345)
+
+### Fixed
+
+- Fix timezone conversion bug for FixedOffset datetimes that were being incorrectly converted to and from UTC. [#3269](https://github.com/PyO3/pyo3/pull/3269)
+- Fix `SystemError` raised in `PyUnicodeDecodeError_Create` on PyPy 3.10. [#3297](https://github.com/PyO3/pyo3/pull/3297)
+- Correct FFI definition `Py_EnterRecursiveCall` to return `c_int` (was incorrectly returning `()`). [#3300](https://github.com/PyO3/pyo3/pull/3300)
+- Fix case where `PyErr::matches` and `PyErr::is_instance` returned results inconsistent with `PyErr::get_type`. [#3313](https://github.com/PyO3/pyo3/pull/3313)
+- Fix loss of panic message in `PanicException` when unwinding after the exception was "normalized". [#3326](https://github.com/PyO3/pyo3/pull/3326)
+- Fix `PyErr::from_value` and `PyErr::into_value` losing traceback on conversion. [#3328](https://github.com/PyO3/pyo3/pull/3328)
+- Fix reference counting of immortal objects on Python 3.12.0b4. [#3335](https://github.com/PyO3/pyo3/pull/3335)
+
+
+## [0.19.1] - 2023-07-03
+
+### Packaging
+
+- Extend range of supported versions of `hashbrown` optional dependency to include version 0.14 [#3258](https://github.com/PyO3/pyo3/pull/3258)
+- Extend range of supported versions of `indexmap` optional dependency to include version 2. [#3277](https://github.com/PyO3/pyo3/pull/3277)
+- Support PyPy 3.10. [#3289](https://github.com/PyO3/pyo3/pull/3289)
+
+### Added
+
+- Add `pyo3::types::PyFrozenSetBuilder` to allow building a `PyFrozenSet` item by item. [#3156](https://github.com/PyO3/pyo3/pull/3156)
+- Add support for converting to and from Python's `ipaddress.IPv4Address`/`ipaddress.IPv6Address` and `std::net::IpAddr`. [#3197](https://github.com/PyO3/pyo3/pull/3197)
+- Add support for `num-bigint` feature in combination with `abi3`. [#3198](https://github.com/PyO3/pyo3/pull/3198)
+- Add `PyErr_GetRaisedException()`, `PyErr_SetRaisedException()` to FFI definitions for Python 3.12 and later. [#3248](https://github.com/PyO3/pyo3/pull/3248)
+- Add `Python::with_pool` which is a safer but more limited alternative to `Python::new_pool`. [#3263](https://github.com/PyO3/pyo3/pull/3263)
+- Add `PyDict::get_item_with_error` on PyPy. [#3270](https://github.com/PyO3/pyo3/pull/3270)
+- Allow `#[new]` methods may to return `Py<Self>` in order to return existing instances. [#3287](https://github.com/PyO3/pyo3/pull/3287)
+
+### Fixed
+
+- Fix conversion of classes implementing `__complex__` to `Complex` when using `abi3` or PyPy. [#3185](https://github.com/PyO3/pyo3/pull/3185)
+- Stop suppressing unrelated exceptions in `PyAny::hasattr`. [#3271](https://github.com/PyO3/pyo3/pull/3271)
+- Fix memory leak when creating `PySet` or `PyFrozenSet` or returning types converted into these internally, e.g. `HashSet` or `BTreeSet`. [#3286](https://github.com/PyO3/pyo3/pull/3286)
+
+
+## [0.19.0] - 2023-05-31
+
+### Packaging
+
+- Correct dependency on syn to version 1.0.85 instead of the incorrect version 1.0.56. [#3152](https://github.com/PyO3/pyo3/pull/3152)
+
+### Added
+
+- Accept `text_signature` option (and automatically generate signature) for `#[new]` in `#[pymethods]`. [#2980](https://github.com/PyO3/pyo3/pull/2980)
+- Add support for converting to and from Python's `decimal.Decimal` and `rust_decimal::Decimal`. [#3016](https://github.com/PyO3/pyo3/pull/3016)
+- Add `#[pyo3(from_item_all)]` when deriving `FromPyObject` to specify `get_item` as getter for all fields. [#3120](https://github.com/PyO3/pyo3/pull/3120)
+- Add `pyo3::exceptions::PyBaseExceptionGroup` for Python 3.11, and corresponding FFI definition `PyExc_BaseExceptionGroup`. [#3141](https://github.com/PyO3/pyo3/pull/3141)
+- Accept `#[new]` with `#[classmethod]` to create a constructor which receives a (subtype's) class/`PyType` as its first argument. [#3157](https://github.com/PyO3/pyo3/pull/3157)
+- Add `PyClass::get` and `Py::get` for GIL-indepedent access to classes with `#[pyclass(frozen)]`. [#3158](https://github.com/PyO3/pyo3/pull/3158)
+- Add `PyAny::is_exact_instance` and `PyAny::is_exact_instance_of`. [#3161](https://github.com/PyO3/pyo3/pull/3161)
+
+### Changed
+
+- `PyAny::is_instance_of::<T>(obj)` is now equivalent to `T::is_type_of(obj)`, and now returns `bool` instead of `PyResult<bool>`. [#2881](https://github.com/PyO3/pyo3/pull/2881)
+- Deprecate `text_signature` option on `#[pyclass]` structs. [#2980](https://github.com/PyO3/pyo3/pull/2980)
+- No longer wrap `anyhow::Error`/`eyre::Report` containing a basic `PyErr` without a chain in a `PyRuntimeError`. [#3004](https://github.com/PyO3/pyo3/pull/3004)
+- - Change `#[getter]` and `#[setter]` to use a common call "trampoline" to slightly reduce generated code size and compile times. [#3029](https://github.com/PyO3/pyo3/pull/3029)
+- Improve default values for str, numbers and bool in automatically-generated `text_signature`. [#3050](https://github.com/PyO3/pyo3/pull/3050)
+- Improve default value for `None` in automatically-generated `text_signature`. [#3066](https://github.com/PyO3/pyo3/pull/3066)
+- Rename `PySequence::list` and `PySequence::tuple` to `PySequence::to_list` and `PySequence::to_tuple`. (The old names continue to exist as deprecated forms.) [#3111](https://github.com/PyO3/pyo3/pull/3111)
+- Extend the lifetime of the GIL token returned by `PyRef::py` and `PyRefMut::py` to match the underlying borrow. [#3131](https://github.com/PyO3/pyo3/pull/3131)
+- Safe access to the GIL, for example via `Python::with_gil`, is now locked inside of implementations of the `__traverse__` slot. [#3168](https://github.com/PyO3/pyo3/pull/3168)
+
+### Removed
+
+- Remove all functionality deprecated in PyO3 0.17, most prominently `Python::acquire_gil` is replaced by `Python::with_gil`. [#2981](https://github.com/PyO3/pyo3/pull/2981)
+
+### Fixed
+
+- Correct FFI definitions `PyGetSetDef`, `PyMemberDef`, `PyStructSequence_Field` and `PyStructSequence_Desc` to have `*const c_char` members for `name` and `doc` (not `*mut c_char`). [#3036](https://github.com/PyO3/pyo3/pull/3036)
+- Fix panic on `fmt::Display`, instead return `"<unprintable object>"` string and report error via `sys.unraisablehook()` [#3062](https://github.com/PyO3/pyo3/pull/3062)
+- Fix a compile error of "temporary value dropped while borrowed" when `#[pyfunction]`s take references into `#[pyclass]`es [#3142](https://github.com/PyO3/pyo3/pull/3142)
+- Fix crashes caused by PyO3 applying deferred reference count updates when entering a `__traverse__` implementation. [#3168](https://github.com/PyO3/pyo3/pull/3168)
+- Forbid running the `Drop` implementations of unsendable classes on other threads. [#3176](https://github.com/PyO3/pyo3/pull/3176)
+- Fix a compile error when `#[pymethods]` items come from somewhere else (for example, as a macro argument) and a custom receiver like `Py<Self>` is used. [#3178](https://github.com/PyO3/pyo3/pull/3178)
+
+
+## [0.18.3] - 2023-04-13
+
+### Added
+
+- Add `GILProtected<T>` to mediate concurrent access to a value using Python's global interpreter lock (GIL). [#2975](https://github.com/PyO3/pyo3/pull/2975)
+- Support `PyASCIIObject` / `PyUnicode` and associated methods on big-endian architectures. [#3015](https://github.com/PyO3/pyo3/pull/3015)
+- Add FFI definition `_PyDict_Contains_KnownHash()` for CPython 3.10 and up. [#3088](https://github.com/PyO3/pyo3/pull/3088)
+
+### Fixed
+
+- Fix compile error for `#[pymethods]` and `#[pyfunction]` called "output". [#3022](https://github.com/PyO3/pyo3/pull/3022)
+- Fix compile error in generated code for magic methods implemented as a `#[staticmethod]`. [#3055](https://github.com/PyO3/pyo3/pull/3055)
+- Fix `is_instance` for `PyDateTime` (would incorrectly check for a `PyDate`). [#3071](https://github.com/PyO3/pyo3/pull/3071)
+- Fix upstream deprecation of `PyUnicode_InternImmortal` since Python 3.10. [#3071](https://github.com/PyO3/pyo3/pull/3087)
+
+
+## [0.18.2] - 2023-03-24
+
+### Packaging
+
+- Disable default features of `chrono` to avoid depending on `time` v0.1.x. [#2939](https://github.com/PyO3/pyo3/pull/2939)
+
+### Added
+
+- Implement `IntoPy<PyObject>`, `ToPyObject` and `FromPyObject` for `Cow<[u8]>` to efficiently handle both `bytes` and `bytearray` objects. [#2899](https://github.com/PyO3/pyo3/pull/2899)
+- Implement `IntoPy<PyObject>`, `ToPyObject` and `FromPyObject` for `Cell<T>`. [#3014](https://github.com/PyO3/pyo3/pull/3014)
+- Add `PyList::to_tuple()`, as a convenient and efficient conversion from lists to tuples. [#3042](https://github.com/PyO3/pyo3/pull/3042)
+- Add `PyTuple::to_list()`, as a convenient and efficient conversion from tuples to lists. [#3044](https://github.com/PyO3/pyo3/pull/3044)
+
+### Changed
+
+- Optimize `PySequence` conversion for `list` and `tuple` inputs. [#2944](https://github.com/PyO3/pyo3/pull/2944)
+- Improve exception raised when creating `#[pyclass]` type object fails during module import. [#2947](https://github.com/PyO3/pyo3/pull/2947)
+- Optimize `PyMapping` conversion for `dict` inputs. [#2954](https://github.com/PyO3/pyo3/pull/2954)
+- Allow `create_exception!` to take a `dotted.module` to place the exception in a submodule. [#2979](https://github.com/PyO3/pyo3/pull/2979)
+
+### Fixed
+
+- Fix a reference counting race condition affecting `PyObject`s cloned in `allow_threads` blocks. [#2952](https://github.com/PyO3/pyo3/pull/2952)
+- Fix `clippy::redundant_closure` lint on default arguments in `#[pyo3(signature = (...))]` annotations. [#2990](https://github.com/PyO3/pyo3/pull/2990)
+- Fix `non_snake_case` lint on generated code in `#[pyfunction]` macro. [#2993](https://github.com/PyO3/pyo3/pull/2993)
+- Fix some FFI definitions for the upcoming PyPy 3.10 release. [#3031](https://github.com/PyO3/pyo3/pull/3031)
+
+
+## [0.18.1] - 2023-02-07
+
+### Added
+
+- Add `PyErr::write_unraisable()`. [#2889](https://github.com/PyO3/pyo3/pull/2889)
+- Add `Python::Ellipsis()` and `PyAny::is_ellipsis()` methods. [#2911](https://github.com/PyO3/pyo3/pull/2911)
+- Add `PyDict::update()` and `PyDict::update_if_missing()` methods. [#2912](https://github.com/PyO3/pyo3/pull/2912)
+
+### Changed
+
+- FFI definition `PyIter_Check` on CPython 3.7 is now implemented as `hasattr(type(obj), "__next__")`, which works correctly on all platforms and adds support for `abi3`. [#2914](https://github.com/PyO3/pyo3/pull/2914)
+- Warn about unknown config keys in `PYO3_CONFIG_FILE` instead of denying. [#2926](https://github.com/PyO3/pyo3/pull/2926)
+
+### Fixed
+
+- Send errors returned by `__releasebuffer__` to `sys.unraisablehook` rather than causing `SystemError`. [#2886](https://github.com/PyO3/pyo3/pull/2886)
+- Fix downcast to `PyIterator` succeeding for Python classes which did not implement `__next__`. [#2914](https://github.com/PyO3/pyo3/pull/2914)
+- Fix segfault in `__traverse__` when visiting `None` fields of `Option<T: AsPyPointer>`. [#2921](https://github.com/PyO3/pyo3/pull/2921)
+- Fix `#[pymethods(crate = "...")]` option being ignored. [#2923](https://github.com/PyO3/pyo3/pull/2923)
+- Link against `pythonXY_d.dll` for debug Python builds on Windows. [#2937](https://github.com/PyO3/pyo3/pull/2937)
+
+
+## [0.18.0] - 2023-01-17
+
+### Packaging
+
+- Relax `indexmap` optional depecency to allow `>= 1.6, < 2`. [#2849](https://github.com/PyO3/pyo3/pull/2849)
+- Relax `hashbrown` optional dependency to allow `>= 0.9, < 0.14`. [#2875](https://github.com/PyO3/pyo3/pull/2875)
+- Update `memoffset` dependency to 0.8. [#2875](https://github.com/PyO3/pyo3/pull/2875)
+
+### Added
+
+- Add `GILOnceCell::get_or_try_init` for fallible `GILOnceCell` initialization. [#2398](https://github.com/PyO3/pyo3/pull/2398)
+- Add experimental feature `experimental-inspect` with `type_input()` and `type_output()` helpers to get the Python type of any Python-compatible object. [#2490](https://github.com/PyO3/pyo3/pull/2490) [#2882](https://github.com/PyO3/pyo3/pull/2882)
+- The `#[pyclass]` macro can now take `get_all` and `set_all` to create getters and setters for every field. [#2692](https://github.com/PyO3/pyo3/pull/2692)
+- Add `#[pyo3(signature = (...))]` option for `#[pyfunction]` and `#[pymethods]`. [#2702](https://github.com/PyO3/pyo3/pull/2702)
+- `pyo3-build-config`: rebuild when `PYO3_ENVIRONMENT_SIGNATURE` environment variable value changes. [#2727](https://github.com/PyO3/pyo3/pull/2727)
+- Add conversions between non-zero int types in `std::num` and Python `int`. [#2730](https://github.com/PyO3/pyo3/pull/2730)
+- Add `Py::downcast()` as a companion to `PyAny::downcast()`, as well as `downcast_unchecked()` for both types. [#2734](https://github.com/PyO3/pyo3/pull/2734)
+- Add types for all built-in `Warning` classes as well as `PyErr::warn_explicit`. [#2742](https://github.com/PyO3/pyo3/pull/2742)
+- Add `abi3-py311` feature. [#2776](https://github.com/PyO3/pyo3/pull/2776)
+- Add FFI definition `_PyErr_ChainExceptions()` for CPython. [#2788](https://github.com/PyO3/pyo3/pull/2788)
+- Add FFI definitions `PyVectorcall_NARGS` and `PY_VECTORCALL_ARGUMENTS_OFFSET` for PyPy 3.8 and up. [#2811](https://github.com/PyO3/pyo3/pull/2811)
+- Add `PyList::get_item_unchecked` for PyPy. [#2827](https://github.com/PyO3/pyo3/pull/2827)
+
+### Changed
+
+- PyO3's macros now emit a much nicer error message if function return values don't implement the required trait(s). [#2664](https://github.com/PyO3/pyo3/pull/2664)
+- Use a TypeError, rather than a ValueError, when refusing to treat a str as a Vec. [#2685](https://github.com/PyO3/pyo3/pull/2685)
+- Change `PyCFunction::new_closure` to take `name` and `doc` arguments. [#2686](https://github.com/PyO3/pyo3/pull/2686)
+- `PyType::is_subclass`, `PyErr::is_instance` and `PyAny::is_instance` now take `&PyAny` instead of `&PyType` arguments, so that they work with objects that pretend to be types using `__subclasscheck__` and `__instancecheck__`. [#2695](https://github.com/PyO3/pyo3/pull/2695)
+- Deprecate `#[args]` attribute and passing "args" specification directly to `#[pyfunction]` in favor of the new `#[pyo3(signature = (...))]` option. [#2702](https://github.com/PyO3/pyo3/pull/2702)
+- Deprecate required arguments after `Option<T>` arguments to `#[pyfunction]` and `#[pymethods]` without also using `#[pyo3(signature)]` to specify whether the arguments should be required or have defaults. [#2703](https://github.com/PyO3/pyo3/pull/2703)
+- Change `#[pyfunction]` and `#[pymethods]` to use a common call "trampoline" to slightly reduce generated code size and compile times. [#2705](https://github.com/PyO3/pyo3/pull/2705)
+- `PyAny::cast_as()` and `Py::cast_as()` are now deprecated in favor of `PyAny::downcast()` and the new `Py::downcast()`. [#2734](https://github.com/PyO3/pyo3/pull/2734)
+- Relax lifetime bounds on `PyAny::downcast()`. [#2734](https://github.com/PyO3/pyo3/pull/2734)
+- Automatically generate `__text_signature__` for all Python functions created using `#[pyfunction]` and `#[pymethods]`. [#2784](https://github.com/PyO3/pyo3/pull/2784)
+- Accept any iterator in `PySet::new` and `PyFrozenSet::new`. [#2795](https://github.com/PyO3/pyo3/pull/2795)
+- Mixing `#[cfg(...)]` and `#[pyo3(...)]` attributes on `#[pyclass]` struct fields will now work. [#2796](https://github.com/PyO3/pyo3/pull/2796)
+- Re-enable `PyFunction` on when building for abi3 or PyPy. [#2838](https://github.com/PyO3/pyo3/pull/2838)
+- Improve `derive(FromPyObject)` to use `intern!` when applicable for `#[pyo3(item)]`. [#2879](https://github.com/PyO3/pyo3/pull/2879)
+
+### Removed
+
+- Remove the deprecated `pyproto` feature, `#[pyproto]` macro, and all accompanying APIs. [#2587](https://github.com/PyO3/pyo3/pull/2587)
+- Remove all functionality deprecated in PyO3 0.16. [#2843](https://github.com/PyO3/pyo3/pull/2843)
+
+### Fixed
+
+- Disable `PyModule::filename` on PyPy. [#2715](https://github.com/PyO3/pyo3/pull/2715)
+- `PyCodeObject` is now once again defined with fields on Python 3.7. [#2726](https://github.com/PyO3/pyo3/pull/2726)
+- Raise a `TypeError` if `#[new]` pymethods with no arguments receive arguments when called from Python. [#2749](https://github.com/PyO3/pyo3/pull/2749)
+- Use the `NOARGS` argument calling convention for methods that have a single `py: Python` argument (as a performance optimization). [#2760](https://github.com/PyO3/pyo3/pull/2760)
+- Fix truncation of `isize` values to `c_long` in `PySlice::new`. [#2769](https://github.com/PyO3/pyo3/pull/2769)
+- Fix soundness issue with FFI definition `PyUnicodeDecodeError_Create` on PyPy leading to indeterminate behavior (typically a `TypeError`). [#2772](https://github.com/PyO3/pyo3/pull/2772)
+- Allow functions taking `**kwargs` to accept keyword arguments which share a name with a positional-only argument (as permitted by PEP 570). [#2800](https://github.com/PyO3/pyo3/pull/2800)
+- Fix unresolved symbol for `PyObject_Vectorcall` on PyPy 3.9 and up. [#2811](https://github.com/PyO3/pyo3/pull/2811)
+- Fix memory leak in `PyCFunction::new_closure`. [#2842](https://github.com/PyO3/pyo3/pull/2842)
+
+
+## [0.17.3] - 2022-11-01
+
+### Packaging
+
+- Support Python 3.11. (Previous versions of PyO3 0.17 have been tested against Python 3.11 release candidates and are expected to be compatible, this is the first version tested against Python 3.11.0.) [#2708](https://github.com/PyO3/pyo3/pull/2708)
+
+### Added
+
+- Implemented `ExactSizeIterator` for `PyListIterator`, `PyDictIterator`, `PySetIterator` and `PyFrozenSetIterator`. [#2676](https://github.com/PyO3/pyo3/pull/2676)
+
+### Fixed
+
+- Fix regression of `impl FromPyObject for [T; N]` no longer accepting types passing `PySequence_Check`, e.g. NumPy arrays, since version 0.17.0. This the same fix that was applied `impl FromPyObject for Vec<T>` in version 0.17.1 extended to fixed-size arrays. [#2675](https://github.com/PyO3/pyo3/pull/2675)
+- Fix UB in `FunctionDescription::extract_arguments_fastcall` due to creating slices from a null pointer. [#2687](https://github.com/PyO3/pyo3/pull/2687)
+
+
+## [0.17.2] - 2022-10-04
+
+### Packaging
+
+- Added optional `chrono` feature to convert `chrono` types into types in the `datetime` module. [#2612](https://github.com/PyO3/pyo3/pull/2612)
+
+### Added
+
+- Add support for `num-bigint` feature on `PyPy`. [#2626](https://github.com/PyO3/pyo3/pull/2626)
+
+### Fixed
+
+- Correctly implement `__richcmp__` for enums, fixing `__ne__` returning always returning `True`. [#2622](https://github.com/PyO3/pyo3/pull/2622)
+- Fix compile error since 0.17.0 with `Option<&SomePyClass>` argument with a default. [#2630](https://github.com/PyO3/pyo3/pull/2630)
+- Fix regression of `impl FromPyObject for Vec<T>` no longer accepting types passing `PySequence_Check`, e.g. NumPy arrays, since 0.17.0. [#2631](https://github.com/PyO3/pyo3/pull/2631)
+
+## [0.17.1] - 2022-08-28
+
+### Fixed
+
+- Fix visibility of `PyDictItems`, `PyDictKeys`, and `PyDictValues` types added in PyO3 0.17.0.
+- Fix compile failure when using `#[pyo3(from_py_with = "...")]` attribute on an argument of type `Option<T>`. [#2592](https://github.com/PyO3/pyo3/pull/2592)
+- Fix clippy `redundant-closure` lint on `**kwargs` arguments for `#[pyfunction]` and `#[pymethods]`. [#2595](https://github.com/PyO3/pyo3/pull/2595)
+
+## [0.17.0] - 2022-08-23
+
+### Packaging
+
+- Update inventory dependency to `0.3` (the `multiple-pymethods` feature now requires Rust 1.62 for correctness). [#2492](https://github.com/PyO3/pyo3/pull/2492)
+
+### Added
+
+- Add `timezone_utc`. [#1588](https://github.com/PyO3/pyo3/pull/1588)
+- Implement `ToPyObject` for `[T; N]`. [#2313](https://github.com/PyO3/pyo3/pull/2313)
+- Add `PyDictKeys`, `PyDictValues` and `PyDictItems` Rust types. [#2358](https://github.com/PyO3/pyo3/pull/2358)
+- Add `append_to_inittab`. [#2377](https://github.com/PyO3/pyo3/pull/2377)
+- Add FFI definition `PyFrame_GetCode`. [#2406](https://github.com/PyO3/pyo3/pull/2406)
+- Add `PyCode` and `PyFrame` high level objects. [#2408](https://github.com/PyO3/pyo3/pull/2408)
+- Add FFI definitions `Py_fstring_input`, `sendfunc`, and `_PyErr_StackItem`. [#2423](https://github.com/PyO3/pyo3/pull/2423)
+- Add `PyDateTime::new_with_fold`, `PyTime::new_with_fold`, `PyTime::get_fold`, and `PyDateTime::get_fold` for PyPy. [#2428](https://github.com/PyO3/pyo3/pull/2428)
+- Add `#[pyclass(frozen)]`. [#2448](https://github.com/PyO3/pyo3/pull/2448)
+- Accept `#[pyo3(name)]` on enum variants. [#2457](https://github.com/PyO3/pyo3/pull/2457)
+- Add `CompareOp::matches` to implement `__richcmp__` as the result of a Rust `std::cmp::Ordering` comparison. [#2460](https://github.com/PyO3/pyo3/pull/2460)
+- Add `PySuper` type. [#2486](https://github.com/PyO3/pyo3/pull/2486)
+- Support PyPy on Windows with the `generate-import-lib` feature. [#2506](https://github.com/PyO3/pyo3/pull/2506)
+- Add FFI definitions `Py_EnterRecursiveCall` and `Py_LeaveRecursiveCall`. [#2511](https://github.com/PyO3/pyo3/pull/2511)
+- Add `PyDict::get_item_with_error`. [#2536](https://github.com/PyO3/pyo3/pull/2536)
+- Add `#[pyclass(sequence)]` option. [#2567](https://github.com/PyO3/pyo3/pull/2567)
+
+### Changed
+
+- Change datetime constructors taking a `tzinfo` to take `Option<&PyTzInfo>` instead of `Option<&PyObject>`: `PyDateTime::new`, `PyDateTime::new_with_fold`, `PyTime::new`, and `PyTime::new_with_fold`. [#1588](https://github.com/PyO3/pyo3/pull/1588)
+- Move `PyTypeObject::type_object` method to the `PyTypeInfo` trait, and deprecate the `PyTypeObject` trait. [#2287](https://github.com/PyO3/pyo3/pull/2287)
+- Methods of `Py` and `PyAny` now accept `impl IntoPy<Py<PyString>>` rather than just `&str` to allow use of the `intern!` macro. [#2312](https://github.com/PyO3/pyo3/pull/2312)
+- Change the deprecated `pyproto` feature to be opt-in instead of opt-out. [#2322](https://github.com/PyO3/pyo3/pull/2322)
+- Emit better error messages when `#[pyfunction]` return types do not implement `IntoPy`. [#2326](https://github.com/PyO3/pyo3/pull/2326)
+- Require `T: IntoPy` for `impl<T, const N: usize> IntoPy<PyObject> for [T; N]` instead of `T: ToPyObject`. [#2326](https://github.com/PyO3/pyo3/pull/2326)
+- Deprecate the `ToBorrowedObject` trait. [#2333](https://github.com/PyO3/pyo3/pull/2333)
+- Iterators over `PySet` and `PyDict` will now panic if the underlying collection is mutated during the iteration. [#2380](https://github.com/PyO3/pyo3/pull/2380)
+- Iterators over `PySet` and `PyDict` will now panic if the underlying collection is mutated during the iteration. [#2380](https://github.com/PyO3/pyo3/pull/2380)
+- Allow `#[classattr]` methods to be fallible. [#2385](https://github.com/PyO3/pyo3/pull/2385)
+- Prevent multiple `#[pymethods]` with the same name for a single `#[pyclass]`. [#2399](https://github.com/PyO3/pyo3/pull/2399)
+- Fixup `lib_name` when using `PYO3_CONFIG_FILE`. [#2404](https://github.com/PyO3/pyo3/pull/2404)
+- Add a message to the `ValueError` raised by the `#[derive(FromPyObject)]` implementation for a tuple struct. [#2414](https://github.com/PyO3/pyo3/pull/2414)
+- Allow `#[classattr]` methods to take `Python` argument. [#2456](https://github.com/PyO3/pyo3/pull/2456)
+- Rework `PyCapsule` type to resolve soundness issues: [#2485](https://github.com/PyO3/pyo3/pull/2485)
+  - `PyCapsule::new` and `PyCapsule::new_with_destructor` now take `name: Option<CString>` instead of `&CStr`.
+  - The destructor `F` in `PyCapsule::new_with_destructor` must now be `Send`.
+  - `PyCapsule::get_context` deprecated in favor of `PyCapsule::context` which doesn't take a `py: Python<'_>` argument.
+  - `PyCapsule::set_context` no longer takes a `py: Python<'_>` argument.
+  - `PyCapsule::name` now returns `PyResult<Option<&CStr>>` instead of `&CStr`.
+- `FromPyObject::extract` for `Vec<T>` no longer accepts Python `str` inputs. [#2500](https://github.com/PyO3/pyo3/pull/2500)
+- Ensure each `#[pymodule]` is only initialized once. [#2523](https://github.com/PyO3/pyo3/pull/2523)
+- `pyo3_build_config::add_extension_module_link_args` now also emits linker arguments for `wasm32-unknown-emscripten`. [#2538](https://github.com/PyO3/pyo3/pull/2538)
+- Type checks for `PySequence` and `PyMapping` now require inputs to inherit from (or register with) `collections.abc.Sequence` and `collections.abc.Mapping` respectively. [#2477](https://github.com/PyO3/pyo3/pull/2477)
+- Disable `PyFunction` on when building for abi3 or PyPy. [#2542](https://github.com/PyO3/pyo3/pull/2542)
+- Deprecate `Python::acquire_gil`. [#2549](https://github.com/PyO3/pyo3/pull/2549)
+
+### Removed
+
+- Remove all functionality deprecated in PyO3 0.15. [#2283](https://github.com/PyO3/pyo3/pull/2283)
+- Make the `Dict`, `WeakRef` and `BaseNativeType` members of the `PyClass` private implementation details. [#2572](https://github.com/PyO3/pyo3/pull/2572)
+
+### Fixed
+
+- Enable incorrectly disabled FFI definition `PyThreadState_DeleteCurrent`. [#2357](https://github.com/PyO3/pyo3/pull/2357)
+- Fix `wrap_pymodule` interactions with name resolution rules: it no longer "sees through" glob imports of `use submodule::*` when `submodule::submodule` is a `#[pymodule]`. [#2363](https://github.com/PyO3/pyo3/pull/2363)
+- Correct FFI definition `PyEval_EvalCodeEx` to take `*const *mut PyObject` array arguments instead of `*mut *mut PyObject`. [#2368](https://github.com/PyO3/pyo3/pull/2368)
+- Fix "raw-ident" structs (e.g. `#[pyclass] struct r#RawName`) incorrectly having `r#` at the start of the class name created in Python. [#2395](https://github.com/PyO3/pyo3/pull/2395)
+- Correct FFI definition `Py_tracefunc` to be `unsafe extern "C" fn` (was previously safe). [#2407](https://github.com/PyO3/pyo3/pull/2407)
+- Fix compile failure with `#[pyo3(from_py_with = "...")]` annotations on a field in a `#[derive(FromPyObject)]` struct. [#2414](https://github.com/PyO3/pyo3/pull/2414)
+- Fix FFI definitions `_PyDateTime_BaseTime` and `_PyDateTime_BaseDateTime` lacking leading underscores in their names. [#2421](https://github.com/PyO3/pyo3/pull/2421)
+- Remove FFI definition `PyArena` on Python 3.10 and up. [#2421](https://github.com/PyO3/pyo3/pull/2421)
+- Fix FFI definition `PyCompilerFlags` missing member `cf_feature_version` on Python 3.8 and up. [#2423](https://github.com/PyO3/pyo3/pull/2423)
+- Fix FFI definition `PyAsyncMethods` missing member `am_send` on Python 3.10 and up. [#2423](https://github.com/PyO3/pyo3/pull/2423)
+- Fix FFI definition `PyGenObject` having multiple incorrect members on various Python versions. [#2423](https://github.com/PyO3/pyo3/pull/2423)
+- Fix FFI definition `PySyntaxErrorObject` missing members `end_lineno` and `end_offset` on Python 3.10 and up. [#2423](https://github.com/PyO3/pyo3/pull/2423)
+- Fix FFI definition `PyHeapTypeObject` missing member `ht_module` on Python 3.9 and up. [#2423](https://github.com/PyO3/pyo3/pull/2423)
+- Fix FFI definition `PyFrameObject` having multiple incorrect members on various Python versions. [#2424](https://github.com/PyO3/pyo3/pull/2424) [#2434](https://github.com/PyO3/pyo3/pull/2434)
+- Fix FFI definition `PyTypeObject` missing deprecated field `tp_print` on Python 3.8. [#2428](https://github.com/PyO3/pyo3/pull/2428)
+- Fix FFI definitions `PyDateTime_CAPI`. `PyDateTime_Date`, `PyASCIIObject`, `PyBaseExceptionObject`, `PyListObject`, and `PyTypeObject` on PyPy. [#2428](https://github.com/PyO3/pyo3/pull/2428)
+- Fix FFI definition `_inittab` field `initfunc` typo'd as `initfun`. [#2431](https://github.com/PyO3/pyo3/pull/2431)
+- Fix FFI definitions `_PyDateTime_BaseTime` and `_PyDateTime_BaseDateTime` incorrectly having `fold` member. [#2432](https://github.com/PyO3/pyo3/pull/2432)
+- Fix FFI definitions `PyTypeObject`. `PyHeapTypeObject`, and `PyCFunctionObject` having incorrect members on PyPy 3.9. [#2433](https://github.com/PyO3/pyo3/pull/2433)
+- Fix FFI definition `PyGetSetDef` to have `*const c_char` for `doc` member (not `*mut c_char`). [#2439](https://github.com/PyO3/pyo3/pull/2439)
+- Fix `#[pyo3(from_py_with = "...")]` being ignored for 1-element tuple structs and transparent structs. [#2440](https://github.com/PyO3/pyo3/pull/2440)
+- Use `memoffset` to avoid UB when computing `PyCell` layout. [#2450](https://github.com/PyO3/pyo3/pull/2450)
+- Fix incorrect enum names being returned by the generated `repr` for enums renamed by `#[pyclass(name = "...")]` [#2457](https://github.com/PyO3/pyo3/pull/2457)
+- Fix `PyObject_CallNoArgs` incorrectly being available when building for abi3 on Python 3.9. [#2476](https://github.com/PyO3/pyo3/pull/2476)
+- Fix several clippy warnings generated by `#[pyfunction]` arguments. [#2503](https://github.com/PyO3/pyo3/pull/2503)
+
+## [0.16.6] - 2022-08-23
+
+### Changed
+
+- Fix soundness issues with `PyCapsule` type with select workarounds. Users are encourage to upgrade to PyO3 0.17 at their earliest convenience which contains API breakages which fix the issues in a long-term fashion. [#2522](https://github.com/PyO3/pyo3/pull/2522)
+  - `PyCapsule::new` and `PyCapsule::new_with_destructor` now take ownership of a copy of the `name` to resolve a possible use-after-free.
+  - `PyCapsule::name` now returns an empty `CStr` instead of dereferencing a null pointer if the capsule has no name.
+  - The destructor `F` in `PyCapsule::new_with_destructor` will never be called if the capsule is deleted from a thread other than the one which the capsule was created in (a warning will be emitted).
+- Panics during drop of panic payload caught by PyO3 will now abort. [#2544](https://github.com/PyO3/pyo3/pull/2544)
+
+## [0.16.5] - 2022-05-15
+
+### Added
+
+- Add an experimental `generate-import-lib` feature to support auto-generating non-abi3 python import libraries for Windows targets. [#2364](https://github.com/PyO3/pyo3/pull/2364)
+- Add FFI definition `Py_ExitStatusException`. [#2374](https://github.com/PyO3/pyo3/pull/2374)
+
+### Changed
+
+- Deprecate experimental `generate-abi3-import-lib` feature in favor of the new `generate-import-lib` feature. [#2364](https://github.com/PyO3/pyo3/pull/2364)
+
+### Fixed
+
+- Added missing `warn_default_encoding` field to `PyConfig` on 3.10+. The previously missing field could result in incorrect behavior or crashes. [#2370](https://github.com/PyO3/pyo3/pull/2370)
+- Fixed order of `pathconfig_warnings` and `program_name` fields of `PyConfig` on 3.10+. Previously, the order of the fields was swapped and this could lead to incorrect behavior or crashes. [#2370](https://github.com/PyO3/pyo3/pull/2370)
+
+## [0.16.4] - 2022-04-14
+
+### Added
+
+- Add `PyTzInfoAccess` trait for safe access to time zone information. [#2263](https://github.com/PyO3/pyo3/pull/2263)
+- Add an experimental `generate-abi3-import-lib` feature to auto-generate `python3.dll` import libraries for Windows. [#2282](https://github.com/PyO3/pyo3/pull/2282)
+- Add FFI definitions for `PyDateTime_BaseTime` and `PyDateTime_BaseDateTime`. [#2294](https://github.com/PyO3/pyo3/pull/2294)
+
+### Changed
+
+- Improved performance of failing calls to `FromPyObject::extract` which is common when functions accept multiple distinct types. [#2279](https://github.com/PyO3/pyo3/pull/2279)
+- Default to "m" ABI tag when choosing `libpython` link name for CPython 3.7 on Unix. [#2288](https://github.com/PyO3/pyo3/pull/2288)
+- Allow to compile "abi3" extensions without a working build host Python interpreter. [#2293](https://github.com/PyO3/pyo3/pull/2293)
+
+### Fixed
+
+- Crates depending on PyO3 can collect code coverage via LLVM instrumentation using stable Rust. [#2286](https://github.com/PyO3/pyo3/pull/2286)
+- Fix segfault when calling FFI methods `PyDateTime_DATE_GET_TZINFO` or `PyDateTime_TIME_GET_TZINFO` on `datetime` or `time` without a tzinfo. [#2289](https://github.com/PyO3/pyo3/pull/2289)
+- Fix directory names starting with the letter `n` breaking serialization of the interpreter configuration on Windows since PyO3 0.16.3. [#2299](https://github.com/PyO3/pyo3/pull/2299)
+
+## [0.16.3] - 2022-04-05
+
+### Packaging
+
+- Extend `parking_lot` dependency supported versions to include 0.12. [#2239](https://github.com/PyO3/pyo3/pull/2239)
+
+### Added
+
+- Add methods to `pyo3_build_config::InterpreterConfig` to run Python scripts using the configured executable. [#2092](https://github.com/PyO3/pyo3/pull/2092)
+- Add `as_bytes` method to `Py<PyBytes>`. [#2235](https://github.com/PyO3/pyo3/pull/2235)
+- Add FFI definitions for `PyType_FromModuleAndSpec`, `PyType_GetModule`, `PyType_GetModuleState` and `PyModule_AddType`. [#2250](https://github.com/PyO3/pyo3/pull/2250)
+- Add `pyo3_build_config::cross_compiling_from_to` as a helper to detect when PyO3 is cross-compiling. [#2253](https://github.com/PyO3/pyo3/pull/2253)
+- Add `#[pyclass(mapping)]` option to leave sequence slots empty in container implementations. [#2265](https://github.com/PyO3/pyo3/pull/2265)
+- Add `PyString::intern` to enable usage of the Python's built-in string interning. [#2268](https://github.com/PyO3/pyo3/pull/2268)
+- Add `intern!` macro which can be used to amortize the cost of creating Python strings by storing them inside a `GILOnceCell`. [#2269](https://github.com/PyO3/pyo3/pull/2269)
+- Add `PYO3_CROSS_PYTHON_IMPLEMENTATION` environment variable for selecting the default cross Python implementation. [#2272](https://github.com/PyO3/pyo3/pull/2272)
+
+### Changed
+
+- Allow `#[pyo3(crate = "...", text_signature = "...")]` options to be used directly in `#[pyclass(crate = "...", text_signature = "...")]`. [#2234](https://github.com/PyO3/pyo3/pull/2234)
+- Make `PYO3_CROSS_LIB_DIR` environment variable optional when cross compiling. [#2241](https://github.com/PyO3/pyo3/pull/2241)
+- Mark `METH_FASTCALL` calling convention as limited API on Python 3.10. [#2250](https://github.com/PyO3/pyo3/pull/2250)
+- Deprecate `pyo3_build_config::cross_compiling` in favor of `pyo3_build_config::cross_compiling_from_to`. [#2253](https://github.com/PyO3/pyo3/pull/2253)
+
+### Fixed
+
+- Fix `abi3-py310` feature: use Python 3.10 ABI when available instead of silently falling back to the 3.9 ABI. [#2242](https://github.com/PyO3/pyo3/pull/2242)
+- Use shared linking mode when cross compiling against a [Framework bundle](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html) for macOS. [#2233](https://github.com/PyO3/pyo3/pull/2233)
+- Fix panic during compilation when `PYO3_CROSS_LIB_DIR` is set for some host/target combinations. [#2232](https://github.com/PyO3/pyo3/pull/2232)
+- Correct dependency version for `syn` to require minimal patch version 1.0.56. [#2240](https://github.com/PyO3/pyo3/pull/2240)
+
+## [0.16.2] - 2022-03-15
+
+### Packaging
+
+- Warn when modules are imported on PyPy 3.7 versions older than PyPy 7.3.8, as they are known to have binary compatibility issues. [#2217](https://github.com/PyO3/pyo3/pull/2217)
+- Ensure build script of `pyo3-ffi` runs before that of `pyo3` to fix cross compilation. [#2224](https://github.com/PyO3/pyo3/pull/2224)
+
+## [0.16.1] - 2022-03-05
+
+### Packaging
+
+- Extend `hashbrown` optional dependency supported versions to include 0.12. [#2197](https://github.com/PyO3/pyo3/pull/2197)
+
+### Fixed
+
+- Fix incorrect platform detection for Windows in `pyo3-build-config`. [#2198](https://github.com/PyO3/pyo3/pull/2198)
+- Fix regression from 0.16 preventing cross compiling to aarch64 macOS. [#2201](https://github.com/PyO3/pyo3/pull/2201)
+
+## [0.16.0] - 2022-02-27
+
+### Packaging
+
+- Update MSRV to Rust 1.48. [#2004](https://github.com/PyO3/pyo3/pull/2004)
+- Update `indoc` optional dependency to 1.0. [#2004](https://github.com/PyO3/pyo3/pull/2004)
+- Drop support for Python 3.6, remove `abi3-py36` feature. [#2006](https://github.com/PyO3/pyo3/pull/2006)
+- `pyo3-build-config` no longer enables the `resolve-config` feature by default. [#2008](https://github.com/PyO3/pyo3/pull/2008)
+- Update `inventory` optional dependency to 0.2. [#2019](https://github.com/PyO3/pyo3/pull/2019)
+- Drop `paste` dependency. [#2081](https://github.com/PyO3/pyo3/pull/2081)
+- The bindings found in `pyo3::ffi` are now a re-export of a separate `pyo3-ffi` crate. [#2126](https://github.com/PyO3/pyo3/pull/2126)
+- Support PyPy 3.9. [#2143](https://github.com/PyO3/pyo3/pull/2143)
+
+### Added
+
+- Add `PyCapsule` type exposing the [Capsule API](https://docs.python.org/3/c-api/capsule.html#capsules). [#1980](https://github.com/PyO3/pyo3/pull/1980)
+- Add `pyo3_build_config::Sysconfigdata` and supporting APIs. [#1996](https://github.com/PyO3/pyo3/pull/1996)
+- Add `Py::setattr` method. [#2009](https://github.com/PyO3/pyo3/pull/2009)
+- Add `#[pyo3(crate = "some::path")]` option to all attribute macros (except the deprecated `#[pyproto]`). [#2022](https://github.com/PyO3/pyo3/pull/2022)
+- Enable `create_exception!` macro to take an optional docstring. [#2027](https://github.com/PyO3/pyo3/pull/2027)
+- Enable `#[pyclass]` for fieldless (aka C-like) enums. [#2034](https://github.com/PyO3/pyo3/pull/2034)
+- Add buffer magic methods `__getbuffer__` and `__releasebuffer__` to `#[pymethods]`. [#2067](https://github.com/PyO3/pyo3/pull/2067)
+- Add support for paths in `wrap_pyfunction` and `wrap_pymodule`. [#2081](https://github.com/PyO3/pyo3/pull/2081)
+- Enable `wrap_pyfunction!` to wrap a `#[pyfunction]` implemented in a different Rust module or crate. [#2091](https://github.com/PyO3/pyo3/pull/2091)
+- Add `PyAny::contains` method (`in` operator for `PyAny`). [#2115](https://github.com/PyO3/pyo3/pull/2115)
+- Add `PyMapping::contains` method (`in` operator for `PyMapping`). [#2133](https://github.com/PyO3/pyo3/pull/2133)
+- Add garbage collection magic magic methods `__traverse__` and `__clear__` to `#[pymethods]`. [#2159](https://github.com/PyO3/pyo3/pull/2159)
+- Add support for `from_py_with` on struct tuples and enums to override the default from-Python conversion. [#2181](https://github.com/PyO3/pyo3/pull/2181)
+- Add `eq`, `ne`, `lt`, `le`, `gt`, `ge` methods to `PyAny` that wrap `rich_compare`. [#2175](https://github.com/PyO3/pyo3/pull/2175)
+- Add `Py::is` and `PyAny::is` methods to check for object identity. [#2183](https://github.com/PyO3/pyo3/pull/2183)
+- Add support for the `__getattribute__` magic method. [#2187](https://github.com/PyO3/pyo3/pull/2187)
+
+### Changed
+
+- `PyType::is_subclass`, `PyErr::is_instance` and `PyAny::is_instance` now operate run-time type object instead of a type known at compile-time. The old behavior is still available as `PyType::is_subclass_of`, `PyErr::is_instance_of` and `PyAny::is_instance_of`.  [#1985](https://github.com/PyO3/pyo3/pull/1985)
+- Rename some methods on `PyErr` (the old names are just marked deprecated for now): [#2026](https://github.com/PyO3/pyo3/pull/2026)
+  - `pytype` -> `get_type`
+  - `pvalue` -> `value` (and deprecate equivalent `instance`)
+  - `ptraceback` -> `traceback`
+  - `from_instance` -> `from_value`
+  - `into_instance` -> `into_value`
+- `PyErr::new_type` now takes an optional docstring and now returns `PyResult<Py<PyType>>` rather than a `ffi::PyTypeObject` pointer. [#2027](https://github.com/PyO3/pyo3/pull/2027)
+- Deprecate `PyType::is_instance`; it is inconsistent with other `is_instance` methods in PyO3. Instead of `typ.is_instance(obj)`, use `obj.is_instance(typ)`. [#2031](https://github.com/PyO3/pyo3/pull/2031)
+- `__getitem__`, `__setitem__` and `__delitem__` in `#[pymethods]` now implement both a Python mapping and sequence by default. [#2065](https://github.com/PyO3/pyo3/pull/2065)
+- Improve performance and error messages for `#[derive(FromPyObject)]` for enums. [#2068](https://github.com/PyO3/pyo3/pull/2068)
+- Reduce generated LLVM code size (to improve compile times) for:
+  - internal `handle_panic` helper [#2074](https://github.com/PyO3/pyo3/pull/2074) [#2158](https://github.com/PyO3/pyo3/pull/2158)
+  - `#[pyfunction]` and `#[pymethods]` argument extraction [#2075](https://github.com/PyO3/pyo3/pull/2075) [#2085](https://github.com/PyO3/pyo3/pull/2085)
+  - `#[pyclass]` type object creation [#2076](https://github.com/PyO3/pyo3/pull/2076) [#2081](https://github.com/PyO3/pyo3/pull/2081) [#2157](https://github.com/PyO3/pyo3/pull/2157)
+- Respect Rust privacy rules for items wrapped with `wrap_pyfunction` and `wrap_pymodule`. [#2081](https://github.com/PyO3/pyo3/pull/2081)
+- Add modulo argument to `__ipow__` magic method. [#2083](https://github.com/PyO3/pyo3/pull/2083)
+- Fix FFI definition for `_PyCFunctionFast`. [#2126](https://github.com/PyO3/pyo3/pull/2126)
+- `PyDateTimeAPI` and `PyDateTime_TimeZone_UTC` are now unsafe functions instead of statics. [#2126](https://github.com/PyO3/pyo3/pull/2126)
+- `PyDateTimeAPI` does not implicitly call `PyDateTime_IMPORT` anymore to reflect the original Python API more closely. Before the first call to `PyDateTime_IMPORT` a null pointer is returned. Therefore before calling any of the following FFI functions `PyDateTime_IMPORT` must be called to avoid undefined behavior: [#2126](https://github.com/PyO3/pyo3/pull/2126)
+  - `PyDateTime_TimeZone_UTC`
+  - `PyDate_Check`
+  - `PyDate_CheckExact`
+  - `PyDateTime_Check`
+  - `PyDateTime_CheckExact`
+  - `PyTime_Check`
+  - `PyTime_CheckExact`
+  - `PyDelta_Check`
+  - `PyDelta_CheckExact`
+  - `PyTZInfo_Check`
+  - `PyTZInfo_CheckExact`
+  - `PyDateTime_FromTimestamp`
+  - `PyDate_FromTimestamp`
+- Deprecate the `gc` option for `pyclass` (e.g. `#[pyclass(gc)]`). Just implement a `__traverse__` `#[pymethod]`. [#2159](https://github.com/PyO3/pyo3/pull/2159)
+- The `ml_meth` field of `PyMethodDef` is now represented by the `PyMethodDefPointer` union. [2166](https://github.com/PyO3/pyo3/pull/2166)
+- Deprecate the `#[pyproto]` traits. [#2173](https://github.com/PyO3/pyo3/pull/2173)
+
+### Removed
+
+- Remove all functionality deprecated in PyO3 0.14. [#2007](https://github.com/PyO3/pyo3/pull/2007)
+- Remove `Default` impl for `PyMethodDef`. [#2166](https://github.com/PyO3/pyo3/pull/2166)
+- Remove `PartialEq` impl for `Py` and `PyAny` (use the new `is` instead). [#2183](https://github.com/PyO3/pyo3/pull/2183)
+
+### Fixed
+
+- Fix undefined symbol for `PyObject_HasAttr` on PyPy. [#2025](https://github.com/PyO3/pyo3/pull/2025)
+- Fix memory leak in `PyErr::into_value`. [#2026](https://github.com/PyO3/pyo3/pull/2026)
+- Fix clippy warning `needless-option-as-deref` in code generated by `#[pyfunction]` and `#[pymethods]`. [#2040](https://github.com/PyO3/pyo3/pull/2040)
+- Fix undefined behavior in `PySlice::indices`. [#2061](https://github.com/PyO3/pyo3/pull/2061)
+- Fix the `wrap_pymodule!` macro using the wrong name for a `#[pymodule]` with a `#[pyo3(name = "..")]` attribute. [#2081](https://github.com/PyO3/pyo3/pull/2081)
+- Fix magic methods in `#[pymethods]` accepting implementations with the wrong number of arguments. [#2083](https://github.com/PyO3/pyo3/pull/2083)
+- Fix panic in `#[pyfunction]` generated code when a required argument following an `Option` was not provided.  [#2093](https://github.com/PyO3/pyo3/pull/2093)
+- Fixed undefined behavior caused by incorrect `ExactSizeIterator` implementations. [#2124](https://github.com/PyO3/pyo3/pull/2124)
+- Fix missing FFI definition `PyCMethod_New` on Python 3.9 and up. [#2143](https://github.com/PyO3/pyo3/pull/2143)
+- Add missing FFI definitions `_PyLong_NumBits` and `_PyLong_AsByteArray` on PyPy. [#2146](https://github.com/PyO3/pyo3/pull/2146)
+- Fix memory leak in implementation of `AsPyPointer` for `Option<T>`. [#2160](https://github.com/PyO3/pyo3/pull/2160)
+- Fix FFI definition of `_PyLong_NumBits` to return `size_t` instead of `c_int`. [#2161](https://github.com/PyO3/pyo3/pull/2161)
+- Fix `TypeError` thrown when argument parsing failed missing the originating causes. [2177](https://github.com/PyO3/pyo3/pull/2178)
+
+## [0.15.2] - 2022-04-14
+
+### Packaging
+
+- Backport of PyPy 3.9 support from PyO3 0.16. [#2262](https://github.com/PyO3/pyo3/pull/2262)
+
+## [0.15.1] - 2021-11-19
+
+### Added
+
+- Add implementations for `Py::as_ref` and `Py::into_ref` for `Py<PySequence>`, `Py<PyIterator>` and `Py<PyMapping>`. [#1682](https://github.com/PyO3/pyo3/pull/1682)
+- Add `PyTraceback` type to represent and format Python tracebacks. [#1977](https://github.com/PyO3/pyo3/pull/1977)
+
+### Changed
+
+- `#[classattr]` constants with a known magic method name (which is lowercase) no longer trigger lint warnings expecting constants to be uppercase. [#1969](https://github.com/PyO3/pyo3/pull/1969)
+
+### Fixed
+
+- Fix creating `#[classattr]` by functions with the name of a known magic method. [#1969](https://github.com/PyO3/pyo3/pull/1969)
+- Fix use of `catch_unwind` in `allow_threads` which can cause fatal crashes. [#1989](https://github.com/PyO3/pyo3/pull/1989)
+- Fix build failure on PyPy when abi3 features are activated. [#1991](https://github.com/PyO3/pyo3/pull/1991)
+- Fix mingw platform detection. [#1993](https://github.com/PyO3/pyo3/pull/1993)
+- Fix panic in `__get__` implementation when accessing descriptor on type object. [#1997](https://github.com/PyO3/pyo3/pull/1997)
+
+## [0.15.0] - 2021-11-03
+
+### Packaging
+
+- `pyo3`'s `Cargo.toml` now advertises `links = "python"` to inform Cargo that it links against *libpython*. [#1819](https://github.com/PyO3/pyo3/pull/1819)
+- Added optional `anyhow` feature to convert `anyhow::Error` into `PyErr`. [#1822](https://github.com/PyO3/pyo3/pull/1822)
+- Support Python 3.10. [#1889](https://github.com/PyO3/pyo3/pull/1889)
+- Added optional `eyre` feature to convert `eyre::Report` into `PyErr`. [#1893](https://github.com/PyO3/pyo3/pull/1893)
+- Support PyPy 3.8. [#1948](https://github.com/PyO3/pyo3/pull/1948)
+
+### Added
+
+- Add `PyList::get_item_unchecked` and `PyTuple::get_item_unchecked` to get items without bounds checks. [#1733](https://github.com/PyO3/pyo3/pull/1733)
+- Support `#[doc = include_str!(...)]` attributes on Rust 1.54 and up. [#1746](https://github.com/PyO3/pyo3/issues/1746)
+- Add `PyAny::py` as a convenience for `PyNativeType::py`. [#1751](https://github.com/PyO3/pyo3/pull/1751)
+- Add implementation of `std::ops::Index<usize>` for `PyList`, `PyTuple` and `PySequence`. [#1825](https://github.com/PyO3/pyo3/pull/1825)
+- Add range indexing implementations of `std::ops::Index` for `PyList`, `PyTuple` and `PySequence`. [#1829](https://github.com/PyO3/pyo3/pull/1829)
+- Add `PyMapping` type to represent the Python mapping protocol. [#1844](https://github.com/PyO3/pyo3/pull/1844)
+- Add commonly-used sequence methods to `PyList` and `PyTuple`. [#1849](https://github.com/PyO3/pyo3/pull/1849)
+- Add `as_sequence` methods to `PyList` and `PyTuple`. [#1860](https://github.com/PyO3/pyo3/pull/1860)
+- Add support for magic methods in `#[pymethods]`, intended as a replacement for `#[pyproto]`. [#1864](https://github.com/PyO3/pyo3/pull/1864)
+- Add `abi3-py310` feature. [#1889](https://github.com/PyO3/pyo3/pull/1889)
+- Add `PyCFunction::new_closure` to create a Python function from a Rust closure. [#1901](https://github.com/PyO3/pyo3/pull/1901)
+- Add support for positional-only arguments in `#[pyfunction]`. [#1925](https://github.com/PyO3/pyo3/pull/1925)
+- Add `PyErr::take` to attempt to fetch a Python exception if present. [#1957](https://github.com/PyO3/pyo3/pull/1957)
+
+### Changed
+
+- `PyList`, `PyTuple` and `PySequence`'s APIs now accepts only `usize` indices instead of `isize`.
+  [#1733](https://github.com/PyO3/pyo3/pull/1733), [#1802](https://github.com/PyO3/pyo3/pull/1802),
+  [#1803](https://github.com/PyO3/pyo3/pull/1803)
+- `PyList::get_item` and `PyTuple::get_item` now return `PyResult<&PyAny>` instead of panicking. [#1733](https://github.com/PyO3/pyo3/pull/1733)
+- `PySequence::in_place_repeat` and `PySequence::in_place_concat` now return `PyResult<&PySequence>` instead of `PyResult<()>`, which is needed in case of immutable sequences such as tuples. [#1803](https://github.com/PyO3/pyo3/pull/1803)
+- `PySequence::get_slice` now returns `PyResult<&PySequence>` instead of `PyResult<&PyAny>`. [#1829](https://github.com/PyO3/pyo3/pull/1829)
+- Deprecate `PyTuple::split_from`. [#1804](https://github.com/PyO3/pyo3/pull/1804)
+- Deprecate `PyTuple::slice`, new method `PyTuple::get_slice` added with `usize` indices. [#1828](https://github.com/PyO3/pyo3/pull/1828)
+- Deprecate FFI definitions `PyParser_SimpleParseStringFlags`, `PyParser_SimpleParseStringFlagsFilename`, `PyParser_SimpleParseFileFlags` when building for Python 3.9. [#1830](https://github.com/PyO3/pyo3/pull/1830)
+- Mark FFI definitions removed in Python 3.10 `PyParser_ASTFromString`, `PyParser_ASTFromStringObject`, `PyParser_ASTFromFile`, `PyParser_ASTFromFileObject`, `PyParser_SimpleParseStringFlags`, `PyParser_SimpleParseStringFlagsFilename`, `PyParser_SimpleParseFileFlags`, `PyParser_SimpleParseString`, `PyParser_SimpleParseFile`, `Py_SymtableString`, and `Py_SymtableStringObject`. [#1830](https://github.com/PyO3/pyo3/pull/1830)
+- `#[pymethods]` now handles magic methods similarly to `#[pyproto]`. In the future, `#[pyproto]` may be deprecated. [#1864](https://github.com/PyO3/pyo3/pull/1864)
+- Deprecate FFI definitions `PySys_AddWarnOption`, `PySys_AddWarnOptionUnicode` and `PySys_HasWarnOptions`. [#1887](https://github.com/PyO3/pyo3/pull/1887)
+- Deprecate `#[call]` attribute in favor of using `fn __call__`. [#1929](https://github.com/PyO3/pyo3/pull/1929)
+- Fix missing FFI definition `_PyImport_FindExtensionObject` on Python 3.10. [#1942](https://github.com/PyO3/pyo3/pull/1942)
+- Change `PyErr::fetch` to panic in debug mode if no exception is present. [#1957](https://github.com/PyO3/pyo3/pull/1957)
+
+### Fixed
+
+- Fix building with a conda environment on Windows. [#1873](https://github.com/PyO3/pyo3/pull/1873)
+- Fix panic on Python 3.6 when calling `Python::with_gil` with Python initialized but threading not initialized. [#1874](https://github.com/PyO3/pyo3/pull/1874)
+- Fix incorrect linking to version-specific DLL instead of `python3.dll` when cross-compiling to Windows with `abi3`. [#1880](https://github.com/PyO3/pyo3/pull/1880)
+- Fix FFI definition for `PyTuple_ClearFreeList` incorrectly being present for Python 3.9 and up. [#1887](https://github.com/PyO3/pyo3/pull/1887)
+- Fix panic in generated `#[derive(FromPyObject)]` for enums. [#1888](https://github.com/PyO3/pyo3/pull/1888)
+- Fix cross-compiling to Python 3.7 builds with the "m" abi flag. [#1908](https://github.com/PyO3/pyo3/pull/1908)
+- Fix `__mod__` magic method fallback to `__rmod__`. [#1934](https://github.com/PyO3/pyo3/pull/1934).
+- Fix missing FFI definition `_PyImport_FindExtensionObject` on Python 3.10. [#1942](https://github.com/PyO3/pyo3/pull/1942)
+
+## [0.14.5] - 2021-09-05
+
+### Added
+
+- Make `pyo3_build_config::InterpreterConfig` and subfields public. [#1848](https://github.com/PyO3/pyo3/pull/1848)
+- Add `resolve-config` feature to the `pyo3-build-config` to control whether its build script does anything. [#1856](https://github.com/PyO3/pyo3/pull/1856)
+
+### Fixed
+
+- Fix 0.14.4 compile regression on `s390x-unknown-linux-gnu` target. [#1850](https://github.com/PyO3/pyo3/pull/1850)
+
+## [0.14.4] - 2021-08-29
+
+### Changed
+
+- Mark `PyString::data` as `unsafe` and disable it and some supporting PyUnicode FFI APIs (which depend on a C bitfield) on big-endian targets. [#1834](https://github.com/PyO3/pyo3/pull/1834)
+
+## [0.14.3] - 2021-08-22
+
+### Added
+
+- Add `PyString::data` to access the raw bytes stored in a Python string. [#1794](https://github.com/PyO3/pyo3/pull/1794)
+
+### Fixed
+
+- Raise `AttributeError` to avoid panic when calling `del` on a `#[setter]` defined class property. [#1779](https://github.com/PyO3/pyo3/pull/1779)
+- Restrict FFI definitions `PyGILState_Check` and `Py_tracefunc` to the unlimited API. [#1787](https://github.com/PyO3/pyo3/pull/1787)
+- Add missing `_type` field to `PyStatus` struct definition. [#1791](https://github.com/PyO3/pyo3/pull/1791)
+- Reduce lower bound `num-complex` optional dependency to support interop with `rust-numpy` and `ndarray` when building with the MSRV of 1.41 [#1799](https://github.com/PyO3/pyo3/pull/1799)
+- Fix memory leak in `Python::run_code`. [#1806](https://github.com/PyO3/pyo3/pull/1806)
+- Fix memory leak in `PyModule::from_code`. [#1810](https://github.com/PyO3/pyo3/pull/1810)
+- Remove use of `pyo3::` in `pyo3::types::datetime` which broke builds using `-Z avoid-dev-deps` [#1811](https://github.com/PyO3/pyo3/pull/1811)
+
+## [0.14.2] - 2021-08-09
+
+### Added
+
+- Add `indexmap` feature to add `ToPyObject`, `IntoPy` and `FromPyObject` implementations for `indexmap::IndexMap`. [#1728](https://github.com/PyO3/pyo3/pull/1728)
+- Add `pyo3_build_config::add_extension_module_link_args` to use in build scripts to set linker arguments (for macOS). [#1755](https://github.com/PyO3/pyo3/pull/1755)
+- Add `Python::with_gil_unchecked` unsafe variation of `Python::with_gil` to allow obtaining a `Python` in scenarios where `Python::with_gil` would fail. [#1769](https://github.com/PyO3/pyo3/pull/1769)
+
+### Changed
+
+- `PyErr::new` no longer acquires the Python GIL internally. [#1724](https://github.com/PyO3/pyo3/pull/1724)
+- Reverted PyO3 0.14.0's use of `cargo:rustc-cdylib-link-arg` in its build script, as Cargo unintentionally allowed crates to pass linker args to downstream crates in this way. Projects supporting macOS may need to restore `.cargo/config.toml` files. [#1755](https://github.com/PyO3/pyo3/pull/1755)
+
+### Fixed
+
+- Fix regression in 0.14.0 rejecting usage of `#[doc(hidden)]` on structs and functions annotated with PyO3 macros. [#1722](https://github.com/PyO3/pyo3/pull/1722)
+- Fix regression in 0.14.0 leading to incorrect code coverage being computed for `#[pyfunction]`s. [#1726](https://github.com/PyO3/pyo3/pull/1726)
+- Fix incorrect FFI definition of `Py_Buffer` on PyPy. [#1737](https://github.com/PyO3/pyo3/pull/1737)
+- Fix incorrect calculation of `dictoffset` on 32-bit Windows. [#1475](https://github.com/PyO3/pyo3/pull/1475)
+- Fix regression in 0.13.2 leading to linking to incorrect Python library on Windows "gnu" targets. [#1759](https://github.com/PyO3/pyo3/pull/1759)
+- Fix compiler warning: deny trailing semicolons in expression macro. [#1762](https://github.com/PyO3/pyo3/pull/1762)
+- Fix incorrect FFI definition of `Py_DecodeLocale`. The 2nd argument is now `*mut Py_ssize_t` instead of `Py_ssize_t`. [#1766](https://github.com/PyO3/pyo3/pull/1766)
+
+## [0.14.1] - 2021-07-04
+
+### Added
+
+- Implement `IntoPy<PyObject>` for `&PathBuf` and `&OsString`. [#1712](https://github.com/PyO3/pyo3/pull/1712)
+
+### Fixed
+
+- Fix crashes on PyPy due to incorrect definitions of `PyList_SET_ITEM`. [#1713](https://github.com/PyO3/pyo3/pull/1713)
+
+## [0.14.0] - 2021-07-03
+
+### Packaging
+
+- Update `num-bigint` optional dependency to 0.4. [#1481](https://github.com/PyO3/pyo3/pull/1481)
+- Update `num-complex` optional dependency to 0.4. [#1482](https://github.com/PyO3/pyo3/pull/1482)
+- Extend `hashbrown` optional dependency supported versions to include 0.11. [#1496](https://github.com/PyO3/pyo3/pull/1496)
+- Support PyPy 3.7. [#1538](https://github.com/PyO3/pyo3/pull/1538)
+
+### Added
+
+- Extend conversions for `[T; N]` to all `N` using const generics (on Rust 1.51 and up). [#1128](https://github.com/PyO3/pyo3/pull/1128)
+- Add conversions between `OsStr`/ `OsString` and Python strings. [#1379](https://github.com/PyO3/pyo3/pull/1379)
+- Add conversions between `Path`/ `PathBuf` and Python strings (and `pathlib.Path` objects). [#1379](https://github.com/PyO3/pyo3/pull/1379) [#1654](https://github.com/PyO3/pyo3/pull/1654)
+- Add a new set of `#[pyo3(...)]` attributes to control various PyO3 macro functionality:
+  - `#[pyo3(from_py_with = "...")]` function arguments and struct fields to override the default from-Python conversion. [#1411](https://github.com/PyO3/pyo3/pull/1411)
+  - `#[pyo3(name = "...")]` for setting Python names. [#1567](https://github.com/PyO3/pyo3/pull/1567)
+  - `#[pyo3(text_signature = "...")]` for setting text signature. [#1658](https://github.com/PyO3/pyo3/pull/1658)
+- Add FFI definition `PyCFunction_CheckExact` for Python 3.9 and later. [#1425](https://github.com/PyO3/pyo3/pull/1425)
+- Add FFI definition `Py_IS_TYPE`. [#1429](https://github.com/PyO3/pyo3/pull/1429)
+- Add FFI definition `_Py_InitializeMain`. [#1473](https://github.com/PyO3/pyo3/pull/1473)
+- Add FFI definitions from `cpython/import.h`.[#1475](https://github.com/PyO3/pyo3/pull/1475)
+- Add tuple and unit struct support for `#[pyclass]` macro. [#1504](https://github.com/PyO3/pyo3/pull/1504)
+- Add FFI definition `PyDateTime_TimeZone_UTC`. [#1572](https://github.com/PyO3/pyo3/pull/1572)
+- Add support for `#[pyclass(extends=Exception)]`. [#1591](https://github.com/PyO3/pyo3/pull/1591)
+- Add `PyErr::cause` and `PyErr::set_cause`. [#1679](https://github.com/PyO3/pyo3/pull/1679)
+- Add FFI definitions from `cpython/pystate.h`. [#1687](https://github.com/PyO3/pyo3/pull/1687/)
+- Add `wrap_pyfunction!` macro to `pyo3::prelude`. [#1695](https://github.com/PyO3/pyo3/pull/1695)
+
+### Changed
+
+- Allow only one `#[pymethods]` block per `#[pyclass]` by default, to remove the dependency on `inventory`. Add a `multiple-pymethods` feature to opt-in the original behavior and dependency on `inventory`. [#1457](https://github.com/PyO3/pyo3/pull/1457)
+- Change `PyTimeAccess::get_fold` to return a `bool` instead of a `u8`. [#1397](https://github.com/PyO3/pyo3/pull/1397)
+- Deprecate FFI definition `PyCFunction_Call` for Python 3.9 and up. [#1425](https://github.com/PyO3/pyo3/pull/1425)
+- Deprecate FFI definition `PyModule_GetFilename`. [#1425](https://github.com/PyO3/pyo3/pull/1425)
+- The `auto-initialize` feature is no longer enabled by default. [#1443](https://github.com/PyO3/pyo3/pull/1443)
+- Change `PyCFunction::new` and `PyCFunction::new_with_keywords` to take `&'static str` arguments rather than implicitly copying (and leaking) them. [#1450](https://github.com/PyO3/pyo3/pull/1450)
+- Deprecate `PyModule::call`, `PyModule::call0`, `PyModule::call1` and `PyModule::get`. [#1492](https://github.com/PyO3/pyo3/pull/1492)
+- Add length information to `PyBufferError`s raised from `PyBuffer::copy_to_slice` and `PyBuffer::copy_from_slice`. [#1534](https://github.com/PyO3/pyo3/pull/1534)
+- Automatically set `-undefined` and `dynamic_lookup` linker arguments on macOS with the `extension-module` feature. [#1539](https://github.com/PyO3/pyo3/pull/1539)
+- Deprecate `#[pyproto]` methods which are easier to implement as `#[pymethods]`: [#1560](https://github.com/PyO3/pyo3/pull/1560)
+  - `PyBasicProtocol::__bytes__` and `PyBasicProtocol::__format__`
+  - `PyContextProtocol::__enter__` and `PyContextProtocol::__exit__`
+  - `PyDescrProtocol::__delete__` and `PyDescrProtocol::__set_name__`
+  - `PyMappingProtocol::__reversed__`
+  - `PyNumberProtocol::__complex__` and `PyNumberProtocol::__round__`
+  - `PyAsyncProtocol::__aenter__` and `PyAsyncProtocol::__aexit__`
+- Deprecate several attributes in favor of the new `#[pyo3(...)]` options:
+  - `#[name = "..."]`, replaced by `#[pyo3(name = "...")]` [#1567](https://github.com/PyO3/pyo3/pull/1567)
+  - `#[pyfn(m, "name")]`, replaced by `#[pyfn(m)] #[pyo3(name = "...")]`. [#1610](https://github.com/PyO3/pyo3/pull/1610)
+  - `#[pymodule(name)]`, replaced by `#[pymodule] #[pyo3(name = "...")]` [#1650](https://github.com/PyO3/pyo3/pull/1650)
+  - `#[text_signature = "..."]`, replaced by `#[pyo3(text_signature = "...")]`. [#1658](https://github.com/PyO3/pyo3/pull/1658)
+- Reduce LLVM line counts to improve compilation times. [#1604](https://github.com/PyO3/pyo3/pull/1604)
+- No longer call `PyEval_InitThreads` in `#[pymodule]` init code. [#1630](https://github.com/PyO3/pyo3/pull/1630)
+- Use `METH_FASTCALL` argument passing convention, when possible, to improve `#[pyfunction]` and method performance.
+  [#1619](https://github.com/PyO3/pyo3/pull/1619), [#1660](https://github.com/PyO3/pyo3/pull/1660)
+- Filter sysconfigdata candidates by architecture when cross-compiling. [#1626](https://github.com/PyO3/pyo3/pull/1626)
+
+### Removed
+
+- Remove deprecated exception names `BaseException` etc. [#1426](https://github.com/PyO3/pyo3/pull/1426)
+- Remove deprecated methods `Python::is_instance`, `Python::is_subclass`, `Python::release`, `Python::xdecref`, and `Py::from_owned_ptr_or_panic`. [#1426](https://github.com/PyO3/pyo3/pull/1426)
+- Remove many FFI definitions which never existed in the Python C-API:
+  - (previously deprecated) `PyGetSetDef_INIT`, `PyGetSetDef_DICT`, `PyCoro_Check`, `PyCoroWrapper_Check`, and `PyAsyncGen_Check` [#1426](https://github.com/PyO3/pyo3/pull/1426)
+  - `PyMethodDef_INIT` [#1426](https://github.com/PyO3/pyo3/pull/1426)
+  - `PyTypeObject_INIT` [#1429](https://github.com/PyO3/pyo3/pull/1429)
+  - `PyObject_Check`, `PySuper_Check`, and `FreeFunc` [#1438](https://github.com/PyO3/pyo3/pull/1438)
+  - `PyModuleDef_INIT` [#1630](https://github.com/PyO3/pyo3/pull/1630)
+- Remove pyclass implementation details from `PyTypeInfo`:
+  - `Type`, `DESCRIPTION`, and `FLAGS` [#1456](https://github.com/PyO3/pyo3/pull/1456)
+  - `BaseType`, `BaseLayout`, `Layout`, `Initializer` [#1596](https://github.com/PyO3/pyo3/pull/1596)
+- Remove `PYO3_CROSS_INCLUDE_DIR` environment variable and the associated C header parsing functionality. [#1521](https://github.com/PyO3/pyo3/pull/1521)
+- Remove `raw_pycfunction!` macro. [#1619](https://github.com/PyO3/pyo3/pull/1619)
+- Remove `PyClassAlloc` trait. [#1657](https://github.com/PyO3/pyo3/pull/1657)
+- Remove `PyList::get_parked_item`. [#1664](https://github.com/PyO3/pyo3/pull/1664)
+
+### Fixed
+
+- Remove FFI definition `PyCFunction_ClearFreeList` for Python 3.9 and later. [#1425](https://github.com/PyO3/pyo3/pull/1425)
+- `PYO3_CROSS_LIB_DIR` environment variable no long required when compiling for x86-64 Python from macOS arm64 and reverse. [#1428](https://github.com/PyO3/pyo3/pull/1428)
+- Fix FFI definition `_PyEval_RequestCodeExtraIndex`, which took an argument of the wrong type. [#1429](https://github.com/PyO3/pyo3/pull/1429)
+- Fix FFI definition `PyIndex_Check` missing with the `abi3` feature. [#1436](https://github.com/PyO3/pyo3/pull/1436)
+- Fix incorrect `TypeError` raised when keyword-only argument passed along with a positional argument in `*args`. [#1440](https://github.com/PyO3/pyo3/pull/1440)
+- Fix inability to use a named lifetime for `&PyTuple` of `*args` in `#[pyfunction]`. [#1440](https://github.com/PyO3/pyo3/pull/1440)
+- Fix use of Python argument for `#[pymethods]` inside macro expansions. [#1505](https://github.com/PyO3/pyo3/pull/1505)
+- No longer include `__doc__` in `__all__` generated for `#[pymodule]`. [#1509](https://github.com/PyO3/pyo3/pull/1509)
+- Always use cross-compiling configuration if any of the `PYO3_CROSS` family of environment variables are set. [#1514](https://github.com/PyO3/pyo3/pull/1514)
+- Support `EnvironmentError`, `IOError`, and `WindowsError` on PyPy. [#1533](https://github.com/PyO3/pyo3/pull/1533)
+- Fix unnecessary rebuilds when cycling between `cargo check` and `cargo clippy` in a Python virtualenv. [#1557](https://github.com/PyO3/pyo3/pull/1557)
+- Fix segfault when dereferencing `ffi::PyDateTimeAPI` without the GIL. [#1563](https://github.com/PyO3/pyo3/pull/1563)
+- Fix memory leak in `FromPyObject` implementations for `u128` and `i128`. [#1638](https://github.com/PyO3/pyo3/pull/1638)
+- Fix `#[pyclass(extends=PyDict)]` leaking the dict contents on drop. [#1657](https://github.com/PyO3/pyo3/pull/1657)
+- Fix segfault when calling `PyList::get_item` with negative indices. [#1668](https://github.com/PyO3/pyo3/pull/1668)
+- Fix FFI definitions of `PyEval_SetProfile`/`PyEval_SetTrace` to take `Option<Py_tracefunc>` parameters. [#1692](https://github.com/PyO3/pyo3/pull/1692)
+- Fix `ToPyObject` impl for `HashSet` to accept non-default hashers. [#1702](https://github.com/PyO3/pyo3/pull/1702)
+
+## [0.13.2] - 2021-02-12
+
+### Packaging
+
+- Lower minimum supported Rust version to 1.41. [#1421](https://github.com/PyO3/pyo3/pull/1421)
+
+### Added
+
+- Add unsafe API `with_embedded_python_interpreter` to initialize a Python interpreter, execute a closure, and finalize the interpreter. [#1355](https://github.com/PyO3/pyo3/pull/1355)
+- Add `serde` feature which provides implementations of `Serialize` and `Deserialize` for `Py<T>`. [#1366](https://github.com/PyO3/pyo3/pull/1366)
+- Add FFI definition `_PyCFunctionFastWithKeywords` on Python 3.7 and up. [#1384](https://github.com/PyO3/pyo3/pull/1384)
+- Add `PyDateTime::new_with_fold` method. [#1398](https://github.com/PyO3/pyo3/pull/1398)
+- Add `size_hint` impls for `{PyDict,PyList,PySet,PyTuple}Iterator`s. [#1699](https://github.com/PyO3/pyo3/pull/1699)
+
+### Changed
+
+- `prepare_freethreaded_python` will no longer register an `atexit` handler to call `Py_Finalize`. This resolves a number of issues with incompatible C extensions causing crashes at finalization. [#1355](https://github.com/PyO3/pyo3/pull/1355)
+- Mark `PyLayout::py_init`, `PyClassDict::clear_dict`, and `opt_to_pyobj` safe, as they do not perform any unsafe operations. [#1404](https://github.com/PyO3/pyo3/pull/1404)
+
+### Fixed
+
+- Fix support for using `r#raw_idents` as argument names in pyfunctions. [#1383](https://github.com/PyO3/pyo3/pull/1383)
+- Fix typo in FFI definition for `PyFunction_GetCode` (was incorrectly `PyFunction_Code`). [#1387](https://github.com/PyO3/pyo3/pull/1387)
+- Fix FFI definitions `PyMarshal_WriteObjectToString` and `PyMarshal_ReadObjectFromString` as available in limited API. [#1387](https://github.com/PyO3/pyo3/pull/1387)
+- Fix FFI definitions `PyListObject` and those from `funcobject.h` as requiring non-limited API. [#1387](https://github.com/PyO3/pyo3/pull/1387)
+- Fix unqualified `Result` usage in `pyobject_native_type_base`. [#1402](https://github.com/PyO3/pyo3/pull/1402)
+- Fix build on systems where the default Python encoding is not UTF-8. [#1405](https://github.com/PyO3/pyo3/pull/1405)
+- Fix build on mingw / MSYS2. [#1423](https://github.com/PyO3/pyo3/pull/1423)
+
+## [0.13.1] - 2021-01-10
+
+### Added
+
+- Add support for `#[pyclass(dict)]` and `#[pyclass(weakref)]` with the `abi3` feature on Python 3.9 and up. [#1342](https://github.com/PyO3/pyo3/pull/1342)
+- Add FFI definitions `PyOS_BeforeFork`, `PyOS_AfterFork_Parent`, `PyOS_AfterFork_Child` for Python 3.7 and up. [#1348](https://github.com/PyO3/pyo3/pull/1348)
+- Add an `auto-initialize` feature to control whether PyO3 should automatically initialize an embedded Python interpreter. For compatibility this feature is enabled by default in PyO3 0.13.1, but is planned to become opt-in from PyO3 0.14.0. [#1347](https://github.com/PyO3/pyo3/pull/1347)
+- Add support for cross-compiling to Windows without needing `PYO3_CROSS_INCLUDE_DIR`. [#1350](https://github.com/PyO3/pyo3/pull/1350)
+
+### Deprecated
+
+- Deprecate FFI definitions `PyEval_CallObjectWithKeywords`, `PyEval_CallObject`, `PyEval_CallFunction`, `PyEval_CallMethod` when building for Python 3.9. [#1338](https://github.com/PyO3/pyo3/pull/1338)
+- Deprecate FFI definitions `PyGetSetDef_DICT` and `PyGetSetDef_INIT` which have never been in the Python API. [#1341](https://github.com/PyO3/pyo3/pull/1341)
+- Deprecate FFI definitions `PyGen_NeedsFinalizing`, `PyImport_Cleanup` (removed in 3.9), and `PyOS_InitInterrupts` (3.10). [#1348](https://github.com/PyO3/pyo3/pull/1348)
+- Deprecate FFI definition `PyOS_AfterFork` for Python 3.7 and up. [#1348](https://github.com/PyO3/pyo3/pull/1348)
+- Deprecate FFI definitions `PyCoro_Check`, `PyAsyncGen_Check`, and `PyCoroWrapper_Check`, which have never been in the Python API (for the first two, it is possible to use `PyCoro_CheckExact` and `PyAsyncGen_CheckExact` instead; these are the actual functions provided by the Python API). [#1348](https://github.com/PyO3/pyo3/pull/1348)
+- Deprecate FFI definitions for `PyUnicode_FromUnicode`, `PyUnicode_AsUnicode` and `PyUnicode_AsUnicodeAndSize`, which will be removed from 3.12 and up due to [PEP 623](https://www.python.org/dev/peps/pep-0623/). [#1370](https://github.com/PyO3/pyo3/pull/1370)
+
+### Removed
+
+- Remove FFI definition `PyFrame_ClearFreeList` when building for Python 3.9. [#1341](https://github.com/PyO3/pyo3/pull/1341)
+- Remove FFI definition `_PyDict_Contains` when building for Python 3.10. [#1341](https://github.com/PyO3/pyo3/pull/1341)
+- Remove FFI definitions `PyGen_NeedsFinalizing` and `PyImport_Cleanup` (for 3.9 and up), and `PyOS_InitInterrupts` (3.10). [#1348](https://github.com/PyO3/pyo3/pull/1348)
+
+### Fixed
+
+- Stop including `Py_TRACE_REFS` config setting automatically if `Py_DEBUG` is set on Python 3.8 and up. [#1334](https://github.com/PyO3/pyo3/pull/1334)
+- Remove `#[deny(warnings)]` attribute (and instead refuse warnings only in CI). [#1340](https://github.com/PyO3/pyo3/pull/1340)
+- Fix deprecation warning for missing `__module__` with `#[pyclass]`. [#1343](https://github.com/PyO3/pyo3/pull/1343)
+- Correct return type of `PyFrozenSet::empty` to `&PyFrozenSet` (was incorrectly `&PySet`). [#1351](https://github.com/PyO3/pyo3/pull/1351)
+- Fix missing `Py_INCREF` on heap type objects on Python versions before 3.8. [#1365](https://github.com/PyO3/pyo3/pull/1365)
+
+## [0.13.0] - 2020-12-22
+
+### Packaging
+
+- Drop support for Python 3.5 (as it is now end-of-life). [#1250](https://github.com/PyO3/pyo3/pull/1250)
+- Bump minimum supported Rust version to 1.45. [#1272](https://github.com/PyO3/pyo3/pull/1272)
+- Bump indoc dependency to 1.0. [#1272](https://github.com/PyO3/pyo3/pull/1272)
+- Bump paste dependency to 1.0. [#1272](https://github.com/PyO3/pyo3/pull/1272)
+- Rename internal crates `pyo3cls` and `pyo3-derive-backend` to `pyo3-macros` and `pyo3-macros-backend` respectively. [#1317](https://github.com/PyO3/pyo3/pull/1317)
+
+### Added
+
+- Add support for building for CPython limited API. Opting-in to the limited API enables a single extension wheel built with PyO3 to be installable on multiple Python versions. This required a few minor changes to runtime behavior of of PyO3 `#[pyclass]` types. See the migration guide for full details. [#1152](https://github.com/PyO3/pyo3/pull/1152)
+  - Add feature flags `abi3-py36`, `abi3-py37`, `abi3-py38` etc. to set the minimum Python version when using the limited API. [#1263](https://github.com/PyO3/pyo3/pull/1263)
+- Add argument names to `TypeError` messages generated by pymethod wrappers. [#1212](https://github.com/PyO3/pyo3/pull/1212)
+- Add FFI definitions for PEP 587 "Python Initialization Configuration". [#1247](https://github.com/PyO3/pyo3/pull/1247)
+- Add FFI definitions for `PyEval_SetProfile` and `PyEval_SetTrace`. [#1255](https://github.com/PyO3/pyo3/pull/1255)
+- Add FFI definitions for context.h functions (`PyContext_New`, etc). [#1259](https://github.com/PyO3/pyo3/pull/1259)
+- Add `PyAny::is_instance` method. [#1276](https://github.com/PyO3/pyo3/pull/1276)
+- Add support for conversion between `char` and `PyString`. [#1282](https://github.com/PyO3/pyo3/pull/1282)
+- Add FFI definitions for `PyBuffer_SizeFromFormat`, `PyObject_LengthHint`, `PyObject_CallNoArgs`, `PyObject_CallOneArg`, `PyObject_CallMethodNoArgs`, `PyObject_CallMethodOneArg`, `PyObject_VectorcallDict`, and `PyObject_VectorcallMethod`. [#1287](https://github.com/PyO3/pyo3/pull/1287)
+- Add conversions between `u128`/`i128` and `PyLong` for PyPy. [#1310](https://github.com/PyO3/pyo3/pull/1310)
+- Add `Python::version` and `Python::version_info` to get the running interpreter version. [#1322](https://github.com/PyO3/pyo3/pull/1322)
+- Add conversions for tuples of length 10, 11, and 12. [#1454](https://github.com/PyO3/pyo3/pull/1454)
+
+### Changed
+
+- Change return type of `PyType::name` from `Cow<str>` to `PyResult<&str>`. [#1152](https://github.com/PyO3/pyo3/pull/1152)
+- `#[pyclass(subclass)]` is now required for subclassing from Rust (was previously just required for subclassing from Python). [#1152](https://github.com/PyO3/pyo3/pull/1152)
+- Change `PyIterator` to be consistent with other native types: it is now used as `&PyIterator` instead of `PyIterator<'a>`. [#1176](https://github.com/PyO3/pyo3/pull/1176)
+- Change formatting of `PyDowncastError` messages to be closer to Python's builtin error messages. [#1212](https://github.com/PyO3/pyo3/pull/1212)
+- Change `Debug` and `Display` impls for `PyException` to be consistent with `PyAny`. [#1275](https://github.com/PyO3/pyo3/pull/1275)
+- Change `Debug` impl of `PyErr` to output more helpful information (acquiring the GIL if necessary). [#1275](https://github.com/PyO3/pyo3/pull/1275)
+- Rename `PyTypeInfo::is_instance` and `PyTypeInfo::is_exact_instance` to `PyTypeInfo::is_type_of` and `PyTypeInfo::is_exact_type_of`. [#1278](https://github.com/PyO3/pyo3/pull/1278)
+- Optimize `PyAny::call0`, `Py::call0` and `PyAny::call_method0` and `Py::call_method0` on Python 3.9 and up. [#1287](https://github.com/PyO3/pyo3/pull/1285)
+- Require double-quotes for pyclass name argument e.g `#[pyclass(name = "MyClass")]`. [#1303](https://github.com/PyO3/pyo3/pull/1303)
+
+### Deprecated
+
+- Deprecate `Python::is_instance`, `Python::is_subclass`, `Python::release`, and `Python::xdecref`. [#1292](https://github.com/PyO3/pyo3/pull/1292)
+
+### Removed
+
+- Remove deprecated ffi definitions `PyUnicode_AsUnicodeCopy`, `PyUnicode_GetMax`, `_Py_CheckRecursionLimit`, `PyObject_AsCharBuffer`, `PyObject_AsReadBuffer`, `PyObject_CheckReadBuffer` and `PyObject_AsWriteBuffer`, which will be removed in Python 3.10. [#1217](https://github.com/PyO3/pyo3/pull/1217)
+- Remove unused `python3` feature. [#1235](https://github.com/PyO3/pyo3/pull/1235)
+
+### Fixed
+
+- Fix missing field in `PyCodeObject` struct (`co_posonlyargcount`) - caused invalid access to other fields in Python >3.7. [#1260](https://github.com/PyO3/pyo3/pull/1260)
+- Fix building for `x86_64-unknown-linux-musl` target from `x86_64-unknown-linux-gnu` host. [#1267](https://github.com/PyO3/pyo3/pull/1267)
+- Fix `#[text_signature]` interacting badly with rust `r#raw_identifiers`. [#1286](https://github.com/PyO3/pyo3/pull/1286)
+- Fix FFI definitions for `PyObject_Vectorcall` and `PyVectorcall_Call`. [#1287](https://github.com/PyO3/pyo3/pull/1285)
+- Fix building with Anaconda python inside a virtualenv. [#1290](https://github.com/PyO3/pyo3/pull/1290)
+- Fix definition of opaque FFI types. [#1312](https://github.com/PyO3/pyo3/pull/1312)
+- Fix using custom error type in pyclass `#[new]` methods. [#1319](https://github.com/PyO3/pyo3/pull/1319)
+
+## [0.12.4] - 2020-11-28
+
+### Fixed
+
+- Fix reference count bug in implementation of `From<Py<T>>` for `PyObject`, a regression introduced in PyO3 0.12. [#1297](https://github.com/PyO3/pyo3/pull/1297)
+
+## [0.12.3] - 2020-10-12
+
+### Fixed
+
+- Fix support for Rust versions 1.39 to 1.44, broken by an incorrect internal update to paste 1.0 which was done in PyO3 0.12.2. [#1234](https://github.com/PyO3/pyo3/pull/1234)
+
+## [0.12.2] - 2020-10-12
+
+### Added
+
+- Add support for keyword-only arguments without default values in `#[pyfunction]`. [#1209](https://github.com/PyO3/pyo3/pull/1209)
+- Add `Python::check_signals` as a safe a wrapper for `PyErr_CheckSignals`. [#1214](https://github.com/PyO3/pyo3/pull/1214)
+
+### Fixed
+
+- Fix invalid document for protocol methods. [#1169](https://github.com/PyO3/pyo3/pull/1169)
+- Hide docs of PyO3 private implementation details in `pyo3::class::methods`. [#1169](https://github.com/PyO3/pyo3/pull/1169)
+- Fix unnecessary rebuild on PATH changes when the python interpreter is provided by PYO3_PYTHON. [#1231](https://github.com/PyO3/pyo3/pull/1231)
+
+## [0.12.1] - 2020-09-16
+
+### Fixed
+
+- Fix building for a 32-bit Python on 64-bit Windows with a 64-bit Rust toolchain. [#1179](https://github.com/PyO3/pyo3/pull/1179)
+- Fix building on platforms where `c_char` is `u8`. [#1182](https://github.com/PyO3/pyo3/pull/1182)
+
+## [0.12.0] - 2020-09-12
+
+### Added
+
+- Add FFI definitions `Py_FinalizeEx`, `PyOS_getsig`, and `PyOS_setsig`. [#1021](https://github.com/PyO3/pyo3/pull/1021)
+- Add `PyString::to_str` for accessing `PyString` as `&str`. [#1023](https://github.com/PyO3/pyo3/pull/1023)
+- Add `Python::with_gil` for executing a closure with the Python GIL. [#1037](https://github.com/PyO3/pyo3/pull/1037)
+- Add type information to failures in `PyAny::downcast`. [#1050](https://github.com/PyO3/pyo3/pull/1050)
+- Implement `Debug` for `PyIterator`. [#1051](https://github.com/PyO3/pyo3/pull/1051)
+- Add `PyBytes::new_with` and `PyByteArray::new_with` for initialising `bytes` and `bytearray` objects using a closure. [#1074](https://github.com/PyO3/pyo3/pull/1074)
+- Add `#[derive(FromPyObject)]` macro for enums and structs. [#1065](https://github.com/PyO3/pyo3/pull/1065)
+- Add `Py::as_ref` and `Py::into_ref` for converting `Py<T>` to `&T`. [#1098](https://github.com/PyO3/pyo3/pull/1098)
+- Add ability to return `Result` types other than `PyResult` from `#[pyfunction]`, `#[pymethod]` and `#[pyproto]` functions. [#1106](https://github.com/PyO3/pyo3/pull/1118).
+- Implement `ToPyObject`, `IntoPy`, and `FromPyObject` for [hashbrown](https://crates.io/crates/hashbrown)'s `HashMap` and `HashSet` types (requires the `hashbrown` feature). [#1114](https://github.com/PyO3/pyo3/pull/1114)
+- Add `#[pyfunction(pass_module)]` and `#[pyfn(pass_module)]` to pass the module object as the first function argument. [#1143](https://github.com/PyO3/pyo3/pull/1143)
+- Add `PyModule::add_function` and `PyModule::add_submodule` as typed alternatives to `PyModule::add_wrapped`. [#1143](https://github.com/PyO3/pyo3/pull/1143)
+- Add native `PyCFunction` and `PyFunction` types. [#1163](https://github.com/PyO3/pyo3/pull/1163)
+
+### Changed
+
+- Rework exception types: [#1024](https://github.com/PyO3/pyo3/pull/1024) [#1115](https://github.com/PyO3/pyo3/pull/1115)
+  - Rename exception types from e.g. `RuntimeError` to `PyRuntimeError`. The old names continue to exist but are deprecated.
+  - Exception objects are now accessible as `&T` or `Py<T>`, just like other Python-native types.
+  - Rename `PyException::py_err` to `PyException::new_err`.
+  - Rename `PyUnicodeDecodeErr::new_err` to `PyUnicodeDecodeErr::new`.
+  - Remove `PyStopIteration::stop_iteration`.
+- Require `T: Send` for the return value `T` of `Python::allow_threads`. [#1036](https://github.com/PyO3/pyo3/pull/1036)
+- Rename `PYTHON_SYS_EXECUTABLE` to `PYO3_PYTHON`. The old name will continue to work (undocumented) but will be removed in a future release. [#1039](https://github.com/PyO3/pyo3/pull/1039)
+- Remove `unsafe` from signature of `PyType::as_type_ptr`. [#1047](https://github.com/PyO3/pyo3/pull/1047)
+- Change return type of `PyIterator::from_object` to `PyResult<PyIterator>` (was `Result<PyIterator, PyDowncastError>`). [#1051](https://github.com/PyO3/pyo3/pull/1051)
+- `IntoPy` is no longer implied by `FromPy`. [#1063](https://github.com/PyO3/pyo3/pull/1063)
+- Change `PyObject` to be a type alias for `Py<PyAny>`. [#1063](https://github.com/PyO3/pyo3/pull/1063)
+- Rework `PyErr` to be compatible with the `std::error::Error` trait: [#1067](https://github.com/PyO3/pyo3/pull/1067) [#1115](https://github.com/PyO3/pyo3/pull/1115)
+  - Implement `Display`, `Error`, `Send` and `Sync` for `PyErr` and `PyErrArguments`.
+  - Add `PyErr::instance` for accessing `PyErr` as `&PyBaseException`.
+  - `PyErr`'s fields are now an implementation detail. The equivalent values can be accessed with `PyErr::ptype`, `PyErr::pvalue` and `PyErr::ptraceback`.
+  - Change receiver of `PyErr::print` and `PyErr::print_and_set_sys_last_vars` to `&self` (was `self`).
+  - Remove `PyErrValue`, `PyErr::from_value`, `PyErr::into_normalized`, and `PyErr::normalize`.
+  - Remove `PyException::into`.
+  - Remove `Into<PyResult<T>>` for `PyErr` and `PyException`.
+- Change methods generated by `#[pyproto]` to return `NotImplemented` if Python should try a reversed operation. #[1072](https://github.com/PyO3/pyo3/pull/1072)
+- Change argument to `PyModule::add` to `impl IntoPy<PyObject>` (was `impl ToPyObject`). #[1124](https://github.com/PyO3/pyo3/pull/1124)
+
+### Removed
+
+- Remove many exception and `PyErr` APIs; see the "changed" section above. [#1024](https://github.com/PyO3/pyo3/pull/1024) [#1067](https://github.com/PyO3/pyo3/pull/1067) [#1115](https://github.com/PyO3/pyo3/pull/1115)
+- Remove `PyString::to_string` (use new `PyString::to_str`). [#1023](https://github.com/PyO3/pyo3/pull/1023)
+- Remove `PyString::as_bytes`. [#1023](https://github.com/PyO3/pyo3/pull/1023)
+- Remove `Python::register_any`. [#1023](https://github.com/PyO3/pyo3/pull/1023)
+- Remove `GILGuard::acquire` from the public API. Use `Python::acquire_gil` or `Python::with_gil`. [#1036](https://github.com/PyO3/pyo3/pull/1036)
+- Remove the `FromPy` trait. [#1063](https://github.com/PyO3/pyo3/pull/1063)
+- Remove the `AsPyRef` trait. [#1098](https://github.com/PyO3/pyo3/pull/1098)
+
+### Fixed
+
+- Correct FFI definitions `Py_SetProgramName` and `Py_SetPythonHome` to take `*const` arguments (was `*mut`). [#1021](https://github.com/PyO3/pyo3/pull/1021)
+- Fix `FromPyObject` for `num_bigint::BigInt` for Python objects with an `__index__` method. [#1027](https://github.com/PyO3/pyo3/pull/1027)
+- Correct FFI definition `_PyLong_AsByteArray` to take `*mut c_uchar` argument (was `*const c_uchar`). [#1029](https://github.com/PyO3/pyo3/pull/1029)
+- Fix segfault with `#[pyclass(dict, unsendable)]`. [#1058](https://github.com/PyO3/pyo3/pull/1058) [#1059](https://github.com/PyO3/pyo3/pull/1059)
+- Fix using `&Self` as an argument type for functions in a `#[pymethods]` block. [#1071](https://github.com/PyO3/pyo3/pull/1071)
+- Fix best-effort build against PyPy 3.6. [#1092](https://github.com/PyO3/pyo3/pull/1092)
+- Fix many cases of lifetime elision in `#[pyproto]` implementations. [#1093](https://github.com/PyO3/pyo3/pull/1093)
+- Fix detection of Python build configuration when cross-compiling. [#1095](https://github.com/PyO3/pyo3/pull/1095)
+- Always link against libpython on android with the `extension-module` feature. [#1095](https://github.com/PyO3/pyo3/pull/1095)
+- Fix the `+` operator not trying `__radd__` when both `__add__` and `__radd__` are defined in `PyNumberProtocol` (and similar for all other reversible operators). [#1107](https://github.com/PyO3/pyo3/pull/1107)
+- Fix building with Anaconda python. [#1175](https://github.com/PyO3/pyo3/pull/1175)
+
+## [0.11.1] - 2020-06-30
+
+### Added
+
+- `#[pyclass(unsendable)]`. [#1009](https://github.com/PyO3/pyo3/pull/1009)
+
+### Changed
+
+- Update `parking_lot` dependency to `0.11`. [#1010](https://github.com/PyO3/pyo3/pull/1010)
+
+## [0.11.0] - 2020-06-28
+
+### Added
+
+- Support stable versions of Rust (>=1.39). [#969](https://github.com/PyO3/pyo3/pull/969)
+- Add FFI definition `PyObject_AsFileDescriptor`. [#938](https://github.com/PyO3/pyo3/pull/938)
+- Add `PyByteArray::data`, `PyByteArray::as_bytes`, and `PyByteArray::as_bytes_mut`. [#967](https://github.com/PyO3/pyo3/pull/967)
+- Add `GILOnceCell` to use in situations where `lazy_static` or `once_cell` can deadlock. [#975](https://github.com/PyO3/pyo3/pull/975)
+- Add `Py::borrow`, `Py::borrow_mut`, `Py::try_borrow`, and `Py::try_borrow_mut` for accessing `#[pyclass]` values. [#976](https://github.com/PyO3/pyo3/pull/976)
+- Add `IterNextOutput` and `IterANextOutput` for returning from `__next__` / `__anext__`. [#997](https://github.com/PyO3/pyo3/pull/997)
+
+### Changed
+
+- Simplify internals of `#[pyo3(get)]` attribute. (Remove the hidden API `GetPropertyValue`.) [#934](https://github.com/PyO3/pyo3/pull/934)
+- Call `Py_Finalize` at exit to flush buffers, etc. [#943](https://github.com/PyO3/pyo3/pull/943)
+- Add type parameter to PyBuffer. #[951](https://github.com/PyO3/pyo3/pull/951)
+- Require `Send` bound for `#[pyclass]`. [#966](https://github.com/PyO3/pyo3/pull/966)
+- Add `Python` argument to most methods on `PyObject` and `Py<T>` to ensure GIL safety. [#970](https://github.com/PyO3/pyo3/pull/970)
+- Change signature of `PyTypeObject::type_object` - now takes `Python` argument and returns `&PyType`. [#970](https://github.com/PyO3/pyo3/pull/970)
+- Change return type of `PyTuple::slice` and `PyTuple::split_from` from `Py<PyTuple>` to `&PyTuple`. [#970](https://github.com/PyO3/pyo3/pull/970)
+- Change return type of `PyTuple::as_slice` to `&[&PyAny]`. [#971](https://github.com/PyO3/pyo3/pull/971)
+- Rename `PyTypeInfo::type_object` to `type_object_raw`, and add `Python` argument. [#975](https://github.com/PyO3/pyo3/pull/975)
+- Update `num-complex` optional dependendency from `0.2` to `0.3`. [#977](https://github.com/PyO3/pyo3/pull/977)
+- Update `num-bigint` optional dependendency from `0.2` to `0.3`. [#978](https://github.com/PyO3/pyo3/pull/978)
+- `#[pyproto]` is re-implemented without specialization. [#961](https://github.com/PyO3/pyo3/pull/961)
+- `PyClassAlloc::alloc` is renamed to `PyClassAlloc::new`. [#990](https://github.com/PyO3/pyo3/pull/990)
+- `#[pyproto]` methods can now have return value `T` or `PyResult<T>` (previously only `PyResult<T>` was supported). [#996](https://github.com/PyO3/pyo3/pull/996)
+- `#[pyproto]` methods can now skip annotating the return type if it is `()`. [#998](https://github.com/PyO3/pyo3/pull/998)
+
+### Removed
+
+- Remove `ManagedPyRef` (unused, and needs specialization) [#930](https://github.com/PyO3/pyo3/pull/930)
+
+### Fixed
+
+- Fix passing explicit `None` to `Option<T>` argument `#[pyfunction]` with a default value. [#936](https://github.com/PyO3/pyo3/pull/936)
+- Fix `PyClass.__new__`'s not respecting subclasses when inherited by a Python class. [#990](https://github.com/PyO3/pyo3/pull/990)
+- Fix returning `Option<T>` from `#[pyproto]` methods. [#996](https://github.com/PyO3/pyo3/pull/996)
+- Fix accepting `PyRef<Self>` and `PyRefMut<Self>` to `#[getter]` and `#[setter]` methods. [#999](https://github.com/PyO3/pyo3/pull/999)
+
+## [0.10.1] - 2020-05-14
+
+### Fixed
+
+- Fix deadlock in `Python::acquire_gil` after dropping a `PyObject` or `Py<T>`. [#924](https://github.com/PyO3/pyo3/pull/924)
+
+## [0.10.0] - 2020-05-13
+
+### Added
+
+- Add FFI definition `_PyDict_NewPresized`. [#849](https://github.com/PyO3/pyo3/pull/849)
+- Implement `IntoPy<PyObject>` for `HashSet` and `BTreeSet`. [#864](https://github.com/PyO3/pyo3/pull/864)
+- Add `PyAny::dir` method. [#886](https://github.com/PyO3/pyo3/pull/886)
+- Gate macros behind a `macros` feature (enabled by default). [#897](https://github.com/PyO3/pyo3/pull/897)
+- Add ability to define class attributes using `#[classattr]` on functions in `#[pymethods]`. [#905](https://github.com/PyO3/pyo3/pull/905)
+- Implement `Clone` for `PyObject` and `Py<T>`. [#908](https://github.com/PyO3/pyo3/pull/908)
+- Implement `Deref<Target = PyAny>` for all builtin types. (`PyList`, `PyTuple`, `PyDict` etc.) [#911](https://github.com/PyO3/pyo3/pull/911)
+- Implement `Deref<Target = PyAny>` for `PyCell<T>`. [#911](https://github.com/PyO3/pyo3/pull/911)
+- Add `#[classattr]` support for associated constants in `#[pymethods]`. [#914](https://github.com/PyO3/pyo3/pull/914)
+
+### Changed
+
+- Panics will now be raised as a Python `PanicException`. [#797](https://github.com/PyO3/pyo3/pull/797)
+- Change `PyObject` and `Py<T>` reference counts to decrement immediately upon drop when the GIL is held. [#851](https://github.com/PyO3/pyo3/pull/851)
+- Allow `PyIterProtocol` methods to use either `PyRef` or `PyRefMut` as the receiver type. [#856](https://github.com/PyO3/pyo3/pull/856)
+- Change the implementation of `FromPyObject` for `Py<T>` to apply to a wider range of `T`, including all `T: PyClass`. [#880](https://github.com/PyO3/pyo3/pull/880)
+- Move all methods from the `ObjectProtocol` trait to the `PyAny` struct. [#911](https://github.com/PyO3/pyo3/pull/911)
+- Remove need for `#![feature(specialization)]` in crates depending on PyO3. [#917](https://github.com/PyO3/pyo3/pull/917)
+
+### Removed
+
+- Remove `PyMethodsProtocol` trait. [#889](https://github.com/PyO3/pyo3/pull/889)
+- Remove `num-traits` dependency. [#895](https://github.com/PyO3/pyo3/pull/895)
+- Remove `ObjectProtocol` trait. [#911](https://github.com/PyO3/pyo3/pull/911)
+- Remove `PyAny::None`. Users should use `Python::None` instead. [#911](https://github.com/PyO3/pyo3/pull/911)
+- Remove all `*ProtocolImpl` traits. [#917](https://github.com/PyO3/pyo3/pull/917)
+
+### Fixed
+
+- Fix support for `__radd__` and other `__r*__` methods as implementations for Python mathematical operators. [#839](https://github.com/PyO3/pyo3/pull/839)
+- Fix panics during garbage collection when traversing objects that were already mutably borrowed. [#855](https://github.com/PyO3/pyo3/pull/855)
+- Prevent `&'static` references to Python objects as arguments to `#[pyfunction]` and `#[pymethods]`. [#869](https://github.com/PyO3/pyo3/pull/869)
+- Fix lifetime safety bug with `AsPyRef::as_ref`. [#876](https://github.com/PyO3/pyo3/pull/876)
+- Fix `#[pyo3(get)]` attribute on `Py<T>` fields. [#880](https://github.com/PyO3/pyo3/pull/880)
+- Fix segmentation faults caused by functions such as `PyList::get_item` returning borrowed objects when it was not safe to do so. [#890](https://github.com/PyO3/pyo3/pull/890)
+- Fix segmentation faults caused by nested `Python::acquire_gil` calls creating dangling references. [#893](https://github.com/PyO3/pyo3/pull/893)
+- Fix segmentatation faults when a panic occurs during a call to `Python::allow_threads`. [#912](https://github.com/PyO3/pyo3/pull/912)
+
+## [0.9.2] - 2020-04-09
+
+### Added
+
+- `FromPyObject` implementations for `HashSet` and `BTreeSet`. [#842](https://github.com/PyO3/pyo3/pull/842)
+
+### Fixed
+
+- Correctly detect 32bit architecture. [#830](https://github.com/PyO3/pyo3/pull/830)
+
+## [0.9.1] - 2020-03-23
+
+### Fixed
+
+- Error messages for `#[pyclass]`. [#826](https://github.com/PyO3/pyo3/pull/826)
+- `FromPyObject` implementation for `PySequence`. [#827](https://github.com/PyO3/pyo3/pull/827)
+
+## [0.9.0] - 2020-03-19
+
+### Added
+
+- `PyCell`, which has RefCell-like features. [#770](https://github.com/PyO3/pyo3/pull/770)
+- `PyClass`, `PyLayout`, `PyClassInitializer`. [#683](https://github.com/PyO3/pyo3/pull/683)
+- Implemented `IntoIterator` for `PySet` and `PyFrozenSet`. [#716](https://github.com/PyO3/pyo3/pull/716)
+- `FromPyObject` is now automatically implemented for `T: Clone` pyclasses. [#730](https://github.com/PyO3/pyo3/pull/730)
+- `#[pyo3(get)]` and `#[pyo3(set)]` will now use the Rust doc-comment from the field for the Python property. [#755](https://github.com/PyO3/pyo3/pull/755)
+- `#[setter]` functions may now take an argument of `Pyo3::Python`. [#760](https://github.com/PyO3/pyo3/pull/760)
+- `PyTypeInfo::BaseLayout` and `PyClass::BaseNativeType`. [#770](https://github.com/PyO3/pyo3/pull/770)
+- `PyDowncastImpl`. [#770](https://github.com/PyO3/pyo3/pull/770)
+- Implement `FromPyObject` and `IntoPy<PyObject>` traits for arrays (up to 32). [#778](https://github.com/PyO3/pyo3/pull/778)
+- `migration.md` and `types.md` in the guide. [#795](https://github.com/PyO3/pyo3/pull/795), #[802](https://github.com/PyO3/pyo3/pull/802)
+- `ffi::{_PyBytes_Resize, _PyDict_Next, _PyDict_Contains, _PyDict_GetDictPtr}`. #[820](https://github.com/PyO3/pyo3/pull/820)
+
+### Changed
+
+- `#[new]` does not take `PyRawObject` and can return `Self`. [#683](https://github.com/PyO3/pyo3/pull/683)
+- The blanket implementations for `FromPyObject` for `&T` and `&mut T` are no longer specializable. Implement `PyTryFrom` for your type to control the behavior of `FromPyObject::extract` for your types. [#713](https://github.com/PyO3/pyo3/pull/713)
+- The implementation for `IntoPy<U> for T` where `U: FromPy<T>` is no longer specializable. Control the behavior of this via the implementation of `FromPy`. [#713](https://github.com/PyO3/pyo3/pull/713)
+- Use `parking_lot::Mutex` instead of `spin::Mutex`. [#734](https://github.com/PyO3/pyo3/pull/734)
+- Bumped minimum Rust version to `1.42.0-nightly 2020-01-21`. [#761](https://github.com/PyO3/pyo3/pull/761)
+- `PyRef` and `PyRefMut` are renewed for `PyCell`. [#770](https://github.com/PyO3/pyo3/pull/770)
+- Some new FFI functions for Python 3.8. [#784](https://github.com/PyO3/pyo3/pull/784)
+- `PyAny` is now on the top level module and prelude. [#816](https://github.com/PyO3/pyo3/pull/816)
+
+### Removed
+
+- `PyRawObject`. [#683](https://github.com/PyO3/pyo3/pull/683)
+- `PyNoArgsFunction`. [#741](https://github.com/PyO3/pyo3/pull/741)
+- `initialize_type`. To set the module name for a `#[pyclass]`, use the `module` argument to the macro. #[751](https://github.com/PyO3/pyo3/pull/751)
+- `AsPyRef::as_mut/with/with_mut/into_py/into_mut_py`. [#770](https://github.com/PyO3/pyo3/pull/770)
+- `PyTryFrom::try_from_mut/try_from_mut_exact/try_from_mut_unchecked`. [#770](https://github.com/PyO3/pyo3/pull/770)
+- `Python::mut_from_owned_ptr/mut_from_borrowed_ptr`. [#770](https://github.com/PyO3/pyo3/pull/770)
+- `ObjectProtocol::get_base/get_mut_base`. [#770](https://github.com/PyO3/pyo3/pull/770)
+
+### Fixed
+
+- Fixed unsoundness of subclassing. [#683](https://github.com/PyO3/pyo3/pull/683).
+- Clear error indicator when the exception is handled on the Rust side. [#719](https://github.com/PyO3/pyo3/pull/719)
+- Usage of raw identifiers with `#[pyo3(set)]`. [#745](https://github.com/PyO3/pyo3/pull/745)
+- Usage of `PyObject` with `#[pyo3(get)]`. [#760](https://github.com/PyO3/pyo3/pull/760)
+- `#[pymethods]` used in conjunction with `#[cfg]`. #[769](https://github.com/PyO3/pyo3/pull/769)
+- `"*"` in a `#[pyfunction()]` argument list incorrectly accepting any number of positional arguments (use `args = "*"` when this behavior is desired). #[792](https://github.com/PyO3/pyo3/pull/792)
+- `PyModule::dict`. #[809](https://github.com/PyO3/pyo3/pull/809)
+- Fix the case where `DESCRIPTION` is not null-terminated. #[822](https://github.com/PyO3/pyo3/pull/822)
+
+## [0.8.5] - 2020-01-05
+
+### Added
+
+- Implemented `FromPyObject` for `HashMap` and `BTreeMap`
+- Support for `#[name = "foo"]` attribute for `#[pyfunction]` and in `#[pymethods]`. [#692](https://github.com/PyO3/pyo3/pull/692)
+
+## [0.8.4] - 2019-12-14
+
+### Added
+
+- Support for `#[text_signature]` attribute. [#675](https://github.com/PyO3/pyo3/pull/675)
+
+## [0.8.3] - 2019-11-23
+
+### Removed
+
+- `#[init]` is removed. [#658](https://github.com/PyO3/pyo3/pull/658)
+
+### Fixed
+
+- Now all `&Py~` types have `!Send` bound. [#655](https://github.com/PyO3/pyo3/pull/655)
+- Fix a compile error raised by the stabilization of `!` type. [#672](https://github.com/PyO3/pyo3/issues/672).
+
+## [0.8.2] - 2019-10-27
+
+### Added
+
+- FFI compatibility for PEP 590 Vectorcall. [#641](https://github.com/PyO3/pyo3/pull/641)
+
+### Fixed
+
+- Fix PySequenceProtocol::set_item. [#624](https://github.com/PyO3/pyo3/pull/624)
+- Fix a corner case of BigInt::FromPyObject. [#630](https://github.com/PyO3/pyo3/pull/630)
+- Fix index errors in parameter conversion. [#631](https://github.com/PyO3/pyo3/pull/631)
+- Fix handling of invalid utf-8 sequences in `PyString::as_bytes`. [#639](https://github.com/PyO3/pyo3/pull/639)
+  and `PyString::to_string_lossy` [#642](https://github.com/PyO3/pyo3/pull/642).
+- Remove `__contains__` and `__iter__` from PyMappingProtocol. [#644](https://github.com/PyO3/pyo3/pull/644)
+- Fix proc-macro definition of PySetAttrProtocol. [#645](https://github.com/PyO3/pyo3/pull/645)
+
+## [0.8.1] - 2019-10-08
+
+### Added
+
+- Conversion between [num-bigint](https://github.com/rust-num/num-bigint) and Python int. [#608](https://github.com/PyO3/pyo3/pull/608)
+
+### Fixed
+
+- Make sure the right Python interpreter is used in OSX builds. [#604](https://github.com/PyO3/pyo3/pull/604)
+- Patch specialization being broken by Rust 1.40. [#614](https://github.com/PyO3/pyo3/issues/614)
+- Fix a segfault around PyErr. [#597](https://github.com/PyO3/pyo3/pull/597)
+
+## [0.8.0] - 2019-09-16
+
+### Added
+
+- `module` argument to `pyclass` macro. [#499](https://github.com/PyO3/pyo3/pull/499)
+- `py_run!` macro [#512](https://github.com/PyO3/pyo3/pull/512)
+- Use existing fields and methods before calling custom **getattr**. [#505](https://github.com/PyO3/pyo3/pull/505)
+- `PyBytes` can now be indexed just like `Vec<u8>`
+- Implement `IntoPy<PyObject>` for `PyRef` and `PyRefMut`.
+
+### Changed
+
+- Implementing the Using the `gc` parameter for `pyclass` (e.g. `#[pyclass(gc)]`) without implementing the `class::PyGCProtocol` trait is now a compile-time error. Failing to implement this trait could lead to segfaults. [#532](https://github.com/PyO3/pyo3/pull/532)
+- `PyByteArray::data` has been replaced with `PyDataArray::to_vec` because returning a `&[u8]` is unsound. (See [this comment](https://github.com/PyO3/pyo3/issues/373#issuecomment-512332696) for a great write-up for why that was unsound)
+- Replace `mashup` with `paste`.
+- `GILPool` gained a `Python` marker to prevent it from being misused to release Python objects without the GIL held.
+
+### Removed
+
+- `IntoPyObject` was replaced with `IntoPy<PyObject>`
+- `#[pyclass(subclass)]` is hidden a `unsound-subclass` feature because it's causing segmentation faults.
+
+### Fixed
+
+- More readable error message for generics in pyclass [#503](https://github.com/PyO3/pyo3/pull/503)
+
+## [0.7.0] - 2019-05-26
+
+### Added
+
+- PyPy support by omerbenamram in [#393](https://github.com/PyO3/pyo3/pull/393)
+- Have `PyModule` generate an index of its members (`__all__` list).
+- Allow `slf: PyRef<T>` for pyclass(#419)
+- Allow to use lifetime specifiers in `pymethods`
+- Add `marshal` module. [#460](https://github.com/PyO3/pyo3/pull/460)
+
+### Changed
+
+- `Python::run` returns `PyResult<()>` instead of `PyResult<&PyAny>`.
+- Methods decorated with `#[getter]` and `#[setter]` can now omit wrapping the
+  result type in `PyResult` if they don't raise exceptions.
+
+### Fixed
+
+- `type_object::PyTypeObject` has been marked unsafe because breaking the contract `type_object::PyTypeObject::init_type` can lead to UB.
+- Fixed automatic derive of `PySequenceProtocol` implementation in [#423](https://github.com/PyO3/pyo3/pull/423).
+- Capitalization & better wording to README.md.
+- Docstrings of properties is now properly set using the doc of the `#[getter]` method.
+- Fixed issues with `pymethods` crashing on doc comments containing double quotes.
+- `PySet::new` and `PyFrozenSet::new` now return `PyResult<&Py[Frozen]Set>`; exceptions are raised if
+  the items are not hashable.
+- Fixed building using `venv` on Windows.
+- `PyTuple::new` now returns `&PyTuple` instead of `Py<PyTuple>`.
+- Fixed several issues with argument parsing; notable, the `*args` and `**kwargs`
+  tuple/dict now doesn't contain arguments that are otherwise assigned to parameters.
+
+## [0.6.0] - 2019-03-28
+
+### Regressions
+
+- Currently, [#341](https://github.com/PyO3/pyo3/issues/341) causes `cargo test` to fail with weird linking errors when the `extension-module` feature is activated. For now you can work around this by making the `extension-module` feature optional and running the tests with `cargo test --no-default-features`:
+
+```toml
+[dependencies.pyo3]
+version = "0.6.0"
+
+[features]
+extension-module = ["pyo3/extension-module"]
+default = ["extension-module"]
+```
+
+### Added
+
+- Added a `wrap_pymodule!` macro similar to the existing `wrap_pyfunction!` macro. Only available on python 3
+- Added support for cross compiling (e.g. to arm v7) by mtp401 in [#327](https://github.com/PyO3/pyo3/pull/327). See the "Cross Compiling" section in the "Building and Distribution" chapter of the guide for more details.
+- The `PyRef` and `PyRefMut` types, which allow to differentiate between an instance of a rust struct on the rust heap and an instance that is embedded inside a python object. By kngwyu in [#335](https://github.com/PyO3/pyo3/pull/335)
+- Added `FromPy<T>` and `IntoPy<T>` which are equivalent to `From<T>` and `Into<T>` except that they require a gil token.
+- Added `ManagedPyRef`, which should eventually replace `ToBorrowedObject`.
+
+### Changed
+
+- Renamed `PyObjectRef` to `PyAny` in #388
+- Renamed `add_function` to `add_wrapped` as it now also supports modules.
+- Renamed `#[pymodinit]` to `#[pymodule]`
+- `py.init(|| value)` becomes `Py::new(value)`
+- `py.init_ref(|| value)` becomes `PyRef::new(value)`
+- `py.init_mut(|| value)` becomes `PyRefMut::new(value)`.
+- `PyRawObject::init` is now infallible, e.g. it returns `()` instead of `PyResult<()>`.
+- Renamed `py_exception!` to `create_exception!` and refactored the error macros.
+- Renamed `wrap_function!` to `wrap_pyfunction!`
+- Renamed `#[prop(get, set)]` to `#[pyo3(get, set)]`
+- `#[pyfunction]` now supports the same arguments as `#[pyfn()]`
+- Some macros now emit proper spanned errors instead of panics.
+- Migrated to the 2018 edition
+- `crate::types::exceptions` moved to `crate::exceptions`
+- Replace `IntoPyTuple` with `IntoPy<Py<PyTuple>>`.
+- `IntoPyPointer` and `ToPyPointer` moved into the crate root.
+- `class::CompareOp` moved into `class::basic::CompareOp`
+- PyTypeObject is now a direct subtrait PyTypeCreate, removing the old cyclical implementation in [#350](https://github.com/PyO3/pyo3/pull/350)
+- Add `PyList::{sort, reverse}` by chr1sj0nes in [#357](https://github.com/PyO3/pyo3/pull/357) and [#358](https://github.com/PyO3/pyo3/pull/358)
+- Renamed the `typeob` module to `type_object`
+
+### Removed
+
+- `PyToken` was removed due to unsoundness (See [#94](https://github.com/PyO3/pyo3/issues/94)).
+- Removed the unnecessary type parameter from `PyObjectAlloc`
+- `NoArgs`. Just use an empty tuple
+- `PyObjectWithGIL`. `PyNativeType` is sufficient now that PyToken is removed.
+
+### Fixed
+
+- A soudness hole where every instances of a `#[pyclass]` struct was considered to be part of a python object, even though you can create instances that are not part of the python heap. This was fixed through `PyRef` and `PyRefMut`.
+- Fix kwargs support in [#328](https://github.com/PyO3/pyo3/pull/328).
+- Add full support for `__dict__` in [#403](https://github.com/PyO3/pyo3/pull/403).
+
+## [0.5.3] - 2019-01-04
+
+### Fixed
+
+- Fix memory leak in ArrayList by kngwyu [#316](https://github.com/PyO3/pyo3/pull/316)
+
+## [0.5.2] - 2018-11-25
+
+### Fixed
+
+- Fix undeterministic segfaults when creating many objects by kngwyu in [#281](https://github.com/PyO3/pyo3/pull/281)
+
+## [0.5.1] - 2018-11-24
+
+Yanked
+
+## [0.5.0] - 2018-11-11
+
+### Added
+
+- `#[pyclass]` objects can now be returned from rust functions
+- `PyComplex` by kngwyu in [#226](https://github.com/PyO3/pyo3/pull/226)
+- `PyDict::from_sequence`, equivalent to `dict([(key, val), ...])`
+- Bindings for the `datetime` standard library types: `PyDate`, `PyTime`, `PyDateTime`, `PyTzInfo`, `PyDelta` with associated `ffi` types, by pganssle [#200](https://github.com/PyO3/pyo3/pull/200).
+- `PyString`, `PyUnicode`, and `PyBytes` now have an `as_bytes` method that returns `&[u8]`.
+- `PyObjectProtocol::get_type_ptr` by ijl in [#242](https://github.com/PyO3/pyo3/pull/242)
+
+### Changed
+
+- Removes the types from the root module and the prelude. They now live in `pyo3::types` instead.
+- All exceptions are constructed with `py_err` instead of `new`, as they return `PyErr` and not `Self`.
+- `as_mut` and friends take and `&mut self` instead of `&self`
+- `ObjectProtocol::call` now takes an `Option<&PyDict>` for the kwargs instead of an `IntoPyDictPointer`.
+- `IntoPyDictPointer` was replace by `IntoPyDict` which doesn't convert `PyDict` itself anymore and returns a `PyDict` instead of `*mut PyObject`.
+- `PyTuple::new` now takes an `IntoIterator` instead of a slice
+- Updated to syn 0.15
+- Splitted `PyTypeObject` into `PyTypeObject` without the create method and `PyTypeCreate` with requires `PyObjectAlloc<Self> + PyTypeInfo + Sized`.
+- Ran `cargo edition --fix` which prefixed path with `crate::` for rust 2018
+- Renamed `async` to `pyasync` as async will be a keyword in the 2018 edition.
+- Starting to use `NonNull<*mut PyObject>` for Py and PyObject by ijl [#260](https://github.com/PyO3/pyo3/pull/260)
+
+### Removed
+
+- Removed most entries from the prelude. The new prelude is small and clear.
+- Slowly removing specialization uses
+- `PyString`, `PyUnicode`, and `PyBytes` no longer have a `data` method
+  (replaced by `as_bytes`) and `PyStringData` has been removed.
+- The pyobject_extract macro
+
+### Fixed
+
+- Added an explanation that the GIL can temporarily be released even while holding a GILGuard.
+- Lots of clippy errors
+- Fix segfault on calling an unknown method on a PyObject
+- Work around a [bug](https://github.com/rust-lang/rust/issues/55380) in the rust compiler by kngwyu [#252](https://github.com/PyO3/pyo3/pull/252)
+- Fixed a segfault with subclassing pyo3 create classes and using `__class__` by kngwyu [#263](https://github.com/PyO3/pyo3/pull/263)
+
+## [0.4.1] - 2018-08-20
+
+### Changed
+
+- PyTryFrom's error is always to `PyDowncastError`
+
+### Fixed
+
+- Fixed compilation on nightly since `use_extern_macros` was stabilized
+
+### Removed
+
+- The pyobject_downcast macro
+
+## [0.4.0] - 2018-07-30
+
+### Changed
+
+- Merged both examples into one
+- Rustfmt all the things :heavy_check_mark:
+- Switched to [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+
+### Removed
+
+- Conversions from tuples to PyDict due to [rust-lang/rust#52050](https://github.com/rust-lang/rust/issues/52050)
+
+## [0.3.2] - 2018-07-22
+
+### Changed
+
+- Replaced `concat_idents` with mashup
+
+## [0.3.1] - 2018-07-18
+
+### Fixed
+
+- Fixed scoping bug in pyobject_native_type that would break rust-numpy
+
+## [0.3.0] - 2018-07-18
+
+### Added
+
+- A few internal macros became part of the public api ([#155](https://github.com/PyO3/pyo3/pull/155), [#186](https://github.com/PyO3/pyo3/pull/186))
+- Always clone in getters. This allows using the get-annotation on all Clone-Types
+
+### Changed
+
+- Upgraded to syn 0.14 which means much better error messages :tada:
+- 128 bit integer support by [kngwyu](https://github.com/kngwyu) ([#137](https://github.com/PyO3/pyo3/pull/173))
+- `proc_macro` has been stabilized on nightly ([rust-lang/rust#52081](https://github.com/rust-lang/rust/pull/52081)). This means that we can remove the `proc_macro` feature, but now we need the `use_extern_macros` from the 2018 edition instead.
+- All proc macro are now prefixed with `py` and live in the prelude. This means you can use `#[pyclass]`, `#[pymethods]`, `#[pyproto]`, `#[pyfunction]` and `#[pymodinit]` directly, at least after a `use pyo3::prelude::*`. They were also moved into a module called `proc_macro`. You shouldn't use `#[pyo3::proc_macro::pyclass]` or other longer paths in attributes because `proc_macro_path_invoc` isn't going to be stabilized soon.
+- Renamed the `base` option in the `pyclass` macro to `extends`.
+- `#[pymodinit]` uses the function name as module name, unless the name is overrriden with `#[pymodinit(name)]`
+- The guide is now properly versioned.
+
+## [0.2.7] - 2018-05-18
+
+### Fixed
+
+- Fix nightly breakage with proc_macro_path
+
+## [0.2.6] - 2018-04-03
+
+### Fixed
+
+- Fix compatibility with TryFrom trait #137
+
+## [0.2.5] - 2018-02-21
+
+### Added
+
+- CPython 3.7 support
+
+### Fixed
+
+- Embedded CPython 3.7b1 crashes on initialization #110
+- Generated extension functions are weakly typed #108
+- call_method\* crashes when the method does not exist #113
+- Allow importing exceptions from nested modules #116
+
+## [0.2.4] - 2018-01-19
+
+### Added
+
+- Allow to get mutable ref from PyObject #106
+- Drop `RefFromPyObject` trait
+- Add Python::register_any method
+
+### Fixed
+
+- Fix impl `FromPyObject` for `Py<T>`
+- Mark method that work with raw pointers as unsafe #95
+
+## [0.2.3] - 11-27-2017
+
+### Changed
+
+- Rustup to 1.23.0-nightly 2017-11-07
+
+### Fixed
+
+- Proper `c_char` usage #93
+
+### Removed
+
+- Remove use of now unneeded 'AsciiExt' trait
+
+## [0.2.2] - 09-26-2017
+
+### Changed
+
+- Rustup to 1.22.0-nightly 2017-09-30
+
+## [0.2.1] - 09-26-2017
+
+### Fixed
+
+- Fix rustc const_fn nightly breakage
+
+## [0.2.0] - 08-12-2017
+
+### Added
+
+- Added inheritance support #15
+- Added weakref support #56
+- Added subclass support #64
+- Added `self.__dict__` supoort #68
+- Added `pyo3::prelude` module #70
+- Better `Iterator` support for PyTuple, PyList, PyDict #75
+- Introduce IntoPyDictPointer similar to IntoPyTuple #69
+
+### Changed
+
+- Allow to add gc support without implementing PyGCProtocol #57
+- Refactor `PyErr` implementation. Drop `py` parameter from constructor.
+
+## [0.1.0] - 07-23-2017
+
+### Added
+
+- Initial release
+
+[Unreleased]: https://github.com/pyo3/pyo3/compare/v0.22.2...HEAD
+[0.22.2]: https://github.com/pyo3/pyo3/compare/v0.22.1...v0.22.2
+[0.22.1]: https://github.com/pyo3/pyo3/compare/v0.22.0...v0.22.1
+[0.22.0]: https://github.com/pyo3/pyo3/compare/v0.21.2...v0.22.0
+[0.21.2]: https://github.com/pyo3/pyo3/compare/v0.21.1...v0.21.2
+[0.21.1]: https://github.com/pyo3/pyo3/compare/v0.21.0...v0.21.1
+[0.21.0]: https://github.com/pyo3/pyo3/compare/v0.20.3...v0.21.0
+[0.21.0-beta.0]: https://github.com/pyo3/pyo3/compare/v0.20.3...v0.21.0-beta.0
+[0.20.3]: https://github.com/pyo3/pyo3/compare/v0.20.2...v0.20.3
+[0.20.2]: https://github.com/pyo3/pyo3/compare/v0.20.1...v0.20.2
+[0.20.1]: https://github.com/pyo3/pyo3/compare/v0.20.0...v0.20.1
+[0.20.0]: https://github.com/pyo3/pyo3/compare/v0.19.2...v0.20.0
+[0.19.2]: https://github.com/pyo3/pyo3/compare/v0.19.1...v0.19.2
+[0.19.1]: https://github.com/pyo3/pyo3/compare/v0.19.0...v0.19.1
+[0.19.0]: https://github.com/pyo3/pyo3/compare/v0.18.3...v0.19.0
+[0.18.3]: https://github.com/pyo3/pyo3/compare/v0.18.2...v0.18.3
+[0.18.2]: https://github.com/pyo3/pyo3/compare/v0.18.1...v0.18.2
+[0.18.1]: https://github.com/pyo3/pyo3/compare/v0.18.0...v0.18.1
+[0.18.0]: https://github.com/pyo3/pyo3/compare/v0.17.3...v0.18.0
+[0.17.3]: https://github.com/pyo3/pyo3/compare/v0.17.2...v0.17.3
+[0.17.2]: https://github.com/pyo3/pyo3/compare/v0.17.1...v0.17.2
+[0.17.1]: https://github.com/pyo3/pyo3/compare/v0.17.0...v0.17.1
+[0.17.0]: https://github.com/pyo3/pyo3/compare/v0.16.6...v0.17.0
+[0.16.6]: https://github.com/pyo3/pyo3/compare/v0.16.5...v0.16.6
+[0.16.5]: https://github.com/pyo3/pyo3/compare/v0.16.4...v0.16.5
+[0.16.4]: https://github.com/pyo3/pyo3/compare/v0.16.3...v0.16.4
+[0.16.3]: https://github.com/pyo3/pyo3/compare/v0.16.2...v0.16.3
+[0.16.2]: https://github.com/pyo3/pyo3/compare/v0.16.1...v0.16.2
+[0.16.1]: https://github.com/pyo3/pyo3/compare/v0.16.0...v0.16.1
+[0.16.0]: https://github.com/pyo3/pyo3/compare/v0.15.1...v0.16.0
+[0.15.2]: https://github.com/pyo3/pyo3/compare/v0.15.1...v0.15.2
+[0.15.1]: https://github.com/pyo3/pyo3/compare/v0.15.0...v0.15.1
+[0.15.0]: https://github.com/pyo3/pyo3/compare/v0.14.5...v0.15.0
+[0.14.5]: https://github.com/pyo3/pyo3/compare/v0.14.4...v0.14.5
+[0.14.4]: https://github.com/pyo3/pyo3/compare/v0.14.3...v0.14.4
+[0.14.3]: https://github.com/pyo3/pyo3/compare/v0.14.2...v0.14.3
+[0.14.2]: https://github.com/pyo3/pyo3/compare/v0.14.1...v0.14.2
+[0.14.1]: https://github.com/pyo3/pyo3/compare/v0.14.0...v0.14.1
+[0.14.0]: https://github.com/pyo3/pyo3/compare/v0.13.2...v0.14.0
+[0.13.2]: https://github.com/pyo3/pyo3/compare/v0.13.1...v0.13.2
+[0.13.1]: https://github.com/pyo3/pyo3/compare/v0.13.0...v0.13.1
+[0.13.0]: https://github.com/pyo3/pyo3/compare/v0.12.4...v0.13.0
+[0.12.4]: https://github.com/pyo3/pyo3/compare/v0.12.3...v0.12.4
+[0.12.3]: https://github.com/pyo3/pyo3/compare/v0.12.2...v0.12.3
+[0.12.2]: https://github.com/pyo3/pyo3/compare/v0.12.1...v0.12.2
+[0.12.1]: https://github.com/pyo3/pyo3/compare/v0.12.0...v0.12.1
+[0.12.0]: https://github.com/pyo3/pyo3/compare/v0.11.1...v0.12.0
+[0.11.1]: https://github.com/pyo3/pyo3/compare/v0.11.0...v0.11.1
+[0.11.0]: https://github.com/pyo3/pyo3/compare/v0.10.1...v0.11.0
+[0.10.1]: https://github.com/pyo3/pyo3/compare/v0.10.0...v0.10.1
+[0.10.0]: https://github.com/pyo3/pyo3/compare/v0.9.2...v0.10.0
+[0.9.2]: https://github.com/pyo3/pyo3/compare/v0.9.1...v0.9.2
+[0.9.1]: https://github.com/pyo3/pyo3/compare/v0.9.0...v0.9.1
+[0.9.0]: https://github.com/pyo3/pyo3/compare/v0.8.5...v0.9.0
+[0.8.5]: https://github.com/pyo3/pyo3/compare/v0.8.4...v0.8.5
+[0.8.4]: https://github.com/pyo3/pyo3/compare/v0.8.3...v0.8.4
+[0.8.3]: https://github.com/pyo3/pyo3/compare/v0.8.2...v0.8.3
+[0.8.2]: https://github.com/pyo3/pyo3/compare/v0.8.1...v0.8.2
+[0.8.1]: https://github.com/pyo3/pyo3/compare/v0.8.0...v0.8.1
+[0.8.0]: https://github.com/pyo3/pyo3/compare/v0.7.0...v0.8.0
+[0.7.0]: https://github.com/pyo3/pyo3/compare/v0.6.0...v0.7.0
+[0.6.0]: https://github.com/pyo3/pyo3/compare/v0.5.3...v0.6.0
+[0.5.3]: https://github.com/pyo3/pyo3/compare/v0.5.2...v0.5.3
+[0.5.2]: https://github.com/pyo3/pyo3/compare/v0.5.1...v0.5.2
+[0.5.1]: https://github.com/pyo3/pyo3/compare/v0.5.0...v0.5.1
+[0.5.0]: https://github.com/pyo3/pyo3/compare/v0.4.1...v0.5.0
+[0.4.1]: https://github.com/pyo3/pyo3/compare/v0.4.0...v0.4.1
+[0.4.0]: https://github.com/pyo3/pyo3/compare/v0.3.2...v0.4.0
+[0.3.2]: https://github.com/pyo3/pyo3/compare/v0.3.1...v0.3.2
+[0.3.1]: https://github.com/pyo3/pyo3/compare/v0.3.0...v0.3.1
+[0.3.0]: https://github.com/pyo3/pyo3/compare/v0.2.7...v0.3.0
+[0.2.7]: https://github.com/pyo3/pyo3/compare/v0.2.6...v0.2.7
+[0.2.6]: https://github.com/pyo3/pyo3/compare/v0.2.5...v0.2.6
+[0.2.5]: https://github.com/pyo3/pyo3/compare/v0.2.4...v0.2.5
+[0.2.4]: https://github.com/pyo3/pyo3/compare/v0.2.3...v0.2.4
+[0.2.3]: https://github.com/pyo3/pyo3/compare/v0.2.2...v0.2.3
+[0.2.2]: https://github.com/pyo3/pyo3/compare/v0.2.1...v0.2.2
+[0.2.1]: https://github.com/pyo3/pyo3/compare/v0.2.0...v0.2.1
+[0.2.0]: https://github.com/pyo3/pyo3/compare/v0.1.0...v0.2.0
+[0.1.0]: https://github.com/PyO3/pyo3/tree/0.1.0
diff -pruN 43.0.0-1/rust-vendor/pyo3/CITATION.cff 43.0.0-1ubuntu1/rust-vendor/pyo3/CITATION.cff
--- 43.0.0-1/rust-vendor/pyo3/CITATION.cff	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/CITATION.cff	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,12 @@
+cff-version: 1.2.0
+title: PyO3
+message: >-
+  If you use this software as part of a publication and wish to cite
+  it, please use the metadata from this file.
+type: software
+authors:
+  - name: PyO3 Project and Contributors
+    website: https://github.com/PyO3
+license:
+  - Apache-2.0
+  - MIT
diff -pruN 43.0.0-1/rust-vendor/pyo3/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/pyo3/Cargo.toml
--- 43.0.0-1/rust-vendor/pyo3/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,286 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2021"
+rust-version = "1.63"
+name = "pyo3"
+version = "0.22.2"
+authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]
+exclude = [
+    "/.gitignore",
+    ".cargo/config",
+    "/codecov.yml",
+    "/Makefile",
+    "/pyproject.toml",
+    "/noxfile.py",
+    "/.github",
+    "/tests/test_compile_error.rs",
+    "/tests/ui",
+]
+description = "Bindings to Python interpreter"
+homepage = "https://github.com/pyo3/pyo3"
+documentation = "https://docs.rs/crate/pyo3/"
+readme = "README.md"
+keywords = [
+    "pyo3",
+    "python",
+    "cpython",
+    "ffi",
+]
+categories = [
+    "api-bindings",
+    "development-tools::ffi",
+]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/pyo3/pyo3"
+
+[package.metadata.docs.rs]
+features = [
+    "full",
+    "gil-refs",
+]
+no-default-features = true
+rustdoc-args = [
+    "--cfg",
+    "docsrs",
+]
+
+[dependencies.anyhow]
+version = "1.0.1"
+optional = true
+
+[dependencies.cfg-if]
+version = "1.0"
+
+[dependencies.chrono]
+version = "0.4.25"
+optional = true
+default-features = false
+
+[dependencies.chrono-tz]
+version = ">= 0.6, < 0.10"
+optional = true
+default-features = false
+
+[dependencies.either]
+version = "1.9"
+optional = true
+
+[dependencies.eyre]
+version = ">= 0.4, < 0.7"
+optional = true
+
+[dependencies.hashbrown]
+version = ">= 0.9, < 0.15"
+optional = true
+
+[dependencies.indexmap]
+version = ">= 1.6, < 3"
+optional = true
+
+[dependencies.indoc]
+version = "2.0.1"
+optional = true
+
+[dependencies.inventory]
+version = "0.3.0"
+optional = true
+
+[dependencies.libc]
+version = "0.2.62"
+
+[dependencies.memoffset]
+version = "0.9"
+
+[dependencies.num-bigint]
+version = "0.4.2"
+optional = true
+
+[dependencies.num-complex]
+version = ">= 0.2, < 0.5"
+optional = true
+
+[dependencies.num-rational]
+version = "0.4.1"
+optional = true
+
+[dependencies.once_cell]
+version = "1.13"
+
+[dependencies.pyo3-ffi]
+version = "=0.22.2"
+
+[dependencies.pyo3-macros]
+version = "=0.22.2"
+optional = true
+
+[dependencies.rust_decimal]
+version = "1.15"
+optional = true
+default-features = false
+
+[dependencies.serde]
+version = "1.0"
+optional = true
+
+[dependencies.smallvec]
+version = "1.0"
+optional = true
+
+[dependencies.unindent]
+version = "0.2.1"
+optional = true
+
+[dev-dependencies.assert_approx_eq]
+version = "1.1.0"
+
+[dev-dependencies.chrono]
+version = "0.4.25"
+
+[dev-dependencies.chrono-tz]
+version = ">= 0.6, < 0.10"
+
+[dev-dependencies.futures]
+version = "0.3.28"
+
+[dev-dependencies.proptest]
+version = "1.0"
+features = ["std"]
+default-features = false
+
+[dev-dependencies.rayon]
+version = "1.6.1"
+
+[dev-dependencies.send_wrapper]
+version = "0.6"
+
+[dev-dependencies.serde]
+version = "1.0"
+features = ["derive"]
+
+[dev-dependencies.serde_json]
+version = "1.0.61"
+
+[dev-dependencies.trybuild]
+version = ">=1.0.70"
+
+[build-dependencies.pyo3-build-config]
+version = "=0.22.2"
+features = ["resolve-config"]
+
+[features]
+abi3 = [
+    "pyo3-build-config/abi3",
+    "pyo3-ffi/abi3",
+]
+abi3-py310 = [
+    "abi3-py311",
+    "pyo3-build-config/abi3-py310",
+    "pyo3-ffi/abi3-py310",
+]
+abi3-py311 = [
+    "abi3-py312",
+    "pyo3-build-config/abi3-py311",
+    "pyo3-ffi/abi3-py311",
+]
+abi3-py312 = [
+    "abi3",
+    "pyo3-build-config/abi3-py312",
+    "pyo3-ffi/abi3-py312",
+]
+abi3-py37 = [
+    "abi3-py38",
+    "pyo3-build-config/abi3-py37",
+    "pyo3-ffi/abi3-py37",
+]
+abi3-py38 = [
+    "abi3-py39",
+    "pyo3-build-config/abi3-py38",
+    "pyo3-ffi/abi3-py38",
+]
+abi3-py39 = [
+    "abi3-py310",
+    "pyo3-build-config/abi3-py39",
+    "pyo3-ffi/abi3-py39",
+]
+auto-initialize = []
+default = ["macros"]
+experimental-async = [
+    "macros",
+    "pyo3-macros/experimental-async",
+]
+experimental-inspect = []
+extension-module = ["pyo3-ffi/extension-module"]
+full = [
+    "macros",
+    "anyhow",
+    "chrono",
+    "chrono-tz",
+    "either",
+    "experimental-async",
+    "experimental-inspect",
+    "eyre",
+    "hashbrown",
+    "indexmap",
+    "num-bigint",
+    "num-complex",
+    "num-rational",
+    "py-clone",
+    "rust_decimal",
+    "serde",
+    "smallvec",
+]
+generate-import-lib = ["pyo3-ffi/generate-import-lib"]
+gil-refs = ["pyo3-macros/gil-refs"]
+macros = [
+    "pyo3-macros",
+    "indoc",
+    "unindent",
+]
+multiple-pymethods = [
+    "inventory",
+    "pyo3-macros/multiple-pymethods",
+]
+nightly = []
+py-clone = []
+
+[target."cfg(not(target_has_atomic = \"64\"))".dependencies.portable-atomic]
+version = "1.0"
+
+[lints.clippy]
+checked_conversions = "warn"
+dbg_macro = "warn"
+explicit_into_iter_loop = "warn"
+explicit_iter_loop = "warn"
+filter_map_next = "warn"
+flat_map_option = "warn"
+let_unit_value = "warn"
+manual_assert = "warn"
+manual_ok_or = "warn"
+todo = "warn"
+unnecessary_wraps = "warn"
+used_underscore_binding = "warn"
+useless_transmute = "warn"
+
+[lints.rust]
+elided_lifetimes_in_paths = "warn"
+invalid_doc_attributes = "warn"
+rust_2021_prelude_collisions = "warn"
+unused_lifetimes = "warn"
+
+[lints.rust.rust_2018_idioms]
+level = "warn"
+priority = -1
+
+[lints.rustdoc]
+bare_urls = "warn"
+broken_intra_doc_links = "warn"
diff -pruN 43.0.0-1/rust-vendor/pyo3/Code-of-Conduct.md 43.0.0-1ubuntu1/rust-vendor/pyo3/Code-of-Conduct.md
--- 43.0.0-1/rust-vendor/pyo3/Code-of-Conduct.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/Code-of-Conduct.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,77 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as
+contributors and maintainers pledge to making participation in our project and
+our community a harassment-free experience for everyone, regardless of age, body
+size, disability, ethnicity, sex characteristics, gender identity and expression,
+level of experience, education, socio-economic status, nationality, personal
+appearance, race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment
+include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or
+  advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic
+  address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+  professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable
+behavior and are expected to take appropriate and fair corrective action in
+response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or
+reject comments, commits, code, wiki edits, issues, and other contributions
+that are not aligned to this Code of Conduct, or to ban temporarily or
+permanently any contributor for other behaviors that they deem inappropriate,
+threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces
+when an individual is representing the project or its community. Examples of
+representing a project or community include using an official project e-mail
+address, posting via an official social media account, or acting as an appointed
+representative at an online or offline event. Representation of a project may be
+further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported by contacting the project team. All
+complaints will be reviewed and investigated and will result in a response that
+is deemed necessary and appropriate to the circumstances. The project team is
+obligated to maintain confidentiality with regard to the reporter of an incident.
+Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good
+faith may face temporary or permanent repercussions as determined by other
+members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
+available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
+
+[homepage]: https://www.contributor-covenant.org
+
+For answers to common questions about this code of conduct, see
+https://www.contributor-covenant.org/faq
+
diff -pruN 43.0.0-1/rust-vendor/pyo3/Contributing.md 43.0.0-1ubuntu1/rust-vendor/pyo3/Contributing.md
--- 43.0.0-1/rust-vendor/pyo3/Contributing.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/Contributing.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,240 @@
+# Contributing
+
+Thank you for your interest in contributing to PyO3! All are welcome - please consider reading our [Code of Conduct](https://github.com/PyO3/pyo3/blob/main/Code-of-Conduct.md) to keep our community positive and inclusive.
+
+If you are searching for ideas how to contribute, proceed to the ["Getting started contributing"](#getting-started-contributing) section. If you have found a specific issue to contribute to and need information about the development process, you may find the section ["Writing pull requests"](#writing-pull-requests) helpful.
+
+If you want to become familiar with the codebase, see
+[Architecture.md](https://github.com/PyO3/pyo3/blob/main/Architecture.md).
+
+## Getting started contributing
+
+Please join in with any part of PyO3 which interests you. We use GitHub issues to record all bugs and ideas. Feel free to request an issue to be assigned to you if you want to work on it.
+
+You can browse the API of the non-public parts of PyO3 [here](https://pyo3.netlify.app/internal/doc/pyo3/index.html).
+
+The following sections also contain specific ideas on where to start contributing to PyO3.
+
+## Setting up a development environment
+
+To work and develop PyO3, you need Python & Rust installed on your system.
+* We encourage the use of [rustup](https://rustup.rs/) to be able to select and choose specific toolchains based on the project.
+* [Pyenv](https://github.com/pyenv/pyenv) is also highly recommended for being able to choose a specific Python version.
+* [virtualenv](https://virtualenv.pypa.io/en/latest/) can also be used with or without Pyenv to use specific installed Python versions.
+* [`nox`][nox] is used to automate many of our CI tasks.
+
+### Help users identify bugs
+
+The [PyO3 Discord server](https://discord.gg/33kcChzH7f) is very active with users who are new to PyO3, and often completely new to Rust. Helping them debug is a great way to get experience with the PyO3 codebase.
+
+Helping others often reveals bugs, documentation weaknesses, and missing APIs. It's a good idea to open GitHub issues for these immediately so the resolution can be designed and implemented!
+
+### Implement issues ready for development
+
+Issues where the solution is clear and work is not in progress use the [needs-implementer](https://github.com/PyO3/pyo3/issues?q=is%3Aissue+is%3Aopen+label%3Aneeds-implementer) label.
+
+Don't be afraid if the solution is not clear to you! The core PyO3 contributors will be happy to mentor you through any questions you have to help you write the solution.
+
+### Help write great docs
+
+PyO3 has a user guide (using mdbook) as well as the usual Rust API docs. The aim is for both of these to be detailed, easy to understand, and up-to-date. Pull requests are always welcome to fix typos, change wording, add examples, etc.
+
+There are some specific areas of focus where help is currently needed for the documentation:
+
+- Issues requesting documentation improvements are tracked with the [documentation](https://github.com/PyO3/pyo3/issues?q=is%3Aissue+is%3Aopen+label%3Adocumentation) label.
+- Not all APIs had docs or examples when they were made. The goal is to have documentation on all PyO3 APIs ([#306](https://github.com/PyO3/pyo3/issues/306)). If you see an API lacking a doc, please write one and open a PR!
+
+To build the docs (including all features), install [`nox`][nox] and then run
+
+```shell
+nox -s docs -- open
+```
+
+#### Doctests
+
+We use lots of code blocks in our docs. Run `cargo test --doc` when making changes to check that
+the doctests still work, or `cargo test` to run all the tests including doctests. See
+https://doc.rust-lang.org/rustdoc/documentation-tests.html for a guide on doctests.
+
+#### Building the guide
+
+You can preview the user guide by building it locally with `mdbook`.
+
+First, install [`mdbook`][mdbook] and [`nox`][nox]. Then, run
+
+```shell
+nox -s build-guide -- --open
+```
+
+To check all links in the guide are valid, also install [`lychee`][lychee] and use the `check-guide` session instead:
+
+```shell
+nox -s check-guide
+```
+
+### Help design the next PyO3
+
+Issues which don't yet have a clear solution use the [needs-design](https://github.com/PyO3/pyo3/issues?q=is%3Aissue+is%3Aopen+label%3Aneeds-design) label.
+
+If any of these issues interest you, please join in with the conversation on the issue! All opinions are valued, and if you're interested in going further with e.g. draft PRs to experiment with API designs, even better!
+
+### Review pull requests
+
+Everybody is welcome to submit comments on open PRs. Please help ensure new PyO3 APIs are safe, performant, tidy, and easy to use!
+
+## Writing pull requests
+
+Here are a few things to note when you are writing PRs.
+
+### Continuous Integration
+
+The PyO3 repo uses GitHub Actions. PRs are blocked from merging if CI is not successful. Formatting, linting and tests are checked for all Rust and Python code. In addition, all warnings in Rust code are disallowed (using `RUSTFLAGS="-D warnings"`).
+
+Tests run with all supported Python versions with the latest stable Rust compiler, as well as for Python 3.9 with the minimum supported Rust version.
+
+If you are adding a new feature, you should add it to the `full` feature in our *Cargo.toml** so that it is tested in CI.
+
+You can run these tests yourself with
+`nox`. Use  `nox -l` to list the full set of subcommands you can run.
+
+#### Linting Python code
+`nox -s ruff`
+
+#### Linting Rust code
+`nox -s rustfmt`
+
+#### Semver checks
+`cargo semver-checks check-release`
+
+#### Clippy
+`nox -s clippy-all`
+
+#### Tests
+`cargo test --features full`
+
+#### Check all conditional compilation
+`nox -s check-feature-powerset`
+
+#### UI Tests
+
+PyO3 uses [`trybuild`](https://github.com/dtolnay/trybuild) to develop UI tests to capture error messages from the Rust compiler for some of the macro functionality.
+
+Because there are several feature combinations for these UI tests, when updating them all (e.g. for a new Rust compiler version) it may be helpful to use the `update-ui-tests` nox session:
+
+```bash
+nox -s update-ui-tests
+```
+
+### Documenting changes
+
+We use [towncrier](https://towncrier.readthedocs.io/en/stable/index.html) to generate a CHANGELOG for each release.
+
+To include your changes in the release notes, you should create one (or more) news items in the `newsfragments` directory. Valid news items should be saved as `<PR>.<CATEGORY>.md` where `<PR>` is the pull request number and `<CATEGORY>` is one of the following:
+- `packaging` - for dependency changes and Python / Rust version compatibility changes
+- `added` - for new features
+- `changed` - for features which already existed but have been altered or deprecated
+- `removed` - for features which have been removed
+- `fixed` - for "changed" features which were classed as a bugfix
+
+Docs-only PRs do not need news items; start your PR title with `docs:` to skip the check.
+
+### Style guide
+
+#### Generic code
+
+PyO3 has a lot of generic APIs to increase usability. These can come at the cost of generic code bloat. Where reasonable, try to implement a concrete sub-portion of generic functions. There are two forms of this:
+
+- If the concrete sub-portion doesn't benefit from re-use by other functions, name it `inner` and keep it as a local to the function.
+- If the concrete sub-portion is re-used by other functions, preferably name it `_foo` and place it directly below `foo` in the source code (where `foo` is the original generic function).
+
+#### FFI calls
+
+PyO3 makes a lot of FFI calls to Python's C API using raw pointers. Where possible try to avoid using pointers-to-temporaries in expressions:
+
+```rust
+// dangerous
+pyo3::ffi::Something(name.to_object(py).as_ptr());
+
+// because the following refactoring is a use-after-free error:
+let name = name.to_object(py).as_ptr();
+pyo3::ffi::Something(name)
+```
+
+Instead, prefer to bind the safe owned `PyObject` wrapper before passing to ffi functions:
+
+```rust
+let name: PyObject = name.to_object(py);
+pyo3::ffi::Something(name.as_ptr())
+// name will automatically be freed when it falls out of scope
+```
+
+## Python and Rust version support policy
+
+PyO3 aims to keep sufficient compatibility to make packaging Python extensions built with PyO3 feasible on most common package managers.
+
+To keep package maintainers' lives simpler, PyO3 will commit, wherever possible, to only adjust minimum supported Rust and Python versions at the same time. This bump will only come in an `0.x` release, roughly once per year, after the oldest supported Python version reaches its end-of-life. (Check https://endoflife.date/python for a clear timetable on these.)
+
+Below are guidelines on what compatibility all PRs are expected to deliver for each language.
+
+### Python
+
+PyO3 supports all officially supported Python versions, as well as the latest PyPy3 release. All of these versions are tested in CI.
+
+### Rust
+
+PyO3 aims to make use of up-to-date Rust language features to keep the implementation as efficient as possible.
+
+The minimum Rust version supported will be decided when the release which bumps Python and Rust versions is made. At the time, the minimum Rust version will be set no higher than the lowest Rust version shipped in the current Debian, RHEL and Alpine Linux distributions.
+
+CI tests both the most recent stable Rust version and the minimum supported Rust version. Because of Rust's stability guarantees this is sufficient to confirm support for all Rust versions in between.
+
+## Benchmarking
+
+PyO3 has two sets of benchmarks for evaluating some aspects of its performance. The benchmark suite is currently very small - please open PRs with new benchmarks if you're interested in helping to expand it!
+
+First, there are Rust-based benchmarks located in the `pyo3-benches` subdirectory. You can run these benchmarks with:
+
+    nox -s bench
+
+Second, there is a Python-based benchmark contained in the `pytests` subdirectory. You can read more about it [here](https://github.com/PyO3/pyo3/tree/main/pytests).
+
+## Code coverage
+
+You can view what code is and isn't covered by PyO3's tests. We aim to have 100% coverage - please check coverage and add tests if you notice a lack of coverage!
+
+- First, ensure the llvm-cov cargo plugin is installed. You may need to run the plugin through cargo once before using it with `nox`.
+```shell
+cargo install cargo-llvm-cov
+cargo llvm-cov
+```
+- Then, generate an `lcov.info` file with
+```shell
+nox -s coverage -- lcov
+```
+You can install an IDE plugin to view the coverage. For example, if you use VSCode:
+- Add the [coverage-gutters](https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters) plugin.
+- Add these settings to VSCode's `settings.json`:
+```json
+{
+    "coverage-gutters.coverageFileNames": [
+        "lcov.info",
+        "cov.xml",
+        "coverage.xml",
+    ],
+    "coverage-gutters.showLineCoverage": true
+}
+```
+- You should now be able to see green highlights for code that is tested, and red highlights for code that is not tested.
+
+## Sponsor this project
+
+At the moment there is no official organisation that accepts sponsorship on PyO3's behalf. If you're seeking to provide significant funding to the PyO3 ecosystem, please reach out to us on [GitHub](https://github.com/PyO3/pyo3/issues/new) or [Discord](https://discord.gg/33kcChzH7f) and we can discuss.
+
+In the meanwhile, some of our maintainers have personal GitHub sponsorship pages and would be grateful for your support:
+
+- [davidhewitt](https://github.com/sponsors/davidhewitt)
+- [messense](https://github.com/sponsors/messense)
+
+[mdbook]: https://rust-lang.github.io/mdBook/cli/index.html
+[lychee]: https://github.com/lycheeverse/lychee
+[nox]: https://github.com/theacodes/nox
diff -pruN 43.0.0-1/rust-vendor/pyo3/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/pyo3/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/pyo3/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,189 @@
+   Copyright (c) 2017-present PyO3 Project and Contributors.  https://github.com/PyO3
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
diff -pruN 43.0.0-1/rust-vendor/pyo3/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/pyo3/LICENSE-MIT
--- 43.0.0-1/rust-vendor/pyo3/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,25 @@
+Copyright (c) 2023-present PyO3 Project and Contributors.  https://github.com/PyO3
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/pyo3/README.md 43.0.0-1ubuntu1/rust-vendor/pyo3/README.md
--- 43.0.0-1/rust-vendor/pyo3/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,264 @@
+# PyO3
+
+[![actions status](https://img.shields.io/github/actions/workflow/status/PyO3/pyo3/ci.yml?branch=main&logo=github&style=)](https://github.com/PyO3/pyo3/actions)
+[![benchmark](https://img.shields.io/endpoint?url=https://codspeed.io/badge.json)](https://codspeed.io/PyO3/pyo3)
+[![codecov](https://img.shields.io/codecov/c/gh/PyO3/pyo3?logo=codecov)](https://codecov.io/gh/PyO3/pyo3)
+[![crates.io](https://img.shields.io/crates/v/pyo3?logo=rust)](https://crates.io/crates/pyo3)
+[![minimum rustc 1.63](https://img.shields.io/badge/rustc-1.63+-blue?logo=rust)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)
+[![discord server](https://img.shields.io/discord/1209263839632424990?logo=discord)](https://discord.gg/33kcChzH7f)
+[![contributing notes](https://img.shields.io/badge/contribute-on%20github-Green?logo=github)](https://github.com/PyO3/pyo3/blob/main/Contributing.md)
+
+[Rust](https://www.rust-lang.org/) bindings for [Python](https://www.python.org/), including tools for creating native Python extension modules. Running and interacting with Python code from a Rust binary is also supported.
+
+- User Guide: [stable](https://pyo3.rs) | [main](https://pyo3.rs/main)
+
+- API Documentation: [stable](https://docs.rs/pyo3/) | [main](https://pyo3.rs/main/doc)
+
+## Usage
+
+PyO3 supports the following software versions:
+  - Python 3.7 and up (CPython, PyPy, and GraalPy)
+  - Rust 1.63 and up
+
+You can use PyO3 to write a native Python module in Rust, or to embed Python in a Rust binary. The following sections explain each of these in turn.
+
+### Using Rust from Python
+
+PyO3 can be used to generate a native Python module. The easiest way to try this out for the first time is to use [`maturin`](https://github.com/PyO3/maturin). `maturin` is a tool for building and publishing Rust-based Python packages with minimal configuration. The following steps install `maturin`, use it to generate and build a new Python package, and then launch Python to import and execute a function from the package.
+
+First, follow the commands below to create a new directory containing a new Python `virtualenv`, and install `maturin` into the virtualenv using Python's package manager, `pip`:
+
+```bash
+# (replace string_sum with the desired package name)
+$ mkdir string_sum
+$ cd string_sum
+$ python -m venv .env
+$ source .env/bin/activate
+$ pip install maturin
+```
+
+Still inside this `string_sum` directory, now run `maturin init`. This will generate the new package source. When given the choice of bindings to use, select pyo3 bindings:
+
+```bash
+$ maturin init
+✔ 🤷 What kind of bindings to use? · pyo3
+  ✨ Done! New project created string_sum
+```
+
+The most important files generated by this command are `Cargo.toml` and `lib.rs`, which will look roughly like the following:
+
+**`Cargo.toml`**
+
+```toml
+[package]
+name = "string_sum"
+version = "0.1.0"
+edition = "2021"
+
+[lib]
+# The name of the native library. This is the name which will be used in Python to import the
+# library (i.e. `import string_sum`). If you change this, you must also change the name of the
+# `#[pymodule]` in `src/lib.rs`.
+name = "string_sum"
+# "cdylib" is necessary to produce a shared library for Python to import from.
+#
+# Downstream Rust code (including code in `bin/`, `examples/`, and `tests/`) will not be able
+# to `use string_sum;` unless the "rlib" or "lib" crate type is also included, e.g.:
+# crate-type = ["cdylib", "rlib"]
+crate-type = ["cdylib"]
+
+[dependencies]
+pyo3 = { version = "0.22.2", features = ["extension-module"] }
+```
+
+**`src/lib.rs`**
+
+```rust
+use pyo3::prelude::*;
+
+/// Formats the sum of two numbers as string.
+#[pyfunction]
+fn sum_as_string(a: usize, b: usize) -> PyResult<String> {
+    Ok((a + b).to_string())
+}
+
+/// A Python module implemented in Rust. The name of this function must match
+/// the `lib.name` setting in the `Cargo.toml`, else Python will not be able to
+/// import the module.
+#[pymodule]
+fn string_sum(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    m.add_function(wrap_pyfunction!(sum_as_string, m)?)?;
+    Ok(())
+}
+```
+
+Finally, run `maturin develop`. This will build the package and install it into the Python virtualenv previously created and activated. The package is then ready to be used from `python`:
+
+```bash
+$ maturin develop
+# lots of progress output as maturin runs the compilation...
+$ python
+>>> import string_sum
+>>> string_sum.sum_as_string(5, 20)
+'25'
+```
+
+To make changes to the package, just edit the Rust source code and then re-run `maturin develop` to recompile.
+
+To run this all as a single copy-and-paste, use the bash script below (replace `string_sum` in the first command with the desired package name):
+
+```bash
+mkdir string_sum && cd "$_"
+python -m venv .env
+source .env/bin/activate
+pip install maturin
+maturin init --bindings pyo3
+maturin develop
+```
+
+If you want to be able to run `cargo test` or use this project in a Cargo workspace and are running into linker issues, there are some workarounds in [the FAQ](https://pyo3.rs/latest/faq.html#i-cant-run-cargo-test-or-i-cant-build-in-a-cargo-workspace-im-having-linker-issues-like-symbol-not-found-or-undefined-reference-to-_pyexc_systemerror).
+
+As well as with `maturin`, it is possible to build using [`setuptools-rust`](https://github.com/PyO3/setuptools-rust) or [manually](https://pyo3.rs/latest/building-and-distribution.html#manual-builds). Both offer more flexibility than `maturin` but require more configuration to get started.
+
+### Using Python from Rust
+
+To embed Python into a Rust binary, you need to ensure that your Python installation contains a shared library. The following steps demonstrate how to ensure this (for Ubuntu), and then give some example code which runs an embedded Python interpreter.
+
+To install the Python shared library on Ubuntu:
+
+```bash
+sudo apt install python3-dev
+```
+
+To install the Python shared library on RPM based distributions (e.g. Fedora, Red Hat, SuSE), install the `python3-devel` package.
+
+
+Start a new project with `cargo new` and add  `pyo3` to the `Cargo.toml` like this:
+
+```toml
+[dependencies.pyo3]
+version = "0.22.2"
+features = ["auto-initialize"]
+```
+
+Example program displaying the value of `sys.version` and the current user name:
+
+```rust
+use pyo3::prelude::*;
+use pyo3::types::IntoPyDict;
+
+fn main() -> PyResult<()> {
+    Python::with_gil(|py| {
+        let sys = py.import_bound("sys")?;
+        let version: String = sys.getattr("version")?.extract()?;
+
+        let locals = [("os", py.import_bound("os")?)].into_py_dict_bound(py);
+        let code = "os.getenv('USER') or os.getenv('USERNAME') or 'Unknown'";
+        let user: String = py.eval_bound(code, None, Some(&locals))?.extract()?;
+
+        println!("Hello {}, I'm Python {}", user, version);
+        Ok(())
+    })
+}
+```
+
+The guide has [a section](https://pyo3.rs/latest/python-from-rust.html) with lots of examples
+about this topic.
+
+## Tools and libraries
+
+- [maturin](https://github.com/PyO3/maturin) _Build and publish crates with pyo3, rust-cpython or cffi bindings as well as rust binaries as python packages_
+- [setuptools-rust](https://github.com/PyO3/setuptools-rust) _Setuptools plugin for Rust support_.
+- [pyo3-built](https://github.com/PyO3/pyo3-built) _Simple macro to expose metadata obtained with the [`built`](https://crates.io/crates/built) crate as a [`PyDict`](https://docs.rs/pyo3/*/pyo3/types/struct.PyDict.html)_
+- [rust-numpy](https://github.com/PyO3/rust-numpy) _Rust binding of NumPy C-API_
+- [dict-derive](https://github.com/gperinazzo/dict-derive) _Derive FromPyObject to automatically transform Python dicts into Rust structs_
+- [pyo3-log](https://github.com/vorner/pyo3-log) _Bridge from Rust to Python logging_
+- [pythonize](https://github.com/davidhewitt/pythonize) _Serde serializer for converting Rust objects to JSON-compatible Python objects_
+- [pyo3-asyncio](https://github.com/awestlake87/pyo3-asyncio) _Utilities for working with Python's Asyncio library and async functions_
+- [rustimport](https://github.com/mityax/rustimport) _Directly import Rust files or crates from Python, without manual compilation step. Provides pyo3 integration by default and generates pyo3 binding code automatically._
+- [pyo3-arrow](https://crates.io/crates/pyo3-arrow) _Lightweight [Apache Arrow](https://arrow.apache.org/) integration for pyo3._
+
+## Examples
+
+- [autopy](https://github.com/autopilot-rs/autopy) _A simple, cross-platform GUI automation library for Python and Rust._
+  - Contains an example of building wheels on TravisCI and appveyor using [cibuildwheel](https://github.com/pypa/cibuildwheel)
+- [ballista-python](https://github.com/apache/arrow-ballista-python) _A Python library that binds to Apache Arrow distributed query engine Ballista._
+- [bed-reader](https://github.com/fastlmm/bed-reader) _Read and write the PLINK BED format, simply and efficiently._
+    - Shows Rayon/ndarray::parallel (including capturing errors, controlling thread num), Python types to Rust generics, Github Actions
+- [cryptography](https://github.com/pyca/cryptography/tree/main/src/rust) _Python cryptography library with some functionality in Rust._
+- [css-inline](https://github.com/Stranger6667/css-inline/tree/master/bindings/python) _CSS inlining for Python implemented in Rust._
+- [datafusion-python](https://github.com/apache/arrow-datafusion-python) _A Python library that binds to Apache Arrow in-memory query engine DataFusion._
+- [deltalake-python](https://github.com/delta-io/delta-rs/tree/main/python) _Native Delta Lake Python binding based on delta-rs with Pandas integration._
+- [fastbloom](https://github.com/yankun1992/fastbloom) _A fast [bloom filter](https://github.com/yankun1992/fastbloom#BloomFilter) | [counting bloom filter](https://github.com/yankun1992/fastbloom#countingbloomfilter) implemented by Rust for Rust and Python!_
+- [fastuuid](https://github.com/thedrow/fastuuid/) _Python bindings to Rust's UUID library._
+- [feos](https://github.com/feos-org/feos) _Lightning fast thermodynamic modeling in Rust with fully developed Python interface._
+- [forust](https://github.com/jinlow/forust) _A lightweight gradient boosted decision tree library written in Rust._
+- [granian](https://github.com/emmett-framework/granian) _A Rust HTTP server for Python applications._
+- [greptimedb](https://github.com/GreptimeTeam/greptimedb/tree/main/src/script) _Support [Python scripting](https://docs.greptime.com/user-guide/python-scripts/overview) in the database_
+- [haem](https://github.com/BooleanCat/haem) _A Python library for working on Bioinformatics problems._
+- [html-py-ever](https://github.com/PyO3/setuptools-rust/tree/main/examples/html-py-ever) _Using [html5ever](https://github.com/servo/html5ever) through [kuchiki](https://github.com/kuchiki-rs/kuchiki) to speed up html parsing and css-selecting._
+- [hyperjson](https://github.com/mre/hyperjson) _A hyper-fast Python module for reading/writing JSON data using Rust's serde-json._
+- [inline-python](https://github.com/fusion-engineering/inline-python) _Inline Python code directly in your Rust code._
+- [johnnycanencrypt](https://github.com/kushaldas/johnnycanencrypt) OpenPGP library with Yubikey support.
+- [jsonschema-rs](https://github.com/Stranger6667/jsonschema-rs/tree/master/bindings/python) _Fast JSON Schema validation library._
+- [mocpy](https://github.com/cds-astro/mocpy) _Astronomical Python library offering data structures for describing any arbitrary coverage regions on the unit sphere._
+- [opendal](https://github.com/apache/opendal/tree/main/bindings/python) _A data access layer that allows users to easily and efficiently retrieve data from various storage services in a unified way._
+- [orjson](https://github.com/ijl/orjson) _Fast Python JSON library._
+- [ormsgpack](https://github.com/aviramha/ormsgpack) _Fast Python msgpack library._
+- [point-process](https://github.com/ManifoldFR/point-process-rust/tree/master/pylib) _High level API for pointprocesses as a Python library._
+- [polaroid](https://github.com/daggy1234/polaroid) _Hyper Fast and safe image manipulation library for Python written in Rust._
+- [polars](https://github.com/pola-rs/polars) _Fast multi-threaded DataFrame library in Rust | Python | Node.js._
+- [pydantic-core](https://github.com/pydantic/pydantic-core) _Core validation logic for pydantic written in Rust._
+- [pyheck](https://github.com/kevinheavey/pyheck) _Fast case conversion library, built by wrapping [heck](https://github.com/withoutboats/heck)._
+    - Quite easy to follow as there's not much code.
+- [pyre](https://github.com/Project-Dream-Weaver/pyre-http) _Fast Python HTTP server written in Rust._
+- [pyreqwest_impersonate](https://github.com/deedy5/pyreqwest_impersonate) _The fastest python HTTP client that can impersonate web browsers by mimicking their headers and TLS/JA3/JA4/HTTP2 fingerprints._
+- [ril-py](https://github.com/Cryptex-github/ril-py) _A performant and high-level image processing library for Python written in Rust._
+- [river](https://github.com/online-ml/river) _Online machine learning in python, the computationally heavy statistics algorithms are implemented in Rust._
+- [rust-python-coverage](https://github.com/cjermain/rust-python-coverage) _Example PyO3 project with automated test coverage for Rust and Python._
+- [tiktoken](https://github.com/openai/tiktoken) _A fast BPE tokeniser for use with OpenAI's models._
+- [tokenizers](https://github.com/huggingface/tokenizers/tree/main/bindings/python) _Python bindings to the Hugging Face tokenizers (NLP) written in Rust._
+- [tzfpy](http://github.com/ringsaturn/tzfpy) _A fast package to convert longitude/latitude to timezone name._
+- [utiles](https://github.com/jessekrubin/utiles) _Fast Python web-map tile utilities_
+- [wasmer-python](https://github.com/wasmerio/wasmer-python) _Python library to run WebAssembly binaries._
+
+## Articles and other media
+
+- [(Video) Extending Python with Rust using PyO3](https://www.youtube.com/watch?v=T45ZEmSR1-s) - Dec 16, 2023
+- [A Week of PyO3 + rust-numpy (How to Speed Up Your Data Pipeline X Times)](https://terencezl.github.io/blog/2023/06/06/a-week-of-pyo3-rust-numpy/) - Jun 6, 2023
+- [(Podcast) PyO3 with David Hewitt](https://rustacean-station.org/episode/david-hewitt/) - May 19, 2023
+- [Making Python 100x faster with less than 100 lines of Rust](https://ohadravid.github.io/posts/2023-03-rusty-python/) - Mar 28, 2023
+- [How Pydantic V2 leverages Rust's Superpowers](https://fosdem.org/2023/schedule/event/rust_how_pydantic_v2_leverages_rusts_superpowers/) - Feb 4, 2023
+- [How we extended the River stats module with Rust using PyO3](https://boring-guy.sh/posts/river-rust/) - Dec 23, 2022
+- [Nine Rules for Writing Python Extensions in Rust](https://towardsdatascience.com/nine-rules-for-writing-python-extensions-in-rust-d35ea3a4ec29?sk=f8d808d5f414154fdb811e4137011437) - Dec 31, 2021
+- [Calling Rust from Python using PyO3](https://saidvandeklundert.net/learn/2021-11-18-calling-rust-from-python-using-pyo3/) - Nov 18, 2021
+- [davidhewitt's 2021 talk at Rust Manchester meetup](https://www.youtube.com/watch?v=-XyWG_klSAw&t=320s) - Aug 19, 2021
+- [Incrementally porting a small Python project to Rust](https://blog.waleedkhan.name/port-python-to-rust/) - Apr 29, 2021
+- [Vortexa - Integrating Rust into Python](https://www.vortexa.com/insight/integrating-rust-into-python) - Apr 12, 2021
+- [Writing and publishing a Python module in Rust](https://blog.yossarian.net/2020/08/02/Writing-and-publishing-a-python-module-in-rust) - Aug 2, 2020
+
+## Contributing
+
+Everyone is welcomed to contribute to PyO3! There are many ways to support the project, such as:
+
+- help PyO3 users with issues on GitHub and [Discord](https://discord.gg/33kcChzH7f)
+- improve documentation
+- write features and bugfixes
+- publish blogs and examples of how to use PyO3
+
+Our [contributing notes](https://github.com/PyO3/pyo3/blob/main/Contributing.md) and [architecture guide](https://github.com/PyO3/pyo3/blob/main/Architecture.md) have more resources if you wish to volunteer time for PyO3 and are searching where to start.
+
+If you don't have time to contribute yourself but still wish to support the project's future success, some of our maintainers have GitHub sponsorship pages:
+
+- [davidhewitt](https://github.com/sponsors/davidhewitt)
+- [messense](https://github.com/sponsors/messense)
+
+## License
+
+PyO3 is licensed under the [Apache-2.0 license](LICENSE-APACHE) or the [MIT license](LICENSE-MIT), at your option.
+
+Python is licensed under the [Python License](https://docs.python.org/3/license.html).
+
+Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in PyO3 by you, as defined in the Apache License, shall be dual-licensed as above, without any additional terms or conditions.
+
+<a href="https://www.netlify.com"> <img src="https://www.netlify.com/v3/img/components/netlify-color-accent.svg" alt="Deploys by Netlify" /> </a>
diff -pruN 43.0.0-1/rust-vendor/pyo3/Releasing.md 43.0.0-1ubuntu1/rust-vendor/pyo3/Releasing.md
--- 43.0.0-1/rust-vendor/pyo3/Releasing.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/Releasing.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,57 @@
+# Releasing
+
+This is notes for the current process of releasing a new PyO3 version. Replace `<version>` in all instructions below with the new version.
+
+## 1. Prepare the release commit
+
+Follow the process below to update all required pieces to bump the version. All these changes are done in a single commit because it makes it clear to git readers what happened to bump the version. It also makes it easy to cherry-pick the version bump onto the `main` branch when tidying up branch history at the end of the release process.
+
+1. Replace all instances of the PyO3 current version and the with the new version to be released. Places to check:
+   - `Cargo.toml` for all PyO3 crates in the repository.
+   - Examples in `README.md`
+   - PyO3 version embedded into documentation like the README.
+   - `pre-script.rhai` templates for the examples.
+   - `[towncrier]` section in `pyproject.toml`.
+
+   Some of the above locations may already have the new version with a `-dev` suffix, which needs to be removed.
+
+   **Make sure not to modify the CHANGELOG during this step!**
+
+2. Run `towncrier build` to generate the CHANGELOG. The version used by `towncrier` should automatically be correct because of the update to `pyproject.toml` in step 1.
+
+3. Manually edit the CHANGELOG for final notes. Steps to do:
+   - Adjust wording of any release lines to make them clearer for users / fix typos.
+   - Add a new link at the bottom for the new version, and update the `Unreleased` link.
+
+4. Create the commit containing all the above changes, with a message of `release: <version>`. Push to `release-<BRANCH_VER>` branch on the main PyO3 repository, where `<BRANCH_VER>` depends on whether this is a major or minor release:
+   - for O.X.0 minor releases, just use `0.X`, e.g. `release-0.17`. This will become the maintenance branch after release.
+   - for 0.X.Y patch releases, use the full `0.X.Y`, e.g. `release-0.17.1`. This will be deleted after merge.
+
+## 2. Create the release PR and draft release notes
+
+Open a PR for the branch, and confirm that it passes CI. For `0.X.0` minor releases, the PR should be merging into `main`, for `0.X.Y` patch releases, the PR should be merging the `release-0.X` maintenance branch.
+
+On https://github.com/PyO3/pyo3/releases, click "Draft a new release". The tag will be a new tag of `v<version>` (note preceding `v`) and target should be the `release-<BRANCH_VER>` branch you just pushed.
+
+Write release notes which match the style of previous releases. You can get the list of contributors by running `nox -s contributors -- v<prev-version> release-<BRANCH_VER>` to get contributors from the previous version tag through to the branch tip you just pushed. (This uses the GitHub API, so you'll need to push the branch first.)
+
+Save as a draft and wait for now.
+
+## 3. Leave for a cooling off period
+
+Wait a couple of days in case anyone wants to hold up the release to add bugfixes etc.
+
+## 4. Put live
+
+To put live:
+- 1. run `nox -s publish` to put live on crates.io
+- 2. publish the release on Github
+- 3. merge the release PR
+
+## 5. Tidy the main branch
+
+If the release PR targeted a branch other than main, you will need to cherry-pick the version bumps, CHANGELOG modifications and removal of towncrier `newsfragments` and open another PR to land these on main.
+
+## 6. Delete the release branch (patch releases only)
+
+For 0.X.Y patch releases, the release branch is no longer needed, so it should be deleted.
diff -pruN 43.0.0-1/rust-vendor/pyo3/assets/script.py 43.0.0-1ubuntu1/rust-vendor/pyo3/assets/script.py
--- 43.0.0-1/rust-vendor/pyo3/assets/script.py	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/assets/script.py	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+# Used in PyModule examples.
+
+
+class Blah:
+    pass
diff -pruN 43.0.0-1/rust-vendor/pyo3/build.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/build.rs
--- 43.0.0-1/rust-vendor/pyo3/build.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/build.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,54 @@
+use std::env;
+
+use pyo3_build_config::pyo3_build_script_impl::{cargo_env_var, errors::Result};
+use pyo3_build_config::{bail, print_feature_cfgs, InterpreterConfig};
+
+fn ensure_auto_initialize_ok(interpreter_config: &InterpreterConfig) -> Result<()> {
+    if cargo_env_var("CARGO_FEATURE_AUTO_INITIALIZE").is_some() && !interpreter_config.shared {
+        bail!(
+            "The `auto-initialize` feature is enabled, but your python installation only supports \
+            embedding the Python interpreter statically. If you are attempting to run tests, or a \
+            binary which is okay to link dynamically, install a Python distribution which ships \
+            with the Python shared library.\n\
+            \n\
+            Embedding the Python interpreter statically does not yet have first-class support in \
+            PyO3. If you are sure you intend to do this, disable the `auto-initialize` feature.\n\
+            \n\
+            For more information, see \
+            https://pyo3.rs/v{pyo3_version}/\
+                building-and-distribution.html#embedding-python-in-rust",
+            pyo3_version = env::var("CARGO_PKG_VERSION").unwrap()
+        );
+    }
+    Ok(())
+}
+
+/// Prepares the PyO3 crate for compilation.
+///
+/// This loads the config from pyo3-build-config and then makes some additional checks to improve UX
+/// for users.
+///
+/// Emits the cargo configuration based on this config as well as a few checks of the Rust compiler
+/// version to enable features which aren't supported on MSRV.
+fn configure_pyo3() -> Result<()> {
+    let interpreter_config = pyo3_build_config::get();
+
+    ensure_auto_initialize_ok(interpreter_config)?;
+
+    for cfg in interpreter_config.build_script_outputs() {
+        println!("{}", cfg)
+    }
+
+    // Emit cfgs like `invalid_from_utf8_lint`
+    print_feature_cfgs();
+
+    Ok(())
+}
+
+fn main() {
+    pyo3_build_config::print_expected_cfgs();
+    if let Err(e) = configure_pyo3() {
+        eprintln!("error: {}", e.report());
+        std::process::exit(1)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/emscripten/Makefile 43.0.0-1ubuntu1/rust-vendor/pyo3/emscripten/Makefile
--- 43.0.0-1/rust-vendor/pyo3/emscripten/Makefile	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/emscripten/Makefile	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,87 @@
+CURDIR=$(abspath .)
+
+# These three are passed in from nox.
+BUILDROOT ?= $(CURDIR)/builddir
+PYMAJORMINORMICRO ?= 3.11.0
+
+EMSCRIPTEN_VERSION=3.1.13
+
+export EMSDKDIR = $(BUILDROOT)/emsdk
+
+PLATFORM=wasm32_emscripten
+SYSCONFIGDATA_NAME=_sysconfigdata__$(PLATFORM)
+
+# BASH_ENV tells bash to source emsdk_env.sh on startup.
+export BASH_ENV := $(CURDIR)/env.sh
+# Use bash to run each command so that env.sh will be used.
+SHELL := /bin/bash
+
+
+# Set version variables.
+version_tuple := $(subst ., ,$(PYMAJORMINORMICRO:v%=%))
+PYMAJOR=$(word 1,$(version_tuple))
+PYMINOR=$(word 2,$(version_tuple))
+PYMICRO=$(word 3,$(version_tuple))
+PYVERSION=$(PYMAJORMINORMICRO)
+PYMAJORMINOR=$(PYMAJOR).$(PYMINOR)
+
+
+PYTHONURL=https://www.python.org/ftp/python/$(PYMAJORMINORMICRO)/Python-$(PYVERSION).tgz
+PYTHONTARBALL=$(BUILDROOT)/downloads/Python-$(PYVERSION).tgz
+PYTHONBUILD=$(BUILDROOT)/build/Python-$(PYVERSION)
+
+PYTHONLIBDIR=$(BUILDROOT)/install/Python-$(PYVERSION)/lib
+
+all: $(PYTHONLIBDIR)/libpython$(PYMAJORMINOR).a
+
+$(BUILDROOT)/.exists: 
+	mkdir -p $(BUILDROOT)
+	touch $@
+
+
+# Install emscripten
+$(EMSDKDIR): $(CURDIR)/emscripten_patches/* $(BUILDROOT)/.exists
+	git clone https://github.com/emscripten-core/emsdk.git --depth 1 --branch $(EMSCRIPTEN_VERSION) $(EMSDKDIR)
+	$(EMSDKDIR)/emsdk install $(EMSCRIPTEN_VERSION)
+	cd $(EMSDKDIR)/upstream/emscripten && cat $(CURDIR)/emscripten_patches/* | patch -p1
+	$(EMSDKDIR)/emsdk activate $(EMSCRIPTEN_VERSION)
+
+
+$(PYTHONTARBALL):
+	[ -d $(BUILDROOT)/downloads ] || mkdir -p $(BUILDROOT)/downloads
+	wget -q -O $@ $(PYTHONURL)
+
+$(PYTHONBUILD)/.patched: $(PYTHONTARBALL)
+	[ -d $(PYTHONBUILD) ] || ( \
+		mkdir -p $(dir $(PYTHONBUILD));\
+		tar -C $(dir $(PYTHONBUILD)) -xf $(PYTHONTARBALL) \
+	)
+	touch $@
+
+$(PYTHONBUILD)/Makefile: $(PYTHONBUILD)/.patched $(BUILDROOT)/emsdk
+	cd $(PYTHONBUILD) && \
+	CONFIG_SITE=Tools/wasm/config.site-wasm32-emscripten \
+  	emconfigure ./configure -C \
+		--host=wasm32-unknown-emscripten \
+		--build=$(shell $(PYTHONBUILD)/config.guess) \
+		--with-emscripten-target=browser \
+		--enable-wasm-dynamic-linking \
+		--with-build-python=python3.11
+
+$(PYTHONLIBDIR)/libpython$(PYMAJORMINOR).a : $(PYTHONBUILD)/Makefile
+	cd $(PYTHONBUILD) && \
+		emmake make -j3 libpython$(PYMAJORMINOR).a
+
+	# Generate sysconfigdata
+	_PYTHON_SYSCONFIGDATA_NAME=$(SYSCONFIGDATA_NAME) _PYTHON_PROJECT_BASE=$(PYTHONBUILD) python3.11 -m sysconfig --generate-posix-vars
+	cp `cat pybuilddir.txt`/$(SYSCONFIGDATA_NAME).py $(PYTHONBUILD)/Lib
+
+	mkdir -p $(PYTHONLIBDIR)
+	# Copy libexpat.a, libmpdec.a, and libpython3.11.a
+	# In noxfile, we explicitly link libexpat and libmpdec via RUSTFLAGS
+	find $(PYTHONBUILD) -name '*.a' -exec cp {} $(PYTHONLIBDIR) \;
+	# Install Python stdlib
+	cp -r $(PYTHONBUILD)/Lib $(PYTHONLIBDIR)/python$(PYMAJORMINOR)
+
+clean:
+	rm -rf $(BUILDROOT)
diff -pruN 43.0.0-1/rust-vendor/pyo3/emscripten/emscripten_patches/0001-Add-_gxx_personality_v0-stub-to-library.js.patch 43.0.0-1ubuntu1/rust-vendor/pyo3/emscripten/emscripten_patches/0001-Add-_gxx_personality_v0-stub-to-library.js.patch
--- 43.0.0-1/rust-vendor/pyo3/emscripten/emscripten_patches/0001-Add-_gxx_personality_v0-stub-to-library.js.patch	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/emscripten/emscripten_patches/0001-Add-_gxx_personality_v0-stub-to-library.js.patch	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,28 @@
+From 4b56f37c3dc9185a235a8314086c4d7a6239b2f8 Mon Sep 17 00:00:00 2001
+From: Hood Chatham <roberthoodchatham@gmail.com>
+Date: Sat, 4 Jun 2022 19:19:47 -0700
+Subject: [PATCH] Add _gxx_personality_v0 stub to library.js
+
+Mitigation for an incompatibility between Rust and Emscripten:
+https://github.com/rust-lang/rust/issues/85821
+https://github.com/emscripten-core/emscripten/issues/17128
+---
+ src/library.js | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/library.js b/src/library.js
+index e7bb4c38e..7d01744df 100644
+--- a/src/library.js
++++ b/src/library.js
+@@ -403,6 +403,8 @@ mergeInto(LibraryManager.library, {
+     abort('Assertion failed: ' + UTF8ToString(condition) + ', at: ' + [filename ? UTF8ToString(filename) : 'unknown filename', line, func ? UTF8ToString(func) : 'unknown function']);
+   },
+ 
++  __gxx_personality_v0: function() {},
++
+   // ==========================================================================
+   // time.h
+   // ==========================================================================
+-- 
+2.25.1
+
diff -pruN 43.0.0-1/rust-vendor/pyo3/emscripten/env.sh 43.0.0-1ubuntu1/rust-vendor/pyo3/emscripten/env.sh
--- 43.0.0-1/rust-vendor/pyo3/emscripten/env.sh	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/emscripten/env.sh	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+# Activate emsdk environment. emsdk_env.sh writes a lot to stderr so we suppress
+# the output. This also prevents it from complaining when emscripten isn't yet
+# installed.
+source "$EMSDKDIR/emsdk_env.sh" 2> /dev/null || true
diff -pruN 43.0.0-1/rust-vendor/pyo3/emscripten/pybuilddir.txt 43.0.0-1ubuntu1/rust-vendor/pyo3/emscripten/pybuilddir.txt
--- 43.0.0-1/rust-vendor/pyo3/emscripten/pybuilddir.txt	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/emscripten/pybuilddir.txt	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+build/lib.linux-x86_64-3.11
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/pyo3/emscripten/runner.py 43.0.0-1ubuntu1/rust-vendor/pyo3/emscripten/runner.py
--- 43.0.0-1/rust-vendor/pyo3/emscripten/runner.py	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/emscripten/runner.py	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,8 @@
+#!/usr/local/bin/python
+import pathlib
+import sys
+import subprocess
+
+p = pathlib.Path(sys.argv[1])
+
+sys.exit(subprocess.call(["node", p.name], cwd=p.parent))
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/book.toml 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/book.toml
--- 43.0.0-1/rust-vendor/pyo3/guide/book.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/book.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,12 @@
+[book]
+title = "PyO3 user guide"
+description = "PyO3 user guide"
+author = "PyO3 Project and Contributors"
+
+[preprocessor.pyo3_version]
+command = "python3 guide/pyo3_version.py"
+
+[output.html]
+git-repository-url = "https://github.com/PyO3/pyo3/tree/main/guide"
+edit-url-template = "https://github.com/PyO3/pyo3/edit/main/guide/{path}"
+playground.runnable = false
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/pyclass-parameters.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/pyclass-parameters.md
--- 43.0.0-1/rust-vendor/pyo3/guide/pyclass-parameters.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/pyclass-parameters.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,49 @@
+`#[pyclass]` can be used with the following parameters:
+
+|  Parameter  |  Description |
+| :-  | :- |
+| `constructor` | This is currently only allowed on [variants of complex enums][params-constructor]. It allows customization of the generated class constructor for each variant. It uses the same syntax and supports the same options as the `signature` attribute of functions and methods. |
+| <span style="white-space: pre">`crate = "some::path"`</span>  | Path to import the `pyo3` crate, if it's not accessible at `::pyo3`. |
+| `dict` | Gives instances of this class an empty `__dict__` to store custom attributes. |
+| `eq` | Implements `__eq__` using the `PartialEq` implementation of the underlying Rust datatype. |
+| `eq_int` | Implements `__eq__` using `__int__` for simple enums. |
+| <span style="white-space: pre">`extends = BaseType`</span>  | Use a custom baseclass. Defaults to [`PyAny`][params-1] |
+| <span style="white-space: pre">`freelist = N`</span> |  Implements a [free list][params-2] of size N. This can improve performance for types that are often created and deleted in quick succession. Profile your code to see whether `freelist` is right for you.  |
+| <span style="white-space: pre">`frozen`</span> | Declares that your pyclass is immutable. It removes the borrow checker overhead when retrieving a shared reference to the Rust struct, but disables the ability to get a mutable reference. |
+| `get_all` | Generates getters for all fields of the pyclass. |
+| `hash` | Implements `__hash__` using the `Hash` implementation of the underlying Rust datatype. |
+| `mapping` |  Inform PyO3 that this class is a [`Mapping`][params-mapping], and so leave its implementation of sequence C-API slots empty. |
+| <span style="white-space: pre">`module = "module_name"`</span> |  Python code will see the class as being defined in this module. Defaults to `builtins`. |
+| <span style="white-space: pre">`name = "python_name"`</span> | Sets the name that Python sees this class as. Defaults to the name of the Rust struct. |
+| `ord` | Implements `__lt__`, `__gt__`, `__le__`, & `__ge__` using the `PartialOrd` implementation of the underlying Rust datatype. *Requires `eq`* |
+| `rename_all = "renaming_rule"` | Applies renaming rules to every getters and setters of a struct, or every variants of an enum. Possible values are: "camelCase", "kebab-case", "lowercase", "PascalCase", "SCREAMING-KEBAB-CASE", "SCREAMING_SNAKE_CASE", "snake_case", "UPPERCASE". |
+| `sequence` |  Inform PyO3 that this class is a [`Sequence`][params-sequence], and so leave its C-API mapping length slot empty. |
+| `set_all` | Generates setters for all fields of the pyclass. |
+| `subclass` | Allows other Python classes and `#[pyclass]` to inherit from this class. Enums cannot be subclassed. |
+| <span style="white-space: pre">`text_signature = "(arg1, arg2, ...)"`</span> |  Sets the text signature for the Python class' `__new__` method. |
+| `unsendable` | Required if your struct is not [`Send`][params-3]. Rather than using `unsendable`, consider implementing your struct in a threadsafe way by e.g. substituting [`Rc`][params-4] with [`Arc`][params-5]. By using `unsendable`, your class will panic when accessed by another thread. Also note the Python's GC is multi-threaded and while unsendable classes will not be traversed on foreign threads to avoid UB, this can lead to memory leaks. |
+| `weakref` | Allows this class to be [weakly referenceable][params-6]. |
+
+All of these parameters can either be passed directly on the `#[pyclass(...)]` annotation, or as one or
+more accompanying `#[pyo3(...)]` annotations, e.g.:
+
+```rust,ignore
+// Argument supplied directly to the `#[pyclass]` annotation.
+#[pyclass(name = "SomeName", subclass)]
+struct MyClass {}
+
+// Argument supplied as a separate annotation.
+#[pyclass]
+#[pyo3(name = "SomeName", subclass)]
+struct MyClass {}
+```
+
+[params-1]: https://docs.rs/pyo3/latest/pyo3/types/struct.PyAny.html
+[params-2]: https://en.wikipedia.org/wiki/Free_list
+[params-3]: https://doc.rust-lang.org/std/marker/trait.Send.html
+[params-4]: https://doc.rust-lang.org/std/rc/struct.Rc.html
+[params-5]: https://doc.rust-lang.org/std/sync/struct.Arc.html
+[params-6]: https://docs.python.org/3/library/weakref.html
+[params-constructor]: https://pyo3.rs/latest/class.html#complex-enums
+[params-mapping]: https://pyo3.rs/latest/class/protocols.html#mapping--sequence-types
+[params-sequence]: https://pyo3.rs/latest/class/protocols.html#mapping--sequence-types
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/pyo3_version.py 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/pyo3_version.py
--- 43.0.0-1/rust-vendor/pyo3/guide/pyo3_version.py	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/pyo3_version.py	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,53 @@
+"""Simple mdbook preprocessor to inject pyo3 version into the guide.
+
+It will replace:
+    - {{#PYO3_VERSION_TAG}} with the contents of the PYO3_VERSION_TAG environment var
+    - {{#PYO3_DOCS_URL}} with the location of docs (e.g. 'https://docs.rs/pyo3/0.13.2')
+    - {{#PYO3_CRATE_VERSION}} with a relevant toml snippet (e.g. 'version = "0.13.2"')
+
+
+Tested against mdbook 0.4.10.
+"""
+
+import json
+import os
+import sys
+
+# Set PYO3_VERSION in CI to build the correct version into links
+PYO3_VERSION_TAG = os.environ.get("PYO3_VERSION_TAG", "main")
+
+if PYO3_VERSION_TAG == "main":
+    PYO3_DOCS_URL = "https://pyo3.rs/main/doc"
+    PYO3_DOCS_VERSION = "latest"
+    PYO3_CRATE_VERSION = 'git = "https://github.com/pyo3/pyo3"'
+else:
+    # v0.13.2 -> 0.13.2
+    version = PYO3_VERSION_TAG.lstrip("v")
+    PYO3_DOCS_URL = f"https://docs.rs/pyo3/{version}"
+    PYO3_DOCS_VERSION = version
+    PYO3_CRATE_VERSION = f'version = "{version}"'
+
+
+def replace_section_content(section):
+    if not isinstance(section, dict) or "Chapter" not in section:
+        return
+
+    # Replace raw and url-encoded forms
+    section["Chapter"]["content"] = (
+        section["Chapter"]["content"]
+        .replace("{{#PYO3_VERSION_TAG}}", PYO3_VERSION_TAG)
+        .replace("{{#PYO3_DOCS_URL}}", PYO3_DOCS_URL)
+        .replace("{{#PYO3_DOCS_VERSION}}", PYO3_DOCS_VERSION)
+        .replace("{{#PYO3_CRATE_VERSION}}", PYO3_CRATE_VERSION)
+    )
+
+    for sub_item in section["Chapter"]["sub_items"]:
+        replace_section_content(sub_item)
+
+
+for line in sys.stdin:
+    if line:
+        [context, book] = json.loads(line)
+        for section in book["sections"]:
+            replace_section_content(section)
+        json.dump(book, fp=sys.stdout)
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/SUMMARY.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/SUMMARY.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/SUMMARY.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/SUMMARY.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,49 @@
+# Summary
+
+[Introduction](index.md)
+
+---
+
+- [Getting started](getting-started.md)
+- [Using Rust from Python](rust-from-python.md)
+  - [Python modules](module.md)
+  - [Python functions](function.md)
+    - [Function signatures](function/signature.md)
+    - [Error handling](function/error-handling.md)
+  - [Python classes](class.md)
+    - [Class customizations](class/protocols.md)
+      - [Basic object customization](class/object.md)
+      - [Emulating numeric types](class/numeric.md)
+      - [Emulating callable objects](class/call.md)
+- [Calling Python from Rust](python-from-rust.md)
+  - [Python object types](types.md)
+  - [Python exceptions](exception.md)
+  - [Calling Python functions](python-from-rust/function-calls.md)
+  - [Executing existing Python code](python-from-rust/calling-existing-code.md)
+- [Type conversions](conversions.md)
+  - [Mapping of Rust types to Python types](conversions/tables.md)
+  - [Conversion traits](conversions/traits.md)
+- [Using `async` and `await`](async-await.md)
+- [Parallelism](parallelism.md)
+- [Debugging](debugging.md)
+- [Features reference](features.md)
+- [Memory management](memory.md)
+- [Performance](performance.md)
+- [Advanced topics](advanced.md)
+- [Building and distribution](building-and-distribution.md)
+  - [Supporting multiple Python versions](building-and-distribution/multiple-python-versions.md)
+- [Useful crates](ecosystem.md)
+  - [Logging](ecosystem/logging.md)
+  - [Using `async` and `await`](ecosystem/async-await.md)
+- [FAQ and troubleshooting](faq.md)
+
+---
+
+[Appendix A: Migration guide](migration.md)
+[Appendix B: Trait bounds](trait-bounds.md)
+[Appendix C: Python typing hints](python-typing-hints.md)
+[CHANGELOG](changelog.md)
+
+---
+
+[Contributing](contributing.md)
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/advanced.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/advanced.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/advanced.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/advanced.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+# Advanced topics
+
+## FFI
+
+PyO3 exposes much of Python's C API through the `ffi` module.
+
+The C API is naturally unsafe and requires you to manage reference counts, errors and specific invariants yourself. Please refer to the [C API Reference Manual](https://docs.python.org/3/c-api/) and [The Rustonomicon](https://doc.rust-lang.org/nightly/nomicon/ffi.html) before using any function from that API.
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/async-await.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/async-await.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/async-await.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/async-await.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,103 @@
+# Using `async` and `await`
+
+*This feature is still in active development. See [the related issue](https://github.com/PyO3/pyo3/issues/1632).*
+
+`#[pyfunction]` and `#[pymethods]` attributes also support `async fn`.
+
+```rust
+# #![allow(dead_code)]
+# #[cfg(feature = "experimental-async")] {
+use std::{thread, time::Duration};
+use futures::channel::oneshot;
+use pyo3::prelude::*;
+
+#[pyfunction]
+#[pyo3(signature=(seconds, result=None))]
+async fn sleep(seconds: f64, result: Option<PyObject>) -> Option<PyObject> {
+    let (tx, rx) = oneshot::channel();
+    thread::spawn(move || {
+        thread::sleep(Duration::from_secs_f64(seconds));
+        tx.send(()).unwrap();
+    });
+    rx.await.unwrap();
+    result
+}
+# }
+```
+
+*Python awaitables instantiated with this method can only be awaited in *asyncio* context. Other Python async runtime may be supported in the future.*
+
+## `Send + 'static` constraint
+
+Resulting future of an `async fn` decorated by `#[pyfunction]` must be `Send + 'static` to be embedded in a Python object.
+
+As a consequence, `async fn` parameters and return types must also be `Send + 'static`, so it is not possible to have a signature like `async fn does_not_compile<'py>(arg: Bound<'py, PyAny>) -> Bound<'py, PyAny>`.
+
+However, there is an exception for method receivers, so async methods can accept `&self`/`&mut self`. Note that this means that the class instance is borrowed for as long as the returned future is not completed, even across yield points and while waiting for I/O operations to complete. Hence, other methods cannot obtain exclusive borrows while the future is still being polled. This is the same as how async methods in Rust generally work but it is more problematic for Rust code interfacing with Python code due to pervasive shared mutability. This strongly suggests to prefer shared borrows `&self` over exclusive ones `&mut self` to avoid racy borrow check failures at runtime.
+
+## Implicit GIL holding
+
+Even if it is not possible to pass a `py: Python<'py>` parameter to `async fn`, the GIL is still held during the execution of the future – it's also the case for regular `fn` without `Python<'py>`/`Bound<'py, PyAny>` parameter, yet the GIL is held.
+
+It is still possible to get a `Python` marker using [`Python::with_gil`]({{#PYO3_DOCS_URL}}/pyo3/marker/struct.Python.html#method.with_gil); because `with_gil` is reentrant and optimized, the cost will be negligible.
+
+## Release the GIL across `.await`
+
+There is currently no simple way to release the GIL when awaiting a future, *but solutions are currently in development*.
+
+Here is the advised workaround for now:
+
+```rust,ignore
+use std::{
+    future::Future,
+    pin::{Pin, pin},
+    task::{Context, Poll},
+};
+use pyo3::prelude::*;
+
+struct AllowThreads<F>(F);
+
+impl<F> Future for AllowThreads<F>
+where
+    F: Future + Unpin + Send,
+    F::Output: Send,
+{
+    type Output = F::Output;
+
+    fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
+        let waker = cx.waker();
+        Python::with_gil(|gil| {
+            gil.allow_threads(|| pin!(&mut self.0).poll(&mut Context::from_waker(waker)))
+        })
+    }
+}
+```
+
+## Cancellation
+
+Cancellation on the Python side can be caught using [`CancelHandle`]({{#PYO3_DOCS_URL}}/pyo3/coroutine/struct.CancelHandle.html) type, by annotating a function parameter with `#[pyo3(cancel_handle)]`.
+
+```rust
+# #![allow(dead_code)]
+# #[cfg(feature = "experimental-async")] {
+use futures::FutureExt;
+use pyo3::prelude::*;
+use pyo3::coroutine::CancelHandle;
+
+#[pyfunction]
+async fn cancellable(#[pyo3(cancel_handle)] mut cancel: CancelHandle) {
+    futures::select! {
+        /* _ = ... => println!("done"), */
+        _ = cancel.cancelled().fuse() => println!("cancelled"),
+    }
+}
+# }
+```
+
+## The `Coroutine` type
+
+To make a Rust future awaitable in Python, PyO3 defines a [`Coroutine`]({{#PYO3_DOCS_URL}}/pyo3/coroutine/struct.Coroutine.html) type, which implements the Python [coroutine protocol](https://docs.python.org/3/library/collections.abc.html#collections.abc.Coroutine).
+
+Each `coroutine.send` call is translated to a `Future::poll` call. If a [`CancelHandle`]({{#PYO3_DOCS_URL}}/pyo3/coroutine/struct.CancelHandle.html) parameter is declared, the exception passed to `coroutine.throw` call is stored in it and can be retrieved with [`CancelHandle::cancelled`]({{#PYO3_DOCS_URL}}/pyo3/coroutine/struct.CancelHandle.html#method.cancelled); otherwise, it cancels the Rust future, and the exception is reraised;
+
+*The type does not yet have a public constructor until the design is finalized.*
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/building-and-distribution/multiple-python-versions.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/building-and-distribution/multiple-python-versions.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/building-and-distribution/multiple-python-versions.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/building-and-distribution/multiple-python-versions.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,108 @@
+# Supporting multiple Python versions
+
+PyO3 supports all actively-supported Python 3 and PyPy versions. As much as possible, this is done internally to PyO3 so that your crate's code does not need to adapt to the differences between each version. However, as Python features grow and change between versions, PyO3 cannot a completely identical API for every Python version. This may require you to add conditional compilation to your crate or runtime checks for the Python version.
+
+This section of the guide first introduces the `pyo3-build-config` crate, which you can use as a `build-dependency` to add additional `#[cfg]` flags which allow you to support multiple Python versions at compile-time.
+
+Second, we'll show how to check the Python version at runtime. This can be useful when building for multiple versions with the `abi3` feature, where the Python API compiled against is not always the same as the one in use.
+
+## Conditional compilation for different Python versions
+
+The `pyo3-build-config` exposes multiple [`#[cfg]` flags](https://doc.rust-lang.org/rust-by-example/attribute/cfg.html) which can be used to conditionally compile code for a given Python version. PyO3 itself depends on this crate, so by using it you can be sure that you are configured correctly for the Python version PyO3 is building against.
+
+This allows us to write code like the following
+
+```rust,ignore
+#[cfg(Py_3_7)]
+fn function_only_supported_on_python_3_7_and_up() {}
+
+#[cfg(not(Py_3_8))]
+fn function_only_supported_before_python_3_8() {}
+
+#[cfg(not(Py_LIMITED_API))]
+fn function_incompatible_with_abi3_feature() {}
+```
+
+The following sections first show how to add these `#[cfg]` flags to your build process, and then cover some common patterns flags in a little more detail.
+
+To see a full reference of all the `#[cfg]` flags provided, see the [`pyo3-build-cfg` docs](https://docs.rs/pyo3-build-config).
+
+### Using `pyo3-build-config`
+
+You can use the `#[cfg]` flags in just two steps:
+
+1. Add `pyo3-build-config` with the [`resolve-config`](../features.md#resolve-config) feature enabled to your crate's build dependencies in `Cargo.toml`:
+
+   ```toml
+   [build-dependencies]
+   pyo3-build-config = { {{#PYO3_CRATE_VERSION}}, features = ["resolve-config"] }
+   ```
+
+2. Add a [`build.rs`](https://doc.rust-lang.org/cargo/reference/build-scripts.html) file to your crate with the following contents:
+
+   ```rust,ignore
+   fn main() {
+       // If you have an existing build.rs file, just add this line to it.
+       pyo3_build_config::use_pyo3_cfgs();
+   }
+   ```
+
+After these steps you are ready to annotate your code!
+
+### Common usages of `pyo3-build-cfg` flags
+
+The `#[cfg]` flags added by `pyo3-build-cfg` can be combined with all of Rust's logic in the `#[cfg]` attribute to create very precise conditional code generation. The following are some common patterns implemented using these flags:
+
+```text
+#[cfg(Py_3_7)]
+```
+
+This `#[cfg]` marks code that will only be present on Python 3.7 and upwards. There are similar options `Py_3_8`, `Py_3_9`, `Py_3_10` and so on for each minor version.
+
+```text
+#[cfg(not(Py_3_7))]
+```
+
+This `#[cfg]` marks code that will only be present on Python versions before (but not including) Python 3.7.
+
+```text
+#[cfg(not(Py_LIMITED_API))]
+```
+
+This `#[cfg]` marks code that is only available when building for the unlimited Python API (i.e. PyO3's `abi3` feature is not enabled). This might be useful if you want to ship your extension module as an `abi3` wheel and also allow users to compile it from source to make use of optimizations only possible with the unlimited API.
+
+```text
+#[cfg(any(Py_3_9, not(Py_LIMITED_API)))]
+```
+
+This `#[cfg]` marks code which is available when running Python 3.9 or newer, or when using the unlimited API with an older Python version. Patterns like this are commonly seen on Python APIs which were added to the limited Python API in a specific minor version.
+
+```text
+#[cfg(PyPy)]
+```
+
+This `#[cfg]` marks code which is running on PyPy.
+
+## Checking the Python version at runtime
+
+When building with PyO3's `abi3` feature, your extension module will be compiled against a specific [minimum version](../building-and-distribution.md#minimum-python-version-for-abi3) of Python, but may be running on newer Python versions.
+
+For example with PyO3's `abi3-py38` feature, your extension will be compiled as if it were for Python 3.8. If you were using `pyo3-build-config`, `#[cfg(Py_3_8)]` would be present. Your user could freely install and run your abi3 extension on Python 3.9.
+
+There's no way to detect your user doing that at compile time, so instead you need to fall back to runtime checks.
+
+PyO3 provides the APIs [`Python::version()`] and [`Python::version_info()`] to query the running Python version. This allows you to do the following, for example:
+
+
+```rust
+use pyo3::Python;
+
+Python::with_gil(|py| {
+    // PyO3 supports Python 3.7 and up.
+    assert!(py.version_info() >= (3, 7));
+    assert!(py.version_info() >= (3, 7, 0));
+});
+```
+
+[`Python::version()`]: {{#PYO3_DOCS_URL}}/pyo3/marker/struct.Python.html#method.version
+[`Python::version_info()`]: {{#PYO3_DOCS_URL}}/pyo3/marker/struct.Python.html#method.version_info
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/building-and-distribution.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/building-and-distribution.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/building-and-distribution.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/building-and-distribution.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,351 @@
+# Building and distribution
+
+This chapter of the guide goes into detail on how to build and distribute projects using PyO3. The way to achieve this is very different depending on whether the project is a Python module implemented in Rust, or a Rust binary embedding Python. For both types of project there are also common problems such as the Python version to build for and the [linker](https://en.wikipedia.org/wiki/Linker_(computing)) arguments to use.
+
+The material in this chapter is intended for users who have already read the PyO3 [README](./index.md). It covers in turn the choices that can be made for Python modules and for Rust binaries. There is also a section at the end about cross-compiling projects using PyO3.
+
+There is an additional sub-chapter dedicated to [supporting multiple Python versions](./building-and-distribution/multiple-python-versions.md).
+
+## Configuring the Python version
+
+PyO3 uses a build script (backed by the [`pyo3-build-config`] crate) to determine the Python version and set the correct linker arguments. By default it will attempt to use the following in order:
+ - Any active Python virtualenv.
+ - The `python` executable (if it's a Python 3 interpreter).
+ - The `python3` executable.
+
+You can override the Python interpreter by setting the `PYO3_PYTHON` environment variable, e.g. `PYO3_PYTHON=python3.7`, `PYO3_PYTHON=/usr/bin/python3.9`, or even a PyPy interpreter `PYO3_PYTHON=pypy3`.
+
+Once the Python interpreter is located, `pyo3-build-config` executes it to query the information in the `sysconfig` module which is needed to configure the rest of the compilation.
+
+To validate the configuration which PyO3 will use, you can run a compilation with the environment variable `PYO3_PRINT_CONFIG=1` set. An example output of doing this is shown below:
+
+```console
+$ PYO3_PRINT_CONFIG=1 cargo build
+   Compiling pyo3 v0.14.1 (/home/david/dev/pyo3)
+error: failed to run custom build command for `pyo3 v0.14.1 (/home/david/dev/pyo3)`
+
+Caused by:
+  process didn't exit successfully: `/home/david/dev/pyo3/target/debug/build/pyo3-7a8cf4fe22e959b7/build-script-build` (exit status: 101)
+  --- stdout
+  cargo:rerun-if-env-changed=PYO3_CROSS
+  cargo:rerun-if-env-changed=PYO3_CROSS_LIB_DIR
+  cargo:rerun-if-env-changed=PYO3_CROSS_PYTHON_VERSION
+  cargo:rerun-if-env-changed=PYO3_PRINT_CONFIG
+
+  -- PYO3_PRINT_CONFIG=1 is set, printing configuration and halting compile --
+  implementation=CPython
+  version=3.8
+  shared=true
+  abi3=false
+  lib_name=python3.8
+  lib_dir=/usr/lib
+  executable=/usr/bin/python
+  pointer_width=64
+  build_flags=
+  suppress_build_script_link_lines=false
+```
+
+The `PYO3_ENVIRONMENT_SIGNATURE` environment variable can be used to trigger rebuilds when its value changes, it has no other effect.
+
+### Advanced: config files
+
+If you save the above output config from `PYO3_PRINT_CONFIG` to a file, it is possible to manually override the contents and feed it back into PyO3 using the `PYO3_CONFIG_FILE` env var.
+
+If your build environment is unusual enough that PyO3's regular configuration detection doesn't work, using a config file like this will give you the flexibility to make PyO3 work for you. To see the full set of options supported, see the documentation for the [`InterpreterConfig` struct](https://docs.rs/pyo3-build-config/{{#PYO3_DOCS_VERSION}}/pyo3_build_config/struct.InterpreterConfig.html).
+
+## Building Python extension modules
+
+Python extension modules need to be compiled differently depending on the OS (and architecture) that they are being compiled for. As well as multiple OSes (and architectures), there are also many different Python versions which are actively supported. Packages uploaded to [PyPI](https://pypi.org/) usually want to upload prebuilt "wheels" covering many OS/arch/version combinations so that users on all these different platforms don't have to compile the package themselves. Package vendors can opt-in to the "abi3" limited Python API which allows their wheels to be used on multiple Python versions, reducing the number of wheels they need to compile, but restricts the functionality they can use.
+
+There are many ways to go about this: it is possible to use `cargo` to build the extension module (along with some manual work, which varies with OS). The PyO3 ecosystem has two packaging tools, [`maturin`] and [`setuptools-rust`], which abstract over the OS difference and also support building wheels for PyPI upload.
+
+PyO3 has some Cargo features to configure projects for building Python extension modules:
+ - The `extension-module` feature, which must be enabled when building Python extension modules.
+ - The `abi3` feature and its version-specific `abi3-pyXY` companions, which are used to opt-in to the limited Python API in order to support multiple Python versions in a single wheel.
+
+This section describes each of these packaging tools before describing how to build manually without them. It then proceeds with an explanation of the `extension-module` feature. Finally, there is a section describing PyO3's `abi3` features.
+
+### Packaging tools
+
+The PyO3 ecosystem has two main choices to abstract the process of developing Python extension modules:
+- [`maturin`] is a command-line tool to build, package and upload Python modules. It makes opinionated choices about project layout meaning it needs very little configuration. This makes it a great choice for users who are building a Python extension from scratch and don't need flexibility.
+- [`setuptools-rust`] is an add-on for `setuptools` which adds extra keyword arguments to the `setup.py` configuration file. It requires more configuration than `maturin`, however this gives additional flexibility for users adding Rust to an existing Python package that can't satisfy `maturin`'s constraints.
+
+Consult each project's documentation for full details on how to get started using them and how to upload wheels to PyPI. It should be noted that while `maturin` is able to build [manylinux](https://github.com/pypa/manylinux)-compliant wheels out-of-the-box, `setuptools-rust` requires a bit more effort, [relying on Docker](https://setuptools-rust.readthedocs.io/en/latest/building_wheels.html) for this purpose.
+
+There are also [`maturin-starter`] and [`setuptools-rust-starter`] examples in the PyO3 repository.
+
+### Manual builds
+
+To build a PyO3-based Python extension manually, start by running `cargo build` as normal in a library project which uses PyO3's `extension-module` feature and has the [`cdylib` crate type](https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-crate-type-field).
+
+Once built, symlink (or copy) and rename the shared library from Cargo's `target/` directory to your desired output directory:
+- on macOS, rename `libyour_module.dylib` to `your_module.so`.
+- on Windows, rename  `libyour_module.dll` to `your_module.pyd`.
+- on Linux, rename `libyour_module.so` to `your_module.so`.
+
+You can then open a Python shell in the output directory and you'll be able to run `import your_module`.
+
+If you're packaging your library for redistribution, you should indicated the Python interpreter your library is compiled for by including the [platform tag](#platform-tags) in its name. This prevents incompatible interpreters from trying to import your library. If you're compiling for PyPy you *must* include the platform tag, or PyPy will ignore the module.
+
+#### Bazel builds
+
+To use PyO3 with bazel one needs to manually configure PyO3, PyO3-ffi and PyO3-macros. In particular, one needs to make sure that it is compiled with the right python flags for the version you intend to use.
+For example see:
+1. https://github.com/OliverFM/pytorch_with_gazelle -- for a minimal example of a repo that can use PyO3, PyTorch and Gazelle to generate python Build files.
+2. https://github.com/TheButlah/rules_pyo3 -- which has more extensive support, but is outdated.
+
+#### Platform tags
+
+Rather than using just the `.so` or `.pyd` extension suggested above (depending on OS), you can prefix the shared library extension with a platform tag to indicate the interpreter it is compatible with. You can query your interpreter's platform tag from the `sysconfig` module. Some example outputs of this are seen below:
+
+```bash
+# CPython 3.10 on macOS
+.cpython-310-darwin.so
+
+# PyPy 7.3 (Python 3.8) on Linux
+$ python -c 'import sysconfig; print(sysconfig.get_config_var("EXT_SUFFIX"))'
+.pypy38-pp73-x86_64-linux-gnu.so
+```
+
+So, for example, a valid module library name on CPython 3.10 for macOS is `your_module.cpython-310-darwin.so`, and its equivalent when compiled for PyPy 7.3 on Linux would be `your_module.pypy38-pp73-x86_64-linux-gnu.so`.
+
+See [PEP 3149](https://peps.python.org/pep-3149/) for more background on platform tags.
+
+#### macOS
+
+On macOS, because the `extension-module` feature disables linking to `libpython` ([see the next section](#the-extension-module-feature)), some additional linker arguments need to be set. `maturin` and `setuptools-rust` both pass these arguments for PyO3 automatically, but projects using manual builds will need to set these directly in order to support macOS.
+
+The easiest way to set the correct linker arguments is to add a [`build.rs`](https://doc.rust-lang.org/cargo/reference/build-scripts.html) with the following content:
+
+```rust,ignore
+fn main() {
+    pyo3_build_config::add_extension_module_link_args();
+}
+```
+
+Remember to also add `pyo3-build-config` to the `build-dependencies` section in `Cargo.toml`.
+
+An alternative to using `pyo3-build-config` is add the following to a cargo configuration file (e.g. `.cargo/config.toml`):
+
+```toml
+[target.x86_64-apple-darwin]
+rustflags = [
+  "-C", "link-arg=-undefined",
+  "-C", "link-arg=dynamic_lookup",
+]
+
+[target.aarch64-apple-darwin]
+rustflags = [
+  "-C", "link-arg=-undefined",
+  "-C", "link-arg=dynamic_lookup",
+]
+```
+
+Using the MacOS system python3 (`/usr/bin/python3`, as opposed to python installed via homebrew, pyenv, nix, etc.) may result in runtime errors such as `Library not loaded: @rpath/Python3.framework/Versions/3.8/Python3`. These can be resolved with another addition to `.cargo/config.toml`:
+
+```toml
+[build]
+rustflags = [
+  "-C", "link-args=-Wl,-rpath,/Library/Developer/CommandLineTools/Library/Frameworks",
+]
+```
+
+Alternatively, one can include in `build.rs`:
+
+```rust
+fn main() {
+    println!(
+        "cargo:rustc-link-arg=-Wl,-rpath,/Library/Developer/CommandLineTools/Library/Frameworks"
+    );
+}
+```
+
+For more discussion on and workarounds for MacOS linking problems [see this issue](https://github.com/PyO3/pyo3/issues/1800#issuecomment-906786649).
+
+Finally, don't forget that on MacOS the `extension-module` feature will cause `cargo test` to fail without the `--no-default-features` flag (see [the FAQ](https://pyo3.rs/main/faq.html#i-cant-run-cargo-test-or-i-cant-build-in-a-cargo-workspace-im-having-linker-issues-like-symbol-not-found-or-undefined-reference-to-_pyexc_systemerror)).
+
+### The `extension-module` feature
+
+PyO3's `extension-module` feature is used to disable [linking](https://en.wikipedia.org/wiki/Linker_(computing)) to `libpython` on Unix targets.
+
+This is necessary because by default PyO3 links to `libpython`. This makes binaries, tests, and examples "just work". However, Python extensions on Unix must not link to libpython for [manylinux](https://www.python.org/dev/peps/pep-0513/) compliance.
+
+The downside of not linking to `libpython` is that binaries, tests, and examples (which usually embed Python) will fail to build. If you have an extension module as well as other outputs in a single project, you need to use optional Cargo features to disable the `extension-module` when you're not building the extension module. See [the FAQ](faq.md#i-cant-run-cargo-test-or-i-cant-build-in-a-cargo-workspace-im-having-linker-issues-like-symbol-not-found-or-undefined-reference-to-_pyexc_systemerror) for an example workaround.
+
+### `Py_LIMITED_API`/`abi3`
+
+By default, Python extension modules can only be used with the same Python version they were compiled against. For example, an extension module built for Python 3.5 can't be imported in Python 3.8. [PEP 384](https://www.python.org/dev/peps/pep-0384/) introduced the idea of the limited Python API, which would have a stable ABI enabling extension modules built with it to be used against multiple Python versions. This is also known as `abi3`.
+
+The advantage of building extension modules using the limited Python API is that package vendors only need to build and distribute a single copy (for each OS / architecture), and users can install it on all Python versions from the [minimum version](#minimum-python-version-for-abi3) and up. The downside of this is that PyO3 can't use optimizations which rely on being compiled against a known exact Python version. It's up to you to decide whether this matters for your extension module. It's also possible to design your extension module such that you can distribute `abi3` wheels but allow users compiling from source to benefit from additional optimizations - see the [support for multiple python versions](./building-and-distribution/multiple-python-versions.md) section of this guide, in particular the `#[cfg(Py_LIMITED_API)]` flag.
+
+There are three steps involved in making use of `abi3` when building Python packages as wheels:
+
+1. Enable the `abi3` feature in `pyo3`. This ensures `pyo3` only calls Python C-API functions which are part of the stable API, and on Windows also ensures that the project links against the correct shared object (no special behavior is required on other platforms):
+
+```toml
+[dependencies]
+pyo3 = { {{#PYO3_CRATE_VERSION}}, features = ["abi3"] }
+```
+
+2. Ensure that the built shared objects are correctly marked as `abi3`. This is accomplished by telling your build system that you're using the limited API. [`maturin`] >= 0.9.0 and [`setuptools-rust`] >= 0.11.4 support `abi3` wheels.
+See the [corresponding](https://github.com/PyO3/maturin/pull/353) [PRs](https://github.com/PyO3/setuptools-rust/pull/82) for more.
+
+3. Ensure that the `.whl` is correctly marked as `abi3`. For projects using `setuptools`, this is accomplished by passing `--py-limited-api=cp3x` (where `x` is the minimum Python version supported by the wheel, e.g. `--py-limited-api=cp35` for Python 3.5) to `setup.py bdist_wheel`.
+
+#### Minimum Python version for `abi3`
+
+Because a single `abi3` wheel can be used with many different Python versions, PyO3 has feature flags `abi3-py37`, `abi3-py38`, `abi3-py39` etc. to set the minimum required Python version for your `abi3` wheel.
+For example, if you set the `abi3-py37` feature, your extension wheel can be used on all Python 3 versions from Python 3.7 and up. `maturin` and `setuptools-rust` will give the wheel a name like `my-extension-1.0-cp37-abi3-manylinux2020_x86_64.whl`.
+
+As your extension module may be run with multiple different Python versions you may occasionally find you need to check the Python version at runtime to customize behavior. See [the relevant section of this guide](./building-and-distribution/multiple-python-versions.md#checking-the-python-version-at-runtime) on supporting multiple Python versions at runtime.
+
+PyO3 is only able to link your extension module to abi3 version up to and including your host Python version. E.g., if you set `abi3-py38` and try to compile the crate with a host of Python 3.7, the build will fail.
+
+> Note: If you set more that one of these `abi3` version feature flags the lowest version always wins. For example, with both `abi3-py37` and `abi3-py38` set, PyO3 would build a wheel which supports Python 3.7 and up.
+
+#### Building `abi3` extensions without a Python interpreter
+
+As an advanced feature, you can build PyO3 wheel without calling Python interpreter with the environment variable `PYO3_NO_PYTHON` set.
+Also, if the build host Python interpreter is not found or is too old or otherwise unusable,
+PyO3 will still attempt to compile `abi3` extension modules after displaying a warning message.
+On Unix-like systems this works unconditionally; on Windows you must also set the `RUSTFLAGS` environment variable
+to contain `-L native=/path/to/python/libs` so that the linker can find `python3.lib`.
+
+If the `python3.dll` import library is not available, an experimental `generate-import-lib` crate
+feature may be enabled, and the required library will be created and used by PyO3 automatically.
+
+*Note*: MSVC targets require LLVM binutils (`llvm-dlltool`) to be available in `PATH` for
+the automatic import library generation feature to work.
+
+#### Missing features
+
+Due to limitations in the Python API, there are a few `pyo3` features that do
+not work when compiling for `abi3`. These are:
+
+- `#[pyo3(text_signature = "...")]` does not work on classes until Python 3.10 or greater.
+- The `dict` and `weakref` options on classes are not supported until Python 3.9 or greater.
+- The buffer API is not supported until Python 3.11 or greater.
+- Optimizations which rely on knowledge of the exact Python version compiled against.
+
+## Embedding Python in Rust
+
+If you want to embed the Python interpreter inside a Rust program, there are two modes in which this can be done: dynamically and statically. We'll cover each of these modes in the following sections. Each of them affect how you must distribute your program. Instead of learning how to do this yourself, you might want to consider using a project like [PyOxidizer] to ship your application and all of its dependencies in a single file.
+
+PyO3 automatically switches between the two linking modes depending on whether the Python distribution you have configured PyO3 to use ([see above](#configuring-the-python-version)) contains a shared library or a static library. The static library is most often seen in Python distributions compiled from source without the `--enable-shared` configuration option.
+
+### Dynamically embedding the Python interpreter
+
+Embedding the Python interpreter dynamically is much easier than doing so statically. This is done by linking your program against a Python shared library (such as `libpython.3.9.so` on UNIX, or `python39.dll` on Windows). The implementation of the Python interpreter resides inside the shared library. This means that when the OS runs your Rust program it also needs to be able to find the Python shared library.
+
+This mode of embedding works well for Rust tests which need access to the Python interpreter. It is also great for Rust software which is installed inside a Python virtualenv, because the virtualenv sets up appropriate environment variables to locate the correct Python shared library.
+
+For distributing your program to non-technical users, you will have to consider including the Python shared library in your distribution as well as setting up wrapper scripts to set the right environment variables (such as `LD_LIBRARY_PATH` on UNIX, or `PATH` on Windows).
+
+Note that PyPy cannot be embedded in Rust (or any other software). Support for this is tracked on the [PyPy issue tracker](https://github.com/pypy/pypy/issues/3836).
+
+### Statically embedding the Python interpreter
+
+Embedding the Python interpreter statically means including the contents of a Python static library directly inside your Rust binary. This means that to distribute your program you only need to ship your binary file: it contains the Python interpreter inside the binary!
+
+On Windows static linking is almost never done, so Python distributions don't usually include a static library. The information below applies only to UNIX.
+
+The Python static library is usually called `libpython.a`.
+
+Static linking has a lot of complications, listed below. For these reasons PyO3 does not yet have first-class support for this embedding mode. See [issue 416 on PyO3's GitHub](https://github.com/PyO3/pyo3/issues/416) for more information and to discuss any issues you encounter.
+
+The [`auto-initialize`](features.md#auto-initialize) feature is deliberately disabled when embedding the interpreter statically because this is often unintentionally done by new users to PyO3 running test programs. Trying out PyO3 is much easier using dynamic embedding.
+
+The known complications are:
+  - To import compiled extension modules (such as other Rust extension modules, or those written in C), your binary must have the correct linker flags set during compilation to export the original contents of `libpython.a` so that extensions can use them (e.g. `-Wl,--export-dynamic`).
+  - The C compiler and flags which were used to create `libpython.a` must be compatible with your Rust compiler and flags, else you will experience compilation failures.
+
+    Significantly different compiler versions may see errors like this:
+
+    ```text
+    lto1: fatal error: bytecode stream in file 'rust-numpy/target/release/deps/libpyo3-6a7fb2ed970dbf26.rlib' generated with LTO version 6.0 instead of the expected 6.2
+    ```
+
+    Mismatching flags may lead to errors like this:
+
+    ```text
+    /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libpython3.9.a(zlibmodule.o): relocation R_X86_64_32 against `.data' can not be used when making a PIE object; recompile with -fPIE
+    ```
+
+If you encounter these or other complications when linking the interpreter statically, discuss them on [issue 416 on PyO3's GitHub](https://github.com/PyO3/pyo3/issues/416). It is hoped that eventually that discussion will contain enough information and solutions that PyO3 can offer first-class support for static embedding.
+
+### Import your module when embedding the Python interpreter
+
+When you run your Rust binary with an embedded interpreter, any `#[pymodule]` created modules won't be accessible to import unless added to a table called `PyImport_Inittab` before the embedded interpreter is initialized. This will cause Python statements in your embedded interpreter such as `import your_new_module` to fail. You can call the macro [`append_to_inittab`]({{#PYO3_DOCS_URL}}/pyo3/macro.append_to_inittab.html) with your module before initializing the Python interpreter to add the module function into that table. (The Python interpreter will be initialized by calling `prepare_freethreaded_python`, `with_embedded_python_interpreter`, or `Python::with_gil` with the [`auto-initialize`](features.md#auto-initialize) feature enabled.)
+
+## Cross Compiling
+
+Thanks to Rust's great cross-compilation support, cross-compiling using PyO3 is relatively straightforward. To get started, you'll need a few pieces of software:
+
+* A toolchain for your target.
+* The appropriate options in your Cargo `.config` for the platform you're targeting and the toolchain you are using.
+* A Python interpreter that's already been compiled for your target (optional when building "abi3" extension modules).
+* A Python interpreter that is built for your host and available through the `PATH` or setting the [`PYO3_PYTHON`](#configuring-the-python-version) variable (optional when building "abi3" extension modules).
+
+After you've obtained the above, you can build a cross-compiled PyO3 module by using Cargo's `--target` flag. PyO3's build script will detect that you are attempting a cross-compile based on your host machine and the desired target.
+
+When cross-compiling, PyO3's build script cannot execute the target Python interpreter to query the configuration, so there are a few additional environment variables you may need to set:
+
+* `PYO3_CROSS`: If present this variable forces PyO3 to configure as a cross-compilation.
+* `PYO3_CROSS_LIB_DIR`: This variable can be set to the directory containing the target's libpython DSO and the associated `_sysconfigdata*.py` file for Unix-like targets, or the Python DLL import libraries for the Windows target. This variable is only needed when the output binary must link to libpython explicitly (e.g. when targeting Windows and Android or embedding a Python interpreter), or when it is absolutely required to get the interpreter configuration from `_sysconfigdata*.py`.
+* `PYO3_CROSS_PYTHON_VERSION`: Major and minor version (e.g. 3.9) of the target Python installation. This variable is only needed if PyO3 cannot determine the version to target from `abi3-py3*` features, or if `PYO3_CROSS_LIB_DIR` is not set, or if there are multiple versions of Python present in `PYO3_CROSS_LIB_DIR`.
+* `PYO3_CROSS_PYTHON_IMPLEMENTATION`: Python implementation name ("CPython" or "PyPy") of the target Python installation. CPython is assumed by default when this variable is not set, unless `PYO3_CROSS_LIB_DIR` is set for a Unix-like target and PyO3 can get the interpreter configuration from `_sysconfigdata*.py`.
+
+An experimental `pyo3` crate feature `generate-import-lib` enables the user to cross-compile
+extension modules for Windows targets without setting the `PYO3_CROSS_LIB_DIR` environment
+variable or providing any Windows Python library files. It uses an external [`python3-dll-a`] crate
+to generate import libraries for the Python DLL for MinGW-w64 and MSVC compile targets.
+`python3-dll-a` uses the binutils `dlltool` program to generate DLL import libraries for MinGW-w64 targets.
+It is possible to override the default `dlltool` command name for the cross target
+by setting `PYO3_MINGW_DLLTOOL` environment variable.
+*Note*: MSVC targets require LLVM binutils or MSVC build tools to be available on the host system.
+More specifically, `python3-dll-a` requires `llvm-dlltool` or `lib.exe` executable to be present in `PATH` when
+targeting `*-pc-windows-msvc`. The Zig compiler executable can be used in place of `llvm-dlltool` when the `ZIG_COMMAND`
+environment variable is set to the installed Zig program name (`"zig"` or `"python -m ziglang"`).
+
+An example might look like the following (assuming your target's sysroot is at `/home/pyo3/cross/sysroot` and that your target is `armv7`):
+
+```sh
+export PYO3_CROSS_LIB_DIR="/home/pyo3/cross/sysroot/usr/lib"
+
+cargo build --target armv7-unknown-linux-gnueabihf
+```
+
+If there are multiple python versions at the cross lib directory and you cannot set a more precise location to include both the `libpython` DSO and `_sysconfigdata*.py` files, you can set the required version:
+```sh
+export PYO3_CROSS_PYTHON_VERSION=3.8
+export PYO3_CROSS_LIB_DIR="/home/pyo3/cross/sysroot/usr/lib"
+
+cargo build --target armv7-unknown-linux-gnueabihf
+```
+
+Or another example with the same sys root but building for Windows:
+```sh
+export PYO3_CROSS_PYTHON_VERSION=3.9
+export PYO3_CROSS_LIB_DIR="/home/pyo3/cross/sysroot/usr/lib"
+
+cargo build --target x86_64-pc-windows-gnu
+```
+
+Any of the `abi3-py3*` features can be enabled instead of setting `PYO3_CROSS_PYTHON_VERSION` in the above examples.
+
+`PYO3_CROSS_LIB_DIR` can often be omitted when cross compiling extension modules for Unix and macOS targets,
+or when cross compiling extension modules for Windows and the experimental `generate-import-lib`
+crate feature is enabled.
+
+The following resources may also be useful for cross-compiling:
+ - [github.com/japaric/rust-cross](https://github.com/japaric/rust-cross) is a primer on cross compiling Rust.
+ - [github.com/rust-embedded/cross](https://github.com/rust-embedded/cross) uses Docker to make Rust cross-compilation easier.
+
+[`pyo3-build-config`]: https://github.com/PyO3/pyo3/tree/main/pyo3-build-config
+[`maturin-starter`]: https://github.com/PyO3/pyo3/tree/main/examples/maturin-starter
+[`setuptools-rust-starter`]: https://github.com/PyO3/pyo3/tree/main/examples/setuptools-rust-starter
+[`maturin`]: https://github.com/PyO3/maturin
+[`setuptools-rust`]: https://github.com/PyO3/setuptools-rust
+[PyOxidizer]: https://github.com/indygreg/PyOxidizer
+[`python3-dll-a`]: https://docs.rs/python3-dll-a/latest/python3_dll_a/
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/changelog.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/changelog.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/changelog.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/changelog.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{{#include ../../CHANGELOG.md}}
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/class/call.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/class/call.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/class/call.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/class/call.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,121 @@
+# Emulating callable objects
+
+Classes can be callable if they have a `#[pymethod]` named `__call__`.
+This allows instances of a class to behave similar to functions.
+
+This method's signature must look like `__call__(<self>, ...) -> object` - here,
+ any argument list can be defined as for normal pymethods
+
+### Example: Implementing a call counter
+
+The following pyclass is a basic decorator - its constructor takes a Python object
+as argument and calls that object when called. An equivalent Python implementation
+is linked at the end.
+
+An example crate containing this pyclass can be found [here](https://github.com/PyO3/pyo3/tree/main/examples/decorator)
+
+```rust,ignore
+{{#include ../../../examples/decorator/src/lib.rs}}
+```
+
+Python code:
+
+```python
+{{#include ../../../examples/decorator/tests/example.py}}
+```
+
+Output:
+
+```text
+say_hello has been called 1 time(s).
+hello
+say_hello has been called 2 time(s).
+hello
+say_hello has been called 3 time(s).
+hello
+say_hello has been called 4 time(s).
+hello
+```
+
+### Pure Python implementation
+
+A Python implementation of this looks similar to the Rust version:
+
+```python
+class Counter:
+    def __init__(self, wraps):
+        self.count = 0
+        self.wraps = wraps
+
+    def __call__(self, *args, **kwargs):
+        self.count += 1
+        print(f"{self.wraps.__name__} has been called {self.count} time(s)")
+        self.wraps(*args, **kwargs)
+```
+
+Note that it can also be implemented as a higher order function:
+
+```python
+def Counter(wraps):
+    count = 0
+    def call(*args, **kwargs):
+        nonlocal count
+        count += 1
+        print(f"{wraps.__name__} has been called {count} time(s)")
+        return wraps(*args, **kwargs)
+    return call
+```
+
+### What is the `Cell` for?
+
+A [previous implementation] used a normal `u64`, which meant it required a `&mut self` receiver to update the count:
+
+```rust,ignore
+#[pyo3(signature = (*args, **kwargs))]
+fn __call__(
+    &mut self,
+    py: Python<'_>,
+    args: &Bound<'_, PyTuple>,
+    kwargs: Option<&Bound<'_, PyDict>>,
+) -> PyResult<Py<PyAny>> {
+    self.count += 1;
+    let name = self.wraps.getattr(py, "__name__")?;
+
+    println!("{} has been called {} time(s).", name, self.count);
+
+    // After doing something, we finally forward the call to the wrapped function
+    let ret = self.wraps.call(py, args, kwargs)?;
+
+    // We could do something with the return value of
+    // the function before returning it
+    Ok(ret)
+}
+```
+
+The problem with this is that the `&mut self` receiver means PyO3 has to borrow it exclusively,
+ and hold this borrow across the`self.wraps.call(py, args, kwargs)` call. This call returns control to the user's Python code
+ which is free to call arbitrary things, *including* the decorated function. If that happens PyO3 is unable to create a second unique borrow and will be forced to raise an exception.
+
+As a result, something innocent like this will raise an exception:
+
+```py
+@Counter
+def say_hello():
+    if say_hello.count < 2:
+        print(f"hello from decorator")
+
+say_hello()
+# RuntimeError: Already borrowed
+```
+
+The implementation in this chapter fixes that by never borrowing exclusively; all the methods take `&self` as receivers, of which multiple may exist simultaneously. This requires a shared counter and the easiest way to do that is to use [`Cell`], so that's what is used here.
+
+This shows the dangers of running arbitrary Python code - note that "running arbitrary Python code" can be far more subtle than the example above:
+- Python's asynchronous executor may park the current thread in the middle of Python code, even in Python code that *you* control, and let other Python code run.
+- Dropping arbitrary Python objects may invoke destructors defined in Python (`__del__` methods).
+- Calling Python's C-api (most PyO3 apis call C-api functions internally) may raise exceptions, which may allow Python code in signal handlers to run.
+
+This is especially important if you are writing unsafe code; Python code must never be able to cause undefined behavior. You must ensure that your Rust code is in a consistent state before doing any of the above things.
+
+[previous implementation]: https://github.com/PyO3/pyo3/discussions/2598 "Thread Safe Decorator <Help Wanted> · Discussion #2598 · PyO3/pyo3"
+[`Cell`]: https://doc.rust-lang.org/std/cell/struct.Cell.html "Cell in std::cell - Rust"
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/class/numeric.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/class/numeric.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/class/numeric.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/class/numeric.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,445 @@
+# Emulating numeric types
+
+At this point we have a `Number` class that we can't actually do any math on!
+
+Before proceeding, we should think about how we want to handle overflows. There are three obvious solutions:
+- We can have infinite precision just like Python's `int`. However that would be quite boring - we'd
+ be reinventing the wheel.
+- We can raise exceptions whenever `Number` overflows, but that makes the API painful to use.
+- We can wrap around the boundary of `i32`. This is the approach we'll take here. To do that we'll just forward to `i32`'s
+ `wrapping_*` methods.
+
+### Fixing our constructor
+
+Let's address the first overflow, in `Number`'s constructor:
+
+```python
+from my_module import Number
+
+n = Number(1 << 1337)
+```
+
+```text
+Traceback (most recent call last):
+  File "example.py", line 3, in <module>
+    n = Number(1 << 1337)
+OverflowError: Python int too large to convert to C long
+```
+
+Instead of relying on the default [`FromPyObject`] extraction to parse arguments, we can specify our
+own extraction function, using the `#[pyo3(from_py_with = "...")]` attribute. Unfortunately PyO3
+doesn't provide a way to wrap Python integers out of the box, but we can do a Python call to mask it
+and cast it to an `i32`.
+
+```rust
+# #![allow(dead_code)]
+use pyo3::prelude::*;
+
+fn wrap(obj: &Bound<'_, PyAny>) -> PyResult<i32> {
+    let val = obj.call_method1("__and__", (0xFFFFFFFF_u32,))?;
+    let val: u32 = val.extract()?;
+    //     👇 This intentionally overflows!
+    Ok(val as i32)
+}
+```
+We also add documentation, via `///` comments, which are visible to Python users.
+
+```rust
+# #![allow(dead_code)]
+use pyo3::prelude::*;
+
+fn wrap(obj: &Bound<'_, PyAny>) -> PyResult<i32> {
+    let val = obj.call_method1("__and__", (0xFFFFFFFF_u32,))?;
+    let val: u32 = val.extract()?;
+    Ok(val as i32)
+}
+
+/// Did you ever hear the tragedy of Darth Signed The Overfloweth? I thought not.
+/// It's not a story C would tell you. It's a Rust legend.
+#[pyclass(module = "my_module")]
+struct Number(i32);
+
+#[pymethods]
+impl Number {
+    #[new]
+    fn new(#[pyo3(from_py_with = "wrap")] value: i32) -> Self {
+        Self(value)
+    }
+}
+```
+
+
+With that out of the way, let's implement some operators:
+```rust
+use pyo3::exceptions::{PyZeroDivisionError, PyValueError};
+
+# use pyo3::prelude::*;
+#
+# #[pyclass]
+# struct Number(i32);
+#
+#[pymethods]
+impl Number {
+    fn __add__(&self, other: &Self) -> Self {
+        Self(self.0.wrapping_add(other.0))
+    }
+
+    fn __sub__(&self, other: &Self) -> Self {
+        Self(self.0.wrapping_sub(other.0))
+    }
+
+    fn __mul__(&self, other: &Self) -> Self {
+        Self(self.0.wrapping_mul(other.0))
+    }
+
+    fn __truediv__(&self, other: &Self) -> PyResult<Self> {
+        match self.0.checked_div(other.0) {
+            Some(i) => Ok(Self(i)),
+            None => Err(PyZeroDivisionError::new_err("division by zero")),
+        }
+    }
+
+    fn __floordiv__(&self, other: &Self) -> PyResult<Self> {
+        match self.0.checked_div(other.0) {
+            Some(i) => Ok(Self(i)),
+            None => Err(PyZeroDivisionError::new_err("division by zero")),
+        }
+    }
+
+    fn __rshift__(&self, other: &Self) -> PyResult<Self> {
+        match other.0.try_into() {
+            Ok(rhs) => Ok(Self(self.0.wrapping_shr(rhs))),
+            Err(_) => Err(PyValueError::new_err("negative shift count")),
+        }
+    }
+
+    fn __lshift__(&self, other: &Self) -> PyResult<Self> {
+        match other.0.try_into() {
+            Ok(rhs) => Ok(Self(self.0.wrapping_shl(rhs))),
+            Err(_) => Err(PyValueError::new_err("negative shift count")),
+        }
+    }
+}
+```
+
+### Unary arithmetic operations
+
+```rust
+# use pyo3::prelude::*;
+#
+# #[pyclass]
+# struct Number(i32);
+#
+#[pymethods]
+impl Number {
+    fn __pos__(slf: PyRef<'_, Self>) -> PyRef<'_, Self> {
+        slf
+    }
+
+    fn __neg__(&self) -> Self {
+        Self(-self.0)
+    }
+
+    fn __abs__(&self) -> Self {
+        Self(self.0.abs())
+    }
+
+    fn __invert__(&self) -> Self {
+        Self(!self.0)
+    }
+}
+```
+
+### Support for the `complex()`, `int()` and `float()` built-in functions.
+
+```rust
+# use pyo3::prelude::*;
+#
+# #[pyclass]
+# struct Number(i32);
+#
+use pyo3::types::PyComplex;
+
+#[pymethods]
+impl Number {
+    fn __int__(&self) -> i32 {
+        self.0
+    }
+
+    fn __float__(&self) -> f64 {
+        self.0 as f64
+    }
+
+    fn __complex__<'py>(&self, py: Python<'py>) -> Bound<'py, PyComplex> {
+        PyComplex::from_doubles_bound(py, self.0 as f64, 0.0)
+    }
+}
+```
+
+We do not implement the in-place operations like `__iadd__` because we do not wish to mutate `Number`.
+Similarly we're not interested in supporting operations with different types, so we do not implement
+ the reflected operations like `__radd__` either.
+
+Now Python can use our `Number` class:
+
+```python
+from my_module import Number
+
+def hash_djb2(s: str):
+	'''
+	A version of Daniel J. Bernstein's djb2 string hashing algorithm
+	Like many hashing algorithms, it relies on integer wrapping.
+	'''
+
+	n = Number(0)
+	five = Number(5)
+
+	for x in s:
+		n = Number(ord(x)) + ((n << five) - n)
+	return n
+
+assert hash_djb2('l50_50') == Number(-1152549421)
+```
+
+### Final code
+
+```rust
+use std::collections::hash_map::DefaultHasher;
+use std::hash::{Hash, Hasher};
+
+use pyo3::exceptions::{PyValueError, PyZeroDivisionError};
+use pyo3::prelude::*;
+use pyo3::class::basic::CompareOp;
+use pyo3::types::{PyComplex, PyString};
+
+fn wrap(obj: &Bound<'_, PyAny>) -> PyResult<i32> {
+    let val = obj.call_method1("__and__", (0xFFFFFFFF_u32,))?;
+    let val: u32 = val.extract()?;
+    Ok(val as i32)
+}
+/// Did you ever hear the tragedy of Darth Signed The Overfloweth? I thought not.
+/// It's not a story C would tell you. It's a Rust legend.
+#[pyclass(module = "my_module")]
+struct Number(i32);
+
+#[pymethods]
+impl Number {
+    #[new]
+    fn new(#[pyo3(from_py_with = "wrap")] value: i32) -> Self {
+        Self(value)
+    }
+
+    fn __repr__(slf: &Bound<'_, Self>) -> PyResult<String> {
+       // Get the class name dynamically in case `Number` is subclassed
+       let class_name: Bound<'_, PyString> = slf.get_type().qualname()?;
+        Ok(format!("{}({})", class_name, slf.borrow().0))
+    }
+
+    fn __str__(&self) -> String {
+        self.0.to_string()
+    }
+
+    fn __hash__(&self) -> u64 {
+        let mut hasher = DefaultHasher::new();
+        self.0.hash(&mut hasher);
+        hasher.finish()
+    }
+
+    fn __richcmp__(&self, other: &Self, op: CompareOp) -> PyResult<bool> {
+        match op {
+            CompareOp::Lt => Ok(self.0 < other.0),
+            CompareOp::Le => Ok(self.0 <= other.0),
+            CompareOp::Eq => Ok(self.0 == other.0),
+            CompareOp::Ne => Ok(self.0 != other.0),
+            CompareOp::Gt => Ok(self.0 > other.0),
+            CompareOp::Ge => Ok(self.0 >= other.0),
+        }
+    }
+
+    fn __bool__(&self) -> bool {
+        self.0 != 0
+    }
+
+    fn __add__(&self, other: &Self) -> Self {
+        Self(self.0.wrapping_add(other.0))
+    }
+
+    fn __sub__(&self, other: &Self) -> Self {
+        Self(self.0.wrapping_sub(other.0))
+    }
+
+    fn __mul__(&self, other: &Self) -> Self {
+        Self(self.0.wrapping_mul(other.0))
+    }
+
+    fn __truediv__(&self, other: &Self) -> PyResult<Self> {
+        match self.0.checked_div(other.0) {
+            Some(i) => Ok(Self(i)),
+            None => Err(PyZeroDivisionError::new_err("division by zero")),
+        }
+    }
+
+    fn __floordiv__(&self, other: &Self) -> PyResult<Self> {
+        match self.0.checked_div(other.0) {
+            Some(i) => Ok(Self(i)),
+            None => Err(PyZeroDivisionError::new_err("division by zero")),
+        }
+    }
+
+    fn __rshift__(&self, other: &Self) -> PyResult<Self> {
+        match other.0.try_into() {
+            Ok(rhs) => Ok(Self(self.0.wrapping_shr(rhs))),
+            Err(_) => Err(PyValueError::new_err("negative shift count")),
+        }
+    }
+
+    fn __lshift__(&self, other: &Self) -> PyResult<Self> {
+        match other.0.try_into() {
+            Ok(rhs) => Ok(Self(self.0.wrapping_shl(rhs))),
+            Err(_) => Err(PyValueError::new_err("negative shift count")),
+        }
+    }
+
+    fn __xor__(&self, other: &Self) -> Self {
+        Self(self.0 ^ other.0)
+    }
+
+    fn __or__(&self, other: &Self) -> Self {
+        Self(self.0 | other.0)
+    }
+
+    fn __and__(&self, other: &Self) -> Self {
+        Self(self.0 & other.0)
+    }
+
+    fn __int__(&self) -> i32 {
+        self.0
+    }
+
+    fn __float__(&self) -> f64 {
+        self.0 as f64
+    }
+
+    fn __complex__<'py>(&self, py: Python<'py>) -> Bound<'py, PyComplex> {
+        PyComplex::from_doubles_bound(py, self.0 as f64, 0.0)
+    }
+}
+
+#[pymodule]
+fn my_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    m.add_class::<Number>()?;
+    Ok(())
+}
+# const SCRIPT: &'static str = r#"
+# def hash_djb2(s: str):
+#     n = Number(0)
+#     five = Number(5)
+#
+#     for x in s:
+#         n = Number(ord(x)) + ((n << five) - n)
+#     return n
+#
+# assert hash_djb2('l50_50') == Number(-1152549421)
+# assert hash_djb2('logo') == Number(3327403)
+# assert hash_djb2('horizon') == Number(1097468315)
+#
+#
+# assert Number(2) + Number(2) == Number(4)
+# assert Number(2) + Number(2) != Number(5)
+#
+# assert Number(13) - Number(7) == Number(6)
+# assert Number(13) - Number(-7) == Number(20)
+#
+# assert Number(13) / Number(7) == Number(1)
+# assert Number(13) // Number(7) == Number(1)
+#
+# assert Number(13) * Number(7) == Number(13*7)
+#
+# assert Number(13) > Number(7)
+# assert Number(13) < Number(20)
+# assert Number(13) == Number(13)
+# assert Number(13) >= Number(7)
+# assert Number(13) <= Number(20)
+# assert Number(13) == Number(13)
+#
+#
+# assert (True if Number(1) else False)
+# assert (False if Number(0) else True)
+#
+#
+# assert int(Number(13)) == 13
+# assert float(Number(13)) == 13
+# assert Number.__doc__ == "Did you ever hear the tragedy of Darth Signed The Overfloweth? I thought not.\nIt's not a story C would tell you. It's a Rust legend."
+# assert Number(12345234523452) == Number(1498514748)
+# try:
+#     import inspect
+#     assert inspect.signature(Number).__str__() == '(value)'
+# except ValueError:
+#     # Not supported with `abi3` before Python 3.10
+#     pass
+# assert Number(1337).__str__() == '1337'
+# assert Number(1337).__repr__() == 'Number(1337)'
+"#;
+
+#
+# use pyo3::PyTypeInfo;
+#
+# fn main() -> PyResult<()> {
+#     Python::with_gil(|py| -> PyResult<()> {
+#         let globals = PyModule::import_bound(py, "__main__")?.dict();
+#         globals.set_item("Number", Number::type_object_bound(py))?;
+#
+#         py.run_bound(SCRIPT, Some(&globals), None)?;
+#         Ok(())
+#     })
+# }
+```
+
+## Appendix: Writing some unsafe code
+
+At the beginning of this chapter we said that PyO3 doesn't provide a way to wrap Python integers out
+of the box but that's a half truth. There's not a PyO3 API for it, but there's a Python C API
+function that does:
+
+```c
+unsigned long PyLong_AsUnsignedLongMask(PyObject *obj)
+```
+
+We can call this function from Rust by using [`pyo3::ffi::PyLong_AsUnsignedLongMask`]. This is an *unsafe*
+function, which means we have to use an unsafe block to call it and take responsibility for upholding
+the contracts of this function. Let's review those contracts:
+- The GIL must be held. If it's not, calling this function causes a data race.
+- The pointer must be valid, i.e. it must be properly aligned and point to a valid Python object.
+
+Let's create that helper function. The signature has to be `fn(&Bound<'_, PyAny>) -> PyResult<T>`.
+- `&Bound<'_, PyAny>` represents a checked borrowed reference, so the pointer derived from it is valid (and not null).
+- Whenever we have borrowed references to Python objects in scope, it is guaranteed that the GIL is held. This reference is also where we can get a [`Python`] token to use in our call to [`PyErr::take`].
+
+```rust
+# #![allow(dead_code)]
+use std::os::raw::c_ulong;
+use pyo3::prelude::*;
+use pyo3::ffi;
+
+fn wrap(obj: &Bound<'_, PyAny>) -> Result<i32, PyErr> {
+    let py: Python<'_> = obj.py();
+
+    unsafe {
+        let ptr = obj.as_ptr();
+
+        let ret: c_ulong = ffi::PyLong_AsUnsignedLongMask(ptr);
+        if ret == c_ulong::MAX {
+            if let Some(err) = PyErr::take(py) {
+                return Err(err);
+            }
+        }
+
+        Ok(ret as i32)
+    }
+}
+```
+
+[`PyErr::take`]: {{#PYO3_DOCS_URL}}/pyo3/prelude/struct.PyErr.html#method.take
+[`Python`]: {{#PYO3_DOCS_URL}}/pyo3/marker/struct.Python.html
+[`FromPyObject`]: {{#PYO3_DOCS_URL}}/pyo3/conversion/trait.FromPyObject.html
+[`pyo3::ffi::PyLong_AsUnsignedLongMask`]: {{#PYO3_DOCS_URL}}/pyo3/ffi/fn.PyLong_AsUnsignedLongMask.html
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/class/object.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/class/object.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/class/object.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/class/object.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,343 @@
+# Basic object customization
+
+Recall the `Number` class from the previous chapter:
+
+```rust
+# #![allow(dead_code)]
+use pyo3::prelude::*;
+
+#[pyclass]
+struct Number(i32);
+
+#[pymethods]
+impl Number {
+    #[new]
+    fn new(value: i32) -> Self {
+        Self(value)
+    }
+}
+
+#[pymodule]
+fn my_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    m.add_class::<Number>()?;
+    Ok(())
+}
+```
+
+At this point Python code can import the module, access the class and create class instances - but
+nothing else.
+
+```python
+from my_module import Number
+
+n = Number(5)
+print(n)
+```
+
+```text
+<builtins.Number object at 0x000002B4D185D7D0>
+```
+
+### String representations
+
+It can't even print an user-readable representation of itself! We can fix that by defining the
+`__repr__` and `__str__` methods inside a `#[pymethods]` block. We do this by accessing the value
+contained inside `Number`.
+
+```rust
+# use pyo3::prelude::*;
+#
+# #[pyclass]
+# struct Number(i32);
+#
+#[pymethods]
+impl Number {
+    // For `__repr__` we want to return a string that Python code could use to recreate
+    // the `Number`, like `Number(5)` for example.
+    fn __repr__(&self) -> String {
+        // We use the `format!` macro to create a string. Its first argument is a
+        // format string, followed by any number of parameters which replace the
+        // `{}`'s in the format string.
+        //
+        //                       👇 Tuple field access in Rust uses a dot
+        format!("Number({})", self.0)
+    }
+    // `__str__` is generally used to create an "informal" representation, so we
+    // just forward to `i32`'s `ToString` trait implementation to print a bare number.
+    fn __str__(&self) -> String {
+        self.0.to_string()
+    }
+}
+```
+
+#### Accessing the class name
+
+In the `__repr__`, we used a hard-coded class name. This is sometimes not ideal,
+because if the class is subclassed in Python, we would like the repr to reflect
+the subclass name. This is typically done in Python code by accessing
+`self.__class__.__name__`. In order to be able to access the Python type information
+*and* the Rust struct, we need to use a `Bound` as the `self` argument.
+
+```rust
+# use pyo3::prelude::*;
+# use pyo3::types::PyString;
+#
+# #[pyclass]
+# struct Number(i32);
+#
+#[pymethods]
+impl Number {
+    fn __repr__(slf: &Bound<'_, Self>) -> PyResult<String> {
+        // This is the equivalent of `self.__class__.__name__` in Python.
+        let class_name: Bound<'_, PyString> = slf.get_type().qualname()?;
+        // To access fields of the Rust struct, we need to borrow the `PyCell`.
+        Ok(format!("{}({})", class_name, slf.borrow().0))
+    }
+}
+```
+
+### Hashing
+
+
+Let's also implement hashing. We'll just hash the `i32`. For that we need a [`Hasher`]. The one
+provided by `std` is [`DefaultHasher`], which uses the [SipHash] algorithm.
+
+```rust
+use std::collections::hash_map::DefaultHasher;
+
+// Required to call the `.hash` and `.finish` methods, which are defined on traits.
+use std::hash::{Hash, Hasher};
+
+# use pyo3::prelude::*;
+#
+# #[pyclass]
+# struct Number(i32);
+#
+#[pymethods]
+impl Number {
+    fn __hash__(&self) -> u64 {
+        let mut hasher = DefaultHasher::new();
+        self.0.hash(&mut hasher);
+        hasher.finish()
+    }
+}
+```
+To implement `__hash__` using the Rust [`Hash`] trait implementation, the `hash` option can be used.
+This option is only available for `frozen` classes to prevent accidental hash changes from mutating the object. If you need
+an `__hash__` implementation for a mutable class, use the manual method from above. This option also requires `eq`: According to the
+[Python docs](https://docs.python.org/3/reference/datamodel.html#object.__hash__) "If a class does not define an `__eq__()`
+method it should not define a `__hash__()` operation either"
+```rust
+# use pyo3::prelude::*;
+#
+#[pyclass(frozen, eq, hash)]
+#[derive(PartialEq, Hash)]
+struct Number(i32);
+```
+
+
+> **Note**: When implementing `__hash__` and comparisons, it is important that the following property holds:
+>
+> ```text
+> k1 == k2 -> hash(k1) == hash(k2)
+> ```
+>
+> In other words, if two keys are equal, their hashes must also be equal. In addition you must take
+> care that your classes' hash doesn't change during its lifetime. In this tutorial we do that by not
+> letting Python code change our `Number` class. In other words, it is immutable.
+>
+> By default, all `#[pyclass]` types have a default hash implementation from Python.
+> Types which should not be hashable can override this by setting `__hash__` to None.
+> This is the same mechanism as for a pure-Python class. This is done like so:
+>
+> ```rust
+> # use pyo3::prelude::*;
+> #[pyclass]
+> struct NotHashable {}
+>
+> #[pymethods]
+> impl NotHashable {
+>     #[classattr]
+>     const __hash__: Option<Py<PyAny>> = None;
+> }
+> ```
+
+### Comparisons
+
+PyO3 supports the usual magic comparison methods available in Python such as `__eq__`, `__lt__`
+and so on. It is also possible to support all six operations at once with `__richcmp__`.
+This method will be called with a value of `CompareOp` depending on the operation.
+
+```rust
+use pyo3::class::basic::CompareOp;
+
+# use pyo3::prelude::*;
+#
+# #[pyclass]
+# struct Number(i32);
+#
+#[pymethods]
+impl Number {
+    fn __richcmp__(&self, other: &Self, op: CompareOp) -> PyResult<bool> {
+        match op {
+            CompareOp::Lt => Ok(self.0 < other.0),
+            CompareOp::Le => Ok(self.0 <= other.0),
+            CompareOp::Eq => Ok(self.0 == other.0),
+            CompareOp::Ne => Ok(self.0 != other.0),
+            CompareOp::Gt => Ok(self.0 > other.0),
+            CompareOp::Ge => Ok(self.0 >= other.0),
+        }
+    }
+}
+```
+
+If you obtain the result by comparing two Rust values, as in this example, you
+can take a shortcut using `CompareOp::matches`:
+
+```rust
+use pyo3::class::basic::CompareOp;
+
+# use pyo3::prelude::*;
+#
+# #[pyclass]
+# struct Number(i32);
+#
+#[pymethods]
+impl Number {
+    fn __richcmp__(&self, other: &Self, op: CompareOp) -> bool {
+        op.matches(self.0.cmp(&other.0))
+    }
+}
+```
+
+It checks that the `std::cmp::Ordering` obtained from Rust's `Ord` matches
+the given `CompareOp`.
+
+Alternatively, you can implement just equality using `__eq__`:
+
+
+```rust
+# use pyo3::prelude::*;
+#
+# #[pyclass]
+# struct Number(i32);
+#
+#[pymethods]
+impl Number {
+    fn __eq__(&self, other: &Self) -> bool {
+        self.0 == other.0
+    }
+}
+
+# fn main() -> PyResult<()> {
+#     Python::with_gil(|py| {
+#         let x = &Bound::new(py, Number(4))?;
+#         let y = &Bound::new(py, Number(4))?;
+#         assert!(x.eq(y)?);
+#         assert!(!x.ne(y)?);
+#         Ok(())
+#     })
+# }
+```
+
+To implement `__eq__` using the Rust [`PartialEq`] trait implementation, the `eq` option can be used.
+
+```rust
+# use pyo3::prelude::*;
+#
+#[pyclass(eq)]
+#[derive(PartialEq)]
+struct Number(i32);
+```
+
+To implement `__lt__`, `__le__`, `__gt__`, & `__ge__` using the Rust `PartialOrd` trait implementation, the `ord` option can be used. *Note: Requires `eq`.*
+
+```rust
+# use pyo3::prelude::*;
+#
+#[pyclass(eq, ord)]
+#[derive(PartialEq, PartialOrd)]
+struct Number(i32);
+```
+
+### Truthyness
+
+We'll consider `Number` to be `True` if it is nonzero:
+
+```rust
+# use pyo3::prelude::*;
+#
+# #[pyclass]
+# struct Number(i32);
+#
+#[pymethods]
+impl Number {
+    fn __bool__(&self) -> bool {
+        self.0 != 0
+    }
+}
+```
+
+### Final code
+
+```rust
+use std::collections::hash_map::DefaultHasher;
+use std::hash::{Hash, Hasher};
+
+use pyo3::prelude::*;
+use pyo3::class::basic::CompareOp;
+use pyo3::types::PyString;
+
+#[pyclass]
+struct Number(i32);
+
+#[pymethods]
+impl Number {
+    #[new]
+    fn new(value: i32) -> Self {
+        Self(value)
+    }
+
+    fn __repr__(slf: &Bound<'_, Self>) -> PyResult<String> {
+        let class_name: Bound<'_, PyString> = slf.get_type().qualname()?;
+        Ok(format!("{}({})", class_name, slf.borrow().0))
+    }
+
+    fn __str__(&self) -> String {
+        self.0.to_string()
+    }
+
+    fn __hash__(&self) -> u64 {
+        let mut hasher = DefaultHasher::new();
+        self.0.hash(&mut hasher);
+        hasher.finish()
+    }
+
+    fn __richcmp__(&self, other: &Self, op: CompareOp) -> PyResult<bool> {
+        match op {
+            CompareOp::Lt => Ok(self.0 < other.0),
+            CompareOp::Le => Ok(self.0 <= other.0),
+            CompareOp::Eq => Ok(self.0 == other.0),
+            CompareOp::Ne => Ok(self.0 != other.0),
+            CompareOp::Gt => Ok(self.0 > other.0),
+            CompareOp::Ge => Ok(self.0 >= other.0),
+        }
+    }
+
+    fn __bool__(&self) -> bool {
+        self.0 != 0
+    }
+}
+
+#[pymodule]
+fn my_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    m.add_class::<Number>()?;
+    Ok(())
+}
+```
+
+[`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html
+[`Hasher`]: https://doc.rust-lang.org/std/hash/trait.Hasher.html
+[`DefaultHasher`]: https://doc.rust-lang.org/std/collections/hash_map/struct.DefaultHasher.html
+[SipHash]: https://en.wikipedia.org/wiki/SipHash
+[`PartialEq`]: https://doc.rust-lang.org/stable/std/cmp/trait.PartialEq.html
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/class/protocols.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/class/protocols.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/class/protocols.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/class/protocols.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,463 @@
+# Class customizations
+
+Python's object model defines several protocols for different object behavior, such as the sequence, mapping, and number protocols. Python classes support these protocols by implementing "magic" methods, such as `__str__` or `__repr__`. Because of the double-underscores surrounding their name, these are also known as "dunder" methods.
+
+PyO3 makes it possible for every magic method to be implemented in `#[pymethods]` just as they would be done in a regular Python class, with a few notable differences:
+- `__new__` and `__init__` are replaced by the [`#[new]` attribute](../class.md#constructor).
+- `__del__` is not yet supported, but may be in the future.
+- `__buffer__` and `__release_buffer__` are currently not supported and instead PyO3 supports [`__getbuffer__` and `__releasebuffer__`](#buffer-objects) methods (these predate [PEP 688](https://peps.python.org/pep-0688/#python-level-buffer-protocol)), again this may change in the future.
+- PyO3 adds [`__traverse__` and `__clear__`](#garbage-collector-integration) methods for controlling garbage collection.
+- The Python C-API which PyO3 is implemented upon requires many magic methods to have a specific function signature in C and be placed into special "slots" on the class type object. This limits the allowed argument and return types for these methods. They are listed in detail in the section below.
+
+If a magic method is not on the list above (for example `__init_subclass__`), then it should just work in PyO3. If this is not the case, please file a bug report.
+
+## Magic Methods handled by PyO3
+
+If a function name in `#[pymethods]` is a magic method which is known to need special handling, it will be automatically placed into the correct slot in the Python type object. The function name is taken from the usual rules for naming `#[pymethods]`: the `#[pyo3(name = "...")]` attribute is used if present, otherwise the Rust function name is used.
+
+The magic methods handled by PyO3 are very similar to the standard Python ones on [this page](https://docs.python.org/3/reference/datamodel.html#special-method-names) - in particular they are the subset which have slots as [defined here](https://docs.python.org/3/c-api/typeobj.html).
+
+When PyO3 handles a magic method, a couple of changes apply compared to other `#[pymethods]`:
+ - The Rust function signature is restricted to match the magic method.
+ - The `#[pyo3(signature = (...)]` and `#[pyo3(text_signature = "...")]` attributes are not allowed.
+
+The following sections list all magic methods for which PyO3 implements the necessary special handling.  The
+given signatures should be interpreted as follows:
+ - All methods take a receiver as first argument, shown as `<self>`. It can be
+   `&self`, `&mut self` or a `Bound` reference like `self_: PyRef<'_, Self>` and
+   `self_: PyRefMut<'_, Self>`, as described [here](../class.md#inheritance).
+ - An optional `Python<'py>` argument is always allowed as the first argument.
+ - Return values can be optionally wrapped in `PyResult`.
+ - `object` means that any type is allowed that can be extracted from a Python
+   object (if argument) or converted to a Python object (if return value).
+ - Other types must match what's given, e.g. `pyo3::basic::CompareOp` for
+   `__richcmp__`'s second argument.
+ - For the comparison and arithmetic methods, extraction errors are not
+   propagated as exceptions, but lead to a return of `NotImplemented`.
+ - For some magic methods, the return values are not restricted by PyO3, but
+   checked by the Python interpreter. For example, `__str__` needs to return a
+   string object.  This is indicated by `object (Python type)`.
+
+### Basic object customization
+
+  - `__str__(<self>) -> object (str)`
+  - `__repr__(<self>) -> object (str)`
+
+  - `__hash__(<self>) -> isize`
+
+    Objects that compare equal must have the same hash value. Any type up to 64 bits may be returned instead of `isize`, PyO3 will convert to an isize automatically (wrapping unsigned types like `u64` and `usize`).
+    <details>
+    <summary>Disabling Python's default hash</summary>
+    By default, all `#[pyclass]` types have a default hash implementation from Python. Types which should not be hashable can override this by setting `__hash__` to `None`. This is the same mechanism as for a pure-Python class. This is done like so:
+
+    ```rust
+    # use pyo3::prelude::*;
+    #
+    #[pyclass]
+    struct NotHashable {}
+
+    #[pymethods]
+    impl NotHashable {
+        #[classattr]
+        const __hash__: Option<PyObject> = None;
+    }
+    ```
+    </details>
+
+  - `__lt__(<self>, object) -> object`
+  - `__le__(<self>, object) -> object`
+  - `__eq__(<self>, object) -> object`
+  - `__ne__(<self>, object) -> object`
+  - `__gt__(<self>, object) -> object`
+  - `__ge__(<self>, object) -> object`
+
+    The implementations of Python's "rich comparison" operators `<`, `<=`, `==`, `!=`, `>` and `>=` respectively.
+
+    _Note that implementing any of these methods will cause Python not to generate a default `__hash__` implementation, so consider also implementing `__hash__`._
+    <details>
+    <summary>Return type</summary>
+    The return type will normally be `bool` or `PyResult<bool>`, however any Python object can be returned.
+    </details>
+
+  - `__richcmp__(<self>, object, pyo3::basic::CompareOp) -> object`
+
+    Implements Python comparison operations (`==`, `!=`, `<`, `<=`, `>`, and `>=`) in a single method.
+    The `CompareOp` argument indicates the comparison operation being performed. You can use
+    [`CompareOp::matches`] to adapt a Rust `std::cmp::Ordering` result to the requested comparison.
+
+    _This method cannot be implemented in combination with any of `__lt__`, `__le__`, `__eq__`, `__ne__`, `__gt__`, or `__ge__`._
+
+    _Note that implementing `__richcmp__` will cause Python not to generate a default `__hash__` implementation, so consider implementing `__hash__` when implementing `__richcmp__`._
+    <details>
+    <summary>Return type</summary>
+    The return type will normally be `PyResult<bool>`, but any Python object can be returned.
+
+    If you want to leave some operations unimplemented, you can return `py.NotImplemented()`
+    for some of the operations:
+
+    ```rust
+    use pyo3::class::basic::CompareOp;
+
+    # use pyo3::prelude::*;
+    #
+    # #[pyclass]
+    # struct Number(i32);
+    #
+    #[pymethods]
+    impl Number {
+        fn __richcmp__(&self, other: &Self, op: CompareOp, py: Python<'_>) -> PyObject {
+            match op {
+                CompareOp::Eq => (self.0 == other.0).into_py(py),
+                CompareOp::Ne => (self.0 != other.0).into_py(py),
+                _ => py.NotImplemented(),
+            }
+        }
+    }
+    ```
+
+    If the second argument `object` is not of the type specified in the
+    signature, the generated code will automatically `return NotImplemented`.
+    </details>
+
+  - `__getattr__(<self>, object) -> object`
+  - `__getattribute__(<self>, object) -> object`
+    <details>
+    <summary>Differences between `__getattr__` and `__getattribute__`</summary>
+    As in Python, `__getattr__` is only called if the attribute is not found
+    by normal attribute lookup.  `__getattribute__`, on the other hand, is
+    called for *every* attribute access.  If it wants to access existing
+    attributes on `self`, it needs to be very careful not to introduce
+    infinite recursion, and use `baseclass.__getattribute__()`.
+    </details>
+
+  - `__setattr__(<self>, value: object) -> ()`
+  - `__delattr__(<self>, object) -> ()`
+
+    Overrides attribute access.
+
+  - `__bool__(<self>) -> bool`
+
+    Determines the "truthyness" of an object.
+
+  - `__call__(<self>, ...) -> object` - here, any argument list can be defined
+    as for normal `pymethods`
+
+### Iterable objects
+
+Iterators can be defined using these methods:
+
+  - `__iter__(<self>) -> object`
+  - `__next__(<self>) -> Option<object> or IterNextOutput` ([see details](#returning-a-value-from-iteration))
+
+Returning `None` from `__next__` indicates that that there are no further items.
+
+Example:
+
+```rust
+use pyo3::prelude::*;
+
+#[pyclass]
+struct MyIterator {
+    iter: Box<dyn Iterator<Item = PyObject> + Send>,
+}
+
+#[pymethods]
+impl MyIterator {
+    fn __iter__(slf: PyRef<'_, Self>) -> PyRef<'_, Self> {
+        slf
+    }
+    fn __next__(mut slf: PyRefMut<'_, Self>) -> Option<PyObject> {
+        slf.iter.next()
+    }
+}
+```
+
+In many cases you'll have a distinction between the type being iterated over
+(i.e. the *iterable*) and the iterator it provides. In this case, the iterable
+only needs to implement `__iter__()` while the iterator must implement both
+`__iter__()` and `__next__()`. For example:
+
+```rust
+# use pyo3::prelude::*;
+
+#[pyclass]
+struct Iter {
+    inner: std::vec::IntoIter<usize>,
+}
+
+#[pymethods]
+impl Iter {
+    fn __iter__(slf: PyRef<'_, Self>) -> PyRef<'_, Self> {
+        slf
+    }
+
+    fn __next__(mut slf: PyRefMut<'_, Self>) -> Option<usize> {
+        slf.inner.next()
+    }
+}
+
+#[pyclass]
+struct Container {
+    iter: Vec<usize>,
+}
+
+#[pymethods]
+impl Container {
+    fn __iter__(slf: PyRef<'_, Self>) -> PyResult<Py<Iter>> {
+        let iter = Iter {
+            inner: slf.iter.clone().into_iter(),
+        };
+        Py::new(slf.py(), iter)
+    }
+}
+
+# Python::with_gil(|py| {
+#     let container = Container { iter: vec![1, 2, 3, 4] };
+#     let inst = pyo3::Py::new(py, container).unwrap();
+#     pyo3::py_run!(py, inst, "assert list(inst) == [1, 2, 3, 4]");
+#     pyo3::py_run!(py, inst, "assert list(iter(iter(inst))) == [1, 2, 3, 4]");
+# });
+```
+
+For more details on Python's iteration protocols, check out [the "Iterator Types" section of the library
+documentation](https://docs.python.org/library/stdtypes.html#iterator-types).
+
+#### Returning a value from iteration
+
+This guide has so far shown how to use `Option<T>` to implement yielding values
+during iteration.  In Python a generator can also return a value. To express
+this in Rust, PyO3 provides the [`IterNextOutput`] enum to both `Yield` values
+and `Return` a final value - see its docs for further details and an example.
+
+### Awaitable objects
+
+  - `__await__(<self>) -> object`
+  - `__aiter__(<self>) -> object`
+  - `__anext__(<self>) -> Option<object> or IterANextOutput`
+
+### Mapping & Sequence types
+
+The magic methods in this section can be used to implement Python container types. They are two main categories of container in Python: "mappings" such as `dict`, with arbitrary keys, and "sequences" such as `list` and `tuple`, with integer keys.
+
+The Python C-API which PyO3 is built upon has separate "slots" for sequences and mappings. When writing a `class` in pure Python, there is no such distinction in the implementation - a `__getitem__` implementation will fill the slots for both the mapping and sequence forms, for example.
+
+By default PyO3 reproduces the Python behaviour of filling both mapping and sequence slots. This makes sense for the "simple" case which matches Python, and also for sequences, where the mapping slot is used anyway to implement slice indexing.
+
+Mapping types usually will not want the sequence slots filled. Having them filled will lead to outcomes which may be unwanted, such as:
+- The mapping type will successfully cast to [`PySequence`]. This may lead to consumers of the type handling it incorrectly.
+- Python provides a default implementation of `__iter__` for sequences, which calls `__getitem__` with consecutive positive integers starting from 0 until an `IndexError` is returned. Unless the mapping only contains consecutive positive integer keys, this `__iter__` implementation will likely not be the intended behavior.
+
+Use the `#[pyclass(mapping)]` annotation to instruct PyO3 to only fill the mapping slots, leaving the sequence ones empty. This will apply to `__getitem__`, `__setitem__`, and `__delitem__`.
+
+Use the `#[pyclass(sequence)]` annotation to instruct PyO3 to fill the `sq_length` slot instead of the `mp_length` slot for `__len__`. This will help libraries such as `numpy` recognise the class as a sequence, however will also cause CPython to automatically add the sequence length to any negative indices before passing them to `__getitem__`. (`__getitem__`, `__setitem__` and `__delitem__` mapping slots are still used for sequences, for slice operations.)
+
+  - `__len__(<self>) -> usize`
+
+    Implements the built-in function `len()`.
+
+  - `__contains__(<self>, object) -> bool`
+
+    Implements membership test operators.
+    Should return true if `item` is in `self`, false otherwise.
+    For objects that don’t define `__contains__()`, the membership test simply
+    traverses the sequence until it finds a match.
+
+    <details>
+    <summary>Disabling Python's default contains</summary>
+
+    By default, all `#[pyclass]` types with an `__iter__` method support a
+    default implementation of the `in` operator. Types which do not want this
+    can override this by setting `__contains__` to `None`. This is the same
+    mechanism as for a pure-Python class. This is done like so:
+
+    ```rust
+    # use pyo3::prelude::*;
+    #
+    #[pyclass]
+    struct NoContains {}
+
+    #[pymethods]
+    impl NoContains {
+        #[classattr]
+        const __contains__: Option<PyObject> = None;
+    }
+    ```
+    </details>
+
+  - `__getitem__(<self>, object) -> object`
+
+    Implements retrieval of the `self[a]` element.
+
+    *Note:* Negative integer indexes are not handled specially by PyO3.
+    However, for classes with `#[pyclass(sequence)]`, when a negative index is
+    accessed via `PySequence::get_item`, the underlying C API already adjusts
+    the index to be positive.
+
+  - `__setitem__(<self>, object, object) -> ()`
+
+    Implements assignment to the `self[a]` element.
+    Should only be implemented if elements can be replaced.
+
+    Same behavior regarding negative indices as for `__getitem__`.
+
+  - `__delitem__(<self>, object) -> ()`
+
+    Implements deletion of the `self[a]` element.
+    Should only be implemented if elements can be deleted.
+
+    Same behavior regarding negative indices as for `__getitem__`.
+
+  * `fn __concat__(&self, other: impl FromPyObject) -> PyResult<impl ToPyObject>`
+
+    Concatenates two sequences.
+    Used by the `+` operator, after trying the numeric addition via
+    the `__add__` and `__radd__` methods.
+
+  * `fn __repeat__(&self, count: isize) -> PyResult<impl ToPyObject>`
+
+    Repeats the sequence `count` times.
+    Used by the `*` operator, after trying the numeric multiplication via
+    the `__mul__` and `__rmul__` methods.
+
+  * `fn __inplace_concat__(&self, other: impl FromPyObject) -> PyResult<impl ToPyObject>`
+
+    Concatenates two sequences.
+    Used by the `+=` operator, after trying the numeric addition via
+    the `__iadd__` method.
+
+  * `fn __inplace_repeat__(&self, count: isize) -> PyResult<impl ToPyObject>`
+
+    Concatenates two sequences.
+    Used by the `*=` operator, after trying the numeric multiplication via
+    the `__imul__` method.
+
+### Descriptors
+
+  - `__get__(<self>, object, object) -> object`
+  - `__set__(<self>, object, object) -> ()`
+  - `__delete__(<self>, object) -> ()`
+
+### Numeric types
+
+Binary arithmetic operations (`+`, `-`, `*`, `@`, `/`, `//`, `%`, `divmod()`,
+`pow()` and `**`, `<<`, `>>`, `&`, `^`, and `|`) and their reflected versions:
+
+(If the `object` is not of the type specified in the signature, the generated code
+will automatically `return NotImplemented`.)
+
+  - `__add__(<self>, object) -> object`
+  - `__radd__(<self>, object) -> object`
+  - `__sub__(<self>, object) -> object`
+  - `__rsub__(<self>, object) -> object`
+  - `__mul__(<self>, object) -> object`
+  - `__rmul__(<self>, object) -> object`
+  - `__matmul__(<self>, object) -> object`
+  - `__rmatmul__(<self>, object) -> object`
+  - `__floordiv__(<self>, object) -> object`
+  - `__rfloordiv__(<self>, object) -> object`
+  - `__truediv__(<self>, object) -> object`
+  - `__rtruediv__(<self>, object) -> object`
+  - `__divmod__(<self>, object) -> object`
+  - `__rdivmod__(<self>, object) -> object`
+  - `__mod__(<self>, object) -> object`
+  - `__rmod__(<self>, object) -> object`
+  - `__lshift__(<self>, object) -> object`
+  - `__rlshift__(<self>, object) -> object`
+  - `__rshift__(<self>, object) -> object`
+  - `__rrshift__(<self>, object) -> object`
+  - `__and__(<self>, object) -> object`
+  - `__rand__(<self>, object) -> object`
+  - `__xor__(<self>, object) -> object`
+  - `__rxor__(<self>, object) -> object`
+  - `__or__(<self>, object) -> object`
+  - `__ror__(<self>, object) -> object`
+  - `__pow__(<self>, object, object) -> object`
+  - `__rpow__(<self>, object, object) -> object`
+
+In-place assignment operations (`+=`, `-=`, `*=`, `@=`, `/=`, `//=`, `%=`,
+`**=`, `<<=`, `>>=`, `&=`, `^=`, `|=`):
+
+  - `__iadd__(<self>, object) -> ()`
+  - `__isub__(<self>, object) -> ()`
+  - `__imul__(<self>, object) -> ()`
+  - `__imatmul__(<self>, object) -> ()`
+  - `__itruediv__(<self>, object) -> ()`
+  - `__ifloordiv__(<self>, object) -> ()`
+  - `__imod__(<self>, object) -> ()`
+  - `__ipow__(<self>, object, object) -> ()`
+  - `__ilshift__(<self>, object) -> ()`
+  - `__irshift__(<self>, object) -> ()`
+  - `__iand__(<self>, object) -> ()`
+  - `__ixor__(<self>, object) -> ()`
+  - `__ior__(<self>, object) -> ()`
+
+Unary operations (`-`, `+`, `abs()` and `~`):
+
+  - `__pos__(<self>) -> object`
+  - `__neg__(<self>) -> object`
+  - `__abs__(<self>) -> object`
+  - `__invert__(<self>) -> object`
+
+Coercions:
+
+  - `__index__(<self>) -> object (int)`
+  - `__int__(<self>) -> object (int)`
+  - `__float__(<self>) -> object (float)`
+
+### Buffer objects
+
+  - `__getbuffer__(<self>, *mut ffi::Py_buffer, flags) -> ()`
+  - `__releasebuffer__(<self>, *mut ffi::Py_buffer) -> ()`
+    Errors returned from `__releasebuffer__` will be sent to `sys.unraiseablehook`. It is strongly advised to never return an error from `__releasebuffer__`, and if it really is necessary, to make best effort to perform any required freeing operations before returning. `__releasebuffer__` will not be called a second time; anything not freed will be leaked.
+
+### Garbage Collector Integration
+
+If your type owns references to other Python objects, you will need to integrate
+with Python's garbage collector so that the GC is aware of those references.  To
+do this, implement the two methods `__traverse__` and `__clear__`.  These
+correspond to the slots `tp_traverse` and `tp_clear` in the Python C API.
+`__traverse__` must call `visit.call()` for each reference to another Python
+object.  `__clear__` must clear out any mutable references to other Python
+objects (thus breaking reference cycles). Immutable references do not have to be
+cleared, as every cycle must contain at least one mutable reference.
+
+  - `__traverse__(<self>, pyo3::class::gc::PyVisit<'_>) -> Result<(), pyo3::class::gc::PyTraverseError>`
+  - `__clear__(<self>) -> ()`
+
+Example:
+
+```rust
+use pyo3::prelude::*;
+use pyo3::PyTraverseError;
+use pyo3::gc::PyVisit;
+
+#[pyclass]
+struct ClassWithGCSupport {
+    obj: Option<PyObject>,
+}
+
+#[pymethods]
+impl ClassWithGCSupport {
+    fn __traverse__(&self, visit: PyVisit<'_>) -> Result<(), PyTraverseError> {
+        if let Some(obj) = &self.obj {
+            visit.call(obj)?
+        }
+        Ok(())
+    }
+
+    fn __clear__(&mut self) {
+        // Clear reference, this decrements ref counter.
+        self.obj = None;
+    }
+}
+```
+
+Usually, an implementation of `__traverse__` should do nothing but calls to `visit.call`.
+Most importantly, safe access to the GIL is prohibited inside implementations of `__traverse__`,
+i.e. `Python::with_gil` will panic.
+
+> Note: these methods are part of the C API, PyPy does not necessarily honor them. If you are building for PyPy you should measure memory consumption to make sure you do not have runaway memory growth. See [this issue on the PyPy bug tracker](https://github.com/pypy/pypy/issues/3848).
+
+[`IterNextOutput`]: {{#PYO3_DOCS_URL}}/pyo3/pyclass/enum.IterNextOutput.html
+[`PySequence`]: {{#PYO3_DOCS_URL}}/pyo3/types/struct.PySequence.html
+[`CompareOp::matches`]: {{#PYO3_DOCS_URL}}/pyo3/pyclass/enum.CompareOp.html#method.matches
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/class.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/class.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/class.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/class.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1476 @@
+# Python classes
+
+PyO3 exposes a group of attributes powered by Rust's proc macro system for defining Python classes as Rust structs.
+
+The main attribute is `#[pyclass]`, which is placed upon a Rust `struct` or `enum` to generate a Python type for it. They will usually also have *one* `#[pymethods]`-annotated `impl` block for the struct, which is used to define Python methods and constants for the generated Python type. (If the [`multiple-pymethods`] feature is enabled, each `#[pyclass]` is allowed to have multiple `#[pymethods]` blocks.) `#[pymethods]` may also have implementations for Python magic methods such as `__str__`.
+
+This chapter will discuss the functionality and configuration these attributes offer. Below is a list of links to the relevant section of this chapter for each:
+
+- [`#[pyclass]`](#defining-a-new-class)
+  - [`#[pyo3(get, set)]`](#object-properties-using-pyo3get-set)
+- [`#[pymethods]`](#instance-methods)
+  - [`#[new]`](#constructor)
+  - [`#[getter]`](#object-properties-using-getter-and-setter)
+  - [`#[setter]`](#object-properties-using-getter-and-setter)
+  - [`#[staticmethod]`](#static-methods)
+  - [`#[classmethod]`](#class-methods)
+  - [`#[classattr]`](#class-attributes)
+  - [`#[args]`](#method-arguments)
+- [Magic methods and slots](class/protocols.md)
+- [Classes as function arguments](#classes-as-function-arguments)
+
+## Defining a new class
+
+To define a custom Python class, add the `#[pyclass]` attribute to a Rust struct or enum.
+```rust
+# #![allow(dead_code)]
+use pyo3::prelude::*;
+
+#[pyclass]
+struct MyClass {
+    inner: i32,
+}
+
+// A "tuple" struct
+#[pyclass]
+struct Number(i32);
+
+// PyO3 supports unit-only enums (which contain only unit variants)
+// These simple enums behave similarly to Python's enumerations (enum.Enum)
+#[pyclass(eq, eq_int)]
+#[derive(PartialEq)]
+enum MyEnum {
+    Variant,
+    OtherVariant = 30, // PyO3 supports custom discriminants.
+}
+
+// PyO3 supports custom discriminants in unit-only enums
+#[pyclass(eq, eq_int)]
+#[derive(PartialEq)]
+enum HttpResponse {
+    Ok = 200,
+    NotFound = 404,
+    Teapot = 418,
+    // ...
+}
+
+// PyO3 also supports enums with Struct and Tuple variants
+// These complex enums have sligtly different behavior from the simple enums above
+// They are meant to work with instance checks and match statement patterns
+// The variants can be mixed and matched
+// Struct variants have named fields while tuple enums generate generic names for fields in order _0, _1, _2, ...
+// Apart from this both types are functionally identical
+#[pyclass]
+enum Shape {
+    Circle { radius: f64 },
+    Rectangle { width: f64, height: f64 },
+    RegularPolygon(u32, f64),
+    Nothing(),
+}
+```
+
+The above example generates implementations for [`PyTypeInfo`] and [`PyClass`] for `MyClass`, `Number`, `MyEnum`, `HttpResponse`, and `Shape`. To see these generated implementations, refer to the [implementation details](#implementation-details) at the end of this chapter.
+
+### Restrictions
+
+To integrate Rust types with Python, PyO3 needs to place some restrictions on the types which can be annotated with `#[pyclass]`. In particular, they must have no lifetime parameters, no generic parameters, and must implement `Send`. The reason for each of these is explained below.
+
+#### No lifetime parameters
+
+Rust lifetimes are used by the Rust compiler to reason about a program's memory safety. They are a compile-time only concept; there is no way to access Rust lifetimes at runtime from a dynamic language like Python.
+
+As soon as Rust data is exposed to Python, there is no guarantee that the Rust compiler can make on how long the data will live. Python is a reference-counted language and those references can be held for an arbitrarily long time which is untraceable by the Rust compiler. The only possible way to express this correctly is to require that any `#[pyclass]` does not borrow data for any lifetime shorter than the `'static` lifetime, i.e. the `#[pyclass]` cannot have any lifetime parameters.
+
+When you need to share ownership of data between Python and Rust, instead of using borrowed references with lifetimes consider using reference-counted smart pointers such as [`Arc`] or [`Py`].
+
+#### No generic parameters
+
+A Rust `struct Foo<T>` with a generic parameter `T` generates new compiled implementations each time it is used with a different concrete type for `T`. These new implementations are generated by the compiler at each usage site. This is incompatible with wrapping `Foo` in Python, where there needs to be a single compiled implementation of `Foo` which is integrated with the Python interpreter.
+
+Currently, the best alternative is to write a macro which expands to a new `#[pyclass]` for each instantiation you want:
+
+```rust
+# #![allow(dead_code)]
+use pyo3::prelude::*;
+
+struct GenericClass<T> {
+    data: T,
+}
+
+macro_rules! create_interface {
+    ($name: ident, $type: ident) => {
+        #[pyclass]
+        pub struct $name {
+            inner: GenericClass<$type>,
+        }
+        #[pymethods]
+        impl $name {
+            #[new]
+            pub fn new(data: $type) -> Self {
+                Self {
+                    inner: GenericClass { data: data },
+                }
+            }
+        }
+    };
+}
+
+create_interface!(IntClass, i64);
+create_interface!(FloatClass, String);
+```
+
+#### Must be Send
+
+Because Python objects are freely shared between threads by the Python interpreter, there is no guarantee which thread will eventually drop the object. Therefore all types annotated with `#[pyclass]` must implement `Send` (unless annotated with [`#[pyclass(unsendable)]`](#customizing-the-class)).
+
+## Constructor
+
+By default, it is not possible to create an instance of a custom class from Python code.
+To declare a constructor, you need to define a method and annotate it with the `#[new]`
+attribute. Only Python's `__new__` method can be specified, `__init__` is not available.
+
+```rust
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+# #[pyclass]
+# struct Number(i32);
+#
+#[pymethods]
+impl Number {
+    #[new]
+    fn new(value: i32) -> Self {
+        Number(value)
+    }
+}
+```
+
+Alternatively, if your `new` method may fail you can return `PyResult<Self>`.
+
+```rust
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+# use pyo3::exceptions::PyValueError;
+# #[pyclass]
+# struct Nonzero(i32);
+#
+#[pymethods]
+impl Nonzero {
+    #[new]
+    fn py_new(value: i32) -> PyResult<Self> {
+        if value == 0 {
+            Err(PyValueError::new_err("cannot be zero"))
+        } else {
+            Ok(Nonzero(value))
+        }
+    }
+}
+```
+
+If you want to return an existing object (for example, because your `new`
+method caches the values it returns), `new` can return `pyo3::Py<Self>`.
+
+As you can see, the Rust method name is not important here; this way you can
+still, use `new()` for a Rust-level constructor.
+
+If no method marked with `#[new]` is declared, object instances can only be
+created from Rust, but not from Python.
+
+For arguments, see the [`Method arguments`](#method-arguments) section below.
+
+## Adding the class to a module
+
+The next step is to create the module initializer and add our class to it:
+
+```rust
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+# #[pyclass]
+# struct Number(i32);
+#
+#[pymodule]
+fn my_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    m.add_class::<Number>()?;
+    Ok(())
+}
+```
+
+## Bound<T> and interior mutability
+
+Often is useful to turn a `#[pyclass]` type `T` into a Python object and access it from Rust code. The [`Py<T>`] and [`Bound<'py, T>`] smart pointers are the ways to represent a Python object in PyO3's API. More detail can be found about them [in the Python objects](./types.md#pyo3s-smart-pointers) section of the guide.
+
+Most Python objects do not offer exclusive (`&mut`) access (see the [section on Python's memory model](./python-from-rust.md#pythons-memory-model)). However, Rust structs wrapped as Python objects (called `pyclass` types) often *do* need `&mut` access. Due to the GIL, PyO3 *can* guarantee exclusive access to them.
+
+The Rust borrow checker cannot reason about `&mut` references once an object's ownership has been passed to the Python interpreter. This means that borrow checking is done at runtime using with a scheme very similar to `std::cell::RefCell<T>`. This is known as [interior mutability](https://doc.rust-lang.org/book/ch15-05-interior-mutability.html).
+
+Users who are familiar with `RefCell<T>` can use `Py<T>` and `Bound<'py, T>` just like `RefCell<T>`.
+
+For users who are not very familiar with `RefCell<T>`, here is a reminder of Rust's rules of borrowing:
+- At any given time, you can have either (but not both of) one mutable reference or any number of immutable references.
+- References can never outlast the data they refer to.
+
+`Py<T>` and `Bound<'py, T>`, like `RefCell<T>`, ensure these borrowing rules by tracking references at runtime.
+
+```rust
+# use pyo3::prelude::*;
+#[pyclass]
+struct MyClass {
+    #[pyo3(get)]
+    num: i32,
+}
+Python::with_gil(|py| {
+    let obj = Bound::new(py, MyClass { num: 3 }).unwrap();
+    {
+        let obj_ref = obj.borrow(); // Get PyRef
+        assert_eq!(obj_ref.num, 3);
+        // You cannot get PyRefMut unless all PyRefs are dropped
+        assert!(obj.try_borrow_mut().is_err());
+    }
+    {
+        let mut obj_mut = obj.borrow_mut(); // Get PyRefMut
+        obj_mut.num = 5;
+        // You cannot get any other refs until the PyRefMut is dropped
+        assert!(obj.try_borrow().is_err());
+        assert!(obj.try_borrow_mut().is_err());
+    }
+
+    // You can convert `Bound` to a Python object
+    pyo3::py_run!(py, obj, "assert obj.num == 5");
+});
+```
+
+A `Bound<'py, T>` is restricted to the GIL lifetime `'py`. To make the object longer lived (for example, to store it in a struct on the
+Rust side), use `Py<T>`. `Py<T>` needs a `Python<'_>` token to allow access:
+
+```rust
+# use pyo3::prelude::*;
+#[pyclass]
+struct MyClass {
+    num: i32,
+}
+
+fn return_myclass() -> Py<MyClass> {
+    Python::with_gil(|py| Py::new(py, MyClass { num: 1 }).unwrap())
+}
+
+let obj = return_myclass();
+
+Python::with_gil(move |py| {
+    let bound = obj.bind(py); // Py<MyClass>::bind returns &Bound<'py, MyClass>
+    let obj_ref = bound.borrow(); // Get PyRef<T>
+    assert_eq!(obj_ref.num, 1);
+});
+```
+
+### frozen classes: Opting out of interior mutability
+
+As detailed above, runtime borrow checking is currently enabled by default. But a class can opt of out it by declaring itself `frozen`. It can still use interior mutability via standard Rust types like `RefCell` or `Mutex`, but it is not bound to the implementation provided by PyO3 and can choose the most appropriate strategy on field-by-field basis.
+
+Classes which are `frozen` and also `Sync`, e.g. they do use `Mutex` but not `RefCell`, can be accessed without needing the Python GIL via the `Bound::get` and `Py::get` methods:
+
+```rust
+use std::sync::atomic::{AtomicUsize, Ordering};
+# use pyo3::prelude::*;
+
+#[pyclass(frozen)]
+struct FrozenCounter {
+    value: AtomicUsize,
+}
+
+let py_counter: Py<FrozenCounter> = Python::with_gil(|py| {
+    let counter = FrozenCounter {
+        value: AtomicUsize::new(0),
+    };
+
+    Py::new(py, counter).unwrap()
+});
+
+py_counter.get().value.fetch_add(1, Ordering::Relaxed);
+
+Python::with_gil(move |_py| drop(py_counter));
+```
+
+Frozen classes are likely to become the default thereby guiding the PyO3 ecosystem towards a more deliberate application of interior mutability. Eventually, this should enable further optimizations of PyO3's internals and avoid downstream code paying the cost of interior mutability when it is not actually required.
+
+## Customizing the class
+
+{{#include ../pyclass-parameters.md}}
+
+These parameters are covered in various sections of this guide.
+
+### Return type
+
+Generally, `#[new]` methods have to return `T: Into<PyClassInitializer<Self>>` or
+`PyResult<T> where T: Into<PyClassInitializer<Self>>`.
+
+For constructors that may fail, you should wrap the return type in a PyResult as well.
+Consult the table below to determine which type your constructor should return:
+
+|                             | **Cannot fail**           | **May fail**                      |
+|-----------------------------|---------------------------|-----------------------------------|
+|**No inheritance**           | `T`                       | `PyResult<T>`                     |
+|**Inheritance(T Inherits U)**| `(T, U)`                  | `PyResult<(T, U)>`                |
+|**Inheritance(General Case)**| [`PyClassInitializer<T>`] | `PyResult<PyClassInitializer<T>>` |
+
+## Inheritance
+
+By default, `object`, i.e. `PyAny` is used as the base class. To override this default,
+use the `extends` parameter for `pyclass` with the full path to the base class.
+Currently, only classes defined in Rust and builtins provided by PyO3 can be inherited
+from; inheriting from other classes defined in Python is not yet supported
+([#991](https://github.com/PyO3/pyo3/issues/991)).
+
+
+For convenience, `(T, U)` implements `Into<PyClassInitializer<T>>` where `U` is the
+base class of `T`.
+But for a more deeply nested inheritance, you have to return `PyClassInitializer<T>`
+explicitly.
+
+To get a parent class from a child, use [`PyRef`] instead of `&self` for methods,
+or [`PyRefMut`] instead of `&mut self`.
+Then you can access a parent class by `self_.as_super()` as `&PyRef<Self::BaseClass>`,
+or by `self_.into_super()` as `PyRef<Self::BaseClass>` (and similar for the `PyRefMut`
+case). For convenience, `self_.as_ref()` can also be used to get `&Self::BaseClass`
+directly; however, this approach does not let you access base clases higher in the
+inheritance hierarchy, for which you would need to chain multiple `as_super` or
+`into_super` calls.
+
+```rust
+# use pyo3::prelude::*;
+
+#[pyclass(subclass)]
+struct BaseClass {
+    val1: usize,
+}
+
+#[pymethods]
+impl BaseClass {
+    #[new]
+    fn new() -> Self {
+        BaseClass { val1: 10 }
+    }
+
+    pub fn method1(&self) -> PyResult<usize> {
+        Ok(self.val1)
+    }
+}
+
+#[pyclass(extends=BaseClass, subclass)]
+struct SubClass {
+    val2: usize,
+}
+
+#[pymethods]
+impl SubClass {
+    #[new]
+    fn new() -> (Self, BaseClass) {
+        (SubClass { val2: 15 }, BaseClass::new())
+    }
+
+    fn method2(self_: PyRef<'_, Self>) -> PyResult<usize> {
+        let super_ = self_.as_super(); // Get &PyRef<BaseClass>
+        super_.method1().map(|x| x * self_.val2)
+    }
+}
+
+#[pyclass(extends=SubClass)]
+struct SubSubClass {
+    val3: usize,
+}
+
+#[pymethods]
+impl SubSubClass {
+    #[new]
+    fn new() -> PyClassInitializer<Self> {
+        PyClassInitializer::from(SubClass::new()).add_subclass(SubSubClass { val3: 20 })
+    }
+
+    fn method3(self_: PyRef<'_, Self>) -> PyResult<usize> {
+        let base = self_.as_super().as_super(); // Get &PyRef<'_, BaseClass>
+        base.method1().map(|x| x * self_.val3)
+    }
+
+    fn method4(self_: PyRef<'_, Self>) -> PyResult<usize> {
+        let v = self_.val3;
+        let super_ = self_.into_super(); // Get PyRef<'_, SubClass>
+        SubClass::method2(super_).map(|x| x * v)
+    }
+
+      fn get_values(self_: PyRef<'_, Self>) -> (usize, usize, usize) {
+          let val1 = self_.as_super().as_super().val1;
+          let val2 = self_.as_super().val2;
+          (val1, val2, self_.val3)
+      }
+
+    fn double_values(mut self_: PyRefMut<'_, Self>) {
+        self_.as_super().as_super().val1 *= 2;
+        self_.as_super().val2 *= 2;
+        self_.val3 *= 2;
+    }
+
+    #[staticmethod]
+    fn factory_method(py: Python<'_>, val: usize) -> PyResult<PyObject> {
+        let base = PyClassInitializer::from(BaseClass::new());
+        let sub = base.add_subclass(SubClass { val2: val });
+        if val % 2 == 0 {
+            Ok(Py::new(py, sub)?.to_object(py))
+        } else {
+            let sub_sub = sub.add_subclass(SubSubClass { val3: val });
+            Ok(Py::new(py, sub_sub)?.to_object(py))
+        }
+    }
+}
+# Python::with_gil(|py| {
+#     let subsub = pyo3::Py::new(py, SubSubClass::new()).unwrap();
+#     pyo3::py_run!(py, subsub, "assert subsub.method1() == 10");
+#     pyo3::py_run!(py, subsub, "assert subsub.method2() == 150");
+#     pyo3::py_run!(py, subsub, "assert subsub.method3() == 200");
+#     pyo3::py_run!(py, subsub, "assert subsub.method4() == 3000");
+#     pyo3::py_run!(py, subsub, "assert subsub.get_values() == (10, 15, 20)");
+#     pyo3::py_run!(py, subsub, "assert subsub.double_values() == None");
+#     pyo3::py_run!(py, subsub, "assert subsub.get_values() == (20, 30, 40)");
+#     let subsub = SubSubClass::factory_method(py, 2).unwrap();
+#     let subsubsub = SubSubClass::factory_method(py, 3).unwrap();
+#     let cls = py.get_type_bound::<SubSubClass>();
+#     pyo3::py_run!(py, subsub cls, "assert not isinstance(subsub, cls)");
+#     pyo3::py_run!(py, subsubsub cls, "assert isinstance(subsubsub, cls)");
+# });
+```
+
+You can inherit native types such as `PyDict`, if they implement
+[`PySizedLayout`]({{#PYO3_DOCS_URL}}/pyo3/type_object/trait.PySizedLayout.html).
+This is not supported when building for the Python limited API (aka the `abi3` feature of PyO3).
+
+To convert between the Rust type and its native base class, you can take
+`slf` as a Python object. To access the Rust fields use `slf.borrow()` or
+`slf.borrow_mut()`, and to access the base class use `slf.downcast::<BaseClass>()`.
+
+```rust
+# #[cfg(not(Py_LIMITED_API))] {
+# use pyo3::prelude::*;
+use pyo3::types::PyDict;
+use std::collections::HashMap;
+
+#[pyclass(extends=PyDict)]
+#[derive(Default)]
+struct DictWithCounter {
+    counter: HashMap<String, usize>,
+}
+
+#[pymethods]
+impl DictWithCounter {
+    #[new]
+    fn new() -> Self {
+        Self::default()
+    }
+
+    fn set(slf: &Bound<'_, Self>, key: String, value: Bound<'_, PyAny>) -> PyResult<()> {
+        slf.borrow_mut().counter.entry(key.clone()).or_insert(0);
+        let dict = slf.downcast::<PyDict>()?;
+        dict.set_item(key, value)
+    }
+}
+# Python::with_gil(|py| {
+#     let cnt = pyo3::Py::new(py, DictWithCounter::new()).unwrap();
+#     pyo3::py_run!(py, cnt, "cnt.set('abc', 10); assert cnt['abc'] == 10")
+# });
+# }
+```
+
+If `SubClass` does not provide a base class initialization, the compilation fails.
+```rust,compile_fail
+# use pyo3::prelude::*;
+
+#[pyclass]
+struct BaseClass {
+    val1: usize,
+}
+
+#[pyclass(extends=BaseClass)]
+struct SubClass {
+    val2: usize,
+}
+
+#[pymethods]
+impl SubClass {
+    #[new]
+    fn new() -> Self {
+        SubClass { val2: 15 }
+    }
+}
+```
+
+The `__new__` constructor of a native base class is called implicitly when
+creating a new instance from Python.  Be sure to accept arguments in the
+`#[new]` method that you want the base class to get, even if they are not used
+in that `fn`:
+
+```rust
+# #[allow(dead_code)]
+# #[cfg(not(Py_LIMITED_API))] {
+# use pyo3::prelude::*;
+use pyo3::types::PyDict;
+
+#[pyclass(extends=PyDict)]
+struct MyDict {
+    private: i32,
+}
+
+#[pymethods]
+impl MyDict {
+    #[new]
+    #[pyo3(signature = (*args, **kwargs))]
+    fn new(args: &Bound<'_, PyAny>, kwargs: Option<&Bound<'_, PyAny>>) -> Self {
+        Self { private: 0 }
+    }
+
+    // some custom methods that use `private` here...
+}
+# Python::with_gil(|py| {
+#     let cls = py.get_type_bound::<MyDict>();
+#     pyo3::py_run!(py, cls, "cls(a=1, b=2)")
+# });
+# }
+```
+
+Here, the `args` and `kwargs` allow creating instances of the subclass passing
+initial items, such as `MyDict(item_sequence)` or `MyDict(a=1, b=2)`.
+
+## Object properties
+
+PyO3 supports two ways to add properties to your `#[pyclass]`:
+- For simple struct fields with no side effects, a `#[pyo3(get, set)]` attribute can be added directly to the field definition in the `#[pyclass]`.
+- For properties which require computation you can define `#[getter]` and `#[setter]` functions in the [`#[pymethods]`](#instance-methods) block.
+
+We'll cover each of these in the following sections.
+
+### Object properties using `#[pyo3(get, set)]`
+
+For simple cases where a member variable is just read and written with no side effects, you can declare getters and setters in your `#[pyclass]` field definition using the `pyo3` attribute, like in the example below:
+
+```rust
+# use pyo3::prelude::*;
+#[pyclass]
+struct MyClass {
+    #[pyo3(get, set)]
+    num: i32,
+}
+```
+
+The above would make the `num` field available for reading and writing as a `self.num` Python property. To expose the property with a different name to the field, specify this alongside the rest of the options, e.g. `#[pyo3(get, set, name = "custom_name")]`.
+
+Properties can be readonly or writeonly by using just `#[pyo3(get)]` or `#[pyo3(set)]` respectively.
+
+To use these annotations, your field type must implement some conversion traits:
+- For `get` the field type must implement both `IntoPy<PyObject>` and `Clone`.
+- For `set` the field type must implement `FromPyObject`.
+
+For example, implementations of those traits are provided for the `Cell` type, if the inner type also implements the trait. This means you can use `#[pyo3(get, set)]` on fields wrapped in a `Cell`.
+
+### Object properties using `#[getter]` and `#[setter]`
+
+For cases which don't satisfy the `#[pyo3(get, set)]` trait requirements, or need side effects, descriptor methods can be defined in a `#[pymethods]` `impl` block.
+
+This is done using the `#[getter]` and `#[setter]` attributes, like in the example below:
+
+```rust
+# use pyo3::prelude::*;
+#[pyclass]
+struct MyClass {
+    num: i32,
+}
+
+#[pymethods]
+impl MyClass {
+    #[getter]
+    fn num(&self) -> PyResult<i32> {
+        Ok(self.num)
+    }
+}
+```
+
+A getter or setter's function name is used as the property name by default. There are several
+ways how to override the name.
+
+If a function name starts with `get_` or `set_` for getter or setter respectively,
+the descriptor name becomes the function name with this prefix removed. This is also useful in case of
+Rust keywords like `type`
+([raw identifiers](https://doc.rust-lang.org/edition-guide/rust-2018/module-system/raw-identifiers.html)
+can be used since Rust 2018).
+
+```rust
+# use pyo3::prelude::*;
+# #[pyclass]
+# struct MyClass {
+#     num: i32,
+# }
+#[pymethods]
+impl MyClass {
+    #[getter]
+    fn get_num(&self) -> PyResult<i32> {
+        Ok(self.num)
+    }
+
+    #[setter]
+    fn set_num(&mut self, value: i32) -> PyResult<()> {
+        self.num = value;
+        Ok(())
+    }
+}
+```
+
+In this case, a property `num` is defined and available from Python code as `self.num`.
+
+Both the `#[getter]` and `#[setter]` attributes accept one parameter.
+If this parameter is specified, it is used as the property name, i.e.
+
+```rust
+# use pyo3::prelude::*;
+# #[pyclass]
+# struct MyClass {
+#    num: i32,
+# }
+#[pymethods]
+impl MyClass {
+    #[getter(number)]
+    fn num(&self) -> PyResult<i32> {
+        Ok(self.num)
+    }
+
+    #[setter(number)]
+    fn set_num(&mut self, value: i32) -> PyResult<()> {
+        self.num = value;
+        Ok(())
+    }
+}
+```
+
+In this case, the property `number` is defined and available from Python code as `self.number`.
+
+Attributes defined by `#[setter]` or `#[pyo3(set)]` will always raise `AttributeError` on `del`
+operations. Support for defining custom `del` behavior is tracked in
+[#1778](https://github.com/PyO3/pyo3/issues/1778).
+
+## Instance methods
+
+To define a Python compatible method, an `impl` block for your struct has to be annotated with the
+`#[pymethods]` attribute. PyO3 generates Python compatible wrappers for all functions in this
+block with some variations, like descriptors, class method static methods, etc.
+
+Since Rust allows any number of `impl` blocks, you can easily split methods
+between those accessible to Python (and Rust) and those accessible only to Rust. However to have multiple
+`#[pymethods]`-annotated `impl` blocks for the same struct you must enable the [`multiple-pymethods`] feature of PyO3.
+
+```rust
+# use pyo3::prelude::*;
+# #[pyclass]
+# struct MyClass {
+#     num: i32,
+# }
+#[pymethods]
+impl MyClass {
+    fn method1(&self) -> PyResult<i32> {
+        Ok(10)
+    }
+
+    fn set_method(&mut self, value: i32) -> PyResult<()> {
+        self.num = value;
+        Ok(())
+    }
+}
+```
+
+Calls to these methods are protected by the GIL, so both `&self` and `&mut self` can be used.
+The return type must be `PyResult<T>` or `T` for some `T` that implements `IntoPy<PyObject>`;
+the latter is allowed if the method cannot raise Python exceptions.
+
+A `Python` parameter can be specified as part of method signature, in this case the `py` argument
+gets injected by the method wrapper, e.g.
+
+```rust
+# use pyo3::prelude::*;
+# #[pyclass]
+# struct MyClass {
+# #[allow(dead_code)]
+#     num: i32,
+# }
+#[pymethods]
+impl MyClass {
+    fn method2(&self, py: Python<'_>) -> PyResult<i32> {
+        Ok(10)
+    }
+}
+```
+
+From the Python perspective, the `method2` in this example does not accept any arguments.
+
+## Class methods
+
+To create a class method for a custom class, the method needs to be annotated
+with the `#[classmethod]` attribute.
+This is the equivalent of the Python decorator `@classmethod`.
+
+```rust
+# use pyo3::prelude::*;
+# use pyo3::types::PyType;
+# #[pyclass]
+# struct MyClass {
+#     #[allow(dead_code)]
+#     num: i32,
+# }
+#[pymethods]
+impl MyClass {
+    #[classmethod]
+    fn cls_method(cls: &Bound<'_, PyType>) -> PyResult<i32> {
+        Ok(10)
+    }
+}
+```
+
+Declares a class method callable from Python.
+
+* The first parameter is the type object of the class on which the method is called.
+  This may be the type object of a derived class.
+* The first parameter implicitly has type `&Bound<'_, PyType>`.
+* For details on `parameter-list`, see the documentation of `Method arguments` section.
+* The return type must be `PyResult<T>` or `T` for some `T` that implements `IntoPy<PyObject>`.
+
+### Constructors which accept a class argument
+
+To create a constructor which takes a positional class argument, you can combine the `#[classmethod]` and `#[new]` modifiers:
+```rust
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+# use pyo3::types::PyType;
+# #[pyclass]
+# struct BaseClass(PyObject);
+#
+#[pymethods]
+impl BaseClass {
+    #[new]
+    #[classmethod]
+    fn py_new(cls: &Bound<'_, PyType>) -> PyResult<Self> {
+        // Get an abstract attribute (presumably) declared on a subclass of this class.
+        let subclass_attr: Bound<'_, PyAny> = cls.getattr("a_class_attr")?;
+        Ok(Self(subclass_attr.unbind()))
+    }
+}
+```
+
+## Static methods
+
+To create a static method for a custom class, the method needs to be annotated with the
+`#[staticmethod]` attribute. The return type must be `T` or `PyResult<T>` for some `T` that implements
+`IntoPy<PyObject>`.
+
+```rust
+# use pyo3::prelude::*;
+# #[pyclass]
+# struct MyClass {
+#     #[allow(dead_code)]
+#     num: i32,
+# }
+#[pymethods]
+impl MyClass {
+    #[staticmethod]
+    fn static_method(param1: i32, param2: &str) -> PyResult<i32> {
+        Ok(10)
+    }
+}
+```
+
+## Class attributes
+
+To create a class attribute (also called [class variable][classattr]), a method without
+any arguments can be annotated with the `#[classattr]` attribute.
+
+```rust
+# use pyo3::prelude::*;
+# #[pyclass]
+# struct MyClass {}
+#[pymethods]
+impl MyClass {
+    #[classattr]
+    fn my_attribute() -> String {
+        "hello".to_string()
+    }
+}
+
+Python::with_gil(|py| {
+    let my_class = py.get_type_bound::<MyClass>();
+    pyo3::py_run!(py, my_class, "assert my_class.my_attribute == 'hello'")
+});
+```
+
+> Note: if the method has a `Result` return type and returns an `Err`, PyO3 will panic during
+class creation.
+
+If the class attribute is defined with `const` code only, one can also annotate associated
+constants:
+
+```rust
+# use pyo3::prelude::*;
+# #[pyclass]
+# struct MyClass {}
+#[pymethods]
+impl MyClass {
+    #[classattr]
+    const MY_CONST_ATTRIBUTE: &'static str = "foobar";
+}
+```
+
+## Classes as function arguments
+
+Free functions defined using `#[pyfunction]` interact with classes through the same mechanisms as the self parameters of instance methods, i.e. they can take GIL-bound references, GIL-bound reference wrappers or GIL-indepedent references:
+
+```rust
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+#[pyclass]
+struct MyClass {
+    my_field: i32,
+}
+
+// Take a reference when the underlying `Bound` is irrelevant.
+#[pyfunction]
+fn increment_field(my_class: &mut MyClass) {
+    my_class.my_field += 1;
+}
+
+// Take a reference wrapper when borrowing should be automatic,
+// but interaction with the underlying `Bound` is desired.
+#[pyfunction]
+fn print_field(my_class: PyRef<'_, MyClass>) {
+    println!("{}", my_class.my_field);
+}
+
+// Take a reference to the underlying Bound
+// when borrowing needs to be managed manually.
+#[pyfunction]
+fn increment_then_print_field(my_class: &Bound<'_, MyClass>) {
+    my_class.borrow_mut().my_field += 1;
+
+    println!("{}", my_class.borrow().my_field);
+}
+
+// Take a GIL-indepedent reference when you want to store the reference elsewhere.
+#[pyfunction]
+fn print_refcnt(my_class: Py<MyClass>, py: Python<'_>) {
+    println!("{}", my_class.get_refcnt(py));
+}
+```
+
+Classes can also be passed by value if they can be cloned, i.e. they automatically implement `FromPyObject` if they implement `Clone`, e.g. via `#[derive(Clone)]`:
+
+```rust
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+#[pyclass]
+#[derive(Clone)]
+struct MyClass {
+    my_field: Box<i32>,
+}
+
+#[pyfunction]
+fn dissamble_clone(my_class: MyClass) {
+    let MyClass { mut my_field } = my_class;
+    *my_field += 1;
+}
+```
+
+Note that `#[derive(FromPyObject)]` on a class is usually not useful as it tries to construct a new Rust value by filling in the fields by looking up attributes of any given Python value.
+
+## Method arguments
+
+Similar to `#[pyfunction]`, the `#[pyo3(signature = (...))]` attribute can be used to specify the way that `#[pymethods]` accept arguments. Consult the documentation for [`function signatures`](./function/signature.md) to see the parameters this attribute accepts.
+
+The following example defines a class `MyClass` with a method `method`. This method has a signature that sets default values for `num` and `name`, and indicates that `py_args` should collect all extra positional arguments and `py_kwargs` all extra keyword arguments:
+
+```rust
+# use pyo3::prelude::*;
+use pyo3::types::{PyDict, PyTuple};
+#
+# #[pyclass]
+# struct MyClass {
+#     num: i32,
+# }
+#[pymethods]
+impl MyClass {
+    #[new]
+    #[pyo3(signature = (num=-1))]
+    fn new(num: i32) -> Self {
+        MyClass { num }
+    }
+
+    #[pyo3(signature = (num=10, *py_args, name="Hello", **py_kwargs))]
+    fn method(
+        &mut self,
+        num: i32,
+        py_args: &Bound<'_, PyTuple>,
+        name: &str,
+        py_kwargs: Option<&Bound<'_, PyDict>>,
+    ) -> String {
+        let num_before = self.num;
+        self.num = num;
+        format!(
+            "num={} (was previously={}), py_args={:?}, name={}, py_kwargs={:?} ",
+            num, num_before, py_args, name, py_kwargs,
+        )
+    }
+}
+```
+
+In Python, this might be used like:
+
+```python
+>>> import mymodule
+>>> mc = mymodule.MyClass()
+>>> print(mc.method(44, False, "World", 666, x=44, y=55))
+py_args=('World', 666), py_kwargs=Some({'x': 44, 'y': 55}), name=Hello, num=44, num_before=-1
+>>> print(mc.method(num=-1, name="World"))
+py_args=(), py_kwargs=None, name=World, num=-1, num_before=44
+```
+
+The [`#[pyo3(text_signature = "...")`](./function/signature.md#overriding-the-generated-signature) option for `#[pyfunction]` also works for `#[pymethods]`.
+
+```rust
+# #![allow(dead_code)]
+use pyo3::prelude::*;
+use pyo3::types::PyType;
+
+#[pyclass]
+struct MyClass {}
+
+#[pymethods]
+impl MyClass {
+    #[new]
+    #[pyo3(text_signature = "(c, d)")]
+    fn new(c: i32, d: &str) -> Self {
+        Self {}
+    }
+    // the self argument should be written $self
+    #[pyo3(text_signature = "($self, e, f)")]
+    fn my_method(&self, e: i32, f: i32) -> i32 {
+        e + f
+    }
+    // similarly for classmethod arguments, use $cls
+    #[classmethod]
+    #[pyo3(text_signature = "($cls, e, f)")]
+    fn my_class_method(cls: &Bound<'_, PyType>, e: i32, f: i32) -> i32 {
+        e + f
+    }
+    #[staticmethod]
+    #[pyo3(text_signature = "(e, f)")]
+    fn my_static_method(e: i32, f: i32) -> i32 {
+        e + f
+    }
+}
+#
+# fn main() -> PyResult<()> {
+#     Python::with_gil(|py| {
+#         let inspect = PyModule::import_bound(py, "inspect")?.getattr("signature")?;
+#         let module = PyModule::new_bound(py, "my_module")?;
+#         module.add_class::<MyClass>()?;
+#         let class = module.getattr("MyClass")?;
+#
+#         if cfg!(not(Py_LIMITED_API)) || py.version_info() >= (3, 10)  {
+#             let doc: String = class.getattr("__doc__")?.extract()?;
+#             assert_eq!(doc, "");
+#
+#             let sig: String = inspect
+#                 .call1((&class,))?
+#                 .call_method0("__str__")?
+#                 .extract()?;
+#             assert_eq!(sig, "(c, d)");
+#         } else {
+#             let doc: String = class.getattr("__doc__")?.extract()?;
+#             assert_eq!(doc, "");
+#
+#             inspect.call1((&class,)).expect_err("`text_signature` on classes is not compatible with compilation in `abi3` mode until Python 3.10 or greater");
+#          }
+#
+#         {
+#             let method = class.getattr("my_method")?;
+#
+#             assert!(method.getattr("__doc__")?.is_none());
+#
+#             let sig: String = inspect
+#                 .call1((method,))?
+#                 .call_method0("__str__")?
+#                 .extract()?;
+#             assert_eq!(sig, "(self, /, e, f)");
+#         }
+#
+#         {
+#             let method = class.getattr("my_class_method")?;
+#
+#             assert!(method.getattr("__doc__")?.is_none());
+#
+#             let sig: String = inspect
+#                 .call1((method,))?
+#                 .call_method0("__str__")?
+#                 .extract()?;
+#             assert_eq!(sig, "(e, f)");  // inspect.signature skips the $cls arg
+#         }
+#
+#         {
+#             let method = class.getattr("my_static_method")?;
+#
+#             assert!(method.getattr("__doc__")?.is_none());
+#
+#             let sig: String = inspect
+#                 .call1((method,))?
+#                 .call_method0("__str__")?
+#                 .extract()?;
+#             assert_eq!(sig, "(e, f)");
+#         }
+#
+#         Ok(())
+#     })
+# }
+```
+
+Note that `text_signature` on `#[new]` is not compatible with compilation in
+`abi3` mode until Python 3.10 or greater.
+
+### Method receivers and lifetime elision
+
+PyO3 supports writing instance methods using the normal method receivers for shared `&self` and unique `&mut self` references. This interacts with [lifetime elision][lifetime-elision] insofar as the lifetime of a such a receiver is assigned to all elided output lifetime parameters.
+
+This is a good default for general Rust code where return values are more likely to borrow from the receiver than from the other arguments, if they contain any lifetimes at all. However, when returning bound references `Bound<'py, T>` in PyO3-based code, the GIL lifetime `'py` should usually be derived from a GIL token `py: Python<'py>` passed as an argument instead of the receiver.
+
+Specifically, signatures like
+
+```rust,ignore
+fn frobnicate(&self, py: Python) -> Bound<Foo>;
+```
+
+will not work as they are inferred as
+
+```rust,ignore
+fn frobnicate<'a, 'py>(&'a self, py: Python<'py>) -> Bound<'a, Foo>;
+```
+
+instead of the intended
+
+```rust,ignore
+fn frobnicate<'a, 'py>(&'a self, py: Python<'py>) -> Bound<'py, Foo>;
+```
+
+and should usually be written as
+
+```rust,ignore
+fn frobnicate<'py>(&self, py: Python<'py>) -> Bound<'py, Foo>;
+```
+
+The same problem does not exist for `#[pyfunction]`s as the special case for receiver lifetimes does not apply and indeed a signature like
+
+```rust,ignore
+fn frobnicate(bar: &Bar, py: Python) -> Bound<Foo>;
+```
+
+will yield compiler error [E0106 "missing lifetime specifier"][compiler-error-e0106].
+
+## `#[pyclass]` enums
+
+Enum support in PyO3 comes in two flavors, depending on what kind of variants the enum has: simple and complex.
+
+### Simple enums
+
+A simple enum (a.k.a. C-like enum) has only unit variants.
+
+PyO3 adds a class attribute for each variant, so you can access them in Python without defining `#[new]`. PyO3 also provides default implementations of `__richcmp__` and `__int__`, so they can be compared using `==`:
+
+```rust
+# use pyo3::prelude::*;
+#[pyclass(eq, eq_int)]
+#[derive(PartialEq)]
+enum MyEnum {
+    Variant,
+    OtherVariant,
+}
+
+Python::with_gil(|py| {
+    let x = Py::new(py, MyEnum::Variant).unwrap();
+    let y = Py::new(py, MyEnum::OtherVariant).unwrap();
+    let cls = py.get_type_bound::<MyEnum>();
+    pyo3::py_run!(py, x y cls, r#"
+        assert x == cls.Variant
+        assert y == cls.OtherVariant
+        assert x != y
+    "#)
+})
+```
+
+You can also convert your simple enums into `int`:
+
+```rust
+# use pyo3::prelude::*;
+#[pyclass(eq, eq_int)]
+#[derive(PartialEq)]
+enum MyEnum {
+    Variant,
+    OtherVariant = 10,
+}
+
+Python::with_gil(|py| {
+    let cls = py.get_type_bound::<MyEnum>();
+    let x = MyEnum::Variant as i32; // The exact value is assigned by the compiler.
+    pyo3::py_run!(py, cls x, r#"
+        assert int(cls.Variant) == x
+        assert int(cls.OtherVariant) == 10
+    "#)
+})
+```
+
+PyO3 also provides `__repr__` for enums:
+
+```rust
+# use pyo3::prelude::*;
+#[pyclass(eq, eq_int)]
+#[derive(PartialEq)]
+enum MyEnum{
+    Variant,
+    OtherVariant,
+}
+
+Python::with_gil(|py| {
+    let cls = py.get_type_bound::<MyEnum>();
+    let x = Py::new(py, MyEnum::Variant).unwrap();
+    pyo3::py_run!(py, cls x, r#"
+        assert repr(x) == 'MyEnum.Variant'
+        assert repr(cls.OtherVariant) == 'MyEnum.OtherVariant'
+    "#)
+})
+```
+
+All methods defined by PyO3 can be overridden. For example here's how you override `__repr__`:
+
+```rust
+# use pyo3::prelude::*;
+#[pyclass(eq, eq_int)]
+#[derive(PartialEq)]
+enum MyEnum {
+    Answer = 42,
+}
+
+#[pymethods]
+impl MyEnum {
+    fn __repr__(&self) -> &'static str {
+        "42"
+    }
+}
+
+Python::with_gil(|py| {
+    let cls = py.get_type_bound::<MyEnum>();
+    pyo3::py_run!(py, cls, "assert repr(cls.Answer) == '42'")
+})
+```
+
+Enums and their variants can also be renamed using `#[pyo3(name)]`.
+
+```rust
+# use pyo3::prelude::*;
+#[pyclass(eq, eq_int, name = "RenamedEnum")]
+#[derive(PartialEq)]
+enum MyEnum {
+    #[pyo3(name = "UPPERCASE")]
+    Variant,
+}
+
+Python::with_gil(|py| {
+    let x = Py::new(py, MyEnum::Variant).unwrap();
+    let cls = py.get_type_bound::<MyEnum>();
+    pyo3::py_run!(py, x cls, r#"
+        assert repr(x) == 'RenamedEnum.UPPERCASE'
+        assert x == cls.UPPERCASE
+    "#)
+})
+```
+
+Ordering of enum variants is optionally added using `#[pyo3(ord)]`.
+*Note: Implementation of the `PartialOrd` trait is required when passing the `ord` argument.  If not implemented, a compile time error is raised.*
+
+```rust
+# use pyo3::prelude::*;
+#[pyclass(eq, ord)]
+#[derive(PartialEq, PartialOrd)]
+enum MyEnum{
+    A,
+    B,
+    C,
+}
+
+Python::with_gil(|py| {
+    let cls = py.get_type_bound::<MyEnum>();
+    let a = Py::new(py, MyEnum::A).unwrap();
+    let b = Py::new(py, MyEnum::B).unwrap();
+    let c = Py::new(py, MyEnum::C).unwrap();
+    pyo3::py_run!(py, cls a b c, r#"
+        assert (a < b) == True
+        assert (c <= b) == False
+        assert (c > a) == True
+    "#)
+})
+```
+
+You may not use enums as a base class or let enums inherit from other classes.
+
+```rust,compile_fail
+# use pyo3::prelude::*;
+#[pyclass(subclass)]
+enum BadBase {
+    Var1,
+}
+```
+
+```rust,compile_fail
+# use pyo3::prelude::*;
+
+#[pyclass(subclass)]
+struct Base;
+
+#[pyclass(extends=Base)]
+enum BadSubclass {
+    Var1,
+}
+```
+
+`#[pyclass]` enums are currently not interoperable with `IntEnum` in Python.
+
+### Complex enums
+
+An enum is complex if it has any non-unit (struct or tuple) variants.
+
+PyO3 supports only struct and tuple variants in a complex enum. Unit variants aren't supported at present (the recommendation is to use an empty tuple enum instead).
+
+PyO3 adds a class attribute for each variant, which may be used to construct values and in match patterns. PyO3 also provides getter methods for all fields of each variant.
+
+```rust
+# use pyo3::prelude::*;
+#[pyclass]
+enum Shape {
+    Circle { radius: f64 },
+    Rectangle { width: f64, height: f64 },
+    RegularPolygon(u32, f64),
+    Nothing { },
+}
+
+# #[cfg(Py_3_10)]
+Python::with_gil(|py| {
+    let circle = Shape::Circle { radius: 10.0 }.into_py(py);
+    let square = Shape::RegularPolygon(4, 10.0).into_py(py);
+    let cls = py.get_type_bound::<Shape>();
+    pyo3::py_run!(py, circle square cls, r#"
+        assert isinstance(circle, cls)
+        assert isinstance(circle, cls.Circle)
+        assert circle.radius == 10.0
+
+        assert isinstance(square, cls)
+        assert isinstance(square, cls.RegularPolygon)
+        assert square[0] == 4 # Gets _0 field
+        assert square[1] == 10.0 # Gets _1 field
+
+        def count_vertices(cls, shape):
+            match shape:
+                case cls.Circle():
+                    return 0
+                case cls.Rectangle():
+                    return 4
+                case cls.RegularPolygon(n):
+                    return n
+                case cls.Nothing():
+                    return 0
+
+        assert count_vertices(cls, circle) == 0
+        assert count_vertices(cls, square) == 4
+    "#)
+})
+```
+
+WARNING: `Py::new` and `.into_py` are currently inconsistent. Note how the constructed value is _not_ an instance of the specific variant. For this reason, constructing values is only recommended using `.into_py`.
+
+```rust
+# use pyo3::prelude::*;
+#[pyclass]
+enum MyEnum {
+    Variant { i: i32 },
+}
+
+Python::with_gil(|py| {
+    let x = Py::new(py, MyEnum::Variant { i: 42 }).unwrap();
+    let cls = py.get_type_bound::<MyEnum>();
+    pyo3::py_run!(py, x cls, r#"
+        assert isinstance(x, cls)
+        assert not isinstance(x, cls.Variant)
+    "#)
+})
+```
+
+The constructor of each generated class can be customized using the `#[pyo3(constructor = (...))]` attribute. This uses the same syntax as the [`#[pyo3(signature = (...))]`](function/signature.md)
+attribute on function and methods and supports the same options. To apply this attribute simply place it on top of a variant in a `#[pyclass]` complex enum as shown below:
+
+```rust
+# use pyo3::prelude::*;
+#[pyclass]
+enum Shape {
+    #[pyo3(constructor = (radius=1.0))]
+    Circle { radius: f64 },
+    #[pyo3(constructor = (*, width, height))]
+    Rectangle { width: f64, height: f64 },
+    #[pyo3(constructor = (side_count, radius=1.0))]
+    RegularPolygon { side_count: u32, radius: f64 },
+    Nothing { },
+}
+
+# #[cfg(Py_3_10)]
+Python::with_gil(|py| {
+    let cls = py.get_type_bound::<Shape>();
+    pyo3::py_run!(py, cls, r#"
+        circle = cls.Circle()
+        assert isinstance(circle, cls)
+        assert isinstance(circle, cls.Circle)
+        assert circle.radius == 1.0
+
+        square = cls.Rectangle(width = 1, height = 1)
+        assert isinstance(square, cls)
+        assert isinstance(square, cls.Rectangle)
+        assert square.width == 1
+        assert square.height == 1
+
+        hexagon = cls.RegularPolygon(6)
+        assert isinstance(hexagon, cls)
+        assert isinstance(hexagon, cls.RegularPolygon)
+        assert hexagon.side_count == 6
+        assert hexagon.radius == 1
+    "#)
+})
+```
+
+## Implementation details
+
+The `#[pyclass]` macros rely on a lot of conditional code generation: each `#[pyclass]` can optionally have a `#[pymethods]` block.
+
+To support this flexibility the `#[pyclass]` macro expands to a blob of boilerplate code which sets up the structure for ["dtolnay specialization"](https://github.com/dtolnay/case-studies/blob/master/autoref-specialization/README.md). This implementation pattern enables the Rust compiler to use `#[pymethods]` implementations when they are present, and fall back to default (empty) definitions when they are not.
+
+This simple technique works for the case when there is zero or one implementations. To support multiple `#[pymethods]` for a `#[pyclass]` (in the [`multiple-pymethods`] feature), a registry mechanism provided by the [`inventory`](https://github.com/dtolnay/inventory) crate is used instead. This collects `impl`s at library load time, but isn't supported on all platforms. See [inventory: how it works](https://github.com/dtolnay/inventory#how-it-works) for more details.
+
+The `#[pyclass]` macro expands to roughly the code seen below. The `PyClassImplCollector` is the type used internally by PyO3 for dtolnay specialization:
+
+```rust
+# #[cfg(not(feature = "multiple-pymethods"))] {
+# use pyo3::prelude::*;
+// Note: the implementation differs slightly with the `multiple-pymethods` feature enabled.
+struct MyClass {
+    # #[allow(dead_code)]
+    num: i32,
+}
+
+impl pyo3::types::DerefToPyAny for MyClass {}
+
+# #[allow(deprecated)]
+# #[cfg(feature = "gil-refs")]
+unsafe impl pyo3::type_object::HasPyGilRef for MyClass {
+    type AsRefTarget = pyo3::PyCell<Self>;
+}
+unsafe impl pyo3::type_object::PyTypeInfo for MyClass {
+    const NAME: &'static str = "MyClass";
+    const MODULE: ::std::option::Option<&'static str> = ::std::option::Option::None;
+    #[inline]
+    fn type_object_raw(py: pyo3::Python<'_>) -> *mut pyo3::ffi::PyTypeObject {
+        <Self as pyo3::impl_::pyclass::PyClassImpl>::lazy_type_object()
+            .get_or_init(py)
+            .as_type_ptr()
+    }
+}
+
+impl pyo3::PyClass for MyClass {
+    type Frozen = pyo3::pyclass::boolean_struct::False;
+}
+
+impl<'a, 'py> pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'py> for &'a MyClass
+{
+    type Holder = ::std::option::Option<pyo3::PyRef<'py, MyClass>>;
+
+    #[inline]
+    fn extract(obj: &'a pyo3::Bound<'py, PyAny>, holder: &'a mut Self::Holder) -> pyo3::PyResult<Self> {
+        pyo3::impl_::extract_argument::extract_pyclass_ref(obj, holder)
+    }
+}
+
+impl<'a, 'py> pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'py> for &'a mut MyClass
+{
+    type Holder = ::std::option::Option<pyo3::PyRefMut<'py, MyClass>>;
+
+    #[inline]
+    fn extract(obj: &'a pyo3::Bound<'py, PyAny>, holder: &'a mut Self::Holder) -> pyo3::PyResult<Self> {
+        pyo3::impl_::extract_argument::extract_pyclass_ref_mut(obj, holder)
+    }
+}
+
+impl pyo3::IntoPy<PyObject> for MyClass {
+    fn into_py(self, py: pyo3::Python<'_>) -> pyo3::PyObject {
+        pyo3::IntoPy::into_py(pyo3::Py::new(py, self).unwrap(), py)
+    }
+}
+
+impl pyo3::impl_::pyclass::PyClassImpl for MyClass {
+    const IS_BASETYPE: bool = false;
+    const IS_SUBCLASS: bool = false;
+    const IS_MAPPING: bool = false;
+    const IS_SEQUENCE: bool = false;
+    type BaseType = PyAny;
+    type ThreadChecker = pyo3::impl_::pyclass::SendablePyClass<MyClass>;
+    type PyClassMutability = <<pyo3::PyAny as pyo3::impl_::pyclass::PyClassBaseType>::PyClassMutability as pyo3::impl_::pycell::PyClassMutability>::MutableChild;
+    type Dict = pyo3::impl_::pyclass::PyClassDummySlot;
+    type WeakRef = pyo3::impl_::pyclass::PyClassDummySlot;
+    type BaseNativeType = pyo3::PyAny;
+
+    fn items_iter() -> pyo3::impl_::pyclass::PyClassItemsIter {
+        use pyo3::impl_::pyclass::*;
+        let collector = PyClassImplCollector::<MyClass>::new();
+        static INTRINSIC_ITEMS: PyClassItems = PyClassItems { slots: &[], methods: &[] };
+        PyClassItemsIter::new(&INTRINSIC_ITEMS, collector.py_methods())
+    }
+
+    fn lazy_type_object() -> &'static pyo3::impl_::pyclass::LazyTypeObject<MyClass> {
+        use pyo3::impl_::pyclass::LazyTypeObject;
+        static TYPE_OBJECT: LazyTypeObject<MyClass> = LazyTypeObject::new();
+        &TYPE_OBJECT
+    }
+
+    fn doc(py: Python<'_>) -> pyo3::PyResult<&'static ::std::ffi::CStr> {
+        use pyo3::impl_::pyclass::*;
+        static DOC: pyo3::sync::GILOnceCell<::std::borrow::Cow<'static, ::std::ffi::CStr>> = pyo3::sync::GILOnceCell::new();
+        DOC.get_or_try_init(py, || {
+            let collector = PyClassImplCollector::<Self>::new();
+            build_pyclass_doc(<MyClass as pyo3::PyTypeInfo>::NAME, pyo3::ffi::c_str!(""), collector.new_text_signature())
+        }).map(::std::ops::Deref::deref)
+    }
+}
+
+# Python::with_gil(|py| {
+#     let cls = py.get_type_bound::<MyClass>();
+#     pyo3::py_run!(py, cls, "assert cls.__name__ == 'MyClass'")
+# });
+# }
+```
+
+
+[`PyTypeInfo`]: {{#PYO3_DOCS_URL}}/pyo3/type_object/trait.PyTypeInfo.html
+
+[`Py`]: {{#PYO3_DOCS_URL}}/pyo3/struct.Py.html
+[`Bound<'_, T>`]: {{#PYO3_DOCS_URL}}/pyo3/struct.Bound.html
+[`PyClass`]: {{#PYO3_DOCS_URL}}/pyo3/pyclass/trait.PyClass.html
+[`PyRef`]: {{#PYO3_DOCS_URL}}/pyo3/pycell/struct.PyRef.html
+[`PyRefMut`]: {{#PYO3_DOCS_URL}}/pyo3/pycell/struct.PyRefMut.html
+[`PyClassInitializer<T>`]: {{#PYO3_DOCS_URL}}/pyo3/pyclass_init/struct.PyClassInitializer.html
+
+[`Arc`]: https://doc.rust-lang.org/std/sync/struct.Arc.html
+[`RefCell`]: https://doc.rust-lang.org/std/cell/struct.RefCell.html
+
+[classattr]: https://docs.python.org/3/tutorial/classes.html#class-and-instance-variables
+
+[`multiple-pymethods`]: features.md#multiple-pymethods
+
+[lifetime-elision]: https://doc.rust-lang.org/reference/lifetime-elision.html
+[compiler-error-e0106]: https://doc.rust-lang.org/error_codes/E0106.html
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/contributing.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/contributing.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/contributing.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/contributing.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{{#include ../../Contributing.md}}
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/conversions/tables.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/conversions/tables.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/conversions/tables.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/conversions/tables.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,118 @@
+## Mapping of Rust types to Python types
+
+When writing functions callable from Python (such as a `#[pyfunction]` or in a `#[pymethods]` block), the trait `FromPyObject` is required for function arguments, and `IntoPy<PyObject>` is required for function return values.
+
+Consult the tables in the following section to find the Rust types provided by PyO3 which implement these traits.
+
+### Argument Types
+
+When accepting a function argument, it is possible to either use Rust library types or PyO3's Python-native types. (See the next section for discussion on when to use each.)
+
+The table below contains the Python type and the corresponding function argument types that will accept them:
+
+| Python        | Rust                            | Rust (Python-native) |
+| ------------- |:-------------------------------:|:--------------------:|
+| `object`      | -                               | `PyAny`             |
+| `str`         | `String`, `Cow<str>`, `&str`, `char`, `OsString`, `PathBuf`, `Path` | `PyString`, `PyUnicode` |
+| `bytes`       | `Vec<u8>`, `&[u8]`, `Cow<[u8]>` | `PyBytes`           |
+| `bool`        | `bool`                          | `PyBool`            |
+| `int`         | `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`, `num_bigint::BigInt`[^1], `num_bigint::BigUint`[^1] | `PyLong` |
+| `float`       | `f32`, `f64`                    | `PyFloat`           |
+| `complex`     | `num_complex::Complex`[^2]      | `PyComplex`         |
+| `fractions.Fraction`| `num_rational::Ratio`[^8] | -         |
+| `list[T]`     | `Vec<T>`                        | `PyList`            |
+| `dict[K, V]`  | `HashMap<K, V>`, `BTreeMap<K, V>`, `hashbrown::HashMap<K, V>`[^3], `indexmap::IndexMap<K, V>`[^4] | `PyDict` |
+| `tuple[T, U]` | `(T, U)`, `Vec<T>`              | `PyTuple`           |
+| `set[T]`      | `HashSet<T>`, `BTreeSet<T>`, `hashbrown::HashSet<T>`[^3] | `PySet` |
+| `frozenset[T]` | `HashSet<T>`, `BTreeSet<T>`, `hashbrown::HashSet<T>`[^3] | `PyFrozenSet` |
+| `bytearray`   | `Vec<u8>`, `Cow<[u8]>`          | `PyByteArray`       |
+| `slice`       | -                               | `PySlice`           |
+| `type`        | -                               | `PyType`            |
+| `module`      | -                               | `PyModule`          |
+| `collections.abc.Buffer` | -                    | `PyBuffer<T>`        |
+| `datetime.datetime` | `SystemTime`, `chrono::DateTime<Tz>`[^5], `chrono::NaiveDateTime`[^5] | `PyDateTime`        |
+| `datetime.date` | `chrono::NaiveDate`[^5]       | `PyDate`            |
+| `datetime.time` | `chrono::NaiveTime`[^5]       | `PyTime`            |
+| `datetime.tzinfo` | `chrono::FixedOffset`[^5], `chrono::Utc`[^5], `chrono_tz::TimeZone`[^6] | `PyTzInfo`          |
+| `datetime.timedelta` | `Duration`, `chrono::Duration`[^5] | `PyDelta`           |
+| `decimal.Decimal` | `rust_decimal::Decimal`[^7] | -                    |
+| `ipaddress.IPv4Address` | `std::net::IpAddr`, `std::net::IpV4Addr` | - |
+| `ipaddress.IPv6Address` | `std::net::IpAddr`, `std::net::IpV6Addr` | - |
+| `os.PathLike ` | `PathBuf`, `Path`              | `PyString`, `PyUnicode` |
+| `pathlib.Path` | `PathBuf`, `Path`              | `PyString`, `PyUnicode` |
+| `typing.Optional[T]` | `Option<T>`              | -                    |
+| `typing.Sequence[T]` | `Vec<T>`                 | `PySequence`        |
+| `typing.Mapping[K, V]` | `HashMap<K, V>`, `BTreeMap<K, V>`, `hashbrown::HashMap<K, V>`[^3], `indexmap::IndexMap<K, V>`[^4] | `&PyMapping` |
+| `typing.Iterator[Any]` | -                      | `PyIterator`        |
+| `typing.Union[...]` | See [`#[derive(FromPyObject)]`](traits.md#deriving-frompyobject-for-enums) | - |
+
+It is also worth remembering the following special types:
+
+| What             | Description                           |
+| ---------------- | ------------------------------------- |
+| `Python<'py>`    | A GIL token, used to pass to PyO3 constructors to prove ownership of the GIL. |
+| `Bound<'py, T>`  | A Python object connected to the GIL lifetime. This provides access to most of PyO3's APIs. |
+| `Py<T>`          | A Python object isolated from the GIL lifetime. This can be sent to other threads. |
+| `PyObject`       | An alias for `Py<PyAny>`              |
+| `PyRef<T>`       | A `#[pyclass]` borrowed immutably.    |
+| `PyRefMut<T>`    | A `#[pyclass]` borrowed mutably.      |
+
+For more detail on accepting `#[pyclass]` values as function arguments, see [the section of this guide on Python Classes](../class.md).
+
+#### Using Rust library types vs Python-native types
+
+Using Rust library types as function arguments will incur a conversion cost compared to using the Python-native types. Using the Python-native types is almost zero-cost (they just require a type check similar to the Python builtin function `isinstance()`).
+
+However, once that conversion cost has been paid, the Rust standard library types offer a number of benefits:
+- You can write functionality in native-speed Rust code (free of Python's runtime costs).
+- You get better interoperability with the rest of the Rust ecosystem.
+- You can use `Python::allow_threads` to release the Python GIL and let other Python threads make progress while your Rust code is executing.
+- You also benefit from stricter type checking. For example you can specify `Vec<i32>`, which will only accept a Python `list` containing integers. The Python-native equivalent, `&PyList`, would accept a Python `list` containing Python objects of any type.
+
+For most PyO3 usage the conversion cost is worth paying to get these benefits. As always, if you're not sure it's worth it in your case, benchmark it!
+
+### Returning Rust values to Python
+
+When returning values from functions callable from Python, [PyO3's smart pointers](../types.md#pyo3s-smart-pointers) (`Py<T>`, `Bound<'py, T>`, and `Borrowed<'a, 'py, T>`) can be used with zero cost.
+
+Because `Bound<'py, T>` and `Borrowed<'a, 'py, T>` have lifetime parameters, the Rust compiler may ask for lifetime annotations to be added to your function. See the [section of the guide dedicated to this](../types.md#function-argument-lifetimes).
+
+If your function is fallible, it should return `PyResult<T>` or `Result<T, E>` where `E` implements `From<E> for PyErr`. This will raise a `Python` exception if the `Err` variant is returned.
+
+Finally, the following Rust types are also able to convert to Python as return values:
+
+| Rust type     | Resulting Python Type           |
+| ------------- |:-------------------------------:|
+| `String`      | `str`                           |
+| `&str`        | `str`                           |
+| `bool`        | `bool`                          |
+| Any integer type (`i32`, `u32`, `usize`, etc) | `int` |
+| `f32`, `f64`  | `float`                         |
+| `Option<T>`   | `Optional[T]`                   |
+| `(T, U)`      | `Tuple[T, U]`                   |
+| `Vec<T>`      | `List[T]`                       |
+| `Cow<[u8]>`   | `bytes`                         |
+| `HashMap<K, V>` | `Dict[K, V]`                  |
+| `BTreeMap<K, V>` | `Dict[K, V]`                 |
+| `HashSet<T>`  | `Set[T]`                        |
+| `BTreeSet<T>` | `Set[T]`                        |
+| `Py<T>` | `T`                                   |
+| `Bound<T>` | `T`                                |
+| `PyRef<T: PyClass>` | `T`                       |
+| `PyRefMut<T: PyClass>` | `T`                    |
+
+[^1]: Requires the `num-bigint` optional feature.
+
+[^2]: Requires the `num-complex` optional feature.
+
+[^3]: Requires the `hashbrown` optional feature.
+
+[^4]: Requires the `indexmap` optional feature.
+
+[^5]: Requires the `chrono` optional feature.
+
+[^6]: Requires the `chrono-tz` optional feature.
+
+[^7]: Requires the `rust_decimal` optional feature.
+
+[^8]: Requires the `num-rational` optional feature.
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/conversions/traits.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/conversions/traits.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/conversions/traits.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/conversions/traits.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,524 @@
+## Conversion traits
+
+PyO3 provides some handy traits to convert between Python types and Rust types.
+
+### `.extract()` and the `FromPyObject` trait
+
+The easiest way to convert a Python object to a Rust value is using
+`.extract()`.  It returns a `PyResult` with a type error if the conversion
+fails, so usually you will use something like
+
+```rust
+# use pyo3::prelude::*;
+# use pyo3::types::PyList;
+# fn main() -> PyResult<()> {
+#     Python::with_gil(|py| {
+#         let list = PyList::new_bound(py, b"foo");
+let v: Vec<i32> = list.extract()?;
+#         assert_eq!(&v, &[102, 111, 111]);
+#         Ok(())
+#     })
+# }
+```
+
+This method is available for many Python object types, and can produce a wide
+variety of Rust types, which you can check out in the implementor list of
+[`FromPyObject`].
+
+[`FromPyObject`] is also implemented for your own Rust types wrapped as Python
+objects (see [the chapter about classes](../class.md)).  There, in order to both be
+able to operate on mutable references *and* satisfy Rust's rules of non-aliasing
+mutable references, you have to extract the PyO3 reference wrappers [`PyRef`]
+and [`PyRefMut`].  They work like the reference wrappers of
+`std::cell::RefCell` and ensure (at runtime) that Rust borrows are allowed.
+
+#### Deriving [`FromPyObject`]
+
+[`FromPyObject`] can be automatically derived for many kinds of structs and enums
+if the member types themselves implement `FromPyObject`. This even includes members
+with a generic type `T: FromPyObject`. Derivation for empty enums, enum variants and
+structs is not supported.
+
+#### Deriving [`FromPyObject`] for structs
+
+The derivation generates code that will attempt to access the attribute  `my_string` on
+the Python object, i.e. `obj.getattr("my_string")`, and call `extract()` on the attribute.
+
+```rust
+use pyo3::prelude::*;
+
+#[derive(FromPyObject)]
+struct RustyStruct {
+    my_string: String,
+}
+#
+# fn main() -> PyResult<()> {
+#     Python::with_gil(|py| -> PyResult<()> {
+#         let module = PyModule::from_code_bound(
+#             py,
+#             "class Foo:
+#             def __init__(self):
+#                 self.my_string = 'test'",
+#             "",
+#             "",
+#         )?;
+#
+#         let class = module.getattr("Foo")?;
+#         let instance = class.call0()?;
+#         let rustystruct: RustyStruct = instance.extract()?;
+#         assert_eq!(rustystruct.my_string, "test");
+#         Ok(())
+#     })
+# }
+```
+
+By setting the `#[pyo3(item)]` attribute on the field, PyO3 will attempt to extract the value by calling the `get_item` method on the Python object.
+
+```rust
+use pyo3::prelude::*;
+
+#[derive(FromPyObject)]
+struct RustyStruct {
+    #[pyo3(item)]
+    my_string: String,
+}
+#
+# use pyo3::types::PyDict;
+# fn main() -> PyResult<()> {
+#     Python::with_gil(|py| -> PyResult<()> {
+#         let dict = PyDict::new_bound(py);
+#         dict.set_item("my_string", "test")?;
+#
+#         let rustystruct: RustyStruct = dict.extract()?;
+#         assert_eq!(rustystruct.my_string, "test");
+#         Ok(())
+#     })
+# }
+```
+
+The argument passed to `getattr` and `get_item` can also be configured:
+
+```rust
+use pyo3::prelude::*;
+
+#[derive(FromPyObject)]
+struct RustyStruct {
+    #[pyo3(item("key"))]
+    string_in_mapping: String,
+    #[pyo3(attribute("name"))]
+    string_attr: String,
+}
+#
+# fn main() -> PyResult<()> {
+#     Python::with_gil(|py| -> PyResult<()> {
+#         let module = PyModule::from_code_bound(
+#             py,
+#             "class Foo(dict):
+#             def __init__(self):
+#                 self.name = 'test'
+#                 self['key'] = 'test2'",
+#             "",
+#             "",
+#         )?;
+#
+#         let class = module.getattr("Foo")?;
+#         let instance = class.call0()?;
+#         let rustystruct: RustyStruct = instance.extract()?;
+# 		assert_eq!(rustystruct.string_attr, "test");
+#         assert_eq!(rustystruct.string_in_mapping, "test2");
+#
+#         Ok(())
+#     })
+# }
+```
+
+This tries to extract `string_attr` from the attribute `name` and `string_in_mapping`
+from a mapping with the key `"key"`. The arguments for `attribute` are restricted to
+non-empty string literals while `item` can take any valid literal that implements
+`ToBorrowedObject`.
+
+You can use `#[pyo3(from_item_all)]` on a struct to extract every field with `get_item` method.
+In this case, you can't use `#[pyo3(attribute)]` or barely use `#[pyo3(item)]` on any field.
+However, using `#[pyo3(item("key"))]` to specify the key for a field is still allowed.
+
+```rust
+use pyo3::prelude::*;
+
+#[derive(FromPyObject)]
+#[pyo3(from_item_all)]
+struct RustyStruct {
+    foo: String,
+    bar: String,
+    #[pyo3(item("foobar"))]
+    baz: String,
+}
+#
+# fn main() -> PyResult<()> {
+#     Python::with_gil(|py| -> PyResult<()> {
+#         let py_dict = py.eval_bound("{'foo': 'foo', 'bar': 'bar', 'foobar': 'foobar'}", None, None)?;
+#         let rustystruct: RustyStruct = py_dict.extract()?;
+# 		  assert_eq!(rustystruct.foo, "foo");
+#         assert_eq!(rustystruct.bar, "bar");
+#         assert_eq!(rustystruct.baz, "foobar");
+#
+#         Ok(())
+#     })
+# }
+```
+
+#### Deriving [`FromPyObject`] for tuple structs
+
+Tuple structs are also supported but do not allow customizing the extraction. The input is
+always assumed to be a Python tuple with the same length as the Rust type, the `n`th field
+is extracted from the `n`th item in the Python tuple.
+
+```rust
+use pyo3::prelude::*;
+
+#[derive(FromPyObject)]
+struct RustyTuple(String, String);
+
+# use pyo3::types::PyTuple;
+# fn main() -> PyResult<()> {
+#     Python::with_gil(|py| -> PyResult<()> {
+#         let tuple = PyTuple::new_bound(py, vec!["test", "test2"]);
+#
+#         let rustytuple: RustyTuple = tuple.extract()?;
+#         assert_eq!(rustytuple.0, "test");
+#         assert_eq!(rustytuple.1, "test2");
+#
+#         Ok(())
+#     })
+# }
+```
+
+Tuple structs with a single field are treated as wrapper types which are described in the
+following section. To override this behaviour and ensure that the input is in fact a tuple,
+specify the struct as
+```rust
+use pyo3::prelude::*;
+
+#[derive(FromPyObject)]
+struct RustyTuple((String,));
+
+# use pyo3::types::PyTuple;
+# fn main() -> PyResult<()> {
+#     Python::with_gil(|py| -> PyResult<()> {
+#         let tuple = PyTuple::new_bound(py, vec!["test"]);
+#
+#         let rustytuple: RustyTuple = tuple.extract()?;
+#         assert_eq!((rustytuple.0).0, "test");
+#
+#         Ok(())
+#     })
+# }
+```
+
+#### Deriving [`FromPyObject`] for wrapper types
+
+The `pyo3(transparent)` attribute can be used on structs with exactly one field. This results
+in extracting directly from the input object, i.e. `obj.extract()`, rather than trying to access
+an item or attribute. This behaviour is enabled per default for newtype structs and tuple-variants
+with a single field.
+
+```rust
+use pyo3::prelude::*;
+
+#[derive(FromPyObject)]
+struct RustyTransparentTupleStruct(String);
+
+#[derive(FromPyObject)]
+#[pyo3(transparent)]
+struct RustyTransparentStruct {
+    inner: String,
+}
+
+# use pyo3::types::PyString;
+# fn main() -> PyResult<()> {
+#     Python::with_gil(|py| -> PyResult<()> {
+#         let s = PyString::new_bound(py, "test");
+#
+#         let tup: RustyTransparentTupleStruct = s.extract()?;
+#         assert_eq!(tup.0, "test");
+#
+#         let stru: RustyTransparentStruct = s.extract()?;
+#         assert_eq!(stru.inner, "test");
+#
+#         Ok(())
+#     })
+# }
+```
+
+#### Deriving [`FromPyObject`] for enums
+
+The `FromPyObject` derivation for enums generates code that tries to extract the variants in the
+order of the fields. As soon as a variant can be extracted successfully, that variant is returned.
+This makes it possible to extract Python union types like `str | int`.
+
+The same customizations and restrictions described for struct derivations apply to enum variants,
+i.e. a tuple variant assumes that the input is a Python tuple, and a struct variant defaults to
+extracting fields as attributes but can be configured in the same manner. The `transparent`
+attribute can be applied to single-field-variants.
+
+```rust
+use pyo3::prelude::*;
+
+#[derive(FromPyObject)]
+# #[derive(Debug)]
+enum RustyEnum<'py> {
+    Int(usize),                    // input is a positive int
+    String(String),                // input is a string
+    IntTuple(usize, usize),        // input is a 2-tuple with positive ints
+    StringIntTuple(String, usize), // input is a 2-tuple with String and int
+    Coordinates3d {
+        // needs to be in front of 2d
+        x: usize,
+        y: usize,
+        z: usize,
+    },
+    Coordinates2d {
+        // only gets checked if the input did not have `z`
+        #[pyo3(attribute("x"))]
+        a: usize,
+        #[pyo3(attribute("y"))]
+        b: usize,
+    },
+    #[pyo3(transparent)]
+    CatchAll(Bound<'py, PyAny>), // This extraction never fails
+}
+#
+# use pyo3::types::{PyBytes, PyString};
+# fn main() -> PyResult<()> {
+#     Python::with_gil(|py| -> PyResult<()> {
+#         {
+#             let thing = 42_u8.to_object(py);
+#             let rust_thing: RustyEnum<'_> = thing.extract(py)?;
+#
+#             assert_eq!(
+#                 42,
+#                 match rust_thing {
+#                     RustyEnum::Int(i) => i,
+#                     other => unreachable!("Error extracting: {:?}", other),
+#                 }
+#             );
+#         }
+#         {
+#             let thing = PyString::new_bound(py, "text");
+#             let rust_thing: RustyEnum<'_> = thing.extract()?;
+#
+#             assert_eq!(
+#                 "text",
+#                 match rust_thing {
+#                     RustyEnum::String(i) => i,
+#                     other => unreachable!("Error extracting: {:?}", other),
+#                 }
+#             );
+#         }
+#         {
+#             let thing = (32_u8, 73_u8).to_object(py);
+#             let rust_thing: RustyEnum<'_> = thing.extract(py)?;
+#
+#             assert_eq!(
+#                 (32, 73),
+#                 match rust_thing {
+#                     RustyEnum::IntTuple(i, j) => (i, j),
+#                     other => unreachable!("Error extracting: {:?}", other),
+#                 }
+#             );
+#         }
+#         {
+#             let thing = ("foo", 73_u8).to_object(py);
+#             let rust_thing: RustyEnum<'_> = thing.extract(py)?;
+#
+#             assert_eq!(
+#                 (String::from("foo"), 73),
+#                 match rust_thing {
+#                     RustyEnum::StringIntTuple(i, j) => (i, j),
+#                     other => unreachable!("Error extracting: {:?}", other),
+#                 }
+#             );
+#         }
+#         {
+#             let module = PyModule::from_code_bound(
+#                 py,
+#                 "class Foo(dict):
+#             def __init__(self):
+#                 self.x = 0
+#                 self.y = 1
+#                 self.z = 2",
+#                 "",
+#                 "",
+#             )?;
+#
+#             let class = module.getattr("Foo")?;
+#             let instance = class.call0()?;
+#             let rust_thing: RustyEnum<'_> = instance.extract()?;
+#
+#             assert_eq!(
+#                 (0, 1, 2),
+#                 match rust_thing {
+#                     RustyEnum::Coordinates3d { x, y, z } => (x, y, z),
+#                     other => unreachable!("Error extracting: {:?}", other),
+#                 }
+#             );
+#         }
+#
+#         {
+#             let module = PyModule::from_code_bound(
+#                 py,
+#                 "class Foo(dict):
+#             def __init__(self):
+#                 self.x = 3
+#                 self.y = 4",
+#                 "",
+#                 "",
+#             )?;
+#
+#             let class = module.getattr("Foo")?;
+#             let instance = class.call0()?;
+#             let rust_thing: RustyEnum<'_> = instance.extract()?;
+#
+#             assert_eq!(
+#                 (3, 4),
+#                 match rust_thing {
+#                     RustyEnum::Coordinates2d { a, b } => (a, b),
+#                     other => unreachable!("Error extracting: {:?}", other),
+#                 }
+#             );
+#         }
+#
+#         {
+#             let thing = PyBytes::new_bound(py, b"text");
+#             let rust_thing: RustyEnum<'_> = thing.extract()?;
+#
+#             assert_eq!(
+#                 b"text",
+#                 match rust_thing {
+#                     RustyEnum::CatchAll(ref i) => i.downcast::<PyBytes>()?.as_bytes(),
+#                     other => unreachable!("Error extracting: {:?}", other),
+#                 }
+#             );
+#         }
+#         Ok(())
+#     })
+# }
+```
+
+If none of the enum variants match, a `PyTypeError` containing the names of the
+tested variants is returned. The names reported in the error message can be customized
+through the `#[pyo3(annotation = "name")]` attribute, e.g. to use conventional Python type
+names:
+
+```rust
+use pyo3::prelude::*;
+
+#[derive(FromPyObject)]
+# #[derive(Debug)]
+enum RustyEnum {
+    #[pyo3(transparent, annotation = "str")]
+    String(String),
+    #[pyo3(transparent, annotation = "int")]
+    Int(isize),
+}
+#
+# fn main() -> PyResult<()> {
+#     Python::with_gil(|py| -> PyResult<()> {
+#         {
+#             let thing = 42_u8.to_object(py);
+#             let rust_thing: RustyEnum = thing.extract(py)?;
+#
+#             assert_eq!(
+#                 42,
+#                 match rust_thing {
+#                     RustyEnum::Int(i) => i,
+#                     other => unreachable!("Error extracting: {:?}", other),
+#                 }
+#             );
+#         }
+#
+#         {
+#             let thing = "foo".to_object(py);
+#             let rust_thing: RustyEnum = thing.extract(py)?;
+#
+#             assert_eq!(
+#                 "foo",
+#                 match rust_thing {
+#                     RustyEnum::String(i) => i,
+#                     other => unreachable!("Error extracting: {:?}", other),
+#                 }
+#             );
+#         }
+#
+#         {
+#             let thing = b"foo".to_object(py);
+#             let error = thing.extract::<RustyEnum>(py).unwrap_err();
+#             assert!(error.is_instance_of::<pyo3::exceptions::PyTypeError>(py));
+#         }
+#
+#         Ok(())
+#     })
+# }
+```
+
+If the input is neither a string nor an integer, the error message will be:
+`"'<INPUT_TYPE>' cannot be converted to 'str | int'"`.
+
+#### `#[derive(FromPyObject)]` Container Attributes
+- `pyo3(transparent)`
+    - extract the field directly from the object as `obj.extract()` instead of `get_item()` or
+      `getattr()`
+    - Newtype structs and tuple-variants are treated as transparent per default.
+    - only supported for single-field structs and enum variants
+- `pyo3(annotation = "name")`
+    - changes the name of the failed variant in the generated error message in case of failure.
+    - e.g. `pyo3("int")` reports the variant's type as `int`.
+    - only supported for enum variants
+
+#### `#[derive(FromPyObject)]` Field Attributes
+- `pyo3(attribute)`, `pyo3(attribute("name"))`
+    - retrieve the field from an attribute, possibly with a custom name specified as an argument
+    - argument must be a string-literal.
+- `pyo3(item)`, `pyo3(item("key"))`
+    - retrieve the field from a mapping, possibly with the custom key specified as an argument.
+    - can be any literal that implements `ToBorrowedObject`
+- `pyo3(from_py_with = "...")`
+    - apply a custom function to convert the field from Python the desired Rust type.
+    - the argument must be the name of the function as a string.
+    - the function signature must be `fn(&Bound<PyAny>) -> PyResult<T>` where `T` is the Rust type of the argument.
+
+### `IntoPy<T>`
+
+This trait defines the to-python conversion for a Rust type. It is usually implemented as
+`IntoPy<PyObject>`, which is the trait needed for returning a value from `#[pyfunction]` and
+`#[pymethods]`.
+
+All types in PyO3 implement this trait, as does a `#[pyclass]` which doesn't use `extends`.
+
+Occasionally you may choose to implement this for custom types which are mapped to Python types
+_without_ having a unique python type.
+
+```rust
+use pyo3::prelude::*;
+# #[allow(dead_code)]
+struct MyPyObjectWrapper(PyObject);
+
+impl IntoPy<PyObject> for MyPyObjectWrapper {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.0
+    }
+}
+```
+
+### The `ToPyObject` trait
+
+[`ToPyObject`] is a conversion trait that allows various objects to be
+converted into [`PyObject`]. `IntoPy<PyObject>` serves the
+same purpose, except that it consumes `self`.
+
+[`IntoPy`]: {{#PYO3_DOCS_URL}}/pyo3/conversion/trait.IntoPy.html
+[`FromPyObject`]: {{#PYO3_DOCS_URL}}/pyo3/conversion/trait.FromPyObject.html
+[`ToPyObject`]: {{#PYO3_DOCS_URL}}/pyo3/conversion/trait.ToPyObject.html
+[`PyObject`]: {{#PYO3_DOCS_URL}}/pyo3/type.PyObject.html
+
+[`PyRef`]: {{#PYO3_DOCS_URL}}/pyo3/pycell/struct.PyRef.html
+[`PyRefMut`]: {{#PYO3_DOCS_URL}}/pyo3/pycell/struct.PyRefMut.html
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/conversions.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/conversions.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/conversions.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/conversions.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,3 @@
+# Type conversions
+
+In this portion of the guide we'll talk about the mapping of Python types to Rust types offered by PyO3, as well as the traits available to perform conversions between them.
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/debugging.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/debugging.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/debugging.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/debugging.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,47 @@
+# Debugging
+
+## Macros
+
+PyO3's attributes (`#[pyclass]`, `#[pymodule]`, etc.) are [procedural macros](https://doc.rust-lang.org/reference/procedural-macros.html), which means that they rewrite the source of the annotated item. You can view the generated source with the following command, which also expands a few other things:
+
+```bash
+cargo rustc --profile=check -- -Z unstable-options --pretty=expanded > expanded.rs; rustfmt expanded.rs
+```
+
+(You might need to install [rustfmt](https://github.com/rust-lang-nursery/rustfmt) if you don't already have it.)
+
+You can also debug classic `!`-macros by adding `-Z trace-macros`:
+
+```bash
+cargo rustc --profile=check -- -Z unstable-options --pretty=expanded -Z trace-macros > expanded.rs; rustfmt expanded.rs
+```
+
+Note that those commands require using the nightly build of rust and may occasionally have bugs. See [cargo expand](https://github.com/dtolnay/cargo-expand) for a more elaborate and stable version of those commands.
+
+## Running with Valgrind
+
+Valgrind is a tool to detect memory management bugs such as memory leaks.
+
+You first need to install a debug build of Python, otherwise Valgrind won't produce usable results. In Ubuntu there's e.g. a `python3-dbg` package.
+
+Activate an environment with the debug interpreter and recompile. If you're on Linux, use `ldd` with the name of your binary and check that you're linking e.g. `libpython3.7d.so.1.0` instead of `libpython3.7.so.1.0`.
+
+[Download the suppressions file for CPython](https://raw.githubusercontent.com/python/cpython/master/Misc/valgrind-python.supp).
+
+Run Valgrind with `valgrind --suppressions=valgrind-python.supp ./my-command --with-options`
+
+## Getting a stacktrace
+
+The best start to investigate a crash such as an segmentation fault is a backtrace. You can set `RUST_BACKTRACE=1` as an environment variable to get the stack trace on a `panic!`. Alternatively you can use a debugger such as `gdb` to explore the issue. Rust provides a wrapper, `rust-gdb`, which has pretty-printers for inspecting Rust variables. Since PyO3 uses `cdylib` for Python shared objects, it does not receive the pretty-print debug hooks in `rust-gdb` ([rust-lang/rust#96365](https://github.com/rust-lang/rust/issues/96365)). The mentioned issue contains a workaround for enabling pretty-printers in this case.
+
+ * Link against a debug build of python as described in the previous chapter
+ * Run `rust-gdb <my-binary>`
+ * Set a breakpoint (`b`) on `rust_panic` if you are investigating a `panic!`
+ * Enter `r` to run
+ * After the crash occurred, enter `bt` or `bt full` to print the stacktrace
+
+ Often it is helpful to run a small piece of Python code to exercise a section of Rust.
+
+ ```console
+ rust-gdb --args python -c "import my_package; my_package.sum_to_string(1, 2)"
+ ```
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/ecosystem/async-await.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/ecosystem/async-await.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/ecosystem/async-await.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/ecosystem/async-await.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,555 @@
+# Using `async` and `await`
+
+*`async`/`await` support is currently being integrated in PyO3. See the [dedicated documentation](../async-await.md)*
+
+If you are working with a Python library that makes use of async functions or wish to provide
+Python bindings for an async Rust library, [`pyo3-asyncio`](https://github.com/awestlake87/pyo3-asyncio)
+likely has the tools you need. It provides conversions between async functions in both Python and
+Rust and was designed with first-class support for popular Rust runtimes such as
+[`tokio`](https://tokio.rs/) and [`async-std`](https://async.rs/). In addition, all async Python
+code runs on the default `asyncio` event loop, so `pyo3-asyncio` should work just fine with existing
+Python libraries.
+
+In the following sections, we'll give a general overview of `pyo3-asyncio` explaining how to call
+async Python functions with PyO3, how to call async Rust functions from Python, and how to configure
+your codebase to manage the runtimes of both.
+
+## Quickstart
+
+Here are some examples to get you started right away! A more detailed breakdown
+of the concepts in these examples can be found in the following sections.
+
+### Rust Applications
+Here we initialize the runtime, import Python's `asyncio` library and run the given future to completion using Python's default `EventLoop` and `async-std`. Inside the future, we convert `asyncio` sleep into a Rust future and await it.
+
+
+```toml
+# Cargo.toml dependencies
+[dependencies]
+pyo3 = { version = "0.14" }
+pyo3-asyncio = { version = "0.14", features = ["attributes", "async-std-runtime"] }
+async-std = "1.9"
+```
+
+```rust
+//! main.rs
+
+use pyo3::prelude::*;
+
+#[pyo3_asyncio::async_std::main]
+async fn main() -> PyResult<()> {
+    let fut = Python::with_gil(|py| {
+        let asyncio = py.import("asyncio")?;
+        // convert asyncio.sleep into a Rust Future
+        pyo3_asyncio::async_std::into_future(asyncio.call_method1("sleep", (1.into_py(py),))?)
+    })?;
+
+    fut.await?;
+
+    Ok(())
+}
+```
+
+The same application can be written to use `tokio` instead using the `#[pyo3_asyncio::tokio::main]`
+attribute.
+
+```toml
+# Cargo.toml dependencies
+[dependencies]
+pyo3 = { version = "0.14" }
+pyo3-asyncio = { version = "0.14", features = ["attributes", "tokio-runtime"] }
+tokio = "1.4"
+```
+
+```rust
+//! main.rs
+
+use pyo3::prelude::*;
+
+#[pyo3_asyncio::tokio::main]
+async fn main() -> PyResult<()> {
+    let fut = Python::with_gil(|py| {
+        let asyncio = py.import("asyncio")?;
+        // convert asyncio.sleep into a Rust Future
+        pyo3_asyncio::tokio::into_future(asyncio.call_method1("sleep", (1.into_py(py),))?)
+    })?;
+
+    fut.await?;
+
+    Ok(())
+}
+```
+
+More details on the usage of this library can be found in the [API docs](https://awestlake87.github.io/pyo3-asyncio/master/doc) and the primer below.
+
+### PyO3 Native Rust Modules
+
+PyO3 Asyncio can also be used to write native modules with async functions.
+
+Add the `[lib]` section to `Cargo.toml` to make your library a `cdylib` that Python can import.
+```toml
+[lib]
+name = "my_async_module"
+crate-type = ["cdylib"]
+```
+
+Make your project depend on `pyo3` with the `extension-module` feature enabled and select your
+`pyo3-asyncio` runtime:
+
+For `async-std`:
+```toml
+[dependencies]
+pyo3 = { version = "0.14", features = ["extension-module"] }
+pyo3-asyncio = { version = "0.14", features = ["async-std-runtime"] }
+async-std = "1.9"
+```
+
+For `tokio`:
+```toml
+[dependencies]
+pyo3 = { version = "0.14", features = ["extension-module"] }
+pyo3-asyncio = { version = "0.14", features = ["tokio-runtime"] }
+tokio = "1.4"
+```
+
+Export an async function that makes use of `async-std`:
+
+```rust
+//! lib.rs
+
+use pyo3::{prelude::*, wrap_pyfunction};
+
+#[pyfunction]
+fn rust_sleep(py: Python<'_>) -> PyResult<&Bound<'_, PyAny>> {
+    pyo3_asyncio::async_std::future_into_py(py, async {
+        async_std::task::sleep(std::time::Duration::from_secs(1)).await;
+        Ok(Python::with_gil(|py| py.None()))
+    })
+}
+
+#[pymodule]
+fn my_async_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    m.add_function(wrap_pyfunction!(rust_sleep, m)?)
+}
+```
+
+If you want to use `tokio` instead, here's what your module should look like:
+
+```rust
+//! lib.rs
+
+use pyo3::{prelude::*, wrap_pyfunction};
+
+#[pyfunction]
+fn rust_sleep(py: Python<'_>) -> PyResult<&Bound<'_, PyAny>>> {
+    pyo3_asyncio::tokio::future_into_py(py, async {
+        tokio::time::sleep(std::time::Duration::from_secs(1)).await;
+        Ok(Python::with_gil(|py| py.None()))
+    })
+}
+
+#[pymodule]
+fn my_async_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    m.add_function(wrap_pyfunction!(rust_sleep, m)?)
+}
+```
+
+You can build your module with maturin (see the [Using Rust in Python](https://pyo3.rs/main/#using-rust-from-python) section in the PyO3 guide for setup instructions). After that you should be able to run the Python REPL to try it out.
+
+```bash
+maturin develop && python3
+🔗 Found pyo3 bindings
+🐍 Found CPython 3.8 at python3
+    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
+Python 3.8.5 (default, Jan 27 2021, 15:41:15)
+[GCC 9.3.0] on linux
+Type "help", "copyright", "credits" or "license" for more information.
+>>> import asyncio
+>>>
+>>> from my_async_module import rust_sleep
+>>>
+>>> async def main():
+>>>     await rust_sleep()
+>>>
+>>> # should sleep for 1s
+>>> asyncio.run(main())
+>>>
+```
+
+## Awaiting an Async Python Function in Rust
+
+Let's take a look at a dead simple async Python function:
+
+```python
+# Sleep for 1 second
+async def py_sleep():
+    await asyncio.sleep(1)
+```
+
+**Async functions in Python are simply functions that return a `coroutine` object**. For our purposes,
+we really don't need to know much about these `coroutine` objects. The key factor here is that calling
+an `async` function is _just like calling a regular function_, the only difference is that we have
+to do something special with the object that it returns.
+
+Normally in Python, that something special is the `await` keyword, but in order to await this
+coroutine in Rust, we first need to convert it into Rust's version of a `coroutine`: a `Future`.
+That's where `pyo3-asyncio` comes in.
+[`pyo3_asyncio::async_std::into_future`](https://docs.rs/pyo3-asyncio/latest/pyo3_asyncio/async_std/fn.into_future.html)
+performs this conversion for us.
+
+The following example uses `into_future` to call the `py_sleep` function shown above and then await the
+coroutine object returned from the call:
+
+```rust
+use pyo3::prelude::*;
+
+#[pyo3_asyncio::tokio::main]
+async fn main() -> PyResult<()> {
+    let future = Python::with_gil(|py| -> PyResult<_> {
+        // import the module containing the py_sleep function
+        let example = py.import("example")?;
+
+        // calling the py_sleep method like a normal function
+        // returns a coroutine
+        let coroutine = example.call_method0("py_sleep")?;
+
+        // convert the coroutine into a Rust future using the
+        // tokio runtime
+        pyo3_asyncio::tokio::into_future(coroutine)
+    })?;
+
+    // await the future
+    future.await?;
+
+    Ok(())
+}
+```
+
+Alternatively, the below example shows how to write a `#[pyfunction]` which uses `into_future` to receive and await
+a coroutine argument:
+
+```rust
+#[pyfunction]
+fn await_coro(coro: &Bound<'_, PyAny>>) -> PyResult<()> {
+    // convert the coroutine into a Rust future using the
+    // async_std runtime
+    let f = pyo3_asyncio::async_std::into_future(coro)?;
+
+    pyo3_asyncio::async_std::run_until_complete(coro.py(), async move {
+        // await the future
+        f.await?;
+        Ok(())
+    })
+}
+```
+
+This could be called from Python as:
+
+```python
+import asyncio
+
+async def py_sleep():
+    asyncio.sleep(1)
+
+await_coro(py_sleep())
+```
+
+If you wanted to pass a callable function to the `#[pyfunction]` instead, (i.e. the last line becomes `await_coro(py_sleep))`, then the above example needs to be tweaked to first call the callable to get the coroutine:
+
+```rust
+#[pyfunction]
+fn await_coro(callable: &Bound<'_, PyAny>>) -> PyResult<()> {
+    // get the coroutine by calling the callable
+    let coro = callable.call0()?;
+
+    // convert the coroutine into a Rust future using the
+    // async_std runtime
+    let f = pyo3_asyncio::async_std::into_future(coro)?;
+
+    pyo3_asyncio::async_std::run_until_complete(coro.py(), async move {
+        // await the future
+        f.await?;
+        Ok(())
+    })
+}
+```
+
+This can be particularly helpful where you need to repeatedly create and await a coroutine. Trying to await the same coroutine multiple times will raise an error:
+
+```python
+RuntimeError: cannot reuse already awaited coroutine
+```
+
+> If you're interested in learning more about `coroutines` and `awaitables` in general, check out the
+> [Python 3 `asyncio` docs](https://docs.python.org/3/library/asyncio-task.html) for more information.
+
+## Awaiting a Rust Future in Python
+
+Here we have the same async function as before written in Rust using the
+[`async-std`](https://async.rs/) runtime:
+
+```rust
+/// Sleep for 1 second
+async fn rust_sleep() {
+    async_std::task::sleep(std::time::Duration::from_secs(1)).await;
+}
+```
+
+Similar to Python, Rust's async functions also return a special object called a
+`Future`:
+
+```rust
+let future = rust_sleep();
+```
+
+We can convert this `Future` object into Python to make it `awaitable`. This tells Python that you
+can use the `await` keyword with it. In order to do this, we'll call
+[`pyo3_asyncio::async_std::future_into_py`](https://docs.rs/pyo3-asyncio/latest/pyo3_asyncio/async_std/fn.future_into_py.html):
+
+```rust
+use pyo3::prelude::*;
+
+async fn rust_sleep() {
+    async_std::task::sleep(std::time::Duration::from_secs(1)).await;
+}
+
+#[pyfunction]
+fn call_rust_sleep(py: Python<'_>) -> PyResult<&Bound<'_, PyAny>>> {
+    pyo3_asyncio::async_std::future_into_py(py, async move {
+        rust_sleep().await;
+        Ok(Python::with_gil(|py| py.None()))
+    })
+}
+```
+
+In Python, we can call this pyo3 function just like any other async function:
+
+```python
+from example import call_rust_sleep
+
+async def rust_sleep():
+    await call_rust_sleep()
+```
+
+## Managing Event Loops
+
+Python's event loop requires some special treatment, especially regarding the main thread. Some of
+Python's `asyncio` features, like proper signal handling, require control over the main thread, which
+doesn't always play well with Rust.
+
+Luckily, Rust's event loops are pretty flexible and don't _need_ control over the main thread, so in
+`pyo3-asyncio`, we decided the best way to handle Rust/Python interop was to just surrender the main
+thread to Python and run Rust's event loops in the background. Unfortunately, since most event loop
+implementations _prefer_ control over the main thread, this can still make some things awkward.
+
+### PyO3 Asyncio Initialization
+
+Because Python needs to control the main thread, we can't use the convenient proc macros from Rust
+runtimes to handle the `main` function or `#[test]` functions. Instead, the initialization for PyO3 has to be done from the `main` function and the main
+thread must block on [`pyo3_asyncio::async_std::run_until_complete`](https://docs.rs/pyo3-asyncio/latest/pyo3_asyncio/async_std/fn.run_until_complete.html).
+
+Because we have to block on one of those functions, we can't use [`#[async_std::main]`](https://docs.rs/async-std/latest/async_std/attr.main.html) or [`#[tokio::main]`](https://docs.rs/tokio/1.1.0/tokio/attr.main.html)
+since it's not a good idea to make long blocking calls during an async function.
+
+> Internally, these `#[main]` proc macros are expanded to something like this:
+> ```rust
+> fn main() {
+>     // your async main fn
+>     async fn _main_impl() { /* ... */ }
+>     Runtime::new().block_on(_main_impl());
+> }
+> ```
+> Making a long blocking call inside the `Future` that's being driven by `block_on` prevents that
+> thread from doing anything else and can spell trouble for some runtimes (also this will actually
+> deadlock a single-threaded runtime!). Many runtimes have some sort of `spawn_blocking` mechanism
+> that can avoid this problem, but again that's not something we can use here since we need it to
+> block on the _main_ thread.
+
+For this reason, `pyo3-asyncio` provides its own set of proc macros to provide you with this
+initialization. These macros are intended to mirror the initialization of `async-std` and `tokio`
+while also satisfying the Python runtime's needs.
+
+Here's a full example of PyO3 initialization with the `async-std` runtime:
+```rust
+use pyo3::prelude::*;
+
+#[pyo3_asyncio::async_std::main]
+async fn main() -> PyResult<()> {
+    // PyO3 is initialized - Ready to go
+
+    let fut = Python::with_gil(|py| -> PyResult<_> {
+        let asyncio = py.import("asyncio")?;
+
+        // convert asyncio.sleep into a Rust Future
+        pyo3_asyncio::async_std::into_future(
+            asyncio.call_method1("sleep", (1.into_py(py),))?
+        )
+    })?;
+
+    fut.await?;
+
+    Ok(())
+}
+```
+
+### A Note About `asyncio.run`
+
+In Python 3.7+, the recommended way to run a top-level coroutine with `asyncio`
+is with `asyncio.run`. In `v0.13` we recommended against using this function due to initialization issues, but in `v0.14` it's perfectly valid to use this function... with a caveat.
+
+Since our Rust <--> Python conversions require a reference to the Python event loop, this poses a problem. Imagine we have a PyO3 Asyncio module that defines
+a `rust_sleep` function like in previous examples. You might rightfully assume that you can call pass this directly into `asyncio.run` like this:
+
+```python
+import asyncio
+
+from my_async_module import rust_sleep
+
+asyncio.run(rust_sleep())
+```
+
+You might be surprised to find out that this throws an error:
+```bash
+Traceback (most recent call last):
+  File "example.py", line 5, in <module>
+    asyncio.run(rust_sleep())
+RuntimeError: no running event loop
+```
+
+What's happening here is that we are calling `rust_sleep` _before_ the future is
+actually running on the event loop created by `asyncio.run`. This is counter-intuitive, but expected behaviour, and unfortunately there doesn't seem to be a good way of solving this problem within PyO3 Asyncio itself.
+
+However, we can make this example work with a simple workaround:
+
+```python
+import asyncio
+
+from my_async_module import rust_sleep
+
+# Calling main will just construct the coroutine that later calls rust_sleep.
+# - This ensures that rust_sleep will be called when the event loop is running,
+#   not before.
+async def main():
+    await rust_sleep()
+
+# Run the main() coroutine at the top-level instead
+asyncio.run(main())
+```
+
+### Non-standard Python Event Loops
+
+Python allows you to use alternatives to the default `asyncio` event loop. One
+popular alternative is `uvloop`. In `v0.13` using non-standard event loops was
+a bit of an ordeal, but in `v0.14` it's trivial.
+
+#### Using `uvloop` in a PyO3 Asyncio Native Extensions
+
+```toml
+# Cargo.toml
+
+[lib]
+name = "my_async_module"
+crate-type = ["cdylib"]
+
+[dependencies]
+pyo3 = { version = "0.14", features = ["extension-module"] }
+pyo3-asyncio = { version = "0.14", features = ["tokio-runtime"] }
+async-std = "1.9"
+tokio = "1.4"
+```
+
+```rust
+//! lib.rs
+
+use pyo3::{prelude::*, wrap_pyfunction};
+
+#[pyfunction]
+fn rust_sleep(py: Python<'_>) -> PyResult<&Bound<'_, PyAny>>> {
+    pyo3_asyncio::tokio::future_into_py(py, async {
+        tokio::time::sleep(std::time::Duration::from_secs(1)).await;
+        Ok(Python::with_gil(|py| py.None()))
+    })
+}
+
+#[pymodule]
+fn my_async_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    m.add_function(wrap_pyfunction!(rust_sleep, m)?)?;
+
+    Ok(())
+}
+```
+
+```bash
+$ maturin develop && python3
+🔗 Found pyo3 bindings
+🐍 Found CPython 3.8 at python3
+    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
+Python 3.8.8 (default, Apr 13 2021, 19:58:26)
+[GCC 7.3.0] :: Anaconda, Inc. on linux
+Type "help", "copyright", "credits" or "license" for more information.
+>>> import asyncio
+>>> import uvloop
+>>>
+>>> import my_async_module
+>>>
+>>> uvloop.install()
+>>>
+>>> async def main():
+...     await my_async_module.rust_sleep()
+...
+>>> asyncio.run(main())
+>>>
+```
+
+#### Using `uvloop` in Rust Applications
+
+Using `uvloop` in Rust applications is a bit trickier, but it's still possible
+with relatively few modifications.
+
+Unfortunately, we can't make use of the `#[pyo3_asyncio::<runtime>::main]` attribute with non-standard event loops. This is because the `#[pyo3_asyncio::<runtime>::main]` proc macro has to interact with the Python
+event loop before we can install the `uvloop` policy.
+
+```toml
+[dependencies]
+async-std = "1.9"
+pyo3 = "0.14"
+pyo3-asyncio = { version = "0.14", features = ["async-std-runtime"] }
+```
+
+```rust
+//! main.rs
+
+use pyo3::{prelude::*, types::PyType};
+
+fn main() -> PyResult<()> {
+    pyo3::prepare_freethreaded_python();
+
+    Python::with_gil(|py| {
+        let uvloop = py.import("uvloop")?;
+        uvloop.call_method0("install")?;
+
+        // store a reference for the assertion
+        let uvloop = PyObject::from(uvloop);
+
+        pyo3_asyncio::async_std::run(py, async move {
+            // verify that we are on a uvloop.Loop
+            Python::with_gil(|py| -> PyResult<()> {
+                assert!(pyo3_asyncio::async_std::get_current_loop(py)?.is_instance(
+                    uvloop
+                        .as_ref(py)
+                        .getattr("Loop")?
+                )?);
+                Ok(())
+            })?;
+
+            async_std::task::sleep(std::time::Duration::from_secs(1)).await;
+
+            Ok(())
+        })
+    })
+}
+```
+
+## Additional Information
+- Managing event loop references can be tricky with pyo3-asyncio. See [Event Loop References](https://docs.rs/pyo3-asyncio/#event-loop-references) in the API docs to get a better intuition for how event loop references are managed in this library.
+- Testing pyo3-asyncio libraries and applications requires a custom test harness since Python requires control over the main thread. You can find a testing guide in the [API docs for the `testing` module](https://docs.rs/pyo3-asyncio/latest/pyo3_asyncio/testing)
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/ecosystem/logging.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/ecosystem/logging.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/ecosystem/logging.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/ecosystem/logging.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,98 @@
+# Logging
+
+It is desirable if both the Python and Rust parts of the application end up
+logging using the same configuration into the same place.
+
+This section of the guide briefly discusses how to connect the two languages'
+logging ecosystems together. The recommended way for Python extension modules is
+to configure Rust's logger to send log messages to Python using the `pyo3-log`
+crate. For users who want to do the opposite and send Python log messages to
+Rust, see the note at the end of this guide.
+
+## Using `pyo3-log` to send Rust log messages to Python
+
+The [pyo3-log] crate allows sending the messages from the Rust side to Python's
+[logging] system. This is mostly suitable for writing native extensions for
+Python programs.
+
+Use [`pyo3_log::init`][init] to install the logger in its default configuration.
+It's also possible to tweak its configuration (mostly to tune its performance).
+
+```rust
+use log::info;
+use pyo3::prelude::*;
+
+#[pyfunction]
+fn log_something() {
+    // This will use the logger installed in `my_module` to send the `info`
+    // message to the Python logging facilities.
+    info!("Something!");
+}
+
+#[pymodule]
+fn my_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    // A good place to install the Rust -> Python logger.
+    pyo3_log::init();
+
+    m.add_function(wrap_pyfunction!(log_something, m)?)?;
+    Ok(())
+}
+```
+
+Then it is up to the Python side to actually output the messages somewhere.
+
+```python
+import logging
+import my_module
+
+FORMAT = '%(levelname)s %(name)s %(asctime)-15s %(filename)s:%(lineno)d %(message)s'
+logging.basicConfig(format=FORMAT)
+logging.getLogger().setLevel(logging.INFO)
+my_module.log_something()
+```
+
+It is important to initialize the Python loggers first, before calling any Rust
+functions that may log. This limitation can be worked around if it is not
+possible to satisfy, read the documentation about [caching].
+
+## The Python to Rust direction
+
+To have python logs be handled by Rust, one need only register a rust function to handle logs emitted from the core python logging module.
+
+This has been implemented within the [pyo3-pylogger] crate.
+
+```rust
+use log::{info, warn};
+use pyo3::prelude::*;
+
+fn main() -> PyResult<()> {
+    // register the host handler with python logger, providing a logger target
+    // set the name here to something appropriate for your application
+    pyo3_pylogger::register("example_application_py_logger");
+
+    // initialize up a logger
+    env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("trace")).init();
+
+    // Log some messages from Rust.
+    info!("Just some normal information!");
+    warn!("Something spooky happened!");
+
+    // Log some messages from Python
+    Python::with_gil(|py| {
+        py.run(
+            "
+import logging
+logging.error('Something bad happened')
+",
+            None,
+            None,
+        )
+    })
+}
+```
+
+[logging]: https://docs.python.org/3/library/logging.html
+[pyo3-log]: https://crates.io/crates/pyo3-log
+[init]: https://docs.rs/pyo3-log/*/pyo3_log/fn.init.html
+[caching]: https://docs.rs/pyo3-log/*/pyo3_log/#performance-filtering-and-caching
+[pyo3-pylogger]: https://crates.io/crates/pyo3-pylogger
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/ecosystem.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/ecosystem.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/ecosystem.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/ecosystem.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+# The PyO3 ecosystem
+
+This portion of the guide is dedicated to crates which are external to the main PyO3 project and provide additional functionality you might find useful.
+
+Because these projects evolve independently of the PyO3 repository the content of these articles may fall out of date over time; please file issues on the PyO3 GitHub to alert maintainers when this is the case.
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/exception.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/exception.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/exception.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/exception.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,132 @@
+# Python exceptions
+
+## Defining a new exception
+
+Use the [`create_exception!`] macro:
+
+```rust
+use pyo3::create_exception;
+
+create_exception!(module, MyError, pyo3::exceptions::PyException);
+```
+
+* `module` is the name of the containing module.
+* `MyError` is the name of the new exception type.
+
+For example:
+
+```rust
+use pyo3::prelude::*;
+use pyo3::create_exception;
+use pyo3::types::IntoPyDict;
+use pyo3::exceptions::PyException;
+
+create_exception!(mymodule, CustomError, PyException);
+
+Python::with_gil(|py| {
+    let ctx = [("CustomError", py.get_type_bound::<CustomError>())].into_py_dict_bound(py);
+    pyo3::py_run!(
+        py,
+        *ctx,
+        "assert str(CustomError) == \"<class 'mymodule.CustomError'>\""
+    );
+    pyo3::py_run!(py, *ctx, "assert CustomError('oops').args == ('oops',)");
+});
+```
+
+When using PyO3 to create an extension module, you can add the new exception to
+the module like this, so that it is importable from Python:
+
+```rust
+use pyo3::prelude::*;
+use pyo3::exceptions::PyException;
+
+pyo3::create_exception!(mymodule, CustomError, PyException);
+
+#[pymodule]
+fn mymodule(py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> {
+    // ... other elements added to module ...
+    m.add("CustomError", py.get_type_bound::<CustomError>())?;
+
+    Ok(())
+}
+```
+
+## Raising an exception
+
+As described in the [function error handling](./function/error-handling.md) chapter, to raise an exception from a `#[pyfunction]` or `#[pymethods]`, return an `Err(PyErr)`. PyO3 will automatically raise this exception for you when returning the result to Python.
+
+You can also manually write and fetch errors in the Python interpreter's global state:
+
+```rust
+use pyo3::{Python, PyErr};
+use pyo3::exceptions::PyTypeError;
+
+Python::with_gil(|py| {
+    PyTypeError::new_err("Error").restore(py);
+    assert!(PyErr::occurred(py));
+    drop(PyErr::fetch(py));
+});
+```
+
+## Checking exception types
+
+Python has an [`isinstance`](https://docs.python.org/3/library/functions.html#isinstance) method to check an object's type.
+In PyO3 every object has the [`PyAny::is_instance`] and [`PyAny::is_instance_of`] methods which do the same thing.
+
+```rust
+use pyo3::prelude::*;
+use pyo3::types::{PyBool, PyList};
+
+Python::with_gil(|py| {
+    assert!(PyBool::new_bound(py, true).is_instance_of::<PyBool>());
+    let list = PyList::new_bound(py, &[1, 2, 3, 4]);
+    assert!(!list.is_instance_of::<PyBool>());
+    assert!(list.is_instance_of::<PyList>());
+});
+```
+
+To check the type of an exception, you can similarly do:
+
+```rust
+# use pyo3::exceptions::PyTypeError;
+# use pyo3::prelude::*;
+# Python::with_gil(|py| {
+# let err = PyTypeError::new_err(());
+err.is_instance_of::<PyTypeError>(py);
+# });
+```
+
+## Using exceptions defined in Python code
+
+It is possible to use an exception defined in Python code as a native Rust type.
+The `import_exception!` macro allows importing a specific exception class and defines a Rust type
+for that exception.
+
+```rust
+#![allow(dead_code)]
+use pyo3::prelude::*;
+
+mod io {
+    pyo3::import_exception!(io, UnsupportedOperation);
+}
+
+fn tell(file: &Bound<'_, PyAny>) -> PyResult<u64> {
+    match file.call_method0("tell") {
+        Err(_) => Err(io::UnsupportedOperation::new_err("not supported: tell")),
+        Ok(x) => x.extract::<u64>(),
+    }
+}
+```
+
+[`pyo3::exceptions`]({{#PYO3_DOCS_URL}}/pyo3/exceptions/index.html)
+defines exceptions for several standard library modules.
+
+[`create_exception!`]: {{#PYO3_DOCS_URL}}/pyo3/macro.create_exception.html
+[`import_exception!`]: {{#PYO3_DOCS_URL}}/pyo3/macro.import_exception.html
+
+[`PyErr`]: {{#PYO3_DOCS_URL}}/pyo3/struct.PyErr.html
+[`PyResult`]: {{#PYO3_DOCS_URL}}/pyo3/type.PyResult.html
+[`PyErr::from_value`]: {{#PYO3_DOCS_URL}}/pyo3/struct.PyErr.html#method.from_value
+[`PyAny::is_instance`]: {{#PYO3_DOCS_URL}}/pyo3/types/trait.PyAnyMethods.html#tymethod.is_instance
+[`PyAny::is_instance_of`]: {{#PYO3_DOCS_URL}}/pyo3/types/trait.PyAnyMethods.html#tymethod.is_instance_of
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/faq.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/faq.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/faq.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/faq.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,204 @@
+# Frequently Asked Questions and troubleshooting
+
+Sorry that you're having trouble using PyO3. If you can't find the answer to your problem in the list below, you can also reach out for help on [GitHub Discussions](https://github.com/PyO3/pyo3/discussions) and on [Discord](https://discord.gg/33kcChzH7f).
+
+## I'm experiencing deadlocks using PyO3 with lazy_static or once_cell!
+
+`lazy_static` and `once_cell::sync` both use locks to ensure that initialization is performed only by a single thread. Because the Python GIL is an additional lock this can lead to deadlocks in the following way:
+
+1. A thread (thread A) which has acquired the Python GIL starts initialization of a `lazy_static` value.
+2. The initialization code calls some Python API which temporarily releases the GIL e.g. `Python::import`.
+3. Another thread (thread B) acquires the Python GIL and attempts to access the same `lazy_static` value.
+4. Thread B is blocked, because it waits for `lazy_static`'s initialization to lock to release.
+5. Thread A is blocked, because it waits to re-acquire the GIL which thread B still holds.
+6. Deadlock.
+
+PyO3 provides a struct [`GILOnceCell`] which works equivalently to `OnceCell` but relies solely on the Python GIL for thread safety. This means it can be used in place of `lazy_static` or `once_cell` where you are experiencing the deadlock described above. See the documentation for [`GILOnceCell`] for an example how to use it.
+
+[`GILOnceCell`]: {{#PYO3_DOCS_URL}}/pyo3/sync/struct.GILOnceCell.html
+
+## I can't run `cargo test`; or I can't build in a Cargo workspace: I'm having linker issues like "Symbol not found" or "Undefined reference to _PyExc_SystemError"!
+
+Currently, [#340](https://github.com/PyO3/pyo3/issues/340) causes `cargo test` to fail with linking errors when the `extension-module` feature is activated. Linking errors can also happen when building in a cargo workspace where a different crate also uses PyO3 (see [#2521](https://github.com/PyO3/pyo3/issues/2521)). For now, there are three ways we can work around these issues.
+
+1. Make the `extension-module` feature optional. Build with `maturin develop --features "extension-module"`
+
+```toml
+[dependencies.pyo3]
+{{#PYO3_CRATE_VERSION}}
+
+[features]
+extension-module = ["pyo3/extension-module"]
+```
+
+2. Make the `extension-module` feature optional and default. Run tests with `cargo test --no-default-features`:
+
+```toml
+[dependencies.pyo3]
+{{#PYO3_CRATE_VERSION}}
+
+[features]
+extension-module = ["pyo3/extension-module"]
+default = ["extension-module"]
+```
+
+3. If you are using a [`pyproject.toml`](https://maturin.rs/metadata.html) file to control maturin settings, add the following section:
+
+```toml
+[tool.maturin]
+features = ["pyo3/extension-module"]
+# Or for maturin 0.12:
+# cargo-extra-args = ["--features", "pyo3/extension-module"]
+```
+
+## I can't run `cargo test`: my crate cannot be found for tests in `tests/` directory!
+
+The Rust book suggests to [put integration tests inside a `tests/` directory](https://doc.rust-lang.org/book/ch11-03-test-organization.html#integration-tests).
+
+For a PyO3 `extension-module` project where the `crate-type` is set to `"cdylib"` in your `Cargo.toml`,
+the compiler won't be able to find your crate and will display errors such as `E0432` or `E0463`:
+
+```text
+error[E0432]: unresolved import `my_crate`
+ --> tests/test_my_crate.rs:1:5
+  |
+1 | use my_crate;
+  |     ^^^^^^^^^^^^ no external crate `my_crate`
+```
+
+The best solution is to make your crate types include both `rlib` and `cdylib`:
+
+```toml
+# Cargo.toml
+[lib]
+crate-type = ["cdylib", "rlib"]
+```
+
+## Ctrl-C doesn't do anything while my Rust code is executing!
+
+This is because Ctrl-C raises a SIGINT signal, which is handled by the calling Python process by simply setting a flag to action upon later. This flag isn't checked while Rust code called from Python is executing, only once control returns to the Python interpreter.
+
+You can give the Python interpreter a chance to process the signal properly by calling `Python::check_signals`. It's good practice to call this function regularly if you have a long-running Rust function so that your users can cancel it.
+
+## `#[pyo3(get)]` clones my field!
+
+You may have a nested struct similar to this:
+
+```rust
+# use pyo3::prelude::*;
+#[pyclass]
+#[derive(Clone)]
+struct Inner {/* fields omitted */}
+
+#[pyclass]
+struct Outer {
+    #[pyo3(get)]
+    inner: Inner,
+}
+
+#[pymethods]
+impl Outer {
+    #[new]
+    fn __new__() -> Self {
+        Self { inner: Inner {} }
+    }
+}
+```
+
+When Python code accesses `Outer`'s field, PyO3 will return a new object on every access (note that their addresses are different):
+
+```python
+outer = Outer()
+
+a = outer.inner
+b = outer.inner
+
+assert a is b, f"a: {a}\nb: {b}"
+```
+
+```text
+AssertionError: a: <builtins.Inner object at 0x00000238FFB9C7B0>
+b: <builtins.Inner object at 0x00000238FFB9C830>
+```
+
+This can be especially confusing if the field is mutable, as getting the field and then mutating it won't persist - you'll just get a fresh clone of the original on the next access. Unfortunately Python and Rust don't agree about ownership - if PyO3 gave out references to (possibly) temporary Rust objects to Python code, Python code could then keep that reference alive indefinitely. Therefore returning Rust objects requires cloning.
+
+If you don't want that cloning to happen, a workaround is to allocate the field on the Python heap and store a reference to that, by using [`Py<...>`]({{#PYO3_DOCS_URL}}/pyo3/struct.Py.html):
+```rust
+# use pyo3::prelude::*;
+#[pyclass]
+struct Inner {/* fields omitted */}
+
+#[pyclass]
+struct Outer {
+    inner: Py<Inner>,
+}
+
+#[pymethods]
+impl Outer {
+    #[new]
+    fn __new__(py: Python<'_>) -> PyResult<Self> {
+        Ok(Self {
+            inner: Py::new(py, Inner {})?,
+        })
+    }
+
+    #[getter]
+    fn inner(&self, py: Python<'_>) -> Py<Inner> {
+        self.inner.clone_ref(py)
+    }
+}
+```
+This time `a` and `b` *are* the same object:
+```python
+outer = Outer()
+
+a = outer.inner
+b = outer.inner
+
+assert a is b, f"a: {a}\nb: {b}"
+print(f"a: {a}\nb: {b}")
+```
+
+```text
+a: <builtins.Inner object at 0x0000020044FCC670>
+b: <builtins.Inner object at 0x0000020044FCC670>
+```
+The downside to this approach is that any Rust code working on the `Outer` struct now has to acquire the GIL to do anything with its field.
+
+## I want to use the `pyo3` crate re-exported from dependency but the proc-macros fail!
+
+All PyO3 proc-macros (`#[pyclass]`, `#[pyfunction]`, `#[derive(FromPyObject)]`
+and so on) expect the `pyo3` crate to be available under that name in your crate
+root, which is the normal situation when `pyo3` is a direct dependency of your
+crate.
+
+However, when the dependency is renamed, or your crate only indirectly depends
+on `pyo3`, you need to let the macro code know where to find the crate.  This is
+done with the `crate` attribute:
+
+```rust
+# use pyo3::prelude::*;
+# pub extern crate pyo3;
+# mod reexported { pub use ::pyo3; }
+#[pyclass]
+#[pyo3(crate = "reexported::pyo3")]
+struct MyClass;
+```
+
+## I'm trying to call Python from Rust but I get `STATUS_DLL_NOT_FOUND` or `STATUS_ENTRYPOINT_NOT_FOUND`!
+
+This happens on Windows when linking to the python DLL fails or the wrong one is linked. The Python DLL on Windows will usually be called something like:
+- `python3X.dll` for Python 3.X, e.g. `python310.dll` for Python 3.10
+- `python3.dll` when using PyO3's `abi3` feature
+
+The DLL needs to be locatable using the [Windows DLL search order](https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order#standard-search-order-for-unpackaged-apps). Some ways to achieve this are:
+- Put the Python DLL in the same folder as your build artifacts
+- Add the directory containing the Python DLL to your `PATH` environment variable, for example `C:\Users\<You>\AppData\Local\Programs\Python\Python310`
+- If this happens when you are *distributing* your program, consider using [PyOxidizer](https://github.com/indygreg/PyOxidizer) to package it with your binary.
+
+If the wrong DLL is linked it is possible that this happened because another program added itself and its own Python DLLs to `PATH`. Rearrange your `PATH` variables to give the correct DLL priority.
+
+> **Note**: Changes to `PATH` (or any other environment variable) are not visible to existing shells. Restart it for changes to take effect.
+
+For advanced troubleshooting, [Dependency Walker](https://www.dependencywalker.com/) can be used to diagnose linking errors.
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/features.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/features.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/features.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/features.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,201 @@
+# Features reference
+
+PyO3 provides a number of Cargo features to customize functionality. This chapter of the guide provides detail on each of them.
+
+By default, only the `macros` feature is enabled.
+
+## Features for extension module authors
+
+### `extension-module`
+
+This feature is required when building a Python extension module using PyO3.
+
+It tells PyO3's build script to skip linking against `libpython.so` on Unix platforms, where this must not be done.
+
+See the [building and distribution](building-and-distribution.md#the-extension-module-feature) section for further detail.
+
+### `abi3`
+
+This feature is used when building Python extension modules to create wheels which are compatible with multiple Python versions.
+
+It restricts PyO3's API to a subset of the full Python API which is guaranteed by [PEP 384](https://www.python.org/dev/peps/pep-0384/) to be forwards-compatible with future Python versions.
+
+See the [building and distribution](building-and-distribution.md#py_limited_apiabi3) section for further detail.
+
+### The `abi3-pyXY` features
+
+(`abi3-py37`, `abi3-py38`, `abi3-py39`, `abi3-py310` and `abi3-py311`)
+
+These features are extensions of the `abi3` feature to specify the exact minimum Python version which the multiple-version-wheel will support.
+
+See the [building and distribution](building-and-distribution.md#minimum-python-version-for-abi3) section for further detail.
+
+### `generate-import-lib`
+
+This experimental feature is used to generate import libraries for Python DLL
+for MinGW-w64 and MSVC (cross-)compile targets.
+
+Enabling it allows to (cross-)compile extension modules to any Windows targets
+without having to install the Windows Python distribution files for the target.
+
+See the [building and distribution](building-and-distribution.md#building-abi3-extensions-without-a-python-interpreter)
+section for further detail.
+
+## Features for embedding Python in Rust
+
+### `auto-initialize`
+
+This feature changes [`Python::with_gil`]({{#PYO3_DOCS_URL}}/pyo3/marker/struct.Python.html#method.with_gil) to automatically initialize a Python interpreter (by calling [`prepare_freethreaded_python`]({{#PYO3_DOCS_URL}}/pyo3/fn.prepare_freethreaded_python.html)) if needed.
+
+If you do not enable this feature, you should call `pyo3::prepare_freethreaded_python()` before attempting to call any other Python APIs.
+
+## Advanced Features
+
+### `experimental-async`
+
+This feature adds support for `async fn` in `#[pyfunction]` and `#[pymethods]`.
+
+The feature has some unfinished refinements and performance improvements. To help finish this off, see [issue #1632](https://github.com/PyO3/pyo3/issues/1632) and its associated draft PRs.
+
+### `experimental-inspect`
+
+This feature adds the `pyo3::inspect` module, as well as `IntoPy::type_output` and `FromPyObject::type_input` APIs to produce Python type "annotations" for Rust types.
+
+This is a first step towards adding first-class support for generating type annotations automatically in PyO3, however work is needed to finish this off. All feedback and offers of help welcome on [issue #2454](https://github.com/PyO3/pyo3/issues/2454).
+
+### `gil-refs`
+
+This feature is a backwards-compatibility feature to allow continued use of the "GIL Refs" APIs deprecated in PyO3 0.21. These APIs have performance drawbacks and soundness edge cases which the newer `Bound<T>` smart pointer and accompanying APIs resolve.
+
+This feature and the APIs it enables is expected to be removed in a future PyO3 version.
+
+### `py-clone`
+
+This feature was introduced to ease migration. It was found that delayed reference counts cannot be made sound and hence `Clon`ing an instance of `Py<T>` must panic without the GIL being held. To avoid migrations introducing new panics without warning, the `Clone` implementation itself is now gated behind this feature.
+
+### `pyo3_disable_reference_pool`
+
+This is a performance-oriented conditional compilation flag, e.g. [set via `$RUSTFLAGS`][set-configuration-options], which disabled the global reference pool and the assocaited overhead for the crossing the Python-Rust boundary. However, if enabled, `Drop`ping an instance of `Py<T>` without the GIL being held will abort the process.
+
+### `macros`
+
+This feature enables a dependency on the `pyo3-macros` crate, which provides the procedural macros portion of PyO3's API:
+
+- `#[pymodule]`
+- `#[pyfunction]`
+- `#[pyclass]`
+- `#[pymethods]`
+- `#[derive(FromPyObject)]`
+
+It also provides the `py_run!` macro.
+
+These macros require a number of dependencies which may not be needed by users who just need PyO3 for Python FFI. Disabling this feature enables faster builds for those users, as these dependencies will not be built if this feature is disabled.
+
+> This feature is enabled by default. To disable it, set `default-features = false` for the `pyo3` entry in your Cargo.toml.
+
+### `multiple-pymethods`
+
+This feature enables each `#[pyclass]` to have more than one `#[pymethods]` block.
+
+Most users should only need a single `#[pymethods]` per `#[pyclass]`. In addition, not all platforms (e.g. Wasm) are supported by `inventory`, which is used in the implementation of the feature. For this reason this feature is not enabled by default, meaning fewer dependencies and faster compilation for the majority of users.
+
+See [the `#[pyclass]` implementation details](class.md#implementation-details) for more information.
+
+### `nightly`
+
+The `nightly` feature needs the nightly Rust compiler. This allows PyO3 to use the `auto_traits` and `negative_impls` features to fix the `Python::allow_threads` function.
+
+### `resolve-config`
+
+The `resolve-config` feature of the `pyo3-build-config` crate controls whether that crate's
+build script automatically resolves a Python interpreter / build configuration. This feature is primarily useful when building PyO3
+itself. By default this feature is not enabled, meaning you can freely use `pyo3-build-config` as a standalone library to read or write PyO3 build configuration files or resolve metadata about a Python interpreter.
+
+## Optional Dependencies
+
+These features enable conversions between Python types and types from other Rust crates, enabling easy access to the rest of the Rust ecosystem.
+
+### `anyhow`
+
+Adds a dependency on [anyhow](https://docs.rs/anyhow). Enables a conversion from [anyhow](https://docs.rs/anyhow)’s [`Error`](https://docs.rs/anyhow/latest/anyhow/struct.Error.html) type to [`PyErr`]({{#PYO3_DOCS_URL}}/pyo3/struct.PyErr.html), for easy error handling.
+
+### `chrono`
+
+Adds a dependency on [chrono](https://docs.rs/chrono). Enables a conversion from [chrono](https://docs.rs/chrono)'s types to python:
+- [TimeDelta](https://docs.rs/chrono/latest/chrono/struct.TimeDelta.html) -> [`PyDelta`]({{#PYO3_DOCS_URL}}/pyo3/types/struct.PyDelta.html)
+- [FixedOffset](https://docs.rs/chrono/latest/chrono/offset/struct.FixedOffset.html) -> [`PyDelta`]({{#PYO3_DOCS_URL}}/pyo3/types/struct.PyDelta.html)
+- [Utc](https://docs.rs/chrono/latest/chrono/offset/struct.Utc.html) -> [`PyTzInfo`]({{#PYO3_DOCS_URL}}/pyo3/types/struct.PyTzInfo.html)
+- [NaiveDate](https://docs.rs/chrono/latest/chrono/naive/struct.NaiveDate.html) -> [`PyDate`]({{#PYO3_DOCS_URL}}/pyo3/types/struct.PyDate.html)
+- [NaiveTime](https://docs.rs/chrono/latest/chrono/naive/struct.NaiveTime.html) -> [`PyTime`]({{#PYO3_DOCS_URL}}/pyo3/types/struct.PyTime.html)
+- [DateTime](https://docs.rs/chrono/latest/chrono/struct.DateTime.html) -> [`PyDateTime`]({{#PYO3_DOCS_URL}}/pyo3/types/struct.PyDateTime.html)
+
+### `chrono-tz`
+
+Adds a dependency on [chrono-tz](https://docs.rs/chrono-tz).
+Enables conversion from and to [`Tz`](https://docs.rs/chrono-tz/latest/chrono_tz/enum.Tz.html).
+It requires at least Python 3.9.
+
+### `either`
+
+Adds a dependency on [either](https://docs.rs/either). Enables a conversions into [either](https://docs.rs/either)’s [`Either`](https://docs.rs/either/latest/either/enum.Either.html) type.
+
+### `eyre`
+
+Adds a dependency on [eyre](https://docs.rs/eyre). Enables a conversion from [eyre](https://docs.rs/eyre)’s [`Report`](https://docs.rs/eyre/latest/eyre/struct.Report.html) type to [`PyErr`]({{#PYO3_DOCS_URL}}/pyo3/struct.PyErr.html), for easy error handling.
+
+### `hashbrown`
+
+Adds a dependency on [hashbrown](https://docs.rs/hashbrown) and enables conversions into its [`HashMap`](https://docs.rs/hashbrown/latest/hashbrown/struct.HashMap.html) and [`HashSet`](https://docs.rs/hashbrown/latest/hashbrown/struct.HashSet.html) types.
+
+### `indexmap`
+
+Adds a dependency on [indexmap](https://docs.rs/indexmap) and enables conversions into its [`IndexMap`](https://docs.rs/indexmap/latest/indexmap/map/struct.IndexMap.html) type.
+
+### `num-bigint`
+
+Adds a dependency on [num-bigint](https://docs.rs/num-bigint) and enables conversions into its [`BigInt`](https://docs.rs/num-bigint/latest/num_bigint/struct.BigInt.html) and [`BigUint`](https://docs.rs/num-bigint/latest/num_bigint/struct.BigUint.html) types.
+
+### `num-complex`
+
+Adds a dependency on [num-complex](https://docs.rs/num-complex) and enables conversions into its [`Complex`](https://docs.rs/num-complex/latest/num_complex/struct.Complex.html) type.
+
+### `num-rational`
+
+Adds a dependency on [num-rational](https://docs.rs/num-rational) and enables conversions into its [`Ratio`](https://docs.rs/num-rational/latest/num_rational/struct.Ratio.html) type.
+
+### `rust_decimal`
+
+Adds a dependency on [rust_decimal](https://docs.rs/rust_decimal) and enables conversions into its [`Decimal`](https://docs.rs/rust_decimal/latest/rust_decimal/struct.Decimal.html) type.
+
+### `serde`
+
+Enables (de)serialization of `Py<T>` objects via [serde](https://serde.rs/).
+This allows to use [`#[derive(Serialize, Deserialize)`](https://serde.rs/derive.html) on structs that hold references to `#[pyclass]` instances
+
+```rust
+# #[cfg(feature = "serde")]
+# #[allow(dead_code)]
+# mod serde_only {
+# use pyo3::prelude::*;
+# use serde::{Deserialize, Serialize};
+
+#[pyclass]
+#[derive(Serialize, Deserialize)]
+struct Permission {
+    name: String,
+}
+
+#[pyclass]
+#[derive(Serialize, Deserialize)]
+struct User {
+    username: String,
+    permissions: Vec<Py<Permission>>,
+}
+# }
+```
+
+### `smallvec`
+
+Adds a dependency on [smallvec](https://docs.rs/smallvec) and enables conversions into its [`SmallVec`](https://docs.rs/smallvec/latest/smallvec/struct.SmallVec.html) type.
+
+[set-configuration-options]: https://doc.rust-lang.org/reference/conditional-compilation.html#set-configuration-options
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/function/error-handling.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/function/error-handling.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/function/error-handling.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/function/error-handling.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,239 @@
+# Error handling
+
+This chapter contains a little background of error handling in Rust and how PyO3 integrates this with Python exceptions.
+
+This covers enough detail to create a `#[pyfunction]` which raises Python exceptions from errors originating in Rust.
+
+There is a later section of the guide on [Python exceptions](../exception.md) which covers exception types in more detail.
+
+## Representing Python exceptions
+
+Rust code uses the generic [`Result<T, E>`] enum to propagate errors. The error type `E` is chosen by the code author to describe the possible errors which can happen.
+
+PyO3 has the [`PyErr`] type which represents a Python exception. If a PyO3 API could result in a Python exception being raised, the return type of that `API` will be [`PyResult<T>`], which is an alias for the type `Result<T, PyErr>`.
+
+In summary:
+- When Python exceptions are raised and caught by PyO3, the exception will be stored in the `Err` variant of the `PyResult`.
+- Passing Python exceptions through Rust code then uses all the "normal" techniques such as the `?` operator, with `PyErr` as the error type.
+- Finally, when a `PyResult` crosses from Rust back to Python via PyO3, if the result is an `Err` variant the contained exception will be raised.
+
+(There are many great tutorials on Rust error handling and the `?` operator, so this guide will not go into detail on Rust-specific topics.)
+
+## Raising an exception from a function
+
+As indicated in the previous section, when a `PyResult` containing an `Err` crosses from Rust to Python, PyO3 will raise the exception contained within.
+
+Accordingly, to raise an exception from a `#[pyfunction]`, change the return type `T` to `PyResult<T>`. When the function returns an `Err` it will raise a Python exception. (Other `Result<T, E>` types can be used as long as the error `E` has a `From` conversion for `PyErr`, see [custom Rust error types](#custom-rust-error-types) below.)
+
+This also works for functions in `#[pymethods]`.
+
+For example, the following `check_positive` function raises a `ValueError` when the input is negative:
+
+```rust
+use pyo3::exceptions::PyValueError;
+use pyo3::prelude::*;
+
+#[pyfunction]
+fn check_positive(x: i32) -> PyResult<()> {
+    if x < 0 {
+        Err(PyValueError::new_err("x is negative"))
+    } else {
+        Ok(())
+    }
+}
+#
+# fn main(){
+# 	Python::with_gil(|py|{
+# 		let fun = pyo3::wrap_pyfunction_bound!(check_positive, py).unwrap();
+# 		fun.call1((-1,)).unwrap_err();
+# 		fun.call1((1,)).unwrap();
+# 	});
+# }
+```
+
+All built-in Python exception types are defined in the [`pyo3::exceptions`] module. They have a `new_err` constructor to directly build a `PyErr`, as seen in the example above.
+
+## Custom Rust error types
+
+PyO3 will automatically convert a `Result<T, E>` returned by a `#[pyfunction]` into a `PyResult<T>` as long as there is an implementation of `std::from::From<E> for PyErr`. Many error types in the Rust standard library have a [`From`] conversion defined in this way.
+
+If the type `E` you are handling is defined in a third-party crate, see the section on [foreign rust error types](#foreign-rust-error-types) below for ways to work with this error.
+
+The following example makes use of the implementation of `From<ParseIntError> for PyErr` to raise exceptions encountered when parsing strings as integers:
+
+```rust
+# use pyo3::prelude::*;
+use std::num::ParseIntError;
+
+#[pyfunction]
+fn parse_int(x: &str) -> Result<usize, ParseIntError> {
+    x.parse()
+}
+
+# fn main() {
+#     Python::with_gil(|py| {
+#         let fun = pyo3::wrap_pyfunction_bound!(parse_int, py).unwrap();
+#         let value: usize = fun.call1(("5",)).unwrap().extract().unwrap();
+#         assert_eq!(value, 5);
+#     });
+# }
+```
+
+When passed a string which doesn't contain a floating-point number, the exception raised will look like the below:
+
+```python
+>>> parse_int("bar")
+Traceback (most recent call last):
+  File "<stdin>", line 1, in <module>
+ValueError: invalid digit found in string
+```
+
+As a more complete example, the following snippet defines a Rust error named `CustomIOError`. It then defines a `From<CustomIOError> for PyErr`, which returns a `PyErr` representing Python's `OSError`.
+Therefore, it can use this error in the result of a `#[pyfunction]` directly, relying on the conversion if it has to be propagated into a Python exception.
+
+```rust
+use pyo3::exceptions::PyOSError;
+use pyo3::prelude::*;
+use std::fmt;
+
+#[derive(Debug)]
+struct CustomIOError;
+
+impl std::error::Error for CustomIOError {}
+
+impl fmt::Display for CustomIOError {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        write!(f, "Oh no!")
+    }
+}
+
+impl std::convert::From<CustomIOError> for PyErr {
+    fn from(err: CustomIOError) -> PyErr {
+        PyOSError::new_err(err.to_string())
+    }
+}
+
+pub struct Connection {/* ... */}
+
+fn bind(addr: String) -> Result<Connection, CustomIOError> {
+    if &addr == "0.0.0.0" {
+        Err(CustomIOError)
+    } else {
+        Ok(Connection{ /* ... */})
+    }
+}
+
+#[pyfunction]
+fn connect(s: String) -> Result<(), CustomIOError> {
+    bind(s)?;
+    // etc.
+    Ok(())
+}
+
+fn main() {
+    Python::with_gil(|py| {
+        let fun = pyo3::wrap_pyfunction_bound!(connect, py).unwrap();
+        let err = fun.call1(("0.0.0.0",)).unwrap_err();
+        assert!(err.is_instance_of::<PyOSError>(py));
+    });
+}
+```
+
+If lazy construction of the Python exception instance is desired, the
+[`PyErrArguments`]({{#PYO3_DOCS_URL}}/pyo3/trait.PyErrArguments.html)
+trait can be implemented instead of `From`. In that case, actual exception argument creation is delayed
+until the `PyErr` is needed.
+
+A final note is that any errors `E` which have a `From` conversion can be used with the `?`
+("try") operator with them. An alternative implementation of the above `parse_int` which instead returns `PyResult` is below:
+
+```rust
+use pyo3::prelude::*;
+
+fn parse_int(s: String) -> PyResult<usize> {
+    let x = s.parse()?;
+    Ok(x)
+}
+#
+# use pyo3::exceptions::PyValueError;
+#
+# fn main() {
+#     Python::with_gil(|py| {
+#         assert_eq!(parse_int(String::from("1")).unwrap(), 1);
+#         assert_eq!(parse_int(String::from("1337")).unwrap(), 1337);
+#
+#         assert!(parse_int(String::from("-1"))
+#             .unwrap_err()
+#             .is_instance_of::<PyValueError>(py));
+#         assert!(parse_int(String::from("foo"))
+#             .unwrap_err()
+#             .is_instance_of::<PyValueError>(py));
+#         assert!(parse_int(String::from("13.37"))
+#             .unwrap_err()
+#             .is_instance_of::<PyValueError>(py));
+#     })
+# }
+```
+
+## Foreign Rust error types
+
+The Rust compiler will not permit implementation of traits for types outside of the crate where the type is defined. (This is known as the "orphan rule".)
+
+Given a type `OtherError` which is defined in third-party code, there are two main strategies available to integrate it with PyO3:
+
+- Create a newtype wrapper, e.g. `MyOtherError`. Then implement `From<MyOtherError> for PyErr` (or `PyErrArguments`), as well as `From<OtherError>` for `MyOtherError`.
+- Use Rust's Result combinators such as `map_err` to write code freely to convert `OtherError` into whatever is needed. This requires boilerplate at every usage however gives unlimited flexibility.
+
+To detail the newtype strategy a little further, the key trick is to return `Result<T, MyOtherError>` from the `#[pyfunction]`. This means that PyO3 will make use of `From<MyOtherError> for PyErr` to create Python exceptions while the `#[pyfunction]` implementation can use `?` to convert `OtherError` to `MyOtherError` automatically.
+
+The following example demonstrates this for some imaginary third-party crate `some_crate` with a function `get_x` returning `Result<i32, OtherError>`:
+
+```rust
+# mod some_crate {
+#   pub struct OtherError(());
+#   impl OtherError {
+#       pub fn message(&self) -> &'static str { "some error occurred" }
+#   }
+#   pub fn get_x() -> Result<i32, OtherError> { Ok(5) }
+# }
+
+use pyo3::prelude::*;
+use pyo3::exceptions::PyValueError;
+use some_crate::{OtherError, get_x};
+
+struct MyOtherError(OtherError);
+
+impl From<MyOtherError> for PyErr {
+    fn from(error: MyOtherError) -> Self {
+        PyValueError::new_err(error.0.message())
+    }
+}
+
+impl From<OtherError> for MyOtherError {
+    fn from(other: OtherError) -> Self {
+        Self(other)
+    }
+}
+
+#[pyfunction]
+fn wrapped_get_x() -> Result<i32, MyOtherError> {
+    // get_x is a function returning Result<i32, OtherError>
+    let x: i32 = get_x()?;
+    Ok(x)
+}
+
+# fn main() {
+#     Python::with_gil(|py| {
+#         let fun = pyo3::wrap_pyfunction_bound!(wrapped_get_x, py).unwrap();
+#         let value: usize = fun.call0().unwrap().extract().unwrap();
+#         assert_eq!(value, 5);
+#     });
+# }
+```
+
+
+[`From`]: https://doc.rust-lang.org/stable/std/convert/trait.From.html
+[`Result<T, E>`]: https://doc.rust-lang.org/stable/std/result/enum.Result.html
+[`PyResult<T>`]: {{#PYO3_DOCS_URL}}/pyo3/prelude/type.PyResult.html
+[`PyErr`]: {{#PYO3_DOCS_URL}}/pyo3/struct.PyErr.html
+[`pyo3::exceptions`]: {{#PYO3_DOCS_URL}}/pyo3/exceptions/index.html
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/function/signature.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/function/signature.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/function/signature.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/function/signature.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,328 @@
+# Function signatures
+
+The `#[pyfunction]` attribute also accepts parameters to control how the generated Python function accepts arguments. Just like in Python, arguments can be positional-only, keyword-only, or accept either. `*args` lists and `**kwargs` dicts can also be accepted. These parameters also work for `#[pymethods]` which will be introduced in the [Python Classes](../class.md) section of the guide.
+
+Like Python, by default PyO3 accepts all arguments as either positional or keyword arguments. Most arguments are required by default, except for trailing `Option<_>` arguments, which are [implicitly given a default of `None`](#trailing-optional-arguments). This behaviour can be configured by the `#[pyo3(signature = (...))]` option which allows writing a signature in Python syntax.
+
+This section of the guide goes into detail about use of the `#[pyo3(signature = (...))]` option and its related option `#[pyo3(text_signature = "...")]`
+
+## Using `#[pyo3(signature = (...))]`
+
+For example, below is a function that accepts arbitrary keyword arguments (`**kwargs` in Python syntax) and returns the number that was passed:
+
+```rust
+use pyo3::prelude::*;
+use pyo3::types::PyDict;
+
+#[pyfunction]
+#[pyo3(signature = (**kwds))]
+fn num_kwds(kwds: Option<&Bound<'_, PyDict>>) -> usize {
+    kwds.map_or(0, |dict| dict.len())
+}
+
+#[pymodule]
+fn module_with_functions(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    m.add_function(wrap_pyfunction!(num_kwds, m)?)
+}
+```
+
+Just like in Python, the following constructs can be part of the signature::
+
+ * `/`: positional-only arguments separator, each parameter defined before `/` is a positional-only parameter.
+ * `*`: var arguments separator, each parameter defined after `*` is a keyword-only parameter.
+ * `*args`: "args" is var args. Type of the `args` parameter has to be `&Bound<'_, PyTuple>`.
+ * `**kwargs`: "kwargs" receives keyword arguments. The type of the `kwargs` parameter has to be `Option<&Bound<'_, PyDict>>`.
+ * `arg=Value`: arguments with default value.
+   If the `arg` argument is defined after var arguments, it is treated as a keyword-only argument.
+   Note that `Value` has to be valid rust code, PyO3 just inserts it into the generated
+   code unmodified.
+
+Example:
+```rust
+# use pyo3::prelude::*;
+use pyo3::types::{PyDict, PyTuple};
+#
+# #[pyclass]
+# struct MyClass {
+#     num: i32,
+# }
+#[pymethods]
+impl MyClass {
+    #[new]
+    #[pyo3(signature = (num=-1))]
+    fn new(num: i32) -> Self {
+        MyClass { num }
+    }
+
+    #[pyo3(signature = (num=10, *py_args, name="Hello", **py_kwargs))]
+    fn method(
+        &mut self,
+        num: i32,
+        py_args: &Bound<'_, PyTuple>,
+        name: &str,
+        py_kwargs: Option<&Bound<'_, PyDict>>,
+    ) -> String {
+        let num_before = self.num;
+        self.num = num;
+        format!(
+            "num={} (was previously={}), py_args={:?}, name={}, py_kwargs={:?} ",
+            num, num_before, py_args, name, py_kwargs,
+        )
+    }
+
+    fn make_change(&mut self, num: i32) -> PyResult<String> {
+        self.num = num;
+        Ok(format!("num={}", self.num))
+    }
+}
+```
+
+Arguments of type `Python` must not be part of the signature:
+
+```rust
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+#[pyfunction]
+#[pyo3(signature = (lambda))]
+pub fn simple_python_bound_function(py: Python<'_>, lambda: PyObject) -> PyResult<()> {
+    Ok(())
+}
+```
+
+N.B. the position of the `/` and `*` arguments (if included) control the system of handling positional and keyword arguments. In Python:
+```python
+import mymodule
+
+mc = mymodule.MyClass()
+print(mc.method(44, False, "World", 666, x=44, y=55))
+print(mc.method(num=-1, name="World"))
+print(mc.make_change(44, False))
+```
+Produces output:
+```text
+py_args=('World', 666), py_kwargs=Some({'x': 44, 'y': 55}), name=Hello, num=44
+py_args=(), py_kwargs=None, name=World, num=-1
+num=44
+num=-1
+```
+
+> Note: to use keywords like `struct` as a function argument, use "raw identifier" syntax `r#struct` in both the signature and the function definition:
+>
+> ```rust
+> # #![allow(dead_code)]
+> # use pyo3::prelude::*;
+> #[pyfunction(signature = (r#struct = "foo"))]
+> fn function_with_keyword(r#struct: &str) {
+> #     let _ = r#struct;
+>     /* ... */
+> }
+> ```
+
+## Trailing optional arguments
+
+<div class="warning">
+
+⚠️ Warning: This behaviour is being phased out 🛠️
+
+The special casing of trailing optional arguments is deprecated. In a future `pyo3` version, arguments of type `Option<..>` will share the same behaviour as other arguments, they are required unless a default is set using `#[pyo3(signature = (...))]`.
+
+This is done to better align the Python and Rust definition of such functions and make it more intuitive to rewrite them from Python in Rust. Specifically `def some_fn(a: int, b: Optional[int]): ...` will not automatically default `b` to `none`, but requires an explicit default if desired, where as in current `pyo3` it is handled the other way around.
+
+During the migration window a `#[pyo3(signature = (...))]` will be required to silence the deprecation warning. After support for trailing optional arguments is fully removed, the signature attribute can be removed if all arguments should be required.
+</div>
+
+
+As a convenience, functions without a `#[pyo3(signature = (...))]` option will treat trailing `Option<T>` arguments as having a default of `None`. In the example below, PyO3 will create `increment` with a signature of `increment(x, amount=None)`.
+
+```rust
+#![allow(deprecated)]
+use pyo3::prelude::*;
+
+/// Returns a copy of `x` increased by `amount`.
+///
+/// If `amount` is unspecified or `None`, equivalent to `x + 1`.
+#[pyfunction]
+fn increment(x: u64, amount: Option<u64>) -> u64 {
+    x + amount.unwrap_or(1)
+}
+#
+# fn main() -> PyResult<()> {
+#     Python::with_gil(|py| {
+#         let fun = pyo3::wrap_pyfunction_bound!(increment, py)?;
+#
+#         let inspect = PyModule::import_bound(py, "inspect")?.getattr("signature")?;
+#         let sig: String = inspect
+#             .call1((fun,))?
+#             .call_method0("__str__")?
+#             .extract()?;
+#
+#         #[cfg(Py_3_8)]  // on 3.7 the signature doesn't render b, upstream bug?
+#         assert_eq!(sig, "(x, amount=None)");
+#
+#         Ok(())
+#     })
+# }
+```
+
+To make trailing `Option<T>` arguments required, but still accept `None`, add a `#[pyo3(signature = (...))]` annotation. For the example above, this would be `#[pyo3(signature = (x, amount))]`:
+
+```rust
+# use pyo3::prelude::*;
+#[pyfunction]
+#[pyo3(signature = (x, amount))]
+fn increment(x: u64, amount: Option<u64>) -> u64 {
+    x + amount.unwrap_or(1)
+}
+#
+# fn main() -> PyResult<()> {
+#     Python::with_gil(|py| {
+#         let fun = pyo3::wrap_pyfunction_bound!(increment, py)?;
+#
+#         let inspect = PyModule::import_bound(py, "inspect")?.getattr("signature")?;
+#         let sig: String = inspect
+#             .call1((fun,))?
+#             .call_method0("__str__")?
+#             .extract()?;
+#
+#         #[cfg(Py_3_8)]  // on 3.7 the signature doesn't render b, upstream bug?
+#         assert_eq!(sig, "(x, amount)");
+#
+#         Ok(())
+#     })
+# }
+```
+
+To help avoid confusion, PyO3 requires `#[pyo3(signature = (...))]` when an `Option<T>` argument is surrounded by arguments which aren't `Option<T>`.
+
+## Making the function signature available to Python
+
+The function signature is exposed to Python via the `__text_signature__` attribute. PyO3 automatically generates this for every `#[pyfunction]` and all `#[pymethods]` directly from the Rust function, taking into account any override done with the `#[pyo3(signature = (...))]` option.
+
+This automatic generation can only display the value of default arguments for strings, integers, boolean types, and `None`. Any other default arguments will be displayed as `...`. (`.pyi` type stub files commonly also use `...` for default arguments in the same way.)
+
+In cases where the automatically-generated signature needs adjusting, it can [be overridden](#overriding-the-generated-signature) using the `#[pyo3(text_signature)]` option.)
+
+The example below creates a function `add` which accepts two positional-only arguments `a` and `b`, where `b` has a default value of zero.
+
+```rust
+use pyo3::prelude::*;
+
+/// This function adds two unsigned 64-bit integers.
+#[pyfunction]
+#[pyo3(signature = (a, b=0, /))]
+fn add(a: u64, b: u64) -> u64 {
+    a + b
+}
+#
+# fn main() -> PyResult<()> {
+#     Python::with_gil(|py| {
+#         let fun = pyo3::wrap_pyfunction_bound!(add, py)?;
+#
+#         let doc: String = fun.getattr("__doc__")?.extract()?;
+#         assert_eq!(doc, "This function adds two unsigned 64-bit integers.");
+#
+#         let inspect = PyModule::import_bound(py, "inspect")?.getattr("signature")?;
+#         let sig: String = inspect
+#             .call1((fun,))?
+#             .call_method0("__str__")?
+#             .extract()?;
+#
+#         #[cfg(Py_3_8)]  // on 3.7 the signature doesn't render b, upstream bug?
+#         assert_eq!(sig, "(a, b=0, /)");
+#
+#         Ok(())
+#     })
+# }
+```
+
+The following IPython output demonstrates how this generated signature will be seen from Python tooling:
+
+```text
+>>> pyo3_test.add.__text_signature__
+'(a, b=..., /)'
+>>> pyo3_test.add?
+Signature: pyo3_test.add(a, b=0, /)
+Docstring: This function adds two unsigned 64-bit integers.
+Type:      builtin_function_or_method
+```
+
+### Overriding the generated signature
+
+The `#[pyo3(text_signature = "(<some signature>)")]` attribute can be used to override the default generated signature.
+
+In the snippet below, the text signature attribute is used to include the default value of `0` for the argument `b`, instead of the automatically-generated default value of `...`:
+
+```rust
+use pyo3::prelude::*;
+
+/// This function adds two unsigned 64-bit integers.
+#[pyfunction]
+#[pyo3(signature = (a, b=0, /), text_signature = "(a, b=0, /)")]
+fn add(a: u64, b: u64) -> u64 {
+    a + b
+}
+#
+# fn main() -> PyResult<()> {
+#     Python::with_gil(|py| {
+#         let fun = pyo3::wrap_pyfunction_bound!(add, py)?;
+#
+#         let doc: String = fun.getattr("__doc__")?.extract()?;
+#         assert_eq!(doc, "This function adds two unsigned 64-bit integers.");
+#
+#         let inspect = PyModule::import_bound(py, "inspect")?.getattr("signature")?;
+#         let sig: String = inspect
+#             .call1((fun,))?
+#             .call_method0("__str__")?
+#             .extract()?;
+#         assert_eq!(sig, "(a, b=0, /)");
+#
+#         Ok(())
+#     })
+# }
+```
+
+PyO3 will include the contents of the annotation unmodified as the `__text_signature__`. Below shows how IPython will now present this (see the default value of 0 for b):
+
+```text
+>>> pyo3_test.add.__text_signature__
+'(a, b=0, /)'
+>>> pyo3_test.add?
+Signature: pyo3_test.add(a, b=0, /)
+Docstring: This function adds two unsigned 64-bit integers.
+Type:      builtin_function_or_method
+```
+
+If no signature is wanted at all, `#[pyo3(text_signature = None)]` will disable the built-in signature. The snippet below demonstrates use of this:
+
+```rust
+use pyo3::prelude::*;
+
+/// This function adds two unsigned 64-bit integers.
+#[pyfunction]
+#[pyo3(signature = (a, b=0, /), text_signature = None)]
+fn add(a: u64, b: u64) -> u64 {
+    a + b
+}
+#
+# fn main() -> PyResult<()> {
+#     Python::with_gil(|py| {
+#         let fun = pyo3::wrap_pyfunction_bound!(add, py)?;
+#
+#         let doc: String = fun.getattr("__doc__")?.extract()?;
+#         assert_eq!(doc, "This function adds two unsigned 64-bit integers.");
+#         assert!(fun.getattr("__text_signature__")?.is_none());
+#
+#         Ok(())
+#     })
+# }
+```
+
+Now the function's `__text_signature__` will be set to `None`, and IPython will not display any signature in the help:
+
+```text
+>>> pyo3_test.add.__text_signature__ == None
+True
+>>> pyo3_test.add?
+Docstring: This function adds two unsigned 64-bit integers.
+Type:      builtin_function_or_method
+```
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/function-calls.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/function-calls.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/function-calls.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/function-calls.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+# Calling Python functions
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/function.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/function.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/function.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/function.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,208 @@
+# Python functions
+
+The `#[pyfunction]` attribute is used to define a Python function from a Rust function. Once defined, the function needs to be added to a [module](./module.md) using the `wrap_pyfunction!` macro.
+
+The following example defines a function called `double` in a Python module called `my_extension`:
+
+```rust
+use pyo3::prelude::*;
+
+#[pyfunction]
+fn double(x: usize) -> usize {
+    x * 2
+}
+
+#[pymodule]
+fn my_extension(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    m.add_function(wrap_pyfunction!(double, m)?)
+}
+```
+
+This chapter of the guide explains full usage of the `#[pyfunction]` attribute. In this first section, the following topics are covered:
+
+- [Function options](#function-options)
+  - [`#[pyo3(name = "...")]`](#name)
+  - [`#[pyo3(signature = (...))]`](#signature)
+  - [`#[pyo3(text_signature = "...")]`](#text_signature)
+  - [`#[pyo3(pass_module)]`](#pass_module)
+- [Per-argument options](#per-argument-options)
+- [Advanced function patterns](#advanced-function-patterns)
+- [`#[pyfn]` shorthand](#pyfn-shorthand)
+
+There are also additional sections on the following topics:
+
+- [Function Signatures](./function/signature.md)
+
+## Function options
+
+The `#[pyo3]` attribute can be used to modify properties of the generated Python function. It can take any combination of the following options:
+
+  - <a id="name"></a> `#[pyo3(name = "...")]`
+
+    Overrides the name exposed to Python.
+
+    In the following example, the Rust function `no_args_py` will be added to the Python module
+    `module_with_functions` as the Python function `no_args`:
+
+    ```rust
+    use pyo3::prelude::*;
+
+    #[pyfunction]
+    #[pyo3(name = "no_args")]
+    fn no_args_py() -> usize {
+        42
+    }
+
+    #[pymodule]
+    fn module_with_functions(m: &Bound<'_, PyModule>) -> PyResult<()> {
+        m.add_function(wrap_pyfunction!(no_args_py, m)?)
+    }
+
+    # Python::with_gil(|py| {
+    #     let m = pyo3::wrap_pymodule!(module_with_functions)(py);
+    #     assert!(m.getattr(py, "no_args").is_ok());
+    #     assert!(m.getattr(py, "no_args_py").is_err());
+    # });
+    ```
+
+  - <a id="signature"></a> `#[pyo3(signature = (...))]`
+
+    Defines the function signature in Python. See [Function Signatures](./function/signature.md).
+
+  - <a id="text_signature"></a> `#[pyo3(text_signature = "...")]`
+
+    Overrides the PyO3-generated function signature visible in Python tooling (such as via [`inspect.signature`]). See the [corresponding topic in the Function Signatures subchapter](./function/signature.md#making-the-function-signature-available-to-python).
+
+  - <a id="pass_module" ></a> `#[pyo3(pass_module)]`
+
+    Set this option to make PyO3 pass the containing module as the first argument to the function. It is then possible to use the module in the function body. The first argument **must** be of type `&Bound<'_, PyModule>`, `Bound<'_, PyModule>`, or `Py<PyModule>`.
+
+    The following example creates a function `pyfunction_with_module` which returns the containing module's name (i.e. `module_with_fn`):
+
+    ```rust
+    use pyo3::prelude::*;
+    use pyo3::types::PyString;
+
+    #[pyfunction]
+    #[pyo3(pass_module)]
+    fn pyfunction_with_module<'py>(
+        module: &Bound<'py, PyModule>,
+    ) -> PyResult<Bound<'py, PyString>> {
+        module.name()
+    }
+
+    #[pymodule]
+    fn module_with_fn(m: &Bound<'_, PyModule>) -> PyResult<()> {
+        m.add_function(wrap_pyfunction!(pyfunction_with_module, m)?)
+    }
+    ```
+
+## Per-argument options
+
+The `#[pyo3]` attribute can be used on individual arguments to modify properties of them in the generated function. It can take any combination of the following options:
+
+  - <a id="from_py_with"></a> `#[pyo3(from_py_with = "...")]`
+
+    Set this on an option to specify a custom function to convert the function argument from Python to the desired Rust type, instead of using the default `FromPyObject` extraction. The function signature must be `fn(&Bound<'_, PyAny>) -> PyResult<T>` where `T` is the Rust type of the argument.
+
+    The following example uses `from_py_with` to convert the input Python object to its length:
+
+    ```rust
+    use pyo3::prelude::*;
+
+    fn get_length(obj: &Bound<'_, PyAny>) -> PyResult<usize> {
+        obj.len()
+    }
+
+    #[pyfunction]
+    fn object_length(#[pyo3(from_py_with = "get_length")] argument: usize) -> usize {
+        argument
+    }
+
+    # Python::with_gil(|py| {
+    #     let f = pyo3::wrap_pyfunction_bound!(object_length)(py).unwrap();
+    #     assert_eq!(f.call1((vec![1, 2, 3],)).unwrap().extract::<usize>().unwrap(), 3);
+    # });
+    ```
+
+## Advanced function patterns
+
+### Calling Python functions in Rust
+
+You can pass Python `def`'d functions and built-in functions to Rust functions [`PyFunction`]
+corresponds to regular Python functions while [`PyCFunction`] describes built-ins such as
+`repr()`.
+
+You can also use [`Bound<'_, PyAny>::is_callable`] to check if you have a callable object. `is_callable`
+will return `true` for functions (including lambdas), methods and objects with a `__call__` method.
+You can call the object with [`Bound<'_, PyAny>::call`] with the args as first parameter and the kwargs
+(or `None`) as second parameter. There are also [`Bound<'_, PyAny>::call0`] with no args and
+[`Bound<'_, PyAny>::call1`] with only positional args.
+
+### Calling Rust functions in Python
+
+The ways to convert a Rust function into a Python object vary depending on the function:
+
+- Named functions, e.g. `fn foo()`: add `#[pyfunction]` and then use [`wrap_pyfunction!`] to get the corresponding [`PyCFunction`].
+- Anonymous functions (or closures), e.g. `foo: fn()` either:
+  - use a `#[pyclass]` struct which stores the function as a field and implement `__call__` to call the stored function.
+  - use `PyCFunction::new_closure` to create an object directly from the function.
+
+[`Bound<'_, PyAny>::is_callable`]: {{#PYO3_DOCS_URL}}/pyo3/prelude/trait.PyAnyMethods.html#tymethod.is_callable
+[`Bound<'_, PyAny>::call`]: {{#PYO3_DOCS_URL}}/pyo3/prelude/trait.PyAnyMethods.html#tymethod.call
+[`Bound<'_, PyAny>::call0`]: {{#PYO3_DOCS_URL}}/pyo3/prelude/trait.PyAnyMethods.html#tymethod.call0
+[`Bound<'_, PyAny>::call1`]: {{#PYO3_DOCS_URL}}/pyo3/prelude/trait.PyAnyMethods.html#tymethod.call1
+[`wrap_pyfunction!`]: {{#PYO3_DOCS_URL}}/pyo3/macro.wrap_pyfunction.html
+[`PyFunction`]: {{#PYO3_DOCS_URL}}/pyo3/types/struct.PyFunction.html
+[`PyCFunction`]: {{#PYO3_DOCS_URL}}/pyo3/types/struct.PyCFunction.html
+
+### Accessing the FFI functions
+
+In order to make Rust functions callable from Python, PyO3 generates an `extern "C"`
+function whose exact signature depends on the Rust signature.  (PyO3 chooses the optimal
+Python argument passing convention.) It then embeds the call to the Rust function inside this
+FFI-wrapper function. This wrapper handles extraction of the regular arguments and the keyword
+arguments from the input `PyObject`s.
+
+The `wrap_pyfunction` macro can be used to directly get a `Bound<PyCFunction>` given a
+`#[pyfunction]` and a `Bound<PyModule>`: `wrap_pyfunction!(rust_fun, module)`.
+
+## `#[pyfn]` shorthand
+
+There is a shorthand to `#[pyfunction]` and `wrap_pymodule!`: the function can be placed inside the module definition and
+annotated with `#[pyfn]`. To simplify PyO3, it is expected that `#[pyfn]` may be removed in a future release (See [#694](https://github.com/PyO3/pyo3/issues/694)).
+
+An example of `#[pyfn]` is below:
+
+```rust
+use pyo3::prelude::*;
+
+#[pymodule]
+fn my_extension(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    #[pyfn(m)]
+    fn double(x: usize) -> usize {
+        x * 2
+    }
+
+    Ok(())
+}
+```
+
+`#[pyfn(m)]` is just syntactic sugar for `#[pyfunction]`, and takes all the same options
+documented in the rest of this chapter. The code above is expanded to the following:
+
+```rust
+use pyo3::prelude::*;
+
+#[pymodule]
+fn my_extension(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    #[pyfunction]
+    fn double(x: usize) -> usize {
+        x * 2
+    }
+
+    m.add_function(wrap_pyfunction!(double, m)?)
+}
+```
+
+[`inspect.signature`]: https://docs.python.org/3/library/inspect.html#inspect.signature
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/getting-started.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/getting-started.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/getting-started.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/getting-started.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,181 @@
+# Installation
+
+To get started using PyO3 you will need three things: a Rust toolchain, a Python environment, and a way to build. We'll cover each of these below.
+
+> If you'd like to chat to the PyO3 maintainers and other PyO3 users, consider joining the [PyO3 Discord server](https://discord.gg/33kcChzH7f). We're keen to hear about your experience getting started, so we can make PyO3 as accessible as possible for everyone!
+
+## Rust
+
+First, make sure you have Rust installed on your system. If you haven't already done so, try following the instructions [here](https://www.rust-lang.org/tools/install). PyO3 runs on both the `stable` and `nightly` versions so you can choose whichever one fits you best. The minimum required Rust version is 1.63.
+
+If you can run `rustc --version` and the version is new enough you're good to go!
+
+## Python
+
+To use PyO3, you need at least Python 3.7. While you can simply use the default Python interpreter on your system, it is recommended to use a virtual environment.
+
+## Virtualenvs
+
+While you can use any virtualenv manager you like, we recommend the use of `pyenv` in particular if you want to develop or test for multiple different Python versions, so that is what the examples in this book will use. The installation instructions for `pyenv` can be found [here](https://github.com/pyenv/pyenv#getting-pyenv). (Note: To get the `pyenv activate` and `pyenv virtualenv` commands, you will also need to install the [`pyenv-virtualenv`](https://github.com/pyenv/pyenv-virtualenv) plugin. The [pyenv installer](https://github.com/pyenv/pyenv-installer#installation--update--uninstallation) will install both together.)
+
+It can be useful to keep the sources used when installing using `pyenv` so that future debugging can see the original source files. This can be done by passing the `--keep` flag as part of the `pyenv install` command.
+
+For example:
+
+```bash
+pyenv install 3.12 --keep
+```
+
+### Building
+
+There are a number of build and Python package management systems such as [`setuptools-rust`](https://github.com/PyO3/setuptools-rust) or [manually](./building-and-distribution.md#manual-builds). We recommend the use of `maturin`, which you can install [here](https://maturin.rs/installation.html). It is developed to work with PyO3 and provides the most "batteries included" experience, especially if you are aiming to publish to PyPI. `maturin` is just a Python package, so you can add it in the same way you already install Python packages.
+
+System Python:
+```bash
+pip install maturin --user
+```
+
+pipx:
+```bash
+pipx install maturin
+```
+
+pyenv:
+```bash
+pyenv activate pyo3
+pip install maturin
+```
+
+poetry:
+```bash
+poetry add -G dev maturin
+```
+
+After installation, you can run `maturin --version` to check that you have correctly installed it.
+
+# Starting a new project
+
+First you should create the folder and virtual environment that are going to contain your new project. Here we will use the recommended `pyenv`:
+
+```bash
+mkdir pyo3-example
+cd pyo3-example
+pyenv virtualenv pyo3
+pyenv local pyo3
+```
+
+After this, you should install your build manager. In this example, we will use `maturin`. After you've activated your virtualenv, add `maturin` to it:
+
+```bash
+pip install maturin
+```
+
+Now you can initialize the new project:
+
+```bash
+maturin init
+```
+
+If `maturin` is already installed, you can create a new project using that directly as well:
+
+```bash
+maturin new -b pyo3 pyo3-example
+cd pyo3-example
+pyenv virtualenv pyo3
+pyenv local pyo3
+```
+
+# Adding to an existing project
+
+Sadly, `maturin` cannot currently be run in existing projects, so if you want to use Python in an existing project you basically have two options:
+
+1. Create a new project as above and move your existing code into that project
+2. Manually edit your project configuration as necessary
+
+If you opt for the second option, here are the things you need to pay attention to:
+
+## Cargo.toml
+
+Make sure that the Rust crate you want to be able to access from Python is compiled into a library. You can have a binary output as well, but the code you want to access from Python has to be in the library part. Also, make sure that the crate type is `cdylib` and add PyO3 as a dependency as so:
+
+
+```toml
+# If you already have [package] information in `Cargo.toml`, you can ignore
+# this section!
+[package]
+# `name` here is name of the package.
+name = "pyo3_start"
+# these are good defaults:
+version = "0.1.0"
+edition = "2021"
+
+[lib]
+# The name of the native library. This is the name which will be used in Python to import the
+# library (i.e. `import string_sum`). If you change this, you must also change the name of the
+# `#[pymodule]` in `src/lib.rs`.
+name = "pyo3_example"
+
+# "cdylib" is necessary to produce a shared library for Python to import from.
+crate-type = ["cdylib"]
+
+[dependencies]
+pyo3 = { {{#PYO3_CRATE_VERSION}}, features = ["extension-module"] }
+```
+
+## pyproject.toml
+
+You should also create a `pyproject.toml` with the following contents:
+
+```toml
+[build-system]
+requires = ["maturin>=1,<2"]
+build-backend = "maturin"
+
+[project]
+name = "pyo3_example"
+requires-python = ">=3.7"
+classifiers = [
+    "Programming Language :: Rust",
+    "Programming Language :: Python :: Implementation :: CPython",
+    "Programming Language :: Python :: Implementation :: PyPy",
+]
+```
+
+## Running code
+
+After this you can setup Rust code to be available in Python as below; for example, you can place this code in `src/lib.rs`:
+
+```rust
+use pyo3::prelude::*;
+
+/// Formats the sum of two numbers as string.
+#[pyfunction]
+fn sum_as_string(a: usize, b: usize) -> PyResult<String> {
+    Ok((a + b).to_string())
+}
+
+/// A Python module implemented in Rust. The name of this function must match
+/// the `lib.name` setting in the `Cargo.toml`, else Python will not be able to
+/// import the module.
+#[pymodule]
+fn pyo3_example(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    m.add_function(wrap_pyfunction!(sum_as_string, m)?)
+}
+```
+
+Now you can run `maturin develop` to prepare the Python package, after which you can use it like so:
+
+```bash
+$ maturin develop
+# lots of progress output as maturin runs the compilation...
+$ python
+>>> import pyo3_example
+>>> pyo3_example.sum_as_string(5, 20)
+'25'
+```
+
+For more instructions on how to use Python code from Rust, see the [Python from Rust](python-from-rust.md) page.
+
+## Maturin Import Hook
+
+In development, any changes in the code would require running `maturin develop` before testing. To streamline the development process, you may want to install [Maturin Import Hook](https://github.com/PyO3/maturin-import-hook) which will run `maturin develop` automatically when the library with code changes is being imported.
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/index.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/index.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/index.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/index.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,24 @@
+# The PyO3 user guide
+
+Welcome to the PyO3 user guide! This book is a companion to [PyO3's API docs](https://docs.rs/pyo3). It contains examples and documentation to explain all of PyO3's use cases in detail.
+
+The rough order of material in this user guide is as follows:
+  1. Getting started
+  2. Wrapping Rust code for use from Python
+  3. How to use Python code from Rust
+  4. Remaining topics which go into advanced concepts in detail
+
+Please choose from the chapters on the left to jump to individual topics, or continue below to start with PyO3's README.
+
+<div class="warning">
+
+⚠️ Warning: API update in progress 🛠️
+
+PyO3 0.21 has introduced a significant new API, termed the "Bound" API after the new smart pointer `Bound<T>`.
+
+While most of this guide has been updated to the new API, it is possible some stray references to the older "GIL Refs" API such as `&PyAny` remain.
+</div>
+
+<hr style="opacity:0.2">
+
+{{#include ../../README.md}}
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/memory.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/memory.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/memory.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/memory.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,309 @@
+# Memory management
+
+<div class="warning">
+
+⚠️ Warning: API update in progress 🛠️
+
+PyO3 0.21 has introduced a significant new API, termed the "Bound" API after the new smart pointer `Bound<T>`.
+
+This section on memory management is heavily weighted towards the now-deprecated "GIL Refs" API, which suffered from the drawbacks detailed here as well as CPU overheads.
+
+See [the smart pointer types](./types.md#pyo3s-smart-pointers) for description on the new, simplified, memory model of the Bound API, which is built as a thin wrapper on Python reference counting.
+</div>
+
+Rust and Python have very different notions of memory management.  Rust has
+a strict memory model with concepts of ownership, borrowing, and lifetimes,
+where memory is freed at predictable points in program execution.  Python has
+a looser memory model in which variables are reference-counted with shared,
+mutable state by default. A global interpreter lock (GIL) is needed to prevent
+race conditions, and a garbage collector is needed to break reference cycles.
+Memory in Python is freed eventually by the garbage collector, but not usually
+in a predictable way.
+
+PyO3 bridges the Rust and Python memory models with two different strategies for
+accessing memory allocated on Python's heap from inside Rust. These are
+GIL Refs such as `&'py PyAny`, and GIL-independent `Py<Any>` smart pointers.
+
+## GIL-bound memory
+
+PyO3's GIL Refs such as `&'py PyAny` make PyO3 more ergonomic to
+use by ensuring that their lifetime can never be longer than the duration the
+Python GIL is held.  This means that most of PyO3's API can assume the GIL is
+held. (If PyO3 could not assume this, every PyO3 API would need to take a
+`Python` GIL token to prove that the GIL is held.)  This allows us to write
+very simple and easy-to-understand programs like this:
+
+```rust
+# #![allow(unused_imports)]
+# use pyo3::prelude::*;
+# use pyo3::types::PyString;
+# fn main() -> PyResult<()> {
+# #[cfg(feature = "gil-refs")]
+Python::with_gil(|py| -> PyResult<()> {
+    #[allow(deprecated)] // py.eval() is part of the GIL Refs API
+    let hello = py
+        .eval("\"Hello World!\"", None, None)?
+        .downcast::<PyString>()?;
+    println!("Python says: {}", hello);
+    Ok(())
+})?;
+# Ok(())
+# }
+```
+
+Internally, calling `Python::with_gil()` creates a `GILPool` which owns the
+memory pointed to by the reference.  In the example above, the lifetime of the
+reference `hello` is bound to the `GILPool`.  When the `with_gil()` closure ends
+the `GILPool` is also dropped and the Python reference counts of the variables
+it owns are decreased, releasing them to the Python garbage collector.  Most
+of the time we don't have to think about this, but consider the following:
+
+```rust
+# #![allow(unused_imports)]
+# use pyo3::prelude::*;
+# use pyo3::types::PyString;
+# fn main() -> PyResult<()> {
+# #[cfg(feature = "gil-refs")]
+Python::with_gil(|py| -> PyResult<()> {
+    for _ in 0..10 {
+        #[allow(deprecated)] // py.eval() is part of the GIL Refs API
+        let hello = py
+            .eval("\"Hello World!\"", None, None)?
+            .downcast::<PyString>()?;
+        println!("Python says: {}", hello);
+    }
+    // There are 10 copies of `hello` on Python's heap here.
+    Ok(())
+})?;
+# Ok(())
+# }
+```
+
+We might assume that the `hello` variable's memory is freed at the end of each
+loop iteration, but in fact we create 10 copies of `hello` on Python's heap.
+This may seem surprising at first, but it is completely consistent with Rust's
+memory model.  The `hello` variable is dropped at the end of each loop, but it
+is only a reference to the memory owned by the `GILPool`, and its lifetime is
+bound to the `GILPool`, not the for loop.  The `GILPool` isn't dropped until
+the end of the `with_gil()` closure, at which point the 10 copies of `hello`
+are finally released to the Python garbage collector.
+
+<div class="warning">
+
+⚠️ Warning: `GILPool` is no longer the preferred way to manage memory with PyO3 🛠️
+
+PyO3 0.21 has introduced a new API known as the Bound API, which doesn't have the same surprising results. Instead, each `Bound<T>` smart pointer releases the Python reference immediately on drop. See [the smart pointer types](./types.md#pyo3s-smart-pointers) for more details.
+</div>
+
+
+In general we don't want unbounded memory growth during loops!  One workaround
+is to acquire and release the GIL with each iteration of the loop.
+
+```rust
+# #![allow(unused_imports)]
+# use pyo3::prelude::*;
+# use pyo3::types::PyString;
+# fn main() -> PyResult<()> {
+# #[cfg(feature = "gil-refs")]
+for _ in 0..10 {
+    Python::with_gil(|py| -> PyResult<()> {
+        #[allow(deprecated)] // py.eval() is part of the GIL Refs API
+        let hello = py
+            .eval("\"Hello World!\"", None, None)?
+            .downcast::<PyString>()?;
+        println!("Python says: {}", hello);
+        Ok(())
+    })?; // only one copy of `hello` at a time
+}
+# Ok(())
+# }
+```
+
+It might not be practical or performant to acquire and release the GIL so many
+times.  Another workaround is to work with the `GILPool` object directly, but
+this is unsafe.
+
+```rust
+# #![allow(unused_imports)]
+# use pyo3::prelude::*;
+# use pyo3::types::PyString;
+# fn main() -> PyResult<()> {
+# #[cfg(feature = "gil-refs")]
+Python::with_gil(|py| -> PyResult<()> {
+    for _ in 0..10 {
+        #[allow(deprecated)] // `new_pool` is not needed in code not using the GIL Refs API
+        let pool = unsafe { py.new_pool() };
+        let py = pool.python();
+        #[allow(deprecated)] // py.eval() is part of the GIL Refs API
+        let hello = py
+            .eval("\"Hello World!\"", None, None)?
+            .downcast::<PyString>()?;
+        println!("Python says: {}", hello);
+    }
+    Ok(())
+})?;
+# Ok(())
+# }
+```
+
+The unsafe method `Python::new_pool` allows you to create a nested `GILPool`
+from which you can retrieve a new `py: Python` GIL token.  Variables created
+with this new GIL token are bound to the nested `GILPool` and will be released
+when the nested `GILPool` is dropped.  Here, the nested `GILPool` is dropped
+at the end of each loop iteration, before the `with_gil()` closure ends.
+
+When doing this, you must be very careful to ensure that once the `GILPool` is
+dropped you do not retain access to any owned references created after the
+`GILPool` was created.  Read the documentation for `Python::new_pool()`
+for more information on safety.
+
+This memory management can also be applicable when writing extension modules.
+`#[pyfunction]` and `#[pymethods]` will create a `GILPool` which lasts the entire
+function call, releasing objects when the function returns. Most functions only create
+a few objects, meaning this doesn't have a significant impact. Occasionally functions
+with long complex loops may need to use `Python::new_pool` as shown above.
+
+<div class="warning">
+
+⚠️ Warning: `GILPool` is no longer the preferred way to manage memory with PyO3 🛠️
+
+PyO3 0.21 has introduced a new API known as the Bound API, which doesn't have the same surprising results. Instead, each `Bound<T>` smart pointer releases the Python reference immediately on drop. See [the smart pointer types](./types.md#pyo3s-smart-pointers) for more details.
+</div>
+
+## GIL-independent memory
+
+Sometimes we need a reference to memory on Python's heap that can outlive the
+GIL.  Python's `Py<PyAny>` is analogous to `Arc<T>`, but for variables whose
+memory is allocated on Python's heap.  Cloning a `Py<PyAny>` increases its
+internal reference count just like cloning `Arc<T>`.  The smart pointer can
+outlive the "GIL is held" period in which it was created.  It isn't magic,
+though.  We need to reacquire the GIL to access the memory pointed to by the
+`Py<PyAny>`.
+
+What happens to the memory when the last `Py<PyAny>` is dropped and its
+reference count reaches zero?  It depends whether or not we are holding the GIL.
+
+```rust
+# #![allow(unused_imports)]
+# use pyo3::prelude::*;
+# use pyo3::types::PyString;
+# fn main() -> PyResult<()> {
+# #[cfg(feature = "gil-refs")]
+Python::with_gil(|py| -> PyResult<()> {
+    #[allow(deprecated)] // py.eval() is part of the GIL Refs API
+    let hello: Py<PyString> = py.eval("\"Hello World!\"", None, None)?.extract()?;
+    #[allow(deprecated)] // as_ref is part of the GIL Refs API
+    {
+        println!("Python says: {}", hello.as_ref(py));
+    }
+    Ok(())
+})?;
+# Ok(())
+# }
+```
+
+At the end of the `Python::with_gil()` closure `hello` is dropped, and then the
+GIL is dropped.  Since `hello` is dropped while the GIL is still held by the
+current thread, its memory is released to the Python garbage collector
+immediately.
+
+This example wasn't very interesting.  We could have just used a GIL-bound
+`&PyString` reference.  What happens when the last `Py<Any>` is dropped while
+we are *not* holding the GIL?
+
+```rust
+# #![allow(unused_imports, dead_code)]
+# #[cfg(not(pyo3_disable_reference_pool))] {
+# use pyo3::prelude::*;
+# use pyo3::types::PyString;
+# fn main() -> PyResult<()> {
+# #[cfg(feature = "gil-refs")]
+# {
+let hello: Py<PyString> = Python::with_gil(|py| {
+    #[allow(deprecated)] // py.eval() is part of the GIL Refs API
+    py.eval("\"Hello World!\"", None, None)?.extract()
+})?;
+// Do some stuff...
+// Now sometime later in the program we want to access `hello`.
+Python::with_gil(|py| {
+    #[allow(deprecated)]  // as_ref is part of the deprecated "GIL Refs" API.
+    let hello = hello.as_ref(py);
+    println!("Python says: {}", hello);
+});
+// Now we're done with `hello`.
+drop(hello); // Memory *not* released here.
+// Sometime later we need the GIL again for something...
+Python::with_gil(|py|
+    // Memory for `hello` is released here.
+# ()
+);
+# }
+# Ok(())
+# }
+# }
+```
+
+When `hello` is dropped *nothing* happens to the pointed-to memory on Python's
+heap because nothing _can_ happen if we're not holding the GIL.  Fortunately,
+the memory isn't leaked. If the `pyo3_disable_reference_pool` conditional compilation flag
+is not enabled, PyO3 keeps track of the memory internally and will release it
+the next time we acquire the GIL.
+
+We can avoid the delay in releasing memory if we are careful to drop the
+`Py<Any>` while the GIL is held.
+
+```rust
+# #![allow(unused_imports)]
+# use pyo3::prelude::*;
+# use pyo3::types::PyString;
+# fn main() -> PyResult<()> {
+# #[cfg(feature = "gil-refs")]
+# {
+#[allow(deprecated)] // py.eval() is part of the GIL Refs API
+let hello: Py<PyString> =
+    Python::with_gil(|py| py.eval("\"Hello World!\"", None, None)?.extract())?;
+// Do some stuff...
+// Now sometime later in the program:
+Python::with_gil(|py| {
+    #[allow(deprecated)] // as_ref is part of the GIL Refs API
+    {
+        println!("Python says: {}", hello.as_ref(py));
+    }
+    drop(hello); // Memory released here.
+});
+# }
+# Ok(())
+# }
+```
+
+We could also have used `Py::into_ref()`, which consumes `self`, instead of
+`Py::as_ref()`.  But note that in addition to being slower than `as_ref()`,
+`into_ref()` binds the memory to the lifetime of the `GILPool`, which means
+that rather than being released immediately, the memory will not be released
+until the GIL is dropped.
+
+```rust
+# #![allow(unused_imports)]
+# use pyo3::prelude::*;
+# use pyo3::types::PyString;
+# fn main() -> PyResult<()> {
+# #[cfg(feature = "gil-refs")]
+# {
+#[allow(deprecated)] // py.eval() is part of the GIL Refs API
+let hello: Py<PyString> =
+    Python::with_gil(|py| py.eval("\"Hello World!\"", None, None)?.extract())?;
+// Do some stuff...
+// Now sometime later in the program:
+Python::with_gil(|py| {
+    #[allow(deprecated)] // into_ref is part of the GIL Refs API
+    {
+        println!("Python says: {}", hello.into_ref(py));
+    }
+    // Memory not released yet.
+    // Do more stuff...
+    // Memory released here at end of `with_gil()` closure.
+});
+# }
+# Ok(())
+# }
+```
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/migration.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/migration.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/migration.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/migration.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1897 @@
+# Migrating from older PyO3 versions
+
+This guide can help you upgrade code through breaking changes from one PyO3 version to the next.
+For a detailed list of all changes, see the [CHANGELOG](changelog.md).
+
+## from 0.21.* to 0.22
+
+### Deprecation of `gil-refs` feature continues
+<details open>
+<summary><small>Click to expand</small></summary>
+
+Following the introduction of the "Bound" API in PyO3 0.21 and the planned removal of the "GIL Refs" API, all functionality related to GIL Refs is now gated behind the `gil-refs` feature and emits a deprecation warning on use.
+
+See <a href="#from-021-to-022">the 0.21 migration entry</a> for help upgrading.
+</details>
+
+### Deprecation of implicit default for trailing optional arguments
+<details open>
+<summary><small>Click to expand</small></summary>
+
+With `pyo3` 0.22 the implicit `None` default for trailing `Option<T>` type argument is deprecated. To migrate, place a `#[pyo3(signature = (...))]` attribute on affected functions or methods and specify the desired behavior.
+The migration warning specifies the corresponding signature to keep the current behavior. With 0.23 the signature will be required for any function containing `Option<T>` type parameters to prevent accidental
+and unnoticed changes in behavior. With 0.24 this restriction will be lifted again and `Option<T>` type arguments will be treated as any other argument _without_ special handling.
+
+Before:
+
+```rust
+# #![allow(deprecated, dead_code)]
+# use pyo3::prelude::*;
+#[pyfunction]
+fn increment(x: u64, amount: Option<u64>) -> u64 {
+    x + amount.unwrap_or(1)
+}
+```
+
+After:
+
+```rust
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+#[pyfunction]
+#[pyo3(signature = (x, amount=None))]
+fn increment(x: u64, amount: Option<u64>) -> u64 {
+    x + amount.unwrap_or(1)
+}
+```
+</details>
+
+### `Py::clone` is now gated behind the `py-clone` feature
+<details open>
+<summary><small>Click to expand</small></summary>
+If you rely on `impl<T> Clone for Py<T>` to fulfil trait requirements imposed by existing Rust code written without PyO3-based code in mind, the newly introduced feature `py-clone` must be enabled.
+
+However, take care to note that the behaviour is different from previous versions. If `Clone` was called without the GIL being held, we tried to delay the application of these reference count increments until PyO3-based code would re-acquire it. This turned out to be impossible to implement in a sound manner and hence was removed. Now, if `Clone` is called without the GIL being held, we panic instead for which calling code might not be prepared.
+
+Related to this, we also added a `pyo3_disable_reference_pool` conditional compilation flag which removes the infrastructure necessary to apply delayed reference count decrements implied by `impl<T> Drop for Py<T>`. They do not appear to be a soundness hazard as they should lead to memory leaks in the worst case. However, the global synchronization adds significant overhead to cross the Python-Rust boundary. Enabling this feature will remove these costs and make the `Drop` implementation abort the process if called without the GIL being held instead.
+</details>
+
+### Require explicit opt-in for comparison for simple enums
+<details open>
+<summary><small>Click to expand</small></summary>
+
+With `pyo3` 0.22 the new `#[pyo3(eq)]` options allows automatic implementation of Python equality using Rust's `PartialEq`. Previously simple enums automatically implemented equality in terms of their discriminants. To make PyO3 more consistent, this automatic equality implementation is deprecated in favour of having opt-ins for all `#[pyclass]` types. Similarly, simple enums supported comparison with integers, which is not covered by Rust's `PartialEq` derive, so has been split out into the `#[pyo3(eq_int)]` attribute.
+
+To migrate, place a `#[pyo3(eq, eq_int)]` attribute on simple enum classes.
+
+Before:
+
+```rust
+# #![allow(deprecated, dead_code)]
+# use pyo3::prelude::*;
+#[pyclass]
+enum SimpleEnum {
+    VariantA,
+    VariantB = 42,
+}
+```
+
+After:
+
+```rust
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+#[pyclass(eq, eq_int)]
+#[derive(PartialEq)]
+enum SimpleEnum {
+    VariantA,
+    VariantB = 42,
+}
+```
+</details>
+
+### `PyType::name` reworked to better match Python `__name__`
+<details open>
+<summary><small>Click to expand</small></summary>
+
+This function previously would try to read directly from Python type objects' C API field (`tp_name`), in which case it
+would return a `Cow::Borrowed`. However the contents of `tp_name` don't have well-defined semantics.
+
+Instead `PyType::name()` now returns the equivalent of Python `__name__` and returns `PyResult<Bound<'py, PyString>>`.
+
+The closest equivalent to PyO3 0.21's version of `PyType::name()` has been introduced as a new function `PyType::fully_qualified_name()`,
+which is equivalent to `__module__` and `__qualname__` joined as `module.qualname`.
+
+Before:
+
+```rust,ignore
+# #![allow(deprecated, dead_code)]
+# use pyo3::prelude::*;
+# use pyo3::types::{PyBool};
+# fn main() -> PyResult<()> {
+Python::with_gil(|py| {
+    let bool_type = py.get_type_bound::<PyBool>();
+    let name = bool_type.name()?.into_owned();
+    println!("Hello, {}", name);
+
+    let mut name_upper = bool_type.name()?;
+    name_upper.to_mut().make_ascii_uppercase();
+    println!("Hello, {}", name_upper);
+
+    Ok(())
+})
+# }
+```
+
+After:
+
+```rust
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+# use pyo3::types::{PyBool};
+# fn main() -> PyResult<()> {
+Python::with_gil(|py| {
+    let bool_type = py.get_type_bound::<PyBool>();
+    let name = bool_type.name()?;
+    println!("Hello, {}", name);
+
+    // (if the full dotted path was desired, switch from `name()` to `fully_qualified_name()`)
+    let mut name_upper = bool_type.fully_qualified_name()?.to_string();
+    name_upper.make_ascii_uppercase();
+    println!("Hello, {}", name_upper);
+
+    Ok(())
+})
+# }
+```
+</details>
+
+
+
+## from 0.20.* to 0.21
+<details>
+<summary><small>Click to expand</small></summary>
+
+PyO3 0.21 introduces a new `Bound<'py, T>` smart pointer which replaces the existing "GIL Refs" API to interact with Python objects. For example, in PyO3 0.20 the reference `&'py PyAny` would be used to interact with Python objects. In PyO3 0.21 the updated type is `Bound<'py, PyAny>`. Making this change moves Rust ownership semantics out of PyO3's internals and into user code. This change fixes [a known soundness edge case of interaction with gevent](https://github.com/PyO3/pyo3/issues/3668) as well as improves CPU and [memory performance](https://github.com/PyO3/pyo3/issues/1056). For a full history of discussion see https://github.com/PyO3/pyo3/issues/3382.
+
+The "GIL Ref" `&'py PyAny` and similar types such as `&'py PyDict` continue to be available as a deprecated API. Due to the advantages of the new API it is advised that all users make the effort to upgrade as soon as possible.
+
+In addition to the major API type overhaul, PyO3 has needed to make a few small breaking adjustments to other APIs to close correctness and soundness gaps.
+
+The recommended steps to update to PyO3 0.21 is as follows:
+  1. Enable the `gil-refs` feature to silence deprecations related to the API change
+  2. Fix all other PyO3 0.21 migration steps
+  3. Disable the `gil-refs` feature and migrate off the deprecated APIs
+
+The following sections are laid out in this order.
+</details>
+
+### Enable the `gil-refs` feature
+<details>
+<summary><small>Click to expand</small></summary>
+
+To make the transition for the PyO3 ecosystem away from the GIL Refs API as smooth as possible, in PyO3 0.21 no APIs consuming or producing GIL Refs have been altered. Instead, variants using `Bound<T>` smart pointers have been introduced, for example `PyTuple::new_bound` which returns `Bound<PyTuple>` is the replacement form of `PyTuple::new`. The GIL Ref APIs have been deprecated, but to make migration easier it is possible to disable these deprecation warnings by enabling the `gil-refs` feature.
+
+> The one single exception where an existing API was changed in-place is the `pyo3::intern!` macro. Almost all uses of this macro did not need to update code to account it changing to return `&Bound<PyString>` immediately, and adding an `intern_bound!` replacement was perceived as adding more work for users.
+
+It is recommended that users do this as a first step of updating to PyO3 0.21 so that the deprecation warnings do not get in the way of resolving the rest of the migration steps.
+
+Before:
+
+```toml
+# Cargo.toml
+[dependencies]
+pyo3 = "0.20"
+```
+
+After:
+
+```toml
+# Cargo.toml
+[dependencies]
+pyo3 = { version = "0.21", features = ["gil-refs"] }
+```
+</details>
+
+### `PyTypeInfo` and `PyTryFrom` have been adjusted
+<details>
+<summary><small>Click to expand</small></summary>
+
+The `PyTryFrom` trait has aged poorly, its `try_from` method now conflicts with `TryFrom::try_from` in the 2021 edition prelude. A lot of its functionality was also duplicated with `PyTypeInfo`.
+
+To tighten up the PyO3 traits as part of the deprecation of the GIL Refs API the `PyTypeInfo` trait has had a simpler companion `PyTypeCheck`. The methods `PyAny::downcast` and `PyAny::downcast_exact` no longer use `PyTryFrom` as a bound, instead using `PyTypeCheck` and `PyTypeInfo` respectively.
+
+To migrate, switch all type casts to use `obj.downcast()` instead of `try_from(obj)` (and similar for `downcast_exact`).
+
+Before:
+
+```rust,ignore
+# #![allow(deprecated)]
+# use pyo3::prelude::*;
+# use pyo3::types::{PyInt, PyList};
+# fn main() -> PyResult<()> {
+Python::with_gil(|py| {
+    let list = PyList::new(py, 0..5);
+    let b = <PyInt as PyTryFrom>::try_from(list.get_item(0).unwrap())?;
+    Ok(())
+})
+# }
+```
+
+After:
+
+```rust,ignore
+# use pyo3::prelude::*;
+# use pyo3::types::{PyInt, PyList};
+# fn main() -> PyResult<()> {
+Python::with_gil(|py| {
+    // Note that PyList::new is deprecated for PyList::new_bound as part of the GIL Refs API removal,
+    // see the section below on migration to Bound<T>.
+    #[allow(deprecated)]
+    let list = PyList::new(py, 0..5);
+    let b = list.get_item(0).unwrap().downcast::<PyInt>()?;
+    Ok(())
+})
+# }
+```
+</details>
+
+### `Iter(A)NextOutput` are deprecated
+<details>
+<summary><small>Click to expand</small></summary>
+
+The `__next__` and `__anext__` magic methods can now return any type convertible into Python objects directly just like all other `#[pymethods]`. The `IterNextOutput` used by `__next__` and `IterANextOutput` used by `__anext__` are subsequently deprecated. Most importantly, this change allows returning an awaitable from `__anext__` without non-sensically wrapping it into `Yield` or `Some`. Only the return types `Option<T>` and `Result<Option<T>, E>` are still handled in a special manner where `Some(val)` yields `val` and `None` stops iteration.
+
+Starting with an implementation of a Python iterator using `IterNextOutput`, e.g.
+
+```rust
+#![allow(deprecated)]
+use pyo3::prelude::*;
+use pyo3::iter::IterNextOutput;
+
+#[pyclass]
+struct PyClassIter {
+    count: usize,
+}
+
+#[pymethods]
+impl PyClassIter {
+    fn __next__(&mut self) -> IterNextOutput<usize, &'static str> {
+        if self.count < 5 {
+            self.count += 1;
+            IterNextOutput::Yield(self.count)
+        } else {
+            IterNextOutput::Return("done")
+        }
+    }
+}
+```
+
+If returning `"done"` via `StopIteration` is not really required, this should be written as
+
+```rust
+use pyo3::prelude::*;
+
+#[pyclass]
+struct PyClassIter {
+    count: usize,
+}
+
+#[pymethods]
+impl PyClassIter {
+    fn __next__(&mut self) -> Option<usize> {
+        if self.count < 5 {
+            self.count += 1;
+            Some(self.count)
+        } else {
+            None
+        }
+    }
+}
+```
+
+This form also has additional benefits: It has already worked in previous PyO3 versions, it matches the signature of Rust's [`Iterator` trait](https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html) and it allows using a fast path in CPython which completely avoids the cost of raising a `StopIteration` exception. Note that using [`Option::transpose`](https://doc.rust-lang.org/stable/std/option/enum.Option.html#method.transpose) and the `Result<Option<T>, E>` variant, this form can also be used to wrap fallible iterators.
+
+Alternatively, the implementation can also be done as it would in Python itself, i.e. by "raising" a `StopIteration` exception
+
+```rust
+use pyo3::prelude::*;
+use pyo3::exceptions::PyStopIteration;
+
+#[pyclass]
+struct PyClassIter {
+    count: usize,
+}
+
+#[pymethods]
+impl PyClassIter {
+    fn __next__(&mut self) -> PyResult<usize> {
+        if self.count < 5 {
+            self.count += 1;
+            Ok(self.count)
+        } else {
+            Err(PyStopIteration::new_err("done"))
+        }
+    }
+}
+```
+
+Finally, an asynchronous iterator can directly return an awaitable without confusing wrapping
+
+```rust
+use pyo3::prelude::*;
+
+#[pyclass]
+struct PyClassAwaitable {
+    number: usize,
+}
+
+#[pymethods]
+impl PyClassAwaitable {
+    fn __next__(&self) -> usize {
+        self.number
+    }
+
+    fn __await__(slf: Py<Self>) -> Py<Self> {
+        slf
+    }
+}
+
+#[pyclass]
+struct PyClassAsyncIter {
+    number: usize,
+}
+
+#[pymethods]
+impl PyClassAsyncIter {
+    fn __anext__(&mut self) -> PyClassAwaitable {
+        self.number += 1;
+        PyClassAwaitable {
+            number: self.number,
+        }
+    }
+
+    fn __aiter__(slf: Py<Self>) -> Py<Self> {
+        slf
+    }
+}
+```
+</details>
+
+### `PyType::name` has been renamed to `PyType::qualname`
+<details>
+<summary><small>Click to expand</small></summary>
+
+`PyType::name` has been renamed to `PyType::qualname` to indicate that it does indeed return the [qualified name](https://docs.python.org/3/glossary.html#term-qualified-name), matching the `__qualname__` attribute. The newly added `PyType::name` yields the full name including the module name now which corresponds to `__module__.__name__` on the level of attributes.
+</details>
+
+### `PyCell` has been deprecated
+<details>
+<summary><small>Click to expand</small></summary>
+
+Interactions with Python objects implemented in Rust no longer need to go though `PyCell<T>`. Instead iteractions with Python object now consistently go through `Bound<T>` or `Py<T>` independently of whether `T` is native Python object or a `#[pyclass]` implemented in Rust. Use `Bound::new` or `Py::new` respectively to create and `Bound::borrow(_mut)` / `Py::borrow(_mut)` to borrow the Rust object.
+</details>
+
+### Migrating from the GIL Refs API to `Bound<T>`
+<details>
+<summary><small>Click to expand</small></summary>
+
+To minimise breakage of code using the GIL Refs API, the `Bound<T>` smart pointer has been introduced by adding complements to all functions which accept or return GIL Refs. This allows code to migrate by replacing the deprecated APIs with the new ones.
+
+To identify what to migrate, temporarily switch off the `gil-refs` feature to see deprecation warnings on [almost](#cases-where-pyo3-cannot-emit-gil-ref-deprecation-warnings) all uses of APIs accepting and producing GIL Refs . Over one or more PRs it should be possible to follow the deprecation hints to update code. Depending on your development environment, switching off the `gil-refs` feature may introduce [some very targeted breakages](#deactivating-the-gil-refs-feature), so you may need to fixup those first.
+
+For example, the following APIs have gained updated variants:
+- `PyList::new`, `PyTyple::new` and similar constructors have replacements `PyList::new_bound`, `PyTuple::new_bound` etc.
+- `FromPyObject::extract` has a new `FromPyObject::extract_bound` (see the section below)
+- The `PyTypeInfo` trait has had new `_bound` methods added to accept / return `Bound<T>`.
+
+Because the new `Bound<T>` API brings ownership out of the PyO3 framework and into user code, there are a few places where user code is expected to need to adjust while switching to the new API:
+- Code will need to add the occasional `&` to borrow the new smart pointer as `&Bound<T>` to pass these types around (or use `.clone()` at the very small cost of increasing the Python reference count)
+- `Bound<PyList>` and `Bound<PyTuple>` cannot support indexing with `list[0]`, you should use `list.get_item(0)` instead.
+- `Bound<PyTuple>::iter_borrowed` is slightly more efficient than `Bound<PyTuple>::iter`. The default iteration of `Bound<PyTuple>` cannot return borrowed references because Rust does not (yet) have "lending iterators". Similarly `Bound<PyTuple>::get_borrowed_item` is more efficient than `Bound<PyTuple>::get_item` for the same reason.
+- `&Bound<T>` does not implement `FromPyObject` (although it might be possible to do this in the future once the GIL Refs API is completely removed). Use `bound_any.downcast::<T>()` instead of `bound_any.extract::<&Bound<T>>()`.
+- `Bound<PyString>::to_str` now borrows from the `Bound<PyString>` rather than from the `'py` lifetime, so code will need to store the smart pointer as a value in some cases where previously `&PyString` was just used as a temporary. (There are some more details relating to this in [the section below](#deactivating-the-gil-refs-feature).)
+- `.extract::<&str>()` now borrows from the source Python object. The simplest way to update is to change to `.extract::<PyBackedStr>()`, which retains ownership of the Python reference. See more information [in the section on deactivating the `gil-refs` feature](#deactivating-the-gil-refs-feature).
+
+To convert between `&PyAny` and `&Bound<PyAny>` use the `as_borrowed()` method:
+
+```rust,ignore
+let gil_ref: &PyAny = ...;
+let bound: &Bound<PyAny> = &gil_ref.as_borrowed();
+```
+
+To convert between `Py<T>` and `Bound<T>` use the `bind()` / `into_bound()` methods, and `as_unbound()` / `unbind()` to go back from `Bound<T>` to `Py<T>`.
+
+```rust,ignore
+let obj: Py<PyList> = ...;
+let bound: &Bound<'py, PyList> = obj.bind(py);
+let bound: Bound<'py, PyList> = obj.into_bound(py);
+
+let obj: &Py<PyList> = bound.as_unbound();
+let obj: Py<PyList> = bound.unbind();
+```
+
+<div class="warning">
+
+⚠️ Warning: dangling pointer trap 💣
+
+> Because of the ownership changes, code which uses `.as_ptr()` to convert `&PyAny` and other GIL Refs to a `*mut pyo3_ffi::PyObject` should take care to avoid creating dangling pointers now that `Bound<PyAny>` carries ownership.
+>
+> For example, the following pattern with `Option<&PyAny>` can easily create a dangling pointer when migrating to the `Bound<PyAny>` smart pointer:
+>
+> ```rust,ignore
+> let opt: Option<&PyAny> = ...;
+> let p: *mut ffi::PyObject = opt.map_or(std::ptr::null_mut(), |any| any.as_ptr());
+> ```
+>
+> The correct way to migrate this code is to use `.as_ref()` to avoid dropping the `Bound<PyAny>` in the `map_or` closure:
+>
+> ```rust,ignore
+> let opt: Option<Bound<PyAny>> = ...;
+> let p: *mut ffi::PyObject = opt.as_ref().map_or(std::ptr::null_mut(), Bound::as_ptr);
+> ```
+<div>
+
+#### Migrating `FromPyObject` implementations
+
+`FromPyObject` has had a new method `extract_bound` which takes `&Bound<'py, PyAny>` as an argument instead of `&PyAny`. Both `extract` and `extract_bound` have been given default implementations in terms of the other, to avoid breaking code immediately on update to 0.21.
+
+All implementations of `FromPyObject` should be switched from `extract` to `extract_bound`.
+
+Before:
+
+```rust,ignore
+impl<'py> FromPyObject<'py> for MyType {
+    fn extract(obj: &'py PyAny) -> PyResult<Self> {
+        /* ... */
+    }
+}
+```
+
+After:
+
+```rust,ignore
+impl<'py> FromPyObject<'py> for MyType {
+    fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self> {
+        /* ... */
+    }
+}
+```
+
+The expectation is that in 0.22 `extract_bound` will have the default implementation removed and in 0.23 `extract` will be removed.
+
+#### Cases where PyO3 cannot emit GIL Ref deprecation warnings
+
+Despite a large amount of deprecations warnings produced by PyO3 to aid with the transition from GIL Refs to the Bound API, there are a few cases where PyO3 cannot automatically warn on uses of GIL Refs. It is worth checking for these cases manually after the deprecation warnings have all been addressed:
+
+- Individual implementations of the `FromPyObject` trait cannot be deprecated, so PyO3 cannot warn about uses of code patterns like `.extract<&PyAny>()` which produce a GIL Ref.
+- GIL Refs in `#[pyfunction]` arguments emit a warning, but if the GIL Ref is wrapped inside another container such as `Vec<&PyAny>` then PyO3 cannot warn against this.
+- The `wrap_pyfunction!(function)(py)` deferred argument form of the `wrap_pyfunction` macro taking `py: Python<'py>` produces a GIL Ref, and due to limitations in type inference PyO3 cannot warn against this specific case.
+
+</details>
+
+### Deactivating the `gil-refs` feature
+<details>
+<summary><small>Click to expand</small></summary>
+
+As a final step of migration, deactivating the `gil-refs` feature will set up code for best performance and is intended to set up a forward-compatible API for PyO3 0.22.
+
+At this point code that needed to manage GIL Ref memory can safely remove uses of `GILPool` (which are constructed by calls to `Python::new_pool` and `Python::with_pool`). Deprecation warnings will highlight these cases.
+
+There is just one case of code that changes upon disabling these features: `FromPyObject` trait implementations for types that borrow directly from the input data cannot be implemented by PyO3 without GIL Refs (while the GIL Refs API is in the process of being removed). The main types affected are `&str`, `Cow<'_, str>`, `&[u8]`, `Cow<'_, u8>`.
+
+To make PyO3's core functionality continue to work while the GIL Refs API is in the process of being removed, disabling the `gil-refs` feature moves the implementations of `FromPyObject` for `&str`, `Cow<'_, str>`, `&[u8]`, `Cow<'_, u8>` to a new temporary trait `FromPyObjectBound`. This trait is the expected future form of `FromPyObject` and has an additional lifetime `'a` to enable these types to borrow data from Python objects.
+
+PyO3 0.21 has introduced the [`PyBackedStr`]({{#PYO3_DOCS_URL}}/pyo3/pybacked/struct.PyBackedStr.html) and [`PyBackedBytes`]({{#PYO3_DOCS_URL}}/pyo3/pybacked/struct.PyBackedBytes.html) types to help with this case. The easiest way to avoid lifetime challenges from extracting `&str` is to use these. For more complex types like `Vec<&str>`, is now impossible to extract directly from a Python object and `Vec<PyBackedStr>` is the recommended upgrade path.
+
+A key thing to note here is because extracting to these types now ties them to the input lifetime, some extremely common patterns may need to be split into multiple Rust lines. For example, the following snippet of calling `.extract::<&str>()` directly on the result of `.getattr()` needs to be adjusted when deactivating the `gil-refs` feature.
+
+Before:
+
+```rust
+# #[cfg(feature = "gil-refs")] {
+# use pyo3::prelude::*;
+# use pyo3::types::{PyList, PyType};
+# fn example<'py>(py: Python<'py>) -> PyResult<()> {
+#[allow(deprecated)] // GIL Ref API
+let obj: &'py PyType = py.get_type::<PyList>();
+let name: &'py str = obj.getattr("__name__")?.extract()?;
+assert_eq!(name, "list");
+# Ok(())
+# }
+# Python::with_gil(example).unwrap();
+# }
+```
+
+After:
+
+```rust
+# #[cfg(any(not(Py_LIMITED_API), Py_3_10))] {
+# use pyo3::prelude::*;
+# use pyo3::types::{PyList, PyType};
+# fn example<'py>(py: Python<'py>) -> PyResult<()> {
+let obj: Bound<'py, PyType> = py.get_type_bound::<PyList>();
+let name_obj: Bound<'py, PyAny> = obj.getattr("__name__")?;
+// the lifetime of the data is no longer `'py` but the much shorter
+// lifetime of the `name_obj` smart pointer above
+let name: &'_ str = name_obj.extract()?;
+assert_eq!(name, "list");
+# Ok(())
+# }
+# Python::with_gil(example).unwrap();
+# }
+```
+
+To avoid needing to worry about lifetimes at all, it is also possible to use the new `PyBackedStr` type, which stores a reference to the Python `str` without a lifetime attachment. In particular, `PyBackedStr` helps for `abi3` builds for Python older than 3.10. Due to limitations in the `abi3` CPython API for those older versions, PyO3 cannot offer a `FromPyObjectBound` implementation for `&str` on those versions. The easiest way to migrate for older `abi3` builds is to replace any cases of `.extract::<&str>()` with `.extract::<PyBackedStr>()`. Alternatively, use `.extract::<Cow<str>>()`, `.extract::<String>()` to copy the data into Rust.
+
+The following example uses the same snippet as those just above, but this time the final extracted type is `PyBackedStr`:
+
+```rust
+# use pyo3::prelude::*;
+# use pyo3::types::{PyList, PyType};
+# fn example<'py>(py: Python<'py>) -> PyResult<()> {
+use pyo3::pybacked::PyBackedStr;
+let obj: Bound<'py, PyType> = py.get_type_bound::<PyList>();
+let name: PyBackedStr = obj.getattr("__name__")?.extract()?;
+assert_eq!(&*name, "list");
+# Ok(())
+# }
+# Python::with_gil(example).unwrap();
+```
+</details>
+
+## from 0.19.* to 0.20
+
+### Drop support for older technologies
+<details>
+<summary><small>Click to expand</small></summary>
+
+PyO3 0.20 has increased minimum Rust version to 1.56. This enables use of newer language features and simplifies maintenance of the project.
+</details>
+
+### `PyDict::get_item` now returns a `Result`
+<details>
+<summary><small>Click to expand</small></summary>
+
+`PyDict::get_item` in PyO3 0.19 and older was implemented using a Python API which would suppress all exceptions and return `None` in those cases. This included errors in `__hash__` and `__eq__` implementations of the key being looked up.
+
+Newer recommendations by the Python core developers advise against using these APIs which suppress exceptions, instead allowing exceptions to bubble upwards. `PyDict::get_item_with_error` already implemented this recommended behavior, so that API has been renamed to `PyDict::get_item`.
+
+
+Before:
+
+```rust,ignore
+use pyo3::prelude::*;
+use pyo3::exceptions::PyTypeError;
+use pyo3::types::{PyDict, IntoPyDict};
+
+# fn main() {
+# let _ =
+Python::with_gil(|py| {
+    let dict: &PyDict = [("a", 1)].into_py_dict(py);
+    // `a` is in the dictionary, with value 1
+    assert!(dict.get_item("a").map_or(Ok(false), |x| x.eq(1))?);
+    // `b` is not in the dictionary
+    assert!(dict.get_item("b").is_none());
+    // `dict` is not hashable, so this fails with a `TypeError`
+    assert!(dict
+        .get_item_with_error(dict)
+        .unwrap_err()
+        .is_instance_of::<PyTypeError>(py));
+});
+# }
+```
+
+After:
+
+```rust,ignore
+use pyo3::prelude::*;
+use pyo3::exceptions::PyTypeError;
+use pyo3::types::{PyDict, IntoPyDict};
+
+# fn main() {
+# let _ =
+Python::with_gil(|py| -> PyResult<()> {
+    let dict: &PyDict = [("a", 1)].into_py_dict(py);
+    // `a` is in the dictionary, with value 1
+    assert!(dict.get_item("a")?.map_or(Ok(false), |x| x.eq(1))?);
+    // `b` is not in the dictionary
+    assert!(dict.get_item("b")?.is_none());
+    // `dict` is not hashable, so this fails with a `TypeError`
+    assert!(dict
+        .get_item(dict)
+        .unwrap_err()
+        .is_instance_of::<PyTypeError>(py));
+
+    Ok(())
+});
+# }
+```
+</details>
+
+### Required arguments are no longer accepted after optional arguments
+<details>
+<summary><small>Click to expand</small></summary>
+
+[Trailing `Option<T>` arguments](./function/signature.md#trailing-optional-arguments) have an automatic default of `None`. To avoid unwanted changes when modifying function signatures, in PyO3 0.18 it was deprecated to have a required argument after an `Option<T>` argument without using `#[pyo3(signature = (...))]` to specify the intended defaults. In PyO3 0.20, this becomes a hard error.
+
+Before:
+
+```rust,ignore
+#[pyfunction]
+fn x_or_y(x: Option<u64>, y: u64) -> u64 {
+    x.unwrap_or(y)
+}
+```
+
+After:
+
+```rust
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+
+#[pyfunction]
+#[pyo3(signature = (x, y))] // both x and y have no defaults and are required
+fn x_or_y(x: Option<u64>, y: u64) -> u64 {
+    x.unwrap_or(y)
+}
+```
+</details>
+
+### Remove deprecated function forms
+<details>
+<summary><small>Click to expand</small></summary>
+
+In PyO3 0.18 the `#[args]` attribute for `#[pymethods]`, and directly specifying the function signature in `#[pyfunction]`, was deprecated. This functionality has been removed in PyO3 0.20.
+
+Before:
+
+```rust,ignore
+#[pyfunction]
+#[pyo3(a, b = "0", "/")]
+fn add(a: u64, b: u64) -> u64 {
+    a + b
+}
+```
+
+After:
+
+```rust
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+
+#[pyfunction]
+#[pyo3(signature = (a, b=0, /))]
+fn add(a: u64, b: u64) -> u64 {
+    a + b
+}
+```
+
+</details>
+
+### `IntoPyPointer` trait removed
+<details>
+<summary><small>Click to expand</small></summary>
+
+The trait `IntoPyPointer`, which provided the `into_ptr` method on many types, has been removed. `into_ptr` is now available as an inherent method on all types that previously implemented this trait.
+</details>
+
+### `AsPyPointer` now `unsafe` trait
+<details>
+<summary><small>Click to expand</small></summary>
+
+The trait `AsPyPointer` is now `unsafe trait`, meaning any external implementation of it must be marked as `unsafe impl`, and ensure that they uphold the invariant of returning valid pointers.
+</details>
+
+## from 0.18.* to 0.19
+
+### Access to `Python` inside `__traverse__` implementations are now forbidden
+<details>
+<summary><small>Click to expand</small></summary>
+
+During `__traverse__` implementations for Python's Garbage Collection it is forbidden to do anything other than visit the members of the `#[pyclass]` being traversed. This means making Python function calls or other API calls are forbidden.
+
+Previous versions of PyO3 would allow access to `Python` (e.g. via `Python::with_gil`), which could cause the Python interpreter to crash or otherwise confuse the garbage collection algorithm.
+
+Attempts to acquire the GIL will now panic. See [#3165](https://github.com/PyO3/pyo3/issues/3165) for more detail.
+
+```rust,ignore
+# use pyo3::prelude::*;
+
+#[pyclass]
+struct SomeClass {}
+
+impl SomeClass {
+    fn __traverse__(&self, pyo3::class::gc::PyVisit<'_>) -> Result<(), pyo3::class::gc::PyTraverseError>` {
+        Python::with_gil(|| { /*...*/ })  // ERROR: this will panic
+    }
+}
+```
+</details>
+
+### Smarter `anyhow::Error` / `eyre::Report` conversion when inner error is "simple" `PyErr`
+<details>
+<summary><small>Click to expand</small></summary>
+
+When converting from `anyhow::Error` or `eyre::Report` to `PyErr`, if the inner error is a "simple" `PyErr` (with no source error), then the inner error will be used directly as the `PyErr` instead of wrapping it in a new `PyRuntimeError` with the original information converted into a string.
+
+```rust,ignore
+# #[cfg(feature = "anyhow")]
+# #[allow(dead_code)]
+# mod anyhow_only {
+# use pyo3::prelude::*;
+# use pyo3::exceptions::PyValueError;
+#[pyfunction]
+fn raise_err() -> anyhow::Result<()> {
+    Err(PyValueError::new_err("original error message").into())
+}
+
+fn main() {
+    Python::with_gil(|py| {
+        let rs_func = wrap_pyfunction!(raise_err, py).unwrap();
+        pyo3::py_run!(
+            py,
+            rs_func,
+            r"
+        try:
+            rs_func()
+        except Exception as e:
+            print(repr(e))
+        "
+        );
+    })
+}
+# }
+```
+
+Before, the above code would have printed `RuntimeError('ValueError: original error message')`, which might be confusing.
+
+After, the same code will print `ValueError: original error message`, which is more straightforward.
+
+However, if the `anyhow::Error` or `eyre::Report` has a source, then the original exception will still be wrapped in a `PyRuntimeError`.
+</details>
+
+### The deprecated `Python::acquire_gil` was removed and `Python::with_gil` must be used instead
+<details>
+<summary><small>Click to expand</small></summary>
+
+While the API provided by [`Python::acquire_gil`](https://docs.rs/pyo3/0.18.3/pyo3/marker/struct.Python.html#method.acquire_gil) seems convenient, it is somewhat brittle as the design of the GIL token [`Python`](https://docs.rs/pyo3/0.18.3/pyo3/marker/struct.Python.html) relies on proper nesting and panics if not used correctly, e.g.
+
+```rust,ignore
+# #![allow(dead_code, deprecated)]
+# use pyo3::prelude::*;
+
+#[pyclass]
+struct SomeClass {}
+
+struct ObjectAndGuard {
+    object: Py<SomeClass>,
+    guard: GILGuard,
+}
+
+impl ObjectAndGuard {
+    fn new() -> Self {
+        let guard = Python::acquire_gil();
+        let object = Py::new(guard.python(), SomeClass {}).unwrap();
+
+        Self { object, guard }
+    }
+}
+
+let first = ObjectAndGuard::new();
+let second = ObjectAndGuard::new();
+// Panics because the guard within `second` is still alive.
+drop(first);
+drop(second);
+```
+
+The replacement is [`Python::with_gil`](https://docs.rs/pyo3/0.18.3/pyo3/marker/struct.Python.html#method.with_gil) which is more cumbersome but enforces the proper nesting by design, e.g.
+
+```rust,ignore
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+
+#[pyclass]
+struct SomeClass {}
+
+struct Object {
+    object: Py<SomeClass>,
+}
+
+impl Object {
+    fn new(py: Python<'_>) -> Self {
+        let object = Py::new(py, SomeClass {}).unwrap();
+
+        Self { object }
+    }
+}
+
+// It either forces us to release the GIL before aquiring it again.
+let first = Python::with_gil(|py| Object::new(py));
+let second = Python::with_gil(|py| Object::new(py));
+drop(first);
+drop(second);
+
+// Or it ensures releasing the inner lock before the outer one.
+Python::with_gil(|py| {
+    let first = Object::new(py);
+    let second = Python::with_gil(|py| Object::new(py));
+    drop(first);
+    drop(second);
+});
+```
+
+Furthermore, `Python::acquire_gil` provides ownership of a `GILGuard` which can be freely stored and passed around. This is usually not helpful as it may keep the lock held for a long time thereby blocking progress in other parts of the program. Due to the generative lifetime attached to the GIL token supplied by `Python::with_gil`, the problem is avoided as the GIL token can only be passed down the call chain. Often, this issue can also be avoided entirely as any GIL-bound reference `&'py PyAny` implies access to a GIL token `Python<'py>` via the [`PyAny::py`](https://docs.rs/pyo3/latest/pyo3/types/struct.PyAny.html#method.py) method.
+</details>
+
+## from 0.17.* to 0.18
+
+### Required arguments after `Option<_>` arguments will no longer be automatically inferred
+<details>
+<summary><small>Click to expand</small></summary>
+
+In `#[pyfunction]` and `#[pymethods]`, if a "required" function input such as `i32` came after an `Option<_>` input, then the `Option<_>` would be implicitly treated as required. (All trailing `Option<_>` arguments were treated as optional with a default value of `None`).
+
+Starting with PyO3 0.18, this is deprecated and a future PyO3 version will require a [`#[pyo3(signature = (...))]` option](./function/signature.md) to explicitly declare the programmer's intention.
+
+Before, x in the below example would be required to be passed from Python code:
+
+```rust,compile_fail
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+
+#[pyfunction]
+fn required_argument_after_option(x: Option<i32>, y: i32) {}
+```
+
+After, specify the intended Python signature explicitly:
+
+```rust
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+
+// If x really was intended to be required
+#[pyfunction(signature = (x, y))]
+fn required_argument_after_option_a(x: Option<i32>, y: i32) {}
+
+// If x was intended to be optional, y needs a default too
+#[pyfunction(signature = (x=None, y=0))]
+fn required_argument_after_option_b(x: Option<i32>, y: i32) {}
+```
+</details>
+
+### `__text_signature__` is now automatically generated for `#[pyfunction]` and `#[pymethods]`
+<details>
+<summary><small>Click to expand</small></summary>
+
+The [`#[pyo3(text_signature = "...")]` option](./function/signature.md#making-the-function-signature-available-to-python) was previously the only supported way to set the `__text_signature__` attribute on generated Python functions.
+
+PyO3 is now able to automatically populate `__text_signature__` for all functions automatically based on their Rust signature (or the [new `#[pyo3(signature = (...))]` option](./function/signature.md)). These automatically-generated `__text_signature__` values will currently only render `...` for all default values. Many `#[pyo3(text_signature = "...")]` options can be removed from functions when updating to PyO3 0.18, however in cases with default values a manual implementation may still be preferred for now.
+
+As examples:
+
+```rust
+# use pyo3::prelude::*;
+
+// The `text_signature` option here is no longer necessary, as PyO3 will automatically
+// generate exactly the same value.
+#[pyfunction(text_signature = "(a, b, c)")]
+fn simple_function(a: i32, b: i32, c: i32) {}
+
+// The `text_signature` still provides value here as of PyO3 0.18, because the automatically
+// generated signature would be "(a, b=..., c=...)".
+#[pyfunction(signature = (a, b = 1, c = 2), text_signature = "(a, b=1, c=2)")]
+fn function_with_defaults(a: i32, b: i32, c: i32) {}
+
+# fn main() {
+#     Python::with_gil(|py| {
+#         let simple = wrap_pyfunction_bound!(simple_function, py).unwrap();
+#         assert_eq!(simple.getattr("__text_signature__").unwrap().to_string(), "(a, b, c)");
+#         let defaulted = wrap_pyfunction_bound!(function_with_defaults, py).unwrap();
+#         assert_eq!(defaulted.getattr("__text_signature__").unwrap().to_string(), "(a, b=1, c=2)");
+#     })
+# }
+```
+</details>
+
+## from 0.16.* to 0.17
+
+### Type checks have been changed for `PyMapping` and `PySequence` types
+<details>
+<summary><small>Click to expand</small></summary>
+
+Previously the type checks for `PyMapping` and `PySequence` (implemented in `PyTryFrom`)
+used the Python C-API functions `PyMapping_Check` and `PySequence_Check`.
+Unfortunately these functions are not sufficient for distinguishing such types,
+leading to inconsistent behavior (see
+[pyo3/pyo3#2072](https://github.com/PyO3/pyo3/issues/2072)).
+
+PyO3 0.17 changes these downcast checks to explicitly test if the type is a
+subclass of the corresponding abstract base class `collections.abc.Mapping` or
+`collections.abc.Sequence`. Note this requires calling into Python, which may
+incur a performance penalty over the previous method. If this performance
+penalty is a problem, you may be able to perform your own checks and use
+`try_from_unchecked` (unsafe).
+
+Another side-effect is that a pyclass defined in Rust with PyO3 will need to
+be _registered_ with the corresponding Python abstract base class for
+downcasting to succeed. `PySequence::register` and `PyMapping:register` have
+been added to make it easy to do this from Rust code. These are equivalent to
+calling `collections.abc.Mapping.register(MappingPyClass)` or
+`collections.abc.Sequence.register(SequencePyClass)` from Python.
+
+For example, for a mapping class defined in Rust:
+```rust,compile_fail
+use pyo3::prelude::*;
+use std::collections::HashMap;
+
+#[pyclass(mapping)]
+struct Mapping {
+    index: HashMap<String, usize>,
+}
+
+#[pymethods]
+impl Mapping {
+    #[new]
+    fn new(elements: Option<&PyList>) -> PyResult<Self> {
+    // ...
+    // truncated implementation of this mapping pyclass - basically a wrapper around a HashMap
+}
+```
+
+You must register the class with `collections.abc.Mapping` before the downcast will work:
+```rust,compile_fail
+let m = Py::new(py, Mapping { index }).unwrap();
+assert!(m.as_ref(py).downcast::<PyMapping>().is_err());
+PyMapping::register::<Mapping>(py).unwrap();
+assert!(m.as_ref(py).downcast::<PyMapping>().is_ok());
+```
+
+Note that this requirement may go away in the future when a pyclass is able to inherit from the abstract base class directly (see [pyo3/pyo3#991](https://github.com/PyO3/pyo3/issues/991)).
+</details>
+
+### The `multiple-pymethods` feature now requires Rust 1.62
+<details>
+<summary><small>Click to expand</small></summary>
+
+Due to limitations in the `inventory` crate which the `multiple-pymethods` feature depends on, this feature now
+requires Rust 1.62. For more information see [dtolnay/inventory#32](https://github.com/dtolnay/inventory/issues/32).
+</details>
+
+### Added `impl IntoPy<Py<PyString>> for &str`
+<details>
+<summary><small>Click to expand</small></summary>
+
+This may cause inference errors.
+
+Before:
+```rust,compile_fail
+# use pyo3::prelude::*;
+#
+# fn main() {
+Python::with_gil(|py| {
+    // Cannot infer either `Py<PyAny>` or `Py<PyString>`
+    let _test = "test".into_py(py);
+});
+# }
+```
+
+After, some type annotations may be necessary:
+
+```rust
+# use pyo3::prelude::*;
+#
+# fn main() {
+Python::with_gil(|py| {
+    let _test: Py<PyAny> = "test".into_py(py);
+});
+# }
+```
+</details>
+
+### The `pyproto` feature is now disabled by default
+<details>
+<summary><small>Click to expand</small></summary>
+
+In preparation for removing the deprecated `#[pyproto]` attribute macro in a future PyO3 version, it is now gated behind an opt-in feature flag. This also gives a slight saving to compile times for code which does not use the deprecated macro.
+</details>
+
+### `PyTypeObject` trait has been deprecated
+<details>
+<summary><small>Click to expand</small></summary>
+
+The `PyTypeObject` trait already was near-useless; almost all functionality was already on the `PyTypeInfo` trait, which `PyTypeObject` had a blanket implementation based upon. In PyO3 0.17 the final method, `PyTypeObject::type_object` was moved to `PyTypeInfo::type_object`.
+
+To migrate, update trait bounds and imports from `PyTypeObject` to `PyTypeInfo`.
+
+Before:
+
+```rust,ignore
+use pyo3::Python;
+use pyo3::type_object::PyTypeObject;
+use pyo3::types::PyType;
+
+fn get_type_object<T: PyTypeObject>(py: Python<'_>) -> &PyType {
+    T::type_object(py)
+}
+```
+
+After
+
+```rust,ignore
+use pyo3::{Python, PyTypeInfo};
+use pyo3::types::PyType;
+
+fn get_type_object<T: PyTypeInfo>(py: Python<'_>) -> &PyType {
+    T::type_object(py)
+}
+
+# Python::with_gil(|py| { get_type_object::<pyo3::types::PyList>(py); });
+```
+</details>
+
+### `impl<T, const N: usize> IntoPy<PyObject> for [T; N]` now requires `T: IntoPy` rather than `T: ToPyObject`
+<details>
+<summary><small>Click to expand</small></summary>
+
+If this leads to errors, simply implement `IntoPy`. Because pyclasses already implement `IntoPy`, you probably don't need to worry about this.
+</details>
+
+### Each `#[pymodule]` can now only be initialized once per process
+<details>
+<summary><small>Click to expand</small></summary>
+
+To make PyO3 modules sound in the presence of Python sub-interpreters, for now it has been necessary to explicitly disable the ability to initialize a `#[pymodule]` more than once in the same process. Attempting to do this will now raise an `ImportError`.
+</details>
+
+## from 0.15.* to 0.16
+
+### Drop support for older technologies
+<details>
+<summary><small>Click to expand</small></summary>
+
+PyO3 0.16 has increased minimum Rust version to 1.48 and minimum Python version to 3.7. This enables use of newer language features (enabling some of the other additions in 0.16) and simplifies maintenance of the project.
+</details>
+
+### `#[pyproto]` has been deprecated
+<details>
+<summary><small>Click to expand</small></summary>
+
+In PyO3 0.15, the `#[pymethods]` attribute macro gained support for implementing "magic methods" such as `__str__` (aka "dunder" methods). This implementation was not quite finalized at the time, with a few edge cases to be decided upon. The existing `#[pyproto]` attribute macro was left untouched, because it covered these edge cases.
+
+In PyO3 0.16, the `#[pymethods]` implementation has been completed and is now the preferred way to implement magic methods. To allow the PyO3 project to move forward, `#[pyproto]` has been deprecated (with expected removal in PyO3 0.18).
+
+Migration from `#[pyproto]` to `#[pymethods]` is straightforward; copying the existing methods directly from the `#[pyproto]` trait implementation is all that is needed in most cases.
+
+Before:
+
+```rust,compile_fail
+use pyo3::prelude::*;
+use pyo3::class::{PyObjectProtocol, PyIterProtocol};
+use pyo3::types::PyString;
+
+#[pyclass]
+struct MyClass {}
+
+#[pyproto]
+impl PyObjectProtocol for MyClass {
+    fn __str__(&self) -> &'static [u8] {
+        b"hello, world"
+    }
+}
+
+#[pyproto]
+impl PyIterProtocol for MyClass {
+    fn __iter__(slf: PyRef<self>) -> PyResult<&PyAny> {
+        PyString::new(slf.py(), "hello, world").iter()
+    }
+}
+```
+
+After
+
+```rust,compile_fail
+use pyo3::prelude::*;
+use pyo3::types::PyString;
+
+#[pyclass]
+struct MyClass {}
+
+#[pymethods]
+impl MyClass {
+    fn __str__(&self) -> &'static [u8] {
+        b"hello, world"
+    }
+
+    fn __iter__(slf: PyRef<self>) -> PyResult<&PyAny> {
+        PyString::new(slf.py(), "hello, world").iter()
+    }
+}
+```
+</details>
+
+### Removed `PartialEq` for object wrappers
+<details>
+<summary><small>Click to expand</small></summary>
+
+The Python object wrappers `Py` and `PyAny` had implementations of `PartialEq`
+so that `object_a == object_b` would compare the Python objects for pointer
+equality, which corresponds to the `is` operator, not the `==` operator in
+Python.  This has been removed in favor of a new method: use
+`object_a.is(object_b)`.  This also has the advantage of not requiring the same
+wrapper type for `object_a` and `object_b`; you can now directly compare a
+`Py<T>` with a `&PyAny` without having to convert.
+
+To check for Python object equality (the Python `==` operator), use the new
+method `eq()`.
+</details>
+
+### Container magic methods now match Python behavior
+<details>
+<summary><small>Click to expand</small></summary>
+
+In PyO3 0.15, `__getitem__`, `__setitem__` and `__delitem__` in `#[pymethods]` would generate only the _mapping_ implementation for a `#[pyclass]`. To match the Python behavior, these methods now generate both the _mapping_ **and** _sequence_ implementations.
+
+This means that classes implementing these `#[pymethods]` will now also be treated as sequences, same as a Python `class` would be. Small differences in behavior may result:
+ - PyO3 will allow instances of these classes to be cast to `PySequence` as well as `PyMapping`.
+ - Python will provide a default implementation of `__iter__` (if the class did not have one) which repeatedly calls `__getitem__` with integers (starting at 0) until an `IndexError` is raised.
+
+To explain this in detail, consider the following Python class:
+
+```python
+class ExampleContainer:
+
+    def __len__(self):
+        return 5
+
+    def __getitem__(self, idx: int) -> int:
+        if idx < 0 or idx > 5:
+            raise IndexError()
+        return idx
+```
+
+This class implements a Python [sequence](https://docs.python.org/3/glossary.html#term-sequence).
+
+The `__len__` and `__getitem__` methods are also used to implement a Python [mapping](https://docs.python.org/3/glossary.html#term-mapping). In the Python C-API, these methods are not shared: the sequence `__len__` and `__getitem__` are defined by the `sq_length` and `sq_item` slots, and the mapping equivalents are `mp_length` and `mp_subscript`. There are similar distinctions for `__setitem__` and `__delitem__`.
+
+Because there is no such distinction from Python, implementing these methods will fill the mapping and sequence slots simultaneously. A Python class with `__len__` implemented, for example, will have both the `sq_length` and `mp_length` slots filled.
+
+The PyO3 behavior in 0.16 has been changed to be closer to this Python behavior by default.
+</details>
+
+### `wrap_pymodule!` and `wrap_pyfunction!` now respect privacy correctly
+<details>
+<summary><small>Click to expand</small></summary>
+
+Prior to PyO3 0.16 the `wrap_pymodule!` and `wrap_pyfunction!` macros could use modules and functions whose defining `fn` was not reachable according Rust privacy rules.
+
+For example, the following code was legal before 0.16, but in 0.16 is rejected because the `wrap_pymodule!` macro cannot access the `private_submodule` function:
+
+```rust,compile_fail
+mod foo {
+    use pyo3::prelude::*;
+
+    #[pymodule]
+    fn private_submodule(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
+        Ok(())
+    }
+}
+
+use pyo3::prelude::*;
+use foo::*;
+
+#[pymodule]
+fn my_module(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
+    m.add_wrapped(wrap_pymodule!(private_submodule))?;
+    Ok(())
+}
+```
+
+To fix it, make the private submodule visible, e.g. with `pub` or `pub(crate)`.
+
+```rust,ignore
+mod foo {
+    use pyo3::prelude::*;
+
+    #[pymodule]
+    pub(crate) fn private_submodule(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
+        Ok(())
+    }
+}
+
+use pyo3::prelude::*;
+use pyo3::wrap_pymodule;
+use foo::*;
+
+#[pymodule]
+fn my_module(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
+    m.add_wrapped(wrap_pymodule!(private_submodule))?;
+    Ok(())
+}
+```
+</details>
+
+## from 0.14.* to 0.15
+
+### Changes in sequence indexing
+<details>
+<summary><small>Click to expand</small></summary>
+
+For all types that take sequence indices (`PyList`, `PyTuple` and `PySequence`),
+the API has been made consistent to only take `usize` indices, for consistency
+with Rust's indexing conventions.  Negative indices, which were only
+sporadically supported even in APIs that took `isize`, now aren't supported
+anywhere.
+
+Further, the `get_item` methods now always return a `PyResult` instead of
+panicking on invalid indices.  The `Index` trait has been implemented instead,
+and provides the same panic behavior as on Rust vectors.
+
+Note that *slice* indices (accepted by `PySequence::get_slice` and other) still
+inherit the Python behavior of clamping the indices to the actual length, and
+not panicking/returning an error on out of range indices.
+
+An additional advantage of using Rust's indexing conventions for these types is
+that these types can now also support Rust's indexing operators as part of a
+consistent API:
+
+```rust,ignore
+#![allow(deprecated)]
+use pyo3::{Python, types::PyList};
+
+Python::with_gil(|py| {
+    let list = PyList::new(py, &[1, 2, 3]);
+    assert_eq!(list[0..2].to_string(), "[1, 2]");
+});
+```
+</details>
+
+## from 0.13.* to 0.14
+
+### `auto-initialize` feature is now opt-in
+<details>
+<summary><small>Click to expand</small></summary>
+
+For projects embedding Python in Rust, PyO3 no longer automatically initializes a Python interpreter on the first call to `Python::with_gil` (or `Python::acquire_gil`) unless the [`auto-initialize` feature](features.md#auto-initialize) is enabled.
+</details>
+
+### New `multiple-pymethods` feature
+<details>
+<summary><small>Click to expand</small></summary>
+
+`#[pymethods]` have been reworked with a simpler default implementation which removes the dependency on the `inventory` crate. This reduces dependencies and compile times for the majority of users.
+
+The limitation of the new default implementation is that it cannot support multiple `#[pymethods]` blocks for the same `#[pyclass]`. If you need this functionality, you must enable the `multiple-pymethods` feature which will switch `#[pymethods]` to the inventory-based implementation.
+</details>
+
+### Deprecated `#[pyproto]` methods
+<details>
+<summary><small>Click to expand</small></summary>
+
+Some protocol (aka `__dunder__`) methods such as `__bytes__` and `__format__` have been possible to implement two ways in PyO3 for some time: via a `#[pyproto]` (e.g. `PyObjectProtocol` for the methods listed here), or by writing them directly in `#[pymethods]`. This is only true for a handful of the `#[pyproto]` methods (for technical reasons to do with the way PyO3 currently interacts with the Python C-API).
+
+In the interest of having only one way to do things, the `#[pyproto]` forms of these methods have been deprecated.
+
+To migrate just move the affected methods from a `#[pyproto]` to a `#[pymethods]` block.
+
+Before:
+
+```rust,compile_fail
+use pyo3::prelude::*;
+use pyo3::class::basic::PyObjectProtocol;
+
+#[pyclass]
+struct MyClass {}
+
+#[pyproto]
+impl PyObjectProtocol for MyClass {
+    fn __bytes__(&self) -> &'static [u8] {
+        b"hello, world"
+    }
+}
+```
+
+After:
+
+```rust
+use pyo3::prelude::*;
+
+#[pyclass]
+struct MyClass {}
+
+#[pymethods]
+impl MyClass {
+    fn __bytes__(&self) -> &'static [u8] {
+        b"hello, world"
+    }
+}
+```
+</details>
+
+## from 0.12.* to 0.13
+
+### Minimum Rust version increased to Rust 1.45
+<details>
+<summary><small>Click to expand</small></summary>
+
+PyO3 `0.13` makes use of new Rust language features stabilized between Rust 1.40 and Rust 1.45. If you are using a Rust compiler older than Rust 1.45, you will need to update your toolchain to be able to continue using PyO3.
+</details>
+
+### Runtime changes to support the CPython limited API
+<details>
+<summary><small>Click to expand</small></summary>
+
+In PyO3 `0.13` support was added for compiling against the CPython limited API. This had a number of implications for _all_ PyO3 users, described here.
+
+The largest of these is that all types created from PyO3 are what CPython calls "heap" types. The specific implications of this are:
+
+- If you wish to subclass one of these types _from Rust_ you must mark it `#[pyclass(subclass)]`, as you would if you wished to allow subclassing it from Python code.
+- Type objects are now mutable - Python code can set attributes on them.
+- `__module__` on types without `#[pyclass(module="mymodule")]` no longer returns `builtins`, it now raises `AttributeError`.
+</details>
+
+## from 0.11.* to 0.12
+
+### `PyErr` has been reworked
+<details>
+<summary><small>Click to expand</small></summary>
+
+In PyO3 `0.12` the `PyErr` type has been re-implemented to be significantly more compatible with
+the standard Rust error handling ecosystem. Specifically `PyErr` now implements
+`Error + Send + Sync`, which are the standard traits used for error types.
+
+While this has necessitated the removal of a number of APIs, the resulting `PyErr` type should now
+be much more easier to work with. The following sections list the changes in detail and how to
+migrate to the new APIs.
+</details>
+
+#### `PyErr::new` and `PyErr::from_type` now require `Send + Sync` for their argument
+<details>
+<summary><small>Click to expand</small></summary>
+
+For most uses no change will be needed. If you are trying to construct `PyErr` from a value that is
+not `Send + Sync`, you will need to first create the Python object and then use
+`PyErr::from_instance`.
+
+Similarly, any types which implemented `PyErrArguments` will now need to be `Send + Sync`.
+</details>
+
+#### `PyErr`'s contents are now private
+<details>
+<summary><small>Click to expand</small></summary>
+
+It is no longer possible to access the fields `.ptype`, `.pvalue` and `.ptraceback` of a `PyErr`.
+You should instead now use the new methods `PyErr::ptype`, `PyErr::pvalue` and `PyErr::ptraceback`.
+</details>
+
+#### `PyErrValue` and `PyErr::from_value` have been removed
+<details>
+<summary><small>Click to expand</small></summary>
+
+As these were part the internals of `PyErr` which have been reworked, these APIs no longer exist.
+
+If you used this API, it is recommended to use `PyException::new_err` (see [the section on
+Exception types](#exception-types-have-been-reworked)).
+</details>
+
+#### `Into<PyResult<T>>` for `PyErr` has been removed
+<details>
+<summary><small>Click to expand</small></summary>
+
+This implementation was redundant. Just construct the `Result::Err` variant directly.
+
+Before:
+```rust,compile_fail
+let result: PyResult<()> = PyErr::new::<TypeError, _>("error message").into();
+```
+
+After (also using the new reworked exception types; see the following section):
+```rust
+# use pyo3::{PyResult, exceptions::PyTypeError};
+let result: PyResult<()> = Err(PyTypeError::new_err("error message"));
+```
+</details>
+
+### Exception types have been reworked
+<details>
+<summary><small>Click to expand</small></summary>
+
+Previously exception types were zero-sized marker types purely used to construct `PyErr`. In PyO3
+0.12, these types have been replaced with full definitions and are usable in the same way as `PyAny`, `PyDict` etc. This
+makes it possible to interact with Python exception objects.
+
+The new types also have names starting with the "Py" prefix. For example, before:
+
+```rust,ignore
+let err: PyErr = TypeError::py_err("error message");
+```
+
+After:
+
+```rust,ignore
+# use pyo3::{PyErr, PyResult, Python, type_object::PyTypeObject};
+# use pyo3::exceptions::{PyBaseException, PyTypeError};
+# Python::with_gil(|py| -> PyResult<()> {
+let err: PyErr = PyTypeError::new_err("error message");
+
+// Uses Display for PyErr, new for PyO3 0.12
+assert_eq!(err.to_string(), "TypeError: error message");
+
+// Now possible to interact with exception instances, new for PyO3 0.12
+let instance: &PyBaseException = err.instance(py);
+assert_eq!(
+    instance.getattr("__class__")?,
+    PyTypeError::type_object(py).as_ref()
+);
+# Ok(())
+# }).unwrap();
+```
+</details>
+
+### `FromPy` has been removed
+<details>
+<summary><small>Click to expand</small></summary>
+
+To simplify the PyO3 conversion traits, the `FromPy` trait has been removed. Previously there were
+two ways to define the to-Python conversion for a type:
+`FromPy<T> for PyObject` and `IntoPy<PyObject> for T`.
+
+Now there is only one way to define the conversion, `IntoPy`, so downstream crates may need to
+adjust accordingly.
+
+Before:
+```rust,compile_fail
+# use pyo3::prelude::*;
+struct MyPyObjectWrapper(PyObject);
+
+impl FromPy<MyPyObjectWrapper> for PyObject {
+    fn from_py(other: MyPyObjectWrapper, _py: Python<'_>) -> Self {
+        other.0
+    }
+}
+```
+
+After
+```rust
+# use pyo3::prelude::*;
+# #[allow(dead_code)]
+struct MyPyObjectWrapper(PyObject);
+
+impl IntoPy<PyObject> for MyPyObjectWrapper {
+    fn into_py(self, _py: Python<'_>) -> PyObject {
+        self.0
+    }
+}
+```
+
+Similarly, code which was using the `FromPy` trait can be trivially rewritten to use `IntoPy`.
+
+Before:
+```rust,compile_fail
+# use pyo3::prelude::*;
+# Python::with_gil(|py| {
+let obj = PyObject::from_py(1.234, py);
+# })
+```
+
+After:
+```rust
+# use pyo3::prelude::*;
+# Python::with_gil(|py| {
+let obj: PyObject = 1.234.into_py(py);
+# })
+```
+</details>
+
+### `PyObject` is now a type alias of `Py<PyAny>`
+<details>
+<summary><small>Click to expand</small></summary>
+
+This should change very little from a usage perspective. If you implemented traits for both
+`PyObject` and `Py<T>`, you may find you can just remove the `PyObject` implementation.
+</details>
+
+### `AsPyRef` has been removed
+<details>
+<summary><small>Click to expand</small></summary>
+
+As `PyObject` has been changed to be just a type alias, the only remaining implementor of `AsPyRef`
+was `Py<T>`. This removed the need for a trait, so the `AsPyRef::as_ref` method has been moved to
+`Py::as_ref`.
+
+This should require no code changes except removing `use pyo3::AsPyRef` for code which did not use
+`pyo3::prelude::*`.
+
+Before:
+```rust,ignore
+use pyo3::{AsPyRef, Py, types::PyList};
+# pyo3::Python::with_gil(|py| {
+let list_py: Py<PyList> = PyList::empty(py).into();
+let list_ref: &PyList = list_py.as_ref(py);
+# })
+```
+
+After:
+```rust,ignore
+use pyo3::{Py, types::PyList};
+# pyo3::Python::with_gil(|py| {
+let list_py: Py<PyList> = PyList::empty(py).into();
+let list_ref: &PyList = list_py.as_ref(py);
+# })
+```
+</details>
+
+## from 0.10.* to 0.11
+
+### Stable Rust
+<details>
+<summary><small>Click to expand</small></summary>
+
+PyO3 now supports the stable Rust toolchain. The minimum required version is 1.39.0.
+</details>
+
+### `#[pyclass]` structs must now be `Send` or `unsendable`
+<details>
+<summary><small>Click to expand</small></summary>
+
+Because `#[pyclass]` structs can be sent between threads by the Python interpreter, they must implement
+`Send` or declared as `unsendable` (by `#[pyclass(unsendable)]`).
+Note that `unsendable` is added in PyO3 `0.11.1` and `Send` is always required in PyO3 `0.11.0`.
+
+This may "break" some code which previously was accepted, even though it could be unsound.
+There can be two fixes:
+
+1. If you think that your `#[pyclass]` actually must be `Send`able, then let's implement `Send`.
+   A common, safer way is using thread-safe types. E.g., `Arc` instead of `Rc`, `Mutex` instead of
+   `RefCell`, and `Box<dyn Send + T>` instead of `Box<dyn T>`.
+
+   Before:
+   ```rust,compile_fail
+   use pyo3::prelude::*;
+   use std::rc::Rc;
+   use std::cell::RefCell;
+
+   #[pyclass]
+   struct NotThreadSafe {
+       shared_bools: Rc<RefCell<Vec<bool>>>,
+       closure: Box<dyn Fn()>,
+   }
+   ```
+
+   After:
+   ```rust
+   # #![allow(dead_code)]
+   use pyo3::prelude::*;
+   use std::sync::{Arc, Mutex};
+
+   #[pyclass]
+   struct ThreadSafe {
+       shared_bools: Arc<Mutex<Vec<bool>>>,
+       closure: Box<dyn Fn() + Send>,
+   }
+   ```
+
+   In situations where you cannot change your `#[pyclass]` to automatically implement `Send`
+   (e.g., when it contains a raw pointer), you can use `unsafe impl Send`.
+   In such cases, care should be taken to ensure the struct is actually thread safe.
+   See [the Rustonomicon](https://doc.rust-lang.org/nomicon/send-and-sync.html) for more.
+
+2. If you think that your `#[pyclass]` should not be accessed by another thread, you can use
+   `unsendable` flag. A class marked with `unsendable` panics when accessed by another thread,
+   making it thread-safe to expose an unsendable object to the Python interpreter.
+
+   Before:
+   ```rust,compile_fail
+   use pyo3::prelude::*;
+
+   #[pyclass]
+   struct Unsendable {
+       pointers: Vec<*mut std::os::raw::c_char>,
+   }
+   ```
+
+   After:
+   ```rust
+   # #![allow(dead_code)]
+   use pyo3::prelude::*;
+
+   #[pyclass(unsendable)]
+   struct Unsendable {
+       pointers: Vec<*mut std::os::raw::c_char>,
+   }
+   ```
+</details>
+
+### All `PyObject` and `Py<T>` methods now take `Python` as an argument
+<details>
+<summary><small>Click to expand</small></summary>
+
+Previously, a few methods such as `Object::get_refcnt` did not take `Python` as an argument (to
+ensure that the Python GIL was held by the current thread). Technically, this was not sound.
+To migrate, just pass a `py` argument to any calls to these methods.
+
+Before:
+```rust,compile_fail
+# pyo3::Python::with_gil(|py| {
+py.None().get_refcnt();
+# })
+```
+
+After:
+```rust
+# pyo3::Python::with_gil(|py| {
+py.None().get_refcnt(py);
+# })
+```
+</details>
+
+## from 0.9.* to 0.10
+
+### `ObjectProtocol` is removed
+<details>
+<summary><small>Click to expand</small></summary>
+
+All methods are moved to [`PyAny`].
+And since now all native types (e.g., `PyList`) implements `Deref<Target=PyAny>`,
+all you need to do is remove `ObjectProtocol` from your code.
+Or if you use `ObjectProtocol` by `use pyo3::prelude::*`, you have to do nothing.
+
+Before:
+```rust,compile_fail,ignore
+use pyo3::ObjectProtocol;
+
+# pyo3::Python::with_gil(|py| {
+let obj = py.eval("lambda: 'Hi :)'", None, None).unwrap();
+let hi: &pyo3::types::PyString = obj.call0().unwrap().downcast().unwrap();
+assert_eq!(hi.len().unwrap(), 5);
+# })
+```
+
+After:
+```rust,ignore
+# pyo3::Python::with_gil(|py| {
+let obj = py.eval("lambda: 'Hi :)'", None, None).unwrap();
+let hi: &pyo3::types::PyString = obj.call0().unwrap().downcast().unwrap();
+assert_eq!(hi.len().unwrap(), 5);
+# })
+```
+</details>
+
+### No `#![feature(specialization)]` in user code
+<details>
+<summary><small>Click to expand</small></summary>
+
+While PyO3 itself still requires specialization and nightly Rust,
+now you don't have to use `#![feature(specialization)]` in your crate.
+</details>
+
+## from 0.8.* to 0.9
+
+### `#[new]` interface
+<details>
+<summary><small>Click to expand</small></summary>
+
+[`PyRawObject`](https://docs.rs/pyo3/0.8.5/pyo3/type_object/struct.PyRawObject.html)
+is now removed and our syntax for constructors has changed.
+
+Before:
+```rust,compile_fail
+#[pyclass]
+struct MyClass {}
+
+#[pymethods]
+impl MyClass {
+    #[new]
+    fn new(obj: &PyRawObject) {
+        obj.init(MyClass {})
+    }
+}
+```
+
+After:
+```rust
+# use pyo3::prelude::*;
+#[pyclass]
+struct MyClass {}
+
+#[pymethods]
+impl MyClass {
+    #[new]
+    fn new() -> Self {
+        MyClass {}
+    }
+}
+```
+
+Basically you can return `Self` or `Result<Self>` directly.
+For more, see [the constructor section](class.md#constructor) of this guide.
+</details>
+
+### PyCell
+<details>
+<summary><small>Click to expand</small></summary>
+
+PyO3 0.9 introduces `PyCell`, which is a [`RefCell`]-like object wrapper
+for ensuring Rust's rules regarding aliasing of references are upheld.
+For more detail, see the
+[Rust Book's section on Rust's rules of references](https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#the-rules-of-references)
+
+For `#[pymethods]` or `#[pyfunction]`s, your existing code should continue to work without any change.
+Python exceptions will automatically be raised when your functions are used in a way which breaks Rust's
+rules of references.
+
+Here is an example.
+```rust
+# use pyo3::prelude::*;
+
+#[pyclass]
+struct Names {
+    names: Vec<String>,
+}
+
+#[pymethods]
+impl Names {
+    #[new]
+    fn new() -> Self {
+        Names { names: vec![] }
+    }
+    fn merge(&mut self, other: &mut Names) {
+        self.names.append(&mut other.names)
+    }
+}
+# Python::with_gil(|py| {
+#     let names = Py::new(py, Names::new()).unwrap();
+#     pyo3::py_run!(py, names, r"
+#     try:
+#        names.merge(names)
+#        assert False, 'Unreachable'
+#     except RuntimeError as e:
+#        assert str(e) == 'Already borrowed'
+#     ");
+# })
+```
+`Names` has a `merge` method, which takes `&mut self` and another argument of type `&mut Self`.
+Given this `#[pyclass]`, calling `names.merge(names)` in Python raises
+a [`PyBorrowMutError`] exception, since it requires two mutable borrows of `names`.
+
+However, for `#[pyproto]` and some functions, you need to manually fix the code.
+
+#### Object creation
+In 0.8 object creation was done with `PyRef::new` and `PyRefMut::new`.
+In 0.9 these have both been removed.
+To upgrade code, please use
+`PyCell::new` instead.
+If you need [`PyRef`] or [`PyRefMut`], just call `.borrow()` or `.borrow_mut()`
+on the newly-created `PyCell`.
+
+Before:
+```rust,compile_fail
+# use pyo3::prelude::*;
+# #[pyclass]
+# struct MyClass {}
+# Python::with_gil(|py| {
+let obj_ref = PyRef::new(py, MyClass {}).unwrap();
+# })
+```
+
+After:
+```rust,ignore
+# use pyo3::prelude::*;
+# #[pyclass]
+# struct MyClass {}
+# Python::with_gil(|py| {
+let obj = PyCell::new(py, MyClass {}).unwrap();
+let obj_ref = obj.borrow();
+# })
+```
+
+#### Object extraction
+For `PyClass` types `T`, `&T` and `&mut T` no longer have [`FromPyObject`] implementations.
+Instead you should extract `PyRef<T>` or `PyRefMut<T>`, respectively.
+If `T` implements `Clone`, you can extract `T` itself.
+In addition, you can also extract `&PyCell<T>`, though you rarely need it.
+
+Before:
+```compile_fail
+let obj: &PyAny = create_obj();
+let obj_ref: &MyClass = obj.extract().unwrap();
+let obj_ref_mut: &mut MyClass = obj.extract().unwrap();
+```
+
+After:
+```rust,ignore
+# use pyo3::prelude::*;
+# use pyo3::types::IntoPyDict;
+# #[pyclass] #[derive(Clone)] struct MyClass {}
+# #[pymethods] impl MyClass { #[new]fn new() -> Self { MyClass {} }}
+# Python::with_gil(|py| {
+# let typeobj = py.get_type::<MyClass>();
+# let d = [("c", typeobj)].into_py_dict(py);
+# let create_obj = || py.eval("c()", None, Some(d)).unwrap();
+let obj: &PyAny = create_obj();
+let obj_cell: &PyCell<MyClass> = obj.extract().unwrap();
+let obj_cloned: MyClass = obj.extract().unwrap(); // extracted by cloning the object
+{
+    let obj_ref: PyRef<'_, MyClass> = obj.extract().unwrap();
+    // we need to drop obj_ref before we can extract a PyRefMut due to Rust's rules of references
+}
+let obj_ref_mut: PyRefMut<'_, MyClass> = obj.extract().unwrap();
+# })
+```
+
+
+#### `#[pyproto]`
+Most of the arguments to methods in `#[pyproto]` impls require a
+[`FromPyObject`] implementation.
+So if your protocol methods take `&T` or `&mut T` (where `T: PyClass`),
+please use [`PyRef`] or [`PyRefMut`] instead.
+
+Before:
+```rust,compile_fail
+# use pyo3::prelude::*;
+# use pyo3::class::PySequenceProtocol;
+#[pyclass]
+struct ByteSequence {
+    elements: Vec<u8>,
+}
+#[pyproto]
+impl PySequenceProtocol for ByteSequence {
+    fn __concat__(&self, other: &Self) -> PyResult<Self> {
+        let mut elements = self.elements.clone();
+        elements.extend_from_slice(&other.elements);
+        Ok(Self { elements })
+    }
+}
+```
+
+After:
+```rust,compile_fail
+# use pyo3::prelude::*;
+# use pyo3::class::PySequenceProtocol;
+#[pyclass]
+struct ByteSequence {
+    elements: Vec<u8>,
+}
+#[pyproto]
+impl PySequenceProtocol for ByteSequence {
+    fn __concat__(&self, other: PyRef<'p, Self>) -> PyResult<Self> {
+        let mut elements = self.elements.clone();
+        elements.extend_from_slice(&other.elements);
+        Ok(Self { elements })
+    }
+}
+```
+</details>
+
+<style>
+    /* render details immediately below h3 headers */
+    h3:has(+ details) {
+        margin-bottom: 0;
+    }
+
+    /* make summary text hint that it's clickable and increase the
+       size of the clickable area by padding downwards */
+    details > summary {
+        cursor: pointer;
+        padding-bottom: 0.5em;
+    }
+
+    /* reduce margin from paragraph directly below the clickable space
+       to avoid large gap */
+    details > summary + p {
+        margin-block-start: 0.5em;
+    }
+
+    /* pack headings that aren't expanded slightly closer together */
+    h3 + details:not([open]) + h3 {
+        margin-top: 1.5em;
+    }
+</style>
+
+[`FromPyObject`]: {{#PYO3_DOCS_URL}}/pyo3/conversion/trait.FromPyObject.html
+[`PyAny`]: {{#PYO3_DOCS_URL}}/pyo3/types/struct.PyAny.html
+[`PyBorrowMutError`]: {{#PYO3_DOCS_URL}}/pyo3/pycell/struct.PyBorrowMutError.html
+[`PyRef`]: {{#PYO3_DOCS_URL}}/pyo3/pycell/struct.PyRef.html
+[`PyRefMut`]: {{#PYO3_DOCS_URL}}/pyo3/pycell/struct.PyRef.html
+
+[`RefCell`]: https://doc.rust-lang.org/std/cell/struct.RefCell.html
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/module.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/module.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/module.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/module.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,180 @@
+# Python modules
+
+You can create a module using `#[pymodule]`:
+
+```rust
+use pyo3::prelude::*;
+
+#[pyfunction]
+fn double(x: usize) -> usize {
+    x * 2
+}
+
+/// This module is implemented in Rust.
+#[pymodule]
+fn my_extension(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    m.add_function(wrap_pyfunction!(double, m)?)
+}
+```
+
+The `#[pymodule]` procedural macro takes care of exporting the initialization function of your
+module to Python.
+
+The module's name defaults to the name of the Rust function. You can override the module name by
+using `#[pyo3(name = "custom_name")]`:
+
+```rust
+use pyo3::prelude::*;
+
+#[pyfunction]
+fn double(x: usize) -> usize {
+    x * 2
+}
+
+#[pymodule(name = "custom_name")]
+fn my_extension(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    m.add_function(wrap_pyfunction!(double, m)?)
+}
+```
+
+The name of the module must match the name of the `.so` or `.pyd`
+file. Otherwise, you will get an import error in Python with the following message:
+`ImportError: dynamic module does not define module export function (PyInit_name_of_your_module)`
+
+To import the module, either:
+ - copy the shared library as described in [Manual builds](building-and-distribution.md#manual-builds), or
+ - use a tool, e.g. `maturin develop` with [maturin](https://github.com/PyO3/maturin) or
+`python setup.py develop` with [setuptools-rust](https://github.com/PyO3/setuptools-rust).
+
+## Documentation
+
+The [Rust doc comments](https://doc.rust-lang.org/stable/book/ch03-04-comments.html) of the module
+initialization function will be applied automatically as the Python docstring of your module.
+
+For example, building off of the above code, this will print `This module is implemented in Rust.`:
+
+```python
+import my_extension
+
+print(my_extension.__doc__)
+```
+
+## Python submodules
+
+You can create a module hierarchy within a single extension module by using
+[`Bound<'_, PyModule>::add_submodule()`]({{#PYO3_DOCS_URL}}/pyo3/prelude/trait.PyModuleMethods.html#tymethod.add_submodule).
+For example, you could define the modules `parent_module` and `parent_module.child_module`.
+
+```rust
+use pyo3::prelude::*;
+
+#[pymodule]
+fn parent_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    register_child_module(m)?;
+    Ok(())
+}
+
+fn register_child_module(parent_module: &Bound<'_, PyModule>) -> PyResult<()> {
+    let child_module = PyModule::new_bound(parent_module.py(), "child_module")?;
+    child_module.add_function(wrap_pyfunction!(func, &child_module)?)?;
+    parent_module.add_submodule(&child_module)
+}
+
+#[pyfunction]
+fn func() -> String {
+    "func".to_string()
+}
+
+# Python::with_gil(|py| {
+#    use pyo3::wrap_pymodule;
+#    use pyo3::types::IntoPyDict;
+#    let parent_module = wrap_pymodule!(parent_module)(py);
+#    let ctx = [("parent_module", parent_module)].into_py_dict_bound(py);
+#
+#    py.run_bound("assert parent_module.child_module.func() == 'func'", None, Some(&ctx)).unwrap();
+# })
+```
+
+Note that this does not define a package, so this won’t allow Python code to directly import
+submodules by using `from parent_module import child_module`. For more information, see
+[#759](https://github.com/PyO3/pyo3/issues/759) and
+[#1517](https://github.com/PyO3/pyo3/issues/1517#issuecomment-808664021).
+
+It is not necessary to add `#[pymodule]` on nested modules, which is only required on the top-level module.
+
+## Declarative modules
+
+Another syntax based on Rust inline modules is also available to declare modules.
+
+For example:
+```rust
+# mod declarative_module_test {
+use pyo3::prelude::*;
+
+#[pyfunction]
+fn double(x: usize) -> usize {
+    x * 2
+}
+
+#[pymodule]
+mod my_extension {
+    use super::*;
+
+    #[pymodule_export]
+    use super::double; // Exports the double function as part of the module
+
+    #[pyfunction] // This will be part of the module
+    fn triple(x: usize) -> usize {
+        x * 3
+    }
+
+    #[pyclass] // This will be part of the module
+    struct Unit;
+
+    #[pymodule]
+    mod submodule {
+        // This is a submodule
+    }
+
+    #[pymodule_init]
+    fn init(m: &Bound<'_, PyModule>) -> PyResult<()> {
+        // Arbitrary code to run at the module initialization
+        m.add("double2", m.getattr("double")?)
+    }
+}
+# }
+```
+
+The `#[pymodule]` macro automatically sets the `module` attribute of the `#[pyclass]` macros declared inside of it with its name.
+For nested modules, the name of the parent module is automatically added.
+In the following example, the `Unit` class will have for `module` `my_extension.submodule` because it is properly nested
+but the `Ext` class will have for `module` the default `builtins` because it not nested.
+
+You can provide the `submodule` argument to `pymodule()` for modules that are not top-level modules.
+```rust
+# mod declarative_module_module_attr_test {
+use pyo3::prelude::*;
+
+#[pyclass]
+struct Ext;
+
+#[pymodule]
+mod my_extension {
+    use super::*;
+
+    #[pymodule_export]
+    use super::Ext;
+
+    #[pymodule(submodule)]
+    mod submodule {
+        use super::*;
+        // This is a submodule
+
+        #[pyclass] // This will be part of the module
+        struct Unit;
+    }
+}
+# }
+```
+It is possible to customize the `module` value for a `#[pymodule]` with the `#[pyo3(module = "MY_MODULE")]` option.
+
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/parallelism.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/parallelism.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/parallelism.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/parallelism.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,120 @@
+# Parallelism
+
+CPython has the infamous [Global Interpreter Lock](https://docs.python.org/3/glossary.html#term-global-interpreter-lock), which prevents several threads from executing Python bytecode in parallel. This makes threading in Python a bad fit for [CPU-bound](https://en.wikipedia.org/wiki/CPU-bound) tasks and often forces developers to accept the overhead of multiprocessing.
+
+In PyO3 parallelism can be easily achieved in Rust-only code. Let's take a look at our [word-count](https://github.com/PyO3/pyo3/blob/main/examples/word-count/src/lib.rs) example, where we have a `search` function that utilizes the [rayon](https://github.com/rayon-rs/rayon) crate to count words in parallel.
+```rust,no_run
+# #![allow(dead_code)]
+use pyo3::prelude::*;
+
+// These traits let us use `par_lines` and `map`.
+use rayon::str::ParallelString;
+use rayon::iter::ParallelIterator;
+
+/// Count the occurrences of needle in line, case insensitive
+fn count_line(line: &str, needle: &str) -> usize {
+    let mut total = 0;
+    for word in line.split(' ') {
+        if word == needle {
+            total += 1;
+        }
+    }
+    total
+}
+
+#[pyfunction]
+fn search(contents: &str, needle: &str) -> usize {
+    contents
+        .par_lines()
+        .map(|line| count_line(line, needle))
+        .sum()
+}
+```
+
+But let's assume you have a long running Rust function which you would like to execute several times in parallel. For the sake of example let's take a sequential version of the word count:
+```rust,no_run
+# #![allow(dead_code)]
+# fn count_line(line: &str, needle: &str) -> usize {
+#     let mut total = 0;
+#     for word in line.split(' ') {
+#         if word == needle {
+#             total += 1;
+#         }
+#     }
+#     total
+# }
+#
+fn search_sequential(contents: &str, needle: &str) -> usize {
+    contents.lines().map(|line| count_line(line, needle)).sum()
+}
+```
+
+To enable parallel execution of this function, the [`Python::allow_threads`] method can be used to temporarily release the GIL, thus allowing other Python threads to run. We then have a function exposed to the Python runtime which calls `search_sequential` inside a closure passed to [`Python::allow_threads`] to enable true parallelism:
+```rust,no_run
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+#
+# fn count_line(line: &str, needle: &str) -> usize {
+#     let mut total = 0;
+#     for word in line.split(' ') {
+#         if word == needle {
+#             total += 1;
+#         }
+#     }
+#     total
+# }
+#
+# fn search_sequential(contents: &str, needle: &str) -> usize {
+#    contents.lines().map(|line| count_line(line, needle)).sum()
+# }
+#[pyfunction]
+fn search_sequential_allow_threads(py: Python<'_>, contents: &str, needle: &str) -> usize {
+    py.allow_threads(|| search_sequential(contents, needle))
+}
+```
+
+Now Python threads can use more than one CPU core, resolving the limitation which usually makes multi-threading in Python only good for IO-bound tasks:
+```Python
+from concurrent.futures import ThreadPoolExecutor
+from word_count import search_sequential_allow_threads
+
+executor = ThreadPoolExecutor(max_workers=2)
+
+future_1 = executor.submit(
+    word_count.search_sequential_allow_threads, contents, needle
+)
+future_2 = executor.submit(
+    word_count.search_sequential_allow_threads, contents, needle
+)
+result_1 = future_1.result()
+result_2 = future_2.result()
+```
+
+## Benchmark
+
+Let's benchmark the `word-count` example to verify that we really did unlock parallelism with PyO3.
+
+We are using `pytest-benchmark` to benchmark four word count functions:
+
+1. Pure Python version
+2. Rust parallel version
+3. Rust sequential version
+4. Rust sequential version executed twice with two Python threads
+
+The benchmark script can be found [here](https://github.com/PyO3/pyo3/blob/main/examples/word-count/tests/test_word_count.py), and we can run `nox` in the `word-count` folder to benchmark these functions.
+
+While the results of the benchmark of course depend on your machine, the relative results should be similar to this (mid 2020):
+```text
+-------------------------------------------------------------------------------------------------- benchmark: 4 tests -------------------------------------------------------------------------------------------------
+Name (time in ms)                                          Min                Max               Mean            StdDev             Median               IQR            Outliers       OPS            Rounds  Iterations
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+test_word_count_rust_parallel                           1.7315 (1.0)       4.6495 (1.0)       1.9972 (1.0)      0.4299 (1.0)       1.8142 (1.0)      0.2049 (1.0)         40;46  500.6943 (1.0)         375           1
+test_word_count_rust_sequential                         7.3348 (4.24)     10.3556 (2.23)      8.0035 (4.01)     0.7785 (1.81)      7.5597 (4.17)     0.8641 (4.22)         26;5  124.9457 (0.25)        121           1
+test_word_count_rust_sequential_twice_with_threads      7.9839 (4.61)     10.3065 (2.22)      8.4511 (4.23)     0.4709 (1.10)      8.2457 (4.55)     0.3927 (1.92)        17;17  118.3274 (0.24)        114           1
+test_word_count_python_sequential                      27.3985 (15.82)    45.4527 (9.78)     28.9604 (14.50)    4.1449 (9.64)     27.5781 (15.20)    0.4638 (2.26)          3;5   34.5299 (0.07)         35           1
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+```
+
+You can see that the Python threaded version is not much slower than the Rust sequential version, which means compared to an execution on a single CPU core the speed has doubled.
+
+[`Python::allow_threads`]: {{#PYO3_DOCS_URL}}/pyo3/marker/struct.Python.html#method.allow_threads
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/performance.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/performance.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/performance.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/performance.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,142 @@
+# Performance
+
+To achieve the best possible performance, it is useful to be aware of several tricks and sharp edges concerning PyO3's API.
+
+## `extract` versus `downcast`
+
+Pythonic API implemented using PyO3 are often polymorphic, i.e. they will accept `&Bound<'_, PyAny>` and try to turn this into multiple more concrete types to which the requested operation is applied. This often leads to chains of calls to `extract`, e.g.
+
+```rust
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+# use pyo3::{exceptions::PyTypeError, types::PyList};
+
+fn frobnicate_list<'py>(list: &Bound<'_, PyList>) -> PyResult<Bound<'py, PyAny>> {
+    todo!()
+}
+
+fn frobnicate_vec<'py>(vec: Vec<Bound<'py, PyAny>>) -> PyResult<Bound<'py, PyAny>> {
+    todo!()
+}
+
+#[pyfunction]
+fn frobnicate<'py>(value: &Bound<'py, PyAny>) -> PyResult<Bound<'py, PyAny>> {
+    if let Ok(list) = value.extract::<Bound<'_, PyList>>() {
+        frobnicate_list(&list)
+    } else if let Ok(vec) = value.extract::<Vec<Bound<'_, PyAny>>>() {
+        frobnicate_vec(vec)
+    } else {
+        Err(PyTypeError::new_err("Cannot frobnicate that type."))
+    }
+}
+```
+
+This suboptimal as the `FromPyObject<T>` trait requires `extract` to have a `Result<T, PyErr>` return type. For native types like `PyList`, it faster to use `downcast` (which `extract` calls internally) when the error value is ignored. This avoids the costly conversion of a `PyDowncastError` to a `PyErr` required to fulfil the `FromPyObject` contract, i.e.
+
+```rust
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+# use pyo3::{exceptions::PyTypeError, types::PyList};
+# fn frobnicate_list<'py>(list: &Bound<'_, PyList>) -> PyResult<Bound<'py, PyAny>> { todo!() }
+# fn frobnicate_vec<'py>(vec: Vec<Bound<'py, PyAny>>) -> PyResult<Bound<'py, PyAny>> { todo!() }
+#
+#[pyfunction]
+fn frobnicate<'py>(value: &Bound<'py, PyAny>) -> PyResult<Bound<'py, PyAny>> {
+    // Use `downcast` instead of `extract` as turning `PyDowncastError` into `PyErr` is quite costly.
+    if let Ok(list) = value.downcast::<PyList>() {
+        frobnicate_list(list)
+    } else if let Ok(vec) = value.extract::<Vec<Bound<'_, PyAny>>>() {
+        frobnicate_vec(vec)
+    } else {
+        Err(PyTypeError::new_err("Cannot frobnicate that type."))
+    }
+}
+```
+
+## Access to Bound implies access to GIL token
+
+Calling `Python::with_gil` is effectively a no-op when the GIL is already held, but checking that this is the case still has a cost. If an existing GIL token can not be accessed, for example when implementing a pre-existing trait, but a GIL-bound reference is available, this cost can be avoided by exploiting that access to GIL-bound reference gives zero-cost access to a GIL token via `Bound::py`.
+
+For example, instead of writing
+
+```rust
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+# use pyo3::types::PyList;
+
+struct Foo(Py<PyList>);
+
+struct FooBound<'py>(Bound<'py, PyList>);
+
+impl PartialEq<Foo> for FooBound<'_> {
+    fn eq(&self, other: &Foo) -> bool {
+        Python::with_gil(|py| {
+            let len = other.0.bind(py).len();
+            self.0.len() == len
+        })
+    }
+}
+```
+
+use the more efficient
+
+```rust
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+# use pyo3::types::PyList;
+# struct Foo(Py<PyList>);
+# struct FooBound<'py>(Bound<'py, PyList>);
+#
+impl PartialEq<Foo> for FooBound<'_> {
+    fn eq(&self, other: &Foo) -> bool {
+        // Access to `&Bound<'py, PyAny>` implies access to `Python<'py>`.
+        let py = self.0.py();
+        let len = other.0.bind(py).len();
+        self.0.len() == len
+    }
+}
+```
+
+## Disable the global reference pool
+
+PyO3 uses global mutable state to keep track of deferred reference count updates implied by `impl<T> Drop for Py<T>` being called without the GIL being held. The necessary synchronization to obtain and apply these reference count updates when PyO3-based code next acquires the GIL is somewhat expensive and can become a significant part of the cost of crossing the Python-Rust boundary.
+
+This functionality can be avoided by setting the `pyo3_disable_reference_pool` conditional compilation flag. This removes the global reference pool and the associated costs completely. However, it does _not_ remove the `Drop` implementation for `Py<T>` which is necessary to interoperate with existing Rust code written without PyO3-based code in mind. To stay compatible with the wider Rust ecosystem in these cases, we keep the implementation but abort when `Drop` is called without the GIL being held. If `pyo3_leak_on_drop_without_reference_pool` is additionally enabled, objects dropped without the GIL being held will be leaked instead which is always sound but might have determinal effects like resource exhaustion in the long term.
+
+This limitation is important to keep in mind when this setting is used, especially when embedding Python code into a Rust application as it is quite easy to accidentally drop a `Py<T>` (or types containing it like `PyErr`, `PyBackedStr` or `PyBackedBytes`) returned from `Python::with_gil` without making sure to re-acquire the GIL beforehand. For example, the following code
+
+```rust,ignore
+# use pyo3::prelude::*;
+# use pyo3::types::PyList;
+let numbers: Py<PyList> = Python::with_gil(|py| PyList::empty_bound(py).unbind());
+
+Python::with_gil(|py| {
+    numbers.bind(py).append(23).unwrap();
+});
+
+Python::with_gil(|py| {
+    numbers.bind(py).append(42).unwrap();
+});
+```
+
+will abort if the list not explicitly disposed via
+
+```rust
+# use pyo3::prelude::*;
+# use pyo3::types::PyList;
+let numbers: Py<PyList> = Python::with_gil(|py| PyList::empty_bound(py).unbind());
+
+Python::with_gil(|py| {
+    numbers.bind(py).append(23).unwrap();
+});
+
+Python::with_gil(|py| {
+    numbers.bind(py).append(42).unwrap();
+});
+
+Python::with_gil(move |py| {
+    drop(numbers);
+});
+```
+
+[conditional-compilation]: https://doc.rust-lang.org/reference/conditional-compilation.html
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/python-from-rust/calling-existing-code.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/python-from-rust/calling-existing-code.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/python-from-rust/calling-existing-code.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/python-from-rust/calling-existing-code.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,397 @@
+# Executing existing Python code
+
+If you already have some existing Python code that you need to execute from Rust, the following FAQs can help you select the right PyO3 functionality for your situation:
+
+## Want to access Python APIs? Then use `PyModule::import_bound`.
+
+[`PyModule::import_bound`]({{#PYO3_DOCS_URL}}/pyo3/types/struct.PyModule.html#method.import_bound) can
+be used to get handle to a Python module from Rust. You can use this to import and use any Python
+module available in your environment.
+
+```rust
+use pyo3::prelude::*;
+
+fn main() -> PyResult<()> {
+    Python::with_gil(|py| {
+        let builtins = PyModule::import_bound(py, "builtins")?;
+        let total: i32 = builtins
+            .getattr("sum")?
+            .call1((vec![1, 2, 3],))?
+            .extract()?;
+        assert_eq!(total, 6);
+        Ok(())
+    })
+}
+```
+
+## Want to run just an expression? Then use `eval_bound`.
+
+[`Python::eval_bound`]({{#PYO3_DOCS_URL}}/pyo3/marker/struct.Python.html#method.eval_bound) is
+a method to execute a [Python expression](https://docs.python.org/3.7/reference/expressions.html)
+and return the evaluated value as a `Bound<'py, PyAny>` object.
+
+```rust
+use pyo3::prelude::*;
+
+# fn main() -> Result<(), ()> {
+Python::with_gil(|py| {
+    let result = py
+        .eval_bound("[i * 10 for i in range(5)]", None, None)
+        .map_err(|e| {
+            e.print_and_set_sys_last_vars(py);
+        })?;
+    let res: Vec<i64> = result.extract().unwrap();
+    assert_eq!(res, vec![0, 10, 20, 30, 40]);
+    Ok(())
+})
+# }
+```
+
+## Want to run statements? Then use `run_bound`.
+
+[`Python::run_bound`] is a method to execute one or more
+[Python statements](https://docs.python.org/3.7/reference/simple_stmts.html).
+This method returns nothing (like any Python statement), but you can get
+access to manipulated objects via the `locals` dict.
+
+You can also use the [`py_run!`] macro, which is a shorthand for [`Python::run_bound`].
+Since [`py_run!`] panics on exceptions, we recommend you use this macro only for
+quickly testing your Python extensions.
+
+```rust
+use pyo3::prelude::*;
+use pyo3::py_run;
+
+# fn main() {
+#[pyclass]
+struct UserData {
+    id: u32,
+    name: String,
+}
+
+#[pymethods]
+impl UserData {
+    fn as_tuple(&self) -> (u32, String) {
+        (self.id, self.name.clone())
+    }
+
+    fn __repr__(&self) -> PyResult<String> {
+        Ok(format!("User {}(id: {})", self.name, self.id))
+    }
+}
+
+Python::with_gil(|py| {
+    let userdata = UserData {
+        id: 34,
+        name: "Yu".to_string(),
+    };
+    let userdata = Py::new(py, userdata).unwrap();
+    let userdata_as_tuple = (34, "Yu");
+    py_run!(py, userdata userdata_as_tuple, r#"
+assert repr(userdata) == "User Yu(id: 34)"
+assert userdata.as_tuple() == userdata_as_tuple
+    "#);
+})
+# }
+```
+
+## You have a Python file or code snippet? Then use `PyModule::from_code_bound`.
+
+[`PyModule::from_code_bound`]({{#PYO3_DOCS_URL}}/pyo3/types/struct.PyModule.html#method.from_code_bound)
+can be used to generate a Python module which can then be used just as if it was imported with
+`PyModule::import`.
+
+**Warning**: This will compile and execute code. **Never** pass untrusted code
+to this function!
+
+```rust
+use pyo3::{prelude::*, types::IntoPyDict};
+
+# fn main() -> PyResult<()> {
+Python::with_gil(|py| {
+    let activators = PyModule::from_code_bound(
+        py,
+        r#"
+def relu(x):
+    """see https://en.wikipedia.org/wiki/Rectifier_(neural_networks)"""
+    return max(0.0, x)
+
+def leaky_relu(x, slope=0.01):
+    return x if x >= 0 else x * slope
+    "#,
+        "activators.py",
+        "activators",
+    )?;
+
+    let relu_result: f64 = activators.getattr("relu")?.call1((-1.0,))?.extract()?;
+    assert_eq!(relu_result, 0.0);
+
+    let kwargs = [("slope", 0.2)].into_py_dict_bound(py);
+    let lrelu_result: f64 = activators
+        .getattr("leaky_relu")?
+        .call((-1.0,), Some(&kwargs))?
+        .extract()?;
+    assert_eq!(lrelu_result, -0.2);
+#    Ok(())
+})
+# }
+```
+
+## Want to embed Python in Rust with additional modules?
+
+Python maintains the `sys.modules` dict as a cache of all imported modules.
+An import in Python will first attempt to lookup the module from this dict,
+and if not present will use various strategies to attempt to locate and load
+the module.
+
+The [`append_to_inittab`]({{#PYO3_DOCS_URL}}/pyo3/macro.append_to_inittab.html)
+macro can be used to add additional `#[pymodule]` modules to an embedded
+Python interpreter. The macro **must** be invoked _before_ initializing Python.
+
+As an example, the below adds the module `foo` to the embedded interpreter:
+
+```rust
+use pyo3::prelude::*;
+
+#[pyfunction]
+fn add_one(x: i64) -> i64 {
+    x + 1
+}
+
+#[pymodule]
+fn foo(foo_module: &Bound<'_, PyModule>) -> PyResult<()> {
+    foo_module.add_function(wrap_pyfunction!(add_one, foo_module)?)?;
+    Ok(())
+}
+
+fn main() -> PyResult<()> {
+    pyo3::append_to_inittab!(foo);
+    Python::with_gil(|py| Python::run_bound(py, "import foo; foo.add_one(6)", None, None))
+}
+```
+
+If `append_to_inittab` cannot be used due to constraints in the program,
+an alternative is to create a module using [`PyModule::new_bound`]
+and insert it manually into `sys.modules`:
+
+```rust
+use pyo3::prelude::*;
+use pyo3::types::PyDict;
+
+#[pyfunction]
+pub fn add_one(x: i64) -> i64 {
+    x + 1
+}
+
+fn main() -> PyResult<()> {
+    Python::with_gil(|py| {
+        // Create new module
+        let foo_module = PyModule::new_bound(py, "foo")?;
+        foo_module.add_function(wrap_pyfunction!(add_one, &foo_module)?)?;
+
+        // Import and get sys.modules
+        let sys = PyModule::import_bound(py, "sys")?;
+        let py_modules: Bound<'_, PyDict> = sys.getattr("modules")?.downcast_into()?;
+
+        // Insert foo into sys.modules
+        py_modules.set_item("foo", foo_module)?;
+
+        // Now we can import + run our python code
+        Python::run_bound(py, "import foo; foo.add_one(6)", None, None)
+    })
+}
+```
+
+## Include multiple Python files
+
+You can include a file at compile time by using
+[`std::include_str`](https://doc.rust-lang.org/std/macro.include_str.html) macro.
+
+Or you can load a file at runtime by using
+[`std::fs::read_to_string`](https://doc.rust-lang.org/std/fs/fn.read_to_string.html) function.
+
+Many Python files can be included and loaded as modules. If one file depends on
+another you must preserve correct order while declaring `PyModule`.
+
+Example directory structure:
+```text
+.
+├── Cargo.lock
+├── Cargo.toml
+├── python_app
+│   ├── app.py
+│   └── utils
+│       └── foo.py
+└── src
+    └── main.rs
+```
+
+`python_app/app.py`:
+```python
+from utils.foo import bar
+
+
+def run():
+    return bar()
+```
+
+`python_app/utils/foo.py`:
+```python
+def bar():
+    return "baz"
+```
+
+The example below shows:
+* how to include content of `app.py` and `utils/foo.py` into your rust binary
+* how to call function `run()` (declared in `app.py`) that needs function
+  imported from `utils/foo.py`
+
+`src/main.rs`:
+```rust,ignore
+use pyo3::prelude::*;
+
+fn main() -> PyResult<()> {
+    let py_foo = include_str!(concat!(
+        env!("CARGO_MANIFEST_DIR"),
+        "/python_app/utils/foo.py"
+    ));
+    let py_app = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/python_app/app.py"));
+    let from_python = Python::with_gil(|py| -> PyResult<Py<PyAny>> {
+        PyModule::from_code_bound(py, py_foo, "utils.foo", "utils.foo")?;
+        let app: Py<PyAny> = PyModule::from_code_bound(py, py_app, "", "")?
+            .getattr("run")?
+            .into();
+        app.call0(py)
+    });
+
+    println!("py: {}", from_python?);
+    Ok(())
+}
+```
+
+The example below shows:
+* how to load content of `app.py` at runtime so that it sees its dependencies
+  automatically
+* how to call function `run()` (declared in `app.py`) that needs function
+  imported from `utils/foo.py`
+
+It is recommended to use absolute paths because then your binary can be run
+from anywhere as long as your `app.py` is in the expected directory (in this example
+that directory is `/usr/share/python_app`).
+
+`src/main.rs`:
+```rust,no_run
+use pyo3::prelude::*;
+use pyo3::types::PyList;
+use std::fs;
+use std::path::Path;
+
+fn main() -> PyResult<()> {
+    let path = Path::new("/usr/share/python_app");
+    let py_app = fs::read_to_string(path.join("app.py"))?;
+    let from_python = Python::with_gil(|py| -> PyResult<Py<PyAny>> {
+        let syspath = py
+            .import_bound("sys")?
+            .getattr("path")?
+            .downcast_into::<PyList>()?;
+        syspath.insert(0, &path)?;
+        let app: Py<PyAny> = PyModule::from_code_bound(py, &py_app, "", "")?
+            .getattr("run")?
+            .into();
+        app.call0(py)
+    });
+
+    println!("py: {}", from_python?);
+    Ok(())
+}
+```
+
+
+[`Python::run`]: {{#PYO3_DOCS_URL}}/pyo3/marker/struct.Python.html#method.run
+[`py_run!`]: {{#PYO3_DOCS_URL}}/pyo3/macro.py_run.html
+
+## Need to use a context manager from Rust?
+
+Use context managers by directly invoking `__enter__` and `__exit__`.
+
+```rust
+use pyo3::prelude::*;
+
+fn main() {
+    Python::with_gil(|py| {
+        let custom_manager = PyModule::from_code_bound(
+            py,
+            r#"
+class House(object):
+    def __init__(self, address):
+        self.address = address
+    def __enter__(self):
+        print(f"Welcome to {self.address}!")
+    def __exit__(self, type, value, traceback):
+        if type:
+            print(f"Sorry you had {type} trouble at {self.address}")
+        else:
+            print(f"Thank you for visiting {self.address}, come again soon!")
+
+        "#,
+            "house.py",
+            "house",
+        )
+        .unwrap();
+
+        let house_class = custom_manager.getattr("House").unwrap();
+        let house = house_class.call1(("123 Main Street",)).unwrap();
+
+        house.call_method0("__enter__").unwrap();
+
+        let result = py.eval_bound("undefined_variable + 1", None, None);
+
+        // If the eval threw an exception we'll pass it through to the context manager.
+        // Otherwise, __exit__  is called with empty arguments (Python "None").
+        match result {
+            Ok(_) => {
+                let none = py.None();
+                house
+                    .call_method1("__exit__", (&none, &none, &none))
+                    .unwrap();
+            }
+            Err(e) => {
+                house
+                    .call_method1(
+                        "__exit__",
+                        (
+                            e.get_type_bound(py),
+                            e.value_bound(py),
+                            e.traceback_bound(py),
+                        ),
+                    )
+                    .unwrap();
+            }
+        }
+    })
+}
+```
+
+## Handling system signals/interrupts (Ctrl-C)
+
+The best way to handle system signals when running Rust code is to periodically call `Python::check_signals` to handle any signals captured by Python's signal handler. See also [the FAQ entry](../faq.md#ctrl-c-doesnt-do-anything-while-my-rust-code-is-executing).
+
+Alternatively, set Python's `signal` module to take the default action for a signal:
+
+```rust
+use pyo3::prelude::*;
+
+# fn main() -> PyResult<()> {
+Python::with_gil(|py| -> PyResult<()> {
+    let signal = py.import_bound("signal")?;
+    // Set SIGINT to have the default action
+    signal
+        .getattr("signal")?
+        .call1((signal.getattr("SIGINT")?, signal.getattr("SIG_DFL")?))?;
+    Ok(())
+})
+# }
+```
+
+
+[`PyModule::new_bound`]: {{#PYO3_DOCS_URL}}/pyo3/types/struct.PyModule.html#method.new_bound
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/python-from-rust/function-calls.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/python-from-rust/function-calls.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/python-from-rust/function-calls.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/python-from-rust/function-calls.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,114 @@
+# Calling Python functions
+
+The `Bound<'py, T>` smart pointer (such as `Bound<'py, PyAny>`, `Bound<'py, PyList>`, or `Bound<'py, MyClass>`) can be used to call Python functions.
+
+PyO3 offers two APIs to make function calls:
+
+* [`call`]({{#PYO3_DOCS_URL}}/pyo3/types/trait.PyAnyMethods.html#tymethod.call) - call any callable Python object.
+* [`call_method`]({{#PYO3_DOCS_URL}}/pyo3/types/trait.PyAnyMethods.html#tymethod.call_method) - call a method on the Python object.
+
+Both of these APIs take `args` and `kwargs` arguments (for positional and keyword arguments respectively). There are variants for less complex calls:
+
+* [`call1`]({{#PYO3_DOCS_URL}}/pyo3/types/trait.PyAnyMethods.html#tymethod.call1) and [`call_method1`]({{#PYO3_DOCS_URL}}/pyo3/types/trait.PyAnyMethods.html#tymethod.call_method1) to call only with positional `args`.
+* [`call0`]({{#PYO3_DOCS_URL}}/pyo3/types/trait.PyAnyMethods.html#tymethod.call0) and [`call_method0`]({{#PYO3_DOCS_URL}}/pyo3/types/trait.PyAnyMethods.html#tymethod.call_method0) to call with no arguments.
+
+For convenience the [`Py<T>`](../types.md#pyt-and-pyobject) smart pointer also exposes these same six API methods, but needs a `Python` token as an additional first argument to prove the GIL is held.
+
+The example below calls a Python function behind a `PyObject` (aka `Py<PyAny>`) reference:
+
+```rust
+use pyo3::prelude::*;
+use pyo3::types::PyTuple;
+
+fn main() -> PyResult<()> {
+    let arg1 = "arg1";
+    let arg2 = "arg2";
+    let arg3 = "arg3";
+
+    Python::with_gil(|py| {
+        let fun: Py<PyAny> = PyModule::from_code_bound(
+            py,
+            "def example(*args, **kwargs):
+                if args != ():
+                    print('called with args', args)
+                if kwargs != {}:
+                    print('called with kwargs', kwargs)
+                if args == () and kwargs == {}:
+                    print('called with no arguments')",
+            "",
+            "",
+        )?
+        .getattr("example")?
+        .into();
+
+        // call object without any arguments
+        fun.call0(py)?;
+
+        // pass object with Rust tuple of positional arguments
+        let args = (arg1, arg2, arg3);
+        fun.call1(py, args)?;
+
+        // call object with Python tuple of positional arguments
+        let args = PyTuple::new_bound(py, &[arg1, arg2, arg3]);
+        fun.call1(py, args)?;
+        Ok(())
+    })
+}
+```
+
+## Creating keyword arguments
+
+For the `call` and `call_method` APIs, `kwargs` are `Option<&Bound<'py, PyDict>>`, so can either be `None` or `Some(&dict)`. You can use the [`IntoPyDict`]({{#PYO3_DOCS_URL}}/pyo3/types/trait.IntoPyDict.html) trait to convert other dict-like containers, e.g. `HashMap` or `BTreeMap`, as well as tuples with up to 10 elements and `Vec`s where each element is a two-element tuple.
+
+```rust
+use pyo3::prelude::*;
+use pyo3::types::IntoPyDict;
+use std::collections::HashMap;
+
+fn main() -> PyResult<()> {
+    let key1 = "key1";
+    let val1 = 1;
+    let key2 = "key2";
+    let val2 = 2;
+
+    Python::with_gil(|py| {
+        let fun: Py<PyAny> = PyModule::from_code_bound(
+            py,
+            "def example(*args, **kwargs):
+                if args != ():
+                    print('called with args', args)
+                if kwargs != {}:
+                    print('called with kwargs', kwargs)
+                if args == () and kwargs == {}:
+                    print('called with no arguments')",
+            "",
+            "",
+        )?
+        .getattr("example")?
+        .into();
+
+        // call object with PyDict
+        let kwargs = [(key1, val1)].into_py_dict_bound(py);
+        fun.call_bound(py, (), Some(&kwargs))?;
+
+        // pass arguments as Vec
+        let kwargs = vec![(key1, val1), (key2, val2)];
+        fun.call_bound(py, (), Some(&kwargs.into_py_dict_bound(py)))?;
+
+        // pass arguments as HashMap
+        let mut kwargs = HashMap::<&str, i32>::new();
+        kwargs.insert(key1, 1);
+        fun.call_bound(py, (), Some(&kwargs.into_py_dict_bound(py)))?;
+
+        Ok(())
+    })
+}
+```
+
+<div class="warning">
+
+During PyO3's [migration from "GIL Refs" to the `Bound<T>` smart pointer](../migration.md#migrating-from-the-gil-refs-api-to-boundt), `Py<T>::call` is temporarily named [`Py<T>::call_bound`]({{#PYO3_DOCS_URL}}/pyo3/struct.Py.html#method.call_bound) (and `call_method` is temporarily `call_method_bound`).
+
+(This temporary naming is only the case for the `Py<T>` smart pointer. The methods on the `&PyAny` GIL Ref such as `call` have not been given replacements, and the methods on the `Bound<PyAny>` smart pointer such as [`Bound<PyAny>::call`]({{#PYO3_DOCS_URL}}/pyo3/types/trait.PyAnyMethods.html#tymethod.call) already use follow the newest API conventions.)
+
+</div>
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/python-from-rust.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/python-from-rust.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/python-from-rust.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/python-from-rust.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,46 @@
+# Calling Python in Rust code
+
+This chapter of the guide documents some ways to interact with Python code from Rust.
+
+Below is an introduction to the `'py` lifetime and some general remarks about how PyO3's API reasons about Python code.
+
+The subchapters also cover the following topics:
+ - Python object types available in PyO3's API
+ - How to work with Python exceptions
+ - How to call Python functions
+ - How to execute existing Python code
+
+## The `'py` lifetime
+
+To safely interact with the Python interpreter a Rust thread must have a corresponding Python thread state and hold the [Global Interpreter Lock (GIL)](#the-global-interpreter-lock). PyO3 has a `Python<'py>` token that is used to prove that these conditions
+are met. Its lifetime `'py` is a central part of PyO3's API.
+
+The `Python<'py>` token serves three purposes:
+
+* It provides global APIs for the Python interpreter, such as [`py.eval_bound()`][eval] and [`py.import_bound()`][import].
+* It can be passed to functions that require a proof of holding the GIL, such as [`Py::clone_ref`][clone_ref].
+* Its lifetime `'py` is used to bind many of PyO3's types to the Python interpreter, such as [`Bound<'py, T>`][Bound].
+
+PyO3's types that are bound to the `'py` lifetime, for example `Bound<'py, T>`, all contain a `Python<'py>` token. This means they have full access to the Python interpreter and offer a complete API for interacting with Python objects.
+
+Consult [PyO3's API documentation][obtaining-py] to learn how to acquire one of these tokens.
+
+### The Global Interpreter Lock
+
+Concurrent programming in Python is aided by the Global Interpreter Lock (GIL), which ensures that only one Python thread can use the Python interpreter and its API at the same time. This allows it to be used to synchronize code. See the [`pyo3::sync`] module for synchronization tools PyO3 offers that are based on the GIL's guarantees.
+
+Non-Python operations (system calls and native Rust code) can unlock the GIL. See [the section on parallelism](parallelism.md) for how to do that using PyO3's API.
+
+## Python's memory model
+
+Python's memory model differs from Rust's memory model in two key ways:
+- There is no concept of ownership; all Python objects are shared and usually implemented via reference counting
+- There is no concept of exclusive (`&mut`) references; any reference can mutate a Python object
+
+PyO3's API reflects this by providing [smart pointer][smart-pointers] types, `Py<T>`, `Bound<'py, T>`, and (the very rarely used) `Borrowed<'a, 'py, T>`. These smart pointers all use Python reference counting. See the [subchapter on types](./types.md) for more detail on these types.
+
+Because of the lack of exclusive `&mut` references, PyO3's APIs for Python objects, for example [`PyListMethods::append`], use shared references. This is safe because Python objects have internal mechanisms to prevent data races (as of time of writing, the Python GIL).
+
+[smart-pointers]: https://doc.rust-lang.org/book/ch15-00-smart-pointers.html
+[obtaining-py]: {{#PYO3_DOCS_URL}}/pyo3/marker/struct.Python.html#obtaining-a-python-token
+[`pyo3::sync`]: {{#PYO3_DOCS_URL}}/pyo3/sync/index.html
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/python-typing-hints.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/python-typing-hints.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/python-typing-hints.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/python-typing-hints.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,167 @@
+# Typing and IDE hints for your Python package
+
+PyO3 provides an easy to use interface to code native Python libraries in Rust. The accompanying Maturin allows you to build and publish them as a package. Yet, for a better user experience, Python libraries should provide typing hints and documentation for all public entities, so that IDEs can show them during development and type analyzing tools such as `mypy` can use them to properly verify the code.
+
+Currently the best solution for the problem is to manually maintain `*.pyi` files and ship them along with the package.
+
+There is a sketch of a roadmap towards completing [the `experimental-inspect` feature](./features.md#experimental-inspect) which may eventually lead to automatic type annotations generated by PyO3. This needs more testing and implementation, please see [issue #2454](https://github.com/PyO3/pyo3/issues/2454).
+
+## Introduction to `pyi` files
+
+`pyi` files (an abbreviation for `Python Interface`) are called "stub files" in most of the documentation related to them. A very good definition of what it is can be found in [old MyPy documentation](https://github.com/python/mypy/wiki/Creating-Stubs-For-Python-Modules):
+
+> A stubs file only contains a description of the public interface of the module without any implementations.
+
+There is also [extensive documentation on type stubs on the official Python typing documentation](https://typing.readthedocs.io/en/latest/source/stubs.html).
+
+Most Python developers probably already encountered them when trying to use their IDE's "Go to Definition" function on any builtin type. For example, the definitions of a few standard exceptions look like this:
+
+```python
+class BaseException(object):
+    args: Tuple[Any, ...]
+    __cause__: BaseException | None
+    __context__: BaseException | None
+    __suppress_context__: bool
+    __traceback__: TracebackType | None
+    def __init__(self, *args: object) -> None: ...
+    def __str__(self) -> str: ...
+    def __repr__(self) -> str: ...
+    def with_traceback(self: _TBE, tb: TracebackType | None) -> _TBE: ...
+
+class SystemExit(BaseException):
+    code: int
+
+class Exception(BaseException): ...
+
+class StopIteration(Exception):
+    value: Any
+```
+
+As we can see, those are not full definitions containing implementation, but just a description of the interface. It is usually all that the user of the library needs.
+
+### What do the PEPs say?
+
+At the time of writing this documentation, the `pyi` files are referenced in three PEPs.
+
+[PEP8 - Style Guide for Python Code - #Function Annotations](https://www.python.org/dev/peps/pep-0008/#function-annotations) (last point) recommends all third party library creators to provide stub files as the source of knowledge about the package for type checker tools.
+
+> (...) it is expected that users of third party library packages may want to run type checkers over those packages. For this purpose [PEP 484](https://www.python.org/dev/peps/pep-0484) recommends the use of stub files: .pyi files that are read by the type checker in preference of the corresponding .py files. (...)
+
+[PEP484 - Type Hints - #Stub Files](https://www.python.org/dev/peps/pep-0484/#stub-files) defines stub files as follows.
+
+> Stub files are files containing type hints that are only for use by the type checker, not at runtime.
+
+It contains a specification for them (highly recommended reading, since it contains at least one thing that is not used in normal Python code) and also some general information about where to store the stub files.
+
+[PEP561 - Distributing and Packaging Type Information](https://www.python.org/dev/peps/pep-0561/) describes in detail how to build packages that will enable type checking. In particular it contains information about how the stub files must be distributed in order for type checkers to use them.
+
+## How to do it?
+
+[PEP561](https://www.python.org/dev/peps/pep-0561/) recognizes three ways of distributing type information:
+
+* `inline` - the typing is placed directly in source (`py`) files;
+* `separate package with stub files` - the typing is placed in `pyi` files distributed in their own, separate package;
+* `in-package stub files` - the typing is placed in `pyi` files distributed in the same package as source files.
+
+The first way is tricky with PyO3 since we do not have `py` files. When it has been investigated and necessary changes are implemented, this document will be updated.
+
+The second way is easy to do, and the whole work can be fully separated from the main library code. The example repo for the package with stub files can be found in [PEP561 references section](https://www.python.org/dev/peps/pep-0561/#references): [Stub package repository](https://github.com/ethanhs/stub-package)
+
+The third way is described below.
+
+### Including `pyi` files in your PyO3/Maturin build package
+
+When source files are in the same package as stub files, they should be placed next to each other. We need a way to do that with Maturin. Also, in order to mark our package as typing-enabled we need to add an empty file named `py.typed` to the package.
+
+#### If you do not have other Python files
+
+If you do not need to add any other Python files apart from `pyi` to the package, Maturin provides a way to do most of the work for you. As documented in the [Maturin Guide](https://github.com/PyO3/maturin/#mixed-rustpython-projects), the only thing you need to do is to create a stub file for your module named `<module_name>.pyi` in your project root and Maturin will do the rest.
+
+```text
+my-rust-project/
+├── Cargo.toml
+├── my_project.pyi  # <<< add type stubs for Rust functions in the my_project module here
+├── pyproject.toml
+└── src
+    └── lib.rs
+```
+
+For an example `pyi` file see the [`my_project.pyi` content](#my_projectpyi-content) section.
+
+#### If you need other Python files
+
+If you need to add other Python files apart from `pyi` to the package, you can do it also, but that requires some more work. Maturin provides an easy way to add files to a package ([documentation](https://github.com/PyO3/maturin/blob/0dee40510083c03607834c821eea76964140a126/Readme.md#mixed-rustpython-projects)). You just need to create a folder with the name of your module next to the `Cargo.toml` file (for customization see documentation linked above).
+
+The folder structure would be:
+
+```text
+my-project
+├── Cargo.toml
+├── my_project
+│   ├── __init__.py
+│   ├── my_project.pyi
+│   ├── other_python_file.py
+│   └── py.typed
+├── pyproject.toml
+├── Readme.md
+└── src
+    └── lib.rs
+```
+
+Let's go a little bit more into detail regarding the files inside the package folder.
+
+##### `__init__.py` content
+
+As we now specify our own package content, we have to provide the `__init__.py` file, so the folder is treated as a package and we can import things from it. We can always use the same content that Maturin creates for us if we do not specify a Python source folder. For PyO3 bindings it would be:
+
+```python
+from .my_project import *
+```
+
+That way everything that is exposed by our native module can be imported directly from the package.
+
+##### `py.typed` requirement
+
+As stated in [PEP561](https://www.python.org/dev/peps/pep-0561/):
+> Package maintainers who wish to support type checking of their code MUST add a marker file named py.typed to their package supporting typing. This marker applies recursively: if a top-level package includes it, all its sub-packages MUST support type checking as well.
+
+If we do not include that file, some IDEs might still use our `pyi` files to show hints, but the type checkers might not. MyPy will raise an error in this situation:
+
+```text
+error: Skipping analyzing "my_project": found module but no type hints or library stubs
+```
+
+The file is just a marker file, so it should be empty.
+
+##### `my_project.pyi` content
+
+Our module stub file. This document does not aim at describing how to write them, since you can find a lot of documentation on it, starting from the already quoted [PEP484](https://www.python.org/dev/peps/pep-0484/#stub-files).
+
+The example can look like this:
+
+```python
+class Car:
+    """
+    A class representing a car.
+
+    :param body_type: the name of body type, e.g. hatchback, sedan
+    :param horsepower: power of the engine in horsepower
+    """
+    def __init__(self, body_type: str, horsepower: int) -> None: ...
+
+    @classmethod
+    def from_unique_name(cls, name: str) -> 'Car':
+        """
+        Creates a Car based on unique name
+
+        :param name: model name of a car to be created
+        :return: a Car instance with default data
+        """
+
+    def best_color(self) -> str:
+        """
+        Gets the best color for the car.
+
+        :return: the name of the color our great algorithm thinks is the best for this car
+        """
+```
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/rust-from-python.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/rust-from-python.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/rust-from-python.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/rust-from-python.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,13 @@
+# Using Rust from Python
+
+This chapter of the guide is dedicated to explaining how to wrap Rust code into Python objects.
+
+PyO3 uses Rust's "procedural macros" to provide a powerful yet simple API to denote what Rust code should map into Python objects.
+
+The three types of Python objects which PyO3 can produce are:
+
+- Python modules, via the `#[pymodule]` macro
+- Python functions, via the `#[pyfunction]` macro
+- Python classes, via the `#[pyclass]` macro (plus `#[pymethods]` to define methods for those clases)
+
+The following subchapters go through each of these in turn.
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/trait-bounds.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/trait-bounds.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/trait-bounds.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/trait-bounds.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,555 @@
+# Using in Python a Rust function with trait bounds
+
+PyO3 allows for easy conversion from Rust to Python for certain functions and classes (see the [conversion table](conversions/tables.md)).
+However, it is not always straightforward to convert Rust code that requires a given trait implementation as an argument.
+
+This tutorial explains how to convert a Rust function that takes a trait as argument for use in Python with classes implementing the same methods as the trait.
+
+Why is this useful?
+
+### Pros
+- Make your Rust code available to Python users
+- Code complex algorithms in Rust with the help of the borrow checker
+
+### Cons
+- Not as fast as native Rust (type conversion has to be performed and one part of the code runs in Python)
+- You need to adapt your code to expose it
+
+## Example
+
+Let's work with the following basic example of an implementation of a optimization solver operating on a given model.
+
+Let's say we have a function `solve` that operates on a model and mutates its state.
+The argument of the function can be any model that implements the `Model` trait :
+
+```rust
+# #![allow(dead_code)]
+pub trait Model {
+    fn set_variables(&mut self, inputs: &Vec<f64>);
+    fn compute(&mut self);
+    fn get_results(&self) -> Vec<f64>;
+}
+
+pub fn solve<T: Model>(model: &mut T) {
+    println!("Magic solver that mutates the model into a resolved state");
+}
+```
+Let's assume we have the following constraints:
+- We cannot change that code as it runs on many Rust models.
+- We also have many Python models that cannot be solved as this solver is not available in that language.
+Rewriting it in Python would be cumbersome and error-prone, as everything is already available in Rust.
+
+How could we expose this solver to Python thanks to PyO3 ?
+
+## Implementation of the trait bounds for the Python class
+
+If a Python class implements the same three methods as the `Model` trait, it seems logical it could be adapted to use the solver.
+However, it is not possible to pass a `PyObject` to it as it does not implement the Rust trait (even if the Python model has the required methods).
+
+In order to implement the trait, we must write a wrapper around the calls in Rust to the Python model.
+The method signatures must be the same as the trait, keeping in mind that the Rust trait cannot be changed for the purpose of making the code available in Python.
+
+The Python model we want to expose is the following one, which already contains all the required methods:
+
+```python
+class Model:
+    def set_variables(self, inputs):
+        self.inputs = inputs
+    def compute(self):
+        self.results = [elt**2 - 3 for elt in self.inputs]
+    def get_results(self):
+        return self.results
+```
+
+The following wrapper will call the Python model from Rust, using a struct to hold the model as a `PyAny` object:
+
+```rust
+# #![allow(dead_code)]
+use pyo3::prelude::*;
+use pyo3::types::PyList;
+
+# pub trait Model {
+#   fn set_variables(&mut self, inputs: &Vec<f64>);
+#   fn compute(&mut self);
+#   fn get_results(&self) -> Vec<f64>;
+# }
+
+struct UserModel {
+    model: Py<PyAny>,
+}
+
+impl Model for UserModel {
+    fn set_variables(&mut self, var: &Vec<f64>) {
+        println!("Rust calling Python to set the variables");
+        Python::with_gil(|py| {
+            self.model
+                .bind(py)
+                .call_method("set_variables", (PyList::new_bound(py, var),), None)
+                .unwrap();
+        })
+    }
+
+    fn get_results(&self) -> Vec<f64> {
+        println!("Rust calling Python to get the results");
+        Python::with_gil(|py| {
+            self.model
+                .bind(py)
+                .call_method("get_results", (), None)
+                .unwrap()
+                .extract()
+                .unwrap()
+        })
+    }
+
+    fn compute(&mut self) {
+        println!("Rust calling Python to perform the computation");
+        Python::with_gil(|py| {
+            self.model
+                .bind(py)
+                .call_method("compute", (), None)
+                .unwrap();
+        })
+    }
+}
+```
+
+Now that this bit is implemented, let's expose the model wrapper to Python.
+Let's add the PyO3 annotations and add a constructor:
+
+```rust
+# #![allow(dead_code)]
+# pub trait Model {
+#   fn set_variables(&mut self, inputs: &Vec<f64>);
+#   fn compute(&mut self);
+#   fn get_results(&self) -> Vec<f64>;
+# }
+# use pyo3::prelude::*;
+
+#[pyclass]
+struct UserModel {
+    model: Py<PyAny>,
+}
+
+#[pymodule]
+fn trait_exposure(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    m.add_class::<UserModel>()?;
+    Ok(())
+}
+
+#[pymethods]
+impl UserModel {
+    #[new]
+    pub fn new(model: Py<PyAny>) -> Self {
+        UserModel { model }
+    }
+}
+```
+
+Now we add the PyO3 annotations to the trait implementation:
+
+```rust,ignore
+#[pymethods]
+impl Model for UserModel {
+    // the previous trait implementation
+}
+```
+
+However, the previous code will not compile. The compilation error is the following one:
+`error: #[pymethods] cannot be used on trait impl blocks`
+
+That's a bummer!
+However, we can write a second wrapper around these functions to call them directly.
+This wrapper will also perform the type conversions between Python and Rust.
+
+```rust
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+# use pyo3::types::PyList;
+#
+# pub trait Model {
+#   fn set_variables(&mut self, inputs: &Vec<f64>);
+#   fn compute(&mut self);
+#   fn get_results(&self) -> Vec<f64>;
+# }
+#
+# #[pyclass]
+# struct UserModel {
+#     model: Py<PyAny>,
+# }
+#
+# impl Model for UserModel {
+#  fn set_variables(&mut self, var: &Vec<f64>) {
+#      println!("Rust calling Python to set the variables");
+#      Python::with_gil(|py| {
+#          self.model.bind(py)
+#              .call_method("set_variables", (PyList::new_bound(py, var),), None)
+#              .unwrap();
+#      })
+#  }
+#
+#  fn get_results(&self) -> Vec<f64> {
+#      println!("Rust calling Python to get the results");
+#      Python::with_gil(|py| {
+#          self.model
+#              .bind(py)
+#              .call_method("get_results", (), None)
+#              .unwrap()
+#              .extract()
+#              .unwrap()
+#      })
+#  }
+#
+#  fn compute(&mut self) {
+#      println!("Rust calling Python to perform the computation");
+#      Python::with_gil(|py| {
+#          self.model
+#              .bind(py)
+#              .call_method("compute", (), None)
+#              .unwrap();
+#      })
+#
+#  }
+# }
+
+#[pymethods]
+impl UserModel {
+    pub fn set_variables(&mut self, var: Vec<f64>) {
+        println!("Set variables from Python calling Rust");
+        Model::set_variables(self, &var)
+    }
+
+    pub fn get_results(&mut self) -> Vec<f64> {
+        println!("Get results from Python calling Rust");
+        Model::get_results(self)
+    }
+
+    pub fn compute(&mut self) {
+        println!("Compute from Python calling Rust");
+        Model::compute(self)
+    }
+}
+```
+This wrapper handles the type conversion between the PyO3 requirements and the trait.
+In order to meet PyO3 requirements, this wrapper must:
+- return an object of type `PyResult`
+- use only values, not references in the method signatures
+
+Let's run the file python file:
+
+```python
+class Model:
+    def set_variables(self, inputs):
+        self.inputs = inputs
+    def compute(self):
+        self.results = [elt**2 - 3 for elt in self.inputs]
+    def get_results(self):
+        return self.results
+
+if __name__=="__main__":
+  import trait_exposure
+
+  myModel = Model()
+  my_rust_model = trait_exposure.UserModel(myModel)
+  my_rust_model.set_variables([2.0])
+  print("Print value from Python: ", myModel.inputs)
+  my_rust_model.compute()
+  print("Print value from Python through Rust: ", my_rust_model.get_results())
+  print("Print value directly from Python: ", myModel.get_results())
+```
+
+This outputs:
+
+```block
+Set variables from Python calling Rust
+Set variables from Rust calling Python
+Print value from Python:  [2.0]
+Compute from Python calling Rust
+Compute from Rust calling Python
+Get results from Python calling Rust
+Get results from Rust calling Python
+Print value from Python through Rust:  [1.0]
+Print value directly from Python:  [1.0]
+```
+
+We have now successfully exposed a Rust model that implements the `Model` trait to Python!
+
+We will now expose the `solve` function, but before, let's talk about types errors.
+
+## Type errors in Python
+
+What happens if you have type errors when using Python and how can you improve the error messages?
+
+
+### Wrong types in Python function arguments
+
+Let's assume in the first case that you will use in your Python file `my_rust_model.set_variables(2.0)` instead of `my_rust_model.set_variables([2.0])`.
+
+The Rust signature expects a vector, which corresponds to a list in Python.
+What happens if instead of a vector, we pass a single value ?
+
+At the execution of Python, we get :
+
+```block
+File "main.py", line 15, in <module>
+   my_rust_model.set_variables(2)
+TypeError
+```
+
+It is a type error and Python points to it, so it's easy to identify and solve.
+
+### Wrong types in Python method signatures
+
+Let's assume now that the return type of one of the methods of our Model class is wrong, for example the `get_results` method that is expected to return a `Vec<f64>` in Rust, a list in Python.
+
+```python
+class Model:
+    def set_variables(self, inputs):
+        self.inputs = inputs
+    def compute(self):
+        self.results = [elt**2 -3 for elt in self.inputs]
+    def get_results(self):
+        return self.results[0]
+        #return self.results <-- this is the expected output
+```
+
+This call results in the following panic:
+
+```block
+pyo3_runtime.PanicException: called `Result::unwrap()` on an `Err` value: PyErr { type: Py(0x10dcf79f0, PhantomData) }
+```
+
+This error code is not helpful for a Python user that does not know anything about Rust, or someone that does not know PyO3 was used to interface the Rust code.
+
+However, as we are responsible for making the Rust code available to Python, we can do something about it.
+
+The issue is that we called `unwrap` anywhere we could, and therefore any panic from PyO3 will be directly forwarded to the end user.
+
+Let's modify the code performing the type conversion to give a helpful error message to the Python user:
+
+We used in our `get_results` method the following call that performs the type conversion:
+
+```rust
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+# use pyo3::types::PyList;
+#
+# pub trait Model {
+#   fn set_variables(&mut self, inputs: &Vec<f64>);
+#   fn compute(&mut self);
+#   fn get_results(&self) -> Vec<f64>;
+# }
+#
+# #[pyclass]
+# struct UserModel {
+#     model: Py<PyAny>,
+# }
+
+impl Model for UserModel {
+    fn get_results(&self) -> Vec<f64> {
+        println!("Rust calling Python to get the results");
+        Python::with_gil(|py| {
+            self.model
+                .bind(py)
+                .call_method("get_results", (), None)
+                .unwrap()
+                .extract()
+                .unwrap()
+        })
+    }
+#     fn set_variables(&mut self, var: &Vec<f64>) {
+#         println!("Rust calling Python to set the variables");
+#         Python::with_gil(|py| {
+#             self.model.bind(py)
+#                 .call_method("set_variables", (PyList::new_bound(py, var),), None)
+#                 .unwrap();
+#         })
+#     }
+#
+#     fn compute(&mut self) {
+#         println!("Rust calling Python to perform the computation");
+#         Python::with_gil(|py| {
+#             self.model
+#                 .bind(py)
+#                 .call_method("compute", (), None)
+#                 .unwrap();
+#         })
+#     }
+}
+```
+
+Let's break it down in order to perform better error handling:
+
+```rust
+# #![allow(dead_code)]
+# use pyo3::prelude::*;
+# use pyo3::types::PyList;
+#
+# pub trait Model {
+#   fn set_variables(&mut self, inputs: &Vec<f64>);
+#   fn compute(&mut self);
+#   fn get_results(&self) -> Vec<f64>;
+# }
+#
+# #[pyclass]
+# struct UserModel {
+#     model: Py<PyAny>,
+# }
+
+impl Model for UserModel {
+    fn get_results(&self) -> Vec<f64> {
+        println!("Get results from Rust calling Python");
+        Python::with_gil(|py| {
+            let py_result: Bound<'_, PyAny> = self
+                .model
+                .bind(py)
+                .call_method("get_results", (), None)
+                .unwrap();
+
+            if py_result.get_type().name().unwrap() != "list" {
+                panic!(
+                    "Expected a list for the get_results() method signature, got {}",
+                    py_result.get_type().name().unwrap()
+                );
+            }
+            py_result.extract()
+        })
+        .unwrap()
+    }
+#     fn set_variables(&mut self, var: &Vec<f64>) {
+#         println!("Rust calling Python to set the variables");
+#         Python::with_gil(|py| {
+#             let py_model = self.model.bind(py)
+#                 .call_method("set_variables", (PyList::new_bound(py, var),), None)
+#                 .unwrap();
+#         })
+#     }
+#
+#     fn compute(&mut self) {
+#         println!("Rust calling Python to perform the computation");
+#         Python::with_gil(|py| {
+#             self.model
+#                 .bind(py)
+#                 .call_method("compute", (), None)
+#                 .unwrap();
+#         })
+#     }
+}
+```
+
+By doing so, you catch the result of the Python computation and check its type in order to be able to deliver a better error message before performing the unwrapping.
+
+Of course, it does not cover all the possible wrong outputs:
+the user could return a list of strings instead of a list of floats.
+In this case, a runtime panic would still occur due to PyO3, but with an error message much more difficult to decipher for non-rust user.
+
+It is up to the developer exposing the rust code to decide how much effort to invest into Python type error handling and improved error messages.
+
+## The final code
+
+Now let's expose the `solve()` function to make it available from Python.
+
+It is not possible to directly expose the `solve` function to Python, as the type conversion cannot be performed.
+It requires an object implementing the `Model` trait as input.
+
+However, the `UserModel` already implements this trait.
+Because of this, we can write a function wrapper that takes the `UserModel`--which has already been exposed to Python--as an argument in order to call the core function `solve`.
+
+It is also required to make the struct public.
+
+```rust
+# #![allow(dead_code)]
+use pyo3::prelude::*;
+use pyo3::types::PyList;
+
+pub trait Model {
+    fn set_variables(&mut self, var: &Vec<f64>);
+    fn get_results(&self) -> Vec<f64>;
+    fn compute(&mut self);
+}
+
+pub fn solve<T: Model>(model: &mut T) {
+    println!("Magic solver that mutates the model into a resolved state");
+}
+
+#[pyfunction]
+#[pyo3(name = "solve")]
+pub fn solve_wrapper(model: &mut UserModel) {
+    solve(model);
+}
+
+#[pyclass]
+pub struct UserModel {
+    model: Py<PyAny>,
+}
+
+#[pymodule]
+fn trait_exposure(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    m.add_class::<UserModel>()?;
+    m.add_function(wrap_pyfunction!(solve_wrapper, m)?)?;
+    Ok(())
+}
+
+#[pymethods]
+impl UserModel {
+    #[new]
+    pub fn new(model: Py<PyAny>) -> Self {
+        UserModel { model }
+    }
+
+    pub fn set_variables(&mut self, var: Vec<f64>) {
+        println!("Set variables from Python calling Rust");
+        Model::set_variables(self, &var)
+    }
+
+    pub fn get_results(&mut self) -> Vec<f64> {
+        println!("Get results from Python calling Rust");
+        Model::get_results(self)
+    }
+
+    pub fn compute(&mut self) {
+        Model::compute(self)
+    }
+}
+
+impl Model for UserModel {
+    fn set_variables(&mut self, var: &Vec<f64>) {
+        println!("Rust calling Python to set the variables");
+        Python::with_gil(|py| {
+            self.model
+                .bind(py)
+                .call_method("set_variables", (PyList::new_bound(py, var),), None)
+                .unwrap();
+        })
+    }
+
+    fn get_results(&self) -> Vec<f64> {
+        println!("Get results from Rust calling Python");
+        Python::with_gil(|py| {
+            let py_result: Bound<'_, PyAny> = self
+                .model
+                .bind(py)
+                .call_method("get_results", (), None)
+                .unwrap();
+
+            if py_result.get_type().name().unwrap() != "list" {
+                panic!(
+                    "Expected a list for the get_results() method signature, got {}",
+                    py_result.get_type().name().unwrap()
+                );
+            }
+            py_result.extract()
+        })
+        .unwrap()
+    }
+
+    fn compute(&mut self) {
+        println!("Rust calling Python to perform the computation");
+        Python::with_gil(|py| {
+            self.model
+                .bind(py)
+                .call_method("compute", (), None)
+                .unwrap();
+        })
+    }
+}
+```
diff -pruN 43.0.0-1/rust-vendor/pyo3/guide/src/types.md 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/types.md
--- 43.0.0-1/rust-vendor/pyo3/guide/src/types.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/guide/src/types.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,513 @@
+# Python object types
+
+PyO3 offers two main sets of types to interact with Python objects. This section of the guide expands into detail about these types and how to choose which to use.
+
+The first set of types are the [smart pointers][smart-pointers] which all Python objects are wrapped in. These are `Py<T>`, `Bound<'py, T>`, and `Borrowed<'a, 'py, T>`. The [first section below](#pyo3s-smart-pointers) expands on each of these in detail and why there are three of them.
+
+The second set of types are types which fill in the generic parameter `T` of the smart pointers. The most common is `PyAny`, which represents any Python object (similar to Python's `typing.Any`). There are also concrete types for many Python built-in types, such as `PyList`, `PyDict`, and `PyTuple`. User defined `#[pyclass]` types also fit this category. The [second section below](#concrete-python-types) expands on how to use these types.
+
+Before PyO3 0.21, PyO3's main API to interact with Python objects was a deprecated API known as the "GIL Refs" API, containing reference types such as `&PyAny`, `&PyList`, and `&PyCell<T>` for user-defined `#[pyclass]` types. The [third section below](#the-gil-refs-api) details this deprecated API.
+
+## PyO3's smart pointers
+
+PyO3's API offers three generic smart pointers: `Py<T>`, `Bound<'py, T>` and `Borrowed<'a, 'py, T>`. For each of these the type parameter `T` will be filled by a [concrete Python type](#concrete-python-types). For example, a Python list object can be represented by `Py<PyList>`, `Bound<'py, PyList>`, and `Borrowed<'a, 'py, PyList>`.
+
+These smart pointers behave differently due to their lifetime parameters. `Py<T>` has no lifetime parameters, `Bound<'py, T>` has [the `'py` lifetime](./python-from-rust.md#the-py-lifetime) as a parameter, and `Borrowed<'a, 'py, T>` has the `'py` lifetime plus an additional lifetime `'a` to denote the lifetime it is borrowing data for. (You can read more about these lifetimes in the subsections below).
+
+Python objects are reference counted, like [`std::sync::Arc`](https://doc.rust-lang.org/stable/std/sync/struct.Arc.html). A major reason for these smart pointers is to bring Python's reference counting to a Rust API.
+
+The recommendation of when to use each of these smart pointers is as follows:
+
+- Use `Bound<'py, T>` for as much as possible, as it offers the most efficient and complete API.
+- Use `Py<T>` mostly just for storage inside Rust `struct`s which do not want to or can't add a lifetime parameter for `Bound<'py, T>`.
+- `Borrowed<'a, 'py, T>` is almost never used. It is occasionally present at the boundary between Rust and the Python interpreter, for example when borrowing data from Python tuples (which is safe because they are immutable).
+
+The sections below also explain these smart pointers in a little more detail.
+
+### `Py<T>` (and `PyObject`)
+
+[`Py<T>`][Py] is the foundational smart pointer in PyO3's API. The type parameter `T` denotes the type of the Python object. Very frequently this is `PyAny`, meaning any Python object. This is so common that `Py<PyAny>` has a type alias `PyObject`.
+
+Because `Py<T>` is not bound to [the `'py` lifetime](./python-from-rust.md#the-py-lifetime), it is the type to use when storing a Python object inside a Rust `struct` or `enum` which do not want to have a lifetime parameter. In particular, [`#[pyclass]`][pyclass] types are not permitted to have a lifetime, so `Py<T>` is the correct type to store Python objects inside them.
+
+The lack of binding to the `'py` lifetime also carries drawbacks:
+ - Almost all methods on `Py<T>` require a `Python<'py>` token as the first argument
+ - Other functionality, such as [`Drop`][Drop], needs to check at runtime for attachment to the Python GIL, at a small performance cost
+
+Because of the drawbacks `Bound<'py, T>` is preferred for many of PyO3's APIs. In particular, `Bound<'py, T>` is the better for function arguments.
+
+To convert a `Py<T>` into a `Bound<'py, T>`, the `Py::bind` and `Py::into_bound` methods are available. `Bound<'py, T>` can be converted back into `Py<T>` using [`Bound::unbind`].
+
+### `Bound<'py, T>`
+
+[`Bound<'py, T>`][Bound] is the counterpart to `Py<T>` which is also bound to the `'py` lifetime. It can be thought of as equivalent to the Rust tuple `(Python<'py>, Py<T>)`.
+
+By having the binding to the `'py` lifetime, `Bound<'py, T>` can offer the complete PyO3 API at maximum efficiency. This means that in almost all cases where `Py<T>` is not necessary for lifetime reasons, `Bound<'py, T>` should be used.
+
+`Bound<'py, T>` engages in Python reference counting. This means that `Bound<'py, T>` owns a Python object. Rust code which just wants to borrow a Python object should use a shared reference `&Bound<'py, T>`. Just like `std::sync::Arc`, using `.clone()` and `drop()` will cheaply increment and decrement the reference count of the object (just in this case, the reference counting is implemented by the Python interpreter itself).
+
+To give an example of how `Bound<'py, T>` is PyO3's primary API type, consider the following Python code:
+
+```python
+def example():
+    x = list()   # create a Python list
+    x.append(1)  # append the integer 1 to it
+    y = x        # create a second reference to the list
+    del x        # delete the original reference
+```
+
+Using PyO3's API, and in particular `Bound<'py, PyList>`, this code translates into the following Rust code:
+
+```rust
+use pyo3::prelude::*;
+use pyo3::types::PyList;
+
+fn example<'py>(py: Python<'py>) -> PyResult<()> {
+    let x: Bound<'py, PyList> = PyList::empty_bound(py);
+    x.append(1)?;
+    let y: Bound<'py, PyList> = x.clone(); // y is a new reference to the same list
+    drop(x); // release the original reference x
+    Ok(())
+}
+# Python::with_gil(example).unwrap();
+```
+
+Or, without the type annotations:
+
+```rust
+use pyo3::prelude::*;
+use pyo3::types::PyList;
+
+fn example(py: Python<'_>) -> PyResult<()> {
+    let x = PyList::empty_bound(py);
+    x.append(1)?;
+    let y = x.clone();
+    drop(x);
+    Ok(())
+}
+# Python::with_gil(example).unwrap();
+```
+
+#### Function argument lifetimes
+
+Because the `'py` lifetime often appears in many function arguments as part of the `Bound<'py, T>` smart pointer, the Rust compiler will often require annotations of input and output lifetimes. This occurs when the function output has at least one lifetime, and there is more than one lifetime present on the inputs.
+
+To demonstrate, consider this function which takes accepts Python objects and applies the [Python `+` operation][PyAnyMethods::add] to them:
+
+```rust,compile_fail
+# use pyo3::prelude::*;
+fn add(left: &'_ Bound<'_, PyAny>, right: &'_ Bound<'_, PyAny>) -> PyResult<Bound<'_, PyAny>> {
+    left.add(right)
+}
+```
+
+Because the Python `+` operation might raise an exception, this function returns `PyResult<Bound<'_, PyAny>>`. It doesn't need ownership of the inputs, so it takes `&Bound<'_, PyAny>` shared references. To demonstrate the point, all lifetimes have used the wildcard `'_` to allow the Rust compiler to attempt to infer them. Because there are four input lifetimes (two lifetimes of the shared references, and two `'py` lifetimes unnamed inside the `Bound<'_, PyAny>` pointers), the compiler cannot reason about which must be connected to the output.
+
+The correct way to solve this is to add the `'py` lifetime as a parameter for the function, and name all the `'py` lifetimes inside the `Bound<'py, PyAny>` smart pointers. For the shared references, it's also fine to reduce `&'_` to just `&`. The working end result is below:
+
+```rust
+# use pyo3::prelude::*;
+fn add<'py>(
+    left: &Bound<'py, PyAny>,
+    right: &Bound<'py, PyAny>,
+) -> PyResult<Bound<'py, PyAny>> {
+    left.add(right)
+}
+# Python::with_gil(|py| {
+#     let s = pyo3::types::PyString::new_bound(py, "s");
+#     assert!(add(&s, &s).unwrap().eq("ss").unwrap());
+# })
+```
+
+If naming the `'py` lifetime adds unwanted complexity to the function signature, it is also acceptable to return `PyObject` (aka `Py<PyAny>`), which has no lifetime. The cost is instead paid by a slight increase in implementation complexity, as seen by the introduction of a call to [`Bound::unbind`]:
+
+```rust
+# use pyo3::prelude::*;
+fn add(left: &Bound<'_, PyAny>, right: &Bound<'_, PyAny>) -> PyResult<PyObject> {
+    let output: Bound<'_, PyAny> = left.add(right)?;
+    Ok(output.unbind())
+}
+# Python::with_gil(|py| {
+#     let s = pyo3::types::PyString::new_bound(py, "s");
+#     assert!(add(&s, &s).unwrap().bind(py).eq("ss").unwrap());
+# })
+```
+
+### `Borrowed<'a, 'py, T>`
+
+[`Borrowed<'a, 'py, T>`][Borrowed] is an advanced type used just occasionally at the edge of interaction with the Python interpreter. It can be thought of as analogous to the shared reference `&'a Bound<'py, T>`. The difference is that `Borrowed<'a, 'py, T>` is just a smart pointer rather than a reference-to-a-smart-pointer, which is a helpful reduction in indirection in specific interactions with the Python interpreter.
+
+`Borrowed<'a, 'py, T>` dereferences to `Bound<'py, T>`, so all methods on `Bound<'py, T>` are available on `Borrowed<'a, 'py, T>`.
+
+An example where `Borrowed<'a, 'py, T>` is used is in [`PyTupleMethods::get_borrowed_item`]({{#PYO3_DOCS_URL}}/pyo3/types/trait.PyTupleMethods.html#tymethod.get_item):
+
+```rust
+use pyo3::prelude::*;
+use pyo3::types::PyTuple;
+
+# fn example<'py>(py: Python<'py>) -> PyResult<()> {
+// Create a new tuple with the elements (0, 1, 2)
+let t = PyTuple::new_bound(py, [0, 1, 2]);
+for i in 0..=2 {
+    let entry: Borrowed<'_, 'py, PyAny> = t.get_borrowed_item(i)?;
+    // `PyAnyMethods::extract` is available on `Borrowed`
+    // via the dereference to `Bound`
+    let value: usize = entry.extract()?;
+    assert_eq!(i, value);
+}
+# Ok(())
+# }
+# Python::with_gil(example).unwrap();
+```
+
+### Casting between smart pointer types
+
+To convert between `Py<T>` and `Bound<'py, T>` use the `bind()` / `into_bound()` methods. Use the `as_unbound()` / `unbind()` methods to go back from `Bound<'py, T>` to `Py<T>`.
+
+```rust,ignore
+let obj: Py<PyAny> = ...;
+let bound: &Bound<'py, PyAny> = obj.bind(py);
+let bound: Bound<'py, PyAny> = obj.into_bound(py);
+
+let obj: &Py<PyAny> = bound.as_unbound();
+let obj: Py<PyAny> = bound.unbind();
+```
+
+To convert between `Bound<'py, T>` and `Borrowed<'a, 'py, T>` use the `as_borrowed()` method. `Borrowed<'a, 'py, T>` has a deref coercion to `Bound<'py, T>`. Use the `to_owned()` method to increment the Python reference count and to create a new `Bound<'py, T>` from the `Borrowed<'a, 'py, T>`.
+
+```rust,ignore
+let bound: Bound<'py, PyAny> = ...;
+let borrowed: Borrowed<'_, 'py, PyAny> = bound.as_borrowed();
+
+// deref coercion
+let bound: &Bound<'py, PyAny> = &borrowed;
+
+// create a new Bound by increase the Python reference count
+let bound: Bound<'py, PyAny> = borrowed.to_owned();
+```
+
+To convert between `Py<T>` and `Borrowed<'a, 'py, T>` use the `bind_borrowed()` method. Use either `as_unbound()` or `.to_owned().unbind()` to go back to `Py<T>` from `Borrowed<'a, 'py, T>`, via `Bound<'py, T>`.
+
+```rust,ignore
+let obj: Py<PyAny> = ...;
+let borrowed: Borrowed<'_, 'py, PyAny> = bound.as_borrowed();
+
+// via deref coercion to Bound and then using Bound::as_unbound
+let obj: &Py<PyAny> = borrowed.as_unbound();
+
+// via a new Bound by increasing the Python reference count, and unbind it
+let obj: Py<PyAny> = borrowed.to_owned().unbind().
+```
+
+## Concrete Python types
+
+In all of `Py<T>`, `Bound<'py, T>`, and `Borrowed<'a, 'py, T>`, the type parameter `T` denotes the type of the Python object referred to by the smart pointer.
+
+This parameter `T` can be filled by:
+ - [`PyAny`][PyAny], which represents any Python object,
+ - Native Python types such as `PyList`, `PyTuple`, and `PyDict`, and
+ - [`#[pyclass]`][pyclass] types defined from Rust
+
+The following subsections covers some further detail about how to work with these types:
+- the APIs that are available for these concrete types,
+- how to cast `Bound<'py, T>` to a specific concrete type, and
+- how to get Rust data out of a `Bound<'py, T>`.
+
+### Using APIs for concrete Python types
+
+Each concrete Python type such as `PyAny`, `PyTuple` and `PyDict` exposes its API on the corresponding bound smart pointer `Bound<'py, PyAny>`, `Bound<'py, PyTuple>` and `Bound<'py, PyDict>`.
+
+Each type's API is exposed as a trait: [`PyAnyMethods`], [`PyTupleMethods`], [`PyDictMethods`], and so on for all concrete types. Using traits rather than associated methods on the `Bound` smart pointer is done for a couple of reasons:
+- Clarity of documentation: each trait gets its own documentation page in the PyO3 API docs. If all methods were on the `Bound` smart pointer directly, the vast majority of PyO3's API would be on a single, extremely long, documentation page.
+- Consistency: downstream code implementing Rust APIs for existing Python types can also follow this pattern of using a trait. Downstream code would not be allowed to add new associated methods directly on the `Bound` type.
+- Future design: it is hoped that a future Rust with [arbitrary self types](https://github.com/rust-lang/rust/issues/44874) will remove the need for these traits in favour of placing the methods directly on `PyAny`, `PyTuple`, `PyDict`, and so on.
+
+These traits are all included in the `pyo3::prelude` module, so with the glob import `use pyo3::prelude::*` the full PyO3 API is made available to downstream code.
+
+The following function accesses the first item in the input Python list, using the `.get_item()` method from the `PyListMethods` trait:
+
+```rust
+use pyo3::prelude::*;
+use pyo3::types::PyList;
+
+fn get_first_item<'py>(list: &Bound<'py, PyList>) -> PyResult<Bound<'py, PyAny>> {
+    list.get_item(0)
+}
+# Python::with_gil(|py| {
+#     let l = PyList::new_bound(py, ["hello world"]);
+#     assert!(get_first_item(&l).unwrap().eq("hello world").unwrap());
+# })
+```
+
+### Casting between Python object types
+
+To cast `Bound<'py, T>` smart pointers to some other type, use the [`.downcast()`][PyAnyMethods::downcast] family of functions. This converts `&Bound<'py, T>` to a different `&Bound<'py, U>`, without transferring ownership. There is also [`.downcast_into()`][PyAnyMethods::downcast_into] to convert `Bound<'py, T>` to `Bound<'py, U>` with transfer of ownership. These methods are available for all types `T` which implement the [`PyTypeCheck`] trait.
+
+Casting to `Bound<'py, PyAny>` can be done with `.as_any()` or `.into_any()`.
+
+For example, the following snippet shows how to cast `Bound<'py, PyAny>` to `Bound<'py, PyTuple>`:
+
+```rust
+# use pyo3::prelude::*;
+# use pyo3::types::PyTuple;
+# fn example<'py>(py: Python<'py>) -> PyResult<()> {
+// create a new Python `tuple`, and use `.into_any()` to erase the type
+let obj: Bound<'py, PyAny> = PyTuple::empty_bound(py).into_any();
+
+// use `.downcast()` to cast to `PyTuple` without transferring ownership
+let _: &Bound<'py, PyTuple> = obj.downcast()?;
+
+// use `.downcast_into()` to cast to `PyTuple` with transfer of ownership
+let _: Bound<'py, PyTuple> = obj.downcast_into()?;
+# Ok(())
+# }
+# Python::with_gil(example).unwrap()
+```
+
+Custom [`#[pyclass]`][pyclass] types implement [`PyTypeCheck`], so `.downcast()` also works for these types. The snippet below is the same as the snippet above casting instead to a custom type `MyClass`:
+
+```rust
+use pyo3::prelude::*;
+
+#[pyclass]
+struct MyClass {}
+
+# fn example<'py>(py: Python<'py>) -> PyResult<()> {
+// create a new Python `tuple`, and use `.into_any()` to erase the type
+let obj: Bound<'py, PyAny> = Bound::new(py, MyClass {})?.into_any();
+
+// use `.downcast()` to cast to `MyClass` without transferring ownership
+let _: &Bound<'py, MyClass> = obj.downcast()?;
+
+// use `.downcast_into()` to cast to `MyClass` with transfer of ownership
+let _: Bound<'py, MyClass> = obj.downcast_into()?;
+# Ok(())
+# }
+# Python::with_gil(example).unwrap()
+```
+
+### Extracting Rust data from Python objects
+
+To extract Rust data from Python objects, use [`.extract()`][PyAnyMethods::extract] instead of `.downcast()`. This method is available for all types which implement the [`FromPyObject`] trait.
+
+For example, the following snippet extracts a Rust tuple of integers from a Python tuple:
+
+```rust
+# use pyo3::prelude::*;
+# use pyo3::types::PyTuple;
+# fn example<'py>(py: Python<'py>) -> PyResult<()> {
+// create a new Python `tuple`, and use `.into_any()` to erase the type
+let obj: Bound<'py, PyAny> = PyTuple::new_bound(py, [1, 2, 3]).into_any();
+
+// extracting the Python `tuple` to a rust `(i32, i32, i32)` tuple
+let (x, y, z) = obj.extract::<(i32, i32, i32)>()?;
+assert_eq!((x, y, z), (1, 2, 3));
+# Ok(())
+# }
+# Python::with_gil(example).unwrap()
+```
+
+To avoid copying data, [`#[pyclass]`][pyclass] types can directly reference Rust data stored within the Python objects without needing to `.extract()`. See the [corresponding documentation in the class section of the guide](./class.md#bound-and-interior-mutability)
+for more detail.
+
+## The GIL Refs API
+
+The GIL Refs API was PyO3's primary API prior to PyO3 0.21. The main difference was that instead of the `Bound<'py, PyAny>` smart pointer, the "GIL Reference" `&'py PyAny` was used. (This was similar for other Python types.)
+
+As of PyO3 0.21, the GIL Refs API is deprecated. See the [migration guide](./migration.md#from-020-to-021) for details on how to upgrade.
+
+The following sections note some historical detail about the GIL Refs API.
+
+### [`PyAny`][PyAny]
+
+**Represented:** a Python object of unspecified type. In the GIL Refs API, this was only accessed as the GIL Ref `&'py PyAny`.
+
+**Used:** `&'py PyAny` was used to refer to some Python object when the GIL lifetime was available for the whole duration access was needed. For example, intermediate values and arguments to `pyfunction`s or `pymethod`s implemented in Rust where any type is allowed.
+
+**Conversions:**
+
+For a `&PyAny` object reference `any` where the underlying object is a Python-native type such as
+a list:
+
+```rust
+# #![allow(unused_imports)]
+# use pyo3::prelude::*;
+# use pyo3::types::PyList;
+# #[cfg(feature = "gil-refs")]
+# Python::with_gil(|py| -> PyResult<()> {
+#[allow(deprecated)] // PyList::empty is part of the deprecated "GIL Refs" API.
+let obj: &PyAny = PyList::empty(py);
+
+// To &PyList with PyAny::downcast
+let _: &PyList = obj.downcast()?;
+
+// To Py<PyAny> (aka PyObject) with .into()
+let _: Py<PyAny> = obj.into();
+
+// To Py<PyList> with PyAny::extract
+let _: Py<PyList> = obj.extract()?;
+# Ok(())
+# }).unwrap();
+```
+
+For a `&PyAny` object reference `any` where the underlying object is a `#[pyclass]`:
+
+```rust
+# #![allow(unused_imports)]
+# use pyo3::prelude::*;
+# #[pyclass] #[derive(Clone)] struct MyClass { }
+# #[cfg(feature = "gil-refs")]
+# Python::with_gil(|py| -> PyResult<()> {
+#[allow(deprecated)] // into_ref is part of the deprecated GIL Refs API
+let obj: &PyAny = Py::new(py, MyClass {})?.into_ref(py);
+
+// To &PyCell<MyClass> with PyAny::downcast
+#[allow(deprecated)] // &PyCell is part of the deprecated GIL Refs API
+let _: &PyCell<MyClass> = obj.downcast()?;
+
+// To Py<PyAny> (aka PyObject) with .into()
+let _: Py<PyAny> = obj.into();
+
+// To Py<MyClass> with PyAny::extract
+let _: Py<MyClass> = obj.extract()?;
+
+// To MyClass with PyAny::extract, if MyClass: Clone
+let _: MyClass = obj.extract()?;
+
+// To PyRef<'_, MyClass> or PyRefMut<'_, MyClass> with PyAny::extract
+let _: PyRef<'_, MyClass> = obj.extract()?;
+let _: PyRefMut<'_, MyClass> = obj.extract()?;
+# Ok(())
+# }).unwrap();
+```
+
+### `PyTuple`, `PyDict`, and many more
+
+**Represented:** a native Python object of known type. In the GIL Refs API, they were only accessed as the GIL Refs `&'py PyTuple`, `&'py PyDict`.
+
+**Used:** `&'py PyTuple` and similar were used to operate with native Python types while holding the GIL. Like `PyAny`, this is the most convenient form to use for function arguments and intermediate values.
+
+These GIL Refs implement `Deref<Target = PyAny>`, so they all expose the same methods which can be found on `PyAny`.
+
+To see all Python types exposed by `PyO3` consult the [`pyo3::types`][pyo3::types] module.
+
+**Conversions:**
+
+```rust
+# #![allow(unused_imports)]
+# use pyo3::prelude::*;
+# use pyo3::types::PyList;
+# #[cfg(feature = "gil-refs")]
+# Python::with_gil(|py| -> PyResult<()> {
+#[allow(deprecated)] // PyList::empty is part of the deprecated "GIL Refs" API.
+let list = PyList::empty(py);
+
+// Use methods from PyAny on all Python types with Deref implementation
+let _ = list.repr()?;
+
+// To &PyAny automatically with Deref implementation
+let _: &PyAny = list;
+
+// To &PyAny explicitly with .as_ref()
+#[allow(deprecated)] // as_ref is part of the deprecated "GIL Refs" API.
+let _: &PyAny = list.as_ref();
+
+// To Py<T> with .into() or Py::from()
+let _: Py<PyList> = list.into();
+
+// To PyObject with .into() or .to_object(py)
+let _: PyObject = list.into();
+# Ok(())
+# }).unwrap();
+```
+
+### `Py<T>` and `PyObject`
+
+**Represented:** a GIL-independent reference to a Python object. This can be a Python native type
+(like `PyTuple`), or a `pyclass` type implemented in Rust. The most commonly-used variant,
+`Py<PyAny>`, is also known as `PyObject`.
+
+**Used:** Whenever you want to carry around references to a Python object without caring about a
+GIL lifetime.  For example, storing Python object references in a Rust struct that outlives the
+Python-Rust FFI boundary, or returning objects from functions implemented in Rust back to Python.
+
+Can be cloned using Python reference counts with `.clone()`.
+
+### `PyCell<SomeType>`
+
+**Represented:** a reference to a Rust object (instance of `PyClass`) wrapped in a Python object.  The cell part is an analog to stdlib's [`RefCell`][RefCell] to allow access to `&mut` references.
+
+**Used:** for accessing pure-Rust API of the instance (members and functions taking `&SomeType` or `&mut SomeType`) while maintaining the aliasing rules of Rust references.
+
+Like PyO3's Python native types, the GIL Ref `&PyCell<T>` implements `Deref<Target = PyAny>`, so it also exposed all of the methods on `PyAny`.
+
+**Conversions:**
+
+`PyCell<T>` was used to access `&T` and `&mut T` via `PyRef<T>` and `PyRefMut<T>` respectively.
+
+```rust
+#![allow(unused_imports)]
+# use pyo3::prelude::*;
+# #[pyclass] struct MyClass { }
+# #[cfg(feature = "gil-refs")]
+# Python::with_gil(|py| -> PyResult<()> {
+#[allow(deprecated)] // &PyCell is part of the deprecated GIL Refs API
+let cell: &PyCell<MyClass> = PyCell::new(py, MyClass {})?;
+
+// To PyRef<T> with .borrow() or .try_borrow()
+let py_ref: PyRef<'_, MyClass> = cell.try_borrow()?;
+let _: &MyClass = &*py_ref;
+# drop(py_ref);
+
+// To PyRefMut<T> with .borrow_mut() or .try_borrow_mut()
+let mut py_ref_mut: PyRefMut<'_, MyClass> = cell.try_borrow_mut()?;
+let _: &mut MyClass = &mut *py_ref_mut;
+# Ok(())
+# }).unwrap();
+```
+
+`PyCell<T>` was also accessed like a Python-native type.
+
+```rust
+#![allow(unused_imports)]
+# use pyo3::prelude::*;
+# #[pyclass] struct MyClass { }
+# #[cfg(feature = "gil-refs")]
+# Python::with_gil(|py| -> PyResult<()> {
+#[allow(deprecated)] // &PyCell is part of the deprecate GIL Refs API
+let cell: &PyCell<MyClass> = PyCell::new(py, MyClass {})?;
+
+// Use methods from PyAny on PyCell<T> with Deref implementation
+let _ = cell.repr()?;
+
+// To &PyAny automatically with Deref implementation
+let _: &PyAny = cell;
+
+// To &PyAny explicitly with .as_ref()
+#[allow(deprecated)] // as_ref is part of the deprecated "GIL Refs" API.
+let _: &PyAny = cell.as_ref();
+# Ok(())
+# }).unwrap();
+```
+
+[Bound]: {{#PYO3_DOCS_URL}}/pyo3/struct.Bound.html
+[`Bound::unbind`]: {{#PYO3_DOCS_URL}}/pyo3/struct.Bound.html#method.unbind
+[Py]: {{#PYO3_DOCS_URL}}/pyo3/struct.Py.html
+[PyAnyMethods::add]: {{#PYO3_DOCS_URL}}/pyo3/types/trait.PyAnyMethods.html#tymethod.add
+[PyAnyMethods::extract]: {{#PYO3_DOCS_URL}}/pyo3/types/trait.PyAnyMethods.html#tymethod.extract
+[PyAnyMethods::downcast]: {{#PYO3_DOCS_URL}}/pyo3/types/trait.PyAnyMethods.html#tymethod.downcast
+[PyAnyMethods::downcast_into]: {{#PYO3_DOCS_URL}}/pyo3/types/trait.PyAnyMethods.html#tymethod.downcast_into
+[`PyTypeCheck`]: {{#PYO3_DOCS_URL}}/pyo3/type_object/trait.PyTypeCheck.html
+[`PyAnyMethods`]: {{#PYO3_DOCS_URL}}/pyo3/types/trait.PyAnyMethods.html
+[`PyDictMethods`]: {{#PYO3_DOCS_URL}}/pyo3/types/trait.PyDictMethods.html
+[`PyTupleMethods`]: {{#PYO3_DOCS_URL}}/pyo3/types/trait.PyTupleMethods.html
+[pyclass]: class.md
+[Borrowed]: {{#PYO3_DOCS_URL}}/pyo3/struct.Borrowed.html
+[Drop]: https://doc.rust-lang.org/std/ops/trait.Drop.html
+[eval]: {{#PYO3_DOCS_URL}}/pyo3/marker/struct.Python.html#method.eval
+[clone_ref]: {{#PYO3_DOCS_URL}}/pyo3/struct.Py.html#method.clone_ref
+[pyo3::types]: {{#PYO3_DOCS_URL}}/pyo3/types/index.html
+[PyAny]: {{#PYO3_DOCS_URL}}/pyo3/types/struct.PyAny.html
+[PyList_append]: {{#PYO3_DOCS_URL}}/pyo3/types/struct.PyList.html#method.append
+[RefCell]: https://doc.rust-lang.org/std/cell/struct.RefCell.html
+[smart-pointers]: https://doc.rust-lang.org/book/ch15-00-smart-pointers.html
diff -pruN 43.0.0-1/rust-vendor/pyo3/netlify.toml 43.0.0-1ubuntu1/rust-vendor/pyo3/netlify.toml
--- 43.0.0-1/rust-vendor/pyo3/netlify.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/netlify.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,6 @@
+[build]
+publish = "netlify_build/"
+command = ".netlify/build.sh"
+
+[build.environment]
+PYTHON_VERSION = "3.8"
diff -pruN 43.0.0-1/rust-vendor/pyo3/pyo3-runtime/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/pyo3/pyo3-runtime/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/pyo3/pyo3-runtime/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/pyo3-runtime/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,189 @@
+   Copyright (c) 2017-present PyO3 Project and Contributors.  https://github.com/PyO3
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
diff -pruN 43.0.0-1/rust-vendor/pyo3/pyo3-runtime/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/pyo3/pyo3-runtime/LICENSE-MIT
--- 43.0.0-1/rust-vendor/pyo3/pyo3-runtime/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/pyo3-runtime/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,25 @@
+Copyright (c) 2023-present PyO3 Project and Contributors.  https://github.com/PyO3
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/pyo3/pyo3-runtime/README.md 43.0.0-1ubuntu1/rust-vendor/pyo3/pyo3-runtime/README.md
--- 43.0.0-1/rust-vendor/pyo3/pyo3-runtime/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/pyo3-runtime/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+Coming soon!
diff -pruN 43.0.0-1/rust-vendor/pyo3/pyo3-runtime/pyproject.toml 43.0.0-1ubuntu1/rust-vendor/pyo3/pyo3-runtime/pyproject.toml
--- 43.0.0-1/rust-vendor/pyo3/pyo3-runtime/pyproject.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/pyo3-runtime/pyproject.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,34 @@
+[build-system]
+requires = ["hatchling"]
+build-backend = "hatchling.build"
+
+[project]
+name = "pyo3-runtime"
+dynamic = ["version"]
+description = ''
+readme = "README.md"
+requires-python = ">=3.7"
+license = "MIT OR Apache-2.0"
+keywords = []
+authors = [
+  { name = "David Hewitt", email = "1939362+davidhewitt@users.noreply.github.com" },
+]
+classifiers = [
+  "Development Status :: 4 - Beta",
+  "Programming Language :: Python",
+  "Programming Language :: Python :: 3.7",
+  "Programming Language :: Python :: 3.8",
+  "Programming Language :: Python :: 3.9",
+  "Programming Language :: Python :: 3.10",
+  "Programming Language :: Python :: 3.11",
+  "Programming Language :: Python :: 3.12",
+  "Programming Language :: Python :: Implementation :: CPython",
+  "Programming Language :: Python :: Implementation :: PyPy",
+]
+dependencies = []
+
+[project.urls]
+Homepage = "https://github.com/PyO3/pyo3"
+
+[tool.hatch.version]
+path = "src/pyo3_runtime/__init__.py"
diff -pruN 43.0.0-1/rust-vendor/pyo3/pyo3-runtime/src/pyo3_runtime/__init__.py 43.0.0-1ubuntu1/rust-vendor/pyo3/pyo3-runtime/src/pyo3_runtime/__init__.py
--- 43.0.0-1/rust-vendor/pyo3/pyo3-runtime/src/pyo3_runtime/__init__.py	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/pyo3-runtime/src/pyo3_runtime/__init__.py	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+__version__ = "0.0.1"
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/buffer.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/buffer.rs
--- 43.0.0-1/rust-vendor/pyo3/src/buffer.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/buffer.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,948 @@
+#![cfg(any(not(Py_LIMITED_API), Py_3_11))]
+// Copyright (c) 2017 Daniel Grunwald
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy of this
+// software and associated documentation files (the "Software"), to deal in the Software
+// without restriction, including without limitation the rights to use, copy, modify, merge,
+// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+// to whom the Software is furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all copies or
+// substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+//! `PyBuffer` implementation
+use crate::Bound;
+#[cfg(feature = "gil-refs")]
+use crate::PyNativeType;
+use crate::{err, exceptions::PyBufferError, ffi, FromPyObject, PyAny, PyResult, Python};
+use std::marker::PhantomData;
+use std::os::raw;
+use std::pin::Pin;
+use std::{cell, mem, ptr, slice};
+use std::{ffi::CStr, fmt::Debug};
+
+/// Allows access to the underlying buffer used by a python object such as `bytes`, `bytearray` or `array.array`.
+// use Pin<Box> because Python expects that the Py_buffer struct has a stable memory address
+#[repr(transparent)]
+pub struct PyBuffer<T>(Pin<Box<ffi::Py_buffer>>, PhantomData<T>);
+
+// PyBuffer is thread-safe: the shape of the buffer is immutable while a Py_buffer exists.
+// Accessing the buffer contents is protected using the GIL.
+unsafe impl<T> Send for PyBuffer<T> {}
+unsafe impl<T> Sync for PyBuffer<T> {}
+
+impl<T> Debug for PyBuffer<T> {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        f.debug_struct("PyBuffer")
+            .field("buf", &self.0.buf)
+            .field("obj", &self.0.obj)
+            .field("len", &self.0.len)
+            .field("itemsize", &self.0.itemsize)
+            .field("readonly", &self.0.readonly)
+            .field("ndim", &self.0.ndim)
+            .field("format", &self.0.format)
+            .field("shape", &self.0.shape)
+            .field("strides", &self.0.strides)
+            .field("suboffsets", &self.0.suboffsets)
+            .field("internal", &self.0.internal)
+            .finish()
+    }
+}
+
+/// Represents the type of a Python buffer element.
+#[derive(Copy, Clone, Debug, Eq, PartialEq)]
+pub enum ElementType {
+    /// A signed integer type.
+    SignedInteger {
+        /// The width of the signed integer in bytes.
+        bytes: usize,
+    },
+    /// An unsigned integer type.
+    UnsignedInteger {
+        /// The width of the unsigned integer in bytes.
+        bytes: usize,
+    },
+    /// A boolean type.
+    Bool,
+    /// A float type.
+    Float {
+        /// The width of the float in bytes.
+        bytes: usize,
+    },
+    /// An unknown type. This may occur when parsing has failed.
+    Unknown,
+}
+
+impl ElementType {
+    /// Determines the `ElementType` from a Python `struct` module format string.
+    ///
+    /// See <https://docs.python.org/3/library/struct.html#format-strings> for more information
+    /// about struct format strings.
+    pub fn from_format(format: &CStr) -> ElementType {
+        match format.to_bytes() {
+            [size] | [b'@', size] => native_element_type_from_type_char(*size),
+            [b'=' | b'<' | b'>' | b'!', size] => standard_element_type_from_type_char(*size),
+            _ => ElementType::Unknown,
+        }
+    }
+}
+
+fn native_element_type_from_type_char(type_char: u8) -> ElementType {
+    use self::ElementType::*;
+    match type_char {
+        b'c' => UnsignedInteger {
+            bytes: mem::size_of::<raw::c_char>(),
+        },
+        b'b' => SignedInteger {
+            bytes: mem::size_of::<raw::c_schar>(),
+        },
+        b'B' => UnsignedInteger {
+            bytes: mem::size_of::<raw::c_uchar>(),
+        },
+        b'?' => Bool,
+        b'h' => SignedInteger {
+            bytes: mem::size_of::<raw::c_short>(),
+        },
+        b'H' => UnsignedInteger {
+            bytes: mem::size_of::<raw::c_ushort>(),
+        },
+        b'i' => SignedInteger {
+            bytes: mem::size_of::<raw::c_int>(),
+        },
+        b'I' => UnsignedInteger {
+            bytes: mem::size_of::<raw::c_uint>(),
+        },
+        b'l' => SignedInteger {
+            bytes: mem::size_of::<raw::c_long>(),
+        },
+        b'L' => UnsignedInteger {
+            bytes: mem::size_of::<raw::c_ulong>(),
+        },
+        b'q' => SignedInteger {
+            bytes: mem::size_of::<raw::c_longlong>(),
+        },
+        b'Q' => UnsignedInteger {
+            bytes: mem::size_of::<raw::c_ulonglong>(),
+        },
+        b'n' => SignedInteger {
+            bytes: mem::size_of::<libc::ssize_t>(),
+        },
+        b'N' => UnsignedInteger {
+            bytes: mem::size_of::<libc::size_t>(),
+        },
+        b'e' => Float { bytes: 2 },
+        b'f' => Float { bytes: 4 },
+        b'd' => Float { bytes: 8 },
+        _ => Unknown,
+    }
+}
+
+fn standard_element_type_from_type_char(type_char: u8) -> ElementType {
+    use self::ElementType::*;
+    match type_char {
+        b'c' | b'B' => UnsignedInteger { bytes: 1 },
+        b'b' => SignedInteger { bytes: 1 },
+        b'?' => Bool,
+        b'h' => SignedInteger { bytes: 2 },
+        b'H' => UnsignedInteger { bytes: 2 },
+        b'i' | b'l' => SignedInteger { bytes: 4 },
+        b'I' | b'L' => UnsignedInteger { bytes: 4 },
+        b'q' => SignedInteger { bytes: 8 },
+        b'Q' => UnsignedInteger { bytes: 8 },
+        b'e' => Float { bytes: 2 },
+        b'f' => Float { bytes: 4 },
+        b'd' => Float { bytes: 8 },
+        _ => Unknown,
+    }
+}
+
+#[cfg(target_endian = "little")]
+fn is_matching_endian(c: u8) -> bool {
+    c == b'@' || c == b'=' || c == b'>'
+}
+
+#[cfg(target_endian = "big")]
+fn is_matching_endian(c: u8) -> bool {
+    c == b'@' || c == b'=' || c == b'>' || c == b'!'
+}
+
+/// Trait implemented for possible element types of `PyBuffer`.
+///
+/// # Safety
+///
+/// This trait must only be implemented for types which represent valid elements of Python buffers.
+pub unsafe trait Element: Copy {
+    /// Gets whether the element specified in the format string is potentially compatible.
+    /// Alignment and size are checked separately from this function.
+    fn is_compatible_format(format: &CStr) -> bool;
+}
+
+impl<'py, T: Element> FromPyObject<'py> for PyBuffer<T> {
+    fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<PyBuffer<T>> {
+        Self::get_bound(obj)
+    }
+}
+
+impl<T: Element> PyBuffer<T> {
+    /// Deprecated form of [`PyBuffer::get_bound`]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyBuffer::get` will be replaced by `PyBuffer::get_bound` in a future PyO3 version"
+    )]
+    pub fn get(obj: &PyAny) -> PyResult<PyBuffer<T>> {
+        Self::get_bound(&obj.as_borrowed())
+    }
+
+    /// Gets the underlying buffer from the specified python object.
+    pub fn get_bound(obj: &Bound<'_, PyAny>) -> PyResult<PyBuffer<T>> {
+        // TODO: use nightly API Box::new_uninit() once stable
+        let mut buf = Box::new(mem::MaybeUninit::uninit());
+        let buf: Box<ffi::Py_buffer> = {
+            err::error_on_minusone(obj.py(), unsafe {
+                ffi::PyObject_GetBuffer(obj.as_ptr(), buf.as_mut_ptr(), ffi::PyBUF_FULL_RO)
+            })?;
+            // Safety: buf is initialized by PyObject_GetBuffer.
+            // TODO: use nightly API Box::assume_init() once stable
+            unsafe { mem::transmute(buf) }
+        };
+        // Create PyBuffer immediately so that if validation checks fail, the PyBuffer::drop code
+        // will call PyBuffer_Release (thus avoiding any leaks).
+        let buf = PyBuffer(Pin::from(buf), PhantomData);
+
+        if buf.0.shape.is_null() {
+            Err(PyBufferError::new_err("shape is null"))
+        } else if buf.0.strides.is_null() {
+            Err(PyBufferError::new_err("strides is null"))
+        } else if mem::size_of::<T>() != buf.item_size() || !T::is_compatible_format(buf.format()) {
+            Err(PyBufferError::new_err(format!(
+                "buffer contents are not compatible with {}",
+                std::any::type_name::<T>()
+            )))
+        } else if buf.0.buf.align_offset(mem::align_of::<T>()) != 0 {
+            Err(PyBufferError::new_err(format!(
+                "buffer contents are insufficiently aligned for {}",
+                std::any::type_name::<T>()
+            )))
+        } else {
+            Ok(buf)
+        }
+    }
+
+    /// Gets the pointer to the start of the buffer memory.
+    ///
+    /// Warning: the buffer memory might be mutated by other Python functions,
+    /// and thus may only be accessed while the GIL is held.
+    #[inline]
+    pub fn buf_ptr(&self) -> *mut raw::c_void {
+        self.0.buf
+    }
+
+    /// Gets a pointer to the specified item.
+    ///
+    /// If `indices.len() < self.dimensions()`, returns the start address of the sub-array at the specified dimension.
+    pub fn get_ptr(&self, indices: &[usize]) -> *mut raw::c_void {
+        let shape = &self.shape()[..indices.len()];
+        for i in 0..indices.len() {
+            assert!(indices[i] < shape[i]);
+        }
+        unsafe {
+            ffi::PyBuffer_GetPointer(
+                #[cfg(Py_3_11)]
+                &*self.0,
+                #[cfg(not(Py_3_11))]
+                {
+                    &*self.0 as *const ffi::Py_buffer as *mut ffi::Py_buffer
+                },
+                #[cfg(Py_3_11)]
+                {
+                    indices.as_ptr().cast()
+                },
+                #[cfg(not(Py_3_11))]
+                {
+                    indices.as_ptr() as *mut ffi::Py_ssize_t
+                },
+            )
+        }
+    }
+
+    /// Gets whether the underlying buffer is read-only.
+    #[inline]
+    pub fn readonly(&self) -> bool {
+        self.0.readonly != 0
+    }
+
+    /// Gets the size of a single element, in bytes.
+    /// Important exception: when requesting an unformatted buffer, item_size still has the value
+    #[inline]
+    pub fn item_size(&self) -> usize {
+        self.0.itemsize as usize
+    }
+
+    /// Gets the total number of items.
+    #[inline]
+    pub fn item_count(&self) -> usize {
+        (self.0.len as usize) / (self.0.itemsize as usize)
+    }
+
+    /// `item_size() * item_count()`.
+    /// For contiguous arrays, this is the length of the underlying memory block.
+    /// For non-contiguous arrays, it is the length that the logical structure would have if it were copied to a contiguous representation.
+    #[inline]
+    pub fn len_bytes(&self) -> usize {
+        self.0.len as usize
+    }
+
+    /// Gets the number of dimensions.
+    ///
+    /// May be 0 to indicate a single scalar value.
+    #[inline]
+    pub fn dimensions(&self) -> usize {
+        self.0.ndim as usize
+    }
+
+    /// Returns an array of length `dimensions`. `shape()[i]` is the length of the array in dimension number `i`.
+    ///
+    /// May return None for single-dimensional arrays or scalar values (`dimensions() <= 1`);
+    /// You can call `item_count()` to get the length of the single dimension.
+    ///
+    /// Despite Python using an array of signed integers, the values are guaranteed to be non-negative.
+    /// However, dimensions of length 0 are possible and might need special attention.
+    #[inline]
+    pub fn shape(&self) -> &[usize] {
+        unsafe { slice::from_raw_parts(self.0.shape.cast(), self.0.ndim as usize) }
+    }
+
+    /// Returns an array that holds, for each dimension, the number of bytes to skip to get to the next element in the dimension.
+    ///
+    /// Stride values can be any integer. For regular arrays, strides are usually positive,
+    /// but a consumer MUST be able to handle the case `strides[n] <= 0`.
+    #[inline]
+    pub fn strides(&self) -> &[isize] {
+        unsafe { slice::from_raw_parts(self.0.strides, self.0.ndim as usize) }
+    }
+
+    /// An array of length ndim.
+    /// If `suboffsets[n] >= 0`, the values stored along the nth dimension are pointers and the suboffset value dictates how many bytes to add to each pointer after de-referencing.
+    /// A suboffset value that is negative indicates that no de-referencing should occur (striding in a contiguous memory block).
+    ///
+    /// If all suboffsets are negative (i.e. no de-referencing is needed), then this field must be NULL (the default value).
+    #[inline]
+    pub fn suboffsets(&self) -> Option<&[isize]> {
+        unsafe {
+            if self.0.suboffsets.is_null() {
+                None
+            } else {
+                Some(slice::from_raw_parts(
+                    self.0.suboffsets,
+                    self.0.ndim as usize,
+                ))
+            }
+        }
+    }
+
+    /// A NUL terminated string in struct module style syntax describing the contents of a single item.
+    #[inline]
+    pub fn format(&self) -> &CStr {
+        if self.0.format.is_null() {
+            ffi::c_str!("B")
+        } else {
+            unsafe { CStr::from_ptr(self.0.format) }
+        }
+    }
+
+    /// Gets whether the buffer is contiguous in C-style order (last index varies fastest when visiting items in order of memory address).
+    #[inline]
+    pub fn is_c_contiguous(&self) -> bool {
+        unsafe { ffi::PyBuffer_IsContiguous(&*self.0, b'C' as std::os::raw::c_char) != 0 }
+    }
+
+    /// Gets whether the buffer is contiguous in Fortran-style order (first index varies fastest when visiting items in order of memory address).
+    #[inline]
+    pub fn is_fortran_contiguous(&self) -> bool {
+        unsafe { ffi::PyBuffer_IsContiguous(&*self.0, b'F' as std::os::raw::c_char) != 0 }
+    }
+
+    /// Gets the buffer memory as a slice.
+    ///
+    /// This function succeeds if:
+    /// * the buffer format is compatible with `T`
+    /// * alignment and size of buffer elements is matching the expectations for type `T`
+    /// * the buffer is C-style contiguous
+    ///
+    /// The returned slice uses type `Cell<T>` because it's theoretically possible for any call into the Python runtime
+    /// to modify the values in the slice.
+    pub fn as_slice<'a>(&'a self, _py: Python<'a>) -> Option<&'a [ReadOnlyCell<T>]> {
+        if self.is_c_contiguous() {
+            unsafe {
+                Some(slice::from_raw_parts(
+                    self.0.buf as *mut ReadOnlyCell<T>,
+                    self.item_count(),
+                ))
+            }
+        } else {
+            None
+        }
+    }
+
+    /// Gets the buffer memory as a slice.
+    ///
+    /// This function succeeds if:
+    /// * the buffer is not read-only
+    /// * the buffer format is compatible with `T`
+    /// * alignment and size of buffer elements is matching the expectations for type `T`
+    /// * the buffer is C-style contiguous
+    ///
+    /// The returned slice uses type `Cell<T>` because it's theoretically possible for any call into the Python runtime
+    /// to modify the values in the slice.
+    pub fn as_mut_slice<'a>(&'a self, _py: Python<'a>) -> Option<&'a [cell::Cell<T>]> {
+        if !self.readonly() && self.is_c_contiguous() {
+            unsafe {
+                Some(slice::from_raw_parts(
+                    self.0.buf as *mut cell::Cell<T>,
+                    self.item_count(),
+                ))
+            }
+        } else {
+            None
+        }
+    }
+
+    /// Gets the buffer memory as a slice.
+    ///
+    /// This function succeeds if:
+    /// * the buffer format is compatible with `T`
+    /// * alignment and size of buffer elements is matching the expectations for type `T`
+    /// * the buffer is Fortran-style contiguous
+    ///
+    /// The returned slice uses type `Cell<T>` because it's theoretically possible for any call into the Python runtime
+    /// to modify the values in the slice.
+    pub fn as_fortran_slice<'a>(&'a self, _py: Python<'a>) -> Option<&'a [ReadOnlyCell<T>]> {
+        if mem::size_of::<T>() == self.item_size() && self.is_fortran_contiguous() {
+            unsafe {
+                Some(slice::from_raw_parts(
+                    self.0.buf as *mut ReadOnlyCell<T>,
+                    self.item_count(),
+                ))
+            }
+        } else {
+            None
+        }
+    }
+
+    /// Gets the buffer memory as a slice.
+    ///
+    /// This function succeeds if:
+    /// * the buffer is not read-only
+    /// * the buffer format is compatible with `T`
+    /// * alignment and size of buffer elements is matching the expectations for type `T`
+    /// * the buffer is Fortran-style contiguous
+    ///
+    /// The returned slice uses type `Cell<T>` because it's theoretically possible for any call into the Python runtime
+    /// to modify the values in the slice.
+    pub fn as_fortran_mut_slice<'a>(&'a self, _py: Python<'a>) -> Option<&'a [cell::Cell<T>]> {
+        if !self.readonly() && self.is_fortran_contiguous() {
+            unsafe {
+                Some(slice::from_raw_parts(
+                    self.0.buf as *mut cell::Cell<T>,
+                    self.item_count(),
+                ))
+            }
+        } else {
+            None
+        }
+    }
+
+    /// Copies the buffer elements to the specified slice.
+    /// If the buffer is multi-dimensional, the elements are written in C-style order.
+    ///
+    ///  * Fails if the slice does not have the correct length (`buf.item_count()`).
+    ///  * Fails if the buffer format is not compatible with type `T`.
+    ///
+    /// To check whether the buffer format is compatible before calling this method,
+    /// you can use `<T as buffer::Element>::is_compatible_format(buf.format())`.
+    /// Alternatively, `match buffer::ElementType::from_format(buf.format())`.
+    pub fn copy_to_slice(&self, py: Python<'_>, target: &mut [T]) -> PyResult<()> {
+        self._copy_to_slice(py, target, b'C')
+    }
+
+    /// Copies the buffer elements to the specified slice.
+    /// If the buffer is multi-dimensional, the elements are written in Fortran-style order.
+    ///
+    ///  * Fails if the slice does not have the correct length (`buf.item_count()`).
+    ///  * Fails if the buffer format is not compatible with type `T`.
+    ///
+    /// To check whether the buffer format is compatible before calling this method,
+    /// you can use `<T as buffer::Element>::is_compatible_format(buf.format())`.
+    /// Alternatively, `match buffer::ElementType::from_format(buf.format())`.
+    pub fn copy_to_fortran_slice(&self, py: Python<'_>, target: &mut [T]) -> PyResult<()> {
+        self._copy_to_slice(py, target, b'F')
+    }
+
+    fn _copy_to_slice(&self, py: Python<'_>, target: &mut [T], fort: u8) -> PyResult<()> {
+        if mem::size_of_val(target) != self.len_bytes() {
+            return Err(PyBufferError::new_err(format!(
+                "slice to copy to (of length {}) does not match buffer length of {}",
+                target.len(),
+                self.item_count()
+            )));
+        }
+
+        err::error_on_minusone(py, unsafe {
+            ffi::PyBuffer_ToContiguous(
+                target.as_mut_ptr().cast(),
+                #[cfg(Py_3_11)]
+                &*self.0,
+                #[cfg(not(Py_3_11))]
+                {
+                    &*self.0 as *const ffi::Py_buffer as *mut ffi::Py_buffer
+                },
+                self.0.len,
+                fort as std::os::raw::c_char,
+            )
+        })
+    }
+
+    /// Copies the buffer elements to a newly allocated vector.
+    /// If the buffer is multi-dimensional, the elements are written in C-style order.
+    ///
+    /// Fails if the buffer format is not compatible with type `T`.
+    pub fn to_vec(&self, py: Python<'_>) -> PyResult<Vec<T>> {
+        self._to_vec(py, b'C')
+    }
+
+    /// Copies the buffer elements to a newly allocated vector.
+    /// If the buffer is multi-dimensional, the elements are written in Fortran-style order.
+    ///
+    /// Fails if the buffer format is not compatible with type `T`.
+    pub fn to_fortran_vec(&self, py: Python<'_>) -> PyResult<Vec<T>> {
+        self._to_vec(py, b'F')
+    }
+
+    fn _to_vec(&self, py: Python<'_>, fort: u8) -> PyResult<Vec<T>> {
+        let item_count = self.item_count();
+        let mut vec: Vec<T> = Vec::with_capacity(item_count);
+
+        // Copy the buffer into the uninitialized space in the vector.
+        // Due to T:Copy, we don't need to be concerned with Drop impls.
+        err::error_on_minusone(py, unsafe {
+            ffi::PyBuffer_ToContiguous(
+                vec.as_ptr() as *mut raw::c_void,
+                #[cfg(Py_3_11)]
+                &*self.0,
+                #[cfg(not(Py_3_11))]
+                {
+                    &*self.0 as *const ffi::Py_buffer as *mut ffi::Py_buffer
+                },
+                self.0.len,
+                fort as std::os::raw::c_char,
+            )
+        })?;
+        // set vector length to mark the now-initialized space as usable
+        unsafe { vec.set_len(item_count) };
+        Ok(vec)
+    }
+
+    /// Copies the specified slice into the buffer.
+    /// If the buffer is multi-dimensional, the elements in the slice are expected to be in C-style order.
+    ///
+    ///  * Fails if the buffer is read-only.
+    ///  * Fails if the slice does not have the correct length (`buf.item_count()`).
+    ///  * Fails if the buffer format is not compatible with type `T`.
+    ///
+    /// To check whether the buffer format is compatible before calling this method,
+    /// use `<T as buffer::Element>::is_compatible_format(buf.format())`.
+    /// Alternatively, `match buffer::ElementType::from_format(buf.format())`.
+    pub fn copy_from_slice(&self, py: Python<'_>, source: &[T]) -> PyResult<()> {
+        self._copy_from_slice(py, source, b'C')
+    }
+
+    /// Copies the specified slice into the buffer.
+    /// If the buffer is multi-dimensional, the elements in the slice are expected to be in Fortran-style order.
+    ///
+    ///  * Fails if the buffer is read-only.
+    ///  * Fails if the slice does not have the correct length (`buf.item_count()`).
+    ///  * Fails if the buffer format is not compatible with type `T`.
+    ///
+    /// To check whether the buffer format is compatible before calling this method,
+    /// use `<T as buffer::Element>::is_compatible_format(buf.format())`.
+    /// Alternatively, `match buffer::ElementType::from_format(buf.format())`.
+    pub fn copy_from_fortran_slice(&self, py: Python<'_>, source: &[T]) -> PyResult<()> {
+        self._copy_from_slice(py, source, b'F')
+    }
+
+    fn _copy_from_slice(&self, py: Python<'_>, source: &[T], fort: u8) -> PyResult<()> {
+        if self.readonly() {
+            return Err(PyBufferError::new_err("cannot write to read-only buffer"));
+        } else if mem::size_of_val(source) != self.len_bytes() {
+            return Err(PyBufferError::new_err(format!(
+                "slice to copy from (of length {}) does not match buffer length of {}",
+                source.len(),
+                self.item_count()
+            )));
+        }
+
+        err::error_on_minusone(py, unsafe {
+            ffi::PyBuffer_FromContiguous(
+                #[cfg(Py_3_11)]
+                &*self.0,
+                #[cfg(not(Py_3_11))]
+                {
+                    &*self.0 as *const ffi::Py_buffer as *mut ffi::Py_buffer
+                },
+                #[cfg(Py_3_11)]
+                {
+                    source.as_ptr().cast()
+                },
+                #[cfg(not(Py_3_11))]
+                {
+                    source.as_ptr() as *mut raw::c_void
+                },
+                self.0.len,
+                fort as std::os::raw::c_char,
+            )
+        })
+    }
+
+    /// Releases the buffer object, freeing the reference to the Python object
+    /// which owns the buffer.
+    ///
+    /// This will automatically be called on drop.
+    pub fn release(self, _py: Python<'_>) {
+        // First move self into a ManuallyDrop, so that PyBuffer::drop will
+        // never be called. (It would acquire the GIL and call PyBuffer_Release
+        // again.)
+        let mut mdself = mem::ManuallyDrop::new(self);
+        unsafe {
+            // Next, make the actual PyBuffer_Release call.
+            ffi::PyBuffer_Release(&mut *mdself.0);
+
+            // Finally, drop the contained Pin<Box<_>> in place, to free the
+            // Box memory.
+            let inner: *mut Pin<Box<ffi::Py_buffer>> = &mut mdself.0;
+            ptr::drop_in_place(inner);
+        }
+    }
+}
+
+impl<T> Drop for PyBuffer<T> {
+    fn drop(&mut self) {
+        Python::with_gil(|_| unsafe { ffi::PyBuffer_Release(&mut *self.0) });
+    }
+}
+
+/// Like [std::cell::Cell], but only provides read-only access to the data.
+///
+/// `&ReadOnlyCell<T>` is basically a safe version of `*const T`:
+///  The data cannot be modified through the reference, but other references may
+///  be modifying the data.
+#[repr(transparent)]
+pub struct ReadOnlyCell<T: Element>(cell::UnsafeCell<T>);
+
+impl<T: Element> ReadOnlyCell<T> {
+    /// Returns a copy of the current value.
+    #[inline]
+    pub fn get(&self) -> T {
+        unsafe { *self.0.get() }
+    }
+
+    /// Returns a pointer to the current value.
+    #[inline]
+    pub fn as_ptr(&self) -> *const T {
+        self.0.get()
+    }
+}
+
+macro_rules! impl_element(
+    ($t:ty, $f:ident) => {
+        unsafe impl Element for $t {
+            fn is_compatible_format(format: &CStr) -> bool {
+                let slice = format.to_bytes();
+                if slice.len() > 1 && !is_matching_endian(slice[0]) {
+                    return false;
+                }
+                ElementType::from_format(format) == ElementType::$f { bytes: mem::size_of::<$t>() }
+            }
+        }
+    }
+);
+
+impl_element!(u8, UnsignedInteger);
+impl_element!(u16, UnsignedInteger);
+impl_element!(u32, UnsignedInteger);
+impl_element!(u64, UnsignedInteger);
+impl_element!(usize, UnsignedInteger);
+impl_element!(i8, SignedInteger);
+impl_element!(i16, SignedInteger);
+impl_element!(i32, SignedInteger);
+impl_element!(i64, SignedInteger);
+impl_element!(isize, SignedInteger);
+impl_element!(f32, Float);
+impl_element!(f64, Float);
+
+#[cfg(test)]
+mod tests {
+    use super::PyBuffer;
+    use crate::ffi;
+    use crate::types::any::PyAnyMethods;
+    use crate::Python;
+
+    #[test]
+    fn test_debug() {
+        Python::with_gil(|py| {
+            let bytes = py.eval_bound("b'abcde'", None, None).unwrap();
+            let buffer: PyBuffer<u8> = PyBuffer::get_bound(&bytes).unwrap();
+            let expected = format!(
+                concat!(
+                    "PyBuffer {{ buf: {:?}, obj: {:?}, ",
+                    "len: 5, itemsize: 1, readonly: 1, ",
+                    "ndim: 1, format: {:?}, shape: {:?}, ",
+                    "strides: {:?}, suboffsets: {:?}, internal: {:?} }}",
+                ),
+                buffer.0.buf,
+                buffer.0.obj,
+                buffer.0.format,
+                buffer.0.shape,
+                buffer.0.strides,
+                buffer.0.suboffsets,
+                buffer.0.internal
+            );
+            let debug_repr = format!("{:?}", buffer);
+            assert_eq!(debug_repr, expected);
+        });
+    }
+
+    #[test]
+    fn test_element_type_from_format() {
+        use super::ElementType;
+        use super::ElementType::*;
+        use std::mem::size_of;
+        use std::os::raw;
+
+        for (cstr, expected) in [
+            // @ prefix goes to native_element_type_from_type_char
+            (
+                ffi::c_str!("@b"),
+                SignedInteger {
+                    bytes: size_of::<raw::c_schar>(),
+                },
+            ),
+            (
+                ffi::c_str!("@c"),
+                UnsignedInteger {
+                    bytes: size_of::<raw::c_char>(),
+                },
+            ),
+            (
+                ffi::c_str!("@b"),
+                SignedInteger {
+                    bytes: size_of::<raw::c_schar>(),
+                },
+            ),
+            (
+                ffi::c_str!("@B"),
+                UnsignedInteger {
+                    bytes: size_of::<raw::c_uchar>(),
+                },
+            ),
+            (ffi::c_str!("@?"), Bool),
+            (
+                ffi::c_str!("@h"),
+                SignedInteger {
+                    bytes: size_of::<raw::c_short>(),
+                },
+            ),
+            (
+                ffi::c_str!("@H"),
+                UnsignedInteger {
+                    bytes: size_of::<raw::c_ushort>(),
+                },
+            ),
+            (
+                ffi::c_str!("@i"),
+                SignedInteger {
+                    bytes: size_of::<raw::c_int>(),
+                },
+            ),
+            (
+                ffi::c_str!("@I"),
+                UnsignedInteger {
+                    bytes: size_of::<raw::c_uint>(),
+                },
+            ),
+            (
+                ffi::c_str!("@l"),
+                SignedInteger {
+                    bytes: size_of::<raw::c_long>(),
+                },
+            ),
+            (
+                ffi::c_str!("@L"),
+                UnsignedInteger {
+                    bytes: size_of::<raw::c_ulong>(),
+                },
+            ),
+            (
+                ffi::c_str!("@q"),
+                SignedInteger {
+                    bytes: size_of::<raw::c_longlong>(),
+                },
+            ),
+            (
+                ffi::c_str!("@Q"),
+                UnsignedInteger {
+                    bytes: size_of::<raw::c_ulonglong>(),
+                },
+            ),
+            (
+                ffi::c_str!("@n"),
+                SignedInteger {
+                    bytes: size_of::<libc::ssize_t>(),
+                },
+            ),
+            (
+                ffi::c_str!("@N"),
+                UnsignedInteger {
+                    bytes: size_of::<libc::size_t>(),
+                },
+            ),
+            (ffi::c_str!("@e"), Float { bytes: 2 }),
+            (ffi::c_str!("@f"), Float { bytes: 4 }),
+            (ffi::c_str!("@d"), Float { bytes: 8 }),
+            (ffi::c_str!("@z"), Unknown),
+            // = prefix goes to standard_element_type_from_type_char
+            (ffi::c_str!("=b"), SignedInteger { bytes: 1 }),
+            (ffi::c_str!("=c"), UnsignedInteger { bytes: 1 }),
+            (ffi::c_str!("=B"), UnsignedInteger { bytes: 1 }),
+            (ffi::c_str!("=?"), Bool),
+            (ffi::c_str!("=h"), SignedInteger { bytes: 2 }),
+            (ffi::c_str!("=H"), UnsignedInteger { bytes: 2 }),
+            (ffi::c_str!("=l"), SignedInteger { bytes: 4 }),
+            (ffi::c_str!("=l"), SignedInteger { bytes: 4 }),
+            (ffi::c_str!("=I"), UnsignedInteger { bytes: 4 }),
+            (ffi::c_str!("=L"), UnsignedInteger { bytes: 4 }),
+            (ffi::c_str!("=q"), SignedInteger { bytes: 8 }),
+            (ffi::c_str!("=Q"), UnsignedInteger { bytes: 8 }),
+            (ffi::c_str!("=e"), Float { bytes: 2 }),
+            (ffi::c_str!("=f"), Float { bytes: 4 }),
+            (ffi::c_str!("=d"), Float { bytes: 8 }),
+            (ffi::c_str!("=z"), Unknown),
+            (ffi::c_str!("=0"), Unknown),
+            // unknown prefix -> Unknown
+            (ffi::c_str!(":b"), Unknown),
+        ] {
+            assert_eq!(
+                ElementType::from_format(cstr),
+                expected,
+                "element from format &Cstr: {:?}",
+                cstr,
+            );
+        }
+    }
+
+    #[test]
+    fn test_compatible_size() {
+        // for the cast in PyBuffer::shape()
+        assert_eq!(
+            std::mem::size_of::<ffi::Py_ssize_t>(),
+            std::mem::size_of::<usize>()
+        );
+    }
+
+    #[test]
+    fn test_bytes_buffer() {
+        Python::with_gil(|py| {
+            let bytes = py.eval_bound("b'abcde'", None, None).unwrap();
+            let buffer = PyBuffer::get_bound(&bytes).unwrap();
+            assert_eq!(buffer.dimensions(), 1);
+            assert_eq!(buffer.item_count(), 5);
+            assert_eq!(buffer.format().to_str().unwrap(), "B");
+            assert_eq!(buffer.shape(), [5]);
+            // single-dimensional buffer is always contiguous
+            assert!(buffer.is_c_contiguous());
+            assert!(buffer.is_fortran_contiguous());
+
+            let slice = buffer.as_slice(py).unwrap();
+            assert_eq!(slice.len(), 5);
+            assert_eq!(slice[0].get(), b'a');
+            assert_eq!(slice[2].get(), b'c');
+
+            assert_eq!(unsafe { *(buffer.get_ptr(&[1]) as *mut u8) }, b'b');
+
+            assert!(buffer.as_mut_slice(py).is_none());
+
+            assert!(buffer.copy_to_slice(py, &mut [0u8]).is_err());
+            let mut arr = [0; 5];
+            buffer.copy_to_slice(py, &mut arr).unwrap();
+            assert_eq!(arr, b"abcde" as &[u8]);
+
+            assert!(buffer.copy_from_slice(py, &[0u8; 5]).is_err());
+            assert_eq!(buffer.to_vec(py).unwrap(), b"abcde");
+        });
+    }
+
+    #[test]
+    fn test_array_buffer() {
+        Python::with_gil(|py| {
+            let array = py
+                .import_bound("array")
+                .unwrap()
+                .call_method("array", ("f", (1.0, 1.5, 2.0, 2.5)), None)
+                .unwrap();
+            let buffer = PyBuffer::get_bound(&array).unwrap();
+            assert_eq!(buffer.dimensions(), 1);
+            assert_eq!(buffer.item_count(), 4);
+            assert_eq!(buffer.format().to_str().unwrap(), "f");
+            assert_eq!(buffer.shape(), [4]);
+
+            // array creates a 1D contiguious buffer, so it's both C and F contiguous.  This would
+            // be more interesting if we can come up with a 2D buffer but I think it would need a
+            // third-party lib or a custom class.
+
+            // C-contiguous fns
+            let slice = buffer.as_slice(py).unwrap();
+            assert_eq!(slice.len(), 4);
+            assert_eq!(slice[0].get(), 1.0);
+            assert_eq!(slice[3].get(), 2.5);
+
+            let mut_slice = buffer.as_mut_slice(py).unwrap();
+            assert_eq!(mut_slice.len(), 4);
+            assert_eq!(mut_slice[0].get(), 1.0);
+            mut_slice[3].set(2.75);
+            assert_eq!(slice[3].get(), 2.75);
+
+            buffer
+                .copy_from_slice(py, &[10.0f32, 11.0, 12.0, 13.0])
+                .unwrap();
+            assert_eq!(slice[2].get(), 12.0);
+
+            assert_eq!(buffer.to_vec(py).unwrap(), [10.0, 11.0, 12.0, 13.0]);
+
+            // F-contiguous fns
+            let buffer = PyBuffer::get_bound(&array).unwrap();
+            let slice = buffer.as_fortran_slice(py).unwrap();
+            assert_eq!(slice.len(), 4);
+            assert_eq!(slice[1].get(), 11.0);
+
+            let mut_slice = buffer.as_fortran_mut_slice(py).unwrap();
+            assert_eq!(mut_slice.len(), 4);
+            assert_eq!(mut_slice[2].get(), 12.0);
+            mut_slice[3].set(2.75);
+            assert_eq!(slice[3].get(), 2.75);
+
+            buffer
+                .copy_from_fortran_slice(py, &[10.0f32, 11.0, 12.0, 13.0])
+                .unwrap();
+            assert_eq!(slice[2].get(), 12.0);
+
+            assert_eq!(buffer.to_fortran_vec(py).unwrap(), [10.0, 11.0, 12.0, 13.0]);
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/callback.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/callback.rs
--- 43.0.0-1/rust-vendor/pyo3/src/callback.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/callback.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,173 @@
+//! Utilities for a Python callable object that invokes a Rust function.
+
+use crate::err::{PyErr, PyResult};
+use crate::exceptions::PyOverflowError;
+use crate::ffi::{self, Py_hash_t};
+use crate::{IntoPy, PyObject, Python};
+use std::os::raw::c_int;
+
+/// A type which can be the return type of a python C-API callback
+pub trait PyCallbackOutput: Copy {
+    /// The error value to return to python if the callback raised an exception
+    const ERR_VALUE: Self;
+}
+
+impl PyCallbackOutput for *mut ffi::PyObject {
+    const ERR_VALUE: Self = std::ptr::null_mut();
+}
+
+impl PyCallbackOutput for std::os::raw::c_int {
+    const ERR_VALUE: Self = -1;
+}
+
+impl PyCallbackOutput for ffi::Py_ssize_t {
+    const ERR_VALUE: Self = -1;
+}
+
+/// Convert the result of callback function into the appropriate return value.
+pub trait IntoPyCallbackOutput<Target> {
+    fn convert(self, py: Python<'_>) -> PyResult<Target>;
+}
+
+impl<T, E, U> IntoPyCallbackOutput<U> for Result<T, E>
+where
+    T: IntoPyCallbackOutput<U>,
+    E: Into<PyErr>,
+{
+    #[inline]
+    fn convert(self, py: Python<'_>) -> PyResult<U> {
+        match self {
+            Ok(v) => v.convert(py),
+            Err(e) => Err(e.into()),
+        }
+    }
+}
+
+impl<T> IntoPyCallbackOutput<*mut ffi::PyObject> for T
+where
+    T: IntoPy<PyObject>,
+{
+    #[inline]
+    fn convert(self, py: Python<'_>) -> PyResult<*mut ffi::PyObject> {
+        Ok(self.into_py(py).into_ptr())
+    }
+}
+
+impl IntoPyCallbackOutput<Self> for *mut ffi::PyObject {
+    #[inline]
+    fn convert(self, _: Python<'_>) -> PyResult<Self> {
+        Ok(self)
+    }
+}
+
+impl IntoPyCallbackOutput<std::os::raw::c_int> for () {
+    #[inline]
+    fn convert(self, _: Python<'_>) -> PyResult<std::os::raw::c_int> {
+        Ok(0)
+    }
+}
+
+impl IntoPyCallbackOutput<std::os::raw::c_int> for bool {
+    #[inline]
+    fn convert(self, _: Python<'_>) -> PyResult<std::os::raw::c_int> {
+        Ok(self as c_int)
+    }
+}
+
+impl IntoPyCallbackOutput<()> for () {
+    #[inline]
+    fn convert(self, _: Python<'_>) -> PyResult<()> {
+        Ok(())
+    }
+}
+
+impl IntoPyCallbackOutput<ffi::Py_ssize_t> for usize {
+    #[inline]
+    fn convert(self, _py: Python<'_>) -> PyResult<ffi::Py_ssize_t> {
+        self.try_into().map_err(|_err| PyOverflowError::new_err(()))
+    }
+}
+
+// Converters needed for `#[pyproto]` implementations
+
+impl IntoPyCallbackOutput<bool> for bool {
+    #[inline]
+    fn convert(self, _: Python<'_>) -> PyResult<bool> {
+        Ok(self)
+    }
+}
+
+impl IntoPyCallbackOutput<usize> for usize {
+    #[inline]
+    fn convert(self, _: Python<'_>) -> PyResult<usize> {
+        Ok(self)
+    }
+}
+
+impl<T> IntoPyCallbackOutput<PyObject> for T
+where
+    T: IntoPy<PyObject>,
+{
+    #[inline]
+    fn convert(self, py: Python<'_>) -> PyResult<PyObject> {
+        Ok(self.into_py(py))
+    }
+}
+
+pub trait WrappingCastTo<T> {
+    fn wrapping_cast(self) -> T;
+}
+
+macro_rules! wrapping_cast {
+    ($from:ty, $to:ty) => {
+        impl WrappingCastTo<$to> for $from {
+            #[inline]
+            fn wrapping_cast(self) -> $to {
+                self as $to
+            }
+        }
+    };
+}
+wrapping_cast!(u8, Py_hash_t);
+wrapping_cast!(u16, Py_hash_t);
+wrapping_cast!(u32, Py_hash_t);
+wrapping_cast!(usize, Py_hash_t);
+wrapping_cast!(u64, Py_hash_t);
+wrapping_cast!(i8, Py_hash_t);
+wrapping_cast!(i16, Py_hash_t);
+wrapping_cast!(i32, Py_hash_t);
+wrapping_cast!(isize, Py_hash_t);
+wrapping_cast!(i64, Py_hash_t);
+
+pub struct HashCallbackOutput(Py_hash_t);
+
+impl IntoPyCallbackOutput<Py_hash_t> for HashCallbackOutput {
+    #[inline]
+    fn convert(self, _py: Python<'_>) -> PyResult<Py_hash_t> {
+        let hash = self.0;
+        if hash == -1 {
+            Ok(-2)
+        } else {
+            Ok(hash)
+        }
+    }
+}
+
+impl<T> IntoPyCallbackOutput<HashCallbackOutput> for T
+where
+    T: WrappingCastTo<Py_hash_t>,
+{
+    #[inline]
+    fn convert(self, _py: Python<'_>) -> PyResult<HashCallbackOutput> {
+        Ok(HashCallbackOutput(self.wrapping_cast()))
+    }
+}
+
+#[doc(hidden)]
+#[inline]
+pub fn convert<T, U>(py: Python<'_>, value: T) -> PyResult<U>
+where
+    T: IntoPyCallbackOutput<U>,
+{
+    value.convert(py)
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversion.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversion.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversion.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversion.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,715 @@
+//! Defines conversions between Rust and Python types.
+use crate::err::PyResult;
+#[cfg(feature = "experimental-inspect")]
+use crate::inspect::types::TypeInfo;
+use crate::pyclass::boolean_struct::False;
+use crate::types::any::PyAnyMethods;
+use crate::types::PyTuple;
+use crate::{ffi, Borrowed, Bound, Py, PyAny, PyClass, PyObject, PyRef, PyRefMut, Python};
+#[cfg(feature = "gil-refs")]
+use {
+    crate::{
+        err::{self, PyDowncastError},
+        gil, PyNativeType,
+    },
+    std::ptr::NonNull,
+};
+
+/// Returns a borrowed pointer to a Python object.
+///
+/// The returned pointer will be valid for as long as `self` is. It may be null depending on the
+/// implementation.
+///
+/// # Examples
+///
+/// ```rust
+/// use pyo3::prelude::*;
+/// use pyo3::types::PyString;
+/// use pyo3::ffi;
+///
+/// Python::with_gil(|py| {
+///     let s: Py<PyString> = "foo".into_py(py);
+///     let ptr = s.as_ptr();
+///
+///     let is_really_a_pystring = unsafe { ffi::PyUnicode_CheckExact(ptr) };
+///     assert_eq!(is_really_a_pystring, 1);
+/// });
+/// ```
+///
+/// # Safety
+///
+/// For callers, it is your responsibility to make sure that the underlying Python object is not dropped too
+/// early. For example, the following code will cause undefined behavior:
+///
+/// ```rust,no_run
+/// # use pyo3::prelude::*;
+/// # use pyo3::ffi;
+/// #
+/// Python::with_gil(|py| {
+///     let ptr: *mut ffi::PyObject = 0xabad1dea_u32.into_py(py).as_ptr();
+///
+///     let isnt_a_pystring = unsafe {
+///         // `ptr` is dangling, this is UB
+///         ffi::PyUnicode_CheckExact(ptr)
+///     };
+/// #    assert_eq!(isnt_a_pystring, 0);
+/// });
+/// ```
+///
+/// This happens because the pointer returned by `as_ptr` does not carry any lifetime information
+/// and the Python object is dropped immediately after the `0xabad1dea_u32.into_py(py).as_ptr()`
+/// expression is evaluated. To fix the problem, bind Python object to a local variable like earlier
+/// to keep the Python object alive until the end of its scope.
+///
+/// Implementors must ensure this returns a valid pointer to a Python object, which borrows a reference count from `&self`.
+pub unsafe trait AsPyPointer {
+    /// Returns the underlying FFI pointer as a borrowed pointer.
+    fn as_ptr(&self) -> *mut ffi::PyObject;
+}
+
+/// Conversion trait that allows various objects to be converted into `PyObject`.
+pub trait ToPyObject {
+    /// Converts self into a Python object.
+    fn to_object(&self, py: Python<'_>) -> PyObject;
+}
+
+/// Defines a conversion from a Rust type to a Python object.
+///
+/// It functions similarly to std's [`Into`] trait, but requires a [GIL token](Python)
+/// as an argument. Many functions and traits internal to PyO3 require this trait as a bound,
+/// so a lack of this trait can manifest itself in different error messages.
+///
+/// # Examples
+/// ## With `#[pyclass]`
+/// The easiest way to implement `IntoPy` is by exposing a struct as a native Python object
+/// by annotating it with [`#[pyclass]`](crate::prelude::pyclass).
+///
+/// ```rust
+/// use pyo3::prelude::*;
+///
+/// #[pyclass]
+/// struct Number {
+///     #[pyo3(get, set)]
+///     value: i32,
+/// }
+/// ```
+/// Python code will see this as an instance of the `Number` class with a `value` attribute.
+///
+/// ## Conversion to a Python object
+///
+/// However, it may not be desirable to expose the existence of `Number` to Python code.
+/// `IntoPy` allows us to define a conversion to an appropriate Python object.
+/// ```rust
+/// use pyo3::prelude::*;
+///
+/// # #[allow(dead_code)]
+/// struct Number {
+///     value: i32,
+/// }
+///
+/// impl IntoPy<PyObject> for Number {
+///     fn into_py(self, py: Python<'_>) -> PyObject {
+///         // delegates to i32's IntoPy implementation.
+///         self.value.into_py(py)
+///     }
+/// }
+/// ```
+/// Python code will see this as an `int` object.
+///
+/// ## Dynamic conversion into Python objects.
+/// It is also possible to return a different Python object depending on some condition.
+/// This is useful for types like enums that can carry different types.
+///
+/// ```rust
+/// use pyo3::prelude::*;
+///
+/// enum Value {
+///     Integer(i32),
+///     String(String),
+///     None,
+/// }
+///
+/// impl IntoPy<PyObject> for Value {
+///     fn into_py(self, py: Python<'_>) -> PyObject {
+///         match self {
+///             Self::Integer(val) => val.into_py(py),
+///             Self::String(val) => val.into_py(py),
+///             Self::None => py.None(),
+///         }
+///     }
+/// }
+/// # fn main() {
+/// #     Python::with_gil(|py| {
+/// #         let v = Value::Integer(73).into_py(py);
+/// #         let v = v.extract::<i32>(py).unwrap();
+/// #
+/// #         let v = Value::String("foo".into()).into_py(py);
+/// #         let v = v.extract::<String>(py).unwrap();
+/// #
+/// #         let v = Value::None.into_py(py);
+/// #         let v = v.extract::<Option<Vec<i32>>>(py).unwrap();
+/// #     });
+/// # }
+/// ```
+/// Python code will see this as any of the `int`, `string` or `None` objects.
+#[cfg_attr(
+    diagnostic_namespace,
+    diagnostic::on_unimplemented(
+        message = "`{Self}` cannot be converted to a Python object",
+        note = "`IntoPy` is automatically implemented by the `#[pyclass]` macro",
+        note = "if you do not wish to have a corresponding Python type, implement it manually",
+        note = "if you do not own `{Self}` you can perform a manual conversion to one of the types in `pyo3::types::*`"
+    )
+)]
+pub trait IntoPy<T>: Sized {
+    /// Performs the conversion.
+    fn into_py(self, py: Python<'_>) -> T;
+
+    /// Extracts the type hint information for this type when it appears as a return value.
+    ///
+    /// For example, `Vec<u32>` would return `List[int]`.
+    /// The default implementation returns `Any`, which is correct for any type.
+    ///
+    /// For most types, the return value for this method will be identical to that of [`FromPyObject::type_input`].
+    /// It may be different for some types, such as `Dict`, to allow duck-typing: functions return `Dict` but take `Mapping` as argument.
+    #[cfg(feature = "experimental-inspect")]
+    fn type_output() -> TypeInfo {
+        TypeInfo::Any
+    }
+}
+
+/// Extract a type from a Python object.
+///
+///
+/// Normal usage is through the `extract` methods on [`Bound`] and [`Py`], which forward to this trait.
+///
+/// # Examples
+///
+/// ```rust
+/// use pyo3::prelude::*;
+/// use pyo3::types::PyString;
+///
+/// # fn main() -> PyResult<()> {
+/// Python::with_gil(|py| {
+///     // Calling `.extract()` on a `Bound` smart pointer
+///     let obj: Bound<'_, PyString> = PyString::new_bound(py, "blah");
+///     let s: String = obj.extract()?;
+/// #   assert_eq!(s, "blah");
+///
+///     // Calling `.extract(py)` on a `Py` smart pointer
+///     let obj: Py<PyString> = obj.unbind();
+///     let s: String = obj.extract(py)?;
+/// #   assert_eq!(s, "blah");
+/// #   Ok(())
+/// })
+/// # }
+/// ```
+///
+// /// FIXME: until `FromPyObject` can pick up a second lifetime, the below commentary is no longer
+// /// true. Update and restore this documentation at that time.
+// ///
+// /// Note: depending on the implementation, the lifetime of the extracted result may
+// /// depend on the lifetime of the `obj` or the `prepared` variable.
+// ///
+// /// For example, when extracting `&str` from a Python byte string, the resulting string slice will
+// /// point to the existing string data (lifetime: `'py`).
+// /// On the other hand, when extracting `&str` from a Python Unicode string, the preparation step
+// /// will convert the string to UTF-8, and the resulting string slice will have lifetime `'prepared`.
+// /// Since which case applies depends on the runtime type of the Python object,
+// /// both the `obj` and `prepared` variables must outlive the resulting string slice.
+///
+/// During the migration of PyO3 from the "GIL Refs" API to the `Bound<T>` smart pointer, this trait
+/// has two methods `extract` and `extract_bound` which are defaulted to call each other. To avoid
+/// infinite recursion, implementors must implement at least one of these methods. The recommendation
+/// is to implement `extract_bound` and leave `extract` as the default implementation.
+pub trait FromPyObject<'py>: Sized {
+    /// Extracts `Self` from the source GIL Ref `obj`.
+    ///
+    /// Implementors are encouraged to implement `extract_bound` and leave this method as the
+    /// default implementation, which will forward calls to `extract_bound`.
+    #[cfg(feature = "gil-refs")]
+    fn extract(ob: &'py PyAny) -> PyResult<Self> {
+        Self::extract_bound(&ob.as_borrowed())
+    }
+
+    /// Extracts `Self` from the bound smart pointer `obj`.
+    ///
+    /// Implementors are encouraged to implement this method and leave `extract` defaulted, as
+    /// this will be most compatible with PyO3's future API.
+    fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self>;
+
+    /// Extracts the type hint information for this type when it appears as an argument.
+    ///
+    /// For example, `Vec<u32>` would return `Sequence[int]`.
+    /// The default implementation returns `Any`, which is correct for any type.
+    ///
+    /// For most types, the return value for this method will be identical to that of [`IntoPy::type_output`].
+    /// It may be different for some types, such as `Dict`, to allow duck-typing: functions return `Dict` but take `Mapping` as argument.
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        TypeInfo::Any
+    }
+}
+
+mod from_py_object_bound_sealed {
+    /// Private seal for the `FromPyObjectBound` trait.
+    ///
+    /// This prevents downstream types from implementing the trait before
+    /// PyO3 is ready to declare the trait as public API.
+    pub trait Sealed {}
+
+    // This generic implementation is why the seal is separate from
+    // `crate::sealed::Sealed`.
+    impl<'py, T> Sealed for T where T: super::FromPyObject<'py> {}
+    #[cfg(not(feature = "gil-refs"))]
+    impl Sealed for &'_ str {}
+    #[cfg(not(feature = "gil-refs"))]
+    impl Sealed for std::borrow::Cow<'_, str> {}
+    #[cfg(not(feature = "gil-refs"))]
+    impl Sealed for &'_ [u8] {}
+    #[cfg(not(feature = "gil-refs"))]
+    impl Sealed for std::borrow::Cow<'_, [u8]> {}
+}
+
+/// Expected form of [`FromPyObject`] to be used in a future PyO3 release.
+///
+/// The difference between this and `FromPyObject` is that this trait takes an
+/// additional lifetime `'a`, which is the lifetime of the input `Bound`.
+///
+/// This allows implementations for `&'a str` and `&'a [u8]`, which could not
+/// be expressed by the existing `FromPyObject` trait once the GIL Refs API was
+/// removed.
+///
+/// # Usage
+///
+/// Users are prevented from implementing this trait, instead they should implement
+/// the normal `FromPyObject` trait. This trait has a blanket implementation
+/// for `T: FromPyObject`.
+///
+/// The only case where this trait may have a use case to be implemented is when the
+/// lifetime of the extracted value is tied to the lifetime `'a` of the input `Bound`
+/// instead of the GIL lifetime `py`, as is the case for the `&'a str` implementation.
+///
+/// Please contact the PyO3 maintainers if you believe you have a use case for implementing
+/// this trait before PyO3 is ready to change the main `FromPyObject` trait to take an
+/// additional lifetime.
+///
+/// Similarly, users should typically not call these trait methods and should instead
+/// use this via the `extract` method on `Bound` and `Py`.
+pub trait FromPyObjectBound<'a, 'py>: Sized + from_py_object_bound_sealed::Sealed {
+    /// Extracts `Self` from the bound smart pointer `obj`.
+    ///
+    /// Users are advised against calling this method directly: instead, use this via
+    /// [`Bound<'_, PyAny>::extract`] or [`Py::extract`].
+    fn from_py_object_bound(ob: Borrowed<'a, 'py, PyAny>) -> PyResult<Self>;
+
+    /// Extracts the type hint information for this type when it appears as an argument.
+    ///
+    /// For example, `Vec<u32>` would return `Sequence[int]`.
+    /// The default implementation returns `Any`, which is correct for any type.
+    ///
+    /// For most types, the return value for this method will be identical to that of [`IntoPy::type_output`].
+    /// It may be different for some types, such as `Dict`, to allow duck-typing: functions return `Dict` but take `Mapping` as argument.
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        TypeInfo::Any
+    }
+}
+
+impl<'py, T> FromPyObjectBound<'_, 'py> for T
+where
+    T: FromPyObject<'py>,
+{
+    fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> PyResult<Self> {
+        Self::extract_bound(&ob)
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        <T as FromPyObject>::type_input()
+    }
+}
+
+/// Identity conversion: allows using existing `PyObject` instances where
+/// `T: ToPyObject` is expected.
+impl<T: ?Sized + ToPyObject> ToPyObject for &'_ T {
+    #[inline]
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        <T as ToPyObject>::to_object(*self, py)
+    }
+}
+
+impl IntoPy<PyObject> for &'_ PyAny {
+    #[inline]
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        unsafe { PyObject::from_borrowed_ptr(py, self.as_ptr()) }
+    }
+}
+
+impl<T> IntoPy<PyObject> for &'_ T
+where
+    T: AsRef<PyAny>,
+{
+    #[inline]
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        unsafe { PyObject::from_borrowed_ptr(py, self.as_ref().as_ptr()) }
+    }
+}
+
+#[allow(deprecated)]
+#[cfg(feature = "gil-refs")]
+impl<'py, T> FromPyObject<'py> for &'py crate::PyCell<T>
+where
+    T: PyClass,
+{
+    fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self> {
+        obj.clone().into_gil_ref().downcast().map_err(Into::into)
+    }
+}
+
+impl<T> FromPyObject<'_> for T
+where
+    T: PyClass + Clone,
+{
+    fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self> {
+        let bound = obj.downcast::<Self>()?;
+        Ok(bound.try_borrow()?.clone())
+    }
+}
+
+impl<'py, T> FromPyObject<'py> for PyRef<'py, T>
+where
+    T: PyClass,
+{
+    fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self> {
+        obj.downcast::<T>()?.try_borrow().map_err(Into::into)
+    }
+}
+
+impl<'py, T> FromPyObject<'py> for PyRefMut<'py, T>
+where
+    T: PyClass<Frozen = False>,
+{
+    fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self> {
+        obj.downcast::<T>()?.try_borrow_mut().map_err(Into::into)
+    }
+}
+
+/// Trait implemented by Python object types that allow a checked downcast.
+/// If `T` implements `PyTryFrom`, we can convert `&PyAny` to `&T`.
+///
+/// This trait is similar to `std::convert::TryFrom`
+#[cfg(feature = "gil-refs")]
+#[deprecated(since = "0.21.0")]
+pub trait PyTryFrom<'v>: Sized + PyNativeType {
+    /// Cast from a concrete Python object type to PyObject.
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `value.downcast::<T>()` instead of `T::try_from(value)`"
+    )]
+    fn try_from<V: Into<&'v PyAny>>(value: V) -> Result<&'v Self, PyDowncastError<'v>>;
+
+    /// Cast from a concrete Python object type to PyObject. With exact type check.
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `value.downcast_exact::<T>()` instead of `T::try_from_exact(value)`"
+    )]
+    fn try_from_exact<V: Into<&'v PyAny>>(value: V) -> Result<&'v Self, PyDowncastError<'v>>;
+
+    /// Cast a PyAny to a specific type of PyObject. The caller must
+    /// have already verified the reference is for this type.
+    ///
+    /// # Safety
+    ///
+    /// Callers must ensure that the type is valid or risk type confusion.
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `value.downcast_unchecked::<T>()` instead of `T::try_from_unchecked(value)`"
+    )]
+    unsafe fn try_from_unchecked<V: Into<&'v PyAny>>(value: V) -> &'v Self;
+}
+
+/// Trait implemented by Python object types that allow a checked downcast.
+/// This trait is similar to `std::convert::TryInto`
+#[cfg(feature = "gil-refs")]
+#[deprecated(since = "0.21.0")]
+pub trait PyTryInto<T>: Sized {
+    /// Cast from PyObject to a concrete Python object type.
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `value.downcast()` instead of `value.try_into()`"
+    )]
+    fn try_into(&self) -> Result<&T, PyDowncastError<'_>>;
+
+    /// Cast from PyObject to a concrete Python object type. With exact type check.
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `value.downcast()` instead of `value.try_into_exact()`"
+    )]
+    fn try_into_exact(&self) -> Result<&T, PyDowncastError<'_>>;
+}
+
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+mod implementations {
+    use super::*;
+    use crate::type_object::PyTypeInfo;
+
+    // TryFrom implies TryInto
+    impl<U> PyTryInto<U> for PyAny
+    where
+        U: for<'v> PyTryFrom<'v>,
+    {
+        fn try_into(&self) -> Result<&U, PyDowncastError<'_>> {
+            <U as PyTryFrom<'_>>::try_from(self)
+        }
+        fn try_into_exact(&self) -> Result<&U, PyDowncastError<'_>> {
+            U::try_from_exact(self)
+        }
+    }
+
+    impl<'v, T> PyTryFrom<'v> for T
+    where
+        T: PyTypeInfo<AsRefTarget = Self> + PyNativeType,
+    {
+        fn try_from<V: Into<&'v PyAny>>(value: V) -> Result<&'v Self, PyDowncastError<'v>> {
+            value.into().downcast()
+        }
+
+        fn try_from_exact<V: Into<&'v PyAny>>(value: V) -> Result<&'v Self, PyDowncastError<'v>> {
+            value.into().downcast_exact()
+        }
+
+        #[inline]
+        unsafe fn try_from_unchecked<V: Into<&'v PyAny>>(value: V) -> &'v Self {
+            value.into().downcast_unchecked()
+        }
+    }
+
+    impl<'v, T> PyTryFrom<'v> for crate::PyCell<T>
+    where
+        T: 'v + PyClass,
+    {
+        fn try_from<V: Into<&'v PyAny>>(value: V) -> Result<&'v Self, PyDowncastError<'v>> {
+            value.into().downcast()
+        }
+        fn try_from_exact<V: Into<&'v PyAny>>(value: V) -> Result<&'v Self, PyDowncastError<'v>> {
+            let value = value.into();
+            unsafe {
+                if T::is_exact_type_of(value) {
+                    Ok(Self::try_from_unchecked(value))
+                } else {
+                    Err(PyDowncastError::new(value, T::NAME))
+                }
+            }
+        }
+        #[inline]
+        unsafe fn try_from_unchecked<V: Into<&'v PyAny>>(value: V) -> &'v Self {
+            value.into().downcast_unchecked()
+        }
+    }
+}
+
+/// Converts `()` to an empty Python tuple.
+impl IntoPy<Py<PyTuple>> for () {
+    fn into_py(self, py: Python<'_>) -> Py<PyTuple> {
+        PyTuple::empty_bound(py).unbind()
+    }
+}
+
+/// Raw level conversion between `*mut ffi::PyObject` and PyO3 types.
+///
+/// # Safety
+///
+/// See safety notes on individual functions.
+#[cfg(feature = "gil-refs")]
+#[deprecated(since = "0.21.0")]
+pub unsafe trait FromPyPointer<'p>: Sized {
+    /// Convert from an arbitrary `PyObject`.
+    ///
+    /// # Safety
+    ///
+    /// Implementations must ensure the object does not get freed during `'p`
+    /// and ensure that `ptr` is of the correct type.
+    /// Note that it must be safe to decrement the reference count of `ptr`.
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `Py::from_owned_ptr_or_opt(py, ptr)` or `Bound::from_owned_ptr_or_opt(py, ptr)` instead"
+    )]
+    unsafe fn from_owned_ptr_or_opt(py: Python<'p>, ptr: *mut ffi::PyObject) -> Option<&'p Self>;
+    /// Convert from an arbitrary `PyObject` or panic.
+    ///
+    /// # Safety
+    ///
+    /// Relies on [`from_owned_ptr_or_opt`](#method.from_owned_ptr_or_opt).
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `Py::from_owned_ptr(py, ptr)` or `Bound::from_owned_ptr(py, ptr)` instead"
+    )]
+    unsafe fn from_owned_ptr_or_panic(py: Python<'p>, ptr: *mut ffi::PyObject) -> &'p Self {
+        #[allow(deprecated)]
+        Self::from_owned_ptr_or_opt(py, ptr).unwrap_or_else(|| err::panic_after_error(py))
+    }
+    /// Convert from an arbitrary `PyObject` or panic.
+    ///
+    /// # Safety
+    ///
+    /// Relies on [`from_owned_ptr_or_opt`](#method.from_owned_ptr_or_opt).
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `Py::from_owned_ptr(py, ptr)` or `Bound::from_owned_ptr(py, ptr)` instead"
+    )]
+    unsafe fn from_owned_ptr(py: Python<'p>, ptr: *mut ffi::PyObject) -> &'p Self {
+        #[allow(deprecated)]
+        Self::from_owned_ptr_or_panic(py, ptr)
+    }
+    /// Convert from an arbitrary `PyObject`.
+    ///
+    /// # Safety
+    ///
+    /// Relies on [`from_owned_ptr_or_opt`](#method.from_owned_ptr_or_opt).
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `Py::from_owned_ptr_or_err(py, ptr)` or `Bound::from_owned_ptr_or_err(py, ptr)` instead"
+    )]
+    unsafe fn from_owned_ptr_or_err(py: Python<'p>, ptr: *mut ffi::PyObject) -> PyResult<&'p Self> {
+        #[allow(deprecated)]
+        Self::from_owned_ptr_or_opt(py, ptr).ok_or_else(|| err::PyErr::fetch(py))
+    }
+    /// Convert from an arbitrary borrowed `PyObject`.
+    ///
+    /// # Safety
+    ///
+    /// Implementations must ensure the object does not get freed during `'p` and avoid type confusion.
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `Py::from_borrowed_ptr_or_opt(py, ptr)` or `Bound::from_borrowed_ptr_or_opt(py, ptr)` instead"
+    )]
+    unsafe fn from_borrowed_ptr_or_opt(py: Python<'p>, ptr: *mut ffi::PyObject)
+        -> Option<&'p Self>;
+    /// Convert from an arbitrary borrowed `PyObject`.
+    ///
+    /// # Safety
+    ///
+    /// Relies on unsafe fn [`from_borrowed_ptr_or_opt`](#method.from_borrowed_ptr_or_opt).
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `Py::from_borrowed_ptr(py, ptr)` or `Bound::from_borrowed_ptr(py, ptr)` instead"
+    )]
+    unsafe fn from_borrowed_ptr_or_panic(py: Python<'p>, ptr: *mut ffi::PyObject) -> &'p Self {
+        #[allow(deprecated)]
+        Self::from_borrowed_ptr_or_opt(py, ptr).unwrap_or_else(|| err::panic_after_error(py))
+    }
+    /// Convert from an arbitrary borrowed `PyObject`.
+    ///
+    /// # Safety
+    ///
+    /// Relies on unsafe fn [`from_borrowed_ptr_or_opt`](#method.from_borrowed_ptr_or_opt).
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `Py::from_borrowed_ptr(py, ptr)` or `Bound::from_borrowed_ptr(py, ptr)` instead"
+    )]
+    unsafe fn from_borrowed_ptr(py: Python<'p>, ptr: *mut ffi::PyObject) -> &'p Self {
+        #[allow(deprecated)]
+        Self::from_borrowed_ptr_or_panic(py, ptr)
+    }
+    /// Convert from an arbitrary borrowed `PyObject`.
+    ///
+    /// # Safety
+    ///
+    /// Relies on unsafe fn [`from_borrowed_ptr_or_opt`](#method.from_borrowed_ptr_or_opt).
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `Py::from_borrowed_ptr_or_err(py, ptr)` or `Bound::from_borrowed_ptr_or_err(py, ptr)` instead"
+    )]
+    unsafe fn from_borrowed_ptr_or_err(
+        py: Python<'p>,
+        ptr: *mut ffi::PyObject,
+    ) -> PyResult<&'p Self> {
+        #[allow(deprecated)]
+        Self::from_borrowed_ptr_or_opt(py, ptr).ok_or_else(|| err::PyErr::fetch(py))
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+unsafe impl<'p, T> FromPyPointer<'p> for T
+where
+    T: 'p + crate::PyNativeType,
+{
+    unsafe fn from_owned_ptr_or_opt(py: Python<'p>, ptr: *mut ffi::PyObject) -> Option<&'p Self> {
+        gil::register_owned(py, NonNull::new(ptr)?);
+        Some(&*(ptr as *mut Self))
+    }
+    unsafe fn from_borrowed_ptr_or_opt(
+        _py: Python<'p>,
+        ptr: *mut ffi::PyObject,
+    ) -> Option<&'p Self> {
+        NonNull::new(ptr as *mut Self).map(|p| &*p.as_ptr())
+    }
+}
+
+/// ```rust,compile_fail
+/// use pyo3::prelude::*;
+///
+/// #[pyclass]
+/// struct TestClass {
+///     num: u32,
+/// }
+///
+/// let t = TestClass { num: 10 };
+///
+/// Python::with_gil(|py| {
+///     let pyvalue = Py::new(py, t).unwrap().to_object(py);
+///     let t: TestClass = pyvalue.extract(py).unwrap();
+/// })
+/// ```
+mod test_no_clone {}
+
+#[cfg(test)]
+mod tests {
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    mod deprecated {
+        use super::super::PyTryFrom;
+        use crate::types::{IntoPyDict, PyAny, PyDict, PyList};
+        use crate::{Python, ToPyObject};
+
+        #[test]
+        fn test_try_from() {
+            Python::with_gil(|py| {
+                let list: &PyAny = vec![3, 6, 5, 4, 7].to_object(py).into_ref(py);
+                let dict: &PyAny = vec![("reverse", true)].into_py_dict(py).as_ref();
+
+                assert!(<PyList as PyTryFrom<'_>>::try_from(list).is_ok());
+                assert!(<PyDict as PyTryFrom<'_>>::try_from(dict).is_ok());
+
+                assert!(<PyAny as PyTryFrom<'_>>::try_from(list).is_ok());
+                assert!(<PyAny as PyTryFrom<'_>>::try_from(dict).is_ok());
+            });
+        }
+
+        #[test]
+        fn test_try_from_exact() {
+            Python::with_gil(|py| {
+                let list: &PyAny = vec![3, 6, 5, 4, 7].to_object(py).into_ref(py);
+                let dict: &PyAny = vec![("reverse", true)].into_py_dict(py).as_ref();
+
+                assert!(PyList::try_from_exact(list).is_ok());
+                assert!(PyDict::try_from_exact(dict).is_ok());
+
+                assert!(PyAny::try_from_exact(list).is_err());
+                assert!(PyAny::try_from_exact(dict).is_err());
+            });
+        }
+
+        #[test]
+        fn test_try_from_unchecked() {
+            Python::with_gil(|py| {
+                let list = PyList::new(py, [1, 2, 3]);
+                let val = unsafe { <PyList as PyTryFrom>::try_from_unchecked(list.as_ref()) };
+                assert!(list.is(val));
+            });
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/anyhow.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/anyhow.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/anyhow.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/anyhow.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,191 @@
+#![cfg(feature = "anyhow")]
+
+//! A conversion from
+//! [anyhow](https://docs.rs/anyhow/ "A trait object based error system for easy idiomatic error handling in Rust applications.")’s
+//! [`Error`](https://docs.rs/anyhow/latest/anyhow/struct.Error.html "Anyhows `Error` type, a wrapper around a dynamic error type")
+//! type to [`PyErr`].
+//!
+//! Use of an error handling library like [anyhow] is common in application code and when you just
+//! want error handling to be easy. If you are writing a library or you need more control over your
+//! errors you might want to design your own error type instead.
+//!
+//! When the inner error is a [`PyErr`] without source, it will be extracted out.
+//! Otherwise a Python [`RuntimeError`] will be created.
+//! You might find that you need to map the error from your Rust code into another Python exception.
+//! See [`PyErr::new`] for more information about that.
+//!
+//! For information about error handling in general, see the [Error handling] chapter of the Rust
+//! book.
+//!
+//! # Setup
+//!
+//! To use this feature, add this to your **`Cargo.toml`**:
+//!
+//! ```toml
+//! [dependencies]
+//! ## change * to the version you want to use, ideally the latest.
+//! anyhow = "*"
+#![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"),  "\", features = [\"anyhow\"] }")]
+//! ```
+//!
+//! Note that you must use compatible versions of anyhow and PyO3.
+//! The required anyhow version may vary based on the version of PyO3.
+//!
+//! # Example: Propagating a `PyErr` into [`anyhow::Error`]
+//!
+//! ```rust
+//! use pyo3::prelude::*;
+//! use std::path::PathBuf;
+//!
+//! // A wrapper around a Rust function.
+//! // The pyfunction macro performs the conversion to a PyErr
+//! #[pyfunction]
+//! fn py_open(filename: PathBuf) -> anyhow::Result<Vec<u8>> {
+//!     let data = std::fs::read(filename)?;
+//!     Ok(data)
+//! }
+//!
+//! fn main() {
+//!     let error = Python::with_gil(|py| -> PyResult<Vec<u8>> {
+//!         let fun = wrap_pyfunction_bound!(py_open, py)?;
+//!         let text = fun.call1(("foo.txt",))?.extract::<Vec<u8>>()?;
+//!         Ok(text)
+//!     }).unwrap_err();
+//!
+//!     println!("{}", error);
+//! }
+//! ```
+//!
+//! # Example: Using `anyhow` in general
+//!
+//! Note that you don't need this feature to convert a [`PyErr`] into an [`anyhow::Error`], because
+//! it can already convert anything that implements [`Error`](std::error::Error):
+//!
+//! ```rust
+//! use pyo3::prelude::*;
+//! use pyo3::types::PyBytes;
+//!
+//! // An example function that must handle multiple error types.
+//! //
+//! // To do this you usually need to design your own error type or use
+//! // `Box<dyn Error>`. `anyhow` is a convenient alternative for this.
+//! pub fn decompress(bytes: &[u8]) -> anyhow::Result<String> {
+//!     // An arbitrary example of a Python api you
+//!     // could call inside an application...
+//!     // This might return a `PyErr`.
+//!     let res = Python::with_gil(|py| {
+//!         let zlib = PyModule::import_bound(py, "zlib")?;
+//!         let decompress = zlib.getattr("decompress")?;
+//!         let bytes = PyBytes::new_bound(py, bytes);
+//!         let value = decompress.call1((bytes,))?;
+//!         value.extract::<Vec<u8>>()
+//!     })?;
+//!
+//!     // This might be a `FromUtf8Error`.
+//!     let text = String::from_utf8(res)?;
+//!
+//!     Ok(text)
+//! }
+//!
+//! fn main() -> anyhow::Result<()> {
+//!     let bytes: &[u8] = b"x\x9c\x8b\xcc/U(\xce\xc8/\xcdIQ((\xcaOJL\xca\xa9T\
+//!                         (-NU(\xc9HU\xc8\xc9LJ\xcbI,IUH.\x02\x91\x99y\xc5%\
+//!                         \xa9\x89)z\x00\xf2\x15\x12\xfe";
+//!     let text = decompress(bytes)?;
+//!
+//!     println!("The text is \"{}\"", text);
+//! # assert_eq!(text, "You should probably use the libflate crate instead.");
+//!     Ok(())
+//! }
+//! ```
+//!
+//! [`RuntimeError`]: https://docs.python.org/3/library/exceptions.html#RuntimeError "Built-in Exceptions — Python documentation"
+//! [Error handling]: https://doc.rust-lang.org/book/ch09-02-recoverable-errors-with-result.html "Recoverable Errors with Result - The Rust Programming Language"
+
+use crate::exceptions::PyRuntimeError;
+use crate::PyErr;
+
+impl From<anyhow::Error> for PyErr {
+    fn from(mut error: anyhow::Error) -> Self {
+        // Errors containing a PyErr without chain or context are returned as the underlying error
+        if error.source().is_none() {
+            error = match error.downcast::<Self>() {
+                Ok(py_err) => return py_err,
+                Err(error) => error,
+            };
+        }
+        PyRuntimeError::new_err(format!("{:?}", error))
+    }
+}
+
+#[cfg(test)]
+mod test_anyhow {
+    use crate::exceptions::{PyRuntimeError, PyValueError};
+    use crate::prelude::*;
+    use crate::types::IntoPyDict;
+
+    use anyhow::{anyhow, bail, Context, Result};
+
+    fn f() -> Result<()> {
+        use std::io;
+        bail!(io::Error::new(io::ErrorKind::PermissionDenied, "oh no!"));
+    }
+
+    fn g() -> Result<()> {
+        f().context("f failed")
+    }
+
+    fn h() -> Result<()> {
+        g().context("g failed")
+    }
+
+    #[test]
+    fn test_pyo3_exception_contents() {
+        let err = h().unwrap_err();
+        let expected_contents = format!("{:?}", err);
+        let pyerr = PyErr::from(err);
+
+        Python::with_gil(|py| {
+            let locals = [("err", pyerr)].into_py_dict_bound(py);
+            let pyerr = py.run_bound("raise err", None, Some(&locals)).unwrap_err();
+            assert_eq!(pyerr.value_bound(py).to_string(), expected_contents);
+        })
+    }
+
+    fn k() -> Result<()> {
+        Err(anyhow!("Some sort of error"))
+    }
+
+    #[test]
+    fn test_pyo3_exception_contents2() {
+        let err = k().unwrap_err();
+        let expected_contents = format!("{:?}", err);
+        let pyerr = PyErr::from(err);
+
+        Python::with_gil(|py| {
+            let locals = [("err", pyerr)].into_py_dict_bound(py);
+            let pyerr = py.run_bound("raise err", None, Some(&locals)).unwrap_err();
+            assert_eq!(pyerr.value_bound(py).to_string(), expected_contents);
+        })
+    }
+
+    #[test]
+    fn test_pyo3_unwrap_simple_err() {
+        let origin_exc = PyValueError::new_err("Value Error");
+        let err: anyhow::Error = origin_exc.into();
+        let converted: PyErr = err.into();
+        assert!(Python::with_gil(
+            |py| converted.is_instance_of::<PyValueError>(py)
+        ))
+    }
+    #[test]
+    fn test_pyo3_unwrap_complex_err() {
+        let origin_exc = PyValueError::new_err("Value Error");
+        let mut err: anyhow::Error = origin_exc.into();
+        err = err.context("Context");
+        let converted: PyErr = err.into();
+        assert!(Python::with_gil(
+            |py| converted.is_instance_of::<PyRuntimeError>(py)
+        ))
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/chrono.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/chrono.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/chrono.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/chrono.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1273 @@
+#![cfg(feature = "chrono")]
+
+//! Conversions to and from [chrono](https://docs.rs/chrono/)’s `Duration`,
+//! `NaiveDate`, `NaiveTime`, `DateTime<Tz>`, `FixedOffset`, and `Utc`.
+//!
+//! # Setup
+//!
+//! To use this feature, add this to your **`Cargo.toml`**:
+//!
+//! ```toml
+//! [dependencies]
+//! chrono = "0.4"
+#![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"),  "\", features = [\"chrono\"] }")]
+//! ```
+//!
+//! Note that you must use compatible versions of chrono and PyO3.
+//! The required chrono version may vary based on the version of PyO3.
+//!
+//! # Example: Convert a `datetime.datetime` to chrono's `DateTime<Utc>`
+//!
+//! ```rust
+//! use chrono::{DateTime, Duration, TimeZone, Utc};
+//! use pyo3::{Python, ToPyObject};
+//!
+//! fn main() {
+//!     pyo3::prepare_freethreaded_python();
+//!     Python::with_gil(|py| {
+//!         // Build some chrono values
+//!         let chrono_datetime = Utc.with_ymd_and_hms(2022, 1, 1, 12, 0, 0).unwrap();
+//!         let chrono_duration = Duration::seconds(1);
+//!         // Convert them to Python
+//!         let py_datetime = chrono_datetime.to_object(py);
+//!         let py_timedelta = chrono_duration.to_object(py);
+//!         // Do an operation in Python
+//!         let py_sum = py_datetime.call_method1(py, "__add__", (py_timedelta,)).unwrap();
+//!         // Convert back to Rust
+//!         let chrono_sum: DateTime<Utc> = py_sum.extract(py).unwrap();
+//!         println!("DateTime<Utc>: {}", chrono_datetime);
+//!     });
+//! }
+//! ```
+
+use crate::exceptions::{PyTypeError, PyUserWarning, PyValueError};
+#[cfg(Py_LIMITED_API)]
+use crate::sync::GILOnceCell;
+use crate::types::any::PyAnyMethods;
+#[cfg(not(Py_LIMITED_API))]
+use crate::types::datetime::timezone_from_offset;
+#[cfg(not(Py_LIMITED_API))]
+use crate::types::{
+    timezone_utc_bound, PyDate, PyDateAccess, PyDateTime, PyDelta, PyDeltaAccess, PyTime,
+    PyTimeAccess, PyTzInfo, PyTzInfoAccess,
+};
+#[cfg(Py_LIMITED_API)]
+use crate::{intern, DowncastError};
+use crate::{Bound, FromPyObject, IntoPy, PyAny, PyErr, PyObject, PyResult, Python, ToPyObject};
+use chrono::offset::{FixedOffset, Utc};
+use chrono::{
+    DateTime, Datelike, Duration, NaiveDate, NaiveDateTime, NaiveTime, Offset, TimeZone, Timelike,
+};
+
+impl ToPyObject for Duration {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        // Total number of days
+        let days = self.num_days();
+        // Remainder of seconds
+        let secs_dur = *self - Duration::days(days);
+        let secs = secs_dur.num_seconds();
+        // Fractional part of the microseconds
+        let micros = (secs_dur - Duration::seconds(secs_dur.num_seconds()))
+            .num_microseconds()
+            // This should never panic since we are just getting the fractional
+            // part of the total microseconds, which should never overflow.
+            .unwrap();
+
+        #[cfg(not(Py_LIMITED_API))]
+        {
+            // We do not need to check the days i64 to i32 cast from rust because
+            // python will panic with OverflowError.
+            // We pass true as the `normalize` parameter since we'd need to do several checks here to
+            // avoid that, and it shouldn't have a big performance impact.
+            // The seconds and microseconds cast should never overflow since it's at most the number of seconds per day
+            PyDelta::new_bound(
+                py,
+                days.try_into().unwrap_or(i32::MAX),
+                secs.try_into().unwrap(),
+                micros.try_into().unwrap(),
+                true,
+            )
+            .expect("failed to construct delta")
+            .into()
+        }
+        #[cfg(Py_LIMITED_API)]
+        {
+            DatetimeTypes::get(py)
+                .timedelta
+                .call1(py, (days, secs, micros))
+                .expect("failed to construct datetime.timedelta")
+        }
+    }
+}
+
+impl IntoPy<PyObject> for Duration {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_object(py)
+    }
+}
+
+impl FromPyObject<'_> for Duration {
+    fn extract_bound(ob: &Bound<'_, PyAny>) -> PyResult<Duration> {
+        // Python size are much lower than rust size so we do not need bound checks.
+        // 0 <= microseconds < 1000000
+        // 0 <= seconds < 3600*24
+        // -999999999 <= days <= 999999999
+        #[cfg(not(Py_LIMITED_API))]
+        let (days, seconds, microseconds) = {
+            let delta = ob.downcast::<PyDelta>()?;
+            (
+                delta.get_days().into(),
+                delta.get_seconds().into(),
+                delta.get_microseconds().into(),
+            )
+        };
+        #[cfg(Py_LIMITED_API)]
+        let (days, seconds, microseconds) = {
+            check_type(ob, &DatetimeTypes::get(ob.py()).timedelta, "PyDelta")?;
+            (
+                ob.getattr(intern!(ob.py(), "days"))?.extract()?,
+                ob.getattr(intern!(ob.py(), "seconds"))?.extract()?,
+                ob.getattr(intern!(ob.py(), "microseconds"))?.extract()?,
+            )
+        };
+        Ok(
+            Duration::days(days)
+                + Duration::seconds(seconds)
+                + Duration::microseconds(microseconds),
+        )
+    }
+}
+
+impl ToPyObject for NaiveDate {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        let DateArgs { year, month, day } = self.into();
+        #[cfg(not(Py_LIMITED_API))]
+        {
+            PyDate::new_bound(py, year, month, day)
+                .expect("failed to construct date")
+                .into()
+        }
+        #[cfg(Py_LIMITED_API)]
+        {
+            DatetimeTypes::get(py)
+                .date
+                .call1(py, (year, month, day))
+                .expect("failed to construct datetime.date")
+        }
+    }
+}
+
+impl IntoPy<PyObject> for NaiveDate {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_object(py)
+    }
+}
+
+impl FromPyObject<'_> for NaiveDate {
+    fn extract_bound(ob: &Bound<'_, PyAny>) -> PyResult<NaiveDate> {
+        #[cfg(not(Py_LIMITED_API))]
+        {
+            let date = ob.downcast::<PyDate>()?;
+            py_date_to_naive_date(date)
+        }
+        #[cfg(Py_LIMITED_API)]
+        {
+            check_type(ob, &DatetimeTypes::get(ob.py()).date, "PyDate")?;
+            py_date_to_naive_date(ob)
+        }
+    }
+}
+
+impl ToPyObject for NaiveTime {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        let TimeArgs {
+            hour,
+            min,
+            sec,
+            micro,
+            truncated_leap_second,
+        } = self.into();
+        #[cfg(not(Py_LIMITED_API))]
+        let time =
+            PyTime::new_bound(py, hour, min, sec, micro, None).expect("Failed to construct time");
+        #[cfg(Py_LIMITED_API)]
+        let time = DatetimeTypes::get(py)
+            .time
+            .bind(py)
+            .call1((hour, min, sec, micro))
+            .expect("failed to construct datetime.time");
+        if truncated_leap_second {
+            warn_truncated_leap_second(&time);
+        }
+        time.into()
+    }
+}
+
+impl IntoPy<PyObject> for NaiveTime {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_object(py)
+    }
+}
+
+impl FromPyObject<'_> for NaiveTime {
+    fn extract_bound(ob: &Bound<'_, PyAny>) -> PyResult<NaiveTime> {
+        #[cfg(not(Py_LIMITED_API))]
+        {
+            let time = ob.downcast::<PyTime>()?;
+            py_time_to_naive_time(time)
+        }
+        #[cfg(Py_LIMITED_API)]
+        {
+            check_type(ob, &DatetimeTypes::get(ob.py()).time, "PyTime")?;
+            py_time_to_naive_time(ob)
+        }
+    }
+}
+
+impl ToPyObject for NaiveDateTime {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        naive_datetime_to_py_datetime(py, self, None)
+    }
+}
+
+impl IntoPy<PyObject> for NaiveDateTime {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_object(py)
+    }
+}
+
+impl FromPyObject<'_> for NaiveDateTime {
+    fn extract_bound(dt: &Bound<'_, PyAny>) -> PyResult<NaiveDateTime> {
+        #[cfg(not(Py_LIMITED_API))]
+        let dt = dt.downcast::<PyDateTime>()?;
+        #[cfg(Py_LIMITED_API)]
+        check_type(dt, &DatetimeTypes::get(dt.py()).datetime, "PyDateTime")?;
+
+        // If the user tries to convert a timezone aware datetime into a naive one,
+        // we return a hard error. We could silently remove tzinfo, or assume local timezone
+        // and do a conversion, but better leave this decision to the user of the library.
+        #[cfg(not(Py_LIMITED_API))]
+        let has_tzinfo = dt.get_tzinfo_bound().is_some();
+        #[cfg(Py_LIMITED_API)]
+        let has_tzinfo = !dt.getattr(intern!(dt.py(), "tzinfo"))?.is_none();
+        if has_tzinfo {
+            return Err(PyTypeError::new_err("expected a datetime without tzinfo"));
+        }
+
+        let dt = NaiveDateTime::new(py_date_to_naive_date(dt)?, py_time_to_naive_time(dt)?);
+        Ok(dt)
+    }
+}
+
+impl<Tz: TimeZone> ToPyObject for DateTime<Tz> {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        // FIXME: convert to better timezone representation here than just convert to fixed offset
+        // See https://github.com/PyO3/pyo3/issues/3266
+        let tz = self.offset().fix().to_object(py);
+        let tz = tz.bind(py).downcast().unwrap();
+        naive_datetime_to_py_datetime(py, &self.naive_local(), Some(tz))
+    }
+}
+
+impl<Tz: TimeZone> IntoPy<PyObject> for DateTime<Tz> {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_object(py)
+    }
+}
+
+impl<Tz: TimeZone + for<'py> FromPyObject<'py>> FromPyObject<'_> for DateTime<Tz> {
+    fn extract_bound(dt: &Bound<'_, PyAny>) -> PyResult<DateTime<Tz>> {
+        #[cfg(not(Py_LIMITED_API))]
+        let dt = dt.downcast::<PyDateTime>()?;
+        #[cfg(Py_LIMITED_API)]
+        check_type(dt, &DatetimeTypes::get(dt.py()).datetime, "PyDateTime")?;
+
+        #[cfg(not(Py_LIMITED_API))]
+        let tzinfo = dt.get_tzinfo_bound();
+        #[cfg(Py_LIMITED_API)]
+        let tzinfo: Option<Bound<'_, PyAny>> = dt.getattr(intern!(dt.py(), "tzinfo"))?.extract()?;
+
+        let tz = if let Some(tzinfo) = tzinfo {
+            tzinfo.extract()?
+        } else {
+            return Err(PyTypeError::new_err(
+                "expected a datetime with non-None tzinfo",
+            ));
+        };
+        let naive_dt = NaiveDateTime::new(py_date_to_naive_date(dt)?, py_time_to_naive_time(dt)?);
+        naive_dt.and_local_timezone(tz).single().ok_or_else(|| {
+            PyValueError::new_err(format!(
+                "The datetime {:?} contains an incompatible or ambiguous timezone",
+                dt
+            ))
+        })
+    }
+}
+
+impl ToPyObject for FixedOffset {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        let seconds_offset = self.local_minus_utc();
+
+        #[cfg(not(Py_LIMITED_API))]
+        {
+            let td = PyDelta::new_bound(py, 0, seconds_offset, 0, true)
+                .expect("failed to construct timedelta");
+            timezone_from_offset(&td)
+                .expect("Failed to construct PyTimezone")
+                .into()
+        }
+        #[cfg(Py_LIMITED_API)]
+        {
+            let td = Duration::seconds(seconds_offset.into()).into_py(py);
+            DatetimeTypes::get(py)
+                .timezone
+                .call1(py, (td,))
+                .expect("failed to construct datetime.timezone")
+        }
+    }
+}
+
+impl IntoPy<PyObject> for FixedOffset {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_object(py)
+    }
+}
+
+impl FromPyObject<'_> for FixedOffset {
+    /// Convert python tzinfo to rust [`FixedOffset`].
+    ///
+    /// Note that the conversion will result in precision lost in microseconds as chrono offset
+    /// does not supports microseconds.
+    fn extract_bound(ob: &Bound<'_, PyAny>) -> PyResult<FixedOffset> {
+        #[cfg(not(Py_LIMITED_API))]
+        let ob = ob.downcast::<PyTzInfo>()?;
+        #[cfg(Py_LIMITED_API)]
+        check_type(ob, &DatetimeTypes::get(ob.py()).tzinfo, "PyTzInfo")?;
+
+        // Passing `()` (so Python's None) to the `utcoffset` function will only
+        // work for timezones defined as fixed offsets in Python.
+        // Any other timezone would require a datetime as the parameter, and return
+        // None if the datetime is not provided.
+        // Trying to convert None to a PyDelta in the next line will then fail.
+        let py_timedelta = ob.call_method1("utcoffset", ((),))?;
+        if py_timedelta.is_none() {
+            return Err(PyTypeError::new_err(format!(
+                "{:?} is not a fixed offset timezone",
+                ob
+            )));
+        }
+        let total_seconds: Duration = py_timedelta.extract()?;
+        // This cast is safe since the timedelta is limited to -24 hours and 24 hours.
+        let total_seconds = total_seconds.num_seconds() as i32;
+        FixedOffset::east_opt(total_seconds)
+            .ok_or_else(|| PyValueError::new_err("fixed offset out of bounds"))
+    }
+}
+
+impl ToPyObject for Utc {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        timezone_utc_bound(py).into()
+    }
+}
+
+impl IntoPy<PyObject> for Utc {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_object(py)
+    }
+}
+
+impl FromPyObject<'_> for Utc {
+    fn extract_bound(ob: &Bound<'_, PyAny>) -> PyResult<Utc> {
+        let py_utc = timezone_utc_bound(ob.py());
+        if ob.eq(py_utc)? {
+            Ok(Utc)
+        } else {
+            Err(PyValueError::new_err("expected datetime.timezone.utc"))
+        }
+    }
+}
+
+struct DateArgs {
+    year: i32,
+    month: u8,
+    day: u8,
+}
+
+impl From<&NaiveDate> for DateArgs {
+    fn from(value: &NaiveDate) -> Self {
+        Self {
+            year: value.year(),
+            month: value.month() as u8,
+            day: value.day() as u8,
+        }
+    }
+}
+
+struct TimeArgs {
+    hour: u8,
+    min: u8,
+    sec: u8,
+    micro: u32,
+    truncated_leap_second: bool,
+}
+
+impl From<&NaiveTime> for TimeArgs {
+    fn from(value: &NaiveTime) -> Self {
+        let ns = value.nanosecond();
+        let checked_sub = ns.checked_sub(1_000_000_000);
+        let truncated_leap_second = checked_sub.is_some();
+        let micro = checked_sub.unwrap_or(ns) / 1000;
+        Self {
+            hour: value.hour() as u8,
+            min: value.minute() as u8,
+            sec: value.second() as u8,
+            micro,
+            truncated_leap_second,
+        }
+    }
+}
+
+fn naive_datetime_to_py_datetime(
+    py: Python<'_>,
+    naive_datetime: &NaiveDateTime,
+    #[cfg(not(Py_LIMITED_API))] tzinfo: Option<&Bound<'_, PyTzInfo>>,
+    #[cfg(Py_LIMITED_API)] tzinfo: Option<&Bound<'_, PyAny>>,
+) -> PyObject {
+    let DateArgs { year, month, day } = (&naive_datetime.date()).into();
+    let TimeArgs {
+        hour,
+        min,
+        sec,
+        micro,
+        truncated_leap_second,
+    } = (&naive_datetime.time()).into();
+    #[cfg(not(Py_LIMITED_API))]
+    let datetime = PyDateTime::new_bound(py, year, month, day, hour, min, sec, micro, tzinfo)
+        .expect("failed to construct datetime");
+    #[cfg(Py_LIMITED_API)]
+    let datetime = DatetimeTypes::get(py)
+        .datetime
+        .bind(py)
+        .call1((year, month, day, hour, min, sec, micro, tzinfo))
+        .expect("failed to construct datetime.datetime");
+    if truncated_leap_second {
+        warn_truncated_leap_second(&datetime);
+    }
+    datetime.into()
+}
+
+fn warn_truncated_leap_second(obj: &Bound<'_, PyAny>) {
+    let py = obj.py();
+    if let Err(e) = PyErr::warn_bound(
+        py,
+        &py.get_type_bound::<PyUserWarning>(),
+        "ignored leap-second, `datetime` does not support leap-seconds",
+        0,
+    ) {
+        e.write_unraisable_bound(py, Some(&obj.as_borrowed()))
+    };
+}
+
+#[cfg(not(Py_LIMITED_API))]
+fn py_date_to_naive_date(py_date: &impl PyDateAccess) -> PyResult<NaiveDate> {
+    NaiveDate::from_ymd_opt(
+        py_date.get_year(),
+        py_date.get_month().into(),
+        py_date.get_day().into(),
+    )
+    .ok_or_else(|| PyValueError::new_err("invalid or out-of-range date"))
+}
+
+#[cfg(Py_LIMITED_API)]
+fn py_date_to_naive_date(py_date: &Bound<'_, PyAny>) -> PyResult<NaiveDate> {
+    NaiveDate::from_ymd_opt(
+        py_date.getattr(intern!(py_date.py(), "year"))?.extract()?,
+        py_date.getattr(intern!(py_date.py(), "month"))?.extract()?,
+        py_date.getattr(intern!(py_date.py(), "day"))?.extract()?,
+    )
+    .ok_or_else(|| PyValueError::new_err("invalid or out-of-range date"))
+}
+
+#[cfg(not(Py_LIMITED_API))]
+fn py_time_to_naive_time(py_time: &impl PyTimeAccess) -> PyResult<NaiveTime> {
+    NaiveTime::from_hms_micro_opt(
+        py_time.get_hour().into(),
+        py_time.get_minute().into(),
+        py_time.get_second().into(),
+        py_time.get_microsecond(),
+    )
+    .ok_or_else(|| PyValueError::new_err("invalid or out-of-range time"))
+}
+
+#[cfg(Py_LIMITED_API)]
+fn py_time_to_naive_time(py_time: &Bound<'_, PyAny>) -> PyResult<NaiveTime> {
+    NaiveTime::from_hms_micro_opt(
+        py_time.getattr(intern!(py_time.py(), "hour"))?.extract()?,
+        py_time
+            .getattr(intern!(py_time.py(), "minute"))?
+            .extract()?,
+        py_time
+            .getattr(intern!(py_time.py(), "second"))?
+            .extract()?,
+        py_time
+            .getattr(intern!(py_time.py(), "microsecond"))?
+            .extract()?,
+    )
+    .ok_or_else(|| PyValueError::new_err("invalid or out-of-range time"))
+}
+
+#[cfg(Py_LIMITED_API)]
+fn check_type(value: &Bound<'_, PyAny>, t: &PyObject, type_name: &'static str) -> PyResult<()> {
+    if !value.is_instance(t.bind(value.py()))? {
+        return Err(DowncastError::new(value, type_name).into());
+    }
+    Ok(())
+}
+
+#[cfg(Py_LIMITED_API)]
+struct DatetimeTypes {
+    date: PyObject,
+    datetime: PyObject,
+    time: PyObject,
+    timedelta: PyObject,
+    timezone: PyObject,
+    timezone_utc: PyObject,
+    tzinfo: PyObject,
+}
+
+#[cfg(Py_LIMITED_API)]
+impl DatetimeTypes {
+    fn get(py: Python<'_>) -> &Self {
+        static TYPES: GILOnceCell<DatetimeTypes> = GILOnceCell::new();
+        TYPES
+            .get_or_try_init(py, || {
+                let datetime = py.import_bound("datetime")?;
+                let timezone = datetime.getattr("timezone")?;
+                Ok::<_, PyErr>(Self {
+                    date: datetime.getattr("date")?.into(),
+                    datetime: datetime.getattr("datetime")?.into(),
+                    time: datetime.getattr("time")?.into(),
+                    timedelta: datetime.getattr("timedelta")?.into(),
+                    timezone_utc: timezone.getattr("utc")?.into(),
+                    timezone: timezone.into(),
+                    tzinfo: datetime.getattr("tzinfo")?.into(),
+                })
+            })
+            .expect("failed to load datetime module")
+    }
+}
+
+#[cfg(Py_LIMITED_API)]
+fn timezone_utc_bound(py: Python<'_>) -> Bound<'_, PyAny> {
+    DatetimeTypes::get(py).timezone_utc.bind(py).clone()
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::{types::PyTuple, Py};
+    use std::{cmp::Ordering, panic};
+
+    #[test]
+    // Only Python>=3.9 has the zoneinfo package
+    // We skip the test on windows too since we'd need to install
+    // tzdata there to make this work.
+    #[cfg(all(Py_3_9, not(target_os = "windows")))]
+    fn test_zoneinfo_is_not_fixed_offset() {
+        use crate::types::any::PyAnyMethods;
+        use crate::types::dict::PyDictMethods;
+
+        Python::with_gil(|py| {
+            let locals = crate::types::PyDict::new_bound(py);
+            py.run_bound(
+                "import zoneinfo; zi = zoneinfo.ZoneInfo('Europe/London')",
+                None,
+                Some(&locals),
+            )
+            .unwrap();
+            let result: PyResult<FixedOffset> = locals.get_item("zi").unwrap().unwrap().extract();
+            assert!(result.is_err());
+            let res = result.err().unwrap();
+            // Also check the error message is what we expect
+            let msg = res.value_bound(py).repr().unwrap().to_string();
+            assert_eq!(msg, "TypeError(\"zoneinfo.ZoneInfo(key='Europe/London') is not a fixed offset timezone\")");
+        });
+    }
+
+    #[test]
+    fn test_timezone_aware_to_naive_fails() {
+        // Test that if a user tries to convert a python's timezone aware datetime into a naive
+        // one, the conversion fails.
+        Python::with_gil(|py| {
+            let py_datetime =
+                new_py_datetime_ob(py, "datetime", (2022, 1, 1, 1, 0, 0, 0, python_utc(py)));
+            // Now test that converting a PyDateTime with tzinfo to a NaiveDateTime fails
+            let res: PyResult<NaiveDateTime> = py_datetime.extract();
+            assert_eq!(
+                res.unwrap_err().value_bound(py).repr().unwrap().to_string(),
+                "TypeError('expected a datetime without tzinfo')"
+            );
+        });
+    }
+
+    #[test]
+    fn test_naive_to_timezone_aware_fails() {
+        // Test that if a user tries to convert a python's timezone aware datetime into a naive
+        // one, the conversion fails.
+        Python::with_gil(|py| {
+            let py_datetime = new_py_datetime_ob(py, "datetime", (2022, 1, 1, 1, 0, 0, 0));
+            // Now test that converting a PyDateTime with tzinfo to a NaiveDateTime fails
+            let res: PyResult<DateTime<Utc>> = py_datetime.extract();
+            assert_eq!(
+                res.unwrap_err().value_bound(py).repr().unwrap().to_string(),
+                "TypeError('expected a datetime with non-None tzinfo')"
+            );
+
+            // Now test that converting a PyDateTime with tzinfo to a NaiveDateTime fails
+            let res: PyResult<DateTime<FixedOffset>> = py_datetime.extract();
+            assert_eq!(
+                res.unwrap_err().value_bound(py).repr().unwrap().to_string(),
+                "TypeError('expected a datetime with non-None tzinfo')"
+            );
+        });
+    }
+
+    #[test]
+    fn test_invalid_types_fail() {
+        // Test that if a user tries to convert a python's timezone aware datetime into a naive
+        // one, the conversion fails.
+        Python::with_gil(|py| {
+            let none = py.None().into_bound(py);
+            assert_eq!(
+                none.extract::<Duration>().unwrap_err().to_string(),
+                "TypeError: 'NoneType' object cannot be converted to 'PyDelta'"
+            );
+            assert_eq!(
+                none.extract::<FixedOffset>().unwrap_err().to_string(),
+                "TypeError: 'NoneType' object cannot be converted to 'PyTzInfo'"
+            );
+            assert_eq!(
+                none.extract::<Utc>().unwrap_err().to_string(),
+                "ValueError: expected datetime.timezone.utc"
+            );
+            assert_eq!(
+                none.extract::<NaiveTime>().unwrap_err().to_string(),
+                "TypeError: 'NoneType' object cannot be converted to 'PyTime'"
+            );
+            assert_eq!(
+                none.extract::<NaiveDate>().unwrap_err().to_string(),
+                "TypeError: 'NoneType' object cannot be converted to 'PyDate'"
+            );
+            assert_eq!(
+                none.extract::<NaiveDateTime>().unwrap_err().to_string(),
+                "TypeError: 'NoneType' object cannot be converted to 'PyDateTime'"
+            );
+            assert_eq!(
+                none.extract::<DateTime<Utc>>().unwrap_err().to_string(),
+                "TypeError: 'NoneType' object cannot be converted to 'PyDateTime'"
+            );
+            assert_eq!(
+                none.extract::<DateTime<FixedOffset>>()
+                    .unwrap_err()
+                    .to_string(),
+                "TypeError: 'NoneType' object cannot be converted to 'PyDateTime'"
+            );
+        });
+    }
+
+    #[test]
+    fn test_pyo3_timedelta_topyobject() {
+        // Utility function used to check different durations.
+        // The `name` parameter is used to identify the check in case of a failure.
+        let check = |name: &'static str, delta: Duration, py_days, py_seconds, py_ms| {
+            Python::with_gil(|py| {
+                let delta = delta.to_object(py);
+                let py_delta = new_py_datetime_ob(py, "timedelta", (py_days, py_seconds, py_ms));
+                assert!(
+                    delta.bind(py).eq(&py_delta).unwrap(),
+                    "{}: {} != {}",
+                    name,
+                    delta,
+                    py_delta
+                );
+            });
+        };
+
+        let delta = Duration::days(-1) + Duration::seconds(1) + Duration::microseconds(-10);
+        check("delta normalization", delta, -1, 1, -10);
+
+        // Check the minimum value allowed by PyDelta, which is different
+        // from the minimum value allowed in Duration. This should pass.
+        let delta = Duration::seconds(-86399999913600); // min
+        check("delta min value", delta, -999999999, 0, 0);
+
+        // Same, for max value
+        let delta = Duration::seconds(86399999999999) + Duration::nanoseconds(999999000); // max
+        check("delta max value", delta, 999999999, 86399, 999999);
+
+        // Also check that trying to convert an out of bound value panics.
+        Python::with_gil(|py| {
+            assert!(panic::catch_unwind(|| Duration::min_value().to_object(py)).is_err());
+            assert!(panic::catch_unwind(|| Duration::max_value().to_object(py)).is_err());
+        });
+    }
+
+    #[test]
+    fn test_pyo3_timedelta_frompyobject() {
+        // Utility function used to check different durations.
+        // The `name` parameter is used to identify the check in case of a failure.
+        let check = |name: &'static str, delta: Duration, py_days, py_seconds, py_ms| {
+            Python::with_gil(|py| {
+                let py_delta = new_py_datetime_ob(py, "timedelta", (py_days, py_seconds, py_ms));
+                let py_delta: Duration = py_delta.extract().unwrap();
+                assert_eq!(py_delta, delta, "{}: {} != {}", name, py_delta, delta);
+            })
+        };
+
+        // Check the minimum value allowed by PyDelta, which is different
+        // from the minimum value allowed in Duration. This should pass.
+        check(
+            "min py_delta value",
+            Duration::seconds(-86399999913600),
+            -999999999,
+            0,
+            0,
+        );
+        // Same, for max value
+        check(
+            "max py_delta value",
+            Duration::seconds(86399999999999) + Duration::microseconds(999999),
+            999999999,
+            86399,
+            999999,
+        );
+
+        // This check is to assert that we can't construct every possible Duration from a PyDelta
+        // since they have different bounds.
+        Python::with_gil(|py| {
+            let low_days: i32 = -1000000000;
+            // This is possible
+            assert!(panic::catch_unwind(|| Duration::days(low_days as i64)).is_ok());
+            // This panics on PyDelta::new
+            assert!(panic::catch_unwind(|| {
+                let py_delta = new_py_datetime_ob(py, "timedelta", (low_days, 0, 0));
+                if let Ok(_duration) = py_delta.extract::<Duration>() {
+                    // So we should never get here
+                }
+            })
+            .is_err());
+
+            let high_days: i32 = 1000000000;
+            // This is possible
+            assert!(panic::catch_unwind(|| Duration::days(high_days as i64)).is_ok());
+            // This panics on PyDelta::new
+            assert!(panic::catch_unwind(|| {
+                let py_delta = new_py_datetime_ob(py, "timedelta", (high_days, 0, 0));
+                if let Ok(_duration) = py_delta.extract::<Duration>() {
+                    // So we should never get here
+                }
+            })
+            .is_err());
+        });
+    }
+
+    #[test]
+    fn test_pyo3_date_topyobject() {
+        let eq_ymd = |name: &'static str, year, month, day| {
+            Python::with_gil(|py| {
+                let date = NaiveDate::from_ymd_opt(year, month, day)
+                    .unwrap()
+                    .to_object(py);
+                let py_date = new_py_datetime_ob(py, "date", (year, month, day));
+                assert_eq!(
+                    date.bind(py).compare(&py_date).unwrap(),
+                    Ordering::Equal,
+                    "{}: {} != {}",
+                    name,
+                    date,
+                    py_date
+                );
+            })
+        };
+
+        eq_ymd("past date", 2012, 2, 29);
+        eq_ymd("min date", 1, 1, 1);
+        eq_ymd("future date", 3000, 6, 5);
+        eq_ymd("max date", 9999, 12, 31);
+    }
+
+    #[test]
+    fn test_pyo3_date_frompyobject() {
+        let eq_ymd = |name: &'static str, year, month, day| {
+            Python::with_gil(|py| {
+                let py_date = new_py_datetime_ob(py, "date", (year, month, day));
+                let py_date: NaiveDate = py_date.extract().unwrap();
+                let date = NaiveDate::from_ymd_opt(year, month, day).unwrap();
+                assert_eq!(py_date, date, "{}: {} != {}", name, date, py_date);
+            })
+        };
+
+        eq_ymd("past date", 2012, 2, 29);
+        eq_ymd("min date", 1, 1, 1);
+        eq_ymd("future date", 3000, 6, 5);
+        eq_ymd("max date", 9999, 12, 31);
+    }
+
+    #[test]
+    fn test_pyo3_datetime_topyobject_utc() {
+        Python::with_gil(|py| {
+            let check_utc =
+                |name: &'static str, year, month, day, hour, minute, second, ms, py_ms| {
+                    let datetime = NaiveDate::from_ymd_opt(year, month, day)
+                        .unwrap()
+                        .and_hms_micro_opt(hour, minute, second, ms)
+                        .unwrap()
+                        .and_utc();
+                    let datetime = datetime.to_object(py);
+                    let py_datetime = new_py_datetime_ob(
+                        py,
+                        "datetime",
+                        (
+                            year,
+                            month,
+                            day,
+                            hour,
+                            minute,
+                            second,
+                            py_ms,
+                            python_utc(py),
+                        ),
+                    );
+                    assert_eq!(
+                        datetime.bind(py).compare(&py_datetime).unwrap(),
+                        Ordering::Equal,
+                        "{}: {} != {}",
+                        name,
+                        datetime,
+                        py_datetime
+                    );
+                };
+
+            check_utc("regular", 2014, 5, 6, 7, 8, 9, 999_999, 999_999);
+
+            assert_warnings!(
+                py,
+                check_utc("leap second", 2014, 5, 6, 7, 8, 59, 1_999_999, 999_999),
+                [(
+                    PyUserWarning,
+                    "ignored leap-second, `datetime` does not support leap-seconds"
+                )]
+            );
+        })
+    }
+
+    #[test]
+    fn test_pyo3_datetime_topyobject_fixed_offset() {
+        Python::with_gil(|py| {
+            let check_fixed_offset =
+                |name: &'static str, year, month, day, hour, minute, second, ms, py_ms| {
+                    let offset = FixedOffset::east_opt(3600).unwrap();
+                    let datetime = NaiveDate::from_ymd_opt(year, month, day)
+                        .unwrap()
+                        .and_hms_micro_opt(hour, minute, second, ms)
+                        .unwrap()
+                        .and_local_timezone(offset)
+                        .unwrap();
+                    let datetime = datetime.to_object(py);
+                    let py_tz = offset.to_object(py);
+                    let py_datetime = new_py_datetime_ob(
+                        py,
+                        "datetime",
+                        (year, month, day, hour, minute, second, py_ms, py_tz),
+                    );
+                    assert_eq!(
+                        datetime.bind(py).compare(&py_datetime).unwrap(),
+                        Ordering::Equal,
+                        "{}: {} != {}",
+                        name,
+                        datetime,
+                        py_datetime
+                    );
+                };
+
+            check_fixed_offset("regular", 2014, 5, 6, 7, 8, 9, 999_999, 999_999);
+
+            assert_warnings!(
+                py,
+                check_fixed_offset("leap second", 2014, 5, 6, 7, 8, 59, 1_999_999, 999_999),
+                [(
+                    PyUserWarning,
+                    "ignored leap-second, `datetime` does not support leap-seconds"
+                )]
+            );
+        })
+    }
+
+    #[test]
+    fn test_pyo3_datetime_frompyobject_utc() {
+        Python::with_gil(|py| {
+            let year = 2014;
+            let month = 5;
+            let day = 6;
+            let hour = 7;
+            let minute = 8;
+            let second = 9;
+            let micro = 999_999;
+            let tz_utc = timezone_utc_bound(py);
+            let py_datetime = new_py_datetime_ob(
+                py,
+                "datetime",
+                (year, month, day, hour, minute, second, micro, tz_utc),
+            );
+            let py_datetime: DateTime<Utc> = py_datetime.extract().unwrap();
+            let datetime = NaiveDate::from_ymd_opt(year, month, day)
+                .unwrap()
+                .and_hms_micro_opt(hour, minute, second, micro)
+                .unwrap()
+                .and_utc();
+            assert_eq!(py_datetime, datetime,);
+        })
+    }
+
+    #[test]
+    fn test_pyo3_datetime_frompyobject_fixed_offset() {
+        Python::with_gil(|py| {
+            let year = 2014;
+            let month = 5;
+            let day = 6;
+            let hour = 7;
+            let minute = 8;
+            let second = 9;
+            let micro = 999_999;
+            let offset = FixedOffset::east_opt(3600).unwrap();
+            let py_tz = offset.to_object(py);
+            let py_datetime = new_py_datetime_ob(
+                py,
+                "datetime",
+                (year, month, day, hour, minute, second, micro, py_tz),
+            );
+            let datetime_from_py: DateTime<FixedOffset> = py_datetime.extract().unwrap();
+            let datetime = NaiveDate::from_ymd_opt(year, month, day)
+                .unwrap()
+                .and_hms_micro_opt(hour, minute, second, micro)
+                .unwrap();
+            let datetime = datetime.and_local_timezone(offset).unwrap();
+
+            assert_eq!(datetime_from_py, datetime);
+            assert!(
+                py_datetime.extract::<DateTime<Utc>>().is_err(),
+                "Extracting Utc from nonzero FixedOffset timezone will fail"
+            );
+
+            let utc = python_utc(py);
+            let py_datetime_utc = new_py_datetime_ob(
+                py,
+                "datetime",
+                (year, month, day, hour, minute, second, micro, utc),
+            );
+            assert!(
+                py_datetime_utc.extract::<DateTime<FixedOffset>>().is_ok(),
+                "Extracting FixedOffset from Utc timezone will succeed"
+            );
+        })
+    }
+
+    #[test]
+    fn test_pyo3_offset_fixed_topyobject() {
+        Python::with_gil(|py| {
+            // Chrono offset
+            let offset = FixedOffset::east_opt(3600).unwrap().to_object(py);
+            // Python timezone from timedelta
+            let td = new_py_datetime_ob(py, "timedelta", (0, 3600, 0));
+            let py_timedelta = new_py_datetime_ob(py, "timezone", (td,));
+            // Should be equal
+            assert!(offset.bind(py).eq(py_timedelta).unwrap());
+
+            // Same but with negative values
+            let offset = FixedOffset::east_opt(-3600).unwrap().to_object(py);
+            let td = new_py_datetime_ob(py, "timedelta", (0, -3600, 0));
+            let py_timedelta = new_py_datetime_ob(py, "timezone", (td,));
+            assert!(offset.bind(py).eq(py_timedelta).unwrap());
+        })
+    }
+
+    #[test]
+    fn test_pyo3_offset_fixed_frompyobject() {
+        Python::with_gil(|py| {
+            let py_timedelta = new_py_datetime_ob(py, "timedelta", (0, 3600, 0));
+            let py_tzinfo = new_py_datetime_ob(py, "timezone", (py_timedelta,));
+            let offset: FixedOffset = py_tzinfo.extract().unwrap();
+            assert_eq!(FixedOffset::east_opt(3600).unwrap(), offset);
+        })
+    }
+
+    #[test]
+    fn test_pyo3_offset_utc_topyobject() {
+        Python::with_gil(|py| {
+            let utc = Utc.to_object(py);
+            let py_utc = python_utc(py);
+            assert!(utc.bind(py).is(&py_utc));
+        })
+    }
+
+    #[test]
+    fn test_pyo3_offset_utc_frompyobject() {
+        Python::with_gil(|py| {
+            let py_utc = python_utc(py);
+            let py_utc: Utc = py_utc.extract().unwrap();
+            assert_eq!(Utc, py_utc);
+
+            let py_timedelta = new_py_datetime_ob(py, "timedelta", (0, 0, 0));
+            let py_timezone_utc = new_py_datetime_ob(py, "timezone", (py_timedelta,));
+            let py_timezone_utc: Utc = py_timezone_utc.extract().unwrap();
+            assert_eq!(Utc, py_timezone_utc);
+
+            let py_timedelta = new_py_datetime_ob(py, "timedelta", (0, 3600, 0));
+            let py_timezone = new_py_datetime_ob(py, "timezone", (py_timedelta,));
+            assert!(py_timezone.extract::<Utc>().is_err());
+        })
+    }
+
+    #[test]
+    fn test_pyo3_time_topyobject() {
+        Python::with_gil(|py| {
+            let check_time = |name: &'static str, hour, minute, second, ms, py_ms| {
+                let time = NaiveTime::from_hms_micro_opt(hour, minute, second, ms)
+                    .unwrap()
+                    .to_object(py);
+                let py_time = new_py_datetime_ob(py, "time", (hour, minute, second, py_ms));
+                assert!(
+                    time.bind(py).eq(&py_time).unwrap(),
+                    "{}: {} != {}",
+                    name,
+                    time,
+                    py_time
+                );
+            };
+
+            check_time("regular", 3, 5, 7, 999_999, 999_999);
+
+            assert_warnings!(
+                py,
+                check_time("leap second", 3, 5, 59, 1_999_999, 999_999),
+                [(
+                    PyUserWarning,
+                    "ignored leap-second, `datetime` does not support leap-seconds"
+                )]
+            );
+        })
+    }
+
+    #[test]
+    fn test_pyo3_time_frompyobject() {
+        let hour = 3;
+        let minute = 5;
+        let second = 7;
+        let micro = 999_999;
+        Python::with_gil(|py| {
+            let py_time = new_py_datetime_ob(py, "time", (hour, minute, second, micro));
+            let py_time: NaiveTime = py_time.extract().unwrap();
+            let time = NaiveTime::from_hms_micro_opt(hour, minute, second, micro).unwrap();
+            assert_eq!(py_time, time);
+        })
+    }
+
+    fn new_py_datetime_ob<'py>(
+        py: Python<'py>,
+        name: &str,
+        args: impl IntoPy<Py<PyTuple>>,
+    ) -> Bound<'py, PyAny> {
+        py.import_bound("datetime")
+            .unwrap()
+            .getattr(name)
+            .unwrap()
+            .call1(args)
+            .unwrap()
+    }
+
+    fn python_utc(py: Python<'_>) -> Bound<'_, PyAny> {
+        py.import_bound("datetime")
+            .unwrap()
+            .getattr("timezone")
+            .unwrap()
+            .getattr("utc")
+            .unwrap()
+    }
+
+    #[cfg(not(target_arch = "wasm32"))]
+    mod proptests {
+        use super::*;
+        use crate::tests::common::CatchWarnings;
+        use crate::types::IntoPyDict;
+        use proptest::prelude::*;
+
+        proptest! {
+
+            // Range is limited to 1970 to 2038 due to windows limitations
+            #[test]
+            fn test_pyo3_offset_fixed_frompyobject_created_in_python(timestamp in 0..(i32::MAX as i64), timedelta in -86399i32..=86399i32) {
+                Python::with_gil(|py| {
+
+                    let globals = [("datetime", py.import_bound("datetime").unwrap())].into_py_dict_bound(py);
+                    let code = format!("datetime.datetime.fromtimestamp({}).replace(tzinfo=datetime.timezone(datetime.timedelta(seconds={})))", timestamp, timedelta);
+                    let t = py.eval_bound(&code, Some(&globals), None).unwrap();
+
+                    // Get ISO 8601 string from python
+                    let py_iso_str = t.call_method0("isoformat").unwrap();
+
+                    // Get ISO 8601 string from rust
+                    let t = t.extract::<DateTime<FixedOffset>>().unwrap();
+                    // Python doesn't print the seconds of the offset if they are 0
+                    let rust_iso_str = if timedelta % 60 == 0 {
+                        t.format("%Y-%m-%dT%H:%M:%S%:z").to_string()
+                    } else {
+                        t.format("%Y-%m-%dT%H:%M:%S%::z").to_string()
+                    };
+
+                    // They should be equal
+                    assert_eq!(py_iso_str.to_string(), rust_iso_str);
+                })
+            }
+
+            #[test]
+            fn test_duration_roundtrip(days in -999999999i64..=999999999i64) {
+                // Test roundtrip conversion rust->python->rust for all allowed
+                // python values of durations (from -999999999 to 999999999 days),
+                Python::with_gil(|py| {
+                    let dur = Duration::days(days);
+                    let py_delta = dur.into_py(py);
+                    let roundtripped: Duration = py_delta.extract(py).expect("Round trip");
+                    assert_eq!(dur, roundtripped);
+                })
+            }
+
+            #[test]
+            fn test_fixed_offset_roundtrip(secs in -86399i32..=86399i32) {
+                Python::with_gil(|py| {
+                    let offset = FixedOffset::east_opt(secs).unwrap();
+                    let py_offset = offset.into_py(py);
+                    let roundtripped: FixedOffset = py_offset.extract(py).expect("Round trip");
+                    assert_eq!(offset, roundtripped);
+                })
+            }
+
+            #[test]
+            fn test_naive_date_roundtrip(
+                year in 1i32..=9999i32,
+                month in 1u32..=12u32,
+                day in 1u32..=31u32
+            ) {
+                // Test roundtrip conversion rust->python->rust for all allowed
+                // python dates (from year 1 to year 9999)
+                Python::with_gil(|py| {
+                    // We use to `from_ymd_opt` constructor so that we only test valid `NaiveDate`s.
+                    // This is to skip the test if we are creating an invalid date, like February 31.
+                    if let Some(date) = NaiveDate::from_ymd_opt(year, month, day) {
+                        let py_date = date.to_object(py);
+                        let roundtripped: NaiveDate = py_date.extract(py).expect("Round trip");
+                        assert_eq!(date, roundtripped);
+                    }
+                })
+            }
+
+            #[test]
+            fn test_naive_time_roundtrip(
+                hour in 0u32..=23u32,
+                min in 0u32..=59u32,
+                sec in 0u32..=59u32,
+                micro in 0u32..=1_999_999u32
+            ) {
+                // Test roundtrip conversion rust->python->rust for naive times.
+                // Python time has a resolution of microseconds, so we only test
+                // NaiveTimes with microseconds resolution, even if NaiveTime has nanosecond
+                // resolution.
+                Python::with_gil(|py| {
+                    if let Some(time) = NaiveTime::from_hms_micro_opt(hour, min, sec, micro) {
+                        // Wrap in CatchWarnings to avoid to_object firing warning for truncated leap second
+                        let py_time = CatchWarnings::enter(py, |_| Ok(time.to_object(py))).unwrap();
+                        let roundtripped: NaiveTime = py_time.extract(py).expect("Round trip");
+                        // Leap seconds are not roundtripped
+                        let expected_roundtrip_time = micro.checked_sub(1_000_000).map(|micro| NaiveTime::from_hms_micro_opt(hour, min, sec, micro).unwrap()).unwrap_or(time);
+                        assert_eq!(expected_roundtrip_time, roundtripped);
+                    }
+                })
+            }
+
+            #[test]
+            fn test_naive_datetime_roundtrip(
+                year in 1i32..=9999i32,
+                month in 1u32..=12u32,
+                day in 1u32..=31u32,
+                hour in 0u32..=24u32,
+                min in 0u32..=60u32,
+                sec in 0u32..=60u32,
+                micro in 0u32..=999_999u32
+            ) {
+                Python::with_gil(|py| {
+                    let date_opt = NaiveDate::from_ymd_opt(year, month, day);
+                    let time_opt = NaiveTime::from_hms_micro_opt(hour, min, sec, micro);
+                    if let (Some(date), Some(time)) = (date_opt, time_opt) {
+                        let dt = NaiveDateTime::new(date, time);
+                        let pydt = dt.to_object(py);
+                        let roundtripped: NaiveDateTime = pydt.extract(py).expect("Round trip");
+                        assert_eq!(dt, roundtripped);
+                    }
+                })
+            }
+
+            #[test]
+            fn test_utc_datetime_roundtrip(
+                year in 1i32..=9999i32,
+                month in 1u32..=12u32,
+                day in 1u32..=31u32,
+                hour in 0u32..=23u32,
+                min in 0u32..=59u32,
+                sec in 0u32..=59u32,
+                micro in 0u32..=1_999_999u32
+            ) {
+                Python::with_gil(|py| {
+                    let date_opt = NaiveDate::from_ymd_opt(year, month, day);
+                    let time_opt = NaiveTime::from_hms_micro_opt(hour, min, sec, micro);
+                    if let (Some(date), Some(time)) = (date_opt, time_opt) {
+                        let dt: DateTime<Utc> = NaiveDateTime::new(date, time).and_utc();
+                        // Wrap in CatchWarnings to avoid into_py firing warning for truncated leap second
+                        let py_dt = CatchWarnings::enter(py, |_| Ok(dt.into_py(py))).unwrap();
+                        let roundtripped: DateTime<Utc> = py_dt.extract(py).expect("Round trip");
+                        // Leap seconds are not roundtripped
+                        let expected_roundtrip_time = micro.checked_sub(1_000_000).map(|micro| NaiveTime::from_hms_micro_opt(hour, min, sec, micro).unwrap()).unwrap_or(time);
+                        let expected_roundtrip_dt: DateTime<Utc> = NaiveDateTime::new(date, expected_roundtrip_time).and_utc();
+                        assert_eq!(expected_roundtrip_dt, roundtripped);
+                    }
+                })
+            }
+
+            #[test]
+            fn test_fixed_offset_datetime_roundtrip(
+                year in 1i32..=9999i32,
+                month in 1u32..=12u32,
+                day in 1u32..=31u32,
+                hour in 0u32..=23u32,
+                min in 0u32..=59u32,
+                sec in 0u32..=59u32,
+                micro in 0u32..=1_999_999u32,
+                offset_secs in -86399i32..=86399i32
+            ) {
+                Python::with_gil(|py| {
+                    let date_opt = NaiveDate::from_ymd_opt(year, month, day);
+                    let time_opt = NaiveTime::from_hms_micro_opt(hour, min, sec, micro);
+                    let offset = FixedOffset::east_opt(offset_secs).unwrap();
+                    if let (Some(date), Some(time)) = (date_opt, time_opt) {
+                        let dt: DateTime<FixedOffset> = NaiveDateTime::new(date, time).and_local_timezone(offset).unwrap();
+                        // Wrap in CatchWarnings to avoid into_py firing warning for truncated leap second
+                        let py_dt = CatchWarnings::enter(py, |_| Ok(dt.into_py(py))).unwrap();
+                        let roundtripped: DateTime<FixedOffset> = py_dt.extract(py).expect("Round trip");
+                        // Leap seconds are not roundtripped
+                        let expected_roundtrip_time = micro.checked_sub(1_000_000).map(|micro| NaiveTime::from_hms_micro_opt(hour, min, sec, micro).unwrap()).unwrap_or(time);
+                        let expected_roundtrip_dt: DateTime<FixedOffset> = NaiveDateTime::new(date, expected_roundtrip_time).and_local_timezone(offset).unwrap();
+                        assert_eq!(expected_roundtrip_dt, roundtripped);
+                    }
+                })
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/chrono_tz.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/chrono_tz.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/chrono_tz.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/chrono_tz.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,122 @@
+#![cfg(all(Py_3_9, feature = "chrono-tz"))]
+
+//! Conversions to and from [chrono-tz](https://docs.rs/chrono-tz/)’s `Tz`.
+//!
+//! This feature requires at least Python 3.9.
+//!
+//! # Setup
+//!
+//! To use this feature, add this to your **`Cargo.toml`**:
+//!
+//! ```toml
+//! [dependencies]
+//! chrono-tz = "0.8"
+#![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"),  "\", features = [\"chrono-tz\"] }")]
+//! ```
+//!
+//! Note that you must use compatible versions of chrono, chrono-tz and PyO3.
+//! The required chrono version may vary based on the version of PyO3.
+//!
+//! # Example: Convert a `zoneinfo.ZoneInfo` to chrono-tz's `Tz`
+//!
+//! ```rust,no_run
+//! use chrono_tz::Tz;
+//! use pyo3::{Python, ToPyObject};
+//!
+//! fn main() {
+//!     pyo3::prepare_freethreaded_python();
+//!     Python::with_gil(|py| {
+//!         // Convert to Python
+//!         let py_tzinfo = Tz::Europe__Paris.to_object(py);
+//!         // Convert back to Rust
+//!         assert_eq!(py_tzinfo.extract::<Tz>(py).unwrap(), Tz::Europe__Paris);
+//!     });
+//! }
+//! ```
+use crate::exceptions::PyValueError;
+use crate::pybacked::PyBackedStr;
+use crate::sync::GILOnceCell;
+use crate::types::{any::PyAnyMethods, PyType};
+use crate::{
+    intern, Bound, FromPyObject, IntoPy, Py, PyAny, PyObject, PyResult, Python, ToPyObject,
+};
+use chrono_tz::Tz;
+use std::str::FromStr;
+
+impl ToPyObject for Tz {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        static ZONE_INFO: GILOnceCell<Py<PyType>> = GILOnceCell::new();
+        ZONE_INFO
+            .get_or_try_init_type_ref(py, "zoneinfo", "ZoneInfo")
+            .unwrap()
+            .call1((self.name(),))
+            .unwrap()
+            .unbind()
+    }
+}
+
+impl IntoPy<PyObject> for Tz {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_object(py)
+    }
+}
+
+impl FromPyObject<'_> for Tz {
+    fn extract_bound(ob: &Bound<'_, PyAny>) -> PyResult<Tz> {
+        Tz::from_str(
+            &ob.getattr(intern!(ob.py(), "key"))?
+                .extract::<PyBackedStr>()?,
+        )
+        .map_err(|e| PyValueError::new_err(e.to_string()))
+    }
+}
+
+#[cfg(all(test, not(windows)))] // Troubles loading timezones on Windows
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test_frompyobject() {
+        Python::with_gil(|py| {
+            assert_eq!(
+                new_zoneinfo(py, "Europe/Paris").extract::<Tz>().unwrap(),
+                Tz::Europe__Paris
+            );
+            assert_eq!(new_zoneinfo(py, "UTC").extract::<Tz>().unwrap(), Tz::UTC);
+            assert_eq!(
+                new_zoneinfo(py, "Etc/GMT-5").extract::<Tz>().unwrap(),
+                Tz::Etc__GMTMinus5
+            );
+        });
+    }
+
+    #[test]
+    fn test_topyobject() {
+        Python::with_gil(|py| {
+            let assert_eq = |l: PyObject, r: Bound<'_, PyAny>| {
+                assert!(l.bind(py).eq(r).unwrap());
+            };
+
+            assert_eq(
+                Tz::Europe__Paris.to_object(py),
+                new_zoneinfo(py, "Europe/Paris"),
+            );
+            assert_eq(Tz::UTC.to_object(py), new_zoneinfo(py, "UTC"));
+            assert_eq(
+                Tz::Etc__GMTMinus5.to_object(py),
+                new_zoneinfo(py, "Etc/GMT-5"),
+            );
+        });
+    }
+
+    fn new_zoneinfo<'py>(py: Python<'py>, name: &str) -> Bound<'py, PyAny> {
+        zoneinfo_class(py).call1((name,)).unwrap()
+    }
+
+    fn zoneinfo_class(py: Python<'_>) -> Bound<'_, PyAny> {
+        py.import_bound("zoneinfo")
+            .unwrap()
+            .getattr("ZoneInfo")
+            .unwrap()
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/either.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/either.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/either.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/either.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,157 @@
+#![cfg(feature = "either")]
+
+//! Conversion to/from
+//! [either](https://docs.rs/either/ "A library for easy idiomatic error handling and reporting in Rust applications")’s
+//! [`Either`] type to a union of two Python types.
+//!
+//! Use of a generic sum type like [either] is common when you want to either accept one of two possible
+//! types as an argument or return one of two possible types from a function, without having to define
+//! a helper type manually yourself.
+//!
+//! # Setup
+//!
+//! To use this feature, add this to your **`Cargo.toml`**:
+//!
+//! ```toml
+//! [dependencies]
+//! ## change * to the version you want to use, ideally the latest.
+//! either = "*"
+#![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"),  "\", features = [\"either\"] }")]
+//! ```
+//!
+//! Note that you must use compatible versions of either and PyO3.
+//! The required either version may vary based on the version of PyO3.
+//!
+//! # Example: Convert a `int | str` to `Either<i32, String>`.
+//!
+//! ```rust
+//! use either::Either;
+//! use pyo3::{Python, ToPyObject};
+//!
+//! fn main() {
+//!     pyo3::prepare_freethreaded_python();
+//!     Python::with_gil(|py| {
+//!         // Create a string and an int in Python.
+//!         let py_str = "crab".to_object(py);
+//!         let py_int = 42.to_object(py);
+//!         // Now convert it to an Either<i32, String>.
+//!         let either_str: Either<i32, String> = py_str.extract(py).unwrap();
+//!         let either_int: Either<i32, String> = py_int.extract(py).unwrap();
+//!     });
+//! }
+//! ```
+//!
+//! [either](https://docs.rs/either/ "A library for easy idiomatic error handling and reporting in Rust applications")’s
+
+#[cfg(feature = "experimental-inspect")]
+use crate::inspect::types::TypeInfo;
+use crate::{
+    exceptions::PyTypeError, types::any::PyAnyMethods, Bound, FromPyObject, IntoPy, PyAny,
+    PyObject, PyResult, Python, ToPyObject,
+};
+use either::Either;
+
+#[cfg_attr(docsrs, doc(cfg(feature = "either")))]
+impl<L, R> IntoPy<PyObject> for Either<L, R>
+where
+    L: IntoPy<PyObject>,
+    R: IntoPy<PyObject>,
+{
+    #[inline]
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        match self {
+            Either::Left(l) => l.into_py(py),
+            Either::Right(r) => r.into_py(py),
+        }
+    }
+}
+
+#[cfg_attr(docsrs, doc(cfg(feature = "either")))]
+impl<L, R> ToPyObject for Either<L, R>
+where
+    L: ToPyObject,
+    R: ToPyObject,
+{
+    #[inline]
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        match self {
+            Either::Left(l) => l.to_object(py),
+            Either::Right(r) => r.to_object(py),
+        }
+    }
+}
+
+#[cfg_attr(docsrs, doc(cfg(feature = "either")))]
+impl<'py, L, R> FromPyObject<'py> for Either<L, R>
+where
+    L: FromPyObject<'py>,
+    R: FromPyObject<'py>,
+{
+    #[inline]
+    fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self> {
+        if let Ok(l) = obj.extract::<L>() {
+            Ok(Either::Left(l))
+        } else if let Ok(r) = obj.extract::<R>() {
+            Ok(Either::Right(r))
+        } else {
+            // TODO: it might be nice to use the `type_input()` name here once `type_input`
+            // is not experimental, rather than the Rust type names.
+            let err_msg = format!(
+                "failed to convert the value to 'Union[{}, {}]'",
+                std::any::type_name::<L>(),
+                std::any::type_name::<R>()
+            );
+            Err(PyTypeError::new_err(err_msg))
+        }
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        TypeInfo::union_of(&[L::type_input(), R::type_input()])
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use std::borrow::Cow;
+
+    use crate::exceptions::PyTypeError;
+    use crate::{Python, ToPyObject};
+
+    use either::Either;
+
+    #[test]
+    fn test_either_conversion() {
+        type E = Either<i32, String>;
+        type E1 = Either<i32, f32>;
+        type E2 = Either<f32, i32>;
+
+        Python::with_gil(|py| {
+            let l = E::Left(42);
+            let obj_l = l.to_object(py);
+            assert_eq!(obj_l.extract::<i32>(py).unwrap(), 42);
+            assert_eq!(obj_l.extract::<E>(py).unwrap(), l);
+
+            let r = E::Right("foo".to_owned());
+            let obj_r = r.to_object(py);
+            assert_eq!(obj_r.extract::<Cow<'_, str>>(py).unwrap(), "foo");
+            assert_eq!(obj_r.extract::<E>(py).unwrap(), r);
+
+            let obj_s = "foo".to_object(py);
+            let err = obj_s.extract::<E1>(py).unwrap_err();
+            assert!(err.is_instance_of::<PyTypeError>(py));
+            assert_eq!(
+                err.to_string(),
+                "TypeError: failed to convert the value to 'Union[i32, f32]'"
+            );
+
+            let obj_i = 42.to_object(py);
+            assert_eq!(obj_i.extract::<E1>(py).unwrap(), E1::Left(42));
+            assert_eq!(obj_i.extract::<E2>(py).unwrap(), E2::Left(42.0));
+
+            let obj_f = 42.0.to_object(py);
+            assert_eq!(obj_f.extract::<E1>(py).unwrap(), E1::Right(42.0));
+            assert_eq!(obj_f.extract::<E2>(py).unwrap(), E2::Left(42.0));
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/eyre.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/eyre.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/eyre.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/eyre.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,196 @@
+#![cfg(feature = "eyre")]
+
+//! A conversion from
+//! [eyre](https://docs.rs/eyre/ "A library for easy idiomatic error handling and reporting in Rust applications.")’s
+//! [`Report`] type to [`PyErr`].
+//!
+//! Use of an error handling library like [eyre] is common in application code and when you just
+//! want error handling to be easy. If you are writing a library or you need more control over your
+//! errors you might want to design your own error type instead.
+//!
+//! When the inner error is a [`PyErr`] without source, it will be extracted out.
+//! Otherwise a Python [`RuntimeError`] will be created.
+//! You might find that you need to map the error from your Rust code into another Python exception.
+//! See [`PyErr::new`] for more information about that.
+//!
+//! For information about error handling in general, see the [Error handling] chapter of the Rust
+//! book.
+//!
+//! # Setup
+//!
+//! To use this feature, add this to your **`Cargo.toml`**:
+//!
+//! ```toml
+//! [dependencies]
+//! ## change * to the version you want to use, ideally the latest.
+//! eyre = "*"
+#![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"),  "\", features = [\"eyre\"] }")]
+//! ```
+//!
+//! Note that you must use compatible versions of eyre and PyO3.
+//! The required eyre version may vary based on the version of PyO3.
+//!
+//! # Example: Propagating a `PyErr` into [`eyre::Report`]
+//!
+//! ```rust
+//! use pyo3::prelude::*;
+//! use std::path::PathBuf;
+//!
+//! // A wrapper around a Rust function.
+//! // The pyfunction macro performs the conversion to a PyErr
+//! #[pyfunction]
+//! fn py_open(filename: PathBuf) -> eyre::Result<Vec<u8>> {
+//!     let data = std::fs::read(filename)?;
+//!     Ok(data)
+//! }
+//!
+//! fn main() {
+//!     let error = Python::with_gil(|py| -> PyResult<Vec<u8>> {
+//!         let fun = wrap_pyfunction_bound!(py_open, py)?;
+//!         let text = fun.call1(("foo.txt",))?.extract::<Vec<u8>>()?;
+//!         Ok(text)
+//!     }).unwrap_err();
+//!
+//!     println!("{}", error);
+//! }
+//! ```
+//!
+//! # Example: Using `eyre` in general
+//!
+//! Note that you don't need this feature to convert a [`PyErr`] into an [`eyre::Report`], because
+//! it can already convert anything that implements [`Error`](std::error::Error):
+//!
+//! ```rust
+//! use pyo3::prelude::*;
+//! use pyo3::types::PyBytes;
+//!
+//! // An example function that must handle multiple error types.
+//! //
+//! // To do this you usually need to design your own error type or use
+//! // `Box<dyn Error>`. `eyre` is a convenient alternative for this.
+//! pub fn decompress(bytes: &[u8]) -> eyre::Result<String> {
+//!     // An arbitrary example of a Python api you
+//!     // could call inside an application...
+//!     // This might return a `PyErr`.
+//!     let res = Python::with_gil(|py| {
+//!         let zlib = PyModule::import_bound(py, "zlib")?;
+//!         let decompress = zlib.getattr("decompress")?;
+//!         let bytes = PyBytes::new_bound(py, bytes);
+//!         let value = decompress.call1((bytes,))?;
+//!         value.extract::<Vec<u8>>()
+//!     })?;
+//!
+//!     // This might be a `FromUtf8Error`.
+//!     let text = String::from_utf8(res)?;
+//!
+//!     Ok(text)
+//! }
+//!
+//! fn main() -> eyre::Result<()> {
+//!     let bytes: &[u8] = b"x\x9c\x8b\xcc/U(\xce\xc8/\xcdIQ((\xcaOJL\xca\xa9T\
+//!                         (-NU(\xc9HU\xc8\xc9LJ\xcbI,IUH.\x02\x91\x99y\xc5%\
+//!                         \xa9\x89)z\x00\xf2\x15\x12\xfe";
+//!     let text = decompress(bytes)?;
+//!
+//!     println!("The text is \"{}\"", text);
+//! # assert_eq!(text, "You should probably use the libflate crate instead.");
+//!     Ok(())
+//! }
+//! ```
+//!
+//! [eyre]: https://docs.rs/eyre/ "A library for easy idiomatic error handling and reporting in Rust applications."
+//! [`RuntimeError`]: https://docs.python.org/3/library/exceptions.html#RuntimeError "Built-in Exceptions — Python documentation"
+//! [Error handling]: https://doc.rust-lang.org/book/ch09-02-recoverable-errors-with-result.html "Recoverable Errors with Result - The Rust Programming Language"
+
+use crate::exceptions::PyRuntimeError;
+use crate::PyErr;
+use eyre::Report;
+
+/// Converts [`eyre::Report`] to a [`PyErr`] containing a [`PyRuntimeError`].
+///
+/// If you want to raise a different Python exception you will have to do so manually. See
+/// [`PyErr::new`] for more information about that.
+impl From<eyre::Report> for PyErr {
+    fn from(mut error: Report) -> Self {
+        // Errors containing a PyErr without chain or context are returned as the underlying error
+        if error.source().is_none() {
+            error = match error.downcast::<Self>() {
+                Ok(py_err) => return py_err,
+                Err(error) => error,
+            };
+        }
+        PyRuntimeError::new_err(format!("{:?}", error))
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::exceptions::{PyRuntimeError, PyValueError};
+    use crate::prelude::*;
+    use crate::types::IntoPyDict;
+
+    use eyre::{bail, eyre, Report, Result, WrapErr};
+
+    fn f() -> Result<()> {
+        use std::io;
+        bail!(io::Error::new(io::ErrorKind::PermissionDenied, "oh no!"));
+    }
+
+    fn g() -> Result<()> {
+        f().wrap_err("f failed")
+    }
+
+    fn h() -> Result<()> {
+        g().wrap_err("g failed")
+    }
+
+    #[test]
+    fn test_pyo3_exception_contents() {
+        let err = h().unwrap_err();
+        let expected_contents = format!("{:?}", err);
+        let pyerr = PyErr::from(err);
+
+        Python::with_gil(|py| {
+            let locals = [("err", pyerr)].into_py_dict_bound(py);
+            let pyerr = py.run_bound("raise err", None, Some(&locals)).unwrap_err();
+            assert_eq!(pyerr.value_bound(py).to_string(), expected_contents);
+        })
+    }
+
+    fn k() -> Result<()> {
+        Err(eyre!("Some sort of error"))
+    }
+
+    #[test]
+    fn test_pyo3_exception_contents2() {
+        let err = k().unwrap_err();
+        let expected_contents = format!("{:?}", err);
+        let pyerr = PyErr::from(err);
+
+        Python::with_gil(|py| {
+            let locals = [("err", pyerr)].into_py_dict_bound(py);
+            let pyerr = py.run_bound("raise err", None, Some(&locals)).unwrap_err();
+            assert_eq!(pyerr.value_bound(py).to_string(), expected_contents);
+        })
+    }
+
+    #[test]
+    fn test_pyo3_unwrap_simple_err() {
+        let origin_exc = PyValueError::new_err("Value Error");
+        let report: Report = origin_exc.into();
+        let converted: PyErr = report.into();
+        assert!(Python::with_gil(
+            |py| converted.is_instance_of::<PyValueError>(py)
+        ))
+    }
+    #[test]
+    fn test_pyo3_unwrap_complex_err() {
+        let origin_exc = PyValueError::new_err("Value Error");
+        let mut report: Report = origin_exc.into();
+        report = report.wrap_err("Wrapped");
+        let converted: PyErr = report.into();
+        assert!(Python::with_gil(
+            |py| converted.is_instance_of::<PyRuntimeError>(py)
+        ))
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/hashbrown.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/hashbrown.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/hashbrown.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/hashbrown.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,204 @@
+#![cfg(feature = "hashbrown")]
+
+//!  Conversions to and from [hashbrown](https://docs.rs/hashbrown/)’s
+//! `HashMap` and `HashSet`.
+//!
+//! # Setup
+//!
+//! To use this feature, add this to your **`Cargo.toml`**:
+//!
+//! ```toml
+//! [dependencies]
+//! # change * to the latest versions
+//! hashbrown = "*"
+#![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"),  "\", features = [\"hashbrown\"] }")]
+//! ```
+//!
+//! Note that you must use compatible versions of hashbrown and PyO3.
+//! The required hashbrown version may vary based on the version of PyO3.
+use crate::{
+    types::any::PyAnyMethods,
+    types::dict::PyDictMethods,
+    types::frozenset::PyFrozenSetMethods,
+    types::set::{new_from_iter, PySetMethods},
+    types::{IntoPyDict, PyDict, PyFrozenSet, PySet},
+    Bound, FromPyObject, IntoPy, PyAny, PyErr, PyObject, PyResult, Python, ToPyObject,
+};
+use std::{cmp, hash};
+
+impl<K, V, H> ToPyObject for hashbrown::HashMap<K, V, H>
+where
+    K: hash::Hash + cmp::Eq + ToPyObject,
+    V: ToPyObject,
+    H: hash::BuildHasher,
+{
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        IntoPyDict::into_py_dict_bound(self, py).into()
+    }
+}
+
+impl<K, V, H> IntoPy<PyObject> for hashbrown::HashMap<K, V, H>
+where
+    K: hash::Hash + cmp::Eq + IntoPy<PyObject>,
+    V: IntoPy<PyObject>,
+    H: hash::BuildHasher,
+{
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        let iter = self
+            .into_iter()
+            .map(|(k, v)| (k.into_py(py), v.into_py(py)));
+        IntoPyDict::into_py_dict_bound(iter, py).into()
+    }
+}
+
+impl<'py, K, V, S> FromPyObject<'py> for hashbrown::HashMap<K, V, S>
+where
+    K: FromPyObject<'py> + cmp::Eq + hash::Hash,
+    V: FromPyObject<'py>,
+    S: hash::BuildHasher + Default,
+{
+    fn extract_bound(ob: &Bound<'py, PyAny>) -> Result<Self, PyErr> {
+        let dict = ob.downcast::<PyDict>()?;
+        let mut ret = hashbrown::HashMap::with_capacity_and_hasher(dict.len(), S::default());
+        for (k, v) in dict {
+            ret.insert(k.extract()?, v.extract()?);
+        }
+        Ok(ret)
+    }
+}
+
+impl<T> ToPyObject for hashbrown::HashSet<T>
+where
+    T: hash::Hash + Eq + ToPyObject,
+{
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        new_from_iter(py, self)
+            .expect("Failed to create Python set from hashbrown::HashSet")
+            .into()
+    }
+}
+
+impl<K, S> IntoPy<PyObject> for hashbrown::HashSet<K, S>
+where
+    K: IntoPy<PyObject> + Eq + hash::Hash,
+    S: hash::BuildHasher + Default,
+{
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        new_from_iter(py, self.into_iter().map(|item| item.into_py(py)))
+            .expect("Failed to create Python set from hashbrown::HashSet")
+            .into()
+    }
+}
+
+impl<'py, K, S> FromPyObject<'py> for hashbrown::HashSet<K, S>
+where
+    K: FromPyObject<'py> + cmp::Eq + hash::Hash,
+    S: hash::BuildHasher + Default,
+{
+    fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self> {
+        match ob.downcast::<PySet>() {
+            Ok(set) => set.iter().map(|any| any.extract()).collect(),
+            Err(err) => {
+                if let Ok(frozen_set) = ob.downcast::<PyFrozenSet>() {
+                    frozen_set.iter().map(|any| any.extract()).collect()
+                } else {
+                    Err(PyErr::from(err))
+                }
+            }
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test_hashbrown_hashmap_to_python() {
+        Python::with_gil(|py| {
+            let mut map = hashbrown::HashMap::<i32, i32>::new();
+            map.insert(1, 1);
+
+            let m = map.to_object(py);
+            let py_map = m.downcast_bound::<PyDict>(py).unwrap();
+
+            assert!(py_map.len() == 1);
+            assert!(
+                py_map
+                    .get_item(1)
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap()
+                    == 1
+            );
+            assert_eq!(map, py_map.extract().unwrap());
+        });
+    }
+    #[test]
+    fn test_hashbrown_hashmap_into_python() {
+        Python::with_gil(|py| {
+            let mut map = hashbrown::HashMap::<i32, i32>::new();
+            map.insert(1, 1);
+
+            let m: PyObject = map.into_py(py);
+            let py_map = m.downcast_bound::<PyDict>(py).unwrap();
+
+            assert!(py_map.len() == 1);
+            assert!(
+                py_map
+                    .get_item(1)
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap()
+                    == 1
+            );
+        });
+    }
+
+    #[test]
+    fn test_hashbrown_hashmap_into_dict() {
+        Python::with_gil(|py| {
+            let mut map = hashbrown::HashMap::<i32, i32>::new();
+            map.insert(1, 1);
+
+            let py_map = map.into_py_dict_bound(py);
+
+            assert_eq!(py_map.len(), 1);
+            assert_eq!(
+                py_map
+                    .get_item(1)
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                1
+            );
+        });
+    }
+
+    #[test]
+    fn test_extract_hashbrown_hashset() {
+        Python::with_gil(|py| {
+            let set = PySet::new_bound(py, &[1, 2, 3, 4, 5]).unwrap();
+            let hash_set: hashbrown::HashSet<usize> = set.extract().unwrap();
+            assert_eq!(hash_set, [1, 2, 3, 4, 5].iter().copied().collect());
+
+            let set = PyFrozenSet::new_bound(py, &[1, 2, 3, 4, 5]).unwrap();
+            let hash_set: hashbrown::HashSet<usize> = set.extract().unwrap();
+            assert_eq!(hash_set, [1, 2, 3, 4, 5].iter().copied().collect());
+        });
+    }
+
+    #[test]
+    fn test_hashbrown_hashset_into_py() {
+        Python::with_gil(|py| {
+            let hs: hashbrown::HashSet<u64> = [1, 2, 3, 4, 5].iter().cloned().collect();
+
+            let hso: PyObject = hs.clone().into_py(py);
+
+            assert_eq!(hs, hso.extract(py).unwrap());
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/indexmap.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/indexmap.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/indexmap.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/indexmap.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,239 @@
+#![cfg(feature = "indexmap")]
+
+//!  Conversions to and from [indexmap](https://docs.rs/indexmap/)’s
+//! `IndexMap`.
+//!
+//! [`indexmap::IndexMap`] is a hash table that is closely compatible with the standard [`std::collections::HashMap`],
+//! with the difference that it preserves the insertion order when iterating over keys. It was inspired
+//! by Python's 3.6+ dict implementation.
+//!
+//! Dictionary order is guaranteed to be insertion order in Python, hence IndexMap is a good candidate
+//! for maintaining an equivalent behaviour in Rust.
+//!
+//! # Setup
+//!
+//! To use this feature, add this to your **`Cargo.toml`**:
+//!
+//! ```toml
+//! [dependencies]
+//! # change * to the latest versions
+//! indexmap = "*"
+#![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"),  "\", features = [\"indexmap\"] }")]
+//! ```
+//!
+//! Note that you must use compatible versions of indexmap and PyO3.
+//! The required indexmap version may vary based on the version of PyO3.
+//!
+//! # Examples
+//!
+//! Using [indexmap](https://docs.rs/indexmap) to return a dictionary with some statistics
+//! about a list of numbers. Because of the insertion order guarantees, the Python code will
+//! always print the same result, matching users' expectations about Python's dict.
+//! ```rust
+//! use indexmap::{indexmap, IndexMap};
+//! use pyo3::prelude::*;
+//!
+//! fn median(data: &Vec<i32>) -> f32 {
+//!     let sorted_data = data.clone().sort();
+//!     let mid = data.len() / 2;
+//!     if data.len() % 2 == 0 {
+//!         data[mid] as f32
+//!     }
+//!     else {
+//!         (data[mid] + data[mid - 1]) as f32 / 2.0
+//!     }
+//! }
+//!
+//! fn mean(data: &Vec<i32>) -> f32 {
+//!     data.iter().sum::<i32>() as f32 / data.len() as f32
+//! }
+//! fn mode(data: &Vec<i32>) -> f32 {
+//!     let mut frequency = IndexMap::new(); // we can use IndexMap as any hash table
+//!
+//!     for &element in data {
+//!         *frequency.entry(element).or_insert(0) += 1;
+//!     }
+//!
+//!     frequency
+//!         .iter()
+//!         .max_by(|a, b| a.1.cmp(&b.1))
+//!         .map(|(k, _v)| *k)
+//!         .unwrap() as f32
+//!   }
+//!
+//! #[pyfunction]
+//! fn calculate_statistics(data: Vec<i32>) -> IndexMap<&'static str, f32> {
+//!     indexmap! {
+//!        "median" => median(&data),
+//!        "mean" => mean(&data),
+//!        "mode" => mode(&data),
+//!     }
+//! }
+//!
+//! #[pymodule]
+//! fn my_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
+//!     m.add_function(wrap_pyfunction!(calculate_statistics, m)?)?;
+//!     Ok(())
+//! }
+//! ```
+//!
+//! Python code:
+//! ```python
+//! from my_module import calculate_statistics
+//!
+//! data = [1, 1, 1, 3, 4, 5]
+//! print(calculate_statistics(data))
+//! # always prints {"median": 2.0, "mean": 2.5, "mode": 1.0} in the same order
+//! # if another hash table was used, the order could be random
+//! ```
+
+use crate::types::*;
+use crate::{Bound, FromPyObject, IntoPy, PyErr, PyObject, Python, ToPyObject};
+use std::{cmp, hash};
+
+impl<K, V, H> ToPyObject for indexmap::IndexMap<K, V, H>
+where
+    K: hash::Hash + cmp::Eq + ToPyObject,
+    V: ToPyObject,
+    H: hash::BuildHasher,
+{
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        IntoPyDict::into_py_dict_bound(self, py).into()
+    }
+}
+
+impl<K, V, H> IntoPy<PyObject> for indexmap::IndexMap<K, V, H>
+where
+    K: hash::Hash + cmp::Eq + IntoPy<PyObject>,
+    V: IntoPy<PyObject>,
+    H: hash::BuildHasher,
+{
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        let iter = self
+            .into_iter()
+            .map(|(k, v)| (k.into_py(py), v.into_py(py)));
+        IntoPyDict::into_py_dict_bound(iter, py).into()
+    }
+}
+
+impl<'py, K, V, S> FromPyObject<'py> for indexmap::IndexMap<K, V, S>
+where
+    K: FromPyObject<'py> + cmp::Eq + hash::Hash,
+    V: FromPyObject<'py>,
+    S: hash::BuildHasher + Default,
+{
+    fn extract_bound(ob: &Bound<'py, PyAny>) -> Result<Self, PyErr> {
+        let dict = ob.downcast::<PyDict>()?;
+        let mut ret = indexmap::IndexMap::with_capacity_and_hasher(dict.len(), S::default());
+        for (k, v) in dict {
+            ret.insert(k.extract()?, v.extract()?);
+        }
+        Ok(ret)
+    }
+}
+
+#[cfg(test)]
+mod test_indexmap {
+
+    use crate::types::*;
+    use crate::{IntoPy, PyObject, Python, ToPyObject};
+
+    #[test]
+    fn test_indexmap_indexmap_to_python() {
+        Python::with_gil(|py| {
+            let mut map = indexmap::IndexMap::<i32, i32>::new();
+            map.insert(1, 1);
+
+            let m = map.to_object(py);
+            let py_map = m.downcast_bound::<PyDict>(py).unwrap();
+
+            assert!(py_map.len() == 1);
+            assert!(
+                py_map
+                    .get_item(1)
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap()
+                    == 1
+            );
+            assert_eq!(
+                map,
+                py_map.extract::<indexmap::IndexMap::<i32, i32>>().unwrap()
+            );
+        });
+    }
+
+    #[test]
+    fn test_indexmap_indexmap_into_python() {
+        Python::with_gil(|py| {
+            let mut map = indexmap::IndexMap::<i32, i32>::new();
+            map.insert(1, 1);
+
+            let m: PyObject = map.into_py(py);
+            let py_map = m.downcast_bound::<PyDict>(py).unwrap();
+
+            assert!(py_map.len() == 1);
+            assert!(
+                py_map
+                    .get_item(1)
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap()
+                    == 1
+            );
+        });
+    }
+
+    #[test]
+    fn test_indexmap_indexmap_into_dict() {
+        Python::with_gil(|py| {
+            let mut map = indexmap::IndexMap::<i32, i32>::new();
+            map.insert(1, 1);
+
+            let py_map = map.into_py_dict_bound(py);
+
+            assert_eq!(py_map.len(), 1);
+            assert_eq!(
+                py_map
+                    .get_item(1)
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                1
+            );
+        });
+    }
+
+    #[test]
+    fn test_indexmap_indexmap_insertion_order_round_trip() {
+        Python::with_gil(|py| {
+            let n = 20;
+            let mut map = indexmap::IndexMap::<i32, i32>::new();
+
+            for i in 1..=n {
+                if i % 2 == 1 {
+                    map.insert(i, i);
+                } else {
+                    map.insert(n - i, i);
+                }
+            }
+
+            let py_map = map.clone().into_py_dict_bound(py);
+
+            let trip_map = py_map.extract::<indexmap::IndexMap<i32, i32>>().unwrap();
+
+            for (((k1, v1), (k2, v2)), (k3, v3)) in
+                map.iter().zip(py_map.iter()).zip(trip_map.iter())
+            {
+                let k2 = k2.extract::<i32>().unwrap();
+                let v2 = v2.extract::<i32>().unwrap();
+                assert_eq!((k1, v1), (&k2, &v2));
+                assert_eq!((k1, v1), (k3, v3));
+                assert_eq!((&k2, &v2), (k3, v3));
+            }
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/mod.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/mod.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,16 @@
+//! This module contains conversions between various Rust object and their representation in Python.
+
+pub mod anyhow;
+pub mod chrono;
+pub mod chrono_tz;
+pub mod either;
+pub mod eyre;
+pub mod hashbrown;
+pub mod indexmap;
+pub mod num_bigint;
+pub mod num_complex;
+pub mod num_rational;
+pub mod rust_decimal;
+pub mod serde;
+pub mod smallvec;
+mod std;
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/num_bigint.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/num_bigint.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/num_bigint.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/num_bigint.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,463 @@
+#![cfg(feature = "num-bigint")]
+//!  Conversions to and from [num-bigint](https://docs.rs/num-bigint)’s [`BigInt`] and [`BigUint`] types.
+//!
+//! This is useful for converting Python integers when they may not fit in Rust's built-in integer types.
+//!
+//! # Setup
+//!
+//! To use this feature, add this to your **`Cargo.toml`**:
+//!
+//! ```toml
+//! [dependencies]
+//! num-bigint = "*"
+#![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"),  "\", features = [\"num-bigint\"] }")]
+//! ```
+//!
+//! Note that you must use compatible versions of num-bigint and PyO3.
+//! The required num-bigint version may vary based on the version of PyO3.
+//!
+//! ## Examples
+//!
+//! Using [`BigInt`] to correctly increment an arbitrary precision integer.
+//! This is not possible with Rust's native integers if the Python integer is too large,
+//! in which case it will fail its conversion and raise `OverflowError`.
+//! ```rust
+//! use num_bigint::BigInt;
+//! use pyo3::prelude::*;
+//!
+//! #[pyfunction]
+//! fn add_one(n: BigInt) -> BigInt {
+//!     n + 1
+//! }
+//!
+//! #[pymodule]
+//! fn my_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
+//!     m.add_function(wrap_pyfunction!(add_one, m)?)?;
+//!     Ok(())
+//! }
+//! ```
+//!
+//! Python code:
+//! ```python
+//! from my_module import add_one
+//!
+//! n = 1 << 1337
+//! value = add_one(n)
+//!
+//! assert n + 1 == value
+//! ```
+
+#[cfg(not(Py_LIMITED_API))]
+use crate::ffi_ptr_ext::FfiPtrExt;
+#[cfg(Py_LIMITED_API)]
+use crate::types::{bytes::PyBytesMethods, PyBytes};
+use crate::{
+    ffi,
+    instance::Bound,
+    types::{any::PyAnyMethods, PyLong},
+    FromPyObject, IntoPy, Py, PyAny, PyObject, PyResult, Python, ToPyObject,
+};
+
+use num_bigint::{BigInt, BigUint};
+
+#[cfg(not(Py_LIMITED_API))]
+use num_bigint::Sign;
+
+// for identical functionality between BigInt and BigUint
+macro_rules! bigint_conversion {
+    ($rust_ty: ty, $is_signed: literal, $to_bytes: path) => {
+        #[cfg_attr(docsrs, doc(cfg(feature = "num-bigint")))]
+        impl ToPyObject for $rust_ty {
+            #[cfg(not(Py_LIMITED_API))]
+            fn to_object(&self, py: Python<'_>) -> PyObject {
+                let bytes = $to_bytes(self);
+                #[cfg(not(Py_3_13))]
+                {
+                    unsafe {
+                        ffi::_PyLong_FromByteArray(
+                            bytes.as_ptr().cast(),
+                            bytes.len(),
+                            1,
+                            $is_signed.into(),
+                        )
+                        .assume_owned(py)
+                        .unbind()
+                    }
+                }
+                #[cfg(Py_3_13)]
+                {
+                    if $is_signed {
+                        unsafe {
+                            ffi::PyLong_FromNativeBytes(
+                                bytes.as_ptr().cast(),
+                                bytes.len(),
+                                ffi::Py_ASNATIVEBYTES_LITTLE_ENDIAN,
+                            )
+                            .assume_owned(py)
+                        }
+                    } else {
+                        unsafe {
+                            ffi::PyLong_FromUnsignedNativeBytes(
+                                bytes.as_ptr().cast(),
+                                bytes.len(),
+                                ffi::Py_ASNATIVEBYTES_LITTLE_ENDIAN,
+                            )
+                            .assume_owned(py)
+                        }
+                    }
+                    .unbind()
+                }
+            }
+
+            #[cfg(Py_LIMITED_API)]
+            fn to_object(&self, py: Python<'_>) -> PyObject {
+                let bytes = $to_bytes(self);
+                let bytes_obj = PyBytes::new_bound(py, &bytes);
+                let kwargs = if $is_signed {
+                    let kwargs = crate::types::PyDict::new_bound(py);
+                    kwargs.set_item(crate::intern!(py, "signed"), true).unwrap();
+                    Some(kwargs)
+                } else {
+                    None
+                };
+                py.get_type_bound::<PyLong>()
+                    .call_method("from_bytes", (bytes_obj, "little"), kwargs.as_ref())
+                    .expect("int.from_bytes() failed during to_object()") // FIXME: #1813 or similar
+                    .into()
+            }
+        }
+
+        #[cfg_attr(docsrs, doc(cfg(feature = "num-bigint")))]
+        impl IntoPy<PyObject> for $rust_ty {
+            fn into_py(self, py: Python<'_>) -> PyObject {
+                self.to_object(py)
+            }
+        }
+    };
+}
+
+bigint_conversion!(BigUint, false, BigUint::to_bytes_le);
+bigint_conversion!(BigInt, true, BigInt::to_signed_bytes_le);
+
+#[cfg_attr(docsrs, doc(cfg(feature = "num-bigint")))]
+impl<'py> FromPyObject<'py> for BigInt {
+    fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<BigInt> {
+        let py = ob.py();
+        // fast path - checking for subclass of `int` just checks a bit in the type object
+        let num_owned: Py<PyLong>;
+        let num = if let Ok(long) = ob.downcast::<PyLong>() {
+            long
+        } else {
+            num_owned = unsafe { Py::from_owned_ptr_or_err(py, ffi::PyNumber_Index(ob.as_ptr()))? };
+            num_owned.bind(py)
+        };
+        #[cfg(not(Py_LIMITED_API))]
+        {
+            let mut buffer = int_to_u32_vec::<true>(num)?;
+            let sign = if buffer.last().copied().map_or(false, |last| last >> 31 != 0) {
+                // BigInt::new takes an unsigned array, so need to convert from two's complement
+                // flip all bits, 'subtract' 1 (by adding one to the unsigned array)
+                let mut elements = buffer.iter_mut();
+                for element in elements.by_ref() {
+                    *element = (!*element).wrapping_add(1);
+                    if *element != 0 {
+                        // if the element didn't wrap over, no need to keep adding further ...
+                        break;
+                    }
+                }
+                // ... so just two's complement the rest
+                for element in elements {
+                    *element = !*element;
+                }
+                Sign::Minus
+            } else {
+                Sign::Plus
+            };
+            Ok(BigInt::new(sign, buffer))
+        }
+        #[cfg(Py_LIMITED_API)]
+        {
+            let n_bits = int_n_bits(num)?;
+            if n_bits == 0 {
+                return Ok(BigInt::from(0isize));
+            }
+            let bytes = int_to_py_bytes(num, (n_bits + 8) / 8, true)?;
+            Ok(BigInt::from_signed_bytes_le(bytes.as_bytes()))
+        }
+    }
+}
+
+#[cfg_attr(docsrs, doc(cfg(feature = "num-bigint")))]
+impl<'py> FromPyObject<'py> for BigUint {
+    fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<BigUint> {
+        let py = ob.py();
+        // fast path - checking for subclass of `int` just checks a bit in the type object
+        let num_owned: Py<PyLong>;
+        let num = if let Ok(long) = ob.downcast::<PyLong>() {
+            long
+        } else {
+            num_owned = unsafe { Py::from_owned_ptr_or_err(py, ffi::PyNumber_Index(ob.as_ptr()))? };
+            num_owned.bind(py)
+        };
+        #[cfg(not(Py_LIMITED_API))]
+        {
+            let buffer = int_to_u32_vec::<false>(num)?;
+            Ok(BigUint::new(buffer))
+        }
+        #[cfg(Py_LIMITED_API)]
+        {
+            let n_bits = int_n_bits(num)?;
+            if n_bits == 0 {
+                return Ok(BigUint::from(0usize));
+            }
+            let bytes = int_to_py_bytes(num, (n_bits + 7) / 8, false)?;
+            Ok(BigUint::from_bytes_le(bytes.as_bytes()))
+        }
+    }
+}
+
+#[cfg(not(any(Py_LIMITED_API, Py_3_13)))]
+#[inline]
+fn int_to_u32_vec<const SIGNED: bool>(long: &Bound<'_, PyLong>) -> PyResult<Vec<u32>> {
+    let mut buffer = Vec::new();
+    let n_bits = int_n_bits(long)?;
+    if n_bits == 0 {
+        return Ok(buffer);
+    }
+    let n_digits = if SIGNED {
+        (n_bits + 32) / 32
+    } else {
+        (n_bits + 31) / 32
+    };
+    buffer.reserve_exact(n_digits);
+    unsafe {
+        crate::err::error_on_minusone(
+            long.py(),
+            ffi::_PyLong_AsByteArray(
+                long.as_ptr().cast(),
+                buffer.as_mut_ptr() as *mut u8,
+                n_digits * 4,
+                1,
+                SIGNED.into(),
+            ),
+        )?;
+        buffer.set_len(n_digits)
+    };
+    buffer
+        .iter_mut()
+        .for_each(|chunk| *chunk = u32::from_le(*chunk));
+
+    Ok(buffer)
+}
+
+#[cfg(all(not(Py_LIMITED_API), Py_3_13))]
+#[inline]
+fn int_to_u32_vec<const SIGNED: bool>(long: &Bound<'_, PyLong>) -> PyResult<Vec<u32>> {
+    let mut buffer = Vec::new();
+    let mut flags = ffi::Py_ASNATIVEBYTES_LITTLE_ENDIAN;
+    if !SIGNED {
+        flags |= ffi::Py_ASNATIVEBYTES_UNSIGNED_BUFFER | ffi::Py_ASNATIVEBYTES_REJECT_NEGATIVE;
+    }
+    let n_bytes =
+        unsafe { ffi::PyLong_AsNativeBytes(long.as_ptr().cast(), std::ptr::null_mut(), 0, flags) };
+    let n_bytes_unsigned: usize = n_bytes
+        .try_into()
+        .map_err(|_| crate::PyErr::fetch(long.py()))?;
+    if n_bytes == 0 {
+        return Ok(buffer);
+    }
+    // TODO: use div_ceil when MSRV >= 1.73
+    let n_digits = {
+        let adjust = if n_bytes % 4 == 0 { 0 } else { 1 };
+        (n_bytes_unsigned / 4) + adjust
+    };
+    buffer.reserve_exact(n_digits);
+    unsafe {
+        ffi::PyLong_AsNativeBytes(
+            long.as_ptr().cast(),
+            buffer.as_mut_ptr().cast(),
+            (n_digits * 4).try_into().unwrap(),
+            flags,
+        );
+        buffer.set_len(n_digits);
+    };
+    buffer
+        .iter_mut()
+        .for_each(|chunk| *chunk = u32::from_le(*chunk));
+
+    Ok(buffer)
+}
+
+#[cfg(Py_LIMITED_API)]
+fn int_to_py_bytes<'py>(
+    long: &Bound<'py, PyLong>,
+    n_bytes: usize,
+    is_signed: bool,
+) -> PyResult<Bound<'py, PyBytes>> {
+    use crate::intern;
+    let py = long.py();
+    let kwargs = if is_signed {
+        let kwargs = crate::types::PyDict::new_bound(py);
+        kwargs.set_item(intern!(py, "signed"), true)?;
+        Some(kwargs)
+    } else {
+        None
+    };
+    let bytes = long.call_method(
+        intern!(py, "to_bytes"),
+        (n_bytes, intern!(py, "little")),
+        kwargs.as_ref(),
+    )?;
+    Ok(bytes.downcast_into()?)
+}
+
+#[inline]
+#[cfg(any(not(Py_3_13), Py_LIMITED_API))]
+fn int_n_bits(long: &Bound<'_, PyLong>) -> PyResult<usize> {
+    let py = long.py();
+    #[cfg(not(Py_LIMITED_API))]
+    {
+        // fast path
+        let n_bits = unsafe { ffi::_PyLong_NumBits(long.as_ptr()) };
+        if n_bits == (-1isize as usize) {
+            return Err(crate::PyErr::fetch(py));
+        }
+        Ok(n_bits)
+    }
+
+    #[cfg(Py_LIMITED_API)]
+    {
+        // slow path
+        long.call_method0(crate::intern!(py, "bit_length"))
+            .and_then(|any| any.extract())
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::types::{PyDict, PyModule};
+    use indoc::indoc;
+
+    fn rust_fib<T>() -> impl Iterator<Item = T>
+    where
+        T: From<u16>,
+        for<'a> &'a T: std::ops::Add<Output = T>,
+    {
+        let mut f0: T = T::from(1);
+        let mut f1: T = T::from(1);
+        std::iter::from_fn(move || {
+            let f2 = &f0 + &f1;
+            Some(std::mem::replace(&mut f0, std::mem::replace(&mut f1, f2)))
+        })
+    }
+
+    fn python_fib(py: Python<'_>) -> impl Iterator<Item = PyObject> + '_ {
+        let mut f0 = 1.to_object(py);
+        let mut f1 = 1.to_object(py);
+        std::iter::from_fn(move || {
+            let f2 = f0.call_method1(py, "__add__", (f1.bind(py),)).unwrap();
+            Some(std::mem::replace(&mut f0, std::mem::replace(&mut f1, f2)))
+        })
+    }
+
+    #[test]
+    fn convert_biguint() {
+        Python::with_gil(|py| {
+            // check the first 2000 numbers in the fibonacci sequence
+            for (py_result, rs_result) in python_fib(py).zip(rust_fib::<BigUint>()).take(2000) {
+                // Python -> Rust
+                assert_eq!(py_result.extract::<BigUint>(py).unwrap(), rs_result);
+                // Rust -> Python
+                assert!(py_result.bind(py).eq(rs_result).unwrap());
+            }
+        });
+    }
+
+    #[test]
+    fn convert_bigint() {
+        Python::with_gil(|py| {
+            // check the first 2000 numbers in the fibonacci sequence
+            for (py_result, rs_result) in python_fib(py).zip(rust_fib::<BigInt>()).take(2000) {
+                // Python -> Rust
+                assert_eq!(py_result.extract::<BigInt>(py).unwrap(), rs_result);
+                // Rust -> Python
+                assert!(py_result.bind(py).eq(&rs_result).unwrap());
+
+                // negate
+
+                let rs_result = rs_result * -1;
+                let py_result = py_result.call_method0(py, "__neg__").unwrap();
+
+                // Python -> Rust
+                assert_eq!(py_result.extract::<BigInt>(py).unwrap(), rs_result);
+                // Rust -> Python
+                assert!(py_result.bind(py).eq(rs_result).unwrap());
+            }
+        });
+    }
+
+    fn python_index_class(py: Python<'_>) -> Bound<'_, PyModule> {
+        let index_code = indoc!(
+            r#"
+                class C:
+                    def __init__(self, x):
+                        self.x = x
+                    def __index__(self):
+                        return self.x
+                "#
+        );
+        PyModule::from_code_bound(py, index_code, "index.py", "index").unwrap()
+    }
+
+    #[test]
+    fn convert_index_class() {
+        Python::with_gil(|py| {
+            let index = python_index_class(py);
+            let locals = PyDict::new_bound(py);
+            locals.set_item("index", index).unwrap();
+            let ob = py.eval_bound("index.C(10)", None, Some(&locals)).unwrap();
+            let _: BigInt = ob.extract().unwrap();
+        });
+    }
+
+    #[test]
+    fn handle_zero() {
+        Python::with_gil(|py| {
+            let zero: BigInt = 0.to_object(py).extract(py).unwrap();
+            assert_eq!(zero, BigInt::from(0));
+        })
+    }
+
+    /// `OverflowError` on converting Python int to BigInt, see issue #629
+    #[test]
+    fn check_overflow() {
+        Python::with_gil(|py| {
+            macro_rules! test {
+                ($T:ty, $value:expr, $py:expr) => {
+                    let value = $value;
+                    println!("{}: {}", stringify!($T), value);
+                    let python_value = value.clone().into_py(py);
+                    let roundtrip_value = python_value.extract::<$T>(py).unwrap();
+                    assert_eq!(value, roundtrip_value);
+                };
+            }
+
+            for i in 0..=256usize {
+                // test a lot of values to help catch other bugs too
+                test!(BigInt, BigInt::from(i), py);
+                test!(BigUint, BigUint::from(i), py);
+                test!(BigInt, -BigInt::from(i), py);
+                test!(BigInt, BigInt::from(1) << i, py);
+                test!(BigUint, BigUint::from(1u32) << i, py);
+                test!(BigInt, -BigInt::from(1) << i, py);
+                test!(BigInt, (BigInt::from(1) << i) + 1u32, py);
+                test!(BigUint, (BigUint::from(1u32) << i) + 1u32, py);
+                test!(BigInt, (-BigInt::from(1) << i) + 1u32, py);
+                test!(BigInt, (BigInt::from(1) << i) - 1u32, py);
+                test!(BigUint, (BigUint::from(1u32) << i) - 1u32, py);
+                test!(BigInt, (-BigInt::from(1) << i) - 1u32, py);
+            }
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/num_complex.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/num_complex.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/num_complex.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/num_complex.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,353 @@
+#![cfg(feature = "num-complex")]
+
+//!  Conversions to and from [num-complex](https://docs.rs/num-complex)’
+//! [`Complex`]`<`[`f32`]`>` and [`Complex`]`<`[`f64`]`>`.
+//!
+//! num-complex’ [`Complex`] supports more operations than PyO3's [`PyComplex`]
+//! and can be used with the rest of the Rust ecosystem.
+//!
+//! # Setup
+//!
+//! To use this feature, add this to your **`Cargo.toml`**:
+//!
+//! ```toml
+//! [dependencies]
+//! # change * to the latest versions
+//! num-complex = "*"
+#![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"),  "\", features = [\"num-complex\"] }")]
+//! ```
+//!
+//! Note that you must use compatible versions of num-complex and PyO3.
+//! The required num-complex version may vary based on the version of PyO3.
+//!
+//! # Examples
+//!
+//! Using [num-complex](https://docs.rs/num-complex) and [nalgebra](https://docs.rs/nalgebra)
+//! to create a pyfunction that calculates the eigenvalues of a 2x2 matrix.
+//! ```ignore
+//! # // not tested because nalgebra isn't supported on msrv
+//! # // please file an issue if it breaks!
+//! use nalgebra::base::{dimension::Const, Matrix};
+//! use num_complex::Complex;
+//! use pyo3::prelude::*;
+//!
+//! type T = Complex<f64>;
+//!
+//! #[pyfunction]
+//! fn get_eigenvalues(m11: T, m12: T, m21: T, m22: T) -> Vec<T> {
+//!     let mat = Matrix::<T, Const<2>, Const<2>, _>::new(m11, m12, m21, m22);
+//!
+//!     match mat.eigenvalues() {
+//!         Some(e) => e.data.as_slice().to_vec(),
+//!         None => vec![],
+//!     }
+//! }
+//!
+//! #[pymodule]
+//! fn my_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
+//!     m.add_function(wrap_pyfunction!(get_eigenvalues, m)?)?;
+//!     Ok(())
+//! }
+//! # // test
+//! # use assert_approx_eq::assert_approx_eq;
+//! # use nalgebra::ComplexField;
+//! # use pyo3::types::PyComplex;
+//! #
+//! # fn main() -> PyResult<()> {
+//! #     Python::with_gil(|py| -> PyResult<()> {
+//! #         let module = PyModule::new_bound(py, "my_module")?;
+//! #
+//! #         module.add_function(&wrap_pyfunction!(get_eigenvalues, module)?)?;
+//! #
+//! #         let m11 = PyComplex::from_doubles_bound(py, 0_f64, -1_f64);
+//! #         let m12 = PyComplex::from_doubles_bound(py, 1_f64, 0_f64);
+//! #         let m21 = PyComplex::from_doubles_bound(py, 2_f64, -1_f64);
+//! #         let m22 = PyComplex::from_doubles_bound(py, -1_f64, 0_f64);
+//! #
+//! #         let result = module
+//! #             .getattr("get_eigenvalues")?
+//! #             .call1((m11, m12, m21, m22))?;
+//! #         println!("eigenvalues: {:?}", result);
+//! #
+//! #         let result = result.extract::<Vec<T>>()?;
+//! #         let e0 = result[0];
+//! #         let e1 = result[1];
+//! #
+//! #         assert_approx_eq!(e0, Complex::new(1_f64, -1_f64));
+//! #         assert_approx_eq!(e1, Complex::new(-2_f64, 0_f64));
+//! #
+//! #         Ok(())
+//! #     })
+//! # }
+//! ```
+//!
+//! Python code:
+//! ```python
+//! from my_module import get_eigenvalues
+//!
+//! m11 = complex(0,-1)
+//! m12 = complex(1,0)
+//! m21 = complex(2,-1)
+//! m22 = complex(-1,0)
+//!
+//! result = get_eigenvalues(m11,m12,m21,m22)
+//! assert result == [complex(1,-1), complex(-2,0)]
+//! ```
+use crate::{
+    ffi,
+    ffi_ptr_ext::FfiPtrExt,
+    types::{any::PyAnyMethods, PyComplex},
+    Bound, FromPyObject, PyAny, PyErr, PyObject, PyResult, Python, ToPyObject,
+};
+use num_complex::Complex;
+use std::os::raw::c_double;
+
+impl PyComplex {
+    /// Deprecated form of [`PyComplex::from_complex_bound`]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyComplex::from_complex` will be replaced by `PyComplex::from_complex_bound` in a future PyO3 version"
+    )]
+    pub fn from_complex<F: Into<c_double>>(py: Python<'_>, complex: Complex<F>) -> &PyComplex {
+        Self::from_complex_bound(py, complex).into_gil_ref()
+    }
+
+    /// Creates a new Python `PyComplex` object from `num_complex`'s [`Complex`].
+    pub fn from_complex_bound<F: Into<c_double>>(
+        py: Python<'_>,
+        complex: Complex<F>,
+    ) -> Bound<'_, PyComplex> {
+        unsafe {
+            ffi::PyComplex_FromDoubles(complex.re.into(), complex.im.into())
+                .assume_owned(py)
+                .downcast_into_unchecked()
+        }
+    }
+}
+
+macro_rules! complex_conversion {
+    ($float: ty) => {
+        #[cfg_attr(docsrs, doc(cfg(feature = "num-complex")))]
+        impl ToPyObject for Complex<$float> {
+            #[inline]
+            fn to_object(&self, py: Python<'_>) -> PyObject {
+                crate::IntoPy::<PyObject>::into_py(self.to_owned(), py)
+            }
+        }
+
+        #[cfg_attr(docsrs, doc(cfg(feature = "num-complex")))]
+        impl crate::IntoPy<PyObject> for Complex<$float> {
+            fn into_py(self, py: Python<'_>) -> PyObject {
+                unsafe {
+                    let raw_obj =
+                        ffi::PyComplex_FromDoubles(self.re as c_double, self.im as c_double);
+                    PyObject::from_owned_ptr(py, raw_obj)
+                }
+            }
+        }
+
+        #[cfg_attr(docsrs, doc(cfg(feature = "num-complex")))]
+        impl FromPyObject<'_> for Complex<$float> {
+            fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Complex<$float>> {
+                #[cfg(not(any(Py_LIMITED_API, PyPy)))]
+                unsafe {
+                    let val = ffi::PyComplex_AsCComplex(obj.as_ptr());
+                    if val.real == -1.0 {
+                        if let Some(err) = PyErr::take(obj.py()) {
+                            return Err(err);
+                        }
+                    }
+                    Ok(Complex::new(val.real as $float, val.imag as $float))
+                }
+
+                #[cfg(any(Py_LIMITED_API, PyPy))]
+                unsafe {
+                    let complex;
+                    let obj = if obj.is_instance_of::<PyComplex>() {
+                        obj
+                    } else if let Some(method) =
+                        obj.lookup_special(crate::intern!(obj.py(), "__complex__"))?
+                    {
+                        complex = method.call0()?;
+                        &complex
+                    } else {
+                        // `obj` might still implement `__float__` or `__index__`, which will be
+                        // handled by `PyComplex_{Real,Imag}AsDouble`, including propagating any
+                        // errors if those methods don't exist / raise exceptions.
+                        obj
+                    };
+                    let ptr = obj.as_ptr();
+                    let real = ffi::PyComplex_RealAsDouble(ptr);
+                    if real == -1.0 {
+                        if let Some(err) = PyErr::take(obj.py()) {
+                            return Err(err);
+                        }
+                    }
+                    let imag = ffi::PyComplex_ImagAsDouble(ptr);
+                    Ok(Complex::new(real as $float, imag as $float))
+                }
+            }
+        }
+    };
+}
+complex_conversion!(f32);
+complex_conversion!(f64);
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::types::{complex::PyComplexMethods, PyModule};
+
+    #[test]
+    fn from_complex() {
+        Python::with_gil(|py| {
+            let complex = Complex::new(3.0, 1.2);
+            let py_c = PyComplex::from_complex_bound(py, complex);
+            assert_eq!(py_c.real(), 3.0);
+            assert_eq!(py_c.imag(), 1.2);
+        });
+    }
+    #[test]
+    fn to_from_complex() {
+        Python::with_gil(|py| {
+            let val = Complex::new(3.0, 1.2);
+            let obj = val.to_object(py);
+            assert_eq!(obj.extract::<Complex<f64>>(py).unwrap(), val);
+        });
+    }
+    #[test]
+    fn from_complex_err() {
+        Python::with_gil(|py| {
+            let obj = vec![1].to_object(py);
+            assert!(obj.extract::<Complex<f64>>(py).is_err());
+        });
+    }
+    #[test]
+    fn from_python_magic() {
+        Python::with_gil(|py| {
+            let module = PyModule::from_code_bound(
+                py,
+                r#"
+class A:
+    def __complex__(self): return 3.0+1.2j
+class B:
+    def __float__(self): return 3.0
+class C:
+    def __index__(self): return 3
+                "#,
+                "test.py",
+                "test",
+            )
+            .unwrap();
+            let from_complex = module.getattr("A").unwrap().call0().unwrap();
+            assert_eq!(
+                from_complex.extract::<Complex<f64>>().unwrap(),
+                Complex::new(3.0, 1.2)
+            );
+            let from_float = module.getattr("B").unwrap().call0().unwrap();
+            assert_eq!(
+                from_float.extract::<Complex<f64>>().unwrap(),
+                Complex::new(3.0, 0.0)
+            );
+            // Before Python 3.8, `__index__` wasn't tried by `float`/`complex`.
+            #[cfg(Py_3_8)]
+            {
+                let from_index = module.getattr("C").unwrap().call0().unwrap();
+                assert_eq!(
+                    from_index.extract::<Complex<f64>>().unwrap(),
+                    Complex::new(3.0, 0.0)
+                );
+            }
+        })
+    }
+    #[test]
+    fn from_python_inherited_magic() {
+        Python::with_gil(|py| {
+            let module = PyModule::from_code_bound(
+                py,
+                r#"
+class First: pass
+class ComplexMixin:
+    def __complex__(self): return 3.0+1.2j
+class FloatMixin:
+    def __float__(self): return 3.0
+class IndexMixin:
+    def __index__(self): return 3
+class A(First, ComplexMixin): pass
+class B(First, FloatMixin): pass
+class C(First, IndexMixin): pass
+                "#,
+                "test.py",
+                "test",
+            )
+            .unwrap();
+            let from_complex = module.getattr("A").unwrap().call0().unwrap();
+            assert_eq!(
+                from_complex.extract::<Complex<f64>>().unwrap(),
+                Complex::new(3.0, 1.2)
+            );
+            let from_float = module.getattr("B").unwrap().call0().unwrap();
+            assert_eq!(
+                from_float.extract::<Complex<f64>>().unwrap(),
+                Complex::new(3.0, 0.0)
+            );
+            #[cfg(Py_3_8)]
+            {
+                let from_index = module.getattr("C").unwrap().call0().unwrap();
+                assert_eq!(
+                    from_index.extract::<Complex<f64>>().unwrap(),
+                    Complex::new(3.0, 0.0)
+                );
+            }
+        })
+    }
+    #[test]
+    fn from_python_noncallable_descriptor_magic() {
+        // Functions and lambdas implement the descriptor protocol in a way that makes
+        // `type(inst).attr(inst)` equivalent to `inst.attr()` for methods, but this isn't the only
+        // way the descriptor protocol might be implemented.
+        Python::with_gil(|py| {
+            let module = PyModule::from_code_bound(
+                py,
+                r#"
+class A:
+    @property
+    def __complex__(self):
+        return lambda: 3.0+1.2j
+                "#,
+                "test.py",
+                "test",
+            )
+            .unwrap();
+            let obj = module.getattr("A").unwrap().call0().unwrap();
+            assert_eq!(
+                obj.extract::<Complex<f64>>().unwrap(),
+                Complex::new(3.0, 1.2)
+            );
+        })
+    }
+    #[test]
+    fn from_python_nondescriptor_magic() {
+        // Magic methods don't need to implement the descriptor protocol, if they're callable.
+        Python::with_gil(|py| {
+            let module = PyModule::from_code_bound(
+                py,
+                r#"
+class MyComplex:
+    def __call__(self): return 3.0+1.2j
+class A:
+    __complex__ = MyComplex()
+                "#,
+                "test.py",
+                "test",
+            )
+            .unwrap();
+            let obj = module.getattr("A").unwrap().call0().unwrap();
+            assert_eq!(
+                obj.extract::<Complex<f64>>().unwrap(),
+                Complex::new(3.0, 1.2)
+            );
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/num_rational.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/num_rational.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/num_rational.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/num_rational.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,257 @@
+#![cfg(feature = "num-rational")]
+//! Conversions to and from [num-rational](https://docs.rs/num-rational) types.
+//!
+//! This is useful for converting between Python's [fractions.Fraction](https://docs.python.org/3/library/fractions.html) into and from a native Rust
+//! type.
+//!
+//!
+//! To use this feature, add to your **`Cargo.toml`**:
+//!
+//! ```toml
+//! [dependencies]
+#![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"),  "\", features = [\"num-rational\"] }")]
+//! num-rational = "0.4.1"
+//! ```
+//!
+//! # Example
+//!
+//! Rust code to create a function that adds five to a fraction:
+//!
+//! ```rust
+//! use num_rational::Ratio;
+//! use pyo3::prelude::*;
+//!
+//! #[pyfunction]
+//! fn add_five_to_fraction(fraction: Ratio<i32>) -> Ratio<i32> {
+//!     fraction + Ratio::new(5, 1)
+//! }
+//!
+//! #[pymodule]
+//! fn my_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
+//!     m.add_function(wrap_pyfunction!(add_five_to_fraction, m)?)?;
+//!     Ok(())
+//! }
+//! ```
+//!
+//! Python code that validates the functionality:
+//! ```python
+//! from my_module import add_five_to_fraction
+//! from fractions import Fraction
+//!
+//! fraction = Fraction(2,1)
+//! fraction_plus_five = add_five_to_fraction(f)
+//! assert fraction + 5 == fraction_plus_five
+//! ```
+
+use crate::ffi;
+use crate::sync::GILOnceCell;
+use crate::types::any::PyAnyMethods;
+use crate::types::PyType;
+use crate::{Bound, FromPyObject, IntoPy, Py, PyAny, PyObject, PyResult, Python, ToPyObject};
+
+#[cfg(feature = "num-bigint")]
+use num_bigint::BigInt;
+use num_rational::Ratio;
+
+static FRACTION_CLS: GILOnceCell<Py<PyType>> = GILOnceCell::new();
+
+fn get_fraction_cls(py: Python<'_>) -> PyResult<&Bound<'_, PyType>> {
+    FRACTION_CLS.get_or_try_init_type_ref(py, "fractions", "Fraction")
+}
+
+macro_rules! rational_conversion {
+    ($int: ty) => {
+        impl<'py> FromPyObject<'py> for Ratio<$int> {
+            fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self> {
+                let py = obj.py();
+                let py_numerator_obj = obj.getattr(crate::intern!(py, "numerator"))?;
+                let py_denominator_obj = obj.getattr(crate::intern!(py, "denominator"))?;
+                let numerator_owned = unsafe {
+                    Bound::from_owned_ptr_or_err(py, ffi::PyNumber_Long(py_numerator_obj.as_ptr()))?
+                };
+                let denominator_owned = unsafe {
+                    Bound::from_owned_ptr_or_err(
+                        py,
+                        ffi::PyNumber_Long(py_denominator_obj.as_ptr()),
+                    )?
+                };
+                let rs_numerator: $int = numerator_owned.extract()?;
+                let rs_denominator: $int = denominator_owned.extract()?;
+                Ok(Ratio::new(rs_numerator, rs_denominator))
+            }
+        }
+
+        impl ToPyObject for Ratio<$int> {
+            fn to_object(&self, py: Python<'_>) -> PyObject {
+                let fraction_cls = get_fraction_cls(py).expect("failed to load fractions.Fraction");
+                let ret = fraction_cls
+                    .call1((self.numer().clone(), self.denom().clone()))
+                    .expect("failed to call fractions.Fraction(value)");
+                ret.to_object(py)
+            }
+        }
+        impl IntoPy<PyObject> for Ratio<$int> {
+            fn into_py(self, py: Python<'_>) -> PyObject {
+                self.to_object(py)
+            }
+        }
+    };
+}
+rational_conversion!(i8);
+rational_conversion!(i16);
+rational_conversion!(i32);
+rational_conversion!(isize);
+rational_conversion!(i64);
+#[cfg(feature = "num-bigint")]
+rational_conversion!(BigInt);
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::types::dict::PyDictMethods;
+    use crate::types::PyDict;
+
+    #[cfg(not(target_arch = "wasm32"))]
+    use proptest::prelude::*;
+    #[test]
+    fn test_negative_fraction() {
+        Python::with_gil(|py| {
+            let locals = PyDict::new_bound(py);
+            py.run_bound(
+                "import fractions\npy_frac = fractions.Fraction(-0.125)",
+                None,
+                Some(&locals),
+            )
+            .unwrap();
+            let py_frac = locals.get_item("py_frac").unwrap().unwrap();
+            let roundtripped: Ratio<i32> = py_frac.extract().unwrap();
+            let rs_frac = Ratio::new(-1, 8);
+            assert_eq!(roundtripped, rs_frac);
+        })
+    }
+    #[test]
+    fn test_obj_with_incorrect_atts() {
+        Python::with_gil(|py| {
+            let locals = PyDict::new_bound(py);
+            py.run_bound(
+                "not_fraction = \"contains_incorrect_atts\"",
+                None,
+                Some(&locals),
+            )
+            .unwrap();
+            let py_frac = locals.get_item("not_fraction").unwrap().unwrap();
+            assert!(py_frac.extract::<Ratio<i32>>().is_err());
+        })
+    }
+
+    #[test]
+    fn test_fraction_with_fraction_type() {
+        Python::with_gil(|py| {
+            let locals = PyDict::new_bound(py);
+            py.run_bound(
+                "import fractions\npy_frac = fractions.Fraction(fractions.Fraction(10))",
+                None,
+                Some(&locals),
+            )
+            .unwrap();
+            let py_frac = locals.get_item("py_frac").unwrap().unwrap();
+            let roundtripped: Ratio<i32> = py_frac.extract().unwrap();
+            let rs_frac = Ratio::new(10, 1);
+            assert_eq!(roundtripped, rs_frac);
+        })
+    }
+
+    #[test]
+    fn test_fraction_with_decimal() {
+        Python::with_gil(|py| {
+            let locals = PyDict::new_bound(py);
+            py.run_bound(
+                "import fractions\n\nfrom decimal import Decimal\npy_frac = fractions.Fraction(Decimal(\"1.1\"))",
+                None,
+                Some(&locals),
+            )
+            .unwrap();
+            let py_frac = locals.get_item("py_frac").unwrap().unwrap();
+            let roundtripped: Ratio<i32> = py_frac.extract().unwrap();
+            let rs_frac = Ratio::new(11, 10);
+            assert_eq!(roundtripped, rs_frac);
+        })
+    }
+
+    #[test]
+    fn test_fraction_with_num_den() {
+        Python::with_gil(|py| {
+            let locals = PyDict::new_bound(py);
+            py.run_bound(
+                "import fractions\npy_frac = fractions.Fraction(10,5)",
+                None,
+                Some(&locals),
+            )
+            .unwrap();
+            let py_frac = locals.get_item("py_frac").unwrap().unwrap();
+            let roundtripped: Ratio<i32> = py_frac.extract().unwrap();
+            let rs_frac = Ratio::new(10, 5);
+            assert_eq!(roundtripped, rs_frac);
+        })
+    }
+
+    #[cfg(target_arch = "wasm32")]
+    #[test]
+    fn test_int_roundtrip() {
+        Python::with_gil(|py| {
+            let rs_frac = Ratio::new(1, 2);
+            let py_frac: PyObject = rs_frac.into_py(py);
+            let roundtripped: Ratio<i32> = py_frac.extract(py).unwrap();
+            assert_eq!(rs_frac, roundtripped);
+            // float conversion
+        })
+    }
+
+    #[cfg(target_arch = "wasm32")]
+    #[test]
+    fn test_big_int_roundtrip() {
+        Python::with_gil(|py| {
+            let rs_frac = Ratio::from_float(5.5).unwrap();
+            let py_frac: PyObject = rs_frac.clone().into_py(py);
+            let roundtripped: Ratio<BigInt> = py_frac.extract(py).unwrap();
+            assert_eq!(rs_frac, roundtripped);
+        })
+    }
+
+    #[cfg(not(target_arch = "wasm32"))]
+    proptest! {
+        #[test]
+        fn test_int_roundtrip(num in any::<i32>(), den in any::<i32>()) {
+            Python::with_gil(|py| {
+                let rs_frac = Ratio::new(num, den);
+                let py_frac = rs_frac.into_py(py);
+                let roundtripped: Ratio<i32> = py_frac.extract(py).unwrap();
+                assert_eq!(rs_frac, roundtripped);
+            })
+        }
+
+        #[test]
+        #[cfg(feature = "num-bigint")]
+        fn test_big_int_roundtrip(num in any::<f32>()) {
+            Python::with_gil(|py| {
+                let rs_frac = Ratio::from_float(num).unwrap();
+                let py_frac = rs_frac.clone().into_py(py);
+                let roundtripped: Ratio<BigInt> = py_frac.extract(py).unwrap();
+                assert_eq!(roundtripped, rs_frac);
+            })
+        }
+
+    }
+
+    #[test]
+    fn test_infinity() {
+        Python::with_gil(|py| {
+            let locals = PyDict::new_bound(py);
+            let py_bound = py.run_bound(
+                "import fractions\npy_frac = fractions.Fraction(\"Infinity\")",
+                None,
+                Some(&locals),
+            );
+            assert!(py_bound.is_err());
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/rust_decimal.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/rust_decimal.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/rust_decimal.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/rust_decimal.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,232 @@
+#![cfg(feature = "rust_decimal")]
+//! Conversions to and from [rust_decimal](https://docs.rs/rust_decimal)'s [`Decimal`] type.
+//!
+//! This is useful for converting Python's decimal.Decimal into and from a native Rust type.
+//!
+//! # Setup
+//!
+//! To use this feature, add to your **`Cargo.toml`**:
+//!
+//! ```toml
+//! [dependencies]
+#![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"),  "\", features = [\"rust_decimal\"] }")]
+//! rust_decimal = "1.0"
+//! ```
+//!
+//! Note that you must use a compatible version of rust_decimal and PyO3.
+//! The required rust_decimal version may vary based on the version of PyO3.
+//!
+//! # Example
+//!
+//! Rust code to create a function that adds one to a Decimal
+//!
+//! ```rust
+//! use rust_decimal::Decimal;
+//! use pyo3::prelude::*;
+//!
+//! #[pyfunction]
+//! fn add_one(d: Decimal) -> Decimal {
+//!     d + Decimal::ONE
+//! }
+//!
+//! #[pymodule]
+//! fn my_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
+//!     m.add_function(wrap_pyfunction!(add_one, m)?)?;
+//!     Ok(())
+//! }
+//! ```
+//!
+//! Python code that validates the functionality
+//!
+//!
+//! ```python
+//! from my_module import add_one
+//! from decimal import Decimal
+//!
+//! d = Decimal("2")
+//! value = add_one(d)
+//!
+//! assert d + 1 == value
+//! ```
+
+use crate::exceptions::PyValueError;
+use crate::sync::GILOnceCell;
+use crate::types::any::PyAnyMethods;
+use crate::types::string::PyStringMethods;
+use crate::types::PyType;
+use crate::{Bound, FromPyObject, IntoPy, Py, PyAny, PyObject, PyResult, Python, ToPyObject};
+use rust_decimal::Decimal;
+use std::str::FromStr;
+
+impl FromPyObject<'_> for Decimal {
+    fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self> {
+        // use the string representation to not be lossy
+        if let Ok(val) = obj.extract() {
+            Ok(Decimal::new(val, 0))
+        } else {
+            let py_str = &obj.str()?;
+            let rs_str = &py_str.to_cow()?;
+            Decimal::from_str(rs_str).or_else(|_| {
+                Decimal::from_scientific(rs_str).map_err(|e| PyValueError::new_err(e.to_string()))
+            })
+        }
+    }
+}
+
+static DECIMAL_CLS: GILOnceCell<Py<PyType>> = GILOnceCell::new();
+
+fn get_decimal_cls(py: Python<'_>) -> PyResult<&Bound<'_, PyType>> {
+    DECIMAL_CLS.get_or_try_init_type_ref(py, "decimal", "Decimal")
+}
+
+impl ToPyObject for Decimal {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        // TODO: handle error gracefully when ToPyObject can error
+        // look up the decimal.Decimal
+        let dec_cls = get_decimal_cls(py).expect("failed to load decimal.Decimal");
+        // now call the constructor with the Rust Decimal string-ified
+        // to not be lossy
+        let ret = dec_cls
+            .call1((self.to_string(),))
+            .expect("failed to call decimal.Decimal(value)");
+        ret.to_object(py)
+    }
+}
+
+impl IntoPy<PyObject> for Decimal {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_object(py)
+    }
+}
+
+#[cfg(test)]
+mod test_rust_decimal {
+    use super::*;
+    use crate::err::PyErr;
+    use crate::types::dict::PyDictMethods;
+    use crate::types::PyDict;
+
+    #[cfg(not(target_arch = "wasm32"))]
+    use proptest::prelude::*;
+
+    macro_rules! convert_constants {
+        ($name:ident, $rs:expr, $py:literal) => {
+            #[test]
+            fn $name() {
+                Python::with_gil(|py| {
+                    let rs_orig = $rs;
+                    let rs_dec = rs_orig.into_py(py);
+                    let locals = PyDict::new_bound(py);
+                    locals.set_item("rs_dec", &rs_dec).unwrap();
+                    // Checks if Rust Decimal -> Python Decimal conversion is correct
+                    py.run_bound(
+                        &format!(
+                            "import decimal\npy_dec = decimal.Decimal({})\nassert py_dec == rs_dec",
+                            $py
+                        ),
+                        None,
+                        Some(&locals),
+                    )
+                    .unwrap();
+                    // Checks if Python Decimal -> Rust Decimal conversion is correct
+                    let py_dec = locals.get_item("py_dec").unwrap().unwrap();
+                    let py_result: Decimal = py_dec.extract().unwrap();
+                    assert_eq!(rs_orig, py_result);
+                })
+            }
+        };
+    }
+
+    convert_constants!(convert_zero, Decimal::ZERO, "0");
+    convert_constants!(convert_one, Decimal::ONE, "1");
+    convert_constants!(convert_neg_one, Decimal::NEGATIVE_ONE, "-1");
+    convert_constants!(convert_two, Decimal::TWO, "2");
+    convert_constants!(convert_ten, Decimal::TEN, "10");
+    convert_constants!(convert_one_hundred, Decimal::ONE_HUNDRED, "100");
+    convert_constants!(convert_one_thousand, Decimal::ONE_THOUSAND, "1000");
+
+    #[cfg(not(target_arch = "wasm32"))]
+    proptest! {
+        #[test]
+        fn test_roundtrip(
+            lo in any::<u32>(),
+            mid in any::<u32>(),
+            high in any::<u32>(),
+            negative in any::<bool>(),
+            scale in 0..28u32
+        ) {
+            let num = Decimal::from_parts(lo, mid, high, negative, scale);
+            Python::with_gil(|py| {
+                let rs_dec = num.into_py(py);
+                let locals = PyDict::new_bound(py);
+                locals.set_item("rs_dec", &rs_dec).unwrap();
+                py.run_bound(
+                    &format!(
+                       "import decimal\npy_dec = decimal.Decimal(\"{}\")\nassert py_dec == rs_dec",
+                     num),
+                None, Some(&locals)).unwrap();
+                let roundtripped: Decimal = rs_dec.extract(py).unwrap();
+                assert_eq!(num, roundtripped);
+            })
+        }
+
+        #[test]
+        fn test_integers(num in any::<i64>()) {
+            Python::with_gil(|py| {
+                let py_num = num.into_py(py);
+                let roundtripped: Decimal = py_num.extract(py).unwrap();
+                let rs_dec = Decimal::new(num, 0);
+                assert_eq!(rs_dec, roundtripped);
+            })
+        }
+    }
+
+    #[test]
+    fn test_nan() {
+        Python::with_gil(|py| {
+            let locals = PyDict::new_bound(py);
+            py.run_bound(
+                "import decimal\npy_dec = decimal.Decimal(\"NaN\")",
+                None,
+                Some(&locals),
+            )
+            .unwrap();
+            let py_dec = locals.get_item("py_dec").unwrap().unwrap();
+            let roundtripped: Result<Decimal, PyErr> = py_dec.extract();
+            assert!(roundtripped.is_err());
+        })
+    }
+
+    #[test]
+    fn test_scientific_notation() {
+        Python::with_gil(|py| {
+            let locals = PyDict::new_bound(py);
+            py.run_bound(
+                "import decimal\npy_dec = decimal.Decimal(\"1e3\")",
+                None,
+                Some(&locals),
+            )
+            .unwrap();
+            let py_dec = locals.get_item("py_dec").unwrap().unwrap();
+            let roundtripped: Decimal = py_dec.extract().unwrap();
+            let rs_dec = Decimal::from_scientific("1e3").unwrap();
+            assert_eq!(rs_dec, roundtripped);
+        })
+    }
+
+    #[test]
+    fn test_infinity() {
+        Python::with_gil(|py| {
+            let locals = PyDict::new_bound(py);
+            py.run_bound(
+                "import decimal\npy_dec = decimal.Decimal(\"Infinity\")",
+                None,
+                Some(&locals),
+            )
+            .unwrap();
+            let py_dec = locals.get_item("py_dec").unwrap().unwrap();
+            let roundtripped: Result<Decimal, PyErr> = py_dec.extract();
+            assert!(roundtripped.is_err());
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/serde.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/serde.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/serde.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/serde.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,48 @@
+#![cfg(feature = "serde")]
+
+//! Enables (de)serialization of [`Py`]`<T>` objects via [serde](https://docs.rs/serde).
+//!
+//! # Setup
+//!
+//! To use this feature, add this to your **`Cargo.toml`**:
+//!
+//! ```toml
+//! [dependencies]
+#![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"),  "\", features = [\"serde\"] }")]
+//! serde = "1.0"
+//! ```
+
+use crate::{Py, PyAny, PyClass, Python};
+use serde::{de, ser, Deserialize, Deserializer, Serialize, Serializer};
+
+impl<T> Serialize for Py<T>
+where
+    T: Serialize + PyClass,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
+    where
+        S: Serializer,
+    {
+        Python::with_gil(|py| {
+            self.try_borrow(py)
+                .map_err(|e| ser::Error::custom(e.to_string()))?
+                .serialize(serializer)
+        })
+    }
+}
+
+impl<'de, T> Deserialize<'de> for Py<T>
+where
+    T: PyClass<BaseType = PyAny> + Deserialize<'de>,
+{
+    fn deserialize<D>(deserializer: D) -> Result<Py<T>, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        let deserialized = T::deserialize(deserializer)?;
+
+        Python::with_gil(|py| {
+            Py::new(py, deserialized).map_err(|e| de::Error::custom(e.to_string()))
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/smallvec.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/smallvec.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/smallvec.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/smallvec.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,142 @@
+#![cfg(feature = "smallvec")]
+
+//!  Conversions to and from [smallvec](https://docs.rs/smallvec/).
+//!
+//! # Setup
+//!
+//! To use this feature, add this to your **`Cargo.toml`**:
+//!
+//! ```toml
+//! [dependencies]
+//! # change * to the latest versions
+//! smallvec = "*"
+#![doc = concat!("pyo3 = { version = \"", env!("CARGO_PKG_VERSION"),  "\", features = [\"smallvec\"] }")]
+//! ```
+//!
+//! Note that you must use compatible versions of smallvec and PyO3.
+//! The required smallvec version may vary based on the version of PyO3.
+use crate::exceptions::PyTypeError;
+#[cfg(feature = "experimental-inspect")]
+use crate::inspect::types::TypeInfo;
+use crate::types::any::PyAnyMethods;
+use crate::types::list::new_from_iter;
+use crate::types::{PySequence, PyString};
+use crate::{
+    err::DowncastError, ffi, Bound, FromPyObject, IntoPy, PyAny, PyObject, PyResult, Python,
+    ToPyObject,
+};
+use smallvec::{Array, SmallVec};
+
+impl<A> ToPyObject for SmallVec<A>
+where
+    A: Array,
+    A::Item: ToPyObject,
+{
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        self.as_slice().to_object(py)
+    }
+}
+
+impl<A> IntoPy<PyObject> for SmallVec<A>
+where
+    A: Array,
+    A::Item: IntoPy<PyObject>,
+{
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        let mut iter = self.into_iter().map(|e| e.into_py(py));
+        let list = new_from_iter(py, &mut iter);
+        list.into()
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_output() -> TypeInfo {
+        TypeInfo::list_of(A::Item::type_output())
+    }
+}
+
+impl<'py, A> FromPyObject<'py> for SmallVec<A>
+where
+    A: Array,
+    A::Item: FromPyObject<'py>,
+{
+    fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self> {
+        if obj.is_instance_of::<PyString>() {
+            return Err(PyTypeError::new_err("Can't extract `str` to `SmallVec`"));
+        }
+        extract_sequence(obj)
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        TypeInfo::sequence_of(A::Item::type_input())
+    }
+}
+
+fn extract_sequence<'py, A>(obj: &Bound<'py, PyAny>) -> PyResult<SmallVec<A>>
+where
+    A: Array,
+    A::Item: FromPyObject<'py>,
+{
+    // Types that pass `PySequence_Check` usually implement enough of the sequence protocol
+    // to support this function and if not, we will only fail extraction safely.
+    let seq = unsafe {
+        if ffi::PySequence_Check(obj.as_ptr()) != 0 {
+            obj.downcast_unchecked::<PySequence>()
+        } else {
+            return Err(DowncastError::new(obj, "Sequence").into());
+        }
+    };
+
+    let mut sv = SmallVec::with_capacity(seq.len().unwrap_or(0));
+    for item in seq.iter()? {
+        sv.push(item?.extract::<A::Item>()?);
+    }
+    Ok(sv)
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::types::{PyDict, PyList};
+
+    #[test]
+    fn test_smallvec_into_py() {
+        Python::with_gil(|py| {
+            let sv: SmallVec<[u64; 8]> = [1, 2, 3, 4, 5].iter().cloned().collect();
+            let hso: PyObject = sv.clone().into_py(py);
+            let l = PyList::new_bound(py, [1, 2, 3, 4, 5]);
+            assert!(l.eq(hso).unwrap());
+        });
+    }
+
+    #[test]
+    fn test_smallvec_from_py_object() {
+        Python::with_gil(|py| {
+            let l = PyList::new_bound(py, [1, 2, 3, 4, 5]);
+            let sv: SmallVec<[u64; 8]> = l.extract().unwrap();
+            assert_eq!(sv.as_slice(), [1, 2, 3, 4, 5]);
+        });
+    }
+
+    #[test]
+    fn test_smallvec_from_py_object_fails() {
+        Python::with_gil(|py| {
+            let dict = PyDict::new_bound(py);
+            let sv: PyResult<SmallVec<[u64; 8]>> = dict.extract();
+            assert_eq!(
+                sv.unwrap_err().to_string(),
+                "TypeError: 'dict' object cannot be converted to 'Sequence'"
+            );
+        });
+    }
+
+    #[test]
+    fn test_smallvec_to_object() {
+        Python::with_gil(|py| {
+            let sv: SmallVec<[u64; 8]> = [1, 2, 3, 4, 5].iter().cloned().collect();
+            let hso: PyObject = sv.to_object(py);
+            let l = PyList::new_bound(py, [1, 2, 3, 4, 5]);
+            assert!(l.eq(hso).unwrap());
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/std/array.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/array.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/std/array.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/array.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,258 @@
+use crate::instance::Bound;
+use crate::types::any::PyAnyMethods;
+use crate::types::PySequence;
+use crate::{
+    err::DowncastError, ffi, FromPyObject, IntoPy, Py, PyAny, PyObject, PyResult, Python,
+    ToPyObject,
+};
+use crate::{exceptions, PyErr};
+
+impl<T, const N: usize> IntoPy<PyObject> for [T; N]
+where
+    T: IntoPy<PyObject>,
+{
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        unsafe {
+            let len = N as ffi::Py_ssize_t;
+
+            let ptr = ffi::PyList_New(len);
+
+            // We create the  `Py` pointer here for two reasons:
+            // - panics if the ptr is null
+            // - its Drop cleans up the list if user code panics.
+            let list: Py<PyAny> = Py::from_owned_ptr(py, ptr);
+
+            for (i, obj) in (0..len).zip(self) {
+                let obj = obj.into_py(py).into_ptr();
+
+                #[cfg(not(Py_LIMITED_API))]
+                ffi::PyList_SET_ITEM(ptr, i, obj);
+                #[cfg(Py_LIMITED_API)]
+                ffi::PyList_SetItem(ptr, i, obj);
+            }
+
+            list
+        }
+    }
+}
+
+impl<T, const N: usize> ToPyObject for [T; N]
+where
+    T: ToPyObject,
+{
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        self.as_ref().to_object(py)
+    }
+}
+
+impl<'py, T, const N: usize> FromPyObject<'py> for [T; N]
+where
+    T: FromPyObject<'py>,
+{
+    fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self> {
+        create_array_from_obj(obj)
+    }
+}
+
+fn create_array_from_obj<'py, T, const N: usize>(obj: &Bound<'py, PyAny>) -> PyResult<[T; N]>
+where
+    T: FromPyObject<'py>,
+{
+    // Types that pass `PySequence_Check` usually implement enough of the sequence protocol
+    // to support this function and if not, we will only fail extraction safely.
+    let seq = unsafe {
+        if ffi::PySequence_Check(obj.as_ptr()) != 0 {
+            obj.downcast_unchecked::<PySequence>()
+        } else {
+            return Err(DowncastError::new(obj, "Sequence").into());
+        }
+    };
+    let seq_len = seq.len()?;
+    if seq_len != N {
+        return Err(invalid_sequence_length(N, seq_len));
+    }
+    array_try_from_fn(|idx| seq.get_item(idx).and_then(|any| any.extract()))
+}
+
+// TODO use std::array::try_from_fn, if that stabilises:
+// (https://github.com/rust-lang/rust/issues/89379)
+fn array_try_from_fn<E, F, T, const N: usize>(mut cb: F) -> Result<[T; N], E>
+where
+    F: FnMut(usize) -> Result<T, E>,
+{
+    // Helper to safely create arrays since the standard library doesn't
+    // provide one yet. Shouldn't be necessary in the future.
+    struct ArrayGuard<T, const N: usize> {
+        dst: *mut T,
+        initialized: usize,
+    }
+
+    impl<T, const N: usize> Drop for ArrayGuard<T, N> {
+        fn drop(&mut self) {
+            debug_assert!(self.initialized <= N);
+            let initialized_part = core::ptr::slice_from_raw_parts_mut(self.dst, self.initialized);
+            unsafe {
+                core::ptr::drop_in_place(initialized_part);
+            }
+        }
+    }
+
+    // [MaybeUninit<T>; N] would be "nicer" but is actually difficult to create - there are nightly
+    // APIs which would make this easier.
+    let mut array: core::mem::MaybeUninit<[T; N]> = core::mem::MaybeUninit::uninit();
+    let mut guard: ArrayGuard<T, N> = ArrayGuard {
+        dst: array.as_mut_ptr() as _,
+        initialized: 0,
+    };
+    unsafe {
+        let mut value_ptr = array.as_mut_ptr() as *mut T;
+        for i in 0..N {
+            core::ptr::write(value_ptr, cb(i)?);
+            value_ptr = value_ptr.offset(1);
+            guard.initialized += 1;
+        }
+        core::mem::forget(guard);
+        Ok(array.assume_init())
+    }
+}
+
+fn invalid_sequence_length(expected: usize, actual: usize) -> PyErr {
+    exceptions::PyValueError::new_err(format!(
+        "expected a sequence of length {} (got {})",
+        expected, actual
+    ))
+}
+
+#[cfg(test)]
+mod tests {
+    use std::{
+        panic,
+        sync::atomic::{AtomicUsize, Ordering},
+    };
+
+    use crate::types::any::PyAnyMethods;
+    use crate::{types::PyList, IntoPy, PyResult, Python, ToPyObject};
+
+    #[test]
+    fn array_try_from_fn() {
+        static DROP_COUNTER: AtomicUsize = AtomicUsize::new(0);
+        struct CountDrop;
+        impl Drop for CountDrop {
+            fn drop(&mut self) {
+                DROP_COUNTER.fetch_add(1, Ordering::SeqCst);
+            }
+        }
+        let _ = catch_unwind_silent(move || {
+            let _: Result<[CountDrop; 4], ()> = super::array_try_from_fn(|idx| {
+                #[allow(clippy::manual_assert)]
+                if idx == 2 {
+                    panic!("peek a boo");
+                }
+                Ok(CountDrop)
+            });
+        });
+        assert_eq!(DROP_COUNTER.load(Ordering::SeqCst), 2);
+    }
+
+    #[test]
+    fn test_extract_bytearray_to_array() {
+        Python::with_gil(|py| {
+            let v: [u8; 33] = py
+                .eval_bound(
+                    "bytearray(b'abcabcabcabcabcabcabcabcabcabcabc')",
+                    None,
+                    None,
+                )
+                .unwrap()
+                .extract()
+                .unwrap();
+            assert!(&v == b"abcabcabcabcabcabcabcabcabcabcabc");
+        })
+    }
+
+    #[test]
+    fn test_extract_small_bytearray_to_array() {
+        Python::with_gil(|py| {
+            let v: [u8; 3] = py
+                .eval_bound("bytearray(b'abc')", None, None)
+                .unwrap()
+                .extract()
+                .unwrap();
+            assert!(&v == b"abc");
+        });
+    }
+    #[test]
+    fn test_topyobject_array_conversion() {
+        Python::with_gil(|py| {
+            let array: [f32; 4] = [0.0, -16.0, 16.0, 42.0];
+            let pyobject = array.to_object(py);
+            let pylist = pyobject.downcast_bound::<PyList>(py).unwrap();
+            assert_eq!(pylist.get_item(0).unwrap().extract::<f32>().unwrap(), 0.0);
+            assert_eq!(pylist.get_item(1).unwrap().extract::<f32>().unwrap(), -16.0);
+            assert_eq!(pylist.get_item(2).unwrap().extract::<f32>().unwrap(), 16.0);
+            assert_eq!(pylist.get_item(3).unwrap().extract::<f32>().unwrap(), 42.0);
+        });
+    }
+
+    #[test]
+    fn test_extract_invalid_sequence_length() {
+        Python::with_gil(|py| {
+            let v: PyResult<[u8; 3]> = py
+                .eval_bound("bytearray(b'abcdefg')", None, None)
+                .unwrap()
+                .extract();
+            assert_eq!(
+                v.unwrap_err().to_string(),
+                "ValueError: expected a sequence of length 3 (got 7)"
+            );
+        })
+    }
+
+    #[test]
+    fn test_intopy_array_conversion() {
+        Python::with_gil(|py| {
+            let array: [f32; 4] = [0.0, -16.0, 16.0, 42.0];
+            let pyobject = array.into_py(py);
+            let pylist = pyobject.downcast_bound::<PyList>(py).unwrap();
+            assert_eq!(pylist.get_item(0).unwrap().extract::<f32>().unwrap(), 0.0);
+            assert_eq!(pylist.get_item(1).unwrap().extract::<f32>().unwrap(), -16.0);
+            assert_eq!(pylist.get_item(2).unwrap().extract::<f32>().unwrap(), 16.0);
+            assert_eq!(pylist.get_item(3).unwrap().extract::<f32>().unwrap(), 42.0);
+        });
+    }
+
+    #[test]
+    fn test_extract_non_iterable_to_array() {
+        Python::with_gil(|py| {
+            let v = py.eval_bound("42", None, None).unwrap();
+            v.extract::<i32>().unwrap();
+            v.extract::<[i32; 1]>().unwrap_err();
+        });
+    }
+
+    #[cfg(feature = "macros")]
+    #[test]
+    fn test_pyclass_intopy_array_conversion() {
+        #[crate::pyclass(crate = "crate")]
+        struct Foo;
+
+        Python::with_gil(|py| {
+            let array: [Foo; 8] = [Foo, Foo, Foo, Foo, Foo, Foo, Foo, Foo];
+            let pyobject = array.into_py(py);
+            let list = pyobject.downcast_bound::<PyList>(py).unwrap();
+            let _bound = list.get_item(4).unwrap().downcast::<Foo>().unwrap();
+        });
+    }
+
+    // https://stackoverflow.com/a/59211505
+    fn catch_unwind_silent<F, R>(f: F) -> std::thread::Result<R>
+    where
+        F: FnOnce() -> R + panic::UnwindSafe,
+    {
+        let prev_hook = panic::take_hook();
+        panic::set_hook(Box::new(|_| {}));
+        let result = panic::catch_unwind(f);
+        panic::set_hook(prev_hook);
+        result
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/std/cell.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/cell.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/std/cell.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/cell.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,24 @@
+use std::cell::Cell;
+
+use crate::{
+    types::any::PyAnyMethods, Bound, FromPyObject, IntoPy, PyAny, PyObject, PyResult, Python,
+    ToPyObject,
+};
+
+impl<T: Copy + ToPyObject> ToPyObject for Cell<T> {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        self.get().to_object(py)
+    }
+}
+
+impl<T: Copy + IntoPy<PyObject>> IntoPy<PyObject> for Cell<T> {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.get().into_py(py)
+    }
+}
+
+impl<'py, T: FromPyObject<'py>> FromPyObject<'py> for Cell<T> {
+    fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self> {
+        ob.extract().map(Cell::new)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/std/ipaddr.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/ipaddr.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/std/ipaddr.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/ipaddr.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,114 @@
+use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
+
+use crate::exceptions::PyValueError;
+use crate::instance::Bound;
+use crate::sync::GILOnceCell;
+use crate::types::any::PyAnyMethods;
+use crate::types::string::PyStringMethods;
+use crate::types::PyType;
+use crate::{intern, FromPyObject, IntoPy, Py, PyAny, PyObject, PyResult, Python, ToPyObject};
+
+impl FromPyObject<'_> for IpAddr {
+    fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self> {
+        match obj.getattr(intern!(obj.py(), "packed")) {
+            Ok(packed) => {
+                if let Ok(packed) = packed.extract::<[u8; 4]>() {
+                    Ok(IpAddr::V4(Ipv4Addr::from(packed)))
+                } else if let Ok(packed) = packed.extract::<[u8; 16]>() {
+                    Ok(IpAddr::V6(Ipv6Addr::from(packed)))
+                } else {
+                    Err(PyValueError::new_err("invalid packed length"))
+                }
+            }
+            Err(_) => {
+                // We don't have a .packed attribute, so we try to construct an IP from str().
+                obj.str()?.to_cow()?.parse().map_err(PyValueError::new_err)
+            }
+        }
+    }
+}
+
+impl ToPyObject for Ipv4Addr {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        static IPV4_ADDRESS: GILOnceCell<Py<PyType>> = GILOnceCell::new();
+        IPV4_ADDRESS
+            .get_or_try_init_type_ref(py, "ipaddress", "IPv4Address")
+            .expect("failed to load ipaddress.IPv4Address")
+            .call1((u32::from_be_bytes(self.octets()),))
+            .expect("failed to construct ipaddress.IPv4Address")
+            .unbind()
+    }
+}
+
+impl ToPyObject for Ipv6Addr {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        static IPV6_ADDRESS: GILOnceCell<Py<PyType>> = GILOnceCell::new();
+        IPV6_ADDRESS
+            .get_or_try_init_type_ref(py, "ipaddress", "IPv6Address")
+            .expect("failed to load ipaddress.IPv6Address")
+            .call1((u128::from_be_bytes(self.octets()),))
+            .expect("failed to construct ipaddress.IPv6Address")
+            .unbind()
+    }
+}
+
+impl ToPyObject for IpAddr {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        match self {
+            IpAddr::V4(ip) => ip.to_object(py),
+            IpAddr::V6(ip) => ip.to_object(py),
+        }
+    }
+}
+
+impl IntoPy<PyObject> for IpAddr {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_object(py)
+    }
+}
+
+#[cfg(test)]
+mod test_ipaddr {
+    use std::str::FromStr;
+
+    use crate::types::PyString;
+
+    use super::*;
+
+    #[test]
+    fn test_roundtrip() {
+        Python::with_gil(|py| {
+            fn roundtrip(py: Python<'_>, ip: &str) {
+                let ip = IpAddr::from_str(ip).unwrap();
+                let py_cls = if ip.is_ipv4() {
+                    "IPv4Address"
+                } else {
+                    "IPv6Address"
+                };
+
+                let pyobj = ip.into_py(py);
+                let repr = pyobj.bind(py).repr().unwrap();
+                let repr = repr.to_string_lossy();
+                assert_eq!(repr, format!("{}('{}')", py_cls, ip));
+
+                let ip2: IpAddr = pyobj.extract(py).unwrap();
+                assert_eq!(ip, ip2);
+            }
+            roundtrip(py, "127.0.0.1");
+            roundtrip(py, "::1");
+            roundtrip(py, "0.0.0.0");
+        });
+    }
+
+    #[test]
+    fn test_from_pystring() {
+        Python::with_gil(|py| {
+            let py_str = PyString::new_bound(py, "0:0:0:0:0:0:0:1");
+            let ip: IpAddr = py_str.to_object(py).extract(py).unwrap();
+            assert_eq!(ip, IpAddr::from_str("::1").unwrap());
+
+            let py_str = PyString::new_bound(py, "invalid");
+            assert!(py_str.to_object(py).extract::<IpAddr>(py).is_err());
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/std/map.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/map.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/std/map.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/map.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,205 @@
+use std::{cmp, collections, hash};
+
+#[cfg(feature = "experimental-inspect")]
+use crate::inspect::types::TypeInfo;
+use crate::{
+    instance::Bound,
+    types::dict::PyDictMethods,
+    types::{any::PyAnyMethods, IntoPyDict, PyDict},
+    FromPyObject, IntoPy, PyAny, PyErr, PyObject, Python, ToPyObject,
+};
+
+impl<K, V, H> ToPyObject for collections::HashMap<K, V, H>
+where
+    K: hash::Hash + cmp::Eq + ToPyObject,
+    V: ToPyObject,
+    H: hash::BuildHasher,
+{
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        IntoPyDict::into_py_dict_bound(self, py).into()
+    }
+}
+
+impl<K, V> ToPyObject for collections::BTreeMap<K, V>
+where
+    K: cmp::Eq + ToPyObject,
+    V: ToPyObject,
+{
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        IntoPyDict::into_py_dict_bound(self, py).into()
+    }
+}
+
+impl<K, V, H> IntoPy<PyObject> for collections::HashMap<K, V, H>
+where
+    K: hash::Hash + cmp::Eq + IntoPy<PyObject>,
+    V: IntoPy<PyObject>,
+    H: hash::BuildHasher,
+{
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        let iter = self
+            .into_iter()
+            .map(|(k, v)| (k.into_py(py), v.into_py(py)));
+        IntoPyDict::into_py_dict_bound(iter, py).into()
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_output() -> TypeInfo {
+        TypeInfo::dict_of(K::type_output(), V::type_output())
+    }
+}
+
+impl<K, V> IntoPy<PyObject> for collections::BTreeMap<K, V>
+where
+    K: cmp::Eq + IntoPy<PyObject>,
+    V: IntoPy<PyObject>,
+{
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        let iter = self
+            .into_iter()
+            .map(|(k, v)| (k.into_py(py), v.into_py(py)));
+        IntoPyDict::into_py_dict_bound(iter, py).into()
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_output() -> TypeInfo {
+        TypeInfo::dict_of(K::type_output(), V::type_output())
+    }
+}
+
+impl<'py, K, V, S> FromPyObject<'py> for collections::HashMap<K, V, S>
+where
+    K: FromPyObject<'py> + cmp::Eq + hash::Hash,
+    V: FromPyObject<'py>,
+    S: hash::BuildHasher + Default,
+{
+    fn extract_bound(ob: &Bound<'py, PyAny>) -> Result<Self, PyErr> {
+        let dict = ob.downcast::<PyDict>()?;
+        let mut ret = collections::HashMap::with_capacity_and_hasher(dict.len(), S::default());
+        for (k, v) in dict {
+            ret.insert(k.extract()?, v.extract()?);
+        }
+        Ok(ret)
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        TypeInfo::mapping_of(K::type_input(), V::type_input())
+    }
+}
+
+impl<'py, K, V> FromPyObject<'py> for collections::BTreeMap<K, V>
+where
+    K: FromPyObject<'py> + cmp::Ord,
+    V: FromPyObject<'py>,
+{
+    fn extract_bound(ob: &Bound<'py, PyAny>) -> Result<Self, PyErr> {
+        let dict = ob.downcast::<PyDict>()?;
+        let mut ret = collections::BTreeMap::new();
+        for (k, v) in dict {
+            ret.insert(k.extract()?, v.extract()?);
+        }
+        Ok(ret)
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        TypeInfo::mapping_of(K::type_input(), V::type_input())
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use std::collections::{BTreeMap, HashMap};
+
+    #[test]
+    fn test_hashmap_to_python() {
+        Python::with_gil(|py| {
+            let mut map = HashMap::<i32, i32>::new();
+            map.insert(1, 1);
+
+            let m = map.to_object(py);
+            let py_map = m.downcast_bound::<PyDict>(py).unwrap();
+
+            assert!(py_map.len() == 1);
+            assert!(
+                py_map
+                    .get_item(1)
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap()
+                    == 1
+            );
+            assert_eq!(map, py_map.extract().unwrap());
+        });
+    }
+
+    #[test]
+    fn test_btreemap_to_python() {
+        Python::with_gil(|py| {
+            let mut map = BTreeMap::<i32, i32>::new();
+            map.insert(1, 1);
+
+            let m = map.to_object(py);
+            let py_map = m.downcast_bound::<PyDict>(py).unwrap();
+
+            assert!(py_map.len() == 1);
+            assert!(
+                py_map
+                    .get_item(1)
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap()
+                    == 1
+            );
+            assert_eq!(map, py_map.extract().unwrap());
+        });
+    }
+
+    #[test]
+    fn test_hashmap_into_python() {
+        Python::with_gil(|py| {
+            let mut map = HashMap::<i32, i32>::new();
+            map.insert(1, 1);
+
+            let m: PyObject = map.into_py(py);
+            let py_map = m.downcast_bound::<PyDict>(py).unwrap();
+
+            assert!(py_map.len() == 1);
+            assert!(
+                py_map
+                    .get_item(1)
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap()
+                    == 1
+            );
+        });
+    }
+
+    #[test]
+    fn test_btreemap_into_py() {
+        Python::with_gil(|py| {
+            let mut map = BTreeMap::<i32, i32>::new();
+            map.insert(1, 1);
+
+            let m: PyObject = map.into_py(py);
+            let py_map = m.downcast_bound::<PyDict>(py).unwrap();
+
+            assert!(py_map.len() == 1);
+            assert!(
+                py_map
+                    .get_item(1)
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap()
+                    == 1
+            );
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/std/mod.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/mod.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/std/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,13 @@
+mod array;
+mod cell;
+mod ipaddr;
+mod map;
+mod num;
+mod option;
+mod osstr;
+mod path;
+mod set;
+mod slice;
+mod string;
+mod time;
+mod vec;
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/std/num.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/num.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/std/num.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/num.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,831 @@
+use crate::ffi_ptr_ext::FfiPtrExt;
+#[cfg(feature = "experimental-inspect")]
+use crate::inspect::types::TypeInfo;
+use crate::types::any::PyAnyMethods;
+use crate::{
+    exceptions, ffi, Bound, FromPyObject, IntoPy, PyAny, PyErr, PyObject, PyResult, Python,
+    ToPyObject,
+};
+use std::num::{
+    NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize, NonZeroU128,
+    NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize,
+};
+use std::os::raw::c_long;
+
+macro_rules! int_fits_larger_int {
+    ($rust_type:ty, $larger_type:ty) => {
+        impl ToPyObject for $rust_type {
+            #[inline]
+            fn to_object(&self, py: Python<'_>) -> PyObject {
+                (*self as $larger_type).into_py(py)
+            }
+        }
+        impl IntoPy<PyObject> for $rust_type {
+            fn into_py(self, py: Python<'_>) -> PyObject {
+                (self as $larger_type).into_py(py)
+            }
+
+            #[cfg(feature = "experimental-inspect")]
+            fn type_output() -> TypeInfo {
+                <$larger_type>::type_output()
+            }
+        }
+
+        impl FromPyObject<'_> for $rust_type {
+            fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self> {
+                let val: $larger_type = obj.extract()?;
+                <$rust_type>::try_from(val)
+                    .map_err(|e| exceptions::PyOverflowError::new_err(e.to_string()))
+            }
+
+            #[cfg(feature = "experimental-inspect")]
+            fn type_input() -> TypeInfo {
+                <$larger_type>::type_input()
+            }
+        }
+    };
+}
+
+macro_rules! extract_int {
+    ($obj:ident, $error_val:expr, $pylong_as:expr) => {
+        extract_int!($obj, $error_val, $pylong_as, false)
+    };
+
+    ($obj:ident, $error_val:expr, $pylong_as:expr, $force_index_call: literal) => {
+        // In python 3.8+ `PyLong_AsLong` and friends takes care of calling `PyNumber_Index`,
+        // however 3.8 & 3.9 do lossy conversion of floats, hence we only use the
+        // simplest logic for 3.10+ where that was fixed - python/cpython#82180.
+        // `PyLong_AsUnsignedLongLong` does not call `PyNumber_Index`, hence the `force_index_call` argument
+        // See https://github.com/PyO3/pyo3/pull/3742 for detials
+        if cfg!(Py_3_10) && !$force_index_call {
+            err_if_invalid_value($obj.py(), $error_val, unsafe { $pylong_as($obj.as_ptr()) })
+        } else if let Ok(long) = $obj.downcast::<crate::types::PyLong>() {
+            // fast path - checking for subclass of `int` just checks a bit in the type $object
+            err_if_invalid_value($obj.py(), $error_val, unsafe { $pylong_as(long.as_ptr()) })
+        } else {
+            unsafe {
+                let num = ffi::PyNumber_Index($obj.as_ptr()).assume_owned_or_err($obj.py())?;
+                err_if_invalid_value($obj.py(), $error_val, $pylong_as(num.as_ptr()))
+            }
+        }
+    };
+}
+
+macro_rules! int_convert_u64_or_i64 {
+    ($rust_type:ty, $pylong_from_ll_or_ull:expr, $pylong_as_ll_or_ull:expr, $force_index_call:literal) => {
+        impl ToPyObject for $rust_type {
+            #[inline]
+            fn to_object(&self, py: Python<'_>) -> PyObject {
+                unsafe { PyObject::from_owned_ptr(py, $pylong_from_ll_or_ull(*self)) }
+            }
+        }
+        impl IntoPy<PyObject> for $rust_type {
+            #[inline]
+            fn into_py(self, py: Python<'_>) -> PyObject {
+                unsafe { PyObject::from_owned_ptr(py, $pylong_from_ll_or_ull(self)) }
+            }
+
+            #[cfg(feature = "experimental-inspect")]
+            fn type_output() -> TypeInfo {
+                TypeInfo::builtin("int")
+            }
+        }
+        impl FromPyObject<'_> for $rust_type {
+            fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<$rust_type> {
+                extract_int!(obj, !0, $pylong_as_ll_or_ull, $force_index_call)
+            }
+
+            #[cfg(feature = "experimental-inspect")]
+            fn type_input() -> TypeInfo {
+                Self::type_output()
+            }
+        }
+    };
+}
+
+macro_rules! int_fits_c_long {
+    ($rust_type:ty) => {
+        impl ToPyObject for $rust_type {
+            fn to_object(&self, py: Python<'_>) -> PyObject {
+                unsafe { PyObject::from_owned_ptr(py, ffi::PyLong_FromLong(*self as c_long)) }
+            }
+        }
+        impl IntoPy<PyObject> for $rust_type {
+            fn into_py(self, py: Python<'_>) -> PyObject {
+                unsafe { PyObject::from_owned_ptr(py, ffi::PyLong_FromLong(self as c_long)) }
+            }
+
+            #[cfg(feature = "experimental-inspect")]
+            fn type_output() -> TypeInfo {
+                TypeInfo::builtin("int")
+            }
+        }
+
+        impl<'py> FromPyObject<'py> for $rust_type {
+            fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self> {
+                let val: c_long = extract_int!(obj, -1, ffi::PyLong_AsLong)?;
+                <$rust_type>::try_from(val)
+                    .map_err(|e| exceptions::PyOverflowError::new_err(e.to_string()))
+            }
+
+            #[cfg(feature = "experimental-inspect")]
+            fn type_input() -> TypeInfo {
+                Self::type_output()
+            }
+        }
+    };
+}
+
+int_fits_c_long!(i8);
+int_fits_c_long!(u8);
+int_fits_c_long!(i16);
+int_fits_c_long!(u16);
+int_fits_c_long!(i32);
+
+// If c_long is 64-bits, we can use more types with int_fits_c_long!:
+#[cfg(all(target_pointer_width = "64", not(target_os = "windows")))]
+int_fits_c_long!(u32);
+#[cfg(any(target_pointer_width = "32", target_os = "windows"))]
+int_fits_larger_int!(u32, u64);
+
+#[cfg(all(target_pointer_width = "64", not(target_os = "windows")))]
+int_fits_c_long!(i64);
+
+// manual implementation for i64 on systems with 32-bit long
+#[cfg(any(target_pointer_width = "32", target_os = "windows"))]
+int_convert_u64_or_i64!(i64, ffi::PyLong_FromLongLong, ffi::PyLong_AsLongLong, false);
+
+#[cfg(all(target_pointer_width = "64", not(target_os = "windows")))]
+int_fits_c_long!(isize);
+#[cfg(any(target_pointer_width = "32", target_os = "windows"))]
+int_fits_larger_int!(isize, i64);
+
+int_fits_larger_int!(usize, u64);
+
+// u64 has a manual implementation as it never fits into signed long
+int_convert_u64_or_i64!(
+    u64,
+    ffi::PyLong_FromUnsignedLongLong,
+    ffi::PyLong_AsUnsignedLongLong,
+    true
+);
+
+#[cfg(all(not(Py_LIMITED_API), not(GraalPy)))]
+mod fast_128bit_int_conversion {
+    use super::*;
+
+    // for 128bit Integers
+    macro_rules! int_convert_128 {
+        ($rust_type: ty, $is_signed: literal) => {
+            impl ToPyObject for $rust_type {
+                #[inline]
+                fn to_object(&self, py: Python<'_>) -> PyObject {
+                    (*self).into_py(py)
+                }
+            }
+            impl IntoPy<PyObject> for $rust_type {
+                fn into_py(self, py: Python<'_>) -> PyObject {
+                    #[cfg(not(Py_3_13))]
+                    {
+                        let bytes = self.to_le_bytes();
+                        unsafe {
+                            ffi::_PyLong_FromByteArray(
+                                bytes.as_ptr().cast(),
+                                bytes.len(),
+                                1,
+                                $is_signed.into(),
+                            )
+                            .assume_owned(py)
+                            .unbind()
+                        }
+                    }
+                    #[cfg(Py_3_13)]
+                    {
+                        let bytes = self.to_ne_bytes();
+
+                        if $is_signed {
+                            unsafe {
+                                ffi::PyLong_FromNativeBytes(
+                                    bytes.as_ptr().cast(),
+                                    bytes.len(),
+                                    ffi::Py_ASNATIVEBYTES_NATIVE_ENDIAN,
+                                )
+                                .assume_owned(py)
+                            }
+                        } else {
+                            unsafe {
+                                ffi::PyLong_FromUnsignedNativeBytes(
+                                    bytes.as_ptr().cast(),
+                                    bytes.len(),
+                                    ffi::Py_ASNATIVEBYTES_NATIVE_ENDIAN,
+                                )
+                                .assume_owned(py)
+                            }
+                        }
+                        .unbind()
+                    }
+                }
+
+                #[cfg(feature = "experimental-inspect")]
+                fn type_output() -> TypeInfo {
+                    TypeInfo::builtin("int")
+                }
+            }
+
+            impl FromPyObject<'_> for $rust_type {
+                fn extract_bound(ob: &Bound<'_, PyAny>) -> PyResult<$rust_type> {
+                    let num =
+                        unsafe { ffi::PyNumber_Index(ob.as_ptr()).assume_owned_or_err(ob.py())? };
+                    let mut buffer = [0u8; std::mem::size_of::<$rust_type>()];
+                    #[cfg(not(Py_3_13))]
+                    {
+                        crate::err::error_on_minusone(ob.py(), unsafe {
+                            ffi::_PyLong_AsByteArray(
+                                num.as_ptr() as *mut ffi::PyLongObject,
+                                buffer.as_mut_ptr(),
+                                buffer.len(),
+                                1,
+                                $is_signed.into(),
+                            )
+                        })?;
+                        Ok(<$rust_type>::from_le_bytes(buffer))
+                    }
+                    #[cfg(Py_3_13)]
+                    {
+                        let mut flags = ffi::Py_ASNATIVEBYTES_NATIVE_ENDIAN;
+                        if !$is_signed {
+                            flags |= ffi::Py_ASNATIVEBYTES_UNSIGNED_BUFFER
+                                | ffi::Py_ASNATIVEBYTES_REJECT_NEGATIVE;
+                        }
+                        let actual_size: usize = unsafe {
+                            ffi::PyLong_AsNativeBytes(
+                                num.as_ptr(),
+                                buffer.as_mut_ptr().cast(),
+                                buffer
+                                    .len()
+                                    .try_into()
+                                    .expect("length of buffer fits in Py_ssize_t"),
+                                flags,
+                            )
+                        }
+                        .try_into()
+                        .map_err(|_| PyErr::fetch(ob.py()))?;
+                        if actual_size as usize > buffer.len() {
+                            return Err(crate::exceptions::PyOverflowError::new_err(
+                                "Python int larger than 128 bits",
+                            ));
+                        }
+                        Ok(<$rust_type>::from_ne_bytes(buffer))
+                    }
+                }
+
+                #[cfg(feature = "experimental-inspect")]
+                fn type_input() -> TypeInfo {
+                    Self::type_output()
+                }
+            }
+        };
+    }
+
+    int_convert_128!(i128, true);
+    int_convert_128!(u128, false);
+}
+
+// For ABI3 we implement the conversion manually.
+#[cfg(any(Py_LIMITED_API, GraalPy))]
+mod slow_128bit_int_conversion {
+    use super::*;
+    const SHIFT: usize = 64;
+
+    // for 128bit Integers
+    macro_rules! int_convert_128 {
+        ($rust_type: ty, $half_type: ty) => {
+            impl ToPyObject for $rust_type {
+                #[inline]
+                fn to_object(&self, py: Python<'_>) -> PyObject {
+                    (*self).into_py(py)
+                }
+            }
+
+            impl IntoPy<PyObject> for $rust_type {
+                fn into_py(self, py: Python<'_>) -> PyObject {
+                    let lower = (self as u64).into_py(py);
+                    let upper = ((self >> SHIFT) as $half_type).into_py(py);
+                    let shift = SHIFT.into_py(py);
+                    unsafe {
+                        let shifted = PyObject::from_owned_ptr(
+                            py,
+                            ffi::PyNumber_Lshift(upper.as_ptr(), shift.as_ptr()),
+                        );
+                        PyObject::from_owned_ptr(
+                            py,
+                            ffi::PyNumber_Or(shifted.as_ptr(), lower.as_ptr()),
+                        )
+                    }
+                }
+
+                #[cfg(feature = "experimental-inspect")]
+                fn type_output() -> TypeInfo {
+                    TypeInfo::builtin("int")
+                }
+            }
+
+            impl FromPyObject<'_> for $rust_type {
+                fn extract_bound(ob: &Bound<'_, PyAny>) -> PyResult<$rust_type> {
+                    let py = ob.py();
+                    unsafe {
+                        let lower = err_if_invalid_value(
+                            py,
+                            -1 as _,
+                            ffi::PyLong_AsUnsignedLongLongMask(ob.as_ptr()),
+                        )? as $rust_type;
+                        let shift = SHIFT.into_py(py);
+                        let shifted = PyObject::from_owned_ptr_or_err(
+                            py,
+                            ffi::PyNumber_Rshift(ob.as_ptr(), shift.as_ptr()),
+                        )?;
+                        let upper: $half_type = shifted.extract(py)?;
+                        Ok((<$rust_type>::from(upper) << SHIFT) | lower)
+                    }
+                }
+
+                #[cfg(feature = "experimental-inspect")]
+                fn type_input() -> TypeInfo {
+                    Self::type_output()
+                }
+            }
+        };
+    }
+
+    int_convert_128!(i128, i64);
+    int_convert_128!(u128, u64);
+}
+
+fn err_if_invalid_value<T: PartialEq>(
+    py: Python<'_>,
+    invalid_value: T,
+    actual_value: T,
+) -> PyResult<T> {
+    if actual_value == invalid_value {
+        if let Some(err) = PyErr::take(py) {
+            return Err(err);
+        }
+    }
+
+    Ok(actual_value)
+}
+
+macro_rules! nonzero_int_impl {
+    ($nonzero_type:ty, $primitive_type:ty) => {
+        impl ToPyObject for $nonzero_type {
+            fn to_object(&self, py: Python<'_>) -> PyObject {
+                self.get().to_object(py)
+            }
+        }
+
+        impl IntoPy<PyObject> for $nonzero_type {
+            fn into_py(self, py: Python<'_>) -> PyObject {
+                self.get().into_py(py)
+            }
+        }
+
+        impl FromPyObject<'_> for $nonzero_type {
+            fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self> {
+                let val: $primitive_type = obj.extract()?;
+                <$nonzero_type>::try_from(val)
+                    .map_err(|_| exceptions::PyValueError::new_err("invalid zero value"))
+            }
+
+            #[cfg(feature = "experimental-inspect")]
+            fn type_input() -> TypeInfo {
+                <$primitive_type>::type_input()
+            }
+        }
+    };
+}
+
+nonzero_int_impl!(NonZeroI8, i8);
+nonzero_int_impl!(NonZeroI16, i16);
+nonzero_int_impl!(NonZeroI32, i32);
+nonzero_int_impl!(NonZeroI64, i64);
+nonzero_int_impl!(NonZeroI128, i128);
+nonzero_int_impl!(NonZeroIsize, isize);
+nonzero_int_impl!(NonZeroU8, u8);
+nonzero_int_impl!(NonZeroU16, u16);
+nonzero_int_impl!(NonZeroU32, u32);
+nonzero_int_impl!(NonZeroU64, u64);
+nonzero_int_impl!(NonZeroU128, u128);
+nonzero_int_impl!(NonZeroUsize, usize);
+
+#[cfg(test)]
+mod test_128bit_integers {
+    use super::*;
+
+    #[cfg(not(target_arch = "wasm32"))]
+    use crate::types::PyDict;
+
+    #[cfg(not(target_arch = "wasm32"))]
+    use crate::types::dict::PyDictMethods;
+
+    #[cfg(not(target_arch = "wasm32"))]
+    use proptest::prelude::*;
+
+    #[cfg(not(target_arch = "wasm32"))]
+    proptest! {
+        #[test]
+        fn test_i128_roundtrip(x: i128) {
+            Python::with_gil(|py| {
+                let x_py = x.into_py(py);
+                let locals = PyDict::new_bound(py);
+                locals.set_item("x_py", x_py.clone_ref(py)).unwrap();
+                py.run_bound(&format!("assert x_py == {}", x), None, Some(&locals)).unwrap();
+                let roundtripped: i128 = x_py.extract(py).unwrap();
+                assert_eq!(x, roundtripped);
+            })
+        }
+
+        #[test]
+        fn test_nonzero_i128_roundtrip(
+            x in any::<i128>()
+                .prop_filter("Values must not be 0", |x| x != &0)
+                .prop_map(|x| NonZeroI128::new(x).unwrap())
+        ) {
+            Python::with_gil(|py| {
+                let x_py = x.into_py(py);
+                let locals = PyDict::new_bound(py);
+                locals.set_item("x_py", x_py.clone_ref(py)).unwrap();
+                py.run_bound(&format!("assert x_py == {}", x), None, Some(&locals)).unwrap();
+                let roundtripped: NonZeroI128 = x_py.extract(py).unwrap();
+                assert_eq!(x, roundtripped);
+            })
+        }
+    }
+
+    #[cfg(not(target_arch = "wasm32"))]
+    proptest! {
+        #[test]
+        fn test_u128_roundtrip(x: u128) {
+            Python::with_gil(|py| {
+                let x_py = x.into_py(py);
+                let locals = PyDict::new_bound(py);
+                locals.set_item("x_py", x_py.clone_ref(py)).unwrap();
+                py.run_bound(&format!("assert x_py == {}", x), None, Some(&locals)).unwrap();
+                let roundtripped: u128 = x_py.extract(py).unwrap();
+                assert_eq!(x, roundtripped);
+            })
+        }
+
+        #[test]
+        fn test_nonzero_u128_roundtrip(
+            x in any::<u128>()
+                .prop_filter("Values must not be 0", |x| x != &0)
+                .prop_map(|x| NonZeroU128::new(x).unwrap())
+        ) {
+            Python::with_gil(|py| {
+                let x_py = x.into_py(py);
+                let locals = PyDict::new_bound(py);
+                locals.set_item("x_py", x_py.clone_ref(py)).unwrap();
+                py.run_bound(&format!("assert x_py == {}", x), None, Some(&locals)).unwrap();
+                let roundtripped: NonZeroU128 = x_py.extract(py).unwrap();
+                assert_eq!(x, roundtripped);
+            })
+        }
+    }
+
+    #[test]
+    fn test_i128_max() {
+        Python::with_gil(|py| {
+            let v = i128::MAX;
+            let obj = v.to_object(py);
+            assert_eq!(v, obj.extract::<i128>(py).unwrap());
+            assert_eq!(v as u128, obj.extract::<u128>(py).unwrap());
+            assert!(obj.extract::<u64>(py).is_err());
+        })
+    }
+
+    #[test]
+    fn test_i128_min() {
+        Python::with_gil(|py| {
+            let v = i128::MIN;
+            let obj = v.to_object(py);
+            assert_eq!(v, obj.extract::<i128>(py).unwrap());
+            assert!(obj.extract::<i64>(py).is_err());
+            assert!(obj.extract::<u128>(py).is_err());
+        })
+    }
+
+    #[test]
+    fn test_u128_max() {
+        Python::with_gil(|py| {
+            let v = u128::MAX;
+            let obj = v.to_object(py);
+            assert_eq!(v, obj.extract::<u128>(py).unwrap());
+            assert!(obj.extract::<i128>(py).is_err());
+        })
+    }
+
+    #[test]
+    fn test_i128_overflow() {
+        Python::with_gil(|py| {
+            let obj = py.eval_bound("(1 << 130) * -1", None, None).unwrap();
+            let err = obj.extract::<i128>().unwrap_err();
+            assert!(err.is_instance_of::<crate::exceptions::PyOverflowError>(py));
+        })
+    }
+
+    #[test]
+    fn test_u128_overflow() {
+        Python::with_gil(|py| {
+            let obj = py.eval_bound("1 << 130", None, None).unwrap();
+            let err = obj.extract::<u128>().unwrap_err();
+            assert!(err.is_instance_of::<crate::exceptions::PyOverflowError>(py));
+        })
+    }
+
+    #[test]
+    fn test_nonzero_i128_max() {
+        Python::with_gil(|py| {
+            let v = NonZeroI128::new(i128::MAX).unwrap();
+            let obj = v.to_object(py);
+            assert_eq!(v, obj.extract::<NonZeroI128>(py).unwrap());
+            assert_eq!(
+                NonZeroU128::new(v.get() as u128).unwrap(),
+                obj.extract::<NonZeroU128>(py).unwrap()
+            );
+            assert!(obj.extract::<NonZeroU64>(py).is_err());
+        })
+    }
+
+    #[test]
+    fn test_nonzero_i128_min() {
+        Python::with_gil(|py| {
+            let v = NonZeroI128::new(i128::MIN).unwrap();
+            let obj = v.to_object(py);
+            assert_eq!(v, obj.extract::<NonZeroI128>(py).unwrap());
+            assert!(obj.extract::<NonZeroI64>(py).is_err());
+            assert!(obj.extract::<NonZeroU128>(py).is_err());
+        })
+    }
+
+    #[test]
+    fn test_nonzero_u128_max() {
+        Python::with_gil(|py| {
+            let v = NonZeroU128::new(u128::MAX).unwrap();
+            let obj = v.to_object(py);
+            assert_eq!(v, obj.extract::<NonZeroU128>(py).unwrap());
+            assert!(obj.extract::<NonZeroI128>(py).is_err());
+        })
+    }
+
+    #[test]
+    fn test_nonzero_i128_overflow() {
+        Python::with_gil(|py| {
+            let obj = py.eval_bound("(1 << 130) * -1", None, None).unwrap();
+            let err = obj.extract::<NonZeroI128>().unwrap_err();
+            assert!(err.is_instance_of::<crate::exceptions::PyOverflowError>(py));
+        })
+    }
+
+    #[test]
+    fn test_nonzero_u128_overflow() {
+        Python::with_gil(|py| {
+            let obj = py.eval_bound("1 << 130", None, None).unwrap();
+            let err = obj.extract::<NonZeroU128>().unwrap_err();
+            assert!(err.is_instance_of::<crate::exceptions::PyOverflowError>(py));
+        })
+    }
+
+    #[test]
+    fn test_nonzero_i128_zero_value() {
+        Python::with_gil(|py| {
+            let obj = py.eval_bound("0", None, None).unwrap();
+            let err = obj.extract::<NonZeroI128>().unwrap_err();
+            assert!(err.is_instance_of::<crate::exceptions::PyValueError>(py));
+        })
+    }
+
+    #[test]
+    fn test_nonzero_u128_zero_value() {
+        Python::with_gil(|py| {
+            let obj = py.eval_bound("0", None, None).unwrap();
+            let err = obj.extract::<NonZeroU128>().unwrap_err();
+            assert!(err.is_instance_of::<crate::exceptions::PyValueError>(py));
+        })
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::Python;
+    use crate::ToPyObject;
+    use std::num::*;
+
+    #[test]
+    fn test_u32_max() {
+        Python::with_gil(|py| {
+            let v = u32::MAX;
+            let obj = v.to_object(py);
+            assert_eq!(v, obj.extract::<u32>(py).unwrap());
+            assert_eq!(u64::from(v), obj.extract::<u64>(py).unwrap());
+            assert!(obj.extract::<i32>(py).is_err());
+        });
+    }
+
+    #[test]
+    fn test_i64_max() {
+        Python::with_gil(|py| {
+            let v = i64::MAX;
+            let obj = v.to_object(py);
+            assert_eq!(v, obj.extract::<i64>(py).unwrap());
+            assert_eq!(v as u64, obj.extract::<u64>(py).unwrap());
+            assert!(obj.extract::<u32>(py).is_err());
+        });
+    }
+
+    #[test]
+    fn test_i64_min() {
+        Python::with_gil(|py| {
+            let v = i64::MIN;
+            let obj = v.to_object(py);
+            assert_eq!(v, obj.extract::<i64>(py).unwrap());
+            assert!(obj.extract::<i32>(py).is_err());
+            assert!(obj.extract::<u64>(py).is_err());
+        });
+    }
+
+    #[test]
+    fn test_u64_max() {
+        Python::with_gil(|py| {
+            let v = u64::MAX;
+            let obj = v.to_object(py);
+            assert_eq!(v, obj.extract::<u64>(py).unwrap());
+            assert!(obj.extract::<i64>(py).is_err());
+        });
+    }
+
+    macro_rules! test_common (
+        ($test_mod_name:ident, $t:ty) => (
+            mod $test_mod_name {
+                use crate::exceptions;
+                use crate::ToPyObject;
+                use crate::Python;
+
+                #[test]
+                fn from_py_string_type_error() {
+                    Python::with_gil(|py| {
+                    let obj = ("123").to_object(py);
+                    let err = obj.extract::<$t>(py).unwrap_err();
+                    assert!(err.is_instance_of::<exceptions::PyTypeError>(py));
+                    });
+                }
+
+                #[test]
+                fn from_py_float_type_error() {
+                    Python::with_gil(|py| {
+                    let obj = (12.3).to_object(py);
+                    let err = obj.extract::<$t>(py).unwrap_err();
+                    assert!(err.is_instance_of::<exceptions::PyTypeError>(py));});
+                }
+
+                #[test]
+                fn to_py_object_and_back() {
+                    Python::with_gil(|py| {
+                    let val = 123 as $t;
+                    let obj = val.to_object(py);
+                    assert_eq!(obj.extract::<$t>(py).unwrap(), val as $t);});
+                }
+            }
+        )
+    );
+
+    test_common!(i8, i8);
+    test_common!(u8, u8);
+    test_common!(i16, i16);
+    test_common!(u16, u16);
+    test_common!(i32, i32);
+    test_common!(u32, u32);
+    test_common!(i64, i64);
+    test_common!(u64, u64);
+    test_common!(isize, isize);
+    test_common!(usize, usize);
+    test_common!(i128, i128);
+    test_common!(u128, u128);
+
+    #[test]
+    fn test_nonzero_u32_max() {
+        Python::with_gil(|py| {
+            let v = NonZeroU32::new(u32::MAX).unwrap();
+            let obj = v.to_object(py);
+            assert_eq!(v, obj.extract::<NonZeroU32>(py).unwrap());
+            assert_eq!(NonZeroU64::from(v), obj.extract::<NonZeroU64>(py).unwrap());
+            assert!(obj.extract::<NonZeroI32>(py).is_err());
+        });
+    }
+
+    #[test]
+    fn test_nonzero_i64_max() {
+        Python::with_gil(|py| {
+            let v = NonZeroI64::new(i64::MAX).unwrap();
+            let obj = v.to_object(py);
+            assert_eq!(v, obj.extract::<NonZeroI64>(py).unwrap());
+            assert_eq!(
+                NonZeroU64::new(v.get() as u64).unwrap(),
+                obj.extract::<NonZeroU64>(py).unwrap()
+            );
+            assert!(obj.extract::<NonZeroU32>(py).is_err());
+        });
+    }
+
+    #[test]
+    fn test_nonzero_i64_min() {
+        Python::with_gil(|py| {
+            let v = NonZeroI64::new(i64::MIN).unwrap();
+            let obj = v.to_object(py);
+            assert_eq!(v, obj.extract::<NonZeroI64>(py).unwrap());
+            assert!(obj.extract::<NonZeroI32>(py).is_err());
+            assert!(obj.extract::<NonZeroU64>(py).is_err());
+        });
+    }
+
+    #[test]
+    fn test_nonzero_u64_max() {
+        Python::with_gil(|py| {
+            let v = NonZeroU64::new(u64::MAX).unwrap();
+            let obj = v.to_object(py);
+            assert_eq!(v, obj.extract::<NonZeroU64>(py).unwrap());
+            assert!(obj.extract::<NonZeroI64>(py).is_err());
+        });
+    }
+
+    macro_rules! test_nonzero_common (
+        ($test_mod_name:ident, $t:ty) => (
+            mod $test_mod_name {
+                use crate::exceptions;
+                use crate::ToPyObject;
+                use crate::Python;
+                use std::num::*;
+
+                #[test]
+                fn from_py_string_type_error() {
+                    Python::with_gil(|py| {
+                    let obj = ("123").to_object(py);
+                    let err = obj.extract::<$t>(py).unwrap_err();
+                    assert!(err.is_instance_of::<exceptions::PyTypeError>(py));
+                    });
+                }
+
+                #[test]
+                fn from_py_float_type_error() {
+                    Python::with_gil(|py| {
+                    let obj = (12.3).to_object(py);
+                    let err = obj.extract::<$t>(py).unwrap_err();
+                    assert!(err.is_instance_of::<exceptions::PyTypeError>(py));});
+                }
+
+                #[test]
+                fn to_py_object_and_back() {
+                    Python::with_gil(|py| {
+                    let val = <$t>::new(123).unwrap();
+                    let obj = val.to_object(py);
+                    assert_eq!(obj.extract::<$t>(py).unwrap(), val);});
+                }
+            }
+        )
+    );
+
+    test_nonzero_common!(nonzero_i8, NonZeroI8);
+    test_nonzero_common!(nonzero_u8, NonZeroU8);
+    test_nonzero_common!(nonzero_i16, NonZeroI16);
+    test_nonzero_common!(nonzero_u16, NonZeroU16);
+    test_nonzero_common!(nonzero_i32, NonZeroI32);
+    test_nonzero_common!(nonzero_u32, NonZeroU32);
+    test_nonzero_common!(nonzero_i64, NonZeroI64);
+    test_nonzero_common!(nonzero_u64, NonZeroU64);
+    test_nonzero_common!(nonzero_isize, NonZeroIsize);
+    test_nonzero_common!(nonzero_usize, NonZeroUsize);
+    test_nonzero_common!(nonzero_i128, NonZeroI128);
+    test_nonzero_common!(nonzero_u128, NonZeroU128);
+
+    #[test]
+    fn test_i64_bool() {
+        Python::with_gil(|py| {
+            let obj = true.to_object(py);
+            assert_eq!(1, obj.extract::<i64>(py).unwrap());
+            let obj = false.to_object(py);
+            assert_eq!(0, obj.extract::<i64>(py).unwrap());
+        })
+    }
+
+    #[test]
+    fn test_i64_f64() {
+        Python::with_gil(|py| {
+            let obj = 12.34f64.to_object(py);
+            let err = obj.extract::<i64>(py).unwrap_err();
+            assert!(err.is_instance_of::<crate::exceptions::PyTypeError>(py));
+            // with no remainder
+            let obj = 12f64.to_object(py);
+            let err = obj.extract::<i64>(py).unwrap_err();
+            assert!(err.is_instance_of::<crate::exceptions::PyTypeError>(py));
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/std/option.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/option.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/std/option.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/option.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,73 @@
+use crate::{
+    ffi, types::any::PyAnyMethods, AsPyPointer, Bound, FromPyObject, IntoPy, PyAny, PyObject,
+    PyResult, Python, ToPyObject,
+};
+
+/// `Option::Some<T>` is converted like `T`.
+/// `Option::None` is converted to Python `None`.
+impl<T> ToPyObject for Option<T>
+where
+    T: ToPyObject,
+{
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        self.as_ref()
+            .map_or_else(|| py.None(), |val| val.to_object(py))
+    }
+}
+
+impl<T> IntoPy<PyObject> for Option<T>
+where
+    T: IntoPy<PyObject>,
+{
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.map_or_else(|| py.None(), |val| val.into_py(py))
+    }
+}
+
+impl<'py, T> FromPyObject<'py> for Option<T>
+where
+    T: FromPyObject<'py>,
+{
+    fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self> {
+        if obj.is_none() {
+            Ok(None)
+        } else {
+            obj.extract().map(Some)
+        }
+    }
+}
+
+/// Convert `None` into a null pointer.
+unsafe impl<T> AsPyPointer for Option<T>
+where
+    T: AsPyPointer,
+{
+    #[inline]
+    fn as_ptr(&self) -> *mut ffi::PyObject {
+        self.as_ref()
+            .map_or_else(std::ptr::null_mut, |t| t.as_ptr())
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::{PyObject, Python};
+
+    #[test]
+    fn test_option_as_ptr() {
+        Python::with_gil(|py| {
+            use crate::AsPyPointer;
+            let mut option: Option<PyObject> = None;
+            assert_eq!(option.as_ptr(), std::ptr::null_mut());
+
+            let none = py.None();
+            option = Some(none.clone_ref(py));
+
+            let ref_cnt = none.get_refcnt(py);
+            assert_eq!(option.as_ptr(), none.as_ptr());
+
+            // Ensure ref count not changed by as_ptr call
+            assert_eq!(none.get_refcnt(py), ref_cnt);
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/std/osstr.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/osstr.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/std/osstr.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/osstr.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,213 @@
+use crate::instance::Bound;
+use crate::types::any::PyAnyMethods;
+use crate::types::PyString;
+use crate::{ffi, FromPyObject, IntoPy, PyAny, PyObject, PyResult, Python, ToPyObject};
+use std::borrow::Cow;
+use std::ffi::{OsStr, OsString};
+
+impl ToPyObject for OsStr {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        // If the string is UTF-8, take the quick and easy shortcut
+        if let Some(valid_utf8_path) = self.to_str() {
+            return valid_utf8_path.to_object(py);
+        }
+
+        // All targets besides windows support the std::os::unix::ffi::OsStrExt API:
+        // https://doc.rust-lang.org/src/std/sys_common/mod.rs.html#59
+        #[cfg(not(windows))]
+        {
+            #[cfg(target_os = "wasi")]
+            let bytes = std::os::wasi::ffi::OsStrExt::as_bytes(self);
+            #[cfg(not(target_os = "wasi"))]
+            let bytes = std::os::unix::ffi::OsStrExt::as_bytes(self);
+
+            let ptr = bytes.as_ptr().cast();
+            let len = bytes.len() as ffi::Py_ssize_t;
+            unsafe {
+                // DecodeFSDefault automatically chooses an appropriate decoding mechanism to
+                // parse os strings losslessly (i.e. surrogateescape most of the time)
+                let pystring = ffi::PyUnicode_DecodeFSDefaultAndSize(ptr, len);
+                PyObject::from_owned_ptr(py, pystring)
+            }
+        }
+
+        #[cfg(windows)]
+        {
+            let wstr: Vec<u16> = std::os::windows::ffi::OsStrExt::encode_wide(self).collect();
+
+            unsafe {
+                // This will not panic because the data from encode_wide is well-formed Windows
+                // string data
+                PyObject::from_owned_ptr(
+                    py,
+                    ffi::PyUnicode_FromWideChar(wstr.as_ptr(), wstr.len() as ffi::Py_ssize_t),
+                )
+            }
+        }
+    }
+}
+
+// There's no FromPyObject implementation for &OsStr because albeit possible on Unix, this would
+// be impossible to implement on Windows. Hence it's omitted entirely
+
+impl FromPyObject<'_> for OsString {
+    fn extract_bound(ob: &Bound<'_, PyAny>) -> PyResult<Self> {
+        let pystring = ob.downcast::<PyString>()?;
+
+        #[cfg(not(windows))]
+        {
+            // Decode from Python's lossless bytes string representation back into raw bytes
+            let fs_encoded_bytes = unsafe {
+                crate::Py::<crate::types::PyBytes>::from_owned_ptr(
+                    ob.py(),
+                    ffi::PyUnicode_EncodeFSDefault(pystring.as_ptr()),
+                )
+            };
+
+            // Create an OsStr view into the raw bytes from Python
+            #[cfg(target_os = "wasi")]
+            let os_str: &OsStr =
+                std::os::wasi::ffi::OsStrExt::from_bytes(fs_encoded_bytes.as_bytes(ob.py()));
+            #[cfg(not(target_os = "wasi"))]
+            let os_str: &OsStr =
+                std::os::unix::ffi::OsStrExt::from_bytes(fs_encoded_bytes.as_bytes(ob.py()));
+
+            Ok(os_str.to_os_string())
+        }
+
+        #[cfg(windows)]
+        {
+            use crate::types::string::PyStringMethods;
+
+            // Take the quick and easy shortcut if UTF-8
+            if let Ok(utf8_string) = pystring.to_cow() {
+                return Ok(utf8_string.into_owned().into());
+            }
+
+            // Get an owned allocated wide char buffer from PyString, which we have to deallocate
+            // ourselves
+            let size =
+                unsafe { ffi::PyUnicode_AsWideChar(pystring.as_ptr(), std::ptr::null_mut(), 0) };
+            crate::err::error_on_minusone(ob.py(), size)?;
+
+            let mut buffer = vec![0; size as usize];
+            let bytes_read =
+                unsafe { ffi::PyUnicode_AsWideChar(pystring.as_ptr(), buffer.as_mut_ptr(), size) };
+            assert_eq!(bytes_read, size);
+
+            // Copy wide char buffer into OsString
+            let os_string = std::os::windows::ffi::OsStringExt::from_wide(&buffer);
+
+            Ok(os_string)
+        }
+    }
+}
+
+impl IntoPy<PyObject> for &'_ OsStr {
+    #[inline]
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_object(py)
+    }
+}
+
+impl ToPyObject for Cow<'_, OsStr> {
+    #[inline]
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        (self as &OsStr).to_object(py)
+    }
+}
+
+impl IntoPy<PyObject> for Cow<'_, OsStr> {
+    #[inline]
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_object(py)
+    }
+}
+
+impl ToPyObject for OsString {
+    #[inline]
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        (self as &OsStr).to_object(py)
+    }
+}
+
+impl IntoPy<PyObject> for OsString {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_object(py)
+    }
+}
+
+impl<'a> IntoPy<PyObject> for &'a OsString {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_object(py)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::types::{PyAnyMethods, PyStringMethods};
+    use crate::{types::PyString, IntoPy, PyObject, Python, ToPyObject};
+    use std::fmt::Debug;
+    use std::{
+        borrow::Cow,
+        ffi::{OsStr, OsString},
+    };
+
+    #[test]
+    #[cfg(not(windows))]
+    fn test_non_utf8_conversion() {
+        Python::with_gil(|py| {
+            #[cfg(not(target_os = "wasi"))]
+            use std::os::unix::ffi::OsStrExt;
+            #[cfg(target_os = "wasi")]
+            use std::os::wasi::ffi::OsStrExt;
+
+            // this is not valid UTF-8
+            let payload = &[250, 251, 252, 253, 254, 255, 0, 255];
+            let os_str = OsStr::from_bytes(payload);
+
+            // do a roundtrip into Pythonland and back and compare
+            let py_str: PyObject = os_str.into_py(py);
+            let os_str_2: OsString = py_str.extract(py).unwrap();
+            assert_eq!(os_str, os_str_2);
+        });
+    }
+
+    #[test]
+    fn test_topyobject_roundtrip() {
+        Python::with_gil(|py| {
+            fn test_roundtrip<T: ToPyObject + AsRef<OsStr> + Debug>(py: Python<'_>, obj: T) {
+                let pyobject = obj.to_object(py);
+                let pystring = pyobject.downcast_bound::<PyString>(py).unwrap();
+                assert_eq!(pystring.to_string_lossy(), obj.as_ref().to_string_lossy());
+                let roundtripped_obj: OsString = pystring.extract().unwrap();
+                assert_eq!(obj.as_ref(), roundtripped_obj.as_os_str());
+            }
+            let os_str = OsStr::new("Hello\0\n🐍");
+            test_roundtrip::<&OsStr>(py, os_str);
+            test_roundtrip::<Cow<'_, OsStr>>(py, Cow::Borrowed(os_str));
+            test_roundtrip::<Cow<'_, OsStr>>(py, Cow::Owned(os_str.to_os_string()));
+            test_roundtrip::<OsString>(py, os_str.to_os_string());
+        });
+    }
+
+    #[test]
+    fn test_intopy_roundtrip() {
+        Python::with_gil(|py| {
+            fn test_roundtrip<T: IntoPy<PyObject> + AsRef<OsStr> + Debug + Clone>(
+                py: Python<'_>,
+                obj: T,
+            ) {
+                let pyobject = obj.clone().into_py(py);
+                let pystring = pyobject.downcast_bound::<PyString>(py).unwrap();
+                assert_eq!(pystring.to_string_lossy(), obj.as_ref().to_string_lossy());
+                let roundtripped_obj: OsString = pystring.extract().unwrap();
+                assert!(obj.as_ref() == roundtripped_obj.as_os_str());
+            }
+            let os_str = OsStr::new("Hello\0\n🐍");
+            test_roundtrip::<&OsStr>(py, os_str);
+            test_roundtrip::<OsString>(py, os_str.to_os_string());
+            test_roundtrip::<&OsString>(py, &os_str.to_os_string());
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/std/path.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/path.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/std/path.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/path.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,131 @@
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::instance::Bound;
+use crate::types::any::PyAnyMethods;
+use crate::{ffi, FromPyObject, IntoPy, PyAny, PyObject, PyResult, Python, ToPyObject};
+use std::borrow::Cow;
+use std::ffi::OsString;
+use std::path::{Path, PathBuf};
+
+impl ToPyObject for Path {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        self.as_os_str().to_object(py)
+    }
+}
+
+// See osstr.rs for why there's no FromPyObject impl for &Path
+
+impl FromPyObject<'_> for PathBuf {
+    fn extract_bound(ob: &Bound<'_, PyAny>) -> PyResult<Self> {
+        // We use os.fspath to get the underlying path as bytes or str
+        let path = unsafe { ffi::PyOS_FSPath(ob.as_ptr()).assume_owned_or_err(ob.py())? };
+        Ok(path.extract::<OsString>()?.into())
+    }
+}
+
+impl<'a> IntoPy<PyObject> for &'a Path {
+    #[inline]
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.as_os_str().to_object(py)
+    }
+}
+
+impl<'a> ToPyObject for Cow<'a, Path> {
+    #[inline]
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        self.as_os_str().to_object(py)
+    }
+}
+
+impl<'a> IntoPy<PyObject> for Cow<'a, Path> {
+    #[inline]
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_object(py)
+    }
+}
+
+impl ToPyObject for PathBuf {
+    #[inline]
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        self.as_os_str().to_object(py)
+    }
+}
+
+impl IntoPy<PyObject> for PathBuf {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.into_os_string().to_object(py)
+    }
+}
+
+impl<'a> IntoPy<PyObject> for &'a PathBuf {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.as_os_str().to_object(py)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::types::{PyAnyMethods, PyStringMethods};
+    use crate::{types::PyString, IntoPy, PyObject, Python, ToPyObject};
+    use std::borrow::Cow;
+    use std::fmt::Debug;
+    use std::path::{Path, PathBuf};
+
+    #[test]
+    #[cfg(not(windows))]
+    fn test_non_utf8_conversion() {
+        Python::with_gil(|py| {
+            use std::ffi::OsStr;
+            #[cfg(not(target_os = "wasi"))]
+            use std::os::unix::ffi::OsStrExt;
+            #[cfg(target_os = "wasi")]
+            use std::os::wasi::ffi::OsStrExt;
+
+            // this is not valid UTF-8
+            let payload = &[250, 251, 252, 253, 254, 255, 0, 255];
+            let path = Path::new(OsStr::from_bytes(payload));
+
+            // do a roundtrip into Pythonland and back and compare
+            let py_str: PyObject = path.into_py(py);
+            let path_2: PathBuf = py_str.extract(py).unwrap();
+            assert_eq!(path, path_2);
+        });
+    }
+
+    #[test]
+    fn test_topyobject_roundtrip() {
+        Python::with_gil(|py| {
+            fn test_roundtrip<T: ToPyObject + AsRef<Path> + Debug>(py: Python<'_>, obj: T) {
+                let pyobject = obj.to_object(py);
+                let pystring = pyobject.downcast_bound::<PyString>(py).unwrap();
+                assert_eq!(pystring.to_string_lossy(), obj.as_ref().to_string_lossy());
+                let roundtripped_obj: PathBuf = pystring.extract().unwrap();
+                assert_eq!(obj.as_ref(), roundtripped_obj.as_path());
+            }
+            let path = Path::new("Hello\0\n🐍");
+            test_roundtrip::<&Path>(py, path);
+            test_roundtrip::<Cow<'_, Path>>(py, Cow::Borrowed(path));
+            test_roundtrip::<Cow<'_, Path>>(py, Cow::Owned(path.to_path_buf()));
+            test_roundtrip::<PathBuf>(py, path.to_path_buf());
+        });
+    }
+
+    #[test]
+    fn test_intopy_roundtrip() {
+        Python::with_gil(|py| {
+            fn test_roundtrip<T: IntoPy<PyObject> + AsRef<Path> + Debug + Clone>(
+                py: Python<'_>,
+                obj: T,
+            ) {
+                let pyobject = obj.clone().into_py(py);
+                let pystring = pyobject.downcast_bound::<PyString>(py).unwrap();
+                assert_eq!(pystring.to_string_lossy(), obj.as_ref().to_string_lossy());
+                let roundtripped_obj: PathBuf = pystring.extract().unwrap();
+                assert_eq!(obj.as_ref(), roundtripped_obj.as_path());
+            }
+            let path = Path::new("Hello\0\n🐍");
+            test_roundtrip::<&Path>(py, path);
+            test_roundtrip::<PathBuf>(py, path.to_path_buf());
+            test_roundtrip::<&PathBuf>(py, &path.to_path_buf());
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/std/set.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/set.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/std/set.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/set.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,176 @@
+use std::{cmp, collections, hash};
+
+#[cfg(feature = "experimental-inspect")]
+use crate::inspect::types::TypeInfo;
+use crate::{
+    instance::Bound,
+    types::any::PyAnyMethods,
+    types::frozenset::PyFrozenSetMethods,
+    types::set::{new_from_iter, PySetMethods},
+    types::{PyFrozenSet, PySet},
+    FromPyObject, IntoPy, PyAny, PyErr, PyObject, PyResult, Python, ToPyObject,
+};
+
+impl<T, S> ToPyObject for collections::HashSet<T, S>
+where
+    T: hash::Hash + Eq + ToPyObject,
+    S: hash::BuildHasher + Default,
+{
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        new_from_iter(py, self)
+            .expect("Failed to create Python set from HashSet")
+            .into()
+    }
+}
+
+impl<T> ToPyObject for collections::BTreeSet<T>
+where
+    T: hash::Hash + Eq + ToPyObject,
+{
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        new_from_iter(py, self)
+            .expect("Failed to create Python set from BTreeSet")
+            .into()
+    }
+}
+
+impl<K, S> IntoPy<PyObject> for collections::HashSet<K, S>
+where
+    K: IntoPy<PyObject> + Eq + hash::Hash,
+    S: hash::BuildHasher + Default,
+{
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        new_from_iter(py, self.into_iter().map(|item| item.into_py(py)))
+            .expect("Failed to create Python set from HashSet")
+            .into()
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_output() -> TypeInfo {
+        TypeInfo::set_of(K::type_output())
+    }
+}
+
+impl<'py, K, S> FromPyObject<'py> for collections::HashSet<K, S>
+where
+    K: FromPyObject<'py> + cmp::Eq + hash::Hash,
+    S: hash::BuildHasher + Default,
+{
+    fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self> {
+        match ob.downcast::<PySet>() {
+            Ok(set) => set.iter().map(|any| any.extract()).collect(),
+            Err(err) => {
+                if let Ok(frozen_set) = ob.downcast::<PyFrozenSet>() {
+                    frozen_set.iter().map(|any| any.extract()).collect()
+                } else {
+                    Err(PyErr::from(err))
+                }
+            }
+        }
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        TypeInfo::set_of(K::type_input())
+    }
+}
+
+impl<K> IntoPy<PyObject> for collections::BTreeSet<K>
+where
+    K: IntoPy<PyObject> + cmp::Ord,
+{
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        new_from_iter(py, self.into_iter().map(|item| item.into_py(py)))
+            .expect("Failed to create Python set from BTreeSet")
+            .into()
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_output() -> TypeInfo {
+        TypeInfo::set_of(K::type_output())
+    }
+}
+
+impl<'py, K> FromPyObject<'py> for collections::BTreeSet<K>
+where
+    K: FromPyObject<'py> + cmp::Ord,
+{
+    fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self> {
+        match ob.downcast::<PySet>() {
+            Ok(set) => set.iter().map(|any| any.extract()).collect(),
+            Err(err) => {
+                if let Ok(frozen_set) = ob.downcast::<PyFrozenSet>() {
+                    frozen_set.iter().map(|any| any.extract()).collect()
+                } else {
+                    Err(PyErr::from(err))
+                }
+            }
+        }
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        TypeInfo::set_of(K::type_input())
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::types::{any::PyAnyMethods, PyFrozenSet, PySet};
+    use crate::{IntoPy, PyObject, Python, ToPyObject};
+    use std::collections::{BTreeSet, HashSet};
+
+    #[test]
+    fn test_extract_hashset() {
+        Python::with_gil(|py| {
+            let set = PySet::new_bound(py, &[1, 2, 3, 4, 5]).unwrap();
+            let hash_set: HashSet<usize> = set.extract().unwrap();
+            assert_eq!(hash_set, [1, 2, 3, 4, 5].iter().copied().collect());
+
+            let set = PyFrozenSet::new_bound(py, &[1, 2, 3, 4, 5]).unwrap();
+            let hash_set: HashSet<usize> = set.extract().unwrap();
+            assert_eq!(hash_set, [1, 2, 3, 4, 5].iter().copied().collect());
+        });
+    }
+
+    #[test]
+    fn test_extract_btreeset() {
+        Python::with_gil(|py| {
+            let set = PySet::new_bound(py, &[1, 2, 3, 4, 5]).unwrap();
+            let hash_set: BTreeSet<usize> = set.extract().unwrap();
+            assert_eq!(hash_set, [1, 2, 3, 4, 5].iter().copied().collect());
+
+            let set = PyFrozenSet::new_bound(py, &[1, 2, 3, 4, 5]).unwrap();
+            let hash_set: BTreeSet<usize> = set.extract().unwrap();
+            assert_eq!(hash_set, [1, 2, 3, 4, 5].iter().copied().collect());
+        });
+    }
+
+    #[test]
+    fn test_set_into_py() {
+        Python::with_gil(|py| {
+            let bt: BTreeSet<u64> = [1, 2, 3, 4, 5].iter().cloned().collect();
+            let hs: HashSet<u64> = [1, 2, 3, 4, 5].iter().cloned().collect();
+
+            let bto: PyObject = bt.clone().into_py(py);
+            let hso: PyObject = hs.clone().into_py(py);
+
+            assert_eq!(bt, bto.extract(py).unwrap());
+            assert_eq!(hs, hso.extract(py).unwrap());
+        });
+    }
+
+    #[test]
+    fn test_set_to_object() {
+        Python::with_gil(|py| {
+            let bt: BTreeSet<u64> = [1, 2, 3, 4, 5].iter().cloned().collect();
+            let hs: HashSet<u64> = [1, 2, 3, 4, 5].iter().cloned().collect();
+
+            let bto: PyObject = bt.to_object(py);
+            let hso: PyObject = hs.to_object(py);
+
+            assert_eq!(bt, bto.extract(py).unwrap());
+            assert_eq!(hs, hso.extract(py).unwrap());
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/std/slice.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/slice.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/std/slice.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/slice.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,135 @@
+use std::borrow::Cow;
+
+#[cfg(feature = "experimental-inspect")]
+use crate::inspect::types::TypeInfo;
+use crate::{
+    types::{PyByteArray, PyByteArrayMethods, PyBytes},
+    IntoPy, Py, PyAny, PyObject, PyResult, Python, ToPyObject,
+};
+
+impl<'a> IntoPy<PyObject> for &'a [u8] {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        PyBytes::new_bound(py, self).unbind().into()
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_output() -> TypeInfo {
+        TypeInfo::builtin("bytes")
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'py> crate::FromPyObject<'py> for &'py [u8] {
+    fn extract_bound(obj: &crate::Bound<'py, PyAny>) -> PyResult<Self> {
+        Ok(obj.clone().into_gil_ref().downcast::<PyBytes>()?.as_bytes())
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        Self::type_output()
+    }
+}
+
+#[cfg(not(feature = "gil-refs"))]
+impl<'a> crate::conversion::FromPyObjectBound<'a, '_> for &'a [u8] {
+    fn from_py_object_bound(obj: crate::Borrowed<'a, '_, PyAny>) -> PyResult<Self> {
+        Ok(obj.downcast::<PyBytes>()?.as_bytes())
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        Self::type_output()
+    }
+}
+
+/// Special-purpose trait impl to efficiently handle both `bytes` and `bytearray`
+///
+/// If the source object is a `bytes` object, the `Cow` will be borrowed and
+/// pointing into the source object, and no copying or heap allocations will happen.
+/// If it is a `bytearray`, its contents will be copied to an owned `Cow`.
+#[cfg(feature = "gil-refs")]
+impl<'py> crate::FromPyObject<'py> for Cow<'py, [u8]> {
+    fn extract_bound(ob: &crate::Bound<'py, PyAny>) -> PyResult<Self> {
+        use crate::types::PyAnyMethods;
+        if let Ok(bytes) = ob.downcast::<PyBytes>() {
+            return Ok(Cow::Borrowed(bytes.clone().into_gil_ref().as_bytes()));
+        }
+
+        let byte_array = ob.downcast::<PyByteArray>()?;
+        Ok(Cow::Owned(byte_array.to_vec()))
+    }
+}
+
+#[cfg(not(feature = "gil-refs"))]
+impl<'a> crate::conversion::FromPyObjectBound<'a, '_> for Cow<'a, [u8]> {
+    fn from_py_object_bound(ob: crate::Borrowed<'a, '_, PyAny>) -> PyResult<Self> {
+        if let Ok(bytes) = ob.downcast::<PyBytes>() {
+            return Ok(Cow::Borrowed(bytes.as_bytes()));
+        }
+
+        let byte_array = ob.downcast::<PyByteArray>()?;
+        Ok(Cow::Owned(byte_array.to_vec()))
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        Self::type_output()
+    }
+}
+
+impl ToPyObject for Cow<'_, [u8]> {
+    fn to_object(&self, py: Python<'_>) -> Py<PyAny> {
+        PyBytes::new_bound(py, self.as_ref()).into()
+    }
+}
+
+impl IntoPy<Py<PyAny>> for Cow<'_, [u8]> {
+    fn into_py(self, py: Python<'_>) -> Py<PyAny> {
+        self.to_object(py)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use std::borrow::Cow;
+
+    use crate::{
+        types::{any::PyAnyMethods, PyBytes},
+        Python, ToPyObject,
+    };
+
+    #[test]
+    fn test_extract_bytes() {
+        Python::with_gil(|py| {
+            let py_bytes = py.eval_bound("b'Hello Python'", None, None).unwrap();
+            let bytes: &[u8] = py_bytes.extract().unwrap();
+            assert_eq!(bytes, b"Hello Python");
+        });
+    }
+
+    #[test]
+    fn test_cow_impl() {
+        Python::with_gil(|py| {
+            let bytes = py.eval_bound(r#"b"foobar""#, None, None).unwrap();
+            let cow = bytes.extract::<Cow<'_, [u8]>>().unwrap();
+            assert_eq!(cow, Cow::<[u8]>::Borrowed(b"foobar"));
+
+            let byte_array = py
+                .eval_bound(r#"bytearray(b"foobar")"#, None, None)
+                .unwrap();
+            let cow = byte_array.extract::<Cow<'_, [u8]>>().unwrap();
+            assert_eq!(cow, Cow::<[u8]>::Owned(b"foobar".to_vec()));
+
+            let something_else_entirely = py.eval_bound("42", None, None).unwrap();
+            something_else_entirely
+                .extract::<Cow<'_, [u8]>>()
+                .unwrap_err();
+
+            let cow = Cow::<[u8]>::Borrowed(b"foobar").to_object(py);
+            assert!(cow.bind(py).is_instance_of::<PyBytes>());
+
+            let cow = Cow::<[u8]>::Owned(b"foobar".to_vec()).to_object(py);
+            assert!(cow.bind(py).is_instance_of::<PyBytes>());
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/std/string.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/string.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/std/string.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/string.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,295 @@
+use std::borrow::Cow;
+
+#[cfg(feature = "experimental-inspect")]
+use crate::inspect::types::TypeInfo;
+use crate::{
+    instance::Bound,
+    types::{any::PyAnyMethods, string::PyStringMethods, PyString},
+    FromPyObject, IntoPy, Py, PyAny, PyObject, PyResult, Python, ToPyObject,
+};
+
+/// Converts a Rust `str` to a Python object.
+/// See `PyString::new` for details on the conversion.
+impl ToPyObject for str {
+    #[inline]
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        PyString::new_bound(py, self).into()
+    }
+}
+
+impl<'a> IntoPy<PyObject> for &'a str {
+    #[inline]
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        PyString::new_bound(py, self).into()
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_output() -> TypeInfo {
+        <String>::type_output()
+    }
+}
+
+impl<'a> IntoPy<Py<PyString>> for &'a str {
+    #[inline]
+    fn into_py(self, py: Python<'_>) -> Py<PyString> {
+        PyString::new_bound(py, self).into()
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_output() -> TypeInfo {
+        <String>::type_output()
+    }
+}
+
+/// Converts a Rust `Cow<'_, str>` to a Python object.
+/// See `PyString::new` for details on the conversion.
+impl ToPyObject for Cow<'_, str> {
+    #[inline]
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        PyString::new_bound(py, self).into()
+    }
+}
+
+impl IntoPy<PyObject> for Cow<'_, str> {
+    #[inline]
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_object(py)
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_output() -> TypeInfo {
+        <String>::type_output()
+    }
+}
+
+/// Converts a Rust `String` to a Python object.
+/// See `PyString::new` for details on the conversion.
+impl ToPyObject for String {
+    #[inline]
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        PyString::new_bound(py, self).into()
+    }
+}
+
+impl ToPyObject for char {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        self.into_py(py)
+    }
+}
+
+impl IntoPy<PyObject> for char {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        let mut bytes = [0u8; 4];
+        PyString::new_bound(py, self.encode_utf8(&mut bytes)).into()
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_output() -> TypeInfo {
+        <String>::type_output()
+    }
+}
+
+impl IntoPy<PyObject> for String {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        PyString::new_bound(py, &self).into()
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_output() -> TypeInfo {
+        TypeInfo::builtin("str")
+    }
+}
+
+impl<'a> IntoPy<PyObject> for &'a String {
+    #[inline]
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        PyString::new_bound(py, self).into()
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_output() -> TypeInfo {
+        <String>::type_output()
+    }
+}
+
+/// Allows extracting strings from Python objects.
+/// Accepts Python `str` objects.
+#[cfg(feature = "gil-refs")]
+impl<'py> FromPyObject<'py> for &'py str {
+    fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self> {
+        ob.clone().into_gil_ref().downcast::<PyString>()?.to_str()
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        <String as crate::FromPyObject>::type_input()
+    }
+}
+
+#[cfg(all(not(feature = "gil-refs"), any(Py_3_10, not(Py_LIMITED_API))))]
+impl<'a> crate::conversion::FromPyObjectBound<'a, '_> for &'a str {
+    fn from_py_object_bound(ob: crate::Borrowed<'a, '_, PyAny>) -> PyResult<Self> {
+        ob.downcast::<PyString>()?.to_str()
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        <String as crate::FromPyObject>::type_input()
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'py> FromPyObject<'py> for Cow<'py, str> {
+    fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self> {
+        ob.extract().map(Cow::Owned)
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        <String as crate::FromPyObject>::type_input()
+    }
+}
+
+#[cfg(not(feature = "gil-refs"))]
+impl<'a> crate::conversion::FromPyObjectBound<'a, '_> for Cow<'a, str> {
+    fn from_py_object_bound(ob: crate::Borrowed<'a, '_, PyAny>) -> PyResult<Self> {
+        ob.downcast::<PyString>()?.to_cow()
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        <String as crate::FromPyObject>::type_input()
+    }
+}
+
+/// Allows extracting strings from Python objects.
+/// Accepts Python `str` and `unicode` objects.
+impl FromPyObject<'_> for String {
+    fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self> {
+        obj.downcast::<PyString>()?.to_cow().map(Cow::into_owned)
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        Self::type_output()
+    }
+}
+
+impl FromPyObject<'_> for char {
+    fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self> {
+        let s = obj.downcast::<PyString>()?.to_cow()?;
+        let mut iter = s.chars();
+        if let (Some(ch), None) = (iter.next(), iter.next()) {
+            Ok(ch)
+        } else {
+            Err(crate::exceptions::PyValueError::new_err(
+                "expected a string of length 1",
+            ))
+        }
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        <String>::type_input()
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::types::any::PyAnyMethods;
+    use crate::Python;
+    use crate::{IntoPy, PyObject, ToPyObject};
+    use std::borrow::Cow;
+
+    #[test]
+    fn test_cow_into_py() {
+        Python::with_gil(|py| {
+            let s = "Hello Python";
+            let py_string: PyObject = Cow::Borrowed(s).into_py(py);
+            assert_eq!(s, py_string.extract::<Cow<'_, str>>(py).unwrap());
+            let py_string: PyObject = Cow::<str>::Owned(s.into()).into_py(py);
+            assert_eq!(s, py_string.extract::<Cow<'_, str>>(py).unwrap());
+        })
+    }
+
+    #[test]
+    fn test_cow_to_object() {
+        Python::with_gil(|py| {
+            let s = "Hello Python";
+            let py_string = Cow::Borrowed(s).to_object(py);
+            assert_eq!(s, py_string.extract::<Cow<'_, str>>(py).unwrap());
+            let py_string = Cow::<str>::Owned(s.into()).to_object(py);
+            assert_eq!(s, py_string.extract::<Cow<'_, str>>(py).unwrap());
+        })
+    }
+
+    #[test]
+    fn test_non_bmp() {
+        Python::with_gil(|py| {
+            let s = "\u{1F30F}";
+            let py_string = s.to_object(py);
+            assert_eq!(s, py_string.extract::<String>(py).unwrap());
+        })
+    }
+
+    #[test]
+    fn test_extract_str() {
+        Python::with_gil(|py| {
+            let s = "Hello Python";
+            let py_string = s.to_object(py);
+
+            let s2: Cow<'_, str> = py_string.bind(py).extract().unwrap();
+            assert_eq!(s, s2);
+        })
+    }
+
+    #[test]
+    fn test_extract_char() {
+        Python::with_gil(|py| {
+            let ch = '😃';
+            let py_string = ch.to_object(py);
+            let ch2: char = py_string.bind(py).extract().unwrap();
+            assert_eq!(ch, ch2);
+        })
+    }
+
+    #[test]
+    fn test_extract_char_err() {
+        Python::with_gil(|py| {
+            let s = "Hello Python";
+            let py_string = s.to_object(py);
+            let err: crate::PyResult<char> = py_string.bind(py).extract();
+            assert!(err
+                .unwrap_err()
+                .to_string()
+                .contains("expected a string of length 1"));
+        })
+    }
+
+    #[test]
+    fn test_string_into_py() {
+        Python::with_gil(|py| {
+            let s = "Hello Python";
+            let s2 = s.to_owned();
+            let s3 = &s2;
+            assert_eq!(
+                s,
+                IntoPy::<PyObject>::into_py(s3, py)
+                    .extract::<Cow<'_, str>>(py)
+                    .unwrap()
+            );
+            assert_eq!(
+                s,
+                IntoPy::<PyObject>::into_py(s2, py)
+                    .extract::<Cow<'_, str>>(py)
+                    .unwrap()
+            );
+            assert_eq!(
+                s,
+                IntoPy::<PyObject>::into_py(s, py)
+                    .extract::<Cow<'_, str>>(py)
+                    .unwrap()
+            );
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/std/time.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/time.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/std/time.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/time.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,399 @@
+use crate::exceptions::{PyOverflowError, PyValueError};
+use crate::sync::GILOnceCell;
+use crate::types::any::PyAnyMethods;
+#[cfg(Py_LIMITED_API)]
+use crate::types::PyType;
+#[cfg(not(Py_LIMITED_API))]
+use crate::types::{timezone_utc_bound, PyDateTime, PyDelta, PyDeltaAccess};
+#[cfg(Py_LIMITED_API)]
+use crate::Py;
+use crate::{
+    intern, Bound, FromPyObject, IntoPy, PyAny, PyErr, PyObject, PyResult, Python, ToPyObject,
+};
+use std::time::{Duration, SystemTime, UNIX_EPOCH};
+
+const SECONDS_PER_DAY: u64 = 24 * 60 * 60;
+
+impl FromPyObject<'_> for Duration {
+    fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self> {
+        #[cfg(not(Py_LIMITED_API))]
+        let (days, seconds, microseconds) = {
+            let delta = obj.downcast::<PyDelta>()?;
+            (
+                delta.get_days(),
+                delta.get_seconds(),
+                delta.get_microseconds(),
+            )
+        };
+        #[cfg(Py_LIMITED_API)]
+        let (days, seconds, microseconds): (i32, i32, i32) = {
+            (
+                obj.getattr(intern!(obj.py(), "days"))?.extract()?,
+                obj.getattr(intern!(obj.py(), "seconds"))?.extract()?,
+                obj.getattr(intern!(obj.py(), "microseconds"))?.extract()?,
+            )
+        };
+
+        // We cast
+        let days = u64::try_from(days).map_err(|_| {
+            PyValueError::new_err(
+                "It is not possible to convert a negative timedelta to a Rust Duration",
+            )
+        })?;
+        let seconds = u64::try_from(seconds).unwrap(); // 0 <= seconds < 3600*24
+        let microseconds = u32::try_from(microseconds).unwrap(); // 0 <= microseconds < 1000000
+
+        // We convert
+        let total_seconds = days * SECONDS_PER_DAY + seconds; // We casted from i32, this can't overflow
+        let nanoseconds = microseconds.checked_mul(1_000).unwrap(); // 0 <= microseconds < 1000000
+
+        Ok(Duration::new(total_seconds, nanoseconds))
+    }
+}
+
+impl ToPyObject for Duration {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        let days = self.as_secs() / SECONDS_PER_DAY;
+        let seconds = self.as_secs() % SECONDS_PER_DAY;
+        let microseconds = self.subsec_micros();
+
+        #[cfg(not(Py_LIMITED_API))]
+        {
+            PyDelta::new_bound(
+                py,
+                days.try_into()
+                    .expect("Too large Rust duration for timedelta"),
+                seconds.try_into().unwrap(),
+                microseconds.try_into().unwrap(),
+                false,
+            )
+            .expect("failed to construct timedelta (overflow?)")
+            .into()
+        }
+        #[cfg(Py_LIMITED_API)]
+        {
+            static TIMEDELTA: GILOnceCell<Py<PyType>> = GILOnceCell::new();
+            TIMEDELTA
+                .get_or_try_init_type_ref(py, "datetime", "timedelta")
+                .unwrap()
+                .call1((days, seconds, microseconds))
+                .unwrap()
+                .into()
+        }
+    }
+}
+
+impl IntoPy<PyObject> for Duration {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_object(py)
+    }
+}
+
+// Conversions between SystemTime and datetime do not rely on the floating point timestamp of the
+// timestamp/fromtimestamp APIs to avoid possible precision loss but goes through the
+// timedelta/std::time::Duration types by taking for reference point the UNIX epoch.
+//
+// TODO: it might be nice to investigate using timestamps anyway, at least when the datetime is a safe range.
+
+impl FromPyObject<'_> for SystemTime {
+    fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self> {
+        let duration_since_unix_epoch: Duration = obj
+            .call_method1(intern!(obj.py(), "__sub__"), (unix_epoch_py(obj.py()),))?
+            .extract()?;
+        UNIX_EPOCH
+            .checked_add(duration_since_unix_epoch)
+            .ok_or_else(|| {
+                PyOverflowError::new_err("Overflow error when converting the time to Rust")
+            })
+    }
+}
+
+impl ToPyObject for SystemTime {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        let duration_since_unix_epoch = self.duration_since(UNIX_EPOCH).unwrap().into_py(py);
+        unix_epoch_py(py)
+            .call_method1(py, intern!(py, "__add__"), (duration_since_unix_epoch,))
+            .unwrap()
+    }
+}
+
+impl IntoPy<PyObject> for SystemTime {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_object(py)
+    }
+}
+
+fn unix_epoch_py(py: Python<'_>) -> &PyObject {
+    static UNIX_EPOCH: GILOnceCell<PyObject> = GILOnceCell::new();
+    UNIX_EPOCH
+        .get_or_try_init(py, || {
+            #[cfg(not(Py_LIMITED_API))]
+            {
+                Ok::<_, PyErr>(
+                    PyDateTime::new_bound(
+                        py,
+                        1970,
+                        1,
+                        1,
+                        0,
+                        0,
+                        0,
+                        0,
+                        Some(&timezone_utc_bound(py)),
+                    )?
+                    .into(),
+                )
+            }
+            #[cfg(Py_LIMITED_API)]
+            {
+                let datetime = py.import_bound("datetime")?;
+                let utc = datetime.getattr("timezone")?.getattr("utc")?;
+                Ok::<_, PyErr>(
+                    datetime
+                        .getattr("datetime")?
+                        .call1((1970, 1, 1, 0, 0, 0, 0, utc))
+                        .unwrap()
+                        .into(),
+                )
+            }
+        })
+        .unwrap()
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::types::PyDict;
+    use std::panic;
+
+    #[test]
+    fn test_duration_frompyobject() {
+        Python::with_gil(|py| {
+            assert_eq!(
+                new_timedelta(py, 0, 0, 0).extract::<Duration>().unwrap(),
+                Duration::new(0, 0)
+            );
+            assert_eq!(
+                new_timedelta(py, 1, 0, 0).extract::<Duration>().unwrap(),
+                Duration::new(86400, 0)
+            );
+            assert_eq!(
+                new_timedelta(py, 0, 1, 0).extract::<Duration>().unwrap(),
+                Duration::new(1, 0)
+            );
+            assert_eq!(
+                new_timedelta(py, 0, 0, 1).extract::<Duration>().unwrap(),
+                Duration::new(0, 1_000)
+            );
+            assert_eq!(
+                new_timedelta(py, 1, 1, 1).extract::<Duration>().unwrap(),
+                Duration::new(86401, 1_000)
+            );
+            assert_eq!(
+                timedelta_class(py)
+                    .getattr("max")
+                    .unwrap()
+                    .extract::<Duration>()
+                    .unwrap(),
+                Duration::new(86399999999999, 999999000)
+            );
+        });
+    }
+
+    #[test]
+    fn test_duration_frompyobject_negative() {
+        Python::with_gil(|py| {
+            assert_eq!(
+                new_timedelta(py, 0, -1, 0)
+                    .extract::<Duration>()
+                    .unwrap_err()
+                    .to_string(),
+                "ValueError: It is not possible to convert a negative timedelta to a Rust Duration"
+            );
+        })
+    }
+
+    #[test]
+    fn test_duration_topyobject() {
+        Python::with_gil(|py| {
+            let assert_eq = |l: PyObject, r: Bound<'_, PyAny>| {
+                assert!(l.bind(py).eq(r).unwrap());
+            };
+
+            assert_eq(
+                Duration::new(0, 0).to_object(py),
+                new_timedelta(py, 0, 0, 0),
+            );
+            assert_eq(
+                Duration::new(86400, 0).to_object(py),
+                new_timedelta(py, 1, 0, 0),
+            );
+            assert_eq(
+                Duration::new(1, 0).to_object(py),
+                new_timedelta(py, 0, 1, 0),
+            );
+            assert_eq(
+                Duration::new(0, 1_000).to_object(py),
+                new_timedelta(py, 0, 0, 1),
+            );
+            assert_eq(
+                Duration::new(0, 1).to_object(py),
+                new_timedelta(py, 0, 0, 0),
+            );
+            assert_eq(
+                Duration::new(86401, 1_000).to_object(py),
+                new_timedelta(py, 1, 1, 1),
+            );
+            assert_eq(
+                Duration::new(86399999999999, 999999000).to_object(py),
+                timedelta_class(py).getattr("max").unwrap(),
+            );
+        });
+    }
+
+    #[test]
+    fn test_duration_topyobject_overflow() {
+        Python::with_gil(|py| {
+            assert!(panic::catch_unwind(|| Duration::MAX.to_object(py)).is_err());
+        })
+    }
+
+    #[test]
+    fn test_time_frompyobject() {
+        Python::with_gil(|py| {
+            assert_eq!(
+                new_datetime(py, 1970, 1, 1, 0, 0, 0, 0)
+                    .extract::<SystemTime>()
+                    .unwrap(),
+                UNIX_EPOCH
+            );
+            assert_eq!(
+                new_datetime(py, 2020, 2, 3, 4, 5, 6, 7)
+                    .extract::<SystemTime>()
+                    .unwrap(),
+                UNIX_EPOCH
+                    .checked_add(Duration::new(1580702706, 7000))
+                    .unwrap()
+            );
+            assert_eq!(
+                max_datetime(py).extract::<SystemTime>().unwrap(),
+                UNIX_EPOCH
+                    .checked_add(Duration::new(253402300799, 999999000))
+                    .unwrap()
+            );
+        });
+    }
+
+    #[test]
+    fn test_time_frompyobject_before_epoch() {
+        Python::with_gil(|py| {
+            assert_eq!(
+                new_datetime(py, 1950, 1, 1, 0, 0, 0, 0)
+                    .extract::<SystemTime>()
+                    .unwrap_err()
+                    .to_string(),
+                "ValueError: It is not possible to convert a negative timedelta to a Rust Duration"
+            );
+        })
+    }
+
+    #[test]
+    fn test_time_topyobject() {
+        Python::with_gil(|py| {
+            let assert_eq = |l: PyObject, r: Bound<'_, PyAny>| {
+                assert!(l.bind(py).eq(r).unwrap());
+            };
+
+            assert_eq(
+                UNIX_EPOCH
+                    .checked_add(Duration::new(1580702706, 7123))
+                    .unwrap()
+                    .into_py(py),
+                new_datetime(py, 2020, 2, 3, 4, 5, 6, 7),
+            );
+            assert_eq(
+                UNIX_EPOCH
+                    .checked_add(Duration::new(253402300799, 999999000))
+                    .unwrap()
+                    .into_py(py),
+                max_datetime(py),
+            );
+        });
+    }
+
+    #[allow(clippy::too_many_arguments)]
+    fn new_datetime(
+        py: Python<'_>,
+        year: i32,
+        month: u8,
+        day: u8,
+        hour: u8,
+        minute: u8,
+        second: u8,
+        microsecond: u32,
+    ) -> Bound<'_, PyAny> {
+        datetime_class(py)
+            .call1((
+                year,
+                month,
+                day,
+                hour,
+                minute,
+                second,
+                microsecond,
+                tz_utc(py),
+            ))
+            .unwrap()
+    }
+
+    fn max_datetime(py: Python<'_>) -> Bound<'_, PyAny> {
+        let naive_max = datetime_class(py).getattr("max").unwrap();
+        let kargs = PyDict::new_bound(py);
+        kargs.set_item("tzinfo", tz_utc(py)).unwrap();
+        naive_max.call_method("replace", (), Some(&kargs)).unwrap()
+    }
+
+    #[test]
+    fn test_time_topyobject_overflow() {
+        let big_system_time = UNIX_EPOCH
+            .checked_add(Duration::new(300000000000, 0))
+            .unwrap();
+        Python::with_gil(|py| {
+            assert!(panic::catch_unwind(|| big_system_time.into_py(py)).is_err());
+        })
+    }
+
+    fn tz_utc(py: Python<'_>) -> Bound<'_, PyAny> {
+        py.import_bound("datetime")
+            .unwrap()
+            .getattr("timezone")
+            .unwrap()
+            .getattr("utc")
+            .unwrap()
+    }
+
+    fn new_timedelta(
+        py: Python<'_>,
+        days: i32,
+        seconds: i32,
+        microseconds: i32,
+    ) -> Bound<'_, PyAny> {
+        timedelta_class(py)
+            .call1((days, seconds, microseconds))
+            .unwrap()
+    }
+
+    fn datetime_class(py: Python<'_>) -> Bound<'_, PyAny> {
+        py.import_bound("datetime")
+            .unwrap()
+            .getattr("datetime")
+            .unwrap()
+    }
+
+    fn timedelta_class(py: Python<'_>) -> Bound<'_, PyAny> {
+        py.import_bound("datetime")
+            .unwrap()
+            .getattr("timedelta")
+            .unwrap()
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/conversions/std/vec.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/vec.rs
--- 43.0.0-1/rust-vendor/pyo3/src/conversions/std/vec.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/conversions/std/vec.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,40 @@
+#[cfg(feature = "experimental-inspect")]
+use crate::inspect::types::TypeInfo;
+use crate::types::list::new_from_iter;
+use crate::{IntoPy, PyObject, Python, ToPyObject};
+
+impl<T> ToPyObject for [T]
+where
+    T: ToPyObject,
+{
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        let mut iter = self.iter().map(|e| e.to_object(py));
+        let list = new_from_iter(py, &mut iter);
+        list.into()
+    }
+}
+
+impl<T> ToPyObject for Vec<T>
+where
+    T: ToPyObject,
+{
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        self.as_slice().to_object(py)
+    }
+}
+
+impl<T> IntoPy<PyObject> for Vec<T>
+where
+    T: IntoPy<PyObject>,
+{
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        let mut iter = self.into_iter().map(|e| e.into_py(py));
+        let list = new_from_iter(py, &mut iter);
+        list.into()
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_output() -> TypeInfo {
+        TypeInfo::list_of(T::type_output())
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/coroutine/cancel.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/coroutine/cancel.rs
--- 43.0.0-1/rust-vendor/pyo3/src/coroutine/cancel.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/coroutine/cancel.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,77 @@
+use crate::{Py, PyAny, PyObject};
+use std::future::Future;
+use std::pin::Pin;
+use std::sync::{Arc, Mutex};
+use std::task::{Context, Poll, Waker};
+
+#[derive(Debug, Default)]
+struct Inner {
+    exception: Option<PyObject>,
+    waker: Option<Waker>,
+}
+
+/// Helper used to wait and retrieve exception thrown in [`Coroutine`](super::Coroutine).
+///
+/// Only the last exception thrown can be retrieved.
+#[derive(Debug, Default)]
+pub struct CancelHandle(Arc<Mutex<Inner>>);
+
+impl CancelHandle {
+    /// Create a new `CoroutineCancel`.
+    pub fn new() -> Self {
+        Default::default()
+    }
+
+    /// Returns whether the associated coroutine has been cancelled.
+    pub fn is_cancelled(&self) -> bool {
+        self.0.lock().unwrap().exception.is_some()
+    }
+
+    /// Poll to retrieve the exception thrown in the associated coroutine.
+    pub fn poll_cancelled(&mut self, cx: &mut Context<'_>) -> Poll<PyObject> {
+        let mut inner = self.0.lock().unwrap();
+        if let Some(exc) = inner.exception.take() {
+            return Poll::Ready(exc);
+        }
+        if let Some(ref waker) = inner.waker {
+            if cx.waker().will_wake(waker) {
+                return Poll::Pending;
+            }
+        }
+        inner.waker = Some(cx.waker().clone());
+        Poll::Pending
+    }
+
+    /// Retrieve the exception thrown in the associated coroutine.
+    pub async fn cancelled(&mut self) -> PyObject {
+        Cancelled(self).await
+    }
+
+    #[doc(hidden)]
+    pub fn throw_callback(&self) -> ThrowCallback {
+        ThrowCallback(self.0.clone())
+    }
+}
+
+// Because `poll_fn` is not available in MSRV
+struct Cancelled<'a>(&'a mut CancelHandle);
+
+impl Future for Cancelled<'_> {
+    type Output = PyObject;
+    fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
+        self.0.poll_cancelled(cx)
+    }
+}
+
+#[doc(hidden)]
+pub struct ThrowCallback(Arc<Mutex<Inner>>);
+
+impl ThrowCallback {
+    pub(super) fn throw(&self, exc: Py<PyAny>) {
+        let mut inner = self.0.lock().unwrap();
+        inner.exception = Some(exc);
+        if let Some(waker) = inner.waker.take() {
+            waker.wake();
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/coroutine/waker.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/coroutine/waker.rs
--- 43.0.0-1/rust-vendor/pyo3/src/coroutine/waker.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/coroutine/waker.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,106 @@
+use crate::sync::GILOnceCell;
+use crate::types::any::PyAnyMethods;
+use crate::types::PyCFunction;
+use crate::{intern, wrap_pyfunction_bound, Bound, Py, PyAny, PyObject, PyResult, Python};
+use pyo3_macros::pyfunction;
+use std::sync::Arc;
+use std::task::Wake;
+
+/// Lazy `asyncio.Future` wrapper, implementing [`Wake`] by calling `Future.set_result`.
+///
+/// asyncio future is let uninitialized until [`initialize_future`][1] is called.
+/// If [`wake`][2] is called before future initialization (during Rust future polling),
+/// [`initialize_future`][1] will return `None` (it is roughly equivalent to `asyncio.sleep(0)`)
+///
+/// [1]: AsyncioWaker::initialize_future
+/// [2]: AsyncioWaker::wake
+pub struct AsyncioWaker(GILOnceCell<Option<LoopAndFuture>>);
+
+impl AsyncioWaker {
+    pub(super) fn new() -> Self {
+        Self(GILOnceCell::new())
+    }
+
+    pub(super) fn reset(&mut self) {
+        self.0.take();
+    }
+
+    pub(super) fn initialize_future<'py>(
+        &self,
+        py: Python<'py>,
+    ) -> PyResult<Option<&Bound<'py, PyAny>>> {
+        let init = || LoopAndFuture::new(py).map(Some);
+        let loop_and_future = self.0.get_or_try_init(py, init)?.as_ref();
+        Ok(loop_and_future.map(|LoopAndFuture { future, .. }| future.bind(py)))
+    }
+}
+
+impl Wake for AsyncioWaker {
+    fn wake(self: Arc<Self>) {
+        self.wake_by_ref()
+    }
+
+    fn wake_by_ref(self: &Arc<Self>) {
+        Python::with_gil(|gil| {
+            if let Some(loop_and_future) = self.0.get_or_init(gil, || None) {
+                loop_and_future
+                    .set_result(gil)
+                    .expect("unexpected error in coroutine waker");
+            }
+        });
+    }
+}
+
+struct LoopAndFuture {
+    event_loop: PyObject,
+    future: PyObject,
+}
+
+impl LoopAndFuture {
+    fn new(py: Python<'_>) -> PyResult<Self> {
+        static GET_RUNNING_LOOP: GILOnceCell<PyObject> = GILOnceCell::new();
+        let import = || -> PyResult<_> {
+            let module = py.import_bound("asyncio")?;
+            Ok(module.getattr("get_running_loop")?.into())
+        };
+        let event_loop = GET_RUNNING_LOOP.get_or_try_init(py, import)?.call0(py)?;
+        let future = event_loop.call_method0(py, "create_future")?;
+        Ok(Self { event_loop, future })
+    }
+
+    fn set_result(&self, py: Python<'_>) -> PyResult<()> {
+        static RELEASE_WAITER: GILOnceCell<Py<PyCFunction>> = GILOnceCell::new();
+        let release_waiter = RELEASE_WAITER.get_or_try_init(py, || {
+            wrap_pyfunction_bound!(release_waiter, py).map(Bound::unbind)
+        })?;
+        // `Future.set_result` must be called in event loop thread,
+        // so it requires `call_soon_threadsafe`
+        let call_soon_threadsafe = self.event_loop.call_method1(
+            py,
+            intern!(py, "call_soon_threadsafe"),
+            (release_waiter, self.future.bind(py)),
+        );
+        if let Err(err) = call_soon_threadsafe {
+            // `call_soon_threadsafe` will raise if the event loop is closed;
+            // instead of catching an unspecific `RuntimeError`, check directly if it's closed.
+            let is_closed = self.event_loop.call_method0(py, "is_closed")?;
+            if !is_closed.extract(py)? {
+                return Err(err);
+            }
+        }
+        Ok(())
+    }
+}
+
+/// Call `future.set_result` if the future is not done.
+///
+/// Future can be cancelled by the event loop before being waken.
+/// See <https://github.com/python/cpython/blob/main/Lib/asyncio/tasks.py#L452C5-L452C5>
+#[pyfunction(crate = "crate")]
+fn release_waiter(future: &Bound<'_, PyAny>) -> PyResult<()> {
+    let done = future.call_method0(intern!(future.py(), "done"))?;
+    if !done.extract::<bool>()? {
+        future.call_method1(intern!(future.py(), "set_result"), (future.py().None(),))?;
+    }
+    Ok(())
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/coroutine.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/coroutine.rs
--- 43.0.0-1/rust-vendor/pyo3/src/coroutine.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/coroutine.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,167 @@
+//! Python coroutine implementation, used notably when wrapping `async fn`
+//! with `#[pyfunction]`/`#[pymethods]`.
+use std::{
+    future::Future,
+    panic,
+    pin::Pin,
+    sync::Arc,
+    task::{Context, Poll, Waker},
+};
+
+use pyo3_macros::{pyclass, pymethods};
+
+use crate::{
+    coroutine::{cancel::ThrowCallback, waker::AsyncioWaker},
+    exceptions::{PyAttributeError, PyRuntimeError, PyStopIteration},
+    panic::PanicException,
+    types::{string::PyStringMethods, PyIterator, PyString},
+    Bound, IntoPy, Py, PyAny, PyErr, PyObject, PyResult, Python,
+};
+
+pub(crate) mod cancel;
+mod waker;
+
+pub use cancel::CancelHandle;
+
+const COROUTINE_REUSED_ERROR: &str = "cannot reuse already awaited coroutine";
+
+/// Python coroutine wrapping a [`Future`].
+#[pyclass(crate = "crate")]
+pub struct Coroutine {
+    name: Option<Py<PyString>>,
+    qualname_prefix: Option<&'static str>,
+    throw_callback: Option<ThrowCallback>,
+    future: Option<Pin<Box<dyn Future<Output = PyResult<PyObject>> + Send>>>,
+    waker: Option<Arc<AsyncioWaker>>,
+}
+
+impl Coroutine {
+    ///  Wrap a future into a Python coroutine.
+    ///
+    /// Coroutine `send` polls the wrapped future, ignoring the value passed
+    /// (should always be `None` anyway).
+    ///
+    /// `Coroutine `throw` drop the wrapped future and reraise the exception passed
+    pub(crate) fn new<F, T, E>(
+        name: Option<Py<PyString>>,
+        qualname_prefix: Option<&'static str>,
+        throw_callback: Option<ThrowCallback>,
+        future: F,
+    ) -> Self
+    where
+        F: Future<Output = Result<T, E>> + Send + 'static,
+        T: IntoPy<PyObject>,
+        E: Into<PyErr>,
+    {
+        let wrap = async move {
+            let obj = future.await.map_err(Into::into)?;
+            // SAFETY: GIL is acquired when future is polled (see `Coroutine::poll`)
+            Ok(obj.into_py(unsafe { Python::assume_gil_acquired() }))
+        };
+        Self {
+            name,
+            qualname_prefix,
+            throw_callback,
+            future: Some(Box::pin(wrap)),
+            waker: None,
+        }
+    }
+
+    fn poll(&mut self, py: Python<'_>, throw: Option<PyObject>) -> PyResult<PyObject> {
+        // raise if the coroutine has already been run to completion
+        let future_rs = match self.future {
+            Some(ref mut fut) => fut,
+            None => return Err(PyRuntimeError::new_err(COROUTINE_REUSED_ERROR)),
+        };
+        // reraise thrown exception it
+        match (throw, &self.throw_callback) {
+            (Some(exc), Some(cb)) => cb.throw(exc),
+            (Some(exc), None) => {
+                self.close();
+                return Err(PyErr::from_value_bound(exc.into_bound(py)));
+            }
+            (None, _) => {}
+        }
+        // create a new waker, or try to reset it in place
+        if let Some(waker) = self.waker.as_mut().and_then(Arc::get_mut) {
+            waker.reset();
+        } else {
+            self.waker = Some(Arc::new(AsyncioWaker::new()));
+        }
+        let waker = Waker::from(self.waker.clone().unwrap());
+        // poll the Rust future and forward its results if ready
+        // polling is UnwindSafe because the future is dropped in case of panic
+        let poll = || future_rs.as_mut().poll(&mut Context::from_waker(&waker));
+        match panic::catch_unwind(panic::AssertUnwindSafe(poll)) {
+            Ok(Poll::Ready(res)) => {
+                self.close();
+                return Err(PyStopIteration::new_err(res?));
+            }
+            Err(err) => {
+                self.close();
+                return Err(PanicException::from_panic_payload(err));
+            }
+            _ => {}
+        }
+        // otherwise, initialize the waker `asyncio.Future`
+        if let Some(future) = self.waker.as_ref().unwrap().initialize_future(py)? {
+            // `asyncio.Future` must be awaited; fortunately, it implements `__iter__ = __await__`
+            // and will yield itself if its result has not been set in polling above
+            if let Some(future) = PyIterator::from_bound_object(&future.as_borrowed())
+                .unwrap()
+                .next()
+            {
+                // future has not been leaked into Python for now, and Rust code can only call
+                // `set_result(None)` in `Wake` implementation, so it's safe to unwrap
+                return Ok(future.unwrap().into());
+            }
+        }
+        // if waker has been waken during future polling, this is roughly equivalent to
+        // `await asyncio.sleep(0)`, so just yield `None`.
+        Ok(py.None().into_py(py))
+    }
+}
+
+#[pymethods(crate = "crate")]
+impl Coroutine {
+    #[getter]
+    fn __name__(&self, py: Python<'_>) -> PyResult<Py<PyString>> {
+        match &self.name {
+            Some(name) => Ok(name.clone_ref(py)),
+            None => Err(PyAttributeError::new_err("__name__")),
+        }
+    }
+
+    #[getter]
+    fn __qualname__(&self, py: Python<'_>) -> PyResult<Py<PyString>> {
+        match (&self.name, &self.qualname_prefix) {
+            (Some(name), Some(prefix)) => Ok(format!("{}.{}", prefix, name.bind(py).to_cow()?)
+                .as_str()
+                .into_py(py)),
+            (Some(name), None) => Ok(name.clone_ref(py)),
+            (None, _) => Err(PyAttributeError::new_err("__qualname__")),
+        }
+    }
+
+    fn send(&mut self, py: Python<'_>, _value: &Bound<'_, PyAny>) -> PyResult<PyObject> {
+        self.poll(py, None)
+    }
+
+    fn throw(&mut self, py: Python<'_>, exc: PyObject) -> PyResult<PyObject> {
+        self.poll(py, Some(exc))
+    }
+
+    fn close(&mut self) {
+        // the Rust future is dropped, and the field set to `None`
+        // to indicate the coroutine has been run to completion
+        drop(self.future.take());
+    }
+
+    fn __await__(self_: Py<Self>) -> Py<Self> {
+        self_
+    }
+
+    fn __next__(&mut self, py: Python<'_>) -> PyResult<PyObject> {
+        self.poll(py, None)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/derive_utils.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/derive_utils.rs
--- 43.0.0-1/rust-vendor/pyo3/src/derive_utils.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/derive_utils.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,33 @@
+//! Functionality for the code generated by the derive backend
+
+use crate::{types::PyModule, Python};
+
+/// Enum to abstract over the arguments of Python function wrappers.
+pub enum PyFunctionArguments<'a> {
+    Python(Python<'a>),
+    PyModule(&'a PyModule),
+}
+
+impl<'a> PyFunctionArguments<'a> {
+    pub fn into_py_and_maybe_module(self) -> (Python<'a>, Option<&'a PyModule>) {
+        match self {
+            PyFunctionArguments::Python(py) => (py, None),
+            PyFunctionArguments::PyModule(module) => {
+                let py = crate::PyNativeType::py(module);
+                (py, Some(module))
+            }
+        }
+    }
+}
+
+impl<'a> From<Python<'a>> for PyFunctionArguments<'a> {
+    fn from(py: Python<'a>) -> PyFunctionArguments<'a> {
+        PyFunctionArguments::Python(py)
+    }
+}
+
+impl<'a> From<&'a PyModule> for PyFunctionArguments<'a> {
+    fn from(module: &'a PyModule) -> PyFunctionArguments<'a> {
+        PyFunctionArguments::PyModule(module)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/err/err_state.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/err/err_state.rs
--- 43.0.0-1/rust-vendor/pyo3/src/err/err_state.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/err/err_state.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,249 @@
+use crate::{
+    exceptions::{PyBaseException, PyTypeError},
+    ffi,
+    types::{PyTraceback, PyType},
+    Bound, IntoPy, Py, PyAny, PyObject, PyTypeInfo, Python,
+};
+
+pub(crate) struct PyErrStateNormalized {
+    #[cfg(not(Py_3_12))]
+    ptype: Py<PyType>,
+    pub pvalue: Py<PyBaseException>,
+    #[cfg(not(Py_3_12))]
+    ptraceback: Option<Py<PyTraceback>>,
+}
+
+impl PyErrStateNormalized {
+    #[cfg(not(Py_3_12))]
+    pub(crate) fn ptype<'py>(&self, py: Python<'py>) -> Bound<'py, PyType> {
+        self.ptype.bind(py).clone()
+    }
+
+    #[cfg(Py_3_12)]
+    pub(crate) fn ptype<'py>(&self, py: Python<'py>) -> Bound<'py, PyType> {
+        use crate::types::any::PyAnyMethods;
+        self.pvalue.bind(py).get_type()
+    }
+
+    #[cfg(not(Py_3_12))]
+    pub(crate) fn ptraceback<'py>(&self, py: Python<'py>) -> Option<Bound<'py, PyTraceback>> {
+        self.ptraceback
+            .as_ref()
+            .map(|traceback| traceback.bind(py).clone())
+    }
+
+    #[cfg(Py_3_12)]
+    pub(crate) fn ptraceback<'py>(&self, py: Python<'py>) -> Option<Bound<'py, PyTraceback>> {
+        use crate::ffi_ptr_ext::FfiPtrExt;
+        use crate::types::any::PyAnyMethods;
+        unsafe {
+            ffi::PyException_GetTraceback(self.pvalue.as_ptr())
+                .assume_owned_or_opt(py)
+                .map(|b| b.downcast_into_unchecked())
+        }
+    }
+
+    #[cfg(Py_3_12)]
+    pub(crate) fn take(py: Python<'_>) -> Option<PyErrStateNormalized> {
+        unsafe { Py::from_owned_ptr_or_opt(py, ffi::PyErr_GetRaisedException()) }
+            .map(|pvalue| PyErrStateNormalized { pvalue })
+    }
+
+    #[cfg(not(Py_3_12))]
+    unsafe fn from_normalized_ffi_tuple(
+        py: Python<'_>,
+        ptype: *mut ffi::PyObject,
+        pvalue: *mut ffi::PyObject,
+        ptraceback: *mut ffi::PyObject,
+    ) -> Self {
+        PyErrStateNormalized {
+            ptype: Py::from_owned_ptr_or_opt(py, ptype).expect("Exception type missing"),
+            pvalue: Py::from_owned_ptr_or_opt(py, pvalue).expect("Exception value missing"),
+            ptraceback: Py::from_owned_ptr_or_opt(py, ptraceback),
+        }
+    }
+
+    pub fn clone_ref(&self, py: Python<'_>) -> Self {
+        Self {
+            #[cfg(not(Py_3_12))]
+            ptype: self.ptype.clone_ref(py),
+            pvalue: self.pvalue.clone_ref(py),
+            #[cfg(not(Py_3_12))]
+            ptraceback: self
+                .ptraceback
+                .as_ref()
+                .map(|ptraceback| ptraceback.clone_ref(py)),
+        }
+    }
+}
+
+pub(crate) struct PyErrStateLazyFnOutput {
+    pub(crate) ptype: PyObject,
+    pub(crate) pvalue: PyObject,
+}
+
+pub(crate) type PyErrStateLazyFn =
+    dyn for<'py> FnOnce(Python<'py>) -> PyErrStateLazyFnOutput + Send + Sync;
+
+pub(crate) enum PyErrState {
+    Lazy(Box<PyErrStateLazyFn>),
+    #[cfg(not(Py_3_12))]
+    FfiTuple {
+        ptype: PyObject,
+        pvalue: Option<PyObject>,
+        ptraceback: Option<PyObject>,
+    },
+    Normalized(PyErrStateNormalized),
+}
+
+/// Helper conversion trait that allows to use custom arguments for lazy exception construction.
+pub trait PyErrArguments: Send + Sync {
+    /// Arguments for exception
+    fn arguments(self, py: Python<'_>) -> PyObject;
+}
+
+impl<T> PyErrArguments for T
+where
+    T: IntoPy<PyObject> + Send + Sync,
+{
+    fn arguments(self, py: Python<'_>) -> PyObject {
+        self.into_py(py)
+    }
+}
+
+impl PyErrState {
+    pub(crate) fn lazy(ptype: Py<PyAny>, args: impl PyErrArguments + 'static) -> Self {
+        PyErrState::Lazy(Box::new(move |py| PyErrStateLazyFnOutput {
+            ptype,
+            pvalue: args.arguments(py),
+        }))
+    }
+
+    pub(crate) fn normalized(pvalue: Bound<'_, PyBaseException>) -> Self {
+        #[cfg(not(Py_3_12))]
+        use crate::types::any::PyAnyMethods;
+
+        Self::Normalized(PyErrStateNormalized {
+            #[cfg(not(Py_3_12))]
+            ptype: pvalue.get_type().into(),
+            #[cfg(not(Py_3_12))]
+            ptraceback: unsafe {
+                Py::from_owned_ptr_or_opt(
+                    pvalue.py(),
+                    ffi::PyException_GetTraceback(pvalue.as_ptr()),
+                )
+            },
+            pvalue: pvalue.into(),
+        })
+    }
+
+    pub(crate) fn normalize(self, py: Python<'_>) -> PyErrStateNormalized {
+        match self {
+            #[cfg(not(Py_3_12))]
+            PyErrState::Lazy(lazy) => {
+                let (ptype, pvalue, ptraceback) = lazy_into_normalized_ffi_tuple(py, lazy);
+                unsafe {
+                    PyErrStateNormalized::from_normalized_ffi_tuple(py, ptype, pvalue, ptraceback)
+                }
+            }
+            #[cfg(Py_3_12)]
+            PyErrState::Lazy(lazy) => {
+                // To keep the implementation simple, just write the exception into the interpreter,
+                // which will cause it to be normalized
+                raise_lazy(py, lazy);
+                PyErrStateNormalized::take(py)
+                    .expect("exception missing after writing to the interpreter")
+            }
+            #[cfg(not(Py_3_12))]
+            PyErrState::FfiTuple {
+                ptype,
+                pvalue,
+                ptraceback,
+            } => {
+                let mut ptype = ptype.into_ptr();
+                let mut pvalue = pvalue.map_or(std::ptr::null_mut(), Py::into_ptr);
+                let mut ptraceback = ptraceback.map_or(std::ptr::null_mut(), Py::into_ptr);
+                unsafe {
+                    ffi::PyErr_NormalizeException(&mut ptype, &mut pvalue, &mut ptraceback);
+                    PyErrStateNormalized::from_normalized_ffi_tuple(py, ptype, pvalue, ptraceback)
+                }
+            }
+            PyErrState::Normalized(normalized) => normalized,
+        }
+    }
+
+    #[cfg(not(Py_3_12))]
+    pub(crate) fn restore(self, py: Python<'_>) {
+        let (ptype, pvalue, ptraceback) = match self {
+            PyErrState::Lazy(lazy) => lazy_into_normalized_ffi_tuple(py, lazy),
+            PyErrState::FfiTuple {
+                ptype,
+                pvalue,
+                ptraceback,
+            } => (
+                ptype.into_ptr(),
+                pvalue.map_or(std::ptr::null_mut(), Py::into_ptr),
+                ptraceback.map_or(std::ptr::null_mut(), Py::into_ptr),
+            ),
+            PyErrState::Normalized(PyErrStateNormalized {
+                ptype,
+                pvalue,
+                ptraceback,
+            }) => (
+                ptype.into_ptr(),
+                pvalue.into_ptr(),
+                ptraceback.map_or(std::ptr::null_mut(), Py::into_ptr),
+            ),
+        };
+        unsafe { ffi::PyErr_Restore(ptype, pvalue, ptraceback) }
+    }
+
+    #[cfg(Py_3_12)]
+    pub(crate) fn restore(self, py: Python<'_>) {
+        match self {
+            PyErrState::Lazy(lazy) => raise_lazy(py, lazy),
+            PyErrState::Normalized(PyErrStateNormalized { pvalue }) => unsafe {
+                ffi::PyErr_SetRaisedException(pvalue.into_ptr())
+            },
+        }
+    }
+}
+
+#[cfg(not(Py_3_12))]
+fn lazy_into_normalized_ffi_tuple(
+    py: Python<'_>,
+    lazy: Box<PyErrStateLazyFn>,
+) -> (*mut ffi::PyObject, *mut ffi::PyObject, *mut ffi::PyObject) {
+    // To be consistent with 3.12 logic, go via raise_lazy, but also then normalize
+    // the resulting exception
+    raise_lazy(py, lazy);
+    let mut ptype = std::ptr::null_mut();
+    let mut pvalue = std::ptr::null_mut();
+    let mut ptraceback = std::ptr::null_mut();
+    unsafe {
+        ffi::PyErr_Fetch(&mut ptype, &mut pvalue, &mut ptraceback);
+        ffi::PyErr_NormalizeException(&mut ptype, &mut pvalue, &mut ptraceback);
+    }
+    (ptype, pvalue, ptraceback)
+}
+
+/// Raises a "lazy" exception state into the Python interpreter.
+///
+/// In principle this could be split in two; first a function to create an exception
+/// in a normalized state, and then a call to `PyErr_SetRaisedException` to raise it.
+///
+/// This would require either moving some logic from C to Rust, or requesting a new
+/// API in CPython.
+fn raise_lazy(py: Python<'_>, lazy: Box<PyErrStateLazyFn>) {
+    let PyErrStateLazyFnOutput { ptype, pvalue } = lazy(py);
+    unsafe {
+        if ffi::PyExceptionClass_Check(ptype.as_ptr()) == 0 {
+            ffi::PyErr_SetString(
+                PyTypeError::type_object_raw(py).cast(),
+                ffi::c_str!("exceptions must derive from BaseException").as_ptr(),
+            )
+        } else {
+            ffi::PyErr_SetObject(ptype.as_ptr(), pvalue.as_ptr())
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/err/impls.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/err/impls.rs
--- 43.0.0-1/rust-vendor/pyo3/src/err/impls.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/err/impls.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,160 @@
+use crate::{err::PyErrArguments, exceptions, IntoPy, PyErr, PyObject, Python};
+use std::io;
+
+/// Convert `PyErr` to `io::Error`
+impl From<PyErr> for io::Error {
+    fn from(err: PyErr) -> Self {
+        let kind = Python::with_gil(|py| {
+            if err.is_instance_of::<exceptions::PyBrokenPipeError>(py) {
+                io::ErrorKind::BrokenPipe
+            } else if err.is_instance_of::<exceptions::PyConnectionRefusedError>(py) {
+                io::ErrorKind::ConnectionRefused
+            } else if err.is_instance_of::<exceptions::PyConnectionAbortedError>(py) {
+                io::ErrorKind::ConnectionAborted
+            } else if err.is_instance_of::<exceptions::PyConnectionResetError>(py) {
+                io::ErrorKind::ConnectionReset
+            } else if err.is_instance_of::<exceptions::PyInterruptedError>(py) {
+                io::ErrorKind::Interrupted
+            } else if err.is_instance_of::<exceptions::PyFileNotFoundError>(py) {
+                io::ErrorKind::NotFound
+            } else if err.is_instance_of::<exceptions::PyPermissionError>(py) {
+                io::ErrorKind::PermissionDenied
+            } else if err.is_instance_of::<exceptions::PyFileExistsError>(py) {
+                io::ErrorKind::AlreadyExists
+            } else if err.is_instance_of::<exceptions::PyBlockingIOError>(py) {
+                io::ErrorKind::WouldBlock
+            } else if err.is_instance_of::<exceptions::PyTimeoutError>(py) {
+                io::ErrorKind::TimedOut
+            } else {
+                io::ErrorKind::Other
+            }
+        });
+        io::Error::new(kind, err)
+    }
+}
+
+/// Create `PyErr` from `io::Error`
+/// (`OSError` except if the `io::Error` is wrapping a Python exception,
+/// in this case the exception is returned)
+impl From<io::Error> for PyErr {
+    fn from(err: io::Error) -> PyErr {
+        // If the error wraps a Python error we return it
+        if err.get_ref().map_or(false, |e| e.is::<PyErr>()) {
+            return *err.into_inner().unwrap().downcast().unwrap();
+        }
+        match err.kind() {
+            io::ErrorKind::BrokenPipe => exceptions::PyBrokenPipeError::new_err(err),
+            io::ErrorKind::ConnectionRefused => exceptions::PyConnectionRefusedError::new_err(err),
+            io::ErrorKind::ConnectionAborted => exceptions::PyConnectionAbortedError::new_err(err),
+            io::ErrorKind::ConnectionReset => exceptions::PyConnectionResetError::new_err(err),
+            io::ErrorKind::Interrupted => exceptions::PyInterruptedError::new_err(err),
+            io::ErrorKind::NotFound => exceptions::PyFileNotFoundError::new_err(err),
+            io::ErrorKind::PermissionDenied => exceptions::PyPermissionError::new_err(err),
+            io::ErrorKind::AlreadyExists => exceptions::PyFileExistsError::new_err(err),
+            io::ErrorKind::WouldBlock => exceptions::PyBlockingIOError::new_err(err),
+            io::ErrorKind::TimedOut => exceptions::PyTimeoutError::new_err(err),
+            _ => exceptions::PyOSError::new_err(err),
+        }
+    }
+}
+
+impl PyErrArguments for io::Error {
+    fn arguments(self, py: Python<'_>) -> PyObject {
+        self.to_string().into_py(py)
+    }
+}
+
+impl<W> From<io::IntoInnerError<W>> for PyErr {
+    fn from(err: io::IntoInnerError<W>) -> PyErr {
+        err.into_error().into()
+    }
+}
+
+impl<W: Send + Sync> PyErrArguments for io::IntoInnerError<W> {
+    fn arguments(self, py: Python<'_>) -> PyObject {
+        self.into_error().arguments(py)
+    }
+}
+
+impl From<std::convert::Infallible> for PyErr {
+    fn from(_: std::convert::Infallible) -> PyErr {
+        unreachable!()
+    }
+}
+
+macro_rules! impl_to_pyerr {
+    ($err: ty, $pyexc: ty) => {
+        impl PyErrArguments for $err {
+            fn arguments(self, py: Python<'_>) -> PyObject {
+                self.to_string().into_py(py)
+            }
+        }
+
+        impl std::convert::From<$err> for PyErr {
+            fn from(err: $err) -> PyErr {
+                <$pyexc>::new_err(err)
+            }
+        }
+    };
+}
+
+impl_to_pyerr!(std::array::TryFromSliceError, exceptions::PyValueError);
+impl_to_pyerr!(std::num::ParseIntError, exceptions::PyValueError);
+impl_to_pyerr!(std::num::ParseFloatError, exceptions::PyValueError);
+impl_to_pyerr!(std::num::TryFromIntError, exceptions::PyValueError);
+impl_to_pyerr!(std::str::ParseBoolError, exceptions::PyValueError);
+impl_to_pyerr!(std::ffi::IntoStringError, exceptions::PyUnicodeDecodeError);
+impl_to_pyerr!(std::ffi::NulError, exceptions::PyValueError);
+impl_to_pyerr!(std::str::Utf8Error, exceptions::PyUnicodeDecodeError);
+impl_to_pyerr!(std::string::FromUtf8Error, exceptions::PyUnicodeDecodeError);
+impl_to_pyerr!(
+    std::string::FromUtf16Error,
+    exceptions::PyUnicodeDecodeError
+);
+impl_to_pyerr!(
+    std::char::DecodeUtf16Error,
+    exceptions::PyUnicodeDecodeError
+);
+impl_to_pyerr!(std::net::AddrParseError, exceptions::PyValueError);
+
+#[cfg(test)]
+mod tests {
+    use crate::{PyErr, Python};
+    use std::io;
+
+    #[test]
+    fn io_errors() {
+        use crate::types::any::PyAnyMethods;
+
+        let check_err = |kind, expected_ty| {
+            Python::with_gil(|py| {
+                let rust_err = io::Error::new(kind, "some error msg");
+
+                let py_err: PyErr = rust_err.into();
+                let py_err_msg = format!("{}: some error msg", expected_ty);
+                assert_eq!(py_err.to_string(), py_err_msg);
+                let py_error_clone = py_err.clone_ref(py);
+
+                let rust_err_from_py_err: io::Error = py_err.into();
+                assert_eq!(rust_err_from_py_err.to_string(), py_err_msg);
+                assert_eq!(rust_err_from_py_err.kind(), kind);
+
+                let py_err_recovered_from_rust_err: PyErr = rust_err_from_py_err.into();
+                assert!(py_err_recovered_from_rust_err
+                    .value_bound(py)
+                    .is(py_error_clone.value_bound(py))); // It should be the same exception
+            })
+        };
+
+        check_err(io::ErrorKind::BrokenPipe, "BrokenPipeError");
+        check_err(io::ErrorKind::ConnectionRefused, "ConnectionRefusedError");
+        check_err(io::ErrorKind::ConnectionAborted, "ConnectionAbortedError");
+        check_err(io::ErrorKind::ConnectionReset, "ConnectionResetError");
+        check_err(io::ErrorKind::Interrupted, "InterruptedError");
+        check_err(io::ErrorKind::NotFound, "FileNotFoundError");
+        check_err(io::ErrorKind::PermissionDenied, "PermissionError");
+        check_err(io::ErrorKind::AlreadyExists, "FileExistsError");
+        check_err(io::ErrorKind::WouldBlock, "BlockingIOError");
+        check_err(io::ErrorKind::TimedOut, "TimeoutError");
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/err/mod.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/err/mod.rs
--- 43.0.0-1/rust-vendor/pyo3/src/err/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/err/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1370 @@
+use crate::instance::Bound;
+use crate::panic::PanicException;
+use crate::type_object::PyTypeInfo;
+use crate::types::any::PyAnyMethods;
+use crate::types::{string::PyStringMethods, typeobject::PyTypeMethods, PyTraceback, PyType};
+#[cfg(feature = "gil-refs")]
+use crate::PyNativeType;
+use crate::{
+    exceptions::{self, PyBaseException},
+    ffi,
+};
+use crate::{Borrowed, IntoPy, Py, PyAny, PyObject, Python, ToPyObject};
+use std::borrow::Cow;
+use std::cell::UnsafeCell;
+use std::ffi::CString;
+
+mod err_state;
+mod impls;
+
+pub use err_state::PyErrArguments;
+use err_state::{PyErrState, PyErrStateLazyFnOutput, PyErrStateNormalized};
+
+/// Represents a Python exception.
+///
+/// To avoid needing access to [`Python`] in `Into` conversions to create `PyErr` (thus improving
+/// compatibility with `?` and other Rust errors) this type supports creating exceptions instances
+/// in a lazy fashion, where the full Python object for the exception is created only when needed.
+///
+/// Accessing the contained exception in any way, such as with [`value_bound`](PyErr::value_bound),
+/// [`get_type_bound`](PyErr::get_type_bound), or [`is_instance_bound`](PyErr::is_instance_bound)
+/// will create the full exception object if it was not already created.
+pub struct PyErr {
+    // Safety: can only hand out references when in the "normalized" state. Will never change
+    // after normalization.
+    //
+    // The state is temporarily removed from the PyErr during normalization, to avoid
+    // concurrent modifications.
+    state: UnsafeCell<Option<PyErrState>>,
+}
+
+// The inner value is only accessed through ways that require proving the gil is held
+#[cfg(feature = "nightly")]
+unsafe impl crate::marker::Ungil for PyErr {}
+unsafe impl Send for PyErr {}
+unsafe impl Sync for PyErr {}
+
+/// Represents the result of a Python call.
+pub type PyResult<T> = Result<T, PyErr>;
+
+/// Error that indicates a failure to convert a PyAny to a more specific Python type.
+#[derive(Debug)]
+#[cfg(feature = "gil-refs")]
+pub struct PyDowncastError<'a> {
+    from: &'a PyAny,
+    to: Cow<'static, str>,
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'a> PyDowncastError<'a> {
+    /// Create a new `PyDowncastError` representing a failure to convert the object
+    /// `from` into the type named in `to`.
+    pub fn new(from: &'a PyAny, to: impl Into<Cow<'static, str>>) -> Self {
+        PyDowncastError {
+            from,
+            to: to.into(),
+        }
+    }
+
+    /// Compatibility API to convert the Bound variant `DowncastError` into the
+    /// gil-ref variant
+    pub(crate) fn from_downcast_err(DowncastError { from, to }: DowncastError<'a, 'a>) -> Self {
+        #[allow(deprecated)]
+        let from = unsafe { from.py().from_borrowed_ptr(from.as_ptr()) };
+        Self { from, to }
+    }
+}
+
+/// Error that indicates a failure to convert a PyAny to a more specific Python type.
+#[derive(Debug)]
+pub struct DowncastError<'a, 'py> {
+    from: Borrowed<'a, 'py, PyAny>,
+    to: Cow<'static, str>,
+}
+
+impl<'a, 'py> DowncastError<'a, 'py> {
+    /// Create a new `PyDowncastError` representing a failure to convert the object
+    /// `from` into the type named in `to`.
+    pub fn new(from: &'a Bound<'py, PyAny>, to: impl Into<Cow<'static, str>>) -> Self {
+        DowncastError {
+            from: from.as_borrowed(),
+            to: to.into(),
+        }
+    }
+    #[cfg(not(feature = "gil-refs"))]
+    pub(crate) fn new_from_borrowed(
+        from: Borrowed<'a, 'py, PyAny>,
+        to: impl Into<Cow<'static, str>>,
+    ) -> Self {
+        DowncastError {
+            from,
+            to: to.into(),
+        }
+    }
+}
+
+/// Error that indicates a failure to convert a PyAny to a more specific Python type.
+#[derive(Debug)]
+pub struct DowncastIntoError<'py> {
+    from: Bound<'py, PyAny>,
+    to: Cow<'static, str>,
+}
+
+impl<'py> DowncastIntoError<'py> {
+    /// Create a new `DowncastIntoError` representing a failure to convert the object
+    /// `from` into the type named in `to`.
+    pub fn new(from: Bound<'py, PyAny>, to: impl Into<Cow<'static, str>>) -> Self {
+        DowncastIntoError {
+            from,
+            to: to.into(),
+        }
+    }
+
+    /// Consumes this `DowncastIntoError` and returns the original object, allowing continued
+    /// use of it after a failed conversion.
+    ///
+    /// See [`downcast_into`][PyAnyMethods::downcast_into] for an example.
+    pub fn into_inner(self) -> Bound<'py, PyAny> {
+        self.from
+    }
+}
+
+impl PyErr {
+    /// Creates a new PyErr of type `T`.
+    ///
+    /// `args` can be:
+    /// * a tuple: the exception instance will be created using the equivalent to the Python
+    ///   expression `T(*tuple)`
+    /// * any other value: the exception instance will be created using the equivalent to the Python
+    ///   expression `T(value)`
+    ///
+    /// This exception instance will be initialized lazily. This avoids the need for the Python GIL
+    /// to be held, but requires `args` to be `Send` and `Sync`. If `args` is not `Send` or `Sync`,
+    /// consider using [`PyErr::from_value_bound`] instead.
+    ///
+    /// If `T` does not inherit from `BaseException`, then a `TypeError` will be returned.
+    ///
+    /// If calling T's constructor with `args` raises an exception, that exception will be returned.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use pyo3::prelude::*;
+    /// use pyo3::exceptions::PyTypeError;
+    ///
+    /// #[pyfunction]
+    /// fn always_throws() -> PyResult<()> {
+    ///     Err(PyErr::new::<PyTypeError, _>("Error message"))
+    /// }
+    /// #
+    /// # Python::with_gil(|py| {
+    /// #     let fun = pyo3::wrap_pyfunction_bound!(always_throws, py).unwrap();
+    /// #     let err = fun.call0().expect_err("called a function that should always return an error but the return value was Ok");
+    /// #     assert!(err.is_instance_of::<PyTypeError>(py))
+    /// # });
+    /// ```
+    ///
+    /// In most cases, you can use a concrete exception's constructor instead:
+    ///
+    /// ```
+    /// use pyo3::prelude::*;
+    /// use pyo3::exceptions::PyTypeError;
+    ///
+    /// #[pyfunction]
+    /// fn always_throws() -> PyResult<()> {
+    ///     Err(PyTypeError::new_err("Error message"))
+    /// }
+    /// #
+    /// # Python::with_gil(|py| {
+    /// #     let fun = pyo3::wrap_pyfunction_bound!(always_throws, py).unwrap();
+    /// #     let err = fun.call0().expect_err("called a function that should always return an error but the return value was Ok");
+    /// #     assert!(err.is_instance_of::<PyTypeError>(py))
+    /// # });
+    /// ```
+    #[inline]
+    pub fn new<T, A>(args: A) -> PyErr
+    where
+        T: PyTypeInfo,
+        A: PyErrArguments + Send + Sync + 'static,
+    {
+        PyErr::from_state(PyErrState::Lazy(Box::new(move |py| {
+            PyErrStateLazyFnOutput {
+                ptype: T::type_object_bound(py).into(),
+                pvalue: args.arguments(py),
+            }
+        })))
+    }
+
+    /// Deprecated form of [`PyErr::from_type_bound`]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyErr::from_type` will be replaced by `PyErr::from_type_bound` in a future PyO3 version"
+    )]
+    pub fn from_type<A>(ty: &PyType, args: A) -> PyErr
+    where
+        A: PyErrArguments + Send + Sync + 'static,
+    {
+        PyErr::from_state(PyErrState::lazy(ty.into(), args))
+    }
+
+    /// Constructs a new PyErr from the given Python type and arguments.
+    ///
+    /// `ty` is the exception type; usually one of the standard exceptions
+    /// like `exceptions::PyRuntimeError`.
+    ///
+    /// `args` is either a tuple or a single value, with the same meaning as in [`PyErr::new`].
+    ///
+    /// If `ty` does not inherit from `BaseException`, then a `TypeError` will be returned.
+    ///
+    /// If calling `ty` with `args` raises an exception, that exception will be returned.
+    pub fn from_type_bound<A>(ty: Bound<'_, PyType>, args: A) -> PyErr
+    where
+        A: PyErrArguments + Send + Sync + 'static,
+    {
+        PyErr::from_state(PyErrState::lazy(ty.unbind().into_any(), args))
+    }
+
+    /// Deprecated form of [`PyErr::from_value_bound`].
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyErr::from_value` will be replaced by `PyErr::from_value_bound` in a future PyO3 version"
+    )]
+    pub fn from_value(obj: &PyAny) -> PyErr {
+        PyErr::from_value_bound(obj.as_borrowed().to_owned())
+    }
+
+    /// Creates a new PyErr.
+    ///
+    /// If `obj` is a Python exception object, the PyErr will contain that object.
+    ///
+    /// If `obj` is a Python exception type object, this is equivalent to `PyErr::from_type(obj, ())`.
+    ///
+    /// Otherwise, a `TypeError` is created.
+    ///
+    /// # Examples
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::PyTypeInfo;
+    /// use pyo3::exceptions::PyTypeError;
+    /// use pyo3::types::PyString;
+    ///
+    /// Python::with_gil(|py| {
+    ///     // Case #1: Exception object
+    ///     let err = PyErr::from_value_bound(PyTypeError::new_err("some type error")
+    ///         .value_bound(py).clone().into_any());
+    ///     assert_eq!(err.to_string(), "TypeError: some type error");
+    ///
+    ///     // Case #2: Exception type
+    ///     let err = PyErr::from_value_bound(PyTypeError::type_object_bound(py).into_any());
+    ///     assert_eq!(err.to_string(), "TypeError: ");
+    ///
+    ///     // Case #3: Invalid exception value
+    ///     let err = PyErr::from_value_bound(PyString::new_bound(py, "foo").into_any());
+    ///     assert_eq!(
+    ///         err.to_string(),
+    ///         "TypeError: exceptions must derive from BaseException"
+    ///     );
+    /// });
+    /// ```
+    pub fn from_value_bound(obj: Bound<'_, PyAny>) -> PyErr {
+        let state = match obj.downcast_into::<PyBaseException>() {
+            Ok(obj) => PyErrState::normalized(obj),
+            Err(err) => {
+                // Assume obj is Type[Exception]; let later normalization handle if this
+                // is not the case
+                let obj = err.into_inner();
+                let py = obj.py();
+                PyErrState::lazy(obj.into_py(py), py.None())
+            }
+        };
+
+        PyErr::from_state(state)
+    }
+
+    /// Deprecated form of [`PyErr::get_type_bound`].
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyErr::get_type` will be replaced by `PyErr::get_type_bound` in a future PyO3 version"
+    )]
+    pub fn get_type<'py>(&'py self, py: Python<'py>) -> &'py PyType {
+        self.get_type_bound(py).into_gil_ref()
+    }
+
+    /// Returns the type of this exception.
+    ///
+    /// # Examples
+    /// ```rust
+    /// use pyo3::{prelude::*, exceptions::PyTypeError, types::PyType};
+    ///
+    /// Python::with_gil(|py| {
+    ///     let err: PyErr = PyTypeError::new_err(("some type error",));
+    ///     assert!(err.get_type_bound(py).is(&PyType::new_bound::<PyTypeError>(py)));
+    /// });
+    /// ```
+    pub fn get_type_bound<'py>(&self, py: Python<'py>) -> Bound<'py, PyType> {
+        self.normalized(py).ptype(py)
+    }
+
+    /// Deprecated form of [`PyErr::value_bound`].
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyErr::value` will be replaced by `PyErr::value_bound` in a future PyO3 version"
+    )]
+    pub fn value<'py>(&'py self, py: Python<'py>) -> &'py PyBaseException {
+        self.value_bound(py).as_gil_ref()
+    }
+
+    /// Returns the value of this exception.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::{exceptions::PyTypeError, PyErr, Python};
+    ///
+    /// Python::with_gil(|py| {
+    ///     let err: PyErr = PyTypeError::new_err(("some type error",));
+    ///     assert!(err.is_instance_of::<PyTypeError>(py));
+    ///     assert_eq!(err.value_bound(py).to_string(), "some type error");
+    /// });
+    /// ```
+    pub fn value_bound<'py>(&self, py: Python<'py>) -> &Bound<'py, PyBaseException> {
+        self.normalized(py).pvalue.bind(py)
+    }
+
+    /// Consumes self to take ownership of the exception value contained in this error.
+    pub fn into_value(self, py: Python<'_>) -> Py<PyBaseException> {
+        // NB technically this causes one reference count increase and decrease in quick succession
+        // on pvalue, but it's probably not worth optimizing this right now for the additional code
+        // complexity.
+        let normalized = self.normalized(py);
+        let exc = normalized.pvalue.clone_ref(py);
+        if let Some(tb) = normalized.ptraceback(py) {
+            unsafe {
+                ffi::PyException_SetTraceback(exc.as_ptr(), tb.as_ptr());
+            }
+        }
+        exc
+    }
+
+    /// Deprecated form of [`PyErr::traceback_bound`].
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyErr::traceback` will be replaced by `PyErr::traceback_bound` in a future PyO3 version"
+    )]
+    pub fn traceback<'py>(&'py self, py: Python<'py>) -> Option<&'py PyTraceback> {
+        self.normalized(py).ptraceback(py).map(|b| b.into_gil_ref())
+    }
+
+    /// Returns the traceback of this exception object.
+    ///
+    /// # Examples
+    /// ```rust
+    /// use pyo3::{exceptions::PyTypeError, Python};
+    ///
+    /// Python::with_gil(|py| {
+    ///     let err = PyTypeError::new_err(("some type error",));
+    ///     assert!(err.traceback_bound(py).is_none());
+    /// });
+    /// ```
+    pub fn traceback_bound<'py>(&self, py: Python<'py>) -> Option<Bound<'py, PyTraceback>> {
+        self.normalized(py).ptraceback(py)
+    }
+
+    /// Gets whether an error is present in the Python interpreter's global state.
+    #[inline]
+    pub fn occurred(_: Python<'_>) -> bool {
+        unsafe { !ffi::PyErr_Occurred().is_null() }
+    }
+
+    /// Takes the current error from the Python interpreter's global state and clears the global
+    /// state. If no error is set, returns `None`.
+    ///
+    /// If the error is a `PanicException` (which would have originated from a panic in a pyo3
+    /// callback) then this function will resume the panic.
+    ///
+    /// Use this function when it is not known if an error should be present. If the error is
+    /// expected to have been set, for example from [`PyErr::occurred`] or by an error return value
+    /// from a C FFI function, use [`PyErr::fetch`].
+    pub fn take(py: Python<'_>) -> Option<PyErr> {
+        Self::_take(py)
+    }
+
+    #[cfg(not(Py_3_12))]
+    fn _take(py: Python<'_>) -> Option<PyErr> {
+        let (ptype, pvalue, ptraceback) = unsafe {
+            let mut ptype: *mut ffi::PyObject = std::ptr::null_mut();
+            let mut pvalue: *mut ffi::PyObject = std::ptr::null_mut();
+            let mut ptraceback: *mut ffi::PyObject = std::ptr::null_mut();
+            ffi::PyErr_Fetch(&mut ptype, &mut pvalue, &mut ptraceback);
+
+            // Convert to Py immediately so that any references are freed by early return.
+            let ptype = PyObject::from_owned_ptr_or_opt(py, ptype);
+            let pvalue = PyObject::from_owned_ptr_or_opt(py, pvalue);
+            let ptraceback = PyObject::from_owned_ptr_or_opt(py, ptraceback);
+
+            // A valid exception state should always have a non-null ptype, but the other two may be
+            // null.
+            let ptype = match ptype {
+                Some(ptype) => ptype,
+                None => {
+                    debug_assert!(
+                        pvalue.is_none(),
+                        "Exception type was null but value was not null"
+                    );
+                    debug_assert!(
+                        ptraceback.is_none(),
+                        "Exception type was null but traceback was not null"
+                    );
+                    return None;
+                }
+            };
+
+            (ptype, pvalue, ptraceback)
+        };
+
+        if ptype.as_ptr() == PanicException::type_object_raw(py).cast() {
+            let msg = pvalue
+                .as_ref()
+                .and_then(|obj| obj.bind(py).str().ok())
+                .map(|py_str| py_str.to_string_lossy().into())
+                .unwrap_or_else(|| String::from("Unwrapped panic from Python code"));
+
+            let state = PyErrState::FfiTuple {
+                ptype,
+                pvalue,
+                ptraceback,
+            };
+            Self::print_panic_and_unwind(py, state, msg)
+        }
+
+        Some(PyErr::from_state(PyErrState::FfiTuple {
+            ptype,
+            pvalue,
+            ptraceback,
+        }))
+    }
+
+    #[cfg(Py_3_12)]
+    fn _take(py: Python<'_>) -> Option<PyErr> {
+        let state = PyErrStateNormalized::take(py)?;
+        let pvalue = state.pvalue.bind(py);
+        if pvalue.get_type().as_ptr() == PanicException::type_object_raw(py).cast() {
+            let msg: String = pvalue
+                .str()
+                .map(|py_str| py_str.to_string_lossy().into())
+                .unwrap_or_else(|_| String::from("Unwrapped panic from Python code"));
+            Self::print_panic_and_unwind(py, PyErrState::Normalized(state), msg)
+        }
+
+        Some(PyErr::from_state(PyErrState::Normalized(state)))
+    }
+
+    fn print_panic_and_unwind(py: Python<'_>, state: PyErrState, msg: String) -> ! {
+        eprintln!("--- PyO3 is resuming a panic after fetching a PanicException from Python. ---");
+        eprintln!("Python stack trace below:");
+
+        state.restore(py);
+
+        unsafe {
+            ffi::PyErr_PrintEx(0);
+        }
+
+        std::panic::resume_unwind(Box::new(msg))
+    }
+
+    /// Equivalent to [PyErr::take], but when no error is set:
+    ///  - Panics in debug mode.
+    ///  - Returns a `SystemError` in release mode.
+    ///
+    /// This behavior is consistent with Python's internal handling of what happens when a C return
+    /// value indicates an error occurred but the global error state is empty. (A lack of exception
+    /// should be treated as a bug in the code which returned an error code but did not set an
+    /// exception.)
+    ///
+    /// Use this function when the error is expected to have been set, for example from
+    /// [PyErr::occurred] or by an error return value from a C FFI function.
+    #[cfg_attr(debug_assertions, track_caller)]
+    #[inline]
+    pub fn fetch(py: Python<'_>) -> PyErr {
+        const FAILED_TO_FETCH: &str = "attempted to fetch exception but none was set";
+        match PyErr::take(py) {
+            Some(err) => err,
+            #[cfg(debug_assertions)]
+            None => panic!("{}", FAILED_TO_FETCH),
+            #[cfg(not(debug_assertions))]
+            None => exceptions::PySystemError::new_err(FAILED_TO_FETCH),
+        }
+    }
+
+    /// Deprecated form of [`PyErr::new_type_bound`]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyErr::new_type` will be replaced by `PyErr::new_type_bound` in a future PyO3 version"
+    )]
+    pub fn new_type(
+        py: Python<'_>,
+        name: &str,
+        doc: Option<&str>,
+        base: Option<&PyType>,
+        dict: Option<PyObject>,
+    ) -> PyResult<Py<PyType>> {
+        Self::new_type_bound(
+            py,
+            name,
+            doc,
+            base.map(PyNativeType::as_borrowed).as_deref(),
+            dict,
+        )
+    }
+
+    /// Creates a new exception type with the given name and docstring.
+    ///
+    /// - `base` can be an existing exception type to subclass, or a tuple of classes.
+    /// - `dict` specifies an optional dictionary of class variables and methods.
+    /// - `doc` will be the docstring seen by python users.
+    ///
+    ///
+    /// # Errors
+    ///
+    /// This function returns an error if `name` is not of the form `<module>.<ExceptionName>`.
+    ///
+    /// # Panics
+    ///
+    /// This function will panic if  `name` or `doc` cannot be converted to [`CString`]s.
+    pub fn new_type_bound<'py>(
+        py: Python<'py>,
+        name: &str,
+        doc: Option<&str>,
+        base: Option<&Bound<'py, PyType>>,
+        dict: Option<PyObject>,
+    ) -> PyResult<Py<PyType>> {
+        let base: *mut ffi::PyObject = match base {
+            None => std::ptr::null_mut(),
+            Some(obj) => obj.as_ptr(),
+        };
+
+        let dict: *mut ffi::PyObject = match dict {
+            None => std::ptr::null_mut(),
+            Some(obj) => obj.as_ptr(),
+        };
+
+        let null_terminated_name =
+            CString::new(name).expect("Failed to initialize nul terminated exception name");
+
+        let null_terminated_doc =
+            doc.map(|d| CString::new(d).expect("Failed to initialize nul terminated docstring"));
+
+        let null_terminated_doc_ptr = match null_terminated_doc.as_ref() {
+            Some(c) => c.as_ptr(),
+            None => std::ptr::null(),
+        };
+
+        let ptr = unsafe {
+            ffi::PyErr_NewExceptionWithDoc(
+                null_terminated_name.as_ptr(),
+                null_terminated_doc_ptr,
+                base,
+                dict,
+            )
+        };
+
+        unsafe { Py::from_owned_ptr_or_err(py, ptr) }
+    }
+
+    /// Prints a standard traceback to `sys.stderr`.
+    pub fn display(&self, py: Python<'_>) {
+        #[cfg(Py_3_12)]
+        unsafe {
+            ffi::PyErr_DisplayException(self.value_bound(py).as_ptr())
+        }
+
+        #[cfg(not(Py_3_12))]
+        unsafe {
+            // keep the bound `traceback` alive for entire duration of
+            // PyErr_Display. if we inline this, the `Bound` will be dropped
+            // after the argument got evaluated, leading to call with a dangling
+            // pointer.
+            let traceback = self.traceback_bound(py);
+            let type_bound = self.get_type_bound(py);
+            ffi::PyErr_Display(
+                type_bound.as_ptr(),
+                self.value_bound(py).as_ptr(),
+                traceback
+                    .as_ref()
+                    .map_or(std::ptr::null_mut(), |traceback| traceback.as_ptr()),
+            )
+        }
+    }
+
+    /// Calls `sys.excepthook` and then prints a standard traceback to `sys.stderr`.
+    pub fn print(&self, py: Python<'_>) {
+        self.clone_ref(py).restore(py);
+        unsafe { ffi::PyErr_PrintEx(0) }
+    }
+
+    /// Calls `sys.excepthook` and then prints a standard traceback to `sys.stderr`.
+    ///
+    /// Additionally sets `sys.last_{type,value,traceback,exc}` attributes to this exception.
+    pub fn print_and_set_sys_last_vars(&self, py: Python<'_>) {
+        self.clone_ref(py).restore(py);
+        unsafe { ffi::PyErr_PrintEx(1) }
+    }
+
+    /// Returns true if the current exception matches the exception in `exc`.
+    ///
+    /// If `exc` is a class object, this also returns `true` when `self` is an instance of a subclass.
+    /// If `exc` is a tuple, all exceptions in the tuple (and recursively in subtuples) are searched for a match.
+    pub fn matches<T>(&self, py: Python<'_>, exc: T) -> bool
+    where
+        T: ToPyObject,
+    {
+        self.is_instance_bound(py, exc.to_object(py).bind(py))
+    }
+
+    /// Deprecated form of `PyErr::is_instance_bound`.
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyErr::is_instance` will be replaced by `PyErr::is_instance_bound` in a future PyO3 version"
+    )]
+    #[inline]
+    pub fn is_instance(&self, py: Python<'_>, ty: &PyAny) -> bool {
+        self.is_instance_bound(py, &ty.as_borrowed())
+    }
+
+    /// Returns true if the current exception is instance of `T`.
+    #[inline]
+    pub fn is_instance_bound(&self, py: Python<'_>, ty: &Bound<'_, PyAny>) -> bool {
+        let type_bound = self.get_type_bound(py);
+        (unsafe { ffi::PyErr_GivenExceptionMatches(type_bound.as_ptr(), ty.as_ptr()) }) != 0
+    }
+
+    /// Returns true if the current exception is instance of `T`.
+    #[inline]
+    pub fn is_instance_of<T>(&self, py: Python<'_>) -> bool
+    where
+        T: PyTypeInfo,
+    {
+        self.is_instance_bound(py, &T::type_object_bound(py))
+    }
+
+    /// Writes the error back to the Python interpreter's global state.
+    /// This is the opposite of `PyErr::fetch()`.
+    #[inline]
+    pub fn restore(self, py: Python<'_>) {
+        self.state
+            .into_inner()
+            .expect("PyErr state should never be invalid outside of normalization")
+            .restore(py)
+    }
+
+    /// Deprecated form of `PyErr::write_unraisable_bound`.
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyErr::write_unraisable` will be replaced by `PyErr::write_unraisable_bound` in a future PyO3 version"
+    )]
+    #[inline]
+    pub fn write_unraisable(self, py: Python<'_>, obj: Option<&PyAny>) {
+        self.write_unraisable_bound(py, obj.map(PyAny::as_borrowed).as_deref())
+    }
+
+    /// Reports the error as unraisable.
+    ///
+    /// This calls `sys.unraisablehook()` using the current exception and obj argument.
+    ///
+    /// This method is useful to report errors in situations where there is no good mechanism
+    /// to report back to the Python land.  In Python this is used to indicate errors in
+    /// background threads or destructors which are protected.  In Rust code this is commonly
+    /// useful when you are calling into a Python callback which might fail, but there is no
+    /// obvious way to handle this error other than logging it.
+    ///
+    /// Calling this method has the benefit that the error goes back into a standardized callback
+    /// in Python which for instance allows unittests to ensure that no unraisable error
+    /// actually happend by hooking `sys.unraisablehook`.
+    ///
+    /// Example:
+    /// ```rust
+    /// # use pyo3::prelude::*;
+    /// # use pyo3::exceptions::PyRuntimeError;
+    /// # fn failing_function() -> PyResult<()> { Err(PyRuntimeError::new_err("foo")) }
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     match failing_function() {
+    ///         Err(pyerr) => pyerr.write_unraisable_bound(py, None),
+    ///         Ok(..) => { /* do something here */ }
+    ///     }
+    ///     Ok(())
+    /// })
+    /// # }
+    #[inline]
+    pub fn write_unraisable_bound(self, py: Python<'_>, obj: Option<&Bound<'_, PyAny>>) {
+        self.restore(py);
+        unsafe { ffi::PyErr_WriteUnraisable(obj.map_or(std::ptr::null_mut(), Bound::as_ptr)) }
+    }
+
+    /// Deprecated form of [`PyErr::warn_bound`].
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyErr::warn` will be replaced by `PyErr::warn_bound` in a future PyO3 version"
+    )]
+    pub fn warn(py: Python<'_>, category: &PyAny, message: &str, stacklevel: i32) -> PyResult<()> {
+        Self::warn_bound(py, &category.as_borrowed(), message, stacklevel)
+    }
+
+    /// Issues a warning message.
+    ///
+    /// May return an `Err(PyErr)` if warnings-as-errors is enabled.
+    ///
+    /// Equivalent to `warnings.warn()` in Python.
+    ///
+    /// The `category` should be one of the `Warning` classes available in
+    /// [`pyo3::exceptions`](crate::exceptions), or a subclass.  The Python
+    /// object can be retrieved using [`Python::get_type_bound()`].
+    ///
+    /// Example:
+    /// ```rust
+    /// # use pyo3::prelude::*;
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let user_warning = py.get_type_bound::<pyo3::exceptions::PyUserWarning>();
+    ///     PyErr::warn_bound(py, &user_warning, "I am warning you", 0)?;
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    pub fn warn_bound<'py>(
+        py: Python<'py>,
+        category: &Bound<'py, PyAny>,
+        message: &str,
+        stacklevel: i32,
+    ) -> PyResult<()> {
+        let message = CString::new(message)?;
+        error_on_minusone(py, unsafe {
+            ffi::PyErr_WarnEx(
+                category.as_ptr(),
+                message.as_ptr(),
+                stacklevel as ffi::Py_ssize_t,
+            )
+        })
+    }
+
+    /// Deprecated form of [`PyErr::warn_explicit_bound`].
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyErr::warn_explicit` will be replaced by `PyErr::warn_explicit_bound` in a future PyO3 version"
+    )]
+    pub fn warn_explicit(
+        py: Python<'_>,
+        category: &PyAny,
+        message: &str,
+        filename: &str,
+        lineno: i32,
+        module: Option<&str>,
+        registry: Option<&PyAny>,
+    ) -> PyResult<()> {
+        Self::warn_explicit_bound(
+            py,
+            &category.as_borrowed(),
+            message,
+            filename,
+            lineno,
+            module,
+            registry.map(PyNativeType::as_borrowed).as_deref(),
+        )
+    }
+
+    /// Issues a warning message, with more control over the warning attributes.
+    ///
+    /// May return a `PyErr` if warnings-as-errors is enabled.
+    ///
+    /// Equivalent to `warnings.warn_explicit()` in Python.
+    ///
+    /// The `category` should be one of the `Warning` classes available in
+    /// [`pyo3::exceptions`](crate::exceptions), or a subclass.
+    pub fn warn_explicit_bound<'py>(
+        py: Python<'py>,
+        category: &Bound<'py, PyAny>,
+        message: &str,
+        filename: &str,
+        lineno: i32,
+        module: Option<&str>,
+        registry: Option<&Bound<'py, PyAny>>,
+    ) -> PyResult<()> {
+        let message = CString::new(message)?;
+        let filename = CString::new(filename)?;
+        let module = module.map(CString::new).transpose()?;
+        let module_ptr = match module {
+            None => std::ptr::null_mut(),
+            Some(s) => s.as_ptr(),
+        };
+        let registry: *mut ffi::PyObject = match registry {
+            None => std::ptr::null_mut(),
+            Some(obj) => obj.as_ptr(),
+        };
+        error_on_minusone(py, unsafe {
+            ffi::PyErr_WarnExplicit(
+                category.as_ptr(),
+                message.as_ptr(),
+                filename.as_ptr(),
+                lineno,
+                module_ptr,
+                registry,
+            )
+        })
+    }
+
+    /// Clone the PyErr. This requires the GIL, which is why PyErr does not implement Clone.
+    ///
+    /// # Examples
+    /// ```rust
+    /// use pyo3::{exceptions::PyTypeError, PyErr, Python, prelude::PyAnyMethods};
+    /// Python::with_gil(|py| {
+    ///     let err: PyErr = PyTypeError::new_err(("some type error",));
+    ///     let err_clone = err.clone_ref(py);
+    ///     assert!(err.get_type_bound(py).is(&err_clone.get_type_bound(py)));
+    ///     assert!(err.value_bound(py).is(err_clone.value_bound(py)));
+    ///     match err.traceback_bound(py) {
+    ///         None => assert!(err_clone.traceback_bound(py).is_none()),
+    ///         Some(tb) => assert!(err_clone.traceback_bound(py).unwrap().is(&tb)),
+    ///     }
+    /// });
+    /// ```
+    #[inline]
+    pub fn clone_ref(&self, py: Python<'_>) -> PyErr {
+        PyErr::from_state(PyErrState::Normalized(self.normalized(py).clone_ref(py)))
+    }
+
+    /// Return the cause (either an exception instance, or None, set by `raise ... from ...`)
+    /// associated with the exception, as accessible from Python through `__cause__`.
+    pub fn cause(&self, py: Python<'_>) -> Option<PyErr> {
+        use crate::ffi_ptr_ext::FfiPtrExt;
+        let obj = unsafe {
+            ffi::PyException_GetCause(self.value_bound(py).as_ptr()).assume_owned_or_opt(py)
+        };
+        // PyException_GetCause is documented as potentially returning PyNone, but only GraalPy seems to actually do that
+        #[cfg(GraalPy)]
+        if let Some(cause) = &obj {
+            if cause.is_none() {
+                return None;
+            }
+        }
+        obj.map(Self::from_value_bound)
+    }
+
+    /// Set the cause associated with the exception, pass `None` to clear it.
+    pub fn set_cause(&self, py: Python<'_>, cause: Option<Self>) {
+        let value = self.value_bound(py);
+        let cause = cause.map(|err| err.into_value(py));
+        unsafe {
+            // PyException_SetCause _steals_ a reference to cause, so must use .into_ptr()
+            ffi::PyException_SetCause(
+                value.as_ptr(),
+                cause.map_or(std::ptr::null_mut(), Py::into_ptr),
+            );
+        }
+    }
+
+    #[inline]
+    fn from_state(state: PyErrState) -> PyErr {
+        PyErr {
+            state: UnsafeCell::new(Some(state)),
+        }
+    }
+
+    #[inline]
+    fn normalized(&self, py: Python<'_>) -> &PyErrStateNormalized {
+        if let Some(PyErrState::Normalized(n)) = unsafe {
+            // Safety: self.state will never be written again once normalized.
+            &*self.state.get()
+        } {
+            return n;
+        }
+
+        self.make_normalized(py)
+    }
+
+    #[cold]
+    fn make_normalized(&self, py: Python<'_>) -> &PyErrStateNormalized {
+        // This process is safe because:
+        // - Access is guaranteed not to be concurrent thanks to `Python` GIL token
+        // - Write happens only once, and then never will change again.
+        // - State is set to None during the normalization process, so that a second
+        //   concurrent normalization attempt will panic before changing anything.
+
+        let state = unsafe {
+            (*self.state.get())
+                .take()
+                .expect("Cannot normalize a PyErr while already normalizing it.")
+        };
+
+        unsafe {
+            let self_state = &mut *self.state.get();
+            *self_state = Some(PyErrState::Normalized(state.normalize(py)));
+            match self_state {
+                Some(PyErrState::Normalized(n)) => n,
+                _ => unreachable!(),
+            }
+        }
+    }
+}
+
+impl std::fmt::Debug for PyErr {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+        Python::with_gil(|py| {
+            f.debug_struct("PyErr")
+                .field("type", &self.get_type_bound(py))
+                .field("value", self.value_bound(py))
+                .field("traceback", &self.traceback_bound(py))
+                .finish()
+        })
+    }
+}
+
+impl std::fmt::Display for PyErr {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        Python::with_gil(|py| {
+            let value = self.value_bound(py);
+            let type_name = value.get_type().qualname().map_err(|_| std::fmt::Error)?;
+            write!(f, "{}", type_name)?;
+            if let Ok(s) = value.str() {
+                write!(f, ": {}", &s.to_string_lossy())
+            } else {
+                write!(f, ": <exception str() failed>")
+            }
+        })
+    }
+}
+
+impl std::error::Error for PyErr {}
+
+impl IntoPy<PyObject> for PyErr {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.into_value(py).into()
+    }
+}
+
+impl ToPyObject for PyErr {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        self.clone_ref(py).into_py(py)
+    }
+}
+
+impl<'a> IntoPy<PyObject> for &'a PyErr {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.clone_ref(py).into_py(py)
+    }
+}
+
+struct PyDowncastErrorArguments {
+    from: Py<PyType>,
+    to: Cow<'static, str>,
+}
+
+impl PyErrArguments for PyDowncastErrorArguments {
+    fn arguments(self, py: Python<'_>) -> PyObject {
+        const FAILED_TO_EXTRACT: Cow<'_, str> = Cow::Borrowed("<failed to extract type name>");
+        let from = self.from.bind(py).qualname();
+        let from = match &from {
+            Ok(qn) => qn.to_cow().unwrap_or(FAILED_TO_EXTRACT),
+            Err(_) => FAILED_TO_EXTRACT,
+        };
+        format!("'{}' object cannot be converted to '{}'", from, self.to).to_object(py)
+    }
+}
+
+/// Python exceptions that can be converted to [`PyErr`].
+///
+/// This is used to implement [`From<Bound<'_, T>> for PyErr`].
+///
+/// Users should not need to implement this trait directly. It is implemented automatically in the
+/// [`crate::import_exception!`] and [`crate::create_exception!`] macros.
+pub trait ToPyErr {}
+
+impl<'py, T> std::convert::From<Bound<'py, T>> for PyErr
+where
+    T: ToPyErr,
+{
+    #[inline]
+    fn from(err: Bound<'py, T>) -> PyErr {
+        PyErr::from_value_bound(err.into_any())
+    }
+}
+
+/// Convert `PyDowncastError` to Python `TypeError`.
+#[cfg(feature = "gil-refs")]
+impl<'a> std::convert::From<PyDowncastError<'a>> for PyErr {
+    fn from(err: PyDowncastError<'_>) -> PyErr {
+        let args = PyDowncastErrorArguments {
+            from: err.from.get_type().into(),
+            to: err.to,
+        };
+
+        exceptions::PyTypeError::new_err(args)
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'a> std::error::Error for PyDowncastError<'a> {}
+
+#[cfg(feature = "gil-refs")]
+impl<'a> std::fmt::Display for PyDowncastError<'a> {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+        display_downcast_error(f, &self.from.as_borrowed(), &self.to)
+    }
+}
+
+/// Convert `DowncastError` to Python `TypeError`.
+impl std::convert::From<DowncastError<'_, '_>> for PyErr {
+    fn from(err: DowncastError<'_, '_>) -> PyErr {
+        let args = PyDowncastErrorArguments {
+            from: err.from.get_type().into(),
+            to: err.to,
+        };
+
+        exceptions::PyTypeError::new_err(args)
+    }
+}
+
+impl std::error::Error for DowncastError<'_, '_> {}
+
+impl std::fmt::Display for DowncastError<'_, '_> {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+        display_downcast_error(f, &self.from, &self.to)
+    }
+}
+
+/// Convert `DowncastIntoError` to Python `TypeError`.
+impl std::convert::From<DowncastIntoError<'_>> for PyErr {
+    fn from(err: DowncastIntoError<'_>) -> PyErr {
+        let args = PyDowncastErrorArguments {
+            from: err.from.get_type().into(),
+            to: err.to,
+        };
+
+        exceptions::PyTypeError::new_err(args)
+    }
+}
+
+impl std::error::Error for DowncastIntoError<'_> {}
+
+impl std::fmt::Display for DowncastIntoError<'_> {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+        display_downcast_error(f, &self.from, &self.to)
+    }
+}
+
+fn display_downcast_error(
+    f: &mut std::fmt::Formatter<'_>,
+    from: &Bound<'_, PyAny>,
+    to: &str,
+) -> std::fmt::Result {
+    write!(
+        f,
+        "'{}' object cannot be converted to '{}'",
+        from.get_type().qualname().map_err(|_| std::fmt::Error)?,
+        to
+    )
+}
+
+#[track_caller]
+pub fn panic_after_error(_py: Python<'_>) -> ! {
+    unsafe {
+        ffi::PyErr_Print();
+    }
+    panic!("Python API call failed");
+}
+
+/// Returns Ok if the error code is not -1.
+#[inline]
+pub(crate) fn error_on_minusone<T: SignedInteger>(py: Python<'_>, result: T) -> PyResult<()> {
+    if result != T::MINUS_ONE {
+        Ok(())
+    } else {
+        Err(PyErr::fetch(py))
+    }
+}
+
+pub(crate) trait SignedInteger: Eq {
+    const MINUS_ONE: Self;
+}
+
+macro_rules! impl_signed_integer {
+    ($t:ty) => {
+        impl SignedInteger for $t {
+            const MINUS_ONE: Self = -1;
+        }
+    };
+}
+
+impl_signed_integer!(i8);
+impl_signed_integer!(i16);
+impl_signed_integer!(i32);
+impl_signed_integer!(i64);
+impl_signed_integer!(i128);
+impl_signed_integer!(isize);
+
+#[cfg(test)]
+mod tests {
+    use super::PyErrState;
+    use crate::exceptions::{self, PyTypeError, PyValueError};
+    use crate::{PyErr, PyTypeInfo, Python};
+
+    #[test]
+    fn no_error() {
+        assert!(Python::with_gil(PyErr::take).is_none());
+    }
+
+    #[test]
+    fn set_valueerror() {
+        Python::with_gil(|py| {
+            let err: PyErr = exceptions::PyValueError::new_err("some exception message");
+            assert!(err.is_instance_of::<exceptions::PyValueError>(py));
+            err.restore(py);
+            assert!(PyErr::occurred(py));
+            let err = PyErr::fetch(py);
+            assert!(err.is_instance_of::<exceptions::PyValueError>(py));
+            assert_eq!(err.to_string(), "ValueError: some exception message");
+        })
+    }
+
+    #[test]
+    fn invalid_error_type() {
+        Python::with_gil(|py| {
+            let err: PyErr = PyErr::new::<crate::types::PyString, _>(());
+            assert!(err.is_instance_of::<exceptions::PyTypeError>(py));
+            err.restore(py);
+            let err = PyErr::fetch(py);
+
+            assert!(err.is_instance_of::<exceptions::PyTypeError>(py));
+            assert_eq!(
+                err.to_string(),
+                "TypeError: exceptions must derive from BaseException"
+            );
+        })
+    }
+
+    #[test]
+    fn set_typeerror() {
+        Python::with_gil(|py| {
+            let err: PyErr = exceptions::PyTypeError::new_err(());
+            err.restore(py);
+            assert!(PyErr::occurred(py));
+            drop(PyErr::fetch(py));
+        });
+    }
+
+    #[test]
+    #[should_panic(expected = "new panic")]
+    fn fetching_panic_exception_resumes_unwind() {
+        use crate::panic::PanicException;
+
+        Python::with_gil(|py| {
+            let err: PyErr = PanicException::new_err("new panic");
+            err.restore(py);
+            assert!(PyErr::occurred(py));
+
+            // should resume unwind
+            let _ = PyErr::fetch(py);
+        });
+    }
+
+    #[test]
+    #[should_panic(expected = "new panic")]
+    #[cfg(not(Py_3_12))]
+    fn fetching_normalized_panic_exception_resumes_unwind() {
+        use crate::panic::PanicException;
+
+        Python::with_gil(|py| {
+            let err: PyErr = PanicException::new_err("new panic");
+            // Restoring an error doesn't normalize it before Python 3.12,
+            // so we have to explicitly test this case.
+            let _ = err.normalized(py);
+            err.restore(py);
+            assert!(PyErr::occurred(py));
+
+            // should resume unwind
+            let _ = PyErr::fetch(py);
+        });
+    }
+
+    #[test]
+    fn err_debug() {
+        // Debug representation should be like the following (without the newlines):
+        // PyErr {
+        //     type: <class 'Exception'>,
+        //     value: Exception('banana'),
+        //     traceback: Some(<traceback object at 0x..)"
+        // }
+
+        Python::with_gil(|py| {
+            let err = py
+                .run_bound("raise Exception('banana')", None, None)
+                .expect_err("raising should have given us an error");
+
+            let debug_str = format!("{:?}", err);
+            assert!(debug_str.starts_with("PyErr { "));
+            assert!(debug_str.ends_with(" }"));
+
+            // strip "PyErr { " and " }"
+            let mut fields = debug_str["PyErr { ".len()..debug_str.len() - 2].split(", ");
+
+            assert_eq!(fields.next().unwrap(), "type: <class 'Exception'>");
+            assert_eq!(fields.next().unwrap(), "value: Exception('banana')");
+
+            let traceback = fields.next().unwrap();
+            assert!(traceback.starts_with("traceback: Some(<traceback object at 0x"));
+            assert!(traceback.ends_with(">)"));
+
+            assert!(fields.next().is_none());
+        });
+    }
+
+    #[test]
+    fn err_display() {
+        Python::with_gil(|py| {
+            let err = py
+                .run_bound("raise Exception('banana')", None, None)
+                .expect_err("raising should have given us an error");
+            assert_eq!(err.to_string(), "Exception: banana");
+        });
+    }
+
+    #[test]
+    fn test_pyerr_send_sync() {
+        fn is_send<T: Send>() {}
+        fn is_sync<T: Sync>() {}
+
+        is_send::<PyErr>();
+        is_sync::<PyErr>();
+
+        is_send::<PyErrState>();
+        is_sync::<PyErrState>();
+    }
+
+    #[test]
+    fn test_pyerr_matches() {
+        Python::with_gil(|py| {
+            let err = PyErr::new::<PyValueError, _>("foo");
+            assert!(err.matches(py, PyValueError::type_object_bound(py)));
+
+            assert!(err.matches(
+                py,
+                (
+                    PyValueError::type_object_bound(py),
+                    PyTypeError::type_object_bound(py)
+                )
+            ));
+
+            assert!(!err.matches(py, PyTypeError::type_object_bound(py)));
+
+            // String is not a valid exception class, so we should get a TypeError
+            let err: PyErr =
+                PyErr::from_type_bound(crate::types::PyString::type_object_bound(py), "foo");
+            assert!(err.matches(py, PyTypeError::type_object_bound(py)));
+        })
+    }
+
+    #[test]
+    fn test_pyerr_cause() {
+        Python::with_gil(|py| {
+            let err = py
+                .run_bound("raise Exception('banana')", None, None)
+                .expect_err("raising should have given us an error");
+            assert!(err.cause(py).is_none());
+
+            let err = py
+                .run_bound(
+                    "raise Exception('banana') from Exception('apple')",
+                    None,
+                    None,
+                )
+                .expect_err("raising should have given us an error");
+            let cause = err
+                .cause(py)
+                .expect("raising from should have given us a cause");
+            assert_eq!(cause.to_string(), "Exception: apple");
+
+            err.set_cause(py, None);
+            assert!(err.cause(py).is_none());
+
+            let new_cause = exceptions::PyValueError::new_err("orange");
+            err.set_cause(py, Some(new_cause));
+            let cause = err
+                .cause(py)
+                .expect("set_cause should have given us a cause");
+            assert_eq!(cause.to_string(), "ValueError: orange");
+        });
+    }
+
+    #[test]
+    fn warnings() {
+        use crate::types::any::PyAnyMethods;
+        // Note: although the warning filter is interpreter global, keeping the
+        // GIL locked should prevent effects to be visible to other testing
+        // threads.
+        Python::with_gil(|py| {
+            let cls = py.get_type_bound::<exceptions::PyUserWarning>();
+
+            // Reset warning filter to default state
+            let warnings = py.import_bound("warnings").unwrap();
+            warnings.call_method0("resetwarnings").unwrap();
+
+            // First, test the warning is emitted
+            assert_warnings!(
+                py,
+                { PyErr::warn_bound(py, &cls, "I am warning you", 0).unwrap() },
+                [(exceptions::PyUserWarning, "I am warning you")]
+            );
+
+            // Test with raising
+            warnings
+                .call_method1("simplefilter", ("error", &cls))
+                .unwrap();
+            PyErr::warn_bound(py, &cls, "I am warning you", 0).unwrap_err();
+
+            // Test with error for an explicit module
+            warnings.call_method0("resetwarnings").unwrap();
+            warnings
+                .call_method1("filterwarnings", ("error", "", &cls, "pyo3test"))
+                .unwrap();
+
+            // This has the wrong module and will not raise, just be emitted
+            assert_warnings!(
+                py,
+                { PyErr::warn_bound(py, &cls, "I am warning you", 0).unwrap() },
+                [(exceptions::PyUserWarning, "I am warning you")]
+            );
+
+            let err = PyErr::warn_explicit_bound(
+                py,
+                &cls,
+                "I am warning you",
+                "pyo3test.py",
+                427,
+                None,
+                None,
+            )
+            .unwrap_err();
+            assert!(err
+                .value_bound(py)
+                .getattr("args")
+                .unwrap()
+                .get_item(0)
+                .unwrap()
+                .eq("I am warning you")
+                .unwrap());
+
+            // Finally, reset filter again
+            warnings.call_method0("resetwarnings").unwrap();
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/exceptions.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/exceptions.rs
--- 43.0.0-1/rust-vendor/pyo3/src/exceptions.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/exceptions.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1214 @@
+//! Exception and warning types defined by Python.
+//!
+//! The structs in this module represent Python's built-in exceptions and
+//! warnings, while the modules comprise structs representing errors defined in
+//! Python code.
+//!
+//! The latter are created with the
+//! [`import_exception`](crate::import_exception) macro, which you can use
+//! yourself to import Python classes that are ultimately derived from
+//! `BaseException`.
+
+use crate::{ffi, Bound, PyResult, Python};
+use std::ffi::CStr;
+use std::ops;
+
+/// The boilerplate to convert between a Rust type and a Python exception.
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_exception_boilerplate {
+    ($name: ident) => {
+        // FIXME https://github.com/PyO3/pyo3/issues/3903
+        #[allow(unknown_lints, non_local_definitions)]
+        #[cfg(feature = "gil-refs")]
+        impl ::std::convert::From<&$name> for $crate::PyErr {
+            #[inline]
+            fn from(err: &$name) -> $crate::PyErr {
+                #[allow(deprecated)]
+                $crate::PyErr::from_value(err)
+            }
+        }
+
+        $crate::impl_exception_boilerplate_bound!($name);
+
+        #[cfg(feature = "gil-refs")]
+        impl ::std::error::Error for $name {
+            fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
+                unsafe {
+                    #[allow(deprecated)]
+                    let cause: &$crate::exceptions::PyBaseException = self
+                        .py()
+                        .from_owned_ptr_or_opt($crate::ffi::PyException_GetCause(self.as_ptr()))?;
+
+                    ::std::option::Option::Some(cause)
+                }
+            }
+        }
+
+        impl $crate::ToPyErr for $name {}
+    };
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_exception_boilerplate_bound {
+    ($name: ident) => {
+        impl $name {
+            /// Creates a new [`PyErr`] of this type.
+            ///
+            /// [`PyErr`]: https://docs.rs/pyo3/latest/pyo3/struct.PyErr.html "PyErr in pyo3"
+            #[inline]
+            #[allow(dead_code)]
+            pub fn new_err<A>(args: A) -> $crate::PyErr
+            where
+                A: $crate::PyErrArguments + ::std::marker::Send + ::std::marker::Sync + 'static,
+            {
+                $crate::PyErr::new::<$name, A>(args)
+            }
+        }
+    };
+}
+
+/// Defines a Rust type for an exception defined in Python code.
+///
+/// # Syntax
+///
+/// ```import_exception!(module, MyError)```
+///
+/// * `module` is the name of the containing module.
+/// * `MyError` is the name of the new exception type.
+///
+/// # Examples
+/// ```
+/// use pyo3::import_exception;
+/// use pyo3::types::IntoPyDict;
+/// use pyo3::Python;
+///
+/// import_exception!(socket, gaierror);
+///
+/// Python::with_gil(|py| {
+///     let ctx = [("gaierror", py.get_type_bound::<gaierror>())].into_py_dict_bound(py);
+///     pyo3::py_run!(py, *ctx, "import socket; assert gaierror is socket.gaierror");
+/// });
+///
+/// ```
+#[macro_export]
+macro_rules! import_exception {
+    ($module: expr, $name: ident) => {
+        /// A Rust type representing an exception defined in Python code.
+        ///
+        /// This type was created by the [`pyo3::import_exception!`] macro - see its documentation
+        /// for more information.
+        ///
+        /// [`pyo3::import_exception!`]: https://docs.rs/pyo3/latest/pyo3/macro.import_exception.html "import_exception in pyo3"
+        #[repr(transparent)]
+        #[allow(non_camel_case_types)] // E.g. `socket.herror`
+        pub struct $name($crate::PyAny);
+
+        $crate::impl_exception_boilerplate!($name);
+
+        $crate::pyobject_native_type_core!(
+            $name,
+            $name::type_object_raw,
+            #module=::std::option::Option::Some(stringify!($module))
+        );
+
+        impl $name {
+            fn type_object_raw(py: $crate::Python<'_>) -> *mut $crate::ffi::PyTypeObject {
+                use $crate::types::PyTypeMethods;
+                static TYPE_OBJECT: $crate::impl_::exceptions::ImportedExceptionTypeObject =
+                    $crate::impl_::exceptions::ImportedExceptionTypeObject::new(stringify!($module), stringify!($name));
+                TYPE_OBJECT.get(py).as_type_ptr()
+            }
+        }
+    };
+}
+
+/// Variant of [`import_exception`](crate::import_exception) that does not emit code needed to
+/// use the imported exception type as a GIL Ref.
+///
+/// This is useful only during migration as a way to avoid generating needless code.
+#[macro_export]
+macro_rules! import_exception_bound {
+    ($module: expr, $name: ident) => {
+        /// A Rust type representing an exception defined in Python code.
+        ///
+        /// This type was created by the [`pyo3::import_exception_bound!`] macro - see its documentation
+        /// for more information.
+        ///
+        /// [`pyo3::import_exception_bound!`]: https://docs.rs/pyo3/latest/pyo3/macro.import_exception.html "import_exception in pyo3"
+        #[repr(transparent)]
+        #[allow(non_camel_case_types)] // E.g. `socket.herror`
+        pub struct $name($crate::PyAny);
+
+        $crate::impl_exception_boilerplate_bound!($name);
+
+        // FIXME remove this: was necessary while `PyTypeInfo` requires `HasPyGilRef`,
+        // should change in 0.22.
+        #[cfg(feature = "gil-refs")]
+        unsafe impl $crate::type_object::HasPyGilRef for $name {
+            type AsRefTarget = $crate::PyAny;
+        }
+
+        $crate::pyobject_native_type_info!(
+            $name,
+            $name::type_object_raw,
+            ::std::option::Option::Some(stringify!($module))
+        );
+
+        impl $crate::types::DerefToPyAny for $name {}
+
+        impl $name {
+            fn type_object_raw(py: $crate::Python<'_>) -> *mut $crate::ffi::PyTypeObject {
+                use $crate::types::PyTypeMethods;
+                static TYPE_OBJECT: $crate::impl_::exceptions::ImportedExceptionTypeObject =
+                    $crate::impl_::exceptions::ImportedExceptionTypeObject::new(
+                        stringify!($module),
+                        stringify!($name),
+                    );
+                TYPE_OBJECT.get(py).as_type_ptr()
+            }
+        }
+    };
+}
+
+/// Defines a new exception type.
+///
+/// # Syntax
+///
+/// * `module` is the name of the containing module.
+/// * `name` is the name of the new exception type.
+/// * `base` is the base class of `MyError`, usually [`PyException`].
+/// * `doc` (optional) is the docstring visible to users (with `.__doc__` and `help()`) and
+///
+/// accompanies your error type in your crate's documentation.
+///
+/// # Examples
+///
+/// ```
+/// use pyo3::prelude::*;
+/// use pyo3::create_exception;
+/// use pyo3::exceptions::PyException;
+///
+/// create_exception!(my_module, MyError, PyException, "Some description.");
+///
+/// #[pyfunction]
+/// fn raise_myerror() -> PyResult<()> {
+///     let err = MyError::new_err("Some error happened.");
+///     Err(err)
+/// }
+///
+/// #[pymodule]
+/// fn my_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
+///     m.add("MyError", m.py().get_type_bound::<MyError>())?;
+///     m.add_function(wrap_pyfunction!(raise_myerror, m)?)?;
+///     Ok(())
+/// }
+/// # fn main() -> PyResult<()> {
+/// #     Python::with_gil(|py| -> PyResult<()> {
+/// #         let fun = wrap_pyfunction_bound!(raise_myerror, py)?;
+/// #         let locals = pyo3::types::PyDict::new_bound(py);
+/// #         locals.set_item("MyError", py.get_type_bound::<MyError>())?;
+/// #         locals.set_item("raise_myerror", fun)?;
+/// #
+/// #         py.run_bound(
+/// # "try:
+/// #     raise_myerror()
+/// # except MyError as e:
+/// #     assert e.__doc__ == 'Some description.'
+/// #     assert str(e) == 'Some error happened.'",
+/// #             None,
+/// #             Some(&locals),
+/// #         )?;
+/// #
+/// #         Ok(())
+/// #     })
+/// # }
+/// ```
+///
+/// Python code can handle this exception like any other exception:
+///
+/// ```python
+/// from my_module import MyError, raise_myerror
+///
+/// try:
+///     raise_myerror()
+/// except MyError as e:
+///     assert e.__doc__ == 'Some description.'
+///     assert str(e) == 'Some error happened.'
+/// ```
+///
+#[macro_export]
+macro_rules! create_exception {
+    ($module: expr, $name: ident, $base: ty) => {
+        #[repr(transparent)]
+        #[allow(non_camel_case_types)] // E.g. `socket.herror`
+        pub struct $name($crate::PyAny);
+
+        $crate::impl_exception_boilerplate!($name);
+
+        $crate::create_exception_type_object!($module, $name, $base, ::std::option::Option::None);
+    };
+    ($module: expr, $name: ident, $base: ty, $doc: expr) => {
+        #[repr(transparent)]
+        #[allow(non_camel_case_types)] // E.g. `socket.herror`
+        #[doc = $doc]
+        pub struct $name($crate::PyAny);
+
+        $crate::impl_exception_boilerplate!($name);
+
+        $crate::create_exception_type_object!(
+            $module,
+            $name,
+            $base,
+            ::std::option::Option::Some($doc)
+        );
+    };
+}
+
+/// `impl PyTypeInfo for $name` where `$name` is an
+/// exception newly defined in Rust code.
+#[doc(hidden)]
+#[macro_export]
+macro_rules! create_exception_type_object {
+    ($module: expr, $name: ident, $base: ty, $doc: expr) => {
+        $crate::pyobject_native_type_core!(
+            $name,
+            $name::type_object_raw,
+            #module=::std::option::Option::Some(stringify!($module))
+        );
+
+        impl $name {
+            fn type_object_raw(py: $crate::Python<'_>) -> *mut $crate::ffi::PyTypeObject {
+                use $crate::sync::GILOnceCell;
+                static TYPE_OBJECT: GILOnceCell<$crate::Py<$crate::types::PyType>> =
+                    GILOnceCell::new();
+
+                TYPE_OBJECT
+                    .get_or_init(py, ||
+                        $crate::PyErr::new_type_bound(
+                            py,
+                            concat!(stringify!($module), ".", stringify!($name)),
+                            $doc,
+                            ::std::option::Option::Some(&py.get_type_bound::<$base>()),
+                            ::std::option::Option::None,
+                        ).expect("Failed to initialize new exception type.")
+                ).as_ptr() as *mut $crate::ffi::PyTypeObject
+            }
+        }
+    };
+}
+
+macro_rules! impl_native_exception (
+    ($name:ident, $exc_name:ident, $doc:expr, $layout:path $(, #checkfunction=$checkfunction:path)?) => (
+        #[doc = $doc]
+        #[allow(clippy::upper_case_acronyms)]
+        pub struct $name($crate::PyAny);
+
+        $crate::impl_exception_boilerplate!($name);
+        $crate::pyobject_native_type!($name, $layout, |_py| unsafe { $crate::ffi::$exc_name as *mut $crate::ffi::PyTypeObject } $(, #checkfunction=$checkfunction)?);
+    );
+    ($name:ident, $exc_name:ident, $doc:expr) => (
+        impl_native_exception!($name, $exc_name, $doc, $crate::ffi::PyBaseExceptionObject);
+    )
+);
+
+#[cfg(windows)]
+macro_rules! impl_windows_native_exception (
+    ($name:ident, $exc_name:ident, $doc:expr, $layout:path) => (
+        #[cfg(windows)]
+        #[doc = $doc]
+        #[allow(clippy::upper_case_acronyms)]
+        pub struct $name($crate::PyAny);
+
+        $crate::impl_exception_boilerplate!($name);
+        $crate::pyobject_native_type!($name, $layout, |_py| unsafe { $crate::ffi::$exc_name as *mut $crate::ffi::PyTypeObject });
+    );
+    ($name:ident, $exc_name:ident, $doc:expr) => (
+        impl_windows_native_exception!($name, $exc_name, $doc, $crate::ffi::PyBaseExceptionObject);
+    )
+);
+
+macro_rules! native_doc(
+    ($name: literal, $alt: literal) => (
+        concat!(
+"Represents Python's [`", $name, "`](https://docs.python.org/3/library/exceptions.html#", $name, ") exception.
+
+", $alt
+        )
+    );
+    ($name: literal) => (
+        concat!(
+"
+Represents Python's [`", $name, "`](https://docs.python.org/3/library/exceptions.html#", $name, ") exception.
+
+# Example: Raising ", $name, " from Rust
+
+This exception can be sent to Python code by converting it into a
+[`PyErr`](crate::PyErr), where Python code can then catch it.
+```
+use pyo3::prelude::*;
+use pyo3::exceptions::Py", $name, ";
+
+#[pyfunction]
+fn always_throws() -> PyResult<()> {
+    let message = \"I'm ", $name ,", and I was raised from Rust.\";
+    Err(Py", $name, "::new_err(message))
+}
+#
+# Python::with_gil(|py| {
+#     let fun = pyo3::wrap_pyfunction_bound!(always_throws, py).unwrap();
+#     let err = fun.call0().expect_err(\"called a function that should always return an error but the return value was Ok\");
+#     assert!(err.is_instance_of::<Py", $name, ">(py))
+# });
+```
+
+Python code:
+ ```python
+ from my_module import always_throws
+
+try:
+    always_throws()
+except ", $name, " as e:
+    print(f\"Caught an exception: {e}\")
+```
+
+# Example: Catching ", $name, " in Rust
+
+```
+use pyo3::prelude::*;
+use pyo3::exceptions::Py", $name, ";
+
+Python::with_gil(|py| {
+    let result: PyResult<()> = py.run_bound(\"raise ", $name, "\", None, None);
+
+    let error_type = match result {
+        Ok(_) => \"Not an error\",
+        Err(error) if error.is_instance_of::<Py", $name, ">(py) => \"" , $name, "\",
+        Err(_) => \"Some other error\",
+    };
+
+    assert_eq!(error_type, \"", $name, "\");
+});
+```
+"
+        )
+    );
+);
+
+impl_native_exception!(
+    PyBaseException,
+    PyExc_BaseException,
+    native_doc!("BaseException"),
+    ffi::PyBaseExceptionObject,
+    #checkfunction=ffi::PyExceptionInstance_Check
+);
+impl_native_exception!(PyException, PyExc_Exception, native_doc!("Exception"));
+impl_native_exception!(
+    PyStopAsyncIteration,
+    PyExc_StopAsyncIteration,
+    native_doc!("StopAsyncIteration")
+);
+impl_native_exception!(
+    PyStopIteration,
+    PyExc_StopIteration,
+    native_doc!("StopIteration"),
+    ffi::PyStopIterationObject
+);
+impl_native_exception!(
+    PyGeneratorExit,
+    PyExc_GeneratorExit,
+    native_doc!("GeneratorExit")
+);
+impl_native_exception!(
+    PyArithmeticError,
+    PyExc_ArithmeticError,
+    native_doc!("ArithmeticError")
+);
+impl_native_exception!(PyLookupError, PyExc_LookupError, native_doc!("LookupError"));
+
+impl_native_exception!(
+    PyAssertionError,
+    PyExc_AssertionError,
+    native_doc!("AssertionError")
+);
+impl_native_exception!(
+    PyAttributeError,
+    PyExc_AttributeError,
+    native_doc!("AttributeError")
+);
+impl_native_exception!(PyBufferError, PyExc_BufferError, native_doc!("BufferError"));
+impl_native_exception!(PyEOFError, PyExc_EOFError, native_doc!("EOFError"));
+impl_native_exception!(
+    PyFloatingPointError,
+    PyExc_FloatingPointError,
+    native_doc!("FloatingPointError")
+);
+#[cfg(not(any(PyPy, GraalPy)))]
+impl_native_exception!(
+    PyOSError,
+    PyExc_OSError,
+    native_doc!("OSError"),
+    ffi::PyOSErrorObject
+);
+#[cfg(any(PyPy, GraalPy))]
+impl_native_exception!(PyOSError, PyExc_OSError, native_doc!("OSError"));
+impl_native_exception!(PyImportError, PyExc_ImportError, native_doc!("ImportError"));
+
+impl_native_exception!(
+    PyModuleNotFoundError,
+    PyExc_ModuleNotFoundError,
+    native_doc!("ModuleNotFoundError")
+);
+
+impl_native_exception!(PyIndexError, PyExc_IndexError, native_doc!("IndexError"));
+impl_native_exception!(PyKeyError, PyExc_KeyError, native_doc!("KeyError"));
+impl_native_exception!(
+    PyKeyboardInterrupt,
+    PyExc_KeyboardInterrupt,
+    native_doc!("KeyboardInterrupt")
+);
+impl_native_exception!(PyMemoryError, PyExc_MemoryError, native_doc!("MemoryError"));
+impl_native_exception!(PyNameError, PyExc_NameError, native_doc!("NameError"));
+impl_native_exception!(
+    PyOverflowError,
+    PyExc_OverflowError,
+    native_doc!("OverflowError")
+);
+impl_native_exception!(
+    PyRuntimeError,
+    PyExc_RuntimeError,
+    native_doc!("RuntimeError")
+);
+impl_native_exception!(
+    PyRecursionError,
+    PyExc_RecursionError,
+    native_doc!("RecursionError")
+);
+impl_native_exception!(
+    PyNotImplementedError,
+    PyExc_NotImplementedError,
+    native_doc!("NotImplementedError")
+);
+#[cfg(not(any(PyPy, GraalPy)))]
+impl_native_exception!(
+    PySyntaxError,
+    PyExc_SyntaxError,
+    native_doc!("SyntaxError"),
+    ffi::PySyntaxErrorObject
+);
+#[cfg(any(PyPy, GraalPy))]
+impl_native_exception!(PySyntaxError, PyExc_SyntaxError, native_doc!("SyntaxError"));
+impl_native_exception!(
+    PyReferenceError,
+    PyExc_ReferenceError,
+    native_doc!("ReferenceError")
+);
+impl_native_exception!(PySystemError, PyExc_SystemError, native_doc!("SystemError"));
+#[cfg(not(any(PyPy, GraalPy)))]
+impl_native_exception!(
+    PySystemExit,
+    PyExc_SystemExit,
+    native_doc!("SystemExit"),
+    ffi::PySystemExitObject
+);
+#[cfg(any(PyPy, GraalPy))]
+impl_native_exception!(PySystemExit, PyExc_SystemExit, native_doc!("SystemExit"));
+impl_native_exception!(PyTypeError, PyExc_TypeError, native_doc!("TypeError"));
+impl_native_exception!(
+    PyUnboundLocalError,
+    PyExc_UnboundLocalError,
+    native_doc!("UnboundLocalError")
+);
+#[cfg(not(any(PyPy, GraalPy)))]
+impl_native_exception!(
+    PyUnicodeError,
+    PyExc_UnicodeError,
+    native_doc!("UnicodeError"),
+    ffi::PyUnicodeErrorObject
+);
+#[cfg(any(PyPy, GraalPy))]
+impl_native_exception!(
+    PyUnicodeError,
+    PyExc_UnicodeError,
+    native_doc!("UnicodeError")
+);
+// these four errors need arguments, so they're too annoying to write tests for using macros...
+impl_native_exception!(
+    PyUnicodeDecodeError,
+    PyExc_UnicodeDecodeError,
+    native_doc!("UnicodeDecodeError", "")
+);
+impl_native_exception!(
+    PyUnicodeEncodeError,
+    PyExc_UnicodeEncodeError,
+    native_doc!("UnicodeEncodeError", "")
+);
+impl_native_exception!(
+    PyUnicodeTranslateError,
+    PyExc_UnicodeTranslateError,
+    native_doc!("UnicodeTranslateError", "")
+);
+#[cfg(Py_3_11)]
+impl_native_exception!(
+    PyBaseExceptionGroup,
+    PyExc_BaseExceptionGroup,
+    native_doc!("BaseExceptionGroup", "")
+);
+impl_native_exception!(PyValueError, PyExc_ValueError, native_doc!("ValueError"));
+impl_native_exception!(
+    PyZeroDivisionError,
+    PyExc_ZeroDivisionError,
+    native_doc!("ZeroDivisionError")
+);
+
+impl_native_exception!(
+    PyBlockingIOError,
+    PyExc_BlockingIOError,
+    native_doc!("BlockingIOError")
+);
+impl_native_exception!(
+    PyBrokenPipeError,
+    PyExc_BrokenPipeError,
+    native_doc!("BrokenPipeError")
+);
+impl_native_exception!(
+    PyChildProcessError,
+    PyExc_ChildProcessError,
+    native_doc!("ChildProcessError")
+);
+impl_native_exception!(
+    PyConnectionError,
+    PyExc_ConnectionError,
+    native_doc!("ConnectionError")
+);
+impl_native_exception!(
+    PyConnectionAbortedError,
+    PyExc_ConnectionAbortedError,
+    native_doc!("ConnectionAbortedError")
+);
+impl_native_exception!(
+    PyConnectionRefusedError,
+    PyExc_ConnectionRefusedError,
+    native_doc!("ConnectionRefusedError")
+);
+impl_native_exception!(
+    PyConnectionResetError,
+    PyExc_ConnectionResetError,
+    native_doc!("ConnectionResetError")
+);
+impl_native_exception!(
+    PyFileExistsError,
+    PyExc_FileExistsError,
+    native_doc!("FileExistsError")
+);
+impl_native_exception!(
+    PyFileNotFoundError,
+    PyExc_FileNotFoundError,
+    native_doc!("FileNotFoundError")
+);
+impl_native_exception!(
+    PyInterruptedError,
+    PyExc_InterruptedError,
+    native_doc!("InterruptedError")
+);
+impl_native_exception!(
+    PyIsADirectoryError,
+    PyExc_IsADirectoryError,
+    native_doc!("IsADirectoryError")
+);
+impl_native_exception!(
+    PyNotADirectoryError,
+    PyExc_NotADirectoryError,
+    native_doc!("NotADirectoryError")
+);
+impl_native_exception!(
+    PyPermissionError,
+    PyExc_PermissionError,
+    native_doc!("PermissionError")
+);
+impl_native_exception!(
+    PyProcessLookupError,
+    PyExc_ProcessLookupError,
+    native_doc!("ProcessLookupError")
+);
+impl_native_exception!(
+    PyTimeoutError,
+    PyExc_TimeoutError,
+    native_doc!("TimeoutError")
+);
+
+impl_native_exception!(
+    PyEnvironmentError,
+    PyExc_EnvironmentError,
+    native_doc!("EnvironmentError")
+);
+impl_native_exception!(PyIOError, PyExc_IOError, native_doc!("IOError"));
+
+#[cfg(windows)]
+impl_windows_native_exception!(
+    PyWindowsError,
+    PyExc_WindowsError,
+    native_doc!("WindowsError")
+);
+
+impl PyUnicodeDecodeError {
+    /// Deprecated form of [`PyUnicodeDecodeError::new_bound`].
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyUnicodeDecodeError::new` will be replaced by `PyUnicodeDecodeError::new_bound` in a future PyO3 version"
+    )]
+    pub fn new<'p>(
+        py: Python<'p>,
+        encoding: &CStr,
+        input: &[u8],
+        range: ops::Range<usize>,
+        reason: &CStr,
+    ) -> PyResult<&'p PyUnicodeDecodeError> {
+        Ok(PyUnicodeDecodeError::new_bound(py, encoding, input, range, reason)?.into_gil_ref())
+    }
+
+    /// Creates a Python `UnicodeDecodeError`.
+    pub fn new_bound<'p>(
+        py: Python<'p>,
+        encoding: &CStr,
+        input: &[u8],
+        range: ops::Range<usize>,
+        reason: &CStr,
+    ) -> PyResult<Bound<'p, PyUnicodeDecodeError>> {
+        use crate::ffi_ptr_ext::FfiPtrExt;
+        use crate::py_result_ext::PyResultExt;
+        unsafe {
+            ffi::PyUnicodeDecodeError_Create(
+                encoding.as_ptr(),
+                input.as_ptr().cast(),
+                input.len() as ffi::Py_ssize_t,
+                range.start as ffi::Py_ssize_t,
+                range.end as ffi::Py_ssize_t,
+                reason.as_ptr(),
+            )
+            .assume_owned_or_err(py)
+        }
+        .downcast_into()
+    }
+
+    /// Deprecated form of [`PyUnicodeDecodeError::new_utf8_bound`].
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyUnicodeDecodeError::new_utf8` will be replaced by `PyUnicodeDecodeError::new_utf8_bound` in a future PyO3 version"
+    )]
+    pub fn new_utf8<'p>(
+        py: Python<'p>,
+        input: &[u8],
+        err: std::str::Utf8Error,
+    ) -> PyResult<&'p PyUnicodeDecodeError> {
+        Ok(PyUnicodeDecodeError::new_utf8_bound(py, input, err)?.into_gil_ref())
+    }
+
+    /// Creates a Python `UnicodeDecodeError` from a Rust UTF-8 decoding error.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// #![cfg_attr(invalid_from_utf8_lint, allow(invalid_from_utf8))]
+    /// use pyo3::prelude::*;
+    /// use pyo3::exceptions::PyUnicodeDecodeError;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let invalid_utf8 = b"fo\xd8o";
+    ///     let err = std::str::from_utf8(invalid_utf8).expect_err("should be invalid utf8");
+    ///     let decode_err = PyUnicodeDecodeError::new_utf8_bound(py, invalid_utf8, err)?;
+    ///     assert_eq!(
+    ///         decode_err.to_string(),
+    ///         "'utf-8' codec can't decode byte 0xd8 in position 2: invalid utf-8"
+    ///     );
+    ///     Ok(())
+    /// })
+    /// # }
+    pub fn new_utf8_bound<'p>(
+        py: Python<'p>,
+        input: &[u8],
+        err: std::str::Utf8Error,
+    ) -> PyResult<Bound<'p, PyUnicodeDecodeError>> {
+        let pos = err.valid_up_to();
+        PyUnicodeDecodeError::new_bound(
+            py,
+            ffi::c_str!("utf-8"),
+            input,
+            pos..(pos + 1),
+            ffi::c_str!("invalid utf-8"),
+        )
+    }
+}
+
+impl_native_exception!(PyWarning, PyExc_Warning, native_doc!("Warning"));
+impl_native_exception!(PyUserWarning, PyExc_UserWarning, native_doc!("UserWarning"));
+impl_native_exception!(
+    PyDeprecationWarning,
+    PyExc_DeprecationWarning,
+    native_doc!("DeprecationWarning")
+);
+impl_native_exception!(
+    PyPendingDeprecationWarning,
+    PyExc_PendingDeprecationWarning,
+    native_doc!("PendingDeprecationWarning")
+);
+impl_native_exception!(
+    PySyntaxWarning,
+    PyExc_SyntaxWarning,
+    native_doc!("SyntaxWarning")
+);
+impl_native_exception!(
+    PyRuntimeWarning,
+    PyExc_RuntimeWarning,
+    native_doc!("RuntimeWarning")
+);
+impl_native_exception!(
+    PyFutureWarning,
+    PyExc_FutureWarning,
+    native_doc!("FutureWarning")
+);
+impl_native_exception!(
+    PyImportWarning,
+    PyExc_ImportWarning,
+    native_doc!("ImportWarning")
+);
+impl_native_exception!(
+    PyUnicodeWarning,
+    PyExc_UnicodeWarning,
+    native_doc!("UnicodeWarning")
+);
+impl_native_exception!(
+    PyBytesWarning,
+    PyExc_BytesWarning,
+    native_doc!("BytesWarning")
+);
+impl_native_exception!(
+    PyResourceWarning,
+    PyExc_ResourceWarning,
+    native_doc!("ResourceWarning")
+);
+
+#[cfg(Py_3_10)]
+impl_native_exception!(
+    PyEncodingWarning,
+    PyExc_EncodingWarning,
+    native_doc!("EncodingWarning")
+);
+
+#[cfg(test)]
+macro_rules! test_exception {
+    ($exc_ty:ident $(, |$py:tt| $constructor:expr )?) => {
+        #[allow(non_snake_case)]
+        #[test]
+        fn $exc_ty () {
+            use super::$exc_ty;
+
+            $crate::Python::with_gil(|py| {
+                use $crate::types::PyAnyMethods;
+                let err: $crate::PyErr = {
+                    None
+                    $(
+                        .or(Some({ let $py = py; $constructor }))
+                    )?
+                        .unwrap_or($exc_ty::new_err("a test exception"))
+                };
+
+                assert!(err.is_instance_of::<$exc_ty>(py));
+
+                let value = err.value_bound(py).as_any().downcast::<$exc_ty>().unwrap();
+
+                #[cfg(feature = "gil-refs")]
+                {
+                    use std::error::Error;
+                    let value = value.as_gil_ref();
+                    assert!(value.source().is_none());
+
+                    err.set_cause(py, Some($crate::exceptions::PyValueError::new_err("a cause")));
+                    assert!(value.source().is_some());
+                }
+
+                assert!($crate::PyErr::from(value.clone()).is_instance_of::<$exc_ty>(py));
+            })
+        }
+    };
+}
+
+/// Exceptions defined in Python's [`asyncio`](https://docs.python.org/3/library/asyncio.html)
+/// module.
+pub mod asyncio {
+    import_exception!(asyncio, CancelledError);
+    import_exception!(asyncio, InvalidStateError);
+    import_exception!(asyncio, TimeoutError);
+    import_exception!(asyncio, IncompleteReadError);
+    import_exception!(asyncio, LimitOverrunError);
+    import_exception!(asyncio, QueueEmpty);
+    import_exception!(asyncio, QueueFull);
+
+    #[cfg(test)]
+    mod tests {
+        test_exception!(CancelledError);
+        test_exception!(InvalidStateError);
+        test_exception!(TimeoutError);
+        test_exception!(IncompleteReadError, |_| IncompleteReadError::new_err((
+            "partial", "expected"
+        )));
+        test_exception!(LimitOverrunError, |_| LimitOverrunError::new_err((
+            "message", "consumed"
+        )));
+        test_exception!(QueueEmpty);
+        test_exception!(QueueFull);
+    }
+}
+
+/// Exceptions defined in Python's [`socket`](https://docs.python.org/3/library/socket.html)
+/// module.
+pub mod socket {
+    import_exception!(socket, herror);
+    import_exception!(socket, gaierror);
+    import_exception!(socket, timeout);
+
+    #[cfg(test)]
+    mod tests {
+        test_exception!(herror);
+        test_exception!(gaierror);
+        test_exception!(timeout);
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::types::any::PyAnyMethods;
+    use crate::types::{IntoPyDict, PyDict};
+    use crate::PyErr;
+    #[cfg(feature = "gil-refs")]
+    use crate::PyNativeType;
+
+    import_exception_bound!(socket, gaierror);
+    import_exception_bound!(email.errors, MessageError);
+
+    #[test]
+    fn test_check_exception() {
+        Python::with_gil(|py| {
+            let err: PyErr = gaierror::new_err(());
+            let socket = py
+                .import_bound("socket")
+                .map_err(|e| e.display(py))
+                .expect("could not import socket");
+
+            let d = PyDict::new_bound(py);
+            d.set_item("socket", socket)
+                .map_err(|e| e.display(py))
+                .expect("could not setitem");
+
+            d.set_item("exc", err)
+                .map_err(|e| e.display(py))
+                .expect("could not setitem");
+
+            py.run_bound("assert isinstance(exc, socket.gaierror)", None, Some(&d))
+                .map_err(|e| e.display(py))
+                .expect("assertion failed");
+        });
+    }
+
+    #[test]
+    fn test_check_exception_nested() {
+        Python::with_gil(|py| {
+            let err: PyErr = MessageError::new_err(());
+            let email = py
+                .import_bound("email")
+                .map_err(|e| e.display(py))
+                .expect("could not import email");
+
+            let d = PyDict::new_bound(py);
+            d.set_item("email", email)
+                .map_err(|e| e.display(py))
+                .expect("could not setitem");
+            d.set_item("exc", err)
+                .map_err(|e| e.display(py))
+                .expect("could not setitem");
+
+            py.run_bound(
+                "assert isinstance(exc, email.errors.MessageError)",
+                None,
+                Some(&d),
+            )
+            .map_err(|e| e.display(py))
+            .expect("assertion failed");
+        });
+    }
+
+    #[test]
+    fn custom_exception() {
+        create_exception!(mymodule, CustomError, PyException);
+
+        Python::with_gil(|py| {
+            let error_type = py.get_type_bound::<CustomError>();
+            let ctx = [("CustomError", error_type)].into_py_dict_bound(py);
+            let type_description: String = py
+                .eval_bound("str(CustomError)", None, Some(&ctx))
+                .unwrap()
+                .extract()
+                .unwrap();
+            assert_eq!(type_description, "<class 'mymodule.CustomError'>");
+            py.run_bound(
+                "assert CustomError('oops').args == ('oops',)",
+                None,
+                Some(&ctx),
+            )
+            .unwrap();
+            py.run_bound("assert CustomError.__doc__ is None", None, Some(&ctx))
+                .unwrap();
+        });
+    }
+
+    #[test]
+    fn custom_exception_dotted_module() {
+        create_exception!(mymodule.exceptions, CustomError, PyException);
+        Python::with_gil(|py| {
+            let error_type = py.get_type_bound::<CustomError>();
+            let ctx = [("CustomError", error_type)].into_py_dict_bound(py);
+            let type_description: String = py
+                .eval_bound("str(CustomError)", None, Some(&ctx))
+                .unwrap()
+                .extract()
+                .unwrap();
+            assert_eq!(
+                type_description,
+                "<class 'mymodule.exceptions.CustomError'>"
+            );
+        });
+    }
+
+    #[test]
+    fn custom_exception_doc() {
+        create_exception!(mymodule, CustomError, PyException, "Some docs");
+
+        Python::with_gil(|py| {
+            let error_type = py.get_type_bound::<CustomError>();
+            let ctx = [("CustomError", error_type)].into_py_dict_bound(py);
+            let type_description: String = py
+                .eval_bound("str(CustomError)", None, Some(&ctx))
+                .unwrap()
+                .extract()
+                .unwrap();
+            assert_eq!(type_description, "<class 'mymodule.CustomError'>");
+            py.run_bound(
+                "assert CustomError('oops').args == ('oops',)",
+                None,
+                Some(&ctx),
+            )
+            .unwrap();
+            py.run_bound(
+                "assert CustomError.__doc__ == 'Some docs'",
+                None,
+                Some(&ctx),
+            )
+            .unwrap();
+        });
+    }
+
+    #[test]
+    fn custom_exception_doc_expr() {
+        create_exception!(
+            mymodule,
+            CustomError,
+            PyException,
+            concat!("Some", " more ", stringify!(docs))
+        );
+
+        Python::with_gil(|py| {
+            let error_type = py.get_type_bound::<CustomError>();
+            let ctx = [("CustomError", error_type)].into_py_dict_bound(py);
+            let type_description: String = py
+                .eval_bound("str(CustomError)", None, Some(&ctx))
+                .unwrap()
+                .extract()
+                .unwrap();
+            assert_eq!(type_description, "<class 'mymodule.CustomError'>");
+            py.run_bound(
+                "assert CustomError('oops').args == ('oops',)",
+                None,
+                Some(&ctx),
+            )
+            .unwrap();
+            py.run_bound(
+                "assert CustomError.__doc__ == 'Some more docs'",
+                None,
+                Some(&ctx),
+            )
+            .unwrap();
+        });
+    }
+
+    #[test]
+    fn native_exception_debug() {
+        Python::with_gil(|py| {
+            let exc = py
+                .run_bound("raise Exception('banana')", None, None)
+                .expect_err("raising should have given us an error")
+                .into_value(py)
+                .into_bound(py);
+            assert_eq!(
+                format!("{:?}", exc),
+                exc.repr().unwrap().extract::<String>().unwrap()
+            );
+        });
+    }
+
+    #[test]
+    fn native_exception_display() {
+        Python::with_gil(|py| {
+            let exc = py
+                .run_bound("raise Exception('banana')", None, None)
+                .expect_err("raising should have given us an error")
+                .into_value(py)
+                .into_bound(py);
+            assert_eq!(
+                exc.to_string(),
+                exc.str().unwrap().extract::<String>().unwrap()
+            );
+        });
+    }
+
+    #[test]
+    #[cfg(feature = "gil-refs")]
+    fn native_exception_chain() {
+        use std::error::Error;
+
+        Python::with_gil(|py| {
+            #[allow(deprecated)]
+            let exc = py
+                .run_bound(
+                    "raise Exception('banana') from TypeError('peach')",
+                    None,
+                    None,
+                )
+                .expect_err("raising should have given us an error")
+                .into_value(py)
+                .into_ref(py);
+
+            assert_eq!(format!("{:?}", exc), "Exception('banana')");
+
+            let source = exc.source().expect("cause should exist");
+
+            assert_eq!(format!("{:?}", source), "TypeError('peach')");
+
+            let source_source = source.source();
+            assert!(source_source.is_none(), "source_source should be None");
+        });
+    }
+
+    #[test]
+    fn unicode_decode_error() {
+        let invalid_utf8 = b"fo\xd8o";
+        #[cfg_attr(invalid_from_utf8_lint, allow(invalid_from_utf8))]
+        let err = std::str::from_utf8(invalid_utf8).expect_err("should be invalid utf8");
+        Python::with_gil(|py| {
+            let decode_err = PyUnicodeDecodeError::new_utf8_bound(py, invalid_utf8, err).unwrap();
+            assert_eq!(
+                format!("{:?}", decode_err),
+                "UnicodeDecodeError('utf-8', b'fo\\xd8o', 2, 3, 'invalid utf-8')"
+            );
+
+            // Restoring should preserve the same error
+            let e: PyErr = decode_err.into();
+            e.restore(py);
+
+            assert_eq!(
+                PyErr::fetch(py).to_string(),
+                "UnicodeDecodeError: \'utf-8\' codec can\'t decode byte 0xd8 in position 2: invalid utf-8"
+            );
+        });
+    }
+    #[cfg(Py_3_11)]
+    test_exception!(PyBaseExceptionGroup, |_| PyBaseExceptionGroup::new_err((
+        "msg",
+        vec![PyValueError::new_err("err")]
+    )));
+    test_exception!(PyBaseException);
+    test_exception!(PyException);
+    test_exception!(PyStopAsyncIteration);
+    test_exception!(PyStopIteration);
+    test_exception!(PyGeneratorExit);
+    test_exception!(PyArithmeticError);
+    test_exception!(PyLookupError);
+    test_exception!(PyAssertionError);
+    test_exception!(PyAttributeError);
+    test_exception!(PyBufferError);
+    test_exception!(PyEOFError);
+    test_exception!(PyFloatingPointError);
+    test_exception!(PyOSError);
+    test_exception!(PyImportError);
+    test_exception!(PyModuleNotFoundError);
+    test_exception!(PyIndexError);
+    test_exception!(PyKeyError);
+    test_exception!(PyKeyboardInterrupt);
+    test_exception!(PyMemoryError);
+    test_exception!(PyNameError);
+    test_exception!(PyOverflowError);
+    test_exception!(PyRuntimeError);
+    test_exception!(PyRecursionError);
+    test_exception!(PyNotImplementedError);
+    test_exception!(PySyntaxError);
+    test_exception!(PyReferenceError);
+    test_exception!(PySystemError);
+    test_exception!(PySystemExit);
+    test_exception!(PyTypeError);
+    test_exception!(PyUnboundLocalError);
+    test_exception!(PyUnicodeError);
+    test_exception!(PyUnicodeDecodeError, |py| {
+        let invalid_utf8 = b"fo\xd8o";
+        #[cfg_attr(invalid_from_utf8_lint, allow(invalid_from_utf8))]
+        let err = std::str::from_utf8(invalid_utf8).expect_err("should be invalid utf8");
+        PyErr::from_value_bound(
+            PyUnicodeDecodeError::new_utf8_bound(py, invalid_utf8, err)
+                .unwrap()
+                .into_any(),
+        )
+    });
+    test_exception!(PyUnicodeEncodeError, |py| py
+        .eval_bound("chr(40960).encode('ascii')", None, None)
+        .unwrap_err());
+    test_exception!(PyUnicodeTranslateError, |_| {
+        PyUnicodeTranslateError::new_err(("\u{3042}", 0, 1, "ouch"))
+    });
+    test_exception!(PyValueError);
+    test_exception!(PyZeroDivisionError);
+    test_exception!(PyBlockingIOError);
+    test_exception!(PyBrokenPipeError);
+    test_exception!(PyChildProcessError);
+    test_exception!(PyConnectionError);
+    test_exception!(PyConnectionAbortedError);
+    test_exception!(PyConnectionRefusedError);
+    test_exception!(PyConnectionResetError);
+    test_exception!(PyFileExistsError);
+    test_exception!(PyFileNotFoundError);
+    test_exception!(PyInterruptedError);
+    test_exception!(PyIsADirectoryError);
+    test_exception!(PyNotADirectoryError);
+    test_exception!(PyPermissionError);
+    test_exception!(PyProcessLookupError);
+    test_exception!(PyTimeoutError);
+    test_exception!(PyEnvironmentError);
+    test_exception!(PyIOError);
+    #[cfg(windows)]
+    test_exception!(PyWindowsError);
+
+    test_exception!(PyWarning);
+    test_exception!(PyUserWarning);
+    test_exception!(PyDeprecationWarning);
+    test_exception!(PyPendingDeprecationWarning);
+    test_exception!(PySyntaxWarning);
+    test_exception!(PyRuntimeWarning);
+    test_exception!(PyFutureWarning);
+    test_exception!(PyImportWarning);
+    test_exception!(PyUnicodeWarning);
+    test_exception!(PyBytesWarning);
+    #[cfg(Py_3_10)]
+    test_exception!(PyEncodingWarning);
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/ffi/mod.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/ffi/mod.rs
--- 43.0.0-1/rust-vendor/pyo3/src/ffi/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/ffi/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,31 @@
+//! Raw FFI declarations for Python's C API.
+//!
+//! This module provides low level bindings to the Python interpreter.
+//! It is meant for advanced users only - regular PyO3 users shouldn't
+//! need to interact with this module at all.
+//!
+//! The contents of this module are not documented here, as it would entail
+//! basically copying the documentation from CPython. Consult the [Python/C API Reference
+//! Manual][capi] for up-to-date documentation.
+//!
+//! # Safety
+//!
+//! The functions in this module lack individual safety documentation, but
+//! generally the following apply:
+//! - Pointer arguments have to point to a valid Python object of the correct type,
+//!   although null pointers are sometimes valid input.
+//! - The vast majority can only be used safely while the GIL is held.
+//! - Some functions have additional safety requirements, consult the
+//!   [Python/C API Reference Manual][capi] for more information.
+//!
+//! [capi]: https://docs.python.org/3/c-api/index.html
+
+#[cfg(test)]
+mod tests;
+
+//  reexport raw bindings exposed in pyo3_ffi
+pub use pyo3_ffi::*;
+
+/// Helper to enable #\[pymethods\] to see the workaround for __ipow__ on Python 3.7
+#[doc(hidden)]
+pub use crate::impl_::pymethods::ipowfunc;
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/ffi/tests.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/ffi/tests.rs
--- 43.0.0-1/rust-vendor/pyo3/src/ffi/tests.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/ffi/tests.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,322 @@
+use crate::ffi::*;
+use crate::types::any::PyAnyMethods;
+use crate::Python;
+
+#[cfg(all(not(Py_LIMITED_API), any(not(PyPy), feature = "macros")))]
+use crate::types::PyString;
+
+#[cfg(not(Py_LIMITED_API))]
+use crate::{types::PyDict, Bound, IntoPy, Py, PyAny};
+#[cfg(not(any(Py_3_12, Py_LIMITED_API)))]
+use libc::wchar_t;
+
+#[cfg(not(Py_LIMITED_API))]
+#[cfg_attr(target_arch = "wasm32", ignore)] // DateTime import fails on wasm for mysterious reasons
+#[test]
+fn test_datetime_fromtimestamp() {
+    Python::with_gil(|py| {
+        let args: Py<PyAny> = (100,).into_py(py);
+        let dt = unsafe {
+            PyDateTime_IMPORT();
+            Bound::from_owned_ptr(py, PyDateTime_FromTimestamp(args.as_ptr()))
+        };
+        let locals = PyDict::new_bound(py);
+        locals.set_item("dt", dt).unwrap();
+        py.run_bound(
+            "import datetime; assert dt == datetime.datetime.fromtimestamp(100)",
+            None,
+            Some(&locals),
+        )
+        .unwrap();
+    })
+}
+
+#[cfg(not(Py_LIMITED_API))]
+#[cfg_attr(target_arch = "wasm32", ignore)] // DateTime import fails on wasm for mysterious reasons
+#[test]
+fn test_date_fromtimestamp() {
+    Python::with_gil(|py| {
+        let args: Py<PyAny> = (100,).into_py(py);
+        let dt = unsafe {
+            PyDateTime_IMPORT();
+            Bound::from_owned_ptr(py, PyDate_FromTimestamp(args.as_ptr()))
+        };
+        let locals = PyDict::new_bound(py);
+        locals.set_item("dt", dt).unwrap();
+        py.run_bound(
+            "import datetime; assert dt == datetime.date.fromtimestamp(100)",
+            None,
+            Some(&locals),
+        )
+        .unwrap();
+    })
+}
+
+#[cfg(not(Py_LIMITED_API))]
+#[cfg_attr(target_arch = "wasm32", ignore)] // DateTime import fails on wasm for mysterious reasons
+#[test]
+fn test_utc_timezone() {
+    Python::with_gil(|py| {
+        let utc_timezone: Bound<'_, PyAny> = unsafe {
+            PyDateTime_IMPORT();
+            Bound::from_borrowed_ptr(py, PyDateTime_TimeZone_UTC())
+        };
+        let locals = PyDict::new_bound(py);
+        locals.set_item("utc_timezone", utc_timezone).unwrap();
+        py.run_bound(
+            "import datetime; assert utc_timezone is datetime.timezone.utc",
+            None,
+            Some(&locals),
+        )
+        .unwrap();
+    })
+}
+
+#[test]
+#[cfg(not(Py_LIMITED_API))]
+#[cfg(feature = "macros")]
+#[cfg_attr(target_arch = "wasm32", ignore)] // DateTime import fails on wasm for mysterious reasons
+fn test_timezone_from_offset() {
+    use crate::{ffi_ptr_ext::FfiPtrExt, types::PyDelta};
+
+    Python::with_gil(|py| {
+        let delta = PyDelta::new_bound(py, 0, 100, 0, false).unwrap();
+        let tz = unsafe { PyTimeZone_FromOffset(delta.as_ptr()).assume_owned(py) };
+        crate::py_run!(
+            py,
+            tz,
+            "import datetime; assert tz == datetime.timezone(datetime.timedelta(seconds=100))"
+        );
+    })
+}
+
+#[test]
+#[cfg(not(Py_LIMITED_API))]
+#[cfg(feature = "macros")]
+#[cfg_attr(target_arch = "wasm32", ignore)] // DateTime import fails on wasm for mysterious reasons
+fn test_timezone_from_offset_and_name() {
+    use crate::{ffi_ptr_ext::FfiPtrExt, types::PyDelta};
+
+    Python::with_gil(|py| {
+        let delta = PyDelta::new_bound(py, 0, 100, 0, false).unwrap();
+        let tzname = PyString::new_bound(py, "testtz");
+        let tz = unsafe {
+            PyTimeZone_FromOffsetAndName(delta.as_ptr(), tzname.as_ptr()).assume_owned(py)
+        };
+        crate::py_run!(
+            py,
+            tz,
+            "import datetime; assert tz == datetime.timezone(datetime.timedelta(seconds=100), 'testtz')"
+        );
+    })
+}
+
+#[test]
+#[cfg(not(Py_LIMITED_API))]
+fn ascii_object_bitfield() {
+    let ob_base: PyObject = unsafe { std::mem::zeroed() };
+
+    let mut o = PyASCIIObject {
+        ob_base,
+        length: 0,
+        #[cfg(not(PyPy))]
+        hash: 0,
+        state: 0u32,
+        #[cfg(not(Py_3_12))]
+        wstr: std::ptr::null_mut() as *mut wchar_t,
+    };
+
+    unsafe {
+        assert_eq!(o.interned(), 0);
+        assert_eq!(o.kind(), 0);
+        assert_eq!(o.compact(), 0);
+        assert_eq!(o.ascii(), 0);
+        #[cfg(not(Py_3_12))]
+        assert_eq!(o.ready(), 0);
+
+        let interned_count = if cfg!(Py_3_12) { 2 } else { 4 };
+
+        for i in 0..interned_count {
+            o.set_interned(i);
+            assert_eq!(o.interned(), i);
+        }
+
+        for i in 0..8 {
+            o.set_kind(i);
+            assert_eq!(o.kind(), i);
+        }
+
+        o.set_compact(1);
+        assert_eq!(o.compact(), 1);
+
+        o.set_ascii(1);
+        assert_eq!(o.ascii(), 1);
+
+        #[cfg(not(Py_3_12))]
+        o.set_ready(1);
+        #[cfg(not(Py_3_12))]
+        assert_eq!(o.ready(), 1);
+    }
+}
+
+#[test]
+#[cfg(not(any(Py_LIMITED_API, PyPy)))]
+fn ascii() {
+    Python::with_gil(|py| {
+        // This test relies on implementation details of PyString.
+        let s = PyString::new_bound(py, "hello, world");
+        let ptr = s.as_ptr();
+
+        unsafe {
+            let ascii_ptr = ptr as *mut PyASCIIObject;
+            let ascii = ascii_ptr.as_ref().unwrap();
+
+            assert_eq!(ascii.interned(), 0);
+            assert_eq!(ascii.kind(), PyUnicode_1BYTE_KIND);
+            assert_eq!(ascii.compact(), 1);
+            assert_eq!(ascii.ascii(), 1);
+            #[cfg(not(Py_3_12))]
+            assert_eq!(ascii.ready(), 1);
+
+            assert_eq!(PyUnicode_IS_ASCII(ptr), 1);
+            assert_eq!(PyUnicode_IS_COMPACT(ptr), 1);
+            assert_eq!(PyUnicode_IS_COMPACT_ASCII(ptr), 1);
+
+            assert!(!PyUnicode_1BYTE_DATA(ptr).is_null());
+            // 2 and 4 byte macros return nonsense for this string instance.
+            assert_eq!(PyUnicode_KIND(ptr), PyUnicode_1BYTE_KIND);
+
+            assert!(!_PyUnicode_COMPACT_DATA(ptr).is_null());
+            // _PyUnicode_NONCOMPACT_DATA isn't valid for compact strings.
+            assert!(!PyUnicode_DATA(ptr).is_null());
+
+            assert_eq!(PyUnicode_GET_LENGTH(ptr), s.len().unwrap() as Py_ssize_t);
+            assert_eq!(PyUnicode_IS_READY(ptr), 1);
+
+            // This has potential to mutate object. But it should be a no-op since
+            // we're already ready.
+            assert_eq!(PyUnicode_READY(ptr), 0);
+        }
+    })
+}
+
+#[test]
+#[cfg(not(any(Py_LIMITED_API, PyPy)))]
+fn ucs4() {
+    Python::with_gil(|py| {
+        let s = "哈哈🐈";
+        let py_string = PyString::new_bound(py, s);
+        let ptr = py_string.as_ptr();
+
+        unsafe {
+            let ascii_ptr = ptr as *mut PyASCIIObject;
+            let ascii = ascii_ptr.as_ref().unwrap();
+
+            assert_eq!(ascii.interned(), 0);
+            assert_eq!(ascii.kind(), PyUnicode_4BYTE_KIND);
+            assert_eq!(ascii.compact(), 1);
+            assert_eq!(ascii.ascii(), 0);
+            #[cfg(not(Py_3_12))]
+            assert_eq!(ascii.ready(), 1);
+
+            assert_eq!(PyUnicode_IS_ASCII(ptr), 0);
+            assert_eq!(PyUnicode_IS_COMPACT(ptr), 1);
+            assert_eq!(PyUnicode_IS_COMPACT_ASCII(ptr), 0);
+
+            assert!(!PyUnicode_4BYTE_DATA(ptr).is_null());
+            assert_eq!(PyUnicode_KIND(ptr), PyUnicode_4BYTE_KIND);
+
+            assert!(!_PyUnicode_COMPACT_DATA(ptr).is_null());
+            // _PyUnicode_NONCOMPACT_DATA isn't valid for compact strings.
+            assert!(!PyUnicode_DATA(ptr).is_null());
+
+            assert_eq!(
+                PyUnicode_GET_LENGTH(ptr),
+                py_string.len().unwrap() as Py_ssize_t
+            );
+            assert_eq!(PyUnicode_IS_READY(ptr), 1);
+
+            // This has potential to mutate object. But it should be a no-op since
+            // we're already ready.
+            assert_eq!(PyUnicode_READY(ptr), 0);
+        }
+    })
+}
+
+#[test]
+#[cfg(not(Py_LIMITED_API))]
+#[cfg_attr(target_arch = "wasm32", ignore)] // DateTime import fails on wasm for mysterious reasons
+#[cfg(not(PyPy))]
+fn test_get_tzinfo() {
+    use crate::types::timezone_utc_bound;
+
+    crate::Python::with_gil(|py| {
+        use crate::types::{PyDateTime, PyTime};
+
+        let utc = &timezone_utc_bound(py);
+
+        let dt = PyDateTime::new_bound(py, 2018, 1, 1, 0, 0, 0, 0, Some(utc)).unwrap();
+
+        assert!(
+            unsafe { Bound::from_borrowed_ptr(py, PyDateTime_DATE_GET_TZINFO(dt.as_ptr())) }
+                .is(utc)
+        );
+
+        let dt = PyDateTime::new_bound(py, 2018, 1, 1, 0, 0, 0, 0, None).unwrap();
+
+        assert!(
+            unsafe { Bound::from_borrowed_ptr(py, PyDateTime_DATE_GET_TZINFO(dt.as_ptr())) }
+                .is_none()
+        );
+
+        let t = PyTime::new_bound(py, 0, 0, 0, 0, Some(utc)).unwrap();
+
+        assert!(
+            unsafe { Bound::from_borrowed_ptr(py, PyDateTime_TIME_GET_TZINFO(t.as_ptr())) }.is(utc)
+        );
+
+        let t = PyTime::new_bound(py, 0, 0, 0, 0, None).unwrap();
+
+        assert!(
+            unsafe { Bound::from_borrowed_ptr(py, PyDateTime_TIME_GET_TZINFO(t.as_ptr())) }
+                .is_none()
+        );
+    })
+}
+
+#[test]
+fn test_inc_dec_ref() {
+    Python::with_gil(|py| {
+        let obj = py.eval_bound("object()", None, None).unwrap();
+
+        let ref_count = obj.get_refcnt();
+        let ptr = obj.as_ptr();
+
+        unsafe { Py_INCREF(ptr) };
+
+        assert_eq!(obj.get_refcnt(), ref_count + 1);
+
+        unsafe { Py_DECREF(ptr) };
+
+        assert_eq!(obj.get_refcnt(), ref_count);
+    })
+}
+
+#[test]
+#[cfg(Py_3_12)]
+fn test_inc_dec_ref_immortal() {
+    Python::with_gil(|py| {
+        let obj = py.None();
+
+        let ref_count = obj.get_refcnt(py);
+        let ptr = obj.as_ptr();
+
+        unsafe { Py_INCREF(ptr) };
+
+        assert_eq!(obj.get_refcnt(py), ref_count);
+
+        unsafe { Py_DECREF(ptr) };
+
+        assert_eq!(obj.get_refcnt(py), ref_count);
+    })
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/ffi_ptr_ext.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/ffi_ptr_ext.rs
--- 43.0.0-1/rust-vendor/pyo3/src/ffi_ptr_ext.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/ffi_ptr_ext.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,70 @@
+use crate::sealed::Sealed;
+use crate::{
+    ffi,
+    instance::{Borrowed, Bound},
+    PyAny, PyResult, Python,
+};
+
+pub(crate) trait FfiPtrExt: Sealed {
+    unsafe fn assume_owned_or_err(self, py: Python<'_>) -> PyResult<Bound<'_, PyAny>>;
+    unsafe fn assume_owned_or_opt(self, py: Python<'_>) -> Option<Bound<'_, PyAny>>;
+    unsafe fn assume_owned(self, py: Python<'_>) -> Bound<'_, PyAny>;
+
+    /// Assumes this pointer is borrowed from a parent object.
+    ///
+    /// Warning: the lifetime `'a` is not bounded by the function arguments; the caller is
+    /// responsible to ensure this is tied to some appropriate lifetime.
+    unsafe fn assume_borrowed_or_err<'a>(self, py: Python<'_>)
+        -> PyResult<Borrowed<'a, '_, PyAny>>;
+
+    /// Same as `assume_borrowed_or_err`, but doesn't fetch an error on NULL.
+    unsafe fn assume_borrowed_or_opt<'a>(self, py: Python<'_>) -> Option<Borrowed<'a, '_, PyAny>>;
+
+    /// Same as `assume_borrowed_or_err`, but panics on NULL.
+    unsafe fn assume_borrowed<'a>(self, py: Python<'_>) -> Borrowed<'a, '_, PyAny>;
+
+    /// Same as `assume_borrowed_or_err`, but does not check for NULL.
+    unsafe fn assume_borrowed_unchecked<'a>(self, py: Python<'_>) -> Borrowed<'a, '_, PyAny>;
+}
+
+impl FfiPtrExt for *mut ffi::PyObject {
+    #[inline]
+    unsafe fn assume_owned_or_err(self, py: Python<'_>) -> PyResult<Bound<'_, PyAny>> {
+        Bound::from_owned_ptr_or_err(py, self)
+    }
+
+    #[inline]
+    unsafe fn assume_owned_or_opt(self, py: Python<'_>) -> Option<Bound<'_, PyAny>> {
+        Bound::from_owned_ptr_or_opt(py, self)
+    }
+
+    #[inline]
+    #[track_caller]
+    unsafe fn assume_owned(self, py: Python<'_>) -> Bound<'_, PyAny> {
+        Bound::from_owned_ptr(py, self)
+    }
+
+    #[inline]
+    unsafe fn assume_borrowed_or_err<'a>(
+        self,
+        py: Python<'_>,
+    ) -> PyResult<Borrowed<'a, '_, PyAny>> {
+        Borrowed::from_ptr_or_err(py, self)
+    }
+
+    #[inline]
+    unsafe fn assume_borrowed_or_opt<'a>(self, py: Python<'_>) -> Option<Borrowed<'a, '_, PyAny>> {
+        Borrowed::from_ptr_or_opt(py, self)
+    }
+
+    #[inline]
+    #[track_caller]
+    unsafe fn assume_borrowed<'a>(self, py: Python<'_>) -> Borrowed<'a, '_, PyAny> {
+        Borrowed::from_ptr(py, self)
+    }
+
+    #[inline]
+    unsafe fn assume_borrowed_unchecked<'a>(self, py: Python<'_>) -> Borrowed<'a, '_, PyAny> {
+        Borrowed::from_ptr_unchecked(py, self)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/gil.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/gil.rs
--- 43.0.0-1/rust-vendor/pyo3/src/gil.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/gil.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,866 @@
+//! Interaction with Python's global interpreter lock
+
+#[cfg(feature = "gil-refs")]
+use crate::impl_::not_send::{NotSend, NOT_SEND};
+#[cfg(pyo3_disable_reference_pool)]
+use crate::impl_::panic::PanicTrap;
+use crate::{ffi, Python};
+#[cfg(not(pyo3_disable_reference_pool))]
+use once_cell::sync::Lazy;
+use std::cell::Cell;
+#[cfg(all(feature = "gil-refs", debug_assertions))]
+use std::cell::RefCell;
+#[cfg(all(feature = "gil-refs", not(debug_assertions)))]
+use std::cell::UnsafeCell;
+use std::{mem, ptr::NonNull, sync};
+
+static START: sync::Once = sync::Once::new();
+
+std::thread_local! {
+    /// This is an internal counter in pyo3 monitoring whether this thread has the GIL.
+    ///
+    /// It will be incremented whenever a GILGuard or GILPool is created, and decremented whenever
+    /// they are dropped.
+    ///
+    /// As a result, if this thread has the GIL, GIL_COUNT is greater than zero.
+    ///
+    /// Additionally, we sometimes need to prevent safe access to the GIL,
+    /// e.g. when implementing `__traverse__`, which is represented by a negative value.
+    static GIL_COUNT: Cell<isize> = const { Cell::new(0) };
+
+    /// Temporarily hold objects that will be released when the GILPool drops.
+    #[cfg(all(feature = "gil-refs", debug_assertions))]
+    static OWNED_OBJECTS: RefCell<PyObjVec> = const { RefCell::new(Vec::new()) };
+    #[cfg(all(feature = "gil-refs", not(debug_assertions)))]
+    static OWNED_OBJECTS: UnsafeCell<PyObjVec> = const { UnsafeCell::new(Vec::new()) };
+}
+
+const GIL_LOCKED_DURING_TRAVERSE: isize = -1;
+
+/// Checks whether the GIL is acquired.
+///
+/// Note: This uses pyo3's internal count rather than PyGILState_Check for two reasons:
+///  1) for performance
+///  2) PyGILState_Check always returns 1 if the sub-interpreter APIs have ever been called,
+///     which could lead to incorrect conclusions that the GIL is held.
+#[inline(always)]
+fn gil_is_acquired() -> bool {
+    GIL_COUNT.try_with(|c| c.get() > 0).unwrap_or(false)
+}
+
+/// Prepares the use of Python in a free-threaded context.
+///
+/// If the Python interpreter is not already initialized, this function will initialize it with
+/// signal handling disabled (Python will not raise the `KeyboardInterrupt` exception). Python
+/// signal handling depends on the notion of a 'main thread', which must be the thread that
+/// initializes the Python interpreter.
+///
+/// If the Python interpreter is already initialized, this function has no effect.
+///
+/// This function is unavailable under PyPy because PyPy cannot be embedded in Rust (or any other
+/// software). Support for this is tracked on the
+/// [PyPy issue tracker](https://github.com/pypy/pypy/issues/3836).
+///
+/// # Examples
+/// ```rust
+/// use pyo3::prelude::*;
+///
+/// # fn main() -> PyResult<()> {
+/// pyo3::prepare_freethreaded_python();
+/// Python::with_gil(|py| py.run_bound("print('Hello World')", None, None))
+/// # }
+/// ```
+#[cfg(not(any(PyPy, GraalPy)))]
+pub fn prepare_freethreaded_python() {
+    // Protect against race conditions when Python is not yet initialized and multiple threads
+    // concurrently call 'prepare_freethreaded_python()'. Note that we do not protect against
+    // concurrent initialization of the Python runtime by other users of the Python C API.
+    START.call_once_force(|_| unsafe {
+        // Use call_once_force because if initialization panics, it's okay to try again.
+        if ffi::Py_IsInitialized() == 0 {
+            ffi::Py_InitializeEx(0);
+
+            // Release the GIL.
+            ffi::PyEval_SaveThread();
+        }
+    });
+}
+
+/// Executes the provided closure with an embedded Python interpreter.
+///
+/// This function initializes the Python interpreter, executes the provided closure, and then
+/// finalizes the Python interpreter.
+///
+/// After execution all Python resources are cleaned up, and no further Python APIs can be called.
+/// Because many Python modules implemented in C do not support multiple Python interpreters in a
+/// single process, it is not safe to call this function more than once. (Many such modules will not
+/// initialize correctly on the second run.)
+///
+/// # Panics
+/// - If the Python interpreter is already initialized before calling this function.
+///
+/// # Safety
+/// - This function should only ever be called once per process (usually as part of the `main`
+///   function). It is also not thread-safe.
+/// - No Python APIs can be used after this function has finished executing.
+/// - The return value of the closure must not contain any Python value, _including_ `PyResult`.
+///
+/// # Examples
+///
+/// ```rust
+/// unsafe {
+///     pyo3::with_embedded_python_interpreter(|py| {
+///         if let Err(e) = py.run_bound("print('Hello World')", None, None) {
+///             // We must make sure to not return a `PyErr`!
+///             e.print(py);
+///         }
+///     });
+/// }
+/// ```
+#[cfg(not(any(PyPy, GraalPy)))]
+pub unsafe fn with_embedded_python_interpreter<F, R>(f: F) -> R
+where
+    F: for<'p> FnOnce(Python<'p>) -> R,
+{
+    assert_eq!(
+        ffi::Py_IsInitialized(),
+        0,
+        "called `with_embedded_python_interpreter` but a Python interpreter is already running."
+    );
+
+    ffi::Py_InitializeEx(0);
+
+    let result = {
+        let guard = GILGuard::assume();
+        let py = guard.python();
+        // Import the threading module - this ensures that it will associate this thread as the "main"
+        // thread, which is important to avoid an `AssertionError` at finalization.
+        py.import_bound("threading").unwrap();
+
+        // Execute the closure.
+        f(py)
+    };
+
+    // Finalize the Python interpreter.
+    ffi::Py_Finalize();
+
+    result
+}
+
+/// RAII type that represents the Global Interpreter Lock acquisition.
+pub(crate) enum GILGuard {
+    /// Indicates the GIL was already held with this GILGuard was acquired.
+    Assumed,
+    /// Indicates that we actually acquired the GIL when this GILGuard was acquired
+    Ensured {
+        gstate: ffi::PyGILState_STATE,
+        #[cfg(feature = "gil-refs")]
+        #[allow(deprecated)]
+        pool: mem::ManuallyDrop<GILPool>,
+    },
+}
+
+impl GILGuard {
+    /// PyO3 internal API for acquiring the GIL. The public API is Python::with_gil.
+    ///
+    /// If the GIL was already acquired via PyO3, this returns
+    /// `GILGuard::Assumed`. Otherwise, the GIL will be acquired and
+    /// `GILGuard::Ensured` will be returned.
+    pub(crate) fn acquire() -> Self {
+        if gil_is_acquired() {
+            // SAFETY: We just checked that the GIL is already acquired.
+            return unsafe { Self::assume() };
+        }
+
+        // Maybe auto-initialize the GIL:
+        //  - If auto-initialize feature set and supported, try to initialize the interpreter.
+        //  - If the auto-initialize feature is set but unsupported, emit hard errors only when the
+        //    extension-module feature is not activated - extension modules don't care about
+        //    auto-initialize so this avoids breaking existing builds.
+        //  - Otherwise, just check the GIL is initialized.
+        cfg_if::cfg_if! {
+            if #[cfg(all(feature = "auto-initialize", not(any(PyPy, GraalPy))))] {
+                prepare_freethreaded_python();
+            } else {
+                // This is a "hack" to make running `cargo test` for PyO3 convenient (i.e. no need
+                // to specify `--features auto-initialize` manually. Tests within the crate itself
+                // all depend on the auto-initialize feature for conciseness but Cargo does not
+                // provide a mechanism to specify required features for tests.
+                #[cfg(not(any(PyPy, GraalPy)))]
+                if option_env!("CARGO_PRIMARY_PACKAGE").is_some() {
+                    prepare_freethreaded_python();
+                }
+
+                START.call_once_force(|_| unsafe {
+                    // Use call_once_force because if there is a panic because the interpreter is
+                    // not initialized, it's fine for the user to initialize the interpreter and
+                    // retry.
+                    assert_ne!(
+                        ffi::Py_IsInitialized(),
+                        0,
+                        "The Python interpreter is not initialized and the `auto-initialize` \
+                         feature is not enabled.\n\n\
+                         Consider calling `pyo3::prepare_freethreaded_python()` before attempting \
+                         to use Python APIs."
+                    );
+                });
+            }
+        }
+
+        // SAFETY: We have ensured the Python interpreter is initialized.
+        unsafe { Self::acquire_unchecked() }
+    }
+
+    /// Acquires the `GILGuard` without performing any state checking.
+    ///
+    /// This can be called in "unsafe" contexts where the normal interpreter state
+    /// checking performed by `GILGuard::acquire` may fail. This includes calling
+    /// as part of multi-phase interpreter initialization.
+    pub(crate) unsafe fn acquire_unchecked() -> Self {
+        if gil_is_acquired() {
+            return Self::assume();
+        }
+
+        let gstate = ffi::PyGILState_Ensure(); // acquire GIL
+        increment_gil_count();
+
+        #[cfg(feature = "gil-refs")]
+        #[allow(deprecated)]
+        let pool = mem::ManuallyDrop::new(GILPool::new());
+
+        #[cfg(not(pyo3_disable_reference_pool))]
+        if let Some(pool) = Lazy::get(&POOL) {
+            pool.update_counts(Python::assume_gil_acquired());
+        }
+        GILGuard::Ensured {
+            gstate,
+            #[cfg(feature = "gil-refs")]
+            pool,
+        }
+    }
+
+    /// Acquires the `GILGuard` while assuming that the GIL is already held.
+    pub(crate) unsafe fn assume() -> Self {
+        increment_gil_count();
+        let guard = GILGuard::Assumed;
+        #[cfg(not(pyo3_disable_reference_pool))]
+        if let Some(pool) = Lazy::get(&POOL) {
+            pool.update_counts(guard.python());
+        }
+        guard
+    }
+
+    /// Gets the Python token associated with this [`GILGuard`].
+    #[inline]
+    pub fn python(&self) -> Python<'_> {
+        unsafe { Python::assume_gil_acquired() }
+    }
+}
+
+/// The Drop implementation for `GILGuard` will release the GIL.
+impl Drop for GILGuard {
+    fn drop(&mut self) {
+        match self {
+            GILGuard::Assumed => {}
+            GILGuard::Ensured {
+                gstate,
+                #[cfg(feature = "gil-refs")]
+                pool,
+            } => unsafe {
+                // Drop the objects in the pool before attempting to release the thread state
+                #[cfg(feature = "gil-refs")]
+                mem::ManuallyDrop::drop(pool);
+                ffi::PyGILState_Release(*gstate);
+            },
+        }
+        decrement_gil_count();
+    }
+}
+
+// Vector of PyObject
+type PyObjVec = Vec<NonNull<ffi::PyObject>>;
+
+#[cfg(not(pyo3_disable_reference_pool))]
+/// Thread-safe storage for objects which were dec_ref while the GIL was not held.
+struct ReferencePool {
+    pending_decrefs: sync::Mutex<PyObjVec>,
+}
+
+#[cfg(not(pyo3_disable_reference_pool))]
+impl ReferencePool {
+    const fn new() -> Self {
+        Self {
+            pending_decrefs: sync::Mutex::new(Vec::new()),
+        }
+    }
+
+    fn register_decref(&self, obj: NonNull<ffi::PyObject>) {
+        self.pending_decrefs.lock().unwrap().push(obj);
+    }
+
+    fn update_counts(&self, _py: Python<'_>) {
+        let mut pending_decrefs = self.pending_decrefs.lock().unwrap();
+        if pending_decrefs.is_empty() {
+            return;
+        }
+
+        let decrefs = mem::take(&mut *pending_decrefs);
+        drop(pending_decrefs);
+
+        for ptr in decrefs {
+            unsafe { ffi::Py_DECREF(ptr.as_ptr()) };
+        }
+    }
+}
+
+#[cfg(not(pyo3_disable_reference_pool))]
+unsafe impl Send for ReferencePool {}
+
+#[cfg(not(pyo3_disable_reference_pool))]
+unsafe impl Sync for ReferencePool {}
+
+#[cfg(not(pyo3_disable_reference_pool))]
+static POOL: Lazy<ReferencePool> = Lazy::new(ReferencePool::new);
+
+/// A guard which can be used to temporarily release the GIL and restore on `Drop`.
+pub(crate) struct SuspendGIL {
+    count: isize,
+    tstate: *mut ffi::PyThreadState,
+}
+
+impl SuspendGIL {
+    pub(crate) unsafe fn new() -> Self {
+        let count = GIL_COUNT.with(|c| c.replace(0));
+        let tstate = ffi::PyEval_SaveThread();
+
+        Self { count, tstate }
+    }
+}
+
+impl Drop for SuspendGIL {
+    fn drop(&mut self) {
+        GIL_COUNT.with(|c| c.set(self.count));
+        unsafe {
+            ffi::PyEval_RestoreThread(self.tstate);
+
+            // Update counts of PyObjects / Py that were cloned or dropped while the GIL was released.
+            #[cfg(not(pyo3_disable_reference_pool))]
+            if let Some(pool) = Lazy::get(&POOL) {
+                pool.update_counts(Python::assume_gil_acquired());
+            }
+        }
+    }
+}
+
+/// Used to lock safe access to the GIL
+pub(crate) struct LockGIL {
+    count: isize,
+}
+
+impl LockGIL {
+    /// Lock access to the GIL while an implementation of `__traverse__` is running
+    pub fn during_traverse() -> Self {
+        Self::new(GIL_LOCKED_DURING_TRAVERSE)
+    }
+
+    fn new(reason: isize) -> Self {
+        let count = GIL_COUNT.with(|c| c.replace(reason));
+
+        Self { count }
+    }
+
+    #[cold]
+    fn bail(current: isize) {
+        match current {
+            GIL_LOCKED_DURING_TRAVERSE => panic!(
+                "Access to the GIL is prohibited while a __traverse__ implmentation is running."
+            ),
+            _ => panic!("Access to the GIL is currently prohibited."),
+        }
+    }
+}
+
+impl Drop for LockGIL {
+    fn drop(&mut self) {
+        GIL_COUNT.with(|c| c.set(self.count));
+    }
+}
+
+/// A RAII pool which PyO3 uses to store owned Python references.
+///
+/// See the [Memory Management] chapter of the guide for more information about how PyO3 uses
+/// [`GILPool`] to manage memory.
+
+///
+/// [Memory Management]: https://pyo3.rs/main/memory.html#gil-bound-memory
+#[cfg(feature = "gil-refs")]
+#[deprecated(
+    since = "0.21.0",
+    note = "`GILPool` has no function if PyO3's deprecated GIL Refs API is not used"
+)]
+pub struct GILPool {
+    /// Initial length of owned objects and anys.
+    /// `Option` is used since TSL can be broken when `new` is called from `atexit`.
+    start: Option<usize>,
+    _not_send: NotSend,
+}
+
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+impl GILPool {
+    /// Creates a new [`GILPool`]. This function should only ever be called with the GIL held.
+    ///
+    /// It is recommended not to use this API directly, but instead to use `Python::new_pool`, as
+    /// that guarantees the GIL is held.
+    ///
+    /// # Safety
+    ///
+    /// As well as requiring the GIL, see the safety notes on `Python::new_pool`.
+    #[inline]
+    pub unsafe fn new() -> GILPool {
+        // Update counts of PyObjects / Py that have been cloned or dropped since last acquisition
+        #[cfg(not(pyo3_disable_reference_pool))]
+        if let Some(pool) = Lazy::get(&POOL) {
+            pool.update_counts(Python::assume_gil_acquired());
+        }
+        GILPool {
+            start: OWNED_OBJECTS
+                .try_with(|owned_objects| {
+                    #[cfg(debug_assertions)]
+                    let len = owned_objects.borrow().len();
+                    #[cfg(not(debug_assertions))]
+                    // SAFETY: This is not re-entrant.
+                    let len = unsafe { (*owned_objects.get()).len() };
+                    len
+                })
+                .ok(),
+            _not_send: NOT_SEND,
+        }
+    }
+
+    /// Gets the Python token associated with this [`GILPool`].
+    #[inline]
+    pub fn python(&self) -> Python<'_> {
+        unsafe { Python::assume_gil_acquired() }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+impl Drop for GILPool {
+    fn drop(&mut self) {
+        if let Some(start) = self.start {
+            let owned_objects = OWNED_OBJECTS.with(|owned_objects| {
+                #[cfg(debug_assertions)]
+                let mut owned_objects = owned_objects.borrow_mut();
+                #[cfg(not(debug_assertions))]
+                // SAFETY: `OWNED_OBJECTS` is released before calling Py_DECREF,
+                // or Py_DECREF may call `GILPool::drop` recursively, resulting in invalid borrowing.
+                let owned_objects = unsafe { &mut *owned_objects.get() };
+                if start < owned_objects.len() {
+                    owned_objects.split_off(start)
+                } else {
+                    Vec::new()
+                }
+            });
+            for obj in owned_objects {
+                unsafe {
+                    ffi::Py_DECREF(obj.as_ptr());
+                }
+            }
+        }
+    }
+}
+
+/// Increments the reference count of a Python object if the GIL is held. If
+/// the GIL is not held, this function will panic.
+///
+/// # Safety
+/// The object must be an owned Python reference.
+#[cfg(feature = "py-clone")]
+#[track_caller]
+pub unsafe fn register_incref(obj: NonNull<ffi::PyObject>) {
+    if gil_is_acquired() {
+        ffi::Py_INCREF(obj.as_ptr())
+    } else {
+        panic!("Cannot clone pointer into Python heap without the GIL being held.");
+    }
+}
+
+/// Registers a Python object pointer inside the release pool, to have its reference count decreased
+/// the next time the GIL is acquired in pyo3.
+///
+/// If the GIL is held, the reference count will be decreased immediately instead of being queued
+/// for later.
+///
+/// # Safety
+/// The object must be an owned Python reference.
+#[track_caller]
+pub unsafe fn register_decref(obj: NonNull<ffi::PyObject>) {
+    if gil_is_acquired() {
+        ffi::Py_DECREF(obj.as_ptr())
+    } else {
+        #[cfg(not(pyo3_disable_reference_pool))]
+        POOL.register_decref(obj);
+        #[cfg(all(
+            pyo3_disable_reference_pool,
+            not(pyo3_leak_on_drop_without_reference_pool)
+        ))]
+        {
+            let _trap = PanicTrap::new("Aborting the process to avoid panic-from-drop.");
+            panic!("Cannot drop pointer into Python heap without the GIL being held.");
+        }
+    }
+}
+
+/// Registers an owned object inside the GILPool, to be released when the GILPool drops.
+///
+/// # Safety
+/// The object must be an owned Python reference.
+#[cfg(feature = "gil-refs")]
+pub unsafe fn register_owned(_py: Python<'_>, obj: NonNull<ffi::PyObject>) {
+    debug_assert!(gil_is_acquired());
+    // Ignores the error in case this function called from `atexit`.
+    let _ = OWNED_OBJECTS.try_with(|owned_objects| {
+        #[cfg(debug_assertions)]
+        owned_objects.borrow_mut().push(obj);
+        #[cfg(not(debug_assertions))]
+        // SAFETY: This is not re-entrant.
+        unsafe {
+            (*owned_objects.get()).push(obj);
+        }
+    });
+}
+
+/// Increments pyo3's internal GIL count - to be called whenever GILPool or GILGuard is created.
+#[inline(always)]
+fn increment_gil_count() {
+    // Ignores the error in case this function called from `atexit`.
+    let _ = GIL_COUNT.try_with(|c| {
+        let current = c.get();
+        if current < 0 {
+            LockGIL::bail(current);
+        }
+        c.set(current + 1);
+    });
+}
+
+/// Decrements pyo3's internal GIL count - to be called whenever GILPool or GILGuard is dropped.
+#[inline(always)]
+fn decrement_gil_count() {
+    // Ignores the error in case this function called from `atexit`.
+    let _ = GIL_COUNT.try_with(|c| {
+        let current = c.get();
+        debug_assert!(
+            current > 0,
+            "Negative GIL count detected. Please report this error to the PyO3 repo as a bug."
+        );
+        c.set(current - 1);
+    });
+}
+
+#[cfg(test)]
+mod tests {
+    use super::GIL_COUNT;
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    use super::OWNED_OBJECTS;
+    #[cfg(not(pyo3_disable_reference_pool))]
+    use super::{gil_is_acquired, POOL};
+    #[cfg(feature = "gil-refs")]
+    use crate::{ffi, gil};
+    use crate::{gil::GILGuard, types::any::PyAnyMethods};
+    use crate::{PyObject, Python};
+    use std::ptr::NonNull;
+
+    fn get_object(py: Python<'_>) -> PyObject {
+        py.eval_bound("object()", None, None).unwrap().unbind()
+    }
+
+    #[cfg(feature = "gil-refs")]
+    fn owned_object_count() -> usize {
+        #[cfg(debug_assertions)]
+        let len = OWNED_OBJECTS.with(|owned_objects| owned_objects.borrow().len());
+        #[cfg(not(debug_assertions))]
+        let len = OWNED_OBJECTS.with(|owned_objects| unsafe { (*owned_objects.get()).len() });
+        len
+    }
+
+    #[cfg(not(pyo3_disable_reference_pool))]
+    fn pool_dec_refs_does_not_contain(obj: &PyObject) -> bool {
+        !POOL
+            .pending_decrefs
+            .lock()
+            .unwrap()
+            .contains(&unsafe { NonNull::new_unchecked(obj.as_ptr()) })
+    }
+
+    #[cfg(not(pyo3_disable_reference_pool))]
+    fn pool_dec_refs_contains(obj: &PyObject) -> bool {
+        POOL.pending_decrefs
+            .lock()
+            .unwrap()
+            .contains(&unsafe { NonNull::new_unchecked(obj.as_ptr()) })
+    }
+
+    #[test]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_owned() {
+        Python::with_gil(|py| {
+            let obj = get_object(py);
+            let obj_ptr = obj.as_ptr();
+            // Ensure that obj does not get freed
+            let _ref = obj.clone_ref(py);
+
+            unsafe {
+                {
+                    let pool = py.new_pool();
+                    gil::register_owned(pool.python(), NonNull::new_unchecked(obj.into_ptr()));
+
+                    assert_eq!(owned_object_count(), 1);
+                    assert_eq!(ffi::Py_REFCNT(obj_ptr), 2);
+                }
+                {
+                    let _pool = py.new_pool();
+                    assert_eq!(owned_object_count(), 0);
+                    assert_eq!(ffi::Py_REFCNT(obj_ptr), 1);
+                }
+            }
+        })
+    }
+
+    #[test]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_owned_nested() {
+        Python::with_gil(|py| {
+            let obj = get_object(py);
+            // Ensure that obj does not get freed
+            let _ref = obj.clone_ref(py);
+            let obj_ptr = obj.as_ptr();
+
+            unsafe {
+                {
+                    let _pool = py.new_pool();
+                    assert_eq!(owned_object_count(), 0);
+
+                    gil::register_owned(py, NonNull::new_unchecked(obj.into_ptr()));
+
+                    assert_eq!(owned_object_count(), 1);
+                    assert_eq!(ffi::Py_REFCNT(obj_ptr), 2);
+                    {
+                        let _pool = py.new_pool();
+                        let obj = get_object(py);
+                        gil::register_owned(py, NonNull::new_unchecked(obj.into_ptr()));
+                        assert_eq!(owned_object_count(), 2);
+                    }
+                    assert_eq!(owned_object_count(), 1);
+                }
+                {
+                    assert_eq!(owned_object_count(), 0);
+                    assert_eq!(ffi::Py_REFCNT(obj_ptr), 1);
+                }
+            }
+        });
+    }
+
+    #[test]
+    fn test_pyobject_drop_with_gil_decreases_refcnt() {
+        Python::with_gil(|py| {
+            let obj = get_object(py);
+
+            // Create a reference to drop with the GIL.
+            let reference = obj.clone_ref(py);
+
+            assert_eq!(obj.get_refcnt(py), 2);
+            #[cfg(not(pyo3_disable_reference_pool))]
+            assert!(pool_dec_refs_does_not_contain(&obj));
+
+            // With the GIL held, reference count will be decreased immediately.
+            drop(reference);
+
+            assert_eq!(obj.get_refcnt(py), 1);
+            #[cfg(not(pyo3_disable_reference_pool))]
+            assert!(pool_dec_refs_does_not_contain(&obj));
+        });
+    }
+
+    #[test]
+    #[cfg(all(not(pyo3_disable_reference_pool), not(target_arch = "wasm32")))] // We are building wasm Python with pthreads disabled
+    fn test_pyobject_drop_without_gil_doesnt_decrease_refcnt() {
+        let obj = Python::with_gil(|py| {
+            let obj = get_object(py);
+            // Create a reference to drop without the GIL.
+            let reference = obj.clone_ref(py);
+
+            assert_eq!(obj.get_refcnt(py), 2);
+            assert!(pool_dec_refs_does_not_contain(&obj));
+
+            // Drop reference in a separate thread which doesn't have the GIL.
+            std::thread::spawn(move || drop(reference)).join().unwrap();
+
+            // The reference count should not have changed (the GIL has always
+            // been held by this thread), it is remembered to release later.
+            assert_eq!(obj.get_refcnt(py), 2);
+            assert!(pool_dec_refs_contains(&obj));
+            obj
+        });
+
+        // Next time the GIL is acquired, the reference is released
+        Python::with_gil(|py| {
+            assert_eq!(obj.get_refcnt(py), 1);
+            assert!(pool_dec_refs_does_not_contain(&obj));
+        });
+    }
+
+    #[test]
+    #[allow(deprecated)]
+    fn test_gil_counts() {
+        // Check with_gil and GILGuard both increase counts correctly
+        let get_gil_count = || GIL_COUNT.with(|c| c.get());
+
+        assert_eq!(get_gil_count(), 0);
+        Python::with_gil(|_| {
+            assert_eq!(get_gil_count(), 1);
+
+            let pool = unsafe { GILGuard::assume() };
+            assert_eq!(get_gil_count(), 2);
+
+            let pool2 = unsafe { GILGuard::assume() };
+            assert_eq!(get_gil_count(), 3);
+
+            drop(pool);
+            assert_eq!(get_gil_count(), 2);
+
+            Python::with_gil(|_| {
+                // nested with_gil updates gil count
+                assert_eq!(get_gil_count(), 3);
+            });
+            assert_eq!(get_gil_count(), 2);
+
+            drop(pool2);
+            assert_eq!(get_gil_count(), 1);
+        });
+        assert_eq!(get_gil_count(), 0);
+    }
+
+    #[test]
+    fn test_allow_threads() {
+        assert!(!gil_is_acquired());
+
+        Python::with_gil(|py| {
+            assert!(gil_is_acquired());
+
+            py.allow_threads(move || {
+                assert!(!gil_is_acquired());
+
+                Python::with_gil(|_| assert!(gil_is_acquired()));
+
+                assert!(!gil_is_acquired());
+            });
+
+            assert!(gil_is_acquired());
+        });
+
+        assert!(!gil_is_acquired());
+    }
+
+    #[cfg(feature = "py-clone")]
+    #[test]
+    #[should_panic]
+    fn test_allow_threads_updates_refcounts() {
+        Python::with_gil(|py| {
+            // Make a simple object with 1 reference
+            let obj = get_object(py);
+            assert!(obj.get_refcnt(py) == 1);
+            // Clone the object without the GIL which should panic
+            py.allow_threads(|| obj.clone());
+        });
+    }
+
+    #[test]
+    fn dropping_gil_does_not_invalidate_references() {
+        // Acquiring GIL for the second time should be safe - see #864
+        Python::with_gil(|py| {
+            let obj = Python::with_gil(|_| py.eval_bound("object()", None, None).unwrap());
+
+            // After gil2 drops, obj should still have a reference count of one
+            assert_eq!(obj.get_refcnt(), 1);
+        })
+    }
+
+    #[cfg(feature = "py-clone")]
+    #[test]
+    fn test_clone_with_gil() {
+        Python::with_gil(|py| {
+            let obj = get_object(py);
+            let count = obj.get_refcnt(py);
+
+            // Cloning with the GIL should increase reference count immediately
+            #[allow(clippy::redundant_clone)]
+            let c = obj.clone();
+            assert_eq!(count + 1, c.get_refcnt(py));
+        })
+    }
+
+    #[test]
+    #[cfg(not(pyo3_disable_reference_pool))]
+    fn test_update_counts_does_not_deadlock() {
+        // update_counts can run arbitrary Python code during Py_DECREF.
+        // if the locking is implemented incorrectly, it will deadlock.
+
+        use crate::ffi;
+        use crate::gil::GILGuard;
+
+        Python::with_gil(|py| {
+            let obj = get_object(py);
+
+            unsafe extern "C" fn capsule_drop(capsule: *mut ffi::PyObject) {
+                // This line will implicitly call update_counts
+                // -> and so cause deadlock if update_counts is not handling recursion correctly.
+                let pool = GILGuard::assume();
+
+                // Rebuild obj so that it can be dropped
+                PyObject::from_owned_ptr(
+                    pool.python(),
+                    ffi::PyCapsule_GetPointer(capsule, std::ptr::null()) as _,
+                );
+            }
+
+            let ptr = obj.into_ptr();
+
+            let capsule =
+                unsafe { ffi::PyCapsule_New(ptr as _, std::ptr::null(), Some(capsule_drop)) };
+
+            POOL.register_decref(NonNull::new(capsule).unwrap());
+
+            // Updating the counts will call decref on the capsule, which calls capsule_drop
+            POOL.update_counts(py);
+        })
+    }
+
+    #[test]
+    #[cfg(not(pyo3_disable_reference_pool))]
+    fn test_gil_guard_update_counts() {
+        use crate::gil::GILGuard;
+
+        Python::with_gil(|py| {
+            let obj = get_object(py);
+
+            // For GILGuard::acquire
+
+            POOL.register_decref(NonNull::new(obj.clone_ref(py).into_ptr()).unwrap());
+            assert!(pool_dec_refs_contains(&obj));
+            let _guard = GILGuard::acquire();
+            assert!(pool_dec_refs_does_not_contain(&obj));
+
+            // For GILGuard::assume
+
+            POOL.register_decref(NonNull::new(obj.clone_ref(py).into_ptr()).unwrap());
+            assert!(pool_dec_refs_contains(&obj));
+            let _guard2 = unsafe { GILGuard::assume() };
+            assert!(pool_dec_refs_does_not_contain(&obj));
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/impl_/coroutine.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/coroutine.rs
--- 43.0.0-1/rust-vendor/pyo3/src/impl_/coroutine.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/coroutine.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,103 @@
+use std::{
+    future::Future,
+    ops::{Deref, DerefMut},
+};
+
+use crate::{
+    coroutine::{cancel::ThrowCallback, Coroutine},
+    instance::Bound,
+    pycell::impl_::PyClassBorrowChecker,
+    pyclass::boolean_struct::False,
+    types::{PyAnyMethods, PyString},
+    IntoPy, Py, PyAny, PyClass, PyErr, PyObject, PyResult, Python,
+};
+
+pub fn new_coroutine<F, T, E>(
+    name: &Bound<'_, PyString>,
+    qualname_prefix: Option<&'static str>,
+    throw_callback: Option<ThrowCallback>,
+    future: F,
+) -> Coroutine
+where
+    F: Future<Output = Result<T, E>> + Send + 'static,
+    T: IntoPy<PyObject>,
+    E: Into<PyErr>,
+{
+    Coroutine::new(
+        Some(name.clone().into()),
+        qualname_prefix,
+        throw_callback,
+        future,
+    )
+}
+
+fn get_ptr<T: PyClass>(obj: &Py<T>) -> *mut T {
+    obj.get_class_object().get_ptr()
+}
+
+pub struct RefGuard<T: PyClass>(Py<T>);
+
+impl<T: PyClass> RefGuard<T> {
+    pub fn new(obj: &Bound<'_, PyAny>) -> PyResult<Self> {
+        let bound = obj.downcast::<T>()?;
+        bound.get_class_object().borrow_checker().try_borrow()?;
+        Ok(RefGuard(bound.clone().unbind()))
+    }
+}
+
+impl<T: PyClass> Deref for RefGuard<T> {
+    type Target = T;
+    fn deref(&self) -> &Self::Target {
+        // SAFETY: `RefGuard` has been built from `PyRef` and provides the same guarantees
+        unsafe { &*get_ptr(&self.0) }
+    }
+}
+
+impl<T: PyClass> Drop for RefGuard<T> {
+    fn drop(&mut self) {
+        Python::with_gil(|gil| {
+            self.0
+                .bind(gil)
+                .get_class_object()
+                .borrow_checker()
+                .release_borrow()
+        })
+    }
+}
+
+pub struct RefMutGuard<T: PyClass<Frozen = False>>(Py<T>);
+
+impl<T: PyClass<Frozen = False>> RefMutGuard<T> {
+    pub fn new(obj: &Bound<'_, PyAny>) -> PyResult<Self> {
+        let bound = obj.downcast::<T>()?;
+        bound.get_class_object().borrow_checker().try_borrow_mut()?;
+        Ok(RefMutGuard(bound.clone().unbind()))
+    }
+}
+
+impl<T: PyClass<Frozen = False>> Deref for RefMutGuard<T> {
+    type Target = T;
+    fn deref(&self) -> &Self::Target {
+        // SAFETY: `RefMutGuard` has been built from `PyRefMut` and provides the same guarantees
+        unsafe { &*get_ptr(&self.0) }
+    }
+}
+
+impl<T: PyClass<Frozen = False>> DerefMut for RefMutGuard<T> {
+    fn deref_mut(&mut self) -> &mut Self::Target {
+        // SAFETY: `RefMutGuard` has been built from `PyRefMut` and provides the same guarantees
+        unsafe { &mut *get_ptr(&self.0) }
+    }
+}
+
+impl<T: PyClass<Frozen = False>> Drop for RefMutGuard<T> {
+    fn drop(&mut self) {
+        Python::with_gil(|gil| {
+            self.0
+                .bind(gil)
+                .get_class_object()
+                .borrow_checker()
+                .release_borrow_mut()
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/impl_/deprecations.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/deprecations.rs
--- 43.0.0-1/rust-vendor/pyo3/src/impl_/deprecations.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/deprecations.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,76 @@
+//! Symbols used to denote deprecated usages of PyO3's proc macros.
+
+use crate::{PyResult, Python};
+
+#[deprecated(since = "0.20.0", note = "use `#[new]` instead of `#[__new__]`")]
+pub const PYMETHODS_NEW_DEPRECATED_FORM: () = ();
+
+pub fn inspect_type<T>(t: T, _: &GilRefs<T>) -> T {
+    t
+}
+
+pub fn inspect_fn<A, T>(f: fn(A) -> PyResult<T>, _: &GilRefs<A>) -> fn(A) -> PyResult<T> {
+    f
+}
+
+pub struct GilRefs<T>(OptionGilRefs<T>);
+pub struct OptionGilRefs<T>(NotAGilRef<T>);
+pub struct NotAGilRef<T>(std::marker::PhantomData<T>);
+
+pub trait IsGilRef {}
+
+#[cfg(feature = "gil-refs")]
+impl<T: crate::PyNativeType> IsGilRef for &'_ T {}
+
+impl<T> GilRefs<T> {
+    #[allow(clippy::new_without_default)]
+    pub fn new() -> Self {
+        GilRefs(OptionGilRefs(NotAGilRef(std::marker::PhantomData)))
+    }
+}
+
+impl GilRefs<Python<'_>> {
+    #[deprecated(since = "0.21.0", note = "use `wrap_pyfunction_bound!` instead")]
+    pub fn is_python(&self) {}
+}
+
+impl<T: IsGilRef> GilRefs<T> {
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `&Bound<'_, T>` instead for this function argument"
+    )]
+    pub fn function_arg(&self) {}
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `&Bound<'_, PyAny>` as the argument for this `from_py_with` extractor"
+    )]
+    pub fn from_py_with_arg(&self) {}
+}
+
+impl<T: IsGilRef> OptionGilRefs<Option<T>> {
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `Option<&Bound<'_, T>>` instead for this function argument"
+    )]
+    pub fn function_arg(&self) {}
+}
+
+impl<T> NotAGilRef<T> {
+    pub fn function_arg(&self) {}
+    pub fn from_py_with_arg(&self) {}
+    pub fn is_python(&self) {}
+}
+
+impl<T> std::ops::Deref for GilRefs<T> {
+    type Target = OptionGilRefs<T>;
+    fn deref(&self) -> &Self::Target {
+        &self.0
+    }
+}
+
+impl<T> std::ops::Deref for OptionGilRefs<T> {
+    type Target = NotAGilRef<T>;
+    fn deref(&self) -> &Self::Target {
+        &self.0
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/impl_/exceptions.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/exceptions.rs
--- 43.0.0-1/rust-vendor/pyo3/src/impl_/exceptions.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/exceptions.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,28 @@
+use crate::{sync::GILOnceCell, types::PyType, Bound, Py, Python};
+
+pub struct ImportedExceptionTypeObject {
+    imported_value: GILOnceCell<Py<PyType>>,
+    module: &'static str,
+    name: &'static str,
+}
+
+impl ImportedExceptionTypeObject {
+    pub const fn new(module: &'static str, name: &'static str) -> Self {
+        Self {
+            imported_value: GILOnceCell::new(),
+            module,
+            name,
+        }
+    }
+
+    pub fn get<'py>(&self, py: Python<'py>) -> &Bound<'py, PyType> {
+        self.imported_value
+            .get_or_try_init_type_ref(py, self.module, self.name)
+            .unwrap_or_else(|e| {
+                panic!(
+                    "failed to import exception {}.{}: {}",
+                    self.module, self.name, e
+                )
+            })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/impl_/extract_argument.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/extract_argument.rs
--- 43.0.0-1/rust-vendor/pyo3/src/impl_/extract_argument.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/extract_argument.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,924 @@
+use crate::{
+    conversion::FromPyObjectBound,
+    exceptions::PyTypeError,
+    ffi,
+    pyclass::boolean_struct::False,
+    types::{any::PyAnyMethods, dict::PyDictMethods, tuple::PyTupleMethods, PyDict, PyTuple},
+    Borrowed, Bound, PyAny, PyClass, PyErr, PyRef, PyRefMut, PyResult, PyTypeCheck, Python,
+};
+
+/// Helper type used to keep implementation more concise.
+///
+/// (Function argument extraction borrows input arguments.)
+type PyArg<'py> = Borrowed<'py, 'py, PyAny>;
+
+/// A trait which is used to help PyO3 macros extract function arguments.
+///
+/// `#[pyclass]` structs need to extract as `PyRef<T>` and `PyRefMut<T>`
+/// wrappers rather than extracting `&T` and `&mut T` directly. The `Holder` type is used
+/// to hold these temporary wrappers - the way the macro is constructed, these wrappers
+/// will be dropped as soon as the pyfunction call ends.
+///
+/// There exists a trivial blanket implementation for `T: FromPyObject` with `Holder = ()`.
+pub trait PyFunctionArgument<'a, 'py>: Sized + 'a {
+    type Holder: FunctionArgumentHolder;
+    fn extract(obj: &'a Bound<'py, PyAny>, holder: &'a mut Self::Holder) -> PyResult<Self>;
+}
+
+impl<'a, 'py, T> PyFunctionArgument<'a, 'py> for T
+where
+    T: FromPyObjectBound<'a, 'py> + 'a,
+{
+    type Holder = ();
+
+    #[inline]
+    fn extract(obj: &'a Bound<'py, PyAny>, _: &'a mut ()) -> PyResult<Self> {
+        obj.extract()
+    }
+}
+
+impl<'a, 'py, T: 'py> PyFunctionArgument<'a, 'py> for &'a Bound<'py, T>
+where
+    T: PyTypeCheck,
+{
+    type Holder = Option<()>;
+
+    #[inline]
+    fn extract(obj: &'a Bound<'py, PyAny>, _: &'a mut Option<()>) -> PyResult<Self> {
+        obj.downcast().map_err(Into::into)
+    }
+}
+
+impl<'a, 'py, T: 'py> PyFunctionArgument<'a, 'py> for Option<&'a Bound<'py, T>>
+where
+    T: PyTypeCheck,
+{
+    type Holder = ();
+
+    #[inline]
+    fn extract(obj: &'a Bound<'py, PyAny>, _: &'a mut ()) -> PyResult<Self> {
+        if obj.is_none() {
+            Ok(None)
+        } else {
+            Ok(Some(obj.downcast()?))
+        }
+    }
+}
+
+#[cfg(all(Py_LIMITED_API, not(any(feature = "gil-refs", Py_3_10))))]
+impl<'a> PyFunctionArgument<'a, '_> for &'a str {
+    type Holder = Option<std::borrow::Cow<'a, str>>;
+
+    #[inline]
+    fn extract(
+        obj: &'a Bound<'_, PyAny>,
+        holder: &'a mut Option<std::borrow::Cow<'a, str>>,
+    ) -> PyResult<Self> {
+        Ok(holder.insert(obj.extract()?))
+    }
+}
+
+/// Trait for types which can be a function argument holder - they should
+/// to be able to const-initialize to an empty value.
+pub trait FunctionArgumentHolder: Sized {
+    const INIT: Self;
+}
+
+impl FunctionArgumentHolder for () {
+    const INIT: Self = ();
+}
+
+impl<T> FunctionArgumentHolder for Option<T> {
+    const INIT: Self = None;
+}
+
+#[inline]
+pub fn extract_pyclass_ref<'a, 'py: 'a, T: PyClass>(
+    obj: &'a Bound<'py, PyAny>,
+    holder: &'a mut Option<PyRef<'py, T>>,
+) -> PyResult<&'a T> {
+    Ok(&*holder.insert(obj.extract()?))
+}
+
+#[inline]
+pub fn extract_pyclass_ref_mut<'a, 'py: 'a, T: PyClass<Frozen = False>>(
+    obj: &'a Bound<'py, PyAny>,
+    holder: &'a mut Option<PyRefMut<'py, T>>,
+) -> PyResult<&'a mut T> {
+    Ok(&mut *holder.insert(obj.extract()?))
+}
+
+/// The standard implementation of how PyO3 extracts a `#[pyfunction]` or `#[pymethod]` function argument.
+#[doc(hidden)]
+pub fn extract_argument<'a, 'py, T>(
+    obj: &'a Bound<'py, PyAny>,
+    holder: &'a mut T::Holder,
+    arg_name: &str,
+) -> PyResult<T>
+where
+    T: PyFunctionArgument<'a, 'py>,
+{
+    match PyFunctionArgument::extract(obj, holder) {
+        Ok(value) => Ok(value),
+        Err(e) => Err(argument_extraction_error(obj.py(), arg_name, e)),
+    }
+}
+
+/// Alternative to [`extract_argument`] used for `Option<T>` arguments. This is necessary because Option<&T>
+/// does not implement `PyFunctionArgument` for `T: PyClass`.
+#[doc(hidden)]
+pub fn extract_optional_argument<'a, 'py, T>(
+    obj: Option<&'a Bound<'py, PyAny>>,
+    holder: &'a mut T::Holder,
+    arg_name: &str,
+    default: fn() -> Option<T>,
+) -> PyResult<Option<T>>
+where
+    T: PyFunctionArgument<'a, 'py>,
+{
+    match obj {
+        Some(obj) => {
+            if obj.is_none() {
+                // Explicit `None` will result in None being used as the function argument
+                Ok(None)
+            } else {
+                extract_argument(obj, holder, arg_name).map(Some)
+            }
+        }
+        _ => Ok(default()),
+    }
+}
+
+/// Alternative to [`extract_argument`] used when the argument has a default value provided by an annotation.
+#[doc(hidden)]
+pub fn extract_argument_with_default<'a, 'py, T>(
+    obj: Option<&'a Bound<'py, PyAny>>,
+    holder: &'a mut T::Holder,
+    arg_name: &str,
+    default: fn() -> T,
+) -> PyResult<T>
+where
+    T: PyFunctionArgument<'a, 'py>,
+{
+    match obj {
+        Some(obj) => extract_argument(obj, holder, arg_name),
+        None => Ok(default()),
+    }
+}
+
+/// Alternative to [`extract_argument`] used when the argument has a `#[pyo3(from_py_with)]` annotation.
+#[doc(hidden)]
+pub fn from_py_with<'a, 'py, T>(
+    obj: &'a Bound<'py, PyAny>,
+    arg_name: &str,
+    extractor: impl Into<super::frompyobject::Extractor<'a, 'py, T>>,
+) -> PyResult<T> {
+    match extractor.into().call(obj) {
+        Ok(value) => Ok(value),
+        Err(e) => Err(argument_extraction_error(obj.py(), arg_name, e)),
+    }
+}
+
+/// Alternative to [`extract_argument`] used when the argument has a `#[pyo3(from_py_with)]` annotation and also a default value.
+#[doc(hidden)]
+pub fn from_py_with_with_default<'a, 'py, T>(
+    obj: Option<&'a Bound<'py, PyAny>>,
+    arg_name: &str,
+    extractor: impl Into<super::frompyobject::Extractor<'a, 'py, T>>,
+    default: fn() -> T,
+) -> PyResult<T> {
+    match obj {
+        Some(obj) => from_py_with(obj, arg_name, extractor),
+        None => Ok(default()),
+    }
+}
+
+/// Adds the argument name to the error message of an error which occurred during argument extraction.
+///
+/// Only modifies TypeError. (Cannot guarantee all exceptions have constructors from
+/// single string.)
+#[doc(hidden)]
+#[cold]
+pub fn argument_extraction_error(py: Python<'_>, arg_name: &str, error: PyErr) -> PyErr {
+    if error
+        .get_type_bound(py)
+        .is(&py.get_type_bound::<PyTypeError>())
+    {
+        let remapped_error = PyTypeError::new_err(format!(
+            "argument '{}': {}",
+            arg_name,
+            error.value_bound(py)
+        ));
+        remapped_error.set_cause(py, error.cause(py));
+        remapped_error
+    } else {
+        error
+    }
+}
+
+/// Unwraps the Option<&PyAny> produced by the FunctionDescription `extract_arguments_` methods.
+/// They check if required methods are all provided.
+///
+/// # Safety
+/// `argument` must not be `None`
+#[doc(hidden)]
+#[inline]
+pub unsafe fn unwrap_required_argument<'a, 'py>(
+    argument: Option<&'a Bound<'py, PyAny>>,
+) -> &'a Bound<'py, PyAny> {
+    match argument {
+        Some(value) => value,
+        #[cfg(debug_assertions)]
+        None => unreachable!("required method argument was not extracted"),
+        #[cfg(not(debug_assertions))]
+        None => std::hint::unreachable_unchecked(),
+    }
+}
+
+pub struct KeywordOnlyParameterDescription {
+    pub name: &'static str,
+    pub required: bool,
+}
+
+/// Function argument specification for a `#[pyfunction]` or `#[pymethod]`.
+pub struct FunctionDescription {
+    pub cls_name: Option<&'static str>,
+    pub func_name: &'static str,
+    pub positional_parameter_names: &'static [&'static str],
+    pub positional_only_parameters: usize,
+    pub required_positional_parameters: usize,
+    pub keyword_only_parameters: &'static [KeywordOnlyParameterDescription],
+}
+
+impl FunctionDescription {
+    fn full_name(&self) -> String {
+        if let Some(cls_name) = self.cls_name {
+            format!("{}.{}()", cls_name, self.func_name)
+        } else {
+            format!("{}()", self.func_name)
+        }
+    }
+
+    /// Equivalent of `extract_arguments_tuple_dict` which uses the Python C-API "fastcall" convention.
+    ///
+    /// # Safety
+    /// - `args` must be a pointer to a C-style array of valid `ffi::PyObject` pointers, or NULL.
+    /// - `kwnames` must be a pointer to a PyTuple, or NULL.
+    /// - `nargs + kwnames.len()` is the total length of the `args` array.
+    #[cfg(not(Py_LIMITED_API))]
+    pub unsafe fn extract_arguments_fastcall<'py, V, K>(
+        &self,
+        py: Python<'py>,
+        args: *const *mut ffi::PyObject,
+        nargs: ffi::Py_ssize_t,
+        kwnames: *mut ffi::PyObject,
+        output: &mut [Option<PyArg<'py>>],
+    ) -> PyResult<(V::Varargs, K::Varkeywords)>
+    where
+        V: VarargsHandler<'py>,
+        K: VarkeywordsHandler<'py>,
+    {
+        let num_positional_parameters = self.positional_parameter_names.len();
+
+        debug_assert!(nargs >= 0);
+        debug_assert!(self.positional_only_parameters <= num_positional_parameters);
+        debug_assert!(self.required_positional_parameters <= num_positional_parameters);
+        debug_assert_eq!(
+            output.len(),
+            num_positional_parameters + self.keyword_only_parameters.len()
+        );
+
+        // Handle positional arguments
+        // Safety:
+        //  - Option<PyArg> has the same memory layout as `*mut ffi::PyObject`
+        //  - we both have the GIL and can borrow these input references for the `'py` lifetime.
+        let args: *const Option<PyArg<'py>> = args.cast();
+        let positional_args_provided = nargs as usize;
+        let remaining_positional_args = if args.is_null() {
+            debug_assert_eq!(positional_args_provided, 0);
+            &[]
+        } else {
+            // Can consume at most the number of positional parameters in the function definition,
+            // the rest are varargs.
+            let positional_args_to_consume =
+                num_positional_parameters.min(positional_args_provided);
+            let (positional_parameters, remaining) =
+                std::slice::from_raw_parts(args, positional_args_provided)
+                    .split_at(positional_args_to_consume);
+            output[..positional_args_to_consume].copy_from_slice(positional_parameters);
+            remaining
+        };
+        let varargs = V::handle_varargs_fastcall(py, remaining_positional_args, self)?;
+
+        // Handle keyword arguments
+        let mut varkeywords = K::Varkeywords::default();
+
+        // Safety: kwnames is known to be a pointer to a tuple, or null
+        //  - we both have the GIL and can borrow this input reference for the `'py` lifetime.
+        let kwnames: Option<Borrowed<'_, '_, PyTuple>> =
+            Borrowed::from_ptr_or_opt(py, kwnames).map(|kwnames| kwnames.downcast_unchecked());
+        if let Some(kwnames) = kwnames {
+            let kwargs = ::std::slice::from_raw_parts(
+                // Safety: PyArg has the same memory layout as `*mut ffi::PyObject`
+                args.offset(nargs).cast::<PyArg<'py>>(),
+                kwnames.len(),
+            );
+
+            self.handle_kwargs::<K, _>(
+                kwnames.iter_borrowed().zip(kwargs.iter().copied()),
+                &mut varkeywords,
+                num_positional_parameters,
+                output,
+            )?
+        }
+
+        // Once all inputs have been processed, check that all required arguments have been provided.
+
+        self.ensure_no_missing_required_positional_arguments(output, positional_args_provided)?;
+        self.ensure_no_missing_required_keyword_arguments(output)?;
+
+        Ok((varargs, varkeywords))
+    }
+
+    /// Extracts the `args` and `kwargs` provided into `output`, according to this function
+    /// definition.
+    ///
+    /// `output` must have the same length as this function has positional and keyword-only
+    /// parameters (as per the `positional_parameter_names` and `keyword_only_parameters`
+    /// respectively).
+    ///
+    /// Unexpected, duplicate or invalid arguments will cause this function to return `TypeError`.
+    ///
+    /// # Safety
+    /// - `args` must be a pointer to a PyTuple.
+    /// - `kwargs` must be a pointer to a PyDict, or NULL.
+    pub unsafe fn extract_arguments_tuple_dict<'py, V, K>(
+        &self,
+        py: Python<'py>,
+        args: *mut ffi::PyObject,
+        kwargs: *mut ffi::PyObject,
+        output: &mut [Option<PyArg<'py>>],
+    ) -> PyResult<(V::Varargs, K::Varkeywords)>
+    where
+        V: VarargsHandler<'py>,
+        K: VarkeywordsHandler<'py>,
+    {
+        // Safety:
+        //  - `args` is known to be a tuple
+        //  - `kwargs` is known to be a dict or null
+        //  - we both have the GIL and can borrow these input references for the `'py` lifetime.
+        let args: Borrowed<'py, 'py, PyTuple> =
+            Borrowed::from_ptr(py, args).downcast_unchecked::<PyTuple>();
+        let kwargs: Option<Borrowed<'py, 'py, PyDict>> =
+            Borrowed::from_ptr_or_opt(py, kwargs).map(|kwargs| kwargs.downcast_unchecked());
+
+        let num_positional_parameters = self.positional_parameter_names.len();
+
+        debug_assert!(self.positional_only_parameters <= num_positional_parameters);
+        debug_assert!(self.required_positional_parameters <= num_positional_parameters);
+        debug_assert_eq!(
+            output.len(),
+            num_positional_parameters + self.keyword_only_parameters.len()
+        );
+
+        // Copy positional arguments into output
+        for (i, arg) in args
+            .iter_borrowed()
+            .take(num_positional_parameters)
+            .enumerate()
+        {
+            output[i] = Some(arg);
+        }
+
+        // If any arguments remain, push them to varargs (if possible) or error
+        let varargs = V::handle_varargs_tuple(&args, self)?;
+
+        // Handle keyword arguments
+        let mut varkeywords = K::Varkeywords::default();
+        if let Some(kwargs) = kwargs {
+            self.handle_kwargs::<K, _>(
+                kwargs.iter_borrowed(),
+                &mut varkeywords,
+                num_positional_parameters,
+                output,
+            )?
+        }
+
+        // Once all inputs have been processed, check that all required arguments have been provided.
+
+        self.ensure_no_missing_required_positional_arguments(output, args.len())?;
+        self.ensure_no_missing_required_keyword_arguments(output)?;
+
+        Ok((varargs, varkeywords))
+    }
+
+    #[inline]
+    fn handle_kwargs<'py, K, I>(
+        &self,
+        kwargs: I,
+        varkeywords: &mut K::Varkeywords,
+        num_positional_parameters: usize,
+        output: &mut [Option<PyArg<'py>>],
+    ) -> PyResult<()>
+    where
+        K: VarkeywordsHandler<'py>,
+        I: IntoIterator<Item = (PyArg<'py>, PyArg<'py>)>,
+    {
+        debug_assert_eq!(
+            num_positional_parameters,
+            self.positional_parameter_names.len()
+        );
+        debug_assert_eq!(
+            output.len(),
+            num_positional_parameters + self.keyword_only_parameters.len()
+        );
+        let mut positional_only_keyword_arguments = Vec::new();
+        for (kwarg_name_py, value) in kwargs {
+            // Safety: All keyword arguments should be UTF-8 strings, but if it's not, `.to_str()`
+            // will return an error anyway.
+            #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
+            let kwarg_name =
+                unsafe { kwarg_name_py.downcast_unchecked::<crate::types::PyString>() }.to_str();
+
+            #[cfg(all(not(Py_3_10), Py_LIMITED_API))]
+            let kwarg_name = kwarg_name_py.extract::<crate::pybacked::PyBackedStr>();
+
+            if let Ok(kwarg_name_owned) = kwarg_name {
+                #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
+                let kwarg_name = kwarg_name_owned;
+                #[cfg(all(not(Py_3_10), Py_LIMITED_API))]
+                let kwarg_name: &str = &kwarg_name_owned;
+
+                // Try to place parameter in keyword only parameters
+                if let Some(i) = self.find_keyword_parameter_in_keyword_only(kwarg_name) {
+                    if output[i + num_positional_parameters]
+                        .replace(value)
+                        .is_some()
+                    {
+                        return Err(self.multiple_values_for_argument(kwarg_name));
+                    }
+                    continue;
+                }
+
+                // Repeat for positional parameters
+                if let Some(i) = self.find_keyword_parameter_in_positional(kwarg_name) {
+                    if i < self.positional_only_parameters {
+                        // If accepting **kwargs, then it's allowed for the name of the
+                        // kwarg to conflict with a postional-only argument - the value
+                        // will go into **kwargs anyway.
+                        if K::handle_varkeyword(varkeywords, kwarg_name_py, value, self).is_err() {
+                            positional_only_keyword_arguments.push(kwarg_name_owned);
+                        }
+                    } else if output[i].replace(value).is_some() {
+                        return Err(self.multiple_values_for_argument(kwarg_name));
+                    }
+                    continue;
+                }
+            };
+
+            K::handle_varkeyword(varkeywords, kwarg_name_py, value, self)?
+        }
+
+        if !positional_only_keyword_arguments.is_empty() {
+            #[cfg(all(not(Py_3_10), Py_LIMITED_API))]
+            let positional_only_keyword_arguments: Vec<_> = positional_only_keyword_arguments
+                .iter()
+                .map(std::ops::Deref::deref)
+                .collect();
+            return Err(self.positional_only_keyword_arguments(&positional_only_keyword_arguments));
+        }
+
+        Ok(())
+    }
+
+    #[inline]
+    fn find_keyword_parameter_in_positional(&self, kwarg_name: &str) -> Option<usize> {
+        self.positional_parameter_names
+            .iter()
+            .position(|&param_name| param_name == kwarg_name)
+    }
+
+    #[inline]
+    fn find_keyword_parameter_in_keyword_only(&self, kwarg_name: &str) -> Option<usize> {
+        // Compare the keyword name against each parameter in turn. This is exactly the same method
+        // which CPython uses to map keyword names. Although it's O(num_parameters), the number of
+        // parameters is expected to be small so it's not worth constructing a mapping.
+        self.keyword_only_parameters
+            .iter()
+            .position(|param_desc| param_desc.name == kwarg_name)
+    }
+
+    #[inline]
+    fn ensure_no_missing_required_positional_arguments(
+        &self,
+        output: &[Option<PyArg<'_>>],
+        positional_args_provided: usize,
+    ) -> PyResult<()> {
+        if positional_args_provided < self.required_positional_parameters {
+            for out in &output[positional_args_provided..self.required_positional_parameters] {
+                if out.is_none() {
+                    return Err(self.missing_required_positional_arguments(output));
+                }
+            }
+        }
+        Ok(())
+    }
+
+    #[inline]
+    fn ensure_no_missing_required_keyword_arguments(
+        &self,
+        output: &[Option<PyArg<'_>>],
+    ) -> PyResult<()> {
+        let keyword_output = &output[self.positional_parameter_names.len()..];
+        for (param, out) in self.keyword_only_parameters.iter().zip(keyword_output) {
+            if param.required && out.is_none() {
+                return Err(self.missing_required_keyword_arguments(keyword_output));
+            }
+        }
+        Ok(())
+    }
+
+    #[cold]
+    fn too_many_positional_arguments(&self, args_provided: usize) -> PyErr {
+        let was = if args_provided == 1 { "was" } else { "were" };
+        let msg = if self.required_positional_parameters != self.positional_parameter_names.len() {
+            format!(
+                "{} takes from {} to {} positional arguments but {} {} given",
+                self.full_name(),
+                self.required_positional_parameters,
+                self.positional_parameter_names.len(),
+                args_provided,
+                was
+            )
+        } else {
+            format!(
+                "{} takes {} positional arguments but {} {} given",
+                self.full_name(),
+                self.positional_parameter_names.len(),
+                args_provided,
+                was
+            )
+        };
+        PyTypeError::new_err(msg)
+    }
+
+    #[cold]
+    fn multiple_values_for_argument(&self, argument: &str) -> PyErr {
+        PyTypeError::new_err(format!(
+            "{} got multiple values for argument '{}'",
+            self.full_name(),
+            argument
+        ))
+    }
+
+    #[cold]
+    fn unexpected_keyword_argument(&self, argument: PyArg<'_>) -> PyErr {
+        PyTypeError::new_err(format!(
+            "{} got an unexpected keyword argument '{}'",
+            self.full_name(),
+            argument.as_any()
+        ))
+    }
+
+    #[cold]
+    fn positional_only_keyword_arguments(&self, parameter_names: &[&str]) -> PyErr {
+        let mut msg = format!(
+            "{} got some positional-only arguments passed as keyword arguments: ",
+            self.full_name()
+        );
+        push_parameter_list(&mut msg, parameter_names);
+        PyTypeError::new_err(msg)
+    }
+
+    #[cold]
+    fn missing_required_arguments(&self, argument_type: &str, parameter_names: &[&str]) -> PyErr {
+        let arguments = if parameter_names.len() == 1 {
+            "argument"
+        } else {
+            "arguments"
+        };
+        let mut msg = format!(
+            "{} missing {} required {} {}: ",
+            self.full_name(),
+            parameter_names.len(),
+            argument_type,
+            arguments,
+        );
+        push_parameter_list(&mut msg, parameter_names);
+        PyTypeError::new_err(msg)
+    }
+
+    #[cold]
+    fn missing_required_keyword_arguments(&self, keyword_outputs: &[Option<PyArg<'_>>]) -> PyErr {
+        debug_assert_eq!(self.keyword_only_parameters.len(), keyword_outputs.len());
+
+        let missing_keyword_only_arguments: Vec<_> = self
+            .keyword_only_parameters
+            .iter()
+            .zip(keyword_outputs)
+            .filter_map(|(keyword_desc, out)| {
+                if keyword_desc.required && out.is_none() {
+                    Some(keyword_desc.name)
+                } else {
+                    None
+                }
+            })
+            .collect();
+
+        debug_assert!(!missing_keyword_only_arguments.is_empty());
+        self.missing_required_arguments("keyword", &missing_keyword_only_arguments)
+    }
+
+    #[cold]
+    fn missing_required_positional_arguments(&self, output: &[Option<PyArg<'_>>]) -> PyErr {
+        let missing_positional_arguments: Vec<_> = self
+            .positional_parameter_names
+            .iter()
+            .take(self.required_positional_parameters)
+            .zip(output)
+            .filter_map(|(param, out)| if out.is_none() { Some(*param) } else { None })
+            .collect();
+
+        debug_assert!(!missing_positional_arguments.is_empty());
+        self.missing_required_arguments("positional", &missing_positional_arguments)
+    }
+}
+
+/// A trait used to control whether to accept varargs in FunctionDescription::extract_argument_(method) functions.
+pub trait VarargsHandler<'py> {
+    type Varargs;
+    /// Called by `FunctionDescription::extract_arguments_fastcall` with any additional arguments.
+    fn handle_varargs_fastcall(
+        py: Python<'py>,
+        varargs: &[Option<PyArg<'py>>],
+        function_description: &FunctionDescription,
+    ) -> PyResult<Self::Varargs>;
+    /// Called by `FunctionDescription::extract_arguments_tuple_dict` with the original tuple.
+    ///
+    /// Additional arguments are those in the tuple slice starting from `function_description.positional_parameter_names.len()`.
+    fn handle_varargs_tuple(
+        args: &Bound<'py, PyTuple>,
+        function_description: &FunctionDescription,
+    ) -> PyResult<Self::Varargs>;
+}
+
+/// Marker struct which indicates varargs are not allowed.
+pub struct NoVarargs;
+
+impl<'py> VarargsHandler<'py> for NoVarargs {
+    type Varargs = ();
+
+    #[inline]
+    fn handle_varargs_fastcall(
+        _py: Python<'py>,
+        varargs: &[Option<PyArg<'py>>],
+        function_description: &FunctionDescription,
+    ) -> PyResult<Self::Varargs> {
+        let extra_arguments = varargs.len();
+        if extra_arguments > 0 {
+            return Err(function_description.too_many_positional_arguments(
+                function_description.positional_parameter_names.len() + extra_arguments,
+            ));
+        }
+        Ok(())
+    }
+
+    #[inline]
+    fn handle_varargs_tuple(
+        args: &Bound<'py, PyTuple>,
+        function_description: &FunctionDescription,
+    ) -> PyResult<Self::Varargs> {
+        let positional_parameter_count = function_description.positional_parameter_names.len();
+        let provided_args_count = args.len();
+        if provided_args_count <= positional_parameter_count {
+            Ok(())
+        } else {
+            Err(function_description.too_many_positional_arguments(provided_args_count))
+        }
+    }
+}
+
+/// Marker struct which indicates varargs should be collected into a `PyTuple`.
+pub struct TupleVarargs;
+
+impl<'py> VarargsHandler<'py> for TupleVarargs {
+    type Varargs = Bound<'py, PyTuple>;
+    #[inline]
+    fn handle_varargs_fastcall(
+        py: Python<'py>,
+        varargs: &[Option<PyArg<'py>>],
+        _function_description: &FunctionDescription,
+    ) -> PyResult<Self::Varargs> {
+        Ok(PyTuple::new_bound(py, varargs))
+    }
+
+    #[inline]
+    fn handle_varargs_tuple(
+        args: &Bound<'py, PyTuple>,
+        function_description: &FunctionDescription,
+    ) -> PyResult<Self::Varargs> {
+        let positional_parameters = function_description.positional_parameter_names.len();
+        Ok(args.get_slice(positional_parameters, args.len()))
+    }
+}
+
+/// A trait used to control whether to accept varkeywords in FunctionDescription::extract_argument_(method) functions.
+pub trait VarkeywordsHandler<'py> {
+    type Varkeywords: Default;
+    fn handle_varkeyword(
+        varkeywords: &mut Self::Varkeywords,
+        name: PyArg<'py>,
+        value: PyArg<'py>,
+        function_description: &FunctionDescription,
+    ) -> PyResult<()>;
+}
+
+/// Marker struct which indicates unknown keywords are not permitted.
+pub struct NoVarkeywords;
+
+impl<'py> VarkeywordsHandler<'py> for NoVarkeywords {
+    type Varkeywords = ();
+    #[inline]
+    fn handle_varkeyword(
+        _varkeywords: &mut Self::Varkeywords,
+        name: PyArg<'py>,
+        _value: PyArg<'py>,
+        function_description: &FunctionDescription,
+    ) -> PyResult<()> {
+        Err(function_description.unexpected_keyword_argument(name))
+    }
+}
+
+/// Marker struct which indicates unknown keywords should be collected into a `PyDict`.
+pub struct DictVarkeywords;
+
+impl<'py> VarkeywordsHandler<'py> for DictVarkeywords {
+    type Varkeywords = Option<Bound<'py, PyDict>>;
+    #[inline]
+    fn handle_varkeyword(
+        varkeywords: &mut Self::Varkeywords,
+        name: PyArg<'py>,
+        value: PyArg<'py>,
+        _function_description: &FunctionDescription,
+    ) -> PyResult<()> {
+        varkeywords
+            .get_or_insert_with(|| PyDict::new_bound(name.py()))
+            .set_item(name, value)
+    }
+}
+
+fn push_parameter_list(msg: &mut String, parameter_names: &[&str]) {
+    let len = parameter_names.len();
+    for (i, parameter) in parameter_names.iter().enumerate() {
+        if i != 0 {
+            if len > 2 {
+                msg.push(',');
+            }
+
+            if i == len - 1 {
+                msg.push_str(" and ")
+            } else {
+                msg.push(' ')
+            }
+        }
+
+        msg.push('\'');
+        msg.push_str(parameter);
+        msg.push('\'');
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::types::{IntoPyDict, PyTuple};
+    use crate::Python;
+
+    use super::{push_parameter_list, FunctionDescription, NoVarargs, NoVarkeywords};
+
+    #[test]
+    fn unexpected_keyword_argument() {
+        let function_description = FunctionDescription {
+            cls_name: None,
+            func_name: "example",
+            positional_parameter_names: &[],
+            positional_only_parameters: 0,
+            required_positional_parameters: 0,
+            keyword_only_parameters: &[],
+        };
+
+        Python::with_gil(|py| {
+            let args = PyTuple::empty_bound(py);
+            let kwargs = [("foo", 0u8)].into_py_dict_bound(py);
+            let err = unsafe {
+                function_description
+                    .extract_arguments_tuple_dict::<NoVarargs, NoVarkeywords>(
+                        py,
+                        args.as_ptr(),
+                        kwargs.as_ptr(),
+                        &mut [],
+                    )
+                    .unwrap_err()
+            };
+            assert_eq!(
+                err.to_string(),
+                "TypeError: example() got an unexpected keyword argument 'foo'"
+            );
+        })
+    }
+
+    #[test]
+    fn keyword_not_string() {
+        let function_description = FunctionDescription {
+            cls_name: None,
+            func_name: "example",
+            positional_parameter_names: &[],
+            positional_only_parameters: 0,
+            required_positional_parameters: 0,
+            keyword_only_parameters: &[],
+        };
+
+        Python::with_gil(|py| {
+            let args = PyTuple::empty_bound(py);
+            let kwargs = [(1u8, 1u8)].into_py_dict_bound(py);
+            let err = unsafe {
+                function_description
+                    .extract_arguments_tuple_dict::<NoVarargs, NoVarkeywords>(
+                        py,
+                        args.as_ptr(),
+                        kwargs.as_ptr(),
+                        &mut [],
+                    )
+                    .unwrap_err()
+            };
+            assert_eq!(
+                err.to_string(),
+                "TypeError: example() got an unexpected keyword argument '1'"
+            );
+        })
+    }
+
+    #[test]
+    fn missing_required_arguments() {
+        let function_description = FunctionDescription {
+            cls_name: None,
+            func_name: "example",
+            positional_parameter_names: &["foo", "bar"],
+            positional_only_parameters: 0,
+            required_positional_parameters: 2,
+            keyword_only_parameters: &[],
+        };
+
+        Python::with_gil(|py| {
+            let args = PyTuple::empty_bound(py);
+            let mut output = [None, None];
+            let err = unsafe {
+                function_description.extract_arguments_tuple_dict::<NoVarargs, NoVarkeywords>(
+                    py,
+                    args.as_ptr(),
+                    std::ptr::null_mut(),
+                    &mut output,
+                )
+            }
+            .unwrap_err();
+            assert_eq!(
+                err.to_string(),
+                "TypeError: example() missing 2 required positional arguments: 'foo' and 'bar'"
+            );
+        })
+    }
+
+    #[test]
+    fn push_parameter_list_empty() {
+        let mut s = String::new();
+        push_parameter_list(&mut s, &[]);
+        assert_eq!(&s, "");
+    }
+
+    #[test]
+    fn push_parameter_list_one() {
+        let mut s = String::new();
+        push_parameter_list(&mut s, &["a"]);
+        assert_eq!(&s, "'a'");
+    }
+
+    #[test]
+    fn push_parameter_list_two() {
+        let mut s = String::new();
+        push_parameter_list(&mut s, &["a", "b"]);
+        assert_eq!(&s, "'a' and 'b'");
+    }
+
+    #[test]
+    fn push_parameter_list_three() {
+        let mut s = String::new();
+        push_parameter_list(&mut s, &["a", "b", "c"]);
+        assert_eq!(&s, "'a', 'b', and 'c'");
+    }
+
+    #[test]
+    fn push_parameter_list_four() {
+        let mut s = String::new();
+        push_parameter_list(&mut s, &["a", "b", "c", "d"]);
+        assert_eq!(&s, "'a', 'b', 'c', and 'd'");
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/impl_/freelist.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/freelist.rs
--- 43.0.0-1/rust-vendor/pyo3/src/impl_/freelist.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/freelist.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,69 @@
+//! Support for [free allocation lists][1].
+//!
+//! This can improve performance for types that are often created and deleted in quick succession.
+//!
+//! Rather than implementing this manually,
+//! implement it by annotating a struct with `#[pyclass(freelist = N)]`,
+//! where `N` is the size of the freelist.
+//!
+//! [1]: https://en.wikipedia.org/wiki/Free_list
+
+use std::mem;
+
+/// Represents a slot of a [`FreeList`].
+pub enum Slot<T> {
+    /// A free slot.
+    Empty,
+    /// An allocated slot.
+    Filled(T),
+}
+
+/// A free allocation list.
+///
+/// See [the parent module](crate::impl_::freelist) for more details.
+pub struct FreeList<T> {
+    entries: Vec<Slot<T>>,
+    split: usize,
+    capacity: usize,
+}
+
+impl<T> FreeList<T> {
+    /// Creates a new `FreeList` instance with specified capacity.
+    pub fn with_capacity(capacity: usize) -> FreeList<T> {
+        let entries = (0..capacity).map(|_| Slot::Empty).collect::<Vec<_>>();
+
+        FreeList {
+            entries,
+            split: 0,
+            capacity,
+        }
+    }
+
+    /// Pops the first non empty item.
+    pub fn pop(&mut self) -> Option<T> {
+        let idx = self.split;
+        if idx == 0 {
+            None
+        } else {
+            match mem::replace(&mut self.entries[idx - 1], Slot::Empty) {
+                Slot::Filled(v) => {
+                    self.split = idx - 1;
+                    Some(v)
+                }
+                _ => panic!("FreeList is corrupt"),
+            }
+        }
+    }
+
+    /// Inserts a value into the list. Returns `Some(val)` if the `FreeList` is full.
+    pub fn insert(&mut self, val: T) -> Option<T> {
+        let next = self.split + 1;
+        if next < self.capacity {
+            self.entries[self.split] = Slot::Filled(val);
+            self.split = next;
+            None
+        } else {
+            Some(val)
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/impl_/frompyobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/frompyobject.rs
--- 43.0.0-1/rust-vendor/pyo3/src/impl_/frompyobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/frompyobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,172 @@
+use crate::types::any::PyAnyMethods;
+use crate::Bound;
+use crate::{exceptions::PyTypeError, FromPyObject, PyAny, PyErr, PyResult, Python};
+
+pub enum Extractor<'a, 'py, T> {
+    Bound(fn(&'a Bound<'py, PyAny>) -> PyResult<T>),
+    #[cfg(feature = "gil-refs")]
+    GilRef(fn(&'a PyAny) -> PyResult<T>),
+}
+
+impl<'a, 'py, T> From<fn(&'a Bound<'py, PyAny>) -> PyResult<T>> for Extractor<'a, 'py, T> {
+    fn from(value: fn(&'a Bound<'py, PyAny>) -> PyResult<T>) -> Self {
+        Self::Bound(value)
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'a, T> From<fn(&'a PyAny) -> PyResult<T>> for Extractor<'a, '_, T> {
+    fn from(value: fn(&'a PyAny) -> PyResult<T>) -> Self {
+        Self::GilRef(value)
+    }
+}
+
+impl<'a, 'py, T> Extractor<'a, 'py, T> {
+    pub(crate) fn call(self, obj: &'a Bound<'py, PyAny>) -> PyResult<T> {
+        match self {
+            Extractor::Bound(f) => f(obj),
+            #[cfg(feature = "gil-refs")]
+            Extractor::GilRef(f) => f(obj.as_gil_ref()),
+        }
+    }
+}
+
+#[cold]
+pub fn failed_to_extract_enum(
+    py: Python<'_>,
+    type_name: &str,
+    variant_names: &[&str],
+    error_names: &[&str],
+    errors: &[PyErr],
+) -> PyErr {
+    // TODO maybe use ExceptionGroup on Python 3.11+ ?
+    let mut err_msg = format!(
+        "failed to extract enum {} ('{}')",
+        type_name,
+        error_names.join(" | ")
+    );
+    for ((variant_name, error_name), error) in variant_names.iter().zip(error_names).zip(errors) {
+        use std::fmt::Write;
+        write!(
+            &mut err_msg,
+            "\n- variant {variant_name} ({error_name}): {error_msg}",
+            variant_name = variant_name,
+            error_name = error_name,
+            error_msg = extract_traceback(py, error.clone_ref(py)),
+        )
+        .unwrap();
+    }
+    PyTypeError::new_err(err_msg)
+}
+
+/// Flattens a chain of errors into a single string.
+fn extract_traceback(py: Python<'_>, mut error: PyErr) -> String {
+    use std::fmt::Write;
+
+    let mut error_msg = error.to_string();
+    while let Some(cause) = error.cause(py) {
+        write!(&mut error_msg, ", caused by {}", cause).unwrap();
+        error = cause
+    }
+    error_msg
+}
+
+pub fn extract_struct_field<'py, T>(
+    obj: &Bound<'py, PyAny>,
+    struct_name: &str,
+    field_name: &str,
+) -> PyResult<T>
+where
+    T: FromPyObject<'py>,
+{
+    match obj.extract() {
+        Ok(value) => Ok(value),
+        Err(err) => Err(failed_to_extract_struct_field(
+            obj.py(),
+            err,
+            struct_name,
+            field_name,
+        )),
+    }
+}
+
+pub fn extract_struct_field_with<'a, 'py, T>(
+    extractor: impl Into<Extractor<'a, 'py, T>>,
+    obj: &'a Bound<'py, PyAny>,
+    struct_name: &str,
+    field_name: &str,
+) -> PyResult<T> {
+    match extractor.into().call(obj) {
+        Ok(value) => Ok(value),
+        Err(err) => Err(failed_to_extract_struct_field(
+            obj.py(),
+            err,
+            struct_name,
+            field_name,
+        )),
+    }
+}
+
+#[cold]
+fn failed_to_extract_struct_field(
+    py: Python<'_>,
+    inner_err: PyErr,
+    struct_name: &str,
+    field_name: &str,
+) -> PyErr {
+    let new_err = PyTypeError::new_err(format!(
+        "failed to extract field {}.{}",
+        struct_name, field_name
+    ));
+    new_err.set_cause(py, ::std::option::Option::Some(inner_err));
+    new_err
+}
+
+pub fn extract_tuple_struct_field<'py, T>(
+    obj: &Bound<'py, PyAny>,
+    struct_name: &str,
+    index: usize,
+) -> PyResult<T>
+where
+    T: FromPyObject<'py>,
+{
+    match obj.extract() {
+        Ok(value) => Ok(value),
+        Err(err) => Err(failed_to_extract_tuple_struct_field(
+            obj.py(),
+            err,
+            struct_name,
+            index,
+        )),
+    }
+}
+
+pub fn extract_tuple_struct_field_with<'a, 'py, T>(
+    extractor: impl Into<Extractor<'a, 'py, T>>,
+    obj: &'a Bound<'py, PyAny>,
+    struct_name: &str,
+    index: usize,
+) -> PyResult<T> {
+    match extractor.into().call(obj) {
+        Ok(value) => Ok(value),
+        Err(err) => Err(failed_to_extract_tuple_struct_field(
+            obj.py(),
+            err,
+            struct_name,
+            index,
+        )),
+    }
+}
+
+#[cold]
+fn failed_to_extract_tuple_struct_field(
+    py: Python<'_>,
+    inner_err: PyErr,
+    struct_name: &str,
+    index: usize,
+) -> PyErr {
+    let new_err =
+        PyTypeError::new_err(format!("failed to extract field {}.{}", struct_name, index));
+    new_err.set_cause(py, ::std::option::Option::Some(inner_err));
+    new_err
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/impl_/not_send.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/not_send.rs
--- 43.0.0-1/rust-vendor/pyo3/src/impl_/not_send.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/not_send.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,10 @@
+use std::marker::PhantomData;
+
+use crate::Python;
+
+/// A marker type that makes the type !Send.
+/// Workaround for lack of !Send on stable (<https://github.com/rust-lang/rust/issues/68318>).
+pub(crate) struct NotSend(PhantomData<*mut Python<'static>>);
+
+#[cfg(feature = "gil-refs")]
+pub(crate) const NOT_SEND: NotSend = NotSend(PhantomData);
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/impl_/panic.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/panic.rs
--- 43.0.0-1/rust-vendor/pyo3/src/impl_/panic.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/panic.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,27 @@
+/// Type which will panic if dropped.
+///
+/// If this is dropped during a panic, this will cause an abort.
+///
+/// Use this to avoid letting unwinds cross through the FFI boundary, which is UB.
+pub struct PanicTrap {
+    msg: &'static str,
+}
+
+impl PanicTrap {
+    #[inline]
+    pub const fn new(msg: &'static str) -> Self {
+        Self { msg }
+    }
+
+    #[inline]
+    pub const fn disarm(self) {
+        std::mem::forget(self)
+    }
+}
+
+impl Drop for PanicTrap {
+    fn drop(&mut self) {
+        // Panic here will abort the process, assuming in an unwind.
+        panic!("{}", self.msg)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/impl_/pycell.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/pycell.rs
--- 43.0.0-1/rust-vendor/pyo3/src/impl_/pycell.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/pycell.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4 @@
+//! Externally-accessible implementation of pycell
+pub use crate::pycell::impl_::{
+    GetBorrowChecker, PyClassMutability, PyClassObject, PyClassObjectBase, PyClassObjectLayout,
+};
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/impl_/pyclass/lazy_type_object.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/pyclass/lazy_type_object.rs
--- 43.0.0-1/rust-vendor/pyo3/src/impl_/pyclass/lazy_type_object.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/pyclass/lazy_type_object.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,227 @@
+use std::{
+    cell::RefCell,
+    ffi::CStr,
+    marker::PhantomData,
+    thread::{self, ThreadId},
+};
+
+use crate::{
+    exceptions::PyRuntimeError,
+    ffi,
+    impl_::pyclass::MaybeRuntimePyMethodDef,
+    pyclass::{create_type_object, PyClassTypeObject},
+    sync::{GILOnceCell, GILProtected},
+    types::PyType,
+    Bound, PyClass, PyErr, PyMethodDefType, PyObject, PyResult, Python,
+};
+
+use super::PyClassItemsIter;
+
+/// Lazy type object for PyClass.
+#[doc(hidden)]
+pub struct LazyTypeObject<T>(LazyTypeObjectInner, PhantomData<T>);
+
+// Non-generic inner of LazyTypeObject to keep code size down
+struct LazyTypeObjectInner {
+    value: GILOnceCell<PyClassTypeObject>,
+    // Threads which have begun initialization of the `tp_dict`. Used for
+    // reentrant initialization detection.
+    initializing_threads: GILProtected<RefCell<Vec<ThreadId>>>,
+    tp_dict_filled: GILOnceCell<()>,
+}
+
+impl<T> LazyTypeObject<T> {
+    /// Creates an uninitialized `LazyTypeObject`.
+    #[allow(clippy::new_without_default)]
+    pub const fn new() -> Self {
+        LazyTypeObject(
+            LazyTypeObjectInner {
+                value: GILOnceCell::new(),
+                initializing_threads: GILProtected::new(RefCell::new(Vec::new())),
+                tp_dict_filled: GILOnceCell::new(),
+            },
+            PhantomData,
+        )
+    }
+}
+
+impl<T: PyClass> LazyTypeObject<T> {
+    /// Gets the type object contained by this `LazyTypeObject`, initializing it if needed.
+    pub fn get_or_init<'py>(&self, py: Python<'py>) -> &Bound<'py, PyType> {
+        self.get_or_try_init(py).unwrap_or_else(|err| {
+            err.print(py);
+            panic!("failed to create type object for {}", T::NAME)
+        })
+    }
+
+    /// Fallible version of the above.
+    pub(crate) fn get_or_try_init<'py>(&self, py: Python<'py>) -> PyResult<&Bound<'py, PyType>> {
+        self.0
+            .get_or_try_init(py, create_type_object::<T>, T::NAME, T::items_iter())
+    }
+}
+
+impl LazyTypeObjectInner {
+    // Uses dynamically dispatched fn(Python<'py>) -> PyResult<Py<PyType>
+    // so that this code is only instantiated once, instead of for every T
+    // like the generic LazyTypeObject<T> methods above.
+    fn get_or_try_init<'py>(
+        &self,
+        py: Python<'py>,
+        init: fn(Python<'py>) -> PyResult<PyClassTypeObject>,
+        name: &str,
+        items_iter: PyClassItemsIter,
+    ) -> PyResult<&Bound<'py, PyType>> {
+        (|| -> PyResult<_> {
+            let type_object = self
+                .value
+                .get_or_try_init(py, || init(py))?
+                .type_object
+                .bind(py);
+            self.ensure_init(type_object, name, items_iter)?;
+            Ok(type_object)
+        })()
+        .map_err(|err| {
+            wrap_in_runtime_error(
+                py,
+                err,
+                format!("An error occurred while initializing class {}", name),
+            )
+        })
+    }
+
+    fn ensure_init(
+        &self,
+        type_object: &Bound<'_, PyType>,
+        name: &str,
+        items_iter: PyClassItemsIter,
+    ) -> PyResult<()> {
+        let py = type_object.py();
+
+        // We might want to fill the `tp_dict` with python instances of `T`
+        // itself. In order to do so, we must first initialize the type object
+        // with an empty `tp_dict`: now we can create instances of `T`.
+        //
+        // Then we fill the `tp_dict`. Multiple threads may try to fill it at
+        // the same time, but only one of them will succeed.
+        //
+        // More importantly, if a thread is performing initialization of the
+        // `tp_dict`, it can still request the type object through `get_or_init`,
+        // but the `tp_dict` may appear empty of course.
+
+        if self.tp_dict_filled.get(py).is_some() {
+            // `tp_dict` is already filled: ok.
+            return Ok(());
+        }
+
+        let thread_id = thread::current().id();
+        {
+            let mut threads = self.initializing_threads.get(py).borrow_mut();
+            if threads.contains(&thread_id) {
+                // Reentrant call: just return the type object, even if the
+                // `tp_dict` is not filled yet.
+                return Ok(());
+            }
+            threads.push(thread_id);
+        }
+
+        struct InitializationGuard<'a> {
+            initializing_threads: &'a GILProtected<RefCell<Vec<ThreadId>>>,
+            py: Python<'a>,
+            thread_id: ThreadId,
+        }
+        impl Drop for InitializationGuard<'_> {
+            fn drop(&mut self) {
+                let mut threads = self.initializing_threads.get(self.py).borrow_mut();
+                threads.retain(|id| *id != self.thread_id);
+            }
+        }
+
+        let guard = InitializationGuard {
+            initializing_threads: &self.initializing_threads,
+            py,
+            thread_id,
+        };
+
+        // Pre-compute the class attribute objects: this can temporarily
+        // release the GIL since we're calling into arbitrary user code. It
+        // means that another thread can continue the initialization in the
+        // meantime: at worst, we'll just make a useless computation.
+        let mut items = vec![];
+        for class_items in items_iter {
+            for def in class_items.methods {
+                let built_method;
+                let method = match def {
+                    MaybeRuntimePyMethodDef::Runtime(builder) => {
+                        built_method = builder();
+                        &built_method
+                    }
+                    MaybeRuntimePyMethodDef::Static(method) => method,
+                };
+                if let PyMethodDefType::ClassAttribute(attr) = method {
+                    match (attr.meth)(py) {
+                        Ok(val) => items.push((attr.name, val)),
+                        Err(err) => {
+                            return Err(wrap_in_runtime_error(
+                                py,
+                                err,
+                                format!(
+                                    "An error occurred while initializing `{}.{}`",
+                                    name,
+                                    attr.name.to_str().unwrap()
+                                ),
+                            ))
+                        }
+                    }
+                }
+            }
+        }
+
+        // Now we hold the GIL and we can assume it won't be released until we
+        // return from the function.
+        let result = self.tp_dict_filled.get_or_try_init(py, move || {
+            let result = initialize_tp_dict(py, type_object.as_ptr(), items);
+
+            // Initialization successfully complete, can clear the thread list.
+            // (No further calls to get_or_init() will try to init, on any thread.)
+            std::mem::forget(guard);
+            self.initializing_threads.get(py).replace(Vec::new());
+            result
+        });
+
+        if let Err(err) = result {
+            return Err(wrap_in_runtime_error(
+                py,
+                err.clone_ref(py),
+                format!("An error occurred while initializing `{}.__dict__`", name),
+            ));
+        }
+
+        Ok(())
+    }
+}
+
+fn initialize_tp_dict(
+    py: Python<'_>,
+    type_object: *mut ffi::PyObject,
+    items: Vec<(&'static CStr, PyObject)>,
+) -> PyResult<()> {
+    // We hold the GIL: the dictionary update can be considered atomic from
+    // the POV of other threads.
+    for (key, val) in items {
+        crate::err::error_on_minusone(py, unsafe {
+            ffi::PyObject_SetAttrString(type_object, key.as_ptr(), val.into_ptr())
+        })?;
+    }
+    Ok(())
+}
+
+// This is necessary for making static `LazyTypeObject`s
+unsafe impl<T> Sync for LazyTypeObject<T> {}
+
+#[cold]
+fn wrap_in_runtime_error(py: Python<'_>, err: PyErr, message: String) -> PyErr {
+    let runtime_err = PyRuntimeError::new_err(message);
+    runtime_err.set_cause(py, Some(err));
+    runtime_err
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/impl_/pyclass.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/pyclass.rs
--- 43.0.0-1/rust-vendor/pyo3/src/impl_/pyclass.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/pyclass.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1456 @@
+#[cfg(feature = "gil-refs")]
+use crate::PyNativeType;
+use crate::{
+    exceptions::{PyAttributeError, PyNotImplementedError, PyRuntimeError, PyValueError},
+    ffi,
+    impl_::freelist::FreeList,
+    impl_::pycell::{GetBorrowChecker, PyClassMutability, PyClassObjectLayout},
+    pyclass_init::PyObjectInit,
+    types::{any::PyAnyMethods, PyBool},
+    Borrowed, IntoPy, Py, PyAny, PyClass, PyErr, PyMethodDefType, PyResult, PyTypeInfo, Python,
+    ToPyObject,
+};
+use std::{
+    borrow::Cow,
+    ffi::{CStr, CString},
+    marker::PhantomData,
+    os::raw::{c_int, c_void},
+    ptr::NonNull,
+    thread,
+};
+
+mod lazy_type_object;
+pub use lazy_type_object::LazyTypeObject;
+
+/// Gets the offset of the dictionary from the start of the object in bytes.
+#[inline]
+pub fn dict_offset<T: PyClass>() -> ffi::Py_ssize_t {
+    PyClassObject::<T>::dict_offset()
+}
+
+/// Gets the offset of the weakref list from the start of the object in bytes.
+#[inline]
+pub fn weaklist_offset<T: PyClass>() -> ffi::Py_ssize_t {
+    PyClassObject::<T>::weaklist_offset()
+}
+
+/// Represents the `__dict__` field for `#[pyclass]`.
+pub trait PyClassDict {
+    /// Initial form of a [PyObject](crate::ffi::PyObject) `__dict__` reference.
+    const INIT: Self;
+    /// Empties the dictionary of its key-value pairs.
+    #[inline]
+    fn clear_dict(&mut self, _py: Python<'_>) {}
+    private_decl! {}
+}
+
+/// Represents the `__weakref__` field for `#[pyclass]`.
+pub trait PyClassWeakRef {
+    /// Initializes a `weakref` instance.
+    const INIT: Self;
+    /// Clears the weak references to the given object.
+    ///
+    /// # Safety
+    /// - `_obj` must be a pointer to the pyclass instance which contains `self`.
+    /// - The GIL must be held.
+    #[inline]
+    unsafe fn clear_weakrefs(&mut self, _obj: *mut ffi::PyObject, _py: Python<'_>) {}
+    private_decl! {}
+}
+
+/// Zero-sized dummy field.
+pub struct PyClassDummySlot;
+
+impl PyClassDict for PyClassDummySlot {
+    private_impl! {}
+    const INIT: Self = PyClassDummySlot;
+}
+
+impl PyClassWeakRef for PyClassDummySlot {
+    private_impl! {}
+    const INIT: Self = PyClassDummySlot;
+}
+
+/// Actual dict field, which holds the pointer to `__dict__`.
+///
+/// `#[pyclass(dict)]` automatically adds this.
+#[repr(transparent)]
+#[allow(dead_code)] // These are constructed in INIT and used by the macro code
+pub struct PyClassDictSlot(*mut ffi::PyObject);
+
+impl PyClassDict for PyClassDictSlot {
+    private_impl! {}
+    const INIT: Self = Self(std::ptr::null_mut());
+    #[inline]
+    fn clear_dict(&mut self, _py: Python<'_>) {
+        if !self.0.is_null() {
+            unsafe { ffi::PyDict_Clear(self.0) }
+        }
+    }
+}
+
+/// Actual weakref field, which holds the pointer to `__weakref__`.
+///
+/// `#[pyclass(weakref)]` automatically adds this.
+#[repr(transparent)]
+#[allow(dead_code)] // These are constructed in INIT and used by the macro code
+pub struct PyClassWeakRefSlot(*mut ffi::PyObject);
+
+impl PyClassWeakRef for PyClassWeakRefSlot {
+    private_impl! {}
+    const INIT: Self = Self(std::ptr::null_mut());
+    #[inline]
+    unsafe fn clear_weakrefs(&mut self, obj: *mut ffi::PyObject, _py: Python<'_>) {
+        if !self.0.is_null() {
+            ffi::PyObject_ClearWeakRefs(obj)
+        }
+    }
+}
+
+/// This type is used as a "dummy" type on which dtolnay specializations are
+/// applied to apply implementations from `#[pymethods]`
+pub struct PyClassImplCollector<T>(PhantomData<T>);
+
+impl<T> PyClassImplCollector<T> {
+    pub fn new() -> Self {
+        Self(PhantomData)
+    }
+}
+
+impl<T> Default for PyClassImplCollector<T> {
+    fn default() -> Self {
+        Self::new()
+    }
+}
+
+impl<T> Clone for PyClassImplCollector<T> {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+impl<T> Copy for PyClassImplCollector<T> {}
+
+pub enum MaybeRuntimePyMethodDef {
+    /// Used in cases where const functionality is not sufficient to define the method
+    /// purely at compile time.
+    Runtime(fn() -> PyMethodDefType),
+    Static(PyMethodDefType),
+}
+
+pub struct PyClassItems {
+    pub methods: &'static [MaybeRuntimePyMethodDef],
+    pub slots: &'static [ffi::PyType_Slot],
+}
+
+// Allow PyClassItems in statics
+unsafe impl Sync for PyClassItems {}
+
+/// Implements the underlying functionality of `#[pyclass]`, assembled by various proc macros.
+///
+/// Users are discouraged from implementing this trait manually; it is a PyO3 implementation detail
+/// and may be changed at any time.
+pub trait PyClassImpl: Sized + 'static {
+    /// #[pyclass(subclass)]
+    const IS_BASETYPE: bool = false;
+
+    /// #[pyclass(extends=...)]
+    const IS_SUBCLASS: bool = false;
+
+    /// #[pyclass(mapping)]
+    const IS_MAPPING: bool = false;
+
+    /// #[pyclass(sequence)]
+    const IS_SEQUENCE: bool = false;
+
+    /// Base class
+    type BaseType: PyTypeInfo + PyClassBaseType;
+
+    /// Immutable or mutable
+    type PyClassMutability: PyClassMutability + GetBorrowChecker<Self>;
+
+    /// Specify this class has `#[pyclass(dict)]` or not.
+    type Dict: PyClassDict;
+
+    /// Specify this class has `#[pyclass(weakref)]` or not.
+    type WeakRef: PyClassWeakRef;
+
+    /// The closest native ancestor. This is `PyAny` by default, and when you declare
+    /// `#[pyclass(extends=PyDict)]`, it's `PyDict`.
+    #[cfg(feature = "gil-refs")]
+    type BaseNativeType: PyTypeInfo + PyNativeType;
+    /// The closest native ancestor. This is `PyAny` by default, and when you declare
+    /// `#[pyclass(extends=PyDict)]`, it's `PyDict`.
+    #[cfg(not(feature = "gil-refs"))]
+    type BaseNativeType: PyTypeInfo;
+
+    /// This handles following two situations:
+    /// 1. In case `T` is `Send`, stub `ThreadChecker` is used and does nothing.
+    ///    This implementation is used by default. Compile fails if `T: !Send`.
+    /// 2. In case `T` is `!Send`, `ThreadChecker` panics when `T` is accessed by another thread.
+    ///    This implementation is used when `#[pyclass(unsendable)]` is given.
+    ///    Panicking makes it safe to expose `T: !Send` to the Python interpreter, where all objects
+    ///    can be accessed by multiple threads by `threading` module.
+    type ThreadChecker: PyClassThreadChecker<Self>;
+
+    #[cfg(feature = "multiple-pymethods")]
+    type Inventory: PyClassInventory;
+
+    /// Rendered class doc
+    fn doc(py: Python<'_>) -> PyResult<&'static CStr>;
+
+    fn items_iter() -> PyClassItemsIter;
+
+    #[inline]
+    fn dict_offset() -> Option<ffi::Py_ssize_t> {
+        None
+    }
+
+    #[inline]
+    fn weaklist_offset() -> Option<ffi::Py_ssize_t> {
+        None
+    }
+
+    fn lazy_type_object() -> &'static LazyTypeObject<Self>;
+}
+
+/// Runtime helper to build a class docstring from the `doc` and `text_signature`.
+///
+/// This is done at runtime because the class text signature is collected via dtolnay
+/// specialization in to the `#[pyclass]` macro from the `#[pymethods]` macro.
+pub fn build_pyclass_doc(
+    class_name: &'static str,
+    doc: &'static CStr,
+    text_signature: Option<&'static str>,
+) -> PyResult<Cow<'static, CStr>> {
+    if let Some(text_signature) = text_signature {
+        let doc = CString::new(format!(
+            "{}{}\n--\n\n{}",
+            class_name,
+            text_signature,
+            doc.to_str().unwrap(),
+        ))
+        .map_err(|_| PyValueError::new_err("class doc cannot contain nul bytes"))?;
+        Ok(Cow::Owned(doc))
+    } else {
+        Ok(Cow::Borrowed(doc))
+    }
+}
+
+/// Iterator used to process all class items during type instantiation.
+pub struct PyClassItemsIter {
+    /// Iteration state
+    idx: usize,
+    /// Items from the `#[pyclass]` macro
+    pyclass_items: &'static PyClassItems,
+    /// Items from the `#[pymethods]` macro
+    #[cfg(not(feature = "multiple-pymethods"))]
+    pymethods_items: &'static PyClassItems,
+    /// Items from the `#[pymethods]` macro with inventory
+    #[cfg(feature = "multiple-pymethods")]
+    pymethods_items: Box<dyn Iterator<Item = &'static PyClassItems>>,
+}
+
+impl PyClassItemsIter {
+    pub fn new(
+        pyclass_items: &'static PyClassItems,
+        #[cfg(not(feature = "multiple-pymethods"))] pymethods_items: &'static PyClassItems,
+        #[cfg(feature = "multiple-pymethods")] pymethods_items: Box<
+            dyn Iterator<Item = &'static PyClassItems>,
+        >,
+    ) -> Self {
+        Self {
+            idx: 0,
+            pyclass_items,
+            pymethods_items,
+        }
+    }
+}
+
+impl Iterator for PyClassItemsIter {
+    type Item = &'static PyClassItems;
+
+    #[cfg(not(feature = "multiple-pymethods"))]
+    fn next(&mut self) -> Option<Self::Item> {
+        match self.idx {
+            0 => {
+                self.idx += 1;
+                Some(self.pyclass_items)
+            }
+            1 => {
+                self.idx += 1;
+                Some(self.pymethods_items)
+            }
+            // Termination clause
+            _ => None,
+        }
+    }
+
+    #[cfg(feature = "multiple-pymethods")]
+    fn next(&mut self) -> Option<Self::Item> {
+        match self.idx {
+            0 => {
+                self.idx += 1;
+                Some(self.pyclass_items)
+            }
+            // Termination clause
+            _ => self.pymethods_items.next(),
+        }
+    }
+}
+
+// Traits describing known special methods.
+
+macro_rules! slot_fragment_trait {
+    ($trait_name:ident, $($default_method:tt)*) => {
+        #[allow(non_camel_case_types)]
+        pub trait $trait_name<T>: Sized {
+            $($default_method)*
+        }
+
+        impl<T> $trait_name<T> for &'_ PyClassImplCollector<T> {}
+    }
+}
+
+slot_fragment_trait! {
+    PyClass__getattribute__SlotFragment,
+
+    /// # Safety: _slf and _attr must be valid non-null Python objects
+    #[inline]
+    unsafe fn __getattribute__(
+        self,
+        py: Python<'_>,
+        slf: *mut ffi::PyObject,
+        attr: *mut ffi::PyObject,
+    ) -> PyResult<*mut ffi::PyObject> {
+        let res = ffi::PyObject_GenericGetAttr(slf, attr);
+        if res.is_null() {
+            Err(PyErr::fetch(py))
+        } else {
+            Ok(res)
+        }
+    }
+}
+
+slot_fragment_trait! {
+    PyClass__getattr__SlotFragment,
+
+    /// # Safety: _slf and _attr must be valid non-null Python objects
+    #[inline]
+    unsafe fn __getattr__(
+        self,
+        py: Python<'_>,
+        _slf: *mut ffi::PyObject,
+        attr: *mut ffi::PyObject,
+    ) -> PyResult<*mut ffi::PyObject> {
+        Err(PyErr::new::<PyAttributeError, _>(
+            (Py::<PyAny>::from_borrowed_ptr(py, attr),)
+        ))
+    }
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! generate_pyclass_getattro_slot {
+    ($cls:ty) => {{
+        unsafe extern "C" fn __wrap(
+            _slf: *mut $crate::ffi::PyObject,
+            attr: *mut $crate::ffi::PyObject,
+        ) -> *mut $crate::ffi::PyObject {
+            $crate::impl_::trampoline::getattrofunc(_slf, attr, |py, _slf, attr| {
+                use ::std::result::Result::*;
+                use $crate::impl_::pyclass::*;
+                let collector = PyClassImplCollector::<$cls>::new();
+
+                // Strategy:
+                // - Try __getattribute__ first. Its default is PyObject_GenericGetAttr.
+                // - If it returns a result, use it.
+                // - If it fails with AttributeError, try __getattr__.
+                // - If it fails otherwise, reraise.
+                match collector.__getattribute__(py, _slf, attr) {
+                    Ok(obj) => Ok(obj),
+                    Err(e) if e.is_instance_of::<$crate::exceptions::PyAttributeError>(py) => {
+                        collector.__getattr__(py, _slf, attr)
+                    }
+                    Err(e) => Err(e),
+                }
+            })
+        }
+        $crate::ffi::PyType_Slot {
+            slot: $crate::ffi::Py_tp_getattro,
+            pfunc: __wrap as $crate::ffi::getattrofunc as _,
+        }
+    }};
+}
+
+pub use generate_pyclass_getattro_slot;
+
+/// Macro which expands to three items
+/// - Trait for a __setitem__ dunder
+/// - Trait for the corresponding __delitem__ dunder
+/// - A macro which will use dtolnay specialisation to generate the shared slot for the two dunders
+macro_rules! define_pyclass_setattr_slot {
+    (
+        $set_trait:ident,
+        $del_trait:ident,
+        $set:ident,
+        $del:ident,
+        $set_error:expr,
+        $del_error:expr,
+        $generate_macro:ident,
+        $slot:ident,
+        $func_ty:ident,
+    ) => {
+        slot_fragment_trait! {
+            $set_trait,
+
+            /// # Safety: _slf and _attr must be valid non-null Python objects
+            #[inline]
+            unsafe fn $set(
+                self,
+                _py: Python<'_>,
+                _slf: *mut ffi::PyObject,
+                _attr: *mut ffi::PyObject,
+                _value: NonNull<ffi::PyObject>,
+            ) -> PyResult<()> {
+                $set_error
+            }
+        }
+
+        slot_fragment_trait! {
+            $del_trait,
+
+            /// # Safety: _slf and _attr must be valid non-null Python objects
+            #[inline]
+            unsafe fn $del(
+                self,
+                _py: Python<'_>,
+                _slf: *mut ffi::PyObject,
+                _attr: *mut ffi::PyObject,
+            ) -> PyResult<()> {
+                $del_error
+            }
+        }
+
+        #[doc(hidden)]
+        #[macro_export]
+        macro_rules! $generate_macro {
+            ($cls:ty) => {{
+                unsafe extern "C" fn __wrap(
+                    _slf: *mut $crate::ffi::PyObject,
+                    attr: *mut $crate::ffi::PyObject,
+                    value: *mut $crate::ffi::PyObject,
+                ) -> ::std::os::raw::c_int {
+                    $crate::impl_::trampoline::setattrofunc(
+                        _slf,
+                        attr,
+                        value,
+                        |py, _slf, attr, value| {
+                            use ::std::option::Option::*;
+                            use $crate::callback::IntoPyCallbackOutput;
+                            use $crate::impl_::pyclass::*;
+                            let collector = PyClassImplCollector::<$cls>::new();
+                            if let Some(value) = ::std::ptr::NonNull::new(value) {
+                                collector.$set(py, _slf, attr, value).convert(py)
+                            } else {
+                                collector.$del(py, _slf, attr).convert(py)
+                            }
+                        },
+                    )
+                }
+                $crate::ffi::PyType_Slot {
+                    slot: $crate::ffi::$slot,
+                    pfunc: __wrap as $crate::ffi::$func_ty as _,
+                }
+            }};
+        }
+        pub use $generate_macro;
+    };
+}
+
+define_pyclass_setattr_slot! {
+    PyClass__setattr__SlotFragment,
+    PyClass__delattr__SlotFragment,
+    __setattr__,
+    __delattr__,
+    Err(PyAttributeError::new_err("can't set attribute")),
+    Err(PyAttributeError::new_err("can't delete attribute")),
+    generate_pyclass_setattr_slot,
+    Py_tp_setattro,
+    setattrofunc,
+}
+
+define_pyclass_setattr_slot! {
+    PyClass__set__SlotFragment,
+    PyClass__delete__SlotFragment,
+    __set__,
+    __delete__,
+    Err(PyNotImplementedError::new_err("can't set descriptor")),
+    Err(PyNotImplementedError::new_err("can't delete descriptor")),
+    generate_pyclass_setdescr_slot,
+    Py_tp_descr_set,
+    descrsetfunc,
+}
+
+define_pyclass_setattr_slot! {
+    PyClass__setitem__SlotFragment,
+    PyClass__delitem__SlotFragment,
+    __setitem__,
+    __delitem__,
+    Err(PyNotImplementedError::new_err("can't set item")),
+    Err(PyNotImplementedError::new_err("can't delete item")),
+    generate_pyclass_setitem_slot,
+    Py_mp_ass_subscript,
+    objobjargproc,
+}
+
+/// Macro which expands to three items
+/// - Trait for a lhs dunder e.g. __add__
+/// - Trait for the corresponding rhs e.g. __radd__
+/// - A macro which will use dtolnay specialisation to generate the shared slot for the two dunders
+macro_rules! define_pyclass_binary_operator_slot {
+    (
+        $lhs_trait:ident,
+        $rhs_trait:ident,
+        $lhs:ident,
+        $rhs:ident,
+        $generate_macro:ident,
+        $slot:ident,
+        $func_ty:ident,
+    ) => {
+        slot_fragment_trait! {
+            $lhs_trait,
+
+            /// # Safety: _slf and _other must be valid non-null Python objects
+            #[inline]
+            unsafe fn $lhs(
+                self,
+                py: Python<'_>,
+                _slf: *mut ffi::PyObject,
+                _other: *mut ffi::PyObject,
+            ) -> PyResult<*mut ffi::PyObject> {
+                Ok(py.NotImplemented().into_ptr())
+            }
+        }
+
+        slot_fragment_trait! {
+            $rhs_trait,
+
+            /// # Safety: _slf and _other must be valid non-null Python objects
+            #[inline]
+            unsafe fn $rhs(
+                self,
+                py: Python<'_>,
+                _slf: *mut ffi::PyObject,
+                _other: *mut ffi::PyObject,
+            ) -> PyResult<*mut ffi::PyObject> {
+                Ok(py.NotImplemented().into_ptr())
+            }
+        }
+
+        #[doc(hidden)]
+        #[macro_export]
+        macro_rules! $generate_macro {
+            ($cls:ty) => {{
+                unsafe extern "C" fn __wrap(
+                    _slf: *mut $crate::ffi::PyObject,
+                    _other: *mut $crate::ffi::PyObject,
+                ) -> *mut $crate::ffi::PyObject {
+                    $crate::impl_::trampoline::binaryfunc(_slf, _other, |py, _slf, _other| {
+                        use $crate::impl_::pyclass::*;
+                        let collector = PyClassImplCollector::<$cls>::new();
+                        let lhs_result = collector.$lhs(py, _slf, _other)?;
+                        if lhs_result == $crate::ffi::Py_NotImplemented() {
+                            $crate::ffi::Py_DECREF(lhs_result);
+                            collector.$rhs(py, _other, _slf)
+                        } else {
+                            ::std::result::Result::Ok(lhs_result)
+                        }
+                    })
+                }
+                $crate::ffi::PyType_Slot {
+                    slot: $crate::ffi::$slot,
+                    pfunc: __wrap as $crate::ffi::$func_ty as _,
+                }
+            }};
+        }
+        pub use $generate_macro;
+    };
+}
+
+define_pyclass_binary_operator_slot! {
+    PyClass__add__SlotFragment,
+    PyClass__radd__SlotFragment,
+    __add__,
+    __radd__,
+    generate_pyclass_add_slot,
+    Py_nb_add,
+    binaryfunc,
+}
+
+define_pyclass_binary_operator_slot! {
+    PyClass__sub__SlotFragment,
+    PyClass__rsub__SlotFragment,
+    __sub__,
+    __rsub__,
+    generate_pyclass_sub_slot,
+    Py_nb_subtract,
+    binaryfunc,
+}
+
+define_pyclass_binary_operator_slot! {
+    PyClass__mul__SlotFragment,
+    PyClass__rmul__SlotFragment,
+    __mul__,
+    __rmul__,
+    generate_pyclass_mul_slot,
+    Py_nb_multiply,
+    binaryfunc,
+}
+
+define_pyclass_binary_operator_slot! {
+    PyClass__mod__SlotFragment,
+    PyClass__rmod__SlotFragment,
+    __mod__,
+    __rmod__,
+    generate_pyclass_mod_slot,
+    Py_nb_remainder,
+    binaryfunc,
+}
+
+define_pyclass_binary_operator_slot! {
+    PyClass__divmod__SlotFragment,
+    PyClass__rdivmod__SlotFragment,
+    __divmod__,
+    __rdivmod__,
+    generate_pyclass_divmod_slot,
+    Py_nb_divmod,
+    binaryfunc,
+}
+
+define_pyclass_binary_operator_slot! {
+    PyClass__lshift__SlotFragment,
+    PyClass__rlshift__SlotFragment,
+    __lshift__,
+    __rlshift__,
+    generate_pyclass_lshift_slot,
+    Py_nb_lshift,
+    binaryfunc,
+}
+
+define_pyclass_binary_operator_slot! {
+    PyClass__rshift__SlotFragment,
+    PyClass__rrshift__SlotFragment,
+    __rshift__,
+    __rrshift__,
+    generate_pyclass_rshift_slot,
+    Py_nb_rshift,
+    binaryfunc,
+}
+
+define_pyclass_binary_operator_slot! {
+    PyClass__and__SlotFragment,
+    PyClass__rand__SlotFragment,
+    __and__,
+    __rand__,
+    generate_pyclass_and_slot,
+    Py_nb_and,
+    binaryfunc,
+}
+
+define_pyclass_binary_operator_slot! {
+    PyClass__or__SlotFragment,
+    PyClass__ror__SlotFragment,
+    __or__,
+    __ror__,
+    generate_pyclass_or_slot,
+    Py_nb_or,
+    binaryfunc,
+}
+
+define_pyclass_binary_operator_slot! {
+    PyClass__xor__SlotFragment,
+    PyClass__rxor__SlotFragment,
+    __xor__,
+    __rxor__,
+    generate_pyclass_xor_slot,
+    Py_nb_xor,
+    binaryfunc,
+}
+
+define_pyclass_binary_operator_slot! {
+    PyClass__matmul__SlotFragment,
+    PyClass__rmatmul__SlotFragment,
+    __matmul__,
+    __rmatmul__,
+    generate_pyclass_matmul_slot,
+    Py_nb_matrix_multiply,
+    binaryfunc,
+}
+
+define_pyclass_binary_operator_slot! {
+    PyClass__truediv__SlotFragment,
+    PyClass__rtruediv__SlotFragment,
+    __truediv__,
+    __rtruediv__,
+    generate_pyclass_truediv_slot,
+    Py_nb_true_divide,
+    binaryfunc,
+}
+
+define_pyclass_binary_operator_slot! {
+    PyClass__floordiv__SlotFragment,
+    PyClass__rfloordiv__SlotFragment,
+    __floordiv__,
+    __rfloordiv__,
+    generate_pyclass_floordiv_slot,
+    Py_nb_floor_divide,
+    binaryfunc,
+}
+
+slot_fragment_trait! {
+    PyClass__pow__SlotFragment,
+
+    /// # Safety: _slf and _other must be valid non-null Python objects
+    #[inline]
+    unsafe fn __pow__(
+        self,
+        py: Python<'_>,
+        _slf: *mut ffi::PyObject,
+        _other: *mut ffi::PyObject,
+        _mod: *mut ffi::PyObject,
+    ) -> PyResult<*mut ffi::PyObject> {
+        Ok(py.NotImplemented().into_ptr())
+    }
+}
+
+slot_fragment_trait! {
+    PyClass__rpow__SlotFragment,
+
+    /// # Safety: _slf and _other must be valid non-null Python objects
+    #[inline]
+    unsafe fn __rpow__(
+        self,
+        py: Python<'_>,
+        _slf: *mut ffi::PyObject,
+        _other: *mut ffi::PyObject,
+        _mod: *mut ffi::PyObject,
+    ) -> PyResult<*mut ffi::PyObject> {
+        Ok(py.NotImplemented().into_ptr())
+    }
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! generate_pyclass_pow_slot {
+    ($cls:ty) => {{
+        unsafe extern "C" fn __wrap(
+            _slf: *mut $crate::ffi::PyObject,
+            _other: *mut $crate::ffi::PyObject,
+            _mod: *mut $crate::ffi::PyObject,
+        ) -> *mut $crate::ffi::PyObject {
+            $crate::impl_::trampoline::ternaryfunc(_slf, _other, _mod, |py, _slf, _other, _mod| {
+                use $crate::impl_::pyclass::*;
+                let collector = PyClassImplCollector::<$cls>::new();
+                let lhs_result = collector.__pow__(py, _slf, _other, _mod)?;
+                if lhs_result == $crate::ffi::Py_NotImplemented() {
+                    $crate::ffi::Py_DECREF(lhs_result);
+                    collector.__rpow__(py, _other, _slf, _mod)
+                } else {
+                    ::std::result::Result::Ok(lhs_result)
+                }
+            })
+        }
+        $crate::ffi::PyType_Slot {
+            slot: $crate::ffi::Py_nb_power,
+            pfunc: __wrap as $crate::ffi::ternaryfunc as _,
+        }
+    }};
+}
+pub use generate_pyclass_pow_slot;
+
+slot_fragment_trait! {
+    PyClass__lt__SlotFragment,
+
+    /// # Safety: _slf and _other must be valid non-null Python objects
+    #[inline]
+    unsafe fn __lt__(
+        self,
+        py: Python<'_>,
+        _slf: *mut ffi::PyObject,
+        _other: *mut ffi::PyObject,
+    ) -> PyResult<*mut ffi::PyObject> {
+        Ok(py.NotImplemented().into_ptr())
+    }
+}
+
+slot_fragment_trait! {
+    PyClass__le__SlotFragment,
+
+    /// # Safety: _slf and _other must be valid non-null Python objects
+    #[inline]
+    unsafe fn __le__(
+        self,
+        py: Python<'_>,
+        _slf: *mut ffi::PyObject,
+        _other: *mut ffi::PyObject,
+    ) -> PyResult<*mut ffi::PyObject> {
+        Ok(py.NotImplemented().into_ptr())
+    }
+}
+
+slot_fragment_trait! {
+    PyClass__eq__SlotFragment,
+
+    /// # Safety: _slf and _other must be valid non-null Python objects
+    #[inline]
+    unsafe fn __eq__(
+        self,
+        py: Python<'_>,
+        _slf: *mut ffi::PyObject,
+        _other: *mut ffi::PyObject,
+    ) -> PyResult<*mut ffi::PyObject> {
+        Ok(py.NotImplemented().into_ptr())
+    }
+}
+
+slot_fragment_trait! {
+    PyClass__ne__SlotFragment,
+
+    /// # Safety: _slf and _other must be valid non-null Python objects
+    #[inline]
+    unsafe fn __ne__(
+        self,
+        py: Python<'_>,
+        slf: *mut ffi::PyObject,
+        other: *mut ffi::PyObject,
+    ) -> PyResult<*mut ffi::PyObject> {
+        // By default `__ne__` will try `__eq__` and invert the result
+        let slf = Borrowed::from_ptr(py, slf);
+        let other = Borrowed::from_ptr(py, other);
+        slf.eq(other).map(|is_eq| PyBool::new_bound(py, !is_eq).to_owned().into_ptr())
+    }
+}
+
+slot_fragment_trait! {
+    PyClass__gt__SlotFragment,
+
+    /// # Safety: _slf and _other must be valid non-null Python objects
+    #[inline]
+    unsafe fn __gt__(
+        self,
+        py: Python<'_>,
+        _slf: *mut ffi::PyObject,
+        _other: *mut ffi::PyObject,
+    ) -> PyResult<*mut ffi::PyObject> {
+        Ok(py.NotImplemented().into_ptr())
+    }
+}
+
+slot_fragment_trait! {
+    PyClass__ge__SlotFragment,
+
+    /// # Safety: _slf and _other must be valid non-null Python objects
+    #[inline]
+    unsafe fn __ge__(
+        self,
+        py: Python<'_>,
+        _slf: *mut ffi::PyObject,
+        _other: *mut ffi::PyObject,
+    ) -> PyResult<*mut ffi::PyObject> {
+        Ok(py.NotImplemented().into_ptr())
+    }
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! generate_pyclass_richcompare_slot {
+    ($cls:ty) => {{
+        #[allow(unknown_lints, non_local_definitions)]
+        impl $cls {
+            #[allow(non_snake_case)]
+            unsafe extern "C" fn __pymethod___richcmp____(
+                slf: *mut $crate::ffi::PyObject,
+                other: *mut $crate::ffi::PyObject,
+                op: ::std::os::raw::c_int,
+            ) -> *mut $crate::ffi::PyObject {
+                $crate::impl_::trampoline::richcmpfunc(slf, other, op, |py, slf, other, op| {
+                    use $crate::class::basic::CompareOp;
+                    use $crate::impl_::pyclass::*;
+                    let collector = PyClassImplCollector::<$cls>::new();
+                    match CompareOp::from_raw(op).expect("invalid compareop") {
+                        CompareOp::Lt => collector.__lt__(py, slf, other),
+                        CompareOp::Le => collector.__le__(py, slf, other),
+                        CompareOp::Eq => collector.__eq__(py, slf, other),
+                        CompareOp::Ne => collector.__ne__(py, slf, other),
+                        CompareOp::Gt => collector.__gt__(py, slf, other),
+                        CompareOp::Ge => collector.__ge__(py, slf, other),
+                    }
+                })
+            }
+        }
+        $crate::ffi::PyType_Slot {
+            slot: $crate::ffi::Py_tp_richcompare,
+            pfunc: <$cls>::__pymethod___richcmp____ as $crate::ffi::richcmpfunc as _,
+        }
+    }};
+}
+pub use generate_pyclass_richcompare_slot;
+
+use super::{pycell::PyClassObject, pymethods::BoundRef};
+
+/// Implements a freelist.
+///
+/// Do not implement this trait manually. Instead, use `#[pyclass(freelist = N)]`
+/// on a Rust struct to implement it.
+pub trait PyClassWithFreeList: PyClass {
+    fn get_free_list(py: Python<'_>) -> &mut FreeList<*mut ffi::PyObject>;
+}
+
+/// Implementation of tp_alloc for `freelist` classes.
+///
+/// # Safety
+/// - `subtype` must be a valid pointer to the type object of T or a subclass.
+/// - The GIL must be held.
+pub unsafe extern "C" fn alloc_with_freelist<T: PyClassWithFreeList>(
+    subtype: *mut ffi::PyTypeObject,
+    nitems: ffi::Py_ssize_t,
+) -> *mut ffi::PyObject {
+    let py = Python::assume_gil_acquired();
+
+    #[cfg(not(Py_3_8))]
+    bpo_35810_workaround(py, subtype);
+
+    let self_type = T::type_object_raw(py);
+    // If this type is a variable type or the subtype is not equal to this type, we cannot use the
+    // freelist
+    if nitems == 0 && subtype == self_type {
+        if let Some(obj) = T::get_free_list(py).pop() {
+            ffi::PyObject_Init(obj, subtype);
+            return obj as _;
+        }
+    }
+
+    ffi::PyType_GenericAlloc(subtype, nitems)
+}
+
+/// Implementation of tp_free for `freelist` classes.
+///
+/// # Safety
+/// - `obj` must be a valid pointer to an instance of T (not a subclass).
+/// - The GIL must be held.
+pub unsafe extern "C" fn free_with_freelist<T: PyClassWithFreeList>(obj: *mut c_void) {
+    let obj = obj as *mut ffi::PyObject;
+    debug_assert_eq!(
+        T::type_object_raw(Python::assume_gil_acquired()),
+        ffi::Py_TYPE(obj)
+    );
+    if let Some(obj) = T::get_free_list(Python::assume_gil_acquired()).insert(obj) {
+        let ty = ffi::Py_TYPE(obj);
+
+        // Deduce appropriate inverse of PyType_GenericAlloc
+        let free = if ffi::PyType_IS_GC(ty) != 0 {
+            ffi::PyObject_GC_Del
+        } else {
+            ffi::PyObject_Free
+        };
+        free(obj as *mut c_void);
+
+        #[cfg(Py_3_8)]
+        if ffi::PyType_HasFeature(ty, ffi::Py_TPFLAGS_HEAPTYPE) != 0 {
+            ffi::Py_DECREF(ty as *mut ffi::PyObject);
+        }
+    }
+}
+
+/// Workaround for Python issue 35810; no longer necessary in Python 3.8
+#[inline]
+#[cfg(not(Py_3_8))]
+unsafe fn bpo_35810_workaround(py: Python<'_>, ty: *mut ffi::PyTypeObject) {
+    #[cfg(Py_LIMITED_API)]
+    {
+        // Must check version at runtime for abi3 wheels - they could run against a higher version
+        // than the build config suggests.
+        use crate::sync::GILOnceCell;
+        static IS_PYTHON_3_8: GILOnceCell<bool> = GILOnceCell::new();
+
+        if *IS_PYTHON_3_8.get_or_init(py, || py.version_info() >= (3, 8)) {
+            // No fix needed - the wheel is running on a sufficiently new interpreter.
+            return;
+        }
+    }
+    #[cfg(not(Py_LIMITED_API))]
+    {
+        // suppress unused variable warning
+        let _ = py;
+    }
+
+    ffi::Py_INCREF(ty as *mut ffi::PyObject);
+}
+
+/// Implementation detail. Only to be used through our proc macro code.
+/// Method storage for `#[pyclass]`.
+/// Allows arbitrary `#[pymethod]` blocks to submit their methods,
+/// which are eventually collected by `#[pyclass]`.
+#[cfg(feature = "multiple-pymethods")]
+pub trait PyClassInventory: inventory::Collect {
+    /// Returns the items for a single `#[pymethods] impl` block
+    fn items(&'static self) -> &'static PyClassItems;
+}
+
+// Items from #[pymethods] if not using inventory.
+#[cfg(not(feature = "multiple-pymethods"))]
+pub trait PyMethods<T> {
+    fn py_methods(self) -> &'static PyClassItems;
+}
+
+#[cfg(not(feature = "multiple-pymethods"))]
+impl<T> PyMethods<T> for &'_ PyClassImplCollector<T> {
+    fn py_methods(self) -> &'static PyClassItems {
+        &PyClassItems {
+            methods: &[],
+            slots: &[],
+        }
+    }
+}
+
+// Text signature for __new__
+pub trait PyClassNewTextSignature<T> {
+    fn new_text_signature(self) -> Option<&'static str>;
+}
+
+impl<T> PyClassNewTextSignature<T> for &'_ PyClassImplCollector<T> {
+    #[inline]
+    fn new_text_signature(self) -> Option<&'static str> {
+        None
+    }
+}
+
+// Thread checkers
+
+#[doc(hidden)]
+pub trait PyClassThreadChecker<T>: Sized {
+    fn ensure(&self);
+    fn check(&self) -> bool;
+    fn can_drop(&self, py: Python<'_>) -> bool;
+    fn new() -> Self;
+    private_decl! {}
+}
+
+/// Default thread checker for `#[pyclass]`.
+///
+/// Keeping the T: Send bound here slightly improves the compile
+/// error message to hint to users to figure out what's wrong
+/// when `#[pyclass]` types do not implement `Send`.
+#[doc(hidden)]
+pub struct SendablePyClass<T: Send>(PhantomData<T>);
+
+impl<T: Send> PyClassThreadChecker<T> for SendablePyClass<T> {
+    fn ensure(&self) {}
+    fn check(&self) -> bool {
+        true
+    }
+    fn can_drop(&self, _py: Python<'_>) -> bool {
+        true
+    }
+    #[inline]
+    fn new() -> Self {
+        SendablePyClass(PhantomData)
+    }
+    private_impl! {}
+}
+
+/// Thread checker for `#[pyclass(unsendable)]` types.
+/// Panics when the value is accessed by another thread.
+#[doc(hidden)]
+pub struct ThreadCheckerImpl(thread::ThreadId);
+
+impl ThreadCheckerImpl {
+    fn ensure(&self, type_name: &'static str) {
+        assert_eq!(
+            thread::current().id(),
+            self.0,
+            "{} is unsendable, but sent to another thread",
+            type_name
+        );
+    }
+
+    fn check(&self) -> bool {
+        thread::current().id() == self.0
+    }
+
+    fn can_drop(&self, py: Python<'_>, type_name: &'static str) -> bool {
+        if thread::current().id() != self.0 {
+            PyRuntimeError::new_err(format!(
+                "{} is unsendable, but is being dropped on another thread",
+                type_name
+            ))
+            .write_unraisable_bound(py, None);
+            return false;
+        }
+
+        true
+    }
+}
+
+impl<T> PyClassThreadChecker<T> for ThreadCheckerImpl {
+    fn ensure(&self) {
+        self.ensure(std::any::type_name::<T>());
+    }
+    fn check(&self) -> bool {
+        self.check()
+    }
+    fn can_drop(&self, py: Python<'_>) -> bool {
+        self.can_drop(py, std::any::type_name::<T>())
+    }
+    fn new() -> Self {
+        ThreadCheckerImpl(thread::current().id())
+    }
+    private_impl! {}
+}
+
+/// Trait denoting that this class is suitable to be used as a base type for PyClass.
+
+#[cfg_attr(
+    all(diagnostic_namespace, feature = "abi3"),
+    diagnostic::on_unimplemented(
+        note = "with the `abi3` feature enabled, PyO3 does not support subclassing native types"
+    )
+)]
+pub trait PyClassBaseType: Sized {
+    type LayoutAsBase: PyClassObjectLayout<Self>;
+    type BaseNativeType;
+    type Initializer: PyObjectInit<Self>;
+    type PyClassMutability: PyClassMutability;
+}
+
+/// All mutable PyClasses can be used as a base type.
+///
+/// In the future this will be extended to immutable PyClasses too.
+impl<T: PyClass> PyClassBaseType for T {
+    type LayoutAsBase = crate::impl_::pycell::PyClassObject<T>;
+    type BaseNativeType = T::BaseNativeType;
+    type Initializer = crate::pyclass_init::PyClassInitializer<Self>;
+    type PyClassMutability = T::PyClassMutability;
+}
+
+/// Implementation of tp_dealloc for pyclasses without gc
+pub(crate) unsafe extern "C" fn tp_dealloc<T: PyClass>(obj: *mut ffi::PyObject) {
+    crate::impl_::trampoline::dealloc(obj, PyClassObject::<T>::tp_dealloc)
+}
+
+/// Implementation of tp_dealloc for pyclasses with gc
+pub(crate) unsafe extern "C" fn tp_dealloc_with_gc<T: PyClass>(obj: *mut ffi::PyObject) {
+    #[cfg(not(PyPy))]
+    {
+        ffi::PyObject_GC_UnTrack(obj.cast());
+    }
+    crate::impl_::trampoline::dealloc(obj, PyClassObject::<T>::tp_dealloc)
+}
+
+pub(crate) unsafe extern "C" fn get_sequence_item_from_mapping(
+    obj: *mut ffi::PyObject,
+    index: ffi::Py_ssize_t,
+) -> *mut ffi::PyObject {
+    let index = ffi::PyLong_FromSsize_t(index);
+    if index.is_null() {
+        return std::ptr::null_mut();
+    }
+    let result = ffi::PyObject_GetItem(obj, index);
+    ffi::Py_DECREF(index);
+    result
+}
+
+pub(crate) unsafe extern "C" fn assign_sequence_item_from_mapping(
+    obj: *mut ffi::PyObject,
+    index: ffi::Py_ssize_t,
+    value: *mut ffi::PyObject,
+) -> c_int {
+    let index = ffi::PyLong_FromSsize_t(index);
+    if index.is_null() {
+        return -1;
+    }
+    let result = if value.is_null() {
+        ffi::PyObject_DelItem(obj, index)
+    } else {
+        ffi::PyObject_SetItem(obj, index, value)
+    };
+    ffi::Py_DECREF(index);
+    result
+}
+
+/// Helper trait to locate field within a `#[pyclass]` for a `#[pyo3(get)]`.
+///
+/// Below MSRV 1.77 we can't use `std::mem::offset_of!`, and the replacement in
+/// `memoffset::offset_of` doesn't work in const contexts for types containing `UnsafeCell`.
+///
+/// # Safety
+///
+/// The trait is unsafe to implement because producing an incorrect offset will lead to UB.
+pub unsafe trait OffsetCalculator<T: PyClass, U> {
+    /// Offset to the field within a `PyClassObject<T>`, in bytes.
+    fn offset() -> usize;
+}
+
+// Used in generated implementations of OffsetCalculator
+pub fn class_offset<T: PyClass>() -> usize {
+    offset_of!(PyClassObject<T>, contents)
+}
+
+// Used in generated implementations of OffsetCalculator
+pub use memoffset::offset_of;
+
+/// Type which uses specialization on impl blocks to determine how to read a field from a Rust pyclass
+/// as part of a `#[pyo3(get)]` annotation.
+pub struct PyClassGetterGenerator<
+    // structural information about the field: class type, field type, where the field is within the
+    // class struct
+    ClassT: PyClass,
+    FieldT,
+    Offset: OffsetCalculator<ClassT, FieldT>, // on Rust 1.77+ this could be a const OFFSET: usize
+    // additional metadata about the field which is used to switch between different implementations
+    // at compile time
+    const IS_PY_T: bool,
+    const IMPLEMENTS_TOPYOBJECT: bool,
+>(PhantomData<(ClassT, FieldT, Offset)>);
+
+impl<
+        ClassT: PyClass,
+        FieldT,
+        Offset: OffsetCalculator<ClassT, FieldT>,
+        const IS_PY_T: bool,
+        const IMPLEMENTS_TOPYOBJECT: bool,
+    > PyClassGetterGenerator<ClassT, FieldT, Offset, IS_PY_T, IMPLEMENTS_TOPYOBJECT>
+{
+    /// Safety: constructing this type requires that there exists a value of type FieldT
+    /// at the calculated offset within the type ClassT.
+    pub const unsafe fn new() -> Self {
+        Self(PhantomData)
+    }
+}
+
+impl<
+        ClassT: PyClass,
+        U,
+        Offset: OffsetCalculator<ClassT, Py<U>>,
+        const IMPLEMENTS_TOPYOBJECT: bool,
+    > PyClassGetterGenerator<ClassT, Py<U>, Offset, true, IMPLEMENTS_TOPYOBJECT>
+{
+    /// `Py<T>` fields have a potential optimization to use Python's "struct members" to read
+    /// the field directly from the struct, rather than using a getter function.
+    ///
+    /// This is the most efficient operation the Python interpreter could possibly do to
+    /// read a field, but it's only possible for us to allow this for frozen classes.
+    pub fn generate(&self, name: &'static CStr, doc: &'static CStr) -> PyMethodDefType {
+        use crate::pyclass::boolean_struct::private::Boolean;
+        if ClassT::Frozen::VALUE {
+            PyMethodDefType::StructMember(ffi::PyMemberDef {
+                name: name.as_ptr(),
+                type_code: ffi::Py_T_OBJECT_EX,
+                offset: Offset::offset() as ffi::Py_ssize_t,
+                flags: ffi::Py_READONLY,
+                doc: doc.as_ptr(),
+            })
+        } else {
+            PyMethodDefType::Getter(crate::PyGetterDef {
+                name,
+                meth: pyo3_get_value_topyobject::<ClassT, Py<U>, Offset>,
+                doc,
+            })
+        }
+    }
+}
+
+/// Field is not `Py<T>`; try to use `ToPyObject` to avoid potentially expensive clones of containers like `Vec`
+impl<ClassT: PyClass, FieldT: ToPyObject, Offset: OffsetCalculator<ClassT, FieldT>>
+    PyClassGetterGenerator<ClassT, FieldT, Offset, false, true>
+{
+    pub const fn generate(&self, name: &'static CStr, doc: &'static CStr) -> PyMethodDefType {
+        PyMethodDefType::Getter(crate::PyGetterDef {
+            name,
+            meth: pyo3_get_value_topyobject::<ClassT, FieldT, Offset>,
+            doc,
+        })
+    }
+}
+
+#[cfg_attr(
+    diagnostic_namespace,
+    diagnostic::on_unimplemented(
+        message = "`{Self}` cannot be converted to a Python object",
+        label = "required by `#[pyo3(get)]` to create a readable property from a field of type `{Self}`",
+        note = "implement `ToPyObject` or `IntoPy<PyObject> + Clone` for `{Self}` to define the conversion",
+    )
+)]
+pub trait PyO3GetField: IntoPy<Py<PyAny>> + Clone {}
+impl<T: IntoPy<Py<PyAny>> + Clone> PyO3GetField for T {}
+
+/// Base case attempts to use IntoPy + Clone, which was the only behaviour before PyO3 0.22.
+impl<ClassT: PyClass, FieldT, Offset: OffsetCalculator<ClassT, FieldT>>
+    PyClassGetterGenerator<ClassT, FieldT, Offset, false, false>
+{
+    pub const fn generate(&self, name: &'static CStr, doc: &'static CStr) -> PyMethodDefType
+    // The bound goes here rather than on the block so that this impl is always available
+    // if no specialization is used instead
+    where
+        FieldT: PyO3GetField,
+    {
+        PyMethodDefType::Getter(crate::PyGetterDef {
+            name,
+            meth: pyo3_get_value::<ClassT, FieldT, Offset>,
+            doc,
+        })
+    }
+}
+
+/// Trait used to combine with zero-sized types to calculate at compile time
+/// some property of a type.
+///
+/// The trick uses the fact that an associated constant has higher priority
+/// than a trait constant, so we can use the trait to define the false case.
+///
+/// The true case is defined in the zero-sized type's impl block, which is
+/// gated on some property like trait bound or only being implemented
+/// for fixed concrete types.
+pub trait Probe {
+    const VALUE: bool = false;
+}
+
+macro_rules! probe {
+    ($name:ident) => {
+        pub struct $name<T>(PhantomData<T>);
+        impl<T> Probe for $name<T> {}
+    };
+}
+
+probe!(IsPyT);
+
+impl<T> IsPyT<Py<T>> {
+    pub const VALUE: bool = true;
+}
+
+probe!(IsToPyObject);
+
+impl<T: ToPyObject> IsToPyObject<T> {
+    pub const VALUE: bool = true;
+}
+
+fn pyo3_get_value_topyobject<
+    ClassT: PyClass,
+    FieldT: ToPyObject,
+    Offset: OffsetCalculator<ClassT, FieldT>,
+>(
+    py: Python<'_>,
+    obj: *mut ffi::PyObject,
+) -> PyResult<*mut ffi::PyObject> {
+    // Check for mutable aliasing
+    let _holder = unsafe {
+        BoundRef::ref_from_ptr(py, &obj)
+            .downcast_unchecked::<ClassT>()
+            .try_borrow()?
+    };
+
+    let value = unsafe { obj.cast::<u8>().add(Offset::offset()).cast::<FieldT>() };
+
+    // SAFETY: Offset is known to describe the location of the value, and
+    // _holder is preventing mutable aliasing
+    Ok((unsafe { &*value }).to_object(py).into_ptr())
+}
+
+fn pyo3_get_value<
+    ClassT: PyClass,
+    FieldT: IntoPy<Py<PyAny>> + Clone,
+    Offset: OffsetCalculator<ClassT, FieldT>,
+>(
+    py: Python<'_>,
+    obj: *mut ffi::PyObject,
+) -> PyResult<*mut ffi::PyObject> {
+    // Check for mutable aliasing
+    let _holder = unsafe {
+        BoundRef::ref_from_ptr(py, &obj)
+            .downcast_unchecked::<ClassT>()
+            .try_borrow()?
+    };
+
+    let value = unsafe { obj.cast::<u8>().add(Offset::offset()).cast::<FieldT>() };
+
+    // SAFETY: Offset is known to describe the location of the value, and
+    // _holder is preventing mutable aliasing
+    Ok((unsafe { &*value }).clone().into_py(py).into_ptr())
+}
+
+#[cfg(test)]
+#[cfg(feature = "macros")]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn get_py_for_frozen_class() {
+        #[crate::pyclass(crate = "crate", frozen)]
+        struct FrozenClass {
+            #[pyo3(get)]
+            value: Py<PyAny>,
+        }
+
+        let mut methods = Vec::new();
+        let mut slots = Vec::new();
+
+        for items in FrozenClass::items_iter() {
+            methods.extend(items.methods.iter().map(|m| match m {
+                MaybeRuntimePyMethodDef::Static(m) => m.clone(),
+                MaybeRuntimePyMethodDef::Runtime(r) => r(),
+            }));
+            slots.extend_from_slice(items.slots);
+        }
+
+        assert_eq!(methods.len(), 1);
+        assert!(slots.is_empty());
+
+        match methods.first() {
+            Some(PyMethodDefType::StructMember(member)) => {
+                assert_eq!(unsafe { CStr::from_ptr(member.name) }, ffi::c_str!("value"));
+                assert_eq!(member.type_code, ffi::Py_T_OBJECT_EX);
+                assert_eq!(
+                    member.offset,
+                    (memoffset::offset_of!(PyClassObject<FrozenClass>, contents)
+                        + memoffset::offset_of!(FrozenClass, value))
+                        as ffi::Py_ssize_t
+                );
+                assert_eq!(member.flags, ffi::Py_READONLY);
+            }
+            _ => panic!("Expected a StructMember"),
+        }
+    }
+
+    #[test]
+    fn get_py_for_non_frozen_class() {
+        #[crate::pyclass(crate = "crate")]
+        struct FrozenClass {
+            #[pyo3(get)]
+            value: Py<PyAny>,
+        }
+
+        let mut methods = Vec::new();
+        let mut slots = Vec::new();
+
+        for items in FrozenClass::items_iter() {
+            methods.extend(items.methods.iter().map(|m| match m {
+                MaybeRuntimePyMethodDef::Static(m) => m.clone(),
+                MaybeRuntimePyMethodDef::Runtime(r) => r(),
+            }));
+            slots.extend_from_slice(items.slots);
+        }
+
+        assert_eq!(methods.len(), 1);
+        assert!(slots.is_empty());
+
+        match methods.first() {
+            Some(PyMethodDefType::Getter(getter)) => {
+                assert_eq!(getter.name, ffi::c_str!("value"));
+                assert_eq!(getter.doc, ffi::c_str!(""));
+                // tests for the function pointer are in test_getter_setter.py
+            }
+            _ => panic!("Expected a StructMember"),
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/impl_/pyfunction.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/pyfunction.rs
--- 43.0.0-1/rust-vendor/pyo3/src/impl_/pyfunction.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/pyfunction.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,80 @@
+use crate::{
+    types::{PyCFunction, PyModule},
+    Borrowed, Bound, PyResult, Python,
+};
+
+pub use crate::impl_::pymethods::PyMethodDef;
+
+/// Trait to enable the use of `wrap_pyfunction` with both `Python` and `PyModule`,
+/// and also to infer the return type of either `&'py PyCFunction` or `Bound<'py, PyCFunction>`.
+pub trait WrapPyFunctionArg<'py, T> {
+    fn wrap_pyfunction(self, method_def: &PyMethodDef) -> PyResult<T>;
+}
+
+impl<'py> WrapPyFunctionArg<'py, Bound<'py, PyCFunction>> for Bound<'py, PyModule> {
+    fn wrap_pyfunction(self, method_def: &PyMethodDef) -> PyResult<Bound<'py, PyCFunction>> {
+        PyCFunction::internal_new(self.py(), method_def, Some(&self))
+    }
+}
+
+impl<'py> WrapPyFunctionArg<'py, Bound<'py, PyCFunction>> for &'_ Bound<'py, PyModule> {
+    fn wrap_pyfunction(self, method_def: &PyMethodDef) -> PyResult<Bound<'py, PyCFunction>> {
+        PyCFunction::internal_new(self.py(), method_def, Some(self))
+    }
+}
+
+impl<'py> WrapPyFunctionArg<'py, Bound<'py, PyCFunction>> for Borrowed<'_, 'py, PyModule> {
+    fn wrap_pyfunction(self, method_def: &PyMethodDef) -> PyResult<Bound<'py, PyCFunction>> {
+        PyCFunction::internal_new(self.py(), method_def, Some(&self))
+    }
+}
+
+impl<'py> WrapPyFunctionArg<'py, Bound<'py, PyCFunction>> for &'_ Borrowed<'_, 'py, PyModule> {
+    fn wrap_pyfunction(self, method_def: &PyMethodDef) -> PyResult<Bound<'py, PyCFunction>> {
+        PyCFunction::internal_new(self.py(), method_def, Some(self))
+    }
+}
+
+// For Python<'py>, only the GIL Ref form exists to avoid causing type inference to kick in.
+// The `wrap_pyfunction_bound!` macro is needed for the Bound form.
+#[cfg(feature = "gil-refs")]
+impl<'py> WrapPyFunctionArg<'py, &'py PyCFunction> for Python<'py> {
+    fn wrap_pyfunction(self, method_def: &PyMethodDef) -> PyResult<&'py PyCFunction> {
+        PyCFunction::internal_new(self, method_def, None).map(Bound::into_gil_ref)
+    }
+}
+
+#[cfg(not(feature = "gil-refs"))]
+impl<'py> WrapPyFunctionArg<'py, Bound<'py, PyCFunction>> for Python<'py> {
+    fn wrap_pyfunction(self, method_def: &PyMethodDef) -> PyResult<Bound<'py, PyCFunction>> {
+        PyCFunction::internal_new(self, method_def, None)
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'py> WrapPyFunctionArg<'py, &'py PyCFunction> for &'py PyModule {
+    fn wrap_pyfunction(self, method_def: &PyMethodDef) -> PyResult<&'py PyCFunction> {
+        use crate::PyNativeType;
+        PyCFunction::internal_new(self.py(), method_def, Some(&self.as_borrowed()))
+            .map(Bound::into_gil_ref)
+    }
+}
+
+/// Helper for `wrap_pyfunction_bound!` to guarantee return type of `Bound<'py, PyCFunction>`.
+pub struct OnlyBound<T>(pub T);
+
+impl<'py, T> WrapPyFunctionArg<'py, Bound<'py, PyCFunction>> for OnlyBound<T>
+where
+    T: WrapPyFunctionArg<'py, Bound<'py, PyCFunction>>,
+{
+    fn wrap_pyfunction(self, method_def: &PyMethodDef) -> PyResult<Bound<'py, PyCFunction>> {
+        WrapPyFunctionArg::wrap_pyfunction(self.0, method_def)
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'py> WrapPyFunctionArg<'py, Bound<'py, PyCFunction>> for OnlyBound<Python<'py>> {
+    fn wrap_pyfunction(self, method_def: &PyMethodDef) -> PyResult<Bound<'py, PyCFunction>> {
+        PyCFunction::internal_new(self.0, method_def, None)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/impl_/pymethods.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/pymethods.rs
--- 43.0.0-1/rust-vendor/pyo3/src/impl_/pymethods.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/pymethods.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,550 @@
+use crate::callback::IntoPyCallbackOutput;
+use crate::exceptions::PyStopAsyncIteration;
+use crate::gil::LockGIL;
+use crate::impl_::panic::PanicTrap;
+use crate::pycell::{PyBorrowError, PyBorrowMutError};
+use crate::pyclass::boolean_struct::False;
+use crate::types::any::PyAnyMethods;
+#[cfg(feature = "gil-refs")]
+use crate::types::{PyModule, PyType};
+use crate::{
+    ffi, Borrowed, Bound, DowncastError, Py, PyAny, PyClass, PyClassInitializer, PyErr, PyObject,
+    PyRef, PyRefMut, PyResult, PyTraverseError, PyTypeCheck, PyVisit, Python,
+};
+use std::ffi::CStr;
+use std::fmt;
+use std::os::raw::{c_int, c_void};
+use std::panic::{catch_unwind, AssertUnwindSafe};
+use std::ptr::null_mut;
+
+/// Python 3.8 and up - __ipow__ has modulo argument correctly populated.
+#[cfg(Py_3_8)]
+#[repr(transparent)]
+pub struct IPowModulo(*mut ffi::PyObject);
+
+/// Python 3.7 and older - __ipow__ does not have modulo argument correctly populated.
+#[cfg(not(Py_3_8))]
+#[repr(transparent)]
+pub struct IPowModulo(#[allow(dead_code)] std::mem::MaybeUninit<*mut ffi::PyObject>);
+
+/// Helper to use as pymethod ffi definition
+#[allow(non_camel_case_types)]
+pub type ipowfunc = unsafe extern "C" fn(
+    arg1: *mut ffi::PyObject,
+    arg2: *mut ffi::PyObject,
+    arg3: IPowModulo,
+) -> *mut ffi::PyObject;
+
+impl IPowModulo {
+    #[cfg(Py_3_8)]
+    #[inline]
+    pub fn as_ptr(self) -> *mut ffi::PyObject {
+        self.0
+    }
+
+    #[cfg(not(Py_3_8))]
+    #[inline]
+    pub fn as_ptr(self) -> *mut ffi::PyObject {
+        // Safety: returning a borrowed pointer to Python `None` singleton
+        unsafe { ffi::Py_None() }
+    }
+}
+
+/// `PyMethodDefType` represents different types of Python callable objects.
+/// It is used by the `#[pymethods]` attribute.
+#[cfg_attr(test, derive(Clone))]
+pub enum PyMethodDefType {
+    /// Represents class method
+    Class(PyMethodDef),
+    /// Represents static method
+    Static(PyMethodDef),
+    /// Represents normal method
+    Method(PyMethodDef),
+    /// Represents class attribute, used by `#[attribute]`
+    ClassAttribute(PyClassAttributeDef),
+    /// Represents getter descriptor, used by `#[getter]`
+    Getter(PyGetterDef),
+    /// Represents setter descriptor, used by `#[setter]`
+    Setter(PySetterDef),
+    /// Represents a struct member
+    StructMember(ffi::PyMemberDef),
+}
+
+#[derive(Copy, Clone, Debug)]
+pub enum PyMethodType {
+    PyCFunction(ffi::PyCFunction),
+    PyCFunctionWithKeywords(ffi::PyCFunctionWithKeywords),
+    #[cfg(not(Py_LIMITED_API))]
+    PyCFunctionFastWithKeywords(ffi::_PyCFunctionFastWithKeywords),
+}
+
+pub type PyClassAttributeFactory = for<'p> fn(Python<'p>) -> PyResult<PyObject>;
+
+// TODO: it would be nice to use CStr in these types, but then the constructors can't be const fn
+// until `CStr::from_bytes_with_nul_unchecked` is const fn.
+
+#[derive(Clone, Debug)]
+pub struct PyMethodDef {
+    pub(crate) ml_name: &'static CStr,
+    pub(crate) ml_meth: PyMethodType,
+    pub(crate) ml_flags: c_int,
+    pub(crate) ml_doc: &'static CStr,
+}
+
+#[derive(Copy, Clone)]
+pub struct PyClassAttributeDef {
+    pub(crate) name: &'static CStr,
+    pub(crate) meth: PyClassAttributeFactory,
+}
+
+#[derive(Clone)]
+pub struct PyGetterDef {
+    pub(crate) name: &'static CStr,
+    pub(crate) meth: Getter,
+    pub(crate) doc: &'static CStr,
+}
+
+#[derive(Clone)]
+pub struct PySetterDef {
+    pub(crate) name: &'static CStr,
+    pub(crate) meth: Setter,
+    pub(crate) doc: &'static CStr,
+}
+
+unsafe impl Sync for PyMethodDef {}
+
+unsafe impl Sync for PyGetterDef {}
+
+unsafe impl Sync for PySetterDef {}
+
+impl PyMethodDef {
+    /// Define a function with no `*args` and `**kwargs`.
+    pub const fn noargs(
+        ml_name: &'static CStr,
+        cfunction: ffi::PyCFunction,
+        ml_doc: &'static CStr,
+    ) -> Self {
+        Self {
+            ml_name,
+            ml_meth: PyMethodType::PyCFunction(cfunction),
+            ml_flags: ffi::METH_NOARGS,
+            ml_doc,
+        }
+    }
+
+    /// Define a function that can take `*args` and `**kwargs`.
+    pub const fn cfunction_with_keywords(
+        ml_name: &'static CStr,
+        cfunction: ffi::PyCFunctionWithKeywords,
+        ml_doc: &'static CStr,
+    ) -> Self {
+        Self {
+            ml_name,
+            ml_meth: PyMethodType::PyCFunctionWithKeywords(cfunction),
+            ml_flags: ffi::METH_VARARGS | ffi::METH_KEYWORDS,
+            ml_doc,
+        }
+    }
+
+    /// Define a function that can take `*args` and `**kwargs`.
+    #[cfg(not(Py_LIMITED_API))]
+    pub const fn fastcall_cfunction_with_keywords(
+        ml_name: &'static CStr,
+        cfunction: ffi::_PyCFunctionFastWithKeywords,
+        ml_doc: &'static CStr,
+    ) -> Self {
+        Self {
+            ml_name,
+            ml_meth: PyMethodType::PyCFunctionFastWithKeywords(cfunction),
+            ml_flags: ffi::METH_FASTCALL | ffi::METH_KEYWORDS,
+            ml_doc,
+        }
+    }
+
+    pub const fn flags(mut self, flags: c_int) -> Self {
+        self.ml_flags |= flags;
+        self
+    }
+
+    /// Convert `PyMethodDef` to Python method definition struct `ffi::PyMethodDef`
+    pub(crate) fn as_method_def(&self) -> ffi::PyMethodDef {
+        let meth = match self.ml_meth {
+            PyMethodType::PyCFunction(meth) => ffi::PyMethodDefPointer { PyCFunction: meth },
+            PyMethodType::PyCFunctionWithKeywords(meth) => ffi::PyMethodDefPointer {
+                PyCFunctionWithKeywords: meth,
+            },
+            #[cfg(not(Py_LIMITED_API))]
+            PyMethodType::PyCFunctionFastWithKeywords(meth) => ffi::PyMethodDefPointer {
+                _PyCFunctionFastWithKeywords: meth,
+            },
+        };
+
+        ffi::PyMethodDef {
+            ml_name: self.ml_name.as_ptr(),
+            ml_meth: meth,
+            ml_flags: self.ml_flags,
+            ml_doc: self.ml_doc.as_ptr(),
+        }
+    }
+}
+
+impl PyClassAttributeDef {
+    /// Define a class attribute.
+    pub const fn new(name: &'static CStr, meth: PyClassAttributeFactory) -> Self {
+        Self { name, meth }
+    }
+}
+
+// Manual implementation because `Python<'_>` does not implement `Debug` and
+// trait bounds on `fn` compiler-generated derive impls are too restrictive.
+impl fmt::Debug for PyClassAttributeDef {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.debug_struct("PyClassAttributeDef")
+            .field("name", &self.name)
+            .finish()
+    }
+}
+
+/// Class getter / setters
+pub(crate) type Getter =
+    for<'py> unsafe fn(Python<'py>, *mut ffi::PyObject) -> PyResult<*mut ffi::PyObject>;
+pub(crate) type Setter =
+    for<'py> unsafe fn(Python<'py>, *mut ffi::PyObject, *mut ffi::PyObject) -> PyResult<c_int>;
+
+impl PyGetterDef {
+    /// Define a getter.
+    pub const fn new(name: &'static CStr, getter: Getter, doc: &'static CStr) -> Self {
+        Self {
+            name,
+            meth: getter,
+            doc,
+        }
+    }
+}
+
+impl PySetterDef {
+    /// Define a setter.
+    pub const fn new(name: &'static CStr, setter: Setter, doc: &'static CStr) -> Self {
+        Self {
+            name,
+            meth: setter,
+            doc,
+        }
+    }
+}
+
+/// Calls an implementation of __traverse__ for tp_traverse
+#[doc(hidden)]
+pub unsafe fn _call_traverse<T>(
+    slf: *mut ffi::PyObject,
+    impl_: fn(&T, PyVisit<'_>) -> Result<(), PyTraverseError>,
+    visit: ffi::visitproc,
+    arg: *mut c_void,
+) -> c_int
+where
+    T: PyClass,
+{
+    // It is important the implementation of `__traverse__` cannot safely access the GIL,
+    // c.f. https://github.com/PyO3/pyo3/issues/3165, and hence we do not expose our GIL
+    // token to the user code and lock safe methods for acquiring the GIL.
+    // (This includes enforcing the `&self` method receiver as e.g. `PyRef<Self>` could
+    // reconstruct a GIL token via `PyRef::py`.)
+    // Since we do not create a `GILPool` at all, it is important that our usage of the GIL
+    // token does not produce any owned objects thereby calling into `register_owned`.
+    let trap = PanicTrap::new("uncaught panic inside __traverse__ handler");
+
+    let py = Python::assume_gil_acquired();
+    let slf = Borrowed::from_ptr_unchecked(py, slf).downcast_unchecked::<T>();
+    let borrow = PyRef::try_borrow_threadsafe(&slf);
+    let visit = PyVisit::from_raw(visit, arg, py);
+
+    let retval = if let Ok(borrow) = borrow {
+        let _lock = LockGIL::during_traverse();
+
+        match catch_unwind(AssertUnwindSafe(move || impl_(&*borrow, visit))) {
+            Ok(res) => match res {
+                Ok(()) => 0,
+                Err(PyTraverseError(value)) => value,
+            },
+            Err(_err) => -1,
+        }
+    } else {
+        0
+    };
+    trap.disarm();
+    retval
+}
+
+// Autoref-based specialization for handling `__next__` returning `Option`
+
+pub struct IterBaseTag;
+
+impl IterBaseTag {
+    #[inline]
+    pub fn convert<Value, Target>(self, py: Python<'_>, value: Value) -> PyResult<Target>
+    where
+        Value: IntoPyCallbackOutput<Target>,
+    {
+        value.convert(py)
+    }
+}
+
+pub trait IterBaseKind {
+    #[inline]
+    fn iter_tag(&self) -> IterBaseTag {
+        IterBaseTag
+    }
+}
+
+impl<Value> IterBaseKind for &Value {}
+
+pub struct IterOptionTag;
+
+impl IterOptionTag {
+    #[inline]
+    pub fn convert<Value>(
+        self,
+        py: Python<'_>,
+        value: Option<Value>,
+    ) -> PyResult<*mut ffi::PyObject>
+    where
+        Value: IntoPyCallbackOutput<*mut ffi::PyObject>,
+    {
+        match value {
+            Some(value) => value.convert(py),
+            None => Ok(null_mut()),
+        }
+    }
+}
+
+pub trait IterOptionKind {
+    #[inline]
+    fn iter_tag(&self) -> IterOptionTag {
+        IterOptionTag
+    }
+}
+
+impl<Value> IterOptionKind for Option<Value> {}
+
+pub struct IterResultOptionTag;
+
+impl IterResultOptionTag {
+    #[inline]
+    pub fn convert<Value, Error>(
+        self,
+        py: Python<'_>,
+        value: Result<Option<Value>, Error>,
+    ) -> PyResult<*mut ffi::PyObject>
+    where
+        Value: IntoPyCallbackOutput<*mut ffi::PyObject>,
+        Error: Into<PyErr>,
+    {
+        match value {
+            Ok(Some(value)) => value.convert(py),
+            Ok(None) => Ok(null_mut()),
+            Err(err) => Err(err.into()),
+        }
+    }
+}
+
+pub trait IterResultOptionKind {
+    #[inline]
+    fn iter_tag(&self) -> IterResultOptionTag {
+        IterResultOptionTag
+    }
+}
+
+impl<Value, Error> IterResultOptionKind for Result<Option<Value>, Error> {}
+
+// Autoref-based specialization for handling `__anext__` returning `Option`
+
+pub struct AsyncIterBaseTag;
+
+impl AsyncIterBaseTag {
+    #[inline]
+    pub fn convert<Value, Target>(self, py: Python<'_>, value: Value) -> PyResult<Target>
+    where
+        Value: IntoPyCallbackOutput<Target>,
+    {
+        value.convert(py)
+    }
+}
+
+pub trait AsyncIterBaseKind {
+    #[inline]
+    fn async_iter_tag(&self) -> AsyncIterBaseTag {
+        AsyncIterBaseTag
+    }
+}
+
+impl<Value> AsyncIterBaseKind for &Value {}
+
+pub struct AsyncIterOptionTag;
+
+impl AsyncIterOptionTag {
+    #[inline]
+    pub fn convert<Value>(
+        self,
+        py: Python<'_>,
+        value: Option<Value>,
+    ) -> PyResult<*mut ffi::PyObject>
+    where
+        Value: IntoPyCallbackOutput<*mut ffi::PyObject>,
+    {
+        match value {
+            Some(value) => value.convert(py),
+            None => Err(PyStopAsyncIteration::new_err(())),
+        }
+    }
+}
+
+pub trait AsyncIterOptionKind {
+    #[inline]
+    fn async_iter_tag(&self) -> AsyncIterOptionTag {
+        AsyncIterOptionTag
+    }
+}
+
+impl<Value> AsyncIterOptionKind for Option<Value> {}
+
+pub struct AsyncIterResultOptionTag;
+
+impl AsyncIterResultOptionTag {
+    #[inline]
+    pub fn convert<Value, Error>(
+        self,
+        py: Python<'_>,
+        value: Result<Option<Value>, Error>,
+    ) -> PyResult<*mut ffi::PyObject>
+    where
+        Value: IntoPyCallbackOutput<*mut ffi::PyObject>,
+        Error: Into<PyErr>,
+    {
+        match value {
+            Ok(Some(value)) => value.convert(py),
+            Ok(None) => Err(PyStopAsyncIteration::new_err(())),
+            Err(err) => Err(err.into()),
+        }
+    }
+}
+
+pub trait AsyncIterResultOptionKind {
+    #[inline]
+    fn async_iter_tag(&self) -> AsyncIterResultOptionTag {
+        AsyncIterResultOptionTag
+    }
+}
+
+impl<Value, Error> AsyncIterResultOptionKind for Result<Option<Value>, Error> {}
+
+/// Used in `#[classmethod]` to pass the class object to the method
+/// and also in `#[pyfunction(pass_module)]`.
+///
+/// This is a wrapper to avoid implementing `From<Bound>` for GIL Refs.
+///
+/// Once the GIL Ref API is fully removed, it should be possible to simplify
+/// this to just `&'a Bound<'py, T>` and `From` implementations.
+pub struct BoundRef<'a, 'py, T>(pub &'a Bound<'py, T>);
+
+impl<'a, 'py> BoundRef<'a, 'py, PyAny> {
+    pub unsafe fn ref_from_ptr(py: Python<'py>, ptr: &'a *mut ffi::PyObject) -> Self {
+        BoundRef(Bound::ref_from_ptr(py, ptr))
+    }
+
+    pub unsafe fn ref_from_ptr_or_opt(
+        py: Python<'py>,
+        ptr: &'a *mut ffi::PyObject,
+    ) -> Option<Self> {
+        Bound::ref_from_ptr_or_opt(py, ptr).as_ref().map(BoundRef)
+    }
+
+    pub fn downcast<T: PyTypeCheck>(self) -> Result<BoundRef<'a, 'py, T>, DowncastError<'a, 'py>> {
+        self.0.downcast::<T>().map(BoundRef)
+    }
+
+    pub unsafe fn downcast_unchecked<T>(self) -> BoundRef<'a, 'py, T> {
+        BoundRef(self.0.downcast_unchecked::<T>())
+    }
+}
+
+// GIL Ref implementations for &'a T ran into trouble with orphan rules,
+// so explicit implementations are used instead for the two relevant types.
+#[cfg(feature = "gil-refs")]
+impl<'a> From<BoundRef<'a, 'a, PyType>> for &'a PyType {
+    #[inline]
+    fn from(bound: BoundRef<'a, 'a, PyType>) -> Self {
+        bound.0.as_gil_ref()
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'a> From<BoundRef<'a, 'a, PyModule>> for &'a PyModule {
+    #[inline]
+    fn from(bound: BoundRef<'a, 'a, PyModule>) -> Self {
+        bound.0.as_gil_ref()
+    }
+}
+
+#[allow(deprecated)]
+#[cfg(feature = "gil-refs")]
+impl<'a, 'py, T: PyClass> From<BoundRef<'a, 'py, T>> for &'a crate::PyCell<T> {
+    #[inline]
+    fn from(bound: BoundRef<'a, 'py, T>) -> Self {
+        bound.0.as_gil_ref()
+    }
+}
+
+impl<'a, 'py, T: PyClass> TryFrom<BoundRef<'a, 'py, T>> for PyRef<'py, T> {
+    type Error = PyBorrowError;
+    #[inline]
+    fn try_from(value: BoundRef<'a, 'py, T>) -> Result<Self, Self::Error> {
+        value.0.try_borrow()
+    }
+}
+
+impl<'a, 'py, T: PyClass<Frozen = False>> TryFrom<BoundRef<'a, 'py, T>> for PyRefMut<'py, T> {
+    type Error = PyBorrowMutError;
+    #[inline]
+    fn try_from(value: BoundRef<'a, 'py, T>) -> Result<Self, Self::Error> {
+        value.0.try_borrow_mut()
+    }
+}
+
+impl<'a, 'py, T> From<BoundRef<'a, 'py, T>> for Bound<'py, T> {
+    #[inline]
+    fn from(bound: BoundRef<'a, 'py, T>) -> Self {
+        bound.0.clone()
+    }
+}
+
+impl<'a, 'py, T> From<BoundRef<'a, 'py, T>> for &'a Bound<'py, T> {
+    #[inline]
+    fn from(bound: BoundRef<'a, 'py, T>) -> Self {
+        bound.0
+    }
+}
+
+impl<T> From<BoundRef<'_, '_, T>> for Py<T> {
+    #[inline]
+    fn from(bound: BoundRef<'_, '_, T>) -> Self {
+        bound.0.clone().unbind()
+    }
+}
+
+impl<'py, T> std::ops::Deref for BoundRef<'_, 'py, T> {
+    type Target = Bound<'py, T>;
+    #[inline]
+    fn deref(&self) -> &Self::Target {
+        self.0
+    }
+}
+
+pub unsafe fn tp_new_impl<T: PyClass>(
+    py: Python<'_>,
+    initializer: PyClassInitializer<T>,
+    target_type: *mut ffi::PyTypeObject,
+) -> PyResult<*mut ffi::PyObject> {
+    initializer
+        .create_class_object_of_type(py, target_type)
+        .map(Bound::into_ptr)
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/impl_/pymodule.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/pymodule.rs
--- 43.0.0-1/rust-vendor/pyo3/src/impl_/pymodule.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/pymodule.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,294 @@
+//! Implementation details of `#[pymodule]` which need to be accessible from proc-macro generated code.
+
+use std::{cell::UnsafeCell, ffi::CStr, marker::PhantomData};
+
+#[cfg(all(
+    not(any(PyPy, GraalPy)),
+    Py_3_9,
+    not(all(windows, Py_LIMITED_API, not(Py_3_10))),
+    not(target_has_atomic = "64"),
+))]
+use portable_atomic::{AtomicI64, Ordering};
+#[cfg(all(
+    not(any(PyPy, GraalPy)),
+    Py_3_9,
+    not(all(windows, Py_LIMITED_API, not(Py_3_10))),
+    target_has_atomic = "64",
+))]
+use std::sync::atomic::{AtomicI64, Ordering};
+
+#[cfg(not(any(PyPy, GraalPy)))]
+use crate::exceptions::PyImportError;
+use crate::{
+    ffi,
+    sync::GILOnceCell,
+    types::{PyCFunction, PyModule, PyModuleMethods},
+    Bound, Py, PyClass, PyMethodDef, PyResult, PyTypeInfo, Python,
+};
+
+/// `Sync` wrapper of `ffi::PyModuleDef`.
+pub struct ModuleDef {
+    // wrapped in UnsafeCell so that Rust compiler treats this as interior mutability
+    ffi_def: UnsafeCell<ffi::PyModuleDef>,
+    initializer: ModuleInitializer,
+    /// Interpreter ID where module was initialized (not applicable on PyPy).
+    #[cfg(all(
+        not(any(PyPy, GraalPy)),
+        Py_3_9,
+        not(all(windows, Py_LIMITED_API, not(Py_3_10)))
+    ))]
+    interpreter: AtomicI64,
+    /// Initialized module object, cached to avoid reinitialization.
+    module: GILOnceCell<Py<PyModule>>,
+}
+
+/// Wrapper to enable initializer to be used in const fns.
+pub struct ModuleInitializer(pub for<'py> fn(&Bound<'py, PyModule>) -> PyResult<()>);
+
+unsafe impl Sync for ModuleDef {}
+
+impl ModuleDef {
+    /// Make new module definition with given module name.
+    pub const unsafe fn new(
+        name: &'static CStr,
+        doc: &'static CStr,
+        initializer: ModuleInitializer,
+    ) -> Self {
+        const INIT: ffi::PyModuleDef = ffi::PyModuleDef {
+            m_base: ffi::PyModuleDef_HEAD_INIT,
+            m_name: std::ptr::null(),
+            m_doc: std::ptr::null(),
+            m_size: 0,
+            m_methods: std::ptr::null_mut(),
+            m_slots: std::ptr::null_mut(),
+            m_traverse: None,
+            m_clear: None,
+            m_free: None,
+        };
+
+        let ffi_def = UnsafeCell::new(ffi::PyModuleDef {
+            m_name: name.as_ptr(),
+            m_doc: doc.as_ptr(),
+            ..INIT
+        });
+
+        ModuleDef {
+            ffi_def,
+            initializer,
+            // -1 is never expected to be a valid interpreter ID
+            #[cfg(all(
+                not(any(PyPy, GraalPy)),
+                Py_3_9,
+                not(all(windows, Py_LIMITED_API, not(Py_3_10)))
+            ))]
+            interpreter: AtomicI64::new(-1),
+            module: GILOnceCell::new(),
+        }
+    }
+    /// Builds a module using user given initializer. Used for [`#[pymodule]`][crate::pymodule].
+    pub fn make_module(&'static self, py: Python<'_>) -> PyResult<Py<PyModule>> {
+        #[cfg(all(PyPy, not(Py_3_8)))]
+        {
+            use crate::types::any::PyAnyMethods;
+            const PYPY_GOOD_VERSION: [u8; 3] = [7, 3, 8];
+            let version = py
+                .import_bound("sys")?
+                .getattr("implementation")?
+                .getattr("version")?;
+            if version.lt(crate::types::PyTuple::new_bound(py, PYPY_GOOD_VERSION))? {
+                let warn = py.import_bound("warnings")?.getattr("warn")?;
+                warn.call1((
+                    "PyPy 3.7 versions older than 7.3.8 are known to have binary \
+                        compatibility issues which may cause segfaults. Please upgrade.",
+                ))?;
+            }
+        }
+        // Check the interpreter ID has not changed, since we currently have no way to guarantee
+        // that static data is not reused across interpreters.
+        //
+        // PyPy does not have subinterpreters, so no need to check interpreter ID.
+        #[cfg(not(any(PyPy, GraalPy)))]
+        {
+            // PyInterpreterState_Get is only available on 3.9 and later, but is missing
+            // from python3.dll for Windows stable API on 3.9
+            #[cfg(all(Py_3_9, not(all(windows, Py_LIMITED_API, not(Py_3_10)))))]
+            {
+                let current_interpreter =
+                    unsafe { ffi::PyInterpreterState_GetID(ffi::PyInterpreterState_Get()) };
+                crate::err::error_on_minusone(py, current_interpreter)?;
+                if let Err(initialized_interpreter) = self.interpreter.compare_exchange(
+                    -1,
+                    current_interpreter,
+                    Ordering::SeqCst,
+                    Ordering::SeqCst,
+                ) {
+                    if initialized_interpreter != current_interpreter {
+                        return Err(PyImportError::new_err(
+                            "PyO3 modules do not yet support subinterpreters, see https://github.com/PyO3/pyo3/issues/576",
+                        ));
+                    }
+                }
+            }
+            #[cfg(not(all(Py_3_9, not(all(windows, Py_LIMITED_API, not(Py_3_10))))))]
+            {
+                // CPython before 3.9 does not have APIs to check the interpreter ID, so best that can be
+                // done to guard against subinterpreters is fail if the module is initialized twice
+                if self.module.get(py).is_some() {
+                    return Err(PyImportError::new_err(
+                        "PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process"
+                    ));
+                }
+            }
+        }
+        self.module
+            .get_or_try_init(py, || {
+                let module = unsafe {
+                    Py::<PyModule>::from_owned_ptr_or_err(
+                        py,
+                        ffi::PyModule_Create(self.ffi_def.get()),
+                    )?
+                };
+                self.initializer.0(module.bind(py))?;
+                Ok(module)
+            })
+            .map(|py_module| py_module.clone_ref(py))
+    }
+}
+
+/// Trait to add an element (class, function...) to a module.
+///
+/// Currently only implemented for classes.
+pub trait PyAddToModule {
+    fn add_to_module(&'static self, module: &Bound<'_, PyModule>) -> PyResult<()>;
+}
+
+/// For adding native types (non-pyclass) to a module.
+pub struct AddTypeToModule<T>(PhantomData<T>);
+
+impl<T> AddTypeToModule<T> {
+    #[allow(clippy::new_without_default)]
+    pub const fn new() -> Self {
+        AddTypeToModule(PhantomData)
+    }
+}
+
+impl<T: PyTypeInfo> PyAddToModule for AddTypeToModule<T> {
+    fn add_to_module(&'static self, module: &Bound<'_, PyModule>) -> PyResult<()> {
+        module.add(T::NAME, T::type_object_bound(module.py()))
+    }
+}
+
+/// For adding a class to a module.
+pub struct AddClassToModule<T>(PhantomData<T>);
+
+impl<T> AddClassToModule<T> {
+    #[allow(clippy::new_without_default)]
+    pub const fn new() -> Self {
+        AddClassToModule(PhantomData)
+    }
+}
+
+impl<T: PyClass> PyAddToModule for AddClassToModule<T> {
+    fn add_to_module(&'static self, module: &Bound<'_, PyModule>) -> PyResult<()> {
+        module.add_class::<T>()
+    }
+}
+
+/// For adding a function to a module.
+impl PyAddToModule for PyMethodDef {
+    fn add_to_module(&'static self, module: &Bound<'_, PyModule>) -> PyResult<()> {
+        module.add_function(PyCFunction::internal_new(module.py(), self, Some(module))?)
+    }
+}
+
+/// For adding a module to a module.
+impl PyAddToModule for ModuleDef {
+    fn add_to_module(&'static self, module: &Bound<'_, PyModule>) -> PyResult<()> {
+        module.add_submodule(self.make_module(module.py())?.bind(module.py()))
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use std::{
+        borrow::Cow,
+        ffi::CStr,
+        sync::atomic::{AtomicBool, Ordering},
+    };
+
+    use crate::{
+        ffi,
+        types::{any::PyAnyMethods, module::PyModuleMethods, PyModule},
+        Bound, PyResult, Python,
+    };
+
+    use super::{ModuleDef, ModuleInitializer};
+
+    #[test]
+    fn module_init() {
+        static MODULE_DEF: ModuleDef = unsafe {
+            ModuleDef::new(
+                ffi::c_str!("test_module"),
+                ffi::c_str!("some doc"),
+                ModuleInitializer(|m| {
+                    m.add("SOME_CONSTANT", 42)?;
+                    Ok(())
+                }),
+            )
+        };
+        Python::with_gil(|py| {
+            let module = MODULE_DEF.make_module(py).unwrap().into_bound(py);
+            assert_eq!(
+                module
+                    .getattr("__name__")
+                    .unwrap()
+                    .extract::<Cow<'_, str>>()
+                    .unwrap(),
+                "test_module",
+            );
+            assert_eq!(
+                module
+                    .getattr("__doc__")
+                    .unwrap()
+                    .extract::<Cow<'_, str>>()
+                    .unwrap(),
+                "some doc",
+            );
+            assert_eq!(
+                module
+                    .getattr("SOME_CONSTANT")
+                    .unwrap()
+                    .extract::<u8>()
+                    .unwrap(),
+                42,
+            );
+        })
+    }
+
+    #[test]
+    fn module_def_new() {
+        // To get coverage for ModuleDef::new() need to create a non-static ModuleDef, however init
+        // etc require static ModuleDef, so this test needs to be separated out.
+        static NAME: &CStr = ffi::c_str!("test_module");
+        static DOC: &CStr = ffi::c_str!("some doc");
+
+        static INIT_CALLED: AtomicBool = AtomicBool::new(false);
+
+        #[allow(clippy::unnecessary_wraps)]
+        fn init(_: &Bound<'_, PyModule>) -> PyResult<()> {
+            INIT_CALLED.store(true, Ordering::SeqCst);
+            Ok(())
+        }
+
+        unsafe {
+            let module_def: ModuleDef = ModuleDef::new(NAME, DOC, ModuleInitializer(init));
+            assert_eq!((*module_def.ffi_def.get()).m_name, NAME.as_ptr() as _);
+            assert_eq!((*module_def.ffi_def.get()).m_doc, DOC.as_ptr() as _);
+
+            Python::with_gil(|py| {
+                module_def.initializer.0(&py.import_bound("builtins").unwrap()).unwrap();
+                assert!(INIT_CALLED.load(Ordering::SeqCst));
+            })
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/impl_/trampoline.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/trampoline.rs
--- 43.0.0-1/rust-vendor/pyo3/src/impl_/trampoline.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/trampoline.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,241 @@
+//! Trampolines for various pyfunction and pymethod implementations.
+//!
+//! They exist to monomorphise std::panic::catch_unwind once into PyO3, rather than inline in every
+//! function, thus saving a huge amount of compile-time complexity.
+
+use std::{
+    any::Any,
+    os::raw::c_int,
+    panic::{self, UnwindSafe},
+};
+
+use crate::gil::GILGuard;
+use crate::{
+    callback::PyCallbackOutput, ffi, ffi_ptr_ext::FfiPtrExt, impl_::panic::PanicTrap,
+    methods::IPowModulo, panic::PanicException, types::PyModule, Py, PyResult, Python,
+};
+
+#[inline]
+pub unsafe fn module_init(
+    f: for<'py> unsafe fn(Python<'py>) -> PyResult<Py<PyModule>>,
+) -> *mut ffi::PyObject {
+    trampoline(|py| f(py).map(|module| module.into_ptr()))
+}
+
+#[inline]
+#[allow(clippy::used_underscore_binding)]
+pub unsafe fn noargs(
+    slf: *mut ffi::PyObject,
+    _args: *mut ffi::PyObject,
+    f: for<'py> unsafe fn(Python<'py>, *mut ffi::PyObject) -> PyResult<*mut ffi::PyObject>,
+) -> *mut ffi::PyObject {
+    #[cfg(not(GraalPy))] // this is not specified and GraalPy does not pass null here
+    debug_assert!(_args.is_null());
+    trampoline(|py| f(py, slf))
+}
+
+macro_rules! trampoline {
+    (pub fn $name:ident($($arg_names:ident: $arg_types:ty),* $(,)?) -> $ret:ty;) => {
+        #[inline]
+        pub unsafe fn $name(
+            $($arg_names: $arg_types,)*
+            f: for<'py> unsafe fn (Python<'py>, $($arg_types),*) -> PyResult<$ret>,
+        ) -> $ret {
+            trampoline(|py| f(py, $($arg_names,)*))
+        }
+    }
+}
+
+macro_rules! trampolines {
+    ($(pub fn $name:ident($($arg_names:ident: $arg_types:ty),* $(,)?) -> $ret:ty);* ;) => {
+        $(trampoline!(pub fn $name($($arg_names: $arg_types),*) -> $ret;));*;
+    }
+}
+
+trampolines!(
+    pub fn fastcall_with_keywords(
+        slf: *mut ffi::PyObject,
+        args: *const *mut ffi::PyObject,
+        nargs: ffi::Py_ssize_t,
+        kwnames: *mut ffi::PyObject,
+    ) -> *mut ffi::PyObject;
+
+    pub fn cfunction_with_keywords(
+        slf: *mut ffi::PyObject,
+        args: *mut ffi::PyObject,
+        kwargs: *mut ffi::PyObject,
+    ) -> *mut ffi::PyObject;
+);
+
+// Trampolines used by slot methods
+trampolines!(
+    pub fn getattrofunc(slf: *mut ffi::PyObject, attr: *mut ffi::PyObject) -> *mut ffi::PyObject;
+
+    pub fn setattrofunc(
+        slf: *mut ffi::PyObject,
+        attr: *mut ffi::PyObject,
+        value: *mut ffi::PyObject,
+    ) -> c_int;
+
+    pub fn binaryfunc(slf: *mut ffi::PyObject, arg1: *mut ffi::PyObject) -> *mut ffi::PyObject;
+
+    pub fn descrgetfunc(
+        slf: *mut ffi::PyObject,
+        arg1: *mut ffi::PyObject,
+        arg2: *mut ffi::PyObject,
+    ) -> *mut ffi::PyObject;
+
+    pub fn getiterfunc(slf: *mut ffi::PyObject) -> *mut ffi::PyObject;
+
+    pub fn hashfunc(slf: *mut ffi::PyObject) -> ffi::Py_hash_t;
+
+    pub fn inquiry(slf: *mut ffi::PyObject) -> c_int;
+
+    pub fn iternextfunc(slf: *mut ffi::PyObject) -> *mut ffi::PyObject;
+
+    pub fn lenfunc(slf: *mut ffi::PyObject) -> ffi::Py_ssize_t;
+
+    pub fn newfunc(
+        subtype: *mut ffi::PyTypeObject,
+        args: *mut ffi::PyObject,
+        kwargs: *mut ffi::PyObject,
+    ) -> *mut ffi::PyObject;
+
+    pub fn objobjproc(slf: *mut ffi::PyObject, arg1: *mut ffi::PyObject) -> c_int;
+
+    pub fn reprfunc(slf: *mut ffi::PyObject) -> *mut ffi::PyObject;
+
+    pub fn richcmpfunc(
+        slf: *mut ffi::PyObject,
+        other: *mut ffi::PyObject,
+        op: c_int,
+    ) -> *mut ffi::PyObject;
+
+    pub fn ssizeargfunc(arg1: *mut ffi::PyObject, arg2: ffi::Py_ssize_t) -> *mut ffi::PyObject;
+
+    pub fn ternaryfunc(
+        slf: *mut ffi::PyObject,
+        arg1: *mut ffi::PyObject,
+        arg2: *mut ffi::PyObject,
+    ) -> *mut ffi::PyObject;
+
+    pub fn unaryfunc(slf: *mut ffi::PyObject) -> *mut ffi::PyObject;
+);
+
+#[cfg(any(not(Py_LIMITED_API), Py_3_11))]
+trampoline! {
+    pub fn getbufferproc(slf: *mut ffi::PyObject, buf: *mut ffi::Py_buffer, flags: c_int) -> c_int;
+}
+
+#[cfg(any(not(Py_LIMITED_API), Py_3_11))]
+#[inline]
+pub unsafe fn releasebufferproc(
+    slf: *mut ffi::PyObject,
+    buf: *mut ffi::Py_buffer,
+    f: for<'py> unsafe fn(Python<'py>, *mut ffi::PyObject, *mut ffi::Py_buffer) -> PyResult<()>,
+) {
+    trampoline_unraisable(|py| f(py, slf, buf), slf)
+}
+
+#[inline]
+pub(crate) unsafe fn dealloc(
+    slf: *mut ffi::PyObject,
+    f: for<'py> unsafe fn(Python<'py>, *mut ffi::PyObject) -> (),
+) {
+    // After calling tp_dealloc the object is no longer valid,
+    // so pass null_mut() to the context.
+    //
+    // (Note that we don't allow the implementation `f` to fail.)
+    trampoline_unraisable(
+        |py| {
+            f(py, slf);
+            Ok(())
+        },
+        std::ptr::null_mut(),
+    )
+}
+
+// Ipowfunc is a unique case where PyO3 has its own type
+// to workaround a problem on 3.7 (see IPowModulo type definition).
+// Once 3.7 support dropped can just remove this.
+trampoline!(
+    pub fn ipowfunc(
+        arg1: *mut ffi::PyObject,
+        arg2: *mut ffi::PyObject,
+        arg3: IPowModulo,
+    ) -> *mut ffi::PyObject;
+);
+
+/// Implementation of trampoline functions, which sets up a GILPool and calls F.
+///
+/// Panics during execution are trapped so that they don't propagate through any
+/// outer FFI boundary.
+///
+/// The GIL must already be held when this is called.
+#[inline]
+pub(crate) unsafe fn trampoline<F, R>(body: F) -> R
+where
+    F: for<'py> FnOnce(Python<'py>) -> PyResult<R> + UnwindSafe,
+    R: PyCallbackOutput,
+{
+    let trap = PanicTrap::new("uncaught panic at ffi boundary");
+
+    // SAFETY: This function requires the GIL to already be held.
+    let guard = GILGuard::assume();
+    let py = guard.python();
+    let out = panic_result_into_callback_output(
+        py,
+        panic::catch_unwind(move || -> PyResult<_> { body(py) }),
+    );
+    trap.disarm();
+    out
+}
+
+/// Converts the output of std::panic::catch_unwind into a Python function output, either by raising a Python
+/// exception or by unwrapping the contained success output.
+#[inline]
+fn panic_result_into_callback_output<R>(
+    py: Python<'_>,
+    panic_result: Result<PyResult<R>, Box<dyn Any + Send + 'static>>,
+) -> R
+where
+    R: PyCallbackOutput,
+{
+    let py_err = match panic_result {
+        Ok(Ok(value)) => return value,
+        Ok(Err(py_err)) => py_err,
+        Err(payload) => PanicException::from_panic_payload(payload),
+    };
+    py_err.restore(py);
+    R::ERR_VALUE
+}
+
+/// Implementation of trampoline for functions which can't return an error.
+///
+/// Panics during execution are trapped so that they don't propagate through any
+/// outer FFI boundary.
+///
+/// Exceptions produced are sent to `sys.unraisablehook`.
+///
+/// # Safety
+///
+/// - ctx must be either a valid ffi::PyObject or NULL
+/// - The GIL must already be held when this is called.
+#[inline]
+unsafe fn trampoline_unraisable<F>(body: F, ctx: *mut ffi::PyObject)
+where
+    F: for<'py> FnOnce(Python<'py>) -> PyResult<()> + UnwindSafe,
+{
+    let trap = PanicTrap::new("uncaught panic at ffi boundary");
+
+    // SAFETY: The GIL is already held.
+    let guard = GILGuard::assume();
+    let py = guard.python();
+
+    if let Err(py_err) = panic::catch_unwind(move || body(py))
+        .unwrap_or_else(|payload| Err(PanicException::from_panic_payload(payload)))
+    {
+        py_err.write_unraisable_bound(py, ctx.assume_borrowed_or_opt(py).as_deref());
+    }
+    trap.disarm();
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/impl_/wrap.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/wrap.rs
--- 43.0.0-1/rust-vendor/pyo3/src/impl_/wrap.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_/wrap.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,103 @@
+use std::convert::Infallible;
+
+use crate::{ffi, IntoPy, PyObject, PyResult, Python};
+
+/// Used to wrap values in `Option<T>` for default arguments.
+pub trait SomeWrap<T> {
+    fn wrap(self) -> Option<T>;
+}
+
+impl<T> SomeWrap<T> for T {
+    fn wrap(self) -> Option<T> {
+        Some(self)
+    }
+}
+
+impl<T> SomeWrap<T> for Option<T> {
+    fn wrap(self) -> Self {
+        self
+    }
+}
+
+/// Used to wrap the result of `#[pyfunction]` and `#[pymethods]`.
+#[cfg_attr(
+    diagnostic_namespace,
+    diagnostic::on_unimplemented(
+        message = "`{Self}` cannot be converted to a Python object",
+        note = "`IntoPy` is automatically implemented by the `#[pyclass]` macro",
+        note = "if you do not wish to have a corresponding Python type, implement `IntoPy` manually",
+        note = "if you do not own `{Self}` you can perform a manual conversion to one of the types in `pyo3::types::*`"
+    )
+)]
+pub trait OkWrap<T> {
+    type Error;
+    fn wrap(self) -> Result<T, Self::Error>;
+}
+
+// The T: IntoPy<PyObject> bound here is necessary to prevent the
+// implementation for Result<T, E> from conflicting
+impl<T> OkWrap<T> for T
+where
+    T: IntoPy<PyObject>,
+{
+    type Error = Infallible;
+    #[inline]
+    fn wrap(self) -> Result<T, Infallible> {
+        Ok(self)
+    }
+}
+
+impl<T, E> OkWrap<T> for Result<T, E>
+where
+    T: IntoPy<PyObject>,
+{
+    type Error = E;
+    #[inline]
+    fn wrap(self) -> Result<T, Self::Error> {
+        self
+    }
+}
+
+/// This is a follow-up function to `OkWrap::wrap` that converts the result into
+/// a `*mut ffi::PyObject` pointer.
+pub fn map_result_into_ptr<T: IntoPy<PyObject>>(
+    py: Python<'_>,
+    result: PyResult<T>,
+) -> PyResult<*mut ffi::PyObject> {
+    result.map(|obj| obj.into_py(py).into_ptr())
+}
+
+/// This is a follow-up function to `OkWrap::wrap` that converts the result into
+/// a safe wrapper.
+pub fn map_result_into_py<T: IntoPy<PyObject>>(
+    py: Python<'_>,
+    result: PyResult<T>,
+) -> PyResult<PyObject> {
+    result.map(|err| err.into_py(py))
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn wrap_option() {
+        let a: Option<u8> = SomeWrap::wrap(42);
+        assert_eq!(a, Some(42));
+
+        let b: Option<u8> = SomeWrap::wrap(None);
+        assert_eq!(b, None);
+    }
+
+    #[test]
+    fn wrap_result() {
+        let a: Result<u8, _> = OkWrap::wrap(42u8);
+        assert!(matches!(a, Ok(42)));
+
+        let b: PyResult<u8> = OkWrap::wrap(Ok(42u8));
+        assert!(matches!(b, Ok(42)));
+
+        let c: Result<u8, &str> = OkWrap::wrap(Err("error"));
+        assert_eq!(c, Err("error"));
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/impl_.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_.rs
--- 43.0.0-1/rust-vendor/pyo3/src/impl_.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/impl_.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,25 @@
+#![allow(missing_docs)]
+
+//! Internals of PyO3 which are accessed by code expanded from PyO3's procedural macros.
+//!
+//! Usage of any of these APIs in downstream code is implicitly acknowledging that these
+//! APIs may may change at any time without documentation in the CHANGELOG and without
+//! breaking semver guarantees.
+
+#[cfg(feature = "experimental-async")]
+pub mod coroutine;
+pub mod deprecations;
+pub mod exceptions;
+pub mod extract_argument;
+pub mod freelist;
+pub mod frompyobject;
+pub(crate) mod not_send;
+pub mod panic;
+pub mod pycell;
+pub mod pyclass;
+pub mod pyfunction;
+pub mod pymethods;
+pub mod pymodule;
+#[doc(hidden)]
+pub mod trampoline;
+pub mod wrap;
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/inspect/mod.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/inspect/mod.rs
--- 43.0.0-1/rust-vendor/pyo3/src/inspect/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/inspect/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4 @@
+//! Runtime inspection of objects exposed to Python.
+//!
+//! Tracking issue: <https://github.com/PyO3/pyo3/issues/2454>.
+pub mod types;
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/inspect/types.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/inspect/types.rs
--- 43.0.0-1/rust-vendor/pyo3/src/inspect/types.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/inspect/types.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,486 @@
+//! Data types used to describe runtime Python types.
+
+use std::borrow::Cow;
+use std::fmt::{Display, Formatter};
+
+/// Designation of a Python type.
+///
+/// This enum is used to handle advanced types, such as types with generics.
+/// Its [`Display`] implementation can be used to convert to the type hint notation (e.g. `List[int]`).
+#[derive(Debug, Clone, Eq, PartialEq)]
+pub enum TypeInfo {
+    /// The type `typing.Any`, which represents any possible value (unknown type).
+    Any,
+    /// The type `typing.None`.
+    None,
+    /// The type `typing.NoReturn`, which represents functions that never return (they can still panic / throw, similar to `never` in Rust).
+    NoReturn,
+    /// The type `typing.Callable`.
+    ///
+    /// The first argument represents the parameters of the callable:
+    /// - `Some` of a vector of types to represent the signature,
+    /// - `None` if the signature is unknown (allows any number of arguments with type `Any`).
+    ///
+    /// The second argument represents the return type.
+    Callable(Option<Vec<TypeInfo>>, Box<TypeInfo>),
+    /// The type `typing.tuple`.
+    ///
+    /// The argument represents the contents of the tuple:
+    /// - `Some` of a vector of types to represent the accepted types,
+    /// - `Some` of an empty vector for the empty tuple,
+    /// - `None` if the number and type of accepted values is unknown.
+    ///
+    /// If the number of accepted values is unknown, but their type is, use [`Self::UnsizedTypedTuple`].
+    Tuple(Option<Vec<TypeInfo>>),
+    /// The type `typing.Tuple`.
+    ///
+    /// Use this variant to represent a tuple of unknown size but of known types.
+    ///
+    /// If the type is unknown, or if the number of elements is known, use [`Self::Tuple`].
+    UnsizedTypedTuple(Box<TypeInfo>),
+    /// A Python class.
+    Class {
+        /// The module this class comes from.
+        module: ModuleName,
+        /// The name of this class, as it appears in a type hint.
+        name: Cow<'static, str>,
+        /// The generics accepted by this class (empty vector if this class is not generic).
+        type_vars: Vec<TypeInfo>,
+    },
+}
+
+/// Declares which module a type is a part of.
+#[derive(Debug, Clone, Eq, PartialEq)]
+pub enum ModuleName {
+    /// The type is built-in: it doesn't need to be imported.
+    Builtin,
+    /// The type is in the current module: it doesn't need to be imported in this module, but needs to be imported in others.
+    CurrentModule,
+    /// The type is in the specified module.
+    Module(Cow<'static, str>),
+}
+
+impl TypeInfo {
+    /// Returns the module in which a type is declared.
+    ///
+    /// Returns `None` if the type is declared in the current module.
+    pub fn module_name(&self) -> Option<&str> {
+        match self {
+            TypeInfo::Any
+            | TypeInfo::None
+            | TypeInfo::NoReturn
+            | TypeInfo::Callable(_, _)
+            | TypeInfo::Tuple(_)
+            | TypeInfo::UnsizedTypedTuple(_) => Some("typing"),
+            TypeInfo::Class { module, .. } => match module {
+                ModuleName::Builtin => Some("builtins"),
+                ModuleName::CurrentModule => None,
+                ModuleName::Module(name) => Some(name),
+            },
+        }
+    }
+
+    /// Returns the name of a type.
+    ///
+    /// The name of a type is the part of the hint that is not generic (e.g. `List` instead of `List[int]`).
+    pub fn name(&self) -> Cow<'_, str> {
+        Cow::from(match self {
+            TypeInfo::Any => "Any",
+            TypeInfo::None => "None",
+            TypeInfo::NoReturn => "NoReturn",
+            TypeInfo::Callable(_, _) => "Callable",
+            TypeInfo::Tuple(_) => "Tuple",
+            TypeInfo::UnsizedTypedTuple(_) => "Tuple",
+            TypeInfo::Class { name, .. } => name,
+        })
+    }
+}
+
+// Utilities for easily instantiating TypeInfo structures for built-in/common types.
+impl TypeInfo {
+    /// The Python `Optional` type.
+    pub fn optional_of(t: TypeInfo) -> TypeInfo {
+        TypeInfo::Class {
+            module: ModuleName::Module(Cow::from("typing")),
+            name: Cow::from("Optional"),
+            type_vars: vec![t],
+        }
+    }
+
+    /// The Python `Union` type.
+    pub fn union_of(types: &[TypeInfo]) -> TypeInfo {
+        TypeInfo::Class {
+            module: ModuleName::Module(Cow::from("typing")),
+            name: Cow::from("Union"),
+            type_vars: types.to_vec(),
+        }
+    }
+
+    /// The Python `List` type.
+    pub fn list_of(t: TypeInfo) -> TypeInfo {
+        TypeInfo::Class {
+            module: ModuleName::Module(Cow::from("typing")),
+            name: Cow::from("List"),
+            type_vars: vec![t],
+        }
+    }
+
+    /// The Python `Sequence` type.
+    pub fn sequence_of(t: TypeInfo) -> TypeInfo {
+        TypeInfo::Class {
+            module: ModuleName::Module(Cow::from("typing")),
+            name: Cow::from("Sequence"),
+            type_vars: vec![t],
+        }
+    }
+
+    /// The Python `Set` type.
+    pub fn set_of(t: TypeInfo) -> TypeInfo {
+        TypeInfo::Class {
+            module: ModuleName::Module(Cow::from("typing")),
+            name: Cow::from("Set"),
+            type_vars: vec![t],
+        }
+    }
+
+    /// The Python `FrozenSet` type.
+    pub fn frozen_set_of(t: TypeInfo) -> TypeInfo {
+        TypeInfo::Class {
+            module: ModuleName::Module(Cow::from("typing")),
+            name: Cow::from("FrozenSet"),
+            type_vars: vec![t],
+        }
+    }
+
+    /// The Python `Iterable` type.
+    pub fn iterable_of(t: TypeInfo) -> TypeInfo {
+        TypeInfo::Class {
+            module: ModuleName::Module(Cow::from("typing")),
+            name: Cow::from("Iterable"),
+            type_vars: vec![t],
+        }
+    }
+
+    /// The Python `Iterator` type.
+    pub fn iterator_of(t: TypeInfo) -> TypeInfo {
+        TypeInfo::Class {
+            module: ModuleName::Module(Cow::from("typing")),
+            name: Cow::from("Iterator"),
+            type_vars: vec![t],
+        }
+    }
+
+    /// The Python `Dict` type.
+    pub fn dict_of(k: TypeInfo, v: TypeInfo) -> TypeInfo {
+        TypeInfo::Class {
+            module: ModuleName::Module(Cow::from("typing")),
+            name: Cow::from("Dict"),
+            type_vars: vec![k, v],
+        }
+    }
+
+    /// The Python `Mapping` type.
+    pub fn mapping_of(k: TypeInfo, v: TypeInfo) -> TypeInfo {
+        TypeInfo::Class {
+            module: ModuleName::Module(Cow::from("typing")),
+            name: Cow::from("Mapping"),
+            type_vars: vec![k, v],
+        }
+    }
+
+    /// Convenience factory for non-generic builtins (e.g. `int`).
+    pub fn builtin(name: &'static str) -> TypeInfo {
+        TypeInfo::Class {
+            module: ModuleName::Builtin,
+            name: Cow::from(name),
+            type_vars: vec![],
+        }
+    }
+}
+
+impl Display for TypeInfo {
+    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+        match self {
+            TypeInfo::Any | TypeInfo::None | TypeInfo::NoReturn => write!(f, "{}", self.name()),
+            TypeInfo::Callable(input, output) => {
+                write!(f, "Callable[")?;
+
+                if let Some(input) = input {
+                    write!(f, "[")?;
+                    let mut comma = false;
+                    for arg in input {
+                        if comma {
+                            write!(f, ", ")?;
+                        }
+                        write!(f, "{}", arg)?;
+                        comma = true;
+                    }
+                    write!(f, "]")?;
+                } else {
+                    write!(f, "...")?;
+                }
+
+                write!(f, ", {}]", output)
+            }
+            TypeInfo::Tuple(types) => {
+                write!(f, "Tuple[")?;
+
+                if let Some(types) = types {
+                    if types.is_empty() {
+                        write!(f, "()")?;
+                    } else {
+                        let mut comma = false;
+                        for t in types {
+                            if comma {
+                                write!(f, ", ")?;
+                            }
+                            write!(f, "{}", t)?;
+                            comma = true;
+                        }
+                    }
+                } else {
+                    write!(f, "...")?;
+                }
+
+                write!(f, "]")
+            }
+            TypeInfo::UnsizedTypedTuple(t) => write!(f, "Tuple[{}, ...]", t),
+            TypeInfo::Class {
+                name, type_vars, ..
+            } => {
+                write!(f, "{}", name)?;
+
+                if !type_vars.is_empty() {
+                    write!(f, "[")?;
+
+                    let mut comma = false;
+                    for var in type_vars {
+                        if comma {
+                            write!(f, ", ")?;
+                        }
+                        write!(f, "{}", var)?;
+                        comma = true;
+                    }
+
+                    write!(f, "]")
+                } else {
+                    Ok(())
+                }
+            }
+        }
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use std::borrow::Cow;
+
+    use crate::inspect::types::{ModuleName, TypeInfo};
+
+    pub fn assert_display(t: &TypeInfo, expected: &str) {
+        assert_eq!(format!("{}", t), expected)
+    }
+
+    #[test]
+    fn basic() {
+        assert_display(&TypeInfo::Any, "Any");
+        assert_display(&TypeInfo::None, "None");
+        assert_display(&TypeInfo::NoReturn, "NoReturn");
+
+        assert_display(&TypeInfo::builtin("int"), "int");
+    }
+
+    #[test]
+    fn callable() {
+        let any_to_int = TypeInfo::Callable(None, Box::new(TypeInfo::builtin("int")));
+        assert_display(&any_to_int, "Callable[..., int]");
+
+        let sum = TypeInfo::Callable(
+            Some(vec![TypeInfo::builtin("int"), TypeInfo::builtin("int")]),
+            Box::new(TypeInfo::builtin("int")),
+        );
+        assert_display(&sum, "Callable[[int, int], int]");
+    }
+
+    #[test]
+    fn tuple() {
+        let any = TypeInfo::Tuple(None);
+        assert_display(&any, "Tuple[...]");
+
+        let triple = TypeInfo::Tuple(Some(vec![
+            TypeInfo::builtin("int"),
+            TypeInfo::builtin("str"),
+            TypeInfo::builtin("bool"),
+        ]));
+        assert_display(&triple, "Tuple[int, str, bool]");
+
+        let empty = TypeInfo::Tuple(Some(vec![]));
+        assert_display(&empty, "Tuple[()]");
+
+        let typed = TypeInfo::UnsizedTypedTuple(Box::new(TypeInfo::builtin("bool")));
+        assert_display(&typed, "Tuple[bool, ...]");
+    }
+
+    #[test]
+    fn class() {
+        let class1 = TypeInfo::Class {
+            module: ModuleName::CurrentModule,
+            name: Cow::from("MyClass"),
+            type_vars: vec![],
+        };
+        assert_display(&class1, "MyClass");
+
+        let class2 = TypeInfo::Class {
+            module: ModuleName::CurrentModule,
+            name: Cow::from("MyClass"),
+            type_vars: vec![TypeInfo::builtin("int"), TypeInfo::builtin("bool")],
+        };
+        assert_display(&class2, "MyClass[int, bool]");
+    }
+
+    #[test]
+    fn collections() {
+        let int = TypeInfo::builtin("int");
+        let bool = TypeInfo::builtin("bool");
+        let str = TypeInfo::builtin("str");
+
+        let list = TypeInfo::list_of(int.clone());
+        assert_display(&list, "List[int]");
+
+        let sequence = TypeInfo::sequence_of(bool.clone());
+        assert_display(&sequence, "Sequence[bool]");
+
+        let optional = TypeInfo::optional_of(str.clone());
+        assert_display(&optional, "Optional[str]");
+
+        let iterable = TypeInfo::iterable_of(int.clone());
+        assert_display(&iterable, "Iterable[int]");
+
+        let iterator = TypeInfo::iterator_of(bool);
+        assert_display(&iterator, "Iterator[bool]");
+
+        let dict = TypeInfo::dict_of(int.clone(), str.clone());
+        assert_display(&dict, "Dict[int, str]");
+
+        let mapping = TypeInfo::mapping_of(int, str.clone());
+        assert_display(&mapping, "Mapping[int, str]");
+
+        let set = TypeInfo::set_of(str.clone());
+        assert_display(&set, "Set[str]");
+
+        let frozen_set = TypeInfo::frozen_set_of(str);
+        assert_display(&frozen_set, "FrozenSet[str]");
+    }
+
+    #[test]
+    fn complicated() {
+        let int = TypeInfo::builtin("int");
+        assert_display(&int, "int");
+
+        let bool = TypeInfo::builtin("bool");
+        assert_display(&bool, "bool");
+
+        let str = TypeInfo::builtin("str");
+        assert_display(&str, "str");
+
+        let any = TypeInfo::Any;
+        assert_display(&any, "Any");
+
+        let params = TypeInfo::union_of(&[int.clone(), str]);
+        assert_display(&params, "Union[int, str]");
+
+        let func = TypeInfo::Callable(Some(vec![params, any]), Box::new(bool));
+        assert_display(&func, "Callable[[Union[int, str], Any], bool]");
+
+        let dict = TypeInfo::mapping_of(int, func);
+        assert_display(
+            &dict,
+            "Mapping[int, Callable[[Union[int, str], Any], bool]]",
+        );
+    }
+}
+
+#[cfg(test)]
+mod conversion {
+    use std::collections::{HashMap, HashSet};
+
+    use crate::inspect::types::test::assert_display;
+    use crate::{FromPyObject, IntoPy};
+
+    #[test]
+    fn unsigned_int() {
+        assert_display(&usize::type_output(), "int");
+        assert_display(&usize::type_input(), "int");
+
+        assert_display(&u8::type_output(), "int");
+        assert_display(&u8::type_input(), "int");
+
+        assert_display(&u16::type_output(), "int");
+        assert_display(&u16::type_input(), "int");
+
+        assert_display(&u32::type_output(), "int");
+        assert_display(&u32::type_input(), "int");
+
+        assert_display(&u64::type_output(), "int");
+        assert_display(&u64::type_input(), "int");
+    }
+
+    #[test]
+    fn signed_int() {
+        assert_display(&isize::type_output(), "int");
+        assert_display(&isize::type_input(), "int");
+
+        assert_display(&i8::type_output(), "int");
+        assert_display(&i8::type_input(), "int");
+
+        assert_display(&i16::type_output(), "int");
+        assert_display(&i16::type_input(), "int");
+
+        assert_display(&i32::type_output(), "int");
+        assert_display(&i32::type_input(), "int");
+
+        assert_display(&i64::type_output(), "int");
+        assert_display(&i64::type_input(), "int");
+    }
+
+    #[test]
+    fn float() {
+        assert_display(&f32::type_output(), "float");
+        assert_display(&f32::type_input(), "float");
+
+        assert_display(&f64::type_output(), "float");
+        assert_display(&f64::type_input(), "float");
+    }
+
+    #[test]
+    fn bool() {
+        assert_display(&bool::type_output(), "bool");
+        assert_display(&bool::type_input(), "bool");
+    }
+
+    #[test]
+    fn text() {
+        assert_display(&String::type_output(), "str");
+        assert_display(&String::type_input(), "str");
+
+        assert_display(&<&[u8]>::type_output(), "bytes");
+        assert_display(
+            &<&[u8] as crate::conversion::FromPyObjectBound>::type_input(),
+            "bytes",
+        );
+    }
+
+    #[test]
+    fn collections() {
+        assert_display(&<Vec<usize>>::type_output(), "List[int]");
+        assert_display(&<Vec<usize>>::type_input(), "Sequence[int]");
+
+        assert_display(&<HashSet<usize>>::type_output(), "Set[int]");
+        assert_display(&<HashSet<usize>>::type_input(), "Set[int]");
+
+        assert_display(&<HashMap<usize, f32>>::type_output(), "Dict[int, float]");
+        assert_display(&<HashMap<usize, f32>>::type_input(), "Mapping[int, float]");
+
+        assert_display(&<(usize, f32)>::type_input(), "Tuple[int, float]");
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/instance.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/instance.rs
--- 43.0.0-1/rust-vendor/pyo3/src/instance.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/instance.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,2407 @@
+use crate::err::{self, PyErr, PyResult};
+use crate::impl_::pycell::PyClassObject;
+use crate::internal_tricks::ptr_from_ref;
+use crate::pycell::{PyBorrowError, PyBorrowMutError};
+use crate::pyclass::boolean_struct::{False, True};
+#[cfg(feature = "gil-refs")]
+use crate::type_object::HasPyGilRef;
+use crate::types::{any::PyAnyMethods, string::PyStringMethods, typeobject::PyTypeMethods};
+use crate::types::{DerefToPyAny, PyDict, PyString, PyTuple};
+use crate::{
+    ffi, AsPyPointer, DowncastError, FromPyObject, IntoPy, PyAny, PyClass, PyClassInitializer,
+    PyRef, PyRefMut, PyTypeInfo, Python, ToPyObject,
+};
+use crate::{gil, PyTypeCheck};
+use std::marker::PhantomData;
+use std::mem::ManuallyDrop;
+use std::ops::Deref;
+use std::ptr::NonNull;
+
+/// Types that are built into the Python interpreter.
+///
+/// PyO3 is designed in a way that all references to those types are bound
+/// to the GIL, which is why you can get a token from all references of those
+/// types.
+///
+/// # Safety
+///
+/// This trait must only be implemented for types which cannot be accessed without the GIL.
+#[cfg(feature = "gil-refs")]
+pub unsafe trait PyNativeType: Sized {
+    /// The form of this which is stored inside a `Py<T>` smart pointer.
+    type AsRefSource: HasPyGilRef<AsRefTarget = Self>;
+
+    /// Cast `&self` to a `Borrowed` smart pointer.
+    ///
+    /// `Borrowed<T>` implements `Deref<Target=Bound<T>>`, so can also be used in locations
+    /// where `Bound<T>` is expected.
+    ///
+    /// This is available as a migration tool to adjust code from the deprecated "GIL Refs"
+    /// API to the `Bound` smart pointer API.
+    #[inline]
+    fn as_borrowed(&self) -> Borrowed<'_, '_, Self::AsRefSource> {
+        // Safety: &'py Self is expected to be a Python pointer,
+        // so has the same layout as Borrowed<'py, 'py, T>
+        Borrowed(
+            unsafe { NonNull::new_unchecked(ptr_from_ref(self) as *mut _) },
+            PhantomData,
+            self.py(),
+        )
+    }
+
+    /// Returns a GIL marker constrained to the lifetime of this type.
+    #[inline]
+    fn py(&self) -> Python<'_> {
+        unsafe { Python::assume_gil_acquired() }
+    }
+    /// Cast `&PyAny` to `&Self` without no type checking.
+    ///
+    /// # Safety
+    ///
+    /// `obj` must have the same layout as `*const ffi::PyObject` and must be
+    /// an instance of a type corresponding to `Self`.
+    unsafe fn unchecked_downcast(obj: &PyAny) -> &Self {
+        &*(obj.as_ptr() as *const Self)
+    }
+}
+
+/// A GIL-attached equivalent to [`Py<T>`].
+///
+/// This type can be thought of as equivalent to the tuple `(Py<T>, Python<'py>)`. By having the `'py`
+/// lifetime of the [`Python<'py>`] token, this ties the lifetime of the [`Bound<'py, T>`] smart pointer
+/// to the lifetime of the GIL and allows PyO3 to call Python APIs at maximum efficiency.
+///
+/// To access the object in situations where the GIL is not held, convert it to [`Py<T>`]
+/// using [`.unbind()`][Bound::unbind]. This includes situations where the GIL is temporarily
+/// released, such as [`Python::allow_threads`](crate::Python::allow_threads)'s closure.
+///
+/// See
+#[doc = concat!("[the guide](https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/types.html#boundpy-t)")]
+/// for more detail.
+#[repr(transparent)]
+pub struct Bound<'py, T>(Python<'py>, ManuallyDrop<Py<T>>);
+
+impl<'py, T> Bound<'py, T>
+where
+    T: PyClass,
+{
+    /// Creates a new instance `Bound<T>` of a `#[pyclass]` on the Python heap.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// #[pyclass]
+    /// struct Foo {/* fields omitted */}
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// let foo: Py<Foo> = Python::with_gil(|py| -> PyResult<_> {
+    ///     let foo: Bound<'_, Foo> = Bound::new(py, Foo {})?;
+    ///     Ok(foo.into())
+    /// })?;
+    /// # Python::with_gil(move |_py| drop(foo));
+    /// # Ok(())
+    /// # }
+    /// ```
+    pub fn new(
+        py: Python<'py>,
+        value: impl Into<PyClassInitializer<T>>,
+    ) -> PyResult<Bound<'py, T>> {
+        value.into().create_class_object(py)
+    }
+}
+
+impl<'py> Bound<'py, PyAny> {
+    /// Constructs a new `Bound<'py, PyAny>` from a pointer. Panics if `ptr` is null.
+    ///
+    /// # Safety
+    ///
+    /// - `ptr` must be a valid pointer to a Python object
+    /// - `ptr` must be an owned Python reference, as the `Bound<'py, PyAny>` will assume ownership
+    #[inline]
+    #[track_caller]
+    pub unsafe fn from_owned_ptr(py: Python<'py>, ptr: *mut ffi::PyObject) -> Self {
+        Self(py, ManuallyDrop::new(Py::from_owned_ptr(py, ptr)))
+    }
+
+    /// Constructs a new `Bound<'py, PyAny>` from a pointer. Returns `None` if `ptr` is null.
+    ///
+    /// # Safety
+    ///
+    /// - `ptr` must be a valid pointer to a Python object, or null
+    /// - `ptr` must be an owned Python reference, as the `Bound<'py, PyAny>` will assume ownership
+    #[inline]
+    pub unsafe fn from_owned_ptr_or_opt(py: Python<'py>, ptr: *mut ffi::PyObject) -> Option<Self> {
+        Py::from_owned_ptr_or_opt(py, ptr).map(|obj| Self(py, ManuallyDrop::new(obj)))
+    }
+
+    /// Constructs a new `Bound<'py, PyAny>` from a pointer. Returns an `Err` by calling `PyErr::fetch`
+    /// if `ptr` is null.
+    ///
+    /// # Safety
+    ///
+    /// - `ptr` must be a valid pointer to a Python object, or null
+    /// - `ptr` must be an owned Python reference, as the `Bound<'py, PyAny>` will assume ownership
+    #[inline]
+    pub unsafe fn from_owned_ptr_or_err(
+        py: Python<'py>,
+        ptr: *mut ffi::PyObject,
+    ) -> PyResult<Self> {
+        Py::from_owned_ptr_or_err(py, ptr).map(|obj| Self(py, ManuallyDrop::new(obj)))
+    }
+
+    /// Constructs a new `Bound<'py, PyAny>` from a pointer by creating a new Python reference.
+    /// Panics if `ptr` is null.
+    ///
+    /// # Safety
+    ///
+    /// - `ptr` must be a valid pointer to a Python object
+    #[inline]
+    #[track_caller]
+    pub unsafe fn from_borrowed_ptr(py: Python<'py>, ptr: *mut ffi::PyObject) -> Self {
+        Self(py, ManuallyDrop::new(Py::from_borrowed_ptr(py, ptr)))
+    }
+
+    /// Constructs a new `Bound<'py, PyAny>` from a pointer by creating a new Python reference.
+    /// Returns `None` if `ptr` is null.
+    ///
+    /// # Safety
+    ///
+    /// - `ptr` must be a valid pointer to a Python object, or null
+    #[inline]
+    pub unsafe fn from_borrowed_ptr_or_opt(
+        py: Python<'py>,
+        ptr: *mut ffi::PyObject,
+    ) -> Option<Self> {
+        Py::from_borrowed_ptr_or_opt(py, ptr).map(|obj| Self(py, ManuallyDrop::new(obj)))
+    }
+
+    /// Constructs a new `Bound<'py, PyAny>` from a pointer by creating a new Python reference.
+    /// Returns an `Err` by calling `PyErr::fetch` if `ptr` is null.
+    ///
+    /// # Safety
+    ///
+    /// - `ptr` must be a valid pointer to a Python object, or null
+    #[inline]
+    pub unsafe fn from_borrowed_ptr_or_err(
+        py: Python<'py>,
+        ptr: *mut ffi::PyObject,
+    ) -> PyResult<Self> {
+        Py::from_borrowed_ptr_or_err(py, ptr).map(|obj| Self(py, ManuallyDrop::new(obj)))
+    }
+
+    /// This slightly strange method is used to obtain `&Bound<PyAny>` from a pointer in macro code
+    /// where we need to constrain the lifetime `'a` safely.
+    ///
+    /// Note that `'py` is required to outlive `'a` implicitly by the nature of the fact that
+    /// `&'a Bound<'py>` means that `Bound<'py>` exists for at least the lifetime `'a`.
+    ///
+    /// # Safety
+    /// - `ptr` must be a valid pointer to a Python object for the lifetime `'a`. The `ptr` can
+    ///   be either a borrowed reference or an owned reference, it does not matter, as this is
+    ///   just `&Bound` there will never be any ownership transfer.
+    #[inline]
+    pub(crate) unsafe fn ref_from_ptr<'a>(
+        _py: Python<'py>,
+        ptr: &'a *mut ffi::PyObject,
+    ) -> &'a Self {
+        &*ptr_from_ref(ptr).cast::<Bound<'py, PyAny>>()
+    }
+
+    /// Variant of the above which returns `None` for null pointers.
+    ///
+    /// # Safety
+    /// - `ptr` must be a valid pointer to a Python object for the lifetime `'a, or null.
+    #[inline]
+    pub(crate) unsafe fn ref_from_ptr_or_opt<'a>(
+        _py: Python<'py>,
+        ptr: &'a *mut ffi::PyObject,
+    ) -> &'a Option<Self> {
+        &*ptr_from_ref(ptr).cast::<Option<Bound<'py, PyAny>>>()
+    }
+}
+
+impl<'py, T> Bound<'py, T>
+where
+    T: PyClass,
+{
+    /// Immutably borrows the value `T`.
+    ///
+    /// This borrow lasts while the returned [`PyRef`] exists.
+    /// Multiple immutable borrows can be taken out at the same time.
+    ///
+    /// For frozen classes, the simpler [`get`][Self::get] is available.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// # use pyo3::prelude::*;
+    /// #
+    /// #[pyclass]
+    /// struct Foo {
+    ///     inner: u8,
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let foo: Bound<'_, Foo> = Bound::new(py, Foo { inner: 73 })?;
+    ///     let inner: &u8 = &foo.borrow().inner;
+    ///
+    ///     assert_eq!(*inner, 73);
+    ///     Ok(())
+    /// })?;
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    ///
+    /// Panics if the value is currently mutably borrowed. For a non-panicking variant, use
+    /// [`try_borrow`](#method.try_borrow).
+    #[inline]
+    #[track_caller]
+    pub fn borrow(&self) -> PyRef<'py, T> {
+        PyRef::borrow(self)
+    }
+
+    /// Mutably borrows the value `T`.
+    ///
+    /// This borrow lasts while the returned [`PyRefMut`] exists.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # use pyo3::prelude::*;
+    /// #
+    /// #[pyclass]
+    /// struct Foo {
+    ///     inner: u8,
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let foo: Bound<'_, Foo> = Bound::new(py, Foo { inner: 73 })?;
+    ///     foo.borrow_mut().inner = 35;
+    ///
+    ///     assert_eq!(foo.borrow().inner, 35);
+    ///     Ok(())
+    /// })?;
+    /// # Ok(())
+    /// # }
+    ///  ```
+    ///
+    /// # Panics
+    /// Panics if the value is currently borrowed. For a non-panicking variant, use
+    /// [`try_borrow_mut`](#method.try_borrow_mut).
+    #[inline]
+    #[track_caller]
+    pub fn borrow_mut(&self) -> PyRefMut<'py, T>
+    where
+        T: PyClass<Frozen = False>,
+    {
+        PyRefMut::borrow(self)
+    }
+
+    /// Attempts to immutably borrow the value `T`, returning an error if the value is currently mutably borrowed.
+    ///
+    /// The borrow lasts while the returned [`PyRef`] exists.
+    ///
+    /// This is the non-panicking variant of [`borrow`](#method.borrow).
+    ///
+    /// For frozen classes, the simpler [`get`][Self::get] is available.
+    #[inline]
+    pub fn try_borrow(&self) -> Result<PyRef<'py, T>, PyBorrowError> {
+        PyRef::try_borrow(self)
+    }
+
+    /// Attempts to mutably borrow the value `T`, returning an error if the value is currently borrowed.
+    ///
+    /// The borrow lasts while the returned [`PyRefMut`] exists.
+    ///
+    /// This is the non-panicking variant of [`borrow_mut`](#method.borrow_mut).
+    #[inline]
+    pub fn try_borrow_mut(&self) -> Result<PyRefMut<'py, T>, PyBorrowMutError>
+    where
+        T: PyClass<Frozen = False>,
+    {
+        PyRefMut::try_borrow(self)
+    }
+
+    /// Provide an immutable borrow of the value `T` without acquiring the GIL.
+    ///
+    /// This is available if the class is [`frozen`][macro@crate::pyclass] and [`Sync`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::sync::atomic::{AtomicUsize, Ordering};
+    /// # use pyo3::prelude::*;
+    ///
+    /// #[pyclass(frozen)]
+    /// struct FrozenCounter {
+    ///     value: AtomicUsize,
+    /// }
+    ///
+    /// Python::with_gil(|py| {
+    ///     let counter = FrozenCounter { value: AtomicUsize::new(0) };
+    ///
+    ///     let py_counter = Bound::new(py, counter).unwrap();
+    ///
+    ///     py_counter.get().value.fetch_add(1, Ordering::Relaxed);
+    /// });
+    /// ```
+    #[inline]
+    pub fn get(&self) -> &T
+    where
+        T: PyClass<Frozen = True> + Sync,
+    {
+        self.1.get()
+    }
+
+    #[inline]
+    pub(crate) fn get_class_object(&self) -> &PyClassObject<T> {
+        self.1.get_class_object()
+    }
+}
+
+impl<'py, T> std::fmt::Debug for Bound<'py, T> {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+        let any = self.as_any();
+        python_format(any, any.repr(), f)
+    }
+}
+
+impl<'py, T> std::fmt::Display for Bound<'py, T> {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+        let any = self.as_any();
+        python_format(any, any.str(), f)
+    }
+}
+
+fn python_format(
+    any: &Bound<'_, PyAny>,
+    format_result: PyResult<Bound<'_, PyString>>,
+    f: &mut std::fmt::Formatter<'_>,
+) -> Result<(), std::fmt::Error> {
+    match format_result {
+        Result::Ok(s) => return f.write_str(&s.to_string_lossy()),
+        Result::Err(err) => err.write_unraisable_bound(any.py(), Some(any)),
+    }
+
+    match any.get_type().name() {
+        Result::Ok(name) => std::write!(f, "<unprintable {} object>", name),
+        Result::Err(_err) => f.write_str("<unprintable object>"),
+    }
+}
+
+// The trait bound is needed to avoid running into the auto-deref recursion
+// limit (error[E0055]), because `Bound<PyAny>` would deref into itself. See:
+// https://github.com/rust-lang/rust/issues/19509
+impl<'py, T> Deref for Bound<'py, T>
+where
+    T: DerefToPyAny,
+{
+    type Target = Bound<'py, PyAny>;
+
+    #[inline]
+    fn deref(&self) -> &Bound<'py, PyAny> {
+        self.as_any()
+    }
+}
+
+impl<'py, T> AsRef<Bound<'py, PyAny>> for Bound<'py, T> {
+    #[inline]
+    fn as_ref(&self) -> &Bound<'py, PyAny> {
+        self.as_any()
+    }
+}
+
+impl<T> Clone for Bound<'_, T> {
+    #[inline]
+    fn clone(&self) -> Self {
+        Self(self.0, ManuallyDrop::new(self.1.clone_ref(self.0)))
+    }
+}
+
+impl<T> Drop for Bound<'_, T> {
+    #[inline]
+    fn drop(&mut self) {
+        unsafe { ffi::Py_DECREF(self.as_ptr()) }
+    }
+}
+
+impl<'py, T> Bound<'py, T> {
+    /// Returns the GIL token associated with this object.
+    #[inline]
+    pub fn py(&self) -> Python<'py> {
+        self.0
+    }
+
+    /// Returns the raw FFI pointer represented by self.
+    ///
+    /// # Safety
+    ///
+    /// Callers are responsible for ensuring that the pointer does not outlive self.
+    ///
+    /// The reference is borrowed; callers should not decrease the reference count
+    /// when they are finished with the pointer.
+    #[inline]
+    pub fn as_ptr(&self) -> *mut ffi::PyObject {
+        self.1.as_ptr()
+    }
+
+    /// Returns an owned raw FFI pointer represented by self.
+    ///
+    /// # Safety
+    ///
+    /// The reference is owned; when finished the caller should either transfer ownership
+    /// of the pointer or decrease the reference count (e.g. with [`pyo3::ffi::Py_DecRef`](crate::ffi::Py_DecRef)).
+    #[inline]
+    pub fn into_ptr(self) -> *mut ffi::PyObject {
+        ManuallyDrop::new(self).as_ptr()
+    }
+
+    /// Helper to cast to `Bound<'py, PyAny>`.
+    #[inline]
+    pub fn as_any(&self) -> &Bound<'py, PyAny> {
+        // Safety: all Bound<T> have the same memory layout, and all Bound<T> are valid
+        // Bound<PyAny>, so pointer casting is valid.
+        unsafe { &*ptr_from_ref(self).cast::<Bound<'py, PyAny>>() }
+    }
+
+    /// Helper to cast to `Bound<'py, PyAny>`, transferring ownership.
+    #[inline]
+    pub fn into_any(self) -> Bound<'py, PyAny> {
+        // Safety: all Bound<T> are valid Bound<PyAny>
+        Bound(self.0, ManuallyDrop::new(self.unbind().into_any()))
+    }
+
+    /// Casts this `Bound<T>` to a `Borrowed<T>` smart pointer.
+    #[inline]
+    pub fn as_borrowed<'a>(&'a self) -> Borrowed<'a, 'py, T> {
+        Borrowed(
+            unsafe { NonNull::new_unchecked(self.as_ptr()) },
+            PhantomData,
+            self.py(),
+        )
+    }
+
+    /// Removes the connection for this `Bound<T>` from the GIL, allowing
+    /// it to cross thread boundaries.
+    #[inline]
+    pub fn unbind(self) -> Py<T> {
+        // Safety: the type T is known to be correct and the ownership of the
+        // pointer is transferred to the new Py<T> instance.
+        let non_null = (ManuallyDrop::new(self).1).0;
+        unsafe { Py::from_non_null(non_null) }
+    }
+
+    /// Removes the connection for this `Bound<T>` from the GIL, allowing
+    /// it to cross thread boundaries, without transferring ownership.
+    #[inline]
+    pub fn as_unbound(&self) -> &Py<T> {
+        &self.1
+    }
+
+    /// Casts this `Bound<T>` as the corresponding "GIL Ref" type.
+    ///
+    /// This is a helper to be used for migration from the deprecated "GIL Refs" API.
+    #[inline]
+    #[cfg(feature = "gil-refs")]
+    pub fn as_gil_ref(&'py self) -> &'py T::AsRefTarget
+    where
+        T: HasPyGilRef,
+    {
+        #[allow(deprecated)]
+        unsafe {
+            self.py().from_borrowed_ptr(self.as_ptr())
+        }
+    }
+
+    /// Casts this `Bound<T>` as the corresponding "GIL Ref" type, registering the pointer on the
+    /// [release pool](Python::from_owned_ptr).
+    ///
+    /// This is a helper to be used for migration from the deprecated "GIL Refs" API.
+    #[inline]
+    #[cfg(feature = "gil-refs")]
+    pub fn into_gil_ref(self) -> &'py T::AsRefTarget
+    where
+        T: HasPyGilRef,
+    {
+        #[allow(deprecated)]
+        unsafe {
+            self.py().from_owned_ptr(self.into_ptr())
+        }
+    }
+}
+
+unsafe impl<T> AsPyPointer for Bound<'_, T> {
+    #[inline]
+    fn as_ptr(&self) -> *mut ffi::PyObject {
+        self.1.as_ptr()
+    }
+}
+
+/// A borrowed equivalent to `Bound`.
+///
+/// The advantage of this over `&Bound` is that it avoids the need to have a pointer-to-pointer, as Bound
+/// is already a pointer to an `ffi::PyObject``.
+///
+/// Similarly, this type is `Copy` and `Clone`, like a shared reference (`&T`).
+#[repr(transparent)]
+pub struct Borrowed<'a, 'py, T>(NonNull<ffi::PyObject>, PhantomData<&'a Py<T>>, Python<'py>);
+
+impl<'py, T> Borrowed<'_, 'py, T> {
+    /// Creates a new owned [`Bound<T>`] from this borrowed reference by
+    /// increasing the reference count.
+    ///
+    /// # Example
+    /// ```
+    /// use pyo3::{prelude::*, types::PyTuple};
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let tuple = PyTuple::new_bound(py, [1, 2, 3]);
+    ///
+    ///     // borrows from `tuple`, so can only be
+    ///     // used while `tuple` stays alive
+    ///     let borrowed = tuple.get_borrowed_item(0)?;
+    ///
+    ///     // creates a new owned reference, which
+    ///     // can be used indendently of `tuple`
+    ///     let bound = borrowed.to_owned();
+    ///     drop(tuple);
+    ///
+    ///     assert_eq!(bound.extract::<i32>().unwrap(), 1);
+    ///     Ok(())
+    /// })
+    /// # }
+    pub fn to_owned(self) -> Bound<'py, T> {
+        (*self).clone()
+    }
+}
+
+impl<'a, 'py> Borrowed<'a, 'py, PyAny> {
+    /// Constructs a new `Borrowed<'a, 'py, PyAny>` from a pointer. Panics if `ptr` is null.
+    ///
+    /// Prefer to use [`Bound::from_borrowed_ptr`], as that avoids the major safety risk
+    /// of needing to precisely define the lifetime `'a` for which the borrow is valid.
+    ///
+    /// # Safety
+    ///
+    /// - `ptr` must be a valid pointer to a Python object
+    /// - similar to `std::slice::from_raw_parts`, the lifetime `'a` is completely defined by
+    ///   the caller and it is the caller's responsibility to ensure that the reference this is
+    ///   derived from is valid for the lifetime `'a`.
+    #[inline]
+    #[track_caller]
+    pub unsafe fn from_ptr(py: Python<'py>, ptr: *mut ffi::PyObject) -> Self {
+        Self(
+            NonNull::new(ptr).unwrap_or_else(|| crate::err::panic_after_error(py)),
+            PhantomData,
+            py,
+        )
+    }
+
+    /// Constructs a new `Borrowed<'a, 'py, PyAny>` from a pointer. Returns `None` if `ptr` is null.
+    ///
+    /// Prefer to use [`Bound::from_borrowed_ptr_or_opt`], as that avoids the major safety risk
+    /// of needing to precisely define the lifetime `'a` for which the borrow is valid.
+    ///
+    /// # Safety
+    ///
+    /// - `ptr` must be a valid pointer to a Python object, or null
+    /// - similar to `std::slice::from_raw_parts`, the lifetime `'a` is completely defined by
+    ///   the caller and it is the caller's responsibility to ensure that the reference this is
+    ///   derived from is valid for the lifetime `'a`.
+    #[inline]
+    pub unsafe fn from_ptr_or_opt(py: Python<'py>, ptr: *mut ffi::PyObject) -> Option<Self> {
+        NonNull::new(ptr).map(|ptr| Self(ptr, PhantomData, py))
+    }
+
+    /// Constructs a new `Borrowed<'a, 'py, PyAny>` from a pointer. Returns an `Err` by calling `PyErr::fetch`
+    /// if `ptr` is null.
+    ///
+    /// Prefer to use [`Bound::from_borrowed_ptr_or_err`], as that avoids the major safety risk
+    /// of needing to precisely define the lifetime `'a` for which the borrow is valid.
+    ///
+    /// # Safety
+    ///
+    /// - `ptr` must be a valid pointer to a Python object, or null
+    /// - similar to `std::slice::from_raw_parts`, the lifetime `'a` is completely defined by
+    ///   the caller and it is the caller's responsibility to ensure that the reference this is
+    ///   derived from is valid for the lifetime `'a`.
+    #[inline]
+    pub unsafe fn from_ptr_or_err(py: Python<'py>, ptr: *mut ffi::PyObject) -> PyResult<Self> {
+        NonNull::new(ptr).map_or_else(
+            || Err(PyErr::fetch(py)),
+            |ptr| Ok(Self(ptr, PhantomData, py)),
+        )
+    }
+
+    /// # Safety
+    /// This is similar to `std::slice::from_raw_parts`, the lifetime `'a` is completely defined by
+    /// the caller and it's the caller's responsibility to ensure that the reference this is
+    /// derived from is valid for the lifetime `'a`.
+    #[inline]
+    pub(crate) unsafe fn from_ptr_unchecked(py: Python<'py>, ptr: *mut ffi::PyObject) -> Self {
+        Self(NonNull::new_unchecked(ptr), PhantomData, py)
+    }
+
+    #[inline]
+    #[cfg(not(feature = "gil-refs"))]
+    pub(crate) fn downcast<T>(self) -> Result<Borrowed<'a, 'py, T>, DowncastError<'a, 'py>>
+    where
+        T: PyTypeCheck,
+    {
+        if T::type_check(&self) {
+            // Safety: type_check is responsible for ensuring that the type is correct
+            Ok(unsafe { self.downcast_unchecked() })
+        } else {
+            Err(DowncastError::new_from_borrowed(self, T::NAME))
+        }
+    }
+
+    /// Converts this `PyAny` to a concrete Python type without checking validity.
+    ///
+    /// # Safety
+    /// Callers must ensure that the type is valid or risk type confusion.
+    #[inline]
+    pub(crate) unsafe fn downcast_unchecked<T>(self) -> Borrowed<'a, 'py, T> {
+        Borrowed(self.0, PhantomData, self.2)
+    }
+}
+
+impl<'a, 'py, T> From<&'a Bound<'py, T>> for Borrowed<'a, 'py, T> {
+    /// Create borrow on a Bound
+    #[inline]
+    fn from(instance: &'a Bound<'py, T>) -> Self {
+        instance.as_borrowed()
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'py, T> Borrowed<'py, 'py, T>
+where
+    T: HasPyGilRef,
+{
+    pub(crate) fn into_gil_ref(self) -> &'py T::AsRefTarget {
+        // Safety: self is a borrow over `'py`.
+        #[allow(deprecated)]
+        unsafe {
+            self.py().from_borrowed_ptr(self.0.as_ptr())
+        }
+    }
+}
+
+impl<T> std::fmt::Debug for Borrowed<'_, '_, T> {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        Bound::fmt(self, f)
+    }
+}
+
+impl<'py, T> Deref for Borrowed<'_, 'py, T> {
+    type Target = Bound<'py, T>;
+
+    #[inline]
+    fn deref(&self) -> &Bound<'py, T> {
+        // safety: Bound has the same layout as NonNull<ffi::PyObject>
+        unsafe { &*ptr_from_ref(&self.0).cast() }
+    }
+}
+
+impl<T> Clone for Borrowed<'_, '_, T> {
+    #[inline]
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+impl<T> Copy for Borrowed<'_, '_, T> {}
+
+impl<T> ToPyObject for Borrowed<'_, '_, T> {
+    /// Converts `Py` instance -> PyObject.
+    #[inline]
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        (*self).into_py(py)
+    }
+}
+
+impl<T> IntoPy<PyObject> for Borrowed<'_, '_, T> {
+    /// Converts `Py` instance -> PyObject.
+    #[inline]
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_owned().into_py(py)
+    }
+}
+
+/// A GIL-independent reference to an object allocated on the Python heap.
+///
+/// This type does not auto-dereference to the inner object because you must prove you hold the GIL to access it.
+/// Instead, call one of its methods to access the inner object:
+///  - [`Py::bind`] or [`Py::into_bound`], to borrow a GIL-bound reference to the contained object.
+///  - [`Py::borrow`], [`Py::try_borrow`], [`Py::borrow_mut`], or [`Py::try_borrow_mut`],
+///
+/// to get a (mutable) reference to a contained pyclass, using a scheme similar to std's [`RefCell`].
+/// See the
+#[doc = concat!("[guide entry](https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/class.html#bound-and-interior-mutability)")]
+/// for more information.
+///  - You can call methods directly on `Py` with [`Py::call_bound`], [`Py::call_method_bound`] and friends.
+///
+/// These require passing in the [`Python<'py>`](crate::Python) token but are otherwise similar to the corresponding
+/// methods on [`PyAny`].
+///
+/// # Example: Storing Python objects in `#[pyclass]` structs
+///
+/// Usually `Bound<'py, T>` is recommended for interacting with Python objects as its lifetime `'py`
+/// is an association to the GIL and that enables many operations to be done as efficiently as possible.
+///
+/// However, `#[pyclass]` structs cannot carry a lifetime, so `Py<T>` is the only way to store
+/// a Python object in a `#[pyclass]` struct.
+///
+/// For example, this won't compile:
+///
+/// ```compile_fail
+/// # use pyo3::prelude::*;
+/// # use pyo3::types::PyDict;
+/// #
+/// #[pyclass]
+/// struct Foo<'py> {
+///     inner: Bound<'py, PyDict>,
+/// }
+///
+/// impl Foo {
+///     fn new() -> Foo {
+///         let foo = Python::with_gil(|py| {
+///             // `py` will only last for this scope.
+///
+///             // `Bound<'py, PyDict>` inherits the GIL lifetime from `py` and
+///             // so won't be able to outlive this closure.
+///             let dict: Bound<'_, PyDict> = PyDict::new_bound(py);
+///
+///             // because `Foo` contains `dict` its lifetime
+///             // is now also tied to `py`.
+///             Foo { inner: dict }
+///         });
+///         // Foo is no longer valid.
+///         // Returning it from this function is a 💥 compiler error 💥
+///         foo
+///     }
+/// }
+/// ```
+///
+/// [`Py`]`<T>` can be used to get around this by converting `dict` into a GIL-independent reference:
+///
+/// ```rust
+/// use pyo3::prelude::*;
+/// use pyo3::types::PyDict;
+///
+/// #[pyclass]
+/// struct Foo {
+///     inner: Py<PyDict>,
+/// }
+///
+/// #[pymethods]
+/// impl Foo {
+///     #[new]
+///     fn __new__() -> Foo {
+///         Python::with_gil(|py| {
+///             let dict: Py<PyDict> = PyDict::new_bound(py).unbind();
+///             Foo { inner: dict }
+///         })
+///     }
+/// }
+/// #
+/// # fn main() -> PyResult<()> {
+/// #     Python::with_gil(|py| {
+/// #         let m = pyo3::types::PyModule::new_bound(py, "test")?;
+/// #         m.add_class::<Foo>()?;
+/// #
+/// #         let foo: Bound<'_, Foo> = m.getattr("Foo")?.call0()?.downcast_into()?;
+/// #         let dict = &foo.borrow().inner;
+/// #         let dict: &Bound<'_, PyDict> = dict.bind(py);
+/// #
+/// #         Ok(())
+/// #     })
+/// # }
+/// ```
+///
+/// This can also be done with other pyclasses:
+/// ```rust
+/// use pyo3::prelude::*;
+///
+/// #[pyclass]
+/// struct Bar {/* ... */}
+///
+/// #[pyclass]
+/// struct Foo {
+///     inner: Py<Bar>,
+/// }
+///
+/// #[pymethods]
+/// impl Foo {
+///     #[new]
+///     fn __new__() -> PyResult<Foo> {
+///         Python::with_gil(|py| {
+///             let bar: Py<Bar> = Py::new(py, Bar {})?;
+///             Ok(Foo { inner: bar })
+///         })
+///     }
+/// }
+/// #
+/// # fn main() -> PyResult<()> {
+/// #     Python::with_gil(|py| {
+/// #         let m = pyo3::types::PyModule::new_bound(py, "test")?;
+/// #         m.add_class::<Foo>()?;
+/// #
+/// #         let foo: Bound<'_, Foo> = m.getattr("Foo")?.call0()?.downcast_into()?;
+/// #         let bar = &foo.borrow().inner;
+/// #         let bar: &Bar = &*bar.borrow(py);
+/// #
+/// #         Ok(())
+/// #     })
+/// # }
+/// ```
+///
+/// # Example: Shared ownership of Python objects
+///
+/// `Py<T>` can be used to share ownership of a Python object, similar to std's [`Rc`]`<T>`.
+/// As with [`Rc`]`<T>`, cloning it increases its reference count rather than duplicating
+/// the underlying object.
+///
+/// This can be done using either [`Py::clone_ref`] or [`Py`]`<T>`'s [`Clone`] trait implementation.
+/// [`Py::clone_ref`] will be faster if you happen to be already holding the GIL.
+///
+/// ```rust
+/// use pyo3::prelude::*;
+/// use pyo3::types::PyDict;
+///
+/// # fn main() {
+/// Python::with_gil(|py| {
+///     let first: Py<PyDict> = PyDict::new_bound(py).unbind();
+///
+///     // All of these are valid syntax
+///     let second = Py::clone_ref(&first, py);
+///     let third = first.clone_ref(py);
+///     #[cfg(feature = "py-clone")]
+///     let fourth = Py::clone(&first);
+///     #[cfg(feature = "py-clone")]
+///     let fifth = first.clone();
+///
+///     // Disposing of our original `Py<PyDict>` just decrements the reference count.
+///     drop(first);
+///
+///     // They all point to the same object
+///     assert!(second.is(&third));
+///     #[cfg(feature = "py-clone")]
+///     assert!(fourth.is(&fifth));
+///     #[cfg(feature = "py-clone")]
+///     assert!(second.is(&fourth));
+/// });
+/// # }
+/// ```
+///
+/// # Preventing reference cycles
+///
+/// It is easy to accidentally create reference cycles using [`Py`]`<T>`.
+/// The Python interpreter can break these reference cycles within pyclasses if they
+/// [integrate with the garbage collector][gc]. If your pyclass contains other Python
+/// objects you should implement it to avoid leaking memory.
+///
+/// # A note on Python reference counts
+///
+/// Dropping a [`Py`]`<T>` will eventually decrease Python's reference count
+/// of the pointed-to variable, allowing Python's garbage collector to free
+/// the associated memory, but this may not happen immediately.  This is
+/// because a [`Py`]`<T>` can be dropped at any time, but the Python reference
+/// count can only be modified when the GIL is held.
+///
+/// If a [`Py`]`<T>` is dropped while its thread happens to be holding the
+/// GIL then the Python reference count will be decreased immediately.
+/// Otherwise, the reference count will be decreased the next time the GIL is
+/// reacquired.
+///
+/// If you happen to be already holding the GIL, [`Py::drop_ref`] will decrease
+/// the Python reference count immediately and will execute slightly faster than
+/// relying on implicit [`Drop`]s.
+///
+/// # A note on `Send` and `Sync`
+///
+/// Accessing this object is threadsafe, since any access to its API requires a [`Python<'py>`](crate::Python) token.
+/// As you can only get this by acquiring the GIL, `Py<...>` implements [`Send`] and [`Sync`].
+///
+/// [`Rc`]: std::rc::Rc
+/// [`RefCell`]: std::cell::RefCell
+/// [gc]: https://pyo3.rs/main/class/protocols.html#garbage-collector-integration
+#[repr(transparent)]
+pub struct Py<T>(NonNull<ffi::PyObject>, PhantomData<T>);
+
+// The inner value is only accessed through ways that require proving the gil is held
+#[cfg(feature = "nightly")]
+unsafe impl<T> crate::marker::Ungil for Py<T> {}
+unsafe impl<T> Send for Py<T> {}
+unsafe impl<T> Sync for Py<T> {}
+
+impl<T> Py<T>
+where
+    T: PyClass,
+{
+    /// Creates a new instance `Py<T>` of a `#[pyclass]` on the Python heap.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// #[pyclass]
+    /// struct Foo {/* fields omitted */}
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// let foo = Python::with_gil(|py| -> PyResult<_> {
+    ///     let foo: Py<Foo> = Py::new(py, Foo {})?;
+    ///     Ok(foo)
+    /// })?;
+    /// # Python::with_gil(move |_py| drop(foo));
+    /// # Ok(())
+    /// # }
+    /// ```
+    pub fn new(py: Python<'_>, value: impl Into<PyClassInitializer<T>>) -> PyResult<Py<T>> {
+        Bound::new(py, value).map(Bound::unbind)
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<T> Py<T>
+where
+    T: HasPyGilRef,
+{
+    /// Borrows a GIL-bound reference to the contained `T`.
+    ///
+    /// By binding to the GIL lifetime, this allows the GIL-bound reference to not require
+    /// [`Python<'py>`](crate::Python) for any of its methods, which makes calling methods
+    /// on it more ergonomic.
+    ///
+    /// For native types, this reference is `&T`. For pyclasses, this is `&PyCell<T>`.
+    ///
+    /// Note that the lifetime of the returned reference is the shortest of `&self` and
+    /// [`Python<'py>`](crate::Python).
+    /// Consider using [`Py::into_ref`] instead if this poses a problem.
+    ///
+    /// # Examples
+    ///
+    /// Get access to `&PyList` from `Py<PyList>`:
+    ///
+    /// ```
+    /// # use pyo3::prelude::*;
+    /// # use pyo3::types::PyList;
+    /// #
+    /// Python::with_gil(|py| {
+    ///     let list: Py<PyList> = PyList::empty_bound(py).into();
+    ///     # #[allow(deprecated)]
+    ///     let list: &PyList = list.as_ref(py);
+    ///     assert_eq!(list.len(), 0);
+    /// });
+    /// ```
+    ///
+    /// Get access to `&PyCell<MyClass>` from `Py<MyClass>`:
+    ///
+    /// ```
+    /// # use pyo3::prelude::*;
+    /// #
+    /// #[pyclass]
+    /// struct MyClass {}
+    ///
+    /// Python::with_gil(|py| {
+    ///     let my_class: Py<MyClass> = Py::new(py, MyClass {}).unwrap();
+    ///     # #[allow(deprecated)]
+    ///     let my_class_cell: &PyCell<MyClass> = my_class.as_ref(py);
+    ///     assert!(my_class_cell.try_borrow().is_ok());
+    /// });
+    /// ```
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `obj.bind(py)` instead of `obj.as_ref(py)`"
+    )]
+    pub fn as_ref<'py>(&'py self, _py: Python<'py>) -> &'py T::AsRefTarget {
+        let any = self.as_ptr() as *const PyAny;
+        unsafe { PyNativeType::unchecked_downcast(&*any) }
+    }
+
+    /// Borrows a GIL-bound reference to the contained `T` independently of the lifetime of `T`.
+    ///
+    /// This method is similar to [`as_ref`](#method.as_ref) but consumes `self` and registers the
+    /// Python object reference in PyO3's object storage. The reference count for the Python
+    /// object will not be decreased until the GIL lifetime ends.
+    ///
+    /// You should prefer using [`as_ref`](#method.as_ref) if you can as it'll have less overhead.
+    ///
+    /// # Examples
+    ///
+    /// [`Py::as_ref`]'s lifetime limitation forbids creating a function that references a
+    /// variable created inside the function.
+    ///
+    /// ```rust,compile_fail
+    /// # use pyo3::prelude::*;
+    /// #
+    /// fn new_py_any<'py>(py: Python<'py>, value: impl IntoPy<Py<PyAny>>) -> &'py PyAny {
+    ///     let obj: Py<PyAny> = value.into_py(py);
+    ///
+    ///     // The lifetime of the return value of this function is the shortest
+    ///     // of `obj` and `py`. As `obj` is owned by the current function,
+    ///     // Rust won't let the return value escape this function!
+    ///     obj.as_ref(py)
+    /// }
+    /// ```
+    ///
+    /// This can be solved by using [`Py::into_ref`] instead, which does not suffer from this issue.
+    /// Note that the lifetime of the [`Python<'py>`](crate::Python) token is transferred to
+    /// the returned reference.
+    ///
+    /// ```rust
+    /// # use pyo3::prelude::*;
+    /// # #[allow(dead_code)] // This is just to show it compiles.
+    /// fn new_py_any<'py>(py: Python<'py>, value: impl IntoPy<Py<PyAny>>) -> &'py PyAny {
+    ///     let obj: Py<PyAny> = value.into_py(py);
+    ///
+    ///     // This reference's lifetime is determined by `py`'s lifetime.
+    ///     // Because that originates from outside this function,
+    ///     // this return value is allowed.
+    ///     # #[allow(deprecated)]
+    ///     obj.into_ref(py)
+    /// }
+    /// ```
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `obj.into_bound(py)` instead of `obj.into_ref(py)`"
+    )]
+    pub fn into_ref(self, py: Python<'_>) -> &T::AsRefTarget {
+        #[allow(deprecated)]
+        unsafe {
+            py.from_owned_ptr(self.into_ptr())
+        }
+    }
+}
+
+impl<T> Py<T> {
+    /// Returns the raw FFI pointer represented by self.
+    ///
+    /// # Safety
+    ///
+    /// Callers are responsible for ensuring that the pointer does not outlive self.
+    ///
+    /// The reference is borrowed; callers should not decrease the reference count
+    /// when they are finished with the pointer.
+    #[inline]
+    pub fn as_ptr(&self) -> *mut ffi::PyObject {
+        self.0.as_ptr()
+    }
+
+    /// Returns an owned raw FFI pointer represented by self.
+    ///
+    /// # Safety
+    ///
+    /// The reference is owned; when finished the caller should either transfer ownership
+    /// of the pointer or decrease the reference count (e.g. with [`pyo3::ffi::Py_DecRef`](crate::ffi::Py_DecRef)).
+    #[inline]
+    pub fn into_ptr(self) -> *mut ffi::PyObject {
+        ManuallyDrop::new(self).0.as_ptr()
+    }
+
+    /// Helper to cast to `Py<PyAny>`.
+    #[inline]
+    pub fn as_any(&self) -> &Py<PyAny> {
+        // Safety: all Py<T> have the same memory layout, and all Py<T> are valid
+        // Py<PyAny>, so pointer casting is valid.
+        unsafe { &*ptr_from_ref(self).cast::<Py<PyAny>>() }
+    }
+
+    /// Helper to cast to `Py<PyAny>`, transferring ownership.
+    #[inline]
+    pub fn into_any(self) -> Py<PyAny> {
+        // Safety: all Py<T> are valid Py<PyAny>
+        unsafe { Py::from_non_null(ManuallyDrop::new(self).0) }
+    }
+}
+
+impl<T> Py<T>
+where
+    T: PyClass,
+{
+    /// Immutably borrows the value `T`.
+    ///
+    /// This borrow lasts while the returned [`PyRef`] exists.
+    /// Multiple immutable borrows can be taken out at the same time.
+    ///
+    /// For frozen classes, the simpler [`get`][Self::get] is available.
+    ///
+    /// Equivalent to `self.bind(py).borrow()` - see [`Bound::borrow`].
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// # use pyo3::prelude::*;
+    /// #
+    /// #[pyclass]
+    /// struct Foo {
+    ///     inner: u8,
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let foo: Py<Foo> = Py::new(py, Foo { inner: 73 })?;
+    ///     let inner: &u8 = &foo.borrow(py).inner;
+    ///
+    ///     assert_eq!(*inner, 73);
+    ///     Ok(())
+    /// })?;
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    ///
+    /// Panics if the value is currently mutably borrowed. For a non-panicking variant, use
+    /// [`try_borrow`](#method.try_borrow).
+    #[inline]
+    #[track_caller]
+    pub fn borrow<'py>(&'py self, py: Python<'py>) -> PyRef<'py, T> {
+        self.bind(py).borrow()
+    }
+
+    /// Mutably borrows the value `T`.
+    ///
+    /// This borrow lasts while the returned [`PyRefMut`] exists.
+    ///
+    /// Equivalent to `self.bind(py).borrow_mut()` - see [`Bound::borrow_mut`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # use pyo3::prelude::*;
+    /// #
+    /// #[pyclass]
+    /// struct Foo {
+    ///     inner: u8,
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let foo: Py<Foo> = Py::new(py, Foo { inner: 73 })?;
+    ///     foo.borrow_mut(py).inner = 35;
+    ///
+    ///     assert_eq!(foo.borrow(py).inner, 35);
+    ///     Ok(())
+    /// })?;
+    /// # Ok(())
+    /// # }
+    ///  ```
+    ///
+    /// # Panics
+    /// Panics if the value is currently borrowed. For a non-panicking variant, use
+    /// [`try_borrow_mut`](#method.try_borrow_mut).
+    #[inline]
+    #[track_caller]
+    pub fn borrow_mut<'py>(&'py self, py: Python<'py>) -> PyRefMut<'py, T>
+    where
+        T: PyClass<Frozen = False>,
+    {
+        self.bind(py).borrow_mut()
+    }
+
+    /// Attempts to immutably borrow the value `T`, returning an error if the value is currently mutably borrowed.
+    ///
+    /// The borrow lasts while the returned [`PyRef`] exists.
+    ///
+    /// This is the non-panicking variant of [`borrow`](#method.borrow).
+    ///
+    /// For frozen classes, the simpler [`get`][Self::get] is available.
+    ///
+    /// Equivalent to `self.bind(py).try_borrow()` - see [`Bound::try_borrow`].
+    #[inline]
+    pub fn try_borrow<'py>(&'py self, py: Python<'py>) -> Result<PyRef<'py, T>, PyBorrowError> {
+        self.bind(py).try_borrow()
+    }
+
+    /// Attempts to mutably borrow the value `T`, returning an error if the value is currently borrowed.
+    ///
+    /// The borrow lasts while the returned [`PyRefMut`] exists.
+    ///
+    /// This is the non-panicking variant of [`borrow_mut`](#method.borrow_mut).
+    ///
+    /// Equivalent to `self.bind(py).try_borrow_mut()` - see [`Bound::try_borrow_mut`].
+    #[inline]
+    pub fn try_borrow_mut<'py>(
+        &'py self,
+        py: Python<'py>,
+    ) -> Result<PyRefMut<'py, T>, PyBorrowMutError>
+    where
+        T: PyClass<Frozen = False>,
+    {
+        self.bind(py).try_borrow_mut()
+    }
+
+    /// Provide an immutable borrow of the value `T` without acquiring the GIL.
+    ///
+    /// This is available if the class is [`frozen`][macro@crate::pyclass] and [`Sync`].
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::sync::atomic::{AtomicUsize, Ordering};
+    /// # use pyo3::prelude::*;
+    ///
+    /// #[pyclass(frozen)]
+    /// struct FrozenCounter {
+    ///     value: AtomicUsize,
+    /// }
+    ///
+    /// let cell  = Python::with_gil(|py| {
+    ///     let counter = FrozenCounter { value: AtomicUsize::new(0) };
+    ///
+    ///     Py::new(py, counter).unwrap()
+    /// });
+    ///
+    /// cell.get().value.fetch_add(1, Ordering::Relaxed);
+    /// # Python::with_gil(move |_py| drop(cell));
+    /// ```
+    #[inline]
+    pub fn get(&self) -> &T
+    where
+        T: PyClass<Frozen = True> + Sync,
+    {
+        // Safety: The class itself is frozen and `Sync`
+        unsafe { &*self.get_class_object().get_ptr() }
+    }
+
+    /// Get a view on the underlying `PyClass` contents.
+    #[inline]
+    pub(crate) fn get_class_object(&self) -> &PyClassObject<T> {
+        let class_object = self.as_ptr().cast::<PyClassObject<T>>();
+        // Safety: Bound<T: PyClass> is known to contain an object which is laid out in memory as a
+        // PyClassObject<T>.
+        unsafe { &*class_object }
+    }
+}
+
+impl<T> Py<T> {
+    /// Attaches this `Py` to the given Python context, allowing access to further Python APIs.
+    #[inline]
+    pub fn bind<'py>(&self, _py: Python<'py>) -> &Bound<'py, T> {
+        // Safety: `Bound` has the same layout as `Py`
+        unsafe { &*ptr_from_ref(self).cast() }
+    }
+
+    /// Same as `bind` but takes ownership of `self`.
+    #[inline]
+    pub fn into_bound(self, py: Python<'_>) -> Bound<'_, T> {
+        Bound(py, ManuallyDrop::new(self))
+    }
+
+    /// Same as `bind` but produces a `Borrowed<T>` instead of a `Bound<T>`.
+    #[inline]
+    pub fn bind_borrowed<'a, 'py>(&'a self, py: Python<'py>) -> Borrowed<'a, 'py, T> {
+        Borrowed(self.0, PhantomData, py)
+    }
+
+    /// Returns whether `self` and `other` point to the same object. To compare
+    /// the equality of two objects (the `==` operator), use [`eq`](PyAnyMethods::eq).
+    ///
+    /// This is equivalent to the Python expression `self is other`.
+    #[inline]
+    pub fn is<U: AsPyPointer>(&self, o: &U) -> bool {
+        self.as_ptr() == o.as_ptr()
+    }
+
+    /// Gets the reference count of the `ffi::PyObject` pointer.
+    #[inline]
+    pub fn get_refcnt(&self, _py: Python<'_>) -> isize {
+        unsafe { ffi::Py_REFCNT(self.0.as_ptr()) }
+    }
+
+    /// Makes a clone of `self`.
+    ///
+    /// This creates another pointer to the same object, increasing its reference count.
+    ///
+    /// You should prefer using this method over [`Clone`] if you happen to be holding the GIL already.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyDict;
+    ///
+    /// # fn main() {
+    /// Python::with_gil(|py| {
+    ///     let first: Py<PyDict> = PyDict::new_bound(py).unbind();
+    ///     let second = Py::clone_ref(&first, py);
+    ///
+    ///     // Both point to the same object
+    ///     assert!(first.is(&second));
+    /// });
+    /// # }
+    /// ```
+    #[inline]
+    pub fn clone_ref(&self, _py: Python<'_>) -> Py<T> {
+        unsafe {
+            ffi::Py_INCREF(self.as_ptr());
+            Self::from_non_null(self.0)
+        }
+    }
+
+    /// Drops `self` and immediately decreases its reference count.
+    ///
+    /// This method is a micro-optimisation over [`Drop`] if you happen to be holding the GIL
+    /// already.
+    ///
+    /// Note that if you are using [`Bound`], you do not need to use [`Self::drop_ref`] since
+    /// [`Bound`] guarantees that the GIL is held.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyDict;
+    ///
+    /// # fn main() {
+    /// Python::with_gil(|py| {
+    ///     let object: Py<PyDict> = PyDict::new_bound(py).unbind();
+    ///
+    ///     // some usage of object
+    ///
+    ///     object.drop_ref(py);
+    /// });
+    /// # }
+    /// ```
+    #[inline]
+    pub fn drop_ref(self, py: Python<'_>) {
+        let _ = self.into_bound(py);
+    }
+
+    /// Returns whether the object is considered to be None.
+    ///
+    /// This is equivalent to the Python expression `self is None`.
+    pub fn is_none(&self, _py: Python<'_>) -> bool {
+        unsafe { ffi::Py_None() == self.as_ptr() }
+    }
+
+    /// Returns whether the object is Ellipsis, e.g. `...`.
+    ///
+    /// This is equivalent to the Python expression `self is ...`.
+    #[deprecated(since = "0.20.0", note = "use `.is(py.Ellipsis())` instead")]
+    pub fn is_ellipsis(&self) -> bool {
+        unsafe { ffi::Py_Ellipsis() == self.as_ptr() }
+    }
+
+    /// Returns whether the object is considered to be true.
+    ///
+    /// This is equivalent to the Python expression `bool(self)`.
+    #[deprecated(since = "0.21.0", note = "use `.is_truthy()` instead")]
+    pub fn is_true(&self, py: Python<'_>) -> PyResult<bool> {
+        self.is_truthy(py)
+    }
+
+    /// Returns whether the object is considered to be true.
+    ///
+    /// This applies truth value testing equivalent to the Python expression `bool(self)`.
+    pub fn is_truthy(&self, py: Python<'_>) -> PyResult<bool> {
+        let v = unsafe { ffi::PyObject_IsTrue(self.as_ptr()) };
+        err::error_on_minusone(py, v)?;
+        Ok(v != 0)
+    }
+
+    /// Extracts some type from the Python object.
+    ///
+    /// This is a wrapper function around `FromPyObject::extract()`.
+    pub fn extract<'a, 'py, D>(&'a self, py: Python<'py>) -> PyResult<D>
+    where
+        D: crate::conversion::FromPyObjectBound<'a, 'py>,
+        // TODO it might be possible to relax this bound in future, to allow
+        // e.g. `.extract::<&str>(py)` where `py` is short-lived.
+        'py: 'a,
+    {
+        self.bind(py).as_any().extract()
+    }
+
+    /// Retrieves an attribute value.
+    ///
+    /// This is equivalent to the Python expression `self.attr_name`.
+    ///
+    /// If calling this method becomes performance-critical, the [`intern!`](crate::intern) macro
+    /// can be used to intern `attr_name`, thereby avoiding repeated temporary allocations of
+    /// Python strings.
+    ///
+    /// # Example: `intern!`ing the attribute name
+    ///
+    /// ```
+    /// # use pyo3::{prelude::*, intern};
+    /// #
+    /// #[pyfunction]
+    /// fn version(sys: Py<PyModule>, py: Python<'_>) -> PyResult<PyObject> {
+    ///     sys.getattr(py, intern!(py, "version"))
+    /// }
+    /// #
+    /// # Python::with_gil(|py| {
+    /// #    let sys = py.import_bound("sys").unwrap().unbind();
+    /// #    version(sys, py).unwrap();
+    /// # });
+    /// ```
+    pub fn getattr<N>(&self, py: Python<'_>, attr_name: N) -> PyResult<PyObject>
+    where
+        N: IntoPy<Py<PyString>>,
+    {
+        self.bind(py).as_any().getattr(attr_name).map(Bound::unbind)
+    }
+
+    /// Sets an attribute value.
+    ///
+    /// This is equivalent to the Python expression `self.attr_name = value`.
+    ///
+    /// To avoid repeated temporary allocations of Python strings, the [`intern!`](crate::intern)
+    /// macro can be used to intern `attr_name`.
+    ///
+    /// # Example: `intern!`ing the attribute name
+    ///
+    /// ```
+    /// # use pyo3::{intern, pyfunction, types::PyModule, IntoPy, PyObject, Python, PyResult};
+    /// #
+    /// #[pyfunction]
+    /// fn set_answer(ob: PyObject, py: Python<'_>) -> PyResult<()> {
+    ///     ob.setattr(py, intern!(py, "answer"), 42)
+    /// }
+    /// #
+    /// # Python::with_gil(|py| {
+    /// #    let ob = PyModule::new_bound(py, "empty").unwrap().into_py(py);
+    /// #    set_answer(ob, py).unwrap();
+    /// # });
+    /// ```
+    pub fn setattr<N, V>(&self, py: Python<'_>, attr_name: N, value: V) -> PyResult<()>
+    where
+        N: IntoPy<Py<PyString>>,
+        V: IntoPy<Py<PyAny>>,
+    {
+        self.bind(py)
+            .as_any()
+            .setattr(attr_name, value.into_py(py).into_bound(py))
+    }
+
+    /// Deprecated form of [`call_bound`][Py::call_bound].
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`call` will be replaced by `call_bound` in a future PyO3 version"
+    )]
+    #[inline]
+    pub fn call<A>(&self, py: Python<'_>, args: A, kwargs: Option<&PyDict>) -> PyResult<PyObject>
+    where
+        A: IntoPy<Py<PyTuple>>,
+    {
+        self.call_bound(py, args, kwargs.map(PyDict::as_borrowed).as_deref())
+    }
+
+    /// Calls the object.
+    ///
+    /// This is equivalent to the Python expression `self(*args, **kwargs)`.
+    pub fn call_bound(
+        &self,
+        py: Python<'_>,
+        args: impl IntoPy<Py<PyTuple>>,
+        kwargs: Option<&Bound<'_, PyDict>>,
+    ) -> PyResult<PyObject> {
+        self.bind(py).as_any().call(args, kwargs).map(Bound::unbind)
+    }
+
+    /// Calls the object with only positional arguments.
+    ///
+    /// This is equivalent to the Python expression `self(*args)`.
+    pub fn call1(&self, py: Python<'_>, args: impl IntoPy<Py<PyTuple>>) -> PyResult<PyObject> {
+        self.bind(py).as_any().call1(args).map(Bound::unbind)
+    }
+
+    /// Calls the object without arguments.
+    ///
+    /// This is equivalent to the Python expression `self()`.
+    pub fn call0(&self, py: Python<'_>) -> PyResult<PyObject> {
+        self.bind(py).as_any().call0().map(Bound::unbind)
+    }
+
+    /// Deprecated form of [`call_method_bound`][Py::call_method_bound].
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`call_method` will be replaced by `call_method_bound` in a future PyO3 version"
+    )]
+    #[inline]
+    pub fn call_method<N, A>(
+        &self,
+        py: Python<'_>,
+        name: N,
+        args: A,
+        kwargs: Option<&PyDict>,
+    ) -> PyResult<PyObject>
+    where
+        N: IntoPy<Py<PyString>>,
+        A: IntoPy<Py<PyTuple>>,
+    {
+        self.call_method_bound(py, name, args, kwargs.map(PyDict::as_borrowed).as_deref())
+    }
+
+    /// Calls a method on the object.
+    ///
+    /// This is equivalent to the Python expression `self.name(*args, **kwargs)`.
+    ///
+    /// To avoid repeated temporary allocations of Python strings, the [`intern!`](crate::intern)
+    /// macro can be used to intern `name`.
+    pub fn call_method_bound<N, A>(
+        &self,
+        py: Python<'_>,
+        name: N,
+        args: A,
+        kwargs: Option<&Bound<'_, PyDict>>,
+    ) -> PyResult<PyObject>
+    where
+        N: IntoPy<Py<PyString>>,
+        A: IntoPy<Py<PyTuple>>,
+    {
+        self.bind(py)
+            .as_any()
+            .call_method(name, args, kwargs)
+            .map(Bound::unbind)
+    }
+
+    /// Calls a method on the object with only positional arguments.
+    ///
+    /// This is equivalent to the Python expression `self.name(*args)`.
+    ///
+    /// To avoid repeated temporary allocations of Python strings, the [`intern!`](crate::intern)
+    /// macro can be used to intern `name`.
+    pub fn call_method1<N, A>(&self, py: Python<'_>, name: N, args: A) -> PyResult<PyObject>
+    where
+        N: IntoPy<Py<PyString>>,
+        A: IntoPy<Py<PyTuple>>,
+    {
+        self.bind(py)
+            .as_any()
+            .call_method1(name, args)
+            .map(Bound::unbind)
+    }
+
+    /// Calls a method on the object with no arguments.
+    ///
+    /// This is equivalent to the Python expression `self.name()`.
+    ///
+    /// To avoid repeated temporary allocations of Python strings, the [`intern!`](crate::intern)
+    /// macro can be used to intern `name`.
+    pub fn call_method0<N>(&self, py: Python<'_>, name: N) -> PyResult<PyObject>
+    where
+        N: IntoPy<Py<PyString>>,
+    {
+        self.bind(py).as_any().call_method0(name).map(Bound::unbind)
+    }
+
+    /// Create a `Py<T>` instance by taking ownership of the given FFI pointer.
+    ///
+    /// # Safety
+    /// `ptr` must be a pointer to a Python object of type T.
+    ///
+    /// Callers must own the object referred to by `ptr`, as this function
+    /// implicitly takes ownership of that object.
+    ///
+    /// # Panics
+    /// Panics if `ptr` is null.
+    #[inline]
+    #[track_caller]
+    pub unsafe fn from_owned_ptr(py: Python<'_>, ptr: *mut ffi::PyObject) -> Py<T> {
+        match NonNull::new(ptr) {
+            Some(nonnull_ptr) => Py(nonnull_ptr, PhantomData),
+            None => crate::err::panic_after_error(py),
+        }
+    }
+
+    /// Create a `Py<T>` instance by taking ownership of the given FFI pointer.
+    ///
+    /// If `ptr` is null then the current Python exception is fetched as a [`PyErr`].
+    ///
+    /// # Safety
+    /// If non-null, `ptr` must be a pointer to a Python object of type T.
+    #[inline]
+    pub unsafe fn from_owned_ptr_or_err(
+        py: Python<'_>,
+        ptr: *mut ffi::PyObject,
+    ) -> PyResult<Py<T>> {
+        match NonNull::new(ptr) {
+            Some(nonnull_ptr) => Ok(Py(nonnull_ptr, PhantomData)),
+            None => Err(PyErr::fetch(py)),
+        }
+    }
+
+    /// Create a `Py<T>` instance by taking ownership of the given FFI pointer.
+    ///
+    /// If `ptr` is null then `None` is returned.
+    ///
+    /// # Safety
+    /// If non-null, `ptr` must be a pointer to a Python object of type T.
+    #[inline]
+    pub unsafe fn from_owned_ptr_or_opt(_py: Python<'_>, ptr: *mut ffi::PyObject) -> Option<Self> {
+        NonNull::new(ptr).map(|nonnull_ptr| Py(nonnull_ptr, PhantomData))
+    }
+
+    /// Create a `Py<T>` instance by creating a new reference from the given FFI pointer.
+    ///
+    /// # Safety
+    /// `ptr` must be a pointer to a Python object of type T.
+    ///
+    /// # Panics
+    /// Panics if `ptr` is null.
+    #[inline]
+    #[track_caller]
+    pub unsafe fn from_borrowed_ptr(py: Python<'_>, ptr: *mut ffi::PyObject) -> Py<T> {
+        match Self::from_borrowed_ptr_or_opt(py, ptr) {
+            Some(slf) => slf,
+            None => crate::err::panic_after_error(py),
+        }
+    }
+
+    /// Create a `Py<T>` instance by creating a new reference from the given FFI pointer.
+    ///
+    /// If `ptr` is null then the current Python exception is fetched as a `PyErr`.
+    ///
+    /// # Safety
+    /// `ptr` must be a pointer to a Python object of type T.
+    #[inline]
+    pub unsafe fn from_borrowed_ptr_or_err(
+        py: Python<'_>,
+        ptr: *mut ffi::PyObject,
+    ) -> PyResult<Self> {
+        Self::from_borrowed_ptr_or_opt(py, ptr).ok_or_else(|| PyErr::fetch(py))
+    }
+
+    /// Create a `Py<T>` instance by creating a new reference from the given FFI pointer.
+    ///
+    /// If `ptr` is null then `None` is returned.
+    ///
+    /// # Safety
+    /// `ptr` must be a pointer to a Python object of type T.
+    #[inline]
+    pub unsafe fn from_borrowed_ptr_or_opt(
+        _py: Python<'_>,
+        ptr: *mut ffi::PyObject,
+    ) -> Option<Self> {
+        NonNull::new(ptr).map(|nonnull_ptr| {
+            ffi::Py_INCREF(ptr);
+            Py(nonnull_ptr, PhantomData)
+        })
+    }
+
+    /// For internal conversions.
+    ///
+    /// # Safety
+    /// `ptr` must point to a Python object of type T.
+    unsafe fn from_non_null(ptr: NonNull<ffi::PyObject>) -> Self {
+        Self(ptr, PhantomData)
+    }
+}
+
+impl<T> ToPyObject for Py<T> {
+    /// Converts `Py` instance -> PyObject.
+    #[inline]
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        self.clone_ref(py).into_any()
+    }
+}
+
+impl<T> IntoPy<PyObject> for Py<T> {
+    /// Converts a `Py` instance to `PyObject`.
+    /// Consumes `self` without calling `Py_DECREF()`.
+    #[inline]
+    fn into_py(self, _py: Python<'_>) -> PyObject {
+        self.into_any()
+    }
+}
+
+impl<T> IntoPy<PyObject> for &'_ Py<T> {
+    #[inline]
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_object(py)
+    }
+}
+
+impl<T> ToPyObject for Bound<'_, T> {
+    /// Converts `&Bound` instance -> PyObject, increasing the reference count.
+    #[inline]
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        self.clone().into_py(py)
+    }
+}
+
+impl<T> IntoPy<PyObject> for Bound<'_, T> {
+    /// Converts a `Bound` instance to `PyObject`.
+    #[inline]
+    fn into_py(self, _py: Python<'_>) -> PyObject {
+        self.into_any().unbind()
+    }
+}
+
+impl<T> IntoPy<PyObject> for &Bound<'_, T> {
+    /// Converts `&Bound` instance -> PyObject, increasing the reference count.
+    #[inline]
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.to_object(py)
+    }
+}
+
+unsafe impl<T> crate::AsPyPointer for Py<T> {
+    /// Gets the underlying FFI pointer, returns a borrowed pointer.
+    #[inline]
+    fn as_ptr(&self) -> *mut ffi::PyObject {
+        self.0.as_ptr()
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<T> std::convert::From<&'_ T> for PyObject
+where
+    T: PyNativeType,
+{
+    #[inline]
+    fn from(obj: &T) -> Self {
+        obj.as_borrowed().to_owned().into_any().unbind()
+    }
+}
+
+impl<T> std::convert::From<Py<T>> for PyObject
+where
+    T: AsRef<PyAny>,
+{
+    #[inline]
+    fn from(other: Py<T>) -> Self {
+        other.into_any()
+    }
+}
+
+impl<T> std::convert::From<Bound<'_, T>> for PyObject
+where
+    T: AsRef<PyAny>,
+{
+    #[inline]
+    fn from(other: Bound<'_, T>) -> Self {
+        let py = other.py();
+        other.into_py(py)
+    }
+}
+
+impl<T> std::convert::From<Bound<'_, T>> for Py<T> {
+    #[inline]
+    fn from(other: Bound<'_, T>) -> Self {
+        other.unbind()
+    }
+}
+
+// `&PyCell<T>` can be converted to `Py<T>`
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+impl<T> std::convert::From<&crate::PyCell<T>> for Py<T>
+where
+    T: PyClass,
+{
+    fn from(cell: &crate::PyCell<T>) -> Self {
+        cell.as_borrowed().to_owned().unbind()
+    }
+}
+
+impl<'a, T> std::convert::From<PyRef<'a, T>> for Py<T>
+where
+    T: PyClass,
+{
+    fn from(pyref: PyRef<'a, T>) -> Self {
+        unsafe { Py::from_borrowed_ptr(pyref.py(), pyref.as_ptr()) }
+    }
+}
+
+impl<'a, T> std::convert::From<PyRefMut<'a, T>> for Py<T>
+where
+    T: PyClass<Frozen = False>,
+{
+    fn from(pyref: PyRefMut<'a, T>) -> Self {
+        unsafe { Py::from_borrowed_ptr(pyref.py(), pyref.as_ptr()) }
+    }
+}
+
+/// If the GIL is held this increments `self`'s reference count.
+/// Otherwise, it will panic.
+///
+/// Only available if the `py-clone` feature is enabled.
+#[cfg(feature = "py-clone")]
+impl<T> Clone for Py<T> {
+    #[track_caller]
+    fn clone(&self) -> Self {
+        unsafe {
+            gil::register_incref(self.0);
+        }
+        Self(self.0, PhantomData)
+    }
+}
+
+/// Dropping a `Py` instance decrements the reference count
+/// on the object by one if the GIL is held.
+///
+/// Otherwise and by default, this registers the underlying pointer to have its reference count
+/// decremented the next time PyO3 acquires the GIL.
+///
+/// However, if the `pyo3_disable_reference_pool` conditional compilation flag
+/// is enabled, it will abort the process.
+impl<T> Drop for Py<T> {
+    #[track_caller]
+    fn drop(&mut self) {
+        unsafe {
+            gil::register_decref(self.0);
+        }
+    }
+}
+
+impl<T> FromPyObject<'_> for Py<T>
+where
+    T: PyTypeCheck,
+{
+    /// Extracts `Self` from the source `PyObject`.
+    fn extract_bound(ob: &Bound<'_, PyAny>) -> PyResult<Self> {
+        ob.extract::<Bound<'_, T>>().map(Bound::unbind)
+    }
+}
+
+impl<'py, T> FromPyObject<'py> for Bound<'py, T>
+where
+    T: PyTypeCheck,
+{
+    /// Extracts `Self` from the source `PyObject`.
+    fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self> {
+        ob.downcast().cloned().map_err(Into::into)
+    }
+}
+
+/// `Py<T>` can be used as an error when T is an Error.
+///
+/// However for GIL lifetime reasons, cause() cannot be implemented for `Py<T>`.
+/// Use .as_ref() to get the GIL-scoped error if you need to inspect the cause.
+#[cfg(feature = "gil-refs")]
+impl<T> std::error::Error for Py<T>
+where
+    T: std::error::Error + PyTypeInfo,
+    T::AsRefTarget: std::fmt::Display,
+{
+}
+
+impl<T> std::fmt::Display for Py<T>
+where
+    T: PyTypeInfo,
+{
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        Python::with_gil(|py| std::fmt::Display::fmt(self.bind(py), f))
+    }
+}
+
+impl<T> std::fmt::Debug for Py<T> {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        f.debug_tuple("Py").field(&self.0.as_ptr()).finish()
+    }
+}
+
+/// A commonly-used alias for `Py<PyAny>`.
+///
+/// This is an owned reference a Python object without any type information. This value can also be
+/// safely sent between threads.
+///
+/// See the documentation for [`Py`](struct.Py.html).
+pub type PyObject = Py<PyAny>;
+
+impl PyObject {
+    /// Deprecated form of [`PyObject::downcast_bound`]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyObject::downcast` will be replaced by `PyObject::downcast_bound` in a future PyO3 version"
+    )]
+    #[inline]
+    pub fn downcast<'py, T>(
+        &'py self,
+        py: Python<'py>,
+    ) -> Result<&'py T, crate::err::PyDowncastError<'py>>
+    where
+        T: PyTypeCheck<AsRefTarget = T>,
+    {
+        self.downcast_bound::<T>(py)
+            .map(Bound::as_gil_ref)
+            .map_err(crate::err::PyDowncastError::from_downcast_err)
+    }
+    /// Downcast this `PyObject` to a concrete Python type or pyclass.
+    ///
+    /// Note that you can often avoid downcasting yourself by just specifying
+    /// the desired type in function or method signatures.
+    /// However, manual downcasting is sometimes necessary.
+    ///
+    /// For extracting a Rust-only type, see [`Py::extract`](struct.Py.html#method.extract).
+    ///
+    /// # Example: Downcasting to a specific Python object
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::{PyDict, PyList};
+    ///
+    /// Python::with_gil(|py| {
+    ///     let any: PyObject = PyDict::new_bound(py).into();
+    ///
+    ///     assert!(any.downcast_bound::<PyDict>(py).is_ok());
+    ///     assert!(any.downcast_bound::<PyList>(py).is_err());
+    /// });
+    /// ```
+    ///
+    /// # Example: Getting a reference to a pyclass
+    ///
+    /// This is useful if you want to mutate a `PyObject` that
+    /// might actually be a pyclass.
+    ///
+    /// ```rust
+    /// # fn main() -> Result<(), pyo3::PyErr> {
+    /// use pyo3::prelude::*;
+    ///
+    /// #[pyclass]
+    /// struct Class {
+    ///     i: i32,
+    /// }
+    ///
+    /// Python::with_gil(|py| {
+    ///     let class: PyObject = Py::new(py, Class { i: 0 }).unwrap().into_py(py);
+    ///
+    ///     let class_bound = class.downcast_bound::<Class>(py)?;
+    ///
+    ///     class_bound.borrow_mut().i += 1;
+    ///
+    ///     // Alternatively you can get a `PyRefMut` directly
+    ///     let class_ref: PyRefMut<'_, Class> = class.extract(py)?;
+    ///     assert_eq!(class_ref.i, 1);
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    #[inline]
+    pub fn downcast_bound<'py, T>(
+        &self,
+        py: Python<'py>,
+    ) -> Result<&Bound<'py, T>, DowncastError<'_, 'py>>
+    where
+        T: PyTypeCheck,
+    {
+        self.bind(py).downcast()
+    }
+
+    /// Deprecated form of [`PyObject::downcast_bound_unchecked`]
+    ///
+    /// # Safety
+    ///
+    /// Callers must ensure that the type is valid or risk type confusion.
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyObject::downcast_unchecked` will be replaced by `PyObject::downcast_bound_unchecked` in a future PyO3 version"
+    )]
+    #[inline]
+    pub unsafe fn downcast_unchecked<'py, T>(&'py self, py: Python<'py>) -> &T
+    where
+        T: HasPyGilRef<AsRefTarget = T>,
+    {
+        self.downcast_bound_unchecked::<T>(py).as_gil_ref()
+    }
+
+    /// Casts the PyObject to a concrete Python object type without checking validity.
+    ///
+    /// # Safety
+    ///
+    /// Callers must ensure that the type is valid or risk type confusion.
+    #[inline]
+    pub unsafe fn downcast_bound_unchecked<'py, T>(&self, py: Python<'py>) -> &Bound<'py, T> {
+        self.bind(py).downcast_unchecked()
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::{Bound, Py, PyObject};
+    use crate::types::{dict::IntoPyDict, PyAnyMethods, PyCapsule, PyDict, PyString};
+    use crate::{ffi, Borrowed, PyAny, PyResult, Python, ToPyObject};
+
+    #[test]
+    fn test_call() {
+        Python::with_gil(|py| {
+            let obj = py.get_type_bound::<PyDict>().to_object(py);
+
+            let assert_repr = |obj: &Bound<'_, PyAny>, expected: &str| {
+                assert_eq!(obj.repr().unwrap(), expected);
+            };
+
+            assert_repr(obj.call0(py).unwrap().bind(py), "{}");
+            assert_repr(obj.call1(py, ()).unwrap().bind(py), "{}");
+            assert_repr(obj.call_bound(py, (), None).unwrap().bind(py), "{}");
+
+            assert_repr(obj.call1(py, ((('x', 1),),)).unwrap().bind(py), "{'x': 1}");
+            assert_repr(
+                obj.call_bound(py, (), Some(&[('x', 1)].into_py_dict_bound(py)))
+                    .unwrap()
+                    .bind(py),
+                "{'x': 1}",
+            );
+        })
+    }
+
+    #[test]
+    fn test_call_for_non_existing_method() {
+        Python::with_gil(|py| {
+            let obj: PyObject = PyDict::new_bound(py).into();
+            assert!(obj.call_method0(py, "asdf").is_err());
+            assert!(obj
+                .call_method_bound(py, "nonexistent_method", (1,), None)
+                .is_err());
+            assert!(obj.call_method0(py, "nonexistent_method").is_err());
+            assert!(obj.call_method1(py, "nonexistent_method", (1,)).is_err());
+        });
+    }
+
+    #[test]
+    fn py_from_dict() {
+        let dict: Py<PyDict> = Python::with_gil(|py| {
+            let native = PyDict::new_bound(py);
+            Py::from(native)
+        });
+
+        Python::with_gil(move |py| {
+            assert_eq!(dict.get_refcnt(py), 1);
+        });
+    }
+
+    #[test]
+    fn pyobject_from_py() {
+        Python::with_gil(|py| {
+            let dict: Py<PyDict> = PyDict::new_bound(py).unbind();
+            let cnt = dict.get_refcnt(py);
+            let p: PyObject = dict.into();
+            assert_eq!(p.get_refcnt(py), cnt);
+        });
+    }
+
+    #[test]
+    fn attr() -> PyResult<()> {
+        use crate::types::PyModule;
+
+        Python::with_gil(|py| {
+            const CODE: &str = r#"
+class A:
+    pass
+a = A()
+   "#;
+            let module = PyModule::from_code_bound(py, CODE, "", "")?;
+            let instance: Py<PyAny> = module.getattr("a")?.into();
+
+            instance.getattr(py, "foo").unwrap_err();
+
+            instance.setattr(py, "foo", "bar")?;
+
+            assert!(instance
+                .getattr(py, "foo")?
+                .bind(py)
+                .eq(PyString::new_bound(py, "bar"))?);
+
+            instance.getattr(py, "foo")?;
+            Ok(())
+        })
+    }
+
+    #[test]
+    fn pystring_attr() -> PyResult<()> {
+        use crate::types::PyModule;
+
+        Python::with_gil(|py| {
+            const CODE: &str = r#"
+class A:
+    pass
+a = A()
+   "#;
+            let module = PyModule::from_code_bound(py, CODE, "", "")?;
+            let instance: Py<PyAny> = module.getattr("a")?.into();
+
+            let foo = crate::intern!(py, "foo");
+            let bar = crate::intern!(py, "bar");
+
+            instance.getattr(py, foo).unwrap_err();
+            instance.setattr(py, foo, bar)?;
+            assert!(instance.getattr(py, foo)?.bind(py).eq(bar)?);
+            Ok(())
+        })
+    }
+
+    #[test]
+    fn invalid_attr() -> PyResult<()> {
+        Python::with_gil(|py| {
+            let instance: Py<PyAny> = py.eval_bound("object()", None, None)?.into();
+
+            instance.getattr(py, "foo").unwrap_err();
+
+            // Cannot assign arbitrary attributes to `object`
+            instance.setattr(py, "foo", "bar").unwrap_err();
+            Ok(())
+        })
+    }
+
+    #[test]
+    fn test_py2_from_py_object() {
+        Python::with_gil(|py| {
+            let instance = py.eval_bound("object()", None, None).unwrap();
+            let ptr = instance.as_ptr();
+            let instance: Bound<'_, PyAny> = instance.extract().unwrap();
+            assert_eq!(instance.as_ptr(), ptr);
+        })
+    }
+
+    #[test]
+    fn test_py2_into_py_object() {
+        Python::with_gil(|py| {
+            let instance = py
+                .eval_bound("object()", None, None)
+                .unwrap()
+                .as_borrowed()
+                .to_owned();
+            let ptr = instance.as_ptr();
+            let instance: PyObject = instance.clone().unbind();
+            assert_eq!(instance.as_ptr(), ptr);
+        })
+    }
+
+    #[test]
+    #[allow(deprecated)]
+    fn test_is_ellipsis() {
+        Python::with_gil(|py| {
+            let v = py
+                .eval_bound("...", None, None)
+                .map_err(|e| e.display(py))
+                .unwrap()
+                .to_object(py);
+
+            assert!(v.is_ellipsis());
+
+            let not_ellipsis = 5.to_object(py);
+            assert!(!not_ellipsis.is_ellipsis());
+        });
+    }
+
+    #[test]
+    fn test_debug_fmt() {
+        Python::with_gil(|py| {
+            let obj = "hello world".to_object(py).into_bound(py);
+            assert_eq!(format!("{:?}", obj), "'hello world'");
+        });
+    }
+
+    #[test]
+    fn test_display_fmt() {
+        Python::with_gil(|py| {
+            let obj = "hello world".to_object(py).into_bound(py);
+            assert_eq!(format!("{}", obj), "hello world");
+        });
+    }
+
+    #[test]
+    fn test_bound_as_any() {
+        Python::with_gil(|py| {
+            let obj = PyString::new_bound(py, "hello world");
+            let any = obj.as_any();
+            assert_eq!(any.as_ptr(), obj.as_ptr());
+        });
+    }
+
+    #[test]
+    fn test_bound_into_any() {
+        Python::with_gil(|py| {
+            let obj = PyString::new_bound(py, "hello world");
+            let any = obj.clone().into_any();
+            assert_eq!(any.as_ptr(), obj.as_ptr());
+        });
+    }
+
+    #[test]
+    fn test_bound_py_conversions() {
+        Python::with_gil(|py| {
+            let obj: Bound<'_, PyString> = PyString::new_bound(py, "hello world");
+            let obj_unbound: &Py<PyString> = obj.as_unbound();
+            let _: &Bound<'_, PyString> = obj_unbound.bind(py);
+
+            let obj_unbound: Py<PyString> = obj.unbind();
+            let obj: Bound<'_, PyString> = obj_unbound.into_bound(py);
+
+            assert_eq!(obj, "hello world");
+        });
+    }
+
+    #[test]
+    fn bound_from_borrowed_ptr_constructors() {
+        // More detailed tests of the underlying semantics in pycell.rs
+        Python::with_gil(|py| {
+            fn check_drop<'py>(
+                py: Python<'py>,
+                method: impl FnOnce(*mut ffi::PyObject) -> Bound<'py, PyAny>,
+            ) {
+                let mut dropped = false;
+                let capsule = PyCapsule::new_bound_with_destructor(
+                    py,
+                    (&mut dropped) as *mut _ as usize,
+                    None,
+                    |ptr, _| unsafe { std::ptr::write(ptr as *mut bool, true) },
+                )
+                .unwrap();
+
+                let bound = method(capsule.as_ptr());
+                assert!(!dropped);
+
+                // creating the bound should have increased the refcount
+                drop(capsule);
+                assert!(!dropped);
+
+                // dropping the bound should now also decrease the refcount and free the object
+                drop(bound);
+                assert!(dropped);
+            }
+
+            check_drop(py, |ptr| unsafe { Bound::from_borrowed_ptr(py, ptr) });
+            check_drop(py, |ptr| unsafe {
+                Bound::from_borrowed_ptr_or_opt(py, ptr).unwrap()
+            });
+            check_drop(py, |ptr| unsafe {
+                Bound::from_borrowed_ptr_or_err(py, ptr).unwrap()
+            });
+        })
+    }
+
+    #[test]
+    fn borrowed_ptr_constructors() {
+        // More detailed tests of the underlying semantics in pycell.rs
+        Python::with_gil(|py| {
+            fn check_drop<'py>(
+                py: Python<'py>,
+                method: impl FnOnce(&*mut ffi::PyObject) -> Borrowed<'_, 'py, PyAny>,
+            ) {
+                let mut dropped = false;
+                let capsule = PyCapsule::new_bound_with_destructor(
+                    py,
+                    (&mut dropped) as *mut _ as usize,
+                    None,
+                    |ptr, _| unsafe { std::ptr::write(ptr as *mut bool, true) },
+                )
+                .unwrap();
+
+                let ptr = &capsule.as_ptr();
+                let _borrowed = method(ptr);
+                assert!(!dropped);
+
+                // creating the borrow should not have increased the refcount
+                drop(capsule);
+                assert!(dropped);
+            }
+
+            check_drop(py, |&ptr| unsafe { Borrowed::from_ptr(py, ptr) });
+            check_drop(py, |&ptr| unsafe {
+                Borrowed::from_ptr_or_opt(py, ptr).unwrap()
+            });
+            check_drop(py, |&ptr| unsafe {
+                Borrowed::from_ptr_or_err(py, ptr).unwrap()
+            });
+        })
+    }
+
+    #[test]
+    fn explicit_drop_ref() {
+        Python::with_gil(|py| {
+            let object: Py<PyDict> = PyDict::new_bound(py).unbind();
+            let object2 = object.clone_ref(py);
+
+            assert_eq!(object.as_ptr(), object2.as_ptr());
+            assert_eq!(object.get_refcnt(py), 2);
+
+            object.drop_ref(py);
+
+            assert_eq!(object2.get_refcnt(py), 1);
+
+            object2.drop_ref(py);
+        });
+    }
+
+    #[cfg(feature = "macros")]
+    mod using_macros {
+        use super::*;
+
+        #[crate::pyclass(crate = "crate")]
+        struct SomeClass(i32);
+
+        #[test]
+        fn py_borrow_methods() {
+            // More detailed tests of the underlying semantics in pycell.rs
+            Python::with_gil(|py| {
+                let instance = Py::new(py, SomeClass(0)).unwrap();
+                assert_eq!(instance.borrow(py).0, 0);
+                assert_eq!(instance.try_borrow(py).unwrap().0, 0);
+                assert_eq!(instance.borrow_mut(py).0, 0);
+                assert_eq!(instance.try_borrow_mut(py).unwrap().0, 0);
+
+                instance.borrow_mut(py).0 = 123;
+
+                assert_eq!(instance.borrow(py).0, 123);
+                assert_eq!(instance.try_borrow(py).unwrap().0, 123);
+                assert_eq!(instance.borrow_mut(py).0, 123);
+                assert_eq!(instance.try_borrow_mut(py).unwrap().0, 123);
+            })
+        }
+
+        #[test]
+        fn bound_borrow_methods() {
+            // More detailed tests of the underlying semantics in pycell.rs
+            Python::with_gil(|py| {
+                let instance = Bound::new(py, SomeClass(0)).unwrap();
+                assert_eq!(instance.borrow().0, 0);
+                assert_eq!(instance.try_borrow().unwrap().0, 0);
+                assert_eq!(instance.borrow_mut().0, 0);
+                assert_eq!(instance.try_borrow_mut().unwrap().0, 0);
+
+                instance.borrow_mut().0 = 123;
+
+                assert_eq!(instance.borrow().0, 123);
+                assert_eq!(instance.try_borrow().unwrap().0, 123);
+                assert_eq!(instance.borrow_mut().0, 123);
+                assert_eq!(instance.try_borrow_mut().unwrap().0, 123);
+            })
+        }
+
+        #[crate::pyclass(frozen, crate = "crate")]
+        struct FrozenClass(i32);
+
+        #[test]
+        fn test_frozen_get() {
+            Python::with_gil(|py| {
+                for i in 0..10 {
+                    let instance = Py::new(py, FrozenClass(i)).unwrap();
+                    assert_eq!(instance.get().0, i);
+
+                    assert_eq!(instance.bind(py).get().0, i);
+                }
+            })
+        }
+
+        #[test]
+        #[cfg(feature = "gil-refs")]
+        #[allow(deprecated)]
+        fn cell_tryfrom() {
+            use crate::{PyCell, PyTryInto};
+            // More detailed tests of the underlying semantics in pycell.rs
+            Python::with_gil(|py| {
+                let instance: &PyAny = Py::new(py, SomeClass(0)).unwrap().into_ref(py);
+                let _: &PyCell<SomeClass> = PyTryInto::try_into(instance).unwrap();
+                let _: &PyCell<SomeClass> = PyTryInto::try_into_exact(instance).unwrap();
+            })
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/internal_tricks.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/internal_tricks.rs
--- 43.0.0-1/rust-vendor/pyo3/src/internal_tricks.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/internal_tricks.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,197 @@
+use crate::ffi::{Py_ssize_t, PY_SSIZE_T_MAX};
+pub struct PrivateMarker;
+
+macro_rules! private_decl {
+    () => {
+        /// This trait is private to implement; this method exists to make it
+        /// impossible to implement outside the crate.
+        fn __private__(&self) -> crate::internal_tricks::PrivateMarker;
+    };
+}
+
+macro_rules! private_impl {
+    () => {
+        fn __private__(&self) -> crate::internal_tricks::PrivateMarker {
+            crate::internal_tricks::PrivateMarker
+        }
+    };
+}
+
+macro_rules! pyo3_exception {
+    ($doc: expr, $name: ident, $base: ty) => {
+        #[doc = $doc]
+        #[repr(transparent)]
+        #[allow(non_camel_case_types)]
+        pub struct $name($crate::PyAny);
+
+        $crate::impl_exception_boilerplate!($name);
+
+        $crate::create_exception_type_object!(pyo3_runtime, $name, $base, Some($doc));
+    };
+}
+
+/// Convert an usize index into a Py_ssize_t index, clamping overflow to
+/// PY_SSIZE_T_MAX.
+pub(crate) fn get_ssize_index(index: usize) -> Py_ssize_t {
+    index.min(PY_SSIZE_T_MAX as usize) as Py_ssize_t
+}
+
+/// Implementations used for slice indexing PySequence, PyTuple, and PyList
+#[cfg(feature = "gil-refs")]
+macro_rules! index_impls {
+    (
+        $ty:ty,
+        $ty_name:literal,
+        $len:expr,
+        $get_slice:expr $(,)?
+    ) => {
+        impl std::ops::Index<usize> for $ty {
+            // Always PyAny output (even if the slice operation returns something else)
+            type Output = PyAny;
+
+            #[track_caller]
+            fn index(&self, index: usize) -> &Self::Output {
+                self.get_item(index).unwrap_or_else(|_| {
+                    crate::internal_tricks::index_len_fail(index, $ty_name, $len(self))
+                })
+            }
+        }
+
+        impl std::ops::Index<std::ops::Range<usize>> for $ty {
+            type Output = $ty;
+
+            #[track_caller]
+            fn index(
+                &self,
+                std::ops::Range { start, end }: std::ops::Range<usize>,
+            ) -> &Self::Output {
+                let len = $len(self);
+                if start > len {
+                    crate::internal_tricks::slice_start_index_len_fail(start, $ty_name, len)
+                } else if end > len {
+                    crate::internal_tricks::slice_end_index_len_fail(end, $ty_name, len)
+                } else if start > end {
+                    crate::internal_tricks::slice_index_order_fail(start, end)
+                } else {
+                    $get_slice(self, start, end)
+                }
+            }
+        }
+
+        impl std::ops::Index<std::ops::RangeFrom<usize>> for $ty {
+            type Output = $ty;
+
+            #[track_caller]
+            fn index(
+                &self,
+                std::ops::RangeFrom { start }: std::ops::RangeFrom<usize>,
+            ) -> &Self::Output {
+                let len = $len(self);
+                if start > len {
+                    crate::internal_tricks::slice_start_index_len_fail(start, $ty_name, len)
+                } else {
+                    $get_slice(self, start, len)
+                }
+            }
+        }
+
+        impl std::ops::Index<std::ops::RangeFull> for $ty {
+            type Output = $ty;
+
+            #[track_caller]
+            fn index(&self, _: std::ops::RangeFull) -> &Self::Output {
+                let len = $len(self);
+                $get_slice(self, 0, len)
+            }
+        }
+
+        impl std::ops::Index<std::ops::RangeInclusive<usize>> for $ty {
+            type Output = $ty;
+
+            #[track_caller]
+            fn index(&self, range: std::ops::RangeInclusive<usize>) -> &Self::Output {
+                let exclusive_end = range
+                    .end()
+                    .checked_add(1)
+                    .expect("range end exceeds Python limit");
+                &self[*range.start()..exclusive_end]
+            }
+        }
+
+        impl std::ops::Index<std::ops::RangeTo<usize>> for $ty {
+            type Output = $ty;
+
+            #[track_caller]
+            fn index(&self, std::ops::RangeTo { end }: std::ops::RangeTo<usize>) -> &Self::Output {
+                &self[0..end]
+            }
+        }
+
+        impl std::ops::Index<std::ops::RangeToInclusive<usize>> for $ty {
+            type Output = $ty;
+
+            #[track_caller]
+            fn index(
+                &self,
+                std::ops::RangeToInclusive { end }: std::ops::RangeToInclusive<usize>,
+            ) -> &Self::Output {
+                &self[0..=end]
+            }
+        }
+    };
+}
+
+// these error messages are shamelessly "borrowed" from std.
+
+#[inline(never)]
+#[cold]
+#[track_caller]
+#[cfg(feature = "gil-refs")]
+pub(crate) fn index_len_fail(index: usize, ty_name: &str, len: usize) -> ! {
+    panic!(
+        "index {} out of range for {} of length {}",
+        index, ty_name, len
+    );
+}
+
+#[inline(never)]
+#[cold]
+#[track_caller]
+#[cfg(feature = "gil-refs")]
+pub(crate) fn slice_start_index_len_fail(index: usize, ty_name: &str, len: usize) -> ! {
+    panic!(
+        "range start index {} out of range for {} of length {}",
+        index, ty_name, len
+    );
+}
+
+#[inline(never)]
+#[cold]
+#[track_caller]
+#[cfg(feature = "gil-refs")]
+pub(crate) fn slice_end_index_len_fail(index: usize, ty_name: &str, len: usize) -> ! {
+    panic!(
+        "range end index {} out of range for {} of length {}",
+        index, ty_name, len
+    );
+}
+
+#[inline(never)]
+#[cold]
+#[track_caller]
+#[cfg(feature = "gil-refs")]
+pub(crate) fn slice_index_order_fail(index: usize, end: usize) -> ! {
+    panic!("slice index starts at {} but ends at {}", index, end);
+}
+
+// TODO: use ptr::from_ref on MSRV 1.76
+#[inline]
+pub(crate) const fn ptr_from_ref<T>(t: &T) -> *const T {
+    t as *const T
+}
+
+// TODO: use ptr::from_mut on MSRV 1.76
+#[inline]
+pub(crate) fn ptr_from_mut<T>(t: &mut T) -> *mut T {
+    t as *mut T
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/lib.rs
--- 43.0.0-1/rust-vendor/pyo3/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,561 @@
+#![warn(missing_docs)]
+#![cfg_attr(feature = "nightly", feature(auto_traits, negative_impls))]
+#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
+// Deny some lints in doctests.
+// Use `#[allow(...)]` locally to override.
+#![doc(test(attr(
+    deny(
+        rust_2018_idioms,
+        unused_lifetimes,
+        rust_2021_prelude_collisions,
+        warnings
+    ),
+    allow(
+        unused_variables,
+        unused_assignments,
+        unused_extern_crates,
+        // FIXME https://github.com/rust-lang/rust/issues/121621#issuecomment-1965156376
+        unknown_lints,
+        non_local_definitions,
+    )
+)))]
+
+//! Rust bindings to the Python interpreter.
+//!
+//! PyO3 can be used to write native Python modules or run Python code and modules from Rust.
+//!
+//! See [the guide] for a detailed introduction.
+//!
+//! # PyO3's object types
+//!
+//! PyO3 has several core types that you should familiarize yourself with:
+//!
+//! ## The `Python<'py>` object, and the `'py` lifetime
+//!
+//! Holding the [global interpreter lock] (GIL) is modeled with the [`Python<'py>`](Python) token. Many
+//! Python APIs require that the GIL is held, and PyO3 uses this token as proof that these APIs
+//! can be called safely. It can be explicitly acquired and is also implicitly acquired by PyO3
+//! as it wraps Rust functions and structs into Python functions and objects.
+//!
+//! The [`Python<'py>`](Python) token's lifetime `'py` is common to many PyO3 APIs:
+//! - Types that also have the `'py` lifetime, such as the [`Bound<'py, T>`](Bound) smart pointer, are
+//!   bound to the Python GIL and rely on this to offer their functionality. These types often
+//!   have a [`.py()`](Bound::py) method to get the associated [`Python<'py>`](Python) token.
+//! - Functions which depend on the `'py` lifetime, such as [`PyList::new_bound`](types::PyList::new_bound),
+//!   require a [`Python<'py>`](Python) token as an input. Sometimes the token is passed implicitly by
+//!   taking a [`Bound<'py, T>`](Bound) or other type which is bound to the `'py` lifetime.
+//! - Traits which depend on the `'py` lifetime, such as [`FromPyObject<'py>`](FromPyObject), usually have
+//!   inputs or outputs which depend on the lifetime. Adding the lifetime to the trait allows
+//!   these inputs and outputs to express their binding to the GIL in the Rust type system.
+//!
+//! ## Python object smart pointers
+//!
+//! PyO3 has two core smart pointers to refer to Python objects, [`Py<T>`](Py) and its GIL-bound
+//! form [`Bound<'py, T>`](Bound) which carries the `'py` lifetime. (There is also
+//! [`Borrowed<'a, 'py, T>`](instance::Borrowed), but it is used much more rarely).
+//!
+//! The type parameter `T` in these smart pointers can be filled by:
+//!   - [`PyAny`], e.g. `Py<PyAny>` or `Bound<'py, PyAny>`, where the Python object type is not
+//!     known. `Py<PyAny>` is so common it has a type alias [`PyObject`].
+//!   - Concrete Python types like [`PyList`](types::PyList) or [`PyTuple`](types::PyTuple).
+//!   - Rust types which are exposed to Python using the [`#[pyclass]`](macro@pyclass) macro.
+//!
+//! See the [guide][types] for an explanation of the different Python object types.
+//!
+//! ## PyErr
+//!
+//! The vast majority of operations in this library will return [`PyResult<...>`](PyResult).
+//! This is an alias for the type `Result<..., PyErr>`.
+//!
+//! A `PyErr` represents a Python exception. A `PyErr` returned to Python code will be raised as a
+//! Python exception. Errors from `PyO3` itself are also exposed as Python exceptions.
+//!
+//! # Feature flags
+//!
+//! PyO3 uses [feature flags] to enable you to opt-in to additional functionality. For a detailed
+//! description, see the [Features chapter of the guide].
+//!
+//! ## Default feature flags
+//!
+//! The following features are turned on by default:
+//! - `macros`: Enables various macros, including all the attribute macros.
+//!
+//! ## Optional feature flags
+//!
+//! The following features customize PyO3's behavior:
+//!
+//! - `abi3`: Restricts PyO3's API to a subset of the full Python API which is guaranteed by
+//! [PEP 384] to be forward-compatible with future Python versions.
+//! - `auto-initialize`: Changes [`Python::with_gil`] to automatically initialize the Python
+//! interpreter if needed.
+//! - `extension-module`: This will tell the linker to keep the Python symbols unresolved, so that
+//! your module can also be used with statically linked Python interpreters. Use this feature when
+//! building an extension module.
+//! - `multiple-pymethods`: Enables the use of multiple [`#[pymethods]`](macro@crate::pymethods)
+//! blocks per [`#[pyclass]`](macro@crate::pyclass). This adds a dependency on the [inventory]
+//! crate, which is not supported on all platforms.
+//!
+//! The following features enable interactions with other crates in the Rust ecosystem:
+//! - [`anyhow`]: Enables a conversion from [anyhow]’s [`Error`][anyhow_error] type to [`PyErr`].
+//! - [`chrono`]: Enables a conversion from [chrono]'s structures to the equivalent Python ones.
+//! - [`chrono-tz`]: Enables a conversion from [chrono-tz]'s `Tz` enum. Requires Python 3.9+.
+//! - [`either`]: Enables conversions between Python objects and [either]'s [`Either`] type.
+//! - [`eyre`]: Enables a conversion from [eyre]’s [`Report`] type to [`PyErr`].
+//! - [`hashbrown`]: Enables conversions between Python objects and [hashbrown]'s [`HashMap`] and
+//! [`HashSet`] types.
+//! - [`indexmap`][indexmap_feature]: Enables conversions between Python dictionary and [indexmap]'s [`IndexMap`].
+//! - [`num-bigint`]: Enables conversions between Python objects and [num-bigint]'s [`BigInt`] and
+//! [`BigUint`] types.
+//! - [`num-complex`]: Enables conversions between Python objects and [num-complex]'s [`Complex`]
+//!  type.
+//! - [`num-rational`]: Enables conversions between Python's fractions.Fraction and [num-rational]'s types
+//! - [`rust_decimal`]: Enables conversions between Python's decimal.Decimal and [rust_decimal]'s
+//! [`Decimal`] type.
+//! - [`serde`]: Allows implementing [serde]'s [`Serialize`] and [`Deserialize`] traits for
+//! [`Py`]`<T>` for all `T` that implement [`Serialize`] and [`Deserialize`].
+//! - [`smallvec`][smallvec]: Enables conversions between Python list and [smallvec]'s [`SmallVec`].
+//!
+//! ## Unstable features
+//!
+//! - `nightly`: Uses  `#![feature(auto_traits, negative_impls)]` to define [`Ungil`] as an auto trait.
+//
+//! ## `rustc` environment flags
+//!
+//! PyO3 uses `rustc`'s `--cfg` flags to enable or disable code used for different Python versions.
+//! If you want to do this for your own crate, you can do so with the [`pyo3-build-config`] crate.
+//!
+//! - `Py_3_7`, `Py_3_8`, `Py_3_9`, `Py_3_10`: Marks code that is only enabled when
+//!  compiling for a given minimum Python version.
+//! - `Py_LIMITED_API`: Marks code enabled when the `abi3` feature flag is enabled.
+//! - `PyPy` - Marks code enabled when compiling for PyPy.
+//!
+//! # Minimum supported Rust and Python versions
+//!
+//! PyO3 supports the following software versions:
+//!   - Python 3.7 and up (CPython and PyPy)
+//!   - Rust 1.63 and up
+//!
+//! # Example: Building a native Python module
+//!
+//! PyO3 can be used to generate a native Python module. The easiest way to try this out for the
+//! first time is to use [`maturin`]. `maturin` is a tool for building and publishing Rust-based
+//! Python packages with minimal configuration. The following steps set up some files for an example
+//! Python module, install `maturin`, and then show how to build and import the Python module.
+//!
+//! First, create a new folder (let's call it `string_sum`) containing the following two files:
+//!
+//! **`Cargo.toml`**
+//!
+//! ```toml
+//! [package]
+//! name = "string-sum"
+//! version = "0.1.0"
+//! edition = "2021"
+//!
+//! [lib]
+//! name = "string_sum"
+//! # "cdylib" is necessary to produce a shared library for Python to import from.
+//! #
+//! # Downstream Rust code (including code in `bin/`, `examples/`, and `tests/`) will not be able
+//! # to `use string_sum;` unless the "rlib" or "lib" crate type is also included, e.g.:
+//! # crate-type = ["cdylib", "rlib"]
+//! crate-type = ["cdylib"]
+//!
+//! [dependencies.pyo3]
+#![doc = concat!("version = \"", env!("CARGO_PKG_VERSION"),  "\"")]
+//! features = ["extension-module"]
+//! ```
+//!
+//! **`src/lib.rs`**
+//! ```rust
+//! use pyo3::prelude::*;
+//!
+//! /// Formats the sum of two numbers as string.
+//! #[pyfunction]
+//! fn sum_as_string(a: usize, b: usize) -> PyResult<String> {
+//!     Ok((a + b).to_string())
+//! }
+//!
+//! /// A Python module implemented in Rust.
+//! #[pymodule]
+//! fn string_sum(m: &Bound<'_, PyModule>) -> PyResult<()> {
+//!     m.add_function(wrap_pyfunction!(sum_as_string, m)?)?;
+//!
+//!     Ok(())
+//! }
+//! ```
+//!
+//! With those two files in place, now `maturin` needs to be installed. This can be done using
+//! Python's package manager `pip`. First, load up a new Python `virtualenv`, and install `maturin`
+//! into it:
+//! ```bash
+//! $ cd string_sum
+//! $ python -m venv .env
+//! $ source .env/bin/activate
+//! $ pip install maturin
+//! ```
+//!
+//! Now build and execute the module:
+//! ```bash
+//! $ maturin develop
+//! # lots of progress output as maturin runs the compilation...
+//! $ python
+//! >>> import string_sum
+//! >>> string_sum.sum_as_string(5, 20)
+//! '25'
+//! ```
+//!
+//! As well as with `maturin`, it is possible to build using [setuptools-rust] or
+//! [manually][manual_builds]. Both offer more flexibility than `maturin` but require further
+//! configuration.
+//!
+//! # Example: Using Python from Rust
+//!
+//! To embed Python into a Rust binary, you need to ensure that your Python installation contains a
+//! shared library. The following steps demonstrate how to ensure this (for Ubuntu), and then give
+//! some example code which runs an embedded Python interpreter.
+//!
+//! To install the Python shared library on Ubuntu:
+//! ```bash
+//! sudo apt install python3-dev
+//! ```
+//!
+//! Start a new project with `cargo new` and add  `pyo3` to the `Cargo.toml` like this:
+//! ```toml
+//! [dependencies.pyo3]
+#![doc = concat!("version = \"", env!("CARGO_PKG_VERSION"),  "\"")]
+//! # this is necessary to automatically initialize the Python interpreter
+//! features = ["auto-initialize"]
+//! ```
+//!
+//! Example program displaying the value of `sys.version` and the current user name:
+//! ```rust
+//! use pyo3::prelude::*;
+//! use pyo3::types::IntoPyDict;
+//!
+//! fn main() -> PyResult<()> {
+//!     Python::with_gil(|py| {
+//!         let sys = py.import_bound("sys")?;
+//!         let version: String = sys.getattr("version")?.extract()?;
+//!
+//!         let locals = [("os", py.import_bound("os")?)].into_py_dict_bound(py);
+//!         let code = "os.getenv('USER') or os.getenv('USERNAME') or 'Unknown'";
+//!         let user: String = py.eval_bound(code, None, Some(&locals))?.extract()?;
+//!
+//!         println!("Hello {}, I'm Python {}", user, version);
+//!         Ok(())
+//!     })
+//! }
+//! ```
+//!
+//! The guide has [a section][calling_rust] with lots of examples about this topic.
+//!
+//! # Other Examples
+//!
+//! The PyO3 [README](https://github.com/PyO3/pyo3#readme) contains quick-start examples for both
+//! using [Rust from Python] and [Python from Rust].
+//!
+//! The PyO3 repository's [examples subdirectory]
+//! contains some basic packages to demonstrate usage of PyO3.
+//!
+//! There are many projects using PyO3 - see a list of some at
+//! <https://github.com/PyO3/pyo3#examples>.
+//!
+//! [anyhow]: https://docs.rs/anyhow/ "A trait object based error system for easy idiomatic error handling in Rust applications."
+//! [anyhow_error]: https://docs.rs/anyhow/latest/anyhow/struct.Error.html "Anyhows `Error` type, a wrapper around a dynamic error type"
+//! [`anyhow`]: ./anyhow/index.html "Documentation about the `anyhow` feature."
+//! [inventory]: https://docs.rs/inventory
+//! [`HashMap`]: https://docs.rs/hashbrown/latest/hashbrown/struct.HashMap.html
+//! [`HashSet`]: https://docs.rs/hashbrown/latest/hashbrown/struct.HashSet.html
+//! [`SmallVec`]: https://docs.rs/smallvec/latest/smallvec/struct.SmallVec.html
+//! [`IndexMap`]: https://docs.rs/indexmap/latest/indexmap/map/struct.IndexMap.html
+//! [`BigInt`]: https://docs.rs/num-bigint/latest/num_bigint/struct.BigInt.html
+//! [`BigUint`]: https://docs.rs/num-bigint/latest/num_bigint/struct.BigUint.html
+//! [`Complex`]: https://docs.rs/num-complex/latest/num_complex/struct.Complex.html
+//! [`Deserialize`]: https://docs.rs/serde/latest/serde/trait.Deserialize.html
+//! [`Serialize`]: https://docs.rs/serde/latest/serde/trait.Serialize.html
+//! [chrono]: https://docs.rs/chrono/ "Date and Time for Rust."
+//! [chrono-tz]: https://docs.rs/chrono-tz/ "TimeZone implementations for chrono from the IANA database."
+//! [`chrono`]: ./chrono/index.html "Documentation about the `chrono` feature."
+//! [`chrono-tz`]: ./chrono-tz/index.html "Documentation about the `chrono-tz` feature."
+//! [either]: https://docs.rs/either/ "A type that represents one of two alternatives."
+//! [`either`]: ./either/index.html "Documentation about the `either` feature."
+//! [`Either`]: https://docs.rs/either/latest/either/enum.Either.html
+//! [eyre]: https://docs.rs/eyre/ "A library for easy idiomatic error handling and reporting in Rust applications."
+//! [`Report`]: https://docs.rs/eyre/latest/eyre/struct.Report.html
+//! [`eyre`]: ./eyre/index.html "Documentation about the `eyre` feature."
+//! [`hashbrown`]: ./hashbrown/index.html "Documentation about the `hashbrown` feature."
+//! [indexmap_feature]: ./indexmap/index.html "Documentation about the `indexmap` feature."
+//! [`maturin`]: https://github.com/PyO3/maturin "Build and publish crates with pyo3, rust-cpython and cffi bindings as well as rust binaries as python packages"
+//! [`num-bigint`]: ./num_bigint/index.html "Documentation about the `num-bigint` feature."
+//! [`num-complex`]: ./num_complex/index.html "Documentation about the `num-complex` feature."
+//! [`num-rational`]: ./num_rational/index.html "Documentation about the `num-rational` feature."
+//! [`pyo3-build-config`]: https://docs.rs/pyo3-build-config
+//! [rust_decimal]: https://docs.rs/rust_decimal
+//! [`rust_decimal`]: ./rust_decimal/index.html "Documenation about the `rust_decimal` feature."
+//! [`Decimal`]: https://docs.rs/rust_decimal/latest/rust_decimal/struct.Decimal.html
+//! [`serde`]: <./serde/index.html> "Documentation about the `serde` feature."
+#![doc = concat!("[calling_rust]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/python-from-rust.html \"Calling Python from Rust - PyO3 user guide\"")]
+//! [examples subdirectory]: https://github.com/PyO3/pyo3/tree/main/examples
+//! [feature flags]: https://doc.rust-lang.org/cargo/reference/features.html "Features - The Cargo Book"
+//! [global interpreter lock]: https://docs.python.org/3/glossary.html#term-global-interpreter-lock
+//! [hashbrown]: https://docs.rs/hashbrown
+//! [smallvec]: https://docs.rs/smallvec
+//! [indexmap]: https://docs.rs/indexmap
+#![doc = concat!("[manual_builds]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/building-and-distribution.html#manual-builds \"Manual builds - Building and Distribution - PyO3 user guide\"")]
+//! [num-bigint]: https://docs.rs/num-bigint
+//! [num-complex]: https://docs.rs/num-complex
+//! [num-rational]: https://docs.rs/num-rational
+//! [serde]: https://docs.rs/serde
+//! [setuptools-rust]: https://github.com/PyO3/setuptools-rust "Setuptools plugin for Rust extensions"
+//! [the guide]: https://pyo3.rs "PyO3 user guide"
+#![doc = concat!("[types]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/types.html \"GIL lifetimes, mutability and Python object types\"")]
+//! [PEP 384]: https://www.python.org/dev/peps/pep-0384 "PEP 384 -- Defining a Stable ABI"
+//! [Python from Rust]: https://github.com/PyO3/pyo3#using-python-from-rust
+//! [Rust from Python]: https://github.com/PyO3/pyo3#using-rust-from-python
+#![doc = concat!("[Features chapter of the guide]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/features.html#features-reference \"Features Reference - PyO3 user guide\"")]
+//! [`Ungil`]: crate::marker::Ungil
+pub use crate::class::*;
+pub use crate::conversion::{AsPyPointer, FromPyObject, IntoPy, ToPyObject};
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+pub use crate::conversion::{FromPyPointer, PyTryFrom, PyTryInto};
+#[cfg(feature = "gil-refs")]
+pub use crate::err::PyDowncastError;
+pub use crate::err::{DowncastError, DowncastIntoError, PyErr, PyErrArguments, PyResult, ToPyErr};
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+pub use crate::gil::GILPool;
+#[cfg(not(any(PyPy, GraalPy)))]
+pub use crate::gil::{prepare_freethreaded_python, with_embedded_python_interpreter};
+#[cfg(feature = "gil-refs")]
+pub use crate::instance::PyNativeType;
+pub use crate::instance::{Borrowed, Bound, Py, PyObject};
+pub use crate::marker::Python;
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+pub use crate::pycell::PyCell;
+pub use crate::pycell::{PyRef, PyRefMut};
+pub use crate::pyclass::PyClass;
+pub use crate::pyclass_init::PyClassInitializer;
+pub use crate::type_object::{PyTypeCheck, PyTypeInfo};
+pub use crate::types::PyAny;
+pub use crate::version::PythonVersionInfo;
+
+pub(crate) mod ffi_ptr_ext;
+pub(crate) mod py_result_ext;
+pub(crate) mod sealed;
+
+/// Old module which contained some implementation details of the `#[pyproto]` module.
+///
+/// Prefer using the same content from `pyo3::pyclass`, e.g. `use pyo3::pyclass::CompareOp` instead
+/// of `use pyo3::class::basic::CompareOp`.
+///
+/// For compatibility reasons this has not yet been removed, however will be done so
+/// once <https://github.com/rust-lang/rust/issues/30827> is resolved.
+pub mod class {
+    pub use self::gc::{PyTraverseError, PyVisit};
+
+    #[doc(hidden)]
+    pub use self::methods::{
+        PyClassAttributeDef, PyGetterDef, PyMethodDef, PyMethodDefType, PyMethodType, PySetterDef,
+    };
+
+    #[doc(hidden)]
+    pub mod methods {
+        // frozen with the contents of the `impl_::pymethods` module in 0.20,
+        // this should probably all be replaced with deprecated type aliases and removed.
+        pub use crate::impl_::pymethods::{
+            IPowModulo, PyClassAttributeDef, PyGetterDef, PyMethodDef, PyMethodDefType,
+            PyMethodType, PySetterDef,
+        };
+    }
+
+    /// Old module which contained some implementation details of the `#[pyproto]` module.
+    ///
+    /// Prefer using the same content from `pyo3::pyclass`, e.g. `use pyo3::pyclass::CompareOp` instead
+    /// of `use pyo3::class::basic::CompareOp`.
+    ///
+    /// For compatibility reasons this has not yet been removed, however will be done so
+    /// once <https://github.com/rust-lang/rust/issues/30827> is resolved.
+    pub mod basic {
+        pub use crate::pyclass::CompareOp;
+    }
+
+    /// Old module which contained some implementation details of the `#[pyproto]` module.
+    ///
+    /// Prefer using the same content from `pyo3::pyclass`, e.g. `use pyo3::pyclass::IterANextOutput` instead
+    /// of `use pyo3::class::pyasync::IterANextOutput`.
+    ///
+    /// For compatibility reasons this has not yet been removed, however will be done so
+    /// once <https://github.com/rust-lang/rust/issues/30827> is resolved.
+    pub mod pyasync {
+        #[allow(deprecated)]
+        pub use crate::pyclass::{IterANextOutput, PyIterANextOutput};
+    }
+
+    /// Old module which contained some implementation details of the `#[pyproto]` module.
+    ///
+    /// Prefer using the same content from `pyo3::pyclass`, e.g. `use pyo3::pyclass::IterNextOutput` instead
+    /// of `use pyo3::class::pyasync::IterNextOutput`.
+    ///
+    /// For compatibility reasons this has not yet been removed, however will be done so
+    /// once <https://github.com/rust-lang/rust/issues/30827> is resolved.
+    pub mod iter {
+        #[allow(deprecated)]
+        pub use crate::pyclass::{IterNextOutput, PyIterNextOutput};
+    }
+
+    /// Old module which contained some implementation details of the `#[pyproto]` module.
+    ///
+    /// Prefer using the same content from `pyo3::pyclass`, e.g. `use pyo3::pyclass::PyTraverseError` instead
+    /// of `use pyo3::class::gc::PyTraverseError`.
+    ///
+    /// For compatibility reasons this has not yet been removed, however will be done so
+    /// once <https://github.com/rust-lang/rust/issues/30827> is resolved.
+    pub mod gc {
+        pub use crate::pyclass::{PyTraverseError, PyVisit};
+    }
+}
+
+#[cfg(feature = "macros")]
+#[doc(hidden)]
+pub use {
+    indoc,    // Re-exported for py_run
+    unindent, // Re-exported for py_run
+};
+
+#[cfg(all(feature = "macros", feature = "multiple-pymethods"))]
+#[doc(hidden)]
+pub use inventory; // Re-exported for `#[pyclass]` and `#[pymethods]` with `multiple-pymethods`.
+
+/// Tests and helpers which reside inside PyO3's main library. Declared first so that macros
+/// are available in unit tests.
+#[cfg(test)]
+#[macro_use]
+mod tests;
+
+#[macro_use]
+mod internal_tricks;
+
+pub mod buffer;
+#[doc(hidden)]
+pub mod callback;
+pub mod conversion;
+mod conversions;
+#[cfg(feature = "experimental-async")]
+pub mod coroutine;
+#[macro_use]
+#[doc(hidden)]
+#[cfg(feature = "gil-refs")]
+pub mod derive_utils;
+mod err;
+pub mod exceptions;
+pub mod ffi;
+mod gil;
+#[doc(hidden)]
+pub mod impl_;
+mod instance;
+pub mod marker;
+pub mod marshal;
+#[macro_use]
+pub mod sync;
+pub mod panic;
+pub mod pybacked;
+pub mod pycell;
+pub mod pyclass;
+pub mod pyclass_init;
+
+pub mod type_object;
+pub mod types;
+mod version;
+
+#[allow(unused_imports)] // with no features enabled this module has no public exports
+pub use crate::conversions::*;
+
+#[cfg(feature = "macros")]
+pub use pyo3_macros::{pyfunction, pymethods, pymodule, FromPyObject};
+
+/// A proc macro used to expose Rust structs and fieldless enums as Python objects.
+///
+#[doc = include_str!("../guide/pyclass-parameters.md")]
+///
+/// For more on creating Python classes,
+/// see the [class section of the guide][1].
+///
+#[doc = concat!("[1]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/class.html")]
+#[cfg(feature = "macros")]
+pub use pyo3_macros::pyclass;
+
+#[cfg(feature = "macros")]
+#[macro_use]
+mod macros;
+
+#[cfg(feature = "experimental-inspect")]
+pub mod inspect;
+
+// Putting the declaration of prelude at the end seems to help encourage rustc and rustdoc to prefer using
+// other paths to the same items. (e.g. `pyo3::types::PyAnyMethods` instead of `pyo3::prelude::PyAnyMethods`).
+pub mod prelude;
+
+/// Ths module only contains re-exports of pyo3 deprecation warnings and exists
+/// purely to make compiler error messages nicer.
+///
+/// (The compiler uses this module in error messages, probably because it's a public
+/// re-export at a shorter path than `pyo3::impl_::deprecations`.)
+#[doc(hidden)]
+pub mod deprecations {
+    pub use crate::impl_::deprecations::*;
+}
+
+/// Test readme and user guide
+#[cfg(doctest)]
+pub mod doc_test {
+    macro_rules! doctests {
+        ($($path:expr => $mod:ident),* $(,)?) => {
+            $(
+                #[doc = include_str!(concat!("../", $path))]
+                mod $mod{}
+            )*
+        };
+    }
+
+    doctests! {
+        "README.md" => readme_md,
+        "guide/src/advanced.md" => guide_advanced_md,
+        "guide/src/async-await.md" => guide_async_await_md,
+        "guide/src/building-and-distribution.md" => guide_building_and_distribution_md,
+        "guide/src/building-and-distribution/multiple-python-versions.md" => guide_bnd_multiple_python_versions_md,
+        "guide/src/class.md" => guide_class_md,
+        "guide/src/class/call.md" => guide_class_call,
+        "guide/src/class/object.md" => guide_class_object,
+        "guide/src/class/numeric.md" => guide_class_numeric,
+        "guide/src/class/protocols.md" => guide_class_protocols_md,
+        "guide/src/conversions.md" => guide_conversions_md,
+        "guide/src/conversions/tables.md" => guide_conversions_tables_md,
+        "guide/src/conversions/traits.md" => guide_conversions_traits_md,
+        "guide/src/debugging.md" => guide_debugging_md,
+
+        // deliberate choice not to test guide/ecosystem because those pages depend on external
+        // crates such as pyo3_asyncio.
+
+        "guide/src/exception.md" => guide_exception_md,
+        "guide/src/faq.md" => guide_faq_md,
+        "guide/src/features.md" => guide_features_md,
+        "guide/src/function.md" => guide_function_md,
+        "guide/src/function/error-handling.md" => guide_function_error_handling_md,
+        "guide/src/function/signature.md" => guide_function_signature_md,
+        "guide/src/memory.md" => guide_memory_md,
+        "guide/src/migration.md" => guide_migration_md,
+        "guide/src/module.md" => guide_module_md,
+        "guide/src/parallelism.md" => guide_parallelism_md,
+        "guide/src/performance.md" => guide_performance_md,
+        "guide/src/python-from-rust.md" => guide_python_from_rust_md,
+        "guide/src/python-from-rust/calling-existing-code.md" => guide_pfr_calling_existing_code_md,
+        "guide/src/python-from-rust/function-calls.md" => guide_pfr_function_calls_md,
+        "guide/src/python-typing-hints.md" => guide_python_typing_hints_md,
+        "guide/src/rust-from-python.md" => guide_rust_from_python_md,
+        "guide/src/trait-bounds.md" => guide_trait_bounds_md,
+        "guide/src/types.md" => guide_types_md,
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/macros.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/macros.rs
--- 43.0.0-1/rust-vendor/pyo3/src/macros.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/macros.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,222 @@
+/// A convenient macro to execute a Python code snippet, with some local variables set.
+///
+/// # Panics
+///
+/// This macro internally calls [`Python::run_bound`](crate::Python::run_bound) and panics
+/// if it returns `Err`, after printing the error to stdout.
+///
+/// If you need to handle failures, please use [`Python::run_bound`](crate::marker::Python::run_bound) instead.
+///
+/// # Examples
+/// ```
+/// use pyo3::{prelude::*, py_run, types::PyList};
+///
+/// Python::with_gil(|py| {
+///     let list = PyList::new_bound(py, &[1, 2, 3]);
+///     py_run!(py, list, "assert list == [1, 2, 3]");
+/// });
+/// ```
+///
+/// You can use this macro to test pyfunctions or pyclasses quickly.
+///
+/// ```
+/// use pyo3::{prelude::*, py_run};
+///
+/// #[pyclass]
+/// #[derive(Debug)]
+/// struct Time {
+///     hour: u32,
+///     minute: u32,
+///     second: u32,
+/// }
+///
+/// #[pymethods]
+/// impl Time {
+///     fn repl_japanese(&self) -> String {
+///         format!("{}時{}分{}秒", self.hour, self.minute, self.second)
+///     }
+///     #[getter]
+///     fn hour(&self) -> u32 {
+///         self.hour
+///     }
+///     fn as_tuple(&self) -> (u32, u32, u32) {
+///         (self.hour, self.minute, self.second)
+///     }
+/// }
+///
+/// Python::with_gil(|py| {
+///     let time = Py::new(py, Time {hour: 8, minute: 43, second: 16}).unwrap();
+///     let time_as_tuple = (8, 43, 16);
+///     py_run!(py, time time_as_tuple, r#"
+///         assert time.hour == 8
+///         assert time.repl_japanese() == "8時43分16秒"
+///         assert time.as_tuple() == time_as_tuple
+///     "#);
+/// });
+/// ```
+///
+/// If you need to prepare the `locals` dict by yourself, you can pass it as `*locals`.
+///
+/// ```
+/// use pyo3::prelude::*;
+/// use pyo3::types::IntoPyDict;
+///
+/// #[pyclass]
+/// struct MyClass;
+///
+/// #[pymethods]
+/// impl MyClass {
+///     #[new]
+///     fn new() -> Self {
+///         MyClass {}
+///     }
+/// }
+///
+/// Python::with_gil(|py| {
+///     let locals = [("C", py.get_type_bound::<MyClass>())].into_py_dict_bound(py);
+///     pyo3::py_run!(py, *locals, "c = C()");
+/// });
+/// ```
+#[macro_export]
+macro_rules! py_run {
+    ($py:expr, $($val:ident)+, $code:literal) => {{
+        $crate::py_run_impl!($py, $($val)+, $crate::indoc::indoc!($code))
+    }};
+    ($py:expr, $($val:ident)+, $code:expr) => {{
+        $crate::py_run_impl!($py, $($val)+, &$crate::unindent::unindent($code))
+    }};
+    ($py:expr, *$dict:expr, $code:literal) => {{
+        $crate::py_run_impl!($py, *$dict, $crate::indoc::indoc!($code))
+    }};
+    ($py:expr, *$dict:expr, $code:expr) => {{
+        $crate::py_run_impl!($py, *$dict, &$crate::unindent::unindent($code))
+    }};
+}
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! py_run_impl {
+    ($py:expr, $($val:ident)+, $code:expr) => {{
+        use $crate::types::IntoPyDict;
+        use $crate::ToPyObject;
+        let d = [$((stringify!($val), $val.to_object($py)),)+].into_py_dict_bound($py);
+        $crate::py_run_impl!($py, *d, $code)
+    }};
+    ($py:expr, *$dict:expr, $code:expr) => {{
+        use ::std::option::Option::*;
+        #[allow(unused_imports)]
+        #[cfg(feature = "gil-refs")]
+        use $crate::PyNativeType;
+        if let ::std::result::Result::Err(e) = $py.run_bound($code, None, Some(&$dict.as_borrowed())) {
+            e.print($py);
+            // So when this c api function the last line called printed the error to stderr,
+            // the output is only written into a buffer which is never flushed because we
+            // panic before flushing. This is where this hack comes into place
+            $py.run_bound("import sys; sys.stderr.flush()", None, None)
+                .unwrap();
+            ::std::panic!("{}", $code)
+        }
+    }};
+}
+
+/// Wraps a Rust function annotated with [`#[pyfunction]`](macro@crate::pyfunction).
+///
+/// This can be used with [`PyModule::add_function`](crate::types::PyModuleMethods::add_function) to
+/// add free functions to a [`PyModule`](crate::types::PyModule) - see its documentation for more
+/// information.
+///
+/// During the migration from the GIL Ref API to the Bound API, the return type of this macro will
+/// be either the `&'py PyModule` GIL Ref or `Bound<'py, PyModule>` according to the second
+/// argument.
+///
+/// For backwards compatibility, if the second argument is `Python<'py>` then the return type will
+/// be `&'py PyModule` GIL Ref. To get `Bound<'py, PyModule>`, use the [`crate::wrap_pyfunction_bound!`]
+/// macro instead.
+#[macro_export]
+macro_rules! wrap_pyfunction {
+    ($function:path) => {
+        &|py_or_module| {
+            use $function as wrapped_pyfunction;
+            $crate::impl_::pyfunction::WrapPyFunctionArg::wrap_pyfunction(
+                py_or_module,
+                &wrapped_pyfunction::_PYO3_DEF,
+            )
+        }
+    };
+    ($function:path, $py_or_module:expr) => {{
+        use $function as wrapped_pyfunction;
+        let check_gil_refs = $crate::impl_::deprecations::GilRefs::new();
+        let py_or_module =
+            $crate::impl_::deprecations::inspect_type($py_or_module, &check_gil_refs);
+        check_gil_refs.is_python();
+        $crate::impl_::pyfunction::WrapPyFunctionArg::wrap_pyfunction(
+            py_or_module,
+            &wrapped_pyfunction::_PYO3_DEF,
+        )
+    }};
+}
+
+/// Wraps a Rust function annotated with [`#[pyfunction]`](macro@crate::pyfunction).
+///
+/// This can be used with [`PyModule::add_function`](crate::types::PyModuleMethods::add_function) to
+/// add free functions to a [`PyModule`](crate::types::PyModule) - see its documentation for more
+/// information.
+#[macro_export]
+macro_rules! wrap_pyfunction_bound {
+    ($function:path) => {
+        &|py_or_module| {
+            use $function as wrapped_pyfunction;
+            $crate::impl_::pyfunction::WrapPyFunctionArg::wrap_pyfunction(
+                $crate::impl_::pyfunction::OnlyBound(py_or_module),
+                &wrapped_pyfunction::_PYO3_DEF,
+            )
+        }
+    };
+    ($function:path, $py_or_module:expr) => {{
+        use $function as wrapped_pyfunction;
+        $crate::impl_::pyfunction::WrapPyFunctionArg::wrap_pyfunction(
+            $crate::impl_::pyfunction::OnlyBound($py_or_module),
+            &wrapped_pyfunction::_PYO3_DEF,
+        )
+    }};
+}
+
+/// Returns a function that takes a [`Python`](crate::Python) instance and returns a
+/// Python module.
+///
+/// Use this together with [`#[pymodule]`](crate::pymodule) and
+/// [`PyModule::add_wrapped`](crate::types::PyModuleMethods::add_wrapped).
+#[macro_export]
+macro_rules! wrap_pymodule {
+    ($module:path) => {
+        &|py| {
+            use $module as wrapped_pymodule;
+            wrapped_pymodule::_PYO3_DEF
+                .make_module(py)
+                .expect("failed to wrap pymodule")
+        }
+    };
+}
+
+/// Add the module to the initialization table in order to make embedded Python code to use it.
+/// Module name is the argument.
+///
+/// Use it before [`prepare_freethreaded_python`](crate::prepare_freethreaded_python) and
+/// leave feature `auto-initialize` off
+#[cfg(not(any(PyPy, GraalPy)))]
+#[macro_export]
+macro_rules! append_to_inittab {
+    ($module:ident) => {
+        unsafe {
+            if $crate::ffi::Py_IsInitialized() != 0 {
+                ::std::panic!(
+                    "called `append_to_inittab` but a Python interpreter is already running."
+                );
+            }
+            $crate::ffi::PyImport_AppendInittab(
+                $module::__PYO3_NAME.as_ptr(),
+                ::std::option::Option::Some($module::__pyo3_init),
+            );
+        }
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/marker.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/marker.rs
--- 43.0.0-1/rust-vendor/pyo3/src/marker.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/marker.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1325 @@
+//! Fundamental properties of objects tied to the Python interpreter.
+//!
+//! The Python interpreter is not threadsafe. To protect the Python interpreter in multithreaded
+//! scenarios there is a global lock, the *global interpreter lock* (hereafter referred to as *GIL*)
+//! that must be held to safely interact with Python objects. This is why in PyO3 when you acquire
+//! the GIL you get a [`Python`] marker token that carries the *lifetime* of holding the GIL and all
+//! borrowed references to Python objects carry this lifetime as well. This will statically ensure
+//! that you can never use Python objects after dropping the lock - if you mess this up it will be
+//! caught at compile time and your program will fail to compile.
+//!
+//! It also supports this pattern that many extension modules employ:
+//! - Drop the GIL, so that other Python threads can acquire it and make progress themselves
+//! - Do something independently of the Python interpreter, like IO, a long running calculation or
+//!   awaiting a future
+//! - Once that is done, reacquire the GIL
+//!
+//! That API is provided by [`Python::allow_threads`] and enforced via the [`Ungil`] bound on the
+//! closure and the return type. This is done by relying on the [`Send`] auto trait. `Ungil` is
+//! defined as the following:
+//!
+//! ```rust
+//! # #![allow(dead_code)]
+//! pub unsafe trait Ungil {}
+//!
+//! unsafe impl<T: Send> Ungil for T {}
+//! ```
+//!
+//! We piggy-back off the `Send` auto trait because it is not possible to implement custom auto
+//! traits on stable Rust. This is the solution which enables it for as many types as possible while
+//! making the API usable.
+//!
+//! In practice this API works quite well, but it comes with some drawbacks:
+//!
+//! ## Drawbacks
+//!
+//! There is no reason to prevent `!Send` types like [`Rc`] from crossing the closure. After all,
+//! [`Python::allow_threads`] just lets other Python threads run - it does not itself launch a new
+//! thread.
+//!
+//! ```rust, compile_fail
+//! # #[cfg(feature = "nightly")]
+//! # compile_error!("this actually works on nightly")
+//! use pyo3::prelude::*;
+//! use std::rc::Rc;
+//!
+//! fn main() {
+//!     Python::with_gil(|py| {
+//!         let rc = Rc::new(5);
+//!
+//!         py.allow_threads(|| {
+//!             // This would actually be fine...
+//!             println!("{:?}", *rc);
+//!         });
+//!     });
+//! }
+//! ```
+//!
+//! Because we are using `Send` for something it's not quite meant for, other code that
+//! (correctly) upholds the invariants of [`Send`] can cause problems.
+//!
+//! [`SendWrapper`] is one of those. Per its documentation:
+//!
+//! > A wrapper which allows you to move around non-Send-types between threads, as long as you
+//! > access the contained value only from within the original thread and make sure that it is
+//! > dropped from within the original thread.
+//!
+//! This will "work" to smuggle Python references across the closure, because we're not actually
+//! doing anything with threads:
+//!
+//! ```rust, no_run
+//! use pyo3::prelude::*;
+//! use pyo3::types::PyString;
+//! use send_wrapper::SendWrapper;
+//!
+//! Python::with_gil(|py| {
+//!     let string = PyString::new_bound(py, "foo");
+//!
+//!     let wrapped = SendWrapper::new(string);
+//!
+//!     py.allow_threads(|| {
+//! # #[cfg(not(feature = "nightly"))]
+//! # {
+//!         // 💥 Unsound! 💥
+//!         let smuggled: &Bound<'_, PyString> = &*wrapped;
+//!         println!("{:?}", smuggled);
+//! # }
+//!     });
+//! });
+//! ```
+//!
+//! For now the answer to that is "don't do that".
+//!
+//! # A proper implementation using an auto trait
+//!
+//! However on nightly Rust and when PyO3's `nightly` feature is
+//! enabled, `Ungil` is defined as the following:
+//!
+//! ```rust
+//! # #[cfg(any())]
+//! # {
+//! #![feature(auto_traits, negative_impls)]
+//!
+//! pub unsafe auto trait Ungil {}
+//!
+//! // It is unimplemented for the `Python` struct and Python objects.
+//! impl !Ungil for Python<'_> {}
+//! impl !Ungil for ffi::PyObject {}
+//!
+//! // `Py` wraps it in  a safe api, so this is OK
+//! unsafe impl<T> Ungil for Py<T> {}
+//! # }
+//! ```
+//!
+//! With this feature enabled, the above two examples will start working and not working, respectively.
+//!
+//! [`SendWrapper`]: https://docs.rs/send_wrapper/latest/send_wrapper/struct.SendWrapper.html
+//! [`Rc`]: std::rc::Rc
+//! [`Py`]: crate::Py
+use crate::err::{self, PyErr, PyResult};
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::gil::{GILGuard, SuspendGIL};
+use crate::impl_::not_send::NotSend;
+use crate::py_result_ext::PyResultExt;
+use crate::types::any::PyAnyMethods;
+use crate::types::{
+    PyAny, PyDict, PyEllipsis, PyModule, PyNone, PyNotImplemented, PyString, PyType,
+};
+use crate::version::PythonVersionInfo;
+use crate::{ffi, Bound, IntoPy, Py, PyObject, PyTypeInfo};
+#[allow(deprecated)]
+#[cfg(feature = "gil-refs")]
+use crate::{gil::GILPool, FromPyPointer, PyNativeType};
+use std::ffi::{CStr, CString};
+use std::marker::PhantomData;
+use std::os::raw::c_int;
+
+/// Types that are safe to access while the GIL is not held.
+///
+/// # Safety
+///
+/// The type must not carry borrowed Python references or, if it does, not allow access to them if
+/// the GIL is not held.
+///
+/// See the [module-level documentation](self) for more information.
+///
+/// # Examples
+///
+/// This tracking is currently imprecise as it relies on the [`Send`] auto trait on stable Rust.
+/// For example, an `Rc` smart pointer should be usable without the GIL, but we currently prevent that:
+///
+/// ```compile_fail
+/// # use pyo3::prelude::*;
+/// use std::rc::Rc;
+///
+/// Python::with_gil(|py| {
+///     let rc = Rc::new(42);
+///
+///     py.allow_threads(|| {
+///         println!("{:?}", rc);
+///     });
+/// });
+/// ```
+///
+/// This also implies that the interplay between `with_gil` and `allow_threads` is unsound, for example
+/// one can circumvent this protection using the [`send_wrapper`](https://docs.rs/send_wrapper/) crate:
+///
+/// ```no_run
+/// # use pyo3::prelude::*;
+/// # use pyo3::types::PyString;
+/// use send_wrapper::SendWrapper;
+///
+/// Python::with_gil(|py| {
+///     let string = PyString::new_bound(py, "foo");
+///
+///     let wrapped = SendWrapper::new(string);
+///
+///     py.allow_threads(|| {
+///         let sneaky: &Bound<'_, PyString> = &*wrapped;
+///
+///         println!("{:?}", sneaky);
+///     });
+/// });
+/// ```
+///
+/// Fixing this loophole on stable Rust has significant ergonomic issues, but it is fixed when using
+/// nightly Rust and the `nightly` feature, c.f. [#2141](https://github.com/PyO3/pyo3/issues/2141).
+#[cfg_attr(docsrs, doc(cfg(all())))] // Hide the cfg flag
+#[cfg(not(feature = "nightly"))]
+pub unsafe trait Ungil {}
+
+#[cfg_attr(docsrs, doc(cfg(all())))] // Hide the cfg flag
+#[cfg(not(feature = "nightly"))]
+unsafe impl<T: Send> Ungil for T {}
+
+#[cfg(feature = "nightly")]
+mod nightly {
+    macro_rules! define {
+        ($($tt:tt)*) => { $($tt)* }
+    }
+
+    define! {
+        /// Types that are safe to access while the GIL is not held.
+        ///
+        /// # Safety
+        ///
+        /// The type must not carry borrowed Python references or, if it does, not allow access to them if
+        /// the GIL is not held.
+        ///
+        /// See the [module-level documentation](self) for more information.
+        ///
+        /// # Examples
+        ///
+        /// Types which are `Ungil` cannot be used in contexts where the GIL was released, e.g.
+        ///
+        /// ```compile_fail
+        /// # use pyo3::prelude::*;
+        /// # use pyo3::types::PyString;
+        /// Python::with_gil(|py| {
+        ///     let string = PyString::new_bound(py, "foo");
+        ///
+        ///     py.allow_threads(|| {
+        ///         println!("{:?}", string);
+        ///     });
+        /// });
+        /// ```
+        ///
+        /// This applies to the GIL token `Python` itself as well, e.g.
+        ///
+        /// ```compile_fail
+        /// # use pyo3::prelude::*;
+        /// Python::with_gil(|py| {
+        ///     py.allow_threads(|| {
+        ///         drop(py);
+        ///     });
+        /// });
+        /// ```
+        ///
+        /// On nightly Rust, this is not based on the [`Send`] auto trait and hence we are able
+        /// to prevent incorrectly circumventing it using e.g. the [`send_wrapper`](https://docs.rs/send_wrapper/) crate:
+        ///
+        /// ```compile_fail
+        /// # use pyo3::prelude::*;
+        /// # use pyo3::types::PyString;
+        /// use send_wrapper::SendWrapper;
+        ///
+        /// Python::with_gil(|py| {
+        ///     let string = PyString::new_bound(py, "foo");
+        ///
+        ///     let wrapped = SendWrapper::new(string);
+        ///
+        ///     py.allow_threads(|| {
+        ///         let sneaky: &PyString = *wrapped;
+        ///
+        ///         println!("{:?}", sneaky);
+        ///     });
+        /// });
+        /// ```
+        ///
+        /// This also enables using non-[`Send`] types in `allow_threads`,
+        /// at least if they are not also bound to the GIL:
+        ///
+        /// ```rust
+        /// # use pyo3::prelude::*;
+        /// use std::rc::Rc;
+        ///
+        /// Python::with_gil(|py| {
+        ///     let rc = Rc::new(42);
+        ///
+        ///     py.allow_threads(|| {
+        ///         println!("{:?}", rc);
+        ///     });
+        /// });
+        /// ```
+        pub unsafe auto trait Ungil {}
+    }
+
+    impl !Ungil for crate::Python<'_> {}
+
+    // This means that PyString, PyList, etc all inherit !Ungil from  this.
+    impl !Ungil for crate::PyAny {}
+
+    // All the borrowing wrappers
+    #[allow(deprecated)]
+    #[cfg(feature = "gil-refs")]
+    impl<T> !Ungil for crate::PyCell<T> {}
+    impl<T> !Ungil for crate::PyRef<'_, T> {}
+    impl<T> !Ungil for crate::PyRefMut<'_, T> {}
+
+    // FFI pointees
+    impl !Ungil for crate::ffi::PyObject {}
+    impl !Ungil for crate::ffi::PyLongObject {}
+
+    impl !Ungil for crate::ffi::PyThreadState {}
+    impl !Ungil for crate::ffi::PyInterpreterState {}
+    impl !Ungil for crate::ffi::PyWeakReference {}
+    impl !Ungil for crate::ffi::PyFrameObject {}
+    impl !Ungil for crate::ffi::PyCodeObject {}
+    #[cfg(not(Py_LIMITED_API))]
+    impl !Ungil for crate::ffi::PyDictKeysObject {}
+    #[cfg(not(any(Py_LIMITED_API, Py_3_10)))]
+    impl !Ungil for crate::ffi::PyArena {}
+}
+
+#[cfg(feature = "nightly")]
+pub use nightly::Ungil;
+
+/// A marker token that represents holding the GIL.
+///
+/// It serves three main purposes:
+/// - It provides a global API for the Python interpreter, such as [`Python::eval_bound`].
+/// - It can be passed to functions that require a proof of holding the GIL, such as
+///   [`Py::clone_ref`].
+/// - Its lifetime represents the scope of holding the GIL which can be used to create Rust
+///   references that are bound to it, such as [`Bound<'py, PyAny>`].
+///
+/// Note that there are some caveats to using it that you might need to be aware of. See the
+/// [Deadlocks](#deadlocks) and [Releasing and freeing memory](#releasing-and-freeing-memory)
+/// paragraphs for more information about that.
+///
+/// # Obtaining a Python token
+///
+/// The following are the recommended ways to obtain a [`Python<'py>`] token, in order of preference:
+/// - If you already have something with a lifetime bound to the GIL, such as [`Bound<'py, PyAny>`], you can
+///   use its `.py()` method to get a token.
+/// - In a function or method annotated with [`#[pyfunction]`](crate::pyfunction) or [`#[pymethods]`](crate::pymethods) you can declare it
+///   as a parameter, and PyO3 will pass in the token when Python code calls it.
+/// - When you need to acquire the GIL yourself, such as when calling Python code from Rust, you
+///   should call [`Python::with_gil`] to do that and pass your code as a closure to it.
+///
+/// The first two options are zero-cost; [`Python::with_gil`] requires runtime checking and may need to block
+/// to acquire the GIL.
+///
+/// # Deadlocks
+///
+/// Note that the GIL can be temporarily released by the Python interpreter during a function call
+/// (e.g. importing a module). In general, you don't need to worry about this because the GIL is
+/// reacquired before returning to the Rust code:
+///
+/// ```text
+/// `Python` exists   |=====================================|
+/// GIL actually held |==========|         |================|
+/// Rust code running |=======|                |==|  |======|
+/// ```
+///
+/// This behaviour can cause deadlocks when trying to lock a Rust mutex while holding the GIL:
+///
+///  * Thread 1 acquires the GIL
+///  * Thread 1 locks a mutex
+///  * Thread 1 makes a call into the Python interpreter which releases the GIL
+///  * Thread 2 acquires the GIL
+///  * Thread 2 tries to locks the mutex, blocks
+///  * Thread 1's Python interpreter call blocks trying to reacquire the GIL held by thread 2
+///
+/// To avoid deadlocking, you should release the GIL before trying to lock a mutex or `await`ing in
+/// asynchronous code, e.g. with [`Python::allow_threads`].
+///
+/// # Releasing and freeing memory
+///
+/// The [`Python<'py>`] type can be used to create references to variables owned by the Python
+/// interpreter, using functions such as [`Python::eval_bound`] and [`PyModule::import_bound`].
+#[derive(Copy, Clone)]
+pub struct Python<'py>(PhantomData<(&'py GILGuard, NotSend)>);
+
+impl Python<'_> {
+    /// Acquires the global interpreter lock, allowing access to the Python interpreter. The
+    /// provided closure `F` will be executed with the acquired `Python` marker token.
+    ///
+    /// If implementing [`#[pymethods]`](crate::pymethods) or [`#[pyfunction]`](crate::pyfunction),
+    /// declare `py: Python` as an argument. PyO3 will pass in the token to grant access to the GIL
+    /// context in which the function is running, avoiding the need to call `with_gil`.
+    ///
+    /// If the [`auto-initialize`] feature is enabled and the Python runtime is not already
+    /// initialized, this function will initialize it. See
+    #[cfg_attr(
+        not(any(PyPy, GraalPy)),
+        doc = "[`prepare_freethreaded_python`](crate::prepare_freethreaded_python)"
+    )]
+    #[cfg_attr(PyPy, doc = "`prepare_freethreaded_python`")]
+    /// for details.
+    ///
+    /// If the current thread does not yet have a Python "thread state" associated with it,
+    /// a new one will be automatically created before `F` is executed and destroyed after `F`
+    /// completes.
+    ///
+    /// # Panics
+    ///
+    /// - If the [`auto-initialize`] feature is not enabled and the Python interpreter is not
+    ///   initialized.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use pyo3::prelude::*;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let x: i32 = py.eval_bound("5", None, None)?.extract()?;
+    ///     assert_eq!(x, 5);
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// [`auto-initialize`]: https://pyo3.rs/main/features.html#auto-initialize
+    #[inline]
+    pub fn with_gil<F, R>(f: F) -> R
+    where
+        F: for<'py> FnOnce(Python<'py>) -> R,
+    {
+        let guard = GILGuard::acquire();
+
+        // SAFETY: Either the GIL was already acquired or we just created a new `GILGuard`.
+        f(guard.python())
+    }
+
+    /// Like [`Python::with_gil`] except Python interpreter state checking is skipped.
+    ///
+    /// Normally when the GIL is acquired, we check that the Python interpreter is an
+    /// appropriate state (e.g. it is fully initialized). This function skips those
+    /// checks.
+    ///
+    /// # Safety
+    ///
+    /// If [`Python::with_gil`] would succeed, it is safe to call this function.
+    ///
+    /// In most cases, you should use [`Python::with_gil`].
+    ///
+    /// A justified scenario for calling this function is during multi-phase interpreter
+    /// initialization when [`Python::with_gil`] would fail before
+    // this link is only valid on 3.8+not pypy and up.
+    #[cfg_attr(
+        all(Py_3_8, not(PyPy)),
+        doc = "[`_Py_InitializeMain`](crate::ffi::_Py_InitializeMain)"
+    )]
+    #[cfg_attr(any(not(Py_3_8), PyPy), doc = "`_Py_InitializeMain`")]
+    /// is called because the interpreter is only partially initialized.
+    ///
+    /// Behavior in other scenarios is not documented.
+    #[inline]
+    pub unsafe fn with_gil_unchecked<F, R>(f: F) -> R
+    where
+        F: for<'py> FnOnce(Python<'py>) -> R,
+    {
+        let guard = GILGuard::acquire_unchecked();
+
+        f(guard.python())
+    }
+}
+
+impl<'py> Python<'py> {
+    /// Temporarily releases the GIL, thus allowing other Python threads to run. The GIL will be
+    /// reacquired when `F`'s scope ends.
+    ///
+    /// If you don't need to touch the Python
+    /// interpreter for some time and have other Python threads around, this will let you run
+    /// Rust-only code while letting those other Python threads make progress.
+    ///
+    /// Only types that implement [`Ungil`] can cross the closure. See the
+    /// [module level documentation](self) for more information.
+    ///
+    /// If you need to pass Python objects into the closure you can use [`Py`]`<T>`to create a
+    /// reference independent of the GIL lifetime. However, you cannot do much with those without a
+    /// [`Python`] token, for which you'd need to reacquire the GIL.
+    ///
+    /// # Example: Releasing the GIL while running a computation in Rust-only code
+    ///
+    /// ```
+    /// use pyo3::prelude::*;
+    ///
+    /// #[pyfunction]
+    /// fn sum_numbers(py: Python<'_>, numbers: Vec<u32>) -> PyResult<u32> {
+    ///     // We release the GIL here so any other Python threads get a chance to run.
+    ///     py.allow_threads(move || {
+    ///         // An example of an "expensive" Rust calculation
+    ///         let sum = numbers.iter().sum();
+    ///
+    ///         Ok(sum)
+    ///     })
+    /// }
+    /// #
+    /// # fn main() -> PyResult<()> {
+    /// #     Python::with_gil(|py| -> PyResult<()> {
+    /// #         let fun = pyo3::wrap_pyfunction_bound!(sum_numbers, py)?;
+    /// #         let res = fun.call1((vec![1_u32, 2, 3],))?;
+    /// #         assert_eq!(res.extract::<u32>()?, 6_u32);
+    /// #         Ok(())
+    /// #     })
+    /// # }
+    /// ```
+    ///
+    /// Please see the [Parallelism] chapter of the guide for a thorough discussion of using
+    /// [`Python::allow_threads`] in this manner.
+    ///
+    /// # Example: Passing borrowed Python references into the closure is not allowed
+    ///
+    /// ```compile_fail
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyString;
+    ///
+    /// fn parallel_print(py: Python<'_>) {
+    ///     let s = PyString::new_bound(py, "This object cannot be accessed without holding the GIL >_<");
+    ///     py.allow_threads(move || {
+    ///         println!("{:?}", s); // This causes a compile error.
+    ///     });
+    /// }
+    /// ```
+    ///
+    /// [`Py`]: crate::Py
+    /// [`PyString`]: crate::types::PyString
+    /// [auto-traits]: https://doc.rust-lang.org/nightly/unstable-book/language-features/auto-traits.html
+    /// [Parallelism]: https://pyo3.rs/main/parallelism.html
+    pub fn allow_threads<T, F>(self, f: F) -> T
+    where
+        F: Ungil + FnOnce() -> T,
+        T: Ungil,
+    {
+        // Use a guard pattern to handle reacquiring the GIL,
+        // so that the GIL will be reacquired even if `f` panics.
+        // The `Send` bound on the closure prevents the user from
+        // transferring the `Python` token into the closure.
+        let _guard = unsafe { SuspendGIL::new() };
+        f()
+    }
+
+    /// Deprecated version of [`Python::eval_bound`]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`Python::eval` will be replaced by `Python::eval_bound` in a future PyO3 version"
+    )]
+    pub fn eval(
+        self,
+        code: &str,
+        globals: Option<&'py PyDict>,
+        locals: Option<&'py PyDict>,
+    ) -> PyResult<&'py PyAny> {
+        self.eval_bound(
+            code,
+            globals.map(PyNativeType::as_borrowed).as_deref(),
+            locals.map(PyNativeType::as_borrowed).as_deref(),
+        )
+        .map(Bound::into_gil_ref)
+    }
+
+    /// Evaluates a Python expression in the given context and returns the result.
+    ///
+    /// If `globals` is `None`, it defaults to Python module `__main__`.
+    /// If `locals` is `None`, it defaults to the value of `globals`.
+    ///
+    /// If `globals` doesn't contain `__builtins__`, default `__builtins__`
+    /// will be added automatically.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # use pyo3::prelude::*;
+    /// # Python::with_gil(|py| {
+    /// let result = py.eval_bound("[i * 10 for i in range(5)]", None, None).unwrap();
+    /// let res: Vec<i64> = result.extract().unwrap();
+    /// assert_eq!(res, vec![0, 10, 20, 30, 40])
+    /// # });
+    /// ```
+    pub fn eval_bound(
+        self,
+        code: &str,
+        globals: Option<&Bound<'py, PyDict>>,
+        locals: Option<&Bound<'py, PyDict>>,
+    ) -> PyResult<Bound<'py, PyAny>> {
+        self.run_code(code, ffi::Py_eval_input, globals, locals)
+    }
+
+    /// Deprecated version of [`Python::run_bound`]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`Python::run` will be replaced by `Python::run_bound` in a future PyO3 version"
+    )]
+    pub fn run(
+        self,
+        code: &str,
+        globals: Option<&PyDict>,
+        locals: Option<&PyDict>,
+    ) -> PyResult<()> {
+        self.run_bound(
+            code,
+            globals.map(PyNativeType::as_borrowed).as_deref(),
+            locals.map(PyNativeType::as_borrowed).as_deref(),
+        )
+    }
+
+    /// Executes one or more Python statements in the given context.
+    ///
+    /// If `globals` is `None`, it defaults to Python module `__main__`.
+    /// If `locals` is `None`, it defaults to the value of `globals`.
+    ///
+    /// If `globals` doesn't contain `__builtins__`, default `__builtins__`
+    /// will be added automatically.
+    ///
+    /// # Examples
+    /// ```
+    /// use pyo3::{
+    ///     prelude::*,
+    ///     types::{PyBytes, PyDict},
+    /// };
+    /// Python::with_gil(|py| {
+    ///     let locals = PyDict::new_bound(py);
+    ///     py.run_bound(
+    ///         r#"
+    /// import base64
+    /// s = 'Hello Rust!'
+    /// ret = base64.b64encode(s.encode('utf-8'))
+    /// "#,
+    ///         None,
+    ///         Some(&locals),
+    ///     )
+    ///     .unwrap();
+    ///     let ret = locals.get_item("ret").unwrap().unwrap();
+    ///     let b64 = ret.downcast::<PyBytes>().unwrap();
+    ///     assert_eq!(b64.as_bytes(), b"SGVsbG8gUnVzdCE=");
+    /// });
+    /// ```
+    ///
+    /// You can use [`py_run!`](macro.py_run.html) for a handy alternative of `run`
+    /// if you don't need `globals` and unwrapping is OK.
+    pub fn run_bound(
+        self,
+        code: &str,
+        globals: Option<&Bound<'py, PyDict>>,
+        locals: Option<&Bound<'py, PyDict>>,
+    ) -> PyResult<()> {
+        let res = self.run_code(code, ffi::Py_file_input, globals, locals);
+        res.map(|obj| {
+            debug_assert!(obj.is_none());
+        })
+    }
+
+    /// Runs code in the given context.
+    ///
+    /// `start` indicates the type of input expected: one of `Py_single_input`,
+    /// `Py_file_input`, or `Py_eval_input`.
+    ///
+    /// If `globals` is `None`, it defaults to Python module `__main__`.
+    /// If `locals` is `None`, it defaults to the value of `globals`.
+    fn run_code(
+        self,
+        code: &str,
+        start: c_int,
+        globals: Option<&Bound<'py, PyDict>>,
+        locals: Option<&Bound<'py, PyDict>>,
+    ) -> PyResult<Bound<'py, PyAny>> {
+        let code = CString::new(code)?;
+        unsafe {
+            let mptr = ffi::PyImport_AddModule(ffi::c_str!("__main__").as_ptr());
+            if mptr.is_null() {
+                return Err(PyErr::fetch(self));
+            }
+
+            let globals = globals
+                .map(|dict| dict.as_ptr())
+                .unwrap_or_else(|| ffi::PyModule_GetDict(mptr));
+            let locals = locals.map(|dict| dict.as_ptr()).unwrap_or(globals);
+
+            // If `globals` don't provide `__builtins__`, most of the code will fail if Python
+            // version is <3.10. That's probably not what user intended, so insert `__builtins__`
+            // for them.
+            //
+            // See also:
+            // - https://github.com/python/cpython/pull/24564 (the same fix in CPython 3.10)
+            // - https://github.com/PyO3/pyo3/issues/3370
+            let builtins_s = crate::intern!(self, "__builtins__").as_ptr();
+            let has_builtins = ffi::PyDict_Contains(globals, builtins_s);
+            if has_builtins == -1 {
+                return Err(PyErr::fetch(self));
+            }
+            if has_builtins == 0 {
+                // Inherit current builtins.
+                let builtins = ffi::PyEval_GetBuiltins();
+
+                // `PyDict_SetItem` doesn't take ownership of `builtins`, but `PyEval_GetBuiltins`
+                // seems to return a borrowed reference, so no leak here.
+                if ffi::PyDict_SetItem(globals, builtins_s, builtins) == -1 {
+                    return Err(PyErr::fetch(self));
+                }
+            }
+
+            let code_obj =
+                ffi::Py_CompileString(code.as_ptr(), ffi::c_str!("<string>").as_ptr(), start);
+            if code_obj.is_null() {
+                return Err(PyErr::fetch(self));
+            }
+            let res_ptr = ffi::PyEval_EvalCode(code_obj, globals, locals);
+            ffi::Py_DECREF(code_obj);
+
+            res_ptr.assume_owned_or_err(self).downcast_into_unchecked()
+        }
+    }
+
+    /// Gets the Python type object for type `T`.
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`Python::get_type` will be replaced by `Python::get_type_bound` in a future PyO3 version"
+    )]
+    #[inline]
+    pub fn get_type<T>(self) -> &'py PyType
+    where
+        T: PyTypeInfo,
+    {
+        self.get_type_bound::<T>().into_gil_ref()
+    }
+
+    /// Gets the Python type object for type `T`.
+    #[inline]
+    pub fn get_type_bound<T>(self) -> Bound<'py, PyType>
+    where
+        T: PyTypeInfo,
+    {
+        T::type_object_bound(self)
+    }
+
+    /// Deprecated form of [`Python::import_bound`]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`Python::import` will be replaced by `Python::import_bound` in a future PyO3 version"
+    )]
+    pub fn import<N>(self, name: N) -> PyResult<&'py PyModule>
+    where
+        N: IntoPy<Py<PyString>>,
+    {
+        Self::import_bound(self, name).map(Bound::into_gil_ref)
+    }
+
+    /// Imports the Python module with the specified name.
+    pub fn import_bound<N>(self, name: N) -> PyResult<Bound<'py, PyModule>>
+    where
+        N: IntoPy<Py<PyString>>,
+    {
+        PyModule::import_bound(self, name)
+    }
+
+    /// Gets the Python builtin value `None`.
+    #[allow(non_snake_case)] // the Python keyword starts with uppercase
+    #[inline]
+    pub fn None(self) -> PyObject {
+        PyNone::get_bound(self).into_py(self)
+    }
+
+    /// Gets the Python builtin value `Ellipsis`, or `...`.
+    #[allow(non_snake_case)] // the Python keyword starts with uppercase
+    #[inline]
+    pub fn Ellipsis(self) -> PyObject {
+        PyEllipsis::get_bound(self).into_py(self)
+    }
+
+    /// Gets the Python builtin value `NotImplemented`.
+    #[allow(non_snake_case)] // the Python keyword starts with uppercase
+    #[inline]
+    pub fn NotImplemented(self) -> PyObject {
+        PyNotImplemented::get_bound(self).into_py(self)
+    }
+
+    /// Gets the running Python interpreter version as a string.
+    ///
+    /// # Examples
+    /// ```rust
+    /// # use pyo3::Python;
+    /// Python::with_gil(|py| {
+    ///     // The full string could be, for example:
+    ///     // "3.10.0 (tags/v3.10.0:b494f59, Oct  4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)]"
+    ///     assert!(py.version().starts_with("3."));
+    /// });
+    /// ```
+    pub fn version(self) -> &'py str {
+        unsafe {
+            CStr::from_ptr(ffi::Py_GetVersion())
+                .to_str()
+                .expect("Python version string not UTF-8")
+        }
+    }
+
+    /// Gets the running Python interpreter version as a struct similar to
+    /// `sys.version_info`.
+    ///
+    /// # Examples
+    /// ```rust
+    /// # use pyo3::Python;
+    /// Python::with_gil(|py| {
+    ///     // PyO3 supports Python 3.7 and up.
+    ///     assert!(py.version_info() >= (3, 7));
+    ///     assert!(py.version_info() >= (3, 7, 0));
+    /// });
+    /// ```
+    pub fn version_info(self) -> PythonVersionInfo<'py> {
+        let version_str = self.version();
+
+        // Portion of the version string returned by Py_GetVersion up to the first space is the
+        // version number.
+        let version_number_str = version_str.split(' ').next().unwrap_or(version_str);
+
+        PythonVersionInfo::from_str(version_number_str).unwrap()
+    }
+
+    /// Registers the object in the release pool, and tries to downcast to specific type.
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `obj.downcast_bound::<T>(py)` instead of `py.checked_cast_as::<T>(obj)`"
+    )]
+    pub fn checked_cast_as<T>(
+        self,
+        obj: PyObject,
+    ) -> Result<&'py T, crate::err::PyDowncastError<'py>>
+    where
+        T: crate::PyTypeCheck<AsRefTarget = T>,
+    {
+        #[allow(deprecated)]
+        obj.into_ref(self).downcast()
+    }
+
+    /// Registers the object in the release pool, and does an unchecked downcast
+    /// to the specific type.
+    ///
+    /// # Safety
+    ///
+    /// Callers must ensure that ensure that the cast is valid.
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `obj.downcast_bound_unchecked::<T>(py)` instead of `py.cast_as::<T>(obj)`"
+    )]
+    pub unsafe fn cast_as<T>(self, obj: PyObject) -> &'py T
+    where
+        T: crate::type_object::HasPyGilRef<AsRefTarget = T>,
+    {
+        #[allow(deprecated)]
+        obj.into_ref(self).downcast_unchecked()
+    }
+
+    /// Registers the object pointer in the release pool,
+    /// and does an unchecked downcast to the specific type.
+    ///
+    /// # Safety
+    ///
+    /// Callers must ensure that ensure that the cast is valid.
+    #[allow(clippy::wrong_self_convention, deprecated)]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `Py::from_owned_ptr(py, ptr)` or `Bound::from_owned_ptr(py, ptr)` instead"
+    )]
+    pub unsafe fn from_owned_ptr<T>(self, ptr: *mut ffi::PyObject) -> &'py T
+    where
+        T: FromPyPointer<'py>,
+    {
+        FromPyPointer::from_owned_ptr(self, ptr)
+    }
+
+    /// Registers the owned object pointer in the release pool.
+    ///
+    /// Returns `Err(PyErr)` if the pointer is NULL.
+    /// Does an unchecked downcast to the specific type.
+    ///
+    /// # Safety
+    ///
+    /// Callers must ensure that ensure that the cast is valid.
+    #[allow(clippy::wrong_self_convention, deprecated)]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `Py::from_owned_ptr_or_err(py, ptr)` or `Bound::from_owned_ptr_or_err(py, ptr)` instead"
+    )]
+    pub unsafe fn from_owned_ptr_or_err<T>(self, ptr: *mut ffi::PyObject) -> PyResult<&'py T>
+    where
+        T: FromPyPointer<'py>,
+    {
+        FromPyPointer::from_owned_ptr_or_err(self, ptr)
+    }
+
+    /// Registers the owned object pointer in release pool.
+    ///
+    /// Returns `None` if the pointer is NULL.
+    /// Does an unchecked downcast to the specific type.
+    ///
+    /// # Safety
+    ///
+    /// Callers must ensure that ensure that the cast is valid.
+    #[allow(clippy::wrong_self_convention, deprecated)]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `Py::from_owned_ptr_or_opt(py, ptr)` or `Bound::from_owned_ptr_or_opt(py, ptr)` instead"
+    )]
+    pub unsafe fn from_owned_ptr_or_opt<T>(self, ptr: *mut ffi::PyObject) -> Option<&'py T>
+    where
+        T: FromPyPointer<'py>,
+    {
+        FromPyPointer::from_owned_ptr_or_opt(self, ptr)
+    }
+
+    /// Does an unchecked downcast to the specific type.
+    ///
+    /// Panics if the pointer is NULL.
+    ///
+    /// # Safety
+    ///
+    /// Callers must ensure that ensure that the cast is valid.
+    #[allow(clippy::wrong_self_convention, deprecated)]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `Py::from_borrowed_ptr(py, ptr)` or `Bound::from_borrowed_ptr(py, ptr)` instead"
+    )]
+    pub unsafe fn from_borrowed_ptr<T>(self, ptr: *mut ffi::PyObject) -> &'py T
+    where
+        T: FromPyPointer<'py>,
+    {
+        FromPyPointer::from_borrowed_ptr(self, ptr)
+    }
+
+    /// Does an unchecked downcast to the specific type.
+    ///
+    /// Returns `Err(PyErr)` if the pointer is NULL.
+    ///
+    /// # Safety
+    ///
+    /// Callers must ensure that ensure that the cast is valid.
+    #[allow(clippy::wrong_self_convention, deprecated)]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `Py::from_borrowed_ptr_or_err(py, ptr)` or `Bound::from_borrowed_ptr_or_err(py, ptr)` instead"
+    )]
+    pub unsafe fn from_borrowed_ptr_or_err<T>(self, ptr: *mut ffi::PyObject) -> PyResult<&'py T>
+    where
+        T: FromPyPointer<'py>,
+    {
+        FromPyPointer::from_borrowed_ptr_or_err(self, ptr)
+    }
+
+    /// Does an unchecked downcast to the specific type.
+    ///
+    /// Returns `None` if the pointer is NULL.
+    ///
+    /// # Safety
+    ///
+    /// Callers must ensure that ensure that the cast is valid.
+    #[allow(clippy::wrong_self_convention, deprecated)]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `Py::from_borrowed_ptr_or_opt(py, ptr)` or `Bound::from_borrowed_ptr_or_opt(py, ptr)` instead"
+    )]
+    pub unsafe fn from_borrowed_ptr_or_opt<T>(self, ptr: *mut ffi::PyObject) -> Option<&'py T>
+    where
+        T: FromPyPointer<'py>,
+    {
+        FromPyPointer::from_borrowed_ptr_or_opt(self, ptr)
+    }
+
+    /// Lets the Python interpreter check and handle any pending signals. This will invoke the
+    /// corresponding signal handlers registered in Python (if any).
+    ///
+    /// Returns `Err(`[`PyErr`]`)` if any signal handler raises an exception.
+    ///
+    /// These signals include `SIGINT` (normally raised by CTRL + C), which by default raises
+    /// `KeyboardInterrupt`. For this reason it is good practice to call this function regularly
+    /// as part of long-running Rust functions so that users can cancel it.
+    ///
+    /// # Example
+    ///
+    /// ```rust
+    /// # #![allow(dead_code)] // this example is quite impractical to test
+    /// use pyo3::prelude::*;
+    ///
+    /// # fn main() {
+    /// #[pyfunction]
+    /// fn loop_forever(py: Python<'_>) -> PyResult<()> {
+    ///     loop {
+    ///         // As this loop is infinite it should check for signals every once in a while.
+    ///         // Using `?` causes any `PyErr` (potentially containing `KeyboardInterrupt`)
+    ///         // to break out of the loop.
+    ///         py.check_signals()?;
+    ///
+    ///         // do work here
+    ///         # break Ok(()) // don't actually loop forever
+    ///     }
+    /// }
+    /// # }
+    /// ```
+    ///
+    /// # Note
+    ///
+    /// This function calls [`PyErr_CheckSignals()`][1] which in turn may call signal handlers.
+    /// As Python's [`signal`][2] API allows users to define custom signal handlers, calling this
+    /// function allows arbitrary Python code inside signal handlers to run.
+    ///
+    /// If the function is called from a non-main thread, or under a non-main Python interpreter,
+    /// it does nothing yet still returns `Ok(())`.
+    ///
+    /// [1]: https://docs.python.org/3/c-api/exceptions.html?highlight=pyerr_checksignals#c.PyErr_CheckSignals
+    /// [2]: https://docs.python.org/3/library/signal.html
+    pub fn check_signals(self) -> PyResult<()> {
+        err::error_on_minusone(self, unsafe { ffi::PyErr_CheckSignals() })
+    }
+
+    /// Create a new pool for managing PyO3's GIL Refs. This has no functional
+    /// use for code which does not use the deprecated GIL Refs API.
+    ///
+    /// When this `GILPool` is dropped, all GIL Refs created after this `GILPool` will
+    /// all have their Python reference counts decremented, potentially allowing Python to drop
+    /// the corresponding Python objects.
+    ///
+    /// Typical usage of PyO3 will not need this API, as [`Python::with_gil`] automatically creates
+    /// a `GILPool` where appropriate.
+    ///
+    /// Advanced uses of PyO3 which perform long-running tasks which never free the GIL may need
+    /// to use this API to clear memory, as PyO3 usually does not clear memory until the GIL is
+    /// released.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// # use pyo3::prelude::*;
+    /// Python::with_gil(|py| {
+    ///     // Some long-running process like a webserver, which never releases the GIL.
+    ///     loop {
+    ///         // Create a new pool, so that PyO3 can clear memory at the end of the loop.
+    ///         #[allow(deprecated)]  // `new_pool` is not needed in code not using the GIL Refs API
+    ///         let pool = unsafe { py.new_pool() };
+    ///
+    ///         // It is recommended to *always* immediately set py to the pool's Python, to help
+    ///         // avoid creating references with invalid lifetimes.
+    ///         let py = pool.python();
+    ///
+    ///         // do stuff...
+    /// #       break;  // Exit the loop so that doctest terminates!
+    ///     }
+    /// });
+    /// ```
+    ///
+    /// # Safety
+    ///
+    /// Extreme care must be taken when using this API, as misuse can lead to accessing invalid
+    /// memory. In addition, the caller is responsible for guaranteeing that the GIL remains held
+    /// for the entire lifetime of the returned `GILPool`.
+    ///
+    /// Two best practices are required when using this API:
+    /// - From the moment `new_pool()` is called, only the `Python` token from the returned
+    ///   `GILPool` (accessible using [`.python()`]) should be used in PyO3 APIs. All other older
+    ///   `Python` tokens with longer lifetimes are unsafe to use until the `GILPool` is dropped,
+    ///   because they can be used to create PyO3 owned references which have lifetimes which
+    ///   outlive the `GILPool`.
+    /// - Similarly, methods on existing owned references will implicitly refer back to the
+    ///   `Python` token which that reference was originally created with. If the returned values
+    ///   from these methods are owned references they will inherit the same lifetime. As a result,
+    ///   Rust's lifetime rules may allow them to outlive the `GILPool`, even though this is not
+    ///   safe for reasons discussed above. Care must be taken to never access these return values
+    ///   after the `GILPool` is dropped, unless they are converted to `Py<T>` *before* the pool
+    ///   is dropped.
+    ///
+    /// [`.python()`]: crate::GILPool::python
+    #[inline]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "code not using the GIL Refs API can safely remove use of `Python::new_pool`"
+    )]
+    #[allow(deprecated)]
+    pub unsafe fn new_pool(self) -> GILPool {
+        GILPool::new()
+    }
+}
+
+impl Python<'_> {
+    /// Creates a scope using a new pool for managing PyO3's GIL Refs. This has no functional
+    /// use for code which does not use the deprecated GIL Refs API.
+    ///
+    /// This is a safe alterantive to [`new_pool`][Self::new_pool] as
+    /// it limits the closure to using the new GIL token at the cost of
+    /// being unable to capture existing GIL-bound references.
+    ///
+    /// Note that on stable Rust, this API suffers from the same the `SendWrapper` loophole
+    /// as [`allow_threads`][Self::allow_threads], c.f. the documentation of the [`Ungil`] trait,
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// # use pyo3::prelude::*;
+    /// Python::with_gil(|py| {
+    ///     // Some long-running process like a webserver, which never releases the GIL.
+    ///     loop {
+    ///         // Create a new scope, so that PyO3 can clear memory at the end of the loop.
+    ///         #[allow(deprecated)]  // `with_pool` is not needed in code not using the GIL Refs API
+    ///         py.with_pool(|py| {
+    ///             // do stuff...
+    ///         });
+    /// #       break;  // Exit the loop so that doctest terminates!
+    ///     }
+    /// });
+    /// ```
+    ///
+    /// The `Ungil` bound on the closure does prevent hanging on to existing GIL-bound references
+    ///
+    /// ```compile_fail
+    /// # #![allow(deprecated)]
+    /// # use pyo3::prelude::*;
+    /// # use pyo3::types::PyString;
+    ///
+    /// Python::with_gil(|py| {
+    ///     let old_str = PyString::new(py, "a message from the past");
+    ///
+    ///     py.with_pool(|_py| {
+    ///         print!("{:?}", old_str);
+    ///     });
+    /// });
+    /// ```
+    ///
+    /// or continuing to use the old GIL token
+    ///
+    /// ```compile_fail
+    /// # use pyo3::prelude::*;
+    ///
+    /// Python::with_gil(|old_py| {
+    ///     old_py.with_pool(|_new_py| {
+    ///         let _none = old_py.None();
+    ///     });
+    /// });
+    /// ```
+    #[inline]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "code not using the GIL Refs API can safely remove use of `Python::with_pool`"
+    )]
+    #[allow(deprecated)]
+    pub fn with_pool<F, R>(&self, f: F) -> R
+    where
+        F: for<'py> FnOnce(Python<'py>) -> R + Ungil,
+    {
+        // SAFETY: The closure is `Ungil`,
+        // i.e. it does not capture any GIL-bound references
+        // and accesses only the newly created GIL token.
+        let pool = unsafe { GILPool::new() };
+
+        f(pool.python())
+    }
+}
+
+impl<'unbound> Python<'unbound> {
+    /// Unsafely creates a Python token with an unbounded lifetime.
+    ///
+    /// Many of PyO3 APIs use `Python<'_>` as proof that the GIL is held, but this function can be
+    /// used to call them unsafely.
+    ///
+    /// # Safety
+    ///
+    /// - This token and any borrowed Python references derived from it can only be safely used
+    ///   whilst the currently executing thread is actually holding the GIL.
+    /// - This function creates a token with an *unbounded* lifetime. Safe code can assume that
+    ///   holding a `Python<'py>` token means the GIL is and stays acquired for the lifetime `'py`.
+    ///   If you let it or borrowed Python references escape to safe code you are
+    ///   responsible for bounding the lifetime `'unbound` appropriately. For more on unbounded
+    ///   lifetimes, see the [nomicon].
+    ///
+    /// [nomicon]: https://doc.rust-lang.org/nomicon/unbounded-lifetimes.html
+    #[inline]
+    pub unsafe fn assume_gil_acquired() -> Python<'unbound> {
+        Python(PhantomData)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::types::{IntoPyDict, PyList};
+
+    #[test]
+    fn test_eval() {
+        Python::with_gil(|py| {
+            // Make sure builtin names are accessible
+            let v: i32 = py
+                .eval_bound("min(1, 2)", None, None)
+                .map_err(|e| e.display(py))
+                .unwrap()
+                .extract()
+                .unwrap();
+            assert_eq!(v, 1);
+
+            let d = [("foo", 13)].into_py_dict_bound(py);
+
+            // Inject our own global namespace
+            let v: i32 = py
+                .eval_bound("foo + 29", Some(&d), None)
+                .unwrap()
+                .extract()
+                .unwrap();
+            assert_eq!(v, 42);
+
+            // Inject our own local namespace
+            let v: i32 = py
+                .eval_bound("foo + 29", None, Some(&d))
+                .unwrap()
+                .extract()
+                .unwrap();
+            assert_eq!(v, 42);
+
+            // Make sure builtin names are still accessible when using a local namespace
+            let v: i32 = py
+                .eval_bound("min(foo, 2)", None, Some(&d))
+                .unwrap()
+                .extract()
+                .unwrap();
+            assert_eq!(v, 2);
+        });
+    }
+
+    #[test]
+    #[cfg(not(target_arch = "wasm32"))] // We are building wasm Python with pthreads disabled
+    fn test_allow_threads_releases_and_acquires_gil() {
+        Python::with_gil(|py| {
+            let b = std::sync::Arc::new(std::sync::Barrier::new(2));
+
+            let b2 = b.clone();
+            std::thread::spawn(move || Python::with_gil(|_| b2.wait()));
+
+            py.allow_threads(|| {
+                // If allow_threads does not release the GIL, this will deadlock because
+                // the thread spawned above will never be able to acquire the GIL.
+                b.wait();
+            });
+
+            unsafe {
+                // If the GIL is not reacquired at the end of allow_threads, this call
+                // will crash the Python interpreter.
+                let tstate = ffi::PyEval_SaveThread();
+                ffi::PyEval_RestoreThread(tstate);
+            }
+        });
+    }
+
+    #[test]
+    fn test_allow_threads_panics_safely() {
+        Python::with_gil(|py| {
+            let result = std::panic::catch_unwind(|| unsafe {
+                let py = Python::assume_gil_acquired();
+                py.allow_threads(|| {
+                    panic!("There was a panic!");
+                });
+            });
+
+            // Check panic was caught
+            assert!(result.is_err());
+
+            // If allow_threads is implemented correctly, this thread still owns the GIL here
+            // so the following Python calls should not cause crashes.
+            let list = PyList::new_bound(py, [1, 2, 3, 4]);
+            assert_eq!(list.extract::<Vec<i32>>().unwrap(), vec![1, 2, 3, 4]);
+        });
+    }
+
+    #[cfg(not(pyo3_disable_reference_pool))]
+    #[test]
+    fn test_allow_threads_pass_stuff_in() {
+        let list = Python::with_gil(|py| PyList::new_bound(py, vec!["foo", "bar"]).unbind());
+        let mut v = vec![1, 2, 3];
+        let a = std::sync::Arc::new(String::from("foo"));
+
+        Python::with_gil(|py| {
+            py.allow_threads(|| {
+                drop((list, &mut v, a));
+            });
+        });
+    }
+
+    #[test]
+    #[cfg(not(Py_LIMITED_API))]
+    fn test_acquire_gil() {
+        const GIL_NOT_HELD: c_int = 0;
+        const GIL_HELD: c_int = 1;
+
+        // Before starting the interpreter the state of calling `PyGILState_Check`
+        // seems to be undefined, so let's ensure that Python is up.
+        #[cfg(not(any(PyPy, GraalPy)))]
+        crate::prepare_freethreaded_python();
+
+        let state = unsafe { crate::ffi::PyGILState_Check() };
+        assert_eq!(state, GIL_NOT_HELD);
+
+        Python::with_gil(|_| {
+            let state = unsafe { crate::ffi::PyGILState_Check() };
+            assert_eq!(state, GIL_HELD);
+        });
+
+        let state = unsafe { crate::ffi::PyGILState_Check() };
+        assert_eq!(state, GIL_NOT_HELD);
+    }
+
+    #[test]
+    fn test_ellipsis() {
+        Python::with_gil(|py| {
+            assert_eq!(py.Ellipsis().to_string(), "Ellipsis");
+
+            let v = py
+                .eval_bound("...", None, None)
+                .map_err(|e| e.display(py))
+                .unwrap();
+
+            assert!(v.eq(py.Ellipsis()).unwrap());
+        });
+    }
+
+    #[test]
+    fn test_py_run_inserts_globals() {
+        use crate::types::dict::PyDictMethods;
+
+        Python::with_gil(|py| {
+            let namespace = PyDict::new_bound(py);
+            py.run_bound("class Foo: pass", Some(&namespace), Some(&namespace))
+                .unwrap();
+            assert!(matches!(namespace.get_item("Foo"), Ok(Some(..))));
+            assert!(matches!(namespace.get_item("__builtins__"), Ok(Some(..))));
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/marshal.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/marshal.rs
--- 43.0.0-1/rust-vendor/pyo3/src/marshal.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/marshal.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,109 @@
+#![cfg(not(Py_LIMITED_API))]
+
+//! Support for the Python `marshal` format.
+
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::py_result_ext::PyResultExt;
+use crate::types::{PyAny, PyBytes};
+use crate::{ffi, Bound};
+use crate::{AsPyPointer, PyResult, Python};
+use std::os::raw::c_int;
+
+/// The current version of the marshal binary format.
+pub const VERSION: i32 = 4;
+
+/// Deprecated form of [`dumps_bound`]
+#[cfg(feature = "gil-refs")]
+#[deprecated(
+    since = "0.21.0",
+    note = "`dumps` will be replaced by `dumps_bound` in a future PyO3 version"
+)]
+pub fn dumps<'py>(
+    py: Python<'py>,
+    object: &impl AsPyPointer,
+    version: i32,
+) -> PyResult<&'py PyBytes> {
+    dumps_bound(py, object, version).map(Bound::into_gil_ref)
+}
+
+/// Serialize an object to bytes using the Python built-in marshal module.
+///
+/// The built-in marshalling only supports a limited range of objects.
+/// The exact types supported depend on the version argument.
+/// The [`VERSION`] constant holds the highest version currently supported.
+///
+/// See the [Python documentation](https://docs.python.org/3/library/marshal.html) for more details.
+///
+/// # Examples
+/// ```
+/// # use pyo3::{marshal, types::PyDict, prelude::PyDictMethods};
+/// # pyo3::Python::with_gil(|py| {
+/// let dict = PyDict::new_bound(py);
+/// dict.set_item("aap", "noot").unwrap();
+/// dict.set_item("mies", "wim").unwrap();
+/// dict.set_item("zus", "jet").unwrap();
+///
+/// let bytes = marshal::dumps_bound(py, &dict, marshal::VERSION);
+/// # });
+/// ```
+pub fn dumps_bound<'py>(
+    py: Python<'py>,
+    object: &impl AsPyPointer,
+    version: i32,
+) -> PyResult<Bound<'py, PyBytes>> {
+    unsafe {
+        ffi::PyMarshal_WriteObjectToString(object.as_ptr(), version as c_int)
+            .assume_owned_or_err(py)
+            .downcast_into_unchecked()
+    }
+}
+
+/// Deprecated form of [`loads_bound`]
+#[cfg(feature = "gil-refs")]
+#[deprecated(
+    since = "0.21.0",
+    note = "`loads` will be replaced by `loads_bound` in a future PyO3 version"
+)]
+pub fn loads<'py, B>(py: Python<'py>, data: &B) -> PyResult<&'py PyAny>
+where
+    B: AsRef<[u8]> + ?Sized,
+{
+    loads_bound(py, data).map(Bound::into_gil_ref)
+}
+
+/// Deserialize an object from bytes using the Python built-in marshal module.
+pub fn loads_bound<'py, B>(py: Python<'py>, data: &B) -> PyResult<Bound<'py, PyAny>>
+where
+    B: AsRef<[u8]> + ?Sized,
+{
+    let data = data.as_ref();
+    unsafe {
+        ffi::PyMarshal_ReadObjectFromString(data.as_ptr().cast(), data.len() as isize)
+            .assume_owned_or_err(py)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::types::{bytes::PyBytesMethods, dict::PyDictMethods, PyDict};
+
+    #[test]
+    fn marshal_roundtrip() {
+        Python::with_gil(|py| {
+            let dict = PyDict::new_bound(py);
+            dict.set_item("aap", "noot").unwrap();
+            dict.set_item("mies", "wim").unwrap();
+            dict.set_item("zus", "jet").unwrap();
+
+            let pybytes = dumps_bound(py, &dict, VERSION).expect("marshalling failed");
+            let deserialized = loads_bound(py, pybytes.as_bytes()).expect("unmarshalling failed");
+
+            assert!(equal(py, &dict, &deserialized));
+        });
+    }
+
+    fn equal(_py: Python<'_>, a: &impl AsPyPointer, b: &impl AsPyPointer) -> bool {
+        unsafe { ffi::PyObject_RichCompareBool(a.as_ptr(), b.as_ptr(), ffi::Py_EQ) != 0 }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/panic.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/panic.rs
--- 43.0.0-1/rust-vendor/pyo3/src/panic.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/panic.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,32 @@
+//! Helper to convert Rust panics to Python exceptions.
+use crate::exceptions::PyBaseException;
+use crate::PyErr;
+use std::any::Any;
+
+pyo3_exception!(
+    "
+The exception raised when Rust code called from Python panics.
+
+Like SystemExit, this exception is derived from BaseException so that
+it will typically propagate all the way through the stack and cause the
+Python interpreter to exit.
+",
+    PanicException,
+    PyBaseException
+);
+
+impl PanicException {
+    /// Creates a new PanicException from a panic payload.
+    ///
+    /// Attempts to format the error in the same way panic does.
+    #[cold]
+    pub(crate) fn from_panic_payload(payload: Box<dyn Any + Send + 'static>) -> PyErr {
+        if let Some(string) = payload.downcast_ref::<String>() {
+            Self::new_err((string.clone(),))
+        } else if let Some(s) = payload.downcast_ref::<&str>() {
+            Self::new_err((s.to_string(),))
+        } else {
+            Self::new_err(("panic from Rust code",))
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/prelude.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/prelude.rs
--- 43.0.0-1/rust-vendor/pyo3/src/prelude.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/prelude.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,52 @@
+//! PyO3's prelude.
+//!
+//! The purpose of this module is to alleviate imports of many commonly used items of the PyO3 crate
+//! by adding a glob import to the top of pyo3 heavy modules:
+//!
+//! ```
+//! # #![allow(unused_imports)]
+//! use pyo3::prelude::*;
+//! ```
+
+pub use crate::conversion::{FromPyObject, IntoPy, ToPyObject};
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+pub use crate::conversion::{PyTryFrom, PyTryInto};
+pub use crate::err::{PyErr, PyResult};
+pub use crate::instance::{Borrowed, Bound, Py, PyObject};
+pub use crate::marker::Python;
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+pub use crate::pycell::PyCell;
+pub use crate::pycell::{PyRef, PyRefMut};
+pub use crate::pyclass_init::PyClassInitializer;
+pub use crate::types::{PyAny, PyModule};
+#[cfg(feature = "gil-refs")]
+pub use crate::PyNativeType;
+
+#[cfg(feature = "macros")]
+pub use pyo3_macros::{pyclass, pyfunction, pymethods, pymodule, FromPyObject};
+
+#[cfg(feature = "macros")]
+pub use crate::{wrap_pyfunction, wrap_pyfunction_bound};
+
+pub use crate::types::any::PyAnyMethods;
+pub use crate::types::boolobject::PyBoolMethods;
+pub use crate::types::bytearray::PyByteArrayMethods;
+pub use crate::types::bytes::PyBytesMethods;
+pub use crate::types::capsule::PyCapsuleMethods;
+pub use crate::types::complex::PyComplexMethods;
+pub use crate::types::dict::PyDictMethods;
+pub use crate::types::float::PyFloatMethods;
+pub use crate::types::frozenset::PyFrozenSetMethods;
+pub use crate::types::list::PyListMethods;
+pub use crate::types::mapping::PyMappingMethods;
+pub use crate::types::module::PyModuleMethods;
+pub use crate::types::sequence::PySequenceMethods;
+pub use crate::types::set::PySetMethods;
+pub use crate::types::slice::PySliceMethods;
+pub use crate::types::string::PyStringMethods;
+pub use crate::types::traceback::PyTracebackMethods;
+pub use crate::types::tuple::PyTupleMethods;
+pub use crate::types::typeobject::PyTypeMethods;
+pub use crate::types::weakref::PyWeakrefMethods;
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/py_result_ext.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/py_result_ext.rs
--- 43.0.0-1/rust-vendor/pyo3/src/py_result_ext.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/py_result_ext.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,18 @@
+use crate::{types::any::PyAnyMethods, Bound, PyAny, PyResult, PyTypeCheck};
+
+pub(crate) trait PyResultExt<'py>: crate::sealed::Sealed {
+    fn downcast_into<T: PyTypeCheck>(self) -> PyResult<Bound<'py, T>>;
+    unsafe fn downcast_into_unchecked<T>(self) -> PyResult<Bound<'py, T>>;
+}
+
+impl<'py> PyResultExt<'py> for PyResult<Bound<'py, PyAny>> {
+    #[inline]
+    fn downcast_into<T: PyTypeCheck>(self) -> PyResult<Bound<'py, T>> where {
+        self.and_then(|instance| instance.downcast_into().map_err(Into::into))
+    }
+
+    #[inline]
+    unsafe fn downcast_into_unchecked<T>(self) -> PyResult<Bound<'py, T>> {
+        self.map(|instance| instance.downcast_into_unchecked())
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/pybacked.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/pybacked.rs
--- 43.0.0-1/rust-vendor/pyo3/src/pybacked.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/pybacked.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,578 @@
+//! Contains types for working with Python objects that own the underlying data.
+
+use std::{ops::Deref, ptr::NonNull, sync::Arc};
+
+use crate::{
+    types::{
+        any::PyAnyMethods, bytearray::PyByteArrayMethods, bytes::PyBytesMethods,
+        string::PyStringMethods, PyByteArray, PyBytes, PyString,
+    },
+    Bound, DowncastError, FromPyObject, IntoPy, Py, PyAny, PyErr, PyResult, Python, ToPyObject,
+};
+
+/// A wrapper around `str` where the storage is owned by a Python `bytes` or `str` object.
+///
+/// This type gives access to the underlying data via a `Deref` implementation.
+#[cfg_attr(feature = "py-clone", derive(Clone))]
+pub struct PyBackedStr {
+    #[allow(dead_code)] // only held so that the storage is not dropped
+    storage: Py<PyAny>,
+    data: NonNull<str>,
+}
+
+impl Deref for PyBackedStr {
+    type Target = str;
+    fn deref(&self) -> &str {
+        // Safety: `data` is known to be immutable and owned by self
+        unsafe { self.data.as_ref() }
+    }
+}
+
+impl AsRef<str> for PyBackedStr {
+    fn as_ref(&self) -> &str {
+        self
+    }
+}
+
+impl AsRef<[u8]> for PyBackedStr {
+    fn as_ref(&self) -> &[u8] {
+        self.as_bytes()
+    }
+}
+
+// Safety: the underlying Python str (or bytes) is immutable and
+// safe to share between threads
+unsafe impl Send for PyBackedStr {}
+unsafe impl Sync for PyBackedStr {}
+
+impl std::fmt::Display for PyBackedStr {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        self.deref().fmt(f)
+    }
+}
+
+impl_traits!(PyBackedStr, str);
+
+impl TryFrom<Bound<'_, PyString>> for PyBackedStr {
+    type Error = PyErr;
+    fn try_from(py_string: Bound<'_, PyString>) -> Result<Self, Self::Error> {
+        #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
+        {
+            let s = py_string.to_str()?;
+            let data = NonNull::from(s);
+            Ok(Self {
+                storage: py_string.as_any().to_owned().unbind(),
+                data,
+            })
+        }
+        #[cfg(not(any(Py_3_10, not(Py_LIMITED_API))))]
+        {
+            let bytes = py_string.encode_utf8()?;
+            let s = unsafe { std::str::from_utf8_unchecked(bytes.as_bytes()) };
+            let data = NonNull::from(s);
+            Ok(Self {
+                storage: bytes.into_any().unbind(),
+                data,
+            })
+        }
+    }
+}
+
+impl FromPyObject<'_> for PyBackedStr {
+    fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self> {
+        let py_string = obj.downcast::<PyString>()?.to_owned();
+        Self::try_from(py_string)
+    }
+}
+
+impl ToPyObject for PyBackedStr {
+    #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
+    fn to_object(&self, py: Python<'_>) -> Py<PyAny> {
+        self.storage.clone_ref(py)
+    }
+    #[cfg(not(any(Py_3_10, not(Py_LIMITED_API))))]
+    fn to_object(&self, py: Python<'_>) -> Py<PyAny> {
+        PyString::new_bound(py, self).into_any().unbind()
+    }
+}
+
+impl IntoPy<Py<PyAny>> for PyBackedStr {
+    #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
+    fn into_py(self, _py: Python<'_>) -> Py<PyAny> {
+        self.storage
+    }
+    #[cfg(not(any(Py_3_10, not(Py_LIMITED_API))))]
+    fn into_py(self, py: Python<'_>) -> Py<PyAny> {
+        PyString::new_bound(py, &self).into_any().unbind()
+    }
+}
+
+/// A wrapper around `[u8]` where the storage is either owned by a Python `bytes` object, or a Rust `Box<[u8]>`.
+///
+/// This type gives access to the underlying data via a `Deref` implementation.
+#[cfg_attr(feature = "py-clone", derive(Clone))]
+pub struct PyBackedBytes {
+    #[allow(dead_code)] // only held so that the storage is not dropped
+    storage: PyBackedBytesStorage,
+    data: NonNull<[u8]>,
+}
+
+#[allow(dead_code)]
+#[cfg_attr(feature = "py-clone", derive(Clone))]
+enum PyBackedBytesStorage {
+    Python(Py<PyBytes>),
+    Rust(Arc<[u8]>),
+}
+
+impl Deref for PyBackedBytes {
+    type Target = [u8];
+    fn deref(&self) -> &[u8] {
+        // Safety: `data` is known to be immutable and owned by self
+        unsafe { self.data.as_ref() }
+    }
+}
+
+impl AsRef<[u8]> for PyBackedBytes {
+    fn as_ref(&self) -> &[u8] {
+        self
+    }
+}
+
+// Safety: the underlying Python bytes or Rust bytes is immutable and
+// safe to share between threads
+unsafe impl Send for PyBackedBytes {}
+unsafe impl Sync for PyBackedBytes {}
+
+impl<const N: usize> PartialEq<[u8; N]> for PyBackedBytes {
+    fn eq(&self, other: &[u8; N]) -> bool {
+        self.deref() == other
+    }
+}
+
+impl<const N: usize> PartialEq<PyBackedBytes> for [u8; N] {
+    fn eq(&self, other: &PyBackedBytes) -> bool {
+        self == other.deref()
+    }
+}
+
+impl<const N: usize> PartialEq<&[u8; N]> for PyBackedBytes {
+    fn eq(&self, other: &&[u8; N]) -> bool {
+        self.deref() == *other
+    }
+}
+
+impl<const N: usize> PartialEq<PyBackedBytes> for &[u8; N] {
+    fn eq(&self, other: &PyBackedBytes) -> bool {
+        self == &other.deref()
+    }
+}
+
+impl_traits!(PyBackedBytes, [u8]);
+
+impl From<Bound<'_, PyBytes>> for PyBackedBytes {
+    fn from(py_bytes: Bound<'_, PyBytes>) -> Self {
+        let b = py_bytes.as_bytes();
+        let data = NonNull::from(b);
+        Self {
+            storage: PyBackedBytesStorage::Python(py_bytes.to_owned().unbind()),
+            data,
+        }
+    }
+}
+
+impl From<Bound<'_, PyByteArray>> for PyBackedBytes {
+    fn from(py_bytearray: Bound<'_, PyByteArray>) -> Self {
+        let s = Arc::<[u8]>::from(py_bytearray.to_vec());
+        let data = NonNull::from(s.as_ref());
+        Self {
+            storage: PyBackedBytesStorage::Rust(s),
+            data,
+        }
+    }
+}
+
+impl FromPyObject<'_> for PyBackedBytes {
+    fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self> {
+        if let Ok(bytes) = obj.downcast::<PyBytes>() {
+            Ok(Self::from(bytes.to_owned()))
+        } else if let Ok(bytearray) = obj.downcast::<PyByteArray>() {
+            Ok(Self::from(bytearray.to_owned()))
+        } else {
+            Err(DowncastError::new(obj, "`bytes` or `bytearray`").into())
+        }
+    }
+}
+
+impl ToPyObject for PyBackedBytes {
+    fn to_object(&self, py: Python<'_>) -> Py<PyAny> {
+        match &self.storage {
+            PyBackedBytesStorage::Python(bytes) => bytes.to_object(py),
+            PyBackedBytesStorage::Rust(bytes) => PyBytes::new_bound(py, bytes).into_any().unbind(),
+        }
+    }
+}
+
+impl IntoPy<Py<PyAny>> for PyBackedBytes {
+    fn into_py(self, py: Python<'_>) -> Py<PyAny> {
+        match self.storage {
+            PyBackedBytesStorage::Python(bytes) => bytes.into_any(),
+            PyBackedBytesStorage::Rust(bytes) => PyBytes::new_bound(py, &bytes).into_any().unbind(),
+        }
+    }
+}
+
+macro_rules! impl_traits {
+    ($slf:ty, $equiv:ty) => {
+        impl std::fmt::Debug for $slf {
+            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+                self.deref().fmt(f)
+            }
+        }
+
+        impl PartialEq for $slf {
+            fn eq(&self, other: &Self) -> bool {
+                self.deref() == other.deref()
+            }
+        }
+
+        impl PartialEq<$equiv> for $slf {
+            fn eq(&self, other: &$equiv) -> bool {
+                self.deref() == other
+            }
+        }
+
+        impl PartialEq<&$equiv> for $slf {
+            fn eq(&self, other: &&$equiv) -> bool {
+                self.deref() == *other
+            }
+        }
+
+        impl PartialEq<$slf> for $equiv {
+            fn eq(&self, other: &$slf) -> bool {
+                self == other.deref()
+            }
+        }
+
+        impl PartialEq<$slf> for &$equiv {
+            fn eq(&self, other: &$slf) -> bool {
+                self == &other.deref()
+            }
+        }
+
+        impl Eq for $slf {}
+
+        impl PartialOrd for $slf {
+            fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
+                Some(self.cmp(other))
+            }
+        }
+
+        impl PartialOrd<$equiv> for $slf {
+            fn partial_cmp(&self, other: &$equiv) -> Option<std::cmp::Ordering> {
+                self.deref().partial_cmp(other)
+            }
+        }
+
+        impl PartialOrd<$slf> for $equiv {
+            fn partial_cmp(&self, other: &$slf) -> Option<std::cmp::Ordering> {
+                self.partial_cmp(other.deref())
+            }
+        }
+
+        impl Ord for $slf {
+            fn cmp(&self, other: &Self) -> std::cmp::Ordering {
+                self.deref().cmp(other.deref())
+            }
+        }
+
+        impl std::hash::Hash for $slf {
+            fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
+                self.deref().hash(state)
+            }
+        }
+    };
+}
+use impl_traits;
+
+#[cfg(test)]
+mod test {
+    use super::*;
+    use crate::Python;
+    use std::collections::hash_map::DefaultHasher;
+    use std::hash::{Hash, Hasher};
+
+    #[test]
+    fn py_backed_str_empty() {
+        Python::with_gil(|py| {
+            let s = PyString::new_bound(py, "");
+            let py_backed_str = s.extract::<PyBackedStr>().unwrap();
+            assert_eq!(&*py_backed_str, "");
+        });
+    }
+
+    #[test]
+    fn py_backed_str() {
+        Python::with_gil(|py| {
+            let s = PyString::new_bound(py, "hello");
+            let py_backed_str = s.extract::<PyBackedStr>().unwrap();
+            assert_eq!(&*py_backed_str, "hello");
+        });
+    }
+
+    #[test]
+    fn py_backed_str_try_from() {
+        Python::with_gil(|py| {
+            let s = PyString::new_bound(py, "hello");
+            let py_backed_str = PyBackedStr::try_from(s).unwrap();
+            assert_eq!(&*py_backed_str, "hello");
+        });
+    }
+
+    #[test]
+    fn py_backed_str_to_object() {
+        Python::with_gil(|py| {
+            let orig_str = PyString::new_bound(py, "hello");
+            let py_backed_str = orig_str.extract::<PyBackedStr>().unwrap();
+            let new_str = py_backed_str.to_object(py);
+            assert_eq!(new_str.extract::<PyBackedStr>(py).unwrap(), "hello");
+            #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
+            assert!(new_str.is(&orig_str));
+        });
+    }
+
+    #[test]
+    fn py_backed_str_into_py() {
+        Python::with_gil(|py| {
+            let orig_str = PyString::new_bound(py, "hello");
+            let py_backed_str = orig_str.extract::<PyBackedStr>().unwrap();
+            let new_str = py_backed_str.into_py(py);
+            assert_eq!(new_str.extract::<PyBackedStr>(py).unwrap(), "hello");
+            #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
+            assert!(new_str.is(&orig_str));
+        });
+    }
+
+    #[test]
+    fn py_backed_bytes_empty() {
+        Python::with_gil(|py| {
+            let b = PyBytes::new_bound(py, b"");
+            let py_backed_bytes = b.extract::<PyBackedBytes>().unwrap();
+            assert_eq!(&*py_backed_bytes, b"");
+        });
+    }
+
+    #[test]
+    fn py_backed_bytes() {
+        Python::with_gil(|py| {
+            let b = PyBytes::new_bound(py, b"abcde");
+            let py_backed_bytes = b.extract::<PyBackedBytes>().unwrap();
+            assert_eq!(&*py_backed_bytes, b"abcde");
+        });
+    }
+
+    #[test]
+    fn py_backed_bytes_from_bytes() {
+        Python::with_gil(|py| {
+            let b = PyBytes::new_bound(py, b"abcde");
+            let py_backed_bytes = PyBackedBytes::from(b);
+            assert_eq!(&*py_backed_bytes, b"abcde");
+        });
+    }
+
+    #[test]
+    fn py_backed_bytes_from_bytearray() {
+        Python::with_gil(|py| {
+            let b = PyByteArray::new_bound(py, b"abcde");
+            let py_backed_bytes = PyBackedBytes::from(b);
+            assert_eq!(&*py_backed_bytes, b"abcde");
+        });
+    }
+
+    #[test]
+    fn py_backed_bytes_into_py() {
+        Python::with_gil(|py| {
+            let orig_bytes = PyBytes::new_bound(py, b"abcde");
+            let py_backed_bytes = PyBackedBytes::from(orig_bytes.clone());
+            assert!(py_backed_bytes.to_object(py).is(&orig_bytes));
+            assert!(py_backed_bytes.into_py(py).is(&orig_bytes));
+        });
+    }
+
+    #[test]
+    fn rust_backed_bytes_into_py() {
+        Python::with_gil(|py| {
+            let orig_bytes = PyByteArray::new_bound(py, b"abcde");
+            let rust_backed_bytes = PyBackedBytes::from(orig_bytes);
+            assert!(matches!(
+                rust_backed_bytes.storage,
+                PyBackedBytesStorage::Rust(_)
+            ));
+            let to_object = rust_backed_bytes.to_object(py).into_bound(py);
+            assert!(&to_object.is_exact_instance_of::<PyBytes>());
+            assert_eq!(&to_object.extract::<PyBackedBytes>().unwrap(), b"abcde");
+            let into_py = rust_backed_bytes.into_py(py).into_bound(py);
+            assert!(&into_py.is_exact_instance_of::<PyBytes>());
+            assert_eq!(&into_py.extract::<PyBackedBytes>().unwrap(), b"abcde");
+        });
+    }
+
+    #[test]
+    fn test_backed_types_send_sync() {
+        fn is_send<T: Send>() {}
+        fn is_sync<T: Sync>() {}
+
+        is_send::<PyBackedStr>();
+        is_sync::<PyBackedStr>();
+
+        is_send::<PyBackedBytes>();
+        is_sync::<PyBackedBytes>();
+    }
+
+    #[cfg(feature = "py-clone")]
+    #[test]
+    fn test_backed_str_clone() {
+        Python::with_gil(|py| {
+            let s1: PyBackedStr = PyString::new_bound(py, "hello").try_into().unwrap();
+            let s2 = s1.clone();
+            assert_eq!(s1, s2);
+
+            drop(s1);
+            assert_eq!(s2, "hello");
+        });
+    }
+
+    #[test]
+    fn test_backed_str_eq() {
+        Python::with_gil(|py| {
+            let s1: PyBackedStr = PyString::new_bound(py, "hello").try_into().unwrap();
+            let s2: PyBackedStr = PyString::new_bound(py, "hello").try_into().unwrap();
+            assert_eq!(s1, "hello");
+            assert_eq!(s1, s2);
+
+            let s3: PyBackedStr = PyString::new_bound(py, "abcde").try_into().unwrap();
+            assert_eq!("abcde", s3);
+            assert_ne!(s1, s3);
+        });
+    }
+
+    #[test]
+    fn test_backed_str_hash() {
+        Python::with_gil(|py| {
+            let h = {
+                let mut hasher = DefaultHasher::new();
+                "abcde".hash(&mut hasher);
+                hasher.finish()
+            };
+
+            let s1: PyBackedStr = PyString::new_bound(py, "abcde").try_into().unwrap();
+            let h1 = {
+                let mut hasher = DefaultHasher::new();
+                s1.hash(&mut hasher);
+                hasher.finish()
+            };
+
+            assert_eq!(h, h1);
+        });
+    }
+
+    #[test]
+    fn test_backed_str_ord() {
+        Python::with_gil(|py| {
+            let mut a = vec!["a", "c", "d", "b", "f", "g", "e"];
+            let mut b = a
+                .iter()
+                .map(|s| PyString::new_bound(py, s).try_into().unwrap())
+                .collect::<Vec<PyBackedStr>>();
+
+            a.sort();
+            b.sort();
+
+            assert_eq!(a, b);
+        })
+    }
+
+    #[cfg(feature = "py-clone")]
+    #[test]
+    fn test_backed_bytes_from_bytes_clone() {
+        Python::with_gil(|py| {
+            let b1: PyBackedBytes = PyBytes::new_bound(py, b"abcde").into();
+            let b2 = b1.clone();
+            assert_eq!(b1, b2);
+
+            drop(b1);
+            assert_eq!(b2, b"abcde");
+        });
+    }
+
+    #[cfg(feature = "py-clone")]
+    #[test]
+    fn test_backed_bytes_from_bytearray_clone() {
+        Python::with_gil(|py| {
+            let b1: PyBackedBytes = PyByteArray::new_bound(py, b"abcde").into();
+            let b2 = b1.clone();
+            assert_eq!(b1, b2);
+
+            drop(b1);
+            assert_eq!(b2, b"abcde");
+        });
+    }
+
+    #[test]
+    fn test_backed_bytes_eq() {
+        Python::with_gil(|py| {
+            let b1: PyBackedBytes = PyBytes::new_bound(py, b"abcde").into();
+            let b2: PyBackedBytes = PyByteArray::new_bound(py, b"abcde").into();
+
+            assert_eq!(b1, b"abcde");
+            assert_eq!(b1, b2);
+
+            let b3: PyBackedBytes = PyBytes::new_bound(py, b"hello").into();
+            assert_eq!(b"hello", b3);
+            assert_ne!(b1, b3);
+        });
+    }
+
+    #[test]
+    fn test_backed_bytes_hash() {
+        Python::with_gil(|py| {
+            let h = {
+                let mut hasher = DefaultHasher::new();
+                b"abcde".hash(&mut hasher);
+                hasher.finish()
+            };
+
+            let b1: PyBackedBytes = PyBytes::new_bound(py, b"abcde").into();
+            let h1 = {
+                let mut hasher = DefaultHasher::new();
+                b1.hash(&mut hasher);
+                hasher.finish()
+            };
+
+            let b2: PyBackedBytes = PyByteArray::new_bound(py, b"abcde").into();
+            let h2 = {
+                let mut hasher = DefaultHasher::new();
+                b2.hash(&mut hasher);
+                hasher.finish()
+            };
+
+            assert_eq!(h, h1);
+            assert_eq!(h, h2);
+        });
+    }
+
+    #[test]
+    fn test_backed_bytes_ord() {
+        Python::with_gil(|py| {
+            let mut a = vec![b"a", b"c", b"d", b"b", b"f", b"g", b"e"];
+            let mut b = a
+                .iter()
+                .map(|&b| PyBytes::new_bound(py, b).into())
+                .collect::<Vec<PyBackedBytes>>();
+
+            a.sort();
+            b.sort();
+
+            assert_eq!(a, b);
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/pycell/impl_.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/pycell/impl_.rs
--- 43.0.0-1/rust-vendor/pyo3/src/pycell/impl_.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/pycell/impl_.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,519 @@
+#![allow(missing_docs)]
+//! Crate-private implementation of PyClassObject
+
+use std::cell::{Cell, UnsafeCell};
+use std::marker::PhantomData;
+use std::mem::ManuallyDrop;
+
+use crate::impl_::pyclass::{
+    PyClassBaseType, PyClassDict, PyClassImpl, PyClassThreadChecker, PyClassWeakRef,
+};
+use crate::type_object::{get_tp_free, PyLayout, PySizedLayout};
+use crate::{ffi, PyClass, PyTypeInfo, Python};
+
+use super::{PyBorrowError, PyBorrowMutError};
+
+pub trait PyClassMutability {
+    // The storage for this inheritance layer. Only the first mutable class in
+    // an inheritance hierarchy needs to store the borrow flag.
+    type Storage: PyClassBorrowChecker;
+    // The borrow flag needed to implement this class' mutability. Empty until
+    // the first mutable class, at which point it is BorrowChecker and will be
+    // for all subclasses.
+    type Checker: PyClassBorrowChecker;
+    type ImmutableChild: PyClassMutability;
+    type MutableChild: PyClassMutability;
+}
+
+pub struct ImmutableClass(());
+pub struct MutableClass(());
+pub struct ExtendsMutableAncestor<M: PyClassMutability>(PhantomData<M>);
+
+impl PyClassMutability for ImmutableClass {
+    type Storage = EmptySlot;
+    type Checker = EmptySlot;
+    type ImmutableChild = ImmutableClass;
+    type MutableChild = MutableClass;
+}
+
+impl PyClassMutability for MutableClass {
+    type Storage = BorrowChecker;
+    type Checker = BorrowChecker;
+    type ImmutableChild = ExtendsMutableAncestor<ImmutableClass>;
+    type MutableChild = ExtendsMutableAncestor<MutableClass>;
+}
+
+impl<M: PyClassMutability> PyClassMutability for ExtendsMutableAncestor<M> {
+    type Storage = EmptySlot;
+    type Checker = BorrowChecker;
+    type ImmutableChild = ExtendsMutableAncestor<ImmutableClass>;
+    type MutableChild = ExtendsMutableAncestor<MutableClass>;
+}
+
+#[derive(Debug, Copy, Clone, Eq, PartialEq)]
+struct BorrowFlag(usize);
+
+impl BorrowFlag {
+    pub(crate) const UNUSED: BorrowFlag = BorrowFlag(0);
+    const HAS_MUTABLE_BORROW: BorrowFlag = BorrowFlag(usize::MAX);
+    const fn increment(self) -> Self {
+        Self(self.0 + 1)
+    }
+    const fn decrement(self) -> Self {
+        Self(self.0 - 1)
+    }
+}
+
+pub struct EmptySlot(());
+pub struct BorrowChecker(Cell<BorrowFlag>);
+
+pub trait PyClassBorrowChecker {
+    /// Initial value for self
+    fn new() -> Self;
+
+    /// Increments immutable borrow count, if possible
+    fn try_borrow(&self) -> Result<(), PyBorrowError>;
+
+    #[cfg(feature = "gil-refs")]
+    fn try_borrow_unguarded(&self) -> Result<(), PyBorrowError>;
+
+    /// Decrements immutable borrow count
+    fn release_borrow(&self);
+    /// Increments mutable borrow count, if possible
+    fn try_borrow_mut(&self) -> Result<(), PyBorrowMutError>;
+    /// Decremements mutable borrow count
+    fn release_borrow_mut(&self);
+}
+
+impl PyClassBorrowChecker for EmptySlot {
+    #[inline]
+    fn new() -> Self {
+        EmptySlot(())
+    }
+
+    #[inline]
+    fn try_borrow(&self) -> Result<(), PyBorrowError> {
+        Ok(())
+    }
+
+    #[inline]
+    #[cfg(feature = "gil-refs")]
+    fn try_borrow_unguarded(&self) -> Result<(), PyBorrowError> {
+        Ok(())
+    }
+
+    #[inline]
+    fn release_borrow(&self) {}
+
+    #[inline]
+    fn try_borrow_mut(&self) -> Result<(), PyBorrowMutError> {
+        unreachable!()
+    }
+
+    #[inline]
+    fn release_borrow_mut(&self) {
+        unreachable!()
+    }
+}
+
+impl PyClassBorrowChecker for BorrowChecker {
+    #[inline]
+    fn new() -> Self {
+        Self(Cell::new(BorrowFlag::UNUSED))
+    }
+
+    fn try_borrow(&self) -> Result<(), PyBorrowError> {
+        let flag = self.0.get();
+        if flag != BorrowFlag::HAS_MUTABLE_BORROW {
+            self.0.set(flag.increment());
+            Ok(())
+        } else {
+            Err(PyBorrowError { _private: () })
+        }
+    }
+
+    #[cfg(feature = "gil-refs")]
+    fn try_borrow_unguarded(&self) -> Result<(), PyBorrowError> {
+        let flag = self.0.get();
+        if flag != BorrowFlag::HAS_MUTABLE_BORROW {
+            Ok(())
+        } else {
+            Err(PyBorrowError { _private: () })
+        }
+    }
+
+    fn release_borrow(&self) {
+        let flag = self.0.get();
+        self.0.set(flag.decrement())
+    }
+
+    fn try_borrow_mut(&self) -> Result<(), PyBorrowMutError> {
+        let flag = self.0.get();
+        if flag == BorrowFlag::UNUSED {
+            self.0.set(BorrowFlag::HAS_MUTABLE_BORROW);
+            Ok(())
+        } else {
+            Err(PyBorrowMutError { _private: () })
+        }
+    }
+
+    fn release_borrow_mut(&self) {
+        self.0.set(BorrowFlag::UNUSED)
+    }
+}
+
+pub trait GetBorrowChecker<T: PyClassImpl> {
+    fn borrow_checker(
+        class_object: &PyClassObject<T>,
+    ) -> &<T::PyClassMutability as PyClassMutability>::Checker;
+}
+
+impl<T: PyClassImpl<PyClassMutability = Self>> GetBorrowChecker<T> for MutableClass {
+    fn borrow_checker(class_object: &PyClassObject<T>) -> &BorrowChecker {
+        &class_object.contents.borrow_checker
+    }
+}
+
+impl<T: PyClassImpl<PyClassMutability = Self>> GetBorrowChecker<T> for ImmutableClass {
+    fn borrow_checker(class_object: &PyClassObject<T>) -> &EmptySlot {
+        &class_object.contents.borrow_checker
+    }
+}
+
+impl<T: PyClassImpl<PyClassMutability = Self>, M: PyClassMutability> GetBorrowChecker<T>
+    for ExtendsMutableAncestor<M>
+where
+    T::BaseType: PyClassImpl + PyClassBaseType<LayoutAsBase = PyClassObject<T::BaseType>>,
+    <T::BaseType as PyClassImpl>::PyClassMutability: PyClassMutability<Checker = BorrowChecker>,
+{
+    fn borrow_checker(class_object: &PyClassObject<T>) -> &BorrowChecker {
+        <<T::BaseType as PyClassImpl>::PyClassMutability as GetBorrowChecker<T::BaseType>>::borrow_checker(&class_object.ob_base)
+    }
+}
+
+/// Base layout of PyClassObject.
+#[doc(hidden)]
+#[repr(C)]
+pub struct PyClassObjectBase<T> {
+    ob_base: T,
+}
+
+unsafe impl<T, U> PyLayout<T> for PyClassObjectBase<U> where U: PySizedLayout<T> {}
+
+#[doc(hidden)]
+pub trait PyClassObjectLayout<T>: PyLayout<T> {
+    fn ensure_threadsafe(&self);
+    fn check_threadsafe(&self) -> Result<(), PyBorrowError>;
+    /// Implementation of tp_dealloc.
+    /// # Safety
+    /// - slf must be a valid pointer to an instance of a T or a subclass.
+    /// - slf must not be used after this call (as it will be freed).
+    unsafe fn tp_dealloc(py: Python<'_>, slf: *mut ffi::PyObject);
+}
+
+impl<T, U> PyClassObjectLayout<T> for PyClassObjectBase<U>
+where
+    U: PySizedLayout<T>,
+    T: PyTypeInfo,
+{
+    fn ensure_threadsafe(&self) {}
+    fn check_threadsafe(&self) -> Result<(), PyBorrowError> {
+        Ok(())
+    }
+    unsafe fn tp_dealloc(py: Python<'_>, slf: *mut ffi::PyObject) {
+        let type_obj = T::type_object_raw(py);
+        // For `#[pyclass]` types which inherit from PyAny, we can just call tp_free
+        if type_obj == std::ptr::addr_of_mut!(ffi::PyBaseObject_Type) {
+            return get_tp_free(ffi::Py_TYPE(slf))(slf.cast());
+        }
+
+        // More complex native types (e.g. `extends=PyDict`) require calling the base's dealloc.
+        #[cfg(not(Py_LIMITED_API))]
+        {
+            if let Some(dealloc) = (*type_obj).tp_dealloc {
+                // Before CPython 3.11 BaseException_dealloc would use Py_GC_UNTRACK which
+                // assumes the exception is currently GC tracked, so we have to re-track
+                // before calling the dealloc so that it can safely call Py_GC_UNTRACK.
+                #[cfg(not(any(Py_3_11, PyPy)))]
+                if ffi::PyType_FastSubclass(type_obj, ffi::Py_TPFLAGS_BASE_EXC_SUBCLASS) == 1 {
+                    ffi::PyObject_GC_Track(slf.cast());
+                }
+                dealloc(slf);
+            } else {
+                get_tp_free(ffi::Py_TYPE(slf))(slf.cast());
+            }
+        }
+
+        #[cfg(Py_LIMITED_API)]
+        unreachable!("subclassing native types is not possible with the `abi3` feature");
+    }
+}
+
+/// The layout of a PyClass as a Python object
+#[repr(C)]
+pub struct PyClassObject<T: PyClassImpl> {
+    pub(crate) ob_base: <T::BaseType as PyClassBaseType>::LayoutAsBase,
+    pub(crate) contents: PyClassObjectContents<T>,
+}
+
+#[repr(C)]
+pub(crate) struct PyClassObjectContents<T: PyClassImpl> {
+    pub(crate) value: ManuallyDrop<UnsafeCell<T>>,
+    pub(crate) borrow_checker: <T::PyClassMutability as PyClassMutability>::Storage,
+    pub(crate) thread_checker: T::ThreadChecker,
+    pub(crate) dict: T::Dict,
+    pub(crate) weakref: T::WeakRef,
+}
+
+impl<T: PyClassImpl> PyClassObject<T> {
+    pub(crate) fn get_ptr(&self) -> *mut T {
+        self.contents.value.get()
+    }
+
+    /// Gets the offset of the dictionary from the start of the struct in bytes.
+    pub(crate) fn dict_offset() -> ffi::Py_ssize_t {
+        use memoffset::offset_of;
+
+        let offset =
+            offset_of!(PyClassObject<T>, contents) + offset_of!(PyClassObjectContents<T>, dict);
+
+        // Py_ssize_t may not be equal to isize on all platforms
+        #[allow(clippy::useless_conversion)]
+        offset.try_into().expect("offset should fit in Py_ssize_t")
+    }
+
+    /// Gets the offset of the weakref list from the start of the struct in bytes.
+    pub(crate) fn weaklist_offset() -> ffi::Py_ssize_t {
+        use memoffset::offset_of;
+
+        let offset =
+            offset_of!(PyClassObject<T>, contents) + offset_of!(PyClassObjectContents<T>, weakref);
+
+        // Py_ssize_t may not be equal to isize on all platforms
+        #[allow(clippy::useless_conversion)]
+        offset.try_into().expect("offset should fit in Py_ssize_t")
+    }
+}
+
+impl<T: PyClassImpl> PyClassObject<T> {
+    pub(crate) fn borrow_checker(&self) -> &<T::PyClassMutability as PyClassMutability>::Checker {
+        T::PyClassMutability::borrow_checker(self)
+    }
+}
+
+unsafe impl<T: PyClassImpl> PyLayout<T> for PyClassObject<T> {}
+impl<T: PyClass> PySizedLayout<T> for PyClassObject<T> {}
+
+impl<T: PyClassImpl> PyClassObjectLayout<T> for PyClassObject<T>
+where
+    <T::BaseType as PyClassBaseType>::LayoutAsBase: PyClassObjectLayout<T::BaseType>,
+{
+    fn ensure_threadsafe(&self) {
+        self.contents.thread_checker.ensure();
+        self.ob_base.ensure_threadsafe();
+    }
+    fn check_threadsafe(&self) -> Result<(), PyBorrowError> {
+        if !self.contents.thread_checker.check() {
+            return Err(PyBorrowError { _private: () });
+        }
+        self.ob_base.check_threadsafe()
+    }
+    unsafe fn tp_dealloc(py: Python<'_>, slf: *mut ffi::PyObject) {
+        // Safety: Python only calls tp_dealloc when no references to the object remain.
+        let class_object = &mut *(slf.cast::<PyClassObject<T>>());
+        if class_object.contents.thread_checker.can_drop(py) {
+            ManuallyDrop::drop(&mut class_object.contents.value);
+        }
+        class_object.contents.dict.clear_dict(py);
+        class_object.contents.weakref.clear_weakrefs(slf, py);
+        <T::BaseType as PyClassBaseType>::LayoutAsBase::tp_dealloc(py, slf)
+    }
+}
+
+#[cfg(test)]
+#[cfg(feature = "macros")]
+mod tests {
+    use super::*;
+
+    use crate::prelude::*;
+    use crate::pyclass::boolean_struct::{False, True};
+
+    #[pyclass(crate = "crate", subclass)]
+    struct MutableBase;
+
+    #[pyclass(crate = "crate", extends = MutableBase, subclass)]
+    struct MutableChildOfMutableBase;
+
+    #[pyclass(crate = "crate", extends = MutableBase, frozen, subclass)]
+    struct ImmutableChildOfMutableBase;
+
+    #[pyclass(crate = "crate", extends = MutableChildOfMutableBase)]
+    struct MutableChildOfMutableChildOfMutableBase;
+
+    #[pyclass(crate = "crate", extends = ImmutableChildOfMutableBase)]
+    struct MutableChildOfImmutableChildOfMutableBase;
+
+    #[pyclass(crate = "crate", extends = MutableChildOfMutableBase, frozen)]
+    struct ImmutableChildOfMutableChildOfMutableBase;
+
+    #[pyclass(crate = "crate", extends = ImmutableChildOfMutableBase, frozen)]
+    struct ImmutableChildOfImmutableChildOfMutableBase;
+
+    #[pyclass(crate = "crate", frozen, subclass)]
+    struct ImmutableBase;
+
+    #[pyclass(crate = "crate", extends = ImmutableBase, subclass)]
+    struct MutableChildOfImmutableBase;
+
+    #[pyclass(crate = "crate", extends = ImmutableBase, frozen, subclass)]
+    struct ImmutableChildOfImmutableBase;
+
+    #[pyclass(crate = "crate", extends = MutableChildOfImmutableBase)]
+    struct MutableChildOfMutableChildOfImmutableBase;
+
+    #[pyclass(crate = "crate", extends = ImmutableChildOfImmutableBase)]
+    struct MutableChildOfImmutableChildOfImmutableBase;
+
+    #[pyclass(crate = "crate", extends = MutableChildOfImmutableBase, frozen)]
+    struct ImmutableChildOfMutableChildOfImmutableBase;
+
+    #[pyclass(crate = "crate", extends = ImmutableChildOfImmutableBase, frozen)]
+    struct ImmutableChildOfImmutableChildOfImmutableBase;
+
+    fn assert_mutable<T: PyClass<Frozen = False, PyClassMutability = MutableClass>>() {}
+    fn assert_immutable<T: PyClass<Frozen = True, PyClassMutability = ImmutableClass>>() {}
+    fn assert_mutable_with_mutable_ancestor<
+        T: PyClass<Frozen = False, PyClassMutability = ExtendsMutableAncestor<MutableClass>>,
+    >() {
+    }
+    fn assert_immutable_with_mutable_ancestor<
+        T: PyClass<Frozen = True, PyClassMutability = ExtendsMutableAncestor<ImmutableClass>>,
+    >() {
+    }
+
+    #[test]
+    fn test_inherited_mutability() {
+        // mutable base
+        assert_mutable::<MutableBase>();
+
+        // children of mutable base have a mutable ancestor
+        assert_mutable_with_mutable_ancestor::<MutableChildOfMutableBase>();
+        assert_immutable_with_mutable_ancestor::<ImmutableChildOfMutableBase>();
+
+        // grandchildren of mutable base have a mutable ancestor
+        assert_mutable_with_mutable_ancestor::<MutableChildOfMutableChildOfMutableBase>();
+        assert_mutable_with_mutable_ancestor::<MutableChildOfImmutableChildOfMutableBase>();
+        assert_immutable_with_mutable_ancestor::<ImmutableChildOfMutableChildOfMutableBase>();
+        assert_immutable_with_mutable_ancestor::<ImmutableChildOfImmutableChildOfMutableBase>();
+
+        // immutable base and children
+        assert_immutable::<ImmutableBase>();
+        assert_immutable::<ImmutableChildOfImmutableBase>();
+        assert_immutable::<ImmutableChildOfImmutableChildOfImmutableBase>();
+
+        // mutable children of immutable at any level are simply mutable
+        assert_mutable::<MutableChildOfImmutableBase>();
+        assert_mutable::<MutableChildOfImmutableChildOfImmutableBase>();
+
+        // children of the mutable child display this property
+        assert_mutable_with_mutable_ancestor::<MutableChildOfMutableChildOfImmutableBase>();
+        assert_immutable_with_mutable_ancestor::<ImmutableChildOfMutableChildOfImmutableBase>();
+    }
+
+    #[test]
+    fn test_mutable_borrow_prevents_further_borrows() {
+        Python::with_gil(|py| {
+            let mmm = Py::new(
+                py,
+                PyClassInitializer::from(MutableBase)
+                    .add_subclass(MutableChildOfMutableBase)
+                    .add_subclass(MutableChildOfMutableChildOfMutableBase),
+            )
+            .unwrap();
+
+            let mmm_bound: &Bound<'_, MutableChildOfMutableChildOfMutableBase> = mmm.bind(py);
+
+            let mmm_refmut = mmm_bound.borrow_mut();
+
+            // Cannot take any other mutable or immutable borrows whilst the object is borrowed mutably
+            assert!(mmm_bound
+                .extract::<PyRef<'_, MutableChildOfMutableChildOfMutableBase>>()
+                .is_err());
+            assert!(mmm_bound
+                .extract::<PyRef<'_, MutableChildOfMutableBase>>()
+                .is_err());
+            assert!(mmm_bound.extract::<PyRef<'_, MutableBase>>().is_err());
+            assert!(mmm_bound
+                .extract::<PyRefMut<'_, MutableChildOfMutableChildOfMutableBase>>()
+                .is_err());
+            assert!(mmm_bound
+                .extract::<PyRefMut<'_, MutableChildOfMutableBase>>()
+                .is_err());
+            assert!(mmm_bound.extract::<PyRefMut<'_, MutableBase>>().is_err());
+
+            // With the borrow dropped, all other borrow attempts will succeed
+            drop(mmm_refmut);
+
+            assert!(mmm_bound
+                .extract::<PyRef<'_, MutableChildOfMutableChildOfMutableBase>>()
+                .is_ok());
+            assert!(mmm_bound
+                .extract::<PyRef<'_, MutableChildOfMutableBase>>()
+                .is_ok());
+            assert!(mmm_bound.extract::<PyRef<'_, MutableBase>>().is_ok());
+            assert!(mmm_bound
+                .extract::<PyRefMut<'_, MutableChildOfMutableChildOfMutableBase>>()
+                .is_ok());
+            assert!(mmm_bound
+                .extract::<PyRefMut<'_, MutableChildOfMutableBase>>()
+                .is_ok());
+            assert!(mmm_bound.extract::<PyRefMut<'_, MutableBase>>().is_ok());
+        })
+    }
+
+    #[test]
+    fn test_immutable_borrows_prevent_mutable_borrows() {
+        Python::with_gil(|py| {
+            let mmm = Py::new(
+                py,
+                PyClassInitializer::from(MutableBase)
+                    .add_subclass(MutableChildOfMutableBase)
+                    .add_subclass(MutableChildOfMutableChildOfMutableBase),
+            )
+            .unwrap();
+
+            let mmm_bound: &Bound<'_, MutableChildOfMutableChildOfMutableBase> = mmm.bind(py);
+
+            let mmm_refmut = mmm_bound.borrow();
+
+            // Further immutable borrows are ok
+            assert!(mmm_bound
+                .extract::<PyRef<'_, MutableChildOfMutableChildOfMutableBase>>()
+                .is_ok());
+            assert!(mmm_bound
+                .extract::<PyRef<'_, MutableChildOfMutableBase>>()
+                .is_ok());
+            assert!(mmm_bound.extract::<PyRef<'_, MutableBase>>().is_ok());
+
+            // Further mutable borrows are not ok
+            assert!(mmm_bound
+                .extract::<PyRefMut<'_, MutableChildOfMutableChildOfMutableBase>>()
+                .is_err());
+            assert!(mmm_bound
+                .extract::<PyRefMut<'_, MutableChildOfMutableBase>>()
+                .is_err());
+            assert!(mmm_bound.extract::<PyRefMut<'_, MutableBase>>().is_err());
+
+            // With the borrow dropped, all mutable borrow attempts will succeed
+            drop(mmm_refmut);
+
+            assert!(mmm_bound
+                .extract::<PyRefMut<'_, MutableChildOfMutableChildOfMutableBase>>()
+                .is_ok());
+            assert!(mmm_bound
+                .extract::<PyRefMut<'_, MutableChildOfMutableBase>>()
+                .is_ok());
+            assert!(mmm_bound.extract::<PyRefMut<'_, MutableBase>>().is_ok());
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/pycell.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/pycell.rs
--- 43.0.0-1/rust-vendor/pyo3/src/pycell.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/pycell.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1303 @@
+//! PyO3's interior mutability primitive.
+//!
+//! Rust has strict aliasing rules - you can either have any number of immutable (shared) references or one mutable
+//! reference. Python's ownership model is the complete opposite of that - any Python object
+//! can be referenced any number of times, and mutation is allowed from any reference.
+//!
+//! PyO3 deals with these differences by employing the [Interior Mutability]
+//! pattern. This requires that PyO3 enforces the borrowing rules and it has two mechanisms for
+//! doing so:
+//! - Statically it can enforce threadsafe access with the [`Python<'py>`](crate::Python) token.
+//!   All Rust code holding that token, or anything derived from it, can assume that they have
+//!   safe access to the Python interpreter's state. For this reason all the native Python objects
+//!   can be mutated through shared references.
+//! - However, methods and functions in Rust usually *do* need `&mut` references. While PyO3 can
+//!   use the [`Python<'py>`](crate::Python) token to guarantee thread-safe access to them, it cannot
+//!   statically guarantee uniqueness of `&mut` references. As such those references have to be tracked
+//!   dynamically at runtime, using `PyCell` and the other types defined in this module. This works
+//!   similar to std's [`RefCell`](std::cell::RefCell) type.
+//!
+//! # When *not* to use PyCell
+//!
+//! Usually you can use `&mut` references as method and function receivers and arguments, and you
+//! won't need to use `PyCell` directly:
+//!
+//! ```rust
+//! use pyo3::prelude::*;
+//!
+//! #[pyclass]
+//! struct Number {
+//!     inner: u32,
+//! }
+//!
+//! #[pymethods]
+//! impl Number {
+//!     fn increment(&mut self) {
+//!         self.inner += 1;
+//!     }
+//! }
+//! ```
+//!
+//! The [`#[pymethods]`](crate::pymethods) proc macro will generate this wrapper function (and more),
+//! using `PyCell` under the hood:
+//!
+//! ```rust,ignore
+//! # use pyo3::prelude::*;
+//! # #[pyclass]
+//! # struct Number {
+//! #    inner: u32,
+//! # }
+//! #
+//! # #[pymethods]
+//! # impl Number {
+//! #    fn increment(&mut self) {
+//! #        self.inner += 1;
+//! #    }
+//! # }
+//! #
+//! // The function which is exported to Python looks roughly like the following
+//! unsafe extern "C" fn __pymethod_increment__(
+//!     _slf: *mut pyo3::ffi::PyObject,
+//!     _args: *mut pyo3::ffi::PyObject,
+//! ) -> *mut pyo3::ffi::PyObject {
+//!     use :: pyo3 as _pyo3;
+//!     _pyo3::impl_::trampoline::noargs(_slf, _args, |py, _slf| {
+//! #       #[allow(deprecated)]
+//!         let _cell = py
+//!             .from_borrowed_ptr::<_pyo3::PyAny>(_slf)
+//!             .downcast::<_pyo3::PyCell<Number>>()?;
+//!         let mut _ref = _cell.try_borrow_mut()?;
+//!         let _slf: &mut Number = &mut *_ref;
+//!         _pyo3::callback::convert(py, Number::increment(_slf))
+//!     })
+//! }
+//! ```
+//!
+//! # When to use PyCell
+//! ## Using pyclasses from Rust
+//!
+//! However, we *do* need `PyCell` if we want to call its methods from Rust:
+//! ```rust
+//! # use pyo3::prelude::*;
+//! #
+//! # #[pyclass]
+//! # struct Number {
+//! #     inner: u32,
+//! # }
+//! #
+//! # #[pymethods]
+//! # impl Number {
+//! #     fn increment(&mut self) {
+//! #         self.inner += 1;
+//! #     }
+//! # }
+//! # fn main() -> PyResult<()> {
+//! Python::with_gil(|py| {
+//!     let n = Py::new(py, Number { inner: 0 })?;
+//!
+//!     // We borrow the guard and then dereference
+//!     // it to get a mutable reference to Number
+//!     let mut guard: PyRefMut<'_, Number> = n.bind(py).borrow_mut();
+//!     let n_mutable: &mut Number = &mut *guard;
+//!
+//!     n_mutable.increment();
+//!
+//!     // To avoid panics we must dispose of the
+//!     // `PyRefMut` before borrowing again.
+//!     drop(guard);
+//!
+//!     let n_immutable: &Number = &n.bind(py).borrow();
+//!     assert_eq!(n_immutable.inner, 1);
+//!
+//!     Ok(())
+//! })
+//! # }
+//! ```
+//! ## Dealing with possibly overlapping mutable references
+//!
+//! It is also necessary to use `PyCell` if you can receive mutable arguments that may overlap.
+//! Suppose the following function that swaps the values of two `Number`s:
+//! ```
+//! # use pyo3::prelude::*;
+//! # #[pyclass]
+//! # pub struct Number {
+//! #     inner: u32,
+//! # }
+//! #[pyfunction]
+//! fn swap_numbers(a: &mut Number, b: &mut Number) {
+//!     std::mem::swap(&mut a.inner, &mut b.inner);
+//! }
+//! # fn main() {
+//! #     Python::with_gil(|py| {
+//! #         let n = Py::new(py, Number{inner: 35}).unwrap();
+//! #         let n2 = n.clone_ref(py);
+//! #         assert!(n.is(&n2));
+//! #         let fun = pyo3::wrap_pyfunction_bound!(swap_numbers, py).unwrap();
+//! #         fun.call1((n, n2)).expect_err("Managed to create overlapping mutable references. Note: this is undefined behaviour.");
+//! #     });
+//! # }
+//! ```
+//! When users pass in the same `Number` as both arguments, one of the mutable borrows will
+//! fail and raise a `RuntimeError`:
+//! ```text
+//! >>> a = Number()
+//! >>> swap_numbers(a, a)
+//! Traceback (most recent call last):
+//!   File "<stdin>", line 1, in <module>
+//!   RuntimeError: Already borrowed
+//! ```
+//!
+//! It is better to write that function like this:
+//! ```rust,ignore
+//! # #![allow(deprecated)]
+//! # use pyo3::prelude::*;
+//! # #[pyclass]
+//! # pub struct Number {
+//! #     inner: u32,
+//! # }
+//! #[pyfunction]
+//! fn swap_numbers(a: &PyCell<Number>, b: &PyCell<Number>) {
+//!     // Check that the pointers are unequal
+//!     if !a.is(b) {
+//!         std::mem::swap(&mut a.borrow_mut().inner, &mut b.borrow_mut().inner);
+//!     } else {
+//!         // Do nothing - they are the same object, so don't need swapping.
+//!     }
+//! }
+//! # fn main() {
+//! #     // With duplicate numbers
+//! #     Python::with_gil(|py| {
+//! #         let n = Py::new(py, Number{inner: 35}).unwrap();
+//! #         let n2 = n.clone_ref(py);
+//! #         assert!(n.is(&n2));
+//! #         let fun = pyo3::wrap_pyfunction_bound!(swap_numbers, py).unwrap();
+//! #         fun.call1((n, n2)).unwrap();
+//! #     });
+//! #
+//! #     // With two different numbers
+//! #     Python::with_gil(|py| {
+//! #         let n = Py::new(py, Number{inner: 35}).unwrap();
+//! #         let n2 = Py::new(py, Number{inner: 42}).unwrap();
+//! #         assert!(!n.is(&n2));
+//! #         let fun = pyo3::wrap_pyfunction_bound!(swap_numbers, py).unwrap();
+//! #         fun.call1((&n, &n2)).unwrap();
+//! #         let n: u32 = n.borrow(py).inner;
+//! #         let n2: u32 = n2.borrow(py).inner;
+//! #         assert_eq!(n, 42);
+//! #         assert_eq!(n2, 35);
+//! #     });
+//! # }
+//! ```
+//! See the [guide] for more information.
+//!
+//! [guide]: https://pyo3.rs/latest/class.html#pycell-and-interior-mutability "PyCell and interior mutability"
+//! [Interior Mutability]: https://doc.rust-lang.org/book/ch15-05-interior-mutability.html "RefCell<T> and the Interior Mutability Pattern - The Rust Programming Language"
+
+use crate::conversion::AsPyPointer;
+use crate::exceptions::PyRuntimeError;
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::internal_tricks::{ptr_from_mut, ptr_from_ref};
+use crate::pyclass::{boolean_struct::False, PyClass};
+use crate::types::any::PyAnyMethods;
+#[cfg(feature = "gil-refs")]
+use crate::{
+    conversion::ToPyObject,
+    impl_::pyclass::PyClassImpl,
+    pyclass::boolean_struct::True,
+    pyclass_init::PyClassInitializer,
+    type_object::{PyLayout, PySizedLayout},
+    types::PyAny,
+    PyNativeType, PyResult, PyTypeCheck,
+};
+use crate::{ffi, Bound, IntoPy, PyErr, PyObject, Python};
+use std::fmt;
+use std::mem::ManuallyDrop;
+use std::ops::{Deref, DerefMut};
+
+pub(crate) mod impl_;
+#[cfg(feature = "gil-refs")]
+use self::impl_::PyClassObject;
+use impl_::{PyClassBorrowChecker, PyClassObjectLayout};
+
+/// A container type for (mutably) accessing [`PyClass`] values
+///
+/// `PyCell` autodereferences to [`PyAny`], so you can call `PyAny`'s methods on a `PyCell<T>`.
+///
+/// # Examples
+///
+/// This example demonstrates getting a mutable reference of the contained `PyClass`.
+/// ```rust
+/// use pyo3::prelude::*;
+///
+/// #[pyclass]
+/// struct Number {
+///     inner: u32,
+/// }
+///
+/// #[pymethods]
+/// impl Number {
+///     fn increment(&mut self) {
+///         self.inner += 1;
+///     }
+/// }
+///
+/// # fn main() -> PyResult<()> {
+/// Python::with_gil(|py| {
+/// #   #[allow(deprecated)]
+///     let n = PyCell::new(py, Number { inner: 0 })?;
+///
+///     let n_mutable: &mut Number = &mut n.borrow_mut();
+///     n_mutable.increment();
+///
+///     Ok(())
+/// })
+/// # }
+/// ```
+/// For more information on how, when and why (not) to use `PyCell` please see the
+/// [module-level documentation](self).
+#[cfg(feature = "gil-refs")]
+#[deprecated(
+    since = "0.21.0",
+    note = "`PyCell` was merged into `Bound`, use that instead; see the migration guide for more info"
+)]
+#[repr(transparent)]
+pub struct PyCell<T: PyClassImpl>(PyClassObject<T>);
+
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+unsafe impl<T: PyClass> PyNativeType for PyCell<T> {
+    type AsRefSource = T;
+}
+
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+impl<T: PyClass> PyCell<T> {
+    /// Makes a new `PyCell` on the Python heap and return the reference to it.
+    ///
+    /// In cases where the value in the cell does not need to be accessed immediately after
+    /// creation, consider [`Py::new`](crate::Py::new) as a more efficient alternative.
+    #[deprecated(
+        since = "0.21.0",
+        note = "use `Bound::new(py, value)` or `Py::new(py, value)` instead of `PyCell::new(py, value)`"
+    )]
+    pub fn new(py: Python<'_>, value: impl Into<PyClassInitializer<T>>) -> PyResult<&Self> {
+        Bound::new(py, value).map(Bound::into_gil_ref)
+    }
+
+    /// Immutably borrows the value `T`. This borrow lasts as long as the returned `PyRef` exists.
+    ///
+    /// For frozen classes, the simpler [`get`][Self::get] is available.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the value is currently mutably borrowed. For a non-panicking variant, use
+    /// [`try_borrow`](#method.try_borrow).
+    pub fn borrow(&self) -> PyRef<'_, T> {
+        PyRef::borrow(&self.as_borrowed())
+    }
+
+    /// Mutably borrows the value `T`. This borrow lasts as long as the returned `PyRefMut` exists.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the value is currently borrowed. For a non-panicking variant, use
+    /// [`try_borrow_mut`](#method.try_borrow_mut).
+    pub fn borrow_mut(&self) -> PyRefMut<'_, T>
+    where
+        T: PyClass<Frozen = False>,
+    {
+        PyRefMut::borrow(&self.as_borrowed())
+    }
+
+    /// Immutably borrows the value `T`, returning an error if the value is currently
+    /// mutably borrowed. This borrow lasts as long as the returned `PyRef` exists.
+    ///
+    /// This is the non-panicking variant of [`borrow`](#method.borrow).
+    ///
+    /// For frozen classes, the simpler [`get`][Self::get] is available.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # use pyo3::prelude::*;
+    /// #[pyclass]
+    /// struct Class {}
+    ///
+    /// Python::with_gil(|py| {
+    /// #   #[allow(deprecated)]
+    ///     let c = PyCell::new(py, Class {}).unwrap();
+    ///     {
+    ///         let m = c.borrow_mut();
+    ///         assert!(c.try_borrow().is_err());
+    ///     }
+    ///
+    ///     {
+    ///         let m = c.borrow();
+    ///         assert!(c.try_borrow().is_ok());
+    ///     }
+    /// });
+    /// ```
+    pub fn try_borrow(&self) -> Result<PyRef<'_, T>, PyBorrowError> {
+        PyRef::try_borrow(&self.as_borrowed())
+    }
+
+    /// Mutably borrows the value `T`, returning an error if the value is currently borrowed.
+    /// This borrow lasts as long as the returned `PyRefMut` exists.
+    ///
+    /// This is the non-panicking variant of [`borrow_mut`](#method.borrow_mut).
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # use pyo3::prelude::*;
+    /// #[pyclass]
+    /// struct Class {}
+    /// Python::with_gil(|py| {
+    /// #   #[allow(deprecated)]
+    ///     let c = PyCell::new(py, Class {}).unwrap();
+    ///     {
+    ///         let m = c.borrow();
+    ///         assert!(c.try_borrow_mut().is_err());
+    ///     }
+    ///
+    ///     assert!(c.try_borrow_mut().is_ok());
+    /// });
+    /// ```
+    pub fn try_borrow_mut(&self) -> Result<PyRefMut<'_, T>, PyBorrowMutError>
+    where
+        T: PyClass<Frozen = False>,
+    {
+        PyRefMut::try_borrow(&self.as_borrowed())
+    }
+
+    /// Immutably borrows the value `T`, returning an error if the value is
+    /// currently mutably borrowed.
+    ///
+    /// # Safety
+    ///
+    /// This method is unsafe because it does not return a `PyRef`,
+    /// thus leaving the borrow flag untouched. Mutably borrowing the `PyCell`
+    /// while the reference returned by this method is alive is undefined behaviour.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # use pyo3::prelude::*;
+    /// #[pyclass]
+    /// struct Class {}
+    /// Python::with_gil(|py| {
+    /// #   #[allow(deprecated)]
+    ///     let c = PyCell::new(py, Class {}).unwrap();
+    ///
+    ///     {
+    ///         let m = c.borrow_mut();
+    ///         assert!(unsafe { c.try_borrow_unguarded() }.is_err());
+    ///     }
+    ///
+    ///     {
+    ///         let m = c.borrow();
+    ///         assert!(unsafe { c.try_borrow_unguarded() }.is_ok());
+    ///     }
+    /// });
+    /// ```
+    pub unsafe fn try_borrow_unguarded(&self) -> Result<&T, PyBorrowError> {
+        self.0.ensure_threadsafe();
+        self.0
+            .borrow_checker()
+            .try_borrow_unguarded()
+            .map(|_: ()| &*self.0.get_ptr())
+    }
+
+    /// Provide an immutable borrow of the value `T` without acquiring the GIL.
+    ///
+    /// This is available if the class is [`frozen`][macro@crate::pyclass] and [`Sync`].
+    ///
+    /// While the GIL is usually required to get access to `&PyCell<T>`,
+    /// compared to [`borrow`][Self::borrow] or [`try_borrow`][Self::try_borrow]
+    /// this avoids any thread or borrow checking overhead at runtime.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::sync::atomic::{AtomicUsize, Ordering};
+    /// # use pyo3::prelude::*;
+    ///
+    /// #[pyclass(frozen)]
+    /// struct FrozenCounter {
+    ///     value: AtomicUsize,
+    /// }
+    ///
+    /// Python::with_gil(|py| {
+    ///     let counter = FrozenCounter { value: AtomicUsize::new(0) };
+    ///
+    /// #   #[allow(deprecated)]
+    ///     let cell = PyCell::new(py, counter).unwrap();
+    ///
+    ///     cell.get().value.fetch_add(1, Ordering::Relaxed);
+    /// });
+    /// ```
+    pub fn get(&self) -> &T
+    where
+        T: PyClass<Frozen = True> + Sync,
+    {
+        // SAFETY: The class itself is frozen and `Sync` and we do not access anything but `self.contents.value`.
+        unsafe { &*self.get_ptr() }
+    }
+
+    /// Replaces the wrapped value with a new one, returning the old value.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the value is currently borrowed.
+    #[inline]
+    pub fn replace(&self, t: T) -> T
+    where
+        T: PyClass<Frozen = False>,
+    {
+        std::mem::replace(&mut *self.borrow_mut(), t)
+    }
+
+    /// Replaces the wrapped value with a new one computed from `f`, returning the old value.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the value is currently borrowed.
+    pub fn replace_with<F: FnOnce(&mut T) -> T>(&self, f: F) -> T
+    where
+        T: PyClass<Frozen = False>,
+    {
+        let mut_borrow = &mut *self.borrow_mut();
+        let replacement = f(mut_borrow);
+        std::mem::replace(mut_borrow, replacement)
+    }
+
+    /// Swaps the wrapped value of `self` with the wrapped value of `other`.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the value in either `PyCell` is currently borrowed.
+    #[inline]
+    pub fn swap(&self, other: &Self)
+    where
+        T: PyClass<Frozen = False>,
+    {
+        std::mem::swap(&mut *self.borrow_mut(), &mut *other.borrow_mut())
+    }
+
+    pub(crate) fn get_ptr(&self) -> *mut T {
+        self.0.get_ptr()
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+unsafe impl<T: PyClassImpl> PyLayout<T> for PyCell<T> {}
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+impl<T: PyClass> PySizedLayout<T> for PyCell<T> {}
+
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+impl<T> PyTypeCheck for PyCell<T>
+where
+    T: PyClass,
+{
+    const NAME: &'static str = <T as PyTypeCheck>::NAME;
+
+    fn type_check(object: &Bound<'_, PyAny>) -> bool {
+        <T as PyTypeCheck>::type_check(object)
+    }
+}
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+unsafe impl<T: PyClass> AsPyPointer for PyCell<T> {
+    fn as_ptr(&self) -> *mut ffi::PyObject {
+        ptr_from_ref(self) as *mut _
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+impl<T: PyClass> ToPyObject for &PyCell<T> {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        unsafe { PyObject::from_borrowed_ptr(py, self.as_ptr()) }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+impl<T: PyClass> AsRef<PyAny> for PyCell<T> {
+    fn as_ref(&self) -> &PyAny {
+        #[allow(deprecated)]
+        unsafe {
+            self.py().from_borrowed_ptr(self.as_ptr())
+        }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+impl<T: PyClass> Deref for PyCell<T> {
+    type Target = PyAny;
+
+    fn deref(&self) -> &PyAny {
+        #[allow(deprecated)]
+        unsafe {
+            self.py().from_borrowed_ptr(self.as_ptr())
+        }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+impl<T: PyClass + fmt::Debug> fmt::Debug for PyCell<T> {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        match self.try_borrow() {
+            Ok(borrow) => f.debug_struct("RefCell").field("value", &borrow).finish(),
+            Err(_) => {
+                struct BorrowedPlaceholder;
+                impl fmt::Debug for BorrowedPlaceholder {
+                    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+                        f.write_str("<borrowed>")
+                    }
+                }
+                f.debug_struct("RefCell")
+                    .field("value", &BorrowedPlaceholder)
+                    .finish()
+            }
+        }
+    }
+}
+
+/// A wrapper type for an immutably borrowed value from a [`Bound<'py, T>`].
+///
+/// See the [`Bound`] documentation for more information.
+///
+/// # Examples
+///
+/// You can use [`PyRef`] as an alternative to a `&self` receiver when
+/// - you need to access the pointer of the [`Bound`], or
+/// - you want to get a super class.
+/// ```
+/// # use pyo3::prelude::*;
+/// #[pyclass(subclass)]
+/// struct Parent {
+///     basename: &'static str,
+/// }
+///
+/// #[pyclass(extends=Parent)]
+/// struct Child {
+///     name: &'static str,
+///  }
+///
+/// #[pymethods]
+/// impl Child {
+///     #[new]
+///     fn new() -> (Self, Parent) {
+///         (Child { name: "Caterpillar" }, Parent { basename: "Butterfly" })
+///     }
+///
+///     fn format(slf: PyRef<'_, Self>) -> String {
+///         // We can get *mut ffi::PyObject from PyRef
+///         let refcnt = unsafe { pyo3::ffi::Py_REFCNT(slf.as_ptr()) };
+///         // We can get &Self::BaseType by as_ref
+///         let basename = slf.as_ref().basename;
+///         format!("{}(base: {}, cnt: {})", slf.name, basename, refcnt)
+///     }
+/// }
+/// # Python::with_gil(|py| {
+/// #     let sub = Py::new(py, Child::new()).unwrap();
+/// #     pyo3::py_run!(py, sub, "assert sub.format() == 'Caterpillar(base: Butterfly, cnt: 4)', sub.format()");
+/// # });
+/// ```
+///
+/// See the [module-level documentation](self) for more information.
+#[repr(transparent)]
+pub struct PyRef<'p, T: PyClass> {
+    // TODO: once the GIL Ref API is removed, consider adding a lifetime parameter to `PyRef` to
+    // store `Borrowed` here instead, avoiding reference counting overhead.
+    inner: Bound<'p, T>,
+}
+
+impl<'p, T: PyClass> PyRef<'p, T> {
+    /// Returns a `Python` token that is bound to the lifetime of the `PyRef`.
+    pub fn py(&self) -> Python<'p> {
+        self.inner.py()
+    }
+}
+
+impl<'p, T, U> AsRef<U> for PyRef<'p, T>
+where
+    T: PyClass<BaseType = U>,
+    U: PyClass,
+{
+    fn as_ref(&self) -> &T::BaseType {
+        self.as_super()
+    }
+}
+
+impl<'py, T: PyClass> PyRef<'py, T> {
+    /// Returns the raw FFI pointer represented by self.
+    ///
+    /// # Safety
+    ///
+    /// Callers are responsible for ensuring that the pointer does not outlive self.
+    ///
+    /// The reference is borrowed; callers should not decrease the reference count
+    /// when they are finished with the pointer.
+    #[inline]
+    pub fn as_ptr(&self) -> *mut ffi::PyObject {
+        self.inner.as_ptr()
+    }
+
+    /// Returns an owned raw FFI pointer represented by self.
+    ///
+    /// # Safety
+    ///
+    /// The reference is owned; when finished the caller should either transfer ownership
+    /// of the pointer or decrease the reference count (e.g. with [`pyo3::ffi::Py_DecRef`](crate::ffi::Py_DecRef)).
+    #[inline]
+    pub fn into_ptr(self) -> *mut ffi::PyObject {
+        self.inner.clone().into_ptr()
+    }
+
+    #[track_caller]
+    pub(crate) fn borrow(obj: &Bound<'py, T>) -> Self {
+        Self::try_borrow(obj).expect("Already mutably borrowed")
+    }
+
+    pub(crate) fn try_borrow(obj: &Bound<'py, T>) -> Result<Self, PyBorrowError> {
+        let cell = obj.get_class_object();
+        cell.ensure_threadsafe();
+        cell.borrow_checker()
+            .try_borrow()
+            .map(|_| Self { inner: obj.clone() })
+    }
+
+    pub(crate) fn try_borrow_threadsafe(obj: &Bound<'py, T>) -> Result<Self, PyBorrowError> {
+        let cell = obj.get_class_object();
+        cell.check_threadsafe()?;
+        cell.borrow_checker()
+            .try_borrow()
+            .map(|_| Self { inner: obj.clone() })
+    }
+}
+
+impl<'p, T, U> PyRef<'p, T>
+where
+    T: PyClass<BaseType = U>,
+    U: PyClass,
+{
+    /// Gets a `PyRef<T::BaseType>`.
+    ///
+    /// While `as_ref()` returns a reference of type `&T::BaseType`, this cannot be
+    /// used to get the base of `T::BaseType`.
+    ///
+    /// But with the help of this method, you can get hold of instances of the
+    /// super-superclass when needed.
+    ///
+    /// # Examples
+    /// ```
+    /// # use pyo3::prelude::*;
+    /// #[pyclass(subclass)]
+    /// struct Base1 {
+    ///     name1: &'static str,
+    /// }
+    ///
+    /// #[pyclass(extends=Base1, subclass)]
+    /// struct Base2 {
+    ///     name2: &'static str,
+    /// }
+    ///
+    /// #[pyclass(extends=Base2)]
+    /// struct Sub {
+    ///     name3: &'static str,
+    /// }
+    ///
+    /// #[pymethods]
+    /// impl Sub {
+    ///     #[new]
+    ///     fn new() -> PyClassInitializer<Self> {
+    ///         PyClassInitializer::from(Base1 { name1: "base1" })
+    ///             .add_subclass(Base2 { name2: "base2" })
+    ///             .add_subclass(Self { name3: "sub" })
+    ///     }
+    ///     fn name(slf: PyRef<'_, Self>) -> String {
+    ///         let subname = slf.name3;
+    ///         let super_ = slf.into_super();
+    ///         format!("{} {} {}", super_.as_ref().name1, super_.name2, subname)
+    ///     }
+    /// }
+    /// # Python::with_gil(|py| {
+    /// #     let sub = Py::new(py, Sub::new()).unwrap();
+    /// #     pyo3::py_run!(py, sub, "assert sub.name() == 'base1 base2 sub'")
+    /// # });
+    /// ```
+    pub fn into_super(self) -> PyRef<'p, U> {
+        let py = self.py();
+        PyRef {
+            inner: unsafe {
+                ManuallyDrop::new(self)
+                    .as_ptr()
+                    .assume_owned(py)
+                    .downcast_into_unchecked()
+            },
+        }
+    }
+
+    /// Borrows a shared reference to `PyRef<T::BaseType>`.
+    ///
+    /// With the help of this method, you can access attributes and call methods
+    /// on the superclass without consuming the `PyRef<T>`. This method can also
+    /// be chained to access the super-superclass (and so on).
+    ///
+    /// # Examples
+    /// ```
+    /// # use pyo3::prelude::*;
+    /// #[pyclass(subclass)]
+    /// struct Base {
+    ///     base_name: &'static str,
+    /// }
+    /// #[pymethods]
+    /// impl Base {
+    ///     fn base_name_len(&self) -> usize {
+    ///         self.base_name.len()
+    ///     }
+    /// }
+    ///
+    /// #[pyclass(extends=Base)]
+    /// struct Sub {
+    ///     sub_name: &'static str,
+    /// }
+    ///
+    /// #[pymethods]
+    /// impl Sub {
+    ///     #[new]
+    ///     fn new() -> (Self, Base) {
+    ///         (Self { sub_name: "sub_name" }, Base { base_name: "base_name" })
+    ///     }
+    ///     fn sub_name_len(&self) -> usize {
+    ///         self.sub_name.len()
+    ///     }
+    ///     fn format_name_lengths(slf: PyRef<'_, Self>) -> String {
+    ///         format!("{} {}", slf.as_super().base_name_len(), slf.sub_name_len())
+    ///     }
+    /// }
+    /// # Python::with_gil(|py| {
+    /// #     let sub = Py::new(py, Sub::new()).unwrap();
+    /// #     pyo3::py_run!(py, sub, "assert sub.format_name_lengths() == '9 8'")
+    /// # });
+    /// ```
+    pub fn as_super(&self) -> &PyRef<'p, U> {
+        let ptr = ptr_from_ref::<Bound<'p, T>>(&self.inner)
+            // `Bound<T>` has the same layout as `Bound<T::BaseType>`
+            .cast::<Bound<'p, T::BaseType>>()
+            // `Bound<T::BaseType>` has the same layout as `PyRef<T::BaseType>`
+            .cast::<PyRef<'p, T::BaseType>>();
+        unsafe { &*ptr }
+    }
+}
+
+impl<'p, T: PyClass> Deref for PyRef<'p, T> {
+    type Target = T;
+
+    #[inline]
+    fn deref(&self) -> &T {
+        unsafe { &*self.inner.get_class_object().get_ptr() }
+    }
+}
+
+impl<'p, T: PyClass> Drop for PyRef<'p, T> {
+    fn drop(&mut self) {
+        self.inner
+            .get_class_object()
+            .borrow_checker()
+            .release_borrow()
+    }
+}
+
+impl<T: PyClass> IntoPy<PyObject> for PyRef<'_, T> {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        unsafe { PyObject::from_borrowed_ptr(py, self.inner.as_ptr()) }
+    }
+}
+
+impl<T: PyClass> IntoPy<PyObject> for &'_ PyRef<'_, T> {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        unsafe { PyObject::from_borrowed_ptr(py, self.inner.as_ptr()) }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+impl<'a, T: PyClass> std::convert::TryFrom<&'a PyCell<T>> for crate::PyRef<'a, T> {
+    type Error = PyBorrowError;
+    fn try_from(cell: &'a crate::PyCell<T>) -> Result<Self, Self::Error> {
+        cell.try_borrow()
+    }
+}
+
+unsafe impl<'a, T: PyClass> AsPyPointer for PyRef<'a, T> {
+    fn as_ptr(&self) -> *mut ffi::PyObject {
+        self.inner.as_ptr()
+    }
+}
+
+impl<T: PyClass + fmt::Debug> fmt::Debug for PyRef<'_, T> {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        fmt::Debug::fmt(&**self, f)
+    }
+}
+
+/// A wrapper type for a mutably borrowed value from a [`Bound<'py, T>`].
+///
+/// See the [module-level documentation](self) for more information.
+#[repr(transparent)]
+pub struct PyRefMut<'p, T: PyClass<Frozen = False>> {
+    // TODO: once the GIL Ref API is removed, consider adding a lifetime parameter to `PyRef` to
+    // store `Borrowed` here instead, avoiding reference counting overhead.
+    inner: Bound<'p, T>,
+}
+
+impl<'p, T: PyClass<Frozen = False>> PyRefMut<'p, T> {
+    /// Returns a `Python` token that is bound to the lifetime of the `PyRefMut`.
+    pub fn py(&self) -> Python<'p> {
+        self.inner.py()
+    }
+}
+
+impl<'p, T, U> AsRef<U> for PyRefMut<'p, T>
+where
+    T: PyClass<BaseType = U, Frozen = False>,
+    U: PyClass<Frozen = False>,
+{
+    fn as_ref(&self) -> &T::BaseType {
+        PyRefMut::downgrade(self).as_super()
+    }
+}
+
+impl<'p, T, U> AsMut<U> for PyRefMut<'p, T>
+where
+    T: PyClass<BaseType = U, Frozen = False>,
+    U: PyClass<Frozen = False>,
+{
+    fn as_mut(&mut self) -> &mut T::BaseType {
+        self.as_super()
+    }
+}
+
+impl<'py, T: PyClass<Frozen = False>> PyRefMut<'py, T> {
+    /// Returns the raw FFI pointer represented by self.
+    ///
+    /// # Safety
+    ///
+    /// Callers are responsible for ensuring that the pointer does not outlive self.
+    ///
+    /// The reference is borrowed; callers should not decrease the reference count
+    /// when they are finished with the pointer.
+    #[inline]
+    pub fn as_ptr(&self) -> *mut ffi::PyObject {
+        self.inner.as_ptr()
+    }
+
+    /// Returns an owned raw FFI pointer represented by self.
+    ///
+    /// # Safety
+    ///
+    /// The reference is owned; when finished the caller should either transfer ownership
+    /// of the pointer or decrease the reference count (e.g. with [`pyo3::ffi::Py_DecRef`](crate::ffi::Py_DecRef)).
+    #[inline]
+    pub fn into_ptr(self) -> *mut ffi::PyObject {
+        self.inner.clone().into_ptr()
+    }
+
+    #[inline]
+    #[track_caller]
+    pub(crate) fn borrow(obj: &Bound<'py, T>) -> Self {
+        Self::try_borrow(obj).expect("Already borrowed")
+    }
+
+    pub(crate) fn try_borrow(obj: &Bound<'py, T>) -> Result<Self, PyBorrowMutError> {
+        let cell = obj.get_class_object();
+        cell.ensure_threadsafe();
+        cell.borrow_checker()
+            .try_borrow_mut()
+            .map(|_| Self { inner: obj.clone() })
+    }
+
+    pub(crate) fn downgrade(slf: &Self) -> &PyRef<'py, T> {
+        // `PyRefMut<T>` and `PyRef<T>` have the same layout
+        unsafe { &*ptr_from_ref(slf).cast() }
+    }
+}
+
+impl<'p, T, U> PyRefMut<'p, T>
+where
+    T: PyClass<BaseType = U, Frozen = False>,
+    U: PyClass<Frozen = False>,
+{
+    /// Gets a `PyRef<T::BaseType>`.
+    ///
+    /// See [`PyRef::into_super`] for more.
+    pub fn into_super(self) -> PyRefMut<'p, U> {
+        let py = self.py();
+        PyRefMut {
+            inner: unsafe {
+                ManuallyDrop::new(self)
+                    .as_ptr()
+                    .assume_owned(py)
+                    .downcast_into_unchecked()
+            },
+        }
+    }
+
+    /// Borrows a mutable reference to `PyRefMut<T::BaseType>`.
+    ///
+    /// With the help of this method, you can mutate attributes and call mutating
+    /// methods on the superclass without consuming the `PyRefMut<T>`. This method
+    /// can also be chained to access the super-superclass (and so on).
+    ///
+    /// See [`PyRef::as_super`] for more.
+    pub fn as_super(&mut self) -> &mut PyRefMut<'p, U> {
+        let ptr = ptr_from_mut::<Bound<'p, T>>(&mut self.inner)
+            // `Bound<T>` has the same layout as `Bound<T::BaseType>`
+            .cast::<Bound<'p, T::BaseType>>()
+            // `Bound<T::BaseType>` has the same layout as `PyRefMut<T::BaseType>`,
+            // and the mutable borrow on `self` prevents aliasing
+            .cast::<PyRefMut<'p, T::BaseType>>();
+        unsafe { &mut *ptr }
+    }
+}
+
+impl<'p, T: PyClass<Frozen = False>> Deref for PyRefMut<'p, T> {
+    type Target = T;
+
+    #[inline]
+    fn deref(&self) -> &T {
+        unsafe { &*self.inner.get_class_object().get_ptr() }
+    }
+}
+
+impl<'p, T: PyClass<Frozen = False>> DerefMut for PyRefMut<'p, T> {
+    #[inline]
+    fn deref_mut(&mut self) -> &mut T {
+        unsafe { &mut *self.inner.get_class_object().get_ptr() }
+    }
+}
+
+impl<'p, T: PyClass<Frozen = False>> Drop for PyRefMut<'p, T> {
+    fn drop(&mut self) {
+        self.inner
+            .get_class_object()
+            .borrow_checker()
+            .release_borrow_mut()
+    }
+}
+
+impl<T: PyClass<Frozen = False>> IntoPy<PyObject> for PyRefMut<'_, T> {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        unsafe { PyObject::from_borrowed_ptr(py, self.inner.as_ptr()) }
+    }
+}
+
+impl<T: PyClass<Frozen = False>> IntoPy<PyObject> for &'_ PyRefMut<'_, T> {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        self.inner.clone().into_py(py)
+    }
+}
+
+unsafe impl<'a, T: PyClass<Frozen = False>> AsPyPointer for PyRefMut<'a, T> {
+    fn as_ptr(&self) -> *mut ffi::PyObject {
+        self.inner.as_ptr()
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+impl<'a, T: PyClass<Frozen = False>> std::convert::TryFrom<&'a PyCell<T>>
+    for crate::PyRefMut<'a, T>
+{
+    type Error = PyBorrowMutError;
+    fn try_from(cell: &'a crate::PyCell<T>) -> Result<Self, Self::Error> {
+        cell.try_borrow_mut()
+    }
+}
+
+impl<T: PyClass<Frozen = False> + fmt::Debug> fmt::Debug for PyRefMut<'_, T> {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        fmt::Debug::fmt(self.deref(), f)
+    }
+}
+
+/// An error type returned by [`Bound::try_borrow`].
+///
+/// If this error is allowed to bubble up into Python code it will raise a `RuntimeError`.
+pub struct PyBorrowError {
+    _private: (),
+}
+
+impl fmt::Debug for PyBorrowError {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.debug_struct("PyBorrowError").finish()
+    }
+}
+
+impl fmt::Display for PyBorrowError {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        fmt::Display::fmt("Already mutably borrowed", f)
+    }
+}
+
+impl From<PyBorrowError> for PyErr {
+    fn from(other: PyBorrowError) -> Self {
+        PyRuntimeError::new_err(other.to_string())
+    }
+}
+
+/// An error type returned by [`Bound::try_borrow_mut`].
+///
+/// If this error is allowed to bubble up into Python code it will raise a `RuntimeError`.
+pub struct PyBorrowMutError {
+    _private: (),
+}
+
+impl fmt::Debug for PyBorrowMutError {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.debug_struct("PyBorrowMutError").finish()
+    }
+}
+
+impl fmt::Display for PyBorrowMutError {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        fmt::Display::fmt("Already borrowed", f)
+    }
+}
+
+impl From<PyBorrowMutError> for PyErr {
+    fn from(other: PyBorrowMutError) -> Self {
+        PyRuntimeError::new_err(other.to_string())
+    }
+}
+
+#[cfg(test)]
+#[cfg(feature = "macros")]
+mod tests {
+
+    use super::*;
+
+    #[crate::pyclass]
+    #[pyo3(crate = "crate")]
+    #[derive(Copy, Clone, PartialEq, Eq, Debug)]
+    struct SomeClass(i32);
+
+    #[cfg(feature = "gil-refs")]
+    mod deprecated {
+        use super::*;
+
+        #[test]
+        fn pycell_replace() {
+            Python::with_gil(|py| {
+                #[allow(deprecated)]
+                let cell = PyCell::new(py, SomeClass(0)).unwrap();
+                assert_eq!(*cell.borrow(), SomeClass(0));
+
+                let previous = cell.replace(SomeClass(123));
+                assert_eq!(previous, SomeClass(0));
+                assert_eq!(*cell.borrow(), SomeClass(123));
+            })
+        }
+
+        #[test]
+        #[should_panic(expected = "Already borrowed: PyBorrowMutError")]
+        fn pycell_replace_panic() {
+            Python::with_gil(|py| {
+                #[allow(deprecated)]
+                let cell = PyCell::new(py, SomeClass(0)).unwrap();
+                let _guard = cell.borrow();
+
+                cell.replace(SomeClass(123));
+            })
+        }
+
+        #[test]
+        fn pycell_replace_with() {
+            Python::with_gil(|py| {
+                #[allow(deprecated)]
+                let cell = PyCell::new(py, SomeClass(0)).unwrap();
+                assert_eq!(*cell.borrow(), SomeClass(0));
+
+                let previous = cell.replace_with(|value| {
+                    *value = SomeClass(2);
+                    SomeClass(123)
+                });
+                assert_eq!(previous, SomeClass(2));
+                assert_eq!(*cell.borrow(), SomeClass(123));
+            })
+        }
+
+        #[test]
+        #[should_panic(expected = "Already borrowed: PyBorrowMutError")]
+        fn pycell_replace_with_panic() {
+            Python::with_gil(|py| {
+                #[allow(deprecated)]
+                let cell = PyCell::new(py, SomeClass(0)).unwrap();
+                let _guard = cell.borrow();
+
+                cell.replace_with(|_| SomeClass(123));
+            })
+        }
+
+        #[test]
+        fn pycell_swap() {
+            Python::with_gil(|py| {
+                #[allow(deprecated)]
+                let cell = PyCell::new(py, SomeClass(0)).unwrap();
+                #[allow(deprecated)]
+                let cell2 = PyCell::new(py, SomeClass(123)).unwrap();
+                assert_eq!(*cell.borrow(), SomeClass(0));
+                assert_eq!(*cell2.borrow(), SomeClass(123));
+
+                cell.swap(cell2);
+                assert_eq!(*cell.borrow(), SomeClass(123));
+                assert_eq!(*cell2.borrow(), SomeClass(0));
+            })
+        }
+
+        #[test]
+        #[should_panic(expected = "Already borrowed: PyBorrowMutError")]
+        fn pycell_swap_panic() {
+            Python::with_gil(|py| {
+                #[allow(deprecated)]
+                let cell = PyCell::new(py, SomeClass(0)).unwrap();
+                #[allow(deprecated)]
+                let cell2 = PyCell::new(py, SomeClass(123)).unwrap();
+
+                let _guard = cell.borrow();
+                cell.swap(cell2);
+            })
+        }
+
+        #[test]
+        #[should_panic(expected = "Already borrowed: PyBorrowMutError")]
+        fn pycell_swap_panic_other_borrowed() {
+            Python::with_gil(|py| {
+                #[allow(deprecated)]
+                let cell = PyCell::new(py, SomeClass(0)).unwrap();
+                #[allow(deprecated)]
+                let cell2 = PyCell::new(py, SomeClass(123)).unwrap();
+
+                let _guard = cell2.borrow();
+                cell.swap(cell2);
+            })
+        }
+    }
+
+    #[test]
+    fn test_as_ptr() {
+        Python::with_gil(|py| {
+            let cell = Bound::new(py, SomeClass(0)).unwrap();
+            let ptr = cell.as_ptr();
+
+            assert_eq!(cell.borrow().as_ptr(), ptr);
+            assert_eq!(cell.borrow_mut().as_ptr(), ptr);
+        })
+    }
+
+    #[test]
+    fn test_into_ptr() {
+        Python::with_gil(|py| {
+            let cell = Bound::new(py, SomeClass(0)).unwrap();
+            let ptr = cell.as_ptr();
+
+            assert_eq!(cell.borrow().into_ptr(), ptr);
+            unsafe { ffi::Py_DECREF(ptr) };
+
+            assert_eq!(cell.borrow_mut().into_ptr(), ptr);
+            unsafe { ffi::Py_DECREF(ptr) };
+        })
+    }
+
+    #[crate::pyclass]
+    #[pyo3(crate = "crate", subclass)]
+    struct BaseClass {
+        val1: usize,
+    }
+
+    #[crate::pyclass]
+    #[pyo3(crate = "crate", extends=BaseClass, subclass)]
+    struct SubClass {
+        val2: usize,
+    }
+
+    #[crate::pyclass]
+    #[pyo3(crate = "crate", extends=SubClass)]
+    struct SubSubClass {
+        val3: usize,
+    }
+
+    #[crate::pymethods]
+    #[pyo3(crate = "crate")]
+    impl SubSubClass {
+        #[new]
+        fn new(py: Python<'_>) -> crate::Py<SubSubClass> {
+            let init = crate::PyClassInitializer::from(BaseClass { val1: 10 })
+                .add_subclass(SubClass { val2: 15 })
+                .add_subclass(SubSubClass { val3: 20 });
+            crate::Py::new(py, init).expect("allocation error")
+        }
+
+        fn get_values(self_: PyRef<'_, Self>) -> (usize, usize, usize) {
+            let val1 = self_.as_super().as_super().val1;
+            let val2 = self_.as_super().val2;
+            (val1, val2, self_.val3)
+        }
+
+        fn double_values(mut self_: PyRefMut<'_, Self>) {
+            self_.as_super().as_super().val1 *= 2;
+            self_.as_super().val2 *= 2;
+            self_.val3 *= 2;
+        }
+    }
+
+    #[test]
+    fn test_pyref_as_super() {
+        Python::with_gil(|py| {
+            let obj = SubSubClass::new(py).into_bound(py);
+            let pyref = obj.borrow();
+            assert_eq!(pyref.as_super().as_super().val1, 10);
+            assert_eq!(pyref.as_super().val2, 15);
+            assert_eq!(pyref.as_ref().val2, 15); // `as_ref` also works
+            assert_eq!(pyref.val3, 20);
+            assert_eq!(SubSubClass::get_values(pyref), (10, 15, 20));
+        });
+    }
+
+    #[test]
+    fn test_pyrefmut_as_super() {
+        Python::with_gil(|py| {
+            let obj = SubSubClass::new(py).into_bound(py);
+            assert_eq!(SubSubClass::get_values(obj.borrow()), (10, 15, 20));
+            {
+                let mut pyrefmut = obj.borrow_mut();
+                assert_eq!(pyrefmut.as_super().as_ref().val1, 10);
+                pyrefmut.as_super().as_super().val1 -= 5;
+                pyrefmut.as_super().val2 -= 3;
+                pyrefmut.as_mut().val2 -= 2; // `as_mut` also works
+                pyrefmut.val3 -= 5;
+            }
+            assert_eq!(SubSubClass::get_values(obj.borrow()), (5, 10, 15));
+            SubSubClass::double_values(obj.borrow_mut());
+            assert_eq!(SubSubClass::get_values(obj.borrow()), (10, 20, 30));
+        });
+    }
+
+    #[test]
+    fn test_pyrefs_in_python() {
+        Python::with_gil(|py| {
+            let obj = SubSubClass::new(py);
+            crate::py_run!(py, obj, "assert obj.get_values() == (10, 15, 20)");
+            crate::py_run!(py, obj, "assert obj.double_values() is None");
+            crate::py_run!(py, obj, "assert obj.get_values() == (20, 30, 40)");
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/pyclass/create_type_object.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/pyclass/create_type_object.rs
--- 43.0.0-1/rust-vendor/pyo3/src/pyclass/create_type_object.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/pyclass/create_type_object.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,669 @@
+use crate::{
+    exceptions::PyTypeError,
+    ffi,
+    impl_::{
+        pycell::PyClassObject,
+        pyclass::{
+            assign_sequence_item_from_mapping, get_sequence_item_from_mapping, tp_dealloc,
+            tp_dealloc_with_gc, MaybeRuntimePyMethodDef, PyClassItemsIter,
+        },
+        pymethods::{Getter, Setter},
+        trampoline::trampoline,
+    },
+    internal_tricks::ptr_from_ref,
+    types::{typeobject::PyTypeMethods, PyType},
+    Py, PyClass, PyGetterDef, PyMethodDefType, PyResult, PySetterDef, PyTypeInfo, Python,
+};
+use std::{
+    collections::HashMap,
+    ffi::{CStr, CString},
+    os::raw::{c_char, c_int, c_ulong, c_void},
+    ptr,
+};
+
+pub(crate) struct PyClassTypeObject {
+    pub type_object: Py<PyType>,
+    #[allow(dead_code)] // This is purely a cache that must live as long as the type object
+    getset_destructors: Vec<GetSetDefDestructor>,
+}
+
+pub(crate) fn create_type_object<T>(py: Python<'_>) -> PyResult<PyClassTypeObject>
+where
+    T: PyClass,
+{
+    // Written this way to monomorphize the majority of the logic.
+    #[allow(clippy::too_many_arguments)]
+    unsafe fn inner(
+        py: Python<'_>,
+        base: *mut ffi::PyTypeObject,
+        dealloc: unsafe extern "C" fn(*mut ffi::PyObject),
+        dealloc_with_gc: unsafe extern "C" fn(*mut ffi::PyObject),
+        is_mapping: bool,
+        is_sequence: bool,
+        doc: &'static CStr,
+        dict_offset: Option<ffi::Py_ssize_t>,
+        weaklist_offset: Option<ffi::Py_ssize_t>,
+        is_basetype: bool,
+        items_iter: PyClassItemsIter,
+        name: &'static str,
+        module: Option<&'static str>,
+        size_of: usize,
+    ) -> PyResult<PyClassTypeObject> {
+        PyTypeBuilder {
+            slots: Vec::new(),
+            method_defs: Vec::new(),
+            member_defs: Vec::new(),
+            getset_builders: HashMap::new(),
+            cleanup: Vec::new(),
+            tp_base: base,
+            tp_dealloc: dealloc,
+            tp_dealloc_with_gc: dealloc_with_gc,
+            is_mapping,
+            is_sequence,
+            has_new: false,
+            has_dealloc: false,
+            has_getitem: false,
+            has_setitem: false,
+            has_traverse: false,
+            has_clear: false,
+            dict_offset: None,
+            class_flags: 0,
+            #[cfg(all(not(Py_3_9), not(Py_LIMITED_API)))]
+            buffer_procs: Default::default(),
+        }
+        .type_doc(doc)
+        .offsets(dict_offset, weaklist_offset)
+        .set_is_basetype(is_basetype)
+        .class_items(items_iter)
+        .build(py, name, module, size_of)
+    }
+
+    unsafe {
+        inner(
+            py,
+            T::BaseType::type_object_raw(py),
+            tp_dealloc::<T>,
+            tp_dealloc_with_gc::<T>,
+            T::IS_MAPPING,
+            T::IS_SEQUENCE,
+            T::doc(py)?,
+            T::dict_offset(),
+            T::weaklist_offset(),
+            T::IS_BASETYPE,
+            T::items_iter(),
+            T::NAME,
+            T::MODULE,
+            std::mem::size_of::<PyClassObject<T>>(),
+        )
+    }
+}
+
+type PyTypeBuilderCleanup = Box<dyn Fn(&PyTypeBuilder, *mut ffi::PyTypeObject)>;
+
+struct PyTypeBuilder {
+    slots: Vec<ffi::PyType_Slot>,
+    method_defs: Vec<ffi::PyMethodDef>,
+    member_defs: Vec<ffi::PyMemberDef>,
+    getset_builders: HashMap<&'static CStr, GetSetDefBuilder>,
+    /// Used to patch the type objects for the things there's no
+    /// PyType_FromSpec API for... there's no reason this should work,
+    /// except for that it does and we have tests.
+    cleanup: Vec<PyTypeBuilderCleanup>,
+    tp_base: *mut ffi::PyTypeObject,
+    tp_dealloc: ffi::destructor,
+    tp_dealloc_with_gc: ffi::destructor,
+    is_mapping: bool,
+    is_sequence: bool,
+    has_new: bool,
+    has_dealloc: bool,
+    has_getitem: bool,
+    has_setitem: bool,
+    has_traverse: bool,
+    has_clear: bool,
+    dict_offset: Option<ffi::Py_ssize_t>,
+    class_flags: c_ulong,
+    // Before Python 3.9, need to patch in buffer methods manually (they don't work in slots)
+    #[cfg(all(not(Py_3_9), not(Py_LIMITED_API)))]
+    buffer_procs: ffi::PyBufferProcs,
+}
+
+impl PyTypeBuilder {
+    /// # Safety
+    /// The given pointer must be of the correct type for the given slot
+    unsafe fn push_slot<T>(&mut self, slot: c_int, pfunc: *mut T) {
+        match slot {
+            ffi::Py_tp_new => self.has_new = true,
+            ffi::Py_tp_dealloc => self.has_dealloc = true,
+            ffi::Py_mp_subscript => self.has_getitem = true,
+            ffi::Py_mp_ass_subscript => self.has_setitem = true,
+            ffi::Py_tp_traverse => {
+                self.has_traverse = true;
+                self.class_flags |= ffi::Py_TPFLAGS_HAVE_GC;
+            }
+            ffi::Py_tp_clear => self.has_clear = true,
+            #[cfg(all(not(Py_3_9), not(Py_LIMITED_API)))]
+            ffi::Py_bf_getbuffer => {
+                // Safety: slot.pfunc is a valid function pointer
+                self.buffer_procs.bf_getbuffer =
+                    Some(std::mem::transmute::<*mut T, ffi::getbufferproc>(pfunc));
+            }
+            #[cfg(all(not(Py_3_9), not(Py_LIMITED_API)))]
+            ffi::Py_bf_releasebuffer => {
+                // Safety: slot.pfunc is a valid function pointer
+                self.buffer_procs.bf_releasebuffer =
+                    Some(std::mem::transmute::<*mut T, ffi::releasebufferproc>(pfunc));
+            }
+            _ => {}
+        }
+
+        self.slots.push(ffi::PyType_Slot {
+            slot,
+            pfunc: pfunc as _,
+        });
+    }
+
+    /// # Safety
+    /// It is the caller's responsibility that `data` is of the correct type for the given slot.
+    unsafe fn push_raw_vec_slot<T>(&mut self, slot: c_int, mut data: Vec<T>) {
+        if !data.is_empty() {
+            // Python expects a zeroed entry to mark the end of the defs
+            data.push(std::mem::zeroed());
+            self.push_slot(slot, Box::into_raw(data.into_boxed_slice()) as *mut c_void);
+        }
+    }
+
+    fn pymethod_def(&mut self, def: &PyMethodDefType) {
+        match def {
+            PyMethodDefType::Getter(getter) => self
+                .getset_builders
+                .entry(getter.name)
+                .or_default()
+                .add_getter(getter),
+            PyMethodDefType::Setter(setter) => self
+                .getset_builders
+                .entry(setter.name)
+                .or_default()
+                .add_setter(setter),
+            PyMethodDefType::Method(def)
+            | PyMethodDefType::Class(def)
+            | PyMethodDefType::Static(def) => self.method_defs.push(def.as_method_def()),
+            // These class attributes are added after the type gets created by LazyStaticType
+            PyMethodDefType::ClassAttribute(_) => {}
+            PyMethodDefType::StructMember(def) => self.member_defs.push(*def),
+        }
+    }
+
+    fn finalize_methods_and_properties(&mut self) -> Vec<GetSetDefDestructor> {
+        let method_defs: Vec<pyo3_ffi::PyMethodDef> = std::mem::take(&mut self.method_defs);
+        // Safety: Py_tp_methods expects a raw vec of PyMethodDef
+        unsafe { self.push_raw_vec_slot(ffi::Py_tp_methods, method_defs) };
+
+        let member_defs = std::mem::take(&mut self.member_defs);
+        // Safety: Py_tp_members expects a raw vec of PyMemberDef
+        unsafe { self.push_raw_vec_slot(ffi::Py_tp_members, member_defs) };
+
+        let mut getset_destructors = Vec::with_capacity(self.getset_builders.len());
+
+        #[allow(unused_mut)]
+        let mut property_defs: Vec<_> = self
+            .getset_builders
+            .iter()
+            .map(|(name, builder)| {
+                let (def, destructor) = builder.as_get_set_def(name);
+                getset_destructors.push(destructor);
+                def
+            })
+            .collect();
+
+        // PyPy automatically adds __dict__ getter / setter.
+        #[cfg(not(PyPy))]
+        // Supported on unlimited API for all versions, and on 3.9+ for limited API
+        #[cfg(any(Py_3_9, not(Py_LIMITED_API)))]
+        if let Some(dict_offset) = self.dict_offset {
+            let get_dict;
+            let closure;
+            // PyObject_GenericGetDict not in the limited API until Python 3.10.
+            #[cfg(any(not(Py_LIMITED_API), Py_3_10))]
+            {
+                let _ = dict_offset;
+                get_dict = ffi::PyObject_GenericGetDict;
+                closure = ptr::null_mut();
+            }
+
+            // ... so we write a basic implementation ourselves
+            #[cfg(not(any(not(Py_LIMITED_API), Py_3_10)))]
+            {
+                extern "C" fn get_dict_impl(
+                    object: *mut ffi::PyObject,
+                    closure: *mut c_void,
+                ) -> *mut ffi::PyObject {
+                    unsafe {
+                        trampoline(|_| {
+                            let dict_offset = closure as ffi::Py_ssize_t;
+                            // we don't support negative dict_offset here; PyO3 doesn't set it negative
+                            assert!(dict_offset > 0);
+                            // TODO: use `.byte_offset` on MSRV 1.75
+                            let dict_ptr = object
+                                .cast::<u8>()
+                                .offset(dict_offset)
+                                .cast::<*mut ffi::PyObject>();
+                            if (*dict_ptr).is_null() {
+                                std::ptr::write(dict_ptr, ffi::PyDict_New());
+                            }
+                            Ok(ffi::_Py_XNewRef(*dict_ptr))
+                        })
+                    }
+                }
+
+                get_dict = get_dict_impl;
+                closure = dict_offset as _;
+            }
+
+            property_defs.push(ffi::PyGetSetDef {
+                name: ffi::c_str!("__dict__").as_ptr(),
+                get: Some(get_dict),
+                set: Some(ffi::PyObject_GenericSetDict),
+                doc: ptr::null(),
+                closure,
+            });
+        }
+
+        // Safety: Py_tp_getset expects a raw vec of PyGetSetDef
+        unsafe { self.push_raw_vec_slot(ffi::Py_tp_getset, property_defs) };
+
+        // If mapping methods implemented, define sequence methods get implemented too.
+        // CPython does the same for Python `class` statements.
+
+        // NB we don't implement sq_length to avoid annoying CPython behaviour of automatically adding
+        // the length to negative indices.
+
+        // Don't add these methods for "pure" mappings.
+
+        if !self.is_mapping && self.has_getitem {
+            // Safety: This is the correct slot type for Py_sq_item
+            unsafe {
+                self.push_slot(
+                    ffi::Py_sq_item,
+                    get_sequence_item_from_mapping as *mut c_void,
+                )
+            }
+        }
+
+        if !self.is_mapping && self.has_setitem {
+            // Safety: This is the correct slot type for Py_sq_ass_item
+            unsafe {
+                self.push_slot(
+                    ffi::Py_sq_ass_item,
+                    assign_sequence_item_from_mapping as *mut c_void,
+                )
+            }
+        }
+
+        getset_destructors
+    }
+
+    fn set_is_basetype(mut self, is_basetype: bool) -> Self {
+        if is_basetype {
+            self.class_flags |= ffi::Py_TPFLAGS_BASETYPE;
+        }
+        self
+    }
+
+    /// # Safety
+    /// All slots in the PyClassItemsIter should be correct
+    unsafe fn class_items(mut self, iter: PyClassItemsIter) -> Self {
+        for items in iter {
+            for slot in items.slots {
+                self.push_slot(slot.slot, slot.pfunc);
+            }
+            for method in items.methods {
+                let built_method;
+                let method = match method {
+                    MaybeRuntimePyMethodDef::Runtime(builder) => {
+                        built_method = builder();
+                        &built_method
+                    }
+                    MaybeRuntimePyMethodDef::Static(method) => method,
+                };
+                self.pymethod_def(method);
+            }
+        }
+        self
+    }
+
+    fn type_doc(mut self, type_doc: &'static CStr) -> Self {
+        let slice = type_doc.to_bytes();
+        if !slice.is_empty() {
+            unsafe { self.push_slot(ffi::Py_tp_doc, type_doc.as_ptr() as *mut c_char) }
+
+            // Running this causes PyPy to segfault.
+            #[cfg(all(not(PyPy), not(Py_LIMITED_API), not(Py_3_10)))]
+            {
+                // Until CPython 3.10, tp_doc was treated specially for
+                // heap-types, and it removed the text_signature value from it.
+                // We go in after the fact and replace tp_doc with something
+                // that _does_ include the text_signature value!
+                self.cleanup
+                    .push(Box::new(move |_self, type_object| unsafe {
+                        ffi::PyObject_Free((*type_object).tp_doc as _);
+                        let data = ffi::PyMem_Malloc(slice.len());
+                        data.copy_from(slice.as_ptr() as _, slice.len());
+                        (*type_object).tp_doc = data as _;
+                    }))
+            }
+        }
+        self
+    }
+
+    fn offsets(
+        mut self,
+        dict_offset: Option<ffi::Py_ssize_t>,
+        #[allow(unused_variables)] weaklist_offset: Option<ffi::Py_ssize_t>,
+    ) -> Self {
+        self.dict_offset = dict_offset;
+
+        #[cfg(Py_3_9)]
+        {
+            #[inline(always)]
+            fn offset_def(name: &'static CStr, offset: ffi::Py_ssize_t) -> ffi::PyMemberDef {
+                ffi::PyMemberDef {
+                    name: name.as_ptr().cast(),
+                    type_code: ffi::Py_T_PYSSIZET,
+                    offset,
+                    flags: ffi::Py_READONLY,
+                    doc: std::ptr::null_mut(),
+                }
+            }
+
+            // __dict__ support
+            if let Some(dict_offset) = dict_offset {
+                self.member_defs
+                    .push(offset_def(ffi::c_str!("__dictoffset__"), dict_offset));
+            }
+
+            // weakref support
+            if let Some(weaklist_offset) = weaklist_offset {
+                self.member_defs.push(offset_def(
+                    ffi::c_str!("__weaklistoffset__"),
+                    weaklist_offset,
+                ));
+            }
+        }
+
+        // Setting buffer protocols, tp_dictoffset and tp_weaklistoffset via slots doesn't work until
+        // Python 3.9, so on older versions we must manually fixup the type object.
+        #[cfg(all(not(Py_LIMITED_API), not(Py_3_9)))]
+        {
+            self.cleanup
+                .push(Box::new(move |builder, type_object| unsafe {
+                    (*(*type_object).tp_as_buffer).bf_getbuffer = builder.buffer_procs.bf_getbuffer;
+                    (*(*type_object).tp_as_buffer).bf_releasebuffer =
+                        builder.buffer_procs.bf_releasebuffer;
+
+                    if let Some(dict_offset) = dict_offset {
+                        (*type_object).tp_dictoffset = dict_offset;
+                    }
+
+                    if let Some(weaklist_offset) = weaklist_offset {
+                        (*type_object).tp_weaklistoffset = weaklist_offset;
+                    }
+                }));
+        }
+        self
+    }
+
+    fn build(
+        mut self,
+        py: Python<'_>,
+        name: &'static str,
+        module_name: Option<&'static str>,
+        basicsize: usize,
+    ) -> PyResult<PyClassTypeObject> {
+        // `c_ulong` and `c_uint` have the same size
+        // on some platforms (like windows)
+        #![allow(clippy::useless_conversion)]
+
+        let getset_destructors = self.finalize_methods_and_properties();
+
+        unsafe { self.push_slot(ffi::Py_tp_base, self.tp_base) }
+
+        if !self.has_new {
+            // Safety: This is the correct slot type for Py_tp_new
+            unsafe { self.push_slot(ffi::Py_tp_new, no_constructor_defined as *mut c_void) }
+        }
+
+        let tp_dealloc = if self.has_traverse || unsafe { ffi::PyType_IS_GC(self.tp_base) == 1 } {
+            self.tp_dealloc_with_gc
+        } else {
+            self.tp_dealloc
+        };
+        unsafe { self.push_slot(ffi::Py_tp_dealloc, tp_dealloc as *mut c_void) }
+
+        if self.has_clear && !self.has_traverse {
+            return Err(PyTypeError::new_err(format!(
+                "`#[pyclass]` {} implements __clear__ without __traverse__",
+                name
+            )));
+        }
+
+        // For sequences, implement sq_length instead of mp_length
+        if self.is_sequence {
+            for slot in &mut self.slots {
+                if slot.slot == ffi::Py_mp_length {
+                    slot.slot = ffi::Py_sq_length;
+                }
+            }
+        }
+
+        // Add empty sentinel at the end
+        // Safety: python expects this empty slot
+        unsafe { self.push_slot(0, ptr::null_mut::<c_void>()) }
+
+        let class_name = py_class_qualified_name(module_name, name)?;
+        let mut spec = ffi::PyType_Spec {
+            name: class_name.as_ptr() as _,
+            basicsize: basicsize as c_int,
+            itemsize: 0,
+
+            flags: (ffi::Py_TPFLAGS_DEFAULT | self.class_flags)
+                .try_into()
+                .unwrap(),
+            slots: self.slots.as_mut_ptr(),
+        };
+
+        // Safety: We've correctly setup the PyType_Spec at this point
+        let type_object: Py<PyType> =
+            unsafe { Py::from_owned_ptr_or_err(py, ffi::PyType_FromSpec(&mut spec))? };
+
+        #[cfg(not(Py_3_11))]
+        bpo_45315_workaround(py, class_name);
+
+        for cleanup in std::mem::take(&mut self.cleanup) {
+            cleanup(&self, type_object.bind(py).as_type_ptr());
+        }
+
+        Ok(PyClassTypeObject {
+            type_object,
+            getset_destructors,
+        })
+    }
+}
+
+fn py_class_qualified_name(module_name: Option<&str>, class_name: &str) -> PyResult<CString> {
+    Ok(CString::new(format!(
+        "{}.{}",
+        module_name.unwrap_or("builtins"),
+        class_name
+    ))?)
+}
+
+/// Workaround for Python issue 45315; no longer necessary in Python 3.11
+#[inline]
+#[cfg(not(Py_3_11))]
+fn bpo_45315_workaround(py: Python<'_>, class_name: CString) {
+    #[cfg(Py_LIMITED_API)]
+    {
+        // Must check version at runtime for abi3 wheels - they could run against a higher version
+        // than the build config suggests.
+        use crate::sync::GILOnceCell;
+        static IS_PYTHON_3_11: GILOnceCell<bool> = GILOnceCell::new();
+
+        if *IS_PYTHON_3_11.get_or_init(py, || py.version_info() >= (3, 11)) {
+            // No fix needed - the wheel is running on a sufficiently new interpreter.
+            return;
+        }
+    }
+    #[cfg(not(Py_LIMITED_API))]
+    {
+        // suppress unused variable warning
+        let _ = py;
+    }
+
+    std::mem::forget(class_name);
+}
+
+/// Default new implementation
+unsafe extern "C" fn no_constructor_defined(
+    _subtype: *mut ffi::PyTypeObject,
+    _args: *mut ffi::PyObject,
+    _kwds: *mut ffi::PyObject,
+) -> *mut ffi::PyObject {
+    trampoline(|_| {
+        Err(crate::exceptions::PyTypeError::new_err(
+            "No constructor defined",
+        ))
+    })
+}
+
+#[derive(Default)]
+struct GetSetDefBuilder {
+    doc: Option<&'static CStr>,
+    getter: Option<Getter>,
+    setter: Option<Setter>,
+}
+
+impl GetSetDefBuilder {
+    fn add_getter(&mut self, getter: &PyGetterDef) {
+        // TODO: be smarter about merging getter and setter docs
+        if self.doc.is_none() {
+            self.doc = Some(getter.doc);
+        }
+        // TODO: return an error if getter already defined?
+        self.getter = Some(getter.meth)
+    }
+
+    fn add_setter(&mut self, setter: &PySetterDef) {
+        // TODO: be smarter about merging getter and setter docs
+        if self.doc.is_none() {
+            self.doc = Some(setter.doc);
+        }
+        // TODO: return an error if setter already defined?
+        self.setter = Some(setter.meth)
+    }
+
+    fn as_get_set_def(&self, name: &'static CStr) -> (ffi::PyGetSetDef, GetSetDefDestructor) {
+        let getset_type = match (self.getter, self.setter) {
+            (Some(getter), None) => GetSetDefType::Getter(getter),
+            (None, Some(setter)) => GetSetDefType::Setter(setter),
+            (Some(getter), Some(setter)) => {
+                GetSetDefType::GetterAndSetter(Box::new(GetterAndSetter { getter, setter }))
+            }
+            (None, None) => {
+                unreachable!("GetSetDefBuilder expected to always have either getter or setter")
+            }
+        };
+
+        let getset_def = getset_type.create_py_get_set_def(name, self.doc);
+        let destructor = GetSetDefDestructor {
+            closure: getset_type,
+        };
+        (getset_def, destructor)
+    }
+}
+
+#[allow(dead_code)] // a stack of fields which are purely to cache until dropped
+struct GetSetDefDestructor {
+    closure: GetSetDefType,
+}
+
+/// Possible forms of property - either a getter, setter, or both
+enum GetSetDefType {
+    Getter(Getter),
+    Setter(Setter),
+    // The box is here so that the `GetterAndSetter` has a stable
+    // memory address even if the `GetSetDefType` enum is moved
+    GetterAndSetter(Box<GetterAndSetter>),
+}
+
+pub(crate) struct GetterAndSetter {
+    getter: Getter,
+    setter: Setter,
+}
+
+impl GetSetDefType {
+    /// Fills a PyGetSetDef structure
+    /// It is only valid for as long as this GetSetDefType remains alive,
+    /// as well as name and doc members
+    pub(crate) fn create_py_get_set_def(
+        &self,
+        name: &CStr,
+        doc: Option<&CStr>,
+    ) -> ffi::PyGetSetDef {
+        let (get, set, closure): (Option<ffi::getter>, Option<ffi::setter>, *mut c_void) =
+            match self {
+                &Self::Getter(closure) => {
+                    unsafe extern "C" fn getter(
+                        slf: *mut ffi::PyObject,
+                        closure: *mut c_void,
+                    ) -> *mut ffi::PyObject {
+                        // Safety: PyO3 sets the closure when constructing the ffi getter so this cast should always be valid
+                        let getter: Getter = std::mem::transmute(closure);
+                        trampoline(|py| getter(py, slf))
+                    }
+                    (Some(getter), None, closure as Getter as _)
+                }
+                &Self::Setter(closure) => {
+                    unsafe extern "C" fn setter(
+                        slf: *mut ffi::PyObject,
+                        value: *mut ffi::PyObject,
+                        closure: *mut c_void,
+                    ) -> c_int {
+                        // Safety: PyO3 sets the closure when constructing the ffi setter so this cast should always be valid
+                        let setter: Setter = std::mem::transmute(closure);
+                        trampoline(|py| setter(py, slf, value))
+                    }
+                    (None, Some(setter), closure as Setter as _)
+                }
+                Self::GetterAndSetter(closure) => {
+                    unsafe extern "C" fn getset_getter(
+                        slf: *mut ffi::PyObject,
+                        closure: *mut c_void,
+                    ) -> *mut ffi::PyObject {
+                        let getset: &GetterAndSetter = &*closure.cast();
+                        trampoline(|py| (getset.getter)(py, slf))
+                    }
+
+                    unsafe extern "C" fn getset_setter(
+                        slf: *mut ffi::PyObject,
+                        value: *mut ffi::PyObject,
+                        closure: *mut c_void,
+                    ) -> c_int {
+                        let getset: &GetterAndSetter = &*closure.cast();
+                        trampoline(|py| (getset.setter)(py, slf, value))
+                    }
+                    (
+                        Some(getset_getter),
+                        Some(getset_setter),
+                        ptr_from_ref::<GetterAndSetter>(closure) as *mut _,
+                    )
+                }
+            };
+        ffi::PyGetSetDef {
+            name: name.as_ptr(),
+            doc: doc.map_or(ptr::null(), CStr::as_ptr),
+            get,
+            set,
+            closure,
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/pyclass/gc.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/pyclass/gc.rs
--- 43.0.0-1/rust-vendor/pyo3/src/pyclass/gc.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/pyclass/gc.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,48 @@
+use std::os::raw::{c_int, c_void};
+
+use crate::{ffi, AsPyPointer, Python};
+
+/// Error returned by a `__traverse__` visitor implementation.
+#[repr(transparent)]
+pub struct PyTraverseError(pub(crate) c_int);
+
+/// Object visitor for GC.
+#[derive(Clone)]
+pub struct PyVisit<'p> {
+    pub(crate) visit: ffi::visitproc,
+    pub(crate) arg: *mut c_void,
+    /// VisitProc contains a Python instance to ensure that
+    /// 1) it is cannot be moved out of the traverse() call
+    /// 2) it cannot be sent to other threads
+    pub(crate) _py: Python<'p>,
+}
+
+impl<'p> PyVisit<'p> {
+    /// Visit `obj`.
+    pub fn call<T>(&self, obj: &T) -> Result<(), PyTraverseError>
+    where
+        T: AsPyPointer,
+    {
+        let ptr = obj.as_ptr();
+        if !ptr.is_null() {
+            let r = unsafe { (self.visit)(ptr, self.arg) };
+            if r == 0 {
+                Ok(())
+            } else {
+                Err(PyTraverseError(r))
+            }
+        } else {
+            Ok(())
+        }
+    }
+
+    /// Creates the PyVisit from the arguments to tp_traverse
+    #[doc(hidden)]
+    pub unsafe fn from_raw(visit: ffi::visitproc, arg: *mut c_void, py: Python<'p>) -> Self {
+        Self {
+            visit,
+            arg,
+            _py: py,
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/pyclass.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/pyclass.rs
--- 43.0.0-1/rust-vendor/pyo3/src/pyclass.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/pyclass.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,252 @@
+//! `PyClass` and related traits.
+use crate::{
+    callback::IntoPyCallbackOutput, ffi, impl_::pyclass::PyClassImpl, IntoPy, PyObject, PyResult,
+    PyTypeInfo, Python,
+};
+use std::{cmp::Ordering, os::raw::c_int};
+
+mod create_type_object;
+mod gc;
+
+pub(crate) use self::create_type_object::{create_type_object, PyClassTypeObject};
+pub use self::gc::{PyTraverseError, PyVisit};
+
+/// Types that can be used as Python classes.
+///
+/// The `#[pyclass]` attribute implements this trait for your Rust struct -
+/// you shouldn't implement this trait directly.
+#[allow(deprecated)]
+#[cfg(feature = "gil-refs")]
+pub trait PyClass: PyTypeInfo<AsRefTarget = crate::PyCell<Self>> + PyClassImpl {
+    /// Whether the pyclass is frozen.
+    ///
+    /// This can be enabled via `#[pyclass(frozen)]`.
+    type Frozen: Frozen;
+}
+
+/// Types that can be used as Python classes.
+///
+/// The `#[pyclass]` attribute implements this trait for your Rust struct -
+/// you shouldn't implement this trait directly.
+#[cfg(not(feature = "gil-refs"))]
+pub trait PyClass: PyTypeInfo + PyClassImpl {
+    /// Whether the pyclass is frozen.
+    ///
+    /// This can be enabled via `#[pyclass(frozen)]`.
+    type Frozen: Frozen;
+}
+
+/// Operators for the `__richcmp__` method
+#[derive(Debug, Clone, Copy)]
+pub enum CompareOp {
+    /// The *less than* operator.
+    Lt = ffi::Py_LT as isize,
+    /// The *less than or equal to* operator.
+    Le = ffi::Py_LE as isize,
+    /// The equality operator.
+    Eq = ffi::Py_EQ as isize,
+    /// The *not equal to* operator.
+    Ne = ffi::Py_NE as isize,
+    /// The *greater than* operator.
+    Gt = ffi::Py_GT as isize,
+    /// The *greater than or equal to* operator.
+    Ge = ffi::Py_GE as isize,
+}
+
+impl CompareOp {
+    /// Conversion from the C enum.
+    pub fn from_raw(op: c_int) -> Option<Self> {
+        match op {
+            ffi::Py_LT => Some(CompareOp::Lt),
+            ffi::Py_LE => Some(CompareOp::Le),
+            ffi::Py_EQ => Some(CompareOp::Eq),
+            ffi::Py_NE => Some(CompareOp::Ne),
+            ffi::Py_GT => Some(CompareOp::Gt),
+            ffi::Py_GE => Some(CompareOp::Ge),
+            _ => None,
+        }
+    }
+
+    /// Returns if a Rust [`std::cmp::Ordering`] matches this ordering query.
+    ///
+    /// Usage example:
+    ///
+    /// ```rust
+    /// # use pyo3::prelude::*;
+    /// # use pyo3::class::basic::CompareOp;
+    ///
+    /// #[pyclass]
+    /// struct Size {
+    ///     size: usize,
+    /// }
+    ///
+    /// #[pymethods]
+    /// impl Size {
+    ///     fn __richcmp__(&self, other: &Size, op: CompareOp) -> bool {
+    ///         op.matches(self.size.cmp(&other.size))
+    ///     }
+    /// }
+    /// ```
+    pub fn matches(&self, result: Ordering) -> bool {
+        match self {
+            CompareOp::Eq => result == Ordering::Equal,
+            CompareOp::Ne => result != Ordering::Equal,
+            CompareOp::Lt => result == Ordering::Less,
+            CompareOp::Le => result != Ordering::Greater,
+            CompareOp::Gt => result == Ordering::Greater,
+            CompareOp::Ge => result != Ordering::Less,
+        }
+    }
+}
+
+/// Output of `__next__` which can either `yield` the next value in the iteration, or
+/// `return` a value to raise `StopIteration` in Python.
+///
+/// Usage example:
+///
+/// ```rust
+/// # #![allow(deprecated)]
+/// use pyo3::prelude::*;
+/// use pyo3::iter::IterNextOutput;
+///
+/// #[pyclass]
+/// struct PyClassIter {
+///     count: usize,
+/// }
+///
+/// #[pymethods]
+/// impl PyClassIter {
+///     #[new]
+///     pub fn new() -> Self {
+///         PyClassIter { count: 0 }
+///     }
+///
+///     fn __next__(&mut self) -> IterNextOutput<usize, &'static str> {
+///         if self.count < 5 {
+///             self.count += 1;
+///             // Given an instance `counter`, First five `next(counter)` calls yield 1, 2, 3, 4, 5.
+///             IterNextOutput::Yield(self.count)
+///         } else {
+///             // At the sixth time, we get a `StopIteration` with `'Ended'`.
+///             //     try:
+///             //         next(counter)
+///             //     except StopIteration as e:
+///             //         assert e.value == 'Ended'
+///             IterNextOutput::Return("Ended")
+///         }
+///     }
+/// }
+/// ```
+#[deprecated(since = "0.21.0", note = "Use `Option` or `PyStopIteration` instead.")]
+pub enum IterNextOutput<T, U> {
+    /// The value yielded by the iterator.
+    Yield(T),
+    /// The `StopIteration` object.
+    Return(U),
+}
+
+/// Alias of `IterNextOutput` with `PyObject` yield & return values.
+#[deprecated(since = "0.21.0", note = "Use `Option` or `PyStopIteration` instead.")]
+#[allow(deprecated)]
+pub type PyIterNextOutput = IterNextOutput<PyObject, PyObject>;
+
+#[allow(deprecated)]
+impl<T, U> IntoPyCallbackOutput<*mut ffi::PyObject> for IterNextOutput<T, U>
+where
+    T: IntoPy<PyObject>,
+    U: IntoPy<PyObject>,
+{
+    fn convert(self, py: Python<'_>) -> PyResult<*mut ffi::PyObject> {
+        match self {
+            IterNextOutput::Yield(o) => Ok(o.into_py(py).into_ptr()),
+            IterNextOutput::Return(o) => {
+                Err(crate::exceptions::PyStopIteration::new_err(o.into_py(py)))
+            }
+        }
+    }
+}
+
+/// Output of `__anext__`.
+///
+/// <https://docs.python.org/3/reference/expressions.html#agen.__anext__>
+#[deprecated(
+    since = "0.21.0",
+    note = "Use `Option` or `PyStopAsyncIteration` instead."
+)]
+pub enum IterANextOutput<T, U> {
+    /// An expression which the generator yielded.
+    Yield(T),
+    /// A `StopAsyncIteration` object.
+    Return(U),
+}
+
+/// An [IterANextOutput] of Python objects.
+#[deprecated(
+    since = "0.21.0",
+    note = "Use `Option` or `PyStopAsyncIteration` instead."
+)]
+#[allow(deprecated)]
+pub type PyIterANextOutput = IterANextOutput<PyObject, PyObject>;
+
+#[allow(deprecated)]
+impl<T, U> IntoPyCallbackOutput<*mut ffi::PyObject> for IterANextOutput<T, U>
+where
+    T: IntoPy<PyObject>,
+    U: IntoPy<PyObject>,
+{
+    fn convert(self, py: Python<'_>) -> PyResult<*mut ffi::PyObject> {
+        match self {
+            IterANextOutput::Yield(o) => Ok(o.into_py(py).into_ptr()),
+            IterANextOutput::Return(o) => Err(crate::exceptions::PyStopAsyncIteration::new_err(
+                o.into_py(py),
+            )),
+        }
+    }
+}
+
+/// A workaround for [associated const equality](https://github.com/rust-lang/rust/issues/92827).
+///
+/// This serves to have True / False values in the [`PyClass`] trait's `Frozen` type.
+#[doc(hidden)]
+pub mod boolean_struct {
+    pub(crate) mod private {
+        use super::*;
+
+        /// A way to "seal" the boolean traits.
+        pub trait Boolean {
+            const VALUE: bool;
+        }
+
+        impl Boolean for True {
+            const VALUE: bool = true;
+        }
+        impl Boolean for False {
+            const VALUE: bool = false;
+        }
+    }
+
+    pub struct True(());
+    pub struct False(());
+}
+
+/// A trait which is used to describe whether a `#[pyclass]` is frozen.
+#[doc(hidden)]
+pub trait Frozen: boolean_struct::private::Boolean {}
+
+impl Frozen for boolean_struct::True {}
+impl Frozen for boolean_struct::False {}
+
+mod tests {
+    #[test]
+    fn test_compare_op_matches() {
+        use super::CompareOp;
+        use std::cmp::Ordering;
+
+        assert!(CompareOp::Eq.matches(Ordering::Equal));
+        assert!(CompareOp::Ne.matches(Ordering::Less));
+        assert!(CompareOp::Ge.matches(Ordering::Greater));
+        assert!(CompareOp::Gt.matches(Ordering::Greater));
+        assert!(CompareOp::Le.matches(Ordering::Equal));
+        assert!(CompareOp::Lt.matches(Ordering::Less));
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/pyclass_init.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/pyclass_init.rs
--- 43.0.0-1/rust-vendor/pyo3/src/pyclass_init.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/pyclass_init.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,322 @@
+//! Contains initialization utilities for `#[pyclass]`.
+use crate::callback::IntoPyCallbackOutput;
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::impl_::pyclass::{PyClassBaseType, PyClassDict, PyClassThreadChecker, PyClassWeakRef};
+use crate::types::PyAnyMethods;
+use crate::{ffi, Bound, Py, PyClass, PyErr, PyResult, Python};
+use crate::{
+    ffi::PyTypeObject,
+    pycell::impl_::{PyClassBorrowChecker, PyClassMutability, PyClassObjectContents},
+    type_object::{get_tp_alloc, PyTypeInfo},
+};
+use std::{
+    cell::UnsafeCell,
+    marker::PhantomData,
+    mem::{ManuallyDrop, MaybeUninit},
+};
+
+/// Initializer for Python types.
+///
+/// This trait is intended to use internally for distinguishing `#[pyclass]` and
+/// Python native types.
+pub trait PyObjectInit<T>: Sized {
+    /// # Safety
+    /// - `subtype` must be a valid pointer to a type object of T or a subclass.
+    unsafe fn into_new_object(
+        self,
+        py: Python<'_>,
+        subtype: *mut PyTypeObject,
+    ) -> PyResult<*mut ffi::PyObject>;
+    private_decl! {}
+}
+
+/// Initializer for Python native types, like `PyDict`.
+pub struct PyNativeTypeInitializer<T: PyTypeInfo>(PhantomData<T>);
+
+impl<T: PyTypeInfo> PyObjectInit<T> for PyNativeTypeInitializer<T> {
+    unsafe fn into_new_object(
+        self,
+        py: Python<'_>,
+        subtype: *mut PyTypeObject,
+    ) -> PyResult<*mut ffi::PyObject> {
+        unsafe fn inner(
+            py: Python<'_>,
+            type_object: *mut PyTypeObject,
+            subtype: *mut PyTypeObject,
+        ) -> PyResult<*mut ffi::PyObject> {
+            // HACK (due to FIXME below): PyBaseObject_Type's tp_new isn't happy with NULL arguments
+            let is_base_object = type_object == std::ptr::addr_of_mut!(ffi::PyBaseObject_Type);
+            if is_base_object {
+                let alloc = get_tp_alloc(subtype).unwrap_or(ffi::PyType_GenericAlloc);
+                let obj = alloc(subtype, 0);
+                return if obj.is_null() {
+                    Err(PyErr::fetch(py))
+                } else {
+                    Ok(obj)
+                };
+            }
+
+            #[cfg(Py_LIMITED_API)]
+            unreachable!("subclassing native types is not possible with the `abi3` feature");
+
+            #[cfg(not(Py_LIMITED_API))]
+            {
+                match (*type_object).tp_new {
+                    // FIXME: Call __new__ with actual arguments
+                    Some(newfunc) => {
+                        let obj = newfunc(subtype, std::ptr::null_mut(), std::ptr::null_mut());
+                        if obj.is_null() {
+                            Err(PyErr::fetch(py))
+                        } else {
+                            Ok(obj)
+                        }
+                    }
+                    None => Err(crate::exceptions::PyTypeError::new_err(
+                        "base type without tp_new",
+                    )),
+                }
+            }
+        }
+        let type_object = T::type_object_raw(py);
+        inner(py, type_object, subtype)
+    }
+
+    private_impl! {}
+}
+
+/// Initializer for our `#[pyclass]` system.
+///
+/// You can use this type to initialize complicatedly nested `#[pyclass]`.
+///
+/// # Examples
+///
+/// ```
+/// # use pyo3::prelude::*;
+/// # use pyo3::py_run;
+/// #[pyclass(subclass)]
+/// struct BaseClass {
+///     #[pyo3(get)]
+///     basename: &'static str,
+/// }
+/// #[pyclass(extends=BaseClass, subclass)]
+/// struct SubClass {
+///     #[pyo3(get)]
+///     subname: &'static str,
+/// }
+/// #[pyclass(extends=SubClass)]
+/// struct SubSubClass {
+///     #[pyo3(get)]
+///     subsubname: &'static str,
+/// }
+///
+/// #[pymethods]
+/// impl SubSubClass {
+///     #[new]
+///     fn new() -> PyClassInitializer<Self> {
+///         PyClassInitializer::from(BaseClass { basename: "base" })
+///             .add_subclass(SubClass { subname: "sub" })
+///             .add_subclass(SubSubClass {
+///                 subsubname: "subsub",
+///             })
+///     }
+/// }
+/// Python::with_gil(|py| {
+///     let typeobj = py.get_type_bound::<SubSubClass>();
+///     let sub_sub_class = typeobj.call((), None).unwrap();
+///     py_run!(
+///         py,
+///         sub_sub_class,
+///         r#"
+///  assert sub_sub_class.basename == 'base'
+///  assert sub_sub_class.subname == 'sub'
+///  assert sub_sub_class.subsubname == 'subsub'"#
+///     );
+/// });
+/// ```
+pub struct PyClassInitializer<T: PyClass>(PyClassInitializerImpl<T>);
+
+enum PyClassInitializerImpl<T: PyClass> {
+    Existing(Py<T>),
+    New {
+        init: T,
+        super_init: <T::BaseType as PyClassBaseType>::Initializer,
+    },
+}
+
+impl<T: PyClass> PyClassInitializer<T> {
+    /// Constructs a new initializer from value `T` and base class' initializer.
+    ///
+    /// It is recommended to use `add_subclass` instead of this method for most usage.
+    pub fn new(init: T, super_init: <T::BaseType as PyClassBaseType>::Initializer) -> Self {
+        Self(PyClassInitializerImpl::New { init, super_init })
+    }
+
+    /// Constructs a new initializer from an initializer for the base class.
+    ///
+    /// # Examples
+    /// ```
+    /// use pyo3::prelude::*;
+    ///
+    /// #[pyclass(subclass)]
+    /// struct BaseClass {
+    ///     #[pyo3(get)]
+    ///     value: i32,
+    /// }
+    ///
+    /// impl BaseClass {
+    ///     fn new(value: i32) -> PyResult<Self> {
+    ///         Ok(Self { value })
+    ///     }
+    /// }
+    ///
+    /// #[pyclass(extends=BaseClass)]
+    /// struct SubClass {}
+    ///
+    /// #[pymethods]
+    /// impl SubClass {
+    ///     #[new]
+    ///     fn new(value: i32) -> PyResult<PyClassInitializer<Self>> {
+    ///         let base_init = PyClassInitializer::from(BaseClass::new(value)?);
+    ///         Ok(base_init.add_subclass(SubClass {}))
+    ///     }
+    /// }
+    ///
+    /// fn main() -> PyResult<()> {
+    ///     Python::with_gil(|py| {
+    ///         let m = PyModule::new_bound(py, "example")?;
+    ///         m.add_class::<SubClass>()?;
+    ///         m.add_class::<BaseClass>()?;
+    ///
+    ///         let instance = m.getattr("SubClass")?.call1((92,))?;
+    ///
+    ///         // `SubClass` does not have a `value` attribute, but `BaseClass` does.
+    ///         let n = instance.getattr("value")?.extract::<i32>()?;
+    ///         assert_eq!(n, 92);
+    ///
+    ///         Ok(())
+    ///     })
+    /// }
+    /// ```
+    pub fn add_subclass<S>(self, subclass_value: S) -> PyClassInitializer<S>
+    where
+        S: PyClass<BaseType = T>,
+        S::BaseType: PyClassBaseType<Initializer = Self>,
+    {
+        PyClassInitializer::new(subclass_value, self)
+    }
+
+    /// Creates a new PyCell and initializes it.
+    pub(crate) fn create_class_object(self, py: Python<'_>) -> PyResult<Bound<'_, T>>
+    where
+        T: PyClass,
+    {
+        unsafe { self.create_class_object_of_type(py, T::type_object_raw(py)) }
+    }
+
+    /// Creates a new class object and initializes it given a typeobject `subtype`.
+    ///
+    /// # Safety
+    /// `subtype` must be a valid pointer to the type object of T or a subclass.
+    pub(crate) unsafe fn create_class_object_of_type(
+        self,
+        py: Python<'_>,
+        target_type: *mut crate::ffi::PyTypeObject,
+    ) -> PyResult<Bound<'_, T>>
+    where
+        T: PyClass,
+    {
+        /// Layout of a PyClassObject after base new has been called, but the contents have not yet been
+        /// written.
+        #[repr(C)]
+        struct PartiallyInitializedClassObject<T: PyClass> {
+            _ob_base: <T::BaseType as PyClassBaseType>::LayoutAsBase,
+            contents: MaybeUninit<PyClassObjectContents<T>>,
+        }
+
+        let (init, super_init) = match self.0 {
+            PyClassInitializerImpl::Existing(value) => return Ok(value.into_bound(py)),
+            PyClassInitializerImpl::New { init, super_init } => (init, super_init),
+        };
+
+        let obj = super_init.into_new_object(py, target_type)?;
+
+        let part_init: *mut PartiallyInitializedClassObject<T> = obj.cast();
+        std::ptr::write(
+            (*part_init).contents.as_mut_ptr(),
+            PyClassObjectContents {
+                value: ManuallyDrop::new(UnsafeCell::new(init)),
+                borrow_checker: <T::PyClassMutability as PyClassMutability>::Storage::new(),
+                thread_checker: T::ThreadChecker::new(),
+                dict: T::Dict::INIT,
+                weakref: T::WeakRef::INIT,
+            },
+        );
+
+        // Safety: obj is a valid pointer to an object of type `target_type`, which` is a known
+        // subclass of `T`
+        Ok(obj.assume_owned(py).downcast_into_unchecked())
+    }
+}
+
+impl<T: PyClass> PyObjectInit<T> for PyClassInitializer<T> {
+    unsafe fn into_new_object(
+        self,
+        py: Python<'_>,
+        subtype: *mut PyTypeObject,
+    ) -> PyResult<*mut ffi::PyObject> {
+        self.create_class_object_of_type(py, subtype)
+            .map(Bound::into_ptr)
+    }
+
+    private_impl! {}
+}
+
+impl<T> From<T> for PyClassInitializer<T>
+where
+    T: PyClass,
+    T::BaseType: PyClassBaseType<Initializer = PyNativeTypeInitializer<T::BaseType>>,
+{
+    #[inline]
+    fn from(value: T) -> PyClassInitializer<T> {
+        Self::new(value, PyNativeTypeInitializer(PhantomData))
+    }
+}
+
+impl<S, B> From<(S, B)> for PyClassInitializer<S>
+where
+    S: PyClass<BaseType = B>,
+    B: PyClass,
+    B::BaseType: PyClassBaseType<Initializer = PyNativeTypeInitializer<B::BaseType>>,
+{
+    fn from(sub_and_base: (S, B)) -> PyClassInitializer<S> {
+        let (sub, base) = sub_and_base;
+        PyClassInitializer::from(base).add_subclass(sub)
+    }
+}
+
+impl<T: PyClass> From<Py<T>> for PyClassInitializer<T> {
+    #[inline]
+    fn from(value: Py<T>) -> PyClassInitializer<T> {
+        PyClassInitializer(PyClassInitializerImpl::Existing(value))
+    }
+}
+
+impl<'py, T: PyClass> From<Bound<'py, T>> for PyClassInitializer<T> {
+    #[inline]
+    fn from(value: Bound<'py, T>) -> PyClassInitializer<T> {
+        PyClassInitializer::from(value.unbind())
+    }
+}
+
+// Implementation used by proc macros to allow anything convertible to PyClassInitializer<T> to be
+// the return value of pyclass #[new] method (optionally wrapped in `Result<U, E>`).
+impl<T, U> IntoPyCallbackOutput<PyClassInitializer<T>> for U
+where
+    T: PyClass,
+    U: Into<PyClassInitializer<T>>,
+{
+    #[inline]
+    fn convert(self, _py: Python<'_>) -> PyResult<PyClassInitializer<T>> {
+        Ok(self.into())
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/sealed.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/sealed.rs
--- 43.0.0-1/rust-vendor/pyo3/src/sealed.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/sealed.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,34 @@
+use crate::types::{
+    PyBool, PyByteArray, PyBytes, PyCapsule, PyComplex, PyDict, PyFloat, PyFrozenSet, PyList,
+    PyMapping, PyModule, PySequence, PySet, PySlice, PyString, PyTraceback, PyTuple, PyType,
+};
+use crate::{ffi, Bound, PyAny, PyResult};
+
+pub trait Sealed {}
+
+// for FfiPtrExt
+impl Sealed for *mut ffi::PyObject {}
+
+// for PyResultExt
+impl Sealed for PyResult<Bound<'_, PyAny>> {}
+
+// for Py(...)Methods
+impl Sealed for Bound<'_, PyAny> {}
+impl Sealed for Bound<'_, PyBool> {}
+impl Sealed for Bound<'_, PyByteArray> {}
+impl Sealed for Bound<'_, PyBytes> {}
+impl Sealed for Bound<'_, PyCapsule> {}
+impl Sealed for Bound<'_, PyComplex> {}
+impl Sealed for Bound<'_, PyDict> {}
+impl Sealed for Bound<'_, PyFloat> {}
+impl Sealed for Bound<'_, PyFrozenSet> {}
+impl Sealed for Bound<'_, PyList> {}
+impl Sealed for Bound<'_, PyMapping> {}
+impl Sealed for Bound<'_, PyModule> {}
+impl Sealed for Bound<'_, PySequence> {}
+impl Sealed for Bound<'_, PySet> {}
+impl Sealed for Bound<'_, PySlice> {}
+impl Sealed for Bound<'_, PyString> {}
+impl Sealed for Bound<'_, PyTraceback> {}
+impl Sealed for Bound<'_, PyTuple> {}
+impl Sealed for Bound<'_, PyType> {}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/sync.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/sync.rs
--- 43.0.0-1/rust-vendor/pyo3/src/sync.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/sync.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,332 @@
+//! Synchronization mechanisms based on the Python GIL.
+//!
+//! With the acceptance of [PEP 703] (aka a "freethreaded Python") for Python 3.13, these
+//! are likely to undergo significant developments in the future.
+//!
+//! [PEP 703]: https://peps.python.org/pep-703/
+use crate::{
+    types::{any::PyAnyMethods, PyString, PyType},
+    Bound, Py, PyResult, PyVisit, Python,
+};
+use std::cell::UnsafeCell;
+
+/// Value with concurrent access protected by the GIL.
+///
+/// This is a synchronization primitive based on Python's global interpreter lock (GIL).
+/// It ensures that only one thread at a time can access the inner value via shared references.
+/// It can be combined with interior mutability to obtain mutable references.
+///
+/// # Example
+///
+/// Combining `GILProtected` with `RefCell` enables mutable access to static data:
+///
+/// ```
+/// # use pyo3::prelude::*;
+/// use pyo3::sync::GILProtected;
+/// use std::cell::RefCell;
+///
+/// static NUMBERS: GILProtected<RefCell<Vec<i32>>> = GILProtected::new(RefCell::new(Vec::new()));
+///
+/// Python::with_gil(|py| {
+///     NUMBERS.get(py).borrow_mut().push(42);
+/// });
+/// ```
+pub struct GILProtected<T> {
+    value: T,
+}
+
+impl<T> GILProtected<T> {
+    /// Place the given value under the protection of the GIL.
+    pub const fn new(value: T) -> Self {
+        Self { value }
+    }
+
+    /// Gain access to the inner value by giving proof of having acquired the GIL.
+    pub fn get<'py>(&'py self, _py: Python<'py>) -> &'py T {
+        &self.value
+    }
+
+    /// Gain access to the inner value by giving proof that garbage collection is happening.
+    pub fn traverse<'py>(&'py self, _visit: PyVisit<'py>) -> &'py T {
+        &self.value
+    }
+}
+
+unsafe impl<T> Sync for GILProtected<T> where T: Send {}
+
+/// A write-once cell similar to [`once_cell::OnceCell`](https://docs.rs/once_cell/latest/once_cell/).
+///
+/// Unlike `once_cell::sync` which blocks threads to achieve thread safety, this implementation
+/// uses the Python GIL to mediate concurrent access. This helps in cases where `once_cell` or
+/// `lazy_static`'s synchronization strategy can lead to deadlocks when interacting with the Python
+/// GIL. For an example, see
+#[doc = concat!("[the FAQ section](https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/faq.html)")]
+/// of the guide.
+///
+/// Note that:
+///  1) `get_or_init` and `get_or_try_init` do not protect against infinite recursion
+///     from reentrant initialization.
+///  2) If the initialization function `f` provided to `get_or_init` (or `get_or_try_init`)
+///     temporarily releases the GIL (e.g. by calling `Python::import`) then it is possible
+///     for a second thread to also begin initializing the `GITOnceCell`. Even when this
+///     happens `GILOnceCell` guarantees that only **one** write to the cell ever occurs -
+///     this is treated as a race, other threads will discard the value they compute and
+///     return the result of the first complete computation.
+///
+/// # Examples
+///
+/// The following example shows how to use `GILOnceCell` to share a reference to a Python list
+/// between threads:
+///
+/// ```
+/// use pyo3::sync::GILOnceCell;
+/// use pyo3::prelude::*;
+/// use pyo3::types::PyList;
+///
+/// static LIST_CELL: GILOnceCell<Py<PyList>> = GILOnceCell::new();
+///
+/// pub fn get_shared_list(py: Python<'_>) -> &Bound<'_, PyList> {
+///     LIST_CELL
+///         .get_or_init(py, || PyList::empty_bound(py).unbind())
+///         .bind(py)
+/// }
+/// # Python::with_gil(|py| assert_eq!(get_shared_list(py).len(), 0));
+/// ```
+#[derive(Default)]
+pub struct GILOnceCell<T>(UnsafeCell<Option<T>>);
+
+// T: Send is needed for Sync because the thread which drops the GILOnceCell can be different
+// to the thread which fills it.
+unsafe impl<T: Send + Sync> Sync for GILOnceCell<T> {}
+unsafe impl<T: Send> Send for GILOnceCell<T> {}
+
+impl<T> GILOnceCell<T> {
+    /// Create a `GILOnceCell` which does not yet contain a value.
+    pub const fn new() -> Self {
+        Self(UnsafeCell::new(None))
+    }
+
+    /// Get a reference to the contained value, or `None` if the cell has not yet been written.
+    #[inline]
+    pub fn get(&self, _py: Python<'_>) -> Option<&T> {
+        // Safe because if the cell has not yet been written, None is returned.
+        unsafe { &*self.0.get() }.as_ref()
+    }
+
+    /// Get a reference to the contained value, initializing it if needed using the provided
+    /// closure.
+    ///
+    /// See the type-level documentation for detail on re-entrancy and concurrent initialization.
+    #[inline]
+    pub fn get_or_init<F>(&self, py: Python<'_>, f: F) -> &T
+    where
+        F: FnOnce() -> T,
+    {
+        if let Some(value) = self.get(py) {
+            return value;
+        }
+
+        match self.init(py, || Ok::<T, std::convert::Infallible>(f())) {
+            Ok(value) => value,
+            Err(void) => match void {},
+        }
+    }
+
+    /// Like `get_or_init`, but accepts a fallible initialization function. If it fails, the cell
+    /// is left uninitialized.
+    ///
+    /// See the type-level documentation for detail on re-entrancy and concurrent initialization.
+    #[inline]
+    pub fn get_or_try_init<F, E>(&self, py: Python<'_>, f: F) -> Result<&T, E>
+    where
+        F: FnOnce() -> Result<T, E>,
+    {
+        if let Some(value) = self.get(py) {
+            return Ok(value);
+        }
+
+        self.init(py, f)
+    }
+
+    #[cold]
+    fn init<F, E>(&self, py: Python<'_>, f: F) -> Result<&T, E>
+    where
+        F: FnOnce() -> Result<T, E>,
+    {
+        // Note that f() could temporarily release the GIL, so it's possible that another thread
+        // writes to this GILOnceCell before f() finishes. That's fine; we'll just have to discard
+        // the value computed here and accept a bit of wasted computation.
+        let value = f()?;
+        let _ = self.set(py, value);
+
+        Ok(self.get(py).unwrap())
+    }
+
+    /// Get the contents of the cell mutably. This is only possible if the reference to the cell is
+    /// unique.
+    pub fn get_mut(&mut self) -> Option<&mut T> {
+        self.0.get_mut().as_mut()
+    }
+
+    /// Set the value in the cell.
+    ///
+    /// If the cell has already been written, `Err(value)` will be returned containing the new
+    /// value which was not written.
+    pub fn set(&self, _py: Python<'_>, value: T) -> Result<(), T> {
+        // Safe because GIL is held, so no other thread can be writing to this cell concurrently.
+        let inner = unsafe { &mut *self.0.get() };
+        if inner.is_some() {
+            return Err(value);
+        }
+
+        *inner = Some(value);
+        Ok(())
+    }
+
+    /// Takes the value out of the cell, moving it back to an uninitialized state.
+    ///
+    /// Has no effect and returns None if the cell has not yet been written.
+    pub fn take(&mut self) -> Option<T> {
+        self.0.get_mut().take()
+    }
+
+    /// Consumes the cell, returning the wrapped value.
+    ///
+    /// Returns None if the cell has not yet been written.
+    pub fn into_inner(self) -> Option<T> {
+        self.0.into_inner()
+    }
+}
+
+impl GILOnceCell<Py<PyType>> {
+    /// Get a reference to the contained Python type, initializing it if needed.
+    ///
+    /// This is a shorthand method for `get_or_init` which imports the type from Python on init.
+    pub(crate) fn get_or_try_init_type_ref<'py>(
+        &self,
+        py: Python<'py>,
+        module_name: &str,
+        attr_name: &str,
+    ) -> PyResult<&Bound<'py, PyType>> {
+        self.get_or_try_init(py, || {
+            let type_object = py
+                .import_bound(module_name)?
+                .getattr(attr_name)?
+                .downcast_into()?;
+            Ok(type_object.unbind())
+        })
+        .map(|ty| ty.bind(py))
+    }
+}
+
+/// Interns `text` as a Python string and stores a reference to it in static storage.
+///
+/// A reference to the same Python string is returned on each invocation.
+///
+/// # Example: Using `intern!` to avoid needlessly recreating the same Python string
+///
+/// ```
+/// use pyo3::intern;
+/// # use pyo3::{prelude::*, types::PyDict};
+///
+/// #[pyfunction]
+/// fn create_dict(py: Python<'_>) -> PyResult<Bound<'_, PyDict>> {
+///     let dict = PyDict::new_bound(py);
+///     //             👇 A new `PyString` is created
+///     //                for every call of this function.
+///     dict.set_item("foo", 42)?;
+///     Ok(dict)
+/// }
+///
+/// #[pyfunction]
+/// fn create_dict_faster(py: Python<'_>) -> PyResult<Bound<'_, PyDict>> {
+///     let dict = PyDict::new_bound(py);
+///     //               👇 A `PyString` is created once and reused
+///     //                  for the lifetime of the program.
+///     dict.set_item(intern!(py, "foo"), 42)?;
+///     Ok(dict)
+/// }
+/// #
+/// # Python::with_gil(|py| {
+/// #     let fun_slow = wrap_pyfunction_bound!(create_dict, py).unwrap();
+/// #     let dict = fun_slow.call0().unwrap();
+/// #     assert!(dict.contains("foo").unwrap());
+/// #     let fun = wrap_pyfunction_bound!(create_dict_faster, py).unwrap();
+/// #     let dict = fun.call0().unwrap();
+/// #     assert!(dict.contains("foo").unwrap());
+/// # });
+/// ```
+#[macro_export]
+macro_rules! intern {
+    ($py: expr, $text: expr) => {{
+        static INTERNED: $crate::sync::Interned = $crate::sync::Interned::new($text);
+        INTERNED.get($py)
+    }};
+}
+
+/// Implementation detail for `intern!` macro.
+#[doc(hidden)]
+pub struct Interned(&'static str, GILOnceCell<Py<PyString>>);
+
+impl Interned {
+    /// Creates an empty holder for an interned `str`.
+    pub const fn new(value: &'static str) -> Self {
+        Interned(value, GILOnceCell::new())
+    }
+
+    /// Gets or creates the interned `str` value.
+    #[inline]
+    pub fn get<'py>(&self, py: Python<'py>) -> &Bound<'py, PyString> {
+        self.1
+            .get_or_init(py, || PyString::intern_bound(py, self.0).into())
+            .bind(py)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    use crate::types::{dict::PyDictMethods, PyDict};
+
+    #[test]
+    fn test_intern() {
+        Python::with_gil(|py| {
+            let foo1 = "foo";
+            let foo2 = intern!(py, "foo");
+            let foo3 = intern!(py, stringify!(foo));
+
+            let dict = PyDict::new_bound(py);
+            dict.set_item(foo1, 42_usize).unwrap();
+            assert!(dict.contains(foo2).unwrap());
+            assert_eq!(
+                dict.get_item(foo3)
+                    .unwrap()
+                    .unwrap()
+                    .extract::<usize>()
+                    .unwrap(),
+                42
+            );
+        });
+    }
+
+    #[test]
+    fn test_once_cell() {
+        Python::with_gil(|py| {
+            let mut cell = GILOnceCell::new();
+
+            assert!(cell.get(py).is_none());
+
+            assert_eq!(cell.get_or_try_init(py, || Err(5)), Err(5));
+            assert!(cell.get(py).is_none());
+
+            assert_eq!(cell.get_or_try_init(py, || Ok::<_, ()>(2)), Ok(&2));
+            assert_eq!(cell.get(py), Some(&2));
+
+            assert_eq!(cell.get_or_try_init(py, || Err(5)), Ok(&2));
+
+            assert_eq!(cell.take(), Some(2));
+            assert_eq!(cell.into_inner(), None)
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/test_utils.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/test_utils.rs
--- 43.0.0-1/rust-vendor/pyo3/src/test_utils.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/test_utils.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,2 @@
+use crate as pyo3;
+include!("../tests/common.rs");
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/tests/common.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/tests/common.rs
--- 43.0.0-1/rust-vendor/pyo3/src/tests/common.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/tests/common.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,166 @@
+// the inner mod enables the #![allow(dead_code)] to
+// be applied - `test_utils.rs` uses `include!` to pull in this file
+
+/// Common macros and helpers for tests
+#[allow(dead_code)] // many tests do not use the complete set of functionality offered here
+#[macro_use]
+mod inner {
+
+    #[allow(unused_imports)] // pulls in `use crate as pyo3` in `test_utils.rs`
+    use super::*;
+
+    use pyo3::prelude::*;
+
+    use pyo3::types::{IntoPyDict, PyList};
+
+    #[macro_export]
+    macro_rules! py_assert {
+        ($py:expr, $($val:ident)+, $assertion:literal) => {
+            pyo3::py_run!($py, $($val)+, concat!("assert ", $assertion))
+        };
+        ($py:expr, *$dict:expr, $assertion:literal) => {
+            pyo3::py_run!($py, *$dict, concat!("assert ", $assertion))
+        };
+    }
+
+    #[macro_export]
+    macro_rules! assert_py_eq {
+        ($val:expr, $expected:expr) => {
+            assert!($val.eq($expected).unwrap());
+        };
+    }
+
+    #[macro_export]
+    macro_rules! py_expect_exception {
+        // Case1: idents & no err_msg
+        ($py:expr, $($val:ident)+, $code:expr, $err:ident) => {{
+            use pyo3::types::IntoPyDict;
+            let d = [$((stringify!($val), $val.to_object($py)),)+].into_py_dict_bound($py);
+            py_expect_exception!($py, *d, $code, $err)
+        }};
+        // Case2: dict & no err_msg
+        ($py:expr, *$dict:expr, $code:expr, $err:ident) => {{
+            let res = $py.run_bound($code, None, Some(&$dict.as_borrowed()));
+            let err = res.expect_err(&format!("Did not raise {}", stringify!($err)));
+            if !err.matches($py, $py.get_type_bound::<pyo3::exceptions::$err>()) {
+                panic!("Expected {} but got {:?}", stringify!($err), err)
+            }
+            err
+        }};
+        // Case3: idents & err_msg
+        ($py:expr, $($val:ident)+, $code:expr, $err:ident, $err_msg:literal) => {{
+            let err = py_expect_exception!($py, $($val)+, $code, $err);
+            // Suppose that the error message looks like 'TypeError: ~'
+            assert_eq!(format!("Py{}", err), concat!(stringify!($err), ": ", $err_msg));
+            err
+        }};
+        // Case4: dict & err_msg
+        ($py:expr, *$dict:expr, $code:expr, $err:ident, $err_msg:literal) => {{
+            let err = py_expect_exception!($py, *$dict, $code, $err);
+            assert_eq!(format!("Py{}", err), concat!(stringify!($err), ": ", $err_msg));
+            err
+        }};
+    }
+
+    // sys.unraisablehook not available until Python 3.8
+    #[cfg(all(feature = "macros", Py_3_8))]
+    #[pyclass(crate = "pyo3")]
+    pub struct UnraisableCapture {
+        pub capture: Option<(PyErr, PyObject)>,
+        old_hook: Option<PyObject>,
+    }
+
+    #[cfg(all(feature = "macros", Py_3_8))]
+    #[pymethods(crate = "pyo3")]
+    impl UnraisableCapture {
+        pub fn hook(&mut self, unraisable: Bound<'_, PyAny>) {
+            let err = PyErr::from_value_bound(unraisable.getattr("exc_value").unwrap());
+            let instance = unraisable.getattr("object").unwrap();
+            self.capture = Some((err, instance.into()));
+        }
+    }
+
+    #[cfg(all(feature = "macros", Py_3_8))]
+    impl UnraisableCapture {
+        pub fn install(py: Python<'_>) -> Py<Self> {
+            let sys = py.import_bound("sys").unwrap();
+            let old_hook = sys.getattr("unraisablehook").unwrap().into();
+
+            let capture = Py::new(
+                py,
+                UnraisableCapture {
+                    capture: None,
+                    old_hook: Some(old_hook),
+                },
+            )
+            .unwrap();
+
+            sys.setattr("unraisablehook", capture.getattr(py, "hook").unwrap())
+                .unwrap();
+
+            capture
+        }
+
+        pub fn uninstall(&mut self, py: Python<'_>) {
+            let old_hook = self.old_hook.take().unwrap();
+
+            let sys = py.import_bound("sys").unwrap();
+            sys.setattr("unraisablehook", old_hook).unwrap();
+        }
+    }
+
+    pub struct CatchWarnings<'py> {
+        catch_warnings: Bound<'py, PyAny>,
+    }
+
+    impl<'py> CatchWarnings<'py> {
+        pub fn enter<R>(
+            py: Python<'py>,
+            f: impl FnOnce(&Bound<'py, PyList>) -> PyResult<R>,
+        ) -> PyResult<R> {
+            let warnings = py.import_bound("warnings")?;
+            let kwargs = [("record", true)].into_py_dict_bound(py);
+            let catch_warnings = warnings
+                .getattr("catch_warnings")?
+                .call((), Some(&kwargs))?;
+            let list = catch_warnings.call_method0("__enter__")?.downcast_into()?;
+            let _guard = Self { catch_warnings };
+            f(&list)
+        }
+    }
+
+    impl Drop for CatchWarnings<'_> {
+        fn drop(&mut self) {
+            let py = self.catch_warnings.py();
+            self.catch_warnings
+                .call_method1("__exit__", (py.None(), py.None(), py.None()))
+                .unwrap();
+        }
+    }
+
+    #[macro_export]
+    macro_rules! assert_warnings {
+        ($py:expr, $body:expr, [$(($category:ty, $message:literal)),+] $(,)? ) => {{
+            $crate::tests::common::CatchWarnings::enter($py, |w| {
+                use $crate::types::{PyListMethods, PyStringMethods};
+                $body;
+                let expected_warnings = [$((<$category as $crate::type_object::PyTypeInfo>::type_object_bound($py), $message)),+];
+                assert_eq!(w.len(), expected_warnings.len());
+                for (warning, (category, message)) in w.iter().zip(expected_warnings) {
+
+                    assert!(warning.getattr("category").unwrap().is(&category));
+                    assert_eq!(
+                        warning.getattr("message").unwrap().str().unwrap().to_string_lossy(),
+                        message
+                    );
+                }
+
+                Ok(())
+            })
+            .unwrap();
+        }};
+    }
+}
+
+#[allow(unused_imports)] // some tests use just the macros and none of the other functionality
+pub use inner::*;
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/tests/hygiene/misc.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/tests/hygiene/misc.rs
--- 43.0.0-1/rust-vendor/pyo3/src/tests/hygiene/misc.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/tests/hygiene/misc.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,51 @@
+#![no_implicit_prelude]
+
+#[derive(crate::FromPyObject)]
+#[pyo3(crate = "crate")]
+struct Derive1(#[allow(dead_code)] i32); // newtype case
+
+#[derive(crate::FromPyObject)]
+#[pyo3(crate = "crate")]
+#[allow(dead_code)]
+struct Derive2(i32, i32); // tuple case
+
+#[derive(crate::FromPyObject)]
+#[pyo3(crate = "crate")]
+#[allow(dead_code)]
+struct Derive3 {
+    f: i32,
+    #[pyo3(item(42))]
+    g: i32,
+} // struct case
+
+#[derive(crate::FromPyObject)]
+#[pyo3(crate = "crate")]
+#[allow(dead_code)]
+enum Derive4 {
+    A(i32),
+    B { f: i32 },
+} // enum case
+
+crate::create_exception!(mymodule, CustomError, crate::exceptions::PyException);
+crate::import_exception!(socket, gaierror);
+
+#[allow(dead_code)]
+fn intern(py: crate::Python<'_>) {
+    let _foo = crate::intern!(py, "foo");
+    let _bar = crate::intern!(py, stringify!(bar));
+}
+
+#[allow(dead_code)]
+#[cfg(not(PyPy))]
+fn append_to_inittab() {
+    #[crate::pymodule]
+    #[pyo3(crate = "crate")]
+    #[allow(clippy::unnecessary_wraps)]
+    fn module_for_inittab(
+        _: crate::Python<'_>,
+        _: &crate::Bound<'_, crate::types::PyModule>,
+    ) -> crate::PyResult<()> {
+        ::std::result::Result::Ok(())
+    }
+    crate::append_to_inittab!(module_for_inittab);
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/tests/hygiene/mod.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/tests/hygiene/mod.rs
--- 43.0.0-1/rust-vendor/pyo3/src/tests/hygiene/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/tests/hygiene/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,9 @@
+// The modules in this test are used to check PyO3 macro expansion is hygienic. By locating the test
+// inside the crate the global `::pyo3` namespace is not available, so in combination with
+// #[pyo3(crate = "crate")] this validates that all macro expansion respects the setting.
+
+mod misc;
+mod pyclass;
+mod pyfunction;
+mod pymethods;
+mod pymodule;
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/tests/hygiene/pyclass.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/tests/hygiene/pyclass.rs
--- 43.0.0-1/rust-vendor/pyo3/src/tests/hygiene/pyclass.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/tests/hygiene/pyclass.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,71 @@
+#![no_implicit_prelude]
+#![allow(unused_variables)]
+
+#[crate::pyclass]
+#[pyo3(crate = "crate")]
+#[derive(::std::clone::Clone)]
+pub struct Foo;
+
+#[crate::pyclass]
+#[pyo3(crate = "crate")]
+pub struct Foo2;
+
+#[cfg_attr(any(Py_3_9, not(Py_LIMITED_API)), crate::pyclass(
+    name = "ActuallyBar",
+    freelist = 8,
+    unsendable,
+    subclass,
+    extends = crate::types::PyAny,
+    module = "Spam",
+    weakref,
+    dict
+))]
+#[cfg_attr(not(any(Py_3_9, not(Py_LIMITED_API))), crate::pyclass(
+    name = "ActuallyBar",
+    freelist = 8,
+    unsendable,
+    subclass,
+    extends = crate::types::PyAny,
+    module = "Spam"
+))]
+#[pyo3(crate = "crate")]
+pub struct Bar {
+    #[pyo3(get, set)]
+    a: u8,
+    #[pyo3(get, set)]
+    b: Foo,
+    #[pyo3(set)]
+    c: ::std::option::Option<crate::Py<Foo2>>,
+}
+
+#[crate::pyclass(eq, eq_int)]
+#[pyo3(crate = "crate")]
+#[derive(PartialEq)]
+pub enum Enum {
+    Var0,
+}
+
+#[crate::pyclass]
+#[pyo3(crate = "crate")]
+pub struct Foo3 {
+    #[pyo3(get, set)]
+    #[cfg(any())]
+    field: i32,
+
+    #[pyo3(get, set)]
+    #[cfg(not(any()))]
+    field: u32,
+}
+
+#[crate::pyclass]
+#[pyo3(crate = "crate")]
+pub struct Foo4 {
+    #[pyo3(get, set)]
+    #[cfg(any())]
+    #[cfg(not(any()))]
+    field: i32,
+
+    #[pyo3(get, set)]
+    #[cfg(not(any()))]
+    field: u32,
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/tests/hygiene/pyfunction.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/tests/hygiene/pyfunction.rs
--- 43.0.0-1/rust-vendor/pyo3/src/tests/hygiene/pyfunction.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/tests/hygiene/pyfunction.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,26 @@
+#![no_implicit_prelude]
+#![allow(unused_variables, clippy::unnecessary_wraps)]
+
+#[crate::pyfunction]
+#[pyo3(crate = "crate")]
+fn do_something(x: i32) -> crate::PyResult<i32> {
+    ::std::result::Result::Ok(x)
+}
+
+#[test]
+#[cfg(feature = "gil-refs")]
+fn invoke_wrap_pyfunction() {
+    crate::Python::with_gil(|py| {
+        #[allow(deprecated)]
+        let func = crate::wrap_pyfunction!(do_something)(py).unwrap();
+        crate::py_run!(py, func, r#"func(5)"#);
+    });
+}
+
+#[test]
+fn invoke_wrap_pyfunction_bound() {
+    crate::Python::with_gil(|py| {
+        let func = crate::wrap_pyfunction_bound!(do_something, py).unwrap();
+        crate::py_run!(py, func, r#"func(5)"#);
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/tests/hygiene/pymethods.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/tests/hygiene/pymethods.rs
--- 43.0.0-1/rust-vendor/pyo3/src/tests/hygiene/pymethods.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/tests/hygiene/pymethods.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,424 @@
+#![no_implicit_prelude]
+#![allow(unused_variables, clippy::unnecessary_wraps)]
+
+#[crate::pyclass]
+#[pyo3(crate = "crate")]
+pub struct Dummy;
+
+#[crate::pyclass]
+#[pyo3(crate = "crate")]
+pub struct DummyIter;
+
+#[crate::pymethods]
+#[pyo3(crate = "crate")]
+impl Dummy {
+    //////////////////////
+    // Basic customization
+    //////////////////////
+    fn __repr__(&self) -> &'static str {
+        "Dummy"
+    }
+
+    fn __str__(&self) -> &'static str {
+        "Dummy"
+    }
+
+    fn __bytes__<'py>(&self, py: crate::Python<'py>) -> crate::Bound<'py, crate::types::PyBytes> {
+        crate::types::PyBytes::new_bound(py, &[0])
+    }
+
+    fn __format__(&self, format_spec: ::std::string::String) -> ::std::string::String {
+        ::std::unimplemented!()
+    }
+
+    fn __lt__(&self, other: &Self) -> bool {
+        false
+    }
+
+    fn __le__(&self, other: &Self) -> bool {
+        false
+    }
+    fn __eq__(&self, other: &Self) -> bool {
+        false
+    }
+    fn __ne__(&self, other: &Self) -> bool {
+        false
+    }
+    fn __gt__(&self, other: &Self) -> bool {
+        false
+    }
+    fn __ge__(&self, other: &Self) -> bool {
+        false
+    }
+
+    fn __hash__(&self) -> u64 {
+        42
+    }
+
+    fn __bool__(&self) -> bool {
+        true
+    }
+
+    //////////////////////
+    // Customizing attribute access
+    //////////////////////
+
+    fn __getattr__(&self, name: ::std::string::String) -> &crate::Bound<'_, crate::PyAny> {
+        ::std::unimplemented!()
+    }
+
+    fn __getattribute__(&self, name: ::std::string::String) -> &crate::Bound<'_, crate::PyAny> {
+        ::std::unimplemented!()
+    }
+
+    fn __setattr__(&mut self, name: ::std::string::String, value: ::std::string::String) {}
+
+    fn __delattr__(&mut self, name: ::std::string::String) {}
+
+    fn __dir__<'py>(&self, py: crate::Python<'py>) -> crate::Bound<'py, crate::types::PyList> {
+        crate::types::PyList::new_bound(py, ::std::vec![0_u8])
+    }
+
+    //////////////////////
+    // Implementing Descriptors
+    //////////////////////
+
+    fn __get__(
+        &self,
+        instance: &crate::Bound<'_, crate::PyAny>,
+        owner: &crate::Bound<'_, crate::PyAny>,
+    ) -> crate::PyResult<&crate::Bound<'_, crate::PyAny>> {
+        ::std::unimplemented!()
+    }
+
+    fn __set__(
+        &self,
+        instance: &crate::Bound<'_, crate::PyAny>,
+        owner: &crate::Bound<'_, crate::PyAny>,
+    ) {
+    }
+
+    fn __delete__(&self, instance: &crate::Bound<'_, crate::PyAny>) {}
+
+    fn __set_name__(
+        &self,
+        owner: &crate::Bound<'_, crate::PyAny>,
+        name: &crate::Bound<'_, crate::PyAny>,
+    ) {
+    }
+
+    //////////////////////
+    // Implementing Descriptors
+    //////////////////////
+
+    fn __len__(&self) -> usize {
+        0
+    }
+
+    fn __getitem__(&self, key: u32) -> crate::PyResult<u32> {
+        ::std::result::Result::Err(crate::exceptions::PyKeyError::new_err("boo"))
+    }
+
+    fn __setitem__(&self, key: u32, value: u32) {}
+
+    fn __delitem__(&self, key: u32) {}
+
+    fn __iter__(_: crate::pycell::PyRef<'_, Self>, py: crate::Python<'_>) -> crate::Py<DummyIter> {
+        crate::Py::new(py, DummyIter {}).unwrap()
+    }
+
+    fn __next__(&mut self) -> ::std::option::Option<()> {
+        ::std::option::Option::None
+    }
+
+    fn __reversed__(
+        slf: crate::pycell::PyRef<'_, Self>,
+        py: crate::Python<'_>,
+    ) -> crate::Py<DummyIter> {
+        crate::Py::new(py, DummyIter {}).unwrap()
+    }
+
+    fn __contains__(&self, item: u32) -> bool {
+        false
+    }
+
+    //////////////////////
+    // Emulating numeric types
+    //////////////////////
+
+    fn __add__(&self, other: &Self) -> Dummy {
+        Dummy {}
+    }
+
+    fn __sub__(&self, other: &Self) -> Dummy {
+        Dummy {}
+    }
+
+    fn __mul__(&self, other: &Self) -> Dummy {
+        Dummy {}
+    }
+
+    fn __truediv__(&self, _other: &Self) -> crate::PyResult<()> {
+        ::std::result::Result::Err(crate::exceptions::PyZeroDivisionError::new_err("boo"))
+    }
+
+    fn __floordiv__(&self, _other: &Self) -> crate::PyResult<()> {
+        ::std::result::Result::Err(crate::exceptions::PyZeroDivisionError::new_err("boo"))
+    }
+
+    fn __mod__(&self, _other: &Self) -> u32 {
+        0
+    }
+
+    fn __divmod__(&self, _other: &Self) -> (u32, u32) {
+        (0, 0)
+    }
+
+    fn __pow__(&self, _other: &Self, modulo: ::std::option::Option<i32>) -> Dummy {
+        Dummy {}
+    }
+
+    fn __lshift__(&self, other: &Self) -> Dummy {
+        Dummy {}
+    }
+
+    fn __rshift__(&self, other: &Self) -> Dummy {
+        Dummy {}
+    }
+
+    fn __and__(&self, other: &Self) -> Dummy {
+        Dummy {}
+    }
+
+    fn __xor__(&self, other: &Self) -> Dummy {
+        Dummy {}
+    }
+
+    fn __or__(&self, other: &Self) -> Dummy {
+        Dummy {}
+    }
+
+    fn __radd__(&self, other: &Self) -> Dummy {
+        Dummy {}
+    }
+
+    fn __rrsub__(&self, other: &Self) -> Dummy {
+        Dummy {}
+    }
+
+    fn __rmul__(&self, other: &Self) -> Dummy {
+        Dummy {}
+    }
+
+    fn __rtruediv__(&self, _other: &Self) -> crate::PyResult<()> {
+        ::std::result::Result::Err(crate::exceptions::PyZeroDivisionError::new_err("boo"))
+    }
+
+    fn __rfloordiv__(&self, _other: &Self) -> crate::PyResult<()> {
+        ::std::result::Result::Err(crate::exceptions::PyZeroDivisionError::new_err("boo"))
+    }
+
+    fn __rmod__(&self, _other: &Self) -> u32 {
+        0
+    }
+
+    fn __rdivmod__(&self, _other: &Self) -> (u32, u32) {
+        (0, 0)
+    }
+
+    fn __rpow__(&self, _other: &Self, modulo: ::std::option::Option<i32>) -> Dummy {
+        Dummy {}
+    }
+
+    fn __rlshift__(&self, other: &Self) -> Dummy {
+        Dummy {}
+    }
+
+    fn __rrshift__(&self, other: &Self) -> Dummy {
+        Dummy {}
+    }
+
+    fn __rand__(&self, other: &Self) -> Dummy {
+        Dummy {}
+    }
+
+    fn __rxor__(&self, other: &Self) -> Dummy {
+        Dummy {}
+    }
+
+    fn __ror__(&self, other: &Self) -> Dummy {
+        Dummy {}
+    }
+
+    fn __iadd__(&mut self, other: &Self) {}
+
+    fn __irsub__(&mut self, other: &Self) {}
+
+    fn __imul__(&mut self, other: &Self) {}
+
+    fn __itruediv__(&mut self, _other: &Self) {}
+
+    fn __ifloordiv__(&mut self, _other: &Self) {}
+
+    fn __imod__(&mut self, _other: &Self) {}
+
+    fn __ipow__(&mut self, _other: &Self, modulo: ::std::option::Option<i32>) {}
+
+    fn __ilshift__(&mut self, other: &Self) {}
+
+    fn __irshift__(&mut self, other: &Self) {}
+
+    fn __iand__(&mut self, other: &Self) {}
+
+    fn __ixor__(&mut self, other: &Self) {}
+
+    fn __ior__(&mut self, other: &Self) {}
+
+    fn __neg__(slf: crate::pycell::PyRef<'_, Self>) -> crate::pycell::PyRef<'_, Self> {
+        slf
+    }
+
+    fn __pos__(slf: crate::pycell::PyRef<'_, Self>) -> crate::pycell::PyRef<'_, Self> {
+        slf
+    }
+
+    fn __abs__(slf: crate::pycell::PyRef<'_, Self>) -> crate::pycell::PyRef<'_, Self> {
+        slf
+    }
+
+    fn __invert__(slf: crate::pycell::PyRef<'_, Self>) -> crate::pycell::PyRef<'_, Self> {
+        slf
+    }
+
+    fn __complex__<'py>(
+        &self,
+        py: crate::Python<'py>,
+    ) -> crate::Bound<'py, crate::types::PyComplex> {
+        crate::types::PyComplex::from_doubles_bound(py, 0.0, 0.0)
+    }
+
+    fn __int__(&self) -> u32 {
+        0
+    }
+
+    fn __float__(&self) -> f64 {
+        0.0
+    }
+
+    fn __index__(&self) -> u32 {
+        0
+    }
+
+    #[pyo3(signature=(ndigits=::std::option::Option::None))]
+    fn __round__(&self, ndigits: ::std::option::Option<u32>) -> u32 {
+        0
+    }
+
+    fn __trunc__(&self) -> u32 {
+        0
+    }
+
+    fn __floor__(&self) -> u32 {
+        0
+    }
+
+    fn __ceil__(&self) -> u32 {
+        0
+    }
+
+    //////////////////////
+    // With Statement Context Managers
+    //////////////////////
+
+    fn __enter__(&mut self) {}
+
+    fn __exit__(
+        &mut self,
+        exc_type: &crate::Bound<'_, crate::PyAny>,
+        exc_value: &crate::Bound<'_, crate::PyAny>,
+        traceback: &crate::Bound<'_, crate::PyAny>,
+    ) {
+    }
+
+    //////////////////////
+    // Awaitable Objects
+    //////////////////////
+
+    fn __await__(slf: crate::pycell::PyRef<'_, Self>) -> crate::pycell::PyRef<'_, Self> {
+        slf
+    }
+
+    //////////////////////
+
+    // Asynchronous Iterators
+    //////////////////////
+
+    fn __aiter__(
+        slf: crate::pycell::PyRef<'_, Self>,
+        py: crate::Python<'_>,
+    ) -> crate::Py<DummyIter> {
+        crate::Py::new(py, DummyIter {}).unwrap()
+    }
+
+    fn __anext__(&mut self) -> ::std::option::Option<()> {
+        ::std::option::Option::None
+    }
+
+    //////////////////////
+    // Asynchronous Context Managers
+    //////////////////////
+
+    fn __aenter__(&mut self) {}
+
+    fn __aexit__(
+        &mut self,
+        exc_type: &crate::Bound<'_, crate::PyAny>,
+        exc_value: &crate::Bound<'_, crate::PyAny>,
+        traceback: &crate::Bound<'_, crate::PyAny>,
+    ) {
+    }
+
+    // Things with attributes
+
+    #[pyo3(signature = (_y, *, _z=2))]
+    fn test(&self, _y: &Dummy, _z: i32) {}
+    #[staticmethod]
+    fn staticmethod() {}
+    #[classmethod]
+    fn clsmethod(_: &crate::Bound<'_, crate::types::PyType>) {}
+    #[pyo3(signature = (*_args, **_kwds))]
+    fn __call__(
+        &self,
+        _args: &crate::Bound<'_, crate::types::PyTuple>,
+        _kwds: ::std::option::Option<&crate::Bound<'_, crate::types::PyDict>>,
+    ) -> crate::PyResult<i32> {
+        ::std::unimplemented!()
+    }
+    #[new]
+    fn new(a: u8) -> Self {
+        Dummy {}
+    }
+    #[getter]
+    fn get(&self) -> i32 {
+        0
+    }
+    #[setter]
+    fn set(&mut self, _v: i32) {}
+    #[classattr]
+    fn class_attr() -> i32 {
+        0
+    }
+
+    // Dunder methods invented for protocols
+
+    // PyGcProtocol
+    // Buffer protocol?
+}
+
+// Ensure that crate argument is also accepted inline
+
+#[crate::pyclass(crate = "crate")]
+struct Dummy2;
+
+#[crate::pymethods(crate = "crate")]
+impl Dummy2 {}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/tests/hygiene/pymodule.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/tests/hygiene/pymodule.rs
--- 43.0.0-1/rust-vendor/pyo3/src/tests/hygiene/pymodule.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/tests/hygiene/pymodule.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,51 @@
+#![no_implicit_prelude]
+#![allow(unused_variables, clippy::unnecessary_wraps)]
+
+#[crate::pyfunction]
+#[pyo3(crate = "crate")]
+fn do_something(x: i32) -> crate::PyResult<i32> {
+    ::std::result::Result::Ok(x)
+}
+
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+#[crate::pymodule]
+#[pyo3(crate = "crate")]
+fn foo(_py: crate::Python<'_>, _m: &crate::types::PyModule) -> crate::PyResult<()> {
+    ::std::result::Result::Ok(())
+}
+
+#[crate::pymodule]
+#[pyo3(crate = "crate")]
+fn foo_bound(
+    _py: crate::Python<'_>,
+    _m: &crate::Bound<'_, crate::types::PyModule>,
+) -> crate::PyResult<()> {
+    ::std::result::Result::Ok(())
+}
+
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+#[crate::pymodule]
+#[pyo3(crate = "crate")]
+fn my_module(_py: crate::Python<'_>, m: &crate::types::PyModule) -> crate::PyResult<()> {
+    m.add_function(crate::wrap_pyfunction!(do_something, m)?)?;
+    m.add_wrapped(crate::wrap_pymodule!(foo))?;
+
+    ::std::result::Result::Ok(())
+}
+
+#[crate::pymodule]
+#[pyo3(crate = "crate")]
+fn my_module_bound(m: &crate::Bound<'_, crate::types::PyModule>) -> crate::PyResult<()> {
+    <crate::Bound<'_, crate::types::PyModule> as crate::types::PyModuleMethods>::add_function(
+        m,
+        crate::wrap_pyfunction_bound!(do_something, m)?,
+    )?;
+    <crate::Bound<'_, crate::types::PyModule> as crate::types::PyModuleMethods>::add_wrapped(
+        m,
+        crate::wrap_pymodule!(foo_bound),
+    )?;
+
+    ::std::result::Result::Ok(())
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/tests/mod.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/tests/mod.rs
--- 43.0.0-1/rust-vendor/pyo3/src/tests/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/tests/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,10 @@
+#[macro_use]
+pub(crate) mod common {
+    use crate as pyo3;
+    include!("./common.rs");
+}
+
+/// Test macro hygiene - this is in the crate since we won't have
+/// `pyo3` available in the crate root.
+#[cfg(all(test, feature = "macros"))]
+mod hygiene;
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/type_object.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/type_object.rs
--- 43.0.0-1/rust-vendor/pyo3/src/type_object.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/type_object.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,257 @@
+//! Python type object information
+
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::types::any::PyAnyMethods;
+use crate::types::{PyAny, PyType};
+#[cfg(feature = "gil-refs")]
+use crate::PyNativeType;
+use crate::{ffi, Bound, Python};
+
+/// `T: PyLayout<U>` represents that `T` is a concrete representation of `U` in the Python heap.
+/// E.g., `PyClassObject` is a concrete representation of all `pyclass`es, and `ffi::PyObject`
+/// is of `PyAny`.
+///
+/// This trait is intended to be used internally.
+///
+/// # Safety
+///
+/// This trait must only be implemented for types which represent valid layouts of Python objects.
+pub unsafe trait PyLayout<T> {}
+
+/// `T: PySizedLayout<U>` represents that `T` is not a instance of
+/// [`PyVarObject`](https://docs.python.org/3.8/c-api/structures.html?highlight=pyvarobject#c.PyVarObject).
+/// In addition, that `T` is a concrete representation of `U`.
+pub trait PySizedLayout<T>: PyLayout<T> + Sized {}
+
+/// Specifies that this type has a "GIL-bound Reference" form.
+///
+/// This is expected to be deprecated in the near future, see <https://github.com/PyO3/pyo3/issues/3382>
+///
+/// # Safety
+///
+/// - `Py<Self>::as_ref` will hand out references to `Self::AsRefTarget`.
+/// - `Self::AsRefTarget` must have the same layout as `UnsafeCell<ffi::PyAny>`.
+#[cfg(feature = "gil-refs")]
+pub unsafe trait HasPyGilRef {
+    /// Utility type to make Py::as_ref work.
+    type AsRefTarget: PyNativeType;
+}
+
+#[cfg(feature = "gil-refs")]
+unsafe impl<T> HasPyGilRef for T
+where
+    T: PyNativeType,
+{
+    type AsRefTarget = Self;
+}
+
+/// Python type information.
+/// All Python native types (e.g., `PyDict`) and `#[pyclass]` structs implement this trait.
+///
+/// This trait is marked unsafe because:
+///  - specifying the incorrect layout can lead to memory errors
+///  - the return value of type_object must always point to the same PyTypeObject instance
+///
+/// It is safely implemented by the `pyclass` macro.
+///
+/// # Safety
+///
+/// Implementations must provide an implementation for `type_object_raw` which infallibly produces a
+/// non-null pointer to the corresponding Python type object.
+#[cfg(feature = "gil-refs")]
+pub unsafe trait PyTypeInfo: Sized + HasPyGilRef {
+    /// Class name.
+    const NAME: &'static str;
+
+    /// Module name, if any.
+    const MODULE: Option<&'static str>;
+
+    /// Returns the PyTypeObject instance for this type.
+    fn type_object_raw(py: Python<'_>) -> *mut ffi::PyTypeObject;
+
+    /// Returns the safe abstraction over the type object.
+    #[inline]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyTypeInfo::type_object` will be replaced by `PyTypeInfo::type_object_bound` in a future PyO3 version"
+    )]
+    fn type_object(py: Python<'_>) -> &PyType {
+        // This isn't implemented in terms of `type_object_bound` because this just borrowed the
+        // object, for legacy reasons.
+        #[allow(deprecated)]
+        unsafe {
+            py.from_borrowed_ptr(Self::type_object_raw(py) as _)
+        }
+    }
+
+    /// Returns the safe abstraction over the type object.
+    #[inline]
+    fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType> {
+        // Making the borrowed object `Bound` is necessary for soundness reasons. It's an extreme
+        // edge case, but arbitrary Python code _could_ change the __class__ of an object and cause
+        // the type object to be freed.
+        //
+        // By making `Bound` we assume ownership which is then safe against races.
+        unsafe {
+            Self::type_object_raw(py)
+                .cast::<ffi::PyObject>()
+                .assume_borrowed_unchecked(py)
+                .to_owned()
+                .downcast_into_unchecked()
+        }
+    }
+
+    /// Checks if `object` is an instance of this type or a subclass of this type.
+    #[inline]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyTypeInfo::is_type_of` will be replaced by `PyTypeInfo::is_type_of_bound` in a future PyO3 version"
+    )]
+    fn is_type_of(object: &PyAny) -> bool {
+        Self::is_type_of_bound(&object.as_borrowed())
+    }
+
+    /// Checks if `object` is an instance of this type or a subclass of this type.
+    #[inline]
+    fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool {
+        unsafe { ffi::PyObject_TypeCheck(object.as_ptr(), Self::type_object_raw(object.py())) != 0 }
+    }
+
+    /// Checks if `object` is an instance of this type.
+    #[inline]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyTypeInfo::is_exact_type_of` will be replaced by `PyTypeInfo::is_exact_type_of_bound` in a future PyO3 version"
+    )]
+    fn is_exact_type_of(object: &PyAny) -> bool {
+        Self::is_exact_type_of_bound(&object.as_borrowed())
+    }
+
+    /// Checks if `object` is an instance of this type.
+    #[inline]
+    fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool {
+        unsafe { ffi::Py_TYPE(object.as_ptr()) == Self::type_object_raw(object.py()) }
+    }
+}
+
+/// Python type information.
+/// All Python native types (e.g., `PyDict`) and `#[pyclass]` structs implement this trait.
+///
+/// This trait is marked unsafe because:
+///  - specifying the incorrect layout can lead to memory errors
+///  - the return value of type_object must always point to the same PyTypeObject instance
+///
+/// It is safely implemented by the `pyclass` macro.
+///
+/// # Safety
+///
+/// Implementations must provide an implementation for `type_object_raw` which infallibly produces a
+/// non-null pointer to the corresponding Python type object.
+#[cfg(not(feature = "gil-refs"))]
+pub unsafe trait PyTypeInfo: Sized {
+    /// Class name.
+    const NAME: &'static str;
+
+    /// Module name, if any.
+    const MODULE: Option<&'static str>;
+
+    /// Returns the PyTypeObject instance for this type.
+    fn type_object_raw(py: Python<'_>) -> *mut ffi::PyTypeObject;
+
+    /// Returns the safe abstraction over the type object.
+    #[inline]
+    fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType> {
+        // Making the borrowed object `Bound` is necessary for soundness reasons. It's an extreme
+        // edge case, but arbitrary Python code _could_ change the __class__ of an object and cause
+        // the type object to be freed.
+        //
+        // By making `Bound` we assume ownership which is then safe against races.
+        unsafe {
+            Self::type_object_raw(py)
+                .cast::<ffi::PyObject>()
+                .assume_borrowed_unchecked(py)
+                .to_owned()
+                .downcast_into_unchecked()
+        }
+    }
+
+    /// Checks if `object` is an instance of this type or a subclass of this type.
+    #[inline]
+    fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool {
+        unsafe { ffi::PyObject_TypeCheck(object.as_ptr(), Self::type_object_raw(object.py())) != 0 }
+    }
+
+    /// Checks if `object` is an instance of this type.
+    #[inline]
+    fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool {
+        unsafe { ffi::Py_TYPE(object.as_ptr()) == Self::type_object_raw(object.py()) }
+    }
+}
+
+/// Implemented by types which can be used as a concrete Python type inside `Py<T>` smart pointers.
+#[cfg(feature = "gil-refs")]
+pub trait PyTypeCheck: HasPyGilRef {
+    /// Name of self. This is used in error messages, for example.
+    const NAME: &'static str;
+
+    /// Checks if `object` is an instance of `Self`, which may include a subtype.
+    ///
+    /// This should be equivalent to the Python expression `isinstance(object, Self)`.
+    fn type_check(object: &Bound<'_, PyAny>) -> bool;
+}
+
+/// Implemented by types which can be used as a concrete Python type inside `Py<T>` smart pointers.
+#[cfg(not(feature = "gil-refs"))]
+pub trait PyTypeCheck {
+    /// Name of self. This is used in error messages, for example.
+    const NAME: &'static str;
+
+    /// Checks if `object` is an instance of `Self`, which may include a subtype.
+    ///
+    /// This should be equivalent to the Python expression `isinstance(object, Self)`.
+    fn type_check(object: &Bound<'_, PyAny>) -> bool;
+}
+
+impl<T> PyTypeCheck for T
+where
+    T: PyTypeInfo,
+{
+    const NAME: &'static str = <T as PyTypeInfo>::NAME;
+
+    #[inline]
+    fn type_check(object: &Bound<'_, PyAny>) -> bool {
+        T::is_type_of_bound(object)
+    }
+}
+
+#[inline]
+pub(crate) unsafe fn get_tp_alloc(tp: *mut ffi::PyTypeObject) -> Option<ffi::allocfunc> {
+    #[cfg(not(Py_LIMITED_API))]
+    {
+        (*tp).tp_alloc
+    }
+
+    #[cfg(Py_LIMITED_API)]
+    {
+        let ptr = ffi::PyType_GetSlot(tp, ffi::Py_tp_alloc);
+        std::mem::transmute(ptr)
+    }
+}
+
+#[inline]
+pub(crate) unsafe fn get_tp_free(tp: *mut ffi::PyTypeObject) -> ffi::freefunc {
+    #[cfg(not(Py_LIMITED_API))]
+    {
+        (*tp).tp_free.unwrap()
+    }
+
+    #[cfg(Py_LIMITED_API)]
+    {
+        let ptr = ffi::PyType_GetSlot(tp, ffi::Py_tp_free);
+        debug_assert_ne!(ptr, std::ptr::null_mut());
+        std::mem::transmute(ptr)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/any.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/any.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/any.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/any.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,2848 @@
+use crate::class::basic::CompareOp;
+use crate::conversion::{AsPyPointer, FromPyObjectBound, IntoPy, ToPyObject};
+use crate::err::{DowncastError, DowncastIntoError, PyErr, PyResult};
+use crate::exceptions::{PyAttributeError, PyTypeError};
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::instance::Bound;
+use crate::internal_tricks::ptr_from_ref;
+use crate::py_result_ext::PyResultExt;
+use crate::type_object::{PyTypeCheck, PyTypeInfo};
+#[cfg(not(any(PyPy, GraalPy)))]
+use crate::types::PySuper;
+use crate::types::{PyDict, PyIterator, PyList, PyString, PyTuple, PyType};
+use crate::{err, ffi, Py, Python};
+#[cfg(feature = "gil-refs")]
+use crate::{err::PyDowncastError, type_object::HasPyGilRef, PyNativeType};
+use std::cell::UnsafeCell;
+use std::cmp::Ordering;
+use std::os::raw::c_int;
+
+/// Represents any Python object.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyAny>`][crate::Py] or [`Bound<'py, PyAny>`][Bound].
+///
+/// For APIs available on all Python objects, see the [`PyAnyMethods`] trait which is implemented for
+/// [`Bound<'py, PyAny>`][Bound].
+///
+/// See
+#[doc = concat!("[the guide](https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/types.html#concrete-python-types)")]
+/// for an explanation of the different Python object types.
+#[repr(transparent)]
+pub struct PyAny(UnsafeCell<ffi::PyObject>);
+
+unsafe impl AsPyPointer for PyAny {
+    #[inline]
+    fn as_ptr(&self) -> *mut ffi::PyObject {
+        self.0.get()
+    }
+}
+
+#[allow(non_snake_case)]
+// Copied here as the macro does not accept deprecated functions.
+// Originally ffi::object::PyObject_Check, but this is not in the Python C API.
+fn PyObject_Check(_: *mut ffi::PyObject) -> c_int {
+    1
+}
+
+pyobject_native_type_base!(PyAny);
+
+pyobject_native_type_info!(
+    PyAny,
+    pyobject_native_static_type_object!(ffi::PyBaseObject_Type),
+    Some("builtins"),
+    #checkfunction=PyObject_Check
+);
+
+pyobject_native_type_extract!(PyAny);
+
+pyobject_native_type_sized!(PyAny, ffi::PyObject);
+
+#[cfg(feature = "gil-refs")]
+impl PyAny {
+    /// Returns whether `self` and `other` point to the same object. To compare
+    /// the equality of two objects (the `==` operator), use [`eq`](PyAny::eq).
+    ///
+    /// This is equivalent to the Python expression `self is other`.
+    #[inline]
+    pub fn is<T: AsPyPointer>(&self, other: &T) -> bool {
+        self.as_borrowed().is(other)
+    }
+
+    /// Determines whether this object has the given attribute.
+    ///
+    /// This is equivalent to the Python expression `hasattr(self, attr_name)`.
+    ///
+    /// To avoid repeated temporary allocations of Python strings, the [`intern!`] macro can be used
+    /// to intern `attr_name`.
+    ///
+    /// # Example: `intern!`ing the attribute name
+    ///
+    /// ```
+    /// # use pyo3::{prelude::*, intern};
+    /// #
+    /// #[pyfunction]
+    /// fn has_version(sys: &Bound<'_, PyModule>) -> PyResult<bool> {
+    ///     sys.hasattr(intern!(sys.py(), "version"))
+    /// }
+    /// #
+    /// # Python::with_gil(|py| {
+    /// #    let sys = py.import_bound("sys").unwrap();
+    /// #    has_version(&sys).unwrap();
+    /// # });
+    /// ```
+    pub fn hasattr<N>(&self, attr_name: N) -> PyResult<bool>
+    where
+        N: IntoPy<Py<PyString>>,
+    {
+        self.as_borrowed().hasattr(attr_name)
+    }
+
+    /// Retrieves an attribute value.
+    ///
+    /// This is equivalent to the Python expression `self.attr_name`.
+    ///
+    /// To avoid repeated temporary allocations of Python strings, the [`intern!`] macro can be used
+    /// to intern `attr_name`.
+    ///
+    /// # Example: `intern!`ing the attribute name
+    ///
+    /// ```
+    /// # use pyo3::{prelude::*, intern};
+    /// #
+    /// #[pyfunction]
+    /// fn version<'py>(sys: &Bound<'py, PyModule>) -> PyResult<Bound<'py, PyAny>> {
+    ///     sys.getattr(intern!(sys.py(), "version"))
+    /// }
+    /// #
+    /// # Python::with_gil(|py| {
+    /// #    let sys = py.import_bound("sys").unwrap();
+    /// #    version(&sys).unwrap();
+    /// # });
+    /// ```
+    pub fn getattr<N>(&self, attr_name: N) -> PyResult<&PyAny>
+    where
+        N: IntoPy<Py<PyString>>,
+    {
+        self.as_borrowed()
+            .getattr(attr_name)
+            .map(Bound::into_gil_ref)
+    }
+
+    /// Sets an attribute value.
+    ///
+    /// This is equivalent to the Python expression `self.attr_name = value`.
+    ///
+    /// To avoid repeated temporary allocations of Python strings, the [`intern!`] macro can be used
+    /// to intern `name`.
+    ///
+    /// # Example: `intern!`ing the attribute name
+    ///
+    /// ```
+    /// # use pyo3::{prelude::*, intern};
+    /// #
+    /// #[pyfunction]
+    /// fn set_answer(ob: &Bound<'_, PyAny>) -> PyResult<()> {
+    ///     ob.setattr(intern!(ob.py(), "answer"), 42)
+    /// }
+    /// #
+    /// # Python::with_gil(|py| {
+    /// #    let ob = PyModule::new_bound(py, "empty").unwrap();
+    /// #    set_answer(&ob).unwrap();
+    /// # });
+    /// ```
+    pub fn setattr<N, V>(&self, attr_name: N, value: V) -> PyResult<()>
+    where
+        N: IntoPy<Py<PyString>>,
+        V: ToPyObject,
+    {
+        self.as_borrowed().setattr(attr_name, value)
+    }
+
+    /// Deletes an attribute.
+    ///
+    /// This is equivalent to the Python statement `del self.attr_name`.
+    ///
+    /// To avoid repeated temporary allocations of Python strings, the [`intern!`] macro can be used
+    /// to intern `attr_name`.
+    pub fn delattr<N>(&self, attr_name: N) -> PyResult<()>
+    where
+        N: IntoPy<Py<PyString>>,
+    {
+        self.as_borrowed().delattr(attr_name)
+    }
+
+    /// Returns an [`Ordering`] between `self` and `other`.
+    ///
+    /// This is equivalent to the following Python code:
+    /// ```python
+    /// if self == other:
+    ///     return Equal
+    /// elif a < b:
+    ///     return Less
+    /// elif a > b:
+    ///     return Greater
+    /// else:
+    ///     raise TypeError("PyAny::compare(): All comparisons returned false")
+    /// ```
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyFloat;
+    /// use std::cmp::Ordering;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let a = PyFloat::new_bound(py, 0_f64);
+    ///     let b = PyFloat::new_bound(py, 42_f64);
+    ///     assert_eq!(a.compare(b)?, Ordering::Less);
+    ///     Ok(())
+    /// })?;
+    /// # Ok(())}
+    /// ```
+    ///
+    /// It will return `PyErr` for values that cannot be compared:
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::{PyFloat, PyString};
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let a = PyFloat::new_bound(py, 0_f64);
+    ///     let b = PyString::new_bound(py, "zero");
+    ///     assert!(a.compare(b).is_err());
+    ///     Ok(())
+    /// })?;
+    /// # Ok(())}
+    /// ```
+    pub fn compare<O>(&self, other: O) -> PyResult<Ordering>
+    where
+        O: ToPyObject,
+    {
+        self.as_borrowed().compare(other)
+    }
+
+    /// Tests whether two Python objects obey a given [`CompareOp`].
+    ///
+    /// [`lt`](Self::lt), [`le`](Self::le), [`eq`](Self::eq), [`ne`](Self::ne),
+    /// [`gt`](Self::gt) and [`ge`](Self::ge) are the specialized versions
+    /// of this function.
+    ///
+    /// Depending on the value of `compare_op`, this is equivalent to one of the
+    /// following Python expressions:
+    ///
+    /// | `compare_op` | Python expression |
+    /// | :---: | :----: |
+    /// | [`CompareOp::Eq`] | `self == other` |
+    /// | [`CompareOp::Ne`] | `self != other` |
+    /// | [`CompareOp::Lt`] | `self < other` |
+    /// | [`CompareOp::Le`] | `self <= other` |
+    /// | [`CompareOp::Gt`] | `self > other` |
+    /// | [`CompareOp::Ge`] | `self >= other` |
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::class::basic::CompareOp;
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyInt;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let a: Bound<'_, PyInt> = 0_u8.into_py(py).into_bound(py).downcast_into()?;
+    ///     let b: Bound<'_, PyInt> = 42_u8.into_py(py).into_bound(py).downcast_into()?;
+    ///     assert!(a.rich_compare(b, CompareOp::Le)?.is_truthy()?);
+    ///     Ok(())
+    /// })?;
+    /// # Ok(())}
+    /// ```
+    pub fn rich_compare<O>(&self, other: O, compare_op: CompareOp) -> PyResult<&PyAny>
+    where
+        O: ToPyObject,
+    {
+        self.as_borrowed()
+            .rich_compare(other, compare_op)
+            .map(Bound::into_gil_ref)
+    }
+
+    /// Tests whether this object is less than another.
+    ///
+    /// This is equivalent to the Python expression `self < other`.
+    pub fn lt<O>(&self, other: O) -> PyResult<bool>
+    where
+        O: ToPyObject,
+    {
+        self.as_borrowed().lt(other)
+    }
+
+    /// Tests whether this object is less than or equal to another.
+    ///
+    /// This is equivalent to the Python expression `self <= other`.
+    pub fn le<O>(&self, other: O) -> PyResult<bool>
+    where
+        O: ToPyObject,
+    {
+        self.as_borrowed().le(other)
+    }
+
+    /// Tests whether this object is equal to another.
+    ///
+    /// This is equivalent to the Python expression `self == other`.
+    pub fn eq<O>(&self, other: O) -> PyResult<bool>
+    where
+        O: ToPyObject,
+    {
+        self.as_borrowed().eq(other)
+    }
+
+    /// Tests whether this object is not equal to another.
+    ///
+    /// This is equivalent to the Python expression `self != other`.
+    pub fn ne<O>(&self, other: O) -> PyResult<bool>
+    where
+        O: ToPyObject,
+    {
+        self.as_borrowed().ne(other)
+    }
+
+    /// Tests whether this object is greater than another.
+    ///
+    /// This is equivalent to the Python expression `self > other`.
+    pub fn gt<O>(&self, other: O) -> PyResult<bool>
+    where
+        O: ToPyObject,
+    {
+        self.as_borrowed().gt(other)
+    }
+
+    /// Tests whether this object is greater than or equal to another.
+    ///
+    /// This is equivalent to the Python expression `self >= other`.
+    pub fn ge<O>(&self, other: O) -> PyResult<bool>
+    where
+        O: ToPyObject,
+    {
+        self.as_borrowed().ge(other)
+    }
+
+    /// Determines whether this object appears callable.
+    ///
+    /// This is equivalent to Python's [`callable()`][1] function.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let builtins = PyModule::import_bound(py, "builtins")?;
+    ///     let print = builtins.getattr("print")?;
+    ///     assert!(print.is_callable());
+    ///     Ok(())
+    /// })?;
+    /// # Ok(())}
+    /// ```
+    ///
+    /// This is equivalent to the Python statement `assert callable(print)`.
+    ///
+    /// Note that unless an API needs to distinguish between callable and
+    /// non-callable objects, there is no point in checking for callability.
+    /// Instead, it is better to just do the call and handle potential
+    /// exceptions.
+    ///
+    /// [1]: https://docs.python.org/3/library/functions.html#callable
+    pub fn is_callable(&self) -> bool {
+        self.as_borrowed().is_callable()
+    }
+
+    /// Calls the object.
+    ///
+    /// This is equivalent to the Python expression `self(*args, **kwargs)`.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyDict;
+    ///
+    /// const CODE: &str = r#"
+    /// def function(*args, **kwargs):
+    ///     assert args == ("hello",)
+    ///     assert kwargs == {"cruel": "world"}
+    ///     return "called with args and kwargs"
+    /// "#;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let module = PyModule::from_code_bound(py, CODE, "", "")?;
+    ///     let fun = module.getattr("function")?;
+    ///     let args = ("hello",);
+    ///     let kwargs = PyDict::new_bound(py);
+    ///     kwargs.set_item("cruel", "world")?;
+    ///     let result = fun.call(args, Some(&kwargs))?;
+    ///     assert_eq!(result.extract::<String>()?, "called with args and kwargs");
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    pub fn call(
+        &self,
+        args: impl IntoPy<Py<PyTuple>>,
+        kwargs: Option<&PyDict>,
+    ) -> PyResult<&PyAny> {
+        self.as_borrowed()
+            .call(args, kwargs.map(PyDict::as_borrowed).as_deref())
+            .map(Bound::into_gil_ref)
+    }
+
+    /// Calls the object without arguments.
+    ///
+    /// This is equivalent to the Python expression `self()`.
+    ///
+    /// # Examples
+    ///
+    /// ```no_run
+    /// use pyo3::prelude::*;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let module = PyModule::import_bound(py, "builtins")?;
+    ///     let help = module.getattr("help")?;
+    ///     help.call0()?;
+    ///     Ok(())
+    /// })?;
+    /// # Ok(())}
+    /// ```
+    ///
+    /// This is equivalent to the Python expression `help()`.
+    pub fn call0(&self) -> PyResult<&PyAny> {
+        self.as_borrowed().call0().map(Bound::into_gil_ref)
+    }
+
+    /// Calls the object with only positional arguments.
+    ///
+    /// This is equivalent to the Python expression `self(*args)`.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// const CODE: &str = r#"
+    /// def function(*args, **kwargs):
+    ///     assert args == ("hello",)
+    ///     assert kwargs == {}
+    ///     return "called with args"
+    /// "#;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let module = PyModule::from_code_bound(py, CODE, "", "")?;
+    ///     let fun = module.getattr("function")?;
+    ///     let args = ("hello",);
+    ///     let result = fun.call1(args)?;
+    ///     assert_eq!(result.extract::<String>()?, "called with args");
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    pub fn call1(&self, args: impl IntoPy<Py<PyTuple>>) -> PyResult<&PyAny> {
+        self.as_borrowed().call1(args).map(Bound::into_gil_ref)
+    }
+
+    /// Calls a method on the object.
+    ///
+    /// This is equivalent to the Python expression `self.name(*args, **kwargs)`.
+    ///
+    /// To avoid repeated temporary allocations of Python strings, the [`intern!`] macro can be used
+    /// to intern `name`.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyDict;
+    ///
+    /// const CODE: &str = r#"
+    /// class A:
+    ///     def method(self, *args, **kwargs):
+    ///         assert args == ("hello",)
+    ///         assert kwargs == {"cruel": "world"}
+    ///         return "called with args and kwargs"
+    /// a = A()
+    /// "#;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let module = PyModule::from_code_bound(py, CODE, "", "")?;
+    ///     let instance = module.getattr("a")?;
+    ///     let args = ("hello",);
+    ///     let kwargs = PyDict::new_bound(py);
+    ///     kwargs.set_item("cruel", "world")?;
+    ///     let result = instance.call_method("method", args, Some(&kwargs))?;
+    ///     assert_eq!(result.extract::<String>()?, "called with args and kwargs");
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    pub fn call_method<N, A>(&self, name: N, args: A, kwargs: Option<&PyDict>) -> PyResult<&PyAny>
+    where
+        N: IntoPy<Py<PyString>>,
+        A: IntoPy<Py<PyTuple>>,
+    {
+        self.as_borrowed()
+            .call_method(name, args, kwargs.map(PyDict::as_borrowed).as_deref())
+            .map(Bound::into_gil_ref)
+    }
+
+    /// Calls a method on the object without arguments.
+    ///
+    /// This is equivalent to the Python expression `self.name()`.
+    ///
+    /// To avoid repeated temporary allocations of Python strings, the [`intern!`] macro can be used
+    /// to intern `name`.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// const CODE: &str = r#"
+    /// class A:
+    ///     def method(self, *args, **kwargs):
+    ///         assert args == ()
+    ///         assert kwargs == {}
+    ///         return "called with no arguments"
+    /// a = A()
+    /// "#;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let module = PyModule::from_code_bound(py, CODE, "", "")?;
+    ///     let instance = module.getattr("a")?;
+    ///     let result = instance.call_method0("method")?;
+    ///     assert_eq!(result.extract::<String>()?, "called with no arguments");
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    pub fn call_method0<N>(&self, name: N) -> PyResult<&PyAny>
+    where
+        N: IntoPy<Py<PyString>>,
+    {
+        self.as_borrowed()
+            .call_method0(name)
+            .map(Bound::into_gil_ref)
+    }
+
+    /// Calls a method on the object with only positional arguments.
+    ///
+    /// This is equivalent to the Python expression `self.name(*args)`.
+    ///
+    /// To avoid repeated temporary allocations of Python strings, the [`intern!`] macro can be used
+    /// to intern `name`.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// const CODE: &str = r#"
+    /// class A:
+    ///     def method(self, *args, **kwargs):
+    ///         assert args == ("hello",)
+    ///         assert kwargs == {}
+    ///         return "called with args"
+    /// a = A()
+    /// "#;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let module = PyModule::from_code_bound(py, CODE, "", "")?;
+    ///     let instance = module.getattr("a")?;
+    ///     let args = ("hello",);
+    ///     let result = instance.call_method1("method", args)?;
+    ///     assert_eq!(result.extract::<String>()?, "called with args");
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    pub fn call_method1<N, A>(&self, name: N, args: A) -> PyResult<&PyAny>
+    where
+        N: IntoPy<Py<PyString>>,
+        A: IntoPy<Py<PyTuple>>,
+    {
+        self.as_borrowed()
+            .call_method1(name, args)
+            .map(Bound::into_gil_ref)
+    }
+
+    /// Returns whether the object is considered to be true.
+    ///
+    /// This is equivalent to the Python expression `bool(self)`.
+    #[deprecated(since = "0.21.0", note = "use `.is_truthy()` instead")]
+    pub fn is_true(&self) -> PyResult<bool> {
+        self.is_truthy()
+    }
+
+    /// Returns whether the object is considered to be true.
+    ///
+    /// This applies truth value testing equivalent to the Python expression `bool(self)`.
+    pub fn is_truthy(&self) -> PyResult<bool> {
+        self.as_borrowed().is_truthy()
+    }
+
+    /// Returns whether the object is considered to be None.
+    ///
+    /// This is equivalent to the Python expression `self is None`.
+    #[inline]
+    pub fn is_none(&self) -> bool {
+        self.as_borrowed().is_none()
+    }
+
+    /// Returns whether the object is Ellipsis, e.g. `...`.
+    ///
+    /// This is equivalent to the Python expression `self is ...`.
+    #[deprecated(since = "0.20.0", note = "use `.is(py.Ellipsis())` instead")]
+    pub fn is_ellipsis(&self) -> bool {
+        self.as_borrowed().is_ellipsis()
+    }
+
+    /// Returns true if the sequence or mapping has a length of 0.
+    ///
+    /// This is equivalent to the Python expression `len(self) == 0`.
+    pub fn is_empty(&self) -> PyResult<bool> {
+        self.as_borrowed().is_empty()
+    }
+
+    /// Gets an item from the collection.
+    ///
+    /// This is equivalent to the Python expression `self[key]`.
+    pub fn get_item<K>(&self, key: K) -> PyResult<&PyAny>
+    where
+        K: ToPyObject,
+    {
+        self.as_borrowed().get_item(key).map(Bound::into_gil_ref)
+    }
+
+    /// Sets a collection item value.
+    ///
+    /// This is equivalent to the Python expression `self[key] = value`.
+    pub fn set_item<K, V>(&self, key: K, value: V) -> PyResult<()>
+    where
+        K: ToPyObject,
+        V: ToPyObject,
+    {
+        self.as_borrowed().set_item(key, value)
+    }
+
+    /// Deletes an item from the collection.
+    ///
+    /// This is equivalent to the Python expression `del self[key]`.
+    pub fn del_item<K>(&self, key: K) -> PyResult<()>
+    where
+        K: ToPyObject,
+    {
+        self.as_borrowed().del_item(key)
+    }
+
+    /// Takes an object and returns an iterator for it.
+    ///
+    /// This is typically a new iterator but if the argument is an iterator,
+    /// this returns itself.
+    pub fn iter(&self) -> PyResult<&PyIterator> {
+        self.as_borrowed().iter().map(Bound::into_gil_ref)
+    }
+
+    /// Returns the Python type object for this object's type.
+    pub fn get_type(&self) -> &PyType {
+        self.as_borrowed().get_type().into_gil_ref()
+    }
+
+    /// Returns the Python type pointer for this object.
+    #[inline]
+    pub fn get_type_ptr(&self) -> *mut ffi::PyTypeObject {
+        self.as_borrowed().get_type_ptr()
+    }
+
+    /// Downcast this `PyAny` to a concrete Python type or pyclass.
+    ///
+    /// Note that you can often avoid downcasting yourself by just specifying
+    /// the desired type in function or method signatures.
+    /// However, manual downcasting is sometimes necessary.
+    ///
+    /// For extracting a Rust-only type, see [`PyAny::extract`](struct.PyAny.html#method.extract).
+    ///
+    /// # Example: Downcasting to a specific Python object
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::{PyDict, PyList};
+    ///
+    /// Python::with_gil(|py| {
+    ///     let dict = PyDict::new_bound(py);
+    ///     assert!(dict.is_instance_of::<PyAny>());
+    ///     let any = dict.as_any();
+    ///
+    ///     assert!(any.downcast::<PyDict>().is_ok());
+    ///     assert!(any.downcast::<PyList>().is_err());
+    /// });
+    /// ```
+    ///
+    /// # Example: Getting a reference to a pyclass
+    ///
+    /// This is useful if you want to mutate a `PyObject` that
+    /// might actually be a pyclass.
+    ///
+    /// ```rust
+    /// # fn main() -> Result<(), pyo3::PyErr> {
+    /// use pyo3::prelude::*;
+    ///
+    /// #[pyclass]
+    /// struct Class {
+    ///     i: i32,
+    /// }
+    ///
+    /// Python::with_gil(|py| {
+    ///     let class = Py::new(py, Class { i: 0 }).unwrap().into_bound(py).into_any();
+    ///
+    ///     let class_bound: &Bound<'_, Class> = class.downcast()?;
+    ///
+    ///     class_bound.borrow_mut().i += 1;
+    ///
+    ///     // Alternatively you can get a `PyRefMut` directly
+    ///     let class_ref: PyRefMut<'_, Class> = class.extract()?;
+    ///     assert_eq!(class_ref.i, 1);
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    #[inline]
+    pub fn downcast<T>(&self) -> Result<&T, PyDowncastError<'_>>
+    where
+        T: PyTypeCheck<AsRefTarget = T>,
+    {
+        if T::type_check(&self.as_borrowed()) {
+            // Safety: type_check is responsible for ensuring that the type is correct
+            Ok(unsafe { self.downcast_unchecked() })
+        } else {
+            Err(PyDowncastError::new(self, T::NAME))
+        }
+    }
+
+    /// Downcast this `PyAny` to a concrete Python type or pyclass (but not a subclass of it).
+    ///
+    /// It is almost always better to use [`PyAny::downcast`] because it accounts for Python
+    /// subtyping. Use this method only when you do not want to allow subtypes.
+    ///
+    /// The advantage of this method over [`PyAny::downcast`] is that it is faster. The implementation
+    /// of `downcast_exact` uses the equivalent of the Python expression `type(self) is T`, whereas
+    /// `downcast` uses `isinstance(self, T)`.
+    ///
+    /// For extracting a Rust-only type, see [`PyAny::extract`](struct.PyAny.html#method.extract).
+    ///
+    /// # Example: Downcasting to a specific Python object but not a subtype
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::{PyBool, PyLong};
+    ///
+    /// Python::with_gil(|py| {
+    ///     let b = PyBool::new_bound(py, true);
+    ///     assert!(b.is_instance_of::<PyBool>());
+    ///     let any: &Bound<'_, PyAny> = b.as_any();
+    ///
+    ///     // `bool` is a subtype of `int`, so `downcast` will accept a `bool` as an `int`
+    ///     // but `downcast_exact` will not.
+    ///     assert!(any.downcast::<PyLong>().is_ok());
+    ///     assert!(any.downcast_exact::<PyLong>().is_err());
+    ///
+    ///     assert!(any.downcast_exact::<PyBool>().is_ok());
+    /// });
+    /// ```
+    #[inline]
+    pub fn downcast_exact<T>(&self) -> Result<&T, PyDowncastError<'_>>
+    where
+        T: PyTypeInfo<AsRefTarget = T>,
+    {
+        if T::is_exact_type_of_bound(&self.as_borrowed()) {
+            // Safety: type_check is responsible for ensuring that the type is correct
+            Ok(unsafe { self.downcast_unchecked() })
+        } else {
+            Err(PyDowncastError::new(self, T::NAME))
+        }
+    }
+
+    /// Converts this `PyAny` to a concrete Python type without checking validity.
+    ///
+    /// # Safety
+    ///
+    /// Callers must ensure that the type is valid or risk type confusion.
+    #[inline]
+    pub unsafe fn downcast_unchecked<T>(&self) -> &T
+    where
+        T: HasPyGilRef<AsRefTarget = T>,
+    {
+        &*(self.as_ptr() as *const T)
+    }
+
+    /// Extracts some type from the Python object.
+    ///
+    /// This is a wrapper function around
+    /// [`FromPyObject::extract()`](crate::FromPyObject::extract).
+    #[inline]
+    pub fn extract<'py, D>(&'py self) -> PyResult<D>
+    where
+        D: FromPyObjectBound<'py, 'py>,
+    {
+        FromPyObjectBound::from_py_object_bound(self.as_borrowed())
+    }
+
+    /// Returns the reference count for the Python object.
+    pub fn get_refcnt(&self) -> isize {
+        self.as_borrowed().get_refcnt()
+    }
+
+    /// Computes the "repr" representation of self.
+    ///
+    /// This is equivalent to the Python expression `repr(self)`.
+    pub fn repr(&self) -> PyResult<&PyString> {
+        self.as_borrowed().repr().map(Bound::into_gil_ref)
+    }
+
+    /// Computes the "str" representation of self.
+    ///
+    /// This is equivalent to the Python expression `str(self)`.
+    pub fn str(&self) -> PyResult<&PyString> {
+        self.as_borrowed().str().map(Bound::into_gil_ref)
+    }
+
+    /// Retrieves the hash code of self.
+    ///
+    /// This is equivalent to the Python expression `hash(self)`.
+    pub fn hash(&self) -> PyResult<isize> {
+        self.as_borrowed().hash()
+    }
+
+    /// Returns the length of the sequence or mapping.
+    ///
+    /// This is equivalent to the Python expression `len(self)`.
+    pub fn len(&self) -> PyResult<usize> {
+        self.as_borrowed().len()
+    }
+
+    /// Returns the list of attributes of this object.
+    ///
+    /// This is equivalent to the Python expression `dir(self)`.
+    pub fn dir(&self) -> PyResult<&PyList> {
+        self.as_borrowed().dir().map(Bound::into_gil_ref)
+    }
+
+    /// Checks whether this object is an instance of type `ty`.
+    ///
+    /// This is equivalent to the Python expression `isinstance(self, ty)`.
+    #[inline]
+    pub fn is_instance(&self, ty: &PyAny) -> PyResult<bool> {
+        self.as_borrowed().is_instance(&ty.as_borrowed())
+    }
+
+    /// Checks whether this object is an instance of exactly type `ty` (not a subclass).
+    ///
+    /// This is equivalent to the Python expression `type(self) is ty`.
+    #[inline]
+    pub fn is_exact_instance(&self, ty: &PyAny) -> bool {
+        self.as_borrowed().is_exact_instance(&ty.as_borrowed())
+    }
+
+    /// Checks whether this object is an instance of type `T`.
+    ///
+    /// This is equivalent to the Python expression `isinstance(self, T)`,
+    /// if the type `T` is known at compile time.
+    #[inline]
+    pub fn is_instance_of<T: PyTypeInfo>(&self) -> bool {
+        self.as_borrowed().is_instance_of::<T>()
+    }
+
+    /// Checks whether this object is an instance of exactly type `T`.
+    ///
+    /// This is equivalent to the Python expression `type(self) is T`,
+    /// if the type `T` is known at compile time.
+    #[inline]
+    pub fn is_exact_instance_of<T: PyTypeInfo>(&self) -> bool {
+        self.as_borrowed().is_exact_instance_of::<T>()
+    }
+
+    /// Determines if self contains `value`.
+    ///
+    /// This is equivalent to the Python expression `value in self`.
+    pub fn contains<V>(&self, value: V) -> PyResult<bool>
+    where
+        V: ToPyObject,
+    {
+        self.as_borrowed().contains(value)
+    }
+
+    /// Returns a GIL marker constrained to the lifetime of this type.
+    #[inline]
+    pub fn py(&self) -> Python<'_> {
+        PyNativeType::py(self)
+    }
+
+    /// Returns the raw FFI pointer represented by self.
+    ///
+    /// # Safety
+    ///
+    /// Callers are responsible for ensuring that the pointer does not outlive self.
+    ///
+    /// The reference is borrowed; callers should not decrease the reference count
+    /// when they are finished with the pointer.
+    #[inline]
+    pub fn as_ptr(&self) -> *mut ffi::PyObject {
+        ptr_from_ref(self) as *mut ffi::PyObject
+    }
+
+    /// Returns an owned raw FFI pointer represented by self.
+    ///
+    /// # Safety
+    ///
+    /// The reference is owned; when finished the caller should either transfer ownership
+    /// of the pointer or decrease the reference count (e.g. with [`pyo3::ffi::Py_DecRef`](crate::ffi::Py_DecRef)).
+    #[inline]
+    pub fn into_ptr(&self) -> *mut ffi::PyObject {
+        // Safety: self.as_ptr() returns a valid non-null pointer
+        let ptr = self.as_ptr();
+        unsafe { ffi::Py_INCREF(ptr) };
+        ptr
+    }
+
+    /// Return a proxy object that delegates method calls to a parent or sibling class of type.
+    ///
+    /// This is equivalent to the Python expression `super()`
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn py_super(&self) -> PyResult<&PySuper> {
+        self.as_borrowed().py_super().map(Bound::into_gil_ref)
+    }
+}
+
+/// This trait represents the Python APIs which are usable on all Python objects.
+///
+/// It is recommended you import this trait via `use pyo3::prelude::*` rather than
+/// by importing this trait directly.
+#[doc(alias = "PyAny")]
+pub trait PyAnyMethods<'py>: crate::sealed::Sealed {
+    /// Returns whether `self` and `other` point to the same object. To compare
+    /// the equality of two objects (the `==` operator), use [`eq`](PyAnyMethods::eq).
+    ///
+    /// This is equivalent to the Python expression `self is other`.
+    fn is<T: AsPyPointer>(&self, other: &T) -> bool;
+
+    /// Determines whether this object has the given attribute.
+    ///
+    /// This is equivalent to the Python expression `hasattr(self, attr_name)`.
+    ///
+    /// To avoid repeated temporary allocations of Python strings, the [`intern!`] macro can be used
+    /// to intern `attr_name`.
+    ///
+    /// # Example: `intern!`ing the attribute name
+    ///
+    /// ```
+    /// # use pyo3::{prelude::*, intern};
+    /// #
+    /// #[pyfunction]
+    /// fn has_version(sys: &Bound<'_, PyModule>) -> PyResult<bool> {
+    ///     sys.hasattr(intern!(sys.py(), "version"))
+    /// }
+    /// #
+    /// # Python::with_gil(|py| {
+    /// #    let sys = py.import_bound("sys").unwrap();
+    /// #    has_version(&sys).unwrap();
+    /// # });
+    /// ```
+    fn hasattr<N>(&self, attr_name: N) -> PyResult<bool>
+    where
+        N: IntoPy<Py<PyString>>;
+
+    /// Retrieves an attribute value.
+    ///
+    /// This is equivalent to the Python expression `self.attr_name`.
+    ///
+    /// To avoid repeated temporary allocations of Python strings, the [`intern!`] macro can be used
+    /// to intern `attr_name`.
+    ///
+    /// # Example: `intern!`ing the attribute name
+    ///
+    /// ```
+    /// # use pyo3::{prelude::*, intern};
+    /// #
+    /// #[pyfunction]
+    /// fn version<'py>(sys: &Bound<'py, PyModule>) -> PyResult<Bound<'py, PyAny>> {
+    ///     sys.getattr(intern!(sys.py(), "version"))
+    /// }
+    /// #
+    /// # Python::with_gil(|py| {
+    /// #    let sys = py.import_bound("sys").unwrap();
+    /// #    version(&sys).unwrap();
+    /// # });
+    /// ```
+    fn getattr<N>(&self, attr_name: N) -> PyResult<Bound<'py, PyAny>>
+    where
+        N: IntoPy<Py<PyString>>;
+
+    /// Sets an attribute value.
+    ///
+    /// This is equivalent to the Python expression `self.attr_name = value`.
+    ///
+    /// To avoid repeated temporary allocations of Python strings, the [`intern!`] macro can be used
+    /// to intern `name`.
+    ///
+    /// # Example: `intern!`ing the attribute name
+    ///
+    /// ```
+    /// # use pyo3::{prelude::*, intern};
+    /// #
+    /// #[pyfunction]
+    /// fn set_answer(ob: &Bound<'_, PyAny>) -> PyResult<()> {
+    ///     ob.setattr(intern!(ob.py(), "answer"), 42)
+    /// }
+    /// #
+    /// # Python::with_gil(|py| {
+    /// #    let ob = PyModule::new_bound(py, "empty").unwrap();
+    /// #    set_answer(&ob).unwrap();
+    /// # });
+    /// ```
+    fn setattr<N, V>(&self, attr_name: N, value: V) -> PyResult<()>
+    where
+        N: IntoPy<Py<PyString>>,
+        V: ToPyObject;
+
+    /// Deletes an attribute.
+    ///
+    /// This is equivalent to the Python statement `del self.attr_name`.
+    ///
+    /// To avoid repeated temporary allocations of Python strings, the [`intern!`] macro can be used
+    /// to intern `attr_name`.
+    fn delattr<N>(&self, attr_name: N) -> PyResult<()>
+    where
+        N: IntoPy<Py<PyString>>;
+
+    /// Returns an [`Ordering`] between `self` and `other`.
+    ///
+    /// This is equivalent to the following Python code:
+    /// ```python
+    /// if self == other:
+    ///     return Equal
+    /// elif a < b:
+    ///     return Less
+    /// elif a > b:
+    ///     return Greater
+    /// else:
+    ///     raise TypeError("PyAny::compare(): All comparisons returned false")
+    /// ```
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyFloat;
+    /// use std::cmp::Ordering;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let a = PyFloat::new_bound(py, 0_f64);
+    ///     let b = PyFloat::new_bound(py, 42_f64);
+    ///     assert_eq!(a.compare(b)?, Ordering::Less);
+    ///     Ok(())
+    /// })?;
+    /// # Ok(())}
+    /// ```
+    ///
+    /// It will return `PyErr` for values that cannot be compared:
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::{PyFloat, PyString};
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let a = PyFloat::new_bound(py, 0_f64);
+    ///     let b = PyString::new_bound(py, "zero");
+    ///     assert!(a.compare(b).is_err());
+    ///     Ok(())
+    /// })?;
+    /// # Ok(())}
+    /// ```
+    fn compare<O>(&self, other: O) -> PyResult<Ordering>
+    where
+        O: ToPyObject;
+
+    /// Tests whether two Python objects obey a given [`CompareOp`].
+    ///
+    /// [`lt`](Self::lt), [`le`](Self::le), [`eq`](Self::eq), [`ne`](Self::ne),
+    /// [`gt`](Self::gt) and [`ge`](Self::ge) are the specialized versions
+    /// of this function.
+    ///
+    /// Depending on the value of `compare_op`, this is equivalent to one of the
+    /// following Python expressions:
+    ///
+    /// | `compare_op` | Python expression |
+    /// | :---: | :----: |
+    /// | [`CompareOp::Eq`] | `self == other` |
+    /// | [`CompareOp::Ne`] | `self != other` |
+    /// | [`CompareOp::Lt`] | `self < other` |
+    /// | [`CompareOp::Le`] | `self <= other` |
+    /// | [`CompareOp::Gt`] | `self > other` |
+    /// | [`CompareOp::Ge`] | `self >= other` |
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::class::basic::CompareOp;
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyInt;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let a: Bound<'_, PyInt> = 0_u8.into_py(py).into_bound(py).downcast_into()?;
+    ///     let b: Bound<'_, PyInt> = 42_u8.into_py(py).into_bound(py).downcast_into()?;
+    ///     assert!(a.rich_compare(b, CompareOp::Le)?.is_truthy()?);
+    ///     Ok(())
+    /// })?;
+    /// # Ok(())}
+    /// ```
+    fn rich_compare<O>(&self, other: O, compare_op: CompareOp) -> PyResult<Bound<'py, PyAny>>
+    where
+        O: ToPyObject;
+
+    /// Computes the negative of self.
+    ///
+    /// Equivalent to the Python expression `-self`.
+    fn neg(&self) -> PyResult<Bound<'py, PyAny>>;
+
+    /// Computes the positive of self.
+    ///
+    /// Equivalent to the Python expression `+self`.
+    fn pos(&self) -> PyResult<Bound<'py, PyAny>>;
+
+    /// Computes the absolute of self.
+    ///
+    /// Equivalent to the Python expression `abs(self)`.
+    fn abs(&self) -> PyResult<Bound<'py, PyAny>>;
+
+    /// Computes `~self`.
+    fn bitnot(&self) -> PyResult<Bound<'py, PyAny>>;
+
+    /// Tests whether this object is less than another.
+    ///
+    /// This is equivalent to the Python expression `self < other`.
+    fn lt<O>(&self, other: O) -> PyResult<bool>
+    where
+        O: ToPyObject;
+
+    /// Tests whether this object is less than or equal to another.
+    ///
+    /// This is equivalent to the Python expression `self <= other`.
+    fn le<O>(&self, other: O) -> PyResult<bool>
+    where
+        O: ToPyObject;
+
+    /// Tests whether this object is equal to another.
+    ///
+    /// This is equivalent to the Python expression `self == other`.
+    fn eq<O>(&self, other: O) -> PyResult<bool>
+    where
+        O: ToPyObject;
+
+    /// Tests whether this object is not equal to another.
+    ///
+    /// This is equivalent to the Python expression `self != other`.
+    fn ne<O>(&self, other: O) -> PyResult<bool>
+    where
+        O: ToPyObject;
+
+    /// Tests whether this object is greater than another.
+    ///
+    /// This is equivalent to the Python expression `self > other`.
+    fn gt<O>(&self, other: O) -> PyResult<bool>
+    where
+        O: ToPyObject;
+
+    /// Tests whether this object is greater than or equal to another.
+    ///
+    /// This is equivalent to the Python expression `self >= other`.
+    fn ge<O>(&self, other: O) -> PyResult<bool>
+    where
+        O: ToPyObject;
+
+    /// Computes `self + other`.
+    fn add<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>
+    where
+        O: ToPyObject;
+
+    /// Computes `self - other`.
+    fn sub<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>
+    where
+        O: ToPyObject;
+
+    /// Computes `self * other`.
+    fn mul<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>
+    where
+        O: ToPyObject;
+
+    /// Computes `self @ other`.
+    fn matmul<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>
+    where
+        O: ToPyObject;
+
+    /// Computes `self / other`.
+    fn div<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>
+    where
+        O: ToPyObject;
+
+    /// Computes `self // other`.
+    fn floor_div<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>
+    where
+        O: ToPyObject;
+
+    /// Computes `self % other`.
+    fn rem<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>
+    where
+        O: ToPyObject;
+
+    /// Computes `divmod(self, other)`.
+    fn divmod<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>
+    where
+        O: ToPyObject;
+
+    /// Computes `self << other`.
+    fn lshift<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>
+    where
+        O: ToPyObject;
+
+    /// Computes `self >> other`.
+    fn rshift<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>
+    where
+        O: ToPyObject;
+
+    /// Computes `self ** other % modulus` (`pow(self, other, modulus)`).
+    /// `py.None()` may be passed for the `modulus`.
+    fn pow<O1, O2>(&self, other: O1, modulus: O2) -> PyResult<Bound<'py, PyAny>>
+    where
+        O1: ToPyObject,
+        O2: ToPyObject;
+
+    /// Computes `self & other`.
+    fn bitand<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>
+    where
+        O: ToPyObject;
+
+    /// Computes `self | other`.
+    fn bitor<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>
+    where
+        O: ToPyObject;
+
+    /// Computes `self ^ other`.
+    fn bitxor<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>
+    where
+        O: ToPyObject;
+
+    /// Determines whether this object appears callable.
+    ///
+    /// This is equivalent to Python's [`callable()`][1] function.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let builtins = PyModule::import_bound(py, "builtins")?;
+    ///     let print = builtins.getattr("print")?;
+    ///     assert!(print.is_callable());
+    ///     Ok(())
+    /// })?;
+    /// # Ok(())}
+    /// ```
+    ///
+    /// This is equivalent to the Python statement `assert callable(print)`.
+    ///
+    /// Note that unless an API needs to distinguish between callable and
+    /// non-callable objects, there is no point in checking for callability.
+    /// Instead, it is better to just do the call and handle potential
+    /// exceptions.
+    ///
+    /// [1]: https://docs.python.org/3/library/functions.html#callable
+    fn is_callable(&self) -> bool;
+
+    /// Calls the object.
+    ///
+    /// This is equivalent to the Python expression `self(*args, **kwargs)`.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyDict;
+    ///
+    /// const CODE: &str = r#"
+    /// def function(*args, **kwargs):
+    ///     assert args == ("hello",)
+    ///     assert kwargs == {"cruel": "world"}
+    ///     return "called with args and kwargs"
+    /// "#;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let module = PyModule::from_code_bound(py, CODE, "", "")?;
+    ///     let fun = module.getattr("function")?;
+    ///     let args = ("hello",);
+    ///     let kwargs = PyDict::new_bound(py);
+    ///     kwargs.set_item("cruel", "world")?;
+    ///     let result = fun.call(args, Some(&kwargs))?;
+    ///     assert_eq!(result.extract::<String>()?, "called with args and kwargs");
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    fn call(
+        &self,
+        args: impl IntoPy<Py<PyTuple>>,
+        kwargs: Option<&Bound<'_, PyDict>>,
+    ) -> PyResult<Bound<'py, PyAny>>;
+
+    /// Calls the object without arguments.
+    ///
+    /// This is equivalent to the Python expression `self()`.
+    ///
+    /// # Examples
+    ///
+    /// ```no_run
+    /// use pyo3::prelude::*;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let module = PyModule::import_bound(py, "builtins")?;
+    ///     let help = module.getattr("help")?;
+    ///     help.call0()?;
+    ///     Ok(())
+    /// })?;
+    /// # Ok(())}
+    /// ```
+    ///
+    /// This is equivalent to the Python expression `help()`.
+    fn call0(&self) -> PyResult<Bound<'py, PyAny>>;
+
+    /// Calls the object with only positional arguments.
+    ///
+    /// This is equivalent to the Python expression `self(*args)`.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// const CODE: &str = r#"
+    /// def function(*args, **kwargs):
+    ///     assert args == ("hello",)
+    ///     assert kwargs == {}
+    ///     return "called with args"
+    /// "#;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let module = PyModule::from_code_bound(py, CODE, "", "")?;
+    ///     let fun = module.getattr("function")?;
+    ///     let args = ("hello",);
+    ///     let result = fun.call1(args)?;
+    ///     assert_eq!(result.extract::<String>()?, "called with args");
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    fn call1(&self, args: impl IntoPy<Py<PyTuple>>) -> PyResult<Bound<'py, PyAny>>;
+
+    /// Calls a method on the object.
+    ///
+    /// This is equivalent to the Python expression `self.name(*args, **kwargs)`.
+    ///
+    /// To avoid repeated temporary allocations of Python strings, the [`intern!`] macro can be used
+    /// to intern `name`.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyDict;
+    ///
+    /// const CODE: &str = r#"
+    /// class A:
+    ///     def method(self, *args, **kwargs):
+    ///         assert args == ("hello",)
+    ///         assert kwargs == {"cruel": "world"}
+    ///         return "called with args and kwargs"
+    /// a = A()
+    /// "#;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let module = PyModule::from_code_bound(py, CODE, "", "")?;
+    ///     let instance = module.getattr("a")?;
+    ///     let args = ("hello",);
+    ///     let kwargs = PyDict::new_bound(py);
+    ///     kwargs.set_item("cruel", "world")?;
+    ///     let result = instance.call_method("method", args, Some(&kwargs))?;
+    ///     assert_eq!(result.extract::<String>()?, "called with args and kwargs");
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    fn call_method<N, A>(
+        &self,
+        name: N,
+        args: A,
+        kwargs: Option<&Bound<'_, PyDict>>,
+    ) -> PyResult<Bound<'py, PyAny>>
+    where
+        N: IntoPy<Py<PyString>>,
+        A: IntoPy<Py<PyTuple>>;
+
+    /// Calls a method on the object without arguments.
+    ///
+    /// This is equivalent to the Python expression `self.name()`.
+    ///
+    /// To avoid repeated temporary allocations of Python strings, the [`intern!`] macro can be used
+    /// to intern `name`.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// const CODE: &str = r#"
+    /// class A:
+    ///     def method(self, *args, **kwargs):
+    ///         assert args == ()
+    ///         assert kwargs == {}
+    ///         return "called with no arguments"
+    /// a = A()
+    /// "#;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let module = PyModule::from_code_bound(py, CODE, "", "")?;
+    ///     let instance = module.getattr("a")?;
+    ///     let result = instance.call_method0("method")?;
+    ///     assert_eq!(result.extract::<String>()?, "called with no arguments");
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    fn call_method0<N>(&self, name: N) -> PyResult<Bound<'py, PyAny>>
+    where
+        N: IntoPy<Py<PyString>>;
+
+    /// Calls a method on the object with only positional arguments.
+    ///
+    /// This is equivalent to the Python expression `self.name(*args)`.
+    ///
+    /// To avoid repeated temporary allocations of Python strings, the [`intern!`] macro can be used
+    /// to intern `name`.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// const CODE: &str = r#"
+    /// class A:
+    ///     def method(self, *args, **kwargs):
+    ///         assert args == ("hello",)
+    ///         assert kwargs == {}
+    ///         return "called with args"
+    /// a = A()
+    /// "#;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let module = PyModule::from_code_bound(py, CODE, "", "")?;
+    ///     let instance = module.getattr("a")?;
+    ///     let args = ("hello",);
+    ///     let result = instance.call_method1("method", args)?;
+    ///     assert_eq!(result.extract::<String>()?, "called with args");
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    fn call_method1<N, A>(&self, name: N, args: A) -> PyResult<Bound<'py, PyAny>>
+    where
+        N: IntoPy<Py<PyString>>,
+        A: IntoPy<Py<PyTuple>>;
+
+    /// Returns whether the object is considered to be true.
+    ///
+    /// This is equivalent to the Python expression `bool(self)`.
+    fn is_truthy(&self) -> PyResult<bool>;
+
+    /// Returns whether the object is considered to be None.
+    ///
+    /// This is equivalent to the Python expression `self is None`.
+    fn is_none(&self) -> bool;
+
+    /// Returns whether the object is Ellipsis, e.g. `...`.
+    ///
+    /// This is equivalent to the Python expression `self is ...`.
+    fn is_ellipsis(&self) -> bool;
+
+    /// Returns true if the sequence or mapping has a length of 0.
+    ///
+    /// This is equivalent to the Python expression `len(self) == 0`.
+    fn is_empty(&self) -> PyResult<bool>;
+
+    /// Gets an item from the collection.
+    ///
+    /// This is equivalent to the Python expression `self[key]`.
+    fn get_item<K>(&self, key: K) -> PyResult<Bound<'py, PyAny>>
+    where
+        K: ToPyObject;
+
+    /// Sets a collection item value.
+    ///
+    /// This is equivalent to the Python expression `self[key] = value`.
+    fn set_item<K, V>(&self, key: K, value: V) -> PyResult<()>
+    where
+        K: ToPyObject,
+        V: ToPyObject;
+
+    /// Deletes an item from the collection.
+    ///
+    /// This is equivalent to the Python expression `del self[key]`.
+    fn del_item<K>(&self, key: K) -> PyResult<()>
+    where
+        K: ToPyObject;
+
+    /// Takes an object and returns an iterator for it.
+    ///
+    /// This is typically a new iterator but if the argument is an iterator,
+    /// this returns itself.
+    fn iter(&self) -> PyResult<Bound<'py, PyIterator>>;
+
+    /// Returns the Python type object for this object's type.
+    fn get_type(&self) -> Bound<'py, PyType>;
+
+    /// Returns the Python type pointer for this object.
+    fn get_type_ptr(&self) -> *mut ffi::PyTypeObject;
+
+    /// Downcast this `PyAny` to a concrete Python type or pyclass.
+    ///
+    /// Note that you can often avoid downcasting yourself by just specifying
+    /// the desired type in function or method signatures.
+    /// However, manual downcasting is sometimes necessary.
+    ///
+    /// For extracting a Rust-only type, see [`PyAny::extract`](struct.PyAny.html#method.extract).
+    ///
+    /// # Example: Downcasting to a specific Python object
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::{PyDict, PyList};
+    ///
+    /// Python::with_gil(|py| {
+    ///     let dict = PyDict::new_bound(py);
+    ///     assert!(dict.is_instance_of::<PyAny>());
+    ///     let any = dict.as_any();
+    ///
+    ///     assert!(any.downcast::<PyDict>().is_ok());
+    ///     assert!(any.downcast::<PyList>().is_err());
+    /// });
+    /// ```
+    ///
+    /// # Example: Getting a reference to a pyclass
+    ///
+    /// This is useful if you want to mutate a `PyObject` that
+    /// might actually be a pyclass.
+    ///
+    /// ```rust
+    /// # fn main() -> Result<(), pyo3::PyErr> {
+    /// use pyo3::prelude::*;
+    ///
+    /// #[pyclass]
+    /// struct Class {
+    ///     i: i32,
+    /// }
+    ///
+    /// Python::with_gil(|py| {
+    ///     let class = Py::new(py, Class { i: 0 }).unwrap().into_bound(py).into_any();
+    ///
+    ///     let class_bound: &Bound<'_, Class> = class.downcast()?;
+    ///
+    ///     class_bound.borrow_mut().i += 1;
+    ///
+    ///     // Alternatively you can get a `PyRefMut` directly
+    ///     let class_ref: PyRefMut<'_, Class> = class.extract()?;
+    ///     assert_eq!(class_ref.i, 1);
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    fn downcast<T>(&self) -> Result<&Bound<'py, T>, DowncastError<'_, 'py>>
+    where
+        T: PyTypeCheck;
+
+    /// Like `downcast` but takes ownership of `self`.
+    ///
+    /// In case of an error, it is possible to retrieve `self` again via [`DowncastIntoError::into_inner`].
+    ///
+    /// # Example
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::{PyDict, PyList};
+    ///
+    /// Python::with_gil(|py| {
+    ///     let obj: Bound<'_, PyAny> = PyDict::new_bound(py).into_any();
+    ///
+    ///     let obj: Bound<'_, PyAny> = match obj.downcast_into::<PyList>() {
+    ///         Ok(_) => panic!("obj should not be a list"),
+    ///         Err(err) => err.into_inner(),
+    ///     };
+    ///
+    ///     // obj is a dictionary
+    ///     assert!(obj.downcast_into::<PyDict>().is_ok());
+    /// })
+    /// ```
+    fn downcast_into<T>(self) -> Result<Bound<'py, T>, DowncastIntoError<'py>>
+    where
+        T: PyTypeCheck;
+
+    /// Downcast this `PyAny` to a concrete Python type or pyclass (but not a subclass of it).
+    ///
+    /// It is almost always better to use [`PyAnyMethods::downcast`] because it accounts for Python
+    /// subtyping. Use this method only when you do not want to allow subtypes.
+    ///
+    /// The advantage of this method over [`PyAnyMethods::downcast`] is that it is faster. The implementation
+    /// of `downcast_exact` uses the equivalent of the Python expression `type(self) is T`, whereas
+    /// `downcast` uses `isinstance(self, T)`.
+    ///
+    /// For extracting a Rust-only type, see [`PyAny::extract`](struct.PyAny.html#method.extract).
+    ///
+    /// # Example: Downcasting to a specific Python object but not a subtype
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::{PyBool, PyLong};
+    ///
+    /// Python::with_gil(|py| {
+    ///     let b = PyBool::new_bound(py, true);
+    ///     assert!(b.is_instance_of::<PyBool>());
+    ///     let any: &Bound<'_, PyAny> = b.as_any();
+    ///
+    ///     // `bool` is a subtype of `int`, so `downcast` will accept a `bool` as an `int`
+    ///     // but `downcast_exact` will not.
+    ///     assert!(any.downcast::<PyLong>().is_ok());
+    ///     assert!(any.downcast_exact::<PyLong>().is_err());
+    ///
+    ///     assert!(any.downcast_exact::<PyBool>().is_ok());
+    /// });
+    /// ```
+    fn downcast_exact<T>(&self) -> Result<&Bound<'py, T>, DowncastError<'_, 'py>>
+    where
+        T: PyTypeInfo;
+
+    /// Like `downcast_exact` but takes ownership of `self`.
+    fn downcast_into_exact<T>(self) -> Result<Bound<'py, T>, DowncastIntoError<'py>>
+    where
+        T: PyTypeInfo;
+
+    /// Converts this `PyAny` to a concrete Python type without checking validity.
+    ///
+    /// # Safety
+    ///
+    /// Callers must ensure that the type is valid or risk type confusion.
+    unsafe fn downcast_unchecked<T>(&self) -> &Bound<'py, T>;
+
+    /// Like `downcast_unchecked` but takes ownership of `self`.
+    ///
+    /// # Safety
+    ///
+    /// Callers must ensure that the type is valid or risk type confusion.
+    unsafe fn downcast_into_unchecked<T>(self) -> Bound<'py, T>;
+
+    /// Extracts some type from the Python object.
+    ///
+    /// This is a wrapper function around
+    /// [`FromPyObject::extract_bound()`](crate::FromPyObject::extract_bound).
+    fn extract<'a, T>(&'a self) -> PyResult<T>
+    where
+        T: FromPyObjectBound<'a, 'py>;
+
+    /// Returns the reference count for the Python object.
+    fn get_refcnt(&self) -> isize;
+
+    /// Computes the "repr" representation of self.
+    ///
+    /// This is equivalent to the Python expression `repr(self)`.
+    fn repr(&self) -> PyResult<Bound<'py, PyString>>;
+
+    /// Computes the "str" representation of self.
+    ///
+    /// This is equivalent to the Python expression `str(self)`.
+    fn str(&self) -> PyResult<Bound<'py, PyString>>;
+
+    /// Retrieves the hash code of self.
+    ///
+    /// This is equivalent to the Python expression `hash(self)`.
+    fn hash(&self) -> PyResult<isize>;
+
+    /// Returns the length of the sequence or mapping.
+    ///
+    /// This is equivalent to the Python expression `len(self)`.
+    fn len(&self) -> PyResult<usize>;
+
+    /// Returns the list of attributes of this object.
+    ///
+    /// This is equivalent to the Python expression `dir(self)`.
+    fn dir(&self) -> PyResult<Bound<'py, PyList>>;
+
+    /// Checks whether this object is an instance of type `ty`.
+    ///
+    /// This is equivalent to the Python expression `isinstance(self, ty)`.
+    fn is_instance(&self, ty: &Bound<'py, PyAny>) -> PyResult<bool>;
+
+    /// Checks whether this object is an instance of exactly type `ty` (not a subclass).
+    ///
+    /// This is equivalent to the Python expression `type(self) is ty`.
+    fn is_exact_instance(&self, ty: &Bound<'py, PyAny>) -> bool;
+
+    /// Checks whether this object is an instance of type `T`.
+    ///
+    /// This is equivalent to the Python expression `isinstance(self, T)`,
+    /// if the type `T` is known at compile time.
+    fn is_instance_of<T: PyTypeInfo>(&self) -> bool;
+
+    /// Checks whether this object is an instance of exactly type `T`.
+    ///
+    /// This is equivalent to the Python expression `type(self) is T`,
+    /// if the type `T` is known at compile time.
+    fn is_exact_instance_of<T: PyTypeInfo>(&self) -> bool;
+
+    /// Determines if self contains `value`.
+    ///
+    /// This is equivalent to the Python expression `value in self`.
+    fn contains<V>(&self, value: V) -> PyResult<bool>
+    where
+        V: ToPyObject;
+
+    /// Return a proxy object that delegates method calls to a parent or sibling class of type.
+    ///
+    /// This is equivalent to the Python expression `super()`
+    #[cfg(not(any(PyPy, GraalPy)))]
+    fn py_super(&self) -> PyResult<Bound<'py, PySuper>>;
+}
+
+macro_rules! implement_binop {
+    ($name:ident, $c_api:ident, $op:expr) => {
+        #[doc = concat!("Computes `self ", $op, " other`.")]
+        fn $name<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>
+        where
+            O: ToPyObject,
+        {
+            fn inner<'py>(
+                any: &Bound<'py, PyAny>,
+                other: Bound<'_, PyAny>,
+            ) -> PyResult<Bound<'py, PyAny>> {
+                unsafe { ffi::$c_api(any.as_ptr(), other.as_ptr()).assume_owned_or_err(any.py()) }
+            }
+
+            let py = self.py();
+            inner(self, other.to_object(py).into_bound(py))
+        }
+    };
+}
+
+impl<'py> PyAnyMethods<'py> for Bound<'py, PyAny> {
+    #[inline]
+    fn is<T: AsPyPointer>(&self, other: &T) -> bool {
+        self.as_ptr() == other.as_ptr()
+    }
+
+    fn hasattr<N>(&self, attr_name: N) -> PyResult<bool>
+    where
+        N: IntoPy<Py<PyString>>,
+    {
+        // PyObject_HasAttr suppresses all exceptions, which was the behaviour of `hasattr` in Python 2.
+        // Use an implementation which suppresses only AttributeError, which is consistent with `hasattr` in Python 3.
+        fn inner(py: Python<'_>, getattr_result: PyResult<Bound<'_, PyAny>>) -> PyResult<bool> {
+            match getattr_result {
+                Ok(_) => Ok(true),
+                Err(err) if err.is_instance_of::<PyAttributeError>(py) => Ok(false),
+                Err(e) => Err(e),
+            }
+        }
+
+        inner(self.py(), self.getattr(attr_name))
+    }
+
+    fn getattr<N>(&self, attr_name: N) -> PyResult<Bound<'py, PyAny>>
+    where
+        N: IntoPy<Py<PyString>>,
+    {
+        fn inner<'py>(
+            any: &Bound<'py, PyAny>,
+            attr_name: Bound<'_, PyString>,
+        ) -> PyResult<Bound<'py, PyAny>> {
+            unsafe {
+                ffi::PyObject_GetAttr(any.as_ptr(), attr_name.as_ptr())
+                    .assume_owned_or_err(any.py())
+            }
+        }
+
+        let py = self.py();
+        inner(self, attr_name.into_py(self.py()).into_bound(py))
+    }
+
+    fn setattr<N, V>(&self, attr_name: N, value: V) -> PyResult<()>
+    where
+        N: IntoPy<Py<PyString>>,
+        V: ToPyObject,
+    {
+        fn inner(
+            any: &Bound<'_, PyAny>,
+            attr_name: Bound<'_, PyString>,
+            value: Bound<'_, PyAny>,
+        ) -> PyResult<()> {
+            err::error_on_minusone(any.py(), unsafe {
+                ffi::PyObject_SetAttr(any.as_ptr(), attr_name.as_ptr(), value.as_ptr())
+            })
+        }
+
+        let py = self.py();
+        inner(
+            self,
+            attr_name.into_py(py).into_bound(py),
+            value.to_object(py).into_bound(py),
+        )
+    }
+
+    fn delattr<N>(&self, attr_name: N) -> PyResult<()>
+    where
+        N: IntoPy<Py<PyString>>,
+    {
+        fn inner(any: &Bound<'_, PyAny>, attr_name: Bound<'_, PyString>) -> PyResult<()> {
+            err::error_on_minusone(any.py(), unsafe {
+                ffi::PyObject_DelAttr(any.as_ptr(), attr_name.as_ptr())
+            })
+        }
+
+        let py = self.py();
+        inner(self, attr_name.into_py(py).into_bound(py))
+    }
+
+    fn compare<O>(&self, other: O) -> PyResult<Ordering>
+    where
+        O: ToPyObject,
+    {
+        fn inner(any: &Bound<'_, PyAny>, other: Bound<'_, PyAny>) -> PyResult<Ordering> {
+            let other = other.as_ptr();
+            // Almost the same as ffi::PyObject_RichCompareBool, but this one doesn't try self == other.
+            // See https://github.com/PyO3/pyo3/issues/985 for more.
+            let do_compare = |other, op| unsafe {
+                ffi::PyObject_RichCompare(any.as_ptr(), other, op)
+                    .assume_owned_or_err(any.py())
+                    .and_then(|obj| obj.is_truthy())
+            };
+            if do_compare(other, ffi::Py_EQ)? {
+                Ok(Ordering::Equal)
+            } else if do_compare(other, ffi::Py_LT)? {
+                Ok(Ordering::Less)
+            } else if do_compare(other, ffi::Py_GT)? {
+                Ok(Ordering::Greater)
+            } else {
+                Err(PyTypeError::new_err(
+                    "PyAny::compare(): All comparisons returned false",
+                ))
+            }
+        }
+
+        let py = self.py();
+        inner(self, other.to_object(py).into_bound(py))
+    }
+
+    fn rich_compare<O>(&self, other: O, compare_op: CompareOp) -> PyResult<Bound<'py, PyAny>>
+    where
+        O: ToPyObject,
+    {
+        fn inner<'py>(
+            any: &Bound<'py, PyAny>,
+            other: Bound<'_, PyAny>,
+            compare_op: CompareOp,
+        ) -> PyResult<Bound<'py, PyAny>> {
+            unsafe {
+                ffi::PyObject_RichCompare(any.as_ptr(), other.as_ptr(), compare_op as c_int)
+                    .assume_owned_or_err(any.py())
+            }
+        }
+
+        let py = self.py();
+        inner(self, other.to_object(py).into_bound(py), compare_op)
+    }
+
+    fn neg(&self) -> PyResult<Bound<'py, PyAny>> {
+        unsafe { ffi::PyNumber_Negative(self.as_ptr()).assume_owned_or_err(self.py()) }
+    }
+
+    fn pos(&self) -> PyResult<Bound<'py, PyAny>> {
+        fn inner<'py>(any: &Bound<'py, PyAny>) -> PyResult<Bound<'py, PyAny>> {
+            unsafe { ffi::PyNumber_Positive(any.as_ptr()).assume_owned_or_err(any.py()) }
+        }
+
+        inner(self)
+    }
+
+    fn abs(&self) -> PyResult<Bound<'py, PyAny>> {
+        fn inner<'py>(any: &Bound<'py, PyAny>) -> PyResult<Bound<'py, PyAny>> {
+            unsafe { ffi::PyNumber_Absolute(any.as_ptr()).assume_owned_or_err(any.py()) }
+        }
+
+        inner(self)
+    }
+
+    fn bitnot(&self) -> PyResult<Bound<'py, PyAny>> {
+        fn inner<'py>(any: &Bound<'py, PyAny>) -> PyResult<Bound<'py, PyAny>> {
+            unsafe { ffi::PyNumber_Invert(any.as_ptr()).assume_owned_or_err(any.py()) }
+        }
+
+        inner(self)
+    }
+
+    fn lt<O>(&self, other: O) -> PyResult<bool>
+    where
+        O: ToPyObject,
+    {
+        self.rich_compare(other, CompareOp::Lt)
+            .and_then(|any| any.is_truthy())
+    }
+
+    fn le<O>(&self, other: O) -> PyResult<bool>
+    where
+        O: ToPyObject,
+    {
+        self.rich_compare(other, CompareOp::Le)
+            .and_then(|any| any.is_truthy())
+    }
+
+    fn eq<O>(&self, other: O) -> PyResult<bool>
+    where
+        O: ToPyObject,
+    {
+        self.rich_compare(other, CompareOp::Eq)
+            .and_then(|any| any.is_truthy())
+    }
+
+    fn ne<O>(&self, other: O) -> PyResult<bool>
+    where
+        O: ToPyObject,
+    {
+        self.rich_compare(other, CompareOp::Ne)
+            .and_then(|any| any.is_truthy())
+    }
+
+    fn gt<O>(&self, other: O) -> PyResult<bool>
+    where
+        O: ToPyObject,
+    {
+        self.rich_compare(other, CompareOp::Gt)
+            .and_then(|any| any.is_truthy())
+    }
+
+    fn ge<O>(&self, other: O) -> PyResult<bool>
+    where
+        O: ToPyObject,
+    {
+        self.rich_compare(other, CompareOp::Ge)
+            .and_then(|any| any.is_truthy())
+    }
+
+    implement_binop!(add, PyNumber_Add, "+");
+    implement_binop!(sub, PyNumber_Subtract, "-");
+    implement_binop!(mul, PyNumber_Multiply, "*");
+    implement_binop!(matmul, PyNumber_MatrixMultiply, "@");
+    implement_binop!(div, PyNumber_TrueDivide, "/");
+    implement_binop!(floor_div, PyNumber_FloorDivide, "//");
+    implement_binop!(rem, PyNumber_Remainder, "%");
+    implement_binop!(lshift, PyNumber_Lshift, "<<");
+    implement_binop!(rshift, PyNumber_Rshift, ">>");
+    implement_binop!(bitand, PyNumber_And, "&");
+    implement_binop!(bitor, PyNumber_Or, "|");
+    implement_binop!(bitxor, PyNumber_Xor, "^");
+
+    /// Computes `divmod(self, other)`.
+    fn divmod<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>
+    where
+        O: ToPyObject,
+    {
+        fn inner<'py>(
+            any: &Bound<'py, PyAny>,
+            other: Bound<'_, PyAny>,
+        ) -> PyResult<Bound<'py, PyAny>> {
+            unsafe {
+                ffi::PyNumber_Divmod(any.as_ptr(), other.as_ptr()).assume_owned_or_err(any.py())
+            }
+        }
+
+        let py = self.py();
+        inner(self, other.to_object(py).into_bound(py))
+    }
+
+    /// Computes `self ** other % modulus` (`pow(self, other, modulus)`).
+    /// `py.None()` may be passed for the `modulus`.
+    fn pow<O1, O2>(&self, other: O1, modulus: O2) -> PyResult<Bound<'py, PyAny>>
+    where
+        O1: ToPyObject,
+        O2: ToPyObject,
+    {
+        fn inner<'py>(
+            any: &Bound<'py, PyAny>,
+            other: Bound<'_, PyAny>,
+            modulus: Bound<'_, PyAny>,
+        ) -> PyResult<Bound<'py, PyAny>> {
+            unsafe {
+                ffi::PyNumber_Power(any.as_ptr(), other.as_ptr(), modulus.as_ptr())
+                    .assume_owned_or_err(any.py())
+            }
+        }
+
+        let py = self.py();
+        inner(
+            self,
+            other.to_object(py).into_bound(py),
+            modulus.to_object(py).into_bound(py),
+        )
+    }
+
+    fn is_callable(&self) -> bool {
+        unsafe { ffi::PyCallable_Check(self.as_ptr()) != 0 }
+    }
+
+    fn call(
+        &self,
+        args: impl IntoPy<Py<PyTuple>>,
+        kwargs: Option<&Bound<'_, PyDict>>,
+    ) -> PyResult<Bound<'py, PyAny>> {
+        fn inner<'py>(
+            any: &Bound<'py, PyAny>,
+            args: Bound<'_, PyTuple>,
+            kwargs: Option<&Bound<'_, PyDict>>,
+        ) -> PyResult<Bound<'py, PyAny>> {
+            unsafe {
+                ffi::PyObject_Call(
+                    any.as_ptr(),
+                    args.as_ptr(),
+                    kwargs.map_or(std::ptr::null_mut(), |dict| dict.as_ptr()),
+                )
+                .assume_owned_or_err(any.py())
+            }
+        }
+
+        let py = self.py();
+        inner(self, args.into_py(py).into_bound(py), kwargs)
+    }
+
+    fn call0(&self) -> PyResult<Bound<'py, PyAny>> {
+        cfg_if::cfg_if! {
+            if #[cfg(all(
+                not(PyPy),
+                not(GraalPy),
+                any(Py_3_10, all(not(Py_LIMITED_API), Py_3_9)) // PyObject_CallNoArgs was added to python in 3.9 but to limited API in 3.10
+            ))] {
+                // Optimized path on python 3.9+
+                unsafe {
+                    ffi::PyObject_CallNoArgs(self.as_ptr()).assume_owned_or_err(self.py())
+                }
+            } else {
+                self.call((), None)
+            }
+        }
+    }
+
+    fn call1(&self, args: impl IntoPy<Py<PyTuple>>) -> PyResult<Bound<'py, PyAny>> {
+        self.call(args, None)
+    }
+
+    fn call_method<N, A>(
+        &self,
+        name: N,
+        args: A,
+        kwargs: Option<&Bound<'_, PyDict>>,
+    ) -> PyResult<Bound<'py, PyAny>>
+    where
+        N: IntoPy<Py<PyString>>,
+        A: IntoPy<Py<PyTuple>>,
+    {
+        self.getattr(name)
+            .and_then(|method| method.call(args, kwargs))
+    }
+
+    fn call_method0<N>(&self, name: N) -> PyResult<Bound<'py, PyAny>>
+    where
+        N: IntoPy<Py<PyString>>,
+    {
+        cfg_if::cfg_if! {
+            if #[cfg(all(Py_3_9, not(any(Py_LIMITED_API, PyPy, GraalPy))))] {
+                let py = self.py();
+
+                // Optimized path on python 3.9+
+                unsafe {
+                    let name = name.into_py(py).into_bound(py);
+                    ffi::PyObject_CallMethodNoArgs(self.as_ptr(), name.as_ptr()).assume_owned_or_err(py)
+                }
+            } else {
+                self.call_method(name, (), None)
+            }
+        }
+    }
+
+    fn call_method1<N, A>(&self, name: N, args: A) -> PyResult<Bound<'py, PyAny>>
+    where
+        N: IntoPy<Py<PyString>>,
+        A: IntoPy<Py<PyTuple>>,
+    {
+        self.call_method(name, args, None)
+    }
+
+    fn is_truthy(&self) -> PyResult<bool> {
+        let v = unsafe { ffi::PyObject_IsTrue(self.as_ptr()) };
+        err::error_on_minusone(self.py(), v)?;
+        Ok(v != 0)
+    }
+
+    #[inline]
+    fn is_none(&self) -> bool {
+        unsafe { ffi::Py_None() == self.as_ptr() }
+    }
+
+    fn is_ellipsis(&self) -> bool {
+        unsafe { ffi::Py_Ellipsis() == self.as_ptr() }
+    }
+
+    fn is_empty(&self) -> PyResult<bool> {
+        self.len().map(|l| l == 0)
+    }
+
+    fn get_item<K>(&self, key: K) -> PyResult<Bound<'py, PyAny>>
+    where
+        K: ToPyObject,
+    {
+        fn inner<'py>(
+            any: &Bound<'py, PyAny>,
+            key: Bound<'_, PyAny>,
+        ) -> PyResult<Bound<'py, PyAny>> {
+            unsafe {
+                ffi::PyObject_GetItem(any.as_ptr(), key.as_ptr()).assume_owned_or_err(any.py())
+            }
+        }
+
+        let py = self.py();
+        inner(self, key.to_object(py).into_bound(py))
+    }
+
+    fn set_item<K, V>(&self, key: K, value: V) -> PyResult<()>
+    where
+        K: ToPyObject,
+        V: ToPyObject,
+    {
+        fn inner(
+            any: &Bound<'_, PyAny>,
+            key: Bound<'_, PyAny>,
+            value: Bound<'_, PyAny>,
+        ) -> PyResult<()> {
+            err::error_on_minusone(any.py(), unsafe {
+                ffi::PyObject_SetItem(any.as_ptr(), key.as_ptr(), value.as_ptr())
+            })
+        }
+
+        let py = self.py();
+        inner(
+            self,
+            key.to_object(py).into_bound(py),
+            value.to_object(py).into_bound(py),
+        )
+    }
+
+    fn del_item<K>(&self, key: K) -> PyResult<()>
+    where
+        K: ToPyObject,
+    {
+        fn inner(any: &Bound<'_, PyAny>, key: Bound<'_, PyAny>) -> PyResult<()> {
+            err::error_on_minusone(any.py(), unsafe {
+                ffi::PyObject_DelItem(any.as_ptr(), key.as_ptr())
+            })
+        }
+
+        let py = self.py();
+        inner(self, key.to_object(py).into_bound(py))
+    }
+
+    fn iter(&self) -> PyResult<Bound<'py, PyIterator>> {
+        PyIterator::from_bound_object(self)
+    }
+
+    fn get_type(&self) -> Bound<'py, PyType> {
+        unsafe { PyType::from_borrowed_type_ptr(self.py(), ffi::Py_TYPE(self.as_ptr())) }
+    }
+
+    #[inline]
+    fn get_type_ptr(&self) -> *mut ffi::PyTypeObject {
+        unsafe { ffi::Py_TYPE(self.as_ptr()) }
+    }
+
+    #[inline]
+    fn downcast<T>(&self) -> Result<&Bound<'py, T>, DowncastError<'_, 'py>>
+    where
+        T: PyTypeCheck,
+    {
+        if T::type_check(self) {
+            // Safety: type_check is responsible for ensuring that the type is correct
+            Ok(unsafe { self.downcast_unchecked() })
+        } else {
+            Err(DowncastError::new(self, T::NAME))
+        }
+    }
+
+    #[inline]
+    fn downcast_into<T>(self) -> Result<Bound<'py, T>, DowncastIntoError<'py>>
+    where
+        T: PyTypeCheck,
+    {
+        if T::type_check(&self) {
+            // Safety: type_check is responsible for ensuring that the type is correct
+            Ok(unsafe { self.downcast_into_unchecked() })
+        } else {
+            Err(DowncastIntoError::new(self, T::NAME))
+        }
+    }
+
+    #[inline]
+    fn downcast_exact<T>(&self) -> Result<&Bound<'py, T>, DowncastError<'_, 'py>>
+    where
+        T: PyTypeInfo,
+    {
+        if self.is_exact_instance_of::<T>() {
+            // Safety: is_exact_instance_of is responsible for ensuring that the type is correct
+            Ok(unsafe { self.downcast_unchecked() })
+        } else {
+            Err(DowncastError::new(self, T::NAME))
+        }
+    }
+
+    #[inline]
+    fn downcast_into_exact<T>(self) -> Result<Bound<'py, T>, DowncastIntoError<'py>>
+    where
+        T: PyTypeInfo,
+    {
+        if self.is_exact_instance_of::<T>() {
+            // Safety: is_exact_instance_of is responsible for ensuring that the type is correct
+            Ok(unsafe { self.downcast_into_unchecked() })
+        } else {
+            Err(DowncastIntoError::new(self, T::NAME))
+        }
+    }
+
+    #[inline]
+    unsafe fn downcast_unchecked<T>(&self) -> &Bound<'py, T> {
+        &*ptr_from_ref(self).cast()
+    }
+
+    #[inline]
+    unsafe fn downcast_into_unchecked<T>(self) -> Bound<'py, T> {
+        std::mem::transmute(self)
+    }
+
+    fn extract<'a, T>(&'a self) -> PyResult<T>
+    where
+        T: FromPyObjectBound<'a, 'py>,
+    {
+        FromPyObjectBound::from_py_object_bound(self.as_borrowed())
+    }
+
+    fn get_refcnt(&self) -> isize {
+        unsafe { ffi::Py_REFCNT(self.as_ptr()) }
+    }
+
+    fn repr(&self) -> PyResult<Bound<'py, PyString>> {
+        unsafe {
+            ffi::PyObject_Repr(self.as_ptr())
+                .assume_owned_or_err(self.py())
+                .downcast_into_unchecked()
+        }
+    }
+
+    fn str(&self) -> PyResult<Bound<'py, PyString>> {
+        unsafe {
+            ffi::PyObject_Str(self.as_ptr())
+                .assume_owned_or_err(self.py())
+                .downcast_into_unchecked()
+        }
+    }
+
+    fn hash(&self) -> PyResult<isize> {
+        let v = unsafe { ffi::PyObject_Hash(self.as_ptr()) };
+        crate::err::error_on_minusone(self.py(), v)?;
+        Ok(v)
+    }
+
+    fn len(&self) -> PyResult<usize> {
+        let v = unsafe { ffi::PyObject_Size(self.as_ptr()) };
+        crate::err::error_on_minusone(self.py(), v)?;
+        Ok(v as usize)
+    }
+
+    fn dir(&self) -> PyResult<Bound<'py, PyList>> {
+        unsafe {
+            ffi::PyObject_Dir(self.as_ptr())
+                .assume_owned_or_err(self.py())
+                .downcast_into_unchecked()
+        }
+    }
+
+    #[inline]
+    fn is_instance(&self, ty: &Bound<'py, PyAny>) -> PyResult<bool> {
+        let result = unsafe { ffi::PyObject_IsInstance(self.as_ptr(), ty.as_ptr()) };
+        err::error_on_minusone(self.py(), result)?;
+        Ok(result == 1)
+    }
+
+    #[inline]
+    fn is_exact_instance(&self, ty: &Bound<'py, PyAny>) -> bool {
+        self.get_type().is(ty)
+    }
+
+    #[inline]
+    fn is_instance_of<T: PyTypeInfo>(&self) -> bool {
+        T::is_type_of_bound(self)
+    }
+
+    #[inline]
+    fn is_exact_instance_of<T: PyTypeInfo>(&self) -> bool {
+        T::is_exact_type_of_bound(self)
+    }
+
+    fn contains<V>(&self, value: V) -> PyResult<bool>
+    where
+        V: ToPyObject,
+    {
+        fn inner(any: &Bound<'_, PyAny>, value: Bound<'_, PyAny>) -> PyResult<bool> {
+            match unsafe { ffi::PySequence_Contains(any.as_ptr(), value.as_ptr()) } {
+                0 => Ok(false),
+                1 => Ok(true),
+                _ => Err(PyErr::fetch(any.py())),
+            }
+        }
+
+        let py = self.py();
+        inner(self, value.to_object(py).into_bound(py))
+    }
+
+    #[cfg(not(any(PyPy, GraalPy)))]
+    fn py_super(&self) -> PyResult<Bound<'py, PySuper>> {
+        PySuper::new_bound(&self.get_type(), self)
+    }
+}
+
+impl<'py> Bound<'py, PyAny> {
+    /// Retrieve an attribute value, skipping the instance dictionary during the lookup but still
+    /// binding the object to the instance.
+    ///
+    /// This is useful when trying to resolve Python's "magic" methods like `__getitem__`, which
+    /// are looked up starting from the type object.  This returns an `Option` as it is not
+    /// typically a direct error for the special lookup to fail, as magic methods are optional in
+    /// many situations in which they might be called.
+    ///
+    /// To avoid repeated temporary allocations of Python strings, the [`intern!`] macro can be used
+    /// to intern `attr_name`.
+    #[allow(dead_code)] // Currently only used with num-complex+abi3, so dead without that.
+    pub(crate) fn lookup_special<N>(&self, attr_name: N) -> PyResult<Option<Bound<'py, PyAny>>>
+    where
+        N: IntoPy<Py<PyString>>,
+    {
+        let py = self.py();
+        let self_type = self.get_type();
+        let attr = if let Ok(attr) = self_type.getattr(attr_name) {
+            attr
+        } else {
+            return Ok(None);
+        };
+
+        // Manually resolve descriptor protocol.
+        if cfg!(Py_3_10)
+            || unsafe { ffi::PyType_HasFeature(attr.get_type_ptr(), ffi::Py_TPFLAGS_HEAPTYPE) } != 0
+        {
+            // This is the preferred faster path, but does not work on static types (generally,
+            // types defined in extension modules) before Python 3.10.
+            unsafe {
+                let descr_get_ptr = ffi::PyType_GetSlot(attr.get_type_ptr(), ffi::Py_tp_descr_get);
+                if descr_get_ptr.is_null() {
+                    return Ok(Some(attr));
+                }
+                let descr_get: ffi::descrgetfunc = std::mem::transmute(descr_get_ptr);
+                let ret = descr_get(attr.as_ptr(), self.as_ptr(), self_type.as_ptr());
+                ret.assume_owned_or_err(py).map(Some)
+            }
+        } else if let Ok(descr_get) = attr
+            .get_type()
+            .as_borrowed()
+            .getattr(crate::intern!(py, "__get__"))
+        {
+            descr_get.call1((attr, self, self_type)).map(Some)
+        } else {
+            Ok(Some(attr))
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::{
+        basic::CompareOp,
+        types::{IntoPyDict, PyAny, PyAnyMethods, PyBool, PyList, PyLong, PyModule, PyTypeMethods},
+        Bound, PyTypeInfo, Python, ToPyObject,
+    };
+
+    #[test]
+    fn test_lookup_special() {
+        Python::with_gil(|py| {
+            let module = PyModule::from_code_bound(
+                py,
+                r#"
+class CustomCallable:
+    def __call__(self):
+        return 1
+
+class SimpleInt:
+    def __int__(self):
+        return 1
+
+class InheritedInt(SimpleInt): pass
+
+class NoInt: pass
+
+class NoDescriptorInt:
+    __int__ = CustomCallable()
+
+class InstanceOverrideInt:
+    def __int__(self):
+        return 1
+instance_override = InstanceOverrideInt()
+instance_override.__int__ = lambda self: 2
+
+class ErrorInDescriptorInt:
+    @property
+    def __int__(self):
+        raise ValueError("uh-oh!")
+
+class NonHeapNonDescriptorInt:
+    # A static-typed callable that doesn't implement `__get__`.  These are pretty hard to come by.
+    __int__ = int
+                "#,
+                "test.py",
+                "test",
+            )
+            .unwrap();
+
+            let int = crate::intern!(py, "__int__");
+            let eval_int =
+                |obj: Bound<'_, PyAny>| obj.lookup_special(int)?.unwrap().call0()?.extract::<u32>();
+
+            let simple = module.getattr("SimpleInt").unwrap().call0().unwrap();
+            assert_eq!(eval_int(simple).unwrap(), 1);
+            let inherited = module.getattr("InheritedInt").unwrap().call0().unwrap();
+            assert_eq!(eval_int(inherited).unwrap(), 1);
+            let no_descriptor = module.getattr("NoDescriptorInt").unwrap().call0().unwrap();
+            assert_eq!(eval_int(no_descriptor).unwrap(), 1);
+            let missing = module.getattr("NoInt").unwrap().call0().unwrap();
+            assert!(missing.as_borrowed().lookup_special(int).unwrap().is_none());
+            // Note the instance override should _not_ call the instance method that returns 2,
+            // because that's not how special lookups are meant to work.
+            let instance_override = module.getattr("instance_override").unwrap();
+            assert_eq!(eval_int(instance_override).unwrap(), 1);
+            let descriptor_error = module
+                .getattr("ErrorInDescriptorInt")
+                .unwrap()
+                .call0()
+                .unwrap();
+            assert!(descriptor_error.as_borrowed().lookup_special(int).is_err());
+            let nonheap_nondescriptor = module
+                .getattr("NonHeapNonDescriptorInt")
+                .unwrap()
+                .call0()
+                .unwrap();
+            assert_eq!(eval_int(nonheap_nondescriptor).unwrap(), 0);
+        })
+    }
+
+    #[test]
+    fn test_call_for_non_existing_method() {
+        Python::with_gil(|py| {
+            let a = py.eval_bound("42", None, None).unwrap();
+            a.call_method0("__str__").unwrap(); // ok
+            assert!(a.call_method("nonexistent_method", (1,), None).is_err());
+            assert!(a.call_method0("nonexistent_method").is_err());
+            assert!(a.call_method1("nonexistent_method", (1,)).is_err());
+        });
+    }
+
+    #[test]
+    fn test_call_with_kwargs() {
+        Python::with_gil(|py| {
+            let list = vec![3, 6, 5, 4, 7].to_object(py);
+            let dict = vec![("reverse", true)].into_py_dict_bound(py);
+            list.call_method_bound(py, "sort", (), Some(&dict)).unwrap();
+            assert_eq!(list.extract::<Vec<i32>>(py).unwrap(), vec![7, 6, 5, 4, 3]);
+        });
+    }
+
+    #[test]
+    fn test_call_method0() {
+        Python::with_gil(|py| {
+            let module = PyModule::from_code_bound(
+                py,
+                r#"
+class SimpleClass:
+    def foo(self):
+        return 42
+"#,
+                file!(),
+                "test_module",
+            )
+            .expect("module creation failed");
+
+            let simple_class = module.getattr("SimpleClass").unwrap().call0().unwrap();
+            assert_eq!(
+                simple_class
+                    .call_method0("foo")
+                    .unwrap()
+                    .extract::<u32>()
+                    .unwrap(),
+                42
+            );
+        })
+    }
+
+    #[test]
+    fn test_type() {
+        Python::with_gil(|py| {
+            let obj = py.eval_bound("42", None, None).unwrap();
+            assert_eq!(obj.get_type().as_type_ptr(), obj.get_type_ptr());
+        });
+    }
+
+    #[test]
+    fn test_dir() {
+        Python::with_gil(|py| {
+            let obj = py.eval_bound("42", None, None).unwrap();
+            let dir = py
+                .eval_bound("dir(42)", None, None)
+                .unwrap()
+                .downcast_into::<PyList>()
+                .unwrap();
+            let a = obj
+                .dir()
+                .unwrap()
+                .into_iter()
+                .map(|x| x.extract::<String>().unwrap());
+            let b = dir.into_iter().map(|x| x.extract::<String>().unwrap());
+            assert!(a.eq(b));
+        });
+    }
+
+    #[test]
+    fn test_hasattr() {
+        Python::with_gil(|py| {
+            let x = 5.to_object(py).into_bound(py);
+            assert!(x.is_instance_of::<PyLong>());
+
+            assert!(x.hasattr("to_bytes").unwrap());
+            assert!(!x.hasattr("bbbbbbytes").unwrap());
+        })
+    }
+
+    #[cfg(feature = "macros")]
+    #[test]
+    #[allow(unknown_lints, non_local_definitions)]
+    fn test_hasattr_error() {
+        use crate::exceptions::PyValueError;
+        use crate::prelude::*;
+
+        #[pyclass(crate = "crate")]
+        struct GetattrFail;
+
+        #[pymethods(crate = "crate")]
+        impl GetattrFail {
+            fn __getattr__(&self, attr: PyObject) -> PyResult<PyObject> {
+                Err(PyValueError::new_err(attr))
+            }
+        }
+
+        Python::with_gil(|py| {
+            let obj = Py::new(py, GetattrFail).unwrap();
+            let obj = obj.bind(py).as_ref();
+
+            assert!(obj
+                .hasattr("foo")
+                .unwrap_err()
+                .is_instance_of::<PyValueError>(py));
+        })
+    }
+
+    #[test]
+    fn test_nan_eq() {
+        Python::with_gil(|py| {
+            let nan = py.eval_bound("float('nan')", None, None).unwrap();
+            assert!(nan.compare(&nan).is_err());
+        });
+    }
+
+    #[test]
+    fn test_any_is_instance_of() {
+        Python::with_gil(|py| {
+            let x = 5.to_object(py).into_bound(py);
+            assert!(x.is_instance_of::<PyLong>());
+
+            let l = vec![&x, &x].to_object(py).into_bound(py);
+            assert!(l.is_instance_of::<PyList>());
+        });
+    }
+
+    #[test]
+    fn test_any_is_instance() {
+        Python::with_gil(|py| {
+            let l = vec![1u8, 2].to_object(py).into_bound(py);
+            assert!(l.is_instance(&py.get_type_bound::<PyList>()).unwrap());
+        });
+    }
+
+    #[test]
+    fn test_any_is_exact_instance_of() {
+        Python::with_gil(|py| {
+            let x = 5.to_object(py).into_bound(py);
+            assert!(x.is_exact_instance_of::<PyLong>());
+
+            let t = PyBool::new_bound(py, true);
+            assert!(t.is_instance_of::<PyLong>());
+            assert!(!t.is_exact_instance_of::<PyLong>());
+            assert!(t.is_exact_instance_of::<PyBool>());
+
+            let l = vec![&x, &x].to_object(py).into_bound(py);
+            assert!(l.is_exact_instance_of::<PyList>());
+        });
+    }
+
+    #[test]
+    fn test_any_is_exact_instance() {
+        Python::with_gil(|py| {
+            let t = PyBool::new_bound(py, true);
+            assert!(t.is_instance(&py.get_type_bound::<PyLong>()).unwrap());
+            assert!(!t.is_exact_instance(&py.get_type_bound::<PyLong>()));
+            assert!(t.is_exact_instance(&py.get_type_bound::<PyBool>()));
+        });
+    }
+
+    #[test]
+    fn test_any_contains() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![1, 1, 2, 3, 5, 8];
+            let ob = v.to_object(py).into_bound(py);
+
+            let bad_needle = 7i32.to_object(py);
+            assert!(!ob.contains(&bad_needle).unwrap());
+
+            let good_needle = 8i32.to_object(py);
+            assert!(ob.contains(&good_needle).unwrap());
+
+            let type_coerced_needle = 8f32.to_object(py);
+            assert!(ob.contains(&type_coerced_needle).unwrap());
+
+            let n: u32 = 42;
+            let bad_haystack = n.to_object(py).into_bound(py);
+            let irrelevant_needle = 0i32.to_object(py);
+            assert!(bad_haystack.contains(&irrelevant_needle).is_err());
+        });
+    }
+
+    // This is intentionally not a test, it's a generic function used by the tests below.
+    fn test_eq_methods_generic<T>(list: &[T])
+    where
+        T: PartialEq + PartialOrd + ToPyObject,
+    {
+        Python::with_gil(|py| {
+            for a in list {
+                for b in list {
+                    let a_py = a.to_object(py).into_bound(py);
+                    let b_py = b.to_object(py).into_bound(py);
+
+                    assert_eq!(
+                        a.lt(b),
+                        a_py.lt(&b_py).unwrap(),
+                        "{} < {} should be {}.",
+                        a_py,
+                        b_py,
+                        a.lt(b)
+                    );
+                    assert_eq!(
+                        a.le(b),
+                        a_py.le(&b_py).unwrap(),
+                        "{} <= {} should be {}.",
+                        a_py,
+                        b_py,
+                        a.le(b)
+                    );
+                    assert_eq!(
+                        a.eq(b),
+                        a_py.eq(&b_py).unwrap(),
+                        "{} == {} should be {}.",
+                        a_py,
+                        b_py,
+                        a.eq(b)
+                    );
+                    assert_eq!(
+                        a.ne(b),
+                        a_py.ne(&b_py).unwrap(),
+                        "{} != {} should be {}.",
+                        a_py,
+                        b_py,
+                        a.ne(b)
+                    );
+                    assert_eq!(
+                        a.gt(b),
+                        a_py.gt(&b_py).unwrap(),
+                        "{} > {} should be {}.",
+                        a_py,
+                        b_py,
+                        a.gt(b)
+                    );
+                    assert_eq!(
+                        a.ge(b),
+                        a_py.ge(&b_py).unwrap(),
+                        "{} >= {} should be {}.",
+                        a_py,
+                        b_py,
+                        a.ge(b)
+                    );
+                }
+            }
+        });
+    }
+
+    #[test]
+    fn test_eq_methods_integers() {
+        let ints = [-4, -4, 1, 2, 0, -100, 1_000_000];
+        test_eq_methods_generic(&ints);
+    }
+
+    #[test]
+    fn test_eq_methods_strings() {
+        let strings = ["Let's", "test", "some", "eq", "methods"];
+        test_eq_methods_generic(&strings);
+    }
+
+    #[test]
+    fn test_eq_methods_floats() {
+        let floats = [
+            -1.0,
+            2.5,
+            0.0,
+            3.0,
+            std::f64::consts::PI,
+            10.0,
+            10.0 / 3.0,
+            -1_000_000.0,
+        ];
+        test_eq_methods_generic(&floats);
+    }
+
+    #[test]
+    fn test_eq_methods_bools() {
+        let bools = [true, false];
+        test_eq_methods_generic(&bools);
+    }
+
+    #[test]
+    fn test_rich_compare_type_error() {
+        Python::with_gil(|py| {
+            let py_int = 1.to_object(py).into_bound(py);
+            let py_str = "1".to_object(py).into_bound(py);
+
+            assert!(py_int.rich_compare(&py_str, CompareOp::Lt).is_err());
+            assert!(!py_int
+                .rich_compare(py_str, CompareOp::Eq)
+                .unwrap()
+                .is_truthy()
+                .unwrap());
+        })
+    }
+
+    #[test]
+    fn test_is_ellipsis() {
+        Python::with_gil(|py| {
+            let v = py
+                .eval_bound("...", None, None)
+                .map_err(|e| e.display(py))
+                .unwrap();
+
+            assert!(v.is_ellipsis());
+
+            let not_ellipsis = 5.to_object(py).into_bound(py);
+            assert!(!not_ellipsis.is_ellipsis());
+        });
+    }
+
+    #[test]
+    fn test_is_callable() {
+        Python::with_gil(|py| {
+            assert!(PyList::type_object_bound(py).is_callable());
+
+            let not_callable = 5.to_object(py).into_bound(py);
+            assert!(!not_callable.is_callable());
+        });
+    }
+
+    #[test]
+    fn test_is_empty() {
+        Python::with_gil(|py| {
+            let empty_list = PyList::empty_bound(py).into_any();
+            assert!(empty_list.is_empty().unwrap());
+
+            let list = PyList::new_bound(py, vec![1, 2, 3]).into_any();
+            assert!(!list.is_empty().unwrap());
+
+            let not_container = 5.to_object(py).into_bound(py);
+            assert!(not_container.is_empty().is_err());
+        });
+    }
+
+    #[cfg(feature = "macros")]
+    #[test]
+    #[allow(unknown_lints, non_local_definitions)]
+    fn test_fallible_dir() {
+        use crate::exceptions::PyValueError;
+        use crate::prelude::*;
+
+        #[pyclass(crate = "crate")]
+        struct DirFail;
+
+        #[pymethods(crate = "crate")]
+        impl DirFail {
+            fn __dir__(&self) -> PyResult<PyObject> {
+                Err(PyValueError::new_err("uh-oh!"))
+            }
+        }
+
+        Python::with_gil(|py| {
+            let obj = Bound::new(py, DirFail).unwrap();
+            assert!(obj.dir().unwrap_err().is_instance_of::<PyValueError>(py));
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/boolobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/boolobject.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/boolobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/boolobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,339 @@
+#[cfg(feature = "experimental-inspect")]
+use crate::inspect::types::TypeInfo;
+#[cfg(feature = "gil-refs")]
+use crate::PyNativeType;
+use crate::{
+    exceptions::PyTypeError, ffi, ffi_ptr_ext::FfiPtrExt, instance::Bound,
+    types::typeobject::PyTypeMethods, Borrowed, FromPyObject, IntoPy, PyAny, PyObject, PyResult,
+    Python, ToPyObject,
+};
+
+use super::any::PyAnyMethods;
+
+/// Represents a Python `bool`.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyBool>`][crate::Py] or [`Bound<'py, PyBool>`][Bound].
+///
+/// For APIs available on `bool` objects, see the [`PyBoolMethods`] trait which is implemented for
+/// [`Bound<'py, PyBool>`][Bound].
+#[repr(transparent)]
+pub struct PyBool(PyAny);
+
+pyobject_native_type!(PyBool, ffi::PyObject, pyobject_native_static_type_object!(ffi::PyBool_Type), #checkfunction=ffi::PyBool_Check);
+
+impl PyBool {
+    /// Depending on `val`, returns `true` or `false`.
+    ///
+    /// # Note
+    /// This returns a [`Borrowed`] reference to one of Pythons `True` or
+    /// `False` singletons
+    #[inline]
+    pub fn new_bound(py: Python<'_>, val: bool) -> Borrowed<'_, '_, Self> {
+        unsafe {
+            if val { ffi::Py_True() } else { ffi::Py_False() }
+                .assume_borrowed(py)
+                .downcast_unchecked()
+        }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyBool {
+    /// Deprecated form of [`PyBool::new_bound`]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyBool::new` will be replaced by `PyBool::new_bound` in a future PyO3 version"
+    )]
+    #[inline]
+    pub fn new(py: Python<'_>, val: bool) -> &PyBool {
+        #[allow(deprecated)]
+        unsafe {
+            py.from_borrowed_ptr(if val { ffi::Py_True() } else { ffi::Py_False() })
+        }
+    }
+
+    /// Gets whether this boolean is `true`.
+    #[inline]
+    pub fn is_true(&self) -> bool {
+        self.as_borrowed().is_true()
+    }
+}
+
+/// Implementation of functionality for [`PyBool`].
+///
+/// These methods are defined for the `Bound<'py, PyBool>` smart pointer, so to use method call
+/// syntax these methods are separated into a trait, because stable Rust does not yet support
+/// `arbitrary_self_types`.
+#[doc(alias = "PyBool")]
+pub trait PyBoolMethods<'py>: crate::sealed::Sealed {
+    /// Gets whether this boolean is `true`.
+    fn is_true(&self) -> bool;
+}
+
+impl<'py> PyBoolMethods<'py> for Bound<'py, PyBool> {
+    #[inline]
+    fn is_true(&self) -> bool {
+        self.as_ptr() == unsafe { crate::ffi::Py_True() }
+    }
+}
+
+/// Compare `Bound<PyBool>` with `bool`.
+impl PartialEq<bool> for Bound<'_, PyBool> {
+    #[inline]
+    fn eq(&self, other: &bool) -> bool {
+        self.as_borrowed() == *other
+    }
+}
+
+/// Compare `&Bound<PyBool>` with `bool`.
+impl PartialEq<bool> for &'_ Bound<'_, PyBool> {
+    #[inline]
+    fn eq(&self, other: &bool) -> bool {
+        self.as_borrowed() == *other
+    }
+}
+
+/// Compare `Bound<PyBool>` with `&bool`.
+impl PartialEq<&'_ bool> for Bound<'_, PyBool> {
+    #[inline]
+    fn eq(&self, other: &&bool) -> bool {
+        self.as_borrowed() == **other
+    }
+}
+
+/// Compare `bool` with `Bound<PyBool>`
+impl PartialEq<Bound<'_, PyBool>> for bool {
+    #[inline]
+    fn eq(&self, other: &Bound<'_, PyBool>) -> bool {
+        *self == other.as_borrowed()
+    }
+}
+
+/// Compare `bool` with `&Bound<PyBool>`
+impl PartialEq<&'_ Bound<'_, PyBool>> for bool {
+    #[inline]
+    fn eq(&self, other: &&'_ Bound<'_, PyBool>) -> bool {
+        *self == other.as_borrowed()
+    }
+}
+
+/// Compare `&bool` with `Bound<PyBool>`
+impl PartialEq<Bound<'_, PyBool>> for &'_ bool {
+    #[inline]
+    fn eq(&self, other: &Bound<'_, PyBool>) -> bool {
+        **self == other.as_borrowed()
+    }
+}
+
+/// Compare `Borrowed<PyBool>` with `bool`
+impl PartialEq<bool> for Borrowed<'_, '_, PyBool> {
+    #[inline]
+    fn eq(&self, other: &bool) -> bool {
+        self.is_true() == *other
+    }
+}
+
+/// Compare `Borrowed<PyBool>` with `&bool`
+impl PartialEq<&bool> for Borrowed<'_, '_, PyBool> {
+    #[inline]
+    fn eq(&self, other: &&bool) -> bool {
+        self.is_true() == **other
+    }
+}
+
+/// Compare `bool` with `Borrowed<PyBool>`
+impl PartialEq<Borrowed<'_, '_, PyBool>> for bool {
+    #[inline]
+    fn eq(&self, other: &Borrowed<'_, '_, PyBool>) -> bool {
+        *self == other.is_true()
+    }
+}
+
+/// Compare `&bool` with `Borrowed<PyBool>`
+impl PartialEq<Borrowed<'_, '_, PyBool>> for &'_ bool {
+    #[inline]
+    fn eq(&self, other: &Borrowed<'_, '_, PyBool>) -> bool {
+        **self == other.is_true()
+    }
+}
+
+/// Converts a Rust `bool` to a Python `bool`.
+impl ToPyObject for bool {
+    #[inline]
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        unsafe {
+            PyObject::from_borrowed_ptr(
+                py,
+                if *self {
+                    ffi::Py_True()
+                } else {
+                    ffi::Py_False()
+                },
+            )
+        }
+    }
+}
+
+impl IntoPy<PyObject> for bool {
+    #[inline]
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        PyBool::new_bound(py, self).into_py(py)
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_output() -> TypeInfo {
+        TypeInfo::builtin("bool")
+    }
+}
+
+/// Converts a Python `bool` to a Rust `bool`.
+///
+/// Fails with `TypeError` if the input is not a Python `bool`.
+impl FromPyObject<'_> for bool {
+    fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self> {
+        let err = match obj.downcast::<PyBool>() {
+            Ok(obj) => return Ok(obj.is_true()),
+            Err(err) => err,
+        };
+
+        let is_numpy_bool = {
+            let ty = obj.get_type();
+            ty.module().map_or(false, |module| module == "numpy")
+                && ty
+                    .name()
+                    .map_or(false, |name| name == "bool_" || name == "bool")
+        };
+
+        if is_numpy_bool {
+            let missing_conversion = |obj: &Bound<'_, PyAny>| {
+                PyTypeError::new_err(format!(
+                    "object of type '{}' does not define a '__bool__' conversion",
+                    obj.get_type()
+                ))
+            };
+
+            #[cfg(not(any(Py_LIMITED_API, PyPy)))]
+            unsafe {
+                let ptr = obj.as_ptr();
+
+                if let Some(tp_as_number) = (*(*ptr).ob_type).tp_as_number.as_ref() {
+                    if let Some(nb_bool) = tp_as_number.nb_bool {
+                        match (nb_bool)(ptr) {
+                            0 => return Ok(false),
+                            1 => return Ok(true),
+                            _ => return Err(crate::PyErr::fetch(obj.py())),
+                        }
+                    }
+                }
+
+                return Err(missing_conversion(obj));
+            }
+
+            #[cfg(any(Py_LIMITED_API, PyPy))]
+            {
+                let meth = obj
+                    .lookup_special(crate::intern!(obj.py(), "__bool__"))?
+                    .ok_or_else(|| missing_conversion(obj))?;
+
+                let obj = meth.call0()?.downcast_into::<PyBool>()?;
+                return Ok(obj.is_true());
+            }
+        }
+
+        Err(err.into())
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        Self::type_output()
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::types::any::PyAnyMethods;
+    use crate::types::boolobject::PyBoolMethods;
+    use crate::types::PyBool;
+    use crate::Python;
+    use crate::ToPyObject;
+
+    #[test]
+    fn test_true() {
+        Python::with_gil(|py| {
+            assert!(PyBool::new_bound(py, true).is_true());
+            let t = PyBool::new_bound(py, true);
+            assert!(t.extract::<bool>().unwrap());
+            assert!(true.to_object(py).is(&*PyBool::new_bound(py, true)));
+        });
+    }
+
+    #[test]
+    fn test_false() {
+        Python::with_gil(|py| {
+            assert!(!PyBool::new_bound(py, false).is_true());
+            let t = PyBool::new_bound(py, false);
+            assert!(!t.extract::<bool>().unwrap());
+            assert!(false.to_object(py).is(&*PyBool::new_bound(py, false)));
+        });
+    }
+
+    #[test]
+    fn test_pybool_comparisons() {
+        Python::with_gil(|py| {
+            let py_bool = PyBool::new_bound(py, true);
+            let py_bool_false = PyBool::new_bound(py, false);
+            let rust_bool = true;
+
+            // Bound<'_, PyBool> == bool
+            assert_eq!(*py_bool, rust_bool);
+            assert_ne!(*py_bool_false, rust_bool);
+
+            // Bound<'_, PyBool> == &bool
+            assert_eq!(*py_bool, &rust_bool);
+            assert_ne!(*py_bool_false, &rust_bool);
+
+            // &Bound<'_, PyBool> == bool
+            assert_eq!(&*py_bool, rust_bool);
+            assert_ne!(&*py_bool_false, rust_bool);
+
+            // &Bound<'_, PyBool> == &bool
+            assert_eq!(&*py_bool, &rust_bool);
+            assert_ne!(&*py_bool_false, &rust_bool);
+
+            // bool == Bound<'_, PyBool>
+            assert_eq!(rust_bool, *py_bool);
+            assert_ne!(rust_bool, *py_bool_false);
+
+            // bool == &Bound<'_, PyBool>
+            assert_eq!(rust_bool, &*py_bool);
+            assert_ne!(rust_bool, &*py_bool_false);
+
+            // &bool == Bound<'_, PyBool>
+            assert_eq!(&rust_bool, *py_bool);
+            assert_ne!(&rust_bool, *py_bool_false);
+
+            // &bool == &Bound<'_, PyBool>
+            assert_eq!(&rust_bool, &*py_bool);
+            assert_ne!(&rust_bool, &*py_bool_false);
+
+            // Borrowed<'_, '_, PyBool> == bool
+            assert_eq!(py_bool, rust_bool);
+            assert_ne!(py_bool_false, rust_bool);
+
+            // Borrowed<'_, '_, PyBool> == &bool
+            assert_eq!(py_bool, &rust_bool);
+            assert_ne!(py_bool_false, &rust_bool);
+
+            // bool == Borrowed<'_, '_, PyBool>
+            assert_eq!(rust_bool, py_bool);
+            assert_ne!(rust_bool, py_bool_false);
+
+            // &bool == Borrowed<'_, '_, PyBool>
+            assert_eq!(&rust_bool, py_bool);
+            assert_ne!(&rust_bool, py_bool_false);
+            assert_eq!(py_bool, rust_bool);
+            assert_ne!(py_bool_false, rust_bool);
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/bytearray.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/bytearray.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/bytearray.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/bytearray.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,658 @@
+use crate::err::{PyErr, PyResult};
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::instance::{Borrowed, Bound};
+use crate::py_result_ext::PyResultExt;
+use crate::types::any::PyAnyMethods;
+use crate::{ffi, PyAny, Python};
+#[cfg(feature = "gil-refs")]
+use crate::{AsPyPointer, PyNativeType};
+use std::slice;
+
+/// Represents a Python `bytearray`.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyByteArray>`][crate::Py] or [`Bound<'py, PyByteArray>`][Bound].
+///
+/// For APIs available on `bytearray` objects, see the [`PyByteArrayMethods`] trait which is implemented for
+/// [`Bound<'py, PyByteArray>`][Bound].
+#[repr(transparent)]
+pub struct PyByteArray(PyAny);
+
+pyobject_native_type_core!(PyByteArray, pyobject_native_static_type_object!(ffi::PyByteArray_Type), #checkfunction=ffi::PyByteArray_Check);
+
+impl PyByteArray {
+    /// Creates a new Python bytearray object.
+    ///
+    /// The byte string is initialized by copying the data from the `&[u8]`.
+    pub fn new_bound<'py>(py: Python<'py>, src: &[u8]) -> Bound<'py, PyByteArray> {
+        let ptr = src.as_ptr().cast();
+        let len = src.len() as ffi::Py_ssize_t;
+        unsafe {
+            ffi::PyByteArray_FromStringAndSize(ptr, len)
+                .assume_owned(py)
+                .downcast_into_unchecked()
+        }
+    }
+
+    /// Creates a new Python `bytearray` object with an `init` closure to write its contents.
+    /// Before calling `init` the bytearray is zero-initialised.
+    /// * If Python raises a MemoryError on the allocation, `new_with` will return
+    ///   it inside `Err`.
+    /// * If `init` returns `Err(e)`, `new_with` will return `Err(e)`.
+    /// * If `init` returns `Ok(())`, `new_with` will return `Ok(&PyByteArray)`.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use pyo3::{prelude::*, types::PyByteArray};
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let py_bytearray = PyByteArray::new_bound_with(py, 10, |bytes: &mut [u8]| {
+    ///         bytes.copy_from_slice(b"Hello Rust");
+    ///         Ok(())
+    ///     })?;
+    ///     let bytearray: &[u8] = unsafe { py_bytearray.as_bytes() };
+    ///     assert_eq!(bytearray, b"Hello Rust");
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    pub fn new_bound_with<F>(
+        py: Python<'_>,
+        len: usize,
+        init: F,
+    ) -> PyResult<Bound<'_, PyByteArray>>
+    where
+        F: FnOnce(&mut [u8]) -> PyResult<()>,
+    {
+        unsafe {
+            // Allocate buffer and check for an error
+            let pybytearray: Bound<'_, Self> =
+                ffi::PyByteArray_FromStringAndSize(std::ptr::null(), len as ffi::Py_ssize_t)
+                    .assume_owned_or_err(py)?
+                    .downcast_into_unchecked();
+
+            let buffer: *mut u8 = ffi::PyByteArray_AsString(pybytearray.as_ptr()).cast();
+            debug_assert!(!buffer.is_null());
+            // Zero-initialise the uninitialised bytearray
+            std::ptr::write_bytes(buffer, 0u8, len);
+            // (Further) Initialise the bytearray in init
+            // If init returns an Err, pypybytearray will automatically deallocate the buffer
+            init(std::slice::from_raw_parts_mut(buffer, len)).map(|_| pybytearray)
+        }
+    }
+
+    /// Creates a new Python `bytearray` object from another Python object that
+    /// implements the buffer protocol.
+    pub fn from_bound<'py>(src: &Bound<'py, PyAny>) -> PyResult<Bound<'py, PyByteArray>> {
+        unsafe {
+            ffi::PyByteArray_FromObject(src.as_ptr())
+                .assume_owned_or_err(src.py())
+                .downcast_into_unchecked()
+        }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyByteArray {
+    /// Deprecated form of [`PyByteArray::new_bound`]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyByteArray::new` will be replaced by `PyByteArray::new_bound` in a future PyO3 version"
+    )]
+    pub fn new<'py>(py: Python<'py>, src: &[u8]) -> &'py PyByteArray {
+        Self::new_bound(py, src).into_gil_ref()
+    }
+
+    /// Deprecated form of [`PyByteArray::new_bound_with`]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyByteArray::new_with` will be replaced by `PyByteArray::new_bound_with` in a future PyO3 version"
+    )]
+    pub fn new_with<F>(py: Python<'_>, len: usize, init: F) -> PyResult<&PyByteArray>
+    where
+        F: FnOnce(&mut [u8]) -> PyResult<()>,
+    {
+        Self::new_bound_with(py, len, init).map(Bound::into_gil_ref)
+    }
+
+    /// Deprecated form of [`PyByteArray::from_bound`]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyByteArray::from` will be replaced by `PyByteArray::from_bound` in a future PyO3 version"
+    )]
+    pub fn from(src: &PyAny) -> PyResult<&PyByteArray> {
+        PyByteArray::from_bound(&src.as_borrowed()).map(Bound::into_gil_ref)
+    }
+
+    /// Gets the length of the bytearray.
+    #[inline]
+    pub fn len(&self) -> usize {
+        self.as_borrowed().len()
+    }
+
+    /// Checks if the bytearray is empty.
+    pub fn is_empty(&self) -> bool {
+        self.as_borrowed().is_empty()
+    }
+
+    /// Gets the start of the buffer containing the contents of the bytearray.
+    ///
+    /// # Safety
+    ///
+    /// See the safety requirements of [`PyByteArray::as_bytes`] and [`PyByteArray::as_bytes_mut`].
+    pub fn data(&self) -> *mut u8 {
+        self.as_borrowed().data()
+    }
+
+    /// Extracts a slice of the `ByteArray`'s entire buffer.
+    ///
+    /// # Safety
+    ///
+    /// Mutation of the `bytearray` invalidates the slice. If it is used afterwards, the behavior is
+    /// undefined.
+    ///
+    /// These mutations may occur in Python code as well as from Rust:
+    /// - Calling methods like [`PyByteArray::as_bytes_mut`] and [`PyByteArray::resize`] will
+    ///   invalidate the slice.
+    /// - Actions like dropping objects or raising exceptions can invoke `__del__`methods or signal
+    ///   handlers, which may execute arbitrary Python code. This means that if Python code has a
+    ///   reference to the `bytearray` you cannot safely use the vast majority of PyO3's API whilst
+    ///   using the slice.
+    ///
+    /// As a result, this slice should only be used for short-lived operations without executing any
+    /// Python code, such as copying into a Vec.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::exceptions::PyRuntimeError;
+    /// use pyo3::types::PyByteArray;
+    ///
+    /// #[pyfunction]
+    /// fn a_valid_function(bytes: &Bound<'_, PyByteArray>) -> PyResult<()> {
+    ///     let section = {
+    ///         // SAFETY: We promise to not let the interpreter regain control
+    ///         // or invoke any PyO3 APIs while using the slice.
+    ///         let slice = unsafe { bytes.as_bytes() };
+    ///
+    ///         // Copy only a section of `bytes` while avoiding
+    ///         // `to_vec` which copies the entire thing.
+    ///         let section = slice
+    ///             .get(6..11)
+    ///             .ok_or_else(|| PyRuntimeError::new_err("input is not long enough"))?;
+    ///         Vec::from(section)
+    ///     };
+    ///
+    ///     // Now we can do things with `section` and call PyO3 APIs again.
+    ///     // ...
+    ///     # assert_eq!(&section, b"world");
+    ///
+    ///     Ok(())
+    /// }
+    /// # fn main() -> PyResult<()> {
+    /// #     Python::with_gil(|py| -> PyResult<()> {
+    /// #         let fun = wrap_pyfunction_bound!(a_valid_function, py)?;
+    /// #         let locals = pyo3::types::PyDict::new_bound(py);
+    /// #         locals.set_item("a_valid_function", fun)?;
+    /// #
+    /// #         py.run_bound(
+    /// # r#"b = bytearray(b"hello world")
+    /// # a_valid_function(b)
+    /// #
+    /// # try:
+    /// #     a_valid_function(bytearray())
+    /// # except RuntimeError as e:
+    /// #     assert str(e) == 'input is not long enough'"#,
+    /// #             None,
+    /// #             Some(&locals),
+    /// #         )?;
+    /// #
+    /// #         Ok(())
+    /// #     })
+    /// # }
+    /// ```
+    ///
+    /// # Incorrect usage
+    ///
+    /// The following `bug` function is unsound ⚠️
+    ///
+    /// ```rust,no_run
+    /// # use pyo3::prelude::*;
+    /// # use pyo3::types::PyByteArray;
+    ///
+    /// # #[allow(dead_code)]
+    /// #[pyfunction]
+    /// fn bug(py: Python<'_>, bytes: &Bound<'_, PyByteArray>) {
+    ///     let slice = unsafe { bytes.as_bytes() };
+    ///
+    ///     // This explicitly yields control back to the Python interpreter...
+    ///     // ...but it's not always this obvious. Many things do this implicitly.
+    ///     py.allow_threads(|| {
+    ///         // Python code could be mutating through its handle to `bytes`,
+    ///         // which makes reading it a data race, which is undefined behavior.
+    ///         println!("{:?}", slice[0]);
+    ///     });
+    ///
+    ///     // Python code might have mutated it, so we can not rely on the slice
+    ///     // remaining valid. As such this is also undefined behavior.
+    ///     println!("{:?}", slice[0]);
+    /// }
+    /// ```
+    pub unsafe fn as_bytes(&self) -> &[u8] {
+        self.as_borrowed().as_bytes()
+    }
+
+    /// Extracts a mutable slice of the `ByteArray`'s entire buffer.
+    ///
+    /// # Safety
+    ///
+    /// Any other accesses of the `bytearray`'s buffer invalidate the slice. If it is used
+    /// afterwards, the behavior is undefined. The safety requirements of [`PyByteArray::as_bytes`]
+    /// apply to this function as well.
+    #[allow(clippy::mut_from_ref)]
+    pub unsafe fn as_bytes_mut(&self) -> &mut [u8] {
+        self.as_borrowed().as_bytes_mut()
+    }
+
+    /// Copies the contents of the bytearray to a Rust vector.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # use pyo3::prelude::*;
+    /// # use pyo3::types::PyByteArray;
+    /// # Python::with_gil(|py| {
+    /// let bytearray = PyByteArray::new_bound(py, b"Hello World.");
+    /// let mut copied_message = bytearray.to_vec();
+    /// assert_eq!(b"Hello World.", copied_message.as_slice());
+    ///
+    /// copied_message[11] = b'!';
+    /// assert_eq!(b"Hello World!", copied_message.as_slice());
+    ///
+    /// pyo3::py_run!(py, bytearray, "assert bytearray == b'Hello World.'");
+    /// # });
+    /// ```
+    pub fn to_vec(&self) -> Vec<u8> {
+        self.as_borrowed().to_vec()
+    }
+
+    /// Resizes the bytearray object to the new length `len`.
+    ///
+    /// Note that this will invalidate any pointers obtained by [PyByteArray::data], as well as
+    /// any (unsafe) slices obtained from [PyByteArray::as_bytes] and [PyByteArray::as_bytes_mut].
+    pub fn resize(&self, len: usize) -> PyResult<()> {
+        self.as_borrowed().resize(len)
+    }
+}
+
+/// Implementation of functionality for [`PyByteArray`].
+///
+/// These methods are defined for the `Bound<'py, PyByteArray>` smart pointer, so to use method call
+/// syntax these methods are separated into a trait, because stable Rust does not yet support
+/// `arbitrary_self_types`.
+#[doc(alias = "PyByteArray")]
+pub trait PyByteArrayMethods<'py>: crate::sealed::Sealed {
+    /// Gets the length of the bytearray.
+    fn len(&self) -> usize;
+
+    /// Checks if the bytearray is empty.
+    fn is_empty(&self) -> bool;
+
+    /// Gets the start of the buffer containing the contents of the bytearray.
+    ///
+    /// # Safety
+    ///
+    /// See the safety requirements of [`PyByteArrayMethods::as_bytes`] and [`PyByteArrayMethods::as_bytes_mut`].
+    fn data(&self) -> *mut u8;
+
+    /// Extracts a slice of the `ByteArray`'s entire buffer.
+    ///
+    /// # Safety
+    ///
+    /// Mutation of the `bytearray` invalidates the slice. If it is used afterwards, the behavior is
+    /// undefined.
+    ///
+    /// These mutations may occur in Python code as well as from Rust:
+    /// - Calling methods like [`PyByteArrayMethods::as_bytes_mut`] and [`PyByteArrayMethods::resize`] will
+    ///   invalidate the slice.
+    /// - Actions like dropping objects or raising exceptions can invoke `__del__`methods or signal
+    ///   handlers, which may execute arbitrary Python code. This means that if Python code has a
+    ///   reference to the `bytearray` you cannot safely use the vast majority of PyO3's API whilst
+    ///   using the slice.
+    ///
+    /// As a result, this slice should only be used for short-lived operations without executing any
+    /// Python code, such as copying into a Vec.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::exceptions::PyRuntimeError;
+    /// use pyo3::types::PyByteArray;
+    ///
+    /// #[pyfunction]
+    /// fn a_valid_function(bytes: &Bound<'_, PyByteArray>) -> PyResult<()> {
+    ///     let section = {
+    ///         // SAFETY: We promise to not let the interpreter regain control
+    ///         // or invoke any PyO3 APIs while using the slice.
+    ///         let slice = unsafe { bytes.as_bytes() };
+    ///
+    ///         // Copy only a section of `bytes` while avoiding
+    ///         // `to_vec` which copies the entire thing.
+    ///         let section = slice
+    ///             .get(6..11)
+    ///             .ok_or_else(|| PyRuntimeError::new_err("input is not long enough"))?;
+    ///         Vec::from(section)
+    ///     };
+    ///
+    ///     // Now we can do things with `section` and call PyO3 APIs again.
+    ///     // ...
+    ///     # assert_eq!(&section, b"world");
+    ///
+    ///     Ok(())
+    /// }
+    /// # fn main() -> PyResult<()> {
+    /// #     Python::with_gil(|py| -> PyResult<()> {
+    /// #         let fun = wrap_pyfunction_bound!(a_valid_function, py)?;
+    /// #         let locals = pyo3::types::PyDict::new_bound(py);
+    /// #         locals.set_item("a_valid_function", fun)?;
+    /// #
+    /// #         py.run_bound(
+    /// # r#"b = bytearray(b"hello world")
+    /// # a_valid_function(b)
+    /// #
+    /// # try:
+    /// #     a_valid_function(bytearray())
+    /// # except RuntimeError as e:
+    /// #     assert str(e) == 'input is not long enough'"#,
+    /// #             None,
+    /// #             Some(&locals),
+    /// #         )?;
+    /// #
+    /// #         Ok(())
+    /// #     })
+    /// # }
+    /// ```
+    ///
+    /// # Incorrect usage
+    ///
+    /// The following `bug` function is unsound ⚠️
+    ///
+    /// ```rust,no_run
+    /// # use pyo3::prelude::*;
+    /// # use pyo3::types::PyByteArray;
+    ///
+    /// # #[allow(dead_code)]
+    /// #[pyfunction]
+    /// fn bug(py: Python<'_>, bytes: &Bound<'_, PyByteArray>) {
+    ///     let slice = unsafe { bytes.as_bytes() };
+    ///
+    ///     // This explicitly yields control back to the Python interpreter...
+    ///     // ...but it's not always this obvious. Many things do this implicitly.
+    ///     py.allow_threads(|| {
+    ///         // Python code could be mutating through its handle to `bytes`,
+    ///         // which makes reading it a data race, which is undefined behavior.
+    ///         println!("{:?}", slice[0]);
+    ///     });
+    ///
+    ///     // Python code might have mutated it, so we can not rely on the slice
+    ///     // remaining valid. As such this is also undefined behavior.
+    ///     println!("{:?}", slice[0]);
+    /// }
+    /// ```
+    unsafe fn as_bytes(&self) -> &[u8];
+
+    /// Extracts a mutable slice of the `ByteArray`'s entire buffer.
+    ///
+    /// # Safety
+    ///
+    /// Any other accesses of the `bytearray`'s buffer invalidate the slice. If it is used
+    /// afterwards, the behavior is undefined. The safety requirements of [`PyByteArrayMethods::as_bytes`]
+    /// apply to this function as well.
+    #[allow(clippy::mut_from_ref)]
+    unsafe fn as_bytes_mut(&self) -> &mut [u8];
+
+    /// Copies the contents of the bytearray to a Rust vector.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # use pyo3::prelude::*;
+    /// # use pyo3::types::PyByteArray;
+    /// # Python::with_gil(|py| {
+    /// let bytearray = PyByteArray::new_bound(py, b"Hello World.");
+    /// let mut copied_message = bytearray.to_vec();
+    /// assert_eq!(b"Hello World.", copied_message.as_slice());
+    ///
+    /// copied_message[11] = b'!';
+    /// assert_eq!(b"Hello World!", copied_message.as_slice());
+    ///
+    /// pyo3::py_run!(py, bytearray, "assert bytearray == b'Hello World.'");
+    /// # });
+    /// ```
+    fn to_vec(&self) -> Vec<u8>;
+
+    /// Resizes the bytearray object to the new length `len`.
+    ///
+    /// Note that this will invalidate any pointers obtained by [PyByteArrayMethods::data], as well as
+    /// any (unsafe) slices obtained from [PyByteArrayMethods::as_bytes] and [PyByteArrayMethods::as_bytes_mut].
+    fn resize(&self, len: usize) -> PyResult<()>;
+}
+
+impl<'py> PyByteArrayMethods<'py> for Bound<'py, PyByteArray> {
+    #[inline]
+    fn len(&self) -> usize {
+        // non-negative Py_ssize_t should always fit into Rust usize
+        unsafe { ffi::PyByteArray_Size(self.as_ptr()) as usize }
+    }
+
+    fn is_empty(&self) -> bool {
+        self.len() == 0
+    }
+
+    fn data(&self) -> *mut u8 {
+        self.as_borrowed().data()
+    }
+
+    unsafe fn as_bytes(&self) -> &[u8] {
+        self.as_borrowed().as_bytes()
+    }
+
+    #[allow(clippy::mut_from_ref)]
+    unsafe fn as_bytes_mut(&self) -> &mut [u8] {
+        self.as_borrowed().as_bytes_mut()
+    }
+
+    fn to_vec(&self) -> Vec<u8> {
+        unsafe { self.as_bytes() }.to_vec()
+    }
+
+    fn resize(&self, len: usize) -> PyResult<()> {
+        unsafe {
+            let result = ffi::PyByteArray_Resize(self.as_ptr(), len as ffi::Py_ssize_t);
+            if result == 0 {
+                Ok(())
+            } else {
+                Err(PyErr::fetch(self.py()))
+            }
+        }
+    }
+}
+
+impl<'a> Borrowed<'a, '_, PyByteArray> {
+    fn data(&self) -> *mut u8 {
+        unsafe { ffi::PyByteArray_AsString(self.as_ptr()).cast() }
+    }
+
+    #[allow(clippy::wrong_self_convention)]
+    unsafe fn as_bytes(self) -> &'a [u8] {
+        slice::from_raw_parts(self.data(), self.len())
+    }
+
+    #[allow(clippy::wrong_self_convention)]
+    unsafe fn as_bytes_mut(self) -> &'a mut [u8] {
+        slice::from_raw_parts_mut(self.data(), self.len())
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'py> TryFrom<&'py PyAny> for &'py PyByteArray {
+    type Error = crate::PyErr;
+
+    /// Creates a new Python `bytearray` object from another Python object that
+    /// implements the buffer protocol.
+    fn try_from(value: &'py PyAny) -> Result<Self, Self::Error> {
+        PyByteArray::from_bound(&value.as_borrowed()).map(Bound::into_gil_ref)
+    }
+}
+
+impl<'py> TryFrom<&Bound<'py, PyAny>> for Bound<'py, PyByteArray> {
+    type Error = crate::PyErr;
+
+    /// Creates a new Python `bytearray` object from another Python object that
+    /// implements the buffer protocol.
+    fn try_from(value: &Bound<'py, PyAny>) -> Result<Self, Self::Error> {
+        PyByteArray::from_bound(value)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::types::{PyAnyMethods, PyByteArray, PyByteArrayMethods};
+    use crate::{exceptions, Bound, PyAny, PyObject, Python};
+
+    #[test]
+    fn test_len() {
+        Python::with_gil(|py| {
+            let src = b"Hello Python";
+            let bytearray = PyByteArray::new_bound(py, src);
+            assert_eq!(src.len(), bytearray.len());
+        });
+    }
+
+    #[test]
+    fn test_as_bytes() {
+        Python::with_gil(|py| {
+            let src = b"Hello Python";
+            let bytearray = PyByteArray::new_bound(py, src);
+
+            let slice = unsafe { bytearray.as_bytes() };
+            assert_eq!(src, slice);
+            assert_eq!(bytearray.data() as *const _, slice.as_ptr());
+        });
+    }
+
+    #[test]
+    fn test_as_bytes_mut() {
+        Python::with_gil(|py| {
+            let src = b"Hello Python";
+            let bytearray = PyByteArray::new_bound(py, src);
+
+            let slice = unsafe { bytearray.as_bytes_mut() };
+            assert_eq!(src, slice);
+            assert_eq!(bytearray.data(), slice.as_mut_ptr());
+
+            slice[0..5].copy_from_slice(b"Hi...");
+
+            assert_eq!(bytearray.str().unwrap(), "bytearray(b'Hi... Python')");
+        });
+    }
+
+    #[test]
+    fn test_to_vec() {
+        Python::with_gil(|py| {
+            let src = b"Hello Python";
+            let bytearray = PyByteArray::new_bound(py, src);
+
+            let vec = bytearray.to_vec();
+            assert_eq!(src, vec.as_slice());
+        });
+    }
+
+    #[test]
+    fn test_from() {
+        Python::with_gil(|py| {
+            let src = b"Hello Python";
+            let bytearray = PyByteArray::new_bound(py, src);
+
+            let ba: PyObject = bytearray.into();
+            let bytearray = PyByteArray::from_bound(ba.bind(py)).unwrap();
+
+            assert_eq!(src, unsafe { bytearray.as_bytes() });
+        });
+    }
+
+    #[test]
+    fn test_from_err() {
+        Python::with_gil(|py| {
+            if let Err(err) = PyByteArray::from_bound(py.None().bind(py)) {
+                assert!(err.is_instance_of::<exceptions::PyTypeError>(py));
+            } else {
+                panic!("error");
+            }
+        });
+    }
+
+    #[test]
+    fn test_try_from() {
+        Python::with_gil(|py| {
+            let src = b"Hello Python";
+            let bytearray: &Bound<'_, PyAny> = &PyByteArray::new_bound(py, src);
+            let bytearray: Bound<'_, PyByteArray> = TryInto::try_into(bytearray).unwrap();
+
+            assert_eq!(src, unsafe { bytearray.as_bytes() });
+        });
+    }
+
+    #[test]
+    fn test_resize() {
+        Python::with_gil(|py| {
+            let src = b"Hello Python";
+            let bytearray = PyByteArray::new_bound(py, src);
+
+            bytearray.resize(20).unwrap();
+            assert_eq!(20, bytearray.len());
+        });
+    }
+
+    #[test]
+    fn test_byte_array_new_with() -> super::PyResult<()> {
+        Python::with_gil(|py| -> super::PyResult<()> {
+            let py_bytearray = PyByteArray::new_bound_with(py, 10, |b: &mut [u8]| {
+                b.copy_from_slice(b"Hello Rust");
+                Ok(())
+            })?;
+            let bytearray: &[u8] = unsafe { py_bytearray.as_bytes() };
+            assert_eq!(bytearray, b"Hello Rust");
+            Ok(())
+        })
+    }
+
+    #[test]
+    fn test_byte_array_new_with_zero_initialised() -> super::PyResult<()> {
+        Python::with_gil(|py| -> super::PyResult<()> {
+            let py_bytearray = PyByteArray::new_bound_with(py, 10, |_b: &mut [u8]| Ok(()))?;
+            let bytearray: &[u8] = unsafe { py_bytearray.as_bytes() };
+            assert_eq!(bytearray, &[0; 10]);
+            Ok(())
+        })
+    }
+
+    #[test]
+    fn test_byte_array_new_with_error() {
+        use crate::exceptions::PyValueError;
+        Python::with_gil(|py| {
+            let py_bytearray_result = PyByteArray::new_bound_with(py, 10, |_b: &mut [u8]| {
+                Err(PyValueError::new_err("Hello Crustaceans!"))
+            });
+            assert!(py_bytearray_result.is_err());
+            assert!(py_bytearray_result
+                .err()
+                .unwrap()
+                .is_instance_of::<PyValueError>(py));
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/bytes.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/bytes.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/bytes.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/bytes.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,419 @@
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::instance::{Borrowed, Bound};
+use crate::types::any::PyAnyMethods;
+#[cfg(feature = "gil-refs")]
+use crate::PyNativeType;
+use crate::{ffi, Py, PyAny, PyResult, Python};
+use std::ops::Index;
+use std::slice::SliceIndex;
+use std::str;
+
+/// Represents a Python `bytes` object.
+///
+/// This type is immutable.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyBytes>`][crate::Py] or [`Bound<'py, PyBytes>`][Bound].
+///
+/// For APIs available on `bytes` objects, see the [`PyBytesMethods`] trait which is implemented for
+/// [`Bound<'py, PyBytes>`][Bound].
+///
+/// # Equality
+///
+/// For convenience, [`Bound<'py, PyBytes>`][Bound] implements [`PartialEq<[u8]>`][PartialEq] to allow comparing the
+/// data in the Python bytes to a Rust `[u8]` byte slice.
+///
+/// This is not always the most appropriate way to compare Python bytes, as Python bytes subclasses
+/// may have different equality semantics. In situations where subclasses overriding equality might be
+/// relevant, use [`PyAnyMethods::eq`], at cost of the additional overhead of a Python method call.
+///
+/// ```rust
+/// # use pyo3::prelude::*;
+/// use pyo3::types::PyBytes;
+///
+/// # Python::with_gil(|py| {
+/// let py_bytes = PyBytes::new_bound(py, b"foo".as_slice());
+/// // via PartialEq<[u8]>
+/// assert_eq!(py_bytes, b"foo".as_slice());
+///
+/// // via Python equality
+/// let other = PyBytes::new_bound(py, b"foo".as_slice());
+/// assert!(py_bytes.as_any().eq(other).unwrap());
+///
+/// // Note that `eq` will convert it's argument to Python using `ToPyObject`,
+/// // so the following does not compare equal since the slice will convert into a
+/// // `list`, not a `bytes` object.
+/// assert!(!py_bytes.as_any().eq(b"foo".as_slice()).unwrap());
+/// # });
+/// ```
+#[repr(transparent)]
+pub struct PyBytes(PyAny);
+
+pyobject_native_type_core!(PyBytes, pyobject_native_static_type_object!(ffi::PyBytes_Type), #checkfunction=ffi::PyBytes_Check);
+
+impl PyBytes {
+    /// Creates a new Python bytestring object.
+    /// The bytestring is initialized by copying the data from the `&[u8]`.
+    ///
+    /// Panics if out of memory.
+    pub fn new_bound<'p>(py: Python<'p>, s: &[u8]) -> Bound<'p, PyBytes> {
+        let ptr = s.as_ptr().cast();
+        let len = s.len() as ffi::Py_ssize_t;
+        unsafe {
+            ffi::PyBytes_FromStringAndSize(ptr, len)
+                .assume_owned(py)
+                .downcast_into_unchecked()
+        }
+    }
+
+    /// Creates a new Python `bytes` object with an `init` closure to write its contents.
+    /// Before calling `init` the bytes' contents are zero-initialised.
+    /// * If Python raises a MemoryError on the allocation, `new_with` will return
+    ///   it inside `Err`.
+    /// * If `init` returns `Err(e)`, `new_with` will return `Err(e)`.
+    /// * If `init` returns `Ok(())`, `new_with` will return `Ok(&PyBytes)`.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use pyo3::{prelude::*, types::PyBytes};
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let py_bytes = PyBytes::new_bound_with(py, 10, |bytes: &mut [u8]| {
+    ///         bytes.copy_from_slice(b"Hello Rust");
+    ///         Ok(())
+    ///     })?;
+    ///     let bytes: &[u8] = py_bytes.extract()?;
+    ///     assert_eq!(bytes, b"Hello Rust");
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    pub fn new_bound_with<F>(py: Python<'_>, len: usize, init: F) -> PyResult<Bound<'_, PyBytes>>
+    where
+        F: FnOnce(&mut [u8]) -> PyResult<()>,
+    {
+        unsafe {
+            let pyptr = ffi::PyBytes_FromStringAndSize(std::ptr::null(), len as ffi::Py_ssize_t);
+            // Check for an allocation error and return it
+            let pybytes = pyptr.assume_owned_or_err(py)?.downcast_into_unchecked();
+            let buffer: *mut u8 = ffi::PyBytes_AsString(pyptr).cast();
+            debug_assert!(!buffer.is_null());
+            // Zero-initialise the uninitialised bytestring
+            std::ptr::write_bytes(buffer, 0u8, len);
+            // (Further) Initialise the bytestring in init
+            // If init returns an Err, pypybytearray will automatically deallocate the buffer
+            init(std::slice::from_raw_parts_mut(buffer, len)).map(|_| pybytes)
+        }
+    }
+
+    /// Creates a new Python byte string object from a raw pointer and length.
+    ///
+    /// Panics if out of memory.
+    ///
+    /// # Safety
+    ///
+    /// This function dereferences the raw pointer `ptr` as the
+    /// leading pointer of a slice of length `len`. [As with
+    /// `std::slice::from_raw_parts`, this is
+    /// unsafe](https://doc.rust-lang.org/std/slice/fn.from_raw_parts.html#safety).
+    pub unsafe fn bound_from_ptr(py: Python<'_>, ptr: *const u8, len: usize) -> Bound<'_, PyBytes> {
+        ffi::PyBytes_FromStringAndSize(ptr.cast(), len as isize)
+            .assume_owned(py)
+            .downcast_into_unchecked()
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyBytes {
+    /// Deprecated form of [`PyBytes::new_bound`].
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyBytes::new` will be replaced by `PyBytes::new_bound` in a future PyO3 version"
+    )]
+    pub fn new<'p>(py: Python<'p>, s: &[u8]) -> &'p PyBytes {
+        Self::new_bound(py, s).into_gil_ref()
+    }
+
+    /// Deprecated form of [`PyBytes::new_bound_with`].
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyBytes::new_with` will be replaced by `PyBytes::new_bound_with` in a future PyO3 version"
+    )]
+    pub fn new_with<F>(py: Python<'_>, len: usize, init: F) -> PyResult<&PyBytes>
+    where
+        F: FnOnce(&mut [u8]) -> PyResult<()>,
+    {
+        Self::new_bound_with(py, len, init).map(Bound::into_gil_ref)
+    }
+
+    /// Deprecated form of [`PyBytes::bound_from_ptr`].
+    ///
+    /// # Safety
+    /// See [`PyBytes::bound_from_ptr`].
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyBytes::from_ptr` will be replaced by `PyBytes::bound_from_ptr` in a future PyO3 version"
+    )]
+    pub unsafe fn from_ptr(py: Python<'_>, ptr: *const u8, len: usize) -> &PyBytes {
+        Self::bound_from_ptr(py, ptr, len).into_gil_ref()
+    }
+
+    /// Gets the Python string as a byte slice.
+    #[inline]
+    pub fn as_bytes(&self) -> &[u8] {
+        self.as_borrowed().as_bytes()
+    }
+}
+
+/// Implementation of functionality for [`PyBytes`].
+///
+/// These methods are defined for the `Bound<'py, PyBytes>` smart pointer, so to use method call
+/// syntax these methods are separated into a trait, because stable Rust does not yet support
+/// `arbitrary_self_types`.
+#[doc(alias = "PyBytes")]
+pub trait PyBytesMethods<'py>: crate::sealed::Sealed {
+    /// Gets the Python string as a byte slice.
+    fn as_bytes(&self) -> &[u8];
+}
+
+impl<'py> PyBytesMethods<'py> for Bound<'py, PyBytes> {
+    #[inline]
+    fn as_bytes(&self) -> &[u8] {
+        self.as_borrowed().as_bytes()
+    }
+}
+
+impl<'a> Borrowed<'a, '_, PyBytes> {
+    /// Gets the Python string as a byte slice.
+    #[allow(clippy::wrong_self_convention)]
+    pub(crate) fn as_bytes(self) -> &'a [u8] {
+        unsafe {
+            let buffer = ffi::PyBytes_AsString(self.as_ptr()) as *const u8;
+            let length = ffi::PyBytes_Size(self.as_ptr()) as usize;
+            debug_assert!(!buffer.is_null());
+            std::slice::from_raw_parts(buffer, length)
+        }
+    }
+}
+
+impl Py<PyBytes> {
+    /// Gets the Python bytes as a byte slice. Because Python bytes are
+    /// immutable, the result may be used for as long as the reference to
+    /// `self` is held, including when the GIL is released.
+    pub fn as_bytes<'a>(&'a self, py: Python<'_>) -> &'a [u8] {
+        self.bind_borrowed(py).as_bytes()
+    }
+}
+
+/// This is the same way [Vec] is indexed.
+#[cfg(feature = "gil-refs")]
+impl<I: SliceIndex<[u8]>> Index<I> for PyBytes {
+    type Output = I::Output;
+
+    fn index(&self, index: I) -> &Self::Output {
+        &self.as_bytes()[index]
+    }
+}
+
+/// This is the same way [Vec] is indexed.
+impl<I: SliceIndex<[u8]>> Index<I> for Bound<'_, PyBytes> {
+    type Output = I::Output;
+
+    fn index(&self, index: I) -> &Self::Output {
+        &self.as_bytes()[index]
+    }
+}
+
+/// Compares whether the Python bytes object is equal to the [u8].
+///
+/// In some cases Python equality might be more appropriate; see the note on [`PyBytes`].
+impl PartialEq<[u8]> for Bound<'_, PyBytes> {
+    #[inline]
+    fn eq(&self, other: &[u8]) -> bool {
+        self.as_borrowed() == *other
+    }
+}
+
+/// Compares whether the Python bytes object is equal to the [u8].
+///
+/// In some cases Python equality might be more appropriate; see the note on [`PyBytes`].
+impl PartialEq<&'_ [u8]> for Bound<'_, PyBytes> {
+    #[inline]
+    fn eq(&self, other: &&[u8]) -> bool {
+        self.as_borrowed() == **other
+    }
+}
+
+/// Compares whether the Python bytes object is equal to the [u8].
+///
+/// In some cases Python equality might be more appropriate; see the note on [`PyBytes`].
+impl PartialEq<Bound<'_, PyBytes>> for [u8] {
+    #[inline]
+    fn eq(&self, other: &Bound<'_, PyBytes>) -> bool {
+        *self == other.as_borrowed()
+    }
+}
+
+/// Compares whether the Python bytes object is equal to the [u8].
+///
+/// In some cases Python equality might be more appropriate; see the note on [`PyBytes`].
+impl PartialEq<&'_ Bound<'_, PyBytes>> for [u8] {
+    #[inline]
+    fn eq(&self, other: &&Bound<'_, PyBytes>) -> bool {
+        *self == other.as_borrowed()
+    }
+}
+
+/// Compares whether the Python bytes object is equal to the [u8].
+///
+/// In some cases Python equality might be more appropriate; see the note on [`PyBytes`].
+impl PartialEq<Bound<'_, PyBytes>> for &'_ [u8] {
+    #[inline]
+    fn eq(&self, other: &Bound<'_, PyBytes>) -> bool {
+        **self == other.as_borrowed()
+    }
+}
+
+/// Compares whether the Python bytes object is equal to the [u8].
+///
+/// In some cases Python equality might be more appropriate; see the note on [`PyBytes`].
+impl PartialEq<[u8]> for &'_ Bound<'_, PyBytes> {
+    #[inline]
+    fn eq(&self, other: &[u8]) -> bool {
+        self.as_borrowed() == other
+    }
+}
+
+/// Compares whether the Python bytes object is equal to the [u8].
+///
+/// In some cases Python equality might be more appropriate; see the note on [`PyBytes`].
+impl PartialEq<[u8]> for Borrowed<'_, '_, PyBytes> {
+    #[inline]
+    fn eq(&self, other: &[u8]) -> bool {
+        self.as_bytes() == other
+    }
+}
+
+/// Compares whether the Python bytes object is equal to the [u8].
+///
+/// In some cases Python equality might be more appropriate; see the note on [`PyBytes`].
+impl PartialEq<&[u8]> for Borrowed<'_, '_, PyBytes> {
+    #[inline]
+    fn eq(&self, other: &&[u8]) -> bool {
+        *self == **other
+    }
+}
+
+/// Compares whether the Python bytes object is equal to the [u8].
+///
+/// In some cases Python equality might be more appropriate; see the note on [`PyBytes`].
+impl PartialEq<Borrowed<'_, '_, PyBytes>> for [u8] {
+    #[inline]
+    fn eq(&self, other: &Borrowed<'_, '_, PyBytes>) -> bool {
+        other == self
+    }
+}
+
+/// Compares whether the Python bytes object is equal to the [u8].
+///
+/// In some cases Python equality might be more appropriate; see the note on [`PyBytes`].
+impl PartialEq<Borrowed<'_, '_, PyBytes>> for &'_ [u8] {
+    #[inline]
+    fn eq(&self, other: &Borrowed<'_, '_, PyBytes>) -> bool {
+        other == self
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test_bytes_index() {
+        Python::with_gil(|py| {
+            let bytes = PyBytes::new_bound(py, b"Hello World");
+            assert_eq!(bytes[1], b'e');
+        });
+    }
+
+    #[test]
+    fn test_bound_bytes_index() {
+        Python::with_gil(|py| {
+            let bytes = PyBytes::new_bound(py, b"Hello World");
+            assert_eq!(bytes[1], b'e');
+
+            let bytes = &bytes;
+            assert_eq!(bytes[1], b'e');
+        });
+    }
+
+    #[test]
+    fn test_bytes_new_with() -> super::PyResult<()> {
+        Python::with_gil(|py| -> super::PyResult<()> {
+            let py_bytes = PyBytes::new_bound_with(py, 10, |b: &mut [u8]| {
+                b.copy_from_slice(b"Hello Rust");
+                Ok(())
+            })?;
+            let bytes: &[u8] = py_bytes.extract()?;
+            assert_eq!(bytes, b"Hello Rust");
+            Ok(())
+        })
+    }
+
+    #[test]
+    fn test_bytes_new_with_zero_initialised() -> super::PyResult<()> {
+        Python::with_gil(|py| -> super::PyResult<()> {
+            let py_bytes = PyBytes::new_bound_with(py, 10, |_b: &mut [u8]| Ok(()))?;
+            let bytes: &[u8] = py_bytes.extract()?;
+            assert_eq!(bytes, &[0; 10]);
+            Ok(())
+        })
+    }
+
+    #[test]
+    fn test_bytes_new_with_error() {
+        use crate::exceptions::PyValueError;
+        Python::with_gil(|py| {
+            let py_bytes_result = PyBytes::new_bound_with(py, 10, |_b: &mut [u8]| {
+                Err(PyValueError::new_err("Hello Crustaceans!"))
+            });
+            assert!(py_bytes_result.is_err());
+            assert!(py_bytes_result
+                .err()
+                .unwrap()
+                .is_instance_of::<PyValueError>(py));
+        });
+    }
+
+    #[test]
+    fn test_comparisons() {
+        Python::with_gil(|py| {
+            let b = b"hello, world".as_slice();
+            let py_bytes = PyBytes::new_bound(py, b);
+
+            assert_eq!(py_bytes, b"hello, world".as_slice());
+
+            assert_eq!(py_bytes, b);
+            assert_eq!(&py_bytes, b);
+            assert_eq!(b, py_bytes);
+            assert_eq!(b, &py_bytes);
+
+            assert_eq!(py_bytes, *b);
+            assert_eq!(&py_bytes, *b);
+            assert_eq!(*b, py_bytes);
+            assert_eq!(*b, &py_bytes);
+
+            let py_string = py_bytes.as_borrowed();
+
+            assert_eq!(py_string, b);
+            assert_eq!(&py_string, b);
+            assert_eq!(b, py_string);
+            assert_eq!(b, &py_string);
+
+            assert_eq!(py_string, *b);
+            assert_eq!(*b, py_string);
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/capsule.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/capsule.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/capsule.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/capsule.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,617 @@
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::py_result_ext::PyResultExt;
+#[cfg(feature = "gil-refs")]
+use crate::PyNativeType;
+use crate::{ffi, PyAny};
+use crate::{Bound, Python};
+use crate::{PyErr, PyResult};
+use std::ffi::{CStr, CString};
+use std::os::raw::{c_char, c_int, c_void};
+/// Represents a Python Capsule
+/// as described in [Capsules](https://docs.python.org/3/c-api/capsule.html#capsules):
+/// > This subtype of PyObject represents an opaque value, useful for C extension
+/// > modules who need to pass an opaque value (as a void* pointer) through Python
+/// > code to other C code. It is often used to make a C function pointer defined
+/// > in one module available to other modules, so the regular import mechanism can
+/// > be used to access C APIs defined in dynamically loaded modules.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyCapsule>`][crate::Py] or [`Bound<'py, PyCapsule>`][Bound].
+///
+/// For APIs available on capsule objects, see the [`PyCapsuleMethods`] trait which is implemented for
+/// [`Bound<'py, PyCapsule>`][Bound].
+///
+/// # Example
+/// ```
+/// use pyo3::{prelude::*, types::PyCapsule};
+/// use std::ffi::CString;
+///
+/// #[repr(C)]
+/// struct Foo {
+///     pub val: u32,
+/// }
+///
+/// let r = Python::with_gil(|py| -> PyResult<()> {
+///     let foo = Foo { val: 123 };
+///     let name = CString::new("builtins.capsule").unwrap();
+///
+///     let capsule = PyCapsule::new_bound(py, foo, Some(name.clone()))?;
+///
+///     let module = PyModule::import_bound(py, "builtins")?;
+///     module.add("capsule", capsule)?;
+///
+///     let cap: &Foo = unsafe { PyCapsule::import(py, name.as_ref())? };
+///     assert_eq!(cap.val, 123);
+///     Ok(())
+/// });
+/// assert!(r.is_ok());
+/// ```
+#[repr(transparent)]
+pub struct PyCapsule(PyAny);
+
+pyobject_native_type_core!(PyCapsule, pyobject_native_static_type_object!(ffi::PyCapsule_Type), #checkfunction=ffi::PyCapsule_CheckExact);
+
+impl PyCapsule {
+    /// Constructs a new capsule whose contents are `value`, associated with `name`.
+    /// `name` is the identifier for the capsule; if it is stored as an attribute of a module,
+    /// the name should be in the format `"modulename.attribute"`.
+    ///
+    /// It is checked at compile time that the type T is not zero-sized. Rust function items
+    /// need to be cast to a function pointer (`fn(args) -> result`) to be put into a capsule.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use pyo3::{prelude::*, types::PyCapsule};
+    /// use std::ffi::CString;
+    ///
+    /// Python::with_gil(|py| {
+    ///     let name = CString::new("foo").unwrap();
+    ///     let capsule = PyCapsule::new_bound(py, 123_u32, Some(name)).unwrap();
+    ///     let val = unsafe { capsule.reference::<u32>() };
+    ///     assert_eq!(*val, 123);
+    /// });
+    /// ```
+    ///
+    /// However, attempting to construct a `PyCapsule` with a zero-sized type will not compile:
+    ///
+    /// ```compile_fail
+    /// use pyo3::{prelude::*, types::PyCapsule};
+    /// use std::ffi::CString;
+    ///
+    /// Python::with_gil(|py| {
+    ///     let capsule = PyCapsule::new_bound(py, (), None).unwrap();  // Oops! `()` is zero sized!
+    /// });
+    /// ```
+    pub fn new_bound<T: 'static + Send + AssertNotZeroSized>(
+        py: Python<'_>,
+        value: T,
+        name: Option<CString>,
+    ) -> PyResult<Bound<'_, Self>> {
+        Self::new_bound_with_destructor(py, value, name, |_, _| {})
+    }
+
+    /// Constructs a new capsule whose contents are `value`, associated with `name`.
+    ///
+    /// Also provides a destructor: when the `PyCapsule` is destroyed, it will be passed the original object,
+    /// as well as a `*mut c_void` which will point to the capsule's context, if any.
+    ///
+    /// The `destructor` must be `Send`, because there is no guarantee which thread it will eventually
+    /// be called from.
+    pub fn new_bound_with_destructor<
+        T: 'static + Send + AssertNotZeroSized,
+        F: FnOnce(T, *mut c_void) + Send,
+    >(
+        py: Python<'_>,
+        value: T,
+        name: Option<CString>,
+        destructor: F,
+    ) -> PyResult<Bound<'_, Self>> {
+        AssertNotZeroSized::assert_not_zero_sized(&value);
+
+        // Sanity check for capsule layout
+        debug_assert_eq!(memoffset::offset_of!(CapsuleContents::<T, F>, value), 0);
+
+        let name_ptr = name.as_ref().map_or(std::ptr::null(), |name| name.as_ptr());
+        let val = Box::new(CapsuleContents {
+            value,
+            destructor,
+            name,
+        });
+
+        unsafe {
+            ffi::PyCapsule_New(
+                Box::into_raw(val).cast(),
+                name_ptr,
+                Some(capsule_destructor::<T, F>),
+            )
+            .assume_owned_or_err(py)
+            .downcast_into_unchecked()
+        }
+    }
+
+    /// Imports an existing capsule.
+    ///
+    /// The `name` should match the path to the module attribute exactly in the form
+    /// of `"module.attribute"`, which should be the same as the name within the capsule.
+    ///
+    /// # Safety
+    ///
+    /// It must be known that the capsule imported by `name` contains an item of type `T`.
+    pub unsafe fn import<'py, T>(py: Python<'py>, name: &CStr) -> PyResult<&'py T> {
+        let ptr = ffi::PyCapsule_Import(name.as_ptr(), false as c_int);
+        if ptr.is_null() {
+            Err(PyErr::fetch(py))
+        } else {
+            Ok(&*ptr.cast::<T>())
+        }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyCapsule {
+    /// Deprecated form of [`PyCapsule::new_bound`].
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyCapsule::new` will be replaced by `PyCapsule::new_bound` in a future PyO3 version"
+    )]
+    pub fn new<T: 'static + Send + AssertNotZeroSized>(
+        py: Python<'_>,
+        value: T,
+        name: Option<CString>,
+    ) -> PyResult<&Self> {
+        Self::new_bound(py, value, name).map(Bound::into_gil_ref)
+    }
+
+    /// Deprecated form of [`PyCapsule::new_bound_with_destructor`].
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyCapsule::new_with_destructor` will be replaced by `PyCapsule::new_bound_with_destructor` in a future PyO3 version"
+    )]
+    pub fn new_with_destructor<
+        T: 'static + Send + AssertNotZeroSized,
+        F: FnOnce(T, *mut c_void) + Send,
+    >(
+        py: Python<'_>,
+        value: T,
+        name: Option<CString>,
+        destructor: F,
+    ) -> PyResult<&'_ Self> {
+        Self::new_bound_with_destructor(py, value, name, destructor).map(Bound::into_gil_ref)
+    }
+
+    /// Sets the context pointer in the capsule.
+    ///
+    /// Returns an error if this capsule is not valid.
+    ///
+    /// # Notes
+    ///
+    /// The context is treated much like the value of the capsule, but should likely act as
+    /// a place to store any state management when using the capsule.
+    ///
+    /// If you want to store a Rust value as the context, and drop it from the destructor, use
+    /// `Box::into_raw` to convert it into a pointer, see the example.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use std::sync::mpsc::{channel, Sender};
+    /// use libc::c_void;
+    /// use pyo3::{prelude::*, types::PyCapsule};
+    ///
+    /// let (tx, rx) = channel::<String>();
+    ///
+    /// fn destructor(val: u32, context: *mut c_void) {
+    ///     let ctx = unsafe { *Box::from_raw(context.cast::<Sender<String>>()) };
+    ///     ctx.send("Destructor called!".to_string()).unwrap();
+    /// }
+    ///
+    /// Python::with_gil(|py| {
+    ///     let capsule =
+    ///         PyCapsule::new_bound_with_destructor(py, 123, None, destructor as fn(u32, *mut c_void))
+    ///             .unwrap();
+    ///     let context = Box::new(tx);  // `Sender<String>` is our context, box it up and ship it!
+    ///     capsule.set_context(Box::into_raw(context).cast()).unwrap();
+    ///     // This scope will end, causing our destructor to be called...
+    /// });
+    ///
+    /// assert_eq!(rx.recv(), Ok("Destructor called!".to_string()));
+    /// ```
+    pub fn set_context(&self, context: *mut c_void) -> PyResult<()> {
+        self.as_borrowed().set_context(context)
+    }
+
+    /// Gets the current context stored in the capsule. If there is no context, the pointer
+    /// will be null.
+    ///
+    /// Returns an error if this capsule is not valid.
+    pub fn context(&self) -> PyResult<*mut c_void> {
+        self.as_borrowed().context()
+    }
+
+    /// Obtains a reference to the value of this capsule.
+    ///
+    /// # Safety
+    ///
+    /// It must be known that this capsule is valid and its pointer is to an item of type `T`.
+    pub unsafe fn reference<T>(&self) -> &T {
+        self.as_borrowed().reference()
+    }
+
+    /// Gets the raw `c_void` pointer to the value in this capsule.
+    ///
+    /// Returns null if this capsule is not valid.
+    pub fn pointer(&self) -> *mut c_void {
+        self.as_borrowed().pointer()
+    }
+
+    /// Checks if this is a valid capsule.
+    ///
+    /// Returns true if the stored `pointer()` is non-null.
+    pub fn is_valid(&self) -> bool {
+        self.as_borrowed().is_valid()
+    }
+
+    /// Retrieves the name of this capsule, if set.
+    ///
+    /// Returns an error if this capsule is not valid.
+    pub fn name(&self) -> PyResult<Option<&CStr>> {
+        self.as_borrowed().name()
+    }
+}
+
+/// Implementation of functionality for [`PyCapsule`].
+///
+/// These methods are defined for the `Bound<'py, PyCapsule>` smart pointer, so to use method call
+/// syntax these methods are separated into a trait, because stable Rust does not yet support
+/// `arbitrary_self_types`.
+#[doc(alias = "PyCapsule")]
+pub trait PyCapsuleMethods<'py>: crate::sealed::Sealed {
+    /// Sets the context pointer in the capsule.
+    ///
+    /// Returns an error if this capsule is not valid.
+    ///
+    /// # Notes
+    ///
+    /// The context is treated much like the value of the capsule, but should likely act as
+    /// a place to store any state management when using the capsule.
+    ///
+    /// If you want to store a Rust value as the context, and drop it from the destructor, use
+    /// `Box::into_raw` to convert it into a pointer, see the example.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use std::sync::mpsc::{channel, Sender};
+    /// use libc::c_void;
+    /// use pyo3::{prelude::*, types::PyCapsule};
+    ///
+    /// let (tx, rx) = channel::<String>();
+    ///
+    /// fn destructor(val: u32, context: *mut c_void) {
+    ///     let ctx = unsafe { *Box::from_raw(context.cast::<Sender<String>>()) };
+    ///     ctx.send("Destructor called!".to_string()).unwrap();
+    /// }
+    ///
+    /// Python::with_gil(|py| {
+    ///     let capsule =
+    ///         PyCapsule::new_bound_with_destructor(py, 123, None, destructor as fn(u32, *mut c_void))
+    ///             .unwrap();
+    ///     let context = Box::new(tx);  // `Sender<String>` is our context, box it up and ship it!
+    ///     capsule.set_context(Box::into_raw(context).cast()).unwrap();
+    ///     // This scope will end, causing our destructor to be called...
+    /// });
+    ///
+    /// assert_eq!(rx.recv(), Ok("Destructor called!".to_string()));
+    /// ```
+    fn set_context(&self, context: *mut c_void) -> PyResult<()>;
+
+    /// Gets the current context stored in the capsule. If there is no context, the pointer
+    /// will be null.
+    ///
+    /// Returns an error if this capsule is not valid.
+    fn context(&self) -> PyResult<*mut c_void>;
+
+    /// Obtains a reference to the value of this capsule.
+    ///
+    /// # Safety
+    ///
+    /// It must be known that this capsule is valid and its pointer is to an item of type `T`.
+    unsafe fn reference<T>(&self) -> &'py T;
+
+    /// Gets the raw `c_void` pointer to the value in this capsule.
+    ///
+    /// Returns null if this capsule is not valid.
+    fn pointer(&self) -> *mut c_void;
+
+    /// Checks if this is a valid capsule.
+    ///
+    /// Returns true if the stored `pointer()` is non-null.
+    fn is_valid(&self) -> bool;
+
+    /// Retrieves the name of this capsule, if set.
+    ///
+    /// Returns an error if this capsule is not valid.
+    fn name(&self) -> PyResult<Option<&'py CStr>>;
+}
+
+impl<'py> PyCapsuleMethods<'py> for Bound<'py, PyCapsule> {
+    #[allow(clippy::not_unsafe_ptr_arg_deref)]
+    fn set_context(&self, context: *mut c_void) -> PyResult<()> {
+        let result = unsafe { ffi::PyCapsule_SetContext(self.as_ptr(), context) };
+        if result != 0 {
+            Err(PyErr::fetch(self.py()))
+        } else {
+            Ok(())
+        }
+    }
+
+    fn context(&self) -> PyResult<*mut c_void> {
+        let ctx = unsafe { ffi::PyCapsule_GetContext(self.as_ptr()) };
+        if ctx.is_null() {
+            ensure_no_error(self.py())?
+        }
+        Ok(ctx)
+    }
+
+    unsafe fn reference<T>(&self) -> &'py T {
+        &*self.pointer().cast()
+    }
+
+    fn pointer(&self) -> *mut c_void {
+        unsafe {
+            let ptr = ffi::PyCapsule_GetPointer(self.as_ptr(), name_ptr_ignore_error(self));
+            if ptr.is_null() {
+                ffi::PyErr_Clear();
+            }
+            ptr
+        }
+    }
+
+    fn is_valid(&self) -> bool {
+        // As well as if the stored pointer is null, PyCapsule_IsValid also returns false if
+        // self.as_ptr() is null or not a ptr to a PyCapsule object. Both of these are guaranteed
+        // to not be the case thanks to invariants of this PyCapsule struct.
+        let r = unsafe { ffi::PyCapsule_IsValid(self.as_ptr(), name_ptr_ignore_error(self)) };
+        r != 0
+    }
+
+    fn name(&self) -> PyResult<Option<&'py CStr>> {
+        unsafe {
+            let ptr = ffi::PyCapsule_GetName(self.as_ptr());
+            if ptr.is_null() {
+                ensure_no_error(self.py())?;
+                Ok(None)
+            } else {
+                Ok(Some(CStr::from_ptr(ptr)))
+            }
+        }
+    }
+}
+
+// C layout, as PyCapsule::get_reference depends on `T` being first.
+#[repr(C)]
+struct CapsuleContents<T: 'static + Send, D: FnOnce(T, *mut c_void) + Send> {
+    /// Value of the capsule
+    value: T,
+    /// Destructor to be used by the capsule
+    destructor: D,
+    /// Name used when creating the capsule
+    name: Option<CString>,
+}
+
+// Wrapping ffi::PyCapsule_Destructor for a user supplied FnOnce(T) for capsule destructor
+unsafe extern "C" fn capsule_destructor<T: 'static + Send, F: FnOnce(T, *mut c_void) + Send>(
+    capsule: *mut ffi::PyObject,
+) {
+    let ptr = ffi::PyCapsule_GetPointer(capsule, ffi::PyCapsule_GetName(capsule));
+    let ctx = ffi::PyCapsule_GetContext(capsule);
+    let CapsuleContents {
+        value, destructor, ..
+    } = *Box::from_raw(ptr.cast::<CapsuleContents<T, F>>());
+    destructor(value, ctx)
+}
+
+/// Guarantee `T` is not zero sized at compile time.
+// credit: `<https://users.rust-lang.org/t/is-it-possible-to-assert-at-compile-time-that-foo-t-is-not-called-with-a-zst/67685>`
+#[doc(hidden)]
+pub trait AssertNotZeroSized: Sized {
+    const _CONDITION: usize = (std::mem::size_of::<Self>() == 0) as usize;
+    const _CHECK: &'static str =
+        ["PyCapsule value type T must not be zero-sized!"][Self::_CONDITION];
+    #[allow(path_statements, clippy::no_effect)]
+    fn assert_not_zero_sized(&self) {
+        <Self as AssertNotZeroSized>::_CHECK;
+    }
+}
+
+impl<T> AssertNotZeroSized for T {}
+
+fn ensure_no_error(py: Python<'_>) -> PyResult<()> {
+    if let Some(err) = PyErr::take(py) {
+        Err(err)
+    } else {
+        Ok(())
+    }
+}
+
+fn name_ptr_ignore_error(slf: &Bound<'_, PyCapsule>) -> *const c_char {
+    let ptr = unsafe { ffi::PyCapsule_GetName(slf.as_ptr()) };
+    if ptr.is_null() {
+        unsafe { ffi::PyErr_Clear() };
+    }
+    ptr
+}
+
+#[cfg(test)]
+mod tests {
+    use libc::c_void;
+
+    use crate::prelude::PyModule;
+    use crate::types::capsule::PyCapsuleMethods;
+    use crate::types::module::PyModuleMethods;
+    use crate::{types::PyCapsule, Py, PyResult, Python};
+    use std::ffi::CString;
+    use std::sync::mpsc::{channel, Sender};
+
+    #[test]
+    fn test_pycapsule_struct() -> PyResult<()> {
+        #[repr(C)]
+        struct Foo {
+            pub val: u32,
+        }
+
+        impl Foo {
+            fn get_val(&self) -> u32 {
+                self.val
+            }
+        }
+
+        Python::with_gil(|py| -> PyResult<()> {
+            let foo = Foo { val: 123 };
+            let name = CString::new("foo").unwrap();
+
+            let cap = PyCapsule::new_bound(py, foo, Some(name.clone()))?;
+            assert!(cap.is_valid());
+
+            let foo_capi = unsafe { cap.reference::<Foo>() };
+            assert_eq!(foo_capi.val, 123);
+            assert_eq!(foo_capi.get_val(), 123);
+            assert_eq!(cap.name().unwrap(), Some(name.as_ref()));
+            Ok(())
+        })
+    }
+
+    #[test]
+    fn test_pycapsule_func() {
+        fn foo(x: u32) -> u32 {
+            x
+        }
+
+        let cap: Py<PyCapsule> = Python::with_gil(|py| {
+            let name = CString::new("foo").unwrap();
+            let cap = PyCapsule::new_bound(py, foo as fn(u32) -> u32, Some(name)).unwrap();
+            cap.into()
+        });
+
+        Python::with_gil(move |py| {
+            let f = unsafe { cap.bind(py).reference::<fn(u32) -> u32>() };
+            assert_eq!(f(123), 123);
+        });
+    }
+
+    #[test]
+    fn test_pycapsule_context() -> PyResult<()> {
+        Python::with_gil(|py| {
+            let name = CString::new("foo").unwrap();
+            let cap = PyCapsule::new_bound(py, 0, Some(name))?;
+
+            let c = cap.context()?;
+            assert!(c.is_null());
+
+            let ctx = Box::new(123_u32);
+            cap.set_context(Box::into_raw(ctx).cast())?;
+
+            let ctx_ptr: *mut c_void = cap.context()?;
+            let ctx = unsafe { *Box::from_raw(ctx_ptr.cast::<u32>()) };
+            assert_eq!(ctx, 123);
+            Ok(())
+        })
+    }
+
+    #[test]
+    fn test_pycapsule_import() -> PyResult<()> {
+        #[repr(C)]
+        struct Foo {
+            pub val: u32,
+        }
+
+        Python::with_gil(|py| -> PyResult<()> {
+            let foo = Foo { val: 123 };
+            let name = CString::new("builtins.capsule").unwrap();
+
+            let capsule = PyCapsule::new_bound(py, foo, Some(name.clone()))?;
+
+            let module = PyModule::import_bound(py, "builtins")?;
+            module.add("capsule", capsule)?;
+
+            // check error when wrong named passed for capsule.
+            let wrong_name = CString::new("builtins.non_existant").unwrap();
+            let result: PyResult<&Foo> = unsafe { PyCapsule::import(py, wrong_name.as_ref()) };
+            assert!(result.is_err());
+
+            // corret name is okay.
+            let cap: &Foo = unsafe { PyCapsule::import(py, name.as_ref())? };
+            assert_eq!(cap.val, 123);
+            Ok(())
+        })
+    }
+
+    #[test]
+    fn test_vec_storage() {
+        let cap: Py<PyCapsule> = Python::with_gil(|py| {
+            let name = CString::new("foo").unwrap();
+
+            let stuff: Vec<u8> = vec![1, 2, 3, 4];
+            let cap = PyCapsule::new_bound(py, stuff, Some(name)).unwrap();
+
+            cap.into()
+        });
+
+        Python::with_gil(move |py| {
+            let ctx: &Vec<u8> = unsafe { cap.bind(py).reference() };
+            assert_eq!(ctx, &[1, 2, 3, 4]);
+        })
+    }
+
+    #[test]
+    fn test_vec_context() {
+        let context: Vec<u8> = vec![1, 2, 3, 4];
+
+        let cap: Py<PyCapsule> = Python::with_gil(|py| {
+            let name = CString::new("foo").unwrap();
+            let cap = PyCapsule::new_bound(py, 0, Some(name)).unwrap();
+            cap.set_context(Box::into_raw(Box::new(&context)).cast())
+                .unwrap();
+
+            cap.into()
+        });
+
+        Python::with_gil(move |py| {
+            let ctx_ptr: *mut c_void = cap.bind(py).context().unwrap();
+            let ctx = unsafe { *Box::from_raw(ctx_ptr.cast::<&Vec<u8>>()) };
+            assert_eq!(ctx, &vec![1_u8, 2, 3, 4]);
+        })
+    }
+
+    #[test]
+    fn test_pycapsule_destructor() {
+        let (tx, rx) = channel::<bool>();
+
+        fn destructor(_val: u32, ctx: *mut c_void) {
+            assert!(!ctx.is_null());
+            let context = unsafe { *Box::from_raw(ctx.cast::<Sender<bool>>()) };
+            context.send(true).unwrap();
+        }
+
+        Python::with_gil(move |py| {
+            let name = CString::new("foo").unwrap();
+            let cap = PyCapsule::new_bound_with_destructor(py, 0, Some(name), destructor).unwrap();
+            cap.set_context(Box::into_raw(Box::new(tx)).cast()).unwrap();
+        });
+
+        // the destructor was called.
+        assert_eq!(rx.recv(), Ok(true));
+    }
+
+    #[test]
+    fn test_pycapsule_no_name() {
+        Python::with_gil(|py| {
+            let cap = PyCapsule::new_bound(py, 0usize, None).unwrap();
+
+            assert_eq!(unsafe { cap.reference::<usize>() }, &0usize);
+            assert_eq!(cap.name().unwrap(), None);
+            assert_eq!(cap.context().unwrap(), std::ptr::null_mut());
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/code.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/code.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/code.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/code.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,29 @@
+use crate::ffi;
+use crate::PyAny;
+
+/// Represents a Python code object.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyCode>`][crate::Py] or [`Bound<'py, PyCode>`][crate::Bound].
+#[repr(transparent)]
+pub struct PyCode(PyAny);
+
+pyobject_native_type_core!(
+    PyCode,
+    pyobject_native_static_type_object!(ffi::PyCode_Type),
+    #checkfunction=ffi::PyCode_Check
+);
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::types::PyTypeMethods;
+    use crate::{PyTypeInfo, Python};
+
+    #[test]
+    fn test_type_object() {
+        Python::with_gil(|py| {
+            assert_eq!(PyCode::type_object_bound(py).name().unwrap(), "code");
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/complex.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/complex.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/complex.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/complex.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,319 @@
+#[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+use crate::py_result_ext::PyResultExt;
+#[cfg(feature = "gil-refs")]
+use crate::PyNativeType;
+use crate::{ffi, types::any::PyAnyMethods, Bound, PyAny, Python};
+use std::os::raw::c_double;
+
+/// Represents a Python [`complex`](https://docs.python.org/3/library/functions.html#complex) object.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyComplex>`][crate::Py] or [`Bound<'py, PyComplex>`][Bound].
+///
+/// For APIs available on `complex` objects, see the [`PyComplexMethods`] trait which is implemented for
+/// [`Bound<'py, PyComplex>`][Bound].
+///
+/// Note that `PyComplex` supports only basic operations. For advanced operations
+/// consider using [num-complex](https://docs.rs/num-complex)'s [`Complex`] type instead.
+/// This optional dependency can be activated with the `num-complex` feature flag.
+///
+/// [`Complex`]: https://docs.rs/num-complex/latest/num_complex/struct.Complex.html
+#[repr(transparent)]
+pub struct PyComplex(PyAny);
+
+pyobject_native_type!(
+    PyComplex,
+    ffi::PyComplexObject,
+    pyobject_native_static_type_object!(ffi::PyComplex_Type),
+    #checkfunction=ffi::PyComplex_Check
+);
+
+impl PyComplex {
+    /// Creates a new `PyComplex` from the given real and imaginary values.
+    pub fn from_doubles_bound(
+        py: Python<'_>,
+        real: c_double,
+        imag: c_double,
+    ) -> Bound<'_, PyComplex> {
+        use crate::ffi_ptr_ext::FfiPtrExt;
+        unsafe {
+            ffi::PyComplex_FromDoubles(real, imag)
+                .assume_owned(py)
+                .downcast_into_unchecked()
+        }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyComplex {
+    /// Deprecated form of [`PyComplex::from_doubles_bound`]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyComplex::from_doubles` will be replaced by `PyComplex::from_doubles_bound` in a future PyO3 version"
+    )]
+    pub fn from_doubles(py: Python<'_>, real: c_double, imag: c_double) -> &PyComplex {
+        Self::from_doubles_bound(py, real, imag).into_gil_ref()
+    }
+
+    /// Returns the real part of the complex number.
+    pub fn real(&self) -> c_double {
+        self.as_borrowed().real()
+    }
+    /// Returns the imaginary part of the complex number.
+    pub fn imag(&self) -> c_double {
+        self.as_borrowed().imag()
+    }
+}
+
+#[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+mod not_limited_impls {
+    use crate::Borrowed;
+
+    use super::*;
+    use std::ops::{Add, Div, Mul, Neg, Sub};
+
+    #[cfg(feature = "gil-refs")]
+    impl PyComplex {
+        /// Returns `|self|`.
+        pub fn abs(&self) -> c_double {
+            self.as_borrowed().abs()
+        }
+        /// Returns `self` raised to the power of `other`.
+        pub fn pow<'py>(&'py self, other: &'py PyComplex) -> &'py PyComplex {
+            self.as_borrowed().pow(&other.as_borrowed()).into_gil_ref()
+        }
+    }
+
+    macro_rules! bin_ops {
+        ($trait:ident, $fn:ident, $op:tt) => {
+            impl<'py> $trait for Borrowed<'_, 'py, PyComplex> {
+                type Output = Bound<'py, PyComplex>;
+                fn $fn(self, other: Self) -> Self::Output {
+                    PyAnyMethods::$fn(self.as_any(), other)
+                    .downcast_into().expect(
+                        concat!("Complex method ",
+                            stringify!($fn),
+                            " failed.")
+                        )
+                }
+            }
+
+            #[cfg(feature = "gil-refs")]
+            impl<'py> $trait for &'py PyComplex {
+                type Output = &'py PyComplex;
+                fn $fn(self, other: &'py PyComplex) -> &'py PyComplex {
+                    (self.as_borrowed() $op other.as_borrowed()).into_gil_ref()
+                }
+            }
+
+            impl<'py> $trait for &Bound<'py, PyComplex> {
+                type Output = Bound<'py, PyComplex>;
+                fn $fn(self, other: &Bound<'py, PyComplex>) -> Bound<'py, PyComplex> {
+                    self.as_borrowed() $op other.as_borrowed()
+                }
+            }
+
+            impl<'py> $trait<Bound<'py, PyComplex>> for &Bound<'py, PyComplex> {
+                type Output = Bound<'py, PyComplex>;
+                fn $fn(self, other: Bound<'py, PyComplex>) -> Bound<'py, PyComplex> {
+                    self.as_borrowed() $op other.as_borrowed()
+                }
+            }
+
+            impl<'py> $trait for Bound<'py, PyComplex> {
+                type Output = Bound<'py, PyComplex>;
+                fn $fn(self, other: Bound<'py, PyComplex>) -> Bound<'py, PyComplex> {
+                    self.as_borrowed() $op other.as_borrowed()
+                }
+            }
+
+            impl<'py> $trait<&Self> for Bound<'py, PyComplex> {
+                type Output = Bound<'py, PyComplex>;
+                fn $fn(self, other: &Bound<'py, PyComplex>) -> Bound<'py, PyComplex> {
+                    self.as_borrowed() $op other.as_borrowed()
+                }
+            }
+        };
+    }
+
+    bin_ops!(Add, add, +);
+    bin_ops!(Sub, sub, -);
+    bin_ops!(Mul, mul, *);
+    bin_ops!(Div, div, /);
+
+    #[cfg(feature = "gil-refs")]
+    impl<'py> Neg for &'py PyComplex {
+        type Output = &'py PyComplex;
+        fn neg(self) -> &'py PyComplex {
+            (-self.as_borrowed()).into_gil_ref()
+        }
+    }
+
+    impl<'py> Neg for Borrowed<'_, 'py, PyComplex> {
+        type Output = Bound<'py, PyComplex>;
+        fn neg(self) -> Self::Output {
+            PyAnyMethods::neg(self.as_any())
+                .downcast_into()
+                .expect("Complex method __neg__ failed.")
+        }
+    }
+
+    impl<'py> Neg for &Bound<'py, PyComplex> {
+        type Output = Bound<'py, PyComplex>;
+        fn neg(self) -> Bound<'py, PyComplex> {
+            -self.as_borrowed()
+        }
+    }
+
+    impl<'py> Neg for Bound<'py, PyComplex> {
+        type Output = Bound<'py, PyComplex>;
+        fn neg(self) -> Bound<'py, PyComplex> {
+            -self.as_borrowed()
+        }
+    }
+
+    #[cfg(test)]
+    mod tests {
+        use super::PyComplex;
+        use crate::{types::complex::PyComplexMethods, Python};
+        use assert_approx_eq::assert_approx_eq;
+
+        #[test]
+        fn test_add() {
+            Python::with_gil(|py| {
+                let l = PyComplex::from_doubles_bound(py, 3.0, 1.2);
+                let r = PyComplex::from_doubles_bound(py, 1.0, 2.6);
+                let res = l + r;
+                assert_approx_eq!(res.real(), 4.0);
+                assert_approx_eq!(res.imag(), 3.8);
+            });
+        }
+
+        #[test]
+        fn test_sub() {
+            Python::with_gil(|py| {
+                let l = PyComplex::from_doubles_bound(py, 3.0, 1.2);
+                let r = PyComplex::from_doubles_bound(py, 1.0, 2.6);
+                let res = l - r;
+                assert_approx_eq!(res.real(), 2.0);
+                assert_approx_eq!(res.imag(), -1.4);
+            });
+        }
+
+        #[test]
+        fn test_mul() {
+            Python::with_gil(|py| {
+                let l = PyComplex::from_doubles_bound(py, 3.0, 1.2);
+                let r = PyComplex::from_doubles_bound(py, 1.0, 2.6);
+                let res = l * r;
+                assert_approx_eq!(res.real(), -0.12);
+                assert_approx_eq!(res.imag(), 9.0);
+            });
+        }
+
+        #[test]
+        fn test_div() {
+            Python::with_gil(|py| {
+                let l = PyComplex::from_doubles_bound(py, 3.0, 1.2);
+                let r = PyComplex::from_doubles_bound(py, 1.0, 2.6);
+                let res = l / r;
+                assert_approx_eq!(res.real(), 0.788_659_793_814_432_9);
+                assert_approx_eq!(res.imag(), -0.850_515_463_917_525_7);
+            });
+        }
+
+        #[test]
+        fn test_neg() {
+            Python::with_gil(|py| {
+                let val = PyComplex::from_doubles_bound(py, 3.0, 1.2);
+                let res = -val;
+                assert_approx_eq!(res.real(), -3.0);
+                assert_approx_eq!(res.imag(), -1.2);
+            });
+        }
+
+        #[test]
+        fn test_abs() {
+            Python::with_gil(|py| {
+                let val = PyComplex::from_doubles_bound(py, 3.0, 1.2);
+                assert_approx_eq!(val.abs(), 3.231_098_884_280_702_2);
+            });
+        }
+
+        #[test]
+        fn test_pow() {
+            Python::with_gil(|py| {
+                let l = PyComplex::from_doubles_bound(py, 3.0, 1.2);
+                let r = PyComplex::from_doubles_bound(py, 1.2, 2.6);
+                let val = l.pow(&r);
+                assert_approx_eq!(val.real(), -1.419_309_997_016_603_7);
+                assert_approx_eq!(val.imag(), -0.541_297_466_033_544_6);
+            });
+        }
+    }
+}
+
+/// Implementation of functionality for [`PyComplex`].
+///
+/// These methods are defined for the `Bound<'py, PyComplex>` smart pointer, so to use method call
+/// syntax these methods are separated into a trait, because stable Rust does not yet support
+/// `arbitrary_self_types`.
+#[doc(alias = "PyComplex")]
+pub trait PyComplexMethods<'py>: crate::sealed::Sealed {
+    /// Returns the real part of the complex number.
+    fn real(&self) -> c_double;
+    /// Returns the imaginary part of the complex number.
+    fn imag(&self) -> c_double;
+    /// Returns `|self|`.
+    #[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+    fn abs(&self) -> c_double;
+    /// Returns `self` raised to the power of `other`.
+    #[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+    fn pow(&self, other: &Bound<'py, PyComplex>) -> Bound<'py, PyComplex>;
+}
+
+impl<'py> PyComplexMethods<'py> for Bound<'py, PyComplex> {
+    fn real(&self) -> c_double {
+        unsafe { ffi::PyComplex_RealAsDouble(self.as_ptr()) }
+    }
+
+    fn imag(&self) -> c_double {
+        unsafe { ffi::PyComplex_ImagAsDouble(self.as_ptr()) }
+    }
+
+    #[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+    fn abs(&self) -> c_double {
+        PyAnyMethods::abs(self.as_any())
+            .downcast_into()
+            .expect("Complex method __abs__ failed.")
+            .extract()
+            .expect("Failed to extract to c double.")
+    }
+
+    #[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+    fn pow(&self, other: &Bound<'py, PyComplex>) -> Bound<'py, PyComplex> {
+        Python::with_gil(|py| {
+            PyAnyMethods::pow(self.as_any(), other, py.None())
+                .downcast_into()
+                .expect("Complex method __pow__ failed.")
+        })
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::PyComplex;
+    use crate::{types::complex::PyComplexMethods, Python};
+    use assert_approx_eq::assert_approx_eq;
+
+    #[test]
+    fn test_from_double() {
+        use assert_approx_eq::assert_approx_eq;
+
+        Python::with_gil(|py| {
+            let complex = PyComplex::from_doubles_bound(py, 3.0, 1.2);
+            assert_approx_eq!(complex.real(), 3.0);
+            assert_approx_eq!(complex.imag(), 1.2);
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/datetime.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/datetime.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/datetime.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/datetime.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1051 @@
+//! Safe Rust wrappers for types defined in the Python `datetime` library
+//!
+//! For more details about these types, see the [Python
+//! documentation](https://docs.python.org/3/library/datetime.html)
+
+use crate::err::PyResult;
+use crate::ffi::{
+    self, PyDateTime_CAPI, PyDateTime_FromTimestamp, PyDateTime_IMPORT, PyDate_FromTimestamp,
+};
+use crate::ffi::{
+    PyDateTime_DATE_GET_FOLD, PyDateTime_DATE_GET_HOUR, PyDateTime_DATE_GET_MICROSECOND,
+    PyDateTime_DATE_GET_MINUTE, PyDateTime_DATE_GET_SECOND,
+};
+#[cfg(GraalPy)]
+use crate::ffi::{PyDateTime_DATE_GET_TZINFO, PyDateTime_TIME_GET_TZINFO, Py_IsNone};
+use crate::ffi::{
+    PyDateTime_DELTA_GET_DAYS, PyDateTime_DELTA_GET_MICROSECONDS, PyDateTime_DELTA_GET_SECONDS,
+};
+use crate::ffi::{PyDateTime_GET_DAY, PyDateTime_GET_MONTH, PyDateTime_GET_YEAR};
+use crate::ffi::{
+    PyDateTime_TIME_GET_FOLD, PyDateTime_TIME_GET_HOUR, PyDateTime_TIME_GET_MICROSECOND,
+    PyDateTime_TIME_GET_MINUTE, PyDateTime_TIME_GET_SECOND,
+};
+use crate::ffi_ptr_ext::FfiPtrExt;
+#[cfg(feature = "gil-refs")]
+use crate::instance::PyNativeType;
+use crate::py_result_ext::PyResultExt;
+use crate::types::any::PyAnyMethods;
+use crate::types::PyTuple;
+use crate::{Bound, IntoPy, Py, PyAny, PyErr, Python};
+use std::os::raw::c_int;
+#[cfg(feature = "chrono")]
+use std::ptr;
+
+fn ensure_datetime_api(py: Python<'_>) -> PyResult<&'static PyDateTime_CAPI> {
+    if let Some(api) = unsafe { pyo3_ffi::PyDateTimeAPI().as_ref() } {
+        Ok(api)
+    } else {
+        unsafe {
+            PyDateTime_IMPORT();
+            pyo3_ffi::PyDateTimeAPI().as_ref()
+        }
+        .ok_or_else(|| PyErr::fetch(py))
+    }
+}
+
+fn expect_datetime_api(py: Python<'_>) -> &'static PyDateTime_CAPI {
+    ensure_datetime_api(py).expect("failed to import `datetime` C API")
+}
+
+// Type Check macros
+//
+// These are bindings around the C API typecheck macros, all of them return
+// `1` if True and `0` if False. In all type check macros, the argument (`op`)
+// must not be `NULL`. The implementations here all call ensure_datetime_api
+// to ensure that the PyDateTimeAPI is initialized before use
+//
+//
+// # Safety
+//
+// These functions must only be called when the GIL is held!
+
+macro_rules! ffi_fun_with_autoinit {
+    ($(#[$outer:meta] unsafe fn $name: ident($arg: ident: *mut PyObject) -> $ret: ty;)*) => {
+        $(
+            #[$outer]
+            #[allow(non_snake_case)]
+            /// # Safety
+            ///
+            /// Must only be called while the GIL is held
+            unsafe fn $name($arg: *mut crate::ffi::PyObject) -> $ret {
+
+                let _ = ensure_datetime_api(Python::assume_gil_acquired());
+                crate::ffi::$name($arg)
+            }
+        )*
+
+
+    };
+}
+
+ffi_fun_with_autoinit! {
+    /// Check if `op` is a `PyDateTimeAPI.DateType` or subtype.
+    unsafe fn PyDate_Check(op: *mut PyObject) -> c_int;
+
+    /// Check if `op` is a `PyDateTimeAPI.DateTimeType` or subtype.
+    unsafe fn PyDateTime_Check(op: *mut PyObject) -> c_int;
+
+    /// Check if `op` is a `PyDateTimeAPI.TimeType` or subtype.
+    unsafe fn PyTime_Check(op: *mut PyObject) -> c_int;
+
+    /// Check if `op` is a `PyDateTimeAPI.DetaType` or subtype.
+    unsafe fn PyDelta_Check(op: *mut PyObject) -> c_int;
+
+    /// Check if `op` is a `PyDateTimeAPI.TZInfoType` or subtype.
+    unsafe fn PyTZInfo_Check(op: *mut PyObject) -> c_int;
+}
+
+// Access traits
+
+/// Trait for accessing the date components of a struct containing a date.
+pub trait PyDateAccess {
+    /// Returns the year, as a positive int.
+    ///
+    /// Implementations should conform to the upstream documentation:
+    /// <https://docs.python.org/3/c-api/datetime.html#c.PyDateTime_GET_YEAR>
+    fn get_year(&self) -> i32;
+    /// Returns the month, as an int from 1 through 12.
+    ///
+    /// Implementations should conform to the upstream documentation:
+    /// <https://docs.python.org/3/c-api/datetime.html#c.PyDateTime_GET_MONTH>
+    fn get_month(&self) -> u8;
+    /// Returns the day, as an int from 1 through 31.
+    ///
+    /// Implementations should conform to the upstream documentation:
+    /// <https://docs.python.org/3/c-api/datetime.html#c.PyDateTime_GET_DAY>
+    fn get_day(&self) -> u8;
+}
+
+/// Trait for accessing the components of a struct containing a timedelta.
+///
+/// Note: These access the individual components of a (day, second,
+/// microsecond) representation of the delta, they are *not* intended as
+/// aliases for calculating the total duration in each of these units.
+pub trait PyDeltaAccess {
+    /// Returns the number of days, as an int from -999999999 to 999999999.
+    ///
+    /// Implementations should conform to the upstream documentation:
+    /// <https://docs.python.org/3/c-api/datetime.html#c.PyDateTime_DELTA_GET_DAYS>
+    fn get_days(&self) -> i32;
+    /// Returns the number of seconds, as an int from 0 through 86399.
+    ///
+    /// Implementations should conform to the upstream documentation:
+    /// <https://docs.python.org/3/c-api/datetime.html#c.PyDateTime_DELTA_GET_DAYS>
+    fn get_seconds(&self) -> i32;
+    /// Returns the number of microseconds, as an int from 0 through 999999.
+    ///
+    /// Implementations should conform to the upstream documentation:
+    /// <https://docs.python.org/3/c-api/datetime.html#c.PyDateTime_DELTA_GET_DAYS>
+    fn get_microseconds(&self) -> i32;
+}
+
+/// Trait for accessing the time components of a struct containing a time.
+pub trait PyTimeAccess {
+    /// Returns the hour, as an int from 0 through 23.
+    ///
+    /// Implementations should conform to the upstream documentation:
+    /// <https://docs.python.org/3/c-api/datetime.html#c.PyDateTime_DATE_GET_HOUR>
+    fn get_hour(&self) -> u8;
+    /// Returns the minute, as an int from 0 through 59.
+    ///
+    /// Implementations should conform to the upstream documentation:
+    /// <https://docs.python.org/3/c-api/datetime.html#c.PyDateTime_DATE_GET_MINUTE>
+    fn get_minute(&self) -> u8;
+    /// Returns the second, as an int from 0 through 59.
+    ///
+    /// Implementations should conform to the upstream documentation:
+    /// <https://docs.python.org/3/c-api/datetime.html#c.PyDateTime_DATE_GET_SECOND>
+    fn get_second(&self) -> u8;
+    /// Returns the microsecond, as an int from 0 through 999999.
+    ///
+    /// Implementations should conform to the upstream documentation:
+    /// <https://docs.python.org/3/c-api/datetime.html#c.PyDateTime_DATE_GET_MICROSECOND>
+    fn get_microsecond(&self) -> u32;
+    /// Returns whether this date is the later of two moments with the
+    /// same representation, during a repeated interval.
+    ///
+    /// This typically occurs at the end of daylight savings time. Only valid if the
+    /// represented time is ambiguous.
+    /// See [PEP 495](https://www.python.org/dev/peps/pep-0495/) for more detail.
+    fn get_fold(&self) -> bool;
+}
+
+/// Trait for accessing the components of a struct containing a tzinfo.
+pub trait PyTzInfoAccess<'py> {
+    /// Deprecated form of `get_tzinfo_bound`.
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`get_tzinfo` will be replaced by `get_tzinfo_bound` in a future PyO3 version"
+    )]
+    fn get_tzinfo(&self) -> Option<&'py PyTzInfo> {
+        self.get_tzinfo_bound().map(Bound::into_gil_ref)
+    }
+
+    /// Returns the tzinfo (which may be None).
+    ///
+    /// Implementations should conform to the upstream documentation:
+    /// <https://docs.python.org/3/c-api/datetime.html#c.PyDateTime_DATE_GET_TZINFO>
+    /// <https://docs.python.org/3/c-api/datetime.html#c.PyDateTime_TIME_GET_TZINFO>
+    fn get_tzinfo_bound(&self) -> Option<Bound<'py, PyTzInfo>>;
+}
+
+/// Bindings around `datetime.date`.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyDate>`][crate::Py] or [`Bound<'py, PyDate>`][Bound].
+#[repr(transparent)]
+pub struct PyDate(PyAny);
+pyobject_native_type!(
+    PyDate,
+    crate::ffi::PyDateTime_Date,
+    |py| expect_datetime_api(py).DateType,
+    #module=Some("datetime"),
+    #checkfunction=PyDate_Check
+);
+
+impl PyDate {
+    /// Deprecated form of [`PyDate::new_bound`].
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyDate::new` will be replaced by `PyDate::new_bound` in a future PyO3 version"
+    )]
+    pub fn new(py: Python<'_>, year: i32, month: u8, day: u8) -> PyResult<&PyDate> {
+        Self::new_bound(py, year, month, day).map(Bound::into_gil_ref)
+    }
+
+    /// Creates a new `datetime.date`.
+    pub fn new_bound(py: Python<'_>, year: i32, month: u8, day: u8) -> PyResult<Bound<'_, PyDate>> {
+        let api = ensure_datetime_api(py)?;
+        unsafe {
+            (api.Date_FromDate)(year, c_int::from(month), c_int::from(day), api.DateType)
+                .assume_owned_or_err(py)
+                .downcast_into_unchecked()
+        }
+    }
+
+    /// Deprecated form of [`PyDate::from_timestamp_bound`].
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyDate::from_timestamp` will be replaced by `PyDate::from_timestamp_bound` in a future PyO3 version"
+    )]
+    pub fn from_timestamp(py: Python<'_>, timestamp: i64) -> PyResult<&PyDate> {
+        Self::from_timestamp_bound(py, timestamp).map(Bound::into_gil_ref)
+    }
+
+    /// Construct a `datetime.date` from a POSIX timestamp
+    ///
+    /// This is equivalent to `datetime.date.fromtimestamp`
+    pub fn from_timestamp_bound(py: Python<'_>, timestamp: i64) -> PyResult<Bound<'_, PyDate>> {
+        let time_tuple = PyTuple::new_bound(py, [timestamp]);
+
+        // safety ensure that the API is loaded
+        let _api = ensure_datetime_api(py)?;
+
+        unsafe {
+            PyDate_FromTimestamp(time_tuple.as_ptr())
+                .assume_owned_or_err(py)
+                .downcast_into_unchecked()
+        }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyDateAccess for PyDate {
+    fn get_year(&self) -> i32 {
+        self.as_borrowed().get_year()
+    }
+
+    fn get_month(&self) -> u8 {
+        self.as_borrowed().get_month()
+    }
+
+    fn get_day(&self) -> u8 {
+        self.as_borrowed().get_day()
+    }
+}
+
+impl PyDateAccess for Bound<'_, PyDate> {
+    fn get_year(&self) -> i32 {
+        unsafe { PyDateTime_GET_YEAR(self.as_ptr()) }
+    }
+
+    fn get_month(&self) -> u8 {
+        unsafe { PyDateTime_GET_MONTH(self.as_ptr()) as u8 }
+    }
+
+    fn get_day(&self) -> u8 {
+        unsafe { PyDateTime_GET_DAY(self.as_ptr()) as u8 }
+    }
+}
+
+/// Bindings for `datetime.datetime`.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyDateTime>`][crate::Py] or [`Bound<'py, PyDateTime>`][Bound].
+#[repr(transparent)]
+pub struct PyDateTime(PyAny);
+pyobject_native_type!(
+    PyDateTime,
+    crate::ffi::PyDateTime_DateTime,
+    |py| expect_datetime_api(py).DateTimeType,
+    #module=Some("datetime"),
+    #checkfunction=PyDateTime_Check
+);
+
+impl PyDateTime {
+    /// Deprecated form of [`PyDateTime::new_bound`].
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyDateTime::new` will be replaced by `PyDateTime::new_bound` in a future PyO3 version"
+    )]
+    #[allow(clippy::too_many_arguments)]
+    pub fn new<'py>(
+        py: Python<'py>,
+        year: i32,
+        month: u8,
+        day: u8,
+        hour: u8,
+        minute: u8,
+        second: u8,
+        microsecond: u32,
+        tzinfo: Option<&'py PyTzInfo>,
+    ) -> PyResult<&'py PyDateTime> {
+        Self::new_bound(
+            py,
+            year,
+            month,
+            day,
+            hour,
+            minute,
+            second,
+            microsecond,
+            tzinfo.map(PyTzInfo::as_borrowed).as_deref(),
+        )
+        .map(Bound::into_gil_ref)
+    }
+
+    /// Creates a new `datetime.datetime` object.
+    #[allow(clippy::too_many_arguments)]
+    pub fn new_bound<'py>(
+        py: Python<'py>,
+        year: i32,
+        month: u8,
+        day: u8,
+        hour: u8,
+        minute: u8,
+        second: u8,
+        microsecond: u32,
+        tzinfo: Option<&Bound<'py, PyTzInfo>>,
+    ) -> PyResult<Bound<'py, PyDateTime>> {
+        let api = ensure_datetime_api(py)?;
+        unsafe {
+            (api.DateTime_FromDateAndTime)(
+                year,
+                c_int::from(month),
+                c_int::from(day),
+                c_int::from(hour),
+                c_int::from(minute),
+                c_int::from(second),
+                microsecond as c_int,
+                opt_to_pyobj(tzinfo),
+                api.DateTimeType,
+            )
+            .assume_owned_or_err(py)
+            .downcast_into_unchecked()
+        }
+    }
+
+    /// Deprecated form of [`PyDateTime::new_bound_with_fold`].
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyDateTime::new_with_fold` will be replaced by `PyDateTime::new_bound_with_fold` in a future PyO3 version"
+    )]
+    #[allow(clippy::too_many_arguments)]
+    pub fn new_with_fold<'py>(
+        py: Python<'py>,
+        year: i32,
+        month: u8,
+        day: u8,
+        hour: u8,
+        minute: u8,
+        second: u8,
+        microsecond: u32,
+        tzinfo: Option<&'py PyTzInfo>,
+        fold: bool,
+    ) -> PyResult<&'py PyDateTime> {
+        Self::new_bound_with_fold(
+            py,
+            year,
+            month,
+            day,
+            hour,
+            minute,
+            second,
+            microsecond,
+            tzinfo.map(PyTzInfo::as_borrowed).as_deref(),
+            fold,
+        )
+        .map(Bound::into_gil_ref)
+    }
+
+    /// Alternate constructor that takes a `fold` parameter. A `true` value for this parameter
+    /// signifies this this datetime is the later of two moments with the same representation,
+    /// during a repeated interval.
+    ///
+    /// This typically occurs at the end of daylight savings time. Only valid if the
+    /// represented time is ambiguous.
+    /// See [PEP 495](https://www.python.org/dev/peps/pep-0495/) for more detail.
+    #[allow(clippy::too_many_arguments)]
+    pub fn new_bound_with_fold<'py>(
+        py: Python<'py>,
+        year: i32,
+        month: u8,
+        day: u8,
+        hour: u8,
+        minute: u8,
+        second: u8,
+        microsecond: u32,
+        tzinfo: Option<&Bound<'py, PyTzInfo>>,
+        fold: bool,
+    ) -> PyResult<Bound<'py, PyDateTime>> {
+        let api = ensure_datetime_api(py)?;
+        unsafe {
+            (api.DateTime_FromDateAndTimeAndFold)(
+                year,
+                c_int::from(month),
+                c_int::from(day),
+                c_int::from(hour),
+                c_int::from(minute),
+                c_int::from(second),
+                microsecond as c_int,
+                opt_to_pyobj(tzinfo),
+                c_int::from(fold),
+                api.DateTimeType,
+            )
+            .assume_owned_or_err(py)
+            .downcast_into_unchecked()
+        }
+    }
+
+    /// Deprecated form of [`PyDateTime::from_timestamp_bound`].
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyDateTime::from_timestamp` will be replaced by `PyDateTime::from_timestamp_bound` in a future PyO3 version"
+    )]
+    pub fn from_timestamp<'py>(
+        py: Python<'py>,
+        timestamp: f64,
+        tzinfo: Option<&'py PyTzInfo>,
+    ) -> PyResult<&'py PyDateTime> {
+        Self::from_timestamp_bound(py, timestamp, tzinfo.map(PyTzInfo::as_borrowed).as_deref())
+            .map(Bound::into_gil_ref)
+    }
+
+    /// Construct a `datetime` object from a POSIX timestamp
+    ///
+    /// This is equivalent to `datetime.datetime.fromtimestamp`
+    pub fn from_timestamp_bound<'py>(
+        py: Python<'py>,
+        timestamp: f64,
+        tzinfo: Option<&Bound<'py, PyTzInfo>>,
+    ) -> PyResult<Bound<'py, PyDateTime>> {
+        let args = IntoPy::<Py<PyTuple>>::into_py((timestamp, tzinfo), py).into_bound(py);
+
+        // safety ensure API is loaded
+        let _api = ensure_datetime_api(py)?;
+
+        unsafe {
+            PyDateTime_FromTimestamp(args.as_ptr())
+                .assume_owned_or_err(py)
+                .downcast_into_unchecked()
+        }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyDateAccess for PyDateTime {
+    fn get_year(&self) -> i32 {
+        self.as_borrowed().get_year()
+    }
+
+    fn get_month(&self) -> u8 {
+        self.as_borrowed().get_month()
+    }
+
+    fn get_day(&self) -> u8 {
+        self.as_borrowed().get_day()
+    }
+}
+
+impl PyDateAccess for Bound<'_, PyDateTime> {
+    fn get_year(&self) -> i32 {
+        unsafe { PyDateTime_GET_YEAR(self.as_ptr()) }
+    }
+
+    fn get_month(&self) -> u8 {
+        unsafe { PyDateTime_GET_MONTH(self.as_ptr()) as u8 }
+    }
+
+    fn get_day(&self) -> u8 {
+        unsafe { PyDateTime_GET_DAY(self.as_ptr()) as u8 }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyTimeAccess for PyDateTime {
+    fn get_hour(&self) -> u8 {
+        self.as_borrowed().get_hour()
+    }
+
+    fn get_minute(&self) -> u8 {
+        self.as_borrowed().get_minute()
+    }
+
+    fn get_second(&self) -> u8 {
+        self.as_borrowed().get_second()
+    }
+
+    fn get_microsecond(&self) -> u32 {
+        self.as_borrowed().get_microsecond()
+    }
+
+    fn get_fold(&self) -> bool {
+        self.as_borrowed().get_fold()
+    }
+}
+
+impl PyTimeAccess for Bound<'_, PyDateTime> {
+    fn get_hour(&self) -> u8 {
+        unsafe { PyDateTime_DATE_GET_HOUR(self.as_ptr()) as u8 }
+    }
+
+    fn get_minute(&self) -> u8 {
+        unsafe { PyDateTime_DATE_GET_MINUTE(self.as_ptr()) as u8 }
+    }
+
+    fn get_second(&self) -> u8 {
+        unsafe { PyDateTime_DATE_GET_SECOND(self.as_ptr()) as u8 }
+    }
+
+    fn get_microsecond(&self) -> u32 {
+        unsafe { PyDateTime_DATE_GET_MICROSECOND(self.as_ptr()) as u32 }
+    }
+
+    fn get_fold(&self) -> bool {
+        unsafe { PyDateTime_DATE_GET_FOLD(self.as_ptr()) > 0 }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'py> PyTzInfoAccess<'py> for &'py PyDateTime {
+    fn get_tzinfo_bound(&self) -> Option<Bound<'py, PyTzInfo>> {
+        self.as_borrowed().get_tzinfo_bound()
+    }
+}
+
+impl<'py> PyTzInfoAccess<'py> for Bound<'py, PyDateTime> {
+    fn get_tzinfo_bound(&self) -> Option<Bound<'py, PyTzInfo>> {
+        let ptr = self.as_ptr() as *mut ffi::PyDateTime_DateTime;
+        #[cfg(not(GraalPy))]
+        unsafe {
+            if (*ptr).hastzinfo != 0 {
+                Some(
+                    (*ptr)
+                        .tzinfo
+                        .assume_borrowed(self.py())
+                        .to_owned()
+                        .downcast_into_unchecked(),
+                )
+            } else {
+                None
+            }
+        }
+
+        #[cfg(GraalPy)]
+        unsafe {
+            let res = PyDateTime_DATE_GET_TZINFO(ptr as *mut ffi::PyObject);
+            if Py_IsNone(res) == 1 {
+                None
+            } else {
+                Some(
+                    res.assume_borrowed(self.py())
+                        .to_owned()
+                        .downcast_into_unchecked(),
+                )
+            }
+        }
+    }
+}
+
+/// Bindings for `datetime.time`.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyTime>`][crate::Py] or [`Bound<'py, PyTime>`][Bound].
+#[repr(transparent)]
+pub struct PyTime(PyAny);
+pyobject_native_type!(
+    PyTime,
+    crate::ffi::PyDateTime_Time,
+    |py| expect_datetime_api(py).TimeType,
+    #module=Some("datetime"),
+    #checkfunction=PyTime_Check
+);
+
+impl PyTime {
+    /// Deprecated form of [`PyTime::new_bound`].
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyTime::new` will be replaced by `PyTime::new_bound` in a future PyO3 version"
+    )]
+    pub fn new<'py>(
+        py: Python<'py>,
+        hour: u8,
+        minute: u8,
+        second: u8,
+        microsecond: u32,
+        tzinfo: Option<&'py PyTzInfo>,
+    ) -> PyResult<&'py PyTime> {
+        Self::new_bound(
+            py,
+            hour,
+            minute,
+            second,
+            microsecond,
+            tzinfo.map(PyTzInfo::as_borrowed).as_deref(),
+        )
+        .map(Bound::into_gil_ref)
+    }
+
+    /// Creates a new `datetime.time` object.
+    pub fn new_bound<'py>(
+        py: Python<'py>,
+        hour: u8,
+        minute: u8,
+        second: u8,
+        microsecond: u32,
+        tzinfo: Option<&Bound<'py, PyTzInfo>>,
+    ) -> PyResult<Bound<'py, PyTime>> {
+        let api = ensure_datetime_api(py)?;
+        unsafe {
+            (api.Time_FromTime)(
+                c_int::from(hour),
+                c_int::from(minute),
+                c_int::from(second),
+                microsecond as c_int,
+                opt_to_pyobj(tzinfo),
+                api.TimeType,
+            )
+            .assume_owned_or_err(py)
+            .downcast_into_unchecked()
+        }
+    }
+
+    /// Deprecated form of [`PyTime::new_bound_with_fold`].
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyTime::new_with_fold` will be replaced by `PyTime::new_bound_with_fold` in a future PyO3 version"
+    )]
+    pub fn new_with_fold<'py>(
+        py: Python<'py>,
+        hour: u8,
+        minute: u8,
+        second: u8,
+        microsecond: u32,
+        tzinfo: Option<&'py PyTzInfo>,
+        fold: bool,
+    ) -> PyResult<&'py PyTime> {
+        Self::new_bound_with_fold(
+            py,
+            hour,
+            minute,
+            second,
+            microsecond,
+            tzinfo.map(PyTzInfo::as_borrowed).as_deref(),
+            fold,
+        )
+        .map(Bound::into_gil_ref)
+    }
+
+    /// Alternate constructor that takes a `fold` argument. See [`PyDateTime::new_bound_with_fold`].
+    pub fn new_bound_with_fold<'py>(
+        py: Python<'py>,
+        hour: u8,
+        minute: u8,
+        second: u8,
+        microsecond: u32,
+        tzinfo: Option<&Bound<'py, PyTzInfo>>,
+        fold: bool,
+    ) -> PyResult<Bound<'py, PyTime>> {
+        let api = ensure_datetime_api(py)?;
+        unsafe {
+            (api.Time_FromTimeAndFold)(
+                c_int::from(hour),
+                c_int::from(minute),
+                c_int::from(second),
+                microsecond as c_int,
+                opt_to_pyobj(tzinfo),
+                fold as c_int,
+                api.TimeType,
+            )
+            .assume_owned_or_err(py)
+            .downcast_into_unchecked()
+        }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyTimeAccess for PyTime {
+    fn get_hour(&self) -> u8 {
+        self.as_borrowed().get_hour()
+    }
+
+    fn get_minute(&self) -> u8 {
+        self.as_borrowed().get_minute()
+    }
+
+    fn get_second(&self) -> u8 {
+        self.as_borrowed().get_second()
+    }
+
+    fn get_microsecond(&self) -> u32 {
+        self.as_borrowed().get_microsecond()
+    }
+
+    fn get_fold(&self) -> bool {
+        self.as_borrowed().get_fold()
+    }
+}
+
+impl PyTimeAccess for Bound<'_, PyTime> {
+    fn get_hour(&self) -> u8 {
+        unsafe { PyDateTime_TIME_GET_HOUR(self.as_ptr()) as u8 }
+    }
+
+    fn get_minute(&self) -> u8 {
+        unsafe { PyDateTime_TIME_GET_MINUTE(self.as_ptr()) as u8 }
+    }
+
+    fn get_second(&self) -> u8 {
+        unsafe { PyDateTime_TIME_GET_SECOND(self.as_ptr()) as u8 }
+    }
+
+    fn get_microsecond(&self) -> u32 {
+        unsafe { PyDateTime_TIME_GET_MICROSECOND(self.as_ptr()) as u32 }
+    }
+
+    fn get_fold(&self) -> bool {
+        unsafe { PyDateTime_TIME_GET_FOLD(self.as_ptr()) != 0 }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'py> PyTzInfoAccess<'py> for &'py PyTime {
+    fn get_tzinfo_bound(&self) -> Option<Bound<'py, PyTzInfo>> {
+        self.as_borrowed().get_tzinfo_bound()
+    }
+}
+
+impl<'py> PyTzInfoAccess<'py> for Bound<'py, PyTime> {
+    fn get_tzinfo_bound(&self) -> Option<Bound<'py, PyTzInfo>> {
+        let ptr = self.as_ptr() as *mut ffi::PyDateTime_Time;
+        #[cfg(not(GraalPy))]
+        unsafe {
+            if (*ptr).hastzinfo != 0 {
+                Some(
+                    (*ptr)
+                        .tzinfo
+                        .assume_borrowed(self.py())
+                        .to_owned()
+                        .downcast_into_unchecked(),
+                )
+            } else {
+                None
+            }
+        }
+
+        #[cfg(GraalPy)]
+        unsafe {
+            let res = PyDateTime_TIME_GET_TZINFO(ptr as *mut ffi::PyObject);
+            if Py_IsNone(res) == 1 {
+                None
+            } else {
+                Some(
+                    res.assume_borrowed(self.py())
+                        .to_owned()
+                        .downcast_into_unchecked(),
+                )
+            }
+        }
+    }
+}
+
+/// Bindings for `datetime.tzinfo`.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyTzInfo>`][crate::Py] or [`Bound<'py, PyTzInfo>`][Bound].
+///
+/// This is an abstract base class and cannot be constructed directly.
+/// For concrete time zone implementations, see [`timezone_utc_bound`] and
+/// the [`zoneinfo` module](https://docs.python.org/3/library/zoneinfo.html).
+#[repr(transparent)]
+pub struct PyTzInfo(PyAny);
+pyobject_native_type!(
+    PyTzInfo,
+    crate::ffi::PyObject,
+    |py| expect_datetime_api(py).TZInfoType,
+    #module=Some("datetime"),
+    #checkfunction=PyTZInfo_Check
+);
+
+/// Deprecated form of [`timezone_utc_bound`].
+#[cfg(feature = "gil-refs")]
+#[deprecated(
+    since = "0.21.0",
+    note = "`timezone_utc` will be replaced by `timezone_utc_bound` in a future PyO3 version"
+)]
+pub fn timezone_utc(py: Python<'_>) -> &PyTzInfo {
+    timezone_utc_bound(py).into_gil_ref()
+}
+
+/// Equivalent to `datetime.timezone.utc`
+pub fn timezone_utc_bound(py: Python<'_>) -> Bound<'_, PyTzInfo> {
+    // TODO: this _could_ have a borrowed form `timezone_utc_borrowed`, but that seems
+    // like an edge case optimization and we'd prefer in PyO3 0.21 to use `Bound` as
+    // much as possible
+    unsafe {
+        expect_datetime_api(py)
+            .TimeZone_UTC
+            .assume_borrowed(py)
+            .to_owned()
+            .downcast_into_unchecked()
+    }
+}
+
+/// Equivalent to `datetime.timezone` constructor
+///
+/// Only used internally
+#[cfg(feature = "chrono")]
+pub(crate) fn timezone_from_offset<'py>(
+    offset: &Bound<'py, PyDelta>,
+) -> PyResult<Bound<'py, PyTzInfo>> {
+    let py = offset.py();
+    let api = ensure_datetime_api(py)?;
+    unsafe {
+        (api.TimeZone_FromTimeZone)(offset.as_ptr(), ptr::null_mut())
+            .assume_owned_or_err(py)
+            .downcast_into_unchecked()
+    }
+}
+
+/// Bindings for `datetime.timedelta`.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyDelta>`][crate::Py] or [`Bound<'py, PyDelta>`][Bound].
+#[repr(transparent)]
+pub struct PyDelta(PyAny);
+pyobject_native_type!(
+    PyDelta,
+    crate::ffi::PyDateTime_Delta,
+    |py| expect_datetime_api(py).DeltaType,
+    #module=Some("datetime"),
+    #checkfunction=PyDelta_Check
+);
+
+impl PyDelta {
+    /// Deprecated form of [`PyDelta::new_bound`].
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyDelta::new` will be replaced by `PyDelta::new_bound` in a future PyO3 version"
+    )]
+    pub fn new(
+        py: Python<'_>,
+        days: i32,
+        seconds: i32,
+        microseconds: i32,
+        normalize: bool,
+    ) -> PyResult<&PyDelta> {
+        Self::new_bound(py, days, seconds, microseconds, normalize).map(Bound::into_gil_ref)
+    }
+
+    /// Creates a new `timedelta`.
+    pub fn new_bound(
+        py: Python<'_>,
+        days: i32,
+        seconds: i32,
+        microseconds: i32,
+        normalize: bool,
+    ) -> PyResult<Bound<'_, PyDelta>> {
+        let api = ensure_datetime_api(py)?;
+        unsafe {
+            (api.Delta_FromDelta)(
+                days as c_int,
+                seconds as c_int,
+                microseconds as c_int,
+                normalize as c_int,
+                api.DeltaType,
+            )
+            .assume_owned_or_err(py)
+            .downcast_into_unchecked()
+        }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyDeltaAccess for PyDelta {
+    fn get_days(&self) -> i32 {
+        self.as_borrowed().get_days()
+    }
+
+    fn get_seconds(&self) -> i32 {
+        self.as_borrowed().get_seconds()
+    }
+
+    fn get_microseconds(&self) -> i32 {
+        self.as_borrowed().get_microseconds()
+    }
+}
+
+impl PyDeltaAccess for Bound<'_, PyDelta> {
+    fn get_days(&self) -> i32 {
+        unsafe { PyDateTime_DELTA_GET_DAYS(self.as_ptr()) }
+    }
+
+    fn get_seconds(&self) -> i32 {
+        unsafe { PyDateTime_DELTA_GET_SECONDS(self.as_ptr()) }
+    }
+
+    fn get_microseconds(&self) -> i32 {
+        unsafe { PyDateTime_DELTA_GET_MICROSECONDS(self.as_ptr()) }
+    }
+}
+
+// Utility function which returns a borrowed reference to either
+// the underlying tzinfo or None.
+fn opt_to_pyobj(opt: Option<&Bound<'_, PyTzInfo>>) -> *mut ffi::PyObject {
+    match opt {
+        Some(tzi) => tzi.as_ptr(),
+        None => unsafe { ffi::Py_None() },
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    #[cfg(feature = "macros")]
+    use crate::py_run;
+
+    #[test]
+    #[cfg(feature = "macros")]
+    #[cfg_attr(target_arch = "wasm32", ignore)] // DateTime import fails on wasm for mysterious reasons
+    fn test_datetime_fromtimestamp() {
+        Python::with_gil(|py| {
+            let dt = PyDateTime::from_timestamp_bound(py, 100.0, None).unwrap();
+            py_run!(
+                py,
+                dt,
+                "import datetime; assert dt == datetime.datetime.fromtimestamp(100)"
+            );
+
+            let dt =
+                PyDateTime::from_timestamp_bound(py, 100.0, Some(&timezone_utc_bound(py))).unwrap();
+            py_run!(
+                py,
+                dt,
+                "import datetime; assert dt == datetime.datetime.fromtimestamp(100, datetime.timezone.utc)"
+            );
+        })
+    }
+
+    #[test]
+    #[cfg(feature = "macros")]
+    #[cfg_attr(target_arch = "wasm32", ignore)] // DateTime import fails on wasm for mysterious reasons
+    fn test_date_fromtimestamp() {
+        Python::with_gil(|py| {
+            let dt = PyDate::from_timestamp_bound(py, 100).unwrap();
+            py_run!(
+                py,
+                dt,
+                "import datetime; assert dt == datetime.date.fromtimestamp(100)"
+            );
+        })
+    }
+
+    #[test]
+    #[cfg_attr(target_arch = "wasm32", ignore)] // DateTime import fails on wasm for mysterious reasons
+    fn test_new_with_fold() {
+        Python::with_gil(|py| {
+            let a =
+                PyDateTime::new_bound_with_fold(py, 2021, 1, 23, 20, 32, 40, 341516, None, false);
+            let b =
+                PyDateTime::new_bound_with_fold(py, 2021, 1, 23, 20, 32, 40, 341516, None, true);
+
+            assert!(!a.unwrap().get_fold());
+            assert!(b.unwrap().get_fold());
+        });
+    }
+
+    #[test]
+    #[cfg_attr(target_arch = "wasm32", ignore)] // DateTime import fails on wasm for mysterious reasons
+    fn test_get_tzinfo() {
+        crate::Python::with_gil(|py| {
+            let utc = timezone_utc_bound(py);
+
+            let dt = PyDateTime::new_bound(py, 2018, 1, 1, 0, 0, 0, 0, Some(&utc)).unwrap();
+
+            assert!(dt.get_tzinfo_bound().unwrap().eq(&utc).unwrap());
+
+            let dt = PyDateTime::new_bound(py, 2018, 1, 1, 0, 0, 0, 0, None).unwrap();
+
+            assert!(dt.get_tzinfo_bound().is_none());
+
+            let t = PyTime::new_bound(py, 0, 0, 0, 0, Some(&utc)).unwrap();
+
+            assert!(t.get_tzinfo_bound().unwrap().eq(utc).unwrap());
+
+            let t = PyTime::new_bound(py, 0, 0, 0, 0, None).unwrap();
+
+            assert!(t.get_tzinfo_bound().is_none());
+        });
+    }
+
+    #[test]
+    #[cfg(all(feature = "macros", feature = "chrono"))]
+    #[cfg_attr(target_arch = "wasm32", ignore)] // DateTime import fails on wasm for mysterious reasons
+    fn test_timezone_from_offset() {
+        Python::with_gil(|py| {
+            assert!(
+                timezone_from_offset(&PyDelta::new_bound(py, 0, -3600, 0, true).unwrap())
+                    .unwrap()
+                    .call_method1("utcoffset", ((),))
+                    .unwrap()
+                    .downcast_into::<PyDelta>()
+                    .unwrap()
+                    .eq(PyDelta::new_bound(py, 0, -3600, 0, true).unwrap())
+                    .unwrap()
+            );
+
+            assert!(
+                timezone_from_offset(&PyDelta::new_bound(py, 0, 3600, 0, true).unwrap())
+                    .unwrap()
+                    .call_method1("utcoffset", ((),))
+                    .unwrap()
+                    .downcast_into::<PyDelta>()
+                    .unwrap()
+                    .eq(PyDelta::new_bound(py, 0, 3600, 0, true).unwrap())
+                    .unwrap()
+            );
+
+            timezone_from_offset(&PyDelta::new_bound(py, 1, 0, 0, true).unwrap()).unwrap_err();
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/dict.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/dict.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/dict.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/dict.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1580 @@
+use super::PyMapping;
+use crate::err::{self, PyErr, PyResult};
+use crate::ffi::Py_ssize_t;
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::instance::{Borrowed, Bound};
+use crate::py_result_ext::PyResultExt;
+use crate::types::any::PyAnyMethods;
+use crate::types::{PyAny, PyList};
+#[cfg(feature = "gil-refs")]
+use crate::PyNativeType;
+use crate::{ffi, Python, ToPyObject};
+
+/// Represents a Python `dict`.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyDict>`][crate::Py] or [`Bound<'py, PyDict>`][Bound].
+///
+/// For APIs available on `dict` objects, see the [`PyDictMethods`] trait which is implemented for
+/// [`Bound<'py, PyDict>`][Bound].
+#[repr(transparent)]
+pub struct PyDict(PyAny);
+
+pyobject_native_type!(
+    PyDict,
+    ffi::PyDictObject,
+    pyobject_native_static_type_object!(ffi::PyDict_Type),
+    #checkfunction=ffi::PyDict_Check
+);
+
+/// Represents a Python `dict_keys`.
+#[cfg(not(any(PyPy, GraalPy)))]
+#[repr(transparent)]
+pub struct PyDictKeys(PyAny);
+
+#[cfg(not(any(PyPy, GraalPy)))]
+pyobject_native_type_core!(
+    PyDictKeys,
+    pyobject_native_static_type_object!(ffi::PyDictKeys_Type),
+    #checkfunction=ffi::PyDictKeys_Check
+);
+
+/// Represents a Python `dict_values`.
+#[cfg(not(any(PyPy, GraalPy)))]
+#[repr(transparent)]
+pub struct PyDictValues(PyAny);
+
+#[cfg(not(any(PyPy, GraalPy)))]
+pyobject_native_type_core!(
+    PyDictValues,
+    pyobject_native_static_type_object!(ffi::PyDictValues_Type),
+    #checkfunction=ffi::PyDictValues_Check
+);
+
+/// Represents a Python `dict_items`.
+#[cfg(not(any(PyPy, GraalPy)))]
+#[repr(transparent)]
+pub struct PyDictItems(PyAny);
+
+#[cfg(not(any(PyPy, GraalPy)))]
+pyobject_native_type_core!(
+    PyDictItems,
+    pyobject_native_static_type_object!(ffi::PyDictItems_Type),
+    #checkfunction=ffi::PyDictItems_Check
+);
+
+impl PyDict {
+    /// Creates a new empty dictionary.
+    pub fn new_bound(py: Python<'_>) -> Bound<'_, PyDict> {
+        unsafe { ffi::PyDict_New().assume_owned(py).downcast_into_unchecked() }
+    }
+
+    /// Creates a new dictionary from the sequence given.
+    ///
+    /// The sequence must consist of `(PyObject, PyObject)`. This is
+    /// equivalent to `dict([("a", 1), ("b", 2)])`.
+    ///
+    /// Returns an error on invalid input. In the case of key collisions,
+    /// this keeps the last entry seen.
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn from_sequence_bound<'py>(seq: &Bound<'py, PyAny>) -> PyResult<Bound<'py, PyDict>> {
+        let py = seq.py();
+        let dict = Self::new_bound(py);
+        err::error_on_minusone(py, unsafe {
+            ffi::PyDict_MergeFromSeq2(dict.as_ptr(), seq.as_ptr(), 1)
+        })?;
+        Ok(dict)
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyDict {
+    /// Deprecated form of [`new_bound`][PyDict::new_bound].
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyDict::new` will be replaced by `PyDict::new_bound` in a future PyO3 version"
+    )]
+    #[inline]
+    pub fn new(py: Python<'_>) -> &PyDict {
+        Self::new_bound(py).into_gil_ref()
+    }
+
+    /// Deprecated form of [`from_sequence_bound`][PyDict::from_sequence_bound].
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyDict::from_sequence` will be replaced by `PyDict::from_sequence_bound` in a future PyO3 version"
+    )]
+    #[inline]
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn from_sequence(seq: &PyAny) -> PyResult<&PyDict> {
+        Self::from_sequence_bound(&seq.as_borrowed()).map(Bound::into_gil_ref)
+    }
+
+    /// Returns a new dictionary that contains the same key-value pairs as self.
+    ///
+    /// This is equivalent to the Python expression `self.copy()`.
+    pub fn copy(&self) -> PyResult<&PyDict> {
+        self.as_borrowed().copy().map(Bound::into_gil_ref)
+    }
+
+    /// Empties an existing dictionary of all key-value pairs.
+    pub fn clear(&self) {
+        self.as_borrowed().clear()
+    }
+
+    /// Return the number of items in the dictionary.
+    ///
+    /// This is equivalent to the Python expression `len(self)`.
+    pub fn len(&self) -> usize {
+        self.as_borrowed().len()
+    }
+
+    /// Checks if the dict is empty, i.e. `len(self) == 0`.
+    pub fn is_empty(&self) -> bool {
+        self.as_borrowed().is_empty()
+    }
+
+    /// Determines if the dictionary contains the specified key.
+    ///
+    /// This is equivalent to the Python expression `key in self`.
+    pub fn contains<K>(&self, key: K) -> PyResult<bool>
+    where
+        K: ToPyObject,
+    {
+        self.as_borrowed().contains(key)
+    }
+
+    /// Gets an item from the dictionary.
+    ///
+    /// Returns `Ok(None)` if the item is not present. To get a `KeyError` for
+    /// non-existing keys, use [`PyAny::get_item`].
+    ///
+    /// Returns `Err(PyErr)` if Python magic methods `__hash__` or `__eq__` used in dictionary
+    /// lookup raise an exception, for example if the key `K` is not hashable. Usually it is
+    /// best to bubble this error up to the caller using the `?` operator.
+    ///
+    /// # Examples
+    ///
+    /// The following example calls `get_item` for the dictionary `{"a": 1}` with various
+    /// keys.
+    /// - `get_item("a")` returns `Ok(Some(...))`, with the `PyAny` being a reference to the Python
+    ///   int `1`.
+    /// - `get_item("b")` returns `Ok(None)`, because "b" is not in the dictionary.
+    /// - `get_item(dict)` returns an `Err(PyErr)`. The error will be a `TypeError` because a dict is not
+    ///   hashable.
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::{IntoPyDict};
+    /// use pyo3::exceptions::{PyTypeError, PyKeyError};
+    ///
+    /// # fn main() {
+    /// # let _ =
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let dict = &[("a", 1)].into_py_dict_bound(py);
+    ///     // `a` is in the dictionary, with value 1
+    ///     assert!(dict.get_item("a")?.map_or(Ok(false), |x| x.eq(1))?);
+    ///     // `b` is not in the dictionary
+    ///     assert!(dict.get_item("b")?.is_none());
+    ///     // `dict` is not hashable, so this returns an error
+    ///     assert!(dict.get_item(dict).unwrap_err().is_instance_of::<PyTypeError>(py));
+    ///
+    ///     // `PyAny::get_item("b")` will raise a `KeyError` instead of returning `None`
+    ///     let any = dict.as_any();
+    ///     assert!(any.get_item("b").unwrap_err().is_instance_of::<PyKeyError>(py));
+    ///     Ok(())
+    /// });
+    /// # }
+    /// ```
+    pub fn get_item<K>(&self, key: K) -> PyResult<Option<&PyAny>>
+    where
+        K: ToPyObject,
+    {
+        match self.as_borrowed().get_item(key) {
+            Ok(Some(item)) => Ok(Some(item.into_gil_ref())),
+            Ok(None) => Ok(None),
+            Err(e) => Err(e),
+        }
+    }
+
+    /// Deprecated version of `get_item`.
+    #[deprecated(
+        since = "0.20.0",
+        note = "this is now equivalent to `PyDict::get_item`"
+    )]
+    #[inline]
+    pub fn get_item_with_error<K>(&self, key: K) -> PyResult<Option<&PyAny>>
+    where
+        K: ToPyObject,
+    {
+        self.get_item(key)
+    }
+
+    /// Sets an item value.
+    ///
+    /// This is equivalent to the Python statement `self[key] = value`.
+    pub fn set_item<K, V>(&self, key: K, value: V) -> PyResult<()>
+    where
+        K: ToPyObject,
+        V: ToPyObject,
+    {
+        self.as_borrowed().set_item(key, value)
+    }
+
+    /// Deletes an item.
+    ///
+    /// This is equivalent to the Python statement `del self[key]`.
+    pub fn del_item<K>(&self, key: K) -> PyResult<()>
+    where
+        K: ToPyObject,
+    {
+        self.as_borrowed().del_item(key)
+    }
+
+    /// Returns a list of dict keys.
+    ///
+    /// This is equivalent to the Python expression `list(dict.keys())`.
+    pub fn keys(&self) -> &PyList {
+        self.as_borrowed().keys().into_gil_ref()
+    }
+
+    /// Returns a list of dict values.
+    ///
+    /// This is equivalent to the Python expression `list(dict.values())`.
+    pub fn values(&self) -> &PyList {
+        self.as_borrowed().values().into_gil_ref()
+    }
+
+    /// Returns a list of dict items.
+    ///
+    /// This is equivalent to the Python expression `list(dict.items())`.
+    pub fn items(&self) -> &PyList {
+        self.as_borrowed().items().into_gil_ref()
+    }
+
+    /// Returns an iterator of `(key, value)` pairs in this dictionary.
+    ///
+    /// # Panics
+    ///
+    /// If PyO3 detects that the dictionary is mutated during iteration, it will panic.
+    /// It is allowed to modify values as you iterate over the dictionary, but only
+    /// so long as the set of keys does not change.
+    pub fn iter(&self) -> PyDictIterator<'_> {
+        PyDictIterator(self.as_borrowed().iter())
+    }
+
+    /// Returns `self` cast as a `PyMapping`.
+    pub fn as_mapping(&self) -> &PyMapping {
+        unsafe { self.downcast_unchecked() }
+    }
+
+    /// Update this dictionary with the key/value pairs from another.
+    ///
+    /// This is equivalent to the Python expression `self.update(other)`. If `other` is a `PyDict`, you may want
+    /// to use `self.update(other.as_mapping())`, note: `PyDict::as_mapping` is a zero-cost conversion.
+    pub fn update(&self, other: &PyMapping) -> PyResult<()> {
+        self.as_borrowed().update(&other.as_borrowed())
+    }
+
+    /// Add key/value pairs from another dictionary to this one only when they do not exist in this.
+    ///
+    /// This is equivalent to the Python expression `self.update({k: v for k, v in other.items() if k not in self})`.
+    /// If `other` is a `PyDict`, you may want to use `self.update_if_missing(other.as_mapping())`,
+    /// note: `PyDict::as_mapping` is a zero-cost conversion.
+    ///
+    /// This method uses [`PyDict_Merge`](https://docs.python.org/3/c-api/dict.html#c.PyDict_Merge) internally,
+    /// so should have the same performance as `update`.
+    pub fn update_if_missing(&self, other: &PyMapping) -> PyResult<()> {
+        self.as_borrowed().update_if_missing(&other.as_borrowed())
+    }
+}
+
+/// Implementation of functionality for [`PyDict`].
+///
+/// These methods are defined for the `Bound<'py, PyDict>` smart pointer, so to use method call
+/// syntax these methods are separated into a trait, because stable Rust does not yet support
+/// `arbitrary_self_types`.
+#[doc(alias = "PyDict")]
+pub trait PyDictMethods<'py>: crate::sealed::Sealed {
+    /// Returns a new dictionary that contains the same key-value pairs as self.
+    ///
+    /// This is equivalent to the Python expression `self.copy()`.
+    fn copy(&self) -> PyResult<Bound<'py, PyDict>>;
+
+    /// Empties an existing dictionary of all key-value pairs.
+    fn clear(&self);
+
+    /// Return the number of items in the dictionary.
+    ///
+    /// This is equivalent to the Python expression `len(self)`.
+    fn len(&self) -> usize;
+
+    /// Checks if the dict is empty, i.e. `len(self) == 0`.
+    fn is_empty(&self) -> bool;
+
+    /// Determines if the dictionary contains the specified key.
+    ///
+    /// This is equivalent to the Python expression `key in self`.
+    fn contains<K>(&self, key: K) -> PyResult<bool>
+    where
+        K: ToPyObject;
+
+    /// Gets an item from the dictionary.
+    ///
+    /// Returns `None` if the item is not present, or if an error occurs.
+    ///
+    /// To get a `KeyError` for non-existing keys, use `PyAny::get_item`.
+    fn get_item<K>(&self, key: K) -> PyResult<Option<Bound<'py, PyAny>>>
+    where
+        K: ToPyObject;
+
+    /// Sets an item value.
+    ///
+    /// This is equivalent to the Python statement `self[key] = value`.
+    fn set_item<K, V>(&self, key: K, value: V) -> PyResult<()>
+    where
+        K: ToPyObject,
+        V: ToPyObject;
+
+    /// Deletes an item.
+    ///
+    /// This is equivalent to the Python statement `del self[key]`.
+    fn del_item<K>(&self, key: K) -> PyResult<()>
+    where
+        K: ToPyObject;
+
+    /// Returns a list of dict keys.
+    ///
+    /// This is equivalent to the Python expression `list(dict.keys())`.
+    fn keys(&self) -> Bound<'py, PyList>;
+
+    /// Returns a list of dict values.
+    ///
+    /// This is equivalent to the Python expression `list(dict.values())`.
+    fn values(&self) -> Bound<'py, PyList>;
+
+    /// Returns a list of dict items.
+    ///
+    /// This is equivalent to the Python expression `list(dict.items())`.
+    fn items(&self) -> Bound<'py, PyList>;
+
+    /// Returns an iterator of `(key, value)` pairs in this dictionary.
+    ///
+    /// # Panics
+    ///
+    /// If PyO3 detects that the dictionary is mutated during iteration, it will panic.
+    /// It is allowed to modify values as you iterate over the dictionary, but only
+    /// so long as the set of keys does not change.
+    fn iter(&self) -> BoundDictIterator<'py>;
+
+    /// Returns `self` cast as a `PyMapping`.
+    fn as_mapping(&self) -> &Bound<'py, PyMapping>;
+
+    /// Returns `self` cast as a `PyMapping`.
+    fn into_mapping(self) -> Bound<'py, PyMapping>;
+
+    /// Update this dictionary with the key/value pairs from another.
+    ///
+    /// This is equivalent to the Python expression `self.update(other)`. If `other` is a `PyDict`, you may want
+    /// to use `self.update(other.as_mapping())`, note: `PyDict::as_mapping` is a zero-cost conversion.
+    fn update(&self, other: &Bound<'_, PyMapping>) -> PyResult<()>;
+
+    /// Add key/value pairs from another dictionary to this one only when they do not exist in this.
+    ///
+    /// This is equivalent to the Python expression `self.update({k: v for k, v in other.items() if k not in self})`.
+    /// If `other` is a `PyDict`, you may want to use `self.update_if_missing(other.as_mapping())`,
+    /// note: `PyDict::as_mapping` is a zero-cost conversion.
+    ///
+    /// This method uses [`PyDict_Merge`](https://docs.python.org/3/c-api/dict.html#c.PyDict_Merge) internally,
+    /// so should have the same performance as `update`.
+    fn update_if_missing(&self, other: &Bound<'_, PyMapping>) -> PyResult<()>;
+}
+
+impl<'py> PyDictMethods<'py> for Bound<'py, PyDict> {
+    fn copy(&self) -> PyResult<Bound<'py, PyDict>> {
+        unsafe {
+            ffi::PyDict_Copy(self.as_ptr())
+                .assume_owned_or_err(self.py())
+                .downcast_into_unchecked()
+        }
+    }
+
+    fn clear(&self) {
+        unsafe { ffi::PyDict_Clear(self.as_ptr()) }
+    }
+
+    fn len(&self) -> usize {
+        dict_len(self) as usize
+    }
+
+    fn is_empty(&self) -> bool {
+        self.len() == 0
+    }
+
+    fn contains<K>(&self, key: K) -> PyResult<bool>
+    where
+        K: ToPyObject,
+    {
+        fn inner(dict: &Bound<'_, PyDict>, key: Bound<'_, PyAny>) -> PyResult<bool> {
+            match unsafe { ffi::PyDict_Contains(dict.as_ptr(), key.as_ptr()) } {
+                1 => Ok(true),
+                0 => Ok(false),
+                _ => Err(PyErr::fetch(dict.py())),
+            }
+        }
+
+        let py = self.py();
+        inner(self, key.to_object(py).into_bound(py))
+    }
+
+    fn get_item<K>(&self, key: K) -> PyResult<Option<Bound<'py, PyAny>>>
+    where
+        K: ToPyObject,
+    {
+        fn inner<'py>(
+            dict: &Bound<'py, PyDict>,
+            key: Bound<'_, PyAny>,
+        ) -> PyResult<Option<Bound<'py, PyAny>>> {
+            let py = dict.py();
+            match unsafe {
+                ffi::PyDict_GetItemWithError(dict.as_ptr(), key.as_ptr())
+                    .assume_borrowed_or_opt(py)
+                    .map(Borrowed::to_owned)
+            } {
+                some @ Some(_) => Ok(some),
+                None => PyErr::take(py).map(Err).transpose(),
+            }
+        }
+
+        let py = self.py();
+        inner(self, key.to_object(py).into_bound(py))
+    }
+
+    fn set_item<K, V>(&self, key: K, value: V) -> PyResult<()>
+    where
+        K: ToPyObject,
+        V: ToPyObject,
+    {
+        fn inner(
+            dict: &Bound<'_, PyDict>,
+            key: Bound<'_, PyAny>,
+            value: Bound<'_, PyAny>,
+        ) -> PyResult<()> {
+            err::error_on_minusone(dict.py(), unsafe {
+                ffi::PyDict_SetItem(dict.as_ptr(), key.as_ptr(), value.as_ptr())
+            })
+        }
+
+        let py = self.py();
+        inner(
+            self,
+            key.to_object(py).into_bound(py),
+            value.to_object(py).into_bound(py),
+        )
+    }
+
+    fn del_item<K>(&self, key: K) -> PyResult<()>
+    where
+        K: ToPyObject,
+    {
+        fn inner(dict: &Bound<'_, PyDict>, key: Bound<'_, PyAny>) -> PyResult<()> {
+            err::error_on_minusone(dict.py(), unsafe {
+                ffi::PyDict_DelItem(dict.as_ptr(), key.as_ptr())
+            })
+        }
+
+        let py = self.py();
+        inner(self, key.to_object(py).into_bound(py))
+    }
+
+    fn keys(&self) -> Bound<'py, PyList> {
+        unsafe {
+            ffi::PyDict_Keys(self.as_ptr())
+                .assume_owned(self.py())
+                .downcast_into_unchecked()
+        }
+    }
+
+    fn values(&self) -> Bound<'py, PyList> {
+        unsafe {
+            ffi::PyDict_Values(self.as_ptr())
+                .assume_owned(self.py())
+                .downcast_into_unchecked()
+        }
+    }
+
+    fn items(&self) -> Bound<'py, PyList> {
+        unsafe {
+            ffi::PyDict_Items(self.as_ptr())
+                .assume_owned(self.py())
+                .downcast_into_unchecked()
+        }
+    }
+
+    fn iter(&self) -> BoundDictIterator<'py> {
+        BoundDictIterator::new(self.clone())
+    }
+
+    fn as_mapping(&self) -> &Bound<'py, PyMapping> {
+        unsafe { self.downcast_unchecked() }
+    }
+
+    fn into_mapping(self) -> Bound<'py, PyMapping> {
+        unsafe { self.into_any().downcast_into_unchecked() }
+    }
+
+    fn update(&self, other: &Bound<'_, PyMapping>) -> PyResult<()> {
+        err::error_on_minusone(self.py(), unsafe {
+            ffi::PyDict_Update(self.as_ptr(), other.as_ptr())
+        })
+    }
+
+    fn update_if_missing(&self, other: &Bound<'_, PyMapping>) -> PyResult<()> {
+        err::error_on_minusone(self.py(), unsafe {
+            ffi::PyDict_Merge(self.as_ptr(), other.as_ptr(), 0)
+        })
+    }
+}
+
+impl<'a, 'py> Borrowed<'a, 'py, PyDict> {
+    /// Iterates over the contents of this dictionary without incrementing reference counts.
+    ///
+    /// # Safety
+    /// It must be known that this dictionary will not be modified during iteration.
+    pub(crate) unsafe fn iter_borrowed(self) -> BorrowedDictIter<'a, 'py> {
+        BorrowedDictIter::new(self)
+    }
+}
+
+fn dict_len(dict: &Bound<'_, PyDict>) -> Py_ssize_t {
+    #[cfg(any(not(Py_3_8), PyPy, GraalPy, Py_LIMITED_API))]
+    unsafe {
+        ffi::PyDict_Size(dict.as_ptr())
+    }
+
+    #[cfg(all(Py_3_8, not(PyPy), not(GraalPy), not(Py_LIMITED_API)))]
+    unsafe {
+        (*dict.as_ptr().cast::<ffi::PyDictObject>()).ma_used
+    }
+}
+
+/// PyO3 implementation of an iterator for a Python `dict` object.
+#[cfg(feature = "gil-refs")]
+pub struct PyDictIterator<'py>(BoundDictIterator<'py>);
+
+#[cfg(feature = "gil-refs")]
+impl<'py> Iterator for PyDictIterator<'py> {
+    type Item = (&'py PyAny, &'py PyAny);
+
+    #[inline]
+    fn next(&mut self) -> Option<Self::Item> {
+        let (key, value) = self.0.next()?;
+        Some((key.into_gil_ref(), value.into_gil_ref()))
+    }
+
+    #[inline]
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        self.0.size_hint()
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'py> ExactSizeIterator for PyDictIterator<'py> {
+    fn len(&self) -> usize {
+        self.0.len()
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'a> IntoIterator for &'a PyDict {
+    type Item = (&'a PyAny, &'a PyAny);
+    type IntoIter = PyDictIterator<'a>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        self.iter()
+    }
+}
+
+/// PyO3 implementation of an iterator for a Python `dict` object.
+pub struct BoundDictIterator<'py> {
+    dict: Bound<'py, PyDict>,
+    ppos: ffi::Py_ssize_t,
+    di_used: ffi::Py_ssize_t,
+    len: ffi::Py_ssize_t,
+}
+
+impl<'py> Iterator for BoundDictIterator<'py> {
+    type Item = (Bound<'py, PyAny>, Bound<'py, PyAny>);
+
+    #[inline]
+    fn next(&mut self) -> Option<Self::Item> {
+        let ma_used = dict_len(&self.dict);
+
+        // These checks are similar to what CPython does.
+        //
+        // If the dimension of the dict changes e.g. key-value pairs are removed
+        // or added during iteration, this will panic next time when `next` is called
+        if self.di_used != ma_used {
+            self.di_used = -1;
+            panic!("dictionary changed size during iteration");
+        };
+
+        // If the dict is changed in such a way that the length remains constant
+        // then this will panic at the end of iteration - similar to this:
+        //
+        // d = {"a":1, "b":2, "c": 3}
+        //
+        // for k, v in d.items():
+        //     d[f"{k}_"] = 4
+        //     del d[k]
+        //     print(k)
+        //
+        if self.len == -1 {
+            self.di_used = -1;
+            panic!("dictionary keys changed during iteration");
+        };
+
+        let mut key: *mut ffi::PyObject = std::ptr::null_mut();
+        let mut value: *mut ffi::PyObject = std::ptr::null_mut();
+
+        if unsafe { ffi::PyDict_Next(self.dict.as_ptr(), &mut self.ppos, &mut key, &mut value) }
+            != 0
+        {
+            self.len -= 1;
+            let py = self.dict.py();
+            // Safety:
+            // - PyDict_Next returns borrowed values
+            // - we have already checked that `PyDict_Next` succeeded, so we can assume these to be non-null
+            Some((
+                unsafe { key.assume_borrowed_unchecked(py) }.to_owned(),
+                unsafe { value.assume_borrowed_unchecked(py) }.to_owned(),
+            ))
+        } else {
+            None
+        }
+    }
+
+    #[inline]
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        let len = self.len();
+        (len, Some(len))
+    }
+}
+
+impl<'py> ExactSizeIterator for BoundDictIterator<'py> {
+    fn len(&self) -> usize {
+        self.len as usize
+    }
+}
+
+impl<'py> BoundDictIterator<'py> {
+    fn new(dict: Bound<'py, PyDict>) -> Self {
+        let len = dict_len(&dict);
+        BoundDictIterator {
+            dict,
+            ppos: 0,
+            di_used: len,
+            len,
+        }
+    }
+}
+
+impl<'py> IntoIterator for Bound<'py, PyDict> {
+    type Item = (Bound<'py, PyAny>, Bound<'py, PyAny>);
+    type IntoIter = BoundDictIterator<'py>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        BoundDictIterator::new(self)
+    }
+}
+
+impl<'py> IntoIterator for &Bound<'py, PyDict> {
+    type Item = (Bound<'py, PyAny>, Bound<'py, PyAny>);
+    type IntoIter = BoundDictIterator<'py>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        self.iter()
+    }
+}
+
+mod borrowed_iter {
+    use super::*;
+
+    /// Variant of the above which is used to iterate the items of the dictionary
+    /// without incrementing reference counts. This is only safe if it's known
+    /// that the dictionary will not be modified during iteration.
+    pub struct BorrowedDictIter<'a, 'py> {
+        dict: Borrowed<'a, 'py, PyDict>,
+        ppos: ffi::Py_ssize_t,
+        len: ffi::Py_ssize_t,
+    }
+
+    impl<'a, 'py> Iterator for BorrowedDictIter<'a, 'py> {
+        type Item = (Borrowed<'a, 'py, PyAny>, Borrowed<'a, 'py, PyAny>);
+
+        #[inline]
+        fn next(&mut self) -> Option<Self::Item> {
+            let mut key: *mut ffi::PyObject = std::ptr::null_mut();
+            let mut value: *mut ffi::PyObject = std::ptr::null_mut();
+
+            // Safety: self.dict lives sufficiently long that the pointer is not dangling
+            if unsafe { ffi::PyDict_Next(self.dict.as_ptr(), &mut self.ppos, &mut key, &mut value) }
+                != 0
+            {
+                let py = self.dict.py();
+                self.len -= 1;
+                // Safety:
+                // - PyDict_Next returns borrowed values
+                // - we have already checked that `PyDict_Next` succeeded, so we can assume these to be non-null
+                Some(unsafe { (key.assume_borrowed(py), value.assume_borrowed(py)) })
+            } else {
+                None
+            }
+        }
+
+        #[inline]
+        fn size_hint(&self) -> (usize, Option<usize>) {
+            let len = self.len();
+            (len, Some(len))
+        }
+    }
+
+    impl ExactSizeIterator for BorrowedDictIter<'_, '_> {
+        fn len(&self) -> usize {
+            self.len as usize
+        }
+    }
+
+    impl<'a, 'py> BorrowedDictIter<'a, 'py> {
+        pub(super) fn new(dict: Borrowed<'a, 'py, PyDict>) -> Self {
+            let len = dict_len(&dict);
+            BorrowedDictIter { dict, ppos: 0, len }
+        }
+    }
+}
+
+pub(crate) use borrowed_iter::BorrowedDictIter;
+
+/// Conversion trait that allows a sequence of tuples to be converted into `PyDict`
+/// Primary use case for this trait is `call` and `call_method` methods as keywords argument.
+pub trait IntoPyDict: Sized {
+    /// Converts self into a `PyDict` object pointer. Whether pointer owned or borrowed
+    /// depends on implementation.
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`IntoPyDict::into_py_dict` will be replaced by `IntoPyDict::into_py_dict_bound` in a future PyO3 version"
+    )]
+    fn into_py_dict(self, py: Python<'_>) -> &PyDict {
+        Self::into_py_dict_bound(self, py).into_gil_ref()
+    }
+
+    /// Converts self into a `PyDict` object pointer. Whether pointer owned or borrowed
+    /// depends on implementation.
+    fn into_py_dict_bound(self, py: Python<'_>) -> Bound<'_, PyDict>;
+}
+
+impl<T, I> IntoPyDict for I
+where
+    T: PyDictItem,
+    I: IntoIterator<Item = T>,
+{
+    fn into_py_dict_bound(self, py: Python<'_>) -> Bound<'_, PyDict> {
+        let dict = PyDict::new_bound(py);
+        for item in self {
+            dict.set_item(item.key(), item.value())
+                .expect("Failed to set_item on dict");
+        }
+        dict
+    }
+}
+
+/// Represents a tuple which can be used as a PyDict item.
+pub trait PyDictItem {
+    type K: ToPyObject;
+    type V: ToPyObject;
+    fn key(&self) -> &Self::K;
+    fn value(&self) -> &Self::V;
+}
+
+impl<K, V> PyDictItem for (K, V)
+where
+    K: ToPyObject,
+    V: ToPyObject,
+{
+    type K = K;
+    type V = V;
+    fn key(&self) -> &Self::K {
+        &self.0
+    }
+    fn value(&self) -> &Self::V {
+        &self.1
+    }
+}
+
+impl<K, V> PyDictItem for &(K, V)
+where
+    K: ToPyObject,
+    V: ToPyObject,
+{
+    type K = K;
+    type V = V;
+    fn key(&self) -> &Self::K {
+        &self.0
+    }
+    fn value(&self) -> &Self::V {
+        &self.1
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::types::PyTuple;
+    use std::collections::{BTreeMap, HashMap};
+
+    #[test]
+    fn test_new() {
+        Python::with_gil(|py| {
+            let dict = [(7, 32)].into_py_dict_bound(py);
+            assert_eq!(
+                32,
+                dict.get_item(7i32)
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap()
+            );
+            assert!(dict.get_item(8i32).unwrap().is_none());
+            let map: HashMap<i32, i32> = [(7, 32)].iter().cloned().collect();
+            assert_eq!(map, dict.extract().unwrap());
+            let map: BTreeMap<i32, i32> = [(7, 32)].iter().cloned().collect();
+            assert_eq!(map, dict.extract().unwrap());
+        });
+    }
+
+    #[test]
+    #[cfg(not(any(PyPy, GraalPy)))]
+    fn test_from_sequence() {
+        Python::with_gil(|py| {
+            let items = PyList::new_bound(py, vec![("a", 1), ("b", 2)]);
+            let dict = PyDict::from_sequence_bound(&items).unwrap();
+            assert_eq!(
+                1,
+                dict.get_item("a")
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap()
+            );
+            assert_eq!(
+                2,
+                dict.get_item("b")
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap()
+            );
+            let map: HashMap<String, i32> =
+                [("a".into(), 1), ("b".into(), 2)].into_iter().collect();
+            assert_eq!(map, dict.extract().unwrap());
+            let map: BTreeMap<String, i32> =
+                [("a".into(), 1), ("b".into(), 2)].into_iter().collect();
+            assert_eq!(map, dict.extract().unwrap());
+        });
+    }
+
+    #[test]
+    #[cfg(not(any(PyPy, GraalPy)))]
+    fn test_from_sequence_err() {
+        Python::with_gil(|py| {
+            let items = PyList::new_bound(py, vec!["a", "b"]);
+            assert!(PyDict::from_sequence_bound(&items).is_err());
+        });
+    }
+
+    #[test]
+    fn test_copy() {
+        Python::with_gil(|py| {
+            let dict = [(7, 32)].into_py_dict_bound(py);
+
+            let ndict = dict.copy().unwrap();
+            assert_eq!(
+                32,
+                ndict
+                    .get_item(7i32)
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap()
+            );
+            assert!(ndict.get_item(8i32).unwrap().is_none());
+        });
+    }
+
+    #[test]
+    fn test_len() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            let ob = v.to_object(py);
+            let dict = ob.downcast_bound::<PyDict>(py).unwrap();
+            assert_eq!(0, dict.len());
+            v.insert(7, 32);
+            let ob = v.to_object(py);
+            let dict2 = ob.downcast_bound::<PyDict>(py).unwrap();
+            assert_eq!(1, dict2.len());
+        });
+    }
+
+    #[test]
+    fn test_contains() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            let ob = v.to_object(py);
+            let dict = ob.downcast_bound::<PyDict>(py).unwrap();
+            assert!(dict.contains(7i32).unwrap());
+            assert!(!dict.contains(8i32).unwrap());
+        });
+    }
+
+    #[test]
+    fn test_get_item() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            let ob = v.to_object(py);
+            let dict = ob.downcast_bound::<PyDict>(py).unwrap();
+            assert_eq!(
+                32,
+                dict.get_item(7i32)
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap()
+            );
+            assert!(dict.get_item(8i32).unwrap().is_none());
+        });
+    }
+
+    #[test]
+    #[allow(deprecated)]
+    #[cfg(all(not(any(PyPy, GraalPy)), feature = "gil-refs"))]
+    fn test_get_item_with_error() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            let ob = v.to_object(py);
+            let dict = ob.downcast::<PyDict>(py).unwrap();
+            assert_eq!(
+                32,
+                dict.get_item_with_error(7i32)
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap()
+            );
+            assert!(dict.get_item_with_error(8i32).unwrap().is_none());
+            assert!(dict
+                .get_item_with_error(dict)
+                .unwrap_err()
+                .is_instance_of::<crate::exceptions::PyTypeError>(py));
+        });
+    }
+
+    #[test]
+    fn test_set_item() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            let ob = v.to_object(py);
+            let dict = ob.downcast_bound::<PyDict>(py).unwrap();
+            assert!(dict.set_item(7i32, 42i32).is_ok()); // change
+            assert!(dict.set_item(8i32, 123i32).is_ok()); // insert
+            assert_eq!(
+                42i32,
+                dict.get_item(7i32)
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap()
+            );
+            assert_eq!(
+                123i32,
+                dict.get_item(8i32)
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap()
+            );
+        });
+    }
+
+    #[test]
+    fn test_set_item_refcnt() {
+        Python::with_gil(|py| {
+            let cnt;
+            let obj = py.eval_bound("object()", None, None).unwrap();
+            {
+                cnt = obj.get_refcnt();
+                let _dict = [(10, &obj)].into_py_dict_bound(py);
+            }
+            {
+                assert_eq!(cnt, obj.get_refcnt());
+            }
+        });
+    }
+
+    #[test]
+    fn test_set_item_does_not_update_original_object() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            let ob = v.to_object(py);
+            let dict = ob.downcast_bound::<PyDict>(py).unwrap();
+            assert!(dict.set_item(7i32, 42i32).is_ok()); // change
+            assert!(dict.set_item(8i32, 123i32).is_ok()); // insert
+            assert_eq!(32i32, v[&7i32]); // not updated!
+            assert_eq!(None, v.get(&8i32));
+        });
+    }
+
+    #[test]
+    fn test_del_item() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            let ob = v.to_object(py);
+            let dict = ob.downcast_bound::<PyDict>(py).unwrap();
+            assert!(dict.del_item(7i32).is_ok());
+            assert_eq!(0, dict.len());
+            assert!(dict.get_item(7i32).unwrap().is_none());
+        });
+    }
+
+    #[test]
+    fn test_del_item_does_not_update_original_object() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            let ob = v.to_object(py);
+            let dict = ob.downcast_bound::<PyDict>(py).unwrap();
+            assert!(dict.del_item(7i32).is_ok()); // change
+            assert_eq!(32i32, *v.get(&7i32).unwrap()); // not updated!
+        });
+    }
+
+    #[test]
+    fn test_items() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            v.insert(8, 42);
+            v.insert(9, 123);
+            let ob = v.to_object(py);
+            let dict = ob.downcast_bound::<PyDict>(py).unwrap();
+            // Can't just compare against a vector of tuples since we don't have a guaranteed ordering.
+            let mut key_sum = 0;
+            let mut value_sum = 0;
+            for el in dict.items() {
+                let tuple = el.downcast::<PyTuple>().unwrap();
+                key_sum += tuple.get_item(0).unwrap().extract::<i32>().unwrap();
+                value_sum += tuple.get_item(1).unwrap().extract::<i32>().unwrap();
+            }
+            assert_eq!(7 + 8 + 9, key_sum);
+            assert_eq!(32 + 42 + 123, value_sum);
+        });
+    }
+
+    #[test]
+    fn test_keys() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            v.insert(8, 42);
+            v.insert(9, 123);
+            let ob = v.to_object(py);
+            let dict = ob.downcast_bound::<PyDict>(py).unwrap();
+            // Can't just compare against a vector of tuples since we don't have a guaranteed ordering.
+            let mut key_sum = 0;
+            for el in dict.keys() {
+                key_sum += el.extract::<i32>().unwrap();
+            }
+            assert_eq!(7 + 8 + 9, key_sum);
+        });
+    }
+
+    #[test]
+    fn test_values() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            v.insert(8, 42);
+            v.insert(9, 123);
+            let ob = v.to_object(py);
+            let dict = ob.downcast_bound::<PyDict>(py).unwrap();
+            // Can't just compare against a vector of tuples since we don't have a guaranteed ordering.
+            let mut values_sum = 0;
+            for el in dict.values() {
+                values_sum += el.extract::<i32>().unwrap();
+            }
+            assert_eq!(32 + 42 + 123, values_sum);
+        });
+    }
+
+    #[test]
+    fn test_iter() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            v.insert(8, 42);
+            v.insert(9, 123);
+            let ob = v.to_object(py);
+            let dict = ob.downcast_bound::<PyDict>(py).unwrap();
+            let mut key_sum = 0;
+            let mut value_sum = 0;
+            for (key, value) in dict {
+                key_sum += key.extract::<i32>().unwrap();
+                value_sum += value.extract::<i32>().unwrap();
+            }
+            assert_eq!(7 + 8 + 9, key_sum);
+            assert_eq!(32 + 42 + 123, value_sum);
+        });
+    }
+
+    #[test]
+    fn test_iter_bound() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            v.insert(8, 42);
+            v.insert(9, 123);
+            let ob = v.to_object(py);
+            let dict: &Bound<'_, PyDict> = ob.downcast_bound(py).unwrap();
+            let mut key_sum = 0;
+            let mut value_sum = 0;
+            for (key, value) in dict {
+                key_sum += key.extract::<i32>().unwrap();
+                value_sum += value.extract::<i32>().unwrap();
+            }
+            assert_eq!(7 + 8 + 9, key_sum);
+            assert_eq!(32 + 42 + 123, value_sum);
+        });
+    }
+
+    #[test]
+    fn test_iter_value_mutated() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            v.insert(8, 42);
+            v.insert(9, 123);
+
+            let ob = v.to_object(py);
+            let dict = ob.downcast_bound::<PyDict>(py).unwrap();
+
+            for (key, value) in dict {
+                dict.set_item(key, value.extract::<i32>().unwrap() + 7)
+                    .unwrap();
+            }
+        });
+    }
+
+    #[test]
+    #[should_panic]
+    fn test_iter_key_mutated() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            for i in 0..10 {
+                v.insert(i * 2, i * 2);
+            }
+            let ob = v.to_object(py);
+            let dict = ob.downcast_bound::<PyDict>(py).unwrap();
+
+            for (i, (key, value)) in dict.iter().enumerate() {
+                let key = key.extract::<i32>().unwrap();
+                let value = value.extract::<i32>().unwrap();
+
+                dict.set_item(key + 1, value + 1).unwrap();
+
+                if i > 1000 {
+                    // avoid this test just running out of memory if it fails
+                    break;
+                };
+            }
+        });
+    }
+
+    #[test]
+    #[should_panic]
+    fn test_iter_key_mutated_constant_len() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            for i in 0..10 {
+                v.insert(i * 2, i * 2);
+            }
+            let ob = v.to_object(py);
+            let dict = ob.downcast_bound::<PyDict>(py).unwrap();
+
+            for (i, (key, value)) in dict.iter().enumerate() {
+                let key = key.extract::<i32>().unwrap();
+                let value = value.extract::<i32>().unwrap();
+                dict.del_item(key).unwrap();
+                dict.set_item(key + 1, value + 1).unwrap();
+
+                if i > 1000 {
+                    // avoid this test just running out of memory if it fails
+                    break;
+                };
+            }
+        });
+    }
+
+    #[test]
+    fn test_iter_size_hint() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            v.insert(8, 42);
+            v.insert(9, 123);
+            let ob = v.to_object(py);
+            let dict = ob.downcast_bound::<PyDict>(py).unwrap();
+
+            let mut iter = dict.iter();
+            assert_eq!(iter.size_hint(), (v.len(), Some(v.len())));
+            iter.next();
+            assert_eq!(iter.size_hint(), (v.len() - 1, Some(v.len() - 1)));
+
+            // Exhaust iterator.
+            for _ in &mut iter {}
+
+            assert_eq!(iter.size_hint(), (0, Some(0)));
+
+            assert!(iter.next().is_none());
+
+            assert_eq!(iter.size_hint(), (0, Some(0)));
+        });
+    }
+
+    #[test]
+    fn test_into_iter() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            v.insert(8, 42);
+            v.insert(9, 123);
+            let ob = v.to_object(py);
+            let dict = ob.downcast_bound::<PyDict>(py).unwrap();
+            let mut key_sum = 0;
+            let mut value_sum = 0;
+            for (key, value) in dict {
+                key_sum += key.extract::<i32>().unwrap();
+                value_sum += value.extract::<i32>().unwrap();
+            }
+            assert_eq!(7 + 8 + 9, key_sum);
+            assert_eq!(32 + 42 + 123, value_sum);
+        });
+    }
+
+    #[test]
+    fn test_hashmap_into_dict() {
+        Python::with_gil(|py| {
+            let mut map = HashMap::<i32, i32>::new();
+            map.insert(1, 1);
+
+            let py_map = map.into_py_dict_bound(py);
+
+            assert_eq!(py_map.len(), 1);
+            assert_eq!(
+                py_map
+                    .get_item(1)
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                1
+            );
+        });
+    }
+
+    #[test]
+    fn test_btreemap_into_dict() {
+        Python::with_gil(|py| {
+            let mut map = BTreeMap::<i32, i32>::new();
+            map.insert(1, 1);
+
+            let py_map = map.into_py_dict_bound(py);
+
+            assert_eq!(py_map.len(), 1);
+            assert_eq!(
+                py_map
+                    .get_item(1)
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                1
+            );
+        });
+    }
+
+    #[test]
+    fn test_vec_into_dict() {
+        Python::with_gil(|py| {
+            let vec = vec![("a", 1), ("b", 2), ("c", 3)];
+            let py_map = vec.into_py_dict_bound(py);
+
+            assert_eq!(py_map.len(), 3);
+            assert_eq!(
+                py_map
+                    .get_item("b")
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                2
+            );
+        });
+    }
+
+    #[test]
+    fn test_slice_into_dict() {
+        Python::with_gil(|py| {
+            let arr = [("a", 1), ("b", 2), ("c", 3)];
+            let py_map = arr.into_py_dict_bound(py);
+
+            assert_eq!(py_map.len(), 3);
+            assert_eq!(
+                py_map
+                    .get_item("b")
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                2
+            );
+        });
+    }
+
+    #[test]
+    fn dict_as_mapping() {
+        Python::with_gil(|py| {
+            let mut map = HashMap::<i32, i32>::new();
+            map.insert(1, 1);
+
+            let py_map = map.into_py_dict_bound(py);
+
+            assert_eq!(py_map.as_mapping().len().unwrap(), 1);
+            assert_eq!(
+                py_map
+                    .as_mapping()
+                    .get_item(1)
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                1
+            );
+        });
+    }
+
+    #[test]
+    fn dict_into_mapping() {
+        Python::with_gil(|py| {
+            let mut map = HashMap::<i32, i32>::new();
+            map.insert(1, 1);
+
+            let py_map = map.into_py_dict_bound(py);
+
+            let py_mapping = py_map.into_mapping();
+            assert_eq!(py_mapping.len().unwrap(), 1);
+            assert_eq!(py_mapping.get_item(1).unwrap().extract::<i32>().unwrap(), 1);
+        });
+    }
+
+    #[cfg(not(any(PyPy, GraalPy)))]
+    fn abc_dict(py: Python<'_>) -> Bound<'_, PyDict> {
+        let mut map = HashMap::<&'static str, i32>::new();
+        map.insert("a", 1);
+        map.insert("b", 2);
+        map.insert("c", 3);
+        map.into_py_dict_bound(py)
+    }
+
+    #[test]
+    #[cfg(not(any(PyPy, GraalPy)))]
+    fn dict_keys_view() {
+        Python::with_gil(|py| {
+            let dict = abc_dict(py);
+            let keys = dict.call_method0("keys").unwrap();
+            assert!(keys
+                .is_instance(&py.get_type_bound::<PyDictKeys>().as_borrowed())
+                .unwrap());
+        })
+    }
+
+    #[test]
+    #[cfg(not(any(PyPy, GraalPy)))]
+    fn dict_values_view() {
+        Python::with_gil(|py| {
+            let dict = abc_dict(py);
+            let values = dict.call_method0("values").unwrap();
+            assert!(values
+                .is_instance(&py.get_type_bound::<PyDictValues>().as_borrowed())
+                .unwrap());
+        })
+    }
+
+    #[test]
+    #[cfg(not(any(PyPy, GraalPy)))]
+    fn dict_items_view() {
+        Python::with_gil(|py| {
+            let dict = abc_dict(py);
+            let items = dict.call_method0("items").unwrap();
+            assert!(items
+                .is_instance(&py.get_type_bound::<PyDictItems>().as_borrowed())
+                .unwrap());
+        })
+    }
+
+    #[test]
+    fn dict_update() {
+        Python::with_gil(|py| {
+            let dict = [("a", 1), ("b", 2), ("c", 3)].into_py_dict_bound(py);
+            let other = [("b", 4), ("c", 5), ("d", 6)].into_py_dict_bound(py);
+            dict.update(other.as_mapping()).unwrap();
+            assert_eq!(dict.len(), 4);
+            assert_eq!(
+                dict.get_item("a")
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                1
+            );
+            assert_eq!(
+                dict.get_item("b")
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                4
+            );
+            assert_eq!(
+                dict.get_item("c")
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                5
+            );
+            assert_eq!(
+                dict.get_item("d")
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                6
+            );
+
+            assert_eq!(other.len(), 3);
+            assert_eq!(
+                other
+                    .get_item("b")
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                4
+            );
+            assert_eq!(
+                other
+                    .get_item("c")
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                5
+            );
+            assert_eq!(
+                other
+                    .get_item("d")
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                6
+            );
+        })
+    }
+
+    #[test]
+    fn dict_update_if_missing() {
+        Python::with_gil(|py| {
+            let dict = [("a", 1), ("b", 2), ("c", 3)].into_py_dict_bound(py);
+            let other = [("b", 4), ("c", 5), ("d", 6)].into_py_dict_bound(py);
+            dict.update_if_missing(other.as_mapping()).unwrap();
+            assert_eq!(dict.len(), 4);
+            assert_eq!(
+                dict.get_item("a")
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                1
+            );
+            assert_eq!(
+                dict.get_item("b")
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                2
+            );
+            assert_eq!(
+                dict.get_item("c")
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                3
+            );
+            assert_eq!(
+                dict.get_item("d")
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                6
+            );
+
+            assert_eq!(other.len(), 3);
+            assert_eq!(
+                other
+                    .get_item("b")
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                4
+            );
+            assert_eq!(
+                other
+                    .get_item("c")
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                5
+            );
+            assert_eq!(
+                other
+                    .get_item("d")
+                    .unwrap()
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                6
+            );
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/ellipsis.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/ellipsis.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/ellipsis.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/ellipsis.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,85 @@
+use crate::{
+    ffi, ffi_ptr_ext::FfiPtrExt, types::any::PyAnyMethods, Borrowed, Bound, PyAny, PyTypeInfo,
+    Python,
+};
+
+/// Represents the Python `Ellipsis` object.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyEllipsis>`][crate::Py] or [`Bound<'py, PyEllipsis>`][Bound].
+#[repr(transparent)]
+pub struct PyEllipsis(PyAny);
+
+pyobject_native_type_named!(PyEllipsis);
+pyobject_native_type_extract!(PyEllipsis);
+
+impl PyEllipsis {
+    /// Returns the `Ellipsis` object.
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyEllipsis::get` will be replaced by `PyEllipsis::get_bound` in a future PyO3 version"
+    )]
+    #[inline]
+    pub fn get(py: Python<'_>) -> &PyEllipsis {
+        Self::get_bound(py).into_gil_ref()
+    }
+
+    /// Returns the `Ellipsis` object.
+    #[inline]
+    pub fn get_bound(py: Python<'_>) -> Borrowed<'_, '_, PyEllipsis> {
+        unsafe { ffi::Py_Ellipsis().assume_borrowed(py).downcast_unchecked() }
+    }
+}
+
+unsafe impl PyTypeInfo for PyEllipsis {
+    const NAME: &'static str = "ellipsis";
+
+    const MODULE: Option<&'static str> = None;
+
+    fn type_object_raw(_py: Python<'_>) -> *mut ffi::PyTypeObject {
+        unsafe { ffi::Py_TYPE(ffi::Py_Ellipsis()) }
+    }
+
+    #[inline]
+    fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool {
+        // ellipsis is not usable as a base type
+        Self::is_exact_type_of_bound(object)
+    }
+
+    #[inline]
+    fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool {
+        object.is(&**Self::get_bound(object.py()))
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::types::any::PyAnyMethods;
+    use crate::types::{PyDict, PyEllipsis};
+    use crate::{PyTypeInfo, Python};
+
+    #[test]
+    fn test_ellipsis_is_itself() {
+        Python::with_gil(|py| {
+            assert!(PyEllipsis::get_bound(py).is_instance_of::<PyEllipsis>());
+            assert!(PyEllipsis::get_bound(py).is_exact_instance_of::<PyEllipsis>());
+        })
+    }
+
+    #[test]
+    fn test_ellipsis_type_object_consistent() {
+        Python::with_gil(|py| {
+            assert!(PyEllipsis::get_bound(py)
+                .get_type()
+                .is(&PyEllipsis::type_object_bound(py)));
+        })
+    }
+
+    #[test]
+    fn test_dict_is_not_ellipsis() {
+        Python::with_gil(|py| {
+            assert!(PyDict::new_bound(py).downcast::<PyEllipsis>().is_err());
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/float.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/float.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/float.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/float.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,200 @@
+use super::any::PyAnyMethods;
+#[cfg(feature = "experimental-inspect")]
+use crate::inspect::types::TypeInfo;
+#[cfg(feature = "gil-refs")]
+use crate::PyNativeType;
+use crate::{
+    ffi, ffi_ptr_ext::FfiPtrExt, instance::Bound, FromPyObject, IntoPy, PyAny, PyErr, PyObject,
+    PyResult, Python, ToPyObject,
+};
+use std::os::raw::c_double;
+
+/// Represents a Python `float` object.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyFloat>`][crate::Py] or [`Bound<'py, PyFloat>`][Bound].
+///
+/// For APIs available on `float` objects, see the [`PyFloatMethods`] trait which is implemented for
+/// [`Bound<'py, PyFloat>`][Bound].
+///
+/// You can usually avoid directly working with this type
+/// by using [`ToPyObject`] and [`extract`][PyAnyMethods::extract]
+/// with [`f32`]/[`f64`].
+#[repr(transparent)]
+pub struct PyFloat(PyAny);
+
+pyobject_native_type!(
+    PyFloat,
+    ffi::PyFloatObject,
+    pyobject_native_static_type_object!(ffi::PyFloat_Type),
+    #checkfunction=ffi::PyFloat_Check
+);
+
+impl PyFloat {
+    /// Creates a new Python `float` object.
+    pub fn new_bound(py: Python<'_>, val: c_double) -> Bound<'_, PyFloat> {
+        unsafe {
+            ffi::PyFloat_FromDouble(val)
+                .assume_owned(py)
+                .downcast_into_unchecked()
+        }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyFloat {
+    /// Deprecated form of [`PyFloat::new_bound`].
+    #[inline]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyFloat::new` will be replaced by `PyFloat::new_bound` in a future PyO3 version"
+    )]
+    pub fn new(py: Python<'_>, val: f64) -> &'_ Self {
+        Self::new_bound(py, val).into_gil_ref()
+    }
+
+    /// Gets the value of this float.
+    pub fn value(&self) -> c_double {
+        self.as_borrowed().value()
+    }
+}
+
+/// Implementation of functionality for [`PyFloat`].
+///
+/// These methods are defined for the `Bound<'py, PyFloat>` smart pointer, so to use method call
+/// syntax these methods are separated into a trait, because stable Rust does not yet support
+/// `arbitrary_self_types`.
+#[doc(alias = "PyFloat")]
+pub trait PyFloatMethods<'py>: crate::sealed::Sealed {
+    /// Gets the value of this float.
+    fn value(&self) -> c_double;
+}
+
+impl<'py> PyFloatMethods<'py> for Bound<'py, PyFloat> {
+    fn value(&self) -> c_double {
+        #[cfg(not(Py_LIMITED_API))]
+        unsafe {
+            // Safety: self is PyFloat object
+            ffi::PyFloat_AS_DOUBLE(self.as_ptr())
+        }
+
+        #[cfg(Py_LIMITED_API)]
+        unsafe {
+            ffi::PyFloat_AsDouble(self.as_ptr())
+        }
+    }
+}
+
+impl ToPyObject for f64 {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        PyFloat::new_bound(py, *self).into()
+    }
+}
+
+impl IntoPy<PyObject> for f64 {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        PyFloat::new_bound(py, self).into()
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_output() -> TypeInfo {
+        TypeInfo::builtin("float")
+    }
+}
+
+impl<'py> FromPyObject<'py> for f64 {
+    // PyFloat_AsDouble returns -1.0 upon failure
+    #![allow(clippy::float_cmp)]
+    fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self> {
+        // On non-limited API, .value() uses PyFloat_AS_DOUBLE which
+        // allows us to have an optimized fast path for the case when
+        // we have exactly a `float` object (it's not worth going through
+        // `isinstance` machinery for subclasses).
+        #[cfg(not(Py_LIMITED_API))]
+        if let Ok(float) = obj.downcast_exact::<PyFloat>() {
+            return Ok(float.value());
+        }
+
+        let v = unsafe { ffi::PyFloat_AsDouble(obj.as_ptr()) };
+
+        if v == -1.0 {
+            if let Some(err) = PyErr::take(obj.py()) {
+                return Err(err);
+            }
+        }
+
+        Ok(v)
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        Self::type_output()
+    }
+}
+
+impl ToPyObject for f32 {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        PyFloat::new_bound(py, f64::from(*self)).into()
+    }
+}
+
+impl IntoPy<PyObject> for f32 {
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        PyFloat::new_bound(py, f64::from(self)).into()
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_output() -> TypeInfo {
+        TypeInfo::builtin("float")
+    }
+}
+
+impl<'py> FromPyObject<'py> for f32 {
+    fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self> {
+        Ok(obj.extract::<f64>()? as f32)
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        Self::type_output()
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::{
+        types::{PyFloat, PyFloatMethods},
+        Python, ToPyObject,
+    };
+
+    macro_rules! num_to_py_object_and_back (
+        ($func_name:ident, $t1:ty, $t2:ty) => (
+            #[test]
+            fn $func_name() {
+                use assert_approx_eq::assert_approx_eq;
+
+                Python::with_gil(|py| {
+
+                let val = 123 as $t1;
+                let obj = val.to_object(py);
+                assert_approx_eq!(obj.extract::<$t2>(py).unwrap(), val as $t2);
+                });
+            }
+        )
+    );
+
+    num_to_py_object_and_back!(to_from_f64, f64, f64);
+    num_to_py_object_and_back!(to_from_f32, f32, f32);
+    num_to_py_object_and_back!(int_to_float, i32, f64);
+
+    #[test]
+    fn test_float_value() {
+        use assert_approx_eq::assert_approx_eq;
+
+        Python::with_gil(|py| {
+            let v = 1.23f64;
+            let obj = PyFloat::new_bound(py, 1.23);
+            assert_approx_eq!(v, obj.value());
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/frame.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/frame.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/frame.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/frame.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,15 @@
+use crate::ffi;
+use crate::PyAny;
+
+/// Represents a Python frame.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyFrame>`][crate::Py] or [`Bound<'py, PyFrame>`][crate::Bound].
+#[repr(transparent)]
+pub struct PyFrame(PyAny);
+
+pyobject_native_type_core!(
+    PyFrame,
+    pyobject_native_static_type_object!(ffi::PyFrame_Type),
+    #checkfunction=ffi::PyFrame_Check
+);
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/frozenset.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/frozenset.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/frozenset.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/frozenset.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,422 @@
+use crate::types::PyIterator;
+#[cfg(feature = "gil-refs")]
+use crate::PyNativeType;
+use crate::{
+    err::{self, PyErr, PyResult},
+    ffi,
+    ffi_ptr_ext::FfiPtrExt,
+    py_result_ext::PyResultExt,
+    types::any::PyAnyMethods,
+    Bound, PyAny, PyObject, Python, ToPyObject,
+};
+use std::ptr;
+
+/// Allows building a Python `frozenset` one item at a time
+pub struct PyFrozenSetBuilder<'py> {
+    py_frozen_set: Bound<'py, PyFrozenSet>,
+}
+
+impl<'py> PyFrozenSetBuilder<'py> {
+    /// Create a new `FrozenSetBuilder`.
+    /// Since this allocates a `PyFrozenSet` internally it may
+    /// panic when running out of memory.
+    pub fn new(py: Python<'py>) -> PyResult<PyFrozenSetBuilder<'py>> {
+        Ok(PyFrozenSetBuilder {
+            py_frozen_set: PyFrozenSet::empty_bound(py)?,
+        })
+    }
+
+    /// Adds an element to the set.
+    pub fn add<K>(&mut self, key: K) -> PyResult<()>
+    where
+        K: ToPyObject,
+    {
+        fn inner(frozenset: &Bound<'_, PyFrozenSet>, key: PyObject) -> PyResult<()> {
+            err::error_on_minusone(frozenset.py(), unsafe {
+                ffi::PySet_Add(frozenset.as_ptr(), key.as_ptr())
+            })
+        }
+
+        inner(&self.py_frozen_set, key.to_object(self.py_frozen_set.py()))
+    }
+
+    /// Deprecated form of [`PyFrozenSetBuilder::finalize_bound`]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyFrozenSetBuilder::finalize` will be replaced by `PyFrozenSetBuilder::finalize_bound` in a future PyO3 version"
+    )]
+    pub fn finalize(self) -> &'py PyFrozenSet {
+        self.finalize_bound().into_gil_ref()
+    }
+
+    /// Finish building the set and take ownership of its current value
+    pub fn finalize_bound(self) -> Bound<'py, PyFrozenSet> {
+        self.py_frozen_set
+    }
+}
+
+/// Represents a  Python `frozenset`.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyFrozenSet>`][crate::Py] or [`Bound<'py, PyFrozenSet>`][Bound].
+///
+/// For APIs available on `frozenset` objects, see the [`PyFrozenSetMethods`] trait which is implemented for
+/// [`Bound<'py, PyFrozenSet>`][Bound].
+#[repr(transparent)]
+pub struct PyFrozenSet(PyAny);
+
+#[cfg(not(any(PyPy, GraalPy)))]
+pyobject_native_type!(
+    PyFrozenSet,
+    ffi::PySetObject,
+    pyobject_native_static_type_object!(ffi::PyFrozenSet_Type),
+    #checkfunction=ffi::PyFrozenSet_Check
+);
+
+#[cfg(any(PyPy, GraalPy))]
+pyobject_native_type_core!(
+    PyFrozenSet,
+    pyobject_native_static_type_object!(ffi::PyFrozenSet_Type),
+    #checkfunction=ffi::PyFrozenSet_Check
+);
+
+impl PyFrozenSet {
+    /// Creates a new frozenset.
+    ///
+    /// May panic when running out of memory.
+    #[inline]
+    pub fn new_bound<'a, 'p, T: ToPyObject + 'a>(
+        py: Python<'p>,
+        elements: impl IntoIterator<Item = &'a T>,
+    ) -> PyResult<Bound<'p, PyFrozenSet>> {
+        new_from_iter(py, elements)
+    }
+
+    /// Creates a new empty frozen set
+    pub fn empty_bound(py: Python<'_>) -> PyResult<Bound<'_, PyFrozenSet>> {
+        unsafe {
+            ffi::PyFrozenSet_New(ptr::null_mut())
+                .assume_owned_or_err(py)
+                .downcast_into_unchecked()
+        }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyFrozenSet {
+    /// Deprecated form of [`PyFrozenSet::new_bound`].
+    #[inline]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyFrozenSet::new` will be replaced by `PyFrozenSet::new_bound` in a future PyO3 version"
+    )]
+    pub fn new<'a, 'p, T: ToPyObject + 'a>(
+        py: Python<'p>,
+        elements: impl IntoIterator<Item = &'a T>,
+    ) -> PyResult<&'p PyFrozenSet> {
+        Self::new_bound(py, elements).map(Bound::into_gil_ref)
+    }
+
+    /// Deprecated form of [`PyFrozenSet::empty_bound`].
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyFrozenSet::empty` will be replaced by `PyFrozenSet::empty_bound` in a future PyO3 version"
+    )]
+    pub fn empty(py: Python<'_>) -> PyResult<&'_ PyFrozenSet> {
+        Self::empty_bound(py).map(Bound::into_gil_ref)
+    }
+
+    /// Return the number of items in the set.
+    /// This is equivalent to len(p) on a set.
+    #[inline]
+    pub fn len(&self) -> usize {
+        self.as_borrowed().len()
+    }
+
+    /// Check if set is empty.
+    pub fn is_empty(&self) -> bool {
+        self.as_borrowed().is_empty()
+    }
+
+    /// Determine if the set contains the specified key.
+    /// This is equivalent to the Python expression `key in self`.
+    pub fn contains<K>(&self, key: K) -> PyResult<bool>
+    where
+        K: ToPyObject,
+    {
+        self.as_borrowed().contains(key)
+    }
+
+    /// Returns an iterator of values in this frozen set.
+    pub fn iter(&self) -> PyFrozenSetIterator<'_> {
+        PyFrozenSetIterator(BoundFrozenSetIterator::new(self.as_borrowed().to_owned()))
+    }
+}
+
+/// Implementation of functionality for [`PyFrozenSet`].
+///
+/// These methods are defined for the `Bound<'py, PyFrozenSet>` smart pointer, so to use method call
+/// syntax these methods are separated into a trait, because stable Rust does not yet support
+/// `arbitrary_self_types`.
+#[doc(alias = "PyFrozenSet")]
+pub trait PyFrozenSetMethods<'py>: crate::sealed::Sealed {
+    /// Returns the number of items in the set.
+    ///
+    /// This is equivalent to the Python expression `len(self)`.
+    fn len(&self) -> usize;
+
+    /// Checks if set is empty.
+    fn is_empty(&self) -> bool {
+        self.len() == 0
+    }
+
+    /// Determines if the set contains the specified key.
+    ///
+    /// This is equivalent to the Python expression `key in self`.
+    fn contains<K>(&self, key: K) -> PyResult<bool>
+    where
+        K: ToPyObject;
+
+    /// Returns an iterator of values in this set.
+    fn iter(&self) -> BoundFrozenSetIterator<'py>;
+}
+
+impl<'py> PyFrozenSetMethods<'py> for Bound<'py, PyFrozenSet> {
+    #[inline]
+    fn len(&self) -> usize {
+        unsafe { ffi::PySet_Size(self.as_ptr()) as usize }
+    }
+
+    fn contains<K>(&self, key: K) -> PyResult<bool>
+    where
+        K: ToPyObject,
+    {
+        fn inner(frozenset: &Bound<'_, PyFrozenSet>, key: Bound<'_, PyAny>) -> PyResult<bool> {
+            match unsafe { ffi::PySet_Contains(frozenset.as_ptr(), key.as_ptr()) } {
+                1 => Ok(true),
+                0 => Ok(false),
+                _ => Err(PyErr::fetch(frozenset.py())),
+            }
+        }
+
+        let py = self.py();
+        inner(self, key.to_object(py).into_bound(py))
+    }
+
+    fn iter(&self) -> BoundFrozenSetIterator<'py> {
+        BoundFrozenSetIterator::new(self.clone())
+    }
+}
+
+/// PyO3 implementation of an iterator for a Python `frozenset` object.
+#[cfg(feature = "gil-refs")]
+pub struct PyFrozenSetIterator<'py>(BoundFrozenSetIterator<'py>);
+
+#[cfg(feature = "gil-refs")]
+impl<'py> Iterator for PyFrozenSetIterator<'py> {
+    type Item = &'py super::PyAny;
+
+    /// Advances the iterator and returns the next value.
+    #[inline]
+    fn next(&mut self) -> Option<Self::Item> {
+        self.0.next().map(Bound::into_gil_ref)
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        self.0.size_hint()
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl ExactSizeIterator for PyFrozenSetIterator<'_> {
+    #[inline]
+    fn len(&self) -> usize {
+        self.0.len()
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'py> IntoIterator for &'py PyFrozenSet {
+    type Item = &'py PyAny;
+    type IntoIter = PyFrozenSetIterator<'py>;
+    /// Returns an iterator of values in this set.
+    fn into_iter(self) -> Self::IntoIter {
+        PyFrozenSetIterator(BoundFrozenSetIterator::new(self.as_borrowed().to_owned()))
+    }
+}
+
+impl<'py> IntoIterator for Bound<'py, PyFrozenSet> {
+    type Item = Bound<'py, PyAny>;
+    type IntoIter = BoundFrozenSetIterator<'py>;
+
+    /// Returns an iterator of values in this set.
+    fn into_iter(self) -> Self::IntoIter {
+        BoundFrozenSetIterator::new(self)
+    }
+}
+
+impl<'py> IntoIterator for &Bound<'py, PyFrozenSet> {
+    type Item = Bound<'py, PyAny>;
+    type IntoIter = BoundFrozenSetIterator<'py>;
+
+    /// Returns an iterator of values in this set.
+    fn into_iter(self) -> Self::IntoIter {
+        self.iter()
+    }
+}
+
+/// PyO3 implementation of an iterator for a Python `frozenset` object.
+pub struct BoundFrozenSetIterator<'p> {
+    it: Bound<'p, PyIterator>,
+    // Remaining elements in the frozenset
+    remaining: usize,
+}
+
+impl<'py> BoundFrozenSetIterator<'py> {
+    pub(super) fn new(set: Bound<'py, PyFrozenSet>) -> Self {
+        Self {
+            it: PyIterator::from_bound_object(&set).unwrap(),
+            remaining: set.len(),
+        }
+    }
+}
+
+impl<'py> Iterator for BoundFrozenSetIterator<'py> {
+    type Item = Bound<'py, super::PyAny>;
+
+    /// Advances the iterator and returns the next value.
+    fn next(&mut self) -> Option<Self::Item> {
+        self.remaining = self.remaining.saturating_sub(1);
+        self.it.next().map(Result::unwrap)
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        (self.remaining, Some(self.remaining))
+    }
+}
+
+impl<'py> ExactSizeIterator for BoundFrozenSetIterator<'py> {
+    fn len(&self) -> usize {
+        self.remaining
+    }
+}
+
+#[inline]
+pub(crate) fn new_from_iter<T: ToPyObject>(
+    py: Python<'_>,
+    elements: impl IntoIterator<Item = T>,
+) -> PyResult<Bound<'_, PyFrozenSet>> {
+    fn inner<'py>(
+        py: Python<'py>,
+        elements: &mut dyn Iterator<Item = PyObject>,
+    ) -> PyResult<Bound<'py, PyFrozenSet>> {
+        let set = unsafe {
+            // We create the  `Py` pointer because its Drop cleans up the set if user code panics.
+            ffi::PyFrozenSet_New(std::ptr::null_mut())
+                .assume_owned_or_err(py)?
+                .downcast_into_unchecked()
+        };
+        let ptr = set.as_ptr();
+
+        for obj in elements {
+            err::error_on_minusone(py, unsafe { ffi::PySet_Add(ptr, obj.as_ptr()) })?;
+        }
+
+        Ok(set)
+    }
+
+    let mut iter = elements.into_iter().map(|e| e.to_object(py));
+    inner(py, &mut iter)
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test_frozenset_new_and_len() {
+        Python::with_gil(|py| {
+            let set = PyFrozenSet::new_bound(py, &[1]).unwrap();
+            assert_eq!(1, set.len());
+
+            let v = vec![1];
+            assert!(PyFrozenSet::new_bound(py, &[v]).is_err());
+        });
+    }
+
+    #[test]
+    fn test_frozenset_empty() {
+        Python::with_gil(|py| {
+            let set = PyFrozenSet::empty_bound(py).unwrap();
+            assert_eq!(0, set.len());
+            assert!(set.is_empty());
+        });
+    }
+
+    #[test]
+    fn test_frozenset_contains() {
+        Python::with_gil(|py| {
+            let set = PyFrozenSet::new_bound(py, &[1]).unwrap();
+            assert!(set.contains(1).unwrap());
+        });
+    }
+
+    #[test]
+    fn test_frozenset_iter() {
+        Python::with_gil(|py| {
+            let set = PyFrozenSet::new_bound(py, &[1]).unwrap();
+
+            for el in set {
+                assert_eq!(1i32, el.extract::<i32>().unwrap());
+            }
+        });
+    }
+
+    #[test]
+    fn test_frozenset_iter_bound() {
+        Python::with_gil(|py| {
+            let set = PyFrozenSet::new_bound(py, &[1]).unwrap();
+
+            for el in &set {
+                assert_eq!(1i32, el.extract::<i32>().unwrap());
+            }
+        });
+    }
+
+    #[test]
+    fn test_frozenset_iter_size_hint() {
+        Python::with_gil(|py| {
+            let set = PyFrozenSet::new_bound(py, &[1]).unwrap();
+            let mut iter = set.iter();
+
+            // Exact size
+            assert_eq!(iter.len(), 1);
+            assert_eq!(iter.size_hint(), (1, Some(1)));
+            iter.next();
+            assert_eq!(iter.len(), 0);
+            assert_eq!(iter.size_hint(), (0, Some(0)));
+        });
+    }
+
+    #[test]
+    fn test_frozenset_builder() {
+        use super::PyFrozenSetBuilder;
+
+        Python::with_gil(|py| {
+            let mut builder = PyFrozenSetBuilder::new(py).unwrap();
+
+            // add an item
+            builder.add(1).unwrap();
+            builder.add(2).unwrap();
+            builder.add(2).unwrap();
+
+            // finalize it
+            let set = builder.finalize_bound();
+
+            assert!(set.contains(1).unwrap());
+            assert!(set.contains(2).unwrap());
+            assert!(!set.contains(3).unwrap());
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/function.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/function.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/function.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/function.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,255 @@
+#[cfg(feature = "gil-refs")]
+use crate::derive_utils::PyFunctionArguments;
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::py_result_ext::PyResultExt;
+use crate::types::capsule::PyCapsuleMethods;
+use crate::types::module::PyModuleMethods;
+#[cfg(feature = "gil-refs")]
+use crate::PyNativeType;
+use crate::{
+    ffi,
+    impl_::pymethods::{self, PyMethodDef},
+    types::{PyCapsule, PyDict, PyModule, PyString, PyTuple},
+};
+use crate::{Bound, IntoPy, Py, PyAny, PyResult, Python};
+use std::cell::UnsafeCell;
+use std::ffi::CStr;
+
+/// Represents a builtin Python function object.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyCFunction>`][crate::Py] or [`Bound<'py, PyCFunction>`][Bound].
+#[repr(transparent)]
+pub struct PyCFunction(PyAny);
+
+pyobject_native_type_core!(PyCFunction, pyobject_native_static_type_object!(ffi::PyCFunction_Type), #checkfunction=ffi::PyCFunction_Check);
+
+impl PyCFunction {
+    /// Deprecated form of [`PyCFunction::new_with_keywords_bound`]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyCFunction::new_with_keywords` will be replaced by `PyCFunction::new_with_keywords_bound` in a future PyO3 version"
+    )]
+    pub fn new_with_keywords<'a>(
+        fun: ffi::PyCFunctionWithKeywords,
+        name: &'static CStr,
+        doc: &'static CStr,
+        py_or_module: PyFunctionArguments<'a>,
+    ) -> PyResult<&'a Self> {
+        let (py, module) = py_or_module.into_py_and_maybe_module();
+        Self::internal_new(
+            py,
+            &PyMethodDef::cfunction_with_keywords(name, fun, doc),
+            module.map(PyNativeType::as_borrowed).as_deref(),
+        )
+        .map(Bound::into_gil_ref)
+    }
+
+    /// Create a new built-in function with keywords (*args and/or **kwargs).
+    ///
+    /// To create `name` and `doc` static strings on Rust versions older than 1.77 (which added c"" literals),
+    /// use the [`c_str!`](crate::ffi::c_str) macro.
+    pub fn new_with_keywords_bound<'py>(
+        py: Python<'py>,
+        fun: ffi::PyCFunctionWithKeywords,
+        name: &'static CStr,
+        doc: &'static CStr,
+        module: Option<&Bound<'py, PyModule>>,
+    ) -> PyResult<Bound<'py, Self>> {
+        Self::internal_new(
+            py,
+            &PyMethodDef::cfunction_with_keywords(name, fun, doc),
+            module,
+        )
+    }
+
+    /// Deprecated form of [`PyCFunction::new`]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyCFunction::new` will be replaced by `PyCFunction::new_bound` in a future PyO3 version"
+    )]
+    pub fn new<'a>(
+        fun: ffi::PyCFunction,
+        name: &'static CStr,
+        doc: &'static CStr,
+        py_or_module: PyFunctionArguments<'a>,
+    ) -> PyResult<&'a Self> {
+        let (py, module) = py_or_module.into_py_and_maybe_module();
+        Self::internal_new(
+            py,
+            &PyMethodDef::noargs(name, fun, doc),
+            module.map(PyNativeType::as_borrowed).as_deref(),
+        )
+        .map(Bound::into_gil_ref)
+    }
+
+    /// Create a new built-in function which takes no arguments.
+    ///
+    /// To create `name` and `doc` static strings on Rust versions older than 1.77 (which added c"" literals),
+    /// use the [`c_str!`](crate::ffi::c_str) macro.
+    pub fn new_bound<'py>(
+        py: Python<'py>,
+        fun: ffi::PyCFunction,
+        name: &'static CStr,
+        doc: &'static CStr,
+        module: Option<&Bound<'py, PyModule>>,
+    ) -> PyResult<Bound<'py, Self>> {
+        Self::internal_new(py, &PyMethodDef::noargs(name, fun, doc), module)
+    }
+
+    /// Deprecated form of [`PyCFunction::new_closure`]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyCFunction::new_closure` will be replaced by `PyCFunction::new_closure_bound` in a future PyO3 version"
+    )]
+    pub fn new_closure<'a, F, R>(
+        py: Python<'a>,
+        name: Option<&'static CStr>,
+        doc: Option<&'static CStr>,
+        closure: F,
+    ) -> PyResult<&'a PyCFunction>
+    where
+        F: Fn(&PyTuple, Option<&PyDict>) -> R + Send + 'static,
+        R: crate::callback::IntoPyCallbackOutput<*mut ffi::PyObject>,
+    {
+        Self::new_closure_bound(py, name, doc, move |args, kwargs| {
+            closure(args.as_gil_ref(), kwargs.map(Bound::as_gil_ref))
+        })
+        .map(Bound::into_gil_ref)
+    }
+
+    /// Create a new function from a closure.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # use pyo3::prelude::*;
+    /// # use pyo3::{py_run, types::{PyCFunction, PyDict, PyTuple}};
+    ///
+    /// Python::with_gil(|py| {
+    ///     let add_one = |args: &Bound<'_, PyTuple>, _kwargs: Option<&Bound<'_, PyDict>>| -> PyResult<_> {
+    ///         let i = args.extract::<(i64,)>()?.0;
+    ///         Ok(i+1)
+    ///     };
+    ///     let add_one = PyCFunction::new_closure_bound(py, None, None, add_one).unwrap();
+    ///     py_run!(py, add_one, "assert add_one(42) == 43");
+    /// });
+    /// ```
+    pub fn new_closure_bound<'py, F, R>(
+        py: Python<'py>,
+        name: Option<&'static CStr>,
+        doc: Option<&'static CStr>,
+        closure: F,
+    ) -> PyResult<Bound<'py, Self>>
+    where
+        F: Fn(&Bound<'_, PyTuple>, Option<&Bound<'_, PyDict>>) -> R + Send + 'static,
+        R: crate::callback::IntoPyCallbackOutput<*mut ffi::PyObject>,
+    {
+        let name = name.unwrap_or(ffi::c_str!("pyo3-closure"));
+        let doc = doc.unwrap_or(ffi::c_str!(""));
+        let method_def =
+            pymethods::PyMethodDef::cfunction_with_keywords(name, run_closure::<F, R>, doc);
+        let def = method_def.as_method_def();
+
+        let capsule = PyCapsule::new_bound(
+            py,
+            ClosureDestructor::<F> {
+                closure,
+                def: UnsafeCell::new(def),
+            },
+            Some(CLOSURE_CAPSULE_NAME.to_owned()),
+        )?;
+
+        // Safety: just created the capsule with type ClosureDestructor<F> above
+        let data = unsafe { capsule.reference::<ClosureDestructor<F>>() };
+
+        unsafe {
+            ffi::PyCFunction_NewEx(data.def.get(), capsule.as_ptr(), std::ptr::null_mut())
+                .assume_owned_or_err(py)
+                .downcast_into_unchecked()
+        }
+    }
+
+    #[doc(hidden)]
+    pub fn internal_new<'py>(
+        py: Python<'py>,
+        method_def: &PyMethodDef,
+        module: Option<&Bound<'py, PyModule>>,
+    ) -> PyResult<Bound<'py, Self>> {
+        let (mod_ptr, module_name): (_, Option<Py<PyString>>) = if let Some(m) = module {
+            let mod_ptr = m.as_ptr();
+            (mod_ptr, Some(m.name()?.into_py(py)))
+        } else {
+            (std::ptr::null_mut(), None)
+        };
+        let def = method_def.as_method_def();
+
+        // FIXME: stop leaking the def
+        let def = Box::into_raw(Box::new(def));
+
+        let module_name_ptr = module_name
+            .as_ref()
+            .map_or(std::ptr::null_mut(), Py::as_ptr);
+
+        unsafe {
+            ffi::PyCFunction_NewEx(def, mod_ptr, module_name_ptr)
+                .assume_owned_or_err(py)
+                .downcast_into_unchecked()
+        }
+    }
+}
+
+static CLOSURE_CAPSULE_NAME: &CStr = ffi::c_str!("pyo3-closure");
+
+unsafe extern "C" fn run_closure<F, R>(
+    capsule_ptr: *mut ffi::PyObject,
+    args: *mut ffi::PyObject,
+    kwargs: *mut ffi::PyObject,
+) -> *mut ffi::PyObject
+where
+    F: Fn(&Bound<'_, PyTuple>, Option<&Bound<'_, PyDict>>) -> R + Send + 'static,
+    R: crate::callback::IntoPyCallbackOutput<*mut ffi::PyObject>,
+{
+    use crate::types::any::PyAnyMethods;
+
+    crate::impl_::trampoline::cfunction_with_keywords(
+        capsule_ptr,
+        args,
+        kwargs,
+        |py, capsule_ptr, args, kwargs| {
+            let boxed_fn: &ClosureDestructor<F> =
+                &*(ffi::PyCapsule_GetPointer(capsule_ptr, CLOSURE_CAPSULE_NAME.as_ptr())
+                    as *mut ClosureDestructor<F>);
+            let args = Bound::ref_from_ptr(py, &args).downcast_unchecked::<PyTuple>();
+            let kwargs = Bound::ref_from_ptr_or_opt(py, &kwargs)
+                .as_ref()
+                .map(|b| b.downcast_unchecked::<PyDict>());
+            let result = (boxed_fn.closure)(args, kwargs);
+            crate::callback::convert(py, result)
+        },
+    )
+}
+
+struct ClosureDestructor<F> {
+    closure: F,
+    // Wrapped in UnsafeCell because Python C-API wants a *mut pointer
+    // to this member.
+    def: UnsafeCell<ffi::PyMethodDef>,
+}
+
+// Safety: F is send and none of the fields are ever mutated
+unsafe impl<F: Send> Send for ClosureDestructor<F> {}
+
+/// Represents a Python function object.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyFunction>`][crate::Py] or [`Bound<'py, PyFunction>`][Bound].
+#[repr(transparent)]
+#[cfg(all(not(Py_LIMITED_API), not(all(PyPy, not(Py_3_8)))))]
+pub struct PyFunction(PyAny);
+
+#[cfg(all(not(Py_LIMITED_API), not(all(PyPy, not(Py_3_8)))))]
+pyobject_native_type_core!(PyFunction, pyobject_native_static_type_object!(ffi::PyFunction_Type), #checkfunction=ffi::PyFunction_Check);
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/iterator.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/iterator.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/iterator.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/iterator.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,395 @@
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::instance::Borrowed;
+use crate::py_result_ext::PyResultExt;
+use crate::{ffi, Bound, PyAny, PyErr, PyResult, PyTypeCheck};
+#[cfg(feature = "gil-refs")]
+use crate::{AsPyPointer, PyDowncastError, PyNativeType};
+
+/// A Python iterator object.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyIterator>`][crate::Py] or [`Bound<'py, PyIterator>`][Bound].
+///
+/// # Examples
+///
+/// ```rust
+/// use pyo3::prelude::*;
+///
+/// # fn main() -> PyResult<()> {
+/// Python::with_gil(|py| -> PyResult<()> {
+///     let list = py.eval_bound("iter([1, 2, 3, 4])", None, None)?;
+///     let numbers: PyResult<Vec<usize>> = list
+///         .iter()?
+///         .map(|i| i.and_then(|i|i.extract::<usize>()))
+///         .collect();
+///     let sum: usize = numbers?.iter().sum();
+///     assert_eq!(sum, 10);
+///     Ok(())
+/// })
+/// # }
+/// ```
+#[repr(transparent)]
+pub struct PyIterator(PyAny);
+pyobject_native_type_named!(PyIterator);
+pyobject_native_type_extract!(PyIterator);
+
+impl PyIterator {
+    /// Deprecated form of `PyIterator::from_bound_object`.
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyIterator::from_object` will be replaced by `PyIterator::from_bound_object` in a future PyO3 version"
+    )]
+    pub fn from_object(obj: &PyAny) -> PyResult<&PyIterator> {
+        Self::from_bound_object(&obj.as_borrowed()).map(Bound::into_gil_ref)
+    }
+
+    /// Builds an iterator for an iterable Python object; the equivalent of calling `iter(obj)` in Python.
+    ///
+    /// Usually it is more convenient to write [`obj.iter()`][crate::types::any::PyAnyMethods::iter],
+    /// which is a more concise way of calling this function.
+    pub fn from_bound_object<'py>(obj: &Bound<'py, PyAny>) -> PyResult<Bound<'py, PyIterator>> {
+        unsafe {
+            ffi::PyObject_GetIter(obj.as_ptr())
+                .assume_owned_or_err(obj.py())
+                .downcast_into_unchecked()
+        }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'p> Iterator for &'p PyIterator {
+    type Item = PyResult<&'p PyAny>;
+
+    /// Retrieves the next item from an iterator.
+    ///
+    /// Returns `None` when the iterator is exhausted.
+    /// If an exception occurs, returns `Some(Err(..))`.
+    /// Further `next()` calls after an exception occurs are likely
+    /// to repeatedly result in the same exception.
+    fn next(&mut self) -> Option<Self::Item> {
+        self.as_borrowed()
+            .next()
+            .map(|result| result.map(Bound::into_gil_ref))
+    }
+
+    #[cfg(not(Py_LIMITED_API))]
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        self.as_borrowed().size_hint()
+    }
+}
+
+impl<'py> Iterator for Bound<'py, PyIterator> {
+    type Item = PyResult<Bound<'py, PyAny>>;
+
+    /// Retrieves the next item from an iterator.
+    ///
+    /// Returns `None` when the iterator is exhausted.
+    /// If an exception occurs, returns `Some(Err(..))`.
+    /// Further `next()` calls after an exception occurs are likely
+    /// to repeatedly result in the same exception.
+    #[inline]
+    fn next(&mut self) -> Option<Self::Item> {
+        Borrowed::from(&*self).next()
+    }
+
+    #[cfg(not(Py_LIMITED_API))]
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        let hint = unsafe { ffi::PyObject_LengthHint(self.as_ptr(), 0) };
+        (hint.max(0) as usize, None)
+    }
+}
+
+impl<'py> Borrowed<'_, 'py, PyIterator> {
+    // TODO: this method is on Borrowed so that &'py PyIterator can use this; once that
+    // implementation is deleted this method should be moved to the `Bound<'py, PyIterator> impl
+    fn next(self) -> Option<PyResult<Bound<'py, PyAny>>> {
+        let py = self.py();
+
+        match unsafe { ffi::PyIter_Next(self.as_ptr()).assume_owned_or_opt(py) } {
+            Some(obj) => Some(Ok(obj)),
+            None => PyErr::take(py).map(Err),
+        }
+    }
+}
+
+impl<'py> IntoIterator for &Bound<'py, PyIterator> {
+    type Item = PyResult<Bound<'py, PyAny>>;
+    type IntoIter = Bound<'py, PyIterator>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        self.clone()
+    }
+}
+
+impl PyTypeCheck for PyIterator {
+    const NAME: &'static str = "Iterator";
+
+    fn type_check(object: &Bound<'_, PyAny>) -> bool {
+        unsafe { ffi::PyIter_Check(object.as_ptr()) != 0 }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+impl<'v> crate::PyTryFrom<'v> for PyIterator {
+    fn try_from<V: Into<&'v PyAny>>(value: V) -> Result<&'v PyIterator, PyDowncastError<'v>> {
+        let value = value.into();
+        unsafe {
+            if ffi::PyIter_Check(value.as_ptr()) != 0 {
+                Ok(value.downcast_unchecked())
+            } else {
+                Err(PyDowncastError::new(value, "Iterator"))
+            }
+        }
+    }
+
+    fn try_from_exact<V: Into<&'v PyAny>>(value: V) -> Result<&'v PyIterator, PyDowncastError<'v>> {
+        value.into().downcast()
+    }
+
+    #[inline]
+    unsafe fn try_from_unchecked<V: Into<&'v PyAny>>(value: V) -> &'v PyIterator {
+        let ptr = value.into() as *const _ as *const PyIterator;
+        &*ptr
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::PyIterator;
+    use crate::exceptions::PyTypeError;
+    use crate::types::{PyAnyMethods, PyDict, PyList, PyListMethods};
+    use crate::{Python, ToPyObject};
+
+    #[test]
+    fn vec_iter() {
+        Python::with_gil(|py| {
+            let obj = vec![10, 20].to_object(py);
+            let inst = obj.bind(py);
+            let mut it = inst.iter().unwrap();
+            assert_eq!(
+                10_i32,
+                it.next().unwrap().unwrap().extract::<'_, i32>().unwrap()
+            );
+            assert_eq!(
+                20_i32,
+                it.next().unwrap().unwrap().extract::<'_, i32>().unwrap()
+            );
+            assert!(it.next().is_none());
+        });
+    }
+
+    #[test]
+    fn iter_refcnt() {
+        let (obj, count) = Python::with_gil(|py| {
+            let obj = vec![10, 20].to_object(py);
+            let count = obj.get_refcnt(py);
+            (obj, count)
+        });
+
+        Python::with_gil(|py| {
+            let inst = obj.bind(py);
+            let mut it = inst.iter().unwrap();
+
+            assert_eq!(
+                10_i32,
+                it.next().unwrap().unwrap().extract::<'_, i32>().unwrap()
+            );
+        });
+
+        Python::with_gil(move |py| {
+            assert_eq!(count, obj.get_refcnt(py));
+        });
+    }
+
+    #[test]
+    fn iter_item_refcnt() {
+        Python::with_gil(|py| {
+            let count;
+            let obj = py.eval_bound("object()", None, None).unwrap();
+            let list = {
+                let list = PyList::empty_bound(py);
+                list.append(10).unwrap();
+                list.append(&obj).unwrap();
+                count = obj.get_refcnt();
+                list.to_object(py)
+            };
+
+            {
+                let inst = list.bind(py);
+                let mut it = inst.iter().unwrap();
+
+                assert_eq!(
+                    10_i32,
+                    it.next().unwrap().unwrap().extract::<'_, i32>().unwrap()
+                );
+                assert!(it.next().unwrap().unwrap().is(&obj));
+                assert!(it.next().is_none());
+            }
+            assert_eq!(count, obj.get_refcnt());
+        });
+    }
+
+    #[test]
+    fn fibonacci_generator() {
+        let fibonacci_generator = r#"
+def fibonacci(target):
+    a = 1
+    b = 1
+    for _ in range(target):
+        yield a
+        a, b = b, a + b
+"#;
+
+        Python::with_gil(|py| {
+            let context = PyDict::new_bound(py);
+            py.run_bound(fibonacci_generator, None, Some(&context))
+                .unwrap();
+
+            let generator = py.eval_bound("fibonacci(5)", None, Some(&context)).unwrap();
+            for (actual, expected) in generator.iter().unwrap().zip(&[1, 1, 2, 3, 5]) {
+                let actual = actual.unwrap().extract::<usize>().unwrap();
+                assert_eq!(actual, *expected)
+            }
+        });
+    }
+
+    #[test]
+    fn fibonacci_generator_bound() {
+        use crate::types::any::PyAnyMethods;
+        use crate::Bound;
+
+        let fibonacci_generator = r#"
+def fibonacci(target):
+    a = 1
+    b = 1
+    for _ in range(target):
+        yield a
+        a, b = b, a + b
+"#;
+
+        Python::with_gil(|py| {
+            let context = PyDict::new_bound(py);
+            py.run_bound(fibonacci_generator, None, Some(&context))
+                .unwrap();
+
+            let generator: Bound<'_, PyIterator> = py
+                .eval_bound("fibonacci(5)", None, Some(&context))
+                .unwrap()
+                .downcast_into()
+                .unwrap();
+            let mut items = vec![];
+            for actual in &generator {
+                let actual = actual.unwrap().extract::<usize>().unwrap();
+                items.push(actual);
+            }
+            assert_eq!(items, [1, 1, 2, 3, 5]);
+        });
+    }
+
+    #[test]
+    fn int_not_iterable() {
+        Python::with_gil(|py| {
+            let x = 5.to_object(py);
+            let err = PyIterator::from_bound_object(x.bind(py)).unwrap_err();
+
+            assert!(err.is_instance_of::<PyTypeError>(py));
+        });
+    }
+
+    #[test]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn iterator_try_from() {
+        Python::with_gil(|py| {
+            let obj: crate::Py<crate::PyAny> =
+                vec![10, 20].to_object(py).as_ref(py).iter().unwrap().into();
+            let iter = <PyIterator as crate::PyTryFrom>::try_from(obj.as_ref(py)).unwrap();
+            assert!(obj.is(iter));
+        });
+    }
+
+    #[test]
+    #[cfg(feature = "macros")]
+    fn python_class_not_iterator() {
+        use crate::PyErr;
+
+        #[crate::pyclass(crate = "crate")]
+        struct Downcaster {
+            failed: Option<PyErr>,
+        }
+
+        #[crate::pymethods(crate = "crate")]
+        impl Downcaster {
+            fn downcast_iterator(&mut self, obj: &crate::Bound<'_, crate::PyAny>) {
+                self.failed = Some(obj.downcast::<PyIterator>().unwrap_err().into());
+            }
+        }
+
+        // Regression test for 2913
+        Python::with_gil(|py| {
+            let downcaster = crate::Py::new(py, Downcaster { failed: None }).unwrap();
+            crate::py_run!(
+                py,
+                downcaster,
+                r#"
+                    from collections.abc import Sequence
+
+                    class MySequence(Sequence):
+                        def __init__(self):
+                            self._data = [1, 2, 3]
+
+                        def __getitem__(self, index):
+                            return self._data[index]
+
+                        def __len__(self):
+                            return len(self._data)
+
+                    downcaster.downcast_iterator(MySequence())
+                "#
+            );
+
+            assert_eq!(
+                downcaster.borrow_mut(py).failed.take().unwrap().to_string(),
+                "TypeError: 'MySequence' object cannot be converted to 'Iterator'"
+            );
+        });
+    }
+
+    #[test]
+    #[cfg(feature = "macros")]
+    fn python_class_iterator() {
+        #[crate::pyfunction(crate = "crate")]
+        fn assert_iterator(obj: &crate::Bound<'_, crate::PyAny>) {
+            assert!(obj.downcast::<PyIterator>().is_ok())
+        }
+
+        // Regression test for 2913
+        Python::with_gil(|py| {
+            let assert_iterator = crate::wrap_pyfunction_bound!(assert_iterator, py).unwrap();
+            crate::py_run!(
+                py,
+                assert_iterator,
+                r#"
+                    class MyIter:
+                        def __next__(self):
+                            raise StopIteration
+
+                    assert_iterator(MyIter())
+                "#
+            );
+        });
+    }
+
+    #[test]
+    #[cfg(not(Py_LIMITED_API))]
+    fn length_hint_becomes_size_hint_lower_bound() {
+        Python::with_gil(|py| {
+            let list = py.eval_bound("[1, 2, 3]", None, None).unwrap();
+            let iter = list.iter().unwrap();
+            let hint = iter.size_hint();
+            assert_eq!(hint, (3, None));
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/list.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/list.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/list.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/list.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1361 @@
+use std::iter::FusedIterator;
+
+use crate::err::{self, PyResult};
+use crate::ffi::{self, Py_ssize_t};
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::instance::Borrowed;
+use crate::internal_tricks::get_ssize_index;
+use crate::types::{PySequence, PyTuple};
+#[cfg(feature = "gil-refs")]
+use crate::PyNativeType;
+use crate::{Bound, PyAny, PyObject, Python, ToPyObject};
+
+use crate::types::any::PyAnyMethods;
+use crate::types::sequence::PySequenceMethods;
+
+/// Represents a Python `list`.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyList>`][crate::Py] or [`Bound<'py, PyList>`][Bound].
+///
+/// For APIs available on `list` objects, see the [`PyListMethods`] trait which is implemented for
+/// [`Bound<'py, PyDict>`][Bound].
+#[repr(transparent)]
+pub struct PyList(PyAny);
+
+pyobject_native_type_core!(PyList, pyobject_native_static_type_object!(ffi::PyList_Type), #checkfunction=ffi::PyList_Check);
+
+#[inline]
+#[track_caller]
+pub(crate) fn new_from_iter<'py>(
+    py: Python<'py>,
+    elements: &mut dyn ExactSizeIterator<Item = PyObject>,
+) -> Bound<'py, PyList> {
+    unsafe {
+        // PyList_New checks for overflow but has a bad error message, so we check ourselves
+        let len: Py_ssize_t = elements
+            .len()
+            .try_into()
+            .expect("out of range integral type conversion attempted on `elements.len()`");
+
+        let ptr = ffi::PyList_New(len);
+
+        // We create the `Bound` pointer here for two reasons:
+        // - panics if the ptr is null
+        // - its Drop cleans up the list if user code or the asserts panic.
+        let list = ptr.assume_owned(py).downcast_into_unchecked();
+
+        let mut counter: Py_ssize_t = 0;
+
+        for obj in elements.take(len as usize) {
+            #[cfg(not(Py_LIMITED_API))]
+            ffi::PyList_SET_ITEM(ptr, counter, obj.into_ptr());
+            #[cfg(Py_LIMITED_API)]
+            ffi::PyList_SetItem(ptr, counter, obj.into_ptr());
+            counter += 1;
+        }
+
+        assert!(elements.next().is_none(), "Attempted to create PyList but `elements` was larger than reported by its `ExactSizeIterator` implementation.");
+        assert_eq!(len, counter, "Attempted to create PyList but `elements` was smaller than reported by its `ExactSizeIterator` implementation.");
+
+        list
+    }
+}
+
+impl PyList {
+    /// Constructs a new list with the given elements.
+    ///
+    /// If you want to create a [`PyList`] with elements of different or unknown types, or from an
+    /// iterable that doesn't implement [`ExactSizeIterator`], use [`PyListMethods::append`].
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyList;
+    ///
+    /// # fn main() {
+    /// Python::with_gil(|py| {
+    ///     let elements: Vec<i32> = vec![0, 1, 2, 3, 4, 5];
+    ///     let list = PyList::new_bound(py, elements);
+    ///     assert_eq!(format!("{:?}", list), "[0, 1, 2, 3, 4, 5]");
+    /// });
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    ///
+    /// This function will panic if `element`'s [`ExactSizeIterator`] implementation is incorrect.
+    /// All standard library structures implement this trait correctly, if they do, so calling this
+    /// function with (for example) [`Vec`]`<T>` or `&[T]` will always succeed.
+    #[track_caller]
+    pub fn new_bound<T, U>(
+        py: Python<'_>,
+        elements: impl IntoIterator<Item = T, IntoIter = U>,
+    ) -> Bound<'_, PyList>
+    where
+        T: ToPyObject,
+        U: ExactSizeIterator<Item = T>,
+    {
+        let mut iter = elements.into_iter().map(|e| e.to_object(py));
+        new_from_iter(py, &mut iter)
+    }
+
+    /// Constructs a new empty list.
+    pub fn empty_bound(py: Python<'_>) -> Bound<'_, PyList> {
+        unsafe {
+            ffi::PyList_New(0)
+                .assume_owned(py)
+                .downcast_into_unchecked()
+        }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyList {
+    /// Deprecated form of [`PyList::new_bound`].
+    #[inline]
+    #[track_caller]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyList::new` will be replaced by `PyList::new_bound` in a future PyO3 version"
+    )]
+    pub fn new<T, U>(py: Python<'_>, elements: impl IntoIterator<Item = T, IntoIter = U>) -> &PyList
+    where
+        T: ToPyObject,
+        U: ExactSizeIterator<Item = T>,
+    {
+        Self::new_bound(py, elements).into_gil_ref()
+    }
+
+    /// Deprecated form of [`PyList::empty_bound`].
+    #[inline]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyList::empty` will be replaced by `PyList::empty_bound` in a future PyO3 version"
+    )]
+    pub fn empty(py: Python<'_>) -> &PyList {
+        Self::empty_bound(py).into_gil_ref()
+    }
+
+    /// Returns the length of the list.
+    pub fn len(&self) -> usize {
+        self.as_borrowed().len()
+    }
+
+    /// Checks if the list is empty.
+    pub fn is_empty(&self) -> bool {
+        self.as_borrowed().is_empty()
+    }
+
+    /// Returns `self` cast as a `PySequence`.
+    pub fn as_sequence(&self) -> &PySequence {
+        unsafe { self.downcast_unchecked() }
+    }
+
+    /// Gets the list item at the specified index.
+    /// # Example
+    /// ```
+    /// use pyo3::{prelude::*, types::PyList};
+    /// Python::with_gil(|py| {
+    ///     let list = PyList::new_bound(py, [2, 3, 5, 7]);
+    ///     let obj = list.get_item(0);
+    ///     assert_eq!(obj.unwrap().extract::<i32>().unwrap(), 2);
+    /// });
+    /// ```
+    pub fn get_item(&self, index: usize) -> PyResult<&PyAny> {
+        self.as_borrowed().get_item(index).map(Bound::into_gil_ref)
+    }
+
+    /// Gets the list item at the specified index. Undefined behavior on bad index. Use with caution.
+    ///
+    /// # Safety
+    ///
+    /// Caller must verify that the index is within the bounds of the list.
+    #[cfg(not(Py_LIMITED_API))]
+    pub unsafe fn get_item_unchecked(&self, index: usize) -> &PyAny {
+        self.as_borrowed().get_item_unchecked(index).into_gil_ref()
+    }
+
+    /// Takes the slice `self[low:high]` and returns it as a new list.
+    ///
+    /// Indices must be nonnegative, and out-of-range indices are clipped to
+    /// `self.len()`.
+    pub fn get_slice(&self, low: usize, high: usize) -> &PyList {
+        self.as_borrowed().get_slice(low, high).into_gil_ref()
+    }
+
+    /// Sets the item at the specified index.
+    ///
+    /// Raises `IndexError` if the index is out of range.
+    pub fn set_item<I>(&self, index: usize, item: I) -> PyResult<()>
+    where
+        I: ToPyObject,
+    {
+        self.as_borrowed().set_item(index, item)
+    }
+
+    /// Deletes the `index`th element of self.
+    ///
+    /// This is equivalent to the Python statement `del self[i]`.
+    #[inline]
+    pub fn del_item(&self, index: usize) -> PyResult<()> {
+        self.as_borrowed().del_item(index)
+    }
+
+    /// Assigns the sequence `seq` to the slice of `self` from `low` to `high`.
+    ///
+    /// This is equivalent to the Python statement `self[low:high] = v`.
+    #[inline]
+    pub fn set_slice(&self, low: usize, high: usize, seq: &PyAny) -> PyResult<()> {
+        self.as_borrowed().set_slice(low, high, &seq.as_borrowed())
+    }
+
+    /// Deletes the slice from `low` to `high` from `self`.
+    ///
+    /// This is equivalent to the Python statement `del self[low:high]`.
+    #[inline]
+    pub fn del_slice(&self, low: usize, high: usize) -> PyResult<()> {
+        self.as_borrowed().del_slice(low, high)
+    }
+
+    /// Appends an item to the list.
+    pub fn append<I>(&self, item: I) -> PyResult<()>
+    where
+        I: ToPyObject,
+    {
+        self.as_borrowed().append(item)
+    }
+
+    /// Inserts an item at the specified index.
+    ///
+    /// If `index >= self.len()`, inserts at the end.
+    pub fn insert<I>(&self, index: usize, item: I) -> PyResult<()>
+    where
+        I: ToPyObject,
+    {
+        self.as_borrowed().insert(index, item)
+    }
+
+    /// Determines if self contains `value`.
+    ///
+    /// This is equivalent to the Python expression `value in self`.
+    #[inline]
+    pub fn contains<V>(&self, value: V) -> PyResult<bool>
+    where
+        V: ToPyObject,
+    {
+        self.as_borrowed().contains(value)
+    }
+
+    /// Returns the first index `i` for which `self[i] == value`.
+    ///
+    /// This is equivalent to the Python expression `self.index(value)`.
+    #[inline]
+    pub fn index<V>(&self, value: V) -> PyResult<usize>
+    where
+        V: ToPyObject,
+    {
+        self.as_borrowed().index(value)
+    }
+
+    /// Returns an iterator over this list's items.
+    pub fn iter(&self) -> PyListIterator<'_> {
+        PyListIterator(self.as_borrowed().iter())
+    }
+
+    /// Sorts the list in-place. Equivalent to the Python expression `l.sort()`.
+    pub fn sort(&self) -> PyResult<()> {
+        self.as_borrowed().sort()
+    }
+
+    /// Reverses the list in-place. Equivalent to the Python expression `l.reverse()`.
+    pub fn reverse(&self) -> PyResult<()> {
+        self.as_borrowed().reverse()
+    }
+
+    /// Return a new tuple containing the contents of the list; equivalent to the Python expression `tuple(list)`.
+    ///
+    /// This method is equivalent to `self.as_sequence().to_tuple()` and faster than `PyTuple::new(py, this_list)`.
+    pub fn to_tuple(&self) -> &PyTuple {
+        self.as_borrowed().to_tuple().into_gil_ref()
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+index_impls!(PyList, "list", PyList::len, PyList::get_slice);
+
+/// Implementation of functionality for [`PyList`].
+///
+/// These methods are defined for the `Bound<'py, PyList>` smart pointer, so to use method call
+/// syntax these methods are separated into a trait, because stable Rust does not yet support
+/// `arbitrary_self_types`.
+#[doc(alias = "PyList")]
+pub trait PyListMethods<'py>: crate::sealed::Sealed {
+    /// Returns the length of the list.
+    fn len(&self) -> usize;
+
+    /// Checks if the list is empty.
+    fn is_empty(&self) -> bool;
+
+    /// Returns `self` cast as a `PySequence`.
+    fn as_sequence(&self) -> &Bound<'py, PySequence>;
+
+    /// Returns `self` cast as a `PySequence`.
+    fn into_sequence(self) -> Bound<'py, PySequence>;
+
+    /// Gets the list item at the specified index.
+    /// # Example
+    /// ```
+    /// use pyo3::{prelude::*, types::PyList};
+    /// Python::with_gil(|py| {
+    ///     let list = PyList::new_bound(py, [2, 3, 5, 7]);
+    ///     let obj = list.get_item(0);
+    ///     assert_eq!(obj.unwrap().extract::<i32>().unwrap(), 2);
+    /// });
+    /// ```
+    fn get_item(&self, index: usize) -> PyResult<Bound<'py, PyAny>>;
+
+    /// Gets the list item at the specified index. Undefined behavior on bad index. Use with caution.
+    ///
+    /// # Safety
+    ///
+    /// Caller must verify that the index is within the bounds of the list.
+    #[cfg(not(Py_LIMITED_API))]
+    unsafe fn get_item_unchecked(&self, index: usize) -> Bound<'py, PyAny>;
+
+    /// Takes the slice `self[low:high]` and returns it as a new list.
+    ///
+    /// Indices must be nonnegative, and out-of-range indices are clipped to
+    /// `self.len()`.
+    fn get_slice(&self, low: usize, high: usize) -> Bound<'py, PyList>;
+
+    /// Sets the item at the specified index.
+    ///
+    /// Raises `IndexError` if the index is out of range.
+    fn set_item<I>(&self, index: usize, item: I) -> PyResult<()>
+    where
+        I: ToPyObject;
+
+    /// Deletes the `index`th element of self.
+    ///
+    /// This is equivalent to the Python statement `del self[i]`.
+    fn del_item(&self, index: usize) -> PyResult<()>;
+
+    /// Assigns the sequence `seq` to the slice of `self` from `low` to `high`.
+    ///
+    /// This is equivalent to the Python statement `self[low:high] = v`.
+    fn set_slice(&self, low: usize, high: usize, seq: &Bound<'_, PyAny>) -> PyResult<()>;
+
+    /// Deletes the slice from `low` to `high` from `self`.
+    ///
+    /// This is equivalent to the Python statement `del self[low:high]`.
+    fn del_slice(&self, low: usize, high: usize) -> PyResult<()>;
+
+    /// Appends an item to the list.
+    fn append<I>(&self, item: I) -> PyResult<()>
+    where
+        I: ToPyObject;
+
+    /// Inserts an item at the specified index.
+    ///
+    /// If `index >= self.len()`, inserts at the end.
+    fn insert<I>(&self, index: usize, item: I) -> PyResult<()>
+    where
+        I: ToPyObject;
+
+    /// Determines if self contains `value`.
+    ///
+    /// This is equivalent to the Python expression `value in self`.
+    fn contains<V>(&self, value: V) -> PyResult<bool>
+    where
+        V: ToPyObject;
+
+    /// Returns the first index `i` for which `self[i] == value`.
+    ///
+    /// This is equivalent to the Python expression `self.index(value)`.
+    fn index<V>(&self, value: V) -> PyResult<usize>
+    where
+        V: ToPyObject;
+
+    /// Returns an iterator over this list's items.
+    fn iter(&self) -> BoundListIterator<'py>;
+
+    /// Sorts the list in-place. Equivalent to the Python expression `l.sort()`.
+    fn sort(&self) -> PyResult<()>;
+
+    /// Reverses the list in-place. Equivalent to the Python expression `l.reverse()`.
+    fn reverse(&self) -> PyResult<()>;
+
+    /// Return a new tuple containing the contents of the list; equivalent to the Python expression `tuple(list)`.
+    ///
+    /// This method is equivalent to `self.as_sequence().to_tuple()` and faster than `PyTuple::new(py, this_list)`.
+    fn to_tuple(&self) -> Bound<'py, PyTuple>;
+}
+
+impl<'py> PyListMethods<'py> for Bound<'py, PyList> {
+    /// Returns the length of the list.
+    fn len(&self) -> usize {
+        unsafe {
+            #[cfg(not(Py_LIMITED_API))]
+            let size = ffi::PyList_GET_SIZE(self.as_ptr());
+            #[cfg(Py_LIMITED_API)]
+            let size = ffi::PyList_Size(self.as_ptr());
+
+            // non-negative Py_ssize_t should always fit into Rust usize
+            size as usize
+        }
+    }
+
+    /// Checks if the list is empty.
+    fn is_empty(&self) -> bool {
+        self.len() == 0
+    }
+
+    /// Returns `self` cast as a `PySequence`.
+    fn as_sequence(&self) -> &Bound<'py, PySequence> {
+        unsafe { self.downcast_unchecked() }
+    }
+
+    /// Returns `self` cast as a `PySequence`.
+    fn into_sequence(self) -> Bound<'py, PySequence> {
+        unsafe { self.into_any().downcast_into_unchecked() }
+    }
+
+    /// Gets the list item at the specified index.
+    /// # Example
+    /// ```
+    /// use pyo3::{prelude::*, types::PyList};
+    /// Python::with_gil(|py| {
+    ///     let list = PyList::new_bound(py, [2, 3, 5, 7]);
+    ///     let obj = list.get_item(0);
+    ///     assert_eq!(obj.unwrap().extract::<i32>().unwrap(), 2);
+    /// });
+    /// ```
+    fn get_item(&self, index: usize) -> PyResult<Bound<'py, PyAny>> {
+        unsafe {
+            // PyList_GetItem return borrowed ptr; must make owned for safety (see #890).
+            ffi::PyList_GetItem(self.as_ptr(), index as Py_ssize_t)
+                .assume_borrowed_or_err(self.py())
+                .map(Borrowed::to_owned)
+        }
+    }
+
+    /// Gets the list item at the specified index. Undefined behavior on bad index. Use with caution.
+    ///
+    /// # Safety
+    ///
+    /// Caller must verify that the index is within the bounds of the list.
+    #[cfg(not(Py_LIMITED_API))]
+    unsafe fn get_item_unchecked(&self, index: usize) -> Bound<'py, PyAny> {
+        // PyList_GET_ITEM return borrowed ptr; must make owned for safety (see #890).
+        ffi::PyList_GET_ITEM(self.as_ptr(), index as Py_ssize_t)
+            .assume_borrowed(self.py())
+            .to_owned()
+    }
+
+    /// Takes the slice `self[low:high]` and returns it as a new list.
+    ///
+    /// Indices must be nonnegative, and out-of-range indices are clipped to
+    /// `self.len()`.
+    fn get_slice(&self, low: usize, high: usize) -> Bound<'py, PyList> {
+        unsafe {
+            ffi::PyList_GetSlice(self.as_ptr(), get_ssize_index(low), get_ssize_index(high))
+                .assume_owned(self.py())
+                .downcast_into_unchecked()
+        }
+    }
+
+    /// Sets the item at the specified index.
+    ///
+    /// Raises `IndexError` if the index is out of range.
+    fn set_item<I>(&self, index: usize, item: I) -> PyResult<()>
+    where
+        I: ToPyObject,
+    {
+        fn inner(list: &Bound<'_, PyList>, index: usize, item: Bound<'_, PyAny>) -> PyResult<()> {
+            err::error_on_minusone(list.py(), unsafe {
+                ffi::PyList_SetItem(list.as_ptr(), get_ssize_index(index), item.into_ptr())
+            })
+        }
+
+        let py = self.py();
+        inner(self, index, item.to_object(py).into_bound(py))
+    }
+
+    /// Deletes the `index`th element of self.
+    ///
+    /// This is equivalent to the Python statement `del self[i]`.
+    #[inline]
+    fn del_item(&self, index: usize) -> PyResult<()> {
+        self.as_sequence().del_item(index)
+    }
+
+    /// Assigns the sequence `seq` to the slice of `self` from `low` to `high`.
+    ///
+    /// This is equivalent to the Python statement `self[low:high] = v`.
+    #[inline]
+    fn set_slice(&self, low: usize, high: usize, seq: &Bound<'_, PyAny>) -> PyResult<()> {
+        err::error_on_minusone(self.py(), unsafe {
+            ffi::PyList_SetSlice(
+                self.as_ptr(),
+                get_ssize_index(low),
+                get_ssize_index(high),
+                seq.as_ptr(),
+            )
+        })
+    }
+
+    /// Deletes the slice from `low` to `high` from `self`.
+    ///
+    /// This is equivalent to the Python statement `del self[low:high]`.
+    #[inline]
+    fn del_slice(&self, low: usize, high: usize) -> PyResult<()> {
+        self.as_sequence().del_slice(low, high)
+    }
+
+    /// Appends an item to the list.
+    fn append<I>(&self, item: I) -> PyResult<()>
+    where
+        I: ToPyObject,
+    {
+        fn inner(list: &Bound<'_, PyList>, item: Bound<'_, PyAny>) -> PyResult<()> {
+            err::error_on_minusone(list.py(), unsafe {
+                ffi::PyList_Append(list.as_ptr(), item.as_ptr())
+            })
+        }
+
+        let py = self.py();
+        inner(self, item.to_object(py).into_bound(py))
+    }
+
+    /// Inserts an item at the specified index.
+    ///
+    /// If `index >= self.len()`, inserts at the end.
+    fn insert<I>(&self, index: usize, item: I) -> PyResult<()>
+    where
+        I: ToPyObject,
+    {
+        fn inner(list: &Bound<'_, PyList>, index: usize, item: Bound<'_, PyAny>) -> PyResult<()> {
+            err::error_on_minusone(list.py(), unsafe {
+                ffi::PyList_Insert(list.as_ptr(), get_ssize_index(index), item.as_ptr())
+            })
+        }
+
+        let py = self.py();
+        inner(self, index, item.to_object(py).into_bound(py))
+    }
+
+    /// Determines if self contains `value`.
+    ///
+    /// This is equivalent to the Python expression `value in self`.
+    #[inline]
+    fn contains<V>(&self, value: V) -> PyResult<bool>
+    where
+        V: ToPyObject,
+    {
+        self.as_sequence().contains(value)
+    }
+
+    /// Returns the first index `i` for which `self[i] == value`.
+    ///
+    /// This is equivalent to the Python expression `self.index(value)`.
+    #[inline]
+    fn index<V>(&self, value: V) -> PyResult<usize>
+    where
+        V: ToPyObject,
+    {
+        self.as_sequence().index(value)
+    }
+
+    /// Returns an iterator over this list's items.
+    fn iter(&self) -> BoundListIterator<'py> {
+        BoundListIterator::new(self.clone())
+    }
+
+    /// Sorts the list in-place. Equivalent to the Python expression `l.sort()`.
+    fn sort(&self) -> PyResult<()> {
+        err::error_on_minusone(self.py(), unsafe { ffi::PyList_Sort(self.as_ptr()) })
+    }
+
+    /// Reverses the list in-place. Equivalent to the Python expression `l.reverse()`.
+    fn reverse(&self) -> PyResult<()> {
+        err::error_on_minusone(self.py(), unsafe { ffi::PyList_Reverse(self.as_ptr()) })
+    }
+
+    /// Return a new tuple containing the contents of the list; equivalent to the Python expression `tuple(list)`.
+    ///
+    /// This method is equivalent to `self.as_sequence().to_tuple()` and faster than `PyTuple::new(py, this_list)`.
+    fn to_tuple(&self) -> Bound<'py, PyTuple> {
+        unsafe {
+            ffi::PyList_AsTuple(self.as_ptr())
+                .assume_owned(self.py())
+                .downcast_into_unchecked()
+        }
+    }
+}
+
+/// Used by `PyList::iter()`.
+#[cfg(feature = "gil-refs")]
+pub struct PyListIterator<'a>(BoundListIterator<'a>);
+
+#[cfg(feature = "gil-refs")]
+impl<'a> Iterator for PyListIterator<'a> {
+    type Item = &'a PyAny;
+
+    #[inline]
+    fn next(&mut self) -> Option<Self::Item> {
+        self.0.next().map(Bound::into_gil_ref)
+    }
+
+    #[inline]
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        self.0.size_hint()
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'a> DoubleEndedIterator for PyListIterator<'a> {
+    #[inline]
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.0.next_back().map(Bound::into_gil_ref)
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'a> ExactSizeIterator for PyListIterator<'a> {
+    fn len(&self) -> usize {
+        self.0.len()
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl FusedIterator for PyListIterator<'_> {}
+
+#[cfg(feature = "gil-refs")]
+impl<'a> IntoIterator for &'a PyList {
+    type Item = &'a PyAny;
+    type IntoIter = PyListIterator<'a>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        self.iter()
+    }
+}
+
+/// Used by `PyList::iter()`.
+pub struct BoundListIterator<'py> {
+    list: Bound<'py, PyList>,
+    index: usize,
+    length: usize,
+}
+
+impl<'py> BoundListIterator<'py> {
+    fn new(list: Bound<'py, PyList>) -> Self {
+        let length: usize = list.len();
+        BoundListIterator {
+            list,
+            index: 0,
+            length,
+        }
+    }
+
+    unsafe fn get_item(&self, index: usize) -> Bound<'py, PyAny> {
+        #[cfg(any(Py_LIMITED_API, PyPy))]
+        let item = self.list.get_item(index).expect("list.get failed");
+        #[cfg(not(any(Py_LIMITED_API, PyPy)))]
+        let item = self.list.get_item_unchecked(index);
+        item
+    }
+}
+
+impl<'py> Iterator for BoundListIterator<'py> {
+    type Item = Bound<'py, PyAny>;
+
+    #[inline]
+    fn next(&mut self) -> Option<Self::Item> {
+        let length = self.length.min(self.list.len());
+
+        if self.index < length {
+            let item = unsafe { self.get_item(self.index) };
+            self.index += 1;
+            Some(item)
+        } else {
+            None
+        }
+    }
+
+    #[inline]
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        let len = self.len();
+        (len, Some(len))
+    }
+}
+
+impl DoubleEndedIterator for BoundListIterator<'_> {
+    #[inline]
+    fn next_back(&mut self) -> Option<Self::Item> {
+        let length = self.length.min(self.list.len());
+
+        if self.index < length {
+            let item = unsafe { self.get_item(length - 1) };
+            self.length = length - 1;
+            Some(item)
+        } else {
+            None
+        }
+    }
+}
+
+impl ExactSizeIterator for BoundListIterator<'_> {
+    fn len(&self) -> usize {
+        self.length.saturating_sub(self.index)
+    }
+}
+
+impl FusedIterator for BoundListIterator<'_> {}
+
+impl<'py> IntoIterator for Bound<'py, PyList> {
+    type Item = Bound<'py, PyAny>;
+    type IntoIter = BoundListIterator<'py>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        BoundListIterator::new(self)
+    }
+}
+
+impl<'py> IntoIterator for &Bound<'py, PyList> {
+    type Item = Bound<'py, PyAny>;
+    type IntoIter = BoundListIterator<'py>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        self.iter()
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::types::any::PyAnyMethods;
+    use crate::types::list::PyListMethods;
+    use crate::types::sequence::PySequenceMethods;
+    use crate::types::{PyList, PyTuple};
+    use crate::Python;
+    use crate::{IntoPy, PyObject, ToPyObject};
+
+    #[test]
+    fn test_new() {
+        Python::with_gil(|py| {
+            let list = PyList::new_bound(py, [2, 3, 5, 7]);
+            assert_eq!(2, list.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert_eq!(3, list.get_item(1).unwrap().extract::<i32>().unwrap());
+            assert_eq!(5, list.get_item(2).unwrap().extract::<i32>().unwrap());
+            assert_eq!(7, list.get_item(3).unwrap().extract::<i32>().unwrap());
+        });
+    }
+
+    #[test]
+    fn test_len() {
+        Python::with_gil(|py| {
+            let list = PyList::new_bound(py, [1, 2, 3, 4]);
+            assert_eq!(4, list.len());
+        });
+    }
+
+    #[test]
+    fn test_get_item() {
+        Python::with_gil(|py| {
+            let list = PyList::new_bound(py, [2, 3, 5, 7]);
+            assert_eq!(2, list.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert_eq!(3, list.get_item(1).unwrap().extract::<i32>().unwrap());
+            assert_eq!(5, list.get_item(2).unwrap().extract::<i32>().unwrap());
+            assert_eq!(7, list.get_item(3).unwrap().extract::<i32>().unwrap());
+        });
+    }
+
+    #[test]
+    fn test_get_slice() {
+        Python::with_gil(|py| {
+            let list = PyList::new_bound(py, [2, 3, 5, 7]);
+            let slice = list.get_slice(1, 3);
+            assert_eq!(2, slice.len());
+            let slice = list.get_slice(1, 7);
+            assert_eq!(3, slice.len());
+        });
+    }
+
+    #[test]
+    fn test_set_item() {
+        Python::with_gil(|py| {
+            let list = PyList::new_bound(py, [2, 3, 5, 7]);
+            let val = 42i32.to_object(py);
+            let val2 = 42i32.to_object(py);
+            assert_eq!(2, list.get_item(0).unwrap().extract::<i32>().unwrap());
+            list.set_item(0, val).unwrap();
+            assert_eq!(42, list.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert!(list.set_item(10, val2).is_err());
+        });
+    }
+
+    #[test]
+    fn test_set_item_refcnt() {
+        Python::with_gil(|py| {
+            let obj = py.eval_bound("object()", None, None).unwrap();
+            let cnt;
+            {
+                let v = vec![2];
+                let ob = v.to_object(py);
+                let list = ob.downcast_bound::<PyList>(py).unwrap();
+                cnt = obj.get_refcnt();
+                list.set_item(0, &obj).unwrap();
+            }
+
+            assert_eq!(cnt, obj.get_refcnt());
+        });
+    }
+
+    #[test]
+    fn test_insert() {
+        Python::with_gil(|py| {
+            let list = PyList::new_bound(py, [2, 3, 5, 7]);
+            let val = 42i32.to_object(py);
+            let val2 = 43i32.to_object(py);
+            assert_eq!(4, list.len());
+            assert_eq!(2, list.get_item(0).unwrap().extract::<i32>().unwrap());
+            list.insert(0, val).unwrap();
+            list.insert(1000, val2).unwrap();
+            assert_eq!(6, list.len());
+            assert_eq!(42, list.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert_eq!(2, list.get_item(1).unwrap().extract::<i32>().unwrap());
+            assert_eq!(43, list.get_item(5).unwrap().extract::<i32>().unwrap());
+        });
+    }
+
+    #[test]
+    fn test_insert_refcnt() {
+        Python::with_gil(|py| {
+            let cnt;
+            let obj = py.eval_bound("object()", None, None).unwrap();
+            {
+                let list = PyList::empty_bound(py);
+                cnt = obj.get_refcnt();
+                list.insert(0, &obj).unwrap();
+            }
+
+            assert_eq!(cnt, obj.get_refcnt());
+        });
+    }
+
+    #[test]
+    fn test_append() {
+        Python::with_gil(|py| {
+            let list = PyList::new_bound(py, [2]);
+            list.append(3).unwrap();
+            assert_eq!(2, list.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert_eq!(3, list.get_item(1).unwrap().extract::<i32>().unwrap());
+        });
+    }
+
+    #[test]
+    fn test_append_refcnt() {
+        Python::with_gil(|py| {
+            let cnt;
+            let obj = py.eval_bound("object()", None, None).unwrap();
+            {
+                let list = PyList::empty_bound(py);
+                cnt = obj.get_refcnt();
+                list.append(&obj).unwrap();
+            }
+            assert_eq!(cnt, obj.get_refcnt());
+        });
+    }
+
+    #[test]
+    fn test_iter() {
+        Python::with_gil(|py| {
+            let v = vec![2, 3, 5, 7];
+            let list = PyList::new_bound(py, &v);
+            let mut idx = 0;
+            for el in list {
+                assert_eq!(v[idx], el.extract::<i32>().unwrap());
+                idx += 1;
+            }
+            assert_eq!(idx, v.len());
+        });
+    }
+
+    #[test]
+    fn test_iter_size_hint() {
+        Python::with_gil(|py| {
+            let v = vec![2, 3, 5, 7];
+            let ob = v.to_object(py);
+            let list = ob.downcast_bound::<PyList>(py).unwrap();
+
+            let mut iter = list.iter();
+            assert_eq!(iter.size_hint(), (v.len(), Some(v.len())));
+            iter.next();
+            assert_eq!(iter.size_hint(), (v.len() - 1, Some(v.len() - 1)));
+
+            // Exhaust iterator.
+            for _ in &mut iter {}
+
+            assert_eq!(iter.size_hint(), (0, Some(0)));
+        });
+    }
+
+    #[test]
+    fn test_iter_rev() {
+        Python::with_gil(|py| {
+            let v = vec![2, 3, 5, 7];
+            let ob = v.to_object(py);
+            let list = ob.downcast_bound::<PyList>(py).unwrap();
+
+            let mut iter = list.iter().rev();
+
+            assert_eq!(iter.size_hint(), (4, Some(4)));
+
+            assert_eq!(iter.next().unwrap().extract::<i32>().unwrap(), 7);
+            assert_eq!(iter.size_hint(), (3, Some(3)));
+
+            assert_eq!(iter.next().unwrap().extract::<i32>().unwrap(), 5);
+            assert_eq!(iter.size_hint(), (2, Some(2)));
+
+            assert_eq!(iter.next().unwrap().extract::<i32>().unwrap(), 3);
+            assert_eq!(iter.size_hint(), (1, Some(1)));
+
+            assert_eq!(iter.next().unwrap().extract::<i32>().unwrap(), 2);
+            assert_eq!(iter.size_hint(), (0, Some(0)));
+
+            assert!(iter.next().is_none());
+            assert!(iter.next().is_none());
+        });
+    }
+
+    #[test]
+    fn test_into_iter() {
+        Python::with_gil(|py| {
+            let list = PyList::new_bound(py, [1, 2, 3, 4]);
+            for (i, item) in list.iter().enumerate() {
+                assert_eq!((i + 1) as i32, item.extract::<i32>().unwrap());
+            }
+        });
+    }
+
+    #[test]
+    fn test_into_iter_bound() {
+        use crate::types::any::PyAnyMethods;
+
+        Python::with_gil(|py| {
+            let list = PyList::new_bound(py, [1, 2, 3, 4]);
+            let mut items = vec![];
+            for item in &list {
+                items.push(item.extract::<i32>().unwrap());
+            }
+            assert_eq!(items, vec![1, 2, 3, 4]);
+        });
+    }
+
+    #[test]
+    fn test_as_sequence() {
+        Python::with_gil(|py| {
+            let list = PyList::new_bound(py, [1, 2, 3, 4]);
+
+            assert_eq!(list.as_sequence().len().unwrap(), 4);
+            assert_eq!(
+                list.as_sequence()
+                    .get_item(1)
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                2
+            );
+        });
+    }
+
+    #[test]
+    fn test_into_sequence() {
+        Python::with_gil(|py| {
+            let list = PyList::new_bound(py, [1, 2, 3, 4]);
+
+            let sequence = list.into_sequence();
+
+            assert_eq!(sequence.len().unwrap(), 4);
+            assert_eq!(sequence.get_item(1).unwrap().extract::<i32>().unwrap(), 2);
+        });
+    }
+
+    #[test]
+    fn test_extract() {
+        Python::with_gil(|py| {
+            let v = vec![2, 3, 5, 7];
+            let list = PyList::new_bound(py, &v);
+            let v2 = list.as_ref().extract::<Vec<i32>>().unwrap();
+            assert_eq!(v, v2);
+        });
+    }
+
+    #[test]
+    fn test_sort() {
+        Python::with_gil(|py| {
+            let v = vec![7, 3, 2, 5];
+            let list = PyList::new_bound(py, &v);
+            assert_eq!(7, list.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert_eq!(3, list.get_item(1).unwrap().extract::<i32>().unwrap());
+            assert_eq!(2, list.get_item(2).unwrap().extract::<i32>().unwrap());
+            assert_eq!(5, list.get_item(3).unwrap().extract::<i32>().unwrap());
+            list.sort().unwrap();
+            assert_eq!(2, list.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert_eq!(3, list.get_item(1).unwrap().extract::<i32>().unwrap());
+            assert_eq!(5, list.get_item(2).unwrap().extract::<i32>().unwrap());
+            assert_eq!(7, list.get_item(3).unwrap().extract::<i32>().unwrap());
+        });
+    }
+
+    #[test]
+    fn test_reverse() {
+        Python::with_gil(|py| {
+            let v = vec![2, 3, 5, 7];
+            let list = PyList::new_bound(py, &v);
+            assert_eq!(2, list.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert_eq!(3, list.get_item(1).unwrap().extract::<i32>().unwrap());
+            assert_eq!(5, list.get_item(2).unwrap().extract::<i32>().unwrap());
+            assert_eq!(7, list.get_item(3).unwrap().extract::<i32>().unwrap());
+            list.reverse().unwrap();
+            assert_eq!(7, list.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert_eq!(5, list.get_item(1).unwrap().extract::<i32>().unwrap());
+            assert_eq!(3, list.get_item(2).unwrap().extract::<i32>().unwrap());
+            assert_eq!(2, list.get_item(3).unwrap().extract::<i32>().unwrap());
+        });
+    }
+
+    #[test]
+    fn test_array_into_py() {
+        Python::with_gil(|py| {
+            let array: PyObject = [1, 2].into_py(py);
+            let list = array.downcast_bound::<PyList>(py).unwrap();
+            assert_eq!(1, list.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert_eq!(2, list.get_item(1).unwrap().extract::<i32>().unwrap());
+        });
+    }
+
+    #[test]
+    fn test_list_get_item_invalid_index() {
+        Python::with_gil(|py| {
+            let list = PyList::new_bound(py, [2, 3, 5, 7]);
+            let obj = list.get_item(5);
+            assert!(obj.is_err());
+            assert_eq!(
+                obj.unwrap_err().to_string(),
+                "IndexError: list index out of range"
+            );
+        });
+    }
+
+    #[test]
+    fn test_list_get_item_sanity() {
+        Python::with_gil(|py| {
+            let list = PyList::new_bound(py, [2, 3, 5, 7]);
+            let obj = list.get_item(0);
+            assert_eq!(obj.unwrap().extract::<i32>().unwrap(), 2);
+        });
+    }
+
+    #[cfg(not(any(Py_LIMITED_API, PyPy)))]
+    #[test]
+    fn test_list_get_item_unchecked_sanity() {
+        Python::with_gil(|py| {
+            let list = PyList::new_bound(py, [2, 3, 5, 7]);
+            let obj = unsafe { list.get_item_unchecked(0) };
+            assert_eq!(obj.extract::<i32>().unwrap(), 2);
+        });
+    }
+
+    #[test]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_list_index_trait() {
+        Python::with_gil(|py| {
+            let list = PyList::new(py, [2, 3, 5]);
+            assert_eq!(2, list[0].extract::<i32>().unwrap());
+            assert_eq!(3, list[1].extract::<i32>().unwrap());
+            assert_eq!(5, list[2].extract::<i32>().unwrap());
+        });
+    }
+
+    #[test]
+    #[should_panic]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_list_index_trait_panic() {
+        Python::with_gil(|py| {
+            let list = PyList::new(py, [2, 3, 5]);
+            let _ = &list[7];
+        });
+    }
+
+    #[test]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_list_index_trait_ranges() {
+        Python::with_gil(|py| {
+            let list = PyList::new(py, [2, 3, 5]);
+            assert_eq!(vec![3, 5], list[1..3].extract::<Vec<i32>>().unwrap());
+            assert_eq!(Vec::<i32>::new(), list[3..3].extract::<Vec<i32>>().unwrap());
+            assert_eq!(vec![3, 5], list[1..].extract::<Vec<i32>>().unwrap());
+            assert_eq!(Vec::<i32>::new(), list[3..].extract::<Vec<i32>>().unwrap());
+            assert_eq!(vec![2, 3, 5], list[..].extract::<Vec<i32>>().unwrap());
+            assert_eq!(vec![3, 5], list[1..=2].extract::<Vec<i32>>().unwrap());
+            assert_eq!(vec![2, 3], list[..2].extract::<Vec<i32>>().unwrap());
+            assert_eq!(vec![2, 3], list[..=1].extract::<Vec<i32>>().unwrap());
+        })
+    }
+
+    #[test]
+    #[should_panic = "range start index 5 out of range for list of length 3"]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_list_index_trait_range_panic_start() {
+        Python::with_gil(|py| {
+            let list = PyList::new(py, [2, 3, 5]);
+            list[5..10].extract::<Vec<i32>>().unwrap();
+        })
+    }
+
+    #[test]
+    #[should_panic = "range end index 10 out of range for list of length 3"]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_list_index_trait_range_panic_end() {
+        Python::with_gil(|py| {
+            let list = PyList::new(py, [2, 3, 5]);
+            list[1..10].extract::<Vec<i32>>().unwrap();
+        })
+    }
+
+    #[test]
+    #[should_panic = "slice index starts at 2 but ends at 1"]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_list_index_trait_range_panic_wrong_order() {
+        Python::with_gil(|py| {
+            let list = PyList::new(py, [2, 3, 5]);
+            #[allow(clippy::reversed_empty_ranges)]
+            list[2..1].extract::<Vec<i32>>().unwrap();
+        })
+    }
+
+    #[test]
+    #[should_panic = "range start index 8 out of range for list of length 3"]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_list_index_trait_range_from_panic() {
+        Python::with_gil(|py| {
+            let list = PyList::new(py, [2, 3, 5]);
+            list[8..].extract::<Vec<i32>>().unwrap();
+        })
+    }
+
+    #[test]
+    fn test_list_del_item() {
+        Python::with_gil(|py| {
+            let list = PyList::new_bound(py, [1, 1, 2, 3, 5, 8]);
+            assert!(list.del_item(10).is_err());
+            assert_eq!(1, list.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert!(list.del_item(0).is_ok());
+            assert_eq!(1, list.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert!(list.del_item(0).is_ok());
+            assert_eq!(2, list.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert!(list.del_item(0).is_ok());
+            assert_eq!(3, list.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert!(list.del_item(0).is_ok());
+            assert_eq!(5, list.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert!(list.del_item(0).is_ok());
+            assert_eq!(8, list.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert!(list.del_item(0).is_ok());
+            assert_eq!(0, list.len());
+            assert!(list.del_item(0).is_err());
+        });
+    }
+
+    #[test]
+    fn test_list_set_slice() {
+        Python::with_gil(|py| {
+            let list = PyList::new_bound(py, [1, 1, 2, 3, 5, 8]);
+            let ins = PyList::new_bound(py, [7, 4]);
+            list.set_slice(1, 4, &ins).unwrap();
+            assert_eq!([1, 7, 4, 5, 8], list.extract::<[i32; 5]>().unwrap());
+            list.set_slice(3, 100, &PyList::empty_bound(py)).unwrap();
+            assert_eq!([1, 7, 4], list.extract::<[i32; 3]>().unwrap());
+        });
+    }
+
+    #[test]
+    fn test_list_del_slice() {
+        Python::with_gil(|py| {
+            let list = PyList::new_bound(py, [1, 1, 2, 3, 5, 8]);
+            list.del_slice(1, 4).unwrap();
+            assert_eq!([1, 5, 8], list.extract::<[i32; 3]>().unwrap());
+            list.del_slice(1, 100).unwrap();
+            assert_eq!([1], list.extract::<[i32; 1]>().unwrap());
+        });
+    }
+
+    #[test]
+    fn test_list_contains() {
+        Python::with_gil(|py| {
+            let list = PyList::new_bound(py, [1, 1, 2, 3, 5, 8]);
+            assert_eq!(6, list.len());
+
+            let bad_needle = 7i32.to_object(py);
+            assert!(!list.contains(&bad_needle).unwrap());
+
+            let good_needle = 8i32.to_object(py);
+            assert!(list.contains(&good_needle).unwrap());
+
+            let type_coerced_needle = 8f32.to_object(py);
+            assert!(list.contains(&type_coerced_needle).unwrap());
+        });
+    }
+
+    #[test]
+    fn test_list_index() {
+        Python::with_gil(|py| {
+            let list = PyList::new_bound(py, [1, 1, 2, 3, 5, 8]);
+            assert_eq!(0, list.index(1i32).unwrap());
+            assert_eq!(2, list.index(2i32).unwrap());
+            assert_eq!(3, list.index(3i32).unwrap());
+            assert_eq!(4, list.index(5i32).unwrap());
+            assert_eq!(5, list.index(8i32).unwrap());
+            assert!(list.index(42i32).is_err());
+        });
+    }
+
+    use std::ops::Range;
+
+    // An iterator that lies about its `ExactSizeIterator` implementation.
+    // See https://github.com/PyO3/pyo3/issues/2118
+    struct FaultyIter(Range<usize>, usize);
+
+    impl Iterator for FaultyIter {
+        type Item = usize;
+
+        fn next(&mut self) -> Option<Self::Item> {
+            self.0.next()
+        }
+    }
+
+    impl ExactSizeIterator for FaultyIter {
+        fn len(&self) -> usize {
+            self.1
+        }
+    }
+
+    #[test]
+    #[should_panic(
+        expected = "Attempted to create PyList but `elements` was larger than reported by its `ExactSizeIterator` implementation."
+    )]
+    fn too_long_iterator() {
+        Python::with_gil(|py| {
+            let iter = FaultyIter(0..usize::MAX, 73);
+            let _list = PyList::new_bound(py, iter);
+        })
+    }
+
+    #[test]
+    #[should_panic(
+        expected = "Attempted to create PyList but `elements` was smaller than reported by its `ExactSizeIterator` implementation."
+    )]
+    fn too_short_iterator() {
+        Python::with_gil(|py| {
+            let iter = FaultyIter(0..35, 73);
+            let _list = PyList::new_bound(py, iter);
+        })
+    }
+
+    #[test]
+    #[should_panic(
+        expected = "out of range integral type conversion attempted on `elements.len()`"
+    )]
+    fn overflowing_size() {
+        Python::with_gil(|py| {
+            let iter = FaultyIter(0..0, usize::MAX);
+
+            let _list = PyList::new_bound(py, iter);
+        })
+    }
+
+    #[cfg(feature = "macros")]
+    #[test]
+    fn bad_clone_mem_leaks() {
+        use crate::{Py, PyAny};
+        use std::sync::atomic::{AtomicUsize, Ordering::SeqCst};
+        static NEEDS_DESTRUCTING_COUNT: AtomicUsize = AtomicUsize::new(0);
+
+        #[crate::pyclass]
+        #[pyo3(crate = "crate")]
+        struct Bad(usize);
+
+        impl Clone for Bad {
+            fn clone(&self) -> Self {
+                // This panic should not lead to a memory leak
+                assert_ne!(self.0, 42);
+                NEEDS_DESTRUCTING_COUNT.fetch_add(1, SeqCst);
+
+                Bad(self.0)
+            }
+        }
+
+        impl Drop for Bad {
+            fn drop(&mut self) {
+                NEEDS_DESTRUCTING_COUNT.fetch_sub(1, SeqCst);
+            }
+        }
+
+        impl ToPyObject for Bad {
+            fn to_object(&self, py: Python<'_>) -> Py<PyAny> {
+                self.to_owned().into_py(py)
+            }
+        }
+
+        struct FaultyIter(Range<usize>, usize);
+
+        impl Iterator for FaultyIter {
+            type Item = Bad;
+
+            fn next(&mut self) -> Option<Self::Item> {
+                self.0.next().map(|i| {
+                    NEEDS_DESTRUCTING_COUNT.fetch_add(1, SeqCst);
+                    Bad(i)
+                })
+            }
+        }
+
+        impl ExactSizeIterator for FaultyIter {
+            fn len(&self) -> usize {
+                self.1
+            }
+        }
+
+        Python::with_gil(|py| {
+            std::panic::catch_unwind(|| {
+                let iter = FaultyIter(0..50, 50);
+                let _list = PyList::new_bound(py, iter);
+            })
+            .unwrap_err();
+        });
+
+        assert_eq!(
+            NEEDS_DESTRUCTING_COUNT.load(SeqCst),
+            0,
+            "Some destructors did not run"
+        );
+    }
+
+    #[test]
+    fn test_list_to_tuple() {
+        Python::with_gil(|py| {
+            let list = PyList::new_bound(py, vec![1, 2, 3]);
+            let tuple = list.to_tuple();
+            let tuple_expected = PyTuple::new_bound(py, vec![1, 2, 3]);
+            assert!(tuple.eq(tuple_expected).unwrap());
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/mapping.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/mapping.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/mapping.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/mapping.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,460 @@
+use crate::err::PyResult;
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::instance::Bound;
+use crate::py_result_ext::PyResultExt;
+use crate::sync::GILOnceCell;
+use crate::type_object::PyTypeInfo;
+use crate::types::any::PyAnyMethods;
+use crate::types::{PyAny, PyDict, PySequence, PyType};
+#[cfg(feature = "gil-refs")]
+use crate::{err::PyDowncastError, PyNativeType};
+use crate::{ffi, Py, PyTypeCheck, Python, ToPyObject};
+
+/// Represents a reference to a Python object supporting the mapping protocol.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyMapping>`][crate::Py] or [`Bound<'py, PyMapping>`][Bound].
+///
+/// For APIs available on mapping objects, see the [`PyMappingMethods`] trait which is implemented for
+/// [`Bound<'py, PyMapping>`][Bound].
+#[repr(transparent)]
+pub struct PyMapping(PyAny);
+pyobject_native_type_named!(PyMapping);
+pyobject_native_type_extract!(PyMapping);
+
+impl PyMapping {
+    /// Register a pyclass as a subclass of `collections.abc.Mapping` (from the Python standard
+    /// library). This is equivalent to `collections.abc.Mapping.register(T)` in Python.
+    /// This registration is required for a pyclass to be downcastable from `PyAny` to `PyMapping`.
+    pub fn register<T: PyTypeInfo>(py: Python<'_>) -> PyResult<()> {
+        let ty = T::type_object_bound(py);
+        get_mapping_abc(py)?.call_method1("register", (ty,))?;
+        Ok(())
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyMapping {
+    /// Returns the number of objects in the mapping.
+    ///
+    /// This is equivalent to the Python expression `len(self)`.
+    #[inline]
+    pub fn len(&self) -> PyResult<usize> {
+        self.as_borrowed().len()
+    }
+
+    /// Returns whether the mapping is empty.
+    #[inline]
+    pub fn is_empty(&self) -> PyResult<bool> {
+        self.as_borrowed().is_empty()
+    }
+
+    /// Determines if the mapping contains the specified key.
+    ///
+    /// This is equivalent to the Python expression `key in self`.
+    pub fn contains<K>(&self, key: K) -> PyResult<bool>
+    where
+        K: ToPyObject,
+    {
+        self.as_borrowed().contains(key)
+    }
+
+    /// Gets the item in self with key `key`.
+    ///
+    /// Returns an `Err` if the item with specified key is not found, usually `KeyError`.
+    ///
+    /// This is equivalent to the Python expression `self[key]`.
+    #[inline]
+    pub fn get_item<K>(&self, key: K) -> PyResult<&PyAny>
+    where
+        K: ToPyObject,
+    {
+        self.as_borrowed().get_item(key).map(Bound::into_gil_ref)
+    }
+
+    /// Sets the item in self with key `key`.
+    ///
+    /// This is equivalent to the Python expression `self[key] = value`.
+    #[inline]
+    pub fn set_item<K, V>(&self, key: K, value: V) -> PyResult<()>
+    where
+        K: ToPyObject,
+        V: ToPyObject,
+    {
+        self.as_borrowed().set_item(key, value)
+    }
+
+    /// Deletes the item with key `key`.
+    ///
+    /// This is equivalent to the Python statement `del self[key]`.
+    #[inline]
+    pub fn del_item<K>(&self, key: K) -> PyResult<()>
+    where
+        K: ToPyObject,
+    {
+        self.as_borrowed().del_item(key)
+    }
+
+    /// Returns a sequence containing all keys in the mapping.
+    #[inline]
+    pub fn keys(&self) -> PyResult<&PySequence> {
+        self.as_borrowed().keys().map(Bound::into_gil_ref)
+    }
+
+    /// Returns a sequence containing all values in the mapping.
+    #[inline]
+    pub fn values(&self) -> PyResult<&PySequence> {
+        self.as_borrowed().values().map(Bound::into_gil_ref)
+    }
+
+    /// Returns a sequence of tuples of all (key, value) pairs in the mapping.
+    #[inline]
+    pub fn items(&self) -> PyResult<&PySequence> {
+        self.as_borrowed().items().map(Bound::into_gil_ref)
+    }
+}
+
+/// Implementation of functionality for [`PyMapping`].
+///
+/// These methods are defined for the `Bound<'py, PyMapping>` smart pointer, so to use method call
+/// syntax these methods are separated into a trait, because stable Rust does not yet support
+/// `arbitrary_self_types`.
+#[doc(alias = "PyMapping")]
+pub trait PyMappingMethods<'py>: crate::sealed::Sealed {
+    /// Returns the number of objects in the mapping.
+    ///
+    /// This is equivalent to the Python expression `len(self)`.
+    fn len(&self) -> PyResult<usize>;
+
+    /// Returns whether the mapping is empty.
+    fn is_empty(&self) -> PyResult<bool>;
+
+    /// Determines if the mapping contains the specified key.
+    ///
+    /// This is equivalent to the Python expression `key in self`.
+    fn contains<K>(&self, key: K) -> PyResult<bool>
+    where
+        K: ToPyObject;
+
+    /// Gets the item in self with key `key`.
+    ///
+    /// Returns an `Err` if the item with specified key is not found, usually `KeyError`.
+    ///
+    /// This is equivalent to the Python expression `self[key]`.
+    fn get_item<K>(&self, key: K) -> PyResult<Bound<'py, PyAny>>
+    where
+        K: ToPyObject;
+
+    /// Sets the item in self with key `key`.
+    ///
+    /// This is equivalent to the Python expression `self[key] = value`.
+    fn set_item<K, V>(&self, key: K, value: V) -> PyResult<()>
+    where
+        K: ToPyObject,
+        V: ToPyObject;
+
+    /// Deletes the item with key `key`.
+    ///
+    /// This is equivalent to the Python statement `del self[key]`.
+    fn del_item<K>(&self, key: K) -> PyResult<()>
+    where
+        K: ToPyObject;
+
+    /// Returns a sequence containing all keys in the mapping.
+    fn keys(&self) -> PyResult<Bound<'py, PySequence>>;
+
+    /// Returns a sequence containing all values in the mapping.
+    fn values(&self) -> PyResult<Bound<'py, PySequence>>;
+
+    /// Returns a sequence of tuples of all (key, value) pairs in the mapping.
+    fn items(&self) -> PyResult<Bound<'py, PySequence>>;
+}
+
+impl<'py> PyMappingMethods<'py> for Bound<'py, PyMapping> {
+    #[inline]
+    fn len(&self) -> PyResult<usize> {
+        let v = unsafe { ffi::PyMapping_Size(self.as_ptr()) };
+        crate::err::error_on_minusone(self.py(), v)?;
+        Ok(v as usize)
+    }
+
+    #[inline]
+    fn is_empty(&self) -> PyResult<bool> {
+        self.len().map(|l| l == 0)
+    }
+
+    fn contains<K>(&self, key: K) -> PyResult<bool>
+    where
+        K: ToPyObject,
+    {
+        PyAnyMethods::contains(&**self, key)
+    }
+
+    #[inline]
+    fn get_item<K>(&self, key: K) -> PyResult<Bound<'py, PyAny>>
+    where
+        K: ToPyObject,
+    {
+        PyAnyMethods::get_item(&**self, key)
+    }
+
+    #[inline]
+    fn set_item<K, V>(&self, key: K, value: V) -> PyResult<()>
+    where
+        K: ToPyObject,
+        V: ToPyObject,
+    {
+        PyAnyMethods::set_item(&**self, key, value)
+    }
+
+    #[inline]
+    fn del_item<K>(&self, key: K) -> PyResult<()>
+    where
+        K: ToPyObject,
+    {
+        PyAnyMethods::del_item(&**self, key)
+    }
+
+    #[inline]
+    fn keys(&self) -> PyResult<Bound<'py, PySequence>> {
+        unsafe {
+            ffi::PyMapping_Keys(self.as_ptr())
+                .assume_owned_or_err(self.py())
+                .downcast_into_unchecked()
+        }
+    }
+
+    #[inline]
+    fn values(&self) -> PyResult<Bound<'py, PySequence>> {
+        unsafe {
+            ffi::PyMapping_Values(self.as_ptr())
+                .assume_owned_or_err(self.py())
+                .downcast_into_unchecked()
+        }
+    }
+
+    #[inline]
+    fn items(&self) -> PyResult<Bound<'py, PySequence>> {
+        unsafe {
+            ffi::PyMapping_Items(self.as_ptr())
+                .assume_owned_or_err(self.py())
+                .downcast_into_unchecked()
+        }
+    }
+}
+
+fn get_mapping_abc(py: Python<'_>) -> PyResult<&Bound<'_, PyType>> {
+    static MAPPING_ABC: GILOnceCell<Py<PyType>> = GILOnceCell::new();
+
+    MAPPING_ABC.get_or_try_init_type_ref(py, "collections.abc", "Mapping")
+}
+
+impl PyTypeCheck for PyMapping {
+    const NAME: &'static str = "Mapping";
+
+    #[inline]
+    fn type_check(object: &Bound<'_, PyAny>) -> bool {
+        // Using `is_instance` for `collections.abc.Mapping` is slow, so provide
+        // optimized case dict as a well-known mapping
+        PyDict::is_type_of_bound(object)
+            || get_mapping_abc(object.py())
+                .and_then(|abc| object.is_instance(abc))
+                .unwrap_or_else(|err| {
+                    err.write_unraisable_bound(object.py(), Some(&object.as_borrowed()));
+                    false
+                })
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+impl<'v> crate::PyTryFrom<'v> for PyMapping {
+    /// Downcasting to `PyMapping` requires the concrete class to be a subclass (or registered
+    /// subclass) of `collections.abc.Mapping` (from the Python standard library) - i.e.
+    /// `isinstance(<class>, collections.abc.Mapping) == True`.
+    fn try_from<V: Into<&'v PyAny>>(value: V) -> Result<&'v PyMapping, PyDowncastError<'v>> {
+        let value = value.into();
+
+        if PyMapping::type_check(&value.as_borrowed()) {
+            unsafe { return Ok(value.downcast_unchecked()) }
+        }
+
+        Err(PyDowncastError::new(value, "Mapping"))
+    }
+
+    #[inline]
+    fn try_from_exact<V: Into<&'v PyAny>>(value: V) -> Result<&'v PyMapping, PyDowncastError<'v>> {
+        value.into().downcast()
+    }
+
+    #[inline]
+    unsafe fn try_from_unchecked<V: Into<&'v PyAny>>(value: V) -> &'v PyMapping {
+        let ptr = value.into() as *const _ as *const PyMapping;
+        &*ptr
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use std::collections::HashMap;
+
+    use crate::{exceptions::PyKeyError, types::PyTuple};
+
+    use super::*;
+
+    #[test]
+    fn test_len() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            let ob = v.to_object(py);
+            let mapping = ob.downcast_bound::<PyMapping>(py).unwrap();
+            assert_eq!(0, mapping.len().unwrap());
+            assert!(mapping.is_empty().unwrap());
+
+            v.insert(7, 32);
+            let ob = v.to_object(py);
+            let mapping2 = ob.downcast_bound::<PyMapping>(py).unwrap();
+            assert_eq!(1, mapping2.len().unwrap());
+            assert!(!mapping2.is_empty().unwrap());
+        });
+    }
+
+    #[test]
+    fn test_contains() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert("key0", 1234);
+            let ob = v.to_object(py);
+            let mapping = ob.downcast_bound::<PyMapping>(py).unwrap();
+            mapping.set_item("key1", "foo").unwrap();
+
+            assert!(mapping.contains("key0").unwrap());
+            assert!(mapping.contains("key1").unwrap());
+            assert!(!mapping.contains("key2").unwrap());
+        });
+    }
+
+    #[test]
+    fn test_get_item() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            let ob = v.to_object(py);
+            let mapping = ob.downcast_bound::<PyMapping>(py).unwrap();
+            assert_eq!(
+                32,
+                mapping.get_item(7i32).unwrap().extract::<i32>().unwrap()
+            );
+            assert!(mapping
+                .get_item(8i32)
+                .unwrap_err()
+                .is_instance_of::<PyKeyError>(py));
+        });
+    }
+
+    #[test]
+    fn test_set_item() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            let ob = v.to_object(py);
+            let mapping = ob.downcast_bound::<PyMapping>(py).unwrap();
+            assert!(mapping.set_item(7i32, 42i32).is_ok()); // change
+            assert!(mapping.set_item(8i32, 123i32).is_ok()); // insert
+            assert_eq!(
+                42i32,
+                mapping.get_item(7i32).unwrap().extract::<i32>().unwrap()
+            );
+            assert_eq!(
+                123i32,
+                mapping.get_item(8i32).unwrap().extract::<i32>().unwrap()
+            );
+        });
+    }
+
+    #[test]
+    fn test_del_item() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            let ob = v.to_object(py);
+            let mapping = ob.downcast_bound::<PyMapping>(py).unwrap();
+            assert!(mapping.del_item(7i32).is_ok());
+            assert_eq!(0, mapping.len().unwrap());
+            assert!(mapping
+                .get_item(7i32)
+                .unwrap_err()
+                .is_instance_of::<PyKeyError>(py));
+        });
+    }
+
+    #[test]
+    fn test_items() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            v.insert(8, 42);
+            v.insert(9, 123);
+            let ob = v.to_object(py);
+            let mapping = ob.downcast_bound::<PyMapping>(py).unwrap();
+            // Can't just compare against a vector of tuples since we don't have a guaranteed ordering.
+            let mut key_sum = 0;
+            let mut value_sum = 0;
+            for el in mapping.items().unwrap().iter().unwrap() {
+                let tuple = el.unwrap().downcast_into::<PyTuple>().unwrap();
+                key_sum += tuple.get_item(0).unwrap().extract::<i32>().unwrap();
+                value_sum += tuple.get_item(1).unwrap().extract::<i32>().unwrap();
+            }
+            assert_eq!(7 + 8 + 9, key_sum);
+            assert_eq!(32 + 42 + 123, value_sum);
+        });
+    }
+
+    #[test]
+    fn test_keys() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            v.insert(8, 42);
+            v.insert(9, 123);
+            let ob = v.to_object(py);
+            let mapping = ob.downcast_bound::<PyMapping>(py).unwrap();
+            // Can't just compare against a vector of tuples since we don't have a guaranteed ordering.
+            let mut key_sum = 0;
+            for el in mapping.keys().unwrap().iter().unwrap() {
+                key_sum += el.unwrap().extract::<i32>().unwrap();
+            }
+            assert_eq!(7 + 8 + 9, key_sum);
+        });
+    }
+
+    #[test]
+    fn test_values() {
+        Python::with_gil(|py| {
+            let mut v = HashMap::new();
+            v.insert(7, 32);
+            v.insert(8, 42);
+            v.insert(9, 123);
+            let ob = v.to_object(py);
+            let mapping = ob.downcast_bound::<PyMapping>(py).unwrap();
+            // Can't just compare against a vector of tuples since we don't have a guaranteed ordering.
+            let mut values_sum = 0;
+            for el in mapping.values().unwrap().iter().unwrap() {
+                values_sum += el.unwrap().extract::<i32>().unwrap();
+            }
+            assert_eq!(32 + 42 + 123, values_sum);
+        });
+    }
+
+    #[test]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_mapping_try_from() {
+        use crate::PyTryFrom;
+        Python::with_gil(|py| {
+            let dict = PyDict::new(py);
+            let _ = <PyMapping as PyTryFrom>::try_from(dict).unwrap();
+            let _ = PyMapping::try_from_exact(dict).unwrap();
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/memoryview.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/memoryview.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/memoryview.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/memoryview.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,58 @@
+use crate::err::PyResult;
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::py_result_ext::PyResultExt;
+use crate::{ffi, Bound, PyAny};
+#[cfg(feature = "gil-refs")]
+use crate::{AsPyPointer, PyNativeType};
+
+/// Represents a Python `memoryview`.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyMemoryView>`][crate::Py] or [`Bound<'py, PyMemoryView>`][Bound].
+#[repr(transparent)]
+pub struct PyMemoryView(PyAny);
+
+pyobject_native_type_core!(PyMemoryView, pyobject_native_static_type_object!(ffi::PyMemoryView_Type), #checkfunction=ffi::PyMemoryView_Check);
+
+impl PyMemoryView {
+    /// Deprecated form of [`PyMemoryView::from_bound`]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyMemoryView::from` will be replaced by `PyMemoryView::from_bound` in a future PyO3 version"
+    )]
+    pub fn from(src: &PyAny) -> PyResult<&PyMemoryView> {
+        PyMemoryView::from_bound(&src.as_borrowed()).map(Bound::into_gil_ref)
+    }
+
+    /// Creates a new Python `memoryview` object from another Python object that
+    /// implements the buffer protocol.
+    pub fn from_bound<'py>(src: &Bound<'py, PyAny>) -> PyResult<Bound<'py, Self>> {
+        unsafe {
+            ffi::PyMemoryView_FromObject(src.as_ptr())
+                .assume_owned_or_err(src.py())
+                .downcast_into_unchecked()
+        }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'py> TryFrom<&'py PyAny> for &'py PyMemoryView {
+    type Error = crate::PyErr;
+
+    /// Creates a new Python `memoryview` object from another Python object that
+    /// implements the buffer protocol.
+    fn try_from(value: &'py PyAny) -> Result<Self, Self::Error> {
+        PyMemoryView::from_bound(&value.as_borrowed()).map(Bound::into_gil_ref)
+    }
+}
+
+impl<'py> TryFrom<&Bound<'py, PyAny>> for Bound<'py, PyMemoryView> {
+    type Error = crate::PyErr;
+
+    /// Creates a new Python `memoryview` object from another Python object that
+    /// implements the buffer protocol.
+    fn try_from(value: &Bound<'py, PyAny>) -> Result<Self, Self::Error> {
+        PyMemoryView::from_bound(value)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/mod.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/mod.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,369 @@
+//! Various types defined by the Python interpreter such as `int`, `str` and `tuple`.
+
+pub use self::any::{PyAny, PyAnyMethods};
+pub use self::boolobject::{PyBool, PyBoolMethods};
+pub use self::bytearray::{PyByteArray, PyByteArrayMethods};
+pub use self::bytes::{PyBytes, PyBytesMethods};
+pub use self::capsule::{PyCapsule, PyCapsuleMethods};
+#[cfg(all(not(Py_LIMITED_API), not(PyPy), not(GraalPy)))]
+pub use self::code::PyCode;
+pub use self::complex::{PyComplex, PyComplexMethods};
+#[allow(deprecated)]
+#[cfg(all(not(Py_LIMITED_API), feature = "gil-refs"))]
+pub use self::datetime::timezone_utc;
+#[cfg(not(Py_LIMITED_API))]
+pub use self::datetime::{
+    timezone_utc_bound, PyDate, PyDateAccess, PyDateTime, PyDelta, PyDeltaAccess, PyTime,
+    PyTimeAccess, PyTzInfo, PyTzInfoAccess,
+};
+pub use self::dict::{IntoPyDict, PyDict, PyDictMethods};
+#[cfg(not(any(PyPy, GraalPy)))]
+pub use self::dict::{PyDictItems, PyDictKeys, PyDictValues};
+pub use self::ellipsis::PyEllipsis;
+pub use self::float::{PyFloat, PyFloatMethods};
+#[cfg(all(not(Py_LIMITED_API), not(PyPy), not(GraalPy)))]
+pub use self::frame::PyFrame;
+pub use self::frozenset::{PyFrozenSet, PyFrozenSetBuilder, PyFrozenSetMethods};
+pub use self::function::PyCFunction;
+#[cfg(all(not(Py_LIMITED_API), not(PyPy), not(GraalPy)))]
+pub use self::function::PyFunction;
+pub use self::iterator::PyIterator;
+pub use self::list::{PyList, PyListMethods};
+pub use self::mapping::{PyMapping, PyMappingMethods};
+pub use self::memoryview::PyMemoryView;
+pub use self::module::{PyModule, PyModuleMethods};
+pub use self::none::PyNone;
+pub use self::notimplemented::PyNotImplemented;
+pub use self::num::PyLong;
+pub use self::num::PyLong as PyInt;
+#[cfg(not(any(PyPy, GraalPy)))]
+pub use self::pysuper::PySuper;
+pub use self::sequence::{PySequence, PySequenceMethods};
+pub use self::set::{PySet, PySetMethods};
+pub use self::slice::{PySlice, PySliceIndices, PySliceMethods};
+#[cfg(not(Py_LIMITED_API))]
+pub use self::string::PyStringData;
+pub use self::string::{PyString, PyString as PyUnicode, PyStringMethods};
+pub use self::traceback::{PyTraceback, PyTracebackMethods};
+pub use self::tuple::{PyTuple, PyTupleMethods};
+pub use self::typeobject::{PyType, PyTypeMethods};
+pub use self::weakref::{PyWeakref, PyWeakrefMethods, PyWeakrefProxy, PyWeakrefReference};
+
+/// Iteration over Python collections.
+///
+/// When working with a Python collection, one approach is to convert it to a Rust collection such
+/// as `Vec` or `HashMap`. However this is a relatively expensive operation. If you just want to
+/// visit all their items, consider iterating over the collections directly:
+///
+/// # Examples
+///
+/// ```rust
+/// use pyo3::prelude::*;
+/// use pyo3::types::PyDict;
+///
+/// # pub fn main() -> PyResult<()> {
+/// Python::with_gil(|py| {
+///     let dict = py.eval_bound("{'a':'b', 'c':'d'}", None, None)?.downcast_into::<PyDict>()?;
+///
+///     for (key, value) in &dict {
+///         println!("key: {}, value: {}", key, value);
+///     }
+///
+///     Ok(())
+/// })
+/// # }
+///  ```
+///
+/// If PyO3 detects that the collection is mutated during iteration, it will panic.
+///
+/// These iterators use Python's C-API directly. However in certain cases, like when compiling for
+/// the Limited API and PyPy, the underlying structures are opaque and that may not be possible.
+/// In these cases the iterators are implemented by forwarding to [`PyIterator`].
+pub mod iter {
+    pub use super::dict::BoundDictIterator;
+    pub use super::frozenset::BoundFrozenSetIterator;
+    pub use super::list::BoundListIterator;
+    pub use super::set::BoundSetIterator;
+    pub use super::tuple::{BorrowedTupleIterator, BoundTupleIterator};
+
+    #[cfg(feature = "gil-refs")]
+    pub use super::{
+        dict::PyDictIterator, frozenset::PyFrozenSetIterator, list::PyListIterator,
+        set::PySetIterator, tuple::PyTupleIterator,
+    };
+}
+
+/// Python objects that have a base type.
+///
+/// This marks types that can be upcast into a [`PyAny`] and used in its place.
+/// This essentially includes every Python object except [`PyAny`] itself.
+///
+/// This is used to provide the [`Deref<Target = Bound<'_, PyAny>>`](std::ops::Deref)
+/// implementations for [`Bound<'_, T>`](crate::Bound).
+///
+/// Users should not need to implement this trait directly. It's implementation
+/// is provided by the [`#[pyclass]`](macro@crate::pyclass) attribute.
+///
+/// ## Note
+/// This is needed because the compiler currently tries to figure out all the
+/// types in a deref-chain before starting to look for applicable method calls.
+/// So we need to prevent [`Bound<'_, PyAny`](crate::Bound) dereferencing to
+/// itself in order to avoid running into the recursion limit. This trait is
+/// used to exclude this from our blanket implementation. See [this Rust
+/// issue][1] for more details. If the compiler limitation gets resolved, this
+/// trait will be removed.
+///
+/// [1]: https://github.com/rust-lang/rust/issues/19509
+pub trait DerefToPyAny {
+    // Empty.
+}
+
+// Implementations core to all native types
+#[doc(hidden)]
+#[macro_export]
+macro_rules! pyobject_native_type_base(
+    ($name:ty $(;$generics:ident)* ) => {
+        #[cfg(feature = "gil-refs")]
+        unsafe impl<$($generics,)*> $crate::PyNativeType for $name {
+            type AsRefSource = Self;
+        }
+
+        #[cfg(feature = "gil-refs")]
+        impl<$($generics,)*> ::std::fmt::Debug for $name {
+            fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>)
+                   -> ::std::result::Result<(), ::std::fmt::Error>
+            {
+                use $crate::{PyNativeType, types::{PyAnyMethods, PyStringMethods}};
+                let s = self.as_borrowed().repr().or(::std::result::Result::Err(::std::fmt::Error))?;
+                f.write_str(&s.to_string_lossy())
+            }
+        }
+
+        #[cfg(feature = "gil-refs")]
+        impl<$($generics,)*> ::std::fmt::Display for $name {
+            fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>)
+                   -> ::std::result::Result<(), ::std::fmt::Error>
+            {
+                use $crate::{PyNativeType, types::{PyAnyMethods, PyStringMethods, PyTypeMethods}};
+                match self.as_borrowed().str() {
+                    ::std::result::Result::Ok(s) => return f.write_str(&s.to_string_lossy()),
+                    ::std::result::Result::Err(err) => err.write_unraisable_bound(self.py(), ::std::option::Option::Some(&self.as_borrowed())),
+                }
+
+                match self.as_borrowed().get_type().name() {
+                    ::std::result::Result::Ok(name) => ::std::write!(f, "<unprintable {} object>", name),
+                    ::std::result::Result::Err(_err) => f.write_str("<unprintable object>"),
+                }
+            }
+        }
+
+        #[cfg(feature = "gil-refs")]
+        impl<$($generics,)*> $crate::ToPyObject for $name
+        {
+            #[inline]
+            fn to_object(&self, py: $crate::Python<'_>) -> $crate::PyObject {
+                unsafe { $crate::PyObject::from_borrowed_ptr(py, self.as_ptr()) }
+            }
+        }
+    };
+);
+
+// Implementations core to all native types except for PyAny (because they don't
+// make sense on PyAny / have different implementations).
+#[doc(hidden)]
+#[macro_export]
+macro_rules! pyobject_native_type_named (
+    ($name:ty $(;$generics:ident)*) => {
+        $crate::pyobject_native_type_base!($name $(;$generics)*);
+
+        impl<$($generics,)*> ::std::convert::AsRef<$crate::PyAny> for $name {
+            #[inline]
+            fn as_ref(&self) -> &$crate::PyAny {
+                &self.0
+            }
+        }
+
+        impl<$($generics,)*> ::std::ops::Deref for $name {
+            type Target = $crate::PyAny;
+
+            #[inline]
+            fn deref(&self) -> &$crate::PyAny {
+                &self.0
+            }
+        }
+
+        unsafe impl<$($generics,)*> $crate::AsPyPointer for $name {
+            /// Gets the underlying FFI pointer, returns a borrowed pointer.
+            #[inline]
+            fn as_ptr(&self) -> *mut $crate::ffi::PyObject {
+                self.0.as_ptr()
+            }
+        }
+
+        // FIXME https://github.com/PyO3/pyo3/issues/3903
+        #[allow(unknown_lints, non_local_definitions)]
+        #[cfg(feature = "gil-refs")]
+        impl<$($generics,)*> $crate::IntoPy<$crate::Py<$name>> for &'_ $name {
+            #[inline]
+            fn into_py(self, py: $crate::Python<'_>) -> $crate::Py<$name> {
+                unsafe { $crate::Py::from_borrowed_ptr(py, self.as_ptr()) }
+            }
+        }
+
+        // FIXME https://github.com/PyO3/pyo3/issues/3903
+        #[allow(unknown_lints, non_local_definitions)]
+        #[cfg(feature = "gil-refs")]
+        impl<$($generics,)*> ::std::convert::From<&'_ $name> for $crate::Py<$name> {
+            #[inline]
+            fn from(other: &$name) -> Self {
+                use $crate::PyNativeType;
+                unsafe { $crate::Py::from_borrowed_ptr(other.py(), other.as_ptr()) }
+            }
+        }
+
+        // FIXME https://github.com/PyO3/pyo3/issues/3903
+        #[allow(unknown_lints, non_local_definitions)]
+        #[cfg(feature = "gil-refs")]
+        impl<'a, $($generics,)*> ::std::convert::From<&'a $name> for &'a $crate::PyAny {
+            fn from(ob: &'a $name) -> Self {
+                unsafe{&*(ob as *const $name as *const $crate::PyAny)}
+            }
+        }
+
+        impl $crate::types::DerefToPyAny for $name {}
+    };
+);
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! pyobject_native_static_type_object(
+    ($typeobject:expr) => {
+        |_py| unsafe { ::std::ptr::addr_of_mut!($typeobject) }
+    };
+);
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! pyobject_native_type_info(
+    ($name:ty, $typeobject:expr, $module:expr $(, #checkfunction=$checkfunction:path)? $(;$generics:ident)*) => {
+        unsafe impl<$($generics,)*> $crate::type_object::PyTypeInfo for $name {
+            const NAME: &'static str = stringify!($name);
+            const MODULE: ::std::option::Option<&'static str> = $module;
+
+            #[inline]
+            #[allow(clippy::redundant_closure_call)]
+            fn type_object_raw(py: $crate::Python<'_>) -> *mut $crate::ffi::PyTypeObject {
+                $typeobject(py)
+            }
+
+            $(
+                #[inline]
+                fn is_type_of_bound(obj: &$crate::Bound<'_, $crate::PyAny>) -> bool {
+                    #[allow(unused_unsafe)]
+                    unsafe { $checkfunction(obj.as_ptr()) > 0 }
+                }
+            )?
+        }
+
+        impl $name {
+            #[doc(hidden)]
+            pub const _PYO3_DEF: $crate::impl_::pymodule::AddTypeToModule<Self> = $crate::impl_::pymodule::AddTypeToModule::new();
+        }
+    };
+);
+
+// NOTE: This macro is not included in pyobject_native_type_base!
+// because rust-numpy has a special implementation.
+#[doc(hidden)]
+#[macro_export]
+macro_rules! pyobject_native_type_extract {
+    ($name:ty $(;$generics:ident)*) => {
+        // FIXME https://github.com/PyO3/pyo3/issues/3903
+        #[allow(unknown_lints, non_local_definitions)]
+        #[cfg(feature = "gil-refs")]
+        impl<'py, $($generics,)*> $crate::FromPyObject<'py> for &'py $name {
+            #[inline]
+            fn extract_bound(obj: &$crate::Bound<'py, $crate::PyAny>) -> $crate::PyResult<Self> {
+                ::std::clone::Clone::clone(obj).into_gil_ref().downcast().map_err(::std::convert::Into::into)
+            }
+        }
+    }
+}
+
+/// Declares all of the boilerplate for Python types.
+#[doc(hidden)]
+#[macro_export]
+macro_rules! pyobject_native_type_core {
+    ($name:ty, $typeobject:expr, #module=$module:expr $(, #checkfunction=$checkfunction:path)? $(;$generics:ident)*) => {
+        $crate::pyobject_native_type_named!($name $(;$generics)*);
+        $crate::pyobject_native_type_info!($name, $typeobject, $module $(, #checkfunction=$checkfunction)? $(;$generics)*);
+        $crate::pyobject_native_type_extract!($name $(;$generics)*);
+    };
+    ($name:ty, $typeobject:expr $(, #checkfunction=$checkfunction:path)? $(;$generics:ident)*) => {
+        $crate::pyobject_native_type_core!($name, $typeobject, #module=::std::option::Option::Some("builtins") $(, #checkfunction=$checkfunction)? $(;$generics)*);
+    };
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! pyobject_native_type_sized {
+    ($name:ty, $layout:path $(;$generics:ident)*) => {
+        unsafe impl $crate::type_object::PyLayout<$name> for $layout {}
+        impl $crate::type_object::PySizedLayout<$name> for $layout {}
+        impl<$($generics,)*> $crate::impl_::pyclass::PyClassBaseType for $name {
+            type LayoutAsBase = $crate::impl_::pycell::PyClassObjectBase<$layout>;
+            type BaseNativeType = $name;
+            type Initializer = $crate::pyclass_init::PyNativeTypeInitializer<Self>;
+            type PyClassMutability = $crate::pycell::impl_::ImmutableClass;
+        }
+    }
+}
+
+/// Declares all of the boilerplate for Python types which can be inherited from (because the exact
+/// Python layout is known).
+#[doc(hidden)]
+#[macro_export]
+macro_rules! pyobject_native_type {
+    ($name:ty, $layout:path, $typeobject:expr $(, #module=$module:expr)? $(, #checkfunction=$checkfunction:path)? $(;$generics:ident)*) => {
+        $crate::pyobject_native_type_core!($name, $typeobject $(, #module=$module)? $(, #checkfunction=$checkfunction)? $(;$generics)*);
+        // To prevent inheriting native types with ABI3
+        #[cfg(not(Py_LIMITED_API))]
+        $crate::pyobject_native_type_sized!($name, $layout $(;$generics)*);
+    };
+}
+
+pub(crate) mod any;
+pub(crate) mod boolobject;
+pub(crate) mod bytearray;
+pub(crate) mod bytes;
+pub(crate) mod capsule;
+#[cfg(all(not(Py_LIMITED_API), not(PyPy), not(GraalPy)))]
+mod code;
+pub(crate) mod complex;
+#[cfg(not(Py_LIMITED_API))]
+pub(crate) mod datetime;
+pub(crate) mod dict;
+mod ellipsis;
+pub(crate) mod float;
+#[cfg(all(not(Py_LIMITED_API), not(PyPy), not(GraalPy)))]
+mod frame;
+pub(crate) mod frozenset;
+mod function;
+pub(crate) mod iterator;
+pub(crate) mod list;
+pub(crate) mod mapping;
+mod memoryview;
+pub(crate) mod module;
+mod none;
+mod notimplemented;
+mod num;
+#[cfg(not(any(PyPy, GraalPy)))]
+mod pysuper;
+pub(crate) mod sequence;
+pub(crate) mod set;
+pub(crate) mod slice;
+pub(crate) mod string;
+pub(crate) mod traceback;
+pub(crate) mod tuple;
+pub(crate) mod typeobject;
+pub(crate) mod weakref;
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/module.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/module.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/module.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/module.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,762 @@
+use crate::callback::IntoPyCallbackOutput;
+use crate::err::{PyErr, PyResult};
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::py_result_ext::PyResultExt;
+use crate::pyclass::PyClass;
+use crate::types::{
+    any::PyAnyMethods, list::PyListMethods, PyAny, PyCFunction, PyDict, PyList, PyString,
+};
+use crate::{exceptions, ffi, Bound, IntoPy, Py, PyObject, Python};
+use std::ffi::CString;
+use std::str;
+
+#[cfg(feature = "gil-refs")]
+use {super::PyStringMethods, crate::PyNativeType};
+
+/// Represents a Python [`module`][1] object.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyModule>`][crate::Py] or [`Bound<'py, PyModule>`][Bound].
+///
+/// For APIs available on `module` objects, see the [`PyModuleMethods`] trait which is implemented for
+/// [`Bound<'py, PyModule>`][Bound].
+///
+/// As with all other Python objects, modules are first class citizens.
+/// This means they can be passed to or returned from functions,
+/// created dynamically, assigned to variables and so forth.
+///
+/// [1]: https://docs.python.org/3/tutorial/modules.html
+#[repr(transparent)]
+pub struct PyModule(PyAny);
+
+pyobject_native_type_core!(PyModule, pyobject_native_static_type_object!(ffi::PyModule_Type), #checkfunction=ffi::PyModule_Check);
+
+impl PyModule {
+    /// Creates a new module object with the `__name__` attribute set to `name`.
+    ///
+    /// # Examples
+    ///
+    /// ``` rust
+    /// use pyo3::prelude::*;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let module = PyModule::new_bound(py, "my_module")?;
+    ///
+    ///     assert_eq!(module.name()?, "my_module");
+    ///     Ok(())
+    /// })?;
+    /// # Ok(())}
+    ///  ```
+    pub fn new_bound<'py>(py: Python<'py>, name: &str) -> PyResult<Bound<'py, PyModule>> {
+        // Could use PyModule_NewObject, but it doesn't exist on PyPy.
+        let name = CString::new(name)?;
+        unsafe {
+            ffi::PyModule_New(name.as_ptr())
+                .assume_owned_or_err(py)
+                .downcast_into_unchecked()
+        }
+    }
+
+    /// Imports the Python module with the specified name.
+    ///
+    /// # Examples
+    ///
+    /// ```no_run
+    /// # fn main() {
+    /// use pyo3::prelude::*;
+    ///
+    /// Python::with_gil(|py| {
+    ///     let module = PyModule::import_bound(py, "antigravity").expect("No flying for you.");
+    /// });
+    /// # }
+    ///  ```
+    ///
+    /// This is equivalent to the following Python expression:
+    /// ```python
+    /// import antigravity
+    /// ```
+    pub fn import_bound<N>(py: Python<'_>, name: N) -> PyResult<Bound<'_, PyModule>>
+    where
+        N: IntoPy<Py<PyString>>,
+    {
+        let name: Py<PyString> = name.into_py(py);
+        unsafe {
+            ffi::PyImport_Import(name.as_ptr())
+                .assume_owned_or_err(py)
+                .downcast_into_unchecked()
+        }
+    }
+
+    /// Creates and loads a module named `module_name`,
+    /// containing the Python code passed to `code`
+    /// and pretending to live at `file_name`.
+    ///
+    /// <div class="information">
+    ///     <div class="tooltip compile_fail" style="">&#x26a0; &#xfe0f;</div>
+    /// </div><div class="example-wrap" style="display:inline-block"><pre class="compile_fail" style="white-space:normal;font:inherit;">
+    //
+    ///  <strong>Warning</strong>: This will compile and execute code. <strong>Never</strong> pass untrusted code to this function!
+    ///
+    /// </pre></div>
+    ///
+    /// # Errors
+    ///
+    /// Returns `PyErr` if:
+    /// - `code` is not syntactically correct Python.
+    /// - Any Python exceptions are raised while initializing the module.
+    /// - Any of the arguments cannot be converted to [`CString`]s.
+    ///
+    /// # Example: bundle in a file at compile time with [`include_str!`][std::include_str]:
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// // This path is resolved relative to this file.
+    /// let code = include_str!("../../assets/script.py");
+    ///
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     PyModule::from_code_bound(py, code, "example.py", "example")?;
+    ///     Ok(())
+    /// })?;
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// # Example: Load a file at runtime with [`std::fs::read_to_string`].
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// // This path is resolved by however the platform resolves paths,
+    /// // which also makes this less portable. Consider using `include_str`
+    /// // if you just want to bundle a script with your module.
+    /// let code = std::fs::read_to_string("assets/script.py")?;
+    ///
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     PyModule::from_code_bound(py, &code, "example.py", "example")?;
+    ///     Ok(())
+    /// })?;
+    /// Ok(())
+    /// # }
+    /// ```
+    pub fn from_code_bound<'py>(
+        py: Python<'py>,
+        code: &str,
+        file_name: &str,
+        module_name: &str,
+    ) -> PyResult<Bound<'py, PyModule>> {
+        let data = CString::new(code)?;
+        let filename = CString::new(file_name)?;
+        let module = CString::new(module_name)?;
+
+        unsafe {
+            let code = ffi::Py_CompileString(data.as_ptr(), filename.as_ptr(), ffi::Py_file_input)
+                .assume_owned_or_err(py)?;
+
+            ffi::PyImport_ExecCodeModuleEx(module.as_ptr(), code.as_ptr(), filename.as_ptr())
+                .assume_owned_or_err(py)
+                .downcast_into()
+        }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyModule {
+    /// Deprecated form of [`PyModule::new_bound`].
+    #[inline]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyModule::new` will be replaced by `PyModule::new_bound` in a future PyO3 version"
+    )]
+    pub fn new<'py>(py: Python<'py>, name: &str) -> PyResult<&'py PyModule> {
+        Self::new_bound(py, name).map(Bound::into_gil_ref)
+    }
+
+    /// Deprecated form of [`PyModule::import_bound`].
+    #[inline]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyModule::import` will be replaced by `PyModule::import_bound` in a future PyO3 version"
+    )]
+    pub fn import<N>(py: Python<'_>, name: N) -> PyResult<&PyModule>
+    where
+        N: IntoPy<Py<PyString>>,
+    {
+        Self::import_bound(py, name).map(Bound::into_gil_ref)
+    }
+
+    /// Deprecated form of [`PyModule::from_code_bound`].
+    #[inline]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyModule::from_code` will be replaced by `PyModule::from_code_bound` in a future PyO3 version"
+    )]
+    pub fn from_code<'py>(
+        py: Python<'py>,
+        code: &str,
+        file_name: &str,
+        module_name: &str,
+    ) -> PyResult<&'py PyModule> {
+        Self::from_code_bound(py, code, file_name, module_name).map(Bound::into_gil_ref)
+    }
+
+    /// Returns the module's `__dict__` attribute, which contains the module's symbol table.
+    pub fn dict(&self) -> &PyDict {
+        self.as_borrowed().dict().into_gil_ref()
+    }
+
+    /// Returns the index (the `__all__` attribute) of the module,
+    /// creating one if needed.
+    ///
+    /// `__all__` declares the items that will be imported with `from my_module import *`.
+    pub fn index(&self) -> PyResult<&PyList> {
+        self.as_borrowed().index().map(Bound::into_gil_ref)
+    }
+
+    /// Returns the name (the `__name__` attribute) of the module.
+    ///
+    /// May fail if the module does not have a `__name__` attribute.
+    pub fn name(&self) -> PyResult<&str> {
+        self.as_borrowed().name()?.into_gil_ref().to_str()
+    }
+
+    /// Returns the filename (the `__file__` attribute) of the module.
+    ///
+    /// May fail if the module does not have a `__file__` attribute.
+    pub fn filename(&self) -> PyResult<&str> {
+        self.as_borrowed().filename()?.into_gil_ref().to_str()
+    }
+
+    /// Adds an attribute to the module.
+    ///
+    /// For adding classes, functions or modules, prefer to use [`PyModule::add_class`],
+    /// [`PyModule::add_function`] or [`PyModule::add_submodule`] instead, respectively.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// #[pymodule]
+    /// fn my_module(module: &Bound<'_, PyModule>) -> PyResult<()> {
+    ///     module.add("c", 299_792_458)?;
+    ///     Ok(())
+    /// }
+    /// ```
+    ///
+    /// Python code can then do the following:
+    ///
+    /// ```python
+    /// from my_module import c
+    ///
+    /// print("c is", c)
+    /// ```
+    ///
+    /// This will result in the following output:
+    ///
+    /// ```text
+    /// c is 299792458
+    /// ```
+    pub fn add<V>(&self, name: &str, value: V) -> PyResult<()>
+    where
+        V: IntoPy<PyObject>,
+    {
+        self.as_borrowed().add(name, value)
+    }
+
+    /// Adds a new class to the module.
+    ///
+    /// Notice that this method does not take an argument.
+    /// Instead, this method is *generic*, and requires us to use the
+    /// "turbofish" syntax to specify the class we want to add.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// #[pyclass]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// #[pymodule]
+    /// fn my_module(module: &Bound<'_, PyModule>) -> PyResult<()> {
+    ///     module.add_class::<Foo>()?;
+    ///     Ok(())
+    /// }
+    ///  ```
+    ///
+    /// Python code can see this class as such:
+    /// ```python
+    /// from my_module import Foo
+    ///
+    /// print("Foo is", Foo)
+    /// ```
+    ///
+    /// This will result in the following output:
+    /// ```text
+    /// Foo is <class 'builtins.Foo'>
+    /// ```
+    ///
+    /// Note that as we haven't defined a [constructor][1], Python code can't actually
+    /// make an *instance* of `Foo` (or *get* one for that matter, as we haven't exported
+    /// anything that can return instances of `Foo`).
+    ///
+    #[doc = concat!("[1]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/class.html#constructor")]
+    pub fn add_class<T>(&self) -> PyResult<()>
+    where
+        T: PyClass,
+    {
+        self.as_borrowed().add_class::<T>()
+    }
+
+    /// Adds a function or a (sub)module to a module, using the functions name as name.
+    ///
+    /// Prefer to use [`PyModule::add_function`] and/or [`PyModule::add_submodule`] instead.
+    pub fn add_wrapped<'a, T>(&'a self, wrapper: &impl Fn(Python<'a>) -> T) -> PyResult<()>
+    where
+        T: IntoPyCallbackOutput<PyObject>,
+    {
+        self.as_borrowed().add_wrapped(wrapper)
+    }
+
+    /// Adds a submodule to a module.
+    ///
+    /// This is especially useful for creating module hierarchies.
+    ///
+    /// Note that this doesn't define a *package*, so this won't allow Python code
+    /// to directly import submodules by using
+    /// <span style="white-space: pre">`from my_module import submodule`</span>.
+    /// For more information, see [#759][1] and [#1517][2].
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// #[pymodule]
+    /// fn my_module(py: Python<'_>, module: &Bound<'_, PyModule>) -> PyResult<()> {
+    ///     let submodule = PyModule::new_bound(py, "submodule")?;
+    ///     submodule.add("super_useful_constant", "important")?;
+    ///
+    ///     module.add_submodule(&submodule)?;
+    ///     Ok(())
+    /// }
+    /// ```
+    ///
+    /// Python code can then do the following:
+    ///
+    /// ```python
+    /// import my_module
+    ///
+    /// print("super_useful_constant is", my_module.submodule.super_useful_constant)
+    /// ```
+    ///
+    /// This will result in the following output:
+    ///
+    /// ```text
+    /// super_useful_constant is important
+    /// ```
+    ///
+    /// [1]: https://github.com/PyO3/pyo3/issues/759
+    /// [2]: https://github.com/PyO3/pyo3/issues/1517#issuecomment-808664021
+    pub fn add_submodule(&self, module: &PyModule) -> PyResult<()> {
+        self.as_borrowed().add_submodule(&module.as_borrowed())
+    }
+
+    /// Add a function to a module.
+    ///
+    /// Note that this also requires the [`wrap_pyfunction!`][2] macro
+    /// to wrap a function annotated with [`#[pyfunction]`][1].
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// #[pyfunction]
+    /// fn say_hello() {
+    ///     println!("Hello world!")
+    /// }
+    /// #[pymodule]
+    /// fn my_module(module: &Bound<'_, PyModule>) -> PyResult<()> {
+    ///     module.add_function(wrap_pyfunction!(say_hello, module)?)
+    /// }
+    /// ```
+    ///
+    /// Python code can then do the following:
+    ///
+    /// ```python
+    /// from my_module import say_hello
+    ///
+    /// say_hello()
+    /// ```
+    ///
+    /// This will result in the following output:
+    ///
+    /// ```text
+    /// Hello world!
+    /// ```
+    ///
+    /// [1]: crate::prelude::pyfunction
+    /// [2]: crate::wrap_pyfunction
+    pub fn add_function<'a>(&'a self, fun: &'a PyCFunction) -> PyResult<()> {
+        let name = fun
+            .as_borrowed()
+            .getattr(__name__(self.py()))?
+            .downcast_into::<PyString>()?;
+        let name = name.to_cow()?;
+        self.add(&name, fun)
+    }
+}
+
+/// Implementation of functionality for [`PyModule`].
+///
+/// These methods are defined for the `Bound<'py, PyModule>` smart pointer, so to use method call
+/// syntax these methods are separated into a trait, because stable Rust does not yet support
+/// `arbitrary_self_types`.
+#[doc(alias = "PyModule")]
+pub trait PyModuleMethods<'py>: crate::sealed::Sealed {
+    /// Returns the module's `__dict__` attribute, which contains the module's symbol table.
+    fn dict(&self) -> Bound<'py, PyDict>;
+
+    /// Returns the index (the `__all__` attribute) of the module,
+    /// creating one if needed.
+    ///
+    /// `__all__` declares the items that will be imported with `from my_module import *`.
+    fn index(&self) -> PyResult<Bound<'py, PyList>>;
+
+    /// Returns the name (the `__name__` attribute) of the module.
+    ///
+    /// May fail if the module does not have a `__name__` attribute.
+    fn name(&self) -> PyResult<Bound<'py, PyString>>;
+
+    /// Returns the filename (the `__file__` attribute) of the module.
+    ///
+    /// May fail if the module does not have a `__file__` attribute.
+    fn filename(&self) -> PyResult<Bound<'py, PyString>>;
+
+    /// Adds an attribute to the module.
+    ///
+    /// For adding classes, functions or modules, prefer to use [`PyModuleMethods::add_class`],
+    /// [`PyModuleMethods::add_function`] or [`PyModuleMethods::add_submodule`] instead,
+    /// respectively.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// #[pymodule]
+    /// fn my_module(module: &Bound<'_, PyModule>) -> PyResult<()> {
+    ///     module.add("c", 299_792_458)?;
+    ///     Ok(())
+    /// }
+    /// ```
+    ///
+    /// Python code can then do the following:
+    ///
+    /// ```python
+    /// from my_module import c
+    ///
+    /// print("c is", c)
+    /// ```
+    ///
+    /// This will result in the following output:
+    ///
+    /// ```text
+    /// c is 299792458
+    /// ```
+    fn add<N, V>(&self, name: N, value: V) -> PyResult<()>
+    where
+        N: IntoPy<Py<PyString>>,
+        V: IntoPy<PyObject>;
+
+    /// Adds a new class to the module.
+    ///
+    /// Notice that this method does not take an argument.
+    /// Instead, this method is *generic*, and requires us to use the
+    /// "turbofish" syntax to specify the class we want to add.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// #[pyclass]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// #[pymodule]
+    /// fn my_module(module: &Bound<'_, PyModule>) -> PyResult<()> {
+    ///     module.add_class::<Foo>()?;
+    ///     Ok(())
+    /// }
+    ///  ```
+    ///
+    /// Python code can see this class as such:
+    /// ```python
+    /// from my_module import Foo
+    ///
+    /// print("Foo is", Foo)
+    /// ```
+    ///
+    /// This will result in the following output:
+    /// ```text
+    /// Foo is <class 'builtins.Foo'>
+    /// ```
+    ///
+    /// Note that as we haven't defined a [constructor][1], Python code can't actually
+    /// make an *instance* of `Foo` (or *get* one for that matter, as we haven't exported
+    /// anything that can return instances of `Foo`).
+    ///
+    #[doc = concat!("[1]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/class.html#constructor")]
+    fn add_class<T>(&self) -> PyResult<()>
+    where
+        T: PyClass;
+
+    /// Adds a function or a (sub)module to a module, using the functions name as name.
+    ///
+    /// Prefer to use [`PyModuleMethods::add_function`] and/or [`PyModuleMethods::add_submodule`]
+    /// instead.
+    fn add_wrapped<T>(&self, wrapper: &impl Fn(Python<'py>) -> T) -> PyResult<()>
+    where
+        T: IntoPyCallbackOutput<PyObject>;
+
+    /// Adds a submodule to a module.
+    ///
+    /// This is especially useful for creating module hierarchies.
+    ///
+    /// Note that this doesn't define a *package*, so this won't allow Python code
+    /// to directly import submodules by using
+    /// <span style="white-space: pre">`from my_module import submodule`</span>.
+    /// For more information, see [#759][1] and [#1517][2].
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// #[pymodule]
+    /// fn my_module(py: Python<'_>, module: &Bound<'_, PyModule>) -> PyResult<()> {
+    ///     let submodule = PyModule::new_bound(py, "submodule")?;
+    ///     submodule.add("super_useful_constant", "important")?;
+    ///
+    ///     module.add_submodule(&submodule)?;
+    ///     Ok(())
+    /// }
+    /// ```
+    ///
+    /// Python code can then do the following:
+    ///
+    /// ```python
+    /// import my_module
+    ///
+    /// print("super_useful_constant is", my_module.submodule.super_useful_constant)
+    /// ```
+    ///
+    /// This will result in the following output:
+    ///
+    /// ```text
+    /// super_useful_constant is important
+    /// ```
+    ///
+    /// [1]: https://github.com/PyO3/pyo3/issues/759
+    /// [2]: https://github.com/PyO3/pyo3/issues/1517#issuecomment-808664021
+    fn add_submodule(&self, module: &Bound<'_, PyModule>) -> PyResult<()>;
+
+    /// Add a function to a module.
+    ///
+    /// Note that this also requires the [`wrap_pyfunction!`][2] macro
+    /// to wrap a function annotated with [`#[pyfunction]`][1].
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// #[pyfunction]
+    /// fn say_hello() {
+    ///     println!("Hello world!")
+    /// }
+    /// #[pymodule]
+    /// fn my_module(module: &Bound<'_, PyModule>) -> PyResult<()> {
+    ///     module.add_function(wrap_pyfunction!(say_hello, module)?)
+    /// }
+    /// ```
+    ///
+    /// Python code can then do the following:
+    ///
+    /// ```python
+    /// from my_module import say_hello
+    ///
+    /// say_hello()
+    /// ```
+    ///
+    /// This will result in the following output:
+    ///
+    /// ```text
+    /// Hello world!
+    /// ```
+    ///
+    /// [1]: crate::prelude::pyfunction
+    /// [2]: crate::wrap_pyfunction
+    fn add_function(&self, fun: Bound<'_, PyCFunction>) -> PyResult<()>;
+}
+
+impl<'py> PyModuleMethods<'py> for Bound<'py, PyModule> {
+    fn dict(&self) -> Bound<'py, PyDict> {
+        unsafe {
+            // PyModule_GetDict returns borrowed ptr; must make owned for safety (see #890).
+            ffi::PyModule_GetDict(self.as_ptr())
+                .assume_borrowed(self.py())
+                .to_owned()
+                .downcast_into_unchecked()
+        }
+    }
+
+    fn index(&self) -> PyResult<Bound<'py, PyList>> {
+        let __all__ = __all__(self.py());
+        match self.getattr(__all__) {
+            Ok(idx) => idx.downcast_into().map_err(PyErr::from),
+            Err(err) => {
+                if err.is_instance_of::<exceptions::PyAttributeError>(self.py()) {
+                    let l = PyList::empty_bound(self.py());
+                    self.setattr(__all__, &l).map_err(PyErr::from)?;
+                    Ok(l)
+                } else {
+                    Err(err)
+                }
+            }
+        }
+    }
+
+    fn name(&self) -> PyResult<Bound<'py, PyString>> {
+        #[cfg(not(PyPy))]
+        {
+            unsafe {
+                ffi::PyModule_GetNameObject(self.as_ptr())
+                    .assume_owned_or_err(self.py())
+                    .downcast_into_unchecked()
+            }
+        }
+
+        #[cfg(PyPy)]
+        {
+            self.dict()
+                .get_item("__name__")
+                .map_err(|_| exceptions::PyAttributeError::new_err("__name__"))?
+                .downcast_into()
+                .map_err(PyErr::from)
+        }
+    }
+
+    fn filename(&self) -> PyResult<Bound<'py, PyString>> {
+        #[cfg(not(PyPy))]
+        unsafe {
+            ffi::PyModule_GetFilenameObject(self.as_ptr())
+                .assume_owned_or_err(self.py())
+                .downcast_into_unchecked()
+        }
+
+        #[cfg(PyPy)]
+        {
+            self.dict()
+                .get_item("__file__")
+                .map_err(|_| exceptions::PyAttributeError::new_err("__file__"))?
+                .downcast_into()
+                .map_err(PyErr::from)
+        }
+    }
+
+    fn add<N, V>(&self, name: N, value: V) -> PyResult<()>
+    where
+        N: IntoPy<Py<PyString>>,
+        V: IntoPy<PyObject>,
+    {
+        fn inner(
+            module: &Bound<'_, PyModule>,
+            name: Bound<'_, PyString>,
+            value: Bound<'_, PyAny>,
+        ) -> PyResult<()> {
+            module
+                .index()?
+                .append(&name)
+                .expect("could not append __name__ to __all__");
+            module.setattr(name, value.into_py(module.py()))
+        }
+
+        let py = self.py();
+        inner(
+            self,
+            name.into_py(py).into_bound(py),
+            value.into_py(py).into_bound(py),
+        )
+    }
+
+    fn add_class<T>(&self) -> PyResult<()>
+    where
+        T: PyClass,
+    {
+        let py = self.py();
+        self.add(T::NAME, T::lazy_type_object().get_or_try_init(py)?)
+    }
+
+    fn add_wrapped<T>(&self, wrapper: &impl Fn(Python<'py>) -> T) -> PyResult<()>
+    where
+        T: IntoPyCallbackOutput<PyObject>,
+    {
+        fn inner(module: &Bound<'_, PyModule>, object: Bound<'_, PyAny>) -> PyResult<()> {
+            let name = object.getattr(__name__(module.py()))?;
+            module.add(name.downcast_into::<PyString>()?, object)
+        }
+
+        let py = self.py();
+        inner(self, wrapper(py).convert(py)?.into_bound(py))
+    }
+
+    fn add_submodule(&self, module: &Bound<'_, PyModule>) -> PyResult<()> {
+        let name = module.name()?;
+        self.add(name, module)
+    }
+
+    fn add_function(&self, fun: Bound<'_, PyCFunction>) -> PyResult<()> {
+        let name = fun.getattr(__name__(self.py()))?;
+        self.add(name.downcast_into::<PyString>()?, fun)
+    }
+}
+
+fn __all__(py: Python<'_>) -> &Bound<'_, PyString> {
+    intern!(py, "__all__")
+}
+
+fn __name__(py: Python<'_>) -> &Bound<'_, PyString> {
+    intern!(py, "__name__")
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::{
+        types::{module::PyModuleMethods, PyModule},
+        Python,
+    };
+
+    #[test]
+    fn module_import_and_name() {
+        Python::with_gil(|py| {
+            let builtins = PyModule::import_bound(py, "builtins").unwrap();
+            assert_eq!(builtins.name().unwrap(), "builtins");
+        })
+    }
+
+    #[test]
+    fn module_filename() {
+        use crate::types::string::PyStringMethods;
+        Python::with_gil(|py| {
+            let site = PyModule::import_bound(py, "site").unwrap();
+            assert!(site
+                .filename()
+                .unwrap()
+                .to_cow()
+                .unwrap()
+                .ends_with("site.py"));
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/none.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/none.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/none.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/none.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,125 @@
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::{
+    ffi, types::any::PyAnyMethods, Borrowed, Bound, IntoPy, PyAny, PyObject, PyTypeInfo, Python,
+    ToPyObject,
+};
+
+/// Represents the Python `None` object.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyNone>`][crate::Py] or [`Bound<'py, PyNone>`][Bound].
+#[repr(transparent)]
+pub struct PyNone(PyAny);
+
+pyobject_native_type_named!(PyNone);
+pyobject_native_type_extract!(PyNone);
+
+impl PyNone {
+    /// Returns the `None` object.
+    /// Deprecated form of [`PyNone::get_bound`]
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyNone::get` will be replaced by `PyNone::get_bound` in a future PyO3 version"
+    )]
+    #[inline]
+    pub fn get(py: Python<'_>) -> &PyNone {
+        Self::get_bound(py).into_gil_ref()
+    }
+
+    /// Returns the `None` object.
+    #[inline]
+    pub fn get_bound(py: Python<'_>) -> Borrowed<'_, '_, PyNone> {
+        unsafe { ffi::Py_None().assume_borrowed(py).downcast_unchecked() }
+    }
+}
+
+unsafe impl PyTypeInfo for PyNone {
+    const NAME: &'static str = "NoneType";
+
+    const MODULE: Option<&'static str> = None;
+
+    fn type_object_raw(_py: Python<'_>) -> *mut ffi::PyTypeObject {
+        unsafe { ffi::Py_TYPE(ffi::Py_None()) }
+    }
+
+    #[inline]
+    fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool {
+        // NoneType is not usable as a base type
+        Self::is_exact_type_of_bound(object)
+    }
+
+    #[inline]
+    fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool {
+        object.is(&**Self::get_bound(object.py()))
+    }
+}
+
+/// `()` is converted to Python `None`.
+impl ToPyObject for () {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        PyNone::get_bound(py).into_py(py)
+    }
+}
+
+impl IntoPy<PyObject> for () {
+    #[inline]
+    fn into_py(self, py: Python<'_>) -> PyObject {
+        PyNone::get_bound(py).into_py(py)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::types::any::PyAnyMethods;
+    use crate::types::{PyDict, PyNone};
+    use crate::{IntoPy, PyObject, PyTypeInfo, Python, ToPyObject};
+    #[test]
+    fn test_none_is_itself() {
+        Python::with_gil(|py| {
+            assert!(PyNone::get_bound(py).is_instance_of::<PyNone>());
+            assert!(PyNone::get_bound(py).is_exact_instance_of::<PyNone>());
+        })
+    }
+
+    #[test]
+    fn test_none_type_object_consistent() {
+        Python::with_gil(|py| {
+            assert!(PyNone::get_bound(py)
+                .get_type()
+                .is(&PyNone::type_object_bound(py)));
+        })
+    }
+
+    #[test]
+    fn test_none_is_none() {
+        Python::with_gil(|py| {
+            assert!(PyNone::get_bound(py)
+                .downcast::<PyNone>()
+                .unwrap()
+                .is_none());
+        })
+    }
+
+    #[test]
+    fn test_unit_to_object_is_none() {
+        Python::with_gil(|py| {
+            assert!(().to_object(py).downcast_bound::<PyNone>(py).is_ok());
+        })
+    }
+
+    #[test]
+    fn test_unit_into_py_is_none() {
+        Python::with_gil(|py| {
+            let obj: PyObject = ().into_py(py);
+            assert!(obj.downcast_bound::<PyNone>(py).is_ok());
+        })
+    }
+
+    #[test]
+    fn test_dict_is_not_none() {
+        Python::with_gil(|py| {
+            assert!(PyDict::new_bound(py).downcast::<PyNone>().is_err());
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/notimplemented.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/notimplemented.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/notimplemented.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/notimplemented.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,90 @@
+use crate::{
+    ffi, ffi_ptr_ext::FfiPtrExt, types::any::PyAnyMethods, Borrowed, Bound, PyAny, PyTypeInfo,
+    Python,
+};
+
+/// Represents the Python `NotImplemented` object.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyNotImplemented>`][crate::Py] or [`Bound<'py, PyNotImplemented>`][Bound].
+#[repr(transparent)]
+pub struct PyNotImplemented(PyAny);
+
+pyobject_native_type_named!(PyNotImplemented);
+pyobject_native_type_extract!(PyNotImplemented);
+
+impl PyNotImplemented {
+    /// Returns the `NotImplemented` object.
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyNotImplemented::get` will be replaced by `PyNotImplemented::get_bound` in a future PyO3 version"
+    )]
+    #[inline]
+    pub fn get(py: Python<'_>) -> &PyNotImplemented {
+        Self::get_bound(py).into_gil_ref()
+    }
+
+    /// Returns the `NotImplemented` object.
+    #[inline]
+    pub fn get_bound(py: Python<'_>) -> Borrowed<'_, '_, PyNotImplemented> {
+        unsafe {
+            ffi::Py_NotImplemented()
+                .assume_borrowed(py)
+                .downcast_unchecked()
+        }
+    }
+}
+
+unsafe impl PyTypeInfo for PyNotImplemented {
+    const NAME: &'static str = "NotImplementedType";
+    const MODULE: Option<&'static str> = None;
+
+    fn type_object_raw(_py: Python<'_>) -> *mut ffi::PyTypeObject {
+        unsafe { ffi::Py_TYPE(ffi::Py_NotImplemented()) }
+    }
+
+    #[inline]
+    fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool {
+        // NotImplementedType is not usable as a base type
+        Self::is_exact_type_of_bound(object)
+    }
+
+    #[inline]
+    fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool {
+        object.is(&**Self::get_bound(object.py()))
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::types::any::PyAnyMethods;
+    use crate::types::{PyDict, PyNotImplemented};
+    use crate::{PyTypeInfo, Python};
+
+    #[test]
+    fn test_notimplemented_is_itself() {
+        Python::with_gil(|py| {
+            assert!(PyNotImplemented::get_bound(py).is_instance_of::<PyNotImplemented>());
+            assert!(PyNotImplemented::get_bound(py).is_exact_instance_of::<PyNotImplemented>());
+        })
+    }
+
+    #[test]
+    fn test_notimplemented_type_object_consistent() {
+        Python::with_gil(|py| {
+            assert!(PyNotImplemented::get_bound(py)
+                .get_type()
+                .is(&PyNotImplemented::type_object_bound(py)));
+        })
+    }
+
+    #[test]
+    fn test_dict_is_not_notimplemented() {
+        Python::with_gil(|py| {
+            assert!(PyDict::new_bound(py)
+                .downcast::<PyNotImplemented>()
+                .is_err());
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/num.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/num.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/num.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/num.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,15 @@
+use crate::{ffi, PyAny};
+
+/// Represents a Python `int` object.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyLong>`][crate::Py] or [`Bound<'py, PyLong>`][crate::Bound].
+///
+/// You can usually avoid directly working with this type
+/// by using [`ToPyObject`](crate::conversion::ToPyObject)
+/// and [`extract`](super::PyAnyMethods::extract)
+/// with the primitive Rust integer types.
+#[repr(transparent)]
+pub struct PyLong(PyAny);
+
+pyobject_native_type_core!(PyLong, pyobject_native_static_type_object!(ffi::PyLong_Type), #checkfunction=ffi::PyLong_Check);
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/pysuper.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/pysuper.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/pysuper.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/pysuper.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,82 @@
+use crate::instance::Bound;
+use crate::types::any::PyAnyMethods;
+use crate::types::PyType;
+use crate::{ffi, PyTypeInfo};
+use crate::{PyAny, PyResult};
+
+/// Represents a Python `super` object.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PySuper>`][crate::Py] or [`Bound<'py, PySuper>`][Bound].
+#[repr(transparent)]
+pub struct PySuper(PyAny);
+
+pyobject_native_type_core!(
+    PySuper,
+    pyobject_native_static_type_object!(ffi::PySuper_Type)
+);
+
+impl PySuper {
+    /// Deprecated form of `PySuper::new_bound`.
+    #[cfg(feature = "gil-refs")]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PySuper::new` will be replaced by `PySuper::new_bound` in a future PyO3 version"
+    )]
+    pub fn new<'py>(ty: &'py PyType, obj: &'py PyAny) -> PyResult<&'py PySuper> {
+        use crate::PyNativeType;
+        Self::new_bound(&ty.as_borrowed(), &obj.as_borrowed()).map(Bound::into_gil_ref)
+    }
+
+    /// Constructs a new super object. More read about super object: [docs](https://docs.python.org/3/library/functions.html#super)
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    ///
+    /// #[pyclass(subclass)]
+    /// struct BaseClass {
+    ///     val1: usize,
+    /// }
+    ///
+    /// #[pymethods]
+    /// impl BaseClass {
+    ///     #[new]
+    ///     fn new() -> Self {
+    ///         BaseClass { val1: 10 }
+    ///     }
+    ///
+    ///     pub fn method(&self) -> usize {
+    ///         self.val1
+    ///     }
+    /// }
+    ///
+    /// #[pyclass(extends=BaseClass)]
+    /// struct SubClass {}
+    ///
+    /// #[pymethods]
+    /// impl SubClass {
+    ///     #[new]
+    ///     fn new() -> (Self, BaseClass) {
+    ///         (SubClass {}, BaseClass::new())
+    ///     }
+    ///
+    ///     fn method<'py>(self_: &Bound<'py, Self>) -> PyResult<Bound<'py, PyAny>> {
+    ///         let super_ = self_.py_super()?;
+    ///         super_.call_method("method", (), None)
+    ///     }
+    /// }
+    /// ```
+    pub fn new_bound<'py>(
+        ty: &Bound<'py, PyType>,
+        obj: &Bound<'py, PyAny>,
+    ) -> PyResult<Bound<'py, PySuper>> {
+        PySuper::type_object_bound(ty.py())
+            .call1((ty, obj))
+            .map(|any| {
+                // Safety: super() always returns instance of super
+                unsafe { any.downcast_into_unchecked() }
+            })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/sequence.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/sequence.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/sequence.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/sequence.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1122 @@
+use crate::err::{self, DowncastError, PyErr, PyResult};
+use crate::exceptions::PyTypeError;
+use crate::ffi_ptr_ext::FfiPtrExt;
+#[cfg(feature = "experimental-inspect")]
+use crate::inspect::types::TypeInfo;
+use crate::instance::Bound;
+use crate::internal_tricks::get_ssize_index;
+use crate::py_result_ext::PyResultExt;
+use crate::sync::GILOnceCell;
+use crate::type_object::PyTypeInfo;
+use crate::types::{any::PyAnyMethods, PyAny, PyList, PyString, PyTuple, PyType};
+#[cfg(feature = "gil-refs")]
+use crate::{err::PyDowncastError, PyNativeType};
+use crate::{ffi, FromPyObject, Py, PyTypeCheck, Python, ToPyObject};
+
+/// Represents a reference to a Python object supporting the sequence protocol.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PySequence>`][crate::Py] or [`Bound<'py, PySequence>`][Bound].
+///
+/// For APIs available on sequence objects, see the [`PySequenceMethods`] trait which is implemented for
+/// [`Bound<'py, PySequence>`][Bound].
+#[repr(transparent)]
+pub struct PySequence(PyAny);
+pyobject_native_type_named!(PySequence);
+pyobject_native_type_extract!(PySequence);
+
+impl PySequence {
+    /// Register a pyclass as a subclass of `collections.abc.Sequence` (from the Python standard
+    /// library). This is equivalent to `collections.abc.Sequence.register(T)` in Python.
+    /// This registration is required for a pyclass to be downcastable from `PyAny` to `PySequence`.
+    pub fn register<T: PyTypeInfo>(py: Python<'_>) -> PyResult<()> {
+        let ty = T::type_object_bound(py);
+        get_sequence_abc(py)?.call_method1("register", (ty,))?;
+        Ok(())
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PySequence {
+    /// Returns the number of objects in sequence.
+    ///
+    /// This is equivalent to the Python expression `len(self)`.
+    #[inline]
+    pub fn len(&self) -> PyResult<usize> {
+        self.as_borrowed().len()
+    }
+
+    /// Returns whether the sequence is empty.
+    #[inline]
+    pub fn is_empty(&self) -> PyResult<bool> {
+        self.as_borrowed().is_empty()
+    }
+
+    /// Returns the concatenation of `self` and `other`.
+    ///
+    /// This is equivalent to the Python expression `self + other`.
+    #[inline]
+    pub fn concat(&self, other: &PySequence) -> PyResult<&PySequence> {
+        self.as_borrowed()
+            .concat(&other.as_borrowed())
+            .map(Bound::into_gil_ref)
+    }
+
+    /// Returns the result of repeating a sequence object `count` times.
+    ///
+    /// This is equivalent to the Python expression `self * count`.
+    #[inline]
+    pub fn repeat(&self, count: usize) -> PyResult<&PySequence> {
+        self.as_borrowed().repeat(count).map(Bound::into_gil_ref)
+    }
+
+    /// Concatenates `self` and `other`, in place if possible.
+    ///
+    /// This is equivalent to the Python expression `self.__iadd__(other)`.
+    ///
+    /// The Python statement `self += other` is syntactic sugar for `self =
+    /// self.__iadd__(other)`.  `__iadd__` should modify and return `self` if
+    /// possible, but create and return a new object if not.
+    #[inline]
+    pub fn in_place_concat(&self, other: &PySequence) -> PyResult<&PySequence> {
+        self.as_borrowed()
+            .in_place_concat(&other.as_borrowed())
+            .map(Bound::into_gil_ref)
+    }
+
+    /// Repeats the sequence object `count` times and updates `self`, if possible.
+    ///
+    /// This is equivalent to the Python expression `self.__imul__(other)`.
+    ///
+    /// The Python statement `self *= other` is syntactic sugar for `self =
+    /// self.__imul__(other)`.  `__imul__` should modify and return `self` if
+    /// possible, but create and return a new object if not.
+    #[inline]
+    pub fn in_place_repeat(&self, count: usize) -> PyResult<&PySequence> {
+        self.as_borrowed()
+            .in_place_repeat(count)
+            .map(Bound::into_gil_ref)
+    }
+
+    /// Returns the `index`th element of the Sequence.
+    ///
+    /// This is equivalent to the Python expression `self[index]` without support of negative indices.
+    #[inline]
+    pub fn get_item(&self, index: usize) -> PyResult<&PyAny> {
+        self.as_borrowed().get_item(index).map(Bound::into_gil_ref)
+    }
+
+    /// Returns the slice of sequence object between `begin` and `end`.
+    ///
+    /// This is equivalent to the Python expression `self[begin:end]`.
+    #[inline]
+    pub fn get_slice(&self, begin: usize, end: usize) -> PyResult<&PySequence> {
+        self.as_borrowed()
+            .get_slice(begin, end)
+            .map(Bound::into_gil_ref)
+    }
+
+    /// Assigns object `item` to the `i`th element of self.
+    ///
+    /// This is equivalent to the Python statement `self[i] = v`.
+    #[inline]
+    pub fn set_item<I>(&self, i: usize, item: I) -> PyResult<()>
+    where
+        I: ToPyObject,
+    {
+        self.as_borrowed().set_item(i, item)
+    }
+
+    /// Deletes the `i`th element of self.
+    ///
+    /// This is equivalent to the Python statement `del self[i]`.
+    #[inline]
+    pub fn del_item(&self, i: usize) -> PyResult<()> {
+        self.as_borrowed().del_item(i)
+    }
+
+    /// Assigns the sequence `v` to the slice of `self` from `i1` to `i2`.
+    ///
+    /// This is equivalent to the Python statement `self[i1:i2] = v`.
+    #[inline]
+    pub fn set_slice(&self, i1: usize, i2: usize, v: &PyAny) -> PyResult<()> {
+        self.as_borrowed().set_slice(i1, i2, &v.as_borrowed())
+    }
+
+    /// Deletes the slice from `i1` to `i2` from `self`.
+    ///
+    /// This is equivalent to the Python statement `del self[i1:i2]`.
+    #[inline]
+    pub fn del_slice(&self, i1: usize, i2: usize) -> PyResult<()> {
+        self.as_borrowed().del_slice(i1, i2)
+    }
+
+    /// Returns the number of occurrences of `value` in self, that is, return the
+    /// number of keys for which `self[key] == value`.
+    #[inline]
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn count<V>(&self, value: V) -> PyResult<usize>
+    where
+        V: ToPyObject,
+    {
+        self.as_borrowed().count(value)
+    }
+
+    /// Determines if self contains `value`.
+    ///
+    /// This is equivalent to the Python expression `value in self`.
+    #[inline]
+    pub fn contains<V>(&self, value: V) -> PyResult<bool>
+    where
+        V: ToPyObject,
+    {
+        self.as_borrowed().contains(value)
+    }
+
+    /// Returns the first index `i` for which `self[i] == value`.
+    ///
+    /// This is equivalent to the Python expression `self.index(value)`.
+    #[inline]
+    pub fn index<V>(&self, value: V) -> PyResult<usize>
+    where
+        V: ToPyObject,
+    {
+        self.as_borrowed().index(value)
+    }
+
+    /// Returns a fresh list based on the Sequence.
+    #[inline]
+    pub fn to_list(&self) -> PyResult<&PyList> {
+        self.as_borrowed().to_list().map(Bound::into_gil_ref)
+    }
+
+    /// Returns a fresh tuple based on the Sequence.
+    #[inline]
+    pub fn to_tuple(&self) -> PyResult<&PyTuple> {
+        self.as_borrowed().to_tuple().map(Bound::into_gil_ref)
+    }
+}
+
+/// Implementation of functionality for [`PySequence`].
+///
+/// These methods are defined for the `Bound<'py, PySequence>` smart pointer, so to use method call
+/// syntax these methods are separated into a trait, because stable Rust does not yet support
+/// `arbitrary_self_types`.
+#[doc(alias = "PySequence")]
+pub trait PySequenceMethods<'py>: crate::sealed::Sealed {
+    /// Returns the number of objects in sequence.
+    ///
+    /// This is equivalent to the Python expression `len(self)`.
+    fn len(&self) -> PyResult<usize>;
+
+    /// Returns whether the sequence is empty.
+    fn is_empty(&self) -> PyResult<bool>;
+
+    /// Returns the concatenation of `self` and `other`.
+    ///
+    /// This is equivalent to the Python expression `self + other`.
+    fn concat(&self, other: &Bound<'_, PySequence>) -> PyResult<Bound<'py, PySequence>>;
+
+    /// Returns the result of repeating a sequence object `count` times.
+    ///
+    /// This is equivalent to the Python expression `self * count`.
+    fn repeat(&self, count: usize) -> PyResult<Bound<'py, PySequence>>;
+
+    /// Concatenates `self` and `other`, in place if possible.
+    ///
+    /// This is equivalent to the Python expression `self.__iadd__(other)`.
+    ///
+    /// The Python statement `self += other` is syntactic sugar for `self =
+    /// self.__iadd__(other)`.  `__iadd__` should modify and return `self` if
+    /// possible, but create and return a new object if not.
+    fn in_place_concat(&self, other: &Bound<'_, PySequence>) -> PyResult<Bound<'py, PySequence>>;
+
+    /// Repeats the sequence object `count` times and updates `self`, if possible.
+    ///
+    /// This is equivalent to the Python expression `self.__imul__(other)`.
+    ///
+    /// The Python statement `self *= other` is syntactic sugar for `self =
+    /// self.__imul__(other)`.  `__imul__` should modify and return `self` if
+    /// possible, but create and return a new object if not.
+    fn in_place_repeat(&self, count: usize) -> PyResult<Bound<'py, PySequence>>;
+
+    /// Returns the `index`th element of the Sequence.
+    ///
+    /// This is equivalent to the Python expression `self[index]` without support of negative indices.
+    fn get_item(&self, index: usize) -> PyResult<Bound<'py, PyAny>>;
+
+    /// Returns the slice of sequence object between `begin` and `end`.
+    ///
+    /// This is equivalent to the Python expression `self[begin:end]`.
+    fn get_slice(&self, begin: usize, end: usize) -> PyResult<Bound<'py, PySequence>>;
+
+    /// Assigns object `item` to the `i`th element of self.
+    ///
+    /// This is equivalent to the Python statement `self[i] = v`.
+    fn set_item<I>(&self, i: usize, item: I) -> PyResult<()>
+    where
+        I: ToPyObject;
+
+    /// Deletes the `i`th element of self.
+    ///
+    /// This is equivalent to the Python statement `del self[i]`.
+    fn del_item(&self, i: usize) -> PyResult<()>;
+
+    /// Assigns the sequence `v` to the slice of `self` from `i1` to `i2`.
+    ///
+    /// This is equivalent to the Python statement `self[i1:i2] = v`.
+    fn set_slice(&self, i1: usize, i2: usize, v: &Bound<'_, PyAny>) -> PyResult<()>;
+
+    /// Deletes the slice from `i1` to `i2` from `self`.
+    ///
+    /// This is equivalent to the Python statement `del self[i1:i2]`.
+    fn del_slice(&self, i1: usize, i2: usize) -> PyResult<()>;
+
+    /// Returns the number of occurrences of `value` in self, that is, return the
+    /// number of keys for which `self[key] == value`.
+    #[cfg(not(PyPy))]
+    fn count<V>(&self, value: V) -> PyResult<usize>
+    where
+        V: ToPyObject;
+
+    /// Determines if self contains `value`.
+    ///
+    /// This is equivalent to the Python expression `value in self`.
+    fn contains<V>(&self, value: V) -> PyResult<bool>
+    where
+        V: ToPyObject;
+
+    /// Returns the first index `i` for which `self[i] == value`.
+    ///
+    /// This is equivalent to the Python expression `self.index(value)`.
+    fn index<V>(&self, value: V) -> PyResult<usize>
+    where
+        V: ToPyObject;
+
+    /// Returns a fresh list based on the Sequence.
+    fn to_list(&self) -> PyResult<Bound<'py, PyList>>;
+
+    /// Returns a fresh tuple based on the Sequence.
+    fn to_tuple(&self) -> PyResult<Bound<'py, PyTuple>>;
+}
+
+impl<'py> PySequenceMethods<'py> for Bound<'py, PySequence> {
+    #[inline]
+    fn len(&self) -> PyResult<usize> {
+        let v = unsafe { ffi::PySequence_Size(self.as_ptr()) };
+        crate::err::error_on_minusone(self.py(), v)?;
+        Ok(v as usize)
+    }
+
+    #[inline]
+    fn is_empty(&self) -> PyResult<bool> {
+        self.len().map(|l| l == 0)
+    }
+
+    #[inline]
+    fn concat(&self, other: &Bound<'_, PySequence>) -> PyResult<Bound<'py, PySequence>> {
+        unsafe {
+            ffi::PySequence_Concat(self.as_ptr(), other.as_ptr())
+                .assume_owned_or_err(self.py())
+                .downcast_into_unchecked()
+        }
+    }
+
+    #[inline]
+    fn repeat(&self, count: usize) -> PyResult<Bound<'py, PySequence>> {
+        unsafe {
+            ffi::PySequence_Repeat(self.as_ptr(), get_ssize_index(count))
+                .assume_owned_or_err(self.py())
+                .downcast_into_unchecked()
+        }
+    }
+
+    #[inline]
+    fn in_place_concat(&self, other: &Bound<'_, PySequence>) -> PyResult<Bound<'py, PySequence>> {
+        unsafe {
+            ffi::PySequence_InPlaceConcat(self.as_ptr(), other.as_ptr())
+                .assume_owned_or_err(self.py())
+                .downcast_into_unchecked()
+        }
+    }
+
+    #[inline]
+    fn in_place_repeat(&self, count: usize) -> PyResult<Bound<'py, PySequence>> {
+        unsafe {
+            ffi::PySequence_InPlaceRepeat(self.as_ptr(), get_ssize_index(count))
+                .assume_owned_or_err(self.py())
+                .downcast_into_unchecked()
+        }
+    }
+
+    #[inline]
+    fn get_item(&self, index: usize) -> PyResult<Bound<'py, PyAny>> {
+        unsafe {
+            ffi::PySequence_GetItem(self.as_ptr(), get_ssize_index(index))
+                .assume_owned_or_err(self.py())
+        }
+    }
+
+    #[inline]
+    fn get_slice(&self, begin: usize, end: usize) -> PyResult<Bound<'py, PySequence>> {
+        unsafe {
+            ffi::PySequence_GetSlice(self.as_ptr(), get_ssize_index(begin), get_ssize_index(end))
+                .assume_owned_or_err(self.py())
+                .downcast_into_unchecked()
+        }
+    }
+
+    #[inline]
+    fn set_item<I>(&self, i: usize, item: I) -> PyResult<()>
+    where
+        I: ToPyObject,
+    {
+        fn inner(seq: &Bound<'_, PySequence>, i: usize, item: Bound<'_, PyAny>) -> PyResult<()> {
+            err::error_on_minusone(seq.py(), unsafe {
+                ffi::PySequence_SetItem(seq.as_ptr(), get_ssize_index(i), item.as_ptr())
+            })
+        }
+
+        let py = self.py();
+        inner(self, i, item.to_object(py).into_bound(py))
+    }
+
+    #[inline]
+    fn del_item(&self, i: usize) -> PyResult<()> {
+        err::error_on_minusone(self.py(), unsafe {
+            ffi::PySequence_DelItem(self.as_ptr(), get_ssize_index(i))
+        })
+    }
+
+    #[inline]
+    fn set_slice(&self, i1: usize, i2: usize, v: &Bound<'_, PyAny>) -> PyResult<()> {
+        err::error_on_minusone(self.py(), unsafe {
+            ffi::PySequence_SetSlice(
+                self.as_ptr(),
+                get_ssize_index(i1),
+                get_ssize_index(i2),
+                v.as_ptr(),
+            )
+        })
+    }
+
+    #[inline]
+    fn del_slice(&self, i1: usize, i2: usize) -> PyResult<()> {
+        err::error_on_minusone(self.py(), unsafe {
+            ffi::PySequence_DelSlice(self.as_ptr(), get_ssize_index(i1), get_ssize_index(i2))
+        })
+    }
+
+    #[inline]
+    #[cfg(not(PyPy))]
+    fn count<V>(&self, value: V) -> PyResult<usize>
+    where
+        V: ToPyObject,
+    {
+        fn inner(seq: &Bound<'_, PySequence>, value: Bound<'_, PyAny>) -> PyResult<usize> {
+            let r = unsafe { ffi::PySequence_Count(seq.as_ptr(), value.as_ptr()) };
+            crate::err::error_on_minusone(seq.py(), r)?;
+            Ok(r as usize)
+        }
+
+        let py = self.py();
+        inner(self, value.to_object(py).into_bound(py))
+    }
+
+    #[inline]
+    fn contains<V>(&self, value: V) -> PyResult<bool>
+    where
+        V: ToPyObject,
+    {
+        fn inner(seq: &Bound<'_, PySequence>, value: Bound<'_, PyAny>) -> PyResult<bool> {
+            let r = unsafe { ffi::PySequence_Contains(seq.as_ptr(), value.as_ptr()) };
+            match r {
+                0 => Ok(false),
+                1 => Ok(true),
+                _ => Err(PyErr::fetch(seq.py())),
+            }
+        }
+
+        let py = self.py();
+        inner(self, value.to_object(py).into_bound(py))
+    }
+
+    #[inline]
+    fn index<V>(&self, value: V) -> PyResult<usize>
+    where
+        V: ToPyObject,
+    {
+        fn inner(seq: &Bound<'_, PySequence>, value: Bound<'_, PyAny>) -> PyResult<usize> {
+            let r = unsafe { ffi::PySequence_Index(seq.as_ptr(), value.as_ptr()) };
+            crate::err::error_on_minusone(seq.py(), r)?;
+            Ok(r as usize)
+        }
+
+        let py = self.py();
+        inner(self, value.to_object(self.py()).into_bound(py))
+    }
+
+    #[inline]
+    fn to_list(&self) -> PyResult<Bound<'py, PyList>> {
+        unsafe {
+            ffi::PySequence_List(self.as_ptr())
+                .assume_owned_or_err(self.py())
+                .downcast_into_unchecked()
+        }
+    }
+
+    #[inline]
+    fn to_tuple(&self) -> PyResult<Bound<'py, PyTuple>> {
+        unsafe {
+            ffi::PySequence_Tuple(self.as_ptr())
+                .assume_owned_or_err(self.py())
+                .downcast_into_unchecked()
+        }
+    }
+}
+
+#[inline]
+#[cfg(feature = "gil-refs")]
+fn sequence_len(seq: &PySequence) -> usize {
+    seq.len().expect("failed to get sequence length")
+}
+
+#[inline]
+#[cfg(feature = "gil-refs")]
+fn sequence_slice(seq: &PySequence, start: usize, end: usize) -> &PySequence {
+    seq.get_slice(start, end)
+        .expect("sequence slice operation failed")
+}
+
+#[cfg(feature = "gil-refs")]
+index_impls!(PySequence, "sequence", sequence_len, sequence_slice);
+
+impl<'py, T> FromPyObject<'py> for Vec<T>
+where
+    T: FromPyObject<'py>,
+{
+    fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self> {
+        if obj.is_instance_of::<PyString>() {
+            return Err(PyTypeError::new_err("Can't extract `str` to `Vec`"));
+        }
+        extract_sequence(obj)
+    }
+
+    #[cfg(feature = "experimental-inspect")]
+    fn type_input() -> TypeInfo {
+        TypeInfo::sequence_of(T::type_input())
+    }
+}
+
+fn extract_sequence<'py, T>(obj: &Bound<'py, PyAny>) -> PyResult<Vec<T>>
+where
+    T: FromPyObject<'py>,
+{
+    // Types that pass `PySequence_Check` usually implement enough of the sequence protocol
+    // to support this function and if not, we will only fail extraction safely.
+    let seq = unsafe {
+        if ffi::PySequence_Check(obj.as_ptr()) != 0 {
+            obj.downcast_unchecked::<PySequence>()
+        } else {
+            return Err(DowncastError::new(obj, "Sequence").into());
+        }
+    };
+
+    let mut v = Vec::with_capacity(seq.len().unwrap_or(0));
+    for item in seq.iter()? {
+        v.push(item?.extract::<T>()?);
+    }
+    Ok(v)
+}
+
+fn get_sequence_abc(py: Python<'_>) -> PyResult<&Bound<'_, PyType>> {
+    static SEQUENCE_ABC: GILOnceCell<Py<PyType>> = GILOnceCell::new();
+
+    SEQUENCE_ABC.get_or_try_init_type_ref(py, "collections.abc", "Sequence")
+}
+
+impl PyTypeCheck for PySequence {
+    const NAME: &'static str = "Sequence";
+
+    #[inline]
+    fn type_check(object: &Bound<'_, PyAny>) -> bool {
+        // Using `is_instance` for `collections.abc.Sequence` is slow, so provide
+        // optimized cases for list and tuples as common well-known sequences
+        PyList::is_type_of_bound(object)
+            || PyTuple::is_type_of_bound(object)
+            || get_sequence_abc(object.py())
+                .and_then(|abc| object.is_instance(abc))
+                .unwrap_or_else(|err| {
+                    err.write_unraisable_bound(object.py(), Some(&object.as_borrowed()));
+                    false
+                })
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+impl<'v> crate::PyTryFrom<'v> for PySequence {
+    /// Downcasting to `PySequence` requires the concrete class to be a subclass (or registered
+    /// subclass) of `collections.abc.Sequence` (from the Python standard library) - i.e.
+    /// `isinstance(<class>, collections.abc.Sequence) == True`.
+    fn try_from<V: Into<&'v PyAny>>(value: V) -> Result<&'v PySequence, PyDowncastError<'v>> {
+        let value = value.into();
+
+        if PySequence::type_check(&value.as_borrowed()) {
+            unsafe { return Ok(value.downcast_unchecked::<PySequence>()) }
+        }
+
+        Err(PyDowncastError::new(value, "Sequence"))
+    }
+
+    fn try_from_exact<V: Into<&'v PyAny>>(value: V) -> Result<&'v PySequence, PyDowncastError<'v>> {
+        value.into().downcast()
+    }
+
+    #[inline]
+    unsafe fn try_from_unchecked<V: Into<&'v PyAny>>(value: V) -> &'v PySequence {
+        let ptr = value.into() as *const _ as *const PySequence;
+        &*ptr
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::types::{PyAnyMethods, PyList, PySequence, PySequenceMethods, PyTuple};
+    use crate::{PyObject, Python, ToPyObject};
+
+    fn get_object() -> PyObject {
+        // Convenience function for getting a single unique object
+        Python::with_gil(|py| {
+            let obj = py.eval_bound("object()", None, None).unwrap();
+
+            obj.to_object(py)
+        })
+    }
+
+    #[test]
+    fn test_numbers_are_not_sequences() {
+        Python::with_gil(|py| {
+            let v = 42i32;
+            assert!(v.to_object(py).downcast_bound::<PySequence>(py).is_err());
+        });
+    }
+
+    #[test]
+    fn test_strings_are_sequences() {
+        Python::with_gil(|py| {
+            let v = "London Calling";
+            assert!(v.to_object(py).downcast_bound::<PySequence>(py).is_ok());
+        });
+    }
+
+    #[test]
+    fn test_strings_cannot_be_extracted_to_vec() {
+        Python::with_gil(|py| {
+            let v = "London Calling";
+            let ob = v.to_object(py);
+
+            assert!(ob.extract::<Vec<String>>(py).is_err());
+            assert!(ob.extract::<Vec<char>>(py).is_err());
+        });
+    }
+
+    #[test]
+    fn test_seq_empty() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![];
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            assert_eq!(0, seq.len().unwrap());
+
+            let needle = 7i32.to_object(py);
+            assert!(!seq.contains(&needle).unwrap());
+        });
+    }
+
+    #[test]
+    fn test_seq_is_empty() {
+        Python::with_gil(|py| {
+            let list = vec![1].to_object(py);
+            let seq = list.downcast_bound::<PySequence>(py).unwrap();
+            assert!(!seq.is_empty().unwrap());
+            let vec: Vec<u32> = Vec::new();
+            let empty_list = vec.to_object(py);
+            let empty_seq = empty_list.downcast_bound::<PySequence>(py).unwrap();
+            assert!(empty_seq.is_empty().unwrap());
+        });
+    }
+
+    #[test]
+    fn test_seq_contains() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![1, 1, 2, 3, 5, 8];
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            assert_eq!(6, seq.len().unwrap());
+
+            let bad_needle = 7i32.to_object(py);
+            assert!(!seq.contains(&bad_needle).unwrap());
+
+            let good_needle = 8i32.to_object(py);
+            assert!(seq.contains(&good_needle).unwrap());
+
+            let type_coerced_needle = 8f32.to_object(py);
+            assert!(seq.contains(&type_coerced_needle).unwrap());
+        });
+    }
+
+    #[test]
+    fn test_seq_get_item() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![1, 1, 2, 3, 5, 8];
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            assert_eq!(1, seq.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert_eq!(1, seq.get_item(1).unwrap().extract::<i32>().unwrap());
+            assert_eq!(2, seq.get_item(2).unwrap().extract::<i32>().unwrap());
+            assert_eq!(3, seq.get_item(3).unwrap().extract::<i32>().unwrap());
+            assert_eq!(5, seq.get_item(4).unwrap().extract::<i32>().unwrap());
+            assert_eq!(8, seq.get_item(5).unwrap().extract::<i32>().unwrap());
+            assert!(seq.get_item(10).is_err());
+        });
+    }
+
+    #[test]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_seq_index_trait() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![1, 1, 2];
+            let ob = v.to_object(py);
+            let seq = ob.downcast::<PySequence>(py).unwrap();
+            assert_eq!(1, seq[0].extract::<i32>().unwrap());
+            assert_eq!(1, seq[1].extract::<i32>().unwrap());
+            assert_eq!(2, seq[2].extract::<i32>().unwrap());
+        });
+    }
+
+    #[test]
+    #[should_panic = "index 7 out of range for sequence"]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_seq_index_trait_panic() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![1, 1, 2];
+            let ob = v.to_object(py);
+            let seq = ob.downcast::<PySequence>(py).unwrap();
+            let _ = &seq[7];
+        });
+    }
+
+    #[test]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_seq_index_trait_ranges() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![1, 1, 2];
+            let ob = v.to_object(py);
+            let seq = ob.downcast::<PySequence>(py).unwrap();
+            assert_eq!(vec![1, 2], seq[1..3].extract::<Vec<i32>>().unwrap());
+            assert_eq!(Vec::<i32>::new(), seq[3..3].extract::<Vec<i32>>().unwrap());
+            assert_eq!(vec![1, 2], seq[1..].extract::<Vec<i32>>().unwrap());
+            assert_eq!(Vec::<i32>::new(), seq[3..].extract::<Vec<i32>>().unwrap());
+            assert_eq!(vec![1, 1, 2], seq[..].extract::<Vec<i32>>().unwrap());
+            assert_eq!(vec![1, 2], seq[1..=2].extract::<Vec<i32>>().unwrap());
+            assert_eq!(vec![1, 1], seq[..2].extract::<Vec<i32>>().unwrap());
+            assert_eq!(vec![1, 1], seq[..=1].extract::<Vec<i32>>().unwrap());
+        })
+    }
+
+    #[test]
+    #[should_panic = "range start index 5 out of range for sequence of length 3"]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_seq_index_trait_range_panic_start() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![1, 1, 2];
+            let ob = v.to_object(py);
+            let seq = ob.downcast::<PySequence>(py).unwrap();
+            seq[5..10].extract::<Vec<i32>>().unwrap();
+        })
+    }
+
+    #[test]
+    #[should_panic = "range end index 10 out of range for sequence of length 3"]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_seq_index_trait_range_panic_end() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![1, 1, 2];
+            let ob = v.to_object(py);
+            let seq = ob.downcast::<PySequence>(py).unwrap();
+            seq[1..10].extract::<Vec<i32>>().unwrap();
+        })
+    }
+
+    #[test]
+    #[should_panic = "slice index starts at 2 but ends at 1"]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_seq_index_trait_range_panic_wrong_order() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![1, 1, 2];
+            let ob = v.to_object(py);
+            let seq = ob.downcast::<PySequence>(py).unwrap();
+            #[allow(clippy::reversed_empty_ranges)]
+            seq[2..1].extract::<Vec<i32>>().unwrap();
+        })
+    }
+
+    #[test]
+    #[should_panic = "range start index 8 out of range for sequence of length 3"]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_seq_index_trait_range_from_panic() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![1, 1, 2];
+            let ob = v.to_object(py);
+            let seq = ob.downcast::<PySequence>(py).unwrap();
+            seq[8..].extract::<Vec<i32>>().unwrap();
+        })
+    }
+
+    #[test]
+    fn test_seq_del_item() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![1, 1, 2, 3, 5, 8];
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            assert!(seq.del_item(10).is_err());
+            assert_eq!(1, seq.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert!(seq.del_item(0).is_ok());
+            assert_eq!(1, seq.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert!(seq.del_item(0).is_ok());
+            assert_eq!(2, seq.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert!(seq.del_item(0).is_ok());
+            assert_eq!(3, seq.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert!(seq.del_item(0).is_ok());
+            assert_eq!(5, seq.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert!(seq.del_item(0).is_ok());
+            assert_eq!(8, seq.get_item(0).unwrap().extract::<i32>().unwrap());
+            assert!(seq.del_item(0).is_ok());
+            assert_eq!(0, seq.len().unwrap());
+            assert!(seq.del_item(0).is_err());
+        });
+    }
+
+    #[test]
+    fn test_seq_set_item() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![1, 2];
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            assert_eq!(2, seq.get_item(1).unwrap().extract::<i32>().unwrap());
+            assert!(seq.set_item(1, 10).is_ok());
+            assert_eq!(10, seq.get_item(1).unwrap().extract::<i32>().unwrap());
+        });
+    }
+
+    #[test]
+    fn test_seq_set_item_refcnt() {
+        let obj = get_object();
+
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![1, 2];
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            assert!(seq.set_item(1, &obj).is_ok());
+            assert!(seq.get_item(1).unwrap().as_ptr() == obj.as_ptr());
+        });
+
+        Python::with_gil(move |py| {
+            assert_eq!(1, obj.get_refcnt(py));
+        });
+    }
+
+    #[test]
+    fn test_seq_get_slice() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![1, 1, 2, 3, 5, 8];
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            assert_eq!(
+                [1, 2, 3],
+                seq.get_slice(1, 4).unwrap().extract::<[i32; 3]>().unwrap()
+            );
+            assert_eq!(
+                [3, 5, 8],
+                seq.get_slice(3, 100)
+                    .unwrap()
+                    .extract::<[i32; 3]>()
+                    .unwrap()
+            );
+        });
+    }
+
+    #[test]
+    fn test_set_slice() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![1, 1, 2, 3, 5, 8];
+            let w: Vec<i32> = vec![7, 4];
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            let ins = w.to_object(py);
+            seq.set_slice(1, 4, ins.bind(py)).unwrap();
+            assert_eq!([1, 7, 4, 5, 8], seq.extract::<[i32; 5]>().unwrap());
+            seq.set_slice(3, 100, &PyList::empty_bound(py)).unwrap();
+            assert_eq!([1, 7, 4], seq.extract::<[i32; 3]>().unwrap());
+        });
+    }
+
+    #[test]
+    fn test_del_slice() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![1, 1, 2, 3, 5, 8];
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            seq.del_slice(1, 4).unwrap();
+            assert_eq!([1, 5, 8], seq.extract::<[i32; 3]>().unwrap());
+            seq.del_slice(1, 100).unwrap();
+            assert_eq!([1], seq.extract::<[i32; 1]>().unwrap());
+        });
+    }
+
+    #[test]
+    fn test_seq_index() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![1, 1, 2, 3, 5, 8];
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            assert_eq!(0, seq.index(1i32).unwrap());
+            assert_eq!(2, seq.index(2i32).unwrap());
+            assert_eq!(3, seq.index(3i32).unwrap());
+            assert_eq!(4, seq.index(5i32).unwrap());
+            assert_eq!(5, seq.index(8i32).unwrap());
+            assert!(seq.index(42i32).is_err());
+        });
+    }
+
+    #[test]
+    #[cfg(not(any(PyPy, GraalPy)))]
+    fn test_seq_count() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![1, 1, 2, 3, 5, 8];
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            assert_eq!(2, seq.count(1i32).unwrap());
+            assert_eq!(1, seq.count(2i32).unwrap());
+            assert_eq!(1, seq.count(3i32).unwrap());
+            assert_eq!(1, seq.count(5i32).unwrap());
+            assert_eq!(1, seq.count(8i32).unwrap());
+            assert_eq!(0, seq.count(42i32).unwrap());
+        });
+    }
+
+    #[test]
+    fn test_seq_iter() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![1, 1, 2, 3, 5, 8];
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            let mut idx = 0;
+            for el in seq.iter().unwrap() {
+                assert_eq!(v[idx], el.unwrap().extract::<i32>().unwrap());
+                idx += 1;
+            }
+            assert_eq!(idx, v.len());
+        });
+    }
+
+    #[test]
+    fn test_seq_strings() {
+        Python::with_gil(|py| {
+            let v = vec!["It", "was", "the", "worst", "of", "times"];
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+
+            let bad_needle = "blurst".to_object(py);
+            assert!(!seq.contains(bad_needle).unwrap());
+
+            let good_needle = "worst".to_object(py);
+            assert!(seq.contains(good_needle).unwrap());
+        });
+    }
+
+    #[test]
+    fn test_seq_concat() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = vec![1, 2, 3];
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            let concat_seq = seq.concat(seq).unwrap();
+            assert_eq!(6, concat_seq.len().unwrap());
+            let concat_v: Vec<i32> = vec![1, 2, 3, 1, 2, 3];
+            for (el, cc) in concat_seq.iter().unwrap().zip(concat_v) {
+                assert_eq!(cc, el.unwrap().extract::<i32>().unwrap());
+            }
+        });
+    }
+
+    #[test]
+    fn test_seq_concat_string() {
+        Python::with_gil(|py| {
+            let v = "string";
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            let concat_seq = seq.concat(seq).unwrap();
+            assert_eq!(12, concat_seq.len().unwrap());
+            let concat_v = "stringstring".to_owned();
+            for (el, cc) in seq.iter().unwrap().zip(concat_v.chars()) {
+                assert_eq!(cc, el.unwrap().extract::<char>().unwrap());
+            }
+        });
+    }
+
+    #[test]
+    fn test_seq_repeat() {
+        Python::with_gil(|py| {
+            let v = vec!["foo", "bar"];
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            let repeat_seq = seq.repeat(3).unwrap();
+            assert_eq!(6, repeat_seq.len().unwrap());
+            let repeated = ["foo", "bar", "foo", "bar", "foo", "bar"];
+            for (el, rpt) in repeat_seq.iter().unwrap().zip(repeated.iter()) {
+                assert_eq!(*rpt, el.unwrap().extract::<String>().unwrap());
+            }
+        });
+    }
+
+    #[test]
+    fn test_seq_inplace() {
+        Python::with_gil(|py| {
+            let v = vec!["foo", "bar"];
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            let rep_seq = seq.in_place_repeat(3).unwrap();
+            assert_eq!(6, seq.len().unwrap());
+            assert!(seq.is(&rep_seq));
+
+            let conc_seq = seq.in_place_concat(seq).unwrap();
+            assert_eq!(12, seq.len().unwrap());
+            assert!(seq.is(&conc_seq));
+        });
+    }
+
+    #[test]
+    fn test_list_coercion() {
+        Python::with_gil(|py| {
+            let v = vec!["foo", "bar"];
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            assert!(seq
+                .to_list()
+                .unwrap()
+                .eq(PyList::new_bound(py, &v))
+                .unwrap());
+        });
+    }
+
+    #[test]
+    fn test_strings_coerce_to_lists() {
+        Python::with_gil(|py| {
+            let v = "foo";
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            assert!(seq
+                .to_list()
+                .unwrap()
+                .eq(PyList::new_bound(py, ["f", "o", "o"]))
+                .unwrap());
+        });
+    }
+
+    #[test]
+    fn test_tuple_coercion() {
+        Python::with_gil(|py| {
+            let v = ("foo", "bar");
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            assert!(seq
+                .to_tuple()
+                .unwrap()
+                .eq(PyTuple::new_bound(py, ["foo", "bar"]))
+                .unwrap());
+        });
+    }
+
+    #[test]
+    fn test_lists_coerce_to_tuples() {
+        Python::with_gil(|py| {
+            let v = vec!["foo", "bar"];
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            assert!(seq
+                .to_tuple()
+                .unwrap()
+                .eq(PyTuple::new_bound(py, &v))
+                .unwrap());
+        });
+    }
+
+    #[test]
+    fn test_extract_tuple_to_vec() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = py
+                .eval_bound("(1, 2)", None, None)
+                .unwrap()
+                .extract()
+                .unwrap();
+            assert!(v == [1, 2]);
+        });
+    }
+
+    #[test]
+    fn test_extract_range_to_vec() {
+        Python::with_gil(|py| {
+            let v: Vec<i32> = py
+                .eval_bound("range(1, 5)", None, None)
+                .unwrap()
+                .extract()
+                .unwrap();
+            assert!(v == [1, 2, 3, 4]);
+        });
+    }
+
+    #[test]
+    fn test_extract_bytearray_to_vec() {
+        Python::with_gil(|py| {
+            let v: Vec<u8> = py
+                .eval_bound("bytearray(b'abc')", None, None)
+                .unwrap()
+                .extract()
+                .unwrap();
+            assert!(v == b"abc");
+        });
+    }
+
+    #[test]
+    fn test_seq_downcast_unchecked() {
+        Python::with_gil(|py| {
+            let v = vec!["foo", "bar"];
+            let ob = v.to_object(py);
+            let seq = ob.downcast_bound::<PySequence>(py).unwrap();
+            let type_ptr = seq.as_ref();
+            let seq_from = unsafe { type_ptr.downcast_unchecked::<PySequence>() };
+            assert!(seq_from.to_list().is_ok());
+        });
+    }
+
+    #[test]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_seq_try_from() {
+        use crate::PyTryFrom;
+        Python::with_gil(|py| {
+            let list = PyList::empty(py);
+            let _ = <PySequence as PyTryFrom>::try_from(list).unwrap();
+            let _ = PySequence::try_from_exact(list).unwrap();
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/set.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/set.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/set.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/set.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,569 @@
+use crate::types::PyIterator;
+#[cfg(feature = "gil-refs")]
+use crate::PyNativeType;
+use crate::{
+    err::{self, PyErr, PyResult},
+    ffi_ptr_ext::FfiPtrExt,
+    instance::Bound,
+    py_result_ext::PyResultExt,
+    types::any::PyAnyMethods,
+};
+use crate::{ffi, PyAny, PyObject, Python, ToPyObject};
+use std::ptr;
+
+/// Represents a Python `set`.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PySet>`][crate::Py] or [`Bound<'py, PySet>`][Bound].
+///
+/// For APIs available on `set` objects, see the [`PySetMethods`] trait which is implemented for
+/// [`Bound<'py, PySet>`][Bound].
+#[repr(transparent)]
+pub struct PySet(PyAny);
+
+#[cfg(not(any(PyPy, GraalPy)))]
+pyobject_native_type!(
+    PySet,
+    ffi::PySetObject,
+    pyobject_native_static_type_object!(ffi::PySet_Type),
+    #checkfunction=ffi::PySet_Check
+);
+
+#[cfg(any(PyPy, GraalPy))]
+pyobject_native_type_core!(
+    PySet,
+    pyobject_native_static_type_object!(ffi::PySet_Type),
+    #checkfunction=ffi::PySet_Check
+);
+
+impl PySet {
+    /// Creates a new set with elements from the given slice.
+    ///
+    /// Returns an error if some element is not hashable.
+    #[inline]
+    pub fn new_bound<'a, 'p, T: ToPyObject + 'a>(
+        py: Python<'p>,
+        elements: impl IntoIterator<Item = &'a T>,
+    ) -> PyResult<Bound<'p, PySet>> {
+        new_from_iter(py, elements)
+    }
+
+    /// Creates a new empty set.
+    pub fn empty_bound(py: Python<'_>) -> PyResult<Bound<'_, PySet>> {
+        unsafe {
+            ffi::PySet_New(ptr::null_mut())
+                .assume_owned_or_err(py)
+                .downcast_into_unchecked()
+        }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PySet {
+    /// Deprecated form of [`PySet::new_bound`].
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PySet::new` will be replaced by `PySet::new_bound` in a future PyO3 version"
+    )]
+    #[inline]
+    pub fn new<'a, 'p, T: ToPyObject + 'a>(
+        py: Python<'p>,
+        elements: impl IntoIterator<Item = &'a T>,
+    ) -> PyResult<&'p PySet> {
+        Self::new_bound(py, elements).map(Bound::into_gil_ref)
+    }
+
+    /// Deprecated form of [`PySet::empty_bound`].
+    #[deprecated(
+        since = "0.21.2",
+        note = "`PySet::empty` will be replaced by `PySet::empty_bound` in a future PyO3 version"
+    )]
+    pub fn empty(py: Python<'_>) -> PyResult<&PySet> {
+        Self::empty_bound(py).map(Bound::into_gil_ref)
+    }
+
+    /// Removes all elements from the set.
+    #[inline]
+    pub fn clear(&self) {
+        self.as_borrowed().clear()
+    }
+
+    /// Returns the number of items in the set.
+    ///
+    /// This is equivalent to the Python expression `len(self)`.
+    #[inline]
+    pub fn len(&self) -> usize {
+        self.as_borrowed().len()
+    }
+
+    /// Checks if set is empty.
+    pub fn is_empty(&self) -> bool {
+        self.as_borrowed().is_empty()
+    }
+
+    /// Determines if the set contains the specified key.
+    ///
+    /// This is equivalent to the Python expression `key in self`.
+    pub fn contains<K>(&self, key: K) -> PyResult<bool>
+    where
+        K: ToPyObject,
+    {
+        self.as_borrowed().contains(key)
+    }
+
+    /// Removes the element from the set if it is present.
+    ///
+    /// Returns `true` if the element was present in the set.
+    pub fn discard<K>(&self, key: K) -> PyResult<bool>
+    where
+        K: ToPyObject,
+    {
+        self.as_borrowed().discard(key)
+    }
+
+    /// Adds an element to the set.
+    pub fn add<K>(&self, key: K) -> PyResult<()>
+    where
+        K: ToPyObject,
+    {
+        self.as_borrowed().add(key)
+    }
+
+    /// Removes and returns an arbitrary element from the set.
+    pub fn pop(&self) -> Option<PyObject> {
+        self.as_borrowed().pop().map(Bound::unbind)
+    }
+
+    /// Returns an iterator of values in this set.
+    ///
+    /// # Panics
+    ///
+    /// If PyO3 detects that the set is mutated during iteration, it will panic.
+    pub fn iter(&self) -> PySetIterator<'_> {
+        PySetIterator(BoundSetIterator::new(self.as_borrowed().to_owned()))
+    }
+}
+
+/// Implementation of functionality for [`PySet`].
+///
+/// These methods are defined for the `Bound<'py, PySet>` smart pointer, so to use method call
+/// syntax these methods are separated into a trait, because stable Rust does not yet support
+/// `arbitrary_self_types`.
+#[doc(alias = "PySet")]
+pub trait PySetMethods<'py>: crate::sealed::Sealed {
+    /// Removes all elements from the set.
+    fn clear(&self);
+
+    /// Returns the number of items in the set.
+    ///
+    /// This is equivalent to the Python expression `len(self)`.
+    fn len(&self) -> usize;
+
+    /// Checks if set is empty.
+    fn is_empty(&self) -> bool {
+        self.len() == 0
+    }
+
+    /// Determines if the set contains the specified key.
+    ///
+    /// This is equivalent to the Python expression `key in self`.
+    fn contains<K>(&self, key: K) -> PyResult<bool>
+    where
+        K: ToPyObject;
+
+    /// Removes the element from the set if it is present.
+    ///
+    /// Returns `true` if the element was present in the set.
+    fn discard<K>(&self, key: K) -> PyResult<bool>
+    where
+        K: ToPyObject;
+
+    /// Adds an element to the set.
+    fn add<K>(&self, key: K) -> PyResult<()>
+    where
+        K: ToPyObject;
+
+    /// Removes and returns an arbitrary element from the set.
+    fn pop(&self) -> Option<Bound<'py, PyAny>>;
+
+    /// Returns an iterator of values in this set.
+    ///
+    /// # Panics
+    ///
+    /// If PyO3 detects that the set is mutated during iteration, it will panic.
+    fn iter(&self) -> BoundSetIterator<'py>;
+}
+
+impl<'py> PySetMethods<'py> for Bound<'py, PySet> {
+    #[inline]
+    fn clear(&self) {
+        unsafe {
+            ffi::PySet_Clear(self.as_ptr());
+        }
+    }
+
+    #[inline]
+    fn len(&self) -> usize {
+        unsafe { ffi::PySet_Size(self.as_ptr()) as usize }
+    }
+
+    fn contains<K>(&self, key: K) -> PyResult<bool>
+    where
+        K: ToPyObject,
+    {
+        fn inner(set: &Bound<'_, PySet>, key: Bound<'_, PyAny>) -> PyResult<bool> {
+            match unsafe { ffi::PySet_Contains(set.as_ptr(), key.as_ptr()) } {
+                1 => Ok(true),
+                0 => Ok(false),
+                _ => Err(PyErr::fetch(set.py())),
+            }
+        }
+
+        let py = self.py();
+        inner(self, key.to_object(py).into_bound(py))
+    }
+
+    fn discard<K>(&self, key: K) -> PyResult<bool>
+    where
+        K: ToPyObject,
+    {
+        fn inner(set: &Bound<'_, PySet>, key: Bound<'_, PyAny>) -> PyResult<bool> {
+            match unsafe { ffi::PySet_Discard(set.as_ptr(), key.as_ptr()) } {
+                1 => Ok(true),
+                0 => Ok(false),
+                _ => Err(PyErr::fetch(set.py())),
+            }
+        }
+
+        let py = self.py();
+        inner(self, key.to_object(py).into_bound(py))
+    }
+
+    fn add<K>(&self, key: K) -> PyResult<()>
+    where
+        K: ToPyObject,
+    {
+        fn inner(set: &Bound<'_, PySet>, key: Bound<'_, PyAny>) -> PyResult<()> {
+            err::error_on_minusone(set.py(), unsafe {
+                ffi::PySet_Add(set.as_ptr(), key.as_ptr())
+            })
+        }
+
+        let py = self.py();
+        inner(self, key.to_object(py).into_bound(py))
+    }
+
+    fn pop(&self) -> Option<Bound<'py, PyAny>> {
+        let element = unsafe { ffi::PySet_Pop(self.as_ptr()).assume_owned_or_err(self.py()) };
+        match element {
+            Ok(e) => Some(e),
+            Err(_) => None,
+        }
+    }
+
+    fn iter(&self) -> BoundSetIterator<'py> {
+        BoundSetIterator::new(self.clone())
+    }
+}
+
+/// PyO3 implementation of an iterator for a Python `set` object.
+#[cfg(feature = "gil-refs")]
+pub struct PySetIterator<'py>(BoundSetIterator<'py>);
+
+#[cfg(feature = "gil-refs")]
+impl<'py> Iterator for PySetIterator<'py> {
+    type Item = &'py super::PyAny;
+
+    /// Advances the iterator and returns the next value.
+    ///
+    /// # Panics
+    ///
+    /// If PyO3 detects that the set is mutated during iteration, it will panic.
+    #[inline]
+    fn next(&mut self) -> Option<Self::Item> {
+        self.0.next().map(Bound::into_gil_ref)
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        self.0.size_hint()
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl ExactSizeIterator for PySetIterator<'_> {
+    fn len(&self) -> usize {
+        self.0.len()
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'py> IntoIterator for &'py PySet {
+    type Item = &'py PyAny;
+    type IntoIter = PySetIterator<'py>;
+    /// Returns an iterator of values in this set.
+    ///
+    /// # Panics
+    ///
+    /// If PyO3 detects that the set is mutated during iteration, it will panic.
+    fn into_iter(self) -> Self::IntoIter {
+        PySetIterator(BoundSetIterator::new(self.as_borrowed().to_owned()))
+    }
+}
+
+impl<'py> IntoIterator for Bound<'py, PySet> {
+    type Item = Bound<'py, PyAny>;
+    type IntoIter = BoundSetIterator<'py>;
+
+    /// Returns an iterator of values in this set.
+    ///
+    /// # Panics
+    ///
+    /// If PyO3 detects that the set is mutated during iteration, it will panic.
+    fn into_iter(self) -> Self::IntoIter {
+        BoundSetIterator::new(self)
+    }
+}
+
+impl<'py> IntoIterator for &Bound<'py, PySet> {
+    type Item = Bound<'py, PyAny>;
+    type IntoIter = BoundSetIterator<'py>;
+
+    /// Returns an iterator of values in this set.
+    ///
+    /// # Panics
+    ///
+    /// If PyO3 detects that the set is mutated during iteration, it will panic.
+    fn into_iter(self) -> Self::IntoIter {
+        self.iter()
+    }
+}
+
+/// PyO3 implementation of an iterator for a Python `set` object.
+pub struct BoundSetIterator<'p> {
+    it: Bound<'p, PyIterator>,
+    // Remaining elements in the set. This is fine to store because
+    // Python will error if the set changes size during iteration.
+    remaining: usize,
+}
+
+impl<'py> BoundSetIterator<'py> {
+    pub(super) fn new(set: Bound<'py, PySet>) -> Self {
+        Self {
+            it: PyIterator::from_bound_object(&set).unwrap(),
+            remaining: set.len(),
+        }
+    }
+}
+
+impl<'py> Iterator for BoundSetIterator<'py> {
+    type Item = Bound<'py, super::PyAny>;
+
+    /// Advances the iterator and returns the next value.
+    fn next(&mut self) -> Option<Self::Item> {
+        self.remaining = self.remaining.saturating_sub(1);
+        self.it.next().map(Result::unwrap)
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        (self.remaining, Some(self.remaining))
+    }
+}
+
+impl<'py> ExactSizeIterator for BoundSetIterator<'py> {
+    fn len(&self) -> usize {
+        self.remaining
+    }
+}
+
+#[inline]
+pub(crate) fn new_from_iter<T: ToPyObject>(
+    py: Python<'_>,
+    elements: impl IntoIterator<Item = T>,
+) -> PyResult<Bound<'_, PySet>> {
+    fn inner<'py>(
+        py: Python<'py>,
+        elements: &mut dyn Iterator<Item = PyObject>,
+    ) -> PyResult<Bound<'py, PySet>> {
+        let set = unsafe {
+            // We create the  `Py` pointer because its Drop cleans up the set if user code panics.
+            ffi::PySet_New(std::ptr::null_mut())
+                .assume_owned_or_err(py)?
+                .downcast_into_unchecked()
+        };
+        let ptr = set.as_ptr();
+
+        for obj in elements {
+            err::error_on_minusone(py, unsafe { ffi::PySet_Add(ptr, obj.as_ptr()) })?;
+        }
+
+        Ok(set)
+    }
+
+    let mut iter = elements.into_iter().map(|e| e.to_object(py));
+    inner(py, &mut iter)
+}
+
+#[cfg(test)]
+mod tests {
+    use super::PySet;
+    use crate::{
+        types::{PyAnyMethods, PySetMethods},
+        Python, ToPyObject,
+    };
+    use std::collections::HashSet;
+
+    #[test]
+    fn test_set_new() {
+        Python::with_gil(|py| {
+            let set = PySet::new_bound(py, &[1]).unwrap();
+            assert_eq!(1, set.len());
+
+            let v = vec![1];
+            assert!(PySet::new_bound(py, &[v]).is_err());
+        });
+    }
+
+    #[test]
+    fn test_set_empty() {
+        Python::with_gil(|py| {
+            let set = PySet::empty_bound(py).unwrap();
+            assert_eq!(0, set.len());
+            assert!(set.is_empty());
+        });
+    }
+
+    #[test]
+    fn test_set_len() {
+        Python::with_gil(|py| {
+            let mut v = HashSet::new();
+            let ob = v.to_object(py);
+            let set = ob.downcast_bound::<PySet>(py).unwrap();
+            assert_eq!(0, set.len());
+            v.insert(7);
+            let ob = v.to_object(py);
+            let set2 = ob.downcast_bound::<PySet>(py).unwrap();
+            assert_eq!(1, set2.len());
+        });
+    }
+
+    #[test]
+    fn test_set_clear() {
+        Python::with_gil(|py| {
+            let set = PySet::new_bound(py, &[1]).unwrap();
+            assert_eq!(1, set.len());
+            set.clear();
+            assert_eq!(0, set.len());
+        });
+    }
+
+    #[test]
+    fn test_set_contains() {
+        Python::with_gil(|py| {
+            let set = PySet::new_bound(py, &[1]).unwrap();
+            assert!(set.contains(1).unwrap());
+        });
+    }
+
+    #[test]
+    fn test_set_discard() {
+        Python::with_gil(|py| {
+            let set = PySet::new_bound(py, &[1]).unwrap();
+            assert!(!set.discard(2).unwrap());
+            assert_eq!(1, set.len());
+
+            assert!(set.discard(1).unwrap());
+            assert_eq!(0, set.len());
+            assert!(!set.discard(1).unwrap());
+
+            assert!(set.discard(vec![1, 2]).is_err());
+        });
+    }
+
+    #[test]
+    fn test_set_add() {
+        Python::with_gil(|py| {
+            let set = PySet::new_bound(py, &[1, 2]).unwrap();
+            set.add(1).unwrap(); // Add a dupliated element
+            assert!(set.contains(1).unwrap());
+        });
+    }
+
+    #[test]
+    fn test_set_pop() {
+        Python::with_gil(|py| {
+            let set = PySet::new_bound(py, &[1]).unwrap();
+            let val = set.pop();
+            assert!(val.is_some());
+            let val2 = set.pop();
+            assert!(val2.is_none());
+            assert!(py
+                .eval_bound("print('Exception state should not be set.')", None, None)
+                .is_ok());
+        });
+    }
+
+    #[test]
+    fn test_set_iter() {
+        Python::with_gil(|py| {
+            let set = PySet::new_bound(py, &[1]).unwrap();
+
+            for el in set {
+                assert_eq!(1i32, el.extract::<'_, i32>().unwrap());
+            }
+        });
+    }
+
+    #[test]
+    fn test_set_iter_bound() {
+        use crate::types::any::PyAnyMethods;
+
+        Python::with_gil(|py| {
+            let set = PySet::new_bound(py, &[1]).unwrap();
+
+            for el in &set {
+                assert_eq!(1i32, el.extract::<i32>().unwrap());
+            }
+        });
+    }
+
+    #[test]
+    #[should_panic]
+    fn test_set_iter_mutation() {
+        Python::with_gil(|py| {
+            let set = PySet::new_bound(py, &[1, 2, 3, 4, 5]).unwrap();
+
+            for _ in &set {
+                let _ = set.add(42);
+            }
+        });
+    }
+
+    #[test]
+    #[should_panic]
+    fn test_set_iter_mutation_same_len() {
+        Python::with_gil(|py| {
+            let set = PySet::new_bound(py, &[1, 2, 3, 4, 5]).unwrap();
+
+            for item in &set {
+                let item: i32 = item.extract().unwrap();
+                let _ = set.del_item(item);
+                let _ = set.add(item + 10);
+            }
+        });
+    }
+
+    #[test]
+    fn test_set_iter_size_hint() {
+        Python::with_gil(|py| {
+            let set = PySet::new_bound(py, &[1]).unwrap();
+            let mut iter = set.iter();
+
+            // Exact size
+            assert_eq!(iter.len(), 1);
+            assert_eq!(iter.size_hint(), (1, Some(1)));
+            iter.next();
+            assert_eq!(iter.len(), 0);
+            assert_eq!(iter.size_hint(), (0, Some(0)));
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/slice.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/slice.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/slice.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/slice.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,264 @@
+use crate::err::{PyErr, PyResult};
+use crate::ffi;
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::types::any::PyAnyMethods;
+#[cfg(feature = "gil-refs")]
+use crate::PyNativeType;
+use crate::{Bound, PyAny, PyObject, Python, ToPyObject};
+
+/// Represents a Python `slice`.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PySlice>`][crate::Py] or [`Bound<'py, PySlice>`][Bound].
+///
+/// For APIs available on `slice` objects, see the [`PySliceMethods`] trait which is implemented for
+/// [`Bound<'py, PySlice>`][Bound].
+///
+/// Only `isize` indices supported at the moment by the `PySlice` object.
+#[repr(transparent)]
+pub struct PySlice(PyAny);
+
+pyobject_native_type!(
+    PySlice,
+    ffi::PySliceObject,
+    pyobject_native_static_type_object!(ffi::PySlice_Type),
+    #checkfunction=ffi::PySlice_Check
+);
+
+/// Return value from [`PySliceMethods::indices`].
+#[derive(Debug, Eq, PartialEq)]
+pub struct PySliceIndices {
+    /// Start of the slice
+    ///
+    /// It can be -1 when the step is negative, otherwise it's non-negative.
+    pub start: isize,
+    /// End of the slice
+    ///
+    /// It can be -1 when the step is negative, otherwise it's non-negative.
+    pub stop: isize,
+    /// Increment to use when iterating the slice from `start` to `stop`.
+    pub step: isize,
+    /// The length of the slice calculated from the original input sequence.
+    pub slicelength: usize,
+}
+
+impl PySliceIndices {
+    /// Creates a new `PySliceIndices`.
+    pub fn new(start: isize, stop: isize, step: isize) -> PySliceIndices {
+        PySliceIndices {
+            start,
+            stop,
+            step,
+            slicelength: 0,
+        }
+    }
+}
+
+impl PySlice {
+    /// Constructs a new slice with the given elements.
+    pub fn new_bound(py: Python<'_>, start: isize, stop: isize, step: isize) -> Bound<'_, PySlice> {
+        unsafe {
+            ffi::PySlice_New(
+                ffi::PyLong_FromSsize_t(start),
+                ffi::PyLong_FromSsize_t(stop),
+                ffi::PyLong_FromSsize_t(step),
+            )
+            .assume_owned(py)
+            .downcast_into_unchecked()
+        }
+    }
+
+    /// Constructs a new full slice that is equivalent to `::`.
+    pub fn full_bound(py: Python<'_>) -> Bound<'_, PySlice> {
+        unsafe {
+            ffi::PySlice_New(ffi::Py_None(), ffi::Py_None(), ffi::Py_None())
+                .assume_owned(py)
+                .downcast_into_unchecked()
+        }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PySlice {
+    /// Deprecated form of `PySlice::new_bound`.
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PySlice::new` will be replaced by `PySlice::new_bound` in a future PyO3 version"
+    )]
+    pub fn new(py: Python<'_>, start: isize, stop: isize, step: isize) -> &PySlice {
+        Self::new_bound(py, start, stop, step).into_gil_ref()
+    }
+
+    /// Deprecated form of `PySlice::full_bound`.
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PySlice::full` will be replaced by `PySlice::full_bound` in a future PyO3 version"
+    )]
+    pub fn full(py: Python<'_>) -> &PySlice {
+        PySlice::full_bound(py).into_gil_ref()
+    }
+
+    /// Retrieves the start, stop, and step indices from the slice object,
+    /// assuming a sequence of length `length`, and stores the length of the
+    /// slice in its `slicelength` member.
+    #[inline]
+    pub fn indices(&self, length: isize) -> PyResult<PySliceIndices> {
+        self.as_borrowed().indices(length)
+    }
+}
+
+/// Implementation of functionality for [`PySlice`].
+///
+/// These methods are defined for the `Bound<'py, PyTuple>` smart pointer, so to use method call
+/// syntax these methods are separated into a trait, because stable Rust does not yet support
+/// `arbitrary_self_types`.
+#[doc(alias = "PySlice")]
+pub trait PySliceMethods<'py>: crate::sealed::Sealed {
+    /// Retrieves the start, stop, and step indices from the slice object,
+    /// assuming a sequence of length `length`, and stores the length of the
+    /// slice in its `slicelength` member.
+    fn indices(&self, length: isize) -> PyResult<PySliceIndices>;
+}
+
+impl<'py> PySliceMethods<'py> for Bound<'py, PySlice> {
+    fn indices(&self, length: isize) -> PyResult<PySliceIndices> {
+        unsafe {
+            let mut slicelength: isize = 0;
+            let mut start: isize = 0;
+            let mut stop: isize = 0;
+            let mut step: isize = 0;
+            let r = ffi::PySlice_GetIndicesEx(
+                self.as_ptr(),
+                length,
+                &mut start,
+                &mut stop,
+                &mut step,
+                &mut slicelength,
+            );
+            if r == 0 {
+                Ok(PySliceIndices {
+                    start,
+                    stop,
+                    step,
+                    // non-negative isize should always fit into usize
+                    slicelength: slicelength as _,
+                })
+            } else {
+                Err(PyErr::fetch(self.py()))
+            }
+        }
+    }
+}
+
+impl ToPyObject for PySliceIndices {
+    fn to_object(&self, py: Python<'_>) -> PyObject {
+        PySlice::new_bound(py, self.start, self.stop, self.step).into()
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test_py_slice_new() {
+        Python::with_gil(|py| {
+            let slice = PySlice::new_bound(py, isize::MIN, isize::MAX, 1);
+            assert_eq!(
+                slice.getattr("start").unwrap().extract::<isize>().unwrap(),
+                isize::MIN
+            );
+            assert_eq!(
+                slice.getattr("stop").unwrap().extract::<isize>().unwrap(),
+                isize::MAX
+            );
+            assert_eq!(
+                slice.getattr("step").unwrap().extract::<isize>().unwrap(),
+                1
+            );
+        });
+    }
+
+    #[test]
+    fn test_py_slice_full() {
+        Python::with_gil(|py| {
+            let slice = PySlice::full_bound(py);
+            assert!(slice.getattr("start").unwrap().is_none(),);
+            assert!(slice.getattr("stop").unwrap().is_none(),);
+            assert!(slice.getattr("step").unwrap().is_none(),);
+            assert_eq!(
+                slice.indices(0).unwrap(),
+                PySliceIndices {
+                    start: 0,
+                    stop: 0,
+                    step: 1,
+                    slicelength: 0,
+                },
+            );
+            assert_eq!(
+                slice.indices(42).unwrap(),
+                PySliceIndices {
+                    start: 0,
+                    stop: 42,
+                    step: 1,
+                    slicelength: 42,
+                },
+            );
+        });
+    }
+
+    #[test]
+    fn test_py_slice_indices_new() {
+        let start = 0;
+        let stop = 0;
+        let step = 0;
+        assert_eq!(
+            PySliceIndices::new(start, stop, step),
+            PySliceIndices {
+                start,
+                stop,
+                step,
+                slicelength: 0
+            }
+        );
+
+        let start = 0;
+        let stop = 100;
+        let step = 10;
+        assert_eq!(
+            PySliceIndices::new(start, stop, step),
+            PySliceIndices {
+                start,
+                stop,
+                step,
+                slicelength: 0
+            }
+        );
+
+        let start = 0;
+        let stop = -10;
+        let step = -1;
+        assert_eq!(
+            PySliceIndices::new(start, stop, step),
+            PySliceIndices {
+                start,
+                stop,
+                step,
+                slicelength: 0
+            }
+        );
+
+        let start = 0;
+        let stop = -10;
+        let step = 20;
+        assert_eq!(
+            PySliceIndices::new(start, stop, step),
+            PySliceIndices {
+                start,
+                stop,
+                step,
+                slicelength: 0
+            }
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/string.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/string.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/string.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/string.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,934 @@
+#[cfg(not(Py_LIMITED_API))]
+use crate::exceptions::PyUnicodeDecodeError;
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::instance::Borrowed;
+use crate::py_result_ext::PyResultExt;
+use crate::types::any::PyAnyMethods;
+use crate::types::bytes::PyBytesMethods;
+use crate::types::PyBytes;
+#[cfg(feature = "gil-refs")]
+use crate::PyNativeType;
+use crate::{ffi, Bound, IntoPy, Py, PyAny, PyResult, Python};
+use std::borrow::Cow;
+use std::str;
+
+/// Represents raw data backing a Python `str`.
+///
+/// Python internally stores strings in various representations. This enumeration
+/// represents those variations.
+#[cfg(not(Py_LIMITED_API))]
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+pub enum PyStringData<'a> {
+    /// UCS1 representation.
+    Ucs1(&'a [u8]),
+
+    /// UCS2 representation.
+    Ucs2(&'a [u16]),
+
+    /// UCS4 representation.
+    Ucs4(&'a [u32]),
+}
+
+#[cfg(not(Py_LIMITED_API))]
+impl<'a> PyStringData<'a> {
+    /// Obtain the raw bytes backing this instance as a [u8] slice.
+    pub fn as_bytes(&self) -> &[u8] {
+        match self {
+            Self::Ucs1(s) => s,
+            Self::Ucs2(s) => unsafe {
+                std::slice::from_raw_parts(s.as_ptr().cast(), s.len() * self.value_width_bytes())
+            },
+            Self::Ucs4(s) => unsafe {
+                std::slice::from_raw_parts(s.as_ptr().cast(), s.len() * self.value_width_bytes())
+            },
+        }
+    }
+
+    /// Size in bytes of each value/item in the underlying slice.
+    #[inline]
+    pub fn value_width_bytes(&self) -> usize {
+        match self {
+            Self::Ucs1(_) => 1,
+            Self::Ucs2(_) => 2,
+            Self::Ucs4(_) => 4,
+        }
+    }
+
+    /// Convert the raw data to a Rust string.
+    ///
+    /// For UCS-1 / UTF-8, returns a borrow into the original slice. For UCS-2 and UCS-4,
+    /// returns an owned string.
+    ///
+    /// Returns [PyUnicodeDecodeError] if the string data isn't valid in its purported
+    /// storage format. This should only occur for strings that were created via Python
+    /// C APIs that skip input validation (like `PyUnicode_FromKindAndData`) and should
+    /// never occur for strings that were created from Python code.
+    pub fn to_string(self, py: Python<'_>) -> PyResult<Cow<'a, str>> {
+        use std::ffi::CStr;
+        match self {
+            Self::Ucs1(data) => match str::from_utf8(data) {
+                Ok(s) => Ok(Cow::Borrowed(s)),
+                Err(e) => Err(PyUnicodeDecodeError::new_utf8_bound(py, data, e)?.into()),
+            },
+            Self::Ucs2(data) => match String::from_utf16(data) {
+                Ok(s) => Ok(Cow::Owned(s)),
+                Err(e) => {
+                    let mut message = e.to_string().as_bytes().to_vec();
+                    message.push(0);
+
+                    Err(PyUnicodeDecodeError::new_bound(
+                        py,
+                        ffi::c_str!("utf-16"),
+                        self.as_bytes(),
+                        0..self.as_bytes().len(),
+                        CStr::from_bytes_with_nul(&message).unwrap(),
+                    )?
+                    .into())
+                }
+            },
+            Self::Ucs4(data) => match data.iter().map(|&c| std::char::from_u32(c)).collect() {
+                Some(s) => Ok(Cow::Owned(s)),
+                None => Err(PyUnicodeDecodeError::new_bound(
+                    py,
+                    ffi::c_str!("utf-32"),
+                    self.as_bytes(),
+                    0..self.as_bytes().len(),
+                    ffi::c_str!("error converting utf-32"),
+                )?
+                .into()),
+            },
+        }
+    }
+
+    /// Convert the raw data to a Rust string, possibly with data loss.
+    ///
+    /// Invalid code points will be replaced with `U+FFFD REPLACEMENT CHARACTER`.
+    ///
+    /// Returns a borrow into original data, when possible, or owned data otherwise.
+    ///
+    /// The return value of this function should only disagree with [Self::to_string]
+    /// when that method would error.
+    pub fn to_string_lossy(self) -> Cow<'a, str> {
+        match self {
+            Self::Ucs1(data) => String::from_utf8_lossy(data),
+            Self::Ucs2(data) => Cow::Owned(String::from_utf16_lossy(data)),
+            Self::Ucs4(data) => Cow::Owned(
+                data.iter()
+                    .map(|&c| std::char::from_u32(c).unwrap_or('\u{FFFD}'))
+                    .collect(),
+            ),
+        }
+    }
+}
+
+/// Represents a Python `string` (a Unicode string object).
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyString>`][crate::Py] or [`Bound<'py, PyString>`][Bound].
+///
+/// For APIs available on `str` objects, see the [`PyStringMethods`] trait which is implemented for
+/// [`Bound<'py, PyString>`][Bound].
+///
+/// # Equality
+///
+/// For convenience, [`Bound<'py, PyString>`] implements [`PartialEq<str>`] to allow comparing the
+/// data in the Python string to a Rust UTF-8 string slice.
+///
+/// This is not always the most appropriate way to compare Python strings, as Python string subclasses
+/// may have different equality semantics. In situations where subclasses overriding equality might be
+/// relevant, use [`PyAnyMethods::eq`], at cost of the additional overhead of a Python method call.
+///
+/// ```rust
+/// # use pyo3::prelude::*;
+/// use pyo3::types::PyString;
+///
+/// # Python::with_gil(|py| {
+/// let py_string = PyString::new_bound(py, "foo");
+/// // via PartialEq<str>
+/// assert_eq!(py_string, "foo");
+///
+/// // via Python equality
+/// assert!(py_string.as_any().eq("foo").unwrap());
+/// # });
+/// ```
+#[repr(transparent)]
+pub struct PyString(PyAny);
+
+pyobject_native_type_core!(PyString, pyobject_native_static_type_object!(ffi::PyUnicode_Type), #checkfunction=ffi::PyUnicode_Check);
+
+impl PyString {
+    /// Creates a new Python string object.
+    ///
+    /// Panics if out of memory.
+    pub fn new_bound<'py>(py: Python<'py>, s: &str) -> Bound<'py, PyString> {
+        let ptr = s.as_ptr().cast();
+        let len = s.len() as ffi::Py_ssize_t;
+        unsafe {
+            ffi::PyUnicode_FromStringAndSize(ptr, len)
+                .assume_owned(py)
+                .downcast_into_unchecked()
+        }
+    }
+
+    /// Intern the given string
+    ///
+    /// This will return a reference to the same Python string object if called repeatedly with the same string.
+    ///
+    /// Note that while this is more memory efficient than [`PyString::new_bound`], it unconditionally allocates a
+    /// temporary Python string object and is thereby slower than [`PyString::new_bound`].
+    ///
+    /// Panics if out of memory.
+    pub fn intern_bound<'py>(py: Python<'py>, s: &str) -> Bound<'py, PyString> {
+        let ptr = s.as_ptr().cast();
+        let len = s.len() as ffi::Py_ssize_t;
+        unsafe {
+            let mut ob = ffi::PyUnicode_FromStringAndSize(ptr, len);
+            if !ob.is_null() {
+                ffi::PyUnicode_InternInPlace(&mut ob);
+            }
+            ob.assume_owned(py).downcast_into_unchecked()
+        }
+    }
+
+    /// Attempts to create a Python string from a Python [bytes-like object].
+    ///
+    /// [bytes-like object]: (https://docs.python.org/3/glossary.html#term-bytes-like-object).
+    pub fn from_object_bound<'py>(
+        src: &Bound<'py, PyAny>,
+        encoding: &str,
+        errors: &str,
+    ) -> PyResult<Bound<'py, PyString>> {
+        unsafe {
+            ffi::PyUnicode_FromEncodedObject(
+                src.as_ptr(),
+                encoding.as_ptr().cast(),
+                errors.as_ptr().cast(),
+            )
+            .assume_owned_or_err(src.py())
+            .downcast_into_unchecked()
+        }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyString {
+    /// Deprecated form of [`PyString::new_bound`].
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyString::new` will be replaced by `PyString::new_bound` in a future PyO3 version"
+    )]
+    pub fn new<'py>(py: Python<'py>, s: &str) -> &'py Self {
+        Self::new_bound(py, s).into_gil_ref()
+    }
+
+    /// Deprecated form of [`PyString::intern_bound`].
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyString::intern` will be replaced by `PyString::intern_bound` in a future PyO3 version"
+    )]
+    pub fn intern<'py>(py: Python<'py>, s: &str) -> &'py Self {
+        Self::intern_bound(py, s).into_gil_ref()
+    }
+
+    /// Deprecated form of [`PyString::from_object_bound`].
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyString::from_object` will be replaced by `PyString::from_object_bound` in a future PyO3 version"
+    )]
+    pub fn from_object<'py>(src: &'py PyAny, encoding: &str, errors: &str) -> PyResult<&'py Self> {
+        Self::from_object_bound(&src.as_borrowed(), encoding, errors).map(Bound::into_gil_ref)
+    }
+
+    /// Gets the Python string as a Rust UTF-8 string slice.
+    ///
+    /// Returns a `UnicodeEncodeError` if the input is not valid unicode
+    /// (containing unpaired surrogates).
+    pub fn to_str(&self) -> PyResult<&str> {
+        #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
+        {
+            self.as_borrowed().to_str()
+        }
+
+        #[cfg(not(any(Py_3_10, not(Py_LIMITED_API))))]
+        {
+            let bytes = self.as_borrowed().encode_utf8()?.into_gil_ref();
+            Ok(unsafe { std::str::from_utf8_unchecked(bytes.as_bytes()) })
+        }
+    }
+
+    /// Converts the `PyString` into a Rust string, avoiding copying when possible.
+    ///
+    /// Returns a `UnicodeEncodeError` if the input is not valid unicode
+    /// (containing unpaired surrogates).
+    pub fn to_cow(&self) -> PyResult<Cow<'_, str>> {
+        self.as_borrowed().to_cow()
+    }
+
+    /// Converts the `PyString` into a Rust string.
+    ///
+    /// Unpaired surrogates invalid UTF-8 sequences are
+    /// replaced with `U+FFFD REPLACEMENT CHARACTER`.
+    pub fn to_string_lossy(&self) -> Cow<'_, str> {
+        self.as_borrowed().to_string_lossy()
+    }
+
+    /// Obtains the raw data backing the Python string.
+    ///
+    /// If the Python string object was created through legacy APIs, its internal storage format
+    /// will be canonicalized before data is returned.
+    ///
+    /// # Safety
+    ///
+    /// This function implementation relies on manually decoding a C bitfield. In practice, this
+    /// works well on common little-endian architectures such as x86_64, where the bitfield has a
+    /// common representation (even if it is not part of the C spec). The PyO3 CI tests this API on
+    /// x86_64 platforms.
+    ///
+    /// By using this API, you accept responsibility for testing that PyStringData behaves as
+    /// expected on the targets where you plan to distribute your software.
+    #[cfg(not(any(Py_LIMITED_API, GraalPy, PyPy)))]
+    pub unsafe fn data(&self) -> PyResult<PyStringData<'_>> {
+        self.as_borrowed().data()
+    }
+}
+
+/// Implementation of functionality for [`PyString`].
+///
+/// These methods are defined for the `Bound<'py, PyString>` smart pointer, so to use method call
+/// syntax these methods are separated into a trait, because stable Rust does not yet support
+/// `arbitrary_self_types`.
+#[doc(alias = "PyString")]
+pub trait PyStringMethods<'py>: crate::sealed::Sealed {
+    /// Gets the Python string as a Rust UTF-8 string slice.
+    ///
+    /// Returns a `UnicodeEncodeError` if the input is not valid unicode
+    /// (containing unpaired surrogates).
+    #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
+    fn to_str(&self) -> PyResult<&str>;
+
+    /// Converts the `PyString` into a Rust string, avoiding copying when possible.
+    ///
+    /// Returns a `UnicodeEncodeError` if the input is not valid unicode
+    /// (containing unpaired surrogates).
+    fn to_cow(&self) -> PyResult<Cow<'_, str>>;
+
+    /// Converts the `PyString` into a Rust string.
+    ///
+    /// Unpaired surrogates invalid UTF-8 sequences are
+    /// replaced with `U+FFFD REPLACEMENT CHARACTER`.
+    fn to_string_lossy(&self) -> Cow<'_, str>;
+
+    /// Encodes this string as a Python `bytes` object, using UTF-8 encoding.
+    fn encode_utf8(&self) -> PyResult<Bound<'py, PyBytes>>;
+
+    /// Obtains the raw data backing the Python string.
+    ///
+    /// If the Python string object was created through legacy APIs, its internal storage format
+    /// will be canonicalized before data is returned.
+    ///
+    /// # Safety
+    ///
+    /// This function implementation relies on manually decoding a C bitfield. In practice, this
+    /// works well on common little-endian architectures such as x86_64, where the bitfield has a
+    /// common representation (even if it is not part of the C spec). The PyO3 CI tests this API on
+    /// x86_64 platforms.
+    ///
+    /// By using this API, you accept responsibility for testing that PyStringData behaves as
+    /// expected on the targets where you plan to distribute your software.
+    #[cfg(not(any(Py_LIMITED_API, GraalPy, PyPy)))]
+    unsafe fn data(&self) -> PyResult<PyStringData<'_>>;
+}
+
+impl<'py> PyStringMethods<'py> for Bound<'py, PyString> {
+    #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
+    fn to_str(&self) -> PyResult<&str> {
+        self.as_borrowed().to_str()
+    }
+
+    fn to_cow(&self) -> PyResult<Cow<'_, str>> {
+        self.as_borrowed().to_cow()
+    }
+
+    fn to_string_lossy(&self) -> Cow<'_, str> {
+        self.as_borrowed().to_string_lossy()
+    }
+
+    fn encode_utf8(&self) -> PyResult<Bound<'py, PyBytes>> {
+        unsafe {
+            ffi::PyUnicode_AsUTF8String(self.as_ptr())
+                .assume_owned_or_err(self.py())
+                .downcast_into_unchecked::<PyBytes>()
+        }
+    }
+
+    #[cfg(not(any(Py_LIMITED_API, GraalPy, PyPy)))]
+    unsafe fn data(&self) -> PyResult<PyStringData<'_>> {
+        self.as_borrowed().data()
+    }
+}
+
+impl<'a> Borrowed<'a, '_, PyString> {
+    #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
+    #[allow(clippy::wrong_self_convention)]
+    pub(crate) fn to_str(self) -> PyResult<&'a str> {
+        // PyUnicode_AsUTF8AndSize only available on limited API starting with 3.10.
+        let mut size: ffi::Py_ssize_t = 0;
+        let data: *const u8 =
+            unsafe { ffi::PyUnicode_AsUTF8AndSize(self.as_ptr(), &mut size).cast() };
+        if data.is_null() {
+            Err(crate::PyErr::fetch(self.py()))
+        } else {
+            Ok(unsafe {
+                std::str::from_utf8_unchecked(std::slice::from_raw_parts(data, size as usize))
+            })
+        }
+    }
+
+    #[allow(clippy::wrong_self_convention)]
+    pub(crate) fn to_cow(self) -> PyResult<Cow<'a, str>> {
+        // TODO: this method can probably be deprecated once Python 3.9 support is dropped,
+        // because all versions then support the more efficient `to_str`.
+        #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
+        {
+            self.to_str().map(Cow::Borrowed)
+        }
+
+        #[cfg(not(any(Py_3_10, not(Py_LIMITED_API))))]
+        {
+            let bytes = self.encode_utf8()?;
+            Ok(Cow::Owned(
+                unsafe { str::from_utf8_unchecked(bytes.as_bytes()) }.to_owned(),
+            ))
+        }
+    }
+
+    #[allow(clippy::wrong_self_convention)]
+    fn to_string_lossy(self) -> Cow<'a, str> {
+        let ptr = self.as_ptr();
+        let py = self.py();
+
+        #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
+        if let Ok(s) = self.to_str() {
+            return Cow::Borrowed(s);
+        }
+
+        let bytes = unsafe {
+            ffi::PyUnicode_AsEncodedString(
+                ptr,
+                ffi::c_str!("utf-8").as_ptr(),
+                ffi::c_str!("surrogatepass").as_ptr(),
+            )
+            .assume_owned(py)
+            .downcast_into_unchecked::<PyBytes>()
+        };
+        Cow::Owned(String::from_utf8_lossy(bytes.as_bytes()).into_owned())
+    }
+
+    #[cfg(not(any(Py_LIMITED_API, GraalPy, PyPy)))]
+    unsafe fn data(self) -> PyResult<PyStringData<'a>> {
+        let ptr = self.as_ptr();
+
+        #[cfg(not(Py_3_12))]
+        #[allow(deprecated)]
+        {
+            let ready = ffi::PyUnicode_READY(ptr);
+            if ready != 0 {
+                // Exception was created on failure.
+                return Err(crate::PyErr::fetch(self.py()));
+            }
+        }
+
+        // The string should be in its canonical form after calling `PyUnicode_READY()`.
+        // And non-canonical form not possible after Python 3.12. So it should be safe
+        // to call these APIs.
+        let length = ffi::PyUnicode_GET_LENGTH(ptr) as usize;
+        let raw_data = ffi::PyUnicode_DATA(ptr);
+        let kind = ffi::PyUnicode_KIND(ptr);
+
+        match kind {
+            ffi::PyUnicode_1BYTE_KIND => Ok(PyStringData::Ucs1(std::slice::from_raw_parts(
+                raw_data as *const u8,
+                length,
+            ))),
+            ffi::PyUnicode_2BYTE_KIND => Ok(PyStringData::Ucs2(std::slice::from_raw_parts(
+                raw_data as *const u16,
+                length,
+            ))),
+            ffi::PyUnicode_4BYTE_KIND => Ok(PyStringData::Ucs4(std::slice::from_raw_parts(
+                raw_data as *const u32,
+                length,
+            ))),
+            _ => unreachable!(),
+        }
+    }
+}
+
+impl Py<PyString> {
+    /// Gets the Python string as a Rust UTF-8 string slice.
+    ///
+    /// Returns a `UnicodeEncodeError` if the input is not valid unicode
+    /// (containing unpaired surrogates).
+    ///
+    /// Because `str` objects are immutable, the returned slice is independent of
+    /// the GIL lifetime.
+    #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
+    pub fn to_str<'a>(&'a self, py: Python<'_>) -> PyResult<&'a str> {
+        self.bind_borrowed(py).to_str()
+    }
+
+    /// Converts the `PyString` into a Rust string, avoiding copying when possible.
+    ///
+    /// Returns a `UnicodeEncodeError` if the input is not valid unicode
+    /// (containing unpaired surrogates).
+    ///
+    /// Because `str` objects are immutable, the returned slice is independent of
+    /// the GIL lifetime.
+    pub fn to_cow<'a>(&'a self, py: Python<'_>) -> PyResult<Cow<'a, str>> {
+        self.bind_borrowed(py).to_cow()
+    }
+
+    /// Converts the `PyString` into a Rust string.
+    ///
+    /// Unpaired surrogates invalid UTF-8 sequences are
+    /// replaced with `U+FFFD REPLACEMENT CHARACTER`.
+    ///
+    /// Because `str` objects are immutable, the returned slice is independent of
+    /// the GIL lifetime.
+    pub fn to_string_lossy<'a>(&'a self, py: Python<'_>) -> Cow<'a, str> {
+        self.bind_borrowed(py).to_string_lossy()
+    }
+}
+
+impl IntoPy<Py<PyString>> for Bound<'_, PyString> {
+    fn into_py(self, _py: Python<'_>) -> Py<PyString> {
+        self.unbind()
+    }
+}
+
+impl IntoPy<Py<PyString>> for &Bound<'_, PyString> {
+    fn into_py(self, _py: Python<'_>) -> Py<PyString> {
+        self.clone().unbind()
+    }
+}
+
+impl IntoPy<Py<PyString>> for &'_ Py<PyString> {
+    fn into_py(self, py: Python<'_>) -> Py<PyString> {
+        self.clone_ref(py)
+    }
+}
+
+/// Compares whether the data in the Python string is equal to the given UTF8.
+///
+/// In some cases Python equality might be more appropriate; see the note on [`PyString`].
+impl PartialEq<str> for Bound<'_, PyString> {
+    #[inline]
+    fn eq(&self, other: &str) -> bool {
+        self.as_borrowed() == *other
+    }
+}
+
+/// Compares whether the data in the Python string is equal to the given UTF8.
+///
+/// In some cases Python equality might be more appropriate; see the note on [`PyString`].
+impl PartialEq<&'_ str> for Bound<'_, PyString> {
+    #[inline]
+    fn eq(&self, other: &&str) -> bool {
+        self.as_borrowed() == **other
+    }
+}
+
+/// Compares whether the data in the Python string is equal to the given UTF8.
+///
+/// In some cases Python equality might be more appropriate; see the note on [`PyString`].
+impl PartialEq<Bound<'_, PyString>> for str {
+    #[inline]
+    fn eq(&self, other: &Bound<'_, PyString>) -> bool {
+        *self == other.as_borrowed()
+    }
+}
+
+/// Compares whether the data in the Python string is equal to the given UTF8.
+///
+/// In some cases Python equality might be more appropriate; see the note on [`PyString`].
+impl PartialEq<&'_ Bound<'_, PyString>> for str {
+    #[inline]
+    fn eq(&self, other: &&Bound<'_, PyString>) -> bool {
+        *self == other.as_borrowed()
+    }
+}
+
+/// Compares whether the data in the Python string is equal to the given UTF8.
+///
+/// In some cases Python equality might be more appropriate; see the note on [`PyString`].
+impl PartialEq<Bound<'_, PyString>> for &'_ str {
+    #[inline]
+    fn eq(&self, other: &Bound<'_, PyString>) -> bool {
+        **self == other.as_borrowed()
+    }
+}
+
+/// Compares whether the data in the Python string is equal to the given UTF8.
+///
+/// In some cases Python equality might be more appropriate; see the note on [`PyString`].
+impl PartialEq<str> for &'_ Bound<'_, PyString> {
+    #[inline]
+    fn eq(&self, other: &str) -> bool {
+        self.as_borrowed() == other
+    }
+}
+
+/// Compares whether the data in the Python string is equal to the given UTF8.
+///
+/// In some cases Python equality might be more appropriate; see the note on [`PyString`].
+impl PartialEq<str> for Borrowed<'_, '_, PyString> {
+    #[inline]
+    fn eq(&self, other: &str) -> bool {
+        #[cfg(not(Py_3_13))]
+        {
+            self.to_cow().map_or(false, |s| s == other)
+        }
+
+        #[cfg(Py_3_13)]
+        unsafe {
+            ffi::PyUnicode_EqualToUTF8AndSize(
+                self.as_ptr(),
+                other.as_ptr().cast(),
+                other.len() as _,
+            ) == 1
+        }
+    }
+}
+
+/// Compares whether the data in the Python string is equal to the given UTF8.
+///
+/// In some cases Python equality might be more appropriate; see the note on [`PyString`].
+impl PartialEq<&str> for Borrowed<'_, '_, PyString> {
+    #[inline]
+    fn eq(&self, other: &&str) -> bool {
+        *self == **other
+    }
+}
+
+/// Compares whether the data in the Python string is equal to the given UTF8.
+///
+/// In some cases Python equality might be more appropriate; see the note on [`PyString`].
+impl PartialEq<Borrowed<'_, '_, PyString>> for str {
+    #[inline]
+    fn eq(&self, other: &Borrowed<'_, '_, PyString>) -> bool {
+        other == self
+    }
+}
+
+/// Compares whether the data in the Python string is equal to the given UTF8.
+///
+/// In some cases Python equality might be more appropriate; see the note on [`PyString`].
+impl PartialEq<Borrowed<'_, '_, PyString>> for &'_ str {
+    #[inline]
+    fn eq(&self, other: &Borrowed<'_, '_, PyString>) -> bool {
+        other == self
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::{PyObject, ToPyObject};
+
+    #[test]
+    fn test_to_cow_utf8() {
+        Python::with_gil(|py| {
+            let s = "ascii 🐈";
+            let py_string = PyString::new_bound(py, s);
+            assert_eq!(s, py_string.to_cow().unwrap());
+        })
+    }
+
+    #[test]
+    fn test_to_cow_surrogate() {
+        Python::with_gil(|py| {
+            let py_string = py
+                .eval_bound(r"'\ud800'", None, None)
+                .unwrap()
+                .downcast_into::<PyString>()
+                .unwrap();
+            assert!(py_string.to_cow().is_err());
+        })
+    }
+
+    #[test]
+    fn test_to_cow_unicode() {
+        Python::with_gil(|py| {
+            let s = "哈哈🐈";
+            let py_string = PyString::new_bound(py, s);
+            assert_eq!(s, py_string.to_cow().unwrap());
+        })
+    }
+
+    #[test]
+    fn test_encode_utf8_unicode() {
+        Python::with_gil(|py| {
+            let s = "哈哈🐈";
+            let obj = PyString::new_bound(py, s);
+            assert_eq!(s.as_bytes(), obj.encode_utf8().unwrap().as_bytes());
+        })
+    }
+
+    #[test]
+    fn test_encode_utf8_surrogate() {
+        Python::with_gil(|py| {
+            let obj: PyObject = py.eval_bound(r"'\ud800'", None, None).unwrap().into();
+            assert!(obj
+                .bind(py)
+                .downcast::<PyString>()
+                .unwrap()
+                .encode_utf8()
+                .is_err());
+        })
+    }
+
+    #[test]
+    fn test_to_string_lossy() {
+        Python::with_gil(|py| {
+            let py_string = py
+                .eval_bound(r"'🐈 Hello \ud800World'", None, None)
+                .unwrap()
+                .downcast_into::<PyString>()
+                .unwrap();
+
+            assert_eq!(py_string.to_string_lossy(), "🐈 Hello ���World");
+        })
+    }
+
+    #[test]
+    fn test_debug_string() {
+        Python::with_gil(|py| {
+            let v = "Hello\n".to_object(py);
+            let s = v.downcast_bound::<PyString>(py).unwrap();
+            assert_eq!(format!("{:?}", s), "'Hello\\n'");
+        })
+    }
+
+    #[test]
+    fn test_display_string() {
+        Python::with_gil(|py| {
+            let v = "Hello\n".to_object(py);
+            let s = v.downcast_bound::<PyString>(py).unwrap();
+            assert_eq!(format!("{}", s), "Hello\n");
+        })
+    }
+
+    #[test]
+    #[cfg(not(any(Py_LIMITED_API, PyPy)))]
+    fn test_string_data_ucs1() {
+        Python::with_gil(|py| {
+            let s = PyString::new_bound(py, "hello, world");
+            let data = unsafe { s.data().unwrap() };
+
+            assert_eq!(data, PyStringData::Ucs1(b"hello, world"));
+            assert_eq!(data.to_string(py).unwrap(), Cow::Borrowed("hello, world"));
+            assert_eq!(data.to_string_lossy(), Cow::Borrowed("hello, world"));
+        })
+    }
+
+    #[test]
+    #[cfg(not(any(Py_LIMITED_API, PyPy)))]
+    fn test_string_data_ucs1_invalid() {
+        Python::with_gil(|py| {
+            // 0xfe is not allowed in UTF-8.
+            let buffer = b"f\xfe\0";
+            let ptr = unsafe {
+                crate::ffi::PyUnicode_FromKindAndData(
+                    crate::ffi::PyUnicode_1BYTE_KIND as _,
+                    buffer.as_ptr().cast(),
+                    2,
+                )
+            };
+            assert!(!ptr.is_null());
+            let s = unsafe { ptr.assume_owned(py).downcast_into_unchecked::<PyString>() };
+            let data = unsafe { s.data().unwrap() };
+            assert_eq!(data, PyStringData::Ucs1(b"f\xfe"));
+            let err = data.to_string(py).unwrap_err();
+            assert!(err
+                .get_type_bound(py)
+                .is(&py.get_type_bound::<PyUnicodeDecodeError>()));
+            assert!(err
+                .to_string()
+                .contains("'utf-8' codec can't decode byte 0xfe in position 1"));
+            assert_eq!(data.to_string_lossy(), Cow::Borrowed("f�"));
+        });
+    }
+
+    #[test]
+    #[cfg(not(any(Py_LIMITED_API, PyPy)))]
+    fn test_string_data_ucs2() {
+        Python::with_gil(|py| {
+            let s = py.eval_bound("'foo\\ud800'", None, None).unwrap();
+            let py_string = s.downcast::<PyString>().unwrap();
+            let data = unsafe { py_string.data().unwrap() };
+
+            assert_eq!(data, PyStringData::Ucs2(&[102, 111, 111, 0xd800]));
+            assert_eq!(
+                data.to_string_lossy(),
+                Cow::Owned::<str>("foo�".to_string())
+            );
+        })
+    }
+
+    #[test]
+    #[cfg(all(not(any(Py_LIMITED_API, PyPy)), target_endian = "little"))]
+    fn test_string_data_ucs2_invalid() {
+        Python::with_gil(|py| {
+            // U+FF22 (valid) & U+d800 (never valid)
+            let buffer = b"\x22\xff\x00\xd8\x00\x00";
+            let ptr = unsafe {
+                crate::ffi::PyUnicode_FromKindAndData(
+                    crate::ffi::PyUnicode_2BYTE_KIND as _,
+                    buffer.as_ptr().cast(),
+                    2,
+                )
+            };
+            assert!(!ptr.is_null());
+            let s = unsafe { ptr.assume_owned(py).downcast_into_unchecked::<PyString>() };
+            let data = unsafe { s.data().unwrap() };
+            assert_eq!(data, PyStringData::Ucs2(&[0xff22, 0xd800]));
+            let err = data.to_string(py).unwrap_err();
+            assert!(err
+                .get_type_bound(py)
+                .is(&py.get_type_bound::<PyUnicodeDecodeError>()));
+            assert!(err
+                .to_string()
+                .contains("'utf-16' codec can't decode bytes in position 0-3"));
+            assert_eq!(data.to_string_lossy(), Cow::Owned::<str>("Ｂ�".into()));
+        });
+    }
+
+    #[test]
+    #[cfg(not(any(Py_LIMITED_API, PyPy)))]
+    fn test_string_data_ucs4() {
+        Python::with_gil(|py| {
+            let s = "哈哈🐈";
+            let py_string = PyString::new_bound(py, s);
+            let data = unsafe { py_string.data().unwrap() };
+
+            assert_eq!(data, PyStringData::Ucs4(&[21704, 21704, 128008]));
+            assert_eq!(data.to_string_lossy(), Cow::Owned::<str>(s.to_string()));
+        })
+    }
+
+    #[test]
+    #[cfg(all(not(any(Py_LIMITED_API, PyPy)), target_endian = "little"))]
+    fn test_string_data_ucs4_invalid() {
+        Python::with_gil(|py| {
+            // U+20000 (valid) & U+d800 (never valid)
+            let buffer = b"\x00\x00\x02\x00\x00\xd8\x00\x00\x00\x00\x00\x00";
+            let ptr = unsafe {
+                crate::ffi::PyUnicode_FromKindAndData(
+                    crate::ffi::PyUnicode_4BYTE_KIND as _,
+                    buffer.as_ptr().cast(),
+                    2,
+                )
+            };
+            assert!(!ptr.is_null());
+            let s = unsafe { ptr.assume_owned(py).downcast_into_unchecked::<PyString>() };
+            let data = unsafe { s.data().unwrap() };
+            assert_eq!(data, PyStringData::Ucs4(&[0x20000, 0xd800]));
+            let err = data.to_string(py).unwrap_err();
+            assert!(err
+                .get_type_bound(py)
+                .is(&py.get_type_bound::<PyUnicodeDecodeError>()));
+            assert!(err
+                .to_string()
+                .contains("'utf-32' codec can't decode bytes in position 0-7"));
+            assert_eq!(data.to_string_lossy(), Cow::Owned::<str>("𠀀�".into()));
+        });
+    }
+
+    #[test]
+    fn test_intern_string() {
+        Python::with_gil(|py| {
+            let py_string1 = PyString::intern_bound(py, "foo");
+            assert_eq!(py_string1, "foo");
+
+            let py_string2 = PyString::intern_bound(py, "foo");
+            assert_eq!(py_string2, "foo");
+
+            assert_eq!(py_string1.as_ptr(), py_string2.as_ptr());
+
+            let py_string3 = PyString::intern_bound(py, "bar");
+            assert_eq!(py_string3, "bar");
+
+            assert_ne!(py_string1.as_ptr(), py_string3.as_ptr());
+        });
+    }
+
+    #[test]
+    fn test_py_to_str_utf8() {
+        Python::with_gil(|py| {
+            let s = "ascii 🐈";
+            let py_string: Py<PyString> = PyString::new_bound(py, s).into_py(py);
+
+            #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
+            assert_eq!(s, py_string.to_str(py).unwrap());
+
+            assert_eq!(s, py_string.to_cow(py).unwrap());
+        })
+    }
+
+    #[test]
+    fn test_py_to_str_surrogate() {
+        Python::with_gil(|py| {
+            let py_string: Py<PyString> = py
+                .eval_bound(r"'\ud800'", None, None)
+                .unwrap()
+                .extract()
+                .unwrap();
+
+            #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
+            assert!(py_string.to_str(py).is_err());
+
+            assert!(py_string.to_cow(py).is_err());
+        })
+    }
+
+    #[test]
+    fn test_py_to_string_lossy() {
+        Python::with_gil(|py| {
+            let py_string: Py<PyString> = py
+                .eval_bound(r"'🐈 Hello \ud800World'", None, None)
+                .unwrap()
+                .extract()
+                .unwrap();
+            assert_eq!(py_string.to_string_lossy(py), "🐈 Hello ���World");
+        })
+    }
+
+    #[test]
+    fn test_comparisons() {
+        Python::with_gil(|py| {
+            let s = "hello, world";
+            let py_string = PyString::new_bound(py, s);
+
+            assert_eq!(py_string, "hello, world");
+
+            assert_eq!(py_string, s);
+            assert_eq!(&py_string, s);
+            assert_eq!(s, py_string);
+            assert_eq!(s, &py_string);
+
+            assert_eq!(py_string, *s);
+            assert_eq!(&py_string, *s);
+            assert_eq!(*s, py_string);
+            assert_eq!(*s, &py_string);
+
+            let py_string = py_string.as_borrowed();
+
+            assert_eq!(py_string, s);
+            assert_eq!(&py_string, s);
+            assert_eq!(s, py_string);
+            assert_eq!(s, &py_string);
+
+            assert_eq!(py_string, *s);
+            assert_eq!(*s, py_string);
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/traceback.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/traceback.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/traceback.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/traceback.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,186 @@
+use crate::err::{error_on_minusone, PyResult};
+use crate::types::{any::PyAnyMethods, string::PyStringMethods, PyString};
+#[cfg(feature = "gil-refs")]
+use crate::PyNativeType;
+use crate::{ffi, Bound, PyAny};
+
+/// Represents a Python traceback.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyTraceback>`][crate::Py] or [`Bound<'py, PyTraceback>`][Bound].
+///
+/// For APIs available on traceback objects, see the [`PyTracebackMethods`] trait which is implemented for
+/// [`Bound<'py, PyTraceback>`][Bound].
+#[repr(transparent)]
+pub struct PyTraceback(PyAny);
+
+pyobject_native_type_core!(
+    PyTraceback,
+    pyobject_native_static_type_object!(ffi::PyTraceBack_Type),
+    #checkfunction=ffi::PyTraceBack_Check
+);
+
+#[cfg(feature = "gil-refs")]
+impl PyTraceback {
+    /// Formats the traceback as a string.
+    ///
+    /// This does not include the exception type and value. The exception type and value can be
+    /// formatted using the `Display` implementation for `PyErr`.
+    ///
+    /// # Example
+    ///
+    /// The following code formats a Python traceback and exception pair from Rust:
+    ///
+    /// ```rust
+    /// # use pyo3::{Python, PyResult, prelude::PyTracebackMethods};
+    /// # let result: PyResult<()> =
+    /// Python::with_gil(|py| {
+    ///     let err = py
+    ///         .run_bound("raise Exception('banana')", None, None)
+    ///         .expect_err("raise will create a Python error");
+    ///
+    ///     let traceback = err.traceback_bound(py).expect("raised exception will have a traceback");
+    ///     assert_eq!(
+    ///         format!("{}{}", traceback.format()?, err),
+    ///         "\
+    /// Traceback (most recent call last):
+    ///   File \"<string>\", line 1, in <module>
+    /// Exception: banana\
+    /// "
+    ///     );
+    ///     Ok(())
+    /// })
+    /// # ;
+    /// # result.expect("example failed");
+    /// ```
+    pub fn format(&self) -> PyResult<String> {
+        self.as_borrowed().format()
+    }
+}
+
+/// Implementation of functionality for [`PyTraceback`].
+///
+/// These methods are defined for the `Bound<'py, PyTraceback>` smart pointer, so to use method call
+/// syntax these methods are separated into a trait, because stable Rust does not yet support
+/// `arbitrary_self_types`.
+#[doc(alias = "PyTraceback")]
+pub trait PyTracebackMethods<'py>: crate::sealed::Sealed {
+    /// Formats the traceback as a string.
+    ///
+    /// This does not include the exception type and value. The exception type and value can be
+    /// formatted using the `Display` implementation for `PyErr`.
+    ///
+    /// # Example
+    ///
+    /// The following code formats a Python traceback and exception pair from Rust:
+    ///
+    /// ```rust
+    /// # use pyo3::{Python, PyResult, prelude::PyTracebackMethods};
+    /// # let result: PyResult<()> =
+    /// Python::with_gil(|py| {
+    ///     let err = py
+    ///         .run_bound("raise Exception('banana')", None, None)
+    ///         .expect_err("raise will create a Python error");
+    ///
+    ///     let traceback = err.traceback_bound(py).expect("raised exception will have a traceback");
+    ///     assert_eq!(
+    ///         format!("{}{}", traceback.format()?, err),
+    ///         "\
+    /// Traceback (most recent call last):
+    ///   File \"<string>\", line 1, in <module>
+    /// Exception: banana\
+    /// "
+    ///     );
+    ///     Ok(())
+    /// })
+    /// # ;
+    /// # result.expect("example failed");
+    /// ```
+    fn format(&self) -> PyResult<String>;
+}
+
+impl<'py> PyTracebackMethods<'py> for Bound<'py, PyTraceback> {
+    fn format(&self) -> PyResult<String> {
+        let py = self.py();
+        let string_io = py
+            .import_bound(intern!(py, "io"))?
+            .getattr(intern!(py, "StringIO"))?
+            .call0()?;
+        let result = unsafe { ffi::PyTraceBack_Print(self.as_ptr(), string_io.as_ptr()) };
+        error_on_minusone(py, result)?;
+        let formatted = string_io
+            .getattr(intern!(py, "getvalue"))?
+            .call0()?
+            .downcast::<PyString>()?
+            .to_cow()?
+            .into_owned();
+        Ok(formatted)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::{
+        types::{any::PyAnyMethods, dict::PyDictMethods, traceback::PyTracebackMethods, PyDict},
+        IntoPy, PyErr, Python,
+    };
+
+    #[test]
+    fn format_traceback() {
+        Python::with_gil(|py| {
+            let err = py
+                .run_bound("raise Exception('banana')", None, None)
+                .expect_err("raising should have given us an error");
+
+            assert_eq!(
+                err.traceback_bound(py).unwrap().format().unwrap(),
+                "Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n"
+            );
+        })
+    }
+
+    #[test]
+    fn test_err_from_value() {
+        Python::with_gil(|py| {
+            let locals = PyDict::new_bound(py);
+            // Produce an error from python so that it has a traceback
+            py.run_bound(
+                r"
+try:
+    raise ValueError('raised exception')
+except Exception as e:
+    err = e
+",
+                None,
+                Some(&locals),
+            )
+            .unwrap();
+            let err = PyErr::from_value_bound(locals.get_item("err").unwrap().unwrap());
+            let traceback = err.value_bound(py).getattr("__traceback__").unwrap();
+            assert!(err.traceback_bound(py).unwrap().is(&traceback));
+        })
+    }
+
+    #[test]
+    fn test_err_into_py() {
+        Python::with_gil(|py| {
+            let locals = PyDict::new_bound(py);
+            // Produce an error from python so that it has a traceback
+            py.run_bound(
+                r"
+def f():
+    raise ValueError('raised exception')
+",
+                None,
+                Some(&locals),
+            )
+            .unwrap();
+            let f = locals.get_item("f").unwrap().unwrap();
+            let err = f.call0().unwrap_err();
+            let traceback = err.traceback_bound(py).unwrap();
+            let err_object = err.clone_ref(py).into_py(py).into_bound(py);
+
+            assert!(err_object.getattr("__traceback__").unwrap().is(&traceback));
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/tuple.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/tuple.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/tuple.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/tuple.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1497 @@
+use std::iter::FusedIterator;
+
+use crate::ffi::{self, Py_ssize_t};
+use crate::ffi_ptr_ext::FfiPtrExt;
+#[cfg(feature = "experimental-inspect")]
+use crate::inspect::types::TypeInfo;
+use crate::instance::Borrowed;
+use crate::internal_tricks::get_ssize_index;
+use crate::types::{any::PyAnyMethods, sequence::PySequenceMethods, PyList, PySequence};
+#[cfg(feature = "gil-refs")]
+use crate::PyNativeType;
+use crate::{
+    exceptions, Bound, FromPyObject, IntoPy, Py, PyAny, PyErr, PyObject, PyResult, Python,
+    ToPyObject,
+};
+
+#[inline]
+#[track_caller]
+fn new_from_iter<'py>(
+    py: Python<'py>,
+    elements: &mut dyn ExactSizeIterator<Item = PyObject>,
+) -> Bound<'py, PyTuple> {
+    unsafe {
+        // PyTuple_New checks for overflow but has a bad error message, so we check ourselves
+        let len: Py_ssize_t = elements
+            .len()
+            .try_into()
+            .expect("out of range integral type conversion attempted on `elements.len()`");
+
+        let ptr = ffi::PyTuple_New(len);
+
+        // - Panics if the ptr is null
+        // - Cleans up the tuple if `convert` or the asserts panic
+        let tup = ptr.assume_owned(py).downcast_into_unchecked();
+
+        let mut counter: Py_ssize_t = 0;
+
+        for obj in elements.take(len as usize) {
+            #[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+            ffi::PyTuple_SET_ITEM(ptr, counter, obj.into_ptr());
+            #[cfg(any(Py_LIMITED_API, PyPy, GraalPy))]
+            ffi::PyTuple_SetItem(ptr, counter, obj.into_ptr());
+            counter += 1;
+        }
+
+        assert!(elements.next().is_none(), "Attempted to create PyTuple but `elements` was larger than reported by its `ExactSizeIterator` implementation.");
+        assert_eq!(len, counter, "Attempted to create PyTuple but `elements` was smaller than reported by its `ExactSizeIterator` implementation.");
+
+        tup
+    }
+}
+
+/// Represents a Python `tuple` object.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyTuple>`][crate::Py] or [`Bound<'py, PyTuple>`][Bound].
+///
+/// For APIs available on `tuple` objects, see the [`PyTupleMethods`] trait which is implemented for
+/// [`Bound<'py, PyTuple>`][Bound].
+#[repr(transparent)]
+pub struct PyTuple(PyAny);
+
+pyobject_native_type_core!(PyTuple, pyobject_native_static_type_object!(ffi::PyTuple_Type), #checkfunction=ffi::PyTuple_Check);
+
+impl PyTuple {
+    /// Constructs a new tuple with the given elements.
+    ///
+    /// If you want to create a [`PyTuple`] with elements of different or unknown types, or from an
+    /// iterable that doesn't implement [`ExactSizeIterator`], create a Rust tuple with the given
+    /// elements and convert it at once using `into_py`.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyTuple;
+    ///
+    /// # fn main() {
+    /// Python::with_gil(|py| {
+    ///     let elements: Vec<i32> = vec![0, 1, 2, 3, 4, 5];
+    ///     let tuple = PyTuple::new_bound(py, elements);
+    ///     assert_eq!(format!("{:?}", tuple), "(0, 1, 2, 3, 4, 5)");
+    /// });
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    ///
+    /// This function will panic if `element`'s [`ExactSizeIterator`] implementation is incorrect.
+    /// All standard library structures implement this trait correctly, if they do, so calling this
+    /// function using [`Vec`]`<T>` or `&[T]` will always succeed.
+    #[track_caller]
+    pub fn new_bound<T, U>(
+        py: Python<'_>,
+        elements: impl IntoIterator<Item = T, IntoIter = U>,
+    ) -> Bound<'_, PyTuple>
+    where
+        T: ToPyObject,
+        U: ExactSizeIterator<Item = T>,
+    {
+        let mut elements = elements.into_iter().map(|e| e.to_object(py));
+        new_from_iter(py, &mut elements)
+    }
+
+    /// Constructs an empty tuple (on the Python side, a singleton object).
+    pub fn empty_bound(py: Python<'_>) -> Bound<'_, PyTuple> {
+        unsafe {
+            ffi::PyTuple_New(0)
+                .assume_owned(py)
+                .downcast_into_unchecked()
+        }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyTuple {
+    /// Deprecated form of `PyTuple::new_bound`.
+    #[track_caller]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyTuple::new` will be replaced by `PyTuple::new_bound` in a future PyO3 version"
+    )]
+    pub fn new<T, U>(
+        py: Python<'_>,
+        elements: impl IntoIterator<Item = T, IntoIter = U>,
+    ) -> &PyTuple
+    where
+        T: ToPyObject,
+        U: ExactSizeIterator<Item = T>,
+    {
+        Self::new_bound(py, elements).into_gil_ref()
+    }
+
+    /// Deprecated form of `PyTuple::empty_bound`.
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyTuple::empty` will be replaced by `PyTuple::empty_bound` in a future PyO3 version"
+    )]
+    pub fn empty(py: Python<'_>) -> &PyTuple {
+        Self::empty_bound(py).into_gil_ref()
+    }
+
+    /// Gets the length of the tuple.
+    pub fn len(&self) -> usize {
+        self.as_borrowed().len()
+    }
+
+    /// Checks if the tuple is empty.
+    pub fn is_empty(&self) -> bool {
+        self.as_borrowed().is_empty()
+    }
+
+    /// Returns `self` cast as a `PySequence`.
+    pub fn as_sequence(&self) -> &PySequence {
+        unsafe { self.downcast_unchecked() }
+    }
+
+    /// Takes the slice `self[low:high]` and returns it as a new tuple.
+    ///
+    /// Indices must be nonnegative, and out-of-range indices are clipped to
+    /// `self.len()`.
+    pub fn get_slice(&self, low: usize, high: usize) -> &PyTuple {
+        self.as_borrowed().get_slice(low, high).into_gil_ref()
+    }
+
+    /// Gets the tuple item at the specified index.
+    /// # Example
+    /// ```
+    /// use pyo3::{prelude::*, types::PyTuple};
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let ob = (1, 2, 3).to_object(py);
+    ///     let tuple = ob.downcast_bound::<PyTuple>(py).unwrap();
+    ///     let obj = tuple.get_item(0);
+    ///     assert_eq!(obj.unwrap().extract::<i32>().unwrap(), 1);
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    pub fn get_item(&self, index: usize) -> PyResult<&PyAny> {
+        self.as_borrowed()
+            .get_borrowed_item(index)
+            .map(Borrowed::into_gil_ref)
+    }
+
+    /// Gets the tuple item at the specified index. Undefined behavior on bad index. Use with caution.
+    ///
+    /// # Safety
+    ///
+    /// Caller must verify that the index is within the bounds of the tuple.
+    #[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+    pub unsafe fn get_item_unchecked(&self, index: usize) -> &PyAny {
+        self.as_borrowed()
+            .get_borrowed_item_unchecked(index)
+            .into_gil_ref()
+    }
+
+    /// Returns `self` as a slice of objects.
+    #[cfg(not(any(Py_LIMITED_API, GraalPy)))]
+    pub fn as_slice(&self) -> &[&PyAny] {
+        // This is safe because &PyAny has the same memory layout as *mut ffi::PyObject,
+        // and because tuples are immutable.
+        unsafe {
+            let ptr = self.as_ptr() as *mut ffi::PyTupleObject;
+            let slice = std::slice::from_raw_parts((*ptr).ob_item.as_ptr(), self.len());
+            &*(slice as *const [*mut ffi::PyObject] as *const [&PyAny])
+        }
+    }
+
+    /// Determines if self contains `value`.
+    ///
+    /// This is equivalent to the Python expression `value in self`.
+    #[inline]
+    pub fn contains<V>(&self, value: V) -> PyResult<bool>
+    where
+        V: ToPyObject,
+    {
+        self.as_borrowed().contains(value)
+    }
+
+    /// Returns the first index `i` for which `self[i] == value`.
+    ///
+    /// This is equivalent to the Python expression `self.index(value)`.
+    #[inline]
+    pub fn index<V>(&self, value: V) -> PyResult<usize>
+    where
+        V: ToPyObject,
+    {
+        self.as_borrowed().index(value)
+    }
+
+    /// Returns an iterator over the tuple items.
+    pub fn iter(&self) -> PyTupleIterator<'_> {
+        PyTupleIterator(BorrowedTupleIterator::new(self.as_borrowed()))
+    }
+
+    /// Return a new list containing the contents of this tuple; equivalent to the Python expression `list(tuple)`.
+    ///
+    /// This method is equivalent to `self.as_sequence().to_list()` and faster than `PyList::new(py, self)`.
+    pub fn to_list(&self) -> &PyList {
+        self.as_borrowed().to_list().into_gil_ref()
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+index_impls!(PyTuple, "tuple", PyTuple::len, PyTuple::get_slice);
+
+/// Implementation of functionality for [`PyTuple`].
+///
+/// These methods are defined for the `Bound<'py, PyTuple>` smart pointer, so to use method call
+/// syntax these methods are separated into a trait, because stable Rust does not yet support
+/// `arbitrary_self_types`.
+#[doc(alias = "PyTuple")]
+pub trait PyTupleMethods<'py>: crate::sealed::Sealed {
+    /// Gets the length of the tuple.
+    fn len(&self) -> usize;
+
+    /// Checks if the tuple is empty.
+    fn is_empty(&self) -> bool;
+
+    /// Returns `self` cast as a `PySequence`.
+    fn as_sequence(&self) -> &Bound<'py, PySequence>;
+
+    /// Returns `self` cast as a `PySequence`.
+    fn into_sequence(self) -> Bound<'py, PySequence>;
+
+    /// Takes the slice `self[low:high]` and returns it as a new tuple.
+    ///
+    /// Indices must be nonnegative, and out-of-range indices are clipped to
+    /// `self.len()`.
+    fn get_slice(&self, low: usize, high: usize) -> Bound<'py, PyTuple>;
+
+    /// Gets the tuple item at the specified index.
+    /// # Example
+    /// ```
+    /// use pyo3::{prelude::*, types::PyTuple};
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| -> PyResult<()> {
+    ///     let ob = (1, 2, 3).to_object(py);
+    ///     let tuple = ob.downcast_bound::<PyTuple>(py).unwrap();
+    ///     let obj = tuple.get_item(0);
+    ///     assert_eq!(obj.unwrap().extract::<i32>().unwrap(), 1);
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    fn get_item(&self, index: usize) -> PyResult<Bound<'py, PyAny>>;
+
+    /// Like [`get_item`][PyTupleMethods::get_item], but returns a borrowed object, which is a slight performance optimization
+    /// by avoiding a reference count change.
+    fn get_borrowed_item<'a>(&'a self, index: usize) -> PyResult<Borrowed<'a, 'py, PyAny>>;
+
+    /// Gets the tuple item at the specified index. Undefined behavior on bad index. Use with caution.
+    ///
+    /// # Safety
+    ///
+    /// Caller must verify that the index is within the bounds of the tuple.
+    #[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+    unsafe fn get_item_unchecked(&self, index: usize) -> Bound<'py, PyAny>;
+
+    /// Like [`get_item_unchecked`][PyTupleMethods::get_item_unchecked], but returns a borrowed object,
+    /// which is a slight performance optimization by avoiding a reference count change.
+    ///
+    /// # Safety
+    ///
+    /// Caller must verify that the index is within the bounds of the tuple.
+    #[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+    unsafe fn get_borrowed_item_unchecked<'a>(&'a self, index: usize) -> Borrowed<'a, 'py, PyAny>;
+
+    /// Returns `self` as a slice of objects.
+    #[cfg(not(any(Py_LIMITED_API, GraalPy)))]
+    fn as_slice(&self) -> &[Bound<'py, PyAny>];
+
+    /// Determines if self contains `value`.
+    ///
+    /// This is equivalent to the Python expression `value in self`.
+    fn contains<V>(&self, value: V) -> PyResult<bool>
+    where
+        V: ToPyObject;
+
+    /// Returns the first index `i` for which `self[i] == value`.
+    ///
+    /// This is equivalent to the Python expression `self.index(value)`.
+    fn index<V>(&self, value: V) -> PyResult<usize>
+    where
+        V: ToPyObject;
+
+    /// Returns an iterator over the tuple items.
+    fn iter(&self) -> BoundTupleIterator<'py>;
+
+    /// Like [`iter`][PyTupleMethods::iter], but produces an iterator which returns borrowed objects,
+    /// which is a slight performance optimization by avoiding a reference count change.
+    fn iter_borrowed<'a>(&'a self) -> BorrowedTupleIterator<'a, 'py>;
+
+    /// Return a new list containing the contents of this tuple; equivalent to the Python expression `list(tuple)`.
+    ///
+    /// This method is equivalent to `self.as_sequence().to_list()` and faster than `PyList::new(py, self)`.
+    fn to_list(&self) -> Bound<'py, PyList>;
+}
+
+impl<'py> PyTupleMethods<'py> for Bound<'py, PyTuple> {
+    fn len(&self) -> usize {
+        unsafe {
+            #[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+            let size = ffi::PyTuple_GET_SIZE(self.as_ptr());
+            #[cfg(any(Py_LIMITED_API, PyPy, GraalPy))]
+            let size = ffi::PyTuple_Size(self.as_ptr());
+            // non-negative Py_ssize_t should always fit into Rust uint
+            size as usize
+        }
+    }
+
+    fn is_empty(&self) -> bool {
+        self.len() == 0
+    }
+
+    fn as_sequence(&self) -> &Bound<'py, PySequence> {
+        unsafe { self.downcast_unchecked() }
+    }
+
+    fn into_sequence(self) -> Bound<'py, PySequence> {
+        unsafe { self.into_any().downcast_into_unchecked() }
+    }
+
+    fn get_slice(&self, low: usize, high: usize) -> Bound<'py, PyTuple> {
+        unsafe {
+            ffi::PyTuple_GetSlice(self.as_ptr(), get_ssize_index(low), get_ssize_index(high))
+                .assume_owned(self.py())
+                .downcast_into_unchecked()
+        }
+    }
+
+    fn get_item(&self, index: usize) -> PyResult<Bound<'py, PyAny>> {
+        self.get_borrowed_item(index).map(Borrowed::to_owned)
+    }
+
+    fn get_borrowed_item<'a>(&'a self, index: usize) -> PyResult<Borrowed<'a, 'py, PyAny>> {
+        self.as_borrowed().get_borrowed_item(index)
+    }
+
+    #[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+    unsafe fn get_item_unchecked(&self, index: usize) -> Bound<'py, PyAny> {
+        self.get_borrowed_item_unchecked(index).to_owned()
+    }
+
+    #[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+    unsafe fn get_borrowed_item_unchecked<'a>(&'a self, index: usize) -> Borrowed<'a, 'py, PyAny> {
+        self.as_borrowed().get_borrowed_item_unchecked(index)
+    }
+
+    #[cfg(not(any(Py_LIMITED_API, GraalPy)))]
+    fn as_slice(&self) -> &[Bound<'py, PyAny>] {
+        // SAFETY: self is known to be a tuple object, and tuples are immutable
+        let items = unsafe { &(*self.as_ptr().cast::<ffi::PyTupleObject>()).ob_item };
+        // SAFETY: Bound<'py, PyAny> has the same memory layout as *mut ffi::PyObject
+        unsafe { std::slice::from_raw_parts(items.as_ptr().cast(), self.len()) }
+    }
+
+    #[inline]
+    fn contains<V>(&self, value: V) -> PyResult<bool>
+    where
+        V: ToPyObject,
+    {
+        self.as_sequence().contains(value)
+    }
+
+    #[inline]
+    fn index<V>(&self, value: V) -> PyResult<usize>
+    where
+        V: ToPyObject,
+    {
+        self.as_sequence().index(value)
+    }
+
+    fn iter(&self) -> BoundTupleIterator<'py> {
+        BoundTupleIterator::new(self.clone())
+    }
+
+    fn iter_borrowed<'a>(&'a self) -> BorrowedTupleIterator<'a, 'py> {
+        self.as_borrowed().iter_borrowed()
+    }
+
+    fn to_list(&self) -> Bound<'py, PyList> {
+        self.as_sequence()
+            .to_list()
+            .expect("failed to convert tuple to list")
+    }
+}
+
+impl<'a, 'py> Borrowed<'a, 'py, PyTuple> {
+    fn get_borrowed_item(self, index: usize) -> PyResult<Borrowed<'a, 'py, PyAny>> {
+        unsafe {
+            ffi::PyTuple_GetItem(self.as_ptr(), index as Py_ssize_t)
+                .assume_borrowed_or_err(self.py())
+        }
+    }
+
+    #[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+    unsafe fn get_borrowed_item_unchecked(self, index: usize) -> Borrowed<'a, 'py, PyAny> {
+        ffi::PyTuple_GET_ITEM(self.as_ptr(), index as Py_ssize_t).assume_borrowed(self.py())
+    }
+
+    pub(crate) fn iter_borrowed(self) -> BorrowedTupleIterator<'a, 'py> {
+        BorrowedTupleIterator::new(self)
+    }
+}
+
+/// Used by `PyTuple::iter()`.
+#[cfg(feature = "gil-refs")]
+pub struct PyTupleIterator<'a>(BorrowedTupleIterator<'a, 'a>);
+
+#[cfg(feature = "gil-refs")]
+impl<'a> Iterator for PyTupleIterator<'a> {
+    type Item = &'a PyAny;
+
+    #[inline]
+    fn next(&mut self) -> Option<Self::Item> {
+        self.0.next().map(Borrowed::into_gil_ref)
+    }
+
+    #[inline]
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        self.0.size_hint()
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'a> DoubleEndedIterator for PyTupleIterator<'a> {
+    #[inline]
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.0.next_back().map(Borrowed::into_gil_ref)
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl<'a> ExactSizeIterator for PyTupleIterator<'a> {
+    fn len(&self) -> usize {
+        self.0.len()
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl FusedIterator for PyTupleIterator<'_> {}
+
+#[cfg(feature = "gil-refs")]
+impl<'a> IntoIterator for &'a PyTuple {
+    type Item = &'a PyAny;
+    type IntoIter = PyTupleIterator<'a>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        PyTupleIterator(BorrowedTupleIterator::new(self.as_borrowed()))
+    }
+}
+
+/// Used by `PyTuple::into_iter()`.
+pub struct BoundTupleIterator<'py> {
+    tuple: Bound<'py, PyTuple>,
+    index: usize,
+    length: usize,
+}
+
+impl<'py> BoundTupleIterator<'py> {
+    fn new(tuple: Bound<'py, PyTuple>) -> Self {
+        let length = tuple.len();
+        BoundTupleIterator {
+            tuple,
+            index: 0,
+            length,
+        }
+    }
+}
+
+impl<'py> Iterator for BoundTupleIterator<'py> {
+    type Item = Bound<'py, PyAny>;
+
+    #[inline]
+    fn next(&mut self) -> Option<Self::Item> {
+        if self.index < self.length {
+            let item = unsafe {
+                BorrowedTupleIterator::get_item(self.tuple.as_borrowed(), self.index).to_owned()
+            };
+            self.index += 1;
+            Some(item)
+        } else {
+            None
+        }
+    }
+
+    #[inline]
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        let len = self.len();
+        (len, Some(len))
+    }
+}
+
+impl<'py> DoubleEndedIterator for BoundTupleIterator<'py> {
+    #[inline]
+    fn next_back(&mut self) -> Option<Self::Item> {
+        if self.index < self.length {
+            let item = unsafe {
+                BorrowedTupleIterator::get_item(self.tuple.as_borrowed(), self.length - 1)
+                    .to_owned()
+            };
+            self.length -= 1;
+            Some(item)
+        } else {
+            None
+        }
+    }
+}
+
+impl<'py> ExactSizeIterator for BoundTupleIterator<'py> {
+    fn len(&self) -> usize {
+        self.length.saturating_sub(self.index)
+    }
+}
+
+impl FusedIterator for BoundTupleIterator<'_> {}
+
+impl<'py> IntoIterator for Bound<'py, PyTuple> {
+    type Item = Bound<'py, PyAny>;
+    type IntoIter = BoundTupleIterator<'py>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        BoundTupleIterator::new(self)
+    }
+}
+
+impl<'py> IntoIterator for &Bound<'py, PyTuple> {
+    type Item = Bound<'py, PyAny>;
+    type IntoIter = BoundTupleIterator<'py>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        self.iter()
+    }
+}
+
+/// Used by `PyTuple::iter_borrowed()`.
+pub struct BorrowedTupleIterator<'a, 'py> {
+    tuple: Borrowed<'a, 'py, PyTuple>,
+    index: usize,
+    length: usize,
+}
+
+impl<'a, 'py> BorrowedTupleIterator<'a, 'py> {
+    fn new(tuple: Borrowed<'a, 'py, PyTuple>) -> Self {
+        let length = tuple.len();
+        BorrowedTupleIterator {
+            tuple,
+            index: 0,
+            length,
+        }
+    }
+
+    unsafe fn get_item(
+        tuple: Borrowed<'a, 'py, PyTuple>,
+        index: usize,
+    ) -> Borrowed<'a, 'py, PyAny> {
+        #[cfg(any(Py_LIMITED_API, PyPy, GraalPy))]
+        let item = tuple.get_borrowed_item(index).expect("tuple.get failed");
+        #[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+        let item = tuple.get_borrowed_item_unchecked(index);
+        item
+    }
+}
+
+impl<'a, 'py> Iterator for BorrowedTupleIterator<'a, 'py> {
+    type Item = Borrowed<'a, 'py, PyAny>;
+
+    #[inline]
+    fn next(&mut self) -> Option<Self::Item> {
+        if self.index < self.length {
+            let item = unsafe { Self::get_item(self.tuple, self.index) };
+            self.index += 1;
+            Some(item)
+        } else {
+            None
+        }
+    }
+
+    #[inline]
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        let len = self.len();
+        (len, Some(len))
+    }
+}
+
+impl<'a, 'py> DoubleEndedIterator for BorrowedTupleIterator<'a, 'py> {
+    #[inline]
+    fn next_back(&mut self) -> Option<Self::Item> {
+        if self.index < self.length {
+            let item = unsafe { Self::get_item(self.tuple, self.length - 1) };
+            self.length -= 1;
+            Some(item)
+        } else {
+            None
+        }
+    }
+}
+
+impl<'a, 'py> ExactSizeIterator for BorrowedTupleIterator<'a, 'py> {
+    fn len(&self) -> usize {
+        self.length.saturating_sub(self.index)
+    }
+}
+
+impl FusedIterator for BorrowedTupleIterator<'_, '_> {}
+
+impl IntoPy<Py<PyTuple>> for Bound<'_, PyTuple> {
+    fn into_py(self, _: Python<'_>) -> Py<PyTuple> {
+        self.unbind()
+    }
+}
+
+impl IntoPy<Py<PyTuple>> for &'_ Bound<'_, PyTuple> {
+    fn into_py(self, _: Python<'_>) -> Py<PyTuple> {
+        self.clone().unbind()
+    }
+}
+
+#[cold]
+fn wrong_tuple_length(t: &Bound<'_, PyTuple>, expected_length: usize) -> PyErr {
+    let msg = format!(
+        "expected tuple of length {}, but got tuple of length {}",
+        expected_length,
+        t.len()
+    );
+    exceptions::PyValueError::new_err(msg)
+}
+
+macro_rules! tuple_conversion ({$length:expr,$(($refN:ident, $n:tt, $T:ident)),+} => {
+    impl <$($T: ToPyObject),+> ToPyObject for ($($T,)+) {
+        fn to_object(&self, py: Python<'_>) -> PyObject {
+            array_into_tuple(py, [$(self.$n.to_object(py)),+]).into()
+        }
+    }
+    impl <$($T: IntoPy<PyObject>),+> IntoPy<PyObject> for ($($T,)+) {
+        fn into_py(self, py: Python<'_>) -> PyObject {
+            array_into_tuple(py, [$(self.$n.into_py(py)),+]).into()
+        }
+
+        #[cfg(feature = "experimental-inspect")]
+fn type_output() -> TypeInfo {
+            TypeInfo::Tuple(Some(vec![$( $T::type_output() ),+]))
+        }
+    }
+
+    impl <$($T: IntoPy<PyObject>),+> IntoPy<Py<PyTuple>> for ($($T,)+) {
+        fn into_py(self, py: Python<'_>) -> Py<PyTuple> {
+            array_into_tuple(py, [$(self.$n.into_py(py)),+])
+        }
+
+        #[cfg(feature = "experimental-inspect")]
+        fn type_output() -> TypeInfo {
+            TypeInfo::Tuple(Some(vec![$( $T::type_output() ),+]))
+        }
+    }
+
+    impl<'py, $($T: FromPyObject<'py>),+> FromPyObject<'py> for ($($T,)+) {
+        fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>
+        {
+            let t = obj.downcast::<PyTuple>()?;
+            if t.len() == $length {
+                #[cfg(any(Py_LIMITED_API, PyPy, GraalPy))]
+                return Ok(($(t.get_borrowed_item($n)?.extract::<$T>()?,)+));
+
+                #[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+                unsafe {return Ok(($(t.get_borrowed_item_unchecked($n).extract::<$T>()?,)+));}
+            } else {
+                Err(wrong_tuple_length(t, $length))
+            }
+        }
+
+        #[cfg(feature = "experimental-inspect")]
+fn type_input() -> TypeInfo {
+            TypeInfo::Tuple(Some(vec![$( $T::type_input() ),+]))
+        }
+    }
+});
+
+fn array_into_tuple<const N: usize>(py: Python<'_>, array: [PyObject; N]) -> Py<PyTuple> {
+    unsafe {
+        let ptr = ffi::PyTuple_New(N.try_into().expect("0 < N <= 12"));
+        let tup = Py::from_owned_ptr(py, ptr);
+        for (index, obj) in array.into_iter().enumerate() {
+            #[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+            ffi::PyTuple_SET_ITEM(ptr, index as ffi::Py_ssize_t, obj.into_ptr());
+            #[cfg(any(Py_LIMITED_API, PyPy, GraalPy))]
+            ffi::PyTuple_SetItem(ptr, index as ffi::Py_ssize_t, obj.into_ptr());
+        }
+        tup
+    }
+}
+
+tuple_conversion!(1, (ref0, 0, T0));
+tuple_conversion!(2, (ref0, 0, T0), (ref1, 1, T1));
+tuple_conversion!(3, (ref0, 0, T0), (ref1, 1, T1), (ref2, 2, T2));
+tuple_conversion!(
+    4,
+    (ref0, 0, T0),
+    (ref1, 1, T1),
+    (ref2, 2, T2),
+    (ref3, 3, T3)
+);
+tuple_conversion!(
+    5,
+    (ref0, 0, T0),
+    (ref1, 1, T1),
+    (ref2, 2, T2),
+    (ref3, 3, T3),
+    (ref4, 4, T4)
+);
+tuple_conversion!(
+    6,
+    (ref0, 0, T0),
+    (ref1, 1, T1),
+    (ref2, 2, T2),
+    (ref3, 3, T3),
+    (ref4, 4, T4),
+    (ref5, 5, T5)
+);
+tuple_conversion!(
+    7,
+    (ref0, 0, T0),
+    (ref1, 1, T1),
+    (ref2, 2, T2),
+    (ref3, 3, T3),
+    (ref4, 4, T4),
+    (ref5, 5, T5),
+    (ref6, 6, T6)
+);
+tuple_conversion!(
+    8,
+    (ref0, 0, T0),
+    (ref1, 1, T1),
+    (ref2, 2, T2),
+    (ref3, 3, T3),
+    (ref4, 4, T4),
+    (ref5, 5, T5),
+    (ref6, 6, T6),
+    (ref7, 7, T7)
+);
+tuple_conversion!(
+    9,
+    (ref0, 0, T0),
+    (ref1, 1, T1),
+    (ref2, 2, T2),
+    (ref3, 3, T3),
+    (ref4, 4, T4),
+    (ref5, 5, T5),
+    (ref6, 6, T6),
+    (ref7, 7, T7),
+    (ref8, 8, T8)
+);
+tuple_conversion!(
+    10,
+    (ref0, 0, T0),
+    (ref1, 1, T1),
+    (ref2, 2, T2),
+    (ref3, 3, T3),
+    (ref4, 4, T4),
+    (ref5, 5, T5),
+    (ref6, 6, T6),
+    (ref7, 7, T7),
+    (ref8, 8, T8),
+    (ref9, 9, T9)
+);
+tuple_conversion!(
+    11,
+    (ref0, 0, T0),
+    (ref1, 1, T1),
+    (ref2, 2, T2),
+    (ref3, 3, T3),
+    (ref4, 4, T4),
+    (ref5, 5, T5),
+    (ref6, 6, T6),
+    (ref7, 7, T7),
+    (ref8, 8, T8),
+    (ref9, 9, T9),
+    (ref10, 10, T10)
+);
+
+tuple_conversion!(
+    12,
+    (ref0, 0, T0),
+    (ref1, 1, T1),
+    (ref2, 2, T2),
+    (ref3, 3, T3),
+    (ref4, 4, T4),
+    (ref5, 5, T5),
+    (ref6, 6, T6),
+    (ref7, 7, T7),
+    (ref8, 8, T8),
+    (ref9, 9, T9),
+    (ref10, 10, T10),
+    (ref11, 11, T11)
+);
+
+#[cfg(test)]
+mod tests {
+    use crate::types::{any::PyAnyMethods, tuple::PyTupleMethods, PyList, PyTuple};
+    use crate::{Python, ToPyObject};
+    use std::collections::HashSet;
+
+    #[test]
+    fn test_new() {
+        Python::with_gil(|py| {
+            let ob = PyTuple::new_bound(py, [1, 2, 3]);
+            assert_eq!(3, ob.len());
+            let ob = ob.as_any();
+            assert_eq!((1, 2, 3), ob.extract().unwrap());
+
+            let mut map = HashSet::new();
+            map.insert(1);
+            map.insert(2);
+            PyTuple::new_bound(py, map);
+        });
+    }
+
+    #[test]
+    fn test_len() {
+        Python::with_gil(|py| {
+            let ob = (1, 2, 3).to_object(py);
+            let tuple = ob.downcast_bound::<PyTuple>(py).unwrap();
+            assert_eq!(3, tuple.len());
+            assert!(!tuple.is_empty());
+            let ob = tuple.as_any();
+            assert_eq!((1, 2, 3), ob.extract().unwrap());
+        });
+    }
+
+    #[test]
+    fn test_empty() {
+        Python::with_gil(|py| {
+            let tuple = PyTuple::empty_bound(py);
+            assert!(tuple.is_empty());
+            assert_eq!(0, tuple.len());
+        });
+    }
+
+    #[test]
+    fn test_slice() {
+        Python::with_gil(|py| {
+            let tup = PyTuple::new_bound(py, [2, 3, 5, 7]);
+            let slice = tup.get_slice(1, 3);
+            assert_eq!(2, slice.len());
+            let slice = tup.get_slice(1, 7);
+            assert_eq!(3, slice.len());
+        });
+    }
+
+    #[test]
+    fn test_iter() {
+        Python::with_gil(|py| {
+            let ob = (1, 2, 3).to_object(py);
+            let tuple = ob.downcast_bound::<PyTuple>(py).unwrap();
+            assert_eq!(3, tuple.len());
+            let mut iter = tuple.iter();
+
+            assert_eq!(iter.size_hint(), (3, Some(3)));
+
+            assert_eq!(1_i32, iter.next().unwrap().extract::<'_, i32>().unwrap());
+            assert_eq!(iter.size_hint(), (2, Some(2)));
+
+            assert_eq!(2_i32, iter.next().unwrap().extract::<'_, i32>().unwrap());
+            assert_eq!(iter.size_hint(), (1, Some(1)));
+
+            assert_eq!(3_i32, iter.next().unwrap().extract::<'_, i32>().unwrap());
+            assert_eq!(iter.size_hint(), (0, Some(0)));
+
+            assert!(iter.next().is_none());
+            assert!(iter.next().is_none());
+        });
+    }
+
+    #[test]
+    fn test_iter_rev() {
+        Python::with_gil(|py| {
+            let ob = (1, 2, 3).to_object(py);
+            let tuple = ob.downcast_bound::<PyTuple>(py).unwrap();
+            assert_eq!(3, tuple.len());
+            let mut iter = tuple.iter().rev();
+
+            assert_eq!(iter.size_hint(), (3, Some(3)));
+
+            assert_eq!(3_i32, iter.next().unwrap().extract::<'_, i32>().unwrap());
+            assert_eq!(iter.size_hint(), (2, Some(2)));
+
+            assert_eq!(2_i32, iter.next().unwrap().extract::<'_, i32>().unwrap());
+            assert_eq!(iter.size_hint(), (1, Some(1)));
+
+            assert_eq!(1_i32, iter.next().unwrap().extract::<'_, i32>().unwrap());
+            assert_eq!(iter.size_hint(), (0, Some(0)));
+
+            assert!(iter.next().is_none());
+            assert!(iter.next().is_none());
+        });
+    }
+
+    #[test]
+    fn test_bound_iter() {
+        Python::with_gil(|py| {
+            let tuple = PyTuple::new_bound(py, [1, 2, 3]);
+            assert_eq!(3, tuple.len());
+            let mut iter = tuple.iter();
+
+            assert_eq!(iter.size_hint(), (3, Some(3)));
+
+            assert_eq!(1, iter.next().unwrap().extract::<i32>().unwrap());
+            assert_eq!(iter.size_hint(), (2, Some(2)));
+
+            assert_eq!(2, iter.next().unwrap().extract::<i32>().unwrap());
+            assert_eq!(iter.size_hint(), (1, Some(1)));
+
+            assert_eq!(3, iter.next().unwrap().extract::<i32>().unwrap());
+            assert_eq!(iter.size_hint(), (0, Some(0)));
+
+            assert!(iter.next().is_none());
+            assert!(iter.next().is_none());
+        });
+    }
+
+    #[test]
+    fn test_bound_iter_rev() {
+        Python::with_gil(|py| {
+            let tuple = PyTuple::new_bound(py, [1, 2, 3]);
+            assert_eq!(3, tuple.len());
+            let mut iter = tuple.iter().rev();
+
+            assert_eq!(iter.size_hint(), (3, Some(3)));
+
+            assert_eq!(3, iter.next().unwrap().extract::<i32>().unwrap());
+            assert_eq!(iter.size_hint(), (2, Some(2)));
+
+            assert_eq!(2, iter.next().unwrap().extract::<i32>().unwrap());
+            assert_eq!(iter.size_hint(), (1, Some(1)));
+
+            assert_eq!(1, iter.next().unwrap().extract::<i32>().unwrap());
+            assert_eq!(iter.size_hint(), (0, Some(0)));
+
+            assert!(iter.next().is_none());
+            assert!(iter.next().is_none());
+        });
+    }
+
+    #[test]
+    fn test_into_iter() {
+        Python::with_gil(|py| {
+            let ob = (1, 2, 3).to_object(py);
+            let tuple = ob.downcast_bound::<PyTuple>(py).unwrap();
+            assert_eq!(3, tuple.len());
+
+            for (i, item) in tuple.iter().enumerate() {
+                assert_eq!(i + 1, item.extract::<'_, usize>().unwrap());
+            }
+        });
+    }
+
+    #[test]
+    fn test_into_iter_bound() {
+        use crate::Bound;
+
+        Python::with_gil(|py| {
+            let ob = (1, 2, 3).to_object(py);
+            let tuple: &Bound<'_, PyTuple> = ob.downcast_bound(py).unwrap();
+            assert_eq!(3, tuple.len());
+
+            let mut items = vec![];
+            for item in tuple {
+                items.push(item.extract::<usize>().unwrap());
+            }
+            assert_eq!(items, vec![1, 2, 3]);
+        });
+    }
+
+    #[test]
+    #[cfg(not(any(Py_LIMITED_API, GraalPy)))]
+    fn test_as_slice() {
+        Python::with_gil(|py| {
+            let ob = (1, 2, 3).to_object(py);
+            let tuple = ob.downcast_bound::<PyTuple>(py).unwrap();
+
+            let slice = tuple.as_slice();
+            assert_eq!(3, slice.len());
+            assert_eq!(1_i32, slice[0].extract::<'_, i32>().unwrap());
+            assert_eq!(2_i32, slice[1].extract::<'_, i32>().unwrap());
+            assert_eq!(3_i32, slice[2].extract::<'_, i32>().unwrap());
+        });
+    }
+
+    #[test]
+    fn test_tuple_lengths_up_to_12() {
+        Python::with_gil(|py| {
+            let t0 = (0,).to_object(py);
+            let t1 = (0, 1).to_object(py);
+            let t2 = (0, 1, 2).to_object(py);
+            let t3 = (0, 1, 2, 3).to_object(py);
+            let t4 = (0, 1, 2, 3, 4).to_object(py);
+            let t5 = (0, 1, 2, 3, 4, 5).to_object(py);
+            let t6 = (0, 1, 2, 3, 4, 5, 6).to_object(py);
+            let t7 = (0, 1, 2, 3, 4, 5, 6, 7).to_object(py);
+            let t8 = (0, 1, 2, 3, 4, 5, 6, 7, 8).to_object(py);
+            let t9 = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9).to_object(py);
+            let t10 = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10).to_object(py);
+            let t11 = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11).to_object(py);
+
+            assert_eq!(t0.extract::<(i32,)>(py).unwrap(), (0,));
+            assert_eq!(t1.extract::<(i32, i32)>(py).unwrap(), (0, 1,));
+            assert_eq!(t2.extract::<(i32, i32, i32)>(py).unwrap(), (0, 1, 2,));
+            assert_eq!(
+                t3.extract::<(i32, i32, i32, i32,)>(py).unwrap(),
+                (0, 1, 2, 3,)
+            );
+            assert_eq!(
+                t4.extract::<(i32, i32, i32, i32, i32,)>(py).unwrap(),
+                (0, 1, 2, 3, 4,)
+            );
+            assert_eq!(
+                t5.extract::<(i32, i32, i32, i32, i32, i32,)>(py).unwrap(),
+                (0, 1, 2, 3, 4, 5,)
+            );
+            assert_eq!(
+                t6.extract::<(i32, i32, i32, i32, i32, i32, i32,)>(py)
+                    .unwrap(),
+                (0, 1, 2, 3, 4, 5, 6,)
+            );
+            assert_eq!(
+                t7.extract::<(i32, i32, i32, i32, i32, i32, i32, i32,)>(py)
+                    .unwrap(),
+                (0, 1, 2, 3, 4, 5, 6, 7,)
+            );
+            assert_eq!(
+                t8.extract::<(i32, i32, i32, i32, i32, i32, i32, i32, i32,)>(py)
+                    .unwrap(),
+                (0, 1, 2, 3, 4, 5, 6, 7, 8,)
+            );
+            assert_eq!(
+                t9.extract::<(i32, i32, i32, i32, i32, i32, i32, i32, i32, i32,)>(py)
+                    .unwrap(),
+                (0, 1, 2, 3, 4, 5, 6, 7, 8, 9,)
+            );
+            assert_eq!(
+                t10.extract::<(i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32,)>(py)
+                    .unwrap(),
+                (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,)
+            );
+            assert_eq!(
+                t11.extract::<(i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32,)>(py)
+                    .unwrap(),
+                (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,)
+            );
+        })
+    }
+
+    #[test]
+    fn test_tuple_get_item_invalid_index() {
+        Python::with_gil(|py| {
+            let ob = (1, 2, 3).to_object(py);
+            let tuple = ob.downcast_bound::<PyTuple>(py).unwrap();
+            let obj = tuple.get_item(5);
+            assert!(obj.is_err());
+            assert_eq!(
+                obj.unwrap_err().to_string(),
+                "IndexError: tuple index out of range"
+            );
+        });
+    }
+
+    #[test]
+    fn test_tuple_get_item_sanity() {
+        Python::with_gil(|py| {
+            let ob = (1, 2, 3).to_object(py);
+            let tuple = ob.downcast_bound::<PyTuple>(py).unwrap();
+            let obj = tuple.get_item(0);
+            assert_eq!(obj.unwrap().extract::<i32>().unwrap(), 1);
+        });
+    }
+
+    #[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+    #[test]
+    fn test_tuple_get_item_unchecked_sanity() {
+        Python::with_gil(|py| {
+            let ob = (1, 2, 3).to_object(py);
+            let tuple = ob.downcast_bound::<PyTuple>(py).unwrap();
+            let obj = unsafe { tuple.get_item_unchecked(0) };
+            assert_eq!(obj.extract::<i32>().unwrap(), 1);
+        });
+    }
+
+    #[test]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_tuple_index_trait() {
+        Python::with_gil(|py| {
+            let ob = (1, 2, 3).to_object(py);
+            let tuple: &PyTuple = ob.downcast(py).unwrap();
+            assert_eq!(1, tuple[0].extract::<i32>().unwrap());
+            assert_eq!(2, tuple[1].extract::<i32>().unwrap());
+            assert_eq!(3, tuple[2].extract::<i32>().unwrap());
+        });
+    }
+
+    #[test]
+    #[should_panic]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_tuple_index_trait_panic() {
+        Python::with_gil(|py| {
+            let ob = (1, 2, 3).to_object(py);
+            let tuple: &PyTuple = ob.downcast(py).unwrap();
+            let _ = &tuple[7];
+        });
+    }
+
+    #[test]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_tuple_index_trait_ranges() {
+        Python::with_gil(|py| {
+            let ob = (1, 2, 3).to_object(py);
+            let tuple: &PyTuple = ob.downcast(py).unwrap();
+            assert_eq!(vec![2, 3], tuple[1..3].extract::<Vec<i32>>().unwrap());
+            assert_eq!(
+                Vec::<i32>::new(),
+                tuple[3..3].extract::<Vec<i32>>().unwrap()
+            );
+            assert_eq!(vec![2, 3], tuple[1..].extract::<Vec<i32>>().unwrap());
+            assert_eq!(Vec::<i32>::new(), tuple[3..].extract::<Vec<i32>>().unwrap());
+            assert_eq!(vec![1, 2, 3], tuple[..].extract::<Vec<i32>>().unwrap());
+            assert_eq!(vec![2, 3], tuple[1..=2].extract::<Vec<i32>>().unwrap());
+            assert_eq!(vec![1, 2], tuple[..2].extract::<Vec<i32>>().unwrap());
+            assert_eq!(vec![1, 2], tuple[..=1].extract::<Vec<i32>>().unwrap());
+        })
+    }
+
+    #[test]
+    #[should_panic = "range start index 5 out of range for tuple of length 3"]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_tuple_index_trait_range_panic_start() {
+        Python::with_gil(|py| {
+            let ob = (1, 2, 3).to_object(py);
+            let tuple: &PyTuple = ob.downcast(py).unwrap();
+            tuple[5..10].extract::<Vec<i32>>().unwrap();
+        })
+    }
+
+    #[test]
+    #[should_panic = "range end index 10 out of range for tuple of length 3"]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_tuple_index_trait_range_panic_end() {
+        Python::with_gil(|py| {
+            let ob = (1, 2, 3).to_object(py);
+            let tuple: &PyTuple = ob.downcast(py).unwrap();
+            tuple[1..10].extract::<Vec<i32>>().unwrap();
+        })
+    }
+
+    #[test]
+    #[should_panic = "slice index starts at 2 but ends at 1"]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_tuple_index_trait_range_panic_wrong_order() {
+        Python::with_gil(|py| {
+            let ob = (1, 2, 3).to_object(py);
+            let tuple: &PyTuple = ob.downcast(py).unwrap();
+            #[allow(clippy::reversed_empty_ranges)]
+            tuple[2..1].extract::<Vec<i32>>().unwrap();
+        })
+    }
+
+    #[test]
+    #[should_panic = "range start index 8 out of range for tuple of length 3"]
+    #[cfg(feature = "gil-refs")]
+    #[allow(deprecated)]
+    fn test_tuple_index_trait_range_from_panic() {
+        Python::with_gil(|py| {
+            let ob = (1, 2, 3).to_object(py);
+            let tuple: &PyTuple = ob.downcast(py).unwrap();
+            tuple[8..].extract::<Vec<i32>>().unwrap();
+        })
+    }
+
+    #[test]
+    fn test_tuple_contains() {
+        Python::with_gil(|py| {
+            let ob = (1, 1, 2, 3, 5, 8).to_object(py);
+            let tuple = ob.downcast_bound::<PyTuple>(py).unwrap();
+            assert_eq!(6, tuple.len());
+
+            let bad_needle = 7i32.to_object(py);
+            assert!(!tuple.contains(&bad_needle).unwrap());
+
+            let good_needle = 8i32.to_object(py);
+            assert!(tuple.contains(&good_needle).unwrap());
+
+            let type_coerced_needle = 8f32.to_object(py);
+            assert!(tuple.contains(&type_coerced_needle).unwrap());
+        });
+    }
+
+    #[test]
+    fn test_tuple_index() {
+        Python::with_gil(|py| {
+            let ob = (1, 1, 2, 3, 5, 8).to_object(py);
+            let tuple = ob.downcast_bound::<PyTuple>(py).unwrap();
+            assert_eq!(0, tuple.index(1i32).unwrap());
+            assert_eq!(2, tuple.index(2i32).unwrap());
+            assert_eq!(3, tuple.index(3i32).unwrap());
+            assert_eq!(4, tuple.index(5i32).unwrap());
+            assert_eq!(5, tuple.index(8i32).unwrap());
+            assert!(tuple.index(42i32).is_err());
+        });
+    }
+
+    use std::ops::Range;
+
+    // An iterator that lies about its `ExactSizeIterator` implementation.
+    // See https://github.com/PyO3/pyo3/issues/2118
+    struct FaultyIter(Range<usize>, usize);
+
+    impl Iterator for FaultyIter {
+        type Item = usize;
+
+        fn next(&mut self) -> Option<Self::Item> {
+            self.0.next()
+        }
+    }
+
+    impl ExactSizeIterator for FaultyIter {
+        fn len(&self) -> usize {
+            self.1
+        }
+    }
+
+    #[test]
+    #[should_panic(
+        expected = "Attempted to create PyTuple but `elements` was larger than reported by its `ExactSizeIterator` implementation."
+    )]
+    fn too_long_iterator() {
+        Python::with_gil(|py| {
+            let iter = FaultyIter(0..usize::MAX, 73);
+            let _tuple = PyTuple::new_bound(py, iter);
+        })
+    }
+
+    #[test]
+    #[should_panic(
+        expected = "Attempted to create PyTuple but `elements` was smaller than reported by its `ExactSizeIterator` implementation."
+    )]
+    fn too_short_iterator() {
+        Python::with_gil(|py| {
+            let iter = FaultyIter(0..35, 73);
+            let _tuple = PyTuple::new_bound(py, iter);
+        })
+    }
+
+    #[test]
+    #[should_panic(
+        expected = "out of range integral type conversion attempted on `elements.len()`"
+    )]
+    fn overflowing_size() {
+        Python::with_gil(|py| {
+            let iter = FaultyIter(0..0, usize::MAX);
+
+            let _tuple = PyTuple::new_bound(py, iter);
+        })
+    }
+
+    #[cfg(feature = "macros")]
+    #[test]
+    fn bad_clone_mem_leaks() {
+        use crate::{IntoPy, Py, PyAny};
+        use std::sync::atomic::{AtomicUsize, Ordering::SeqCst};
+
+        static NEEDS_DESTRUCTING_COUNT: AtomicUsize = AtomicUsize::new(0);
+
+        #[crate::pyclass]
+        #[pyo3(crate = "crate")]
+        struct Bad(usize);
+
+        impl Clone for Bad {
+            fn clone(&self) -> Self {
+                // This panic should not lead to a memory leak
+                assert_ne!(self.0, 42);
+                NEEDS_DESTRUCTING_COUNT.fetch_add(1, SeqCst);
+
+                Bad(self.0)
+            }
+        }
+
+        impl Drop for Bad {
+            fn drop(&mut self) {
+                NEEDS_DESTRUCTING_COUNT.fetch_sub(1, SeqCst);
+            }
+        }
+
+        impl ToPyObject for Bad {
+            fn to_object(&self, py: Python<'_>) -> Py<PyAny> {
+                self.to_owned().into_py(py)
+            }
+        }
+
+        struct FaultyIter(Range<usize>, usize);
+
+        impl Iterator for FaultyIter {
+            type Item = Bad;
+
+            fn next(&mut self) -> Option<Self::Item> {
+                self.0.next().map(|i| {
+                    NEEDS_DESTRUCTING_COUNT.fetch_add(1, SeqCst);
+                    Bad(i)
+                })
+            }
+        }
+
+        impl ExactSizeIterator for FaultyIter {
+            fn len(&self) -> usize {
+                self.1
+            }
+        }
+
+        Python::with_gil(|py| {
+            std::panic::catch_unwind(|| {
+                let iter = FaultyIter(0..50, 50);
+                let _tuple = PyTuple::new_bound(py, iter);
+            })
+            .unwrap_err();
+        });
+
+        assert_eq!(
+            NEEDS_DESTRUCTING_COUNT.load(SeqCst),
+            0,
+            "Some destructors did not run"
+        );
+    }
+
+    #[cfg(feature = "macros")]
+    #[test]
+    fn bad_clone_mem_leaks_2() {
+        use crate::{IntoPy, Py, PyAny};
+        use std::sync::atomic::{AtomicUsize, Ordering::SeqCst};
+
+        static NEEDS_DESTRUCTING_COUNT: AtomicUsize = AtomicUsize::new(0);
+
+        #[crate::pyclass]
+        #[pyo3(crate = "crate")]
+        struct Bad(usize);
+
+        impl Clone for Bad {
+            fn clone(&self) -> Self {
+                // This panic should not lead to a memory leak
+                assert_ne!(self.0, 3);
+                NEEDS_DESTRUCTING_COUNT.fetch_add(1, SeqCst);
+
+                Bad(self.0)
+            }
+        }
+
+        impl Drop for Bad {
+            fn drop(&mut self) {
+                NEEDS_DESTRUCTING_COUNT.fetch_sub(1, SeqCst);
+            }
+        }
+
+        impl ToPyObject for Bad {
+            fn to_object(&self, py: Python<'_>) -> Py<PyAny> {
+                self.to_owned().into_py(py)
+            }
+        }
+
+        let s = (Bad(1), Bad(2), Bad(3), Bad(4));
+        NEEDS_DESTRUCTING_COUNT.store(4, SeqCst);
+        Python::with_gil(|py| {
+            std::panic::catch_unwind(|| {
+                let _tuple: Py<PyAny> = s.to_object(py);
+            })
+            .unwrap_err();
+        });
+        drop(s);
+
+        assert_eq!(
+            NEEDS_DESTRUCTING_COUNT.load(SeqCst),
+            0,
+            "Some destructors did not run"
+        );
+    }
+
+    #[test]
+    fn test_tuple_to_list() {
+        Python::with_gil(|py| {
+            let tuple = PyTuple::new_bound(py, vec![1, 2, 3]);
+            let list = tuple.to_list();
+            let list_expected = PyList::new_bound(py, vec![1, 2, 3]);
+            assert!(list.eq(list_expected).unwrap());
+        })
+    }
+
+    #[test]
+    fn test_tuple_as_sequence() {
+        Python::with_gil(|py| {
+            let tuple = PyTuple::new_bound(py, vec![1, 2, 3]);
+            let sequence = tuple.as_sequence();
+            assert!(tuple.get_item(0).unwrap().eq(1).unwrap());
+            assert!(sequence.get_item(0).unwrap().eq(1).unwrap());
+
+            assert_eq!(tuple.len(), 3);
+            assert_eq!(sequence.len().unwrap(), 3);
+        })
+    }
+
+    #[test]
+    fn test_tuple_into_sequence() {
+        Python::with_gil(|py| {
+            let tuple = PyTuple::new_bound(py, vec![1, 2, 3]);
+            let sequence = tuple.into_sequence();
+            assert!(sequence.get_item(0).unwrap().eq(1).unwrap());
+            assert_eq!(sequence.len().unwrap(), 3);
+        })
+    }
+
+    #[test]
+    fn test_bound_tuple_get_item() {
+        Python::with_gil(|py| {
+            let tuple = PyTuple::new_bound(py, vec![1, 2, 3, 4]);
+
+            assert_eq!(tuple.len(), 4);
+            assert_eq!(tuple.get_item(0).unwrap().extract::<i32>().unwrap(), 1);
+            assert_eq!(
+                tuple
+                    .get_borrowed_item(1)
+                    .unwrap()
+                    .extract::<i32>()
+                    .unwrap(),
+                2
+            );
+            #[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+            {
+                assert_eq!(
+                    unsafe { tuple.get_item_unchecked(2) }
+                        .extract::<i32>()
+                        .unwrap(),
+                    3
+                );
+                assert_eq!(
+                    unsafe { tuple.get_borrowed_item_unchecked(3) }
+                        .extract::<i32>()
+                        .unwrap(),
+                    4
+                );
+            }
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/typeobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/typeobject.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/typeobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/typeobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,444 @@
+use crate::err::{self, PyResult};
+use crate::instance::Borrowed;
+#[cfg(not(Py_3_13))]
+use crate::pybacked::PyBackedStr;
+use crate::types::any::PyAnyMethods;
+use crate::types::PyTuple;
+#[cfg(feature = "gil-refs")]
+use crate::PyNativeType;
+use crate::{ffi, Bound, PyAny, PyTypeInfo, Python};
+
+use super::PyString;
+
+/// Represents a reference to a Python `type` object.
+///
+/// Values of this type are accessed via PyO3's smart pointers, e.g. as
+/// [`Py<PyType>`][crate::Py] or [`Bound<'py, PyType>`][Bound].
+///
+/// For APIs available on `type` objects, see the [`PyTypeMethods`] trait which is implemented for
+/// [`Bound<'py, PyType>`][Bound].
+#[repr(transparent)]
+pub struct PyType(PyAny);
+
+pyobject_native_type_core!(PyType, pyobject_native_static_type_object!(ffi::PyType_Type), #checkfunction=ffi::PyType_Check);
+
+impl PyType {
+    /// Creates a new type object.
+    #[inline]
+    pub fn new_bound<T: PyTypeInfo>(py: Python<'_>) -> Bound<'_, PyType> {
+        T::type_object_bound(py)
+    }
+
+    /// Converts the given FFI pointer into `Bound<PyType>`, to use in safe code.
+    ///
+    /// The function creates a new reference from the given pointer, and returns
+    /// it as a `Bound<PyType>`.
+    ///
+    /// # Safety
+    /// - The pointer must be a valid non-null reference to a `PyTypeObject`
+    #[inline]
+    pub unsafe fn from_borrowed_type_ptr(
+        py: Python<'_>,
+        p: *mut ffi::PyTypeObject,
+    ) -> Bound<'_, PyType> {
+        Borrowed::from_ptr_unchecked(py, p.cast())
+            .downcast_unchecked()
+            .to_owned()
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyType {
+    /// Deprecated form of [`PyType::new_bound`].
+    #[inline]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyType::new` will be replaced by `PyType::new_bound` in a future PyO3 version"
+    )]
+    pub fn new<T: PyTypeInfo>(py: Python<'_>) -> &PyType {
+        T::type_object_bound(py).into_gil_ref()
+    }
+
+    /// Retrieves the underlying FFI pointer associated with this Python object.
+    #[inline]
+    pub fn as_type_ptr(&self) -> *mut ffi::PyTypeObject {
+        self.as_borrowed().as_type_ptr()
+    }
+
+    /// Deprecated form of [`PyType::from_borrowed_type_ptr`].
+    ///
+    /// # Safety
+    ///
+    /// - The pointer must a valid non-null reference to a `PyTypeObject`.
+    #[inline]
+    #[deprecated(
+        since = "0.21.0",
+        note = "Use `PyType::from_borrowed_type_ptr` instead"
+    )]
+    pub unsafe fn from_type_ptr(py: Python<'_>, p: *mut ffi::PyTypeObject) -> &PyType {
+        Self::from_borrowed_type_ptr(py, p).into_gil_ref()
+    }
+
+    /// Gets the name of the `PyType`. Equivalent to `self.__name__` in Python.
+    pub fn name(&self) -> PyResult<&PyString> {
+        self.as_borrowed().name().map(Bound::into_gil_ref)
+    }
+
+    /// Gets the [qualified name](https://docs.python.org/3/glossary.html#term-qualified-name) of the `PyType`.
+    /// Equivalent to `self.__qualname__` in Python.
+    pub fn qualname(&self) -> PyResult<&PyString> {
+        self.as_borrowed().qualname().map(Bound::into_gil_ref)
+    }
+
+    // `module` and `fully_qualified_name` intentionally omitted
+
+    /// Checks whether `self` is a subclass of `other`.
+    ///
+    /// Equivalent to the Python expression `issubclass(self, other)`.
+    pub fn is_subclass(&self, other: &PyAny) -> PyResult<bool> {
+        self.as_borrowed().is_subclass(&other.as_borrowed())
+    }
+
+    /// Checks whether `self` is a subclass of type `T`.
+    ///
+    /// Equivalent to the Python expression `issubclass(self, T)`, if the type
+    /// `T` is known at compile time.
+    pub fn is_subclass_of<T>(&self) -> PyResult<bool>
+    where
+        T: PyTypeInfo,
+    {
+        self.as_borrowed().is_subclass_of::<T>()
+    }
+}
+
+/// Implementation of functionality for [`PyType`].
+///
+/// These methods are defined for the `Bound<'py, PyType>` smart pointer, so to use method call
+/// syntax these methods are separated into a trait, because stable Rust does not yet support
+/// `arbitrary_self_types`.
+#[doc(alias = "PyType")]
+pub trait PyTypeMethods<'py>: crate::sealed::Sealed {
+    /// Retrieves the underlying FFI pointer associated with this Python object.
+    fn as_type_ptr(&self) -> *mut ffi::PyTypeObject;
+
+    /// Gets the name of the `PyType`. Equivalent to `self.__name__` in Python.
+    fn name(&self) -> PyResult<Bound<'py, PyString>>;
+
+    /// Gets the [qualified name](https://docs.python.org/3/glossary.html#term-qualified-name) of the `PyType`.
+    /// Equivalent to `self.__qualname__` in Python.
+    fn qualname(&self) -> PyResult<Bound<'py, PyString>>;
+
+    /// Gets the name of the module defining the `PyType`.
+    fn module(&self) -> PyResult<Bound<'py, PyString>>;
+
+    /// Gets the [fully qualified name](https://peps.python.org/pep-0737/#add-pytype-getfullyqualifiedname-function) of the `PyType`.
+    fn fully_qualified_name(&self) -> PyResult<Bound<'py, PyString>>;
+
+    /// Checks whether `self` is a subclass of `other`.
+    ///
+    /// Equivalent to the Python expression `issubclass(self, other)`.
+    fn is_subclass(&self, other: &Bound<'_, PyAny>) -> PyResult<bool>;
+
+    /// Checks whether `self` is a subclass of type `T`.
+    ///
+    /// Equivalent to the Python expression `issubclass(self, T)`, if the type
+    /// `T` is known at compile time.
+    fn is_subclass_of<T>(&self) -> PyResult<bool>
+    where
+        T: PyTypeInfo;
+
+    /// Return the method resolution order for this type.
+    ///
+    /// Equivalent to the Python expression `self.__mro__`.
+    fn mro(&self) -> Bound<'py, PyTuple>;
+
+    /// Return Python bases
+    ///
+    /// Equivalent to the Python expression `self.__bases__`.
+    fn bases(&self) -> Bound<'py, PyTuple>;
+}
+
+impl<'py> PyTypeMethods<'py> for Bound<'py, PyType> {
+    /// Retrieves the underlying FFI pointer associated with this Python object.
+    #[inline]
+    fn as_type_ptr(&self) -> *mut ffi::PyTypeObject {
+        self.as_ptr() as *mut ffi::PyTypeObject
+    }
+
+    /// Gets the name of the `PyType`.
+    fn name(&self) -> PyResult<Bound<'py, PyString>> {
+        #[cfg(not(Py_3_11))]
+        let name = self
+            .getattr(intern!(self.py(), "__name__"))?
+            .downcast_into()?;
+
+        #[cfg(Py_3_11)]
+        let name = unsafe {
+            use crate::ffi_ptr_ext::FfiPtrExt;
+            ffi::PyType_GetName(self.as_type_ptr())
+                .assume_owned_or_err(self.py())?
+                // SAFETY: setting `__name__` from Python is required to be a `str`
+                .downcast_into_unchecked()
+        };
+
+        Ok(name)
+    }
+
+    /// Gets the [qualified name](https://docs.python.org/3/glossary.html#term-qualified-name) of the `PyType`.
+    fn qualname(&self) -> PyResult<Bound<'py, PyString>> {
+        #[cfg(not(Py_3_11))]
+        let name = self
+            .getattr(intern!(self.py(), "__qualname__"))?
+            .downcast_into()?;
+
+        #[cfg(Py_3_11)]
+        let name = unsafe {
+            use crate::ffi_ptr_ext::FfiPtrExt;
+            ffi::PyType_GetQualName(self.as_type_ptr())
+                .assume_owned_or_err(self.py())?
+                // SAFETY: setting `__qualname__` from Python is required to be a `str`
+                .downcast_into_unchecked()
+        };
+
+        Ok(name)
+    }
+
+    /// Gets the name of the module defining the `PyType`.
+    fn module(&self) -> PyResult<Bound<'py, PyString>> {
+        #[cfg(not(Py_3_13))]
+        let name = self.getattr(intern!(self.py(), "__module__"))?;
+
+        #[cfg(Py_3_13)]
+        let name = unsafe {
+            use crate::ffi_ptr_ext::FfiPtrExt;
+            ffi::PyType_GetModuleName(self.as_type_ptr()).assume_owned_or_err(self.py())?
+        };
+
+        // `__module__` is never guaranteed to be a `str`
+        name.downcast_into().map_err(Into::into)
+    }
+
+    /// Gets the [fully qualified name](https://docs.python.org/3/glossary.html#term-qualified-name) of the `PyType`.
+    fn fully_qualified_name(&self) -> PyResult<Bound<'py, PyString>> {
+        #[cfg(not(Py_3_13))]
+        let name = {
+            let module = self.getattr(intern!(self.py(), "__module__"))?;
+            let qualname = self.getattr(intern!(self.py(), "__qualname__"))?;
+
+            let module_str = module.extract::<PyBackedStr>()?;
+            if module_str == "builtins" || module_str == "__main__" {
+                qualname.downcast_into()?
+            } else {
+                PyString::new_bound(self.py(), &format!("{}.{}", module, qualname))
+            }
+        };
+
+        #[cfg(Py_3_13)]
+        let name = unsafe {
+            use crate::ffi_ptr_ext::FfiPtrExt;
+            ffi::PyType_GetFullyQualifiedName(self.as_type_ptr())
+                .assume_owned_or_err(self.py())?
+                .downcast_into_unchecked()
+        };
+
+        Ok(name)
+    }
+
+    /// Checks whether `self` is a subclass of `other`.
+    ///
+    /// Equivalent to the Python expression `issubclass(self, other)`.
+    fn is_subclass(&self, other: &Bound<'_, PyAny>) -> PyResult<bool> {
+        let result = unsafe { ffi::PyObject_IsSubclass(self.as_ptr(), other.as_ptr()) };
+        err::error_on_minusone(self.py(), result)?;
+        Ok(result == 1)
+    }
+
+    /// Checks whether `self` is a subclass of type `T`.
+    ///
+    /// Equivalent to the Python expression `issubclass(self, T)`, if the type
+    /// `T` is known at compile time.
+    fn is_subclass_of<T>(&self) -> PyResult<bool>
+    where
+        T: PyTypeInfo,
+    {
+        self.is_subclass(&T::type_object_bound(self.py()))
+    }
+
+    fn mro(&self) -> Bound<'py, PyTuple> {
+        #[cfg(any(Py_LIMITED_API, PyPy))]
+        let mro = self
+            .getattr(intern!(self.py(), "__mro__"))
+            .expect("Cannot get `__mro__` from object.")
+            .extract()
+            .expect("Unexpected type in `__mro__` attribute.");
+
+        #[cfg(not(any(Py_LIMITED_API, PyPy)))]
+        let mro = unsafe {
+            use crate::ffi_ptr_ext::FfiPtrExt;
+            (*self.as_type_ptr())
+                .tp_mro
+                .assume_borrowed(self.py())
+                .to_owned()
+                .downcast_into_unchecked()
+        };
+
+        mro
+    }
+
+    fn bases(&self) -> Bound<'py, PyTuple> {
+        #[cfg(any(Py_LIMITED_API, PyPy))]
+        let bases = self
+            .getattr(intern!(self.py(), "__bases__"))
+            .expect("Cannot get `__bases__` from object.")
+            .extract()
+            .expect("Unexpected type in `__bases__` attribute.");
+
+        #[cfg(not(any(Py_LIMITED_API, PyPy)))]
+        let bases = unsafe {
+            use crate::ffi_ptr_ext::FfiPtrExt;
+            (*self.as_type_ptr())
+                .tp_bases
+                .assume_borrowed(self.py())
+                .to_owned()
+                .downcast_into_unchecked()
+        };
+
+        bases
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::types::{
+        PyAnyMethods, PyBool, PyInt, PyLong, PyModule, PyTuple, PyType, PyTypeMethods,
+    };
+    use crate::PyAny;
+    use crate::Python;
+
+    #[test]
+    fn test_type_is_subclass() {
+        Python::with_gil(|py| {
+            let bool_type = py.get_type_bound::<PyBool>();
+            let long_type = py.get_type_bound::<PyLong>();
+            assert!(bool_type.is_subclass(&long_type).unwrap());
+        });
+    }
+
+    #[test]
+    fn test_type_is_subclass_of() {
+        Python::with_gil(|py| {
+            assert!(py
+                .get_type_bound::<PyBool>()
+                .is_subclass_of::<PyLong>()
+                .unwrap());
+        });
+    }
+
+    #[test]
+    fn test_mro() {
+        Python::with_gil(|py| {
+            assert!(py
+                .get_type_bound::<PyBool>()
+                .mro()
+                .eq(PyTuple::new_bound(
+                    py,
+                    [
+                        py.get_type_bound::<PyBool>(),
+                        py.get_type_bound::<PyInt>(),
+                        py.get_type_bound::<PyAny>()
+                    ]
+                ))
+                .unwrap());
+        });
+    }
+
+    #[test]
+    fn test_bases_bool() {
+        Python::with_gil(|py| {
+            assert!(py
+                .get_type_bound::<PyBool>()
+                .bases()
+                .eq(PyTuple::new_bound(py, [py.get_type_bound::<PyInt>()]))
+                .unwrap());
+        });
+    }
+
+    #[test]
+    fn test_bases_object() {
+        Python::with_gil(|py| {
+            assert!(py
+                .get_type_bound::<PyAny>()
+                .bases()
+                .eq(PyTuple::empty_bound(py))
+                .unwrap());
+        });
+    }
+
+    #[test]
+    fn test_type_names_standard() {
+        Python::with_gil(|py| {
+            let module = PyModule::from_code_bound(
+                py,
+                r#"
+class MyClass:
+    pass
+"#,
+                file!(),
+                "test_module",
+            )
+            .expect("module create failed");
+
+            let my_class = module.getattr("MyClass").unwrap();
+            let my_class_type = my_class.downcast_into::<PyType>().unwrap();
+            assert_eq!(my_class_type.name().unwrap(), "MyClass");
+            assert_eq!(my_class_type.qualname().unwrap(), "MyClass");
+            assert_eq!(my_class_type.module().unwrap(), "test_module");
+            assert_eq!(
+                my_class_type.fully_qualified_name().unwrap(),
+                "test_module.MyClass"
+            );
+        });
+    }
+
+    #[test]
+    fn test_type_names_builtin() {
+        Python::with_gil(|py| {
+            let bool_type = py.get_type_bound::<PyBool>();
+            assert_eq!(bool_type.name().unwrap(), "bool");
+            assert_eq!(bool_type.qualname().unwrap(), "bool");
+            assert_eq!(bool_type.module().unwrap(), "builtins");
+            assert_eq!(bool_type.fully_qualified_name().unwrap(), "bool");
+        });
+    }
+
+    #[test]
+    fn test_type_names_nested() {
+        Python::with_gil(|py| {
+            let module = PyModule::from_code_bound(
+                py,
+                r#"
+class OuterClass:
+    class InnerClass:
+        pass
+"#,
+                file!(),
+                "test_module",
+            )
+            .expect("module create failed");
+
+            let outer_class = module.getattr("OuterClass").unwrap();
+            let inner_class = outer_class.getattr("InnerClass").unwrap();
+            let inner_class_type = inner_class.downcast_into::<PyType>().unwrap();
+            assert_eq!(inner_class_type.name().unwrap(), "InnerClass");
+            assert_eq!(
+                inner_class_type.qualname().unwrap(),
+                "OuterClass.InnerClass"
+            );
+            assert_eq!(inner_class_type.module().unwrap(), "test_module");
+            assert_eq!(
+                inner_class_type.fully_qualified_name().unwrap(),
+                "test_module.OuterClass.InnerClass"
+            );
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/weakref/anyref.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/weakref/anyref.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/weakref/anyref.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/weakref/anyref.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1752 @@
+use crate::err::{DowncastError, PyResult};
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::type_object::{PyTypeCheck, PyTypeInfo};
+use crate::types::any::{PyAny, PyAnyMethods};
+use crate::{ffi, Borrowed, Bound};
+
+#[cfg(feature = "gil-refs")]
+use crate::PyNativeType;
+
+/// Represents any Python `weakref` reference.
+///
+/// In Python this is created by calling `weakref.ref` or `weakref.proxy`.
+#[repr(transparent)]
+pub struct PyWeakref(PyAny);
+
+pyobject_native_type_named!(PyWeakref);
+pyobject_native_type_extract!(PyWeakref);
+
+// TODO: We known the layout but this cannot be implemented, due to the lack of public typeobject pointers
+// #[cfg(not(Py_LIMITED_API))]
+// pyobject_native_type_sized!(PyWeakref, ffi::PyWeakReference);
+
+impl PyTypeCheck for PyWeakref {
+    const NAME: &'static str = "weakref";
+
+    fn type_check(object: &Bound<'_, PyAny>) -> bool {
+        unsafe { ffi::PyWeakref_Check(object.as_ptr()) > 0 }
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyWeakref {
+    // TODO: MAYBE ADD CREATION METHODS OR EASY CASTING?;
+
+    /// Upgrade the weakref to a direct object reference.
+    ///
+    /// It is named `upgrade` to be inline with [rust's `Weak::upgrade`](std::rc::Weak::upgrade).
+    /// In Python it would be equivalent to [`PyWeakref_GetObject`] or retrieving the Object from Python.
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::{PyWeakref, PyWeakrefProxy};
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// #[pymethods]
+    /// impl Foo {
+    ///     fn get_data(&self) -> (&str, u32) {
+    ///         ("Dave", 10)
+    ///     }
+    /// }
+    ///
+    /// fn parse_data(reference: Borrowed<'_, '_, PyWeakref>) -> PyResult<String> {
+    ///     if let Some(data_src) = reference.upgrade_as::<Foo>()? {
+    ///         let data = data_src.borrow();
+    ///         let (name, score) = data.get_data();
+    ///         Ok(format!("Processing '{}': score = {}", name, score))
+    ///     } else {
+    ///         Ok("The supplied data reference is nolonger relavent.".to_owned())
+    ///     }
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let data = Bound::new(py, Foo{})?;
+    ///     let proxy = PyWeakrefProxy::new_bound(&data)?; // Retrieve this as an PyMethods argument.
+    ///     let reference = proxy.downcast::<PyWeakref>()?;
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "Processing 'Dave': score = 10"
+    ///     );
+    ///
+    ///     drop(data);
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "The supplied data reference is nolonger relavent."
+    ///     );
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    pub fn upgrade_as<T>(&self) -> PyResult<Option<&T::AsRefTarget>>
+    where
+        T: PyTypeCheck,
+    {
+        Ok(self
+            .as_borrowed()
+            .upgrade_as::<T>()?
+            .map(Bound::into_gil_ref))
+    }
+
+    /// Upgrade the weakref to a direct object reference unchecked. The type of the recovered object is not checked before downcasting, this could lead to unexpected behavior. Use only when absolutely certain the type can be guaranteed. The `weakref` may still return `None`.
+    ///
+    /// It is named `upgrade` to be inline with [rust's `Weak::upgrade`](std::rc::Weak::upgrade).
+    /// In Python it would be equivalent to [`PyWeakref_GetObject`] or retrieving the Object from Python.
+    ///
+    /// # Safety
+    /// Callers must ensure that the type is valid or risk type confusion.
+    /// The `weakref` is still allowed to be `None`, if the referenced object has been cleaned up.
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::{PyWeakref, PyWeakrefProxy};
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// #[pymethods]
+    /// impl Foo {
+    ///     fn get_data(&self) -> (&str, u32) {
+    ///         ("Dave", 10)
+    ///     }
+    /// }
+    ///
+    /// fn parse_data(reference: Borrowed<'_, '_, PyWeakref>) -> String {
+    ///     if let Some(data_src) = unsafe { reference.upgrade_as_unchecked::<Foo>() } {
+    ///         let data = data_src.borrow();
+    ///         let (name, score) = data.get_data();
+    ///         format!("Processing '{}': score = {}", name, score)
+    ///     } else {
+    ///         "The supplied data reference is nolonger relavent.".to_owned()
+    ///     }
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let data = Bound::new(py, Foo{})?;
+    ///     let proxy = PyWeakrefProxy::new_bound(&data)?; // Retrieve this as an PyMethods argument.
+    ///     let reference = proxy.downcast::<PyWeakref>()?;
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed()),
+    ///         "Processing 'Dave': score = 10"
+    ///     );
+    ///
+    ///     drop(data);
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed()),
+    ///         "The supplied data reference is nolonger relavent."
+    ///     );
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    pub unsafe fn upgrade_as_unchecked<T>(&self) -> Option<&T::AsRefTarget>
+    where
+        T: PyTypeCheck,
+    {
+        self.as_borrowed()
+            .upgrade_as_unchecked::<T>()
+            .map(Bound::into_gil_ref)
+    }
+
+    /// Upgrade the weakref to an exact direct object reference.
+    ///
+    /// It is named `upgrade` to be inline with [rust's `Weak::upgrade`](std::rc::Weak::upgrade).
+    /// In Python it would be equivalent to [`PyWeakref_GetObject`] or retrieving the Object from Python.
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::{PyWeakref, PyWeakrefProxy};
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// #[pymethods]
+    /// impl Foo {
+    ///     fn get_data(&self) -> (&str, u32) {
+    ///         ("Dave", 10)
+    ///     }
+    /// }
+    ///
+    /// fn parse_data(reference: Borrowed<'_, '_, PyWeakref>) -> PyResult<String> {
+    ///     if let Some(data_src) = reference.upgrade_as_exact::<Foo>()? {
+    ///         let data = data_src.borrow();
+    ///         let (name, score) = data.get_data();
+    ///         Ok(format!("Processing '{}': score = {}", name, score))
+    ///     } else {
+    ///         Ok("The supplied data reference is nolonger relavent.".to_owned())
+    ///     }
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let data = Bound::new(py, Foo{})?;
+    ///     let proxy = PyWeakrefProxy::new_bound(&data)?; // Retrieve this as an PyMethods argument.  
+    ///     let reference = proxy.downcast::<PyWeakref>()?;
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "Processing 'Dave': score = 10"
+    ///     );
+    ///
+    ///     drop(data);
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "The supplied data reference is nolonger relavent."
+    ///     );
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    pub fn upgrade_as_exact<T>(&self) -> PyResult<Option<&T::AsRefTarget>>
+    where
+        T: PyTypeInfo,
+    {
+        Ok(self
+            .as_borrowed()
+            .upgrade_as_exact::<T>()?
+            .map(Bound::into_gil_ref))
+    }
+
+    /// Upgrade the weakref to a [`PyAny`] reference to the target if possible.
+    ///
+    /// It is named `upgrade` to be inline with [rust's `Weak::upgrade`](std::rc::Weak::upgrade).
+    /// This function returns `Some(&'py PyAny)` if the reference still exists, otherwise `None` will be returned.
+    ///
+    /// This function gets the optional target of this [`PyWeakref`] (Any Python `weakref` weakreference).
+    /// It produces similair results as using [`PyWeakref_GetObject`] in the C api or retrieving the Object from Python.
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::{PyWeakref, PyWeakrefProxy};
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// fn parse_data(reference: Borrowed<'_, '_, PyWeakref>) -> PyResult<String> {
+    ///     if let Some(object) = reference.upgrade() {
+    ///         Ok(format!("The object '{}' refered by this reference still exists.", object.getattr("__class__")?.getattr("__qualname__")?))
+    ///     } else {
+    ///         Ok("The object, which this reference refered to, no longer exists".to_owned())
+    ///     }
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let data = Bound::new(py, Foo{})?;
+    ///     let proxy = PyWeakrefProxy::new_bound(&data)?; // Retrieve this as an PyMethods argument.
+    ///     let reference = proxy.downcast::<PyWeakref>()?;
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "The object 'Foo' refered by this reference still exists."
+    ///     );
+    ///
+    ///     drop(data);
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "The object, which this reference refered to, no longer exists"
+    ///     );
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    pub fn upgrade(&self) -> Option<&'_ PyAny> {
+        self.as_borrowed().upgrade().map(Bound::into_gil_ref)
+    }
+
+    /// Retrieve to a object pointed to by the weakref.
+    ///
+    /// This function returns `&'py PyAny`, which is either the object if it still exists, otherwise it will refer to [`PyNone`](crate::types::PyNone).
+    ///
+    /// This function gets the optional target of this [`PyWeakref`] (Any Python `weakref` weakreference).
+    /// It produces similair results as using [`PyWeakref_GetObject`] in the C api or retrieving the Object from Python.
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::{PyWeakref, PyWeakrefProxy};
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// fn get_class(reference: Borrowed<'_, '_, PyWeakref>) -> PyResult<String> {
+    ///     reference
+    ///         .get_object()
+    ///         .getattr("__class__")?
+    ///         .repr()
+    ///         .map(|repr| repr.to_string())
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let object = Bound::new(py, Foo{})?;
+    ///     let proxy = PyWeakrefProxy::new_bound(&object)?; // Retrieve this as an PyMethods argument.
+    ///     let reference = proxy.downcast::<PyWeakref>()?;
+    ///
+    ///     assert_eq!(
+    ///         get_class(reference.as_borrowed())?,
+    ///         "<class 'builtins.Foo'>"
+    ///     );
+    ///
+    ///     drop(object);
+    ///
+    ///     assert_eq!(get_class(reference.as_borrowed())?, "<class 'NoneType'>");
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    pub fn get_object(&self) -> &'_ PyAny {
+        self.as_borrowed().get_object().into_gil_ref()
+    }
+}
+
+/// Implementation of functionality for [`PyWeakref`].
+///
+/// These methods are defined for the `Bound<'py, PyWeakref>` smart pointer, so to use method call
+/// syntax these methods are separated into a trait, because stable Rust does not yet support
+/// `arbitrary_self_types`.
+#[doc(alias = "PyWeakref")]
+pub trait PyWeakrefMethods<'py> {
+    /// Upgrade the weakref to a direct Bound object reference.
+    ///
+    /// It is named `upgrade` to be inline with [rust's `Weak::upgrade`](std::rc::Weak::upgrade).
+    /// In Python it would be equivalent to [`PyWeakref_GetObject`].
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefReference;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// #[pymethods]
+    /// impl Foo {
+    ///     fn get_data(&self) -> (&str, u32) {
+    ///         ("Dave", 10)
+    ///     }
+    /// }
+    ///
+    /// fn parse_data(reference: Borrowed<'_, '_, PyWeakrefReference>) -> PyResult<String> {
+    ///     if let Some(data_src) = reference.upgrade_as::<Foo>()? {
+    ///         let data = data_src.borrow();
+    ///         let (name, score) = data.get_data();
+    ///         Ok(format!("Processing '{}': score = {}", name, score))
+    ///     } else {
+    ///         Ok("The supplied data reference is nolonger relavent.".to_owned())
+    ///     }
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let data = Bound::new(py, Foo{})?;
+    ///     let reference = PyWeakrefReference::new_bound(&data)?;
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "Processing 'Dave': score = 10"
+    ///     );
+    ///
+    ///     drop(data);
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "The supplied data reference is nolonger relavent."
+    ///     );
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    /// [`weakref.ReferenceType`]: https://docs.python.org/3/library/weakref.html#weakref.ReferenceType
+    /// [`weakref.ref`]: https://docs.python.org/3/library/weakref.html#weakref.ref
+    fn upgrade_as<T>(&self) -> PyResult<Option<Bound<'py, T>>>
+    where
+        T: PyTypeCheck,
+    {
+        self.upgrade()
+            .map(Bound::downcast_into::<T>)
+            .transpose()
+            .map_err(Into::into)
+    }
+
+    /// Upgrade the weakref to a Borrowed object reference.
+    ///
+    /// It is named `upgrade_borrowed` to be inline with [rust's `Weak::upgrade`](std::rc::Weak::upgrade).
+    /// In Python it would be equivalent to [`PyWeakref_GetObject`].
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefReference;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// #[pymethods]
+    /// impl Foo {
+    ///     fn get_data(&self) -> (&str, u32) {
+    ///         ("Dave", 10)
+    ///     }
+    /// }
+    ///
+    /// fn parse_data(reference: Borrowed<'_, '_, PyWeakrefReference>) -> PyResult<String> {
+    ///     if let Some(data_src) = reference.upgrade_borrowed_as::<Foo>()? {
+    ///         let data = data_src.borrow();
+    ///         let (name, score) = data.get_data();
+    ///         Ok(format!("Processing '{}': score = {}", name, score))
+    ///     } else {
+    ///         Ok("The supplied data reference is nolonger relavent.".to_owned())
+    ///     }
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let data = Bound::new(py, Foo{})?;
+    ///     let reference = PyWeakrefReference::new_bound(&data)?;
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "Processing 'Dave': score = 10"
+    ///     );
+    ///
+    ///     drop(data);
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "The supplied data reference is nolonger relavent."
+    ///     );
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    /// [`weakref.ReferenceType`]: https://docs.python.org/3/library/weakref.html#weakref.ReferenceType
+    /// [`weakref.ref`]: https://docs.python.org/3/library/weakref.html#weakref.ref?
+    fn upgrade_borrowed_as<'a, T>(&'a self) -> PyResult<Option<Borrowed<'a, 'py, T>>>
+    where
+        T: PyTypeCheck,
+        'py: 'a,
+    {
+        // TODO: Replace when Borrowed::downcast exists
+        match self.upgrade_borrowed() {
+            None => Ok(None),
+            Some(object) if T::type_check(&object) => {
+                Ok(Some(unsafe { object.downcast_unchecked() }))
+            }
+            Some(object) => Err(DowncastError::new(&object, T::NAME).into()),
+        }
+    }
+
+    /// Upgrade the weakref to a direct Bound object reference unchecked. The type of the recovered object is not checked before downcasting, this could lead to unexpected behavior. Use only when absolutely certain the type can be guaranteed. The `weakref` may still return `None`.
+    ///
+    /// It is named `upgrade` to be inline with [rust's `Weak::upgrade`](std::rc::Weak::upgrade).
+    /// In Python it would be equivalent to [`PyWeakref_GetObject`].
+    ///
+    /// # Safety
+    /// Callers must ensure that the type is valid or risk type confusion.
+    /// The `weakref` is still allowed to be `None`, if the referenced object has been cleaned up.
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefReference;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// #[pymethods]
+    /// impl Foo {
+    ///     fn get_data(&self) -> (&str, u32) {
+    ///         ("Dave", 10)
+    ///     }
+    /// }
+    ///
+    /// fn parse_data(reference: Borrowed<'_, '_, PyWeakrefReference>) -> String {
+    ///     if let Some(data_src) = unsafe { reference.upgrade_as_unchecked::<Foo>() } {
+    ///         let data = data_src.borrow();
+    ///         let (name, score) = data.get_data();
+    ///         format!("Processing '{}': score = {}", name, score)
+    ///     } else {
+    ///         "The supplied data reference is nolonger relavent.".to_owned()
+    ///     }
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let data = Bound::new(py, Foo{})?;
+    ///     let reference = PyWeakrefReference::new_bound(&data)?;
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed()),
+    ///         "Processing 'Dave': score = 10"
+    ///     );
+    ///
+    ///     drop(data);
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed()),
+    ///         "The supplied data reference is nolonger relavent."
+    ///     );
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    /// [`weakref.ReferenceType`]: https://docs.python.org/3/library/weakref.html#weakref.ReferenceType
+    /// [`weakref.ref`]: https://docs.python.org/3/library/weakref.html#weakref.ref
+    unsafe fn upgrade_as_unchecked<T>(&self) -> Option<Bound<'py, T>> {
+        Some(self.upgrade()?.downcast_into_unchecked())
+    }
+
+    /// Upgrade the weakref to a Borrowed object reference  unchecked. The type of the recovered object is not checked before downcasting, this could lead to unexpected behavior. Use only when absolutely certain the type can be guaranteed. The `weakref` may still return `None`.
+    ///
+    /// It is named `upgrade_borrowed` to be inline with [rust's `Weak::upgrade`](std::rc::Weak::upgrade).
+    /// In Python it would be equivalent to [`PyWeakref_GetObject`].
+    ///
+    /// # Safety
+    /// Callers must ensure that the type is valid or risk type confusion.
+    /// The `weakref` is still allowed to be `None`, if the referenced object has been cleaned up.
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefReference;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// #[pymethods]
+    /// impl Foo {
+    ///     fn get_data(&self) -> (&str, u32) {
+    ///         ("Dave", 10)
+    ///     }
+    /// }
+    ///
+    /// fn parse_data(reference: Borrowed<'_, '_, PyWeakrefReference>) -> String {
+    ///     if let Some(data_src) = unsafe { reference.upgrade_borrowed_as_unchecked::<Foo>() } {
+    ///         let data = data_src.borrow();
+    ///         let (name, score) = data.get_data();
+    ///         format!("Processing '{}': score = {}", name, score)
+    ///     } else {
+    ///         "The supplied data reference is nolonger relavent.".to_owned()
+    ///     }
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let data = Bound::new(py, Foo{})?;
+    ///     let reference = PyWeakrefReference::new_bound(&data)?;
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed()),
+    ///         "Processing 'Dave': score = 10"
+    ///     );
+    ///
+    ///     drop(data);
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed()),
+    ///         "The supplied data reference is nolonger relavent."
+    ///     );
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    /// [`weakref.ReferenceType`]: https://docs.python.org/3/library/weakref.html#weakref.ReferenceType
+    /// [`weakref.ref`]: https://docs.python.org/3/library/weakref.html#weakref.ref?
+    unsafe fn upgrade_borrowed_as_unchecked<'a, T>(&'a self) -> Option<Borrowed<'a, 'py, T>>
+    where
+        'py: 'a,
+    {
+        Some(self.upgrade_borrowed()?.downcast_unchecked())
+    }
+
+    /// Upgrade the weakref to a exact direct Bound object reference.
+    ///
+    /// It is named `upgrade` to be inline with [rust's `Weak::upgrade`](std::rc::Weak::upgrade).
+    /// In Python it would be equivalent to [`PyWeakref_GetObject`].
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefReference;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// #[pymethods]
+    /// impl Foo {
+    ///     fn get_data(&self) -> (&str, u32) {
+    ///         ("Dave", 10)
+    ///     }
+    /// }
+    ///
+    /// fn parse_data(reference: Borrowed<'_, '_, PyWeakrefReference>) -> PyResult<String> {
+    ///     if let Some(data_src) = reference.upgrade_as_exact::<Foo>()? {
+    ///         let data = data_src.borrow();
+    ///         let (name, score) = data.get_data();
+    ///         Ok(format!("Processing '{}': score = {}", name, score))
+    ///     } else {
+    ///         Ok("The supplied data reference is nolonger relavent.".to_owned())
+    ///     }
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let data = Bound::new(py, Foo{})?;
+    ///     let reference = PyWeakrefReference::new_bound(&data)?;
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "Processing 'Dave': score = 10"
+    ///     );
+    ///
+    ///     drop(data);
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "The supplied data reference is nolonger relavent."
+    ///     );
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    /// [`weakref.ReferenceType`]: https://docs.python.org/3/library/weakref.html#weakref.ReferenceType
+    /// [`weakref.ref`]: https://docs.python.org/3/library/weakref.html#weakref.ref
+    fn upgrade_as_exact<T>(&self) -> PyResult<Option<Bound<'py, T>>>
+    where
+        T: PyTypeInfo,
+    {
+        self.upgrade()
+            .map(Bound::downcast_into_exact)
+            .transpose()
+            .map_err(Into::into)
+    }
+
+    /// Upgrade the weakref to a exact Borrowed object reference.
+    ///
+    /// It is named `upgrade_borrowed` to be inline with [rust's `Weak::upgrade`](std::rc::Weak::upgrade).
+    /// In Python it would be equivalent to [`PyWeakref_GetObject`].
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefReference;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// #[pymethods]
+    /// impl Foo {
+    ///     fn get_data(&self) -> (&str, u32) {
+    ///         ("Dave", 10)
+    ///     }
+    /// }
+    ///
+    /// fn parse_data(reference: Borrowed<'_, '_, PyWeakrefReference>) -> PyResult<String> {
+    ///     if let Some(data_src) = reference.upgrade_borrowed_as_exact::<Foo>()? {
+    ///         let data = data_src.borrow();
+    ///         let (name, score) = data.get_data();
+    ///         Ok(format!("Processing '{}': score = {}", name, score))
+    ///     } else {
+    ///         Ok("The supplied data reference is nolonger relavent.".to_owned())
+    ///     }
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let data = Bound::new(py, Foo{})?;
+    ///     let reference = PyWeakrefReference::new_bound(&data)?;
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "Processing 'Dave': score = 10"
+    ///     );
+    ///
+    ///     drop(data);
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "The supplied data reference is nolonger relavent."
+    ///     );
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    /// [`weakref.ReferenceType`]: https://docs.python.org/3/library/weakref.html#weakref.ReferenceType
+    /// [`weakref.ref`]: https://docs.python.org/3/library/weakref.html#weakref.ref?
+    fn upgrade_borrowed_as_exact<'a, T>(&'a self) -> PyResult<Option<Borrowed<'a, 'py, T>>>
+    where
+        T: PyTypeInfo,
+        'py: 'a,
+    {
+        // TODO: Replace when Borrowed::downcast_exact exists
+        match self.upgrade_borrowed() {
+            None => Ok(None),
+            Some(object) if object.is_exact_instance_of::<T>() => {
+                Ok(Some(unsafe { object.downcast_unchecked() }))
+            }
+            Some(object) => Err(DowncastError::new(&object, T::NAME).into()),
+        }
+    }
+
+    /// Upgrade the weakref to a Bound [`PyAny`] reference to the target object if possible.
+    ///
+    /// It is named `upgrade` to be inline with [rust's `Weak::upgrade`](std::rc::Weak::upgrade).
+    /// This function returns `Some(Bound<'py, PyAny>)` if the reference still exists, otherwise `None` will be returned.
+    ///
+    /// This function gets the optional target of this [`weakref.ReferenceType`] (result of calling [`weakref.ref`]).
+    /// It produces similair results to using [`PyWeakref_GetObject`] in the C api.
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefReference;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// fn parse_data(reference: Borrowed<'_, '_, PyWeakrefReference>) -> PyResult<String> {
+    ///     if let Some(object) = reference.upgrade() {
+    ///         Ok(format!("The object '{}' refered by this reference still exists.", object.getattr("__class__")?.getattr("__qualname__")?))
+    ///     } else {
+    ///         Ok("The object, which this reference refered to, no longer exists".to_owned())
+    ///     }
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let data = Bound::new(py, Foo{})?;
+    ///     let reference = PyWeakrefReference::new_bound(&data)?;
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "The object 'Foo' refered by this reference still exists."
+    ///     );
+    ///
+    ///     drop(data);
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "The object, which this reference refered to, no longer exists"
+    ///     );
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    /// [`weakref.ReferenceType`]: https://docs.python.org/3/library/weakref.html#weakref.ReferenceType
+    /// [`weakref.ref`]: https://docs.python.org/3/library/weakref.html#weakref.ref
+    fn upgrade(&self) -> Option<Bound<'py, PyAny>> {
+        let object = self.get_object();
+
+        if object.is_none() {
+            None
+        } else {
+            Some(object)
+        }
+    }
+
+    /// Upgrade the weakref to a Borrowed [`PyAny`] reference to the target object if possible.
+    ///
+    /// It is named `upgrade_borrowed` to be inline with [rust's `Weak::upgrade`](std::rc::Weak::upgrade).
+    /// This function returns `Some(Borrowed<'_, 'py, PyAny>)` if the reference still exists, otherwise `None` will be returned.
+    ///
+    /// This function gets the optional target of this [`weakref.ReferenceType`] (result of calling [`weakref.ref`]).
+    /// It produces similair results to using [`PyWeakref_GetObject`] in the C api.
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefReference;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// fn parse_data(reference: Borrowed<'_, '_, PyWeakrefReference>) -> PyResult<String> {
+    ///     if let Some(object) = reference.upgrade_borrowed() {
+    ///         Ok(format!("The object '{}' refered by this reference still exists.", object.getattr("__class__")?.getattr("__qualname__")?))
+    ///     } else {
+    ///         Ok("The object, which this reference refered to, no longer exists".to_owned())
+    ///     }
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let data = Bound::new(py, Foo{})?;
+    ///     let reference = PyWeakrefReference::new_bound(&data)?;
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "The object 'Foo' refered by this reference still exists."
+    ///     );
+    ///
+    ///     drop(data);
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "The object, which this reference refered to, no longer exists"
+    ///     );
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    /// [`weakref.ReferenceType`]: https://docs.python.org/3/library/weakref.html#weakref.ReferenceType
+    /// [`weakref.ref`]: https://docs.python.org/3/library/weakref.html#weakref.ref
+    fn upgrade_borrowed<'a>(&'a self) -> Option<Borrowed<'a, 'py, PyAny>>
+    where
+        'py: 'a,
+    {
+        let object = self.get_object_borrowed();
+
+        if object.is_none() {
+            None
+        } else {
+            Some(object)
+        }
+    }
+
+    /// Retrieve to a Bound object pointed to by the weakref.
+    ///
+    /// This function returns `Bound<'py, PyAny>`, which is either the object if it still exists, otherwise it will refer to [`PyNone`](crate::types::PyNone).
+    ///
+    /// This function gets the optional target of this [`weakref.ReferenceType`] (result of calling [`weakref.ref`]).
+    /// It produces similair results to using [`PyWeakref_GetObject`] in the C api.
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefReference;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// fn get_class(reference: Borrowed<'_, '_, PyWeakrefReference>) -> PyResult<String> {
+    ///     reference
+    ///         .get_object()
+    ///         .getattr("__class__")?
+    ///         .repr()
+    ///         .map(|repr| repr.to_string())
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let object = Bound::new(py, Foo{})?;
+    ///     let reference = PyWeakrefReference::new_bound(&object)?;
+    ///
+    ///     assert_eq!(
+    ///         get_class(reference.as_borrowed())?,
+    ///         "<class 'builtins.Foo'>"
+    ///     );
+    ///
+    ///     drop(object);
+    ///
+    ///     assert_eq!(get_class(reference.as_borrowed())?, "<class 'NoneType'>");
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    /// [`weakref.ReferenceType`]: https://docs.python.org/3/library/weakref.html#weakref.ReferenceType
+    /// [`weakref.ref`]: https://docs.python.org/3/library/weakref.html#weakref.ref
+    fn get_object(&self) -> Bound<'py, PyAny> {
+        // PyWeakref_GetObject does some error checking, however we ensure the passed object is Non-Null and a Weakref type.
+        self.get_object_borrowed().to_owned()
+    }
+
+    /// Retrieve to a Borrowed object pointed to by the weakref.
+    ///
+    /// This function returns `Borrowed<'py, PyAny>`, which is either the object if it still exists, otherwise it will refer to [`PyNone`](crate::types::PyNone).
+    ///
+    /// This function gets the optional target of this [`weakref.ReferenceType`] (result of calling [`weakref.ref`]).
+    /// It produces similair results to  using [`PyWeakref_GetObject`] in the C api.
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefReference;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// fn get_class(reference: Borrowed<'_, '_, PyWeakrefReference>) -> PyResult<String> {
+    ///     reference
+    ///         .get_object_borrowed()
+    ///         .getattr("__class__")?
+    ///         .repr()
+    ///         .map(|repr| repr.to_string())
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let object = Bound::new(py, Foo{})?;
+    ///     let reference = PyWeakrefReference::new_bound(&object)?;
+    ///
+    ///     assert_eq!(
+    ///         get_class(reference.as_borrowed())?,
+    ///         "<class 'builtins.Foo'>"
+    ///     );
+    ///
+    ///     drop(object);
+    ///
+    ///     assert_eq!(get_class(reference.as_borrowed())?, "<class 'NoneType'>");
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    /// [`weakref.ReferenceType`]: https://docs.python.org/3/library/weakref.html#weakref.ReferenceType
+    /// [`weakref.ref`]: https://docs.python.org/3/library/weakref.html#weakref.ref
+    #[track_caller]
+    // TODO: This function is the reason every function tracks caller, however it only panics when the weakref object is not actually a weakreference type. So is it this neccessary?
+    fn get_object_borrowed(&self) -> Borrowed<'_, 'py, PyAny>;
+}
+
+impl<'py> PyWeakrefMethods<'py> for Bound<'py, PyWeakref> {
+    fn get_object_borrowed(&self) -> Borrowed<'_, 'py, PyAny> {
+        // PyWeakref_GetObject does some error checking, however we ensure the passed object is Non-Null and a Weakref type.
+        unsafe { ffi::PyWeakref_GetObject(self.as_ptr()).assume_borrowed_or_err(self.py()) }
+             .expect("The 'weakref' weak reference instance should be valid (non-null and actually a weakref reference)")
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::types::any::{PyAny, PyAnyMethods};
+    use crate::types::weakref::{PyWeakref, PyWeakrefMethods, PyWeakrefProxy, PyWeakrefReference};
+    use crate::{Bound, PyResult, Python};
+
+    fn new_reference<'py>(object: &Bound<'py, PyAny>) -> PyResult<Bound<'py, PyWeakref>> {
+        let reference = PyWeakrefReference::new_bound(object)?;
+        reference.into_any().downcast_into().map_err(Into::into)
+    }
+
+    fn new_proxy<'py>(object: &Bound<'py, PyAny>) -> PyResult<Bound<'py, PyWeakref>> {
+        let reference = PyWeakrefProxy::new_bound(object)?;
+        reference.into_any().downcast_into().map_err(Into::into)
+    }
+
+    mod python_class {
+        use super::*;
+        use crate::{py_result_ext::PyResultExt, types::PyType};
+
+        fn get_type(py: Python<'_>) -> PyResult<Bound<'_, PyType>> {
+            py.run_bound("class A:\n    pass\n", None, None)?;
+            py.eval_bound("A", None, None).downcast_into::<PyType>()
+        }
+
+        #[test]
+        fn test_weakref_upgrade_as() -> PyResult<()> {
+            fn inner(
+                create_reference: impl for<'py> FnOnce(
+                    &Bound<'py, PyAny>,
+                )
+                    -> PyResult<Bound<'py, PyWeakref>>,
+            ) -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = create_reference(&object)?;
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = reference.upgrade_as::<PyAny>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()
+                            && obj.is_exact_instance(&class)));
+                    }
+
+                    drop(object);
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = reference.upgrade_as::<PyAny>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            inner(new_reference)?;
+            inner(new_proxy)
+        }
+
+        #[test]
+        fn test_weakref_upgrade_borrowed_as() -> PyResult<()> {
+            fn inner(
+                create_reference: impl for<'py> FnOnce(
+                    &Bound<'py, PyAny>,
+                )
+                    -> PyResult<Bound<'py, PyWeakref>>,
+            ) -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = create_reference(&object)?;
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = reference.upgrade_borrowed_as::<PyAny>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()
+                            && obj.is_exact_instance(&class)));
+                    }
+
+                    drop(object);
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = reference.upgrade_borrowed_as::<PyAny>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            inner(new_reference)?;
+            inner(new_proxy)
+        }
+
+        #[test]
+        fn test_weakref_upgrade_as_unchecked() -> PyResult<()> {
+            fn inner(
+                create_reference: impl for<'py> FnOnce(
+                    &Bound<'py, PyAny>,
+                )
+                    -> PyResult<Bound<'py, PyWeakref>>,
+            ) -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = create_reference(&object)?;
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = unsafe { reference.upgrade_as_unchecked::<PyAny>() };
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()
+                            && obj.is_exact_instance(&class)));
+                    }
+
+                    drop(object);
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = unsafe { reference.upgrade_as_unchecked::<PyAny>() };
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            inner(new_reference)?;
+            inner(new_proxy)
+        }
+
+        #[test]
+        fn test_weakref_upgrade_borrowed_as_unchecked() -> PyResult<()> {
+            fn inner(
+                create_reference: impl for<'py> FnOnce(
+                    &Bound<'py, PyAny>,
+                )
+                    -> PyResult<Bound<'py, PyWeakref>>,
+            ) -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = create_reference(&object)?;
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = unsafe { reference.upgrade_borrowed_as_unchecked::<PyAny>() };
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()
+                            && obj.is_exact_instance(&class)));
+                    }
+
+                    drop(object);
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = unsafe { reference.upgrade_borrowed_as_unchecked::<PyAny>() };
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            inner(new_reference)?;
+            inner(new_proxy)
+        }
+
+        #[test]
+        fn test_weakref_upgrade() -> PyResult<()> {
+            fn inner(
+                create_reference: impl for<'py> FnOnce(
+                    &Bound<'py, PyAny>,
+                )
+                    -> PyResult<Bound<'py, PyWeakref>>,
+                call_retrievable: bool,
+            ) -> PyResult<()> {
+                let not_call_retrievable = !call_retrievable;
+
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = create_reference(&object)?;
+
+                    assert!(not_call_retrievable || reference.call0()?.is(&object));
+                    assert!(reference.upgrade().is_some());
+                    assert!(reference.upgrade().map_or(false, |obj| obj.is(&object)));
+
+                    drop(object);
+
+                    assert!(not_call_retrievable || reference.call0()?.is_none());
+                    assert!(reference.upgrade().is_none());
+
+                    Ok(())
+                })
+            }
+
+            inner(new_reference, true)?;
+            inner(new_proxy, false)
+        }
+
+        #[test]
+        fn test_weakref_upgrade_borrowed() -> PyResult<()> {
+            fn inner(
+                create_reference: impl for<'py> FnOnce(
+                    &Bound<'py, PyAny>,
+                )
+                    -> PyResult<Bound<'py, PyWeakref>>,
+                call_retrievable: bool,
+            ) -> PyResult<()> {
+                let not_call_retrievable = !call_retrievable;
+
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = create_reference(&object)?;
+
+                    assert!(not_call_retrievable || reference.call0()?.is(&object));
+                    assert!(reference.upgrade_borrowed().is_some());
+                    assert!(reference
+                        .upgrade_borrowed()
+                        .map_or(false, |obj| obj.is(&object)));
+
+                    drop(object);
+
+                    assert!(not_call_retrievable || reference.call0()?.is_none());
+                    assert!(reference.upgrade_borrowed().is_none());
+
+                    Ok(())
+                })
+            }
+
+            inner(new_reference, true)?;
+            inner(new_proxy, false)
+        }
+
+        #[test]
+        fn test_weakref_get_object() -> PyResult<()> {
+            fn inner(
+                create_reference: impl for<'py> FnOnce(
+                    &Bound<'py, PyAny>,
+                )
+                    -> PyResult<Bound<'py, PyWeakref>>,
+                call_retrievable: bool,
+            ) -> PyResult<()> {
+                let not_call_retrievable = !call_retrievable;
+
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = create_reference(&object)?;
+
+                    assert!(not_call_retrievable || reference.call0()?.is(&object));
+                    assert!(reference.get_object().is(&object));
+
+                    drop(object);
+
+                    assert!(not_call_retrievable || reference.call0()?.is(&reference.get_object()));
+                    assert!(not_call_retrievable || reference.call0()?.is_none());
+                    assert!(reference.get_object().is_none());
+
+                    Ok(())
+                })
+            }
+
+            inner(new_reference, true)?;
+            inner(new_proxy, false)
+        }
+
+        #[test]
+        fn test_weakref_get_object_borrowed() -> PyResult<()> {
+            fn inner(
+                create_reference: impl for<'py> FnOnce(
+                    &Bound<'py, PyAny>,
+                )
+                    -> PyResult<Bound<'py, PyWeakref>>,
+                call_retrievable: bool,
+            ) -> PyResult<()> {
+                let not_call_retrievable = !call_retrievable;
+
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = create_reference(&object)?;
+
+                    assert!(not_call_retrievable || reference.call0()?.is(&object));
+                    assert!(reference.get_object_borrowed().is(&object));
+
+                    drop(object);
+
+                    assert!(not_call_retrievable || reference.call0()?.is_none());
+                    assert!(reference.get_object_borrowed().is_none());
+
+                    Ok(())
+                })
+            }
+
+            inner(new_reference, true)?;
+            inner(new_proxy, false)
+        }
+    }
+
+    // under 'abi3-py37' and 'abi3-py38' PyClass cannot be weakreferencable.
+    #[cfg(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))))]
+    mod pyo3_pyclass {
+        use super::*;
+        use crate::{pyclass, Py};
+
+        #[pyclass(weakref, crate = "crate")]
+        struct WeakrefablePyClass {}
+
+        #[test]
+        fn test_weakref_upgrade_as() -> PyResult<()> {
+            fn inner(
+                create_reference: impl for<'py> FnOnce(
+                    &Bound<'py, PyAny>,
+                )
+                    -> PyResult<Bound<'py, PyWeakref>>,
+            ) -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = create_reference(object.bind(py))?;
+
+                    {
+                        let obj = reference.upgrade_as::<WeakrefablePyClass>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()));
+                    }
+
+                    drop(object);
+
+                    {
+                        let obj = reference.upgrade_as::<WeakrefablePyClass>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            inner(new_reference)?;
+            inner(new_proxy)
+        }
+
+        #[test]
+        fn test_weakref_upgrade_borrowed_as() -> PyResult<()> {
+            fn inner(
+                create_reference: impl for<'py> FnOnce(
+                    &Bound<'py, PyAny>,
+                )
+                    -> PyResult<Bound<'py, PyWeakref>>,
+            ) -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = create_reference(object.bind(py))?;
+
+                    {
+                        let obj = reference.upgrade_borrowed_as::<WeakrefablePyClass>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()));
+                    }
+
+                    drop(object);
+
+                    {
+                        let obj = reference.upgrade_borrowed_as::<WeakrefablePyClass>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            inner(new_reference)?;
+            inner(new_proxy)
+        }
+
+        #[test]
+        fn test_weakref_upgrade_as_unchecked() -> PyResult<()> {
+            fn inner(
+                create_reference: impl for<'py> FnOnce(
+                    &Bound<'py, PyAny>,
+                )
+                    -> PyResult<Bound<'py, PyWeakref>>,
+            ) -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = create_reference(object.bind(py))?;
+
+                    {
+                        let obj = unsafe { reference.upgrade_as_unchecked::<WeakrefablePyClass>() };
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()));
+                    }
+
+                    drop(object);
+
+                    {
+                        let obj = unsafe { reference.upgrade_as_unchecked::<WeakrefablePyClass>() };
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            inner(new_reference)?;
+            inner(new_proxy)
+        }
+
+        #[test]
+        fn test_weakref_upgrade_borrowed_as_unchecked() -> PyResult<()> {
+            fn inner(
+                create_reference: impl for<'py> FnOnce(
+                    &Bound<'py, PyAny>,
+                )
+                    -> PyResult<Bound<'py, PyWeakref>>,
+            ) -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = create_reference(object.bind(py))?;
+
+                    {
+                        let obj = unsafe {
+                            reference.upgrade_borrowed_as_unchecked::<WeakrefablePyClass>()
+                        };
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()));
+                    }
+
+                    drop(object);
+
+                    {
+                        let obj = unsafe {
+                            reference.upgrade_borrowed_as_unchecked::<WeakrefablePyClass>()
+                        };
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            inner(new_reference)?;
+            inner(new_proxy)
+        }
+
+        #[test]
+        fn test_weakref_upgrade() -> PyResult<()> {
+            fn inner(
+                create_reference: impl for<'py> FnOnce(
+                    &Bound<'py, PyAny>,
+                )
+                    -> PyResult<Bound<'py, PyWeakref>>,
+                call_retrievable: bool,
+            ) -> PyResult<()> {
+                let not_call_retrievable = !call_retrievable;
+
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = create_reference(object.bind(py))?;
+
+                    assert!(not_call_retrievable || reference.call0()?.is(&object));
+                    assert!(reference.upgrade().is_some());
+                    assert!(reference.upgrade().map_or(false, |obj| obj.is(&object)));
+
+                    drop(object);
+
+                    assert!(not_call_retrievable || reference.call0()?.is_none());
+                    assert!(reference.upgrade().is_none());
+
+                    Ok(())
+                })
+            }
+
+            inner(new_reference, true)?;
+            inner(new_proxy, false)
+        }
+
+        #[test]
+        fn test_weakref_upgrade_borrowed() -> PyResult<()> {
+            fn inner(
+                create_reference: impl for<'py> FnOnce(
+                    &Bound<'py, PyAny>,
+                )
+                    -> PyResult<Bound<'py, PyWeakref>>,
+                call_retrievable: bool,
+            ) -> PyResult<()> {
+                let not_call_retrievable = !call_retrievable;
+
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = create_reference(object.bind(py))?;
+
+                    assert!(not_call_retrievable || reference.call0()?.is(&object));
+                    assert!(reference.upgrade_borrowed().is_some());
+                    assert!(reference
+                        .upgrade_borrowed()
+                        .map_or(false, |obj| obj.is(&object)));
+
+                    drop(object);
+
+                    assert!(not_call_retrievable || reference.call0()?.is_none());
+                    assert!(reference.upgrade_borrowed().is_none());
+
+                    Ok(())
+                })
+            }
+
+            inner(new_reference, true)?;
+            inner(new_proxy, false)
+        }
+
+        #[test]
+        fn test_weakref_get_object() -> PyResult<()> {
+            fn inner(
+                create_reference: impl for<'py> FnOnce(
+                    &Bound<'py, PyAny>,
+                )
+                    -> PyResult<Bound<'py, PyWeakref>>,
+                call_retrievable: bool,
+            ) -> PyResult<()> {
+                let not_call_retrievable = !call_retrievable;
+
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = create_reference(object.bind(py))?;
+
+                    assert!(not_call_retrievable || reference.call0()?.is(&object));
+                    assert!(reference.get_object().is(&object));
+
+                    drop(object);
+
+                    assert!(not_call_retrievable || reference.call0()?.is(&reference.get_object()));
+                    assert!(not_call_retrievable || reference.call0()?.is_none());
+                    assert!(reference.get_object().is_none());
+
+                    Ok(())
+                })
+            }
+
+            inner(new_reference, true)?;
+            inner(new_proxy, false)
+        }
+
+        #[test]
+        fn test_weakref_get_object_borrowed() -> PyResult<()> {
+            fn inner(
+                create_reference: impl for<'py> FnOnce(
+                    &Bound<'py, PyAny>,
+                )
+                    -> PyResult<Bound<'py, PyWeakref>>,
+                call_retrievable: bool,
+            ) -> PyResult<()> {
+                let not_call_retrievable = !call_retrievable;
+
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = create_reference(object.bind(py))?;
+
+                    assert!(not_call_retrievable || reference.call0()?.is(&object));
+                    assert!(reference.get_object_borrowed().is(&object));
+
+                    drop(object);
+
+                    assert!(not_call_retrievable || reference.call0()?.is_none());
+                    assert!(reference.get_object_borrowed().is_none());
+
+                    Ok(())
+                })
+            }
+
+            inner(new_reference, true)?;
+            inner(new_proxy, false)
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/weakref/mod.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/weakref/mod.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/weakref/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/weakref/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+pub use anyref::{PyWeakref, PyWeakrefMethods};
+pub use proxy::PyWeakrefProxy;
+pub use reference::PyWeakrefReference;
+
+pub(crate) mod anyref;
+pub(crate) mod proxy;
+pub(crate) mod reference;
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/weakref/proxy.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/weakref/proxy.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/weakref/proxy.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/weakref/proxy.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1688 @@
+use crate::err::PyResult;
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::py_result_ext::PyResultExt;
+use crate::type_object::PyTypeCheck;
+use crate::types::any::PyAny;
+use crate::{ffi, Borrowed, Bound, ToPyObject};
+
+#[cfg(feature = "gil-refs")]
+use crate::{type_object::PyTypeInfo, PyNativeType};
+
+use super::PyWeakrefMethods;
+
+/// Represents any Python `weakref` Proxy type.
+///
+/// In Python this is created by calling `weakref.proxy`.
+/// This is either a `weakref.ProxyType` or a `weakref.CallableProxyType` (`weakref.ProxyTypes`).
+#[repr(transparent)]
+pub struct PyWeakrefProxy(PyAny);
+
+pyobject_native_type_named!(PyWeakrefProxy);
+pyobject_native_type_extract!(PyWeakrefProxy);
+
+// TODO: We known the layout but this cannot be implemented, due to the lack of public typeobject pointers. And it is 2 distinct types
+// #[cfg(not(Py_LIMITED_API))]
+// pyobject_native_type_sized!(PyWeakrefProxy, ffi::PyWeakReference);
+
+impl PyTypeCheck for PyWeakrefProxy {
+    const NAME: &'static str = "weakref.ProxyTypes";
+
+    fn type_check(object: &Bound<'_, PyAny>) -> bool {
+        unsafe { ffi::PyWeakref_CheckProxy(object.as_ptr()) > 0 }
+    }
+}
+
+/// TODO: UPDATE DOCS
+impl PyWeakrefProxy {
+    /// Constructs a new Weak Reference (`weakref.proxy`/`weakref.ProxyType`/`weakref.CallableProxyType`) for the given object.
+    ///
+    /// Returns a `TypeError` if `object` is not weak referenceable (Most native types and PyClasses without `weakref` flag).
+    ///
+    /// # Examples
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefProxy;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let foo = Bound::new(py, Foo {})?;
+    ///     let weakref = PyWeakrefProxy::new_bound(&foo)?;
+    ///     assert!(
+    ///         // In normal situations where a direct `Bound<'py, Foo>` is required use `upgrade::<Foo>`
+    ///         weakref.upgrade()
+    ///             .map_or(false, |obj| obj.is(&foo))
+    ///     );
+    ///
+    ///     let weakref2 = PyWeakrefProxy::new_bound(&foo)?;
+    ///     assert!(weakref.is(&weakref2));
+    ///
+    ///     drop(foo);
+    ///
+    ///     assert!(weakref.upgrade().is_none());
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    #[inline]
+    pub fn new_bound<'py>(object: &Bound<'py, PyAny>) -> PyResult<Bound<'py, PyWeakrefProxy>> {
+        // TODO: Is this inner pattern still necessary Here?
+        fn inner<'py>(object: &Bound<'py, PyAny>) -> PyResult<Bound<'py, PyWeakrefProxy>> {
+            unsafe {
+                Bound::from_owned_ptr_or_err(
+                    object.py(),
+                    ffi::PyWeakref_NewProxy(object.as_ptr(), ffi::Py_None()),
+                )
+                .downcast_into_unchecked()
+            }
+        }
+
+        inner(object)
+    }
+
+    /// Constructs a new Weak Reference (`weakref.proxy`/`weakref.ProxyType`/`weakref.CallableProxyType`) for the given object with a callback.
+    ///
+    /// Returns a `TypeError` if `object` is not weak referenceable (Most native types and PyClasses without `weakref` flag) or if the `callback` is not callable or None.
+    ///
+    /// # Examples
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefProxy;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// #[pyfunction]
+    /// fn callback(wref: Bound<'_, PyWeakrefProxy>) -> PyResult<()> {
+    ///         let py = wref.py();
+    ///         assert!(wref.upgrade_as::<Foo>()?.is_none());
+    ///         py.run_bound("counter = 1", None, None)
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     py.run_bound("counter = 0", None, None)?;
+    ///     assert_eq!(py.eval_bound("counter", None, None)?.extract::<u32>()?, 0);
+    ///     let foo = Bound::new(py, Foo{})?;
+    ///
+    ///     // This is fine.
+    ///     let weakref = PyWeakrefProxy::new_bound_with(&foo, py.None())?;
+    ///     assert!(weakref.upgrade_as::<Foo>()?.is_some());
+    ///     assert!(
+    ///         // In normal situations where a direct `Bound<'py, Foo>` is required use `upgrade::<Foo>`
+    ///         weakref.upgrade()
+    ///             .map_or(false, |obj| obj.is(&foo))
+    ///     );
+    ///     assert_eq!(py.eval_bound("counter", None, None)?.extract::<u32>()?, 0);
+    ///
+    ///     let weakref2 = PyWeakrefProxy::new_bound_with(&foo, wrap_pyfunction_bound!(callback, py)?)?;
+    ///     assert!(!weakref.is(&weakref2)); // Not the same weakref
+    ///     assert!(weakref.eq(&weakref2)?);  // But Equal, since they point to the same object
+    ///
+    ///     drop(foo);
+    ///
+    ///     assert!(weakref.upgrade_as::<Foo>()?.is_none());
+    ///     assert_eq!(py.eval_bound("counter", None, None)?.extract::<u32>()?, 1);
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    #[inline]
+    pub fn new_bound_with<'py, C>(
+        object: &Bound<'py, PyAny>,
+        callback: C,
+    ) -> PyResult<Bound<'py, PyWeakrefProxy>>
+    where
+        C: ToPyObject,
+    {
+        fn inner<'py>(
+            object: &Bound<'py, PyAny>,
+            callback: Bound<'py, PyAny>,
+        ) -> PyResult<Bound<'py, PyWeakrefProxy>> {
+            unsafe {
+                Bound::from_owned_ptr_or_err(
+                    object.py(),
+                    ffi::PyWeakref_NewProxy(object.as_ptr(), callback.as_ptr()),
+                )
+                .downcast_into_unchecked()
+            }
+        }
+
+        let py = object.py();
+        inner(object, callback.to_object(py).into_bound(py))
+    }
+}
+
+/// TODO: UPDATE DOCS
+#[cfg(feature = "gil-refs")]
+impl PyWeakrefProxy {
+    /// Deprecated form of [`PyWeakrefProxy::new_bound`].
+    #[inline]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyWeakrefProxy::new` will be replaced by `PyWeakrefProxy::new_bound` in a future PyO3 version"
+    )]
+    pub fn new<T>(object: &T) -> PyResult<&PyWeakrefProxy>
+    where
+        T: PyNativeType,
+    {
+        Self::new_bound(object.as_borrowed().as_any()).map(Bound::into_gil_ref)
+    }
+
+    /// Deprecated form of [`PyWeakrefProxy::new_bound_with`].
+    #[inline]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyWeakrefProxy::new_with` will be replaced by `PyWeakrefProxy::new_bound_with` in a future PyO3 version"
+    )]
+    pub fn new_with<T, C>(object: &T, callback: C) -> PyResult<&PyWeakrefProxy>
+    where
+        T: PyNativeType,
+        C: ToPyObject,
+    {
+        Self::new_bound_with(object.as_borrowed().as_any(), callback).map(Bound::into_gil_ref)
+    }
+
+    /// Upgrade the weakref to a direct object reference.
+    ///
+    /// It is named `upgrade` to be inline with [rust's `Weak::upgrade`](std::rc::Weak::upgrade).
+    /// In Python it would be equivalent to [`PyWeakref_GetObject`].
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefProxy;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// #[pymethods]
+    /// impl Foo {
+    ///     fn get_data(&self) -> (&str, u32) {
+    ///         ("Dave", 10)
+    ///     }
+    /// }
+    ///
+    /// fn parse_data(reference: Borrowed<'_, '_, PyWeakrefProxy>) -> PyResult<String> {
+    ///     if let Some(data_src) = reference.upgrade_as::<Foo>()? {
+    ///         let data = data_src.borrow();
+    ///         let (name, score) = data.get_data();
+    ///         Ok(format!("Processing '{}': score = {}", name, score))
+    ///     } else {
+    ///         Ok("The supplied data reference is nolonger relavent.".to_owned())
+    ///     }
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let data = Bound::new(py, Foo{})?;
+    ///     let reference = PyWeakrefProxy::new_bound(&data)?;
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "Processing 'Dave': score = 10"
+    ///     );
+    ///
+    ///     drop(data);
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "The supplied data reference is nolonger relavent."
+    ///     );
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    /// [`weakref.ProxyType`]: https://docs.python.org/3/library/weakref.html#weakref.ProxyType
+    /// [`weakref.proxy`]: https://docs.python.org/3/library/weakref.html#weakref.proxy
+    pub fn upgrade_as<T>(&self) -> PyResult<Option<&T::AsRefTarget>>
+    where
+        T: PyTypeCheck,
+    {
+        Ok(self
+            .as_borrowed()
+            .upgrade_as::<T>()?
+            .map(Bound::into_gil_ref))
+    }
+
+    /// Upgrade the weakref to a direct object reference unchecked. The type of the recovered object is not checked before downcasting, this could lead to unexpected behavior. Use only when absolutely certain the type can be guaranteed. The `weakref` may still return `None`.
+    ///
+    /// It is named `upgrade` to be inline with [rust's `Weak::upgrade`](std::rc::Weak::upgrade).
+    /// In Python it would be equivalent to [`PyWeakref_GetObject`].
+    ///
+    /// # Safety
+    /// Callers must ensure that the type is valid or risk type confusion.
+    /// The `weakref` is still allowed to be `None`, if the referenced object has been cleaned up.
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefProxy;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// #[pymethods]
+    /// impl Foo {
+    ///     fn get_data(&self) -> (&str, u32) {
+    ///         ("Dave", 10)
+    ///     }
+    /// }
+    ///
+    /// fn parse_data(reference: Borrowed<'_, '_, PyWeakrefProxy>) -> String {
+    ///     if let Some(data_src) = unsafe { reference.upgrade_as_unchecked::<Foo>() } {
+    ///         let data = data_src.borrow();
+    ///         let (name, score) = data.get_data();
+    ///         format!("Processing '{}': score = {}", name, score)
+    ///     } else {
+    ///         "The supplied data reference is nolonger relavent.".to_owned()
+    ///     }
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let data = Bound::new(py, Foo{})?;
+    ///     let reference = PyWeakrefProxy::new_bound(&data)?;
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed()),
+    ///         "Processing 'Dave': score = 10"
+    ///     );
+    ///
+    ///     drop(data);
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed()),
+    ///         "The supplied data reference is nolonger relavent."
+    ///     );
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    /// [`weakref.ProxyType`]: https://docs.python.org/3/library/weakref.html#weakref.ProxyType
+    /// [`weakref.proxy`]: https://docs.python.org/3/library/weakref.html#weakref.proxy
+    pub unsafe fn upgrade_as_unchecked<T>(&self) -> Option<&T::AsRefTarget>
+    where
+        T: PyTypeCheck,
+    {
+        self.as_borrowed()
+            .upgrade_as_unchecked::<T>()
+            .map(Bound::into_gil_ref)
+    }
+
+    /// Upgrade the weakref to an exact direct object reference.
+    ///
+    /// It is named `upgrade` to be inline with [rust's `Weak::upgrade`](std::rc::Weak::upgrade).
+    /// In Python it would be equivalent to [`PyWeakref_GetObject`].
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefProxy;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// #[pymethods]
+    /// impl Foo {
+    ///     fn get_data(&self) -> (&str, u32) {
+    ///         ("Dave", 10)
+    ///     }
+    /// }
+    ///
+    /// fn parse_data(reference: Borrowed<'_, '_, PyWeakrefProxy>) -> PyResult<String> {
+    ///     if let Some(data_src) = reference.upgrade_as_exact::<Foo>()? {
+    ///         let data = data_src.borrow();
+    ///         let (name, score) = data.get_data();
+    ///         Ok(format!("Processing '{}': score = {}", name, score))
+    ///     } else {
+    ///         Ok("The supplied data reference is nolonger relavent.".to_owned())
+    ///     }
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let data = Bound::new(py, Foo{})?;
+    ///     let reference = PyWeakrefProxy::new_bound(&data)?;
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "Processing 'Dave': score = 10"
+    ///     );
+    ///
+    ///     drop(data);
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "The supplied data reference is nolonger relavent."
+    ///     );
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    /// [`weakref.ProxyType`]: https://docs.python.org/3/library/weakref.html#weakref.ProxyType
+    /// [`weakref.proxy`]: https://docs.python.org/3/library/weakref.html#weakref.proxy
+    pub fn upgrade_as_exact<T>(&self) -> PyResult<Option<&T::AsRefTarget>>
+    where
+        T: PyTypeInfo,
+    {
+        Ok(self
+            .as_borrowed()
+            .upgrade_as_exact::<T>()?
+            .map(Bound::into_gil_ref))
+    }
+
+    /// Upgrade the weakref to a [`PyAny`] reference to the target if possible.
+    ///
+    /// It is named `upgrade` to be inline with [rust's `Weak::upgrade`](std::rc::Weak::upgrade).
+    /// This function returns `Some(&'py PyAny)` if the reference still exists, otherwise `None` will be returned.
+    ///
+    /// This function gets the optional target of this [`weakref.ProxyType`] (or [`weakref.CallableProxyType`], result of calling [`weakref.proxy`]).
+    /// It produces similair results using [`PyWeakref_GetObject`] in the C api.
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefProxy;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// fn parse_data(reference: Borrowed<'_, '_, PyWeakrefProxy>) -> PyResult<String> {
+    ///     if let Some(object) = reference.upgrade() {
+    ///         Ok(format!("The object '{}' refered by this reference still exists.", object.getattr("__class__")?.getattr("__qualname__")?))
+    ///     } else {
+    ///         Ok("The object, which this reference refered to, no longer exists".to_owned())
+    ///     }
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let data = Bound::new(py, Foo{})?;
+    ///     let reference = PyWeakrefProxy::new_bound(&data)?;
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "The object 'Foo' refered by this reference still exists."
+    ///     );
+    ///
+    ///     drop(data);
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "The object, which this reference refered to, no longer exists"
+    ///     );
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    /// [`weakref.ProxyType`]: https://docs.python.org/3/library/weakref.html#weakref.ProxyType
+    /// [`weakref.CallableProxyType`]: https://docs.python.org/3/library/weakref.html#weakref.CallableProxyType
+    /// [`weakref.proxy`]: https://docs.python.org/3/library/weakref.html#weakref.proxy
+    pub fn upgrade(&self) -> Option<&'_ PyAny> {
+        self.as_borrowed().upgrade().map(Bound::into_gil_ref)
+    }
+
+    /// Retrieve to a object pointed to by the weakref.
+    ///
+    /// This function returns `&'py PyAny`, which is either the object if it still exists, otherwise it will refer to [`PyNone`](crate::types::PyNone).
+    ///
+    /// This function gets the optional target of this [`weakref.ProxyType`] (or [`weakref.CallableProxyType`], result of calling [`weakref.proxy`]).
+    /// It produces similair results using [`PyWeakref_GetObject`] in the C api.
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefProxy;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// fn get_class(reference: Borrowed<'_, '_, PyWeakrefProxy>) -> PyResult<String> {
+    ///     reference
+    ///         .get_object()
+    ///         .getattr("__class__")?
+    ///         .repr()
+    ///         .map(|repr| repr.to_string())
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let object = Bound::new(py, Foo{})?;
+    ///     let reference = PyWeakrefProxy::new_bound(&object)?;
+    ///
+    ///     assert_eq!(
+    ///         get_class(reference.as_borrowed())?,
+    ///         "<class 'builtins.Foo'>"
+    ///     );
+    ///
+    ///     drop(object);
+    ///
+    ///     assert_eq!(get_class(reference.as_borrowed())?, "<class 'NoneType'>");
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    /// [`weakref.ProxyType`]: https://docs.python.org/3/library/weakref.html#weakref.ProxyType
+    /// [`weakref.CallableProxyType`]: https://docs.python.org/3/library/weakref.html#weakref.CallableProxyType
+    /// [`weakref.proxy`]: https://docs.python.org/3/library/weakref.html#weakref.proxy
+    pub fn get_object(&self) -> &'_ PyAny {
+        self.as_borrowed().get_object().into_gil_ref()
+    }
+}
+
+impl<'py> PyWeakrefMethods<'py> for Bound<'py, PyWeakrefProxy> {
+    fn get_object_borrowed(&self) -> Borrowed<'_, 'py, PyAny> {
+        // PyWeakref_GetObject does some error checking, however we ensure the passed object is Non-Null and a Weakref type.
+        unsafe { ffi::PyWeakref_GetObject(self.as_ptr()).assume_borrowed_or_err(self.py()) }
+            .expect("The 'weakref.ProxyType' (or `weakref.CallableProxyType`) instance should be valid (non-null and actually a weakref reference)")
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::exceptions::{PyAttributeError, PyReferenceError, PyTypeError};
+    use crate::types::any::{PyAny, PyAnyMethods};
+    use crate::types::weakref::{PyWeakrefMethods, PyWeakrefProxy};
+    use crate::{Bound, PyResult, Python};
+
+    #[cfg(all(Py_3_13, not(Py_LIMITED_API)))]
+    const DEADREF_FIX: Option<&str> = None;
+    #[cfg(all(not(Py_3_13), not(Py_LIMITED_API)))]
+    const DEADREF_FIX: Option<&str> = Some("NoneType");
+
+    #[cfg(not(Py_LIMITED_API))]
+    fn check_repr(
+        reference: &Bound<'_, PyWeakrefProxy>,
+        object: &Bound<'_, PyAny>,
+        class: Option<&str>,
+    ) -> PyResult<()> {
+        let repr = reference.repr()?.to_string();
+
+        #[cfg(Py_3_13)]
+        let (first_part, second_part) = repr.split_once(';').unwrap();
+        #[cfg(not(Py_3_13))]
+        let (first_part, second_part) = repr.split_once(" to ").unwrap();
+
+        {
+            let (msg, addr) = first_part.split_once("0x").unwrap();
+
+            assert_eq!(msg, "<weakproxy at ");
+            assert!(addr
+                .to_lowercase()
+                .contains(format!("{:x?}", reference.as_ptr()).split_at(2).1));
+        }
+
+        if let Some(class) = class.or(DEADREF_FIX) {
+            let (msg, addr) = second_part.split_once("0x").unwrap();
+
+            // Avoids not succeeding at unreliable quotation (Python 3.13-dev adds ' around classname without documenting)
+            #[cfg(Py_3_13)]
+            assert!(msg.starts_with(" to '"));
+            assert!(msg.contains(class));
+            assert!(msg.ends_with(" at "));
+
+            assert!(addr
+                .to_lowercase()
+                .contains(format!("{:x?}", object.as_ptr()).split_at(2).1));
+        } else {
+            assert!(second_part.contains("dead"));
+        }
+
+        Ok(())
+    }
+
+    mod proxy {
+        use super::*;
+
+        #[cfg(all(not(Py_LIMITED_API), Py_3_10))]
+        const CLASS_NAME: &str = "'weakref.ProxyType'";
+        #[cfg(all(not(Py_LIMITED_API), not(Py_3_10)))]
+        const CLASS_NAME: &str = "'weakproxy'";
+
+        mod python_class {
+            use super::*;
+            use crate::{py_result_ext::PyResultExt, types::PyType};
+
+            fn get_type(py: Python<'_>) -> PyResult<Bound<'_, PyType>> {
+                py.run_bound("class A:\n    pass\n", None, None)?;
+                py.eval_bound("A", None, None).downcast_into::<PyType>()
+            }
+
+            #[test]
+            fn test_weakref_proxy_behavior() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = PyWeakrefProxy::new_bound(&object)?;
+
+                    assert!(!reference.is(&object));
+                    assert!(reference.get_object().is(&object));
+
+                    #[cfg(not(Py_LIMITED_API))]
+                    assert_eq!(
+                        reference.get_type().to_string(),
+                        format!("<class {}>", CLASS_NAME)
+                    );
+
+                    assert_eq!(
+                        reference.getattr("__class__")?.to_string(),
+                        "<class '__main__.A'>"
+                    );
+                    #[cfg(not(Py_LIMITED_API))]
+                    check_repr(&reference, &object, Some("A"))?;
+
+                    assert!(reference
+                        .getattr("__callback__")
+                        .err()
+                        .map_or(false, |err| err.is_instance_of::<PyAttributeError>(py)));
+
+                    assert!(reference.call0().err().map_or(false, |err| {
+                        let result = err.is_instance_of::<PyTypeError>(py);
+                        #[cfg(not(Py_LIMITED_API))]
+                        let result = result
+                            & (err.value_bound(py).to_string()
+                                == format!("{} object is not callable", CLASS_NAME));
+                        result
+                    }));
+
+                    drop(object);
+
+                    assert!(reference.get_object().is_none());
+                    assert!(reference
+                        .getattr("__class__")
+                        .err()
+                        .map_or(false, |err| err.is_instance_of::<PyReferenceError>(py)));
+                    #[cfg(not(Py_LIMITED_API))]
+                    check_repr(&reference, py.None().bind(py), None)?;
+
+                    assert!(reference
+                        .getattr("__callback__")
+                        .err()
+                        .map_or(false, |err| err.is_instance_of::<PyReferenceError>(py)));
+
+                    assert!(reference.call0().err().map_or(false, |err| {
+                        let result = err.is_instance_of::<PyTypeError>(py);
+                        #[cfg(not(Py_LIMITED_API))]
+                        let result = result
+                            & (err.value_bound(py).to_string()
+                                == format!("{} object is not callable", CLASS_NAME));
+                        result
+                    }));
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade_as() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = PyWeakrefProxy::new_bound(&object)?;
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = reference.upgrade_as::<PyAny>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()
+                            && obj.is_exact_instance(&class)));
+                    }
+
+                    drop(object);
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = reference.upgrade_as::<PyAny>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade_borrowed_as() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = PyWeakrefProxy::new_bound(&object)?;
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = reference.upgrade_borrowed_as::<PyAny>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()
+                            && obj.is_exact_instance(&class)));
+                    }
+
+                    drop(object);
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = reference.upgrade_borrowed_as::<PyAny>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade_as_unchecked() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = PyWeakrefProxy::new_bound(&object)?;
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = unsafe { reference.upgrade_as_unchecked::<PyAny>() };
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()
+                            && obj.is_exact_instance(&class)));
+                    }
+
+                    drop(object);
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = unsafe { reference.upgrade_as_unchecked::<PyAny>() };
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade_borrowed_as_unchecked() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = PyWeakrefProxy::new_bound(&object)?;
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = unsafe { reference.upgrade_borrowed_as_unchecked::<PyAny>() };
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()
+                            && obj.is_exact_instance(&class)));
+                    }
+
+                    drop(object);
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = unsafe { reference.upgrade_borrowed_as_unchecked::<PyAny>() };
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = PyWeakrefProxy::new_bound(&object)?;
+
+                    assert!(reference.upgrade().is_some());
+                    assert!(reference.upgrade().map_or(false, |obj| obj.is(&object)));
+
+                    drop(object);
+
+                    assert!(reference.upgrade().is_none());
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade_borrowed() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = PyWeakrefProxy::new_bound(&object)?;
+
+                    assert!(reference.upgrade_borrowed().is_some());
+                    assert!(reference
+                        .upgrade_borrowed()
+                        .map_or(false, |obj| obj.is(&object)));
+
+                    drop(object);
+
+                    assert!(reference.upgrade_borrowed().is_none());
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_get_object() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = PyWeakrefProxy::new_bound(&object)?;
+
+                    assert!(reference.get_object().is(&object));
+
+                    drop(object);
+
+                    assert!(reference.get_object().is_none());
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_get_object_borrowed() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = PyWeakrefProxy::new_bound(&object)?;
+
+                    assert!(reference.get_object_borrowed().is(&object));
+
+                    drop(object);
+
+                    assert!(reference.get_object_borrowed().is_none());
+
+                    Ok(())
+                })
+            }
+        }
+
+        // under 'abi3-py37' and 'abi3-py38' PyClass cannot be weakreferencable.
+        #[cfg(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))))]
+        mod pyo3_pyclass {
+            use super::*;
+            use crate::{pyclass, Py};
+
+            #[pyclass(weakref, crate = "crate")]
+            struct WeakrefablePyClass {}
+
+            #[test]
+            fn test_weakref_proxy_behavior() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object: Bound<'_, WeakrefablePyClass> =
+                        Bound::new(py, WeakrefablePyClass {})?;
+                    let reference = PyWeakrefProxy::new_bound(&object)?;
+
+                    assert!(!reference.is(&object));
+                    assert!(reference.get_object().is(&object));
+                    #[cfg(not(Py_LIMITED_API))]
+                    assert_eq!(
+                        reference.get_type().to_string(),
+                        format!("<class {}>", CLASS_NAME)
+                    );
+
+                    assert_eq!(
+                        reference.getattr("__class__")?.to_string(),
+                        "<class 'builtins.WeakrefablePyClass'>"
+                    );
+                    #[cfg(not(Py_LIMITED_API))]
+                    check_repr(&reference, object.as_any(), Some("WeakrefablePyClass"))?;
+
+                    assert!(reference
+                        .getattr("__callback__")
+                        .err()
+                        .map_or(false, |err| err.is_instance_of::<PyAttributeError>(py)));
+
+                    assert!(reference.call0().err().map_or(false, |err| {
+                        let result = err.is_instance_of::<PyTypeError>(py);
+                        #[cfg(not(Py_LIMITED_API))]
+                        let result = result
+                            & (err.value_bound(py).to_string()
+                                == format!("{} object is not callable", CLASS_NAME));
+                        result
+                    }));
+
+                    drop(object);
+
+                    assert!(reference.get_object().is_none());
+                    assert!(reference
+                        .getattr("__class__")
+                        .err()
+                        .map_or(false, |err| err.is_instance_of::<PyReferenceError>(py)));
+                    #[cfg(not(Py_LIMITED_API))]
+                    check_repr(&reference, py.None().bind(py), None)?;
+
+                    assert!(reference
+                        .getattr("__callback__")
+                        .err()
+                        .map_or(false, |err| err.is_instance_of::<PyReferenceError>(py)));
+
+                    assert!(reference.call0().err().map_or(false, |err| {
+                        let result = err.is_instance_of::<PyTypeError>(py);
+                        #[cfg(not(Py_LIMITED_API))]
+                        let result = result
+                            & (err.value_bound(py).to_string()
+                                == format!("{} object is not callable", CLASS_NAME));
+                        result
+                    }));
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade_as() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = PyWeakrefProxy::new_bound(object.bind(py))?;
+
+                    {
+                        let obj = reference.upgrade_as::<WeakrefablePyClass>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()));
+                    }
+
+                    drop(object);
+
+                    {
+                        let obj = reference.upgrade_as::<WeakrefablePyClass>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade_borrowed_as() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = PyWeakrefProxy::new_bound(object.bind(py))?;
+
+                    {
+                        let obj = reference.upgrade_borrowed_as::<WeakrefablePyClass>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()));
+                    }
+
+                    drop(object);
+
+                    {
+                        let obj = reference.upgrade_borrowed_as::<WeakrefablePyClass>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade_as_unchecked() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = PyWeakrefProxy::new_bound(object.bind(py))?;
+
+                    {
+                        let obj = unsafe { reference.upgrade_as_unchecked::<WeakrefablePyClass>() };
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()));
+                    }
+
+                    drop(object);
+
+                    {
+                        let obj = unsafe { reference.upgrade_as_unchecked::<WeakrefablePyClass>() };
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade_borrowed_as_unchecked() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = PyWeakrefProxy::new_bound(object.bind(py))?;
+
+                    {
+                        let obj = unsafe {
+                            reference.upgrade_borrowed_as_unchecked::<WeakrefablePyClass>()
+                        };
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()));
+                    }
+
+                    drop(object);
+
+                    {
+                        let obj = unsafe {
+                            reference.upgrade_borrowed_as_unchecked::<WeakrefablePyClass>()
+                        };
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = PyWeakrefProxy::new_bound(object.bind(py))?;
+
+                    assert!(reference.upgrade().is_some());
+                    assert!(reference.upgrade().map_or(false, |obj| obj.is(&object)));
+
+                    drop(object);
+
+                    assert!(reference.upgrade().is_none());
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade_borrowed() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = PyWeakrefProxy::new_bound(object.bind(py))?;
+
+                    assert!(reference.upgrade_borrowed().is_some());
+                    assert!(reference
+                        .upgrade_borrowed()
+                        .map_or(false, |obj| obj.is(&object)));
+
+                    drop(object);
+
+                    assert!(reference.upgrade_borrowed().is_none());
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_get_object() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = PyWeakrefProxy::new_bound(object.bind(py))?;
+
+                    assert!(reference.get_object().is(&object));
+
+                    drop(object);
+
+                    assert!(reference.get_object().is_none());
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_get_object_borrowed() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = PyWeakrefProxy::new_bound(object.bind(py))?;
+
+                    assert!(reference.get_object_borrowed().is(&object));
+
+                    drop(object);
+
+                    assert!(reference.get_object_borrowed().is_none());
+
+                    Ok(())
+                })
+            }
+        }
+    }
+
+    mod callable_proxy {
+        use super::*;
+
+        #[cfg(all(not(Py_LIMITED_API), Py_3_10))]
+        const CLASS_NAME: &str = "<class 'weakref.CallableProxyType'>";
+        #[cfg(all(not(Py_LIMITED_API), not(Py_3_10)))]
+        const CLASS_NAME: &str = "<class 'weakcallableproxy'>";
+
+        mod python_class {
+            use super::*;
+            use crate::{py_result_ext::PyResultExt, types::PyType};
+
+            fn get_type(py: Python<'_>) -> PyResult<Bound<'_, PyType>> {
+                py.run_bound(
+                    "class A:\n    def __call__(self):\n        return 'This class is callable!'\n",
+                    None,
+                    None,
+                )?;
+                py.eval_bound("A", None, None).downcast_into::<PyType>()
+            }
+
+            #[test]
+            fn test_weakref_proxy_behavior() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = PyWeakrefProxy::new_bound(&object)?;
+
+                    assert!(!reference.is(&object));
+                    assert!(reference.get_object().is(&object));
+                    #[cfg(not(Py_LIMITED_API))]
+                    assert_eq!(reference.get_type().to_string(), CLASS_NAME);
+
+                    assert_eq!(
+                        reference.getattr("__class__")?.to_string(),
+                        "<class '__main__.A'>"
+                    );
+                    #[cfg(not(Py_LIMITED_API))]
+                    check_repr(&reference, &object, Some("A"))?;
+
+                    assert!(reference
+                        .getattr("__callback__")
+                        .err()
+                        .map_or(false, |err| err.is_instance_of::<PyAttributeError>(py)));
+
+                    assert_eq!(reference.call0()?.to_string(), "This class is callable!");
+
+                    drop(object);
+
+                    assert!(reference.get_object().is_none());
+                    assert!(reference
+                        .getattr("__class__")
+                        .err()
+                        .map_or(false, |err| err.is_instance_of::<PyReferenceError>(py)));
+                    #[cfg(not(Py_LIMITED_API))]
+                    check_repr(&reference, py.None().bind(py), None)?;
+
+                    assert!(reference
+                        .getattr("__callback__")
+                        .err()
+                        .map_or(false, |err| err.is_instance_of::<PyReferenceError>(py)));
+
+                    assert!(reference
+                        .call0()
+                        .err()
+                        .map_or(false, |err| err.is_instance_of::<PyReferenceError>(py)
+                            & (err.value_bound(py).to_string()
+                                == "weakly-referenced object no longer exists")));
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade_as() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = PyWeakrefProxy::new_bound(&object)?;
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = reference.upgrade_as::<PyAny>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()
+                            && obj.is_exact_instance(&class)));
+                    }
+
+                    drop(object);
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = reference.upgrade_as::<PyAny>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade_borrowed_as() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = PyWeakrefProxy::new_bound(&object)?;
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = reference.upgrade_borrowed_as::<PyAny>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()
+                            && obj.is_exact_instance(&class)));
+                    }
+
+                    drop(object);
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = reference.upgrade_borrowed_as::<PyAny>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade_as_unchecked() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = PyWeakrefProxy::new_bound(&object)?;
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = unsafe { reference.upgrade_as_unchecked::<PyAny>() };
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()
+                            && obj.is_exact_instance(&class)));
+                    }
+
+                    drop(object);
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = unsafe { reference.upgrade_as_unchecked::<PyAny>() };
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade_borrowed_as_unchecked() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = PyWeakrefProxy::new_bound(&object)?;
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = unsafe { reference.upgrade_borrowed_as_unchecked::<PyAny>() };
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()
+                            && obj.is_exact_instance(&class)));
+                    }
+
+                    drop(object);
+
+                    {
+                        // This test is a bit weird but ok.
+                        let obj = unsafe { reference.upgrade_borrowed_as_unchecked::<PyAny>() };
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = PyWeakrefProxy::new_bound(&object)?;
+
+                    assert!(reference.upgrade().is_some());
+                    assert!(reference.upgrade().map_or(false, |obj| obj.is(&object)));
+
+                    drop(object);
+
+                    assert!(reference.upgrade().is_none());
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade_borrowed() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = PyWeakrefProxy::new_bound(&object)?;
+
+                    assert!(reference.upgrade_borrowed().is_some());
+                    assert!(reference
+                        .upgrade_borrowed()
+                        .map_or(false, |obj| obj.is(&object)));
+
+                    drop(object);
+
+                    assert!(reference.upgrade_borrowed().is_none());
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_get_object() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = PyWeakrefProxy::new_bound(&object)?;
+
+                    assert!(reference.get_object().is(&object));
+
+                    drop(object);
+
+                    assert!(reference.get_object().is_none());
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_get_object_borrowed() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let class = get_type(py)?;
+                    let object = class.call0()?;
+                    let reference = PyWeakrefProxy::new_bound(&object)?;
+
+                    assert!(reference.get_object_borrowed().is(&object));
+
+                    drop(object);
+
+                    assert!(reference.get_object_borrowed().is_none());
+
+                    Ok(())
+                })
+            }
+        }
+
+        // under 'abi3-py37' and 'abi3-py38' PyClass cannot be weakreferencable.
+        #[cfg(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))))]
+        mod pyo3_pyclass {
+            use super::*;
+            use crate::{pyclass, pymethods, Py};
+
+            #[pyclass(weakref, crate = "crate")]
+            struct WeakrefablePyClass {}
+
+            #[pymethods(crate = "crate")]
+            impl WeakrefablePyClass {
+                fn __call__(&self) -> &str {
+                    "This class is callable!"
+                }
+            }
+
+            #[test]
+            fn test_weakref_proxy_behavior() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object: Bound<'_, WeakrefablePyClass> =
+                        Bound::new(py, WeakrefablePyClass {})?;
+                    let reference = PyWeakrefProxy::new_bound(&object)?;
+
+                    assert!(!reference.is(&object));
+                    assert!(reference.get_object().is(&object));
+                    #[cfg(not(Py_LIMITED_API))]
+                    assert_eq!(reference.get_type().to_string(), CLASS_NAME);
+
+                    assert_eq!(
+                        reference.getattr("__class__")?.to_string(),
+                        "<class 'builtins.WeakrefablePyClass'>"
+                    );
+                    #[cfg(not(Py_LIMITED_API))]
+                    check_repr(&reference, object.as_any(), Some("WeakrefablePyClass"))?;
+
+                    assert!(reference
+                        .getattr("__callback__")
+                        .err()
+                        .map_or(false, |err| err.is_instance_of::<PyAttributeError>(py)));
+
+                    assert_eq!(reference.call0()?.to_string(), "This class is callable!");
+
+                    drop(object);
+
+                    assert!(reference.get_object().is_none());
+                    assert!(reference
+                        .getattr("__class__")
+                        .err()
+                        .map_or(false, |err| err.is_instance_of::<PyReferenceError>(py)));
+                    #[cfg(not(Py_LIMITED_API))]
+                    check_repr(&reference, py.None().bind(py), None)?;
+
+                    assert!(reference
+                        .getattr("__callback__")
+                        .err()
+                        .map_or(false, |err| err.is_instance_of::<PyReferenceError>(py)));
+
+                    assert!(reference
+                        .call0()
+                        .err()
+                        .map_or(false, |err| err.is_instance_of::<PyReferenceError>(py)
+                            & (err.value_bound(py).to_string()
+                                == "weakly-referenced object no longer exists")));
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade_as() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = PyWeakrefProxy::new_bound(object.bind(py))?;
+
+                    {
+                        let obj = reference.upgrade_as::<WeakrefablePyClass>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()));
+                    }
+
+                    drop(object);
+
+                    {
+                        let obj = reference.upgrade_as::<WeakrefablePyClass>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+            #[test]
+            fn test_weakref_upgrade_borrowed_as() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = PyWeakrefProxy::new_bound(object.bind(py))?;
+
+                    {
+                        let obj = reference.upgrade_borrowed_as::<WeakrefablePyClass>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()));
+                    }
+
+                    drop(object);
+
+                    {
+                        let obj = reference.upgrade_borrowed_as::<WeakrefablePyClass>();
+
+                        assert!(obj.is_ok());
+                        let obj = obj.unwrap();
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade_as_unchecked() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = PyWeakrefProxy::new_bound(object.bind(py))?;
+
+                    {
+                        let obj = unsafe { reference.upgrade_as_unchecked::<WeakrefablePyClass>() };
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()));
+                    }
+
+                    drop(object);
+
+                    {
+                        let obj = unsafe { reference.upgrade_as_unchecked::<WeakrefablePyClass>() };
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+            #[test]
+            fn test_weakref_upgrade_borrowed_as_unchecked() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = PyWeakrefProxy::new_bound(object.bind(py))?;
+
+                    {
+                        let obj = unsafe {
+                            reference.upgrade_borrowed_as_unchecked::<WeakrefablePyClass>()
+                        };
+
+                        assert!(obj.is_some());
+                        assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()));
+                    }
+
+                    drop(object);
+
+                    {
+                        let obj = unsafe {
+                            reference.upgrade_borrowed_as_unchecked::<WeakrefablePyClass>()
+                        };
+
+                        assert!(obj.is_none());
+                    }
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = PyWeakrefProxy::new_bound(object.bind(py))?;
+
+                    assert!(reference.upgrade().is_some());
+                    assert!(reference.upgrade().map_or(false, |obj| obj.is(&object)));
+
+                    drop(object);
+
+                    assert!(reference.upgrade().is_none());
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_upgrade_borrowed() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = PyWeakrefProxy::new_bound(object.bind(py))?;
+
+                    assert!(reference.upgrade_borrowed().is_some());
+                    assert!(reference
+                        .upgrade_borrowed()
+                        .map_or(false, |obj| obj.is(&object)));
+
+                    drop(object);
+
+                    assert!(reference.upgrade_borrowed().is_none());
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_get_object() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = PyWeakrefProxy::new_bound(object.bind(py))?;
+
+                    assert!(reference.get_object().is(&object));
+
+                    drop(object);
+
+                    assert!(reference.get_object().is_none());
+
+                    Ok(())
+                })
+            }
+
+            #[test]
+            fn test_weakref_get_object_borrowed() -> PyResult<()> {
+                Python::with_gil(|py| {
+                    let object = Py::new(py, WeakrefablePyClass {})?;
+                    let reference = PyWeakrefProxy::new_bound(object.bind(py))?;
+
+                    assert!(reference.get_object_borrowed().is(&object));
+
+                    drop(object);
+
+                    assert!(reference.get_object_borrowed().is_none());
+
+                    Ok(())
+                })
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/types/weakref/reference.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/weakref/reference.rs
--- 43.0.0-1/rust-vendor/pyo3/src/types/weakref/reference.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/types/weakref/reference.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1119 @@
+use crate::err::PyResult;
+use crate::ffi_ptr_ext::FfiPtrExt;
+use crate::py_result_ext::PyResultExt;
+use crate::types::any::PyAny;
+use crate::{ffi, Borrowed, Bound, ToPyObject};
+
+#[cfg(any(any(PyPy, GraalPy, Py_LIMITED_API), feature = "gil-refs"))]
+use crate::type_object::PyTypeCheck;
+#[cfg(feature = "gil-refs")]
+use crate::{type_object::PyTypeInfo, PyNativeType};
+
+use super::PyWeakrefMethods;
+
+/// Represents a Python `weakref.ReferenceType`.
+///
+/// In Python this is created by calling `weakref.ref`.
+#[repr(transparent)]
+pub struct PyWeakrefReference(PyAny);
+
+#[cfg(not(any(PyPy, GraalPy, Py_LIMITED_API)))]
+pyobject_native_type!(
+    PyWeakrefReference,
+    ffi::PyWeakReference,
+    pyobject_native_static_type_object!(ffi::_PyWeakref_RefType),
+    #module=Some("weakref"),
+    #checkfunction=ffi::PyWeakref_CheckRefExact
+);
+
+// When targetting alternative or multiple interpreters, it is better to not use the internal API.
+#[cfg(any(PyPy, GraalPy, Py_LIMITED_API))]
+pyobject_native_type_named!(PyWeakrefReference);
+#[cfg(any(PyPy, GraalPy, Py_LIMITED_API))]
+pyobject_native_type_extract!(PyWeakrefReference);
+
+#[cfg(any(PyPy, GraalPy, Py_LIMITED_API))]
+impl PyTypeCheck for PyWeakrefReference {
+    const NAME: &'static str = "weakref.ReferenceType";
+
+    fn type_check(object: &Bound<'_, PyAny>) -> bool {
+        unsafe { ffi::PyWeakref_CheckRef(object.as_ptr()) > 0 }
+    }
+}
+
+impl PyWeakrefReference {
+    /// Constructs a new Weak Reference (`weakref.ref`/`weakref.ReferenceType`) for the given object.
+    ///
+    /// Returns a `TypeError` if `object` is not weak referenceable (Most native types and PyClasses without `weakref` flag).
+    ///
+    /// # Examples
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefReference;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let foo = Bound::new(py, Foo {})?;
+    ///     let weakref = PyWeakrefReference::new_bound(&foo)?;
+    ///     assert!(
+    ///         // In normal situations where a direct `Bound<'py, Foo>` is required use `upgrade::<Foo>`
+    ///         weakref.upgrade()
+    ///             .map_or(false, |obj| obj.is(&foo))
+    ///     );
+    ///
+    ///     let weakref2 = PyWeakrefReference::new_bound(&foo)?;
+    ///     assert!(weakref.is(&weakref2));
+    ///
+    ///     drop(foo);
+    ///
+    ///     assert!(weakref.upgrade().is_none());
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    pub fn new_bound<'py>(object: &Bound<'py, PyAny>) -> PyResult<Bound<'py, PyWeakrefReference>> {
+        // TODO: Is this inner pattern still necessary Here?
+        fn inner<'py>(object: &Bound<'py, PyAny>) -> PyResult<Bound<'py, PyWeakrefReference>> {
+            unsafe {
+                Bound::from_owned_ptr_or_err(
+                    object.py(),
+                    ffi::PyWeakref_NewRef(object.as_ptr(), ffi::Py_None()),
+                )
+                .downcast_into_unchecked()
+            }
+        }
+
+        inner(object)
+    }
+
+    /// Constructs a new Weak Reference (`weakref.ref`/`weakref.ReferenceType`) for the given object with a callback.
+    ///
+    /// Returns a `TypeError` if `object` is not weak referenceable (Most native types and PyClasses without `weakref` flag) or if the `callback` is not callable or None.
+    ///
+    /// # Examples
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefReference;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// #[pyfunction]
+    /// fn callback(wref: Bound<'_, PyWeakrefReference>) -> PyResult<()> {
+    ///         let py = wref.py();
+    ///         assert!(wref.upgrade_as::<Foo>()?.is_none());
+    ///         py.run_bound("counter = 1", None, None)
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     py.run_bound("counter = 0", None, None)?;
+    ///     assert_eq!(py.eval_bound("counter", None, None)?.extract::<u32>()?, 0);
+    ///     let foo = Bound::new(py, Foo{})?;
+    ///
+    ///     // This is fine.
+    ///     let weakref = PyWeakrefReference::new_bound_with(&foo, py.None())?;
+    ///     assert!(weakref.upgrade_as::<Foo>()?.is_some());
+    ///     assert!(
+    ///         // In normal situations where a direct `Bound<'py, Foo>` is required use `upgrade::<Foo>`
+    ///         weakref.upgrade()
+    ///             .map_or(false, |obj| obj.is(&foo))
+    ///     );
+    ///     assert_eq!(py.eval_bound("counter", None, None)?.extract::<u32>()?, 0);
+    ///
+    ///     let weakref2 = PyWeakrefReference::new_bound_with(&foo, wrap_pyfunction_bound!(callback, py)?)?;
+    ///     assert!(!weakref.is(&weakref2)); // Not the same weakref
+    ///     assert!(weakref.eq(&weakref2)?);  // But Equal, since they point to the same object
+    ///
+    ///     drop(foo);
+    ///
+    ///     assert!(weakref.upgrade_as::<Foo>()?.is_none());
+    ///     assert_eq!(py.eval_bound("counter", None, None)?.extract::<u32>()?, 1);
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    pub fn new_bound_with<'py, C>(
+        object: &Bound<'py, PyAny>,
+        callback: C,
+    ) -> PyResult<Bound<'py, PyWeakrefReference>>
+    where
+        C: ToPyObject,
+    {
+        fn inner<'py>(
+            object: &Bound<'py, PyAny>,
+            callback: Bound<'py, PyAny>,
+        ) -> PyResult<Bound<'py, PyWeakrefReference>> {
+            unsafe {
+                Bound::from_owned_ptr_or_err(
+                    object.py(),
+                    ffi::PyWeakref_NewRef(object.as_ptr(), callback.as_ptr()),
+                )
+                .downcast_into_unchecked()
+            }
+        }
+
+        let py = object.py();
+        inner(object, callback.to_object(py).into_bound(py))
+    }
+}
+
+#[cfg(feature = "gil-refs")]
+impl PyWeakrefReference {
+    /// Deprecated form of [`PyWeakrefReference::new_bound`].
+    #[inline]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyWeakrefReference::new` will be replaced by `PyWeakrefReference::new_bound` in a future PyO3 version"
+    )]
+    pub fn new<T>(object: &T) -> PyResult<&PyWeakrefReference>
+    where
+        T: PyNativeType,
+    {
+        Self::new_bound(object.as_borrowed().as_any()).map(Bound::into_gil_ref)
+    }
+
+    /// Deprecated form of [`PyWeakrefReference::new_bound_with`].
+    #[inline]
+    #[deprecated(
+        since = "0.21.0",
+        note = "`PyWeakrefReference::new_with` will be replaced by `PyWeakrefReference::new_bound_with` in a future PyO3 version"
+    )]
+    pub fn new_with<T, C>(object: &T, callback: C) -> PyResult<&PyWeakrefReference>
+    where
+        T: PyNativeType,
+        C: ToPyObject,
+    {
+        Self::new_bound_with(object.as_borrowed().as_any(), callback).map(Bound::into_gil_ref)
+    }
+
+    /// Upgrade the weakref to a direct object reference.
+    ///
+    /// It is named `upgrade` to be inline with [rust's `Weak::upgrade`](std::rc::Weak::upgrade).
+    /// In Python it would be equivalent to [`PyWeakref_GetObject`] or calling the [`weakref.ReferenceType`] (result of calling [`weakref.ref`]).
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefReference;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// #[pymethods]
+    /// impl Foo {
+    ///     fn get_data(&self) -> (&str, u32) {
+    ///         ("Dave", 10)
+    ///     }
+    /// }
+    ///
+    /// fn parse_data(reference: Borrowed<'_, '_, PyWeakrefReference>) -> PyResult<String> {
+    ///     if let Some(data_src) = reference.upgrade_as::<Foo>()? {
+    ///         let data = data_src.borrow();
+    ///         let (name, score) = data.get_data();
+    ///         Ok(format!("Processing '{}': score = {}", name, score))
+    ///     } else {
+    ///         Ok("The supplied data reference is nolonger relavent.".to_owned())
+    ///     }
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let data = Bound::new(py, Foo{})?;
+    ///     let reference = PyWeakrefReference::new_bound(&data)?;
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "Processing 'Dave': score = 10"
+    ///     );
+    ///
+    ///     drop(data);
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "The supplied data reference is nolonger relavent."
+    ///     );
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    /// [`weakref.ReferenceType`]: https://docs.python.org/3/library/weakref.html#weakref.ReferenceType
+    /// [`weakref.ref`]: https://docs.python.org/3/library/weakref.html#weakref.ref
+    pub fn upgrade_as<T>(&self) -> PyResult<Option<&T::AsRefTarget>>
+    where
+        T: PyTypeCheck,
+    {
+        Ok(self
+            .as_borrowed()
+            .upgrade_as::<T>()?
+            .map(Bound::into_gil_ref))
+    }
+
+    /// Upgrade the weakref to a direct object reference unchecked. The type of the recovered object is not checked before downcasting, this could lead to unexpected behavior. Use only when absolutely certain the type can be guaranteed. The `weakref` may still return `None`.
+    ///
+    /// It is named `upgrade` to be inline with [rust's `Weak::upgrade`](std::rc::Weak::upgrade).
+    /// In Python it would be equivalent to [`PyWeakref_GetObject`] or calling the [`weakref.ReferenceType`] (result of calling [`weakref.ref`]).
+    ///
+    /// # Safety
+    /// Callers must ensure that the type is valid or risk type confusion.
+    /// The `weakref` is still allowed to be `None`, if the referenced object has been cleaned up.
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefReference;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// #[pymethods]
+    /// impl Foo {
+    ///     fn get_data(&self) -> (&str, u32) {
+    ///         ("Dave", 10)
+    ///     }
+    /// }
+    ///
+    /// fn parse_data(reference: Borrowed<'_, '_, PyWeakrefReference>) -> String {
+    ///     if let Some(data_src) = unsafe { reference.upgrade_as_unchecked::<Foo>() } {
+    ///         let data = data_src.borrow();
+    ///         let (name, score) = data.get_data();
+    ///         format!("Processing '{}': score = {}", name, score)
+    ///     } else {
+    ///         "The supplied data reference is nolonger relavent.".to_owned()
+    ///     }
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let data = Bound::new(py, Foo{})?;
+    ///     let reference = PyWeakrefReference::new_bound(&data)?;
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed()),
+    ///         "Processing 'Dave': score = 10"
+    ///     );
+    ///
+    ///     drop(data);
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed()),
+    ///         "The supplied data reference is nolonger relavent."
+    ///     );
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    /// [`weakref.ReferenceType`]: https://docs.python.org/3/library/weakref.html#weakref.ReferenceType
+    /// [`weakref.ref`]: https://docs.python.org/3/library/weakref.html#weakref.ref
+    pub unsafe fn upgrade_as_unchecked<T>(&self) -> Option<&T::AsRefTarget>
+    where
+        T: PyTypeCheck,
+    {
+        self.as_borrowed()
+            .upgrade_as_unchecked::<T>()
+            .map(Bound::into_gil_ref)
+    }
+
+    /// Upgrade the weakref to an exact direct object reference.
+    ///
+    /// It is named `upgrade` to be inline with [rust's `Weak::upgrade`](std::rc::Weak::upgrade).
+    /// In Python it would be equivalent to [`PyWeakref_GetObject`] or calling the [`weakref.ReferenceType`] (result of calling [`weakref.ref`]).
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefReference;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// #[pymethods]
+    /// impl Foo {
+    ///     fn get_data(&self) -> (&str, u32) {
+    ///         ("Dave", 10)
+    ///     }
+    /// }
+    ///
+    /// fn parse_data(reference: Borrowed<'_, '_, PyWeakrefReference>) -> PyResult<String> {
+    ///     if let Some(data_src) = reference.upgrade_as_exact::<Foo>()? {
+    ///         let data = data_src.borrow();
+    ///         let (name, score) = data.get_data();
+    ///         Ok(format!("Processing '{}': score = {}", name, score))
+    ///     } else {
+    ///         Ok("The supplied data reference is nolonger relavent.".to_owned())
+    ///     }
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let data = Bound::new(py, Foo{})?;
+    ///     let reference = PyWeakrefReference::new_bound(&data)?;
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "Processing 'Dave': score = 10"
+    ///     );
+    ///
+    ///     drop(data);
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "The supplied data reference is nolonger relavent."
+    ///     );
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    /// [`weakref.ReferenceType`]: https://docs.python.org/3/library/weakref.html#weakref.ReferenceType
+    /// [`weakref.ref`]: https://docs.python.org/3/library/weakref.html#weakref.ref
+    pub fn upgrade_as_exact<T>(&self) -> PyResult<Option<&T::AsRefTarget>>
+    where
+        T: PyTypeInfo,
+    {
+        Ok(self
+            .as_borrowed()
+            .upgrade_as_exact::<T>()?
+            .map(Bound::into_gil_ref))
+    }
+
+    /// Upgrade the weakref to a [`PyAny`] reference to the target if possible.
+    ///
+    /// It is named `upgrade` to be inline with [rust's `Weak::upgrade`](std::rc::Weak::upgrade).
+    /// This function returns `Some(&'py PyAny)` if the reference still exists, otherwise `None` will be returned.
+    ///
+    /// This function gets the optional target of this [`weakref.ReferenceType`] (result of calling [`weakref.ref`]).
+    /// It produces similair results to calling the `weakref.ReferenceType` or using [`PyWeakref_GetObject`] in the C api.
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefReference;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// fn parse_data(reference: Borrowed<'_, '_, PyWeakrefReference>) -> PyResult<String> {
+    ///     if let Some(object) = reference.upgrade() {
+    ///         Ok(format!("The object '{}' refered by this reference still exists.", object.getattr("__class__")?.getattr("__qualname__")?))
+    ///     } else {
+    ///         Ok("The object, which this reference refered to, no longer exists".to_owned())
+    ///     }
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let data = Bound::new(py, Foo{})?;
+    ///     let reference = PyWeakrefReference::new_bound(&data)?;
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "The object 'Foo' refered by this reference still exists."
+    ///     );
+    ///
+    ///     drop(data);
+    ///
+    ///     assert_eq!(
+    ///         parse_data(reference.as_borrowed())?,
+    ///         "The object, which this reference refered to, no longer exists"
+    ///     );
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    /// [`weakref.ReferenceType`]: https://docs.python.org/3/library/weakref.html#weakref.ReferenceType
+    /// [`weakref.ref`]: https://docs.python.org/3/library/weakref.html#weakref.ref
+    pub fn upgrade(&self) -> Option<&'_ PyAny> {
+        self.as_borrowed().upgrade().map(Bound::into_gil_ref)
+    }
+
+    /// Retrieve to a object pointed to by the weakref.
+    ///
+    /// This function returns `&'py PyAny`, which is either the object if it still exists, otherwise it will refer to [`PyNone`](crate::types::PyNone).
+    ///
+    /// This function gets the optional target of this [`weakref.ReferenceType`] (result of calling [`weakref.ref`]).
+    /// It produces similair results to calling the `weakref.ReferenceType` or using [`PyWeakref_GetObject`] in the C api.
+    ///
+    /// # Example
+    #[cfg_attr(
+        not(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9))))),
+        doc = "```rust,ignore"
+    )]
+    #[cfg_attr(
+        all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))),
+        doc = "```rust"
+    )]
+    /// use pyo3::prelude::*;
+    /// use pyo3::types::PyWeakrefReference;
+    ///
+    /// #[pyclass(weakref)]
+    /// struct Foo { /* fields omitted */ }
+    ///
+    /// fn get_class(reference: Borrowed<'_, '_, PyWeakrefReference>) -> PyResult<String> {
+    ///     reference
+    ///         .get_object()
+    ///         .getattr("__class__")?
+    ///         .repr()
+    ///         .map(|repr| repr.to_string())
+    /// }
+    ///
+    /// # fn main() -> PyResult<()> {
+    /// Python::with_gil(|py| {
+    ///     let object = Bound::new(py, Foo{})?;
+    ///     let reference = PyWeakrefReference::new_bound(&object)?;
+    ///
+    ///     assert_eq!(
+    ///         get_class(reference.as_borrowed())?,
+    ///         "<class 'builtins.Foo'>"
+    ///     );
+    ///
+    ///     drop(object);
+    ///
+    ///     assert_eq!(get_class(reference.as_borrowed())?, "<class 'NoneType'>");
+    ///
+    ///     Ok(())
+    /// })
+    /// # }
+    /// ```
+    ///
+    /// # Panics
+    /// This function panics is the current object is invalid.
+    /// If used propperly this is never the case. (NonNull and actually a weakref type)
+    ///
+    /// [`PyWeakref_GetObject`]: https://docs.python.org/3/c-api/weakref.html#c.PyWeakref_GetObject
+    /// [`weakref.ReferenceType`]: https://docs.python.org/3/library/weakref.html#weakref.ReferenceType
+    /// [`weakref.ref`]: https://docs.python.org/3/library/weakref.html#weakref.ref
+    pub fn get_object(&self) -> &'_ PyAny {
+        self.as_borrowed().get_object().into_gil_ref()
+    }
+}
+
+impl<'py> PyWeakrefMethods<'py> for Bound<'py, PyWeakrefReference> {
+    fn get_object_borrowed(&self) -> Borrowed<'_, 'py, PyAny> {
+        // PyWeakref_GetObject does some error checking, however we ensure the passed object is Non-Null and a Weakref type.
+        unsafe { ffi::PyWeakref_GetObject(self.as_ptr()).assume_borrowed_or_err(self.py()) }
+            .expect("The 'weakref.ReferenceType' instance should be valid (non-null and actually a weakref reference)")
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::types::any::{PyAny, PyAnyMethods};
+    use crate::types::weakref::{PyWeakrefMethods, PyWeakrefReference};
+    use crate::{Bound, PyResult, Python};
+
+    #[cfg(all(not(Py_LIMITED_API), Py_3_10))]
+    const CLASS_NAME: &str = "<class 'weakref.ReferenceType'>";
+    #[cfg(all(not(Py_LIMITED_API), not(Py_3_10)))]
+    const CLASS_NAME: &str = "<class 'weakref'>";
+
+    fn check_repr(
+        reference: &Bound<'_, PyWeakrefReference>,
+        object: Option<(&Bound<'_, PyAny>, &str)>,
+    ) -> PyResult<()> {
+        let repr = reference.repr()?.to_string();
+        let (first_part, second_part) = repr.split_once("; ").unwrap();
+
+        {
+            let (msg, addr) = first_part.split_once("0x").unwrap();
+
+            assert_eq!(msg, "<weakref at ");
+            assert!(addr
+                .to_lowercase()
+                .contains(format!("{:x?}", reference.as_ptr()).split_at(2).1));
+        }
+
+        match object {
+            Some((object, class)) => {
+                let (msg, addr) = second_part.split_once("0x").unwrap();
+
+                // Avoid testing on reprs directly since they the quoting and full path vs class name tends to be changedi undocumented.
+                assert!(msg.starts_with("to '"));
+                assert!(msg.contains(class));
+                assert!(msg.ends_with("' at "));
+
+                assert!(addr
+                    .to_lowercase()
+                    .contains(format!("{:x?}", object.as_ptr()).split_at(2).1));
+            }
+            None => {
+                assert_eq!(second_part, "dead>")
+            }
+        }
+
+        Ok(())
+    }
+
+    mod python_class {
+        use super::*;
+        use crate::{py_result_ext::PyResultExt, types::PyType};
+
+        fn get_type(py: Python<'_>) -> PyResult<Bound<'_, PyType>> {
+            py.run_bound("class A:\n    pass\n", None, None)?;
+            py.eval_bound("A", None, None).downcast_into::<PyType>()
+        }
+
+        #[test]
+        fn test_weakref_reference_behavior() -> PyResult<()> {
+            Python::with_gil(|py| {
+                let class = get_type(py)?;
+                let object = class.call0()?;
+                let reference = PyWeakrefReference::new_bound(&object)?;
+
+                assert!(!reference.is(&object));
+                assert!(reference.get_object().is(&object));
+
+                #[cfg(not(Py_LIMITED_API))]
+                assert_eq!(reference.get_type().to_string(), CLASS_NAME);
+
+                #[cfg(not(Py_LIMITED_API))]
+                assert_eq!(reference.getattr("__class__")?.to_string(), CLASS_NAME);
+
+                #[cfg(not(Py_LIMITED_API))]
+                check_repr(&reference, Some((object.as_any(), "A")))?;
+
+                assert!(reference
+                    .getattr("__callback__")
+                    .map_or(false, |result| result.is_none()));
+
+                assert!(reference.call0()?.is(&object));
+
+                drop(object);
+
+                assert!(reference.get_object().is_none());
+                #[cfg(not(Py_LIMITED_API))]
+                assert_eq!(reference.getattr("__class__")?.to_string(), CLASS_NAME);
+                check_repr(&reference, None)?;
+
+                assert!(reference
+                    .getattr("__callback__")
+                    .map_or(false, |result| result.is_none()));
+
+                assert!(reference.call0()?.is_none());
+
+                Ok(())
+            })
+        }
+
+        #[test]
+        fn test_weakref_upgrade_as() -> PyResult<()> {
+            Python::with_gil(|py| {
+                let class = get_type(py)?;
+                let object = class.call0()?;
+                let reference = PyWeakrefReference::new_bound(&object)?;
+
+                {
+                    // This test is a bit weird but ok.
+                    let obj = reference.upgrade_as::<PyAny>();
+
+                    assert!(obj.is_ok());
+                    let obj = obj.unwrap();
+
+                    assert!(obj.is_some());
+                    assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()
+                        && obj.is_exact_instance(&class)));
+                }
+
+                drop(object);
+
+                {
+                    // This test is a bit weird but ok.
+                    let obj = reference.upgrade_as::<PyAny>();
+
+                    assert!(obj.is_ok());
+                    let obj = obj.unwrap();
+
+                    assert!(obj.is_none());
+                }
+
+                Ok(())
+            })
+        }
+
+        #[test]
+        fn test_weakref_upgrade_borrowed_as() -> PyResult<()> {
+            Python::with_gil(|py| {
+                let class = get_type(py)?;
+                let object = class.call0()?;
+                let reference = PyWeakrefReference::new_bound(&object)?;
+
+                {
+                    // This test is a bit weird but ok.
+                    let obj = reference.upgrade_borrowed_as::<PyAny>();
+
+                    assert!(obj.is_ok());
+                    let obj = obj.unwrap();
+
+                    assert!(obj.is_some());
+                    assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()
+                        && obj.is_exact_instance(&class)));
+                }
+
+                drop(object);
+
+                {
+                    // This test is a bit weird but ok.
+                    let obj = reference.upgrade_borrowed_as::<PyAny>();
+
+                    assert!(obj.is_ok());
+                    let obj = obj.unwrap();
+
+                    assert!(obj.is_none());
+                }
+
+                Ok(())
+            })
+        }
+
+        #[test]
+        fn test_weakref_upgrade_as_unchecked() -> PyResult<()> {
+            Python::with_gil(|py| {
+                let class = get_type(py)?;
+                let object = class.call0()?;
+                let reference = PyWeakrefReference::new_bound(&object)?;
+
+                {
+                    // This test is a bit weird but ok.
+                    let obj = unsafe { reference.upgrade_as_unchecked::<PyAny>() };
+
+                    assert!(obj.is_some());
+                    assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()
+                        && obj.is_exact_instance(&class)));
+                }
+
+                drop(object);
+
+                {
+                    // This test is a bit weird but ok.
+                    let obj = unsafe { reference.upgrade_as_unchecked::<PyAny>() };
+
+                    assert!(obj.is_none());
+                }
+
+                Ok(())
+            })
+        }
+
+        #[test]
+        fn test_weakref_upgrade_borrowed_as_unchecked() -> PyResult<()> {
+            Python::with_gil(|py| {
+                let class = get_type(py)?;
+                let object = class.call0()?;
+                let reference = PyWeakrefReference::new_bound(&object)?;
+
+                {
+                    // This test is a bit weird but ok.
+                    let obj = unsafe { reference.upgrade_borrowed_as_unchecked::<PyAny>() };
+
+                    assert!(obj.is_some());
+                    assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()
+                        && obj.is_exact_instance(&class)));
+                }
+
+                drop(object);
+
+                {
+                    // This test is a bit weird but ok.
+                    let obj = unsafe { reference.upgrade_borrowed_as_unchecked::<PyAny>() };
+
+                    assert!(obj.is_none());
+                }
+
+                Ok(())
+            })
+        }
+
+        #[test]
+        fn test_weakref_upgrade() -> PyResult<()> {
+            Python::with_gil(|py| {
+                let class = get_type(py)?;
+                let object = class.call0()?;
+                let reference = PyWeakrefReference::new_bound(&object)?;
+
+                assert!(reference.call0()?.is(&object));
+                assert!(reference.upgrade().is_some());
+                assert!(reference.upgrade().map_or(false, |obj| obj.is(&object)));
+
+                drop(object);
+
+                assert!(reference.call0()?.is_none());
+                assert!(reference.upgrade().is_none());
+
+                Ok(())
+            })
+        }
+
+        #[test]
+        fn test_weakref_upgrade_borrowed() -> PyResult<()> {
+            Python::with_gil(|py| {
+                let class = get_type(py)?;
+                let object = class.call0()?;
+                let reference = PyWeakrefReference::new_bound(&object)?;
+
+                assert!(reference.call0()?.is(&object));
+                assert!(reference.upgrade_borrowed().is_some());
+                assert!(reference
+                    .upgrade_borrowed()
+                    .map_or(false, |obj| obj.is(&object)));
+
+                drop(object);
+
+                assert!(reference.call0()?.is_none());
+                assert!(reference.upgrade_borrowed().is_none());
+
+                Ok(())
+            })
+        }
+
+        #[test]
+        fn test_weakref_get_object() -> PyResult<()> {
+            Python::with_gil(|py| {
+                let class = get_type(py)?;
+                let object = class.call0()?;
+                let reference = PyWeakrefReference::new_bound(&object)?;
+
+                assert!(reference.call0()?.is(&object));
+                assert!(reference.get_object().is(&object));
+
+                drop(object);
+
+                assert!(reference.call0()?.is(&reference.get_object()));
+                assert!(reference.call0()?.is_none());
+                assert!(reference.get_object().is_none());
+
+                Ok(())
+            })
+        }
+
+        #[test]
+        fn test_weakref_get_object_borrowed() -> PyResult<()> {
+            Python::with_gil(|py| {
+                let class = get_type(py)?;
+                let object = class.call0()?;
+                let reference = PyWeakrefReference::new_bound(&object)?;
+
+                assert!(reference.call0()?.is(&object));
+                assert!(reference.get_object_borrowed().is(&object));
+
+                drop(object);
+
+                assert!(reference.call0()?.is_none());
+                assert!(reference.get_object_borrowed().is_none());
+
+                Ok(())
+            })
+        }
+    }
+
+    // under 'abi3-py37' and 'abi3-py38' PyClass cannot be weakreferencable.
+    #[cfg(all(feature = "macros", not(all(Py_LIMITED_API, not(Py_3_9)))))]
+    mod pyo3_pyclass {
+        use super::*;
+        use crate::{pyclass, Py};
+
+        #[pyclass(weakref, crate = "crate")]
+        struct WeakrefablePyClass {}
+
+        #[test]
+        fn test_weakref_reference_behavior() -> PyResult<()> {
+            Python::with_gil(|py| {
+                let object: Bound<'_, WeakrefablePyClass> = Bound::new(py, WeakrefablePyClass {})?;
+                let reference = PyWeakrefReference::new_bound(&object)?;
+
+                assert!(!reference.is(&object));
+                assert!(reference.get_object().is(&object));
+                #[cfg(not(Py_LIMITED_API))]
+                assert_eq!(reference.get_type().to_string(), CLASS_NAME);
+
+                #[cfg(not(Py_LIMITED_API))]
+                assert_eq!(reference.getattr("__class__")?.to_string(), CLASS_NAME);
+                #[cfg(not(Py_LIMITED_API))]
+                check_repr(&reference, Some((object.as_any(), "WeakrefablePyClass")))?;
+
+                assert!(reference
+                    .getattr("__callback__")
+                    .map_or(false, |result| result.is_none()));
+
+                assert!(reference.call0()?.is(&object));
+
+                drop(object);
+
+                assert!(reference.get_object().is_none());
+                #[cfg(not(Py_LIMITED_API))]
+                assert_eq!(reference.getattr("__class__")?.to_string(), CLASS_NAME);
+                check_repr(&reference, None)?;
+
+                assert!(reference
+                    .getattr("__callback__")
+                    .map_or(false, |result| result.is_none()));
+
+                assert!(reference.call0()?.is_none());
+
+                Ok(())
+            })
+        }
+
+        #[test]
+        fn test_weakref_upgrade_as() -> PyResult<()> {
+            Python::with_gil(|py| {
+                let object = Py::new(py, WeakrefablePyClass {})?;
+                let reference = PyWeakrefReference::new_bound(object.bind(py))?;
+
+                {
+                    let obj = reference.upgrade_as::<WeakrefablePyClass>();
+
+                    assert!(obj.is_ok());
+                    let obj = obj.unwrap();
+
+                    assert!(obj.is_some());
+                    assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()));
+                }
+
+                drop(object);
+
+                {
+                    let obj = reference.upgrade_as::<WeakrefablePyClass>();
+
+                    assert!(obj.is_ok());
+                    let obj = obj.unwrap();
+
+                    assert!(obj.is_none());
+                }
+
+                Ok(())
+            })
+        }
+
+        #[test]
+        fn test_weakref_upgrade_borrowed_as() -> PyResult<()> {
+            Python::with_gil(|py| {
+                let object = Py::new(py, WeakrefablePyClass {})?;
+                let reference = PyWeakrefReference::new_bound(object.bind(py))?;
+
+                {
+                    let obj = reference.upgrade_borrowed_as::<WeakrefablePyClass>();
+
+                    assert!(obj.is_ok());
+                    let obj = obj.unwrap();
+
+                    assert!(obj.is_some());
+                    assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()));
+                }
+
+                drop(object);
+
+                {
+                    let obj = reference.upgrade_borrowed_as::<WeakrefablePyClass>();
+
+                    assert!(obj.is_ok());
+                    let obj = obj.unwrap();
+
+                    assert!(obj.is_none());
+                }
+
+                Ok(())
+            })
+        }
+
+        #[test]
+        fn test_weakref_upgrade_as_unchecked() -> PyResult<()> {
+            Python::with_gil(|py| {
+                let object = Py::new(py, WeakrefablePyClass {})?;
+                let reference = PyWeakrefReference::new_bound(object.bind(py))?;
+
+                {
+                    let obj = unsafe { reference.upgrade_as_unchecked::<WeakrefablePyClass>() };
+
+                    assert!(obj.is_some());
+                    assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()));
+                }
+
+                drop(object);
+
+                {
+                    let obj = unsafe { reference.upgrade_as_unchecked::<WeakrefablePyClass>() };
+
+                    assert!(obj.is_none());
+                }
+
+                Ok(())
+            })
+        }
+
+        #[test]
+        fn test_weakref_upgrade_borrowed_as_unchecked() -> PyResult<()> {
+            Python::with_gil(|py| {
+                let object = Py::new(py, WeakrefablePyClass {})?;
+                let reference = PyWeakrefReference::new_bound(object.bind(py))?;
+
+                {
+                    let obj =
+                        unsafe { reference.upgrade_borrowed_as_unchecked::<WeakrefablePyClass>() };
+
+                    assert!(obj.is_some());
+                    assert!(obj.map_or(false, |obj| obj.as_ptr() == object.as_ptr()));
+                }
+
+                drop(object);
+
+                {
+                    let obj =
+                        unsafe { reference.upgrade_borrowed_as_unchecked::<WeakrefablePyClass>() };
+
+                    assert!(obj.is_none());
+                }
+
+                Ok(())
+            })
+        }
+
+        #[test]
+        fn test_weakref_upgrade() -> PyResult<()> {
+            Python::with_gil(|py| {
+                let object = Py::new(py, WeakrefablePyClass {})?;
+                let reference = PyWeakrefReference::new_bound(object.bind(py))?;
+
+                assert!(reference.call0()?.is(&object));
+                assert!(reference.upgrade().is_some());
+                assert!(reference.upgrade().map_or(false, |obj| obj.is(&object)));
+
+                drop(object);
+
+                assert!(reference.call0()?.is_none());
+                assert!(reference.upgrade().is_none());
+
+                Ok(())
+            })
+        }
+
+        #[test]
+        fn test_weakref_upgrade_borrowed() -> PyResult<()> {
+            Python::with_gil(|py| {
+                let object = Py::new(py, WeakrefablePyClass {})?;
+                let reference = PyWeakrefReference::new_bound(object.bind(py))?;
+
+                assert!(reference.call0()?.is(&object));
+                assert!(reference.upgrade_borrowed().is_some());
+                assert!(reference
+                    .upgrade_borrowed()
+                    .map_or(false, |obj| obj.is(&object)));
+
+                drop(object);
+
+                assert!(reference.call0()?.is_none());
+                assert!(reference.upgrade_borrowed().is_none());
+
+                Ok(())
+            })
+        }
+
+        #[test]
+        fn test_weakref_get_object() -> PyResult<()> {
+            Python::with_gil(|py| {
+                let object = Py::new(py, WeakrefablePyClass {})?;
+                let reference = PyWeakrefReference::new_bound(object.bind(py))?;
+
+                assert!(reference.call0()?.is(&object));
+                assert!(reference.get_object().is(&object));
+
+                drop(object);
+
+                assert!(reference.call0()?.is(&reference.get_object()));
+                assert!(reference.call0()?.is_none());
+                assert!(reference.get_object().is_none());
+
+                Ok(())
+            })
+        }
+
+        #[test]
+        fn test_weakref_get_object_borrowed() -> PyResult<()> {
+            Python::with_gil(|py| {
+                let object = Py::new(py, WeakrefablePyClass {})?;
+                let reference = PyWeakrefReference::new_bound(object.bind(py))?;
+
+                assert!(reference.call0()?.is(&object));
+                assert!(reference.get_object_borrowed().is(&object));
+
+                drop(object);
+
+                assert!(reference.call0()?.is_none());
+                assert!(reference.get_object_borrowed().is_none());
+
+                Ok(())
+            })
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/src/version.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/src/version.rs
--- 43.0.0-1/rust-vendor/pyo3/src/version.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/src/version.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,143 @@
+/// Represents the major, minor, and patch (if any) versions of this interpreter.
+///
+/// This struct is usually created with [`Python::version`].
+///
+/// # Examples
+///
+/// ```rust
+/// # use pyo3::Python;
+/// Python::with_gil(|py| {
+///     // PyO3 supports Python 3.7 and up.
+///     assert!(py.version_info() >= (3, 7));
+///     assert!(py.version_info() >= (3, 7, 0));
+/// });
+/// ```
+///
+/// [`Python::version`]: crate::marker::Python::version
+#[derive(Debug)]
+pub struct PythonVersionInfo<'py> {
+    /// Python major version (e.g. `3`).
+    pub major: u8,
+    /// Python minor version (e.g. `11`).
+    pub minor: u8,
+    /// Python patch version (e.g. `0`).
+    pub patch: u8,
+    /// Python version suffix, if applicable (e.g. `a0`).
+    pub suffix: Option<&'py str>,
+}
+
+impl<'py> PythonVersionInfo<'py> {
+    /// Parses a hard-coded Python interpreter version string (e.g. 3.9.0a4+).
+    pub(crate) fn from_str(version_number_str: &'py str) -> Result<Self, &str> {
+        fn split_and_parse_number(version_part: &str) -> (u8, Option<&str>) {
+            match version_part.find(|c: char| !c.is_ascii_digit()) {
+                None => (version_part.parse().unwrap(), None),
+                Some(version_part_suffix_start) => {
+                    let (version_part, version_part_suffix) =
+                        version_part.split_at(version_part_suffix_start);
+                    (version_part.parse().unwrap(), Some(version_part_suffix))
+                }
+            }
+        }
+
+        let mut parts = version_number_str.split('.');
+        let major_str = parts.next().ok_or("Python major version missing")?;
+        let minor_str = parts.next().ok_or("Python minor version missing")?;
+        let patch_str = parts.next();
+        if parts.next().is_some() {
+            return Err("Python version string has too many parts");
+        };
+
+        let major = major_str
+            .parse()
+            .map_err(|_| "Python major version not an integer")?;
+        let (minor, suffix) = split_and_parse_number(minor_str);
+        if suffix.is_some() {
+            assert!(patch_str.is_none());
+            return Ok(PythonVersionInfo {
+                major,
+                minor,
+                patch: 0,
+                suffix,
+            });
+        }
+
+        let (patch, suffix) = patch_str.map(split_and_parse_number).unwrap_or_default();
+        Ok(PythonVersionInfo {
+            major,
+            minor,
+            patch,
+            suffix,
+        })
+    }
+}
+
+impl PartialEq<(u8, u8)> for PythonVersionInfo<'_> {
+    fn eq(&self, other: &(u8, u8)) -> bool {
+        self.major == other.0 && self.minor == other.1
+    }
+}
+
+impl PartialEq<(u8, u8, u8)> for PythonVersionInfo<'_> {
+    fn eq(&self, other: &(u8, u8, u8)) -> bool {
+        self.major == other.0 && self.minor == other.1 && self.patch == other.2
+    }
+}
+
+impl PartialOrd<(u8, u8)> for PythonVersionInfo<'_> {
+    fn partial_cmp(&self, other: &(u8, u8)) -> Option<std::cmp::Ordering> {
+        (self.major, self.minor).partial_cmp(other)
+    }
+}
+
+impl PartialOrd<(u8, u8, u8)> for PythonVersionInfo<'_> {
+    fn partial_cmp(&self, other: &(u8, u8, u8)) -> Option<std::cmp::Ordering> {
+        (self.major, self.minor, self.patch).partial_cmp(other)
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+    use crate::Python;
+    #[test]
+    fn test_python_version_info() {
+        Python::with_gil(|py| {
+            let version = py.version_info();
+            #[cfg(Py_3_7)]
+            assert!(version >= (3, 7));
+            #[cfg(Py_3_7)]
+            assert!(version >= (3, 7, 0));
+            #[cfg(Py_3_8)]
+            assert!(version >= (3, 8));
+            #[cfg(Py_3_8)]
+            assert!(version >= (3, 8, 0));
+            #[cfg(Py_3_9)]
+            assert!(version >= (3, 9));
+            #[cfg(Py_3_9)]
+            assert!(version >= (3, 9, 0));
+            #[cfg(Py_3_10)]
+            assert!(version >= (3, 10));
+            #[cfg(Py_3_10)]
+            assert!(version >= (3, 10, 0));
+            #[cfg(Py_3_11)]
+            assert!(version >= (3, 11));
+            #[cfg(Py_3_11)]
+            assert!(version >= (3, 11, 0));
+        });
+    }
+
+    #[test]
+    fn test_python_version_info_parse() {
+        assert!(PythonVersionInfo::from_str("3.5.0a1").unwrap() >= (3, 5, 0));
+        assert!(PythonVersionInfo::from_str("3.5+").unwrap() >= (3, 5, 0));
+        assert!(PythonVersionInfo::from_str("3.5+").unwrap() == (3, 5, 0));
+        assert!(PythonVersionInfo::from_str("3.5+").unwrap() != (3, 5, 1));
+        assert!(PythonVersionInfo::from_str("3.5.2a1+").unwrap() < (3, 5, 3));
+        assert!(PythonVersionInfo::from_str("3.5.2a1+").unwrap() == (3, 5, 2));
+        assert!(PythonVersionInfo::from_str("3.5.2a1+").unwrap() == (3, 5));
+        assert!(PythonVersionInfo::from_str("3.5+").unwrap() == (3, 5));
+        assert!(PythonVersionInfo::from_str("3.5.2a1+").unwrap() < (3, 6));
+        assert!(PythonVersionInfo::from_str("3.5.2a1+").unwrap() > (3, 4));
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_anyhow.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_anyhow.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_anyhow.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_anyhow.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,52 @@
+#![cfg(feature = "anyhow")]
+
+use pyo3::wrap_pyfunction_bound;
+
+#[test]
+fn test_anyhow_py_function_ok_result() {
+    use pyo3::{py_run, pyfunction, Python};
+
+    #[pyfunction]
+    #[allow(clippy::unnecessary_wraps)]
+    fn produce_ok_result() -> anyhow::Result<String> {
+        Ok(String::from("OK buddy"))
+    }
+
+    Python::with_gil(|py| {
+        let func = wrap_pyfunction_bound!(produce_ok_result)(py).unwrap();
+
+        py_run!(
+            py,
+            func,
+            r#"
+            func()
+            "#
+        );
+    });
+}
+
+#[test]
+fn test_anyhow_py_function_err_result() {
+    use pyo3::prelude::PyDictMethods;
+    use pyo3::{pyfunction, types::PyDict, Python};
+
+    #[pyfunction]
+    fn produce_err_result() -> anyhow::Result<String> {
+        anyhow::bail!("error time")
+    }
+
+    Python::with_gil(|py| {
+        let func = wrap_pyfunction_bound!(produce_err_result)(py).unwrap();
+        let locals = PyDict::new_bound(py);
+        locals.set_item("func", func).unwrap();
+
+        py.run_bound(
+            r#"
+            func()
+            "#,
+            None,
+            Some(&locals),
+        )
+        .unwrap_err();
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_append_to_inittab.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_append_to_inittab.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_append_to_inittab.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_append_to_inittab.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,56 @@
+#![cfg(all(feature = "macros", not(PyPy)))]
+
+use pyo3::prelude::*;
+
+#[pyfunction]
+fn foo() -> usize {
+    123
+}
+
+#[pymodule]
+fn module_fn_with_functions(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    m.add_function(wrap_pyfunction!(foo, m)?)?;
+    Ok(())
+}
+
+#[pymodule]
+mod module_mod_with_functions {
+    #[pymodule_export]
+    use super::foo;
+}
+
+#[cfg(not(PyPy))]
+#[test]
+fn test_module_append_to_inittab() {
+    use pyo3::append_to_inittab;
+
+    append_to_inittab!(module_fn_with_functions);
+
+    append_to_inittab!(module_mod_with_functions);
+
+    Python::with_gil(|py| {
+        py.run_bound(
+            r#"
+import module_fn_with_functions
+assert module_fn_with_functions.foo() == 123
+"#,
+            None,
+            None,
+        )
+        .map_err(|e| e.display(py))
+        .unwrap();
+    });
+
+    Python::with_gil(|py| {
+        py.run_bound(
+            r#"
+import module_mod_with_functions
+assert module_mod_with_functions.foo() == 123
+"#,
+            None,
+            None,
+        )
+        .map_err(|e| e.display(py))
+        .unwrap();
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_arithmetics.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_arithmetics.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_arithmetics.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_arithmetics.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,766 @@
+#![cfg(feature = "macros")]
+
+use pyo3::class::basic::CompareOp;
+use pyo3::prelude::*;
+use pyo3::py_run;
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyclass]
+struct UnaryArithmetic {
+    inner: f64,
+}
+
+#[pymethods]
+impl UnaryArithmetic {
+    #[new]
+    fn new(value: f64) -> Self {
+        UnaryArithmetic { inner: value }
+    }
+
+    fn __repr__(&self) -> String {
+        format!("UA({})", self.inner)
+    }
+
+    fn __neg__(&self) -> Self {
+        Self::new(-self.inner)
+    }
+
+    fn __pos__(&self) -> Self {
+        Self::new(self.inner)
+    }
+
+    fn __abs__(&self) -> Self {
+        Self::new(self.inner.abs())
+    }
+
+    fn __invert__(&self) -> Self {
+        Self::new(self.inner.recip())
+    }
+
+    #[pyo3(signature=(_ndigits=None))]
+    fn __round__(&self, _ndigits: Option<u32>) -> Self {
+        Self::new(self.inner.round())
+    }
+}
+
+#[test]
+fn unary_arithmetic() {
+    Python::with_gil(|py| {
+        let c = Py::new(py, UnaryArithmetic::new(2.7)).unwrap();
+        py_run!(py, c, "assert repr(-c) == 'UA(-2.7)'");
+        py_run!(py, c, "assert repr(+c) == 'UA(2.7)'");
+        py_run!(py, c, "assert repr(abs(c)) == 'UA(2.7)'");
+        py_run!(py, c, "assert repr(~c) == 'UA(0.37037037037037035)'");
+        py_run!(py, c, "assert repr(round(c)) == 'UA(3)'");
+        py_run!(py, c, "assert repr(round(c, 1)) == 'UA(3)'");
+
+        let c: Bound<'_, PyAny> = c.extract(py).unwrap();
+        assert_py_eq!(c.neg().unwrap().repr().unwrap().as_any(), "UA(-2.7)");
+        assert_py_eq!(c.pos().unwrap().repr().unwrap().as_any(), "UA(2.7)");
+        assert_py_eq!(c.abs().unwrap().repr().unwrap().as_any(), "UA(2.7)");
+        assert_py_eq!(
+            c.bitnot().unwrap().repr().unwrap().as_any(),
+            "UA(0.37037037037037035)"
+        );
+    });
+}
+
+#[pyclass]
+struct Indexable(i32);
+
+#[pymethods]
+impl Indexable {
+    fn __index__(&self) -> i32 {
+        self.0
+    }
+
+    fn __int__(&self) -> i32 {
+        self.0
+    }
+
+    fn __float__(&self) -> f64 {
+        f64::from(self.0)
+    }
+
+    fn __invert__(&self) -> Self {
+        Self(!self.0)
+    }
+}
+
+#[test]
+fn indexable() {
+    Python::with_gil(|py| {
+        let i = Py::new(py, Indexable(5)).unwrap();
+        py_run!(py, i, "assert int(i) == 5");
+        py_run!(py, i, "assert [0, 1, 2, 3, 4, 5][i] == 5");
+        py_run!(py, i, "assert float(i) == 5.0");
+        py_run!(py, i, "assert int(~i) == -6");
+    })
+}
+
+#[pyclass]
+struct InPlaceOperations {
+    value: u32,
+}
+
+#[pymethods]
+impl InPlaceOperations {
+    fn __repr__(&self) -> String {
+        format!("IPO({:?})", self.value)
+    }
+
+    fn __iadd__(&mut self, other: u32) {
+        self.value += other;
+    }
+
+    fn __isub__(&mut self, other: u32) {
+        self.value -= other;
+    }
+
+    fn __imul__(&mut self, other: u32) {
+        self.value *= other;
+    }
+
+    fn __ilshift__(&mut self, other: u32) {
+        self.value <<= other;
+    }
+
+    fn __irshift__(&mut self, other: u32) {
+        self.value >>= other;
+    }
+
+    fn __iand__(&mut self, other: u32) {
+        self.value &= other;
+    }
+
+    fn __ixor__(&mut self, other: u32) {
+        self.value ^= other;
+    }
+
+    fn __ior__(&mut self, other: u32) {
+        self.value |= other;
+    }
+
+    fn __ipow__(&mut self, other: u32, _modulo: Option<u32>) {
+        self.value = self.value.pow(other);
+    }
+}
+
+#[test]
+fn inplace_operations() {
+    Python::with_gil(|py| {
+        let init = |value, code| {
+            let c = Py::new(py, InPlaceOperations { value }).unwrap();
+            py_run!(py, c, code);
+        };
+
+        init(0, "d = c; c += 1; assert repr(c) == repr(d) == 'IPO(1)'");
+        init(10, "d = c; c -= 1; assert repr(c) == repr(d) == 'IPO(9)'");
+        init(3, "d = c; c *= 3; assert repr(c) == repr(d) == 'IPO(9)'");
+        init(3, "d = c; c <<= 2; assert repr(c) == repr(d) == 'IPO(12)'");
+        init(12, "d = c; c >>= 2; assert repr(c) == repr(d) == 'IPO(3)'");
+        init(12, "d = c; c &= 10; assert repr(c) == repr(d) == 'IPO(8)'");
+        init(12, "d = c; c |= 3; assert repr(c) == repr(d) == 'IPO(15)'");
+        init(12, "d = c; c ^= 5; assert repr(c) == repr(d) == 'IPO(9)'");
+        init(3, "d = c; c **= 4; assert repr(c) == repr(d) == 'IPO(81)'");
+        init(
+            3,
+            "d = c; c.__ipow__(4); assert repr(c) == repr(d) == 'IPO(81)'",
+        );
+    });
+}
+
+#[pyclass]
+struct BinaryArithmetic {}
+
+#[pymethods]
+impl BinaryArithmetic {
+    fn __repr__(&self) -> &'static str {
+        "BA"
+    }
+
+    fn __add__(&self, rhs: &Bound<'_, PyAny>) -> String {
+        format!("BA + {:?}", rhs)
+    }
+
+    fn __sub__(&self, rhs: &Bound<'_, PyAny>) -> String {
+        format!("BA - {:?}", rhs)
+    }
+
+    fn __mul__(&self, rhs: &Bound<'_, PyAny>) -> String {
+        format!("BA * {:?}", rhs)
+    }
+
+    fn __matmul__(&self, rhs: &Bound<'_, PyAny>) -> String {
+        format!("BA @ {:?}", rhs)
+    }
+
+    fn __truediv__(&self, rhs: &Bound<'_, PyAny>) -> String {
+        format!("BA / {:?}", rhs)
+    }
+
+    fn __floordiv__(&self, rhs: &Bound<'_, PyAny>) -> String {
+        format!("BA // {:?}", rhs)
+    }
+
+    fn __mod__(&self, rhs: &Bound<'_, PyAny>) -> String {
+        format!("BA % {:?}", rhs)
+    }
+
+    fn __divmod__(&self, rhs: &Bound<'_, PyAny>) -> String {
+        format!("divmod(BA, {:?})", rhs)
+    }
+
+    fn __lshift__(&self, rhs: &Bound<'_, PyAny>) -> String {
+        format!("BA << {:?}", rhs)
+    }
+
+    fn __rshift__(&self, rhs: &Bound<'_, PyAny>) -> String {
+        format!("BA >> {:?}", rhs)
+    }
+
+    fn __and__(&self, rhs: &Bound<'_, PyAny>) -> String {
+        format!("BA & {:?}", rhs)
+    }
+
+    fn __xor__(&self, rhs: &Bound<'_, PyAny>) -> String {
+        format!("BA ^ {:?}", rhs)
+    }
+
+    fn __or__(&self, rhs: &Bound<'_, PyAny>) -> String {
+        format!("BA | {:?}", rhs)
+    }
+
+    fn __pow__(&self, rhs: &Bound<'_, PyAny>, mod_: Option<u32>) -> String {
+        format!("BA ** {:?} (mod: {:?})", rhs, mod_)
+    }
+}
+
+#[test]
+fn binary_arithmetic() {
+    Python::with_gil(|py| {
+        let c = Py::new(py, BinaryArithmetic {}).unwrap();
+        py_run!(py, c, "assert c + c == 'BA + BA'");
+        py_run!(py, c, "assert c.__add__(c) == 'BA + BA'");
+        py_run!(py, c, "assert c + 1 == 'BA + 1'");
+        py_run!(py, c, "assert c - 1 == 'BA - 1'");
+        py_run!(py, c, "assert c * 1 == 'BA * 1'");
+        py_run!(py, c, "assert c @ 1 == 'BA @ 1'");
+        py_run!(py, c, "assert c / 1 == 'BA / 1'");
+        py_run!(py, c, "assert c // 1 == 'BA // 1'");
+        py_run!(py, c, "assert c % 1 == 'BA % 1'");
+        py_run!(py, c, "assert divmod(c, 1) == 'divmod(BA, 1)'");
+        py_run!(py, c, "assert c << 1 == 'BA << 1'");
+        py_run!(py, c, "assert c >> 1 == 'BA >> 1'");
+        py_run!(py, c, "assert c & 1 == 'BA & 1'");
+        py_run!(py, c, "assert c ^ 1 == 'BA ^ 1'");
+        py_run!(py, c, "assert c | 1 == 'BA | 1'");
+        py_run!(py, c, "assert c ** 1 == 'BA ** 1 (mod: None)'");
+
+        // Class with __add__ only should not allow the reverse op;
+        // this is consistent with Python classes.
+
+        py_expect_exception!(py, c, "1 + c", PyTypeError);
+        py_expect_exception!(py, c, "1 - c", PyTypeError);
+        py_expect_exception!(py, c, "1 * c", PyTypeError);
+        py_expect_exception!(py, c, "1 @ c", PyTypeError);
+        py_expect_exception!(py, c, "1 / c", PyTypeError);
+        py_expect_exception!(py, c, "1 // c", PyTypeError);
+        py_expect_exception!(py, c, "1 % c", PyTypeError);
+        py_expect_exception!(py, c, "divmod(1, c)", PyTypeError);
+        py_expect_exception!(py, c, "1 << c", PyTypeError);
+        py_expect_exception!(py, c, "1 >> c", PyTypeError);
+        py_expect_exception!(py, c, "1 & c", PyTypeError);
+        py_expect_exception!(py, c, "1 ^ c", PyTypeError);
+        py_expect_exception!(py, c, "1 | c", PyTypeError);
+        py_expect_exception!(py, c, "1 ** c", PyTypeError);
+
+        py_run!(py, c, "assert pow(c, 1, 100) == 'BA ** 1 (mod: Some(100))'");
+
+        let c: Bound<'_, PyAny> = c.extract(py).unwrap();
+        assert_py_eq!(c.add(&c).unwrap(), "BA + BA");
+        assert_py_eq!(c.sub(&c).unwrap(), "BA - BA");
+        assert_py_eq!(c.mul(&c).unwrap(), "BA * BA");
+        assert_py_eq!(c.matmul(&c).unwrap(), "BA @ BA");
+        assert_py_eq!(c.div(&c).unwrap(), "BA / BA");
+        assert_py_eq!(c.floor_div(&c).unwrap(), "BA // BA");
+        assert_py_eq!(c.rem(&c).unwrap(), "BA % BA");
+        assert_py_eq!(c.divmod(&c).unwrap(), "divmod(BA, BA)");
+        assert_py_eq!(c.lshift(&c).unwrap(), "BA << BA");
+        assert_py_eq!(c.rshift(&c).unwrap(), "BA >> BA");
+        assert_py_eq!(c.bitand(&c).unwrap(), "BA & BA");
+        assert_py_eq!(c.bitor(&c).unwrap(), "BA | BA");
+        assert_py_eq!(c.bitxor(&c).unwrap(), "BA ^ BA");
+        assert_py_eq!(c.pow(&c, py.None()).unwrap(), "BA ** BA (mod: None)");
+    });
+}
+
+#[pyclass]
+struct RhsArithmetic {}
+
+#[pymethods]
+impl RhsArithmetic {
+    fn __radd__(&self, other: &Bound<'_, PyAny>) -> String {
+        format!("{:?} + RA", other)
+    }
+
+    fn __rsub__(&self, other: &Bound<'_, PyAny>) -> String {
+        format!("{:?} - RA", other)
+    }
+
+    fn __rmul__(&self, other: &Bound<'_, PyAny>) -> String {
+        format!("{:?} * RA", other)
+    }
+
+    fn __rlshift__(&self, other: &Bound<'_, PyAny>) -> String {
+        format!("{:?} << RA", other)
+    }
+
+    fn __rrshift__(&self, other: &Bound<'_, PyAny>) -> String {
+        format!("{:?} >> RA", other)
+    }
+
+    fn __rand__(&self, other: &Bound<'_, PyAny>) -> String {
+        format!("{:?} & RA", other)
+    }
+
+    fn __rxor__(&self, other: &Bound<'_, PyAny>) -> String {
+        format!("{:?} ^ RA", other)
+    }
+
+    fn __ror__(&self, other: &Bound<'_, PyAny>) -> String {
+        format!("{:?} | RA", other)
+    }
+
+    fn __rpow__(&self, other: &Bound<'_, PyAny>, _mod: Option<&Bound<'_, PyAny>>) -> String {
+        format!("{:?} ** RA", other)
+    }
+}
+
+#[test]
+fn rhs_arithmetic() {
+    Python::with_gil(|py| {
+        let c = Py::new(py, RhsArithmetic {}).unwrap();
+        py_run!(py, c, "assert c.__radd__(1) == '1 + RA'");
+        py_run!(py, c, "assert 1 + c == '1 + RA'");
+        py_run!(py, c, "assert c.__rsub__(1) == '1 - RA'");
+        py_run!(py, c, "assert 1 - c == '1 - RA'");
+        py_run!(py, c, "assert c.__rmul__(1) == '1 * RA'");
+        py_run!(py, c, "assert 1 * c == '1 * RA'");
+        py_run!(py, c, "assert c.__rlshift__(1) == '1 << RA'");
+        py_run!(py, c, "assert 1 << c == '1 << RA'");
+        py_run!(py, c, "assert c.__rrshift__(1) == '1 >> RA'");
+        py_run!(py, c, "assert 1 >> c == '1 >> RA'");
+        py_run!(py, c, "assert c.__rand__(1) == '1 & RA'");
+        py_run!(py, c, "assert 1 & c == '1 & RA'");
+        py_run!(py, c, "assert c.__rxor__(1) == '1 ^ RA'");
+        py_run!(py, c, "assert 1 ^ c == '1 ^ RA'");
+        py_run!(py, c, "assert c.__ror__(1) == '1 | RA'");
+        py_run!(py, c, "assert 1 | c == '1 | RA'");
+        py_run!(py, c, "assert c.__rpow__(1) == '1 ** RA'");
+        py_run!(py, c, "assert 1 ** c == '1 ** RA'");
+    });
+}
+
+#[pyclass]
+struct LhsAndRhs {}
+
+impl std::fmt::Debug for LhsAndRhs {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        write!(f, "LR")
+    }
+}
+
+#[pymethods]
+impl LhsAndRhs {
+    // fn __repr__(&self) -> &'static str {
+    //     "BA"
+    // }
+
+    fn __add__(lhs: PyRef<'_, Self>, rhs: &Bound<'_, PyAny>) -> String {
+        format!("{:?} + {:?}", lhs, rhs)
+    }
+
+    fn __sub__(lhs: PyRef<'_, Self>, rhs: &Bound<'_, PyAny>) -> String {
+        format!("{:?} - {:?}", lhs, rhs)
+    }
+
+    fn __mul__(lhs: PyRef<'_, Self>, rhs: &Bound<'_, PyAny>) -> String {
+        format!("{:?} * {:?}", lhs, rhs)
+    }
+
+    fn __lshift__(lhs: PyRef<'_, Self>, rhs: &Bound<'_, PyAny>) -> String {
+        format!("{:?} << {:?}", lhs, rhs)
+    }
+
+    fn __rshift__(lhs: PyRef<'_, Self>, rhs: &Bound<'_, PyAny>) -> String {
+        format!("{:?} >> {:?}", lhs, rhs)
+    }
+
+    fn __and__(lhs: PyRef<'_, Self>, rhs: &Bound<'_, PyAny>) -> String {
+        format!("{:?} & {:?}", lhs, rhs)
+    }
+
+    fn __xor__(lhs: PyRef<'_, Self>, rhs: &Bound<'_, PyAny>) -> String {
+        format!("{:?} ^ {:?}", lhs, rhs)
+    }
+
+    fn __or__(lhs: PyRef<'_, Self>, rhs: &Bound<'_, PyAny>) -> String {
+        format!("{:?} | {:?}", lhs, rhs)
+    }
+
+    fn __pow__(lhs: PyRef<'_, Self>, rhs: &Bound<'_, PyAny>, _mod: Option<usize>) -> String {
+        format!("{:?} ** {:?}", lhs, rhs)
+    }
+
+    fn __matmul__(lhs: PyRef<'_, Self>, rhs: &Bound<'_, PyAny>) -> String {
+        format!("{:?} @ {:?}", lhs, rhs)
+    }
+
+    fn __radd__(&self, other: &Bound<'_, PyAny>) -> String {
+        format!("{:?} + RA", other)
+    }
+
+    fn __rsub__(&self, other: &Bound<'_, PyAny>) -> String {
+        format!("{:?} - RA", other)
+    }
+
+    fn __rmul__(&self, other: &Bound<'_, PyAny>) -> String {
+        format!("{:?} * RA", other)
+    }
+
+    fn __rlshift__(&self, other: &Bound<'_, PyAny>) -> String {
+        format!("{:?} << RA", other)
+    }
+
+    fn __rrshift__(&self, other: &Bound<'_, PyAny>) -> String {
+        format!("{:?} >> RA", other)
+    }
+
+    fn __rand__(&self, other: &Bound<'_, PyAny>) -> String {
+        format!("{:?} & RA", other)
+    }
+
+    fn __rxor__(&self, other: &Bound<'_, PyAny>) -> String {
+        format!("{:?} ^ RA", other)
+    }
+
+    fn __ror__(&self, other: &Bound<'_, PyAny>) -> String {
+        format!("{:?} | RA", other)
+    }
+
+    fn __rpow__(&self, other: &Bound<'_, PyAny>, _mod: Option<&Bound<'_, PyAny>>) -> String {
+        format!("{:?} ** RA", other)
+    }
+
+    fn __rmatmul__(&self, other: &Bound<'_, PyAny>) -> String {
+        format!("{:?} @ RA", other)
+    }
+
+    fn __rtruediv__(&self, other: &Bound<'_, PyAny>) -> String {
+        format!("{:?} / RA", other)
+    }
+
+    fn __rfloordiv__(&self, other: &Bound<'_, PyAny>) -> String {
+        format!("{:?} // RA", other)
+    }
+}
+
+#[test]
+fn lhs_fellback_to_rhs() {
+    Python::with_gil(|py| {
+        let c = Py::new(py, LhsAndRhs {}).unwrap();
+        // If the light hand value is `LhsAndRhs`, LHS is used.
+        py_run!(py, c, "assert c + 1 == 'LR + 1'");
+        py_run!(py, c, "assert c - 1 == 'LR - 1'");
+        py_run!(py, c, "assert c * 1 == 'LR * 1'");
+        py_run!(py, c, "assert c << 1 == 'LR << 1'");
+        py_run!(py, c, "assert c >> 1 == 'LR >> 1'");
+        py_run!(py, c, "assert c & 1 == 'LR & 1'");
+        py_run!(py, c, "assert c ^ 1 == 'LR ^ 1'");
+        py_run!(py, c, "assert c | 1 == 'LR | 1'");
+        py_run!(py, c, "assert c ** 1 == 'LR ** 1'");
+        py_run!(py, c, "assert c @ 1 == 'LR @ 1'");
+        // Fellback to RHS because of type mismatching
+        py_run!(py, c, "assert 1 + c == '1 + RA'");
+        py_run!(py, c, "assert 1 - c == '1 - RA'");
+        py_run!(py, c, "assert 1 * c == '1 * RA'");
+        py_run!(py, c, "assert 1 << c == '1 << RA'");
+        py_run!(py, c, "assert 1 >> c == '1 >> RA'");
+        py_run!(py, c, "assert 1 & c == '1 & RA'");
+        py_run!(py, c, "assert 1 ^ c == '1 ^ RA'");
+        py_run!(py, c, "assert 1 | c == '1 | RA'");
+        py_run!(py, c, "assert 1 ** c == '1 ** RA'");
+        py_run!(py, c, "assert 1 @ c == '1 @ RA'");
+    });
+}
+
+#[pyclass]
+struct RichComparisons {}
+
+#[pymethods]
+impl RichComparisons {
+    fn __repr__(&self) -> &'static str {
+        "RC"
+    }
+
+    fn __richcmp__(&self, other: &Bound<'_, PyAny>, op: CompareOp) -> String {
+        match op {
+            CompareOp::Lt => format!("{} < {:?}", self.__repr__(), other),
+            CompareOp::Le => format!("{} <= {:?}", self.__repr__(), other),
+            CompareOp::Eq => format!("{} == {:?}", self.__repr__(), other),
+            CompareOp::Ne => format!("{} != {:?}", self.__repr__(), other),
+            CompareOp::Gt => format!("{} > {:?}", self.__repr__(), other),
+            CompareOp::Ge => format!("{} >= {:?}", self.__repr__(), other),
+        }
+    }
+}
+
+#[pyclass]
+struct RichComparisons2 {}
+
+#[pymethods]
+impl RichComparisons2 {
+    fn __repr__(&self) -> &'static str {
+        "RC2"
+    }
+
+    fn __richcmp__(&self, other: &Bound<'_, PyAny>, op: CompareOp) -> PyObject {
+        match op {
+            CompareOp::Eq => true.into_py(other.py()),
+            CompareOp::Ne => false.into_py(other.py()),
+            _ => other.py().NotImplemented(),
+        }
+    }
+}
+
+#[test]
+fn rich_comparisons() {
+    Python::with_gil(|py| {
+        let c = Py::new(py, RichComparisons {}).unwrap();
+        py_run!(py, c, "assert (c < c) == 'RC < RC'");
+        py_run!(py, c, "assert (c < 1) == 'RC < 1'");
+        py_run!(py, c, "assert (1 < c) == 'RC > 1'");
+        py_run!(py, c, "assert (c <= c) == 'RC <= RC'");
+        py_run!(py, c, "assert (c <= 1) == 'RC <= 1'");
+        py_run!(py, c, "assert (1 <= c) == 'RC >= 1'");
+        py_run!(py, c, "assert (c == c) == 'RC == RC'");
+        py_run!(py, c, "assert (c == 1) == 'RC == 1'");
+        py_run!(py, c, "assert (1 == c) == 'RC == 1'");
+        py_run!(py, c, "assert (c != c) == 'RC != RC'");
+        py_run!(py, c, "assert (c != 1) == 'RC != 1'");
+        py_run!(py, c, "assert (1 != c) == 'RC != 1'");
+        py_run!(py, c, "assert (c > c) == 'RC > RC'");
+        py_run!(py, c, "assert (c > 1) == 'RC > 1'");
+        py_run!(py, c, "assert (1 > c) == 'RC < 1'");
+        py_run!(py, c, "assert (c >= c) == 'RC >= RC'");
+        py_run!(py, c, "assert (c >= 1) == 'RC >= 1'");
+        py_run!(py, c, "assert (1 >= c) == 'RC <= 1'");
+    });
+}
+
+#[test]
+fn rich_comparisons_python_3_type_error() {
+    Python::with_gil(|py| {
+        let c2 = Py::new(py, RichComparisons2 {}).unwrap();
+        py_expect_exception!(py, c2, "c2 < c2", PyTypeError);
+        py_expect_exception!(py, c2, "c2 < 1", PyTypeError);
+        py_expect_exception!(py, c2, "1 < c2", PyTypeError);
+        py_expect_exception!(py, c2, "c2 <= c2", PyTypeError);
+        py_expect_exception!(py, c2, "c2 <= 1", PyTypeError);
+        py_expect_exception!(py, c2, "1 <= c2", PyTypeError);
+        py_run!(py, c2, "assert (c2 == c2) == True");
+        py_run!(py, c2, "assert (c2 == 1) == True");
+        py_run!(py, c2, "assert (1 == c2) == True");
+        py_run!(py, c2, "assert (c2 != c2) == False");
+        py_run!(py, c2, "assert (c2 != 1) == False");
+        py_run!(py, c2, "assert (1 != c2) == False");
+        py_expect_exception!(py, c2, "c2 > c2", PyTypeError);
+        py_expect_exception!(py, c2, "c2 > 1", PyTypeError);
+        py_expect_exception!(py, c2, "1 > c2", PyTypeError);
+        py_expect_exception!(py, c2, "c2 >= c2", PyTypeError);
+        py_expect_exception!(py, c2, "c2 >= 1", PyTypeError);
+        py_expect_exception!(py, c2, "1 >= c2", PyTypeError);
+    });
+}
+
+// Checks that binary operations for which the arguments don't match the
+// required type, return NotImplemented.
+mod return_not_implemented {
+    use super::*;
+
+    #[pyclass]
+    struct RichComparisonToSelf {}
+
+    #[pymethods]
+    impl RichComparisonToSelf {
+        fn __repr__(&self) -> &'static str {
+            "RC_Self"
+        }
+
+        fn __richcmp__(&self, other: PyRef<'_, Self>, _op: CompareOp) -> PyObject {
+            other.py().None()
+        }
+
+        fn __add__<'p>(slf: PyRef<'p, Self>, _other: PyRef<'p, Self>) -> PyRef<'p, Self> {
+            slf
+        }
+        fn __sub__<'p>(slf: PyRef<'p, Self>, _other: PyRef<'p, Self>) -> PyRef<'p, Self> {
+            slf
+        }
+        fn __mul__<'p>(slf: PyRef<'p, Self>, _other: PyRef<'p, Self>) -> PyRef<'p, Self> {
+            slf
+        }
+        fn __matmul__<'p>(slf: PyRef<'p, Self>, _other: PyRef<'p, Self>) -> PyRef<'p, Self> {
+            slf
+        }
+        fn __truediv__<'p>(slf: PyRef<'p, Self>, _other: PyRef<'p, Self>) -> PyRef<'p, Self> {
+            slf
+        }
+        fn __floordiv__<'p>(slf: PyRef<'p, Self>, _other: PyRef<'p, Self>) -> PyRef<'p, Self> {
+            slf
+        }
+        fn __mod__<'p>(slf: PyRef<'p, Self>, _other: PyRef<'p, Self>) -> PyRef<'p, Self> {
+            slf
+        }
+        fn __pow__(slf: PyRef<'_, Self>, _other: u8, _modulo: Option<u8>) -> PyRef<'_, Self> {
+            slf
+        }
+        fn __lshift__<'p>(slf: PyRef<'p, Self>, _other: PyRef<'p, Self>) -> PyRef<'p, Self> {
+            slf
+        }
+        fn __rshift__<'p>(slf: PyRef<'p, Self>, _other: PyRef<'p, Self>) -> PyRef<'p, Self> {
+            slf
+        }
+        fn __divmod__<'p>(slf: PyRef<'p, Self>, _other: PyRef<'p, Self>) -> PyRef<'p, Self> {
+            slf
+        }
+        fn __and__<'p>(slf: PyRef<'p, Self>, _other: PyRef<'p, Self>) -> PyRef<'p, Self> {
+            slf
+        }
+        fn __or__<'p>(slf: PyRef<'p, Self>, _other: PyRef<'p, Self>) -> PyRef<'p, Self> {
+            slf
+        }
+        fn __xor__<'p>(slf: PyRef<'p, Self>, _other: PyRef<'p, Self>) -> PyRef<'p, Self> {
+            slf
+        }
+
+        // Inplace assignments
+        fn __iadd__(&mut self, _other: PyRef<'_, Self>) {}
+        fn __isub__(&mut self, _other: PyRef<'_, Self>) {}
+        fn __imul__(&mut self, _other: PyRef<'_, Self>) {}
+        fn __imatmul__(&mut self, _other: PyRef<'_, Self>) {}
+        fn __itruediv__(&mut self, _other: PyRef<'_, Self>) {}
+        fn __ifloordiv__(&mut self, _other: PyRef<'_, Self>) {}
+        fn __imod__(&mut self, _other: PyRef<'_, Self>) {}
+        fn __ilshift__(&mut self, _other: PyRef<'_, Self>) {}
+        fn __irshift__(&mut self, _other: PyRef<'_, Self>) {}
+        fn __iand__(&mut self, _other: PyRef<'_, Self>) {}
+        fn __ior__(&mut self, _other: PyRef<'_, Self>) {}
+        fn __ixor__(&mut self, _other: PyRef<'_, Self>) {}
+        fn __ipow__(&mut self, _other: PyRef<'_, Self>, _modulo: Option<u8>) {}
+    }
+
+    fn _test_binary_dunder(dunder: &str) {
+        Python::with_gil(|py| {
+            let c2 = Py::new(py, RichComparisonToSelf {}).unwrap();
+            py_run!(
+                py,
+                c2,
+                &format!(
+                    "class Other: pass\nassert c2.__{}__(Other()) is NotImplemented",
+                    dunder
+                )
+            );
+        });
+    }
+
+    fn _test_binary_operator(operator: &str, dunder: &str) {
+        _test_binary_dunder(dunder);
+
+        Python::with_gil(|py| {
+            let c2 = Py::new(py, RichComparisonToSelf {}).unwrap();
+            py_expect_exception!(
+                py,
+                c2,
+                &format!("class Other: pass\nc2 {} Other()", operator),
+                PyTypeError
+            );
+        });
+    }
+
+    fn _test_inplace_binary_operator(operator: &str, dunder: &str) {
+        _test_binary_operator(operator, dunder);
+    }
+
+    #[test]
+    fn equality() {
+        _test_binary_dunder("eq");
+        _test_binary_dunder("ne");
+    }
+
+    #[test]
+    fn ordering() {
+        _test_binary_operator("<", "lt");
+        _test_binary_operator("<=", "le");
+        _test_binary_operator(">", "gt");
+        _test_binary_operator(">=", "ge");
+    }
+
+    #[test]
+    fn bitwise() {
+        _test_binary_operator("&", "and");
+        _test_binary_operator("|", "or");
+        _test_binary_operator("^", "xor");
+        _test_binary_operator("<<", "lshift");
+        _test_binary_operator(">>", "rshift");
+    }
+
+    #[test]
+    fn arith() {
+        _test_binary_operator("+", "add");
+        _test_binary_operator("-", "sub");
+        _test_binary_operator("*", "mul");
+        _test_binary_operator("@", "matmul");
+        _test_binary_operator("/", "truediv");
+        _test_binary_operator("//", "floordiv");
+        _test_binary_operator("%", "mod");
+        _test_binary_operator("**", "pow");
+    }
+
+    #[test]
+    fn reverse_arith() {
+        _test_binary_dunder("radd");
+        _test_binary_dunder("rsub");
+        _test_binary_dunder("rmul");
+        _test_binary_dunder("rmatmul");
+        _test_binary_dunder("rtruediv");
+        _test_binary_dunder("rfloordiv");
+        _test_binary_dunder("rmod");
+        _test_binary_dunder("rdivmod");
+        _test_binary_dunder("rpow");
+    }
+
+    #[test]
+    fn inplace_bitwise() {
+        _test_inplace_binary_operator("&=", "iand");
+        _test_inplace_binary_operator("|=", "ior");
+        _test_inplace_binary_operator("^=", "ixor");
+        _test_inplace_binary_operator("<<=", "ilshift");
+        _test_inplace_binary_operator(">>=", "irshift");
+    }
+
+    #[test]
+    fn inplace_arith() {
+        _test_inplace_binary_operator("+=", "iadd");
+        _test_inplace_binary_operator("-=", "isub");
+        _test_inplace_binary_operator("*=", "imul");
+        _test_inplace_binary_operator("@=", "imatmul");
+        _test_inplace_binary_operator("/=", "itruediv");
+        _test_inplace_binary_operator("//=", "ifloordiv");
+        _test_inplace_binary_operator("%=", "imod");
+        _test_inplace_binary_operator("**=", "ipow");
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_buffer.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_buffer.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_buffer.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_buffer.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,140 @@
+#![cfg(feature = "macros")]
+#![cfg(any(not(Py_LIMITED_API), Py_3_11))]
+
+use pyo3::{buffer::PyBuffer, exceptions::PyBufferError, ffi, prelude::*};
+use std::{
+    os::raw::{c_int, c_void},
+    ptr,
+};
+
+#[macro_use]
+#[path = "../src/tests/common.rs"]
+mod common;
+
+enum TestGetBufferError {
+    NullShape,
+    NullStrides,
+    IncorrectItemSize,
+    IncorrectFormat,
+    IncorrectAlignment,
+}
+
+#[pyclass]
+struct TestBufferErrors {
+    buf: Vec<u32>,
+    error: Option<TestGetBufferError>,
+}
+
+#[pymethods]
+impl TestBufferErrors {
+    unsafe fn __getbuffer__(
+        slf: PyRefMut<'_, Self>,
+        view: *mut ffi::Py_buffer,
+        flags: c_int,
+    ) -> PyResult<()> {
+        if view.is_null() {
+            return Err(PyBufferError::new_err("View is null"));
+        }
+
+        if (flags & ffi::PyBUF_WRITABLE) == ffi::PyBUF_WRITABLE {
+            return Err(PyBufferError::new_err("Object is not writable"));
+        }
+
+        let bytes = &slf.buf;
+
+        (*view).buf = bytes.as_ptr() as *mut c_void;
+        (*view).len = bytes.len() as isize;
+        (*view).readonly = 1;
+        (*view).itemsize = std::mem::size_of::<u32>() as isize;
+
+        let msg = ffi::c_str!("I");
+        (*view).format = msg.as_ptr() as *mut _;
+
+        (*view).ndim = 1;
+        (*view).shape = &mut (*view).len;
+
+        (*view).strides = &mut (*view).itemsize;
+
+        (*view).suboffsets = ptr::null_mut();
+        (*view).internal = ptr::null_mut();
+
+        if let Some(err) = &slf.error {
+            use TestGetBufferError::*;
+            match err {
+                NullShape => {
+                    (*view).shape = std::ptr::null_mut();
+                }
+                NullStrides => {
+                    (*view).strides = std::ptr::null_mut();
+                }
+                IncorrectItemSize => {
+                    (*view).itemsize += 1;
+                }
+                IncorrectFormat => {
+                    (*view).format = ffi::c_str!("B").as_ptr() as _;
+                }
+                IncorrectAlignment => (*view).buf = (*view).buf.add(1),
+            }
+        }
+
+        (*view).obj = slf.into_ptr();
+
+        Ok(())
+    }
+}
+
+#[test]
+fn test_get_buffer_errors() {
+    Python::with_gil(|py| {
+        let instance = Py::new(
+            py,
+            TestBufferErrors {
+                buf: vec![0, 1, 2, 3],
+                error: None,
+            },
+        )
+        .unwrap();
+
+        assert!(PyBuffer::<u32>::get_bound(instance.bind(py)).is_ok());
+
+        instance.borrow_mut(py).error = Some(TestGetBufferError::NullShape);
+        assert_eq!(
+            PyBuffer::<u32>::get_bound(instance.bind(py))
+                .unwrap_err()
+                .to_string(),
+            "BufferError: shape is null"
+        );
+
+        instance.borrow_mut(py).error = Some(TestGetBufferError::NullStrides);
+        assert_eq!(
+            PyBuffer::<u32>::get_bound(instance.bind(py))
+                .unwrap_err()
+                .to_string(),
+            "BufferError: strides is null"
+        );
+
+        instance.borrow_mut(py).error = Some(TestGetBufferError::IncorrectItemSize);
+        assert_eq!(
+            PyBuffer::<u32>::get_bound(instance.bind(py))
+                .unwrap_err()
+                .to_string(),
+            "BufferError: buffer contents are not compatible with u32"
+        );
+
+        instance.borrow_mut(py).error = Some(TestGetBufferError::IncorrectFormat);
+        assert_eq!(
+            PyBuffer::<u32>::get_bound(instance.bind(py))
+                .unwrap_err()
+                .to_string(),
+            "BufferError: buffer contents are not compatible with u32"
+        );
+
+        instance.borrow_mut(py).error = Some(TestGetBufferError::IncorrectAlignment);
+        assert_eq!(
+            PyBuffer::<u32>::get_bound(instance.bind(py))
+                .unwrap_err()
+                .to_string(),
+            "BufferError: buffer contents are insufficiently aligned for u32"
+        );
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_buffer_protocol.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_buffer_protocol.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_buffer_protocol.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_buffer_protocol.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,189 @@
+#![cfg(feature = "macros")]
+#![cfg(any(not(Py_LIMITED_API), Py_3_11))]
+
+use pyo3::buffer::PyBuffer;
+use pyo3::exceptions::PyBufferError;
+use pyo3::ffi;
+use pyo3::prelude::*;
+use pyo3::types::IntoPyDict;
+use std::ffi::CString;
+use std::os::raw::{c_int, c_void};
+use std::ptr;
+use std::sync::atomic::{AtomicBool, Ordering};
+use std::sync::Arc;
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyclass]
+struct TestBufferClass {
+    vec: Vec<u8>,
+    drop_called: Arc<AtomicBool>,
+}
+
+#[pymethods]
+impl TestBufferClass {
+    unsafe fn __getbuffer__(
+        slf: Bound<'_, Self>,
+        view: *mut ffi::Py_buffer,
+        flags: c_int,
+    ) -> PyResult<()> {
+        fill_view_from_readonly_data(view, flags, &slf.borrow().vec, slf.into_any())
+    }
+
+    unsafe fn __releasebuffer__(&self, view: *mut ffi::Py_buffer) {
+        // Release memory held by the format string
+        drop(CString::from_raw((*view).format));
+    }
+}
+
+impl Drop for TestBufferClass {
+    fn drop(&mut self) {
+        print!("dropped");
+        self.drop_called.store(true, Ordering::Relaxed);
+    }
+}
+
+#[test]
+fn test_buffer() {
+    let drop_called = Arc::new(AtomicBool::new(false));
+
+    Python::with_gil(|py| {
+        let instance = Py::new(
+            py,
+            TestBufferClass {
+                vec: vec![b' ', b'2', b'3'],
+                drop_called: drop_called.clone(),
+            },
+        )
+        .unwrap();
+        let env = [("ob", instance)].into_py_dict_bound(py);
+        py_assert!(py, *env, "bytes(ob) == b' 23'");
+    });
+
+    assert!(drop_called.load(Ordering::Relaxed));
+}
+
+#[test]
+fn test_buffer_referenced() {
+    let drop_called = Arc::new(AtomicBool::new(false));
+
+    let buf = {
+        let input = vec![b' ', b'2', b'3'];
+        Python::with_gil(|py| {
+            let instance: PyObject = TestBufferClass {
+                vec: input.clone(),
+                drop_called: drop_called.clone(),
+            }
+            .into_py(py);
+
+            let buf = PyBuffer::<u8>::get_bound(instance.bind(py)).unwrap();
+            assert_eq!(buf.to_vec(py).unwrap(), input);
+            drop(instance);
+            buf
+        })
+    };
+
+    assert!(!drop_called.load(Ordering::Relaxed));
+
+    Python::with_gil(|_| {
+        drop(buf);
+    });
+
+    assert!(drop_called.load(Ordering::Relaxed));
+}
+
+#[test]
+#[cfg(Py_3_8)] // sys.unraisablehook not available until Python 3.8
+fn test_releasebuffer_unraisable_error() {
+    use common::UnraisableCapture;
+    use pyo3::exceptions::PyValueError;
+
+    #[pyclass]
+    struct ReleaseBufferError {}
+
+    #[pymethods]
+    impl ReleaseBufferError {
+        unsafe fn __getbuffer__(
+            slf: Bound<'_, Self>,
+            view: *mut ffi::Py_buffer,
+            flags: c_int,
+        ) -> PyResult<()> {
+            static BUF_BYTES: &[u8] = b"hello world";
+            fill_view_from_readonly_data(view, flags, BUF_BYTES, slf.into_any())
+        }
+
+        unsafe fn __releasebuffer__(&self, _view: *mut ffi::Py_buffer) -> PyResult<()> {
+            Err(PyValueError::new_err("oh dear"))
+        }
+    }
+
+    Python::with_gil(|py| {
+        let capture = UnraisableCapture::install(py);
+
+        let instance = Py::new(py, ReleaseBufferError {}).unwrap();
+        let env = [("ob", instance.clone_ref(py))].into_py_dict_bound(py);
+
+        assert!(capture.borrow(py).capture.is_none());
+
+        py_assert!(py, *env, "bytes(ob) == b'hello world'");
+
+        let (err, object) = capture.borrow_mut(py).capture.take().unwrap();
+        assert_eq!(err.to_string(), "ValueError: oh dear");
+        assert!(object.is(&instance));
+
+        capture.borrow_mut(py).uninstall(py);
+    });
+}
+
+/// # Safety
+///
+/// `view` must be a valid pointer to ffi::Py_buffer, or null
+/// `data` must outlive the Python lifetime of `owner` (i.e. data must be owned by owner, or data
+/// must be static data)
+unsafe fn fill_view_from_readonly_data(
+    view: *mut ffi::Py_buffer,
+    flags: c_int,
+    data: &[u8],
+    owner: Bound<'_, PyAny>,
+) -> PyResult<()> {
+    if view.is_null() {
+        return Err(PyBufferError::new_err("View is null"));
+    }
+
+    if (flags & ffi::PyBUF_WRITABLE) == ffi::PyBUF_WRITABLE {
+        return Err(PyBufferError::new_err("Object is not writable"));
+    }
+
+    (*view).obj = owner.into_ptr();
+
+    (*view).buf = data.as_ptr() as *mut c_void;
+    (*view).len = data.len() as isize;
+    (*view).readonly = 1;
+    (*view).itemsize = 1;
+
+    (*view).format = if (flags & ffi::PyBUF_FORMAT) == ffi::PyBUF_FORMAT {
+        let msg = CString::new("B").unwrap();
+        msg.into_raw()
+    } else {
+        ptr::null_mut()
+    };
+
+    (*view).ndim = 1;
+    (*view).shape = if (flags & ffi::PyBUF_ND) == ffi::PyBUF_ND {
+        &mut (*view).len
+    } else {
+        ptr::null_mut()
+    };
+
+    (*view).strides = if (flags & ffi::PyBUF_STRIDES) == ffi::PyBUF_STRIDES {
+        &mut (*view).itemsize
+    } else {
+        ptr::null_mut()
+    };
+
+    (*view).suboffsets = ptr::null_mut();
+    (*view).internal = ptr::null_mut();
+
+    Ok(())
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_bytes.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_bytes.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_bytes.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_bytes.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,53 @@
+#![cfg(feature = "macros")]
+
+use pyo3::prelude::*;
+use pyo3::types::PyBytes;
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyfunction]
+fn bytes_pybytes_conversion(bytes: &[u8]) -> &[u8] {
+    bytes
+}
+
+#[test]
+fn test_pybytes_bytes_conversion() {
+    Python::with_gil(|py| {
+        let f = wrap_pyfunction_bound!(bytes_pybytes_conversion)(py).unwrap();
+        py_assert!(py, f, "f(b'Hello World') == b'Hello World'");
+    });
+}
+
+#[pyfunction]
+fn bytes_vec_conversion(py: Python<'_>, bytes: Vec<u8>) -> Bound<'_, PyBytes> {
+    PyBytes::new_bound(py, bytes.as_slice())
+}
+
+#[test]
+fn test_pybytes_vec_conversion() {
+    Python::with_gil(|py| {
+        let f = wrap_pyfunction_bound!(bytes_vec_conversion)(py).unwrap();
+        py_assert!(py, f, "f(b'Hello World') == b'Hello World'");
+    });
+}
+
+#[test]
+fn test_bytearray_vec_conversion() {
+    Python::with_gil(|py| {
+        let f = wrap_pyfunction_bound!(bytes_vec_conversion)(py).unwrap();
+        py_assert!(py, f, "f(bytearray(b'Hello World')) == b'Hello World'");
+    });
+}
+
+#[test]
+fn test_py_as_bytes() {
+    let pyobj: pyo3::Py<pyo3::types::PyBytes> =
+        Python::with_gil(|py| pyo3::types::PyBytes::new_bound(py, b"abc").unbind());
+
+    let data = Python::with_gil(|py| pyobj.as_bytes(py));
+
+    assert_eq!(data, b"abc");
+
+    Python::with_gil(move |_py| drop(pyobj));
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_class_attributes.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_class_attributes.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_class_attributes.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_class_attributes.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,288 @@
+#![cfg(feature = "macros")]
+
+use pyo3::prelude::*;
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyclass]
+struct Foo {
+    #[pyo3(get)]
+    x: i32,
+}
+
+#[pyclass]
+struct Bar {
+    #[pyo3(get)]
+    x: i32,
+}
+
+#[pymethods]
+impl Foo {
+    #[classattr]
+    const MY_CONST: &'static str = "foobar";
+
+    #[classattr]
+    #[pyo3(name = "RENAMED_CONST")]
+    const MY_CONST_2: &'static str = "foobar_2";
+
+    #[classattr]
+    fn a() -> i32 {
+        5
+    }
+
+    #[classattr]
+    #[pyo3(name = "B")]
+    fn b() -> String {
+        "bar".to_string()
+    }
+
+    #[classattr]
+    fn bar() -> Bar {
+        Bar { x: 2 }
+    }
+
+    #[classattr]
+    fn a_foo() -> Foo {
+        Foo { x: 1 }
+    }
+
+    #[classattr]
+    fn a_foo_with_py(py: Python<'_>) -> Py<Foo> {
+        Py::new(py, Foo { x: 1 }).unwrap()
+    }
+}
+
+#[test]
+fn class_attributes() {
+    Python::with_gil(|py| {
+        let foo_obj = py.get_type_bound::<Foo>();
+        py_assert!(py, foo_obj, "foo_obj.MY_CONST == 'foobar'");
+        py_assert!(py, foo_obj, "foo_obj.RENAMED_CONST == 'foobar_2'");
+        py_assert!(py, foo_obj, "foo_obj.a == 5");
+        py_assert!(py, foo_obj, "foo_obj.B == 'bar'");
+        py_assert!(py, foo_obj, "foo_obj.a_foo.x == 1");
+        py_assert!(py, foo_obj, "foo_obj.a_foo_with_py.x == 1");
+    });
+}
+
+// Ignored because heap types are not immutable:
+// https://github.com/python/cpython/blob/master/Objects/typeobject.c#L3399-L3409
+#[test]
+#[ignore]
+fn class_attributes_are_immutable() {
+    Python::with_gil(|py| {
+        let foo_obj = py.get_type_bound::<Foo>();
+        py_expect_exception!(py, foo_obj, "foo_obj.a = 6", PyTypeError);
+    });
+}
+
+#[pymethods]
+impl Bar {
+    #[classattr]
+    fn a_foo() -> Foo {
+        Foo { x: 3 }
+    }
+}
+
+#[test]
+fn recursive_class_attributes() {
+    Python::with_gil(|py| {
+        let foo_obj = py.get_type_bound::<Foo>();
+        let bar_obj = py.get_type_bound::<Bar>();
+        py_assert!(py, foo_obj, "foo_obj.a_foo.x == 1");
+        py_assert!(py, foo_obj, "foo_obj.bar.x == 2");
+        py_assert!(py, bar_obj, "bar_obj.a_foo.x == 3");
+    });
+}
+
+#[test]
+fn test_fallible_class_attribute() {
+    use pyo3::{exceptions::PyValueError, types::PyString};
+
+    struct CaptureStdErr<'py> {
+        oldstderr: Bound<'py, PyAny>,
+        string_io: Bound<'py, PyAny>,
+    }
+
+    impl<'py> CaptureStdErr<'py> {
+        fn new(py: Python<'py>) -> PyResult<Self> {
+            let sys = py.import_bound("sys")?;
+            let oldstderr = sys.getattr("stderr")?;
+            let string_io = py.import_bound("io")?.getattr("StringIO")?.call0()?;
+            sys.setattr("stderr", &string_io)?;
+            Ok(Self {
+                oldstderr,
+                string_io,
+            })
+        }
+
+        fn reset(self) -> PyResult<String> {
+            let py = self.string_io.py();
+            let payload = self
+                .string_io
+                .getattr("getvalue")?
+                .call0()?
+                .downcast::<PyString>()?
+                .to_cow()?
+                .into_owned();
+            let sys = py.import_bound("sys")?;
+            sys.setattr("stderr", self.oldstderr)?;
+            Ok(payload)
+        }
+    }
+
+    #[pyclass]
+    struct BrokenClass;
+
+    #[pymethods]
+    impl BrokenClass {
+        #[classattr]
+        fn fails_to_init() -> PyResult<i32> {
+            Err(PyValueError::new_err("failed to create class attribute"))
+        }
+    }
+
+    Python::with_gil(|py| {
+        let stderr = CaptureStdErr::new(py).unwrap();
+        assert!(std::panic::catch_unwind(|| py.get_type_bound::<BrokenClass>()).is_err());
+        assert_eq!(
+            stderr.reset().unwrap().trim(),
+            "\
+ValueError: failed to create class attribute
+
+The above exception was the direct cause of the following exception:
+
+RuntimeError: An error occurred while initializing `BrokenClass.fails_to_init`
+
+The above exception was the direct cause of the following exception:
+
+RuntimeError: An error occurred while initializing class BrokenClass"
+        )
+    });
+}
+
+#[pyclass(get_all, set_all, rename_all = "camelCase")]
+struct StructWithRenamedFields {
+    first_field: bool,
+    second_field: u8,
+    #[pyo3(name = "third_field")]
+    fourth_field: bool,
+}
+
+#[pymethods]
+impl StructWithRenamedFields {
+    #[new]
+    fn new() -> Self {
+        Self {
+            first_field: true,
+            second_field: 5,
+            fourth_field: false,
+        }
+    }
+}
+
+#[test]
+fn test_renaming_all_struct_fields() {
+    use pyo3::types::PyBool;
+
+    Python::with_gil(|py| {
+        let struct_class = py.get_type_bound::<StructWithRenamedFields>();
+        let struct_obj = struct_class.call0().unwrap();
+        assert!(struct_obj
+            .setattr("firstField", PyBool::new_bound(py, false))
+            .is_ok());
+        py_assert!(py, struct_obj, "struct_obj.firstField == False");
+        py_assert!(py, struct_obj, "struct_obj.secondField == 5");
+        assert!(struct_obj
+            .setattr("third_field", PyBool::new_bound(py, true))
+            .is_ok());
+        py_assert!(py, struct_obj, "struct_obj.third_field == True");
+    });
+}
+
+macro_rules! test_case {
+    ($struct_name: ident, $rule: literal, $field_name: ident, $renamed_field_name: literal, $test_name: ident) => {
+        #[pyclass(get_all, set_all, rename_all = $rule)]
+        #[allow(non_snake_case)]
+        struct $struct_name {
+            $field_name: u8,
+        }
+        #[pymethods]
+        impl $struct_name {
+            #[new]
+            fn new() -> Self {
+                Self { $field_name: 0 }
+            }
+        }
+        #[test]
+        fn $test_name() {
+            //use pyo3::types::PyInt;
+
+            Python::with_gil(|py| {
+                let struct_class = py.get_type_bound::<$struct_name>();
+                let struct_obj = struct_class.call0().unwrap();
+                assert!(struct_obj.setattr($renamed_field_name, 2).is_ok());
+                let attr = struct_obj.getattr($renamed_field_name).unwrap();
+                assert_eq!(2, attr.extract().unwrap());
+            });
+        }
+    };
+}
+
+test_case!(
+    LowercaseTest,
+    "lowercase",
+    fieldOne,
+    "fieldone",
+    test_rename_all_lowercase
+);
+test_case!(
+    CamelCaseTest,
+    "camelCase",
+    field_one,
+    "fieldOne",
+    test_rename_all_camel_case
+);
+test_case!(
+    KebabCaseTest,
+    "kebab-case",
+    field_one,
+    "field-one",
+    test_rename_all_kebab_case
+);
+test_case!(
+    PascalCaseTest,
+    "PascalCase",
+    field_one,
+    "FieldOne",
+    test_rename_all_pascal_case
+);
+test_case!(
+    ScreamingSnakeCaseTest,
+    "SCREAMING_SNAKE_CASE",
+    field_one,
+    "FIELD_ONE",
+    test_rename_all_screaming_snake_case
+);
+test_case!(
+    ScreamingKebabCaseTest,
+    "SCREAMING-KEBAB-CASE",
+    field_one,
+    "FIELD-ONE",
+    test_rename_all_screaming_kebab_case
+);
+test_case!(
+    SnakeCaseTest,
+    "snake_case",
+    fieldOne,
+    "field_one",
+    test_rename_all_snake_case
+);
+test_case!(
+    UppercaseTest,
+    "UPPERCASE",
+    fieldOne,
+    "FIELDONE",
+    test_rename_all_uppercase
+);
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_class_basics.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_class_basics.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_class_basics.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_class_basics.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,715 @@
+#![cfg(feature = "macros")]
+
+use pyo3::prelude::*;
+use pyo3::types::PyType;
+use pyo3::{py_run, PyClass};
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyclass]
+struct EmptyClass {}
+
+#[test]
+fn empty_class() {
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<EmptyClass>();
+        // By default, don't allow creating instances from python.
+        assert!(typeobj.call((), None).is_err());
+
+        py_assert!(py, typeobj, "typeobj.__name__ == 'EmptyClass'");
+    });
+}
+
+#[pyclass]
+struct UnitClass;
+
+#[test]
+fn unit_class() {
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<UnitClass>();
+        // By default, don't allow creating instances from python.
+        assert!(typeobj.call((), None).is_err());
+
+        py_assert!(py, typeobj, "typeobj.__name__ == 'UnitClass'");
+    });
+}
+
+/// Line1
+///Line2
+///  Line3
+// this is not doc string
+#[pyclass]
+struct ClassWithDocs {
+    /// Property field
+    #[pyo3(get, set)]
+    value: i32,
+
+    /// Read-only property field
+    #[pyo3(get)]
+    readonly: i32,
+
+    /// Write-only property field
+    #[pyo3(set)]
+    #[allow(dead_code)] // Rust detects field is never read
+    writeonly: i32,
+}
+
+#[test]
+fn class_with_docstr() {
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<ClassWithDocs>();
+        py_run!(
+            py,
+            typeobj,
+            "assert typeobj.__doc__ == 'Line1\\nLine2\\n Line3'"
+        );
+        py_run!(
+            py,
+            typeobj,
+            "assert typeobj.value.__doc__ == 'Property field'"
+        );
+        py_run!(
+            py,
+            typeobj,
+            "assert typeobj.readonly.__doc__ == 'Read-only property field'"
+        );
+        py_run!(
+            py,
+            typeobj,
+            "assert typeobj.writeonly.__doc__ == 'Write-only property field'"
+        );
+    });
+}
+
+#[pyclass(name = "CustomName")]
+struct EmptyClass2 {}
+
+#[pymethods]
+impl EmptyClass2 {
+    #[pyo3(name = "custom_fn")]
+    fn bar(&self) {}
+
+    #[staticmethod]
+    #[pyo3(name = "custom_static")]
+    fn bar_static() {}
+
+    #[getter]
+    #[pyo3(name = "custom_getter")]
+    fn foo(&self) -> i32 {
+        5
+    }
+}
+
+#[test]
+fn custom_names() {
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<EmptyClass2>();
+        py_assert!(py, typeobj, "typeobj.__name__ == 'CustomName'");
+        py_assert!(py, typeobj, "typeobj.custom_fn.__name__ == 'custom_fn'");
+        py_assert!(
+            py,
+            typeobj,
+            "typeobj.custom_static.__name__ == 'custom_static'"
+        );
+        py_assert!(
+            py,
+            typeobj,
+            "typeobj.custom_getter.__name__ == 'custom_getter'"
+        );
+        py_assert!(py, typeobj, "not hasattr(typeobj, 'bar')");
+        py_assert!(py, typeobj, "not hasattr(typeobj, 'bar_static')");
+        py_assert!(py, typeobj, "not hasattr(typeobj, 'foo')");
+    });
+}
+
+#[pyclass(name = "loop")]
+struct ClassRustKeywords {
+    #[pyo3(name = "unsafe", get, set)]
+    unsafe_variable: usize,
+}
+
+#[pymethods]
+impl ClassRustKeywords {
+    #[pyo3(name = "struct")]
+    fn struct_method(&self) {}
+
+    #[staticmethod]
+    #[pyo3(name = "type")]
+    fn type_method() {}
+}
+
+#[test]
+fn keyword_names() {
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<ClassRustKeywords>();
+        py_assert!(py, typeobj, "typeobj.__name__ == 'loop'");
+        py_assert!(py, typeobj, "typeobj.struct.__name__ == 'struct'");
+        py_assert!(py, typeobj, "typeobj.type.__name__ == 'type'");
+        py_assert!(py, typeobj, "typeobj.unsafe.__name__ == 'unsafe'");
+        py_assert!(py, typeobj, "not hasattr(typeobj, 'unsafe_variable')");
+        py_assert!(py, typeobj, "not hasattr(typeobj, 'struct_method')");
+        py_assert!(py, typeobj, "not hasattr(typeobj, 'type_method')");
+    });
+}
+
+#[pyclass]
+struct RawIdents {
+    #[pyo3(get, set)]
+    r#type: i64,
+}
+
+#[pymethods]
+impl RawIdents {
+    fn r#fn(&self) {}
+}
+
+#[test]
+fn test_raw_idents() {
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<RawIdents>();
+        py_assert!(py, typeobj, "not hasattr(typeobj, 'r#fn')");
+        py_assert!(py, typeobj, "hasattr(typeobj, 'fn')");
+        py_assert!(py, typeobj, "hasattr(typeobj, 'type')");
+    });
+}
+
+#[pyclass]
+struct EmptyClassInModule {}
+
+// Ignored because heap types do not show up as being in builtins, instead they
+// raise AttributeError:
+// https://github.com/python/cpython/blob/v3.11.1/Objects/typeobject.c#L541-L570
+#[test]
+#[ignore]
+fn empty_class_in_module() {
+    Python::with_gil(|py| {
+        let module = PyModule::new_bound(py, "test_module.nested").unwrap();
+        module.add_class::<EmptyClassInModule>().unwrap();
+
+        let ty = module.getattr("EmptyClassInModule").unwrap();
+        assert_eq!(
+            ty.getattr("__name__").unwrap().extract::<String>().unwrap(),
+            "EmptyClassInModule"
+        );
+
+        let module: String = ty.getattr("__module__").unwrap().extract().unwrap();
+
+        // Rationale: The class can be added to many modules, but will only be initialized once.
+        // We currently have no way of determining a canonical module, so builtins is better
+        // than using whatever calls init first.
+        assert_eq!(module, "builtins");
+    });
+}
+
+#[pyclass]
+struct ClassWithObjectField {
+    // It used to be that PyObject was not supported with (get, set)
+    // - this test is just ensuring it compiles.
+    #[pyo3(get, set)]
+    value: PyObject,
+}
+
+#[pymethods]
+impl ClassWithObjectField {
+    #[new]
+    fn new(value: PyObject) -> ClassWithObjectField {
+        Self { value }
+    }
+}
+
+#[test]
+fn class_with_object_field() {
+    Python::with_gil(|py| {
+        let ty = py.get_type_bound::<ClassWithObjectField>();
+        py_assert!(py, ty, "ty(5).value == 5");
+        py_assert!(py, ty, "ty(None).value == None");
+    });
+}
+
+#[pyclass(frozen, eq, hash)]
+#[derive(PartialEq, Hash)]
+struct ClassWithHash {
+    value: usize,
+}
+
+#[test]
+fn class_with_hash() {
+    Python::with_gil(|py| {
+        use pyo3::types::IntoPyDict;
+        let class = ClassWithHash { value: 42 };
+        let hash = {
+            use std::hash::{Hash, Hasher};
+            let mut hasher = std::collections::hash_map::DefaultHasher::new();
+            class.hash(&mut hasher);
+            hasher.finish() as isize
+        };
+
+        let env = [
+            ("obj", Py::new(py, class).unwrap().into_any()),
+            ("hsh", hash.into_py(py)),
+        ]
+        .into_py_dict_bound(py);
+
+        py_assert!(py, *env, "hash(obj) == hsh");
+    });
+}
+
+#[pyclass(unsendable, subclass)]
+struct UnsendableBase {
+    value: std::rc::Rc<usize>,
+}
+
+#[pymethods]
+impl UnsendableBase {
+    #[new]
+    fn new(value: usize) -> UnsendableBase {
+        Self {
+            value: std::rc::Rc::new(value),
+        }
+    }
+
+    #[getter]
+    fn value(&self) -> usize {
+        *self.value
+    }
+}
+
+#[pyclass(extends=UnsendableBase)]
+struct UnsendableChild {}
+
+#[pymethods]
+impl UnsendableChild {
+    #[new]
+    fn new(value: usize) -> (UnsendableChild, UnsendableBase) {
+        (UnsendableChild {}, UnsendableBase::new(value))
+    }
+}
+
+fn test_unsendable<T: PyClass + 'static>() -> PyResult<()> {
+    let (keep_obj_here, obj) = Python::with_gil(|py| -> PyResult<_> {
+        let obj: Py<T> = PyType::new_bound::<T>(py).call1((5,))?.extract()?;
+
+        // Accessing the value inside this thread should not panic
+        let caught_panic =
+            std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| -> PyResult<_> {
+                assert_eq!(obj.getattr(py, "value")?.extract::<usize>(py)?, 5);
+                Ok(())
+            }))
+            .is_err();
+
+        assert!(!caught_panic);
+
+        Ok((obj.clone_ref(py), obj))
+    })?;
+
+    let caught_panic = std::thread::spawn(move || {
+        // This access must panic
+        Python::with_gil(move |py| {
+            obj.borrow(py);
+        });
+    })
+    .join();
+
+    Python::with_gil(|_py| drop(keep_obj_here));
+
+    if let Err(err) = caught_panic {
+        if let Some(msg) = err.downcast_ref::<String>() {
+            panic!("{}", msg);
+        }
+    }
+
+    Ok(())
+}
+
+/// If a class is marked as `unsendable`, it panics when accessed by another thread.
+#[test]
+#[cfg_attr(target_arch = "wasm32", ignore)]
+#[should_panic(
+    expected = "test_class_basics::UnsendableBase is unsendable, but sent to another thread"
+)]
+fn panic_unsendable_base() {
+    test_unsendable::<UnsendableBase>().unwrap();
+}
+
+#[test]
+#[cfg_attr(target_arch = "wasm32", ignore)]
+#[should_panic(
+    expected = "test_class_basics::UnsendableBase is unsendable, but sent to another thread"
+)]
+fn panic_unsendable_child() {
+    test_unsendable::<UnsendableChild>().unwrap();
+}
+
+fn get_length(obj: &Bound<'_, PyAny>) -> PyResult<usize> {
+    let length = obj.len()?;
+
+    Ok(length)
+}
+
+fn is_even(obj: &Bound<'_, PyAny>) -> PyResult<bool> {
+    obj.extract::<i32>().map(|i| i % 2 == 0)
+}
+
+#[pyclass]
+struct ClassWithFromPyWithMethods {}
+
+#[pymethods]
+impl ClassWithFromPyWithMethods {
+    fn instance_method(&self, #[pyo3(from_py_with = "get_length")] argument: usize) -> usize {
+        argument
+    }
+    #[classmethod]
+    fn classmethod(
+        _cls: &Bound<'_, PyType>,
+        #[pyo3(from_py_with = "Bound::<'_, PyAny>::len")] argument: usize,
+    ) -> usize {
+        argument
+    }
+
+    #[staticmethod]
+    fn staticmethod(#[pyo3(from_py_with = "get_length")] argument: usize) -> usize {
+        argument
+    }
+
+    fn __contains__(&self, #[pyo3(from_py_with = "is_even")] obj: bool) -> bool {
+        obj
+    }
+}
+
+#[test]
+fn test_pymethods_from_py_with() {
+    Python::with_gil(|py| {
+        let instance = Py::new(py, ClassWithFromPyWithMethods {}).unwrap();
+
+        py_run!(
+            py,
+            instance,
+            r#"
+        arg = {1: 1, 2: 3}
+
+        assert instance.instance_method(arg) == 2
+        assert instance.classmethod(arg) == 2
+        assert instance.staticmethod(arg) == 2
+
+        assert 42 in instance
+        assert 73 not in instance
+        "#
+        );
+    })
+}
+
+#[pyclass]
+struct TupleClass(#[pyo3(get, set, name = "value")] i32);
+
+#[test]
+fn test_tuple_struct_class() {
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<TupleClass>();
+        assert!(typeobj.call((), None).is_err());
+
+        py_assert!(py, typeobj, "typeobj.__name__ == 'TupleClass'");
+
+        let instance = Py::new(py, TupleClass(5)).unwrap();
+        py_run!(
+            py,
+            instance,
+            r#"
+        assert instance.value == 5;
+        instance.value = 1234;
+        assert instance.value == 1234;
+        "#
+        );
+
+        assert_eq!(instance.borrow(py).0, 1234);
+    });
+}
+
+#[cfg(any(Py_3_9, not(Py_LIMITED_API)))]
+#[pyclass(dict, subclass)]
+struct DunderDictSupport {
+    // Make sure that dict_offset runs with non-zero sized Self
+    _pad: [u8; 32],
+}
+
+#[test]
+#[cfg(any(Py_3_9, not(Py_LIMITED_API)))]
+fn dunder_dict_support() {
+    Python::with_gil(|py| {
+        let inst = Py::new(
+            py,
+            DunderDictSupport {
+                _pad: *b"DEADBEEFDEADBEEFDEADBEEFDEADBEEF",
+            },
+        )
+        .unwrap();
+        py_run!(
+            py,
+            inst,
+            r#"
+        inst.a = 1
+        assert inst.a == 1
+    "#
+        );
+    });
+}
+
+#[test]
+#[cfg(any(Py_3_9, not(Py_LIMITED_API)))]
+fn access_dunder_dict() {
+    Python::with_gil(|py| {
+        let inst = Py::new(
+            py,
+            DunderDictSupport {
+                _pad: *b"DEADBEEFDEADBEEFDEADBEEFDEADBEEF",
+            },
+        )
+        .unwrap();
+        py_run!(
+            py,
+            inst,
+            r#"
+        inst.a = 1
+        assert inst.__dict__ == {'a': 1}
+    "#
+        );
+    });
+}
+
+// If the base class has dict support, child class also has dict
+#[cfg(any(Py_3_9, not(Py_LIMITED_API)))]
+#[pyclass(extends=DunderDictSupport)]
+struct InheritDict {
+    _value: usize,
+}
+
+#[test]
+#[cfg(any(Py_3_9, not(Py_LIMITED_API)))]
+fn inherited_dict() {
+    Python::with_gil(|py| {
+        let inst = Py::new(
+            py,
+            (
+                InheritDict { _value: 0 },
+                DunderDictSupport {
+                    _pad: *b"DEADBEEFDEADBEEFDEADBEEFDEADBEEF",
+                },
+            ),
+        )
+        .unwrap();
+        py_run!(
+            py,
+            inst,
+            r#"
+        inst.a = 1
+        assert inst.a == 1
+    "#
+        );
+    });
+}
+
+#[cfg(any(Py_3_9, not(Py_LIMITED_API)))]
+#[pyclass(weakref, dict)]
+struct WeakRefDunderDictSupport {
+    // Make sure that weaklist_offset runs with non-zero sized Self
+    _pad: [u8; 32],
+}
+
+#[test]
+#[cfg(any(Py_3_9, not(Py_LIMITED_API)))]
+fn weakref_dunder_dict_support() {
+    Python::with_gil(|py| {
+        let inst = Py::new(
+            py,
+            WeakRefDunderDictSupport {
+                _pad: *b"DEADBEEFDEADBEEFDEADBEEFDEADBEEF",
+            },
+        )
+        .unwrap();
+        py_run!(
+            py,
+            inst,
+            "import weakref; assert weakref.ref(inst)() is inst; inst.a = 1; assert inst.a == 1"
+        );
+    });
+}
+
+#[cfg(any(Py_3_9, not(Py_LIMITED_API)))]
+#[pyclass(weakref, subclass)]
+struct WeakRefSupport {
+    _pad: [u8; 32],
+}
+
+#[test]
+#[cfg(any(Py_3_9, not(Py_LIMITED_API)))]
+fn weakref_support() {
+    Python::with_gil(|py| {
+        let inst = Py::new(
+            py,
+            WeakRefSupport {
+                _pad: *b"DEADBEEFDEADBEEFDEADBEEFDEADBEEF",
+            },
+        )
+        .unwrap();
+        py_run!(
+            py,
+            inst,
+            "import weakref; assert weakref.ref(inst)() is inst"
+        );
+    });
+}
+
+// If the base class has weakref support, child class also has weakref.
+#[cfg(any(Py_3_9, not(Py_LIMITED_API)))]
+#[pyclass(extends=WeakRefSupport)]
+struct InheritWeakRef {
+    _value: usize,
+}
+
+#[test]
+#[cfg(any(Py_3_9, not(Py_LIMITED_API)))]
+fn inherited_weakref() {
+    Python::with_gil(|py| {
+        let inst = Py::new(
+            py,
+            (
+                InheritWeakRef { _value: 0 },
+                WeakRefSupport {
+                    _pad: *b"DEADBEEFDEADBEEFDEADBEEFDEADBEEF",
+                },
+            ),
+        )
+        .unwrap();
+        py_run!(
+            py,
+            inst,
+            "import weakref; assert weakref.ref(inst)() is inst"
+        );
+    });
+}
+
+#[test]
+fn access_frozen_class_without_gil() {
+    use std::sync::atomic::{AtomicUsize, Ordering};
+
+    #[pyclass(frozen)]
+    struct FrozenCounter {
+        value: AtomicUsize,
+    }
+
+    let py_counter: Py<FrozenCounter> = Python::with_gil(|py| {
+        let counter = FrozenCounter {
+            value: AtomicUsize::new(0),
+        };
+
+        let cell = Bound::new(py, counter).unwrap();
+
+        cell.get().value.fetch_add(1, Ordering::Relaxed);
+
+        cell.into()
+    });
+
+    assert_eq!(py_counter.get().value.load(Ordering::Relaxed), 1);
+
+    Python::with_gil(move |_py| drop(py_counter));
+}
+
+#[test]
+#[cfg(Py_3_8)] // sys.unraisablehook not available until Python 3.8
+#[cfg_attr(target_arch = "wasm32", ignore)]
+fn drop_unsendable_elsewhere() {
+    use common::UnraisableCapture;
+    use std::sync::{
+        atomic::{AtomicBool, Ordering},
+        Arc,
+    };
+    use std::thread::spawn;
+
+    #[pyclass(unsendable)]
+    struct Unsendable {
+        dropped: Arc<AtomicBool>,
+    }
+
+    impl Drop for Unsendable {
+        fn drop(&mut self) {
+            self.dropped.store(true, Ordering::SeqCst);
+        }
+    }
+
+    Python::with_gil(|py| {
+        let capture = UnraisableCapture::install(py);
+
+        let dropped = Arc::new(AtomicBool::new(false));
+
+        let unsendable = Py::new(
+            py,
+            Unsendable {
+                dropped: dropped.clone(),
+            },
+        )
+        .unwrap();
+
+        py.allow_threads(|| {
+            spawn(move || {
+                Python::with_gil(move |_py| {
+                    drop(unsendable);
+                });
+            })
+            .join()
+            .unwrap();
+        });
+
+        assert!(!dropped.load(Ordering::SeqCst));
+
+        let (err, object) = capture.borrow_mut(py).capture.take().unwrap();
+        assert_eq!(err.to_string(), "RuntimeError: test_class_basics::drop_unsendable_elsewhere::Unsendable is unsendable, but is being dropped on another thread");
+        assert!(object.is_none(py));
+
+        capture.borrow_mut(py).uninstall(py);
+    });
+}
+
+#[test]
+#[cfg(any(Py_3_9, not(Py_LIMITED_API)))]
+fn test_unsendable_dict() {
+    #[pyclass(dict, unsendable)]
+    struct UnsendableDictClass {}
+
+    #[pymethods]
+    impl UnsendableDictClass {
+        #[new]
+        fn new() -> Self {
+            UnsendableDictClass {}
+        }
+    }
+
+    Python::with_gil(|py| {
+        let inst = Py::new(py, UnsendableDictClass {}).unwrap();
+        py_run!(py, inst, "assert inst.__dict__ == {}");
+    });
+}
+
+#[test]
+#[cfg(any(Py_3_9, not(Py_LIMITED_API)))]
+fn test_unsendable_dict_with_weakref() {
+    #[pyclass(dict, unsendable, weakref)]
+    struct UnsendableDictClassWithWeakRef {}
+
+    #[pymethods]
+    impl UnsendableDictClassWithWeakRef {
+        #[new]
+        fn new() -> Self {
+            Self {}
+        }
+    }
+
+    Python::with_gil(|py| {
+        let inst = Py::new(py, UnsendableDictClassWithWeakRef {}).unwrap();
+        py_run!(py, inst, "assert inst.__dict__ == {}");
+        py_run!(
+            py,
+            inst,
+            "import weakref; assert weakref.ref(inst)() is inst; inst.a = 1; assert inst.a == 1"
+        );
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_class_comparisons.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_class_comparisons.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_class_comparisons.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_class_comparisons.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,287 @@
+#![cfg(feature = "macros")]
+
+use pyo3::prelude::*;
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyclass(eq)]
+#[derive(Debug, Clone, PartialEq)]
+pub enum MyEnum {
+    Variant,
+    OtherVariant,
+}
+
+#[pyclass(eq, ord)]
+#[derive(Debug, PartialEq, Eq, Clone, PartialOrd)]
+pub enum MyEnumOrd {
+    Variant,
+    OtherVariant,
+}
+
+#[test]
+fn test_enum_eq_enum() {
+    Python::with_gil(|py| {
+        let var1 = Py::new(py, MyEnum::Variant).unwrap();
+        let var2 = Py::new(py, MyEnum::Variant).unwrap();
+        let other_var = Py::new(py, MyEnum::OtherVariant).unwrap();
+        py_assert!(py, var1 var2, "var1 == var2");
+        py_assert!(py, var1 other_var, "var1 != other_var");
+        py_assert!(py, var1 var2, "(var1 != var2) == False");
+    })
+}
+
+#[test]
+fn test_enum_eq_incomparable() {
+    Python::with_gil(|py| {
+        let var1 = Py::new(py, MyEnum::Variant).unwrap();
+        py_assert!(py, var1, "(var1 == 'foo') == False");
+        py_assert!(py, var1, "(var1 != 'foo') == True");
+    })
+}
+
+#[test]
+fn test_enum_ord_comparable_opt_in_only() {
+    Python::with_gil(|py| {
+        let var1 = Py::new(py, MyEnum::Variant).unwrap();
+        let var2 = Py::new(py, MyEnum::OtherVariant).unwrap();
+        // ordering on simple enums if opt in only, thus raising an error below
+        py_expect_exception!(py, var1 var2, "(var1 > var2) == False", PyTypeError);
+    })
+}
+
+#[test]
+fn test_simple_enum_ord_comparable() {
+    Python::with_gil(|py| {
+        let var1 = Py::new(py, MyEnumOrd::Variant).unwrap();
+        let var2 = Py::new(py, MyEnumOrd::OtherVariant).unwrap();
+        let var3 = Py::new(py, MyEnumOrd::OtherVariant).unwrap();
+        py_assert!(py, var1 var2, "(var1 > var2) == False");
+        py_assert!(py, var1 var2, "(var1 < var2) == True");
+        py_assert!(py, var1 var2, "(var1 >= var2) == False");
+        py_assert!(py, var2 var3, "(var3 >= var2) == True");
+        py_assert!(py, var1 var2, "(var1 <= var2) == True");
+    })
+}
+
+#[pyclass(eq, ord)]
+#[derive(Debug, PartialEq, Eq, Clone, PartialOrd)]
+pub enum MyComplexEnumOrd {
+    Variant(i32),
+    OtherVariant(String),
+}
+
+#[pyclass(eq, ord)]
+#[derive(Debug, PartialEq, Eq, Clone, PartialOrd)]
+pub enum MyComplexEnumOrd2 {
+    Variant { msg: String, idx: u32 },
+    OtherVariant { name: String, idx: u32 },
+}
+
+#[test]
+fn test_complex_enum_ord_comparable() {
+    Python::with_gil(|py| {
+        let var1 = Py::new(py, MyComplexEnumOrd::Variant(-2)).unwrap();
+        let var2 = Py::new(py, MyComplexEnumOrd::Variant(5)).unwrap();
+        let var3 = Py::new(py, MyComplexEnumOrd::OtherVariant("a".to_string())).unwrap();
+        let var4 = Py::new(py, MyComplexEnumOrd::OtherVariant("b".to_string())).unwrap();
+        py_assert!(py, var1 var2, "(var1 > var2) == False");
+        py_assert!(py, var1 var2, "(var1 < var2) == True");
+        py_assert!(py, var1 var2, "(var1 >= var2) == False");
+        py_assert!(py, var1 var2, "(var1 <= var2) == True");
+
+        py_assert!(py, var1 var3, "(var1 >= var3) == False");
+        py_assert!(py, var1 var3, "(var1 <= var3) == True");
+
+        py_assert!(py, var3 var4, "(var3 >= var4) == False");
+        py_assert!(py, var3 var4, "(var3 <= var4) == True");
+
+        let var5 = Py::new(
+            py,
+            MyComplexEnumOrd2::Variant {
+                msg: "hello".to_string(),
+                idx: 1,
+            },
+        )
+        .unwrap();
+        let var6 = Py::new(
+            py,
+            MyComplexEnumOrd2::Variant {
+                msg: "hello".to_string(),
+                idx: 1,
+            },
+        )
+        .unwrap();
+        let var7 = Py::new(
+            py,
+            MyComplexEnumOrd2::Variant {
+                msg: "goodbye".to_string(),
+                idx: 7,
+            },
+        )
+        .unwrap();
+        let var8 = Py::new(
+            py,
+            MyComplexEnumOrd2::Variant {
+                msg: "about".to_string(),
+                idx: 0,
+            },
+        )
+        .unwrap();
+        let var9 = Py::new(
+            py,
+            MyComplexEnumOrd2::OtherVariant {
+                name: "albert".to_string(),
+                idx: 1,
+            },
+        )
+        .unwrap();
+
+        py_assert!(py, var5 var6, "(var5 == var6) == True");
+        py_assert!(py, var5 var6, "(var5 <= var6) == True");
+        py_assert!(py, var6 var7, "(var6 <= var7) == False");
+        py_assert!(py, var6 var7, "(var6 >= var7) == True");
+        py_assert!(py, var5 var8, "(var5 > var8) == True");
+        py_assert!(py, var8 var9, "(var9 > var8) == True");
+    })
+}
+
+#[pyclass(eq, ord)]
+#[derive(Debug, PartialEq, Eq, Clone, PartialOrd)]
+pub struct Point {
+    x: i32,
+    y: i32,
+    z: i32,
+}
+
+#[test]
+fn test_struct_numeric_ord_comparable() {
+    Python::with_gil(|py| {
+        let var1 = Py::new(py, Point { x: 10, y: 2, z: 3 }).unwrap();
+        let var2 = Py::new(py, Point { x: 2, y: 2, z: 3 }).unwrap();
+        let var3 = Py::new(py, Point { x: 1, y: 22, z: 4 }).unwrap();
+        let var4 = Py::new(py, Point { x: 1, y: 3, z: 4 }).unwrap();
+        let var5 = Py::new(py, Point { x: 1, y: 3, z: 4 }).unwrap();
+        py_assert!(py, var1 var2, "(var1 > var2) == True");
+        py_assert!(py, var1 var2, "(var1 <= var2) == False");
+        py_assert!(py, var2 var3, "(var3 < var2) == True");
+        py_assert!(py, var3 var4, "(var3 > var4) == True");
+        py_assert!(py, var4 var5, "(var4 == var5) == True");
+        py_assert!(py, var3 var5, "(var3 != var5) == True");
+    })
+}
+
+#[pyclass(eq, ord)]
+#[derive(Debug, PartialEq, Eq, Clone, PartialOrd)]
+pub struct Person {
+    surname: String,
+    given_name: String,
+}
+
+#[test]
+fn test_struct_string_ord_comparable() {
+    Python::with_gil(|py| {
+        let var1 = Py::new(
+            py,
+            Person {
+                surname: "zzz".to_string(),
+                given_name: "bob".to_string(),
+            },
+        )
+        .unwrap();
+        let var2 = Py::new(
+            py,
+            Person {
+                surname: "aaa".to_string(),
+                given_name: "sally".to_string(),
+            },
+        )
+        .unwrap();
+        let var3 = Py::new(
+            py,
+            Person {
+                surname: "eee".to_string(),
+                given_name: "qqq".to_string(),
+            },
+        )
+        .unwrap();
+        let var4 = Py::new(
+            py,
+            Person {
+                surname: "ddd".to_string(),
+                given_name: "aaa".to_string(),
+            },
+        )
+        .unwrap();
+
+        py_assert!(py, var1 var2, "(var1 > var2) == True");
+        py_assert!(py, var1 var2, "(var1 <= var2) == False");
+        py_assert!(py, var1 var3, "(var1 >= var3) == True");
+        py_assert!(py, var2 var3, "(var2 >= var3) == False");
+        py_assert!(py, var3 var4, "(var3 >= var4) == True");
+        py_assert!(py, var3 var4, "(var3 != var4) == True");
+    })
+}
+
+#[pyclass(eq, ord)]
+#[derive(Debug, PartialEq, Eq, Clone)]
+pub struct Record {
+    name: String,
+    title: String,
+    idx: u32,
+}
+
+impl PartialOrd for Record {
+    fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
+        Some(self.idx.partial_cmp(&other.idx).unwrap())
+    }
+}
+
+#[test]
+fn test_struct_custom_ord_comparable() {
+    Python::with_gil(|py| {
+        let var1 = Py::new(
+            py,
+            Record {
+                name: "zzz".to_string(),
+                title: "bbb".to_string(),
+                idx: 9,
+            },
+        )
+        .unwrap();
+        let var2 = Py::new(
+            py,
+            Record {
+                name: "ddd".to_string(),
+                title: "aaa".to_string(),
+                idx: 1,
+            },
+        )
+        .unwrap();
+        let var3 = Py::new(
+            py,
+            Record {
+                name: "vvv".to_string(),
+                title: "ggg".to_string(),
+                idx: 19,
+            },
+        )
+        .unwrap();
+        let var4 = Py::new(
+            py,
+            Record {
+                name: "vvv".to_string(),
+                title: "ggg".to_string(),
+                idx: 19,
+            },
+        )
+        .unwrap();
+
+        py_assert!(py, var1 var2, "(var1 > var2) == True");
+        py_assert!(py, var1 var2, "(var1 <= var2) == False");
+        py_assert!(py, var1 var3, "(var1 >= var3) == False");
+        py_assert!(py, var2 var3, "(var2 >= var3) == False");
+        py_assert!(py, var3 var4, "(var3 == var4) == True");
+        py_assert!(py, var2 var4, "(var2 != var4) == True");
+    })
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_class_conversion.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_class_conversion.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_class_conversion.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_class_conversion.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,159 @@
+#![cfg(feature = "macros")]
+
+use pyo3::prelude::*;
+
+#[macro_use]
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyclass]
+#[derive(Clone, Debug, PartialEq)]
+struct Cloneable {
+    x: i32,
+}
+
+#[test]
+fn test_cloneable_pyclass() {
+    let c = Cloneable { x: 10 };
+
+    Python::with_gil(|py| {
+        let py_c = Py::new(py, c.clone()).unwrap().to_object(py);
+
+        let c2: Cloneable = py_c.extract(py).unwrap();
+        assert_eq!(c, c2);
+        {
+            let rc: PyRef<'_, Cloneable> = py_c.extract(py).unwrap();
+            assert_eq!(&c, &*rc);
+            // Drops PyRef before taking PyRefMut
+        }
+        let mrc: PyRefMut<'_, Cloneable> = py_c.extract(py).unwrap();
+        assert_eq!(&c, &*mrc);
+    });
+}
+
+#[pyclass(subclass)]
+#[derive(Default)]
+struct BaseClass {
+    value: i32,
+}
+
+#[pymethods]
+impl BaseClass {
+    fn foo(&self) -> &'static str {
+        "BaseClass"
+    }
+}
+
+#[pyclass(extends=BaseClass)]
+struct SubClass {}
+
+#[pymethods]
+impl SubClass {
+    fn foo(&self) -> &'static str {
+        "SubClass"
+    }
+}
+
+#[pyclass]
+struct PolymorphicContainer {
+    #[pyo3(get, set)]
+    inner: Py<BaseClass>,
+}
+
+#[test]
+fn test_polymorphic_container_stores_base_class() {
+    Python::with_gil(|py| {
+        let p = Py::new(
+            py,
+            PolymorphicContainer {
+                inner: Py::new(py, BaseClass::default()).unwrap(),
+            },
+        )
+        .unwrap()
+        .to_object(py);
+
+        py_assert!(py, p, "p.inner.foo() == 'BaseClass'");
+    });
+}
+
+#[test]
+fn test_polymorphic_container_stores_sub_class() {
+    Python::with_gil(|py| {
+        let p = Py::new(
+            py,
+            PolymorphicContainer {
+                inner: Py::new(py, BaseClass::default()).unwrap(),
+            },
+        )
+        .unwrap()
+        .to_object(py);
+
+        p.bind(py)
+            .setattr(
+                "inner",
+                Py::new(
+                    py,
+                    PyClassInitializer::from(BaseClass::default()).add_subclass(SubClass {}),
+                )
+                .unwrap(),
+            )
+            .unwrap();
+
+        py_assert!(py, p, "p.inner.foo() == 'SubClass'");
+    });
+}
+
+#[test]
+fn test_polymorphic_container_does_not_accept_other_types() {
+    Python::with_gil(|py| {
+        let p = Py::new(
+            py,
+            PolymorphicContainer {
+                inner: Py::new(py, BaseClass::default()).unwrap(),
+            },
+        )
+        .unwrap()
+        .to_object(py);
+
+        let setattr = |value: PyObject| p.bind(py).setattr("inner", value);
+
+        assert!(setattr(1i32.into_py(py)).is_err());
+        assert!(setattr(py.None()).is_err());
+        assert!(setattr((1i32, 2i32).into_py(py)).is_err());
+    });
+}
+
+#[test]
+fn test_pyref_as_base() {
+    Python::with_gil(|py| {
+        let cell = Bound::new(py, (SubClass {}, BaseClass { value: 120 })).unwrap();
+
+        // First try PyRefMut
+        let sub: PyRefMut<'_, SubClass> = cell.borrow_mut();
+        let mut base: PyRefMut<'_, BaseClass> = sub.into_super();
+        assert_eq!(120, base.value);
+        base.value = 999;
+        assert_eq!(999, base.value);
+        drop(base);
+
+        // Repeat for PyRef
+        let sub: PyRef<'_, SubClass> = cell.borrow();
+        let base: PyRef<'_, BaseClass> = sub.into_super();
+        assert_eq!(999, base.value);
+    });
+}
+
+#[test]
+fn test_pycell_deref() {
+    Python::with_gil(|py| {
+        let obj = Bound::new(py, (SubClass {}, BaseClass { value: 120 })).unwrap();
+
+        // Should be able to deref as PyAny
+        assert_eq!(
+            obj.call_method0("foo")
+                .and_then(|e| e.extract::<String>())
+                .unwrap(),
+            "SubClass"
+        );
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_class_new.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_class_new.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_class_new.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_class_new.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,300 @@
+#![cfg(feature = "macros")]
+
+use pyo3::exceptions::PyValueError;
+use pyo3::prelude::*;
+use pyo3::sync::GILOnceCell;
+use pyo3::types::IntoPyDict;
+
+#[pyclass]
+struct EmptyClassWithNew {}
+
+#[pymethods]
+impl EmptyClassWithNew {
+    #[new]
+    fn new() -> EmptyClassWithNew {
+        EmptyClassWithNew {}
+    }
+}
+
+#[test]
+fn empty_class_with_new() {
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<EmptyClassWithNew>();
+        assert!(typeobj
+            .call((), None)
+            .unwrap()
+            .downcast::<EmptyClassWithNew>()
+            .is_ok());
+
+        // Calling with arbitrary args or kwargs is not ok
+        assert!(typeobj.call(("some", "args"), None).is_err());
+        assert!(typeobj
+            .call((), Some(&[("some", "kwarg")].into_py_dict_bound(py)))
+            .is_err());
+    });
+}
+
+#[pyclass]
+struct UnitClassWithNew;
+
+#[pymethods]
+impl UnitClassWithNew {
+    #[new]
+    fn new() -> Self {
+        Self
+    }
+}
+
+#[test]
+fn unit_class_with_new() {
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<UnitClassWithNew>();
+        assert!(typeobj
+            .call((), None)
+            .unwrap()
+            .downcast::<UnitClassWithNew>()
+            .is_ok());
+    });
+}
+
+#[pyclass]
+struct TupleClassWithNew(i32);
+
+#[pymethods]
+impl TupleClassWithNew {
+    #[new]
+    fn new(arg: i32) -> Self {
+        Self(arg)
+    }
+}
+
+#[test]
+fn tuple_class_with_new() {
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<TupleClassWithNew>();
+        let wrp = typeobj.call((42,), None).unwrap();
+        let obj = wrp.downcast::<TupleClassWithNew>().unwrap();
+        let obj_ref = obj.borrow();
+        assert_eq!(obj_ref.0, 42);
+    });
+}
+
+#[pyclass]
+#[derive(Debug)]
+struct NewWithOneArg {
+    data: i32,
+}
+
+#[pymethods]
+impl NewWithOneArg {
+    #[new]
+    fn new(arg: i32) -> NewWithOneArg {
+        NewWithOneArg { data: arg }
+    }
+}
+
+#[test]
+fn new_with_one_arg() {
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<NewWithOneArg>();
+        let wrp = typeobj.call((42,), None).unwrap();
+        let obj = wrp.downcast::<NewWithOneArg>().unwrap();
+        let obj_ref = obj.borrow();
+        assert_eq!(obj_ref.data, 42);
+    });
+}
+
+#[pyclass]
+struct NewWithTwoArgs {
+    data1: i32,
+    data2: i32,
+}
+
+#[pymethods]
+impl NewWithTwoArgs {
+    #[new]
+    fn new(arg1: i32, arg2: i32) -> Self {
+        NewWithTwoArgs {
+            data1: arg1,
+            data2: arg2,
+        }
+    }
+}
+
+#[test]
+fn new_with_two_args() {
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<NewWithTwoArgs>();
+        let wrp = typeobj
+            .call((10, 20), None)
+            .map_err(|e| e.display(py))
+            .unwrap();
+        let obj = wrp.downcast::<NewWithTwoArgs>().unwrap();
+        let obj_ref = obj.borrow();
+        assert_eq!(obj_ref.data1, 10);
+        assert_eq!(obj_ref.data2, 20);
+    });
+}
+
+#[pyclass(subclass)]
+struct SuperClass {
+    #[pyo3(get)]
+    from_rust: bool,
+}
+
+#[pymethods]
+impl SuperClass {
+    #[new]
+    fn new() -> Self {
+        SuperClass { from_rust: true }
+    }
+}
+
+/// Checks that `subclass.__new__` works correctly.
+/// See https://github.com/PyO3/pyo3/issues/947 for the corresponding bug.
+#[test]
+fn subclass_new() {
+    Python::with_gil(|py| {
+        let super_cls = py.get_type_bound::<SuperClass>();
+        let source = pyo3::indoc::indoc!(
+            r#"
+class Class(SuperClass):
+    def __new__(cls):
+        return super().__new__(cls)  # This should return an instance of Class
+
+    @property
+    def from_rust(self):
+        return False
+c = Class()
+assert c.from_rust is False
+"#
+        );
+        let globals = PyModule::import_bound(py, "__main__").unwrap().dict();
+        globals.set_item("SuperClass", super_cls).unwrap();
+        py.run_bound(source, Some(&globals), None)
+            .map_err(|e| e.display(py))
+            .unwrap();
+    });
+}
+
+#[pyclass]
+#[derive(Debug)]
+struct NewWithCustomError {}
+
+struct CustomError;
+
+impl From<CustomError> for PyErr {
+    fn from(_error: CustomError) -> PyErr {
+        PyValueError::new_err("custom error")
+    }
+}
+
+#[pymethods]
+impl NewWithCustomError {
+    #[new]
+    fn new() -> Result<NewWithCustomError, CustomError> {
+        Err(CustomError)
+    }
+}
+
+#[test]
+fn new_with_custom_error() {
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<NewWithCustomError>();
+        let err = typeobj.call0().unwrap_err();
+        assert_eq!(err.to_string(), "ValueError: custom error");
+    });
+}
+
+#[pyclass]
+struct NewExisting {
+    #[pyo3(get)]
+    num: usize,
+}
+
+#[pymethods]
+impl NewExisting {
+    #[new]
+    fn new(py: pyo3::Python<'_>, val: usize) -> pyo3::Py<NewExisting> {
+        static PRE_BUILT: GILOnceCell<[pyo3::Py<NewExisting>; 2]> = GILOnceCell::new();
+        let existing = PRE_BUILT.get_or_init(py, || {
+            [
+                pyo3::Py::new(py, NewExisting { num: 0 }).unwrap(),
+                pyo3::Py::new(py, NewExisting { num: 1 }).unwrap(),
+            ]
+        });
+
+        if val < existing.len() {
+            return existing[val].clone_ref(py);
+        }
+
+        pyo3::Py::new(py, NewExisting { num: val }).unwrap()
+    }
+}
+
+#[test]
+fn test_new_existing() {
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<NewExisting>();
+
+        let obj1 = typeobj.call1((0,)).unwrap();
+        let obj2 = typeobj.call1((0,)).unwrap();
+        let obj3 = typeobj.call1((1,)).unwrap();
+        let obj4 = typeobj.call1((1,)).unwrap();
+        let obj5 = typeobj.call1((2,)).unwrap();
+        let obj6 = typeobj.call1((2,)).unwrap();
+
+        assert!(obj1.getattr("num").unwrap().extract::<u32>().unwrap() == 0);
+        assert!(obj2.getattr("num").unwrap().extract::<u32>().unwrap() == 0);
+        assert!(obj3.getattr("num").unwrap().extract::<u32>().unwrap() == 1);
+        assert!(obj4.getattr("num").unwrap().extract::<u32>().unwrap() == 1);
+        assert!(obj5.getattr("num").unwrap().extract::<u32>().unwrap() == 2);
+        assert!(obj6.getattr("num").unwrap().extract::<u32>().unwrap() == 2);
+
+        assert!(obj1.is(&obj2));
+        assert!(obj3.is(&obj4));
+        assert!(!obj1.is(&obj3));
+        assert!(!obj1.is(&obj5));
+        assert!(!obj5.is(&obj6));
+    });
+}
+
+#[pyclass]
+struct NewReturnsPy;
+
+#[pymethods]
+impl NewReturnsPy {
+    #[new]
+    fn new(py: Python<'_>) -> PyResult<Py<NewReturnsPy>> {
+        Py::new(py, NewReturnsPy)
+    }
+}
+
+#[test]
+fn test_new_returns_py() {
+    Python::with_gil(|py| {
+        let type_ = py.get_type_bound::<NewReturnsPy>();
+        let obj = type_.call0().unwrap();
+        assert!(obj.is_exact_instance_of::<NewReturnsPy>());
+    })
+}
+
+#[pyclass]
+struct NewReturnsBound;
+
+#[pymethods]
+impl NewReturnsBound {
+    #[new]
+    fn new(py: Python<'_>) -> PyResult<Bound<'_, NewReturnsBound>> {
+        Bound::new(py, NewReturnsBound)
+    }
+}
+
+#[test]
+fn test_new_returns_bound() {
+    Python::with_gil(|py| {
+        let type_ = py.get_type_bound::<NewReturnsBound>();
+        let obj = type_.call0().unwrap();
+        assert!(obj.is_exact_instance_of::<NewReturnsBound>());
+    })
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_coroutine.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_coroutine.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_coroutine.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_coroutine.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,346 @@
+#![cfg(feature = "experimental-async")]
+#![cfg(not(target_arch = "wasm32"))]
+use std::{task::Poll, thread, time::Duration};
+
+use futures::{channel::oneshot, future::poll_fn, FutureExt};
+#[cfg(not(target_has_atomic = "64"))]
+use portable_atomic::{AtomicBool, Ordering};
+use pyo3::{
+    coroutine::CancelHandle,
+    prelude::*,
+    py_run,
+    types::{IntoPyDict, PyType},
+};
+#[cfg(target_has_atomic = "64")]
+use std::sync::atomic::{AtomicBool, Ordering};
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+fn handle_windows(test: &str) -> String {
+    let set_event_loop_policy = r#"
+    import asyncio, sys
+    if sys.platform == "win32":
+        asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
+    "#;
+    pyo3::unindent::unindent(set_event_loop_policy) + &pyo3::unindent::unindent(test)
+}
+
+#[test]
+fn noop_coroutine() {
+    #[pyfunction]
+    async fn noop() -> usize {
+        42
+    }
+    Python::with_gil(|gil| {
+        let noop = wrap_pyfunction_bound!(noop, gil).unwrap();
+        let test = "import asyncio; assert asyncio.run(noop()) == 42";
+        py_run!(gil, noop, &handle_windows(test));
+    })
+}
+
+#[test]
+fn test_coroutine_qualname() {
+    #[pyfunction]
+    async fn my_fn() {}
+    #[pyclass]
+    struct MyClass;
+    #[pymethods]
+    impl MyClass {
+        #[new]
+        fn new() -> Self {
+            Self
+        }
+        // TODO use &self when possible
+        async fn my_method(_self: Py<Self>) {}
+        #[classmethod]
+        async fn my_classmethod(_cls: Py<PyType>) {}
+        #[staticmethod]
+        async fn my_staticmethod() {}
+    }
+    Python::with_gil(|gil| {
+        let test = r#"
+        for coro, name, qualname in [
+            (my_fn(), "my_fn", "my_fn"),
+            (MyClass().my_method(), "my_method", "MyClass.my_method"),
+            #(MyClass().my_classmethod(), "my_classmethod", "MyClass.my_classmethod"),
+            (MyClass.my_staticmethod(), "my_staticmethod", "MyClass.my_staticmethod"),
+        ]:
+            assert coro.__name__ == name and coro.__qualname__ == qualname
+        "#;
+        let locals = [
+            (
+                "my_fn",
+                wrap_pyfunction_bound!(my_fn, gil)
+                    .unwrap()
+                    .as_borrowed()
+                    .as_any(),
+            ),
+            ("MyClass", gil.get_type_bound::<MyClass>().as_any()),
+        ]
+        .into_py_dict_bound(gil);
+        py_run!(gil, *locals, &handle_windows(test));
+    })
+}
+
+#[test]
+fn sleep_0_like_coroutine() {
+    #[pyfunction]
+    async fn sleep_0() -> usize {
+        let mut waken = false;
+        poll_fn(|cx| {
+            if !waken {
+                cx.waker().wake_by_ref();
+                waken = true;
+                return Poll::Pending;
+            }
+            Poll::Ready(42)
+        })
+        .await
+    }
+    Python::with_gil(|gil| {
+        let sleep_0 = wrap_pyfunction_bound!(sleep_0, gil).unwrap();
+        let test = "import asyncio; assert asyncio.run(sleep_0()) == 42";
+        py_run!(gil, sleep_0, &handle_windows(test));
+    })
+}
+
+#[pyfunction]
+async fn sleep(seconds: f64) -> usize {
+    let (tx, rx) = oneshot::channel();
+    thread::spawn(move || {
+        thread::sleep(Duration::from_secs_f64(seconds));
+        tx.send(42).unwrap();
+    });
+    rx.await.unwrap()
+}
+
+#[test]
+fn sleep_coroutine() {
+    Python::with_gil(|gil| {
+        let sleep = wrap_pyfunction_bound!(sleep, gil).unwrap();
+        let test = r#"import asyncio; assert asyncio.run(sleep(0.1)) == 42"#;
+        py_run!(gil, sleep, &handle_windows(test));
+    })
+}
+
+#[test]
+fn cancelled_coroutine() {
+    Python::with_gil(|gil| {
+        let sleep = wrap_pyfunction_bound!(sleep, gil).unwrap();
+        let test = r#"
+        import asyncio
+        async def main():
+            task = asyncio.create_task(sleep(999))
+            await asyncio.sleep(0)
+            task.cancel()
+            await task
+        asyncio.run(main())
+        "#;
+        let globals = gil.import_bound("__main__").unwrap().dict();
+        globals.set_item("sleep", sleep).unwrap();
+        let err = gil
+            .run_bound(
+                &pyo3::unindent::unindent(&handle_windows(test)),
+                Some(&globals),
+                None,
+            )
+            .unwrap_err();
+        assert_eq!(
+            err.value_bound(gil).get_type().qualname().unwrap(),
+            "CancelledError"
+        );
+    })
+}
+
+#[test]
+fn coroutine_cancel_handle() {
+    #[pyfunction]
+    async fn cancellable_sleep(
+        seconds: f64,
+        #[pyo3(cancel_handle)] mut cancel: CancelHandle,
+    ) -> usize {
+        futures::select! {
+            _ = sleep(seconds).fuse() => 42,
+            _ = cancel.cancelled().fuse() => 0,
+        }
+    }
+    Python::with_gil(|gil| {
+        let cancellable_sleep = wrap_pyfunction_bound!(cancellable_sleep, gil).unwrap();
+        let test = r#"
+        import asyncio;
+        async def main():
+            task = asyncio.create_task(cancellable_sleep(999))
+            await asyncio.sleep(0)
+            task.cancel()
+            return await task
+        assert asyncio.run(main()) == 0
+        "#;
+        let globals = gil.import_bound("__main__").unwrap().dict();
+        globals
+            .set_item("cancellable_sleep", cancellable_sleep)
+            .unwrap();
+        gil.run_bound(
+            &pyo3::unindent::unindent(&handle_windows(test)),
+            Some(&globals),
+            None,
+        )
+        .unwrap();
+    })
+}
+
+#[test]
+fn coroutine_is_cancelled() {
+    #[pyfunction]
+    async fn sleep_loop(#[pyo3(cancel_handle)] cancel: CancelHandle) {
+        while !cancel.is_cancelled() {
+            sleep(0.001).await;
+        }
+    }
+    Python::with_gil(|gil| {
+        let sleep_loop = wrap_pyfunction_bound!(sleep_loop, gil).unwrap();
+        let test = r#"
+        import asyncio;
+        async def main():
+            task = asyncio.create_task(sleep_loop())
+            await asyncio.sleep(0)
+            task.cancel()
+            await task
+        asyncio.run(main())
+        "#;
+        let globals = gil.import_bound("__main__").unwrap().dict();
+        globals.set_item("sleep_loop", sleep_loop).unwrap();
+        gil.run_bound(
+            &pyo3::unindent::unindent(&handle_windows(test)),
+            Some(&globals),
+            None,
+        )
+        .unwrap();
+    })
+}
+
+#[test]
+fn coroutine_panic() {
+    #[pyfunction]
+    async fn panic() {
+        panic!("test panic");
+    }
+    Python::with_gil(|gil| {
+        let panic = wrap_pyfunction_bound!(panic, gil).unwrap();
+        let test = r#"
+        import asyncio
+        coro = panic()
+        try:
+            asyncio.run(coro)
+        except BaseException as err:
+            assert type(err).__name__ == "PanicException"
+            assert str(err) == "test panic"
+        else:
+            assert False
+        try:
+            coro.send(None)
+        except RuntimeError as err:
+            assert str(err) == "cannot reuse already awaited coroutine"
+        else:
+            assert False;
+        "#;
+        py_run!(gil, panic, &handle_windows(test));
+    })
+}
+
+#[test]
+fn test_async_method_receiver() {
+    #[pyclass]
+    struct Counter(usize);
+    #[pymethods]
+    impl Counter {
+        #[new]
+        fn new() -> Self {
+            Self(0)
+        }
+        async fn get(&self) -> usize {
+            self.0
+        }
+        async fn incr(&mut self) -> usize {
+            self.0 += 1;
+            self.0
+        }
+    }
+
+    static IS_DROPPED: AtomicBool = AtomicBool::new(false);
+
+    impl Drop for Counter {
+        fn drop(&mut self) {
+            IS_DROPPED.store(true, Ordering::SeqCst);
+        }
+    }
+
+    Python::with_gil(|gil| {
+        let test = r#"
+        import asyncio
+
+        obj = Counter()
+        coro1 = obj.get()
+        coro2 = obj.get()
+        try:
+            obj.incr()  # borrow checking should fail
+        except RuntimeError as err:
+            pass
+        else:
+            assert False
+        assert asyncio.run(coro1) == 0
+        coro2.close()
+        coro3 = obj.incr()
+        try:
+            obj.incr()  # borrow checking should fail
+        except RuntimeError as err:
+            pass
+        else:
+            assert False
+        try:
+            obj.get() # borrow checking should fail
+        except RuntimeError as err:
+            pass
+        else:
+            assert False
+        assert asyncio.run(coro3) == 1
+        "#;
+        let locals = [("Counter", gil.get_type_bound::<Counter>())].into_py_dict_bound(gil);
+        py_run!(gil, *locals, test);
+    });
+
+    assert!(IS_DROPPED.load(Ordering::SeqCst));
+}
+
+#[test]
+fn test_async_method_receiver_with_other_args() {
+    #[pyclass]
+    struct Value(i32);
+    #[pymethods]
+    impl Value {
+        #[new]
+        fn new() -> Self {
+            Self(0)
+        }
+        async fn get_value_plus_with(&self, v1: i32, v2: i32) -> i32 {
+            self.0 + v1 + v2
+        }
+        async fn set_value(&mut self, new_value: i32) -> i32 {
+            self.0 = new_value;
+            self.0
+        }
+    }
+
+    Python::with_gil(|gil| {
+        let test = r#"
+        import asyncio
+
+        v = Value()
+        assert asyncio.run(v.get_value_plus_with(3, 0)) == 3
+        assert asyncio.run(v.set_value(10)) == 10
+        assert asyncio.run(v.get_value_plus_with(1, 1)) == 12
+        "#;
+        let locals = [("Value", gil.get_type_bound::<Value>())].into_py_dict_bound(gil);
+        py_run!(gil, *locals, test);
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_datetime.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_datetime.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_datetime.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_datetime.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,209 @@
+#![cfg(not(Py_LIMITED_API))]
+
+use pyo3::prelude::*;
+use pyo3::types::{timezone_utc_bound, IntoPyDict, PyDate, PyDateTime, PyTime};
+use pyo3_ffi::PyDateTime_IMPORT;
+
+fn _get_subclasses<'py>(
+    py: Python<'py>,
+    py_type: &str,
+    args: &str,
+) -> PyResult<(Bound<'py, PyAny>, Bound<'py, PyAny>, Bound<'py, PyAny>)> {
+    // Import the class from Python and create some subclasses
+    let datetime = py.import_bound("datetime")?;
+
+    let locals = [(py_type, datetime.getattr(py_type)?)].into_py_dict_bound(py);
+
+    let make_subclass_py = format!("class Subklass({}):\n    pass", py_type);
+
+    let make_sub_subclass_py = "class SubSubklass(Subklass):\n    pass";
+
+    py.run_bound(&make_subclass_py, None, Some(&locals))?;
+    py.run_bound(make_sub_subclass_py, None, Some(&locals))?;
+
+    // Construct an instance of the base class
+    let obj = py.eval_bound(&format!("{}({})", py_type, args), None, Some(&locals))?;
+
+    // Construct an instance of the subclass
+    let sub_obj = py.eval_bound(&format!("Subklass({})", args), None, Some(&locals))?;
+
+    // Construct an instance of the sub-subclass
+    let sub_sub_obj = py.eval_bound(&format!("SubSubklass({})", args), None, Some(&locals))?;
+
+    Ok((obj, sub_obj, sub_sub_obj))
+}
+
+macro_rules! assert_check_exact {
+    ($check_func:ident, $check_func_exact:ident, $obj: expr) => {
+        unsafe {
+            use pyo3::ffi::*;
+            assert!($check_func(($obj).as_ptr()) != 0);
+            assert!($check_func_exact(($obj).as_ptr()) != 0);
+        }
+    };
+}
+
+macro_rules! assert_check_only {
+    ($check_func:ident, $check_func_exact:ident, $obj: expr) => {
+        unsafe {
+            use pyo3::ffi::*;
+            assert!($check_func(($obj).as_ptr()) != 0);
+            assert!($check_func_exact(($obj).as_ptr()) == 0);
+        }
+    };
+}
+
+#[test]
+fn test_date_check() {
+    Python::with_gil(|py| {
+        let (obj, sub_obj, sub_sub_obj) = _get_subclasses(py, "date", "2018, 1, 1").unwrap();
+        unsafe { PyDateTime_IMPORT() }
+        assert_check_exact!(PyDate_Check, PyDate_CheckExact, obj);
+        assert_check_only!(PyDate_Check, PyDate_CheckExact, sub_obj);
+        assert_check_only!(PyDate_Check, PyDate_CheckExact, sub_sub_obj);
+        assert!(obj.is_instance_of::<PyDate>());
+        assert!(!obj.is_instance_of::<PyTime>());
+        assert!(!obj.is_instance_of::<PyDateTime>());
+    });
+}
+
+#[test]
+fn test_time_check() {
+    Python::with_gil(|py| {
+        let (obj, sub_obj, sub_sub_obj) = _get_subclasses(py, "time", "12, 30, 15").unwrap();
+        unsafe { PyDateTime_IMPORT() }
+
+        assert_check_exact!(PyTime_Check, PyTime_CheckExact, obj);
+        assert_check_only!(PyTime_Check, PyTime_CheckExact, sub_obj);
+        assert_check_only!(PyTime_Check, PyTime_CheckExact, sub_sub_obj);
+        assert!(!obj.is_instance_of::<PyDate>());
+        assert!(obj.is_instance_of::<PyTime>());
+        assert!(!obj.is_instance_of::<PyDateTime>());
+    });
+}
+
+#[test]
+fn test_datetime_check() {
+    Python::with_gil(|py| {
+        let (obj, sub_obj, sub_sub_obj) = _get_subclasses(py, "datetime", "2018, 1, 1, 13, 30, 15")
+            .map_err(|e| e.display(py))
+            .unwrap();
+        unsafe { PyDateTime_IMPORT() }
+
+        assert_check_only!(PyDate_Check, PyDate_CheckExact, obj);
+        assert_check_exact!(PyDateTime_Check, PyDateTime_CheckExact, obj);
+        assert_check_only!(PyDateTime_Check, PyDateTime_CheckExact, sub_obj);
+        assert_check_only!(PyDateTime_Check, PyDateTime_CheckExact, sub_sub_obj);
+        assert!(obj.is_instance_of::<PyDate>());
+        assert!(!obj.is_instance_of::<PyTime>());
+        assert!(obj.is_instance_of::<PyDateTime>());
+    });
+}
+
+#[test]
+fn test_delta_check() {
+    Python::with_gil(|py| {
+        let (obj, sub_obj, sub_sub_obj) = _get_subclasses(py, "timedelta", "1, -3").unwrap();
+        unsafe { PyDateTime_IMPORT() }
+
+        assert_check_exact!(PyDelta_Check, PyDelta_CheckExact, obj);
+        assert_check_only!(PyDelta_Check, PyDelta_CheckExact, sub_obj);
+        assert_check_only!(PyDelta_Check, PyDelta_CheckExact, sub_sub_obj);
+    });
+}
+
+#[test]
+fn test_datetime_utc() {
+    use assert_approx_eq::assert_approx_eq;
+    use pyo3::types::PyDateTime;
+
+    Python::with_gil(|py| {
+        let utc = timezone_utc_bound(py);
+
+        let dt = PyDateTime::new_bound(py, 2018, 1, 1, 0, 0, 0, 0, Some(&utc)).unwrap();
+
+        let locals = [("dt", dt)].into_py_dict_bound(py);
+
+        let offset: f32 = py
+            .eval_bound("dt.utcoffset().total_seconds()", None, Some(&locals))
+            .unwrap()
+            .extract()
+            .unwrap();
+        assert_approx_eq!(offset, 0f32);
+    });
+}
+
+static INVALID_DATES: &[(i32, u8, u8)] = &[
+    (-1, 1, 1),
+    (0, 1, 1),
+    (10000, 1, 1),
+    (2 << 30, 1, 1),
+    (2018, 0, 1),
+    (2018, 13, 1),
+    (2018, 1, 0),
+    (2017, 2, 29),
+    (2018, 1, 32),
+];
+
+static INVALID_TIMES: &[(u8, u8, u8, u32)] =
+    &[(25, 0, 0, 0), (255, 0, 0, 0), (0, 60, 0, 0), (0, 0, 61, 0)];
+
+#[test]
+fn test_pydate_out_of_bounds() {
+    use pyo3::types::PyDate;
+
+    Python::with_gil(|py| {
+        for val in INVALID_DATES {
+            let (year, month, day) = val;
+            let dt = PyDate::new_bound(py, *year, *month, *day);
+            dt.unwrap_err();
+        }
+    });
+}
+
+#[test]
+fn test_pytime_out_of_bounds() {
+    use pyo3::types::PyTime;
+
+    Python::with_gil(|py| {
+        for val in INVALID_TIMES {
+            let (hour, minute, second, microsecond) = val;
+            let dt = PyTime::new_bound(py, *hour, *minute, *second, *microsecond, None);
+            dt.unwrap_err();
+        }
+    });
+}
+
+#[test]
+fn test_pydatetime_out_of_bounds() {
+    use pyo3::types::PyDateTime;
+    use std::iter;
+
+    Python::with_gil(|py| {
+        let valid_time = (0, 0, 0, 0);
+        let valid_date = (2018, 1, 1);
+
+        let invalid_dates = INVALID_DATES.iter().zip(iter::repeat(&valid_time));
+        let invalid_times = iter::repeat(&valid_date).zip(INVALID_TIMES.iter());
+
+        let vals = invalid_dates.chain(invalid_times);
+
+        for val in vals {
+            let (date, time) = val;
+            let (year, month, day) = date;
+            let (hour, minute, second, microsecond) = time;
+            let dt = PyDateTime::new_bound(
+                py,
+                *year,
+                *month,
+                *day,
+                *hour,
+                *minute,
+                *second,
+                *microsecond,
+                None,
+            );
+            dt.unwrap_err();
+        }
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_datetime_import.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_datetime_import.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_datetime_import.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_datetime_import.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,26 @@
+#![cfg(not(Py_LIMITED_API))]
+
+use pyo3::{prelude::*, types::PyDate};
+
+#[test]
+#[should_panic(expected = "module 'datetime' has no attribute 'datetime_CAPI'")]
+fn test_bad_datetime_module_panic() {
+    // Create an empty temporary directory
+    // with an empty "datetime" module which we'll put on the sys.path
+    let tmpdir = std::env::temp_dir();
+    let tmpdir = tmpdir.join("pyo3_test_date_check");
+    let _ = std::fs::remove_dir_all(&tmpdir);
+    std::fs::create_dir(&tmpdir).unwrap();
+    std::fs::File::create(tmpdir.join("datetime.py")).unwrap();
+
+    Python::with_gil(|py: Python<'_>| {
+        let sys = py.import_bound("sys").unwrap();
+        sys.getattr("path")
+            .unwrap()
+            .call_method1("insert", (0, tmpdir))
+            .unwrap();
+
+        // This should panic because the "datetime" module is empty
+        PyDate::new_bound(py, 2018, 1, 1).unwrap();
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_declarative_module.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_declarative_module.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_declarative_module.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_declarative_module.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,258 @@
+#![cfg(feature = "macros")]
+
+use pyo3::create_exception;
+use pyo3::exceptions::PyException;
+use pyo3::prelude::*;
+use pyo3::sync::GILOnceCell;
+#[cfg(not(Py_LIMITED_API))]
+use pyo3::types::PyBool;
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+mod some_module {
+    use pyo3::create_exception;
+    use pyo3::exceptions::PyException;
+    use pyo3::prelude::*;
+
+    #[pyclass]
+    pub struct SomePyClass;
+
+    create_exception!(some_module, SomeException, PyException);
+}
+
+#[pyclass]
+struct ValueClass {
+    value: usize,
+}
+
+#[pymethods]
+impl ValueClass {
+    #[new]
+    fn new(value: usize) -> Self {
+        Self { value }
+    }
+}
+
+#[pyclass(module = "module")]
+struct LocatedClass {}
+
+#[pyfunction]
+fn double(x: usize) -> usize {
+    x * 2
+}
+
+create_exception!(
+    declarative_module,
+    MyError,
+    PyException,
+    "Some description."
+);
+
+#[pymodule(submodule)]
+mod external_submodule {}
+
+/// A module written using declarative syntax.
+#[pymodule]
+mod declarative_module {
+    #[pymodule_export]
+    use super::declarative_submodule;
+    #[pymodule_export]
+    // This is not a real constraint but to test cfg attribute support
+    #[cfg(not(Py_LIMITED_API))]
+    use super::LocatedClass;
+    use super::*;
+    #[pymodule_export]
+    use super::{declarative_module2, double, MyError, ValueClass as Value};
+
+    // test for #4036
+    #[pymodule_export]
+    use super::some_module::SomePyClass;
+
+    // test for #4036
+    #[pymodule_export]
+    use super::some_module::SomeException;
+
+    #[pymodule_export]
+    use super::external_submodule;
+
+    #[pymodule]
+    mod inner {
+        use super::*;
+
+        #[pyfunction]
+        fn triple(x: usize) -> usize {
+            x * 3
+        }
+
+        #[pyclass(name = "Struct")]
+        struct Struct;
+
+        #[pymethods]
+        impl Struct {
+            #[new]
+            fn new() -> Self {
+                Self
+            }
+        }
+
+        #[pyclass(module = "foo")]
+        struct StructInCustomModule;
+
+        #[pyclass(eq, eq_int, name = "Enum")]
+        #[derive(PartialEq)]
+        enum Enum {
+            A,
+            B,
+        }
+
+        #[pyclass(eq, eq_int, module = "foo")]
+        #[derive(PartialEq)]
+        enum EnumInCustomModule {
+            A,
+            B,
+        }
+    }
+
+    #[pymodule(submodule)]
+    #[pyo3(module = "custom_root")]
+    mod inner_custom_root {
+        use super::*;
+
+        #[pyclass]
+        struct Struct;
+    }
+
+    #[pyo3::prelude::pymodule]
+    mod full_path_inner {}
+
+    #[pymodule_init]
+    fn init(m: &Bound<'_, PyModule>) -> PyResult<()> {
+        m.add("double2", m.getattr("double")?)
+    }
+}
+
+#[pyfunction]
+fn double_value(v: &ValueClass) -> usize {
+    v.value * 2
+}
+
+#[pymodule]
+mod declarative_submodule {
+    #[pymodule_export]
+    use super::{double, double_value};
+}
+
+#[pymodule(name = "declarative_module_renamed")]
+mod declarative_module2 {
+    #[pymodule_export]
+    use super::double;
+}
+
+fn declarative_module(py: Python<'_>) -> &Bound<'_, PyModule> {
+    static MODULE: GILOnceCell<Py<PyModule>> = GILOnceCell::new();
+    MODULE
+        .get_or_init(py, || pyo3::wrap_pymodule!(declarative_module)(py))
+        .bind(py)
+}
+
+#[test]
+fn test_declarative_module() {
+    Python::with_gil(|py| {
+        let m = declarative_module(py);
+        py_assert!(
+            py,
+            m,
+            "m.__doc__ == 'A module written using declarative syntax.'"
+        );
+
+        py_assert!(py, m, "m.double(2) == 4");
+        py_assert!(py, m, "m.inner.triple(3) == 9");
+        py_assert!(py, m, "m.declarative_submodule.double(4) == 8");
+        py_assert!(
+            py,
+            m,
+            "m.declarative_submodule.double_value(m.ValueClass(1)) == 2"
+        );
+        py_assert!(py, m, "str(m.MyError('foo')) == 'foo'");
+        py_assert!(py, m, "m.declarative_module_renamed.double(2) == 4");
+        #[cfg(Py_LIMITED_API)]
+        py_assert!(py, m, "not hasattr(m, 'LocatedClass')");
+        #[cfg(not(Py_LIMITED_API))]
+        py_assert!(py, m, "hasattr(m, 'LocatedClass')");
+        py_assert!(py, m, "isinstance(m.inner.Struct(), m.inner.Struct)");
+        py_assert!(py, m, "isinstance(m.inner.Enum.A, m.inner.Enum)");
+        py_assert!(py, m, "hasattr(m, 'external_submodule')")
+    })
+}
+
+#[cfg(not(Py_LIMITED_API))]
+#[pyclass(extends = PyBool)]
+struct ExtendsBool;
+
+#[cfg(not(Py_LIMITED_API))]
+#[pymodule]
+mod class_initialization_module {
+    #[pymodule_export]
+    use super::ExtendsBool;
+}
+
+#[test]
+#[cfg(not(Py_LIMITED_API))]
+fn test_class_initialization_fails() {
+    Python::with_gil(|py| {
+        let err = class_initialization_module::_PYO3_DEF
+            .make_module(py)
+            .unwrap_err();
+        assert_eq!(
+            err.to_string(),
+            "RuntimeError: An error occurred while initializing class ExtendsBool"
+        );
+    })
+}
+
+#[pymodule]
+mod r#type {
+    #[pymodule_export]
+    use super::double;
+}
+
+#[test]
+fn test_raw_ident_module() {
+    Python::with_gil(|py| {
+        let m = pyo3::wrap_pymodule!(r#type)(py).into_bound(py);
+        py_assert!(py, m, "m.double(2) == 4");
+    })
+}
+
+#[test]
+fn test_module_names() {
+    Python::with_gil(|py| {
+        let m = declarative_module(py);
+        py_assert!(
+            py,
+            m,
+            "m.inner.Struct.__module__ == 'declarative_module.inner'"
+        );
+        py_assert!(py, m, "m.inner.StructInCustomModule.__module__ == 'foo'");
+        py_assert!(
+            py,
+            m,
+            "m.inner.Enum.__module__ == 'declarative_module.inner'"
+        );
+        py_assert!(py, m, "m.inner.EnumInCustomModule.__module__ == 'foo'");
+        py_assert!(
+            py,
+            m,
+            "m.inner_custom_root.Struct.__module__ == 'custom_root.inner_custom_root'"
+        );
+    })
+}
+
+#[test]
+fn test_inner_module_full_path() {
+    Python::with_gil(|py| {
+        let m = declarative_module(py);
+        py_assert!(py, m, "m.full_path_inner");
+    })
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_default_impls.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_default_impls.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_default_impls.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_default_impls.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,46 @@
+#![cfg(feature = "macros")]
+
+use pyo3::prelude::*;
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+// Test default generated __repr__.
+#[pyclass(eq, eq_int)]
+#[derive(PartialEq)]
+enum TestDefaultRepr {
+    Var,
+}
+
+#[test]
+fn test_default_slot_exists() {
+    Python::with_gil(|py| {
+        let test_object = Py::new(py, TestDefaultRepr::Var).unwrap();
+        py_assert!(
+            py,
+            test_object,
+            "repr(test_object) == 'TestDefaultRepr.Var'"
+        );
+    })
+}
+
+#[pyclass(eq, eq_int)]
+#[derive(PartialEq)]
+enum OverrideSlot {
+    Var,
+}
+
+#[pymethods]
+impl OverrideSlot {
+    fn __repr__(&self) -> &str {
+        "overridden"
+    }
+}
+
+#[test]
+fn test_override_slot() {
+    Python::with_gil(|py| {
+        let test_object = Py::new(py, OverrideSlot::Var).unwrap();
+        py_assert!(py, test_object, "repr(test_object) == 'overridden'");
+    })
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_dict_iter.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_dict_iter.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_dict_iter.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_dict_iter.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,17 @@
+use pyo3::prelude::*;
+use pyo3::types::IntoPyDict;
+
+#[test]
+#[cfg_attr(target_arch = "wasm32", ignore)] // Not sure why this fails.
+fn iter_dict_nosegv() {
+    Python::with_gil(|py| {
+        const LEN: usize = 10_000_000;
+        let dict = (0..LEN as u64).map(|i| (i, i * 2)).into_py_dict_bound(py);
+        let mut sum = 0;
+        for (k, _v) in dict {
+            let i: u64 = k.extract().unwrap();
+            sum += i;
+        }
+        assert_eq!(sum, 49_999_995_000_000);
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_enum.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_enum.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_enum.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_enum.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,357 @@
+#![cfg(feature = "macros")]
+
+use pyo3::prelude::*;
+use pyo3::py_run;
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyclass(eq, eq_int)]
+#[derive(Debug, PartialEq, Eq, Clone)]
+pub enum MyEnum {
+    Variant,
+    OtherVariant,
+}
+
+#[test]
+fn test_enum_class_attr() {
+    Python::with_gil(|py| {
+        let my_enum = py.get_type_bound::<MyEnum>();
+        let var = Py::new(py, MyEnum::Variant).unwrap();
+        py_assert!(py, my_enum var, "my_enum.Variant == var");
+    })
+}
+
+#[pyfunction]
+fn return_enum() -> MyEnum {
+    MyEnum::Variant
+}
+
+#[test]
+fn test_return_enum() {
+    Python::with_gil(|py| {
+        let f = wrap_pyfunction_bound!(return_enum)(py).unwrap();
+        let mynum = py.get_type_bound::<MyEnum>();
+
+        py_run!(py, f mynum, "assert f() == mynum.Variant")
+    });
+}
+
+#[pyfunction]
+fn enum_arg(e: MyEnum) {
+    assert_eq!(MyEnum::OtherVariant, e)
+}
+
+#[test]
+fn test_enum_arg() {
+    Python::with_gil(|py| {
+        let f = wrap_pyfunction_bound!(enum_arg)(py).unwrap();
+        let mynum = py.get_type_bound::<MyEnum>();
+
+        py_run!(py, f mynum, "f(mynum.OtherVariant)")
+    })
+}
+
+#[pyclass(eq, eq_int)]
+#[derive(Debug, PartialEq, Eq, Clone)]
+enum CustomDiscriminant {
+    One = 1,
+    Two = 2,
+}
+
+#[test]
+fn test_custom_discriminant() {
+    Python::with_gil(|py| {
+        #[allow(non_snake_case)]
+        let CustomDiscriminant = py.get_type_bound::<CustomDiscriminant>();
+        let one = Py::new(py, CustomDiscriminant::One).unwrap();
+        let two = Py::new(py, CustomDiscriminant::Two).unwrap();
+        py_run!(py, CustomDiscriminant one two, r#"
+        assert CustomDiscriminant.One == one
+        assert CustomDiscriminant.Two == two
+        assert one != two
+        "#);
+    })
+}
+
+#[test]
+fn test_enum_to_int() {
+    Python::with_gil(|py| {
+        let one = Py::new(py, CustomDiscriminant::One).unwrap();
+        py_assert!(py, one, "int(one) == 1");
+        let v = Py::new(py, MyEnum::Variant).unwrap();
+        let v_value = MyEnum::Variant as isize;
+        py_run!(py, v v_value, "int(v) == v_value");
+    })
+}
+
+#[test]
+fn test_enum_compare_int() {
+    Python::with_gil(|py| {
+        let one = Py::new(py, CustomDiscriminant::One).unwrap();
+        py_run!(
+            py,
+            one,
+            r#"
+            assert one == 1
+            assert 1 == one
+            assert one != 2
+        "#
+        )
+    })
+}
+
+#[pyclass(eq, eq_int)]
+#[derive(Debug, PartialEq, Eq, Clone)]
+#[repr(u8)]
+enum SmallEnum {
+    V = 1,
+}
+
+#[test]
+fn test_enum_compare_int_no_throw_when_overflow() {
+    Python::with_gil(|py| {
+        let v = Py::new(py, SmallEnum::V).unwrap();
+        py_assert!(py, v, "v != 1<<30")
+    })
+}
+
+#[pyclass(eq, eq_int)]
+#[derive(Debug, PartialEq, Eq, Clone)]
+#[repr(usize)]
+#[allow(clippy::enum_clike_unportable_variant)]
+enum BigEnum {
+    V = usize::MAX,
+}
+
+#[test]
+fn test_big_enum_no_overflow() {
+    Python::with_gil(|py| {
+        let usize_max = usize::MAX;
+        let v = Py::new(py, BigEnum::V).unwrap();
+
+        py_assert!(py, usize_max v, "v == usize_max");
+        py_assert!(py, usize_max v, "int(v) == usize_max");
+    })
+}
+
+#[pyclass(eq, eq_int)]
+#[derive(Debug, PartialEq, Eq, Clone)]
+#[repr(u16, align(8))]
+enum TestReprParse {
+    V,
+}
+
+#[test]
+fn test_repr_parse() {
+    assert_eq!(std::mem::align_of::<TestReprParse>(), 8);
+}
+
+#[pyclass(eq, eq_int, name = "MyEnum")]
+#[derive(Debug, PartialEq, Eq, Clone)]
+pub enum RenameEnum {
+    Variant,
+}
+
+#[test]
+fn test_rename_enum_repr_correct() {
+    Python::with_gil(|py| {
+        let var1 = Py::new(py, RenameEnum::Variant).unwrap();
+        py_assert!(py, var1, "repr(var1) == 'MyEnum.Variant'");
+    })
+}
+
+#[pyclass(eq, eq_int)]
+#[derive(Debug, PartialEq, Eq, Clone)]
+pub enum RenameVariantEnum {
+    #[pyo3(name = "VARIANT")]
+    Variant,
+}
+
+#[test]
+fn test_rename_variant_repr_correct() {
+    Python::with_gil(|py| {
+        let var1 = Py::new(py, RenameVariantEnum::Variant).unwrap();
+        py_assert!(py, var1, "repr(var1) == 'RenameVariantEnum.VARIANT'");
+    })
+}
+
+#[pyclass(eq, eq_int, rename_all = "SCREAMING_SNAKE_CASE")]
+#[derive(Debug, PartialEq, Eq, Clone)]
+#[allow(clippy::enum_variant_names)]
+enum RenameAllVariantsEnum {
+    VariantOne,
+    VariantTwo,
+    #[pyo3(name = "VariantThree")]
+    VariantFour,
+}
+
+#[test]
+fn test_renaming_all_enum_variants() {
+    Python::with_gil(|py| {
+        let enum_obj = py.get_type_bound::<RenameAllVariantsEnum>();
+        py_assert!(py, enum_obj, "enum_obj.VARIANT_ONE == enum_obj.VARIANT_ONE");
+        py_assert!(py, enum_obj, "enum_obj.VARIANT_TWO == enum_obj.VARIANT_TWO");
+        py_assert!(
+            py,
+            enum_obj,
+            "enum_obj.VariantThree == enum_obj.VariantThree"
+        );
+    });
+}
+
+#[pyclass(module = "custom_module")]
+#[derive(Debug, Clone)]
+enum CustomModuleComplexEnum {
+    Variant(),
+}
+
+#[test]
+fn test_custom_module() {
+    Python::with_gil(|py| {
+        let enum_obj = py.get_type_bound::<CustomModuleComplexEnum>();
+        py_assert!(
+            py,
+            enum_obj,
+            "enum_obj.Variant.__module__ == 'custom_module'"
+        );
+    });
+}
+
+#[pyclass(eq)]
+#[derive(Debug, Clone, PartialEq)]
+pub enum EqOnly {
+    VariantA,
+    VariantB,
+}
+
+#[test]
+fn test_simple_enum_eq_only() {
+    Python::with_gil(|py| {
+        let var1 = Py::new(py, EqOnly::VariantA).unwrap();
+        let var2 = Py::new(py, EqOnly::VariantA).unwrap();
+        let var3 = Py::new(py, EqOnly::VariantB).unwrap();
+        py_assert!(py, var1 var2, "var1 == var2");
+        py_assert!(py, var1 var3, "var1 != var3");
+    })
+}
+
+#[pyclass(frozen, eq, eq_int, hash)]
+#[derive(PartialEq, Hash)]
+enum SimpleEnumWithHash {
+    A,
+    B,
+}
+
+#[test]
+fn test_simple_enum_with_hash() {
+    Python::with_gil(|py| {
+        use pyo3::types::IntoPyDict;
+        let class = SimpleEnumWithHash::A;
+        let hash = {
+            use std::hash::{Hash, Hasher};
+            let mut hasher = std::collections::hash_map::DefaultHasher::new();
+            class.hash(&mut hasher);
+            hasher.finish() as isize
+        };
+
+        let env = [
+            ("obj", Py::new(py, class).unwrap().into_any()),
+            ("hsh", hash.into_py(py)),
+        ]
+        .into_py_dict_bound(py);
+
+        py_assert!(py, *env, "hash(obj) == hsh");
+    });
+}
+
+#[pyclass(eq, hash)]
+#[derive(PartialEq, Hash)]
+enum ComplexEnumWithHash {
+    A(u32),
+    B { msg: String },
+}
+
+#[test]
+fn test_complex_enum_with_hash() {
+    Python::with_gil(|py| {
+        use pyo3::types::IntoPyDict;
+        let class = ComplexEnumWithHash::B {
+            msg: String::from("Hello"),
+        };
+        let hash = {
+            use std::hash::{Hash, Hasher};
+            let mut hasher = std::collections::hash_map::DefaultHasher::new();
+            class.hash(&mut hasher);
+            hasher.finish() as isize
+        };
+
+        let env = [
+            ("obj", Py::new(py, class).unwrap().into_any()),
+            ("hsh", hash.into_py(py)),
+        ]
+        .into_py_dict_bound(py);
+
+        py_assert!(py, *env, "hash(obj) == hsh");
+    });
+}
+
+#[allow(deprecated)]
+mod deprecated {
+    use crate::py_assert;
+    use pyo3::prelude::*;
+    use pyo3::py_run;
+
+    #[pyclass]
+    #[derive(Debug, PartialEq, Eq, Clone)]
+    pub enum MyEnum {
+        Variant,
+        OtherVariant,
+    }
+
+    #[test]
+    fn test_enum_eq_enum() {
+        Python::with_gil(|py| {
+            let var1 = Py::new(py, MyEnum::Variant).unwrap();
+            let var2 = Py::new(py, MyEnum::Variant).unwrap();
+            let other_var = Py::new(py, MyEnum::OtherVariant).unwrap();
+            py_assert!(py, var1 var2, "var1 == var2");
+            py_assert!(py, var1 other_var, "var1 != other_var");
+            py_assert!(py, var1 var2, "(var1 != var2) == False");
+        })
+    }
+
+    #[test]
+    fn test_enum_eq_incomparable() {
+        Python::with_gil(|py| {
+            let var1 = Py::new(py, MyEnum::Variant).unwrap();
+            py_assert!(py, var1, "(var1 == 'foo') == False");
+            py_assert!(py, var1, "(var1 != 'foo') == True");
+        })
+    }
+
+    #[pyclass]
+    enum CustomDiscriminant {
+        One = 1,
+        Two = 2,
+    }
+
+    #[test]
+    fn test_custom_discriminant() {
+        Python::with_gil(|py| {
+            #[allow(non_snake_case)]
+            let CustomDiscriminant = py.get_type_bound::<CustomDiscriminant>();
+            let one = Py::new(py, CustomDiscriminant::One).unwrap();
+            let two = Py::new(py, CustomDiscriminant::Two).unwrap();
+            py_run!(py, CustomDiscriminant one two, r#"
+            assert CustomDiscriminant.One == one
+            assert CustomDiscriminant.Two == two
+            assert CustomDiscriminant.One == 1
+            assert CustomDiscriminant.Two == 2
+            assert one != two
+            assert CustomDiscriminant.One != 2
+            assert CustomDiscriminant.Two != 1
+            "#);
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_exceptions.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_exceptions.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_exceptions.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_exceptions.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,128 @@
+#![cfg(feature = "macros")]
+
+use pyo3::prelude::*;
+use pyo3::{exceptions, py_run};
+use std::error::Error;
+use std::fmt;
+#[cfg(not(target_os = "windows"))]
+use std::fs::File;
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyfunction]
+#[cfg(not(target_os = "windows"))]
+fn fail_to_open_file() -> PyResult<()> {
+    File::open("not_there.txt")?;
+    Ok(())
+}
+
+#[test]
+#[cfg_attr(target_arch = "wasm32", ignore)] // Not sure why this fails.
+#[cfg(not(target_os = "windows"))]
+fn test_filenotfounderror() {
+    Python::with_gil(|py| {
+        let fail_to_open_file = wrap_pyfunction_bound!(fail_to_open_file)(py).unwrap();
+
+        py_run!(
+            py,
+            fail_to_open_file,
+            r#"
+        try:
+            fail_to_open_file()
+        except FileNotFoundError as e:
+            assert str(e) == "No such file or directory (os error 2)"
+        "#
+        );
+    });
+}
+
+#[derive(Debug)]
+struct CustomError;
+
+impl Error for CustomError {}
+
+impl fmt::Display for CustomError {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        write!(f, "Oh no!")
+    }
+}
+
+impl std::convert::From<CustomError> for PyErr {
+    fn from(err: CustomError) -> PyErr {
+        exceptions::PyOSError::new_err(err.to_string())
+    }
+}
+
+fn fail_with_custom_error() -> Result<(), CustomError> {
+    Err(CustomError)
+}
+
+#[pyfunction]
+fn call_fail_with_custom_error() -> PyResult<()> {
+    fail_with_custom_error()?;
+    Ok(())
+}
+
+#[test]
+fn test_custom_error() {
+    Python::with_gil(|py| {
+        let call_fail_with_custom_error =
+            wrap_pyfunction_bound!(call_fail_with_custom_error)(py).unwrap();
+
+        py_run!(
+            py,
+            call_fail_with_custom_error,
+            r#"
+        try:
+            call_fail_with_custom_error()
+        except OSError as e:
+            assert str(e) == "Oh no!"
+        "#
+        );
+    });
+}
+
+#[test]
+fn test_exception_nosegfault() {
+    use std::net::TcpListener;
+    fn io_err() -> PyResult<()> {
+        TcpListener::bind("no:address")?;
+        Ok(())
+    }
+    fn parse_int() -> PyResult<()> {
+        "@_@".parse::<i64>()?;
+        Ok(())
+    }
+    assert!(io_err().is_err());
+    assert!(parse_int().is_err());
+}
+
+#[test]
+#[cfg(Py_3_8)]
+fn test_write_unraisable() {
+    use common::UnraisableCapture;
+    use pyo3::{exceptions::PyRuntimeError, ffi, types::PyNotImplemented};
+
+    Python::with_gil(|py| {
+        let capture = UnraisableCapture::install(py);
+
+        assert!(capture.borrow(py).capture.is_none());
+
+        let err = PyRuntimeError::new_err("foo");
+        err.write_unraisable_bound(py, None);
+
+        let (err, object) = capture.borrow_mut(py).capture.take().unwrap();
+        assert_eq!(err.to_string(), "RuntimeError: foo");
+        assert!(object.is_none(py));
+
+        let err = PyRuntimeError::new_err("bar");
+        err.write_unraisable_bound(py, Some(&PyNotImplemented::get_bound(py)));
+
+        let (err, object) = capture.borrow_mut(py).capture.take().unwrap();
+        assert_eq!(err.to_string(), "RuntimeError: bar");
+        assert!(object.as_ptr() == unsafe { ffi::Py_NotImplemented() });
+
+        capture.borrow_mut(py).uninstall(py);
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_field_cfg.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_field_cfg.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_field_cfg.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_field_cfg.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,29 @@
+#![cfg(feature = "macros")]
+
+use pyo3::prelude::*;
+
+#[pyclass]
+struct CfgClass {
+    #[pyo3(get, set)]
+    #[cfg(any())]
+    pub a: u32,
+    #[pyo3(get, set)]
+    // This is always true
+    #[cfg(any(
+        target_family = "unix",
+        target_family = "windows",
+        target_family = "wasm"
+    ))]
+    pub b: u32,
+}
+
+#[test]
+fn test_cfg() {
+    Python::with_gil(|py| {
+        let cfg = CfgClass { b: 3 };
+        let py_cfg = Py::new(py, cfg).unwrap();
+        assert!(py_cfg.bind(py).getattr("a").is_err());
+        let b: u32 = py_cfg.bind(py).getattr("b").unwrap().extract().unwrap();
+        assert_eq!(b, 3);
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_frompyobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_frompyobject.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_frompyobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_frompyobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,604 @@
+#![cfg(feature = "macros")]
+
+use pyo3::exceptions::PyValueError;
+use pyo3::prelude::*;
+use pyo3::types::{PyDict, PyList, PyString, PyTuple};
+
+#[macro_use]
+#[path = "../src/tests/common.rs"]
+mod common;
+
+/// Helper function that concatenates the error message from
+/// each error in the traceback into a single string that can
+/// be tested.
+fn extract_traceback(py: Python<'_>, mut error: PyErr) -> String {
+    let mut error_msg = error.to_string();
+    while let Some(cause) = error.cause(py) {
+        error_msg.push_str(": ");
+        error_msg.push_str(&cause.to_string());
+        error = cause
+    }
+    error_msg
+}
+
+#[derive(Debug, FromPyObject)]
+pub struct A<'py> {
+    #[pyo3(attribute)]
+    s: String,
+    #[pyo3(item)]
+    t: Bound<'py, PyString>,
+    #[pyo3(attribute("foo"))]
+    p: Bound<'py, PyAny>,
+}
+
+#[pyclass]
+pub struct PyA {
+    #[pyo3(get)]
+    s: String,
+    #[pyo3(get)]
+    foo: Option<String>,
+}
+
+#[pymethods]
+impl PyA {
+    fn __getitem__(&self, key: String) -> pyo3::PyResult<String> {
+        if key == "t" {
+            Ok("bar".into())
+        } else {
+            Err(PyValueError::new_err("Failed"))
+        }
+    }
+}
+
+#[test]
+fn test_named_fields_struct() {
+    Python::with_gil(|py| {
+        let pya = PyA {
+            s: "foo".into(),
+            foo: None,
+        };
+        let py_c = Py::new(py, pya).unwrap();
+        let a = py_c
+            .extract::<A<'_>>(py)
+            .expect("Failed to extract A from PyA");
+        assert_eq!(a.s, "foo");
+        assert_eq!(a.t.to_string_lossy(), "bar");
+        assert!(a.p.is_none());
+    });
+}
+
+#[derive(Debug, FromPyObject)]
+#[pyo3(transparent)]
+pub struct B {
+    test: String,
+}
+
+#[test]
+fn test_transparent_named_field_struct() {
+    Python::with_gil(|py| {
+        let test: PyObject = "test".into_py(py);
+        let b = test
+            .extract::<B>(py)
+            .expect("Failed to extract B from String");
+        assert_eq!(b.test, "test");
+        let test: PyObject = 1.into_py(py);
+        let b = test.extract::<B>(py);
+        assert!(b.is_err());
+    });
+}
+
+#[derive(Debug, FromPyObject)]
+#[pyo3(transparent)]
+pub struct D<T> {
+    test: T,
+}
+
+#[test]
+fn test_generic_transparent_named_field_struct() {
+    Python::with_gil(|py| {
+        let test: PyObject = "test".into_py(py);
+        let d = test
+            .extract::<D<String>>(py)
+            .expect("Failed to extract D<String> from String");
+        assert_eq!(d.test, "test");
+        let test = 1usize.into_py(py);
+        let d = test
+            .extract::<D<usize>>(py)
+            .expect("Failed to extract D<usize> from String");
+        assert_eq!(d.test, 1);
+    });
+}
+
+#[derive(Debug, FromPyObject)]
+pub struct E<T, T2> {
+    test: T,
+    test2: T2,
+}
+
+#[pyclass]
+#[derive(Clone)]
+pub struct PyE {
+    #[pyo3(get)]
+    test: String,
+    #[pyo3(get)]
+    test2: usize,
+}
+
+#[test]
+fn test_generic_named_fields_struct() {
+    Python::with_gil(|py| {
+        let pye = PyE {
+            test: "test".into(),
+            test2: 2,
+        }
+        .into_py(py);
+
+        let e = pye
+            .extract::<E<String, usize>>(py)
+            .expect("Failed to extract E<String, usize> from PyE");
+        assert_eq!(e.test, "test");
+        assert_eq!(e.test2, 2);
+        let e = pye.extract::<E<usize, usize>>(py);
+        assert!(e.is_err());
+    });
+}
+
+#[derive(Debug, FromPyObject)]
+pub struct C {
+    #[pyo3(attribute("test"))]
+    test: String,
+}
+
+#[test]
+fn test_named_field_with_ext_fn() {
+    Python::with_gil(|py| {
+        let pyc = PyE {
+            test: "foo".into(),
+            test2: 0,
+        }
+        .into_py(py);
+        let c = pyc.extract::<C>(py).expect("Failed to extract C from PyE");
+        assert_eq!(c.test, "foo");
+    });
+}
+
+#[derive(Debug, FromPyObject)]
+pub struct Tuple(String, usize);
+
+#[test]
+fn test_tuple_struct() {
+    Python::with_gil(|py| {
+        let tup = PyTuple::new_bound(py, &[1.into_py(py), "test".into_py(py)]);
+        let tup = tup.extract::<Tuple>();
+        assert!(tup.is_err());
+        let tup = PyTuple::new_bound(py, &["test".into_py(py), 1.into_py(py)]);
+        let tup = tup
+            .extract::<Tuple>()
+            .expect("Failed to extract Tuple from PyTuple");
+        assert_eq!(tup.0, "test");
+        assert_eq!(tup.1, 1);
+    });
+}
+
+#[derive(Debug, FromPyObject)]
+pub struct TransparentTuple(String);
+
+#[test]
+fn test_transparent_tuple_struct() {
+    Python::with_gil(|py| {
+        let tup: PyObject = 1.into_py(py);
+        let tup = tup.extract::<TransparentTuple>(py);
+        assert!(tup.is_err());
+        let test: PyObject = "test".into_py(py);
+        let tup = test
+            .extract::<TransparentTuple>(py)
+            .expect("Failed to extract TransparentTuple from PyTuple");
+        assert_eq!(tup.0, "test");
+    });
+}
+
+#[pyclass]
+struct PyBaz {
+    #[pyo3(get)]
+    tup: (String, String),
+    #[pyo3(get)]
+    e: PyE,
+}
+
+#[derive(Debug, FromPyObject)]
+#[allow(dead_code)]
+struct Baz<U, T> {
+    e: E<U, T>,
+    tup: Tuple,
+}
+
+#[test]
+fn test_struct_nested_type_errors() {
+    Python::with_gil(|py| {
+        let pybaz = PyBaz {
+            tup: ("test".into(), "test".into()),
+            e: PyE {
+                test: "foo".into(),
+                test2: 0,
+            },
+        }
+        .into_py(py);
+
+        let test = pybaz.extract::<Baz<String, usize>>(py);
+        assert!(test.is_err());
+        assert_eq!(
+            extract_traceback(py,test.unwrap_err()),
+            "TypeError: failed to extract field Baz.tup: TypeError: failed to extract field Tuple.1: \
+         TypeError: \'str\' object cannot be interpreted as an integer"
+        );
+    });
+}
+
+#[test]
+fn test_struct_nested_type_errors_with_generics() {
+    Python::with_gil(|py| {
+        let pybaz = PyBaz {
+            tup: ("test".into(), "test".into()),
+            e: PyE {
+                test: "foo".into(),
+                test2: 0,
+            },
+        }
+        .into_py(py);
+
+        let test = pybaz.extract::<Baz<usize, usize>>(py);
+        assert!(test.is_err());
+        assert_eq!(
+            extract_traceback(py, test.unwrap_err()),
+            "TypeError: failed to extract field Baz.e: TypeError: failed to extract field E.test: \
+         TypeError: \'str\' object cannot be interpreted as an integer",
+        );
+    });
+}
+
+#[test]
+fn test_transparent_struct_error_message() {
+    Python::with_gil(|py| {
+        let tup: PyObject = 1.into_py(py);
+        let tup = tup.extract::<B>(py);
+        assert!(tup.is_err());
+        assert_eq!(
+            extract_traceback(py,tup.unwrap_err()),
+            "TypeError: failed to extract field B.test: TypeError: \'int\' object cannot be converted \
+         to \'PyString\'"
+        );
+    });
+}
+
+#[test]
+fn test_tuple_struct_error_message() {
+    Python::with_gil(|py| {
+        let tup: PyObject = (1, "test").into_py(py);
+        let tup = tup.extract::<Tuple>(py);
+        assert!(tup.is_err());
+        assert_eq!(
+            extract_traceback(py, tup.unwrap_err()),
+            "TypeError: failed to extract field Tuple.0: TypeError: \'int\' object cannot be \
+         converted to \'PyString\'"
+        );
+    });
+}
+
+#[test]
+fn test_transparent_tuple_error_message() {
+    Python::with_gil(|py| {
+        let tup: PyObject = 1.into_py(py);
+        let tup = tup.extract::<TransparentTuple>(py);
+        assert!(tup.is_err());
+        assert_eq!(
+            extract_traceback(py, tup.unwrap_err()),
+            "TypeError: failed to extract field TransparentTuple.0: TypeError: 'int' object \
+         cannot be converted to 'PyString'",
+        );
+    });
+}
+
+#[derive(Debug, FromPyObject)]
+pub enum Foo<'py> {
+    TupleVar(usize, String),
+    StructVar {
+        test: Bound<'py, PyString>,
+    },
+    #[pyo3(transparent)]
+    TransparentTuple(usize),
+    #[pyo3(transparent)]
+    TransparentStructVar {
+        a: Option<String>,
+    },
+    StructVarGetAttrArg {
+        #[pyo3(attribute("bla"))]
+        a: bool,
+    },
+    StructWithGetItem {
+        #[pyo3(item)]
+        a: String,
+    },
+    StructWithGetItemArg {
+        #[pyo3(item("foo"))]
+        a: String,
+    },
+}
+
+#[pyclass]
+pub struct PyBool {
+    #[pyo3(get)]
+    bla: bool,
+}
+
+#[test]
+fn test_enum() {
+    Python::with_gil(|py| {
+        let tup = PyTuple::new_bound(py, &[1.into_py(py), "test".into_py(py)]);
+        let f = tup
+            .extract::<Foo<'_>>()
+            .expect("Failed to extract Foo from tuple");
+        match f {
+            Foo::TupleVar(test, test2) => {
+                assert_eq!(test, 1);
+                assert_eq!(test2, "test");
+            }
+            _ => panic!("Expected extracting Foo::TupleVar, got {:?}", f),
+        }
+
+        let pye = PyE {
+            test: "foo".into(),
+            test2: 0,
+        }
+        .into_py(py);
+        let f = pye
+            .extract::<Foo<'_>>(py)
+            .expect("Failed to extract Foo from PyE");
+        match f {
+            Foo::StructVar { test } => assert_eq!(test.to_string_lossy(), "foo"),
+            _ => panic!("Expected extracting Foo::StructVar, got {:?}", f),
+        }
+
+        let int: PyObject = 1.into_py(py);
+        let f = int
+            .extract::<Foo<'_>>(py)
+            .expect("Failed to extract Foo from int");
+        match f {
+            Foo::TransparentTuple(test) => assert_eq!(test, 1),
+            _ => panic!("Expected extracting Foo::TransparentTuple, got {:?}", f),
+        }
+        let none = py.None();
+        let f = none
+            .extract::<Foo<'_>>(py)
+            .expect("Failed to extract Foo from int");
+        match f {
+            Foo::TransparentStructVar { a } => assert!(a.is_none()),
+            _ => panic!("Expected extracting Foo::TransparentStructVar, got {:?}", f),
+        }
+
+        let pybool = PyBool { bla: true }.into_py(py);
+        let f = pybool
+            .extract::<Foo<'_>>(py)
+            .expect("Failed to extract Foo from PyBool");
+        match f {
+            Foo::StructVarGetAttrArg { a } => assert!(a),
+            _ => panic!("Expected extracting Foo::StructVarGetAttrArg, got {:?}", f),
+        }
+
+        let dict = PyDict::new_bound(py);
+        dict.set_item("a", "test").expect("Failed to set item");
+        let f = dict
+            .extract::<Foo<'_>>()
+            .expect("Failed to extract Foo from dict");
+        match f {
+            Foo::StructWithGetItem { a } => assert_eq!(a, "test"),
+            _ => panic!("Expected extracting Foo::StructWithGetItem, got {:?}", f),
+        }
+
+        let dict = PyDict::new_bound(py);
+        dict.set_item("foo", "test").expect("Failed to set item");
+        let f = dict
+            .extract::<Foo<'_>>()
+            .expect("Failed to extract Foo from dict");
+        match f {
+            Foo::StructWithGetItemArg { a } => assert_eq!(a, "test"),
+            _ => panic!("Expected extracting Foo::StructWithGetItemArg, got {:?}", f),
+        }
+    });
+}
+
+#[test]
+fn test_enum_error() {
+    Python::with_gil(|py| {
+        let dict = PyDict::new_bound(py);
+        let err = dict.extract::<Foo<'_>>().unwrap_err();
+        assert_eq!(
+            err.to_string(),
+            "\
+TypeError: failed to extract enum Foo ('TupleVar | StructVar | TransparentTuple | TransparentStructVar | StructVarGetAttrArg | StructWithGetItem | StructWithGetItemArg')
+- variant TupleVar (TupleVar): TypeError: 'dict' object cannot be converted to 'PyTuple'
+- variant StructVar (StructVar): AttributeError: 'dict' object has no attribute 'test'
+- variant TransparentTuple (TransparentTuple): TypeError: failed to extract field Foo::TransparentTuple.0, caused by TypeError: 'dict' object cannot be interpreted as an integer
+- variant TransparentStructVar (TransparentStructVar): TypeError: failed to extract field Foo::TransparentStructVar.a, caused by TypeError: 'dict' object cannot be converted to 'PyString'
+- variant StructVarGetAttrArg (StructVarGetAttrArg): AttributeError: 'dict' object has no attribute 'bla'
+- variant StructWithGetItem (StructWithGetItem): KeyError: 'a'
+- variant StructWithGetItemArg (StructWithGetItemArg): KeyError: 'foo'"
+        );
+
+        let tup = PyTuple::empty_bound(py);
+        let err = tup.extract::<Foo<'_>>().unwrap_err();
+        assert_eq!(
+            err.to_string(),
+            "\
+TypeError: failed to extract enum Foo ('TupleVar | StructVar | TransparentTuple | TransparentStructVar | StructVarGetAttrArg | StructWithGetItem | StructWithGetItemArg')
+- variant TupleVar (TupleVar): ValueError: expected tuple of length 2, but got tuple of length 0
+- variant StructVar (StructVar): AttributeError: 'tuple' object has no attribute 'test'
+- variant TransparentTuple (TransparentTuple): TypeError: failed to extract field Foo::TransparentTuple.0, caused by TypeError: 'tuple' object cannot be interpreted as an integer
+- variant TransparentStructVar (TransparentStructVar): TypeError: failed to extract field Foo::TransparentStructVar.a, caused by TypeError: 'tuple' object cannot be converted to 'PyString'
+- variant StructVarGetAttrArg (StructVarGetAttrArg): AttributeError: 'tuple' object has no attribute 'bla'
+- variant StructWithGetItem (StructWithGetItem): TypeError: tuple indices must be integers or slices, not str
+- variant StructWithGetItemArg (StructWithGetItemArg): TypeError: tuple indices must be integers or slices, not str"
+        );
+    });
+}
+
+#[derive(Debug, FromPyObject)]
+enum EnumWithCatchAll<'py> {
+    #[allow(dead_code)]
+    #[pyo3(transparent)]
+    Foo(Foo<'py>),
+    #[pyo3(transparent)]
+    CatchAll(Bound<'py, PyAny>),
+}
+
+#[test]
+fn test_enum_catch_all() {
+    Python::with_gil(|py| {
+        let dict = PyDict::new_bound(py);
+        let f = dict
+            .extract::<EnumWithCatchAll<'_>>()
+            .expect("Failed to extract EnumWithCatchAll from dict");
+        match f {
+            EnumWithCatchAll::CatchAll(any) => {
+                let d = any.extract::<Bound<'_, PyDict>>().expect("Expected pydict");
+                assert!(d.is_empty());
+            }
+            _ => panic!(
+                "Expected extracting EnumWithCatchAll::CatchAll, got {:?}",
+                f
+            ),
+        }
+    });
+}
+
+#[derive(Debug, FromPyObject)]
+pub enum Bar {
+    #[pyo3(annotation = "str")]
+    A(String),
+    #[pyo3(annotation = "uint")]
+    B(usize),
+    #[pyo3(annotation = "int", transparent)]
+    C(isize),
+}
+
+#[test]
+fn test_err_rename() {
+    Python::with_gil(|py| {
+        let dict = PyDict::new_bound(py);
+        let f = dict.extract::<Bar>();
+        assert!(f.is_err());
+        assert_eq!(
+            f.unwrap_err().to_string(),
+            "\
+TypeError: failed to extract enum Bar ('str | uint | int')
+- variant A (str): TypeError: failed to extract field Bar::A.0, caused by TypeError: 'dict' object cannot be converted to 'PyString'
+- variant B (uint): TypeError: failed to extract field Bar::B.0, caused by TypeError: 'dict' object cannot be interpreted as an integer
+- variant C (int): TypeError: failed to extract field Bar::C.0, caused by TypeError: 'dict' object cannot be interpreted as an integer"
+        );
+    });
+}
+
+#[derive(Debug, FromPyObject)]
+pub struct Zap {
+    #[pyo3(item)]
+    name: String,
+
+    #[pyo3(from_py_with = "Bound::<'_, PyAny>::len", item("my_object"))]
+    some_object_length: usize,
+}
+
+#[test]
+fn test_from_py_with() {
+    Python::with_gil(|py| {
+        let py_zap = py
+            .eval_bound(
+                r#"{"name": "whatever", "my_object": [1, 2, 3]}"#,
+                None,
+                None,
+            )
+            .expect("failed to create dict");
+
+        let zap = py_zap.extract::<Zap>().unwrap();
+
+        assert_eq!(zap.name, "whatever");
+        assert_eq!(zap.some_object_length, 3usize);
+    });
+}
+
+#[derive(Debug, FromPyObject)]
+pub struct ZapTuple(
+    String,
+    #[pyo3(from_py_with = "Bound::<'_, PyAny>::len")] usize,
+);
+
+#[test]
+fn test_from_py_with_tuple_struct() {
+    Python::with_gil(|py| {
+        let py_zap = py
+            .eval_bound(r#"("whatever", [1, 2, 3])"#, None, None)
+            .expect("failed to create tuple");
+
+        let zap = py_zap.extract::<ZapTuple>().unwrap();
+
+        assert_eq!(zap.0, "whatever");
+        assert_eq!(zap.1, 3usize);
+    });
+}
+
+#[test]
+fn test_from_py_with_tuple_struct_error() {
+    Python::with_gil(|py| {
+        let py_zap = py
+            .eval_bound(r#"("whatever", [1, 2, 3], "third")"#, None, None)
+            .expect("failed to create tuple");
+
+        let f = py_zap.extract::<ZapTuple>();
+
+        assert!(f.is_err());
+        assert_eq!(
+            f.unwrap_err().to_string(),
+            "ValueError: expected tuple of length 2, but got tuple of length 3"
+        );
+    });
+}
+
+#[derive(Debug, FromPyObject, PartialEq, Eq)]
+pub enum ZapEnum {
+    Zip(#[pyo3(from_py_with = "Bound::<'_, PyAny>::len")] usize),
+    Zap(
+        String,
+        #[pyo3(from_py_with = "Bound::<'_, PyAny>::len")] usize,
+    ),
+}
+
+#[test]
+fn test_from_py_with_enum() {
+    Python::with_gil(|py| {
+        let py_zap = py
+            .eval_bound(r#"("whatever", [1, 2, 3])"#, None, None)
+            .expect("failed to create tuple");
+
+        let zap = py_zap.extract::<ZapEnum>().unwrap();
+        let expected_zap = ZapEnum::Zip(2);
+
+        assert_eq!(zap, expected_zap);
+    });
+}
+
+#[derive(Debug, FromPyObject, PartialEq, Eq)]
+#[pyo3(transparent)]
+pub struct TransparentFromPyWith {
+    #[pyo3(from_py_with = "Bound::<'_, PyAny>::len")]
+    len: usize,
+}
+
+#[test]
+fn test_transparent_from_py_with() {
+    Python::with_gil(|py| {
+        let result = PyList::new_bound(py, [1, 2, 3])
+            .extract::<TransparentFromPyWith>()
+            .unwrap();
+        let expected = TransparentFromPyWith { len: 3 };
+
+        assert_eq!(result, expected);
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_gc.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_gc.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_gc.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_gc.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,588 @@
+#![cfg(feature = "macros")]
+
+use pyo3::class::PyTraverseError;
+use pyo3::class::PyVisit;
+use pyo3::prelude::*;
+use pyo3::py_run;
+use std::cell::Cell;
+use std::sync::atomic::{AtomicBool, Ordering};
+use std::sync::Arc;
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyclass(freelist = 2)]
+struct ClassWithFreelist {}
+
+#[test]
+fn class_with_freelist() {
+    let ptr = Python::with_gil(|py| {
+        let inst = Py::new(py, ClassWithFreelist {}).unwrap();
+        let _inst2 = Py::new(py, ClassWithFreelist {}).unwrap();
+        let ptr = inst.as_ptr();
+        drop(inst);
+        ptr
+    });
+
+    Python::with_gil(|py| {
+        let inst3 = Py::new(py, ClassWithFreelist {}).unwrap();
+        assert_eq!(ptr, inst3.as_ptr());
+
+        let inst4 = Py::new(py, ClassWithFreelist {}).unwrap();
+        assert_ne!(ptr, inst4.as_ptr())
+    });
+}
+
+struct TestDropCall {
+    drop_called: Arc<AtomicBool>,
+}
+
+impl Drop for TestDropCall {
+    fn drop(&mut self) {
+        self.drop_called.store(true, Ordering::Relaxed);
+    }
+}
+
+#[allow(dead_code)]
+#[pyclass]
+struct DataIsDropped {
+    member1: TestDropCall,
+    member2: TestDropCall,
+}
+
+#[test]
+fn data_is_dropped() {
+    let drop_called1 = Arc::new(AtomicBool::new(false));
+    let drop_called2 = Arc::new(AtomicBool::new(false));
+
+    Python::with_gil(|py| {
+        let data_is_dropped = DataIsDropped {
+            member1: TestDropCall {
+                drop_called: Arc::clone(&drop_called1),
+            },
+            member2: TestDropCall {
+                drop_called: Arc::clone(&drop_called2),
+            },
+        };
+        let inst = Py::new(py, data_is_dropped).unwrap();
+        assert!(!drop_called1.load(Ordering::Relaxed));
+        assert!(!drop_called2.load(Ordering::Relaxed));
+        drop(inst);
+    });
+
+    assert!(drop_called1.load(Ordering::Relaxed));
+    assert!(drop_called2.load(Ordering::Relaxed));
+}
+
+#[allow(dead_code)]
+#[pyclass]
+struct GcIntegration {
+    self_ref: PyObject,
+    dropped: TestDropCall,
+}
+
+#[pymethods]
+impl GcIntegration {
+    fn __traverse__(&self, visit: PyVisit<'_>) -> Result<(), PyTraverseError> {
+        visit.call(&self.self_ref)
+    }
+
+    fn __clear__(&mut self) {
+        Python::with_gil(|py| {
+            self.self_ref = py.None();
+        });
+    }
+}
+
+#[test]
+fn gc_integration() {
+    let drop_called = Arc::new(AtomicBool::new(false));
+
+    Python::with_gil(|py| {
+        let inst = Bound::new(
+            py,
+            GcIntegration {
+                self_ref: py.None(),
+                dropped: TestDropCall {
+                    drop_called: Arc::clone(&drop_called),
+                },
+            },
+        )
+        .unwrap();
+
+        let mut borrow = inst.borrow_mut();
+        borrow.self_ref = inst.to_object(py);
+
+        py_run!(py, inst, "import gc; assert inst in gc.get_objects()");
+    });
+
+    Python::with_gil(|py| {
+        py.run_bound("import gc; gc.collect()", None, None).unwrap();
+        assert!(drop_called.load(Ordering::Relaxed));
+    });
+}
+
+#[pyclass]
+struct GcNullTraversal {
+    cycle: Option<Py<Self>>,
+    null: Option<Py<Self>>,
+}
+
+#[pymethods]
+impl GcNullTraversal {
+    fn __traverse__(&self, visit: PyVisit<'_>) -> Result<(), PyTraverseError> {
+        visit.call(&self.cycle)?;
+        visit.call(&self.null)?; // Should not segfault
+        Ok(())
+    }
+
+    fn __clear__(&mut self) {
+        self.cycle = None;
+        self.null = None;
+    }
+}
+
+#[test]
+fn gc_null_traversal() {
+    Python::with_gil(|py| {
+        let obj = Py::new(
+            py,
+            GcNullTraversal {
+                cycle: None,
+                null: None,
+            },
+        )
+        .unwrap();
+        obj.borrow_mut(py).cycle = Some(obj.clone_ref(py));
+
+        // the object doesn't have to be cleaned up, it just needs to be traversed.
+        py.run_bound("import gc; gc.collect()", None, None).unwrap();
+    });
+}
+
+#[pyclass(subclass)]
+struct BaseClassWithDrop {
+    data: Option<Arc<AtomicBool>>,
+}
+
+#[pymethods]
+impl BaseClassWithDrop {
+    #[new]
+    fn new() -> BaseClassWithDrop {
+        BaseClassWithDrop { data: None }
+    }
+}
+
+impl Drop for BaseClassWithDrop {
+    fn drop(&mut self) {
+        if let Some(data) = &self.data {
+            data.store(true, Ordering::Relaxed);
+        }
+    }
+}
+
+#[pyclass(extends = BaseClassWithDrop)]
+struct SubClassWithDrop {
+    data: Option<Arc<AtomicBool>>,
+}
+
+#[pymethods]
+impl SubClassWithDrop {
+    #[new]
+    fn new() -> (Self, BaseClassWithDrop) {
+        (
+            SubClassWithDrop { data: None },
+            BaseClassWithDrop { data: None },
+        )
+    }
+}
+
+impl Drop for SubClassWithDrop {
+    fn drop(&mut self) {
+        if let Some(data) = &self.data {
+            data.store(true, Ordering::Relaxed);
+        }
+    }
+}
+
+#[test]
+fn inheritance_with_new_methods_with_drop() {
+    let drop_called1 = Arc::new(AtomicBool::new(false));
+    let drop_called2 = Arc::new(AtomicBool::new(false));
+
+    Python::with_gil(|py| {
+        let _typebase = py.get_type_bound::<BaseClassWithDrop>();
+        let typeobj = py.get_type_bound::<SubClassWithDrop>();
+        let inst = typeobj.call((), None).unwrap();
+
+        let obj = inst.downcast::<SubClassWithDrop>().unwrap();
+        let mut obj_ref_mut = obj.borrow_mut();
+        obj_ref_mut.data = Some(Arc::clone(&drop_called1));
+        let base: &mut BaseClassWithDrop = obj_ref_mut.as_mut();
+        base.data = Some(Arc::clone(&drop_called2));
+    });
+
+    assert!(drop_called1.load(Ordering::Relaxed));
+    assert!(drop_called2.load(Ordering::Relaxed));
+}
+
+#[pyclass]
+struct TraversableClass {
+    traversed: AtomicBool,
+}
+
+impl TraversableClass {
+    fn new() -> Self {
+        Self {
+            traversed: AtomicBool::new(false),
+        }
+    }
+}
+
+#[pymethods]
+impl TraversableClass {
+    fn __clear__(&mut self) {}
+
+    #[allow(clippy::unnecessary_wraps)]
+    fn __traverse__(&self, _visit: PyVisit<'_>) -> Result<(), PyTraverseError> {
+        self.traversed.store(true, Ordering::Relaxed);
+        Ok(())
+    }
+}
+
+#[test]
+fn gc_during_borrow() {
+    Python::with_gil(|py| {
+        unsafe {
+            // get the traverse function
+            let ty = py.get_type_bound::<TraversableClass>();
+            let traverse = get_type_traverse(ty.as_type_ptr()).unwrap();
+
+            // create an object and check that traversing it works normally
+            // when it's not borrowed
+            let cell = Bound::new(py, TraversableClass::new()).unwrap();
+            let obj = cell.to_object(py);
+            assert!(!cell.borrow().traversed.load(Ordering::Relaxed));
+            traverse(obj.as_ptr(), novisit, std::ptr::null_mut());
+            assert!(cell.borrow().traversed.load(Ordering::Relaxed));
+
+            // create an object and check that it is not traversed if the GC
+            // is invoked while it is already borrowed mutably
+            let cell2 = Bound::new(py, TraversableClass::new()).unwrap();
+            let obj2 = cell2.to_object(py);
+            let guard = cell2.borrow_mut();
+            assert!(!guard.traversed.load(Ordering::Relaxed));
+            traverse(obj2.as_ptr(), novisit, std::ptr::null_mut());
+            assert!(!guard.traversed.load(Ordering::Relaxed));
+            drop(guard);
+        }
+    });
+}
+
+#[pyclass]
+struct PartialTraverse {
+    member: PyObject,
+}
+
+impl PartialTraverse {
+    fn new(py: Python<'_>) -> Self {
+        Self { member: py.None() }
+    }
+}
+
+#[pymethods]
+impl PartialTraverse {
+    fn __traverse__(&self, visit: PyVisit<'_>) -> Result<(), PyTraverseError> {
+        visit.call(&self.member)?;
+        // In the test, we expect this to never be hit
+        unreachable!()
+    }
+}
+
+#[test]
+fn traverse_partial() {
+    Python::with_gil(|py| unsafe {
+        // get the traverse function
+        let ty = py.get_type_bound::<PartialTraverse>();
+        let traverse = get_type_traverse(ty.as_type_ptr()).unwrap();
+
+        // confirm that traversing errors
+        let obj = Py::new(py, PartialTraverse::new(py)).unwrap();
+        assert_eq!(
+            traverse(obj.as_ptr(), visit_error, std::ptr::null_mut()),
+            -1
+        );
+    })
+}
+
+#[pyclass]
+struct PanickyTraverse {
+    member: PyObject,
+}
+
+impl PanickyTraverse {
+    fn new(py: Python<'_>) -> Self {
+        Self { member: py.None() }
+    }
+}
+
+#[pymethods]
+impl PanickyTraverse {
+    fn __traverse__(&self, visit: PyVisit<'_>) -> Result<(), PyTraverseError> {
+        visit.call(&self.member)?;
+        panic!("at the disco");
+    }
+}
+
+#[test]
+fn traverse_panic() {
+    Python::with_gil(|py| unsafe {
+        // get the traverse function
+        let ty = py.get_type_bound::<PanickyTraverse>();
+        let traverse = get_type_traverse(ty.as_type_ptr()).unwrap();
+
+        // confirm that traversing errors
+        let obj = Py::new(py, PanickyTraverse::new(py)).unwrap();
+        assert_eq!(traverse(obj.as_ptr(), novisit, std::ptr::null_mut()), -1);
+    })
+}
+
+#[pyclass]
+struct TriesGILInTraverse {}
+
+#[pymethods]
+impl TriesGILInTraverse {
+    fn __traverse__(&self, _visit: PyVisit<'_>) -> Result<(), PyTraverseError> {
+        Python::with_gil(|_py| Ok(()))
+    }
+}
+
+#[test]
+fn tries_gil_in_traverse() {
+    Python::with_gil(|py| unsafe {
+        // get the traverse function
+        let ty = py.get_type_bound::<TriesGILInTraverse>();
+        let traverse = get_type_traverse(ty.as_type_ptr()).unwrap();
+
+        // confirm that traversing panicks
+        let obj = Py::new(py, TriesGILInTraverse {}).unwrap();
+        assert_eq!(traverse(obj.as_ptr(), novisit, std::ptr::null_mut()), -1);
+    })
+}
+
+#[pyclass]
+struct HijackedTraverse {
+    traversed: Cell<bool>,
+    hijacked: Cell<bool>,
+}
+
+impl HijackedTraverse {
+    fn new() -> Self {
+        Self {
+            traversed: Cell::new(false),
+            hijacked: Cell::new(false),
+        }
+    }
+
+    fn traversed_and_hijacked(&self) -> (bool, bool) {
+        (self.traversed.get(), self.hijacked.get())
+    }
+}
+
+#[pymethods]
+impl HijackedTraverse {
+    #[allow(clippy::unnecessary_wraps)]
+    fn __traverse__(&self, _visit: PyVisit<'_>) -> Result<(), PyTraverseError> {
+        self.traversed.set(true);
+        Ok(())
+    }
+}
+
+#[allow(dead_code)]
+trait Traversable {
+    fn __traverse__(&self, visit: PyVisit<'_>) -> Result<(), PyTraverseError>;
+}
+
+impl<'a> Traversable for PyRef<'a, HijackedTraverse> {
+    fn __traverse__(&self, _visit: PyVisit<'_>) -> Result<(), PyTraverseError> {
+        self.hijacked.set(true);
+        Ok(())
+    }
+}
+
+#[test]
+fn traverse_cannot_be_hijacked() {
+    Python::with_gil(|py| unsafe {
+        // get the traverse function
+        let ty = py.get_type_bound::<HijackedTraverse>();
+        let traverse = get_type_traverse(ty.as_type_ptr()).unwrap();
+
+        let cell = Bound::new(py, HijackedTraverse::new()).unwrap();
+        let obj = cell.to_object(py);
+        assert_eq!(cell.borrow().traversed_and_hijacked(), (false, false));
+        traverse(obj.as_ptr(), novisit, std::ptr::null_mut());
+        assert_eq!(cell.borrow().traversed_and_hijacked(), (true, false));
+    })
+}
+
+#[allow(dead_code)]
+#[pyclass]
+struct DropDuringTraversal {
+    cycle: Cell<Option<Py<Self>>>,
+    dropped: TestDropCall,
+}
+
+#[pymethods]
+impl DropDuringTraversal {
+    #[allow(clippy::unnecessary_wraps)]
+    fn __traverse__(&self, _visit: PyVisit<'_>) -> Result<(), PyTraverseError> {
+        self.cycle.take();
+        Ok(())
+    }
+
+    fn __clear__(&mut self) {
+        self.cycle.take();
+    }
+}
+
+#[cfg(not(pyo3_disable_reference_pool))]
+#[test]
+fn drop_during_traversal_with_gil() {
+    let drop_called = Arc::new(AtomicBool::new(false));
+
+    Python::with_gil(|py| {
+        let inst = Py::new(
+            py,
+            DropDuringTraversal {
+                cycle: Cell::new(None),
+                dropped: TestDropCall {
+                    drop_called: Arc::clone(&drop_called),
+                },
+            },
+        )
+        .unwrap();
+
+        inst.borrow_mut(py).cycle.set(Some(inst.clone_ref(py)));
+
+        drop(inst);
+    });
+
+    // due to the internal GC mechanism, we may need multiple
+    // (but not too many) collections to get `inst` actually dropped.
+    for _ in 0..10 {
+        Python::with_gil(|py| {
+            py.run_bound("import gc; gc.collect()", None, None).unwrap();
+        });
+    }
+    assert!(drop_called.load(Ordering::Relaxed));
+}
+
+#[cfg(not(pyo3_disable_reference_pool))]
+#[test]
+fn drop_during_traversal_without_gil() {
+    let drop_called = Arc::new(AtomicBool::new(false));
+
+    let inst = Python::with_gil(|py| {
+        let inst = Py::new(
+            py,
+            DropDuringTraversal {
+                cycle: Cell::new(None),
+                dropped: TestDropCall {
+                    drop_called: Arc::clone(&drop_called),
+                },
+            },
+        )
+        .unwrap();
+
+        inst.borrow_mut(py).cycle.set(Some(inst.clone_ref(py)));
+
+        inst
+    });
+
+    drop(inst);
+
+    // due to the internal GC mechanism, we may need multiple
+    // (but not too many) collections to get `inst` actually dropped.
+    for _ in 0..10 {
+        Python::with_gil(|py| {
+            py.run_bound("import gc; gc.collect()", None, None).unwrap();
+        });
+    }
+    assert!(drop_called.load(Ordering::Relaxed));
+}
+
+#[pyclass(unsendable)]
+struct UnsendableTraversal {
+    traversed: Cell<bool>,
+}
+
+#[pymethods]
+impl UnsendableTraversal {
+    fn __clear__(&mut self) {}
+
+    #[allow(clippy::unnecessary_wraps)]
+    fn __traverse__(&self, _visit: PyVisit<'_>) -> Result<(), PyTraverseError> {
+        self.traversed.set(true);
+        Ok(())
+    }
+}
+
+#[test]
+#[cfg(not(target_arch = "wasm32"))] // We are building wasm Python with pthreads disabled
+fn unsendable_are_not_traversed_on_foreign_thread() {
+    #[derive(Clone, Copy)]
+    struct SendablePtr(*mut pyo3::ffi::PyObject);
+
+    unsafe impl Send for SendablePtr {}
+
+    Python::with_gil(|py| unsafe {
+        let ty = py.get_type_bound::<UnsendableTraversal>();
+        let traverse = get_type_traverse(ty.as_type_ptr()).unwrap();
+
+        let obj = Py::new(
+            py,
+            UnsendableTraversal {
+                traversed: Cell::new(false),
+            },
+        )
+        .unwrap();
+
+        let ptr = SendablePtr(obj.as_ptr());
+
+        std::thread::spawn(move || {
+            // traversal on foreign thread is a no-op
+            assert_eq!(traverse({ ptr }.0, novisit, std::ptr::null_mut()), 0);
+        })
+        .join()
+        .unwrap();
+
+        assert!(!obj.borrow(py).traversed.get());
+
+        // traversal on home thread still works
+        assert_eq!(traverse({ ptr }.0, novisit, std::ptr::null_mut()), 0);
+
+        assert!(obj.borrow(py).traversed.get());
+    });
+}
+
+// Manual traversal utilities
+
+unsafe fn get_type_traverse(tp: *mut pyo3::ffi::PyTypeObject) -> Option<pyo3::ffi::traverseproc> {
+    std::mem::transmute(pyo3::ffi::PyType_GetSlot(tp, pyo3::ffi::Py_tp_traverse))
+}
+
+// a dummy visitor function
+extern "C" fn novisit(
+    _object: *mut pyo3::ffi::PyObject,
+    _arg: *mut core::ffi::c_void,
+) -> std::os::raw::c_int {
+    0
+}
+
+// a visitor function which errors (returns nonzero code)
+extern "C" fn visit_error(
+    _object: *mut pyo3::ffi::PyObject,
+    _arg: *mut core::ffi::c_void,
+) -> std::os::raw::c_int {
+    -1
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_getter_setter.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_getter_setter.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_getter_setter.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_getter_setter.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,318 @@
+#![cfg(feature = "macros")]
+
+use std::cell::Cell;
+
+use pyo3::prelude::*;
+use pyo3::py_run;
+use pyo3::types::{IntoPyDict, PyList};
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyclass]
+struct ClassWithProperties {
+    num: i32,
+}
+
+#[pymethods]
+impl ClassWithProperties {
+    fn get_num(&self) -> i32 {
+        self.num
+    }
+
+    #[getter(DATA)]
+    /// a getter for data
+    fn get_data(&self) -> i32 {
+        self.num
+    }
+    #[setter(DATA)]
+    fn set_data(&mut self, value: i32) {
+        self.num = value;
+    }
+
+    #[getter]
+    /// a getter with a type un-wrapped by PyResult
+    fn get_unwrapped(&self) -> i32 {
+        self.num
+    }
+
+    #[setter]
+    fn set_unwrapped(&mut self, value: i32) {
+        self.num = value;
+    }
+
+    #[setter]
+    fn set_from_len(&mut self, #[pyo3(from_py_with = "extract_len")] value: i32) {
+        self.num = value;
+    }
+
+    #[setter]
+    fn set_from_any(&mut self, value: &Bound<'_, PyAny>) -> PyResult<()> {
+        self.num = value.extract()?;
+        Ok(())
+    }
+
+    #[getter]
+    fn get_data_list<'py>(&self, py: Python<'py>) -> Bound<'py, PyList> {
+        PyList::new_bound(py, [self.num])
+    }
+}
+
+fn extract_len(any: &Bound<'_, PyAny>) -> PyResult<i32> {
+    any.len().map(|len| len as i32)
+}
+
+#[test]
+fn class_with_properties() {
+    Python::with_gil(|py| {
+        let inst = Py::new(py, ClassWithProperties { num: 10 }).unwrap();
+
+        py_run!(py, inst, "assert inst.get_num() == 10");
+        py_run!(py, inst, "assert inst.get_num() == inst.DATA");
+        py_run!(py, inst, "inst.DATA = 20");
+        py_run!(py, inst, "assert inst.get_num() == 20 == inst.DATA");
+
+        py_expect_exception!(py, inst, "del inst.DATA", PyAttributeError);
+
+        py_run!(py, inst, "assert inst.get_num() == inst.unwrapped == 20");
+        py_run!(py, inst, "inst.unwrapped = 42");
+        py_run!(py, inst, "assert inst.get_num() == inst.unwrapped == 42");
+        py_run!(py, inst, "assert inst.data_list == [42]");
+
+        py_run!(py, inst, "inst.from_len = [0, 0, 0]");
+        py_run!(py, inst, "assert inst.get_num() == 3");
+
+        py_run!(py, inst, "inst.from_any = 15");
+        py_run!(py, inst, "assert inst.get_num() == 15");
+
+        let d = [("C", py.get_type_bound::<ClassWithProperties>())].into_py_dict_bound(py);
+        py_assert!(py, *d, "C.DATA.__doc__ == 'a getter for data'");
+    });
+}
+
+#[pyclass]
+struct GetterSetter {
+    #[pyo3(get, set)]
+    num: i32,
+    #[pyo3(get, set)]
+    text: String,
+}
+
+#[pymethods]
+impl GetterSetter {
+    fn get_num2(&self) -> i32 {
+        self.num
+    }
+}
+
+#[test]
+fn getter_setter_autogen() {
+    Python::with_gil(|py| {
+        let inst = Py::new(
+            py,
+            GetterSetter {
+                num: 10,
+                text: "Hello".to_string(),
+            },
+        )
+        .unwrap();
+
+        py_run!(py, inst, "assert inst.num == 10");
+        py_run!(py, inst, "inst.num = 20; assert inst.num == 20");
+        py_run!(
+            py,
+            inst,
+            "assert inst.text == 'Hello'; inst.text = 'There'; assert inst.text == 'There'"
+        );
+    });
+}
+
+#[pyclass]
+struct RefGetterSetter {
+    num: i32,
+}
+
+#[pymethods]
+impl RefGetterSetter {
+    #[getter]
+    fn get_num(slf: PyRef<'_, Self>) -> i32 {
+        slf.num
+    }
+
+    #[setter]
+    fn set_num(mut slf: PyRefMut<'_, Self>, value: i32) {
+        slf.num = value;
+    }
+}
+
+#[test]
+fn ref_getter_setter() {
+    // Regression test for #837
+    Python::with_gil(|py| {
+        let inst = Py::new(py, RefGetterSetter { num: 10 }).unwrap();
+
+        py_run!(py, inst, "assert inst.num == 10");
+        py_run!(py, inst, "inst.num = 20; assert inst.num == 20");
+    });
+}
+
+#[pyclass]
+struct TupleClassGetterSetter(i32);
+
+#[pymethods]
+impl TupleClassGetterSetter {
+    #[getter(num)]
+    fn get_num(&self) -> i32 {
+        self.0
+    }
+
+    #[setter(num)]
+    fn set_num(&mut self, value: i32) {
+        self.0 = value;
+    }
+}
+
+#[test]
+fn tuple_struct_getter_setter() {
+    Python::with_gil(|py| {
+        let inst = Py::new(py, TupleClassGetterSetter(10)).unwrap();
+
+        py_assert!(py, inst, "inst.num == 10");
+        py_run!(py, inst, "inst.num = 20");
+        py_assert!(py, inst, "inst.num == 20");
+    });
+}
+
+#[pyclass(get_all, set_all)]
+struct All {
+    num: i32,
+}
+
+#[test]
+fn get_set_all() {
+    Python::with_gil(|py| {
+        let inst = Py::new(py, All { num: 10 }).unwrap();
+
+        py_run!(py, inst, "assert inst.num == 10");
+        py_run!(py, inst, "inst.num = 20; assert inst.num == 20");
+    });
+}
+
+#[pyclass(get_all)]
+struct All2 {
+    #[pyo3(set)]
+    num: i32,
+}
+
+#[test]
+fn get_all_and_set() {
+    Python::with_gil(|py| {
+        let inst = Py::new(py, All2 { num: 10 }).unwrap();
+
+        py_run!(py, inst, "assert inst.num == 10");
+        py_run!(py, inst, "inst.num = 20; assert inst.num == 20");
+    });
+}
+
+#[pyclass]
+struct CellGetterSetter {
+    #[pyo3(get, set)]
+    cell_inner: Cell<i32>,
+}
+
+#[test]
+fn cell_getter_setter() {
+    let c = CellGetterSetter {
+        cell_inner: Cell::new(10),
+    };
+    Python::with_gil(|py| {
+        let inst = Py::new(py, c).unwrap().to_object(py);
+        let cell = Cell::new(20).to_object(py);
+
+        py_run!(py, cell, "assert cell == 20");
+        py_run!(py, inst, "assert inst.cell_inner == 10");
+        py_run!(
+            py,
+            inst,
+            "inst.cell_inner = 20; assert inst.cell_inner == 20"
+        );
+    });
+}
+
+#[test]
+fn borrowed_value_with_lifetime_of_self() {
+    #[pyclass]
+    struct BorrowedValue {}
+
+    #[pymethods]
+    impl BorrowedValue {
+        #[getter]
+        fn value(&self) -> &str {
+            "value"
+        }
+    }
+
+    Python::with_gil(|py| {
+        let inst = Py::new(py, BorrowedValue {}).unwrap().to_object(py);
+
+        py_run!(py, inst, "assert inst.value == 'value'");
+    });
+}
+
+#[test]
+fn frozen_py_field_get() {
+    #[pyclass(frozen)]
+    struct FrozenPyField {
+        #[pyo3(get)]
+        value: Py<PyAny>,
+    }
+
+    Python::with_gil(|py| {
+        let inst = Py::new(
+            py,
+            FrozenPyField {
+                value: "value".into_py(py),
+            },
+        )
+        .unwrap()
+        .to_object(py);
+
+        py_run!(py, inst, "assert inst.value == 'value'");
+    });
+}
+
+#[test]
+fn test_optional_setter() {
+    #[pyclass]
+    struct SimpleClass {
+        field: Option<u32>,
+    }
+
+    #[pymethods]
+    impl SimpleClass {
+        #[getter]
+        fn get_field(&self) -> Option<u32> {
+            self.field
+        }
+
+        #[setter]
+        fn set_field(&mut self, field: Option<u32>) {
+            self.field = field;
+        }
+    }
+
+    Python::with_gil(|py| {
+        let instance = Py::new(py, SimpleClass { field: None }).unwrap();
+        py_run!(py, instance, "assert instance.field is None");
+        py_run!(
+            py,
+            instance,
+            "instance.field = 42; assert instance.field == 42"
+        );
+        py_run!(
+            py,
+            instance,
+            "instance.field = None; assert instance.field is None"
+        );
+    })
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_inheritance.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_inheritance.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_inheritance.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_inheritance.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,369 @@
+#![cfg(feature = "macros")]
+
+use pyo3::prelude::*;
+use pyo3::py_run;
+
+use pyo3::types::IntoPyDict;
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyclass(subclass)]
+struct BaseClass {
+    #[pyo3(get)]
+    val1: usize,
+}
+
+#[pyclass(subclass)]
+struct SubclassAble {}
+
+#[test]
+fn subclass() {
+    Python::with_gil(|py| {
+        let d = [("SubclassAble", py.get_type_bound::<SubclassAble>())].into_py_dict_bound(py);
+
+        py.run_bound(
+            "class A(SubclassAble): pass\nassert issubclass(A, SubclassAble)",
+            None,
+            Some(&d),
+        )
+        .map_err(|e| e.display(py))
+        .unwrap();
+    });
+}
+
+#[pymethods]
+impl BaseClass {
+    #[new]
+    fn new() -> Self {
+        BaseClass { val1: 10 }
+    }
+    fn base_method(&self, x: usize) -> usize {
+        x * self.val1
+    }
+    fn base_set(&mut self, fn_: &Bound<'_, PyAny>) -> PyResult<()> {
+        let value: usize = fn_.call0()?.extract()?;
+        self.val1 = value;
+        Ok(())
+    }
+}
+
+#[pyclass(extends=BaseClass)]
+struct SubClass {
+    #[pyo3(get)]
+    val2: usize,
+}
+
+#[pymethods]
+impl SubClass {
+    #[new]
+    fn new() -> (Self, BaseClass) {
+        (SubClass { val2: 5 }, BaseClass { val1: 10 })
+    }
+    fn sub_method(&self, x: usize) -> usize {
+        x * self.val2
+    }
+    fn sub_set_and_ret(&mut self, x: usize) -> usize {
+        self.val2 = x;
+        x
+    }
+}
+
+#[test]
+fn inheritance_with_new_methods() {
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<SubClass>();
+        let inst = typeobj.call((), None).unwrap();
+        py_run!(py, inst, "assert inst.val1 == 10; assert inst.val2 == 5");
+    });
+}
+
+#[test]
+fn call_base_and_sub_methods() {
+    Python::with_gil(|py| {
+        let obj = Py::new(py, SubClass::new()).unwrap();
+        py_run!(
+            py,
+            obj,
+            r#"
+    assert obj.base_method(10) == 100
+    assert obj.sub_method(10) == 50
+"#
+        );
+    });
+}
+
+#[test]
+fn mutation_fails() {
+    Python::with_gil(|py| {
+        let obj = Py::new(py, SubClass::new()).unwrap();
+        let global = [("obj", obj)].into_py_dict_bound(py);
+        let e = py
+            .run_bound(
+                "obj.base_set(lambda: obj.sub_set_and_ret(1))",
+                Some(&global),
+                None,
+            )
+            .unwrap_err();
+        assert_eq!(&e.to_string(), "RuntimeError: Already borrowed");
+    });
+}
+
+#[test]
+fn is_subclass_and_is_instance() {
+    Python::with_gil(|py| {
+        let sub_ty = py.get_type_bound::<SubClass>();
+        let base_ty = py.get_type_bound::<BaseClass>();
+        assert!(sub_ty.is_subclass_of::<BaseClass>().unwrap());
+        assert!(sub_ty.is_subclass(&base_ty).unwrap());
+
+        let obj = Bound::new(py, SubClass::new()).unwrap().into_any();
+        assert!(obj.is_instance_of::<SubClass>());
+        assert!(obj.is_instance_of::<BaseClass>());
+        assert!(obj.is_instance(&sub_ty).unwrap());
+        assert!(obj.is_instance(&base_ty).unwrap());
+    });
+}
+
+#[pyclass(subclass)]
+struct BaseClassWithResult {
+    _val: usize,
+}
+
+#[pymethods]
+impl BaseClassWithResult {
+    #[new]
+    fn new(value: isize) -> PyResult<Self> {
+        Ok(Self {
+            _val: std::convert::TryFrom::try_from(value)?,
+        })
+    }
+}
+
+#[pyclass(extends=BaseClassWithResult)]
+struct SubClass2 {}
+
+#[pymethods]
+impl SubClass2 {
+    #[new]
+    fn new(value: isize) -> PyResult<(Self, BaseClassWithResult)> {
+        let base = BaseClassWithResult::new(value)?;
+        Ok((Self {}, base))
+    }
+}
+
+#[test]
+fn handle_result_in_new() {
+    Python::with_gil(|py| {
+        let subclass = py.get_type_bound::<SubClass2>();
+        py_run!(
+            py,
+            subclass,
+            r#"
+try:
+    subclass(-10)
+    assert Fals
+except ValueError as e:
+    pass
+except Exception as e:
+    raise e
+"#
+        );
+    });
+}
+
+// Subclassing builtin types is not allowed in the LIMITED API.
+#[cfg(not(Py_LIMITED_API))]
+mod inheriting_native_type {
+    use super::*;
+    use pyo3::exceptions::PyException;
+    use pyo3::types::PyDict;
+
+    #[cfg(not(PyPy))]
+    #[test]
+    fn inherit_set() {
+        use pyo3::types::PySet;
+
+        #[cfg(not(PyPy))]
+        #[pyclass(extends=PySet)]
+        #[derive(Debug)]
+        struct SetWithName {
+            #[pyo3(get, name = "name")]
+            _name: &'static str,
+        }
+
+        #[cfg(not(PyPy))]
+        #[pymethods]
+        impl SetWithName {
+            #[new]
+            fn new() -> Self {
+                SetWithName { _name: "Hello :)" }
+            }
+        }
+
+        Python::with_gil(|py| {
+            let set_sub = pyo3::Py::new(py, SetWithName::new()).unwrap();
+            py_run!(
+                py,
+                set_sub,
+                r#"set_sub.add(10); assert list(set_sub) == [10]; assert set_sub.name == "Hello :)""#
+            );
+        });
+    }
+
+    #[pyclass(extends=PyDict)]
+    #[derive(Debug)]
+    struct DictWithName {
+        #[pyo3(get, name = "name")]
+        _name: &'static str,
+    }
+
+    #[pymethods]
+    impl DictWithName {
+        #[new]
+        fn new() -> Self {
+            DictWithName { _name: "Hello :)" }
+        }
+    }
+
+    #[test]
+    fn inherit_dict() {
+        Python::with_gil(|py| {
+            let dict_sub = pyo3::Py::new(py, DictWithName::new()).unwrap();
+            py_run!(
+                py,
+                dict_sub,
+                r#"dict_sub[0] = 1; assert dict_sub[0] == 1; assert dict_sub.name == "Hello :)""#
+            );
+        });
+    }
+
+    #[test]
+    fn inherit_dict_drop() {
+        Python::with_gil(|py| {
+            let dict_sub = pyo3::Py::new(py, DictWithName::new()).unwrap();
+            assert_eq!(dict_sub.get_refcnt(py), 1);
+
+            let item = &py.eval_bound("object()", None, None).unwrap();
+            assert_eq!(item.get_refcnt(), 1);
+
+            dict_sub.bind(py).set_item("foo", item).unwrap();
+            assert_eq!(item.get_refcnt(), 2);
+
+            drop(dict_sub);
+            assert_eq!(item.get_refcnt(), 1);
+        })
+    }
+
+    #[pyclass(extends=PyException)]
+    struct CustomException {
+        #[pyo3(get)]
+        context: &'static str,
+    }
+
+    #[pymethods]
+    impl CustomException {
+        #[new]
+        fn new(_exc_arg: &Bound<'_, PyAny>) -> Self {
+            CustomException {
+                context: "Hello :)",
+            }
+        }
+    }
+
+    #[test]
+    fn custom_exception() {
+        Python::with_gil(|py| {
+            let cls = py.get_type_bound::<CustomException>();
+            let dict = [("cls", &cls)].into_py_dict_bound(py);
+            let res = py.run_bound(
+            "e = cls('hello'); assert str(e) == 'hello'; assert e.context == 'Hello :)'; raise e",
+            None,
+            Some(&dict)
+            );
+            let err = res.unwrap_err();
+            assert!(err.matches(py, &cls), "{}", err);
+
+            // catching the exception in Python also works:
+            py_run!(
+                py,
+                cls,
+                r#"
+                    try:
+                        raise cls("foo")
+                    except cls:
+                        pass
+                "#
+            )
+        })
+    }
+}
+
+#[pyclass(subclass)]
+struct SimpleClass {}
+
+#[pymethods]
+impl SimpleClass {
+    #[new]
+    fn new() -> Self {
+        Self {}
+    }
+}
+
+#[test]
+fn test_subclass_ref_counts() {
+    // regression test for issue #1363
+    Python::with_gil(|py| {
+        #[allow(non_snake_case)]
+        let SimpleClass = py.get_type_bound::<SimpleClass>();
+        py_run!(
+            py,
+            SimpleClass,
+            r#"
+            import gc
+            import sys
+
+            class SubClass(SimpleClass):
+                pass
+
+            gc.collect()
+            count = sys.getrefcount(SubClass)
+
+            for i in range(1000):
+                c = SubClass()
+                del c
+
+            gc.collect()
+            after = sys.getrefcount(SubClass)
+            # depending on Python's GC the count may be either identical or exactly 1000 higher,
+            # both are expected values that are not representative of the issue.
+            #
+            # (With issue #1363 the count will be decreased.)
+            assert after == count or (after == count + 1000), f"{after} vs {count}"
+            "#
+        );
+    })
+}
+
+#[test]
+#[cfg(not(Py_LIMITED_API))]
+fn module_add_class_inherit_bool_fails() {
+    use pyo3::types::PyBool;
+
+    #[pyclass(extends = PyBool)]
+    struct ExtendsBool;
+
+    Python::with_gil(|py| {
+        let m = PyModule::new_bound(py, "test_module").unwrap();
+
+        let err = m.add_class::<ExtendsBool>().unwrap_err();
+        assert_eq!(
+            err.to_string(),
+            "RuntimeError: An error occurred while initializing class ExtendsBool"
+        );
+        assert_eq!(
+            err.cause(py).unwrap().to_string(),
+            "TypeError: type 'bool' is not an acceptable base type"
+        );
+    })
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_macro_docs.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_macro_docs.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_macro_docs.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_macro_docs.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,38 @@
+#![cfg(feature = "macros")]
+
+use pyo3::prelude::*;
+use pyo3::types::IntoPyDict;
+
+#[macro_use]
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyclass]
+/// The MacroDocs class.
+#[doc = concat!("Some macro ", "class ", "docs.")]
+/// A very interesting type!
+struct MacroDocs {}
+
+#[pymethods]
+impl MacroDocs {
+    #[doc = concat!("A macro ", "example.")]
+    /// With mixed doc types.
+    fn macro_doc(&self) {}
+}
+
+#[test]
+fn meth_doc() {
+    Python::with_gil(|py| {
+        let d = [("C", py.get_type_bound::<MacroDocs>())].into_py_dict_bound(py);
+        py_assert!(
+            py,
+            *d,
+            "C.__doc__ == 'The MacroDocs class.\\nSome macro class docs.\\nA very interesting type!'"
+        );
+        py_assert!(
+            py,
+            *d,
+            "C.macro_doc.__doc__ == 'A macro example.\\nWith mixed doc types.'"
+        );
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_macros.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_macros.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_macros.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_macros.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,93 @@
+#![cfg(feature = "macros")]
+
+//! Ensure that pyo3 macros can be used inside macro_rules!
+
+use pyo3::prelude::*;
+
+#[macro_use]
+#[path = "../src/tests/common.rs"]
+mod common;
+
+macro_rules! make_struct_using_macro {
+    // Ensure that one doesn't need to fall back on the escape type: tt
+    // in order to macro create pyclass.
+    ($class_name:ident, $py_name:literal) => {
+        #[pyclass(name=$py_name)]
+        struct $class_name {}
+    };
+}
+
+make_struct_using_macro!(MyBaseClass, "MyClass");
+
+macro_rules! set_extends_via_macro {
+    ($class_name:ident, $base_class:path) => {
+        // Try and pass a variable into the extends parameter
+        #[pyclass(extends=$base_class)]
+        struct $class_name {}
+    };
+}
+
+set_extends_via_macro!(MyClass2, MyBaseClass);
+
+//
+// Check that pyfunctiona nd text_signature can be called with macro arguments.
+//
+
+macro_rules! fn_macro {
+    ($sig:literal, $a_exp:expr, $b_exp:expr, $c_exp: expr) => {
+        // Try and pass a variable into the signature parameter
+        #[pyfunction(signature = ($a_exp, $b_exp, *, $c_exp))]
+        #[pyo3(text_signature = $sig)]
+        fn my_function_in_macro(a: i32, b: Option<i32>, c: i32) {
+            let _ = (a, b, c);
+        }
+    };
+}
+
+fn_macro!("(a, b=None, *, c=42)", a, b = None, c = 42);
+
+macro_rules! property_rename_via_macro {
+    ($prop_name:ident) => {
+        #[pyclass]
+        struct ClassWithProperty {
+            member: u64,
+        }
+
+        #[pymethods]
+        impl ClassWithProperty {
+            #[getter($prop_name)]
+            fn get_member(&self) -> u64 {
+                self.member
+            }
+
+            #[setter($prop_name)]
+            fn set_member(&mut self, member: u64) {
+                self.member = member;
+            }
+        }
+    };
+}
+
+property_rename_via_macro!(my_new_property_name);
+
+#[test]
+fn test_macro_rules_interactions() {
+    Python::with_gil(|py| {
+        let my_base = py.get_type_bound::<MyBaseClass>();
+        py_assert!(py, my_base, "my_base.__name__ == 'MyClass'");
+
+        let my_func = wrap_pyfunction_bound!(my_function_in_macro, py).unwrap();
+        py_assert!(
+            py,
+            my_func,
+            "my_func.__text_signature__ == '(a, b=None, *, c=42)'"
+        );
+
+        let renamed_prop = py.get_type_bound::<ClassWithProperty>();
+        py_assert!(
+            py,
+            renamed_prop,
+            "hasattr(renamed_prop, 'my_new_property_name')"
+        );
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_mapping.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_mapping.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_mapping.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_mapping.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,131 @@
+#![cfg(feature = "macros")]
+
+use std::collections::HashMap;
+
+use pyo3::exceptions::PyKeyError;
+use pyo3::prelude::*;
+use pyo3::py_run;
+use pyo3::types::IntoPyDict;
+use pyo3::types::PyList;
+use pyo3::types::PyMapping;
+use pyo3::types::PySequence;
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyclass(mapping)]
+struct Mapping {
+    index: HashMap<String, usize>,
+}
+
+#[pymethods]
+impl Mapping {
+    #[new]
+    #[pyo3(signature=(elements=None))]
+    fn new(elements: Option<&Bound<'_, PyList>>) -> PyResult<Self> {
+        if let Some(pylist) = elements {
+            let mut elems = HashMap::with_capacity(pylist.len());
+            for (i, pyelem) in pylist.into_iter().enumerate() {
+                let elem = pyelem.extract()?;
+                elems.insert(elem, i);
+            }
+            Ok(Self { index: elems })
+        } else {
+            Ok(Self {
+                index: HashMap::new(),
+            })
+        }
+    }
+
+    fn __len__(&self) -> usize {
+        self.index.len()
+    }
+
+    fn __getitem__(&self, query: String) -> PyResult<usize> {
+        self.index
+            .get(&query)
+            .copied()
+            .ok_or_else(|| PyKeyError::new_err("unknown key"))
+    }
+
+    fn __setitem__(&mut self, key: String, value: usize) {
+        self.index.insert(key, value);
+    }
+
+    fn __delitem__(&mut self, key: String) -> PyResult<()> {
+        if self.index.remove(&key).is_none() {
+            Err(PyKeyError::new_err("unknown key"))
+        } else {
+            Ok(())
+        }
+    }
+
+    #[pyo3(signature=(key, default=None))]
+    fn get(&self, py: Python<'_>, key: &str, default: Option<PyObject>) -> Option<PyObject> {
+        self.index
+            .get(key)
+            .map(|value| value.into_py(py))
+            .or(default)
+    }
+}
+
+/// Return a dict with `m = Mapping(['1', '2', '3'])`.
+fn map_dict(py: Python<'_>) -> Bound<'_, pyo3::types::PyDict> {
+    let d = [("Mapping", py.get_type_bound::<Mapping>())].into_py_dict_bound(py);
+    py_run!(py, *d, "m = Mapping(['1', '2', '3'])");
+    d
+}
+
+#[test]
+fn test_getitem() {
+    Python::with_gil(|py| {
+        let d = map_dict(py);
+
+        py_assert!(py, *d, "m['1'] == 0");
+        py_assert!(py, *d, "m['2'] == 1");
+        py_assert!(py, *d, "m['3'] == 2");
+        py_expect_exception!(py, *d, "print(m['4'])", PyKeyError);
+    });
+}
+
+#[test]
+fn test_setitem() {
+    Python::with_gil(|py| {
+        let d = map_dict(py);
+
+        py_run!(py, *d, "m['1'] = 4; assert m['1'] == 4");
+        py_run!(py, *d, "m['0'] = 0; assert m['0'] == 0");
+        py_assert!(py, *d, "len(m) == 4");
+        py_expect_exception!(py, *d, "m[0] = 'hello'", PyTypeError);
+        py_expect_exception!(py, *d, "m[0] = -1", PyTypeError);
+    });
+}
+
+#[test]
+fn test_delitem() {
+    Python::with_gil(|py| {
+        let d = map_dict(py);
+        py_run!(
+            py,
+            *d,
+            "del m['1']; assert len(m) == 2 and m['2'] == 1 and m['3'] == 2"
+        );
+        py_expect_exception!(py, *d, "del m[-1]", PyTypeError);
+        py_expect_exception!(py, *d, "del m['4']", PyKeyError);
+    });
+}
+
+#[test]
+fn mapping_is_not_sequence() {
+    Python::with_gil(|py| {
+        let mut index = HashMap::new();
+        index.insert("Foo".into(), 1);
+        index.insert("Bar".into(), 2);
+        let m = Py::new(py, Mapping { index }).unwrap();
+
+        PyMapping::register::<Mapping>(py).unwrap();
+
+        assert!(m.bind(py).downcast::<PyMapping>().is_ok());
+        assert!(m.bind(py).downcast::<PySequence>().is_err());
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_methods.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_methods.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_methods.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_methods.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1163 @@
+#![cfg(feature = "macros")]
+
+use pyo3::prelude::*;
+use pyo3::py_run;
+use pyo3::types::PySequence;
+use pyo3::types::{IntoPyDict, PyDict, PyList, PySet, PyString, PyTuple, PyType};
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyclass]
+struct InstanceMethod {
+    member: i32,
+}
+
+#[pymethods]
+impl InstanceMethod {
+    /// Test method
+    fn method(&self) -> i32 {
+        self.member
+    }
+
+    // Checks that &Self works
+    fn add_other(&self, other: &Self) -> i32 {
+        self.member + other.member
+    }
+}
+
+#[test]
+fn instance_method() {
+    Python::with_gil(|py| {
+        let obj = Bound::new(py, InstanceMethod { member: 42 }).unwrap();
+        let obj_ref = obj.borrow();
+        assert_eq!(obj_ref.method(), 42);
+        py_assert!(py, obj, "obj.method() == 42");
+        py_assert!(py, obj, "obj.add_other(obj) == 84");
+        py_assert!(py, obj, "obj.method.__doc__ == 'Test method'");
+    });
+}
+
+#[pyclass]
+struct InstanceMethodWithArgs {
+    member: i32,
+}
+
+#[pymethods]
+impl InstanceMethodWithArgs {
+    fn method(&self, multiplier: i32) -> i32 {
+        self.member * multiplier
+    }
+}
+
+#[test]
+fn instance_method_with_args() {
+    Python::with_gil(|py| {
+        let obj = Bound::new(py, InstanceMethodWithArgs { member: 7 }).unwrap();
+        let obj_ref = obj.borrow();
+        assert_eq!(obj_ref.method(6), 42);
+        py_assert!(py, obj, "obj.method(3) == 21");
+        py_assert!(py, obj, "obj.method(multiplier=6) == 42");
+    });
+}
+
+#[pyclass]
+struct ClassMethod {}
+
+#[pymethods]
+impl ClassMethod {
+    #[new]
+    fn new() -> Self {
+        ClassMethod {}
+    }
+
+    #[classmethod]
+    /// Test class method.
+    fn method(cls: &Bound<'_, PyType>) -> PyResult<String> {
+        Ok(format!("{}.method()!", cls.qualname()?))
+    }
+
+    #[classmethod]
+    fn method_owned(cls: Py<PyType>, py: Python<'_>) -> PyResult<String> {
+        Ok(format!("{}.method_owned()!", cls.bind(py).qualname()?))
+    }
+}
+
+#[test]
+fn class_method() {
+    Python::with_gil(|py| {
+        let d = [("C", py.get_type_bound::<ClassMethod>())].into_py_dict_bound(py);
+        py_assert!(py, *d, "C.method() == 'ClassMethod.method()!'");
+        py_assert!(py, *d, "C().method() == 'ClassMethod.method()!'");
+        py_assert!(
+            py,
+            *d,
+            "C().method_owned() == 'ClassMethod.method_owned()!'"
+        );
+        py_assert!(py, *d, "C.method.__doc__ == 'Test class method.'");
+        py_assert!(py, *d, "C().method.__doc__ == 'Test class method.'");
+    });
+}
+
+#[pyclass]
+struct ClassMethodWithArgs {}
+
+#[pymethods]
+impl ClassMethodWithArgs {
+    #[classmethod]
+    fn method(cls: &Bound<'_, PyType>, input: &Bound<'_, PyString>) -> PyResult<String> {
+        Ok(format!("{}.method({})", cls.qualname()?, input))
+    }
+}
+
+#[test]
+fn class_method_with_args() {
+    Python::with_gil(|py| {
+        let d = [("C", py.get_type_bound::<ClassMethodWithArgs>())].into_py_dict_bound(py);
+        py_assert!(
+            py,
+            *d,
+            "C.method('abc') == 'ClassMethodWithArgs.method(abc)'"
+        );
+    });
+}
+
+#[pyclass]
+struct StaticMethod {}
+
+#[pymethods]
+impl StaticMethod {
+    #[new]
+    fn new() -> Self {
+        StaticMethod {}
+    }
+
+    #[staticmethod]
+    /// Test static method.
+    fn method(_py: Python<'_>) -> &'static str {
+        "StaticMethod.method()!"
+    }
+}
+
+#[test]
+fn static_method() {
+    Python::with_gil(|py| {
+        assert_eq!(StaticMethod::method(py), "StaticMethod.method()!");
+
+        let d = [("C", py.get_type_bound::<StaticMethod>())].into_py_dict_bound(py);
+        py_assert!(py, *d, "C.method() == 'StaticMethod.method()!'");
+        py_assert!(py, *d, "C().method() == 'StaticMethod.method()!'");
+        py_assert!(py, *d, "C.method.__doc__ == 'Test static method.'");
+        py_assert!(py, *d, "C().method.__doc__ == 'Test static method.'");
+    });
+}
+
+#[pyclass]
+struct StaticMethodWithArgs {}
+
+#[pymethods]
+impl StaticMethodWithArgs {
+    #[staticmethod]
+    fn method(_py: Python<'_>, input: i32) -> String {
+        format!("0x{:x}", input)
+    }
+}
+
+#[test]
+fn static_method_with_args() {
+    Python::with_gil(|py| {
+        assert_eq!(StaticMethodWithArgs::method(py, 1234), "0x4d2");
+
+        let d = [("C", py.get_type_bound::<StaticMethodWithArgs>())].into_py_dict_bound(py);
+        py_assert!(py, *d, "C.method(1337) == '0x539'");
+    });
+}
+
+#[pyclass]
+struct MethSignature {}
+
+#[pymethods]
+impl MethSignature {
+    #[pyo3(signature = (test = None))]
+    fn get_optional(&self, test: Option<i32>) -> i32 {
+        test.unwrap_or(10)
+    }
+    #[pyo3(signature = (test = None))]
+    fn get_optional2(&self, test: Option<i32>) -> Option<i32> {
+        test
+    }
+    #[pyo3(signature=(_t1 = None, t2 = None, _t3 = None))]
+    fn get_optional_positional(
+        &self,
+        _t1: Option<i32>,
+        t2: Option<i32>,
+        _t3: Option<i32>,
+    ) -> Option<i32> {
+        t2
+    }
+
+    #[pyo3(signature = (test = 10))]
+    fn get_default(&self, test: i32) -> i32 {
+        test
+    }
+    #[pyo3(signature = (*, test = 10))]
+    fn get_kwarg(&self, test: i32) -> i32 {
+        test
+    }
+    #[pyo3(signature = (*args, **kwargs))]
+    fn get_kwargs(
+        &self,
+        py: Python<'_>,
+        args: &Bound<'_, PyTuple>,
+        kwargs: Option<&Bound<'_, PyDict>>,
+    ) -> PyObject {
+        [args.to_object(py), kwargs.to_object(py)].to_object(py)
+    }
+
+    #[pyo3(signature = (a, *args, **kwargs))]
+    fn get_pos_arg_kw(
+        &self,
+        py: Python<'_>,
+        a: i32,
+        args: &Bound<'_, PyTuple>,
+        kwargs: Option<&Bound<'_, PyDict>>,
+    ) -> PyObject {
+        [a.to_object(py), args.to_object(py), kwargs.to_object(py)].to_object(py)
+    }
+
+    #[pyo3(signature = (a, b, /))]
+    fn get_pos_only(&self, a: i32, b: i32) -> i32 {
+        a + b
+    }
+
+    #[pyo3(signature = (a, /, b))]
+    fn get_pos_only_and_pos(&self, a: i32, b: i32) -> i32 {
+        a + b
+    }
+
+    #[pyo3(signature = (a, /, b, c = 5))]
+    fn get_pos_only_and_pos_and_kw(&self, a: i32, b: i32, c: i32) -> i32 {
+        a + b + c
+    }
+
+    #[pyo3(signature = (a, /, *, b))]
+    fn get_pos_only_and_kw_only(&self, a: i32, b: i32) -> i32 {
+        a + b
+    }
+
+    #[pyo3(signature = (a, /, *, b = 3))]
+    fn get_pos_only_and_kw_only_with_default(&self, a: i32, b: i32) -> i32 {
+        a + b
+    }
+
+    #[pyo3(signature = (a, /, b, *, c, d = 5))]
+    fn get_all_arg_types_together(&self, a: i32, b: i32, c: i32, d: i32) -> i32 {
+        a + b + c + d
+    }
+
+    #[pyo3(signature = (a, /, *args))]
+    fn get_pos_only_with_varargs(&self, a: i32, args: Vec<i32>) -> i32 {
+        a + args.iter().sum::<i32>()
+    }
+
+    #[pyo3(signature = (a, /, **kwargs))]
+    fn get_pos_only_with_kwargs(
+        &self,
+        py: Python<'_>,
+        a: i32,
+        kwargs: Option<&Bound<'_, PyDict>>,
+    ) -> PyObject {
+        [a.to_object(py), kwargs.to_object(py)].to_object(py)
+    }
+
+    #[pyo3(signature = (a=0, /, **kwargs))]
+    fn get_optional_pos_only_with_kwargs(
+        &self,
+        py: Python<'_>,
+        a: i32,
+        kwargs: Option<&Bound<'_, PyDict>>,
+    ) -> PyObject {
+        [a.to_object(py), kwargs.to_object(py)].to_object(py)
+    }
+
+    #[pyo3(signature = (*, a = 2, b = 3))]
+    fn get_kwargs_only_with_defaults(&self, a: i32, b: i32) -> i32 {
+        a + b
+    }
+
+    #[pyo3(signature = (*, a, b))]
+    fn get_kwargs_only(&self, a: i32, b: i32) -> i32 {
+        a + b
+    }
+
+    #[pyo3(signature = (*, a = 1, b))]
+    fn get_kwargs_only_with_some_default(&self, a: i32, b: i32) -> i32 {
+        a + b
+    }
+
+    #[pyo3(signature = (*args, a))]
+    fn get_args_and_required_keyword(
+        &self,
+        py: Python<'_>,
+        args: &Bound<'_, PyTuple>,
+        a: i32,
+    ) -> PyObject {
+        (args, a).to_object(py)
+    }
+
+    #[pyo3(signature = (a, b = 2, *, c = 3))]
+    fn get_pos_arg_kw_sep1(&self, a: i32, b: i32, c: i32) -> i32 {
+        a + b + c
+    }
+
+    #[pyo3(signature = (a, *, b = 2, c = 3))]
+    fn get_pos_arg_kw_sep2(&self, a: i32, b: i32, c: i32) -> i32 {
+        a + b + c
+    }
+
+    #[pyo3(signature = (a, **kwargs))]
+    fn get_pos_kw(&self, py: Python<'_>, a: i32, kwargs: Option<&Bound<'_, PyDict>>) -> PyObject {
+        [a.to_object(py), kwargs.to_object(py)].to_object(py)
+    }
+
+    // "args" can be anything that can be extracted from PyTuple
+    #[pyo3(signature = (*args))]
+    fn args_as_vec(&self, args: Vec<i32>) -> i32 {
+        args.iter().sum()
+    }
+}
+
+#[test]
+fn meth_signature() {
+    Python::with_gil(|py| {
+        let inst = Py::new(py, MethSignature {}).unwrap();
+
+        py_run!(py, inst, "assert inst.get_optional() == 10");
+        py_run!(py, inst, "assert inst.get_optional(100) == 100");
+        py_run!(py, inst, "assert inst.get_optional2() == None");
+        py_run!(py, inst, "assert inst.get_optional2(100) == 100");
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_optional_positional(1, 2, 3) == 2"
+        );
+        py_run!(py, inst, "assert inst.get_optional_positional(1) == None");
+        py_run!(py, inst, "assert inst.get_default() == 10");
+        py_run!(py, inst, "assert inst.get_default(100) == 100");
+        py_run!(py, inst, "assert inst.get_kwarg() == 10");
+        py_expect_exception!(py, inst, "inst.get_kwarg(100)", PyTypeError);
+        py_run!(py, inst, "assert inst.get_kwarg(test=100) == 100");
+        py_run!(py, inst, "assert inst.get_kwargs() == [(), None]");
+        py_run!(py, inst, "assert inst.get_kwargs(1,2,3) == [(1,2,3), None]");
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_kwargs(t=1,n=2) == [(), {'t': 1, 'n': 2}]"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_kwargs(1,2,3,t=1,n=2) == [(1,2,3), {'t': 1, 'n': 2}]"
+        );
+
+        py_run!(py, inst, "assert inst.get_pos_arg_kw(1) == [1, (), None]");
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_pos_arg_kw(1, 2, 3) == [1, (2, 3), None]"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_pos_arg_kw(1, b=2) == [1, (), {'b': 2}]"
+        );
+        py_run!(py, inst, "assert inst.get_pos_arg_kw(a=1) == [1, (), None]");
+        py_expect_exception!(py, inst, "inst.get_pos_arg_kw()", PyTypeError);
+        py_expect_exception!(py, inst, "inst.get_pos_arg_kw(1, a=1)", PyTypeError);
+        py_expect_exception!(py, inst, "inst.get_pos_arg_kw(b=2)", PyTypeError);
+
+        py_run!(py, inst, "assert inst.get_pos_only(10, 11) == 21");
+        py_expect_exception!(py, inst, "inst.get_pos_only(10, b = 11)", PyTypeError);
+        py_expect_exception!(py, inst, "inst.get_pos_only(a = 10, b = 11)", PyTypeError);
+
+        py_run!(py, inst, "assert inst.get_pos_only_and_pos(10, 11) == 21");
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_pos_only_and_pos(10, b = 11) == 21"
+        );
+        py_expect_exception!(
+            py,
+            inst,
+            "inst.get_pos_only_and_pos(a = 10, b = 11)",
+            PyTypeError
+        );
+
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_pos_only_and_pos_and_kw(10, 11) == 26"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_pos_only_and_pos_and_kw(10, b = 11) == 26"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_pos_only_and_pos_and_kw(10, 11, c = 0) == 21"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_pos_only_and_pos_and_kw(10, b = 11, c = 0) == 21"
+        );
+        py_expect_exception!(
+            py,
+            inst,
+            "inst.get_pos_only_and_pos_and_kw(a = 10, b = 11)",
+            PyTypeError
+        );
+
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_pos_only_and_kw_only(10, b = 11) == 21"
+        );
+        py_expect_exception!(
+            py,
+            inst,
+            "inst.get_pos_only_and_kw_only(10, 11)",
+            PyTypeError
+        );
+        py_expect_exception!(
+            py,
+            inst,
+            "inst.get_pos_only_and_kw_only(a = 10, b = 11)",
+            PyTypeError
+        );
+
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_pos_only_and_kw_only_with_default(10) == 13"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_pos_only_and_kw_only_with_default(10, b = 11) == 21"
+        );
+        py_expect_exception!(
+            py,
+            inst,
+            "inst.get_pos_only_and_kw_only_with_default(10, 11)",
+            PyTypeError
+        );
+        py_expect_exception!(
+            py,
+            inst,
+            "inst.get_pos_only_and_kw_only_with_default(a = 10, b = 11)",
+            PyTypeError
+        );
+
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_all_arg_types_together(10, 10, c = 10) == 35"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_all_arg_types_together(10, 10, c = 10, d = 10) == 40"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_all_arg_types_together(10, b = 10, c = 10, d = 10) == 40"
+        );
+        py_expect_exception!(
+            py,
+            inst,
+            "inst.get_all_arg_types_together(10, 10, 10)",
+            PyTypeError
+        );
+        py_expect_exception!(
+            py,
+            inst,
+            "inst.get_all_arg_types_together(a = 10, b = 10, c = 10)",
+            PyTypeError
+        );
+
+        py_run!(py, inst, "assert inst.get_pos_only_with_varargs(10) == 10");
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_pos_only_with_varargs(10, 10) == 20"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_pos_only_with_varargs(10, 10, 10, 10, 10) == 50"
+        );
+        py_expect_exception!(
+            py,
+            inst,
+            "inst.get_pos_only_with_varargs(a = 10)",
+            PyTypeError
+        );
+
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_pos_only_with_kwargs(10) == [10, None]"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_pos_only_with_kwargs(10, b = 10) == [10, {'b': 10}]"
+        );
+        py_run!(
+        py,
+        inst,
+        "assert inst.get_pos_only_with_kwargs(10, b = 10, c = 10, d = 10, e = 10) == [10, {'b': 10, 'c': 10, 'd': 10, 'e': 10}]"
+    );
+        py_expect_exception!(
+            py,
+            inst,
+            "inst.get_pos_only_with_kwargs(a = 10)",
+            PyTypeError
+        );
+        py_expect_exception!(
+            py,
+            inst,
+            "inst.get_pos_only_with_kwargs(a = 10, b = 10)",
+            PyTypeError
+        );
+
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_optional_pos_only_with_kwargs() == [0, None]"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_optional_pos_only_with_kwargs(10) == [10, None]"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_optional_pos_only_with_kwargs(a=10) == [0, {'a': 10}]"
+        );
+
+        py_run!(py, inst, "assert inst.get_kwargs_only_with_defaults() == 5");
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_kwargs_only_with_defaults(a = 8) == 11"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_kwargs_only_with_defaults(b = 8) == 10"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_kwargs_only_with_defaults(a = 1, b = 1) == 2"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_kwargs_only_with_defaults(b = 1, a = 1) == 2"
+        );
+
+        py_run!(py, inst, "assert inst.get_kwargs_only(a = 1, b = 1) == 2");
+        py_run!(py, inst, "assert inst.get_kwargs_only(b = 1, a = 1) == 2");
+
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_kwargs_only_with_some_default(a = 2, b = 1) == 3"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_kwargs_only_with_some_default(b = 1) == 2"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_kwargs_only_with_some_default(b = 1, a = 2) == 3"
+        );
+        py_expect_exception!(
+            py,
+            inst,
+            "inst.get_kwargs_only_with_some_default()",
+            PyTypeError
+        );
+
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_args_and_required_keyword(1, 2, a=3) == ((1, 2), 3)"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_args_and_required_keyword(a=1) == ((), 1)"
+        );
+        py_expect_exception!(
+            py,
+            inst,
+            "inst.get_args_and_required_keyword()",
+            PyTypeError
+        );
+
+        py_run!(py, inst, "assert inst.get_pos_arg_kw_sep1(1) == 6");
+        py_run!(py, inst, "assert inst.get_pos_arg_kw_sep1(1, 2) == 6");
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_pos_arg_kw_sep1(1, 2, c=13) == 16"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_pos_arg_kw_sep1(a=1, b=2, c=13) == 16"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_pos_arg_kw_sep1(b=2, c=13, a=1) == 16"
+        );
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_pos_arg_kw_sep1(c=13, b=2, a=1) == 16"
+        );
+        py_expect_exception!(py, inst, "inst.get_pos_arg_kw_sep1(1, 2, 3)", PyTypeError);
+
+        py_run!(py, inst, "assert inst.get_pos_arg_kw_sep2(1) == 6");
+        py_run!(
+            py,
+            inst,
+            "assert inst.get_pos_arg_kw_sep2(1, b=12, c=13) == 26"
+        );
+        py_expect_exception!(py, inst, "inst.get_pos_arg_kw_sep2(1, 2)", PyTypeError);
+
+        py_run!(py, inst, "assert inst.get_pos_kw(1, b=2) == [1, {'b': 2}]");
+        py_expect_exception!(py, inst, "inst.get_pos_kw(1,2)", PyTypeError);
+
+        py_run!(py, inst, "assert inst.args_as_vec(1,2,3) == 6");
+    });
+}
+
+#[pyclass]
+/// A class with "documentation".
+struct MethDocs {
+    x: i32,
+}
+
+#[pymethods]
+impl MethDocs {
+    /// A method with "documentation" as well.
+    fn method(&self) -> i32 {
+        0
+    }
+
+    #[getter]
+    /// `int`: a very "important" member of 'this' instance.
+    fn get_x(&self) -> i32 {
+        self.x
+    }
+}
+
+#[test]
+fn meth_doc() {
+    Python::with_gil(|py| {
+        let d = [("C", py.get_type_bound::<MethDocs>())].into_py_dict_bound(py);
+        py_assert!(py, *d, "C.__doc__ == 'A class with \"documentation\".'");
+        py_assert!(
+            py,
+            *d,
+            "C.method.__doc__ == 'A method with \"documentation\" as well.'"
+        );
+        py_assert!(
+            py,
+            *d,
+            "C.x.__doc__ == '`int`: a very \"important\" member of \\'this\\' instance.'"
+        );
+    });
+}
+
+#[pyclass]
+struct MethodWithLifeTime {}
+
+#[pymethods]
+impl MethodWithLifeTime {
+    fn set_to_list<'py>(&self, set: &Bound<'py, PySet>) -> PyResult<Bound<'py, PyList>> {
+        let py = set.py();
+        let mut items = vec![];
+        for _ in 0..set.len() {
+            items.push(set.pop().unwrap());
+        }
+        let list = PyList::new_bound(py, items);
+        list.sort()?;
+        Ok(list)
+    }
+}
+
+#[test]
+fn method_with_lifetime() {
+    Python::with_gil(|py| {
+        let obj = Py::new(py, MethodWithLifeTime {}).unwrap();
+        py_run!(
+            py,
+            obj,
+            "assert obj.set_to_list(set((1, 2, 3))) == [1, 2, 3]"
+        );
+    });
+}
+
+#[pyclass]
+struct MethodWithPyClassArg {
+    #[pyo3(get)]
+    value: i64,
+}
+
+#[pymethods]
+impl MethodWithPyClassArg {
+    fn add(&self, other: &MethodWithPyClassArg) -> MethodWithPyClassArg {
+        MethodWithPyClassArg {
+            value: self.value + other.value,
+        }
+    }
+    fn add_pyref(&self, other: PyRef<'_, MethodWithPyClassArg>) -> MethodWithPyClassArg {
+        MethodWithPyClassArg {
+            value: self.value + other.value,
+        }
+    }
+    fn inplace_add(&self, other: &mut MethodWithPyClassArg) {
+        other.value += self.value;
+    }
+    fn inplace_add_pyref(&self, mut other: PyRefMut<'_, MethodWithPyClassArg>) {
+        other.value += self.value;
+    }
+    #[pyo3(signature=(other = None))]
+    fn optional_add(&self, other: Option<&MethodWithPyClassArg>) -> MethodWithPyClassArg {
+        MethodWithPyClassArg {
+            value: self.value + other.map(|o| o.value).unwrap_or(10),
+        }
+    }
+    #[pyo3(signature=(other = None))]
+    fn optional_inplace_add(&self, other: Option<&mut MethodWithPyClassArg>) {
+        if let Some(other) = other {
+            other.value += self.value;
+        }
+    }
+}
+
+#[test]
+fn method_with_pyclassarg() {
+    Python::with_gil(|py| {
+        let obj1 = Py::new(py, MethodWithPyClassArg { value: 10 }).unwrap();
+        let obj2 = Py::new(py, MethodWithPyClassArg { value: 10 }).unwrap();
+        let d = [("obj1", obj1), ("obj2", obj2)].into_py_dict_bound(py);
+        py_run!(py, *d, "obj = obj1.add(obj2); assert obj.value == 20");
+        py_run!(py, *d, "obj = obj1.add_pyref(obj2); assert obj.value == 20");
+        py_run!(py, *d, "obj = obj1.optional_add(); assert obj.value == 20");
+        py_run!(
+            py,
+            *d,
+            "obj = obj1.optional_add(obj2); assert obj.value == 20"
+        );
+        py_run!(py, *d, "obj1.inplace_add(obj2); assert obj.value == 20");
+        py_run!(
+            py,
+            *d,
+            "obj1.inplace_add_pyref(obj2); assert obj2.value == 30"
+        );
+        py_run!(
+            py,
+            *d,
+            "obj1.optional_inplace_add(); assert obj2.value == 30"
+        );
+        py_run!(
+            py,
+            *d,
+            "obj1.optional_inplace_add(obj2); assert obj2.value == 40"
+        );
+    });
+}
+
+#[pyclass]
+#[cfg(unix)]
+struct CfgStruct {}
+
+#[pyclass]
+#[cfg(not(unix))]
+struct CfgStruct {}
+
+#[pymethods]
+#[cfg(unix)]
+impl CfgStruct {
+    fn unix_method(&self) -> &str {
+        "unix"
+    }
+
+    #[cfg(not(unix))]
+    fn never_compiled_method(&self) {}
+}
+
+#[pymethods]
+#[cfg(not(unix))]
+impl CfgStruct {
+    fn not_unix_method(&self) -> &str {
+        "not unix"
+    }
+
+    #[cfg(unix)]
+    fn never_compiled_method(&self) {}
+}
+
+#[test]
+fn test_cfg_attrs() {
+    Python::with_gil(|py| {
+        let inst = Py::new(py, CfgStruct {}).unwrap();
+
+        #[cfg(unix)]
+        {
+            py_assert!(py, inst, "inst.unix_method() == 'unix'");
+            py_assert!(py, inst, "not hasattr(inst, 'not_unix_method')");
+        }
+
+        #[cfg(not(unix))]
+        {
+            py_assert!(py, inst, "not hasattr(inst, 'unix_method')");
+            py_assert!(py, inst, "inst.not_unix_method() == 'not unix'");
+        }
+
+        py_assert!(py, inst, "not hasattr(inst, 'never_compiled_method')");
+    });
+}
+
+#[pyclass]
+#[derive(Default)]
+struct FromSequence {
+    #[pyo3(get)]
+    numbers: Vec<i64>,
+}
+
+#[pymethods]
+impl FromSequence {
+    #[new]
+    #[pyo3(signature=(seq = None))]
+    fn new(seq: Option<&Bound<'_, PySequence>>) -> PyResult<Self> {
+        if let Some(seq) = seq {
+            Ok(FromSequence {
+                numbers: seq.as_ref().extract::<Vec<_>>()?,
+            })
+        } else {
+            Ok(FromSequence::default())
+        }
+    }
+}
+
+#[test]
+fn test_from_sequence() {
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<FromSequence>();
+        py_assert!(py, typeobj, "typeobj(range(0, 4)).numbers == [0, 1, 2, 3]");
+    });
+}
+
+#[pyclass]
+struct r#RawIdents {
+    #[pyo3(get, set)]
+    r#type: PyObject,
+    r#subtype: PyObject,
+    r#subsubtype: PyObject,
+}
+
+#[pymethods]
+impl r#RawIdents {
+    #[new]
+    pub fn r#new(
+        r#_py: Python<'_>,
+        r#type: PyObject,
+        r#subtype: PyObject,
+        r#subsubtype: PyObject,
+    ) -> Self {
+        Self {
+            r#type,
+            r#subtype,
+            r#subsubtype,
+        }
+    }
+
+    #[getter(r#subtype)]
+    pub fn r#get_subtype(&self, py: Python<'_>) -> PyObject {
+        self.r#subtype.clone_ref(py)
+    }
+
+    #[setter(r#subtype)]
+    pub fn r#set_subtype(&mut self, r#subtype: PyObject) {
+        self.r#subtype = r#subtype;
+    }
+
+    #[getter]
+    pub fn r#get_subsubtype(&self, py: Python<'_>) -> PyObject {
+        self.r#subsubtype.clone_ref(py)
+    }
+
+    #[setter]
+    pub fn r#set_subsubtype(&mut self, r#subsubtype: PyObject) {
+        self.r#subsubtype = r#subsubtype;
+    }
+
+    pub fn r#__call__(&mut self, r#type: PyObject) {
+        self.r#type = r#type;
+    }
+
+    #[staticmethod]
+    pub fn r#static_method(r#type: PyObject) -> PyObject {
+        r#type
+    }
+
+    #[classmethod]
+    pub fn r#class_method(_: &Bound<'_, PyType>, r#type: PyObject) -> PyObject {
+        r#type
+    }
+
+    #[classattr]
+    pub fn r#class_attr_fn() -> i32 {
+        5
+    }
+
+    #[classattr]
+    const r#CLASS_ATTR_CONST: i32 = 6;
+
+    #[pyo3(signature = (r#struct = "foo"))]
+    fn method_with_keyword<'a>(&self, r#struct: &'a str) -> &'a str {
+        r#struct
+    }
+}
+
+#[test]
+fn test_raw_idents() {
+    Python::with_gil(|py| {
+        let raw_idents_type = py.get_type_bound::<r#RawIdents>();
+        assert_eq!(raw_idents_type.qualname().unwrap(), "RawIdents");
+        py_run!(
+            py,
+            raw_idents_type,
+            r#"
+            instance = raw_idents_type(type=None, subtype=5, subsubtype="foo")
+
+            assert instance.type is None
+            assert instance.subtype == 5
+            assert instance.subsubtype == "foo"
+
+            instance.type = 1
+            instance.subtype = 2
+            instance.subsubtype = 3
+
+            assert instance.type == 1
+            assert instance.subtype == 2
+            assert instance.subsubtype == 3
+
+            assert raw_idents_type.static_method(type=30) == 30
+            assert instance.class_method(type=40) == 40
+
+            instance(type=50)
+            assert instance.type == 50
+
+            assert raw_idents_type.class_attr_fn == 5
+            assert raw_idents_type.CLASS_ATTR_CONST == 6
+
+            assert instance.method_with_keyword() == "foo"
+            assert instance.method_with_keyword("bar") == "bar"
+            assert instance.method_with_keyword(struct="baz") == "baz"
+            "#
+        );
+    })
+}
+
+// Regression test for issue 1505 - Python argument not detected correctly when inside a macro.
+
+#[pyclass]
+struct Issue1505 {}
+
+macro_rules! pymethods {
+    (
+        #[pymethods]
+        impl $ty: ty {
+            fn $fn:ident (&self, $arg:ident : $arg_ty:ty) {}
+        }
+    ) => {
+        #[pymethods]
+        impl $ty {
+            fn $fn(&self, $arg: $arg_ty) {}
+        }
+    };
+}
+
+pymethods!(
+    #[pymethods]
+    impl Issue1505 {
+        fn issue_1505(&self, _py: Python<'_>) {}
+    }
+);
+
+// Regression test for issue 1506 - incorrect macro hygiene.
+// By applying the `#[pymethods]` attribute inside a macro_rules! macro, this separates the macro
+// call scope from the scope of the impl block. For this to work our macros must be careful to not
+// cheat hygiene!
+
+#[pyclass]
+struct Issue1506 {}
+
+macro_rules! issue_1506 {
+    (#[pymethods] $($body:tt)*) => {
+        #[pymethods]
+        $($body)*
+    };
+}
+
+issue_1506!(
+    #[pymethods]
+    impl Issue1506 {
+        #[pyo3(signature = (_arg, _args, _kwargs=None))]
+        fn issue_1506(
+            &self,
+            _py: Python<'_>,
+            _arg: &Bound<'_, PyAny>,
+            _args: &Bound<'_, PyTuple>,
+            _kwargs: Option<&Bound<'_, PyDict>>,
+        ) {
+        }
+
+        #[pyo3(signature = (_arg, _args, _kwargs=None))]
+        fn issue_1506_mut(
+            &mut self,
+            _py: Python<'_>,
+            _arg: &Bound<'_, PyAny>,
+            _args: &Bound<'_, PyTuple>,
+            _kwargs: Option<&Bound<'_, PyDict>>,
+        ) {
+        }
+
+        #[pyo3(signature = (_arg, _args, _kwargs=None))]
+        fn issue_1506_custom_receiver(
+            _slf: Py<Self>,
+            _py: Python<'_>,
+            _arg: &Bound<'_, PyAny>,
+            _args: &Bound<'_, PyTuple>,
+            _kwargs: Option<&Bound<'_, PyDict>>,
+        ) {
+        }
+
+        #[pyo3(signature = (_arg, _args, _kwargs=None))]
+        fn issue_1506_custom_receiver_explicit(
+            _slf: Py<Issue1506>,
+            _py: Python<'_>,
+            _arg: &Bound<'_, PyAny>,
+            _args: &Bound<'_, PyTuple>,
+            _kwargs: Option<&Bound<'_, PyDict>>,
+        ) {
+        }
+
+        #[new]
+        #[pyo3(signature = (_arg, _args, _kwargs=None))]
+        fn issue_1506_new(
+            _py: Python<'_>,
+            _arg: &Bound<'_, PyAny>,
+            _args: &Bound<'_, PyTuple>,
+            _kwargs: Option<&Bound<'_, PyDict>>,
+        ) -> Self {
+            Issue1506 {}
+        }
+
+        #[getter("foo")]
+        fn issue_1506_getter(&self, _py: Python<'_>) -> i32 {
+            5
+        }
+
+        #[setter("foo")]
+        fn issue_1506_setter(&self, _py: Python<'_>, _value: i32) {}
+
+        #[staticmethod]
+        #[pyo3(signature = (_arg, _args, _kwargs=None))]
+        fn issue_1506_static(
+            _py: Python<'_>,
+            _arg: &Bound<'_, PyAny>,
+            _args: &Bound<'_, PyTuple>,
+            _kwargs: Option<&Bound<'_, PyDict>>,
+        ) {
+        }
+
+        #[classmethod]
+        #[pyo3(signature = (_arg, _args, _kwargs=None))]
+        fn issue_1506_class(
+            _cls: &Bound<'_, PyType>,
+            _py: Python<'_>,
+            _arg: &Bound<'_, PyAny>,
+            _args: &Bound<'_, PyTuple>,
+            _kwargs: Option<&Bound<'_, PyDict>>,
+        ) {
+        }
+    }
+);
+
+#[pyclass]
+struct Issue1696 {}
+
+pymethods!(
+    #[pymethods]
+    impl Issue1696 {
+        fn issue_1696(&self, _x: &InstanceMethod) {}
+    }
+);
+
+#[test]
+fn test_option_pyclass_arg() {
+    // Option<&PyClass> argument with a default set in a signature regressed to a compile
+    // error in PyO3 0.17.0 - this test it continues to be accepted.
+
+    #[pyclass]
+    struct SomePyClass {}
+
+    #[pyfunction(signature = (arg=None))]
+    fn option_class_arg(arg: Option<&SomePyClass>) -> Option<SomePyClass> {
+        arg.map(|_| SomePyClass {})
+    }
+
+    Python::with_gil(|py| {
+        let f = wrap_pyfunction_bound!(option_class_arg, py).unwrap();
+        assert!(f.call0().unwrap().is_none());
+        let obj = Py::new(py, SomePyClass {}).unwrap();
+        assert!(f
+            .call1((obj,))
+            .unwrap()
+            .extract::<Py<SomePyClass>>()
+            .is_ok());
+    })
+}
+
+#[test]
+fn test_issue_2988() {
+    #[pyfunction]
+    #[pyo3(signature = (
+        _data = vec![],
+        _data2 = vec![],
+    ))]
+    pub fn _foo(
+        _data: Vec<i32>,
+        // The from_py_with here looks a little odd, we just need some way
+        // to encourage the macro to expand the from_py_with default path too
+        #[pyo3(from_py_with = "<Bound<'_, _> as PyAnyMethods>::extract")] _data2: Vec<i32>,
+    ) {
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_module.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_module.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_module.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_module.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,480 @@
+#![cfg(feature = "macros")]
+
+use pyo3::prelude::*;
+
+use pyo3::py_run;
+use pyo3::types::PyString;
+use pyo3::types::{IntoPyDict, PyDict, PyTuple};
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyclass]
+struct AnonClass {}
+
+#[pyclass]
+struct ValueClass {
+    value: usize,
+}
+
+#[pymethods]
+impl ValueClass {
+    #[new]
+    fn new(value: usize) -> ValueClass {
+        ValueClass { value }
+    }
+}
+
+#[pyclass(module = "module")]
+struct LocatedClass {}
+
+#[pyfunction]
+/// Doubles the given value
+fn double(x: usize) -> usize {
+    x * 2
+}
+
+/// This module is implemented in Rust.
+#[pymodule]
+fn module_with_functions(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    #[pyfn(m)]
+    #[pyo3(name = "no_parameters")]
+    fn function_with_name() -> usize {
+        42
+    }
+
+    #[pyfn(m)]
+    #[pyo3(pass_module)]
+    fn with_module<'py>(module: &Bound<'py, PyModule>) -> PyResult<Bound<'py, PyString>> {
+        module.name()
+    }
+
+    #[pyfn(m)]
+    fn double_value(v: &ValueClass) -> usize {
+        v.value * 2
+    }
+
+    m.add_class::<AnonClass>()?;
+    m.add_class::<ValueClass>()?;
+    m.add_class::<LocatedClass>()?;
+
+    m.add("foo", "bar")?;
+
+    m.add_function(wrap_pyfunction!(double, m)?)?;
+    m.add("also_double", wrap_pyfunction!(double, m)?)?;
+
+    Ok(())
+}
+
+#[test]
+fn test_module_with_functions() {
+    use pyo3::wrap_pymodule;
+
+    Python::with_gil(|py| {
+        let d = [(
+            "module_with_functions",
+            wrap_pymodule!(module_with_functions)(py),
+        )]
+        .into_py_dict_bound(py);
+
+        py_assert!(
+            py,
+            *d,
+            "module_with_functions.__doc__ == 'This module is implemented in Rust.'"
+        );
+        py_assert!(py, *d, "module_with_functions.no_parameters() == 42");
+        py_assert!(py, *d, "module_with_functions.foo == 'bar'");
+        py_assert!(py, *d, "module_with_functions.AnonClass != None");
+        py_assert!(py, *d, "module_with_functions.LocatedClass != None");
+        py_assert!(
+            py,
+            *d,
+            "module_with_functions.LocatedClass.__module__ == 'module'"
+        );
+        py_assert!(py, *d, "module_with_functions.double(3) == 6");
+        py_assert!(
+            py,
+            *d,
+            "module_with_functions.double.__doc__ == 'Doubles the given value'"
+        );
+        py_assert!(py, *d, "module_with_functions.also_double(3) == 6");
+        py_assert!(
+            py,
+            *d,
+            "module_with_functions.also_double.__doc__ == 'Doubles the given value'"
+        );
+        py_assert!(
+            py,
+            *d,
+            "module_with_functions.double_value(module_with_functions.ValueClass(1)) == 2"
+        );
+        py_assert!(
+            py,
+            *d,
+            "module_with_functions.with_module() == 'module_with_functions'"
+        );
+    });
+}
+
+/// This module uses a legacy two-argument module function.
+#[pymodule]
+fn module_with_explicit_py_arg(_py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> {
+    m.add_function(wrap_pyfunction!(double, m)?)?;
+    Ok(())
+}
+
+#[test]
+fn test_module_with_explicit_py_arg() {
+    use pyo3::wrap_pymodule;
+
+    Python::with_gil(|py| {
+        let d = [(
+            "module_with_explicit_py_arg",
+            wrap_pymodule!(module_with_explicit_py_arg)(py),
+        )]
+        .into_py_dict_bound(py);
+
+        py_assert!(py, *d, "module_with_explicit_py_arg.double(3) == 6");
+    });
+}
+
+#[pymodule(name = "other_name")]
+fn some_name(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    m.add("other_name", "other_name")?;
+    Ok(())
+}
+
+#[test]
+fn test_module_renaming() {
+    use pyo3::wrap_pymodule;
+
+    Python::with_gil(|py| {
+        let d = [("different_name", wrap_pymodule!(some_name)(py))].into_py_dict_bound(py);
+
+        py_run!(py, *d, "assert different_name.__name__ == 'other_name'");
+    });
+}
+
+#[test]
+fn test_module_from_code_bound() {
+    Python::with_gil(|py| {
+        let adder_mod = PyModule::from_code_bound(
+            py,
+            "def add(a,b):\n\treturn a+b",
+            "adder_mod.py",
+            "adder_mod",
+        )
+        .expect("Module code should be loaded");
+
+        let add_func = adder_mod
+            .getattr("add")
+            .expect("Add function should be in the module")
+            .to_object(py);
+
+        let ret_value: i32 = add_func
+            .call1(py, (1, 2))
+            .expect("A value should be returned")
+            .extract(py)
+            .expect("The value should be able to be converted to an i32");
+
+        assert_eq!(ret_value, 3);
+    });
+}
+
+#[pyfunction]
+fn r#move() -> usize {
+    42
+}
+
+#[pymodule]
+fn raw_ident_module(module: &Bound<'_, PyModule>) -> PyResult<()> {
+    module.add_function(wrap_pyfunction!(r#move, module)?)
+}
+
+#[test]
+fn test_raw_idents() {
+    use pyo3::wrap_pymodule;
+
+    Python::with_gil(|py| {
+        let module = wrap_pymodule!(raw_ident_module)(py);
+
+        py_assert!(py, module, "module.move() == 42");
+    });
+}
+
+#[pyfunction]
+#[pyo3(name = "foobar")]
+fn custom_named_fn() -> usize {
+    42
+}
+
+#[test]
+fn test_custom_names() {
+    #[pymodule]
+    fn custom_names(m: &Bound<'_, PyModule>) -> PyResult<()> {
+        m.add_function(wrap_pyfunction!(custom_named_fn, m)?)?;
+        Ok(())
+    }
+
+    Python::with_gil(|py| {
+        let module = pyo3::wrap_pymodule!(custom_names)(py);
+
+        py_assert!(py, module, "not hasattr(module, 'custom_named_fn')");
+        py_assert!(py, module, "module.foobar() == 42");
+    });
+}
+
+#[test]
+fn test_module_dict() {
+    #[pymodule]
+    fn module_dict(m: &Bound<'_, PyModule>) -> PyResult<()> {
+        m.dict().set_item("yay", "me")?;
+        Ok(())
+    }
+
+    Python::with_gil(|py| {
+        let module = pyo3::wrap_pymodule!(module_dict)(py);
+
+        py_assert!(py, module, "module.yay == 'me'");
+    });
+}
+
+#[test]
+fn test_module_dunder_all() {
+    Python::with_gil(|py| {
+        #[pymodule]
+        fn dunder_all(m: &Bound<'_, PyModule>) -> PyResult<()> {
+            m.dict().set_item("yay", "me")?;
+            m.add_function(wrap_pyfunction!(custom_named_fn, m)?)?;
+            Ok(())
+        }
+
+        let module = pyo3::wrap_pymodule!(dunder_all)(py);
+
+        py_assert!(py, module, "module.__all__ == ['foobar']");
+    });
+}
+
+#[pyfunction]
+fn subfunction() -> String {
+    "Subfunction".to_string()
+}
+
+fn submodule(module: &Bound<'_, PyModule>) -> PyResult<()> {
+    module.add_function(wrap_pyfunction!(subfunction, module)?)?;
+    Ok(())
+}
+
+#[pymodule]
+fn submodule_with_init_fn(module: &Bound<'_, PyModule>) -> PyResult<()> {
+    module.add_function(wrap_pyfunction!(subfunction, module)?)?;
+    Ok(())
+}
+
+#[pyfunction]
+fn superfunction() -> String {
+    "Superfunction".to_string()
+}
+
+#[pymodule]
+fn supermodule(module: &Bound<'_, PyModule>) -> PyResult<()> {
+    module.add_function(wrap_pyfunction!(superfunction, module)?)?;
+    let module_to_add = PyModule::new_bound(module.py(), "submodule")?;
+    submodule(&module_to_add)?;
+    module.add_submodule(&module_to_add)?;
+    let module_to_add = PyModule::new_bound(module.py(), "submodule_with_init_fn")?;
+    submodule_with_init_fn(&module_to_add)?;
+    module.add_submodule(&module_to_add)?;
+    Ok(())
+}
+
+#[test]
+fn test_module_nesting() {
+    use pyo3::wrap_pymodule;
+
+    Python::with_gil(|py| {
+        let supermodule = wrap_pymodule!(supermodule)(py);
+
+        py_assert!(
+            py,
+            supermodule,
+            "supermodule.superfunction() == 'Superfunction'"
+        );
+        py_assert!(
+            py,
+            supermodule,
+            "supermodule.submodule.subfunction() == 'Subfunction'"
+        );
+        py_assert!(
+            py,
+            supermodule,
+            "supermodule.submodule_with_init_fn.subfunction() == 'Subfunction'"
+        );
+    });
+}
+
+// Test that argument parsing specification works for pyfunctions
+
+#[pyfunction(signature = (a=5, *args))]
+fn ext_vararg_fn(py: Python<'_>, a: i32, args: &Bound<'_, PyTuple>) -> PyObject {
+    [a.to_object(py), args.into_py(py)].to_object(py)
+}
+
+#[pymodule]
+fn vararg_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    #[pyfn(m, signature = (a=5, *args))]
+    fn int_vararg_fn(py: Python<'_>, a: i32, args: &Bound<'_, PyTuple>) -> PyObject {
+        ext_vararg_fn(py, a, args)
+    }
+
+    m.add_function(wrap_pyfunction!(ext_vararg_fn, m)?).unwrap();
+    Ok(())
+}
+
+#[test]
+fn test_vararg_module() {
+    Python::with_gil(|py| {
+        let m = pyo3::wrap_pymodule!(vararg_module)(py);
+
+        py_assert!(py, m, "m.ext_vararg_fn() == [5, ()]");
+        py_assert!(py, m, "m.ext_vararg_fn(1, 2) == [1, (2,)]");
+
+        py_assert!(py, m, "m.int_vararg_fn() == [5, ()]");
+        py_assert!(py, m, "m.int_vararg_fn(1, 2) == [1, (2,)]");
+    });
+}
+
+#[test]
+fn test_module_with_constant() {
+    // Regression test for #1102
+
+    #[pymodule]
+    fn module_with_constant(m: &Bound<'_, PyModule>) -> PyResult<()> {
+        const ANON: AnonClass = AnonClass {};
+
+        m.add("ANON", ANON)?;
+        m.add_class::<AnonClass>()?;
+
+        Ok(())
+    }
+
+    Python::with_gil(|py| {
+        let m = pyo3::wrap_pymodule!(module_with_constant)(py);
+        py_assert!(py, m, "isinstance(m.ANON, m.AnonClass)");
+    });
+}
+
+#[pyfunction]
+#[pyo3(pass_module)]
+fn pyfunction_with_module<'py>(module: &Bound<'py, PyModule>) -> PyResult<Bound<'py, PyString>> {
+    module.name()
+}
+
+#[pyfunction]
+#[pyo3(pass_module)]
+fn pyfunction_with_module_owned(
+    module: Py<PyModule>,
+    py: Python<'_>,
+) -> PyResult<Bound<'_, PyString>> {
+    module.bind(py).name()
+}
+
+#[pyfunction]
+#[pyo3(pass_module)]
+fn pyfunction_with_module_and_py<'py>(
+    module: &Bound<'py, PyModule>,
+    _python: Python<'py>,
+) -> PyResult<Bound<'py, PyString>> {
+    module.name()
+}
+
+#[pyfunction]
+#[pyo3(pass_module)]
+fn pyfunction_with_module_and_arg<'py>(
+    module: &Bound<'py, PyModule>,
+    string: String,
+) -> PyResult<(Bound<'py, PyString>, String)> {
+    module.name().map(|s| (s, string))
+}
+
+#[pyfunction(signature = (string="foo"))]
+#[pyo3(pass_module)]
+fn pyfunction_with_module_and_default_arg<'py>(
+    module: &Bound<'py, PyModule>,
+    string: &str,
+) -> PyResult<(Bound<'py, PyString>, String)> {
+    module.name().map(|s| (s, string.into()))
+}
+
+#[pyfunction(signature = (*args, **kwargs))]
+#[pyo3(pass_module)]
+fn pyfunction_with_module_and_args_kwargs<'py>(
+    module: &Bound<'py, PyModule>,
+    args: &Bound<'py, PyTuple>,
+    kwargs: Option<&Bound<'py, PyDict>>,
+) -> PyResult<(Bound<'py, PyString>, usize, Option<usize>)> {
+    module
+        .name()
+        .map(|s| (s, args.len(), kwargs.map(|d| d.len())))
+}
+
+#[pymodule]
+fn module_with_functions_with_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
+    m.add_function(wrap_pyfunction!(pyfunction_with_module, m)?)?;
+    m.add_function(wrap_pyfunction!(pyfunction_with_module_owned, m)?)?;
+    m.add_function(wrap_pyfunction!(pyfunction_with_module_and_py, m)?)?;
+    m.add_function(wrap_pyfunction!(pyfunction_with_module_and_arg, m)?)?;
+    m.add_function(wrap_pyfunction!(pyfunction_with_module_and_default_arg, m)?)?;
+    m.add_function(wrap_pyfunction!(pyfunction_with_module_and_args_kwargs, m)?)?;
+    m.add_function(wrap_pyfunction!(pyfunction_with_module, m)?)?;
+    Ok(())
+}
+
+#[test]
+fn test_module_functions_with_module() {
+    Python::with_gil(|py| {
+        let m = pyo3::wrap_pymodule!(module_with_functions_with_module)(py);
+        py_assert!(
+            py,
+            m,
+            "m.pyfunction_with_module() == 'module_with_functions_with_module'"
+        );
+        py_assert!(
+            py,
+            m,
+            "m.pyfunction_with_module_owned() == 'module_with_functions_with_module'"
+        );
+        py_assert!(
+            py,
+            m,
+            "m.pyfunction_with_module_and_py() == 'module_with_functions_with_module'"
+        );
+        py_assert!(
+            py,
+            m,
+            "m.pyfunction_with_module_and_default_arg() \
+                        == ('module_with_functions_with_module', 'foo')"
+        );
+        py_assert!(
+            py,
+            m,
+            "m.pyfunction_with_module_and_args_kwargs(1, x=1, y=2) \
+                        == ('module_with_functions_with_module', 1, 2)"
+        );
+    });
+}
+
+#[test]
+fn test_module_doc_hidden() {
+    #[doc(hidden)]
+    #[allow(clippy::unnecessary_wraps)]
+    #[pymodule]
+    fn my_module(_m: &Bound<'_, PyModule>) -> PyResult<()> {
+        Ok(())
+    }
+
+    Python::with_gil(|py| {
+        let m = pyo3::wrap_pymodule!(my_module)(py);
+        py_assert!(py, m, "m.__doc__ == ''");
+    })
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_multiple_pymethods.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_multiple_pymethods.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_multiple_pymethods.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_multiple_pymethods.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,76 @@
+#![cfg(feature = "multiple-pymethods")]
+
+use pyo3::prelude::*;
+use pyo3::types::PyType;
+
+#[macro_use]
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyclass]
+struct PyClassWithMultiplePyMethods {}
+
+#[pymethods]
+impl PyClassWithMultiplePyMethods {
+    #[new]
+    fn new() -> Self {
+        Self {}
+    }
+}
+
+#[pymethods]
+impl PyClassWithMultiplePyMethods {
+    fn __call__(&self) -> &'static str {
+        "call"
+    }
+}
+
+#[pymethods]
+impl PyClassWithMultiplePyMethods {
+    fn method(&self) -> &'static str {
+        "method"
+    }
+}
+
+#[pymethods]
+impl PyClassWithMultiplePyMethods {
+    #[classmethod]
+    fn classmethod(_ty: &Bound<'_, PyType>) -> &'static str {
+        "classmethod"
+    }
+}
+
+#[pymethods]
+impl PyClassWithMultiplePyMethods {
+    #[staticmethod]
+    fn staticmethod() -> &'static str {
+        "staticmethod"
+    }
+}
+
+#[pymethods]
+impl PyClassWithMultiplePyMethods {
+    #[classattr]
+    fn class_attribute() -> &'static str {
+        "class_attribute"
+    }
+}
+
+#[pymethods]
+impl PyClassWithMultiplePyMethods {
+    #[classattr]
+    const CLASS_ATTRIBUTE: &'static str = "CLASS_ATTRIBUTE";
+}
+
+#[test]
+fn test_class_with_multiple_pymethods() {
+    Python::with_gil(|py| {
+        let cls = py.get_type_bound::<PyClassWithMultiplePyMethods>();
+        py_assert!(py, cls, "cls()() == 'call'");
+        py_assert!(py, cls, "cls().method() == 'method'");
+        py_assert!(py, cls, "cls.classmethod() == 'classmethod'");
+        py_assert!(py, cls, "cls.staticmethod() == 'staticmethod'");
+        py_assert!(py, cls, "cls.class_attribute == 'class_attribute'");
+        py_assert!(py, cls, "cls.CLASS_ATTRIBUTE == 'CLASS_ATTRIBUTE'");
+    })
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_no_imports.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_no_imports.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_no_imports.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_no_imports.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,169 @@
+//! Tests that various macros work correctly without any PyO3 imports.
+
+#![cfg(feature = "macros")]
+
+use pyo3::prelude::PyAnyMethods;
+
+#[pyo3::pyfunction]
+#[pyo3(name = "identity", signature = (x = None))]
+fn basic_function(py: pyo3::Python<'_>, x: Option<pyo3::PyObject>) -> pyo3::PyObject {
+    x.unwrap_or_else(|| py.None())
+}
+
+#[cfg(feature = "gil-refs")]
+#[allow(deprecated)]
+#[pyo3::pymodule]
+fn basic_module(_py: pyo3::Python<'_>, m: &pyo3::types::PyModule) -> pyo3::PyResult<()> {
+    #[pyfn(m)]
+    fn answer() -> usize {
+        42
+    }
+
+    m.add_function(pyo3::wrap_pyfunction!(basic_function, m)?)?;
+
+    Ok(())
+}
+
+#[pyo3::pymodule]
+fn basic_module_bound(m: &pyo3::Bound<'_, pyo3::types::PyModule>) -> pyo3::PyResult<()> {
+    #[pyfn(m)]
+    fn answer() -> usize {
+        42
+    }
+
+    pyo3::types::PyModuleMethods::add_function(
+        m,
+        pyo3::wrap_pyfunction_bound!(basic_function, m)?,
+    )?;
+
+    Ok(())
+}
+
+#[pyo3::pyclass]
+struct BasicClass {
+    #[pyo3(get)]
+    v: usize,
+    #[pyo3(get, set)]
+    s: String,
+}
+
+#[pyo3::pymethods]
+impl BasicClass {
+    #[classattr]
+    const OKAY: bool = true;
+
+    #[new]
+    fn new(arg: &pyo3::Bound<'_, pyo3::PyAny>) -> pyo3::PyResult<Self> {
+        if let Ok(v) = arg.extract::<usize>() {
+            Ok(Self {
+                v,
+                s: "".to_string(),
+            })
+        } else {
+            Ok(Self {
+                v: 0,
+                s: arg.extract()?,
+            })
+        }
+    }
+
+    #[getter]
+    fn get_property(&self) -> usize {
+        self.v * 100
+    }
+
+    #[setter]
+    fn set_property(&mut self, value: usize) {
+        self.v = value / 100
+    }
+
+    /// Some documentation here
+    #[classmethod]
+    fn classmethod<'a, 'py>(
+        cls: &'a pyo3::Bound<'py, pyo3::types::PyType>,
+    ) -> &'a pyo3::Bound<'py, pyo3::types::PyType> {
+        cls
+    }
+
+    #[staticmethod]
+    fn staticmethod(py: pyo3::Python<'_>, v: usize) -> pyo3::Py<pyo3::PyAny> {
+        use pyo3::IntoPy;
+        v.to_string().into_py(py)
+    }
+
+    fn __add__(&self, other: usize) -> usize {
+        self.v + other
+    }
+
+    fn __iadd__(&mut self, other: pyo3::PyRef<'_, Self>) {
+        self.v += other.v;
+        self.s.push_str(&other.s);
+    }
+
+    fn mutate(mut slf: pyo3::PyRefMut<'_, Self>) {
+        slf.v += slf.v;
+        slf.s.push('!');
+    }
+}
+
+#[test]
+fn test_basic() {
+    pyo3::Python::with_gil(|py| {
+        let module = pyo3::wrap_pymodule!(basic_module_bound)(py);
+        let cls = py.get_type_bound::<BasicClass>();
+        let d = pyo3::types::IntoPyDict::into_py_dict_bound(
+            [
+                ("mod", module.bind(py).as_any()),
+                ("cls", &cls),
+                ("a", &cls.call1((8,)).unwrap()),
+                ("b", &cls.call1(("foo",)).unwrap()),
+            ],
+            py,
+        );
+
+        pyo3::py_run!(py, *d, "assert mod.answer() == 42");
+        pyo3::py_run!(py, *d, "assert mod.identity() is None");
+        pyo3::py_run!(py, *d, "v = object(); assert mod.identity(v) is v");
+        pyo3::py_run!(py, *d, "assert cls.OKAY");
+        pyo3::py_run!(py, *d, "assert (a.v, a.s) == (8, '')");
+        pyo3::py_run!(py, *d, "assert (b.v, b.s) == (0, 'foo')");
+        pyo3::py_run!(py, *d, "b.property = 314");
+        pyo3::py_run!(py, *d, "assert b.property == 300");
+        pyo3::py_run!(
+            py,
+            *d,
+            "assert cls.classmethod.__doc__ == 'Some documentation here'"
+        );
+        pyo3::py_run!(py, *d, "assert cls.classmethod() is cls");
+        pyo3::py_run!(py, *d, "assert cls.staticmethod(5) == '5'");
+        pyo3::py_run!(py, *d, "a.s = 'bar'; assert a.s == 'bar'");
+        pyo3::py_run!(py, *d, "a.mutate(); assert (a.v, a.s) == (16, 'bar!')");
+        pyo3::py_run!(py, *d, "assert a + 9 == 25");
+        pyo3::py_run!(py, *d, "b += a; assert (b.v, b.s) == (19, 'foobar!')");
+    });
+}
+
+#[pyo3::pyclass]
+struct NewClassMethod {
+    #[pyo3(get)]
+    cls: pyo3::PyObject,
+}
+
+#[pyo3::pymethods]
+impl NewClassMethod {
+    #[new]
+    #[classmethod]
+    fn new(cls: &pyo3::Bound<'_, pyo3::types::PyType>) -> Self {
+        Self {
+            cls: cls.clone().into_any().unbind(),
+        }
+    }
+}
+
+#[test]
+fn test_new_class_method() {
+    pyo3::Python::with_gil(|py| {
+        let cls = py.get_type_bound::<NewClassMethod>();
+        pyo3::py_run!(py, cls, "assert cls().cls is cls");
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_proto_methods.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_proto_methods.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_proto_methods.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_proto_methods.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,887 @@
+#![cfg(feature = "macros")]
+
+use pyo3::exceptions::{PyAttributeError, PyIndexError, PyValueError};
+use pyo3::types::{PyDict, PyList, PyMapping, PySequence, PySlice, PyType};
+use pyo3::{prelude::*, py_run};
+use std::iter;
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyclass]
+struct EmptyClass;
+
+#[pyclass]
+struct ExampleClass {
+    #[pyo3(get, set)]
+    value: i32,
+    custom_attr: Option<i32>,
+}
+
+#[pymethods]
+impl ExampleClass {
+    fn __getattr__(&self, py: Python<'_>, attr: &str) -> PyResult<PyObject> {
+        if attr == "special_custom_attr" {
+            Ok(self.custom_attr.into_py(py))
+        } else {
+            Err(PyAttributeError::new_err(attr.to_string()))
+        }
+    }
+
+    fn __setattr__(&mut self, attr: &str, value: &Bound<'_, PyAny>) -> PyResult<()> {
+        if attr == "special_custom_attr" {
+            self.custom_attr = Some(value.extract()?);
+            Ok(())
+        } else {
+            Err(PyAttributeError::new_err(attr.to_string()))
+        }
+    }
+
+    fn __delattr__(&mut self, attr: &str) -> PyResult<()> {
+        if attr == "special_custom_attr" {
+            self.custom_attr = None;
+            Ok(())
+        } else {
+            Err(PyAttributeError::new_err(attr.to_string()))
+        }
+    }
+
+    fn __str__(&self) -> String {
+        self.value.to_string()
+    }
+
+    fn __repr__(&self) -> String {
+        format!("ExampleClass(value={})", self.value)
+    }
+
+    fn __hash__(&self) -> u64 {
+        let i64_value: i64 = self.value.into();
+        i64_value as u64
+    }
+
+    fn __bool__(&self) -> bool {
+        self.value != 0
+    }
+}
+
+fn make_example(py: Python<'_>) -> Bound<'_, ExampleClass> {
+    Bound::new(
+        py,
+        ExampleClass {
+            value: 5,
+            custom_attr: Some(20),
+        },
+    )
+    .unwrap()
+}
+
+#[test]
+fn test_getattr() {
+    Python::with_gil(|py| {
+        let example_py = make_example(py);
+        assert_eq!(
+            example_py
+                .getattr("value")
+                .unwrap()
+                .extract::<i32>()
+                .unwrap(),
+            5,
+        );
+        assert_eq!(
+            example_py
+                .getattr("special_custom_attr")
+                .unwrap()
+                .extract::<i32>()
+                .unwrap(),
+            20,
+        );
+        assert!(example_py
+            .getattr("other_attr")
+            .unwrap_err()
+            .is_instance_of::<PyAttributeError>(py));
+    })
+}
+
+#[test]
+fn test_setattr() {
+    Python::with_gil(|py| {
+        let example_py = make_example(py);
+        example_py.setattr("special_custom_attr", 15).unwrap();
+        assert_eq!(
+            example_py
+                .getattr("special_custom_attr")
+                .unwrap()
+                .extract::<i32>()
+                .unwrap(),
+            15,
+        );
+    })
+}
+
+#[test]
+fn test_delattr() {
+    Python::with_gil(|py| {
+        let example_py = make_example(py);
+        example_py.delattr("special_custom_attr").unwrap();
+        assert!(example_py.getattr("special_custom_attr").unwrap().is_none());
+    })
+}
+
+#[test]
+fn test_str() {
+    Python::with_gil(|py| {
+        let example_py = make_example(py);
+        assert_eq!(example_py.str().unwrap(), "5");
+    })
+}
+
+#[test]
+fn test_repr() {
+    Python::with_gil(|py| {
+        let example_py = make_example(py);
+        assert_eq!(example_py.repr().unwrap(), "ExampleClass(value=5)");
+    })
+}
+
+#[test]
+fn test_hash() {
+    Python::with_gil(|py| {
+        let example_py = make_example(py);
+        assert_eq!(example_py.hash().unwrap(), 5);
+    })
+}
+
+#[test]
+fn test_bool() {
+    Python::with_gil(|py| {
+        let example_py = make_example(py);
+        assert!(example_py.is_truthy().unwrap());
+        example_py.borrow_mut().value = 0;
+        assert!(!example_py.is_truthy().unwrap());
+    })
+}
+
+#[pyclass]
+pub struct LenOverflow;
+
+#[pymethods]
+impl LenOverflow {
+    fn __len__(&self) -> usize {
+        (isize::MAX as usize) + 1
+    }
+}
+
+#[test]
+fn len_overflow() {
+    Python::with_gil(|py| {
+        let inst = Py::new(py, LenOverflow).unwrap();
+        py_expect_exception!(py, inst, "len(inst)", PyOverflowError);
+    });
+}
+
+#[pyclass]
+pub struct Mapping {
+    values: Py<PyDict>,
+}
+
+#[pymethods]
+impl Mapping {
+    fn __len__(&self, py: Python<'_>) -> usize {
+        self.values.bind(py).len()
+    }
+
+    fn __getitem__<'py>(&self, key: &Bound<'py, PyAny>) -> PyResult<Bound<'py, PyAny>> {
+        let any: &Bound<'py, PyAny> = self.values.bind(key.py());
+        any.get_item(key)
+    }
+
+    fn __setitem__<'py>(&self, key: &Bound<'py, PyAny>, value: &Bound<'py, PyAny>) -> PyResult<()> {
+        self.values.bind(key.py()).set_item(key, value)
+    }
+
+    fn __delitem__(&self, key: &Bound<'_, PyAny>) -> PyResult<()> {
+        self.values.bind(key.py()).del_item(key)
+    }
+}
+
+#[test]
+fn mapping() {
+    Python::with_gil(|py| {
+        PyMapping::register::<Mapping>(py).unwrap();
+
+        let inst = Py::new(
+            py,
+            Mapping {
+                values: PyDict::new_bound(py).into(),
+            },
+        )
+        .unwrap();
+
+        let mapping: &Bound<'_, PyMapping> = inst.bind(py).downcast().unwrap();
+
+        py_assert!(py, inst, "len(inst) == 0");
+
+        py_run!(py, inst, "inst['foo'] = 'foo'");
+        py_assert!(py, inst, "inst['foo'] == 'foo'");
+        py_run!(py, inst, "del inst['foo']");
+        py_expect_exception!(py, inst, "inst['foo']", PyKeyError);
+
+        // Default iteration will call __getitem__ with integer indices
+        // which fails with a KeyError
+        py_expect_exception!(py, inst, "[*inst] == []", PyKeyError, "0");
+
+        // check mapping protocol
+        assert_eq!(mapping.len().unwrap(), 0);
+
+        mapping.set_item(0, 5).unwrap();
+        assert_eq!(mapping.len().unwrap(), 1);
+
+        assert_eq!(mapping.get_item(0).unwrap().extract::<u8>().unwrap(), 5);
+
+        mapping.del_item(0).unwrap();
+        assert_eq!(mapping.len().unwrap(), 0);
+    });
+}
+
+#[derive(FromPyObject)]
+enum SequenceIndex<'py> {
+    Integer(isize),
+    Slice(Bound<'py, PySlice>),
+}
+
+#[pyclass]
+pub struct Sequence {
+    values: Vec<PyObject>,
+}
+
+#[pymethods]
+impl Sequence {
+    fn __len__(&self) -> usize {
+        self.values.len()
+    }
+
+    fn __getitem__(&self, index: SequenceIndex<'_>, py: Python<'_>) -> PyResult<PyObject> {
+        match index {
+            SequenceIndex::Integer(index) => {
+                let uindex = self.usize_index(index)?;
+                self.values
+                    .get(uindex)
+                    .map(|o| o.clone_ref(py))
+                    .ok_or_else(|| PyIndexError::new_err(index))
+            }
+            // Just to prove that slicing can be implemented
+            SequenceIndex::Slice(s) => Ok(s.into()),
+        }
+    }
+
+    fn __setitem__(&mut self, index: isize, value: PyObject) -> PyResult<()> {
+        let uindex = self.usize_index(index)?;
+        self.values
+            .get_mut(uindex)
+            .map(|place| *place = value)
+            .ok_or_else(|| PyIndexError::new_err(index))
+    }
+
+    fn __delitem__(&mut self, index: isize) -> PyResult<()> {
+        let uindex = self.usize_index(index)?;
+        if uindex >= self.values.len() {
+            Err(PyIndexError::new_err(index))
+        } else {
+            self.values.remove(uindex);
+            Ok(())
+        }
+    }
+
+    fn append(&mut self, value: PyObject) {
+        self.values.push(value);
+    }
+}
+
+impl Sequence {
+    fn usize_index(&self, index: isize) -> PyResult<usize> {
+        if index < 0 {
+            let corrected_index = index + self.values.len() as isize;
+            if corrected_index < 0 {
+                Err(PyIndexError::new_err(index))
+            } else {
+                Ok(corrected_index as usize)
+            }
+        } else {
+            Ok(index as usize)
+        }
+    }
+}
+
+#[test]
+fn sequence() {
+    Python::with_gil(|py| {
+        PySequence::register::<Sequence>(py).unwrap();
+
+        let inst = Py::new(py, Sequence { values: vec![] }).unwrap();
+
+        let sequence: &Bound<'_, PySequence> = inst.bind(py).downcast().unwrap();
+
+        py_assert!(py, inst, "len(inst) == 0");
+
+        py_expect_exception!(py, inst, "inst[0]", PyIndexError);
+        py_run!(py, inst, "inst.append('foo')");
+
+        py_assert!(py, inst, "inst[0] == 'foo'");
+        py_assert!(py, inst, "inst[-1] == 'foo'");
+
+        py_expect_exception!(py, inst, "inst[1]", PyIndexError);
+        py_expect_exception!(py, inst, "inst[-2]", PyIndexError);
+
+        py_assert!(py, inst, "[*inst] == ['foo']");
+
+        py_run!(py, inst, "del inst[0]");
+
+        py_expect_exception!(py, inst, "inst['foo']", PyTypeError);
+
+        py_assert!(py, inst, "inst[0:2] == slice(0, 2)");
+
+        // check sequence protocol
+
+        // we don't implement sequence length so that CPython doesn't attempt to correct negative
+        // indices.
+        assert!(sequence.len().is_err());
+        // however regular python len() works thanks to mp_len slot
+        assert_eq!(inst.bind(py).len().unwrap(), 0);
+
+        py_run!(py, inst, "inst.append(0)");
+        sequence.set_item(0, 5).unwrap();
+        assert_eq!(inst.bind(py).len().unwrap(), 1);
+
+        assert_eq!(sequence.get_item(0).unwrap().extract::<u8>().unwrap(), 5);
+        sequence.del_item(0).unwrap();
+
+        assert_eq!(inst.bind(py).len().unwrap(), 0);
+    });
+}
+
+#[pyclass]
+struct Iterator {
+    iter: Box<dyn iter::Iterator<Item = i32> + Send>,
+}
+
+#[pymethods]
+impl Iterator {
+    fn __iter__(slf: PyRef<'_, Self>) -> PyRef<'_, Self> {
+        slf
+    }
+
+    fn __next__(mut slf: PyRefMut<'_, Self>) -> Option<i32> {
+        slf.iter.next()
+    }
+}
+
+#[test]
+fn iterator() {
+    Python::with_gil(|py| {
+        let inst = Py::new(
+            py,
+            Iterator {
+                iter: Box::new(5..8),
+            },
+        )
+        .unwrap();
+        py_assert!(py, inst, "iter(inst) is inst");
+        py_assert!(py, inst, "list(inst) == [5, 6, 7]");
+    });
+}
+
+#[pyclass]
+struct Callable;
+
+#[pymethods]
+impl Callable {
+    fn __call__(&self, arg: i32) -> i32 {
+        arg * 6
+    }
+}
+
+#[pyclass]
+struct NotCallable;
+
+#[test]
+fn callable() {
+    Python::with_gil(|py| {
+        let c = Py::new(py, Callable).unwrap();
+        py_assert!(py, c, "callable(c)");
+        py_assert!(py, c, "c(7) == 42");
+
+        let nc = Py::new(py, NotCallable).unwrap();
+        py_assert!(py, nc, "not callable(nc)");
+    });
+}
+
+#[pyclass]
+#[derive(Debug)]
+struct SetItem {
+    key: i32,
+    val: i32,
+}
+
+#[pymethods]
+impl SetItem {
+    fn __setitem__(&mut self, key: i32, val: i32) {
+        self.key = key;
+        self.val = val;
+    }
+}
+
+#[test]
+fn setitem() {
+    Python::with_gil(|py| {
+        let c = Bound::new(py, SetItem { key: 0, val: 0 }).unwrap();
+        py_run!(py, c, "c[1] = 2");
+        {
+            let c = c.borrow();
+            assert_eq!(c.key, 1);
+            assert_eq!(c.val, 2);
+        }
+        py_expect_exception!(py, c, "del c[1]", PyNotImplementedError);
+    });
+}
+
+#[pyclass]
+struct DelItem {
+    key: i32,
+}
+
+#[pymethods]
+impl DelItem {
+    fn __delitem__(&mut self, key: i32) {
+        self.key = key;
+    }
+}
+
+#[test]
+fn delitem() {
+    Python::with_gil(|py| {
+        let c = Bound::new(py, DelItem { key: 0 }).unwrap();
+        py_run!(py, c, "del c[1]");
+        {
+            let c = c.borrow();
+            assert_eq!(c.key, 1);
+        }
+        py_expect_exception!(py, c, "c[1] = 2", PyNotImplementedError);
+    });
+}
+
+#[pyclass]
+struct SetDelItem {
+    val: Option<i32>,
+}
+
+#[pymethods]
+impl SetDelItem {
+    fn __setitem__(&mut self, _key: i32, val: i32) {
+        self.val = Some(val);
+    }
+
+    fn __delitem__(&mut self, _key: i32) {
+        self.val = None;
+    }
+}
+
+#[test]
+fn setdelitem() {
+    Python::with_gil(|py| {
+        let c = Bound::new(py, SetDelItem { val: None }).unwrap();
+        py_run!(py, c, "c[1] = 2");
+        {
+            let c = c.borrow();
+            assert_eq!(c.val, Some(2));
+        }
+        py_run!(py, c, "del c[1]");
+        let c = c.borrow();
+        assert_eq!(c.val, None);
+    });
+}
+
+#[pyclass]
+struct Contains {}
+
+#[pymethods]
+impl Contains {
+    fn __contains__(&self, item: i32) -> bool {
+        item >= 0
+    }
+}
+
+#[test]
+fn contains() {
+    Python::with_gil(|py| {
+        let c = Py::new(py, Contains {}).unwrap();
+        py_run!(py, c, "assert 1 in c");
+        py_run!(py, c, "assert -1 not in c");
+        py_expect_exception!(py, c, "assert 'wrong type' not in c", PyTypeError);
+    });
+}
+
+#[pyclass]
+struct GetItem {}
+
+#[pymethods]
+impl GetItem {
+    fn __getitem__(&self, idx: &Bound<'_, PyAny>) -> PyResult<&'static str> {
+        if let Ok(slice) = idx.downcast::<PySlice>() {
+            let indices = slice.indices(1000)?;
+            if indices.start == 100 && indices.stop == 200 && indices.step == 1 {
+                return Ok("slice");
+            }
+        } else if let Ok(idx) = idx.extract::<isize>() {
+            if idx == 1 {
+                return Ok("int");
+            }
+        }
+        Err(PyValueError::new_err("error"))
+    }
+}
+
+#[test]
+fn test_getitem() {
+    Python::with_gil(|py| {
+        let ob = Py::new(py, GetItem {}).unwrap();
+
+        py_assert!(py, ob, "ob[1] == 'int'");
+        py_assert!(py, ob, "ob[100:200:1] == 'slice'");
+    });
+}
+
+#[pyclass]
+struct ClassWithGetAttr {
+    #[pyo3(get, set)]
+    data: u32,
+}
+
+#[pymethods]
+impl ClassWithGetAttr {
+    fn __getattr__(&self, _name: &str) -> u32 {
+        self.data * 2
+    }
+}
+
+#[test]
+fn getattr_doesnt_override_member() {
+    Python::with_gil(|py| {
+        let inst = Py::new(py, ClassWithGetAttr { data: 4 }).unwrap();
+        py_assert!(py, inst, "inst.data == 4");
+        py_assert!(py, inst, "inst.a == 8");
+    });
+}
+
+#[pyclass]
+struct ClassWithGetAttribute {
+    #[pyo3(get, set)]
+    data: u32,
+}
+
+#[pymethods]
+impl ClassWithGetAttribute {
+    fn __getattribute__(&self, _name: &str) -> u32 {
+        self.data * 2
+    }
+}
+
+#[test]
+fn getattribute_overrides_member() {
+    Python::with_gil(|py| {
+        let inst = Py::new(py, ClassWithGetAttribute { data: 4 }).unwrap();
+        py_assert!(py, inst, "inst.data == 8");
+        py_assert!(py, inst, "inst.y == 8");
+    });
+}
+
+#[pyclass]
+struct ClassWithGetAttrAndGetAttribute;
+
+#[pymethods]
+impl ClassWithGetAttrAndGetAttribute {
+    fn __getattribute__(&self, name: &str) -> PyResult<u32> {
+        if name == "exists" {
+            Ok(42)
+        } else if name == "error" {
+            Err(PyValueError::new_err("bad"))
+        } else {
+            Err(PyAttributeError::new_err("fallback"))
+        }
+    }
+
+    fn __getattr__(&self, name: &str) -> PyResult<u32> {
+        if name == "lucky" {
+            Ok(57)
+        } else {
+            Err(PyAttributeError::new_err("no chance"))
+        }
+    }
+}
+
+#[test]
+fn getattr_and_getattribute() {
+    Python::with_gil(|py| {
+        let inst = Py::new(py, ClassWithGetAttrAndGetAttribute).unwrap();
+        py_assert!(py, inst, "inst.exists == 42");
+        py_assert!(py, inst, "inst.lucky == 57");
+        py_expect_exception!(py, inst, "inst.error", PyValueError);
+        py_expect_exception!(py, inst, "inst.unlucky", PyAttributeError);
+    });
+}
+
+/// Wraps a Python future and yield it once.
+#[pyclass]
+#[derive(Debug)]
+struct OnceFuture {
+    future: PyObject,
+    polled: bool,
+}
+
+#[pymethods]
+impl OnceFuture {
+    #[new]
+    fn new(future: PyObject) -> Self {
+        OnceFuture {
+            future,
+            polled: false,
+        }
+    }
+
+    fn __await__(slf: PyRef<'_, Self>) -> PyRef<'_, Self> {
+        slf
+    }
+
+    fn __iter__(slf: PyRef<'_, Self>) -> PyRef<'_, Self> {
+        slf
+    }
+    fn __next__<'py>(&mut self, py: Python<'py>) -> Option<&Bound<'py, PyAny>> {
+        if !self.polled {
+            self.polled = true;
+            Some(self.future.bind(py))
+        } else {
+            None
+        }
+    }
+}
+
+#[test]
+#[cfg(not(target_arch = "wasm32"))] // Won't work without wasm32 event loop (e.g., Pyodide has WebLoop)
+fn test_await() {
+    Python::with_gil(|py| {
+        let once = py.get_type_bound::<OnceFuture>();
+        let source = r#"
+import asyncio
+import sys
+
+async def main():
+    res = await Once(await asyncio.sleep(0.1))
+    assert res is None
+
+# For an odd error similar to https://bugs.python.org/issue38563
+if sys.platform == "win32" and sys.version_info >= (3, 8, 0):
+    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
+
+asyncio.run(main())
+"#;
+        let globals = PyModule::import_bound(py, "__main__").unwrap().dict();
+        globals.set_item("Once", once).unwrap();
+        py.run_bound(source, Some(&globals), None)
+            .map_err(|e| e.display(py))
+            .unwrap();
+    });
+}
+
+#[pyclass]
+struct AsyncIterator {
+    future: Option<Py<OnceFuture>>,
+}
+
+#[pymethods]
+impl AsyncIterator {
+    #[new]
+    fn new(future: Py<OnceFuture>) -> Self {
+        Self {
+            future: Some(future),
+        }
+    }
+
+    fn __aiter__(slf: PyRef<'_, Self>) -> PyRef<'_, Self> {
+        slf
+    }
+
+    fn __anext__(&mut self) -> Option<Py<OnceFuture>> {
+        self.future.take()
+    }
+}
+
+#[test]
+#[cfg(not(target_arch = "wasm32"))] // Won't work without wasm32 event loop (e.g., Pyodide has WebLoop)
+fn test_anext_aiter() {
+    Python::with_gil(|py| {
+        let once = py.get_type_bound::<OnceFuture>();
+        let source = r#"
+import asyncio
+import sys
+
+async def main():
+    count = 0
+    async for result in AsyncIterator(Once(await asyncio.sleep(0.1))):
+        # The Once is awaited as part of the `async for` and produces None
+        assert result is None
+        count +=1
+    assert count == 1
+
+# For an odd error similar to https://bugs.python.org/issue38563
+if sys.platform == "win32" and sys.version_info >= (3, 8, 0):
+    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
+
+asyncio.run(main())
+"#;
+        let globals = PyModule::import_bound(py, "__main__").unwrap().dict();
+        globals.set_item("Once", once).unwrap();
+        globals
+            .set_item("AsyncIterator", py.get_type_bound::<AsyncIterator>())
+            .unwrap();
+        py.run_bound(source, Some(&globals), None)
+            .map_err(|e| e.display(py))
+            .unwrap();
+    });
+}
+
+/// Increment the count when `__get__` is called.
+#[pyclass]
+struct DescrCounter {
+    #[pyo3(get)]
+    count: usize,
+}
+
+#[pymethods]
+impl DescrCounter {
+    #[new]
+    fn new() -> Self {
+        DescrCounter { count: 0 }
+    }
+    /// Each access will increase the count
+    fn __get__<'a>(
+        mut slf: PyRefMut<'a, Self>,
+        _instance: &Bound<'_, PyAny>,
+        _owner: Option<&Bound<'_, PyType>>,
+    ) -> PyRefMut<'a, Self> {
+        slf.count += 1;
+        slf
+    }
+    /// Allow assigning a new counter to the descriptor, copying the count across
+    fn __set__(&self, _instance: &Bound<'_, PyAny>, new_value: &mut Self) {
+        new_value.count = self.count;
+    }
+    /// Delete to reset the counter
+    fn __delete__(&mut self, _instance: &Bound<'_, PyAny>) {
+        self.count = 0;
+    }
+}
+
+#[test]
+fn descr_getset() {
+    Python::with_gil(|py| {
+        let counter = py.get_type_bound::<DescrCounter>();
+        let source = pyo3::indoc::indoc!(
+            r#"
+class Class:
+    counter = Counter()
+
+# access via type
+counter = Class.counter
+assert counter.count == 1
+
+# access with instance directly
+assert Counter.__get__(counter, Class()).count == 2
+
+# access via instance
+c = Class()
+assert c.counter.count == 3
+
+# __set__
+c.counter = Counter()
+assert c.counter.count == 4
+
+# __delete__
+del c.counter
+assert c.counter.count == 1
+"#
+        );
+        let globals = PyModule::import_bound(py, "__main__").unwrap().dict();
+        globals.set_item("Counter", counter).unwrap();
+        py.run_bound(source, Some(&globals), None)
+            .map_err(|e| e.display(py))
+            .unwrap();
+    });
+}
+
+#[pyclass]
+struct NotHashable;
+
+#[pymethods]
+impl NotHashable {
+    #[classattr]
+    const __hash__: Option<PyObject> = None;
+}
+
+#[test]
+fn test_hash_opt_out() {
+    // By default Python provides a hash implementation, which can be disabled by setting __hash__
+    // to None.
+    Python::with_gil(|py| {
+        let empty = Py::new(py, EmptyClass).unwrap();
+        py_assert!(py, empty, "hash(empty) is not None");
+
+        let not_hashable = Py::new(py, NotHashable).unwrap();
+        py_expect_exception!(py, not_hashable, "hash(not_hashable)", PyTypeError);
+    })
+}
+
+/// Class with __iter__ gets default contains from CPython.
+#[pyclass]
+struct DefaultedContains;
+
+#[pymethods]
+impl DefaultedContains {
+    fn __iter__(&self, py: Python<'_>) -> PyObject {
+        PyList::new_bound(py, ["a", "b", "c"])
+            .as_ref()
+            .iter()
+            .unwrap()
+            .into()
+    }
+}
+
+#[pyclass]
+struct NoContains;
+
+#[pymethods]
+impl NoContains {
+    fn __iter__(&self, py: Python<'_>) -> PyObject {
+        PyList::new_bound(py, ["a", "b", "c"])
+            .as_ref()
+            .iter()
+            .unwrap()
+            .into()
+    }
+
+    // Equivalent to the opt-out const form in NotHashable above, just more verbose, to confirm this
+    // also works.
+    #[classattr]
+    fn __contains__() -> Option<PyObject> {
+        None
+    }
+}
+
+#[test]
+fn test_contains_opt_out() {
+    Python::with_gil(|py| {
+        let defaulted_contains = Py::new(py, DefaultedContains).unwrap();
+        py_assert!(py, defaulted_contains, "'a' in defaulted_contains");
+
+        let no_contains = Py::new(py, NoContains).unwrap();
+        py_expect_exception!(py, no_contains, "'a' in no_contains", PyTypeError);
+    })
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_pyfunction.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_pyfunction.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_pyfunction.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_pyfunction.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,605 @@
+#![cfg(feature = "macros")]
+
+use std::collections::HashMap;
+
+#[cfg(not(Py_LIMITED_API))]
+use pyo3::buffer::PyBuffer;
+use pyo3::ffi::c_str;
+use pyo3::prelude::*;
+#[cfg(not(Py_LIMITED_API))]
+use pyo3::types::PyDateTime;
+#[cfg(not(any(Py_LIMITED_API, PyPy)))]
+use pyo3::types::PyFunction;
+use pyo3::types::{self, PyCFunction};
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyfunction(name = "struct")]
+fn struct_function() {}
+
+#[test]
+fn test_rust_keyword_name() {
+    Python::with_gil(|py| {
+        let f = wrap_pyfunction_bound!(struct_function)(py).unwrap();
+
+        py_assert!(py, f, "f.__name__ == 'struct'");
+    });
+}
+
+#[pyfunction(signature = (arg = true))]
+fn optional_bool(arg: Option<bool>) -> String {
+    format!("{:?}", arg)
+}
+
+#[test]
+fn test_optional_bool() {
+    // Regression test for issue #932
+    Python::with_gil(|py| {
+        let f = wrap_pyfunction_bound!(optional_bool)(py).unwrap();
+
+        py_assert!(py, f, "f() == 'Some(true)'");
+        py_assert!(py, f, "f(True) == 'Some(true)'");
+        py_assert!(py, f, "f(False) == 'Some(false)'");
+        py_assert!(py, f, "f(None) == 'None'");
+    });
+}
+
+#[cfg(not(Py_LIMITED_API))]
+#[pyfunction]
+fn buffer_inplace_add(py: Python<'_>, x: PyBuffer<i32>, y: PyBuffer<i32>) {
+    let x = x.as_mut_slice(py).unwrap();
+    let y = y.as_slice(py).unwrap();
+    for (xi, yi) in x.iter().zip(y) {
+        let xi_plus_yi = xi.get() + yi.get();
+        xi.set(xi_plus_yi);
+    }
+}
+
+#[cfg(not(Py_LIMITED_API))]
+#[test]
+fn test_buffer_add() {
+    Python::with_gil(|py| {
+        let f = wrap_pyfunction_bound!(buffer_inplace_add)(py).unwrap();
+
+        py_expect_exception!(
+            py,
+            f,
+            r#"
+import array
+a = array.array("i", [0, 1, 2, 3])
+b = array.array("I", [0, 1, 2, 3])
+f(a, b)
+"#,
+            PyBufferError
+        );
+
+        pyo3::py_run!(
+            py,
+            f,
+            r#"
+import array
+a = array.array("i", [0, 1, 2, 3])
+b = array.array("i", [2, 3, 4, 5])
+f(a, b)
+assert a, array.array("i", [2, 4, 6, 8])
+"#
+        );
+    });
+}
+
+#[cfg(not(any(Py_LIMITED_API, PyPy)))]
+#[pyfunction]
+fn function_with_pyfunction_arg<'py>(fun: &Bound<'py, PyFunction>) -> PyResult<Bound<'py, PyAny>> {
+    fun.call((), None)
+}
+
+#[pyfunction]
+fn function_with_pycfunction_arg<'py>(
+    fun: &Bound<'py, PyCFunction>,
+) -> PyResult<Bound<'py, PyAny>> {
+    fun.call((), None)
+}
+
+#[test]
+fn test_functions_with_function_args() {
+    Python::with_gil(|py| {
+        let py_cfunc_arg = wrap_pyfunction_bound!(function_with_pycfunction_arg)(py).unwrap();
+        let bool_to_string = wrap_pyfunction_bound!(optional_bool)(py).unwrap();
+
+        pyo3::py_run!(
+            py,
+            py_cfunc_arg
+            bool_to_string,
+            r#"
+        assert py_cfunc_arg(bool_to_string) == "Some(true)"
+        "#
+        );
+
+        #[cfg(not(any(Py_LIMITED_API, PyPy)))]
+        {
+            let py_func_arg = wrap_pyfunction_bound!(function_with_pyfunction_arg)(py).unwrap();
+
+            pyo3::py_run!(
+                py,
+                py_func_arg,
+                r#"
+            def foo(): return "bar"
+            assert py_func_arg(foo) == "bar"
+            "#
+            );
+        }
+    });
+}
+
+#[cfg(not(Py_LIMITED_API))]
+fn datetime_to_timestamp(dt: &Bound<'_, PyAny>) -> PyResult<i64> {
+    let dt = dt.downcast::<PyDateTime>()?;
+    let ts: f64 = dt.call_method0("timestamp")?.extract()?;
+
+    Ok(ts as i64)
+}
+
+#[cfg(not(Py_LIMITED_API))]
+#[pyfunction]
+fn function_with_custom_conversion(
+    #[pyo3(from_py_with = "datetime_to_timestamp")] timestamp: i64,
+) -> i64 {
+    timestamp
+}
+
+#[cfg(not(Py_LIMITED_API))]
+#[test]
+fn test_function_with_custom_conversion() {
+    Python::with_gil(|py| {
+        let custom_conv_func = wrap_pyfunction_bound!(function_with_custom_conversion)(py).unwrap();
+
+        pyo3::py_run!(
+            py,
+            custom_conv_func,
+            r#"
+        import datetime
+
+        dt = datetime.datetime.fromtimestamp(1612040400)
+        assert custom_conv_func(dt) == 1612040400
+        "#
+        )
+    });
+}
+
+#[cfg(not(Py_LIMITED_API))]
+#[test]
+fn test_function_with_custom_conversion_error() {
+    Python::with_gil(|py| {
+        let custom_conv_func = wrap_pyfunction_bound!(function_with_custom_conversion)(py).unwrap();
+
+        py_expect_exception!(
+            py,
+            custom_conv_func,
+            "custom_conv_func(['a'])",
+            PyTypeError,
+            "argument 'timestamp': 'list' object cannot be converted to 'PyDateTime'"
+        );
+    });
+}
+
+#[test]
+fn test_from_py_with_defaults() {
+    fn optional_int(x: &Bound<'_, PyAny>) -> PyResult<Option<i32>> {
+        if x.is_none() {
+            Ok(None)
+        } else {
+            Some(x.extract()).transpose()
+        }
+    }
+
+    // issue 2280 combination of from_py_with and Option<T> did not compile
+    #[pyfunction]
+    #[pyo3(signature = (int=None))]
+    fn from_py_with_option(#[pyo3(from_py_with = "optional_int")] int: Option<i32>) -> i32 {
+        int.unwrap_or(0)
+    }
+
+    #[pyfunction(signature = (len=0))]
+    fn from_py_with_default(
+        #[pyo3(from_py_with = "<Bound<'_, _> as PyAnyMethods>::len")] len: usize,
+    ) -> usize {
+        len
+    }
+
+    Python::with_gil(|py| {
+        let f = wrap_pyfunction_bound!(from_py_with_option)(py).unwrap();
+
+        assert_eq!(f.call0().unwrap().extract::<i32>().unwrap(), 0);
+        assert_eq!(f.call1((123,)).unwrap().extract::<i32>().unwrap(), 123);
+        assert_eq!(f.call1((999,)).unwrap().extract::<i32>().unwrap(), 999);
+
+        let f2 = wrap_pyfunction_bound!(from_py_with_default)(py).unwrap();
+
+        assert_eq!(f2.call0().unwrap().extract::<usize>().unwrap(), 0);
+        assert_eq!(f2.call1(("123",)).unwrap().extract::<usize>().unwrap(), 3);
+        assert_eq!(f2.call1(("1234",)).unwrap().extract::<usize>().unwrap(), 4);
+    });
+}
+
+#[pyclass]
+#[derive(Debug, FromPyObject)]
+struct ValueClass {
+    #[pyo3(get)]
+    value: usize,
+}
+
+#[pyfunction]
+#[pyo3(signature=(str_arg, int_arg, tuple_arg, option_arg = None, struct_arg = None))]
+fn conversion_error(
+    str_arg: &str,
+    int_arg: i64,
+    tuple_arg: (String, f64),
+    option_arg: Option<i64>,
+    struct_arg: Option<ValueClass>,
+) {
+    println!(
+        "{:?} {:?} {:?} {:?} {:?}",
+        str_arg, int_arg, tuple_arg, option_arg, struct_arg
+    );
+}
+
+#[test]
+fn test_conversion_error() {
+    Python::with_gil(|py| {
+        let conversion_error = wrap_pyfunction_bound!(conversion_error)(py).unwrap();
+        py_expect_exception!(
+            py,
+            conversion_error,
+            "conversion_error(None, None, None, None, None)",
+            PyTypeError,
+            "argument 'str_arg': 'NoneType' object cannot be converted to 'PyString'"
+        );
+        py_expect_exception!(
+            py,
+            conversion_error,
+            "conversion_error(100, None, None, None, None)",
+            PyTypeError,
+            "argument 'str_arg': 'int' object cannot be converted to 'PyString'"
+        );
+        py_expect_exception!(
+            py,
+            conversion_error,
+            "conversion_error('string1', 'string2', None, None, None)",
+            PyTypeError,
+            "argument 'int_arg': 'str' object cannot be interpreted as an integer"
+        );
+        py_expect_exception!(
+            py,
+            conversion_error,
+            "conversion_error('string1', -100, 'string2', None, None)",
+            PyTypeError,
+            "argument 'tuple_arg': 'str' object cannot be converted to 'PyTuple'"
+        );
+        py_expect_exception!(
+            py,
+            conversion_error,
+            "conversion_error('string1', -100, ('string2', 10.), 'string3', None)",
+            PyTypeError,
+            "argument 'option_arg': 'str' object cannot be interpreted as an integer"
+        );
+        let exception = py_expect_exception!(
+            py,
+            conversion_error,
+            "
+class ValueClass:
+    def __init__(self, value):
+        self.value = value
+conversion_error('string1', -100, ('string2', 10.), None, ValueClass(\"no_expected_type\"))",
+            PyTypeError
+        );
+        assert_eq!(
+            extract_traceback(py, exception),
+            "TypeError: argument 'struct_arg': failed to \
+    extract field ValueClass.value: TypeError: 'str' object cannot be interpreted as an integer"
+        );
+
+        let exception = py_expect_exception!(
+            py,
+            conversion_error,
+            "
+class ValueClass:
+    def __init__(self, value):
+        self.value = value
+conversion_error('string1', -100, ('string2', 10.), None, ValueClass(-5))",
+            PyTypeError
+        );
+        assert_eq!(
+            extract_traceback(py, exception),
+            "TypeError: argument 'struct_arg': failed to \
+    extract field ValueClass.value: OverflowError: can't convert negative int to unsigned"
+        );
+    });
+}
+
+/// Helper function that concatenates the error message from
+/// each error in the traceback into a single string that can
+/// be tested.
+fn extract_traceback(py: Python<'_>, mut error: PyErr) -> String {
+    let mut error_msg = error.to_string();
+    while let Some(cause) = error.cause(py) {
+        error_msg.push_str(": ");
+        error_msg.push_str(&cause.to_string());
+        error = cause
+    }
+    error_msg
+}
+
+#[test]
+fn test_pycfunction_new() {
+    use pyo3::ffi;
+
+    Python::with_gil(|py| {
+        unsafe extern "C" fn c_fn(
+            _self: *mut ffi::PyObject,
+            _args: *mut ffi::PyObject,
+        ) -> *mut ffi::PyObject {
+            ffi::PyLong_FromLong(4200)
+        }
+
+        let py_fn = PyCFunction::new_bound(
+            py,
+            c_fn,
+            c_str!("py_fn"),
+            c_str!("py_fn for test (this is the docstring)"),
+            None,
+        )
+        .unwrap();
+
+        py_assert!(py, py_fn, "py_fn() == 4200");
+        py_assert!(
+            py,
+            py_fn,
+            "py_fn.__doc__ == 'py_fn for test (this is the docstring)'"
+        );
+    });
+}
+
+#[test]
+fn test_pycfunction_new_with_keywords() {
+    use pyo3::ffi;
+    use std::ffi::CString;
+    use std::os::raw::{c_char, c_long};
+    use std::ptr;
+
+    Python::with_gil(|py| {
+        unsafe extern "C" fn c_fn(
+            _self: *mut ffi::PyObject,
+            args: *mut ffi::PyObject,
+            kwds: *mut ffi::PyObject,
+        ) -> *mut ffi::PyObject {
+            let mut foo: c_long = 0;
+            let mut bar: c_long = 0;
+            let foo_ptr: *mut c_long = &mut foo;
+            let bar_ptr: *mut c_long = &mut bar;
+
+            let foo_name = CString::new("foo").unwrap();
+            let foo_name_raw: *mut c_char = foo_name.into_raw();
+            let kw_bar_name = CString::new("kw_bar").unwrap();
+            let kw_bar_name_raw: *mut c_char = kw_bar_name.into_raw();
+
+            let mut arglist = vec![foo_name_raw, kw_bar_name_raw, ptr::null_mut()];
+            let arglist_ptr: *mut *mut c_char = arglist.as_mut_ptr();
+
+            let arg_pattern: *const c_char = CString::new("l|l").unwrap().into_raw();
+
+            ffi::PyArg_ParseTupleAndKeywords(
+                args,
+                kwds,
+                arg_pattern,
+                arglist_ptr,
+                foo_ptr,
+                bar_ptr,
+            );
+
+            ffi::PyLong_FromLong(foo * bar)
+        }
+
+        let py_fn = PyCFunction::new_with_keywords_bound(
+            py,
+            c_fn,
+            c_str!("py_fn"),
+            c_str!("py_fn for test (this is the docstring)"),
+            None,
+        )
+        .unwrap();
+
+        py_assert!(py, py_fn, "py_fn(42, kw_bar=100) == 4200");
+        py_assert!(py, py_fn, "py_fn(foo=42, kw_bar=100) == 4200");
+        py_assert!(
+            py,
+            py_fn,
+            "py_fn.__doc__ == 'py_fn for test (this is the docstring)'"
+        );
+    });
+}
+
+#[test]
+fn test_closure() {
+    Python::with_gil(|py| {
+        let f = |args: &Bound<'_, types::PyTuple>,
+                 _kwargs: Option<&Bound<'_, types::PyDict>>|
+         -> PyResult<_> {
+            Python::with_gil(|py| {
+                let res: Vec<_> = args
+                    .iter()
+                    .map(|elem| {
+                        if let Ok(i) = elem.extract::<i64>() {
+                            (i + 1).into_py(py)
+                        } else if let Ok(f) = elem.extract::<f64>() {
+                            (2. * f).into_py(py)
+                        } else if let Ok(mut s) = elem.extract::<String>() {
+                            s.push_str("-py");
+                            s.into_py(py)
+                        } else {
+                            panic!("unexpected argument type for {:?}", elem)
+                        }
+                    })
+                    .collect();
+                Ok(res)
+            })
+        };
+        let closure_py = PyCFunction::new_closure_bound(
+            py,
+            Some(c_str!("test_fn")),
+            Some(c_str!("test_fn doc")),
+            f,
+        )
+        .unwrap();
+
+        py_assert!(py, closure_py, "closure_py(42) == [43]");
+        py_assert!(py, closure_py, "closure_py.__name__ == 'test_fn'");
+        py_assert!(py, closure_py, "closure_py.__doc__ == 'test_fn doc'");
+        py_assert!(
+            py,
+            closure_py,
+            "closure_py(42, 3.14, 'foo') == [43, 6.28, 'foo-py']"
+        );
+    });
+}
+
+#[test]
+fn test_closure_counter() {
+    Python::with_gil(|py| {
+        let counter = std::cell::RefCell::new(0);
+        let counter_fn = move |_args: &Bound<'_, types::PyTuple>,
+                               _kwargs: Option<&Bound<'_, types::PyDict>>|
+              -> PyResult<i32> {
+            let mut counter = counter.borrow_mut();
+            *counter += 1;
+            Ok(*counter)
+        };
+        let counter_py = PyCFunction::new_closure_bound(py, None, None, counter_fn).unwrap();
+
+        py_assert!(py, counter_py, "counter_py() == 1");
+        py_assert!(py, counter_py, "counter_py() == 2");
+        py_assert!(py, counter_py, "counter_py() == 3");
+    });
+}
+
+#[test]
+fn use_pyfunction() {
+    mod function_in_module {
+        use pyo3::prelude::*;
+
+        #[pyfunction]
+        pub fn foo(x: i32) -> i32 {
+            x
+        }
+    }
+
+    Python::with_gil(|py| {
+        use function_in_module::foo;
+
+        // check imported name can be wrapped
+        let f = wrap_pyfunction_bound!(foo, py).unwrap();
+        assert_eq!(f.call1((5,)).unwrap().extract::<i32>().unwrap(), 5);
+        assert_eq!(f.call1((42,)).unwrap().extract::<i32>().unwrap(), 42);
+
+        // check path import can be wrapped
+        let f2 = wrap_pyfunction_bound!(function_in_module::foo, py).unwrap();
+        assert_eq!(f2.call1((5,)).unwrap().extract::<i32>().unwrap(), 5);
+        assert_eq!(f2.call1((42,)).unwrap().extract::<i32>().unwrap(), 42);
+    })
+}
+
+#[pyclass]
+struct Key(String);
+
+#[pyclass]
+struct Value(i32);
+
+#[pyfunction]
+fn return_value_borrows_from_arguments<'py>(
+    py: Python<'py>,
+    key: &'py Key,
+    value: &'py Value,
+) -> HashMap<&'py str, i32> {
+    py.allow_threads(move || {
+        let mut map = HashMap::new();
+        map.insert(key.0.as_str(), value.0);
+        map
+    })
+}
+
+#[test]
+fn test_return_value_borrows_from_arguments() {
+    Python::with_gil(|py| {
+        let function = wrap_pyfunction_bound!(return_value_borrows_from_arguments, py).unwrap();
+
+        let key = Py::new(py, Key("key".to_owned())).unwrap();
+        let value = Py::new(py, Value(42)).unwrap();
+
+        py_assert!(py, function key value, "function(key, value) == { \"key\": 42 }");
+    });
+}
+
+#[test]
+fn test_some_wrap_arguments() {
+    // https://github.com/PyO3/pyo3/issues/3460
+    const NONE: Option<u8> = None;
+    #[pyfunction(signature = (a = 1, b = Some(2), c = None, d = NONE))]
+    fn some_wrap_arguments(
+        a: Option<u8>,
+        b: Option<u8>,
+        c: Option<u8>,
+        d: Option<u8>,
+    ) -> [Option<u8>; 4] {
+        [a, b, c, d]
+    }
+
+    Python::with_gil(|py| {
+        let function = wrap_pyfunction_bound!(some_wrap_arguments, py).unwrap();
+        py_assert!(py, function, "function() == [1, 2, None, None]");
+    })
+}
+
+#[test]
+fn test_reference_to_bound_arguments() {
+    #[pyfunction]
+    #[pyo3(signature = (x, y = None))]
+    fn reference_args<'py>(
+        x: &Bound<'py, PyAny>,
+        y: Option<&Bound<'py, PyAny>>,
+    ) -> PyResult<Bound<'py, PyAny>> {
+        y.map_or_else(|| Ok(x.clone()), |y| y.add(x))
+    }
+
+    Python::with_gil(|py| {
+        let function = wrap_pyfunction_bound!(reference_args, py).unwrap();
+        py_assert!(py, function, "function(1) == 1");
+        py_assert!(py, function, "function(1, 2) == 3");
+    })
+}
+
+#[test]
+fn test_pyfunction_raw_ident() {
+    #[pyfunction]
+    fn r#struct() -> bool {
+        true
+    }
+
+    #[pyfunction]
+    #[pyo3(name = "r#enum")]
+    fn raw_ident() -> bool {
+        true
+    }
+
+    #[pymodule]
+    fn m(m: &Bound<'_, PyModule>) -> PyResult<()> {
+        m.add_function(wrap_pyfunction!(r#struct, m)?)?;
+        m.add_function(wrap_pyfunction!(raw_ident, m)?)?;
+        Ok(())
+    }
+
+    Python::with_gil(|py| {
+        let m = pyo3::wrap_pymodule!(m)(py);
+        py_assert!(py, m, "m.struct()");
+        py_assert!(py, m, "m.enum()");
+    })
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_pyself.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_pyself.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_pyself.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_pyself.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,126 @@
+#![cfg(feature = "macros")]
+
+//! Test slf: PyRef/PyMutRef<Self>(especially, slf.into::<Py>) works
+use pyo3::prelude::*;
+use pyo3::types::{PyBytes, PyString};
+use std::collections::HashMap;
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+/// Assumes it's a file reader or so.
+/// Inspired by https://github.com/jothan/cordoba, thanks.
+#[pyclass]
+#[derive(Clone, Debug)]
+struct Reader {
+    inner: HashMap<u8, String>,
+}
+
+#[pymethods]
+impl Reader {
+    fn clone_ref<'a, 'py>(slf: &'a Bound<'py, Self>) -> &'a Bound<'py, Self> {
+        slf
+    }
+    fn clone_ref_with_py<'a, 'py>(
+        slf: &'a Bound<'py, Self>,
+        _py: Python<'py>,
+    ) -> &'a Bound<'py, Self> {
+        slf
+    }
+    fn get_iter(slf: &Bound<'_, Self>, keys: Py<PyBytes>) -> Iter {
+        Iter {
+            reader: slf.clone().unbind(),
+            keys,
+            idx: 0,
+        }
+    }
+    fn get_iter_and_reset(
+        mut slf: PyRefMut<'_, Self>,
+        keys: Py<PyBytes>,
+        py: Python<'_>,
+    ) -> PyResult<Iter> {
+        let reader = Py::new(py, slf.clone())?;
+        slf.inner.clear();
+        Ok(Iter {
+            reader,
+            keys,
+            idx: 0,
+        })
+    }
+}
+
+#[pyclass]
+#[derive(Debug)]
+struct Iter {
+    reader: Py<Reader>,
+    keys: Py<PyBytes>,
+    idx: usize,
+}
+
+#[pymethods]
+impl Iter {
+    #[allow(clippy::self_named_constructors)]
+    fn __iter__(slf: PyRef<'_, Self>) -> PyRef<'_, Self> {
+        slf
+    }
+
+    fn __next__(mut slf: PyRefMut<'_, Self>) -> PyResult<Option<PyObject>> {
+        let bytes = slf.keys.bind(slf.py()).as_bytes();
+        match bytes.get(slf.idx) {
+            Some(&b) => {
+                slf.idx += 1;
+                let py = slf.py();
+                let reader = slf.reader.bind(py);
+                let reader_ref = reader.try_borrow()?;
+                let res = reader_ref
+                    .inner
+                    .get(&b)
+                    .map(|s| PyString::new_bound(py, s).into());
+                Ok(res)
+            }
+            None => Ok(None),
+        }
+    }
+}
+
+fn reader() -> Reader {
+    let reader = [(1, "a"), (2, "b"), (3, "c"), (4, "d"), (5, "e")];
+    Reader {
+        inner: reader.iter().map(|(k, v)| (*k, (*v).to_string())).collect(),
+    }
+}
+
+#[test]
+fn test_nested_iter() {
+    Python::with_gil(|py| {
+        let reader: PyObject = reader().into_py(py);
+        py_assert!(
+            py,
+            reader,
+            "list(reader.get_iter(bytes([3, 5, 2]))) == ['c', 'e', 'b']"
+        );
+    });
+}
+
+#[test]
+fn test_clone_ref() {
+    Python::with_gil(|py| {
+        let reader: PyObject = reader().into_py(py);
+        py_assert!(py, reader, "reader == reader.clone_ref()");
+        py_assert!(py, reader, "reader == reader.clone_ref_with_py()");
+    });
+}
+
+#[test]
+fn test_nested_iter_reset() {
+    Python::with_gil(|py| {
+        let reader = Bound::new(py, reader()).unwrap();
+        py_assert!(
+            py,
+            reader,
+            "list(reader.get_iter_and_reset(bytes([3, 5, 2]))) == ['c', 'e', 'b']"
+        );
+        let reader_ref = reader.borrow();
+        assert!(reader_ref.inner.is_empty());
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_sequence.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_sequence.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_sequence.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_sequence.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,359 @@
+#![cfg(feature = "macros")]
+
+use pyo3::exceptions::{PyIndexError, PyValueError};
+use pyo3::types::{IntoPyDict, PyList, PyMapping, PySequence};
+use pyo3::{ffi, prelude::*};
+
+use pyo3::py_run;
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyclass]
+struct ByteSequence {
+    elements: Vec<u8>,
+}
+
+#[pymethods]
+impl ByteSequence {
+    #[new]
+    #[pyo3(signature=(elements = None))]
+    fn new(elements: Option<&Bound<'_, PyList>>) -> PyResult<Self> {
+        if let Some(pylist) = elements {
+            let mut elems = Vec::with_capacity(pylist.len());
+            for pyelem in pylist {
+                let elem = pyelem.extract()?;
+                elems.push(elem);
+            }
+            Ok(Self { elements: elems })
+        } else {
+            Ok(Self {
+                elements: Vec::new(),
+            })
+        }
+    }
+
+    fn __len__(&self) -> usize {
+        self.elements.len()
+    }
+
+    fn __getitem__(&self, idx: isize) -> PyResult<u8> {
+        self.elements
+            .get(idx as usize)
+            .copied()
+            .ok_or_else(|| PyIndexError::new_err("list index out of range"))
+    }
+
+    fn __setitem__(&mut self, idx: isize, value: u8) {
+        self.elements[idx as usize] = value;
+    }
+
+    fn __delitem__(&mut self, mut idx: isize) -> PyResult<()> {
+        let self_len = self.elements.len() as isize;
+        if idx < 0 {
+            idx += self_len;
+        }
+        if (idx < self_len) && (idx >= 0) {
+            self.elements.remove(idx as usize);
+            Ok(())
+        } else {
+            Err(PyIndexError::new_err("list index out of range"))
+        }
+    }
+
+    fn __contains__(&self, other: &Bound<'_, PyAny>) -> bool {
+        match other.extract::<u8>() {
+            Ok(x) => self.elements.contains(&x),
+            Err(_) => false,
+        }
+    }
+
+    fn __concat__(&self, other: &Self) -> Self {
+        let mut elements = self.elements.clone();
+        elements.extend_from_slice(&other.elements);
+        Self { elements }
+    }
+
+    fn __inplace_concat__(mut slf: PyRefMut<'_, Self>, other: &Self) -> Py<Self> {
+        slf.elements.extend_from_slice(&other.elements);
+        slf.into()
+    }
+
+    fn __repeat__(&self, count: isize) -> PyResult<Self> {
+        if count >= 0 {
+            let mut elements = Vec::with_capacity(self.elements.len() * count as usize);
+            for _ in 0..count {
+                elements.extend(&self.elements);
+            }
+            Ok(Self { elements })
+        } else {
+            Err(PyValueError::new_err("invalid repeat count"))
+        }
+    }
+
+    fn __inplace_repeat__(mut slf: PyRefMut<'_, Self>, count: isize) -> PyResult<Py<Self>> {
+        if count >= 0 {
+            let mut elements = Vec::with_capacity(slf.elements.len() * count as usize);
+            for _ in 0..count {
+                elements.extend(&slf.elements);
+            }
+            slf.elements = elements;
+            Ok(slf.into())
+        } else {
+            Err(PyValueError::new_err("invalid repeat count"))
+        }
+    }
+}
+
+/// Return a dict with `s = ByteSequence([1, 2, 3])`.
+fn seq_dict(py: Python<'_>) -> Bound<'_, pyo3::types::PyDict> {
+    let d = [("ByteSequence", py.get_type_bound::<ByteSequence>())].into_py_dict_bound(py);
+    // Though we can construct `s` in Rust, let's test `__new__` works.
+    py_run!(py, *d, "s = ByteSequence([1, 2, 3])");
+    d
+}
+
+#[test]
+fn test_getitem() {
+    Python::with_gil(|py| {
+        let d = seq_dict(py);
+
+        py_assert!(py, *d, "s[0] == 1");
+        py_assert!(py, *d, "s[1] == 2");
+        py_assert!(py, *d, "s[2] == 3");
+        py_expect_exception!(py, *d, "print(s[-4])", PyIndexError);
+        py_expect_exception!(py, *d, "print(s[4])", PyIndexError);
+    });
+}
+
+#[test]
+fn test_setitem() {
+    Python::with_gil(|py| {
+        let d = seq_dict(py);
+
+        py_run!(py, *d, "s[0] = 4; assert list(s) == [4, 2, 3]");
+        py_expect_exception!(py, *d, "s[0] = 'hello'", PyTypeError);
+    });
+}
+
+#[test]
+fn test_delitem() {
+    Python::with_gil(|py| {
+        let d = [("ByteSequence", py.get_type_bound::<ByteSequence>())].into_py_dict_bound(py);
+
+        py_run!(
+            py,
+            *d,
+            "s = ByteSequence([1, 2, 3]); del s[0]; assert list(s) == [2, 3]"
+        );
+        py_run!(
+            py,
+            *d,
+            "s = ByteSequence([1, 2, 3]); del s[1]; assert list(s) == [1, 3]"
+        );
+        py_run!(
+            py,
+            *d,
+            "s = ByteSequence([1, 2, 3]); del s[-1]; assert list(s) == [1, 2]"
+        );
+        py_run!(
+            py,
+            *d,
+            "s = ByteSequence([1, 2, 3]); del s[-2]; assert list(s) == [1, 3]"
+        );
+        py_expect_exception!(
+            py,
+            *d,
+            "s = ByteSequence([1, 2, 3]); del s[-4]; print(list(s))",
+            PyIndexError
+        );
+        py_expect_exception!(
+            py,
+            *d,
+            "s = ByteSequence([1, 2, 3]); del s[4]",
+            PyIndexError
+        );
+    });
+}
+
+#[test]
+fn test_contains() {
+    Python::with_gil(|py| {
+        let d = seq_dict(py);
+
+        py_assert!(py, *d, "1 in s");
+        py_assert!(py, *d, "2 in s");
+        py_assert!(py, *d, "3 in s");
+        py_assert!(py, *d, "4 not in s");
+        py_assert!(py, *d, "'hello' not in s");
+    });
+}
+
+#[test]
+fn test_concat() {
+    Python::with_gil(|py| {
+        let d = seq_dict(py);
+
+        py_run!(
+        py,
+        *d,
+        "s1 = ByteSequence([1, 2]); s2 = ByteSequence([3, 4]); assert list(s1 + s2) == [1, 2, 3, 4]"
+    );
+        py_expect_exception!(
+            py,
+            *d,
+            "s1 = ByteSequence([1, 2]); s2 = 'hello'; s1 + s2",
+            PyTypeError
+        );
+    });
+}
+
+#[test]
+fn test_inplace_concat() {
+    Python::with_gil(|py| {
+        let d = seq_dict(py);
+
+        py_run!(
+            py,
+            *d,
+            "s += ByteSequence([4, 5]); assert list(s) == [1, 2, 3, 4, 5]"
+        );
+        py_expect_exception!(py, *d, "s += 'hello'", PyTypeError);
+    });
+}
+
+#[test]
+fn test_repeat() {
+    Python::with_gil(|py| {
+        let d = seq_dict(py);
+
+        py_run!(py, *d, "s2 = s * 2; assert list(s2) == [1, 2, 3, 1, 2, 3]");
+        py_expect_exception!(py, *d, "s2 = s * -1", PyValueError);
+    });
+}
+
+#[test]
+fn test_inplace_repeat() {
+    Python::with_gil(|py| {
+        let d = [("ByteSequence", py.get_type_bound::<ByteSequence>())].into_py_dict_bound(py);
+
+        py_run!(
+            py,
+            *d,
+            "s = ByteSequence([1, 2]); s *= 3; assert list(s) == [1, 2, 1, 2, 1, 2]"
+        );
+        py_expect_exception!(py, *d, "s = ByteSequence([1, 2]); s *= -1", PyValueError);
+    });
+}
+
+// Check that #[pyo3(get, set)] works correctly for Vec<PyObject>
+
+#[pyclass]
+struct GenericList {
+    #[pyo3(get, set)]
+    items: Vec<PyObject>,
+}
+
+#[test]
+fn test_generic_list_get() {
+    Python::with_gil(|py| {
+        let list: PyObject = GenericList {
+            items: [1, 2, 3].iter().map(|i| i.to_object(py)).collect(),
+        }
+        .into_py(py);
+
+        py_assert!(py, list, "list.items == [1, 2, 3]");
+    });
+}
+
+#[test]
+fn test_generic_list_set() {
+    Python::with_gil(|py| {
+        let list = Bound::new(py, GenericList { items: vec![] }).unwrap();
+
+        py_run!(py, list, "list.items = [1, 2, 3]");
+        assert!(list
+            .borrow()
+            .items
+            .iter()
+            .zip(&[1u32, 2, 3])
+            .all(|(a, b)| a.bind(py).eq(b.into_py(py)).unwrap()));
+    });
+}
+
+#[pyclass(sequence)]
+struct OptionList {
+    #[pyo3(get, set)]
+    items: Vec<Option<i64>>,
+}
+
+#[pymethods]
+impl OptionList {
+    fn __len__(&self) -> usize {
+        self.items.len()
+    }
+
+    fn __getitem__(&self, idx: isize) -> PyResult<Option<i64>> {
+        match self.items.get(idx as usize) {
+            Some(x) => Ok(*x),
+            None => Err(PyIndexError::new_err("Index out of bounds")),
+        }
+    }
+}
+
+#[test]
+fn test_option_list_get() {
+    // Regression test for #798
+    Python::with_gil(|py| {
+        let list = Py::new(
+            py,
+            OptionList {
+                items: vec![Some(1), None],
+            },
+        )
+        .unwrap();
+
+        py_assert!(py, list, "list[0] == 1");
+        py_assert!(py, list, "list[1] == None");
+        py_expect_exception!(py, list, "list[2]", PyIndexError);
+    });
+}
+
+#[test]
+fn sequence_is_not_mapping() {
+    Python::with_gil(|py| {
+        let list = Bound::new(
+            py,
+            OptionList {
+                items: vec![Some(1), None],
+            },
+        )
+        .unwrap()
+        .into_any();
+
+        PySequence::register::<OptionList>(py).unwrap();
+
+        assert!(list.downcast::<PyMapping>().is_err());
+        assert!(list.downcast::<PySequence>().is_ok());
+    })
+}
+
+#[test]
+fn sequence_length() {
+    Python::with_gil(|py| {
+        let list = Bound::new(
+            py,
+            OptionList {
+                items: vec![Some(1), None],
+            },
+        )
+        .unwrap()
+        .into_any();
+
+        assert_eq!(list.len().unwrap(), 2);
+        assert_eq!(unsafe { ffi::PySequence_Length(list.as_ptr()) }, 2);
+
+        assert_eq!(unsafe { ffi::PyMapping_Length(list.as_ptr()) }, -1);
+        unsafe { ffi::PyErr_Clear() };
+    })
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_serde.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_serde.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_serde.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_serde.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,80 @@
+#[cfg(feature = "serde")]
+mod test_serde {
+    use pyo3::prelude::*;
+
+    use serde::{Deserialize, Serialize};
+
+    #[pyclass]
+    #[derive(Debug, Serialize, Deserialize)]
+    struct Group {
+        name: String,
+    }
+
+    #[pyclass]
+    #[derive(Debug, Serialize, Deserialize)]
+    struct User {
+        username: String,
+        group: Option<Py<Group>>,
+        friends: Vec<Py<User>>,
+    }
+
+    #[test]
+    fn test_serialize() {
+        let friend1 = User {
+            username: "friend 1".into(),
+            group: None,
+            friends: vec![],
+        };
+        let friend2 = User {
+            username: "friend 2".into(),
+            group: None,
+            friends: vec![],
+        };
+
+        let user = Python::with_gil(|py| {
+            let py_friend1 = Py::new(py, friend1).expect("failed to create friend 1");
+            let py_friend2 = Py::new(py, friend2).expect("failed to create friend 2");
+
+            let friends = vec![py_friend1, py_friend2];
+            let py_group = Py::new(
+                py,
+                Group {
+                    name: "group name".into(),
+                },
+            )
+            .unwrap();
+
+            User {
+                username: "danya".into(),
+                group: Some(py_group),
+                friends,
+            }
+        });
+
+        let serialized = serde_json::to_string(&user).expect("failed to serialize");
+        assert_eq!(
+            serialized,
+            r#"{"username":"danya","group":{"name":"group name"},"friends":[{"username":"friend 1","group":null,"friends":[]},{"username":"friend 2","group":null,"friends":[]}]}"#
+        );
+    }
+
+    #[test]
+    fn test_deserialize() {
+        let serialized = r#"{"username": "danya", "friends":
+        [{"username": "friend", "group": {"name": "danya's friends"}, "friends": []}]}"#;
+        let user: User = serde_json::from_str(serialized).expect("failed to deserialize");
+
+        assert_eq!(user.username, "danya");
+        assert!(user.group.is_none());
+        assert_eq!(user.friends.len(), 1usize);
+        let friend = user.friends.first().unwrap();
+
+        Python::with_gil(|py| {
+            assert_eq!(friend.borrow(py).username, "friend");
+            assert_eq!(
+                friend.borrow(py).group.as_ref().unwrap().borrow(py).name,
+                "danya's friends"
+            )
+        });
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_static_slots.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_static_slots.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_static_slots.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_static_slots.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,72 @@
+#![cfg(feature = "macros")]
+
+use pyo3::exceptions::PyIndexError;
+use pyo3::prelude::*;
+use pyo3::types::IntoPyDict;
+
+use pyo3::py_run;
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyclass]
+struct Count5();
+
+#[pymethods]
+impl Count5 {
+    #[new]
+    fn new() -> Self {
+        Self()
+    }
+
+    #[staticmethod]
+    fn __len__() -> usize {
+        5
+    }
+
+    #[staticmethod]
+    fn __getitem__(idx: isize) -> PyResult<f64> {
+        if idx < 0 {
+            Err(PyIndexError::new_err("Count5 cannot count backwards"))
+        } else if idx > 4 {
+            Err(PyIndexError::new_err("Count5 cannot count higher than 5"))
+        } else {
+            Ok(idx as f64 + 1.0)
+        }
+    }
+}
+
+/// Return a dict with `s = Count5()`.
+fn test_dict(py: Python<'_>) -> Bound<'_, pyo3::types::PyDict> {
+    let d = [("Count5", py.get_type_bound::<Count5>())].into_py_dict_bound(py);
+    // Though we can construct `s` in Rust, let's test `__new__` works.
+    py_run!(py, *d, "s = Count5()");
+    d
+}
+
+#[test]
+fn test_len() {
+    Python::with_gil(|py| {
+        let d = test_dict(py);
+
+        py_assert!(py, *d, "len(s) == 5");
+    });
+}
+
+#[test]
+fn test_getitem() {
+    Python::with_gil(|py| {
+        let d = test_dict(py);
+
+        py_assert!(py, *d, "s[4] == 5.0");
+    });
+}
+
+#[test]
+fn test_list() {
+    Python::with_gil(|py| {
+        let d = test_dict(py);
+
+        py_assert!(py, *d, "list(s) == [1.0, 2.0, 3.0, 4.0, 5.0]");
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_string.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_string.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_string.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_string.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,23 @@
+#![cfg(feature = "macros")]
+
+use pyo3::prelude::*;
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyfunction]
+fn take_str(_s: &str) {}
+
+#[test]
+fn test_unicode_encode_error() {
+    Python::with_gil(|py| {
+        let take_str = wrap_pyfunction_bound!(take_str)(py).unwrap();
+        py_expect_exception!(
+            py,
+            take_str,
+            "take_str('\\ud800')",
+            PyUnicodeEncodeError,
+            "'utf-8' codec can't encode character '\\ud800' in position 0: surrogates not allowed"
+        );
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_super.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_super.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_super.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_super.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,58 @@
+#![cfg(all(feature = "macros", not(PyPy)))]
+
+use pyo3::{prelude::*, types::PySuper};
+
+#[pyclass(subclass)]
+struct BaseClass {
+    val1: usize,
+}
+
+#[pymethods]
+impl BaseClass {
+    #[new]
+    fn new() -> Self {
+        BaseClass { val1: 10 }
+    }
+
+    pub fn method(&self) -> usize {
+        self.val1
+    }
+}
+
+#[pyclass(extends=BaseClass)]
+struct SubClass {}
+
+#[pymethods]
+impl SubClass {
+    #[new]
+    fn new() -> (Self, BaseClass) {
+        (SubClass {}, BaseClass::new())
+    }
+
+    fn method<'py>(self_: &Bound<'py, Self>) -> PyResult<Bound<'py, PyAny>> {
+        let super_ = self_.py_super()?;
+        super_.call_method("method", (), None)
+    }
+
+    fn method_super_new<'py>(self_: &Bound<'py, Self>) -> PyResult<Bound<'py, PyAny>> {
+        #[cfg_attr(not(feature = "gil-refs"), allow(deprecated))]
+        let super_ = PySuper::new_bound(&self_.get_type(), self_)?;
+        super_.call_method("method", (), None)
+    }
+}
+
+#[test]
+fn test_call_super_method() {
+    Python::with_gil(|py| {
+        let cls = py.get_type_bound::<SubClass>();
+        pyo3::py_run!(
+            py,
+            cls,
+            r#"
+        obj = cls()
+        assert obj.method() == 10
+        assert obj.method_super_new() == 10
+    "#
+        )
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_text_signature.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_text_signature.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_text_signature.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_text_signature.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,438 @@
+#![cfg(feature = "macros")]
+
+use pyo3::prelude::*;
+use pyo3::types::{PyDict, PyTuple};
+use pyo3::{types::PyType, wrap_pymodule};
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[test]
+fn class_without_docs_or_signature() {
+    #[pyclass]
+    struct MyClass {}
+
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<MyClass>();
+
+        py_assert!(py, typeobj, "typeobj.__doc__ is None");
+        py_assert!(py, typeobj, "typeobj.__text_signature__ is None");
+    });
+}
+
+#[test]
+fn class_with_docs() {
+    /// docs line1
+    #[pyclass]
+    /// docs line2
+    struct MyClass {}
+
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<MyClass>();
+
+        py_assert!(py, typeobj, "typeobj.__doc__ == 'docs line1\\ndocs line2'");
+        py_assert!(py, typeobj, "typeobj.__text_signature__ is None");
+    });
+}
+
+#[test]
+#[cfg_attr(all(Py_LIMITED_API, not(Py_3_10)), ignore)]
+fn class_with_signature_no_doc() {
+    #[pyclass]
+    struct MyClass {}
+
+    #[pymethods]
+    impl MyClass {
+        #[new]
+        #[pyo3(signature = (a, b=None, *, c=42), text_signature = "(a, b=None, *, c=42)")]
+        fn __new__(a: i32, b: Option<i32>, c: i32) -> Self {
+            let _ = (a, b, c);
+            Self {}
+        }
+    }
+
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<MyClass>();
+        py_assert!(py, typeobj, "typeobj.__doc__ == ''");
+        py_assert!(
+            py,
+            typeobj,
+            "typeobj.__text_signature__ == '(a, b=None, *, c=42)'"
+        );
+    });
+}
+
+#[test]
+#[cfg_attr(all(Py_LIMITED_API, not(Py_3_10)), ignore)]
+fn class_with_docs_and_signature() {
+    /// docs line1
+    #[pyclass]
+    /// docs line2
+    struct MyClass {}
+
+    #[pymethods]
+    impl MyClass {
+        #[new]
+        #[pyo3(signature = (a, b=None, *, c=42), text_signature = "(a, b=None, *, c=42)")]
+        fn __new__(a: i32, b: Option<i32>, c: i32) -> Self {
+            let _ = (a, b, c);
+            Self {}
+        }
+    }
+
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<MyClass>();
+
+        py_assert!(py, typeobj, "typeobj.__doc__ == 'docs line1\\ndocs line2'");
+        py_assert!(
+            py,
+            typeobj,
+            "typeobj.__text_signature__ == '(a, b=None, *, c=42)'"
+        );
+    });
+}
+
+#[test]
+fn test_function() {
+    #[pyfunction(signature = (a, b=None, *, c=42))]
+    #[pyo3(text_signature = "(a, b=None, *, c=42)")]
+    fn my_function(a: i32, b: Option<i32>, c: i32) {
+        let _ = (a, b, c);
+    }
+
+    Python::with_gil(|py| {
+        let f = wrap_pyfunction_bound!(my_function)(py).unwrap();
+
+        py_assert!(py, f, "f.__text_signature__ == '(a, b=None, *, c=42)'");
+    });
+}
+
+#[test]
+fn test_auto_test_signature_function() {
+    #[pyfunction]
+    fn my_function(a: i32, b: i32, c: i32) {
+        let _ = (a, b, c);
+    }
+
+    #[pyfunction(pass_module)]
+    fn my_function_2(module: &Bound<'_, PyModule>, a: i32, b: i32, c: i32) {
+        let _ = (module, a, b, c);
+    }
+
+    #[pyfunction(signature = (a, /, b = None, *, c = 5))]
+    fn my_function_3(a: i32, b: Option<i32>, c: i32) {
+        let _ = (a, b, c);
+    }
+
+    #[pyfunction(signature = (a, /, b = None, *args, c, d=5, **kwargs))]
+    fn my_function_4(
+        a: i32,
+        b: Option<i32>,
+        args: &Bound<'_, PyTuple>,
+        c: i32,
+        d: i32,
+        kwargs: Option<&Bound<'_, PyDict>>,
+    ) {
+        let _ = (a, b, args, c, d, kwargs);
+    }
+
+    #[pyfunction(signature = (a = 1, /, b = None, c = 1.5, d=5, e = "pyo3", f = 'f', h = true))]
+    fn my_function_5(a: i32, b: Option<i32>, c: f32, d: i32, e: &str, f: char, h: bool) {
+        let _ = (a, b, c, d, e, f, h);
+    }
+
+    #[pyfunction]
+    #[pyo3(signature=(a, b=None, c=None))]
+    fn my_function_6(a: i32, b: Option<i32>, c: Option<i32>) {
+        let _ = (a, b, c);
+    }
+
+    Python::with_gil(|py| {
+        let f = wrap_pyfunction_bound!(my_function)(py).unwrap();
+        py_assert!(
+            py,
+            f,
+            "f.__text_signature__ == '(a, b, c)', f.__text_signature__"
+        );
+
+        let f = wrap_pyfunction_bound!(my_function_2)(py).unwrap();
+        py_assert!(
+            py,
+            f,
+            "f.__text_signature__ == '($module, a, b, c)', f.__text_signature__"
+        );
+
+        let f = wrap_pyfunction_bound!(my_function_3)(py).unwrap();
+        py_assert!(
+            py,
+            f,
+            "f.__text_signature__ == '(a, /, b=None, *, c=5)', f.__text_signature__"
+        );
+
+        let f = wrap_pyfunction_bound!(my_function_4)(py).unwrap();
+        py_assert!(
+            py,
+            f,
+            "f.__text_signature__ == '(a, /, b=None, *args, c, d=5, **kwargs)', f.__text_signature__"
+        );
+
+        let f = wrap_pyfunction_bound!(my_function_5)(py).unwrap();
+        py_assert!(
+            py,
+            f,
+            "f.__text_signature__ == '(a=1, /, b=None, c=1.5, d=5, e=\"pyo3\", f=\\'f\\', h=True)', f.__text_signature__"
+        );
+
+        let f = wrap_pyfunction_bound!(my_function_6)(py).unwrap();
+        py_assert!(
+            py,
+            f,
+            "f.__text_signature__ == '(a, b=None, c=None)', f.__text_signature__"
+        );
+    });
+}
+
+#[test]
+fn test_auto_test_signature_method() {
+    #[pyclass]
+    struct MyClass {}
+
+    #[pymethods]
+    impl MyClass {
+        #[new]
+        fn new(a: i32, b: i32, c: i32) -> Self {
+            let _ = (a, b, c);
+            Self {}
+        }
+
+        fn method(&self, a: i32, b: i32, c: i32) {
+            let _ = (a, b, c);
+        }
+
+        #[pyo3(signature = (a, /, b = None, *, c = 5))]
+        fn method_2(&self, a: i32, b: Option<i32>, c: i32) {
+            let _ = (a, b, c);
+        }
+
+        #[pyo3(signature = (a, /, b = None, *args, c, d=5, **kwargs))]
+        fn method_3(
+            &self,
+            a: i32,
+            b: Option<i32>,
+            args: &Bound<'_, PyTuple>,
+            c: i32,
+            d: i32,
+            kwargs: Option<&Bound<'_, PyDict>>,
+        ) {
+            let _ = (a, b, args, c, d, kwargs);
+        }
+
+        #[staticmethod]
+        fn staticmethod(a: i32, b: i32, c: i32) {
+            let _ = (a, b, c);
+        }
+
+        #[classmethod]
+        fn classmethod(cls: &Bound<'_, PyType>, a: i32, b: i32, c: i32) {
+            let _ = (cls, a, b, c);
+        }
+    }
+
+    Python::with_gil(|py| {
+        let cls = py.get_type_bound::<MyClass>();
+        #[cfg(any(not(Py_LIMITED_API), Py_3_10))]
+        py_assert!(py, cls, "cls.__text_signature__ == '(a, b, c)'");
+        py_assert!(
+            py,
+            cls,
+            "cls.method.__text_signature__ == '($self, a, b, c)'"
+        );
+        py_assert!(
+            py,
+            cls,
+            "cls.method_2.__text_signature__ == '($self, a, /, b=None, *, c=5)'"
+        );
+        py_assert!(
+            py,
+            cls,
+            "cls.method_3.__text_signature__ == '($self, a, /, b=None, *args, c, d=5, **kwargs)'"
+        );
+        py_assert!(
+            py,
+            cls,
+            "cls.staticmethod.__text_signature__ == '(a, b, c)'"
+        );
+        py_assert!(
+            py,
+            cls,
+            "cls.classmethod.__text_signature__ == '($cls, a, b, c)'"
+        );
+    });
+}
+
+#[test]
+fn test_auto_test_signature_opt_out() {
+    #[pyfunction(text_signature = None)]
+    fn my_function(a: i32, b: i32, c: i32) {
+        let _ = (a, b, c);
+    }
+
+    #[pyfunction(signature = (a, /, b = None, *, c = 5), text_signature = None)]
+    fn my_function_2(a: i32, b: Option<i32>, c: i32) {
+        let _ = (a, b, c);
+    }
+
+    #[pyclass]
+    struct MyClass {}
+
+    #[pymethods]
+    impl MyClass {
+        #[new]
+        #[pyo3(text_signature = None)]
+        fn new(a: i32, b: i32, c: i32) -> Self {
+            let _ = (a, b, c);
+            Self {}
+        }
+
+        #[pyo3(text_signature = None)]
+        fn method(&self, a: i32, b: i32, c: i32) {
+            let _ = (a, b, c);
+        }
+
+        #[pyo3(signature = (a, /, b = None, *, c = 5), text_signature = None)]
+        fn method_2(&self, a: i32, b: Option<i32>, c: i32) {
+            let _ = (a, b, c);
+        }
+
+        #[staticmethod]
+        #[pyo3(text_signature = None)]
+        fn staticmethod(a: i32, b: i32, c: i32) {
+            let _ = (a, b, c);
+        }
+
+        #[classmethod]
+        #[pyo3(text_signature = None)]
+        fn classmethod(cls: &Bound<'_, PyType>, a: i32, b: i32, c: i32) {
+            let _ = (cls, a, b, c);
+        }
+    }
+
+    Python::with_gil(|py| {
+        let f = wrap_pyfunction_bound!(my_function)(py).unwrap();
+        py_assert!(py, f, "f.__text_signature__ == None");
+
+        let f = wrap_pyfunction_bound!(my_function_2)(py).unwrap();
+        py_assert!(py, f, "f.__text_signature__ == None");
+
+        let cls = py.get_type_bound::<MyClass>();
+        py_assert!(py, cls, "cls.__text_signature__ == None");
+        py_assert!(py, cls, "cls.method.__text_signature__ == None");
+        py_assert!(py, cls, "cls.method_2.__text_signature__ == None");
+        py_assert!(py, cls, "cls.staticmethod.__text_signature__ == None");
+        py_assert!(py, cls, "cls.classmethod.__text_signature__ == None");
+    });
+}
+
+#[test]
+fn test_pyfn() {
+    #[pymodule]
+    fn my_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
+        #[pyfn(m, signature = (a, b=None, *, c=42))]
+        #[pyo3(text_signature = "(a, b=None, *, c=42)")]
+        fn my_function(a: i32, b: Option<i32>, c: i32) {
+            let _ = (a, b, c);
+        }
+        Ok(())
+    }
+
+    Python::with_gil(|py| {
+        let m = wrap_pymodule!(my_module)(py);
+
+        py_assert!(
+            py,
+            m,
+            "m.my_function.__text_signature__ == '(a, b=None, *, c=42)'"
+        );
+    });
+}
+
+#[test]
+fn test_methods() {
+    #[pyclass]
+    struct MyClass {}
+
+    #[pymethods]
+    impl MyClass {
+        #[pyo3(text_signature = "($self, a)")]
+        fn method(&self, a: i32) {
+            let _ = a;
+        }
+        #[pyo3(text_signature = "($self, b)")]
+        fn pyself_method(_this: &Bound<'_, Self>, b: i32) {
+            let _ = b;
+        }
+        #[classmethod]
+        #[pyo3(text_signature = "($cls, c)")]
+        fn class_method(_cls: &Bound<'_, PyType>, c: i32) {
+            let _ = c;
+        }
+        #[staticmethod]
+        #[pyo3(text_signature = "(d)")]
+        fn static_method(d: i32) {
+            let _ = d;
+        }
+    }
+
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<MyClass>();
+
+        py_assert!(
+            py,
+            typeobj,
+            "typeobj.method.__text_signature__ == '($self, a)'"
+        );
+        py_assert!(
+            py,
+            typeobj,
+            "typeobj.pyself_method.__text_signature__ == '($self, b)'"
+        );
+        py_assert!(
+            py,
+            typeobj,
+            "typeobj.class_method.__text_signature__ == '($cls, c)'"
+        );
+        py_assert!(
+            py,
+            typeobj,
+            "typeobj.static_method.__text_signature__ == '(d)'"
+        );
+    });
+}
+
+#[test]
+#[cfg_attr(all(Py_LIMITED_API, not(Py_3_10)), ignore)]
+fn test_raw_identifiers() {
+    #[pyclass]
+    struct r#MyClass {}
+
+    #[pymethods]
+    impl MyClass {
+        #[new]
+        fn new() -> MyClass {
+            MyClass {}
+        }
+        fn r#method(&self) {}
+    }
+
+    Python::with_gil(|py| {
+        let typeobj = py.get_type_bound::<MyClass>();
+
+        py_assert!(py, typeobj, "typeobj.__text_signature__ == '()'");
+
+        py_assert!(
+            py,
+            typeobj,
+            "typeobj.method.__text_signature__ == '($self)'"
+        );
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_variable_arguments.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_variable_arguments.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_variable_arguments.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_variable_arguments.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,49 @@
+#![cfg(feature = "macros")]
+
+use pyo3::prelude::*;
+use pyo3::types::{PyDict, PyTuple};
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyclass]
+struct MyClass {}
+
+#[pymethods]
+impl MyClass {
+    #[staticmethod]
+    #[pyo3(signature = (*args))]
+    fn test_args(args: Bound<'_, PyTuple>) -> Bound<'_, PyTuple> {
+        args
+    }
+
+    #[staticmethod]
+    #[pyo3(signature = (**kwargs))]
+    fn test_kwargs(kwargs: Option<Bound<'_, PyDict>>) -> Option<Bound<'_, PyDict>> {
+        kwargs
+    }
+}
+
+#[test]
+fn variable_args() {
+    Python::with_gil(|py| {
+        let my_obj = py.get_type_bound::<MyClass>();
+        py_assert!(py, my_obj, "my_obj.test_args() == ()");
+        py_assert!(py, my_obj, "my_obj.test_args(1) == (1,)");
+        py_assert!(py, my_obj, "my_obj.test_args(1, 2) == (1, 2)");
+    });
+}
+
+#[test]
+fn variable_kwargs() {
+    Python::with_gil(|py| {
+        let my_obj = py.get_type_bound::<MyClass>();
+        py_assert!(py, my_obj, "my_obj.test_kwargs() == None");
+        py_assert!(py, my_obj, "my_obj.test_kwargs(test=1) == {'test': 1}");
+        py_assert!(
+            py,
+            my_obj,
+            "my_obj.test_kwargs(test1=1, test2=2) == {'test1':1, 'test2':2}"
+        );
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_various.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_various.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_various.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_various.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,208 @@
+#![cfg(feature = "macros")]
+
+use pyo3::prelude::*;
+use pyo3::py_run;
+use pyo3::types::PyTuple;
+
+use std::fmt;
+
+#[path = "../src/tests/common.rs"]
+mod common;
+
+#[pyclass]
+struct MutRefArg {
+    n: i32,
+}
+
+#[pymethods]
+impl MutRefArg {
+    fn get(&self) -> i32 {
+        self.n
+    }
+    fn set_other(&self, mut other: PyRefMut<'_, MutRefArg>) {
+        other.n = 100;
+    }
+}
+
+#[test]
+fn mut_ref_arg() {
+    Python::with_gil(|py| {
+        let inst1 = Py::new(py, MutRefArg { n: 0 }).unwrap();
+        let inst2 = Py::new(py, MutRefArg { n: 0 }).unwrap();
+
+        py_run!(py, inst1 inst2, "inst1.set_other(inst2)");
+        let inst2 = inst2.bind(py).borrow();
+        assert_eq!(inst2.n, 100);
+    });
+}
+
+#[pyclass]
+struct PyUsize {
+    #[pyo3(get)]
+    pub value: usize,
+}
+
+#[pyfunction]
+fn get_zero() -> PyUsize {
+    PyUsize { value: 0 }
+}
+
+#[test]
+/// Checks that we can use return a custom class in arbitrary function and use those functions
+/// both in rust and python
+fn return_custom_class() {
+    Python::with_gil(|py| {
+        // Using from rust
+        assert_eq!(get_zero().value, 0);
+
+        // Using from python
+        let get_zero = wrap_pyfunction_bound!(get_zero)(py).unwrap();
+        py_assert!(py, get_zero, "get_zero().value == 0");
+    });
+}
+
+#[test]
+fn intopytuple_primitive() {
+    Python::with_gil(|py| {
+        let tup = (1, 2, "foo");
+        py_assert!(py, tup, "tup == (1, 2, 'foo')");
+        py_assert!(py, tup, "tup[0] == 1");
+        py_assert!(py, tup, "tup[1] == 2");
+        py_assert!(py, tup, "tup[2] == 'foo'");
+    });
+}
+
+#[pyclass]
+struct SimplePyClass {}
+
+#[test]
+fn intopytuple_pyclass() {
+    Python::with_gil(|py| {
+        let tup = (
+            Py::new(py, SimplePyClass {}).unwrap(),
+            Py::new(py, SimplePyClass {}).unwrap(),
+        );
+        py_assert!(py, tup, "type(tup[0]).__name__ == 'SimplePyClass'");
+        py_assert!(py, tup, "type(tup[0]).__name__ == type(tup[1]).__name__");
+        py_assert!(py, tup, "tup[0] != tup[1]");
+    });
+}
+
+#[test]
+fn pytuple_primitive_iter() {
+    Python::with_gil(|py| {
+        let tup = PyTuple::new_bound(py, [1u32, 2, 3].iter());
+        py_assert!(py, tup, "tup == (1, 2, 3)");
+    });
+}
+
+#[test]
+fn pytuple_pyclass_iter() {
+    Python::with_gil(|py| {
+        let tup = PyTuple::new_bound(
+            py,
+            [
+                Py::new(py, SimplePyClass {}).unwrap(),
+                Py::new(py, SimplePyClass {}).unwrap(),
+            ]
+            .iter(),
+        );
+        py_assert!(py, tup, "type(tup[0]).__name__ == 'SimplePyClass'");
+        py_assert!(py, tup, "type(tup[0]).__name__ == type(tup[0]).__name__");
+        py_assert!(py, tup, "tup[0] != tup[1]");
+    });
+}
+
+#[test]
+#[cfg(any(Py_3_9, not(Py_LIMITED_API)))]
+fn test_pickle() {
+    use pyo3::types::PyDict;
+
+    #[pyclass(dict, module = "test_module")]
+    struct PickleSupport {}
+
+    #[pymethods]
+    impl PickleSupport {
+        #[new]
+        fn new() -> PickleSupport {
+            PickleSupport {}
+        }
+
+        pub fn __reduce__<'py>(
+            slf: &Bound<'py, Self>,
+            py: Python<'py>,
+        ) -> PyResult<(PyObject, Bound<'py, PyTuple>, PyObject)> {
+            let cls = slf.to_object(py).getattr(py, "__class__")?;
+            let dict = slf.to_object(py).getattr(py, "__dict__")?;
+            Ok((cls, PyTuple::empty_bound(py), dict))
+        }
+    }
+
+    fn add_module(module: Bound<'_, PyModule>) -> PyResult<()> {
+        PyModule::import_bound(module.py(), "sys")?
+            .dict()
+            .get_item("modules")
+            .unwrap()
+            .unwrap()
+            .downcast::<PyDict>()?
+            .set_item(module.name()?, module)
+    }
+
+    Python::with_gil(|py| {
+        let module = PyModule::new_bound(py, "test_module").unwrap();
+        module.add_class::<PickleSupport>().unwrap();
+        add_module(module).unwrap();
+        let inst = Py::new(py, PickleSupport {}).unwrap();
+        py_run!(
+            py,
+            inst,
+            r#"
+        inst.a = 1
+        assert inst.__dict__ == {'a': 1}
+
+        import pickle
+        inst2 = pickle.loads(pickle.dumps(inst))
+
+        assert inst2.__dict__ == {'a': 1}
+    "#
+        );
+    });
+}
+
+/// Testing https://github.com/PyO3/pyo3/issues/1106. A result type that
+/// implements `From<MyError> for PyErr` should be automatically converted
+/// when using `#[pyfunction]`.
+///
+/// This only makes sure that valid `Result` types do work. For an invalid
+/// enum type, see `ui/invalid_result_conversion.py`.
+#[derive(Debug)]
+struct MyError {
+    pub descr: &'static str,
+}
+
+impl fmt::Display for MyError {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        write!(f, "My error message: {}", self.descr)
+    }
+}
+
+/// Important for the automatic conversion to `PyErr`.
+impl From<MyError> for PyErr {
+    fn from(err: MyError) -> pyo3::PyErr {
+        pyo3::exceptions::PyOSError::new_err(err.to_string())
+    }
+}
+
+#[pyfunction]
+fn result_conversion_function() -> Result<(), MyError> {
+    Err(MyError {
+        descr: "something went wrong",
+    })
+}
+
+#[test]
+fn test_result_conversion() {
+    Python::with_gil(|py| {
+        wrap_pyfunction_bound!(result_conversion_function)(py).unwrap();
+    });
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3/tests/test_wrap_pyfunction_deduction.rs 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_wrap_pyfunction_deduction.rs
--- 43.0.0-1/rust-vendor/pyo3/tests/test_wrap_pyfunction_deduction.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3/tests/test_wrap_pyfunction_deduction.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,29 @@
+#![cfg(feature = "macros")]
+
+use pyo3::{prelude::*, types::PyCFunction};
+
+#[pyfunction]
+fn f() {}
+
+#[cfg(feature = "gil-refs")]
+pub fn add_wrapped(wrapper: &impl Fn(Python<'_>) -> PyResult<&PyCFunction>) {
+    let _ = wrapper;
+}
+
+#[test]
+fn wrap_pyfunction_deduction() {
+    #[allow(deprecated)]
+    #[cfg(feature = "gil-refs")]
+    add_wrapped(wrap_pyfunction!(f));
+    #[cfg(not(feature = "gil-refs"))]
+    add_wrapped_bound(wrap_pyfunction!(f));
+}
+
+pub fn add_wrapped_bound(wrapper: &impl Fn(Python<'_>) -> PyResult<Bound<'_, PyCFunction>>) {
+    let _ = wrapper;
+}
+
+#[test]
+fn wrap_pyfunction_deduction_bound() {
+    add_wrapped_bound(wrap_pyfunction_bound!(f));
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-build-config/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/pyo3-build-config/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/pyo3-build-config/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-build-config/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"Cargo.toml":"7afc92dc490bf5f812ce73007e0e7e89159f010998f5c22e6fdd0fc4229e14da","LICENSE-APACHE":"71073d492e996de196dbe1eb1e4c94c27c014c841b288161265b2efd06d0af28","LICENSE-MIT":"afcbe3b2e6b37172b5a9ca869ee4c0b8cdc09316e5d4384864154482c33e5af6","build.rs":"905cbe245028aa0a6841ce7543dd8fc3e289872e7a630247d4fc81759fc938c3","src/errors.rs":"ffb63dbfa121e0bf4926cde7baa758c4af665fc0d000d2012aa7f818ce97a398","src/impl_.rs":"99044022fb6c00526e753dc62a23c602e7046de9bb3c627885cd89dce2e783b6","src/import_lib.rs":"858fa3fb5344c994498851200a0cb580d1ad5c4740ce0f4cbe59408d1c8e25a7","src/lib.rs":"8fd69acbbac29dc6dcfe68c430a1374eedb1459a58f235095f32cd2ac3a964a5"},"package":"1e8730e591b14492a8945cdff32f089250b05f5accecf74aeddf9e8272ce1fa8"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/pyo3-build-config/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/pyo3-build-config/Cargo.toml
--- 43.0.0-1/rust-vendor/pyo3-build-config/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-build-config/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,62 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2021"
+name = "pyo3-build-config"
+version = "0.22.2"
+authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]
+description = "Build configuration for the PyO3 ecosystem"
+homepage = "https://github.com/pyo3/pyo3"
+keywords = [
+    "pyo3",
+    "python",
+    "cpython",
+    "ffi",
+]
+categories = [
+    "api-bindings",
+    "development-tools::ffi",
+]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/pyo3/pyo3"
+
+[package.metadata.docs.rs]
+features = ["resolve-config"]
+
+[dependencies.once_cell]
+version = "1"
+
+[dependencies.python3-dll-a]
+version = "0.2.6"
+optional = true
+
+[dependencies.target-lexicon]
+version = "0.12.14"
+
+[build-dependencies.python3-dll-a]
+version = "0.2.6"
+optional = true
+
+[build-dependencies.target-lexicon]
+version = "0.12.14"
+
+[features]
+abi3 = []
+abi3-py310 = ["abi3-py311"]
+abi3-py311 = ["abi3-py312"]
+abi3-py312 = ["abi3"]
+abi3-py37 = ["abi3-py38"]
+abi3-py38 = ["abi3-py39"]
+abi3-py39 = ["abi3-py310"]
+default = []
+extension-module = []
+resolve-config = []
diff -pruN 43.0.0-1/rust-vendor/pyo3-build-config/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/pyo3-build-config/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/pyo3-build-config/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-build-config/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,189 @@
+   Copyright (c) 2017-present PyO3 Project and Contributors.  https://github.com/PyO3
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
diff -pruN 43.0.0-1/rust-vendor/pyo3-build-config/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/pyo3-build-config/LICENSE-MIT
--- 43.0.0-1/rust-vendor/pyo3-build-config/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-build-config/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,25 @@
+Copyright (c) 2023-present PyO3 Project and Contributors.  https://github.com/PyO3
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/pyo3-build-config/build.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-build-config/build.rs
--- 43.0.0-1/rust-vendor/pyo3-build-config/build.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-build-config/build.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,74 @@
+// Import some modules from this crate inline to generate the build config.
+// Allow dead code because not all code in the modules is used in this build script.
+
+#[path = "src/impl_.rs"]
+#[allow(dead_code)]
+mod impl_;
+
+#[path = "src/errors.rs"]
+#[allow(dead_code)]
+mod errors;
+
+use std::{env, path::Path};
+
+use errors::{Context, Result};
+use impl_::{env_var, make_interpreter_config, InterpreterConfig};
+
+fn configure(interpreter_config: Option<InterpreterConfig>, name: &str) -> Result<bool> {
+    let target = Path::new(&env::var_os("OUT_DIR").unwrap()).join(name);
+    if let Some(config) = interpreter_config {
+        config
+            .to_writer(&mut std::fs::File::create(&target).with_context(|| {
+                format!("failed to write config file at {}", target.display())
+            })?)?;
+        Ok(true)
+    } else {
+        std::fs::File::create(&target)
+            .with_context(|| format!("failed to create new file at {}", target.display()))?;
+        Ok(false)
+    }
+}
+
+/// If PYO3_CONFIG_FILE is set, copy it into the crate.
+fn config_file() -> Result<Option<InterpreterConfig>> {
+    if let Some(path) = env_var("PYO3_CONFIG_FILE") {
+        let path = Path::new(&path);
+        println!("cargo:rerun-if-changed={}", path.display());
+        // Absolute path is necessary because this build script is run with a cwd different to the
+        // original `cargo build` instruction.
+        ensure!(
+            path.is_absolute(),
+            "PYO3_CONFIG_FILE must be an absolute path"
+        );
+
+        let interpreter_config = InterpreterConfig::from_path(path)
+            .context("failed to parse contents of PYO3_CONFIG_FILE")?;
+        Ok(Some(interpreter_config))
+    } else {
+        Ok(None)
+    }
+}
+
+fn generate_build_configs() -> Result<()> {
+    let configured = configure(config_file()?, "pyo3-build-config-file.txt")?;
+
+    if configured {
+        // Don't bother trying to find an interpreter on the host system
+        // if the user-provided config file is present.
+        configure(None, "pyo3-build-config.txt")?;
+    } else {
+        configure(Some(make_interpreter_config()?), "pyo3-build-config.txt")?;
+    }
+    Ok(())
+}
+
+fn main() {
+    if std::env::var("CARGO_FEATURE_RESOLVE_CONFIG").is_ok() {
+        if let Err(e) = generate_build_configs() {
+            eprintln!("error: {}", e.report());
+            std::process::exit(1)
+        }
+    } else {
+        eprintln!("resolve-config feature not enabled; build script in no-op mode");
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-build-config/src/errors.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-build-config/src/errors.rs
--- 43.0.0-1/rust-vendor/pyo3-build-config/src/errors.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-build-config/src/errors.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,153 @@
+/// A simple macro for returning an error. Resembles anyhow::bail.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! bail {
+    ($($args: tt)+) => { return Err(format!($($args)+).into()) };
+}
+
+/// A simple macro for checking a condition. Resembles anyhow::ensure.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! ensure {
+    ($condition:expr, $($args: tt)+) => { if !($condition) { bail!($($args)+) } };
+}
+
+/// Show warning.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! warn {
+    ($($args: tt)+) => {
+        println!("{}", $crate::format_warn!($($args)+))
+    };
+}
+
+/// Format warning into string.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! format_warn {
+    ($($args: tt)+) => {
+        format!("cargo:warning={}", format_args!($($args)+))
+    };
+}
+
+/// A simple error implementation which allows chaining of errors, inspired somewhat by anyhow.
+#[derive(Debug)]
+pub struct Error {
+    value: String,
+    source: Option<Box<dyn std::error::Error>>,
+}
+
+/// Error report inspired by
+/// <https://blog.rust-lang.org/inside-rust/2021/07/01/What-the-error-handling-project-group-is-working-towards.html#2-error-reporter>
+pub struct ErrorReport<'a>(&'a Error);
+
+impl Error {
+    pub fn report(&self) -> ErrorReport<'_> {
+        ErrorReport(self)
+    }
+}
+
+impl std::fmt::Display for Error {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        write!(f, "{}", self.value)
+    }
+}
+
+impl std::error::Error for Error {
+    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
+        self.source.as_deref()
+    }
+}
+
+impl std::fmt::Display for ErrorReport<'_> {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        use std::error::Error;
+        self.0.fmt(f)?;
+        let mut source = self.0.source();
+        if source.is_some() {
+            writeln!(f, "\ncaused by:")?;
+            let mut index = 0;
+            while let Some(some_source) = source {
+                writeln!(f, "  - {}: {}", index, some_source)?;
+                source = some_source.source();
+                index += 1;
+            }
+        }
+        Ok(())
+    }
+}
+
+impl From<String> for Error {
+    fn from(value: String) -> Self {
+        Self {
+            value,
+            source: None,
+        }
+    }
+}
+
+impl From<&'_ str> for Error {
+    fn from(value: &str) -> Self {
+        value.to_string().into()
+    }
+}
+
+impl From<std::convert::Infallible> for Error {
+    fn from(value: std::convert::Infallible) -> Self {
+        match value {}
+    }
+}
+
+pub type Result<T, E = Error> = std::result::Result<T, E>;
+
+pub trait Context<T> {
+    fn context(self, message: impl Into<String>) -> Result<T>;
+    fn with_context(self, message: impl FnOnce() -> String) -> Result<T>;
+}
+
+impl<T, E> Context<T> for Result<T, E>
+where
+    E: std::error::Error + 'static,
+{
+    fn context(self, message: impl Into<String>) -> Result<T> {
+        self.map_err(|error| Error {
+            value: message.into(),
+            source: Some(Box::new(error)),
+        })
+    }
+
+    fn with_context(self, message: impl FnOnce() -> String) -> Result<T> {
+        self.map_err(|error| Error {
+            value: message(),
+            source: Some(Box::new(error)),
+        })
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn error_report() {
+        let error: Result<()> = Err(Error::from("there was an internal error"))
+            .with_context(|| format!("failed to do {}", "something difficult"))
+            .context("things went wrong");
+
+        assert_eq!(
+            error
+                .unwrap_err()
+                .report()
+                .to_string()
+                .split('\n')
+                .collect::<Vec<&str>>(),
+            vec![
+                "things went wrong",
+                "caused by:",
+                "  - 0: failed to do something difficult",
+                "  - 1: there was an internal error",
+                ""
+            ]
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-build-config/src/impl_.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-build-config/src/impl_.rs
--- 43.0.0-1/rust-vendor/pyo3-build-config/src/impl_.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-build-config/src/impl_.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,2780 @@
+//! Main implementation module included in both the `pyo3-build-config` library crate
+//! and its build script.
+
+// Optional python3.dll import library generator for Windows
+#[cfg(feature = "python3-dll-a")]
+#[path = "import_lib.rs"]
+mod import_lib;
+
+use std::{
+    collections::{HashMap, HashSet},
+    env,
+    ffi::{OsStr, OsString},
+    fmt::Display,
+    fs::{self, DirEntry},
+    io::{BufRead, BufReader, Read, Write},
+    path::{Path, PathBuf},
+    process::{Command, Stdio},
+    str,
+    str::FromStr,
+};
+
+pub use target_lexicon::Triple;
+
+use target_lexicon::{Environment, OperatingSystem};
+
+use crate::{
+    bail, ensure,
+    errors::{Context, Error, Result},
+    warn,
+};
+
+/// Minimum Python version PyO3 supports.
+pub(crate) const MINIMUM_SUPPORTED_VERSION: PythonVersion = PythonVersion { major: 3, minor: 7 };
+
+/// GraalPy may implement the same CPython version over multiple releases.
+const MINIMUM_SUPPORTED_VERSION_GRAALPY: PythonVersion = PythonVersion {
+    major: 24,
+    minor: 0,
+};
+
+/// Maximum Python version that can be used as minimum required Python version with abi3.
+pub(crate) const ABI3_MAX_MINOR: u8 = 12;
+
+/// Gets an environment variable owned by cargo.
+///
+/// Environment variables set by cargo are expected to be valid UTF8.
+pub fn cargo_env_var(var: &str) -> Option<String> {
+    env::var_os(var).map(|os_string| os_string.to_str().unwrap().into())
+}
+
+/// Gets an external environment variable, and registers the build script to rerun if
+/// the variable changes.
+pub fn env_var(var: &str) -> Option<OsString> {
+    if cfg!(feature = "resolve-config") {
+        println!("cargo:rerun-if-env-changed={}", var);
+    }
+    env::var_os(var)
+}
+
+/// Gets the compilation target triple from environment variables set by Cargo.
+///
+/// Must be called from a crate build script.
+pub fn target_triple_from_env() -> Triple {
+    env::var("TARGET")
+        .expect("target_triple_from_env() must be called from a build script")
+        .parse()
+        .expect("Unrecognized TARGET environment variable value")
+}
+
+/// Configuration needed by PyO3 to build for the correct Python implementation.
+///
+/// Usually this is queried directly from the Python interpreter, or overridden using the
+/// `PYO3_CONFIG_FILE` environment variable.
+///
+/// When the `PYO3_NO_PYTHON` variable is set, or during cross compile situations, then alternative
+/// strategies are used to populate this type.
+#[cfg_attr(test, derive(Debug, PartialEq, Eq))]
+pub struct InterpreterConfig {
+    /// The Python implementation flavor.
+    ///
+    /// Serialized to `implementation`.
+    pub implementation: PythonImplementation,
+
+    /// Python `X.Y` version. e.g. `3.9`.
+    ///
+    /// Serialized to `version`.
+    pub version: PythonVersion,
+
+    /// Whether link library is shared.
+    ///
+    /// Serialized to `shared`.
+    pub shared: bool,
+
+    /// Whether linking against the stable/limited Python 3 API.
+    ///
+    /// Serialized to `abi3`.
+    pub abi3: bool,
+
+    /// The name of the link library defining Python.
+    ///
+    /// This effectively controls the `cargo:rustc-link-lib=<name>` value to
+    /// control how libpython is linked. Values should not contain the `lib`
+    /// prefix.
+    ///
+    /// Serialized to `lib_name`.
+    pub lib_name: Option<String>,
+
+    /// The directory containing the Python library to link against.
+    ///
+    /// The effectively controls the `cargo:rustc-link-search=native=<path>` value
+    /// to add an additional library search path for the linker.
+    ///
+    /// Serialized to `lib_dir`.
+    pub lib_dir: Option<String>,
+
+    /// Path of host `python` executable.
+    ///
+    /// This is a valid executable capable of running on the host/building machine.
+    /// For configurations derived by invoking a Python interpreter, it was the
+    /// executable invoked.
+    ///
+    /// Serialized to `executable`.
+    pub executable: Option<String>,
+
+    /// Width in bits of pointers on the target machine.
+    ///
+    /// Serialized to `pointer_width`.
+    pub pointer_width: Option<u32>,
+
+    /// Additional relevant Python build flags / configuration settings.
+    ///
+    /// Serialized to `build_flags`.
+    pub build_flags: BuildFlags,
+
+    /// Whether to suppress emitting of `cargo:rustc-link-*` lines from the build script.
+    ///
+    /// Typically, `pyo3`'s build script will emit `cargo:rustc-link-lib=` and
+    /// `cargo:rustc-link-search=` lines derived from other fields in this struct. In
+    /// advanced building configurations, the default logic to derive these lines may not
+    /// be sufficient. This field can be set to `Some(true)` to suppress the emission
+    /// of these lines.
+    ///
+    /// If suppression is enabled, `extra_build_script_lines` should contain equivalent
+    /// functionality or else a build failure is likely.
+    pub suppress_build_script_link_lines: bool,
+
+    /// Additional lines to `println!()` from Cargo build scripts.
+    ///
+    /// This field can be populated to enable the `pyo3` crate to emit additional lines from its
+    /// its Cargo build script.
+    ///
+    /// This crate doesn't populate this field itself. Rather, it is intended to be used with
+    /// externally provided config files to give them significant control over how the crate
+    /// is build/configured.
+    ///
+    /// Serialized to multiple `extra_build_script_line` values.
+    pub extra_build_script_lines: Vec<String>,
+}
+
+impl InterpreterConfig {
+    #[doc(hidden)]
+    pub fn build_script_outputs(&self) -> Vec<String> {
+        // This should have been checked during pyo3-build-config build time.
+        assert!(self.version >= MINIMUM_SUPPORTED_VERSION);
+
+        let mut out = vec![];
+
+        // pyo3-build-config was released when Python 3.6 was supported, so minimum flag to emit is
+        // Py_3_6 (to avoid silently breaking users who depend on this cfg).
+        for i in 6..=self.version.minor {
+            out.push(format!("cargo:rustc-cfg=Py_3_{}", i));
+        }
+
+        match self.implementation {
+            PythonImplementation::CPython => {}
+            PythonImplementation::PyPy => out.push("cargo:rustc-cfg=PyPy".to_owned()),
+            PythonImplementation::GraalPy => out.push("cargo:rustc-cfg=GraalPy".to_owned()),
+        }
+
+        if self.abi3 {
+            out.push("cargo:rustc-cfg=Py_LIMITED_API".to_owned());
+        }
+
+        for flag in &self.build_flags.0 {
+            out.push(format!("cargo:rustc-cfg=py_sys_config=\"{}\"", flag));
+        }
+
+        out
+    }
+
+    #[doc(hidden)]
+    pub fn from_interpreter(interpreter: impl AsRef<Path>) -> Result<Self> {
+        const SCRIPT: &str = r#"
+# Allow the script to run on Python 2, so that nicer error can be printed later.
+from __future__ import print_function
+
+import os.path
+import platform
+import struct
+import sys
+from sysconfig import get_config_var, get_platform
+
+PYPY = platform.python_implementation() == "PyPy"
+GRAALPY = platform.python_implementation() == "GraalVM"
+
+if GRAALPY:
+    graalpy_ver = map(int, __graalpython__.get_graalvm_version().split('.'));
+    print("graalpy_major", next(graalpy_ver))
+    print("graalpy_minor", next(graalpy_ver))
+
+# sys.base_prefix is missing on Python versions older than 3.3; this allows the script to continue
+# so that the version mismatch can be reported in a nicer way later.
+base_prefix = getattr(sys, "base_prefix", None)
+
+if base_prefix:
+    # Anaconda based python distributions have a static python executable, but include
+    # the shared library. Use the shared library for embedding to avoid rust trying to
+    # LTO the static library (and failing with newer gcc's, because it is old).
+    ANACONDA = os.path.exists(os.path.join(base_prefix, "conda-meta"))
+else:
+    ANACONDA = False
+
+def print_if_set(varname, value):
+    if value is not None:
+        print(varname, value)
+
+# Windows always uses shared linking
+WINDOWS = platform.system() == "Windows"
+
+# macOS framework packages use shared linking
+FRAMEWORK = bool(get_config_var("PYTHONFRAMEWORK"))
+
+# unix-style shared library enabled
+SHARED = bool(get_config_var("Py_ENABLE_SHARED"))
+
+print("implementation", platform.python_implementation())
+print("version_major", sys.version_info[0])
+print("version_minor", sys.version_info[1])
+print("shared", PYPY or GRAALPY or ANACONDA or WINDOWS or FRAMEWORK or SHARED)
+print_if_set("ld_version", get_config_var("LDVERSION"))
+print_if_set("libdir", get_config_var("LIBDIR"))
+print_if_set("base_prefix", base_prefix)
+print("executable", sys.executable)
+print("calcsize_pointer", struct.calcsize("P"))
+print("mingw", get_platform().startswith("mingw"))
+print("ext_suffix", get_config_var("EXT_SUFFIX"))
+"#;
+        let output = run_python_script(interpreter.as_ref(), SCRIPT)?;
+        let map: HashMap<String, String> = parse_script_output(&output);
+
+        ensure!(
+            !map.is_empty(),
+            "broken Python interpreter: {}",
+            interpreter.as_ref().display()
+        );
+
+        if let Some(value) = map.get("graalpy_major") {
+            let graalpy_version = PythonVersion {
+                major: value
+                    .parse()
+                    .context("failed to parse GraalPy major version")?,
+                minor: map["graalpy_minor"]
+                    .parse()
+                    .context("failed to parse GraalPy minor version")?,
+            };
+            ensure!(
+                graalpy_version >= MINIMUM_SUPPORTED_VERSION_GRAALPY,
+                "At least GraalPy version {} needed, got {}",
+                MINIMUM_SUPPORTED_VERSION_GRAALPY,
+                graalpy_version
+            );
+        };
+
+        let shared = map["shared"].as_str() == "True";
+
+        let version = PythonVersion {
+            major: map["version_major"]
+                .parse()
+                .context("failed to parse major version")?,
+            minor: map["version_minor"]
+                .parse()
+                .context("failed to parse minor version")?,
+        };
+
+        let abi3 = is_abi3();
+
+        let implementation = map["implementation"].parse()?;
+
+        let lib_name = if cfg!(windows) {
+            default_lib_name_windows(
+                version,
+                implementation,
+                abi3,
+                map["mingw"].as_str() == "True",
+                // This is the best heuristic currently available to detect debug build
+                // on Windows from sysconfig - e.g. ext_suffix may be
+                // `_d.cp312-win_amd64.pyd` for 3.12 debug build
+                map["ext_suffix"].starts_with("_d."),
+            )
+        } else {
+            default_lib_name_unix(
+                version,
+                implementation,
+                map.get("ld_version").map(String::as_str),
+            )
+        };
+
+        let lib_dir = if cfg!(windows) {
+            map.get("base_prefix")
+                .map(|base_prefix| format!("{}\\libs", base_prefix))
+        } else {
+            map.get("libdir").cloned()
+        };
+
+        // The reason we don't use platform.architecture() here is that it's not
+        // reliable on macOS. See https://stackoverflow.com/a/1405971/823869.
+        // Similarly, sys.maxsize is not reliable on Windows. See
+        // https://stackoverflow.com/questions/1405913/how-do-i-determine-if-my-python-shell-is-executing-in-32bit-or-64bit-mode-on-os/1405971#comment6209952_1405971
+        // and https://stackoverflow.com/a/3411134/823869.
+        let calcsize_pointer: u32 = map["calcsize_pointer"]
+            .parse()
+            .context("failed to parse calcsize_pointer")?;
+
+        Ok(InterpreterConfig {
+            version,
+            implementation,
+            shared,
+            abi3,
+            lib_name: Some(lib_name),
+            lib_dir,
+            executable: map.get("executable").cloned(),
+            pointer_width: Some(calcsize_pointer * 8),
+            build_flags: BuildFlags::from_interpreter(interpreter)?,
+            suppress_build_script_link_lines: false,
+            extra_build_script_lines: vec![],
+        })
+    }
+
+    /// Generate from parsed sysconfigdata file
+    ///
+    /// Use [`parse_sysconfigdata`] to generate a hash map of configuration values which may be
+    /// used to build an [`InterpreterConfig`].
+    pub fn from_sysconfigdata(sysconfigdata: &Sysconfigdata) -> Result<Self> {
+        macro_rules! get_key {
+            ($sysconfigdata:expr, $key:literal) => {
+                $sysconfigdata
+                    .get_value($key)
+                    .ok_or(concat!($key, " not found in sysconfigdata file"))
+            };
+        }
+
+        macro_rules! parse_key {
+            ($sysconfigdata:expr, $key:literal) => {
+                get_key!($sysconfigdata, $key)?
+                    .parse()
+                    .context(concat!("could not parse value of ", $key))
+            };
+        }
+
+        let soabi = get_key!(sysconfigdata, "SOABI")?;
+        let implementation = PythonImplementation::from_soabi(soabi)?;
+        let version = parse_key!(sysconfigdata, "VERSION")?;
+        let shared = match sysconfigdata.get_value("Py_ENABLE_SHARED") {
+            Some("1") | Some("true") | Some("True") => true,
+            Some("0") | Some("false") | Some("False") => false,
+            _ => bail!("expected a bool (1/true/True or 0/false/False) for Py_ENABLE_SHARED"),
+        };
+        // macOS framework packages use shared linking (PYTHONFRAMEWORK is the framework name, hence the empty check)
+        let framework = match sysconfigdata.get_value("PYTHONFRAMEWORK") {
+            Some(s) => !s.is_empty(),
+            _ => false,
+        };
+        let lib_dir = get_key!(sysconfigdata, "LIBDIR").ok().map(str::to_string);
+        let lib_name = Some(default_lib_name_unix(
+            version,
+            implementation,
+            sysconfigdata.get_value("LDVERSION"),
+        ));
+        let pointer_width = parse_key!(sysconfigdata, "SIZEOF_VOID_P")
+            .map(|bytes_width: u32| bytes_width * 8)
+            .ok();
+        let build_flags = BuildFlags::from_sysconfigdata(sysconfigdata);
+
+        Ok(InterpreterConfig {
+            implementation,
+            version,
+            shared: shared || framework,
+            abi3: is_abi3(),
+            lib_dir,
+            lib_name,
+            executable: None,
+            pointer_width,
+            build_flags,
+            suppress_build_script_link_lines: false,
+            extra_build_script_lines: vec![],
+        })
+    }
+
+    #[doc(hidden)]
+    pub fn from_path(path: impl AsRef<Path>) -> Result<Self> {
+        let path = path.as_ref();
+        let config_file = std::fs::File::open(path)
+            .with_context(|| format!("failed to open PyO3 config file at {}", path.display()))?;
+        let reader = std::io::BufReader::new(config_file);
+        InterpreterConfig::from_reader(reader)
+    }
+
+    #[doc(hidden)]
+    pub fn from_cargo_dep_env() -> Option<Result<Self>> {
+        cargo_env_var("DEP_PYTHON_PYO3_CONFIG")
+            .map(|buf| InterpreterConfig::from_reader(&*unescape(&buf)))
+    }
+
+    #[doc(hidden)]
+    pub fn from_reader(reader: impl Read) -> Result<Self> {
+        let reader = BufReader::new(reader);
+        let lines = reader.lines();
+
+        macro_rules! parse_value {
+            ($variable:ident, $value:ident) => {
+                $variable = Some($value.trim().parse().context(format!(
+                    concat!(
+                        "failed to parse ",
+                        stringify!($variable),
+                        " from config value '{}'"
+                    ),
+                    $value
+                ))?)
+            };
+        }
+
+        let mut implementation = None;
+        let mut version = None;
+        let mut shared = None;
+        let mut abi3 = None;
+        let mut lib_name = None;
+        let mut lib_dir = None;
+        let mut executable = None;
+        let mut pointer_width = None;
+        let mut build_flags = None;
+        let mut suppress_build_script_link_lines = None;
+        let mut extra_build_script_lines = vec![];
+
+        for (i, line) in lines.enumerate() {
+            let line = line.context("failed to read line from config")?;
+            let mut split = line.splitn(2, '=');
+            let (key, value) = (
+                split
+                    .next()
+                    .expect("first splitn value should always be present"),
+                split
+                    .next()
+                    .ok_or_else(|| format!("expected key=value pair on line {}", i + 1))?,
+            );
+            match key {
+                "implementation" => parse_value!(implementation, value),
+                "version" => parse_value!(version, value),
+                "shared" => parse_value!(shared, value),
+                "abi3" => parse_value!(abi3, value),
+                "lib_name" => parse_value!(lib_name, value),
+                "lib_dir" => parse_value!(lib_dir, value),
+                "executable" => parse_value!(executable, value),
+                "pointer_width" => parse_value!(pointer_width, value),
+                "build_flags" => parse_value!(build_flags, value),
+                "suppress_build_script_link_lines" => {
+                    parse_value!(suppress_build_script_link_lines, value)
+                }
+                "extra_build_script_line" => {
+                    extra_build_script_lines.push(value.to_string());
+                }
+                unknown => warn!("unknown config key `{}`", unknown),
+            }
+        }
+
+        let version = version.ok_or("missing value for version")?;
+        let implementation = implementation.unwrap_or(PythonImplementation::CPython);
+        let abi3 = abi3.unwrap_or(false);
+        // Fixup lib_name if it's not set
+        let lib_name = lib_name.or_else(|| {
+            if let Ok(Ok(target)) = env::var("TARGET").map(|target| target.parse::<Triple>()) {
+                default_lib_name_for_target(version, implementation, abi3, &target)
+            } else {
+                None
+            }
+        });
+
+        Ok(InterpreterConfig {
+            implementation,
+            version,
+            shared: shared.unwrap_or(true),
+            abi3,
+            lib_name,
+            lib_dir,
+            executable,
+            pointer_width,
+            build_flags: build_flags.unwrap_or_default(),
+            suppress_build_script_link_lines: suppress_build_script_link_lines.unwrap_or(false),
+            extra_build_script_lines,
+        })
+    }
+
+    #[cfg(feature = "python3-dll-a")]
+    #[allow(clippy::unnecessary_wraps)]
+    pub fn generate_import_libs(&mut self) -> Result<()> {
+        // Auto generate python3.dll import libraries for Windows targets.
+        if self.lib_dir.is_none() {
+            let target = target_triple_from_env();
+            let py_version = if self.abi3 { None } else { Some(self.version) };
+            self.lib_dir =
+                import_lib::generate_import_lib(&target, self.implementation, py_version)?;
+        }
+        Ok(())
+    }
+
+    #[cfg(not(feature = "python3-dll-a"))]
+    #[allow(clippy::unnecessary_wraps)]
+    pub fn generate_import_libs(&mut self) -> Result<()> {
+        Ok(())
+    }
+
+    #[doc(hidden)]
+    /// Serialize the `InterpreterConfig` and print it to the environment for Cargo to pass along
+    /// to dependent packages during build time.
+    ///
+    /// NB: writing to the cargo environment requires the
+    /// [`links`](https://doc.rust-lang.org/cargo/reference/build-scripts.html#the-links-manifest-key)
+    /// manifest key to be set. In this case that means this is called by the `pyo3-ffi` crate and
+    /// available for dependent package build scripts in `DEP_PYTHON_PYO3_CONFIG`. See
+    /// documentation for the
+    /// [`DEP_<name>_<key>`](https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts)
+    /// environment variable.
+    pub fn to_cargo_dep_env(&self) -> Result<()> {
+        let mut buf = Vec::new();
+        self.to_writer(&mut buf)?;
+        // escape newlines in env var
+        println!("cargo:PYO3_CONFIG={}", escape(&buf));
+        Ok(())
+    }
+
+    #[doc(hidden)]
+    pub fn to_writer(&self, mut writer: impl Write) -> Result<()> {
+        macro_rules! write_line {
+            ($value:ident) => {
+                writeln!(writer, "{}={}", stringify!($value), self.$value).context(concat!(
+                    "failed to write ",
+                    stringify!($value),
+                    " to config"
+                ))
+            };
+        }
+
+        macro_rules! write_option_line {
+            ($value:ident) => {
+                if let Some(value) = &self.$value {
+                    writeln!(writer, "{}={}", stringify!($value), value).context(concat!(
+                        "failed to write ",
+                        stringify!($value),
+                        " to config"
+                    ))
+                } else {
+                    Ok(())
+                }
+            };
+        }
+
+        write_line!(implementation)?;
+        write_line!(version)?;
+        write_line!(shared)?;
+        write_line!(abi3)?;
+        write_option_line!(lib_name)?;
+        write_option_line!(lib_dir)?;
+        write_option_line!(executable)?;
+        write_option_line!(pointer_width)?;
+        write_line!(build_flags)?;
+        write_line!(suppress_build_script_link_lines)?;
+        for line in &self.extra_build_script_lines {
+            writeln!(writer, "extra_build_script_line={}", line)
+                .context("failed to write extra_build_script_line")?;
+        }
+        Ok(())
+    }
+
+    /// Run a python script using the [`InterpreterConfig::executable`].
+    ///
+    /// # Panics
+    ///
+    /// This function will panic if the [`executable`](InterpreterConfig::executable) is `None`.
+    pub fn run_python_script(&self, script: &str) -> Result<String> {
+        run_python_script_with_envs(
+            Path::new(self.executable.as_ref().expect("no interpreter executable")),
+            script,
+            std::iter::empty::<(&str, &str)>(),
+        )
+    }
+
+    /// Run a python script using the [`InterpreterConfig::executable`] with additional
+    /// environment variables (e.g. PYTHONPATH) set.
+    ///
+    /// # Panics
+    ///
+    /// This function will panic if the [`executable`](InterpreterConfig::executable) is `None`.
+    pub fn run_python_script_with_envs<I, K, V>(&self, script: &str, envs: I) -> Result<String>
+    where
+        I: IntoIterator<Item = (K, V)>,
+        K: AsRef<OsStr>,
+        V: AsRef<OsStr>,
+    {
+        run_python_script_with_envs(
+            Path::new(self.executable.as_ref().expect("no interpreter executable")),
+            script,
+            envs,
+        )
+    }
+
+    /// Lowers the configured version to the abi3 version, if set.
+    fn fixup_for_abi3_version(&mut self, abi3_version: Option<PythonVersion>) -> Result<()> {
+        // PyPy doesn't support abi3; don't adjust the version
+        if self.implementation.is_pypy() || self.implementation.is_graalpy() {
+            return Ok(());
+        }
+
+        if let Some(version) = abi3_version {
+            ensure!(
+                version <= self.version,
+                "cannot set a minimum Python version {} higher than the interpreter version {} \
+                (the minimum Python version is implied by the abi3-py3{} feature)",
+                version,
+                self.version,
+                version.minor,
+            );
+
+            self.version = version;
+        }
+
+        Ok(())
+    }
+}
+
+#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
+pub struct PythonVersion {
+    pub major: u8,
+    pub minor: u8,
+}
+
+impl PythonVersion {
+    const PY37: Self = PythonVersion { major: 3, minor: 7 };
+}
+
+impl Display for PythonVersion {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        write!(f, "{}.{}", self.major, self.minor)
+    }
+}
+
+impl FromStr for PythonVersion {
+    type Err = crate::errors::Error;
+
+    fn from_str(value: &str) -> Result<Self, Self::Err> {
+        let mut split = value.splitn(2, '.');
+        let (major, minor) = (
+            split
+                .next()
+                .expect("first splitn value should always be present"),
+            split.next().ok_or("expected major.minor version")?,
+        );
+        Ok(Self {
+            major: major.parse().context("failed to parse major version")?,
+            minor: minor.parse().context("failed to parse minor version")?,
+        })
+    }
+}
+
+#[derive(Debug, Copy, Clone, PartialEq, Eq)]
+pub enum PythonImplementation {
+    CPython,
+    PyPy,
+    GraalPy,
+}
+
+impl PythonImplementation {
+    #[doc(hidden)]
+    pub fn is_pypy(self) -> bool {
+        self == PythonImplementation::PyPy
+    }
+
+    #[doc(hidden)]
+    pub fn is_graalpy(self) -> bool {
+        self == PythonImplementation::GraalPy
+    }
+
+    #[doc(hidden)]
+    pub fn from_soabi(soabi: &str) -> Result<Self> {
+        if soabi.starts_with("pypy") {
+            Ok(PythonImplementation::PyPy)
+        } else if soabi.starts_with("cpython") {
+            Ok(PythonImplementation::CPython)
+        } else if soabi.starts_with("graalpy") {
+            Ok(PythonImplementation::GraalPy)
+        } else {
+            bail!("unsupported Python interpreter");
+        }
+    }
+}
+
+impl Display for PythonImplementation {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        match self {
+            PythonImplementation::CPython => write!(f, "CPython"),
+            PythonImplementation::PyPy => write!(f, "PyPy"),
+            PythonImplementation::GraalPy => write!(f, "GraalVM"),
+        }
+    }
+}
+
+impl FromStr for PythonImplementation {
+    type Err = Error;
+    fn from_str(s: &str) -> Result<Self> {
+        match s {
+            "CPython" => Ok(PythonImplementation::CPython),
+            "PyPy" => Ok(PythonImplementation::PyPy),
+            "GraalVM" => Ok(PythonImplementation::GraalPy),
+            _ => bail!("unknown interpreter: {}", s),
+        }
+    }
+}
+
+/// Checks if we should look for a Python interpreter installation
+/// to get the target interpreter configuration.
+///
+/// Returns `false` if `PYO3_NO_PYTHON` environment variable is set.
+fn have_python_interpreter() -> bool {
+    env_var("PYO3_NO_PYTHON").is_none()
+}
+
+/// Checks if `abi3` or any of the `abi3-py3*` features is enabled for the PyO3 crate.
+///
+/// Must be called from a PyO3 crate build script.
+fn is_abi3() -> bool {
+    cargo_env_var("CARGO_FEATURE_ABI3").is_some()
+        || env_var("PYO3_USE_ABI3_FORWARD_COMPATIBILITY").map_or(false, |os_str| os_str == "1")
+}
+
+/// Gets the minimum supported Python version from PyO3 `abi3-py*` features.
+///
+/// Must be called from a PyO3 crate build script.
+pub fn get_abi3_version() -> Option<PythonVersion> {
+    let minor_version = (MINIMUM_SUPPORTED_VERSION.minor..=ABI3_MAX_MINOR)
+        .find(|i| cargo_env_var(&format!("CARGO_FEATURE_ABI3_PY3{}", i)).is_some());
+    minor_version.map(|minor| PythonVersion { major: 3, minor })
+}
+
+/// Checks if the `extension-module` feature is enabled for the PyO3 crate.
+///
+/// Must be called from a PyO3 crate build script.
+pub fn is_extension_module() -> bool {
+    cargo_env_var("CARGO_FEATURE_EXTENSION_MODULE").is_some()
+}
+
+/// Checks if we need to link to `libpython` for the current build target.
+///
+/// Must be called from a PyO3 crate build script.
+pub fn is_linking_libpython() -> bool {
+    is_linking_libpython_for_target(&target_triple_from_env())
+}
+
+/// Checks if we need to link to `libpython` for the target.
+///
+/// Must be called from a PyO3 crate build script.
+fn is_linking_libpython_for_target(target: &Triple) -> bool {
+    target.operating_system == OperatingSystem::Windows
+        // See https://github.com/PyO3/pyo3/issues/4068#issuecomment-2051159852
+        || target.operating_system == OperatingSystem::Aix
+        || target.environment == Environment::Android
+        || target.environment == Environment::Androideabi
+        || !is_extension_module()
+}
+
+/// Checks if we need to discover the Python library directory
+/// to link the extension module binary.
+///
+/// Must be called from a PyO3 crate build script.
+fn require_libdir_for_target(target: &Triple) -> bool {
+    let is_generating_libpython = cfg!(feature = "python3-dll-a")
+        && target.operating_system == OperatingSystem::Windows
+        && is_abi3();
+
+    is_linking_libpython_for_target(target) && !is_generating_libpython
+}
+
+/// Configuration needed by PyO3 to cross-compile for a target platform.
+///
+/// Usually this is collected from the environment (i.e. `PYO3_CROSS_*` and `CARGO_CFG_TARGET_*`)
+/// when a cross-compilation configuration is detected.
+#[derive(Debug, PartialEq, Eq)]
+pub struct CrossCompileConfig {
+    /// The directory containing the Python library to link against.
+    pub lib_dir: Option<PathBuf>,
+
+    /// The version of the Python library to link against.
+    version: Option<PythonVersion>,
+
+    /// The target Python implementation hint (CPython, PyPy, GraalPy, ...)
+    implementation: Option<PythonImplementation>,
+
+    /// The compile target triple (e.g. aarch64-unknown-linux-gnu)
+    target: Triple,
+}
+
+impl CrossCompileConfig {
+    /// Creates a new cross compile config struct from PyO3 environment variables
+    /// and the build environment when cross compilation mode is detected.
+    ///
+    /// Returns `None` when not cross compiling.
+    fn try_from_env_vars_host_target(
+        env_vars: CrossCompileEnvVars,
+        host: &Triple,
+        target: &Triple,
+    ) -> Result<Option<Self>> {
+        if env_vars.any() || Self::is_cross_compiling_from_to(host, target) {
+            let lib_dir = env_vars.lib_dir_path()?;
+            let version = env_vars.parse_version()?;
+            let implementation = env_vars.parse_implementation()?;
+            let target = target.clone();
+
+            Ok(Some(CrossCompileConfig {
+                lib_dir,
+                version,
+                implementation,
+                target,
+            }))
+        } else {
+            Ok(None)
+        }
+    }
+
+    /// Checks if compiling on `host` for `target` required "real" cross compilation.
+    ///
+    /// Returns `false` if the target Python interpreter can run on the host.
+    fn is_cross_compiling_from_to(host: &Triple, target: &Triple) -> bool {
+        // Not cross-compiling if arch-vendor-os is all the same
+        // e.g. x86_64-unknown-linux-musl on x86_64-unknown-linux-gnu host
+        //      x86_64-pc-windows-gnu on x86_64-pc-windows-msvc host
+        let mut compatible = host.architecture == target.architecture
+            && host.vendor == target.vendor
+            && host.operating_system == target.operating_system;
+
+        // Not cross-compiling to compile for 32-bit Python from windows 64-bit
+        compatible |= target.operating_system == OperatingSystem::Windows
+            && host.operating_system == OperatingSystem::Windows;
+
+        // Not cross-compiling to compile for x86-64 Python from macOS arm64 and vice versa
+        compatible |= target.operating_system == OperatingSystem::Darwin
+            && host.operating_system == OperatingSystem::Darwin;
+
+        !compatible
+    }
+
+    /// Converts `lib_dir` member field to an UTF-8 string.
+    ///
+    /// The conversion can not fail because `PYO3_CROSS_LIB_DIR` variable
+    /// is ensured contain a valid UTF-8 string.
+    fn lib_dir_string(&self) -> Option<String> {
+        self.lib_dir
+            .as_ref()
+            .map(|s| s.to_str().unwrap().to_owned())
+    }
+}
+
+/// PyO3-specific cross compile environment variable values
+struct CrossCompileEnvVars {
+    /// `PYO3_CROSS`
+    pyo3_cross: Option<OsString>,
+    /// `PYO3_CROSS_LIB_DIR`
+    pyo3_cross_lib_dir: Option<OsString>,
+    /// `PYO3_CROSS_PYTHON_VERSION`
+    pyo3_cross_python_version: Option<OsString>,
+    /// `PYO3_CROSS_PYTHON_IMPLEMENTATION`
+    pyo3_cross_python_implementation: Option<OsString>,
+}
+
+impl CrossCompileEnvVars {
+    /// Grabs the PyO3 cross-compile variables from the environment.
+    ///
+    /// Registers the build script to rerun if any of the variables changes.
+    fn from_env() -> Self {
+        CrossCompileEnvVars {
+            pyo3_cross: env_var("PYO3_CROSS"),
+            pyo3_cross_lib_dir: env_var("PYO3_CROSS_LIB_DIR"),
+            pyo3_cross_python_version: env_var("PYO3_CROSS_PYTHON_VERSION"),
+            pyo3_cross_python_implementation: env_var("PYO3_CROSS_PYTHON_IMPLEMENTATION"),
+        }
+    }
+
+    /// Checks if any of the variables is set.
+    fn any(&self) -> bool {
+        self.pyo3_cross.is_some()
+            || self.pyo3_cross_lib_dir.is_some()
+            || self.pyo3_cross_python_version.is_some()
+            || self.pyo3_cross_python_implementation.is_some()
+    }
+
+    /// Parses `PYO3_CROSS_PYTHON_VERSION` environment variable value
+    /// into `PythonVersion`.
+    fn parse_version(&self) -> Result<Option<PythonVersion>> {
+        let version = self
+            .pyo3_cross_python_version
+            .as_ref()
+            .map(|os_string| {
+                let utf8_str = os_string
+                    .to_str()
+                    .ok_or("PYO3_CROSS_PYTHON_VERSION is not valid a UTF-8 string")?;
+                utf8_str
+                    .parse()
+                    .context("failed to parse PYO3_CROSS_PYTHON_VERSION")
+            })
+            .transpose()?;
+
+        Ok(version)
+    }
+
+    /// Parses `PYO3_CROSS_PYTHON_IMPLEMENTATION` environment variable value
+    /// into `PythonImplementation`.
+    fn parse_implementation(&self) -> Result<Option<PythonImplementation>> {
+        let implementation = self
+            .pyo3_cross_python_implementation
+            .as_ref()
+            .map(|os_string| {
+                let utf8_str = os_string
+                    .to_str()
+                    .ok_or("PYO3_CROSS_PYTHON_IMPLEMENTATION is not valid a UTF-8 string")?;
+                utf8_str
+                    .parse()
+                    .context("failed to parse PYO3_CROSS_PYTHON_IMPLEMENTATION")
+            })
+            .transpose()?;
+
+        Ok(implementation)
+    }
+
+    /// Converts the stored `PYO3_CROSS_LIB_DIR` variable value (if any)
+    /// into a `PathBuf` instance.
+    ///
+    /// Ensures that the path is a valid UTF-8 string.
+    fn lib_dir_path(&self) -> Result<Option<PathBuf>> {
+        let lib_dir = self.pyo3_cross_lib_dir.as_ref().map(PathBuf::from);
+
+        if let Some(dir) = lib_dir.as_ref() {
+            ensure!(
+                dir.to_str().is_some(),
+                "PYO3_CROSS_LIB_DIR variable value is not a valid UTF-8 string"
+            );
+        }
+
+        Ok(lib_dir)
+    }
+}
+
+/// Detect whether we are cross compiling and return an assembled CrossCompileConfig if so.
+///
+/// This function relies on PyO3 cross-compiling environment variables:
+///
+/// * `PYO3_CROSS`: If present, forces PyO3 to configure as a cross-compilation.
+/// * `PYO3_CROSS_LIB_DIR`: If present, must be set to the directory containing
+///   the target's libpython DSO and the associated `_sysconfigdata*.py` file for
+///   Unix-like targets, or the Python DLL import libraries for the Windows target.
+/// * `PYO3_CROSS_PYTHON_VERSION`: Major and minor version (e.g. 3.9) of the target Python
+///   installation. This variable is only needed if PyO3 cannnot determine the version to target
+///   from `abi3-py3*` features, or if there are multiple versions of Python present in
+///   `PYO3_CROSS_LIB_DIR`.
+///
+/// See the [PyO3 User Guide](https://pyo3.rs/) for more info on cross-compiling.
+pub fn cross_compiling_from_to(
+    host: &Triple,
+    target: &Triple,
+) -> Result<Option<CrossCompileConfig>> {
+    let env_vars = CrossCompileEnvVars::from_env();
+    CrossCompileConfig::try_from_env_vars_host_target(env_vars, host, target)
+}
+
+/// Detect whether we are cross compiling from Cargo and `PYO3_CROSS_*` environment
+/// variables and return an assembled `CrossCompileConfig` if so.
+///
+/// This must be called from PyO3's build script, because it relies on environment
+/// variables such as `CARGO_CFG_TARGET_OS` which aren't available at any other time.
+pub fn cross_compiling_from_cargo_env() -> Result<Option<CrossCompileConfig>> {
+    let env_vars = CrossCompileEnvVars::from_env();
+    let host = Triple::host();
+    let target = target_triple_from_env();
+
+    CrossCompileConfig::try_from_env_vars_host_target(env_vars, &host, &target)
+}
+
+#[allow(non_camel_case_types)]
+#[derive(Debug, Clone, Hash, PartialEq, Eq)]
+pub enum BuildFlag {
+    Py_DEBUG,
+    Py_REF_DEBUG,
+    Py_TRACE_REFS,
+    COUNT_ALLOCS,
+    Other(String),
+}
+
+impl Display for BuildFlag {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        match self {
+            BuildFlag::Other(flag) => write!(f, "{}", flag),
+            _ => write!(f, "{:?}", self),
+        }
+    }
+}
+
+impl FromStr for BuildFlag {
+    type Err = std::convert::Infallible;
+    fn from_str(s: &str) -> Result<Self, Self::Err> {
+        match s {
+            "Py_DEBUG" => Ok(BuildFlag::Py_DEBUG),
+            "Py_REF_DEBUG" => Ok(BuildFlag::Py_REF_DEBUG),
+            "Py_TRACE_REFS" => Ok(BuildFlag::Py_TRACE_REFS),
+            "COUNT_ALLOCS" => Ok(BuildFlag::COUNT_ALLOCS),
+            other => Ok(BuildFlag::Other(other.to_owned())),
+        }
+    }
+}
+
+/// A list of python interpreter compile-time preprocessor defines that
+/// we will pick up and pass to rustc via `--cfg=py_sys_config={varname}`;
+/// this allows using them conditional cfg attributes in the .rs files, so
+///
+/// ```rust
+/// #[cfg(py_sys_config="{varname}")]
+/// # struct Foo;
+/// ```
+///
+/// is the equivalent of `#ifdef {varname}` in C.
+///
+/// see Misc/SpecialBuilds.txt in the python source for what these mean.
+#[cfg_attr(test, derive(Debug, PartialEq, Eq))]
+#[derive(Clone, Default)]
+pub struct BuildFlags(pub HashSet<BuildFlag>);
+
+impl BuildFlags {
+    const ALL: [BuildFlag; 4] = [
+        BuildFlag::Py_DEBUG,
+        BuildFlag::Py_REF_DEBUG,
+        BuildFlag::Py_TRACE_REFS,
+        BuildFlag::COUNT_ALLOCS,
+    ];
+
+    pub fn new() -> Self {
+        BuildFlags(HashSet::new())
+    }
+
+    fn from_sysconfigdata(config_map: &Sysconfigdata) -> Self {
+        Self(
+            BuildFlags::ALL
+                .iter()
+                .filter(|flag| {
+                    config_map
+                        .get_value(flag.to_string())
+                        .map_or(false, |value| value == "1")
+                })
+                .cloned()
+                .collect(),
+        )
+        .fixup()
+    }
+
+    /// Examine python's compile flags to pass to cfg by launching
+    /// the interpreter and printing variables of interest from
+    /// sysconfig.get_config_vars.
+    fn from_interpreter(interpreter: impl AsRef<Path>) -> Result<Self> {
+        // sysconfig is missing all the flags on windows, so we can't actually
+        // query the interpreter directly for its build flags.
+        if cfg!(windows) {
+            return Ok(Self::new());
+        }
+
+        let mut script = String::from("import sysconfig\n");
+        script.push_str("config = sysconfig.get_config_vars()\n");
+
+        for k in &BuildFlags::ALL {
+            use std::fmt::Write;
+            writeln!(&mut script, "print(config.get('{}', '0'))", k).unwrap();
+        }
+
+        let stdout = run_python_script(interpreter.as_ref(), &script)?;
+        let split_stdout: Vec<&str> = stdout.trim_end().lines().collect();
+        ensure!(
+            split_stdout.len() == BuildFlags::ALL.len(),
+            "Python stdout len didn't return expected number of lines: {}",
+            split_stdout.len()
+        );
+        let flags = BuildFlags::ALL
+            .iter()
+            .zip(split_stdout)
+            .filter(|(_, flag_value)| *flag_value == "1")
+            .map(|(flag, _)| flag.clone())
+            .collect();
+
+        Ok(Self(flags).fixup())
+    }
+
+    fn fixup(mut self) -> Self {
+        if self.0.contains(&BuildFlag::Py_DEBUG) {
+            self.0.insert(BuildFlag::Py_REF_DEBUG);
+        }
+
+        self
+    }
+}
+
+impl Display for BuildFlags {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        let mut first = true;
+        for flag in &self.0 {
+            if first {
+                first = false;
+            } else {
+                write!(f, ",")?;
+            }
+            write!(f, "{}", flag)?;
+        }
+        Ok(())
+    }
+}
+
+impl FromStr for BuildFlags {
+    type Err = std::convert::Infallible;
+
+    fn from_str(value: &str) -> Result<Self, Self::Err> {
+        let mut flags = HashSet::new();
+        for flag in value.split_terminator(',') {
+            flags.insert(flag.parse().unwrap());
+        }
+        Ok(BuildFlags(flags))
+    }
+}
+
+fn parse_script_output(output: &str) -> HashMap<String, String> {
+    output
+        .lines()
+        .filter_map(|line| {
+            let mut i = line.splitn(2, ' ');
+            Some((i.next()?.into(), i.next()?.into()))
+        })
+        .collect()
+}
+
+/// Parsed data from Python sysconfigdata file
+///
+/// A hash map of all values from a sysconfigdata file.
+pub struct Sysconfigdata(HashMap<String, String>);
+
+impl Sysconfigdata {
+    pub fn get_value<S: AsRef<str>>(&self, k: S) -> Option<&str> {
+        self.0.get(k.as_ref()).map(String::as_str)
+    }
+
+    #[allow(dead_code)]
+    fn new() -> Self {
+        Sysconfigdata(HashMap::new())
+    }
+
+    #[allow(dead_code)]
+    fn insert<S: Into<String>>(&mut self, k: S, v: S) {
+        self.0.insert(k.into(), v.into());
+    }
+}
+
+/// Parse sysconfigdata file
+///
+/// The sysconfigdata is simply a dictionary containing all the build time variables used for the
+/// python executable and library. This function necessitates a python interpreter on the host
+/// machine to work. Here it is read into a `Sysconfigdata` (hash map), which can be turned into an
+/// [`InterpreterConfig`] using
+/// [`from_sysconfigdata`](InterpreterConfig::from_sysconfigdata).
+pub fn parse_sysconfigdata(sysconfigdata_path: impl AsRef<Path>) -> Result<Sysconfigdata> {
+    let sysconfigdata_path = sysconfigdata_path.as_ref();
+    let mut script = fs::read_to_string(sysconfigdata_path).with_context(|| {
+        format!(
+            "failed to read config from {}",
+            sysconfigdata_path.display()
+        )
+    })?;
+    script += r#"
+for key, val in build_time_vars.items():
+    print(key, val)
+"#;
+
+    let output = run_python_script(&find_interpreter()?, &script)?;
+
+    Ok(Sysconfigdata(parse_script_output(&output)))
+}
+
+fn starts_with(entry: &DirEntry, pat: &str) -> bool {
+    let name = entry.file_name();
+    name.to_string_lossy().starts_with(pat)
+}
+fn ends_with(entry: &DirEntry, pat: &str) -> bool {
+    let name = entry.file_name();
+    name.to_string_lossy().ends_with(pat)
+}
+
+/// Finds the sysconfigdata file when the target Python library directory is set.
+///
+/// Returns `None` if the library directory is not available, and a runtime error
+/// when no or multiple sysconfigdata files are found.
+fn find_sysconfigdata(cross: &CrossCompileConfig) -> Result<Option<PathBuf>> {
+    let mut sysconfig_paths = find_all_sysconfigdata(cross)?;
+    if sysconfig_paths.is_empty() {
+        if let Some(lib_dir) = cross.lib_dir.as_ref() {
+            bail!("Could not find _sysconfigdata*.py in {}", lib_dir.display());
+        } else {
+            // Continue with the default configuration when PYO3_CROSS_LIB_DIR is not set.
+            return Ok(None);
+        }
+    } else if sysconfig_paths.len() > 1 {
+        let mut error_msg = String::from(
+            "Detected multiple possible Python versions. Please set either the \
+            PYO3_CROSS_PYTHON_VERSION variable to the wanted version or the \
+            _PYTHON_SYSCONFIGDATA_NAME variable to the wanted sysconfigdata file name.\n\n\
+            sysconfigdata files found:",
+        );
+        for path in sysconfig_paths {
+            use std::fmt::Write;
+            write!(&mut error_msg, "\n\t{}", path.display()).unwrap();
+        }
+        bail!("{}\n", error_msg);
+    }
+
+    Ok(Some(sysconfig_paths.remove(0)))
+}
+
+/// Finds `_sysconfigdata*.py` files for detected Python interpreters.
+///
+/// From the python source for `_sysconfigdata*.py` is always going to be located at
+/// `build/lib.{PLATFORM}-{PY_MINOR_VERSION}` when built from source. The [exact line][1] is defined as:
+///
+/// ```py
+/// pybuilddir = 'build/lib.%s-%s' % (get_platform(), sys.version_info[:2])
+/// ```
+///
+/// Where get_platform returns a kebab-case formatted string containing the os, the architecture and
+/// possibly the os' kernel version (not the case on linux). However, when installed using a package
+/// manager, the `_sysconfigdata*.py` file is installed in the `${PREFIX}/lib/python3.Y/` directory.
+/// The `_sysconfigdata*.py` is generally in a sub-directory of the location of `libpython3.Y.so`.
+/// So we must find the file in the following possible locations:
+///
+/// ```sh
+/// # distribution from package manager, (lib_dir may or may not include lib/)
+/// ${INSTALL_PREFIX}/lib/python3.Y/_sysconfigdata*.py
+/// ${INSTALL_PREFIX}/lib/libpython3.Y.so
+/// ${INSTALL_PREFIX}/lib/python3.Y/config-3.Y-${HOST_TRIPLE}/libpython3.Y.so
+///
+/// # Built from source from host
+/// ${CROSS_COMPILED_LOCATION}/build/lib.linux-x86_64-Y/_sysconfigdata*.py
+/// ${CROSS_COMPILED_LOCATION}/libpython3.Y.so
+///
+/// # if cross compiled, kernel release is only present on certain OS targets.
+/// ${CROSS_COMPILED_LOCATION}/build/lib.{OS}(-{OS-KERNEL-RELEASE})?-{ARCH}-Y/_sysconfigdata*.py
+/// ${CROSS_COMPILED_LOCATION}/libpython3.Y.so
+///
+/// # PyPy includes a similar file since v73
+/// ${INSTALL_PREFIX}/lib/pypy3.Y/_sysconfigdata.py
+/// ${INSTALL_PREFIX}/lib_pypy/_sysconfigdata.py
+/// ```
+///
+/// [1]: https://github.com/python/cpython/blob/3.5/Lib/sysconfig.py#L389
+///
+/// Returns an empty vector when the target Python library directory
+/// is not set via `PYO3_CROSS_LIB_DIR`.
+pub fn find_all_sysconfigdata(cross: &CrossCompileConfig) -> Result<Vec<PathBuf>> {
+    let sysconfig_paths = if let Some(lib_dir) = cross.lib_dir.as_ref() {
+        search_lib_dir(lib_dir, cross).with_context(|| {
+            format!(
+                "failed to search the lib dir at 'PYO3_CROSS_LIB_DIR={}'",
+                lib_dir.display()
+            )
+        })?
+    } else {
+        return Ok(Vec::new());
+    };
+
+    let sysconfig_name = env_var("_PYTHON_SYSCONFIGDATA_NAME");
+    let mut sysconfig_paths = sysconfig_paths
+        .iter()
+        .filter_map(|p| {
+            let canonical = fs::canonicalize(p).ok();
+            match &sysconfig_name {
+                Some(_) => canonical.filter(|p| p.file_stem() == sysconfig_name.as_deref()),
+                None => canonical,
+            }
+        })
+        .collect::<Vec<PathBuf>>();
+
+    sysconfig_paths.sort();
+    sysconfig_paths.dedup();
+
+    Ok(sysconfig_paths)
+}
+
+fn is_pypy_lib_dir(path: &str, v: &Option<PythonVersion>) -> bool {
+    let pypy_version_pat = if let Some(v) = v {
+        format!("pypy{}", v)
+    } else {
+        "pypy3.".into()
+    };
+    path == "lib_pypy" || path.starts_with(&pypy_version_pat)
+}
+
+fn is_graalpy_lib_dir(path: &str, v: &Option<PythonVersion>) -> bool {
+    let graalpy_version_pat = if let Some(v) = v {
+        format!("graalpy{}", v)
+    } else {
+        "graalpy2".into()
+    };
+    path == "lib_graalpython" || path.starts_with(&graalpy_version_pat)
+}
+
+fn is_cpython_lib_dir(path: &str, v: &Option<PythonVersion>) -> bool {
+    let cpython_version_pat = if let Some(v) = v {
+        format!("python{}", v)
+    } else {
+        "python3.".into()
+    };
+    path.starts_with(&cpython_version_pat)
+}
+
+/// recursive search for _sysconfigdata, returns all possibilities of sysconfigdata paths
+fn search_lib_dir(path: impl AsRef<Path>, cross: &CrossCompileConfig) -> Result<Vec<PathBuf>> {
+    let mut sysconfig_paths = vec![];
+    for f in fs::read_dir(path.as_ref()).with_context(|| {
+        format!(
+            "failed to list the entries in '{}'",
+            path.as_ref().display()
+        )
+    })? {
+        sysconfig_paths.extend(match &f {
+            // Python 3.7+ sysconfigdata with platform specifics
+            Ok(f) if starts_with(f, "_sysconfigdata_") && ends_with(f, "py") => vec![f.path()],
+            Ok(f) if f.metadata().map_or(false, |metadata| metadata.is_dir()) => {
+                let file_name = f.file_name();
+                let file_name = file_name.to_string_lossy();
+                if file_name == "build" || file_name == "lib" {
+                    search_lib_dir(f.path(), cross)?
+                } else if file_name.starts_with("lib.") {
+                    // check if right target os
+                    if !file_name.contains(&cross.target.operating_system.to_string()) {
+                        continue;
+                    }
+                    // Check if right arch
+                    if !file_name.contains(&cross.target.architecture.to_string()) {
+                        continue;
+                    }
+                    search_lib_dir(f.path(), cross)?
+                } else if is_cpython_lib_dir(&file_name, &cross.version)
+                    || is_pypy_lib_dir(&file_name, &cross.version)
+                    || is_graalpy_lib_dir(&file_name, &cross.version)
+                {
+                    search_lib_dir(f.path(), cross)?
+                } else {
+                    continue;
+                }
+            }
+            _ => continue,
+        });
+    }
+    // If we got more than one file, only take those that contain the arch name.
+    // For ubuntu 20.04 with host architecture x86_64 and a foreign architecture of armhf
+    // this reduces the number of candidates to 1:
+    //
+    // $ find /usr/lib/python3.8/ -name '_sysconfigdata*.py' -not -lname '*'
+    //  /usr/lib/python3.8/_sysconfigdata__x86_64-linux-gnu.py
+    //  /usr/lib/python3.8/_sysconfigdata__arm-linux-gnueabihf.py
+    if sysconfig_paths.len() > 1 {
+        let temp = sysconfig_paths
+            .iter()
+            .filter(|p| {
+                p.to_string_lossy()
+                    .contains(&cross.target.architecture.to_string())
+            })
+            .cloned()
+            .collect::<Vec<PathBuf>>();
+        if !temp.is_empty() {
+            sysconfig_paths = temp;
+        }
+    }
+
+    Ok(sysconfig_paths)
+}
+
+/// Find cross compilation information from sysconfigdata file
+///
+/// first find sysconfigdata file which follows the pattern [`_sysconfigdata_{abi}_{platform}_{multiarch}`][1]
+///
+/// [1]: https://github.com/python/cpython/blob/3.8/Lib/sysconfig.py#L348
+///
+/// Returns `None` when the target Python library directory is not set.
+fn cross_compile_from_sysconfigdata(
+    cross_compile_config: &CrossCompileConfig,
+) -> Result<Option<InterpreterConfig>> {
+    if let Some(path) = find_sysconfigdata(cross_compile_config)? {
+        let data = parse_sysconfigdata(path)?;
+        let config = InterpreterConfig::from_sysconfigdata(&data)?;
+
+        Ok(Some(config))
+    } else {
+        Ok(None)
+    }
+}
+
+/// Generates "default" cross compilation information for the target.
+///
+/// This should work for most CPython extension modules when targeting
+/// Windows, macOS and Linux.
+///
+/// Must be called from a PyO3 crate build script.
+#[allow(unused_mut)]
+fn default_cross_compile(cross_compile_config: &CrossCompileConfig) -> Result<InterpreterConfig> {
+    let version = cross_compile_config
+        .version
+        .or_else(get_abi3_version)
+        .ok_or_else(||
+            format!(
+                "PYO3_CROSS_PYTHON_VERSION or an abi3-py3* feature must be specified \
+                when cross-compiling and PYO3_CROSS_LIB_DIR is not set.\n\
+                = help: see the PyO3 user guide for more information: https://pyo3.rs/v{}/building-and-distribution.html#cross-compiling",
+                env!("CARGO_PKG_VERSION")
+            )
+        )?;
+
+    let abi3 = is_abi3();
+    let implementation = cross_compile_config
+        .implementation
+        .unwrap_or(PythonImplementation::CPython);
+
+    let lib_name =
+        default_lib_name_for_target(version, implementation, abi3, &cross_compile_config.target);
+
+    let mut lib_dir = cross_compile_config.lib_dir_string();
+
+    // Auto generate python3.dll import libraries for Windows targets.
+    #[cfg(feature = "python3-dll-a")]
+    if lib_dir.is_none() {
+        let py_version = if abi3 { None } else { Some(version) };
+        lib_dir = self::import_lib::generate_import_lib(
+            &cross_compile_config.target,
+            cross_compile_config
+                .implementation
+                .unwrap_or(PythonImplementation::CPython),
+            py_version,
+        )?;
+    }
+
+    Ok(InterpreterConfig {
+        implementation,
+        version,
+        shared: true,
+        abi3,
+        lib_name,
+        lib_dir,
+        executable: None,
+        pointer_width: None,
+        build_flags: BuildFlags::default(),
+        suppress_build_script_link_lines: false,
+        extra_build_script_lines: vec![],
+    })
+}
+
+/// Generates "default" interpreter configuration when compiling "abi3" extensions
+/// without a working Python interpreter.
+///
+/// `version` specifies the minimum supported Stable ABI CPython version.
+///
+/// This should work for most CPython extension modules when compiling on
+/// Windows, macOS and Linux.
+///
+/// Must be called from a PyO3 crate build script.
+fn default_abi3_config(host: &Triple, version: PythonVersion) -> InterpreterConfig {
+    // FIXME: PyPy & GraalPy do not support the Stable ABI.
+    let implementation = PythonImplementation::CPython;
+    let abi3 = true;
+
+    let lib_name = if host.operating_system == OperatingSystem::Windows {
+        Some(default_lib_name_windows(
+            version,
+            implementation,
+            abi3,
+            false,
+            false,
+        ))
+    } else {
+        None
+    };
+
+    InterpreterConfig {
+        implementation,
+        version,
+        shared: true,
+        abi3,
+        lib_name,
+        lib_dir: None,
+        executable: None,
+        pointer_width: None,
+        build_flags: BuildFlags::default(),
+        suppress_build_script_link_lines: false,
+        extra_build_script_lines: vec![],
+    }
+}
+
+/// Detects the cross compilation target interpreter configuration from all
+/// available sources (PyO3 environment variables, Python sysconfigdata, etc.).
+///
+/// Returns the "default" target interpreter configuration for Windows and
+/// when no target Python interpreter is found.
+///
+/// Must be called from a PyO3 crate build script.
+fn load_cross_compile_config(
+    cross_compile_config: CrossCompileConfig,
+) -> Result<InterpreterConfig> {
+    let windows = cross_compile_config.target.operating_system == OperatingSystem::Windows;
+
+    let config = if windows || !have_python_interpreter() {
+        // Load the defaults for Windows even when `PYO3_CROSS_LIB_DIR` is set
+        // since it has no sysconfigdata files in it.
+        // Also, do not try to look for sysconfigdata when `PYO3_NO_PYTHON` variable is set.
+        default_cross_compile(&cross_compile_config)?
+    } else if let Some(config) = cross_compile_from_sysconfigdata(&cross_compile_config)? {
+        // Try to find and parse sysconfigdata files on other targets.
+        config
+    } else {
+        // Fall back to the defaults when nothing else can be done.
+        default_cross_compile(&cross_compile_config)?
+    };
+
+    if config.lib_name.is_some() && config.lib_dir.is_none() {
+        warn!(
+            "The output binary will link to libpython, \
+            but PYO3_CROSS_LIB_DIR environment variable is not set. \
+            Ensure that the target Python library directory is \
+            in the rustc native library search path."
+        );
+    }
+
+    Ok(config)
+}
+
+// Link against python3.lib for the stable ABI on Windows.
+// See https://www.python.org/dev/peps/pep-0384/#linkage
+//
+// This contains only the limited ABI symbols.
+const WINDOWS_ABI3_LIB_NAME: &str = "python3";
+
+fn default_lib_name_for_target(
+    version: PythonVersion,
+    implementation: PythonImplementation,
+    abi3: bool,
+    target: &Triple,
+) -> Option<String> {
+    if target.operating_system == OperatingSystem::Windows {
+        Some(default_lib_name_windows(
+            version,
+            implementation,
+            abi3,
+            false,
+            false,
+        ))
+    } else if is_linking_libpython_for_target(target) {
+        Some(default_lib_name_unix(version, implementation, None))
+    } else {
+        None
+    }
+}
+
+fn default_lib_name_windows(
+    version: PythonVersion,
+    implementation: PythonImplementation,
+    abi3: bool,
+    mingw: bool,
+    debug: bool,
+) -> String {
+    if debug {
+        // CPython bug: linking against python3_d.dll raises error
+        // https://github.com/python/cpython/issues/101614
+        format!("python{}{}_d", version.major, version.minor)
+    } else if abi3 && !(implementation.is_pypy() || implementation.is_graalpy()) {
+        WINDOWS_ABI3_LIB_NAME.to_owned()
+    } else if mingw {
+        // https://packages.msys2.org/base/mingw-w64-python
+        format!("python{}.{}", version.major, version.minor)
+    } else {
+        format!("python{}{}", version.major, version.minor)
+    }
+}
+
+fn default_lib_name_unix(
+    version: PythonVersion,
+    implementation: PythonImplementation,
+    ld_version: Option<&str>,
+) -> String {
+    match implementation {
+        PythonImplementation::CPython => match ld_version {
+            Some(ld_version) => format!("python{}", ld_version),
+            None => {
+                if version > PythonVersion::PY37 {
+                    // PEP 3149 ABI version tags are finally gone
+                    format!("python{}.{}", version.major, version.minor)
+                } else {
+                    // Work around https://bugs.python.org/issue36707
+                    format!("python{}.{}m", version.major, version.minor)
+                }
+            }
+        },
+        PythonImplementation::PyPy => {
+            if version >= (PythonVersion { major: 3, minor: 9 }) {
+                match ld_version {
+                    Some(ld_version) => format!("pypy{}-c", ld_version),
+                    None => format!("pypy{}.{}-c", version.major, version.minor),
+                }
+            } else {
+                format!("pypy{}-c", version.major)
+            }
+        }
+        PythonImplementation::GraalPy => "python-native".to_string(),
+    }
+}
+
+/// Run a python script using the specified interpreter binary.
+fn run_python_script(interpreter: &Path, script: &str) -> Result<String> {
+    run_python_script_with_envs(interpreter, script, std::iter::empty::<(&str, &str)>())
+}
+
+/// Run a python script using the specified interpreter binary with additional environment
+/// variables (e.g. PYTHONPATH) set.
+fn run_python_script_with_envs<I, K, V>(interpreter: &Path, script: &str, envs: I) -> Result<String>
+where
+    I: IntoIterator<Item = (K, V)>,
+    K: AsRef<OsStr>,
+    V: AsRef<OsStr>,
+{
+    let out = Command::new(interpreter)
+        .env("PYTHONIOENCODING", "utf-8")
+        .envs(envs)
+        .stdin(Stdio::piped())
+        .stdout(Stdio::piped())
+        .stderr(Stdio::inherit())
+        .spawn()
+        .and_then(|mut child| {
+            child
+                .stdin
+                .as_mut()
+                .expect("piped stdin")
+                .write_all(script.as_bytes())?;
+            child.wait_with_output()
+        });
+
+    match out {
+        Err(err) => bail!(
+            "failed to run the Python interpreter at {}: {}",
+            interpreter.display(),
+            err
+        ),
+        Ok(ok) if !ok.status.success() => bail!("Python script failed"),
+        Ok(ok) => Ok(String::from_utf8(ok.stdout)
+            .context("failed to parse Python script output as utf-8")?),
+    }
+}
+
+fn venv_interpreter(virtual_env: &OsStr, windows: bool) -> PathBuf {
+    if windows {
+        Path::new(virtual_env).join("Scripts").join("python.exe")
+    } else {
+        Path::new(virtual_env).join("bin").join("python")
+    }
+}
+
+fn conda_env_interpreter(conda_prefix: &OsStr, windows: bool) -> PathBuf {
+    if windows {
+        Path::new(conda_prefix).join("python.exe")
+    } else {
+        Path::new(conda_prefix).join("bin").join("python")
+    }
+}
+
+fn get_env_interpreter() -> Option<PathBuf> {
+    match (env_var("VIRTUAL_ENV"), env_var("CONDA_PREFIX")) {
+        // Use cfg rather than CARGO_CFG_TARGET_OS because this affects where files are located on the
+        // build host
+        (Some(dir), None) => Some(venv_interpreter(&dir, cfg!(windows))),
+        (None, Some(dir)) => Some(conda_env_interpreter(&dir, cfg!(windows))),
+        (Some(_), Some(_)) => {
+            warn!(
+                "Both VIRTUAL_ENV and CONDA_PREFIX are set. PyO3 will ignore both of these for \
+                 locating the Python interpreter until you unset one of them."
+            );
+            None
+        }
+        (None, None) => None,
+    }
+}
+
+/// Attempts to locate a python interpreter.
+///
+/// Locations are checked in the order listed:
+///   1. If `PYO3_PYTHON` is set, this interpreter is used.
+///   2. If in a virtualenv, that environment's interpreter is used.
+///   3. `python`, if this is functional a Python 3.x interpreter
+///   4. `python3`, as above
+pub fn find_interpreter() -> Result<PathBuf> {
+    // Trigger rebuilds when `PYO3_ENVIRONMENT_SIGNATURE` env var value changes
+    // See https://github.com/PyO3/pyo3/issues/2724
+    println!("cargo:rerun-if-env-changed=PYO3_ENVIRONMENT_SIGNATURE");
+
+    if let Some(exe) = env_var("PYO3_PYTHON") {
+        Ok(exe.into())
+    } else if let Some(env_interpreter) = get_env_interpreter() {
+        Ok(env_interpreter)
+    } else {
+        println!("cargo:rerun-if-env-changed=PATH");
+        ["python", "python3"]
+            .iter()
+            .find(|bin| {
+                if let Ok(out) = Command::new(bin).arg("--version").output() {
+                    // begin with `Python 3.X.X :: additional info`
+                    out.stdout.starts_with(b"Python 3")
+                        || out.stderr.starts_with(b"Python 3")
+                        || out.stdout.starts_with(b"GraalPy 3")
+                } else {
+                    false
+                }
+            })
+            .map(PathBuf::from)
+            .ok_or_else(|| "no Python 3.x interpreter found".into())
+    }
+}
+
+/// Locates and extracts the build host Python interpreter configuration.
+///
+/// Lowers the configured Python version to `abi3_version` if required.
+fn get_host_interpreter(abi3_version: Option<PythonVersion>) -> Result<InterpreterConfig> {
+    let interpreter_path = find_interpreter()?;
+
+    let mut interpreter_config = InterpreterConfig::from_interpreter(interpreter_path)?;
+    interpreter_config.fixup_for_abi3_version(abi3_version)?;
+
+    Ok(interpreter_config)
+}
+
+/// Generates an interpreter config suitable for cross-compilation.
+///
+/// This must be called from PyO3's build script, because it relies on environment variables such as
+/// CARGO_CFG_TARGET_OS which aren't available at any other time.
+pub fn make_cross_compile_config() -> Result<Option<InterpreterConfig>> {
+    let interpreter_config = if let Some(cross_config) = cross_compiling_from_cargo_env()? {
+        let mut interpreter_config = load_cross_compile_config(cross_config)?;
+        interpreter_config.fixup_for_abi3_version(get_abi3_version())?;
+        Some(interpreter_config)
+    } else {
+        None
+    };
+
+    Ok(interpreter_config)
+}
+
+/// Generates an interpreter config which will be hard-coded into the pyo3-build-config crate.
+/// Only used by `pyo3-build-config` build script.
+#[allow(dead_code, unused_mut)]
+pub fn make_interpreter_config() -> Result<InterpreterConfig> {
+    let host = Triple::host();
+    let abi3_version = get_abi3_version();
+
+    // See if we can safely skip the Python interpreter configuration detection.
+    // Unix "abi3" extension modules can usually be built without any interpreter.
+    let need_interpreter = abi3_version.is_none() || require_libdir_for_target(&host);
+
+    if have_python_interpreter() {
+        match get_host_interpreter(abi3_version) {
+            Ok(interpreter_config) => return Ok(interpreter_config),
+            // Bail if the interpreter configuration is required to build.
+            Err(e) if need_interpreter => return Err(e),
+            _ => {
+                // Fall back to the "abi3" defaults just as if `PYO3_NO_PYTHON`
+                // environment variable was set.
+                warn!("Compiling without a working Python interpreter.");
+            }
+        }
+    } else {
+        ensure!(
+            abi3_version.is_some(),
+            "An abi3-py3* feature must be specified when compiling without a Python interpreter."
+        );
+    };
+
+    let mut interpreter_config = default_abi3_config(&host, abi3_version.unwrap());
+
+    // Auto generate python3.dll import libraries for Windows targets.
+    #[cfg(feature = "python3-dll-a")]
+    {
+        let py_version = if interpreter_config.abi3 {
+            None
+        } else {
+            Some(interpreter_config.version)
+        };
+        interpreter_config.lib_dir = self::import_lib::generate_import_lib(
+            &host,
+            interpreter_config.implementation,
+            py_version,
+        )?;
+    }
+
+    Ok(interpreter_config)
+}
+
+fn escape(bytes: &[u8]) -> String {
+    let mut escaped = String::with_capacity(2 * bytes.len());
+
+    for byte in bytes {
+        const LUT: &[u8; 16] = b"0123456789abcdef";
+
+        escaped.push(LUT[(byte >> 4) as usize] as char);
+        escaped.push(LUT[(byte & 0x0F) as usize] as char);
+    }
+
+    escaped
+}
+
+fn unescape(escaped: &str) -> Vec<u8> {
+    assert!(escaped.len() % 2 == 0, "invalid hex encoding");
+
+    let mut bytes = Vec::with_capacity(escaped.len() / 2);
+
+    for chunk in escaped.as_bytes().chunks_exact(2) {
+        fn unhex(hex: u8) -> u8 {
+            match hex {
+                b'a'..=b'f' => hex - b'a' + 10,
+                b'0'..=b'9' => hex - b'0',
+                _ => panic!("invalid hex encoding"),
+            }
+        }
+
+        bytes.push(unhex(chunk[0]) << 4 | unhex(chunk[1]));
+    }
+
+    bytes
+}
+
+#[cfg(test)]
+mod tests {
+    use target_lexicon::triple;
+
+    use super::*;
+
+    #[test]
+    fn test_config_file_roundtrip() {
+        let config = InterpreterConfig {
+            abi3: true,
+            build_flags: BuildFlags::default(),
+            pointer_width: Some(32),
+            executable: Some("executable".into()),
+            implementation: PythonImplementation::CPython,
+            lib_name: Some("lib_name".into()),
+            lib_dir: Some("lib_dir".into()),
+            shared: true,
+            version: MINIMUM_SUPPORTED_VERSION,
+            suppress_build_script_link_lines: true,
+            extra_build_script_lines: vec!["cargo:test1".to_string(), "cargo:test2".to_string()],
+        };
+        let mut buf: Vec<u8> = Vec::new();
+        config.to_writer(&mut buf).unwrap();
+
+        assert_eq!(config, InterpreterConfig::from_reader(&*buf).unwrap());
+
+        // And some different options, for variety
+
+        let config = InterpreterConfig {
+            abi3: false,
+            build_flags: {
+                let mut flags = HashSet::new();
+                flags.insert(BuildFlag::Py_DEBUG);
+                flags.insert(BuildFlag::Other(String::from("Py_SOME_FLAG")));
+                BuildFlags(flags)
+            },
+            pointer_width: None,
+            executable: None,
+            implementation: PythonImplementation::PyPy,
+            lib_dir: None,
+            lib_name: None,
+            shared: true,
+            version: PythonVersion {
+                major: 3,
+                minor: 10,
+            },
+            suppress_build_script_link_lines: false,
+            extra_build_script_lines: vec![],
+        };
+        let mut buf: Vec<u8> = Vec::new();
+        config.to_writer(&mut buf).unwrap();
+
+        assert_eq!(config, InterpreterConfig::from_reader(&*buf).unwrap());
+    }
+
+    #[test]
+    fn test_config_file_roundtrip_with_escaping() {
+        let config = InterpreterConfig {
+            abi3: true,
+            build_flags: BuildFlags::default(),
+            pointer_width: Some(32),
+            executable: Some("executable".into()),
+            implementation: PythonImplementation::CPython,
+            lib_name: Some("lib_name".into()),
+            lib_dir: Some("lib_dir\\n".into()),
+            shared: true,
+            version: MINIMUM_SUPPORTED_VERSION,
+            suppress_build_script_link_lines: true,
+            extra_build_script_lines: vec!["cargo:test1".to_string(), "cargo:test2".to_string()],
+        };
+        let mut buf: Vec<u8> = Vec::new();
+        config.to_writer(&mut buf).unwrap();
+
+        let buf = unescape(&escape(&buf));
+
+        assert_eq!(config, InterpreterConfig::from_reader(&*buf).unwrap());
+    }
+
+    #[test]
+    fn test_config_file_defaults() {
+        // Only version is required
+        assert_eq!(
+            InterpreterConfig::from_reader("version=3.7".as_bytes()).unwrap(),
+            InterpreterConfig {
+                version: PythonVersion { major: 3, minor: 7 },
+                implementation: PythonImplementation::CPython,
+                shared: true,
+                abi3: false,
+                lib_name: None,
+                lib_dir: None,
+                executable: None,
+                pointer_width: None,
+                build_flags: BuildFlags::default(),
+                suppress_build_script_link_lines: false,
+                extra_build_script_lines: vec![],
+            }
+        )
+    }
+
+    #[test]
+    fn test_config_file_unknown_keys() {
+        // ext_suffix is unknown to pyo3-build-config, but it shouldn't error
+        assert_eq!(
+            InterpreterConfig::from_reader("version=3.7\next_suffix=.python37.so".as_bytes())
+                .unwrap(),
+            InterpreterConfig {
+                version: PythonVersion { major: 3, minor: 7 },
+                implementation: PythonImplementation::CPython,
+                shared: true,
+                abi3: false,
+                lib_name: None,
+                lib_dir: None,
+                executable: None,
+                pointer_width: None,
+                build_flags: BuildFlags::default(),
+                suppress_build_script_link_lines: false,
+                extra_build_script_lines: vec![],
+            }
+        )
+    }
+
+    #[test]
+    fn build_flags_default() {
+        assert_eq!(BuildFlags::default(), BuildFlags::new());
+    }
+
+    #[test]
+    fn build_flags_from_sysconfigdata() {
+        let mut sysconfigdata = Sysconfigdata::new();
+
+        assert_eq!(
+            BuildFlags::from_sysconfigdata(&sysconfigdata).0,
+            HashSet::new()
+        );
+
+        for flag in &BuildFlags::ALL {
+            sysconfigdata.insert(flag.to_string(), "0".into());
+        }
+
+        assert_eq!(
+            BuildFlags::from_sysconfigdata(&sysconfigdata).0,
+            HashSet::new()
+        );
+
+        let mut expected_flags = HashSet::new();
+        for flag in &BuildFlags::ALL {
+            sysconfigdata.insert(flag.to_string(), "1".into());
+            expected_flags.insert(flag.clone());
+        }
+
+        assert_eq!(
+            BuildFlags::from_sysconfigdata(&sysconfigdata).0,
+            expected_flags
+        );
+    }
+
+    #[test]
+    fn build_flags_fixup() {
+        let mut build_flags = BuildFlags::new();
+
+        build_flags = build_flags.fixup();
+        assert!(build_flags.0.is_empty());
+
+        build_flags.0.insert(BuildFlag::Py_DEBUG);
+
+        build_flags = build_flags.fixup();
+
+        // Py_DEBUG implies Py_REF_DEBUG
+        assert!(build_flags.0.contains(&BuildFlag::Py_REF_DEBUG));
+    }
+
+    #[test]
+    fn parse_script_output() {
+        let output = "foo bar\nbar foobar\n\n";
+        let map = super::parse_script_output(output);
+        assert_eq!(map.len(), 2);
+        assert_eq!(map["foo"], "bar");
+        assert_eq!(map["bar"], "foobar");
+    }
+
+    #[test]
+    fn config_from_interpreter() {
+        // Smoke test to just see whether this works
+        //
+        // PyO3's CI is dependent on Python being installed, so this should be reliable.
+        assert!(make_interpreter_config().is_ok())
+    }
+
+    #[test]
+    fn config_from_empty_sysconfigdata() {
+        let sysconfigdata = Sysconfigdata::new();
+        assert!(InterpreterConfig::from_sysconfigdata(&sysconfigdata).is_err());
+    }
+
+    #[test]
+    fn config_from_sysconfigdata() {
+        let mut sysconfigdata = Sysconfigdata::new();
+        // these are the minimal values required such that InterpreterConfig::from_sysconfigdata
+        // does not error
+        sysconfigdata.insert("SOABI", "cpython-37m-x86_64-linux-gnu");
+        sysconfigdata.insert("VERSION", "3.7");
+        sysconfigdata.insert("Py_ENABLE_SHARED", "1");
+        sysconfigdata.insert("LIBDIR", "/usr/lib");
+        sysconfigdata.insert("LDVERSION", "3.7m");
+        sysconfigdata.insert("SIZEOF_VOID_P", "8");
+        assert_eq!(
+            InterpreterConfig::from_sysconfigdata(&sysconfigdata).unwrap(),
+            InterpreterConfig {
+                abi3: false,
+                build_flags: BuildFlags::from_sysconfigdata(&sysconfigdata),
+                pointer_width: Some(64),
+                executable: None,
+                implementation: PythonImplementation::CPython,
+                lib_dir: Some("/usr/lib".into()),
+                lib_name: Some("python3.7m".into()),
+                shared: true,
+                version: PythonVersion::PY37,
+                suppress_build_script_link_lines: false,
+                extra_build_script_lines: vec![],
+            }
+        );
+    }
+
+    #[test]
+    fn config_from_sysconfigdata_framework() {
+        let mut sysconfigdata = Sysconfigdata::new();
+        sysconfigdata.insert("SOABI", "cpython-37m-x86_64-linux-gnu");
+        sysconfigdata.insert("VERSION", "3.7");
+        // PYTHONFRAMEWORK should override Py_ENABLE_SHARED
+        sysconfigdata.insert("Py_ENABLE_SHARED", "0");
+        sysconfigdata.insert("PYTHONFRAMEWORK", "Python");
+        sysconfigdata.insert("LIBDIR", "/usr/lib");
+        sysconfigdata.insert("LDVERSION", "3.7m");
+        sysconfigdata.insert("SIZEOF_VOID_P", "8");
+        assert_eq!(
+            InterpreterConfig::from_sysconfigdata(&sysconfigdata).unwrap(),
+            InterpreterConfig {
+                abi3: false,
+                build_flags: BuildFlags::from_sysconfigdata(&sysconfigdata),
+                pointer_width: Some(64),
+                executable: None,
+                implementation: PythonImplementation::CPython,
+                lib_dir: Some("/usr/lib".into()),
+                lib_name: Some("python3.7m".into()),
+                shared: true,
+                version: PythonVersion::PY37,
+                suppress_build_script_link_lines: false,
+                extra_build_script_lines: vec![],
+            }
+        );
+
+        sysconfigdata = Sysconfigdata::new();
+        sysconfigdata.insert("SOABI", "cpython-37m-x86_64-linux-gnu");
+        sysconfigdata.insert("VERSION", "3.7");
+        // An empty PYTHONFRAMEWORK means it is not a framework
+        sysconfigdata.insert("Py_ENABLE_SHARED", "0");
+        sysconfigdata.insert("PYTHONFRAMEWORK", "");
+        sysconfigdata.insert("LIBDIR", "/usr/lib");
+        sysconfigdata.insert("LDVERSION", "3.7m");
+        sysconfigdata.insert("SIZEOF_VOID_P", "8");
+        assert_eq!(
+            InterpreterConfig::from_sysconfigdata(&sysconfigdata).unwrap(),
+            InterpreterConfig {
+                abi3: false,
+                build_flags: BuildFlags::from_sysconfigdata(&sysconfigdata),
+                pointer_width: Some(64),
+                executable: None,
+                implementation: PythonImplementation::CPython,
+                lib_dir: Some("/usr/lib".into()),
+                lib_name: Some("python3.7m".into()),
+                shared: false,
+                version: PythonVersion::PY37,
+                suppress_build_script_link_lines: false,
+                extra_build_script_lines: vec![],
+            }
+        );
+    }
+
+    #[test]
+    fn windows_hardcoded_abi3_compile() {
+        let host = triple!("x86_64-pc-windows-msvc");
+        let min_version = "3.7".parse().unwrap();
+
+        assert_eq!(
+            default_abi3_config(&host, min_version),
+            InterpreterConfig {
+                implementation: PythonImplementation::CPython,
+                version: PythonVersion { major: 3, minor: 7 },
+                shared: true,
+                abi3: true,
+                lib_name: Some("python3".into()),
+                lib_dir: None,
+                executable: None,
+                pointer_width: None,
+                build_flags: BuildFlags::default(),
+                suppress_build_script_link_lines: false,
+                extra_build_script_lines: vec![],
+            }
+        );
+    }
+
+    #[test]
+    fn unix_hardcoded_abi3_compile() {
+        let host = triple!("x86_64-unknown-linux-gnu");
+        let min_version = "3.9".parse().unwrap();
+
+        assert_eq!(
+            default_abi3_config(&host, min_version),
+            InterpreterConfig {
+                implementation: PythonImplementation::CPython,
+                version: PythonVersion { major: 3, minor: 9 },
+                shared: true,
+                abi3: true,
+                lib_name: None,
+                lib_dir: None,
+                executable: None,
+                pointer_width: None,
+                build_flags: BuildFlags::default(),
+                suppress_build_script_link_lines: false,
+                extra_build_script_lines: vec![],
+            }
+        );
+    }
+
+    #[test]
+    fn windows_hardcoded_cross_compile() {
+        let env_vars = CrossCompileEnvVars {
+            pyo3_cross: None,
+            pyo3_cross_lib_dir: Some("C:\\some\\path".into()),
+            pyo3_cross_python_implementation: None,
+            pyo3_cross_python_version: Some("3.7".into()),
+        };
+
+        let host = triple!("x86_64-unknown-linux-gnu");
+        let target = triple!("i686-pc-windows-msvc");
+        let cross_config =
+            CrossCompileConfig::try_from_env_vars_host_target(env_vars, &host, &target)
+                .unwrap()
+                .unwrap();
+
+        assert_eq!(
+            default_cross_compile(&cross_config).unwrap(),
+            InterpreterConfig {
+                implementation: PythonImplementation::CPython,
+                version: PythonVersion { major: 3, minor: 7 },
+                shared: true,
+                abi3: false,
+                lib_name: Some("python37".into()),
+                lib_dir: Some("C:\\some\\path".into()),
+                executable: None,
+                pointer_width: None,
+                build_flags: BuildFlags::default(),
+                suppress_build_script_link_lines: false,
+                extra_build_script_lines: vec![],
+            }
+        );
+    }
+
+    #[test]
+    fn mingw_hardcoded_cross_compile() {
+        let env_vars = CrossCompileEnvVars {
+            pyo3_cross: None,
+            pyo3_cross_lib_dir: Some("/usr/lib/mingw".into()),
+            pyo3_cross_python_implementation: None,
+            pyo3_cross_python_version: Some("3.8".into()),
+        };
+
+        let host = triple!("x86_64-unknown-linux-gnu");
+        let target = triple!("i686-pc-windows-gnu");
+        let cross_config =
+            CrossCompileConfig::try_from_env_vars_host_target(env_vars, &host, &target)
+                .unwrap()
+                .unwrap();
+
+        assert_eq!(
+            default_cross_compile(&cross_config).unwrap(),
+            InterpreterConfig {
+                implementation: PythonImplementation::CPython,
+                version: PythonVersion { major: 3, minor: 8 },
+                shared: true,
+                abi3: false,
+                lib_name: Some("python38".into()),
+                lib_dir: Some("/usr/lib/mingw".into()),
+                executable: None,
+                pointer_width: None,
+                build_flags: BuildFlags::default(),
+                suppress_build_script_link_lines: false,
+                extra_build_script_lines: vec![],
+            }
+        );
+    }
+
+    #[test]
+    fn unix_hardcoded_cross_compile() {
+        let env_vars = CrossCompileEnvVars {
+            pyo3_cross: None,
+            pyo3_cross_lib_dir: Some("/usr/arm64/lib".into()),
+            pyo3_cross_python_implementation: None,
+            pyo3_cross_python_version: Some("3.9".into()),
+        };
+
+        let host = triple!("x86_64-unknown-linux-gnu");
+        let target = triple!("aarch64-unknown-linux-gnu");
+        let cross_config =
+            CrossCompileConfig::try_from_env_vars_host_target(env_vars, &host, &target)
+                .unwrap()
+                .unwrap();
+
+        assert_eq!(
+            default_cross_compile(&cross_config).unwrap(),
+            InterpreterConfig {
+                implementation: PythonImplementation::CPython,
+                version: PythonVersion { major: 3, minor: 9 },
+                shared: true,
+                abi3: false,
+                lib_name: Some("python3.9".into()),
+                lib_dir: Some("/usr/arm64/lib".into()),
+                executable: None,
+                pointer_width: None,
+                build_flags: BuildFlags::default(),
+                suppress_build_script_link_lines: false,
+                extra_build_script_lines: vec![],
+            }
+        );
+    }
+
+    #[test]
+    fn pypy_hardcoded_cross_compile() {
+        let env_vars = CrossCompileEnvVars {
+            pyo3_cross: None,
+            pyo3_cross_lib_dir: None,
+            pyo3_cross_python_implementation: Some("PyPy".into()),
+            pyo3_cross_python_version: Some("3.10".into()),
+        };
+
+        let triple = triple!("x86_64-unknown-linux-gnu");
+        let cross_config =
+            CrossCompileConfig::try_from_env_vars_host_target(env_vars, &triple, &triple)
+                .unwrap()
+                .unwrap();
+
+        assert_eq!(
+            default_cross_compile(&cross_config).unwrap(),
+            InterpreterConfig {
+                implementation: PythonImplementation::PyPy,
+                version: PythonVersion {
+                    major: 3,
+                    minor: 10
+                },
+                shared: true,
+                abi3: false,
+                lib_name: Some("pypy3.10-c".into()),
+                lib_dir: None,
+                executable: None,
+                pointer_width: None,
+                build_flags: BuildFlags::default(),
+                suppress_build_script_link_lines: false,
+                extra_build_script_lines: vec![],
+            }
+        );
+    }
+
+    #[test]
+    fn default_lib_name_windows() {
+        use PythonImplementation::*;
+        assert_eq!(
+            super::default_lib_name_windows(
+                PythonVersion { major: 3, minor: 7 },
+                CPython,
+                false,
+                false,
+                false,
+            ),
+            "python37",
+        );
+        assert_eq!(
+            super::default_lib_name_windows(
+                PythonVersion { major: 3, minor: 7 },
+                CPython,
+                true,
+                false,
+                false,
+            ),
+            "python3",
+        );
+        assert_eq!(
+            super::default_lib_name_windows(
+                PythonVersion { major: 3, minor: 7 },
+                CPython,
+                false,
+                true,
+                false,
+            ),
+            "python3.7",
+        );
+        assert_eq!(
+            super::default_lib_name_windows(
+                PythonVersion { major: 3, minor: 7 },
+                CPython,
+                true,
+                true,
+                false,
+            ),
+            "python3",
+        );
+        assert_eq!(
+            super::default_lib_name_windows(
+                PythonVersion { major: 3, minor: 7 },
+                PyPy,
+                true,
+                false,
+                false,
+            ),
+            "python37",
+        );
+        assert_eq!(
+            super::default_lib_name_windows(
+                PythonVersion { major: 3, minor: 7 },
+                CPython,
+                false,
+                false,
+                true,
+            ),
+            "python37_d",
+        );
+        // abi3 debug builds on windows use version-specific lib
+        // to workaround https://github.com/python/cpython/issues/101614
+        assert_eq!(
+            super::default_lib_name_windows(
+                PythonVersion { major: 3, minor: 7 },
+                CPython,
+                true,
+                false,
+                true,
+            ),
+            "python37_d",
+        );
+    }
+
+    #[test]
+    fn default_lib_name_unix() {
+        use PythonImplementation::*;
+        // Defaults to python3.7m for CPython 3.7
+        assert_eq!(
+            super::default_lib_name_unix(PythonVersion { major: 3, minor: 7 }, CPython, None),
+            "python3.7m",
+        );
+        // Defaults to pythonX.Y for CPython 3.8+
+        assert_eq!(
+            super::default_lib_name_unix(PythonVersion { major: 3, minor: 8 }, CPython, None),
+            "python3.8",
+        );
+        assert_eq!(
+            super::default_lib_name_unix(PythonVersion { major: 3, minor: 9 }, CPython, None),
+            "python3.9",
+        );
+        // Can use ldversion to override for CPython
+        assert_eq!(
+            super::default_lib_name_unix(
+                PythonVersion { major: 3, minor: 9 },
+                CPython,
+                Some("3.7md")
+            ),
+            "python3.7md",
+        );
+
+        // PyPy 3.7 ignores ldversion
+        assert_eq!(
+            super::default_lib_name_unix(PythonVersion { major: 3, minor: 7 }, PyPy, Some("3.7md")),
+            "pypy3-c",
+        );
+
+        // PyPy 3.9 includes ldversion
+        assert_eq!(
+            super::default_lib_name_unix(PythonVersion { major: 3, minor: 9 }, PyPy, Some("3.9d")),
+            "pypy3.9d-c",
+        );
+    }
+
+    #[test]
+    fn parse_cross_python_version() {
+        let env_vars = CrossCompileEnvVars {
+            pyo3_cross: None,
+            pyo3_cross_lib_dir: None,
+            pyo3_cross_python_version: Some("3.9".into()),
+            pyo3_cross_python_implementation: None,
+        };
+
+        assert_eq!(
+            env_vars.parse_version().unwrap(),
+            Some(PythonVersion { major: 3, minor: 9 })
+        );
+
+        let env_vars = CrossCompileEnvVars {
+            pyo3_cross: None,
+            pyo3_cross_lib_dir: None,
+            pyo3_cross_python_version: None,
+            pyo3_cross_python_implementation: None,
+        };
+
+        assert_eq!(env_vars.parse_version().unwrap(), None);
+
+        let env_vars = CrossCompileEnvVars {
+            pyo3_cross: None,
+            pyo3_cross_lib_dir: None,
+            pyo3_cross_python_version: Some("100".into()),
+            pyo3_cross_python_implementation: None,
+        };
+
+        assert!(env_vars.parse_version().is_err());
+    }
+
+    #[test]
+    fn interpreter_version_reduced_to_abi3() {
+        let mut config = InterpreterConfig {
+            abi3: true,
+            build_flags: BuildFlags::default(),
+            pointer_width: None,
+            executable: None,
+            implementation: PythonImplementation::CPython,
+            lib_dir: None,
+            lib_name: None,
+            shared: true,
+            version: PythonVersion { major: 3, minor: 7 },
+            suppress_build_script_link_lines: false,
+            extra_build_script_lines: vec![],
+        };
+
+        config
+            .fixup_for_abi3_version(Some(PythonVersion { major: 3, minor: 7 }))
+            .unwrap();
+        assert_eq!(config.version, PythonVersion { major: 3, minor: 7 });
+    }
+
+    #[test]
+    fn abi3_version_cannot_be_higher_than_interpreter() {
+        let mut config = InterpreterConfig {
+            abi3: true,
+            build_flags: BuildFlags::new(),
+            pointer_width: None,
+            executable: None,
+            implementation: PythonImplementation::CPython,
+            lib_dir: None,
+            lib_name: None,
+            shared: true,
+            version: PythonVersion { major: 3, minor: 7 },
+            suppress_build_script_link_lines: false,
+            extra_build_script_lines: vec![],
+        };
+
+        assert!(config
+            .fixup_for_abi3_version(Some(PythonVersion { major: 3, minor: 8 }))
+            .unwrap_err()
+            .to_string()
+            .contains(
+                "cannot set a minimum Python version 3.8 higher than the interpreter version 3.7"
+            ));
+    }
+
+    #[test]
+    #[cfg(all(
+        target_os = "linux",
+        target_arch = "x86_64",
+        feature = "resolve-config"
+    ))]
+    fn parse_sysconfigdata() {
+        // A best effort attempt to get test coverage for the sysconfigdata parsing.
+        // Might not complete successfully depending on host installation; that's ok as long as
+        // CI demonstrates this path is covered!
+
+        let interpreter_config = crate::get();
+
+        let lib_dir = match &interpreter_config.lib_dir {
+            Some(lib_dir) => Path::new(lib_dir),
+            // Don't know where to search for sysconfigdata; never mind.
+            None => return,
+        };
+
+        let cross = CrossCompileConfig {
+            lib_dir: Some(lib_dir.into()),
+            version: Some(interpreter_config.version),
+            implementation: Some(interpreter_config.implementation),
+            target: triple!("x86_64-unknown-linux-gnu"),
+        };
+
+        let sysconfigdata_path = match find_sysconfigdata(&cross) {
+            Ok(Some(path)) => path,
+            // Couldn't find a matching sysconfigdata; never mind!
+            _ => return,
+        };
+        let sysconfigdata = super::parse_sysconfigdata(sysconfigdata_path).unwrap();
+        let parsed_config = InterpreterConfig::from_sysconfigdata(&sysconfigdata).unwrap();
+
+        assert_eq!(
+            parsed_config,
+            InterpreterConfig {
+                abi3: false,
+                build_flags: BuildFlags(interpreter_config.build_flags.0.clone()),
+                pointer_width: Some(64),
+                executable: None,
+                implementation: PythonImplementation::CPython,
+                lib_dir: interpreter_config.lib_dir.to_owned(),
+                lib_name: interpreter_config.lib_name.to_owned(),
+                shared: true,
+                version: interpreter_config.version,
+                suppress_build_script_link_lines: false,
+                extra_build_script_lines: vec![],
+            }
+        )
+    }
+
+    #[test]
+    fn test_venv_interpreter() {
+        let base = OsStr::new("base");
+        assert_eq!(
+            venv_interpreter(base, true),
+            PathBuf::from_iter(&["base", "Scripts", "python.exe"])
+        );
+        assert_eq!(
+            venv_interpreter(base, false),
+            PathBuf::from_iter(&["base", "bin", "python"])
+        );
+    }
+
+    #[test]
+    fn test_conda_env_interpreter() {
+        let base = OsStr::new("base");
+        assert_eq!(
+            conda_env_interpreter(base, true),
+            PathBuf::from_iter(&["base", "python.exe"])
+        );
+        assert_eq!(
+            conda_env_interpreter(base, false),
+            PathBuf::from_iter(&["base", "bin", "python"])
+        );
+    }
+
+    #[test]
+    fn test_not_cross_compiling_from_to() {
+        assert!(cross_compiling_from_to(
+            &triple!("x86_64-unknown-linux-gnu"),
+            &triple!("x86_64-unknown-linux-gnu"),
+        )
+        .unwrap()
+        .is_none());
+
+        assert!(cross_compiling_from_to(
+            &triple!("x86_64-apple-darwin"),
+            &triple!("x86_64-apple-darwin")
+        )
+        .unwrap()
+        .is_none());
+
+        assert!(cross_compiling_from_to(
+            &triple!("aarch64-apple-darwin"),
+            &triple!("x86_64-apple-darwin")
+        )
+        .unwrap()
+        .is_none());
+
+        assert!(cross_compiling_from_to(
+            &triple!("x86_64-apple-darwin"),
+            &triple!("aarch64-apple-darwin")
+        )
+        .unwrap()
+        .is_none());
+
+        assert!(cross_compiling_from_to(
+            &triple!("x86_64-pc-windows-msvc"),
+            &triple!("i686-pc-windows-msvc")
+        )
+        .unwrap()
+        .is_none());
+
+        assert!(cross_compiling_from_to(
+            &triple!("x86_64-unknown-linux-gnu"),
+            &triple!("x86_64-unknown-linux-musl")
+        )
+        .unwrap()
+        .is_none());
+    }
+
+    #[test]
+    fn test_run_python_script() {
+        // as above, this should be okay in CI where Python is presumed installed
+        let interpreter = make_interpreter_config()
+            .expect("could not get InterpreterConfig from installed interpreter");
+        let out = interpreter
+            .run_python_script("print(2 + 2)")
+            .expect("failed to run Python script");
+        assert_eq!(out.trim_end(), "4");
+    }
+
+    #[test]
+    fn test_run_python_script_with_envs() {
+        // as above, this should be okay in CI where Python is presumed installed
+        let interpreter = make_interpreter_config()
+            .expect("could not get InterpreterConfig from installed interpreter");
+        let out = interpreter
+            .run_python_script_with_envs(
+                "import os; print(os.getenv('PYO3_TEST'))",
+                vec![("PYO3_TEST", "42")],
+            )
+            .expect("failed to run Python script");
+        assert_eq!(out.trim_end(), "42");
+    }
+
+    #[test]
+    fn test_build_script_outputs_base() {
+        let interpreter_config = InterpreterConfig {
+            implementation: PythonImplementation::CPython,
+            version: PythonVersion { major: 3, minor: 8 },
+            shared: true,
+            abi3: false,
+            lib_name: Some("python3".into()),
+            lib_dir: None,
+            executable: None,
+            pointer_width: None,
+            build_flags: BuildFlags::default(),
+            suppress_build_script_link_lines: false,
+            extra_build_script_lines: vec![],
+        };
+        assert_eq!(
+            interpreter_config.build_script_outputs(),
+            [
+                "cargo:rustc-cfg=Py_3_6".to_owned(),
+                "cargo:rustc-cfg=Py_3_7".to_owned(),
+                "cargo:rustc-cfg=Py_3_8".to_owned(),
+            ]
+        );
+
+        let interpreter_config = InterpreterConfig {
+            implementation: PythonImplementation::PyPy,
+            ..interpreter_config
+        };
+        assert_eq!(
+            interpreter_config.build_script_outputs(),
+            [
+                "cargo:rustc-cfg=Py_3_6".to_owned(),
+                "cargo:rustc-cfg=Py_3_7".to_owned(),
+                "cargo:rustc-cfg=Py_3_8".to_owned(),
+                "cargo:rustc-cfg=PyPy".to_owned(),
+            ]
+        );
+    }
+
+    #[test]
+    fn test_build_script_outputs_abi3() {
+        let interpreter_config = InterpreterConfig {
+            implementation: PythonImplementation::CPython,
+            version: PythonVersion { major: 3, minor: 7 },
+            shared: true,
+            abi3: true,
+            lib_name: Some("python3".into()),
+            lib_dir: None,
+            executable: None,
+            pointer_width: None,
+            build_flags: BuildFlags::default(),
+            suppress_build_script_link_lines: false,
+            extra_build_script_lines: vec![],
+        };
+
+        assert_eq!(
+            interpreter_config.build_script_outputs(),
+            [
+                "cargo:rustc-cfg=Py_3_6".to_owned(),
+                "cargo:rustc-cfg=Py_3_7".to_owned(),
+                "cargo:rustc-cfg=Py_LIMITED_API".to_owned(),
+            ]
+        );
+
+        let interpreter_config = InterpreterConfig {
+            implementation: PythonImplementation::PyPy,
+            ..interpreter_config
+        };
+        assert_eq!(
+            interpreter_config.build_script_outputs(),
+            [
+                "cargo:rustc-cfg=Py_3_6".to_owned(),
+                "cargo:rustc-cfg=Py_3_7".to_owned(),
+                "cargo:rustc-cfg=PyPy".to_owned(),
+                "cargo:rustc-cfg=Py_LIMITED_API".to_owned(),
+            ]
+        );
+    }
+
+    #[test]
+    fn test_build_script_outputs_debug() {
+        let mut build_flags = BuildFlags::default();
+        build_flags.0.insert(BuildFlag::Py_DEBUG);
+        let interpreter_config = InterpreterConfig {
+            implementation: PythonImplementation::CPython,
+            version: PythonVersion { major: 3, minor: 7 },
+            shared: true,
+            abi3: false,
+            lib_name: Some("python3".into()),
+            lib_dir: None,
+            executable: None,
+            pointer_width: None,
+            build_flags,
+            suppress_build_script_link_lines: false,
+            extra_build_script_lines: vec![],
+        };
+
+        assert_eq!(
+            interpreter_config.build_script_outputs(),
+            [
+                "cargo:rustc-cfg=Py_3_6".to_owned(),
+                "cargo:rustc-cfg=Py_3_7".to_owned(),
+                "cargo:rustc-cfg=py_sys_config=\"Py_DEBUG\"".to_owned(),
+            ]
+        );
+    }
+
+    #[test]
+    fn test_find_sysconfigdata_in_invalid_lib_dir() {
+        let e = find_all_sysconfigdata(&CrossCompileConfig {
+            lib_dir: Some(PathBuf::from("/abc/123/not/a/real/path")),
+            version: None,
+            implementation: None,
+            target: triple!("x86_64-unknown-linux-gnu"),
+        })
+        .unwrap_err();
+
+        // actual error message is platform-dependent, so just check the context we add
+        assert!(e.report().to_string().starts_with(
+            "failed to search the lib dir at 'PYO3_CROSS_LIB_DIR=/abc/123/not/a/real/path'\n\
+            caused by:\n  \
+              - 0: failed to list the entries in '/abc/123/not/a/real/path'\n  \
+              - 1: \
+            "
+        ));
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-build-config/src/import_lib.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-build-config/src/import_lib.rs
--- 43.0.0-1/rust-vendor/pyo3-build-config/src/import_lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-build-config/src/import_lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,62 @@
+//! Optional `python3.dll` import library generator for Windows
+
+use std::env;
+use std::path::PathBuf;
+
+use python3_dll_a::ImportLibraryGenerator;
+use target_lexicon::{Architecture, OperatingSystem, Triple};
+
+use super::{PythonImplementation, PythonVersion};
+use crate::errors::{Context, Error, Result};
+
+/// Generates the `python3.dll` or `pythonXY.dll` import library for Windows targets.
+///
+/// Places the generated import library into the build script output directory
+/// and returns the full library directory path.
+///
+/// Does nothing if the target OS is not Windows.
+pub(super) fn generate_import_lib(
+    target: &Triple,
+    py_impl: PythonImplementation,
+    py_version: Option<PythonVersion>,
+) -> Result<Option<String>> {
+    if target.operating_system != OperatingSystem::Windows {
+        return Ok(None);
+    }
+
+    let out_dir =
+        env::var_os("OUT_DIR").expect("generate_import_lib() must be called from a build script");
+
+    // Put the newly created import library into the build script output directory.
+    let mut out_lib_dir = PathBuf::from(out_dir);
+    out_lib_dir.push("lib");
+
+    // Convert `Architecture` enum to rustc `target_arch` option format.
+    let arch = match target.architecture {
+        // i686, i586, etc.
+        Architecture::X86_32(_) => "x86".to_string(),
+        other => other.to_string(),
+    };
+
+    let env = target.environment.to_string();
+    let implementation = match py_impl {
+        PythonImplementation::CPython => python3_dll_a::PythonImplementation::CPython,
+        PythonImplementation::PyPy => python3_dll_a::PythonImplementation::PyPy,
+        PythonImplementation::GraalPy => {
+            return Err(Error::from("No support for GraalPy on Windows"))
+        }
+    };
+
+    ImportLibraryGenerator::new(&arch, &env)
+        .version(py_version.map(|v| (v.major, v.minor)))
+        .implementation(implementation)
+        .generate(&out_lib_dir)
+        .context("failed to generate python3.dll import library")?;
+
+    let out_lib_dir_string = out_lib_dir
+        .to_str()
+        .ok_or("build directory is not a valid UTF-8 string")?
+        .to_owned();
+
+    Ok(Some(out_lib_dir_string))
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-build-config/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-build-config/src/lib.rs
--- 43.0.0-1/rust-vendor/pyo3-build-config/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-build-config/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,293 @@
+//! Configuration used by PyO3 for conditional support of varying Python versions.
+//!
+//! This crate exposes functionality to be called from build scripts to simplify building crates
+//! which depend on PyO3.
+//!
+//! It used internally by the PyO3 crate's build script to apply the same configuration.
+
+#![warn(elided_lifetimes_in_paths, unused_lifetimes)]
+
+mod errors;
+mod impl_;
+
+#[cfg(feature = "resolve-config")]
+use std::{
+    io::Cursor,
+    path::{Path, PathBuf},
+};
+
+use std::{env, process::Command, str::FromStr};
+
+use once_cell::sync::OnceCell;
+
+pub use impl_::{
+    cross_compiling_from_to, find_all_sysconfigdata, parse_sysconfigdata, BuildFlag, BuildFlags,
+    CrossCompileConfig, InterpreterConfig, PythonImplementation, PythonVersion, Triple,
+};
+use target_lexicon::OperatingSystem;
+
+/// Adds all the [`#[cfg]` flags](index.html) to the current compilation.
+///
+/// This should be called from a build script.
+///
+/// The full list of attributes added are the following:
+///
+/// | Flag | Description |
+/// | ---- | ----------- |
+/// | `#[cfg(Py_3_7)]`, `#[cfg(Py_3_8)]`, `#[cfg(Py_3_9)]`, `#[cfg(Py_3_10)]` | These attributes mark code only for a given Python version and up. For example, `#[cfg(Py_3_7)]` marks code which can run on Python 3.7 **and newer**. |
+/// | `#[cfg(Py_LIMITED_API)]` | This marks code which is run when compiling with PyO3's `abi3` feature enabled. |
+/// | `#[cfg(PyPy)]` | This marks code which is run when compiling for PyPy. |
+/// | `#[cfg(GraalPy)]` | This marks code which is run when compiling for GraalPy. |
+///
+/// For examples of how to use these attributes,
+#[doc = concat!("[see PyO3's guide](https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/building-and-distribution/multiple_python_versions.html)")]
+/// .
+#[cfg(feature = "resolve-config")]
+pub fn use_pyo3_cfgs() {
+    print_expected_cfgs();
+    for cargo_command in get().build_script_outputs() {
+        println!("{}", cargo_command)
+    }
+}
+
+/// Adds linker arguments suitable for PyO3's `extension-module` feature.
+///
+/// This should be called from a build script.
+///
+/// The following link flags are added:
+/// - macOS: `-undefined dynamic_lookup`
+/// - wasm32-unknown-emscripten: `-sSIDE_MODULE=2 -sWASM_BIGINT`
+///
+/// All other platforms currently are no-ops, however this may change as necessary
+/// in future.
+pub fn add_extension_module_link_args() {
+    _add_extension_module_link_args(&impl_::target_triple_from_env(), std::io::stdout())
+}
+
+fn _add_extension_module_link_args(triple: &Triple, mut writer: impl std::io::Write) {
+    if triple.operating_system == OperatingSystem::Darwin {
+        writeln!(writer, "cargo:rustc-cdylib-link-arg=-undefined").unwrap();
+        writeln!(writer, "cargo:rustc-cdylib-link-arg=dynamic_lookup").unwrap();
+    } else if triple == &Triple::from_str("wasm32-unknown-emscripten").unwrap() {
+        writeln!(writer, "cargo:rustc-cdylib-link-arg=-sSIDE_MODULE=2").unwrap();
+        writeln!(writer, "cargo:rustc-cdylib-link-arg=-sWASM_BIGINT").unwrap();
+    }
+}
+
+/// Loads the configuration determined from the build environment.
+///
+/// Because this will never change in a given compilation run, this is cached in a `once_cell`.
+#[cfg(feature = "resolve-config")]
+pub fn get() -> &'static InterpreterConfig {
+    static CONFIG: OnceCell<InterpreterConfig> = OnceCell::new();
+    CONFIG.get_or_init(|| {
+        // Check if we are in a build script and cross compiling to a different target.
+        let cross_compile_config_path = resolve_cross_compile_config_path();
+        let cross_compiling = cross_compile_config_path
+            .as_ref()
+            .map(|path| path.exists())
+            .unwrap_or(false);
+
+        // CONFIG_FILE is generated in build.rs, so it's content can vary
+        #[allow(unknown_lints, clippy::const_is_empty)]
+        if let Some(interpreter_config) = InterpreterConfig::from_cargo_dep_env() {
+            interpreter_config
+        } else if !CONFIG_FILE.is_empty() {
+            InterpreterConfig::from_reader(Cursor::new(CONFIG_FILE))
+        } else if cross_compiling {
+            InterpreterConfig::from_path(cross_compile_config_path.as_ref().unwrap())
+        } else {
+            InterpreterConfig::from_reader(Cursor::new(HOST_CONFIG))
+        }
+        .expect("failed to parse PyO3 config")
+    })
+}
+
+/// Build configuration provided by `PYO3_CONFIG_FILE`. May be empty if env var not set.
+#[doc(hidden)]
+#[cfg(feature = "resolve-config")]
+const CONFIG_FILE: &str = include_str!(concat!(env!("OUT_DIR"), "/pyo3-build-config-file.txt"));
+
+/// Build configuration discovered by `pyo3-build-config` build script. Not aware of
+/// cross-compilation settings.
+#[doc(hidden)]
+#[cfg(feature = "resolve-config")]
+const HOST_CONFIG: &str = include_str!(concat!(env!("OUT_DIR"), "/pyo3-build-config.txt"));
+
+/// Returns the path where PyO3's build.rs writes its cross compile configuration.
+///
+/// The config file will be named `$OUT_DIR/<triple>/pyo3-build-config.txt`.
+///
+/// Must be called from a build script, returns `None` if not.
+#[doc(hidden)]
+#[cfg(feature = "resolve-config")]
+fn resolve_cross_compile_config_path() -> Option<PathBuf> {
+    env::var_os("TARGET").map(|target| {
+        let mut path = PathBuf::from(env!("OUT_DIR"));
+        path.push(Path::new(&target));
+        path.push("pyo3-build-config.txt");
+        path
+    })
+}
+
+/// Use certain features if we detect the compiler being used supports them.
+///
+/// Features may be removed or added as MSRV gets bumped or new features become available,
+/// so this function is unstable.
+#[doc(hidden)]
+pub fn print_feature_cfgs() {
+    let rustc_minor_version = rustc_minor_version().unwrap_or(0);
+
+    // invalid_from_utf8 lint was added in Rust 1.74
+    if rustc_minor_version >= 74 {
+        println!("cargo:rustc-cfg=invalid_from_utf8_lint");
+    }
+
+    if rustc_minor_version >= 79 {
+        println!("cargo:rustc-cfg=c_str_lit");
+    }
+
+    // Actually this is available on 1.78, but we should avoid
+    // https://github.com/rust-lang/rust/issues/124651 just in case
+    if rustc_minor_version >= 79 {
+        println!("cargo:rustc-cfg=diagnostic_namespace");
+    }
+}
+
+/// Registers `pyo3`s config names as reachable cfg expressions
+///
+/// - <https://github.com/rust-lang/cargo/pull/13571>
+/// - <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg>
+#[doc(hidden)]
+pub fn print_expected_cfgs() {
+    if rustc_minor_version().map_or(false, |version| version < 80) {
+        // rustc 1.80.0 stabilized `rustc-check-cfg` feature, don't emit before
+        return;
+    }
+
+    println!("cargo:rustc-check-cfg=cfg(Py_LIMITED_API)");
+    println!("cargo:rustc-check-cfg=cfg(PyPy)");
+    println!("cargo:rustc-check-cfg=cfg(GraalPy)");
+    println!("cargo:rustc-check-cfg=cfg(py_sys_config, values(\"Py_DEBUG\", \"Py_REF_DEBUG\", \"Py_TRACE_REFS\", \"COUNT_ALLOCS\"))");
+    println!("cargo:rustc-check-cfg=cfg(invalid_from_utf8_lint)");
+    println!("cargo:rustc-check-cfg=cfg(pyo3_disable_reference_pool)");
+    println!("cargo:rustc-check-cfg=cfg(pyo3_leak_on_drop_without_reference_pool)");
+    println!("cargo:rustc-check-cfg=cfg(diagnostic_namespace)");
+    println!("cargo:rustc-check-cfg=cfg(c_str_lit)");
+
+    // allow `Py_3_*` cfgs from the minimum supported version up to the
+    // maximum minor version (+1 for development for the next)
+    for i in impl_::MINIMUM_SUPPORTED_VERSION.minor..=impl_::ABI3_MAX_MINOR + 1 {
+        println!("cargo:rustc-check-cfg=cfg(Py_3_{i})");
+    }
+}
+
+/// Private exports used in PyO3's build.rs
+///
+/// Please don't use these - they could change at any time.
+#[doc(hidden)]
+pub mod pyo3_build_script_impl {
+    #[cfg(feature = "resolve-config")]
+    use crate::errors::{Context, Result};
+
+    #[cfg(feature = "resolve-config")]
+    use super::*;
+
+    pub mod errors {
+        pub use crate::errors::*;
+    }
+    pub use crate::impl_::{
+        cargo_env_var, env_var, is_linking_libpython, make_cross_compile_config, InterpreterConfig,
+        PythonVersion,
+    };
+
+    /// Gets the configuration for use from PyO3's build script.
+    ///
+    /// Differs from .get() above only in the cross-compile case, where PyO3's build script is
+    /// required to generate a new config (as it's the first build script which has access to the
+    /// correct value for CARGO_CFG_TARGET_OS).
+    #[cfg(feature = "resolve-config")]
+    pub fn resolve_interpreter_config() -> Result<InterpreterConfig> {
+        // CONFIG_FILE is generated in build.rs, so it's content can vary
+        #[allow(unknown_lints, clippy::const_is_empty)]
+        if !CONFIG_FILE.is_empty() {
+            let mut interperter_config = InterpreterConfig::from_reader(Cursor::new(CONFIG_FILE))?;
+            interperter_config.generate_import_libs()?;
+            Ok(interperter_config)
+        } else if let Some(interpreter_config) = make_cross_compile_config()? {
+            // This is a cross compile and need to write the config file.
+            let path = resolve_cross_compile_config_path()
+                .expect("resolve_interpreter_config() must be called from a build script");
+            let parent_dir = path.parent().ok_or_else(|| {
+                format!(
+                    "failed to resolve parent directory of config file {}",
+                    path.display()
+                )
+            })?;
+            std::fs::create_dir_all(parent_dir).with_context(|| {
+                format!(
+                    "failed to create config file directory {}",
+                    parent_dir.display()
+                )
+            })?;
+            interpreter_config.to_writer(&mut std::fs::File::create(&path).with_context(
+                || format!("failed to create config file at {}", path.display()),
+            )?)?;
+            Ok(interpreter_config)
+        } else {
+            InterpreterConfig::from_reader(Cursor::new(HOST_CONFIG))
+        }
+    }
+}
+
+fn rustc_minor_version() -> Option<u32> {
+    static RUSTC_MINOR_VERSION: OnceCell<Option<u32>> = OnceCell::new();
+    *RUSTC_MINOR_VERSION.get_or_init(|| {
+        let rustc = env::var_os("RUSTC")?;
+        let output = Command::new(rustc).arg("--version").output().ok()?;
+        let version = core::str::from_utf8(&output.stdout).ok()?;
+        let mut pieces = version.split('.');
+        if pieces.next() != Some("rustc 1") {
+            return None;
+        }
+        pieces.next()?.parse().ok()
+    })
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn extension_module_link_args() {
+        let mut buf = Vec::new();
+
+        // Does nothing on non-mac
+        _add_extension_module_link_args(
+            &Triple::from_str("x86_64-pc-windows-msvc").unwrap(),
+            &mut buf,
+        );
+        assert_eq!(buf, Vec::new());
+
+        _add_extension_module_link_args(
+            &Triple::from_str("x86_64-apple-darwin").unwrap(),
+            &mut buf,
+        );
+        assert_eq!(
+            std::str::from_utf8(&buf).unwrap(),
+            "cargo:rustc-cdylib-link-arg=-undefined\n\
+             cargo:rustc-cdylib-link-arg=dynamic_lookup\n"
+        );
+
+        buf.clear();
+        _add_extension_module_link_args(
+            &Triple::from_str("wasm32-unknown-emscripten").unwrap(),
+            &mut buf,
+        );
+        assert_eq!(
+            std::str::from_utf8(&buf).unwrap(),
+            "cargo:rustc-cdylib-link-arg=-sSIDE_MODULE=2\n\
+             cargo:rustc-cdylib-link-arg=-sWASM_BIGINT\n"
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/pyo3-ffi/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"ACKNOWLEDGEMENTS":"a895ab531efd09aae5db905f6a62033d81469c233d42a5c200e1b1965a145020","Cargo.toml":"4d0ec7cc0a09d72d333ff7f546959b9e219ae965fa5e4cc1c8041bedb4b70564","LICENSE-APACHE":"71073d492e996de196dbe1eb1e4c94c27c014c841b288161265b2efd06d0af28","LICENSE-MIT":"afcbe3b2e6b37172b5a9ca869ee4c0b8cdc09316e5d4384864154482c33e5af6","README.md":"d99baee4eea74af6c3b4da3436d7b83f133d1b703bf29b23d9c9b01eba921a5b","build.rs":"574cf8bf024d9d7ad7d35cc21b8d15a5947d620a09d0cd947d579dcfd6a92165","src/abstract_.rs":"dcb44cb9e6b9fee5ced3b8f19118cd9a624e262564ca11c3f0853ed0d9d1af98","src/bltinmodule.rs":"05f18e034fffafba89d8255a7502b05d6debec5ef79f37c9657fd605f2a6a39b","src/boolobject.rs":"eb86795b67f8de0063d02e6292e820f7334397756dd3ff7cf0949ef1ca9f4b99","src/bytearrayobject.rs":"2d21f6cf75fd1c98b203dde5fa6ef8b6029178c9468e28c9170be3b8958c4392","src/bytesobject.rs":"88a9d10e750d7d7917a6dd0d1259a1f86f3ca6a593a8b37c92356569bc2c5071","src/ceval.rs":"a2abc504100b91898e3c924af39348cfbd01125c13fc1389f3781d7bd6c78f6c","src/code.rs":"c6aba4ad96f04ca282e23829d6e92c8028d938b14b0698802582eae7eacb169e","src/codecs.rs":"0c86ae7c1d3d67be9a2ac3c80f6ccdd77aa0c72c46b8dc37eda23eb7619ab0b2","src/compile.rs":"9a7bdc36c8a7c9d0ae14c6db8d9c712d947458b424c8d1348f207c62c9c97b3b","src/complexobject.rs":"1336802508f77798ebd3534bca9593475ae0646a9dcb5254cdd3562bd53dcf86","src/context.rs":"12cac9b5b794d869492a7714227ef0375d41c4a13f22193523ac2b539f52b004","src/cpython/abstract_.rs":"42544ef211afba24ed1517682faa007935e8cd77ab006d5874333b62475ccdb7","src/cpython/bytesobject.rs":"85a0563f6780067b4d0f49792f6bab1d28c9de9a819aa512e4cf47effeb4e7f0","src/cpython/ceval.rs":"3cf69dc673e8cfcb0d40307dc7955526ed3002074d65cb277c282eaabd766160","src/cpython/code.rs":"136d26569c740bbfe4f4f5ffc9762404f31cdcb1b87cce26e44f9899da1e0c41","src/cpython/compile.rs":"ceeed293bb892d49ca9732489962fcb2277fe12d3c6c48f0e7828c2701d8dbb0","src/cpython/descrobject.rs":"ff8341bcf19600cbaddcc02164ff0e789b0c1ec3502537076c4bc57bb5c14570","src/cpython/dictobject.rs":"da456b35dc3f38df95e70bd958514eb627582fea437f4e6173b9ee42d1f2c88e","src/cpython/floatobject.rs":"8a835a937c05d8d6ebbe4fc15c011f019353077da55e074b29011dfddd452ed9","src/cpython/frameobject.rs":"eabc089c5a6beecbe74be31d09ce5c29c35c7dc2a160d9600b4f787a53f2c17d","src/cpython/funcobject.rs":"26794f50e0bffcd48ef9f475d0d101a634d19bf26b8fb6ddc1cb1a3fb3d22146","src/cpython/genobject.rs":"d2bf0214e0cefbad85b6ecfb66fd94ce3ce5c80afe1f1dd6afaaaf62a05dde23","src/cpython/import.rs":"713f0c93e097b1044cdd0e12954865de3fb07595d2dae2dd9f16d14c99a9ae6a","src/cpython/initconfig.rs":"e6a113b30b749aadc7b29d02fb1af2dd9f705fbe0c46ea5e0104b2e875af8a44","src/cpython/listobject.rs":"8bcbd9051dad1cc18c0f4fd4522182fce51b848d49d4252e05eb4624269a0cbc","src/cpython/longobject.rs":"79c16a61a16b103c554c944fd6452f861b1291e182c088a5e270a429580bd227","src/cpython/methodobject.rs":"98d9e9e2d4847ad79999d93d77129051a278631e4260618c2a13b7bbc55da388","src/cpython/mod.rs":"5e61a2ae53017dee57cf4e80711de92fa432628f3b77a854707e7dc4edc17237","src/cpython/object.rs":"3a4eafc8b498f0583ff8df928ff87cf53d88c4afeb78152484d7b10c1e963e8e","src/cpython/objimpl.rs":"d4ae9eb02b3ad44b3beffa2482ea1630c794c3e144fa3091c30b435175e1f064","src/cpython/pydebug.rs":"041988d8ee709ce499b729942b2f815be97d9b1f26e060db93813aa93d850c1f","src/cpython/pyerrors.rs":"de324e847b518f751061faa6703e1da0b5810765ea236d2598af82ec42613f54","src/cpython/pyframe.rs":"d99e567a14a3fbf6dfecf9342c4fa5839f55ac0f64cc22fe28dac8b27751a187","src/cpython/pylifecycle.rs":"c6440b0085c69d41dcdbf9622fcb8da7d16e8252bf511e1c61c0a945ce362d66","src/cpython/pymem.rs":"c42c0b888050bfd4ea5e3275ed1d032b7ec94714bdc4a826517ddb2541bab59e","src/cpython/pystate.rs":"371d81e613fe9a083413eaeb49c2a50523663f6fdf7b6e1aee266414e6efdaf6","src/cpython/pythonrun.rs":"eaafea0d771d421374e0afd650a72860c8b264ff647c1d2375a95035ff8524fd","src/cpython/tupleobject.rs":"9fdc041252a1b47ff8937e4968d6e0f973a5910e09979431972121749fd22aa6","src/cpython/unicodeobject.rs":"4be616fe2587aada9793206b2c1197302a3b8f05a256f5422a03351c299e580d","src/cpython/weakrefobject.rs":"11ce78dd6fe41941cc03b9f09571653e6ee921a3d9e181b9649f96d0f42b88e0","src/datetime.rs":"1d64077a0d5f67434dbb97ac6bb15f8eda66530572e4b7ec2604f7356af1c580","src/descrobject.rs":"3abc7bd7fa71a61352a438b100fff2643a24fd79409403833dd6708b7602dac9","src/dictobject.rs":"505a382e72a2d4fb2f27dd5bae2631775bc8d5ad5a8b7b1214f6dd034db10266","src/enumobject.rs":"1c0f2ab3f7ab48d92147a3bebc0c0f1251adfed6904d53a9b2bf64f32560aeda","src/fileobject.rs":"494421b1779b93e8f27d052c53c857e83b5bb2c7a47870ff00ecbcd320042afe","src/fileutils.rs":"ebec882c3f1ab47686da7bd05dec5f87f653fd115c26c3a1e475aadbf8dd729d","src/floatobject.rs":"cedc182ffeb692386c0f2e588431e18652945739adb3c412401521e3f12a5fcb","src/import.rs":"94b49da77ae6f997d0efcbb6892e3b76973891e03a16f0c7c4a31c3a8ab747f5","src/intrcheck.rs":"0b4e6ca30e123caf1892ab58cf53245f94b456d00333b93058965c08721a3523","src/iterobject.rs":"df4f345519a755ee43acde00c79480bebb34e9f21772f753820e652f4395741f","src/lib.rs":"334868fb6653b99cc92a33ffc7642fb4364219aea3119068b9e7a459c981cd1b","src/listobject.rs":"5e670e009256234c66bef48ee58737888a4517834d3c8a080f664388014dabc2","src/longobject.rs":"87214099920429c5743f812ff461f75e51724abc9c46faceaa49faf972312a5c","src/marshal.rs":"d1a51042497871a33adcd16f4c35e373405f5143be2c9666d4e726dbd3636aa6","src/memoryobject.rs":"db28fc4acd66464db2cab64f36db1a5548ca866ae4f388b99254fad7f77b11d1","src/methodobject.rs":"0871092d2f6a904e53ee466c48e586ca0b6dc540926d8a5d0506bc203b21991a","src/modsupport.rs":"f8c5d909d77660d0891f345b33caf9329b728f7224e7eaca7116aabbeb8ec83b","src/moduleobject.rs":"4ecc0512f36e29bbdfc4c86a4bb93ce471cd15ec4ab4494da64e8181b5fd89a8","src/object.rs":"e50e1d21d3cf24d6ac7103e9665699c4fc63c050dfd37c74e59829f248176b7d","src/objimpl.rs":"534a7c422cfd386aa39826d6d4070c9f3f3b9a5bedeb9413a307ede89e97b267","src/osmodule.rs":"522f0e9265167d67675d01c14f657a31a95795e3dec423dee8af7f830f6946ac","src/pyarena.rs":"53b929cf467bdb3fe7dc5fc22720dddeb6d43836d5e741f291d231c38462c4ab","src/pybuffer.rs":"743af6a4d8db9369a68e9f901353faa3729952566cbf79c466411624e6dce318","src/pycapsule.rs":"47191e027a978ecb2e03efdb9e2853bef68e305ee519b12ed2241801bc48c2db","src/pyerrors.rs":"4042fedff51feb1fc9e3b0f45cebde528568d05fa3ffdff155a28f10f47ec1c5","src/pyframe.rs":"e499a377fda6bd3d08f05f4fc289f3779c9bdf959da364bdd336b4576d07d344","src/pyhash.rs":"5f2180ea34f31edd5488703813f3c9f9d2d352455880d797f1687021495d653a","src/pylifecycle.rs":"a6c40c102d61095adbc7237c1b1cfcad5dc85d8af0cf089505a718b6cf0f00c3","src/pymem.rs":"ae18180aded033401a5354bbb4ab313f07af2ac29b7e8f1216964308124a12f1","src/pyport.rs":"d9b452351def5bc870cbc6d8a7ee4b50fbf6e469843e09edc8cdd6ce6c50d581","src/pystate.rs":"0f37aea4ed472ad38b25f794cdbac0cfbb973597f837f0a10b6164c08fe2aa9b","src/pystrtod.rs":"b29ccd17fc7d82642b5d167fb77d1071acab57c4fa6e56a5309c265aeb483aa3","src/pythonrun.rs":"677949f4a855d437373b15ece75a77a33c55162b7b0c4b0f034409f032cff0af","src/rangeobject.rs":"80761feb600397deb2a940cf94ede3693c47c4920be0a95cf5dbe3f123a6b1c1","src/setobject.rs":"d11fee4b430a6ec1567e5442743219f1bf4b1eeb1968e1948dcc22bef043f987","src/sliceobject.rs":"17c975f8cf0caa566ea6d0ac365b787b7bd4d5612333adfd80f1e6c4cc8e05e7","src/structmember.rs":"264e411d84160f91f992d8bf08f2c2c54b259a802dc77ded5267d32cc3115b7a","src/structseq.rs":"18af9ba6509f683eff0ba45c123953ca21f97586807560a6432975de88f617f6","src/sysmodule.rs":"22b2e98c23f0a6e15fcd2c068c4cae39a5e20f2cad5be25925aea8309d1dd8fd","src/traceback.rs":"0b5fd918f33d88784e0eeb62c7d91ef55fa33aa9ead274cea1ad87fd88004a77","src/tupleobject.rs":"e2fb9e8ca46aaaf828f9eef3b5f35d9cbb4f2ae324b3cc6b8e58e0788c0a8c25","src/typeslots.rs":"0fb9ad514b91d07f4465398276a9c8e40969da3dd30216cbfe905e998e4c9d80","src/unicodeobject.rs":"f7776ec49fdc7165a97d01eb945322ef72d596eab596e4a6c14b5ef1ca76d97a","src/warnings.rs":"7e53c5a45da1af53110ab09d8d7485bfbf0154a7f0e531ac9b74f3b953ab4d11","src/weakrefobject.rs":"aab75292df622b3656260f3e0a9ed98bf67f40810ed0ae5f798c1a0bd92e28a1"},"package":"5e97e919d2df92eb88ca80a037969f44e5e70356559654962cbb3316d00300c6"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/ACKNOWLEDGEMENTS 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/ACKNOWLEDGEMENTS
--- 43.0.0-1/rust-vendor/pyo3-ffi/ACKNOWLEDGEMENTS	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/ACKNOWLEDGEMENTS	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,6 @@
+This is a Rust reimplementation of the CPython public header files as necessary
+for binary compatibility, with additional metadata to support PyPy.
+
+For original implementations please see:
+ - https://github.com/python/cpython
+ - https://foss.heptapod.net/pypy/pypy
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/Cargo.toml
--- 43.0.0-1/rust-vendor/pyo3-ffi/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,98 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2021"
+name = "pyo3-ffi"
+version = "0.22.2"
+authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]
+links = "python"
+description = "Python-API bindings for the PyO3 ecosystem"
+homepage = "https://github.com/pyo3/pyo3"
+readme = "README.md"
+keywords = [
+    "pyo3",
+    "python",
+    "cpython",
+    "ffi",
+]
+categories = [
+    "api-bindings",
+    "development-tools::ffi",
+]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/pyo3/pyo3"
+
+[dependencies.libc]
+version = "0.2.62"
+
+[build-dependencies.pyo3-build-config]
+version = "=0.22.2"
+features = ["resolve-config"]
+
+[features]
+abi3 = ["pyo3-build-config/abi3"]
+abi3-py310 = [
+    "abi3-py311",
+    "pyo3-build-config/abi3-py310",
+]
+abi3-py311 = [
+    "abi3-py312",
+    "pyo3-build-config/abi3-py311",
+]
+abi3-py312 = [
+    "abi3",
+    "pyo3-build-config/abi3-py312",
+]
+abi3-py37 = [
+    "abi3-py38",
+    "pyo3-build-config/abi3-py37",
+]
+abi3-py38 = [
+    "abi3-py39",
+    "pyo3-build-config/abi3-py38",
+]
+abi3-py39 = [
+    "abi3-py310",
+    "pyo3-build-config/abi3-py39",
+]
+default = []
+extension-module = ["pyo3-build-config/extension-module"]
+generate-import-lib = ["pyo3-build-config/python3-dll-a"]
+
+[lints.clippy]
+checked_conversions = "warn"
+dbg_macro = "warn"
+explicit_into_iter_loop = "warn"
+explicit_iter_loop = "warn"
+filter_map_next = "warn"
+flat_map_option = "warn"
+let_unit_value = "warn"
+manual_assert = "warn"
+manual_ok_or = "warn"
+todo = "warn"
+unnecessary_wraps = "warn"
+used_underscore_binding = "warn"
+useless_transmute = "warn"
+
+[lints.rust]
+elided_lifetimes_in_paths = "warn"
+invalid_doc_attributes = "warn"
+rust_2021_prelude_collisions = "warn"
+unused_lifetimes = "warn"
+
+[lints.rust.rust_2018_idioms]
+level = "warn"
+priority = -1
+
+[lints.rustdoc]
+bare_urls = "warn"
+broken_intra_doc_links = "warn"
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/pyo3-ffi/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,189 @@
+   Copyright (c) 2017-present PyO3 Project and Contributors.  https://github.com/PyO3
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/LICENSE-MIT
--- 43.0.0-1/rust-vendor/pyo3-ffi/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,25 @@
+Copyright (c) 2023-present PyO3 Project and Contributors.  https://github.com/PyO3
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/README.md 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/README.md
--- 43.0.0-1/rust-vendor/pyo3-ffi/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,180 @@
+# pyo3-ffi
+
+This crate provides [Rust](https://www.rust-lang.org/) FFI declarations for Python 3.
+It supports both the stable and the unstable component of the ABI through the use of cfg flags.
+Python Versions 3.7+ are supported.
+It is meant for advanced users only - regular PyO3 users shouldn't
+need to interact with this crate at all.
+
+The contents of this crate are not documented here, as it would entail
+basically copying the documentation from CPython. Consult the [Python/C API Reference
+Manual][capi] for up-to-date documentation.
+
+# Minimum supported Rust and Python versions
+
+PyO3 supports the following software versions:
+  - Python 3.7 and up (CPython and PyPy)
+  - Rust 1.63 and up
+
+# Example: Building Python Native modules
+
+PyO3 can be used to generate a native Python module. The easiest way to try this out for the
+first time is to use [`maturin`]. `maturin` is a tool for building and publishing Rust-based
+Python packages with minimal configuration. The following steps set up some files for an example
+Python module, install `maturin`, and then show how to build and import the Python module.
+
+First, create a new folder (let's call it `string_sum`) containing the following two files:
+
+**`Cargo.toml`**
+
+```toml
+[lib]
+name = "string_sum"
+# "cdylib" is necessary to produce a shared library for Python to import from.
+#
+# Downstream Rust code (including code in `bin/`, `examples/`, and `tests/`) will not be able
+# to `use string_sum;` unless the "rlib" or "lib" crate type is also included, e.g.:
+# crate-type = ["cdylib", "rlib"]
+crate-type = ["cdylib"]
+
+[dependencies.pyo3-ffi]
+version = "*"
+features = ["extension-module"]
+```
+
+**`src/lib.rs`**
+```rust
+use std::os::raw::c_char;
+use std::ptr;
+
+use pyo3_ffi::*;
+
+static mut MODULE_DEF: PyModuleDef = PyModuleDef {
+    m_base: PyModuleDef_HEAD_INIT,
+    m_name: c_str!("string_sum").as_ptr(),
+    m_doc: c_str!("A Python module written in Rust.").as_ptr(),
+    m_size: 0,
+    m_methods: unsafe { METHODS.as_mut_ptr().cast() },
+    m_slots: std::ptr::null_mut(),
+    m_traverse: None,
+    m_clear: None,
+    m_free: None,
+};
+
+static mut METHODS: [PyMethodDef; 2] = [
+    PyMethodDef {
+        ml_name: c_str!("sum_as_string").as_ptr(),
+        ml_meth: PyMethodDefPointer {
+            _PyCFunctionFast: sum_as_string,
+        },
+        ml_flags: METH_FASTCALL,
+        ml_doc: c_str!("returns the sum of two integers as a string").as_ptr(),
+    },
+    // A zeroed PyMethodDef to mark the end of the array.
+    PyMethodDef::zeroed()
+];
+
+// The module initialization function, which must be named `PyInit_<your_module>`.
+#[allow(non_snake_case)]
+#[no_mangle]
+pub unsafe extern "C" fn PyInit_string_sum() -> *mut PyObject {
+    PyModule_Create(ptr::addr_of_mut!(MODULE_DEF))
+}
+
+pub unsafe extern "C" fn sum_as_string(
+    _self: *mut PyObject,
+    args: *mut *mut PyObject,
+    nargs: Py_ssize_t,
+) -> *mut PyObject {
+    if nargs != 2 {
+        PyErr_SetString(
+            PyExc_TypeError,
+            c_str!("sum_as_string() expected 2 positional arguments").as_ptr(),
+        );
+        return std::ptr::null_mut();
+    }
+
+    let arg1 = *args;
+    if PyLong_Check(arg1) == 0 {
+        PyErr_SetString(
+            PyExc_TypeError,
+            c_str!("sum_as_string() expected an int for positional argument 1").as_ptr(),
+        );
+        return std::ptr::null_mut();
+    }
+
+    let arg1 = PyLong_AsLong(arg1);
+    if !PyErr_Occurred().is_null() {
+        return ptr::null_mut();
+    }
+
+    let arg2 = *args.add(1);
+    if PyLong_Check(arg2) == 0 {
+        PyErr_SetString(
+            PyExc_TypeError,
+            c_str!("sum_as_string() expected an int for positional argument 2").as_ptr(),
+        );
+        return std::ptr::null_mut();
+    }
+
+    let arg2 = PyLong_AsLong(arg2);
+    if !PyErr_Occurred().is_null() {
+        return ptr::null_mut();
+    }
+
+    match arg1.checked_add(arg2) {
+        Some(sum) => {
+            let string = sum.to_string();
+            PyUnicode_FromStringAndSize(string.as_ptr().cast::<c_char>(), string.len() as isize)
+        }
+        None => {
+            PyErr_SetString(
+                PyExc_OverflowError,
+                c_str!("arguments too large to add").as_ptr(),
+            );
+            std::ptr::null_mut()
+        }
+    }
+}
+```
+
+With those two files in place, now `maturin` needs to be installed. This can be done using
+Python's package manager `pip`. First, load up a new Python `virtualenv`, and install `maturin`
+into it:
+```bash
+$ cd string_sum
+$ python -m venv .env
+$ source .env/bin/activate
+$ pip install maturin
+```
+
+Now build and execute the module:
+```bash
+$ maturin develop
+# lots of progress output as maturin runs the compilation...
+$ python
+>>> import string_sum
+>>> string_sum.sum_as_string(5, 20)
+'25'
+```
+
+As well as with `maturin`, it is possible to build using [setuptools-rust] or
+[manually][manual_builds]. Both offer more flexibility than `maturin` but require further
+configuration.
+
+
+While most projects use the safe wrapper provided by PyO3,
+you can take a look at the [`orjson`] library as an example on how to use `pyo3-ffi` directly.
+For those well versed in C and Rust the [tutorials] from the CPython documentation
+can be easily converted to rust as well.
+
+[tutorials]: https://docs.python.org/3/extending/
+[`orjson`]: https://github.com/ijl/orjson
+[capi]: https://docs.python.org/3/c-api/index.html
+[`maturin`]: https://github.com/PyO3/maturin "Build and publish crates with pyo3, rust-cpython and cffi bindings as well as rust binaries as python packages"
+[`pyo3-build-config`]: https://docs.rs/pyo3-build-config
+[feature flags]: https://doc.rust-lang.org/cargo/reference/features.html "Features - The Cargo Book"
+[manual_builds]: https://pyo3.rs/latest/building-and-distribution.html#manual-builds "Manual builds - Building and Distribution - PyO3 user guide"
+[setuptools-rust]: https://github.com/PyO3/setuptools-rust "Setuptools plugin for Rust extensions"
+[PEP 384]: https://www.python.org/dev/peps/pep-0384 "PEP 384 -- Defining a Stable ABI"
+[Features chapter of the guide]: https://pyo3.rs/latest/features.html#features-reference "Features Reference - PyO3 user guide"
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/build.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/build.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/build.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/build.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,246 @@
+use pyo3_build_config::{
+    bail, ensure, print_feature_cfgs,
+    pyo3_build_script_impl::{
+        cargo_env_var, env_var, errors::Result, is_linking_libpython, resolve_interpreter_config,
+        InterpreterConfig, PythonVersion,
+    },
+    warn, BuildFlag, PythonImplementation,
+};
+use std::ops::Not;
+
+/// Minimum Python version PyO3 supports.
+struct SupportedVersions {
+    min: PythonVersion,
+    max: PythonVersion,
+}
+
+const SUPPORTED_VERSIONS_CPYTHON: SupportedVersions = SupportedVersions {
+    min: PythonVersion { major: 3, minor: 7 },
+    max: PythonVersion {
+        major: 3,
+        minor: 13,
+    },
+};
+
+const SUPPORTED_VERSIONS_PYPY: SupportedVersions = SupportedVersions {
+    min: PythonVersion { major: 3, minor: 7 },
+    max: PythonVersion {
+        major: 3,
+        minor: 10,
+    },
+};
+
+const SUPPORTED_VERSIONS_GRAALPY: SupportedVersions = SupportedVersions {
+    min: PythonVersion {
+        major: 3,
+        minor: 10,
+    },
+    max: PythonVersion {
+        major: 3,
+        minor: 11,
+    },
+};
+
+fn ensure_python_version(interpreter_config: &InterpreterConfig) -> Result<()> {
+    // This is an undocumented env var which is only really intended to be used in CI / for testing
+    // and development.
+    if std::env::var("UNSAFE_PYO3_SKIP_VERSION_CHECK").as_deref() == Ok("1") {
+        return Ok(());
+    }
+
+    match interpreter_config.implementation {
+        PythonImplementation::CPython => {
+            let versions = SUPPORTED_VERSIONS_CPYTHON;
+            ensure!(
+                interpreter_config.version >= versions.min,
+                "the configured Python interpreter version ({}) is lower than PyO3's minimum supported version ({})",
+                interpreter_config.version,
+                versions.min,
+            );
+            ensure!(
+                interpreter_config.version <= versions.max || env_var("PYO3_USE_ABI3_FORWARD_COMPATIBILITY").map_or(false, |os_str| os_str == "1"),
+                "the configured Python interpreter version ({}) is newer than PyO3's maximum supported version ({})\n\
+                 = help: please check if an updated version of PyO3 is available. Current version: {}\n\
+                 = help: set PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 to suppress this check and build anyway using the stable ABI",
+                interpreter_config.version,
+                versions.max,
+                std::env::var("CARGO_PKG_VERSION").unwrap(),
+            );
+        }
+        PythonImplementation::PyPy => {
+            let versions = SUPPORTED_VERSIONS_PYPY;
+            ensure!(
+                interpreter_config.version >= versions.min,
+                "the configured PyPy interpreter version ({}) is lower than PyO3's minimum supported version ({})",
+                interpreter_config.version,
+                versions.min,
+            );
+            // PyO3 does not support abi3, so we cannot offer forward compatibility
+            ensure!(
+                interpreter_config.version <= versions.max,
+                "the configured PyPy interpreter version ({}) is newer than PyO3's maximum supported version ({})\n\
+                 = help: please check if an updated version of PyO3 is available. Current version: {}",
+                interpreter_config.version,
+                versions.max,
+                std::env::var("CARGO_PKG_VERSION").unwrap()
+            );
+        }
+        PythonImplementation::GraalPy => {
+            let versions = SUPPORTED_VERSIONS_GRAALPY;
+            ensure!(
+                interpreter_config.version >= versions.min,
+                "the configured GraalPy interpreter version ({}) is lower than PyO3's minimum supported version ({})",
+                interpreter_config.version,
+                versions.min,
+            );
+            // GraalPy does not support abi3, so we cannot offer forward compatibility
+            ensure!(
+                interpreter_config.version <= versions.max,
+                "the configured GraalPy interpreter version ({}) is newer than PyO3's maximum supported version ({})\n\
+                 = help: please check if an updated version of PyO3 is available. Current version: {}",
+                interpreter_config.version,
+                versions.max,
+                std::env::var("CARGO_PKG_VERSION").unwrap()
+            );
+        }
+    }
+
+    if interpreter_config.abi3 {
+        match interpreter_config.implementation {
+            PythonImplementation::CPython => {}
+            PythonImplementation::PyPy => warn!(
+                "PyPy does not yet support abi3 so the build artifacts will be version-specific. \
+                See https://foss.heptapod.net/pypy/pypy/-/issues/3397 for more information."
+            ),
+            PythonImplementation::GraalPy => warn!(
+                "GraalPy does not support abi3 so the build artifacts will be version-specific."
+            ),
+        }
+    }
+
+    Ok(())
+}
+
+fn ensure_gil_enabled(interpreter_config: &InterpreterConfig) -> Result<()> {
+    let gil_enabled = interpreter_config
+        .build_flags
+        .0
+        .contains(&BuildFlag::Other("Py_GIL_DISABLED".to_string()))
+        .not();
+    ensure!(
+        gil_enabled || std::env::var("UNSAFE_PYO3_BUILD_FREE_THREADED").map_or(false, |os_str| os_str == "1"),
+        "the Python interpreter was built with the GIL disabled, which is not yet supported by PyO3\n\
+        = help: see https://github.com/PyO3/pyo3/issues/4265 for more information\n\
+        = help: please check if an updated version of PyO3 is available. Current version: {}\n\
+        = help: set UNSAFE_PYO3_BUILD_FREE_THREADED=1 to suppress this check and build anyway for free-threaded Python",
+        std::env::var("CARGO_PKG_VERSION").unwrap()
+    );
+
+    Ok(())
+}
+
+fn ensure_target_pointer_width(interpreter_config: &InterpreterConfig) -> Result<()> {
+    if let Some(pointer_width) = interpreter_config.pointer_width {
+        // Try to check whether the target architecture matches the python library
+        let rust_target = match cargo_env_var("CARGO_CFG_TARGET_POINTER_WIDTH")
+            .unwrap()
+            .as_str()
+        {
+            "64" => 64,
+            "32" => 32,
+            x => bail!("unexpected Rust target pointer width: {}", x),
+        };
+
+        ensure!(
+            rust_target == pointer_width,
+            "your Rust target architecture ({}-bit) does not match your python interpreter ({}-bit)",
+            rust_target,
+            pointer_width
+        );
+    }
+    Ok(())
+}
+
+fn emit_link_config(interpreter_config: &InterpreterConfig) -> Result<()> {
+    let target_os = cargo_env_var("CARGO_CFG_TARGET_OS").unwrap();
+
+    println!(
+        "cargo:rustc-link-lib={link_model}{alias}{lib_name}",
+        link_model = if interpreter_config.shared {
+            ""
+        } else {
+            "static="
+        },
+        alias = if target_os == "windows" {
+            "pythonXY:"
+        } else {
+            ""
+        },
+        lib_name = interpreter_config.lib_name.as_ref().ok_or(
+            "attempted to link to Python shared library but config does not contain lib_name"
+        )?,
+    );
+
+    if let Some(lib_dir) = &interpreter_config.lib_dir {
+        println!("cargo:rustc-link-search=native={}", lib_dir);
+    }
+
+    Ok(())
+}
+
+/// Prepares the PyO3 crate for compilation.
+///
+/// This loads the config from pyo3-build-config and then makes some additional checks to improve UX
+/// for users.
+///
+/// Emits the cargo configuration based on this config as well as a few checks of the Rust compiler
+/// version to enable features which aren't supported on MSRV.
+fn configure_pyo3() -> Result<()> {
+    let interpreter_config = resolve_interpreter_config()?;
+
+    if env_var("PYO3_PRINT_CONFIG").map_or(false, |os_str| os_str == "1") {
+        print_config_and_exit(&interpreter_config);
+    }
+
+    ensure_python_version(&interpreter_config)?;
+    ensure_target_pointer_width(&interpreter_config)?;
+    ensure_gil_enabled(&interpreter_config)?;
+
+    // Serialize the whole interpreter config into DEP_PYTHON_PYO3_CONFIG env var.
+    interpreter_config.to_cargo_dep_env()?;
+
+    if is_linking_libpython() && !interpreter_config.suppress_build_script_link_lines {
+        emit_link_config(&interpreter_config)?;
+    }
+
+    for cfg in interpreter_config.build_script_outputs() {
+        println!("{}", cfg)
+    }
+
+    // Extra lines come last, to support last write wins.
+    for line in &interpreter_config.extra_build_script_lines {
+        println!("{}", line);
+    }
+
+    // Emit cfgs like `invalid_from_utf8_lint`
+    print_feature_cfgs();
+
+    Ok(())
+}
+
+fn print_config_and_exit(config: &InterpreterConfig) {
+    println!("\n-- PYO3_PRINT_CONFIG=1 is set, printing configuration and halting compile --");
+    config
+        .to_writer(std::io::stdout())
+        .expect("failed to print config to stdout");
+    println!("\nnote: unset the PYO3_PRINT_CONFIG environment variable and retry to compile with the above config");
+    std::process::exit(101);
+}
+
+fn main() {
+    pyo3_build_config::print_expected_cfgs();
+    if let Err(e) = configure_pyo3() {
+        eprintln!("error: {}", e.report());
+        std::process::exit(1)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/abstract_.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/abstract_.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/abstract_.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/abstract_.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,339 @@
+use crate::object::*;
+use crate::pyport::Py_ssize_t;
+use std::os::raw::{c_char, c_int};
+use std::ptr;
+
+extern "C" {
+    #[cfg(PyPy)]
+    #[link_name = "PyPyObject_DelAttrString"]
+    pub fn PyObject_DelAttrString(o: *mut PyObject, attr_name: *const c_char) -> c_int;
+}
+
+#[inline]
+#[cfg(not(PyPy))]
+pub unsafe fn PyObject_DelAttrString(o: *mut PyObject, attr_name: *const c_char) -> c_int {
+    PyObject_SetAttrString(o, attr_name, ptr::null_mut())
+}
+
+#[inline]
+pub unsafe fn PyObject_DelAttr(o: *mut PyObject, attr_name: *mut PyObject) -> c_int {
+    PyObject_SetAttr(o, attr_name, ptr::null_mut())
+}
+
+extern "C" {
+    #[cfg(all(
+        not(PyPy),
+        not(GraalPy),
+        any(Py_3_10, all(not(Py_LIMITED_API), Py_3_9)) // Added to python in 3.9 but to limited API in 3.10
+    ))]
+    #[cfg_attr(PyPy, link_name = "PyPyObject_CallNoArgs")]
+    pub fn PyObject_CallNoArgs(func: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_Call")]
+    pub fn PyObject_Call(
+        callable_object: *mut PyObject,
+        args: *mut PyObject,
+        kw: *mut PyObject,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_CallObject")]
+    pub fn PyObject_CallObject(
+        callable_object: *mut PyObject,
+        args: *mut PyObject,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_CallFunction")]
+    pub fn PyObject_CallFunction(
+        callable_object: *mut PyObject,
+        format: *const c_char,
+        ...
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_CallMethod")]
+    pub fn PyObject_CallMethod(
+        o: *mut PyObject,
+        method: *const c_char,
+        format: *const c_char,
+        ...
+    ) -> *mut PyObject;
+
+    #[cfg(not(Py_3_13))]
+    #[cfg_attr(PyPy, link_name = "_PyPyObject_CallFunction_SizeT")]
+    pub fn _PyObject_CallFunction_SizeT(
+        callable_object: *mut PyObject,
+        format: *const c_char,
+        ...
+    ) -> *mut PyObject;
+    #[cfg(not(Py_3_13))]
+    #[cfg_attr(PyPy, link_name = "_PyPyObject_CallMethod_SizeT")]
+    pub fn _PyObject_CallMethod_SizeT(
+        o: *mut PyObject,
+        method: *const c_char,
+        format: *const c_char,
+        ...
+    ) -> *mut PyObject;
+
+    #[cfg_attr(PyPy, link_name = "PyPyObject_CallFunctionObjArgs")]
+    pub fn PyObject_CallFunctionObjArgs(callable: *mut PyObject, ...) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_CallMethodObjArgs")]
+    pub fn PyObject_CallMethodObjArgs(
+        o: *mut PyObject,
+        method: *mut PyObject,
+        ...
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_Type")]
+    pub fn PyObject_Type(o: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_Size")]
+    pub fn PyObject_Size(o: *mut PyObject) -> Py_ssize_t;
+}
+
+#[inline]
+pub unsafe fn PyObject_Length(o: *mut PyObject) -> Py_ssize_t {
+    PyObject_Size(o)
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyObject_GetItem")]
+    pub fn PyObject_GetItem(o: *mut PyObject, key: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_SetItem")]
+    pub fn PyObject_SetItem(o: *mut PyObject, key: *mut PyObject, v: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_DelItemString")]
+    pub fn PyObject_DelItemString(o: *mut PyObject, key: *const c_char) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_DelItem")]
+    pub fn PyObject_DelItem(o: *mut PyObject, key: *mut PyObject) -> c_int;
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyObject_Format")]
+    pub fn PyObject_Format(obj: *mut PyObject, format_spec: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_GetIter")]
+    pub fn PyObject_GetIter(arg1: *mut PyObject) -> *mut PyObject;
+}
+
+// Before 3.8 PyIter_Check was defined in CPython as a macro,
+// but the implementation of that in PyO3 did not work, see
+// https://github.com/PyO3/pyo3/pull/2914
+//
+// This is a slow implementation which should function equivalently.
+#[cfg(not(any(Py_3_8, PyPy)))]
+#[inline]
+pub unsafe fn PyIter_Check(o: *mut PyObject) -> c_int {
+    crate::PyObject_HasAttrString(crate::Py_TYPE(o).cast(), c_str!("__next__").as_ptr())
+}
+
+extern "C" {
+    #[cfg(any(Py_3_8, PyPy))]
+    #[cfg_attr(PyPy, link_name = "PyPyIter_Check")]
+    pub fn PyIter_Check(obj: *mut PyObject) -> c_int;
+
+    #[cfg_attr(PyPy, link_name = "PyPyIter_Next")]
+    pub fn PyIter_Next(arg1: *mut PyObject) -> *mut PyObject;
+    #[cfg(all(not(PyPy), Py_3_10))]
+    #[cfg_attr(PyPy, link_name = "PyPyIter_Send")]
+    pub fn PyIter_Send(iter: *mut PyObject, arg: *mut PyObject, presult: *mut *mut PyObject);
+
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_Check")]
+    pub fn PyNumber_Check(o: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_Add")]
+    pub fn PyNumber_Add(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_Subtract")]
+    pub fn PyNumber_Subtract(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_Multiply")]
+    pub fn PyNumber_Multiply(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_MatrixMultiply")]
+    pub fn PyNumber_MatrixMultiply(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_FloorDivide")]
+    pub fn PyNumber_FloorDivide(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_TrueDivide")]
+    pub fn PyNumber_TrueDivide(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_Remainder")]
+    pub fn PyNumber_Remainder(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_Divmod")]
+    pub fn PyNumber_Divmod(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_Power")]
+    pub fn PyNumber_Power(o1: *mut PyObject, o2: *mut PyObject, o3: *mut PyObject)
+        -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_Negative")]
+    pub fn PyNumber_Negative(o: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_Positive")]
+    pub fn PyNumber_Positive(o: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_Absolute")]
+    pub fn PyNumber_Absolute(o: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_Invert")]
+    pub fn PyNumber_Invert(o: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_Lshift")]
+    pub fn PyNumber_Lshift(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_Rshift")]
+    pub fn PyNumber_Rshift(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_And")]
+    pub fn PyNumber_And(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_Xor")]
+    pub fn PyNumber_Xor(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_Or")]
+    pub fn PyNumber_Or(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+}
+
+// Defined as this macro in Python limited API, but relies on
+// non-limited PyTypeObject. Don't expose this since it cannot be used.
+#[cfg(not(any(Py_LIMITED_API, PyPy)))]
+#[inline]
+pub unsafe fn PyIndex_Check(o: *mut PyObject) -> c_int {
+    let tp_as_number = (*Py_TYPE(o)).tp_as_number;
+    (!tp_as_number.is_null() && (*tp_as_number).nb_index.is_some()) as c_int
+}
+
+extern "C" {
+    #[cfg(any(all(Py_3_8, Py_LIMITED_API), PyPy))]
+    #[link_name = "PyPyIndex_Check"]
+    pub fn PyIndex_Check(o: *mut PyObject) -> c_int;
+
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_Index")]
+    pub fn PyNumber_Index(o: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_AsSsize_t")]
+    pub fn PyNumber_AsSsize_t(o: *mut PyObject, exc: *mut PyObject) -> Py_ssize_t;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_Long")]
+    pub fn PyNumber_Long(o: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_Float")]
+    pub fn PyNumber_Float(o: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_InPlaceAdd")]
+    pub fn PyNumber_InPlaceAdd(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_InPlaceSubtract")]
+    pub fn PyNumber_InPlaceSubtract(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_InPlaceMultiply")]
+    pub fn PyNumber_InPlaceMultiply(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_InPlaceMatrixMultiply")]
+    pub fn PyNumber_InPlaceMatrixMultiply(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_InPlaceFloorDivide")]
+    pub fn PyNumber_InPlaceFloorDivide(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_InPlaceTrueDivide")]
+    pub fn PyNumber_InPlaceTrueDivide(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_InPlaceRemainder")]
+    pub fn PyNumber_InPlaceRemainder(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_InPlacePower")]
+    pub fn PyNumber_InPlacePower(
+        o1: *mut PyObject,
+        o2: *mut PyObject,
+        o3: *mut PyObject,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_InPlaceLshift")]
+    pub fn PyNumber_InPlaceLshift(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_InPlaceRshift")]
+    pub fn PyNumber_InPlaceRshift(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_InPlaceAnd")]
+    pub fn PyNumber_InPlaceAnd(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_InPlaceXor")]
+    pub fn PyNumber_InPlaceXor(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyNumber_InPlaceOr")]
+    pub fn PyNumber_InPlaceOr(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    pub fn PyNumber_ToBase(n: *mut PyObject, base: c_int) -> *mut PyObject;
+
+    #[cfg_attr(PyPy, link_name = "PyPySequence_Check")]
+    pub fn PySequence_Check(o: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPySequence_Size")]
+    pub fn PySequence_Size(o: *mut PyObject) -> Py_ssize_t;
+
+    #[cfg(PyPy)]
+    #[link_name = "PyPySequence_Length"]
+    pub fn PySequence_Length(o: *mut PyObject) -> Py_ssize_t;
+}
+
+#[inline]
+#[cfg(not(PyPy))]
+pub unsafe fn PySequence_Length(o: *mut PyObject) -> Py_ssize_t {
+    PySequence_Size(o)
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPySequence_Concat")]
+    pub fn PySequence_Concat(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPySequence_Repeat")]
+    pub fn PySequence_Repeat(o: *mut PyObject, count: Py_ssize_t) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPySequence_GetItem")]
+    pub fn PySequence_GetItem(o: *mut PyObject, i: Py_ssize_t) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPySequence_GetSlice")]
+    pub fn PySequence_GetSlice(o: *mut PyObject, i1: Py_ssize_t, i2: Py_ssize_t) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPySequence_SetItem")]
+    pub fn PySequence_SetItem(o: *mut PyObject, i: Py_ssize_t, v: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPySequence_DelItem")]
+    pub fn PySequence_DelItem(o: *mut PyObject, i: Py_ssize_t) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPySequence_SetSlice")]
+    pub fn PySequence_SetSlice(
+        o: *mut PyObject,
+        i1: Py_ssize_t,
+        i2: Py_ssize_t,
+        v: *mut PyObject,
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPySequence_DelSlice")]
+    pub fn PySequence_DelSlice(o: *mut PyObject, i1: Py_ssize_t, i2: Py_ssize_t) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPySequence_Tuple")]
+    pub fn PySequence_Tuple(o: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPySequence_List")]
+    pub fn PySequence_List(o: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPySequence_Fast")]
+    pub fn PySequence_Fast(o: *mut PyObject, m: *const c_char) -> *mut PyObject;
+    // skipped PySequence_Fast_GET_SIZE
+    // skipped PySequence_Fast_GET_ITEM
+    // skipped PySequence_Fast_GET_ITEMS
+    pub fn PySequence_Count(o: *mut PyObject, value: *mut PyObject) -> Py_ssize_t;
+    #[cfg_attr(PyPy, link_name = "PyPySequence_Contains")]
+    pub fn PySequence_Contains(seq: *mut PyObject, ob: *mut PyObject) -> c_int;
+}
+
+#[inline]
+pub unsafe fn PySequence_In(o: *mut PyObject, value: *mut PyObject) -> c_int {
+    PySequence_Contains(o, value)
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPySequence_Index")]
+    pub fn PySequence_Index(o: *mut PyObject, value: *mut PyObject) -> Py_ssize_t;
+    #[cfg_attr(PyPy, link_name = "PyPySequence_InPlaceConcat")]
+    pub fn PySequence_InPlaceConcat(o1: *mut PyObject, o2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPySequence_InPlaceRepeat")]
+    pub fn PySequence_InPlaceRepeat(o: *mut PyObject, count: Py_ssize_t) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyMapping_Check")]
+    pub fn PyMapping_Check(o: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyMapping_Size")]
+    pub fn PyMapping_Size(o: *mut PyObject) -> Py_ssize_t;
+
+    #[cfg(PyPy)]
+    #[link_name = "PyPyMapping_Length"]
+    pub fn PyMapping_Length(o: *mut PyObject) -> Py_ssize_t;
+}
+
+#[inline]
+#[cfg(not(PyPy))]
+pub unsafe fn PyMapping_Length(o: *mut PyObject) -> Py_ssize_t {
+    PyMapping_Size(o)
+}
+
+#[inline]
+pub unsafe fn PyMapping_DelItemString(o: *mut PyObject, key: *mut c_char) -> c_int {
+    PyObject_DelItemString(o, key)
+}
+
+#[inline]
+pub unsafe fn PyMapping_DelItem(o: *mut PyObject, key: *mut PyObject) -> c_int {
+    PyObject_DelItem(o, key)
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyMapping_HasKeyString")]
+    pub fn PyMapping_HasKeyString(o: *mut PyObject, key: *const c_char) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyMapping_HasKey")]
+    pub fn PyMapping_HasKey(o: *mut PyObject, key: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyMapping_Keys")]
+    pub fn PyMapping_Keys(o: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyMapping_Values")]
+    pub fn PyMapping_Values(o: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyMapping_Items")]
+    pub fn PyMapping_Items(o: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyMapping_GetItemString")]
+    pub fn PyMapping_GetItemString(o: *mut PyObject, key: *const c_char) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyMapping_SetItemString")]
+    pub fn PyMapping_SetItemString(
+        o: *mut PyObject,
+        key: *const c_char,
+        value: *mut PyObject,
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_IsInstance")]
+    pub fn PyObject_IsInstance(object: *mut PyObject, typeorclass: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_IsSubclass")]
+    pub fn PyObject_IsSubclass(object: *mut PyObject, typeorclass: *mut PyObject) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/bltinmodule.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/bltinmodule.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/bltinmodule.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/bltinmodule.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,8 @@
+use crate::object::PyTypeObject;
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    pub static mut PyFilter_Type: PyTypeObject;
+    pub static mut PyMap_Type: PyTypeObject;
+    pub static mut PyZip_Type: PyTypeObject;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/boolobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/boolobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/boolobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/boolobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,66 @@
+#[cfg(not(GraalPy))]
+use crate::longobject::PyLongObject;
+use crate::object::*;
+use std::os::raw::{c_int, c_long};
+use std::ptr::addr_of_mut;
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyBool_Type")]
+    pub static mut PyBool_Type: PyTypeObject;
+}
+
+#[inline]
+pub unsafe fn PyBool_Check(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyBool_Type)) as c_int
+}
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg(not(GraalPy))]
+    #[cfg_attr(PyPy, link_name = "_PyPy_FalseStruct")]
+    static mut _Py_FalseStruct: PyLongObject;
+    #[cfg(not(GraalPy))]
+    #[cfg_attr(PyPy, link_name = "_PyPy_TrueStruct")]
+    static mut _Py_TrueStruct: PyLongObject;
+
+    #[cfg(GraalPy)]
+    static mut _Py_FalseStructReference: *mut PyObject;
+    #[cfg(GraalPy)]
+    static mut _Py_TrueStructReference: *mut PyObject;
+}
+
+#[inline]
+pub unsafe fn Py_False() -> *mut PyObject {
+    #[cfg(not(GraalPy))]
+    return addr_of_mut!(_Py_FalseStruct) as *mut PyObject;
+    #[cfg(GraalPy)]
+    return _Py_FalseStructReference;
+}
+
+#[inline]
+pub unsafe fn Py_True() -> *mut PyObject {
+    #[cfg(not(GraalPy))]
+    return addr_of_mut!(_Py_TrueStruct) as *mut PyObject;
+    #[cfg(GraalPy)]
+    return _Py_TrueStructReference;
+}
+
+#[inline]
+pub unsafe fn Py_IsTrue(x: *mut PyObject) -> c_int {
+    Py_Is(x, Py_True())
+}
+
+#[inline]
+pub unsafe fn Py_IsFalse(x: *mut PyObject) -> c_int {
+    Py_Is(x, Py_False())
+}
+
+// skipped Py_RETURN_TRUE
+// skipped Py_RETURN_FALSE
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyBool_FromLong")]
+    pub fn PyBool_FromLong(arg1: c_long) -> *mut PyObject;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/bytearrayobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/bytearrayobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/bytearrayobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/bytearrayobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,54 @@
+use crate::object::*;
+use crate::pyport::Py_ssize_t;
+use std::os::raw::{c_char, c_int};
+use std::ptr::addr_of_mut;
+
+#[cfg(not(any(PyPy, GraalPy, Py_LIMITED_API)))]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyByteArrayObject {
+    pub ob_base: PyVarObject,
+    pub ob_alloc: Py_ssize_t,
+    pub ob_bytes: *mut c_char,
+    pub ob_start: *mut c_char,
+    #[cfg(Py_3_9)]
+    pub ob_exports: Py_ssize_t,
+    #[cfg(not(Py_3_9))]
+    pub ob_exports: c_int,
+}
+
+#[cfg(any(PyPy, GraalPy, Py_LIMITED_API))]
+opaque_struct!(PyByteArrayObject);
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyByteArray_Type")]
+    pub static mut PyByteArray_Type: PyTypeObject;
+
+    pub static mut PyByteArrayIter_Type: PyTypeObject;
+}
+
+#[inline]
+pub unsafe fn PyByteArray_Check(op: *mut PyObject) -> c_int {
+    PyObject_TypeCheck(op, addr_of_mut!(PyByteArray_Type))
+}
+
+#[inline]
+pub unsafe fn PyByteArray_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyByteArray_Type)) as c_int
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyByteArray_FromObject")]
+    pub fn PyByteArray_FromObject(o: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyByteArray_Concat")]
+    pub fn PyByteArray_Concat(a: *mut PyObject, b: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyByteArray_FromStringAndSize")]
+    pub fn PyByteArray_FromStringAndSize(string: *const c_char, len: Py_ssize_t) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyByteArray_Size")]
+    pub fn PyByteArray_Size(bytearray: *mut PyObject) -> Py_ssize_t;
+    #[cfg_attr(PyPy, link_name = "PyPyByteArray_AsString")]
+    pub fn PyByteArray_AsString(bytearray: *mut PyObject) -> *mut c_char;
+    #[cfg_attr(PyPy, link_name = "PyPyByteArray_Resize")]
+    pub fn PyByteArray_Resize(bytearray: *mut PyObject, len: Py_ssize_t) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/bytesobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/bytesobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/bytesobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/bytesobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,63 @@
+use crate::object::*;
+use crate::pyport::Py_ssize_t;
+use std::os::raw::{c_char, c_int};
+use std::ptr::addr_of_mut;
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyBytes_Type")]
+    pub static mut PyBytes_Type: PyTypeObject;
+    pub static mut PyBytesIter_Type: PyTypeObject;
+}
+
+#[inline]
+pub unsafe fn PyBytes_Check(op: *mut PyObject) -> c_int {
+    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_BYTES_SUBCLASS)
+}
+
+#[inline]
+pub unsafe fn PyBytes_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyBytes_Type)) as c_int
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyBytes_FromStringAndSize")]
+    pub fn PyBytes_FromStringAndSize(arg1: *const c_char, arg2: Py_ssize_t) -> *mut PyObject;
+    pub fn PyBytes_FromString(arg1: *const c_char) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyBytes_FromObject")]
+    pub fn PyBytes_FromObject(arg1: *mut PyObject) -> *mut PyObject;
+    // skipped PyBytes_FromFormatV
+    //#[cfg_attr(PyPy, link_name = "PyPyBytes_FromFormatV")]
+    //pub fn PyBytes_FromFormatV(arg1: *const c_char, arg2: va_list)
+    // -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyBytes_FromFormat")]
+    pub fn PyBytes_FromFormat(arg1: *const c_char, ...) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyBytes_Size")]
+    pub fn PyBytes_Size(arg1: *mut PyObject) -> Py_ssize_t;
+    #[cfg_attr(PyPy, link_name = "PyPyBytes_AsString")]
+    pub fn PyBytes_AsString(arg1: *mut PyObject) -> *mut c_char;
+    pub fn PyBytes_Repr(arg1: *mut PyObject, arg2: c_int) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyBytes_Concat")]
+    pub fn PyBytes_Concat(arg1: *mut *mut PyObject, arg2: *mut PyObject);
+    #[cfg_attr(PyPy, link_name = "PyPyBytes_ConcatAndDel")]
+    pub fn PyBytes_ConcatAndDel(arg1: *mut *mut PyObject, arg2: *mut PyObject);
+    pub fn PyBytes_DecodeEscape(
+        arg1: *const c_char,
+        arg2: Py_ssize_t,
+        arg3: *const c_char,
+        arg4: Py_ssize_t,
+        arg5: *const c_char,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyBytes_AsStringAndSize")]
+    pub fn PyBytes_AsStringAndSize(
+        obj: *mut PyObject,
+        s: *mut *mut c_char,
+        len: *mut Py_ssize_t,
+    ) -> c_int;
+}
+
+// skipped F_LJUST
+// skipped F_SIGN
+// skipped F_BLANK
+// skipped F_ALT
+// skipped F_ZERO
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/ceval.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/ceval.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/ceval.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/ceval.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,122 @@
+use crate::object::PyObject;
+use crate::pystate::PyThreadState;
+use std::os::raw::{c_char, c_int, c_void};
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyEval_EvalCode")]
+    pub fn PyEval_EvalCode(
+        arg1: *mut PyObject,
+        arg2: *mut PyObject,
+        arg3: *mut PyObject,
+    ) -> *mut PyObject;
+
+    pub fn PyEval_EvalCodeEx(
+        co: *mut PyObject,
+        globals: *mut PyObject,
+        locals: *mut PyObject,
+        args: *const *mut PyObject,
+        argc: c_int,
+        kwds: *const *mut PyObject,
+        kwdc: c_int,
+        defs: *const *mut PyObject,
+        defc: c_int,
+        kwdefs: *mut PyObject,
+        closure: *mut PyObject,
+    ) -> *mut PyObject;
+
+    #[cfg_attr(Py_3_9, deprecated(note = "Python 3.9"))]
+    #[cfg_attr(PyPy, link_name = "PyPyEval_CallObjectWithKeywords")]
+    pub fn PyEval_CallObjectWithKeywords(
+        func: *mut PyObject,
+        obj: *mut PyObject,
+        kwargs: *mut PyObject,
+    ) -> *mut PyObject;
+}
+
+#[cfg_attr(Py_3_9, deprecated(note = "Python 3.9"))]
+#[inline]
+pub unsafe fn PyEval_CallObject(func: *mut PyObject, arg: *mut PyObject) -> *mut PyObject {
+    #[allow(deprecated)]
+    PyEval_CallObjectWithKeywords(func, arg, std::ptr::null_mut())
+}
+
+extern "C" {
+    #[cfg_attr(Py_3_9, deprecated(note = "Python 3.9"))]
+    #[cfg_attr(PyPy, link_name = "PyPyEval_CallFunction")]
+    pub fn PyEval_CallFunction(obj: *mut PyObject, format: *const c_char, ...) -> *mut PyObject;
+    #[cfg_attr(Py_3_9, deprecated(note = "Python 3.9"))]
+    #[cfg_attr(PyPy, link_name = "PyPyEval_CallMethod")]
+    pub fn PyEval_CallMethod(
+        obj: *mut PyObject,
+        methodname: *const c_char,
+        format: *const c_char,
+        ...
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyEval_GetBuiltins")]
+    pub fn PyEval_GetBuiltins() -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyEval_GetGlobals")]
+    pub fn PyEval_GetGlobals() -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyEval_GetLocals")]
+    pub fn PyEval_GetLocals() -> *mut PyObject;
+    pub fn PyEval_GetFrame() -> *mut crate::PyFrameObject;
+    #[cfg_attr(PyPy, link_name = "PyPy_AddPendingCall")]
+    pub fn Py_AddPendingCall(
+        func: Option<extern "C" fn(arg1: *mut c_void) -> c_int>,
+        arg: *mut c_void,
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPy_MakePendingCalls")]
+    pub fn Py_MakePendingCalls() -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPy_SetRecursionLimit")]
+    pub fn Py_SetRecursionLimit(arg1: c_int);
+    #[cfg_attr(PyPy, link_name = "PyPy_GetRecursionLimit")]
+    pub fn Py_GetRecursionLimit() -> c_int;
+    fn _Py_CheckRecursiveCall(_where: *mut c_char) -> c_int;
+}
+
+extern "C" {
+    #[cfg(Py_3_9)]
+    #[cfg_attr(PyPy, link_name = "PyPy_EnterRecursiveCall")]
+    pub fn Py_EnterRecursiveCall(arg1: *const c_char) -> c_int;
+    #[cfg(Py_3_9)]
+    #[cfg_attr(PyPy, link_name = "PyPy_LeaveRecursiveCall")]
+    pub fn Py_LeaveRecursiveCall();
+}
+
+extern "C" {
+    pub fn PyEval_GetFuncName(arg1: *mut PyObject) -> *const c_char;
+    pub fn PyEval_GetFuncDesc(arg1: *mut PyObject) -> *const c_char;
+    pub fn PyEval_GetCallStats(arg1: *mut PyObject) -> *mut PyObject;
+    pub fn PyEval_EvalFrame(arg1: *mut crate::PyFrameObject) -> *mut PyObject;
+    pub fn PyEval_EvalFrameEx(f: *mut crate::PyFrameObject, exc: c_int) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyEval_SaveThread")]
+    pub fn PyEval_SaveThread() -> *mut PyThreadState;
+    #[cfg_attr(PyPy, link_name = "PyPyEval_RestoreThread")]
+    pub fn PyEval_RestoreThread(arg1: *mut PyThreadState);
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyEval_ThreadsInitialized")]
+    pub fn PyEval_ThreadsInitialized() -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyEval_InitThreads")]
+    pub fn PyEval_InitThreads();
+    pub fn PyEval_AcquireLock();
+    pub fn PyEval_ReleaseLock();
+    #[cfg_attr(PyPy, link_name = "PyPyEval_AcquireThread")]
+    pub fn PyEval_AcquireThread(tstate: *mut PyThreadState);
+    #[cfg_attr(PyPy, link_name = "PyPyEval_ReleaseThread")]
+    pub fn PyEval_ReleaseThread(tstate: *mut PyThreadState);
+    #[cfg(not(Py_3_8))]
+    pub fn PyEval_ReInitThreads();
+}
+
+// skipped Py_BEGIN_ALLOW_THREADS
+// skipped Py_BLOCK_THREADS
+// skipped Py_UNBLOCK_THREADS
+// skipped Py_END_ALLOW_THREADS
+// skipped FVC_MASK
+// skipped FVC_NONE
+// skipped FVC_STR
+// skipped FVC_REPR
+// skipped FVC_ASCII
+// skipped FVS_MASK
+// skipped FVS_HAVE_SPEC
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/code.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/code.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/code.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/code.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4 @@
+// This header doesn't exist in CPython, but Include/cpython/code.h does. We add
+// this here so that PyCodeObject has a definition under the limited API.
+
+opaque_struct!(PyCodeObject);
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/codecs.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/codecs.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/codecs.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/codecs.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,58 @@
+use crate::object::PyObject;
+use std::os::raw::{c_char, c_int};
+
+extern "C" {
+    pub fn PyCodec_Register(search_function: *mut PyObject) -> c_int;
+    #[cfg(Py_3_10)]
+    #[cfg(not(PyPy))]
+    pub fn PyCodec_Unregister(search_function: *mut PyObject) -> c_int;
+    // skipped non-limited _PyCodec_Lookup from Include/codecs.h
+    // skipped non-limited _PyCodec_Forget from Include/codecs.h
+    pub fn PyCodec_KnownEncoding(encoding: *const c_char) -> c_int;
+    pub fn PyCodec_Encode(
+        object: *mut PyObject,
+        encoding: *const c_char,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    pub fn PyCodec_Decode(
+        object: *mut PyObject,
+        encoding: *const c_char,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    // skipped non-limited _PyCodec_LookupTextEncoding from Include/codecs.h
+    // skipped non-limited _PyCodec_EncodeText from Include/codecs.h
+    // skipped non-limited _PyCodec_DecodeText from Include/codecs.h
+    // skipped non-limited _PyCodecInfo_GetIncrementalDecoder from Include/codecs.h
+    // skipped non-limited _PyCodecInfo_GetIncrementalEncoder from Include/codecs.h
+    pub fn PyCodec_Encoder(encoding: *const c_char) -> *mut PyObject;
+    pub fn PyCodec_Decoder(encoding: *const c_char) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyCodec_IncrementalEncoder")]
+    pub fn PyCodec_IncrementalEncoder(
+        encoding: *const c_char,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyCodec_IncrementalDecoder")]
+    pub fn PyCodec_IncrementalDecoder(
+        encoding: *const c_char,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    pub fn PyCodec_StreamReader(
+        encoding: *const c_char,
+        stream: *mut PyObject,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    pub fn PyCodec_StreamWriter(
+        encoding: *const c_char,
+        stream: *mut PyObject,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    pub fn PyCodec_RegisterError(name: *const c_char, error: *mut PyObject) -> c_int;
+    pub fn PyCodec_LookupError(name: *const c_char) -> *mut PyObject;
+    pub fn PyCodec_StrictErrors(exc: *mut PyObject) -> *mut PyObject;
+    pub fn PyCodec_IgnoreErrors(exc: *mut PyObject) -> *mut PyObject;
+    pub fn PyCodec_ReplaceErrors(exc: *mut PyObject) -> *mut PyObject;
+    pub fn PyCodec_XMLCharRefReplaceErrors(exc: *mut PyObject) -> *mut PyObject;
+    pub fn PyCodec_BackslashReplaceErrors(exc: *mut PyObject) -> *mut PyObject;
+    // skipped non-limited PyCodec_NameReplaceErrors from Include/codecs.h
+    // skipped non-limited Py_hexdigits from Include/codecs.h
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/compile.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/compile.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/compile.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/compile.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,10 @@
+use std::os::raw::c_int;
+
+pub const Py_single_input: c_int = 256;
+pub const Py_file_input: c_int = 257;
+pub const Py_eval_input: c_int = 258;
+#[cfg(Py_3_8)]
+pub const Py_func_type_input: c_int = 345;
+
+#[cfg(Py_3_9)]
+pub const Py_fstring_input: c_int = 800;
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/complexobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/complexobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/complexobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/complexobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,63 @@
+use crate::object::*;
+use std::os::raw::{c_double, c_int};
+use std::ptr::addr_of_mut;
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+// non-limited
+pub struct Py_complex {
+    pub real: c_double,
+    pub imag: c_double,
+}
+
+#[cfg(not(Py_LIMITED_API))]
+extern "C" {
+    pub fn _Py_c_sum(left: Py_complex, right: Py_complex) -> Py_complex;
+    pub fn _Py_c_diff(left: Py_complex, right: Py_complex) -> Py_complex;
+    pub fn _Py_c_neg(complex: Py_complex) -> Py_complex;
+    pub fn _Py_c_prod(left: Py_complex, right: Py_complex) -> Py_complex;
+    pub fn _Py_c_quot(dividend: Py_complex, divisor: Py_complex) -> Py_complex;
+    pub fn _Py_c_pow(num: Py_complex, exp: Py_complex) -> Py_complex;
+    pub fn _Py_c_abs(arg: Py_complex) -> c_double;
+    #[cfg_attr(PyPy, link_name = "PyPyComplex_FromCComplex")]
+    pub fn PyComplex_FromCComplex(v: Py_complex) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyComplex_AsCComplex")]
+    pub fn PyComplex_AsCComplex(op: *mut PyObject) -> Py_complex;
+}
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+// non-limited
+pub struct PyComplexObject {
+    pub ob_base: PyObject,
+    #[cfg(not(GraalPy))]
+    pub cval: Py_complex,
+}
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyComplex_Type")]
+    pub static mut PyComplex_Type: PyTypeObject;
+}
+
+#[inline]
+pub unsafe fn PyComplex_Check(op: *mut PyObject) -> c_int {
+    PyObject_TypeCheck(op, addr_of_mut!(PyComplex_Type))
+}
+
+#[inline]
+pub unsafe fn PyComplex_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyComplex_Type)) as c_int
+}
+
+extern "C" {
+    // skipped non-limited PyComplex_FromCComplex
+    #[cfg_attr(PyPy, link_name = "PyPyComplex_FromDoubles")]
+    pub fn PyComplex_FromDoubles(real: c_double, imag: c_double) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyComplex_RealAsDouble")]
+    pub fn PyComplex_RealAsDouble(op: *mut PyObject) -> c_double;
+    #[cfg_attr(PyPy, link_name = "PyPyComplex_ImagAsDouble")]
+    pub fn PyComplex_ImagAsDouble(op: *mut PyObject) -> c_double;
+    // skipped non-limited PyComplex_AsCComplex
+    // skipped non-limited _PyComplex_FormatAdvancedWriter
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/context.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/context.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/context.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/context.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,46 @@
+use crate::object::{PyObject, PyTypeObject, Py_TYPE};
+use std::os::raw::{c_char, c_int};
+use std::ptr::addr_of_mut;
+
+extern "C" {
+    pub static mut PyContext_Type: PyTypeObject;
+    // skipped non-limited opaque PyContext
+    pub static mut PyContextVar_Type: PyTypeObject;
+    // skipped non-limited opaque PyContextVar
+    pub static mut PyContextToken_Type: PyTypeObject;
+    // skipped non-limited opaque PyContextToken
+}
+
+#[inline]
+pub unsafe fn PyContext_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyContext_Type)) as c_int
+}
+
+#[inline]
+pub unsafe fn PyContextVar_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyContextVar_Type)) as c_int
+}
+
+#[inline]
+pub unsafe fn PyContextToken_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyContextToken_Type)) as c_int
+}
+
+extern "C" {
+    pub fn PyContext_New() -> *mut PyObject;
+    pub fn PyContext_Copy(ctx: *mut PyObject) -> *mut PyObject;
+    pub fn PyContext_CopyCurrent() -> *mut PyObject;
+
+    pub fn PyContext_Enter(ctx: *mut PyObject) -> c_int;
+    pub fn PyContext_Exit(ctx: *mut PyObject) -> c_int;
+
+    pub fn PyContextVar_New(name: *const c_char, def: *mut PyObject) -> *mut PyObject;
+    pub fn PyContextVar_Get(
+        var: *mut PyObject,
+        default_value: *mut PyObject,
+        value: *mut *mut PyObject,
+    ) -> c_int;
+    pub fn PyContextVar_Set(var: *mut PyObject, value: *mut PyObject) -> *mut PyObject;
+    pub fn PyContextVar_Reset(var: *mut PyObject, token: *mut PyObject) -> c_int;
+    // skipped non-limited _PyContext_NewHamtForTests
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/abstract_.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/abstract_.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/abstract_.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/abstract_.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,332 @@
+use crate::{PyObject, Py_ssize_t};
+use std::os::raw::{c_char, c_int};
+
+#[cfg(not(Py_3_11))]
+use crate::Py_buffer;
+
+#[cfg(all(Py_3_8, not(any(PyPy, GraalPy))))]
+use crate::{
+    vectorcallfunc, PyCallable_Check, PyThreadState, PyThreadState_GET, PyTuple_Check,
+    PyType_HasFeature, Py_TPFLAGS_HAVE_VECTORCALL,
+};
+#[cfg(Py_3_8)]
+use libc::size_t;
+
+extern "C" {
+    #[cfg(all(Py_3_8, not(any(PyPy, GraalPy))))]
+    pub fn _PyStack_AsDict(values: *const *mut PyObject, kwnames: *mut PyObject) -> *mut PyObject;
+}
+
+#[cfg(all(Py_3_8, not(any(PyPy, GraalPy))))]
+const _PY_FASTCALL_SMALL_STACK: size_t = 5;
+
+extern "C" {
+    #[cfg(all(Py_3_8, not(any(PyPy, GraalPy))))]
+    pub fn _Py_CheckFunctionResult(
+        tstate: *mut PyThreadState,
+        callable: *mut PyObject,
+        result: *mut PyObject,
+        where_: *const c_char,
+    ) -> *mut PyObject;
+
+    #[cfg(all(Py_3_8, not(any(PyPy, GraalPy))))]
+    pub fn _PyObject_MakeTpCall(
+        tstate: *mut PyThreadState,
+        callable: *mut PyObject,
+        args: *const *mut PyObject,
+        nargs: Py_ssize_t,
+        keywords: *mut PyObject,
+    ) -> *mut PyObject;
+}
+
+#[cfg(Py_3_8)]
+const PY_VECTORCALL_ARGUMENTS_OFFSET: size_t =
+    1 << (8 * std::mem::size_of::<size_t>() as size_t - 1);
+
+#[cfg(Py_3_8)]
+#[inline(always)]
+pub unsafe fn PyVectorcall_NARGS(n: size_t) -> Py_ssize_t {
+    let n = n & !PY_VECTORCALL_ARGUMENTS_OFFSET;
+    n.try_into().expect("cannot fail due to mask")
+}
+
+#[cfg(all(Py_3_8, not(any(PyPy, GraalPy))))]
+#[inline(always)]
+pub unsafe fn PyVectorcall_Function(callable: *mut PyObject) -> Option<vectorcallfunc> {
+    assert!(!callable.is_null());
+    let tp = crate::Py_TYPE(callable);
+    if PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL) == 0 {
+        return None;
+    }
+    assert!(PyCallable_Check(callable) > 0);
+    let offset = (*tp).tp_vectorcall_offset;
+    assert!(offset > 0);
+    let ptr = callable.cast::<c_char>().offset(offset).cast();
+    *ptr
+}
+
+#[cfg(all(Py_3_8, not(any(PyPy, GraalPy))))]
+#[inline(always)]
+pub unsafe fn _PyObject_VectorcallTstate(
+    tstate: *mut PyThreadState,
+    callable: *mut PyObject,
+    args: *const *mut PyObject,
+    nargsf: size_t,
+    kwnames: *mut PyObject,
+) -> *mut PyObject {
+    assert!(kwnames.is_null() || PyTuple_Check(kwnames) > 0);
+    assert!(!args.is_null() || PyVectorcall_NARGS(nargsf) == 0);
+
+    match PyVectorcall_Function(callable) {
+        None => {
+            let nargs = PyVectorcall_NARGS(nargsf);
+            _PyObject_MakeTpCall(tstate, callable, args, nargs, kwnames)
+        }
+        Some(func) => {
+            let res = func(callable, args, nargsf, kwnames);
+            _Py_CheckFunctionResult(tstate, callable, res, std::ptr::null_mut())
+        }
+    }
+}
+
+#[cfg(all(Py_3_8, not(any(PyPy, GraalPy))))]
+#[inline(always)]
+pub unsafe fn PyObject_Vectorcall(
+    callable: *mut PyObject,
+    args: *const *mut PyObject,
+    nargsf: size_t,
+    kwnames: *mut PyObject,
+) -> *mut PyObject {
+    _PyObject_VectorcallTstate(PyThreadState_GET(), callable, args, nargsf, kwnames)
+}
+
+extern "C" {
+    #[cfg(all(PyPy, Py_3_8))]
+    #[cfg_attr(not(Py_3_9), link_name = "_PyPyObject_Vectorcall")]
+    #[cfg_attr(Py_3_9, link_name = "PyPyObject_Vectorcall")]
+    pub fn PyObject_Vectorcall(
+        callable: *mut PyObject,
+        args: *const *mut PyObject,
+        nargsf: size_t,
+        kwnames: *mut PyObject,
+    ) -> *mut PyObject;
+
+    #[cfg(Py_3_8)]
+    #[cfg_attr(
+        all(not(any(PyPy, GraalPy)), not(Py_3_9)),
+        link_name = "_PyObject_VectorcallDict"
+    )]
+    #[cfg_attr(all(PyPy, not(Py_3_9)), link_name = "_PyPyObject_VectorcallDict")]
+    #[cfg_attr(all(PyPy, Py_3_9), link_name = "PyPyObject_VectorcallDict")]
+    pub fn PyObject_VectorcallDict(
+        callable: *mut PyObject,
+        args: *const *mut PyObject,
+        nargsf: size_t,
+        kwdict: *mut PyObject,
+    ) -> *mut PyObject;
+
+    #[cfg(Py_3_8)]
+    #[cfg_attr(not(any(Py_3_9, PyPy)), link_name = "_PyVectorcall_Call")]
+    #[cfg_attr(PyPy, link_name = "PyPyVectorcall_Call")]
+    pub fn PyVectorcall_Call(
+        callable: *mut PyObject,
+        tuple: *mut PyObject,
+        dict: *mut PyObject,
+    ) -> *mut PyObject;
+}
+
+#[cfg(all(Py_3_8, not(any(PyPy, GraalPy))))]
+#[inline(always)]
+pub unsafe fn _PyObject_FastCallTstate(
+    tstate: *mut PyThreadState,
+    func: *mut PyObject,
+    args: *const *mut PyObject,
+    nargs: Py_ssize_t,
+) -> *mut PyObject {
+    _PyObject_VectorcallTstate(tstate, func, args, nargs as size_t, std::ptr::null_mut())
+}
+
+#[cfg(all(Py_3_8, not(any(PyPy, GraalPy))))]
+#[inline(always)]
+pub unsafe fn _PyObject_FastCall(
+    func: *mut PyObject,
+    args: *const *mut PyObject,
+    nargs: Py_ssize_t,
+) -> *mut PyObject {
+    _PyObject_FastCallTstate(PyThreadState_GET(), func, args, nargs)
+}
+
+#[cfg(all(Py_3_8, not(any(PyPy, GraalPy))))]
+#[inline(always)]
+pub unsafe fn _PyObject_CallNoArg(func: *mut PyObject) -> *mut PyObject {
+    _PyObject_VectorcallTstate(
+        PyThreadState_GET(),
+        func,
+        std::ptr::null_mut(),
+        0,
+        std::ptr::null_mut(),
+    )
+}
+
+extern "C" {
+    #[cfg(PyPy)]
+    #[link_name = "_PyPyObject_CallNoArg"]
+    pub fn _PyObject_CallNoArg(func: *mut PyObject) -> *mut PyObject;
+}
+
+#[cfg(all(Py_3_8, not(any(PyPy, GraalPy))))]
+#[inline(always)]
+pub unsafe fn PyObject_CallOneArg(func: *mut PyObject, arg: *mut PyObject) -> *mut PyObject {
+    assert!(!arg.is_null());
+    let args_array = [std::ptr::null_mut(), arg];
+    let args = args_array.as_ptr().offset(1); // For PY_VECTORCALL_ARGUMENTS_OFFSET
+    let tstate = PyThreadState_GET();
+    let nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET;
+    _PyObject_VectorcallTstate(tstate, func, args, nargsf, std::ptr::null_mut())
+}
+
+extern "C" {
+    #[cfg(all(Py_3_9, not(any(PyPy, GraalPy))))]
+    pub fn PyObject_VectorcallMethod(
+        name: *mut PyObject,
+        args: *const *mut PyObject,
+        nargsf: size_t,
+        kwnames: *mut PyObject,
+    ) -> *mut PyObject;
+}
+
+#[cfg(all(Py_3_9, not(any(PyPy, GraalPy))))]
+#[inline(always)]
+pub unsafe fn PyObject_CallMethodNoArgs(
+    self_: *mut PyObject,
+    name: *mut PyObject,
+) -> *mut PyObject {
+    PyObject_VectorcallMethod(
+        name,
+        &self_,
+        1 | PY_VECTORCALL_ARGUMENTS_OFFSET,
+        std::ptr::null_mut(),
+    )
+}
+
+#[cfg(all(Py_3_9, not(any(PyPy, GraalPy))))]
+#[inline(always)]
+pub unsafe fn PyObject_CallMethodOneArg(
+    self_: *mut PyObject,
+    name: *mut PyObject,
+    arg: *mut PyObject,
+) -> *mut PyObject {
+    let args = [self_, arg];
+    assert!(!arg.is_null());
+    PyObject_VectorcallMethod(
+        name,
+        args.as_ptr(),
+        2 | PY_VECTORCALL_ARGUMENTS_OFFSET,
+        std::ptr::null_mut(),
+    )
+}
+
+// skipped _PyObject_VectorcallMethodId
+// skipped _PyObject_CallMethodIdNoArgs
+// skipped _PyObject_CallMethodIdOneArg
+
+// skipped _PyObject_HasLen
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyObject_LengthHint")]
+    pub fn PyObject_LengthHint(o: *mut PyObject, arg1: Py_ssize_t) -> Py_ssize_t;
+
+    #[cfg(not(Py_3_11))] // moved to src/buffer.rs from 3.11
+    #[cfg(all(Py_3_9, not(any(PyPy, GraalPy))))]
+    pub fn PyObject_CheckBuffer(obj: *mut PyObject) -> c_int;
+}
+
+#[cfg(not(any(Py_3_9, PyPy)))]
+#[inline]
+pub unsafe fn PyObject_CheckBuffer(o: *mut PyObject) -> c_int {
+    let tp_as_buffer = (*crate::Py_TYPE(o)).tp_as_buffer;
+    (!tp_as_buffer.is_null() && (*tp_as_buffer).bf_getbuffer.is_some()) as c_int
+}
+
+#[cfg(not(Py_3_11))] // moved to src/buffer.rs from 3.11
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyObject_GetBuffer")]
+    pub fn PyObject_GetBuffer(obj: *mut PyObject, view: *mut Py_buffer, flags: c_int) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyBuffer_GetPointer")]
+    pub fn PyBuffer_GetPointer(
+        view: *mut Py_buffer,
+        indices: *mut Py_ssize_t,
+    ) -> *mut std::os::raw::c_void;
+    #[cfg_attr(PyPy, link_name = "PyPyBuffer_SizeFromFormat")]
+    pub fn PyBuffer_SizeFromFormat(format: *const c_char) -> Py_ssize_t;
+    #[cfg_attr(PyPy, link_name = "PyPyBuffer_ToContiguous")]
+    pub fn PyBuffer_ToContiguous(
+        buf: *mut std::os::raw::c_void,
+        view: *mut Py_buffer,
+        len: Py_ssize_t,
+        order: c_char,
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyBuffer_FromContiguous")]
+    pub fn PyBuffer_FromContiguous(
+        view: *mut Py_buffer,
+        buf: *mut std::os::raw::c_void,
+        len: Py_ssize_t,
+        order: c_char,
+    ) -> c_int;
+    pub fn PyObject_CopyData(dest: *mut PyObject, src: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyBuffer_IsContiguous")]
+    pub fn PyBuffer_IsContiguous(view: *const Py_buffer, fort: c_char) -> c_int;
+    pub fn PyBuffer_FillContiguousStrides(
+        ndims: c_int,
+        shape: *mut Py_ssize_t,
+        strides: *mut Py_ssize_t,
+        itemsize: c_int,
+        fort: c_char,
+    );
+    #[cfg_attr(PyPy, link_name = "PyPyBuffer_FillInfo")]
+    pub fn PyBuffer_FillInfo(
+        view: *mut Py_buffer,
+        o: *mut PyObject,
+        buf: *mut std::os::raw::c_void,
+        len: Py_ssize_t,
+        readonly: c_int,
+        flags: c_int,
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyBuffer_Release")]
+    pub fn PyBuffer_Release(view: *mut Py_buffer);
+}
+
+// PyIter_Check defined in ffi/abstract_.rs
+// PyIndex_Check defined in ffi/abstract_.rs
+// Not defined here because this file is not compiled under the
+// limited API, but the macros need to be defined for 3.6, 3.7 which
+// predate the limited API changes.
+
+// skipped PySequence_ITEM
+
+pub const PY_ITERSEARCH_COUNT: c_int = 1;
+pub const PY_ITERSEARCH_INDEX: c_int = 2;
+pub const PY_ITERSEARCH_CONTAINS: c_int = 3;
+
+extern "C" {
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn _PySequence_IterSearch(
+        seq: *mut PyObject,
+        obj: *mut PyObject,
+        operation: c_int,
+    ) -> Py_ssize_t;
+}
+
+// skipped _PyObject_RealIsInstance
+// skipped _PyObject_RealIsSubclass
+
+// skipped _PySequence_BytesToCharpArray
+
+// skipped _Py_FreeCharPArray
+
+// skipped _Py_add_one_to_index_F
+// skipped _Py_add_one_to_index_C
+
+// skipped _Py_convert_optional_to_ssize_t
+
+// skipped _PyNumber_Index(*mut PyObject o)
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/bytesobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/bytesobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/bytesobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/bytesobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,22 @@
+use crate::object::*;
+use crate::Py_ssize_t;
+#[cfg(not(any(PyPy, GraalPy, Py_LIMITED_API)))]
+use std::os::raw::c_char;
+use std::os::raw::c_int;
+
+#[cfg(not(any(PyPy, GraalPy, Py_LIMITED_API)))]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyBytesObject {
+    pub ob_base: PyVarObject,
+    pub ob_shash: crate::Py_hash_t,
+    pub ob_sval: [c_char; 1],
+}
+
+#[cfg(any(PyPy, GraalPy, Py_LIMITED_API))]
+opaque_struct!(PyBytesObject);
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "_PyPyBytes_Resize")]
+    pub fn _PyBytes_Resize(bytes: *mut *mut PyObject, newsize: Py_ssize_t) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/ceval.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/ceval.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/ceval.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/ceval.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,21 @@
+use crate::cpython::pystate::Py_tracefunc;
+use crate::object::{freefunc, PyObject};
+use std::os::raw::c_int;
+
+extern "C" {
+    // skipped non-limited _PyEval_CallTracing
+
+    #[cfg(not(Py_3_11))]
+    pub fn _PyEval_EvalFrameDefault(arg1: *mut crate::PyFrameObject, exc: c_int) -> *mut PyObject;
+
+    #[cfg(Py_3_11)]
+    pub fn _PyEval_EvalFrameDefault(
+        tstate: *mut crate::PyThreadState,
+        frame: *mut crate::_PyInterpreterFrame,
+        exc: c_int,
+    ) -> *mut crate::PyObject;
+
+    pub fn _PyEval_RequestCodeExtraIndex(func: freefunc) -> c_int;
+    pub fn PyEval_SetProfile(trace_func: Option<Py_tracefunc>, arg1: *mut PyObject);
+    pub fn PyEval_SetTrace(trace_func: Option<Py_tracefunc>, arg1: *mut PyObject);
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/code.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/code.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/code.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/code.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,340 @@
+use crate::object::*;
+use crate::pyport::Py_ssize_t;
+
+#[allow(unused_imports)]
+use std::os::raw::{c_char, c_int, c_short, c_uchar, c_void};
+#[cfg(not(any(PyPy, GraalPy)))]
+use std::ptr::addr_of_mut;
+
+#[cfg(all(Py_3_8, not(any(PyPy, GraalPy)), not(Py_3_11)))]
+opaque_struct!(_PyOpcache);
+
+#[cfg(Py_3_12)]
+pub const _PY_MONITORING_LOCAL_EVENTS: usize = 10;
+#[cfg(Py_3_12)]
+pub const _PY_MONITORING_UNGROUPED_EVENTS: usize = 15;
+#[cfg(Py_3_12)]
+pub const _PY_MONITORING_EVENTS: usize = 17;
+
+#[cfg(Py_3_12)]
+#[repr(C)]
+#[derive(Clone, Copy)]
+pub struct _Py_LocalMonitors {
+    pub tools: [u8; if cfg!(Py_3_13) {
+        _PY_MONITORING_LOCAL_EVENTS
+    } else {
+        _PY_MONITORING_UNGROUPED_EVENTS
+    }],
+}
+
+#[cfg(Py_3_12)]
+#[repr(C)]
+#[derive(Clone, Copy)]
+pub struct _Py_GlobalMonitors {
+    pub tools: [u8; _PY_MONITORING_UNGROUPED_EVENTS],
+}
+
+// skipped _Py_CODEUNIT
+
+// skipped _Py_OPCODE
+// skipped _Py_OPARG
+
+// skipped _py_make_codeunit
+
+// skipped _py_set_opcode
+
+// skipped _Py_MAKE_CODEUNIT
+// skipped _Py_SET_OPCODE
+
+#[cfg(Py_3_12)]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct _PyCoCached {
+    pub _co_code: *mut PyObject,
+    pub _co_varnames: *mut PyObject,
+    pub _co_cellvars: *mut PyObject,
+    pub _co_freevars: *mut PyObject,
+}
+
+#[cfg(Py_3_12)]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct _PyCoLineInstrumentationData {
+    pub original_opcode: u8,
+    pub line_delta: i8,
+}
+
+#[cfg(Py_3_12)]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct _PyCoMonitoringData {
+    pub local_monitors: _Py_LocalMonitors,
+    pub active_monitors: _Py_LocalMonitors,
+    pub tools: *mut u8,
+    pub lines: *mut _PyCoLineInstrumentationData,
+    pub line_tools: *mut u8,
+    pub per_instruction_opcodes: *mut u8,
+    pub per_instruction_tools: *mut u8,
+}
+
+#[cfg(all(not(any(PyPy, GraalPy)), not(Py_3_7)))]
+opaque_struct!(PyCodeObject);
+
+#[cfg(all(not(any(PyPy, GraalPy)), Py_3_7, not(Py_3_8)))]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyCodeObject {
+    pub ob_base: PyObject,
+    pub co_argcount: c_int,
+    pub co_kwonlyargcount: c_int,
+    pub co_nlocals: c_int,
+    pub co_stacksize: c_int,
+    pub co_flags: c_int,
+    pub co_firstlineno: c_int,
+    pub co_code: *mut PyObject,
+    pub co_consts: *mut PyObject,
+    pub co_names: *mut PyObject,
+    pub co_varnames: *mut PyObject,
+    pub co_freevars: *mut PyObject,
+    pub co_cellvars: *mut PyObject,
+    pub co_cell2arg: *mut Py_ssize_t,
+    pub co_filename: *mut PyObject,
+    pub co_name: *mut PyObject,
+    pub co_lnotab: *mut PyObject,
+    pub co_zombieframe: *mut c_void,
+    pub co_weakreflist: *mut PyObject,
+    pub co_extra: *mut c_void,
+}
+
+#[cfg(Py_3_13)]
+opaque_struct!(_PyExecutorArray);
+
+#[cfg(all(not(any(PyPy, GraalPy)), Py_3_8, not(Py_3_11)))]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyCodeObject {
+    pub ob_base: PyObject,
+    pub co_argcount: c_int,
+    pub co_posonlyargcount: c_int,
+    pub co_kwonlyargcount: c_int,
+    pub co_nlocals: c_int,
+    pub co_stacksize: c_int,
+    pub co_flags: c_int,
+    pub co_firstlineno: c_int,
+    pub co_code: *mut PyObject,
+    pub co_consts: *mut PyObject,
+    pub co_names: *mut PyObject,
+    pub co_varnames: *mut PyObject,
+    pub co_freevars: *mut PyObject,
+    pub co_cellvars: *mut PyObject,
+    pub co_cell2arg: *mut Py_ssize_t,
+    pub co_filename: *mut PyObject,
+    pub co_name: *mut PyObject,
+    #[cfg(not(Py_3_10))]
+    pub co_lnotab: *mut PyObject,
+    #[cfg(Py_3_10)]
+    pub co_linetable: *mut PyObject,
+    pub co_zombieframe: *mut c_void,
+    pub co_weakreflist: *mut PyObject,
+    pub co_extra: *mut c_void,
+    pub co_opcache_map: *mut c_uchar,
+    pub co_opcache: *mut _PyOpcache,
+    pub co_opcache_flag: c_int,
+    pub co_opcache_size: c_uchar,
+}
+
+#[cfg(all(not(any(PyPy, GraalPy)), Py_3_11))]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyCodeObject {
+    pub ob_base: PyVarObject,
+    pub co_consts: *mut PyObject,
+    pub co_names: *mut PyObject,
+    pub co_exceptiontable: *mut PyObject,
+    pub co_flags: c_int,
+    #[cfg(not(Py_3_12))]
+    pub co_warmup: c_int,
+
+    pub co_argcount: c_int,
+    pub co_posonlyargcount: c_int,
+    pub co_kwonlyargcount: c_int,
+    pub co_stacksize: c_int,
+    pub co_firstlineno: c_int,
+
+    pub co_nlocalsplus: c_int,
+    #[cfg(Py_3_12)]
+    pub co_framesize: c_int,
+    pub co_nlocals: c_int,
+    #[cfg(not(Py_3_12))]
+    pub co_nplaincellvars: c_int,
+    pub co_ncellvars: c_int,
+    pub co_nfreevars: c_int,
+    #[cfg(Py_3_12)]
+    pub co_version: u32,
+
+    pub co_localsplusnames: *mut PyObject,
+    pub co_localspluskinds: *mut PyObject,
+    pub co_filename: *mut PyObject,
+    pub co_name: *mut PyObject,
+    pub co_qualname: *mut PyObject,
+    pub co_linetable: *mut PyObject,
+    pub co_weakreflist: *mut PyObject,
+    #[cfg(not(Py_3_12))]
+    pub _co_code: *mut PyObject,
+    #[cfg(not(Py_3_12))]
+    pub _co_linearray: *mut c_char,
+    #[cfg(Py_3_13)]
+    pub co_executors: *mut _PyExecutorArray,
+    #[cfg(Py_3_12)]
+    pub _co_cached: *mut _PyCoCached,
+    #[cfg(Py_3_12)]
+    pub _co_instrumentation_version: u64,
+    #[cfg(Py_3_12)]
+    pub _co_monitoring: *mut _PyCoMonitoringData,
+    pub _co_firsttraceable: c_int,
+    pub co_extra: *mut c_void,
+    pub co_code_adaptive: [c_char; 1],
+}
+
+#[cfg(PyPy)]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyCodeObject {
+    pub ob_base: PyObject,
+    pub co_name: *mut PyObject,
+    pub co_filename: *mut PyObject,
+    pub co_argcount: c_int,
+    pub co_flags: c_int,
+}
+
+/* Masks for co_flags */
+pub const CO_OPTIMIZED: c_int = 0x0001;
+pub const CO_NEWLOCALS: c_int = 0x0002;
+pub const CO_VARARGS: c_int = 0x0004;
+pub const CO_VARKEYWORDS: c_int = 0x0008;
+pub const CO_NESTED: c_int = 0x0010;
+pub const CO_GENERATOR: c_int = 0x0020;
+/* The CO_NOFREE flag is set if there are no free or cell variables.
+   This information is redundant, but it allows a single flag test
+   to determine whether there is any extra work to be done when the
+   call frame it setup.
+*/
+pub const CO_NOFREE: c_int = 0x0040;
+/* The CO_COROUTINE flag is set for coroutine functions (defined with
+``async def`` keywords) */
+pub const CO_COROUTINE: c_int = 0x0080;
+pub const CO_ITERABLE_COROUTINE: c_int = 0x0100;
+pub const CO_ASYNC_GENERATOR: c_int = 0x0200;
+
+pub const CO_FUTURE_DIVISION: c_int = 0x2000;
+pub const CO_FUTURE_ABSOLUTE_IMPORT: c_int = 0x4000; /* do absolute imports by default */
+pub const CO_FUTURE_WITH_STATEMENT: c_int = 0x8000;
+pub const CO_FUTURE_PRINT_FUNCTION: c_int = 0x1_0000;
+pub const CO_FUTURE_UNICODE_LITERALS: c_int = 0x2_0000;
+
+pub const CO_FUTURE_BARRY_AS_BDFL: c_int = 0x4_0000;
+pub const CO_FUTURE_GENERATOR_STOP: c_int = 0x8_0000;
+// skipped CO_FUTURE_ANNOTATIONS
+// skipped CO_CELL_NOT_AN_ARG
+
+pub const CO_MAXBLOCKS: usize = 20;
+
+#[cfg(not(any(PyPy, GraalPy)))]
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    pub static mut PyCode_Type: PyTypeObject;
+}
+
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+pub unsafe fn PyCode_Check(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyCode_Type)) as c_int
+}
+
+#[inline]
+#[cfg(all(not(any(PyPy, GraalPy)), Py_3_10, not(Py_3_11)))]
+pub unsafe fn PyCode_GetNumFree(op: *mut PyCodeObject) -> Py_ssize_t {
+    crate::PyTuple_GET_SIZE((*op).co_freevars)
+}
+
+#[inline]
+#[cfg(all(not(Py_3_10), Py_3_11, not(any(PyPy, GraalPy))))]
+pub unsafe fn PyCode_GetNumFree(op: *mut PyCodeObject) -> c_int {
+    (*op).co_nfreevars
+}
+
+extern "C" {
+    #[cfg(PyPy)]
+    #[link_name = "PyPyCode_Check"]
+    pub fn PyCode_Check(op: *mut PyObject) -> c_int;
+
+    #[cfg(PyPy)]
+    #[link_name = "PyPyCode_GetNumFree"]
+    pub fn PyCode_GetNumFree(op: *mut PyCodeObject) -> Py_ssize_t;
+}
+
+extern "C" {
+    #[cfg(not(GraalPy))]
+    #[cfg_attr(PyPy, link_name = "PyPyCode_New")]
+    pub fn PyCode_New(
+        argcount: c_int,
+        kwonlyargcount: c_int,
+        nlocals: c_int,
+        stacksize: c_int,
+        flags: c_int,
+        code: *mut PyObject,
+        consts: *mut PyObject,
+        names: *mut PyObject,
+        varnames: *mut PyObject,
+        freevars: *mut PyObject,
+        cellvars: *mut PyObject,
+        filename: *mut PyObject,
+        name: *mut PyObject,
+        firstlineno: c_int,
+        lnotab: *mut PyObject,
+    ) -> *mut PyCodeObject;
+    #[cfg(not(GraalPy))]
+    #[cfg(Py_3_8)]
+    pub fn PyCode_NewWithPosOnlyArgs(
+        argcount: c_int,
+        posonlyargcount: c_int,
+        kwonlyargcount: c_int,
+        nlocals: c_int,
+        stacksize: c_int,
+        flags: c_int,
+        code: *mut PyObject,
+        consts: *mut PyObject,
+        names: *mut PyObject,
+        varnames: *mut PyObject,
+        freevars: *mut PyObject,
+        cellvars: *mut PyObject,
+        filename: *mut PyObject,
+        name: *mut PyObject,
+        firstlineno: c_int,
+        lnotab: *mut PyObject,
+    ) -> *mut PyCodeObject;
+    #[cfg(not(GraalPy))]
+    #[cfg_attr(PyPy, link_name = "PyPyCode_NewEmpty")]
+    pub fn PyCode_NewEmpty(
+        filename: *const c_char,
+        funcname: *const c_char,
+        firstlineno: c_int,
+    ) -> *mut PyCodeObject;
+    #[cfg(not(GraalPy))]
+    pub fn PyCode_Addr2Line(arg1: *mut PyCodeObject, arg2: c_int) -> c_int;
+    // skipped PyCodeAddressRange "for internal use only"
+    // skipped _PyCode_CheckLineNumber
+    // skipped _PyCode_ConstantKey
+    pub fn PyCode_Optimize(
+        code: *mut PyObject,
+        consts: *mut PyObject,
+        names: *mut PyObject,
+        lnotab: *mut PyObject,
+    ) -> *mut PyObject;
+    pub fn _PyCode_GetExtra(
+        code: *mut PyObject,
+        index: Py_ssize_t,
+        extra: *const *mut c_void,
+    ) -> c_int;
+    pub fn _PyCode_SetExtra(code: *mut PyObject, index: Py_ssize_t, extra: *mut c_void) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/compile.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/compile.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/compile.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/compile.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,108 @@
+#[cfg(not(any(PyPy, Py_3_10)))]
+use crate::object::PyObject;
+#[cfg(not(any(PyPy, Py_3_10)))]
+use crate::pyarena::*;
+#[cfg(not(any(PyPy, Py_3_10)))]
+use crate::pythonrun::*;
+#[cfg(not(any(PyPy, Py_3_10)))]
+use crate::PyCodeObject;
+#[cfg(not(any(PyPy, Py_3_10)))]
+use std::os::raw::c_char;
+use std::os::raw::c_int;
+
+// skipped non-limited PyCF_MASK
+// skipped non-limited PyCF_MASK_OBSOLETE
+// skipped non-limited PyCF_SOURCE_IS_UTF8
+// skipped non-limited PyCF_DONT_IMPLY_DEDENT
+// skipped non-limited PyCF_ONLY_AST
+// skipped non-limited PyCF_IGNORE_COOKIE
+// skipped non-limited PyCF_TYPE_COMMENTS
+// skipped non-limited PyCF_ALLOW_TOP_LEVEL_AWAIT
+// skipped non-limited PyCF_COMPILE_MASK
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyCompilerFlags {
+    pub cf_flags: c_int,
+    #[cfg(Py_3_8)]
+    pub cf_feature_version: c_int,
+}
+
+// skipped non-limited _PyCompilerFlags_INIT
+
+#[cfg(all(Py_3_12, not(any(Py_3_13, PyPy, GraalPy))))]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct _PyCompilerSrcLocation {
+    pub lineno: c_int,
+    pub end_lineno: c_int,
+    pub col_offset: c_int,
+    pub end_col_offset: c_int,
+}
+
+// skipped SRC_LOCATION_FROM_AST
+
+#[cfg(not(any(PyPy, GraalPy, Py_3_13)))]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyFutureFeatures {
+    pub ff_features: c_int,
+    #[cfg(not(Py_3_12))]
+    pub ff_lineno: c_int,
+    #[cfg(Py_3_12)]
+    pub ff_location: _PyCompilerSrcLocation,
+}
+
+pub const FUTURE_NESTED_SCOPES: &str = "nested_scopes";
+pub const FUTURE_GENERATORS: &str = "generators";
+pub const FUTURE_DIVISION: &str = "division";
+pub const FUTURE_ABSOLUTE_IMPORT: &str = "absolute_import";
+pub const FUTURE_WITH_STATEMENT: &str = "with_statement";
+pub const FUTURE_PRINT_FUNCTION: &str = "print_function";
+pub const FUTURE_UNICODE_LITERALS: &str = "unicode_literals";
+pub const FUTURE_BARRY_AS_BDFL: &str = "barry_as_FLUFL";
+pub const FUTURE_GENERATOR_STOP: &str = "generator_stop";
+// skipped non-limited FUTURE_ANNOTATIONS
+
+extern "C" {
+    #[cfg(not(any(PyPy, Py_3_10)))]
+    pub fn PyNode_Compile(arg1: *mut _node, arg2: *const c_char) -> *mut PyCodeObject;
+
+    #[cfg(not(any(PyPy, Py_3_10)))]
+    pub fn PyAST_CompileEx(
+        _mod: *mut _mod,
+        filename: *const c_char,
+        flags: *mut PyCompilerFlags,
+        optimize: c_int,
+        arena: *mut PyArena,
+    ) -> *mut PyCodeObject;
+
+    #[cfg(not(any(PyPy, Py_3_10)))]
+    pub fn PyAST_CompileObject(
+        _mod: *mut _mod,
+        filename: *mut PyObject,
+        flags: *mut PyCompilerFlags,
+        optimize: c_int,
+        arena: *mut PyArena,
+    ) -> *mut PyCodeObject;
+
+    #[cfg(not(any(PyPy, Py_3_10)))]
+    pub fn PyFuture_FromAST(_mod: *mut _mod, filename: *const c_char) -> *mut PyFutureFeatures;
+
+    #[cfg(not(any(PyPy, Py_3_10)))]
+    pub fn PyFuture_FromASTObject(
+        _mod: *mut _mod,
+        filename: *mut PyObject,
+    ) -> *mut PyFutureFeatures;
+
+    // skipped non-limited _Py_Mangle
+    // skipped non-limited PY_INVALID_STACK_EFFECT
+
+    pub fn PyCompile_OpcodeStackEffect(opcode: c_int, oparg: c_int) -> c_int;
+
+    #[cfg(Py_3_8)]
+    pub fn PyCompile_OpcodeStackEffectWithJump(opcode: c_int, oparg: c_int, jump: c_int) -> c_int;
+
+    // skipped non-limited _PyASTOptimizeState
+    // skipped non-limited _PyAST_Optimize
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/descrobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/descrobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/descrobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/descrobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,78 @@
+use crate::{PyGetSetDef, PyMethodDef, PyObject, PyTypeObject};
+use std::os::raw::{c_char, c_int, c_void};
+
+pub type wrapperfunc = Option<
+    unsafe extern "C" fn(
+        slf: *mut PyObject,
+        args: *mut PyObject,
+        wrapped: *mut c_void,
+    ) -> *mut PyObject,
+>;
+
+pub type wrapperfunc_kwds = Option<
+    unsafe extern "C" fn(
+        slf: *mut PyObject,
+        args: *mut PyObject,
+        wrapped: *mut c_void,
+        kwds: *mut PyObject,
+    ) -> *mut PyObject,
+>;
+
+#[repr(C)]
+pub struct wrapperbase {
+    pub name: *const c_char,
+    pub offset: c_int,
+    pub function: *mut c_void,
+    pub wrapper: wrapperfunc,
+    pub doc: *const c_char,
+    pub flags: c_int,
+    pub name_strobj: *mut PyObject,
+}
+
+pub const PyWrapperFlag_KEYWORDS: c_int = 1;
+
+#[repr(C)]
+pub struct PyDescrObject {
+    pub ob_base: PyObject,
+    pub d_type: *mut PyTypeObject,
+    pub d_name: *mut PyObject,
+    pub d_qualname: *mut PyObject,
+}
+
+// skipped non-limited PyDescr_TYPE
+// skipped non-limited PyDescr_NAME
+
+#[repr(C)]
+pub struct PyMethodDescrObject {
+    pub d_common: PyDescrObject,
+    pub d_method: *mut PyMethodDef,
+    #[cfg(all(not(PyPy), Py_3_8))]
+    pub vectorcall: Option<crate::vectorcallfunc>,
+}
+
+#[repr(C)]
+pub struct PyMemberDescrObject {
+    pub d_common: PyDescrObject,
+    pub d_member: *mut PyGetSetDef,
+}
+
+#[repr(C)]
+pub struct PyGetSetDescrObject {
+    pub d_common: PyDescrObject,
+    pub d_getset: *mut PyGetSetDef,
+}
+
+#[repr(C)]
+pub struct PyWrapperDescrObject {
+    pub d_common: PyDescrObject,
+    pub d_base: *mut wrapperbase,
+    pub d_wrapped: *mut c_void,
+}
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    pub static mut _PyMethodWrapper_Type: PyTypeObject;
+}
+
+// skipped non-limited PyDescr_NewWrapper
+// skipped non-limited PyDescr_IsData
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/dictobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/dictobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/dictobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/dictobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,76 @@
+use crate::object::*;
+use crate::pyport::Py_ssize_t;
+use std::os::raw::c_int;
+
+opaque_struct!(PyDictKeysObject);
+
+#[cfg(Py_3_11)]
+opaque_struct!(PyDictValues);
+
+#[cfg(not(GraalPy))]
+#[repr(C)]
+#[derive(Debug)]
+pub struct PyDictObject {
+    pub ob_base: PyObject,
+    pub ma_used: Py_ssize_t,
+    pub ma_version_tag: u64,
+    pub ma_keys: *mut PyDictKeysObject,
+    #[cfg(not(Py_3_11))]
+    pub ma_values: *mut *mut PyObject,
+    #[cfg(Py_3_11)]
+    pub ma_values: *mut PyDictValues,
+}
+
+extern "C" {
+    // skipped _PyDict_GetItem_KnownHash
+    // skipped _PyDict_GetItemIdWithError
+    // skipped _PyDict_GetItemStringWithError
+    // skipped PyDict_SetDefault
+    pub fn _PyDict_SetItem_KnownHash(
+        mp: *mut PyObject,
+        key: *mut PyObject,
+        item: *mut PyObject,
+        hash: crate::Py_hash_t,
+    ) -> c_int;
+    // skipped _PyDict_DelItem_KnownHash
+    // skipped _PyDict_DelItemIf
+    // skipped _PyDict_NewKeysForClass
+    pub fn _PyDict_Next(
+        mp: *mut PyObject,
+        pos: *mut Py_ssize_t,
+        key: *mut *mut PyObject,
+        value: *mut *mut PyObject,
+        hash: *mut crate::Py_hash_t,
+    ) -> c_int;
+    // skipped PyDict_GET_SIZE
+    // skipped _PyDict_ContainsId
+    pub fn _PyDict_NewPresized(minused: Py_ssize_t) -> *mut PyObject;
+    // skipped _PyDict_MaybeUntrack
+    // skipped _PyDict_HasOnlyStringKeys
+    // skipped _PyDict_KeysSize
+    // skipped _PyDict_SizeOf
+    // skipped _PyDict_Pop
+    // skipped _PyDict_Pop_KnownHash
+    // skipped _PyDict_FromKeys
+    // skipped _PyDict_HasSplitTable
+    // skipped _PyDict_MergeEx
+    // skipped _PyDict_SetItemId
+    // skipped _PyDict_DelItemId
+    // skipped _PyDict_DebugMallocStats
+    // skipped _PyObjectDict_SetItem
+    // skipped _PyDict_LoadGlobal
+    // skipped _PyDict_GetItemHint
+    // skipped _PyDictViewObject
+    // skipped _PyDictView_New
+    // skipped _PyDictView_Intersect
+
+    #[cfg(Py_3_10)]
+    pub fn _PyDict_Contains_KnownHash(
+        op: *mut PyObject,
+        key: *mut PyObject,
+        hash: crate::Py_hash_t,
+    ) -> c_int;
+
+    #[cfg(not(Py_3_10))]
+    pub fn _PyDict_Contains(mp: *mut PyObject, key: *mut PyObject, hash: Py_ssize_t) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/floatobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/floatobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/floatobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/floatobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,33 @@
+#[cfg(GraalPy)]
+use crate::PyFloat_AsDouble;
+use crate::{PyFloat_Check, PyObject};
+use std::os::raw::c_double;
+
+#[repr(C)]
+pub struct PyFloatObject {
+    pub ob_base: PyObject,
+    #[cfg(not(GraalPy))]
+    pub ob_fval: c_double,
+}
+
+#[inline]
+pub unsafe fn _PyFloat_CAST(op: *mut PyObject) -> *mut PyFloatObject {
+    debug_assert_eq!(PyFloat_Check(op), 1);
+    op.cast()
+}
+
+#[inline]
+pub unsafe fn PyFloat_AS_DOUBLE(op: *mut PyObject) -> c_double {
+    #[cfg(not(GraalPy))]
+    return (*_PyFloat_CAST(op)).ob_fval;
+    #[cfg(GraalPy)]
+    return PyFloat_AsDouble(op);
+}
+
+// skipped PyFloat_Pack2
+// skipped PyFloat_Pack4
+// skipped PyFloat_Pack8
+
+// skipped PyFloat_Unpack2
+// skipped PyFloat_Unpack4
+// skipped PyFloat_Unpack8
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/frameobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/frameobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/frameobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/frameobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,97 @@
+#[cfg(not(GraalPy))]
+use crate::cpython::code::PyCodeObject;
+use crate::object::*;
+#[cfg(not(GraalPy))]
+use crate::pystate::PyThreadState;
+#[cfg(not(any(PyPy, GraalPy, Py_3_11)))]
+use std::os::raw::c_char;
+use std::os::raw::c_int;
+use std::ptr::addr_of_mut;
+
+#[cfg(not(any(PyPy, GraalPy, Py_3_11)))]
+pub type PyFrameState = c_char;
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+#[cfg(not(any(PyPy, GraalPy, Py_3_11)))]
+pub struct PyTryBlock {
+    pub b_type: c_int,
+    pub b_handler: c_int,
+    pub b_level: c_int,
+}
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+#[cfg(not(any(PyPy, GraalPy, Py_3_11)))]
+pub struct PyFrameObject {
+    pub ob_base: PyVarObject,
+    pub f_back: *mut PyFrameObject,
+    pub f_code: *mut PyCodeObject,
+    pub f_builtins: *mut PyObject,
+    pub f_globals: *mut PyObject,
+    pub f_locals: *mut PyObject,
+    pub f_valuestack: *mut *mut PyObject,
+
+    #[cfg(not(Py_3_10))]
+    pub f_stacktop: *mut *mut PyObject,
+    pub f_trace: *mut PyObject,
+    #[cfg(Py_3_10)]
+    pub f_stackdepth: c_int,
+    pub f_trace_lines: c_char,
+    pub f_trace_opcodes: c_char,
+
+    pub f_gen: *mut PyObject,
+
+    pub f_lasti: c_int,
+    pub f_lineno: c_int,
+    pub f_iblock: c_int,
+    #[cfg(not(Py_3_10))]
+    pub f_executing: c_char,
+    #[cfg(Py_3_10)]
+    pub f_state: PyFrameState,
+    pub f_blockstack: [PyTryBlock; crate::CO_MAXBLOCKS],
+    pub f_localsplus: [*mut PyObject; 1],
+}
+
+#[cfg(any(PyPy, GraalPy, Py_3_11))]
+opaque_struct!(PyFrameObject);
+
+// skipped _PyFrame_IsRunnable
+// skipped _PyFrame_IsExecuting
+// skipped _PyFrameHasCompleted
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    pub static mut PyFrame_Type: PyTypeObject;
+}
+
+#[inline]
+pub unsafe fn PyFrame_Check(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyFrame_Type)) as c_int
+}
+
+extern "C" {
+    #[cfg(not(GraalPy))]
+    #[cfg_attr(PyPy, link_name = "PyPyFrame_New")]
+    pub fn PyFrame_New(
+        tstate: *mut PyThreadState,
+        code: *mut PyCodeObject,
+        globals: *mut PyObject,
+        locals: *mut PyObject,
+    ) -> *mut PyFrameObject;
+    // skipped _PyFrame_New_NoTrack
+
+    pub fn PyFrame_BlockSetup(f: *mut PyFrameObject, _type: c_int, handler: c_int, level: c_int);
+    #[cfg(not(any(PyPy, GraalPy, Py_3_11)))]
+    pub fn PyFrame_BlockPop(f: *mut PyFrameObject) -> *mut PyTryBlock;
+
+    pub fn PyFrame_LocalsToFast(f: *mut PyFrameObject, clear: c_int);
+    pub fn PyFrame_FastToLocalsWithError(f: *mut PyFrameObject) -> c_int;
+    pub fn PyFrame_FastToLocals(f: *mut PyFrameObject);
+
+    // skipped _PyFrame_DebugMallocStats
+    // skipped PyFrame_GetBack
+
+    #[cfg(not(Py_3_9))]
+    pub fn PyFrame_ClearFreeList() -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/funcobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/funcobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/funcobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/funcobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,108 @@
+use std::os::raw::c_int;
+#[cfg(not(all(PyPy, not(Py_3_8))))]
+use std::ptr::addr_of_mut;
+
+use crate::PyObject;
+
+#[cfg(all(not(any(PyPy, GraalPy)), not(Py_3_10)))]
+#[repr(C)]
+pub struct PyFunctionObject {
+    pub ob_base: PyObject,
+    pub func_code: *mut PyObject,
+    pub func_globals: *mut PyObject,
+    pub func_defaults: *mut PyObject,
+    pub func_kwdefaults: *mut PyObject,
+    pub func_closure: *mut PyObject,
+    pub func_doc: *mut PyObject,
+    pub func_name: *mut PyObject,
+    pub func_dict: *mut PyObject,
+    pub func_weakreflist: *mut PyObject,
+    pub func_module: *mut PyObject,
+    pub func_annotations: *mut PyObject,
+    pub func_qualname: *mut PyObject,
+    #[cfg(Py_3_8)]
+    pub vectorcall: Option<crate::vectorcallfunc>,
+}
+
+#[cfg(all(not(any(PyPy, GraalPy)), Py_3_10))]
+#[repr(C)]
+pub struct PyFunctionObject {
+    pub ob_base: PyObject,
+    pub func_globals: *mut PyObject,
+    pub func_builtins: *mut PyObject,
+    pub func_name: *mut PyObject,
+    pub func_qualname: *mut PyObject,
+    pub func_code: *mut PyObject,
+    pub func_defaults: *mut PyObject,
+    pub func_kwdefaults: *mut PyObject,
+    pub func_closure: *mut PyObject,
+    pub func_doc: *mut PyObject,
+    pub func_dict: *mut PyObject,
+    pub func_weakreflist: *mut PyObject,
+    pub func_module: *mut PyObject,
+    pub func_annotations: *mut PyObject,
+    #[cfg(Py_3_12)]
+    pub func_typeparams: *mut PyObject,
+    pub vectorcall: Option<crate::vectorcallfunc>,
+    #[cfg(Py_3_11)]
+    pub func_version: u32,
+}
+
+#[cfg(PyPy)]
+#[repr(C)]
+pub struct PyFunctionObject {
+    pub ob_base: PyObject,
+    pub func_name: *mut PyObject,
+}
+
+#[cfg(GraalPy)]
+pub struct PyFunctionObject {
+    pub ob_base: PyObject,
+}
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg(not(all(PyPy, not(Py_3_8))))]
+    #[cfg_attr(PyPy, link_name = "PyPyFunction_Type")]
+    pub static mut PyFunction_Type: crate::PyTypeObject;
+}
+
+#[cfg(not(all(PyPy, not(Py_3_8))))]
+#[inline]
+pub unsafe fn PyFunction_Check(op: *mut PyObject) -> c_int {
+    (crate::Py_TYPE(op) == addr_of_mut!(PyFunction_Type)) as c_int
+}
+
+extern "C" {
+    pub fn PyFunction_New(code: *mut PyObject, globals: *mut PyObject) -> *mut PyObject;
+    pub fn PyFunction_NewWithQualName(
+        code: *mut PyObject,
+        globals: *mut PyObject,
+        qualname: *mut PyObject,
+    ) -> *mut PyObject;
+    pub fn PyFunction_GetCode(op: *mut PyObject) -> *mut PyObject;
+    pub fn PyFunction_GetGlobals(op: *mut PyObject) -> *mut PyObject;
+    pub fn PyFunction_GetModule(op: *mut PyObject) -> *mut PyObject;
+    pub fn PyFunction_GetDefaults(op: *mut PyObject) -> *mut PyObject;
+    pub fn PyFunction_SetDefaults(op: *mut PyObject, defaults: *mut PyObject) -> c_int;
+    pub fn PyFunction_GetKwDefaults(op: *mut PyObject) -> *mut PyObject;
+    pub fn PyFunction_SetKwDefaults(op: *mut PyObject, defaults: *mut PyObject) -> c_int;
+    pub fn PyFunction_GetClosure(op: *mut PyObject) -> *mut PyObject;
+    pub fn PyFunction_SetClosure(op: *mut PyObject, closure: *mut PyObject) -> c_int;
+    pub fn PyFunction_GetAnnotations(op: *mut PyObject) -> *mut PyObject;
+    pub fn PyFunction_SetAnnotations(op: *mut PyObject, annotations: *mut PyObject) -> c_int;
+}
+
+// skipped _PyFunction_Vectorcall
+// skipped PyFunction_GET_CODE
+// skipped PyFunction_GET_GLOBALS
+// skipped PyFunction_GET_MODULE
+// skipped PyFunction_GET_DEFAULTS
+// skipped PyFunction_GET_KW_DEFAULTS
+// skipped PyFunction_GET_CLOSURE
+// skipped PyFunction_GET_ANNOTATIONS
+
+// skipped PyClassMethod_Type
+// skipped PyStaticMethod_Type
+// skipped PyClassMethod_New
+// skipped PyStaticMethod_New
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/genobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/genobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/genobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/genobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,99 @@
+use crate::object::*;
+use crate::PyFrameObject;
+#[cfg(not(any(PyPy, GraalPy)))]
+use crate::_PyErr_StackItem;
+#[cfg(Py_3_11)]
+use std::os::raw::c_char;
+use std::os::raw::c_int;
+use std::ptr::addr_of_mut;
+
+#[cfg(not(any(PyPy, GraalPy)))]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyGenObject {
+    pub ob_base: PyObject,
+    #[cfg(not(Py_3_11))]
+    pub gi_frame: *mut PyFrameObject,
+    #[cfg(not(Py_3_10))]
+    pub gi_running: c_int,
+    #[cfg(not(Py_3_12))]
+    pub gi_code: *mut PyObject,
+    pub gi_weakreflist: *mut PyObject,
+    pub gi_name: *mut PyObject,
+    pub gi_qualname: *mut PyObject,
+    pub gi_exc_state: _PyErr_StackItem,
+    #[cfg(Py_3_11)]
+    pub gi_origin_or_finalizer: *mut PyObject,
+    #[cfg(Py_3_11)]
+    pub gi_hooks_inited: c_char,
+    #[cfg(Py_3_11)]
+    pub gi_closed: c_char,
+    #[cfg(Py_3_11)]
+    pub gi_running_async: c_char,
+    #[cfg(Py_3_11)]
+    pub gi_frame_state: i8,
+    #[cfg(Py_3_11)]
+    pub gi_iframe: [*mut PyObject; 1],
+}
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    pub static mut PyGen_Type: PyTypeObject;
+}
+
+#[inline]
+pub unsafe fn PyGen_Check(op: *mut PyObject) -> c_int {
+    PyObject_TypeCheck(op, addr_of_mut!(PyGen_Type))
+}
+
+#[inline]
+pub unsafe fn PyGen_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyGen_Type)) as c_int
+}
+
+extern "C" {
+    pub fn PyGen_New(frame: *mut PyFrameObject) -> *mut PyObject;
+    // skipped PyGen_NewWithQualName
+    // skipped _PyGen_SetStopIterationValue
+    // skipped _PyGen_FetchStopIterationValue
+    // skipped _PyGen_yf
+    // skipped _PyGen_Finalize
+    #[cfg(not(any(Py_3_9, PyPy)))]
+    #[deprecated(note = "This function was never documented in the Python API.")]
+    pub fn PyGen_NeedsFinalizing(op: *mut PyGenObject) -> c_int;
+}
+
+// skipped PyCoroObject
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    pub static mut PyCoro_Type: PyTypeObject;
+    pub static mut _PyCoroWrapper_Type: PyTypeObject;
+}
+
+#[inline]
+pub unsafe fn PyCoro_CheckExact(op: *mut PyObject) -> c_int {
+    PyObject_TypeCheck(op, addr_of_mut!(PyCoro_Type))
+}
+
+// skipped _PyCoro_GetAwaitableIter
+// skipped PyCoro_New
+
+// skipped PyAsyncGenObject
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    pub static mut PyAsyncGen_Type: PyTypeObject;
+    // skipped _PyAsyncGenASend_Type
+    // skipped _PyAsyncGenWrappedValue_Type
+    // skipped _PyAsyncGenAThrow_Type
+}
+
+// skipped PyAsyncGen_New
+
+#[inline]
+pub unsafe fn PyAsyncGen_CheckExact(op: *mut PyObject) -> c_int {
+    PyObject_TypeCheck(op, addr_of_mut!(PyAsyncGen_Type))
+}
+
+// skipped _PyAsyncGenValueWrapperNew
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/import.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/import.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/import.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/import.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,74 @@
+use crate::{PyInterpreterState, PyObject};
+#[cfg(not(PyPy))]
+use std::os::raw::c_uchar;
+use std::os::raw::{c_char, c_int};
+
+// skipped PyInit__imp
+
+extern "C" {
+    pub fn _PyImport_IsInitialized(state: *mut PyInterpreterState) -> c_int;
+    // skipped _PyImport_GetModuleId
+    pub fn _PyImport_SetModule(name: *mut PyObject, module: *mut PyObject) -> c_int;
+    pub fn _PyImport_SetModuleString(name: *const c_char, module: *mut PyObject) -> c_int;
+    pub fn _PyImport_AcquireLock();
+    pub fn _PyImport_ReleaseLock() -> c_int;
+    #[cfg(not(Py_3_9))]
+    pub fn _PyImport_FindBuiltin(name: *const c_char, modules: *mut PyObject) -> *mut PyObject;
+    #[cfg(not(Py_3_11))]
+    pub fn _PyImport_FindExtensionObject(a: *mut PyObject, b: *mut PyObject) -> *mut PyObject;
+    pub fn _PyImport_FixupBuiltin(
+        module: *mut PyObject,
+        name: *const c_char,
+        modules: *mut PyObject,
+    ) -> c_int;
+    pub fn _PyImport_FixupExtensionObject(
+        a: *mut PyObject,
+        b: *mut PyObject,
+        c: *mut PyObject,
+        d: *mut PyObject,
+    ) -> c_int;
+}
+
+#[cfg(not(PyPy))]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct _inittab {
+    pub name: *const c_char,
+    pub initfunc: Option<unsafe extern "C" fn() -> *mut PyObject>,
+}
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg(not(PyPy))]
+    pub static mut PyImport_Inittab: *mut _inittab;
+}
+
+extern "C" {
+    #[cfg(not(PyPy))]
+    pub fn PyImport_ExtendInittab(newtab: *mut _inittab) -> c_int;
+}
+
+#[cfg(not(PyPy))]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct _frozen {
+    pub name: *const c_char,
+    pub code: *const c_uchar,
+    pub size: c_int,
+    #[cfg(Py_3_11)]
+    pub is_package: c_int,
+    #[cfg(all(Py_3_11, not(Py_3_13)))]
+    pub get_code: Option<unsafe extern "C" fn() -> *mut PyObject>,
+}
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg(not(PyPy))]
+    pub static mut PyImport_FrozenModules: *const _frozen;
+    #[cfg(all(not(PyPy), Py_3_11))]
+    pub static mut _PyImport_FrozenBootstrap: *const _frozen;
+    #[cfg(all(not(PyPy), Py_3_11))]
+    pub static mut _PyImport_FrozenStdlib: *const _frozen;
+    #[cfg(all(not(PyPy), Py_3_11))]
+    pub static mut _PyImport_FrozenTest: *const _frozen;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/initconfig.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/initconfig.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/initconfig.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/initconfig.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,219 @@
+/* --- PyStatus ----------------------------------------------- */
+
+use crate::Py_ssize_t;
+use libc::wchar_t;
+use std::os::raw::{c_char, c_int, c_ulong};
+
+#[repr(C)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq)]
+pub enum _PyStatus_TYPE {
+    _PyStatus_TYPE_OK = 0,
+    _PyStatus_TYPE_ERROR = 1,
+    _PyStatus_TYPE_EXIT = 2,
+}
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyStatus {
+    pub _type: _PyStatus_TYPE,
+    pub func: *const c_char,
+    pub err_msg: *const c_char,
+    pub exitcode: c_int,
+}
+
+extern "C" {
+    pub fn PyStatus_Ok() -> PyStatus;
+    pub fn PyStatus_Error(err_msg: *const c_char) -> PyStatus;
+    pub fn PyStatus_NoMemory() -> PyStatus;
+    pub fn PyStatus_Exit(exitcode: c_int) -> PyStatus;
+    pub fn PyStatus_IsError(err: PyStatus) -> c_int;
+    pub fn PyStatus_IsExit(err: PyStatus) -> c_int;
+    pub fn PyStatus_Exception(err: PyStatus) -> c_int;
+}
+
+/* --- PyWideStringList ------------------------------------------------ */
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyWideStringList {
+    pub length: Py_ssize_t,
+    pub items: *mut *mut wchar_t,
+}
+
+extern "C" {
+    pub fn PyWideStringList_Append(list: *mut PyWideStringList, item: *const wchar_t) -> PyStatus;
+    pub fn PyWideStringList_Insert(
+        list: *mut PyWideStringList,
+        index: Py_ssize_t,
+        item: *const wchar_t,
+    ) -> PyStatus;
+}
+
+/* --- PyPreConfig ----------------------------------------------- */
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyPreConfig {
+    pub _config_init: c_int,
+    pub parse_argv: c_int,
+    pub isolated: c_int,
+    pub use_environment: c_int,
+    pub configure_locale: c_int,
+    pub coerce_c_locale: c_int,
+    pub coerce_c_locale_warn: c_int,
+
+    #[cfg(windows)]
+    pub legacy_windows_fs_encoding: c_int,
+
+    pub utf8_mode: c_int,
+    pub dev_mode: c_int,
+    pub allocator: c_int,
+}
+
+extern "C" {
+    pub fn PyPreConfig_InitPythonConfig(config: *mut PyPreConfig);
+    pub fn PyPreConfig_InitIsolatedConfig(config: *mut PyPreConfig);
+}
+
+/* --- PyConfig ---------------------------------------------- */
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyConfig {
+    pub _config_init: c_int,
+    pub isolated: c_int,
+    pub use_environment: c_int,
+    pub dev_mode: c_int,
+    pub install_signal_handlers: c_int,
+    pub use_hash_seed: c_int,
+    pub hash_seed: c_ulong,
+    pub faulthandler: c_int,
+    #[cfg(all(Py_3_9, not(Py_3_10)))]
+    pub _use_peg_parser: c_int,
+    pub tracemalloc: c_int,
+    #[cfg(Py_3_12)]
+    pub perf_profiling: c_int,
+    pub import_time: c_int,
+    #[cfg(Py_3_11)]
+    pub code_debug_ranges: c_int,
+    pub show_ref_count: c_int,
+    #[cfg(not(Py_3_9))]
+    pub show_alloc_count: c_int,
+    pub dump_refs: c_int,
+    #[cfg(Py_3_11)]
+    pub dump_refs_file: *mut wchar_t,
+    pub malloc_stats: c_int,
+    pub filesystem_encoding: *mut wchar_t,
+    pub filesystem_errors: *mut wchar_t,
+    pub pycache_prefix: *mut wchar_t,
+    pub parse_argv: c_int,
+    #[cfg(Py_3_10)]
+    pub orig_argv: PyWideStringList,
+    pub argv: PyWideStringList,
+    #[cfg(not(Py_3_10))]
+    pub program_name: *mut wchar_t,
+    pub xoptions: PyWideStringList,
+    pub warnoptions: PyWideStringList,
+    pub site_import: c_int,
+    pub bytes_warning: c_int,
+    #[cfg(Py_3_10)]
+    pub warn_default_encoding: c_int,
+    pub inspect: c_int,
+    pub interactive: c_int,
+    pub optimization_level: c_int,
+    pub parser_debug: c_int,
+    pub write_bytecode: c_int,
+    pub verbose: c_int,
+    pub quiet: c_int,
+    pub user_site_directory: c_int,
+    pub configure_c_stdio: c_int,
+    pub buffered_stdio: c_int,
+    pub stdio_encoding: *mut wchar_t,
+    pub stdio_errors: *mut wchar_t,
+
+    #[cfg(windows)]
+    pub legacy_windows_stdio: c_int,
+
+    pub check_hash_pycs_mode: *mut wchar_t,
+    #[cfg(Py_3_11)]
+    pub use_frozen_modules: c_int,
+    #[cfg(Py_3_11)]
+    pub safe_path: c_int,
+    #[cfg(Py_3_12)]
+    pub int_max_str_digits: c_int,
+    #[cfg(Py_3_13)]
+    pub cpu_count: c_int,
+    pub pathconfig_warnings: c_int,
+    #[cfg(Py_3_10)]
+    pub program_name: *mut wchar_t,
+    pub pythonpath_env: *mut wchar_t,
+    pub home: *mut wchar_t,
+    #[cfg(Py_3_10)]
+    pub platlibdir: *mut wchar_t,
+
+    pub module_search_paths_set: c_int,
+    pub module_search_paths: PyWideStringList,
+    #[cfg(Py_3_11)]
+    pub stdlib_dir: *mut wchar_t,
+    pub executable: *mut wchar_t,
+    pub base_executable: *mut wchar_t,
+    pub prefix: *mut wchar_t,
+    pub base_prefix: *mut wchar_t,
+    pub exec_prefix: *mut wchar_t,
+    pub base_exec_prefix: *mut wchar_t,
+    #[cfg(all(Py_3_9, not(Py_3_10)))]
+    pub platlibdir: *mut wchar_t,
+    pub skip_source_first_line: c_int,
+    pub run_command: *mut wchar_t,
+    pub run_module: *mut wchar_t,
+    pub run_filename: *mut wchar_t,
+    #[cfg(Py_3_13)]
+    pub sys_path_0: *mut wchar_t,
+    pub _install_importlib: c_int,
+    pub _init_main: c_int,
+    #[cfg(all(Py_3_9, not(Py_3_12)))]
+    pub _isolated_interpreter: c_int,
+    #[cfg(Py_3_11)]
+    pub _is_python_build: c_int,
+    #[cfg(all(Py_3_9, not(Py_3_10)))]
+    pub _orig_argv: PyWideStringList,
+}
+
+extern "C" {
+    pub fn PyConfig_InitPythonConfig(config: *mut PyConfig);
+    pub fn PyConfig_InitIsolatedConfig(config: *mut PyConfig);
+    pub fn PyConfig_Clear(config: *mut PyConfig);
+    pub fn PyConfig_SetString(
+        config: *mut PyConfig,
+        config_str: *mut *mut wchar_t,
+        str: *const wchar_t,
+    ) -> PyStatus;
+    pub fn PyConfig_SetBytesString(
+        config: *mut PyConfig,
+        config_str: *mut *mut wchar_t,
+        str: *const c_char,
+    ) -> PyStatus;
+    pub fn PyConfig_Read(config: *mut PyConfig) -> PyStatus;
+    pub fn PyConfig_SetBytesArgv(
+        config: *mut PyConfig,
+        argc: Py_ssize_t,
+        argv: *mut *const c_char,
+    ) -> PyStatus;
+    pub fn PyConfig_SetArgv(
+        config: *mut PyConfig,
+        argc: Py_ssize_t,
+        argv: *mut *const wchar_t,
+    ) -> PyStatus;
+    pub fn PyConfig_SetWideStringList(
+        config: *mut PyConfig,
+        list: *mut PyWideStringList,
+        length: Py_ssize_t,
+        items: *mut *mut wchar_t,
+    ) -> PyStatus;
+}
+
+/* --- Helper functions --------------------------------------- */
+
+extern "C" {
+    pub fn Py_GetArgcArgv(argc: *mut c_int, argv: *mut *mut *mut wchar_t);
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/listobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/listobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/listobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/listobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,41 @@
+use crate::object::*;
+#[cfg(not(PyPy))]
+use crate::pyport::Py_ssize_t;
+
+#[cfg(not(any(PyPy, GraalPy)))]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyListObject {
+    pub ob_base: PyVarObject,
+    pub ob_item: *mut *mut PyObject,
+    pub allocated: Py_ssize_t,
+}
+
+#[cfg(any(PyPy, GraalPy))]
+pub struct PyListObject {
+    pub ob_base: PyObject,
+}
+
+// skipped _PyList_Extend
+// skipped _PyList_DebugMallocStats
+// skipped _PyList_CAST (used inline below)
+
+/// Macro, trading safety for speed
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+pub unsafe fn PyList_GET_ITEM(op: *mut PyObject, i: Py_ssize_t) -> *mut PyObject {
+    *(*(op as *mut PyListObject)).ob_item.offset(i)
+}
+
+/// Macro, *only* to be used to fill in brand new lists
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+pub unsafe fn PyList_SET_ITEM(op: *mut PyObject, i: Py_ssize_t, v: *mut PyObject) {
+    *(*(op as *mut PyListObject)).ob_item.offset(i) = v;
+}
+
+#[inline]
+#[cfg(not(PyPy))]
+pub unsafe fn PyList_GET_SIZE(op: *mut PyObject) -> Py_ssize_t {
+    Py_SIZE(op)
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/longobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/longobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/longobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/longobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,74 @@
+use crate::longobject::*;
+use crate::object::*;
+#[cfg(Py_3_13)]
+use crate::pyport::Py_ssize_t;
+use libc::size_t;
+#[cfg(Py_3_13)]
+use std::os::raw::c_void;
+use std::os::raw::{c_int, c_uchar};
+
+#[cfg(Py_3_13)]
+extern "C" {
+    pub fn PyLong_FromUnicodeObject(u: *mut PyObject, base: c_int) -> *mut PyObject;
+}
+
+#[cfg(Py_3_13)]
+pub const Py_ASNATIVEBYTES_DEFAULTS: c_int = -1;
+#[cfg(Py_3_13)]
+pub const Py_ASNATIVEBYTES_BIG_ENDIAN: c_int = 0;
+#[cfg(Py_3_13)]
+pub const Py_ASNATIVEBYTES_LITTLE_ENDIAN: c_int = 1;
+#[cfg(Py_3_13)]
+pub const Py_ASNATIVEBYTES_NATIVE_ENDIAN: c_int = 3;
+#[cfg(Py_3_13)]
+pub const Py_ASNATIVEBYTES_UNSIGNED_BUFFER: c_int = 4;
+#[cfg(Py_3_13)]
+pub const Py_ASNATIVEBYTES_REJECT_NEGATIVE: c_int = 8;
+
+extern "C" {
+    // skipped _PyLong_Sign
+
+    #[cfg(Py_3_13)]
+    pub fn PyLong_AsNativeBytes(
+        v: *mut PyObject,
+        buffer: *mut c_void,
+        n_bytes: Py_ssize_t,
+        flags: c_int,
+    ) -> Py_ssize_t;
+
+    #[cfg(Py_3_13)]
+    pub fn PyLong_FromNativeBytes(
+        buffer: *const c_void,
+        n_bytes: size_t,
+        flags: c_int,
+    ) -> *mut PyObject;
+
+    #[cfg(Py_3_13)]
+    pub fn PyLong_FromUnsignedNativeBytes(
+        buffer: *const c_void,
+        n_bytes: size_t,
+        flags: c_int,
+    ) -> *mut PyObject;
+
+    // skipped PyUnstable_Long_IsCompact
+    // skipped PyUnstable_Long_CompactValue
+
+    #[cfg_attr(PyPy, link_name = "_PyPyLong_FromByteArray")]
+    pub fn _PyLong_FromByteArray(
+        bytes: *const c_uchar,
+        n: size_t,
+        little_endian: c_int,
+        is_signed: c_int,
+    ) -> *mut PyObject;
+
+    #[cfg_attr(PyPy, link_name = "_PyPyLong_AsByteArrayO")]
+    pub fn _PyLong_AsByteArray(
+        v: *mut PyLongObject,
+        bytes: *mut c_uchar,
+        n: size_t,
+        little_endian: c_int,
+        is_signed: c_int,
+    ) -> c_int;
+
+    // skipped _PyLong_GCD
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/methodobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/methodobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/methodobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/methodobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,71 @@
+use crate::object::*;
+#[cfg(not(GraalPy))]
+use crate::{PyCFunctionObject, PyMethodDefPointer, METH_METHOD, METH_STATIC};
+use std::os::raw::c_int;
+use std::ptr::addr_of_mut;
+
+#[cfg(not(GraalPy))]
+pub struct PyCMethodObject {
+    pub func: PyCFunctionObject,
+    pub mm_class: *mut PyTypeObject,
+}
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    pub static mut PyCMethod_Type: PyTypeObject;
+}
+
+#[inline]
+pub unsafe fn PyCMethod_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyCMethod_Type)) as c_int
+}
+
+#[inline]
+pub unsafe fn PyCMethod_Check(op: *mut PyObject) -> c_int {
+    PyObject_TypeCheck(op, addr_of_mut!(PyCMethod_Type))
+}
+
+#[cfg(not(GraalPy))]
+#[inline]
+pub unsafe fn PyCFunction_GET_FUNCTION(func: *mut PyObject) -> PyMethodDefPointer {
+    debug_assert_eq!(PyCMethod_Check(func), 1);
+
+    let func = func.cast::<PyCFunctionObject>();
+    (*(*func).m_ml).ml_meth
+}
+
+#[cfg(not(GraalPy))]
+#[inline]
+pub unsafe fn PyCFunction_GET_SELF(func: *mut PyObject) -> *mut PyObject {
+    debug_assert_eq!(PyCMethod_Check(func), 1);
+
+    let func = func.cast::<PyCFunctionObject>();
+    if (*(*func).m_ml).ml_flags & METH_STATIC != 0 {
+        std::ptr::null_mut()
+    } else {
+        (*func).m_self
+    }
+}
+
+#[cfg(not(GraalPy))]
+#[inline]
+pub unsafe fn PyCFunction_GET_FLAGS(func: *mut PyObject) -> c_int {
+    debug_assert_eq!(PyCMethod_Check(func), 1);
+
+    let func = func.cast::<PyCFunctionObject>();
+    (*(*func).m_ml).ml_flags
+}
+
+#[cfg(not(GraalPy))]
+#[inline]
+pub unsafe fn PyCFunction_GET_CLASS(func: *mut PyObject) -> *mut PyTypeObject {
+    debug_assert_eq!(PyCMethod_Check(func), 1);
+
+    let func = func.cast::<PyCFunctionObject>();
+    if (*(*func).m_ml).ml_flags & METH_METHOD != 0 {
+        let func = func.cast::<PyCMethodObject>();
+        (*func).mm_class
+    } else {
+        std::ptr::null_mut()
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/mod.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/mod.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,74 @@
+pub(crate) mod abstract_;
+// skipped bytearrayobject.h
+pub(crate) mod bytesobject;
+#[cfg(not(PyPy))]
+pub(crate) mod ceval;
+pub(crate) mod code;
+pub(crate) mod compile;
+pub(crate) mod descrobject;
+#[cfg(not(PyPy))]
+pub(crate) mod dictobject;
+// skipped fileobject.h
+// skipped fileutils.h
+pub(crate) mod frameobject;
+pub(crate) mod funcobject;
+pub(crate) mod genobject;
+pub(crate) mod import;
+#[cfg(all(Py_3_8, not(PyPy)))]
+pub(crate) mod initconfig;
+// skipped interpreteridobject.h
+pub(crate) mod listobject;
+pub(crate) mod longobject;
+#[cfg(all(Py_3_9, not(PyPy)))]
+pub(crate) mod methodobject;
+pub(crate) mod object;
+pub(crate) mod objimpl;
+pub(crate) mod pydebug;
+pub(crate) mod pyerrors;
+#[cfg(all(Py_3_8, not(PyPy)))]
+pub(crate) mod pylifecycle;
+pub(crate) mod pymem;
+pub(crate) mod pystate;
+pub(crate) mod pythonrun;
+// skipped sysmodule.h
+pub(crate) mod floatobject;
+pub(crate) mod pyframe;
+pub(crate) mod tupleobject;
+pub(crate) mod unicodeobject;
+pub(crate) mod weakrefobject;
+
+pub use self::abstract_::*;
+pub use self::bytesobject::*;
+#[cfg(not(PyPy))]
+pub use self::ceval::*;
+pub use self::code::*;
+pub use self::compile::*;
+pub use self::descrobject::*;
+#[cfg(not(PyPy))]
+pub use self::dictobject::*;
+pub use self::floatobject::*;
+pub use self::frameobject::*;
+pub use self::funcobject::*;
+pub use self::genobject::*;
+pub use self::import::*;
+#[cfg(all(Py_3_8, not(PyPy)))]
+pub use self::initconfig::*;
+pub use self::listobject::*;
+pub use self::longobject::*;
+#[cfg(all(Py_3_9, not(PyPy)))]
+pub use self::methodobject::*;
+pub use self::object::*;
+pub use self::objimpl::*;
+pub use self::pydebug::*;
+pub use self::pyerrors::*;
+#[cfg(Py_3_11)]
+pub use self::pyframe::*;
+#[cfg(all(Py_3_8, not(PyPy)))]
+pub use self::pylifecycle::*;
+pub use self::pymem::*;
+pub use self::pystate::*;
+pub use self::pythonrun::*;
+pub use self::tupleobject::*;
+pub use self::unicodeobject::*;
+#[cfg(not(any(PyPy, GraalPy)))]
+pub use self::weakrefobject::*;
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/object.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/object.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/object.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/object.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,411 @@
+#[cfg(Py_3_8)]
+use crate::vectorcallfunc;
+#[cfg(Py_3_11)]
+use crate::PyModuleDef;
+use crate::{object, PyGetSetDef, PyMemberDef, PyMethodDef, PyObject, Py_ssize_t};
+use std::mem;
+use std::os::raw::{c_char, c_int, c_uint, c_ulong, c_void};
+
+// skipped _Py_NewReference
+// skipped _Py_ForgetReference
+// skipped _Py_GetRefTotal
+
+// skipped _Py_Identifier
+
+// skipped _Py_static_string_init
+// skipped _Py_static_string
+// skipped _Py_IDENTIFIER
+
+#[cfg(not(Py_3_11))] // moved to src/buffer.rs from Python
+mod bufferinfo {
+    use crate::Py_ssize_t;
+    use std::os::raw::{c_char, c_int, c_void};
+    use std::ptr;
+
+    #[repr(C)]
+    #[derive(Copy, Clone)]
+    pub struct Py_buffer {
+        pub buf: *mut c_void,
+        /// Owned reference
+        pub obj: *mut crate::PyObject,
+        pub len: Py_ssize_t,
+        pub itemsize: Py_ssize_t,
+        pub readonly: c_int,
+        pub ndim: c_int,
+        pub format: *mut c_char,
+        pub shape: *mut Py_ssize_t,
+        pub strides: *mut Py_ssize_t,
+        pub suboffsets: *mut Py_ssize_t,
+        pub internal: *mut c_void,
+        #[cfg(PyPy)]
+        pub flags: c_int,
+        #[cfg(PyPy)]
+        pub _strides: [Py_ssize_t; PyBUF_MAX_NDIM as usize],
+        #[cfg(PyPy)]
+        pub _shape: [Py_ssize_t; PyBUF_MAX_NDIM as usize],
+    }
+
+    impl Py_buffer {
+        #[allow(clippy::new_without_default)]
+        pub const fn new() -> Self {
+            Py_buffer {
+                buf: ptr::null_mut(),
+                obj: ptr::null_mut(),
+                len: 0,
+                itemsize: 0,
+                readonly: 0,
+                ndim: 0,
+                format: ptr::null_mut(),
+                shape: ptr::null_mut(),
+                strides: ptr::null_mut(),
+                suboffsets: ptr::null_mut(),
+                internal: ptr::null_mut(),
+                #[cfg(PyPy)]
+                flags: 0,
+                #[cfg(PyPy)]
+                _strides: [0; PyBUF_MAX_NDIM as usize],
+                #[cfg(PyPy)]
+                _shape: [0; PyBUF_MAX_NDIM as usize],
+            }
+        }
+    }
+
+    pub type getbufferproc = unsafe extern "C" fn(
+        arg1: *mut crate::PyObject,
+        arg2: *mut Py_buffer,
+        arg3: c_int,
+    ) -> c_int;
+    pub type releasebufferproc =
+        unsafe extern "C" fn(arg1: *mut crate::PyObject, arg2: *mut Py_buffer);
+
+    /// Maximum number of dimensions
+    pub const PyBUF_MAX_NDIM: c_int = if cfg!(PyPy) { 36 } else { 64 };
+
+    /* Flags for getting buffers */
+    pub const PyBUF_SIMPLE: c_int = 0;
+    pub const PyBUF_WRITABLE: c_int = 0x0001;
+    /* we used to include an E, backwards compatible alias */
+    pub const PyBUF_WRITEABLE: c_int = PyBUF_WRITABLE;
+    pub const PyBUF_FORMAT: c_int = 0x0004;
+    pub const PyBUF_ND: c_int = 0x0008;
+    pub const PyBUF_STRIDES: c_int = 0x0010 | PyBUF_ND;
+    pub const PyBUF_C_CONTIGUOUS: c_int = 0x0020 | PyBUF_STRIDES;
+    pub const PyBUF_F_CONTIGUOUS: c_int = 0x0040 | PyBUF_STRIDES;
+    pub const PyBUF_ANY_CONTIGUOUS: c_int = 0x0080 | PyBUF_STRIDES;
+    pub const PyBUF_INDIRECT: c_int = 0x0100 | PyBUF_STRIDES;
+
+    pub const PyBUF_CONTIG: c_int = PyBUF_ND | PyBUF_WRITABLE;
+    pub const PyBUF_CONTIG_RO: c_int = PyBUF_ND;
+
+    pub const PyBUF_STRIDED: c_int = PyBUF_STRIDES | PyBUF_WRITABLE;
+    pub const PyBUF_STRIDED_RO: c_int = PyBUF_STRIDES;
+
+    pub const PyBUF_RECORDS: c_int = PyBUF_STRIDES | PyBUF_WRITABLE | PyBUF_FORMAT;
+    pub const PyBUF_RECORDS_RO: c_int = PyBUF_STRIDES | PyBUF_FORMAT;
+
+    pub const PyBUF_FULL: c_int = PyBUF_INDIRECT | PyBUF_WRITABLE | PyBUF_FORMAT;
+    pub const PyBUF_FULL_RO: c_int = PyBUF_INDIRECT | PyBUF_FORMAT;
+
+    pub const PyBUF_READ: c_int = 0x100;
+    pub const PyBUF_WRITE: c_int = 0x200;
+}
+
+#[cfg(not(Py_3_11))]
+pub use self::bufferinfo::*;
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyNumberMethods {
+    pub nb_add: Option<object::binaryfunc>,
+    pub nb_subtract: Option<object::binaryfunc>,
+    pub nb_multiply: Option<object::binaryfunc>,
+    pub nb_remainder: Option<object::binaryfunc>,
+    pub nb_divmod: Option<object::binaryfunc>,
+    pub nb_power: Option<object::ternaryfunc>,
+    pub nb_negative: Option<object::unaryfunc>,
+    pub nb_positive: Option<object::unaryfunc>,
+    pub nb_absolute: Option<object::unaryfunc>,
+    pub nb_bool: Option<object::inquiry>,
+    pub nb_invert: Option<object::unaryfunc>,
+    pub nb_lshift: Option<object::binaryfunc>,
+    pub nb_rshift: Option<object::binaryfunc>,
+    pub nb_and: Option<object::binaryfunc>,
+    pub nb_xor: Option<object::binaryfunc>,
+    pub nb_or: Option<object::binaryfunc>,
+    pub nb_int: Option<object::unaryfunc>,
+    pub nb_reserved: *mut c_void,
+    pub nb_float: Option<object::unaryfunc>,
+    pub nb_inplace_add: Option<object::binaryfunc>,
+    pub nb_inplace_subtract: Option<object::binaryfunc>,
+    pub nb_inplace_multiply: Option<object::binaryfunc>,
+    pub nb_inplace_remainder: Option<object::binaryfunc>,
+    pub nb_inplace_power: Option<object::ternaryfunc>,
+    pub nb_inplace_lshift: Option<object::binaryfunc>,
+    pub nb_inplace_rshift: Option<object::binaryfunc>,
+    pub nb_inplace_and: Option<object::binaryfunc>,
+    pub nb_inplace_xor: Option<object::binaryfunc>,
+    pub nb_inplace_or: Option<object::binaryfunc>,
+    pub nb_floor_divide: Option<object::binaryfunc>,
+    pub nb_true_divide: Option<object::binaryfunc>,
+    pub nb_inplace_floor_divide: Option<object::binaryfunc>,
+    pub nb_inplace_true_divide: Option<object::binaryfunc>,
+    pub nb_index: Option<object::unaryfunc>,
+    pub nb_matrix_multiply: Option<object::binaryfunc>,
+    pub nb_inplace_matrix_multiply: Option<object::binaryfunc>,
+}
+
+#[repr(C)]
+#[derive(Clone)]
+pub struct PySequenceMethods {
+    pub sq_length: Option<object::lenfunc>,
+    pub sq_concat: Option<object::binaryfunc>,
+    pub sq_repeat: Option<object::ssizeargfunc>,
+    pub sq_item: Option<object::ssizeargfunc>,
+    pub was_sq_slice: *mut c_void,
+    pub sq_ass_item: Option<object::ssizeobjargproc>,
+    pub was_sq_ass_slice: *mut c_void,
+    pub sq_contains: Option<object::objobjproc>,
+    pub sq_inplace_concat: Option<object::binaryfunc>,
+    pub sq_inplace_repeat: Option<object::ssizeargfunc>,
+}
+
+#[repr(C)]
+#[derive(Clone, Default)]
+pub struct PyMappingMethods {
+    pub mp_length: Option<object::lenfunc>,
+    pub mp_subscript: Option<object::binaryfunc>,
+    pub mp_ass_subscript: Option<object::objobjargproc>,
+}
+
+#[cfg(Py_3_10)]
+pub type sendfunc = unsafe extern "C" fn(
+    iter: *mut PyObject,
+    value: *mut PyObject,
+    result: *mut *mut PyObject,
+) -> object::PySendResult;
+
+#[repr(C)]
+#[derive(Clone, Default)]
+pub struct PyAsyncMethods {
+    pub am_await: Option<object::unaryfunc>,
+    pub am_aiter: Option<object::unaryfunc>,
+    pub am_anext: Option<object::unaryfunc>,
+    #[cfg(Py_3_10)]
+    pub am_send: Option<sendfunc>,
+}
+
+#[repr(C)]
+#[derive(Clone, Default)]
+pub struct PyBufferProcs {
+    pub bf_getbuffer: Option<crate::getbufferproc>,
+    pub bf_releasebuffer: Option<crate::releasebufferproc>,
+}
+
+pub type printfunc =
+    unsafe extern "C" fn(arg1: *mut PyObject, arg2: *mut ::libc::FILE, arg3: c_int) -> c_int;
+
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct PyTypeObject {
+    #[cfg(all(PyPy, not(Py_3_9)))]
+    pub ob_refcnt: Py_ssize_t,
+    #[cfg(all(PyPy, not(Py_3_9)))]
+    pub ob_pypy_link: Py_ssize_t,
+    #[cfg(all(PyPy, not(Py_3_9)))]
+    pub ob_type: *mut PyTypeObject,
+    #[cfg(all(PyPy, not(Py_3_9)))]
+    pub ob_size: Py_ssize_t,
+    #[cfg(not(all(PyPy, not(Py_3_9))))]
+    pub ob_base: object::PyVarObject,
+    #[cfg(GraalPy)]
+    pub ob_size: Py_ssize_t,
+    pub tp_name: *const c_char,
+    pub tp_basicsize: Py_ssize_t,
+    pub tp_itemsize: Py_ssize_t,
+    pub tp_dealloc: Option<object::destructor>,
+    #[cfg(not(Py_3_8))]
+    pub tp_print: Option<printfunc>,
+    #[cfg(Py_3_8)]
+    pub tp_vectorcall_offset: Py_ssize_t,
+    pub tp_getattr: Option<object::getattrfunc>,
+    pub tp_setattr: Option<object::setattrfunc>,
+    pub tp_as_async: *mut PyAsyncMethods,
+    pub tp_repr: Option<object::reprfunc>,
+    pub tp_as_number: *mut PyNumberMethods,
+    pub tp_as_sequence: *mut PySequenceMethods,
+    pub tp_as_mapping: *mut PyMappingMethods,
+    pub tp_hash: Option<object::hashfunc>,
+    pub tp_call: Option<object::ternaryfunc>,
+    pub tp_str: Option<object::reprfunc>,
+    pub tp_getattro: Option<object::getattrofunc>,
+    pub tp_setattro: Option<object::setattrofunc>,
+    pub tp_as_buffer: *mut PyBufferProcs,
+    pub tp_flags: c_ulong,
+    pub tp_doc: *const c_char,
+    pub tp_traverse: Option<object::traverseproc>,
+    pub tp_clear: Option<object::inquiry>,
+    pub tp_richcompare: Option<object::richcmpfunc>,
+    pub tp_weaklistoffset: Py_ssize_t,
+    pub tp_iter: Option<object::getiterfunc>,
+    pub tp_iternext: Option<object::iternextfunc>,
+    pub tp_methods: *mut PyMethodDef,
+    pub tp_members: *mut PyMemberDef,
+    pub tp_getset: *mut PyGetSetDef,
+    pub tp_base: *mut PyTypeObject,
+    pub tp_dict: *mut object::PyObject,
+    pub tp_descr_get: Option<object::descrgetfunc>,
+    pub tp_descr_set: Option<object::descrsetfunc>,
+    pub tp_dictoffset: Py_ssize_t,
+    pub tp_init: Option<object::initproc>,
+    pub tp_alloc: Option<object::allocfunc>,
+    pub tp_new: Option<object::newfunc>,
+    pub tp_free: Option<object::freefunc>,
+    pub tp_is_gc: Option<object::inquiry>,
+    pub tp_bases: *mut object::PyObject,
+    pub tp_mro: *mut object::PyObject,
+    pub tp_cache: *mut object::PyObject,
+    pub tp_subclasses: *mut object::PyObject,
+    pub tp_weaklist: *mut object::PyObject,
+    pub tp_del: Option<object::destructor>,
+    pub tp_version_tag: c_uint,
+    pub tp_finalize: Option<object::destructor>,
+    #[cfg(Py_3_8)]
+    pub tp_vectorcall: Option<vectorcallfunc>,
+    #[cfg(Py_3_12)]
+    pub tp_watched: c_char,
+    #[cfg(any(all(PyPy, Py_3_8, not(Py_3_10)), all(not(PyPy), Py_3_8, not(Py_3_9))))]
+    pub tp_print: Option<printfunc>,
+    #[cfg(all(PyPy, not(Py_3_10)))]
+    pub tp_pypy_flags: std::os::raw::c_long,
+    #[cfg(py_sys_config = "COUNT_ALLOCS")]
+    pub tp_allocs: Py_ssize_t,
+    #[cfg(py_sys_config = "COUNT_ALLOCS")]
+    pub tp_frees: Py_ssize_t,
+    #[cfg(py_sys_config = "COUNT_ALLOCS")]
+    pub tp_maxalloc: Py_ssize_t,
+    #[cfg(py_sys_config = "COUNT_ALLOCS")]
+    pub tp_prev: *mut PyTypeObject,
+    #[cfg(py_sys_config = "COUNT_ALLOCS")]
+    pub tp_next: *mut PyTypeObject,
+}
+
+#[cfg(Py_3_11)]
+#[repr(C)]
+#[derive(Clone)]
+pub struct _specialization_cache {
+    pub getitem: *mut PyObject,
+    #[cfg(Py_3_12)]
+    pub getitem_version: u32,
+    #[cfg(Py_3_13)]
+    pub init: *mut PyObject,
+}
+
+#[repr(C)]
+#[derive(Clone)]
+pub struct PyHeapTypeObject {
+    pub ht_type: PyTypeObject,
+    pub as_async: PyAsyncMethods,
+    pub as_number: PyNumberMethods,
+    pub as_mapping: PyMappingMethods,
+    pub as_sequence: PySequenceMethods,
+    pub as_buffer: PyBufferProcs,
+    pub ht_name: *mut object::PyObject,
+    pub ht_slots: *mut object::PyObject,
+    pub ht_qualname: *mut object::PyObject,
+    #[cfg(not(PyPy))]
+    pub ht_cached_keys: *mut c_void,
+    #[cfg(Py_3_9)]
+    pub ht_module: *mut object::PyObject,
+    #[cfg(Py_3_11)]
+    pub _ht_tpname: *mut c_char,
+    #[cfg(Py_3_11)]
+    pub _spec_cache: _specialization_cache,
+}
+
+impl Default for PyHeapTypeObject {
+    #[inline]
+    fn default() -> Self {
+        unsafe { mem::zeroed() }
+    }
+}
+
+#[inline]
+pub unsafe fn PyHeapType_GET_MEMBERS(etype: *mut PyHeapTypeObject) -> *mut PyMemberDef {
+    let py_type = object::Py_TYPE(etype as *mut object::PyObject);
+    let ptr = etype.offset((*py_type).tp_basicsize);
+    ptr as *mut PyMemberDef
+}
+
+// skipped _PyType_Name
+// skipped _PyType_Lookup
+// skipped _PyType_LookupId
+// skipped _PyObject_LookupSpecial
+// skipped _PyType_CalculateMetaclass
+// skipped _PyType_GetDocFromInternalDoc
+// skipped _PyType_GetTextSignatureFromInternalDoc
+
+extern "C" {
+    #[cfg(Py_3_11)]
+    #[cfg_attr(PyPy, link_name = "PyPyType_GetModuleByDef")]
+    pub fn PyType_GetModuleByDef(ty: *mut PyTypeObject, def: *mut PyModuleDef) -> *mut PyObject;
+
+    #[cfg(Py_3_12)]
+    pub fn PyType_GetDict(o: *mut PyTypeObject) -> *mut PyObject;
+
+    #[cfg_attr(PyPy, link_name = "PyPyObject_Print")]
+    pub fn PyObject_Print(o: *mut PyObject, fp: *mut ::libc::FILE, flags: c_int) -> c_int;
+
+    // skipped _Py_BreakPoint
+    // skipped _PyObject_Dump
+    // skipped _PyObject_IsFreed
+    // skipped _PyObject_IsAbstract
+    // skipped _PyObject_GetAttrId
+    // skipped _PyObject_SetAttrId
+    // skipped _PyObject_LookupAttr
+    // skipped _PyObject_LookupAttrId
+    // skipped _PyObject_GetMethod
+
+    #[cfg(not(PyPy))]
+    pub fn _PyObject_GetDictPtr(obj: *mut PyObject) -> *mut *mut PyObject;
+    #[cfg(not(PyPy))]
+    pub fn _PyObject_NextNotImplemented(arg1: *mut PyObject) -> *mut PyObject;
+    pub fn PyObject_CallFinalizer(arg1: *mut PyObject);
+    #[cfg_attr(PyPy, link_name = "PyPyObject_CallFinalizerFromDealloc")]
+    pub fn PyObject_CallFinalizerFromDealloc(arg1: *mut PyObject) -> c_int;
+
+    // skipped _PyObject_GenericGetAttrWithDict
+    // skipped _PyObject_GenericSetAttrWithDict
+    // skipped _PyObject_FunctionStr
+}
+
+// skipped Py_SETREF
+// skipped Py_XSETREF
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    pub static mut _PyNone_Type: PyTypeObject;
+    pub static mut _PyNotImplemented_Type: PyTypeObject;
+}
+
+// skipped _Py_SwappedOp
+
+// skipped _PyDebugAllocatorStats
+// skipped _PyObject_DebugTypeStats
+// skipped _PyObject_ASSERT_FROM
+// skipped _PyObject_ASSERT_WITH_MSG
+// skipped _PyObject_ASSERT
+// skipped _PyObject_ASSERT_FAILED_MSG
+// skipped _PyObject_AssertFailed
+// skipped _PyObject_CheckConsistency
+
+// skipped _PyTrash_thread_deposit_object
+// skipped _PyTrash_thread_destroy_chain
+// skipped _PyTrash_begin
+// skipped _PyTrash_end
+// skipped _PyTrash_cond
+// skipped PyTrash_UNWIND_LEVEL
+// skipped Py_TRASHCAN_BEGIN_CONDITION
+// skipped Py_TRASHCAN_END
+// skipped Py_TRASHCAN_BEGIN
+// skipped Py_TRASHCAN_SAFE_BEGIN
+// skipped Py_TRASHCAN_SAFE_END
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/objimpl.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/objimpl.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/objimpl.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/objimpl.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,71 @@
+use libc::size_t;
+use std::os::raw::c_int;
+
+#[cfg(not(any(PyPy, GraalPy)))]
+use std::os::raw::c_void;
+
+use crate::object::*;
+
+// skipped _PyObject_SIZE
+// skipped _PyObject_VAR_SIZE
+
+#[cfg(not(Py_3_11))]
+extern "C" {
+    pub fn _Py_GetAllocatedBlocks() -> crate::Py_ssize_t;
+}
+
+#[cfg(not(any(PyPy, GraalPy)))]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyObjectArenaAllocator {
+    pub ctx: *mut c_void,
+    pub alloc: Option<extern "C" fn(ctx: *mut c_void, size: size_t) -> *mut c_void>,
+    pub free: Option<extern "C" fn(ctx: *mut c_void, ptr: *mut c_void, size: size_t)>,
+}
+
+#[cfg(not(any(PyPy, GraalPy)))]
+impl Default for PyObjectArenaAllocator {
+    #[inline]
+    fn default() -> Self {
+        unsafe { std::mem::zeroed() }
+    }
+}
+
+extern "C" {
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn PyObject_GetArenaAllocator(allocator: *mut PyObjectArenaAllocator);
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn PyObject_SetArenaAllocator(allocator: *mut PyObjectArenaAllocator);
+
+    #[cfg(Py_3_9)]
+    pub fn PyObject_IS_GC(o: *mut PyObject) -> c_int;
+}
+
+#[inline]
+#[cfg(not(Py_3_9))]
+pub unsafe fn PyObject_IS_GC(o: *mut PyObject) -> c_int {
+    (crate::PyType_IS_GC(Py_TYPE(o)) != 0
+        && match (*Py_TYPE(o)).tp_is_gc {
+            Some(tp_is_gc) => tp_is_gc(o) != 0,
+            None => true,
+        }) as c_int
+}
+
+#[cfg(not(Py_3_11))]
+extern "C" {
+    pub fn _PyObject_GC_Malloc(size: size_t) -> *mut PyObject;
+    pub fn _PyObject_GC_Calloc(size: size_t) -> *mut PyObject;
+}
+
+#[inline]
+pub unsafe fn PyType_SUPPORTS_WEAKREFS(t: *mut PyTypeObject) -> c_int {
+    ((*t).tp_weaklistoffset > 0) as c_int
+}
+
+#[inline]
+pub unsafe fn PyObject_GET_WEAKREFS_LISTPTR(o: *mut PyObject) -> *mut *mut PyObject {
+    let weaklistoffset = (*Py_TYPE(o)).tp_weaklistoffset;
+    o.offset(weaklistoffset) as *mut *mut PyObject
+}
+
+// skipped PyUnstable_Object_GC_NewWithExtraData
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/pydebug.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/pydebug.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/pydebug.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/pydebug.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,72 @@
+use std::os::raw::{c_char, c_int};
+
+#[cfg(not(Py_LIMITED_API))]
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[deprecated(note = "Python 3.12")]
+    #[cfg_attr(PyPy, link_name = "PyPy_DebugFlag")]
+    pub static mut Py_DebugFlag: c_int;
+    #[deprecated(note = "Python 3.12")]
+    #[cfg_attr(PyPy, link_name = "PyPy_VerboseFlag")]
+    pub static mut Py_VerboseFlag: c_int;
+    #[deprecated(note = "Python 3.12")]
+    pub static mut Py_QuietFlag: c_int;
+    #[deprecated(note = "Python 3.12")]
+    #[cfg_attr(PyPy, link_name = "PyPy_InteractiveFlag")]
+    pub static mut Py_InteractiveFlag: c_int;
+    #[deprecated(note = "Python 3.12")]
+    #[cfg_attr(PyPy, link_name = "PyPy_InspectFlag")]
+    pub static mut Py_InspectFlag: c_int;
+    #[deprecated(note = "Python 3.12")]
+    #[cfg_attr(PyPy, link_name = "PyPy_OptimizeFlag")]
+    pub static mut Py_OptimizeFlag: c_int;
+    #[deprecated(note = "Python 3.12")]
+    #[cfg_attr(PyPy, link_name = "PyPy_NoSiteFlag")]
+    pub static mut Py_NoSiteFlag: c_int;
+    #[deprecated(note = "Python 3.12")]
+    #[cfg_attr(PyPy, link_name = "PyPy_BytesWarningFlag")]
+    pub static mut Py_BytesWarningFlag: c_int;
+    #[deprecated(note = "Python 3.12")]
+    #[cfg_attr(PyPy, link_name = "PyPy_UseClassExceptionsFlag")]
+    pub static mut Py_UseClassExceptionsFlag: c_int;
+    #[deprecated(note = "Python 3.12")]
+    #[cfg_attr(PyPy, link_name = "PyPy_FrozenFlag")]
+    pub static mut Py_FrozenFlag: c_int;
+    #[deprecated(note = "Python 3.12")]
+    #[cfg_attr(PyPy, link_name = "PyPy_IgnoreEnvironmentFlag")]
+    pub static mut Py_IgnoreEnvironmentFlag: c_int;
+    #[deprecated(note = "Python 3.12")]
+    #[cfg_attr(PyPy, link_name = "PyPy_DontWriteBytecodeFlag")]
+    pub static mut Py_DontWriteBytecodeFlag: c_int;
+    #[deprecated(note = "Python 3.12")]
+    #[cfg_attr(PyPy, link_name = "PyPy_NoUserSiteDirectory")]
+    pub static mut Py_NoUserSiteDirectory: c_int;
+    #[deprecated(note = "Python 3.12")]
+    pub static mut Py_UnbufferedStdioFlag: c_int;
+    #[cfg_attr(PyPy, link_name = "PyPy_HashRandomizationFlag")]
+    pub static mut Py_HashRandomizationFlag: c_int;
+    #[deprecated(note = "Python 3.12")]
+    pub static mut Py_IsolatedFlag: c_int;
+    #[cfg(windows)]
+    #[deprecated(note = "Python 3.12")]
+    pub static mut Py_LegacyWindowsFSEncodingFlag: c_int;
+    #[cfg(windows)]
+    #[deprecated(note = "Python 3.12")]
+    pub static mut Py_LegacyWindowsStdioFlag: c_int;
+}
+
+extern "C" {
+    #[cfg(Py_3_11)]
+    pub fn Py_GETENV(name: *const c_char) -> *mut c_char;
+}
+
+#[cfg(not(Py_3_11))]
+#[inline(always)]
+pub unsafe fn Py_GETENV(name: *const c_char) -> *mut c_char {
+    #[allow(deprecated)]
+    if Py_IgnoreEnvironmentFlag != 0 {
+        std::ptr::null_mut()
+    } else {
+        libc::getenv(name)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/pyerrors.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/pyerrors.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/pyerrors.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/pyerrors.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,191 @@
+use crate::PyObject;
+#[cfg(not(any(PyPy, GraalPy)))]
+use crate::Py_ssize_t;
+
+#[repr(C)]
+#[derive(Debug)]
+pub struct PyBaseExceptionObject {
+    pub ob_base: PyObject,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub dict: *mut PyObject,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub args: *mut PyObject,
+    #[cfg(all(Py_3_11, not(any(PyPy, GraalPy))))]
+    pub notes: *mut PyObject,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub traceback: *mut PyObject,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub context: *mut PyObject,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub cause: *mut PyObject,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub suppress_context: char,
+}
+
+#[cfg(not(any(PyPy, GraalPy)))]
+#[repr(C)]
+#[derive(Debug)]
+pub struct PySyntaxErrorObject {
+    pub ob_base: PyObject,
+    pub dict: *mut PyObject,
+    pub args: *mut PyObject,
+    #[cfg(Py_3_11)]
+    pub notes: *mut PyObject,
+    pub traceback: *mut PyObject,
+    pub context: *mut PyObject,
+    pub cause: *mut PyObject,
+    pub suppress_context: char,
+
+    pub msg: *mut PyObject,
+    pub filename: *mut PyObject,
+    pub lineno: *mut PyObject,
+    pub offset: *mut PyObject,
+    #[cfg(Py_3_10)]
+    pub end_lineno: *mut PyObject,
+    #[cfg(Py_3_10)]
+    pub end_offset: *mut PyObject,
+    pub text: *mut PyObject,
+    pub print_file_and_line: *mut PyObject,
+}
+
+#[cfg(not(any(PyPy, GraalPy)))]
+#[repr(C)]
+#[derive(Debug)]
+pub struct PyImportErrorObject {
+    pub ob_base: PyObject,
+    pub dict: *mut PyObject,
+    pub args: *mut PyObject,
+    #[cfg(Py_3_11)]
+    pub notes: *mut PyObject,
+    pub traceback: *mut PyObject,
+    pub context: *mut PyObject,
+    pub cause: *mut PyObject,
+    pub suppress_context: char,
+
+    pub msg: *mut PyObject,
+    pub name: *mut PyObject,
+    pub path: *mut PyObject,
+    #[cfg(Py_3_12)]
+    pub name_from: *mut PyObject,
+}
+
+#[cfg(not(any(PyPy, GraalPy)))]
+#[repr(C)]
+#[derive(Debug)]
+pub struct PyUnicodeErrorObject {
+    pub ob_base: PyObject,
+    pub dict: *mut PyObject,
+    pub args: *mut PyObject,
+    #[cfg(Py_3_11)]
+    pub notes: *mut PyObject,
+    pub traceback: *mut PyObject,
+    pub context: *mut PyObject,
+    pub cause: *mut PyObject,
+    pub suppress_context: char,
+
+    pub encoding: *mut PyObject,
+    pub object: *mut PyObject,
+    pub start: Py_ssize_t,
+    pub end: Py_ssize_t,
+    pub reason: *mut PyObject,
+}
+
+#[cfg(not(any(PyPy, GraalPy)))]
+#[repr(C)]
+#[derive(Debug)]
+pub struct PySystemExitObject {
+    pub ob_base: PyObject,
+    pub dict: *mut PyObject,
+    pub args: *mut PyObject,
+    #[cfg(Py_3_11)]
+    pub notes: *mut PyObject,
+    pub traceback: *mut PyObject,
+    pub context: *mut PyObject,
+    pub cause: *mut PyObject,
+    pub suppress_context: char,
+
+    pub code: *mut PyObject,
+}
+
+#[cfg(not(any(PyPy, GraalPy)))]
+#[repr(C)]
+#[derive(Debug)]
+pub struct PyOSErrorObject {
+    pub ob_base: PyObject,
+    pub dict: *mut PyObject,
+    pub args: *mut PyObject,
+    #[cfg(Py_3_11)]
+    pub notes: *mut PyObject,
+    pub traceback: *mut PyObject,
+    pub context: *mut PyObject,
+    pub cause: *mut PyObject,
+    pub suppress_context: char,
+
+    pub myerrno: *mut PyObject,
+    pub strerror: *mut PyObject,
+    pub filename: *mut PyObject,
+    pub filename2: *mut PyObject,
+    #[cfg(windows)]
+    pub winerror: *mut PyObject,
+    pub written: Py_ssize_t,
+}
+
+#[repr(C)]
+#[derive(Debug)]
+pub struct PyStopIterationObject {
+    pub ob_base: PyObject,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub dict: *mut PyObject,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub args: *mut PyObject,
+    #[cfg(all(Py_3_11, not(any(PyPy, GraalPy))))]
+    pub notes: *mut PyObject,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub traceback: *mut PyObject,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub context: *mut PyObject,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub cause: *mut PyObject,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub suppress_context: char,
+
+    pub value: *mut PyObject,
+}
+
+extern "C" {
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn _PyErr_ChainExceptions(typ: *mut PyObject, val: *mut PyObject, tb: *mut PyObject);
+}
+
+// skipped PyNameErrorObject
+// skipped PyAttributeErrorObject
+
+// skipped PyEnvironmentErrorObject
+// skipped PyWindowsErrorObject
+
+// skipped _PyErr_SetKeyError
+// skipped _PyErr_GetTopmostException
+// skipped _PyErr_GetExcInfo
+
+// skipped PyErr_SetFromErrnoWithUnicodeFilename
+
+// skipped _PyErr_FormatFromCause
+
+// skipped PyErr_SetFromWindowsErrWithUnicodeFilename
+// skipped PyErr_SetExcFromWindowsErrWithUnicodeFilename
+
+// skipped _PyErr_TrySetFromCause
+
+// skipped PySignal_SetWakeupFd
+// skipped _PyErr_CheckSignals
+
+// skipped PyErr_SyntaxLocationObject
+// skipped PyErr_RangedSyntaxLocationObject
+// skipped PyErr_ProgramTextObject
+
+// skipped _PyErr_ProgramDecodedTextObject
+// skipped _PyUnicodeTranslateError_Create
+// skipped _PyErr_WriteUnraisableMsg
+// skipped _Py_FatalErrorFunc
+// skipped _Py_FatalErrorFormat
+// skipped Py_FatalError
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/pyframe.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/pyframe.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/pyframe.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/pyframe.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,2 @@
+#[cfg(Py_3_11)]
+opaque_struct!(_PyInterpreterFrame);
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/pylifecycle.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/pylifecycle.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/pylifecycle.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/pylifecycle.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,99 @@
+use crate::{PyConfig, PyPreConfig, PyStatus, Py_ssize_t};
+use libc::wchar_t;
+use std::os::raw::{c_char, c_int};
+
+// "private" functions in cpython/pylifecycle.h accepted in PEP 587
+extern "C" {
+    // skipped _Py_SetStandardStreamEncoding;
+    pub fn Py_PreInitialize(src_config: *const PyPreConfig) -> PyStatus;
+    pub fn Py_PreInitializeFromBytesArgs(
+        src_config: *const PyPreConfig,
+        argc: Py_ssize_t,
+        argv: *mut *mut c_char,
+    ) -> PyStatus;
+    pub fn Py_PreInitializeFromArgs(
+        src_config: *const PyPreConfig,
+        argc: Py_ssize_t,
+        argv: *mut *mut wchar_t,
+    ) -> PyStatus;
+    pub fn _Py_IsCoreInitialized() -> c_int;
+
+    pub fn Py_InitializeFromConfig(config: *const PyConfig) -> PyStatus;
+    pub fn _Py_InitializeMain() -> PyStatus;
+
+    pub fn Py_RunMain() -> c_int;
+
+    pub fn Py_ExitStatusException(status: PyStatus) -> !;
+
+    // skipped _Py_RestoreSignals
+
+    // skipped Py_FdIsInteractive
+    // skipped _Py_FdIsInteractive
+
+    // skipped _Py_SetProgramFullPath
+
+    // skipped _Py_gitidentifier
+    // skipped _Py_getversion
+
+    // skipped _Py_IsFinalizing
+
+    // skipped _PyOS_URandom
+    // skipped _PyOS_URandomNonblock
+
+    // skipped _Py_CoerceLegacyLocale
+    // skipped _Py_LegacyLocaleDetected
+    // skipped _Py_SetLocaleFromEnv
+
+}
+
+#[cfg(Py_3_12)]
+pub const PyInterpreterConfig_DEFAULT_GIL: c_int = 0;
+#[cfg(Py_3_12)]
+pub const PyInterpreterConfig_SHARED_GIL: c_int = 1;
+#[cfg(Py_3_12)]
+pub const PyInterpreterConfig_OWN_GIL: c_int = 2;
+
+#[cfg(Py_3_12)]
+#[repr(C)]
+pub struct PyInterpreterConfig {
+    pub use_main_obmalloc: c_int,
+    pub allow_fork: c_int,
+    pub allow_exec: c_int,
+    pub allow_threads: c_int,
+    pub allow_daemon_threads: c_int,
+    pub check_multi_interp_extensions: c_int,
+    pub gil: c_int,
+}
+
+#[cfg(Py_3_12)]
+pub const _PyInterpreterConfig_INIT: PyInterpreterConfig = PyInterpreterConfig {
+    use_main_obmalloc: 0,
+    allow_fork: 0,
+    allow_exec: 0,
+    allow_threads: 1,
+    allow_daemon_threads: 0,
+    check_multi_interp_extensions: 1,
+    gil: PyInterpreterConfig_OWN_GIL,
+};
+
+#[cfg(Py_3_12)]
+pub const _PyInterpreterConfig_LEGACY_INIT: PyInterpreterConfig = PyInterpreterConfig {
+    use_main_obmalloc: 1,
+    allow_fork: 1,
+    allow_exec: 1,
+    allow_threads: 1,
+    allow_daemon_threads: 1,
+    check_multi_interp_extensions: 0,
+    gil: PyInterpreterConfig_SHARED_GIL,
+};
+
+extern "C" {
+    #[cfg(Py_3_12)]
+    pub fn Py_NewInterpreterFromConfig(
+        tstate_p: *mut *mut crate::PyThreadState,
+        config: *const PyInterpreterConfig,
+    ) -> PyStatus;
+}
+
+// skipped atexit_datacallbackfunc
+// skipped _Py_AtExit
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/pymem.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/pymem.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/pymem.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/pymem.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,49 @@
+use libc::size_t;
+use std::os::raw::c_void;
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyMem_RawMalloc")]
+    pub fn PyMem_RawMalloc(size: size_t) -> *mut c_void;
+    #[cfg_attr(PyPy, link_name = "PyPyMem_RawCalloc")]
+    pub fn PyMem_RawCalloc(nelem: size_t, elsize: size_t) -> *mut c_void;
+    #[cfg_attr(PyPy, link_name = "PyPyMem_RawRealloc")]
+    pub fn PyMem_RawRealloc(ptr: *mut c_void, new_size: size_t) -> *mut c_void;
+    #[cfg_attr(PyPy, link_name = "PyPyMem_RawFree")]
+    pub fn PyMem_RawFree(ptr: *mut c_void);
+
+    // skipped _PyMem_GetCurrentAllocatorName
+    // skipped _PyMem_RawStrdup
+    // skipped _PyMem_Strdup
+    // skipped _PyMem_RawWcsdup
+}
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub enum PyMemAllocatorDomain {
+    PYMEM_DOMAIN_RAW,
+    PYMEM_DOMAIN_MEM,
+    PYMEM_DOMAIN_OBJ,
+}
+
+// skipped PyMemAllocatorName
+#[cfg(not(any(PyPy, GraalPy)))]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyMemAllocatorEx {
+    pub ctx: *mut c_void,
+    pub malloc: Option<extern "C" fn(ctx: *mut c_void, size: size_t) -> *mut c_void>,
+    pub calloc:
+        Option<extern "C" fn(ctx: *mut c_void, nelem: size_t, elsize: size_t) -> *mut c_void>,
+    pub realloc:
+        Option<extern "C" fn(ctx: *mut c_void, ptr: *mut c_void, new_size: size_t) -> *mut c_void>,
+    pub free: Option<extern "C" fn(ctx: *mut c_void, ptr: *mut c_void)>,
+}
+
+extern "C" {
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn PyMem_GetAllocator(domain: PyMemAllocatorDomain, allocator: *mut PyMemAllocatorEx);
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn PyMem_SetAllocator(domain: PyMemAllocatorDomain, allocator: *mut PyMemAllocatorEx);
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn PyMem_SetupDebugHooks();
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/pystate.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/pystate.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/pystate.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/pystate.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,112 @@
+#[cfg(not(PyPy))]
+use crate::PyThreadState;
+use crate::{PyFrameObject, PyInterpreterState, PyObject};
+use std::os::raw::c_int;
+
+// skipped _PyInterpreterState_RequiresIDRef
+// skipped _PyInterpreterState_RequireIDRef
+
+// skipped _PyInterpreterState_GetMainModule
+
+pub type Py_tracefunc = unsafe extern "C" fn(
+    obj: *mut PyObject,
+    frame: *mut PyFrameObject,
+    what: c_int,
+    arg: *mut PyObject,
+) -> c_int;
+
+pub const PyTrace_CALL: c_int = 0;
+pub const PyTrace_EXCEPTION: c_int = 1;
+pub const PyTrace_LINE: c_int = 2;
+pub const PyTrace_RETURN: c_int = 3;
+pub const PyTrace_C_CALL: c_int = 4;
+pub const PyTrace_C_EXCEPTION: c_int = 5;
+pub const PyTrace_C_RETURN: c_int = 6;
+pub const PyTrace_OPCODE: c_int = 7;
+
+// skipped PyTraceInfo
+// skipped CFrame
+
+#[cfg(not(PyPy))]
+#[repr(C)]
+#[derive(Clone, Copy)]
+pub struct _PyErr_StackItem {
+    #[cfg(not(Py_3_11))]
+    pub exc_type: *mut PyObject,
+    pub exc_value: *mut PyObject,
+    #[cfg(not(Py_3_11))]
+    pub exc_traceback: *mut PyObject,
+    pub previous_item: *mut _PyErr_StackItem,
+}
+
+// skipped _PyStackChunk
+// skipped _ts (aka PyThreadState)
+
+extern "C" {
+    // skipped _PyThreadState_Prealloc
+    // skipped _PyThreadState_UncheckedGet
+    // skipped _PyThreadState_GetDict
+
+    #[cfg_attr(PyPy, link_name = "PyPyGILState_Check")]
+    pub fn PyGILState_Check() -> c_int;
+
+    // skipped _PyGILState_GetInterpreterStateUnsafe
+    // skipped _PyThread_CurrentFrames
+    // skipped _PyThread_CurrentExceptions
+
+    #[cfg(not(PyPy))]
+    pub fn PyInterpreterState_Main() -> *mut PyInterpreterState;
+    #[cfg_attr(PyPy, link_name = "PyPyInterpreterState_Head")]
+    pub fn PyInterpreterState_Head() -> *mut PyInterpreterState;
+    #[cfg_attr(PyPy, link_name = "PyPyInterpreterState_Next")]
+    pub fn PyInterpreterState_Next(interp: *mut PyInterpreterState) -> *mut PyInterpreterState;
+    #[cfg(not(PyPy))]
+    pub fn PyInterpreterState_ThreadHead(interp: *mut PyInterpreterState) -> *mut PyThreadState;
+    #[cfg(not(PyPy))]
+    pub fn PyThreadState_Next(tstate: *mut PyThreadState) -> *mut PyThreadState;
+
+    #[cfg_attr(PyPy, link_name = "PyPyThreadState_DeleteCurrent")]
+    pub fn PyThreadState_DeleteCurrent();
+}
+
+#[cfg(all(Py_3_9, not(Py_3_11)))]
+pub type _PyFrameEvalFunction = extern "C" fn(
+    *mut crate::PyThreadState,
+    *mut crate::PyFrameObject,
+    c_int,
+) -> *mut crate::object::PyObject;
+
+#[cfg(Py_3_11)]
+pub type _PyFrameEvalFunction = extern "C" fn(
+    *mut crate::PyThreadState,
+    *mut crate::_PyInterpreterFrame,
+    c_int,
+) -> *mut crate::object::PyObject;
+
+#[cfg(Py_3_9)]
+extern "C" {
+    /// Get the frame evaluation function.
+    pub fn _PyInterpreterState_GetEvalFrameFunc(
+        interp: *mut PyInterpreterState,
+    ) -> _PyFrameEvalFunction;
+
+    ///Set the frame evaluation function.
+    pub fn _PyInterpreterState_SetEvalFrameFunc(
+        interp: *mut PyInterpreterState,
+        eval_frame: _PyFrameEvalFunction,
+    );
+}
+
+// skipped _PyInterpreterState_GetConfig
+// skipped _PyInterpreterState_GetConfigCopy
+// skipped _PyInterpreterState_SetConfig
+// skipped _Py_GetConfig
+
+// skipped _PyCrossInterpreterData
+// skipped _PyObject_GetCrossInterpreterData
+// skipped _PyCrossInterpreterData_NewObject
+// skipped _PyCrossInterpreterData_Release
+// skipped _PyObject_CheckCrossInterpreterData
+// skipped crossinterpdatafunc
+// skipped _PyCrossInterpreterData_RegisterClass
+// skipped _PyCrossInterpreterData_Lookup
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/pythonrun.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/pythonrun.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/pythonrun.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/pythonrun.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,250 @@
+use crate::object::*;
+#[cfg(not(any(PyPy, GraalPy, Py_LIMITED_API, Py_3_10)))]
+use crate::pyarena::PyArena;
+use crate::PyCompilerFlags;
+#[cfg(not(any(PyPy, GraalPy, Py_3_10)))]
+use crate::{_mod, _node};
+use libc::FILE;
+use std::os::raw::{c_char, c_int};
+
+extern "C" {
+    pub fn PyRun_SimpleStringFlags(arg1: *const c_char, arg2: *mut PyCompilerFlags) -> c_int;
+    pub fn _PyRun_SimpleFileObject(
+        fp: *mut FILE,
+        filename: *mut PyObject,
+        closeit: c_int,
+        flags: *mut PyCompilerFlags,
+    ) -> c_int;
+    pub fn PyRun_AnyFileExFlags(
+        fp: *mut FILE,
+        filename: *const c_char,
+        closeit: c_int,
+        flags: *mut PyCompilerFlags,
+    ) -> c_int;
+    pub fn _PyRun_AnyFileObject(
+        fp: *mut FILE,
+        filename: *mut PyObject,
+        closeit: c_int,
+        flags: *mut PyCompilerFlags,
+    ) -> c_int;
+    pub fn PyRun_SimpleFileExFlags(
+        fp: *mut FILE,
+        filename: *const c_char,
+        closeit: c_int,
+        flags: *mut PyCompilerFlags,
+    ) -> c_int;
+    pub fn PyRun_InteractiveOneFlags(
+        fp: *mut FILE,
+        filename: *const c_char,
+        flags: *mut PyCompilerFlags,
+    ) -> c_int;
+    pub fn PyRun_InteractiveOneObject(
+        fp: *mut FILE,
+        filename: *mut PyObject,
+        flags: *mut PyCompilerFlags,
+    ) -> c_int;
+    pub fn PyRun_InteractiveLoopFlags(
+        fp: *mut FILE,
+        filename: *const c_char,
+        flags: *mut PyCompilerFlags,
+    ) -> c_int;
+    pub fn _PyRun_InteractiveLoopObject(
+        fp: *mut FILE,
+        filename: *mut PyObject,
+        flags: *mut PyCompilerFlags,
+    ) -> c_int;
+
+    #[cfg(not(any(PyPy, GraalPy, Py_3_10)))]
+    pub fn PyParser_ASTFromString(
+        s: *const c_char,
+        filename: *const c_char,
+        start: c_int,
+        flags: *mut PyCompilerFlags,
+        arena: *mut PyArena,
+    ) -> *mut _mod;
+    #[cfg(not(any(PyPy, GraalPy, Py_3_10)))]
+    pub fn PyParser_ASTFromStringObject(
+        s: *const c_char,
+        filename: *mut PyObject,
+        start: c_int,
+        flags: *mut PyCompilerFlags,
+        arena: *mut PyArena,
+    ) -> *mut _mod;
+    #[cfg(not(any(PyPy, GraalPy, Py_3_10)))]
+    pub fn PyParser_ASTFromFile(
+        fp: *mut FILE,
+        filename: *const c_char,
+        enc: *const c_char,
+        start: c_int,
+        ps1: *const c_char,
+        ps2: *const c_char,
+        flags: *mut PyCompilerFlags,
+        errcode: *mut c_int,
+        arena: *mut PyArena,
+    ) -> *mut _mod;
+    #[cfg(not(any(PyPy, GraalPy, Py_3_10)))]
+    pub fn PyParser_ASTFromFileObject(
+        fp: *mut FILE,
+        filename: *mut PyObject,
+        enc: *const c_char,
+        start: c_int,
+        ps1: *const c_char,
+        ps2: *const c_char,
+        flags: *mut PyCompilerFlags,
+        errcode: *mut c_int,
+        arena: *mut PyArena,
+    ) -> *mut _mod;
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyRun_StringFlags")]
+    pub fn PyRun_StringFlags(
+        arg1: *const c_char,
+        arg2: c_int,
+        arg3: *mut PyObject,
+        arg4: *mut PyObject,
+        arg5: *mut PyCompilerFlags,
+    ) -> *mut PyObject;
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn PyRun_FileExFlags(
+        fp: *mut FILE,
+        filename: *const c_char,
+        start: c_int,
+        globals: *mut PyObject,
+        locals: *mut PyObject,
+        closeit: c_int,
+        flags: *mut PyCompilerFlags,
+    ) -> *mut PyObject;
+
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn Py_CompileStringExFlags(
+        str: *const c_char,
+        filename: *const c_char,
+        start: c_int,
+        flags: *mut PyCompilerFlags,
+        optimize: c_int,
+    ) -> *mut PyObject;
+    #[cfg(not(Py_LIMITED_API))]
+    pub fn Py_CompileStringObject(
+        str: *const c_char,
+        filename: *mut PyObject,
+        start: c_int,
+        flags: *mut PyCompilerFlags,
+        optimize: c_int,
+    ) -> *mut PyObject;
+}
+
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+pub unsafe fn Py_CompileString(string: *const c_char, p: *const c_char, s: c_int) -> *mut PyObject {
+    Py_CompileStringExFlags(string, p, s, std::ptr::null_mut(), -1)
+}
+
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+pub unsafe fn Py_CompileStringFlags(
+    string: *const c_char,
+    p: *const c_char,
+    s: c_int,
+    f: *mut PyCompilerFlags,
+) -> *mut PyObject {
+    Py_CompileStringExFlags(string, p, s, f, -1)
+}
+
+// skipped _Py_SourceAsString
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyRun_String")]
+    pub fn PyRun_String(
+        string: *const c_char,
+        s: c_int,
+        g: *mut PyObject,
+        l: *mut PyObject,
+    ) -> *mut PyObject;
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn PyRun_AnyFile(fp: *mut FILE, name: *const c_char) -> c_int;
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn PyRun_AnyFileEx(fp: *mut FILE, name: *const c_char, closeit: c_int) -> c_int;
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn PyRun_AnyFileFlags(
+        arg1: *mut FILE,
+        arg2: *const c_char,
+        arg3: *mut PyCompilerFlags,
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyRun_SimpleString")]
+    pub fn PyRun_SimpleString(s: *const c_char) -> c_int;
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn PyRun_SimpleFile(f: *mut FILE, p: *const c_char) -> c_int;
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn PyRun_SimpleFileEx(f: *mut FILE, p: *const c_char, c: c_int) -> c_int;
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn PyRun_InteractiveOne(f: *mut FILE, p: *const c_char) -> c_int;
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn PyRun_InteractiveLoop(f: *mut FILE, p: *const c_char) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyRun_File")]
+    pub fn PyRun_File(
+        fp: *mut FILE,
+        p: *const c_char,
+        s: c_int,
+        g: *mut PyObject,
+        l: *mut PyObject,
+    ) -> *mut PyObject;
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn PyRun_FileEx(
+        fp: *mut FILE,
+        p: *const c_char,
+        s: c_int,
+        g: *mut PyObject,
+        l: *mut PyObject,
+        c: c_int,
+    ) -> *mut PyObject;
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn PyRun_FileFlags(
+        fp: *mut FILE,
+        p: *const c_char,
+        s: c_int,
+        g: *mut PyObject,
+        l: *mut PyObject,
+        flags: *mut PyCompilerFlags,
+    ) -> *mut PyObject;
+}
+
+// skipped macro PyRun_String
+// skipped macro PyRun_AnyFile
+// skipped macro PyRun_AnyFileEx
+// skipped macro PyRun_AnyFileFlags
+
+extern "C" {
+    #[cfg(not(any(PyPy, GraalPy, Py_3_10)))]
+    #[cfg_attr(Py_3_9, deprecated(note = "Python 3.9"))]
+    pub fn PyParser_SimpleParseStringFlags(
+        arg1: *const c_char,
+        arg2: c_int,
+        arg3: c_int,
+    ) -> *mut _node;
+    #[cfg(not(any(PyPy, GraalPy, Py_3_10)))]
+    #[cfg_attr(Py_3_9, deprecated(note = "Python 3.9"))]
+    pub fn PyParser_SimpleParseStringFlagsFilename(
+        arg1: *const c_char,
+        arg2: *const c_char,
+        arg3: c_int,
+        arg4: c_int,
+    ) -> *mut _node;
+    #[cfg(not(any(PyPy, GraalPy, Py_3_10)))]
+    #[cfg_attr(Py_3_9, deprecated(note = "Python 3.9"))]
+    pub fn PyParser_SimpleParseFileFlags(
+        arg1: *mut FILE,
+        arg2: *const c_char,
+        arg3: c_int,
+        arg4: c_int,
+    ) -> *mut _node;
+
+    #[cfg(PyPy)]
+    #[cfg_attr(PyPy, link_name = "PyPy_CompileStringFlags")]
+    pub fn Py_CompileStringFlags(
+        string: *const c_char,
+        p: *const c_char,
+        s: c_int,
+        f: *mut PyCompilerFlags,
+    ) -> *mut PyObject;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/tupleobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/tupleobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/tupleobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/tupleobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,38 @@
+use crate::object::*;
+#[cfg(not(PyPy))]
+use crate::pyport::Py_ssize_t;
+
+#[repr(C)]
+pub struct PyTupleObject {
+    pub ob_base: PyVarObject,
+    #[cfg(not(GraalPy))]
+    pub ob_item: [*mut PyObject; 1],
+}
+
+// skipped _PyTuple_Resize
+// skipped _PyTuple_MaybeUntrack
+
+/// Macro, trading safety for speed
+
+// skipped _PyTuple_CAST
+
+#[inline]
+#[cfg(not(PyPy))]
+pub unsafe fn PyTuple_GET_SIZE(op: *mut PyObject) -> Py_ssize_t {
+    Py_SIZE(op)
+}
+
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+pub unsafe fn PyTuple_GET_ITEM(op: *mut PyObject, i: Py_ssize_t) -> *mut PyObject {
+    *(*(op as *mut PyTupleObject)).ob_item.as_ptr().offset(i)
+}
+
+/// Macro, *only* to be used to fill in brand new tuples
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+pub unsafe fn PyTuple_SET_ITEM(op: *mut PyObject, i: Py_ssize_t, v: *mut PyObject) {
+    *(*(op as *mut PyTupleObject)).ob_item.as_mut_ptr().offset(i) = v;
+}
+
+// skipped _PyTuple_DebugMallocStats
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/unicodeobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/unicodeobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/unicodeobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/unicodeobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,795 @@
+#[cfg(not(any(PyPy, GraalPy)))]
+use crate::Py_hash_t;
+use crate::{PyObject, Py_UCS1, Py_UCS2, Py_UCS4, Py_UNICODE, Py_ssize_t};
+#[cfg(not(any(Py_3_12, GraalPy)))]
+use libc::wchar_t;
+use std::os::raw::{c_char, c_int, c_uint, c_void};
+
+// skipped Py_UNICODE_ISSPACE()
+// skipped Py_UNICODE_ISLOWER()
+// skipped Py_UNICODE_ISUPPER()
+// skipped Py_UNICODE_ISTITLE()
+// skipped Py_UNICODE_ISLINEBREAK
+// skipped Py_UNICODE_TOLOWER
+// skipped Py_UNICODE_TOUPPER
+// skipped Py_UNICODE_TOTITLE
+// skipped Py_UNICODE_ISDECIMAL
+// skipped Py_UNICODE_ISDIGIT
+// skipped Py_UNICODE_ISNUMERIC
+// skipped Py_UNICODE_ISPRINTABLE
+// skipped Py_UNICODE_TODECIMAL
+// skipped Py_UNICODE_TODIGIT
+// skipped Py_UNICODE_TONUMERIC
+// skipped Py_UNICODE_ISALPHA
+// skipped Py_UNICODE_ISALNUM
+// skipped Py_UNICODE_COPY
+// skipped Py_UNICODE_FILL
+// skipped Py_UNICODE_IS_SURROGATE
+// skipped Py_UNICODE_IS_HIGH_SURROGATE
+// skipped Py_UNICODE_IS_LOW_SURROGATE
+// skipped Py_UNICODE_JOIN_SURROGATES
+// skipped Py_UNICODE_HIGH_SURROGATE
+// skipped Py_UNICODE_LOW_SURROGATE
+
+// generated by bindgen v0.63.0 (with small adaptations)
+#[repr(C)]
+struct BitfieldUnit<Storage> {
+    storage: Storage,
+}
+
+impl<Storage> BitfieldUnit<Storage> {
+    #[inline]
+    pub const fn new(storage: Storage) -> Self {
+        Self { storage }
+    }
+}
+
+#[cfg(not(GraalPy))]
+impl<Storage> BitfieldUnit<Storage>
+where
+    Storage: AsRef<[u8]> + AsMut<[u8]>,
+{
+    #[inline]
+    fn get_bit(&self, index: usize) -> bool {
+        debug_assert!(index / 8 < self.storage.as_ref().len());
+        let byte_index = index / 8;
+        let byte = self.storage.as_ref()[byte_index];
+        let bit_index = if cfg!(target_endian = "big") {
+            7 - (index % 8)
+        } else {
+            index % 8
+        };
+        let mask = 1 << bit_index;
+        byte & mask == mask
+    }
+
+    #[inline]
+    fn set_bit(&mut self, index: usize, val: bool) {
+        debug_assert!(index / 8 < self.storage.as_ref().len());
+        let byte_index = index / 8;
+        let byte = &mut self.storage.as_mut()[byte_index];
+        let bit_index = if cfg!(target_endian = "big") {
+            7 - (index % 8)
+        } else {
+            index % 8
+        };
+        let mask = 1 << bit_index;
+        if val {
+            *byte |= mask;
+        } else {
+            *byte &= !mask;
+        }
+    }
+
+    #[inline]
+    fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
+        debug_assert!(bit_width <= 64);
+        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
+        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
+        let mut val = 0;
+        for i in 0..(bit_width as usize) {
+            if self.get_bit(i + bit_offset) {
+                let index = if cfg!(target_endian = "big") {
+                    bit_width as usize - 1 - i
+                } else {
+                    i
+                };
+                val |= 1 << index;
+            }
+        }
+        val
+    }
+
+    #[inline]
+    fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
+        debug_assert!(bit_width <= 64);
+        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
+        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
+        for i in 0..(bit_width as usize) {
+            let mask = 1 << i;
+            let val_bit_is_set = val & mask == mask;
+            let index = if cfg!(target_endian = "big") {
+                bit_width as usize - 1 - i
+            } else {
+                i
+            };
+            self.set_bit(index + bit_offset, val_bit_is_set);
+        }
+    }
+}
+
+#[cfg(not(GraalPy))]
+const STATE_INTERNED_INDEX: usize = 0;
+#[cfg(not(GraalPy))]
+const STATE_INTERNED_WIDTH: u8 = 2;
+
+#[cfg(not(GraalPy))]
+const STATE_KIND_INDEX: usize = STATE_INTERNED_WIDTH as usize;
+#[cfg(not(GraalPy))]
+const STATE_KIND_WIDTH: u8 = 3;
+
+#[cfg(not(GraalPy))]
+const STATE_COMPACT_INDEX: usize = (STATE_INTERNED_WIDTH + STATE_KIND_WIDTH) as usize;
+#[cfg(not(GraalPy))]
+const STATE_COMPACT_WIDTH: u8 = 1;
+
+#[cfg(not(GraalPy))]
+const STATE_ASCII_INDEX: usize =
+    (STATE_INTERNED_WIDTH + STATE_KIND_WIDTH + STATE_COMPACT_WIDTH) as usize;
+#[cfg(not(GraalPy))]
+const STATE_ASCII_WIDTH: u8 = 1;
+
+#[cfg(not(any(Py_3_12, GraalPy)))]
+const STATE_READY_INDEX: usize =
+    (STATE_INTERNED_WIDTH + STATE_KIND_WIDTH + STATE_COMPACT_WIDTH + STATE_ASCII_WIDTH) as usize;
+#[cfg(not(any(Py_3_12, GraalPy)))]
+const STATE_READY_WIDTH: u8 = 1;
+
+// generated by bindgen v0.63.0 (with small adaptations)
+// The same code is generated for Python 3.7, 3.8, 3.9, 3.10, and 3.11, but the "ready" field
+// has been removed from Python 3.12.
+
+/// Wrapper around the `PyASCIIObject.state` bitfield with getters and setters that work
+/// on most little- and big-endian architectures.
+///
+/// Memory layout of C bitfields is implementation defined, so these functions are still
+/// unsafe. Users must verify that they work as expected on the architectures they target.
+#[repr(C)]
+#[repr(align(4))]
+struct PyASCIIObjectState {
+    bitfield_align: [u8; 0],
+    bitfield: BitfieldUnit<[u8; 4usize]>,
+}
+
+// c_uint and u32 are not necessarily the same type on all targets / architectures
+#[cfg(not(GraalPy))]
+#[allow(clippy::useless_transmute)]
+impl PyASCIIObjectState {
+    #[inline]
+    unsafe fn interned(&self) -> c_uint {
+        std::mem::transmute(
+            self.bitfield
+                .get(STATE_INTERNED_INDEX, STATE_INTERNED_WIDTH) as u32,
+        )
+    }
+
+    #[inline]
+    unsafe fn set_interned(&mut self, val: c_uint) {
+        let val: u32 = std::mem::transmute(val);
+        self.bitfield
+            .set(STATE_INTERNED_INDEX, STATE_INTERNED_WIDTH, val as u64)
+    }
+
+    #[inline]
+    unsafe fn kind(&self) -> c_uint {
+        std::mem::transmute(self.bitfield.get(STATE_KIND_INDEX, STATE_KIND_WIDTH) as u32)
+    }
+
+    #[inline]
+    unsafe fn set_kind(&mut self, val: c_uint) {
+        let val: u32 = std::mem::transmute(val);
+        self.bitfield
+            .set(STATE_KIND_INDEX, STATE_KIND_WIDTH, val as u64)
+    }
+
+    #[inline]
+    unsafe fn compact(&self) -> c_uint {
+        std::mem::transmute(self.bitfield.get(STATE_COMPACT_INDEX, STATE_COMPACT_WIDTH) as u32)
+    }
+
+    #[inline]
+    unsafe fn set_compact(&mut self, val: c_uint) {
+        let val: u32 = std::mem::transmute(val);
+        self.bitfield
+            .set(STATE_COMPACT_INDEX, STATE_COMPACT_WIDTH, val as u64)
+    }
+
+    #[inline]
+    unsafe fn ascii(&self) -> c_uint {
+        std::mem::transmute(self.bitfield.get(STATE_ASCII_INDEX, STATE_ASCII_WIDTH) as u32)
+    }
+
+    #[inline]
+    unsafe fn set_ascii(&mut self, val: c_uint) {
+        let val: u32 = std::mem::transmute(val);
+        self.bitfield
+            .set(STATE_ASCII_INDEX, STATE_ASCII_WIDTH, val as u64)
+    }
+
+    #[cfg(not(Py_3_12))]
+    #[inline]
+    unsafe fn ready(&self) -> c_uint {
+        std::mem::transmute(self.bitfield.get(STATE_READY_INDEX, STATE_READY_WIDTH) as u32)
+    }
+
+    #[cfg(not(Py_3_12))]
+    #[inline]
+    unsafe fn set_ready(&mut self, val: c_uint) {
+        let val: u32 = std::mem::transmute(val);
+        self.bitfield
+            .set(STATE_READY_INDEX, STATE_READY_WIDTH, val as u64)
+    }
+}
+
+impl From<u32> for PyASCIIObjectState {
+    #[inline]
+    fn from(value: u32) -> Self {
+        PyASCIIObjectState {
+            bitfield_align: [],
+            bitfield: BitfieldUnit::new(value.to_ne_bytes()),
+        }
+    }
+}
+
+impl From<PyASCIIObjectState> for u32 {
+    #[inline]
+    fn from(value: PyASCIIObjectState) -> Self {
+        u32::from_ne_bytes(value.bitfield.storage)
+    }
+}
+
+#[repr(C)]
+pub struct PyASCIIObject {
+    pub ob_base: PyObject,
+    #[cfg(not(GraalPy))]
+    pub length: Py_ssize_t,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub hash: Py_hash_t,
+    /// A bit field with various properties.
+    ///
+    /// Rust doesn't expose bitfields. So we have accessor functions for
+    /// retrieving values.
+    ///
+    /// unsigned int interned:2; // SSTATE_* constants.
+    /// unsigned int kind:3;     // PyUnicode_*_KIND constants.
+    /// unsigned int compact:1;
+    /// unsigned int ascii:1;
+    /// unsigned int ready:1;
+    /// unsigned int :24;
+    #[cfg(not(GraalPy))]
+    pub state: u32,
+    #[cfg(not(any(Py_3_12, GraalPy)))]
+    pub wstr: *mut wchar_t,
+}
+
+/// Interacting with the bitfield is not actually well-defined, so we mark these APIs unsafe.
+#[cfg(not(GraalPy))]
+impl PyASCIIObject {
+    #[cfg_attr(not(Py_3_12), allow(rustdoc::broken_intra_doc_links))] // SSTATE_INTERNED_IMMORTAL_STATIC requires 3.12
+    /// Get the `interned` field of the [`PyASCIIObject`] state bitfield.
+    ///
+    /// Returns one of: [`SSTATE_NOT_INTERNED`], [`SSTATE_INTERNED_MORTAL`],
+    /// [`SSTATE_INTERNED_IMMORTAL`], or [`SSTATE_INTERNED_IMMORTAL_STATIC`].
+    #[inline]
+    pub unsafe fn interned(&self) -> c_uint {
+        PyASCIIObjectState::from(self.state).interned()
+    }
+
+    #[cfg_attr(not(Py_3_12), allow(rustdoc::broken_intra_doc_links))] // SSTATE_INTERNED_IMMORTAL_STATIC requires 3.12
+    /// Set the `interned` field of the [`PyASCIIObject`] state bitfield.
+    ///
+    /// Calling this function with an argument that is not [`SSTATE_NOT_INTERNED`],
+    /// [`SSTATE_INTERNED_MORTAL`], [`SSTATE_INTERNED_IMMORTAL`], or
+    /// [`SSTATE_INTERNED_IMMORTAL_STATIC`] is invalid.
+    #[inline]
+    pub unsafe fn set_interned(&mut self, val: c_uint) {
+        let mut state = PyASCIIObjectState::from(self.state);
+        state.set_interned(val);
+        self.state = u32::from(state);
+    }
+
+    /// Get the `kind` field of the [`PyASCIIObject`] state bitfield.
+    ///
+    /// Returns one of:
+    #[cfg_attr(not(Py_3_12), doc = "[`PyUnicode_WCHAR_KIND`], ")]
+    /// [`PyUnicode_1BYTE_KIND`], [`PyUnicode_2BYTE_KIND`], or [`PyUnicode_4BYTE_KIND`].
+    #[inline]
+    pub unsafe fn kind(&self) -> c_uint {
+        PyASCIIObjectState::from(self.state).kind()
+    }
+
+    /// Set the `kind` field of the [`PyASCIIObject`] state bitfield.
+    ///
+    /// Calling this function with an argument that is not
+    #[cfg_attr(not(Py_3_12), doc = "[`PyUnicode_WCHAR_KIND`], ")]
+    /// [`PyUnicode_1BYTE_KIND`], [`PyUnicode_2BYTE_KIND`], or [`PyUnicode_4BYTE_KIND`] is invalid.
+    #[inline]
+    pub unsafe fn set_kind(&mut self, val: c_uint) {
+        let mut state = PyASCIIObjectState::from(self.state);
+        state.set_kind(val);
+        self.state = u32::from(state);
+    }
+
+    /// Get the `compact` field of the [`PyASCIIObject`] state bitfield.
+    ///
+    /// Returns either `0` or `1`.
+    #[inline]
+    pub unsafe fn compact(&self) -> c_uint {
+        PyASCIIObjectState::from(self.state).compact()
+    }
+
+    /// Set the `compact` flag of the [`PyASCIIObject`] state bitfield.
+    ///
+    /// Calling this function with an argument that is neither `0` nor `1` is invalid.
+    #[inline]
+    pub unsafe fn set_compact(&mut self, val: c_uint) {
+        let mut state = PyASCIIObjectState::from(self.state);
+        state.set_compact(val);
+        self.state = u32::from(state);
+    }
+
+    /// Get the `ascii` field of the [`PyASCIIObject`] state bitfield.
+    ///
+    /// Returns either `0` or `1`.
+    #[inline]
+    pub unsafe fn ascii(&self) -> c_uint {
+        PyASCIIObjectState::from(self.state).ascii()
+    }
+
+    /// Set the `ascii` flag of the [`PyASCIIObject`] state bitfield.
+    ///
+    /// Calling this function with an argument that is neither `0` nor `1` is invalid.
+    #[inline]
+    pub unsafe fn set_ascii(&mut self, val: c_uint) {
+        let mut state = PyASCIIObjectState::from(self.state);
+        state.set_ascii(val);
+        self.state = u32::from(state);
+    }
+
+    /// Get the `ready` field of the [`PyASCIIObject`] state bitfield.
+    ///
+    /// Returns either `0` or `1`.
+    #[cfg(not(Py_3_12))]
+    #[inline]
+    pub unsafe fn ready(&self) -> c_uint {
+        PyASCIIObjectState::from(self.state).ready()
+    }
+
+    /// Set the `ready` flag of the [`PyASCIIObject`] state bitfield.
+    ///
+    /// Calling this function with an argument that is neither `0` nor `1` is invalid.
+    #[cfg(not(Py_3_12))]
+    #[inline]
+    pub unsafe fn set_ready(&mut self, val: c_uint) {
+        let mut state = PyASCIIObjectState::from(self.state);
+        state.set_ready(val);
+        self.state = u32::from(state);
+    }
+}
+
+#[repr(C)]
+pub struct PyCompactUnicodeObject {
+    pub _base: PyASCIIObject,
+    #[cfg(not(GraalPy))]
+    pub utf8_length: Py_ssize_t,
+    #[cfg(not(GraalPy))]
+    pub utf8: *mut c_char,
+    #[cfg(not(any(Py_3_12, GraalPy)))]
+    pub wstr_length: Py_ssize_t,
+}
+
+#[repr(C)]
+pub union PyUnicodeObjectData {
+    pub any: *mut c_void,
+    pub latin1: *mut Py_UCS1,
+    pub ucs2: *mut Py_UCS2,
+    pub ucs4: *mut Py_UCS4,
+}
+
+#[repr(C)]
+pub struct PyUnicodeObject {
+    pub _base: PyCompactUnicodeObject,
+    #[cfg(not(GraalPy))]
+    pub data: PyUnicodeObjectData,
+}
+
+extern "C" {
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fn _PyUnicode_CheckConsistency(op: *mut PyObject, check_content: c_int) -> c_int;
+}
+
+// skipped PyUnicode_GET_SIZE
+// skipped PyUnicode_GET_DATA_SIZE
+// skipped PyUnicode_AS_UNICODE
+// skipped PyUnicode_AS_DATA
+
+pub const SSTATE_NOT_INTERNED: c_uint = 0;
+pub const SSTATE_INTERNED_MORTAL: c_uint = 1;
+pub const SSTATE_INTERNED_IMMORTAL: c_uint = 2;
+#[cfg(Py_3_12)]
+pub const SSTATE_INTERNED_IMMORTAL_STATIC: c_uint = 3;
+
+#[cfg(not(GraalPy))]
+#[inline]
+pub unsafe fn PyUnicode_IS_ASCII(op: *mut PyObject) -> c_uint {
+    debug_assert!(crate::PyUnicode_Check(op) != 0);
+    #[cfg(not(Py_3_12))]
+    debug_assert!(PyUnicode_IS_READY(op) != 0);
+
+    (*(op as *mut PyASCIIObject)).ascii()
+}
+
+#[cfg(not(GraalPy))]
+#[inline]
+pub unsafe fn PyUnicode_IS_COMPACT(op: *mut PyObject) -> c_uint {
+    (*(op as *mut PyASCIIObject)).compact()
+}
+
+#[cfg(not(GraalPy))]
+#[inline]
+pub unsafe fn PyUnicode_IS_COMPACT_ASCII(op: *mut PyObject) -> c_uint {
+    ((*(op as *mut PyASCIIObject)).ascii() != 0 && PyUnicode_IS_COMPACT(op) != 0).into()
+}
+
+#[cfg(not(Py_3_12))]
+#[deprecated(note = "Removed in Python 3.12")]
+pub const PyUnicode_WCHAR_KIND: c_uint = 0;
+
+pub const PyUnicode_1BYTE_KIND: c_uint = 1;
+pub const PyUnicode_2BYTE_KIND: c_uint = 2;
+pub const PyUnicode_4BYTE_KIND: c_uint = 4;
+
+#[cfg(not(any(GraalPy, PyPy)))]
+#[inline]
+pub unsafe fn PyUnicode_1BYTE_DATA(op: *mut PyObject) -> *mut Py_UCS1 {
+    PyUnicode_DATA(op) as *mut Py_UCS1
+}
+
+#[cfg(not(any(GraalPy, PyPy)))]
+#[inline]
+pub unsafe fn PyUnicode_2BYTE_DATA(op: *mut PyObject) -> *mut Py_UCS2 {
+    PyUnicode_DATA(op) as *mut Py_UCS2
+}
+
+#[cfg(not(any(GraalPy, PyPy)))]
+#[inline]
+pub unsafe fn PyUnicode_4BYTE_DATA(op: *mut PyObject) -> *mut Py_UCS4 {
+    PyUnicode_DATA(op) as *mut Py_UCS4
+}
+
+#[cfg(not(GraalPy))]
+#[inline]
+pub unsafe fn PyUnicode_KIND(op: *mut PyObject) -> c_uint {
+    debug_assert!(crate::PyUnicode_Check(op) != 0);
+    #[cfg(not(Py_3_12))]
+    debug_assert!(PyUnicode_IS_READY(op) != 0);
+
+    (*(op as *mut PyASCIIObject)).kind()
+}
+
+#[cfg(not(GraalPy))]
+#[inline]
+pub unsafe fn _PyUnicode_COMPACT_DATA(op: *mut PyObject) -> *mut c_void {
+    if PyUnicode_IS_ASCII(op) != 0 {
+        (op as *mut PyASCIIObject).offset(1) as *mut c_void
+    } else {
+        (op as *mut PyCompactUnicodeObject).offset(1) as *mut c_void
+    }
+}
+
+#[cfg(not(any(GraalPy, PyPy)))]
+#[inline]
+pub unsafe fn _PyUnicode_NONCOMPACT_DATA(op: *mut PyObject) -> *mut c_void {
+    debug_assert!(!(*(op as *mut PyUnicodeObject)).data.any.is_null());
+
+    (*(op as *mut PyUnicodeObject)).data.any
+}
+
+#[cfg(not(any(GraalPy, PyPy)))]
+#[inline]
+pub unsafe fn PyUnicode_DATA(op: *mut PyObject) -> *mut c_void {
+    debug_assert!(crate::PyUnicode_Check(op) != 0);
+
+    if PyUnicode_IS_COMPACT(op) != 0 {
+        _PyUnicode_COMPACT_DATA(op)
+    } else {
+        _PyUnicode_NONCOMPACT_DATA(op)
+    }
+}
+
+// skipped PyUnicode_WRITE
+// skipped PyUnicode_READ
+// skipped PyUnicode_READ_CHAR
+
+#[cfg(not(GraalPy))]
+#[inline]
+pub unsafe fn PyUnicode_GET_LENGTH(op: *mut PyObject) -> Py_ssize_t {
+    debug_assert!(crate::PyUnicode_Check(op) != 0);
+    #[cfg(not(Py_3_12))]
+    debug_assert!(PyUnicode_IS_READY(op) != 0);
+
+    (*(op as *mut PyASCIIObject)).length
+}
+
+#[cfg(any(Py_3_12, GraalPy))]
+#[inline]
+pub unsafe fn PyUnicode_IS_READY(_op: *mut PyObject) -> c_uint {
+    // kept in CPython for backwards compatibility
+    1
+}
+
+#[cfg(not(any(GraalPy, Py_3_12)))]
+#[inline]
+pub unsafe fn PyUnicode_IS_READY(op: *mut PyObject) -> c_uint {
+    (*(op as *mut PyASCIIObject)).ready()
+}
+
+#[cfg(any(Py_3_12, GraalPy))]
+#[inline]
+pub unsafe fn PyUnicode_READY(_op: *mut PyObject) -> c_int {
+    0
+}
+
+#[cfg(not(any(Py_3_12, GraalPy)))]
+#[inline]
+pub unsafe fn PyUnicode_READY(op: *mut PyObject) -> c_int {
+    debug_assert!(crate::PyUnicode_Check(op) != 0);
+
+    if PyUnicode_IS_READY(op) != 0 {
+        0
+    } else {
+        _PyUnicode_Ready(op)
+    }
+}
+
+// skipped PyUnicode_MAX_CHAR_VALUE
+// skipped _PyUnicode_get_wstr_length
+// skipped PyUnicode_WSTR_LENGTH
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_New")]
+    pub fn PyUnicode_New(size: Py_ssize_t, maxchar: Py_UCS4) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "_PyPyUnicode_Ready")]
+    pub fn _PyUnicode_Ready(unicode: *mut PyObject) -> c_int;
+
+    // skipped _PyUnicode_Copy
+
+    #[cfg(not(PyPy))]
+    pub fn PyUnicode_CopyCharacters(
+        to: *mut PyObject,
+        to_start: Py_ssize_t,
+        from: *mut PyObject,
+        from_start: Py_ssize_t,
+        how_many: Py_ssize_t,
+    ) -> Py_ssize_t;
+
+    // skipped _PyUnicode_FastCopyCharacters
+
+    #[cfg(not(PyPy))]
+    pub fn PyUnicode_Fill(
+        unicode: *mut PyObject,
+        start: Py_ssize_t,
+        length: Py_ssize_t,
+        fill_char: Py_UCS4,
+    ) -> Py_ssize_t;
+
+    // skipped _PyUnicode_FastFill
+
+    #[cfg(not(Py_3_12))]
+    #[deprecated]
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_FromUnicode")]
+    pub fn PyUnicode_FromUnicode(u: *const Py_UNICODE, size: Py_ssize_t) -> *mut PyObject;
+
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_FromKindAndData")]
+    pub fn PyUnicode_FromKindAndData(
+        kind: c_int,
+        buffer: *const c_void,
+        size: Py_ssize_t,
+    ) -> *mut PyObject;
+
+    // skipped _PyUnicode_FromASCII
+    // skipped _PyUnicode_FindMaxChar
+
+    #[cfg(not(Py_3_12))]
+    #[deprecated]
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_AsUnicode")]
+    pub fn PyUnicode_AsUnicode(unicode: *mut PyObject) -> *mut Py_UNICODE;
+
+    // skipped _PyUnicode_AsUnicode
+
+    #[cfg(not(Py_3_12))]
+    #[deprecated]
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_AsUnicodeAndSize")]
+    pub fn PyUnicode_AsUnicodeAndSize(
+        unicode: *mut PyObject,
+        size: *mut Py_ssize_t,
+    ) -> *mut Py_UNICODE;
+
+    // skipped PyUnicode_GetMax
+}
+
+// skipped _PyUnicodeWriter
+// skipped _PyUnicodeWriter_Init
+// skipped _PyUnicodeWriter_Prepare
+// skipped _PyUnicodeWriter_PrepareInternal
+// skipped _PyUnicodeWriter_PrepareKind
+// skipped _PyUnicodeWriter_PrepareKindInternal
+// skipped _PyUnicodeWriter_WriteChar
+// skipped _PyUnicodeWriter_WriteStr
+// skipped _PyUnicodeWriter_WriteSubstring
+// skipped _PyUnicodeWriter_WriteASCIIString
+// skipped _PyUnicodeWriter_WriteLatin1String
+// skipped _PyUnicodeWriter_Finish
+// skipped _PyUnicodeWriter_Dealloc
+// skipped _PyUnicode_FormatAdvancedWriter
+
+extern "C" {
+    // skipped _PyUnicode_AsStringAndSize
+
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_AsUTF8")]
+    pub fn PyUnicode_AsUTF8(unicode: *mut PyObject) -> *const c_char;
+
+    // skipped _PyUnicode_AsString
+
+    pub fn PyUnicode_Encode(
+        s: *const Py_UNICODE,
+        size: Py_ssize_t,
+        encoding: *const c_char,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+
+    pub fn PyUnicode_EncodeUTF7(
+        data: *const Py_UNICODE,
+        length: Py_ssize_t,
+        base64SetO: c_int,
+        base64WhiteSpace: c_int,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+
+    // skipped _PyUnicode_EncodeUTF7
+    // skipped _PyUnicode_AsUTF8String
+
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_EncodeUTF8")]
+    pub fn PyUnicode_EncodeUTF8(
+        data: *const Py_UNICODE,
+        length: Py_ssize_t,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+
+    pub fn PyUnicode_EncodeUTF32(
+        data: *const Py_UNICODE,
+        length: Py_ssize_t,
+        errors: *const c_char,
+        byteorder: c_int,
+    ) -> *mut PyObject;
+
+    // skipped _PyUnicode_EncodeUTF32
+
+    pub fn PyUnicode_EncodeUTF16(
+        data: *const Py_UNICODE,
+        length: Py_ssize_t,
+        errors: *const c_char,
+        byteorder: c_int,
+    ) -> *mut PyObject;
+
+    // skipped _PyUnicode_EncodeUTF16
+    // skipped _PyUnicode_DecodeUnicodeEscape
+
+    pub fn PyUnicode_EncodeUnicodeEscape(
+        data: *const Py_UNICODE,
+        length: Py_ssize_t,
+    ) -> *mut PyObject;
+
+    pub fn PyUnicode_EncodeRawUnicodeEscape(
+        data: *const Py_UNICODE,
+        length: Py_ssize_t,
+    ) -> *mut PyObject;
+
+    // skipped _PyUnicode_AsLatin1String
+
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_EncodeLatin1")]
+    pub fn PyUnicode_EncodeLatin1(
+        data: *const Py_UNICODE,
+        length: Py_ssize_t,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+
+    // skipped _PyUnicode_AsASCIIString
+
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_EncodeASCII")]
+    pub fn PyUnicode_EncodeASCII(
+        data: *const Py_UNICODE,
+        length: Py_ssize_t,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+
+    pub fn PyUnicode_EncodeCharmap(
+        data: *const Py_UNICODE,
+        length: Py_ssize_t,
+        mapping: *mut PyObject,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+
+    // skipped _PyUnicode_EncodeCharmap
+
+    pub fn PyUnicode_TranslateCharmap(
+        data: *const Py_UNICODE,
+        length: Py_ssize_t,
+        table: *mut PyObject,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+
+    // skipped PyUnicode_EncodeMBCS
+
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_EncodeDecimal")]
+    pub fn PyUnicode_EncodeDecimal(
+        s: *mut Py_UNICODE,
+        length: Py_ssize_t,
+        output: *mut c_char,
+        errors: *const c_char,
+    ) -> c_int;
+
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_TransformDecimalToASCII")]
+    pub fn PyUnicode_TransformDecimalToASCII(
+        s: *mut Py_UNICODE,
+        length: Py_ssize_t,
+    ) -> *mut PyObject;
+
+    // skipped _PyUnicode_TransformDecimalAndSpaceToASCII
+}
+
+// skipped _PyUnicode_JoinArray
+// skipped _PyUnicode_EqualToASCIIId
+// skipped _PyUnicode_EqualToASCIIString
+// skipped _PyUnicode_XStrip
+// skipped _PyUnicode_InsertThousandsGrouping
+
+// skipped _Py_ascii_whitespace
+
+// skipped _PyUnicode_IsLowercase
+// skipped _PyUnicode_IsUppercase
+// skipped _PyUnicode_IsTitlecase
+// skipped _PyUnicode_IsXidStart
+// skipped _PyUnicode_IsXidContinue
+// skipped _PyUnicode_IsWhitespace
+// skipped _PyUnicode_IsLinebreak
+// skipped _PyUnicode_ToLowercase
+// skipped _PyUnicode_ToUppercase
+// skipped _PyUnicode_ToTitlecase
+// skipped _PyUnicode_ToLowerFull
+// skipped _PyUnicode_ToTitleFull
+// skipped _PyUnicode_ToUpperFull
+// skipped _PyUnicode_ToFoldedFull
+// skipped _PyUnicode_IsCaseIgnorable
+// skipped _PyUnicode_IsCased
+// skipped _PyUnicode_ToDecimalDigit
+// skipped _PyUnicode_ToDigit
+// skipped _PyUnicode_ToNumeric
+// skipped _PyUnicode_IsDecimalDigit
+// skipped _PyUnicode_IsDigit
+// skipped _PyUnicode_IsNumeric
+// skipped _PyUnicode_IsPrintable
+// skipped _PyUnicode_IsAlpha
+// skipped Py_UNICODE_strlen
+// skipped Py_UNICODE_strcpy
+// skipped Py_UNICODE_strcat
+// skipped Py_UNICODE_strncpy
+// skipped Py_UNICODE_strcmp
+// skipped Py_UNICODE_strncmp
+// skipped Py_UNICODE_strchr
+// skipped Py_UNICODE_strrchr
+// skipped _PyUnicode_FormatLong
+// skipped PyUnicode_AsUnicodeCopy
+// skipped _PyUnicode_FromId
+// skipped _PyUnicode_EQ
+// skipped _PyUnicode_ScanIdentifier
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/weakrefobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/weakrefobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/cpython/weakrefobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/cpython/weakrefobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,15 @@
+#[cfg(not(any(PyPy, GraalPy)))]
+pub struct _PyWeakReference {
+    pub ob_base: crate::PyObject,
+    pub wr_object: *mut crate::PyObject,
+    pub wr_callback: *mut crate::PyObject,
+    pub hash: crate::Py_hash_t,
+    pub wr_prev: *mut crate::PyWeakReference,
+    pub wr_next: *mut crate::PyWeakReference,
+    #[cfg(Py_3_11)]
+    pub vectorcall: Option<crate::vectorcallfunc>,
+}
+
+// skipped _PyWeakref_GetWeakrefCount
+// skipped _PyWeakref_ClearRef
+// skipped PyWeakRef_GET_OBJECT
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/datetime.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/datetime.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/datetime.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/datetime.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,751 @@
+//! FFI bindings to the functions and structs defined in `datetime.h`
+//!
+//! This is the unsafe thin  wrapper around the [CPython C API](https://docs.python.org/3/c-api/datetime.html),
+//! and covers the various date and time related objects in the Python `datetime`
+//! standard library module.
+//!
+//! A note regarding PyPy (cpyext) support:
+//!
+//! Support for `PyDateTime_CAPI` is limited as of PyPy 7.0.0.
+//! `DateTime_FromTimestamp` and `Date_FromTimestamp` are currently not supported.
+
+#[cfg(GraalPy)]
+use crate::{PyLong_AsLong, PyLong_Check, PyObject_GetAttrString, Py_DecRef};
+use crate::{PyObject, PyObject_TypeCheck, PyTypeObject, Py_TYPE};
+use std::cell::UnsafeCell;
+#[cfg(not(GraalPy))]
+use std::os::raw::c_char;
+use std::os::raw::c_int;
+use std::ptr;
+#[cfg(not(PyPy))]
+use {crate::PyCapsule_Import, std::ffi::CString};
+#[cfg(not(any(PyPy, GraalPy)))]
+use {crate::Py_hash_t, std::os::raw::c_uchar};
+// Type struct wrappers
+const _PyDateTime_DATE_DATASIZE: usize = 4;
+const _PyDateTime_TIME_DATASIZE: usize = 6;
+const _PyDateTime_DATETIME_DATASIZE: usize = 10;
+
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+/// Structure representing a `datetime.timedelta`.
+pub struct PyDateTime_Delta {
+    pub ob_base: PyObject,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub hashcode: Py_hash_t,
+    #[cfg(not(GraalPy))]
+    pub days: c_int,
+    #[cfg(not(GraalPy))]
+    pub seconds: c_int,
+    #[cfg(not(GraalPy))]
+    pub microseconds: c_int,
+}
+
+// skipped non-limited PyDateTime_TZInfo
+// skipped non-limited _PyDateTime_BaseTZInfo
+
+#[cfg(not(any(PyPy, GraalPy)))]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+/// Structure representing a `datetime.time` without a `tzinfo` member.
+pub struct _PyDateTime_BaseTime {
+    pub ob_base: PyObject,
+    pub hashcode: Py_hash_t,
+    pub hastzinfo: c_char,
+    pub data: [c_uchar; _PyDateTime_TIME_DATASIZE],
+}
+
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+/// Structure representing a `datetime.time`.
+pub struct PyDateTime_Time {
+    pub ob_base: PyObject,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub hashcode: Py_hash_t,
+    #[cfg(not(GraalPy))]
+    pub hastzinfo: c_char,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub data: [c_uchar; _PyDateTime_TIME_DATASIZE],
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fold: c_uchar,
+    /// # Safety
+    ///
+    /// Care should be taken when reading this field. If the time does not have a
+    /// tzinfo then CPython may allocate as a `_PyDateTime_BaseTime` without this field.
+    #[cfg(not(GraalPy))]
+    pub tzinfo: *mut PyObject,
+}
+
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+/// Structure representing a `datetime.date`
+pub struct PyDateTime_Date {
+    pub ob_base: PyObject,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub hashcode: Py_hash_t,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub hastzinfo: c_char,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub data: [c_uchar; _PyDateTime_DATE_DATASIZE],
+}
+
+#[cfg(not(any(PyPy, GraalPy)))]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+/// Structure representing a `datetime.datetime` without a `tzinfo` member.
+pub struct _PyDateTime_BaseDateTime {
+    pub ob_base: PyObject,
+    pub hashcode: Py_hash_t,
+    pub hastzinfo: c_char,
+    pub data: [c_uchar; _PyDateTime_DATETIME_DATASIZE],
+}
+
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+/// Structure representing a `datetime.datetime`.
+pub struct PyDateTime_DateTime {
+    pub ob_base: PyObject,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub hashcode: Py_hash_t,
+    #[cfg(not(GraalPy))]
+    pub hastzinfo: c_char,
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub data: [c_uchar; _PyDateTime_DATETIME_DATASIZE],
+    #[cfg(not(any(PyPy, GraalPy)))]
+    pub fold: c_uchar,
+    /// # Safety
+    ///
+    /// Care should be taken when reading this field. If the time does not have a
+    /// tzinfo then CPython may allocate as a `_PyDateTime_BaseDateTime` without this field.
+    #[cfg(not(GraalPy))]
+    pub tzinfo: *mut PyObject,
+}
+
+// skipped non-limited _PyDateTime_HAS_TZINFO
+
+// Accessor functions for PyDateTime_Date and PyDateTime_DateTime
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+/// Retrieve the year component of a `PyDateTime_Date` or `PyDateTime_DateTime`.
+/// Returns a signed integer greater than 0.
+pub unsafe fn PyDateTime_GET_YEAR(o: *mut PyObject) -> c_int {
+    // This should work for Date or DateTime
+    let d = *(o as *mut PyDateTime_Date);
+    c_int::from(d.data[0]) << 8 | c_int::from(d.data[1])
+}
+
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+/// Retrieve the month component of a `PyDateTime_Date` or `PyDateTime_DateTime`.
+/// Returns a signed integer in the range `[1, 12]`.
+pub unsafe fn PyDateTime_GET_MONTH(o: *mut PyObject) -> c_int {
+    let d = *(o as *mut PyDateTime_Date);
+    c_int::from(d.data[2])
+}
+
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+/// Retrieve the day component of a `PyDateTime_Date` or `PyDateTime_DateTime`.
+/// Returns a signed integer in the interval `[1, 31]`.
+pub unsafe fn PyDateTime_GET_DAY(o: *mut PyObject) -> c_int {
+    let d = *(o as *mut PyDateTime_Date);
+    c_int::from(d.data[3])
+}
+
+// Accessor macros for times
+#[cfg(not(any(PyPy, GraalPy)))]
+macro_rules! _PyDateTime_GET_HOUR {
+    ($o: expr, $offset:expr) => {
+        c_int::from((*$o).data[$offset + 0])
+    };
+}
+
+#[cfg(not(any(PyPy, GraalPy)))]
+macro_rules! _PyDateTime_GET_MINUTE {
+    ($o: expr, $offset:expr) => {
+        c_int::from((*$o).data[$offset + 1])
+    };
+}
+
+#[cfg(not(any(PyPy, GraalPy)))]
+macro_rules! _PyDateTime_GET_SECOND {
+    ($o: expr, $offset:expr) => {
+        c_int::from((*$o).data[$offset + 2])
+    };
+}
+
+#[cfg(not(any(PyPy, GraalPy)))]
+macro_rules! _PyDateTime_GET_MICROSECOND {
+    ($o: expr, $offset:expr) => {
+        (c_int::from((*$o).data[$offset + 3]) << 16)
+            | (c_int::from((*$o).data[$offset + 4]) << 8)
+            | (c_int::from((*$o).data[$offset + 5]))
+    };
+}
+
+#[cfg(not(any(PyPy, GraalPy)))]
+macro_rules! _PyDateTime_GET_FOLD {
+    ($o: expr) => {
+        (*$o).fold
+    };
+}
+
+#[cfg(not(any(PyPy, GraalPy)))]
+macro_rules! _PyDateTime_GET_TZINFO {
+    ($o: expr) => {
+        if (*$o).hastzinfo != 0 {
+            (*$o).tzinfo
+        } else {
+            $crate::Py_None()
+        }
+    };
+}
+
+// Accessor functions for DateTime
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+/// Retrieve the hour component of a `PyDateTime_DateTime`.
+/// Returns a signed integer in the interval `[0, 23]`
+pub unsafe fn PyDateTime_DATE_GET_HOUR(o: *mut PyObject) -> c_int {
+    _PyDateTime_GET_HOUR!((o as *mut PyDateTime_DateTime), _PyDateTime_DATE_DATASIZE)
+}
+
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+/// Retrieve the minute component of a `PyDateTime_DateTime`.
+/// Returns a signed integer in the interval `[0, 59]`
+pub unsafe fn PyDateTime_DATE_GET_MINUTE(o: *mut PyObject) -> c_int {
+    _PyDateTime_GET_MINUTE!((o as *mut PyDateTime_DateTime), _PyDateTime_DATE_DATASIZE)
+}
+
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+/// Retrieve the second component of a `PyDateTime_DateTime`.
+/// Returns a signed integer in the interval `[0, 59]`
+pub unsafe fn PyDateTime_DATE_GET_SECOND(o: *mut PyObject) -> c_int {
+    _PyDateTime_GET_SECOND!((o as *mut PyDateTime_DateTime), _PyDateTime_DATE_DATASIZE)
+}
+
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+/// Retrieve the microsecond component of a `PyDateTime_DateTime`.
+/// Returns a signed integer in the interval `[0, 999999]`
+pub unsafe fn PyDateTime_DATE_GET_MICROSECOND(o: *mut PyObject) -> c_int {
+    _PyDateTime_GET_MICROSECOND!((o as *mut PyDateTime_DateTime), _PyDateTime_DATE_DATASIZE)
+}
+
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+/// Retrieve the fold component of a `PyDateTime_DateTime`.
+/// Returns a signed integer in the interval `[0, 1]`
+pub unsafe fn PyDateTime_DATE_GET_FOLD(o: *mut PyObject) -> c_uchar {
+    _PyDateTime_GET_FOLD!(o as *mut PyDateTime_DateTime)
+}
+
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+/// Retrieve the tzinfo component of a `PyDateTime_DateTime`.
+/// Returns a pointer to a `PyObject` that should be either NULL or an instance
+/// of a `datetime.tzinfo` subclass.
+pub unsafe fn PyDateTime_DATE_GET_TZINFO(o: *mut PyObject) -> *mut PyObject {
+    _PyDateTime_GET_TZINFO!(o as *mut PyDateTime_DateTime)
+}
+
+// Accessor functions for Time
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+/// Retrieve the hour component of a `PyDateTime_Time`.
+/// Returns a signed integer in the interval `[0, 23]`
+pub unsafe fn PyDateTime_TIME_GET_HOUR(o: *mut PyObject) -> c_int {
+    _PyDateTime_GET_HOUR!((o as *mut PyDateTime_Time), 0)
+}
+
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+/// Retrieve the minute component of a `PyDateTime_Time`.
+/// Returns a signed integer in the interval `[0, 59]`
+pub unsafe fn PyDateTime_TIME_GET_MINUTE(o: *mut PyObject) -> c_int {
+    _PyDateTime_GET_MINUTE!((o as *mut PyDateTime_Time), 0)
+}
+
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+/// Retrieve the second component of a `PyDateTime_DateTime`.
+/// Returns a signed integer in the interval `[0, 59]`
+pub unsafe fn PyDateTime_TIME_GET_SECOND(o: *mut PyObject) -> c_int {
+    _PyDateTime_GET_SECOND!((o as *mut PyDateTime_Time), 0)
+}
+
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+/// Retrieve the microsecond component of a `PyDateTime_DateTime`.
+/// Returns a signed integer in the interval `[0, 999999]`
+pub unsafe fn PyDateTime_TIME_GET_MICROSECOND(o: *mut PyObject) -> c_int {
+    _PyDateTime_GET_MICROSECOND!((o as *mut PyDateTime_Time), 0)
+}
+
+#[cfg(not(any(PyPy, GraalPy)))]
+#[inline]
+/// Retrieve the fold component of a `PyDateTime_Time`.
+/// Returns a signed integer in the interval `[0, 1]`
+pub unsafe fn PyDateTime_TIME_GET_FOLD(o: *mut PyObject) -> c_uchar {
+    _PyDateTime_GET_FOLD!(o as *mut PyDateTime_Time)
+}
+
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+/// Retrieve the tzinfo component of a `PyDateTime_Time`.
+/// Returns a pointer to a `PyObject` that should be either NULL or an instance
+/// of a `datetime.tzinfo` subclass.
+pub unsafe fn PyDateTime_TIME_GET_TZINFO(o: *mut PyObject) -> *mut PyObject {
+    _PyDateTime_GET_TZINFO!(o as *mut PyDateTime_Time)
+}
+
+// Accessor functions
+#[cfg(not(any(PyPy, GraalPy)))]
+macro_rules! _access_field {
+    ($obj:expr, $type: ident, $field:ident) => {
+        (*($obj as *mut $type)).$field
+    };
+}
+
+// Accessor functions for PyDateTime_Delta
+#[cfg(not(any(PyPy, GraalPy)))]
+macro_rules! _access_delta_field {
+    ($obj:expr, $field:ident) => {
+        _access_field!($obj, PyDateTime_Delta, $field)
+    };
+}
+
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+/// Retrieve the days component of a `PyDateTime_Delta`.
+///
+/// Returns a signed integer in the interval [-999999999, 999999999].
+///
+/// Note: This retrieves a component from the underlying structure, it is *not*
+/// a representation of the total duration of the structure.
+pub unsafe fn PyDateTime_DELTA_GET_DAYS(o: *mut PyObject) -> c_int {
+    _access_delta_field!(o, days)
+}
+
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+/// Retrieve the seconds component of a `PyDateTime_Delta`.
+///
+/// Returns a signed integer in the interval [0, 86399].
+///
+/// Note: This retrieves a component from the underlying structure, it is *not*
+/// a representation of the total duration of the structure.
+pub unsafe fn PyDateTime_DELTA_GET_SECONDS(o: *mut PyObject) -> c_int {
+    _access_delta_field!(o, seconds)
+}
+
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+/// Retrieve the seconds component of a `PyDateTime_Delta`.
+///
+/// Returns a signed integer in the interval [0, 999999].
+///
+/// Note: This retrieves a component from the underlying structure, it is *not*
+/// a representation of the total duration of the structure.
+pub unsafe fn PyDateTime_DELTA_GET_MICROSECONDS(o: *mut PyObject) -> c_int {
+    _access_delta_field!(o, microseconds)
+}
+
+// Accessor functions for GraalPy. The macros on GraalPy work differently,
+// but copying them seems suboptimal
+#[inline]
+#[cfg(GraalPy)]
+pub unsafe fn _get_attr(obj: *mut PyObject, field: &std::ffi::CStr) -> c_int {
+    let result = PyObject_GetAttrString(obj, field.as_ptr());
+    Py_DecRef(result); // the original macros are borrowing
+    if PyLong_Check(result) == 1 {
+        PyLong_AsLong(result) as c_int
+    } else {
+        0
+    }
+}
+
+#[inline]
+#[cfg(GraalPy)]
+pub unsafe fn PyDateTime_GET_YEAR(o: *mut PyObject) -> c_int {
+    _get_attr(o, c_str!("year"))
+}
+
+#[inline]
+#[cfg(GraalPy)]
+pub unsafe fn PyDateTime_GET_MONTH(o: *mut PyObject) -> c_int {
+    _get_attr(o, c_str!("month"))
+}
+
+#[inline]
+#[cfg(GraalPy)]
+pub unsafe fn PyDateTime_GET_DAY(o: *mut PyObject) -> c_int {
+    _get_attr(o, c_str!("day"))
+}
+
+#[inline]
+#[cfg(GraalPy)]
+pub unsafe fn PyDateTime_DATE_GET_HOUR(o: *mut PyObject) -> c_int {
+    _get_attr(o, c_str!("hour"))
+}
+
+#[inline]
+#[cfg(GraalPy)]
+pub unsafe fn PyDateTime_DATE_GET_MINUTE(o: *mut PyObject) -> c_int {
+    _get_attr(o, c_str!("minute"))
+}
+
+#[inline]
+#[cfg(GraalPy)]
+pub unsafe fn PyDateTime_DATE_GET_SECOND(o: *mut PyObject) -> c_int {
+    _get_attr(o, c_str!("second"))
+}
+
+#[inline]
+#[cfg(GraalPy)]
+pub unsafe fn PyDateTime_DATE_GET_MICROSECOND(o: *mut PyObject) -> c_int {
+    _get_attr(o, c_str!("microsecond"))
+}
+
+#[inline]
+#[cfg(GraalPy)]
+pub unsafe fn PyDateTime_DATE_GET_FOLD(o: *mut PyObject) -> c_int {
+    _get_attr(o, c_str!("fold"))
+}
+
+#[inline]
+#[cfg(GraalPy)]
+pub unsafe fn PyDateTime_DATE_GET_TZINFO(o: *mut PyObject) -> *mut PyObject {
+    let res = PyObject_GetAttrString(o, c_str!("tzinfo").as_ptr().cast());
+    Py_DecRef(res); // the original macros are borrowing
+    res
+}
+
+#[inline]
+#[cfg(GraalPy)]
+pub unsafe fn PyDateTime_TIME_GET_HOUR(o: *mut PyObject) -> c_int {
+    _get_attr(o, c_str!("hour"))
+}
+
+#[inline]
+#[cfg(GraalPy)]
+pub unsafe fn PyDateTime_TIME_GET_MINUTE(o: *mut PyObject) -> c_int {
+    _get_attr(o, c_str!("minute"))
+}
+
+#[inline]
+#[cfg(GraalPy)]
+pub unsafe fn PyDateTime_TIME_GET_SECOND(o: *mut PyObject) -> c_int {
+    _get_attr(o, c_str!("second"))
+}
+
+#[inline]
+#[cfg(GraalPy)]
+pub unsafe fn PyDateTime_TIME_GET_MICROSECOND(o: *mut PyObject) -> c_int {
+    _get_attr(o, c_str!("microsecond"))
+}
+
+#[inline]
+#[cfg(GraalPy)]
+pub unsafe fn PyDateTime_TIME_GET_FOLD(o: *mut PyObject) -> c_int {
+    _get_attr(o, c_str!("fold"))
+}
+
+#[inline]
+#[cfg(GraalPy)]
+pub unsafe fn PyDateTime_TIME_GET_TZINFO(o: *mut PyObject) -> *mut PyObject {
+    let res = PyObject_GetAttrString(o, c_str!("tzinfo").as_ptr().cast());
+    Py_DecRef(res); // the original macros are borrowing
+    res
+}
+
+#[inline]
+#[cfg(GraalPy)]
+pub unsafe fn PyDateTime_DELTA_GET_DAYS(o: *mut PyObject) -> c_int {
+    _get_attr(o, c_str!("days"))
+}
+
+#[inline]
+#[cfg(GraalPy)]
+pub unsafe fn PyDateTime_DELTA_GET_SECONDS(o: *mut PyObject) -> c_int {
+    _get_attr(o, c_str!("seconds"))
+}
+
+#[inline]
+#[cfg(GraalPy)]
+pub unsafe fn PyDateTime_DELTA_GET_MICROSECONDS(o: *mut PyObject) -> c_int {
+    _get_attr(o, c_str!("microseconds"))
+}
+
+#[cfg(PyPy)]
+extern "C" {
+    // skipped _PyDateTime_HAS_TZINFO (not in PyPy)
+    #[link_name = "PyPyDateTime_GET_YEAR"]
+    pub fn PyDateTime_GET_YEAR(o: *mut PyObject) -> c_int;
+    #[link_name = "PyPyDateTime_GET_MONTH"]
+    pub fn PyDateTime_GET_MONTH(o: *mut PyObject) -> c_int;
+    #[link_name = "PyPyDateTime_GET_DAY"]
+    pub fn PyDateTime_GET_DAY(o: *mut PyObject) -> c_int;
+
+    #[link_name = "PyPyDateTime_DATE_GET_HOUR"]
+    pub fn PyDateTime_DATE_GET_HOUR(o: *mut PyObject) -> c_int;
+    #[link_name = "PyPyDateTime_DATE_GET_MINUTE"]
+    pub fn PyDateTime_DATE_GET_MINUTE(o: *mut PyObject) -> c_int;
+    #[link_name = "PyPyDateTime_DATE_GET_SECOND"]
+    pub fn PyDateTime_DATE_GET_SECOND(o: *mut PyObject) -> c_int;
+    #[link_name = "PyPyDateTime_DATE_GET_MICROSECOND"]
+    pub fn PyDateTime_DATE_GET_MICROSECOND(o: *mut PyObject) -> c_int;
+    #[link_name = "PyPyDateTime_GET_FOLD"]
+    pub fn PyDateTime_DATE_GET_FOLD(o: *mut PyObject) -> c_int;
+    // skipped PyDateTime_DATE_GET_TZINFO (not in PyPy)
+
+    #[link_name = "PyPyDateTime_TIME_GET_HOUR"]
+    pub fn PyDateTime_TIME_GET_HOUR(o: *mut PyObject) -> c_int;
+    #[link_name = "PyPyDateTime_TIME_GET_MINUTE"]
+    pub fn PyDateTime_TIME_GET_MINUTE(o: *mut PyObject) -> c_int;
+    #[link_name = "PyPyDateTime_TIME_GET_SECOND"]
+    pub fn PyDateTime_TIME_GET_SECOND(o: *mut PyObject) -> c_int;
+    #[link_name = "PyPyDateTime_TIME_GET_MICROSECOND"]
+    pub fn PyDateTime_TIME_GET_MICROSECOND(o: *mut PyObject) -> c_int;
+    #[link_name = "PyPyDateTime_TIME_GET_FOLD"]
+    pub fn PyDateTime_TIME_GET_FOLD(o: *mut PyObject) -> c_int;
+    // skipped PyDateTime_TIME_GET_TZINFO (not in PyPy)
+
+    #[link_name = "PyPyDateTime_DELTA_GET_DAYS"]
+    pub fn PyDateTime_DELTA_GET_DAYS(o: *mut PyObject) -> c_int;
+    #[link_name = "PyPyDateTime_DELTA_GET_SECONDS"]
+    pub fn PyDateTime_DELTA_GET_SECONDS(o: *mut PyObject) -> c_int;
+    #[link_name = "PyPyDateTime_DELTA_GET_MICROSECONDS"]
+    pub fn PyDateTime_DELTA_GET_MICROSECONDS(o: *mut PyObject) -> c_int;
+}
+
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct PyDateTime_CAPI {
+    pub DateType: *mut PyTypeObject,
+    pub DateTimeType: *mut PyTypeObject,
+    pub TimeType: *mut PyTypeObject,
+    pub DeltaType: *mut PyTypeObject,
+    pub TZInfoType: *mut PyTypeObject,
+    pub TimeZone_UTC: *mut PyObject,
+    pub Date_FromDate: unsafe extern "C" fn(
+        year: c_int,
+        month: c_int,
+        day: c_int,
+        cls: *mut PyTypeObject,
+    ) -> *mut PyObject,
+    pub DateTime_FromDateAndTime: unsafe extern "C" fn(
+        year: c_int,
+        month: c_int,
+        day: c_int,
+        hour: c_int,
+        minute: c_int,
+        second: c_int,
+        microsecond: c_int,
+        tzinfo: *mut PyObject,
+        cls: *mut PyTypeObject,
+    ) -> *mut PyObject,
+    pub Time_FromTime: unsafe extern "C" fn(
+        hour: c_int,
+        minute: c_int,
+        second: c_int,
+        microsecond: c_int,
+        tzinfo: *mut PyObject,
+        cls: *mut PyTypeObject,
+    ) -> *mut PyObject,
+    pub Delta_FromDelta: unsafe extern "C" fn(
+        days: c_int,
+        seconds: c_int,
+        microseconds: c_int,
+        normalize: c_int,
+        cls: *mut PyTypeObject,
+    ) -> *mut PyObject,
+    pub TimeZone_FromTimeZone:
+        unsafe extern "C" fn(offset: *mut PyObject, name: *mut PyObject) -> *mut PyObject,
+
+    pub DateTime_FromTimestamp: unsafe extern "C" fn(
+        cls: *mut PyTypeObject,
+        args: *mut PyObject,
+        kwargs: *mut PyObject,
+    ) -> *mut PyObject,
+    pub Date_FromTimestamp:
+        unsafe extern "C" fn(cls: *mut PyTypeObject, args: *mut PyObject) -> *mut PyObject,
+    pub DateTime_FromDateAndTimeAndFold: unsafe extern "C" fn(
+        year: c_int,
+        month: c_int,
+        day: c_int,
+        hour: c_int,
+        minute: c_int,
+        second: c_int,
+        microsecond: c_int,
+        tzinfo: *mut PyObject,
+        fold: c_int,
+        cls: *mut PyTypeObject,
+    ) -> *mut PyObject,
+    pub Time_FromTimeAndFold: unsafe extern "C" fn(
+        hour: c_int,
+        minute: c_int,
+        second: c_int,
+        microsecond: c_int,
+        tzinfo: *mut PyObject,
+        fold: c_int,
+        cls: *mut PyTypeObject,
+    ) -> *mut PyObject,
+}
+
+// Python already shares this object between threads, so it's no more evil for us to do it too!
+unsafe impl Sync for PyDateTime_CAPI {}
+
+/// Returns a pointer to a `PyDateTime_CAPI` instance
+///
+/// # Note
+/// This function will return a null pointer until
+/// `PyDateTime_IMPORT` is called
+#[inline]
+pub unsafe fn PyDateTimeAPI() -> *mut PyDateTime_CAPI {
+    *PyDateTimeAPI_impl.0.get()
+}
+
+#[inline]
+pub unsafe fn PyDateTime_TimeZone_UTC() -> *mut PyObject {
+    (*PyDateTimeAPI()).TimeZone_UTC
+}
+
+/// Populates the `PyDateTimeAPI` object
+pub unsafe fn PyDateTime_IMPORT() {
+    // PyPy expects the C-API to be initialized via PyDateTime_Import, so trying to use
+    // `PyCapsule_Import` will behave unexpectedly in pypy.
+    #[cfg(PyPy)]
+    let py_datetime_c_api = PyDateTime_Import();
+
+    #[cfg(not(PyPy))]
+    let py_datetime_c_api = {
+        // PyDateTime_CAPSULE_NAME is a macro in C
+        let PyDateTime_CAPSULE_NAME = CString::new("datetime.datetime_CAPI").unwrap();
+
+        PyCapsule_Import(PyDateTime_CAPSULE_NAME.as_ptr(), 1) as *mut PyDateTime_CAPI
+    };
+
+    *PyDateTimeAPI_impl.0.get() = py_datetime_c_api;
+}
+
+// skipped non-limited PyDateTime_TimeZone_UTC
+
+/// Type Check macros
+///
+/// These are bindings around the C API typecheck macros, all of them return
+/// `1` if True and `0` if False. In all type check macros, the argument (`op`)
+/// must not be `NULL`.
+#[inline]
+/// Check if `op` is a `PyDateTimeAPI.DateType` or subtype.
+pub unsafe fn PyDate_Check(op: *mut PyObject) -> c_int {
+    PyObject_TypeCheck(op, (*PyDateTimeAPI()).DateType) as c_int
+}
+
+#[inline]
+/// Check if `op`'s type is exactly `PyDateTimeAPI.DateType`.
+pub unsafe fn PyDate_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == (*PyDateTimeAPI()).DateType) as c_int
+}
+
+#[inline]
+/// Check if `op` is a `PyDateTimeAPI.DateTimeType` or subtype.
+pub unsafe fn PyDateTime_Check(op: *mut PyObject) -> c_int {
+    PyObject_TypeCheck(op, (*PyDateTimeAPI()).DateTimeType) as c_int
+}
+
+#[inline]
+/// Check if `op`'s type is exactly `PyDateTimeAPI.DateTimeType`.
+pub unsafe fn PyDateTime_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == (*PyDateTimeAPI()).DateTimeType) as c_int
+}
+
+#[inline]
+/// Check if `op` is a `PyDateTimeAPI.TimeType` or subtype.
+pub unsafe fn PyTime_Check(op: *mut PyObject) -> c_int {
+    PyObject_TypeCheck(op, (*PyDateTimeAPI()).TimeType) as c_int
+}
+
+#[inline]
+/// Check if `op`'s type is exactly `PyDateTimeAPI.TimeType`.
+pub unsafe fn PyTime_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == (*PyDateTimeAPI()).TimeType) as c_int
+}
+
+#[inline]
+/// Check if `op` is a `PyDateTimeAPI.DetaType` or subtype.
+pub unsafe fn PyDelta_Check(op: *mut PyObject) -> c_int {
+    PyObject_TypeCheck(op, (*PyDateTimeAPI()).DeltaType) as c_int
+}
+
+#[inline]
+/// Check if `op`'s type is exactly `PyDateTimeAPI.DeltaType`.
+pub unsafe fn PyDelta_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == (*PyDateTimeAPI()).DeltaType) as c_int
+}
+
+#[inline]
+/// Check if `op` is a `PyDateTimeAPI.TZInfoType` or subtype.
+pub unsafe fn PyTZInfo_Check(op: *mut PyObject) -> c_int {
+    PyObject_TypeCheck(op, (*PyDateTimeAPI()).TZInfoType) as c_int
+}
+
+#[inline]
+/// Check if `op`'s type is exactly `PyDateTimeAPI.TZInfoType`.
+pub unsafe fn PyTZInfo_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == (*PyDateTimeAPI()).TZInfoType) as c_int
+}
+
+// skipped non-limited PyDate_FromDate
+// skipped non-limited PyDateTime_FromDateAndTime
+// skipped non-limited PyDateTime_FromDateAndTimeAndFold
+// skipped non-limited PyTime_FromTime
+// skipped non-limited PyTime_FromTimeAndFold
+// skipped non-limited PyDelta_FromDSU
+
+pub unsafe fn PyTimeZone_FromOffset(offset: *mut PyObject) -> *mut PyObject {
+    ((*PyDateTimeAPI()).TimeZone_FromTimeZone)(offset, std::ptr::null_mut())
+}
+
+pub unsafe fn PyTimeZone_FromOffsetAndName(
+    offset: *mut PyObject,
+    name: *mut PyObject,
+) -> *mut PyObject {
+    ((*PyDateTimeAPI()).TimeZone_FromTimeZone)(offset, name)
+}
+
+#[cfg(not(PyPy))]
+pub unsafe fn PyDateTime_FromTimestamp(args: *mut PyObject) -> *mut PyObject {
+    let f = (*PyDateTimeAPI()).DateTime_FromTimestamp;
+    f((*PyDateTimeAPI()).DateTimeType, args, std::ptr::null_mut())
+}
+
+#[cfg(not(PyPy))]
+pub unsafe fn PyDate_FromTimestamp(args: *mut PyObject) -> *mut PyObject {
+    let f = (*PyDateTimeAPI()).Date_FromTimestamp;
+    f((*PyDateTimeAPI()).DateType, args)
+}
+
+#[cfg(PyPy)]
+extern "C" {
+    #[link_name = "PyPyDate_FromTimestamp"]
+    pub fn PyDate_FromTimestamp(args: *mut PyObject) -> *mut PyObject;
+    #[link_name = "PyPyDateTime_FromTimestamp"]
+    pub fn PyDateTime_FromTimestamp(args: *mut PyObject) -> *mut PyObject;
+}
+
+#[cfg(PyPy)]
+extern "C" {
+    #[link_name = "_PyPyDateTime_Import"]
+    pub fn PyDateTime_Import() -> *mut PyDateTime_CAPI;
+}
+
+// Rust specific implementation details
+
+struct PyDateTimeAPISingleton(UnsafeCell<*mut PyDateTime_CAPI>);
+unsafe impl Sync for PyDateTimeAPISingleton {}
+
+static PyDateTimeAPI_impl: PyDateTimeAPISingleton =
+    PyDateTimeAPISingleton(UnsafeCell::new(ptr::null_mut()));
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/descrobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/descrobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/descrobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/descrobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,133 @@
+use crate::methodobject::PyMethodDef;
+use crate::object::{PyObject, PyTypeObject};
+use crate::Py_ssize_t;
+use std::os::raw::{c_char, c_int, c_void};
+use std::ptr;
+
+pub type getter = unsafe extern "C" fn(slf: *mut PyObject, closure: *mut c_void) -> *mut PyObject;
+pub type setter =
+    unsafe extern "C" fn(slf: *mut PyObject, value: *mut PyObject, closure: *mut c_void) -> c_int;
+
+/// Represents the [PyGetSetDef](https://docs.python.org/3/c-api/structures.html#c.PyGetSetDef)
+/// structure.
+///
+/// Note that CPython may leave fields uninitialized. You must ensure that
+/// `name` != NULL before dereferencing or reading other fields.
+#[repr(C)]
+#[derive(Copy, Clone, Debug, Eq, PartialEq)]
+pub struct PyGetSetDef {
+    pub name: *const c_char,
+    pub get: Option<getter>,
+    pub set: Option<setter>,
+    pub doc: *const c_char,
+    pub closure: *mut c_void,
+}
+
+impl Default for PyGetSetDef {
+    fn default() -> PyGetSetDef {
+        PyGetSetDef {
+            name: ptr::null(),
+            get: None,
+            set: None,
+            doc: ptr::null(),
+            closure: ptr::null_mut(),
+        }
+    }
+}
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyClassMethodDescr_Type")]
+    pub static mut PyClassMethodDescr_Type: PyTypeObject;
+    #[cfg_attr(PyPy, link_name = "PyPyGetSetDescr_Type")]
+    pub static mut PyGetSetDescr_Type: PyTypeObject;
+    #[cfg_attr(PyPy, link_name = "PyPyMemberDescr_Type")]
+    pub static mut PyMemberDescr_Type: PyTypeObject;
+    #[cfg_attr(PyPy, link_name = "PyPyMethodDescr_Type")]
+    pub static mut PyMethodDescr_Type: PyTypeObject;
+    #[cfg_attr(PyPy, link_name = "PyPyWrapperDescr_Type")]
+    pub static mut PyWrapperDescr_Type: PyTypeObject;
+    #[cfg_attr(PyPy, link_name = "PyPyDictProxy_Type")]
+    pub static mut PyDictProxy_Type: PyTypeObject;
+    #[cfg_attr(PyPy, link_name = "PyPyProperty_Type")]
+    pub static mut PyProperty_Type: PyTypeObject;
+}
+
+extern "C" {
+    pub fn PyDescr_NewMethod(arg1: *mut PyTypeObject, arg2: *mut PyMethodDef) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyDescr_NewClassMethod")]
+    pub fn PyDescr_NewClassMethod(arg1: *mut PyTypeObject, arg2: *mut PyMethodDef)
+        -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyDescr_NewMember")]
+    pub fn PyDescr_NewMember(arg1: *mut PyTypeObject, arg2: *mut PyMemberDef) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyDescr_NewGetSet")]
+    pub fn PyDescr_NewGetSet(arg1: *mut PyTypeObject, arg2: *mut PyGetSetDef) -> *mut PyObject;
+
+    #[cfg_attr(PyPy, link_name = "PyPyDictProxy_New")]
+    pub fn PyDictProxy_New(arg1: *mut PyObject) -> *mut PyObject;
+    pub fn PyWrapper_New(arg1: *mut PyObject, arg2: *mut PyObject) -> *mut PyObject;
+}
+
+/// Represents the [PyMemberDef](https://docs.python.org/3/c-api/structures.html#c.PyMemberDef)
+/// structure.
+///
+/// Note that CPython may leave fields uninitialized. You must always ensure that
+/// `name` != NULL before dereferencing or reading other fields.
+#[repr(C)]
+#[derive(Copy, Clone, Eq, PartialEq)]
+pub struct PyMemberDef {
+    pub name: *const c_char,
+    pub type_code: c_int,
+    pub offset: Py_ssize_t,
+    pub flags: c_int,
+    pub doc: *const c_char,
+}
+
+impl Default for PyMemberDef {
+    fn default() -> PyMemberDef {
+        PyMemberDef {
+            name: ptr::null_mut(),
+            type_code: 0,
+            offset: 0,
+            flags: 0,
+            doc: ptr::null_mut(),
+        }
+    }
+}
+
+/* Types */
+pub const Py_T_SHORT: c_int = 0;
+pub const Py_T_INT: c_int = 1;
+pub const Py_T_LONG: c_int = 2;
+pub const Py_T_FLOAT: c_int = 3;
+pub const Py_T_DOUBLE: c_int = 4;
+pub const Py_T_STRING: c_int = 5;
+#[deprecated(note = "Use Py_T_OBJECT_EX instead")]
+pub const _Py_T_OBJECT: c_int = 6;
+pub const Py_T_CHAR: c_int = 7;
+pub const Py_T_BYTE: c_int = 8;
+pub const Py_T_UBYTE: c_int = 9;
+pub const Py_T_USHORT: c_int = 10;
+pub const Py_T_UINT: c_int = 11;
+pub const Py_T_ULONG: c_int = 12;
+pub const Py_T_STRING_INPLACE: c_int = 13;
+pub const Py_T_BOOL: c_int = 14;
+pub const Py_T_OBJECT_EX: c_int = 16;
+pub const Py_T_LONGLONG: c_int = 17;
+pub const Py_T_ULONGLONG: c_int = 18;
+pub const Py_T_PYSSIZET: c_int = 19;
+#[deprecated(note = "Value is always none")]
+pub const _Py_T_NONE: c_int = 20;
+
+/* Flags */
+pub const Py_READONLY: c_int = 1;
+#[cfg(Py_3_10)]
+pub const Py_AUDIT_READ: c_int = 2; // Added in 3.10, harmless no-op before that
+#[deprecated]
+pub const _Py_WRITE_RESTRICTED: c_int = 4; // Deprecated, no-op. Do not reuse the value.
+pub const Py_RELATIVE_OFFSET: c_int = 8;
+
+extern "C" {
+    pub fn PyMember_GetOne(addr: *const c_char, l: *mut PyMemberDef) -> *mut PyObject;
+    pub fn PyMember_SetOne(addr: *mut c_char, l: *mut PyMemberDef, value: *mut PyObject) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/dictobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/dictobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/dictobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/dictobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,114 @@
+use crate::object::*;
+use crate::pyport::Py_ssize_t;
+use std::os::raw::{c_char, c_int};
+use std::ptr::addr_of_mut;
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyDict_Type")]
+    pub static mut PyDict_Type: PyTypeObject;
+}
+
+#[inline]
+pub unsafe fn PyDict_Check(op: *mut PyObject) -> c_int {
+    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_DICT_SUBCLASS)
+}
+
+#[inline]
+pub unsafe fn PyDict_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyDict_Type)) as c_int
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyDict_New")]
+    pub fn PyDict_New() -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyDict_GetItem")]
+    pub fn PyDict_GetItem(mp: *mut PyObject, key: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyDict_GetItemWithError")]
+    pub fn PyDict_GetItemWithError(mp: *mut PyObject, key: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyDict_SetItem")]
+    pub fn PyDict_SetItem(mp: *mut PyObject, key: *mut PyObject, item: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyDict_DelItem")]
+    pub fn PyDict_DelItem(mp: *mut PyObject, key: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyDict_Clear")]
+    pub fn PyDict_Clear(mp: *mut PyObject);
+    #[cfg_attr(PyPy, link_name = "PyPyDict_Next")]
+    pub fn PyDict_Next(
+        mp: *mut PyObject,
+        pos: *mut Py_ssize_t,
+        key: *mut *mut PyObject,
+        value: *mut *mut PyObject,
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyDict_Keys")]
+    pub fn PyDict_Keys(mp: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyDict_Values")]
+    pub fn PyDict_Values(mp: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyDict_Items")]
+    pub fn PyDict_Items(mp: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyDict_Size")]
+    pub fn PyDict_Size(mp: *mut PyObject) -> Py_ssize_t;
+    #[cfg_attr(PyPy, link_name = "PyPyDict_Copy")]
+    pub fn PyDict_Copy(mp: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyDict_Contains")]
+    pub fn PyDict_Contains(mp: *mut PyObject, key: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyDict_Update")]
+    pub fn PyDict_Update(mp: *mut PyObject, other: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyDict_Merge")]
+    pub fn PyDict_Merge(mp: *mut PyObject, other: *mut PyObject, _override: c_int) -> c_int;
+    pub fn PyDict_MergeFromSeq2(d: *mut PyObject, seq2: *mut PyObject, _override: c_int) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyDict_GetItemString")]
+    pub fn PyDict_GetItemString(dp: *mut PyObject, key: *const c_char) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyDict_SetItemString")]
+    pub fn PyDict_SetItemString(
+        dp: *mut PyObject,
+        key: *const c_char,
+        item: *mut PyObject,
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyDict_DelItemString")]
+    pub fn PyDict_DelItemString(dp: *mut PyObject, key: *const c_char) -> c_int;
+    // skipped 3.10 / ex-non-limited PyObject_GenericGetDict
+}
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    pub static mut PyDictKeys_Type: PyTypeObject;
+    pub static mut PyDictValues_Type: PyTypeObject;
+    pub static mut PyDictItems_Type: PyTypeObject;
+}
+
+#[inline]
+pub unsafe fn PyDictKeys_Check(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyDictKeys_Type)) as c_int
+}
+
+#[inline]
+pub unsafe fn PyDictValues_Check(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyDictValues_Type)) as c_int
+}
+
+#[inline]
+pub unsafe fn PyDictItems_Check(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyDictItems_Type)) as c_int
+}
+
+#[inline]
+pub unsafe fn PyDictViewSet_Check(op: *mut PyObject) -> c_int {
+    (PyDictKeys_Check(op) != 0 || PyDictItems_Check(op) != 0) as c_int
+}
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    pub static mut PyDictIterKey_Type: PyTypeObject;
+    pub static mut PyDictIterValue_Type: PyTypeObject;
+    pub static mut PyDictIterItem_Type: PyTypeObject;
+    #[cfg(Py_3_8)]
+    pub static mut PyDictRevIterKey_Type: PyTypeObject;
+    #[cfg(Py_3_8)]
+    pub static mut PyDictRevIterValue_Type: PyTypeObject;
+    #[cfg(Py_3_8)]
+    pub static mut PyDictRevIterItem_Type: PyTypeObject;
+}
+
+#[cfg(any(PyPy, GraalPy, Py_LIMITED_API))]
+// TODO: remove (see https://github.com/PyO3/pyo3/pull/1341#issuecomment-751515985)
+opaque_struct!(PyDictObject);
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/enumobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/enumobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/enumobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/enumobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+use crate::object::PyTypeObject;
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    pub static mut PyEnum_Type: PyTypeObject;
+    pub static mut PyReversed_Type: PyTypeObject;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/fileobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/fileobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/fileobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/fileobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,38 @@
+use crate::object::PyObject;
+use std::os::raw::{c_char, c_int};
+
+pub const PY_STDIOTEXTMODE: &str = "b";
+
+extern "C" {
+    pub fn PyFile_FromFd(
+        arg1: c_int,
+        arg2: *const c_char,
+        arg3: *const c_char,
+        arg4: c_int,
+        arg5: *const c_char,
+        arg6: *const c_char,
+        arg7: *const c_char,
+        arg8: c_int,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyFile_GetLine")]
+    pub fn PyFile_GetLine(arg1: *mut PyObject, arg2: c_int) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyFile_WriteObject")]
+    pub fn PyFile_WriteObject(arg1: *mut PyObject, arg2: *mut PyObject, arg3: c_int) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyFile_WriteString")]
+    pub fn PyFile_WriteString(arg1: *const c_char, arg2: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyFile_AsFileDescriptor")]
+    pub fn PyObject_AsFileDescriptor(arg1: *mut PyObject) -> c_int;
+}
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[deprecated(note = "Python 3.12")]
+    pub static mut Py_FileSystemDefaultEncoding: *const c_char;
+    #[deprecated(note = "Python 3.12")]
+    pub static mut Py_FileSystemDefaultEncodeErrors: *const c_char;
+    #[deprecated(note = "Python 3.12")]
+    pub static mut Py_HasFileSystemDefaultEncoding: c_int;
+    // skipped 3.12-deprecated Py_UTF8Mode
+}
+
+// skipped _PyIsSelectable_fd
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/fileutils.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/fileutils.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/fileutils.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/fileutils.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,9 @@
+use crate::pyport::Py_ssize_t;
+use libc::wchar_t;
+use std::os::raw::c_char;
+
+extern "C" {
+    pub fn Py_DecodeLocale(arg1: *const c_char, size: *mut Py_ssize_t) -> *mut wchar_t;
+
+    pub fn Py_EncodeLocale(text: *const wchar_t, error_pos: *mut Py_ssize_t) -> *mut c_char;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/floatobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/floatobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/floatobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/floatobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,47 @@
+use crate::object::*;
+use std::os::raw::{c_double, c_int};
+use std::ptr::addr_of_mut;
+
+#[cfg(Py_LIMITED_API)]
+// TODO: remove (see https://github.com/PyO3/pyo3/pull/1341#issuecomment-751515985)
+opaque_struct!(PyFloatObject);
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyFloat_Type")]
+    pub static mut PyFloat_Type: PyTypeObject;
+}
+
+#[inline]
+pub unsafe fn PyFloat_Check(op: *mut PyObject) -> c_int {
+    PyObject_TypeCheck(op, addr_of_mut!(PyFloat_Type))
+}
+
+#[inline]
+pub unsafe fn PyFloat_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyFloat_Type)) as c_int
+}
+
+// skipped Py_RETURN_NAN
+// skipped Py_RETURN_INF
+
+extern "C" {
+    pub fn PyFloat_GetMax() -> c_double;
+    pub fn PyFloat_GetMin() -> c_double;
+    pub fn PyFloat_GetInfo() -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyFloat_FromString")]
+    pub fn PyFloat_FromString(arg1: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyFloat_FromDouble")]
+    pub fn PyFloat_FromDouble(arg1: c_double) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyFloat_AsDouble")]
+    pub fn PyFloat_AsDouble(arg1: *mut PyObject) -> c_double;
+}
+
+// skipped non-limited _PyFloat_Pack2
+// skipped non-limited _PyFloat_Pack4
+// skipped non-limited _PyFloat_Pack8
+// skipped non-limited _PyFloat_Unpack2
+// skipped non-limited _PyFloat_Unpack4
+// skipped non-limited _PyFloat_Unpack8
+// skipped non-limited _PyFloat_DebugMallocStats
+// skipped non-limited _PyFloat_FormatAdvancedWriter
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/import.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/import.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/import.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/import.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,81 @@
+use crate::object::PyObject;
+use std::os::raw::{c_char, c_int, c_long};
+
+extern "C" {
+    pub fn PyImport_GetMagicNumber() -> c_long;
+    pub fn PyImport_GetMagicTag() -> *const c_char;
+    #[cfg_attr(PyPy, link_name = "PyPyImport_ExecCodeModule")]
+    pub fn PyImport_ExecCodeModule(name: *const c_char, co: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyImport_ExecCodeModuleEx")]
+    pub fn PyImport_ExecCodeModuleEx(
+        name: *const c_char,
+        co: *mut PyObject,
+        pathname: *const c_char,
+    ) -> *mut PyObject;
+    pub fn PyImport_ExecCodeModuleWithPathnames(
+        name: *const c_char,
+        co: *mut PyObject,
+        pathname: *const c_char,
+        cpathname: *const c_char,
+    ) -> *mut PyObject;
+    pub fn PyImport_ExecCodeModuleObject(
+        name: *mut PyObject,
+        co: *mut PyObject,
+        pathname: *mut PyObject,
+        cpathname: *mut PyObject,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyImport_GetModuleDict")]
+    pub fn PyImport_GetModuleDict() -> *mut PyObject;
+    // skipped Python 3.7 / ex-non-limited PyImport_GetModule
+    pub fn PyImport_AddModuleObject(name: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyImport_AddModule")]
+    pub fn PyImport_AddModule(name: *const c_char) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyImport_ImportModule")]
+    pub fn PyImport_ImportModule(name: *const c_char) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyImport_ImportModuleNoBlock")]
+    pub fn PyImport_ImportModuleNoBlock(name: *const c_char) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyImport_ImportModuleLevel")]
+    pub fn PyImport_ImportModuleLevel(
+        name: *const c_char,
+        globals: *mut PyObject,
+        locals: *mut PyObject,
+        fromlist: *mut PyObject,
+        level: c_int,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyImport_ImportModuleLevelObject")]
+    pub fn PyImport_ImportModuleLevelObject(
+        name: *mut PyObject,
+        globals: *mut PyObject,
+        locals: *mut PyObject,
+        fromlist: *mut PyObject,
+        level: c_int,
+    ) -> *mut PyObject;
+}
+
+#[inline]
+pub unsafe fn PyImport_ImportModuleEx(
+    name: *const c_char,
+    globals: *mut PyObject,
+    locals: *mut PyObject,
+    fromlist: *mut PyObject,
+) -> *mut PyObject {
+    PyImport_ImportModuleLevel(name, globals, locals, fromlist, 0)
+}
+
+extern "C" {
+    pub fn PyImport_GetImporter(path: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyImport_Import")]
+    pub fn PyImport_Import(name: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyImport_ReloadModule")]
+    pub fn PyImport_ReloadModule(m: *mut PyObject) -> *mut PyObject;
+    #[cfg(not(Py_3_9))]
+    #[deprecated(note = "Removed in Python 3.9 as it was \"For internal use only\".")]
+    pub fn PyImport_Cleanup();
+    pub fn PyImport_ImportFrozenModuleObject(name: *mut PyObject) -> c_int;
+    pub fn PyImport_ImportFrozenModule(name: *const c_char) -> c_int;
+
+    pub fn PyImport_AppendInittab(
+        name: *const c_char,
+        initfunc: Option<unsafe extern "C" fn() -> *mut PyObject>,
+    ) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/intrcheck.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/intrcheck.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/intrcheck.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/intrcheck.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,19 @@
+use std::os::raw::c_int;
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyOS_InterruptOccurred")]
+    pub fn PyOS_InterruptOccurred() -> c_int;
+    #[cfg(not(Py_3_10))]
+    #[deprecated(note = "Not documented in Python API; see Python 3.10 release notes")]
+    pub fn PyOS_InitInterrupts();
+
+    pub fn PyOS_BeforeFork();
+    pub fn PyOS_AfterFork_Parent();
+    pub fn PyOS_AfterFork_Child();
+    #[deprecated(note = "use PyOS_AfterFork_Child instead")]
+    #[cfg_attr(PyPy, link_name = "PyPyOS_AfterFork")]
+    pub fn PyOS_AfterFork();
+
+    // skipped non-limited _PyOS_IsMainThread
+    // skipped non-limited Windows _PyOS_SigintEvent
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/iterobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/iterobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/iterobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/iterobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,29 @@
+use crate::object::*;
+use std::os::raw::c_int;
+use std::ptr::addr_of_mut;
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    pub static mut PySeqIter_Type: PyTypeObject;
+    pub static mut PyCallIter_Type: PyTypeObject;
+}
+
+#[inline]
+pub unsafe fn PySeqIter_Check(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PySeqIter_Type)) as c_int
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPySeqIter_New")]
+    pub fn PySeqIter_New(arg1: *mut PyObject) -> *mut PyObject;
+}
+
+#[inline]
+pub unsafe fn PyCallIter_Check(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyCallIter_Type)) as c_int
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyCallIter_New")]
+    pub fn PyCallIter_New(arg1: *mut PyObject, arg2: *mut PyObject) -> *mut PyObject;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/lib.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,456 @@
+//! Raw FFI declarations for Python's C API.
+//!
+//! PyO3 can be used to write native Python modules or run Python code and modules from Rust.
+//!
+//! This crate just provides low level bindings to the Python interpreter.
+//! It is meant for advanced users only - regular PyO3 users shouldn't
+//! need to interact with this crate at all.
+//!
+//! The contents of this crate are not documented here, as it would entail
+//! basically copying the documentation from CPython. Consult the [Python/C API Reference
+//! Manual][capi] for up-to-date documentation.
+//!
+//! # Safety
+//!
+//! The functions in this crate lack individual safety documentation, but
+//! generally the following apply:
+//! - Pointer arguments have to point to a valid Python object of the correct type,
+//! although null pointers are sometimes valid input.
+//! - The vast majority can only be used safely while the GIL is held.
+//! - Some functions have additional safety requirements, consult the
+//! [Python/C API Reference Manual][capi]
+//! for more information.
+//!
+//!
+//! # Feature flags
+//!
+//! PyO3 uses [feature flags] to enable you to opt-in to additional functionality. For a detailed
+//! description, see the [Features chapter of the guide].
+//!
+//! ## Optional feature flags
+//!
+//! The following features customize PyO3's behavior:
+//!
+//! - `abi3`: Restricts PyO3's API to a subset of the full Python API which is guaranteed by
+//! [PEP 384] to be forward-compatible with future Python versions.
+//! - `extension-module`: This will tell the linker to keep the Python symbols unresolved, so that
+//! your module can also be used with statically linked Python interpreters. Use this feature when
+//! building an extension module.
+//!
+//! ## `rustc` environment flags
+//!
+//! PyO3 uses `rustc`'s `--cfg` flags to enable or disable code used for different Python versions.
+//! If you want to do this for your own crate, you can do so with the [`pyo3-build-config`] crate.
+//!
+//! - `Py_3_7`, `Py_3_8`, `Py_3_9`, `Py_3_10`: Marks code that is only enabled when
+//!  compiling for a given minimum Python version.
+//! - `Py_LIMITED_API`: Marks code enabled when the `abi3` feature flag is enabled.
+//! - `PyPy` - Marks code enabled when compiling for PyPy.
+//!
+//! # Minimum supported Rust and Python versions
+//!
+//! PyO3 supports the following software versions:
+//!   - Python 3.7 and up (CPython and PyPy)
+//!   - Rust 1.63 and up
+//!
+//! # Example: Building Python Native modules
+//!
+//! PyO3 can be used to generate a native Python module. The easiest way to try this out for the
+//! first time is to use [`maturin`]. `maturin` is a tool for building and publishing Rust-based
+//! Python packages with minimal configuration. The following steps set up some files for an example
+//! Python module, install `maturin`, and then show how to build and import the Python module.
+//!
+//! First, create a new folder (let's call it `string_sum`) containing the following two files:
+//!
+//! **`Cargo.toml`**
+//!
+//! ```toml
+//! [lib]
+//! name = "string_sum"
+//! # "cdylib" is necessary to produce a shared library for Python to import from.
+//! #
+//! # Downstream Rust code (including code in `bin/`, `examples/`, and `tests/`) will not be able
+//! # to `use string_sum;` unless the "rlib" or "lib" crate type is also included, e.g.:
+//! # crate-type = ["cdylib", "rlib"]
+//! crate-type = ["cdylib"]
+//!
+//! [dependencies.pyo3-ffi]
+#![doc = concat!("version = \"", env!("CARGO_PKG_VERSION"),  "\"")]
+//! features = ["extension-module"]
+//! ```
+//!
+//! **`src/lib.rs`**
+//! ```rust
+//! use std::os::raw::c_char;
+//! use std::ptr;
+//!
+//! use pyo3_ffi::*;
+//!
+//! static mut MODULE_DEF: PyModuleDef = PyModuleDef {
+//!     m_base: PyModuleDef_HEAD_INIT,
+//!     m_name: c_str!("string_sum").as_ptr(),
+//!     m_doc: c_str!("A Python module written in Rust.").as_ptr(),
+//!     m_size: 0,
+//!     m_methods: unsafe { METHODS.as_mut_ptr().cast() },
+//!     m_slots: std::ptr::null_mut(),
+//!     m_traverse: None,
+//!     m_clear: None,
+//!     m_free: None,
+//! };
+//!
+//! static mut METHODS: [PyMethodDef; 2] = [
+//!     PyMethodDef {
+//!         ml_name: c_str!("sum_as_string").as_ptr(),
+//!         ml_meth: PyMethodDefPointer {
+//!             _PyCFunctionFast: sum_as_string,
+//!         },
+//!         ml_flags: METH_FASTCALL,
+//!         ml_doc: c_str!("returns the sum of two integers as a string").as_ptr(),
+//!     },
+//!     // A zeroed PyMethodDef to mark the end of the array.
+//!     PyMethodDef::zeroed()
+//! ];
+//!
+//! // The module initialization function, which must be named `PyInit_<your_module>`.
+//! #[allow(non_snake_case)]
+//! #[no_mangle]
+//! pub unsafe extern "C" fn PyInit_string_sum() -> *mut PyObject {
+//!     PyModule_Create(ptr::addr_of_mut!(MODULE_DEF))
+//! }
+//!
+//! pub unsafe extern "C" fn sum_as_string(
+//!     _self: *mut PyObject,
+//!     args: *mut *mut PyObject,
+//!     nargs: Py_ssize_t,
+//! ) -> *mut PyObject {
+//!     if nargs != 2 {
+//!         PyErr_SetString(
+//!             PyExc_TypeError,
+//!             c_str!("sum_as_string() expected 2 positional arguments").as_ptr(),
+//!         );
+//!         return std::ptr::null_mut();
+//!     }
+//!
+//!     let arg1 = *args;
+//!     if PyLong_Check(arg1) == 0 {
+//!         PyErr_SetString(
+//!             PyExc_TypeError,
+//!             c_str!("sum_as_string() expected an int for positional argument 1").as_ptr(),
+//!         );
+//!         return std::ptr::null_mut();
+//!     }
+//!
+//!     let arg1 = PyLong_AsLong(arg1);
+//!     if !PyErr_Occurred().is_null() {
+//!         return ptr::null_mut();
+//!     }
+//!
+//!     let arg2 = *args.add(1);
+//!     if PyLong_Check(arg2) == 0 {
+//!         PyErr_SetString(
+//!             PyExc_TypeError,
+//!             c_str!("sum_as_string() expected an int for positional argument 2").as_ptr(),
+//!         );
+//!         return std::ptr::null_mut();
+//!     }
+//!
+//!     let arg2 = PyLong_AsLong(arg2);
+//!     if !PyErr_Occurred().is_null() {
+//!         return ptr::null_mut();
+//!     }
+//!
+//!     match arg1.checked_add(arg2) {
+//!         Some(sum) => {
+//!             let string = sum.to_string();
+//!             PyUnicode_FromStringAndSize(string.as_ptr().cast::<c_char>(), string.len() as isize)
+//!         }
+//!         None => {
+//!             PyErr_SetString(
+//!                 PyExc_OverflowError,
+//!                 c_str!("arguments too large to add").as_ptr(),
+//!             );
+//!             std::ptr::null_mut()
+//!         }
+//!     }
+//! }
+//! ```
+//!
+//! With those two files in place, now `maturin` needs to be installed. This can be done using
+//! Python's package manager `pip`. First, load up a new Python `virtualenv`, and install `maturin`
+//! into it:
+//! ```bash
+//! $ cd string_sum
+//! $ python -m venv .env
+//! $ source .env/bin/activate
+//! $ pip install maturin
+//! ```
+//!
+//! Now build and execute the module:
+//! ```bash
+//! $ maturin develop
+//! # lots of progress output as maturin runs the compilation...
+//! $ python
+//! >>> import string_sum
+//! >>> string_sum.sum_as_string(5, 20)
+//! '25'
+//! ```
+//!
+//! As well as with `maturin`, it is possible to build using [setuptools-rust] or
+//! [manually][manual_builds]. Both offer more flexibility than `maturin` but require further
+//! configuration.
+//!
+//!
+//! # Using Python from Rust
+//!
+//! To embed Python into a Rust binary, you need to ensure that your Python installation contains a
+//! shared library. The following steps demonstrate how to ensure this (for Ubuntu).
+//!
+//! To install the Python shared library on Ubuntu:
+//! ```bash
+//! sudo apt install python3-dev
+//! ```
+//!
+//! While most projects use the safe wrapper provided by pyo3,
+//! you can take a look at the [`orjson`] library as an example on how to use `pyo3-ffi` directly.
+//! For those well versed in C and Rust the [tutorials] from the CPython documentation
+//! can be easily converted to rust as well.
+//!
+//! [tutorials]: https://docs.python.org/3/extending/
+//! [`orjson`]: https://github.com/ijl/orjson
+//! [capi]: https://docs.python.org/3/c-api/index.html
+//! [`maturin`]: https://github.com/PyO3/maturin "Build and publish crates with pyo3, rust-cpython and cffi bindings as well as rust binaries as python packages"
+//! [`pyo3-build-config`]: https://docs.rs/pyo3-build-config
+//! [feature flags]: https://doc.rust-lang.org/cargo/reference/features.html "Features - The Cargo Book"
+#![doc = concat!("[manual_builds]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/building-and-distribution.html#manual-builds \"Manual builds - Building and Distribution - PyO3 user guide\"")]
+//! [setuptools-rust]: https://github.com/PyO3/setuptools-rust "Setuptools plugin for Rust extensions"
+//! [PEP 384]: https://www.python.org/dev/peps/pep-0384 "PEP 384 -- Defining a Stable ABI"
+#![doc = concat!("[Features chapter of the guide]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/features.html#features-reference \"Features Reference - PyO3 user guide\"")]
+#![allow(
+    missing_docs,
+    non_camel_case_types,
+    non_snake_case,
+    non_upper_case_globals,
+    clippy::upper_case_acronyms,
+    clippy::missing_safety_doc
+)]
+#![warn(elided_lifetimes_in_paths, unused_lifetimes)]
+
+// Until `extern type` is stabilized, use the recommended approach to
+// model opaque types:
+// https://doc.rust-lang.org/nomicon/ffi.html#representing-opaque-structs
+macro_rules! opaque_struct {
+    ($name:ident) => {
+        #[repr(C)]
+        pub struct $name([u8; 0]);
+    };
+}
+
+/// This is a helper macro to create a `&'static CStr`.
+///
+/// It can be used on all Rust versions supported by PyO3, unlike c"" literals which
+/// were stabilised in Rust 1.77.
+///
+/// Due to the nature of PyO3 making heavy use of C FFI interop with Python, it is
+/// common for PyO3 to use CStr.
+///
+/// Examples:
+///
+/// ```rust
+/// use std::ffi::CStr;
+///
+/// const HELLO: &CStr = pyo3_ffi::c_str!("hello");
+/// static WORLD: &CStr = pyo3_ffi::c_str!("world");
+/// ```
+#[macro_export]
+macro_rules! c_str {
+    ($s:expr) => {
+        $crate::_cstr_from_utf8_with_nul_checked(concat!($s, "\0"))
+    };
+}
+
+/// Private helper for `c_str!` macro.
+#[doc(hidden)]
+pub const fn _cstr_from_utf8_with_nul_checked(s: &str) -> &CStr {
+    // TODO: Replace this implementation with `CStr::from_bytes_with_nul` when MSRV above 1.72.
+    let bytes = s.as_bytes();
+    let len = bytes.len();
+    assert!(
+        !bytes.is_empty() && bytes[bytes.len() - 1] == b'\0',
+        "string is not nul-terminated"
+    );
+    let mut i = 0;
+    let non_null_len = len - 1;
+    while i < non_null_len {
+        assert!(bytes[i] != b'\0', "string contains null bytes");
+        i += 1;
+    }
+
+    unsafe { CStr::from_bytes_with_nul_unchecked(bytes) }
+}
+
+use std::ffi::CStr;
+
+pub use self::abstract_::*;
+pub use self::bltinmodule::*;
+pub use self::boolobject::*;
+pub use self::bytearrayobject::*;
+pub use self::bytesobject::*;
+pub use self::ceval::*;
+#[cfg(Py_LIMITED_API)]
+pub use self::code::*;
+pub use self::codecs::*;
+pub use self::compile::*;
+pub use self::complexobject::*;
+#[cfg(all(Py_3_8, not(Py_LIMITED_API)))]
+pub use self::context::*;
+#[cfg(not(Py_LIMITED_API))]
+pub use self::datetime::*;
+pub use self::descrobject::*;
+pub use self::dictobject::*;
+pub use self::enumobject::*;
+pub use self::fileobject::*;
+pub use self::fileutils::*;
+pub use self::floatobject::*;
+pub use self::import::*;
+pub use self::intrcheck::*;
+pub use self::iterobject::*;
+pub use self::listobject::*;
+pub use self::longobject::*;
+#[cfg(not(Py_LIMITED_API))]
+pub use self::marshal::*;
+pub use self::memoryobject::*;
+pub use self::methodobject::*;
+pub use self::modsupport::*;
+pub use self::moduleobject::*;
+pub use self::object::*;
+pub use self::objimpl::*;
+pub use self::osmodule::*;
+#[cfg(not(any(PyPy, Py_LIMITED_API, Py_3_10)))]
+pub use self::pyarena::*;
+#[cfg(Py_3_11)]
+pub use self::pybuffer::*;
+pub use self::pycapsule::*;
+pub use self::pyerrors::*;
+pub use self::pyframe::*;
+pub use self::pyhash::*;
+pub use self::pylifecycle::*;
+pub use self::pymem::*;
+pub use self::pyport::*;
+pub use self::pystate::*;
+pub use self::pystrtod::*;
+pub use self::pythonrun::*;
+pub use self::rangeobject::*;
+pub use self::setobject::*;
+pub use self::sliceobject::*;
+pub use self::structseq::*;
+pub use self::sysmodule::*;
+pub use self::traceback::*;
+pub use self::tupleobject::*;
+pub use self::typeslots::*;
+pub use self::unicodeobject::*;
+pub use self::warnings::*;
+pub use self::weakrefobject::*;
+
+mod abstract_;
+// skipped asdl.h
+// skipped ast.h
+mod bltinmodule;
+mod boolobject;
+mod bytearrayobject;
+mod bytesobject;
+// skipped cellobject.h
+mod ceval;
+// skipped classobject.h
+#[cfg(Py_LIMITED_API)]
+mod code;
+mod codecs;
+mod compile;
+mod complexobject;
+#[cfg(all(Py_3_8, not(Py_LIMITED_API)))]
+mod context; // It's actually 3.7.1, but no cfg for patches.
+#[cfg(not(Py_LIMITED_API))]
+pub(crate) mod datetime;
+mod descrobject;
+mod dictobject;
+// skipped dynamic_annotations.h
+mod enumobject;
+// skipped errcode.h
+// skipped exports.h
+mod fileobject;
+mod fileutils;
+mod floatobject;
+// skipped empty frameobject.h
+// skipped genericaliasobject.h
+mod import;
+// skipped interpreteridobject.h
+mod intrcheck;
+mod iterobject;
+mod listobject;
+// skipped longintrepr.h
+mod longobject;
+#[cfg(not(Py_LIMITED_API))]
+pub mod marshal;
+mod memoryobject;
+mod methodobject;
+mod modsupport;
+mod moduleobject;
+// skipped namespaceobject.h
+mod object;
+mod objimpl;
+// skipped odictobject.h
+// skipped opcode.h
+// skipped osdefs.h
+mod osmodule;
+// skipped parser_interface.h
+// skipped patchlevel.h
+// skipped picklebufobject.h
+// skipped pyctype.h
+// skipped py_curses.h
+#[cfg(not(any(PyPy, Py_LIMITED_API, Py_3_10)))]
+mod pyarena;
+#[cfg(Py_3_11)]
+mod pybuffer;
+mod pycapsule;
+// skipped pydtrace.h
+mod pyerrors;
+// skipped pyexpat.h
+// skipped pyfpe.h
+mod pyframe;
+mod pyhash;
+mod pylifecycle;
+// skipped pymacconfig.h
+// skipped pymacro.h
+// skipped pymath.h
+mod pymem;
+mod pyport;
+mod pystate;
+// skipped pystats.h
+mod pythonrun;
+// skipped pystrhex.h
+// skipped pystrcmp.h
+mod pystrtod;
+// skipped pythread.h
+// skipped pytime.h
+mod rangeobject;
+mod setobject;
+mod sliceobject;
+mod structseq;
+mod sysmodule;
+mod traceback;
+// skipped tracemalloc.h
+mod tupleobject;
+mod typeslots;
+mod unicodeobject;
+mod warnings;
+mod weakrefobject;
+
+// Additional headers that are not exported by Python.h
+#[deprecated(note = "Python 3.12")]
+pub mod structmember;
+
+// "Limited API" definitions matching Python's `include/cpython` directory.
+#[cfg(not(Py_LIMITED_API))]
+mod cpython;
+
+#[cfg(not(Py_LIMITED_API))]
+pub use self::cpython::*;
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/listobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/listobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/listobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/listobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,69 @@
+use crate::object::*;
+use crate::pyport::Py_ssize_t;
+use std::os::raw::c_int;
+use std::ptr::addr_of_mut;
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyList_Type")]
+    pub static mut PyList_Type: PyTypeObject;
+    pub static mut PyListIter_Type: PyTypeObject;
+    pub static mut PyListRevIter_Type: PyTypeObject;
+}
+
+#[inline]
+pub unsafe fn PyList_Check(op: *mut PyObject) -> c_int {
+    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS)
+}
+
+#[inline]
+pub unsafe fn PyList_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyList_Type)) as c_int
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyList_New")]
+    pub fn PyList_New(size: Py_ssize_t) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyList_Size")]
+    pub fn PyList_Size(arg1: *mut PyObject) -> Py_ssize_t;
+    #[cfg_attr(PyPy, link_name = "PyPyList_GetItem")]
+    pub fn PyList_GetItem(arg1: *mut PyObject, arg2: Py_ssize_t) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyList_SetItem")]
+    pub fn PyList_SetItem(arg1: *mut PyObject, arg2: Py_ssize_t, arg3: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyList_Insert")]
+    pub fn PyList_Insert(arg1: *mut PyObject, arg2: Py_ssize_t, arg3: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyList_Append")]
+    pub fn PyList_Append(arg1: *mut PyObject, arg2: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyList_GetSlice")]
+    pub fn PyList_GetSlice(
+        arg1: *mut PyObject,
+        arg2: Py_ssize_t,
+        arg3: Py_ssize_t,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyList_SetSlice")]
+    pub fn PyList_SetSlice(
+        arg1: *mut PyObject,
+        arg2: Py_ssize_t,
+        arg3: Py_ssize_t,
+        arg4: *mut PyObject,
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyList_Sort")]
+    pub fn PyList_Sort(arg1: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyList_Reverse")]
+    pub fn PyList_Reverse(arg1: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyList_AsTuple")]
+    pub fn PyList_AsTuple(arg1: *mut PyObject) -> *mut PyObject;
+
+    // CPython macros exported as functions on PyPy or GraalPy
+    #[cfg(any(PyPy, GraalPy))]
+    #[cfg_attr(PyPy, link_name = "PyPyList_GET_ITEM")]
+    #[cfg_attr(GraalPy, link_name = "PyList_GetItem")]
+    pub fn PyList_GET_ITEM(arg1: *mut PyObject, arg2: Py_ssize_t) -> *mut PyObject;
+    #[cfg(PyPy)]
+    #[cfg_attr(PyPy, link_name = "PyPyList_GET_SIZE")]
+    pub fn PyList_GET_SIZE(arg1: *mut PyObject) -> Py_ssize_t;
+    #[cfg(any(PyPy, GraalPy))]
+    #[cfg_attr(PyPy, link_name = "PyPyList_SET_ITEM")]
+    #[cfg_attr(GraalPy, link_name = "_PyList_SET_ITEM")]
+    pub fn PyList_SET_ITEM(arg1: *mut PyObject, arg2: Py_ssize_t, arg3: *mut PyObject);
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/longobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/longobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/longobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/longobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,110 @@
+use crate::object::*;
+use crate::pyport::Py_ssize_t;
+use libc::size_t;
+use std::os::raw::{c_char, c_double, c_int, c_long, c_longlong, c_ulong, c_ulonglong, c_void};
+use std::ptr::addr_of_mut;
+
+opaque_struct!(PyLongObject);
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyLong_Type")]
+    pub static mut PyLong_Type: PyTypeObject;
+}
+
+#[inline]
+pub unsafe fn PyLong_Check(op: *mut PyObject) -> c_int {
+    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
+}
+
+#[inline]
+pub unsafe fn PyLong_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyLong_Type)) as c_int
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyLong_FromLong")]
+    pub fn PyLong_FromLong(arg1: c_long) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyLong_FromUnsignedLong")]
+    pub fn PyLong_FromUnsignedLong(arg1: c_ulong) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyLong_FromSize_t")]
+    pub fn PyLong_FromSize_t(arg1: size_t) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyLong_FromSsize_t")]
+    pub fn PyLong_FromSsize_t(arg1: Py_ssize_t) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyLong_FromDouble")]
+    pub fn PyLong_FromDouble(arg1: c_double) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyLong_AsLong")]
+    pub fn PyLong_AsLong(arg1: *mut PyObject) -> c_long;
+    #[cfg_attr(PyPy, link_name = "PyPyLong_AsLongAndOverflow")]
+    pub fn PyLong_AsLongAndOverflow(arg1: *mut PyObject, arg2: *mut c_int) -> c_long;
+    #[cfg_attr(PyPy, link_name = "PyPyLong_AsSsize_t")]
+    pub fn PyLong_AsSsize_t(arg1: *mut PyObject) -> Py_ssize_t;
+    #[cfg_attr(PyPy, link_name = "PyPyLong_AsSize_t")]
+    pub fn PyLong_AsSize_t(arg1: *mut PyObject) -> size_t;
+    #[cfg_attr(PyPy, link_name = "PyPyLong_AsUnsignedLong")]
+    pub fn PyLong_AsUnsignedLong(arg1: *mut PyObject) -> c_ulong;
+    #[cfg_attr(PyPy, link_name = "PyPyLong_AsUnsignedLongMask")]
+    pub fn PyLong_AsUnsignedLongMask(arg1: *mut PyObject) -> c_ulong;
+    // skipped non-limited _PyLong_AsInt
+    pub fn PyLong_GetInfo() -> *mut PyObject;
+    // skipped PyLong_AS_LONG
+
+    // skipped PyLong_FromPid
+    // skipped PyLong_AsPid
+    // skipped _Py_PARSE_INTPTR
+    // skipped _Py_PARSE_UINTPTR
+
+    // skipped non-limited _PyLong_UnsignedShort_Converter
+    // skipped non-limited _PyLong_UnsignedInt_Converter
+    // skipped non-limited _PyLong_UnsignedLong_Converter
+    // skipped non-limited _PyLong_UnsignedLongLong_Converter
+    // skipped non-limited _PyLong_Size_t_Converter
+
+    // skipped non-limited _PyLong_DigitValue
+    // skipped non-limited _PyLong_Frexp
+
+    #[cfg_attr(PyPy, link_name = "PyPyLong_AsDouble")]
+    pub fn PyLong_AsDouble(arg1: *mut PyObject) -> c_double;
+    #[cfg_attr(PyPy, link_name = "PyPyLong_FromVoidPtr")]
+    pub fn PyLong_FromVoidPtr(arg1: *mut c_void) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyLong_AsVoidPtr")]
+    pub fn PyLong_AsVoidPtr(arg1: *mut PyObject) -> *mut c_void;
+    #[cfg_attr(PyPy, link_name = "PyPyLong_FromLongLong")]
+    pub fn PyLong_FromLongLong(arg1: c_longlong) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyLong_FromUnsignedLongLong")]
+    pub fn PyLong_FromUnsignedLongLong(arg1: c_ulonglong) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyLong_AsLongLong")]
+    pub fn PyLong_AsLongLong(arg1: *mut PyObject) -> c_longlong;
+    #[cfg_attr(PyPy, link_name = "PyPyLong_AsUnsignedLongLong")]
+    pub fn PyLong_AsUnsignedLongLong(arg1: *mut PyObject) -> c_ulonglong;
+    #[cfg_attr(PyPy, link_name = "PyPyLong_AsUnsignedLongLongMask")]
+    pub fn PyLong_AsUnsignedLongLongMask(arg1: *mut PyObject) -> c_ulonglong;
+    #[cfg_attr(PyPy, link_name = "PyPyLong_AsLongLongAndOverflow")]
+    pub fn PyLong_AsLongLongAndOverflow(arg1: *mut PyObject, arg2: *mut c_int) -> c_longlong;
+    #[cfg_attr(PyPy, link_name = "PyPyLong_FromString")]
+    pub fn PyLong_FromString(
+        arg1: *const c_char,
+        arg2: *mut *mut c_char,
+        arg3: c_int,
+    ) -> *mut PyObject;
+}
+
+#[cfg(not(Py_LIMITED_API))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "_PyPyLong_NumBits")]
+    #[cfg(not(Py_3_13))]
+    pub fn _PyLong_NumBits(obj: *mut PyObject) -> size_t;
+}
+
+// skipped non-limited _PyLong_Format
+// skipped non-limited _PyLong_FormatWriter
+// skipped non-limited _PyLong_FormatBytesWriter
+// skipped non-limited _PyLong_FormatAdvancedWriter
+
+extern "C" {
+    pub fn PyOS_strtoul(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_ulong;
+    pub fn PyOS_strtol(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_long;
+}
+
+// skipped non-limited _PyLong_Rshift
+// skipped non-limited _PyLong_Lshift
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/marshal.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/marshal.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/marshal.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/marshal.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,19 @@
+use super::{PyObject, Py_ssize_t};
+use std::os::raw::{c_char, c_int};
+
+// skipped Py_MARSHAL_VERSION
+// skipped PyMarshal_WriteLongToFile
+// skipped PyMarshal_WriteObjectToFile
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyMarshal_WriteObjectToString")]
+    pub fn PyMarshal_WriteObjectToString(object: *mut PyObject, version: c_int) -> *mut PyObject;
+
+    // skipped non-limited PyMarshal_ReadLongFromFile
+    // skipped non-limited PyMarshal_ReadShortFromFile
+    // skipped non-limited PyMarshal_ReadObjectFromFile
+    // skipped non-limited PyMarshal_ReadLastObjectFromFile
+
+    #[cfg_attr(PyPy, link_name = "PyPyMarshal_ReadObjectFromString")]
+    pub fn PyMarshal_ReadObjectFromString(data: *const c_char, len: Py_ssize_t) -> *mut PyObject;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/memoryobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/memoryobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/memoryobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/memoryobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,46 @@
+use crate::object::*;
+use crate::pyport::Py_ssize_t;
+use std::os::raw::{c_char, c_int};
+use std::ptr::addr_of_mut;
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg(not(Py_LIMITED_API))]
+    pub static mut _PyManagedBuffer_Type: PyTypeObject;
+
+    #[cfg_attr(PyPy, link_name = "PyPyMemoryView_Type")]
+    pub static mut PyMemoryView_Type: PyTypeObject;
+}
+
+#[inline]
+pub unsafe fn PyMemoryView_Check(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyMemoryView_Type)) as c_int
+}
+
+// skipped non-limited PyMemoryView_GET_BUFFER
+// skipped non-limited PyMemeryView_GET_BASE
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyMemoryView_FromObject")]
+    pub fn PyMemoryView_FromObject(base: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyMemoryView_FromMemory")]
+    pub fn PyMemoryView_FromMemory(
+        mem: *mut c_char,
+        size: Py_ssize_t,
+        flags: c_int,
+    ) -> *mut PyObject;
+    #[cfg(any(Py_3_11, not(Py_LIMITED_API)))]
+    #[cfg_attr(PyPy, link_name = "PyPyMemoryView_FromBuffer")]
+    pub fn PyMemoryView_FromBuffer(view: *const crate::Py_buffer) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyMemoryView_GetContiguous")]
+    pub fn PyMemoryView_GetContiguous(
+        base: *mut PyObject,
+        buffertype: c_int,
+        order: c_char,
+    ) -> *mut PyObject;
+}
+
+// skipped remainder of file with comment:
+/* The structs are declared here so that macros can work, but they shouldn't
+be considered public. Don't access their fields directly, use the macros
+and functions instead! */
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/methodobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/methodobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/methodobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/methodobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,265 @@
+use crate::object::{PyObject, PyTypeObject, Py_TYPE};
+#[cfg(Py_3_9)]
+use crate::PyObject_TypeCheck;
+use std::os::raw::{c_char, c_int, c_void};
+use std::{mem, ptr};
+
+#[cfg(all(Py_3_9, not(Py_LIMITED_API), not(GraalPy)))]
+pub struct PyCFunctionObject {
+    pub ob_base: PyObject,
+    pub m_ml: *mut PyMethodDef,
+    pub m_self: *mut PyObject,
+    pub m_module: *mut PyObject,
+    pub m_weakreflist: *mut PyObject,
+    #[cfg(not(PyPy))]
+    pub vectorcall: Option<crate::vectorcallfunc>,
+}
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyCFunction_Type")]
+    pub static mut PyCFunction_Type: PyTypeObject;
+}
+
+#[cfg(Py_3_9)]
+#[inline]
+pub unsafe fn PyCFunction_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == ptr::addr_of_mut!(PyCFunction_Type)) as c_int
+}
+
+#[cfg(Py_3_9)]
+#[inline]
+pub unsafe fn PyCFunction_Check(op: *mut PyObject) -> c_int {
+    PyObject_TypeCheck(op, ptr::addr_of_mut!(PyCFunction_Type))
+}
+
+#[cfg(not(Py_3_9))]
+#[inline]
+pub unsafe fn PyCFunction_Check(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == ptr::addr_of_mut!(PyCFunction_Type)) as c_int
+}
+
+pub type PyCFunction =
+    unsafe extern "C" fn(slf: *mut PyObject, args: *mut PyObject) -> *mut PyObject;
+
+#[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
+pub type _PyCFunctionFast = unsafe extern "C" fn(
+    slf: *mut PyObject,
+    args: *mut *mut PyObject,
+    nargs: crate::pyport::Py_ssize_t,
+) -> *mut PyObject;
+
+pub type PyCFunctionWithKeywords = unsafe extern "C" fn(
+    slf: *mut PyObject,
+    args: *mut PyObject,
+    kwds: *mut PyObject,
+) -> *mut PyObject;
+
+#[cfg(not(Py_LIMITED_API))]
+pub type _PyCFunctionFastWithKeywords = unsafe extern "C" fn(
+    slf: *mut PyObject,
+    args: *const *mut PyObject,
+    nargs: crate::pyport::Py_ssize_t,
+    kwnames: *mut PyObject,
+) -> *mut PyObject;
+
+#[cfg(all(Py_3_9, not(Py_LIMITED_API)))]
+pub type PyCMethod = unsafe extern "C" fn(
+    slf: *mut PyObject,
+    defining_class: *mut PyTypeObject,
+    args: *const *mut PyObject,
+    nargs: crate::pyport::Py_ssize_t,
+    kwnames: *mut PyObject,
+) -> *mut PyObject;
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyCFunction_GetFunction")]
+    pub fn PyCFunction_GetFunction(f: *mut PyObject) -> Option<PyCFunction>;
+    pub fn PyCFunction_GetSelf(f: *mut PyObject) -> *mut PyObject;
+    pub fn PyCFunction_GetFlags(f: *mut PyObject) -> c_int;
+    #[cfg_attr(Py_3_9, deprecated(note = "Python 3.9"))]
+    pub fn PyCFunction_Call(
+        f: *mut PyObject,
+        args: *mut PyObject,
+        kwds: *mut PyObject,
+    ) -> *mut PyObject;
+}
+
+/// Represents the [PyMethodDef](https://docs.python.org/3/c-api/structures.html#c.PyMethodDef)
+/// structure.
+///
+/// Note that CPython may leave fields uninitialized. You must ensure that
+/// `ml_name` != NULL before dereferencing or reading other fields.
+#[repr(C)]
+#[derive(Copy, Clone, PartialEq, Eq)]
+pub struct PyMethodDef {
+    pub ml_name: *const c_char,
+    pub ml_meth: PyMethodDefPointer,
+    pub ml_flags: c_int,
+    pub ml_doc: *const c_char,
+}
+
+impl PyMethodDef {
+    pub const fn zeroed() -> PyMethodDef {
+        PyMethodDef {
+            ml_name: ptr::null(),
+            ml_meth: PyMethodDefPointer {
+                Void: ptr::null_mut(),
+            },
+            ml_flags: 0,
+            ml_doc: ptr::null(),
+        }
+    }
+}
+
+impl Default for PyMethodDef {
+    fn default() -> PyMethodDef {
+        PyMethodDef {
+            ml_name: ptr::null(),
+            ml_meth: PyMethodDefPointer {
+                Void: ptr::null_mut(),
+            },
+            ml_flags: 0,
+            ml_doc: ptr::null(),
+        }
+    }
+}
+
+/// Function types used to implement Python callables.
+///
+/// This function pointer must be accompanied by the correct [ml_flags](PyMethodDef::ml_flags),
+/// otherwise the behavior is undefined.
+///
+/// See the [Python C API documentation][1] for more information.
+///
+/// [1]: https://docs.python.org/3/c-api/structures.html#implementing-functions-and-methods
+#[repr(C)]
+#[derive(Copy, Clone, Eq)]
+pub union PyMethodDefPointer {
+    /// This variant corresponds with [`METH_VARARGS`] *or* [`METH_NOARGS`] *or* [`METH_O`].
+    pub PyCFunction: PyCFunction,
+
+    /// This variant corresponds with [`METH_VARARGS`] | [`METH_KEYWORDS`].
+    pub PyCFunctionWithKeywords: PyCFunctionWithKeywords,
+
+    /// This variant corresponds with [`METH_FASTCALL`].
+    #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
+    pub _PyCFunctionFast: _PyCFunctionFast,
+
+    /// This variant corresponds with [`METH_FASTCALL`] | [`METH_KEYWORDS`].
+    #[cfg(not(Py_LIMITED_API))]
+    pub _PyCFunctionFastWithKeywords: _PyCFunctionFastWithKeywords,
+
+    /// This variant corresponds with [`METH_METHOD`] | [`METH_FASTCALL`] | [`METH_KEYWORDS`].
+    #[cfg(all(Py_3_9, not(Py_LIMITED_API)))]
+    pub PyCMethod: PyCMethod,
+
+    Void: *mut c_void,
+}
+
+impl PyMethodDefPointer {
+    pub fn as_ptr(&self) -> *mut c_void {
+        unsafe { self.Void }
+    }
+
+    pub fn is_null(&self) -> bool {
+        self.as_ptr().is_null()
+    }
+
+    pub const fn zeroed() -> PyMethodDefPointer {
+        PyMethodDefPointer {
+            Void: ptr::null_mut(),
+        }
+    }
+}
+
+impl PartialEq for PyMethodDefPointer {
+    fn eq(&self, other: &Self) -> bool {
+        unsafe { self.Void == other.Void }
+    }
+}
+
+impl std::fmt::Pointer for PyMethodDefPointer {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        let ptr = unsafe { self.Void };
+        std::fmt::Pointer::fmt(&ptr, f)
+    }
+}
+
+const _: () =
+    assert!(mem::size_of::<PyMethodDefPointer>() == mem::size_of::<Option<extern "C" fn()>>());
+
+#[cfg(not(Py_3_9))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyCFunction_New")]
+    pub fn PyCFunction_New(ml: *mut PyMethodDef, slf: *mut PyObject) -> *mut PyObject;
+
+    #[cfg_attr(PyPy, link_name = "PyPyCFunction_NewEx")]
+    pub fn PyCFunction_NewEx(
+        ml: *mut PyMethodDef,
+        slf: *mut PyObject,
+        module: *mut PyObject,
+    ) -> *mut PyObject;
+}
+
+#[cfg(Py_3_9)]
+#[inline]
+pub unsafe fn PyCFunction_New(ml: *mut PyMethodDef, slf: *mut PyObject) -> *mut PyObject {
+    PyCFunction_NewEx(ml, slf, std::ptr::null_mut())
+}
+
+#[cfg(Py_3_9)]
+#[inline]
+pub unsafe fn PyCFunction_NewEx(
+    ml: *mut PyMethodDef,
+    slf: *mut PyObject,
+    module: *mut PyObject,
+) -> *mut PyObject {
+    PyCMethod_New(ml, slf, module, std::ptr::null_mut())
+}
+
+#[cfg(Py_3_9)]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyCMethod_New")]
+    pub fn PyCMethod_New(
+        ml: *mut PyMethodDef,
+        slf: *mut PyObject,
+        module: *mut PyObject,
+        cls: *mut PyTypeObject,
+    ) -> *mut PyObject;
+}
+
+/* Flag passed to newmethodobject */
+pub const METH_VARARGS: c_int = 0x0001;
+pub const METH_KEYWORDS: c_int = 0x0002;
+/* METH_NOARGS and METH_O must not be combined with the flags above. */
+pub const METH_NOARGS: c_int = 0x0004;
+pub const METH_O: c_int = 0x0008;
+
+/* METH_CLASS and METH_STATIC are a little different; these control
+the construction of methods for a class.  These cannot be used for
+functions in modules. */
+pub const METH_CLASS: c_int = 0x0010;
+pub const METH_STATIC: c_int = 0x0020;
+
+/* METH_COEXIST allows a method to be entered eventhough a slot has
+already filled the entry.  When defined, the flag allows a separate
+method, "__contains__" for example, to coexist with a defined
+slot like sq_contains. */
+
+pub const METH_COEXIST: c_int = 0x0040;
+
+/* METH_FASTCALL indicates the PEP 590 Vectorcall calling format. It may
+be specified alone or with METH_KEYWORDS. */
+#[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
+pub const METH_FASTCALL: c_int = 0x0080;
+
+// skipped METH_STACKLESS
+
+#[cfg(all(Py_3_9, not(Py_LIMITED_API)))]
+pub const METH_METHOD: c_int = 0x0200;
+
+extern "C" {
+    #[cfg(not(Py_3_9))]
+    pub fn PyCFunction_ClearFreeList() -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/modsupport.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/modsupport.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/modsupport.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/modsupport.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,167 @@
+use crate::methodobject::PyMethodDef;
+use crate::moduleobject::PyModuleDef;
+use crate::object::PyObject;
+use crate::pyport::Py_ssize_t;
+use std::os::raw::{c_char, c_int, c_long};
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyArg_Parse")]
+    pub fn PyArg_Parse(arg1: *mut PyObject, arg2: *const c_char, ...) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyArg_ParseTuple")]
+    pub fn PyArg_ParseTuple(arg1: *mut PyObject, arg2: *const c_char, ...) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyArg_ParseTupleAndKeywords")]
+    pub fn PyArg_ParseTupleAndKeywords(
+        arg1: *mut PyObject,
+        arg2: *mut PyObject,
+        arg3: *const c_char,
+        arg4: *mut *mut c_char,
+        ...
+    ) -> c_int;
+    pub fn PyArg_ValidateKeywordArguments(arg1: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyArg_UnpackTuple")]
+    pub fn PyArg_UnpackTuple(
+        arg1: *mut PyObject,
+        arg2: *const c_char,
+        arg3: Py_ssize_t,
+        arg4: Py_ssize_t,
+        ...
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPy_BuildValue")]
+    pub fn Py_BuildValue(arg1: *const c_char, ...) -> *mut PyObject;
+    // #[cfg_attr(PyPy, link_name = "_PyPy_BuildValue_SizeT")]
+    //pub fn _Py_BuildValue_SizeT(arg1: *const c_char, ...)
+    // -> *mut PyObject;
+    // #[cfg_attr(PyPy, link_name = "PyPy_VaBuildValue")]
+
+    // skipped non-limited _PyArg_UnpackStack
+    // skipped non-limited _PyArg_NoKeywords
+    // skipped non-limited _PyArg_NoKwnames
+    // skipped non-limited _PyArg_NoPositional
+    // skipped non-limited _PyArg_BadArgument
+    // skipped non-limited _PyArg_CheckPositional
+
+    //pub fn Py_VaBuildValue(arg1: *const c_char, arg2: va_list)
+    // -> *mut PyObject;
+
+    // skipped non-limited _Py_VaBuildStack
+    // skipped non-limited _PyArg_Parser
+
+    // skipped non-limited _PyArg_ParseTupleAndKeywordsFast
+    // skipped non-limited _PyArg_ParseStack
+    // skipped non-limited _PyArg_ParseStackAndKeywords
+    // skipped non-limited _PyArg_VaParseTupleAndKeywordsFast
+    // skipped non-limited _PyArg_UnpackKeywords
+    // skipped non-limited _PyArg_Fini
+
+    #[cfg(Py_3_10)]
+    #[cfg_attr(PyPy, link_name = "PyPyModule_AddObjectRef")]
+    pub fn PyModule_AddObjectRef(
+        module: *mut PyObject,
+        name: *const c_char,
+        value: *mut PyObject,
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyModule_AddObject")]
+    pub fn PyModule_AddObject(
+        module: *mut PyObject,
+        name: *const c_char,
+        value: *mut PyObject,
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyModule_AddIntConstant")]
+    pub fn PyModule_AddIntConstant(
+        module: *mut PyObject,
+        name: *const c_char,
+        value: c_long,
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyModule_AddStringConstant")]
+    pub fn PyModule_AddStringConstant(
+        module: *mut PyObject,
+        name: *const c_char,
+        value: *const c_char,
+    ) -> c_int;
+    #[cfg(any(Py_3_10, all(Py_3_9, not(Py_LIMITED_API))))]
+    #[cfg_attr(PyPy, link_name = "PyPyModule_AddType")]
+    pub fn PyModule_AddType(
+        module: *mut PyObject,
+        type_: *mut crate::object::PyTypeObject,
+    ) -> c_int;
+    // skipped PyModule_AddIntMacro
+    // skipped PyModule_AddStringMacro
+    pub fn PyModule_SetDocString(arg1: *mut PyObject, arg2: *const c_char) -> c_int;
+    pub fn PyModule_AddFunctions(arg1: *mut PyObject, arg2: *mut PyMethodDef) -> c_int;
+    pub fn PyModule_ExecDef(module: *mut PyObject, def: *mut PyModuleDef) -> c_int;
+}
+
+pub const Py_CLEANUP_SUPPORTED: i32 = 0x2_0000;
+
+pub const PYTHON_API_VERSION: i32 = 1013;
+pub const PYTHON_ABI_VERSION: i32 = 3;
+
+extern "C" {
+    #[cfg(not(py_sys_config = "Py_TRACE_REFS"))]
+    #[cfg_attr(PyPy, link_name = "PyPyModule_Create2")]
+    pub fn PyModule_Create2(module: *mut PyModuleDef, apiver: c_int) -> *mut PyObject;
+
+    #[cfg(py_sys_config = "Py_TRACE_REFS")]
+    fn PyModule_Create2TraceRefs(module: *mut PyModuleDef, apiver: c_int) -> *mut PyObject;
+
+    #[cfg(not(py_sys_config = "Py_TRACE_REFS"))]
+    pub fn PyModule_FromDefAndSpec2(
+        def: *mut PyModuleDef,
+        spec: *mut PyObject,
+        module_api_version: c_int,
+    ) -> *mut PyObject;
+
+    #[cfg(py_sys_config = "Py_TRACE_REFS")]
+    fn PyModule_FromDefAndSpec2TraceRefs(
+        def: *mut PyModuleDef,
+        spec: *mut PyObject,
+        module_api_version: c_int,
+    ) -> *mut PyObject;
+}
+
+#[cfg(py_sys_config = "Py_TRACE_REFS")]
+#[inline]
+pub unsafe fn PyModule_Create2(module: *mut PyModuleDef, apiver: c_int) -> *mut PyObject {
+    PyModule_Create2TraceRefs(module, apiver)
+}
+
+#[cfg(py_sys_config = "Py_TRACE_REFS")]
+#[inline]
+pub unsafe fn PyModule_FromDefAndSpec2(
+    def: *mut PyModuleDef,
+    spec: *mut PyObject,
+    module_api_version: c_int,
+) -> *mut PyObject {
+    PyModule_FromDefAndSpec2TraceRefs(def, spec, module_api_version)
+}
+
+#[inline]
+pub unsafe fn PyModule_Create(module: *mut PyModuleDef) -> *mut PyObject {
+    PyModule_Create2(
+        module,
+        if cfg!(Py_LIMITED_API) {
+            PYTHON_ABI_VERSION
+        } else {
+            PYTHON_API_VERSION
+        },
+    )
+}
+
+#[inline]
+pub unsafe fn PyModule_FromDefAndSpec(def: *mut PyModuleDef, spec: *mut PyObject) -> *mut PyObject {
+    PyModule_FromDefAndSpec2(
+        def,
+        spec,
+        if cfg!(Py_LIMITED_API) {
+            PYTHON_ABI_VERSION
+        } else {
+            PYTHON_API_VERSION
+        },
+    )
+}
+
+#[cfg(not(Py_LIMITED_API))]
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    pub static mut _Py_PackageContext: *const c_char;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/moduleobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/moduleobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/moduleobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/moduleobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,112 @@
+use crate::methodobject::PyMethodDef;
+use crate::object::*;
+use crate::pyport::Py_ssize_t;
+use std::os::raw::{c_char, c_int, c_void};
+use std::ptr::addr_of_mut;
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyModule_Type")]
+    pub static mut PyModule_Type: PyTypeObject;
+}
+
+#[inline]
+pub unsafe fn PyModule_Check(op: *mut PyObject) -> c_int {
+    PyObject_TypeCheck(op, addr_of_mut!(PyModule_Type))
+}
+
+#[inline]
+pub unsafe fn PyModule_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyModule_Type)) as c_int
+}
+
+extern "C" {
+    pub fn PyModule_NewObject(name: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyModule_New")]
+    pub fn PyModule_New(name: *const c_char) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyModule_GetDict")]
+    pub fn PyModule_GetDict(arg1: *mut PyObject) -> *mut PyObject;
+    #[cfg(not(PyPy))]
+    pub fn PyModule_GetNameObject(arg1: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyModule_GetName")]
+    pub fn PyModule_GetName(arg1: *mut PyObject) -> *const c_char;
+    #[cfg(not(all(windows, PyPy)))]
+    #[deprecated(note = "Python 3.2")]
+    pub fn PyModule_GetFilename(arg1: *mut PyObject) -> *const c_char;
+    #[cfg(not(PyPy))]
+    pub fn PyModule_GetFilenameObject(arg1: *mut PyObject) -> *mut PyObject;
+    // skipped non-limited _PyModule_Clear
+    // skipped non-limited _PyModule_ClearDict
+    // skipped non-limited _PyModuleSpec_IsInitializing
+    #[cfg_attr(PyPy, link_name = "PyPyModule_GetDef")]
+    pub fn PyModule_GetDef(arg1: *mut PyObject) -> *mut PyModuleDef;
+    #[cfg_attr(PyPy, link_name = "PyPyModule_GetState")]
+    pub fn PyModule_GetState(arg1: *mut PyObject) -> *mut c_void;
+    #[cfg_attr(PyPy, link_name = "PyPyModuleDef_Init")]
+    pub fn PyModuleDef_Init(arg1: *mut PyModuleDef) -> *mut PyObject;
+}
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    pub static mut PyModuleDef_Type: PyTypeObject;
+}
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyModuleDef_Base {
+    pub ob_base: PyObject,
+    pub m_init: Option<extern "C" fn() -> *mut PyObject>,
+    pub m_index: Py_ssize_t,
+    pub m_copy: *mut PyObject,
+}
+
+pub const PyModuleDef_HEAD_INIT: PyModuleDef_Base = PyModuleDef_Base {
+    ob_base: PyObject_HEAD_INIT,
+    m_init: None,
+    m_index: 0,
+    m_copy: std::ptr::null_mut(),
+};
+
+#[repr(C)]
+#[derive(Copy, Clone, Eq, PartialEq)]
+pub struct PyModuleDef_Slot {
+    pub slot: c_int,
+    pub value: *mut c_void,
+}
+
+impl Default for PyModuleDef_Slot {
+    fn default() -> PyModuleDef_Slot {
+        PyModuleDef_Slot {
+            slot: 0,
+            value: std::ptr::null_mut(),
+        }
+    }
+}
+
+pub const Py_mod_create: c_int = 1;
+pub const Py_mod_exec: c_int = 2;
+#[cfg(Py_3_12)]
+pub const Py_mod_multiple_interpreters: c_int = 3;
+
+#[cfg(Py_3_12)]
+pub const Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED: *mut c_void = 0 as *mut c_void;
+#[cfg(Py_3_12)]
+pub const Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED: *mut c_void = 1 as *mut c_void;
+#[cfg(Py_3_12)]
+pub const Py_MOD_PER_INTERPRETER_GIL_SUPPORTED: *mut c_void = 2 as *mut c_void;
+
+// skipped non-limited _Py_mod_LAST_SLOT
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyModuleDef {
+    pub m_base: PyModuleDef_Base,
+    pub m_name: *const c_char,
+    pub m_doc: *const c_char,
+    pub m_size: Py_ssize_t,
+    pub m_methods: *mut PyMethodDef,
+    pub m_slots: *mut PyModuleDef_Slot,
+    pub m_traverse: Option<traverseproc>,
+    pub m_clear: Option<inquiry>,
+    pub m_free: Option<freefunc>,
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/object.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/object.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/object.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/object.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,773 @@
+use crate::pyport::{Py_hash_t, Py_ssize_t};
+use std::mem;
+use std::os::raw::{c_char, c_int, c_uint, c_ulong, c_void};
+use std::ptr;
+
+#[cfg(Py_LIMITED_API)]
+opaque_struct!(PyTypeObject);
+
+#[cfg(not(Py_LIMITED_API))]
+pub use crate::cpython::object::PyTypeObject;
+
+// _PyObject_HEAD_EXTRA: conditionally defined in PyObject_HEAD_INIT
+// _PyObject_EXTRA_INIT: conditionally defined in PyObject_HEAD_INIT
+
+#[cfg(Py_3_12)]
+pub const _Py_IMMORTAL_REFCNT: Py_ssize_t = {
+    if cfg!(target_pointer_width = "64") {
+        c_uint::MAX as Py_ssize_t
+    } else {
+        // for 32-bit systems, use the lower 30 bits (see comment in CPython's object.h)
+        (c_uint::MAX >> 2) as Py_ssize_t
+    }
+};
+
+pub const PyObject_HEAD_INIT: PyObject = PyObject {
+    #[cfg(py_sys_config = "Py_TRACE_REFS")]
+    _ob_next: std::ptr::null_mut(),
+    #[cfg(py_sys_config = "Py_TRACE_REFS")]
+    _ob_prev: std::ptr::null_mut(),
+    #[cfg(Py_3_12)]
+    ob_refcnt: PyObjectObRefcnt { ob_refcnt: 1 },
+    #[cfg(not(Py_3_12))]
+    ob_refcnt: 1,
+    #[cfg(PyPy)]
+    ob_pypy_link: 0,
+    ob_type: std::ptr::null_mut(),
+};
+
+// skipped PyObject_VAR_HEAD
+// skipped Py_INVALID_SIZE
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+#[cfg(Py_3_12)]
+/// This union is anonymous in CPython, so the name was given by PyO3 because
+/// Rust unions need a name.
+pub union PyObjectObRefcnt {
+    pub ob_refcnt: Py_ssize_t,
+    #[cfg(target_pointer_width = "64")]
+    pub ob_refcnt_split: [crate::PY_UINT32_T; 2],
+}
+
+#[cfg(Py_3_12)]
+impl std::fmt::Debug for PyObjectObRefcnt {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        write!(f, "{}", unsafe { self.ob_refcnt })
+    }
+}
+
+#[cfg(not(Py_3_12))]
+pub type PyObjectObRefcnt = Py_ssize_t;
+
+#[repr(C)]
+#[derive(Copy, Clone, Debug)]
+pub struct PyObject {
+    #[cfg(py_sys_config = "Py_TRACE_REFS")]
+    pub _ob_next: *mut PyObject,
+    #[cfg(py_sys_config = "Py_TRACE_REFS")]
+    pub _ob_prev: *mut PyObject,
+    pub ob_refcnt: PyObjectObRefcnt,
+    #[cfg(PyPy)]
+    pub ob_pypy_link: Py_ssize_t,
+    pub ob_type: *mut PyTypeObject,
+}
+
+// skipped _PyObject_CAST
+
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct PyVarObject {
+    pub ob_base: PyObject,
+    #[cfg(not(GraalPy))]
+    pub ob_size: Py_ssize_t,
+}
+
+// skipped _PyVarObject_CAST
+
+#[inline]
+pub unsafe fn Py_Is(x: *mut PyObject, y: *mut PyObject) -> c_int {
+    (x == y).into()
+}
+
+#[inline]
+#[cfg(Py_3_12)]
+pub unsafe fn Py_REFCNT(ob: *mut PyObject) -> Py_ssize_t {
+    (*ob).ob_refcnt.ob_refcnt
+}
+
+#[inline]
+#[cfg(not(Py_3_12))]
+pub unsafe fn Py_REFCNT(ob: *mut PyObject) -> Py_ssize_t {
+    #[cfg(not(GraalPy))]
+    return (*ob).ob_refcnt;
+    #[cfg(GraalPy)]
+    return _Py_REFCNT(ob);
+}
+
+#[inline]
+pub unsafe fn Py_TYPE(ob: *mut PyObject) -> *mut PyTypeObject {
+    #[cfg(not(GraalPy))]
+    return (*ob).ob_type;
+    #[cfg(GraalPy)]
+    return _Py_TYPE(ob);
+}
+
+// PyLong_Type defined in longobject.rs
+// PyBool_Type defined in boolobject.rs
+
+#[inline]
+pub unsafe fn Py_SIZE(ob: *mut PyObject) -> Py_ssize_t {
+    #[cfg(not(GraalPy))]
+    {
+        debug_assert_ne!((*ob).ob_type, std::ptr::addr_of_mut!(crate::PyLong_Type));
+        debug_assert_ne!((*ob).ob_type, std::ptr::addr_of_mut!(crate::PyBool_Type));
+        (*ob.cast::<PyVarObject>()).ob_size
+    }
+    #[cfg(GraalPy)]
+    _Py_SIZE(ob)
+}
+
+#[inline]
+pub unsafe fn Py_IS_TYPE(ob: *mut PyObject, tp: *mut PyTypeObject) -> c_int {
+    (Py_TYPE(ob) == tp) as c_int
+}
+
+#[inline(always)]
+#[cfg(all(Py_3_12, target_pointer_width = "64"))]
+pub unsafe fn _Py_IsImmortal(op: *mut PyObject) -> c_int {
+    (((*op).ob_refcnt.ob_refcnt as crate::PY_INT32_T) < 0) as c_int
+}
+
+#[inline(always)]
+#[cfg(all(Py_3_12, target_pointer_width = "32"))]
+pub unsafe fn _Py_IsImmortal(op: *mut PyObject) -> c_int {
+    ((*op).ob_refcnt.ob_refcnt == _Py_IMMORTAL_REFCNT) as c_int
+}
+
+// skipped _Py_SET_REFCNT
+// skipped Py_SET_REFCNT
+// skipped _Py_SET_TYPE
+// skipped Py_SET_TYPE
+// skipped _Py_SET_SIZE
+// skipped Py_SET_SIZE
+
+pub type unaryfunc = unsafe extern "C" fn(*mut PyObject) -> *mut PyObject;
+pub type binaryfunc = unsafe extern "C" fn(*mut PyObject, *mut PyObject) -> *mut PyObject;
+pub type ternaryfunc =
+    unsafe extern "C" fn(*mut PyObject, *mut PyObject, *mut PyObject) -> *mut PyObject;
+pub type inquiry = unsafe extern "C" fn(*mut PyObject) -> c_int;
+pub type lenfunc = unsafe extern "C" fn(*mut PyObject) -> Py_ssize_t;
+pub type ssizeargfunc = unsafe extern "C" fn(*mut PyObject, Py_ssize_t) -> *mut PyObject;
+pub type ssizessizeargfunc =
+    unsafe extern "C" fn(*mut PyObject, Py_ssize_t, Py_ssize_t) -> *mut PyObject;
+pub type ssizeobjargproc = unsafe extern "C" fn(*mut PyObject, Py_ssize_t, *mut PyObject) -> c_int;
+pub type ssizessizeobjargproc =
+    unsafe extern "C" fn(*mut PyObject, Py_ssize_t, Py_ssize_t, arg4: *mut PyObject) -> c_int;
+pub type objobjargproc = unsafe extern "C" fn(*mut PyObject, *mut PyObject, *mut PyObject) -> c_int;
+
+pub type objobjproc = unsafe extern "C" fn(*mut PyObject, *mut PyObject) -> c_int;
+pub type visitproc = unsafe extern "C" fn(object: *mut PyObject, arg: *mut c_void) -> c_int;
+pub type traverseproc =
+    unsafe extern "C" fn(slf: *mut PyObject, visit: visitproc, arg: *mut c_void) -> c_int;
+
+pub type freefunc = unsafe extern "C" fn(*mut c_void);
+pub type destructor = unsafe extern "C" fn(*mut PyObject);
+pub type getattrfunc = unsafe extern "C" fn(*mut PyObject, *mut c_char) -> *mut PyObject;
+pub type getattrofunc = unsafe extern "C" fn(*mut PyObject, *mut PyObject) -> *mut PyObject;
+pub type setattrfunc = unsafe extern "C" fn(*mut PyObject, *mut c_char, *mut PyObject) -> c_int;
+pub type setattrofunc = unsafe extern "C" fn(*mut PyObject, *mut PyObject, *mut PyObject) -> c_int;
+pub type reprfunc = unsafe extern "C" fn(*mut PyObject) -> *mut PyObject;
+pub type hashfunc = unsafe extern "C" fn(*mut PyObject) -> Py_hash_t;
+pub type richcmpfunc = unsafe extern "C" fn(*mut PyObject, *mut PyObject, c_int) -> *mut PyObject;
+pub type getiterfunc = unsafe extern "C" fn(*mut PyObject) -> *mut PyObject;
+pub type iternextfunc = unsafe extern "C" fn(*mut PyObject) -> *mut PyObject;
+pub type descrgetfunc =
+    unsafe extern "C" fn(*mut PyObject, *mut PyObject, *mut PyObject) -> *mut PyObject;
+pub type descrsetfunc = unsafe extern "C" fn(*mut PyObject, *mut PyObject, *mut PyObject) -> c_int;
+pub type initproc = unsafe extern "C" fn(*mut PyObject, *mut PyObject, *mut PyObject) -> c_int;
+pub type newfunc =
+    unsafe extern "C" fn(*mut PyTypeObject, *mut PyObject, *mut PyObject) -> *mut PyObject;
+pub type allocfunc = unsafe extern "C" fn(*mut PyTypeObject, Py_ssize_t) -> *mut PyObject;
+
+#[cfg(Py_3_8)]
+pub type vectorcallfunc = unsafe extern "C" fn(
+    callable: *mut PyObject,
+    args: *const *mut PyObject,
+    nargsf: libc::size_t,
+    kwnames: *mut PyObject,
+) -> *mut PyObject;
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyType_Slot {
+    pub slot: c_int,
+    pub pfunc: *mut c_void,
+}
+
+impl Default for PyType_Slot {
+    fn default() -> PyType_Slot {
+        unsafe { mem::zeroed() }
+    }
+}
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyType_Spec {
+    pub name: *const c_char,
+    pub basicsize: c_int,
+    pub itemsize: c_int,
+    pub flags: c_uint,
+    pub slots: *mut PyType_Slot,
+}
+
+impl Default for PyType_Spec {
+    fn default() -> PyType_Spec {
+        unsafe { mem::zeroed() }
+    }
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyType_FromSpec")]
+    pub fn PyType_FromSpec(arg1: *mut PyType_Spec) -> *mut PyObject;
+
+    #[cfg_attr(PyPy, link_name = "PyPyType_FromSpecWithBases")]
+    pub fn PyType_FromSpecWithBases(arg1: *mut PyType_Spec, arg2: *mut PyObject) -> *mut PyObject;
+
+    #[cfg_attr(PyPy, link_name = "PyPyType_GetSlot")]
+    pub fn PyType_GetSlot(arg1: *mut PyTypeObject, arg2: c_int) -> *mut c_void;
+
+    #[cfg(any(Py_3_10, all(Py_3_9, not(Py_LIMITED_API))))]
+    #[cfg_attr(PyPy, link_name = "PyPyType_FromModuleAndSpec")]
+    pub fn PyType_FromModuleAndSpec(
+        module: *mut PyObject,
+        spec: *mut PyType_Spec,
+        bases: *mut PyObject,
+    ) -> *mut PyObject;
+
+    #[cfg(any(Py_3_10, all(Py_3_9, not(Py_LIMITED_API))))]
+    #[cfg_attr(PyPy, link_name = "PyPyType_GetModule")]
+    pub fn PyType_GetModule(arg1: *mut PyTypeObject) -> *mut PyObject;
+
+    #[cfg(any(Py_3_10, all(Py_3_9, not(Py_LIMITED_API))))]
+    #[cfg_attr(PyPy, link_name = "PyPyType_GetModuleState")]
+    pub fn PyType_GetModuleState(arg1: *mut PyTypeObject) -> *mut c_void;
+
+    #[cfg(Py_3_11)]
+    #[cfg_attr(PyPy, link_name = "PyPyType_GetName")]
+    pub fn PyType_GetName(arg1: *mut PyTypeObject) -> *mut PyObject;
+
+    #[cfg(Py_3_11)]
+    #[cfg_attr(PyPy, link_name = "PyPyType_GetQualName")]
+    pub fn PyType_GetQualName(arg1: *mut PyTypeObject) -> *mut PyObject;
+
+    #[cfg(Py_3_13)]
+    #[cfg_attr(PyPy, link_name = "PyPyType_GetFullyQualifiedName")]
+    pub fn PyType_GetFullyQualifiedName(arg1: *mut PyTypeObject) -> *mut PyObject;
+
+    #[cfg(Py_3_13)]
+    #[cfg_attr(PyPy, link_name = "PyPyType_GetModuleName")]
+    pub fn PyType_GetModuleName(arg1: *mut PyTypeObject) -> *mut PyObject;
+
+    #[cfg(Py_3_12)]
+    #[cfg_attr(PyPy, link_name = "PyPyType_FromMetaclass")]
+    pub fn PyType_FromMetaclass(
+        metaclass: *mut PyTypeObject,
+        module: *mut PyObject,
+        spec: *mut PyType_Spec,
+        bases: *mut PyObject,
+    ) -> *mut PyObject;
+
+    #[cfg(Py_3_12)]
+    #[cfg_attr(PyPy, link_name = "PyPyObject_GetTypeData")]
+    pub fn PyObject_GetTypeData(obj: *mut PyObject, cls: *mut PyTypeObject) -> *mut c_void;
+
+    #[cfg(Py_3_12)]
+    #[cfg_attr(PyPy, link_name = "PyPyObject_GetTypeDataSize")]
+    pub fn PyObject_GetTypeDataSize(cls: *mut PyTypeObject) -> Py_ssize_t;
+
+    #[cfg_attr(PyPy, link_name = "PyPyType_IsSubtype")]
+    pub fn PyType_IsSubtype(a: *mut PyTypeObject, b: *mut PyTypeObject) -> c_int;
+}
+
+#[inline]
+pub unsafe fn PyObject_TypeCheck(ob: *mut PyObject, tp: *mut PyTypeObject) -> c_int {
+    (Py_TYPE(ob) == tp || PyType_IsSubtype(Py_TYPE(ob), tp) != 0) as c_int
+}
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    /// built-in 'type'
+    #[cfg_attr(PyPy, link_name = "PyPyType_Type")]
+    pub static mut PyType_Type: PyTypeObject;
+    /// built-in 'object'
+    #[cfg_attr(PyPy, link_name = "PyPyBaseObject_Type")]
+    pub static mut PyBaseObject_Type: PyTypeObject;
+    /// built-in 'super'
+    pub static mut PySuper_Type: PyTypeObject;
+}
+
+extern "C" {
+    pub fn PyType_GetFlags(arg1: *mut PyTypeObject) -> c_ulong;
+
+    #[cfg_attr(PyPy, link_name = "PyPyType_Ready")]
+    pub fn PyType_Ready(t: *mut PyTypeObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyType_GenericAlloc")]
+    pub fn PyType_GenericAlloc(t: *mut PyTypeObject, nitems: Py_ssize_t) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyType_GenericNew")]
+    pub fn PyType_GenericNew(
+        t: *mut PyTypeObject,
+        args: *mut PyObject,
+        kwds: *mut PyObject,
+    ) -> *mut PyObject;
+    pub fn PyType_ClearCache() -> c_uint;
+    #[cfg_attr(PyPy, link_name = "PyPyType_Modified")]
+    pub fn PyType_Modified(t: *mut PyTypeObject);
+
+    #[cfg_attr(PyPy, link_name = "PyPyObject_Repr")]
+    pub fn PyObject_Repr(o: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_Str")]
+    pub fn PyObject_Str(o: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_ASCII")]
+    pub fn PyObject_ASCII(arg1: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_Bytes")]
+    pub fn PyObject_Bytes(arg1: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_RichCompare")]
+    pub fn PyObject_RichCompare(
+        arg1: *mut PyObject,
+        arg2: *mut PyObject,
+        arg3: c_int,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_RichCompareBool")]
+    pub fn PyObject_RichCompareBool(arg1: *mut PyObject, arg2: *mut PyObject, arg3: c_int)
+        -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_GetAttrString")]
+    pub fn PyObject_GetAttrString(arg1: *mut PyObject, arg2: *const c_char) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_SetAttrString")]
+    pub fn PyObject_SetAttrString(
+        arg1: *mut PyObject,
+        arg2: *const c_char,
+        arg3: *mut PyObject,
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_HasAttrString")]
+    pub fn PyObject_HasAttrString(arg1: *mut PyObject, arg2: *const c_char) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_GetAttr")]
+    pub fn PyObject_GetAttr(arg1: *mut PyObject, arg2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_SetAttr")]
+    pub fn PyObject_SetAttr(arg1: *mut PyObject, arg2: *mut PyObject, arg3: *mut PyObject)
+        -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_HasAttr")]
+    pub fn PyObject_HasAttr(arg1: *mut PyObject, arg2: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_SelfIter")]
+    pub fn PyObject_SelfIter(arg1: *mut PyObject) -> *mut PyObject;
+
+    #[cfg_attr(PyPy, link_name = "PyPyObject_GenericGetAttr")]
+    pub fn PyObject_GenericGetAttr(arg1: *mut PyObject, arg2: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_GenericSetAttr")]
+    pub fn PyObject_GenericSetAttr(
+        arg1: *mut PyObject,
+        arg2: *mut PyObject,
+        arg3: *mut PyObject,
+    ) -> c_int;
+    #[cfg(not(all(Py_LIMITED_API, not(Py_3_10))))]
+    pub fn PyObject_GenericGetDict(arg1: *mut PyObject, arg2: *mut c_void) -> *mut PyObject;
+    pub fn PyObject_GenericSetDict(
+        arg1: *mut PyObject,
+        arg2: *mut PyObject,
+        arg3: *mut c_void,
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_Hash")]
+    pub fn PyObject_Hash(arg1: *mut PyObject) -> Py_hash_t;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_HashNotImplemented")]
+    pub fn PyObject_HashNotImplemented(arg1: *mut PyObject) -> Py_hash_t;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_IsTrue")]
+    pub fn PyObject_IsTrue(arg1: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_Not")]
+    pub fn PyObject_Not(arg1: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyCallable_Check")]
+    pub fn PyCallable_Check(arg1: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_ClearWeakRefs")]
+    pub fn PyObject_ClearWeakRefs(arg1: *mut PyObject);
+
+    #[cfg_attr(PyPy, link_name = "PyPyObject_Dir")]
+    pub fn PyObject_Dir(arg1: *mut PyObject) -> *mut PyObject;
+    pub fn Py_ReprEnter(arg1: *mut PyObject) -> c_int;
+    pub fn Py_ReprLeave(arg1: *mut PyObject);
+}
+
+// Flag bits for printing:
+pub const Py_PRINT_RAW: c_int = 1; // No string quotes etc.
+
+#[cfg(all(Py_3_12, not(Py_LIMITED_API)))]
+pub const _Py_TPFLAGS_STATIC_BUILTIN: c_ulong = 1 << 1;
+
+#[cfg(all(Py_3_12, not(Py_LIMITED_API)))]
+pub const Py_TPFLAGS_MANAGED_WEAKREF: c_ulong = 1 << 3;
+
+#[cfg(all(Py_3_11, not(Py_LIMITED_API)))]
+pub const Py_TPFLAGS_MANAGED_DICT: c_ulong = 1 << 4;
+
+#[cfg(all(Py_3_10, not(Py_LIMITED_API)))]
+pub const Py_TPFLAGS_SEQUENCE: c_ulong = 1 << 5;
+
+#[cfg(all(Py_3_10, not(Py_LIMITED_API)))]
+pub const Py_TPFLAGS_MAPPING: c_ulong = 1 << 6;
+
+#[cfg(Py_3_10)]
+pub const Py_TPFLAGS_DISALLOW_INSTANTIATION: c_ulong = 1 << 7;
+
+#[cfg(Py_3_10)]
+pub const Py_TPFLAGS_IMMUTABLETYPE: c_ulong = 1 << 8;
+
+/// Set if the type object is dynamically allocated
+pub const Py_TPFLAGS_HEAPTYPE: c_ulong = 1 << 9;
+
+/// Set if the type allows subclassing
+pub const Py_TPFLAGS_BASETYPE: c_ulong = 1 << 10;
+
+/// Set if the type implements the vectorcall protocol (PEP 590)
+#[cfg(any(Py_3_12, all(Py_3_8, not(Py_LIMITED_API))))]
+pub const Py_TPFLAGS_HAVE_VECTORCALL: c_ulong = 1 << 11;
+// skipped non-limited _Py_TPFLAGS_HAVE_VECTORCALL
+
+/// Set if the type is 'ready' -- fully initialized
+pub const Py_TPFLAGS_READY: c_ulong = 1 << 12;
+
+/// Set while the type is being 'readied', to prevent recursive ready calls
+pub const Py_TPFLAGS_READYING: c_ulong = 1 << 13;
+
+/// Objects support garbage collection (see objimp.h)
+pub const Py_TPFLAGS_HAVE_GC: c_ulong = 1 << 14;
+
+const Py_TPFLAGS_HAVE_STACKLESS_EXTENSION: c_ulong = 0;
+
+#[cfg(Py_3_8)]
+pub const Py_TPFLAGS_METHOD_DESCRIPTOR: c_ulong = 1 << 17;
+
+pub const Py_TPFLAGS_VALID_VERSION_TAG: c_ulong = 1 << 19;
+
+/* Type is abstract and cannot be instantiated */
+pub const Py_TPFLAGS_IS_ABSTRACT: c_ulong = 1 << 20;
+
+// skipped non-limited / 3.10 Py_TPFLAGS_HAVE_AM_SEND
+#[cfg(Py_3_12)]
+pub const Py_TPFLAGS_ITEMS_AT_END: c_ulong = 1 << 23;
+
+/* These flags are used to determine if a type is a subclass. */
+pub const Py_TPFLAGS_LONG_SUBCLASS: c_ulong = 1 << 24;
+pub const Py_TPFLAGS_LIST_SUBCLASS: c_ulong = 1 << 25;
+pub const Py_TPFLAGS_TUPLE_SUBCLASS: c_ulong = 1 << 26;
+pub const Py_TPFLAGS_BYTES_SUBCLASS: c_ulong = 1 << 27;
+pub const Py_TPFLAGS_UNICODE_SUBCLASS: c_ulong = 1 << 28;
+pub const Py_TPFLAGS_DICT_SUBCLASS: c_ulong = 1 << 29;
+pub const Py_TPFLAGS_BASE_EXC_SUBCLASS: c_ulong = 1 << 30;
+pub const Py_TPFLAGS_TYPE_SUBCLASS: c_ulong = 1 << 31;
+
+pub const Py_TPFLAGS_DEFAULT: c_ulong = if cfg!(Py_3_10) {
+    Py_TPFLAGS_HAVE_STACKLESS_EXTENSION
+} else {
+    Py_TPFLAGS_HAVE_STACKLESS_EXTENSION | Py_TPFLAGS_HAVE_VERSION_TAG
+};
+
+pub const Py_TPFLAGS_HAVE_FINALIZE: c_ulong = 1;
+pub const Py_TPFLAGS_HAVE_VERSION_TAG: c_ulong = 1 << 18;
+
+extern "C" {
+    #[cfg(all(py_sys_config = "Py_REF_DEBUG", not(Py_LIMITED_API)))]
+    pub fn _Py_NegativeRefcount(filename: *const c_char, lineno: c_int, op: *mut PyObject);
+    #[cfg(all(Py_3_12, py_sys_config = "Py_REF_DEBUG", not(Py_LIMITED_API)))]
+    fn _Py_INCREF_IncRefTotal();
+    #[cfg(all(Py_3_12, py_sys_config = "Py_REF_DEBUG", not(Py_LIMITED_API)))]
+    fn _Py_DECREF_DecRefTotal();
+
+    #[cfg_attr(PyPy, link_name = "_PyPy_Dealloc")]
+    pub fn _Py_Dealloc(arg1: *mut PyObject);
+
+    #[cfg_attr(PyPy, link_name = "PyPy_IncRef")]
+    #[cfg_attr(GraalPy, link_name = "_Py_IncRef")]
+    pub fn Py_IncRef(o: *mut PyObject);
+    #[cfg_attr(PyPy, link_name = "PyPy_DecRef")]
+    #[cfg_attr(GraalPy, link_name = "_Py_DecRef")]
+    pub fn Py_DecRef(o: *mut PyObject);
+
+    #[cfg(all(Py_3_10, not(PyPy)))]
+    pub fn _Py_IncRef(o: *mut PyObject);
+    #[cfg(all(Py_3_10, not(PyPy)))]
+    pub fn _Py_DecRef(o: *mut PyObject);
+
+    #[cfg(GraalPy)]
+    pub fn _Py_REFCNT(arg1: *const PyObject) -> Py_ssize_t;
+
+    #[cfg(GraalPy)]
+    pub fn _Py_TYPE(arg1: *const PyObject) -> *mut PyTypeObject;
+
+    #[cfg(GraalPy)]
+    pub fn _Py_SIZE(arg1: *const PyObject) -> Py_ssize_t;
+}
+
+#[inline(always)]
+pub unsafe fn Py_INCREF(op: *mut PyObject) {
+    // On limited API or with refcount debugging, let the interpreter do refcounting
+    #[cfg(any(Py_LIMITED_API, py_sys_config = "Py_REF_DEBUG", GraalPy))]
+    {
+        // _Py_IncRef was added to the ABI in 3.10; skips null checks
+        #[cfg(all(Py_3_10, not(PyPy)))]
+        {
+            _Py_IncRef(op);
+        }
+
+        #[cfg(any(not(Py_3_10), PyPy))]
+        {
+            Py_IncRef(op);
+        }
+    }
+
+    // version-specific builds are allowed to directly manipulate the reference count
+    #[cfg(not(any(any(Py_LIMITED_API, py_sys_config = "Py_REF_DEBUG", GraalPy))))]
+    {
+        #[cfg(all(Py_3_12, target_pointer_width = "64"))]
+        {
+            let cur_refcnt = (*op).ob_refcnt.ob_refcnt_split[crate::PY_BIG_ENDIAN];
+            let new_refcnt = cur_refcnt.wrapping_add(1);
+            if new_refcnt == 0 {
+                return;
+            }
+            (*op).ob_refcnt.ob_refcnt_split[crate::PY_BIG_ENDIAN] = new_refcnt;
+        }
+
+        #[cfg(all(Py_3_12, target_pointer_width = "32"))]
+        {
+            if _Py_IsImmortal(op) != 0 {
+                return;
+            }
+            (*op).ob_refcnt.ob_refcnt += 1
+        }
+
+        #[cfg(not(Py_3_12))]
+        {
+            (*op).ob_refcnt += 1
+        }
+
+        // Skipped _Py_INCREF_STAT_INC - if anyone wants this, please file an issue
+        // or submit a PR supporting Py_STATS build option and pystats.h
+    }
+}
+
+#[inline(always)]
+#[cfg_attr(
+    all(py_sys_config = "Py_REF_DEBUG", Py_3_12, not(Py_LIMITED_API)),
+    track_caller
+)]
+pub unsafe fn Py_DECREF(op: *mut PyObject) {
+    // On limited API or with refcount debugging, let the interpreter do refcounting
+    // On 3.12+ we implement refcount debugging to get better assertion locations on negative refcounts
+    #[cfg(any(
+        Py_LIMITED_API,
+        all(py_sys_config = "Py_REF_DEBUG", not(Py_3_12)),
+        GraalPy
+    ))]
+    {
+        // _Py_DecRef was added to the ABI in 3.10; skips null checks
+        #[cfg(all(Py_3_10, not(PyPy)))]
+        {
+            _Py_DecRef(op);
+        }
+
+        #[cfg(any(not(Py_3_10), PyPy))]
+        {
+            Py_DecRef(op);
+        }
+    }
+
+    #[cfg(not(any(
+        Py_LIMITED_API,
+        all(py_sys_config = "Py_REF_DEBUG", not(Py_3_12)),
+        GraalPy
+    )))]
+    {
+        #[cfg(Py_3_12)]
+        if _Py_IsImmortal(op) != 0 {
+            return;
+        }
+
+        // Skipped _Py_DECREF_STAT_INC - if anyone needs this, please file an issue
+        // or submit a PR supporting Py_STATS build option and pystats.h
+
+        #[cfg(py_sys_config = "Py_REF_DEBUG")]
+        _Py_DECREF_DecRefTotal();
+
+        #[cfg(Py_3_12)]
+        {
+            (*op).ob_refcnt.ob_refcnt -= 1;
+
+            #[cfg(py_sys_config = "Py_REF_DEBUG")]
+            if (*op).ob_refcnt.ob_refcnt < 0 {
+                let location = std::panic::Location::caller();
+                let filename = std::ffi::CString::new(location.file()).unwrap();
+                _Py_NegativeRefcount(filename.as_ptr(), location.line() as i32, op);
+            }
+
+            if (*op).ob_refcnt.ob_refcnt == 0 {
+                _Py_Dealloc(op);
+            }
+        }
+
+        #[cfg(not(Py_3_12))]
+        {
+            (*op).ob_refcnt -= 1;
+
+            if (*op).ob_refcnt == 0 {
+                _Py_Dealloc(op);
+            }
+        }
+    }
+}
+
+#[inline]
+pub unsafe fn Py_CLEAR(op: *mut *mut PyObject) {
+    let tmp = *op;
+    if !tmp.is_null() {
+        *op = ptr::null_mut();
+        Py_DECREF(tmp);
+    }
+}
+
+#[inline]
+pub unsafe fn Py_XINCREF(op: *mut PyObject) {
+    if !op.is_null() {
+        Py_INCREF(op)
+    }
+}
+
+#[inline]
+pub unsafe fn Py_XDECREF(op: *mut PyObject) {
+    if !op.is_null() {
+        Py_DECREF(op)
+    }
+}
+
+extern "C" {
+    #[cfg(all(Py_3_10, Py_LIMITED_API))]
+    pub fn Py_NewRef(obj: *mut PyObject) -> *mut PyObject;
+    #[cfg(all(Py_3_10, Py_LIMITED_API))]
+    pub fn Py_XNewRef(obj: *mut PyObject) -> *mut PyObject;
+}
+
+// Technically these macros are only available in the C header from 3.10 and up, however their
+// implementation works on all supported Python versions so we define these macros on all
+// versions for simplicity.
+
+#[inline]
+pub unsafe fn _Py_NewRef(obj: *mut PyObject) -> *mut PyObject {
+    Py_INCREF(obj);
+    obj
+}
+
+#[inline]
+pub unsafe fn _Py_XNewRef(obj: *mut PyObject) -> *mut PyObject {
+    Py_XINCREF(obj);
+    obj
+}
+
+#[cfg(all(Py_3_10, not(Py_LIMITED_API)))]
+#[inline]
+pub unsafe fn Py_NewRef(obj: *mut PyObject) -> *mut PyObject {
+    _Py_NewRef(obj)
+}
+
+#[cfg(all(Py_3_10, not(Py_LIMITED_API)))]
+#[inline]
+pub unsafe fn Py_XNewRef(obj: *mut PyObject) -> *mut PyObject {
+    _Py_XNewRef(obj)
+}
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg(not(GraalPy))]
+    #[cfg_attr(PyPy, link_name = "_PyPy_NoneStruct")]
+    static mut _Py_NoneStruct: PyObject;
+
+    #[cfg(GraalPy)]
+    static mut _Py_NoneStructReference: *mut PyObject;
+}
+
+#[inline]
+pub unsafe fn Py_None() -> *mut PyObject {
+    #[cfg(not(GraalPy))]
+    return ptr::addr_of_mut!(_Py_NoneStruct);
+    #[cfg(GraalPy)]
+    return _Py_NoneStructReference;
+}
+
+#[inline]
+pub unsafe fn Py_IsNone(x: *mut PyObject) -> c_int {
+    Py_Is(x, Py_None())
+}
+
+// skipped Py_RETURN_NONE
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg(not(GraalPy))]
+    #[cfg_attr(PyPy, link_name = "_PyPy_NotImplementedStruct")]
+    static mut _Py_NotImplementedStruct: PyObject;
+
+    #[cfg(GraalPy)]
+    static mut _Py_NotImplementedStructReference: *mut PyObject;
+}
+
+#[inline]
+pub unsafe fn Py_NotImplemented() -> *mut PyObject {
+    #[cfg(not(GraalPy))]
+    return ptr::addr_of_mut!(_Py_NotImplementedStruct);
+    #[cfg(GraalPy)]
+    return _Py_NotImplementedStructReference;
+}
+
+// skipped Py_RETURN_NOTIMPLEMENTED
+
+/* Rich comparison opcodes */
+pub const Py_LT: c_int = 0;
+pub const Py_LE: c_int = 1;
+pub const Py_EQ: c_int = 2;
+pub const Py_NE: c_int = 3;
+pub const Py_GT: c_int = 4;
+pub const Py_GE: c_int = 5;
+
+#[cfg(Py_3_10)]
+#[repr(C)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq)]
+pub enum PySendResult {
+    PYGEN_RETURN = 0,
+    PYGEN_ERROR = -1,
+    PYGEN_NEXT = 1,
+}
+
+// skipped Py_RETURN_RICHCOMPARE
+
+#[inline]
+#[cfg(Py_LIMITED_API)]
+pub unsafe fn PyType_HasFeature(t: *mut PyTypeObject, f: c_ulong) -> c_int {
+    ((PyType_GetFlags(t) & f) != 0) as c_int
+}
+
+#[inline]
+#[cfg(not(Py_LIMITED_API))]
+pub unsafe fn PyType_HasFeature(t: *mut PyTypeObject, f: c_ulong) -> c_int {
+    (((*t).tp_flags & f) != 0) as c_int
+}
+
+#[inline]
+pub unsafe fn PyType_FastSubclass(t: *mut PyTypeObject, f: c_ulong) -> c_int {
+    PyType_HasFeature(t, f)
+}
+
+#[inline]
+pub unsafe fn PyType_Check(op: *mut PyObject) -> c_int {
+    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TYPE_SUBCLASS)
+}
+
+#[inline]
+pub unsafe fn PyType_CheckExact(op: *mut PyObject) -> c_int {
+    Py_IS_TYPE(op, ptr::addr_of_mut!(PyType_Type))
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/objimpl.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/objimpl.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/objimpl.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/objimpl.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,94 @@
+use libc::size_t;
+use std::os::raw::{c_int, c_void};
+
+use crate::object::*;
+use crate::pyport::Py_ssize_t;
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyObject_Malloc")]
+    pub fn PyObject_Malloc(size: size_t) -> *mut c_void;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_Calloc")]
+    pub fn PyObject_Calloc(nelem: size_t, elsize: size_t) -> *mut c_void;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_Realloc")]
+    pub fn PyObject_Realloc(ptr: *mut c_void, new_size: size_t) -> *mut c_void;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_Free")]
+    pub fn PyObject_Free(ptr: *mut c_void);
+
+    // skipped PyObject_MALLOC
+    // skipped PyObject_REALLOC
+    // skipped PyObject_FREE
+    // skipped PyObject_Del
+    // skipped PyObject_DEL
+
+    #[cfg_attr(PyPy, link_name = "PyPyObject_Init")]
+    pub fn PyObject_Init(arg1: *mut PyObject, arg2: *mut PyTypeObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyObject_InitVar")]
+    pub fn PyObject_InitVar(
+        arg1: *mut PyVarObject,
+        arg2: *mut PyTypeObject,
+        arg3: Py_ssize_t,
+    ) -> *mut PyVarObject;
+
+    // skipped PyObject_INIT
+    // skipped PyObject_INIT_VAR
+
+    #[cfg_attr(PyPy, link_name = "_PyPyObject_New")]
+    pub fn _PyObject_New(arg1: *mut PyTypeObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "_PyPyObject_NewVar")]
+    pub fn _PyObject_NewVar(arg1: *mut PyTypeObject, arg2: Py_ssize_t) -> *mut PyVarObject;
+
+    // skipped PyObject_New
+    // skipped PyObject_NEW
+    // skipped PyObject_NewVar
+    // skipped PyObject_NEW_VAR
+
+    pub fn PyGC_Collect() -> Py_ssize_t;
+
+    #[cfg(Py_3_10)]
+    #[cfg_attr(PyPy, link_name = "PyPyGC_Enable")]
+    pub fn PyGC_Enable() -> c_int;
+
+    #[cfg(Py_3_10)]
+    #[cfg_attr(PyPy, link_name = "PyPyGC_Disable")]
+    pub fn PyGC_Disable() -> c_int;
+
+    #[cfg(Py_3_10)]
+    #[cfg_attr(PyPy, link_name = "PyPyGC_IsEnabled")]
+    pub fn PyGC_IsEnabled() -> c_int;
+
+    // skipped PyUnstable_GC_VisitObjects
+}
+
+#[inline]
+pub unsafe fn PyType_IS_GC(t: *mut PyTypeObject) -> c_int {
+    PyType_HasFeature(t, Py_TPFLAGS_HAVE_GC)
+}
+
+extern "C" {
+    pub fn _PyObject_GC_Resize(arg1: *mut PyVarObject, arg2: Py_ssize_t) -> *mut PyVarObject;
+
+    // skipped PyObject_GC_Resize
+
+    #[cfg_attr(PyPy, link_name = "_PyPyObject_GC_New")]
+    pub fn _PyObject_GC_New(arg1: *mut PyTypeObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "_PyPyObject_GC_NewVar")]
+    pub fn _PyObject_GC_NewVar(arg1: *mut PyTypeObject, arg2: Py_ssize_t) -> *mut PyVarObject;
+    #[cfg(not(PyPy))]
+    pub fn PyObject_GC_Track(arg1: *mut c_void);
+    #[cfg(not(PyPy))]
+    pub fn PyObject_GC_UnTrack(arg1: *mut c_void);
+    #[cfg_attr(PyPy, link_name = "PyPyObject_GC_Del")]
+    pub fn PyObject_GC_Del(arg1: *mut c_void);
+
+    // skipped PyObject_GC_New
+    // skipped PyObject_GC_NewVar
+
+    #[cfg(any(all(Py_3_9, not(PyPy)), Py_3_10))] // added in 3.9, or 3.10 on PyPy
+    #[cfg_attr(PyPy, link_name = "PyPyObject_GC_IsTracked")]
+    pub fn PyObject_GC_IsTracked(arg1: *mut PyObject) -> c_int;
+    #[cfg(any(all(Py_3_9, not(PyPy)), Py_3_10))] // added in 3.9, or 3.10 on PyPy
+    #[cfg_attr(PyPy, link_name = "PyPyObject_GC_IsFinalized")]
+    pub fn PyObject_GC_IsFinalized(arg1: *mut PyObject) -> c_int;
+}
+
+// skipped Py_VISIT
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/osmodule.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/osmodule.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/osmodule.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/osmodule.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,6 @@
+use crate::object::PyObject;
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyOS_FSPath")]
+    pub fn PyOS_FSPath(path: *mut PyObject) -> *mut PyObject;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/pyarena.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pyarena.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/pyarena.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pyarena.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+opaque_struct!(PyArena);
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/pybuffer.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pybuffer.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/pybuffer.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pybuffer.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,134 @@
+use crate::object::PyObject;
+use crate::pyport::Py_ssize_t;
+use std::os::raw::{c_char, c_int, c_void};
+use std::ptr;
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct Py_buffer {
+    pub buf: *mut c_void,
+    /// Owned reference
+    pub obj: *mut crate::PyObject,
+    pub len: Py_ssize_t,
+    pub itemsize: Py_ssize_t,
+    pub readonly: c_int,
+    pub ndim: c_int,
+    pub format: *mut c_char,
+    pub shape: *mut Py_ssize_t,
+    pub strides: *mut Py_ssize_t,
+    pub suboffsets: *mut Py_ssize_t,
+    pub internal: *mut c_void,
+    #[cfg(PyPy)]
+    pub flags: c_int,
+    #[cfg(PyPy)]
+    pub _strides: [Py_ssize_t; PyBUF_MAX_NDIM],
+    #[cfg(PyPy)]
+    pub _shape: [Py_ssize_t; PyBUF_MAX_NDIM],
+}
+
+impl Py_buffer {
+    #[allow(clippy::new_without_default)]
+    pub const fn new() -> Self {
+        Py_buffer {
+            buf: ptr::null_mut(),
+            obj: ptr::null_mut(),
+            len: 0,
+            itemsize: 0,
+            readonly: 0,
+            ndim: 0,
+            format: ptr::null_mut(),
+            shape: ptr::null_mut(),
+            strides: ptr::null_mut(),
+            suboffsets: ptr::null_mut(),
+            internal: ptr::null_mut(),
+            #[cfg(PyPy)]
+            flags: 0,
+            #[cfg(PyPy)]
+            _strides: [0; PyBUF_MAX_NDIM],
+            #[cfg(PyPy)]
+            _shape: [0; PyBUF_MAX_NDIM],
+        }
+    }
+}
+
+pub type getbufferproc = unsafe extern "C" fn(*mut PyObject, *mut crate::Py_buffer, c_int) -> c_int;
+pub type releasebufferproc = unsafe extern "C" fn(*mut PyObject, *mut crate::Py_buffer);
+
+/* Return 1 if the getbuffer function is available, otherwise return 0. */
+extern "C" {
+    #[cfg(not(PyPy))]
+    pub fn PyObject_CheckBuffer(obj: *mut PyObject) -> c_int;
+
+    #[cfg_attr(PyPy, link_name = "PyPyObject_GetBuffer")]
+    pub fn PyObject_GetBuffer(obj: *mut PyObject, view: *mut Py_buffer, flags: c_int) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyBuffer_GetPointer")]
+    pub fn PyBuffer_GetPointer(view: *const Py_buffer, indices: *const Py_ssize_t) -> *mut c_void;
+    #[cfg_attr(PyPy, link_name = "PyPyBuffer_SizeFromFormat")]
+    pub fn PyBuffer_SizeFromFormat(format: *const c_char) -> Py_ssize_t;
+    #[cfg_attr(PyPy, link_name = "PyPyBuffer_ToContiguous")]
+    pub fn PyBuffer_ToContiguous(
+        buf: *mut c_void,
+        view: *const Py_buffer,
+        len: Py_ssize_t,
+        order: c_char,
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyBuffer_FromContiguous")]
+    pub fn PyBuffer_FromContiguous(
+        view: *const Py_buffer,
+        buf: *const c_void,
+        len: Py_ssize_t,
+        order: c_char,
+    ) -> c_int;
+    pub fn PyObject_CopyData(dest: *mut PyObject, src: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyBuffer_IsContiguous")]
+    pub fn PyBuffer_IsContiguous(view: *const Py_buffer, fort: c_char) -> c_int;
+    pub fn PyBuffer_FillContiguousStrides(
+        ndims: c_int,
+        shape: *mut Py_ssize_t,
+        strides: *mut Py_ssize_t,
+        itemsize: c_int,
+        fort: c_char,
+    );
+    #[cfg_attr(PyPy, link_name = "PyPyBuffer_FillInfo")]
+    pub fn PyBuffer_FillInfo(
+        view: *mut Py_buffer,
+        o: *mut PyObject,
+        buf: *mut c_void,
+        len: Py_ssize_t,
+        readonly: c_int,
+        flags: c_int,
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyBuffer_Release")]
+    pub fn PyBuffer_Release(view: *mut Py_buffer);
+}
+
+/// Maximum number of dimensions
+pub const PyBUF_MAX_NDIM: c_int = if cfg!(PyPy) { 36 } else { 64 };
+
+/* Flags for getting buffers */
+pub const PyBUF_SIMPLE: c_int = 0;
+pub const PyBUF_WRITABLE: c_int = 0x0001;
+/* we used to include an E, backwards compatible alias */
+pub const PyBUF_WRITEABLE: c_int = PyBUF_WRITABLE;
+pub const PyBUF_FORMAT: c_int = 0x0004;
+pub const PyBUF_ND: c_int = 0x0008;
+pub const PyBUF_STRIDES: c_int = 0x0010 | PyBUF_ND;
+pub const PyBUF_C_CONTIGUOUS: c_int = 0x0020 | PyBUF_STRIDES;
+pub const PyBUF_F_CONTIGUOUS: c_int = 0x0040 | PyBUF_STRIDES;
+pub const PyBUF_ANY_CONTIGUOUS: c_int = 0x0080 | PyBUF_STRIDES;
+pub const PyBUF_INDIRECT: c_int = 0x0100 | PyBUF_STRIDES;
+
+pub const PyBUF_CONTIG: c_int = PyBUF_ND | PyBUF_WRITABLE;
+pub const PyBUF_CONTIG_RO: c_int = PyBUF_ND;
+
+pub const PyBUF_STRIDED: c_int = PyBUF_STRIDES | PyBUF_WRITABLE;
+pub const PyBUF_STRIDED_RO: c_int = PyBUF_STRIDES;
+
+pub const PyBUF_RECORDS: c_int = PyBUF_STRIDES | PyBUF_WRITABLE | PyBUF_FORMAT;
+pub const PyBUF_RECORDS_RO: c_int = PyBUF_STRIDES | PyBUF_FORMAT;
+
+pub const PyBUF_FULL: c_int = PyBUF_INDIRECT | PyBUF_WRITABLE | PyBUF_FORMAT;
+pub const PyBUF_FULL_RO: c_int = PyBUF_INDIRECT | PyBUF_FORMAT;
+
+pub const PyBUF_READ: c_int = 0x100;
+pub const PyBUF_WRITE: c_int = 0x200;
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/pycapsule.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pycapsule.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/pycapsule.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pycapsule.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,48 @@
+use crate::object::*;
+use std::os::raw::{c_char, c_int, c_void};
+use std::ptr::addr_of_mut;
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyCapsule_Type")]
+    pub static mut PyCapsule_Type: PyTypeObject;
+}
+
+pub type PyCapsule_Destructor = unsafe extern "C" fn(o: *mut PyObject);
+
+#[inline]
+pub unsafe fn PyCapsule_CheckExact(ob: *mut PyObject) -> c_int {
+    (Py_TYPE(ob) == addr_of_mut!(PyCapsule_Type)) as c_int
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyCapsule_New")]
+    pub fn PyCapsule_New(
+        pointer: *mut c_void,
+        name: *const c_char,
+        destructor: Option<PyCapsule_Destructor>,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyCapsule_GetPointer")]
+    pub fn PyCapsule_GetPointer(capsule: *mut PyObject, name: *const c_char) -> *mut c_void;
+    #[cfg_attr(PyPy, link_name = "PyPyCapsule_GetDestructor")]
+    pub fn PyCapsule_GetDestructor(capsule: *mut PyObject) -> Option<PyCapsule_Destructor>;
+    #[cfg_attr(PyPy, link_name = "PyPyCapsule_GetName")]
+    pub fn PyCapsule_GetName(capsule: *mut PyObject) -> *const c_char;
+    #[cfg_attr(PyPy, link_name = "PyPyCapsule_GetContext")]
+    pub fn PyCapsule_GetContext(capsule: *mut PyObject) -> *mut c_void;
+    #[cfg_attr(PyPy, link_name = "PyPyCapsule_IsValid")]
+    pub fn PyCapsule_IsValid(capsule: *mut PyObject, name: *const c_char) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyCapsule_SetPointer")]
+    pub fn PyCapsule_SetPointer(capsule: *mut PyObject, pointer: *mut c_void) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyCapsule_SetDestructor")]
+    pub fn PyCapsule_SetDestructor(
+        capsule: *mut PyObject,
+        destructor: Option<PyCapsule_Destructor>,
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyCapsule_SetName")]
+    pub fn PyCapsule_SetName(capsule: *mut PyObject, name: *const c_char) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyCapsule_SetContext")]
+    pub fn PyCapsule_SetContext(capsule: *mut PyObject, context: *mut c_void) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyCapsule_Import")]
+    pub fn PyCapsule_Import(name: *const c_char, no_block: c_int) -> *mut c_void;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/pyerrors.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pyerrors.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/pyerrors.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pyerrors.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,363 @@
+use crate::object::*;
+use crate::pyport::Py_ssize_t;
+use std::os::raw::{c_char, c_int};
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyErr_SetNone")]
+    pub fn PyErr_SetNone(arg1: *mut PyObject);
+    #[cfg_attr(PyPy, link_name = "PyPyErr_SetObject")]
+    pub fn PyErr_SetObject(arg1: *mut PyObject, arg2: *mut PyObject);
+    #[cfg_attr(PyPy, link_name = "PyPyErr_SetString")]
+    pub fn PyErr_SetString(exception: *mut PyObject, string: *const c_char);
+    #[cfg_attr(PyPy, link_name = "PyPyErr_Occurred")]
+    pub fn PyErr_Occurred() -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyErr_Clear")]
+    pub fn PyErr_Clear();
+    #[cfg_attr(Py_3_12, deprecated(note = "Use PyErr_GetRaisedException() instead."))]
+    #[cfg_attr(PyPy, link_name = "PyPyErr_Fetch")]
+    pub fn PyErr_Fetch(
+        arg1: *mut *mut PyObject,
+        arg2: *mut *mut PyObject,
+        arg3: *mut *mut PyObject,
+    );
+    #[cfg_attr(Py_3_12, deprecated(note = "Use PyErr_SetRaisedException() instead."))]
+    #[cfg_attr(PyPy, link_name = "PyPyErr_Restore")]
+    pub fn PyErr_Restore(arg1: *mut PyObject, arg2: *mut PyObject, arg3: *mut PyObject);
+    #[cfg_attr(PyPy, link_name = "PyPyErr_GetExcInfo")]
+    pub fn PyErr_GetExcInfo(
+        arg1: *mut *mut PyObject,
+        arg2: *mut *mut PyObject,
+        arg3: *mut *mut PyObject,
+    );
+    #[cfg_attr(PyPy, link_name = "PyPyErr_SetExcInfo")]
+    pub fn PyErr_SetExcInfo(arg1: *mut PyObject, arg2: *mut PyObject, arg3: *mut PyObject);
+    #[cfg_attr(PyPy, link_name = "PyPy_FatalError")]
+    pub fn Py_FatalError(message: *const c_char) -> !;
+    #[cfg_attr(PyPy, link_name = "PyPyErr_GivenExceptionMatches")]
+    pub fn PyErr_GivenExceptionMatches(arg1: *mut PyObject, arg2: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyErr_ExceptionMatches")]
+    pub fn PyErr_ExceptionMatches(arg1: *mut PyObject) -> c_int;
+    #[cfg_attr(
+        Py_3_12,
+        deprecated(
+            note = "Use PyErr_GetRaisedException() instead, to avoid any possible de-normalization."
+        )
+    )]
+    #[cfg_attr(PyPy, link_name = "PyPyErr_NormalizeException")]
+    pub fn PyErr_NormalizeException(
+        arg1: *mut *mut PyObject,
+        arg2: *mut *mut PyObject,
+        arg3: *mut *mut PyObject,
+    );
+    #[cfg(Py_3_12)]
+    pub fn PyErr_GetRaisedException() -> *mut PyObject;
+    #[cfg(Py_3_12)]
+    pub fn PyErr_SetRaisedException(exc: *mut PyObject);
+    #[cfg_attr(PyPy, link_name = "PyPyException_SetTraceback")]
+    pub fn PyException_SetTraceback(arg1: *mut PyObject, arg2: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyException_GetTraceback")]
+    pub fn PyException_GetTraceback(arg1: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyException_GetCause")]
+    pub fn PyException_GetCause(arg1: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyException_SetCause")]
+    pub fn PyException_SetCause(arg1: *mut PyObject, arg2: *mut PyObject);
+    #[cfg_attr(PyPy, link_name = "PyPyException_GetContext")]
+    pub fn PyException_GetContext(arg1: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyException_SetContext")]
+    pub fn PyException_SetContext(arg1: *mut PyObject, arg2: *mut PyObject);
+
+    #[cfg(PyPy)]
+    #[link_name = "PyPyExceptionInstance_Class"]
+    pub fn PyExceptionInstance_Class(x: *mut PyObject) -> *mut PyObject;
+}
+
+#[inline]
+pub unsafe fn PyExceptionClass_Check(x: *mut PyObject) -> c_int {
+    (PyType_Check(x) != 0
+        && PyType_FastSubclass(x as *mut PyTypeObject, Py_TPFLAGS_BASE_EXC_SUBCLASS) != 0)
+        as c_int
+}
+
+#[inline]
+pub unsafe fn PyExceptionInstance_Check(x: *mut PyObject) -> c_int {
+    PyType_FastSubclass(Py_TYPE(x), Py_TPFLAGS_BASE_EXC_SUBCLASS)
+}
+
+#[inline]
+#[cfg(not(PyPy))]
+pub unsafe fn PyExceptionInstance_Class(x: *mut PyObject) -> *mut PyObject {
+    Py_TYPE(x) as *mut PyObject
+}
+
+// ported from cpython exception.c (line 2096)
+#[cfg(PyPy)]
+pub unsafe fn PyUnicodeDecodeError_Create(
+    encoding: *const c_char,
+    object: *const c_char,
+    length: Py_ssize_t,
+    start: Py_ssize_t,
+    end: Py_ssize_t,
+    reason: *const c_char,
+) -> *mut PyObject {
+    crate::_PyObject_CallFunction_SizeT(
+        PyExc_UnicodeDecodeError,
+        c_str!("sy#nns").as_ptr(),
+        encoding,
+        object,
+        length,
+        start,
+        end,
+        reason,
+    )
+}
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyExc_BaseException")]
+    pub static mut PyExc_BaseException: *mut PyObject;
+    #[cfg(Py_3_11)]
+    pub static mut PyExc_BaseExceptionGroup: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_Exception")]
+    pub static mut PyExc_Exception: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_StopAsyncIteration")]
+    pub static mut PyExc_StopAsyncIteration: *mut PyObject;
+
+    #[cfg_attr(PyPy, link_name = "PyPyExc_StopIteration")]
+    pub static mut PyExc_StopIteration: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_GeneratorExit")]
+    pub static mut PyExc_GeneratorExit: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_ArithmeticError")]
+    pub static mut PyExc_ArithmeticError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_LookupError")]
+    pub static mut PyExc_LookupError: *mut PyObject;
+
+    #[cfg_attr(PyPy, link_name = "PyPyExc_AssertionError")]
+    pub static mut PyExc_AssertionError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_AttributeError")]
+    pub static mut PyExc_AttributeError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_BufferError")]
+    pub static mut PyExc_BufferError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_EOFError")]
+    pub static mut PyExc_EOFError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_FloatingPointError")]
+    pub static mut PyExc_FloatingPointError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_OSError")]
+    pub static mut PyExc_OSError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_ImportError")]
+    pub static mut PyExc_ImportError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_ModuleNotFoundError")]
+    pub static mut PyExc_ModuleNotFoundError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_IndexError")]
+    pub static mut PyExc_IndexError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_KeyError")]
+    pub static mut PyExc_KeyError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_KeyboardInterrupt")]
+    pub static mut PyExc_KeyboardInterrupt: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_MemoryError")]
+    pub static mut PyExc_MemoryError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_NameError")]
+    pub static mut PyExc_NameError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_OverflowError")]
+    pub static mut PyExc_OverflowError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_RuntimeError")]
+    pub static mut PyExc_RuntimeError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_RecursionError")]
+    pub static mut PyExc_RecursionError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_NotImplementedError")]
+    pub static mut PyExc_NotImplementedError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_SyntaxError")]
+    pub static mut PyExc_SyntaxError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_IndentationError")]
+    pub static mut PyExc_IndentationError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_TabError")]
+    pub static mut PyExc_TabError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_ReferenceError")]
+    pub static mut PyExc_ReferenceError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_SystemError")]
+    pub static mut PyExc_SystemError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_SystemExit")]
+    pub static mut PyExc_SystemExit: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_TypeError")]
+    pub static mut PyExc_TypeError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_UnboundLocalError")]
+    pub static mut PyExc_UnboundLocalError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_UnicodeError")]
+    pub static mut PyExc_UnicodeError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_UnicodeEncodeError")]
+    pub static mut PyExc_UnicodeEncodeError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_UnicodeDecodeError")]
+    pub static mut PyExc_UnicodeDecodeError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_UnicodeTranslateError")]
+    pub static mut PyExc_UnicodeTranslateError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_ValueError")]
+    pub static mut PyExc_ValueError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_ZeroDivisionError")]
+    pub static mut PyExc_ZeroDivisionError: *mut PyObject;
+
+    #[cfg_attr(PyPy, link_name = "PyPyExc_BlockingIOError")]
+    pub static mut PyExc_BlockingIOError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_BrokenPipeError")]
+    pub static mut PyExc_BrokenPipeError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_ChildProcessError")]
+    pub static mut PyExc_ChildProcessError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_ConnectionError")]
+    pub static mut PyExc_ConnectionError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_ConnectionAbortedError")]
+    pub static mut PyExc_ConnectionAbortedError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_ConnectionRefusedError")]
+    pub static mut PyExc_ConnectionRefusedError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_ConnectionResetError")]
+    pub static mut PyExc_ConnectionResetError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_FileExistsError")]
+    pub static mut PyExc_FileExistsError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_FileNotFoundError")]
+    pub static mut PyExc_FileNotFoundError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_InterruptedError")]
+    pub static mut PyExc_InterruptedError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_IsADirectoryError")]
+    pub static mut PyExc_IsADirectoryError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_NotADirectoryError")]
+    pub static mut PyExc_NotADirectoryError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_PermissionError")]
+    pub static mut PyExc_PermissionError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_ProcessLookupError")]
+    pub static mut PyExc_ProcessLookupError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_TimeoutError")]
+    pub static mut PyExc_TimeoutError: *mut PyObject;
+
+    #[cfg_attr(PyPy, link_name = "PyPyExc_OSError")]
+    pub static mut PyExc_EnvironmentError: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_OSError")]
+    pub static mut PyExc_IOError: *mut PyObject;
+    #[cfg(windows)]
+    #[cfg_attr(PyPy, link_name = "PyPyExc_OSError")]
+    pub static mut PyExc_WindowsError: *mut PyObject;
+
+    pub static mut PyExc_RecursionErrorInst: *mut PyObject;
+
+    /* Predefined warning categories */
+    #[cfg_attr(PyPy, link_name = "PyPyExc_Warning")]
+    pub static mut PyExc_Warning: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_UserWarning")]
+    pub static mut PyExc_UserWarning: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_DeprecationWarning")]
+    pub static mut PyExc_DeprecationWarning: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_PendingDeprecationWarning")]
+    pub static mut PyExc_PendingDeprecationWarning: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_SyntaxWarning")]
+    pub static mut PyExc_SyntaxWarning: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_RuntimeWarning")]
+    pub static mut PyExc_RuntimeWarning: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_FutureWarning")]
+    pub static mut PyExc_FutureWarning: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_ImportWarning")]
+    pub static mut PyExc_ImportWarning: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_UnicodeWarning")]
+    pub static mut PyExc_UnicodeWarning: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_BytesWarning")]
+    pub static mut PyExc_BytesWarning: *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyExc_ResourceWarning")]
+    pub static mut PyExc_ResourceWarning: *mut PyObject;
+    #[cfg(Py_3_10)]
+    #[cfg_attr(PyPy, link_name = "PyPyExc_EncodingWarning")]
+    pub static mut PyExc_EncodingWarning: *mut PyObject;
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyErr_BadArgument")]
+    pub fn PyErr_BadArgument() -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyErr_NoMemory")]
+    pub fn PyErr_NoMemory() -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyErr_SetFromErrno")]
+    pub fn PyErr_SetFromErrno(arg1: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyErr_SetFromErrnoWithFilenameObject")]
+    pub fn PyErr_SetFromErrnoWithFilenameObject(
+        arg1: *mut PyObject,
+        arg2: *mut PyObject,
+    ) -> *mut PyObject;
+    pub fn PyErr_SetFromErrnoWithFilenameObjects(
+        arg1: *mut PyObject,
+        arg2: *mut PyObject,
+        arg3: *mut PyObject,
+    ) -> *mut PyObject;
+    pub fn PyErr_SetFromErrnoWithFilename(
+        exc: *mut PyObject,
+        filename: *const c_char,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyErr_Format")]
+    pub fn PyErr_Format(exception: *mut PyObject, format: *const c_char, ...) -> *mut PyObject;
+    pub fn PyErr_SetImportErrorSubclass(
+        arg1: *mut PyObject,
+        arg2: *mut PyObject,
+        arg3: *mut PyObject,
+        arg4: *mut PyObject,
+    ) -> *mut PyObject;
+    pub fn PyErr_SetImportError(
+        arg1: *mut PyObject,
+        arg2: *mut PyObject,
+        arg3: *mut PyObject,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyErr_BadInternalCall")]
+    pub fn PyErr_BadInternalCall();
+    pub fn _PyErr_BadInternalCall(filename: *const c_char, lineno: c_int);
+    #[cfg_attr(PyPy, link_name = "PyPyErr_NewException")]
+    pub fn PyErr_NewException(
+        name: *const c_char,
+        base: *mut PyObject,
+        dict: *mut PyObject,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyErr_NewExceptionWithDoc")]
+    pub fn PyErr_NewExceptionWithDoc(
+        name: *const c_char,
+        doc: *const c_char,
+        base: *mut PyObject,
+        dict: *mut PyObject,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyErr_WriteUnraisable")]
+    pub fn PyErr_WriteUnraisable(arg1: *mut PyObject);
+    #[cfg_attr(PyPy, link_name = "PyPyErr_CheckSignals")]
+    pub fn PyErr_CheckSignals() -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyErr_SetInterrupt")]
+    pub fn PyErr_SetInterrupt();
+    #[cfg(Py_3_10)]
+    #[cfg_attr(PyPy, link_name = "PyPyErr_SetInterruptEx")]
+    pub fn PyErr_SetInterruptEx(signum: c_int);
+    #[cfg_attr(PyPy, link_name = "PyPyErr_SyntaxLocation")]
+    pub fn PyErr_SyntaxLocation(filename: *const c_char, lineno: c_int);
+    #[cfg_attr(PyPy, link_name = "PyPyErr_SyntaxLocationEx")]
+    pub fn PyErr_SyntaxLocationEx(filename: *const c_char, lineno: c_int, col_offset: c_int);
+    #[cfg_attr(PyPy, link_name = "PyPyErr_ProgramText")]
+    pub fn PyErr_ProgramText(filename: *const c_char, lineno: c_int) -> *mut PyObject;
+    #[cfg(not(PyPy))]
+    pub fn PyUnicodeDecodeError_Create(
+        encoding: *const c_char,
+        object: *const c_char,
+        length: Py_ssize_t,
+        start: Py_ssize_t,
+        end: Py_ssize_t,
+        reason: *const c_char,
+    ) -> *mut PyObject;
+    pub fn PyUnicodeEncodeError_GetEncoding(arg1: *mut PyObject) -> *mut PyObject;
+    pub fn PyUnicodeDecodeError_GetEncoding(arg1: *mut PyObject) -> *mut PyObject;
+    pub fn PyUnicodeEncodeError_GetObject(arg1: *mut PyObject) -> *mut PyObject;
+    pub fn PyUnicodeDecodeError_GetObject(arg1: *mut PyObject) -> *mut PyObject;
+    pub fn PyUnicodeTranslateError_GetObject(arg1: *mut PyObject) -> *mut PyObject;
+    pub fn PyUnicodeEncodeError_GetStart(arg1: *mut PyObject, arg2: *mut Py_ssize_t) -> c_int;
+    pub fn PyUnicodeDecodeError_GetStart(arg1: *mut PyObject, arg2: *mut Py_ssize_t) -> c_int;
+    pub fn PyUnicodeTranslateError_GetStart(arg1: *mut PyObject, arg2: *mut Py_ssize_t) -> c_int;
+    pub fn PyUnicodeEncodeError_SetStart(arg1: *mut PyObject, arg2: Py_ssize_t) -> c_int;
+    pub fn PyUnicodeDecodeError_SetStart(arg1: *mut PyObject, arg2: Py_ssize_t) -> c_int;
+    pub fn PyUnicodeTranslateError_SetStart(arg1: *mut PyObject, arg2: Py_ssize_t) -> c_int;
+    pub fn PyUnicodeEncodeError_GetEnd(arg1: *mut PyObject, arg2: *mut Py_ssize_t) -> c_int;
+    pub fn PyUnicodeDecodeError_GetEnd(arg1: *mut PyObject, arg2: *mut Py_ssize_t) -> c_int;
+    pub fn PyUnicodeTranslateError_GetEnd(arg1: *mut PyObject, arg2: *mut Py_ssize_t) -> c_int;
+    pub fn PyUnicodeEncodeError_SetEnd(arg1: *mut PyObject, arg2: Py_ssize_t) -> c_int;
+    pub fn PyUnicodeDecodeError_SetEnd(arg1: *mut PyObject, arg2: Py_ssize_t) -> c_int;
+    pub fn PyUnicodeTranslateError_SetEnd(arg1: *mut PyObject, arg2: Py_ssize_t) -> c_int;
+    pub fn PyUnicodeEncodeError_GetReason(arg1: *mut PyObject) -> *mut PyObject;
+    pub fn PyUnicodeDecodeError_GetReason(arg1: *mut PyObject) -> *mut PyObject;
+    pub fn PyUnicodeTranslateError_GetReason(arg1: *mut PyObject) -> *mut PyObject;
+    pub fn PyUnicodeEncodeError_SetReason(exc: *mut PyObject, reason: *const c_char) -> c_int;
+    pub fn PyUnicodeDecodeError_SetReason(exc: *mut PyObject, reason: *const c_char) -> c_int;
+    pub fn PyUnicodeTranslateError_SetReason(exc: *mut PyObject, reason: *const c_char) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/pyframe.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pyframe.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/pyframe.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pyframe.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,16 @@
+#[cfg(not(GraalPy))]
+#[cfg(any(Py_3_10, all(Py_3_9, not(Py_LIMITED_API))))]
+use crate::PyCodeObject;
+#[cfg(not(Py_LIMITED_API))]
+use crate::PyFrameObject;
+use std::os::raw::c_int;
+
+#[cfg(Py_LIMITED_API)]
+opaque_struct!(PyFrameObject);
+
+extern "C" {
+    pub fn PyFrame_GetLineNumber(f: *mut PyFrameObject) -> c_int;
+    #[cfg(not(GraalPy))]
+    #[cfg(any(Py_3_10, all(Py_3_9, not(Py_LIMITED_API))))]
+    pub fn PyFrame_GetCode(f: *mut PyFrameObject) -> *mut PyCodeObject;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/pyhash.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pyhash.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/pyhash.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pyhash.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,52 @@
+#[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+use crate::pyport::{Py_hash_t, Py_ssize_t};
+#[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+use std::os::raw::{c_char, c_void};
+
+use std::os::raw::{c_int, c_ulong};
+
+extern "C" {
+    // skipped non-limited _Py_HashDouble
+    // skipped non-limited _Py_HashPointer
+    // skipped non-limited _Py_HashPointerRaw
+
+    #[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+    pub fn _Py_HashBytes(src: *const c_void, len: Py_ssize_t) -> Py_hash_t;
+}
+
+pub const _PyHASH_MULTIPLIER: c_ulong = 1000003;
+
+// skipped _PyHASH_BITS
+
+// skipped non-limited _Py_HashSecret_t
+
+#[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyHash_FuncDef {
+    pub hash: Option<extern "C" fn(arg1: *const c_void, arg2: Py_ssize_t) -> Py_hash_t>,
+    pub name: *const c_char,
+    pub hash_bits: c_int,
+    pub seed_bits: c_int,
+}
+
+#[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+impl Default for PyHash_FuncDef {
+    #[inline]
+    fn default() -> Self {
+        unsafe { std::mem::zeroed() }
+    }
+}
+
+extern "C" {
+    #[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+    pub fn PyHash_GetFuncDef() -> *mut PyHash_FuncDef;
+}
+
+// skipped Py_HASH_CUTOFF
+
+pub const Py_HASH_EXTERNAL: c_int = 0;
+pub const Py_HASH_SIPHASH24: c_int = 1;
+pub const Py_HASH_FNV: c_int = 2;
+
+// skipped Py_HASH_ALGORITHM
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/pylifecycle.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pylifecycle.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/pylifecycle.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pylifecycle.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,55 @@
+use crate::pystate::PyThreadState;
+
+use libc::wchar_t;
+use std::os::raw::{c_char, c_int};
+
+extern "C" {
+    pub fn Py_Initialize();
+    pub fn Py_InitializeEx(arg1: c_int);
+    pub fn Py_Finalize();
+    pub fn Py_FinalizeEx() -> c_int;
+
+    #[cfg_attr(PyPy, link_name = "PyPy_IsInitialized")]
+    pub fn Py_IsInitialized() -> c_int;
+
+    pub fn Py_NewInterpreter() -> *mut PyThreadState;
+    pub fn Py_EndInterpreter(arg1: *mut PyThreadState);
+
+    #[cfg_attr(PyPy, link_name = "PyPy_AtExit")]
+    pub fn Py_AtExit(func: Option<extern "C" fn()>) -> c_int;
+
+    pub fn Py_Exit(arg1: c_int);
+
+    pub fn Py_Main(argc: c_int, argv: *mut *mut wchar_t) -> c_int;
+    pub fn Py_BytesMain(argc: c_int, argv: *mut *mut c_char) -> c_int;
+
+    pub fn Py_SetProgramName(arg1: *const wchar_t);
+    #[cfg_attr(PyPy, link_name = "PyPy_GetProgramName")]
+    pub fn Py_GetProgramName() -> *mut wchar_t;
+
+    pub fn Py_SetPythonHome(arg1: *const wchar_t);
+    pub fn Py_GetPythonHome() -> *mut wchar_t;
+
+    pub fn Py_GetProgramFullPath() -> *mut wchar_t;
+
+    pub fn Py_GetPrefix() -> *mut wchar_t;
+    pub fn Py_GetExecPrefix() -> *mut wchar_t;
+    pub fn Py_GetPath() -> *mut wchar_t;
+    pub fn Py_SetPath(arg1: *const wchar_t);
+
+    // skipped _Py_CheckPython3
+
+    #[cfg_attr(PyPy, link_name = "PyPy_GetVersion")]
+    pub fn Py_GetVersion() -> *const c_char;
+    pub fn Py_GetPlatform() -> *const c_char;
+    pub fn Py_GetCopyright() -> *const c_char;
+    pub fn Py_GetCompiler() -> *const c_char;
+    pub fn Py_GetBuildInfo() -> *const c_char;
+}
+
+type PyOS_sighandler_t = unsafe extern "C" fn(arg1: c_int);
+
+extern "C" {
+    pub fn PyOS_getsig(arg1: c_int) -> PyOS_sighandler_t;
+    pub fn PyOS_setsig(arg1: c_int, arg2: PyOS_sighandler_t) -> PyOS_sighandler_t;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/pymem.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pymem.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/pymem.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pymem.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,13 @@
+use libc::size_t;
+use std::os::raw::c_void;
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyMem_Malloc")]
+    pub fn PyMem_Malloc(size: size_t) -> *mut c_void;
+    #[cfg_attr(PyPy, link_name = "PyPyMem_Calloc")]
+    pub fn PyMem_Calloc(nelem: size_t, elsize: size_t) -> *mut c_void;
+    #[cfg_attr(PyPy, link_name = "PyPyMem_Realloc")]
+    pub fn PyMem_Realloc(ptr: *mut c_void, new_size: size_t) -> *mut c_void;
+    #[cfg_attr(PyPy, link_name = "PyPyMem_Free")]
+    pub fn PyMem_Free(ptr: *mut c_void);
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/pyport.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pyport.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/pyport.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pyport.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,25 @@
+pub type PY_UINT32_T = u32;
+pub type PY_UINT64_T = u64;
+
+pub type PY_INT32_T = i32;
+pub type PY_INT64_T = i64;
+
+pub type Py_uintptr_t = ::libc::uintptr_t;
+pub type Py_intptr_t = ::libc::intptr_t;
+pub type Py_ssize_t = ::libc::ssize_t;
+
+pub type Py_hash_t = Py_ssize_t;
+pub type Py_uhash_t = ::libc::size_t;
+
+pub const PY_SSIZE_T_MIN: Py_ssize_t = isize::MIN as Py_ssize_t;
+pub const PY_SSIZE_T_MAX: Py_ssize_t = isize::MAX as Py_ssize_t;
+
+#[cfg(target_endian = "big")]
+pub const PY_BIG_ENDIAN: usize = 1;
+#[cfg(target_endian = "big")]
+pub const PY_LITTLE_ENDIAN: usize = 0;
+
+#[cfg(target_endian = "little")]
+pub const PY_BIG_ENDIAN: usize = 0;
+#[cfg(target_endian = "little")]
+pub const PY_LITTLE_ENDIAN: usize = 1;
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/pystate.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pystate.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/pystate.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pystate.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,87 @@
+#[cfg(any(not(PyPy), Py_3_9))]
+use crate::moduleobject::PyModuleDef;
+use crate::object::PyObject;
+use std::os::raw::c_int;
+
+#[cfg(not(PyPy))]
+use std::os::raw::c_long;
+
+pub const MAX_CO_EXTRA_USERS: c_int = 255;
+
+opaque_struct!(PyThreadState);
+opaque_struct!(PyInterpreterState);
+
+extern "C" {
+    #[cfg(not(PyPy))]
+    pub fn PyInterpreterState_New() -> *mut PyInterpreterState;
+    #[cfg(not(PyPy))]
+    pub fn PyInterpreterState_Clear(arg1: *mut PyInterpreterState);
+    #[cfg(not(PyPy))]
+    pub fn PyInterpreterState_Delete(arg1: *mut PyInterpreterState);
+
+    #[cfg(all(Py_3_9, not(PyPy)))]
+    pub fn PyInterpreterState_Get() -> *mut PyInterpreterState;
+
+    #[cfg(all(Py_3_8, not(PyPy)))]
+    pub fn PyInterpreterState_GetDict(arg1: *mut PyInterpreterState) -> *mut PyObject;
+
+    #[cfg(not(PyPy))]
+    pub fn PyInterpreterState_GetID(arg1: *mut PyInterpreterState) -> i64;
+
+    #[cfg(any(not(PyPy), Py_3_9))] // only on PyPy since 3.9
+    #[cfg_attr(PyPy, link_name = "PyPyState_AddModule")]
+    pub fn PyState_AddModule(arg1: *mut PyObject, arg2: *mut PyModuleDef) -> c_int;
+
+    #[cfg(any(not(PyPy), Py_3_9))] // only on PyPy since 3.9
+    #[cfg_attr(PyPy, link_name = "PyPyState_RemoveModule")]
+    pub fn PyState_RemoveModule(arg1: *mut PyModuleDef) -> c_int;
+
+    #[cfg(any(not(PyPy), Py_3_9))] // only on PyPy since 3.9
+    // only has PyPy prefix since 3.10
+    #[cfg_attr(all(PyPy, Py_3_10), link_name = "PyPyState_FindModule")]
+    pub fn PyState_FindModule(arg1: *mut PyModuleDef) -> *mut PyObject;
+
+    #[cfg_attr(PyPy, link_name = "PyPyThreadState_New")]
+    pub fn PyThreadState_New(arg1: *mut PyInterpreterState) -> *mut PyThreadState;
+    #[cfg_attr(PyPy, link_name = "PyPyThreadState_Clear")]
+    pub fn PyThreadState_Clear(arg1: *mut PyThreadState);
+    #[cfg_attr(PyPy, link_name = "PyPyThreadState_Delete")]
+    pub fn PyThreadState_Delete(arg1: *mut PyThreadState);
+
+    #[cfg_attr(PyPy, link_name = "PyPyThreadState_Get")]
+    pub fn PyThreadState_Get() -> *mut PyThreadState;
+}
+
+#[inline]
+pub unsafe fn PyThreadState_GET() -> *mut PyThreadState {
+    PyThreadState_Get()
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyThreadState_Swap")]
+    pub fn PyThreadState_Swap(arg1: *mut PyThreadState) -> *mut PyThreadState;
+    #[cfg_attr(PyPy, link_name = "PyPyThreadState_GetDict")]
+    pub fn PyThreadState_GetDict() -> *mut PyObject;
+    #[cfg(not(PyPy))]
+    pub fn PyThreadState_SetAsyncExc(arg1: c_long, arg2: *mut PyObject) -> c_int;
+}
+
+// skipped non-limited / 3.9 PyThreadState_GetInterpreter
+// skipped non-limited / 3.9 PyThreadState_GetFrame
+// skipped non-limited / 3.9 PyThreadState_GetID
+
+#[repr(C)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq)]
+pub enum PyGILState_STATE {
+    PyGILState_LOCKED,
+    PyGILState_UNLOCKED,
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyGILState_Ensure")]
+    pub fn PyGILState_Ensure() -> PyGILState_STATE;
+    #[cfg_attr(PyPy, link_name = "PyPyGILState_Release")]
+    pub fn PyGILState_Release(arg1: PyGILState_STATE);
+    #[cfg(not(PyPy))]
+    pub fn PyGILState_GetThisThreadState() -> *mut PyThreadState;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/pystrtod.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pystrtod.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/pystrtod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pystrtod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,32 @@
+use crate::object::PyObject;
+use std::os::raw::{c_char, c_double, c_int};
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyOS_string_to_double")]
+    pub fn PyOS_string_to_double(
+        str: *const c_char,
+        endptr: *mut *mut c_char,
+        overflow_exception: *mut PyObject,
+    ) -> c_double;
+    #[cfg_attr(PyPy, link_name = "PyPyOS_double_to_string")]
+    pub fn PyOS_double_to_string(
+        val: c_double,
+        format_code: c_char,
+        precision: c_int,
+        flags: c_int,
+        _type: *mut c_int,
+    ) -> *mut c_char;
+}
+
+// skipped non-limited _Py_string_to_number_with_underscores
+// skipped non-limited _Py_parse_inf_or_nan
+
+/* PyOS_double_to_string's "flags" parameter can be set to 0 or more of: */
+pub const Py_DTSF_SIGN: c_int = 0x01; /* always add the sign */
+pub const Py_DTSF_ADD_DOT_0: c_int = 0x02; /* if the result is an integer add ".0" */
+pub const Py_DTSF_ALT: c_int = 0x04; /* "alternate" formatting. it's format_code specific */
+
+/* PyOS_double_to_string's "type", if non-NULL, will be set to one of: */
+pub const Py_DTST_FINITE: c_int = 0;
+pub const Py_DTST_INFINITE: c_int = 1;
+pub const Py_DTST_NAN: c_int = 2;
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/pythonrun.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pythonrun.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/pythonrun.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/pythonrun.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,88 @@
+use crate::object::*;
+#[cfg(not(any(PyPy, Py_LIMITED_API, Py_3_10)))]
+use libc::FILE;
+#[cfg(any(Py_LIMITED_API, not(Py_3_10), PyPy, GraalPy))]
+use std::os::raw::c_char;
+use std::os::raw::c_int;
+
+extern "C" {
+    #[cfg(any(all(Py_LIMITED_API, not(PyPy)), GraalPy))]
+    pub fn Py_CompileString(string: *const c_char, p: *const c_char, s: c_int) -> *mut PyObject;
+
+    #[cfg_attr(PyPy, link_name = "PyPyErr_Print")]
+    pub fn PyErr_Print();
+    #[cfg_attr(PyPy, link_name = "PyPyErr_PrintEx")]
+    pub fn PyErr_PrintEx(arg1: c_int);
+    #[cfg_attr(PyPy, link_name = "PyPyErr_Display")]
+    pub fn PyErr_Display(arg1: *mut PyObject, arg2: *mut PyObject, arg3: *mut PyObject);
+
+    #[cfg(Py_3_12)]
+    pub fn PyErr_DisplayException(exc: *mut PyObject);
+}
+
+#[inline]
+#[cfg(PyPy)]
+pub unsafe fn Py_CompileString(string: *const c_char, p: *const c_char, s: c_int) -> *mut PyObject {
+    // PyPy's implementation of Py_CompileString always forwards to Py_CompileStringFlags; this
+    // is only available in the non-limited API and has a real definition for all versions in
+    // the cpython/ subdirectory.
+    #[cfg(Py_LIMITED_API)]
+    extern "C" {
+        #[link_name = "PyPy_CompileStringFlags"]
+        pub fn Py_CompileStringFlags(
+            string: *const c_char,
+            p: *const c_char,
+            s: c_int,
+            f: *mut std::os::raw::c_void, // Actually *mut Py_CompilerFlags in the real definition
+        ) -> *mut PyObject;
+    }
+    #[cfg(not(Py_LIMITED_API))]
+    use crate::Py_CompileStringFlags;
+
+    Py_CompileStringFlags(string, p, s, std::ptr::null_mut())
+}
+
+// skipped PyOS_InputHook
+
+pub const PYOS_STACK_MARGIN: c_int = 2048;
+
+// skipped PyOS_CheckStack under Microsoft C
+
+#[cfg(not(any(PyPy, Py_LIMITED_API, Py_3_10)))]
+opaque_struct!(_mod);
+
+#[cfg(not(any(PyPy, Py_3_10)))]
+opaque_struct!(symtable);
+#[cfg(not(any(PyPy, Py_3_10)))]
+opaque_struct!(_node);
+
+#[cfg(not(any(PyPy, Py_LIMITED_API, Py_3_10)))]
+#[cfg_attr(Py_3_9, deprecated(note = "Python 3.9"))]
+#[inline]
+pub unsafe fn PyParser_SimpleParseString(s: *const c_char, b: c_int) -> *mut _node {
+    #[allow(deprecated)]
+    crate::PyParser_SimpleParseStringFlags(s, b, 0)
+}
+
+#[cfg(not(any(PyPy, Py_LIMITED_API, Py_3_10)))]
+#[cfg_attr(Py_3_9, deprecated(note = "Python 3.9"))]
+#[inline]
+pub unsafe fn PyParser_SimpleParseFile(fp: *mut FILE, s: *const c_char, b: c_int) -> *mut _node {
+    #[allow(deprecated)]
+    crate::PyParser_SimpleParseFileFlags(fp, s, b, 0)
+}
+
+extern "C" {
+    #[cfg(not(any(PyPy, Py_3_10)))]
+    pub fn Py_SymtableString(
+        str: *const c_char,
+        filename: *const c_char,
+        start: c_int,
+    ) -> *mut symtable;
+    #[cfg(not(any(PyPy, Py_LIMITED_API, Py_3_10)))]
+    pub fn Py_SymtableStringObject(
+        str: *const c_char,
+        filename: *mut PyObject,
+        start: c_int,
+    ) -> *mut symtable;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/rangeobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/rangeobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/rangeobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/rangeobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,16 @@
+use crate::object::*;
+use std::os::raw::c_int;
+use std::ptr::addr_of_mut;
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyRange_Type")]
+    pub static mut PyRange_Type: PyTypeObject;
+    pub static mut PyRangeIter_Type: PyTypeObject;
+    pub static mut PyLongRangeIter_Type: PyTypeObject;
+}
+
+#[inline]
+pub unsafe fn PyRange_Check(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyRange_Type)) as c_int
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/setobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/setobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/setobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/setobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,150 @@
+use crate::object::*;
+#[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+use crate::pyport::Py_hash_t;
+use crate::pyport::Py_ssize_t;
+use std::os::raw::c_int;
+use std::ptr::addr_of_mut;
+
+pub const PySet_MINSIZE: usize = 8;
+
+#[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+#[repr(C)]
+#[derive(Debug)]
+pub struct setentry {
+    pub key: *mut PyObject,
+    pub hash: Py_hash_t,
+}
+
+#[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+#[repr(C)]
+#[derive(Debug)]
+pub struct PySetObject {
+    pub ob_base: PyObject,
+    pub fill: Py_ssize_t,
+    pub used: Py_ssize_t,
+    pub mask: Py_ssize_t,
+    pub table: *mut setentry,
+    pub hash: Py_hash_t,
+    pub finger: Py_ssize_t,
+    pub smalltable: [setentry; PySet_MINSIZE],
+    pub weakreflist: *mut PyObject,
+}
+
+// skipped
+#[inline]
+#[cfg(all(not(any(PyPy, GraalPy)), not(Py_LIMITED_API)))]
+pub unsafe fn PySet_GET_SIZE(so: *mut PyObject) -> Py_ssize_t {
+    debug_assert_eq!(PyAnySet_Check(so), 1);
+    let so = so.cast::<PySetObject>();
+    (*so).used
+}
+
+#[cfg(not(Py_LIMITED_API))]
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    pub static mut _PySet_Dummy: *mut PyObject;
+}
+
+extern "C" {
+    #[cfg(not(Py_LIMITED_API))]
+    #[cfg_attr(PyPy, link_name = "_PyPySet_NextEntry")]
+    pub fn _PySet_NextEntry(
+        set: *mut PyObject,
+        pos: *mut Py_ssize_t,
+        key: *mut *mut PyObject,
+        hash: *mut super::Py_hash_t,
+    ) -> c_int;
+
+    // skipped non-limited _PySet_Update
+}
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPySet_Type")]
+    pub static mut PySet_Type: PyTypeObject;
+    #[cfg_attr(PyPy, link_name = "PyPyFrozenSet_Type")]
+    pub static mut PyFrozenSet_Type: PyTypeObject;
+    pub static mut PySetIter_Type: PyTypeObject;
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPySet_New")]
+    pub fn PySet_New(arg1: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyFrozenSet_New")]
+    pub fn PyFrozenSet_New(arg1: *mut PyObject) -> *mut PyObject;
+
+    #[cfg_attr(PyPy, link_name = "PyPySet_Add")]
+    pub fn PySet_Add(set: *mut PyObject, key: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPySet_Clear")]
+    pub fn PySet_Clear(set: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPySet_Contains")]
+    pub fn PySet_Contains(anyset: *mut PyObject, key: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPySet_Discard")]
+    pub fn PySet_Discard(set: *mut PyObject, key: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPySet_Pop")]
+    pub fn PySet_Pop(set: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPySet_Size")]
+    pub fn PySet_Size(anyset: *mut PyObject) -> Py_ssize_t;
+
+    #[cfg(PyPy)]
+    #[link_name = "PyPyFrozenSet_CheckExact"]
+    pub fn PyFrozenSet_CheckExact(ob: *mut PyObject) -> c_int;
+}
+
+#[inline]
+#[cfg(not(any(PyPy, GraalPy)))]
+pub unsafe fn PyFrozenSet_CheckExact(ob: *mut PyObject) -> c_int {
+    (Py_TYPE(ob) == addr_of_mut!(PyFrozenSet_Type)) as c_int
+}
+
+extern "C" {
+    #[cfg(PyPy)]
+    #[link_name = "PyPyFrozenSet_Check"]
+    pub fn PyFrozenSet_Check(ob: *mut PyObject) -> c_int;
+}
+
+#[inline]
+#[cfg(not(PyPy))]
+pub unsafe fn PyFrozenSet_Check(ob: *mut PyObject) -> c_int {
+    (Py_TYPE(ob) == addr_of_mut!(PyFrozenSet_Type)
+        || PyType_IsSubtype(Py_TYPE(ob), addr_of_mut!(PyFrozenSet_Type)) != 0) as c_int
+}
+
+extern "C" {
+    #[cfg(PyPy)]
+    #[link_name = "PyPyAnySet_CheckExact"]
+    pub fn PyAnySet_CheckExact(ob: *mut PyObject) -> c_int;
+}
+
+#[inline]
+#[cfg(not(PyPy))]
+pub unsafe fn PyAnySet_CheckExact(ob: *mut PyObject) -> c_int {
+    (Py_TYPE(ob) == addr_of_mut!(PySet_Type) || Py_TYPE(ob) == addr_of_mut!(PyFrozenSet_Type))
+        as c_int
+}
+
+#[inline]
+pub unsafe fn PyAnySet_Check(ob: *mut PyObject) -> c_int {
+    (PyAnySet_CheckExact(ob) != 0
+        || PyType_IsSubtype(Py_TYPE(ob), addr_of_mut!(PySet_Type)) != 0
+        || PyType_IsSubtype(Py_TYPE(ob), addr_of_mut!(PyFrozenSet_Type)) != 0) as c_int
+}
+
+#[inline]
+#[cfg(Py_3_10)]
+pub unsafe fn PySet_CheckExact(op: *mut PyObject) -> c_int {
+    crate::Py_IS_TYPE(op, addr_of_mut!(PySet_Type))
+}
+
+extern "C" {
+    #[cfg(PyPy)]
+    #[link_name = "PyPySet_Check"]
+    pub fn PySet_Check(ob: *mut PyObject) -> c_int;
+}
+
+#[inline]
+#[cfg(not(PyPy))]
+pub unsafe fn PySet_Check(ob: *mut PyObject) -> c_int {
+    (Py_TYPE(ob) == addr_of_mut!(PySet_Type)
+        || PyType_IsSubtype(Py_TYPE(ob), addr_of_mut!(PySet_Type)) != 0) as c_int
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/sliceobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/sliceobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/sliceobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/sliceobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,103 @@
+use crate::object::*;
+use crate::pyport::Py_ssize_t;
+use std::os::raw::c_int;
+use std::ptr::addr_of_mut;
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg(not(GraalPy))]
+    #[cfg_attr(PyPy, link_name = "_PyPy_EllipsisObject")]
+    static mut _Py_EllipsisObject: PyObject;
+
+    #[cfg(GraalPy)]
+    static mut _Py_EllipsisObjectReference: *mut PyObject;
+}
+
+#[inline]
+pub unsafe fn Py_Ellipsis() -> *mut PyObject {
+    #[cfg(not(GraalPy))]
+    return addr_of_mut!(_Py_EllipsisObject);
+    #[cfg(GraalPy)]
+    return _Py_EllipsisObjectReference;
+}
+
+#[cfg(not(Py_LIMITED_API))]
+#[repr(C)]
+pub struct PySliceObject {
+    pub ob_base: PyObject,
+    #[cfg(not(GraalPy))]
+    pub start: *mut PyObject,
+    #[cfg(not(GraalPy))]
+    pub stop: *mut PyObject,
+    #[cfg(not(GraalPy))]
+    pub step: *mut PyObject,
+}
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPySlice_Type")]
+    pub static mut PySlice_Type: PyTypeObject;
+    pub static mut PyEllipsis_Type: PyTypeObject;
+}
+
+#[inline]
+pub unsafe fn PySlice_Check(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PySlice_Type)) as c_int
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPySlice_New")]
+    pub fn PySlice_New(
+        start: *mut PyObject,
+        stop: *mut PyObject,
+        step: *mut PyObject,
+    ) -> *mut PyObject;
+
+    // skipped non-limited _PySlice_FromIndices
+    // skipped non-limited _PySlice_GetLongIndices
+
+    #[cfg_attr(PyPy, link_name = "PyPySlice_GetIndices")]
+    pub fn PySlice_GetIndices(
+        r: *mut PyObject,
+        length: Py_ssize_t,
+        start: *mut Py_ssize_t,
+        stop: *mut Py_ssize_t,
+        step: *mut Py_ssize_t,
+    ) -> c_int;
+}
+
+#[inline]
+pub unsafe fn PySlice_GetIndicesEx(
+    slice: *mut PyObject,
+    length: Py_ssize_t,
+    start: *mut Py_ssize_t,
+    stop: *mut Py_ssize_t,
+    step: *mut Py_ssize_t,
+    slicelength: *mut Py_ssize_t,
+) -> c_int {
+    if PySlice_Unpack(slice, start, stop, step) < 0 {
+        *slicelength = 0;
+        -1
+    } else {
+        *slicelength = PySlice_AdjustIndices(length, start, stop, *step);
+        0
+    }
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPySlice_Unpack")]
+    pub fn PySlice_Unpack(
+        slice: *mut PyObject,
+        start: *mut Py_ssize_t,
+        stop: *mut Py_ssize_t,
+        step: *mut Py_ssize_t,
+    ) -> c_int;
+
+    #[cfg_attr(all(PyPy, Py_3_10), link_name = "PyPySlice_AdjustIndices")]
+    pub fn PySlice_AdjustIndices(
+        length: Py_ssize_t,
+        start: *mut Py_ssize_t,
+        stop: *mut Py_ssize_t,
+        step: Py_ssize_t,
+    ) -> Py_ssize_t;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/structmember.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/structmember.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/structmember.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/structmember.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,33 @@
+use std::os::raw::c_int;
+
+pub use crate::PyMemberDef;
+
+pub use crate::Py_T_BOOL as T_BOOL;
+pub use crate::Py_T_BYTE as T_BYTE;
+pub use crate::Py_T_CHAR as T_CHAR;
+pub use crate::Py_T_DOUBLE as T_DOUBLE;
+pub use crate::Py_T_FLOAT as T_FLOAT;
+pub use crate::Py_T_INT as T_INT;
+pub use crate::Py_T_LONG as T_LONG;
+pub use crate::Py_T_LONGLONG as T_LONGLONG;
+pub use crate::Py_T_OBJECT_EX as T_OBJECT_EX;
+pub use crate::Py_T_SHORT as T_SHORT;
+pub use crate::Py_T_STRING as T_STRING;
+pub use crate::Py_T_STRING_INPLACE as T_STRING_INPLACE;
+pub use crate::Py_T_UBYTE as T_UBYTE;
+pub use crate::Py_T_UINT as T_UINT;
+pub use crate::Py_T_ULONG as T_ULONG;
+pub use crate::Py_T_ULONGLONG as T_ULONGLONG;
+pub use crate::Py_T_USHORT as T_USHORT;
+#[allow(deprecated)]
+pub use crate::_Py_T_OBJECT as T_OBJECT;
+
+pub use crate::Py_T_PYSSIZET as T_PYSSIZET;
+#[allow(deprecated)]
+pub use crate::_Py_T_NONE as T_NONE;
+
+/* Flags */
+pub use crate::Py_READONLY as READONLY;
+pub const READ_RESTRICTED: c_int = 2;
+pub const PY_WRITE_RESTRICTED: c_int = 4;
+pub const RESTRICTED: c_int = READ_RESTRICTED | PY_WRITE_RESTRICTED;
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/structseq.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/structseq.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/structseq.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/structseq.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,63 @@
+use crate::object::{PyObject, PyTypeObject};
+#[cfg(not(PyPy))]
+use crate::pyport::Py_ssize_t;
+use std::os::raw::{c_char, c_int};
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyStructSequence_Field {
+    pub name: *const c_char,
+    pub doc: *const c_char,
+}
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct PyStructSequence_Desc {
+    pub name: *const c_char,
+    pub doc: *const c_char,
+    pub fields: *mut PyStructSequence_Field,
+    pub n_in_sequence: c_int,
+}
+
+// skipped PyStructSequence_UnnamedField;
+
+extern "C" {
+    #[cfg(not(Py_LIMITED_API))]
+    #[cfg_attr(PyPy, link_name = "PyPyStructSequence_InitType")]
+    pub fn PyStructSequence_InitType(_type: *mut PyTypeObject, desc: *mut PyStructSequence_Desc);
+
+    #[cfg(not(Py_LIMITED_API))]
+    #[cfg_attr(PyPy, link_name = "PyPyStructSequence_InitType2")]
+    pub fn PyStructSequence_InitType2(
+        _type: *mut PyTypeObject,
+        desc: *mut PyStructSequence_Desc,
+    ) -> c_int;
+
+    #[cfg(not(PyPy))]
+    pub fn PyStructSequence_NewType(desc: *mut PyStructSequence_Desc) -> *mut PyTypeObject;
+    #[cfg_attr(PyPy, link_name = "PyPyStructSequence_New")]
+    pub fn PyStructSequence_New(_type: *mut PyTypeObject) -> *mut PyObject;
+}
+
+#[cfg(not(Py_LIMITED_API))]
+pub type PyStructSequence = crate::PyTupleObject;
+
+#[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+#[inline]
+pub unsafe fn PyStructSequence_SET_ITEM(op: *mut PyObject, i: Py_ssize_t, v: *mut PyObject) {
+    crate::PyTuple_SET_ITEM(op, i, v)
+}
+
+#[cfg(not(any(Py_LIMITED_API, PyPy, GraalPy)))]
+#[inline]
+pub unsafe fn PyStructSequence_GET_ITEM(op: *mut PyObject, i: Py_ssize_t) -> *mut PyObject {
+    crate::PyTuple_GET_ITEM(op, i)
+}
+
+extern "C" {
+    #[cfg(not(PyPy))]
+    pub fn PyStructSequence_SetItem(arg1: *mut PyObject, arg2: Py_ssize_t, arg3: *mut PyObject);
+
+    #[cfg(not(PyPy))]
+    pub fn PyStructSequence_GetItem(arg1: *mut PyObject, arg2: Py_ssize_t) -> *mut PyObject;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/sysmodule.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/sysmodule.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/sysmodule.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/sysmodule.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,32 @@
+use crate::object::PyObject;
+use libc::wchar_t;
+use std::os::raw::{c_char, c_int};
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPySys_GetObject")]
+    pub fn PySys_GetObject(arg1: *const c_char) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPySys_SetObject")]
+    pub fn PySys_SetObject(arg1: *const c_char, arg2: *mut PyObject) -> c_int;
+
+    pub fn PySys_SetArgv(arg1: c_int, arg2: *mut *mut wchar_t);
+    pub fn PySys_SetArgvEx(arg1: c_int, arg2: *mut *mut wchar_t, arg3: c_int);
+    pub fn PySys_SetPath(arg1: *const wchar_t);
+
+    #[cfg_attr(PyPy, link_name = "PyPySys_WriteStdout")]
+    pub fn PySys_WriteStdout(format: *const c_char, ...);
+    #[cfg_attr(PyPy, link_name = "PyPySys_WriteStderr")]
+    pub fn PySys_WriteStderr(format: *const c_char, ...);
+    pub fn PySys_FormatStdout(format: *const c_char, ...);
+    pub fn PySys_FormatStderr(format: *const c_char, ...);
+
+    pub fn PySys_ResetWarnOptions();
+    #[cfg_attr(Py_3_11, deprecated(note = "Python 3.11"))]
+    pub fn PySys_AddWarnOption(arg1: *const wchar_t);
+    #[cfg_attr(Py_3_11, deprecated(note = "Python 3.11"))]
+    pub fn PySys_AddWarnOptionUnicode(arg1: *mut PyObject);
+    #[cfg_attr(Py_3_11, deprecated(note = "Python 3.11"))]
+    pub fn PySys_HasWarnOptions() -> c_int;
+
+    pub fn PySys_AddXOption(arg1: *const wchar_t);
+    pub fn PySys_GetXOptions() -> *mut PyObject;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/traceback.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/traceback.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/traceback.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/traceback.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,27 @@
+use crate::object::*;
+use std::os::raw::c_int;
+#[cfg(not(PyPy))]
+use std::ptr::addr_of_mut;
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyTraceBack_Here")]
+    pub fn PyTraceBack_Here(arg1: *mut crate::PyFrameObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyTraceBack_Print")]
+    pub fn PyTraceBack_Print(arg1: *mut PyObject, arg2: *mut PyObject) -> c_int;
+}
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyTraceBack_Type")]
+    pub static mut PyTraceBack_Type: PyTypeObject;
+
+    #[cfg(PyPy)]
+    #[link_name = "PyPyTraceBack_Check"]
+    pub fn PyTraceBack_Check(op: *mut PyObject) -> c_int;
+}
+
+#[inline]
+#[cfg(not(PyPy))]
+pub unsafe fn PyTraceBack_Check(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyTraceBack_Type)) as c_int
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/tupleobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/tupleobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/tupleobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/tupleobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,42 @@
+use crate::object::*;
+use crate::pyport::Py_ssize_t;
+use std::os::raw::c_int;
+use std::ptr::addr_of_mut;
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyTuple_Type")]
+    pub static mut PyTuple_Type: PyTypeObject;
+    pub static mut PyTupleIter_Type: PyTypeObject;
+}
+
+#[inline]
+pub unsafe fn PyTuple_Check(op: *mut PyObject) -> c_int {
+    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
+}
+
+#[inline]
+pub unsafe fn PyTuple_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyTuple_Type)) as c_int
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyTuple_New")]
+    pub fn PyTuple_New(size: Py_ssize_t) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyTuple_Size")]
+    pub fn PyTuple_Size(arg1: *mut PyObject) -> Py_ssize_t;
+    #[cfg_attr(PyPy, link_name = "PyPyTuple_GetItem")]
+    pub fn PyTuple_GetItem(arg1: *mut PyObject, arg2: Py_ssize_t) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyTuple_SetItem")]
+    pub fn PyTuple_SetItem(arg1: *mut PyObject, arg2: Py_ssize_t, arg3: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyTuple_GetSlice")]
+    pub fn PyTuple_GetSlice(
+        arg1: *mut PyObject,
+        arg2: Py_ssize_t,
+        arg3: Py_ssize_t,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyTuple_Pack")]
+    pub fn PyTuple_Pack(arg1: Py_ssize_t, ...) -> *mut PyObject;
+    #[cfg(not(Py_3_9))]
+    pub fn PyTuple_ClearFreeList() -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/typeslots.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/typeslots.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/typeslots.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/typeslots.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,82 @@
+use std::os::raw::c_int;
+
+pub const Py_bf_getbuffer: c_int = 1;
+pub const Py_bf_releasebuffer: c_int = 2;
+pub const Py_mp_ass_subscript: c_int = 3;
+pub const Py_mp_length: c_int = 4;
+pub const Py_mp_subscript: c_int = 5;
+pub const Py_nb_absolute: c_int = 6;
+pub const Py_nb_add: c_int = 7;
+pub const Py_nb_and: c_int = 8;
+pub const Py_nb_bool: c_int = 9;
+pub const Py_nb_divmod: c_int = 10;
+pub const Py_nb_float: c_int = 11;
+pub const Py_nb_floor_divide: c_int = 12;
+pub const Py_nb_index: c_int = 13;
+pub const Py_nb_inplace_add: c_int = 14;
+pub const Py_nb_inplace_and: c_int = 15;
+pub const Py_nb_inplace_floor_divide: c_int = 16;
+pub const Py_nb_inplace_lshift: c_int = 17;
+pub const Py_nb_inplace_multiply: c_int = 18;
+pub const Py_nb_inplace_or: c_int = 19;
+pub const Py_nb_inplace_power: c_int = 20;
+pub const Py_nb_inplace_remainder: c_int = 21;
+pub const Py_nb_inplace_rshift: c_int = 22;
+pub const Py_nb_inplace_subtract: c_int = 23;
+pub const Py_nb_inplace_true_divide: c_int = 24;
+pub const Py_nb_inplace_xor: c_int = 25;
+pub const Py_nb_int: c_int = 26;
+pub const Py_nb_invert: c_int = 27;
+pub const Py_nb_lshift: c_int = 28;
+pub const Py_nb_multiply: c_int = 29;
+pub const Py_nb_negative: c_int = 30;
+pub const Py_nb_or: c_int = 31;
+pub const Py_nb_positive: c_int = 32;
+pub const Py_nb_power: c_int = 33;
+pub const Py_nb_remainder: c_int = 34;
+pub const Py_nb_rshift: c_int = 35;
+pub const Py_nb_subtract: c_int = 36;
+pub const Py_nb_true_divide: c_int = 37;
+pub const Py_nb_xor: c_int = 38;
+pub const Py_sq_ass_item: c_int = 39;
+pub const Py_sq_concat: c_int = 40;
+pub const Py_sq_contains: c_int = 41;
+pub const Py_sq_inplace_concat: c_int = 42;
+pub const Py_sq_inplace_repeat: c_int = 43;
+pub const Py_sq_item: c_int = 44;
+pub const Py_sq_length: c_int = 45;
+pub const Py_sq_repeat: c_int = 46;
+pub const Py_tp_alloc: c_int = 47;
+pub const Py_tp_base: c_int = 48;
+pub const Py_tp_bases: c_int = 49;
+pub const Py_tp_call: c_int = 50;
+pub const Py_tp_clear: c_int = 51;
+pub const Py_tp_dealloc: c_int = 52;
+pub const Py_tp_del: c_int = 53;
+pub const Py_tp_descr_get: c_int = 54;
+pub const Py_tp_descr_set: c_int = 55;
+pub const Py_tp_doc: c_int = 56;
+pub const Py_tp_getattr: c_int = 57;
+pub const Py_tp_getattro: c_int = 58;
+pub const Py_tp_hash: c_int = 59;
+pub const Py_tp_init: c_int = 60;
+pub const Py_tp_is_gc: c_int = 61;
+pub const Py_tp_iter: c_int = 62;
+pub const Py_tp_iternext: c_int = 63;
+pub const Py_tp_methods: c_int = 64;
+pub const Py_tp_new: c_int = 65;
+pub const Py_tp_repr: c_int = 66;
+pub const Py_tp_richcompare: c_int = 67;
+pub const Py_tp_setattr: c_int = 68;
+pub const Py_tp_setattro: c_int = 69;
+pub const Py_tp_str: c_int = 70;
+pub const Py_tp_traverse: c_int = 71;
+pub const Py_tp_members: c_int = 72;
+pub const Py_tp_getset: c_int = 73;
+pub const Py_tp_free: c_int = 74;
+pub const Py_nb_matrix_multiply: c_int = 75;
+pub const Py_nb_inplace_matrix_multiply: c_int = 76;
+pub const Py_am_await: c_int = 77;
+pub const Py_am_aiter: c_int = 78;
+pub const Py_am_anext: c_int = 79;
+pub const Py_tp_finalize: c_int = 80;
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/unicodeobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/unicodeobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/unicodeobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/unicodeobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,349 @@
+use crate::object::*;
+use crate::pyport::Py_ssize_t;
+use libc::wchar_t;
+use std::os::raw::{c_char, c_int, c_void};
+#[cfg(not(PyPy))]
+use std::ptr::addr_of_mut;
+
+#[cfg(not(Py_LIMITED_API))]
+pub type Py_UNICODE = wchar_t;
+
+pub type Py_UCS4 = u32;
+pub type Py_UCS2 = u16;
+pub type Py_UCS1 = u8;
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_Type")]
+    pub static mut PyUnicode_Type: PyTypeObject;
+    pub static mut PyUnicodeIter_Type: PyTypeObject;
+
+    #[cfg(PyPy)]
+    #[link_name = "PyPyUnicode_Check"]
+    pub fn PyUnicode_Check(op: *mut PyObject) -> c_int;
+
+    #[cfg(PyPy)]
+    #[link_name = "PyPyUnicode_CheckExact"]
+    pub fn PyUnicode_CheckExact(op: *mut PyObject) -> c_int;
+}
+
+#[inline]
+#[cfg(not(PyPy))]
+pub unsafe fn PyUnicode_Check(op: *mut PyObject) -> c_int {
+    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS)
+}
+
+#[inline]
+#[cfg(not(PyPy))]
+pub unsafe fn PyUnicode_CheckExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(PyUnicode_Type)) as c_int
+}
+
+pub const Py_UNICODE_REPLACEMENT_CHARACTER: Py_UCS4 = 0xFFFD;
+
+extern "C" {
+
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_FromStringAndSize")]
+    pub fn PyUnicode_FromStringAndSize(u: *const c_char, size: Py_ssize_t) -> *mut PyObject;
+    pub fn PyUnicode_FromString(u: *const c_char) -> *mut PyObject;
+
+    pub fn PyUnicode_Substring(
+        str: *mut PyObject,
+        start: Py_ssize_t,
+        end: Py_ssize_t,
+    ) -> *mut PyObject;
+    pub fn PyUnicode_AsUCS4(
+        unicode: *mut PyObject,
+        buffer: *mut Py_UCS4,
+        buflen: Py_ssize_t,
+        copy_null: c_int,
+    ) -> *mut Py_UCS4;
+    pub fn PyUnicode_AsUCS4Copy(unicode: *mut PyObject) -> *mut Py_UCS4;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_GetLength")]
+    pub fn PyUnicode_GetLength(unicode: *mut PyObject) -> Py_ssize_t;
+    #[cfg(not(Py_3_12))]
+    #[deprecated(note = "Removed in Python 3.12")]
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_GetSize")]
+    pub fn PyUnicode_GetSize(unicode: *mut PyObject) -> Py_ssize_t;
+    pub fn PyUnicode_ReadChar(unicode: *mut PyObject, index: Py_ssize_t) -> Py_UCS4;
+    pub fn PyUnicode_WriteChar(
+        unicode: *mut PyObject,
+        index: Py_ssize_t,
+        character: Py_UCS4,
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_Resize")]
+    pub fn PyUnicode_Resize(unicode: *mut *mut PyObject, length: Py_ssize_t) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_FromEncodedObject")]
+    pub fn PyUnicode_FromEncodedObject(
+        obj: *mut PyObject,
+        encoding: *const c_char,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_FromObject")]
+    pub fn PyUnicode_FromObject(obj: *mut PyObject) -> *mut PyObject;
+    // #[cfg_attr(PyPy, link_name = "PyPyUnicode_FromFormatV")]
+    // pub fn PyUnicode_FromFormatV(format: *const c_char, vargs: va_list) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_FromFormat")]
+    pub fn PyUnicode_FromFormat(format: *const c_char, ...) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_InternInPlace")]
+    pub fn PyUnicode_InternInPlace(arg1: *mut *mut PyObject);
+    #[cfg(not(Py_3_12))]
+    #[cfg_attr(Py_3_10, deprecated(note = "Python 3.10"))]
+    pub fn PyUnicode_InternImmortal(arg1: *mut *mut PyObject);
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_InternFromString")]
+    pub fn PyUnicode_InternFromString(u: *const c_char) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_FromWideChar")]
+    pub fn PyUnicode_FromWideChar(w: *const wchar_t, size: Py_ssize_t) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_AsWideChar")]
+    pub fn PyUnicode_AsWideChar(
+        unicode: *mut PyObject,
+        w: *mut wchar_t,
+        size: Py_ssize_t,
+    ) -> Py_ssize_t;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_AsWideCharString")]
+    pub fn PyUnicode_AsWideCharString(
+        unicode: *mut PyObject,
+        size: *mut Py_ssize_t,
+    ) -> *mut wchar_t;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_FromOrdinal")]
+    pub fn PyUnicode_FromOrdinal(ordinal: c_int) -> *mut PyObject;
+    pub fn PyUnicode_ClearFreeList() -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_GetDefaultEncoding")]
+    pub fn PyUnicode_GetDefaultEncoding() -> *const c_char;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_Decode")]
+    pub fn PyUnicode_Decode(
+        s: *const c_char,
+        size: Py_ssize_t,
+        encoding: *const c_char,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    pub fn PyUnicode_AsDecodedObject(
+        unicode: *mut PyObject,
+        encoding: *const c_char,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    pub fn PyUnicode_AsDecodedUnicode(
+        unicode: *mut PyObject,
+        encoding: *const c_char,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_AsEncodedObject")]
+    pub fn PyUnicode_AsEncodedObject(
+        unicode: *mut PyObject,
+        encoding: *const c_char,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_AsEncodedString")]
+    pub fn PyUnicode_AsEncodedString(
+        unicode: *mut PyObject,
+        encoding: *const c_char,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    pub fn PyUnicode_AsEncodedUnicode(
+        unicode: *mut PyObject,
+        encoding: *const c_char,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    pub fn PyUnicode_BuildEncodingMap(string: *mut PyObject) -> *mut PyObject;
+    pub fn PyUnicode_DecodeUTF7(
+        string: *const c_char,
+        length: Py_ssize_t,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    pub fn PyUnicode_DecodeUTF7Stateful(
+        string: *const c_char,
+        length: Py_ssize_t,
+        errors: *const c_char,
+        consumed: *mut Py_ssize_t,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_DecodeUTF8")]
+    pub fn PyUnicode_DecodeUTF8(
+        string: *const c_char,
+        length: Py_ssize_t,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    pub fn PyUnicode_DecodeUTF8Stateful(
+        string: *const c_char,
+        length: Py_ssize_t,
+        errors: *const c_char,
+        consumed: *mut Py_ssize_t,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_AsUTF8String")]
+    pub fn PyUnicode_AsUTF8String(unicode: *mut PyObject) -> *mut PyObject;
+    #[cfg(any(Py_3_10, not(Py_LIMITED_API)))]
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_AsUTF8AndSize")]
+    pub fn PyUnicode_AsUTF8AndSize(unicode: *mut PyObject, size: *mut Py_ssize_t) -> *const c_char;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_DecodeUTF32")]
+    pub fn PyUnicode_DecodeUTF32(
+        string: *const c_char,
+        length: Py_ssize_t,
+        errors: *const c_char,
+        byteorder: *mut c_int,
+    ) -> *mut PyObject;
+    pub fn PyUnicode_DecodeUTF32Stateful(
+        string: *const c_char,
+        length: Py_ssize_t,
+        errors: *const c_char,
+        byteorder: *mut c_int,
+        consumed: *mut Py_ssize_t,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_AsUTF32String")]
+    pub fn PyUnicode_AsUTF32String(unicode: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_DecodeUTF16")]
+    pub fn PyUnicode_DecodeUTF16(
+        string: *const c_char,
+        length: Py_ssize_t,
+        errors: *const c_char,
+        byteorder: *mut c_int,
+    ) -> *mut PyObject;
+    pub fn PyUnicode_DecodeUTF16Stateful(
+        string: *const c_char,
+        length: Py_ssize_t,
+        errors: *const c_char,
+        byteorder: *mut c_int,
+        consumed: *mut Py_ssize_t,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_AsUTF16String")]
+    pub fn PyUnicode_AsUTF16String(unicode: *mut PyObject) -> *mut PyObject;
+    pub fn PyUnicode_DecodeUnicodeEscape(
+        string: *const c_char,
+        length: Py_ssize_t,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_AsUnicodeEscapeString")]
+    pub fn PyUnicode_AsUnicodeEscapeString(unicode: *mut PyObject) -> *mut PyObject;
+    pub fn PyUnicode_DecodeRawUnicodeEscape(
+        string: *const c_char,
+        length: Py_ssize_t,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    pub fn PyUnicode_AsRawUnicodeEscapeString(unicode: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_DecodeLatin1")]
+    pub fn PyUnicode_DecodeLatin1(
+        string: *const c_char,
+        length: Py_ssize_t,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_AsLatin1String")]
+    pub fn PyUnicode_AsLatin1String(unicode: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_DecodeASCII")]
+    pub fn PyUnicode_DecodeASCII(
+        string: *const c_char,
+        length: Py_ssize_t,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_AsASCIIString")]
+    pub fn PyUnicode_AsASCIIString(unicode: *mut PyObject) -> *mut PyObject;
+    pub fn PyUnicode_DecodeCharmap(
+        string: *const c_char,
+        length: Py_ssize_t,
+        mapping: *mut PyObject,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    pub fn PyUnicode_AsCharmapString(
+        unicode: *mut PyObject,
+        mapping: *mut PyObject,
+    ) -> *mut PyObject;
+    pub fn PyUnicode_DecodeLocaleAndSize(
+        str: *const c_char,
+        len: Py_ssize_t,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    pub fn PyUnicode_DecodeLocale(str: *const c_char, errors: *const c_char) -> *mut PyObject;
+    pub fn PyUnicode_EncodeLocale(unicode: *mut PyObject, errors: *const c_char) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_FSConverter")]
+    pub fn PyUnicode_FSConverter(arg1: *mut PyObject, arg2: *mut c_void) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_FSDecoder")]
+    pub fn PyUnicode_FSDecoder(arg1: *mut PyObject, arg2: *mut c_void) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_DecodeFSDefault")]
+    pub fn PyUnicode_DecodeFSDefault(s: *const c_char) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_DecodeFSDefaultAndSize")]
+    pub fn PyUnicode_DecodeFSDefaultAndSize(s: *const c_char, size: Py_ssize_t) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_EncodeFSDefault")]
+    pub fn PyUnicode_EncodeFSDefault(unicode: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_Concat")]
+    pub fn PyUnicode_Concat(left: *mut PyObject, right: *mut PyObject) -> *mut PyObject;
+    pub fn PyUnicode_Append(pleft: *mut *mut PyObject, right: *mut PyObject);
+    pub fn PyUnicode_AppendAndDel(pleft: *mut *mut PyObject, right: *mut PyObject);
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_Split")]
+    pub fn PyUnicode_Split(
+        s: *mut PyObject,
+        sep: *mut PyObject,
+        maxsplit: Py_ssize_t,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_Splitlines")]
+    pub fn PyUnicode_Splitlines(s: *mut PyObject, keepends: c_int) -> *mut PyObject;
+    pub fn PyUnicode_Partition(s: *mut PyObject, sep: *mut PyObject) -> *mut PyObject;
+    pub fn PyUnicode_RPartition(s: *mut PyObject, sep: *mut PyObject) -> *mut PyObject;
+    pub fn PyUnicode_RSplit(
+        s: *mut PyObject,
+        sep: *mut PyObject,
+        maxsplit: Py_ssize_t,
+    ) -> *mut PyObject;
+    pub fn PyUnicode_Translate(
+        str: *mut PyObject,
+        table: *mut PyObject,
+        errors: *const c_char,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_Join")]
+    pub fn PyUnicode_Join(separator: *mut PyObject, seq: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_Tailmatch")]
+    pub fn PyUnicode_Tailmatch(
+        str: *mut PyObject,
+        substr: *mut PyObject,
+        start: Py_ssize_t,
+        end: Py_ssize_t,
+        direction: c_int,
+    ) -> Py_ssize_t;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_Find")]
+    pub fn PyUnicode_Find(
+        str: *mut PyObject,
+        substr: *mut PyObject,
+        start: Py_ssize_t,
+        end: Py_ssize_t,
+        direction: c_int,
+    ) -> Py_ssize_t;
+    pub fn PyUnicode_FindChar(
+        str: *mut PyObject,
+        ch: Py_UCS4,
+        start: Py_ssize_t,
+        end: Py_ssize_t,
+        direction: c_int,
+    ) -> Py_ssize_t;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_Count")]
+    pub fn PyUnicode_Count(
+        str: *mut PyObject,
+        substr: *mut PyObject,
+        start: Py_ssize_t,
+        end: Py_ssize_t,
+    ) -> Py_ssize_t;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_Replace")]
+    pub fn PyUnicode_Replace(
+        str: *mut PyObject,
+        substr: *mut PyObject,
+        replstr: *mut PyObject,
+        maxcount: Py_ssize_t,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_Compare")]
+    pub fn PyUnicode_Compare(left: *mut PyObject, right: *mut PyObject) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_CompareWithASCIIString")]
+    pub fn PyUnicode_CompareWithASCIIString(left: *mut PyObject, right: *const c_char) -> c_int;
+    #[cfg(Py_3_13)]
+    pub fn PyUnicode_EqualToUTF8(unicode: *mut PyObject, string: *const c_char) -> c_int;
+    #[cfg(Py_3_13)]
+    pub fn PyUnicode_EqualToUTF8AndSize(
+        unicode: *mut PyObject,
+        string: *const c_char,
+        size: Py_ssize_t,
+    ) -> c_int;
+
+    pub fn PyUnicode_RichCompare(
+        left: *mut PyObject,
+        right: *mut PyObject,
+        op: c_int,
+    ) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyUnicode_Format")]
+    pub fn PyUnicode_Format(format: *mut PyObject, args: *mut PyObject) -> *mut PyObject;
+    pub fn PyUnicode_Contains(container: *mut PyObject, element: *mut PyObject) -> c_int;
+    pub fn PyUnicode_IsIdentifier(s: *mut PyObject) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/warnings.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/warnings.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/warnings.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/warnings.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,34 @@
+use crate::object::PyObject;
+use crate::pyport::Py_ssize_t;
+use std::os::raw::{c_char, c_int};
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyErr_WarnEx")]
+    pub fn PyErr_WarnEx(
+        category: *mut PyObject,
+        message: *const c_char,
+        stack_level: Py_ssize_t,
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyErr_WarnFormat")]
+    pub fn PyErr_WarnFormat(
+        category: *mut PyObject,
+        stack_level: Py_ssize_t,
+        format: *const c_char,
+        ...
+    ) -> c_int;
+    pub fn PyErr_ResourceWarning(
+        source: *mut PyObject,
+        stack_level: Py_ssize_t,
+        format: *const c_char,
+        ...
+    ) -> c_int;
+    #[cfg_attr(PyPy, link_name = "PyPyErr_WarnExplicit")]
+    pub fn PyErr_WarnExplicit(
+        category: *mut PyObject,
+        message: *const c_char,
+        filename: *const c_char,
+        lineno: c_int,
+        module: *const c_char,
+        registry: *mut PyObject,
+    ) -> c_int;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-ffi/src/weakrefobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/weakrefobject.rs
--- 43.0.0-1/rust-vendor/pyo3-ffi/src/weakrefobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-ffi/src/weakrefobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,62 @@
+use crate::object::*;
+use std::os::raw::c_int;
+#[cfg(not(PyPy))]
+use std::ptr::addr_of_mut;
+
+#[cfg(all(not(PyPy), Py_LIMITED_API, not(GraalPy)))]
+opaque_struct!(PyWeakReference);
+
+#[cfg(all(not(PyPy), not(Py_LIMITED_API), not(GraalPy)))]
+pub use crate::_PyWeakReference as PyWeakReference;
+
+#[cfg_attr(windows, link(name = "pythonXY"))]
+extern "C" {
+    pub static mut _PyWeakref_RefType: PyTypeObject;
+    pub static mut _PyWeakref_ProxyType: PyTypeObject;
+    pub static mut _PyWeakref_CallableProxyType: PyTypeObject;
+
+    #[cfg(PyPy)]
+    #[link_name = "PyPyWeakref_CheckRef"]
+    pub fn PyWeakref_CheckRef(op: *mut PyObject) -> c_int;
+
+    #[cfg(PyPy)]
+    #[link_name = "PyPyWeakref_CheckRefExact"]
+    pub fn PyWeakref_CheckRefExact(op: *mut PyObject) -> c_int;
+
+    #[cfg(PyPy)]
+    #[link_name = "PyPyWeakref_CheckProxy"]
+    pub fn PyWeakref_CheckProxy(op: *mut PyObject) -> c_int;
+}
+
+#[inline]
+#[cfg(not(PyPy))]
+pub unsafe fn PyWeakref_CheckRef(op: *mut PyObject) -> c_int {
+    PyObject_TypeCheck(op, addr_of_mut!(_PyWeakref_RefType))
+}
+
+#[inline]
+#[cfg(not(PyPy))]
+pub unsafe fn PyWeakref_CheckRefExact(op: *mut PyObject) -> c_int {
+    (Py_TYPE(op) == addr_of_mut!(_PyWeakref_RefType)) as c_int
+}
+
+#[inline]
+#[cfg(not(PyPy))]
+pub unsafe fn PyWeakref_CheckProxy(op: *mut PyObject) -> c_int {
+    ((Py_TYPE(op) == addr_of_mut!(_PyWeakref_ProxyType))
+        || (Py_TYPE(op) == addr_of_mut!(_PyWeakref_CallableProxyType))) as c_int
+}
+
+#[inline]
+pub unsafe fn PyWeakref_Check(op: *mut PyObject) -> c_int {
+    (PyWeakref_CheckRef(op) != 0 || PyWeakref_CheckProxy(op) != 0) as c_int
+}
+
+extern "C" {
+    #[cfg_attr(PyPy, link_name = "PyPyWeakref_NewRef")]
+    pub fn PyWeakref_NewRef(ob: *mut PyObject, callback: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyWeakref_NewProxy")]
+    pub fn PyWeakref_NewProxy(ob: *mut PyObject, callback: *mut PyObject) -> *mut PyObject;
+    #[cfg_attr(PyPy, link_name = "PyPyWeakref_GetObject")]
+    pub fn PyWeakref_GetObject(_ref: *mut PyObject) -> *mut PyObject;
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/pyo3-macros/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/pyo3-macros/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"Cargo.toml":"fc95f51f86567d3d6c3e73c0a3c54b68e787326102d0ac900c5226047ba95a37","LICENSE-APACHE":"71073d492e996de196dbe1eb1e4c94c27c014c841b288161265b2efd06d0af28","LICENSE-MIT":"afcbe3b2e6b37172b5a9ca869ee4c0b8cdc09316e5d4384864154482c33e5af6","src/lib.rs":"eba6061eafaf5066c78a9c296f43ada5c6c5aeb9ca5f86c2b094279cd280ad2e"},"package":"eb57983022ad41f9e683a599f2fd13c3664d7063a3ac5714cae4b7bee7d3f206"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/pyo3-macros/Cargo.toml
--- 43.0.0-1/rust-vendor/pyo3-macros/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,84 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2021"
+name = "pyo3-macros"
+version = "0.22.2"
+authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]
+description = "Proc macros for PyO3 package"
+homepage = "https://github.com/pyo3/pyo3"
+keywords = [
+    "pyo3",
+    "python",
+    "cpython",
+    "ffi",
+]
+categories = [
+    "api-bindings",
+    "development-tools::ffi",
+]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/pyo3/pyo3"
+
+[lib]
+proc-macro = true
+
+[dependencies.proc-macro2]
+version = "1.0.60"
+default-features = false
+
+[dependencies.pyo3-macros-backend]
+version = "=0.22.2"
+
+[dependencies.quote]
+version = "1"
+
+[dependencies.syn]
+version = "2"
+features = [
+    "full",
+    "extra-traits",
+]
+
+[features]
+experimental-async = ["pyo3-macros-backend/experimental-async"]
+gil-refs = ["pyo3-macros-backend/gil-refs"]
+multiple-pymethods = []
+
+[lints.clippy]
+checked_conversions = "warn"
+dbg_macro = "warn"
+explicit_into_iter_loop = "warn"
+explicit_iter_loop = "warn"
+filter_map_next = "warn"
+flat_map_option = "warn"
+let_unit_value = "warn"
+manual_assert = "warn"
+manual_ok_or = "warn"
+todo = "warn"
+unnecessary_wraps = "warn"
+used_underscore_binding = "warn"
+useless_transmute = "warn"
+
+[lints.rust]
+elided_lifetimes_in_paths = "warn"
+invalid_doc_attributes = "warn"
+rust_2021_prelude_collisions = "warn"
+unused_lifetimes = "warn"
+
+[lints.rust.rust_2018_idioms]
+level = "warn"
+priority = -1
+
+[lints.rustdoc]
+bare_urls = "warn"
+broken_intra_doc_links = "warn"
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/pyo3-macros/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/pyo3-macros/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,189 @@
+   Copyright (c) 2017-present PyO3 Project and Contributors.  https://github.com/PyO3
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/pyo3-macros/LICENSE-MIT
--- 43.0.0-1/rust-vendor/pyo3-macros/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,25 @@
+Copyright (c) 2023-present PyO3 Project and Contributors.  https://github.com/PyO3
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-macros/src/lib.rs
--- 43.0.0-1/rust-vendor/pyo3-macros/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,232 @@
+//! This crate declares only the proc macro attributes, as a crate defining proc macro attributes
+//! must not contain any other public items.
+
+#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
+use proc_macro::TokenStream;
+use proc_macro2::TokenStream as TokenStream2;
+use pyo3_macros_backend::{
+    build_derive_from_pyobject, build_py_class, build_py_enum, build_py_function, build_py_methods,
+    pymodule_function_impl, pymodule_module_impl, PyClassArgs, PyClassMethodsType,
+    PyFunctionOptions, PyModuleOptions,
+};
+use quote::quote;
+use syn::{parse_macro_input, Item};
+
+/// A proc macro used to implement Python modules.
+///
+/// The name of the module will be taken from the function name, unless `#[pyo3(name = "my_name")]`
+/// is also annotated on the function to override the name. **Important**: the module name should
+/// match the `lib.name` setting in `Cargo.toml`, so that Python is able to import the module
+/// without needing a custom import loader.
+///
+/// Functions annotated with `#[pymodule]` can also be annotated with the following:
+///
+/// |  Annotation  |  Description |
+/// | :-  | :- |
+/// | `#[pyo3(name = "...")]` | Defines the name of the module in Python. |
+/// | `#[pyo3(submodule)]`    | Skips adding a `PyInit_` FFI symbol to the compiled binary. |
+/// | `#[pyo3(module = "...")]` | Defines the Python `dotted.path` to the parent module for use in introspection. |
+/// | `#[pyo3(crate = "pyo3")]` | Defines the path to PyO3 to use code generated by the macro. |
+///
+/// For more on creating Python modules see the [module section of the guide][1].
+///
+/// Due to technical limitations on how `#[pymodule]` is implemented, a function marked
+/// `#[pymodule]` cannot have a module with the same name in the same scope. (The
+/// `#[pymodule]` implementation generates a hidden module with the same name containing
+/// metadata about the module, which is used by `wrap_pymodule!`).
+///
+#[doc = concat!("[1]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/module.html")]
+#[proc_macro_attribute]
+pub fn pymodule(args: TokenStream, input: TokenStream) -> TokenStream {
+    let options = parse_macro_input!(args as PyModuleOptions);
+
+    let mut ast = parse_macro_input!(input as Item);
+    let expanded = match &mut ast {
+        Item::Mod(module) => {
+            match pymodule_module_impl(module, options) {
+                // #[pymodule] on a module will rebuild the original ast, so we don't emit it here
+                Ok(expanded) => return expanded.into(),
+                Err(e) => Err(e),
+            }
+        }
+        Item::Fn(function) => pymodule_function_impl(function, options),
+        unsupported => Err(syn::Error::new_spanned(
+            unsupported,
+            "#[pymodule] only supports modules and functions.",
+        )),
+    }
+    .unwrap_or_compile_error();
+
+    quote!(
+        #ast
+        #expanded
+    )
+    .into()
+}
+
+#[proc_macro_attribute]
+pub fn pyclass(attr: TokenStream, input: TokenStream) -> TokenStream {
+    let item = parse_macro_input!(input as Item);
+    match item {
+        Item::Struct(struct_) => pyclass_impl(attr, struct_, methods_type()),
+        Item::Enum(enum_) => pyclass_enum_impl(attr, enum_, methods_type()),
+        unsupported => {
+            syn::Error::new_spanned(unsupported, "#[pyclass] only supports structs and enums.")
+                .into_compile_error()
+                .into()
+        }
+    }
+}
+
+/// A proc macro used to expose methods to Python.
+///
+/// Methods within a `#[pymethods]` block can be annotated with  as well as the following:
+///
+/// |  Annotation  |  Description |
+/// | :-  | :- |
+/// | [`#[new]`][4]  | Defines the class constructor, like Python's `__new__` method. |
+/// | [`#[getter]`][5] and [`#[setter]`][5] | These define getters and setters, similar to Python's `@property` decorator. This is useful for getters/setters that require computation or side effects; if that is not the case consider using [`#[pyo3(get, set)]`][11] on the struct's field(s).|
+/// | [`#[staticmethod]`][6]| Defines the method as a staticmethod, like Python's `@staticmethod` decorator.|
+/// | [`#[classmethod]`][7]  | Defines the method as a classmethod, like Python's `@classmethod` decorator.|
+/// | [`#[classattr]`][9]  | Defines a class variable. |
+/// | [`#[args]`][10]  | Deprecated way to define a method's default arguments and allows the function to receive `*args` and `**kwargs`. Use `#[pyo3(signature = (...))]` instead. |
+/// | <nobr>[`#[pyo3(<option> = <value>)`][pyo3-method-options]</nobr> | Any of the `#[pyo3]` options supported on [`macro@pyfunction`]. |
+///
+/// For more on creating class methods,
+/// see the [class section of the guide][1].
+///
+/// If the [`multiple-pymethods`][2] feature is enabled, it is possible to implement
+/// multiple `#[pymethods]` blocks for a single `#[pyclass]`.
+/// This will add a transitive dependency on the [`inventory`][3] crate.
+///
+#[doc = concat!("[1]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/class.html#instance-methods")]
+#[doc = concat!("[2]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/features.html#multiple-pymethods")]
+/// [3]: https://docs.rs/inventory/
+#[doc = concat!("[4]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/class.html#constructor")]
+#[doc = concat!("[5]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/class.html#object-properties-using-getter-and-setter")]
+#[doc = concat!("[6]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/class.html#static-methods")]
+#[doc = concat!("[7]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/class.html#class-methods")]
+#[doc = concat!("[8]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/class.html#callable-objects")]
+#[doc = concat!("[9]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/class.html#class-attributes")]
+#[doc = concat!("[10]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/class.html#method-arguments")]
+#[doc = concat!("[11]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/class.html#object-properties-using-pyo3get-set")]
+#[proc_macro_attribute]
+pub fn pymethods(attr: TokenStream, input: TokenStream) -> TokenStream {
+    let methods_type = if cfg!(feature = "multiple-pymethods") {
+        PyClassMethodsType::Inventory
+    } else {
+        PyClassMethodsType::Specialization
+    };
+    pymethods_impl(attr, input, methods_type)
+}
+
+/// A proc macro used to expose Rust functions to Python.
+///
+/// Functions annotated with `#[pyfunction]` can also be annotated with the following `#[pyo3]`
+/// options:
+///
+/// |  Annotation  |  Description |
+/// | :-  | :- |
+/// | `#[pyo3(name = "...")]` | Defines the name of the function in Python. |
+/// | `#[pyo3(text_signature = "...")]` | Defines the `__text_signature__` attribute of the function in Python. |
+/// | `#[pyo3(pass_module)]` | Passes the module containing the function as a `&PyModule` first argument to the function. |
+///
+/// For more on exposing functions see the [function section of the guide][1].
+///
+/// Due to technical limitations on how `#[pyfunction]` is implemented, a function marked
+/// `#[pyfunction]` cannot have a module with the same name in the same scope. (The
+/// `#[pyfunction]` implementation generates a hidden module with the same name containing
+/// metadata about the function, which is used by `wrap_pyfunction!`).
+///
+#[doc = concat!("[1]: https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/function.html")]
+#[proc_macro_attribute]
+pub fn pyfunction(attr: TokenStream, input: TokenStream) -> TokenStream {
+    let mut ast = parse_macro_input!(input as syn::ItemFn);
+    let options = parse_macro_input!(attr as PyFunctionOptions);
+
+    let expanded = build_py_function(&mut ast, options).unwrap_or_compile_error();
+
+    quote!(
+        #ast
+        #expanded
+    )
+    .into()
+}
+
+#[proc_macro_derive(FromPyObject, attributes(pyo3))]
+pub fn derive_from_py_object(item: TokenStream) -> TokenStream {
+    let ast = parse_macro_input!(item as syn::DeriveInput);
+    let expanded = build_derive_from_pyobject(&ast).unwrap_or_compile_error();
+    quote!(
+        #expanded
+    )
+    .into()
+}
+
+fn pyclass_impl(
+    attrs: TokenStream,
+    mut ast: syn::ItemStruct,
+    methods_type: PyClassMethodsType,
+) -> TokenStream {
+    let args = parse_macro_input!(attrs with PyClassArgs::parse_stuct_args);
+    let expanded = build_py_class(&mut ast, args, methods_type).unwrap_or_compile_error();
+
+    quote!(
+        #ast
+        #expanded
+    )
+    .into()
+}
+
+fn pyclass_enum_impl(
+    attrs: TokenStream,
+    mut ast: syn::ItemEnum,
+    methods_type: PyClassMethodsType,
+) -> TokenStream {
+    let args = parse_macro_input!(attrs with PyClassArgs::parse_enum_args);
+    let expanded = build_py_enum(&mut ast, args, methods_type).unwrap_or_compile_error();
+
+    quote!(
+        #ast
+        #expanded
+    )
+    .into()
+}
+
+fn pymethods_impl(
+    attr: TokenStream,
+    input: TokenStream,
+    methods_type: PyClassMethodsType,
+) -> TokenStream {
+    let mut ast = parse_macro_input!(input as syn::ItemImpl);
+    // Apply all options as a #[pyo3] attribute on the ItemImpl
+    // e.g. #[pymethods(crate = "crate")] impl Foo { }
+    // -> #[pyo3(crate = "crate")] impl Foo { }
+    let attr: TokenStream2 = attr.into();
+    ast.attrs.push(syn::parse_quote!( #[pyo3(#attr)] ));
+    let expanded = build_py_methods(&mut ast, methods_type).unwrap_or_compile_error();
+
+    quote!(
+        #ast
+        #expanded
+    )
+    .into()
+}
+
+fn methods_type() -> PyClassMethodsType {
+    if cfg!(feature = "multiple-pymethods") {
+        PyClassMethodsType::Inventory
+    } else {
+        PyClassMethodsType::Specialization
+    }
+}
+
+trait UnwrapOrCompileError {
+    fn unwrap_or_compile_error(self) -> TokenStream2;
+}
+
+impl UnwrapOrCompileError for syn::Result<TokenStream2> {
+    fn unwrap_or_compile_error(self) -> TokenStream2 {
+        self.unwrap_or_else(|e| e.into_compile_error())
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"Cargo.toml":"873568039fc9cd51963b5c2419e3d2c743ac5ecd7b2ec187ed6cd912db3b703d","LICENSE-APACHE":"71073d492e996de196dbe1eb1e4c94c27c014c841b288161265b2efd06d0af28","LICENSE-MIT":"afcbe3b2e6b37172b5a9ca869ee4c0b8cdc09316e5d4384864154482c33e5af6","build.rs":"297616b244181f0f18db54be8cd5762d7fba19298b6221f4cff668a34abd24f2","src/attributes.rs":"12d877f3da48b383dd8d52e2f5b943f77320d92812f785b00342ca89d948af5f","src/deprecations.rs":"6700ea169543ccd769cec9f98cf07d795ac4d5b25469b777cf712dccb18c213b","src/frompyobject.rs":"6a08ecfbf07a03c2b34d3fb7f8c3219f64118998ed04d1e14953bf207e3bf41b","src/konst.rs":"c5dc8d654d31b11b6169ba7705781adb57f01d2489377da8d62882a62c5993ae","src/lib.rs":"68807b8832364c83d88a5a7907f9685068597ce6fc5f14fd91acc055c1be6deb","src/method.rs":"f390ee532a7baeca5b826def184860d00c18f7ef8783d0357b58276aa16a11ed","src/module.rs":"0b00aed691e4a64456dc984d03d5ec8a1b9aaffcd707d182653867750b1b94bb","src/params.rs":"348d18f6be7279a5a13169ff6c887b2e5e015648db6ad53913bbd0111275c9fa","src/pyclass.rs":"6276f4d8f4939892f5355e9b1b6ce765c28b1c236274a89a973c06c60ce1a70a","src/pyfunction.rs":"ba6e89d6c7a166c269f8b9281dadd56075e4924548c2b53423520c24c7154de1","src/pyfunction/signature.rs":"4520beb85bbc52516af498da2c8196a827cb6686a0be977295e65ba55bef8ce7","src/pyimpl.rs":"a37baa4ffd279e35be82ecfb90d96a0c0e6b1b7b9666b18ea4e747cabeeab89c","src/pymethod.rs":"e378f2bcd29c7a640bdbb0911145c647f1cdc88806de0cb2d3d8d1ad0cef478f","src/pyversions.rs":"6a5f4ef1d79ecba950cbd9b29e68e6566aeac3e85ab225e9dbdd0204969f073d","src/quotes.rs":"94680b308ba592529ec46c0348949836c72c3f7d706deb1f7dae3d8d943c017b","src/utils.rs":"895f97bb6f4c3c9add47f1e57d8a32c6e440fafd15fbf7a6e17b36de08811901"},"package":"ec480c0c51ddec81019531705acac51bcdbeae563557c982aa8263bb96880372"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/Cargo.toml
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,93 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2021"
+name = "pyo3-macros-backend"
+version = "0.22.2"
+authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]
+description = "Code generation for PyO3 package"
+homepage = "https://github.com/pyo3/pyo3"
+keywords = [
+    "pyo3",
+    "python",
+    "cpython",
+    "ffi",
+]
+categories = [
+    "api-bindings",
+    "development-tools::ffi",
+]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/pyo3/pyo3"
+
+[dependencies.heck]
+version = "0.5"
+
+[dependencies.proc-macro2]
+version = "1.0.60"
+default-features = false
+
+[dependencies.pyo3-build-config]
+version = "=0.22.2"
+features = ["resolve-config"]
+
+[dependencies.quote]
+version = "1"
+default-features = false
+
+[dependencies.syn]
+version = "2.0.59"
+features = [
+    "derive",
+    "parsing",
+    "printing",
+    "clone-impls",
+    "full",
+    "extra-traits",
+]
+default-features = false
+
+[build-dependencies.pyo3-build-config]
+version = "=0.22.2"
+
+[features]
+experimental-async = []
+gil-refs = []
+
+[lints.clippy]
+checked_conversions = "warn"
+dbg_macro = "warn"
+explicit_into_iter_loop = "warn"
+explicit_iter_loop = "warn"
+filter_map_next = "warn"
+flat_map_option = "warn"
+let_unit_value = "warn"
+manual_assert = "warn"
+manual_ok_or = "warn"
+todo = "warn"
+unnecessary_wraps = "warn"
+used_underscore_binding = "warn"
+useless_transmute = "warn"
+
+[lints.rust]
+elided_lifetimes_in_paths = "warn"
+invalid_doc_attributes = "warn"
+rust_2021_prelude_collisions = "warn"
+unused_lifetimes = "warn"
+
+[lints.rust.rust_2018_idioms]
+level = "warn"
+priority = -1
+
+[lints.rustdoc]
+bare_urls = "warn"
+broken_intra_doc_links = "warn"
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,189 @@
+   Copyright (c) 2017-present PyO3 Project and Contributors.  https://github.com/PyO3
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/LICENSE-MIT
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,25 @@
+Copyright (c) 2023-present PyO3 Project and Contributors.  https://github.com/PyO3
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/build.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/build.rs
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/build.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/build.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4 @@
+fn main() {
+    pyo3_build_config::print_expected_cfgs();
+    pyo3_build_config::print_feature_cfgs();
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/src/attributes.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/attributes.rs
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/src/attributes.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/attributes.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,247 @@
+use proc_macro2::TokenStream;
+use quote::ToTokens;
+use syn::{
+    ext::IdentExt,
+    parse::{Parse, ParseStream},
+    punctuated::Punctuated,
+    spanned::Spanned,
+    token::Comma,
+    Attribute, Expr, ExprPath, Ident, LitStr, Path, Result, Token,
+};
+
+pub mod kw {
+    syn::custom_keyword!(annotation);
+    syn::custom_keyword!(attribute);
+    syn::custom_keyword!(cancel_handle);
+    syn::custom_keyword!(constructor);
+    syn::custom_keyword!(dict);
+    syn::custom_keyword!(eq);
+    syn::custom_keyword!(eq_int);
+    syn::custom_keyword!(extends);
+    syn::custom_keyword!(freelist);
+    syn::custom_keyword!(from_py_with);
+    syn::custom_keyword!(frozen);
+    syn::custom_keyword!(get);
+    syn::custom_keyword!(get_all);
+    syn::custom_keyword!(hash);
+    syn::custom_keyword!(item);
+    syn::custom_keyword!(from_item_all);
+    syn::custom_keyword!(mapping);
+    syn::custom_keyword!(module);
+    syn::custom_keyword!(name);
+    syn::custom_keyword!(ord);
+    syn::custom_keyword!(pass_module);
+    syn::custom_keyword!(rename_all);
+    syn::custom_keyword!(sequence);
+    syn::custom_keyword!(set);
+    syn::custom_keyword!(set_all);
+    syn::custom_keyword!(signature);
+    syn::custom_keyword!(subclass);
+    syn::custom_keyword!(submodule);
+    syn::custom_keyword!(text_signature);
+    syn::custom_keyword!(transparent);
+    syn::custom_keyword!(unsendable);
+    syn::custom_keyword!(weakref);
+}
+
+#[derive(Clone, Debug)]
+pub struct KeywordAttribute<K, V> {
+    pub kw: K,
+    pub value: V,
+}
+
+/// A helper type which parses the inner type via a literal string
+/// e.g. `LitStrValue<Path>` -> parses "some::path" in quotes.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct LitStrValue<T>(pub T);
+
+impl<T: Parse> Parse for LitStrValue<T> {
+    fn parse(input: ParseStream<'_>) -> Result<Self> {
+        let lit_str: LitStr = input.parse()?;
+        lit_str.parse().map(LitStrValue)
+    }
+}
+
+impl<T: ToTokens> ToTokens for LitStrValue<T> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        self.0.to_tokens(tokens)
+    }
+}
+
+/// A helper type which parses a name via a literal string
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct NameLitStr(pub Ident);
+
+impl Parse for NameLitStr {
+    fn parse(input: ParseStream<'_>) -> Result<Self> {
+        let string_literal: LitStr = input.parse()?;
+        if let Ok(ident) = string_literal.parse_with(Ident::parse_any) {
+            Ok(NameLitStr(ident))
+        } else {
+            bail_spanned!(string_literal.span() => "expected a single identifier in double quotes")
+        }
+    }
+}
+
+impl ToTokens for NameLitStr {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        self.0.to_tokens(tokens)
+    }
+}
+
+/// Available renaming rules
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+pub enum RenamingRule {
+    CamelCase,
+    KebabCase,
+    Lowercase,
+    PascalCase,
+    ScreamingKebabCase,
+    ScreamingSnakeCase,
+    SnakeCase,
+    Uppercase,
+}
+
+/// A helper type which parses a renaming rule via a literal string
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct RenamingRuleLitStr {
+    pub lit: LitStr,
+    pub rule: RenamingRule,
+}
+
+impl Parse for RenamingRuleLitStr {
+    fn parse(input: ParseStream<'_>) -> Result<Self> {
+        let string_literal: LitStr = input.parse()?;
+        let rule = match string_literal.value().as_ref() {
+            "camelCase" => RenamingRule::CamelCase,
+            "kebab-case" => RenamingRule::KebabCase,
+            "lowercase" => RenamingRule::Lowercase,
+            "PascalCase" => RenamingRule::PascalCase,
+            "SCREAMING-KEBAB-CASE" => RenamingRule::ScreamingKebabCase,
+            "SCREAMING_SNAKE_CASE" => RenamingRule::ScreamingSnakeCase,
+            "snake_case" => RenamingRule::SnakeCase,
+            "UPPERCASE" => RenamingRule::Uppercase,
+            _ => {
+                bail_spanned!(string_literal.span() => "expected a valid renaming rule, possible values are: \"camelCase\", \"kebab-case\", \"lowercase\", \"PascalCase\", \"SCREAMING-KEBAB-CASE\", \"SCREAMING_SNAKE_CASE\", \"snake_case\", \"UPPERCASE\"")
+            }
+        };
+        Ok(Self {
+            lit: string_literal,
+            rule,
+        })
+    }
+}
+
+impl ToTokens for RenamingRuleLitStr {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        self.lit.to_tokens(tokens)
+    }
+}
+
+/// Text signatue can be either a literal string or opt-in/out
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub enum TextSignatureAttributeValue {
+    Str(LitStr),
+    // `None` ident to disable automatic text signature generation
+    Disabled(Ident),
+}
+
+impl Parse for TextSignatureAttributeValue {
+    fn parse(input: ParseStream<'_>) -> Result<Self> {
+        if let Ok(lit_str) = input.parse::<LitStr>() {
+            return Ok(TextSignatureAttributeValue::Str(lit_str));
+        }
+
+        let err_span = match input.parse::<Ident>() {
+            Ok(ident) if ident == "None" => {
+                return Ok(TextSignatureAttributeValue::Disabled(ident));
+            }
+            Ok(other_ident) => other_ident.span(),
+            Err(e) => e.span(),
+        };
+
+        Err(err_spanned!(err_span => "expected a string literal or `None`"))
+    }
+}
+
+impl ToTokens for TextSignatureAttributeValue {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        match self {
+            TextSignatureAttributeValue::Str(s) => s.to_tokens(tokens),
+            TextSignatureAttributeValue::Disabled(b) => b.to_tokens(tokens),
+        }
+    }
+}
+
+pub type ExtendsAttribute = KeywordAttribute<kw::extends, Path>;
+pub type FreelistAttribute = KeywordAttribute<kw::freelist, Box<Expr>>;
+pub type ModuleAttribute = KeywordAttribute<kw::module, LitStr>;
+pub type NameAttribute = KeywordAttribute<kw::name, NameLitStr>;
+pub type RenameAllAttribute = KeywordAttribute<kw::rename_all, RenamingRuleLitStr>;
+pub type TextSignatureAttribute = KeywordAttribute<kw::text_signature, TextSignatureAttributeValue>;
+pub type SubmoduleAttribute = kw::submodule;
+
+impl<K: Parse + std::fmt::Debug, V: Parse> Parse for KeywordAttribute<K, V> {
+    fn parse(input: ParseStream<'_>) -> Result<Self> {
+        let kw: K = input.parse()?;
+        let _: Token![=] = input.parse()?;
+        let value = input.parse()?;
+        Ok(KeywordAttribute { kw, value })
+    }
+}
+
+impl<K: ToTokens, V: ToTokens> ToTokens for KeywordAttribute<K, V> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        self.kw.to_tokens(tokens);
+        Token![=](self.kw.span()).to_tokens(tokens);
+        self.value.to_tokens(tokens);
+    }
+}
+
+pub type FromPyWithAttribute = KeywordAttribute<kw::from_py_with, LitStrValue<ExprPath>>;
+
+/// For specifying the path to the pyo3 crate.
+pub type CrateAttribute = KeywordAttribute<Token![crate], LitStrValue<Path>>;
+
+pub fn get_pyo3_options<T: Parse>(attr: &syn::Attribute) -> Result<Option<Punctuated<T, Comma>>> {
+    if attr.path().is_ident("pyo3") {
+        attr.parse_args_with(Punctuated::parse_terminated).map(Some)
+    } else {
+        Ok(None)
+    }
+}
+
+/// Takes attributes from an attribute vector.
+///
+/// For each attribute in `attrs`, `extractor` is called. If `extractor` returns `Ok(true)`, then
+/// the attribute will be removed from the vector.
+///
+/// This is similar to `Vec::retain` except the closure is fallible and the condition is reversed.
+/// (In `retain`, returning `true` keeps the element, here it removes it.)
+pub fn take_attributes(
+    attrs: &mut Vec<Attribute>,
+    mut extractor: impl FnMut(&Attribute) -> Result<bool>,
+) -> Result<()> {
+    *attrs = attrs
+        .drain(..)
+        .filter_map(|attr| {
+            extractor(&attr)
+                .map(move |attribute_handled| if attribute_handled { None } else { Some(attr) })
+                .transpose()
+        })
+        .collect::<Result<_>>()?;
+    Ok(())
+}
+
+pub fn take_pyo3_options<T: Parse>(attrs: &mut Vec<syn::Attribute>) -> Result<Vec<T>> {
+    let mut out = Vec::new();
+    take_attributes(attrs, |attr| {
+        if let Some(options) = get_pyo3_options(attr)? {
+            out.extend(options);
+            Ok(true)
+        } else {
+            Ok(false)
+        }
+    })?;
+    Ok(out)
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/src/deprecations.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/deprecations.rs
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/src/deprecations.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/deprecations.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,101 @@
+use crate::{
+    method::{FnArg, FnSpec},
+    utils::Ctx,
+};
+use proc_macro2::{Span, TokenStream};
+use quote::{quote_spanned, ToTokens};
+
+pub enum Deprecation {
+    PyMethodsNewDeprecatedForm,
+}
+
+impl Deprecation {
+    fn ident(&self, span: Span) -> syn::Ident {
+        let string = match self {
+            Deprecation::PyMethodsNewDeprecatedForm => "PYMETHODS_NEW_DEPRECATED_FORM",
+        };
+        syn::Ident::new(string, span)
+    }
+}
+
+pub struct Deprecations<'ctx>(Vec<(Deprecation, Span)>, &'ctx Ctx);
+
+impl<'ctx> Deprecations<'ctx> {
+    pub fn new(ctx: &'ctx Ctx) -> Self {
+        Deprecations(Vec::new(), ctx)
+    }
+
+    pub fn push(&mut self, deprecation: Deprecation, span: Span) {
+        self.0.push((deprecation, span))
+    }
+}
+
+impl<'ctx> ToTokens for Deprecations<'ctx> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        let Self(deprecations, Ctx { pyo3_path, .. }) = self;
+
+        for (deprecation, span) in deprecations {
+            let pyo3_path = pyo3_path.to_tokens_spanned(*span);
+            let ident = deprecation.ident(*span);
+            quote_spanned!(
+                *span =>
+                #[allow(clippy::let_unit_value)]
+                {
+                    let _ = #pyo3_path::impl_::deprecations::#ident;
+                }
+            )
+            .to_tokens(tokens)
+        }
+    }
+}
+
+pub(crate) fn deprecate_trailing_option_default(spec: &FnSpec<'_>) -> TokenStream {
+    if spec.signature.attribute.is_none()
+        && spec.tp.signature_attribute_allowed()
+        && spec.signature.arguments.iter().any(|arg| {
+            if let FnArg::Regular(arg) = arg {
+                arg.option_wrapped_type.is_some()
+            } else {
+                false
+            }
+        })
+    {
+        use std::fmt::Write;
+        let mut deprecation_msg = String::from(
+            "this function has implicit defaults for the trailing `Option<T>` arguments \n\
+             = note: these implicit defaults are being phased out \n\
+             = help: add `#[pyo3(signature = (",
+        );
+        spec.signature.arguments.iter().for_each(|arg| {
+            match arg {
+                FnArg::Regular(arg) => {
+                    if arg.option_wrapped_type.is_some() {
+                        write!(deprecation_msg, "{}=None, ", arg.name)
+                    } else {
+                        write!(deprecation_msg, "{}, ", arg.name)
+                    }
+                }
+                FnArg::VarArgs(arg) => write!(deprecation_msg, "{}, ", arg.name),
+                FnArg::KwArgs(arg) => write!(deprecation_msg, "{}, ", arg.name),
+                FnArg::Py(_) | FnArg::CancelHandle(_) => Ok(()),
+            }
+            .expect("writing to `String` should not fail");
+        });
+
+        //remove trailing space and comma
+        deprecation_msg.pop();
+        deprecation_msg.pop();
+
+        deprecation_msg.push_str(
+            "))]` to this function to silence this warning and keep the current behavior",
+        );
+        quote_spanned! { spec.name.span() =>
+            #[deprecated(note = #deprecation_msg)]
+            #[allow(dead_code)]
+            const SIGNATURE: () = ();
+            const _: () = SIGNATURE;
+        }
+    } else {
+        TokenStream::new()
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/src/frompyobject.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/frompyobject.rs
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/src/frompyobject.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/frompyobject.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,709 @@
+use crate::attributes::{self, get_pyo3_options, CrateAttribute, FromPyWithAttribute};
+use crate::utils::Ctx;
+use proc_macro2::TokenStream;
+use quote::{format_ident, quote, quote_spanned};
+use syn::{
+    parenthesized,
+    parse::{Parse, ParseStream},
+    parse_quote,
+    punctuated::Punctuated,
+    spanned::Spanned,
+    Attribute, DataEnum, DeriveInput, Fields, Ident, LitStr, Result, Token,
+};
+
+/// Describes derivation input of an enum.
+struct Enum<'a> {
+    enum_ident: &'a Ident,
+    variants: Vec<Container<'a>>,
+}
+
+impl<'a> Enum<'a> {
+    /// Construct a new enum representation.
+    ///
+    /// `data_enum` is the `syn` representation of the input enum, `ident` is the
+    /// `Identifier` of the enum.
+    fn new(data_enum: &'a DataEnum, ident: &'a Ident) -> Result<Self> {
+        ensure_spanned!(
+            !data_enum.variants.is_empty(),
+            ident.span() => "cannot derive FromPyObject for empty enum"
+        );
+        let variants = data_enum
+            .variants
+            .iter()
+            .map(|variant| {
+                let attrs = ContainerOptions::from_attrs(&variant.attrs)?;
+                let var_ident = &variant.ident;
+                Container::new(&variant.fields, parse_quote!(#ident::#var_ident), attrs)
+            })
+            .collect::<Result<Vec<_>>>()?;
+
+        Ok(Enum {
+            enum_ident: ident,
+            variants,
+        })
+    }
+
+    /// Build derivation body for enums.
+    fn build(&self, ctx: &Ctx) -> (TokenStream, TokenStream) {
+        let Ctx { pyo3_path, .. } = ctx;
+        let mut var_extracts = Vec::new();
+        let mut variant_names = Vec::new();
+        let mut error_names = Vec::new();
+
+        let mut deprecations = TokenStream::new();
+        for var in &self.variants {
+            let (struct_derive, dep) = var.build(ctx);
+            deprecations.extend(dep);
+            let ext = quote!({
+                let maybe_ret = || -> #pyo3_path::PyResult<Self> {
+                    #struct_derive
+                }();
+
+                match maybe_ret {
+                    ok @ ::std::result::Result::Ok(_) => return ok,
+                    ::std::result::Result::Err(err) => err
+                }
+            });
+
+            var_extracts.push(ext);
+            variant_names.push(var.path.segments.last().unwrap().ident.to_string());
+            error_names.push(&var.err_name);
+        }
+        let ty_name = self.enum_ident.to_string();
+        (
+            quote!(
+                let errors = [
+                    #(#var_extracts),*
+                ];
+                ::std::result::Result::Err(
+                    #pyo3_path::impl_::frompyobject::failed_to_extract_enum(
+                        obj.py(),
+                        #ty_name,
+                        &[#(#variant_names),*],
+                        &[#(#error_names),*],
+                        &errors
+                    )
+                )
+            ),
+            deprecations,
+        )
+    }
+}
+
+struct NamedStructField<'a> {
+    ident: &'a syn::Ident,
+    getter: Option<FieldGetter>,
+    from_py_with: Option<FromPyWithAttribute>,
+}
+
+struct TupleStructField {
+    from_py_with: Option<FromPyWithAttribute>,
+}
+
+/// Container Style
+///
+/// Covers Structs, Tuplestructs and corresponding Newtypes.
+enum ContainerType<'a> {
+    /// Struct Container, e.g. `struct Foo { a: String }`
+    ///
+    /// Variant contains the list of field identifiers and the corresponding extraction call.
+    Struct(Vec<NamedStructField<'a>>),
+    /// Newtype struct container, e.g. `#[transparent] struct Foo { a: String }`
+    ///
+    /// The field specified by the identifier is extracted directly from the object.
+    StructNewtype(&'a syn::Ident, Option<FromPyWithAttribute>),
+    /// Tuple struct, e.g. `struct Foo(String)`.
+    ///
+    /// Variant contains a list of conversion methods for each of the fields that are directly
+    ///  extracted from the tuple.
+    Tuple(Vec<TupleStructField>),
+    /// Tuple newtype, e.g. `#[transparent] struct Foo(String)`
+    ///
+    /// The wrapped field is directly extracted from the object.
+    TupleNewtype(Option<FromPyWithAttribute>),
+}
+
+/// Data container
+///
+/// Either describes a struct or an enum variant.
+struct Container<'a> {
+    path: syn::Path,
+    ty: ContainerType<'a>,
+    err_name: String,
+}
+
+impl<'a> Container<'a> {
+    /// Construct a container based on fields, identifier and attributes.
+    ///
+    /// Fails if the variant has no fields or incompatible attributes.
+    fn new(fields: &'a Fields, path: syn::Path, options: ContainerOptions) -> Result<Self> {
+        let style = match fields {
+            Fields::Unnamed(unnamed) if !unnamed.unnamed.is_empty() => {
+                let mut tuple_fields = unnamed
+                    .unnamed
+                    .iter()
+                    .map(|field| {
+                        let attrs = FieldPyO3Attributes::from_attrs(&field.attrs)?;
+                        ensure_spanned!(
+                            attrs.getter.is_none(),
+                            field.span() => "`getter` is not permitted on tuple struct elements."
+                        );
+                        Ok(TupleStructField {
+                            from_py_with: attrs.from_py_with,
+                        })
+                    })
+                    .collect::<Result<Vec<_>>>()?;
+
+                if tuple_fields.len() == 1 {
+                    // Always treat a 1-length tuple struct as "transparent", even without the
+                    // explicit annotation.
+                    let field = tuple_fields.pop().unwrap();
+                    ContainerType::TupleNewtype(field.from_py_with)
+                } else if options.transparent {
+                    bail_spanned!(
+                        fields.span() => "transparent structs and variants can only have 1 field"
+                    );
+                } else {
+                    ContainerType::Tuple(tuple_fields)
+                }
+            }
+            Fields::Named(named) if !named.named.is_empty() => {
+                let mut struct_fields = named
+                    .named
+                    .iter()
+                    .map(|field| {
+                        let ident = field
+                            .ident
+                            .as_ref()
+                            .expect("Named fields should have identifiers");
+                        let mut attrs = FieldPyO3Attributes::from_attrs(&field.attrs)?;
+
+                        if let Some(ref from_item_all) = options.from_item_all {
+                            if let Some(replaced) = attrs.getter.replace(FieldGetter::GetItem(None))
+                            {
+                                match replaced {
+                                    FieldGetter::GetItem(Some(item_name)) => {
+                                        attrs.getter = Some(FieldGetter::GetItem(Some(item_name)));
+                                    }
+                                    FieldGetter::GetItem(None) => bail_spanned!(from_item_all.span() => "Useless `item` - the struct is already annotated with `from_item_all`"),
+                                    FieldGetter::GetAttr(_) => bail_spanned!(
+                                        from_item_all.span() => "The struct is already annotated with `from_item_all`, `attribute` is not allowed"
+                                    ),
+                                }
+                            }
+                        }
+
+                        Ok(NamedStructField {
+                            ident,
+                            getter: attrs.getter,
+                            from_py_with: attrs.from_py_with,
+                        })
+                    })
+                    .collect::<Result<Vec<_>>>()?;
+                if options.transparent {
+                    ensure_spanned!(
+                        struct_fields.len() == 1,
+                        fields.span() => "transparent structs and variants can only have 1 field"
+                    );
+                    let field = struct_fields.pop().unwrap();
+                    ensure_spanned!(
+                        field.getter.is_none(),
+                        field.ident.span() => "`transparent` structs may not have a `getter` for the inner field"
+                    );
+                    ContainerType::StructNewtype(field.ident, field.from_py_with)
+                } else {
+                    ContainerType::Struct(struct_fields)
+                }
+            }
+            _ => bail_spanned!(
+                fields.span() => "cannot derive FromPyObject for empty structs and variants"
+            ),
+        };
+        let err_name = options.annotation.map_or_else(
+            || path.segments.last().unwrap().ident.to_string(),
+            |lit_str| lit_str.value(),
+        );
+
+        let v = Container {
+            path,
+            ty: style,
+            err_name,
+        };
+        Ok(v)
+    }
+
+    fn name(&self) -> String {
+        let mut value = String::new();
+        for segment in &self.path.segments {
+            if !value.is_empty() {
+                value.push_str("::");
+            }
+            value.push_str(&segment.ident.to_string());
+        }
+        value
+    }
+
+    /// Build derivation body for a struct.
+    fn build(&self, ctx: &Ctx) -> (TokenStream, TokenStream) {
+        match &self.ty {
+            ContainerType::StructNewtype(ident, from_py_with) => {
+                self.build_newtype_struct(Some(ident), from_py_with, ctx)
+            }
+            ContainerType::TupleNewtype(from_py_with) => {
+                self.build_newtype_struct(None, from_py_with, ctx)
+            }
+            ContainerType::Tuple(tups) => self.build_tuple_struct(tups, ctx),
+            ContainerType::Struct(tups) => self.build_struct(tups, ctx),
+        }
+    }
+
+    fn build_newtype_struct(
+        &self,
+        field_ident: Option<&Ident>,
+        from_py_with: &Option<FromPyWithAttribute>,
+        ctx: &Ctx,
+    ) -> (TokenStream, TokenStream) {
+        let Ctx { pyo3_path, .. } = ctx;
+        let self_ty = &self.path;
+        let struct_name = self.name();
+        if let Some(ident) = field_ident {
+            let field_name = ident.to_string();
+            match from_py_with {
+                None => (
+                    quote! {
+                        Ok(#self_ty {
+                            #ident: #pyo3_path::impl_::frompyobject::extract_struct_field(obj, #struct_name, #field_name)?
+                        })
+                    },
+                    TokenStream::new(),
+                ),
+                Some(FromPyWithAttribute {
+                    value: expr_path, ..
+                }) => (
+                    quote! {
+                        Ok(#self_ty {
+                            #ident: #pyo3_path::impl_::frompyobject::extract_struct_field_with(#expr_path as fn(_) -> _, obj, #struct_name, #field_name)?
+                        })
+                    },
+                    quote_spanned! { expr_path.span() =>
+                        const _: () = {
+                            fn check_from_py_with() {
+                                let e = #pyo3_path::impl_::deprecations::GilRefs::new();
+                                #pyo3_path::impl_::deprecations::inspect_fn(#expr_path, &e);
+                                e.from_py_with_arg();
+                            }
+                        };
+                    },
+                ),
+            }
+        } else {
+            match from_py_with {
+                None => (
+                    quote!(
+                        #pyo3_path::impl_::frompyobject::extract_tuple_struct_field(obj, #struct_name, 0).map(#self_ty)
+                    ),
+                    TokenStream::new(),
+                ),
+                Some(FromPyWithAttribute {
+                    value: expr_path, ..
+                }) => (
+                    quote! (
+                        #pyo3_path::impl_::frompyobject::extract_tuple_struct_field_with(#expr_path as fn(_) -> _, obj, #struct_name, 0).map(#self_ty)
+                    ),
+                    quote_spanned! { expr_path.span() =>
+                        const _: () = {
+                            fn check_from_py_with() {
+                                let e = #pyo3_path::impl_::deprecations::GilRefs::new();
+                                #pyo3_path::impl_::deprecations::inspect_fn(#expr_path, &e);
+                                e.from_py_with_arg();
+                            }
+                        };
+                    },
+                ),
+            }
+        }
+    }
+
+    fn build_tuple_struct(
+        &self,
+        struct_fields: &[TupleStructField],
+        ctx: &Ctx,
+    ) -> (TokenStream, TokenStream) {
+        let Ctx { pyo3_path, .. } = ctx;
+        let self_ty = &self.path;
+        let struct_name = &self.name();
+        let field_idents: Vec<_> = (0..struct_fields.len())
+            .map(|i| format_ident!("arg{}", i))
+            .collect();
+        let fields = struct_fields.iter().zip(&field_idents).enumerate().map(|(index, (field, ident))| {
+            match &field.from_py_with {
+                None => quote!(
+                    #pyo3_path::impl_::frompyobject::extract_tuple_struct_field(&#ident, #struct_name, #index)?
+                ),
+                Some(FromPyWithAttribute {
+                    value: expr_path, ..
+                }) => quote! (
+                    #pyo3_path::impl_::frompyobject::extract_tuple_struct_field_with(#expr_path as fn(_) -> _, &#ident, #struct_name, #index)?
+                ),
+            }
+        });
+
+        let deprecations = struct_fields
+            .iter()
+            .filter_map(|field| {
+                let FromPyWithAttribute {
+                    value: expr_path, ..
+                } = field.from_py_with.as_ref()?;
+                Some(quote_spanned! { expr_path.span() =>
+                    const _: () = {
+                        fn check_from_py_with() {
+                            let e = #pyo3_path::impl_::deprecations::GilRefs::new();
+                            #pyo3_path::impl_::deprecations::inspect_fn(#expr_path, &e);
+                            e.from_py_with_arg();
+                        }
+                    };
+                })
+            })
+            .collect::<TokenStream>();
+
+        (
+            quote!(
+                match #pyo3_path::types::PyAnyMethods::extract(obj) {
+                    ::std::result::Result::Ok((#(#field_idents),*)) => ::std::result::Result::Ok(#self_ty(#(#fields),*)),
+                    ::std::result::Result::Err(err) => ::std::result::Result::Err(err),
+                }
+            ),
+            deprecations,
+        )
+    }
+
+    fn build_struct(
+        &self,
+        struct_fields: &[NamedStructField<'_>],
+        ctx: &Ctx,
+    ) -> (TokenStream, TokenStream) {
+        let Ctx { pyo3_path, .. } = ctx;
+        let self_ty = &self.path;
+        let struct_name = &self.name();
+        let mut fields: Punctuated<TokenStream, syn::Token![,]> = Punctuated::new();
+        for field in struct_fields {
+            let ident = &field.ident;
+            let field_name = ident.to_string();
+            let getter = match field.getter.as_ref().unwrap_or(&FieldGetter::GetAttr(None)) {
+                FieldGetter::GetAttr(Some(name)) => {
+                    quote!(#pyo3_path::types::PyAnyMethods::getattr(obj, #pyo3_path::intern!(obj.py(), #name)))
+                }
+                FieldGetter::GetAttr(None) => {
+                    quote!(#pyo3_path::types::PyAnyMethods::getattr(obj, #pyo3_path::intern!(obj.py(), #field_name)))
+                }
+                FieldGetter::GetItem(Some(syn::Lit::Str(key))) => {
+                    quote!(#pyo3_path::types::PyAnyMethods::get_item(obj, #pyo3_path::intern!(obj.py(), #key)))
+                }
+                FieldGetter::GetItem(Some(key)) => {
+                    quote!(#pyo3_path::types::PyAnyMethods::get_item(obj, #key))
+                }
+                FieldGetter::GetItem(None) => {
+                    quote!(#pyo3_path::types::PyAnyMethods::get_item(obj, #pyo3_path::intern!(obj.py(), #field_name)))
+                }
+            };
+            let extractor = match &field.from_py_with {
+                None => {
+                    quote!(#pyo3_path::impl_::frompyobject::extract_struct_field(&#getter?, #struct_name, #field_name)?)
+                }
+                Some(FromPyWithAttribute {
+                    value: expr_path, ..
+                }) => {
+                    quote! (#pyo3_path::impl_::frompyobject::extract_struct_field_with(#expr_path as fn(_) -> _, &#getter?, #struct_name, #field_name)?)
+                }
+            };
+
+            fields.push(quote!(#ident: #extractor));
+        }
+
+        let deprecations = struct_fields
+            .iter()
+            .filter_map(|field| {
+                let FromPyWithAttribute {
+                    value: expr_path, ..
+                } = field.from_py_with.as_ref()?;
+                Some(quote_spanned! { expr_path.span() =>
+                    const _: () = {
+                        fn check_from_py_with() {
+                            let e = #pyo3_path::impl_::deprecations::GilRefs::new();
+                            #pyo3_path::impl_::deprecations::inspect_fn(#expr_path, &e);
+                            e.from_py_with_arg();
+                        }
+                    };
+                })
+            })
+            .collect::<TokenStream>();
+
+        (
+            quote!(::std::result::Result::Ok(#self_ty{#fields})),
+            deprecations,
+        )
+    }
+}
+
+#[derive(Default)]
+struct ContainerOptions {
+    /// Treat the Container as a Wrapper, directly extract its fields from the input object.
+    transparent: bool,
+    /// Force every field to be extracted from item of source Python object.
+    from_item_all: Option<attributes::kw::from_item_all>,
+    /// Change the name of an enum variant in the generated error message.
+    annotation: Option<syn::LitStr>,
+    /// Change the path for the pyo3 crate
+    krate: Option<CrateAttribute>,
+}
+
+/// Attributes for deriving FromPyObject scoped on containers.
+enum ContainerPyO3Attribute {
+    /// Treat the Container as a Wrapper, directly extract its fields from the input object.
+    Transparent(attributes::kw::transparent),
+    /// Force every field to be extracted from item of source Python object.
+    ItemAll(attributes::kw::from_item_all),
+    /// Change the name of an enum variant in the generated error message.
+    ErrorAnnotation(LitStr),
+    /// Change the path for the pyo3 crate
+    Crate(CrateAttribute),
+}
+
+impl Parse for ContainerPyO3Attribute {
+    fn parse(input: ParseStream<'_>) -> Result<Self> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(attributes::kw::transparent) {
+            let kw: attributes::kw::transparent = input.parse()?;
+            Ok(ContainerPyO3Attribute::Transparent(kw))
+        } else if lookahead.peek(attributes::kw::from_item_all) {
+            let kw: attributes::kw::from_item_all = input.parse()?;
+            Ok(ContainerPyO3Attribute::ItemAll(kw))
+        } else if lookahead.peek(attributes::kw::annotation) {
+            let _: attributes::kw::annotation = input.parse()?;
+            let _: Token![=] = input.parse()?;
+            input.parse().map(ContainerPyO3Attribute::ErrorAnnotation)
+        } else if lookahead.peek(Token![crate]) {
+            input.parse().map(ContainerPyO3Attribute::Crate)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+}
+
+impl ContainerOptions {
+    fn from_attrs(attrs: &[Attribute]) -> Result<Self> {
+        let mut options = ContainerOptions::default();
+
+        for attr in attrs {
+            if let Some(pyo3_attrs) = get_pyo3_options(attr)? {
+                for pyo3_attr in pyo3_attrs {
+                    match pyo3_attr {
+                        ContainerPyO3Attribute::Transparent(kw) => {
+                            ensure_spanned!(
+                                !options.transparent,
+                                kw.span() => "`transparent` may only be provided once"
+                            );
+                            options.transparent = true;
+                        }
+                        ContainerPyO3Attribute::ItemAll(kw) => {
+                            ensure_spanned!(
+                                options.from_item_all.is_none(),
+                                kw.span() => "`from_item_all` may only be provided once"
+                            );
+                            options.from_item_all = Some(kw);
+                        }
+                        ContainerPyO3Attribute::ErrorAnnotation(lit_str) => {
+                            ensure_spanned!(
+                                options.annotation.is_none(),
+                                lit_str.span() => "`annotation` may only be provided once"
+                            );
+                            options.annotation = Some(lit_str);
+                        }
+                        ContainerPyO3Attribute::Crate(path) => {
+                            ensure_spanned!(
+                                options.krate.is_none(),
+                                path.span() => "`crate` may only be provided once"
+                            );
+                            options.krate = Some(path);
+                        }
+                    }
+                }
+            }
+        }
+        Ok(options)
+    }
+}
+
+/// Attributes for deriving FromPyObject scoped on fields.
+#[derive(Clone, Debug)]
+struct FieldPyO3Attributes {
+    getter: Option<FieldGetter>,
+    from_py_with: Option<FromPyWithAttribute>,
+}
+
+#[derive(Clone, Debug)]
+enum FieldGetter {
+    GetItem(Option<syn::Lit>),
+    GetAttr(Option<LitStr>),
+}
+
+enum FieldPyO3Attribute {
+    Getter(FieldGetter),
+    FromPyWith(FromPyWithAttribute),
+}
+
+impl Parse for FieldPyO3Attribute {
+    fn parse(input: ParseStream<'_>) -> Result<Self> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(attributes::kw::attribute) {
+            let _: attributes::kw::attribute = input.parse()?;
+            if input.peek(syn::token::Paren) {
+                let content;
+                let _ = parenthesized!(content in input);
+                let attr_name: LitStr = content.parse()?;
+                if !content.is_empty() {
+                    return Err(content.error(
+                        "expected at most one argument: `attribute` or `attribute(\"name\")`",
+                    ));
+                }
+                ensure_spanned!(
+                    !attr_name.value().is_empty(),
+                    attr_name.span() => "attribute name cannot be empty"
+                );
+                Ok(FieldPyO3Attribute::Getter(FieldGetter::GetAttr(Some(
+                    attr_name,
+                ))))
+            } else {
+                Ok(FieldPyO3Attribute::Getter(FieldGetter::GetAttr(None)))
+            }
+        } else if lookahead.peek(attributes::kw::item) {
+            let _: attributes::kw::item = input.parse()?;
+            if input.peek(syn::token::Paren) {
+                let content;
+                let _ = parenthesized!(content in input);
+                let key = content.parse()?;
+                if !content.is_empty() {
+                    return Err(
+                        content.error("expected at most one argument: `item` or `item(key)`")
+                    );
+                }
+                Ok(FieldPyO3Attribute::Getter(FieldGetter::GetItem(Some(key))))
+            } else {
+                Ok(FieldPyO3Attribute::Getter(FieldGetter::GetItem(None)))
+            }
+        } else if lookahead.peek(attributes::kw::from_py_with) {
+            input.parse().map(FieldPyO3Attribute::FromPyWith)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+}
+
+impl FieldPyO3Attributes {
+    /// Extract the field attributes.
+    fn from_attrs(attrs: &[Attribute]) -> Result<Self> {
+        let mut getter = None;
+        let mut from_py_with = None;
+
+        for attr in attrs {
+            if let Some(pyo3_attrs) = get_pyo3_options(attr)? {
+                for pyo3_attr in pyo3_attrs {
+                    match pyo3_attr {
+                        FieldPyO3Attribute::Getter(field_getter) => {
+                            ensure_spanned!(
+                                getter.is_none(),
+                                attr.span() => "only one of `attribute` or `item` can be provided"
+                            );
+                            getter = Some(field_getter);
+                        }
+                        FieldPyO3Attribute::FromPyWith(from_py_with_attr) => {
+                            ensure_spanned!(
+                                from_py_with.is_none(),
+                                attr.span() => "`from_py_with` may only be provided once"
+                            );
+                            from_py_with = Some(from_py_with_attr);
+                        }
+                    }
+                }
+            }
+        }
+
+        Ok(FieldPyO3Attributes {
+            getter,
+            from_py_with,
+        })
+    }
+}
+
+fn verify_and_get_lifetime(generics: &syn::Generics) -> Result<Option<&syn::LifetimeParam>> {
+    let mut lifetimes = generics.lifetimes();
+    let lifetime = lifetimes.next();
+    ensure_spanned!(
+        lifetimes.next().is_none(),
+        generics.span() => "FromPyObject can be derived with at most one lifetime parameter"
+    );
+    Ok(lifetime)
+}
+
+/// Derive FromPyObject for enums and structs.
+///
+///   * Max 1 lifetime specifier, will be tied to `FromPyObject`'s specifier
+///   * At least one field, in case of `#[transparent]`, exactly one field
+///   * At least one variant for enums.
+///   * Fields of input structs and enums must implement `FromPyObject` or be annotated with `from_py_with`
+///   * Derivation for structs with generic fields like `struct<T> Foo(T)`
+///     adds `T: FromPyObject` on the derived implementation.
+pub fn build_derive_from_pyobject(tokens: &DeriveInput) -> Result<TokenStream> {
+    let mut trait_generics = tokens.generics.clone();
+    let generics = &tokens.generics;
+    let lt_param = if let Some(lt) = verify_and_get_lifetime(generics)? {
+        lt.clone()
+    } else {
+        trait_generics.params.push(parse_quote!('py));
+        parse_quote!('py)
+    };
+    let mut where_clause: syn::WhereClause = parse_quote!(where);
+    for param in generics.type_params() {
+        let gen_ident = &param.ident;
+        where_clause
+            .predicates
+            .push(parse_quote!(#gen_ident: FromPyObject<#lt_param>))
+    }
+    let options = ContainerOptions::from_attrs(&tokens.attrs)?;
+    let ctx = &Ctx::new(&options.krate, None);
+    let Ctx { pyo3_path, .. } = &ctx;
+
+    let (derives, from_py_with_deprecations) = match &tokens.data {
+        syn::Data::Enum(en) => {
+            if options.transparent || options.annotation.is_some() {
+                bail_spanned!(tokens.span() => "`transparent` or `annotation` is not supported \
+                                                at top level for enums");
+            }
+            let en = Enum::new(en, &tokens.ident)?;
+            en.build(ctx)
+        }
+        syn::Data::Struct(st) => {
+            if let Some(lit_str) = &options.annotation {
+                bail_spanned!(lit_str.span() => "`annotation` is unsupported for structs");
+            }
+            let ident = &tokens.ident;
+            let st = Container::new(&st.fields, parse_quote!(#ident), options)?;
+            st.build(ctx)
+        }
+        syn::Data::Union(_) => bail_spanned!(
+            tokens.span() => "#[derive(FromPyObject)] is not supported for unions"
+        ),
+    };
+
+    let ident = &tokens.ident;
+    Ok(quote!(
+        #[automatically_derived]
+        impl #trait_generics #pyo3_path::FromPyObject<#lt_param> for #ident #generics #where_clause {
+            fn extract_bound(obj: &#pyo3_path::Bound<#lt_param, #pyo3_path::PyAny>) -> #pyo3_path::PyResult<Self>  {
+                #derives
+            }
+        }
+
+        #from_py_with_deprecations
+    ))
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/src/konst.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/konst.rs
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/src/konst.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/konst.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,98 @@
+use std::borrow::Cow;
+use std::ffi::CString;
+
+use crate::utils::{Ctx, LitCStr};
+use crate::{
+    attributes::{self, get_pyo3_options, take_attributes, NameAttribute},
+    deprecations::Deprecations,
+};
+use proc_macro2::{Ident, Span};
+use syn::{
+    ext::IdentExt,
+    parse::{Parse, ParseStream},
+    spanned::Spanned,
+    Result,
+};
+
+pub struct ConstSpec<'ctx> {
+    pub rust_ident: syn::Ident,
+    pub attributes: ConstAttributes<'ctx>,
+}
+
+impl ConstSpec<'_> {
+    pub fn python_name(&self) -> Cow<'_, Ident> {
+        if let Some(name) = &self.attributes.name {
+            Cow::Borrowed(&name.value.0)
+        } else {
+            Cow::Owned(self.rust_ident.unraw())
+        }
+    }
+
+    /// Null-terminated Python name
+    pub fn null_terminated_python_name(&self, ctx: &Ctx) -> LitCStr {
+        let name = self.python_name().to_string();
+        LitCStr::new(CString::new(name).unwrap(), Span::call_site(), ctx)
+    }
+}
+
+pub struct ConstAttributes<'ctx> {
+    pub is_class_attr: bool,
+    pub name: Option<NameAttribute>,
+    pub deprecations: Deprecations<'ctx>,
+}
+
+pub enum PyO3ConstAttribute {
+    Name(NameAttribute),
+}
+
+impl Parse for PyO3ConstAttribute {
+    fn parse(input: ParseStream<'_>) -> Result<Self> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(attributes::kw::name) {
+            input.parse().map(PyO3ConstAttribute::Name)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+}
+
+impl<'ctx> ConstAttributes<'ctx> {
+    pub fn from_attrs(attrs: &mut Vec<syn::Attribute>, ctx: &'ctx Ctx) -> syn::Result<Self> {
+        let mut attributes = ConstAttributes {
+            is_class_attr: false,
+            name: None,
+            deprecations: Deprecations::new(ctx),
+        };
+
+        take_attributes(attrs, |attr| {
+            if attr.path().is_ident("classattr") {
+                ensure_spanned!(
+                    matches!(attr.meta, syn::Meta::Path(..)),
+                    attr.span() => "`#[classattr]` does not take any arguments"
+                );
+                attributes.is_class_attr = true;
+                Ok(true)
+            } else if let Some(pyo3_attributes) = get_pyo3_options(attr)? {
+                for pyo3_attr in pyo3_attributes {
+                    match pyo3_attr {
+                        PyO3ConstAttribute::Name(name) => attributes.set_name(name)?,
+                    }
+                }
+                Ok(true)
+            } else {
+                Ok(false)
+            }
+        })?;
+
+        Ok(attributes)
+    }
+
+    fn set_name(&mut self, name: NameAttribute) -> Result<()> {
+        ensure_spanned!(
+            self.name.is_none(),
+            name.span() => "`name` may only be specified once"
+        );
+        self.name = Some(name);
+        Ok(())
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/lib.rs
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,30 @@
+//! This crate contains the implementation of the proc macro attributes
+
+#![warn(elided_lifetimes_in_paths, unused_lifetimes)]
+#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
+#![recursion_limit = "1024"]
+
+// Listed first so that macros in this module are available in the rest of the crate.
+#[macro_use]
+mod utils;
+
+mod attributes;
+mod deprecations;
+mod frompyobject;
+mod konst;
+mod method;
+mod module;
+mod params;
+mod pyclass;
+mod pyfunction;
+mod pyimpl;
+mod pymethod;
+mod pyversions;
+mod quotes;
+
+pub use frompyobject::build_derive_from_pyobject;
+pub use module::{pymodule_function_impl, pymodule_module_impl, PyModuleOptions};
+pub use pyclass::{build_py_class, build_py_enum, PyClassArgs};
+pub use pyfunction::{build_py_function, PyFunctionOptions};
+pub use pyimpl::{build_py_methods, PyClassMethodsType};
+pub use utils::get_doc;
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/src/method.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/method.rs
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/src/method.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/method.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1142 @@
+use std::borrow::Cow;
+use std::ffi::CString;
+use std::fmt::Display;
+
+use proc_macro2::{Span, TokenStream};
+use quote::{format_ident, quote, quote_spanned, ToTokens};
+use syn::{ext::IdentExt, spanned::Spanned, Ident, Result};
+
+use crate::deprecations::deprecate_trailing_option_default;
+use crate::utils::{Ctx, LitCStr};
+use crate::{
+    attributes::{FromPyWithAttribute, TextSignatureAttribute, TextSignatureAttributeValue},
+    deprecations::{Deprecation, Deprecations},
+    params::{impl_arg_params, Holders},
+    pyfunction::{
+        FunctionSignature, PyFunctionArgPyO3Attributes, PyFunctionOptions, SignatureAttribute,
+    },
+    quotes,
+    utils::{self, is_abi3, PythonDoc},
+};
+
+#[derive(Clone, Debug)]
+pub struct RegularArg<'a> {
+    pub name: Cow<'a, syn::Ident>,
+    pub ty: &'a syn::Type,
+    pub from_py_with: Option<FromPyWithAttribute>,
+    pub default_value: Option<syn::Expr>,
+    pub option_wrapped_type: Option<&'a syn::Type>,
+}
+
+/// Pythons *args argument
+#[derive(Clone, Debug)]
+pub struct VarargsArg<'a> {
+    pub name: Cow<'a, syn::Ident>,
+    pub ty: &'a syn::Type,
+}
+
+/// Pythons **kwarg argument
+#[derive(Clone, Debug)]
+pub struct KwargsArg<'a> {
+    pub name: Cow<'a, syn::Ident>,
+    pub ty: &'a syn::Type,
+}
+
+#[derive(Clone, Debug)]
+pub struct CancelHandleArg<'a> {
+    pub name: &'a syn::Ident,
+    pub ty: &'a syn::Type,
+}
+
+#[derive(Clone, Debug)]
+pub struct PyArg<'a> {
+    pub name: &'a syn::Ident,
+    pub ty: &'a syn::Type,
+}
+
+#[derive(Clone, Debug)]
+pub enum FnArg<'a> {
+    Regular(RegularArg<'a>),
+    VarArgs(VarargsArg<'a>),
+    KwArgs(KwargsArg<'a>),
+    Py(PyArg<'a>),
+    CancelHandle(CancelHandleArg<'a>),
+}
+
+impl<'a> FnArg<'a> {
+    pub fn name(&self) -> &syn::Ident {
+        match self {
+            FnArg::Regular(RegularArg { name, .. }) => name,
+            FnArg::VarArgs(VarargsArg { name, .. }) => name,
+            FnArg::KwArgs(KwargsArg { name, .. }) => name,
+            FnArg::Py(PyArg { name, .. }) => name,
+            FnArg::CancelHandle(CancelHandleArg { name, .. }) => name,
+        }
+    }
+
+    pub fn ty(&self) -> &'a syn::Type {
+        match self {
+            FnArg::Regular(RegularArg { ty, .. }) => ty,
+            FnArg::VarArgs(VarargsArg { ty, .. }) => ty,
+            FnArg::KwArgs(KwargsArg { ty, .. }) => ty,
+            FnArg::Py(PyArg { ty, .. }) => ty,
+            FnArg::CancelHandle(CancelHandleArg { ty, .. }) => ty,
+        }
+    }
+
+    #[allow(clippy::wrong_self_convention)]
+    pub fn from_py_with(&self) -> Option<&FromPyWithAttribute> {
+        if let FnArg::Regular(RegularArg { from_py_with, .. }) = self {
+            from_py_with.as_ref()
+        } else {
+            None
+        }
+    }
+
+    pub fn to_varargs_mut(&mut self) -> Result<&mut Self> {
+        if let Self::Regular(RegularArg {
+            name,
+            ty,
+            option_wrapped_type: None,
+            ..
+        }) = self
+        {
+            *self = Self::VarArgs(VarargsArg {
+                name: name.clone(),
+                ty,
+            });
+            Ok(self)
+        } else {
+            bail_spanned!(self.name().span() => "args cannot be optional")
+        }
+    }
+
+    pub fn to_kwargs_mut(&mut self) -> Result<&mut Self> {
+        if let Self::Regular(RegularArg {
+            name,
+            ty,
+            option_wrapped_type: Some(..),
+            ..
+        }) = self
+        {
+            *self = Self::KwArgs(KwargsArg {
+                name: name.clone(),
+                ty,
+            });
+            Ok(self)
+        } else {
+            bail_spanned!(self.name().span() => "kwargs must be Option<_>")
+        }
+    }
+
+    /// Transforms a rust fn arg parsed with syn into a method::FnArg
+    pub fn parse(arg: &'a mut syn::FnArg) -> Result<Self> {
+        match arg {
+            syn::FnArg::Receiver(recv) => {
+                bail_spanned!(recv.span() => "unexpected receiver")
+            } // checked in parse_fn_type
+            syn::FnArg::Typed(cap) => {
+                if let syn::Type::ImplTrait(_) = &*cap.ty {
+                    bail_spanned!(cap.ty.span() => IMPL_TRAIT_ERR);
+                }
+
+                let PyFunctionArgPyO3Attributes {
+                    from_py_with,
+                    cancel_handle,
+                } = PyFunctionArgPyO3Attributes::from_attrs(&mut cap.attrs)?;
+                let ident = match &*cap.pat {
+                    syn::Pat::Ident(syn::PatIdent { ident, .. }) => ident,
+                    other => return Err(handle_argument_error(other)),
+                };
+
+                if utils::is_python(&cap.ty) {
+                    return Ok(Self::Py(PyArg {
+                        name: ident,
+                        ty: &cap.ty,
+                    }));
+                }
+
+                if cancel_handle.is_some() {
+                    // `PyFunctionArgPyO3Attributes::from_attrs` validates that
+                    // only compatible attributes are specified, either
+                    // `cancel_handle` or `from_py_with`, dublicates and any
+                    // combination of the two are already rejected.
+                    return Ok(Self::CancelHandle(CancelHandleArg {
+                        name: ident,
+                        ty: &cap.ty,
+                    }));
+                }
+
+                Ok(Self::Regular(RegularArg {
+                    name: Cow::Borrowed(ident),
+                    ty: &cap.ty,
+                    from_py_with,
+                    default_value: None,
+                    option_wrapped_type: utils::option_type_argument(&cap.ty),
+                }))
+            }
+        }
+    }
+}
+
+fn handle_argument_error(pat: &syn::Pat) -> syn::Error {
+    let span = pat.span();
+    let msg = match pat {
+        syn::Pat::Wild(_) => "wildcard argument names are not supported",
+        syn::Pat::Struct(_)
+        | syn::Pat::Tuple(_)
+        | syn::Pat::TupleStruct(_)
+        | syn::Pat::Slice(_) => "destructuring in arguments is not supported",
+        _ => "unsupported argument",
+    };
+    syn::Error::new(span, msg)
+}
+
+/// Represents what kind of a function a pyfunction or pymethod is
+#[derive(Clone, Debug)]
+pub enum FnType {
+    /// Represents a pymethod annotated with `#[getter]`
+    Getter(SelfType),
+    /// Represents a pymethod annotated with `#[setter]`
+    Setter(SelfType),
+    /// Represents a regular pymethod
+    Fn(SelfType),
+    /// Represents a pymethod annotated with `#[new]`, i.e. the `__new__` dunder.
+    FnNew,
+    /// Represents a pymethod annotated with both `#[new]` and `#[classmethod]` (in either order)
+    FnNewClass(Span),
+    /// Represents a pymethod annotated with `#[classmethod]`, like a `@classmethod`
+    FnClass(Span),
+    /// Represents a pyfunction or a pymethod annotated with `#[staticmethod]`, like a `@staticmethod`
+    FnStatic,
+    /// Represents a pyfunction annotated with `#[pyo3(pass_module)]
+    FnModule(Span),
+    /// Represents a pymethod or associated constant annotated with `#[classattr]`
+    ClassAttribute,
+}
+
+impl FnType {
+    pub fn skip_first_rust_argument_in_python_signature(&self) -> bool {
+        match self {
+            FnType::Getter(_)
+            | FnType::Setter(_)
+            | FnType::Fn(_)
+            | FnType::FnClass(_)
+            | FnType::FnNewClass(_)
+            | FnType::FnModule(_) => true,
+            FnType::FnNew | FnType::FnStatic | FnType::ClassAttribute => false,
+        }
+    }
+
+    pub fn signature_attribute_allowed(&self) -> bool {
+        match self {
+            FnType::Fn(_)
+            | FnType::FnNew
+            | FnType::FnStatic
+            | FnType::FnClass(_)
+            | FnType::FnNewClass(_)
+            | FnType::FnModule(_) => true,
+            // Setter, Getter and ClassAttribute all have fixed signatures (either take 0 or 1
+            // arguments) so cannot have a `signature = (...)` attribute.
+            FnType::Getter(_) | FnType::Setter(_) | FnType::ClassAttribute => false,
+        }
+    }
+
+    pub fn self_arg(
+        &self,
+        cls: Option<&syn::Type>,
+        error_mode: ExtractErrorMode,
+        holders: &mut Holders,
+        ctx: &Ctx,
+    ) -> Option<TokenStream> {
+        let Ctx { pyo3_path, .. } = ctx;
+        match self {
+            FnType::Getter(st) | FnType::Setter(st) | FnType::Fn(st) => {
+                let mut receiver = st.receiver(
+                    cls.expect("no class given for Fn with a \"self\" receiver"),
+                    error_mode,
+                    holders,
+                    ctx,
+                );
+                syn::Token![,](Span::call_site()).to_tokens(&mut receiver);
+                Some(receiver)
+            }
+            FnType::FnClass(span) | FnType::FnNewClass(span) => {
+                let py = syn::Ident::new("py", Span::call_site());
+                let slf: Ident = syn::Ident::new("_slf_ref", Span::call_site());
+                let pyo3_path = pyo3_path.to_tokens_spanned(*span);
+                let ret = quote_spanned! { *span =>
+                    #[allow(clippy::useless_conversion)]
+                    ::std::convert::Into::into(
+                        #pyo3_path::impl_::pymethods::BoundRef::ref_from_ptr(#py, &*(#slf as *const _ as *const *mut _))
+                            .downcast_unchecked::<#pyo3_path::types::PyType>()
+                    ),
+                };
+                Some(ret)
+            }
+            FnType::FnModule(span) => {
+                let py = syn::Ident::new("py", Span::call_site());
+                let slf: Ident = syn::Ident::new("_slf_ref", Span::call_site());
+                let pyo3_path = pyo3_path.to_tokens_spanned(*span);
+                let ret = quote_spanned! { *span =>
+                    #[allow(clippy::useless_conversion)]
+                    ::std::convert::Into::into(
+                        #pyo3_path::impl_::pymethods::BoundRef::ref_from_ptr(#py, &*(#slf as *const _ as *const *mut _))
+                            .downcast_unchecked::<#pyo3_path::types::PyModule>()
+                    ),
+                };
+                Some(ret)
+            }
+            FnType::FnNew | FnType::FnStatic | FnType::ClassAttribute => None,
+        }
+    }
+}
+
+#[derive(Clone, Debug)]
+pub enum SelfType {
+    Receiver { mutable: bool, span: Span },
+    TryFromBoundRef(Span),
+}
+
+#[derive(Clone, Copy)]
+pub enum ExtractErrorMode {
+    NotImplemented,
+    Raise,
+}
+
+impl ExtractErrorMode {
+    pub fn handle_error(self, extract: TokenStream, ctx: &Ctx) -> TokenStream {
+        let Ctx { pyo3_path, .. } = ctx;
+        match self {
+            ExtractErrorMode::Raise => quote! { #extract? },
+            ExtractErrorMode::NotImplemented => quote! {
+                match #extract {
+                    ::std::result::Result::Ok(value) => value,
+                    ::std::result::Result::Err(_) => { return #pyo3_path::callback::convert(py, py.NotImplemented()); },
+                }
+            },
+        }
+    }
+}
+
+impl SelfType {
+    pub fn receiver(
+        &self,
+        cls: &syn::Type,
+        error_mode: ExtractErrorMode,
+        holders: &mut Holders,
+        ctx: &Ctx,
+    ) -> TokenStream {
+        // Due to use of quote_spanned in this function, need to bind these idents to the
+        // main macro callsite.
+        let py = syn::Ident::new("py", Span::call_site());
+        let slf = syn::Ident::new("_slf", Span::call_site());
+        let Ctx { pyo3_path, .. } = ctx;
+        match self {
+            SelfType::Receiver { span, mutable } => {
+                let method = if *mutable {
+                    syn::Ident::new("extract_pyclass_ref_mut", *span)
+                } else {
+                    syn::Ident::new("extract_pyclass_ref", *span)
+                };
+                let holder = holders.push_holder(*span);
+                let pyo3_path = pyo3_path.to_tokens_spanned(*span);
+                error_mode.handle_error(
+                    quote_spanned! { *span =>
+                        #pyo3_path::impl_::extract_argument::#method::<#cls>(
+                            #pyo3_path::impl_::pymethods::BoundRef::ref_from_ptr(#py, &#slf).0,
+                            &mut #holder,
+                        )
+                    },
+                    ctx,
+                )
+            }
+            SelfType::TryFromBoundRef(span) => {
+                let pyo3_path = pyo3_path.to_tokens_spanned(*span);
+                error_mode.handle_error(
+                    quote_spanned! { *span =>
+                        #pyo3_path::impl_::pymethods::BoundRef::ref_from_ptr(#py, &#slf).downcast::<#cls>()
+                            .map_err(::std::convert::Into::<#pyo3_path::PyErr>::into)
+                            .and_then(
+                                #[allow(unknown_lints, clippy::unnecessary_fallible_conversions)]  // In case slf is Py<Self> (unknown_lints can be removed when MSRV is 1.75+)
+                                |bound| ::std::convert::TryFrom::try_from(bound).map_err(::std::convert::Into::into)
+                            )
+
+                    },
+                    ctx
+                )
+            }
+        }
+    }
+}
+
+/// Determines which CPython calling convention a given FnSpec uses.
+#[derive(Clone, Debug)]
+pub enum CallingConvention {
+    Noargs,   // METH_NOARGS
+    Varargs,  // METH_VARARGS | METH_KEYWORDS
+    Fastcall, // METH_FASTCALL | METH_KEYWORDS (not compatible with `abi3` feature)
+    TpNew,    // special convention for tp_new
+}
+
+impl CallingConvention {
+    /// Determine default calling convention from an argument signature.
+    ///
+    /// Different other slots (tp_call, tp_new) can have other requirements
+    /// and are set manually (see `parse_fn_type` below).
+    pub fn from_signature(signature: &FunctionSignature<'_>) -> Self {
+        if signature.python_signature.has_no_args() {
+            Self::Noargs
+        } else if signature.python_signature.kwargs.is_some() {
+            // for functions that accept **kwargs, always prefer varargs
+            Self::Varargs
+        } else if !is_abi3() {
+            // FIXME: available in the stable ABI since 3.10
+            Self::Fastcall
+        } else {
+            Self::Varargs
+        }
+    }
+}
+
+pub struct FnSpec<'a> {
+    pub tp: FnType,
+    // Rust function name
+    pub name: &'a syn::Ident,
+    // Wrapped python name. This should not have any leading r#.
+    // r# can be removed by syn::ext::IdentExt::unraw()
+    pub python_name: syn::Ident,
+    pub signature: FunctionSignature<'a>,
+    pub convention: CallingConvention,
+    pub text_signature: Option<TextSignatureAttribute>,
+    pub asyncness: Option<syn::Token![async]>,
+    pub unsafety: Option<syn::Token![unsafe]>,
+    pub deprecations: Deprecations<'a>,
+}
+
+pub fn parse_method_receiver(arg: &syn::FnArg) -> Result<SelfType> {
+    match arg {
+        syn::FnArg::Receiver(
+            recv @ syn::Receiver {
+                reference: None, ..
+            },
+        ) => {
+            bail_spanned!(recv.span() => RECEIVER_BY_VALUE_ERR);
+        }
+        syn::FnArg::Receiver(recv @ syn::Receiver { mutability, .. }) => Ok(SelfType::Receiver {
+            mutable: mutability.is_some(),
+            span: recv.span(),
+        }),
+        syn::FnArg::Typed(syn::PatType { ty, .. }) => {
+            if let syn::Type::ImplTrait(_) = &**ty {
+                bail_spanned!(ty.span() => IMPL_TRAIT_ERR);
+            }
+            Ok(SelfType::TryFromBoundRef(ty.span()))
+        }
+    }
+}
+
+impl<'a> FnSpec<'a> {
+    /// Parser function signature and function attributes
+    pub fn parse(
+        // Signature is mutable to remove the `Python` argument.
+        sig: &'a mut syn::Signature,
+        meth_attrs: &mut Vec<syn::Attribute>,
+        options: PyFunctionOptions,
+        ctx: &'a Ctx,
+    ) -> Result<FnSpec<'a>> {
+        let PyFunctionOptions {
+            text_signature,
+            name,
+            signature,
+            ..
+        } = options;
+
+        let mut python_name = name.map(|name| name.value.0);
+        let mut deprecations = Deprecations::new(ctx);
+
+        let fn_type = Self::parse_fn_type(sig, meth_attrs, &mut python_name, &mut deprecations)?;
+        ensure_signatures_on_valid_method(&fn_type, signature.as_ref(), text_signature.as_ref())?;
+
+        let name = &sig.ident;
+        let python_name = python_name.as_ref().unwrap_or(name).unraw();
+
+        let arguments: Vec<_> = sig
+            .inputs
+            .iter_mut()
+            .skip(if fn_type.skip_first_rust_argument_in_python_signature() {
+                1
+            } else {
+                0
+            })
+            .map(FnArg::parse)
+            .collect::<Result<_>>()?;
+
+        let signature = if let Some(signature) = signature {
+            FunctionSignature::from_arguments_and_attribute(arguments, signature)?
+        } else {
+            FunctionSignature::from_arguments(arguments)?
+        };
+
+        let convention = if matches!(fn_type, FnType::FnNew | FnType::FnNewClass(_)) {
+            CallingConvention::TpNew
+        } else {
+            CallingConvention::from_signature(&signature)
+        };
+
+        Ok(FnSpec {
+            tp: fn_type,
+            name,
+            convention,
+            python_name,
+            signature,
+            text_signature,
+            asyncness: sig.asyncness,
+            unsafety: sig.unsafety,
+            deprecations,
+        })
+    }
+
+    pub fn null_terminated_python_name(&self, ctx: &Ctx) -> LitCStr {
+        let name = self.python_name.to_string();
+        let name = CString::new(name).unwrap();
+        LitCStr::new(name, self.python_name.span(), ctx)
+    }
+
+    fn parse_fn_type(
+        sig: &syn::Signature,
+        meth_attrs: &mut Vec<syn::Attribute>,
+        python_name: &mut Option<syn::Ident>,
+        deprecations: &mut Deprecations<'_>,
+    ) -> Result<FnType> {
+        let mut method_attributes = parse_method_attributes(meth_attrs, deprecations)?;
+
+        let name = &sig.ident;
+        let parse_receiver = |msg: &'static str| {
+            let first_arg = sig
+                .inputs
+                .first()
+                .ok_or_else(|| err_spanned!(sig.span() => msg))?;
+            parse_method_receiver(first_arg)
+        };
+
+        // strip get_ or set_
+        let strip_fn_name = |prefix: &'static str| {
+            name.unraw()
+                .to_string()
+                .strip_prefix(prefix)
+                .map(|stripped| syn::Ident::new(stripped, name.span()))
+        };
+
+        let mut set_name_to_new = || {
+            if let Some(name) = &python_name {
+                bail_spanned!(name.span() => "`name` not allowed with `#[new]`");
+            }
+            *python_name = Some(syn::Ident::new("__new__", Span::call_site()));
+            Ok(())
+        };
+
+        let fn_type = match method_attributes.as_mut_slice() {
+            [] => FnType::Fn(parse_receiver(
+                "static method needs #[staticmethod] attribute",
+            )?),
+            [MethodTypeAttribute::StaticMethod(_)] => FnType::FnStatic,
+            [MethodTypeAttribute::ClassAttribute(_)] => FnType::ClassAttribute,
+            [MethodTypeAttribute::New(_)] => {
+                set_name_to_new()?;
+                FnType::FnNew
+            }
+            [MethodTypeAttribute::New(_), MethodTypeAttribute::ClassMethod(span)]
+            | [MethodTypeAttribute::ClassMethod(span), MethodTypeAttribute::New(_)] => {
+                set_name_to_new()?;
+                FnType::FnNewClass(*span)
+            }
+            [MethodTypeAttribute::ClassMethod(_)] => {
+                // Add a helpful hint if the classmethod doesn't look like a classmethod
+                let span = match sig.inputs.first() {
+                    // Don't actually bother checking the type of the first argument, the compiler
+                    // will error on incorrect type.
+                    Some(syn::FnArg::Typed(first_arg)) => first_arg.ty.span(),
+                    Some(syn::FnArg::Receiver(_)) | None => bail_spanned!(
+                        sig.paren_token.span.join() => "Expected `&Bound<PyType>` or `Py<PyType>` as the first argument to `#[classmethod]`"
+                    ),
+                };
+                FnType::FnClass(span)
+            }
+            [MethodTypeAttribute::Getter(_, name)] => {
+                if let Some(name) = name.take() {
+                    ensure_spanned!(
+                        python_name.replace(name).is_none(),
+                        python_name.span() => "`name` may only be specified once"
+                    );
+                } else if python_name.is_none() {
+                    // Strip off "get_" prefix if needed
+                    *python_name = strip_fn_name("get_");
+                }
+
+                FnType::Getter(parse_receiver("expected receiver for `#[getter]`")?)
+            }
+            [MethodTypeAttribute::Setter(_, name)] => {
+                if let Some(name) = name.take() {
+                    ensure_spanned!(
+                        python_name.replace(name).is_none(),
+                        python_name.span() => "`name` may only be specified once"
+                    );
+                } else if python_name.is_none() {
+                    // Strip off "set_" prefix if needed
+                    *python_name = strip_fn_name("set_");
+                }
+
+                FnType::Setter(parse_receiver("expected receiver for `#[setter]`")?)
+            }
+            [first, rest @ .., last] => {
+                // Join as many of the spans together as possible
+                let span = rest
+                    .iter()
+                    .fold(first.span(), |s, next| s.join(next.span()).unwrap_or(s));
+                let span = span.join(last.span()).unwrap_or(span);
+                // List all the attributes in the error message
+                let mut msg = format!("`{}` may not be combined with", first);
+                let mut is_first = true;
+                for attr in &*rest {
+                    msg.push_str(&format!(" `{}`", attr));
+                    if is_first {
+                        is_first = false;
+                    } else {
+                        msg.push(',');
+                    }
+                }
+                if !rest.is_empty() {
+                    msg.push_str(" and");
+                }
+                msg.push_str(&format!(" `{}`", last));
+                bail_spanned!(span => msg)
+            }
+        };
+        Ok(fn_type)
+    }
+
+    /// Return a C wrapper function for this signature.
+    pub fn get_wrapper_function(
+        &self,
+        ident: &proc_macro2::Ident,
+        cls: Option<&syn::Type>,
+        ctx: &Ctx,
+    ) -> Result<TokenStream> {
+        let Ctx {
+            pyo3_path,
+            output_span,
+        } = ctx;
+        let mut cancel_handle_iter = self
+            .signature
+            .arguments
+            .iter()
+            .filter(|arg| matches!(arg, FnArg::CancelHandle(..)));
+        let cancel_handle = cancel_handle_iter.next();
+        if let Some(FnArg::CancelHandle(CancelHandleArg { name, .. })) = cancel_handle {
+            ensure_spanned!(self.asyncness.is_some(), name.span() => "`cancel_handle` attribute can only be used with `async fn`");
+            if let Some(FnArg::CancelHandle(CancelHandleArg { name, .. })) =
+                cancel_handle_iter.next()
+            {
+                bail_spanned!(name.span() => "`cancel_handle` may only be specified once");
+            }
+        }
+
+        if self.asyncness.is_some() {
+            ensure_spanned!(
+                cfg!(feature = "experimental-async"),
+                self.asyncness.span() => "async functions are only supported with the `experimental-async` feature"
+            );
+        }
+
+        let rust_call = |args: Vec<TokenStream>, holders: &mut Holders| {
+            let mut self_arg = || self.tp.self_arg(cls, ExtractErrorMode::Raise, holders, ctx);
+
+            let call = if self.asyncness.is_some() {
+                let throw_callback = if cancel_handle.is_some() {
+                    quote! { Some(__throw_callback) }
+                } else {
+                    quote! { None }
+                };
+                let python_name = &self.python_name;
+                let qualname_prefix = match cls {
+                    Some(cls) => quote!(Some(<#cls as #pyo3_path::PyTypeInfo>::NAME)),
+                    None => quote!(None),
+                };
+                let arg_names = (0..args.len())
+                    .map(|i| format_ident!("arg_{}", i))
+                    .collect::<Vec<_>>();
+                let future = match self.tp {
+                    FnType::Fn(SelfType::Receiver { mutable: false, .. }) => {
+                        quote! {{
+                            #(let #arg_names = #args;)*
+                            let __guard = #pyo3_path::impl_::coroutine::RefGuard::<#cls>::new(&#pyo3_path::impl_::pymethods::BoundRef::ref_from_ptr(py, &_slf))?;
+                            async move { function(&__guard, #(#arg_names),*).await }
+                        }}
+                    }
+                    FnType::Fn(SelfType::Receiver { mutable: true, .. }) => {
+                        quote! {{
+                            #(let #arg_names = #args;)*
+                            let mut __guard = #pyo3_path::impl_::coroutine::RefMutGuard::<#cls>::new(&#pyo3_path::impl_::pymethods::BoundRef::ref_from_ptr(py, &_slf))?;
+                            async move { function(&mut __guard, #(#arg_names),*).await }
+                        }}
+                    }
+                    _ => {
+                        if let Some(self_arg) = self_arg() {
+                            let self_checker = holders.push_gil_refs_checker(self_arg.span());
+                            quote! {
+                                function(
+                                    // NB #self_arg includes a comma, so none inserted here
+                                    #pyo3_path::impl_::deprecations::inspect_type(#self_arg &#self_checker),
+                                    #(#args),*
+                                )
+                            }
+                        } else {
+                            quote! { function(#(#args),*) }
+                        }
+                    }
+                };
+                let mut call = quote! {{
+                    let future = #future;
+                    #pyo3_path::impl_::coroutine::new_coroutine(
+                        #pyo3_path::intern!(py, stringify!(#python_name)),
+                        #qualname_prefix,
+                        #throw_callback,
+                        async move { #pyo3_path::impl_::wrap::OkWrap::wrap(future.await) },
+                    )
+                }};
+                if cancel_handle.is_some() {
+                    call = quote! {{
+                        let __cancel_handle = #pyo3_path::coroutine::CancelHandle::new();
+                        let __throw_callback = __cancel_handle.throw_callback();
+                        #call
+                    }};
+                }
+                call
+            } else if let Some(self_arg) = self_arg() {
+                let self_checker = holders.push_gil_refs_checker(self_arg.span());
+                quote! {
+                    function(
+                        // NB #self_arg includes a comma, so none inserted here
+                        #pyo3_path::impl_::deprecations::inspect_type(#self_arg &#self_checker),
+                        #(#args),*
+                    )
+                }
+            } else {
+                quote! { function(#(#args),*) }
+            };
+
+            // We must assign the output_span to the return value of the call,
+            // but *not* of the call itself otherwise the spans get really weird
+            let ret_expr = quote! { let ret = #call; };
+            let ret_var = quote_spanned! {*output_span=> ret };
+            let return_conversion = quotes::map_result_into_ptr(quotes::ok_wrap(ret_var, ctx), ctx);
+            quote! {
+                {
+                    #ret_expr
+                    #return_conversion
+                }
+            }
+        };
+
+        let func_name = &self.name;
+        let rust_name = if let Some(cls) = cls {
+            quote!(#cls::#func_name)
+        } else {
+            quote!(#func_name)
+        };
+
+        let deprecation = deprecate_trailing_option_default(self);
+
+        Ok(match self.convention {
+            CallingConvention::Noargs => {
+                let mut holders = Holders::new();
+                let args = self
+                    .signature
+                    .arguments
+                    .iter()
+                    .map(|arg| match arg {
+                        FnArg::Py(..) => quote!(py),
+                        FnArg::CancelHandle(..) => quote!(__cancel_handle),
+                        _ => unreachable!("`CallingConvention::Noargs` should not contain any arguments (reaching Python) except for `self`, which is handled below."),
+                    })
+                    .collect();
+                let call = rust_call(args, &mut holders);
+                let check_gil_refs = holders.check_gil_refs();
+                let init_holders = holders.init_holders(ctx);
+                quote! {
+                    unsafe fn #ident<'py>(
+                        py: #pyo3_path::Python<'py>,
+                        _slf: *mut #pyo3_path::ffi::PyObject,
+                    ) -> #pyo3_path::PyResult<*mut #pyo3_path::ffi::PyObject> {
+                        #deprecation
+                        let _slf_ref = &_slf;
+                        let function = #rust_name; // Shadow the function name to avoid #3017
+                        #init_holders
+                        let result = #call;
+                        #check_gil_refs
+                        result
+                    }
+                }
+            }
+            CallingConvention::Fastcall => {
+                let mut holders = Holders::new();
+                let (arg_convert, args) = impl_arg_params(self, cls, true, &mut holders, ctx);
+                let call = rust_call(args, &mut holders);
+                let init_holders = holders.init_holders(ctx);
+                let check_gil_refs = holders.check_gil_refs();
+
+                quote! {
+                    unsafe fn #ident<'py>(
+                        py: #pyo3_path::Python<'py>,
+                        _slf: *mut #pyo3_path::ffi::PyObject,
+                        _args: *const *mut #pyo3_path::ffi::PyObject,
+                        _nargs: #pyo3_path::ffi::Py_ssize_t,
+                        _kwnames: *mut #pyo3_path::ffi::PyObject
+                    ) -> #pyo3_path::PyResult<*mut #pyo3_path::ffi::PyObject> {
+                        #deprecation
+                        let _slf_ref = &_slf;
+                        let function = #rust_name; // Shadow the function name to avoid #3017
+                        #arg_convert
+                        #init_holders
+                        let result = #call;
+                        #check_gil_refs
+                        result
+                    }
+                }
+            }
+            CallingConvention::Varargs => {
+                let mut holders = Holders::new();
+                let (arg_convert, args) = impl_arg_params(self, cls, false, &mut holders, ctx);
+                let call = rust_call(args, &mut holders);
+                let init_holders = holders.init_holders(ctx);
+                let check_gil_refs = holders.check_gil_refs();
+
+                quote! {
+                    unsafe fn #ident<'py>(
+                        py: #pyo3_path::Python<'py>,
+                        _slf: *mut #pyo3_path::ffi::PyObject,
+                        _args: *mut #pyo3_path::ffi::PyObject,
+                        _kwargs: *mut #pyo3_path::ffi::PyObject
+                    ) -> #pyo3_path::PyResult<*mut #pyo3_path::ffi::PyObject> {
+                        #deprecation
+                        let _slf_ref = &_slf;
+                        let function = #rust_name; // Shadow the function name to avoid #3017
+                        #arg_convert
+                        #init_holders
+                        let result = #call;
+                        #check_gil_refs
+                        result
+                    }
+                }
+            }
+            CallingConvention::TpNew => {
+                let mut holders = Holders::new();
+                let (arg_convert, args) = impl_arg_params(self, cls, false, &mut holders, ctx);
+                let self_arg = self
+                    .tp
+                    .self_arg(cls, ExtractErrorMode::Raise, &mut holders, ctx);
+                let call = quote_spanned! {*output_span=> #rust_name(#self_arg #(#args),*) };
+                let init_holders = holders.init_holders(ctx);
+                let check_gil_refs = holders.check_gil_refs();
+                quote! {
+                    unsafe fn #ident(
+                        py: #pyo3_path::Python<'_>,
+                        _slf: *mut #pyo3_path::ffi::PyTypeObject,
+                        _args: *mut #pyo3_path::ffi::PyObject,
+                        _kwargs: *mut #pyo3_path::ffi::PyObject
+                    ) -> #pyo3_path::PyResult<*mut #pyo3_path::ffi::PyObject> {
+                        use #pyo3_path::callback::IntoPyCallbackOutput;
+                        #deprecation
+                        let _slf_ref = &_slf;
+                        let function = #rust_name; // Shadow the function name to avoid #3017
+                        #arg_convert
+                        #init_holders
+                        let result = #call;
+                        let initializer: #pyo3_path::PyClassInitializer::<#cls> = result.convert(py)?;
+                        #check_gil_refs
+                        #pyo3_path::impl_::pymethods::tp_new_impl(py, initializer, _slf)
+                    }
+                }
+            }
+        })
+    }
+
+    /// Return a `PyMethodDef` constructor for this function, matching the selected
+    /// calling convention.
+    pub fn get_methoddef(&self, wrapper: impl ToTokens, doc: &PythonDoc, ctx: &Ctx) -> TokenStream {
+        let Ctx { pyo3_path, .. } = ctx;
+        let python_name = self.null_terminated_python_name(ctx);
+        match self.convention {
+            CallingConvention::Noargs => quote! {
+                #pyo3_path::impl_::pymethods::PyMethodDef::noargs(
+                    #python_name,
+                    {
+                        unsafe extern "C" fn trampoline(
+                            _slf: *mut #pyo3_path::ffi::PyObject,
+                            _args: *mut #pyo3_path::ffi::PyObject,
+                        ) -> *mut #pyo3_path::ffi::PyObject
+                        {
+                            #pyo3_path::impl_::trampoline::noargs(
+                                _slf,
+                                _args,
+                                #wrapper
+                            )
+                        }
+                        trampoline
+                    },
+                    #doc,
+                )
+            },
+            CallingConvention::Fastcall => quote! {
+                #pyo3_path::impl_::pymethods::PyMethodDef::fastcall_cfunction_with_keywords(
+                    #python_name,
+                    {
+                        unsafe extern "C" fn trampoline(
+                            _slf: *mut #pyo3_path::ffi::PyObject,
+                            _args: *const *mut #pyo3_path::ffi::PyObject,
+                            _nargs: #pyo3_path::ffi::Py_ssize_t,
+                            _kwnames: *mut #pyo3_path::ffi::PyObject
+                        ) -> *mut #pyo3_path::ffi::PyObject
+                        {
+                            #pyo3_path::impl_::trampoline::fastcall_with_keywords(
+                                _slf,
+                                _args,
+                                _nargs,
+                                _kwnames,
+                                #wrapper
+                            )
+                        }
+                        trampoline
+                    },
+                    #doc,
+                )
+            },
+            CallingConvention::Varargs => quote! {
+                #pyo3_path::impl_::pymethods::PyMethodDef::cfunction_with_keywords(
+                    #python_name,
+                    {
+                        unsafe extern "C" fn trampoline(
+                            _slf: *mut #pyo3_path::ffi::PyObject,
+                            _args: *mut #pyo3_path::ffi::PyObject,
+                            _kwargs: *mut #pyo3_path::ffi::PyObject,
+                        ) -> *mut #pyo3_path::ffi::PyObject
+                        {
+                            #pyo3_path::impl_::trampoline::cfunction_with_keywords(
+                                _slf,
+                                _args,
+                                _kwargs,
+                                #wrapper
+                            )
+                        }
+                        trampoline
+                    },
+                    #doc,
+                )
+            },
+            CallingConvention::TpNew => unreachable!("tp_new cannot get a methoddef"),
+        }
+    }
+
+    /// Forwards to [utils::get_doc] with the text signature of this spec.
+    pub fn get_doc(&self, attrs: &[syn::Attribute], ctx: &Ctx) -> PythonDoc {
+        let text_signature = self
+            .text_signature_call_signature()
+            .map(|sig| format!("{}{}", self.python_name, sig));
+        utils::get_doc(attrs, text_signature, ctx)
+    }
+
+    /// Creates the parenthesised arguments list for `__text_signature__` snippet based on this spec's signature
+    /// and/or attributes. Prepend the callable name to make a complete `__text_signature__`.
+    pub fn text_signature_call_signature(&self) -> Option<String> {
+        let self_argument = match &self.tp {
+            // Getters / Setters / ClassAttribute are not callables on the Python side
+            FnType::Getter(_) | FnType::Setter(_) | FnType::ClassAttribute => return None,
+            FnType::Fn(_) => Some("self"),
+            FnType::FnModule(_) => Some("module"),
+            FnType::FnClass(_) | FnType::FnNewClass(_) => Some("cls"),
+            FnType::FnStatic | FnType::FnNew => None,
+        };
+
+        match self.text_signature.as_ref().map(|attr| &attr.value) {
+            Some(TextSignatureAttributeValue::Str(s)) => Some(s.value()),
+            None => Some(self.signature.text_signature(self_argument)),
+            Some(TextSignatureAttributeValue::Disabled(_)) => None,
+        }
+    }
+}
+
+enum MethodTypeAttribute {
+    New(Span),
+    ClassMethod(Span),
+    StaticMethod(Span),
+    Getter(Span, Option<Ident>),
+    Setter(Span, Option<Ident>),
+    ClassAttribute(Span),
+}
+
+impl MethodTypeAttribute {
+    fn span(&self) -> Span {
+        match self {
+            MethodTypeAttribute::New(span)
+            | MethodTypeAttribute::ClassMethod(span)
+            | MethodTypeAttribute::StaticMethod(span)
+            | MethodTypeAttribute::Getter(span, _)
+            | MethodTypeAttribute::Setter(span, _)
+            | MethodTypeAttribute::ClassAttribute(span) => *span,
+        }
+    }
+
+    /// Attempts to parse a method type attribute.
+    ///
+    /// If the attribute does not match one of the attribute names, returns `Ok(None)`.
+    ///
+    /// Otherwise will either return a parse error or the attribute.
+    fn parse_if_matching_attribute(
+        attr: &syn::Attribute,
+        deprecations: &mut Deprecations<'_>,
+    ) -> Result<Option<Self>> {
+        fn ensure_no_arguments(meta: &syn::Meta, ident: &str) -> syn::Result<()> {
+            match meta {
+                syn::Meta::Path(_) => Ok(()),
+                syn::Meta::List(l) => bail_spanned!(
+                    l.span() => format!(
+                        "`#[{ident}]` does not take any arguments\n= help: did you mean `#[{ident}] #[pyo3({meta})]`?",
+                        ident = ident,
+                        meta = l.tokens,
+                    )
+                ),
+                syn::Meta::NameValue(nv) => {
+                    bail_spanned!(nv.eq_token.span() => format!(
+                        "`#[{}]` does not take any arguments\n= note: this was previously accepted and ignored",
+                        ident
+                    ))
+                }
+            }
+        }
+
+        fn extract_name(meta: &syn::Meta, ident: &str) -> Result<Option<Ident>> {
+            match meta {
+                syn::Meta::Path(_) => Ok(None),
+                syn::Meta::NameValue(nv) => bail_spanned!(
+                    nv.eq_token.span() => format!("expected `#[{}(name)]` to set the name", ident)
+                ),
+                syn::Meta::List(l) => {
+                    if let Ok(name) = l.parse_args::<syn::Ident>() {
+                        Ok(Some(name))
+                    } else if let Ok(name) = l.parse_args::<syn::LitStr>() {
+                        name.parse().map(Some)
+                    } else {
+                        bail_spanned!(l.tokens.span() => "expected ident or string literal for property name");
+                    }
+                }
+            }
+        }
+
+        let meta = &attr.meta;
+        let path = meta.path();
+
+        if path.is_ident("new") {
+            ensure_no_arguments(meta, "new")?;
+            Ok(Some(MethodTypeAttribute::New(path.span())))
+        } else if path.is_ident("__new__") {
+            let span = path.span();
+            deprecations.push(Deprecation::PyMethodsNewDeprecatedForm, span);
+            ensure_no_arguments(meta, "__new__")?;
+            Ok(Some(MethodTypeAttribute::New(span)))
+        } else if path.is_ident("classmethod") {
+            ensure_no_arguments(meta, "classmethod")?;
+            Ok(Some(MethodTypeAttribute::ClassMethod(path.span())))
+        } else if path.is_ident("staticmethod") {
+            ensure_no_arguments(meta, "staticmethod")?;
+            Ok(Some(MethodTypeAttribute::StaticMethod(path.span())))
+        } else if path.is_ident("classattr") {
+            ensure_no_arguments(meta, "classattr")?;
+            Ok(Some(MethodTypeAttribute::ClassAttribute(path.span())))
+        } else if path.is_ident("getter") {
+            let name = extract_name(meta, "getter")?;
+            Ok(Some(MethodTypeAttribute::Getter(path.span(), name)))
+        } else if path.is_ident("setter") {
+            let name = extract_name(meta, "setter")?;
+            Ok(Some(MethodTypeAttribute::Setter(path.span(), name)))
+        } else {
+            Ok(None)
+        }
+    }
+}
+
+impl Display for MethodTypeAttribute {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        match self {
+            MethodTypeAttribute::New(_) => "#[new]".fmt(f),
+            MethodTypeAttribute::ClassMethod(_) => "#[classmethod]".fmt(f),
+            MethodTypeAttribute::StaticMethod(_) => "#[staticmethod]".fmt(f),
+            MethodTypeAttribute::Getter(_, _) => "#[getter]".fmt(f),
+            MethodTypeAttribute::Setter(_, _) => "#[setter]".fmt(f),
+            MethodTypeAttribute::ClassAttribute(_) => "#[classattr]".fmt(f),
+        }
+    }
+}
+
+fn parse_method_attributes(
+    attrs: &mut Vec<syn::Attribute>,
+    deprecations: &mut Deprecations<'_>,
+) -> Result<Vec<MethodTypeAttribute>> {
+    let mut new_attrs = Vec::new();
+    let mut found_attrs = Vec::new();
+
+    for attr in attrs.drain(..) {
+        match MethodTypeAttribute::parse_if_matching_attribute(&attr, deprecations)? {
+            Some(attr) => found_attrs.push(attr),
+            None => new_attrs.push(attr),
+        }
+    }
+
+    *attrs = new_attrs;
+
+    Ok(found_attrs)
+}
+
+const IMPL_TRAIT_ERR: &str = "Python functions cannot have `impl Trait` arguments";
+const RECEIVER_BY_VALUE_ERR: &str =
+    "Python objects are shared, so 'self' cannot be moved out of the Python interpreter.
+Try `&self`, `&mut self, `slf: PyRef<'_, Self>` or `slf: PyRefMut<'_, Self>`.";
+
+fn ensure_signatures_on_valid_method(
+    fn_type: &FnType,
+    signature: Option<&SignatureAttribute>,
+    text_signature: Option<&TextSignatureAttribute>,
+) -> syn::Result<()> {
+    if let Some(signature) = signature {
+        match fn_type {
+            FnType::Getter(_) => {
+                debug_assert!(!fn_type.signature_attribute_allowed());
+                bail_spanned!(signature.kw.span() => "`signature` not allowed with `getter`")
+            }
+            FnType::Setter(_) => {
+                debug_assert!(!fn_type.signature_attribute_allowed());
+                bail_spanned!(signature.kw.span() => "`signature` not allowed with `setter`")
+            }
+            FnType::ClassAttribute => {
+                debug_assert!(!fn_type.signature_attribute_allowed());
+                bail_spanned!(signature.kw.span() => "`signature` not allowed with `classattr`")
+            }
+            _ => debug_assert!(fn_type.signature_attribute_allowed()),
+        }
+    }
+    if let Some(text_signature) = text_signature {
+        match fn_type {
+            FnType::Getter(_) => {
+                bail_spanned!(text_signature.kw.span() => "`text_signature` not allowed with `getter`")
+            }
+            FnType::Setter(_) => {
+                bail_spanned!(text_signature.kw.span() => "`text_signature` not allowed with `setter`")
+            }
+            FnType::ClassAttribute => {
+                bail_spanned!(text_signature.kw.span() => "`text_signature` not allowed with `classattr`")
+            }
+            _ => {}
+        }
+    }
+    Ok(())
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/src/module.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/module.rs
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/src/module.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/module.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,676 @@
+//! Code generation for the function that initializes a python module and adds classes and function.
+
+use crate::{
+    attributes::{
+        self, kw, take_attributes, take_pyo3_options, CrateAttribute, ModuleAttribute,
+        NameAttribute, SubmoduleAttribute,
+    },
+    get_doc,
+    pyclass::PyClassPyO3Option,
+    pyfunction::{impl_wrap_pyfunction, PyFunctionOptions},
+    utils::{Ctx, LitCStr, PyO3CratePath},
+};
+use proc_macro2::{Span, TokenStream};
+use quote::quote;
+use std::ffi::CString;
+use syn::{
+    ext::IdentExt,
+    parse::{Parse, ParseStream},
+    parse_quote, parse_quote_spanned,
+    punctuated::Punctuated,
+    spanned::Spanned,
+    token::Comma,
+    Item, Meta, Path, Result,
+};
+
+#[derive(Default)]
+pub struct PyModuleOptions {
+    krate: Option<CrateAttribute>,
+    name: Option<NameAttribute>,
+    module: Option<ModuleAttribute>,
+    submodule: Option<kw::submodule>,
+}
+
+impl Parse for PyModuleOptions {
+    fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
+        let mut options: PyModuleOptions = Default::default();
+
+        options.add_attributes(
+            Punctuated::<PyModulePyO3Option, syn::Token![,]>::parse_terminated(input)?,
+        )?;
+
+        Ok(options)
+    }
+}
+
+impl PyModuleOptions {
+    fn take_pyo3_options(&mut self, attrs: &mut Vec<syn::Attribute>) -> Result<()> {
+        self.add_attributes(take_pyo3_options(attrs)?)
+    }
+
+    fn add_attributes(
+        &mut self,
+        attrs: impl IntoIterator<Item = PyModulePyO3Option>,
+    ) -> Result<()> {
+        macro_rules! set_option {
+            ($key:ident) => {
+                {
+                    ensure_spanned!(
+                        self.$key.is_none(),
+                        $key.span() => concat!("`", stringify!($key), "` may only be specified once")
+                    );
+                    self.$key = Some($key);
+                }
+            };
+        }
+        for attr in attrs {
+            match attr {
+                PyModulePyO3Option::Crate(krate) => set_option!(krate),
+                PyModulePyO3Option::Name(name) => set_option!(name),
+                PyModulePyO3Option::Module(module) => set_option!(module),
+                PyModulePyO3Option::Submodule(submodule) => set_option!(submodule),
+            }
+        }
+        Ok(())
+    }
+}
+
+pub fn pymodule_module_impl(
+    module: &mut syn::ItemMod,
+    mut options: PyModuleOptions,
+) -> Result<TokenStream> {
+    let syn::ItemMod {
+        attrs,
+        vis,
+        unsafety: _,
+        ident,
+        mod_token,
+        content,
+        semi: _,
+    } = module;
+    let items = if let Some((_, items)) = content {
+        items
+    } else {
+        bail_spanned!(mod_token.span() => "`#[pymodule]` can only be used on inline modules")
+    };
+    options.take_pyo3_options(attrs)?;
+    let ctx = &Ctx::new(&options.krate, None);
+    let Ctx { pyo3_path, .. } = ctx;
+    let doc = get_doc(attrs, None, ctx);
+    let name = options
+        .name
+        .map_or_else(|| ident.unraw(), |name| name.value.0);
+    let full_name = if let Some(module) = &options.module {
+        format!("{}.{}", module.value.value(), name)
+    } else {
+        name.to_string()
+    };
+
+    let mut module_items = Vec::new();
+    let mut module_items_cfg_attrs = Vec::new();
+
+    fn extract_use_items(
+        source: &syn::UseTree,
+        cfg_attrs: &[syn::Attribute],
+        target_items: &mut Vec<syn::Ident>,
+        target_cfg_attrs: &mut Vec<Vec<syn::Attribute>>,
+    ) -> Result<()> {
+        match source {
+            syn::UseTree::Name(name) => {
+                target_items.push(name.ident.clone());
+                target_cfg_attrs.push(cfg_attrs.to_vec());
+            }
+            syn::UseTree::Path(path) => {
+                extract_use_items(&path.tree, cfg_attrs, target_items, target_cfg_attrs)?
+            }
+            syn::UseTree::Group(group) => {
+                for tree in &group.items {
+                    extract_use_items(tree, cfg_attrs, target_items, target_cfg_attrs)?
+                }
+            }
+            syn::UseTree::Glob(glob) => {
+                bail_spanned!(glob.span() => "#[pymodule] cannot import glob statements")
+            }
+            syn::UseTree::Rename(rename) => {
+                target_items.push(rename.rename.clone());
+                target_cfg_attrs.push(cfg_attrs.to_vec());
+            }
+        }
+        Ok(())
+    }
+
+    let mut pymodule_init = None;
+
+    for item in &mut *items {
+        match item {
+            Item::Use(item_use) => {
+                let is_pymodule_export =
+                    find_and_remove_attribute(&mut item_use.attrs, "pymodule_export");
+                if is_pymodule_export {
+                    let cfg_attrs = get_cfg_attributes(&item_use.attrs);
+                    extract_use_items(
+                        &item_use.tree,
+                        &cfg_attrs,
+                        &mut module_items,
+                        &mut module_items_cfg_attrs,
+                    )?;
+                }
+            }
+            Item::Fn(item_fn) => {
+                ensure_spanned!(
+                    !has_attribute(&item_fn.attrs, "pymodule_export"),
+                    item.span() => "`#[pymodule_export]` may only be used on `use` statements"
+                );
+                let is_pymodule_init =
+                    find_and_remove_attribute(&mut item_fn.attrs, "pymodule_init");
+                let ident = &item_fn.sig.ident;
+                if is_pymodule_init {
+                    ensure_spanned!(
+                        !has_attribute(&item_fn.attrs, "pyfunction"),
+                        item_fn.span() => "`#[pyfunction]` cannot be used alongside `#[pymodule_init]`"
+                    );
+                    ensure_spanned!(pymodule_init.is_none(), item_fn.span() => "only one `#[pymodule_init]` may be specified");
+                    pymodule_init = Some(quote! { #ident(module)?; });
+                } else if has_attribute(&item_fn.attrs, "pyfunction")
+                    || has_attribute_with_namespace(
+                        &item_fn.attrs,
+                        Some(pyo3_path),
+                        &["pyfunction"],
+                    )
+                    || has_attribute_with_namespace(
+                        &item_fn.attrs,
+                        Some(pyo3_path),
+                        &["prelude", "pyfunction"],
+                    )
+                {
+                    module_items.push(ident.clone());
+                    module_items_cfg_attrs.push(get_cfg_attributes(&item_fn.attrs));
+                }
+            }
+            Item::Struct(item_struct) => {
+                ensure_spanned!(
+                    !has_attribute(&item_struct.attrs, "pymodule_export"),
+                    item.span() => "`#[pymodule_export]` may only be used on `use` statements"
+                );
+                if has_attribute(&item_struct.attrs, "pyclass")
+                    || has_attribute_with_namespace(
+                        &item_struct.attrs,
+                        Some(pyo3_path),
+                        &["pyclass"],
+                    )
+                    || has_attribute_with_namespace(
+                        &item_struct.attrs,
+                        Some(pyo3_path),
+                        &["prelude", "pyclass"],
+                    )
+                {
+                    module_items.push(item_struct.ident.clone());
+                    module_items_cfg_attrs.push(get_cfg_attributes(&item_struct.attrs));
+                    if !has_pyo3_module_declared::<PyClassPyO3Option>(
+                        &item_struct.attrs,
+                        "pyclass",
+                        |option| matches!(option, PyClassPyO3Option::Module(_)),
+                    )? {
+                        set_module_attribute(&mut item_struct.attrs, &full_name);
+                    }
+                }
+            }
+            Item::Enum(item_enum) => {
+                ensure_spanned!(
+                    !has_attribute(&item_enum.attrs, "pymodule_export"),
+                    item.span() => "`#[pymodule_export]` may only be used on `use` statements"
+                );
+                if has_attribute(&item_enum.attrs, "pyclass")
+                    || has_attribute_with_namespace(&item_enum.attrs, Some(pyo3_path), &["pyclass"])
+                    || has_attribute_with_namespace(
+                        &item_enum.attrs,
+                        Some(pyo3_path),
+                        &["prelude", "pyclass"],
+                    )
+                {
+                    module_items.push(item_enum.ident.clone());
+                    module_items_cfg_attrs.push(get_cfg_attributes(&item_enum.attrs));
+                    if !has_pyo3_module_declared::<PyClassPyO3Option>(
+                        &item_enum.attrs,
+                        "pyclass",
+                        |option| matches!(option, PyClassPyO3Option::Module(_)),
+                    )? {
+                        set_module_attribute(&mut item_enum.attrs, &full_name);
+                    }
+                }
+            }
+            Item::Mod(item_mod) => {
+                ensure_spanned!(
+                    !has_attribute(&item_mod.attrs, "pymodule_export"),
+                    item.span() => "`#[pymodule_export]` may only be used on `use` statements"
+                );
+                if has_attribute(&item_mod.attrs, "pymodule")
+                    || has_attribute_with_namespace(&item_mod.attrs, Some(pyo3_path), &["pymodule"])
+                    || has_attribute_with_namespace(
+                        &item_mod.attrs,
+                        Some(pyo3_path),
+                        &["prelude", "pymodule"],
+                    )
+                {
+                    module_items.push(item_mod.ident.clone());
+                    module_items_cfg_attrs.push(get_cfg_attributes(&item_mod.attrs));
+                    if !has_pyo3_module_declared::<PyModulePyO3Option>(
+                        &item_mod.attrs,
+                        "pymodule",
+                        |option| matches!(option, PyModulePyO3Option::Module(_)),
+                    )? {
+                        set_module_attribute(&mut item_mod.attrs, &full_name);
+                    }
+                }
+            }
+            Item::ForeignMod(item) => {
+                ensure_spanned!(
+                    !has_attribute(&item.attrs, "pymodule_export"),
+                    item.span() => "`#[pymodule_export]` may only be used on `use` statements"
+                );
+            }
+            Item::Trait(item) => {
+                ensure_spanned!(
+                    !has_attribute(&item.attrs, "pymodule_export"),
+                    item.span() => "`#[pymodule_export]` may only be used on `use` statements"
+                );
+            }
+            Item::Const(item) => {
+                ensure_spanned!(
+                    !has_attribute(&item.attrs, "pymodule_export"),
+                    item.span() => "`#[pymodule_export]` may only be used on `use` statements"
+                );
+            }
+            Item::Static(item) => {
+                ensure_spanned!(
+                    !has_attribute(&item.attrs, "pymodule_export"),
+                    item.span() => "`#[pymodule_export]` may only be used on `use` statements"
+                );
+            }
+            Item::Macro(item) => {
+                ensure_spanned!(
+                    !has_attribute(&item.attrs, "pymodule_export"),
+                    item.span() => "`#[pymodule_export]` may only be used on `use` statements"
+                );
+            }
+            Item::ExternCrate(item) => {
+                ensure_spanned!(
+                    !has_attribute(&item.attrs, "pymodule_export"),
+                    item.span() => "`#[pymodule_export]` may only be used on `use` statements"
+                );
+            }
+            Item::Impl(item) => {
+                ensure_spanned!(
+                    !has_attribute(&item.attrs, "pymodule_export"),
+                    item.span() => "`#[pymodule_export]` may only be used on `use` statements"
+                );
+            }
+            Item::TraitAlias(item) => {
+                ensure_spanned!(
+                    !has_attribute(&item.attrs, "pymodule_export"),
+                    item.span() => "`#[pymodule_export]` may only be used on `use` statements"
+                );
+            }
+            Item::Type(item) => {
+                ensure_spanned!(
+                    !has_attribute(&item.attrs, "pymodule_export"),
+                    item.span() => "`#[pymodule_export]` may only be used on `use` statements"
+                );
+            }
+            Item::Union(item) => {
+                ensure_spanned!(
+                    !has_attribute(&item.attrs, "pymodule_export"),
+                    item.span() => "`#[pymodule_export]` may only be used on `use` statements"
+                );
+            }
+            _ => (),
+        }
+    }
+
+    let module_def = quote! {{
+        use #pyo3_path::impl_::pymodule as impl_;
+        const INITIALIZER: impl_::ModuleInitializer = impl_::ModuleInitializer(__pyo3_pymodule);
+        unsafe {
+           impl_::ModuleDef::new(
+                __PYO3_NAME,
+                #doc,
+                INITIALIZER
+            )
+        }
+    }};
+    let initialization = module_initialization(&name, ctx, module_def, options.submodule.is_some());
+
+    Ok(quote!(
+        #(#attrs)*
+        #vis #mod_token #ident {
+            #(#items)*
+
+            #initialization
+
+            fn __pyo3_pymodule(module: &#pyo3_path::Bound<'_, #pyo3_path::types::PyModule>) -> #pyo3_path::PyResult<()> {
+                use #pyo3_path::impl_::pymodule::PyAddToModule;
+                #(
+                    #(#module_items_cfg_attrs)*
+                    #module_items::_PYO3_DEF.add_to_module(module)?;
+                )*
+                #pymodule_init
+                Ok(())
+            }
+        }
+    ))
+}
+
+/// Generates the function that is called by the python interpreter to initialize the native
+/// module
+pub fn pymodule_function_impl(
+    function: &mut syn::ItemFn,
+    mut options: PyModuleOptions,
+) -> Result<TokenStream> {
+    options.take_pyo3_options(&mut function.attrs)?;
+    process_functions_in_module(&options, function)?;
+    let ctx = &Ctx::new(&options.krate, None);
+    let stmts = std::mem::take(&mut function.block.stmts);
+    let Ctx { pyo3_path, .. } = ctx;
+    let ident = &function.sig.ident;
+    let name = options
+        .name
+        .map_or_else(|| ident.unraw(), |name| name.value.0);
+    let vis = &function.vis;
+    let doc = get_doc(&function.attrs, None, ctx);
+
+    let initialization = module_initialization(&name, ctx, quote! { MakeDef::make_def() }, false);
+
+    // Module function called with optional Python<'_> marker as first arg, followed by the module.
+    let mut module_args = Vec::new();
+    if function.sig.inputs.len() == 2 {
+        module_args.push(quote!(module.py()));
+    }
+    module_args
+        .push(quote!(::std::convert::Into::into(#pyo3_path::impl_::pymethods::BoundRef(module))));
+
+    let extractors = function
+        .sig
+        .inputs
+        .iter()
+        .filter_map(|param| {
+            if let syn::FnArg::Typed(pat_type) = param {
+                if let syn::Pat::Ident(pat_ident) = &*pat_type.pat {
+                    let ident: &syn::Ident = &pat_ident.ident;
+                    return Some([
+                        parse_quote!{ let check_gil_refs = #pyo3_path::impl_::deprecations::GilRefs::new(); },
+                        parse_quote! { let #ident = #pyo3_path::impl_::deprecations::inspect_type(#ident, &check_gil_refs); },
+                        parse_quote_spanned! { pat_type.span() => check_gil_refs.function_arg(); },
+                    ]);
+                }
+            }
+            None
+        })
+        .flatten();
+
+    function.block.stmts = extractors.chain(stmts).collect();
+    function
+        .attrs
+        .push(parse_quote!(#[allow(clippy::used_underscore_binding)]));
+
+    Ok(quote! {
+        #[doc(hidden)]
+        #vis mod #ident {
+            #initialization
+        }
+
+        // Generate the definition inside an anonymous function in the same scope as the original function -
+        // this avoids complications around the fact that the generated module has a different scope
+        // (and `super` doesn't always refer to the outer scope, e.g. if the `#[pymodule] is
+        // inside a function body)
+        #[allow(unknown_lints, non_local_definitions)]
+        impl #ident::MakeDef {
+            const fn make_def() -> #pyo3_path::impl_::pymodule::ModuleDef {
+                fn __pyo3_pymodule(module: &#pyo3_path::Bound<'_, #pyo3_path::types::PyModule>) -> #pyo3_path::PyResult<()> {
+                    #ident(#(#module_args),*)
+                }
+
+                const INITIALIZER: #pyo3_path::impl_::pymodule::ModuleInitializer = #pyo3_path::impl_::pymodule::ModuleInitializer(__pyo3_pymodule);
+                unsafe {
+                    #pyo3_path::impl_::pymodule::ModuleDef::new(
+                        #ident::__PYO3_NAME,
+                        #doc,
+                        INITIALIZER
+                    )
+                }
+            }
+        }
+    })
+}
+
+fn module_initialization(
+    name: &syn::Ident,
+    ctx: &Ctx,
+    module_def: TokenStream,
+    is_submodule: bool,
+) -> TokenStream {
+    let Ctx { pyo3_path, .. } = ctx;
+    let pyinit_symbol = format!("PyInit_{}", name);
+    let name = name.to_string();
+    let pyo3_name = LitCStr::new(CString::new(name).unwrap(), Span::call_site(), ctx);
+
+    let mut result = quote! {
+        #[doc(hidden)]
+        pub const __PYO3_NAME: &'static ::std::ffi::CStr = #pyo3_name;
+
+        pub(super) struct MakeDef;
+        #[doc(hidden)]
+        pub static _PYO3_DEF: #pyo3_path::impl_::pymodule::ModuleDef = #module_def;
+    };
+    if !is_submodule {
+        result.extend(quote! {
+            /// This autogenerated function is called by the python interpreter when importing
+            /// the module.
+            #[doc(hidden)]
+            #[export_name = #pyinit_symbol]
+            pub unsafe extern "C" fn __pyo3_init() -> *mut #pyo3_path::ffi::PyObject {
+                #pyo3_path::impl_::trampoline::module_init(|py| _PYO3_DEF.make_module(py))
+            }
+        });
+    }
+    result
+}
+
+/// Finds and takes care of the #[pyfn(...)] in `#[pymodule]`
+fn process_functions_in_module(options: &PyModuleOptions, func: &mut syn::ItemFn) -> Result<()> {
+    let ctx = &Ctx::new(&options.krate, None);
+    let Ctx { pyo3_path, .. } = ctx;
+    let mut stmts: Vec<syn::Stmt> = Vec::new();
+
+    #[cfg(feature = "gil-refs")]
+    let imports = quote!(use #pyo3_path::{PyNativeType, types::PyModuleMethods};);
+    #[cfg(not(feature = "gil-refs"))]
+    let imports = quote!(use #pyo3_path::types::PyModuleMethods;);
+
+    for mut stmt in func.block.stmts.drain(..) {
+        if let syn::Stmt::Item(Item::Fn(func)) = &mut stmt {
+            if let Some(pyfn_args) = get_pyfn_attr(&mut func.attrs)? {
+                let module_name = pyfn_args.modname;
+                let wrapped_function = impl_wrap_pyfunction(func, pyfn_args.options)?;
+                let name = &func.sig.ident;
+                let statements: Vec<syn::Stmt> = syn::parse_quote! {
+                    #wrapped_function
+                    {
+                        #[allow(unknown_lints, unused_imports, redundant_imports)]
+                        #imports
+                        #module_name.as_borrowed().add_function(#pyo3_path::wrap_pyfunction!(#name, #module_name.as_borrowed())?)?;
+                    }
+                };
+                stmts.extend(statements);
+            }
+        };
+        stmts.push(stmt);
+    }
+
+    func.block.stmts = stmts;
+    Ok(())
+}
+
+pub struct PyFnArgs {
+    modname: Path,
+    options: PyFunctionOptions,
+}
+
+impl Parse for PyFnArgs {
+    fn parse(input: syn::parse::ParseStream<'_>) -> syn::Result<Self> {
+        let modname = input.parse().map_err(
+            |e| err_spanned!(e.span() => "expected module as first argument to #[pyfn()]"),
+        )?;
+
+        if input.is_empty() {
+            return Ok(Self {
+                modname,
+                options: Default::default(),
+            });
+        }
+
+        let _: Comma = input.parse()?;
+
+        Ok(Self {
+            modname,
+            options: input.parse()?,
+        })
+    }
+}
+
+/// Extracts the data from the #[pyfn(...)] attribute of a function
+fn get_pyfn_attr(attrs: &mut Vec<syn::Attribute>) -> syn::Result<Option<PyFnArgs>> {
+    let mut pyfn_args: Option<PyFnArgs> = None;
+
+    take_attributes(attrs, |attr| {
+        if attr.path().is_ident("pyfn") {
+            ensure_spanned!(
+                pyfn_args.is_none(),
+                attr.span() => "`#[pyfn] may only be specified once"
+            );
+            pyfn_args = Some(attr.parse_args()?);
+            Ok(true)
+        } else {
+            Ok(false)
+        }
+    })?;
+
+    if let Some(pyfn_args) = &mut pyfn_args {
+        pyfn_args
+            .options
+            .add_attributes(take_pyo3_options(attrs)?)?;
+    }
+
+    Ok(pyfn_args)
+}
+
+fn get_cfg_attributes(attrs: &[syn::Attribute]) -> Vec<syn::Attribute> {
+    attrs
+        .iter()
+        .filter(|attr| attr.path().is_ident("cfg"))
+        .cloned()
+        .collect()
+}
+
+fn find_and_remove_attribute(attrs: &mut Vec<syn::Attribute>, ident: &str) -> bool {
+    let mut found = false;
+    attrs.retain(|attr| {
+        if attr.path().is_ident(ident) {
+            found = true;
+            false
+        } else {
+            true
+        }
+    });
+    found
+}
+
+enum IdentOrStr<'a> {
+    Str(&'a str),
+    Ident(syn::Ident),
+}
+
+impl<'a> PartialEq<syn::Ident> for IdentOrStr<'a> {
+    fn eq(&self, other: &syn::Ident) -> bool {
+        match self {
+            IdentOrStr::Str(s) => other == s,
+            IdentOrStr::Ident(i) => other == i,
+        }
+    }
+}
+fn has_attribute(attrs: &[syn::Attribute], ident: &str) -> bool {
+    has_attribute_with_namespace(attrs, None, &[ident])
+}
+
+fn has_attribute_with_namespace(
+    attrs: &[syn::Attribute],
+    crate_path: Option<&PyO3CratePath>,
+    idents: &[&str],
+) -> bool {
+    let mut segments = vec![];
+    if let Some(c) = crate_path {
+        match c {
+            PyO3CratePath::Given(paths) => {
+                for p in &paths.segments {
+                    segments.push(IdentOrStr::Ident(p.ident.clone()));
+                }
+            }
+            PyO3CratePath::Default => segments.push(IdentOrStr::Str("pyo3")),
+        }
+    };
+    for i in idents {
+        segments.push(IdentOrStr::Str(i));
+    }
+
+    attrs.iter().any(|attr| {
+        segments
+            .iter()
+            .eq(attr.path().segments.iter().map(|v| &v.ident))
+    })
+}
+
+fn set_module_attribute(attrs: &mut Vec<syn::Attribute>, module_name: &str) {
+    attrs.push(parse_quote!(#[pyo3(module = #module_name)]));
+}
+
+fn has_pyo3_module_declared<T: Parse>(
+    attrs: &[syn::Attribute],
+    root_attribute_name: &str,
+    is_module_option: impl Fn(&T) -> bool + Copy,
+) -> Result<bool> {
+    for attr in attrs {
+        if (attr.path().is_ident("pyo3") || attr.path().is_ident(root_attribute_name))
+            && matches!(attr.meta, Meta::List(_))
+        {
+            for option in &attr.parse_args_with(Punctuated::<T, Comma>::parse_terminated)? {
+                if is_module_option(option) {
+                    return Ok(true);
+                }
+            }
+        }
+    }
+    Ok(false)
+}
+
+enum PyModulePyO3Option {
+    Submodule(SubmoduleAttribute),
+    Crate(CrateAttribute),
+    Name(NameAttribute),
+    Module(ModuleAttribute),
+}
+
+impl Parse for PyModulePyO3Option {
+    fn parse(input: ParseStream<'_>) -> Result<Self> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(attributes::kw::name) {
+            input.parse().map(PyModulePyO3Option::Name)
+        } else if lookahead.peek(syn::Token![crate]) {
+            input.parse().map(PyModulePyO3Option::Crate)
+        } else if lookahead.peek(attributes::kw::module) {
+            input.parse().map(PyModulePyO3Option::Module)
+        } else if lookahead.peek(attributes::kw::submodule) {
+            input.parse().map(PyModulePyO3Option::Submodule)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/src/params.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/params.rs
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/src/params.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/params.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,372 @@
+use crate::utils::Ctx;
+use crate::{
+    method::{FnArg, FnSpec, RegularArg},
+    pyfunction::FunctionSignature,
+    quotes::some_wrap,
+};
+use proc_macro2::{Span, TokenStream};
+use quote::{format_ident, quote, quote_spanned};
+use syn::spanned::Spanned;
+
+pub struct Holders {
+    holders: Vec<syn::Ident>,
+    gil_refs_checkers: Vec<GilRefChecker>,
+}
+
+impl Holders {
+    pub fn new() -> Self {
+        Holders {
+            holders: Vec::new(),
+            gil_refs_checkers: Vec::new(),
+        }
+    }
+
+    pub fn push_holder(&mut self, span: Span) -> syn::Ident {
+        let holder = syn::Ident::new(&format!("holder_{}", self.holders.len()), span);
+        self.holders.push(holder.clone());
+        holder
+    }
+
+    pub fn push_gil_refs_checker(&mut self, span: Span) -> syn::Ident {
+        let gil_refs_checker = syn::Ident::new(
+            &format!("gil_refs_checker_{}", self.gil_refs_checkers.len()),
+            span,
+        );
+        self.gil_refs_checkers
+            .push(GilRefChecker::FunctionArg(gil_refs_checker.clone()));
+        gil_refs_checker
+    }
+
+    pub fn push_from_py_with_checker(&mut self, span: Span) -> syn::Ident {
+        let gil_refs_checker = syn::Ident::new(
+            &format!("gil_refs_checker_{}", self.gil_refs_checkers.len()),
+            span,
+        );
+        self.gil_refs_checkers
+            .push(GilRefChecker::FromPyWith(gil_refs_checker.clone()));
+        gil_refs_checker
+    }
+
+    pub fn init_holders(&self, ctx: &Ctx) -> TokenStream {
+        let Ctx { pyo3_path, .. } = ctx;
+        let holders = &self.holders;
+        let gil_refs_checkers = self.gil_refs_checkers.iter().map(|checker| match checker {
+            GilRefChecker::FunctionArg(ident) => ident,
+            GilRefChecker::FromPyWith(ident) => ident,
+        });
+        quote! {
+            #[allow(clippy::let_unit_value)]
+            #(let mut #holders = #pyo3_path::impl_::extract_argument::FunctionArgumentHolder::INIT;)*
+            #(let #gil_refs_checkers = #pyo3_path::impl_::deprecations::GilRefs::new();)*
+        }
+    }
+
+    pub fn check_gil_refs(&self) -> TokenStream {
+        self.gil_refs_checkers
+            .iter()
+            .map(|checker| match checker {
+                GilRefChecker::FunctionArg(ident) => {
+                    quote_spanned! { ident.span() => #ident.function_arg(); }
+                }
+                GilRefChecker::FromPyWith(ident) => {
+                    quote_spanned! { ident.span() => #ident.from_py_with_arg(); }
+                }
+            })
+            .collect()
+    }
+}
+
+enum GilRefChecker {
+    FunctionArg(syn::Ident),
+    FromPyWith(syn::Ident),
+}
+
+/// Return true if the argument list is simply (*args, **kwds).
+pub fn is_forwarded_args(signature: &FunctionSignature<'_>) -> bool {
+    matches!(
+        signature.arguments.as_slice(),
+        [FnArg::VarArgs(..), FnArg::KwArgs(..),]
+    )
+}
+
+pub(crate) fn check_arg_for_gil_refs(
+    tokens: TokenStream,
+    gil_refs_checker: syn::Ident,
+    ctx: &Ctx,
+) -> TokenStream {
+    let Ctx { pyo3_path, .. } = ctx;
+    quote! {
+        #pyo3_path::impl_::deprecations::inspect_type(#tokens, &#gil_refs_checker)
+    }
+}
+
+pub fn impl_arg_params(
+    spec: &FnSpec<'_>,
+    self_: Option<&syn::Type>,
+    fastcall: bool,
+    holders: &mut Holders,
+    ctx: &Ctx,
+) -> (TokenStream, Vec<TokenStream>) {
+    let args_array = syn::Ident::new("output", Span::call_site());
+    let Ctx { pyo3_path, .. } = ctx;
+
+    let from_py_with = spec
+        .signature
+        .arguments
+        .iter()
+        .enumerate()
+        .filter_map(|(i, arg)| {
+            let from_py_with = &arg.from_py_with()?.value;
+            let from_py_with_holder = format_ident!("from_py_with_{}", i);
+            Some(quote_spanned! { from_py_with.span() =>
+                let e = #pyo3_path::impl_::deprecations::GilRefs::new();
+                let #from_py_with_holder = #pyo3_path::impl_::deprecations::inspect_fn(#from_py_with, &e);
+                e.from_py_with_arg();
+            })
+        })
+        .collect::<TokenStream>();
+
+    if !fastcall && is_forwarded_args(&spec.signature) {
+        // In the varargs convention, we can just pass though if the signature
+        // is (*args, **kwds).
+        let arg_convert = spec
+            .signature
+            .arguments
+            .iter()
+            .enumerate()
+            .map(|(i, arg)| impl_arg_param(arg, i, &mut 0, holders, ctx))
+            .collect();
+        return (
+            quote! {
+                let _args = #pyo3_path::impl_::pymethods::BoundRef::ref_from_ptr(py, &_args);
+                let _kwargs = #pyo3_path::impl_::pymethods::BoundRef::ref_from_ptr_or_opt(py, &_kwargs);
+                #from_py_with
+            },
+            arg_convert,
+        );
+    };
+
+    let positional_parameter_names = &spec.signature.python_signature.positional_parameters;
+    let positional_only_parameters = &spec.signature.python_signature.positional_only_parameters;
+    let required_positional_parameters = &spec
+        .signature
+        .python_signature
+        .required_positional_parameters;
+    let keyword_only_parameters = spec
+        .signature
+        .python_signature
+        .keyword_only_parameters
+        .iter()
+        .map(|(name, required)| {
+            quote! {
+                #pyo3_path::impl_::extract_argument::KeywordOnlyParameterDescription {
+                    name: #name,
+                    required: #required,
+                }
+            }
+        });
+
+    let num_params = positional_parameter_names.len() + keyword_only_parameters.len();
+
+    let mut option_pos = 0usize;
+    let param_conversion = spec
+        .signature
+        .arguments
+        .iter()
+        .enumerate()
+        .map(|(i, arg)| impl_arg_param(arg, i, &mut option_pos, holders, ctx))
+        .collect();
+
+    let args_handler = if spec.signature.python_signature.varargs.is_some() {
+        quote! { #pyo3_path::impl_::extract_argument::TupleVarargs }
+    } else {
+        quote! { #pyo3_path::impl_::extract_argument::NoVarargs }
+    };
+    let kwargs_handler = if spec.signature.python_signature.kwargs.is_some() {
+        quote! { #pyo3_path::impl_::extract_argument::DictVarkeywords }
+    } else {
+        quote! { #pyo3_path::impl_::extract_argument::NoVarkeywords }
+    };
+
+    let cls_name = if let Some(cls) = self_ {
+        quote! { ::std::option::Option::Some(<#cls as #pyo3_path::type_object::PyTypeInfo>::NAME) }
+    } else {
+        quote! { ::std::option::Option::None }
+    };
+    let python_name = &spec.python_name;
+
+    let extract_expression = if fastcall {
+        quote! {
+            DESCRIPTION.extract_arguments_fastcall::<#args_handler, #kwargs_handler>(
+                py,
+                _args,
+                _nargs,
+                _kwnames,
+                &mut #args_array
+            )?
+        }
+    } else {
+        quote! {
+            DESCRIPTION.extract_arguments_tuple_dict::<#args_handler, #kwargs_handler>(
+                py,
+                _args,
+                _kwargs,
+                &mut #args_array
+            )?
+        }
+    };
+
+    // create array of arguments, and then parse
+    (
+        quote! {
+                const DESCRIPTION: #pyo3_path::impl_::extract_argument::FunctionDescription = #pyo3_path::impl_::extract_argument::FunctionDescription {
+                    cls_name: #cls_name,
+                    func_name: stringify!(#python_name),
+                    positional_parameter_names: &[#(#positional_parameter_names),*],
+                    positional_only_parameters: #positional_only_parameters,
+                    required_positional_parameters: #required_positional_parameters,
+                    keyword_only_parameters: &[#(#keyword_only_parameters),*],
+                };
+                let mut #args_array = [::std::option::Option::None; #num_params];
+                let (_args, _kwargs) = #extract_expression;
+                #from_py_with
+        },
+        param_conversion,
+    )
+}
+
+fn impl_arg_param(
+    arg: &FnArg<'_>,
+    pos: usize,
+    option_pos: &mut usize,
+    holders: &mut Holders,
+    ctx: &Ctx,
+) -> TokenStream {
+    let Ctx { pyo3_path, .. } = ctx;
+    let args_array = syn::Ident::new("output", Span::call_site());
+
+    match arg {
+        FnArg::Regular(arg) => {
+            let from_py_with = format_ident!("from_py_with_{}", pos);
+            let arg_value = quote!(#args_array[#option_pos].as_deref());
+            *option_pos += 1;
+            let tokens = impl_regular_arg_param(arg, from_py_with, arg_value, holders, ctx);
+            check_arg_for_gil_refs(tokens, holders.push_gil_refs_checker(arg.ty.span()), ctx)
+        }
+        FnArg::VarArgs(arg) => {
+            let holder = holders.push_holder(arg.name.span());
+            let name_str = arg.name.to_string();
+            quote_spanned! { arg.name.span() =>
+                #pyo3_path::impl_::extract_argument::extract_argument(
+                    &_args,
+                    &mut #holder,
+                    #name_str
+                )?
+            }
+        }
+        FnArg::KwArgs(arg) => {
+            let holder = holders.push_holder(arg.name.span());
+            let name_str = arg.name.to_string();
+            quote_spanned! { arg.name.span() =>
+                #pyo3_path::impl_::extract_argument::extract_optional_argument(
+                    _kwargs.as_deref(),
+                    &mut #holder,
+                    #name_str,
+                    || ::std::option::Option::None
+                )?
+            }
+        }
+        FnArg::Py(..) => quote! { py },
+        FnArg::CancelHandle(..) => quote! { __cancel_handle },
+    }
+}
+
+/// Re option_pos: The option slice doesn't contain the py: Python argument, so the argument
+/// index and the index in option diverge when using py: Python
+pub(crate) fn impl_regular_arg_param(
+    arg: &RegularArg<'_>,
+    from_py_with: syn::Ident,
+    arg_value: TokenStream, // expected type: Option<&'a Bound<'py, PyAny>>
+    holders: &mut Holders,
+    ctx: &Ctx,
+) -> TokenStream {
+    let Ctx { pyo3_path, .. } = ctx;
+    let pyo3_path = pyo3_path.to_tokens_spanned(arg.ty.span());
+
+    // Use this macro inside this function, to ensure that all code generated here is associated
+    // with the function argument
+    macro_rules! quote_arg_span {
+        ($($tokens:tt)*) => { quote_spanned!(arg.ty.span() => $($tokens)*) }
+    }
+
+    let name_str = arg.name.to_string();
+    let mut default = arg.default_value.as_ref().map(|expr| quote!(#expr));
+
+    // Option<T> arguments have special treatment: the default should be specified _without_ the
+    // Some() wrapper. Maybe this should be changed in future?!
+    if arg.option_wrapped_type.is_some() {
+        default = Some(default.map_or_else(
+            || quote!(::std::option::Option::None),
+            |tokens| some_wrap(tokens, ctx),
+        ));
+    }
+
+    if arg.from_py_with.is_some() {
+        if let Some(default) = default {
+            quote_arg_span! {
+                #pyo3_path::impl_::extract_argument::from_py_with_with_default(
+                    #arg_value,
+                    #name_str,
+                    #from_py_with as fn(_) -> _,
+                    #[allow(clippy::redundant_closure)]
+                    {
+                        || #default
+                    }
+                )?
+            }
+        } else {
+            quote_arg_span! {
+                #pyo3_path::impl_::extract_argument::from_py_with(
+                    #pyo3_path::impl_::extract_argument::unwrap_required_argument(#arg_value),
+                    #name_str,
+                    #from_py_with as fn(_) -> _,
+                )?
+            }
+        }
+    } else if arg.option_wrapped_type.is_some() {
+        let holder = holders.push_holder(arg.name.span());
+        quote_arg_span! {
+            #pyo3_path::impl_::extract_argument::extract_optional_argument(
+                #arg_value,
+                &mut #holder,
+                #name_str,
+                #[allow(clippy::redundant_closure)]
+                {
+                    || #default
+                }
+            )?
+        }
+    } else if let Some(default) = default {
+        let holder = holders.push_holder(arg.name.span());
+        quote_arg_span! {
+            #pyo3_path::impl_::extract_argument::extract_argument_with_default(
+                #arg_value,
+                &mut #holder,
+                #name_str,
+                #[allow(clippy::redundant_closure)]
+                {
+                    || #default
+                }
+            )?
+        }
+    } else {
+        let holder = holders.push_holder(arg.name.span());
+        quote_arg_span! {
+            #pyo3_path::impl_::extract_argument::extract_argument(
+                #pyo3_path::impl_::extract_argument::unwrap_required_argument(#arg_value),
+                &mut #holder,
+                #name_str
+            )?
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/src/pyclass.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/pyclass.rs
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/src/pyclass.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/pyclass.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,2288 @@
+use std::borrow::Cow;
+
+use proc_macro2::{Ident, Span, TokenStream};
+use quote::{format_ident, quote, quote_spanned, ToTokens};
+use syn::ext::IdentExt;
+use syn::parse::{Parse, ParseStream};
+use syn::punctuated::Punctuated;
+use syn::{parse_quote, parse_quote_spanned, spanned::Spanned, Result, Token};
+
+use crate::attributes::kw::frozen;
+use crate::attributes::{
+    self, kw, take_pyo3_options, CrateAttribute, ExtendsAttribute, FreelistAttribute,
+    ModuleAttribute, NameAttribute, NameLitStr, RenameAllAttribute,
+};
+use crate::deprecations::Deprecations;
+use crate::konst::{ConstAttributes, ConstSpec};
+use crate::method::{FnArg, FnSpec, PyArg, RegularArg};
+use crate::pyfunction::ConstructorAttribute;
+use crate::pyimpl::{gen_py_const, PyClassMethodsType};
+use crate::pymethod::{
+    impl_py_getter_def, impl_py_setter_def, MethodAndMethodDef, MethodAndSlotDef, PropertyType,
+    SlotDef, __GETITEM__, __HASH__, __INT__, __LEN__, __REPR__, __RICHCMP__,
+};
+use crate::pyversions;
+use crate::utils::{self, apply_renaming_rule, LitCStr, PythonDoc};
+use crate::utils::{is_abi3, Ctx};
+use crate::PyFunctionOptions;
+
+/// If the class is derived from a Rust `struct` or `enum`.
+#[derive(Copy, Clone, Debug, PartialEq, Eq)]
+pub enum PyClassKind {
+    Struct,
+    Enum,
+}
+
+/// The parsed arguments of the pyclass macro
+#[derive(Clone)]
+pub struct PyClassArgs {
+    pub class_kind: PyClassKind,
+    pub options: PyClassPyO3Options,
+}
+
+impl PyClassArgs {
+    fn parse(input: ParseStream<'_>, kind: PyClassKind) -> Result<Self> {
+        Ok(PyClassArgs {
+            class_kind: kind,
+            options: PyClassPyO3Options::parse(input)?,
+        })
+    }
+
+    pub fn parse_stuct_args(input: ParseStream<'_>) -> syn::Result<Self> {
+        Self::parse(input, PyClassKind::Struct)
+    }
+
+    pub fn parse_enum_args(input: ParseStream<'_>) -> syn::Result<Self> {
+        Self::parse(input, PyClassKind::Enum)
+    }
+}
+
+#[derive(Clone, Default)]
+pub struct PyClassPyO3Options {
+    pub krate: Option<CrateAttribute>,
+    pub dict: Option<kw::dict>,
+    pub eq: Option<kw::eq>,
+    pub eq_int: Option<kw::eq_int>,
+    pub extends: Option<ExtendsAttribute>,
+    pub get_all: Option<kw::get_all>,
+    pub freelist: Option<FreelistAttribute>,
+    pub frozen: Option<kw::frozen>,
+    pub hash: Option<kw::hash>,
+    pub mapping: Option<kw::mapping>,
+    pub module: Option<ModuleAttribute>,
+    pub name: Option<NameAttribute>,
+    pub ord: Option<kw::ord>,
+    pub rename_all: Option<RenameAllAttribute>,
+    pub sequence: Option<kw::sequence>,
+    pub set_all: Option<kw::set_all>,
+    pub subclass: Option<kw::subclass>,
+    pub unsendable: Option<kw::unsendable>,
+    pub weakref: Option<kw::weakref>,
+}
+
+pub enum PyClassPyO3Option {
+    Crate(CrateAttribute),
+    Dict(kw::dict),
+    Eq(kw::eq),
+    EqInt(kw::eq_int),
+    Extends(ExtendsAttribute),
+    Freelist(FreelistAttribute),
+    Frozen(kw::frozen),
+    GetAll(kw::get_all),
+    Hash(kw::hash),
+    Mapping(kw::mapping),
+    Module(ModuleAttribute),
+    Name(NameAttribute),
+    Ord(kw::ord),
+    RenameAll(RenameAllAttribute),
+    Sequence(kw::sequence),
+    SetAll(kw::set_all),
+    Subclass(kw::subclass),
+    Unsendable(kw::unsendable),
+    Weakref(kw::weakref),
+}
+
+impl Parse for PyClassPyO3Option {
+    fn parse(input: ParseStream<'_>) -> Result<Self> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(Token![crate]) {
+            input.parse().map(PyClassPyO3Option::Crate)
+        } else if lookahead.peek(kw::dict) {
+            input.parse().map(PyClassPyO3Option::Dict)
+        } else if lookahead.peek(kw::eq) {
+            input.parse().map(PyClassPyO3Option::Eq)
+        } else if lookahead.peek(kw::eq_int) {
+            input.parse().map(PyClassPyO3Option::EqInt)
+        } else if lookahead.peek(kw::extends) {
+            input.parse().map(PyClassPyO3Option::Extends)
+        } else if lookahead.peek(attributes::kw::freelist) {
+            input.parse().map(PyClassPyO3Option::Freelist)
+        } else if lookahead.peek(attributes::kw::frozen) {
+            input.parse().map(PyClassPyO3Option::Frozen)
+        } else if lookahead.peek(attributes::kw::get_all) {
+            input.parse().map(PyClassPyO3Option::GetAll)
+        } else if lookahead.peek(attributes::kw::hash) {
+            input.parse().map(PyClassPyO3Option::Hash)
+        } else if lookahead.peek(attributes::kw::mapping) {
+            input.parse().map(PyClassPyO3Option::Mapping)
+        } else if lookahead.peek(attributes::kw::module) {
+            input.parse().map(PyClassPyO3Option::Module)
+        } else if lookahead.peek(kw::name) {
+            input.parse().map(PyClassPyO3Option::Name)
+        } else if lookahead.peek(attributes::kw::ord) {
+            input.parse().map(PyClassPyO3Option::Ord)
+        } else if lookahead.peek(kw::rename_all) {
+            input.parse().map(PyClassPyO3Option::RenameAll)
+        } else if lookahead.peek(attributes::kw::sequence) {
+            input.parse().map(PyClassPyO3Option::Sequence)
+        } else if lookahead.peek(attributes::kw::set_all) {
+            input.parse().map(PyClassPyO3Option::SetAll)
+        } else if lookahead.peek(attributes::kw::subclass) {
+            input.parse().map(PyClassPyO3Option::Subclass)
+        } else if lookahead.peek(attributes::kw::unsendable) {
+            input.parse().map(PyClassPyO3Option::Unsendable)
+        } else if lookahead.peek(attributes::kw::weakref) {
+            input.parse().map(PyClassPyO3Option::Weakref)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+}
+
+impl Parse for PyClassPyO3Options {
+    fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
+        let mut options: PyClassPyO3Options = Default::default();
+
+        for option in Punctuated::<PyClassPyO3Option, syn::Token![,]>::parse_terminated(input)? {
+            options.set_option(option)?;
+        }
+
+        Ok(options)
+    }
+}
+
+impl PyClassPyO3Options {
+    pub fn take_pyo3_options(&mut self, attrs: &mut Vec<syn::Attribute>) -> syn::Result<()> {
+        take_pyo3_options(attrs)?
+            .into_iter()
+            .try_for_each(|option| self.set_option(option))
+    }
+
+    fn set_option(&mut self, option: PyClassPyO3Option) -> syn::Result<()> {
+        macro_rules! set_option {
+            ($key:ident) => {
+                {
+                    ensure_spanned!(
+                        self.$key.is_none(),
+                        $key.span() => concat!("`", stringify!($key), "` may only be specified once")
+                    );
+                    self.$key = Some($key);
+                }
+            };
+        }
+
+        let python_version = pyo3_build_config::get().version;
+
+        match option {
+            PyClassPyO3Option::Crate(krate) => set_option!(krate),
+            PyClassPyO3Option::Dict(dict) => {
+                ensure_spanned!(
+                    python_version >= pyversions::PY_3_9 || !is_abi3(),
+                    dict.span() => "`dict` requires Python >= 3.9 when using the `abi3` feature"
+                );
+                set_option!(dict);
+            }
+            PyClassPyO3Option::Eq(eq) => set_option!(eq),
+            PyClassPyO3Option::EqInt(eq_int) => set_option!(eq_int),
+            PyClassPyO3Option::Extends(extends) => set_option!(extends),
+            PyClassPyO3Option::Freelist(freelist) => set_option!(freelist),
+            PyClassPyO3Option::Frozen(frozen) => set_option!(frozen),
+            PyClassPyO3Option::GetAll(get_all) => set_option!(get_all),
+            PyClassPyO3Option::Hash(hash) => set_option!(hash),
+            PyClassPyO3Option::Mapping(mapping) => set_option!(mapping),
+            PyClassPyO3Option::Module(module) => set_option!(module),
+            PyClassPyO3Option::Name(name) => set_option!(name),
+            PyClassPyO3Option::Ord(ord) => set_option!(ord),
+            PyClassPyO3Option::RenameAll(rename_all) => set_option!(rename_all),
+            PyClassPyO3Option::Sequence(sequence) => set_option!(sequence),
+            PyClassPyO3Option::SetAll(set_all) => set_option!(set_all),
+            PyClassPyO3Option::Subclass(subclass) => set_option!(subclass),
+            PyClassPyO3Option::Unsendable(unsendable) => set_option!(unsendable),
+            PyClassPyO3Option::Weakref(weakref) => {
+                ensure_spanned!(
+                    python_version >= pyversions::PY_3_9 || !is_abi3(),
+                    weakref.span() => "`weakref` requires Python >= 3.9 when using the `abi3` feature"
+                );
+                set_option!(weakref);
+            }
+        }
+        Ok(())
+    }
+}
+
+pub fn build_py_class(
+    class: &mut syn::ItemStruct,
+    mut args: PyClassArgs,
+    methods_type: PyClassMethodsType,
+) -> syn::Result<TokenStream> {
+    args.options.take_pyo3_options(&mut class.attrs)?;
+
+    let ctx = &Ctx::new(&args.options.krate, None);
+    let doc = utils::get_doc(&class.attrs, None, ctx);
+
+    if let Some(lt) = class.generics.lifetimes().next() {
+        bail_spanned!(
+            lt.span() => concat!(
+                "#[pyclass] cannot have lifetime parameters. For an explanation, see \
+                https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/class.html#no-lifetime-parameters"
+            )
+        );
+    }
+
+    ensure_spanned!(
+        class.generics.params.is_empty(),
+        class.generics.span() => concat!(
+            "#[pyclass] cannot have generic parameters. For an explanation, see \
+            https://pyo3.rs/v", env!("CARGO_PKG_VERSION"), "/class.html#no-generic-parameters"
+        )
+    );
+
+    let mut field_options: Vec<(&syn::Field, FieldPyO3Options)> = match &mut class.fields {
+        syn::Fields::Named(fields) => fields
+            .named
+            .iter_mut()
+            .map(|field| {
+                FieldPyO3Options::take_pyo3_options(&mut field.attrs)
+                    .map(move |options| (&*field, options))
+            })
+            .collect::<Result<_>>()?,
+        syn::Fields::Unnamed(fields) => fields
+            .unnamed
+            .iter_mut()
+            .map(|field| {
+                FieldPyO3Options::take_pyo3_options(&mut field.attrs)
+                    .map(move |options| (&*field, options))
+            })
+            .collect::<Result<_>>()?,
+        syn::Fields::Unit => {
+            if let Some(attr) = args.options.set_all {
+                return Err(syn::Error::new_spanned(attr, UNIT_SET));
+            };
+            if let Some(attr) = args.options.get_all {
+                return Err(syn::Error::new_spanned(attr, UNIT_GET));
+            };
+            // No fields for unit struct
+            Vec::new()
+        }
+    };
+
+    if let Some(attr) = args.options.get_all {
+        for (_, FieldPyO3Options { get, .. }) in &mut field_options {
+            if let Some(old_get) = get.replace(Annotated::Struct(attr)) {
+                return Err(syn::Error::new(old_get.span(), DUPE_GET));
+            }
+        }
+    }
+
+    if let Some(attr) = args.options.set_all {
+        for (_, FieldPyO3Options { set, .. }) in &mut field_options {
+            if let Some(old_set) = set.replace(Annotated::Struct(attr)) {
+                return Err(syn::Error::new(old_set.span(), DUPE_SET));
+            }
+        }
+    }
+
+    impl_class(&class.ident, &args, doc, field_options, methods_type, ctx)
+}
+
+enum Annotated<X, Y> {
+    Field(X),
+    Struct(Y),
+}
+
+impl<X: Spanned, Y: Spanned> Annotated<X, Y> {
+    fn span(&self) -> Span {
+        match self {
+            Self::Field(x) => x.span(),
+            Self::Struct(y) => y.span(),
+        }
+    }
+}
+
+/// `#[pyo3()]` options for pyclass fields
+struct FieldPyO3Options {
+    get: Option<Annotated<kw::get, kw::get_all>>,
+    set: Option<Annotated<kw::set, kw::set_all>>,
+    name: Option<NameAttribute>,
+}
+
+enum FieldPyO3Option {
+    Get(attributes::kw::get),
+    Set(attributes::kw::set),
+    Name(NameAttribute),
+}
+
+impl Parse for FieldPyO3Option {
+    fn parse(input: ParseStream<'_>) -> Result<Self> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(attributes::kw::get) {
+            input.parse().map(FieldPyO3Option::Get)
+        } else if lookahead.peek(attributes::kw::set) {
+            input.parse().map(FieldPyO3Option::Set)
+        } else if lookahead.peek(attributes::kw::name) {
+            input.parse().map(FieldPyO3Option::Name)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+}
+
+impl FieldPyO3Options {
+    fn take_pyo3_options(attrs: &mut Vec<syn::Attribute>) -> Result<Self> {
+        let mut options = FieldPyO3Options {
+            get: None,
+            set: None,
+            name: None,
+        };
+
+        for option in take_pyo3_options(attrs)? {
+            match option {
+                FieldPyO3Option::Get(kw) => {
+                    if options.get.replace(Annotated::Field(kw)).is_some() {
+                        return Err(syn::Error::new(kw.span(), UNIQUE_GET));
+                    }
+                }
+                FieldPyO3Option::Set(kw) => {
+                    if options.set.replace(Annotated::Field(kw)).is_some() {
+                        return Err(syn::Error::new(kw.span(), UNIQUE_SET));
+                    }
+                }
+                FieldPyO3Option::Name(name) => {
+                    if options.name.replace(name).is_some() {
+                        return Err(syn::Error::new(options.name.span(), UNIQUE_NAME));
+                    }
+                }
+            }
+        }
+
+        Ok(options)
+    }
+}
+
+fn get_class_python_name<'a>(cls: &'a syn::Ident, args: &'a PyClassArgs) -> Cow<'a, syn::Ident> {
+    args.options
+        .name
+        .as_ref()
+        .map(|name_attr| Cow::Borrowed(&name_attr.value.0))
+        .unwrap_or_else(|| Cow::Owned(cls.unraw()))
+}
+
+fn impl_class(
+    cls: &syn::Ident,
+    args: &PyClassArgs,
+    doc: PythonDoc,
+    field_options: Vec<(&syn::Field, FieldPyO3Options)>,
+    methods_type: PyClassMethodsType,
+    ctx: &Ctx,
+) -> syn::Result<TokenStream> {
+    let Ctx { pyo3_path, .. } = ctx;
+    let pytypeinfo_impl = impl_pytypeinfo(cls, args, None, ctx);
+
+    let (default_richcmp, default_richcmp_slot) =
+        pyclass_richcmp(&args.options, &syn::parse_quote!(#cls), ctx)?;
+
+    let (default_hash, default_hash_slot) =
+        pyclass_hash(&args.options, &syn::parse_quote!(#cls), ctx)?;
+
+    let mut slots = Vec::new();
+    slots.extend(default_richcmp_slot);
+    slots.extend(default_hash_slot);
+
+    let py_class_impl = PyClassImplsBuilder::new(
+        cls,
+        args,
+        methods_type,
+        descriptors_to_items(
+            cls,
+            args.options.rename_all.as_ref(),
+            args.options.frozen,
+            field_options,
+            ctx,
+        )?,
+        slots,
+    )
+    .doc(doc)
+    .impl_all(ctx)?;
+
+    Ok(quote! {
+        impl #pyo3_path::types::DerefToPyAny for #cls {}
+
+        #pytypeinfo_impl
+
+        #py_class_impl
+
+        #[doc(hidden)]
+        #[allow(non_snake_case)]
+        impl #cls {
+            #default_richcmp
+            #default_hash
+        }
+    })
+}
+
+enum PyClassEnum<'a> {
+    Simple(PyClassSimpleEnum<'a>),
+    Complex(PyClassComplexEnum<'a>),
+}
+
+impl<'a> PyClassEnum<'a> {
+    fn new(enum_: &'a mut syn::ItemEnum) -> syn::Result<Self> {
+        let has_only_unit_variants = enum_
+            .variants
+            .iter()
+            .all(|variant| matches!(variant.fields, syn::Fields::Unit));
+
+        Ok(if has_only_unit_variants {
+            let simple_enum = PyClassSimpleEnum::new(enum_)?;
+            Self::Simple(simple_enum)
+        } else {
+            let complex_enum = PyClassComplexEnum::new(enum_)?;
+            Self::Complex(complex_enum)
+        })
+    }
+}
+
+pub fn build_py_enum(
+    enum_: &mut syn::ItemEnum,
+    mut args: PyClassArgs,
+    method_type: PyClassMethodsType,
+) -> syn::Result<TokenStream> {
+    args.options.take_pyo3_options(&mut enum_.attrs)?;
+
+    let ctx = &Ctx::new(&args.options.krate, None);
+    if let Some(extends) = &args.options.extends {
+        bail_spanned!(extends.span() => "enums can't extend from other classes");
+    } else if let Some(subclass) = &args.options.subclass {
+        bail_spanned!(subclass.span() => "enums can't be inherited by other classes");
+    } else if enum_.variants.is_empty() {
+        bail_spanned!(enum_.brace_token.span.join() => "#[pyclass] can't be used on enums without any variants");
+    }
+
+    let doc = utils::get_doc(&enum_.attrs, None, ctx);
+    let enum_ = PyClassEnum::new(enum_)?;
+    impl_enum(enum_, &args, doc, method_type, ctx)
+}
+
+struct PyClassSimpleEnum<'a> {
+    ident: &'a syn::Ident,
+    // The underlying #[repr] of the enum, used to implement __int__ and __richcmp__.
+    // This matters when the underlying representation may not fit in `isize`.
+    repr_type: syn::Ident,
+    variants: Vec<PyClassEnumUnitVariant<'a>>,
+}
+
+impl<'a> PyClassSimpleEnum<'a> {
+    fn new(enum_: &'a mut syn::ItemEnum) -> syn::Result<Self> {
+        fn is_numeric_type(t: &syn::Ident) -> bool {
+            [
+                "u8", "i8", "u16", "i16", "u32", "i32", "u64", "i64", "u128", "i128", "usize",
+                "isize",
+            ]
+            .iter()
+            .any(|&s| t == s)
+        }
+
+        fn extract_unit_variant_data(
+            variant: &mut syn::Variant,
+        ) -> syn::Result<PyClassEnumUnitVariant<'_>> {
+            use syn::Fields;
+            let ident = match &variant.fields {
+                Fields::Unit => &variant.ident,
+                _ => bail_spanned!(variant.span() => "Must be a unit variant."),
+            };
+            let options = EnumVariantPyO3Options::take_pyo3_options(&mut variant.attrs)?;
+            Ok(PyClassEnumUnitVariant { ident, options })
+        }
+
+        let ident = &enum_.ident;
+
+        // According to the [reference](https://doc.rust-lang.org/reference/items/enumerations.html),
+        // "Under the default representation, the specified discriminant is interpreted as an isize
+        // value", so `isize` should be enough by default.
+        let mut repr_type = syn::Ident::new("isize", proc_macro2::Span::call_site());
+        if let Some(attr) = enum_.attrs.iter().find(|attr| attr.path().is_ident("repr")) {
+            let args =
+                attr.parse_args_with(Punctuated::<TokenStream, Token![!]>::parse_terminated)?;
+            if let Some(ident) = args
+                .into_iter()
+                .filter_map(|ts| syn::parse2::<syn::Ident>(ts).ok())
+                .find(is_numeric_type)
+            {
+                repr_type = ident;
+            }
+        }
+
+        let variants: Vec<_> = enum_
+            .variants
+            .iter_mut()
+            .map(extract_unit_variant_data)
+            .collect::<syn::Result<_>>()?;
+        Ok(Self {
+            ident,
+            repr_type,
+            variants,
+        })
+    }
+}
+
+struct PyClassComplexEnum<'a> {
+    ident: &'a syn::Ident,
+    variants: Vec<PyClassEnumVariant<'a>>,
+}
+
+impl<'a> PyClassComplexEnum<'a> {
+    fn new(enum_: &'a mut syn::ItemEnum) -> syn::Result<Self> {
+        let witness = enum_
+            .variants
+            .iter()
+            .find(|variant| !matches!(variant.fields, syn::Fields::Unit))
+            .expect("complex enum has a non-unit variant")
+            .ident
+            .to_owned();
+
+        let extract_variant_data =
+            |variant: &'a mut syn::Variant| -> syn::Result<PyClassEnumVariant<'a>> {
+                use syn::Fields;
+                let ident = &variant.ident;
+                let options = EnumVariantPyO3Options::take_pyo3_options(&mut variant.attrs)?;
+
+                let variant = match &variant.fields {
+                    Fields::Unit => {
+                        bail_spanned!(variant.span() => format!(
+                            "Unit variant `{ident}` is not yet supported in a complex enum\n\
+                            = help: change to an empty tuple variant instead: `{ident}()`\n\
+                            = note: the enum is complex because of non-unit variant `{witness}`",
+                            ident=ident, witness=witness))
+                    }
+                    Fields::Named(fields) => {
+                        let fields = fields
+                            .named
+                            .iter()
+                            .map(|field| PyClassEnumVariantNamedField {
+                                ident: field.ident.as_ref().expect("named field has an identifier"),
+                                ty: &field.ty,
+                                span: field.span(),
+                            })
+                            .collect();
+
+                        PyClassEnumVariant::Struct(PyClassEnumStructVariant {
+                            ident,
+                            fields,
+                            options,
+                        })
+                    }
+                    Fields::Unnamed(types) => {
+                        let fields = types
+                            .unnamed
+                            .iter()
+                            .map(|field| PyClassEnumVariantUnnamedField {
+                                ty: &field.ty,
+                                span: field.span(),
+                            })
+                            .collect();
+
+                        PyClassEnumVariant::Tuple(PyClassEnumTupleVariant {
+                            ident,
+                            fields,
+                            options,
+                        })
+                    }
+                };
+
+                Ok(variant)
+            };
+
+        let ident = &enum_.ident;
+
+        let variants: Vec<_> = enum_
+            .variants
+            .iter_mut()
+            .map(extract_variant_data)
+            .collect::<syn::Result<_>>()?;
+
+        Ok(Self { ident, variants })
+    }
+}
+
+enum PyClassEnumVariant<'a> {
+    // TODO(mkovaxx): Unit(PyClassEnumUnitVariant<'a>),
+    Struct(PyClassEnumStructVariant<'a>),
+    Tuple(PyClassEnumTupleVariant<'a>),
+}
+
+trait EnumVariant {
+    fn get_ident(&self) -> &syn::Ident;
+    fn get_options(&self) -> &EnumVariantPyO3Options;
+
+    fn get_python_name(&self, args: &PyClassArgs) -> Cow<'_, syn::Ident> {
+        self.get_options()
+            .name
+            .as_ref()
+            .map(|name_attr| Cow::Borrowed(&name_attr.value.0))
+            .unwrap_or_else(|| {
+                let name = self.get_ident().unraw();
+                if let Some(attr) = &args.options.rename_all {
+                    let new_name = apply_renaming_rule(attr.value.rule, &name.to_string());
+                    Cow::Owned(Ident::new(&new_name, Span::call_site()))
+                } else {
+                    Cow::Owned(name)
+                }
+            })
+    }
+}
+
+impl<'a> EnumVariant for PyClassEnumVariant<'a> {
+    fn get_ident(&self) -> &syn::Ident {
+        match self {
+            PyClassEnumVariant::Struct(struct_variant) => struct_variant.ident,
+            PyClassEnumVariant::Tuple(tuple_variant) => tuple_variant.ident,
+        }
+    }
+
+    fn get_options(&self) -> &EnumVariantPyO3Options {
+        match self {
+            PyClassEnumVariant::Struct(struct_variant) => &struct_variant.options,
+            PyClassEnumVariant::Tuple(tuple_variant) => &tuple_variant.options,
+        }
+    }
+}
+
+/// A unit variant has no fields
+struct PyClassEnumUnitVariant<'a> {
+    ident: &'a syn::Ident,
+    options: EnumVariantPyO3Options,
+}
+
+impl<'a> EnumVariant for PyClassEnumUnitVariant<'a> {
+    fn get_ident(&self) -> &syn::Ident {
+        self.ident
+    }
+
+    fn get_options(&self) -> &EnumVariantPyO3Options {
+        &self.options
+    }
+}
+
+/// A struct variant has named fields
+struct PyClassEnumStructVariant<'a> {
+    ident: &'a syn::Ident,
+    fields: Vec<PyClassEnumVariantNamedField<'a>>,
+    options: EnumVariantPyO3Options,
+}
+
+struct PyClassEnumTupleVariant<'a> {
+    ident: &'a syn::Ident,
+    fields: Vec<PyClassEnumVariantUnnamedField<'a>>,
+    options: EnumVariantPyO3Options,
+}
+
+struct PyClassEnumVariantNamedField<'a> {
+    ident: &'a syn::Ident,
+    ty: &'a syn::Type,
+    span: Span,
+}
+
+struct PyClassEnumVariantUnnamedField<'a> {
+    ty: &'a syn::Type,
+    span: Span,
+}
+
+/// `#[pyo3()]` options for pyclass enum variants
+#[derive(Clone, Default)]
+struct EnumVariantPyO3Options {
+    name: Option<NameAttribute>,
+    constructor: Option<ConstructorAttribute>,
+}
+
+enum EnumVariantPyO3Option {
+    Name(NameAttribute),
+    Constructor(ConstructorAttribute),
+}
+
+impl Parse for EnumVariantPyO3Option {
+    fn parse(input: ParseStream<'_>) -> Result<Self> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(attributes::kw::name) {
+            input.parse().map(EnumVariantPyO3Option::Name)
+        } else if lookahead.peek(attributes::kw::constructor) {
+            input.parse().map(EnumVariantPyO3Option::Constructor)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+}
+
+impl EnumVariantPyO3Options {
+    fn take_pyo3_options(attrs: &mut Vec<syn::Attribute>) -> Result<Self> {
+        let mut options = EnumVariantPyO3Options::default();
+
+        take_pyo3_options(attrs)?
+            .into_iter()
+            .try_for_each(|option| options.set_option(option))?;
+
+        Ok(options)
+    }
+
+    fn set_option(&mut self, option: EnumVariantPyO3Option) -> syn::Result<()> {
+        macro_rules! set_option {
+            ($key:ident) => {
+                {
+                    ensure_spanned!(
+                        self.$key.is_none(),
+                        $key.span() => concat!("`", stringify!($key), "` may only be specified once")
+                    );
+                    self.$key = Some($key);
+                }
+            };
+        }
+
+        match option {
+            EnumVariantPyO3Option::Constructor(constructor) => set_option!(constructor),
+            EnumVariantPyO3Option::Name(name) => set_option!(name),
+        }
+        Ok(())
+    }
+}
+
+fn impl_enum(
+    enum_: PyClassEnum<'_>,
+    args: &PyClassArgs,
+    doc: PythonDoc,
+    methods_type: PyClassMethodsType,
+    ctx: &Ctx,
+) -> Result<TokenStream> {
+    match enum_ {
+        PyClassEnum::Simple(simple_enum) => {
+            impl_simple_enum(simple_enum, args, doc, methods_type, ctx)
+        }
+        PyClassEnum::Complex(complex_enum) => {
+            impl_complex_enum(complex_enum, args, doc, methods_type, ctx)
+        }
+    }
+}
+
+fn impl_simple_enum(
+    simple_enum: PyClassSimpleEnum<'_>,
+    args: &PyClassArgs,
+    doc: PythonDoc,
+    methods_type: PyClassMethodsType,
+    ctx: &Ctx,
+) -> Result<TokenStream> {
+    let cls = simple_enum.ident;
+    let ty: syn::Type = syn::parse_quote!(#cls);
+    let variants = simple_enum.variants;
+    let pytypeinfo = impl_pytypeinfo(cls, args, None, ctx);
+
+    for variant in &variants {
+        ensure_spanned!(variant.options.constructor.is_none(), variant.options.constructor.span() => "`constructor` can't be used on a simple enum variant");
+    }
+
+    let (default_repr, default_repr_slot) = {
+        let variants_repr = variants.iter().map(|variant| {
+            let variant_name = variant.ident;
+            // Assuming all variants are unit variants because they are the only type we support.
+            let repr = format!(
+                "{}.{}",
+                get_class_python_name(cls, args),
+                variant.get_python_name(args),
+            );
+            quote! { #cls::#variant_name => #repr, }
+        });
+        let mut repr_impl: syn::ImplItemFn = syn::parse_quote! {
+            fn __pyo3__repr__(&self) -> &'static str {
+                match self {
+                    #(#variants_repr)*
+                }
+            }
+        };
+        let repr_slot =
+            generate_default_protocol_slot(&ty, &mut repr_impl, &__REPR__, ctx).unwrap();
+        (repr_impl, repr_slot)
+    };
+
+    let repr_type = &simple_enum.repr_type;
+
+    let (default_int, default_int_slot) = {
+        // This implementation allows us to convert &T to #repr_type without implementing `Copy`
+        let variants_to_int = variants.iter().map(|variant| {
+            let variant_name = variant.ident;
+            quote! { #cls::#variant_name => #cls::#variant_name as #repr_type, }
+        });
+        let mut int_impl: syn::ImplItemFn = syn::parse_quote! {
+            fn __pyo3__int__(&self) -> #repr_type {
+                match self {
+                    #(#variants_to_int)*
+                }
+            }
+        };
+        let int_slot = generate_default_protocol_slot(&ty, &mut int_impl, &__INT__, ctx).unwrap();
+        (int_impl, int_slot)
+    };
+
+    let (default_richcmp, default_richcmp_slot) =
+        pyclass_richcmp_simple_enum(&args.options, &ty, repr_type, ctx)?;
+    let (default_hash, default_hash_slot) = pyclass_hash(&args.options, &ty, ctx)?;
+
+    let mut default_slots = vec![default_repr_slot, default_int_slot];
+    default_slots.extend(default_richcmp_slot);
+    default_slots.extend(default_hash_slot);
+
+    let pyclass_impls = PyClassImplsBuilder::new(
+        cls,
+        args,
+        methods_type,
+        simple_enum_default_methods(
+            cls,
+            variants.iter().map(|v| (v.ident, v.get_python_name(args))),
+            ctx,
+        ),
+        default_slots,
+    )
+    .doc(doc)
+    .impl_all(ctx)?;
+
+    Ok(quote! {
+        #pytypeinfo
+
+        #pyclass_impls
+
+        #[doc(hidden)]
+        #[allow(non_snake_case)]
+        impl #cls {
+            #default_repr
+            #default_int
+            #default_richcmp
+            #default_hash
+        }
+    })
+}
+
+fn impl_complex_enum(
+    complex_enum: PyClassComplexEnum<'_>,
+    args: &PyClassArgs,
+    doc: PythonDoc,
+    methods_type: PyClassMethodsType,
+    ctx: &Ctx,
+) -> Result<TokenStream> {
+    let Ctx { pyo3_path, .. } = ctx;
+    let cls = complex_enum.ident;
+    let ty: syn::Type = syn::parse_quote!(#cls);
+
+    // Need to rig the enum PyClass options
+    let args = {
+        let mut rigged_args = args.clone();
+        // Needs to be frozen to disallow `&mut self` methods, which could break a runtime invariant
+        rigged_args.options.frozen = parse_quote!(frozen);
+        // Needs to be subclassable by the variant PyClasses
+        rigged_args.options.subclass = parse_quote!(subclass);
+        rigged_args
+    };
+
+    let ctx = &Ctx::new(&args.options.krate, None);
+    let cls = complex_enum.ident;
+    let variants = complex_enum.variants;
+    let pytypeinfo = impl_pytypeinfo(cls, &args, None, ctx);
+
+    let (default_richcmp, default_richcmp_slot) = pyclass_richcmp(&args.options, &ty, ctx)?;
+    let (default_hash, default_hash_slot) = pyclass_hash(&args.options, &ty, ctx)?;
+
+    let mut default_slots = vec![];
+    default_slots.extend(default_richcmp_slot);
+    default_slots.extend(default_hash_slot);
+
+    let impl_builder = PyClassImplsBuilder::new(
+        cls,
+        &args,
+        methods_type,
+        complex_enum_default_methods(
+            cls,
+            variants
+                .iter()
+                .map(|v| (v.get_ident(), v.get_python_name(&args))),
+            ctx,
+        ),
+        default_slots,
+    )
+    .doc(doc);
+
+    // Need to customize the into_py impl so that it returns the variant PyClass
+    let enum_into_py_impl = {
+        let match_arms: Vec<TokenStream> = variants
+            .iter()
+            .map(|variant| {
+                let variant_ident = variant.get_ident();
+                let variant_cls = gen_complex_enum_variant_class_ident(cls, variant.get_ident());
+                quote! {
+                    #cls::#variant_ident { .. } => {
+                        let pyclass_init = #pyo3_path::PyClassInitializer::from(self).add_subclass(#variant_cls);
+                        let variant_value = #pyo3_path::Py::new(py, pyclass_init).unwrap();
+                        #pyo3_path::IntoPy::into_py(variant_value, py)
+                    }
+                }
+            })
+            .collect();
+
+        quote! {
+            impl #pyo3_path::IntoPy<#pyo3_path::PyObject> for #cls {
+                fn into_py(self, py: #pyo3_path::Python) -> #pyo3_path::PyObject {
+                    match self {
+                        #(#match_arms)*
+                    }
+                }
+            }
+        }
+    };
+
+    let pyclass_impls: TokenStream = [
+        impl_builder.impl_pyclass(ctx),
+        impl_builder.impl_extractext(ctx),
+        enum_into_py_impl,
+        impl_builder.impl_pyclassimpl(ctx)?,
+        impl_builder.impl_add_to_module(ctx),
+        impl_builder.impl_freelist(ctx),
+    ]
+    .into_iter()
+    .collect();
+
+    let mut variant_cls_zsts = vec![];
+    let mut variant_cls_pytypeinfos = vec![];
+    let mut variant_cls_pyclass_impls = vec![];
+    let mut variant_cls_impls = vec![];
+    for variant in variants {
+        let variant_cls = gen_complex_enum_variant_class_ident(cls, variant.get_ident());
+
+        let variant_cls_zst = quote! {
+            #[doc(hidden)]
+            #[allow(non_camel_case_types)]
+            struct #variant_cls;
+        };
+        variant_cls_zsts.push(variant_cls_zst);
+
+        let variant_args = PyClassArgs {
+            class_kind: PyClassKind::Struct,
+            // TODO(mkovaxx): propagate variant.options
+            options: {
+                let mut rigged_options: PyClassPyO3Options = parse_quote!(extends = #cls, frozen);
+                // If a specific module was given to the base class, use it for all variants.
+                rigged_options.module.clone_from(&args.options.module);
+                rigged_options
+            },
+        };
+
+        let variant_cls_pytypeinfo = impl_pytypeinfo(&variant_cls, &variant_args, None, ctx);
+        variant_cls_pytypeinfos.push(variant_cls_pytypeinfo);
+
+        let (variant_cls_impl, field_getters, mut slots) =
+            impl_complex_enum_variant_cls(cls, &variant, ctx)?;
+        variant_cls_impls.push(variant_cls_impl);
+
+        let variant_new = complex_enum_variant_new(cls, variant, ctx)?;
+        slots.push(variant_new);
+
+        let pyclass_impl = PyClassImplsBuilder::new(
+            &variant_cls,
+            &variant_args,
+            methods_type,
+            field_getters,
+            slots,
+        )
+        .impl_all(ctx)?;
+
+        variant_cls_pyclass_impls.push(pyclass_impl);
+    }
+
+    Ok(quote! {
+        #pytypeinfo
+
+        #pyclass_impls
+
+        #[doc(hidden)]
+        #[allow(non_snake_case)]
+        impl #cls {
+            #default_richcmp
+            #default_hash
+        }
+
+        #(#variant_cls_zsts)*
+
+        #(#variant_cls_pytypeinfos)*
+
+        #(#variant_cls_pyclass_impls)*
+
+        #(#variant_cls_impls)*
+    })
+}
+
+fn impl_complex_enum_variant_cls(
+    enum_name: &syn::Ident,
+    variant: &PyClassEnumVariant<'_>,
+    ctx: &Ctx,
+) -> Result<(TokenStream, Vec<MethodAndMethodDef>, Vec<MethodAndSlotDef>)> {
+    match variant {
+        PyClassEnumVariant::Struct(struct_variant) => {
+            impl_complex_enum_struct_variant_cls(enum_name, struct_variant, ctx)
+        }
+        PyClassEnumVariant::Tuple(tuple_variant) => {
+            impl_complex_enum_tuple_variant_cls(enum_name, tuple_variant, ctx)
+        }
+    }
+}
+
+fn impl_complex_enum_variant_match_args(
+    ctx: &Ctx,
+    variant_cls_type: &syn::Type,
+    field_names: &mut Vec<Ident>,
+) -> (MethodAndMethodDef, syn::ImplItemConst) {
+    let match_args_const_impl: syn::ImplItemConst = {
+        let args_tp = field_names.iter().map(|_| {
+            quote! { &'static str }
+        });
+        parse_quote! {
+            const __match_args__: ( #(#args_tp,)* ) = (
+                #(stringify!(#field_names),)*
+            );
+        }
+    };
+
+    let spec = ConstSpec {
+        rust_ident: format_ident!("__match_args__"),
+        attributes: ConstAttributes {
+            is_class_attr: true,
+            name: None,
+            deprecations: Deprecations::new(ctx),
+        },
+    };
+
+    let variant_match_args = gen_py_const(variant_cls_type, &spec, ctx);
+
+    (variant_match_args, match_args_const_impl)
+}
+
+fn impl_complex_enum_struct_variant_cls(
+    enum_name: &syn::Ident,
+    variant: &PyClassEnumStructVariant<'_>,
+    ctx: &Ctx,
+) -> Result<(TokenStream, Vec<MethodAndMethodDef>, Vec<MethodAndSlotDef>)> {
+    let Ctx { pyo3_path, .. } = ctx;
+    let variant_ident = &variant.ident;
+    let variant_cls = gen_complex_enum_variant_class_ident(enum_name, variant.ident);
+    let variant_cls_type = parse_quote!(#variant_cls);
+
+    let mut field_names: Vec<Ident> = vec![];
+    let mut fields_with_types: Vec<TokenStream> = vec![];
+    let mut field_getters = vec![];
+    let mut field_getter_impls: Vec<TokenStream> = vec![];
+    for field in &variant.fields {
+        let field_name = field.ident;
+        let field_type = field.ty;
+        let field_with_type = quote! { #field_name: #field_type };
+
+        let field_getter =
+            complex_enum_variant_field_getter(&variant_cls_type, field_name, field.span, ctx)?;
+
+        let field_getter_impl = quote! {
+            fn #field_name(slf: #pyo3_path::PyRef<Self>) -> #pyo3_path::PyResult<#field_type> {
+                match &*slf.into_super() {
+                    #enum_name::#variant_ident { #field_name, .. } => Ok(#field_name.clone()),
+                    _ => unreachable!("Wrong complex enum variant found in variant wrapper PyClass"),
+                }
+            }
+        };
+
+        field_names.push(field_name.clone());
+        fields_with_types.push(field_with_type);
+        field_getters.push(field_getter);
+        field_getter_impls.push(field_getter_impl);
+    }
+
+    let (variant_match_args, match_args_const_impl) =
+        impl_complex_enum_variant_match_args(ctx, &variant_cls_type, &mut field_names);
+
+    field_getters.push(variant_match_args);
+
+    let cls_impl = quote! {
+        #[doc(hidden)]
+        #[allow(non_snake_case)]
+        impl #variant_cls {
+            fn __pymethod_constructor__(py: #pyo3_path::Python<'_>, #(#fields_with_types,)*) -> #pyo3_path::PyClassInitializer<#variant_cls> {
+                let base_value = #enum_name::#variant_ident { #(#field_names,)* };
+                #pyo3_path::PyClassInitializer::from(base_value).add_subclass(#variant_cls)
+            }
+
+            #match_args_const_impl
+
+            #(#field_getter_impls)*
+        }
+    };
+
+    Ok((cls_impl, field_getters, Vec::new()))
+}
+
+fn impl_complex_enum_tuple_variant_field_getters(
+    ctx: &Ctx,
+    variant: &PyClassEnumTupleVariant<'_>,
+    enum_name: &syn::Ident,
+    variant_cls_type: &syn::Type,
+    variant_ident: &&Ident,
+    field_names: &mut Vec<Ident>,
+    fields_types: &mut Vec<syn::Type>,
+) -> Result<(Vec<MethodAndMethodDef>, Vec<syn::ImplItemFn>)> {
+    let Ctx { pyo3_path, .. } = ctx;
+
+    let mut field_getters = vec![];
+    let mut field_getter_impls = vec![];
+
+    for (index, field) in variant.fields.iter().enumerate() {
+        let field_name = format_ident!("_{}", index);
+        let field_type = field.ty;
+
+        let field_getter =
+            complex_enum_variant_field_getter(variant_cls_type, &field_name, field.span, ctx)?;
+
+        // Generate the match arms needed to destructure the tuple and access the specific field
+        let field_access_tokens: Vec<_> = (0..variant.fields.len())
+            .map(|i| {
+                if i == index {
+                    quote! { val }
+                } else {
+                    quote! { _ }
+                }
+            })
+            .collect();
+
+        let field_getter_impl: syn::ImplItemFn = parse_quote! {
+            fn #field_name(slf: #pyo3_path::PyRef<Self>) -> #pyo3_path::PyResult<#field_type> {
+                match &*slf.into_super() {
+                    #enum_name::#variant_ident ( #(#field_access_tokens), *) => Ok(val.clone()),
+                    _ => unreachable!("Wrong complex enum variant found in variant wrapper PyClass"),
+                }
+            }
+        };
+
+        field_names.push(field_name);
+        fields_types.push(field_type.clone());
+        field_getters.push(field_getter);
+        field_getter_impls.push(field_getter_impl);
+    }
+
+    Ok((field_getters, field_getter_impls))
+}
+
+fn impl_complex_enum_tuple_variant_len(
+    ctx: &Ctx,
+
+    variant_cls_type: &syn::Type,
+    num_fields: usize,
+) -> Result<(MethodAndSlotDef, syn::ImplItemFn)> {
+    let Ctx { pyo3_path, .. } = ctx;
+
+    let mut len_method_impl: syn::ImplItemFn = parse_quote! {
+        fn __len__(slf: #pyo3_path::PyRef<Self>) -> #pyo3_path::PyResult<usize> {
+            Ok(#num_fields)
+        }
+    };
+
+    let variant_len =
+        generate_default_protocol_slot(variant_cls_type, &mut len_method_impl, &__LEN__, ctx)?;
+
+    Ok((variant_len, len_method_impl))
+}
+
+fn impl_complex_enum_tuple_variant_getitem(
+    ctx: &Ctx,
+    variant_cls: &syn::Ident,
+    variant_cls_type: &syn::Type,
+    num_fields: usize,
+) -> Result<(MethodAndSlotDef, syn::ImplItemFn)> {
+    let Ctx { pyo3_path, .. } = ctx;
+
+    let match_arms: Vec<_> = (0..num_fields)
+        .map(|i| {
+            let field_access = format_ident!("_{}", i);
+            quote! {
+            #i => Ok(
+                #pyo3_path::IntoPy::into_py(
+                    #variant_cls::#field_access(slf)?
+                    , py)
+                )
+
+            }
+        })
+        .collect();
+
+    let mut get_item_method_impl: syn::ImplItemFn = parse_quote! {
+        fn __getitem__(slf: #pyo3_path::PyRef<Self>, idx: usize) -> #pyo3_path::PyResult< #pyo3_path::PyObject> {
+            let py = slf.py();
+            match idx {
+                #( #match_arms, )*
+                _ => Err(pyo3::exceptions::PyIndexError::new_err("tuple index out of range")),
+            }
+        }
+    };
+
+    let variant_getitem = generate_default_protocol_slot(
+        variant_cls_type,
+        &mut get_item_method_impl,
+        &__GETITEM__,
+        ctx,
+    )?;
+
+    Ok((variant_getitem, get_item_method_impl))
+}
+
+fn impl_complex_enum_tuple_variant_cls(
+    enum_name: &syn::Ident,
+    variant: &PyClassEnumTupleVariant<'_>,
+    ctx: &Ctx,
+) -> Result<(TokenStream, Vec<MethodAndMethodDef>, Vec<MethodAndSlotDef>)> {
+    let Ctx { pyo3_path, .. } = ctx;
+    let variant_ident = &variant.ident;
+    let variant_cls = gen_complex_enum_variant_class_ident(enum_name, variant.ident);
+    let variant_cls_type = parse_quote!(#variant_cls);
+
+    let mut slots = vec![];
+
+    // represents the index of the field
+    let mut field_names: Vec<Ident> = vec![];
+    let mut field_types: Vec<syn::Type> = vec![];
+
+    let (mut field_getters, field_getter_impls) = impl_complex_enum_tuple_variant_field_getters(
+        ctx,
+        variant,
+        enum_name,
+        &variant_cls_type,
+        variant_ident,
+        &mut field_names,
+        &mut field_types,
+    )?;
+
+    let num_fields = variant.fields.len();
+
+    let (variant_len, len_method_impl) =
+        impl_complex_enum_tuple_variant_len(ctx, &variant_cls_type, num_fields)?;
+
+    slots.push(variant_len);
+
+    let (variant_getitem, getitem_method_impl) =
+        impl_complex_enum_tuple_variant_getitem(ctx, &variant_cls, &variant_cls_type, num_fields)?;
+
+    slots.push(variant_getitem);
+
+    let (variant_match_args, match_args_method_impl) =
+        impl_complex_enum_variant_match_args(ctx, &variant_cls_type, &mut field_names);
+
+    field_getters.push(variant_match_args);
+
+    let cls_impl = quote! {
+        #[doc(hidden)]
+        #[allow(non_snake_case)]
+        impl #variant_cls {
+            fn __pymethod_constructor__(py: #pyo3_path::Python<'_>, #(#field_names : #field_types,)*) -> #pyo3_path::PyClassInitializer<#variant_cls> {
+                let base_value = #enum_name::#variant_ident ( #(#field_names,)* );
+                #pyo3_path::PyClassInitializer::from(base_value).add_subclass(#variant_cls)
+            }
+
+            #len_method_impl
+
+            #getitem_method_impl
+
+            #match_args_method_impl
+
+            #(#field_getter_impls)*
+        }
+    };
+
+    Ok((cls_impl, field_getters, slots))
+}
+
+fn gen_complex_enum_variant_class_ident(enum_: &syn::Ident, variant: &syn::Ident) -> syn::Ident {
+    format_ident!("{}_{}", enum_, variant)
+}
+
+fn generate_protocol_slot(
+    cls: &syn::Type,
+    method: &mut syn::ImplItemFn,
+    slot: &SlotDef,
+    name: &str,
+    ctx: &Ctx,
+) -> syn::Result<MethodAndSlotDef> {
+    let spec = FnSpec::parse(
+        &mut method.sig,
+        &mut Vec::new(),
+        PyFunctionOptions::default(),
+        ctx,
+    )
+    .unwrap();
+    slot.generate_type_slot(&syn::parse_quote!(#cls), &spec, name, ctx)
+}
+
+fn generate_default_protocol_slot(
+    cls: &syn::Type,
+    method: &mut syn::ImplItemFn,
+    slot: &SlotDef,
+    ctx: &Ctx,
+) -> syn::Result<MethodAndSlotDef> {
+    let spec = FnSpec::parse(
+        &mut method.sig,
+        &mut Vec::new(),
+        PyFunctionOptions::default(),
+        ctx,
+    )
+    .unwrap();
+    let name = spec.name.to_string();
+    slot.generate_type_slot(
+        &syn::parse_quote!(#cls),
+        &spec,
+        &format!("__default_{}__", name),
+        ctx,
+    )
+}
+
+fn simple_enum_default_methods<'a>(
+    cls: &'a syn::Ident,
+    unit_variant_names: impl IntoIterator<Item = (&'a syn::Ident, Cow<'a, syn::Ident>)>,
+    ctx: &Ctx,
+) -> Vec<MethodAndMethodDef> {
+    let cls_type = syn::parse_quote!(#cls);
+    let variant_to_attribute = |var_ident: &syn::Ident, py_ident: &syn::Ident| ConstSpec {
+        rust_ident: var_ident.clone(),
+        attributes: ConstAttributes {
+            is_class_attr: true,
+            name: Some(NameAttribute {
+                kw: syn::parse_quote! { name },
+                value: NameLitStr(py_ident.clone()),
+            }),
+            deprecations: Deprecations::new(ctx),
+        },
+    };
+    unit_variant_names
+        .into_iter()
+        .map(|(var, py_name)| gen_py_const(&cls_type, &variant_to_attribute(var, &py_name), ctx))
+        .collect()
+}
+
+fn complex_enum_default_methods<'a>(
+    cls: &'a syn::Ident,
+    variant_names: impl IntoIterator<Item = (&'a syn::Ident, Cow<'a, syn::Ident>)>,
+    ctx: &Ctx,
+) -> Vec<MethodAndMethodDef> {
+    let cls_type = syn::parse_quote!(#cls);
+    let variant_to_attribute = |var_ident: &syn::Ident, py_ident: &syn::Ident| ConstSpec {
+        rust_ident: var_ident.clone(),
+        attributes: ConstAttributes {
+            is_class_attr: true,
+            name: Some(NameAttribute {
+                kw: syn::parse_quote! { name },
+                value: NameLitStr(py_ident.clone()),
+            }),
+            deprecations: Deprecations::new(ctx),
+        },
+    };
+    variant_names
+        .into_iter()
+        .map(|(var, py_name)| {
+            gen_complex_enum_variant_attr(cls, &cls_type, &variant_to_attribute(var, &py_name), ctx)
+        })
+        .collect()
+}
+
+pub fn gen_complex_enum_variant_attr(
+    cls: &syn::Ident,
+    cls_type: &syn::Type,
+    spec: &ConstSpec<'_>,
+    ctx: &Ctx,
+) -> MethodAndMethodDef {
+    let Ctx { pyo3_path, .. } = ctx;
+    let member = &spec.rust_ident;
+    let wrapper_ident = format_ident!("__pymethod_variant_cls_{}__", member);
+    let deprecations = &spec.attributes.deprecations;
+    let python_name = spec.null_terminated_python_name(ctx);
+
+    let variant_cls = format_ident!("{}_{}", cls, member);
+    let associated_method = quote! {
+        fn #wrapper_ident(py: #pyo3_path::Python<'_>) -> #pyo3_path::PyResult<#pyo3_path::PyObject> {
+            #deprecations
+            ::std::result::Result::Ok(py.get_type_bound::<#variant_cls>().into_any().unbind())
+        }
+    };
+
+    let method_def = quote! {
+        #pyo3_path::impl_::pyclass::MaybeRuntimePyMethodDef::Static(
+            #pyo3_path::class::PyMethodDefType::ClassAttribute({
+                #pyo3_path::class::PyClassAttributeDef::new(
+                    #python_name,
+                    #cls_type::#wrapper_ident
+                )
+            })
+        )
+    };
+
+    MethodAndMethodDef {
+        associated_method,
+        method_def,
+    }
+}
+
+fn complex_enum_variant_new<'a>(
+    cls: &'a syn::Ident,
+    variant: PyClassEnumVariant<'a>,
+    ctx: &Ctx,
+) -> Result<MethodAndSlotDef> {
+    match variant {
+        PyClassEnumVariant::Struct(struct_variant) => {
+            complex_enum_struct_variant_new(cls, struct_variant, ctx)
+        }
+        PyClassEnumVariant::Tuple(tuple_variant) => {
+            complex_enum_tuple_variant_new(cls, tuple_variant, ctx)
+        }
+    }
+}
+
+fn complex_enum_struct_variant_new<'a>(
+    cls: &'a syn::Ident,
+    variant: PyClassEnumStructVariant<'a>,
+    ctx: &Ctx,
+) -> Result<MethodAndSlotDef> {
+    let Ctx { pyo3_path, .. } = ctx;
+    let variant_cls = format_ident!("{}_{}", cls, variant.ident);
+    let variant_cls_type: syn::Type = parse_quote!(#variant_cls);
+
+    let arg_py_ident: syn::Ident = parse_quote!(py);
+    let arg_py_type: syn::Type = parse_quote!(#pyo3_path::Python<'_>);
+
+    let args = {
+        let mut args = vec![
+            // py: Python<'_>
+            FnArg::Py(PyArg {
+                name: &arg_py_ident,
+                ty: &arg_py_type,
+            }),
+        ];
+
+        for field in &variant.fields {
+            args.push(FnArg::Regular(RegularArg {
+                name: Cow::Borrowed(field.ident),
+                ty: field.ty,
+                from_py_with: None,
+                default_value: None,
+                option_wrapped_type: None,
+            }));
+        }
+        args
+    };
+
+    let signature = if let Some(constructor) = variant.options.constructor {
+        crate::pyfunction::FunctionSignature::from_arguments_and_attribute(
+            args,
+            constructor.into_signature(),
+        )?
+    } else {
+        crate::pyfunction::FunctionSignature::from_arguments(args)?
+    };
+
+    let spec = FnSpec {
+        tp: crate::method::FnType::FnNew,
+        name: &format_ident!("__pymethod_constructor__"),
+        python_name: format_ident!("__new__"),
+        signature,
+        convention: crate::method::CallingConvention::TpNew,
+        text_signature: None,
+        asyncness: None,
+        unsafety: None,
+        deprecations: Deprecations::new(ctx),
+    };
+
+    crate::pymethod::impl_py_method_def_new(&variant_cls_type, &spec, ctx)
+}
+
+fn complex_enum_tuple_variant_new<'a>(
+    cls: &'a syn::Ident,
+    variant: PyClassEnumTupleVariant<'a>,
+    ctx: &Ctx,
+) -> Result<MethodAndSlotDef> {
+    let Ctx { pyo3_path, .. } = ctx;
+
+    let variant_cls: Ident = format_ident!("{}_{}", cls, variant.ident);
+    let variant_cls_type: syn::Type = parse_quote!(#variant_cls);
+
+    let arg_py_ident: syn::Ident = parse_quote!(py);
+    let arg_py_type: syn::Type = parse_quote!(#pyo3_path::Python<'_>);
+
+    let args = {
+        let mut args = vec![FnArg::Py(PyArg {
+            name: &arg_py_ident,
+            ty: &arg_py_type,
+        })];
+
+        for (i, field) in variant.fields.iter().enumerate() {
+            args.push(FnArg::Regular(RegularArg {
+                name: std::borrow::Cow::Owned(format_ident!("_{}", i)),
+                ty: field.ty,
+                from_py_with: None,
+                default_value: None,
+                option_wrapped_type: None,
+            }));
+        }
+        args
+    };
+
+    let signature = if let Some(constructor) = variant.options.constructor {
+        crate::pyfunction::FunctionSignature::from_arguments_and_attribute(
+            args,
+            constructor.into_signature(),
+        )?
+    } else {
+        crate::pyfunction::FunctionSignature::from_arguments(args)?
+    };
+
+    let spec = FnSpec {
+        tp: crate::method::FnType::FnNew,
+        name: &format_ident!("__pymethod_constructor__"),
+        python_name: format_ident!("__new__"),
+        signature,
+        convention: crate::method::CallingConvention::TpNew,
+        text_signature: None,
+        asyncness: None,
+        unsafety: None,
+        deprecations: Deprecations::new(ctx),
+    };
+
+    crate::pymethod::impl_py_method_def_new(&variant_cls_type, &spec, ctx)
+}
+
+fn complex_enum_variant_field_getter<'a>(
+    variant_cls_type: &'a syn::Type,
+    field_name: &'a syn::Ident,
+    field_span: Span,
+    ctx: &Ctx,
+) -> Result<MethodAndMethodDef> {
+    let signature = crate::pyfunction::FunctionSignature::from_arguments(vec![])?;
+
+    let self_type = crate::method::SelfType::TryFromBoundRef(field_span);
+
+    let spec = FnSpec {
+        tp: crate::method::FnType::Getter(self_type.clone()),
+        name: field_name,
+        python_name: field_name.clone(),
+        signature,
+        convention: crate::method::CallingConvention::Noargs,
+        text_signature: None,
+        asyncness: None,
+        unsafety: None,
+        deprecations: Deprecations::new(ctx),
+    };
+
+    let property_type = crate::pymethod::PropertyType::Function {
+        self_type: &self_type,
+        spec: &spec,
+        doc: crate::get_doc(&[], None, ctx),
+    };
+
+    let getter = crate::pymethod::impl_py_getter_def(variant_cls_type, property_type, ctx)?;
+    Ok(getter)
+}
+
+fn descriptors_to_items(
+    cls: &syn::Ident,
+    rename_all: Option<&RenameAllAttribute>,
+    frozen: Option<frozen>,
+    field_options: Vec<(&syn::Field, FieldPyO3Options)>,
+    ctx: &Ctx,
+) -> syn::Result<Vec<MethodAndMethodDef>> {
+    let ty = syn::parse_quote!(#cls);
+    let mut items = Vec::new();
+    for (field_index, (field, options)) in field_options.into_iter().enumerate() {
+        if let FieldPyO3Options {
+            name: Some(name),
+            get: None,
+            set: None,
+        } = options
+        {
+            return Err(syn::Error::new_spanned(name, USELESS_NAME));
+        }
+
+        if options.get.is_some() {
+            let getter = impl_py_getter_def(
+                &ty,
+                PropertyType::Descriptor {
+                    field_index,
+                    field,
+                    python_name: options.name.as_ref(),
+                    renaming_rule: rename_all.map(|rename_all| rename_all.value.rule),
+                },
+                ctx,
+            )?;
+            items.push(getter);
+        }
+
+        if let Some(set) = options.set {
+            ensure_spanned!(frozen.is_none(), set.span() => "cannot use `#[pyo3(set)]` on a `frozen` class");
+            let setter = impl_py_setter_def(
+                &ty,
+                PropertyType::Descriptor {
+                    field_index,
+                    field,
+                    python_name: options.name.as_ref(),
+                    renaming_rule: rename_all.map(|rename_all| rename_all.value.rule),
+                },
+                ctx,
+            )?;
+            items.push(setter);
+        };
+    }
+    Ok(items)
+}
+
+fn impl_pytypeinfo(
+    cls: &syn::Ident,
+    attr: &PyClassArgs,
+    deprecations: Option<&Deprecations<'_>>,
+    ctx: &Ctx,
+) -> TokenStream {
+    let Ctx { pyo3_path, .. } = ctx;
+    let cls_name = get_class_python_name(cls, attr).to_string();
+
+    let module = if let Some(ModuleAttribute { value, .. }) = &attr.options.module {
+        quote! { ::core::option::Option::Some(#value) }
+    } else {
+        quote! { ::core::option::Option::None }
+    };
+
+    #[cfg(feature = "gil-refs")]
+    let has_py_gil_ref = quote! {
+        #[allow(deprecated)]
+        unsafe impl #pyo3_path::type_object::HasPyGilRef for #cls {
+            type AsRefTarget = #pyo3_path::PyCell<Self>;
+        }
+    };
+
+    #[cfg(not(feature = "gil-refs"))]
+    let has_py_gil_ref = TokenStream::new();
+
+    quote! {
+        #has_py_gil_ref
+
+        unsafe impl #pyo3_path::type_object::PyTypeInfo for #cls {
+            const NAME: &'static str = #cls_name;
+            const MODULE: ::std::option::Option<&'static str> = #module;
+
+            #[inline]
+            fn type_object_raw(py: #pyo3_path::Python<'_>) -> *mut #pyo3_path::ffi::PyTypeObject {
+                use #pyo3_path::prelude::PyTypeMethods;
+                #deprecations
+
+                <#cls as #pyo3_path::impl_::pyclass::PyClassImpl>::lazy_type_object()
+                    .get_or_init(py)
+                    .as_type_ptr()
+            }
+        }
+    }
+}
+
+fn pyclass_richcmp_arms(
+    options: &PyClassPyO3Options,
+    ctx: &Ctx,
+) -> std::result::Result<TokenStream, syn::Error> {
+    let Ctx { pyo3_path, .. } = ctx;
+
+    let eq_arms = options
+        .eq
+        .map(|eq| eq.span)
+        .or(options.eq_int.map(|eq_int| eq_int.span))
+        .map(|span| {
+            quote_spanned! { span =>
+                #pyo3_path::pyclass::CompareOp::Eq => {
+                    ::std::result::Result::Ok(#pyo3_path::conversion::IntoPy::into_py(self_val == other, py))
+                },
+                #pyo3_path::pyclass::CompareOp::Ne => {
+                    ::std::result::Result::Ok(#pyo3_path::conversion::IntoPy::into_py(self_val != other, py))
+                },
+            }
+        })
+        .unwrap_or_default();
+
+    if let Some(ord) = options.ord {
+        ensure_spanned!(options.eq.is_some(), ord.span() => "The `ord` option requires the `eq` option.");
+    }
+
+    let ord_arms = options
+        .ord
+        .map(|ord| {
+            quote_spanned! { ord.span() =>
+                #pyo3_path::pyclass::CompareOp::Gt => {
+                    ::std::result::Result::Ok(#pyo3_path::conversion::IntoPy::into_py(self_val > other, py))
+                },
+                #pyo3_path::pyclass::CompareOp::Lt => {
+                    ::std::result::Result::Ok(#pyo3_path::conversion::IntoPy::into_py(self_val < other, py))
+                 },
+                #pyo3_path::pyclass::CompareOp::Le => {
+                    ::std::result::Result::Ok(#pyo3_path::conversion::IntoPy::into_py(self_val <= other, py))
+                 },
+                #pyo3_path::pyclass::CompareOp::Ge => {
+                    ::std::result::Result::Ok(#pyo3_path::conversion::IntoPy::into_py(self_val >= other, py))
+                 },
+            }
+        })
+        .unwrap_or_else(|| quote! { _ => ::std::result::Result::Ok(py.NotImplemented()) });
+
+    Ok(quote! {
+        #eq_arms
+        #ord_arms
+    })
+}
+
+fn pyclass_richcmp_simple_enum(
+    options: &PyClassPyO3Options,
+    cls: &syn::Type,
+    repr_type: &syn::Ident,
+    ctx: &Ctx,
+) -> Result<(Option<syn::ImplItemFn>, Option<MethodAndSlotDef>)> {
+    let Ctx { pyo3_path, .. } = ctx;
+
+    if let Some(eq_int) = options.eq_int {
+        ensure_spanned!(options.eq.is_some(), eq_int.span() => "The `eq_int` option requires the `eq` option.");
+    }
+
+    let deprecation = (options.eq_int.is_none() && options.eq.is_none())
+        .then(|| {
+            quote! {
+                #[deprecated(
+                    since = "0.22.0",
+                    note = "Implicit equality for simple enums is deprecated. Use `#[pyclass(eq, eq_int)` to keep the current behavior."
+                )]
+                const DEPRECATION: () = ();
+                const _: () = DEPRECATION;
+            }
+        })
+        .unwrap_or_default();
+
+    let mut options = options.clone();
+    if options.eq.is_none() {
+        options.eq_int = Some(parse_quote!(eq_int));
+    }
+
+    if options.eq.is_none() && options.eq_int.is_none() {
+        return Ok((None, None));
+    }
+
+    let arms = pyclass_richcmp_arms(&options, ctx)?;
+
+    let eq = options.eq.map(|eq| {
+        quote_spanned! { eq.span() =>
+            let self_val = self;
+            if let ::std::result::Result::Ok(other) = #pyo3_path::types::PyAnyMethods::downcast::<Self>(other) {
+                let other = &*other.borrow();
+                return match op {
+                    #arms
+                }
+            }
+        }
+    });
+
+    let eq_int = options.eq_int.map(|eq_int| {
+        quote_spanned! { eq_int.span() =>
+            let self_val = self.__pyo3__int__();
+            if let ::std::result::Result::Ok(other) = #pyo3_path::types::PyAnyMethods::extract::<#repr_type>(other).or_else(|_| {
+                #pyo3_path::types::PyAnyMethods::downcast::<Self>(other).map(|o| o.borrow().__pyo3__int__())
+            }) {
+                return match op {
+                    #arms
+                }
+            }
+        }
+    });
+
+    let mut richcmp_impl = parse_quote! {
+        fn __pyo3__generated____richcmp__(
+            &self,
+            py: #pyo3_path::Python,
+            other: &#pyo3_path::Bound<'_, #pyo3_path::PyAny>,
+            op: #pyo3_path::pyclass::CompareOp
+        ) -> #pyo3_path::PyResult<#pyo3_path::PyObject> {
+            #deprecation
+
+            #eq
+
+            #eq_int
+
+            ::std::result::Result::Ok(py.NotImplemented())
+        }
+    };
+    let richcmp_slot = if options.eq.is_some() {
+        generate_protocol_slot(cls, &mut richcmp_impl, &__RICHCMP__, "__richcmp__", ctx).unwrap()
+    } else {
+        generate_default_protocol_slot(cls, &mut richcmp_impl, &__RICHCMP__, ctx).unwrap()
+    };
+    Ok((Some(richcmp_impl), Some(richcmp_slot)))
+}
+
+fn pyclass_richcmp(
+    options: &PyClassPyO3Options,
+    cls: &syn::Type,
+    ctx: &Ctx,
+) -> Result<(Option<syn::ImplItemFn>, Option<MethodAndSlotDef>)> {
+    let Ctx { pyo3_path, .. } = ctx;
+    if let Some(eq_int) = options.eq_int {
+        bail_spanned!(eq_int.span() => "`eq_int` can only be used on simple enums.")
+    }
+
+    let arms = pyclass_richcmp_arms(options, ctx)?;
+    if options.eq.is_some() {
+        let mut richcmp_impl = parse_quote! {
+            fn __pyo3__generated____richcmp__(
+                &self,
+                py: #pyo3_path::Python,
+                other: &#pyo3_path::Bound<'_, #pyo3_path::PyAny>,
+                op: #pyo3_path::pyclass::CompareOp
+            ) -> #pyo3_path::PyResult<#pyo3_path::PyObject> {
+                let self_val = self;
+                if let Ok(other) = #pyo3_path::types::PyAnyMethods::downcast::<Self>(other) {
+                    let other = &*other.borrow();
+                    match op {
+                        #arms
+                    }
+                } else {
+                    ::std::result::Result::Ok(py.NotImplemented())
+                }
+            }
+        };
+        let richcmp_slot =
+            generate_protocol_slot(cls, &mut richcmp_impl, &__RICHCMP__, "__richcmp__", ctx)
+                .unwrap();
+        Ok((Some(richcmp_impl), Some(richcmp_slot)))
+    } else {
+        Ok((None, None))
+    }
+}
+
+fn pyclass_hash(
+    options: &PyClassPyO3Options,
+    cls: &syn::Type,
+    ctx: &Ctx,
+) -> Result<(Option<syn::ImplItemFn>, Option<MethodAndSlotDef>)> {
+    if options.hash.is_some() {
+        ensure_spanned!(
+            options.frozen.is_some(), options.hash.span() => "The `hash` option requires the `frozen` option.";
+            options.eq.is_some(), options.hash.span() => "The `hash` option requires the `eq` option.";
+        );
+    }
+    // FIXME: Use hash.map(...).unzip() on MSRV >= 1.66
+    match options.hash {
+        Some(opt) => {
+            let mut hash_impl = parse_quote_spanned! { opt.span() =>
+                fn __pyo3__generated____hash__(&self) -> u64 {
+                    let mut s = ::std::collections::hash_map::DefaultHasher::new();
+                    ::std::hash::Hash::hash(self, &mut s);
+                    ::std::hash::Hasher::finish(&s)
+                }
+            };
+            let hash_slot =
+                generate_protocol_slot(cls, &mut hash_impl, &__HASH__, "__hash__", ctx).unwrap();
+            Ok((Some(hash_impl), Some(hash_slot)))
+        }
+        None => Ok((None, None)),
+    }
+}
+
+/// Implements most traits used by `#[pyclass]`.
+///
+/// Specifically, it implements traits that only depend on class name,
+/// and attributes of `#[pyclass]`, and docstrings.
+/// Therefore it doesn't implement traits that depends on struct fields and enum variants.
+struct PyClassImplsBuilder<'a> {
+    cls: &'a syn::Ident,
+    attr: &'a PyClassArgs,
+    methods_type: PyClassMethodsType,
+    default_methods: Vec<MethodAndMethodDef>,
+    default_slots: Vec<MethodAndSlotDef>,
+    doc: Option<PythonDoc>,
+}
+
+impl<'a> PyClassImplsBuilder<'a> {
+    fn new(
+        cls: &'a syn::Ident,
+        attr: &'a PyClassArgs,
+        methods_type: PyClassMethodsType,
+        default_methods: Vec<MethodAndMethodDef>,
+        default_slots: Vec<MethodAndSlotDef>,
+    ) -> Self {
+        Self {
+            cls,
+            attr,
+            methods_type,
+            default_methods,
+            default_slots,
+            doc: None,
+        }
+    }
+
+    fn doc(self, doc: PythonDoc) -> Self {
+        Self {
+            doc: Some(doc),
+            ..self
+        }
+    }
+
+    fn impl_all(&self, ctx: &Ctx) -> Result<TokenStream> {
+        let tokens = [
+            self.impl_pyclass(ctx),
+            self.impl_extractext(ctx),
+            self.impl_into_py(ctx),
+            self.impl_pyclassimpl(ctx)?,
+            self.impl_add_to_module(ctx),
+            self.impl_freelist(ctx),
+        ]
+        .into_iter()
+        .collect();
+        Ok(tokens)
+    }
+
+    fn impl_pyclass(&self, ctx: &Ctx) -> TokenStream {
+        let Ctx { pyo3_path, .. } = ctx;
+        let cls = self.cls;
+
+        let frozen = if self.attr.options.frozen.is_some() {
+            quote! { #pyo3_path::pyclass::boolean_struct::True }
+        } else {
+            quote! { #pyo3_path::pyclass::boolean_struct::False }
+        };
+
+        quote! {
+            impl #pyo3_path::PyClass for #cls {
+                type Frozen = #frozen;
+            }
+        }
+    }
+    fn impl_extractext(&self, ctx: &Ctx) -> TokenStream {
+        let Ctx { pyo3_path, .. } = ctx;
+        let cls = self.cls;
+        if self.attr.options.frozen.is_some() {
+            quote! {
+                impl<'a, 'py> #pyo3_path::impl_::extract_argument::PyFunctionArgument<'a, 'py> for &'a #cls
+                {
+                    type Holder = ::std::option::Option<#pyo3_path::PyRef<'py, #cls>>;
+
+                    #[inline]
+                    fn extract(obj: &'a #pyo3_path::Bound<'py, #pyo3_path::PyAny>, holder: &'a mut Self::Holder) -> #pyo3_path::PyResult<Self> {
+                        #pyo3_path::impl_::extract_argument::extract_pyclass_ref(obj, holder)
+                    }
+                }
+            }
+        } else {
+            quote! {
+                impl<'a, 'py> #pyo3_path::impl_::extract_argument::PyFunctionArgument<'a, 'py> for &'a #cls
+                {
+                    type Holder = ::std::option::Option<#pyo3_path::PyRef<'py, #cls>>;
+
+                    #[inline]
+                    fn extract(obj: &'a #pyo3_path::Bound<'py, #pyo3_path::PyAny>, holder: &'a mut Self::Holder) -> #pyo3_path::PyResult<Self> {
+                        #pyo3_path::impl_::extract_argument::extract_pyclass_ref(obj, holder)
+                    }
+                }
+
+                impl<'a, 'py> #pyo3_path::impl_::extract_argument::PyFunctionArgument<'a, 'py> for &'a mut #cls
+                {
+                    type Holder = ::std::option::Option<#pyo3_path::PyRefMut<'py, #cls>>;
+
+                    #[inline]
+                    fn extract(obj: &'a #pyo3_path::Bound<'py, #pyo3_path::PyAny>, holder: &'a mut Self::Holder) -> #pyo3_path::PyResult<Self> {
+                        #pyo3_path::impl_::extract_argument::extract_pyclass_ref_mut(obj, holder)
+                    }
+                }
+            }
+        }
+    }
+
+    fn impl_into_py(&self, ctx: &Ctx) -> TokenStream {
+        let Ctx { pyo3_path, .. } = ctx;
+        let cls = self.cls;
+        let attr = self.attr;
+        // If #cls is not extended type, we allow Self->PyObject conversion
+        if attr.options.extends.is_none() {
+            quote! {
+                impl #pyo3_path::IntoPy<#pyo3_path::PyObject> for #cls {
+                    fn into_py(self, py: #pyo3_path::Python) -> #pyo3_path::PyObject {
+                        #pyo3_path::IntoPy::into_py(#pyo3_path::Py::new(py, self).unwrap(), py)
+                    }
+                }
+            }
+        } else {
+            quote! {}
+        }
+    }
+    fn impl_pyclassimpl(&self, ctx: &Ctx) -> Result<TokenStream> {
+        let Ctx { pyo3_path, .. } = ctx;
+        let cls = self.cls;
+        let doc = self.doc.as_ref().map_or(
+            LitCStr::empty(ctx).to_token_stream(),
+            PythonDoc::to_token_stream,
+        );
+        let is_basetype = self.attr.options.subclass.is_some();
+        let base = match &self.attr.options.extends {
+            Some(extends_attr) => extends_attr.value.clone(),
+            None => parse_quote! { #pyo3_path::PyAny },
+        };
+        let is_subclass = self.attr.options.extends.is_some();
+        let is_mapping: bool = self.attr.options.mapping.is_some();
+        let is_sequence: bool = self.attr.options.sequence.is_some();
+
+        ensure_spanned!(
+            !(is_mapping && is_sequence),
+            self.cls.span() => "a `#[pyclass]` cannot be both a `mapping` and a `sequence`"
+        );
+
+        let dict_offset = if self.attr.options.dict.is_some() {
+            quote! {
+                fn dict_offset() -> ::std::option::Option<#pyo3_path::ffi::Py_ssize_t> {
+                    ::std::option::Option::Some(#pyo3_path::impl_::pyclass::dict_offset::<Self>())
+                }
+            }
+        } else {
+            TokenStream::new()
+        };
+
+        // insert space for weak ref
+        let weaklist_offset = if self.attr.options.weakref.is_some() {
+            quote! {
+                fn weaklist_offset() -> ::std::option::Option<#pyo3_path::ffi::Py_ssize_t> {
+                    ::std::option::Option::Some(#pyo3_path::impl_::pyclass::weaklist_offset::<Self>())
+                }
+            }
+        } else {
+            TokenStream::new()
+        };
+
+        let thread_checker = if self.attr.options.unsendable.is_some() {
+            quote! { #pyo3_path::impl_::pyclass::ThreadCheckerImpl }
+        } else {
+            quote! { #pyo3_path::impl_::pyclass::SendablePyClass<#cls> }
+        };
+
+        let (pymethods_items, inventory, inventory_class) = match self.methods_type {
+            PyClassMethodsType::Specialization => (quote! { collector.py_methods() }, None, None),
+            PyClassMethodsType::Inventory => {
+                // To allow multiple #[pymethods] block, we define inventory types.
+                let inventory_class_name = syn::Ident::new(
+                    &format!("Pyo3MethodsInventoryFor{}", cls.unraw()),
+                    Span::call_site(),
+                );
+                (
+                    quote! {
+                        ::std::boxed::Box::new(
+                            ::std::iter::Iterator::map(
+                                #pyo3_path::inventory::iter::<<Self as #pyo3_path::impl_::pyclass::PyClassImpl>::Inventory>(),
+                                #pyo3_path::impl_::pyclass::PyClassInventory::items
+                            )
+                        )
+                    },
+                    Some(quote! { type Inventory = #inventory_class_name; }),
+                    Some(define_inventory_class(&inventory_class_name, ctx)),
+                )
+            }
+        };
+
+        let default_methods = self
+            .default_methods
+            .iter()
+            .map(|meth| &meth.associated_method)
+            .chain(
+                self.default_slots
+                    .iter()
+                    .map(|meth| &meth.associated_method),
+            );
+
+        let default_method_defs = self.default_methods.iter().map(|meth| &meth.method_def);
+        let default_slot_defs = self.default_slots.iter().map(|slot| &slot.slot_def);
+        let freelist_slots = self.freelist_slots(ctx);
+
+        let class_mutability = if self.attr.options.frozen.is_some() {
+            quote! {
+                ImmutableChild
+            }
+        } else {
+            quote! {
+                MutableChild
+            }
+        };
+
+        let cls = self.cls;
+        let attr = self.attr;
+        let dict = if attr.options.dict.is_some() {
+            quote! { #pyo3_path::impl_::pyclass::PyClassDictSlot }
+        } else {
+            quote! { #pyo3_path::impl_::pyclass::PyClassDummySlot }
+        };
+
+        // insert space for weak ref
+        let weakref = if attr.options.weakref.is_some() {
+            quote! { #pyo3_path::impl_::pyclass::PyClassWeakRefSlot }
+        } else {
+            quote! { #pyo3_path::impl_::pyclass::PyClassDummySlot }
+        };
+
+        let base_nativetype = if attr.options.extends.is_some() {
+            quote! { <Self::BaseType as #pyo3_path::impl_::pyclass::PyClassBaseType>::BaseNativeType }
+        } else {
+            quote! { #pyo3_path::PyAny }
+        };
+
+        Ok(quote! {
+            impl #pyo3_path::impl_::pyclass::PyClassImpl for #cls {
+                const IS_BASETYPE: bool = #is_basetype;
+                const IS_SUBCLASS: bool = #is_subclass;
+                const IS_MAPPING: bool = #is_mapping;
+                const IS_SEQUENCE: bool = #is_sequence;
+
+                type BaseType = #base;
+                type ThreadChecker = #thread_checker;
+                #inventory
+                type PyClassMutability = <<#base as #pyo3_path::impl_::pyclass::PyClassBaseType>::PyClassMutability as #pyo3_path::impl_::pycell::PyClassMutability>::#class_mutability;
+                type Dict = #dict;
+                type WeakRef = #weakref;
+                type BaseNativeType = #base_nativetype;
+
+                fn items_iter() -> #pyo3_path::impl_::pyclass::PyClassItemsIter {
+                    use #pyo3_path::impl_::pyclass::*;
+                    let collector = PyClassImplCollector::<Self>::new();
+                    static INTRINSIC_ITEMS: PyClassItems = PyClassItems {
+                        methods: &[#(#default_method_defs),*],
+                        slots: &[#(#default_slot_defs),* #(#freelist_slots),*],
+                    };
+                    PyClassItemsIter::new(&INTRINSIC_ITEMS, #pymethods_items)
+                }
+
+                fn doc(py: #pyo3_path::Python<'_>) -> #pyo3_path::PyResult<&'static ::std::ffi::CStr>  {
+                    use #pyo3_path::impl_::pyclass::*;
+                    static DOC: #pyo3_path::sync::GILOnceCell<::std::borrow::Cow<'static, ::std::ffi::CStr>> = #pyo3_path::sync::GILOnceCell::new();
+                    DOC.get_or_try_init(py, || {
+                        let collector = PyClassImplCollector::<Self>::new();
+                        build_pyclass_doc(<#cls as #pyo3_path::PyTypeInfo>::NAME, #doc, collector.new_text_signature())
+                    }).map(::std::ops::Deref::deref)
+                }
+
+                #dict_offset
+
+                #weaklist_offset
+
+                fn lazy_type_object() -> &'static #pyo3_path::impl_::pyclass::LazyTypeObject<Self> {
+                    use #pyo3_path::impl_::pyclass::LazyTypeObject;
+                    static TYPE_OBJECT: LazyTypeObject<#cls> = LazyTypeObject::new();
+                    &TYPE_OBJECT
+                }
+            }
+
+            #[doc(hidden)]
+            #[allow(non_snake_case)]
+            impl #cls {
+                #(#default_methods)*
+            }
+
+            #inventory_class
+        })
+    }
+
+    fn impl_add_to_module(&self, ctx: &Ctx) -> TokenStream {
+        let Ctx { pyo3_path, .. } = ctx;
+        let cls = self.cls;
+        quote! {
+            impl #cls {
+                #[doc(hidden)]
+                pub const _PYO3_DEF: #pyo3_path::impl_::pymodule::AddClassToModule<Self> = #pyo3_path::impl_::pymodule::AddClassToModule::new();
+            }
+        }
+    }
+
+    fn impl_freelist(&self, ctx: &Ctx) -> TokenStream {
+        let cls = self.cls;
+        let Ctx { pyo3_path, .. } = ctx;
+
+        self.attr.options.freelist.as_ref().map_or(quote!{}, |freelist| {
+            let freelist = &freelist.value;
+            quote! {
+                impl #pyo3_path::impl_::pyclass::PyClassWithFreeList for #cls {
+                    #[inline]
+                    fn get_free_list(py: #pyo3_path::Python<'_>) -> &mut #pyo3_path::impl_::freelist::FreeList<*mut #pyo3_path::ffi::PyObject> {
+                        static mut FREELIST: *mut #pyo3_path::impl_::freelist::FreeList<*mut #pyo3_path::ffi::PyObject> = 0 as *mut _;
+                        unsafe {
+                            if FREELIST.is_null() {
+                                FREELIST = ::std::boxed::Box::into_raw(::std::boxed::Box::new(
+                                    #pyo3_path::impl_::freelist::FreeList::with_capacity(#freelist)));
+                            }
+                            &mut *FREELIST
+                        }
+                    }
+                }
+            }
+        })
+    }
+
+    fn freelist_slots(&self, ctx: &Ctx) -> Vec<TokenStream> {
+        let Ctx { pyo3_path, .. } = ctx;
+        let cls = self.cls;
+
+        if self.attr.options.freelist.is_some() {
+            vec![
+                quote! {
+                    #pyo3_path::ffi::PyType_Slot {
+                        slot: #pyo3_path::ffi::Py_tp_alloc,
+                        pfunc: #pyo3_path::impl_::pyclass::alloc_with_freelist::<#cls> as *mut _,
+                    }
+                },
+                quote! {
+                    #pyo3_path::ffi::PyType_Slot {
+                        slot: #pyo3_path::ffi::Py_tp_free,
+                        pfunc: #pyo3_path::impl_::pyclass::free_with_freelist::<#cls> as *mut _,
+                    }
+                },
+            ]
+        } else {
+            Vec::new()
+        }
+    }
+}
+
+fn define_inventory_class(inventory_class_name: &syn::Ident, ctx: &Ctx) -> TokenStream {
+    let Ctx { pyo3_path, .. } = ctx;
+    quote! {
+        #[doc(hidden)]
+        pub struct #inventory_class_name {
+            items: #pyo3_path::impl_::pyclass::PyClassItems,
+        }
+        impl #inventory_class_name {
+            pub const fn new(items: #pyo3_path::impl_::pyclass::PyClassItems) -> Self {
+                Self { items }
+            }
+        }
+
+        impl #pyo3_path::impl_::pyclass::PyClassInventory for #inventory_class_name {
+            fn items(&self) -> &#pyo3_path::impl_::pyclass::PyClassItems {
+                &self.items
+            }
+        }
+
+        #pyo3_path::inventory::collect!(#inventory_class_name);
+    }
+}
+
+const UNIQUE_GET: &str = "`get` may only be specified once";
+const UNIQUE_SET: &str = "`set` may only be specified once";
+const UNIQUE_NAME: &str = "`name` may only be specified once";
+
+const DUPE_SET: &str = "useless `set` - the struct is already annotated with `set_all`";
+const DUPE_GET: &str = "useless `get` - the struct is already annotated with `get_all`";
+const UNIT_GET: &str =
+    "`get_all` on an unit struct does nothing, because unit structs have no fields";
+const UNIT_SET: &str =
+    "`set_all` on an unit struct does nothing, because unit structs have no fields";
+
+const USELESS_NAME: &str = "`name` is useless without `get` or `set`";
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/src/pyfunction/signature.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/pyfunction/signature.rs
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/src/pyfunction/signature.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/pyfunction/signature.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,609 @@
+use proc_macro2::{Span, TokenStream};
+use quote::ToTokens;
+use syn::{
+    ext::IdentExt,
+    parse::{Parse, ParseStream},
+    punctuated::Punctuated,
+    spanned::Spanned,
+    Token,
+};
+
+use crate::{
+    attributes::{kw, KeywordAttribute},
+    method::{FnArg, RegularArg},
+};
+
+#[derive(Clone)]
+pub struct Signature {
+    paren_token: syn::token::Paren,
+    pub items: Punctuated<SignatureItem, Token![,]>,
+}
+
+impl Parse for Signature {
+    fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
+        let content;
+        let paren_token = syn::parenthesized!(content in input);
+
+        let items = content.parse_terminated(SignatureItem::parse, Token![,])?;
+
+        Ok(Signature { paren_token, items })
+    }
+}
+
+impl ToTokens for Signature {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        self.paren_token
+            .surround(tokens, |tokens| self.items.to_tokens(tokens))
+    }
+}
+
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct SignatureItemArgument {
+    pub ident: syn::Ident,
+    pub eq_and_default: Option<(Token![=], syn::Expr)>,
+}
+
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct SignatureItemPosargsSep {
+    pub slash: Token![/],
+}
+
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct SignatureItemVarargsSep {
+    pub asterisk: Token![*],
+}
+
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct SignatureItemVarargs {
+    pub sep: SignatureItemVarargsSep,
+    pub ident: syn::Ident,
+}
+
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct SignatureItemKwargs {
+    pub asterisks: (Token![*], Token![*]),
+    pub ident: syn::Ident,
+}
+
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub enum SignatureItem {
+    Argument(Box<SignatureItemArgument>),
+    PosargsSep(SignatureItemPosargsSep),
+    VarargsSep(SignatureItemVarargsSep),
+    Varargs(SignatureItemVarargs),
+    Kwargs(SignatureItemKwargs),
+}
+
+impl Parse for SignatureItem {
+    fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(Token![*]) {
+            if input.peek2(Token![*]) {
+                input.parse().map(SignatureItem::Kwargs)
+            } else {
+                let sep = input.parse()?;
+                if input.is_empty() || input.peek(Token![,]) {
+                    Ok(SignatureItem::VarargsSep(sep))
+                } else {
+                    Ok(SignatureItem::Varargs(SignatureItemVarargs {
+                        sep,
+                        ident: input.parse()?,
+                    }))
+                }
+            }
+        } else if lookahead.peek(Token![/]) {
+            input.parse().map(SignatureItem::PosargsSep)
+        } else {
+            input.parse().map(SignatureItem::Argument)
+        }
+    }
+}
+
+impl ToTokens for SignatureItem {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        match self {
+            SignatureItem::Argument(arg) => arg.to_tokens(tokens),
+            SignatureItem::Varargs(varargs) => varargs.to_tokens(tokens),
+            SignatureItem::VarargsSep(sep) => sep.to_tokens(tokens),
+            SignatureItem::Kwargs(kwargs) => kwargs.to_tokens(tokens),
+            SignatureItem::PosargsSep(sep) => sep.to_tokens(tokens),
+        }
+    }
+}
+
+impl Parse for SignatureItemArgument {
+    fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
+        Ok(Self {
+            ident: input.parse()?,
+            eq_and_default: if input.peek(Token![=]) {
+                Some((input.parse()?, input.parse()?))
+            } else {
+                None
+            },
+        })
+    }
+}
+
+impl ToTokens for SignatureItemArgument {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        self.ident.to_tokens(tokens);
+        if let Some((eq, default)) = &self.eq_and_default {
+            eq.to_tokens(tokens);
+            default.to_tokens(tokens);
+        }
+    }
+}
+
+impl Parse for SignatureItemVarargsSep {
+    fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
+        Ok(Self {
+            asterisk: input.parse()?,
+        })
+    }
+}
+
+impl ToTokens for SignatureItemVarargsSep {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        self.asterisk.to_tokens(tokens);
+    }
+}
+
+impl Parse for SignatureItemVarargs {
+    fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
+        Ok(Self {
+            sep: input.parse()?,
+            ident: input.parse()?,
+        })
+    }
+}
+
+impl ToTokens for SignatureItemVarargs {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        self.sep.to_tokens(tokens);
+        self.ident.to_tokens(tokens);
+    }
+}
+
+impl Parse for SignatureItemKwargs {
+    fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
+        Ok(Self {
+            asterisks: (input.parse()?, input.parse()?),
+            ident: input.parse()?,
+        })
+    }
+}
+
+impl ToTokens for SignatureItemKwargs {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        self.asterisks.0.to_tokens(tokens);
+        self.asterisks.1.to_tokens(tokens);
+        self.ident.to_tokens(tokens);
+    }
+}
+
+impl Parse for SignatureItemPosargsSep {
+    fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
+        Ok(Self {
+            slash: input.parse()?,
+        })
+    }
+}
+
+impl ToTokens for SignatureItemPosargsSep {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        self.slash.to_tokens(tokens);
+    }
+}
+
+pub type SignatureAttribute = KeywordAttribute<kw::signature, Signature>;
+pub type ConstructorAttribute = KeywordAttribute<kw::constructor, Signature>;
+
+impl ConstructorAttribute {
+    pub fn into_signature(self) -> SignatureAttribute {
+        SignatureAttribute {
+            kw: kw::signature(self.kw.span),
+            value: self.value,
+        }
+    }
+}
+
+#[derive(Default)]
+pub struct PythonSignature {
+    pub positional_parameters: Vec<String>,
+    pub positional_only_parameters: usize,
+    pub required_positional_parameters: usize,
+    pub varargs: Option<String>,
+    // Tuples of keyword name and whether it is required
+    pub keyword_only_parameters: Vec<(String, bool)>,
+    pub kwargs: Option<String>,
+}
+
+impl PythonSignature {
+    pub fn has_no_args(&self) -> bool {
+        self.positional_parameters.is_empty()
+            && self.keyword_only_parameters.is_empty()
+            && self.varargs.is_none()
+            && self.kwargs.is_none()
+    }
+}
+
+pub struct FunctionSignature<'a> {
+    pub arguments: Vec<FnArg<'a>>,
+    pub python_signature: PythonSignature,
+    pub attribute: Option<SignatureAttribute>,
+}
+
+pub enum ParseState {
+    /// Accepting positional parameters, which might be positional only
+    Positional,
+    /// Accepting positional parameters after '/'
+    PositionalAfterPosargs,
+    /// Accepting keyword-only parameters after '*' or '*args'
+    Keywords,
+    /// After `**kwargs` nothing is allowed
+    Done,
+}
+
+impl ParseState {
+    fn add_argument(
+        &mut self,
+        signature: &mut PythonSignature,
+        name: String,
+        required: bool,
+        span: Span,
+    ) -> syn::Result<()> {
+        match self {
+            ParseState::Positional | ParseState::PositionalAfterPosargs => {
+                signature.positional_parameters.push(name);
+                if required {
+                    signature.required_positional_parameters += 1;
+                    ensure_spanned!(
+                        signature.required_positional_parameters == signature.positional_parameters.len(),
+                        span => "cannot have required positional parameter after an optional parameter"
+                    );
+                }
+                Ok(())
+            }
+            ParseState::Keywords => {
+                signature.keyword_only_parameters.push((name, required));
+                Ok(())
+            }
+            ParseState::Done => {
+                bail_spanned!(span => format!("no more arguments are allowed after `**{}`", signature.kwargs.as_deref().unwrap_or("")))
+            }
+        }
+    }
+
+    fn add_varargs(
+        &mut self,
+        signature: &mut PythonSignature,
+        varargs: &SignatureItemVarargs,
+    ) -> syn::Result<()> {
+        match self {
+            ParseState::Positional | ParseState::PositionalAfterPosargs => {
+                signature.varargs = Some(varargs.ident.to_string());
+                *self = ParseState::Keywords;
+                Ok(())
+            }
+            ParseState::Keywords => {
+                bail_spanned!(varargs.span() => format!("`*{}` not allowed after `*{}`", varargs.ident, signature.varargs.as_deref().unwrap_or("")))
+            }
+            ParseState::Done => {
+                bail_spanned!(varargs.span() => format!("`*{}` not allowed after `**{}`", varargs.ident, signature.kwargs.as_deref().unwrap_or("")))
+            }
+        }
+    }
+
+    fn add_kwargs(
+        &mut self,
+        signature: &mut PythonSignature,
+        kwargs: &SignatureItemKwargs,
+    ) -> syn::Result<()> {
+        match self {
+            ParseState::Positional | ParseState::PositionalAfterPosargs | ParseState::Keywords => {
+                signature.kwargs = Some(kwargs.ident.to_string());
+                *self = ParseState::Done;
+                Ok(())
+            }
+            ParseState::Done => {
+                bail_spanned!(kwargs.span() => format!("`**{}` not allowed after `**{}`", kwargs.ident, signature.kwargs.as_deref().unwrap_or("")))
+            }
+        }
+    }
+
+    fn finish_pos_only_args(
+        &mut self,
+        signature: &mut PythonSignature,
+        span: Span,
+    ) -> syn::Result<()> {
+        match self {
+            ParseState::Positional => {
+                signature.positional_only_parameters = signature.positional_parameters.len();
+                *self = ParseState::PositionalAfterPosargs;
+                Ok(())
+            }
+            ParseState::PositionalAfterPosargs => {
+                bail_spanned!(span => "`/` not allowed after `/`")
+            }
+            ParseState::Keywords => {
+                bail_spanned!(span => format!("`/` not allowed after `*{}`", signature.varargs.as_deref().unwrap_or("")))
+            }
+            ParseState::Done => {
+                bail_spanned!(span => format!("`/` not allowed after `**{}`", signature.kwargs.as_deref().unwrap_or("")))
+            }
+        }
+    }
+
+    fn finish_pos_args(&mut self, signature: &PythonSignature, span: Span) -> syn::Result<()> {
+        match self {
+            ParseState::Positional | ParseState::PositionalAfterPosargs => {
+                *self = ParseState::Keywords;
+                Ok(())
+            }
+            ParseState::Keywords => {
+                bail_spanned!(span => format!("`*` not allowed after `*{}`", signature.varargs.as_deref().unwrap_or("")))
+            }
+            ParseState::Done => {
+                bail_spanned!(span => format!("`*` not allowed after `**{}`", signature.kwargs.as_deref().unwrap_or("")))
+            }
+        }
+    }
+}
+
+impl<'a> FunctionSignature<'a> {
+    pub fn from_arguments_and_attribute(
+        mut arguments: Vec<FnArg<'a>>,
+        attribute: SignatureAttribute,
+    ) -> syn::Result<Self> {
+        let mut parse_state = ParseState::Positional;
+        let mut python_signature = PythonSignature::default();
+
+        let mut args_iter = arguments.iter_mut();
+
+        let mut next_non_py_argument_checked = |name: &syn::Ident| {
+            for fn_arg in args_iter.by_ref() {
+                match fn_arg {
+                    crate::method::FnArg::Py(..) => {
+                        // If the user incorrectly tried to include py: Python in the
+                        // signature, give a useful error as a hint.
+                        ensure_spanned!(
+                            name != fn_arg.name(),
+                            name.span() => "arguments of type `Python` must not be part of the signature"
+                        );
+                        // Otherwise try next argument.
+                        continue;
+                    }
+                    crate::method::FnArg::CancelHandle(..) => {
+                        // If the user incorrectly tried to include cancel: CoroutineCancel in the
+                        // signature, give a useful error as a hint.
+                        ensure_spanned!(
+                            name != fn_arg.name(),
+                            name.span() => "`cancel_handle` argument must not be part of the signature"
+                        );
+                        // Otherwise try next argument.
+                        continue;
+                    }
+                    _ => {
+                        ensure_spanned!(
+                            name == fn_arg.name(),
+                            name.span() => format!(
+                                "expected argument from function definition `{}` but got argument `{}`",
+                                fn_arg.name().unraw(),
+                                name.unraw(),
+                            )
+                        );
+                        return Ok(fn_arg);
+                    }
+                }
+            }
+            bail_spanned!(
+                name.span() => "signature entry does not have a corresponding function argument"
+            )
+        };
+
+        for item in &attribute.value.items {
+            match item {
+                SignatureItem::Argument(arg) => {
+                    let fn_arg = next_non_py_argument_checked(&arg.ident)?;
+                    parse_state.add_argument(
+                        &mut python_signature,
+                        arg.ident.unraw().to_string(),
+                        arg.eq_and_default.is_none(),
+                        arg.span(),
+                    )?;
+                    if let Some((_, default)) = &arg.eq_and_default {
+                        if let FnArg::Regular(arg) = fn_arg {
+                            arg.default_value = Some(default.clone());
+                        } else {
+                            unreachable!(
+                                "`Python` and `CancelHandle` are already handled above and `*args`/`**kwargs` are \
+                                parsed and transformed below. Because the have to come last and are only allowed \
+                                once, this has to be a regular argument."
+                            );
+                        }
+                    }
+                }
+                SignatureItem::VarargsSep(sep) => {
+                    parse_state.finish_pos_args(&python_signature, sep.span())?
+                }
+                SignatureItem::Varargs(varargs) => {
+                    let fn_arg = next_non_py_argument_checked(&varargs.ident)?;
+                    fn_arg.to_varargs_mut()?;
+                    parse_state.add_varargs(&mut python_signature, varargs)?;
+                }
+                SignatureItem::Kwargs(kwargs) => {
+                    let fn_arg = next_non_py_argument_checked(&kwargs.ident)?;
+                    fn_arg.to_kwargs_mut()?;
+                    parse_state.add_kwargs(&mut python_signature, kwargs)?;
+                }
+                SignatureItem::PosargsSep(sep) => {
+                    parse_state.finish_pos_only_args(&mut python_signature, sep.span())?
+                }
+            };
+        }
+
+        // Ensure no non-py arguments remain
+        if let Some(arg) =
+            args_iter.find(|arg| !matches!(arg, FnArg::Py(..) | FnArg::CancelHandle(..)))
+        {
+            bail_spanned!(
+                attribute.kw.span() => format!("missing signature entry for argument `{}`", arg.name())
+            );
+        }
+
+        Ok(FunctionSignature {
+            arguments,
+            python_signature,
+            attribute: Some(attribute),
+        })
+    }
+
+    /// Without `#[pyo3(signature)]` or `#[args]` - just take the Rust function arguments as positional.
+    pub fn from_arguments(arguments: Vec<FnArg<'a>>) -> syn::Result<Self> {
+        let mut python_signature = PythonSignature::default();
+        for arg in &arguments {
+            // Python<'_> arguments don't show in Python signature
+            if matches!(arg, FnArg::Py(..) | FnArg::CancelHandle(..)) {
+                continue;
+            }
+
+            if let FnArg::Regular(RegularArg {
+                ty,
+                option_wrapped_type: None,
+                ..
+            }) = arg
+            {
+                // This argument is required, all previous arguments must also have been required
+                ensure_spanned!(
+                    python_signature.required_positional_parameters == python_signature.positional_parameters.len(),
+                    ty.span() => "required arguments after an `Option<_>` argument are ambiguous\n\
+                    = help: add a `#[pyo3(signature)]` annotation on this function to unambiguously specify the default values for all optional parameters"
+                );
+
+                python_signature.required_positional_parameters =
+                    python_signature.positional_parameters.len() + 1;
+            }
+
+            python_signature
+                .positional_parameters
+                .push(arg.name().unraw().to_string());
+        }
+
+        Ok(Self {
+            arguments,
+            python_signature,
+            attribute: None,
+        })
+    }
+
+    fn default_value_for_parameter(&self, parameter: &str) -> String {
+        let mut default = "...".to_string();
+        if let Some(fn_arg) = self.arguments.iter().find(|arg| arg.name() == parameter) {
+            if let FnArg::Regular(RegularArg {
+                default_value: Some(arg_default),
+                ..
+            }) = fn_arg
+            {
+                match arg_default {
+                    // literal values
+                    syn::Expr::Lit(syn::ExprLit { lit, .. }) => match lit {
+                        syn::Lit::Str(s) => default = s.token().to_string(),
+                        syn::Lit::Char(c) => default = c.token().to_string(),
+                        syn::Lit::Int(i) => default = i.base10_digits().to_string(),
+                        syn::Lit::Float(f) => default = f.base10_digits().to_string(),
+                        syn::Lit::Bool(b) => {
+                            default = if b.value() {
+                                "True".to_string()
+                            } else {
+                                "False".to_string()
+                            }
+                        }
+                        _ => {}
+                    },
+                    // None
+                    syn::Expr::Path(syn::ExprPath {
+                        qself: None, path, ..
+                    }) if path.is_ident("None") => {
+                        default = "None".to_string();
+                    }
+                    // others, unsupported yet so defaults to `...`
+                    _ => {}
+                }
+            } else if let FnArg::Regular(RegularArg {
+                option_wrapped_type: Some(..),
+                ..
+            }) = fn_arg
+            {
+                // functions without a `#[pyo3(signature = (...))]` option
+                // will treat trailing `Option<T>` arguments as having a default of `None`
+                default = "None".to_string();
+            }
+        }
+        default
+    }
+
+    pub fn text_signature(&self, self_argument: Option<&str>) -> String {
+        let mut output = String::new();
+        output.push('(');
+
+        if let Some(arg) = self_argument {
+            output.push('$');
+            output.push_str(arg);
+        }
+
+        let mut maybe_push_comma = {
+            let mut first = self_argument.is_none();
+            move |output: &mut String| {
+                if !first {
+                    output.push_str(", ");
+                } else {
+                    first = false;
+                }
+            }
+        };
+
+        let py_sig = &self.python_signature;
+
+        for (i, parameter) in py_sig.positional_parameters.iter().enumerate() {
+            maybe_push_comma(&mut output);
+
+            output.push_str(parameter);
+
+            if i >= py_sig.required_positional_parameters {
+                output.push('=');
+                output.push_str(&self.default_value_for_parameter(parameter));
+            }
+
+            if py_sig.positional_only_parameters > 0 && i + 1 == py_sig.positional_only_parameters {
+                output.push_str(", /")
+            }
+        }
+
+        if let Some(varargs) = &py_sig.varargs {
+            maybe_push_comma(&mut output);
+            output.push('*');
+            output.push_str(varargs);
+        } else if !py_sig.keyword_only_parameters.is_empty() {
+            maybe_push_comma(&mut output);
+            output.push('*');
+        }
+
+        for (parameter, required) in &py_sig.keyword_only_parameters {
+            maybe_push_comma(&mut output);
+            output.push_str(parameter);
+            if !required {
+                output.push('=');
+                output.push_str(&self.default_value_for_parameter(parameter));
+            }
+        }
+
+        if let Some(kwargs) = &py_sig.kwargs {
+            maybe_push_comma(&mut output);
+            output.push_str("**");
+            output.push_str(kwargs);
+        }
+
+        output.push(')');
+        output
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/src/pyfunction.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/pyfunction.rs
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/src/pyfunction.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/pyfunction.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,288 @@
+use crate::utils::Ctx;
+use crate::{
+    attributes::{
+        self, get_pyo3_options, take_attributes, take_pyo3_options, CrateAttribute,
+        FromPyWithAttribute, NameAttribute, TextSignatureAttribute,
+    },
+    deprecations::Deprecations,
+    method::{self, CallingConvention, FnArg},
+    pymethod::check_generic,
+};
+use proc_macro2::TokenStream;
+use quote::{format_ident, quote};
+use syn::{ext::IdentExt, spanned::Spanned, Result};
+use syn::{
+    parse::{Parse, ParseStream},
+    token::Comma,
+};
+
+mod signature;
+
+pub use self::signature::{ConstructorAttribute, FunctionSignature, SignatureAttribute};
+
+#[derive(Clone, Debug)]
+pub struct PyFunctionArgPyO3Attributes {
+    pub from_py_with: Option<FromPyWithAttribute>,
+    pub cancel_handle: Option<attributes::kw::cancel_handle>,
+}
+
+enum PyFunctionArgPyO3Attribute {
+    FromPyWith(FromPyWithAttribute),
+    CancelHandle(attributes::kw::cancel_handle),
+}
+
+impl Parse for PyFunctionArgPyO3Attribute {
+    fn parse(input: ParseStream<'_>) -> Result<Self> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(attributes::kw::cancel_handle) {
+            input.parse().map(PyFunctionArgPyO3Attribute::CancelHandle)
+        } else if lookahead.peek(attributes::kw::from_py_with) {
+            input.parse().map(PyFunctionArgPyO3Attribute::FromPyWith)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+}
+
+impl PyFunctionArgPyO3Attributes {
+    /// Parses #[pyo3(from_python_with = "func")]
+    pub fn from_attrs(attrs: &mut Vec<syn::Attribute>) -> syn::Result<Self> {
+        let mut attributes = PyFunctionArgPyO3Attributes {
+            from_py_with: None,
+            cancel_handle: None,
+        };
+        take_attributes(attrs, |attr| {
+            if let Some(pyo3_attrs) = get_pyo3_options(attr)? {
+                for attr in pyo3_attrs {
+                    match attr {
+                        PyFunctionArgPyO3Attribute::FromPyWith(from_py_with) => {
+                            ensure_spanned!(
+                                attributes.from_py_with.is_none(),
+                                from_py_with.span() => "`from_py_with` may only be specified once per argument"
+                            );
+                            attributes.from_py_with = Some(from_py_with);
+                        }
+                        PyFunctionArgPyO3Attribute::CancelHandle(cancel_handle) => {
+                            ensure_spanned!(
+                                attributes.cancel_handle.is_none(),
+                                cancel_handle.span() => "`cancel_handle` may only be specified once per argument"
+                            );
+                            attributes.cancel_handle = Some(cancel_handle);
+                        }
+                    }
+                    ensure_spanned!(
+                        attributes.from_py_with.is_none() || attributes.cancel_handle.is_none(),
+                        attributes.cancel_handle.unwrap().span() => "`from_py_with` and `cancel_handle` cannot be specified together"
+                    );
+                }
+                Ok(true)
+            } else {
+                Ok(false)
+            }
+        })?;
+        Ok(attributes)
+    }
+}
+
+#[derive(Default)]
+pub struct PyFunctionOptions {
+    pub pass_module: Option<attributes::kw::pass_module>,
+    pub name: Option<NameAttribute>,
+    pub signature: Option<SignatureAttribute>,
+    pub text_signature: Option<TextSignatureAttribute>,
+    pub krate: Option<CrateAttribute>,
+}
+
+impl Parse for PyFunctionOptions {
+    fn parse(input: ParseStream<'_>) -> Result<Self> {
+        let mut options = PyFunctionOptions::default();
+
+        while !input.is_empty() {
+            let lookahead = input.lookahead1();
+            if lookahead.peek(attributes::kw::name)
+                || lookahead.peek(attributes::kw::pass_module)
+                || lookahead.peek(attributes::kw::signature)
+                || lookahead.peek(attributes::kw::text_signature)
+            {
+                options.add_attributes(std::iter::once(input.parse()?))?;
+                if !input.is_empty() {
+                    let _: Comma = input.parse()?;
+                }
+            } else if lookahead.peek(syn::Token![crate]) {
+                // TODO needs duplicate check?
+                options.krate = Some(input.parse()?);
+            } else {
+                return Err(lookahead.error());
+            }
+        }
+
+        Ok(options)
+    }
+}
+
+pub enum PyFunctionOption {
+    Name(NameAttribute),
+    PassModule(attributes::kw::pass_module),
+    Signature(SignatureAttribute),
+    TextSignature(TextSignatureAttribute),
+    Crate(CrateAttribute),
+}
+
+impl Parse for PyFunctionOption {
+    fn parse(input: ParseStream<'_>) -> Result<Self> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(attributes::kw::name) {
+            input.parse().map(PyFunctionOption::Name)
+        } else if lookahead.peek(attributes::kw::pass_module) {
+            input.parse().map(PyFunctionOption::PassModule)
+        } else if lookahead.peek(attributes::kw::signature) {
+            input.parse().map(PyFunctionOption::Signature)
+        } else if lookahead.peek(attributes::kw::text_signature) {
+            input.parse().map(PyFunctionOption::TextSignature)
+        } else if lookahead.peek(syn::Token![crate]) {
+            input.parse().map(PyFunctionOption::Crate)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+}
+
+impl PyFunctionOptions {
+    pub fn from_attrs(attrs: &mut Vec<syn::Attribute>) -> syn::Result<Self> {
+        let mut options = PyFunctionOptions::default();
+        options.add_attributes(take_pyo3_options(attrs)?)?;
+        Ok(options)
+    }
+
+    pub fn add_attributes(
+        &mut self,
+        attrs: impl IntoIterator<Item = PyFunctionOption>,
+    ) -> Result<()> {
+        macro_rules! set_option {
+            ($key:ident) => {
+                {
+                    ensure_spanned!(
+                        self.$key.is_none(),
+                        $key.span() => concat!("`", stringify!($key), "` may only be specified once")
+                    );
+                    self.$key = Some($key);
+                }
+            };
+        }
+        for attr in attrs {
+            match attr {
+                PyFunctionOption::Name(name) => set_option!(name),
+                PyFunctionOption::PassModule(pass_module) => set_option!(pass_module),
+                PyFunctionOption::Signature(signature) => set_option!(signature),
+                PyFunctionOption::TextSignature(text_signature) => set_option!(text_signature),
+                PyFunctionOption::Crate(krate) => set_option!(krate),
+            }
+        }
+        Ok(())
+    }
+}
+
+pub fn build_py_function(
+    ast: &mut syn::ItemFn,
+    mut options: PyFunctionOptions,
+) -> syn::Result<TokenStream> {
+    options.add_attributes(take_pyo3_options(&mut ast.attrs)?)?;
+    impl_wrap_pyfunction(ast, options)
+}
+
+/// Generates python wrapper over a function that allows adding it to a python module as a python
+/// function
+pub fn impl_wrap_pyfunction(
+    func: &mut syn::ItemFn,
+    options: PyFunctionOptions,
+) -> syn::Result<TokenStream> {
+    check_generic(&func.sig)?;
+    let PyFunctionOptions {
+        pass_module,
+        name,
+        signature,
+        text_signature,
+        krate,
+    } = options;
+
+    let ctx = &Ctx::new(&krate, Some(&func.sig));
+    let Ctx { pyo3_path, .. } = &ctx;
+
+    let python_name = name
+        .as_ref()
+        .map_or_else(|| &func.sig.ident, |name| &name.value.0)
+        .unraw();
+
+    let tp = if pass_module.is_some() {
+        let span = match func.sig.inputs.first() {
+            Some(syn::FnArg::Typed(first_arg)) => first_arg.ty.span(),
+            Some(syn::FnArg::Receiver(_)) | None => bail_spanned!(
+                func.sig.paren_token.span.join() => "expected `&PyModule` or `Py<PyModule>` as first argument with `pass_module`"
+            ),
+        };
+        method::FnType::FnModule(span)
+    } else {
+        method::FnType::FnStatic
+    };
+
+    let arguments = func
+        .sig
+        .inputs
+        .iter_mut()
+        .skip(if tp.skip_first_rust_argument_in_python_signature() {
+            1
+        } else {
+            0
+        })
+        .map(FnArg::parse)
+        .collect::<syn::Result<Vec<_>>>()?;
+
+    let signature = if let Some(signature) = signature {
+        FunctionSignature::from_arguments_and_attribute(arguments, signature)?
+    } else {
+        FunctionSignature::from_arguments(arguments)?
+    };
+
+    let spec = method::FnSpec {
+        tp,
+        name: &func.sig.ident,
+        convention: CallingConvention::from_signature(&signature),
+        python_name,
+        signature,
+        text_signature,
+        asyncness: func.sig.asyncness,
+        unsafety: func.sig.unsafety,
+        deprecations: Deprecations::new(ctx),
+    };
+
+    let vis = &func.vis;
+    let name = &func.sig.ident;
+
+    let wrapper_ident = format_ident!("__pyfunction_{}", spec.name);
+    let wrapper = spec.get_wrapper_function(&wrapper_ident, None, ctx)?;
+    let methoddef = spec.get_methoddef(wrapper_ident, &spec.get_doc(&func.attrs, ctx), ctx);
+
+    let wrapped_pyfunction = quote! {
+
+        // Create a module with the same name as the `#[pyfunction]` - this way `use <the function>`
+        // will actually bring both the module and the function into scope.
+        #[doc(hidden)]
+        #vis mod #name {
+            pub(crate) struct MakeDef;
+            pub const _PYO3_DEF: #pyo3_path::impl_::pymethods::PyMethodDef = MakeDef::_PYO3_DEF;
+        }
+
+        // Generate the definition inside an anonymous function in the same scope as the original function -
+        // this avoids complications around the fact that the generated module has a different scope
+        // (and `super` doesn't always refer to the outer scope, e.g. if the `#[pyfunction] is
+        // inside a function body)
+        #[allow(unknown_lints, non_local_definitions)]
+        impl #name::MakeDef {
+            const _PYO3_DEF: #pyo3_path::impl_::pymethods::PyMethodDef = #methoddef;
+        }
+
+        #[allow(non_snake_case)]
+        #wrapper
+    };
+    Ok(wrapped_pyfunction)
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/src/pyimpl.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/pyimpl.rs
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/src/pyimpl.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/pyimpl.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,317 @@
+use std::collections::HashSet;
+
+use crate::utils::Ctx;
+use crate::{
+    attributes::{take_pyo3_options, CrateAttribute},
+    konst::{ConstAttributes, ConstSpec},
+    pyfunction::PyFunctionOptions,
+    pymethod::{self, is_proto_method, MethodAndMethodDef, MethodAndSlotDef},
+};
+use proc_macro2::TokenStream;
+use pymethod::GeneratedPyMethod;
+use quote::{format_ident, quote};
+use syn::{
+    parse::{Parse, ParseStream},
+    spanned::Spanned,
+    Result,
+};
+
+/// The mechanism used to collect `#[pymethods]` into the type object
+#[derive(Copy, Clone)]
+pub enum PyClassMethodsType {
+    Specialization,
+    Inventory,
+}
+
+enum PyImplPyO3Option {
+    Crate(CrateAttribute),
+}
+
+impl Parse for PyImplPyO3Option {
+    fn parse(input: ParseStream<'_>) -> Result<Self> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(syn::Token![crate]) {
+            input.parse().map(PyImplPyO3Option::Crate)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+}
+
+#[derive(Default)]
+pub struct PyImplOptions {
+    krate: Option<CrateAttribute>,
+}
+
+impl PyImplOptions {
+    pub fn from_attrs(attrs: &mut Vec<syn::Attribute>) -> Result<Self> {
+        let mut options: PyImplOptions = Default::default();
+
+        for option in take_pyo3_options(attrs)? {
+            match option {
+                PyImplPyO3Option::Crate(path) => options.set_crate(path)?,
+            }
+        }
+
+        Ok(options)
+    }
+
+    fn set_crate(&mut self, path: CrateAttribute) -> Result<()> {
+        ensure_spanned!(
+            self.krate.is_none(),
+            path.span() => "`crate` may only be specified once"
+        );
+
+        self.krate = Some(path);
+        Ok(())
+    }
+}
+
+pub fn build_py_methods(
+    ast: &mut syn::ItemImpl,
+    methods_type: PyClassMethodsType,
+) -> syn::Result<TokenStream> {
+    if let Some((_, path, _)) = &ast.trait_ {
+        bail_spanned!(path.span() => "#[pymethods] cannot be used on trait impl blocks");
+    } else if ast.generics != Default::default() {
+        bail_spanned!(
+            ast.generics.span() =>
+            "#[pymethods] cannot be used with lifetime parameters or generics"
+        );
+    } else {
+        let options = PyImplOptions::from_attrs(&mut ast.attrs)?;
+        impl_methods(&ast.self_ty, &mut ast.items, methods_type, options)
+    }
+}
+
+pub fn impl_methods(
+    ty: &syn::Type,
+    impls: &mut [syn::ImplItem],
+    methods_type: PyClassMethodsType,
+    options: PyImplOptions,
+) -> syn::Result<TokenStream> {
+    let mut trait_impls = Vec::new();
+    let mut proto_impls = Vec::new();
+    let mut methods = Vec::new();
+    let mut associated_methods = Vec::new();
+
+    let mut implemented_proto_fragments = HashSet::new();
+
+    for iimpl in impls {
+        match iimpl {
+            syn::ImplItem::Fn(meth) => {
+                let ctx = &Ctx::new(&options.krate, Some(&meth.sig));
+                let mut fun_options = PyFunctionOptions::from_attrs(&mut meth.attrs)?;
+                fun_options.krate = fun_options.krate.or_else(|| options.krate.clone());
+                match pymethod::gen_py_method(ty, &mut meth.sig, &mut meth.attrs, fun_options, ctx)?
+                {
+                    GeneratedPyMethod::Method(MethodAndMethodDef {
+                        associated_method,
+                        method_def,
+                    }) => {
+                        let attrs = get_cfg_attributes(&meth.attrs);
+                        associated_methods.push(quote!(#(#attrs)* #associated_method));
+                        methods.push(quote!(#(#attrs)* #method_def));
+                    }
+                    GeneratedPyMethod::SlotTraitImpl(method_name, token_stream) => {
+                        implemented_proto_fragments.insert(method_name);
+                        let attrs = get_cfg_attributes(&meth.attrs);
+                        trait_impls.push(quote!(#(#attrs)* #token_stream));
+                    }
+                    GeneratedPyMethod::Proto(MethodAndSlotDef {
+                        associated_method,
+                        slot_def,
+                    }) => {
+                        let attrs = get_cfg_attributes(&meth.attrs);
+                        proto_impls.push(quote!(#(#attrs)* #slot_def));
+                        associated_methods.push(quote!(#(#attrs)* #associated_method));
+                    }
+                }
+            }
+            syn::ImplItem::Const(konst) => {
+                let ctx = &Ctx::new(&options.krate, None);
+                let attributes = ConstAttributes::from_attrs(&mut konst.attrs, ctx)?;
+                if attributes.is_class_attr {
+                    let spec = ConstSpec {
+                        rust_ident: konst.ident.clone(),
+                        attributes,
+                    };
+                    let attrs = get_cfg_attributes(&konst.attrs);
+                    let MethodAndMethodDef {
+                        associated_method,
+                        method_def,
+                    } = gen_py_const(ty, &spec, ctx);
+                    methods.push(quote!(#(#attrs)* #method_def));
+                    associated_methods.push(quote!(#(#attrs)* #associated_method));
+                    if is_proto_method(&spec.python_name().to_string()) {
+                        // If this is a known protocol method e.g. __contains__, then allow this
+                        // symbol even though it's not an uppercase constant.
+                        konst
+                            .attrs
+                            .push(syn::parse_quote!(#[allow(non_upper_case_globals)]));
+                    }
+                }
+            }
+            syn::ImplItem::Macro(m) => bail_spanned!(
+                m.span() =>
+                "macros cannot be used as items in `#[pymethods]` impl blocks\n\
+                 = note: this was previously accepted and ignored"
+            ),
+            _ => {}
+        }
+    }
+    let ctx = &Ctx::new(&options.krate, None);
+
+    add_shared_proto_slots(ty, &mut proto_impls, implemented_proto_fragments, ctx);
+
+    let items = match methods_type {
+        PyClassMethodsType::Specialization => impl_py_methods(ty, methods, proto_impls, ctx),
+        PyClassMethodsType::Inventory => submit_methods_inventory(ty, methods, proto_impls, ctx),
+    };
+
+    Ok(quote! {
+        #(#trait_impls)*
+
+        #items
+
+        #[doc(hidden)]
+        #[allow(non_snake_case)]
+        impl #ty {
+            #(#associated_methods)*
+        }
+    })
+}
+
+pub fn gen_py_const(cls: &syn::Type, spec: &ConstSpec<'_>, ctx: &Ctx) -> MethodAndMethodDef {
+    let member = &spec.rust_ident;
+    let wrapper_ident = format_ident!("__pymethod_{}__", member);
+    let deprecations = &spec.attributes.deprecations;
+    let python_name = spec.null_terminated_python_name(ctx);
+    let Ctx { pyo3_path, .. } = ctx;
+
+    let associated_method = quote! {
+        fn #wrapper_ident(py: #pyo3_path::Python<'_>) -> #pyo3_path::PyResult<#pyo3_path::PyObject> {
+            #deprecations
+            ::std::result::Result::Ok(#pyo3_path::IntoPy::into_py(#cls::#member, py))
+        }
+    };
+
+    let method_def = quote! {
+        #pyo3_path::impl_::pyclass::MaybeRuntimePyMethodDef::Static(
+            #pyo3_path::class::PyMethodDefType::ClassAttribute({
+                #pyo3_path::class::PyClassAttributeDef::new(
+                    #python_name,
+                    #cls::#wrapper_ident
+                )
+            })
+        )
+    };
+
+    MethodAndMethodDef {
+        associated_method,
+        method_def,
+    }
+}
+
+fn impl_py_methods(
+    ty: &syn::Type,
+    methods: Vec<TokenStream>,
+    proto_impls: Vec<TokenStream>,
+    ctx: &Ctx,
+) -> TokenStream {
+    let Ctx { pyo3_path, .. } = ctx;
+    quote! {
+        #[allow(unknown_lints, non_local_definitions)]
+        impl #pyo3_path::impl_::pyclass::PyMethods<#ty>
+            for #pyo3_path::impl_::pyclass::PyClassImplCollector<#ty>
+        {
+            fn py_methods(self) -> &'static #pyo3_path::impl_::pyclass::PyClassItems {
+                static ITEMS: #pyo3_path::impl_::pyclass::PyClassItems = #pyo3_path::impl_::pyclass::PyClassItems {
+                    methods: &[#(#methods),*],
+                    slots: &[#(#proto_impls),*]
+                };
+                &ITEMS
+            }
+        }
+    }
+}
+
+fn add_shared_proto_slots(
+    ty: &syn::Type,
+    proto_impls: &mut Vec<TokenStream>,
+    mut implemented_proto_fragments: HashSet<String>,
+    ctx: &Ctx,
+) {
+    let Ctx { pyo3_path, .. } = ctx;
+    macro_rules! try_add_shared_slot {
+        ($slot:ident, $($fragments:literal),*) => {{
+            let mut implemented = false;
+            $(implemented |= implemented_proto_fragments.remove($fragments));*;
+            if implemented {
+                proto_impls.push(quote! { #pyo3_path::impl_::pyclass::$slot!(#ty) })
+            }
+        }};
+    }
+
+    try_add_shared_slot!(
+        generate_pyclass_getattro_slot,
+        "__getattribute__",
+        "__getattr__"
+    );
+    try_add_shared_slot!(generate_pyclass_setattr_slot, "__setattr__", "__delattr__");
+    try_add_shared_slot!(generate_pyclass_setdescr_slot, "__set__", "__delete__");
+    try_add_shared_slot!(generate_pyclass_setitem_slot, "__setitem__", "__delitem__");
+    try_add_shared_slot!(generate_pyclass_add_slot, "__add__", "__radd__");
+    try_add_shared_slot!(generate_pyclass_sub_slot, "__sub__", "__rsub__");
+    try_add_shared_slot!(generate_pyclass_mul_slot, "__mul__", "__rmul__");
+    try_add_shared_slot!(generate_pyclass_mod_slot, "__mod__", "__rmod__");
+    try_add_shared_slot!(generate_pyclass_divmod_slot, "__divmod__", "__rdivmod__");
+    try_add_shared_slot!(generate_pyclass_lshift_slot, "__lshift__", "__rlshift__");
+    try_add_shared_slot!(generate_pyclass_rshift_slot, "__rshift__", "__rrshift__");
+    try_add_shared_slot!(generate_pyclass_and_slot, "__and__", "__rand__");
+    try_add_shared_slot!(generate_pyclass_or_slot, "__or__", "__ror__");
+    try_add_shared_slot!(generate_pyclass_xor_slot, "__xor__", "__rxor__");
+    try_add_shared_slot!(generate_pyclass_matmul_slot, "__matmul__", "__rmatmul__");
+    try_add_shared_slot!(generate_pyclass_truediv_slot, "__truediv__", "__rtruediv__");
+    try_add_shared_slot!(
+        generate_pyclass_floordiv_slot,
+        "__floordiv__",
+        "__rfloordiv__"
+    );
+    try_add_shared_slot!(generate_pyclass_pow_slot, "__pow__", "__rpow__");
+    try_add_shared_slot!(
+        generate_pyclass_richcompare_slot,
+        "__lt__",
+        "__le__",
+        "__eq__",
+        "__ne__",
+        "__gt__",
+        "__ge__"
+    );
+
+    // if this assertion trips, a slot fragment has been implemented which has not been added in the
+    // list above
+    assert!(implemented_proto_fragments.is_empty());
+}
+
+fn submit_methods_inventory(
+    ty: &syn::Type,
+    methods: Vec<TokenStream>,
+    proto_impls: Vec<TokenStream>,
+    ctx: &Ctx,
+) -> TokenStream {
+    let Ctx { pyo3_path, .. } = ctx;
+    quote! {
+        #pyo3_path::inventory::submit! {
+            type Inventory = <#ty as #pyo3_path::impl_::pyclass::PyClassImpl>::Inventory;
+            Inventory::new(#pyo3_path::impl_::pyclass::PyClassItems { methods: &[#(#methods),*], slots: &[#(#proto_impls),*] })
+        }
+    }
+}
+
+fn get_cfg_attributes(attrs: &[syn::Attribute]) -> Vec<&syn::Attribute> {
+    attrs
+        .iter()
+        .filter(|attr| attr.path().is_ident("cfg"))
+        .collect()
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/src/pymethod.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/pymethod.rs
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/src/pymethod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/pymethod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1592 @@
+use std::borrow::Cow;
+use std::ffi::CString;
+
+use crate::attributes::{NameAttribute, RenamingRule};
+use crate::deprecations::deprecate_trailing_option_default;
+use crate::method::{CallingConvention, ExtractErrorMode, PyArg};
+use crate::params::{check_arg_for_gil_refs, impl_regular_arg_param, Holders};
+use crate::utils::PythonDoc;
+use crate::utils::{Ctx, LitCStr};
+use crate::{
+    method::{FnArg, FnSpec, FnType, SelfType},
+    pyfunction::PyFunctionOptions,
+};
+use crate::{quotes, utils};
+use proc_macro2::{Span, TokenStream};
+use quote::{format_ident, quote, quote_spanned, ToTokens};
+use syn::{ext::IdentExt, spanned::Spanned, Result};
+
+/// Generated code for a single pymethod item.
+pub struct MethodAndMethodDef {
+    /// The implementation of the Python wrapper for the pymethod
+    pub associated_method: TokenStream,
+    /// The method def which will be used to register this pymethod
+    pub method_def: TokenStream,
+}
+
+/// Generated code for a single pymethod item which is registered by a slot.
+pub struct MethodAndSlotDef {
+    /// The implementation of the Python wrapper for the pymethod
+    pub associated_method: TokenStream,
+    /// The slot def which will be used to register this pymethod
+    pub slot_def: TokenStream,
+}
+
+pub enum GeneratedPyMethod {
+    Method(MethodAndMethodDef),
+    Proto(MethodAndSlotDef),
+    SlotTraitImpl(String, TokenStream),
+}
+
+pub struct PyMethod<'a> {
+    kind: PyMethodKind,
+    method_name: String,
+    spec: FnSpec<'a>,
+}
+
+enum PyMethodKind {
+    Fn,
+    Proto(PyMethodProtoKind),
+}
+
+impl PyMethodKind {
+    fn from_name(name: &str) -> Self {
+        match name {
+            // Protocol implemented through slots
+            "__str__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__STR__)),
+            "__repr__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__REPR__)),
+            "__hash__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__HASH__)),
+            "__richcmp__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__RICHCMP__)),
+            "__get__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__GET__)),
+            "__iter__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__ITER__)),
+            "__next__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__NEXT__)),
+            "__await__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__AWAIT__)),
+            "__aiter__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__AITER__)),
+            "__anext__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__ANEXT__)),
+            "__len__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__LEN__)),
+            "__contains__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__CONTAINS__)),
+            "__concat__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__CONCAT__)),
+            "__repeat__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__REPEAT__)),
+            "__inplace_concat__" => {
+                PyMethodKind::Proto(PyMethodProtoKind::Slot(&__INPLACE_CONCAT__))
+            }
+            "__inplace_repeat__" => {
+                PyMethodKind::Proto(PyMethodProtoKind::Slot(&__INPLACE_REPEAT__))
+            }
+            "__getitem__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__GETITEM__)),
+            "__pos__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__POS__)),
+            "__neg__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__NEG__)),
+            "__abs__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__ABS__)),
+            "__invert__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__INVERT__)),
+            "__index__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__INDEX__)),
+            "__int__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__INT__)),
+            "__float__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__FLOAT__)),
+            "__bool__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__BOOL__)),
+            "__iadd__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__IADD__)),
+            "__isub__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__ISUB__)),
+            "__imul__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__IMUL__)),
+            "__imatmul__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__IMATMUL__)),
+            "__itruediv__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__ITRUEDIV__)),
+            "__ifloordiv__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__IFLOORDIV__)),
+            "__imod__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__IMOD__)),
+            "__ipow__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__IPOW__)),
+            "__ilshift__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__ILSHIFT__)),
+            "__irshift__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__IRSHIFT__)),
+            "__iand__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__IAND__)),
+            "__ixor__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__IXOR__)),
+            "__ior__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__IOR__)),
+            "__getbuffer__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__GETBUFFER__)),
+            "__releasebuffer__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__RELEASEBUFFER__)),
+            "__clear__" => PyMethodKind::Proto(PyMethodProtoKind::Slot(&__CLEAR__)),
+            // Protocols implemented through traits
+            "__getattribute__" => {
+                PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__GETATTRIBUTE__))
+            }
+            "__getattr__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__GETATTR__)),
+            "__setattr__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__SETATTR__)),
+            "__delattr__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__DELATTR__)),
+            "__set__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__SET__)),
+            "__delete__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__DELETE__)),
+            "__setitem__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__SETITEM__)),
+            "__delitem__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__DELITEM__)),
+            "__add__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__ADD__)),
+            "__radd__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__RADD__)),
+            "__sub__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__SUB__)),
+            "__rsub__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__RSUB__)),
+            "__mul__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__MUL__)),
+            "__rmul__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__RMUL__)),
+            "__matmul__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__MATMUL__)),
+            "__rmatmul__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__RMATMUL__)),
+            "__floordiv__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__FLOORDIV__)),
+            "__rfloordiv__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__RFLOORDIV__)),
+            "__truediv__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__TRUEDIV__)),
+            "__rtruediv__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__RTRUEDIV__)),
+            "__divmod__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__DIVMOD__)),
+            "__rdivmod__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__RDIVMOD__)),
+            "__mod__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__MOD__)),
+            "__rmod__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__RMOD__)),
+            "__lshift__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__LSHIFT__)),
+            "__rlshift__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__RLSHIFT__)),
+            "__rshift__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__RSHIFT__)),
+            "__rrshift__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__RRSHIFT__)),
+            "__and__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__AND__)),
+            "__rand__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__RAND__)),
+            "__xor__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__XOR__)),
+            "__rxor__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__RXOR__)),
+            "__or__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__OR__)),
+            "__ror__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__ROR__)),
+            "__pow__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__POW__)),
+            "__rpow__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__RPOW__)),
+            "__lt__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__LT__)),
+            "__le__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__LE__)),
+            "__eq__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__EQ__)),
+            "__ne__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__NE__)),
+            "__gt__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__GT__)),
+            "__ge__" => PyMethodKind::Proto(PyMethodProtoKind::SlotFragment(&__GE__)),
+            // Some tricky protocols which don't fit the pattern of the rest
+            "__call__" => PyMethodKind::Proto(PyMethodProtoKind::Call),
+            "__traverse__" => PyMethodKind::Proto(PyMethodProtoKind::Traverse),
+            // Not a proto
+            _ => PyMethodKind::Fn,
+        }
+    }
+}
+
+enum PyMethodProtoKind {
+    Slot(&'static SlotDef),
+    Call,
+    Traverse,
+    SlotFragment(&'static SlotFragmentDef),
+}
+
+impl<'a> PyMethod<'a> {
+    fn parse(
+        sig: &'a mut syn::Signature,
+        meth_attrs: &mut Vec<syn::Attribute>,
+        options: PyFunctionOptions,
+        ctx: &'a Ctx,
+    ) -> Result<Self> {
+        let spec = FnSpec::parse(sig, meth_attrs, options, ctx)?;
+
+        let method_name = spec.python_name.to_string();
+        let kind = PyMethodKind::from_name(&method_name);
+
+        Ok(Self {
+            kind,
+            method_name,
+            spec,
+        })
+    }
+}
+
+pub fn is_proto_method(name: &str) -> bool {
+    match PyMethodKind::from_name(name) {
+        PyMethodKind::Fn => false,
+        PyMethodKind::Proto(_) => true,
+    }
+}
+
+pub fn gen_py_method(
+    cls: &syn::Type,
+    sig: &mut syn::Signature,
+    meth_attrs: &mut Vec<syn::Attribute>,
+    options: PyFunctionOptions,
+    ctx: &Ctx,
+) -> Result<GeneratedPyMethod> {
+    check_generic(sig)?;
+    ensure_function_options_valid(&options)?;
+    let method = PyMethod::parse(sig, meth_attrs, options, ctx)?;
+    let spec = &method.spec;
+    let Ctx { pyo3_path, .. } = ctx;
+
+    Ok(match (method.kind, &spec.tp) {
+        // Class attributes go before protos so that class attributes can be used to set proto
+        // method to None.
+        (_, FnType::ClassAttribute) => {
+            GeneratedPyMethod::Method(impl_py_class_attribute(cls, spec, ctx)?)
+        }
+        (PyMethodKind::Proto(proto_kind), _) => {
+            ensure_no_forbidden_protocol_attributes(&proto_kind, spec, &method.method_name)?;
+            match proto_kind {
+                PyMethodProtoKind::Slot(slot_def) => {
+                    let slot = slot_def.generate_type_slot(cls, spec, &method.method_name, ctx)?;
+                    GeneratedPyMethod::Proto(slot)
+                }
+                PyMethodProtoKind::Call => {
+                    GeneratedPyMethod::Proto(impl_call_slot(cls, method.spec, ctx)?)
+                }
+                PyMethodProtoKind::Traverse => {
+                    GeneratedPyMethod::Proto(impl_traverse_slot(cls, spec, ctx)?)
+                }
+                PyMethodProtoKind::SlotFragment(slot_fragment_def) => {
+                    let proto = slot_fragment_def.generate_pyproto_fragment(cls, spec, ctx)?;
+                    GeneratedPyMethod::SlotTraitImpl(method.method_name, proto)
+                }
+            }
+        }
+        // ordinary functions (with some specialties)
+        (_, FnType::Fn(_)) => GeneratedPyMethod::Method(impl_py_method_def(
+            cls,
+            spec,
+            &spec.get_doc(meth_attrs, ctx),
+            None,
+            ctx,
+        )?),
+        (_, FnType::FnClass(_)) => GeneratedPyMethod::Method(impl_py_method_def(
+            cls,
+            spec,
+            &spec.get_doc(meth_attrs, ctx),
+            Some(quote!(#pyo3_path::ffi::METH_CLASS)),
+            ctx,
+        )?),
+        (_, FnType::FnStatic) => GeneratedPyMethod::Method(impl_py_method_def(
+            cls,
+            spec,
+            &spec.get_doc(meth_attrs, ctx),
+            Some(quote!(#pyo3_path::ffi::METH_STATIC)),
+            ctx,
+        )?),
+        // special prototypes
+        (_, FnType::FnNew) | (_, FnType::FnNewClass(_)) => {
+            GeneratedPyMethod::Proto(impl_py_method_def_new(cls, spec, ctx)?)
+        }
+
+        (_, FnType::Getter(self_type)) => GeneratedPyMethod::Method(impl_py_getter_def(
+            cls,
+            PropertyType::Function {
+                self_type,
+                spec,
+                doc: spec.get_doc(meth_attrs, ctx),
+            },
+            ctx,
+        )?),
+        (_, FnType::Setter(self_type)) => GeneratedPyMethod::Method(impl_py_setter_def(
+            cls,
+            PropertyType::Function {
+                self_type,
+                spec,
+                doc: spec.get_doc(meth_attrs, ctx),
+            },
+            ctx,
+        )?),
+        (_, FnType::FnModule(_)) => {
+            unreachable!("methods cannot be FnModule")
+        }
+    })
+}
+
+pub fn check_generic(sig: &syn::Signature) -> syn::Result<()> {
+    let err_msg = |typ| format!("Python functions cannot have generic {} parameters", typ);
+    for param in &sig.generics.params {
+        match param {
+            syn::GenericParam::Lifetime(_) => {}
+            syn::GenericParam::Type(_) => bail_spanned!(param.span() => err_msg("type")),
+            syn::GenericParam::Const(_) => bail_spanned!(param.span() => err_msg("const")),
+        }
+    }
+    Ok(())
+}
+
+fn ensure_function_options_valid(options: &PyFunctionOptions) -> syn::Result<()> {
+    if let Some(pass_module) = &options.pass_module {
+        bail_spanned!(pass_module.span() => "`pass_module` cannot be used on Python methods");
+    }
+    Ok(())
+}
+
+fn ensure_no_forbidden_protocol_attributes(
+    proto_kind: &PyMethodProtoKind,
+    spec: &FnSpec<'_>,
+    method_name: &str,
+) -> syn::Result<()> {
+    if let Some(signature) = &spec.signature.attribute {
+        // __call__ is allowed to have a signature, but nothing else is.
+        if !matches!(proto_kind, PyMethodProtoKind::Call) {
+            bail_spanned!(signature.kw.span() => format!("`signature` cannot be used with magic method `{}`", method_name));
+        }
+    }
+    if let Some(text_signature) = &spec.text_signature {
+        bail_spanned!(text_signature.kw.span() => format!("`text_signature` cannot be used with magic method `{}`", method_name));
+    }
+    Ok(())
+}
+
+/// Also used by pyfunction.
+pub fn impl_py_method_def(
+    cls: &syn::Type,
+    spec: &FnSpec<'_>,
+    doc: &PythonDoc,
+    flags: Option<TokenStream>,
+    ctx: &Ctx,
+) -> Result<MethodAndMethodDef> {
+    let Ctx { pyo3_path, .. } = ctx;
+    let wrapper_ident = format_ident!("__pymethod_{}__", spec.python_name);
+    let associated_method = spec.get_wrapper_function(&wrapper_ident, Some(cls), ctx)?;
+    let add_flags = flags.map(|flags| quote!(.flags(#flags)));
+    let methoddef_type = match spec.tp {
+        FnType::FnStatic => quote!(Static),
+        FnType::FnClass(_) => quote!(Class),
+        _ => quote!(Method),
+    };
+    let methoddef = spec.get_methoddef(quote! { #cls::#wrapper_ident }, doc, ctx);
+    let method_def = quote! {
+        #pyo3_path::impl_::pyclass::MaybeRuntimePyMethodDef::Static(
+            #pyo3_path::class::PyMethodDefType::#methoddef_type(#methoddef #add_flags)
+        )
+    };
+    Ok(MethodAndMethodDef {
+        associated_method,
+        method_def,
+    })
+}
+
+/// Also used by pyclass.
+pub fn impl_py_method_def_new(
+    cls: &syn::Type,
+    spec: &FnSpec<'_>,
+    ctx: &Ctx,
+) -> Result<MethodAndSlotDef> {
+    let Ctx { pyo3_path, .. } = ctx;
+    let wrapper_ident = syn::Ident::new("__pymethod___new____", Span::call_site());
+    let associated_method = spec.get_wrapper_function(&wrapper_ident, Some(cls), ctx)?;
+    // Use just the text_signature_call_signature() because the class' Python name
+    // isn't known to `#[pymethods]` - that has to be attached at runtime from the PyClassImpl
+    // trait implementation created by `#[pyclass]`.
+    let text_signature_body = spec.text_signature_call_signature().map_or_else(
+        || quote!(::std::option::Option::None),
+        |text_signature| quote!(::std::option::Option::Some(#text_signature)),
+    );
+    let deprecations = &spec.deprecations;
+    let slot_def = quote! {
+        #pyo3_path::ffi::PyType_Slot {
+            slot: #pyo3_path::ffi::Py_tp_new,
+            pfunc: {
+                unsafe extern "C" fn trampoline(
+                    subtype: *mut #pyo3_path::ffi::PyTypeObject,
+                    args: *mut #pyo3_path::ffi::PyObject,
+                    kwargs: *mut #pyo3_path::ffi::PyObject,
+                ) -> *mut #pyo3_path::ffi::PyObject
+                {
+                    #deprecations
+
+                    use #pyo3_path::impl_::pyclass::*;
+                    #[allow(unknown_lints, non_local_definitions)]
+                    impl PyClassNewTextSignature<#cls> for PyClassImplCollector<#cls> {
+                        #[inline]
+                        fn new_text_signature(self) -> ::std::option::Option<&'static str> {
+                            #text_signature_body
+                        }
+                    }
+
+                    #pyo3_path::impl_::trampoline::newfunc(
+                        subtype,
+                        args,
+                        kwargs,
+                        #cls::#wrapper_ident
+                    )
+                }
+                trampoline
+            } as #pyo3_path::ffi::newfunc as _
+        }
+    };
+    Ok(MethodAndSlotDef {
+        associated_method,
+        slot_def,
+    })
+}
+
+fn impl_call_slot(cls: &syn::Type, mut spec: FnSpec<'_>, ctx: &Ctx) -> Result<MethodAndSlotDef> {
+    let Ctx { pyo3_path, .. } = ctx;
+
+    // HACK: __call__ proto slot must always use varargs calling convention, so change the spec.
+    // Probably indicates there's a refactoring opportunity somewhere.
+    spec.convention = CallingConvention::Varargs;
+
+    let wrapper_ident = syn::Ident::new("__pymethod___call____", Span::call_site());
+    let associated_method = spec.get_wrapper_function(&wrapper_ident, Some(cls), ctx)?;
+    let slot_def = quote! {
+        #pyo3_path::ffi::PyType_Slot {
+            slot: #pyo3_path::ffi::Py_tp_call,
+            pfunc: {
+                unsafe extern "C" fn trampoline(
+                    slf: *mut #pyo3_path::ffi::PyObject,
+                    args: *mut #pyo3_path::ffi::PyObject,
+                    kwargs: *mut #pyo3_path::ffi::PyObject,
+                ) -> *mut #pyo3_path::ffi::PyObject
+                {
+                    #pyo3_path::impl_::trampoline::ternaryfunc(
+                        slf,
+                        args,
+                        kwargs,
+                        #cls::#wrapper_ident
+                    )
+                }
+                trampoline
+            } as #pyo3_path::ffi::ternaryfunc as _
+        }
+    };
+    Ok(MethodAndSlotDef {
+        associated_method,
+        slot_def,
+    })
+}
+
+fn impl_traverse_slot(
+    cls: &syn::Type,
+    spec: &FnSpec<'_>,
+    ctx: &Ctx,
+) -> syn::Result<MethodAndSlotDef> {
+    let Ctx { pyo3_path, .. } = ctx;
+    if let (Some(py_arg), _) = split_off_python_arg(&spec.signature.arguments) {
+        return Err(syn::Error::new_spanned(py_arg.ty, "__traverse__ may not take `Python`. \
+            Usually, an implementation of `__traverse__(&self, visit: PyVisit<'_>) -> Result<(), PyTraverseError>` \
+            should do nothing but calls to `visit.call`. Most importantly, safe access to the GIL is prohibited \
+            inside implementations of `__traverse__`, i.e. `Python::with_gil` will panic."));
+    }
+
+    // check that the receiver does not try to smuggle an (implicit) `Python` token into here
+    if let FnType::Fn(SelfType::TryFromBoundRef(span))
+    | FnType::Fn(SelfType::Receiver {
+        mutable: true,
+        span,
+    }) = spec.tp
+    {
+        bail_spanned! { span =>
+            "__traverse__ may not take a receiver other than `&self`. Usually, an implementation of \
+            `__traverse__(&self, visit: PyVisit<'_>) -> Result<(), PyTraverseError>` \
+            should do nothing but calls to `visit.call`. Most importantly, safe access to the GIL is prohibited \
+            inside implementations of `__traverse__`, i.e. `Python::with_gil` will panic."
+        }
+    }
+
+    let rust_fn_ident = spec.name;
+
+    let associated_method = quote! {
+        pub unsafe extern "C" fn __pymethod_traverse__(
+            slf: *mut #pyo3_path::ffi::PyObject,
+            visit: #pyo3_path::ffi::visitproc,
+            arg: *mut ::std::os::raw::c_void,
+        ) -> ::std::os::raw::c_int {
+            #pyo3_path::impl_::pymethods::_call_traverse::<#cls>(slf, #cls::#rust_fn_ident, visit, arg)
+        }
+    };
+    let slot_def = quote! {
+        #pyo3_path::ffi::PyType_Slot {
+            slot: #pyo3_path::ffi::Py_tp_traverse,
+            pfunc: #cls::__pymethod_traverse__ as #pyo3_path::ffi::traverseproc as _
+        }
+    };
+    Ok(MethodAndSlotDef {
+        associated_method,
+        slot_def,
+    })
+}
+
+fn impl_py_class_attribute(
+    cls: &syn::Type,
+    spec: &FnSpec<'_>,
+    ctx: &Ctx,
+) -> syn::Result<MethodAndMethodDef> {
+    let Ctx { pyo3_path, .. } = ctx;
+    let (py_arg, args) = split_off_python_arg(&spec.signature.arguments);
+    ensure_spanned!(
+        args.is_empty(),
+        args[0].ty().span() => "#[classattr] can only have one argument (of type pyo3::Python)"
+    );
+
+    let name = &spec.name;
+    let fncall = if py_arg.is_some() {
+        quote!(function(py))
+    } else {
+        quote!(function())
+    };
+
+    let wrapper_ident = format_ident!("__pymethod_{}__", name);
+    let python_name = spec.null_terminated_python_name(ctx);
+    let body = quotes::ok_wrap(fncall, ctx);
+
+    let associated_method = quote! {
+        fn #wrapper_ident(py: #pyo3_path::Python<'_>) -> #pyo3_path::PyResult<#pyo3_path::PyObject> {
+            let function = #cls::#name; // Shadow the method name to avoid #3017
+            #pyo3_path::impl_::wrap::map_result_into_py(py, #body)
+        }
+    };
+
+    let method_def = quote! {
+        #pyo3_path::impl_::pyclass::MaybeRuntimePyMethodDef::Static(
+            #pyo3_path::class::PyMethodDefType::ClassAttribute({
+                #pyo3_path::class::PyClassAttributeDef::new(
+                    #python_name,
+                    #cls::#wrapper_ident
+                )
+            })
+        )
+    };
+
+    Ok(MethodAndMethodDef {
+        associated_method,
+        method_def,
+    })
+}
+
+fn impl_call_setter(
+    cls: &syn::Type,
+    spec: &FnSpec<'_>,
+    self_type: &SelfType,
+    holders: &mut Holders,
+    ctx: &Ctx,
+) -> syn::Result<TokenStream> {
+    let (py_arg, args) = split_off_python_arg(&spec.signature.arguments);
+    let slf = self_type.receiver(cls, ExtractErrorMode::Raise, holders, ctx);
+
+    if args.is_empty() {
+        bail_spanned!(spec.name.span() => "setter function expected to have one argument");
+    } else if args.len() > 1 {
+        bail_spanned!(
+            args[1].ty().span() =>
+            "setter function can have at most two arguments ([pyo3::Python,] and value)"
+        );
+    }
+
+    let name = &spec.name;
+    let fncall = if py_arg.is_some() {
+        quote!(#cls::#name(#slf, py, _val))
+    } else {
+        quote!(#cls::#name(#slf, _val))
+    };
+
+    Ok(fncall)
+}
+
+// Used here for PropertyType::Function, used in pyclass for descriptors.
+pub fn impl_py_setter_def(
+    cls: &syn::Type,
+    property_type: PropertyType<'_>,
+    ctx: &Ctx,
+) -> Result<MethodAndMethodDef> {
+    let Ctx { pyo3_path, .. } = ctx;
+    let python_name = property_type.null_terminated_python_name(ctx)?;
+    let doc = property_type.doc(ctx);
+    let mut holders = Holders::new();
+    let setter_impl = match property_type {
+        PropertyType::Descriptor {
+            field_index, field, ..
+        } => {
+            let slf = SelfType::Receiver {
+                mutable: true,
+                span: Span::call_site(),
+            }
+            .receiver(cls, ExtractErrorMode::Raise, &mut holders, ctx);
+            if let Some(ident) = &field.ident {
+                // named struct field
+                quote!({ #slf.#ident = _val; })
+            } else {
+                // tuple struct field
+                let index = syn::Index::from(field_index);
+                quote!({ #slf.#index = _val; })
+            }
+        }
+        PropertyType::Function {
+            spec, self_type, ..
+        } => impl_call_setter(cls, spec, self_type, &mut holders, ctx)?,
+    };
+
+    let wrapper_ident = match property_type {
+        PropertyType::Descriptor {
+            field: syn::Field {
+                ident: Some(ident), ..
+            },
+            ..
+        } => {
+            format_ident!("__pymethod_set_{}__", ident)
+        }
+        PropertyType::Descriptor { field_index, .. } => {
+            format_ident!("__pymethod_set_field_{}__", field_index)
+        }
+        PropertyType::Function { spec, .. } => {
+            format_ident!("__pymethod_set_{}__", spec.name)
+        }
+    };
+
+    let extract = match &property_type {
+        PropertyType::Function { spec, .. } => {
+            let (_, args) = split_off_python_arg(&spec.signature.arguments);
+            let value_arg = &args[0];
+            let (from_py_with, ident) = if let Some(from_py_with) =
+                &value_arg.from_py_with().as_ref().map(|f| &f.value)
+            {
+                let ident = syn::Ident::new("from_py_with", from_py_with.span());
+                (
+                    quote_spanned! { from_py_with.span() =>
+                        let e = #pyo3_path::impl_::deprecations::GilRefs::new();
+                        let #ident = #pyo3_path::impl_::deprecations::inspect_fn(#from_py_with, &e);
+                        e.from_py_with_arg();
+                    },
+                    ident,
+                )
+            } else {
+                (quote!(), syn::Ident::new("dummy", Span::call_site()))
+            };
+
+            let arg = if let FnArg::Regular(arg) = &value_arg {
+                arg
+            } else {
+                bail_spanned!(value_arg.name().span() => "The #[setter] value argument can't be *args, **kwargs or `cancel_handle`.");
+            };
+
+            let tokens = impl_regular_arg_param(
+                arg,
+                ident,
+                quote!(::std::option::Option::Some(_value.into())),
+                &mut holders,
+                ctx,
+            );
+            let extract =
+                check_arg_for_gil_refs(tokens, holders.push_gil_refs_checker(arg.ty.span()), ctx);
+
+            let deprecation = deprecate_trailing_option_default(spec);
+            quote! {
+                #deprecation
+                #from_py_with
+                let _val = #extract;
+            }
+        }
+        PropertyType::Descriptor { field, .. } => {
+            let span = field.ty.span();
+            let name = field
+                .ident
+                .as_ref()
+                .map(|i| i.to_string())
+                .unwrap_or_default();
+
+            let holder = holders.push_holder(span);
+            let gil_refs_checker = holders.push_gil_refs_checker(span);
+            quote! {
+                let _val = #pyo3_path::impl_::deprecations::inspect_type(
+                    #pyo3_path::impl_::extract_argument::extract_argument(_value.into(), &mut #holder, #name)?,
+                    &#gil_refs_checker
+                );
+            }
+        }
+    };
+
+    let mut cfg_attrs = TokenStream::new();
+    if let PropertyType::Descriptor { field, .. } = &property_type {
+        for attr in field
+            .attrs
+            .iter()
+            .filter(|attr| attr.path().is_ident("cfg"))
+        {
+            attr.to_tokens(&mut cfg_attrs);
+        }
+    }
+
+    let init_holders = holders.init_holders(ctx);
+    let check_gil_refs = holders.check_gil_refs();
+    let associated_method = quote! {
+        #cfg_attrs
+        unsafe fn #wrapper_ident(
+            py: #pyo3_path::Python<'_>,
+            _slf: *mut #pyo3_path::ffi::PyObject,
+            _value: *mut #pyo3_path::ffi::PyObject,
+        ) -> #pyo3_path::PyResult<::std::os::raw::c_int> {
+            use ::std::convert::Into;
+            let _value = #pyo3_path::impl_::pymethods::BoundRef::ref_from_ptr_or_opt(py, &_value)
+                .ok_or_else(|| {
+                    #pyo3_path::exceptions::PyAttributeError::new_err("can't delete attribute")
+                })?;
+            #init_holders
+            #extract
+            let result = #setter_impl;
+            #check_gil_refs
+            #pyo3_path::callback::convert(py, result)
+        }
+    };
+
+    let method_def = quote! {
+        #cfg_attrs
+        #pyo3_path::impl_::pyclass::MaybeRuntimePyMethodDef::Static(
+            #pyo3_path::class::PyMethodDefType::Setter(
+                #pyo3_path::class::PySetterDef::new(
+                    #python_name,
+                    #cls::#wrapper_ident,
+                    #doc
+                )
+            )
+        )
+    };
+
+    Ok(MethodAndMethodDef {
+        associated_method,
+        method_def,
+    })
+}
+
+fn impl_call_getter(
+    cls: &syn::Type,
+    spec: &FnSpec<'_>,
+    self_type: &SelfType,
+    holders: &mut Holders,
+    ctx: &Ctx,
+) -> syn::Result<TokenStream> {
+    let (py_arg, args) = split_off_python_arg(&spec.signature.arguments);
+    let slf = self_type.receiver(cls, ExtractErrorMode::Raise, holders, ctx);
+    ensure_spanned!(
+        args.is_empty(),
+        args[0].ty().span() => "getter function can only have one argument (of type pyo3::Python)"
+    );
+
+    let name = &spec.name;
+    let fncall = if py_arg.is_some() {
+        quote!(#cls::#name(#slf, py))
+    } else {
+        quote!(#cls::#name(#slf))
+    };
+
+    Ok(fncall)
+}
+
+// Used here for PropertyType::Function, used in pyclass for descriptors.
+pub fn impl_py_getter_def(
+    cls: &syn::Type,
+    property_type: PropertyType<'_>,
+    ctx: &Ctx,
+) -> Result<MethodAndMethodDef> {
+    let Ctx { pyo3_path, .. } = ctx;
+    let python_name = property_type.null_terminated_python_name(ctx)?;
+    let doc = property_type.doc(ctx);
+
+    let mut cfg_attrs = TokenStream::new();
+    if let PropertyType::Descriptor { field, .. } = &property_type {
+        for attr in field
+            .attrs
+            .iter()
+            .filter(|attr| attr.path().is_ident("cfg"))
+        {
+            attr.to_tokens(&mut cfg_attrs);
+        }
+    }
+
+    let mut holders = Holders::new();
+    match property_type {
+        PropertyType::Descriptor {
+            field_index, field, ..
+        } => {
+            let ty = &field.ty;
+            let field = if let Some(ident) = &field.ident {
+                ident.to_token_stream()
+            } else {
+                syn::Index::from(field_index).to_token_stream()
+            };
+
+            // TODO: on MSRV 1.77+, we can use `::std::mem::offset_of!` here, and it should
+            // make it possible for the `MaybeRuntimePyMethodDef` to be a `Static` variant.
+            let method_def = quote_spanned! {ty.span()=>
+                #cfg_attrs
+                {
+                    #[allow(unused_imports)]  // might not be used if all probes are positve
+                    use #pyo3_path::impl_::pyclass::Probe;
+
+                    struct Offset;
+                    unsafe impl #pyo3_path::impl_::pyclass::OffsetCalculator<#cls, #ty> for Offset {
+                        fn offset() -> usize {
+                            #pyo3_path::impl_::pyclass::class_offset::<#cls>() +
+                            #pyo3_path::impl_::pyclass::offset_of!(#cls, #field)
+                        }
+                    }
+
+                    const GENERATOR: #pyo3_path::impl_::pyclass::PyClassGetterGenerator::<
+                        #cls,
+                        #ty,
+                        Offset,
+                        { #pyo3_path::impl_::pyclass::IsPyT::<#ty>::VALUE },
+                        { #pyo3_path::impl_::pyclass::IsToPyObject::<#ty>::VALUE },
+                    > = unsafe { #pyo3_path::impl_::pyclass::PyClassGetterGenerator::new() };
+                    #pyo3_path::impl_::pyclass::MaybeRuntimePyMethodDef::Runtime(
+                        || GENERATOR.generate(#python_name, #doc)
+                    )
+                }
+            };
+
+            Ok(MethodAndMethodDef {
+                associated_method: quote! {},
+                method_def,
+            })
+        }
+        // Forward to `IntoPyCallbackOutput`, to handle `#[getter]`s returning results.
+        PropertyType::Function {
+            spec, self_type, ..
+        } => {
+            let wrapper_ident = format_ident!("__pymethod_get_{}__", spec.name);
+            let call = impl_call_getter(cls, spec, self_type, &mut holders, ctx)?;
+            let body = quote! {
+                #pyo3_path::callback::convert(py, #call)
+            };
+
+            let init_holders = holders.init_holders(ctx);
+            let check_gil_refs = holders.check_gil_refs();
+            let associated_method = quote! {
+                #cfg_attrs
+                unsafe fn #wrapper_ident(
+                    py: #pyo3_path::Python<'_>,
+                    _slf: *mut #pyo3_path::ffi::PyObject
+                ) -> #pyo3_path::PyResult<*mut #pyo3_path::ffi::PyObject> {
+                    #init_holders
+                    let result = #body;
+                    #check_gil_refs
+                    result
+                }
+            };
+
+            let method_def = quote! {
+                #cfg_attrs
+                #pyo3_path::impl_::pyclass::MaybeRuntimePyMethodDef::Static(
+                    #pyo3_path::class::PyMethodDefType::Getter(
+                        #pyo3_path::class::PyGetterDef::new(
+                            #python_name,
+                            #cls::#wrapper_ident,
+                            #doc
+                        )
+                    )
+                )
+            };
+
+            Ok(MethodAndMethodDef {
+                associated_method,
+                method_def,
+            })
+        }
+    }
+}
+
+/// Split an argument of pyo3::Python from the front of the arg list, if present
+fn split_off_python_arg<'a>(args: &'a [FnArg<'a>]) -> (Option<&PyArg<'_>>, &[FnArg<'_>]) {
+    match args {
+        [FnArg::Py(py), args @ ..] => (Some(py), args),
+        args => (None, args),
+    }
+}
+
+pub enum PropertyType<'a> {
+    Descriptor {
+        field_index: usize,
+        field: &'a syn::Field,
+        python_name: Option<&'a NameAttribute>,
+        renaming_rule: Option<RenamingRule>,
+    },
+    Function {
+        self_type: &'a SelfType,
+        spec: &'a FnSpec<'a>,
+        doc: PythonDoc,
+    },
+}
+
+impl PropertyType<'_> {
+    fn null_terminated_python_name(&self, ctx: &Ctx) -> Result<LitCStr> {
+        match self {
+            PropertyType::Descriptor {
+                field,
+                python_name,
+                renaming_rule,
+                ..
+            } => {
+                let name = match (python_name, &field.ident) {
+                    (Some(name), _) => name.value.0.to_string(),
+                    (None, Some(field_name)) => {
+                        let mut name = field_name.unraw().to_string();
+                        if let Some(rule) = renaming_rule {
+                            name = utils::apply_renaming_rule(*rule, &name);
+                        }
+                        name
+                    }
+                    (None, None) => {
+                        bail_spanned!(field.span() => "`get` and `set` with tuple struct fields require `name`");
+                    }
+                };
+                let name = CString::new(name).unwrap();
+                Ok(LitCStr::new(name, field.span(), ctx))
+            }
+            PropertyType::Function { spec, .. } => Ok(spec.null_terminated_python_name(ctx)),
+        }
+    }
+
+    fn doc(&self, ctx: &Ctx) -> Cow<'_, PythonDoc> {
+        match self {
+            PropertyType::Descriptor { field, .. } => {
+                Cow::Owned(utils::get_doc(&field.attrs, None, ctx))
+            }
+            PropertyType::Function { doc, .. } => Cow::Borrowed(doc),
+        }
+    }
+}
+
+const __STR__: SlotDef = SlotDef::new("Py_tp_str", "reprfunc");
+pub const __REPR__: SlotDef = SlotDef::new("Py_tp_repr", "reprfunc");
+pub const __HASH__: SlotDef = SlotDef::new("Py_tp_hash", "hashfunc")
+    .ret_ty(Ty::PyHashT)
+    .return_conversion(TokenGenerator(
+        |Ctx { pyo3_path, .. }: &Ctx| quote! { #pyo3_path::callback::HashCallbackOutput },
+    ));
+pub const __RICHCMP__: SlotDef = SlotDef::new("Py_tp_richcompare", "richcmpfunc")
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .arguments(&[Ty::Object, Ty::CompareOp]);
+const __GET__: SlotDef = SlotDef::new("Py_tp_descr_get", "descrgetfunc")
+    .arguments(&[Ty::MaybeNullObject, Ty::MaybeNullObject]);
+const __ITER__: SlotDef = SlotDef::new("Py_tp_iter", "getiterfunc");
+const __NEXT__: SlotDef = SlotDef::new("Py_tp_iternext", "iternextfunc")
+    .return_specialized_conversion(
+        TokenGenerator(|_| quote! { IterBaseKind, IterOptionKind, IterResultOptionKind }),
+        TokenGenerator(|_| quote! { iter_tag }),
+    );
+const __AWAIT__: SlotDef = SlotDef::new("Py_am_await", "unaryfunc");
+const __AITER__: SlotDef = SlotDef::new("Py_am_aiter", "unaryfunc");
+const __ANEXT__: SlotDef = SlotDef::new("Py_am_anext", "unaryfunc").return_specialized_conversion(
+    TokenGenerator(
+        |_| quote! { AsyncIterBaseKind, AsyncIterOptionKind, AsyncIterResultOptionKind },
+    ),
+    TokenGenerator(|_| quote! { async_iter_tag }),
+);
+pub const __LEN__: SlotDef = SlotDef::new("Py_mp_length", "lenfunc").ret_ty(Ty::PySsizeT);
+const __CONTAINS__: SlotDef = SlotDef::new("Py_sq_contains", "objobjproc")
+    .arguments(&[Ty::Object])
+    .ret_ty(Ty::Int);
+const __CONCAT__: SlotDef = SlotDef::new("Py_sq_concat", "binaryfunc").arguments(&[Ty::Object]);
+const __REPEAT__: SlotDef = SlotDef::new("Py_sq_repeat", "ssizeargfunc").arguments(&[Ty::PySsizeT]);
+const __INPLACE_CONCAT__: SlotDef =
+    SlotDef::new("Py_sq_concat", "binaryfunc").arguments(&[Ty::Object]);
+const __INPLACE_REPEAT__: SlotDef =
+    SlotDef::new("Py_sq_repeat", "ssizeargfunc").arguments(&[Ty::PySsizeT]);
+pub const __GETITEM__: SlotDef =
+    SlotDef::new("Py_mp_subscript", "binaryfunc").arguments(&[Ty::Object]);
+
+const __POS__: SlotDef = SlotDef::new("Py_nb_positive", "unaryfunc");
+const __NEG__: SlotDef = SlotDef::new("Py_nb_negative", "unaryfunc");
+const __ABS__: SlotDef = SlotDef::new("Py_nb_absolute", "unaryfunc");
+const __INVERT__: SlotDef = SlotDef::new("Py_nb_invert", "unaryfunc");
+const __INDEX__: SlotDef = SlotDef::new("Py_nb_index", "unaryfunc");
+pub const __INT__: SlotDef = SlotDef::new("Py_nb_int", "unaryfunc");
+const __FLOAT__: SlotDef = SlotDef::new("Py_nb_float", "unaryfunc");
+const __BOOL__: SlotDef = SlotDef::new("Py_nb_bool", "inquiry").ret_ty(Ty::Int);
+
+const __IADD__: SlotDef = SlotDef::new("Py_nb_inplace_add", "binaryfunc")
+    .arguments(&[Ty::Object])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .return_self();
+const __ISUB__: SlotDef = SlotDef::new("Py_nb_inplace_subtract", "binaryfunc")
+    .arguments(&[Ty::Object])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .return_self();
+const __IMUL__: SlotDef = SlotDef::new("Py_nb_inplace_multiply", "binaryfunc")
+    .arguments(&[Ty::Object])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .return_self();
+const __IMATMUL__: SlotDef = SlotDef::new("Py_nb_inplace_matrix_multiply", "binaryfunc")
+    .arguments(&[Ty::Object])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .return_self();
+const __ITRUEDIV__: SlotDef = SlotDef::new("Py_nb_inplace_true_divide", "binaryfunc")
+    .arguments(&[Ty::Object])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .return_self();
+const __IFLOORDIV__: SlotDef = SlotDef::new("Py_nb_inplace_floor_divide", "binaryfunc")
+    .arguments(&[Ty::Object])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .return_self();
+const __IMOD__: SlotDef = SlotDef::new("Py_nb_inplace_remainder", "binaryfunc")
+    .arguments(&[Ty::Object])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .return_self();
+const __IPOW__: SlotDef = SlotDef::new("Py_nb_inplace_power", "ipowfunc")
+    .arguments(&[Ty::Object, Ty::IPowModulo])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .return_self();
+const __ILSHIFT__: SlotDef = SlotDef::new("Py_nb_inplace_lshift", "binaryfunc")
+    .arguments(&[Ty::Object])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .return_self();
+const __IRSHIFT__: SlotDef = SlotDef::new("Py_nb_inplace_rshift", "binaryfunc")
+    .arguments(&[Ty::Object])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .return_self();
+const __IAND__: SlotDef = SlotDef::new("Py_nb_inplace_and", "binaryfunc")
+    .arguments(&[Ty::Object])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .return_self();
+const __IXOR__: SlotDef = SlotDef::new("Py_nb_inplace_xor", "binaryfunc")
+    .arguments(&[Ty::Object])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .return_self();
+const __IOR__: SlotDef = SlotDef::new("Py_nb_inplace_or", "binaryfunc")
+    .arguments(&[Ty::Object])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .return_self();
+const __GETBUFFER__: SlotDef = SlotDef::new("Py_bf_getbuffer", "getbufferproc")
+    .arguments(&[Ty::PyBuffer, Ty::Int])
+    .ret_ty(Ty::Int)
+    .require_unsafe();
+const __RELEASEBUFFER__: SlotDef = SlotDef::new("Py_bf_releasebuffer", "releasebufferproc")
+    .arguments(&[Ty::PyBuffer])
+    .ret_ty(Ty::Void)
+    .require_unsafe();
+const __CLEAR__: SlotDef = SlotDef::new("Py_tp_clear", "inquiry")
+    .arguments(&[])
+    .ret_ty(Ty::Int);
+
+#[derive(Clone, Copy)]
+enum Ty {
+    Object,
+    MaybeNullObject,
+    NonNullObject,
+    IPowModulo,
+    CompareOp,
+    Int,
+    PyHashT,
+    PySsizeT,
+    Void,
+    PyBuffer,
+}
+
+impl Ty {
+    fn ffi_type(self, ctx: &Ctx) -> TokenStream {
+        let Ctx {
+            pyo3_path,
+            output_span,
+        } = ctx;
+        let pyo3_path = pyo3_path.to_tokens_spanned(*output_span);
+        match self {
+            Ty::Object | Ty::MaybeNullObject => quote! { *mut #pyo3_path::ffi::PyObject },
+            Ty::NonNullObject => quote! { ::std::ptr::NonNull<#pyo3_path::ffi::PyObject> },
+            Ty::IPowModulo => quote! { #pyo3_path::impl_::pymethods::IPowModulo },
+            Ty::Int | Ty::CompareOp => quote! { ::std::os::raw::c_int },
+            Ty::PyHashT => quote! { #pyo3_path::ffi::Py_hash_t },
+            Ty::PySsizeT => quote! { #pyo3_path::ffi::Py_ssize_t },
+            Ty::Void => quote! { () },
+            Ty::PyBuffer => quote! { *mut #pyo3_path::ffi::Py_buffer },
+        }
+    }
+
+    fn extract(
+        self,
+        ident: &syn::Ident,
+        arg: &FnArg<'_>,
+        extract_error_mode: ExtractErrorMode,
+        holders: &mut Holders,
+        ctx: &Ctx,
+    ) -> TokenStream {
+        let Ctx { pyo3_path, .. } = ctx;
+        match self {
+            Ty::Object => extract_object(
+                extract_error_mode,
+                holders,
+                arg,
+                quote! { #ident },
+                ctx
+            ),
+            Ty::MaybeNullObject => extract_object(
+                extract_error_mode,
+                holders,
+                arg,
+                quote! {
+                    if #ident.is_null() {
+                        #pyo3_path::ffi::Py_None()
+                    } else {
+                        #ident
+                    }
+                },
+                ctx
+            ),
+            Ty::NonNullObject => extract_object(
+                extract_error_mode,
+                holders,
+                arg,
+                quote! { #ident.as_ptr() },
+                ctx
+            ),
+            Ty::IPowModulo => extract_object(
+                extract_error_mode,
+                holders,
+                arg,
+                quote! { #ident.as_ptr() },
+                ctx
+            ),
+            Ty::CompareOp => extract_error_mode.handle_error(
+                quote! {
+                    #pyo3_path::class::basic::CompareOp::from_raw(#ident)
+                        .ok_or_else(|| #pyo3_path::exceptions::PyValueError::new_err("invalid comparison operator"))
+                },
+                ctx
+            ),
+            Ty::PySsizeT => {
+                let ty = arg.ty();
+                extract_error_mode.handle_error(
+                    quote! {
+                            ::std::convert::TryInto::<#ty>::try_into(#ident).map_err(|e| #pyo3_path::exceptions::PyValueError::new_err(e.to_string()))
+                    },
+                    ctx
+                )
+            }
+            // Just pass other types through unmodified
+            Ty::PyBuffer | Ty::Int | Ty::PyHashT | Ty::Void => quote! { #ident },
+        }
+    }
+}
+
+fn extract_object(
+    extract_error_mode: ExtractErrorMode,
+    holders: &mut Holders,
+    arg: &FnArg<'_>,
+    source_ptr: TokenStream,
+    ctx: &Ctx,
+) -> TokenStream {
+    let Ctx { pyo3_path, .. } = ctx;
+    let gil_refs_checker = holders.push_gil_refs_checker(arg.ty().span());
+    let name = arg.name().unraw().to_string();
+
+    let extract = if let Some(from_py_with) =
+        arg.from_py_with().map(|from_py_with| &from_py_with.value)
+    {
+        let from_py_with_checker = holders.push_from_py_with_checker(from_py_with.span());
+        quote! {
+            #pyo3_path::impl_::extract_argument::from_py_with(
+                #pyo3_path::impl_::pymethods::BoundRef::ref_from_ptr(py, &#source_ptr).0,
+                #name,
+                #pyo3_path::impl_::deprecations::inspect_fn(#from_py_with, &#from_py_with_checker) as fn(_) -> _,
+            )
+        }
+    } else {
+        let holder = holders.push_holder(Span::call_site());
+        quote! {
+            #pyo3_path::impl_::extract_argument::extract_argument(
+                #pyo3_path::impl_::pymethods::BoundRef::ref_from_ptr(py, &#source_ptr).0,
+                &mut #holder,
+                #name
+            )
+        }
+    };
+
+    let extracted = extract_error_mode.handle_error(extract, ctx);
+    quote! {
+        #pyo3_path::impl_::deprecations::inspect_type(#extracted, &#gil_refs_checker)
+    }
+}
+
+enum ReturnMode {
+    ReturnSelf,
+    Conversion(TokenGenerator),
+    SpecializedConversion(TokenGenerator, TokenGenerator),
+}
+
+impl ReturnMode {
+    fn return_call_output(&self, call: TokenStream, ctx: &Ctx, holders: &Holders) -> TokenStream {
+        let Ctx { pyo3_path, .. } = ctx;
+        let check_gil_refs = holders.check_gil_refs();
+        match self {
+            ReturnMode::Conversion(conversion) => {
+                let conversion = TokenGeneratorCtx(*conversion, ctx);
+                quote! {
+                    let _result: #pyo3_path::PyResult<#conversion> = #pyo3_path::callback::convert(py, #call);
+                    #check_gil_refs
+                    #pyo3_path::callback::convert(py, _result)
+                }
+            }
+            ReturnMode::SpecializedConversion(traits, tag) => {
+                let traits = TokenGeneratorCtx(*traits, ctx);
+                let tag = TokenGeneratorCtx(*tag, ctx);
+                quote! {
+                    let _result = #call;
+                    use #pyo3_path::impl_::pymethods::{#traits};
+                    #check_gil_refs
+                    (&_result).#tag().convert(py, _result)
+                }
+            }
+            ReturnMode::ReturnSelf => quote! {
+                let _result: #pyo3_path::PyResult<()> = #pyo3_path::callback::convert(py, #call);
+                _result?;
+                #check_gil_refs
+                #pyo3_path::ffi::Py_XINCREF(_raw_slf);
+                ::std::result::Result::Ok(_raw_slf)
+            },
+        }
+    }
+}
+
+pub struct SlotDef {
+    slot: StaticIdent,
+    func_ty: StaticIdent,
+    arguments: &'static [Ty],
+    ret_ty: Ty,
+    extract_error_mode: ExtractErrorMode,
+    return_mode: Option<ReturnMode>,
+    require_unsafe: bool,
+}
+
+const NO_ARGUMENTS: &[Ty] = &[];
+
+impl SlotDef {
+    const fn new(slot: &'static str, func_ty: &'static str) -> Self {
+        SlotDef {
+            slot: StaticIdent(slot),
+            func_ty: StaticIdent(func_ty),
+            arguments: NO_ARGUMENTS,
+            ret_ty: Ty::Object,
+            extract_error_mode: ExtractErrorMode::Raise,
+            return_mode: None,
+            require_unsafe: false,
+        }
+    }
+
+    const fn arguments(mut self, arguments: &'static [Ty]) -> Self {
+        self.arguments = arguments;
+        self
+    }
+
+    const fn ret_ty(mut self, ret_ty: Ty) -> Self {
+        self.ret_ty = ret_ty;
+        self
+    }
+
+    const fn return_conversion(mut self, return_conversion: TokenGenerator) -> Self {
+        self.return_mode = Some(ReturnMode::Conversion(return_conversion));
+        self
+    }
+
+    const fn return_specialized_conversion(
+        mut self,
+        traits: TokenGenerator,
+        tag: TokenGenerator,
+    ) -> Self {
+        self.return_mode = Some(ReturnMode::SpecializedConversion(traits, tag));
+        self
+    }
+
+    const fn extract_error_mode(mut self, extract_error_mode: ExtractErrorMode) -> Self {
+        self.extract_error_mode = extract_error_mode;
+        self
+    }
+
+    const fn return_self(mut self) -> Self {
+        self.return_mode = Some(ReturnMode::ReturnSelf);
+        self
+    }
+
+    const fn require_unsafe(mut self) -> Self {
+        self.require_unsafe = true;
+        self
+    }
+
+    pub fn generate_type_slot(
+        &self,
+        cls: &syn::Type,
+        spec: &FnSpec<'_>,
+        method_name: &str,
+        ctx: &Ctx,
+    ) -> Result<MethodAndSlotDef> {
+        let Ctx { pyo3_path, .. } = ctx;
+        let SlotDef {
+            slot,
+            func_ty,
+            arguments,
+            extract_error_mode,
+            ret_ty,
+            return_mode,
+            require_unsafe,
+        } = self;
+        if *require_unsafe {
+            ensure_spanned!(
+                spec.unsafety.is_some(),
+                spec.name.span() => format!("`{}` must be `unsafe fn`", method_name)
+            );
+        }
+        let arg_types: &Vec<_> = &arguments.iter().map(|arg| arg.ffi_type(ctx)).collect();
+        let arg_idents: &Vec<_> = &(0..arguments.len())
+            .map(|i| format_ident!("arg{}", i))
+            .collect();
+        let wrapper_ident = format_ident!("__pymethod_{}__", method_name);
+        let ret_ty = ret_ty.ffi_type(ctx);
+        let mut holders = Holders::new();
+        let body = generate_method_body(
+            cls,
+            spec,
+            arguments,
+            *extract_error_mode,
+            &mut holders,
+            return_mode.as_ref(),
+            ctx,
+        )?;
+        let name = spec.name;
+        let holders = holders.init_holders(ctx);
+        let associated_method = quote! {
+            unsafe fn #wrapper_ident(
+                py: #pyo3_path::Python<'_>,
+                _raw_slf: *mut #pyo3_path::ffi::PyObject,
+                #(#arg_idents: #arg_types),*
+            ) -> #pyo3_path::PyResult<#ret_ty> {
+                let function = #cls::#name; // Shadow the method name to avoid #3017
+                let _slf = _raw_slf;
+                #holders
+                #body
+            }
+        };
+        let slot_def = quote! {{
+            unsafe extern "C" fn trampoline(
+                _slf: *mut #pyo3_path::ffi::PyObject,
+                #(#arg_idents: #arg_types),*
+            ) -> #ret_ty
+            {
+                #pyo3_path::impl_::trampoline:: #func_ty (
+                    _slf,
+                    #(#arg_idents,)*
+                    #cls::#wrapper_ident
+                )
+            }
+
+            #pyo3_path::ffi::PyType_Slot {
+                slot: #pyo3_path::ffi::#slot,
+                pfunc: trampoline as #pyo3_path::ffi::#func_ty as _
+            }
+        }};
+        Ok(MethodAndSlotDef {
+            associated_method,
+            slot_def,
+        })
+    }
+}
+
+fn generate_method_body(
+    cls: &syn::Type,
+    spec: &FnSpec<'_>,
+    arguments: &[Ty],
+    extract_error_mode: ExtractErrorMode,
+    holders: &mut Holders,
+    return_mode: Option<&ReturnMode>,
+    ctx: &Ctx,
+) -> Result<TokenStream> {
+    let Ctx { pyo3_path, .. } = ctx;
+    let self_arg = spec
+        .tp
+        .self_arg(Some(cls), extract_error_mode, holders, ctx);
+    let rust_name = spec.name;
+    let args = extract_proto_arguments(spec, arguments, extract_error_mode, holders, ctx)?;
+    let call = quote! { #cls::#rust_name(#self_arg #(#args),*) };
+    Ok(if let Some(return_mode) = return_mode {
+        return_mode.return_call_output(call, ctx, holders)
+    } else {
+        let check_gil_refs = holders.check_gil_refs();
+        quote! {
+            let result = #call;
+            #check_gil_refs;
+            #pyo3_path::callback::convert(py, result)
+        }
+    })
+}
+
+struct SlotFragmentDef {
+    fragment: &'static str,
+    arguments: &'static [Ty],
+    extract_error_mode: ExtractErrorMode,
+    ret_ty: Ty,
+}
+
+impl SlotFragmentDef {
+    const fn new(fragment: &'static str, arguments: &'static [Ty]) -> Self {
+        SlotFragmentDef {
+            fragment,
+            arguments,
+            extract_error_mode: ExtractErrorMode::Raise,
+            ret_ty: Ty::Void,
+        }
+    }
+
+    const fn extract_error_mode(mut self, extract_error_mode: ExtractErrorMode) -> Self {
+        self.extract_error_mode = extract_error_mode;
+        self
+    }
+
+    const fn ret_ty(mut self, ret_ty: Ty) -> Self {
+        self.ret_ty = ret_ty;
+        self
+    }
+
+    fn generate_pyproto_fragment(
+        &self,
+        cls: &syn::Type,
+        spec: &FnSpec<'_>,
+        ctx: &Ctx,
+    ) -> Result<TokenStream> {
+        let Ctx { pyo3_path, .. } = ctx;
+        let SlotFragmentDef {
+            fragment,
+            arguments,
+            extract_error_mode,
+            ret_ty,
+        } = self;
+        let fragment_trait = format_ident!("PyClass{}SlotFragment", fragment);
+        let method = syn::Ident::new(fragment, Span::call_site());
+        let wrapper_ident = format_ident!("__pymethod_{}__", fragment);
+        let arg_types: &Vec<_> = &arguments.iter().map(|arg| arg.ffi_type(ctx)).collect();
+        let arg_idents: &Vec<_> = &(0..arguments.len())
+            .map(|i| format_ident!("arg{}", i))
+            .collect();
+        let mut holders = Holders::new();
+        let body = generate_method_body(
+            cls,
+            spec,
+            arguments,
+            *extract_error_mode,
+            &mut holders,
+            None,
+            ctx,
+        )?;
+        let ret_ty = ret_ty.ffi_type(ctx);
+        let holders = holders.init_holders(ctx);
+        Ok(quote! {
+            impl #cls {
+                unsafe fn #wrapper_ident(
+                    py: #pyo3_path::Python,
+                    _raw_slf: *mut #pyo3_path::ffi::PyObject,
+                    #(#arg_idents: #arg_types),*
+                ) -> #pyo3_path::PyResult<#ret_ty> {
+                    let _slf = _raw_slf;
+                    #holders
+                    #body
+                }
+            }
+
+            impl #pyo3_path::impl_::pyclass::#fragment_trait<#cls> for #pyo3_path::impl_::pyclass::PyClassImplCollector<#cls> {
+
+                #[inline]
+                unsafe fn #method(
+                    self,
+                    py: #pyo3_path::Python,
+                    _raw_slf: *mut #pyo3_path::ffi::PyObject,
+                    #(#arg_idents: #arg_types),*
+                ) -> #pyo3_path::PyResult<#ret_ty> {
+                    #cls::#wrapper_ident(py, _raw_slf, #(#arg_idents),*)
+                }
+            }
+        })
+    }
+}
+
+const __GETATTRIBUTE__: SlotFragmentDef =
+    SlotFragmentDef::new("__getattribute__", &[Ty::Object]).ret_ty(Ty::Object);
+const __GETATTR__: SlotFragmentDef =
+    SlotFragmentDef::new("__getattr__", &[Ty::Object]).ret_ty(Ty::Object);
+const __SETATTR__: SlotFragmentDef =
+    SlotFragmentDef::new("__setattr__", &[Ty::Object, Ty::NonNullObject]);
+const __DELATTR__: SlotFragmentDef = SlotFragmentDef::new("__delattr__", &[Ty::Object]);
+const __SET__: SlotFragmentDef = SlotFragmentDef::new("__set__", &[Ty::Object, Ty::NonNullObject]);
+const __DELETE__: SlotFragmentDef = SlotFragmentDef::new("__delete__", &[Ty::Object]);
+const __SETITEM__: SlotFragmentDef =
+    SlotFragmentDef::new("__setitem__", &[Ty::Object, Ty::NonNullObject]);
+const __DELITEM__: SlotFragmentDef = SlotFragmentDef::new("__delitem__", &[Ty::Object]);
+
+macro_rules! binary_num_slot_fragment_def {
+    ($ident:ident, $name:literal) => {
+        const $ident: SlotFragmentDef = SlotFragmentDef::new($name, &[Ty::Object])
+            .extract_error_mode(ExtractErrorMode::NotImplemented)
+            .ret_ty(Ty::Object);
+    };
+}
+
+binary_num_slot_fragment_def!(__ADD__, "__add__");
+binary_num_slot_fragment_def!(__RADD__, "__radd__");
+binary_num_slot_fragment_def!(__SUB__, "__sub__");
+binary_num_slot_fragment_def!(__RSUB__, "__rsub__");
+binary_num_slot_fragment_def!(__MUL__, "__mul__");
+binary_num_slot_fragment_def!(__RMUL__, "__rmul__");
+binary_num_slot_fragment_def!(__MATMUL__, "__matmul__");
+binary_num_slot_fragment_def!(__RMATMUL__, "__rmatmul__");
+binary_num_slot_fragment_def!(__FLOORDIV__, "__floordiv__");
+binary_num_slot_fragment_def!(__RFLOORDIV__, "__rfloordiv__");
+binary_num_slot_fragment_def!(__TRUEDIV__, "__truediv__");
+binary_num_slot_fragment_def!(__RTRUEDIV__, "__rtruediv__");
+binary_num_slot_fragment_def!(__DIVMOD__, "__divmod__");
+binary_num_slot_fragment_def!(__RDIVMOD__, "__rdivmod__");
+binary_num_slot_fragment_def!(__MOD__, "__mod__");
+binary_num_slot_fragment_def!(__RMOD__, "__rmod__");
+binary_num_slot_fragment_def!(__LSHIFT__, "__lshift__");
+binary_num_slot_fragment_def!(__RLSHIFT__, "__rlshift__");
+binary_num_slot_fragment_def!(__RSHIFT__, "__rshift__");
+binary_num_slot_fragment_def!(__RRSHIFT__, "__rrshift__");
+binary_num_slot_fragment_def!(__AND__, "__and__");
+binary_num_slot_fragment_def!(__RAND__, "__rand__");
+binary_num_slot_fragment_def!(__XOR__, "__xor__");
+binary_num_slot_fragment_def!(__RXOR__, "__rxor__");
+binary_num_slot_fragment_def!(__OR__, "__or__");
+binary_num_slot_fragment_def!(__ROR__, "__ror__");
+
+const __POW__: SlotFragmentDef = SlotFragmentDef::new("__pow__", &[Ty::Object, Ty::Object])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .ret_ty(Ty::Object);
+const __RPOW__: SlotFragmentDef = SlotFragmentDef::new("__rpow__", &[Ty::Object, Ty::Object])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .ret_ty(Ty::Object);
+
+const __LT__: SlotFragmentDef = SlotFragmentDef::new("__lt__", &[Ty::Object])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .ret_ty(Ty::Object);
+const __LE__: SlotFragmentDef = SlotFragmentDef::new("__le__", &[Ty::Object])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .ret_ty(Ty::Object);
+const __EQ__: SlotFragmentDef = SlotFragmentDef::new("__eq__", &[Ty::Object])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .ret_ty(Ty::Object);
+const __NE__: SlotFragmentDef = SlotFragmentDef::new("__ne__", &[Ty::Object])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .ret_ty(Ty::Object);
+const __GT__: SlotFragmentDef = SlotFragmentDef::new("__gt__", &[Ty::Object])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .ret_ty(Ty::Object);
+const __GE__: SlotFragmentDef = SlotFragmentDef::new("__ge__", &[Ty::Object])
+    .extract_error_mode(ExtractErrorMode::NotImplemented)
+    .ret_ty(Ty::Object);
+
+fn extract_proto_arguments(
+    spec: &FnSpec<'_>,
+    proto_args: &[Ty],
+    extract_error_mode: ExtractErrorMode,
+    holders: &mut Holders,
+    ctx: &Ctx,
+) -> Result<Vec<TokenStream>> {
+    let mut args = Vec::with_capacity(spec.signature.arguments.len());
+    let mut non_python_args = 0;
+
+    for arg in &spec.signature.arguments {
+        if let FnArg::Py(..) = arg {
+            args.push(quote! { py });
+        } else {
+            let ident = syn::Ident::new(&format!("arg{}", non_python_args), Span::call_site());
+            let conversions = proto_args.get(non_python_args)
+                .ok_or_else(|| err_spanned!(arg.ty().span() => format!("Expected at most {} non-python arguments", proto_args.len())))?
+                .extract(&ident, arg, extract_error_mode, holders, ctx);
+            non_python_args += 1;
+            args.push(conversions);
+        }
+    }
+
+    if non_python_args != proto_args.len() {
+        bail_spanned!(spec.name.span() => format!("Expected {} arguments, got {}", proto_args.len(), non_python_args));
+    }
+    Ok(args)
+}
+
+struct StaticIdent(&'static str);
+
+impl ToTokens for StaticIdent {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        syn::Ident::new(self.0, Span::call_site()).to_tokens(tokens)
+    }
+}
+
+#[derive(Clone, Copy)]
+struct TokenGenerator(fn(&Ctx) -> TokenStream);
+
+struct TokenGeneratorCtx<'ctx>(TokenGenerator, &'ctx Ctx);
+
+impl ToTokens for TokenGeneratorCtx<'_> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        let Self(TokenGenerator(gen), ctx) = self;
+        (gen)(ctx).to_tokens(tokens)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/src/pyversions.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/pyversions.rs
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/src/pyversions.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/pyversions.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,3 @@
+use pyo3_build_config::PythonVersion;
+
+pub const PY_3_9: PythonVersion = PythonVersion { major: 3, minor: 9 };
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/src/quotes.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/quotes.rs
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/src/quotes.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/quotes.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,31 @@
+use crate::utils::Ctx;
+use proc_macro2::TokenStream;
+use quote::{quote, quote_spanned};
+
+pub(crate) fn some_wrap(obj: TokenStream, ctx: &Ctx) -> TokenStream {
+    let Ctx { pyo3_path, .. } = ctx;
+    quote! {
+        #pyo3_path::impl_::wrap::SomeWrap::wrap(#obj)
+    }
+}
+
+pub(crate) fn ok_wrap(obj: TokenStream, ctx: &Ctx) -> TokenStream {
+    let Ctx {
+        pyo3_path,
+        output_span,
+    } = ctx;
+    let pyo3_path = pyo3_path.to_tokens_spanned(*output_span);
+    quote_spanned! {*output_span=>
+        #pyo3_path::impl_::wrap::OkWrap::wrap(#obj)
+            .map_err(::core::convert::Into::<#pyo3_path::PyErr>::into)
+    }
+}
+
+pub(crate) fn map_result_into_ptr(result: TokenStream, ctx: &Ctx) -> TokenStream {
+    let Ctx {
+        pyo3_path,
+        output_span,
+    } = ctx;
+    let pyo3_path = pyo3_path.to_tokens_spanned(*output_span);
+    quote_spanned! {*output_span=> #pyo3_path::impl_::wrap::map_result_into_ptr(py, #result) }
+}
diff -pruN 43.0.0-1/rust-vendor/pyo3-macros-backend/src/utils.rs 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/utils.rs
--- 43.0.0-1/rust-vendor/pyo3-macros-backend/src/utils.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/pyo3-macros-backend/src/utils.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,293 @@
+use crate::attributes::{CrateAttribute, RenamingRule};
+use proc_macro2::{Span, TokenStream};
+use quote::{quote, ToTokens};
+use std::ffi::CString;
+use syn::spanned::Spanned;
+use syn::{punctuated::Punctuated, Token};
+
+/// Macro inspired by `anyhow::anyhow!` to create a compiler error with the given span.
+macro_rules! err_spanned {
+    ($span:expr => $msg:expr) => {
+        syn::Error::new($span, $msg)
+    };
+}
+
+/// Macro inspired by `anyhow::bail!` to return a compiler error with the given span.
+macro_rules! bail_spanned {
+    ($span:expr => $msg:expr) => {
+        return Err(err_spanned!($span => $msg))
+    };
+}
+
+/// Macro inspired by `anyhow::ensure!` to return a compiler error with the given span if the
+/// specified condition is not met.
+macro_rules! ensure_spanned {
+    ($condition:expr, $span:expr => $msg:expr) => {
+        if !($condition) {
+            bail_spanned!($span => $msg);
+        }
+    };
+    ($($condition:expr, $span:expr => $msg:expr;)*) => {
+        if let Some(e) = [$(
+            (!($condition)).then(|| err_spanned!($span => $msg)),
+        )*]
+            .into_iter()
+            .flatten()
+            .reduce(|mut acc, e| {
+                acc.combine(e);
+                acc
+            }) {
+                return Err(e);
+            }
+    };
+}
+
+/// Check if the given type `ty` is `pyo3::Python`.
+pub fn is_python(ty: &syn::Type) -> bool {
+    match unwrap_ty_group(ty) {
+        syn::Type::Path(typath) => typath
+            .path
+            .segments
+            .last()
+            .map(|seg| seg.ident == "Python")
+            .unwrap_or(false),
+        _ => false,
+    }
+}
+
+/// If `ty` is `Option<T>`, return `Some(T)`, else `None`.
+pub fn option_type_argument(ty: &syn::Type) -> Option<&syn::Type> {
+    if let syn::Type::Path(syn::TypePath { path, .. }) = ty {
+        let seg = path.segments.last().filter(|s| s.ident == "Option")?;
+        if let syn::PathArguments::AngleBracketed(params) = &seg.arguments {
+            if let syn::GenericArgument::Type(ty) = params.args.first()? {
+                return Some(ty);
+            }
+        }
+    }
+    None
+}
+
+// TODO: Replace usage of this by [`syn::LitCStr`] when on MSRV 1.77
+#[derive(Clone)]
+pub struct LitCStr {
+    lit: CString,
+    span: Span,
+    pyo3_path: PyO3CratePath,
+}
+
+impl LitCStr {
+    pub fn new(lit: CString, span: Span, ctx: &Ctx) -> Self {
+        Self {
+            lit,
+            span,
+            pyo3_path: ctx.pyo3_path.clone(),
+        }
+    }
+
+    pub fn empty(ctx: &Ctx) -> Self {
+        Self {
+            lit: CString::new("").unwrap(),
+            span: Span::call_site(),
+            pyo3_path: ctx.pyo3_path.clone(),
+        }
+    }
+}
+
+impl quote::ToTokens for LitCStr {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        if cfg!(c_str_lit) {
+            syn::LitCStr::new(&self.lit, self.span).to_tokens(tokens);
+        } else {
+            let pyo3_path = &self.pyo3_path;
+            let lit = self.lit.to_str().unwrap();
+            tokens.extend(quote::quote_spanned!(self.span => #pyo3_path::ffi::c_str!(#lit)));
+        }
+    }
+}
+
+/// A syntax tree which evaluates to a nul-terminated docstring for Python.
+///
+/// Typically the tokens will just be that string, but if the original docs included macro
+/// expressions then the tokens will be a concat!("...", "\n", "\0") expression of the strings and
+/// macro parts. contents such as parse the string contents.
+#[derive(Clone)]
+pub struct PythonDoc(PythonDocKind);
+
+#[derive(Clone)]
+enum PythonDocKind {
+    LitCStr(LitCStr),
+    // There is currently no way to `concat!` c-string literals, we fallback to the `c_str!` macro in
+    // this case.
+    Tokens(TokenStream),
+}
+
+/// Collects all #[doc = "..."] attributes into a TokenStream evaluating to a null-terminated string.
+///
+/// If this doc is for a callable, the provided `text_signature` can be passed to prepend
+/// this to the documentation suitable for Python to extract this into the `__text_signature__`
+/// attribute.
+pub fn get_doc(
+    attrs: &[syn::Attribute],
+    mut text_signature: Option<String>,
+    ctx: &Ctx,
+) -> PythonDoc {
+    let Ctx { pyo3_path, .. } = ctx;
+    // insert special divider between `__text_signature__` and doc
+    // (assume text_signature is itself well-formed)
+    if let Some(text_signature) = &mut text_signature {
+        text_signature.push_str("\n--\n\n");
+    }
+
+    let mut parts = Punctuated::<TokenStream, Token![,]>::new();
+    let mut first = true;
+    let mut current_part = text_signature.unwrap_or_default();
+
+    for attr in attrs {
+        if attr.path().is_ident("doc") {
+            if let Ok(nv) = attr.meta.require_name_value() {
+                if !first {
+                    current_part.push('\n');
+                } else {
+                    first = false;
+                }
+                if let syn::Expr::Lit(syn::ExprLit {
+                    lit: syn::Lit::Str(lit_str),
+                    ..
+                }) = &nv.value
+                {
+                    // Strip single left space from literal strings, if needed.
+                    // e.g. `/// Hello world` expands to #[doc = " Hello world"]
+                    let doc_line = lit_str.value();
+                    current_part.push_str(doc_line.strip_prefix(' ').unwrap_or(&doc_line));
+                } else {
+                    // This is probably a macro doc from Rust 1.54, e.g. #[doc = include_str!(...)]
+                    // Reset the string buffer, write that part, and then push this macro part too.
+                    parts.push(current_part.to_token_stream());
+                    current_part.clear();
+                    parts.push(nv.value.to_token_stream());
+                }
+            }
+        }
+    }
+
+    if !parts.is_empty() {
+        // Doc contained macro pieces - return as `concat!` expression
+        if !current_part.is_empty() {
+            parts.push(current_part.to_token_stream());
+        }
+
+        let mut tokens = TokenStream::new();
+
+        syn::Ident::new("concat", Span::call_site()).to_tokens(&mut tokens);
+        syn::token::Not(Span::call_site()).to_tokens(&mut tokens);
+        syn::token::Bracket(Span::call_site()).surround(&mut tokens, |tokens| {
+            parts.to_tokens(tokens);
+            syn::token::Comma(Span::call_site()).to_tokens(tokens);
+        });
+
+        PythonDoc(PythonDocKind::Tokens(
+            quote!(#pyo3_path::ffi::c_str!(#tokens)),
+        ))
+    } else {
+        // Just a string doc - return directly with nul terminator
+        let docs = CString::new(current_part).unwrap();
+        PythonDoc(PythonDocKind::LitCStr(LitCStr::new(
+            docs,
+            Span::call_site(),
+            ctx,
+        )))
+    }
+}
+
+impl quote::ToTokens for PythonDoc {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        match &self.0 {
+            PythonDocKind::LitCStr(lit) => lit.to_tokens(tokens),
+            PythonDocKind::Tokens(toks) => toks.to_tokens(tokens),
+        }
+    }
+}
+
+pub fn unwrap_ty_group(mut ty: &syn::Type) -> &syn::Type {
+    while let syn::Type::Group(g) = ty {
+        ty = &*g.elem;
+    }
+    ty
+}
+
+pub struct Ctx {
+    /// Where we can find the pyo3 crate
+    pub pyo3_path: PyO3CratePath,
+
+    /// If we are in a pymethod or pyfunction,
+    /// this will be the span of the return type
+    pub output_span: Span,
+}
+
+impl Ctx {
+    pub(crate) fn new(attr: &Option<CrateAttribute>, signature: Option<&syn::Signature>) -> Self {
+        let pyo3_path = match attr {
+            Some(attr) => PyO3CratePath::Given(attr.value.0.clone()),
+            None => PyO3CratePath::Default,
+        };
+
+        let output_span = if let Some(syn::Signature {
+            output: syn::ReturnType::Type(_, output_type),
+            ..
+        }) = &signature
+        {
+            output_type.span()
+        } else {
+            Span::call_site()
+        };
+
+        Self {
+            pyo3_path,
+            output_span,
+        }
+    }
+}
+
+#[derive(Clone)]
+pub enum PyO3CratePath {
+    Given(syn::Path),
+    Default,
+}
+
+impl PyO3CratePath {
+    pub fn to_tokens_spanned(&self, span: Span) -> TokenStream {
+        match self {
+            Self::Given(path) => quote::quote_spanned! { span => #path },
+            Self::Default => quote::quote_spanned! {  span => ::pyo3 },
+        }
+    }
+}
+
+impl quote::ToTokens for PyO3CratePath {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        match self {
+            Self::Given(path) => path.to_tokens(tokens),
+            Self::Default => quote::quote! { ::pyo3 }.to_tokens(tokens),
+        }
+    }
+}
+
+pub fn apply_renaming_rule(rule: RenamingRule, name: &str) -> String {
+    use heck::*;
+
+    match rule {
+        RenamingRule::CamelCase => name.to_lower_camel_case(),
+        RenamingRule::KebabCase => name.to_kebab_case(),
+        RenamingRule::Lowercase => name.to_lowercase(),
+        RenamingRule::PascalCase => name.to_upper_camel_case(),
+        RenamingRule::ScreamingKebabCase => name.to_shouty_kebab_case(),
+        RenamingRule::ScreamingSnakeCase => name.to_shouty_snake_case(),
+        RenamingRule::SnakeCase => name.to_snake_case(),
+        RenamingRule::Uppercase => name.to_uppercase(),
+    }
+}
+
+pub(crate) fn is_abi3() -> bool {
+    pyo3_build_config::get().abi3
+}
diff -pruN 43.0.0-1/rust-vendor/quote/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/quote/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/quote/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"Cargo.toml":"0a98ab1241e7b64caa29c6ff868e2e96e0f74c1ef8b265727f1863a960fa322c","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"626e7079eab0baacf0fcaf3e244f407b2014ebaeca45905d72e8fb8bed18aaea","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/ext.rs":"9881576cac3e476a4bf04f9b601cf9a53b79399fb0ca9634e8b861ac91709843","src/format.rs":"c595015418f35e6992e710441b9999f09b2afe4678b138039d670d100c0bdd86","src/ident_fragment.rs":"0b3e6c2129e55910fd2d240e1e7efba6f1796801d24352d1c0bfbceb0e8b678f","src/lib.rs":"abbc178821e46d0bcd224904a7542ac4582d189f57cd4daf02a54fd772e52a55","src/runtime.rs":"7f37326edaeac2c42ed806b447eeba12e36dd4b1bc25fbf52f8eb23140f3be7a","src/spanned.rs":"3ccf5120593f35787442c0a37d243e802c5262e7f8b35aed503873008ec035c5","src/to_tokens.rs":"1c76311fcc82098e630056d71fd6f3929194ee31b0840e2aa643ed7e78026e3e","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/test.rs":"3be80741f84a707376c230d9cf70ce9537caa359691d8d4c34968e28175e4ad7","tests/ui/does-not-have-iter-interpolated-dup.rs":"ad13eea21d4cdd2ab6c082f633392e1ff20fb0d1af5f2177041e0bf7f30da695","tests/ui/does-not-have-iter-interpolated-dup.stderr":"90a4bdb9267535f5d2785940148338d6b7d905548051d2c9c5dcbd58f2c11d8e","tests/ui/does-not-have-iter-interpolated.rs":"83a5b3f240651adcbe4b6e51076d76d653ad439b37442cf4054f1fd3c073f3b7","tests/ui/does-not-have-iter-interpolated.stderr":"ae7c2739554c862b331705e82781aa4687a4375210cef6ae899a4be4a4ec2d97","tests/ui/does-not-have-iter-separated.rs":"fe413c48331d5e3a7ae5fef6a5892a90c72f610d54595879eb49d0a94154ba3f","tests/ui/does-not-have-iter-separated.stderr":"03fd560979ebcd5aa6f83858bc2c3c01ba6546c16335101275505304895c1ae9","tests/ui/does-not-have-iter.rs":"09dc9499d861b63cebb0848b855b78e2dc9497bfde37ba6339f3625ae009a62f","tests/ui/does-not-have-iter.stderr":"d6da483c29e232ced72059bbdf05d31afb1df9e02954edaa9cfaea1ec6df72dc","tests/ui/not-quotable.rs":"5759d0884943417609f28faadc70254a3e2fd3d9bd6ff7297a3fb70a77fafd8a","tests/ui/not-quotable.stderr":"1b5ad13712a35f2f25a159c003956762941b111d540b20ad6a258cdb079a9c95","tests/ui/not-repeatable.rs":"a4b115c04e4e41049a05f5b69450503fbffeba031218b4189cb931839f7f9a9c","tests/ui/not-repeatable.stderr":"bbfb702638374001061251f81d63476851ac28ed743f13db9d65e30dd9bdcf52","tests/ui/wrong-type-span.rs":"6195e35ea844c0c52ba1cff5d790c3a371af6915d137d377834ad984229ef9ea","tests/ui/wrong-type-span.stderr":"cad072e40e0ecc04f375122ae41aede2f0da2a9244492b3fcf70249e59d1b128"},"package":"0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/quote/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/quote/Cargo.toml
--- 43.0.0-1/rust-vendor/quote/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,50 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2018"
+rust-version = "1.56"
+name = "quote"
+version = "1.0.36"
+authors = ["David Tolnay <dtolnay@gmail.com>"]
+autobenches = false
+description = "Quasi-quoting macro quote!(...)"
+documentation = "https://docs.rs/quote/"
+readme = "README.md"
+keywords = [
+    "macros",
+    "syn",
+]
+categories = ["development-tools::procedural-macro-helpers"]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/dtolnay/quote"
+
+[package.metadata.docs.rs]
+rustdoc-args = ["--generate-link-to-definition"]
+targets = ["x86_64-unknown-linux-gnu"]
+
+[lib]
+doc-scrape-examples = false
+
+[dependencies.proc-macro2]
+version = "1.0.74"
+default-features = false
+
+[dev-dependencies.rustversion]
+version = "1.0"
+
+[dev-dependencies.trybuild]
+version = "1.0.66"
+features = ["diff"]
+
+[features]
+default = ["proc-macro"]
+proc-macro = ["proc-macro2/proc-macro"]
diff -pruN 43.0.0-1/rust-vendor/quote/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/quote/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/quote/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,176 @@
+                              Apache License
+                        Version 2.0, January 2004
+                     http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+   "License" shall mean the terms and conditions for use, reproduction,
+   and distribution as defined by Sections 1 through 9 of this document.
+
+   "Licensor" shall mean the copyright owner or entity authorized by
+   the copyright owner that is granting the License.
+
+   "Legal Entity" shall mean the union of the acting entity and all
+   other entities that control, are controlled by, or are under common
+   control with that entity. For the purposes of this definition,
+   "control" means (i) the power, direct or indirect, to cause the
+   direction or management of such entity, whether by contract or
+   otherwise, or (ii) ownership of fifty percent (50%) or more of the
+   outstanding shares, or (iii) beneficial ownership of such entity.
+
+   "You" (or "Your") shall mean an individual or Legal Entity
+   exercising permissions granted by this License.
+
+   "Source" form shall mean the preferred form for making modifications,
+   including but not limited to software source code, documentation
+   source, and configuration files.
+
+   "Object" form shall mean any form resulting from mechanical
+   transformation or translation of a Source form, including but
+   not limited to compiled object code, generated documentation,
+   and conversions to other media types.
+
+   "Work" shall mean the work of authorship, whether in Source or
+   Object form, made available under the License, as indicated by a
+   copyright notice that is included in or attached to the work
+   (an example is provided in the Appendix below).
+
+   "Derivative Works" shall mean any work, whether in Source or Object
+   form, that is based on (or derived from) the Work and for which the
+   editorial revisions, annotations, elaborations, or other modifications
+   represent, as a whole, an original work of authorship. For the purposes
+   of this License, Derivative Works shall not include works that remain
+   separable from, or merely link (or bind by name) to the interfaces of,
+   the Work and Derivative Works thereof.
+
+   "Contribution" shall mean any work of authorship, including
+   the original version of the Work and any modifications or additions
+   to that Work or Derivative Works thereof, that is intentionally
+   submitted to Licensor for inclusion in the Work by the copyright owner
+   or by an individual or Legal Entity authorized to submit on behalf of
+   the copyright owner. For the purposes of this definition, "submitted"
+   means any form of electronic, verbal, or written communication sent
+   to the Licensor or its representatives, including but not limited to
+   communication on electronic mailing lists, source code control systems,
+   and issue tracking systems that are managed by, or on behalf of, the
+   Licensor for the purpose of discussing and improving the Work, but
+   excluding communication that is conspicuously marked or otherwise
+   designated in writing by the copyright owner as "Not a Contribution."
+
+   "Contributor" shall mean Licensor and any individual or Legal Entity
+   on behalf of whom a Contribution has been received by Licensor and
+   subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   copyright license to reproduce, prepare Derivative Works of,
+   publicly display, publicly perform, sublicense, and distribute the
+   Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   (except as stated in this section) patent license to make, have made,
+   use, offer to sell, sell, import, and otherwise transfer the Work,
+   where such license applies only to those patent claims licensable
+   by such Contributor that are necessarily infringed by their
+   Contribution(s) alone or by combination of their Contribution(s)
+   with the Work to which such Contribution(s) was submitted. If You
+   institute patent litigation against any entity (including a
+   cross-claim or counterclaim in a lawsuit) alleging that the Work
+   or a Contribution incorporated within the Work constitutes direct
+   or contributory patent infringement, then any patent licenses
+   granted to You under this License for that Work shall terminate
+   as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+   Work or Derivative Works thereof in any medium, with or without
+   modifications, and in Source or Object form, provided that You
+   meet the following conditions:
+
+   (a) You must give any other recipients of the Work or
+       Derivative Works a copy of this License; and
+
+   (b) You must cause any modified files to carry prominent notices
+       stating that You changed the files; and
+
+   (c) You must retain, in the Source form of any Derivative Works
+       that You distribute, all copyright, patent, trademark, and
+       attribution notices from the Source form of the Work,
+       excluding those notices that do not pertain to any part of
+       the Derivative Works; and
+
+   (d) If the Work includes a "NOTICE" text file as part of its
+       distribution, then any Derivative Works that You distribute must
+       include a readable copy of the attribution notices contained
+       within such NOTICE file, excluding those notices that do not
+       pertain to any part of the Derivative Works, in at least one
+       of the following places: within a NOTICE text file distributed
+       as part of the Derivative Works; within the Source form or
+       documentation, if provided along with the Derivative Works; or,
+       within a display generated by the Derivative Works, if and
+       wherever such third-party notices normally appear. The contents
+       of the NOTICE file are for informational purposes only and
+       do not modify the License. You may add Your own attribution
+       notices within Derivative Works that You distribute, alongside
+       or as an addendum to the NOTICE text from the Work, provided
+       that such additional attribution notices cannot be construed
+       as modifying the License.
+
+   You may add Your own copyright statement to Your modifications and
+   may provide additional or different license terms and conditions
+   for use, reproduction, or distribution of Your modifications, or
+   for any such Derivative Works as a whole, provided Your use,
+   reproduction, and distribution of the Work otherwise complies with
+   the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+   any Contribution intentionally submitted for inclusion in the Work
+   by You to the Licensor shall be under the terms and conditions of
+   this License, without any additional terms or conditions.
+   Notwithstanding the above, nothing herein shall supersede or modify
+   the terms of any separate license agreement you may have executed
+   with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+   names, trademarks, service marks, or product names of the Licensor,
+   except as required for reasonable and customary use in describing the
+   origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+   agreed to in writing, Licensor provides the Work (and each
+   Contributor provides its Contributions) on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+   implied, including, without limitation, any warranties or conditions
+   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+   PARTICULAR PURPOSE. You are solely responsible for determining the
+   appropriateness of using or redistributing the Work and assume any
+   risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+   whether in tort (including negligence), contract, or otherwise,
+   unless required by applicable law (such as deliberate and grossly
+   negligent acts) or agreed to in writing, shall any Contributor be
+   liable to You for damages, including any direct, indirect, special,
+   incidental, or consequential damages of any character arising as a
+   result of this License or out of the use or inability to use the
+   Work (including but not limited to damages for loss of goodwill,
+   work stoppage, computer failure or malfunction, or any and all
+   other commercial damages or losses), even if such Contributor
+   has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+   the Work or Derivative Works thereof, You may choose to offer,
+   and charge a fee for, acceptance of support, warranty, indemnity,
+   or other liability obligations and/or rights consistent with this
+   License. However, in accepting such obligations, You may act only
+   on Your own behalf and on Your sole responsibility, not on behalf
+   of any other Contributor, and only if You agree to indemnify,
+   defend, and hold each Contributor harmless for any liability
+   incurred by, or claims asserted against, such Contributor by reason
+   of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
diff -pruN 43.0.0-1/rust-vendor/quote/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/quote/LICENSE-MIT
--- 43.0.0-1/rust-vendor/quote/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,23 @@
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/quote/README.md 43.0.0-1ubuntu1/rust-vendor/quote/README.md
--- 43.0.0-1/rust-vendor/quote/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,272 @@
+Rust Quasi-Quoting
+==================
+
+[<img alt="github" src="https://img.shields.io/badge/github-dtolnay/quote-8da0cb?style=for-the-badge&labelColor=555555&logo=github" height="20">](https://github.com/dtolnay/quote)
+[<img alt="crates.io" src="https://img.shields.io/crates/v/quote.svg?style=for-the-badge&color=fc8d62&logo=rust" height="20">](https://crates.io/crates/quote)
+[<img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-quote-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs" height="20">](https://docs.rs/quote)
+[<img alt="build status" src="https://img.shields.io/github/actions/workflow/status/dtolnay/quote/ci.yml?branch=master&style=for-the-badge" height="20">](https://github.com/dtolnay/quote/actions?query=branch%3Amaster)
+
+This crate provides the [`quote!`] macro for turning Rust syntax tree data
+structures into tokens of source code.
+
+[`quote!`]: https://docs.rs/quote/1.0/quote/macro.quote.html
+
+Procedural macros in Rust receive a stream of tokens as input, execute arbitrary
+Rust code to determine how to manipulate those tokens, and produce a stream of
+tokens to hand back to the compiler to compile into the caller's crate.
+Quasi-quoting is a solution to one piece of that &mdash; producing tokens to
+return to the compiler.
+
+The idea of quasi-quoting is that we write *code* that we treat as *data*.
+Within the `quote!` macro, we can write what looks like code to our text editor
+or IDE. We get all the benefits of the editor's brace matching, syntax
+highlighting, indentation, and maybe autocompletion. But rather than compiling
+that as code into the current crate, we can treat it as data, pass it around,
+mutate it, and eventually hand it back to the compiler as tokens to compile into
+the macro caller's crate.
+
+This crate is motivated by the procedural macro use case, but is a
+general-purpose Rust quasi-quoting library and is not specific to procedural
+macros.
+
+```toml
+[dependencies]
+quote = "1.0"
+```
+
+*Version requirement: Quote supports rustc 1.56 and up.*<br>
+[*Release notes*](https://github.com/dtolnay/quote/releases)
+
+<br>
+
+## Syntax
+
+The quote crate provides a [`quote!`] macro within which you can write Rust code
+that gets packaged into a [`TokenStream`] and can be treated as data. You should
+think of `TokenStream` as representing a fragment of Rust source code.
+
+[`TokenStream`]: https://docs.rs/proc-macro2/1.0/proc_macro2/struct.TokenStream.html
+
+Within the `quote!` macro, interpolation is done with `#var`. Any type
+implementing the [`quote::ToTokens`] trait can be interpolated. This includes
+most Rust primitive types as well as most of the syntax tree types from [`syn`].
+
+[`quote::ToTokens`]: https://docs.rs/quote/1.0/quote/trait.ToTokens.html
+[`syn`]: https://github.com/dtolnay/syn
+
+```rust
+let tokens = quote! {
+    struct SerializeWith #generics #where_clause {
+        value: &'a #field_ty,
+        phantom: core::marker::PhantomData<#item_ty>,
+    }
+
+    impl #generics serde::Serialize for SerializeWith #generics #where_clause {
+        fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+        where
+            S: serde::Serializer,
+        {
+            #path(self.value, serializer)
+        }
+    }
+
+    SerializeWith {
+        value: #value,
+        phantom: core::marker::PhantomData::<#item_ty>,
+    }
+};
+```
+
+<br>
+
+## Repetition
+
+Repetition is done using `#(...)*` or `#(...),*` similar to `macro_rules!`. This
+iterates through the elements of any variable interpolated within the repetition
+and inserts a copy of the repetition body for each one. The variables in an
+interpolation may be anything that implements `IntoIterator`, including `Vec` or
+a pre-existing iterator.
+
+- `#(#var)*` — no separators
+- `#(#var),*` — the character before the asterisk is used as a separator
+- `#( struct #var; )*` — the repetition can contain other things
+- `#( #k => println!("{}", #v), )*` — even multiple interpolations
+
+Note that there is a difference between `#(#var ,)*` and `#(#var),*`—the latter
+does not produce a trailing comma. This matches the behavior of delimiters in
+`macro_rules!`.
+
+<br>
+
+## Returning tokens to the compiler
+
+The `quote!` macro evaluates to an expression of type
+`proc_macro2::TokenStream`. Meanwhile Rust procedural macros are expected to
+return the type `proc_macro::TokenStream`.
+
+The difference between the two types is that `proc_macro` types are entirely
+specific to procedural macros and cannot ever exist in code outside of a
+procedural macro, while `proc_macro2` types may exist anywhere including tests
+and non-macro code like main.rs and build.rs. This is why even the procedural
+macro ecosystem is largely built around `proc_macro2`, because that ensures the
+libraries are unit testable and accessible in non-macro contexts.
+
+There is a [`From`]-conversion in both directions so returning the output of
+`quote!` from a procedural macro usually looks like `tokens.into()` or
+`proc_macro::TokenStream::from(tokens)`.
+
+[`From`]: https://doc.rust-lang.org/std/convert/trait.From.html
+
+<br>
+
+## Examples
+
+### Combining quoted fragments
+
+Usually you don't end up constructing an entire final `TokenStream` in one
+piece. Different parts may come from different helper functions. The tokens
+produced by `quote!` themselves implement `ToTokens` and so can be interpolated
+into later `quote!` invocations to build up a final result.
+
+```rust
+let type_definition = quote! {...};
+let methods = quote! {...};
+
+let tokens = quote! {
+    #type_definition
+    #methods
+};
+```
+
+### Constructing identifiers
+
+Suppose we have an identifier `ident` which came from somewhere in a macro
+input and we need to modify it in some way for the macro output. Let's consider
+prepending the identifier with an underscore.
+
+Simply interpolating the identifier next to an underscore will not have the
+behavior of concatenating them. The underscore and the identifier will continue
+to be two separate tokens as if you had written `_ x`.
+
+```rust
+// incorrect
+quote! {
+    let mut _#ident = 0;
+}
+```
+
+The solution is to build a new identifier token with the correct value. As this
+is such a common case, the `format_ident!` macro provides a convenient utility
+for doing so correctly.
+
+```rust
+let varname = format_ident!("_{}", ident);
+quote! {
+    let mut #varname = 0;
+}
+```
+
+Alternatively, the APIs provided by Syn and proc-macro2 can be used to directly
+build the identifier. This is roughly equivalent to the above, but will not
+handle `ident` being a raw identifier.
+
+```rust
+let concatenated = format!("_{}", ident);
+let varname = syn::Ident::new(&concatenated, ident.span());
+quote! {
+    let mut #varname = 0;
+}
+```
+
+### Making method calls
+
+Let's say our macro requires some type specified in the macro input to have a
+constructor called `new`. We have the type in a variable called `field_type` of
+type `syn::Type` and want to invoke the constructor.
+
+```rust
+// incorrect
+quote! {
+    let value = #field_type::new();
+}
+```
+
+This works only sometimes. If `field_type` is `String`, the expanded code
+contains `String::new()` which is fine. But if `field_type` is something like
+`Vec<i32>` then the expanded code is `Vec<i32>::new()` which is invalid syntax.
+Ordinarily in handwritten Rust we would write `Vec::<i32>::new()` but for macros
+often the following is more convenient.
+
+```rust
+quote! {
+    let value = <#field_type>::new();
+}
+```
+
+This expands to `<Vec<i32>>::new()` which behaves correctly.
+
+A similar pattern is appropriate for trait methods.
+
+```rust
+quote! {
+    let value = <#field_type as core::default::Default>::default();
+}
+```
+
+<br>
+
+## Hygiene
+
+Any interpolated tokens preserve the `Span` information provided by their
+`ToTokens` implementation. Tokens that originate within a `quote!` invocation
+are spanned with [`Span::call_site()`].
+
+[`Span::call_site()`]: https://docs.rs/proc-macro2/1.0/proc_macro2/struct.Span.html#method.call_site
+
+A different span can be provided explicitly through the [`quote_spanned!`]
+macro.
+
+[`quote_spanned!`]: https://docs.rs/quote/1.0/quote/macro.quote_spanned.html
+
+<br>
+
+## Non-macro code generators
+
+When using `quote` in a build.rs or main.rs and writing the output out to a
+file, consider having the code generator pass the tokens through [prettyplease]
+before writing. This way if an error occurs in the generated code it is
+convenient for a human to read and debug.
+
+Be aware that no kind of hygiene or span information is retained when tokens are
+written to a file; the conversion from tokens to source code is lossy.
+
+Example usage in build.rs:
+
+```rust
+let output = quote! { ... };
+let syntax_tree = syn::parse2(output).unwrap();
+let formatted = prettyplease::unparse(&syntax_tree);
+
+let out_dir = env::var_os("OUT_DIR").unwrap();
+let dest_path = Path::new(&out_dir).join("out.rs");
+fs::write(dest_path, formatted).unwrap();
+```
+
+[prettyplease]: https://github.com/dtolnay/prettyplease
+
+<br>
+
+#### License
+
+<sup>
+Licensed under either of <a href="LICENSE-APACHE">Apache License, Version
+2.0</a> or <a href="LICENSE-MIT">MIT license</a> at your option.
+</sup>
+
+<br>
+
+<sub>
+Unless you explicitly state otherwise, any contribution intentionally submitted
+for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
+be dual licensed as above, without any additional terms or conditions.
+</sub>
diff -pruN 43.0.0-1/rust-vendor/quote/rust-toolchain.toml 43.0.0-1ubuntu1/rust-vendor/quote/rust-toolchain.toml
--- 43.0.0-1/rust-vendor/quote/rust-toolchain.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/rust-toolchain.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,2 @@
+[toolchain]
+components = ["rust-src"]
diff -pruN 43.0.0-1/rust-vendor/quote/src/ext.rs 43.0.0-1ubuntu1/rust-vendor/quote/src/ext.rs
--- 43.0.0-1/rust-vendor/quote/src/ext.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/src/ext.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,110 @@
+use super::ToTokens;
+use core::iter;
+use proc_macro2::{TokenStream, TokenTree};
+
+/// TokenStream extension trait with methods for appending tokens.
+///
+/// This trait is sealed and cannot be implemented outside of the `quote` crate.
+pub trait TokenStreamExt: private::Sealed {
+    /// For use by `ToTokens` implementations.
+    ///
+    /// Appends the token specified to this list of tokens.
+    fn append<U>(&mut self, token: U)
+    where
+        U: Into<TokenTree>;
+
+    /// For use by `ToTokens` implementations.
+    ///
+    /// ```
+    /// # use quote::{quote, TokenStreamExt, ToTokens};
+    /// # use proc_macro2::TokenStream;
+    /// #
+    /// struct X;
+    ///
+    /// impl ToTokens for X {
+    ///     fn to_tokens(&self, tokens: &mut TokenStream) {
+    ///         tokens.append_all(&[true, false]);
+    ///     }
+    /// }
+    ///
+    /// let tokens = quote!(#X);
+    /// assert_eq!(tokens.to_string(), "true false");
+    /// ```
+    fn append_all<I>(&mut self, iter: I)
+    where
+        I: IntoIterator,
+        I::Item: ToTokens;
+
+    /// For use by `ToTokens` implementations.
+    ///
+    /// Appends all of the items in the iterator `I`, separated by the tokens
+    /// `U`.
+    fn append_separated<I, U>(&mut self, iter: I, op: U)
+    where
+        I: IntoIterator,
+        I::Item: ToTokens,
+        U: ToTokens;
+
+    /// For use by `ToTokens` implementations.
+    ///
+    /// Appends all tokens in the iterator `I`, appending `U` after each
+    /// element, including after the last element of the iterator.
+    fn append_terminated<I, U>(&mut self, iter: I, term: U)
+    where
+        I: IntoIterator,
+        I::Item: ToTokens,
+        U: ToTokens;
+}
+
+impl TokenStreamExt for TokenStream {
+    fn append<U>(&mut self, token: U)
+    where
+        U: Into<TokenTree>,
+    {
+        self.extend(iter::once(token.into()));
+    }
+
+    fn append_all<I>(&mut self, iter: I)
+    where
+        I: IntoIterator,
+        I::Item: ToTokens,
+    {
+        for token in iter {
+            token.to_tokens(self);
+        }
+    }
+
+    fn append_separated<I, U>(&mut self, iter: I, op: U)
+    where
+        I: IntoIterator,
+        I::Item: ToTokens,
+        U: ToTokens,
+    {
+        for (i, token) in iter.into_iter().enumerate() {
+            if i > 0 {
+                op.to_tokens(self);
+            }
+            token.to_tokens(self);
+        }
+    }
+
+    fn append_terminated<I, U>(&mut self, iter: I, term: U)
+    where
+        I: IntoIterator,
+        I::Item: ToTokens,
+        U: ToTokens,
+    {
+        for token in iter {
+            token.to_tokens(self);
+            term.to_tokens(self);
+        }
+    }
+}
+
+mod private {
+    use proc_macro2::TokenStream;
+
+    pub trait Sealed {}
+
+    impl Sealed for TokenStream {}
+}
diff -pruN 43.0.0-1/rust-vendor/quote/src/format.rs 43.0.0-1ubuntu1/rust-vendor/quote/src/format.rs
--- 43.0.0-1/rust-vendor/quote/src/format.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/src/format.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,168 @@
+/// Formatting macro for constructing `Ident`s.
+///
+/// <br>
+///
+/// # Syntax
+///
+/// Syntax is copied from the [`format!`] macro, supporting both positional and
+/// named arguments.
+///
+/// Only a limited set of formatting traits are supported. The current mapping
+/// of format types to traits is:
+///
+/// * `{}` ⇒ [`IdentFragment`]
+/// * `{:o}` ⇒ [`Octal`](std::fmt::Octal)
+/// * `{:x}` ⇒ [`LowerHex`](std::fmt::LowerHex)
+/// * `{:X}` ⇒ [`UpperHex`](std::fmt::UpperHex)
+/// * `{:b}` ⇒ [`Binary`](std::fmt::Binary)
+///
+/// See [`std::fmt`] for more information.
+///
+/// <br>
+///
+/// # IdentFragment
+///
+/// Unlike `format!`, this macro uses the [`IdentFragment`] formatting trait by
+/// default. This trait is like `Display`, with a few differences:
+///
+/// * `IdentFragment` is only implemented for a limited set of types, such as
+///    unsigned integers and strings.
+/// * [`Ident`] arguments will have their `r#` prefixes stripped, if present.
+///
+/// [`IdentFragment`]: crate::IdentFragment
+/// [`Ident`]: proc_macro2::Ident
+///
+/// <br>
+///
+/// # Hygiene
+///
+/// The [`Span`] of the first `Ident` argument is used as the span of the final
+/// identifier, falling back to [`Span::call_site`] when no identifiers are
+/// provided.
+///
+/// ```
+/// # use quote::format_ident;
+/// # let ident = format_ident!("Ident");
+/// // If `ident` is an Ident, the span of `my_ident` will be inherited from it.
+/// let my_ident = format_ident!("My{}{}", ident, "IsCool");
+/// assert_eq!(my_ident, "MyIdentIsCool");
+/// ```
+///
+/// Alternatively, the span can be overridden by passing the `span` named
+/// argument.
+///
+/// ```
+/// # use quote::format_ident;
+/// # const IGNORE_TOKENS: &'static str = stringify! {
+/// let my_span = /* ... */;
+/// # };
+/// # let my_span = proc_macro2::Span::call_site();
+/// format_ident!("MyIdent", span = my_span);
+/// ```
+///
+/// [`Span`]: proc_macro2::Span
+/// [`Span::call_site`]: proc_macro2::Span::call_site
+///
+/// <p><br></p>
+///
+/// # Panics
+///
+/// This method will panic if the resulting formatted string is not a valid
+/// identifier.
+///
+/// <br>
+///
+/// # Examples
+///
+/// Composing raw and non-raw identifiers:
+/// ```
+/// # use quote::format_ident;
+/// let my_ident = format_ident!("My{}", "Ident");
+/// assert_eq!(my_ident, "MyIdent");
+///
+/// let raw = format_ident!("r#Raw");
+/// assert_eq!(raw, "r#Raw");
+///
+/// let my_ident_raw = format_ident!("{}Is{}", my_ident, raw);
+/// assert_eq!(my_ident_raw, "MyIdentIsRaw");
+/// ```
+///
+/// Integer formatting options:
+/// ```
+/// # use quote::format_ident;
+/// let num: u32 = 10;
+///
+/// let decimal = format_ident!("Id_{}", num);
+/// assert_eq!(decimal, "Id_10");
+///
+/// let octal = format_ident!("Id_{:o}", num);
+/// assert_eq!(octal, "Id_12");
+///
+/// let binary = format_ident!("Id_{:b}", num);
+/// assert_eq!(binary, "Id_1010");
+///
+/// let lower_hex = format_ident!("Id_{:x}", num);
+/// assert_eq!(lower_hex, "Id_a");
+///
+/// let upper_hex = format_ident!("Id_{:X}", num);
+/// assert_eq!(upper_hex, "Id_A");
+/// ```
+#[macro_export]
+macro_rules! format_ident {
+    ($fmt:expr) => {
+        $crate::format_ident_impl!([
+            $crate::__private::Option::None,
+            $fmt
+        ])
+    };
+
+    ($fmt:expr, $($rest:tt)*) => {
+        $crate::format_ident_impl!([
+            $crate::__private::Option::None,
+            $fmt
+        ] $($rest)*)
+    };
+}
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! format_ident_impl {
+    // Final state
+    ([$span:expr, $($fmt:tt)*]) => {
+        $crate::__private::mk_ident(
+            &$crate::__private::format!($($fmt)*),
+            $span,
+        )
+    };
+
+    // Span argument
+    ([$old:expr, $($fmt:tt)*] span = $span:expr) => {
+        $crate::format_ident_impl!([$old, $($fmt)*] span = $span,)
+    };
+    ([$old:expr, $($fmt:tt)*] span = $span:expr, $($rest:tt)*) => {
+        $crate::format_ident_impl!([
+            $crate::__private::Option::Some::<$crate::__private::Span>($span),
+            $($fmt)*
+        ] $($rest)*)
+    };
+
+    // Named argument
+    ([$span:expr, $($fmt:tt)*] $name:ident = $arg:expr) => {
+        $crate::format_ident_impl!([$span, $($fmt)*] $name = $arg,)
+    };
+    ([$span:expr, $($fmt:tt)*] $name:ident = $arg:expr, $($rest:tt)*) => {
+        match $crate::__private::IdentFragmentAdapter(&$arg) {
+            arg => $crate::format_ident_impl!([$span.or(arg.span()), $($fmt)*, $name = arg] $($rest)*),
+        }
+    };
+
+    // Positional argument
+    ([$span:expr, $($fmt:tt)*] $arg:expr) => {
+        $crate::format_ident_impl!([$span, $($fmt)*] $arg,)
+    };
+    ([$span:expr, $($fmt:tt)*] $arg:expr, $($rest:tt)*) => {
+        match $crate::__private::IdentFragmentAdapter(&$arg) {
+            arg => $crate::format_ident_impl!([$span.or(arg.span()), $($fmt)*, arg] $($rest)*),
+        }
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/quote/src/ident_fragment.rs 43.0.0-1ubuntu1/rust-vendor/quote/src/ident_fragment.rs
--- 43.0.0-1/rust-vendor/quote/src/ident_fragment.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/src/ident_fragment.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,88 @@
+use alloc::borrow::Cow;
+use core::fmt;
+use proc_macro2::{Ident, Span};
+
+/// Specialized formatting trait used by `format_ident!`.
+///
+/// [`Ident`] arguments formatted using this trait will have their `r#` prefix
+/// stripped, if present.
+///
+/// See [`format_ident!`] for more information.
+///
+/// [`format_ident!`]: crate::format_ident
+pub trait IdentFragment {
+    /// Format this value as an identifier fragment.
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result;
+
+    /// Span associated with this `IdentFragment`.
+    ///
+    /// If non-`None`, may be inherited by formatted identifiers.
+    fn span(&self) -> Option<Span> {
+        None
+    }
+}
+
+impl<T: IdentFragment + ?Sized> IdentFragment for &T {
+    fn span(&self) -> Option<Span> {
+        <T as IdentFragment>::span(*self)
+    }
+
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        IdentFragment::fmt(*self, f)
+    }
+}
+
+impl<T: IdentFragment + ?Sized> IdentFragment for &mut T {
+    fn span(&self) -> Option<Span> {
+        <T as IdentFragment>::span(*self)
+    }
+
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        IdentFragment::fmt(*self, f)
+    }
+}
+
+impl IdentFragment for Ident {
+    fn span(&self) -> Option<Span> {
+        Some(self.span())
+    }
+
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let id = self.to_string();
+        if let Some(id) = id.strip_prefix("r#") {
+            fmt::Display::fmt(id, f)
+        } else {
+            fmt::Display::fmt(&id[..], f)
+        }
+    }
+}
+
+impl<T> IdentFragment for Cow<'_, T>
+where
+    T: IdentFragment + ToOwned + ?Sized,
+{
+    fn span(&self) -> Option<Span> {
+        T::span(self)
+    }
+
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        T::fmt(self, f)
+    }
+}
+
+// Limited set of types which this is implemented for, as we want to avoid types
+// which will often include non-identifier characters in their `Display` impl.
+macro_rules! ident_fragment_display {
+    ($($T:ty),*) => {
+        $(
+            impl IdentFragment for $T {
+                fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+                    fmt::Display::fmt(self, f)
+                }
+            }
+        )*
+    };
+}
+
+ident_fragment_display!(bool, str, String, char);
+ident_fragment_display!(u8, u16, u32, u64, u128, usize);
diff -pruN 43.0.0-1/rust-vendor/quote/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/quote/src/lib.rs
--- 43.0.0-1/rust-vendor/quote/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1464 @@
+//! [![github]](https://github.com/dtolnay/quote)&ensp;[![crates-io]](https://crates.io/crates/quote)&ensp;[![docs-rs]](https://docs.rs/quote)
+//!
+//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
+//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust
+//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs
+//!
+//! <br>
+//!
+//! This crate provides the [`quote!`] macro for turning Rust syntax tree data
+//! structures into tokens of source code.
+//!
+//! [`quote!`]: macro.quote.html
+//!
+//! Procedural macros in Rust receive a stream of tokens as input, execute
+//! arbitrary Rust code to determine how to manipulate those tokens, and produce
+//! a stream of tokens to hand back to the compiler to compile into the caller's
+//! crate. Quasi-quoting is a solution to one piece of that &mdash; producing
+//! tokens to return to the compiler.
+//!
+//! The idea of quasi-quoting is that we write *code* that we treat as *data*.
+//! Within the `quote!` macro, we can write what looks like code to our text
+//! editor or IDE. We get all the benefits of the editor's brace matching,
+//! syntax highlighting, indentation, and maybe autocompletion. But rather than
+//! compiling that as code into the current crate, we can treat it as data, pass
+//! it around, mutate it, and eventually hand it back to the compiler as tokens
+//! to compile into the macro caller's crate.
+//!
+//! This crate is motivated by the procedural macro use case, but is a
+//! general-purpose Rust quasi-quoting library and is not specific to procedural
+//! macros.
+//!
+//! ```toml
+//! [dependencies]
+//! quote = "1.0"
+//! ```
+//!
+//! <br>
+//!
+//! # Example
+//!
+//! The following quasi-quoted block of code is something you might find in [a]
+//! procedural macro having to do with data structure serialization. The `#var`
+//! syntax performs interpolation of runtime variables into the quoted tokens.
+//! Check out the documentation of the [`quote!`] macro for more detail about
+//! the syntax. See also the [`quote_spanned!`] macro which is important for
+//! implementing hygienic procedural macros.
+//!
+//! [a]: https://serde.rs/
+//! [`quote_spanned!`]: macro.quote_spanned.html
+//!
+//! ```
+//! # use quote::quote;
+//! #
+//! # let generics = "";
+//! # let where_clause = "";
+//! # let field_ty = "";
+//! # let item_ty = "";
+//! # let path = "";
+//! # let value = "";
+//! #
+//! let tokens = quote! {
+//!     struct SerializeWith #generics #where_clause {
+//!         value: &'a #field_ty,
+//!         phantom: core::marker::PhantomData<#item_ty>,
+//!     }
+//!
+//!     impl #generics serde::Serialize for SerializeWith #generics #where_clause {
+//!         fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+//!         where
+//!             S: serde::Serializer,
+//!         {
+//!             #path(self.value, serializer)
+//!         }
+//!     }
+//!
+//!     SerializeWith {
+//!         value: #value,
+//!         phantom: core::marker::PhantomData::<#item_ty>,
+//!     }
+//! };
+//! ```
+//!
+//! <br>
+//!
+//! # Non-macro code generators
+//!
+//! When using `quote` in a build.rs or main.rs and writing the output out to a
+//! file, consider having the code generator pass the tokens through
+//! [prettyplease] before writing. This way if an error occurs in the generated
+//! code it is convenient for a human to read and debug.
+//!
+//! [prettyplease]: https://github.com/dtolnay/prettyplease
+
+// Quote types in rustdoc of other crates get linked to here.
+#![doc(html_root_url = "https://docs.rs/quote/1.0.36")]
+#![allow(
+    clippy::doc_markdown,
+    clippy::missing_errors_doc,
+    clippy::missing_panics_doc,
+    clippy::module_name_repetitions,
+    // false positive https://github.com/rust-lang/rust-clippy/issues/6983
+    clippy::wrong_self_convention,
+)]
+
+extern crate alloc;
+
+#[cfg(feature = "proc-macro")]
+extern crate proc_macro;
+
+mod ext;
+mod format;
+mod ident_fragment;
+mod to_tokens;
+
+// Not public API.
+#[doc(hidden)]
+#[path = "runtime.rs"]
+pub mod __private;
+
+pub use crate::ext::TokenStreamExt;
+pub use crate::ident_fragment::IdentFragment;
+pub use crate::to_tokens::ToTokens;
+
+// Not public API.
+#[doc(hidden)]
+pub mod spanned;
+
+macro_rules! __quote {
+    ($quote:item) => {
+        /// The whole point.
+        ///
+        /// Performs variable interpolation against the input and produces it as
+        /// [`proc_macro2::TokenStream`].
+        ///
+        /// Note: for returning tokens to the compiler in a procedural macro, use
+        /// `.into()` on the result to convert to [`proc_macro::TokenStream`].
+        ///
+        /// [`TokenStream`]: https://docs.rs/proc-macro2/1.0/proc_macro2/struct.TokenStream.html
+        ///
+        /// <br>
+        ///
+        /// # Interpolation
+        ///
+        /// Variable interpolation is done with `#var` (similar to `$var` in
+        /// `macro_rules!` macros). This grabs the `var` variable that is currently in
+        /// scope and inserts it in that location in the output tokens. Any type
+        /// implementing the [`ToTokens`] trait can be interpolated. This includes most
+        /// Rust primitive types as well as most of the syntax tree types from the [Syn]
+        /// crate.
+        ///
+        /// [`ToTokens`]: trait.ToTokens.html
+        /// [Syn]: https://github.com/dtolnay/syn
+        ///
+        /// Repetition is done using `#(...)*` or `#(...),*` again similar to
+        /// `macro_rules!`. This iterates through the elements of any variable
+        /// interpolated within the repetition and inserts a copy of the repetition body
+        /// for each one. The variables in an interpolation may be a `Vec`, slice,
+        /// `BTreeSet`, or any `Iterator`.
+        ///
+        /// - `#(#var)*` — no separators
+        /// - `#(#var),*` — the character before the asterisk is used as a separator
+        /// - `#( struct #var; )*` — the repetition can contain other tokens
+        /// - `#( #k => println!("{}", #v), )*` — even multiple interpolations
+        ///
+        /// <br>
+        ///
+        /// # Hygiene
+        ///
+        /// Any interpolated tokens preserve the `Span` information provided by their
+        /// `ToTokens` implementation. Tokens that originate within the `quote!`
+        /// invocation are spanned with [`Span::call_site()`].
+        ///
+        /// [`Span::call_site()`]: https://docs.rs/proc-macro2/1.0/proc_macro2/struct.Span.html#method.call_site
+        ///
+        /// A different span can be provided through the [`quote_spanned!`] macro.
+        ///
+        /// [`quote_spanned!`]: macro.quote_spanned.html
+        ///
+        /// <br>
+        ///
+        /// # Return type
+        ///
+        /// The macro evaluates to an expression of type `proc_macro2::TokenStream`.
+        /// Meanwhile Rust procedural macros are expected to return the type
+        /// `proc_macro::TokenStream`.
+        ///
+        /// The difference between the two types is that `proc_macro` types are entirely
+        /// specific to procedural macros and cannot ever exist in code outside of a
+        /// procedural macro, while `proc_macro2` types may exist anywhere including
+        /// tests and non-macro code like main.rs and build.rs. This is why even the
+        /// procedural macro ecosystem is largely built around `proc_macro2`, because
+        /// that ensures the libraries are unit testable and accessible in non-macro
+        /// contexts.
+        ///
+        /// There is a [`From`]-conversion in both directions so returning the output of
+        /// `quote!` from a procedural macro usually looks like `tokens.into()` or
+        /// `proc_macro::TokenStream::from(tokens)`.
+        ///
+        /// [`From`]: https://doc.rust-lang.org/std/convert/trait.From.html
+        ///
+        /// <br>
+        ///
+        /// # Examples
+        ///
+        /// ### Procedural macro
+        ///
+        /// The structure of a basic procedural macro is as follows. Refer to the [Syn]
+        /// crate for further useful guidance on using `quote!` as part of a procedural
+        /// macro.
+        ///
+        /// [Syn]: https://github.com/dtolnay/syn
+        ///
+        /// ```
+        /// # #[cfg(any())]
+        /// extern crate proc_macro;
+        /// # extern crate proc_macro2;
+        ///
+        /// # #[cfg(any())]
+        /// use proc_macro::TokenStream;
+        /// # use proc_macro2::TokenStream;
+        /// use quote::quote;
+        ///
+        /// # const IGNORE_TOKENS: &'static str = stringify! {
+        /// #[proc_macro_derive(HeapSize)]
+        /// # };
+        /// pub fn derive_heap_size(input: TokenStream) -> TokenStream {
+        ///     // Parse the input and figure out what implementation to generate...
+        ///     # const IGNORE_TOKENS: &'static str = stringify! {
+        ///     let name = /* ... */;
+        ///     let expr = /* ... */;
+        ///     # };
+        ///     #
+        ///     # let name = 0;
+        ///     # let expr = 0;
+        ///
+        ///     let expanded = quote! {
+        ///         // The generated impl.
+        ///         impl heapsize::HeapSize for #name {
+        ///             fn heap_size_of_children(&self) -> usize {
+        ///                 #expr
+        ///             }
+        ///         }
+        ///     };
+        ///
+        ///     // Hand the output tokens back to the compiler.
+        ///     TokenStream::from(expanded)
+        /// }
+        /// ```
+        ///
+        /// <p><br></p>
+        ///
+        /// ### Combining quoted fragments
+        ///
+        /// Usually you don't end up constructing an entire final `TokenStream` in one
+        /// piece. Different parts may come from different helper functions. The tokens
+        /// produced by `quote!` themselves implement `ToTokens` and so can be
+        /// interpolated into later `quote!` invocations to build up a final result.
+        ///
+        /// ```
+        /// # use quote::quote;
+        /// #
+        /// let type_definition = quote! {...};
+        /// let methods = quote! {...};
+        ///
+        /// let tokens = quote! {
+        ///     #type_definition
+        ///     #methods
+        /// };
+        /// ```
+        ///
+        /// <p><br></p>
+        ///
+        /// ### Constructing identifiers
+        ///
+        /// Suppose we have an identifier `ident` which came from somewhere in a macro
+        /// input and we need to modify it in some way for the macro output. Let's
+        /// consider prepending the identifier with an underscore.
+        ///
+        /// Simply interpolating the identifier next to an underscore will not have the
+        /// behavior of concatenating them. The underscore and the identifier will
+        /// continue to be two separate tokens as if you had written `_ x`.
+        ///
+        /// ```
+        /// # use proc_macro2::{self as syn, Span};
+        /// # use quote::quote;
+        /// #
+        /// # let ident = syn::Ident::new("i", Span::call_site());
+        /// #
+        /// // incorrect
+        /// quote! {
+        ///     let mut _#ident = 0;
+        /// }
+        /// # ;
+        /// ```
+        ///
+        /// The solution is to build a new identifier token with the correct value. As
+        /// this is such a common case, the [`format_ident!`] macro provides a
+        /// convenient utility for doing so correctly.
+        ///
+        /// ```
+        /// # use proc_macro2::{Ident, Span};
+        /// # use quote::{format_ident, quote};
+        /// #
+        /// # let ident = Ident::new("i", Span::call_site());
+        /// #
+        /// let varname = format_ident!("_{}", ident);
+        /// quote! {
+        ///     let mut #varname = 0;
+        /// }
+        /// # ;
+        /// ```
+        ///
+        /// Alternatively, the APIs provided by Syn and proc-macro2 can be used to
+        /// directly build the identifier. This is roughly equivalent to the above, but
+        /// will not handle `ident` being a raw identifier.
+        ///
+        /// ```
+        /// # use proc_macro2::{self as syn, Span};
+        /// # use quote::quote;
+        /// #
+        /// # let ident = syn::Ident::new("i", Span::call_site());
+        /// #
+        /// let concatenated = format!("_{}", ident);
+        /// let varname = syn::Ident::new(&concatenated, ident.span());
+        /// quote! {
+        ///     let mut #varname = 0;
+        /// }
+        /// # ;
+        /// ```
+        ///
+        /// <p><br></p>
+        ///
+        /// ### Making method calls
+        ///
+        /// Let's say our macro requires some type specified in the macro input to have
+        /// a constructor called `new`. We have the type in a variable called
+        /// `field_type` of type `syn::Type` and want to invoke the constructor.
+        ///
+        /// ```
+        /// # use quote::quote;
+        /// #
+        /// # let field_type = quote!(...);
+        /// #
+        /// // incorrect
+        /// quote! {
+        ///     let value = #field_type::new();
+        /// }
+        /// # ;
+        /// ```
+        ///
+        /// This works only sometimes. If `field_type` is `String`, the expanded code
+        /// contains `String::new()` which is fine. But if `field_type` is something
+        /// like `Vec<i32>` then the expanded code is `Vec<i32>::new()` which is invalid
+        /// syntax. Ordinarily in handwritten Rust we would write `Vec::<i32>::new()`
+        /// but for macros often the following is more convenient.
+        ///
+        /// ```
+        /// # use quote::quote;
+        /// #
+        /// # let field_type = quote!(...);
+        /// #
+        /// quote! {
+        ///     let value = <#field_type>::new();
+        /// }
+        /// # ;
+        /// ```
+        ///
+        /// This expands to `<Vec<i32>>::new()` which behaves correctly.
+        ///
+        /// A similar pattern is appropriate for trait methods.
+        ///
+        /// ```
+        /// # use quote::quote;
+        /// #
+        /// # let field_type = quote!(...);
+        /// #
+        /// quote! {
+        ///     let value = <#field_type as core::default::Default>::default();
+        /// }
+        /// # ;
+        /// ```
+        ///
+        /// <p><br></p>
+        ///
+        /// ### Interpolating text inside of doc comments
+        ///
+        /// Neither doc comments nor string literals get interpolation behavior in
+        /// quote:
+        ///
+        /// ```compile_fail
+        /// quote! {
+        ///     /// try to interpolate: #ident
+        ///     ///
+        ///     /// ...
+        /// }
+        /// ```
+        ///
+        /// ```compile_fail
+        /// quote! {
+        ///     #[doc = "try to interpolate: #ident"]
+        /// }
+        /// ```
+        ///
+        /// Instead the best way to build doc comments that involve variables is by
+        /// formatting the doc string literal outside of quote.
+        ///
+        /// ```rust
+        /// # use proc_macro2::{Ident, Span};
+        /// # use quote::quote;
+        /// #
+        /// # const IGNORE: &str = stringify! {
+        /// let msg = format!(...);
+        /// # };
+        /// #
+        /// # let ident = Ident::new("var", Span::call_site());
+        /// # let msg = format!("try to interpolate: {}", ident);
+        /// quote! {
+        ///     #[doc = #msg]
+        ///     ///
+        ///     /// ...
+        /// }
+        /// # ;
+        /// ```
+        ///
+        /// <p><br></p>
+        ///
+        /// ### Indexing into a tuple struct
+        ///
+        /// When interpolating indices of a tuple or tuple struct, we need them not to
+        /// appears suffixed as integer literals by interpolating them as [`syn::Index`]
+        /// instead.
+        ///
+        /// [`syn::Index`]: https://docs.rs/syn/2.0/syn/struct.Index.html
+        ///
+        /// ```compile_fail
+        /// let i = 0usize..self.fields.len();
+        ///
+        /// // expands to 0 + self.0usize.heap_size() + self.1usize.heap_size() + ...
+        /// // which is not valid syntax
+        /// quote! {
+        ///     0 #( + self.#i.heap_size() )*
+        /// }
+        /// ```
+        ///
+        /// ```
+        /// # use proc_macro2::{Ident, TokenStream};
+        /// # use quote::quote;
+        /// #
+        /// # mod syn {
+        /// #     use proc_macro2::{Literal, TokenStream};
+        /// #     use quote::{ToTokens, TokenStreamExt};
+        /// #
+        /// #     pub struct Index(usize);
+        /// #
+        /// #     impl From<usize> for Index {
+        /// #         fn from(i: usize) -> Self {
+        /// #             Index(i)
+        /// #         }
+        /// #     }
+        /// #
+        /// #     impl ToTokens for Index {
+        /// #         fn to_tokens(&self, tokens: &mut TokenStream) {
+        /// #             tokens.append(Literal::usize_unsuffixed(self.0));
+        /// #         }
+        /// #     }
+        /// # }
+        /// #
+        /// # struct Struct {
+        /// #     fields: Vec<Ident>,
+        /// # }
+        /// #
+        /// # impl Struct {
+        /// #     fn example(&self) -> TokenStream {
+        /// let i = (0..self.fields.len()).map(syn::Index::from);
+        ///
+        /// // expands to 0 + self.0.heap_size() + self.1.heap_size() + ...
+        /// quote! {
+        ///     0 #( + self.#i.heap_size() )*
+        /// }
+        /// #     }
+        /// # }
+        /// ```
+        $quote
+    };
+}
+
+#[cfg(doc)]
+__quote![
+    #[macro_export]
+    macro_rules! quote {
+        ($($tt:tt)*) => {
+            ...
+        };
+    }
+];
+
+#[cfg(not(doc))]
+__quote![
+    #[macro_export]
+    macro_rules! quote {
+        () => {
+            $crate::__private::TokenStream::new()
+        };
+
+        // Special case rule for a single tt, for performance.
+        ($tt:tt) => {{
+            let mut _s = $crate::__private::TokenStream::new();
+            $crate::quote_token!{$tt _s}
+            _s
+        }};
+
+        // Special case rules for two tts, for performance.
+        (# $var:ident) => {{
+            let mut _s = $crate::__private::TokenStream::new();
+            $crate::ToTokens::to_tokens(&$var, &mut _s);
+            _s
+        }};
+        ($tt1:tt $tt2:tt) => {{
+            let mut _s = $crate::__private::TokenStream::new();
+            $crate::quote_token!{$tt1 _s}
+            $crate::quote_token!{$tt2 _s}
+            _s
+        }};
+
+        // Rule for any other number of tokens.
+        ($($tt:tt)*) => {{
+            let mut _s = $crate::__private::TokenStream::new();
+            $crate::quote_each_token!{_s $($tt)*}
+            _s
+        }};
+    }
+];
+
+macro_rules! __quote_spanned {
+    ($quote_spanned:item) => {
+        /// Same as `quote!`, but applies a given span to all tokens originating within
+        /// the macro invocation.
+        ///
+        /// <br>
+        ///
+        /// # Syntax
+        ///
+        /// A span expression of type [`Span`], followed by `=>`, followed by the tokens
+        /// to quote. The span expression should be brief &mdash; use a variable for
+        /// anything more than a few characters. There should be no space before the
+        /// `=>` token.
+        ///
+        /// [`Span`]: https://docs.rs/proc-macro2/1.0/proc_macro2/struct.Span.html
+        ///
+        /// ```
+        /// # use proc_macro2::Span;
+        /// # use quote::quote_spanned;
+        /// #
+        /// # const IGNORE_TOKENS: &'static str = stringify! {
+        /// let span = /* ... */;
+        /// # };
+        /// # let span = Span::call_site();
+        /// # let init = 0;
+        ///
+        /// // On one line, use parentheses.
+        /// let tokens = quote_spanned!(span=> Box::into_raw(Box::new(#init)));
+        ///
+        /// // On multiple lines, place the span at the top and use braces.
+        /// let tokens = quote_spanned! {span=>
+        ///     Box::into_raw(Box::new(#init))
+        /// };
+        /// ```
+        ///
+        /// The lack of space before the `=>` should look jarring to Rust programmers
+        /// and this is intentional. The formatting is designed to be visibly
+        /// off-balance and draw the eye a particular way, due to the span expression
+        /// being evaluated in the context of the procedural macro and the remaining
+        /// tokens being evaluated in the generated code.
+        ///
+        /// <br>
+        ///
+        /// # Hygiene
+        ///
+        /// Any interpolated tokens preserve the `Span` information provided by their
+        /// `ToTokens` implementation. Tokens that originate within the `quote_spanned!`
+        /// invocation are spanned with the given span argument.
+        ///
+        /// <br>
+        ///
+        /// # Example
+        ///
+        /// The following procedural macro code uses `quote_spanned!` to assert that a
+        /// particular Rust type implements the [`Sync`] trait so that references can be
+        /// safely shared between threads.
+        ///
+        /// [`Sync`]: https://doc.rust-lang.org/std/marker/trait.Sync.html
+        ///
+        /// ```
+        /// # use quote::{quote_spanned, TokenStreamExt, ToTokens};
+        /// # use proc_macro2::{Span, TokenStream};
+        /// #
+        /// # struct Type;
+        /// #
+        /// # impl Type {
+        /// #     fn span(&self) -> Span {
+        /// #         Span::call_site()
+        /// #     }
+        /// # }
+        /// #
+        /// # impl ToTokens for Type {
+        /// #     fn to_tokens(&self, _tokens: &mut TokenStream) {}
+        /// # }
+        /// #
+        /// # let ty = Type;
+        /// # let call_site = Span::call_site();
+        /// #
+        /// let ty_span = ty.span();
+        /// let assert_sync = quote_spanned! {ty_span=>
+        ///     struct _AssertSync where #ty: Sync;
+        /// };
+        /// ```
+        ///
+        /// If the assertion fails, the user will see an error like the following. The
+        /// input span of their type is highlighted in the error.
+        ///
+        /// ```text
+        /// error[E0277]: the trait bound `*const (): std::marker::Sync` is not satisfied
+        ///   --> src/main.rs:10:21
+        ///    |
+        /// 10 |     static ref PTR: *const () = &();
+        ///    |                     ^^^^^^^^^ `*const ()` cannot be shared between threads safely
+        /// ```
+        ///
+        /// In this example it is important for the where-clause to be spanned with the
+        /// line/column information of the user's input type so that error messages are
+        /// placed appropriately by the compiler.
+        $quote_spanned
+    };
+}
+
+#[cfg(doc)]
+__quote_spanned![
+    #[macro_export]
+    macro_rules! quote_spanned {
+        ($span:expr=> $($tt:tt)*) => {
+            ...
+        };
+    }
+];
+
+#[cfg(not(doc))]
+__quote_spanned![
+    #[macro_export]
+    macro_rules! quote_spanned {
+        ($span:expr=>) => {{
+            let _: $crate::__private::Span = $crate::__private::get_span($span).__into_span();
+            $crate::__private::TokenStream::new()
+        }};
+
+        // Special case rule for a single tt, for performance.
+        ($span:expr=> $tt:tt) => {{
+            let mut _s = $crate::__private::TokenStream::new();
+            let _span: $crate::__private::Span = $crate::__private::get_span($span).__into_span();
+            $crate::quote_token_spanned!{$tt _s _span}
+            _s
+        }};
+
+        // Special case rules for two tts, for performance.
+        ($span:expr=> # $var:ident) => {{
+            let mut _s = $crate::__private::TokenStream::new();
+            let _: $crate::__private::Span = $crate::__private::get_span($span).__into_span();
+            $crate::ToTokens::to_tokens(&$var, &mut _s);
+            _s
+        }};
+        ($span:expr=> $tt1:tt $tt2:tt) => {{
+            let mut _s = $crate::__private::TokenStream::new();
+            let _span: $crate::__private::Span = $crate::__private::get_span($span).__into_span();
+            $crate::quote_token_spanned!{$tt1 _s _span}
+            $crate::quote_token_spanned!{$tt2 _s _span}
+            _s
+        }};
+
+        // Rule for any other number of tokens.
+        ($span:expr=> $($tt:tt)*) => {{
+            let mut _s = $crate::__private::TokenStream::new();
+            let _span: $crate::__private::Span = $crate::__private::get_span($span).__into_span();
+            $crate::quote_each_token_spanned!{_s _span $($tt)*}
+            _s
+        }};
+    }
+];
+
+// Extract the names of all #metavariables and pass them to the $call macro.
+//
+// in:   pounded_var_names!(then!(...) a #b c #( #d )* #e)
+// out:  then!(... b);
+//       then!(... d);
+//       then!(... e);
+#[macro_export]
+#[doc(hidden)]
+macro_rules! pounded_var_names {
+    ($call:ident! $extra:tt $($tts:tt)*) => {
+        $crate::pounded_var_names_with_context!{$call! $extra
+            (@ $($tts)*)
+            ($($tts)* @)
+        }
+    };
+}
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! pounded_var_names_with_context {
+    ($call:ident! $extra:tt ($($b1:tt)*) ($($curr:tt)*)) => {
+        $(
+            $crate::pounded_var_with_context!{$call! $extra $b1 $curr}
+        )*
+    };
+}
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! pounded_var_with_context {
+    ($call:ident! $extra:tt $b1:tt ( $($inner:tt)* )) => {
+        $crate::pounded_var_names!{$call! $extra $($inner)*}
+    };
+
+    ($call:ident! $extra:tt $b1:tt [ $($inner:tt)* ]) => {
+        $crate::pounded_var_names!{$call! $extra $($inner)*}
+    };
+
+    ($call:ident! $extra:tt $b1:tt { $($inner:tt)* }) => {
+        $crate::pounded_var_names!{$call! $extra $($inner)*}
+    };
+
+    ($call:ident!($($extra:tt)*) # $var:ident) => {
+        $crate::$call!($($extra)* $var);
+    };
+
+    ($call:ident! $extra:tt $b1:tt $curr:tt) => {};
+}
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_bind_into_iter {
+    ($has_iter:ident $var:ident) => {
+        // `mut` may be unused if $var occurs multiple times in the list.
+        #[allow(unused_mut)]
+        let (mut $var, i) = $var.quote_into_iter();
+        let $has_iter = $has_iter | i;
+    };
+}
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_bind_next_or_break {
+    ($var:ident) => {
+        let $var = match $var.next() {
+            Some(_x) => $crate::__private::RepInterp(_x),
+            None => break,
+        };
+    };
+}
+
+// The obvious way to write this macro is as a tt muncher. This implementation
+// does something more complex for two reasons.
+//
+//   - With a tt muncher it's easy to hit Rust's built-in recursion_limit, which
+//     this implementation avoids because it isn't tail recursive.
+//
+//   - Compile times for a tt muncher are quadratic relative to the length of
+//     the input. This implementation is linear, so it will be faster
+//     (potentially much faster) for big inputs. However, the constant factors
+//     of this implementation are higher than that of a tt muncher, so it is
+//     somewhat slower than a tt muncher if there are many invocations with
+//     short inputs.
+//
+// An invocation like this:
+//
+//     quote_each_token!(_s a b c d e f g h i j);
+//
+// expands to this:
+//
+//     quote_tokens_with_context!(_s
+//         (@  @  @  @   @   @   a   b   c   d   e   f   g  h  i  j)
+//         (@  @  @  @   @   a   b   c   d   e   f   g   h  i  j  @)
+//         (@  @  @  @   a   b   c   d   e   f   g   h   i  j  @  @)
+//         (@  @  @ (a) (b) (c) (d) (e) (f) (g) (h) (i) (j) @  @  @)
+//         (@  @  a  b   c   d   e   f   g   h   i   j   @  @  @  @)
+//         (@  a  b  c   d   e   f   g   h   i   j   @   @  @  @  @)
+//         (a  b  c  d   e   f   g   h   i   j   @   @   @  @  @  @)
+//     );
+//
+// which gets transposed and expanded to this:
+//
+//     quote_token_with_context!(_s @ @ @  @  @ @ a);
+//     quote_token_with_context!(_s @ @ @  @  @ a b);
+//     quote_token_with_context!(_s @ @ @  @  a b c);
+//     quote_token_with_context!(_s @ @ @ (a) b c d);
+//     quote_token_with_context!(_s @ @ a (b) c d e);
+//     quote_token_with_context!(_s @ a b (c) d e f);
+//     quote_token_with_context!(_s a b c (d) e f g);
+//     quote_token_with_context!(_s b c d (e) f g h);
+//     quote_token_with_context!(_s c d e (f) g h i);
+//     quote_token_with_context!(_s d e f (g) h i j);
+//     quote_token_with_context!(_s e f g (h) i j @);
+//     quote_token_with_context!(_s f g h (i) j @ @);
+//     quote_token_with_context!(_s g h i (j) @ @ @);
+//     quote_token_with_context!(_s h i j  @  @ @ @);
+//     quote_token_with_context!(_s i j @  @  @ @ @);
+//     quote_token_with_context!(_s j @ @  @  @ @ @);
+//
+// Without having used muncher-style recursion, we get one invocation of
+// quote_token_with_context for each original tt, with three tts of context on
+// either side. This is enough for the longest possible interpolation form (a
+// repetition with separator, as in `# (#var) , *`) to be fully represented with
+// the first or last tt in the middle.
+//
+// The middle tt (surrounded by parentheses) is the tt being processed.
+//
+//   - When it is a `#`, quote_token_with_context can do an interpolation. The
+//     interpolation kind will depend on the three subsequent tts.
+//
+//   - When it is within a later part of an interpolation, it can be ignored
+//     because the interpolation has already been done.
+//
+//   - When it is not part of an interpolation it can be pushed as a single
+//     token into the output.
+//
+//   - When the middle token is an unparenthesized `@`, that call is one of the
+//     first 3 or last 3 calls of quote_token_with_context and does not
+//     correspond to one of the original input tokens, so turns into nothing.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_each_token {
+    ($tokens:ident $($tts:tt)*) => {
+        $crate::quote_tokens_with_context!{$tokens
+            (@ @ @ @ @ @ $($tts)*)
+            (@ @ @ @ @ $($tts)* @)
+            (@ @ @ @ $($tts)* @ @)
+            (@ @ @ $(($tts))* @ @ @)
+            (@ @ $($tts)* @ @ @ @)
+            (@ $($tts)* @ @ @ @ @)
+            ($($tts)* @ @ @ @ @ @)
+        }
+    };
+}
+
+// See the explanation on quote_each_token.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_each_token_spanned {
+    ($tokens:ident $span:ident $($tts:tt)*) => {
+        $crate::quote_tokens_with_context_spanned!{$tokens $span
+            (@ @ @ @ @ @ $($tts)*)
+            (@ @ @ @ @ $($tts)* @)
+            (@ @ @ @ $($tts)* @ @)
+            (@ @ @ $(($tts))* @ @ @)
+            (@ @ $($tts)* @ @ @ @)
+            (@ $($tts)* @ @ @ @ @)
+            ($($tts)* @ @ @ @ @ @)
+        }
+    };
+}
+
+// See the explanation on quote_each_token.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_tokens_with_context {
+    ($tokens:ident
+        ($($b3:tt)*) ($($b2:tt)*) ($($b1:tt)*)
+        ($($curr:tt)*)
+        ($($a1:tt)*) ($($a2:tt)*) ($($a3:tt)*)
+    ) => {
+        $(
+            $crate::quote_token_with_context!{$tokens $b3 $b2 $b1 $curr $a1 $a2 $a3}
+        )*
+    };
+}
+
+// See the explanation on quote_each_token.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_tokens_with_context_spanned {
+    ($tokens:ident $span:ident
+        ($($b3:tt)*) ($($b2:tt)*) ($($b1:tt)*)
+        ($($curr:tt)*)
+        ($($a1:tt)*) ($($a2:tt)*) ($($a3:tt)*)
+    ) => {
+        $(
+            $crate::quote_token_with_context_spanned!{$tokens $span $b3 $b2 $b1 $curr $a1 $a2 $a3}
+        )*
+    };
+}
+
+// See the explanation on quote_each_token.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_token_with_context {
+    // Unparenthesized `@` indicates this call does not correspond to one of the
+    // original input tokens. Ignore it.
+    ($tokens:ident $b3:tt $b2:tt $b1:tt @ $a1:tt $a2:tt $a3:tt) => {};
+
+    // A repetition with no separator.
+    ($tokens:ident $b3:tt $b2:tt $b1:tt (#) ( $($inner:tt)* ) * $a3:tt) => {{
+        use $crate::__private::ext::*;
+        let has_iter = $crate::__private::ThereIsNoIteratorInRepetition;
+        $crate::pounded_var_names!{quote_bind_into_iter!(has_iter) () $($inner)*}
+        let _: $crate::__private::HasIterator = has_iter;
+        // This is `while true` instead of `loop` because if there are no
+        // iterators used inside of this repetition then the body would not
+        // contain any `break`, so the compiler would emit unreachable code
+        // warnings on anything below the loop. We use has_iter to detect and
+        // fail to compile when there are no iterators, so here we just work
+        // around the unneeded extra warning.
+        while true {
+            $crate::pounded_var_names!{quote_bind_next_or_break!() () $($inner)*}
+            $crate::quote_each_token!{$tokens $($inner)*}
+        }
+    }};
+    // ... and one step later.
+    ($tokens:ident $b3:tt $b2:tt # (( $($inner:tt)* )) * $a2:tt $a3:tt) => {};
+    // ... and one step later.
+    ($tokens:ident $b3:tt # ( $($inner:tt)* ) (*) $a1:tt $a2:tt $a3:tt) => {};
+
+    // A repetition with separator.
+    ($tokens:ident $b3:tt $b2:tt $b1:tt (#) ( $($inner:tt)* ) $sep:tt *) => {{
+        use $crate::__private::ext::*;
+        let mut _i = 0usize;
+        let has_iter = $crate::__private::ThereIsNoIteratorInRepetition;
+        $crate::pounded_var_names!{quote_bind_into_iter!(has_iter) () $($inner)*}
+        let _: $crate::__private::HasIterator = has_iter;
+        while true {
+            $crate::pounded_var_names!{quote_bind_next_or_break!() () $($inner)*}
+            if _i > 0 {
+                $crate::quote_token!{$sep $tokens}
+            }
+            _i += 1;
+            $crate::quote_each_token!{$tokens $($inner)*}
+        }
+    }};
+    // ... and one step later.
+    ($tokens:ident $b3:tt $b2:tt # (( $($inner:tt)* )) $sep:tt * $a3:tt) => {};
+    // ... and one step later.
+    ($tokens:ident $b3:tt # ( $($inner:tt)* ) ($sep:tt) * $a2:tt $a3:tt) => {};
+    // (A special case for `#(var)**`, where the first `*` is treated as the
+    // repetition symbol and the second `*` is treated as an ordinary token.)
+    ($tokens:ident # ( $($inner:tt)* ) * (*) $a1:tt $a2:tt $a3:tt) => {
+        // https://github.com/dtolnay/quote/issues/130
+        $crate::quote_token!{* $tokens}
+    };
+    // ... and one step later.
+    ($tokens:ident # ( $($inner:tt)* ) $sep:tt (*) $a1:tt $a2:tt $a3:tt) => {};
+
+    // A non-repetition interpolation.
+    ($tokens:ident $b3:tt $b2:tt $b1:tt (#) $var:ident $a2:tt $a3:tt) => {
+        $crate::ToTokens::to_tokens(&$var, &mut $tokens);
+    };
+    // ... and one step later.
+    ($tokens:ident $b3:tt $b2:tt # ($var:ident) $a1:tt $a2:tt $a3:tt) => {};
+
+    // An ordinary token, not part of any interpolation.
+    ($tokens:ident $b3:tt $b2:tt $b1:tt ($curr:tt) $a1:tt $a2:tt $a3:tt) => {
+        $crate::quote_token!{$curr $tokens}
+    };
+}
+
+// See the explanation on quote_each_token, and on the individual rules of
+// quote_token_with_context.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_token_with_context_spanned {
+    ($tokens:ident $span:ident $b3:tt $b2:tt $b1:tt @ $a1:tt $a2:tt $a3:tt) => {};
+
+    ($tokens:ident $span:ident $b3:tt $b2:tt $b1:tt (#) ( $($inner:tt)* ) * $a3:tt) => {{
+        use $crate::__private::ext::*;
+        let has_iter = $crate::__private::ThereIsNoIteratorInRepetition;
+        $crate::pounded_var_names!{quote_bind_into_iter!(has_iter) () $($inner)*}
+        let _: $crate::__private::HasIterator = has_iter;
+        while true {
+            $crate::pounded_var_names!{quote_bind_next_or_break!() () $($inner)*}
+            $crate::quote_each_token_spanned!{$tokens $span $($inner)*}
+        }
+    }};
+    ($tokens:ident $span:ident $b3:tt $b2:tt # (( $($inner:tt)* )) * $a2:tt $a3:tt) => {};
+    ($tokens:ident $span:ident $b3:tt # ( $($inner:tt)* ) (*) $a1:tt $a2:tt $a3:tt) => {};
+
+    ($tokens:ident $span:ident $b3:tt $b2:tt $b1:tt (#) ( $($inner:tt)* ) $sep:tt *) => {{
+        use $crate::__private::ext::*;
+        let mut _i = 0usize;
+        let has_iter = $crate::__private::ThereIsNoIteratorInRepetition;
+        $crate::pounded_var_names!{quote_bind_into_iter!(has_iter) () $($inner)*}
+        let _: $crate::__private::HasIterator = has_iter;
+        while true {
+            $crate::pounded_var_names!{quote_bind_next_or_break!() () $($inner)*}
+            if _i > 0 {
+                $crate::quote_token_spanned!{$sep $tokens $span}
+            }
+            _i += 1;
+            $crate::quote_each_token_spanned!{$tokens $span $($inner)*}
+        }
+    }};
+    ($tokens:ident $span:ident $b3:tt $b2:tt # (( $($inner:tt)* )) $sep:tt * $a3:tt) => {};
+    ($tokens:ident $span:ident $b3:tt # ( $($inner:tt)* ) ($sep:tt) * $a2:tt $a3:tt) => {};
+    ($tokens:ident $span:ident # ( $($inner:tt)* ) * (*) $a1:tt $a2:tt $a3:tt) => {
+        // https://github.com/dtolnay/quote/issues/130
+        $crate::quote_token_spanned!{* $tokens $span}
+    };
+    ($tokens:ident $span:ident # ( $($inner:tt)* ) $sep:tt (*) $a1:tt $a2:tt $a3:tt) => {};
+
+    ($tokens:ident $span:ident $b3:tt $b2:tt $b1:tt (#) $var:ident $a2:tt $a3:tt) => {
+        $crate::ToTokens::to_tokens(&$var, &mut $tokens);
+    };
+    ($tokens:ident $span:ident $b3:tt $b2:tt # ($var:ident) $a1:tt $a2:tt $a3:tt) => {};
+
+    ($tokens:ident $span:ident $b3:tt $b2:tt $b1:tt ($curr:tt) $a1:tt $a2:tt $a3:tt) => {
+        $crate::quote_token_spanned!{$curr $tokens $span}
+    };
+}
+
+// These rules are ordered by approximate token frequency, at least for the
+// first 10 or so, to improve compile times. Having `ident` first is by far the
+// most important because it's typically 2-3x more common than the next most
+// common token.
+//
+// Separately, we put the token being matched in the very front so that failing
+// rules may fail to match as quickly as possible.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_token {
+    ($ident:ident $tokens:ident) => {
+        $crate::__private::push_ident(&mut $tokens, stringify!($ident));
+    };
+
+    (:: $tokens:ident) => {
+        $crate::__private::push_colon2(&mut $tokens);
+    };
+
+    (( $($inner:tt)* ) $tokens:ident) => {
+        $crate::__private::push_group(
+            &mut $tokens,
+            $crate::__private::Delimiter::Parenthesis,
+            $crate::quote!($($inner)*),
+        );
+    };
+
+    ([ $($inner:tt)* ] $tokens:ident) => {
+        $crate::__private::push_group(
+            &mut $tokens,
+            $crate::__private::Delimiter::Bracket,
+            $crate::quote!($($inner)*),
+        );
+    };
+
+    ({ $($inner:tt)* } $tokens:ident) => {
+        $crate::__private::push_group(
+            &mut $tokens,
+            $crate::__private::Delimiter::Brace,
+            $crate::quote!($($inner)*),
+        );
+    };
+
+    (# $tokens:ident) => {
+        $crate::__private::push_pound(&mut $tokens);
+    };
+
+    (, $tokens:ident) => {
+        $crate::__private::push_comma(&mut $tokens);
+    };
+
+    (. $tokens:ident) => {
+        $crate::__private::push_dot(&mut $tokens);
+    };
+
+    (; $tokens:ident) => {
+        $crate::__private::push_semi(&mut $tokens);
+    };
+
+    (: $tokens:ident) => {
+        $crate::__private::push_colon(&mut $tokens);
+    };
+
+    (+ $tokens:ident) => {
+        $crate::__private::push_add(&mut $tokens);
+    };
+
+    (+= $tokens:ident) => {
+        $crate::__private::push_add_eq(&mut $tokens);
+    };
+
+    (& $tokens:ident) => {
+        $crate::__private::push_and(&mut $tokens);
+    };
+
+    (&& $tokens:ident) => {
+        $crate::__private::push_and_and(&mut $tokens);
+    };
+
+    (&= $tokens:ident) => {
+        $crate::__private::push_and_eq(&mut $tokens);
+    };
+
+    (@ $tokens:ident) => {
+        $crate::__private::push_at(&mut $tokens);
+    };
+
+    (! $tokens:ident) => {
+        $crate::__private::push_bang(&mut $tokens);
+    };
+
+    (^ $tokens:ident) => {
+        $crate::__private::push_caret(&mut $tokens);
+    };
+
+    (^= $tokens:ident) => {
+        $crate::__private::push_caret_eq(&mut $tokens);
+    };
+
+    (/ $tokens:ident) => {
+        $crate::__private::push_div(&mut $tokens);
+    };
+
+    (/= $tokens:ident) => {
+        $crate::__private::push_div_eq(&mut $tokens);
+    };
+
+    (.. $tokens:ident) => {
+        $crate::__private::push_dot2(&mut $tokens);
+    };
+
+    (... $tokens:ident) => {
+        $crate::__private::push_dot3(&mut $tokens);
+    };
+
+    (..= $tokens:ident) => {
+        $crate::__private::push_dot_dot_eq(&mut $tokens);
+    };
+
+    (= $tokens:ident) => {
+        $crate::__private::push_eq(&mut $tokens);
+    };
+
+    (== $tokens:ident) => {
+        $crate::__private::push_eq_eq(&mut $tokens);
+    };
+
+    (>= $tokens:ident) => {
+        $crate::__private::push_ge(&mut $tokens);
+    };
+
+    (> $tokens:ident) => {
+        $crate::__private::push_gt(&mut $tokens);
+    };
+
+    (<= $tokens:ident) => {
+        $crate::__private::push_le(&mut $tokens);
+    };
+
+    (< $tokens:ident) => {
+        $crate::__private::push_lt(&mut $tokens);
+    };
+
+    (*= $tokens:ident) => {
+        $crate::__private::push_mul_eq(&mut $tokens);
+    };
+
+    (!= $tokens:ident) => {
+        $crate::__private::push_ne(&mut $tokens);
+    };
+
+    (| $tokens:ident) => {
+        $crate::__private::push_or(&mut $tokens);
+    };
+
+    (|= $tokens:ident) => {
+        $crate::__private::push_or_eq(&mut $tokens);
+    };
+
+    (|| $tokens:ident) => {
+        $crate::__private::push_or_or(&mut $tokens);
+    };
+
+    (? $tokens:ident) => {
+        $crate::__private::push_question(&mut $tokens);
+    };
+
+    (-> $tokens:ident) => {
+        $crate::__private::push_rarrow(&mut $tokens);
+    };
+
+    (<- $tokens:ident) => {
+        $crate::__private::push_larrow(&mut $tokens);
+    };
+
+    (% $tokens:ident) => {
+        $crate::__private::push_rem(&mut $tokens);
+    };
+
+    (%= $tokens:ident) => {
+        $crate::__private::push_rem_eq(&mut $tokens);
+    };
+
+    (=> $tokens:ident) => {
+        $crate::__private::push_fat_arrow(&mut $tokens);
+    };
+
+    (<< $tokens:ident) => {
+        $crate::__private::push_shl(&mut $tokens);
+    };
+
+    (<<= $tokens:ident) => {
+        $crate::__private::push_shl_eq(&mut $tokens);
+    };
+
+    (>> $tokens:ident) => {
+        $crate::__private::push_shr(&mut $tokens);
+    };
+
+    (>>= $tokens:ident) => {
+        $crate::__private::push_shr_eq(&mut $tokens);
+    };
+
+    (* $tokens:ident) => {
+        $crate::__private::push_star(&mut $tokens);
+    };
+
+    (- $tokens:ident) => {
+        $crate::__private::push_sub(&mut $tokens);
+    };
+
+    (-= $tokens:ident) => {
+        $crate::__private::push_sub_eq(&mut $tokens);
+    };
+
+    ($lifetime:lifetime $tokens:ident) => {
+        $crate::__private::push_lifetime(&mut $tokens, stringify!($lifetime));
+    };
+
+    (_ $tokens:ident) => {
+        $crate::__private::push_underscore(&mut $tokens);
+    };
+
+    ($other:tt $tokens:ident) => {
+        $crate::__private::parse(&mut $tokens, stringify!($other));
+    };
+}
+
+// See the comment above `quote_token!` about the rule ordering.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_token_spanned {
+    ($ident:ident $tokens:ident $span:ident) => {
+        $crate::__private::push_ident_spanned(&mut $tokens, $span, stringify!($ident));
+    };
+
+    (:: $tokens:ident $span:ident) => {
+        $crate::__private::push_colon2_spanned(&mut $tokens, $span);
+    };
+
+    (( $($inner:tt)* ) $tokens:ident $span:ident) => {
+        $crate::__private::push_group_spanned(
+            &mut $tokens,
+            $span,
+            $crate::__private::Delimiter::Parenthesis,
+            $crate::quote_spanned!($span=> $($inner)*),
+        );
+    };
+
+    ([ $($inner:tt)* ] $tokens:ident $span:ident) => {
+        $crate::__private::push_group_spanned(
+            &mut $tokens,
+            $span,
+            $crate::__private::Delimiter::Bracket,
+            $crate::quote_spanned!($span=> $($inner)*),
+        );
+    };
+
+    ({ $($inner:tt)* } $tokens:ident $span:ident) => {
+        $crate::__private::push_group_spanned(
+            &mut $tokens,
+            $span,
+            $crate::__private::Delimiter::Brace,
+            $crate::quote_spanned!($span=> $($inner)*),
+        );
+    };
+
+    (# $tokens:ident $span:ident) => {
+        $crate::__private::push_pound_spanned(&mut $tokens, $span);
+    };
+
+    (, $tokens:ident $span:ident) => {
+        $crate::__private::push_comma_spanned(&mut $tokens, $span);
+    };
+
+    (. $tokens:ident $span:ident) => {
+        $crate::__private::push_dot_spanned(&mut $tokens, $span);
+    };
+
+    (; $tokens:ident $span:ident) => {
+        $crate::__private::push_semi_spanned(&mut $tokens, $span);
+    };
+
+    (: $tokens:ident $span:ident) => {
+        $crate::__private::push_colon_spanned(&mut $tokens, $span);
+    };
+
+    (+ $tokens:ident $span:ident) => {
+        $crate::__private::push_add_spanned(&mut $tokens, $span);
+    };
+
+    (+= $tokens:ident $span:ident) => {
+        $crate::__private::push_add_eq_spanned(&mut $tokens, $span);
+    };
+
+    (& $tokens:ident $span:ident) => {
+        $crate::__private::push_and_spanned(&mut $tokens, $span);
+    };
+
+    (&& $tokens:ident $span:ident) => {
+        $crate::__private::push_and_and_spanned(&mut $tokens, $span);
+    };
+
+    (&= $tokens:ident $span:ident) => {
+        $crate::__private::push_and_eq_spanned(&mut $tokens, $span);
+    };
+
+    (@ $tokens:ident $span:ident) => {
+        $crate::__private::push_at_spanned(&mut $tokens, $span);
+    };
+
+    (! $tokens:ident $span:ident) => {
+        $crate::__private::push_bang_spanned(&mut $tokens, $span);
+    };
+
+    (^ $tokens:ident $span:ident) => {
+        $crate::__private::push_caret_spanned(&mut $tokens, $span);
+    };
+
+    (^= $tokens:ident $span:ident) => {
+        $crate::__private::push_caret_eq_spanned(&mut $tokens, $span);
+    };
+
+    (/ $tokens:ident $span:ident) => {
+        $crate::__private::push_div_spanned(&mut $tokens, $span);
+    };
+
+    (/= $tokens:ident $span:ident) => {
+        $crate::__private::push_div_eq_spanned(&mut $tokens, $span);
+    };
+
+    (.. $tokens:ident $span:ident) => {
+        $crate::__private::push_dot2_spanned(&mut $tokens, $span);
+    };
+
+    (... $tokens:ident $span:ident) => {
+        $crate::__private::push_dot3_spanned(&mut $tokens, $span);
+    };
+
+    (..= $tokens:ident $span:ident) => {
+        $crate::__private::push_dot_dot_eq_spanned(&mut $tokens, $span);
+    };
+
+    (= $tokens:ident $span:ident) => {
+        $crate::__private::push_eq_spanned(&mut $tokens, $span);
+    };
+
+    (== $tokens:ident $span:ident) => {
+        $crate::__private::push_eq_eq_spanned(&mut $tokens, $span);
+    };
+
+    (>= $tokens:ident $span:ident) => {
+        $crate::__private::push_ge_spanned(&mut $tokens, $span);
+    };
+
+    (> $tokens:ident $span:ident) => {
+        $crate::__private::push_gt_spanned(&mut $tokens, $span);
+    };
+
+    (<= $tokens:ident $span:ident) => {
+        $crate::__private::push_le_spanned(&mut $tokens, $span);
+    };
+
+    (< $tokens:ident $span:ident) => {
+        $crate::__private::push_lt_spanned(&mut $tokens, $span);
+    };
+
+    (*= $tokens:ident $span:ident) => {
+        $crate::__private::push_mul_eq_spanned(&mut $tokens, $span);
+    };
+
+    (!= $tokens:ident $span:ident) => {
+        $crate::__private::push_ne_spanned(&mut $tokens, $span);
+    };
+
+    (| $tokens:ident $span:ident) => {
+        $crate::__private::push_or_spanned(&mut $tokens, $span);
+    };
+
+    (|= $tokens:ident $span:ident) => {
+        $crate::__private::push_or_eq_spanned(&mut $tokens, $span);
+    };
+
+    (|| $tokens:ident $span:ident) => {
+        $crate::__private::push_or_or_spanned(&mut $tokens, $span);
+    };
+
+    (? $tokens:ident $span:ident) => {
+        $crate::__private::push_question_spanned(&mut $tokens, $span);
+    };
+
+    (-> $tokens:ident $span:ident) => {
+        $crate::__private::push_rarrow_spanned(&mut $tokens, $span);
+    };
+
+    (<- $tokens:ident $span:ident) => {
+        $crate::__private::push_larrow_spanned(&mut $tokens, $span);
+    };
+
+    (% $tokens:ident $span:ident) => {
+        $crate::__private::push_rem_spanned(&mut $tokens, $span);
+    };
+
+    (%= $tokens:ident $span:ident) => {
+        $crate::__private::push_rem_eq_spanned(&mut $tokens, $span);
+    };
+
+    (=> $tokens:ident $span:ident) => {
+        $crate::__private::push_fat_arrow_spanned(&mut $tokens, $span);
+    };
+
+    (<< $tokens:ident $span:ident) => {
+        $crate::__private::push_shl_spanned(&mut $tokens, $span);
+    };
+
+    (<<= $tokens:ident $span:ident) => {
+        $crate::__private::push_shl_eq_spanned(&mut $tokens, $span);
+    };
+
+    (>> $tokens:ident $span:ident) => {
+        $crate::__private::push_shr_spanned(&mut $tokens, $span);
+    };
+
+    (>>= $tokens:ident $span:ident) => {
+        $crate::__private::push_shr_eq_spanned(&mut $tokens, $span);
+    };
+
+    (* $tokens:ident $span:ident) => {
+        $crate::__private::push_star_spanned(&mut $tokens, $span);
+    };
+
+    (- $tokens:ident $span:ident) => {
+        $crate::__private::push_sub_spanned(&mut $tokens, $span);
+    };
+
+    (-= $tokens:ident $span:ident) => {
+        $crate::__private::push_sub_eq_spanned(&mut $tokens, $span);
+    };
+
+    ($lifetime:lifetime $tokens:ident $span:ident) => {
+        $crate::__private::push_lifetime_spanned(&mut $tokens, $span, stringify!($lifetime));
+    };
+
+    (_ $tokens:ident $span:ident) => {
+        $crate::__private::push_underscore_spanned(&mut $tokens, $span);
+    };
+
+    ($other:tt $tokens:ident $span:ident) => {
+        $crate::__private::parse_spanned(&mut $tokens, $span, stringify!($other));
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/quote/src/runtime.rs 43.0.0-1ubuntu1/rust-vendor/quote/src/runtime.rs
--- 43.0.0-1/rust-vendor/quote/src/runtime.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/src/runtime.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,530 @@
+use self::get_span::{GetSpan, GetSpanBase, GetSpanInner};
+use crate::{IdentFragment, ToTokens, TokenStreamExt};
+use core::fmt;
+use core::iter;
+use core::ops::BitOr;
+use proc_macro2::{Group, Ident, Punct, Spacing, TokenTree};
+
+#[doc(hidden)]
+pub use alloc::format;
+#[doc(hidden)]
+pub use core::option::Option;
+
+#[doc(hidden)]
+pub type Delimiter = proc_macro2::Delimiter;
+#[doc(hidden)]
+pub type Span = proc_macro2::Span;
+#[doc(hidden)]
+pub type TokenStream = proc_macro2::TokenStream;
+
+#[doc(hidden)]
+pub struct HasIterator; // True
+#[doc(hidden)]
+pub struct ThereIsNoIteratorInRepetition; // False
+
+impl BitOr<ThereIsNoIteratorInRepetition> for ThereIsNoIteratorInRepetition {
+    type Output = ThereIsNoIteratorInRepetition;
+    fn bitor(self, _rhs: ThereIsNoIteratorInRepetition) -> ThereIsNoIteratorInRepetition {
+        ThereIsNoIteratorInRepetition
+    }
+}
+
+impl BitOr<ThereIsNoIteratorInRepetition> for HasIterator {
+    type Output = HasIterator;
+    fn bitor(self, _rhs: ThereIsNoIteratorInRepetition) -> HasIterator {
+        HasIterator
+    }
+}
+
+impl BitOr<HasIterator> for ThereIsNoIteratorInRepetition {
+    type Output = HasIterator;
+    fn bitor(self, _rhs: HasIterator) -> HasIterator {
+        HasIterator
+    }
+}
+
+impl BitOr<HasIterator> for HasIterator {
+    type Output = HasIterator;
+    fn bitor(self, _rhs: HasIterator) -> HasIterator {
+        HasIterator
+    }
+}
+
+/// Extension traits used by the implementation of `quote!`. These are defined
+/// in separate traits, rather than as a single trait due to ambiguity issues.
+///
+/// These traits expose a `quote_into_iter` method which should allow calling
+/// whichever impl happens to be applicable. Calling that method repeatedly on
+/// the returned value should be idempotent.
+#[doc(hidden)]
+pub mod ext {
+    use super::RepInterp;
+    use super::{HasIterator as HasIter, ThereIsNoIteratorInRepetition as DoesNotHaveIter};
+    use crate::ToTokens;
+    use alloc::collections::btree_set::{self, BTreeSet};
+    use core::slice;
+
+    /// Extension trait providing the `quote_into_iter` method on iterators.
+    #[doc(hidden)]
+    pub trait RepIteratorExt: Iterator + Sized {
+        fn quote_into_iter(self) -> (Self, HasIter) {
+            (self, HasIter)
+        }
+    }
+
+    impl<T: Iterator> RepIteratorExt for T {}
+
+    /// Extension trait providing the `quote_into_iter` method for
+    /// non-iterable types. These types interpolate the same value in each
+    /// iteration of the repetition.
+    #[doc(hidden)]
+    pub trait RepToTokensExt {
+        /// Pretend to be an iterator for the purposes of `quote_into_iter`.
+        /// This allows repeated calls to `quote_into_iter` to continue
+        /// correctly returning DoesNotHaveIter.
+        fn next(&self) -> Option<&Self> {
+            Some(self)
+        }
+
+        fn quote_into_iter(&self) -> (&Self, DoesNotHaveIter) {
+            (self, DoesNotHaveIter)
+        }
+    }
+
+    impl<T: ToTokens + ?Sized> RepToTokensExt for T {}
+
+    /// Extension trait providing the `quote_into_iter` method for types that
+    /// can be referenced as an iterator.
+    #[doc(hidden)]
+    pub trait RepAsIteratorExt<'q> {
+        type Iter: Iterator;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter);
+    }
+
+    impl<'q, 'a, T: RepAsIteratorExt<'q> + ?Sized> RepAsIteratorExt<'q> for &'a T {
+        type Iter = T::Iter;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) {
+            <T as RepAsIteratorExt>::quote_into_iter(*self)
+        }
+    }
+
+    impl<'q, 'a, T: RepAsIteratorExt<'q> + ?Sized> RepAsIteratorExt<'q> for &'a mut T {
+        type Iter = T::Iter;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) {
+            <T as RepAsIteratorExt>::quote_into_iter(*self)
+        }
+    }
+
+    impl<'q, T: 'q> RepAsIteratorExt<'q> for [T] {
+        type Iter = slice::Iter<'q, T>;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) {
+            (self.iter(), HasIter)
+        }
+    }
+
+    impl<'q, T: 'q> RepAsIteratorExt<'q> for Vec<T> {
+        type Iter = slice::Iter<'q, T>;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) {
+            (self.iter(), HasIter)
+        }
+    }
+
+    impl<'q, T: 'q> RepAsIteratorExt<'q> for BTreeSet<T> {
+        type Iter = btree_set::Iter<'q, T>;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) {
+            (self.iter(), HasIter)
+        }
+    }
+
+    impl<'q, T: RepAsIteratorExt<'q>> RepAsIteratorExt<'q> for RepInterp<T> {
+        type Iter = T::Iter;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) {
+            self.0.quote_into_iter()
+        }
+    }
+}
+
+// Helper type used within interpolations to allow for repeated binding names.
+// Implements the relevant traits, and exports a dummy `next()` method.
+#[derive(Copy, Clone)]
+#[doc(hidden)]
+pub struct RepInterp<T>(pub T);
+
+impl<T> RepInterp<T> {
+    // This method is intended to look like `Iterator::next`, and is called when
+    // a name is bound multiple times, as the previous binding will shadow the
+    // original `Iterator` object. This allows us to avoid advancing the
+    // iterator multiple times per iteration.
+    pub fn next(self) -> Option<T> {
+        Some(self.0)
+    }
+}
+
+impl<T: Iterator> Iterator for RepInterp<T> {
+    type Item = T::Item;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.0.next()
+    }
+}
+
+impl<T: ToTokens> ToTokens for RepInterp<T> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        self.0.to_tokens(tokens);
+    }
+}
+
+#[doc(hidden)]
+#[inline]
+pub fn get_span<T>(span: T) -> GetSpan<T> {
+    GetSpan(GetSpanInner(GetSpanBase(span)))
+}
+
+mod get_span {
+    use core::ops::Deref;
+    use proc_macro2::extra::DelimSpan;
+    use proc_macro2::Span;
+
+    pub struct GetSpan<T>(pub(crate) GetSpanInner<T>);
+
+    pub struct GetSpanInner<T>(pub(crate) GetSpanBase<T>);
+
+    pub struct GetSpanBase<T>(pub(crate) T);
+
+    impl GetSpan<Span> {
+        #[inline]
+        pub fn __into_span(self) -> Span {
+            ((self.0).0).0
+        }
+    }
+
+    impl GetSpanInner<DelimSpan> {
+        #[inline]
+        pub fn __into_span(&self) -> Span {
+            (self.0).0.join()
+        }
+    }
+
+    impl<T> GetSpanBase<T> {
+        #[allow(clippy::unused_self)]
+        pub fn __into_span(&self) -> T {
+            unreachable!()
+        }
+    }
+
+    impl<T> Deref for GetSpan<T> {
+        type Target = GetSpanInner<T>;
+
+        #[inline]
+        fn deref(&self) -> &Self::Target {
+            &self.0
+        }
+    }
+
+    impl<T> Deref for GetSpanInner<T> {
+        type Target = GetSpanBase<T>;
+
+        #[inline]
+        fn deref(&self) -> &Self::Target {
+            &self.0
+        }
+    }
+}
+
+#[doc(hidden)]
+pub fn push_group(tokens: &mut TokenStream, delimiter: Delimiter, inner: TokenStream) {
+    tokens.append(Group::new(delimiter, inner));
+}
+
+#[doc(hidden)]
+pub fn push_group_spanned(
+    tokens: &mut TokenStream,
+    span: Span,
+    delimiter: Delimiter,
+    inner: TokenStream,
+) {
+    let mut g = Group::new(delimiter, inner);
+    g.set_span(span);
+    tokens.append(g);
+}
+
+#[doc(hidden)]
+pub fn parse(tokens: &mut TokenStream, s: &str) {
+    let s: TokenStream = s.parse().expect("invalid token stream");
+    tokens.extend(iter::once(s));
+}
+
+#[doc(hidden)]
+pub fn parse_spanned(tokens: &mut TokenStream, span: Span, s: &str) {
+    let s: TokenStream = s.parse().expect("invalid token stream");
+    tokens.extend(s.into_iter().map(|t| respan_token_tree(t, span)));
+}
+
+// Token tree with every span replaced by the given one.
+fn respan_token_tree(mut token: TokenTree, span: Span) -> TokenTree {
+    match &mut token {
+        TokenTree::Group(g) => {
+            let stream = g
+                .stream()
+                .into_iter()
+                .map(|token| respan_token_tree(token, span))
+                .collect();
+            *g = Group::new(g.delimiter(), stream);
+            g.set_span(span);
+        }
+        other => other.set_span(span),
+    }
+    token
+}
+
+#[doc(hidden)]
+pub fn push_ident(tokens: &mut TokenStream, s: &str) {
+    let span = Span::call_site();
+    push_ident_spanned(tokens, span, s);
+}
+
+#[doc(hidden)]
+pub fn push_ident_spanned(tokens: &mut TokenStream, span: Span, s: &str) {
+    tokens.append(ident_maybe_raw(s, span));
+}
+
+#[doc(hidden)]
+pub fn push_lifetime(tokens: &mut TokenStream, lifetime: &str) {
+    struct Lifetime<'a> {
+        name: &'a str,
+        state: u8,
+    }
+
+    impl<'a> Iterator for Lifetime<'a> {
+        type Item = TokenTree;
+
+        fn next(&mut self) -> Option<Self::Item> {
+            match self.state {
+                0 => {
+                    self.state = 1;
+                    Some(TokenTree::Punct(Punct::new('\'', Spacing::Joint)))
+                }
+                1 => {
+                    self.state = 2;
+                    Some(TokenTree::Ident(Ident::new(self.name, Span::call_site())))
+                }
+                _ => None,
+            }
+        }
+    }
+
+    tokens.extend(Lifetime {
+        name: &lifetime[1..],
+        state: 0,
+    });
+}
+
+#[doc(hidden)]
+pub fn push_lifetime_spanned(tokens: &mut TokenStream, span: Span, lifetime: &str) {
+    struct Lifetime<'a> {
+        name: &'a str,
+        span: Span,
+        state: u8,
+    }
+
+    impl<'a> Iterator for Lifetime<'a> {
+        type Item = TokenTree;
+
+        fn next(&mut self) -> Option<Self::Item> {
+            match self.state {
+                0 => {
+                    self.state = 1;
+                    let mut apostrophe = Punct::new('\'', Spacing::Joint);
+                    apostrophe.set_span(self.span);
+                    Some(TokenTree::Punct(apostrophe))
+                }
+                1 => {
+                    self.state = 2;
+                    Some(TokenTree::Ident(Ident::new(self.name, self.span)))
+                }
+                _ => None,
+            }
+        }
+    }
+
+    tokens.extend(Lifetime {
+        name: &lifetime[1..],
+        span,
+        state: 0,
+    });
+}
+
+macro_rules! push_punct {
+    ($name:ident $spanned:ident $char1:tt) => {
+        #[doc(hidden)]
+        pub fn $name(tokens: &mut TokenStream) {
+            tokens.append(Punct::new($char1, Spacing::Alone));
+        }
+        #[doc(hidden)]
+        pub fn $spanned(tokens: &mut TokenStream, span: Span) {
+            let mut punct = Punct::new($char1, Spacing::Alone);
+            punct.set_span(span);
+            tokens.append(punct);
+        }
+    };
+    ($name:ident $spanned:ident $char1:tt $char2:tt) => {
+        #[doc(hidden)]
+        pub fn $name(tokens: &mut TokenStream) {
+            tokens.append(Punct::new($char1, Spacing::Joint));
+            tokens.append(Punct::new($char2, Spacing::Alone));
+        }
+        #[doc(hidden)]
+        pub fn $spanned(tokens: &mut TokenStream, span: Span) {
+            let mut punct = Punct::new($char1, Spacing::Joint);
+            punct.set_span(span);
+            tokens.append(punct);
+            let mut punct = Punct::new($char2, Spacing::Alone);
+            punct.set_span(span);
+            tokens.append(punct);
+        }
+    };
+    ($name:ident $spanned:ident $char1:tt $char2:tt $char3:tt) => {
+        #[doc(hidden)]
+        pub fn $name(tokens: &mut TokenStream) {
+            tokens.append(Punct::new($char1, Spacing::Joint));
+            tokens.append(Punct::new($char2, Spacing::Joint));
+            tokens.append(Punct::new($char3, Spacing::Alone));
+        }
+        #[doc(hidden)]
+        pub fn $spanned(tokens: &mut TokenStream, span: Span) {
+            let mut punct = Punct::new($char1, Spacing::Joint);
+            punct.set_span(span);
+            tokens.append(punct);
+            let mut punct = Punct::new($char2, Spacing::Joint);
+            punct.set_span(span);
+            tokens.append(punct);
+            let mut punct = Punct::new($char3, Spacing::Alone);
+            punct.set_span(span);
+            tokens.append(punct);
+        }
+    };
+}
+
+push_punct!(push_add push_add_spanned '+');
+push_punct!(push_add_eq push_add_eq_spanned '+' '=');
+push_punct!(push_and push_and_spanned '&');
+push_punct!(push_and_and push_and_and_spanned '&' '&');
+push_punct!(push_and_eq push_and_eq_spanned '&' '=');
+push_punct!(push_at push_at_spanned '@');
+push_punct!(push_bang push_bang_spanned '!');
+push_punct!(push_caret push_caret_spanned '^');
+push_punct!(push_caret_eq push_caret_eq_spanned '^' '=');
+push_punct!(push_colon push_colon_spanned ':');
+push_punct!(push_colon2 push_colon2_spanned ':' ':');
+push_punct!(push_comma push_comma_spanned ',');
+push_punct!(push_div push_div_spanned '/');
+push_punct!(push_div_eq push_div_eq_spanned '/' '=');
+push_punct!(push_dot push_dot_spanned '.');
+push_punct!(push_dot2 push_dot2_spanned '.' '.');
+push_punct!(push_dot3 push_dot3_spanned '.' '.' '.');
+push_punct!(push_dot_dot_eq push_dot_dot_eq_spanned '.' '.' '=');
+push_punct!(push_eq push_eq_spanned '=');
+push_punct!(push_eq_eq push_eq_eq_spanned '=' '=');
+push_punct!(push_ge push_ge_spanned '>' '=');
+push_punct!(push_gt push_gt_spanned '>');
+push_punct!(push_le push_le_spanned '<' '=');
+push_punct!(push_lt push_lt_spanned '<');
+push_punct!(push_mul_eq push_mul_eq_spanned '*' '=');
+push_punct!(push_ne push_ne_spanned '!' '=');
+push_punct!(push_or push_or_spanned '|');
+push_punct!(push_or_eq push_or_eq_spanned '|' '=');
+push_punct!(push_or_or push_or_or_spanned '|' '|');
+push_punct!(push_pound push_pound_spanned '#');
+push_punct!(push_question push_question_spanned '?');
+push_punct!(push_rarrow push_rarrow_spanned '-' '>');
+push_punct!(push_larrow push_larrow_spanned '<' '-');
+push_punct!(push_rem push_rem_spanned '%');
+push_punct!(push_rem_eq push_rem_eq_spanned '%' '=');
+push_punct!(push_fat_arrow push_fat_arrow_spanned '=' '>');
+push_punct!(push_semi push_semi_spanned ';');
+push_punct!(push_shl push_shl_spanned '<' '<');
+push_punct!(push_shl_eq push_shl_eq_spanned '<' '<' '=');
+push_punct!(push_shr push_shr_spanned '>' '>');
+push_punct!(push_shr_eq push_shr_eq_spanned '>' '>' '=');
+push_punct!(push_star push_star_spanned '*');
+push_punct!(push_sub push_sub_spanned '-');
+push_punct!(push_sub_eq push_sub_eq_spanned '-' '=');
+
+#[doc(hidden)]
+pub fn push_underscore(tokens: &mut TokenStream) {
+    push_underscore_spanned(tokens, Span::call_site());
+}
+
+#[doc(hidden)]
+pub fn push_underscore_spanned(tokens: &mut TokenStream, span: Span) {
+    tokens.append(Ident::new("_", span));
+}
+
+// Helper method for constructing identifiers from the `format_ident!` macro,
+// handling `r#` prefixes.
+#[doc(hidden)]
+pub fn mk_ident(id: &str, span: Option<Span>) -> Ident {
+    let span = span.unwrap_or_else(Span::call_site);
+    ident_maybe_raw(id, span)
+}
+
+fn ident_maybe_raw(id: &str, span: Span) -> Ident {
+    if let Some(id) = id.strip_prefix("r#") {
+        Ident::new_raw(id, span)
+    } else {
+        Ident::new(id, span)
+    }
+}
+
+// Adapts from `IdentFragment` to `fmt::Display` for use by the `format_ident!`
+// macro, and exposes span information from these fragments.
+//
+// This struct also has forwarding implementations of the formatting traits
+// `Octal`, `LowerHex`, `UpperHex`, and `Binary` to allow for their use within
+// `format_ident!`.
+#[derive(Copy, Clone)]
+#[doc(hidden)]
+pub struct IdentFragmentAdapter<T: IdentFragment>(pub T);
+
+impl<T: IdentFragment> IdentFragmentAdapter<T> {
+    pub fn span(&self) -> Option<Span> {
+        self.0.span()
+    }
+}
+
+impl<T: IdentFragment> fmt::Display for IdentFragmentAdapter<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        IdentFragment::fmt(&self.0, f)
+    }
+}
+
+impl<T: IdentFragment + fmt::Octal> fmt::Octal for IdentFragmentAdapter<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        fmt::Octal::fmt(&self.0, f)
+    }
+}
+
+impl<T: IdentFragment + fmt::LowerHex> fmt::LowerHex for IdentFragmentAdapter<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        fmt::LowerHex::fmt(&self.0, f)
+    }
+}
+
+impl<T: IdentFragment + fmt::UpperHex> fmt::UpperHex for IdentFragmentAdapter<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        fmt::UpperHex::fmt(&self.0, f)
+    }
+}
+
+impl<T: IdentFragment + fmt::Binary> fmt::Binary for IdentFragmentAdapter<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        fmt::Binary::fmt(&self.0, f)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/quote/src/spanned.rs 43.0.0-1ubuntu1/rust-vendor/quote/src/spanned.rs
--- 43.0.0-1/rust-vendor/quote/src/spanned.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/src/spanned.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,50 @@
+use crate::ToTokens;
+use proc_macro2::extra::DelimSpan;
+use proc_macro2::{Span, TokenStream};
+
+// Not public API other than via the syn crate. Use syn::spanned::Spanned.
+pub trait Spanned: private::Sealed {
+    fn __span(&self) -> Span;
+}
+
+impl Spanned for Span {
+    fn __span(&self) -> Span {
+        *self
+    }
+}
+
+impl Spanned for DelimSpan {
+    fn __span(&self) -> Span {
+        self.join()
+    }
+}
+
+impl<T: ?Sized + ToTokens> Spanned for T {
+    fn __span(&self) -> Span {
+        join_spans(self.into_token_stream())
+    }
+}
+
+fn join_spans(tokens: TokenStream) -> Span {
+    let mut iter = tokens.into_iter().map(|tt| tt.span());
+
+    let first = match iter.next() {
+        Some(span) => span,
+        None => return Span::call_site(),
+    };
+
+    iter.fold(None, |_prev, next| Some(next))
+        .and_then(|last| first.join(last))
+        .unwrap_or(first)
+}
+
+mod private {
+    use crate::ToTokens;
+    use proc_macro2::extra::DelimSpan;
+    use proc_macro2::Span;
+
+    pub trait Sealed {}
+    impl Sealed for Span {}
+    impl Sealed for DelimSpan {}
+    impl<T: ?Sized + ToTokens> Sealed for T {}
+}
diff -pruN 43.0.0-1/rust-vendor/quote/src/to_tokens.rs 43.0.0-1ubuntu1/rust-vendor/quote/src/to_tokens.rs
--- 43.0.0-1/rust-vendor/quote/src/to_tokens.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/src/to_tokens.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,209 @@
+use super::TokenStreamExt;
+use alloc::borrow::Cow;
+use alloc::rc::Rc;
+use core::iter;
+use proc_macro2::{Group, Ident, Literal, Punct, Span, TokenStream, TokenTree};
+
+/// Types that can be interpolated inside a `quote!` invocation.
+///
+/// [`quote!`]: macro.quote.html
+pub trait ToTokens {
+    /// Write `self` to the given `TokenStream`.
+    ///
+    /// The token append methods provided by the [`TokenStreamExt`] extension
+    /// trait may be useful for implementing `ToTokens`.
+    ///
+    /// [`TokenStreamExt`]: trait.TokenStreamExt.html
+    ///
+    /// # Example
+    ///
+    /// Example implementation for a struct representing Rust paths like
+    /// `std::cmp::PartialEq`:
+    ///
+    /// ```
+    /// use proc_macro2::{TokenTree, Spacing, Span, Punct, TokenStream};
+    /// use quote::{TokenStreamExt, ToTokens};
+    ///
+    /// pub struct Path {
+    ///     pub global: bool,
+    ///     pub segments: Vec<PathSegment>,
+    /// }
+    ///
+    /// impl ToTokens for Path {
+    ///     fn to_tokens(&self, tokens: &mut TokenStream) {
+    ///         for (i, segment) in self.segments.iter().enumerate() {
+    ///             if i > 0 || self.global {
+    ///                 // Double colon `::`
+    ///                 tokens.append(Punct::new(':', Spacing::Joint));
+    ///                 tokens.append(Punct::new(':', Spacing::Alone));
+    ///             }
+    ///             segment.to_tokens(tokens);
+    ///         }
+    ///     }
+    /// }
+    /// #
+    /// # pub struct PathSegment;
+    /// #
+    /// # impl ToTokens for PathSegment {
+    /// #     fn to_tokens(&self, tokens: &mut TokenStream) {
+    /// #         unimplemented!()
+    /// #     }
+    /// # }
+    /// ```
+    fn to_tokens(&self, tokens: &mut TokenStream);
+
+    /// Convert `self` directly into a `TokenStream` object.
+    ///
+    /// This method is implicitly implemented using `to_tokens`, and acts as a
+    /// convenience method for consumers of the `ToTokens` trait.
+    fn to_token_stream(&self) -> TokenStream {
+        let mut tokens = TokenStream::new();
+        self.to_tokens(&mut tokens);
+        tokens
+    }
+
+    /// Convert `self` directly into a `TokenStream` object.
+    ///
+    /// This method is implicitly implemented using `to_tokens`, and acts as a
+    /// convenience method for consumers of the `ToTokens` trait.
+    fn into_token_stream(self) -> TokenStream
+    where
+        Self: Sized,
+    {
+        self.to_token_stream()
+    }
+}
+
+impl<'a, T: ?Sized + ToTokens> ToTokens for &'a T {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        (**self).to_tokens(tokens);
+    }
+}
+
+impl<'a, T: ?Sized + ToTokens> ToTokens for &'a mut T {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        (**self).to_tokens(tokens);
+    }
+}
+
+impl<'a, T: ?Sized + ToOwned + ToTokens> ToTokens for Cow<'a, T> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        (**self).to_tokens(tokens);
+    }
+}
+
+impl<T: ?Sized + ToTokens> ToTokens for Box<T> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        (**self).to_tokens(tokens);
+    }
+}
+
+impl<T: ?Sized + ToTokens> ToTokens for Rc<T> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        (**self).to_tokens(tokens);
+    }
+}
+
+impl<T: ToTokens> ToTokens for Option<T> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        if let Some(ref t) = *self {
+            t.to_tokens(tokens);
+        }
+    }
+}
+
+impl ToTokens for str {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(Literal::string(self));
+    }
+}
+
+impl ToTokens for String {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        self.as_str().to_tokens(tokens);
+    }
+}
+
+macro_rules! primitive {
+    ($($t:ident => $name:ident)*) => {
+        $(
+            impl ToTokens for $t {
+                fn to_tokens(&self, tokens: &mut TokenStream) {
+                    tokens.append(Literal::$name(*self));
+                }
+            }
+        )*
+    };
+}
+
+primitive! {
+    i8 => i8_suffixed
+    i16 => i16_suffixed
+    i32 => i32_suffixed
+    i64 => i64_suffixed
+    i128 => i128_suffixed
+    isize => isize_suffixed
+
+    u8 => u8_suffixed
+    u16 => u16_suffixed
+    u32 => u32_suffixed
+    u64 => u64_suffixed
+    u128 => u128_suffixed
+    usize => usize_suffixed
+
+    f32 => f32_suffixed
+    f64 => f64_suffixed
+}
+
+impl ToTokens for char {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(Literal::character(*self));
+    }
+}
+
+impl ToTokens for bool {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        let word = if *self { "true" } else { "false" };
+        tokens.append(Ident::new(word, Span::call_site()));
+    }
+}
+
+impl ToTokens for Group {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(self.clone());
+    }
+}
+
+impl ToTokens for Ident {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(self.clone());
+    }
+}
+
+impl ToTokens for Punct {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(self.clone());
+    }
+}
+
+impl ToTokens for Literal {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(self.clone());
+    }
+}
+
+impl ToTokens for TokenTree {
+    fn to_tokens(&self, dst: &mut TokenStream) {
+        dst.append(self.clone());
+    }
+}
+
+impl ToTokens for TokenStream {
+    fn to_tokens(&self, dst: &mut TokenStream) {
+        dst.extend(iter::once(self.clone()));
+    }
+
+    fn into_token_stream(self) -> TokenStream {
+        self
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/quote/tests/compiletest.rs 43.0.0-1ubuntu1/rust-vendor/quote/tests/compiletest.rs
--- 43.0.0-1/rust-vendor/quote/tests/compiletest.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/tests/compiletest.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+#[rustversion::attr(not(nightly), ignore)]
+#[cfg_attr(miri, ignore)]
+#[test]
+fn ui() {
+    let t = trybuild::TestCases::new();
+    t.compile_fail("tests/ui/*.rs");
+}
diff -pruN 43.0.0-1/rust-vendor/quote/tests/test.rs 43.0.0-1ubuntu1/rust-vendor/quote/tests/test.rs
--- 43.0.0-1/rust-vendor/quote/tests/test.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/tests/test.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,549 @@
+#![allow(
+    clippy::disallowed_names,
+    clippy::let_underscore_untyped,
+    clippy::shadow_unrelated,
+    clippy::unseparated_literal_suffix,
+    clippy::used_underscore_binding
+)]
+
+extern crate proc_macro;
+
+use std::borrow::Cow;
+use std::collections::BTreeSet;
+
+use proc_macro2::{Delimiter, Group, Ident, Span, TokenStream};
+use quote::{format_ident, quote, quote_spanned, TokenStreamExt};
+
+struct X;
+
+impl quote::ToTokens for X {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(Ident::new("X", Span::call_site()));
+    }
+}
+
+#[test]
+fn test_quote_impl() {
+    let tokens = quote! {
+        impl<'a, T: ToTokens> ToTokens for &'a T {
+            fn to_tokens(&self, tokens: &mut TokenStream) {
+                (**self).to_tokens(tokens)
+            }
+        }
+    };
+
+    let expected = concat!(
+        "impl < 'a , T : ToTokens > ToTokens for & 'a T { ",
+        "fn to_tokens (& self , tokens : & mut TokenStream) { ",
+        "(* * self) . to_tokens (tokens) ",
+        "} ",
+        "}"
+    );
+
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_quote_spanned_impl() {
+    let span = Span::call_site();
+    let tokens = quote_spanned! {span=>
+        impl<'a, T: ToTokens> ToTokens for &'a T {
+            fn to_tokens(&self, tokens: &mut TokenStream) {
+                (**self).to_tokens(tokens)
+            }
+        }
+    };
+
+    let expected = concat!(
+        "impl < 'a , T : ToTokens > ToTokens for & 'a T { ",
+        "fn to_tokens (& self , tokens : & mut TokenStream) { ",
+        "(* * self) . to_tokens (tokens) ",
+        "} ",
+        "}"
+    );
+
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_substitution() {
+    let x = X;
+    let tokens = quote!(#x <#x> (#x) [#x] {#x});
+
+    let expected = "X < X > (X) [X] { X }";
+
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_iter() {
+    let primes = &[X, X, X, X];
+
+    assert_eq!("X X X X", quote!(#(#primes)*).to_string());
+
+    assert_eq!("X , X , X , X ,", quote!(#(#primes,)*).to_string());
+
+    assert_eq!("X , X , X , X", quote!(#(#primes),*).to_string());
+}
+
+#[test]
+fn test_array() {
+    let array: [u8; 40] = [0; 40];
+    let _ = quote!(#(#array #array)*);
+
+    let ref_array: &[u8; 40] = &[0; 40];
+    let _ = quote!(#(#ref_array #ref_array)*);
+
+    let ref_slice: &[u8] = &[0; 40];
+    let _ = quote!(#(#ref_slice #ref_slice)*);
+
+    let array: [X; 2] = [X, X]; // !Copy
+    let _ = quote!(#(#array #array)*);
+
+    let ref_array: &[X; 2] = &[X, X];
+    let _ = quote!(#(#ref_array #ref_array)*);
+
+    let ref_slice: &[X] = &[X, X];
+    let _ = quote!(#(#ref_slice #ref_slice)*);
+}
+
+#[test]
+fn test_advanced() {
+    let generics = quote!( <'a, T> );
+
+    let where_clause = quote!( where T: Serialize );
+
+    let field_ty = quote!(String);
+
+    let item_ty = quote!(Cow<'a, str>);
+
+    let path = quote!(SomeTrait::serialize_with);
+
+    let value = quote!(self.x);
+
+    let tokens = quote! {
+        struct SerializeWith #generics #where_clause {
+            value: &'a #field_ty,
+            phantom: ::std::marker::PhantomData<#item_ty>,
+        }
+
+        impl #generics ::serde::Serialize for SerializeWith #generics #where_clause {
+            fn serialize<S>(&self, s: &mut S) -> Result<(), S::Error>
+                where S: ::serde::Serializer
+            {
+                #path(self.value, s)
+            }
+        }
+
+        SerializeWith {
+            value: #value,
+            phantom: ::std::marker::PhantomData::<#item_ty>,
+        }
+    };
+
+    let expected = concat!(
+        "struct SerializeWith < 'a , T > where T : Serialize { ",
+        "value : & 'a String , ",
+        "phantom : :: std :: marker :: PhantomData < Cow < 'a , str > > , ",
+        "} ",
+        "impl < 'a , T > :: serde :: Serialize for SerializeWith < 'a , T > where T : Serialize { ",
+        "fn serialize < S > (& self , s : & mut S) -> Result < () , S :: Error > ",
+        "where S : :: serde :: Serializer ",
+        "{ ",
+        "SomeTrait :: serialize_with (self . value , s) ",
+        "} ",
+        "} ",
+        "SerializeWith { ",
+        "value : self . x , ",
+        "phantom : :: std :: marker :: PhantomData :: < Cow < 'a , str > > , ",
+        "}"
+    );
+
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_integer() {
+    let ii8 = -1i8;
+    let ii16 = -1i16;
+    let ii32 = -1i32;
+    let ii64 = -1i64;
+    let ii128 = -1i128;
+    let iisize = -1isize;
+    let uu8 = 1u8;
+    let uu16 = 1u16;
+    let uu32 = 1u32;
+    let uu64 = 1u64;
+    let uu128 = 1u128;
+    let uusize = 1usize;
+
+    let tokens = quote! {
+        1 1i32 1u256
+        #ii8 #ii16 #ii32 #ii64 #ii128 #iisize
+        #uu8 #uu16 #uu32 #uu64 #uu128 #uusize
+    };
+    let expected =
+        "1 1i32 1u256 - 1i8 - 1i16 - 1i32 - 1i64 - 1i128 - 1isize 1u8 1u16 1u32 1u64 1u128 1usize";
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_floating() {
+    let e32 = 2.345f32;
+
+    let e64 = 2.345f64;
+
+    let tokens = quote! {
+        #e32
+        #e64
+    };
+    let expected = concat!("2.345f32 2.345f64");
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_char() {
+    let zero = '\u{1}';
+    let pound = '#';
+    let quote = '"';
+    let apost = '\'';
+    let newline = '\n';
+    let heart = '\u{2764}';
+
+    let tokens = quote! {
+        #zero #pound #quote #apost #newline #heart
+    };
+    let expected = "'\\u{1}' '#' '\"' '\\'' '\\n' '\u{2764}'";
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_str() {
+    let s = "\u{1} a 'b \" c";
+    let tokens = quote!(#s);
+    let expected = "\"\\u{1} a 'b \\\" c\"";
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_string() {
+    let s = "\u{1} a 'b \" c".to_string();
+    let tokens = quote!(#s);
+    let expected = "\"\\u{1} a 'b \\\" c\"";
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_interpolated_literal() {
+    macro_rules! m {
+        ($literal:literal) => {
+            quote!($literal)
+        };
+    }
+
+    let tokens = m!(1);
+    let expected = "1";
+    assert_eq!(expected, tokens.to_string());
+
+    let tokens = m!(-1);
+    let expected = "- 1";
+    assert_eq!(expected, tokens.to_string());
+
+    let tokens = m!(true);
+    let expected = "true";
+    assert_eq!(expected, tokens.to_string());
+
+    let tokens = m!(-true);
+    let expected = "- true";
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_ident() {
+    let foo = Ident::new("Foo", Span::call_site());
+    let bar = Ident::new(&format!("Bar{}", 7), Span::call_site());
+    let tokens = quote!(struct #foo; enum #bar {});
+    let expected = "struct Foo ; enum Bar7 { }";
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_underscore() {
+    let tokens = quote!(let _;);
+    let expected = "let _ ;";
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_duplicate() {
+    let ch = 'x';
+
+    let tokens = quote!(#ch #ch);
+
+    let expected = "'x' 'x'";
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_fancy_repetition() {
+    let foo = vec!["a", "b"];
+    let bar = vec![true, false];
+
+    let tokens = quote! {
+        #(#foo: #bar),*
+    };
+
+    let expected = r#""a" : true , "b" : false"#;
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_nested_fancy_repetition() {
+    let nested = vec![vec!['a', 'b', 'c'], vec!['x', 'y', 'z']];
+
+    let tokens = quote! {
+        #(
+            #(#nested)*
+        ),*
+    };
+
+    let expected = "'a' 'b' 'c' , 'x' 'y' 'z'";
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_duplicate_name_repetition() {
+    let foo = &["a", "b"];
+
+    let tokens = quote! {
+        #(#foo: #foo),*
+        #(#foo: #foo),*
+    };
+
+    let expected = r#""a" : "a" , "b" : "b" "a" : "a" , "b" : "b""#;
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_duplicate_name_repetition_no_copy() {
+    let foo = vec!["a".to_owned(), "b".to_owned()];
+
+    let tokens = quote! {
+        #(#foo: #foo),*
+    };
+
+    let expected = r#""a" : "a" , "b" : "b""#;
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_btreeset_repetition() {
+    let mut set = BTreeSet::new();
+    set.insert("a".to_owned());
+    set.insert("b".to_owned());
+
+    let tokens = quote! {
+        #(#set: #set),*
+    };
+
+    let expected = r#""a" : "a" , "b" : "b""#;
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_variable_name_conflict() {
+    // The implementation of `#(...),*` uses the variable `_i` but it should be
+    // fine, if a little confusing when debugging.
+    let _i = vec!['a', 'b'];
+    let tokens = quote! { #(#_i),* };
+    let expected = "'a' , 'b'";
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_nonrep_in_repetition() {
+    let rep = vec!["a", "b"];
+    let nonrep = "c";
+
+    let tokens = quote! {
+        #(#rep #rep : #nonrep #nonrep),*
+    };
+
+    let expected = r#""a" "a" : "c" "c" , "b" "b" : "c" "c""#;
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_empty_quote() {
+    let tokens = quote!();
+    assert_eq!("", tokens.to_string());
+}
+
+#[test]
+fn test_box_str() {
+    let b = "str".to_owned().into_boxed_str();
+    let tokens = quote! { #b };
+    assert_eq!("\"str\"", tokens.to_string());
+}
+
+#[test]
+fn test_cow() {
+    let owned: Cow<Ident> = Cow::Owned(Ident::new("owned", Span::call_site()));
+
+    let ident = Ident::new("borrowed", Span::call_site());
+    let borrowed = Cow::Borrowed(&ident);
+
+    let tokens = quote! { #owned #borrowed };
+    assert_eq!("owned borrowed", tokens.to_string());
+}
+
+#[test]
+fn test_closure() {
+    fn field_i(i: usize) -> Ident {
+        format_ident!("__field{}", i)
+    }
+
+    let fields = (0usize..3)
+        .map(field_i as fn(_) -> _)
+        .map(|var| quote! { #var });
+
+    let tokens = quote! { #(#fields)* };
+    assert_eq!("__field0 __field1 __field2", tokens.to_string());
+}
+
+#[test]
+fn test_append_tokens() {
+    let mut a = quote!(a);
+    let b = quote!(b);
+    a.append_all(b);
+    assert_eq!("a b", a.to_string());
+}
+
+#[test]
+fn test_format_ident() {
+    let id0 = format_ident!("Aa");
+    let id1 = format_ident!("Hello{x}", x = id0);
+    let id2 = format_ident!("Hello{x}", x = 5usize);
+    let id3 = format_ident!("Hello{}_{x}", id0, x = 10usize);
+    let id4 = format_ident!("Aa", span = Span::call_site());
+    let id5 = format_ident!("Hello{}", Cow::Borrowed("World"));
+
+    assert_eq!(id0, "Aa");
+    assert_eq!(id1, "HelloAa");
+    assert_eq!(id2, "Hello5");
+    assert_eq!(id3, "HelloAa_10");
+    assert_eq!(id4, "Aa");
+    assert_eq!(id5, "HelloWorld");
+}
+
+#[test]
+fn test_format_ident_strip_raw() {
+    let id = format_ident!("r#struct");
+    let my_id = format_ident!("MyId{}", id);
+    let raw_my_id = format_ident!("r#MyId{}", id);
+
+    assert_eq!(id, "r#struct");
+    assert_eq!(my_id, "MyIdstruct");
+    assert_eq!(raw_my_id, "r#MyIdstruct");
+}
+
+#[test]
+fn test_outer_line_comment() {
+    let tokens = quote! {
+        /// doc
+    };
+    let expected = "# [doc = r\" doc\"]";
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_inner_line_comment() {
+    let tokens = quote! {
+        //! doc
+    };
+    let expected = "# ! [doc = r\" doc\"]";
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_outer_block_comment() {
+    let tokens = quote! {
+        /** doc */
+    };
+    let expected = "# [doc = r\" doc \"]";
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_inner_block_comment() {
+    let tokens = quote! {
+        /*! doc */
+    };
+    let expected = "# ! [doc = r\" doc \"]";
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_outer_attr() {
+    let tokens = quote! {
+        #[inline]
+    };
+    let expected = "# [inline]";
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_inner_attr() {
+    let tokens = quote! {
+        #![no_std]
+    };
+    let expected = "# ! [no_std]";
+    assert_eq!(expected, tokens.to_string());
+}
+
+// https://github.com/dtolnay/quote/issues/130
+#[test]
+fn test_star_after_repetition() {
+    let c = vec!['0', '1'];
+    let tokens = quote! {
+        #(
+            f(#c);
+        )*
+        *out = None;
+    };
+    let expected = "f ('0') ; f ('1') ; * out = None ;";
+    assert_eq!(expected, tokens.to_string());
+}
+
+#[test]
+fn test_quote_raw_id() {
+    let id = quote!(r#raw_id);
+    assert_eq!(id.to_string(), "r#raw_id");
+}
+
+#[test]
+fn test_type_inference_for_span() {
+    trait CallSite {
+        fn get() -> Self;
+    }
+
+    impl CallSite for Span {
+        fn get() -> Self {
+            Span::call_site()
+        }
+    }
+
+    let span = Span::call_site();
+    let _ = quote_spanned!(span=> ...);
+
+    let delim_span = Group::new(Delimiter::Parenthesis, TokenStream::new()).delim_span();
+    let _ = quote_spanned!(delim_span=> ...);
+
+    let inferred = CallSite::get();
+    let _ = quote_spanned!(inferred=> ...);
+
+    if false {
+        let proc_macro_span = proc_macro::Span::call_site();
+        let _ = quote_spanned!(proc_macro_span.into()=> ...);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/quote/tests/ui/does-not-have-iter-interpolated-dup.rs 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/does-not-have-iter-interpolated-dup.rs
--- 43.0.0-1/rust-vendor/quote/tests/ui/does-not-have-iter-interpolated-dup.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/does-not-have-iter-interpolated-dup.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,9 @@
+use quote::quote;
+
+fn main() {
+    let nonrep = "";
+
+    // Without some protection against repetitions with no iterator somewhere
+    // inside, this would loop infinitely.
+    quote!(#(#nonrep #nonrep)*);
+}
diff -pruN 43.0.0-1/rust-vendor/quote/tests/ui/does-not-have-iter-interpolated-dup.stderr 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/does-not-have-iter-interpolated-dup.stderr
--- 43.0.0-1/rust-vendor/quote/tests/ui/does-not-have-iter-interpolated-dup.stderr	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/does-not-have-iter-interpolated-dup.stderr	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,11 @@
+error[E0308]: mismatched types
+ --> tests/ui/does-not-have-iter-interpolated-dup.rs:8:5
+  |
+8 |     quote!(#(#nonrep #nonrep)*);
+  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  |     |
+  |     expected `HasIterator`, found `ThereIsNoIteratorInRepetition`
+  |     expected due to this
+  |     here the type of `has_iter` is inferred to be `ThereIsNoIteratorInRepetition`
+  |
+  = note: this error originates in the macro `$crate::quote_token_with_context` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info)
diff -pruN 43.0.0-1/rust-vendor/quote/tests/ui/does-not-have-iter-interpolated.rs 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/does-not-have-iter-interpolated.rs
--- 43.0.0-1/rust-vendor/quote/tests/ui/does-not-have-iter-interpolated.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/does-not-have-iter-interpolated.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,9 @@
+use quote::quote;
+
+fn main() {
+    let nonrep = "";
+
+    // Without some protection against repetitions with no iterator somewhere
+    // inside, this would loop infinitely.
+    quote!(#(#nonrep)*);
+}
diff -pruN 43.0.0-1/rust-vendor/quote/tests/ui/does-not-have-iter-interpolated.stderr 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/does-not-have-iter-interpolated.stderr
--- 43.0.0-1/rust-vendor/quote/tests/ui/does-not-have-iter-interpolated.stderr	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/does-not-have-iter-interpolated.stderr	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,11 @@
+error[E0308]: mismatched types
+ --> tests/ui/does-not-have-iter-interpolated.rs:8:5
+  |
+8 |     quote!(#(#nonrep)*);
+  |     ^^^^^^^^^^^^^^^^^^^
+  |     |
+  |     expected `HasIterator`, found `ThereIsNoIteratorInRepetition`
+  |     expected due to this
+  |     here the type of `has_iter` is inferred to be `ThereIsNoIteratorInRepetition`
+  |
+  = note: this error originates in the macro `$crate::quote_token_with_context` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info)
diff -pruN 43.0.0-1/rust-vendor/quote/tests/ui/does-not-have-iter-separated.rs 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/does-not-have-iter-separated.rs
--- 43.0.0-1/rust-vendor/quote/tests/ui/does-not-have-iter-separated.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/does-not-have-iter-separated.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+use quote::quote;
+
+fn main() {
+    quote!(#(a b),*);
+}
diff -pruN 43.0.0-1/rust-vendor/quote/tests/ui/does-not-have-iter-separated.stderr 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/does-not-have-iter-separated.stderr
--- 43.0.0-1/rust-vendor/quote/tests/ui/does-not-have-iter-separated.stderr	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/does-not-have-iter-separated.stderr	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,10 @@
+error[E0308]: mismatched types
+ --> tests/ui/does-not-have-iter-separated.rs:4:5
+  |
+4 |     quote!(#(a b),*);
+  |     ^^^^^^^^^^^^^^^^
+  |     |
+  |     expected `HasIterator`, found `ThereIsNoIteratorInRepetition`
+  |     expected due to this
+  |
+  = note: this error originates in the macro `$crate::quote_token_with_context` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info)
diff -pruN 43.0.0-1/rust-vendor/quote/tests/ui/does-not-have-iter.rs 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/does-not-have-iter.rs
--- 43.0.0-1/rust-vendor/quote/tests/ui/does-not-have-iter.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/does-not-have-iter.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+use quote::quote;
+
+fn main() {
+    quote!(#(a b)*);
+}
diff -pruN 43.0.0-1/rust-vendor/quote/tests/ui/does-not-have-iter.stderr 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/does-not-have-iter.stderr
--- 43.0.0-1/rust-vendor/quote/tests/ui/does-not-have-iter.stderr	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/does-not-have-iter.stderr	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,10 @@
+error[E0308]: mismatched types
+ --> tests/ui/does-not-have-iter.rs:4:5
+  |
+4 |     quote!(#(a b)*);
+  |     ^^^^^^^^^^^^^^^
+  |     |
+  |     expected `HasIterator`, found `ThereIsNoIteratorInRepetition`
+  |     expected due to this
+  |
+  = note: this error originates in the macro `$crate::quote_token_with_context` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info)
diff -pruN 43.0.0-1/rust-vendor/quote/tests/ui/not-quotable.rs 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/not-quotable.rs
--- 43.0.0-1/rust-vendor/quote/tests/ui/not-quotable.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/not-quotable.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+use quote::quote;
+use std::net::Ipv4Addr;
+
+fn main() {
+    let ip = Ipv4Addr::LOCALHOST;
+    let _ = quote! { #ip };
+}
diff -pruN 43.0.0-1/rust-vendor/quote/tests/ui/not-quotable.stderr 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/not-quotable.stderr
--- 43.0.0-1/rust-vendor/quote/tests/ui/not-quotable.stderr	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/not-quotable.stderr	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,20 @@
+error[E0277]: the trait bound `Ipv4Addr: ToTokens` is not satisfied
+ --> tests/ui/not-quotable.rs:6:13
+  |
+6 |     let _ = quote! { #ip };
+  |             ^^^^^^^^^^^^^^
+  |             |
+  |             the trait `ToTokens` is not implemented for `Ipv4Addr`
+  |             required by a bound introduced by this call
+  |
+  = help: the following other types implement trait `ToTokens`:
+            &'a T
+            &'a mut T
+            Box<T>
+            Cow<'a, T>
+            Option<T>
+            Rc<T>
+            RepInterp<T>
+            String
+          and $N others
+  = note: this error originates in the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info)
diff -pruN 43.0.0-1/rust-vendor/quote/tests/ui/not-repeatable.rs 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/not-repeatable.rs
--- 43.0.0-1/rust-vendor/quote/tests/ui/not-repeatable.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/not-repeatable.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,8 @@
+use quote::quote;
+
+struct Ipv4Addr;
+
+fn main() {
+    let ip = Ipv4Addr;
+    let _ = quote! { #(#ip)* };
+}
diff -pruN 43.0.0-1/rust-vendor/quote/tests/ui/not-repeatable.stderr 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/not-repeatable.stderr
--- 43.0.0-1/rust-vendor/quote/tests/ui/not-repeatable.stderr	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/not-repeatable.stderr	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,34 @@
+error[E0599]: the method `quote_into_iter` exists for struct `Ipv4Addr`, but its trait bounds were not satisfied
+ --> tests/ui/not-repeatable.rs:7:13
+  |
+3 | struct Ipv4Addr;
+  | --------------- method `quote_into_iter` not found for this struct because it doesn't satisfy `Ipv4Addr: Iterator`, `Ipv4Addr: ToTokens`, `Ipv4Addr: ext::RepIteratorExt` or `Ipv4Addr: ext::RepToTokensExt`
+...
+7 |     let _ = quote! { #(#ip)* };
+  |             ^^^^^^^^^^^^^^^^^^ method cannot be called on `Ipv4Addr` due to unsatisfied trait bounds
+  |
+  = note: the following trait bounds were not satisfied:
+          `Ipv4Addr: Iterator`
+          which is required by `Ipv4Addr: ext::RepIteratorExt`
+          `&Ipv4Addr: Iterator`
+          which is required by `&Ipv4Addr: ext::RepIteratorExt`
+          `Ipv4Addr: ToTokens`
+          which is required by `Ipv4Addr: ext::RepToTokensExt`
+          `&mut Ipv4Addr: Iterator`
+          which is required by `&mut Ipv4Addr: ext::RepIteratorExt`
+note: the traits `Iterator` and `ToTokens` must be implemented
+ --> src/to_tokens.rs
+  |
+  | pub trait ToTokens {
+  | ^^^^^^^^^^^^^^^^^^
+  |
+ ::: $RUST/core/src/iter/traits/iterator.rs
+  |
+  | pub trait Iterator {
+  | ^^^^^^^^^^^^^^^^^^
+  = help: items from traits can only be used if the trait is implemented and in scope
+  = note: the following traits define an item `quote_into_iter`, perhaps you need to implement one of them:
+          candidate #1: `ext::RepAsIteratorExt`
+          candidate #2: `ext::RepIteratorExt`
+          candidate #3: `ext::RepToTokensExt`
+  = note: this error originates in the macro `$crate::quote_bind_into_iter` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info)
diff -pruN 43.0.0-1/rust-vendor/quote/tests/ui/wrong-type-span.rs 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/wrong-type-span.rs
--- 43.0.0-1/rust-vendor/quote/tests/ui/wrong-type-span.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/wrong-type-span.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+use quote::quote_spanned;
+
+fn main() {
+    let span = "";
+    let x = 0i32;
+    quote_spanned!(span=> #x);
+}
diff -pruN 43.0.0-1/rust-vendor/quote/tests/ui/wrong-type-span.stderr 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/wrong-type-span.stderr
--- 43.0.0-1/rust-vendor/quote/tests/ui/wrong-type-span.stderr	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/quote/tests/ui/wrong-type-span.stderr	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,10 @@
+error[E0308]: mismatched types
+ --> tests/ui/wrong-type-span.rs:6:5
+  |
+6 |     quote_spanned!(span=> #x);
+  |     ^^^^^^^^^^^^^^^^^^^^^^^^^
+  |     |
+  |     expected `Span`, found `&str`
+  |     expected due to this
+  |
+  = note: this error originates in the macro `quote_spanned` (in Nightly builds, run with -Z macro-backtrace for more info)
diff -pruN 43.0.0-1/rust-vendor/self_cell/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/self_cell/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/self_cell/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/self_cell/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"Cargo.toml":"95b8ab508b199c1bc369fdecd5b038b7920cc31758c14e4b9954e5acb4905b94","LICENSE":"c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","README.md":"e67fcfccde89e0a5af2c52faf871c8af69f68c90b9ad4c2d5acc89c26b7b7247","src/lib.rs":"b8085648ad9943d11844f2a8c7e45375a05816f55aae3219efd6097ff7acfa79","src/unsafe_self_cell.rs":"177d2c2756b2378fdb261ede6065cff16f8ab54245d4fec86943a0d6b004b492"},"package":"d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/self_cell/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/self_cell/Cargo.toml
--- 43.0.0-1/rust-vendor/self_cell/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/self_cell/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,48 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2018"
+name = "self_cell"
+version = "1.0.4"
+authors = ["Lukas Bergdoll <lukas.bergdoll@gmail.com>"]
+include = [
+    "src/*.rs",
+    "Cargo.toml",
+    "README.md",
+    "LICENSE",
+]
+description = "Safe-to-use proc-macro-free self-referential structs in stable Rust."
+documentation = "https://docs.rs/self_cell"
+readme = "README.md"
+keywords = [
+    "lifetime",
+    "borrowing",
+    "self",
+    "reference",
+    "intrusive",
+]
+categories = [
+    "rust-patterns",
+    "memory-management",
+]
+license = "Apache-2.0"
+repository = "https://github.com/Voultapher/self_cell"
+
+[dependencies.rustversion]
+version = ">=1"
+optional = true
+
+[dev-dependencies.once_cell]
+version = "=1.1.0"
+
+[features]
+old_rust = ["rustversion"]
diff -pruN 43.0.0-1/rust-vendor/self_cell/LICENSE 43.0.0-1ubuntu1/rust-vendor/self_cell/LICENSE
--- 43.0.0-1/rust-vendor/self_cell/LICENSE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/self_cell/LICENSE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff -pruN 43.0.0-1/rust-vendor/self_cell/README.md 43.0.0-1ubuntu1/rust-vendor/self_cell/README.md
--- 43.0.0-1/rust-vendor/self_cell/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/self_cell/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,187 @@
+[<img alt="github" src="https://img.shields.io/badge/github-self__cell-8da0cb?style=for-the-badge&logo=github" height="20">](https://github.com/Voultapher/self_cell)
+[<img alt="crates.io" src="https://img.shields.io/badge/dynamic/json?color=fc8d62&label=crates.io&query=%24.crate.max_version&url=https%3A%2F%2Fcrates.io%2Fapi%2Fv1%2Fcrates%2Fself_cell&style=for-the-badge&logo=rust" height="20">](https://crates.io/crates/self_cell)
+[<img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-self__cell-66c2a5?style=for-the-badge&logoColor=white&logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K" height="20">](https://docs.rs/self_cell)
+
+# `self_cell!`
+
+Use the macro-rules macro: `self_cell!` to create safe-to-use self-referential
+structs in stable Rust, without leaking the struct internal lifetime.
+
+In a nutshell, the API looks *roughly* like this:
+
+```rust
+// User code:
+
+self_cell!(
+    struct NewStructName {
+        owner: Owner,
+
+        #[covariant]
+        dependent: Dependent,
+    }
+    
+    impl {Debug}
+);
+
+// Generated by macro:
+
+struct NewStructName(...);
+
+impl NewStructName {
+    fn new(
+        owner: Owner,
+        dependent_builder: impl for<'a> FnOnce(&'a Owner) -> Dependent<'a>
+    ) -> NewStructName { ... }
+    fn borrow_owner<'a>(&'a self) -> &'a Owner { ... }
+    fn borrow_dependent<'a>(&'a self) -> &'a Dependent<'a> { ... }
+    [...]
+    // See the macro level documentation for a list of all generated functions
+    // https://docs.rs/self_cell/latest/self_cell/macro.self_cell.html#generated-api.
+}
+
+impl Debug for NewStructName { ... }
+```
+
+Self-referential structs are currently not supported with safe vanilla Rust. The
+only reasonable safe alternative is to expect the user to juggle 2 separate data
+structures which is a mess. The library solution ouroboros is really expensive
+to compile due to its use of procedural macros.
+
+This alternative is `no_std`, uses no proc-macros, some self contained unsafe
+and works on stable Rust, and is miri tested. With a total of less than 300
+lines of implementation code, which consists mostly of type and trait
+implementations, this crate aims to be a good minimal solution to the problem of
+self-referential structs.
+
+It has undergone [community code review](https://users.rust-lang.org/t/experimental-safe-to-use-proc-macro-free-self-referential-structs-in-stable-rust/52775)
+from experienced Rust users.
+
+### Fast compile times
+
+```
+$ rm -rf target && cargo +nightly build -Z timings
+
+Compiling self_cell v0.9.0
+Completed self_cell v0.9.0 in 0.2s
+```
+
+Because it does **not** use proc-macros, and has 0 dependencies compile-times
+are fast.
+
+Measurements done on a slow laptop.
+
+### A motivating use case
+
+```rust
+use self_cell::self_cell;
+
+#[derive(Debug, Eq, PartialEq)]
+struct Ast<'a>(pub Vec<&'a str>);
+
+self_cell!(
+    struct AstCell {
+        owner: String,
+
+        #[covariant]
+        dependent: Ast,
+    }
+
+    impl {Debug, Eq, PartialEq}
+);
+
+fn build_ast_cell(code: &str) -> AstCell {
+    // Create owning String on stack.
+    let pre_processed_code = code.trim().to_string();
+
+    // Move String into AstCell, then build Ast inplace.
+    AstCell::new(
+        pre_processed_code,
+        |code| Ast(code.split(' ').filter(|word| word.len() > 1).collect())
+    )
+}
+
+fn main() {
+    let ast_cell = build_ast_cell("fox = cat + dog");
+
+    println!("ast_cell -> {:?}", &ast_cell);
+    println!("ast_cell.borrow_owner() -> {:?}", ast_cell.borrow_owner());
+    println!("ast_cell.borrow_dependent().0[1] -> {:?}", ast_cell.borrow_dependent().0[1]);
+}
+```
+
+```
+$ cargo run
+
+ast_cell -> AstCell { owner: "fox = cat + dog", dependent: Ast(["fox", "cat", "dog"]) }
+ast_cell.borrow_owner() -> "fox = cat + dog"
+ast_cell.borrow_dependent().0[1] -> "cat"
+```
+
+There is no way in safe Rust to have an API like `build_ast_cell`, as soon as
+`Ast` depends on stack variables like `pre_processed_code` you can't return the
+value out of the function anymore. You could move the pre-processing into the
+caller but that gets ugly quickly because you can't encapsulate things anymore.
+Note this is a somewhat niche use case, self-referential structs should only be
+used when there is no good alternative.
+
+Under the hood, it heap allocates a struct which it initializes first by moving
+the owner value to it and then using the reference to this now Pin/Immovable
+owner to construct the dependent inplace next to it. This makes it safe to move
+the generated SelfCell but you have to pay for the heap allocation.
+
+See the documentation for a more in-depth API overview and advanced examples:
+https://docs.rs/self_cell
+
+### Installing
+
+[See cargo docs](https://doc.rust-lang.org/cargo/guide/).
+
+## Running the tests
+
+```
+cargo test
+
+cargo miri test
+```
+
+### Related projects
+
+- [ouroboros](https://github.com/joshua-maros/ouroboros)
+- [rental](https://github.com/jpernst/rental) | soundness issues (tests fail with recent miri versions) and [deprecated](https://github.com/jpernst/rental#warning-this-crate-is-no-longer-maintained-or-supported)
+- [Schroedinger](https://github.com/dureuill/sc) | [soundness issues](https://github.com/dureuill/sc/issues/1)
+- [owning_ref](https://github.com/Kimundi/owning-ref-rs) | [soundness issues](https://rustsec.org/advisories/RUSTSEC-2022-0040.html) and [seems unmaintained](https://github.com/Kimundi/owning-ref-rs/issues/81)
+- [ghost-cell](https://github.com/matthieu-m/ghost-cell)
+- [qcell](https://github.com/uazu/qcell/)
+- [selfref](https://docs.rs/selfref)
+
+## Min required rustc version
+
+By default the minimum required rustc version is 1.51.
+
+There is an optional feature you can enable called "old_rust" that enables
+support down to rustc version 1.36. However this requires polyfilling std
+library functionality for older rustc with technically UB versions. Testing does
+not show older rustc versions (ab)using this. Use at your own risk.
+
+The minimum versions are best-effort and may change with any new major release.
+
+## Contributing
+
+Please respect the [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) when contributing.
+
+## Versioning
+
+We use [SemVer](http://semver.org/) for versioning. For the versions available,
+see the [tags on this repository](https://github.com/Voultapher/self_cell/tags).
+
+## Authors
+
+* **Lukas Bergdoll** - *Initial work* - [Voultapher](https://github.com/Voultapher)
+
+See also the list of [contributors](https://github.com/Voultapher/self_cell/contributors)
+who participated in this project.
+
+## License
+
+This project is licensed under the Apache License, Version 2.0 -
+see the [LICENSE.md](LICENSE.md) file for details.
diff -pruN 43.0.0-1/rust-vendor/self_cell/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/self_cell/src/lib.rs
--- 43.0.0-1/rust-vendor/self_cell/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/self_cell/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,673 @@
+//! # Overview
+//!
+//! `self_cell` provides one macro-rules macro: [`self_cell`]. With this macro
+//! you can create self-referential structs that are safe-to-use in stable Rust,
+//! without leaking the struct internal lifetime.
+//!
+//! In a nutshell, the API looks *roughly* like this:
+//!
+//! ```ignore
+//! // User code:
+//!
+//! self_cell!(
+//!     struct NewStructName {
+//!         owner: Owner,
+//!
+//!         #[covariant]
+//!         dependent: Dependent,
+//!     }
+//!
+//!     impl {Debug}
+//! );
+//!
+//! // Generated by macro:
+//!
+//! struct NewStructName(...);
+//!
+//! impl NewStructName {
+//!     fn new(
+//!         owner: Owner,
+//!         dependent_builder: impl for<'a> ::core::ops::FnOnce(&'a Owner) -> Dependent<'a>
+//!     ) -> NewStructName { ... }
+//!     fn borrow_owner<'a>(&'a self) -> &'a Owner { ... }
+//!     fn borrow_dependent<'a>(&'a self) -> &'a Dependent<'a> { ... }
+//!     [...]
+//!     // See the macro level documentation for a list of all generated functions,
+//!     // section "Generated API".
+//! }
+//!
+//! impl Debug for NewStructName { ... }
+//! ```
+//!
+//! Self-referential structs are currently not supported with safe vanilla Rust.
+//! The only reasonable safe alternative is to have the user juggle 2 separate
+//! data structures which is a mess. The library solution ouroboros is really
+//! expensive to compile due to its use of procedural macros.
+//!
+//! This alternative is `no_std`, uses no proc-macros, some self contained
+//! unsafe and works on stable Rust, and is miri tested. With a total of less
+//! than 300 lines of implementation code, which consists mostly of type and
+//! trait implementations, this crate aims to be a good minimal solution to the
+//! problem of self-referential structs.
+//!
+//! It has undergone [community code
+//! review](https://users.rust-lang.org/t/experimental-safe-to-use-proc-macro-free-self-referential-structs-in-stable-rust/52775)
+//! from experienced Rust users.
+//!
+//! ### Fast compile times
+//!
+//! ```txt
+//! $ rm -rf target && cargo +nightly build -Z timings
+//!
+//! Compiling self_cell v0.7.0
+//! Completed self_cell v0.7.0 in 0.2s
+//! ```
+//!
+//! Because it does **not** use proc-macros, and has 0 dependencies
+//! compile-times are fast.
+//!
+//! Measurements done on a slow laptop.
+//!
+//! ### A motivating use case
+//!
+//! ```rust
+//! use self_cell::self_cell;
+//!
+//! #[derive(Debug, Eq, PartialEq)]
+//! struct Ast<'a>(pub Vec<&'a str>);
+//!
+//! self_cell!(
+//!     struct AstCell {
+//!         owner: String,
+//!
+//!         #[covariant]
+//!         dependent: Ast,
+//!     }
+//!
+//!     impl {Debug, Eq, PartialEq}
+//! );
+//!
+//! fn build_ast_cell(code: &str) -> AstCell {
+//!     // Create owning String on stack.
+//!     let pre_processed_code = code.trim().to_string();
+//!
+//!     // Move String into AstCell, then build Ast inplace.
+//!     AstCell::new(
+//!        pre_processed_code,
+//!        |code| Ast(code.split(' ').filter(|word| word.len() > 1).collect())
+//!     )
+//! }
+//!
+//! fn main() {
+//!     let ast_cell = build_ast_cell("fox = cat + dog");
+//!
+//!     println!("ast_cell -> {:?}", &ast_cell);
+//!     println!("ast_cell.borrow_owner() -> {:?}", ast_cell.borrow_owner());
+//!     println!("ast_cell.borrow_dependent().0[1] -> {:?}", ast_cell.borrow_dependent().0[1]);
+//! }
+//! ```
+//!
+//! ```txt
+//! $ cargo run
+//!
+//! ast_cell -> AstCell { owner: "fox = cat + dog", dependent: Ast(["fox", "cat", "dog"]) }
+//! ast_cell.borrow_owner() -> "fox = cat + dog"
+//! ast_cell.borrow_dependent().0[1] -> "cat"
+//! ```
+//!
+//! There is no way in safe Rust to have an API like `build_ast_cell`, as soon
+//! as `Ast` depends on stack variables like `pre_processed_code` you can't
+//! return the value out of the function anymore. You could move the
+//! pre-processing into the caller but that gets ugly quickly because you can't
+//! encapsulate things anymore. Note this is a somewhat niche use case,
+//! self-referential structs should only be used when there is no good
+//! alternative.
+//!
+//! Under the hood, it heap allocates a struct which it initializes first by
+//! moving the owner value to it and then using the reference to this now
+//! Pin/Immovable owner to construct the dependent inplace next to it. This
+//! makes it safe to move the generated SelfCell but you have to pay for the
+//! heap allocation.
+//!
+//! See the documentation for [`self_cell`] to dive further into the details.
+//!
+//! Or take a look at the advanced examples:
+//! - [Example how to handle dependent construction that can
+//!   fail](https://github.com/Voultapher/self_cell/tree/main/examples/fallible_dependent_construction)
+//!
+//! - [How to build a lazy AST with
+//!   self_cell](https://github.com/Voultapher/self_cell/tree/main/examples/lazy_ast)
+//!
+//! - [How to use an owner type with
+//!     lifetime](https://github.com/Voultapher/self_cell/tree/main/examples/owner_with_lifetime)
+//!
+//! ### Min required rustc version
+//!
+//! By default the minimum required rustc version is 1.51.
+//!
+//! There is an optional feature you can enable called "old_rust" that enables
+//! support down to rustc version 1.36. However this requires polyfilling std
+//! library functionality for older rustc with technically UB versions. Testing
+//! does not show older rustc versions (ab)using this. Use at your own risk.
+//!
+//! The minimum versions are a best effor and may change with any new major
+//! release.
+
+#![no_std]
+
+#[doc(hidden)]
+pub extern crate alloc;
+
+#[doc(hidden)]
+pub mod unsafe_self_cell;
+
+/// This macro declares a new struct of `$StructName` and implements traits
+/// based on `$AutomaticDerive`.
+///
+/// ### Example:
+///
+/// ```rust
+/// use self_cell::self_cell;
+///
+/// #[derive(Debug, Eq, PartialEq)]
+/// struct Ast<'a>(Vec<&'a str>);
+///
+/// self_cell!(
+///     #[doc(hidden)]
+///     struct PackedAstCell {
+///         owner: String,
+///
+///         #[covariant]
+///         dependent: Ast,
+///     }
+///
+///     impl {Debug, PartialEq, Eq, Hash}
+/// );
+/// ```
+///
+/// See the crate overview to get a get an overview and a motivating example.
+///
+/// ### Generated API:
+///
+/// The macro implements these constructors:
+///
+/// ```ignore
+/// fn new(
+///     owner: $Owner,
+///     dependent_builder: impl for<'a> ::core::ops::FnOnce(&'a $Owner) -> $Dependent<'a>
+/// ) -> Self
+/// ```
+///
+/// ```ignore
+/// fn try_new<Err>(
+///     owner: $Owner,
+///     dependent_builder: impl for<'a> ::core::ops::FnOnce(&'a $Owner) -> Result<$Dependent<'a>, Err>
+/// ) -> Result<Self, Err>
+/// ```
+///
+/// ```ignore
+/// fn try_new_or_recover<Err>(
+///     owner: $Owner,
+///     dependent_builder: impl for<'a> ::core::ops::FnOnce(&'a $Owner) -> Result<$Dependent<'a>, Err>
+/// ) -> Result<Self, ($Owner, Err)>
+/// ```
+///
+/// The macro implements these methods:
+///
+/// ```ignore
+/// fn borrow_owner<'a>(&'a self) -> &'a $Owner
+/// ```
+///
+/// ```ignore
+/// // Only available if dependent is covariant.
+/// fn borrow_dependent<'a>(&'a self) -> &'a $Dependent<'a>
+/// ```
+///
+/// ```ignore
+/// fn with_dependent<'outer_fn, Ret>(
+///     &'outer_fn self,
+///     func: impl for<'a> ::core::ops::FnOnce(&'a $Owner, &'outer_fn $Dependent<'a>
+/// ) -> Ret) -> Ret
+/// ```
+///
+/// ```ignore
+/// fn with_dependent_mut<'outer_fn, Ret>(
+///     &'outer_fn mut self,
+///     func: impl for<'a> ::core::ops::FnOnce(&'a $Owner, &'outer_fn mut $Dependent<'a>) -> Ret
+/// ) -> Ret
+/// ```
+///
+/// ```ignore
+/// fn into_owner(self) -> $Owner
+/// ```
+///
+///
+/// ### Parameters:
+///
+/// - `$Vis:vis struct $StructName:ident` Name of the struct that will be
+///   declared, this needs to be unique for the relevant scope. Example: `struct
+///   AstCell` or `pub struct AstCell`. `$Vis` can be used to mark the struct
+///   and all functions implemented by the macro as public.
+///
+///   `$(#[$StructMeta:meta])*` allows you specify further meta items for this
+///   struct, eg. `#[doc(hidden)] struct AstCell`.
+///
+/// - `$Owner:ty` Type of owner. This has to have a `'static` lifetime. Example:
+///   `String`.
+///
+/// - `$Dependent:ident` Name of the dependent type without specified lifetime.
+///   This can't be a nested type name. As workaround either create a type alias
+///   `type Dep<'a> = Option<Vec<&'a str>>;` or create a new-type `struct
+///   Dep<'a>(Option<Vec<&'a str>>);`. Example: `Ast`.
+///
+///   `$Covariance:ident` Marker declaring if `$Dependent` is
+///   [covariant](https://doc.rust-lang.org/nightly/nomicon/subtyping.html).
+///   Possible Values:
+///
+///   * **covariant**: This generates the direct reference accessor function
+///     `borrow_dependent`. This is only safe to do if this compiles `fn
+///     _assert_covariance<'x: 'y, 'y>(x: &'y $Dependent<'x>) -> &'y $Dependent<'y>
+///     {x}`. Otherwise you could choose a lifetime that is too short for types
+///     with interior mutability like `Cell`, which can lead to UB in safe code.
+///     Which would violate the promise of this library that it is safe-to-use.
+///     If you accidentally mark a type that is not covariant as covariant, you
+///     will get a compile time error.
+///
+///   * **not_covariant**: This generates no additional code but you can use the
+///     `with_dependent` function. See [How to build a lazy AST with
+///     self_cell](https://github.com/Voultapher/self_cell/tree/main/examples/lazy_ast)
+///     for a usage example.
+///
+///   In both cases you can use the `with_dependent_mut` function to mutate the
+///   dependent value. This is safe to do because notionally you are replacing
+///   pointers to a value not the other way around.
+///
+/// - `impl {$($AutomaticDerive:ident),*},` Optional comma separated list of
+///   optional automatic trait implementations. Possible Values:
+///
+///   * **Debug**: Prints the debug representation of owner and dependent.
+///     Example: `AstCell { owner: "fox = cat + dog", dependent: Ast(["fox",
+///     "cat", "dog"]) }`
+///
+///   * **PartialEq**: Logic `*self.borrow_owner() == *other.borrow_owner()`,
+///     this assumes that `Dependent<'a>::From<&'a Owner>` is deterministic, so
+///     that only comparing owner is enough.
+///
+///   * **Eq**: Will implement the trait marker `Eq` for `$StructName`. Beware
+///     if you select this `Eq` will be implemented regardless if `$Owner`
+///     implements `Eq`, that's an unfortunate technical limitation.
+///
+///   * **Hash**: Logic `self.borrow_owner().hash(state);`, this assumes that
+///     `Dependent<'a>::From<&'a Owner>` is deterministic, so that only hashing
+///     owner is enough.
+///
+///   All `AutomaticDerive` are optional and you can implement you own version
+///   of these traits. The declared struct is part of your module and you are
+///   free to implement any trait in any way you want. Access to the unsafe
+///   internals is only possible via unsafe functions, so you can't accidentally
+///   use them in safe code.
+///
+///   There is limited nested cell support. Eg, having an owner with non static
+///   references. Eg `struct ChildCell<'a> { owner: &'a String, ...`. You can
+///   use any lifetime name you want, except `_q` and only a single lifetime is
+///   supported, and can only be used in the owner. Due to macro_rules
+///   limitations, no `AutomaticDerive` are supported if an owner lifetime is
+///   provided.
+///
+#[macro_export]
+macro_rules! self_cell {
+(
+    $(#[$StructMeta:meta])*
+    $Vis:vis struct $StructName:ident $(<$OwnerLifetime:lifetime>)? {
+        owner: $Owner:ty,
+
+        #[$Covariance:ident]
+        dependent: $Dependent:ident,
+    }
+
+    $(impl {$($AutomaticDerive:ident),*})?
+) => {
+    #[repr(transparent)]
+    $(#[$StructMeta])*
+    $Vis struct $StructName $(<$OwnerLifetime>)? {
+        unsafe_self_cell: $crate::unsafe_self_cell::UnsafeSelfCell<
+            $StructName$(<$OwnerLifetime>)?,
+            $Owner,
+            $Dependent<'static>
+        >,
+
+        $(owner_marker: $crate::_covariant_owner_marker!($Covariance, $OwnerLifetime) ,)?
+    }
+
+    impl $(<$OwnerLifetime>)? $StructName $(<$OwnerLifetime>)? {
+        /// Constructs a new self-referential struct.
+        ///
+        /// The provided `owner` will be moved into a heap allocated box.
+        /// Followed by construction of the dependent value, by calling
+        /// `dependent_builder` with a shared reference to the owner that
+        /// remains valid for the lifetime of the constructed struct.
+        $Vis fn new(
+            owner: $Owner,
+            dependent_builder: impl for<'_q> ::core::ops::FnOnce(&'_q $Owner) -> $Dependent<'_q>
+        ) -> Self {
+            use ::core::ptr::NonNull;
+
+            unsafe {
+                // All this has to happen here, because there is not good way
+                // of passing the appropriate logic into UnsafeSelfCell::new
+                // short of assuming Dependent<'static> is the same as
+                // Dependent<'_q>, which I'm not confident is safe.
+
+                // For this API to be safe there has to be no safe way to
+                // capture additional references in `dependent_builder` and then
+                // return them as part of Dependent. Eg. it should be impossible
+                // to express: '_q should outlive 'x here `fn
+                // bad<'_q>(outside_ref: &'_q String) -> impl for<'x> ::core::ops::FnOnce(&'x
+                // Owner) -> Dependent<'x>`.
+
+                type JoinedCell<'_q $(, $OwnerLifetime)?> =
+                    $crate::unsafe_self_cell::JoinedCell<$Owner, $Dependent<'_q>>;
+
+                let layout = $crate::alloc::alloc::Layout::new::<JoinedCell>();
+                assert!(layout.size() != 0);
+
+                let joined_void_ptr = NonNull::new($crate::alloc::alloc::alloc(layout)).unwrap();
+
+                let mut joined_ptr = joined_void_ptr.cast::<JoinedCell>();
+
+                let (owner_ptr, dependent_ptr) = JoinedCell::_field_pointers(joined_ptr.as_ptr());
+
+                // Move owner into newly allocated space.
+                owner_ptr.write(owner);
+
+                // Drop guard that cleans up should building the dependent panic.
+                let drop_guard =
+                    $crate::unsafe_self_cell::OwnerAndCellDropGuard::new(joined_ptr);
+
+                // Initialize dependent with owner reference in final place.
+                dependent_ptr.write(dependent_builder(&*owner_ptr));
+                ::core::mem::forget(drop_guard);
+
+                Self {
+                    unsafe_self_cell: $crate::unsafe_self_cell::UnsafeSelfCell::new(
+                        joined_void_ptr,
+                    ),
+                    $(owner_marker: $crate::_covariant_owner_marker_ctor!($OwnerLifetime) ,)?
+                }
+            }
+        }
+
+        /// Tries to create a new structure with a given dependent builder.
+        ///
+        /// Consumes owner on error.
+        $Vis fn try_new<Err>(
+            owner: $Owner,
+            dependent_builder:
+                impl for<'_q> ::core::ops::FnOnce(&'_q $Owner) -> ::core::result::Result<$Dependent<'_q>, Err>
+        ) -> ::core::result::Result<Self, Err> {
+            use ::core::ptr::NonNull;
+
+            unsafe {
+                // See fn new for more explanation.
+
+                type JoinedCell<'_q $(, $OwnerLifetime)?> =
+                    $crate::unsafe_self_cell::JoinedCell<$Owner, $Dependent<'_q>>;
+
+                let layout = $crate::alloc::alloc::Layout::new::<JoinedCell>();
+                assert!(layout.size() != 0);
+
+                let joined_void_ptr = NonNull::new($crate::alloc::alloc::alloc(layout)).unwrap();
+
+                let mut joined_ptr = joined_void_ptr.cast::<JoinedCell>();
+
+                let (owner_ptr, dependent_ptr) = JoinedCell::_field_pointers(joined_ptr.as_ptr());
+
+                // Move owner into newly allocated space.
+                owner_ptr.write(owner);
+
+                // Drop guard that cleans up should building the dependent panic.
+                let mut drop_guard =
+                    $crate::unsafe_self_cell::OwnerAndCellDropGuard::new(joined_ptr);
+
+                match dependent_builder(&*owner_ptr) {
+                    ::core::result::Result::Ok(dependent) => {
+                        dependent_ptr.write(dependent);
+                        ::core::mem::forget(drop_guard);
+
+                        ::core::result::Result::Ok(Self {
+                            unsafe_self_cell: $crate::unsafe_self_cell::UnsafeSelfCell::new(
+                                joined_void_ptr,
+                            ),
+                            $(owner_marker: $crate::_covariant_owner_marker_ctor!($OwnerLifetime) ,)?
+                        })
+                    }
+                    ::core::result::Result::Err(err) => ::core::result::Result::Err(err)
+                }
+            }
+        }
+
+        /// Tries to create a new structure with a given dependent builder.
+        ///
+        /// Returns owner on error.
+        $Vis fn try_new_or_recover<Err>(
+            owner: $Owner,
+            dependent_builder:
+                impl for<'_q> ::core::ops::FnOnce(&'_q $Owner) -> ::core::result::Result<$Dependent<'_q>, Err>
+        ) -> ::core::result::Result<Self, ($Owner, Err)> {
+            use ::core::ptr::NonNull;
+
+            unsafe {
+                // See fn new for more explanation.
+
+                type JoinedCell<'_q $(, $OwnerLifetime)?> =
+                    $crate::unsafe_self_cell::JoinedCell<$Owner, $Dependent<'_q>>;
+
+                let layout = $crate::alloc::alloc::Layout::new::<JoinedCell>();
+                assert!(layout.size() != 0);
+
+                let joined_void_ptr = NonNull::new($crate::alloc::alloc::alloc(layout)).unwrap();
+
+                let mut joined_ptr = joined_void_ptr.cast::<JoinedCell>();
+
+                let (owner_ptr, dependent_ptr) = JoinedCell::_field_pointers(joined_ptr.as_ptr());
+
+                // Move owner into newly allocated space.
+                owner_ptr.write(owner);
+
+                // Drop guard that cleans up should building the dependent panic.
+                let mut drop_guard =
+                    $crate::unsafe_self_cell::OwnerAndCellDropGuard::new(joined_ptr);
+
+                match dependent_builder(&*owner_ptr) {
+                    ::core::result::Result::Ok(dependent) => {
+                        dependent_ptr.write(dependent);
+                        ::core::mem::forget(drop_guard);
+
+                        ::core::result::Result::Ok(Self {
+                            unsafe_self_cell: $crate::unsafe_self_cell::UnsafeSelfCell::new(
+                                joined_void_ptr,
+                            ),
+                            $(owner_marker: $crate::_covariant_owner_marker_ctor!($OwnerLifetime) ,)?
+                        })
+                    }
+                    ::core::result::Result::Err(err) => {
+                        // In contrast to into_owner ptr::read, here no dependent
+                        // ever existed in this function and so we are sure its
+                        // drop impl can't access owner after the read.
+                        // And err can't return a reference to owner.
+                        let owner_on_err = ::core::ptr::read(owner_ptr);
+
+                        // Allowing drop_guard to finish would let it double free owner.
+                        // So we dealloc the JoinedCell here manually.
+                        ::core::mem::forget(drop_guard);
+                        $crate::alloc::alloc::dealloc(joined_void_ptr.as_ptr(), layout);
+
+                        ::core::result::Result::Err((owner_on_err, err))
+                    }
+                }
+            }
+        }
+
+        /// Borrows owner.
+        $Vis fn borrow_owner<'_q>(&'_q self) -> &'_q $Owner {
+            unsafe { self.unsafe_self_cell.borrow_owner::<$Dependent<'_q>>() }
+        }
+
+        /// Calls given closure `func` with a shared reference to dependent.
+        $Vis fn with_dependent<'outer_fn, Ret>(
+            &'outer_fn self,
+            func: impl for<'_q> ::core::ops::FnOnce(&'_q $Owner, &'outer_fn $Dependent<'_q>
+        ) -> Ret) -> Ret {
+            unsafe {
+                func(
+                    self.unsafe_self_cell.borrow_owner::<$Dependent>(),
+                    self.unsafe_self_cell.borrow_dependent()
+                )
+            }
+        }
+
+        /// Calls given closure `func` with an unique reference to dependent.
+        $Vis fn with_dependent_mut<'outer_fn, Ret>(
+            &'outer_fn mut self,
+            func: impl for<'_q> ::core::ops::FnOnce(&'_q $Owner, &'outer_fn mut $Dependent<'_q>) -> Ret
+        ) -> Ret {
+            let (owner, dependent) = unsafe {
+                    self.unsafe_self_cell.borrow_mut()
+            };
+
+            func(owner, dependent)
+        }
+
+        $crate::_covariant_access!($Covariance, $Vis, $Dependent);
+
+        /// Consumes `self` and returns the the owner.
+        $Vis fn into_owner(self) -> $Owner {
+            // This is only safe to do with repr(transparent).
+            let unsafe_self_cell = unsafe { ::core::mem::transmute::<
+                Self,
+                $crate::unsafe_self_cell::UnsafeSelfCell<
+                    $StructName$(<$OwnerLifetime>)?,
+                    $Owner,
+                    $Dependent<'static>
+                >
+            >(self) };
+
+            let owner = unsafe { unsafe_self_cell.into_owner::<$Dependent>() };
+
+            owner
+        }
+    }
+
+    impl $(<$OwnerLifetime>)? Drop for $StructName $(<$OwnerLifetime>)? {
+        fn drop(&mut self) {
+            unsafe {
+                self.unsafe_self_cell.drop_joined::<$Dependent>();
+            }
+        }
+    }
+
+    // The user has to choose which traits can and should be automatically
+    // implemented for the cell.
+    $($(
+        $crate::_impl_automatic_derive!($AutomaticDerive, $StructName);
+    )*)*
+};
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! _covariant_access {
+    (covariant, $Vis:vis, $Dependent:ident) => {
+        /// Borrows dependent.
+        $Vis fn borrow_dependent<'_q>(&'_q self) -> &'_q $Dependent<'_q> {
+            fn _assert_covariance<'x: 'y, 'y>(x: &'y $Dependent<'x>) -> &'y $Dependent<'y> {
+                //  This function only compiles for covariant types.
+                x // Change the macro invocation to not_covariant.
+            }
+
+            unsafe { self.unsafe_self_cell.borrow_dependent() }
+        }
+    };
+    (not_covariant, $Vis:vis, $Dependent:ident) => {
+        // For types that are not covariant it's unsafe to allow
+        // returning direct references.
+        // For example a lifetime that is too short could be chosen:
+        // See https://github.com/Voultapher/self_cell/issues/5
+    };
+    ($x:ident, $Vis:vis, $Dependent:ident) => {
+        compile_error!("This macro only accepts `covariant` or `not_covariant`");
+    };
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! _covariant_owner_marker {
+    (covariant, $OwnerLifetime:lifetime) => {
+        // Ensure that contravariant owners don't imply covariance
+        // over the dependent. See issue https://github.com/Voultapher/self_cell/issues/18
+        ::core::marker::PhantomData<&$OwnerLifetime ()>
+    };
+    (not_covariant, $OwnerLifetime:lifetime) => {
+        // See the discussion in https://github.com/Voultapher/self_cell/pull/29
+        //
+        // If the dependent is non_covariant, mark the owner as invariant over its
+        // lifetime. Otherwise unsound use is possible.
+        ::core::marker::PhantomData<fn(&$OwnerLifetime ()) -> &$OwnerLifetime ()>
+    };
+    ($x:ident, $OwnerLifetime:lifetime) => {
+        compile_error!("This macro only accepts `covariant` or `not_covariant`");
+    };
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! _covariant_owner_marker_ctor {
+    ($OwnerLifetime:lifetime) => {
+        // Helper to optionally expand into PhantomData for construction.
+        ::core::marker::PhantomData
+    };
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! _impl_automatic_derive {
+    (Debug, $StructName:ident) => {
+        impl ::core::fmt::Debug for $StructName {
+            fn fmt(
+                &self,
+                fmt: &mut ::core::fmt::Formatter,
+            ) -> ::core::result::Result<(), ::core::fmt::Error> {
+                self.with_dependent(|owner, dependent| {
+                    fmt.debug_struct(stringify!($StructName))
+                        .field("owner", owner)
+                        .field("dependent", dependent)
+                        .finish()
+                })
+            }
+        }
+    };
+    (PartialEq, $StructName:ident) => {
+        impl ::core::cmp::PartialEq for $StructName {
+            fn eq(&self, other: &Self) -> bool {
+                *self.borrow_owner() == *other.borrow_owner()
+            }
+        }
+    };
+    (Eq, $StructName:ident) => {
+        // TODO this should only be allowed if owner is Eq.
+        impl ::core::cmp::Eq for $StructName {}
+    };
+    (Hash, $StructName:ident) => {
+        impl ::core::hash::Hash for $StructName {
+            fn hash<H: ::core::hash::Hasher>(&self, state: &mut H) {
+                self.borrow_owner().hash(state);
+            }
+        }
+    };
+    ($x:ident, $StructName:ident) => {
+        compile_error!(concat!(
+            "No automatic trait impl for trait: ",
+            stringify!($x)
+        ));
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/self_cell/src/unsafe_self_cell.rs 43.0.0-1ubuntu1/rust-vendor/self_cell/src/unsafe_self_cell.rs
--- 43.0.0-1/rust-vendor/self_cell/src/unsafe_self_cell.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/self_cell/src/unsafe_self_cell.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,225 @@
+#![allow(clippy::needless_lifetimes)]
+
+use core::marker::PhantomData;
+use core::mem;
+use core::ptr::{drop_in_place, read, NonNull};
+
+extern crate alloc;
+
+use alloc::alloc::{dealloc, Layout};
+
+// Self referential structs are currently not supported with safe vanilla Rust.
+// The only reasonable safe alternative is to expect the user to juggle 2 separate
+// data structures which is a mess. The library solution rental is both no longer
+// maintained and really heavy to compile. So begrudgingly I rolled my own version.
+// These are some of the core invariants we require for this to be safe to use.
+//
+// 1. owner is initialized when UnsafeSelfCell is constructed.
+// 2. owner is NEVER changed again.
+// 3. The pointer to owner and dependent never changes, even when moved.
+// 4. The only access to owner and dependent is as immutable reference.
+// 5. owner lives longer than dependent.
+
+#[doc(hidden)]
+pub struct JoinedCell<Owner, Dependent> {
+    pub owner: Owner,
+    pub dependent: Dependent,
+}
+
+// Library controlled struct that marks all accesses as unsafe.
+// Because the macro generated struct impl can be extended, could be unsafe.
+#[doc(hidden)]
+pub struct UnsafeSelfCell<ContainedIn, Owner, DependentStatic: 'static> {
+    joined_void_ptr: NonNull<u8>,
+
+    // ContainedIn is necessary for type safety since we don't fully
+    // prohibit access to the UnsafeSelfCell; swapping between different
+    // structs can be unsafe otherwise, see Issue #17.
+    contained_in_marker: PhantomData<ContainedIn>,
+
+    owner_marker: PhantomData<Owner>,
+    // DependentStatic is only used to correctly derive Send and Sync.
+    dependent_marker: PhantomData<DependentStatic>,
+}
+
+impl<ContainedIn, Owner, DependentStatic> UnsafeSelfCell<ContainedIn, Owner, DependentStatic> {
+    pub unsafe fn new(joined_void_ptr: NonNull<u8>) -> Self {
+        Self {
+            joined_void_ptr,
+            contained_in_marker: PhantomData,
+            owner_marker: PhantomData,
+            dependent_marker: PhantomData,
+        }
+    }
+
+    // Calling any of these *unsafe* functions with the wrong Dependent type is UB.
+
+    pub unsafe fn borrow_owner<'a, Dependent>(&'a self) -> &'a Owner {
+        let joined_ptr = self.joined_void_ptr.cast::<JoinedCell<Owner, Dependent>>();
+
+        &(*joined_ptr.as_ptr()).owner
+    }
+
+    pub unsafe fn borrow_dependent<'a, Dependent>(&'a self) -> &'a Dependent {
+        let joined_ptr = self.joined_void_ptr.cast::<JoinedCell<Owner, Dependent>>();
+
+        &(*joined_ptr.as_ptr()).dependent
+    }
+
+    pub unsafe fn borrow_mut<'a, Dependent>(&'a mut self) -> (&'a Owner, &'a mut Dependent) {
+        let joined_ptr = self.joined_void_ptr.cast::<JoinedCell<Owner, Dependent>>();
+
+        // This function used to return `&'a mut JoinedCell<Owner, Dependent>`.
+        // It now creates two references to the fields instead to avoid claiming mutable access
+        // to the whole `JoinedCell` (including the owner!) here.
+        (
+            &(*joined_ptr.as_ptr()).owner,
+            &mut (*joined_ptr.as_ptr()).dependent,
+        )
+    }
+
+    // Any subsequent use of this struct other than dropping it is UB.
+    pub unsafe fn drop_joined<Dependent>(&mut self) {
+        let joined_ptr = self.joined_void_ptr.cast::<JoinedCell<Owner, Dependent>>();
+
+        // Also used in case drop_in_place(...dependent) fails
+        let _guard = OwnerAndCellDropGuard { joined_ptr };
+
+        // IMPORTANT dependent must be dropped before owner.
+        // We don't want to rely on an implicit order of struct fields.
+        // So we drop the struct, field by field manually.
+        drop_in_place(&mut (*joined_ptr.as_ptr()).dependent);
+
+        // Dropping owner
+        // and deallocating
+        // due to _guard at end of scope.
+    }
+
+    pub unsafe fn into_owner<Dependent>(self) -> Owner {
+        let joined_ptr = self.joined_void_ptr.cast::<JoinedCell<Owner, Dependent>>();
+
+        // In case drop_in_place(...dependent) fails
+        let drop_guard = OwnerAndCellDropGuard::new(joined_ptr);
+
+        // Drop dependent
+        drop_in_place(&mut (*joined_ptr.as_ptr()).dependent);
+
+        mem::forget(drop_guard);
+
+        let owner_ptr: *const Owner = &(*joined_ptr.as_ptr()).owner;
+
+        // Move owner out so it can be returned.
+        // Must not read before dropping dependent!! (Which happened above.)
+        let owner = read(owner_ptr);
+
+        // Deallocate JoinedCell
+        let layout = Layout::new::<JoinedCell<Owner, Dependent>>();
+        dealloc(self.joined_void_ptr.as_ptr(), layout);
+
+        owner
+    }
+}
+
+unsafe impl<ContainedIn, Owner, DependentStatic> Send
+    for UnsafeSelfCell<ContainedIn, Owner, DependentStatic>
+where
+    // Only derive Send if Owner and DependentStatic is also Send
+    Owner: Send,
+    DependentStatic: Send,
+{
+}
+
+unsafe impl<ContainedIn, Owner, DependentStatic> Sync
+    for UnsafeSelfCell<ContainedIn, Owner, DependentStatic>
+where
+    // Only derive Sync if Owner and DependentStatic is also Sync
+    Owner: Sync,
+    DependentStatic: Sync,
+{
+}
+
+// This struct is used to safely deallocate only the owner if dependent
+// construction fails.
+//
+// mem::forget it once it's no longer needed or dtor will be UB.
+#[doc(hidden)]
+pub struct OwnerAndCellDropGuard<Owner, Dependent> {
+    joined_ptr: NonNull<JoinedCell<Owner, Dependent>>,
+}
+
+impl<Owner, Dependent> OwnerAndCellDropGuard<Owner, Dependent> {
+    pub unsafe fn new(joined_ptr: NonNull<JoinedCell<Owner, Dependent>>) -> Self {
+        Self { joined_ptr }
+    }
+}
+
+impl<Owner, Dependent> Drop for OwnerAndCellDropGuard<Owner, Dependent> {
+    fn drop(&mut self) {
+        struct DeallocGuard {
+            ptr: *mut u8,
+            layout: Layout,
+        }
+        impl Drop for DeallocGuard {
+            fn drop(&mut self) {
+                unsafe { dealloc(self.ptr, self.layout) }
+            }
+        }
+
+        // Deallocate even when the drop_in_place(...owner) panics
+        let _guard = DeallocGuard {
+            ptr: self.joined_ptr.as_ptr() as *mut u8,
+            layout: Layout::new::<JoinedCell<Owner, Dependent>>(),
+        };
+
+        unsafe {
+            // We must only drop owner and the struct itself,
+            // The whole point of this drop guard is to clean up the partially
+            // initialized struct should building the dependent fail.
+            drop_in_place(&mut (*self.joined_ptr.as_ptr()).owner);
+        }
+
+        // Deallocation happens at end of scope
+    }
+}
+
+// Older versions of rust do not support addr_of_mut!. What we want to do here
+// is to emulate the behavior of that macro by going (incorrectly) via a
+// reference cast. Technically this is UB, but testing does not show the older
+// compiler versions (ab)using this. For discussions about this behavior see
+// https://github.com/Voultapher/self_cell/pull/31 and
+// https://github.com/Voultapher/self_cell/issues/30 and
+// https://github.com/Voultapher/self_cell/pull/33
+//
+// Because of 'procedural macros cannot expand to macro definitions'
+// we have wrap this in functions.
+impl<Owner, Dependent> JoinedCell<Owner, Dependent> {
+    #[doc(hidden)]
+    #[cfg(not(feature = "old_rust"))]
+    pub unsafe fn _field_pointers(this: *mut Self) -> (*mut Owner, *mut Dependent) {
+        let owner_ptr = core::ptr::addr_of_mut!((*this).owner);
+        let dependent_ptr = core::ptr::addr_of_mut!((*this).dependent);
+
+        (owner_ptr, dependent_ptr)
+    }
+
+    #[doc(hidden)]
+    #[cfg(feature = "old_rust")]
+    #[rustversion::since(1.51)]
+    pub unsafe fn _field_pointers(this: *mut Self) -> (*mut Owner, *mut Dependent) {
+        let owner_ptr = core::ptr::addr_of_mut!((*this).owner);
+        let dependent_ptr = core::ptr::addr_of_mut!((*this).dependent);
+
+        (owner_ptr, dependent_ptr)
+    }
+
+    #[doc(hidden)]
+    #[cfg(feature = "old_rust")]
+    #[rustversion::before(1.51)]
+    pub unsafe fn _field_pointers(this: *mut Self) -> (*mut Owner, *mut Dependent) {
+        // See comment above, technically this is UB.
+        let owner_ptr = &mut (*this).owner as *mut Owner;
+        let dependent_ptr = &mut (*this).dependent as *mut Dependent;
+
+        (owner_ptr, dependent_ptr)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/syn/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/syn/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"Cargo.toml":"da27a459467bdce0e0ccc794243c70944283aac440a8ec694bdf09ff27979467","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"ae6deb98ea51df4829c0327139a555cc115c6bcf6fb459db0ef0d6a96c4566ec","benches/file.rs":"0a0527c78d849148cbb6118b4d36f72da7d4add865ba1a410e0a1be9e8dbfe0e","benches/rust.rs":"a4b2ac626d36df1e344b1389384a559fb47da291b8ad3aa964d59d93279eebb1","src/attr.rs":"bd959c93f997d5d77ec08a5f580d1d38a391978b916b5bbe82bad4c03e694563","src/bigint.rs":"0299829b2f7a1a798fe2f7bc1680e4a10f9b6f4a852d09af4da2deab466c4242","src/buffer.rs":"86034db43cad263610a86d77cd7f3a170b173f9375659124c2d9daa30b855953","src/classify.rs":"00312dc6d51f634530f06b44365365a2588a3f6f40740224f64d0cde94839b5b","src/custom_keyword.rs":"322114e36ae43a2f8605506fb4568efdbc2986853e2fee74bd10a4ca0fb60c69","src/custom_punctuation.rs":"2ae2339c29b1aff3ab16157d51a3a07bfca594aa38586981534fe07a62cdd9d1","src/data.rs":"7ad7f3c55d9f0b2ff223f3f30602ffa82013c0e7366006b0a9a01193de753db0","src/derive.rs":"f54f8cf9386a2d45186ff3c86ade5dae59e0e337b0198532449190ae8520cff8","src/discouraged.rs":"e89c91924a2db771f75e90ea032c02d6bdd71d5dd7b59fec98eac19e18209108","src/drops.rs":"013385f1dd95663f1afab41abc1e2eea04181998644828935ca564c74d6462ae","src/error.rs":"3b03fd75eee8b0bb646eaf20f7e287345bdc7515ad5286024a2dd1e53c1e7bf2","src/export.rs":"b260cc49da1da3489e7755832bc8015cfad79e84f6c74e237f65ae25a2385e56","src/expr.rs":"95dfdf7d79b3281e9bc961b254725bd2dc6403b40d901f8cc31ef1ec9ee44690","src/ext.rs":"ed143b029af286e62ceb4310286a4ce894792dd588465face042b4199b39d329","src/file.rs":"39d4ed9c56a7dc0d83259843732c434cd187248a4cde3dba4a98c3b92df6d08f","src/fixup.rs":"b312a6a527f81df17a94cb9f08def820584ca76cbef07893bbed492f2f0506af","src/gen/clone.rs":"36491f5f9e9cad6c4eb354b3331ec2b672607bb26429eba6379d1e9a4919170f","src/gen/debug.rs":"c9b2547663ed9025ba614fb1a70810df1b25f471ebb57abb01de5ab8e4fa8bf0","src/gen/eq.rs":"b5fffca0c3b6c31b3fcc80a7bd8fec65baed982a4e2fb4c8862db6059ab7dea1","src/gen/fold.rs":"345e6a6d9a7d2d09e09cd5857fc903af4202df42f0759a3da118556e98829fd2","src/gen/hash.rs":"447e840245178d0777b4e143b54c356b88962456e80282dcaad1763093709c13","src/gen/visit.rs":"178a6841d7d1974bff8c8c2f9a18e9b77384956841861a50828252bcaef67c18","src/gen/visit_mut.rs":"2a8f9a1c0259060f3fa1d6cab8a1924c1b07d713561aa9562cde8e79a39e66d5","src/generics.rs":"53ba17d13f89d316387c7debb302f703f99d5038921a7272a6d25e6f8bec42ec","src/group.rs":"ddbff97e41315bdf9dfce215a8c00bb4d532827cf794246afde7308b39dc09ca","src/ident.rs":"d6061030fadae9c7dc847e1ee46178d9657d782aad108c7197e8cafe765b3eaa","src/item.rs":"81e2f57843cf2f8df82e314da940a6dda9bfa54e0641dbabe3ca2a7a68c9c5a8","src/lib.rs":"6674fa9e707b43416eb41b2ecbad03bed4e2b6a412e3dabd61e036fb71c05dda","src/lifetime.rs":"5787d5a5dc7e5332b03283a25ae0a9e826464242ca2d149b1a19e7cae9cee34d","src/lit.rs":"8fa6fa2d752bd1bf5a94cd5cbf9becbcba37d491876614ce62dba0f8fc745a3d","src/lookahead.rs":"eae3c1855dfd1f9bca5dd4afba07d41b15f8c108017f9eda3dc515567160a2af","src/mac.rs":"cd85132ab4d302333f771be7a9b40f9281781ae9bcaee0607e0a25547352baaa","src/macros.rs":"e0587f60d510fd0079c60521f6898b61da5857664bd8b450154f83c85c4403c5","src/meta.rs":"969d8ccbdbc6ea2e4928a21831b791c57447b231e1373149e4c63b46f3951801","src/op.rs":"a61757370f802e44efa3c4a1057ae2cd26e64e273f7d76c06d5ffb49602319e2","src/parse.rs":"2a4baaae025237fa3e372e9017b5a07db290554471493ebec54b4f39864398d5","src/parse_macro_input.rs":"e4e22b63d0496d06a4ca17742a22467ed93f08a739081324773828bad63175ee","src/parse_quote.rs":"6f4e5e28622205651bdb23fcf0f0526aef81a7921aaeac2e7a1a1e3b67916fe9","src/pat.rs":"e552911a1712508c672eca35abdf9f81bad3a960f21522eddbc411a6a7070445","src/path.rs":"d77045e5dad382056d67fe31a42bc45b6a02ce044c43287bd38a95e32fd6aead","src/precedence.rs":"a0c3cd0d873e7c40b609ce3279838deb42cec4004bd4bf53276325428d7584fb","src/print.rs":"22910bf0521ab868ebd7c62601c55912d12cfb400c65723e08e5cfa3a2d111c0","src/punctuated.rs":"6e4a63b736f371bbb4cba83bb674e29aa25f9f214bc10e9acf785673a39d3fc5","src/restriction.rs":"eabb012634ef67aa3c3849c905ab549189461df7fefde2a4b90161c8685f31b2","src/sealed.rs":"6ece3b3dcb30f6bb98b93d83759ca7712ee8592bef9c0511141039c38765db0e","src/span.rs":"0a48e375e5c9768f6f64174a91ba6a255f4b021e2fb3548d8494e617f142601b","src/spanned.rs":"4b9bd65f60ab81922adfd0be8f03b6d50e98da3a5f525f242f9639aec4beac79","src/stmt.rs":"bb4cd196ce23c3fc07fefa47e67a0cd815db4f02ce1192625379d60bd657ffd2","src/thread.rs":"1f1deb1272525ab2af9a36aac4bce8f65b0e315adb1656641fd7075662f49222","src/token.rs":"3625e05bfaaf48adf7685669a59186386862572fa4550c5e94bf9a1febdb069e","src/tt.rs":"a58303a95d08d6bf3f3e09715b9b70a57b91b54774cfc1f00f2848034d2ff5c7","src/ty.rs":"90af4ce1911c91bdfd9ae431def641640daeb0c788c39a2ef024926485e7b2b2","src/verbatim.rs":"87cbe82a90f48efb57ffd09141042698b3e011a21d0d5412154d80324b0a5ef0","src/whitespace.rs":"9cdcbfe9045b259046329a795bc1105ab5a871471a6d3f7318d275ee53f7a825","tests/common/eq.rs":"fe86f984ba007f7c57a188f113a51e5bfc3d04aec6b8c30800e0a19d653f8ee5","tests/common/mod.rs":"1f43ce65b273172c87640e87ee0775ecb6f19280fbf8f792570d019b61f9a32d","tests/common/parse.rs":"c173bd515ba1d53b3b676161849fa8df0ae3d5592445843cee65b6628b71ac32","tests/debug/gen.rs":"3ca161a049fe72ff73ead99fbfe78335fdb2ac7c41085fe8cd0c9a0b29995151","tests/debug/mod.rs":"b56136586267ae1812a937b69215dd053ada2c21717771d89dcd3ce52bcb27f5","tests/macros/mod.rs":"64b0da858096e7cf0f772e66bc1787a867e45897d7677de580c0a1f35c0f6852","tests/regression.rs":"e9565ea0efecb4136f099164ffcfa26e1996b0a27fb9c6659e90ad9bdd42e7b6","tests/regression/issue1108.rs":"f32db35244a674e22ff824ca9e5bbec2184e287b59f022db68c418b5878a2edc","tests/regression/issue1235.rs":"a2266b10c3f7c7af5734817ab0a3e8b309b51e7d177b63f26e67e6b744d280b0","tests/repo/mod.rs":"d342b33626d07200b24ac3de839023d8b76910ba6db09c812d8df70a6ec17afa","tests/repo/progress.rs":"c08d0314a7f3ecf760d471f27da3cd2a500aeb9f1c8331bffb2aa648f9fabf3f","tests/test_asyncness.rs":"8982f6bc4e36510f924e288247473403e72697389ce9dda4e4b5ab0a8e49259f","tests/test_attribute.rs":"b35550a43bbd187bb330997ba36f90c65d8fc489135b1d32ef4547f145cb7612","tests/test_derive_input.rs":"99c4e6e45e3322ea9e269b309059c8a00fda1dcc03aed41f6e7d8c7e0a72fa2b","tests/test_expr.rs":"08129117bd4f6b8c2faea8e241e62ec8428c5286b20b5bb1583422f2b661d2f4","tests/test_generics.rs":"2fcc8575d695b568f3724b3b33d853b8fa6d9864eb816b5e3ca82420682e6155","tests/test_grouping.rs":"1bd63c8ca0b90bd493fb3f927079ab9ddf74d2a78da82db2f638e652d22305d5","tests/test_ident.rs":"d5850e817720e774cd397a46dbc5298c57933823c18e20805e84503fc9387e8f","tests/test_item.rs":"1b8412a5581adf93eaa215785a592f139af8511c954dee283d52dff2718a6cc2","tests/test_iterators.rs":"f4dacb5f3a8e0473dfb0d27f05270d41e79eddb4759b1fad3e88e379b4731e17","tests/test_lit.rs":"01b0acfe03cff16e7c1a45ceb7f4b637e5cbc6145840886ba981b7ed8e83691c","tests/test_meta.rs":"4ae570333f849ed8edec5dd957111a2deb721ede360f1e1ffeeab75380578ad4","tests/test_parse_buffer.rs":"0de6af13ba0345986b18d495063f9b75a1018e8569c34b277f9522c63a6c0941","tests/test_parse_quote.rs":"928176da6ebb449ef01a798f3352c9b181d3077c1266eb008df73876f4013c47","tests/test_parse_stream.rs":"b6b533432173123d6d01d8d2cb33714bc50b30b16ffbb6116f93937221ad4594","tests/test_pat.rs":"f6954a50e62a97ac2bc1ba0cb7a5a1fc53b7b01fb55ffe0176bee3fe1955d460","tests/test_path.rs":"d54350aa91508f8d301f5be3e3a34e03b0615b1a04e8fbbab9840da20161838b","tests/test_precedence.rs":"5d7a5f8373c0187823430627983f999733a79a7e2b4f41a4eee4aa9f76578655","tests/test_receiver.rs":"af64117acd66fbf42edc476f731ecd20c88009d9cb641dbd7a1d6384ae99ae73","tests/test_round_trip.rs":"48559ad63116f31fbbfd0d8501c5ace77d47f60a26b70359244bb0988fe65084","tests/test_shebang.rs":"98e8a6690c04e0aad2893b747593620b51836fe704f50f5c6fe352609837138a","tests/test_size.rs":"03efaf829b80b7db1f831474c1d3ce268914fc499d0e2a7eea03cad04a482974","tests/test_stmt.rs":"bbc305ea888254798b6faf285187d8bc7a955e4402d9a497d4b9d361e0436691","tests/test_token_trees.rs":"d012da9c3c861073711b006bf6ffdc073821fb9fb0a08733628cdae57124d1f5","tests/test_ty.rs":"49fbb880891d4c2e21350e35b914d92aa9a056fbaad9c4afa5242802848fe9c4","tests/test_unparenthesize.rs":"6c723cd6332b7d8be703fab20f085cef7716692eb07b1d75f2e590935656641d","tests/test_visibility.rs":"7bd239aef6f6d8173462dbd869064f3fdb9ba71644ac1f62c5d2fbb2568fb986","tests/zzz_stable.rs":"2a862e59cb446235ed99aec0e6ada8e16d3ecc30229b29d825b7c0bbc2602989"},"package":"b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/syn/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/syn/Cargo.toml
--- 43.0.0-1/rust-vendor/syn/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,264 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2021"
+rust-version = "1.61"
+name = "syn"
+version = "2.0.71"
+authors = ["David Tolnay <dtolnay@gmail.com>"]
+build = false
+include = [
+    "/benches/**",
+    "/Cargo.toml",
+    "/LICENSE-APACHE",
+    "/LICENSE-MIT",
+    "/README.md",
+    "/src/**",
+    "/tests/**",
+]
+autobins = false
+autoexamples = false
+autotests = false
+autobenches = false
+description = "Parser for Rust source code"
+documentation = "https://docs.rs/syn"
+readme = "README.md"
+keywords = [
+    "macros",
+    "syn",
+]
+categories = [
+    "development-tools::procedural-macro-helpers",
+    "parser-implementations",
+]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/dtolnay/syn"
+
+[package.metadata.docs.rs]
+all-features = true
+rustdoc-args = ["--generate-link-to-definition"]
+targets = ["x86_64-unknown-linux-gnu"]
+
+[package.metadata.playground]
+features = [
+    "full",
+    "visit",
+    "visit-mut",
+    "fold",
+    "extra-traits",
+]
+
+[lib]
+name = "syn"
+path = "src/lib.rs"
+doc-scrape-examples = false
+
+[[test]]
+name = "regression"
+path = "tests/regression.rs"
+
+[[test]]
+name = "test_asyncness"
+path = "tests/test_asyncness.rs"
+
+[[test]]
+name = "test_attribute"
+path = "tests/test_attribute.rs"
+
+[[test]]
+name = "test_derive_input"
+path = "tests/test_derive_input.rs"
+
+[[test]]
+name = "test_expr"
+path = "tests/test_expr.rs"
+
+[[test]]
+name = "test_generics"
+path = "tests/test_generics.rs"
+
+[[test]]
+name = "test_grouping"
+path = "tests/test_grouping.rs"
+
+[[test]]
+name = "test_ident"
+path = "tests/test_ident.rs"
+
+[[test]]
+name = "test_item"
+path = "tests/test_item.rs"
+
+[[test]]
+name = "test_iterators"
+path = "tests/test_iterators.rs"
+
+[[test]]
+name = "test_lit"
+path = "tests/test_lit.rs"
+
+[[test]]
+name = "test_meta"
+path = "tests/test_meta.rs"
+
+[[test]]
+name = "test_parse_buffer"
+path = "tests/test_parse_buffer.rs"
+
+[[test]]
+name = "test_parse_quote"
+path = "tests/test_parse_quote.rs"
+
+[[test]]
+name = "test_parse_stream"
+path = "tests/test_parse_stream.rs"
+
+[[test]]
+name = "test_pat"
+path = "tests/test_pat.rs"
+
+[[test]]
+name = "test_path"
+path = "tests/test_path.rs"
+
+[[test]]
+name = "test_precedence"
+path = "tests/test_precedence.rs"
+
+[[test]]
+name = "test_receiver"
+path = "tests/test_receiver.rs"
+
+[[test]]
+name = "test_round_trip"
+path = "tests/test_round_trip.rs"
+
+[[test]]
+name = "test_shebang"
+path = "tests/test_shebang.rs"
+
+[[test]]
+name = "test_size"
+path = "tests/test_size.rs"
+
+[[test]]
+name = "test_stmt"
+path = "tests/test_stmt.rs"
+
+[[test]]
+name = "test_token_trees"
+path = "tests/test_token_trees.rs"
+
+[[test]]
+name = "test_ty"
+path = "tests/test_ty.rs"
+
+[[test]]
+name = "test_unparenthesize"
+path = "tests/test_unparenthesize.rs"
+
+[[test]]
+name = "test_visibility"
+path = "tests/test_visibility.rs"
+
+[[test]]
+name = "zzz_stable"
+path = "tests/zzz_stable.rs"
+
+[[bench]]
+name = "file"
+path = "benches/file.rs"
+required-features = [
+    "full",
+    "parsing",
+]
+
+[[bench]]
+name = "rust"
+path = "benches/rust.rs"
+harness = false
+required-features = [
+    "full",
+    "parsing",
+]
+
+[dependencies.proc-macro2]
+version = "1.0.83"
+default-features = false
+
+[dependencies.quote]
+version = "1.0.35"
+optional = true
+default-features = false
+
+[dependencies.unicode-ident]
+version = "1"
+
+[dev-dependencies.anyhow]
+version = "1"
+
+[dev-dependencies.automod]
+version = "1"
+
+[dev-dependencies.insta]
+version = "1"
+
+[dev-dependencies.ref-cast]
+version = "1"
+
+[dev-dependencies.rustversion]
+version = "1"
+
+[dev-dependencies.syn-test-suite]
+version = "0"
+
+[dev-dependencies.termcolor]
+version = "1"
+
+[features]
+clone-impls = []
+default = [
+    "derive",
+    "parsing",
+    "printing",
+    "clone-impls",
+    "proc-macro",
+]
+derive = []
+extra-traits = []
+fold = []
+full = []
+parsing = []
+printing = ["dep:quote"]
+proc-macro = [
+    "proc-macro2/proc-macro",
+    "quote?/proc-macro",
+]
+test = ["syn-test-suite/all-features"]
+visit = []
+visit-mut = []
+
+[target."cfg(not(miri))".dev-dependencies.flate2]
+version = "1"
+
+[target."cfg(not(miri))".dev-dependencies.rayon]
+version = "1"
+
+[target."cfg(not(miri))".dev-dependencies.reqwest]
+version = "0.12"
+features = ["blocking"]
+
+[target."cfg(not(miri))".dev-dependencies.tar]
+version = "0.4.16"
+
+[target."cfg(not(miri))".dev-dependencies.walkdir]
+version = "2.3.2"
diff -pruN 43.0.0-1/rust-vendor/syn/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/syn/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/syn/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,176 @@
+                              Apache License
+                        Version 2.0, January 2004
+                     http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+   "License" shall mean the terms and conditions for use, reproduction,
+   and distribution as defined by Sections 1 through 9 of this document.
+
+   "Licensor" shall mean the copyright owner or entity authorized by
+   the copyright owner that is granting the License.
+
+   "Legal Entity" shall mean the union of the acting entity and all
+   other entities that control, are controlled by, or are under common
+   control with that entity. For the purposes of this definition,
+   "control" means (i) the power, direct or indirect, to cause the
+   direction or management of such entity, whether by contract or
+   otherwise, or (ii) ownership of fifty percent (50%) or more of the
+   outstanding shares, or (iii) beneficial ownership of such entity.
+
+   "You" (or "Your") shall mean an individual or Legal Entity
+   exercising permissions granted by this License.
+
+   "Source" form shall mean the preferred form for making modifications,
+   including but not limited to software source code, documentation
+   source, and configuration files.
+
+   "Object" form shall mean any form resulting from mechanical
+   transformation or translation of a Source form, including but
+   not limited to compiled object code, generated documentation,
+   and conversions to other media types.
+
+   "Work" shall mean the work of authorship, whether in Source or
+   Object form, made available under the License, as indicated by a
+   copyright notice that is included in or attached to the work
+   (an example is provided in the Appendix below).
+
+   "Derivative Works" shall mean any work, whether in Source or Object
+   form, that is based on (or derived from) the Work and for which the
+   editorial revisions, annotations, elaborations, or other modifications
+   represent, as a whole, an original work of authorship. For the purposes
+   of this License, Derivative Works shall not include works that remain
+   separable from, or merely link (or bind by name) to the interfaces of,
+   the Work and Derivative Works thereof.
+
+   "Contribution" shall mean any work of authorship, including
+   the original version of the Work and any modifications or additions
+   to that Work or Derivative Works thereof, that is intentionally
+   submitted to Licensor for inclusion in the Work by the copyright owner
+   or by an individual or Legal Entity authorized to submit on behalf of
+   the copyright owner. For the purposes of this definition, "submitted"
+   means any form of electronic, verbal, or written communication sent
+   to the Licensor or its representatives, including but not limited to
+   communication on electronic mailing lists, source code control systems,
+   and issue tracking systems that are managed by, or on behalf of, the
+   Licensor for the purpose of discussing and improving the Work, but
+   excluding communication that is conspicuously marked or otherwise
+   designated in writing by the copyright owner as "Not a Contribution."
+
+   "Contributor" shall mean Licensor and any individual or Legal Entity
+   on behalf of whom a Contribution has been received by Licensor and
+   subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   copyright license to reproduce, prepare Derivative Works of,
+   publicly display, publicly perform, sublicense, and distribute the
+   Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   (except as stated in this section) patent license to make, have made,
+   use, offer to sell, sell, import, and otherwise transfer the Work,
+   where such license applies only to those patent claims licensable
+   by such Contributor that are necessarily infringed by their
+   Contribution(s) alone or by combination of their Contribution(s)
+   with the Work to which such Contribution(s) was submitted. If You
+   institute patent litigation against any entity (including a
+   cross-claim or counterclaim in a lawsuit) alleging that the Work
+   or a Contribution incorporated within the Work constitutes direct
+   or contributory patent infringement, then any patent licenses
+   granted to You under this License for that Work shall terminate
+   as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+   Work or Derivative Works thereof in any medium, with or without
+   modifications, and in Source or Object form, provided that You
+   meet the following conditions:
+
+   (a) You must give any other recipients of the Work or
+       Derivative Works a copy of this License; and
+
+   (b) You must cause any modified files to carry prominent notices
+       stating that You changed the files; and
+
+   (c) You must retain, in the Source form of any Derivative Works
+       that You distribute, all copyright, patent, trademark, and
+       attribution notices from the Source form of the Work,
+       excluding those notices that do not pertain to any part of
+       the Derivative Works; and
+
+   (d) If the Work includes a "NOTICE" text file as part of its
+       distribution, then any Derivative Works that You distribute must
+       include a readable copy of the attribution notices contained
+       within such NOTICE file, excluding those notices that do not
+       pertain to any part of the Derivative Works, in at least one
+       of the following places: within a NOTICE text file distributed
+       as part of the Derivative Works; within the Source form or
+       documentation, if provided along with the Derivative Works; or,
+       within a display generated by the Derivative Works, if and
+       wherever such third-party notices normally appear. The contents
+       of the NOTICE file are for informational purposes only and
+       do not modify the License. You may add Your own attribution
+       notices within Derivative Works that You distribute, alongside
+       or as an addendum to the NOTICE text from the Work, provided
+       that such additional attribution notices cannot be construed
+       as modifying the License.
+
+   You may add Your own copyright statement to Your modifications and
+   may provide additional or different license terms and conditions
+   for use, reproduction, or distribution of Your modifications, or
+   for any such Derivative Works as a whole, provided Your use,
+   reproduction, and distribution of the Work otherwise complies with
+   the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+   any Contribution intentionally submitted for inclusion in the Work
+   by You to the Licensor shall be under the terms and conditions of
+   this License, without any additional terms or conditions.
+   Notwithstanding the above, nothing herein shall supersede or modify
+   the terms of any separate license agreement you may have executed
+   with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+   names, trademarks, service marks, or product names of the Licensor,
+   except as required for reasonable and customary use in describing the
+   origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+   agreed to in writing, Licensor provides the Work (and each
+   Contributor provides its Contributions) on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+   implied, including, without limitation, any warranties or conditions
+   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+   PARTICULAR PURPOSE. You are solely responsible for determining the
+   appropriateness of using or redistributing the Work and assume any
+   risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+   whether in tort (including negligence), contract, or otherwise,
+   unless required by applicable law (such as deliberate and grossly
+   negligent acts) or agreed to in writing, shall any Contributor be
+   liable to You for damages, including any direct, indirect, special,
+   incidental, or consequential damages of any character arising as a
+   result of this License or out of the use or inability to use the
+   Work (including but not limited to damages for loss of goodwill,
+   work stoppage, computer failure or malfunction, or any and all
+   other commercial damages or losses), even if such Contributor
+   has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+   the Work or Derivative Works thereof, You may choose to offer,
+   and charge a fee for, acceptance of support, warranty, indemnity,
+   or other liability obligations and/or rights consistent with this
+   License. However, in accepting such obligations, You may act only
+   on Your own behalf and on Your sole responsibility, not on behalf
+   of any other Contributor, and only if You agree to indemnify,
+   defend, and hold each Contributor harmless for any liability
+   incurred by, or claims asserted against, such Contributor by reason
+   of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
diff -pruN 43.0.0-1/rust-vendor/syn/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/syn/LICENSE-MIT
--- 43.0.0-1/rust-vendor/syn/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,23 @@
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/syn/README.md 43.0.0-1ubuntu1/rust-vendor/syn/README.md
--- 43.0.0-1/rust-vendor/syn/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,284 @@
+Parser for Rust source code
+===========================
+
+[<img alt="github" src="https://img.shields.io/badge/github-dtolnay/syn-8da0cb?style=for-the-badge&labelColor=555555&logo=github" height="20">](https://github.com/dtolnay/syn)
+[<img alt="crates.io" src="https://img.shields.io/crates/v/syn.svg?style=for-the-badge&color=fc8d62&logo=rust" height="20">](https://crates.io/crates/syn)
+[<img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-syn-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs" height="20">](https://docs.rs/syn)
+[<img alt="build status" src="https://img.shields.io/github/actions/workflow/status/dtolnay/syn/ci.yml?branch=master&style=for-the-badge" height="20">](https://github.com/dtolnay/syn/actions?query=branch%3Amaster)
+
+Syn is a parsing library for parsing a stream of Rust tokens into a syntax tree
+of Rust source code.
+
+Currently this library is geared toward use in Rust procedural macros, but
+contains some APIs that may be useful more generally.
+
+- **Data structures** — Syn provides a complete syntax tree that can represent
+  any valid Rust source code. The syntax tree is rooted at [`syn::File`] which
+  represents a full source file, but there are other entry points that may be
+  useful to procedural macros including [`syn::Item`], [`syn::Expr`] and
+  [`syn::Type`].
+
+- **Derives** — Of particular interest to derive macros is [`syn::DeriveInput`]
+  which is any of the three legal input items to a derive macro. An example
+  below shows using this type in a library that can derive implementations of a
+  user-defined trait.
+
+- **Parsing** — Parsing in Syn is built around [parser functions] with the
+  signature `fn(ParseStream) -> Result<T>`. Every syntax tree node defined by
+  Syn is individually parsable and may be used as a building block for custom
+  syntaxes, or you may dream up your own brand new syntax without involving any
+  of our syntax tree types.
+
+- **Location information** — Every token parsed by Syn is associated with a
+  `Span` that tracks line and column information back to the source of that
+  token. These spans allow a procedural macro to display detailed error messages
+  pointing to all the right places in the user's code. There is an example of
+  this below.
+
+- **Feature flags** — Functionality is aggressively feature gated so your
+  procedural macros enable only what they need, and do not pay in compile time
+  for all the rest.
+
+[`syn::File`]: https://docs.rs/syn/2.0/syn/struct.File.html
+[`syn::Item`]: https://docs.rs/syn/2.0/syn/enum.Item.html
+[`syn::Expr`]: https://docs.rs/syn/2.0/syn/enum.Expr.html
+[`syn::Type`]: https://docs.rs/syn/2.0/syn/enum.Type.html
+[`syn::DeriveInput`]: https://docs.rs/syn/2.0/syn/struct.DeriveInput.html
+[parser functions]: https://docs.rs/syn/2.0/syn/parse/index.html
+
+*Version requirement: Syn supports rustc 1.61 and up.*
+
+[*Release notes*](https://github.com/dtolnay/syn/releases)
+
+<br>
+
+## Resources
+
+The best way to learn about procedural macros is by writing some. Consider
+working through [this procedural macro workshop][workshop] to get familiar with
+the different types of procedural macros. The workshop contains relevant links
+into the Syn documentation as you work through each project.
+
+[workshop]: https://github.com/dtolnay/proc-macro-workshop
+
+<br>
+
+## Example of a derive macro
+
+The canonical derive macro using Syn looks like this. We write an ordinary Rust
+function tagged with a `proc_macro_derive` attribute and the name of the trait
+we are deriving. Any time that derive appears in the user's code, the Rust
+compiler passes their data structure as tokens into our macro. We get to execute
+arbitrary Rust code to figure out what to do with those tokens, then hand some
+tokens back to the compiler to compile into the user's crate.
+
+[`TokenStream`]: https://doc.rust-lang.org/proc_macro/struct.TokenStream.html
+
+```toml
+[dependencies]
+syn = "2.0"
+quote = "1.0"
+
+[lib]
+proc-macro = true
+```
+
+```rust
+use proc_macro::TokenStream;
+use quote::quote;
+use syn::{parse_macro_input, DeriveInput};
+
+#[proc_macro_derive(MyMacro)]
+pub fn my_macro(input: TokenStream) -> TokenStream {
+    // Parse the input tokens into a syntax tree
+    let input = parse_macro_input!(input as DeriveInput);
+
+    // Build the output, possibly using quasi-quotation
+    let expanded = quote! {
+        // ...
+    };
+
+    // Hand the output tokens back to the compiler
+    TokenStream::from(expanded)
+}
+```
+
+The [`heapsize`] example directory shows a complete working implementation of a
+derive macro. The example derives a `HeapSize` trait which computes an estimate
+of the amount of heap memory owned by a value.
+
+[`heapsize`]: examples/heapsize
+
+```rust
+pub trait HeapSize {
+    /// Total number of bytes of heap memory owned by `self`.
+    fn heap_size_of_children(&self) -> usize;
+}
+```
+
+The derive macro allows users to write `#[derive(HeapSize)]` on data structures
+in their program.
+
+```rust
+#[derive(HeapSize)]
+struct Demo<'a, T: ?Sized> {
+    a: Box<T>,
+    b: u8,
+    c: &'a str,
+    d: String,
+}
+```
+
+<br>
+
+## Spans and error reporting
+
+The token-based procedural macro API provides great control over where the
+compiler's error messages are displayed in user code. Consider the error the
+user sees if one of their field types does not implement `HeapSize`.
+
+```rust
+#[derive(HeapSize)]
+struct Broken {
+    ok: String,
+    bad: std::thread::Thread,
+}
+```
+
+By tracking span information all the way through the expansion of a procedural
+macro as shown in the `heapsize` example, token-based macros in Syn are able to
+trigger errors that directly pinpoint the source of the problem.
+
+```console
+error[E0277]: the trait bound `std::thread::Thread: HeapSize` is not satisfied
+ --> src/main.rs:7:5
+  |
+7 |     bad: std::thread::Thread,
+  |     ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HeapSize` is not implemented for `std::thread::Thread`
+```
+
+<br>
+
+## Parsing a custom syntax
+
+The [`lazy-static`] example directory shows the implementation of a
+`functionlike!(...)` procedural macro in which the input tokens are parsed using
+Syn's parsing API.
+
+[`lazy-static`]: examples/lazy-static
+
+The example reimplements the popular `lazy_static` crate from crates.io as a
+procedural macro.
+
+```rust
+lazy_static! {
+    static ref USERNAME: Regex = Regex::new("^[a-z0-9_-]{3,16}$").unwrap();
+}
+```
+
+The implementation shows how to trigger custom warnings and error messages on
+the macro input.
+
+```console
+warning: come on, pick a more creative name
+  --> src/main.rs:10:16
+   |
+10 |     static ref FOO: String = "lazy_static".to_owned();
+   |                ^^^
+```
+
+<br>
+
+## Testing
+
+When testing macros, we often care not just that the macro can be used
+successfully but also that when the macro is provided with invalid input it
+produces maximally helpful error messages. Consider using the [`trybuild`] crate
+to write tests for errors that are emitted by your macro or errors detected by
+the Rust compiler in the expanded code following misuse of the macro. Such tests
+help avoid regressions from later refactors that mistakenly make an error no
+longer trigger or be less helpful than it used to be.
+
+[`trybuild`]: https://github.com/dtolnay/trybuild
+
+<br>
+
+## Debugging
+
+When developing a procedural macro it can be helpful to look at what the
+generated code looks like. Use `cargo rustc -- -Zunstable-options
+--pretty=expanded` or the [`cargo expand`] subcommand.
+
+[`cargo expand`]: https://github.com/dtolnay/cargo-expand
+
+To show the expanded code for some crate that uses your procedural macro, run
+`cargo expand` from that crate. To show the expanded code for one of your own
+test cases, run `cargo expand --test the_test_case` where the last argument is
+the name of the test file without the `.rs` extension.
+
+This write-up by Brandon W Maister discusses debugging in more detail:
+[Debugging Rust's new Custom Derive system][debugging].
+
+[debugging]: https://quodlibetor.github.io/posts/debugging-rusts-new-custom-derive-system/
+
+<br>
+
+## Optional features
+
+Syn puts a lot of functionality behind optional features in order to optimize
+compile time for the most common use cases. The following features are
+available.
+
+- **`derive`** *(enabled by default)* — Data structures for representing the
+  possible input to a derive macro, including structs and enums and types.
+- **`full`** — Data structures for representing the syntax tree of all valid
+  Rust source code, including items and expressions.
+- **`parsing`** *(enabled by default)* — Ability to parse input tokens into a
+  syntax tree node of a chosen type.
+- **`printing`** *(enabled by default)* — Ability to print a syntax tree node as
+  tokens of Rust source code.
+- **`visit`** — Trait for traversing a syntax tree.
+- **`visit-mut`** — Trait for traversing and mutating in place a syntax tree.
+- **`fold`** — Trait for transforming an owned syntax tree.
+- **`clone-impls`** *(enabled by default)* — Clone impls for all syntax tree
+  types.
+- **`extra-traits`** — Debug, Eq, PartialEq, Hash impls for all syntax tree
+  types.
+- **`proc-macro`** *(enabled by default)* — Runtime dependency on the dynamic
+  library libproc_macro from rustc toolchain.
+
+<br>
+
+## Proc macro shim
+
+Syn operates on the token representation provided by the [proc-macro2] crate
+from crates.io rather than using the compiler's built in proc-macro crate
+directly. This enables code using Syn to execute outside of the context of a
+procedural macro, such as in unit tests or build.rs, and we avoid needing
+incompatible ecosystems for proc macros vs non-macro use cases.
+
+In general all of your code should be written against proc-macro2 rather than
+proc-macro. The one exception is in the signatures of procedural macro entry
+points, which are required by the language to use `proc_macro::TokenStream`.
+
+The proc-macro2 crate will automatically detect and use the compiler's data
+structures when a procedural macro is active.
+
+[proc-macro2]: https://docs.rs/proc-macro2/1.0/proc_macro2/
+
+<br>
+
+#### License
+
+<sup>
+Licensed under either of <a href="LICENSE-APACHE">Apache License, Version
+2.0</a> or <a href="LICENSE-MIT">MIT license</a> at your option.
+</sup>
+
+<br>
+
+<sub>
+Unless you explicitly state otherwise, any contribution intentionally submitted
+for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
+be dual licensed as above, without any additional terms or conditions.
+</sub>
diff -pruN 43.0.0-1/rust-vendor/syn/benches/file.rs 43.0.0-1ubuntu1/rust-vendor/syn/benches/file.rs
--- 43.0.0-1/rust-vendor/syn/benches/file.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/benches/file.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,57 @@
+// $ cargo bench --features full,test --bench file
+
+#![feature(rustc_private, test)]
+#![recursion_limit = "1024"]
+#![allow(
+    clippy::items_after_statements,
+    clippy::manual_let_else,
+    clippy::match_like_matches_macro,
+    clippy::missing_panics_doc,
+    clippy::must_use_candidate,
+    clippy::uninlined_format_args
+)]
+
+extern crate test;
+
+#[macro_use]
+#[path = "../tests/macros/mod.rs"]
+mod macros;
+
+#[allow(dead_code)]
+#[path = "../tests/repo/mod.rs"]
+mod repo;
+
+use proc_macro2::{Span, TokenStream};
+use std::fs;
+use std::str::FromStr;
+use syn::parse::{ParseStream, Parser};
+use test::Bencher;
+
+const FILE: &str = "tests/rust/library/core/src/str/mod.rs";
+
+fn get_tokens() -> TokenStream {
+    repo::clone_rust();
+    let content = fs::read_to_string(FILE).unwrap();
+    TokenStream::from_str(&content).unwrap()
+}
+
+#[bench]
+fn baseline(b: &mut Bencher) {
+    let tokens = get_tokens();
+    b.iter(|| drop(tokens.clone()));
+}
+
+#[bench]
+fn create_token_buffer(b: &mut Bencher) {
+    let tokens = get_tokens();
+    fn immediate_fail(_input: ParseStream) -> syn::Result<()> {
+        Err(syn::Error::new(Span::call_site(), ""))
+    }
+    b.iter(|| immediate_fail.parse2(tokens.clone()));
+}
+
+#[bench]
+fn parse_file(b: &mut Bencher) {
+    let tokens = get_tokens();
+    b.iter(|| syn::parse2::<syn::File>(tokens.clone()));
+}
diff -pruN 43.0.0-1/rust-vendor/syn/benches/rust.rs 43.0.0-1ubuntu1/rust-vendor/syn/benches/rust.rs
--- 43.0.0-1/rust-vendor/syn/benches/rust.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/benches/rust.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,190 @@
+// $ cargo bench --features full,test --bench rust
+//
+// Syn only, useful for profiling:
+// $ RUSTFLAGS='--cfg syn_only' cargo build --release --features full,test --bench rust
+
+#![cfg_attr(not(syn_only), feature(rustc_private))]
+#![recursion_limit = "1024"]
+#![allow(
+    clippy::arc_with_non_send_sync,
+    clippy::cast_lossless,
+    clippy::let_underscore_untyped,
+    clippy::manual_let_else,
+    clippy::match_like_matches_macro,
+    clippy::uninlined_format_args,
+    clippy::unnecessary_wraps
+)]
+
+#[macro_use]
+#[path = "../tests/macros/mod.rs"]
+mod macros;
+
+#[allow(dead_code)]
+#[path = "../tests/repo/mod.rs"]
+mod repo;
+
+use std::fs;
+use std::path::Path;
+use std::time::{Duration, Instant};
+
+#[cfg(not(syn_only))]
+mod tokenstream_parse {
+    use proc_macro2::TokenStream;
+    use std::path::Path;
+    use std::str::FromStr;
+
+    pub fn bench(_path: &Path, content: &str) -> Result<(), ()> {
+        TokenStream::from_str(content).map(drop).map_err(drop)
+    }
+}
+
+mod syn_parse {
+    use std::path::Path;
+
+    pub fn bench(_path: &Path, content: &str) -> Result<(), ()> {
+        syn::parse_file(content).map(drop).map_err(drop)
+    }
+}
+
+#[cfg(not(syn_only))]
+mod librustc_parse {
+    extern crate rustc_data_structures;
+    extern crate rustc_driver;
+    extern crate rustc_error_messages;
+    extern crate rustc_errors;
+    extern crate rustc_parse;
+    extern crate rustc_session;
+    extern crate rustc_span;
+
+    use crate::repo;
+    use rustc_data_structures::sync::Lrc;
+    use rustc_error_messages::FluentBundle;
+    use rustc_errors::{emitter::Emitter, translation::Translate, DiagCtxt, DiagInner};
+    use rustc_session::parse::ParseSess;
+    use rustc_span::source_map::{FilePathMapping, SourceMap};
+    use rustc_span::FileName;
+    use std::path::Path;
+
+    pub fn bench(path: &Path, content: &str) -> Result<(), ()> {
+        struct SilentEmitter;
+
+        impl Emitter for SilentEmitter {
+            fn emit_diagnostic(&mut self, _diag: DiagInner) {}
+            fn source_map(&self) -> Option<&Lrc<SourceMap>> {
+                None
+            }
+        }
+
+        impl Translate for SilentEmitter {
+            fn fluent_bundle(&self) -> Option<&Lrc<FluentBundle>> {
+                None
+            }
+            fn fallback_fluent_bundle(&self) -> &FluentBundle {
+                panic!("silent emitter attempted to translate a diagnostic");
+            }
+        }
+
+        let edition = repo::edition(path).parse().unwrap();
+        rustc_span::create_session_if_not_set_then(edition, |_| {
+            let source_map = Lrc::new(SourceMap::new(FilePathMapping::empty()));
+            let emitter = Box::new(SilentEmitter);
+            let handler = DiagCtxt::new(emitter);
+            let sess = ParseSess::with_dcx(handler, source_map);
+            let name = FileName::Custom("bench".to_owned());
+            let mut parser =
+                rustc_parse::new_parser_from_source_str(&sess, name, content.to_owned()).unwrap();
+            if let Err(diagnostic) = parser.parse_crate_mod() {
+                diagnostic.cancel();
+                return Err(());
+            };
+            Ok(())
+        })
+    }
+}
+
+#[cfg(not(syn_only))]
+mod read_from_disk {
+    use std::path::Path;
+
+    pub fn bench(_path: &Path, content: &str) -> Result<(), ()> {
+        let _ = content;
+        Ok(())
+    }
+}
+
+fn exec(mut codepath: impl FnMut(&Path, &str) -> Result<(), ()>) -> Duration {
+    let begin = Instant::now();
+    let mut success = 0;
+    let mut total = 0;
+
+    ["tests/rust/compiler", "tests/rust/library"]
+        .iter()
+        .flat_map(|dir| {
+            walkdir::WalkDir::new(dir)
+                .into_iter()
+                .filter_entry(repo::base_dir_filter)
+        })
+        .for_each(|entry| {
+            let entry = entry.unwrap();
+            let path = entry.path();
+            if path.is_dir() {
+                return;
+            }
+            let content = fs::read_to_string(path).unwrap();
+            let ok = codepath(path, &content).is_ok();
+            success += ok as usize;
+            total += 1;
+            if !ok {
+                eprintln!("FAIL {}", path.display());
+            }
+        });
+
+    assert_eq!(success, total);
+    begin.elapsed()
+}
+
+fn main() {
+    repo::clone_rust();
+
+    macro_rules! testcases {
+        ($($(#[$cfg:meta])* $name:ident,)*) => {
+            [
+                $(
+                    $(#[$cfg])*
+                    (stringify!($name), $name::bench as fn(&Path, &str) -> Result<(), ()>),
+                )*
+            ]
+        };
+    }
+
+    #[cfg(not(syn_only))]
+    {
+        let mut lines = 0;
+        let mut files = 0;
+        exec(|_path, content| {
+            lines += content.lines().count();
+            files += 1;
+            Ok(())
+        });
+        eprintln!("\n{} lines in {} files", lines, files);
+    }
+
+    for (name, f) in testcases!(
+        #[cfg(not(syn_only))]
+        read_from_disk,
+        #[cfg(not(syn_only))]
+        tokenstream_parse,
+        syn_parse,
+        #[cfg(not(syn_only))]
+        librustc_parse,
+    ) {
+        eprint!("{:20}", format!("{}:", name));
+        let elapsed = exec(f);
+        eprintln!(
+            "elapsed={}.{:03}s",
+            elapsed.as_secs(),
+            elapsed.subsec_millis(),
+        );
+    }
+    eprintln!();
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/attr.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/attr.rs
--- 43.0.0-1/rust-vendor/syn/src/attr.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/attr.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,793 @@
+#[cfg(feature = "parsing")]
+use crate::error::Error;
+#[cfg(feature = "parsing")]
+use crate::error::Result;
+use crate::expr::Expr;
+use crate::mac::MacroDelimiter;
+#[cfg(feature = "parsing")]
+use crate::meta::{self, ParseNestedMeta};
+#[cfg(feature = "parsing")]
+use crate::parse::{Parse, ParseStream, Parser};
+use crate::path::Path;
+use crate::token;
+use proc_macro2::TokenStream;
+#[cfg(feature = "printing")]
+use std::iter;
+#[cfg(feature = "printing")]
+use std::slice;
+
+ast_struct! {
+    /// An attribute, like `#[repr(transparent)]`.
+    ///
+    /// <br>
+    ///
+    /// # Syntax
+    ///
+    /// Rust has six types of attributes.
+    ///
+    /// - Outer attributes like `#[repr(transparent)]`. These appear outside or
+    ///   in front of the item they describe.
+    ///
+    /// - Inner attributes like `#![feature(proc_macro)]`. These appear inside
+    ///   of the item they describe, usually a module.
+    ///
+    /// - Outer one-line doc comments like `/// Example`.
+    ///
+    /// - Inner one-line doc comments like `//! Please file an issue`.
+    ///
+    /// - Outer documentation blocks `/** Example */`.
+    ///
+    /// - Inner documentation blocks `/*! Please file an issue */`.
+    ///
+    /// The `style` field of type `AttrStyle` distinguishes whether an attribute
+    /// is outer or inner.
+    ///
+    /// Every attribute has a `path` that indicates the intended interpretation
+    /// of the rest of the attribute's contents. The path and the optional
+    /// additional contents are represented together in the `meta` field of the
+    /// attribute in three possible varieties:
+    ///
+    /// - Meta::Path &mdash; attributes whose information content conveys just a
+    ///   path, for example the `#[test]` attribute.
+    ///
+    /// - Meta::List &mdash; attributes that carry arbitrary tokens after the
+    ///   path, surrounded by a delimiter (parenthesis, bracket, or brace). For
+    ///   example `#[derive(Copy)]` or `#[precondition(x < 5)]`.
+    ///
+    /// - Meta::NameValue &mdash; attributes with an `=` sign after the path,
+    ///   followed by a Rust expression. For example `#[path =
+    ///   "sys/windows.rs"]`.
+    ///
+    /// All doc comments are represented in the NameValue style with a path of
+    /// "doc", as this is how they are processed by the compiler and by
+    /// `macro_rules!` macros.
+    ///
+    /// ```text
+    /// #[derive(Copy, Clone)]
+    ///   ~~~~~~Path
+    ///   ^^^^^^^^^^^^^^^^^^^Meta::List
+    ///
+    /// #[path = "sys/windows.rs"]
+    ///   ~~~~Path
+    ///   ^^^^^^^^^^^^^^^^^^^^^^^Meta::NameValue
+    ///
+    /// #[test]
+    ///   ^^^^Meta::Path
+    /// ```
+    ///
+    /// <br>
+    ///
+    /// # Parsing from tokens to Attribute
+    ///
+    /// This type does not implement the [`Parse`] trait and thus cannot be
+    /// parsed directly by [`ParseStream::parse`]. Instead use
+    /// [`ParseStream::call`] with one of the two parser functions
+    /// [`Attribute::parse_outer`] or [`Attribute::parse_inner`] depending on
+    /// which you intend to parse.
+    ///
+    /// [`Parse`]: crate::parse::Parse
+    /// [`ParseStream::parse`]: crate::parse::ParseBuffer::parse
+    /// [`ParseStream::call`]: crate::parse::ParseBuffer::call
+    ///
+    /// ```
+    /// use syn::{Attribute, Ident, Result, Token};
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// // Parses a unit struct with attributes.
+    /// //
+    /// //     #[path = "s.tmpl"]
+    /// //     struct S;
+    /// struct UnitStruct {
+    ///     attrs: Vec<Attribute>,
+    ///     struct_token: Token![struct],
+    ///     name: Ident,
+    ///     semi_token: Token![;],
+    /// }
+    ///
+    /// impl Parse for UnitStruct {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         Ok(UnitStruct {
+    ///             attrs: input.call(Attribute::parse_outer)?,
+    ///             struct_token: input.parse()?,
+    ///             name: input.parse()?,
+    ///             semi_token: input.parse()?,
+    ///         })
+    ///     }
+    /// }
+    /// ```
+    ///
+    /// <p><br></p>
+    ///
+    /// # Parsing from Attribute to structured arguments
+    ///
+    /// The grammar of attributes in Rust is very flexible, which makes the
+    /// syntax tree not that useful on its own. In particular, arguments of the
+    /// `Meta::List` variety of attribute are held in an arbitrary `tokens:
+    /// TokenStream`. Macros are expected to check the `path` of the attribute,
+    /// decide whether they recognize it, and then parse the remaining tokens
+    /// according to whatever grammar they wish to require for that kind of
+    /// attribute. Use [`parse_args()`] to parse those tokens into the expected
+    /// data structure.
+    ///
+    /// [`parse_args()`]: Attribute::parse_args
+    ///
+    /// <p><br></p>
+    ///
+    /// # Doc comments
+    ///
+    /// The compiler transforms doc comments, such as `/// comment` and `/*!
+    /// comment */`, into attributes before macros are expanded. Each comment is
+    /// expanded into an attribute of the form `#[doc = r"comment"]`.
+    ///
+    /// As an example, the following `mod` items are expanded identically:
+    ///
+    /// ```
+    /// # use syn::{ItemMod, parse_quote};
+    /// let doc: ItemMod = parse_quote! {
+    ///     /// Single line doc comments
+    ///     /// We write so many!
+    ///     /**
+    ///      * Multi-line comments...
+    ///      * May span many lines
+    ///      */
+    ///     mod example {
+    ///         //! Of course, they can be inner too
+    ///         /*! And fit in a single line */
+    ///     }
+    /// };
+    /// let attr: ItemMod = parse_quote! {
+    ///     #[doc = r" Single line doc comments"]
+    ///     #[doc = r" We write so many!"]
+    ///     #[doc = r"
+    ///      * Multi-line comments...
+    ///      * May span many lines
+    ///      "]
+    ///     mod example {
+    ///         #![doc = r" Of course, they can be inner too"]
+    ///         #![doc = r" And fit in a single line "]
+    ///     }
+    /// };
+    /// assert_eq!(doc, attr);
+    /// ```
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct Attribute {
+        pub pound_token: Token![#],
+        pub style: AttrStyle,
+        pub bracket_token: token::Bracket,
+        pub meta: Meta,
+    }
+}
+
+impl Attribute {
+    /// Returns the path that identifies the interpretation of this attribute.
+    ///
+    /// For example this would return the `test` in `#[test]`, the `derive` in
+    /// `#[derive(Copy)]`, and the `path` in `#[path = "sys/windows.rs"]`.
+    pub fn path(&self) -> &Path {
+        self.meta.path()
+    }
+
+    /// Parse the arguments to the attribute as a syntax tree.
+    ///
+    /// This is similar to pulling out the `TokenStream` from `Meta::List` and
+    /// doing `syn::parse2::<T>(meta_list.tokens)`, except that using
+    /// `parse_args` the error message has a more useful span when `tokens` is
+    /// empty.
+    ///
+    /// The surrounding delimiters are *not* included in the input to the
+    /// parser.
+    ///
+    /// ```text
+    /// #[my_attr(value < 5)]
+    ///           ^^^^^^^^^ what gets parsed
+    /// ```
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{parse_quote, Attribute, Expr};
+    ///
+    /// let attr: Attribute = parse_quote! {
+    ///     #[precondition(value < 5)]
+    /// };
+    ///
+    /// if attr.path().is_ident("precondition") {
+    ///     let precondition: Expr = attr.parse_args()?;
+    ///     // ...
+    /// }
+    /// # anyhow::Ok(())
+    /// ```
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    pub fn parse_args<T: Parse>(&self) -> Result<T> {
+        self.parse_args_with(T::parse)
+    }
+
+    /// Parse the arguments to the attribute using the given parser.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{parse_quote, Attribute};
+    ///
+    /// let attr: Attribute = parse_quote! {
+    ///     #[inception { #[brrrrrrraaaaawwwwrwrrrmrmrmmrmrmmmmm] }]
+    /// };
+    ///
+    /// let bwom = attr.parse_args_with(Attribute::parse_outer)?;
+    ///
+    /// // Attribute does not have a Parse impl, so we couldn't directly do:
+    /// // let bwom: Attribute = attr.parse_args()?;
+    /// # anyhow::Ok(())
+    /// ```
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    pub fn parse_args_with<F: Parser>(&self, parser: F) -> Result<F::Output> {
+        match &self.meta {
+            Meta::Path(path) => Err(crate::error::new2(
+                path.segments.first().unwrap().ident.span(),
+                path.segments.last().unwrap().ident.span(),
+                format!(
+                    "expected attribute arguments in parentheses: {}[{}(...)]",
+                    parsing::DisplayAttrStyle(&self.style),
+                    parsing::DisplayPath(path),
+                ),
+            )),
+            Meta::NameValue(meta) => Err(Error::new(
+                meta.eq_token.span,
+                format_args!(
+                    "expected parentheses: {}[{}(...)]",
+                    parsing::DisplayAttrStyle(&self.style),
+                    parsing::DisplayPath(&meta.path),
+                ),
+            )),
+            Meta::List(meta) => meta.parse_args_with(parser),
+        }
+    }
+
+    /// Parse the arguments to the attribute, expecting it to follow the
+    /// conventional structure used by most of Rust's built-in attributes.
+    ///
+    /// The [*Meta Item Attribute Syntax*][syntax] section in the Rust reference
+    /// explains the convention in more detail. Not all attributes follow this
+    /// convention, so [`parse_args()`][Self::parse_args] is available if you
+    /// need to parse arbitrarily goofy attribute syntax.
+    ///
+    /// [syntax]: https://doc.rust-lang.org/reference/attributes.html#meta-item-attribute-syntax
+    ///
+    /// # Example
+    ///
+    /// We'll parse a struct, and then parse some of Rust's `#[repr]` attribute
+    /// syntax.
+    ///
+    /// ```
+    /// use syn::{parenthesized, parse_quote, token, ItemStruct, LitInt};
+    ///
+    /// let input: ItemStruct = parse_quote! {
+    ///     #[repr(C, align(4))]
+    ///     pub struct MyStruct(u16, u32);
+    /// };
+    ///
+    /// let mut repr_c = false;
+    /// let mut repr_transparent = false;
+    /// let mut repr_align = None::<usize>;
+    /// let mut repr_packed = None::<usize>;
+    /// for attr in &input.attrs {
+    ///     if attr.path().is_ident("repr") {
+    ///         attr.parse_nested_meta(|meta| {
+    ///             // #[repr(C)]
+    ///             if meta.path.is_ident("C") {
+    ///                 repr_c = true;
+    ///                 return Ok(());
+    ///             }
+    ///
+    ///             // #[repr(transparent)]
+    ///             if meta.path.is_ident("transparent") {
+    ///                 repr_transparent = true;
+    ///                 return Ok(());
+    ///             }
+    ///
+    ///             // #[repr(align(N))]
+    ///             if meta.path.is_ident("align") {
+    ///                 let content;
+    ///                 parenthesized!(content in meta.input);
+    ///                 let lit: LitInt = content.parse()?;
+    ///                 let n: usize = lit.base10_parse()?;
+    ///                 repr_align = Some(n);
+    ///                 return Ok(());
+    ///             }
+    ///
+    ///             // #[repr(packed)] or #[repr(packed(N))], omitted N means 1
+    ///             if meta.path.is_ident("packed") {
+    ///                 if meta.input.peek(token::Paren) {
+    ///                     let content;
+    ///                     parenthesized!(content in meta.input);
+    ///                     let lit: LitInt = content.parse()?;
+    ///                     let n: usize = lit.base10_parse()?;
+    ///                     repr_packed = Some(n);
+    ///                 } else {
+    ///                     repr_packed = Some(1);
+    ///                 }
+    ///                 return Ok(());
+    ///             }
+    ///
+    ///             Err(meta.error("unrecognized repr"))
+    ///         })?;
+    ///     }
+    /// }
+    /// # anyhow::Ok(())
+    /// ```
+    ///
+    /// # Alternatives
+    ///
+    /// In some cases, for attributes which have nested layers of structured
+    /// content, the following less flexible approach might be more convenient:
+    ///
+    /// ```
+    /// # use syn::{parse_quote, ItemStruct};
+    /// #
+    /// # let input: ItemStruct = parse_quote! {
+    /// #     #[repr(C, align(4))]
+    /// #     pub struct MyStruct(u16, u32);
+    /// # };
+    /// #
+    /// use syn::punctuated::Punctuated;
+    /// use syn::{parenthesized, token, Error, LitInt, Meta, Token};
+    ///
+    /// let mut repr_c = false;
+    /// let mut repr_transparent = false;
+    /// let mut repr_align = None::<usize>;
+    /// let mut repr_packed = None::<usize>;
+    /// for attr in &input.attrs {
+    ///     if attr.path().is_ident("repr") {
+    ///         let nested = attr.parse_args_with(Punctuated::<Meta, Token![,]>::parse_terminated)?;
+    ///         for meta in nested {
+    ///             match meta {
+    ///                 // #[repr(C)]
+    ///                 Meta::Path(path) if path.is_ident("C") => {
+    ///                     repr_c = true;
+    ///                 }
+    ///
+    ///                 // #[repr(align(N))]
+    ///                 Meta::List(meta) if meta.path.is_ident("align") => {
+    ///                     let lit: LitInt = meta.parse_args()?;
+    ///                     let n: usize = lit.base10_parse()?;
+    ///                     repr_align = Some(n);
+    ///                 }
+    ///
+    ///                 /* ... */
+    ///
+    ///                 _ => {
+    ///                     return Err(Error::new_spanned(meta, "unrecognized repr"));
+    ///                 }
+    ///             }
+    ///         }
+    ///     }
+    /// }
+    /// # Ok(())
+    /// ```
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    pub fn parse_nested_meta(
+        &self,
+        logic: impl FnMut(ParseNestedMeta) -> Result<()>,
+    ) -> Result<()> {
+        self.parse_args_with(meta::parser(logic))
+    }
+
+    /// Parses zero or more outer attributes from the stream.
+    ///
+    /// # Example
+    ///
+    /// See
+    /// [*Parsing from tokens to Attribute*](#parsing-from-tokens-to-attribute).
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    pub fn parse_outer(input: ParseStream) -> Result<Vec<Self>> {
+        let mut attrs = Vec::new();
+        while input.peek(Token![#]) {
+            attrs.push(input.call(parsing::single_parse_outer)?);
+        }
+        Ok(attrs)
+    }
+
+    /// Parses zero or more inner attributes from the stream.
+    ///
+    /// # Example
+    ///
+    /// See
+    /// [*Parsing from tokens to Attribute*](#parsing-from-tokens-to-attribute).
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    pub fn parse_inner(input: ParseStream) -> Result<Vec<Self>> {
+        let mut attrs = Vec::new();
+        parsing::parse_inner(input, &mut attrs)?;
+        Ok(attrs)
+    }
+}
+
+ast_enum! {
+    /// Distinguishes between attributes that decorate an item and attributes
+    /// that are contained within an item.
+    ///
+    /// # Outer attributes
+    ///
+    /// - `#[repr(transparent)]`
+    /// - `/// # Example`
+    /// - `/** Please file an issue */`
+    ///
+    /// # Inner attributes
+    ///
+    /// - `#![feature(proc_macro)]`
+    /// - `//! # Example`
+    /// - `/*! Please file an issue */`
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub enum AttrStyle {
+        Outer,
+        Inner(Token![!]),
+    }
+}
+
+ast_enum_of_structs! {
+    /// Content of a compile-time structured attribute.
+    ///
+    /// ## Path
+    ///
+    /// A meta path is like the `test` in `#[test]`.
+    ///
+    /// ## List
+    ///
+    /// A meta list is like the `derive(Copy)` in `#[derive(Copy)]`.
+    ///
+    /// ## NameValue
+    ///
+    /// A name-value meta is like the `path = "..."` in `#[path =
+    /// "sys/windows.rs"]`.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub enum Meta {
+        Path(Path),
+
+        /// A structured list within an attribute, like `derive(Copy, Clone)`.
+        List(MetaList),
+
+        /// A name-value pair within an attribute, like `feature = "nightly"`.
+        NameValue(MetaNameValue),
+    }
+}
+
+ast_struct! {
+    /// A structured list within an attribute, like `derive(Copy, Clone)`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct MetaList {
+        pub path: Path,
+        pub delimiter: MacroDelimiter,
+        pub tokens: TokenStream,
+    }
+}
+
+ast_struct! {
+    /// A name-value pair within an attribute, like `feature = "nightly"`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct MetaNameValue {
+        pub path: Path,
+        pub eq_token: Token![=],
+        pub value: Expr,
+    }
+}
+
+impl Meta {
+    /// Returns the path that begins this structured meta item.
+    ///
+    /// For example this would return the `test` in `#[test]`, the `derive` in
+    /// `#[derive(Copy)]`, and the `path` in `#[path = "sys/windows.rs"]`.
+    pub fn path(&self) -> &Path {
+        match self {
+            Meta::Path(path) => path,
+            Meta::List(meta) => &meta.path,
+            Meta::NameValue(meta) => &meta.path,
+        }
+    }
+
+    /// Error if this is a `Meta::List` or `Meta::NameValue`.
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    pub fn require_path_only(&self) -> Result<&Path> {
+        let error_span = match self {
+            Meta::Path(path) => return Ok(path),
+            Meta::List(meta) => meta.delimiter.span().open(),
+            Meta::NameValue(meta) => meta.eq_token.span,
+        };
+        Err(Error::new(error_span, "unexpected token in attribute"))
+    }
+
+    /// Error if this is a `Meta::Path` or `Meta::NameValue`.
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    pub fn require_list(&self) -> Result<&MetaList> {
+        match self {
+            Meta::List(meta) => Ok(meta),
+            Meta::Path(path) => Err(crate::error::new2(
+                path.segments.first().unwrap().ident.span(),
+                path.segments.last().unwrap().ident.span(),
+                format!(
+                    "expected attribute arguments in parentheses: `{}(...)`",
+                    parsing::DisplayPath(path),
+                ),
+            )),
+            Meta::NameValue(meta) => Err(Error::new(meta.eq_token.span, "expected `(`")),
+        }
+    }
+
+    /// Error if this is a `Meta::Path` or `Meta::List`.
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    pub fn require_name_value(&self) -> Result<&MetaNameValue> {
+        match self {
+            Meta::NameValue(meta) => Ok(meta),
+            Meta::Path(path) => Err(crate::error::new2(
+                path.segments.first().unwrap().ident.span(),
+                path.segments.last().unwrap().ident.span(),
+                format!(
+                    "expected a value for this attribute: `{} = ...`",
+                    parsing::DisplayPath(path),
+                ),
+            )),
+            Meta::List(meta) => Err(Error::new(meta.delimiter.span().open(), "expected `=`")),
+        }
+    }
+}
+
+impl MetaList {
+    /// See [`Attribute::parse_args`].
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    pub fn parse_args<T: Parse>(&self) -> Result<T> {
+        self.parse_args_with(T::parse)
+    }
+
+    /// See [`Attribute::parse_args_with`].
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    pub fn parse_args_with<F: Parser>(&self, parser: F) -> Result<F::Output> {
+        let scope = self.delimiter.span().close();
+        crate::parse::parse_scoped(parser, scope, self.tokens.clone())
+    }
+
+    /// See [`Attribute::parse_nested_meta`].
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    pub fn parse_nested_meta(
+        &self,
+        logic: impl FnMut(ParseNestedMeta) -> Result<()>,
+    ) -> Result<()> {
+        self.parse_args_with(meta::parser(logic))
+    }
+}
+
+#[cfg(feature = "printing")]
+pub(crate) trait FilterAttrs<'a> {
+    type Ret: Iterator<Item = &'a Attribute>;
+
+    fn outer(self) -> Self::Ret;
+    #[cfg(feature = "full")]
+    fn inner(self) -> Self::Ret;
+}
+
+#[cfg(feature = "printing")]
+impl<'a> FilterAttrs<'a> for &'a [Attribute] {
+    type Ret = iter::Filter<slice::Iter<'a, Attribute>, fn(&&Attribute) -> bool>;
+
+    fn outer(self) -> Self::Ret {
+        fn is_outer(attr: &&Attribute) -> bool {
+            match attr.style {
+                AttrStyle::Outer => true,
+                AttrStyle::Inner(_) => false,
+            }
+        }
+        self.iter().filter(is_outer)
+    }
+
+    #[cfg(feature = "full")]
+    fn inner(self) -> Self::Ret {
+        fn is_inner(attr: &&Attribute) -> bool {
+            match attr.style {
+                AttrStyle::Inner(_) => true,
+                AttrStyle::Outer => false,
+            }
+        }
+        self.iter().filter(is_inner)
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::attr::{AttrStyle, Attribute, Meta, MetaList, MetaNameValue};
+    use crate::error::Result;
+    use crate::expr::{Expr, ExprLit};
+    use crate::lit::Lit;
+    use crate::parse::discouraged::Speculative as _;
+    use crate::parse::{Parse, ParseStream};
+    use crate::path::Path;
+    use crate::{mac, token};
+    use std::fmt::{self, Display};
+
+    pub(crate) fn parse_inner(input: ParseStream, attrs: &mut Vec<Attribute>) -> Result<()> {
+        while input.peek(Token![#]) && input.peek2(Token![!]) {
+            attrs.push(input.call(single_parse_inner)?);
+        }
+        Ok(())
+    }
+
+    pub(crate) fn single_parse_inner(input: ParseStream) -> Result<Attribute> {
+        let content;
+        Ok(Attribute {
+            pound_token: input.parse()?,
+            style: AttrStyle::Inner(input.parse()?),
+            bracket_token: bracketed!(content in input),
+            meta: content.parse()?,
+        })
+    }
+
+    pub(crate) fn single_parse_outer(input: ParseStream) -> Result<Attribute> {
+        let content;
+        Ok(Attribute {
+            pound_token: input.parse()?,
+            style: AttrStyle::Outer,
+            bracket_token: bracketed!(content in input),
+            meta: content.parse()?,
+        })
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Meta {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let path = input.call(Path::parse_mod_style)?;
+            parse_meta_after_path(path, input)
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for MetaList {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let path = input.call(Path::parse_mod_style)?;
+            parse_meta_list_after_path(path, input)
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for MetaNameValue {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let path = input.call(Path::parse_mod_style)?;
+            parse_meta_name_value_after_path(path, input)
+        }
+    }
+
+    pub(crate) fn parse_meta_after_path(path: Path, input: ParseStream) -> Result<Meta> {
+        if input.peek(token::Paren) || input.peek(token::Bracket) || input.peek(token::Brace) {
+            parse_meta_list_after_path(path, input).map(Meta::List)
+        } else if input.peek(Token![=]) {
+            parse_meta_name_value_after_path(path, input).map(Meta::NameValue)
+        } else {
+            Ok(Meta::Path(path))
+        }
+    }
+
+    fn parse_meta_list_after_path(path: Path, input: ParseStream) -> Result<MetaList> {
+        let (delimiter, tokens) = mac::parse_delimiter(input)?;
+        Ok(MetaList {
+            path,
+            delimiter,
+            tokens,
+        })
+    }
+
+    fn parse_meta_name_value_after_path(path: Path, input: ParseStream) -> Result<MetaNameValue> {
+        let eq_token: Token![=] = input.parse()?;
+        let ahead = input.fork();
+        let lit: Option<Lit> = ahead.parse()?;
+        let value = if let (Some(lit), true) = (lit, ahead.is_empty()) {
+            input.advance_to(&ahead);
+            Expr::Lit(ExprLit {
+                attrs: Vec::new(),
+                lit,
+            })
+        } else if input.peek(Token![#]) && input.peek2(token::Bracket) {
+            return Err(input.error("unexpected attribute inside of attribute"));
+        } else {
+            input.parse()?
+        };
+        Ok(MetaNameValue {
+            path,
+            eq_token,
+            value,
+        })
+    }
+
+    pub(super) struct DisplayAttrStyle<'a>(pub &'a AttrStyle);
+
+    impl<'a> Display for DisplayAttrStyle<'a> {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            formatter.write_str(match self.0 {
+                AttrStyle::Outer => "#",
+                AttrStyle::Inner(_) => "#!",
+            })
+        }
+    }
+
+    pub(super) struct DisplayPath<'a>(pub &'a Path);
+
+    impl<'a> Display for DisplayPath<'a> {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            for (i, segment) in self.0.segments.iter().enumerate() {
+                if i > 0 || self.0.leading_colon.is_some() {
+                    formatter.write_str("::")?;
+                }
+                write!(formatter, "{}", segment.ident)?;
+            }
+            Ok(())
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::attr::{AttrStyle, Attribute, MetaList, MetaNameValue};
+    use proc_macro2::TokenStream;
+    use quote::ToTokens;
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for Attribute {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.pound_token.to_tokens(tokens);
+            if let AttrStyle::Inner(b) = &self.style {
+                b.to_tokens(tokens);
+            }
+            self.bracket_token.surround(tokens, |tokens| {
+                self.meta.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for MetaList {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.path.to_tokens(tokens);
+            self.delimiter.surround(tokens, self.tokens.clone());
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for MetaNameValue {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.path.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.value.to_tokens(tokens);
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/bigint.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/bigint.rs
--- 43.0.0-1/rust-vendor/syn/src/bigint.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/bigint.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,66 @@
+use std::ops::{AddAssign, MulAssign};
+
+// For implementing base10_digits() accessor on LitInt.
+pub(crate) struct BigInt {
+    digits: Vec<u8>,
+}
+
+impl BigInt {
+    pub(crate) fn new() -> Self {
+        BigInt { digits: Vec::new() }
+    }
+
+    pub(crate) fn to_string(&self) -> String {
+        let mut repr = String::with_capacity(self.digits.len());
+
+        let mut has_nonzero = false;
+        for digit in self.digits.iter().rev() {
+            has_nonzero |= *digit != 0;
+            if has_nonzero {
+                repr.push((*digit + b'0') as char);
+            }
+        }
+
+        if repr.is_empty() {
+            repr.push('0');
+        }
+
+        repr
+    }
+
+    fn reserve_two_digits(&mut self) {
+        let len = self.digits.len();
+        let desired =
+            len + !self.digits.ends_with(&[0, 0]) as usize + !self.digits.ends_with(&[0]) as usize;
+        self.digits.resize(desired, 0);
+    }
+}
+
+impl AddAssign<u8> for BigInt {
+    // Assumes increment <16.
+    fn add_assign(&mut self, mut increment: u8) {
+        self.reserve_two_digits();
+
+        let mut i = 0;
+        while increment > 0 {
+            let sum = self.digits[i] + increment;
+            self.digits[i] = sum % 10;
+            increment = sum / 10;
+            i += 1;
+        }
+    }
+}
+
+impl MulAssign<u8> for BigInt {
+    // Assumes base <=16.
+    fn mul_assign(&mut self, base: u8) {
+        self.reserve_two_digits();
+
+        let mut carry = 0;
+        for digit in &mut self.digits {
+            let prod = *digit * base + carry;
+            *digit = prod % 10;
+            carry = prod / 10;
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/buffer.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/buffer.rs
--- 43.0.0-1/rust-vendor/syn/src/buffer.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/buffer.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,421 @@
+//! A stably addressed token buffer supporting efficient traversal based on a
+//! cheaply copyable cursor.
+
+// This module is heavily commented as it contains most of the unsafe code in
+// Syn, and caution should be used when editing it. The public-facing interface
+// is 100% safe but the implementation is fragile internally.
+
+use crate::Lifetime;
+use proc_macro2::extra::DelimSpan;
+use proc_macro2::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree};
+use std::cmp::Ordering;
+use std::marker::PhantomData;
+
+/// Internal type which is used instead of `TokenTree` to represent a token tree
+/// within a `TokenBuffer`.
+enum Entry {
+    // Mimicking types from proc-macro.
+    // Group entries contain the offset to the matching End entry.
+    Group(Group, usize),
+    Ident(Ident),
+    Punct(Punct),
+    Literal(Literal),
+    // End entries contain the offset (negative) to the start of the buffer, and
+    // offset (negative) to the matching Group entry.
+    End(isize, isize),
+}
+
+/// A buffer that can be efficiently traversed multiple times, unlike
+/// `TokenStream` which requires a deep copy in order to traverse more than
+/// once.
+pub struct TokenBuffer {
+    // NOTE: Do not implement clone on this - while the current design could be
+    // cloned, other designs which could be desirable may not be cloneable.
+    entries: Box<[Entry]>,
+}
+
+impl TokenBuffer {
+    fn recursive_new(entries: &mut Vec<Entry>, stream: TokenStream) {
+        for tt in stream {
+            match tt {
+                TokenTree::Ident(ident) => entries.push(Entry::Ident(ident)),
+                TokenTree::Punct(punct) => entries.push(Entry::Punct(punct)),
+                TokenTree::Literal(literal) => entries.push(Entry::Literal(literal)),
+                TokenTree::Group(group) => {
+                    let group_start_index = entries.len();
+                    entries.push(Entry::End(0, 0)); // we replace this below
+                    Self::recursive_new(entries, group.stream());
+                    let group_end_index = entries.len();
+                    let group_offset = group_end_index - group_start_index;
+                    entries.push(Entry::End(
+                        -(group_end_index as isize),
+                        -(group_offset as isize),
+                    ));
+                    entries[group_start_index] = Entry::Group(group, group_offset);
+                }
+            }
+        }
+    }
+
+    /// Creates a `TokenBuffer` containing all the tokens from the input
+    /// `proc_macro::TokenStream`.
+    #[cfg(feature = "proc-macro")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "proc-macro")))]
+    pub fn new(stream: proc_macro::TokenStream) -> Self {
+        Self::new2(stream.into())
+    }
+
+    /// Creates a `TokenBuffer` containing all the tokens from the input
+    /// `proc_macro2::TokenStream`.
+    pub fn new2(stream: TokenStream) -> Self {
+        let mut entries = Vec::new();
+        Self::recursive_new(&mut entries, stream);
+        entries.push(Entry::End(-(entries.len() as isize), 0));
+        Self {
+            entries: entries.into_boxed_slice(),
+        }
+    }
+
+    /// Creates a cursor referencing the first token in the buffer and able to
+    /// traverse until the end of the buffer.
+    pub fn begin(&self) -> Cursor {
+        let ptr = self.entries.as_ptr();
+        unsafe { Cursor::create(ptr, ptr.add(self.entries.len() - 1)) }
+    }
+}
+
+/// A cheaply copyable cursor into a `TokenBuffer`.
+///
+/// This cursor holds a shared reference into the immutable data which is used
+/// internally to represent a `TokenStream`, and can be efficiently manipulated
+/// and copied around.
+///
+/// An empty `Cursor` can be created directly, or one may create a `TokenBuffer`
+/// object and get a cursor to its first token with `begin()`.
+pub struct Cursor<'a> {
+    // The current entry which the `Cursor` is pointing at.
+    ptr: *const Entry,
+    // This is the only `Entry::End` object which this cursor is allowed to
+    // point at. All other `End` objects are skipped over in `Cursor::create`.
+    scope: *const Entry,
+    // Cursor is covariant in 'a. This field ensures that our pointers are still
+    // valid.
+    marker: PhantomData<&'a Entry>,
+}
+
+impl<'a> Cursor<'a> {
+    /// Creates a cursor referencing a static empty TokenStream.
+    pub fn empty() -> Self {
+        // It's safe in this situation for us to put an `Entry` object in global
+        // storage, despite it not actually being safe to send across threads
+        // (`Ident` is a reference into a thread-local table). This is because
+        // this entry never includes a `Ident` object.
+        //
+        // This wrapper struct allows us to break the rules and put a `Sync`
+        // object in global storage.
+        struct UnsafeSyncEntry(Entry);
+        unsafe impl Sync for UnsafeSyncEntry {}
+        static EMPTY_ENTRY: UnsafeSyncEntry = UnsafeSyncEntry(Entry::End(0, 0));
+
+        Cursor {
+            ptr: &EMPTY_ENTRY.0,
+            scope: &EMPTY_ENTRY.0,
+            marker: PhantomData,
+        }
+    }
+
+    /// This create method intelligently exits non-explicitly-entered
+    /// `None`-delimited scopes when the cursor reaches the end of them,
+    /// allowing for them to be treated transparently.
+    unsafe fn create(mut ptr: *const Entry, scope: *const Entry) -> Self {
+        // NOTE: If we're looking at a `End`, we want to advance the cursor
+        // past it, unless `ptr == scope`, which means that we're at the edge of
+        // our cursor's scope. We should only have `ptr != scope` at the exit
+        // from None-delimited groups entered with `ignore_none`.
+        while let Entry::End(..) = unsafe { &*ptr } {
+            if ptr == scope {
+                break;
+            }
+            ptr = unsafe { ptr.add(1) };
+        }
+
+        Cursor {
+            ptr,
+            scope,
+            marker: PhantomData,
+        }
+    }
+
+    /// Get the current entry.
+    fn entry(self) -> &'a Entry {
+        unsafe { &*self.ptr }
+    }
+
+    /// Bump the cursor to point at the next token after the current one. This
+    /// is undefined behavior if the cursor is currently looking at an
+    /// `Entry::End`.
+    ///
+    /// If the cursor is looking at an `Entry::Group`, the bumped cursor will
+    /// point at the first token in the group (with the same scope end).
+    unsafe fn bump_ignore_group(self) -> Cursor<'a> {
+        unsafe { Cursor::create(self.ptr.offset(1), self.scope) }
+    }
+
+    /// While the cursor is looking at a `None`-delimited group, move it to look
+    /// at the first token inside instead. If the group is empty, this will move
+    /// the cursor past the `None`-delimited group.
+    ///
+    /// WARNING: This mutates its argument.
+    fn ignore_none(&mut self) {
+        while let Entry::Group(group, _) = self.entry() {
+            if group.delimiter() == Delimiter::None {
+                unsafe { *self = self.bump_ignore_group() };
+            } else {
+                break;
+            }
+        }
+    }
+
+    /// Checks whether the cursor is currently pointing at the end of its valid
+    /// scope.
+    pub fn eof(self) -> bool {
+        // We're at eof if we're at the end of our scope.
+        self.ptr == self.scope
+    }
+
+    /// If the cursor is pointing at a `Group` with the given delimiter, returns
+    /// a cursor into that group and one pointing to the next `TokenTree`.
+    pub fn group(mut self, delim: Delimiter) -> Option<(Cursor<'a>, DelimSpan, Cursor<'a>)> {
+        // If we're not trying to enter a none-delimited group, we want to
+        // ignore them. We have to make sure to _not_ ignore them when we want
+        // to enter them, of course. For obvious reasons.
+        if delim != Delimiter::None {
+            self.ignore_none();
+        }
+
+        if let Entry::Group(group, end_offset) = self.entry() {
+            if group.delimiter() == delim {
+                let span = group.delim_span();
+                let end_of_group = unsafe { self.ptr.add(*end_offset) };
+                let inside_of_group = unsafe { Cursor::create(self.ptr.add(1), end_of_group) };
+                let after_group = unsafe { Cursor::create(end_of_group, self.scope) };
+                return Some((inside_of_group, span, after_group));
+            }
+        }
+
+        None
+    }
+
+    pub(crate) fn any_group(self) -> Option<(Cursor<'a>, Delimiter, DelimSpan, Cursor<'a>)> {
+        if let Entry::Group(group, end_offset) = self.entry() {
+            let delimiter = group.delimiter();
+            let span = group.delim_span();
+            let end_of_group = unsafe { self.ptr.add(*end_offset) };
+            let inside_of_group = unsafe { Cursor::create(self.ptr.add(1), end_of_group) };
+            let after_group = unsafe { Cursor::create(end_of_group, self.scope) };
+            return Some((inside_of_group, delimiter, span, after_group));
+        }
+
+        None
+    }
+
+    pub(crate) fn any_group_token(self) -> Option<(Group, Cursor<'a>)> {
+        if let Entry::Group(group, end_offset) = self.entry() {
+            let end_of_group = unsafe { self.ptr.add(*end_offset) };
+            let after_group = unsafe { Cursor::create(end_of_group, self.scope) };
+            return Some((group.clone(), after_group));
+        }
+
+        None
+    }
+
+    /// If the cursor is pointing at a `Ident`, returns it along with a cursor
+    /// pointing at the next `TokenTree`.
+    pub fn ident(mut self) -> Option<(Ident, Cursor<'a>)> {
+        self.ignore_none();
+        match self.entry() {
+            Entry::Ident(ident) => Some((ident.clone(), unsafe { self.bump_ignore_group() })),
+            _ => None,
+        }
+    }
+
+    /// If the cursor is pointing at a `Punct`, returns it along with a cursor
+    /// pointing at the next `TokenTree`.
+    pub fn punct(mut self) -> Option<(Punct, Cursor<'a>)> {
+        self.ignore_none();
+        match self.entry() {
+            Entry::Punct(punct) if punct.as_char() != '\'' => {
+                Some((punct.clone(), unsafe { self.bump_ignore_group() }))
+            }
+            _ => None,
+        }
+    }
+
+    /// If the cursor is pointing at a `Literal`, return it along with a cursor
+    /// pointing at the next `TokenTree`.
+    pub fn literal(mut self) -> Option<(Literal, Cursor<'a>)> {
+        self.ignore_none();
+        match self.entry() {
+            Entry::Literal(literal) => Some((literal.clone(), unsafe { self.bump_ignore_group() })),
+            _ => None,
+        }
+    }
+
+    /// If the cursor is pointing at a `Lifetime`, returns it along with a
+    /// cursor pointing at the next `TokenTree`.
+    pub fn lifetime(mut self) -> Option<(Lifetime, Cursor<'a>)> {
+        self.ignore_none();
+        match self.entry() {
+            Entry::Punct(punct) if punct.as_char() == '\'' && punct.spacing() == Spacing::Joint => {
+                let next = unsafe { self.bump_ignore_group() };
+                let (ident, rest) = next.ident()?;
+                let lifetime = Lifetime {
+                    apostrophe: punct.span(),
+                    ident,
+                };
+                Some((lifetime, rest))
+            }
+            _ => None,
+        }
+    }
+
+    /// Copies all remaining tokens visible from this cursor into a
+    /// `TokenStream`.
+    pub fn token_stream(self) -> TokenStream {
+        let mut tts = Vec::new();
+        let mut cursor = self;
+        while let Some((tt, rest)) = cursor.token_tree() {
+            tts.push(tt);
+            cursor = rest;
+        }
+        tts.into_iter().collect()
+    }
+
+    /// If the cursor is pointing at a `TokenTree`, returns it along with a
+    /// cursor pointing at the next `TokenTree`.
+    ///
+    /// Returns `None` if the cursor has reached the end of its stream.
+    ///
+    /// This method does not treat `None`-delimited groups as transparent, and
+    /// will return a `Group(None, ..)` if the cursor is looking at one.
+    pub fn token_tree(self) -> Option<(TokenTree, Cursor<'a>)> {
+        let (tree, len) = match self.entry() {
+            Entry::Group(group, end_offset) => (group.clone().into(), *end_offset),
+            Entry::Literal(literal) => (literal.clone().into(), 1),
+            Entry::Ident(ident) => (ident.clone().into(), 1),
+            Entry::Punct(punct) => (punct.clone().into(), 1),
+            Entry::End(..) => return None,
+        };
+
+        let rest = unsafe { Cursor::create(self.ptr.add(len), self.scope) };
+        Some((tree, rest))
+    }
+
+    /// Returns the `Span` of the current token, or `Span::call_site()` if this
+    /// cursor points to eof.
+    pub fn span(mut self) -> Span {
+        match self.entry() {
+            Entry::Group(group, _) => group.span(),
+            Entry::Literal(literal) => literal.span(),
+            Entry::Ident(ident) => ident.span(),
+            Entry::Punct(punct) => punct.span(),
+            Entry::End(_, offset) => {
+                self.ptr = unsafe { self.ptr.offset(*offset) };
+                if let Entry::Group(group, _) = self.entry() {
+                    group.span_close()
+                } else {
+                    Span::call_site()
+                }
+            }
+        }
+    }
+
+    /// Returns the `Span` of the token immediately prior to the position of
+    /// this cursor, or of the current token if there is no previous one.
+    #[cfg(any(feature = "full", feature = "derive"))]
+    pub(crate) fn prev_span(mut self) -> Span {
+        if start_of_buffer(self) < self.ptr {
+            self.ptr = unsafe { self.ptr.offset(-1) };
+        }
+        self.span()
+    }
+
+    /// Skip over the next token that is not a None-delimited group, without
+    /// cloning it. Returns `None` if this cursor points to eof.
+    ///
+    /// This method treats `'lifetimes` as a single token.
+    pub(crate) fn skip(mut self) -> Option<Cursor<'a>> {
+        self.ignore_none();
+
+        let len = match self.entry() {
+            Entry::End(..) => return None,
+
+            // Treat lifetimes as a single tt for the purposes of 'skip'.
+            Entry::Punct(punct) if punct.as_char() == '\'' && punct.spacing() == Spacing::Joint => {
+                match unsafe { &*self.ptr.add(1) } {
+                    Entry::Ident(_) => 2,
+                    _ => 1,
+                }
+            }
+
+            Entry::Group(_, end_offset) => *end_offset,
+            _ => 1,
+        };
+
+        Some(unsafe { Cursor::create(self.ptr.add(len), self.scope) })
+    }
+}
+
+impl<'a> Copy for Cursor<'a> {}
+
+impl<'a> Clone for Cursor<'a> {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+impl<'a> Eq for Cursor<'a> {}
+
+impl<'a> PartialEq for Cursor<'a> {
+    fn eq(&self, other: &Self) -> bool {
+        self.ptr == other.ptr
+    }
+}
+
+impl<'a> PartialOrd for Cursor<'a> {
+    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
+        if same_buffer(*self, *other) {
+            Some(cmp_assuming_same_buffer(*self, *other))
+        } else {
+            None
+        }
+    }
+}
+
+pub(crate) fn same_scope(a: Cursor, b: Cursor) -> bool {
+    a.scope == b.scope
+}
+
+pub(crate) fn same_buffer(a: Cursor, b: Cursor) -> bool {
+    start_of_buffer(a) == start_of_buffer(b)
+}
+
+fn start_of_buffer(cursor: Cursor) -> *const Entry {
+    unsafe {
+        match &*cursor.scope {
+            Entry::End(offset, _) => cursor.scope.offset(*offset),
+            _ => unreachable!(),
+        }
+    }
+}
+
+pub(crate) fn cmp_assuming_same_buffer(a: Cursor, b: Cursor) -> Ordering {
+    a.ptr.cmp(&b.ptr)
+}
+
+pub(crate) fn open_span_of_group(cursor: Cursor) -> Span {
+    match cursor.entry() {
+        Entry::Group(group, _) => group.span_open(),
+        _ => cursor.span(),
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/classify.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/classify.rs
--- 43.0.0-1/rust-vendor/syn/src/classify.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/classify.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,389 @@
+#[cfg(feature = "full")]
+use crate::expr::Expr;
+#[cfg(any(feature = "printing", feature = "full"))]
+use crate::generics::TypeParamBound;
+#[cfg(any(feature = "printing", feature = "full"))]
+use crate::path::{Path, PathArguments};
+#[cfg(any(feature = "printing", feature = "full"))]
+use crate::punctuated::Punctuated;
+#[cfg(any(feature = "printing", feature = "full"))]
+use crate::ty::{ReturnType, Type};
+#[cfg(feature = "full")]
+use proc_macro2::{Delimiter, TokenStream, TokenTree};
+#[cfg(any(feature = "printing", feature = "full"))]
+use std::ops::ControlFlow;
+
+#[cfg(feature = "full")]
+pub(crate) fn requires_semi_to_be_stmt(expr: &Expr) -> bool {
+    match expr {
+        Expr::Macro(expr) => !expr.mac.delimiter.is_brace(),
+        _ => requires_comma_to_be_match_arm(expr),
+    }
+}
+
+#[cfg(feature = "full")]
+pub(crate) fn requires_comma_to_be_match_arm(expr: &Expr) -> bool {
+    match expr {
+        Expr::If(_)
+        | Expr::Match(_)
+        | Expr::Block(_) | Expr::Unsafe(_) // both under ExprKind::Block in rustc
+        | Expr::While(_)
+        | Expr::Loop(_)
+        | Expr::ForLoop(_)
+        | Expr::TryBlock(_)
+        | Expr::Const(_) => false,
+
+        Expr::Array(_)
+        | Expr::Assign(_)
+        | Expr::Async(_)
+        | Expr::Await(_)
+        | Expr::Binary(_)
+        | Expr::Break(_)
+        | Expr::Call(_)
+        | Expr::Cast(_)
+        | Expr::Closure(_)
+        | Expr::Continue(_)
+        | Expr::Field(_)
+        | Expr::Group(_)
+        | Expr::Index(_)
+        | Expr::Infer(_)
+        | Expr::Let(_)
+        | Expr::Lit(_)
+        | Expr::Macro(_)
+        | Expr::MethodCall(_)
+        | Expr::Paren(_)
+        | Expr::Path(_)
+        | Expr::Range(_)
+        | Expr::Reference(_)
+        | Expr::Repeat(_)
+        | Expr::Return(_)
+        | Expr::Struct(_)
+        | Expr::Try(_)
+        | Expr::Tuple(_)
+        | Expr::Unary(_)
+        | Expr::Yield(_)
+        | Expr::Verbatim(_) => true
+    }
+}
+
+#[cfg(all(feature = "printing", feature = "full"))]
+pub(crate) fn confusable_with_adjacent_block(mut expr: &Expr) -> bool {
+    let mut stack = Vec::new();
+
+    while let Some(next) = match expr {
+        Expr::Assign(e) => {
+            stack.push(&e.right);
+            Some(&e.left)
+        }
+        Expr::Await(e) => Some(&e.base),
+        Expr::Binary(e) => {
+            stack.push(&e.right);
+            Some(&e.left)
+        }
+        Expr::Break(e) => {
+            if let Some(Expr::Block(_)) = e.expr.as_deref() {
+                return true;
+            }
+            stack.pop()
+        }
+        Expr::Call(e) => Some(&e.func),
+        Expr::Cast(e) => Some(&e.expr),
+        Expr::Closure(e) => Some(&e.body),
+        Expr::Field(e) => Some(&e.base),
+        Expr::Index(e) => Some(&e.expr),
+        Expr::MethodCall(e) => Some(&e.receiver),
+        Expr::Range(e) => {
+            if let Some(Expr::Block(_)) = e.end.as_deref() {
+                return true;
+            }
+            match (&e.start, &e.end) {
+                (Some(start), end) => {
+                    stack.extend(end);
+                    Some(start)
+                }
+                (None, Some(end)) => Some(end),
+                (None, None) => stack.pop(),
+            }
+        }
+        Expr::Reference(e) => Some(&e.expr),
+        Expr::Return(e) => {
+            if e.expr.is_none() && stack.is_empty() {
+                return true;
+            }
+            stack.pop()
+        }
+        Expr::Struct(_) => return true,
+        Expr::Try(e) => Some(&e.expr),
+        Expr::Unary(e) => Some(&e.expr),
+        Expr::Yield(e) => {
+            if e.expr.is_none() && stack.is_empty() {
+                return true;
+            }
+            stack.pop()
+        }
+
+        Expr::Array(_)
+        | Expr::Async(_)
+        | Expr::Block(_)
+        | Expr::Const(_)
+        | Expr::Continue(_)
+        | Expr::ForLoop(_)
+        | Expr::Group(_)
+        | Expr::If(_)
+        | Expr::Infer(_)
+        | Expr::Let(_)
+        | Expr::Lit(_)
+        | Expr::Loop(_)
+        | Expr::Macro(_)
+        | Expr::Match(_)
+        | Expr::Paren(_)
+        | Expr::Path(_)
+        | Expr::Repeat(_)
+        | Expr::TryBlock(_)
+        | Expr::Tuple(_)
+        | Expr::Unsafe(_)
+        | Expr::Verbatim(_)
+        | Expr::While(_) => stack.pop(),
+    } {
+        expr = next;
+    }
+
+    false
+}
+
+#[cfg(feature = "printing")]
+pub(crate) fn trailing_unparameterized_path(mut ty: &Type) -> bool {
+    loop {
+        match ty {
+            Type::BareFn(t) => match &t.output {
+                ReturnType::Default => return false,
+                ReturnType::Type(_, ret) => ty = ret,
+            },
+            Type::ImplTrait(t) => match last_type_in_bounds(&t.bounds) {
+                ControlFlow::Break(trailing_path) => return trailing_path,
+                ControlFlow::Continue(t) => ty = t,
+            },
+            Type::Path(t) => match last_type_in_path(&t.path) {
+                ControlFlow::Break(trailing_path) => return trailing_path,
+                ControlFlow::Continue(t) => ty = t,
+            },
+            Type::Ptr(t) => ty = &t.elem,
+            Type::Reference(t) => ty = &t.elem,
+            Type::TraitObject(t) => match last_type_in_bounds(&t.bounds) {
+                ControlFlow::Break(trailing_path) => return trailing_path,
+                ControlFlow::Continue(t) => ty = t,
+            },
+
+            Type::Array(_)
+            | Type::Group(_)
+            | Type::Infer(_)
+            | Type::Macro(_)
+            | Type::Never(_)
+            | Type::Paren(_)
+            | Type::Slice(_)
+            | Type::Tuple(_)
+            | Type::Verbatim(_) => return false,
+        }
+    }
+
+    fn last_type_in_path(path: &Path) -> ControlFlow<bool, &Type> {
+        match &path.segments.last().unwrap().arguments {
+            PathArguments::None => ControlFlow::Break(true),
+            PathArguments::AngleBracketed(_) => ControlFlow::Break(false),
+            PathArguments::Parenthesized(arg) => match &arg.output {
+                ReturnType::Default => ControlFlow::Break(false),
+                ReturnType::Type(_, ret) => ControlFlow::Continue(ret),
+            },
+        }
+    }
+
+    fn last_type_in_bounds(
+        bounds: &Punctuated<TypeParamBound, Token![+]>,
+    ) -> ControlFlow<bool, &Type> {
+        match bounds.last().unwrap() {
+            TypeParamBound::Trait(t) => last_type_in_path(&t.path),
+            TypeParamBound::Lifetime(_) | TypeParamBound::Verbatim(_) => ControlFlow::Break(false),
+        }
+    }
+}
+
+/// Whether the expression's first token is the label of a loop/block.
+#[cfg(all(feature = "printing", feature = "full"))]
+pub(crate) fn expr_leading_label(mut expr: &Expr) -> bool {
+    loop {
+        match expr {
+            Expr::Block(e) => return e.label.is_some(),
+            Expr::ForLoop(e) => return e.label.is_some(),
+            Expr::Loop(e) => return e.label.is_some(),
+            Expr::While(e) => return e.label.is_some(),
+
+            Expr::Assign(e) => expr = &e.left,
+            Expr::Await(e) => expr = &e.base,
+            Expr::Binary(e) => expr = &e.left,
+            Expr::Call(e) => expr = &e.func,
+            Expr::Cast(e) => expr = &e.expr,
+            Expr::Field(e) => expr = &e.base,
+            Expr::Index(e) => expr = &e.expr,
+            Expr::MethodCall(e) => expr = &e.receiver,
+            Expr::Range(e) => match &e.start {
+                Some(start) => expr = start,
+                None => return false,
+            },
+            Expr::Try(e) => expr = &e.expr,
+
+            Expr::Array(_)
+            | Expr::Async(_)
+            | Expr::Break(_)
+            | Expr::Closure(_)
+            | Expr::Const(_)
+            | Expr::Continue(_)
+            | Expr::Group(_)
+            | Expr::If(_)
+            | Expr::Infer(_)
+            | Expr::Let(_)
+            | Expr::Lit(_)
+            | Expr::Macro(_)
+            | Expr::Match(_)
+            | Expr::Paren(_)
+            | Expr::Path(_)
+            | Expr::Reference(_)
+            | Expr::Repeat(_)
+            | Expr::Return(_)
+            | Expr::Struct(_)
+            | Expr::TryBlock(_)
+            | Expr::Tuple(_)
+            | Expr::Unary(_)
+            | Expr::Unsafe(_)
+            | Expr::Verbatim(_)
+            | Expr::Yield(_) => return false,
+        }
+    }
+}
+
+/// Whether the expression's last token is `}`.
+#[cfg(feature = "full")]
+pub(crate) fn expr_trailing_brace(mut expr: &Expr) -> bool {
+    loop {
+        match expr {
+            Expr::Async(_)
+            | Expr::Block(_)
+            | Expr::Const(_)
+            | Expr::ForLoop(_)
+            | Expr::If(_)
+            | Expr::Loop(_)
+            | Expr::Match(_)
+            | Expr::Struct(_)
+            | Expr::TryBlock(_)
+            | Expr::Unsafe(_)
+            | Expr::While(_) => return true,
+
+            Expr::Assign(e) => expr = &e.right,
+            Expr::Binary(e) => expr = &e.right,
+            Expr::Break(e) => match &e.expr {
+                Some(e) => expr = e,
+                None => return false,
+            },
+            Expr::Cast(e) => return type_trailing_brace(&e.ty),
+            Expr::Closure(e) => expr = &e.body,
+            Expr::Let(e) => expr = &e.expr,
+            Expr::Macro(e) => return e.mac.delimiter.is_brace(),
+            Expr::Range(e) => match &e.end {
+                Some(end) => expr = end,
+                None => return false,
+            },
+            Expr::Reference(e) => expr = &e.expr,
+            Expr::Return(e) => match &e.expr {
+                Some(e) => expr = e,
+                None => return false,
+            },
+            Expr::Unary(e) => expr = &e.expr,
+            Expr::Verbatim(e) => return tokens_trailing_brace(e),
+            Expr::Yield(e) => match &e.expr {
+                Some(e) => expr = e,
+                None => return false,
+            },
+
+            Expr::Array(_)
+            | Expr::Await(_)
+            | Expr::Call(_)
+            | Expr::Continue(_)
+            | Expr::Field(_)
+            | Expr::Group(_)
+            | Expr::Index(_)
+            | Expr::Infer(_)
+            | Expr::Lit(_)
+            | Expr::MethodCall(_)
+            | Expr::Paren(_)
+            | Expr::Path(_)
+            | Expr::Repeat(_)
+            | Expr::Try(_)
+            | Expr::Tuple(_) => return false,
+        }
+    }
+
+    fn type_trailing_brace(mut ty: &Type) -> bool {
+        loop {
+            match ty {
+                Type::BareFn(t) => match &t.output {
+                    ReturnType::Default => return false,
+                    ReturnType::Type(_, ret) => ty = ret,
+                },
+                Type::ImplTrait(t) => match last_type_in_bounds(&t.bounds) {
+                    ControlFlow::Break(trailing_brace) => return trailing_brace,
+                    ControlFlow::Continue(t) => ty = t,
+                },
+                Type::Macro(t) => return t.mac.delimiter.is_brace(),
+                Type::Path(t) => match last_type_in_path(&t.path) {
+                    Some(t) => ty = t,
+                    None => return false,
+                },
+                Type::Ptr(t) => ty = &t.elem,
+                Type::Reference(t) => ty = &t.elem,
+                Type::TraitObject(t) => match last_type_in_bounds(&t.bounds) {
+                    ControlFlow::Break(trailing_brace) => return trailing_brace,
+                    ControlFlow::Continue(t) => ty = t,
+                },
+                Type::Verbatim(t) => return tokens_trailing_brace(t),
+
+                Type::Array(_)
+                | Type::Group(_)
+                | Type::Infer(_)
+                | Type::Never(_)
+                | Type::Paren(_)
+                | Type::Slice(_)
+                | Type::Tuple(_) => return false,
+            }
+        }
+    }
+
+    fn last_type_in_path(path: &Path) -> Option<&Type> {
+        match &path.segments.last().unwrap().arguments {
+            PathArguments::None | PathArguments::AngleBracketed(_) => None,
+            PathArguments::Parenthesized(arg) => match &arg.output {
+                ReturnType::Default => None,
+                ReturnType::Type(_, ret) => Some(ret),
+            },
+        }
+    }
+
+    fn last_type_in_bounds(
+        bounds: &Punctuated<TypeParamBound, Token![+]>,
+    ) -> ControlFlow<bool, &Type> {
+        match bounds.last().unwrap() {
+            TypeParamBound::Trait(t) => match last_type_in_path(&t.path) {
+                Some(t) => ControlFlow::Continue(t),
+                None => ControlFlow::Break(false),
+            },
+            TypeParamBound::Lifetime(_) => ControlFlow::Break(false),
+            TypeParamBound::Verbatim(t) => ControlFlow::Break(tokens_trailing_brace(t)),
+        }
+    }
+
+    fn tokens_trailing_brace(tokens: &TokenStream) -> bool {
+        if let Some(TokenTree::Group(last)) = tokens.clone().into_iter().last() {
+            last.delimiter() == Delimiter::Brace
+        } else {
+            false
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/custom_keyword.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/custom_keyword.rs
--- 43.0.0-1/rust-vendor/syn/src/custom_keyword.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/custom_keyword.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,260 @@
+/// Define a type that supports parsing and printing a given identifier as if it
+/// were a keyword.
+///
+/// # Usage
+///
+/// As a convention, it is recommended that this macro be invoked within a
+/// module called `kw` or `keyword` and that the resulting parser be invoked
+/// with a `kw::` or `keyword::` prefix.
+///
+/// ```
+/// mod kw {
+///     syn::custom_keyword!(whatever);
+/// }
+/// ```
+///
+/// The generated syntax tree node supports the following operations just like
+/// any built-in keyword token.
+///
+/// - [Peeking] — `input.peek(kw::whatever)`
+///
+/// - [Parsing] — `input.parse::<kw::whatever>()?`
+///
+/// - [Printing] — `quote!( ... #whatever_token ... )`
+///
+/// - Construction from a [`Span`] — `let whatever_token = kw::whatever(sp)`
+///
+/// - Field access to its span — `let sp = whatever_token.span`
+///
+/// [Peeking]: crate::parse::ParseBuffer::peek
+/// [Parsing]: crate::parse::ParseBuffer::parse
+/// [Printing]: quote::ToTokens
+/// [`Span`]: proc_macro2::Span
+///
+/// # Example
+///
+/// This example parses input that looks like `bool = true` or `str = "value"`.
+/// The key must be either the identifier `bool` or the identifier `str`. If
+/// `bool`, the value may be either `true` or `false`. If `str`, the value may
+/// be any string literal.
+///
+/// The symbols `bool` and `str` are not reserved keywords in Rust so these are
+/// not considered keywords in the `syn::token` module. Like any other
+/// identifier that is not a keyword, these can be declared as custom keywords
+/// by crates that need to use them as such.
+///
+/// ```
+/// use syn::{LitBool, LitStr, Result, Token};
+/// use syn::parse::{Parse, ParseStream};
+///
+/// mod kw {
+///     syn::custom_keyword!(bool);
+///     syn::custom_keyword!(str);
+/// }
+///
+/// enum Argument {
+///     Bool {
+///         bool_token: kw::bool,
+///         eq_token: Token![=],
+///         value: LitBool,
+///     },
+///     Str {
+///         str_token: kw::str,
+///         eq_token: Token![=],
+///         value: LitStr,
+///     },
+/// }
+///
+/// impl Parse for Argument {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         let lookahead = input.lookahead1();
+///         if lookahead.peek(kw::bool) {
+///             Ok(Argument::Bool {
+///                 bool_token: input.parse::<kw::bool>()?,
+///                 eq_token: input.parse()?,
+///                 value: input.parse()?,
+///             })
+///         } else if lookahead.peek(kw::str) {
+///             Ok(Argument::Str {
+///                 str_token: input.parse::<kw::str>()?,
+///                 eq_token: input.parse()?,
+///                 value: input.parse()?,
+///             })
+///         } else {
+///             Err(lookahead.error())
+///         }
+///     }
+/// }
+/// ```
+#[macro_export]
+macro_rules! custom_keyword {
+    ($ident:ident) => {
+        #[allow(non_camel_case_types)]
+        pub struct $ident {
+            #[allow(dead_code)]
+            pub span: $crate::__private::Span,
+        }
+
+        #[doc(hidden)]
+        #[allow(dead_code, non_snake_case)]
+        pub fn $ident<__S: $crate::__private::IntoSpans<$crate::__private::Span>>(
+            span: __S,
+        ) -> $ident {
+            $ident {
+                span: $crate::__private::IntoSpans::into_spans(span),
+            }
+        }
+
+        const _: () = {
+            impl $crate::__private::Default for $ident {
+                fn default() -> Self {
+                    $ident {
+                        span: $crate::__private::Span::call_site(),
+                    }
+                }
+            }
+
+            $crate::impl_parse_for_custom_keyword!($ident);
+            $crate::impl_to_tokens_for_custom_keyword!($ident);
+            $crate::impl_clone_for_custom_keyword!($ident);
+            $crate::impl_extra_traits_for_custom_keyword!($ident);
+        };
+    };
+}
+
+// Not public API.
+#[cfg(feature = "parsing")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_parse_for_custom_keyword {
+    ($ident:ident) => {
+        // For peek.
+        impl $crate::__private::CustomToken for $ident {
+            fn peek(cursor: $crate::buffer::Cursor) -> $crate::__private::bool {
+                if let $crate::__private::Some((ident, _rest)) = cursor.ident() {
+                    ident == $crate::__private::stringify!($ident)
+                } else {
+                    false
+                }
+            }
+
+            fn display() -> &'static $crate::__private::str {
+                $crate::__private::concat!("`", $crate::__private::stringify!($ident), "`")
+            }
+        }
+
+        impl $crate::parse::Parse for $ident {
+            fn parse(input: $crate::parse::ParseStream) -> $crate::parse::Result<$ident> {
+                input.step(|cursor| {
+                    if let $crate::__private::Some((ident, rest)) = cursor.ident() {
+                        if ident == $crate::__private::stringify!($ident) {
+                            return $crate::__private::Ok(($ident { span: ident.span() }, rest));
+                        }
+                    }
+                    $crate::__private::Err(cursor.error($crate::__private::concat!(
+                        "expected `",
+                        $crate::__private::stringify!($ident),
+                        "`",
+                    )))
+                })
+            }
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "parsing"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_parse_for_custom_keyword {
+    ($ident:ident) => {};
+}
+
+// Not public API.
+#[cfg(feature = "printing")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_to_tokens_for_custom_keyword {
+    ($ident:ident) => {
+        impl $crate::__private::ToTokens for $ident {
+            fn to_tokens(&self, tokens: &mut $crate::__private::TokenStream2) {
+                let ident = $crate::Ident::new($crate::__private::stringify!($ident), self.span);
+                $crate::__private::TokenStreamExt::append(tokens, ident);
+            }
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "printing"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_to_tokens_for_custom_keyword {
+    ($ident:ident) => {};
+}
+
+// Not public API.
+#[cfg(feature = "clone-impls")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_clone_for_custom_keyword {
+    ($ident:ident) => {
+        impl $crate::__private::Copy for $ident {}
+
+        #[allow(clippy::expl_impl_clone_on_copy)]
+        impl $crate::__private::Clone for $ident {
+            fn clone(&self) -> Self {
+                *self
+            }
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "clone-impls"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_clone_for_custom_keyword {
+    ($ident:ident) => {};
+}
+
+// Not public API.
+#[cfg(feature = "extra-traits")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_extra_traits_for_custom_keyword {
+    ($ident:ident) => {
+        impl $crate::__private::Debug for $ident {
+            fn fmt(&self, f: &mut $crate::__private::Formatter) -> $crate::__private::FmtResult {
+                $crate::__private::Formatter::write_str(
+                    f,
+                    $crate::__private::concat!(
+                        "Keyword [",
+                        $crate::__private::stringify!($ident),
+                        "]",
+                    ),
+                )
+            }
+        }
+
+        impl $crate::__private::Eq for $ident {}
+
+        impl $crate::__private::PartialEq for $ident {
+            fn eq(&self, _other: &Self) -> $crate::__private::bool {
+                true
+            }
+        }
+
+        impl $crate::__private::Hash for $ident {
+            fn hash<__H: $crate::__private::Hasher>(&self, _state: &mut __H) {}
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "extra-traits"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_extra_traits_for_custom_keyword {
+    ($ident:ident) => {};
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/custom_punctuation.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/custom_punctuation.rs
--- 43.0.0-1/rust-vendor/syn/src/custom_punctuation.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/custom_punctuation.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,304 @@
+/// Define a type that supports parsing and printing a multi-character symbol
+/// as if it were a punctuation token.
+///
+/// # Usage
+///
+/// ```
+/// syn::custom_punctuation!(LeftRightArrow, <=>);
+/// ```
+///
+/// The generated syntax tree node supports the following operations just like
+/// any built-in punctuation token.
+///
+/// - [Peeking] — `input.peek(LeftRightArrow)`
+///
+/// - [Parsing] — `input.parse::<LeftRightArrow>()?`
+///
+/// - [Printing] — `quote!( ... #lrarrow ... )`
+///
+/// - Construction from a [`Span`] — `let lrarrow = LeftRightArrow(sp)`
+///
+/// - Construction from multiple [`Span`] — `let lrarrow = LeftRightArrow([sp, sp, sp])`
+///
+/// - Field access to its spans — `let spans = lrarrow.spans`
+///
+/// [Peeking]: crate::parse::ParseBuffer::peek
+/// [Parsing]: crate::parse::ParseBuffer::parse
+/// [Printing]: quote::ToTokens
+/// [`Span`]: proc_macro2::Span
+///
+/// # Example
+///
+/// ```
+/// use proc_macro2::{TokenStream, TokenTree};
+/// use syn::parse::{Parse, ParseStream, Peek, Result};
+/// use syn::punctuated::Punctuated;
+/// use syn::Expr;
+///
+/// syn::custom_punctuation!(PathSeparator, </>);
+///
+/// // expr </> expr </> expr ...
+/// struct PathSegments {
+///     segments: Punctuated<Expr, PathSeparator>,
+/// }
+///
+/// impl Parse for PathSegments {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         let mut segments = Punctuated::new();
+///
+///         let first = parse_until(input, PathSeparator)?;
+///         segments.push_value(syn::parse2(first)?);
+///
+///         while input.peek(PathSeparator) {
+///             segments.push_punct(input.parse()?);
+///
+///             let next = parse_until(input, PathSeparator)?;
+///             segments.push_value(syn::parse2(next)?);
+///         }
+///
+///         Ok(PathSegments { segments })
+///     }
+/// }
+///
+/// fn parse_until<E: Peek>(input: ParseStream, end: E) -> Result<TokenStream> {
+///     let mut tokens = TokenStream::new();
+///     while !input.is_empty() && !input.peek(end) {
+///         let next: TokenTree = input.parse()?;
+///         tokens.extend(Some(next));
+///     }
+///     Ok(tokens)
+/// }
+///
+/// fn main() {
+///     let input = r#" a::b </> c::d::e "#;
+///     let _: PathSegments = syn::parse_str(input).unwrap();
+/// }
+/// ```
+#[macro_export]
+macro_rules! custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {
+        pub struct $ident {
+            #[allow(dead_code)]
+            pub spans: $crate::custom_punctuation_repr!($($tt)+),
+        }
+
+        #[doc(hidden)]
+        #[allow(dead_code, non_snake_case)]
+        pub fn $ident<__S: $crate::__private::IntoSpans<$crate::custom_punctuation_repr!($($tt)+)>>(
+            spans: __S,
+        ) -> $ident {
+            let _validate_len = 0 $(+ $crate::custom_punctuation_len!(strict, $tt))*;
+            $ident {
+                spans: $crate::__private::IntoSpans::into_spans(spans)
+            }
+        }
+
+        const _: () = {
+            impl $crate::__private::Default for $ident {
+                fn default() -> Self {
+                    $ident($crate::__private::Span::call_site())
+                }
+            }
+
+            $crate::impl_parse_for_custom_punctuation!($ident, $($tt)+);
+            $crate::impl_to_tokens_for_custom_punctuation!($ident, $($tt)+);
+            $crate::impl_clone_for_custom_punctuation!($ident, $($tt)+);
+            $crate::impl_extra_traits_for_custom_punctuation!($ident, $($tt)+);
+        };
+    };
+}
+
+// Not public API.
+#[cfg(feature = "parsing")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_parse_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {
+        impl $crate::__private::CustomToken for $ident {
+            fn peek(cursor: $crate::buffer::Cursor) -> $crate::__private::bool {
+                $crate::__private::peek_punct(cursor, $crate::stringify_punct!($($tt)+))
+            }
+
+            fn display() -> &'static $crate::__private::str {
+                $crate::__private::concat!("`", $crate::stringify_punct!($($tt)+), "`")
+            }
+        }
+
+        impl $crate::parse::Parse for $ident {
+            fn parse(input: $crate::parse::ParseStream) -> $crate::parse::Result<$ident> {
+                let spans: $crate::custom_punctuation_repr!($($tt)+) =
+                    $crate::__private::parse_punct(input, $crate::stringify_punct!($($tt)+))?;
+                Ok($ident(spans))
+            }
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "parsing"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_parse_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {};
+}
+
+// Not public API.
+#[cfg(feature = "printing")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_to_tokens_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {
+        impl $crate::__private::ToTokens for $ident {
+            fn to_tokens(&self, tokens: &mut $crate::__private::TokenStream2) {
+                $crate::__private::print_punct($crate::stringify_punct!($($tt)+), &self.spans, tokens)
+            }
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "printing"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_to_tokens_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {};
+}
+
+// Not public API.
+#[cfg(feature = "clone-impls")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_clone_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {
+        impl $crate::__private::Copy for $ident {}
+
+        #[allow(clippy::expl_impl_clone_on_copy)]
+        impl $crate::__private::Clone for $ident {
+            fn clone(&self) -> Self {
+                *self
+            }
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "clone-impls"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_clone_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {};
+}
+
+// Not public API.
+#[cfg(feature = "extra-traits")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_extra_traits_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {
+        impl $crate::__private::Debug for $ident {
+            fn fmt(&self, f: &mut $crate::__private::Formatter) -> $crate::__private::FmtResult {
+                $crate::__private::Formatter::write_str(f, $crate::__private::stringify!($ident))
+            }
+        }
+
+        impl $crate::__private::Eq for $ident {}
+
+        impl $crate::__private::PartialEq for $ident {
+            fn eq(&self, _other: &Self) -> $crate::__private::bool {
+                true
+            }
+        }
+
+        impl $crate::__private::Hash for $ident {
+            fn hash<__H: $crate::__private::Hasher>(&self, _state: &mut __H) {}
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "extra-traits"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_extra_traits_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {};
+}
+
+// Not public API.
+#[doc(hidden)]
+#[macro_export]
+macro_rules! custom_punctuation_repr {
+    ($($tt:tt)+) => {
+        [$crate::__private::Span; 0 $(+ $crate::custom_punctuation_len!(lenient, $tt))+]
+    };
+}
+
+// Not public API.
+#[doc(hidden)]
+#[macro_export]
+#[rustfmt::skip]
+macro_rules! custom_punctuation_len {
+    ($mode:ident, &)     => { 1 };
+    ($mode:ident, &&)    => { 2 };
+    ($mode:ident, &=)    => { 2 };
+    ($mode:ident, @)     => { 1 };
+    ($mode:ident, ^)     => { 1 };
+    ($mode:ident, ^=)    => { 2 };
+    ($mode:ident, :)     => { 1 };
+    ($mode:ident, ,)     => { 1 };
+    ($mode:ident, $)     => { 1 };
+    ($mode:ident, .)     => { 1 };
+    ($mode:ident, ..)    => { 2 };
+    ($mode:ident, ...)   => { 3 };
+    ($mode:ident, ..=)   => { 3 };
+    ($mode:ident, =)     => { 1 };
+    ($mode:ident, ==)    => { 2 };
+    ($mode:ident, =>)    => { 2 };
+    ($mode:ident, >=)    => { 2 };
+    ($mode:ident, >)     => { 1 };
+    ($mode:ident, <-)    => { 2 };
+    ($mode:ident, <=)    => { 2 };
+    ($mode:ident, <)     => { 1 };
+    ($mode:ident, -)     => { 1 };
+    ($mode:ident, -=)    => { 2 };
+    ($mode:ident, !=)    => { 2 };
+    ($mode:ident, !)     => { 1 };
+    ($mode:ident, |)     => { 1 };
+    ($mode:ident, |=)    => { 2 };
+    ($mode:ident, ||)    => { 2 };
+    ($mode:ident, ::)    => { 2 };
+    ($mode:ident, %)     => { 1 };
+    ($mode:ident, %=)    => { 2 };
+    ($mode:ident, +)     => { 1 };
+    ($mode:ident, +=)    => { 2 };
+    ($mode:ident, #)     => { 1 };
+    ($mode:ident, ?)     => { 1 };
+    ($mode:ident, ->)    => { 2 };
+    ($mode:ident, ;)     => { 1 };
+    ($mode:ident, <<)    => { 2 };
+    ($mode:ident, <<=)   => { 3 };
+    ($mode:ident, >>)    => { 2 };
+    ($mode:ident, >>=)   => { 3 };
+    ($mode:ident, /)     => { 1 };
+    ($mode:ident, /=)    => { 2 };
+    ($mode:ident, *)     => { 1 };
+    ($mode:ident, *=)    => { 2 };
+    ($mode:ident, ~)     => { 1 };
+    (lenient, $tt:tt)    => { 0 };
+    (strict, $tt:tt)     => {{ $crate::custom_punctuation_unexpected!($tt); 0 }};
+}
+
+// Not public API.
+#[doc(hidden)]
+#[macro_export]
+macro_rules! custom_punctuation_unexpected {
+    () => {};
+}
+
+// Not public API.
+#[doc(hidden)]
+#[macro_export]
+macro_rules! stringify_punct {
+    ($($tt:tt)+) => {
+        $crate::__private::concat!($($crate::__private::stringify!($tt)),+)
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/data.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/data.rs
--- 43.0.0-1/rust-vendor/syn/src/data.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/data.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,423 @@
+use crate::attr::Attribute;
+use crate::expr::Expr;
+use crate::ident::Ident;
+use crate::punctuated::{self, Punctuated};
+use crate::restriction::{FieldMutability, Visibility};
+use crate::token;
+use crate::ty::Type;
+
+ast_struct! {
+    /// An enum variant.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct Variant {
+        pub attrs: Vec<Attribute>,
+
+        /// Name of the variant.
+        pub ident: Ident,
+
+        /// Content stored in the variant.
+        pub fields: Fields,
+
+        /// Explicit discriminant: `Variant = 1`
+        pub discriminant: Option<(Token![=], Expr)>,
+    }
+}
+
+ast_enum_of_structs! {
+    /// Data stored within an enum variant or struct.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub enum Fields {
+        /// Named fields of a struct or struct variant such as `Point { x: f64,
+        /// y: f64 }`.
+        Named(FieldsNamed),
+
+        /// Unnamed fields of a tuple struct or tuple variant such as `Some(T)`.
+        Unnamed(FieldsUnnamed),
+
+        /// Unit struct or unit variant such as `None`.
+        Unit,
+    }
+}
+
+ast_struct! {
+    /// Named fields of a struct or struct variant such as `Point { x: f64,
+    /// y: f64 }`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct FieldsNamed {
+        pub brace_token: token::Brace,
+        pub named: Punctuated<Field, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// Unnamed fields of a tuple struct or tuple variant such as `Some(T)`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct FieldsUnnamed {
+        pub paren_token: token::Paren,
+        pub unnamed: Punctuated<Field, Token![,]>,
+    }
+}
+
+impl Fields {
+    /// Get an iterator over the borrowed [`Field`] items in this object. This
+    /// iterator can be used to iterate over a named or unnamed struct or
+    /// variant's fields uniformly.
+    pub fn iter(&self) -> punctuated::Iter<Field> {
+        match self {
+            Fields::Unit => crate::punctuated::empty_punctuated_iter(),
+            Fields::Named(f) => f.named.iter(),
+            Fields::Unnamed(f) => f.unnamed.iter(),
+        }
+    }
+
+    /// Get an iterator over the mutably borrowed [`Field`] items in this
+    /// object. This iterator can be used to iterate over a named or unnamed
+    /// struct or variant's fields uniformly.
+    pub fn iter_mut(&mut self) -> punctuated::IterMut<Field> {
+        match self {
+            Fields::Unit => crate::punctuated::empty_punctuated_iter_mut(),
+            Fields::Named(f) => f.named.iter_mut(),
+            Fields::Unnamed(f) => f.unnamed.iter_mut(),
+        }
+    }
+
+    /// Returns the number of fields.
+    pub fn len(&self) -> usize {
+        match self {
+            Fields::Unit => 0,
+            Fields::Named(f) => f.named.len(),
+            Fields::Unnamed(f) => f.unnamed.len(),
+        }
+    }
+
+    /// Returns `true` if there are zero fields.
+    pub fn is_empty(&self) -> bool {
+        match self {
+            Fields::Unit => true,
+            Fields::Named(f) => f.named.is_empty(),
+            Fields::Unnamed(f) => f.unnamed.is_empty(),
+        }
+    }
+}
+
+impl IntoIterator for Fields {
+    type Item = Field;
+    type IntoIter = punctuated::IntoIter<Field>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        match self {
+            Fields::Unit => Punctuated::<Field, ()>::new().into_iter(),
+            Fields::Named(f) => f.named.into_iter(),
+            Fields::Unnamed(f) => f.unnamed.into_iter(),
+        }
+    }
+}
+
+impl<'a> IntoIterator for &'a Fields {
+    type Item = &'a Field;
+    type IntoIter = punctuated::Iter<'a, Field>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        self.iter()
+    }
+}
+
+impl<'a> IntoIterator for &'a mut Fields {
+    type Item = &'a mut Field;
+    type IntoIter = punctuated::IterMut<'a, Field>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        self.iter_mut()
+    }
+}
+
+ast_struct! {
+    /// A field of a struct or enum variant.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct Field {
+        pub attrs: Vec<Attribute>,
+
+        pub vis: Visibility,
+
+        pub mutability: FieldMutability,
+
+        /// Name of the field, if any.
+        ///
+        /// Fields of tuple structs have no names.
+        pub ident: Option<Ident>,
+
+        pub colon_token: Option<Token![:]>,
+
+        pub ty: Type,
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::attr::Attribute;
+    use crate::data::{Field, Fields, FieldsNamed, FieldsUnnamed, Variant};
+    use crate::error::Result;
+    use crate::expr::Expr;
+    use crate::ext::IdentExt as _;
+    use crate::ident::Ident;
+    #[cfg(not(feature = "full"))]
+    use crate::parse::discouraged::Speculative as _;
+    use crate::parse::{Parse, ParseStream};
+    use crate::restriction::{FieldMutability, Visibility};
+    use crate::token;
+    use crate::ty::Type;
+    use crate::verbatim;
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Variant {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let _visibility: Visibility = input.parse()?;
+            let ident: Ident = input.parse()?;
+            let fields = if input.peek(token::Brace) {
+                Fields::Named(input.parse()?)
+            } else if input.peek(token::Paren) {
+                Fields::Unnamed(input.parse()?)
+            } else {
+                Fields::Unit
+            };
+            let discriminant = if input.peek(Token![=]) {
+                let eq_token: Token![=] = input.parse()?;
+                #[cfg(feature = "full")]
+                let discriminant: Expr = input.parse()?;
+                #[cfg(not(feature = "full"))]
+                let discriminant = {
+                    let begin = input.fork();
+                    let ahead = input.fork();
+                    let mut discriminant: Result<Expr> = ahead.parse();
+                    if discriminant.is_ok() {
+                        input.advance_to(&ahead);
+                    } else if scan_lenient_discriminant(input).is_ok() {
+                        discriminant = Ok(Expr::Verbatim(verbatim::between(&begin, input)));
+                    }
+                    discriminant?
+                };
+                Some((eq_token, discriminant))
+            } else {
+                None
+            };
+            Ok(Variant {
+                attrs,
+                ident,
+                fields,
+                discriminant,
+            })
+        }
+    }
+
+    #[cfg(not(feature = "full"))]
+    pub(crate) fn scan_lenient_discriminant(input: ParseStream) -> Result<()> {
+        use crate::expr::Member;
+        use crate::lifetime::Lifetime;
+        use crate::lit::Lit;
+        use crate::lit::LitFloat;
+        use crate::op::{BinOp, UnOp};
+        use crate::path::{self, AngleBracketedGenericArguments};
+        use proc_macro2::Delimiter::{self, Brace, Bracket, Parenthesis};
+
+        let consume = |delimiter: Delimiter| {
+            Result::unwrap(input.step(|cursor| match cursor.group(delimiter) {
+                Some((_inside, _span, rest)) => Ok((true, rest)),
+                None => Ok((false, *cursor)),
+            }))
+        };
+
+        macro_rules! consume {
+            [$token:tt] => {
+                input.parse::<Option<Token![$token]>>().unwrap().is_some()
+            };
+        }
+
+        let mut initial = true;
+        let mut depth = 0usize;
+        loop {
+            if initial {
+                if consume![&] {
+                    input.parse::<Option<Token![mut]>>()?;
+                } else if consume![if] || consume![match] || consume![while] {
+                    depth += 1;
+                } else if input.parse::<Option<Lit>>()?.is_some()
+                    || (consume(Brace) || consume(Bracket) || consume(Parenthesis))
+                    || (consume![async] || consume![const] || consume![loop] || consume![unsafe])
+                        && (consume(Brace) || break)
+                {
+                    initial = false;
+                } else if consume![let] {
+                    while !consume![=] {
+                        if !((consume![|] || consume![ref] || consume![mut] || consume![@])
+                            || (consume![!] || input.parse::<Option<Lit>>()?.is_some())
+                            || (consume![..=] || consume![..] || consume![&] || consume![_])
+                            || (consume(Brace) || consume(Bracket) || consume(Parenthesis)))
+                        {
+                            path::parsing::qpath(input, true)?;
+                        }
+                    }
+                } else if input.parse::<Option<Lifetime>>()?.is_some() && !consume![:] {
+                    break;
+                } else if input.parse::<UnOp>().is_err() {
+                    path::parsing::qpath(input, true)?;
+                    initial = consume![!] || depth == 0 && input.peek(token::Brace);
+                }
+            } else if input.is_empty() || input.peek(Token![,]) {
+                return Ok(());
+            } else if depth > 0 && consume(Brace) {
+                if consume![else] && !consume(Brace) {
+                    initial = consume![if] || break;
+                } else {
+                    depth -= 1;
+                }
+            } else if input.parse::<BinOp>().is_ok() || (consume![..] | consume![=]) {
+                initial = true;
+            } else if consume![.] {
+                if input.parse::<Option<LitFloat>>()?.is_none()
+                    && (input.parse::<Member>()?.is_named() && consume![::])
+                {
+                    AngleBracketedGenericArguments::do_parse(None, input)?;
+                }
+            } else if consume![as] {
+                input.parse::<Type>()?;
+            } else if !(consume(Brace) || consume(Bracket) || consume(Parenthesis)) {
+                break;
+            }
+        }
+
+        Err(input.error("unsupported expression"))
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for FieldsNamed {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            Ok(FieldsNamed {
+                brace_token: braced!(content in input),
+                named: content.parse_terminated(Field::parse_named, Token![,])?,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for FieldsUnnamed {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            Ok(FieldsUnnamed {
+                paren_token: parenthesized!(content in input),
+                unnamed: content.parse_terminated(Field::parse_unnamed, Token![,])?,
+            })
+        }
+    }
+
+    impl Field {
+        /// Parses a named (braced struct) field.
+        #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+        pub fn parse_named(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let vis: Visibility = input.parse()?;
+
+            let unnamed_field = cfg!(feature = "full") && input.peek(Token![_]);
+            let ident = if unnamed_field {
+                input.call(Ident::parse_any)
+            } else {
+                input.parse()
+            }?;
+
+            let colon_token: Token![:] = input.parse()?;
+
+            let ty: Type = if unnamed_field
+                && (input.peek(Token![struct])
+                    || input.peek(Token![union]) && input.peek2(token::Brace))
+            {
+                let begin = input.fork();
+                input.call(Ident::parse_any)?;
+                input.parse::<FieldsNamed>()?;
+                Type::Verbatim(verbatim::between(&begin, input))
+            } else {
+                input.parse()?
+            };
+
+            Ok(Field {
+                attrs,
+                vis,
+                mutability: FieldMutability::None,
+                ident: Some(ident),
+                colon_token: Some(colon_token),
+                ty,
+            })
+        }
+
+        /// Parses an unnamed (tuple struct) field.
+        #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+        pub fn parse_unnamed(input: ParseStream) -> Result<Self> {
+            Ok(Field {
+                attrs: input.call(Attribute::parse_outer)?,
+                vis: input.parse()?,
+                mutability: FieldMutability::None,
+                ident: None,
+                colon_token: None,
+                ty: input.parse()?,
+            })
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::data::{Field, FieldsNamed, FieldsUnnamed, Variant};
+    use crate::print::TokensOrDefault;
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for Variant {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(&self.attrs);
+            self.ident.to_tokens(tokens);
+            self.fields.to_tokens(tokens);
+            if let Some((eq_token, disc)) = &self.discriminant {
+                eq_token.to_tokens(tokens);
+                disc.to_tokens(tokens);
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for FieldsNamed {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.brace_token.surround(tokens, |tokens| {
+                self.named.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for FieldsUnnamed {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.paren_token.surround(tokens, |tokens| {
+                self.unnamed.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for Field {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(&self.attrs);
+            self.vis.to_tokens(tokens);
+            if let Some(ident) = &self.ident {
+                ident.to_tokens(tokens);
+                TokensOrDefault(&self.colon_token).to_tokens(tokens);
+            }
+            self.ty.to_tokens(tokens);
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/derive.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/derive.rs
--- 43.0.0-1/rust-vendor/syn/src/derive.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/derive.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,259 @@
+use crate::attr::Attribute;
+use crate::data::{Fields, FieldsNamed, Variant};
+use crate::generics::Generics;
+use crate::ident::Ident;
+use crate::punctuated::Punctuated;
+use crate::restriction::Visibility;
+use crate::token;
+
+ast_struct! {
+    /// Data structure sent to a `proc_macro_derive` macro.
+    #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+    pub struct DeriveInput {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub ident: Ident,
+        pub generics: Generics,
+        pub data: Data,
+    }
+}
+
+ast_enum! {
+    /// The storage of a struct, enum or union data structure.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+    pub enum Data {
+        Struct(DataStruct),
+        Enum(DataEnum),
+        Union(DataUnion),
+    }
+}
+
+ast_struct! {
+    /// A struct input to a `proc_macro_derive` macro.
+    #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+    pub struct DataStruct {
+        pub struct_token: Token![struct],
+        pub fields: Fields,
+        pub semi_token: Option<Token![;]>,
+    }
+}
+
+ast_struct! {
+    /// An enum input to a `proc_macro_derive` macro.
+    #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+    pub struct DataEnum {
+        pub enum_token: Token![enum],
+        pub brace_token: token::Brace,
+        pub variants: Punctuated<Variant, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// An untagged union input to a `proc_macro_derive` macro.
+    #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+    pub struct DataUnion {
+        pub union_token: Token![union],
+        pub fields: FieldsNamed,
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::attr::Attribute;
+    use crate::data::{Fields, FieldsNamed, Variant};
+    use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
+    use crate::error::Result;
+    use crate::generics::{Generics, WhereClause};
+    use crate::ident::Ident;
+    use crate::parse::{Parse, ParseStream};
+    use crate::punctuated::Punctuated;
+    use crate::restriction::Visibility;
+    use crate::token;
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for DeriveInput {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let vis = input.parse::<Visibility>()?;
+
+            let lookahead = input.lookahead1();
+            if lookahead.peek(Token![struct]) {
+                let struct_token = input.parse::<Token![struct]>()?;
+                let ident = input.parse::<Ident>()?;
+                let generics = input.parse::<Generics>()?;
+                let (where_clause, fields, semi) = data_struct(input)?;
+                Ok(DeriveInput {
+                    attrs,
+                    vis,
+                    ident,
+                    generics: Generics {
+                        where_clause,
+                        ..generics
+                    },
+                    data: Data::Struct(DataStruct {
+                        struct_token,
+                        fields,
+                        semi_token: semi,
+                    }),
+                })
+            } else if lookahead.peek(Token![enum]) {
+                let enum_token = input.parse::<Token![enum]>()?;
+                let ident = input.parse::<Ident>()?;
+                let generics = input.parse::<Generics>()?;
+                let (where_clause, brace, variants) = data_enum(input)?;
+                Ok(DeriveInput {
+                    attrs,
+                    vis,
+                    ident,
+                    generics: Generics {
+                        where_clause,
+                        ..generics
+                    },
+                    data: Data::Enum(DataEnum {
+                        enum_token,
+                        brace_token: brace,
+                        variants,
+                    }),
+                })
+            } else if lookahead.peek(Token![union]) {
+                let union_token = input.parse::<Token![union]>()?;
+                let ident = input.parse::<Ident>()?;
+                let generics = input.parse::<Generics>()?;
+                let (where_clause, fields) = data_union(input)?;
+                Ok(DeriveInput {
+                    attrs,
+                    vis,
+                    ident,
+                    generics: Generics {
+                        where_clause,
+                        ..generics
+                    },
+                    data: Data::Union(DataUnion {
+                        union_token,
+                        fields,
+                    }),
+                })
+            } else {
+                Err(lookahead.error())
+            }
+        }
+    }
+
+    pub(crate) fn data_struct(
+        input: ParseStream,
+    ) -> Result<(Option<WhereClause>, Fields, Option<Token![;]>)> {
+        let mut lookahead = input.lookahead1();
+        let mut where_clause = None;
+        if lookahead.peek(Token![where]) {
+            where_clause = Some(input.parse()?);
+            lookahead = input.lookahead1();
+        }
+
+        if where_clause.is_none() && lookahead.peek(token::Paren) {
+            let fields = input.parse()?;
+
+            lookahead = input.lookahead1();
+            if lookahead.peek(Token![where]) {
+                where_clause = Some(input.parse()?);
+                lookahead = input.lookahead1();
+            }
+
+            if lookahead.peek(Token![;]) {
+                let semi = input.parse()?;
+                Ok((where_clause, Fields::Unnamed(fields), Some(semi)))
+            } else {
+                Err(lookahead.error())
+            }
+        } else if lookahead.peek(token::Brace) {
+            let fields = input.parse()?;
+            Ok((where_clause, Fields::Named(fields), None))
+        } else if lookahead.peek(Token![;]) {
+            let semi = input.parse()?;
+            Ok((where_clause, Fields::Unit, Some(semi)))
+        } else {
+            Err(lookahead.error())
+        }
+    }
+
+    pub(crate) fn data_enum(
+        input: ParseStream,
+    ) -> Result<(
+        Option<WhereClause>,
+        token::Brace,
+        Punctuated<Variant, Token![,]>,
+    )> {
+        let where_clause = input.parse()?;
+
+        let content;
+        let brace = braced!(content in input);
+        let variants = content.parse_terminated(Variant::parse, Token![,])?;
+
+        Ok((where_clause, brace, variants))
+    }
+
+    pub(crate) fn data_union(input: ParseStream) -> Result<(Option<WhereClause>, FieldsNamed)> {
+        let where_clause = input.parse()?;
+        let fields = input.parse()?;
+        Ok((where_clause, fields))
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::attr::FilterAttrs;
+    use crate::data::Fields;
+    use crate::derive::{Data, DeriveInput};
+    use crate::print::TokensOrDefault;
+    use proc_macro2::TokenStream;
+    use quote::ToTokens;
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for DeriveInput {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            for attr in self.attrs.outer() {
+                attr.to_tokens(tokens);
+            }
+            self.vis.to_tokens(tokens);
+            match &self.data {
+                Data::Struct(d) => d.struct_token.to_tokens(tokens),
+                Data::Enum(d) => d.enum_token.to_tokens(tokens),
+                Data::Union(d) => d.union_token.to_tokens(tokens),
+            }
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            match &self.data {
+                Data::Struct(data) => match &data.fields {
+                    Fields::Named(fields) => {
+                        self.generics.where_clause.to_tokens(tokens);
+                        fields.to_tokens(tokens);
+                    }
+                    Fields::Unnamed(fields) => {
+                        fields.to_tokens(tokens);
+                        self.generics.where_clause.to_tokens(tokens);
+                        TokensOrDefault(&data.semi_token).to_tokens(tokens);
+                    }
+                    Fields::Unit => {
+                        self.generics.where_clause.to_tokens(tokens);
+                        TokensOrDefault(&data.semi_token).to_tokens(tokens);
+                    }
+                },
+                Data::Enum(data) => {
+                    self.generics.where_clause.to_tokens(tokens);
+                    data.brace_token.surround(tokens, |tokens| {
+                        data.variants.to_tokens(tokens);
+                    });
+                }
+                Data::Union(data) => {
+                    self.generics.where_clause.to_tokens(tokens);
+                    data.fields.to_tokens(tokens);
+                }
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/discouraged.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/discouraged.rs
--- 43.0.0-1/rust-vendor/syn/src/discouraged.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/discouraged.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,225 @@
+//! Extensions to the parsing API with niche applicability.
+
+use crate::buffer::Cursor;
+use crate::error::Result;
+use crate::parse::{inner_unexpected, ParseBuffer, Unexpected};
+use proc_macro2::extra::DelimSpan;
+use proc_macro2::Delimiter;
+use std::cell::Cell;
+use std::mem;
+use std::rc::Rc;
+
+/// Extensions to the `ParseStream` API to support speculative parsing.
+pub trait Speculative {
+    /// Advance this parse stream to the position of a forked parse stream.
+    ///
+    /// This is the opposite operation to [`ParseStream::fork`]. You can fork a
+    /// parse stream, perform some speculative parsing, then join the original
+    /// stream to the fork to "commit" the parsing from the fork to the main
+    /// stream.
+    ///
+    /// If you can avoid doing this, you should, as it limits the ability to
+    /// generate useful errors. That said, it is often the only way to parse
+    /// syntax of the form `A* B*` for arbitrary syntax `A` and `B`. The problem
+    /// is that when the fork fails to parse an `A`, it's impossible to tell
+    /// whether that was because of a syntax error and the user meant to provide
+    /// an `A`, or that the `A`s are finished and it's time to start parsing
+    /// `B`s. Use with care.
+    ///
+    /// Also note that if `A` is a subset of `B`, `A* B*` can be parsed by
+    /// parsing `B*` and removing the leading members of `A` from the
+    /// repetition, bypassing the need to involve the downsides associated with
+    /// speculative parsing.
+    ///
+    /// [`ParseStream::fork`]: ParseBuffer::fork
+    ///
+    /// # Example
+    ///
+    /// There has been chatter about the possibility of making the colons in the
+    /// turbofish syntax like `path::to::<T>` no longer required by accepting
+    /// `path::to<T>` in expression position. Specifically, according to [RFC
+    /// 2544], [`PathSegment`] parsing should always try to consume a following
+    /// `<` token as the start of generic arguments, and reset to the `<` if
+    /// that fails (e.g. the token is acting as a less-than operator).
+    ///
+    /// This is the exact kind of parsing behavior which requires the "fork,
+    /// try, commit" behavior that [`ParseStream::fork`] discourages. With
+    /// `advance_to`, we can avoid having to parse the speculatively parsed
+    /// content a second time.
+    ///
+    /// This change in behavior can be implemented in syn by replacing just the
+    /// `Parse` implementation for `PathSegment`:
+    ///
+    /// ```
+    /// # use syn::ext::IdentExt;
+    /// use syn::parse::discouraged::Speculative;
+    /// # use syn::parse::{Parse, ParseStream};
+    /// # use syn::{Ident, PathArguments, Result, Token};
+    ///
+    /// pub struct PathSegment {
+    ///     pub ident: Ident,
+    ///     pub arguments: PathArguments,
+    /// }
+    /// #
+    /// # impl<T> From<T> for PathSegment
+    /// # where
+    /// #     T: Into<Ident>,
+    /// # {
+    /// #     fn from(ident: T) -> Self {
+    /// #         PathSegment {
+    /// #             ident: ident.into(),
+    /// #             arguments: PathArguments::None,
+    /// #         }
+    /// #     }
+    /// # }
+    ///
+    /// impl Parse for PathSegment {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         if input.peek(Token![super])
+    ///             || input.peek(Token![self])
+    ///             || input.peek(Token![Self])
+    ///             || input.peek(Token![crate])
+    ///         {
+    ///             let ident = input.call(Ident::parse_any)?;
+    ///             return Ok(PathSegment::from(ident));
+    ///         }
+    ///
+    ///         let ident = input.parse()?;
+    ///         if input.peek(Token![::]) && input.peek3(Token![<]) {
+    ///             return Ok(PathSegment {
+    ///                 ident,
+    ///                 arguments: PathArguments::AngleBracketed(input.parse()?),
+    ///             });
+    ///         }
+    ///         if input.peek(Token![<]) && !input.peek(Token![<=]) {
+    ///             let fork = input.fork();
+    ///             if let Ok(arguments) = fork.parse() {
+    ///                 input.advance_to(&fork);
+    ///                 return Ok(PathSegment {
+    ///                     ident,
+    ///                     arguments: PathArguments::AngleBracketed(arguments),
+    ///                 });
+    ///             }
+    ///         }
+    ///         Ok(PathSegment::from(ident))
+    ///     }
+    /// }
+    ///
+    /// # syn::parse_str::<PathSegment>("a<b,c>").unwrap();
+    /// ```
+    ///
+    /// # Drawbacks
+    ///
+    /// The main drawback of this style of speculative parsing is in error
+    /// presentation. Even if the lookahead is the "correct" parse, the error
+    /// that is shown is that of the "fallback" parse. To use the same example
+    /// as the turbofish above, take the following unfinished "turbofish":
+    ///
+    /// ```text
+    /// let _ = f<&'a fn(), for<'a> serde::>();
+    /// ```
+    ///
+    /// If this is parsed as generic arguments, we can provide the error message
+    ///
+    /// ```text
+    /// error: expected identifier
+    ///  --> src.rs:L:C
+    ///   |
+    /// L | let _ = f<&'a fn(), for<'a> serde::>();
+    ///   |                                    ^
+    /// ```
+    ///
+    /// but if parsed using the above speculative parsing, it falls back to
+    /// assuming that the `<` is a less-than when it fails to parse the generic
+    /// arguments, and tries to interpret the `&'a` as the start of a labelled
+    /// loop, resulting in the much less helpful error
+    ///
+    /// ```text
+    /// error: expected `:`
+    ///  --> src.rs:L:C
+    ///   |
+    /// L | let _ = f<&'a fn(), for<'a> serde::>();
+    ///   |               ^^
+    /// ```
+    ///
+    /// This can be mitigated with various heuristics (two examples: show both
+    /// forks' parse errors, or show the one that consumed more tokens), but
+    /// when you can control the grammar, sticking to something that can be
+    /// parsed LL(3) and without the LL(*) speculative parsing this makes
+    /// possible, displaying reasonable errors becomes much more simple.
+    ///
+    /// [RFC 2544]: https://github.com/rust-lang/rfcs/pull/2544
+    /// [`PathSegment`]: crate::PathSegment
+    ///
+    /// # Performance
+    ///
+    /// This method performs a cheap fixed amount of work that does not depend
+    /// on how far apart the two streams are positioned.
+    ///
+    /// # Panics
+    ///
+    /// The forked stream in the argument of `advance_to` must have been
+    /// obtained by forking `self`. Attempting to advance to any other stream
+    /// will cause a panic.
+    fn advance_to(&self, fork: &Self);
+}
+
+impl<'a> Speculative for ParseBuffer<'a> {
+    fn advance_to(&self, fork: &Self) {
+        if !crate::buffer::same_scope(self.cursor(), fork.cursor()) {
+            panic!("fork was not derived from the advancing parse stream");
+        }
+
+        let (self_unexp, self_sp) = inner_unexpected(self);
+        let (fork_unexp, fork_sp) = inner_unexpected(fork);
+        if !Rc::ptr_eq(&self_unexp, &fork_unexp) {
+            match (fork_sp, self_sp) {
+                // Unexpected set on the fork, but not on `self`, copy it over.
+                (Some(span), None) => {
+                    self_unexp.set(Unexpected::Some(span));
+                }
+                // Unexpected unset. Use chain to propagate errors from fork.
+                (None, None) => {
+                    fork_unexp.set(Unexpected::Chain(self_unexp));
+
+                    // Ensure toplevel 'unexpected' tokens from the fork don't
+                    // bubble up the chain by replacing the root `unexpected`
+                    // pointer, only 'unexpected' tokens from existing group
+                    // parsers should bubble.
+                    fork.unexpected
+                        .set(Some(Rc::new(Cell::new(Unexpected::None))));
+                }
+                // Unexpected has been set on `self`. No changes needed.
+                (_, Some(_)) => {}
+            }
+        }
+
+        // See comment on `cell` in the struct definition.
+        self.cell
+            .set(unsafe { mem::transmute::<Cursor, Cursor<'static>>(fork.cursor()) });
+    }
+}
+
+/// Extensions to the `ParseStream` API to support manipulating invisible
+/// delimiters the same as if they were visible.
+pub trait AnyDelimiter {
+    /// Returns the delimiter, the span of the delimiter token, and the nested
+    /// contents for further parsing.
+    fn parse_any_delimiter(&self) -> Result<(Delimiter, DelimSpan, ParseBuffer)>;
+}
+
+impl<'a> AnyDelimiter for ParseBuffer<'a> {
+    fn parse_any_delimiter(&self) -> Result<(Delimiter, DelimSpan, ParseBuffer)> {
+        self.step(|cursor| {
+            if let Some((content, delimiter, span, rest)) = cursor.any_group() {
+                let scope = span.close();
+                let nested = crate::parse::advance_step_cursor(cursor, content);
+                let unexpected = crate::parse::get_unexpected(self);
+                let content = crate::parse::new_parse_buffer(scope, nested, unexpected);
+                Ok(((delimiter, span, content), rest))
+            } else {
+                Err(cursor.error("expected any delimiter"))
+            }
+        })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/drops.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/drops.rs
--- 43.0.0-1/rust-vendor/syn/src/drops.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/drops.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,58 @@
+use std::iter;
+use std::mem::ManuallyDrop;
+use std::ops::{Deref, DerefMut};
+use std::option;
+use std::slice;
+
+#[repr(transparent)]
+pub(crate) struct NoDrop<T: ?Sized>(ManuallyDrop<T>);
+
+impl<T> NoDrop<T> {
+    pub(crate) fn new(value: T) -> Self
+    where
+        T: TrivialDrop,
+    {
+        NoDrop(ManuallyDrop::new(value))
+    }
+}
+
+impl<T: ?Sized> Deref for NoDrop<T> {
+    type Target = T;
+    fn deref(&self) -> &Self::Target {
+        &self.0
+    }
+}
+
+impl<T: ?Sized> DerefMut for NoDrop<T> {
+    fn deref_mut(&mut self) -> &mut Self::Target {
+        &mut self.0
+    }
+}
+
+pub(crate) trait TrivialDrop {}
+
+impl<T> TrivialDrop for iter::Empty<T> {}
+impl<'a, T> TrivialDrop for slice::Iter<'a, T> {}
+impl<'a, T> TrivialDrop for slice::IterMut<'a, T> {}
+impl<'a, T> TrivialDrop for option::IntoIter<&'a T> {}
+impl<'a, T> TrivialDrop for option::IntoIter<&'a mut T> {}
+
+#[test]
+fn test_needs_drop() {
+    use std::mem::needs_drop;
+
+    struct NeedsDrop;
+
+    impl Drop for NeedsDrop {
+        fn drop(&mut self) {}
+    }
+
+    assert!(needs_drop::<NeedsDrop>());
+
+    // Test each of the types with a handwritten TrivialDrop impl above.
+    assert!(!needs_drop::<iter::Empty<NeedsDrop>>());
+    assert!(!needs_drop::<slice::Iter<NeedsDrop>>());
+    assert!(!needs_drop::<slice::IterMut<NeedsDrop>>());
+    assert!(!needs_drop::<option::IntoIter<&NeedsDrop>>());
+    assert!(!needs_drop::<option::IntoIter<&mut NeedsDrop>>());
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/error.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/error.rs
--- 43.0.0-1/rust-vendor/syn/src/error.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/error.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,467 @@
+#[cfg(feature = "parsing")]
+use crate::buffer::Cursor;
+use crate::thread::ThreadBound;
+use proc_macro2::{
+    Delimiter, Group, Ident, LexError, Literal, Punct, Spacing, Span, TokenStream, TokenTree,
+};
+#[cfg(feature = "printing")]
+use quote::ToTokens;
+use std::fmt::{self, Debug, Display};
+use std::slice;
+use std::vec;
+
+/// The result of a Syn parser.
+pub type Result<T> = std::result::Result<T, Error>;
+
+/// Error returned when a Syn parser cannot parse the input tokens.
+///
+/// # Error reporting in proc macros
+///
+/// The correct way to report errors back to the compiler from a procedural
+/// macro is by emitting an appropriately spanned invocation of
+/// [`compile_error!`] in the generated code. This produces a better diagnostic
+/// message than simply panicking the macro.
+///
+/// [`compile_error!`]: std::compile_error!
+///
+/// When parsing macro input, the [`parse_macro_input!`] macro handles the
+/// conversion to `compile_error!` automatically.
+///
+/// [`parse_macro_input!`]: crate::parse_macro_input!
+///
+/// ```
+/// # extern crate proc_macro;
+/// #
+/// use proc_macro::TokenStream;
+/// use syn::parse::{Parse, ParseStream, Result};
+/// use syn::{parse_macro_input, ItemFn};
+///
+/// # const IGNORE: &str = stringify! {
+/// #[proc_macro_attribute]
+/// # };
+/// pub fn my_attr(args: TokenStream, input: TokenStream) -> TokenStream {
+///     let args = parse_macro_input!(args as MyAttrArgs);
+///     let input = parse_macro_input!(input as ItemFn);
+///
+///     /* ... */
+///     # TokenStream::new()
+/// }
+///
+/// struct MyAttrArgs {
+///     # _k: [(); { stringify! {
+///     ...
+///     # }; 0 }]
+/// }
+///
+/// impl Parse for MyAttrArgs {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         # stringify! {
+///         ...
+///         # };
+///         # unimplemented!()
+///     }
+/// }
+/// ```
+///
+/// For errors that arise later than the initial parsing stage, the
+/// [`.to_compile_error()`] or [`.into_compile_error()`] methods can be used to
+/// perform an explicit conversion to `compile_error!`.
+///
+/// [`.to_compile_error()`]: Error::to_compile_error
+/// [`.into_compile_error()`]: Error::into_compile_error
+///
+/// ```
+/// # extern crate proc_macro;
+/// #
+/// # use proc_macro::TokenStream;
+/// # use syn::{parse_macro_input, DeriveInput};
+/// #
+/// # const IGNORE: &str = stringify! {
+/// #[proc_macro_derive(MyDerive)]
+/// # };
+/// pub fn my_derive(input: TokenStream) -> TokenStream {
+///     let input = parse_macro_input!(input as DeriveInput);
+///
+///     // fn(DeriveInput) -> syn::Result<proc_macro2::TokenStream>
+///     expand::my_derive(input)
+///         .unwrap_or_else(syn::Error::into_compile_error)
+///         .into()
+/// }
+/// #
+/// # mod expand {
+/// #     use proc_macro2::TokenStream;
+/// #     use syn::{DeriveInput, Result};
+/// #
+/// #     pub fn my_derive(input: DeriveInput) -> Result<TokenStream> {
+/// #         unimplemented!()
+/// #     }
+/// # }
+/// ```
+pub struct Error {
+    messages: Vec<ErrorMessage>,
+}
+
+struct ErrorMessage {
+    // Span is implemented as an index into a thread-local interner to keep the
+    // size small. It is not safe to access from a different thread. We want
+    // errors to be Send and Sync to play nicely with ecosystem crates for error
+    // handling, so pin the span we're given to its original thread and assume
+    // it is Span::call_site if accessed from any other thread.
+    span: ThreadBound<SpanRange>,
+    message: String,
+}
+
+// Cannot use std::ops::Range<Span> because that does not implement Copy,
+// whereas ThreadBound<T> requires a Copy impl as a way to ensure no Drop impls
+// are involved.
+struct SpanRange {
+    start: Span,
+    end: Span,
+}
+
+#[cfg(test)]
+struct _Test
+where
+    Error: Send + Sync;
+
+impl Error {
+    /// Usually the [`ParseStream::error`] method will be used instead, which
+    /// automatically uses the correct span from the current position of the
+    /// parse stream.
+    ///
+    /// Use `Error::new` when the error needs to be triggered on some span other
+    /// than where the parse stream is currently positioned.
+    ///
+    /// [`ParseStream::error`]: crate::parse::ParseBuffer::error
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{Error, Ident, LitStr, Result, Token};
+    /// use syn::parse::ParseStream;
+    ///
+    /// // Parses input that looks like `name = "string"` where the key must be
+    /// // the identifier `name` and the value may be any string literal.
+    /// // Returns the string literal.
+    /// fn parse_name(input: ParseStream) -> Result<LitStr> {
+    ///     let name_token: Ident = input.parse()?;
+    ///     if name_token != "name" {
+    ///         // Trigger an error not on the current position of the stream,
+    ///         // but on the position of the unexpected identifier.
+    ///         return Err(Error::new(name_token.span(), "expected `name`"));
+    ///     }
+    ///     input.parse::<Token![=]>()?;
+    ///     let s: LitStr = input.parse()?;
+    ///     Ok(s)
+    /// }
+    /// ```
+    pub fn new<T: Display>(span: Span, message: T) -> Self {
+        return new(span, message.to_string());
+
+        fn new(span: Span, message: String) -> Error {
+            Error {
+                messages: vec![ErrorMessage {
+                    span: ThreadBound::new(SpanRange {
+                        start: span,
+                        end: span,
+                    }),
+                    message,
+                }],
+            }
+        }
+    }
+
+    /// Creates an error with the specified message spanning the given syntax
+    /// tree node.
+    ///
+    /// Unlike the `Error::new` constructor, this constructor takes an argument
+    /// `tokens` which is a syntax tree node. This allows the resulting `Error`
+    /// to attempt to span all tokens inside of `tokens`. While you would
+    /// typically be able to use the `Spanned` trait with the above `Error::new`
+    /// constructor, implementation limitations today mean that
+    /// `Error::new_spanned` may provide a higher-quality error message on
+    /// stable Rust.
+    ///
+    /// When in doubt it's recommended to stick to `Error::new` (or
+    /// `ParseStream::error`)!
+    #[cfg(feature = "printing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    pub fn new_spanned<T: ToTokens, U: Display>(tokens: T, message: U) -> Self {
+        return new_spanned(tokens.into_token_stream(), message.to_string());
+
+        fn new_spanned(tokens: TokenStream, message: String) -> Error {
+            let mut iter = tokens.into_iter();
+            let start = iter.next().map_or_else(Span::call_site, |t| t.span());
+            let end = iter.last().map_or(start, |t| t.span());
+            Error {
+                messages: vec![ErrorMessage {
+                    span: ThreadBound::new(SpanRange { start, end }),
+                    message,
+                }],
+            }
+        }
+    }
+
+    /// The source location of the error.
+    ///
+    /// Spans are not thread-safe so this function returns `Span::call_site()`
+    /// if called from a different thread than the one on which the `Error` was
+    /// originally created.
+    pub fn span(&self) -> Span {
+        let SpanRange { start, end } = match self.messages[0].span.get() {
+            Some(span) => *span,
+            None => return Span::call_site(),
+        };
+        start.join(end).unwrap_or(start)
+    }
+
+    /// Render the error as an invocation of [`compile_error!`].
+    ///
+    /// The [`parse_macro_input!`] macro provides a convenient way to invoke
+    /// this method correctly in a procedural macro.
+    ///
+    /// [`compile_error!`]: std::compile_error!
+    /// [`parse_macro_input!`]: crate::parse_macro_input!
+    pub fn to_compile_error(&self) -> TokenStream {
+        self.messages
+            .iter()
+            .map(ErrorMessage::to_compile_error)
+            .collect()
+    }
+
+    /// Render the error as an invocation of [`compile_error!`].
+    ///
+    /// [`compile_error!`]: std::compile_error!
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// # extern crate proc_macro;
+    /// #
+    /// use proc_macro::TokenStream;
+    /// use syn::{parse_macro_input, DeriveInput, Error};
+    ///
+    /// # const _: &str = stringify! {
+    /// #[proc_macro_derive(MyTrait)]
+    /// # };
+    /// pub fn derive_my_trait(input: TokenStream) -> TokenStream {
+    ///     let input = parse_macro_input!(input as DeriveInput);
+    ///     my_trait::expand(input)
+    ///         .unwrap_or_else(Error::into_compile_error)
+    ///         .into()
+    /// }
+    ///
+    /// mod my_trait {
+    ///     use proc_macro2::TokenStream;
+    ///     use syn::{DeriveInput, Result};
+    ///
+    ///     pub(crate) fn expand(input: DeriveInput) -> Result<TokenStream> {
+    ///         /* ... */
+    ///         # unimplemented!()
+    ///     }
+    /// }
+    /// ```
+    pub fn into_compile_error(self) -> TokenStream {
+        self.to_compile_error()
+    }
+
+    /// Add another error message to self such that when `to_compile_error()` is
+    /// called, both errors will be emitted together.
+    pub fn combine(&mut self, another: Error) {
+        self.messages.extend(another.messages);
+    }
+}
+
+impl ErrorMessage {
+    fn to_compile_error(&self) -> TokenStream {
+        let (start, end) = match self.span.get() {
+            Some(range) => (range.start, range.end),
+            None => (Span::call_site(), Span::call_site()),
+        };
+
+        // ::core::compile_error!($message)
+        TokenStream::from_iter([
+            TokenTree::Punct({
+                let mut punct = Punct::new(':', Spacing::Joint);
+                punct.set_span(start);
+                punct
+            }),
+            TokenTree::Punct({
+                let mut punct = Punct::new(':', Spacing::Alone);
+                punct.set_span(start);
+                punct
+            }),
+            TokenTree::Ident(Ident::new("core", start)),
+            TokenTree::Punct({
+                let mut punct = Punct::new(':', Spacing::Joint);
+                punct.set_span(start);
+                punct
+            }),
+            TokenTree::Punct({
+                let mut punct = Punct::new(':', Spacing::Alone);
+                punct.set_span(start);
+                punct
+            }),
+            TokenTree::Ident(Ident::new("compile_error", start)),
+            TokenTree::Punct({
+                let mut punct = Punct::new('!', Spacing::Alone);
+                punct.set_span(start);
+                punct
+            }),
+            TokenTree::Group({
+                let mut group = Group::new(Delimiter::Brace, {
+                    TokenStream::from_iter([TokenTree::Literal({
+                        let mut string = Literal::string(&self.message);
+                        string.set_span(end);
+                        string
+                    })])
+                });
+                group.set_span(end);
+                group
+            }),
+        ])
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) fn new_at<T: Display>(scope: Span, cursor: Cursor, message: T) -> Error {
+    if cursor.eof() {
+        Error::new(scope, format!("unexpected end of input, {}", message))
+    } else {
+        let span = crate::buffer::open_span_of_group(cursor);
+        Error::new(span, message)
+    }
+}
+
+#[cfg(all(feature = "parsing", any(feature = "full", feature = "derive")))]
+pub(crate) fn new2<T: Display>(start: Span, end: Span, message: T) -> Error {
+    return new2(start, end, message.to_string());
+
+    fn new2(start: Span, end: Span, message: String) -> Error {
+        Error {
+            messages: vec![ErrorMessage {
+                span: ThreadBound::new(SpanRange { start, end }),
+                message,
+            }],
+        }
+    }
+}
+
+impl Debug for Error {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        if self.messages.len() == 1 {
+            formatter
+                .debug_tuple("Error")
+                .field(&self.messages[0])
+                .finish()
+        } else {
+            formatter
+                .debug_tuple("Error")
+                .field(&self.messages)
+                .finish()
+        }
+    }
+}
+
+impl Debug for ErrorMessage {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.message, formatter)
+    }
+}
+
+impl Display for Error {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str(&self.messages[0].message)
+    }
+}
+
+impl Clone for Error {
+    fn clone(&self) -> Self {
+        Error {
+            messages: self.messages.clone(),
+        }
+    }
+}
+
+impl Clone for ErrorMessage {
+    fn clone(&self) -> Self {
+        ErrorMessage {
+            span: self.span,
+            message: self.message.clone(),
+        }
+    }
+}
+
+impl Clone for SpanRange {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+impl Copy for SpanRange {}
+
+impl std::error::Error for Error {}
+
+impl From<LexError> for Error {
+    fn from(err: LexError) -> Self {
+        Error::new(err.span(), err)
+    }
+}
+
+impl IntoIterator for Error {
+    type Item = Error;
+    type IntoIter = IntoIter;
+
+    fn into_iter(self) -> Self::IntoIter {
+        IntoIter {
+            messages: self.messages.into_iter(),
+        }
+    }
+}
+
+pub struct IntoIter {
+    messages: vec::IntoIter<ErrorMessage>,
+}
+
+impl Iterator for IntoIter {
+    type Item = Error;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        Some(Error {
+            messages: vec![self.messages.next()?],
+        })
+    }
+}
+
+impl<'a> IntoIterator for &'a Error {
+    type Item = Error;
+    type IntoIter = Iter<'a>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        Iter {
+            messages: self.messages.iter(),
+        }
+    }
+}
+
+pub struct Iter<'a> {
+    messages: slice::Iter<'a, ErrorMessage>,
+}
+
+impl<'a> Iterator for Iter<'a> {
+    type Item = Error;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        Some(Error {
+            messages: vec![self.messages.next()?.clone()],
+        })
+    }
+}
+
+impl Extend<Error> for Error {
+    fn extend<T: IntoIterator<Item = Error>>(&mut self, iter: T) {
+        for err in iter {
+            self.combine(err);
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/export.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/export.rs
--- 43.0.0-1/rust-vendor/syn/src/export.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/export.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,73 @@
+#[doc(hidden)]
+pub use std::clone::Clone;
+#[doc(hidden)]
+pub use std::cmp::{Eq, PartialEq};
+#[doc(hidden)]
+pub use std::concat;
+#[doc(hidden)]
+pub use std::default::Default;
+#[doc(hidden)]
+pub use std::fmt::Debug;
+#[doc(hidden)]
+pub use std::hash::{Hash, Hasher};
+#[doc(hidden)]
+pub use std::marker::Copy;
+#[doc(hidden)]
+pub use std::option::Option::{None, Some};
+#[doc(hidden)]
+pub use std::result::Result::{Err, Ok};
+#[doc(hidden)]
+pub use std::stringify;
+
+#[doc(hidden)]
+pub type Formatter<'a> = std::fmt::Formatter<'a>;
+#[doc(hidden)]
+pub type FmtResult = std::fmt::Result;
+
+#[doc(hidden)]
+pub type bool = std::primitive::bool;
+#[doc(hidden)]
+pub type str = std::primitive::str;
+
+#[cfg(feature = "printing")]
+#[doc(hidden)]
+pub use quote;
+
+#[doc(hidden)]
+pub type Span = proc_macro2::Span;
+#[doc(hidden)]
+pub type TokenStream2 = proc_macro2::TokenStream;
+
+#[cfg(feature = "parsing")]
+#[doc(hidden)]
+pub use crate::group::{parse_braces, parse_brackets, parse_parens};
+
+#[doc(hidden)]
+pub use crate::span::IntoSpans;
+
+#[cfg(all(feature = "parsing", feature = "printing"))]
+#[doc(hidden)]
+pub use crate::parse_quote::parse as parse_quote;
+
+#[cfg(feature = "parsing")]
+#[doc(hidden)]
+pub use crate::token::parsing::{peek_punct, punct as parse_punct};
+
+#[cfg(feature = "printing")]
+#[doc(hidden)]
+pub use crate::token::printing::punct as print_punct;
+
+#[cfg(feature = "parsing")]
+#[doc(hidden)]
+pub use crate::token::private::CustomToken;
+
+#[cfg(feature = "proc-macro")]
+#[doc(hidden)]
+pub type TokenStream = proc_macro::TokenStream;
+
+#[cfg(feature = "printing")]
+#[doc(hidden)]
+pub use quote::{ToTokens, TokenStreamExt};
+
+#[doc(hidden)]
+pub struct private(pub(crate) ());
diff -pruN 43.0.0-1/rust-vendor/syn/src/expr.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/expr.rs
--- 43.0.0-1/rust-vendor/syn/src/expr.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/expr.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,3909 @@
+use crate::attr::Attribute;
+#[cfg(all(feature = "parsing", feature = "full"))]
+use crate::error::Result;
+#[cfg(feature = "full")]
+use crate::generics::BoundLifetimes;
+use crate::ident::Ident;
+#[cfg(feature = "full")]
+use crate::lifetime::Lifetime;
+use crate::lit::Lit;
+use crate::mac::Macro;
+use crate::op::{BinOp, UnOp};
+#[cfg(all(feature = "parsing", feature = "full"))]
+use crate::parse::ParseStream;
+#[cfg(feature = "full")]
+use crate::pat::Pat;
+use crate::path::{AngleBracketedGenericArguments, Path, QSelf};
+use crate::punctuated::Punctuated;
+#[cfg(feature = "full")]
+use crate::stmt::Block;
+use crate::token;
+#[cfg(feature = "full")]
+use crate::ty::ReturnType;
+use crate::ty::Type;
+use proc_macro2::{Span, TokenStream};
+#[cfg(feature = "printing")]
+use quote::IdentFragment;
+#[cfg(feature = "printing")]
+use std::fmt::{self, Display};
+use std::hash::{Hash, Hasher};
+#[cfg(all(feature = "parsing", feature = "full"))]
+use std::mem;
+
+ast_enum_of_structs! {
+    /// A Rust expression.
+    ///
+    /// *This type is available only if Syn is built with the `"derive"` or `"full"`
+    /// feature, but most of the variants are not available unless "full" is enabled.*
+    ///
+    /// # Syntax tree enums
+    ///
+    /// This type is a syntax tree enum. In Syn this and other syntax tree enums
+    /// are designed to be traversed using the following rebinding idiom.
+    ///
+    /// ```
+    /// # use syn::Expr;
+    /// #
+    /// # fn example(expr: Expr) {
+    /// # const IGNORE: &str = stringify! {
+    /// let expr: Expr = /* ... */;
+    /// # };
+    /// match expr {
+    ///     Expr::MethodCall(expr) => {
+    ///         /* ... */
+    ///     }
+    ///     Expr::Cast(expr) => {
+    ///         /* ... */
+    ///     }
+    ///     Expr::If(expr) => {
+    ///         /* ... */
+    ///     }
+    ///
+    ///     /* ... */
+    ///     # _ => {}
+    /// # }
+    /// # }
+    /// ```
+    ///
+    /// We begin with a variable `expr` of type `Expr` that has no fields
+    /// (because it is an enum), and by matching on it and rebinding a variable
+    /// with the same name `expr` we effectively imbue our variable with all of
+    /// the data fields provided by the variant that it turned out to be. So for
+    /// example above if we ended up in the `MethodCall` case then we get to use
+    /// `expr.receiver`, `expr.args` etc; if we ended up in the `If` case we get
+    /// to use `expr.cond`, `expr.then_branch`, `expr.else_branch`.
+    ///
+    /// This approach avoids repeating the variant names twice on every line.
+    ///
+    /// ```
+    /// # use syn::{Expr, ExprMethodCall};
+    /// #
+    /// # fn example(expr: Expr) {
+    /// // Repetitive; recommend not doing this.
+    /// match expr {
+    ///     Expr::MethodCall(ExprMethodCall { method, args, .. }) => {
+    /// # }
+    /// # _ => {}
+    /// # }
+    /// # }
+    /// ```
+    ///
+    /// In general, the name to which a syntax tree enum variant is bound should
+    /// be a suitable name for the complete syntax tree enum type.
+    ///
+    /// ```
+    /// # use syn::{Expr, ExprField};
+    /// #
+    /// # fn example(discriminant: ExprField) {
+    /// // Binding is called `base` which is the name I would use if I were
+    /// // assigning `*discriminant.base` without an `if let`.
+    /// if let Expr::Tuple(base) = *discriminant.base {
+    /// # }
+    /// # }
+    /// ```
+    ///
+    /// A sign that you may not be choosing the right variable names is if you
+    /// see names getting repeated in your code, like accessing
+    /// `receiver.receiver` or `pat.pat` or `cond.cond`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    #[non_exhaustive]
+    pub enum Expr {
+        /// A slice literal expression: `[a, b, c, d]`.
+        Array(ExprArray),
+
+        /// An assignment expression: `a = compute()`.
+        Assign(ExprAssign),
+
+        /// An async block: `async { ... }`.
+        Async(ExprAsync),
+
+        /// An await expression: `fut.await`.
+        Await(ExprAwait),
+
+        /// A binary operation: `a + b`, `a += b`.
+        Binary(ExprBinary),
+
+        /// A blocked scope: `{ ... }`.
+        Block(ExprBlock),
+
+        /// A `break`, with an optional label to break and an optional
+        /// expression.
+        Break(ExprBreak),
+
+        /// A function call expression: `invoke(a, b)`.
+        Call(ExprCall),
+
+        /// A cast expression: `foo as f64`.
+        Cast(ExprCast),
+
+        /// A closure expression: `|a, b| a + b`.
+        Closure(ExprClosure),
+
+        /// A const block: `const { ... }`.
+        Const(ExprConst),
+
+        /// A `continue`, with an optional label.
+        Continue(ExprContinue),
+
+        /// Access of a named struct field (`obj.k`) or unnamed tuple struct
+        /// field (`obj.0`).
+        Field(ExprField),
+
+        /// A for loop: `for pat in expr { ... }`.
+        ForLoop(ExprForLoop),
+
+        /// An expression contained within invisible delimiters.
+        ///
+        /// This variant is important for faithfully representing the precedence
+        /// of expressions and is related to `None`-delimited spans in a
+        /// `TokenStream`.
+        Group(ExprGroup),
+
+        /// An `if` expression with an optional `else` block: `if expr { ... }
+        /// else { ... }`.
+        ///
+        /// The `else` branch expression may only be an `If` or `Block`
+        /// expression, not any of the other types of expression.
+        If(ExprIf),
+
+        /// A square bracketed indexing expression: `vector[2]`.
+        Index(ExprIndex),
+
+        /// The inferred value of a const generic argument, denoted `_`.
+        Infer(ExprInfer),
+
+        /// A `let` guard: `let Some(x) = opt`.
+        Let(ExprLet),
+
+        /// A literal in place of an expression: `1`, `"foo"`.
+        Lit(ExprLit),
+
+        /// Conditionless loop: `loop { ... }`.
+        Loop(ExprLoop),
+
+        /// A macro invocation expression: `format!("{}", q)`.
+        Macro(ExprMacro),
+
+        /// A `match` expression: `match n { Some(n) => {}, None => {} }`.
+        Match(ExprMatch),
+
+        /// A method call expression: `x.foo::<T>(a, b)`.
+        MethodCall(ExprMethodCall),
+
+        /// A parenthesized expression: `(a + b)`.
+        Paren(ExprParen),
+
+        /// A path like `std::mem::replace` possibly containing generic
+        /// parameters and a qualified self-type.
+        ///
+        /// A plain identifier like `x` is a path of length 1.
+        Path(ExprPath),
+
+        /// A range expression: `1..2`, `1..`, `..2`, `1..=2`, `..=2`.
+        Range(ExprRange),
+
+        /// A referencing operation: `&a` or `&mut a`.
+        Reference(ExprReference),
+
+        /// An array literal constructed from one repeated element: `[0u8; N]`.
+        Repeat(ExprRepeat),
+
+        /// A `return`, with an optional value to be returned.
+        Return(ExprReturn),
+
+        /// A struct literal expression: `Point { x: 1, y: 1 }`.
+        ///
+        /// The `rest` provides the value of the remaining fields as in `S { a:
+        /// 1, b: 1, ..rest }`.
+        Struct(ExprStruct),
+
+        /// A try-expression: `expr?`.
+        Try(ExprTry),
+
+        /// A try block: `try { ... }`.
+        TryBlock(ExprTryBlock),
+
+        /// A tuple expression: `(a, b, c, d)`.
+        Tuple(ExprTuple),
+
+        /// A unary operation: `!x`, `*x`.
+        Unary(ExprUnary),
+
+        /// An unsafe block: `unsafe { ... }`.
+        Unsafe(ExprUnsafe),
+
+        /// Tokens in expression position not interpreted by Syn.
+        Verbatim(TokenStream),
+
+        /// A while loop: `while expr { ... }`.
+        While(ExprWhile),
+
+        /// A yield expression: `yield expr`.
+        Yield(ExprYield),
+
+        // For testing exhaustiveness in downstream code, use the following idiom:
+        //
+        //     match expr {
+        //         #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
+        //
+        //         Expr::Array(expr) => {...}
+        //         Expr::Assign(expr) => {...}
+        //         ...
+        //         Expr::Yield(expr) => {...}
+        //
+        //         _ => { /* some sane fallback */ }
+        //     }
+        //
+        // This way we fail your tests but don't break your library when adding
+        // a variant. You will be notified by a test failure when a variant is
+        // added, so that you can add code to handle it, but your library will
+        // continue to compile and work for downstream users in the interim.
+    }
+}
+
+ast_struct! {
+    /// A slice literal expression: `[a, b, c, d]`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprArray #full {
+        pub attrs: Vec<Attribute>,
+        pub bracket_token: token::Bracket,
+        pub elems: Punctuated<Expr, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// An assignment expression: `a = compute()`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprAssign #full {
+        pub attrs: Vec<Attribute>,
+        pub left: Box<Expr>,
+        pub eq_token: Token![=],
+        pub right: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// An async block: `async { ... }`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprAsync #full {
+        pub attrs: Vec<Attribute>,
+        pub async_token: Token![async],
+        pub capture: Option<Token![move]>,
+        pub block: Block,
+    }
+}
+
+ast_struct! {
+    /// An await expression: `fut.await`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprAwait #full {
+        pub attrs: Vec<Attribute>,
+        pub base: Box<Expr>,
+        pub dot_token: Token![.],
+        pub await_token: Token![await],
+    }
+}
+
+ast_struct! {
+    /// A binary operation: `a + b`, `a += b`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprBinary {
+        pub attrs: Vec<Attribute>,
+        pub left: Box<Expr>,
+        pub op: BinOp,
+        pub right: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// A blocked scope: `{ ... }`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprBlock #full {
+        pub attrs: Vec<Attribute>,
+        pub label: Option<Label>,
+        pub block: Block,
+    }
+}
+
+ast_struct! {
+    /// A `break`, with an optional label to break and an optional
+    /// expression.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprBreak #full {
+        pub attrs: Vec<Attribute>,
+        pub break_token: Token![break],
+        pub label: Option<Lifetime>,
+        pub expr: Option<Box<Expr>>,
+    }
+}
+
+ast_struct! {
+    /// A function call expression: `invoke(a, b)`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprCall {
+        pub attrs: Vec<Attribute>,
+        pub func: Box<Expr>,
+        pub paren_token: token::Paren,
+        pub args: Punctuated<Expr, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// A cast expression: `foo as f64`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprCast {
+        pub attrs: Vec<Attribute>,
+        pub expr: Box<Expr>,
+        pub as_token: Token![as],
+        pub ty: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// A closure expression: `|a, b| a + b`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprClosure #full {
+        pub attrs: Vec<Attribute>,
+        pub lifetimes: Option<BoundLifetimes>,
+        pub constness: Option<Token![const]>,
+        pub movability: Option<Token![static]>,
+        pub asyncness: Option<Token![async]>,
+        pub capture: Option<Token![move]>,
+        pub or1_token: Token![|],
+        pub inputs: Punctuated<Pat, Token![,]>,
+        pub or2_token: Token![|],
+        pub output: ReturnType,
+        pub body: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// A const block: `const { ... }`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprConst #full {
+        pub attrs: Vec<Attribute>,
+        pub const_token: Token![const],
+        pub block: Block,
+    }
+}
+
+ast_struct! {
+    /// A `continue`, with an optional label.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprContinue #full {
+        pub attrs: Vec<Attribute>,
+        pub continue_token: Token![continue],
+        pub label: Option<Lifetime>,
+    }
+}
+
+ast_struct! {
+    /// Access of a named struct field (`obj.k`) or unnamed tuple struct
+    /// field (`obj.0`).
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprField {
+        pub attrs: Vec<Attribute>,
+        pub base: Box<Expr>,
+        pub dot_token: Token![.],
+        pub member: Member,
+    }
+}
+
+ast_struct! {
+    /// A for loop: `for pat in expr { ... }`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprForLoop #full {
+        pub attrs: Vec<Attribute>,
+        pub label: Option<Label>,
+        pub for_token: Token![for],
+        pub pat: Box<Pat>,
+        pub in_token: Token![in],
+        pub expr: Box<Expr>,
+        pub body: Block,
+    }
+}
+
+ast_struct! {
+    /// An expression contained within invisible delimiters.
+    ///
+    /// This variant is important for faithfully representing the precedence
+    /// of expressions and is related to `None`-delimited spans in a
+    /// `TokenStream`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprGroup {
+        pub attrs: Vec<Attribute>,
+        pub group_token: token::Group,
+        pub expr: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// An `if` expression with an optional `else` block: `if expr { ... }
+    /// else { ... }`.
+    ///
+    /// The `else` branch expression may only be an `If` or `Block`
+    /// expression, not any of the other types of expression.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprIf #full {
+        pub attrs: Vec<Attribute>,
+        pub if_token: Token![if],
+        pub cond: Box<Expr>,
+        pub then_branch: Block,
+        pub else_branch: Option<(Token![else], Box<Expr>)>,
+    }
+}
+
+ast_struct! {
+    /// A square bracketed indexing expression: `vector[2]`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprIndex {
+        pub attrs: Vec<Attribute>,
+        pub expr: Box<Expr>,
+        pub bracket_token: token::Bracket,
+        pub index: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// The inferred value of a const generic argument, denoted `_`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprInfer #full {
+        pub attrs: Vec<Attribute>,
+        pub underscore_token: Token![_],
+    }
+}
+
+ast_struct! {
+    /// A `let` guard: `let Some(x) = opt`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprLet #full {
+        pub attrs: Vec<Attribute>,
+        pub let_token: Token![let],
+        pub pat: Box<Pat>,
+        pub eq_token: Token![=],
+        pub expr: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// A literal in place of an expression: `1`, `"foo"`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprLit {
+        pub attrs: Vec<Attribute>,
+        pub lit: Lit,
+    }
+}
+
+ast_struct! {
+    /// Conditionless loop: `loop { ... }`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprLoop #full {
+        pub attrs: Vec<Attribute>,
+        pub label: Option<Label>,
+        pub loop_token: Token![loop],
+        pub body: Block,
+    }
+}
+
+ast_struct! {
+    /// A macro invocation expression: `format!("{}", q)`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprMacro {
+        pub attrs: Vec<Attribute>,
+        pub mac: Macro,
+    }
+}
+
+ast_struct! {
+    /// A `match` expression: `match n { Some(n) => {}, None => {} }`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprMatch #full {
+        pub attrs: Vec<Attribute>,
+        pub match_token: Token![match],
+        pub expr: Box<Expr>,
+        pub brace_token: token::Brace,
+        pub arms: Vec<Arm>,
+    }
+}
+
+ast_struct! {
+    /// A method call expression: `x.foo::<T>(a, b)`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprMethodCall {
+        pub attrs: Vec<Attribute>,
+        pub receiver: Box<Expr>,
+        pub dot_token: Token![.],
+        pub method: Ident,
+        pub turbofish: Option<AngleBracketedGenericArguments>,
+        pub paren_token: token::Paren,
+        pub args: Punctuated<Expr, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// A parenthesized expression: `(a + b)`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprParen {
+        pub attrs: Vec<Attribute>,
+        pub paren_token: token::Paren,
+        pub expr: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// A path like `std::mem::replace` possibly containing generic
+    /// parameters and a qualified self-type.
+    ///
+    /// A plain identifier like `x` is a path of length 1.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprPath {
+        pub attrs: Vec<Attribute>,
+        pub qself: Option<QSelf>,
+        pub path: Path,
+    }
+}
+
+ast_struct! {
+    /// A range expression: `1..2`, `1..`, `..2`, `1..=2`, `..=2`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprRange #full {
+        pub attrs: Vec<Attribute>,
+        pub start: Option<Box<Expr>>,
+        pub limits: RangeLimits,
+        pub end: Option<Box<Expr>>,
+    }
+}
+
+ast_struct! {
+    /// A referencing operation: `&a` or `&mut a`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprReference {
+        pub attrs: Vec<Attribute>,
+        pub and_token: Token![&],
+        pub mutability: Option<Token![mut]>,
+        pub expr: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// An array literal constructed from one repeated element: `[0u8; N]`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprRepeat #full {
+        pub attrs: Vec<Attribute>,
+        pub bracket_token: token::Bracket,
+        pub expr: Box<Expr>,
+        pub semi_token: Token![;],
+        pub len: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// A `return`, with an optional value to be returned.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprReturn #full {
+        pub attrs: Vec<Attribute>,
+        pub return_token: Token![return],
+        pub expr: Option<Box<Expr>>,
+    }
+}
+
+ast_struct! {
+    /// A struct literal expression: `Point { x: 1, y: 1 }`.
+    ///
+    /// The `rest` provides the value of the remaining fields as in `S { a:
+    /// 1, b: 1, ..rest }`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprStruct {
+        pub attrs: Vec<Attribute>,
+        pub qself: Option<QSelf>,
+        pub path: Path,
+        pub brace_token: token::Brace,
+        pub fields: Punctuated<FieldValue, Token![,]>,
+        pub dot2_token: Option<Token![..]>,
+        pub rest: Option<Box<Expr>>,
+    }
+}
+
+ast_struct! {
+    /// A try-expression: `expr?`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprTry #full {
+        pub attrs: Vec<Attribute>,
+        pub expr: Box<Expr>,
+        pub question_token: Token![?],
+    }
+}
+
+ast_struct! {
+    /// A try block: `try { ... }`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprTryBlock #full {
+        pub attrs: Vec<Attribute>,
+        pub try_token: Token![try],
+        pub block: Block,
+    }
+}
+
+ast_struct! {
+    /// A tuple expression: `(a, b, c, d)`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprTuple #full {
+        pub attrs: Vec<Attribute>,
+        pub paren_token: token::Paren,
+        pub elems: Punctuated<Expr, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// A unary operation: `!x`, `*x`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprUnary {
+        pub attrs: Vec<Attribute>,
+        pub op: UnOp,
+        pub expr: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// An unsafe block: `unsafe { ... }`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprUnsafe #full {
+        pub attrs: Vec<Attribute>,
+        pub unsafe_token: Token![unsafe],
+        pub block: Block,
+    }
+}
+
+ast_struct! {
+    /// A while loop: `while expr { ... }`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprWhile #full {
+        pub attrs: Vec<Attribute>,
+        pub label: Option<Label>,
+        pub while_token: Token![while],
+        pub cond: Box<Expr>,
+        pub body: Block,
+    }
+}
+
+ast_struct! {
+    /// A yield expression: `yield expr`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ExprYield #full {
+        pub attrs: Vec<Attribute>,
+        pub yield_token: Token![yield],
+        pub expr: Option<Box<Expr>>,
+    }
+}
+
+impl Expr {
+    /// An unspecified invalid expression.
+    ///
+    /// ```
+    /// use quote::ToTokens;
+    /// use std::mem;
+    /// use syn::{parse_quote, Expr};
+    ///
+    /// fn unparenthesize(e: &mut Expr) {
+    ///     while let Expr::Paren(paren) = e {
+    ///         *e = mem::replace(&mut *paren.expr, Expr::PLACEHOLDER);
+    ///     }
+    /// }
+    ///
+    /// fn main() {
+    ///     let mut e: Expr = parse_quote! { ((1 + 1)) };
+    ///     unparenthesize(&mut e);
+    ///     assert_eq!("1 + 1", e.to_token_stream().to_string());
+    /// }
+    /// ```
+    pub const PLACEHOLDER: Self = Expr::Path(ExprPath {
+        attrs: Vec::new(),
+        qself: None,
+        path: Path {
+            leading_colon: None,
+            segments: Punctuated::new(),
+        },
+    });
+
+    /// An alternative to the primary `Expr::parse` parser (from the [`Parse`]
+    /// trait) for ambiguous syntactic positions in which a trailing brace
+    /// should not be taken as part of the expression.
+    ///
+    /// [`Parse`]: crate::parse::Parse
+    ///
+    /// Rust grammar has an ambiguity where braces sometimes turn a path
+    /// expression into a struct initialization and sometimes do not. In the
+    /// following code, the expression `S {}` is one expression. Presumably
+    /// there is an empty struct `struct S {}` defined somewhere which it is
+    /// instantiating.
+    ///
+    /// ```
+    /// # struct S;
+    /// # impl std::ops::Deref for S {
+    /// #     type Target = bool;
+    /// #     fn deref(&self) -> &Self::Target {
+    /// #         &true
+    /// #     }
+    /// # }
+    /// let _ = *S {};
+    ///
+    /// // parsed by rustc as: `*(S {})`
+    /// ```
+    ///
+    /// We would want to parse the above using `Expr::parse` after the `=`
+    /// token.
+    ///
+    /// But in the following, `S {}` is *not* a struct init expression.
+    ///
+    /// ```
+    /// # const S: &bool = &true;
+    /// if *S {} {}
+    ///
+    /// // parsed by rustc as:
+    /// //
+    /// //    if (*S) {
+    /// //        /* empty block */
+    /// //    }
+    /// //    {
+    /// //        /* another empty block */
+    /// //    }
+    /// ```
+    ///
+    /// For that reason we would want to parse if-conditions using
+    /// `Expr::parse_without_eager_brace` after the `if` token. Same for similar
+    /// syntactic positions such as the condition expr after a `while` token or
+    /// the expr at the top of a `match`.
+    ///
+    /// The Rust grammar's choices around which way this ambiguity is resolved
+    /// at various syntactic positions is fairly arbitrary. Really either parse
+    /// behavior could work in most positions, and language designers just
+    /// decide each case based on which is more likely to be what the programmer
+    /// had in mind most of the time.
+    ///
+    /// ```
+    /// # struct S;
+    /// # fn doc() -> S {
+    /// if return S {} {}
+    /// # unreachable!()
+    /// # }
+    ///
+    /// // parsed by rustc as:
+    /// //
+    /// //    if (return (S {})) {
+    /// //    }
+    /// //
+    /// // but could equally well have been this other arbitrary choice:
+    /// //
+    /// //    if (return S) {
+    /// //    }
+    /// //    {}
+    /// ```
+    ///
+    /// Note the grammar ambiguity on trailing braces is distinct from
+    /// precedence and is not captured by assigning a precedence level to the
+    /// braced struct init expr in relation to other operators. This can be
+    /// illustrated by `return 0..S {}` vs `match 0..S {}`. The former parses as
+    /// `return (0..(S {}))` implying tighter precedence for struct init than
+    /// `..`, while the latter parses as `match (0..S) {}` implying tighter
+    /// precedence for `..` than struct init, a contradiction.
+    #[cfg(all(feature = "full", feature = "parsing"))]
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "full", feature = "parsing"))))]
+    pub fn parse_without_eager_brace(input: ParseStream) -> Result<Expr> {
+        parsing::ambiguous_expr(input, parsing::AllowStruct(false))
+    }
+
+    /// An alternative to the primary `Expr::parse` parser (from the [`Parse`]
+    /// trait) for syntactic positions in which expression boundaries are placed
+    /// more eagerly than done by the typical expression grammar. This includes
+    /// expressions at the head of a statement or in the right-hand side of a
+    /// `match` arm.
+    ///
+    /// [`Parse`]: crate::parse::Parse
+    ///
+    /// Compare the following cases:
+    ///
+    /// 1.
+    ///   ```
+    ///   # let result = ();
+    ///   # let guard = false;
+    ///   # let cond = true;
+    ///   # let f = true;
+    ///   # let g = f;
+    ///   #
+    ///   let _ = match result {
+    ///       () if guard => if cond { f } else { g }
+    ///       () => false,
+    ///   };
+    ///   ```
+    ///
+    /// 2.
+    ///   ```
+    ///   # let cond = true;
+    ///   # let f = ();
+    ///   # let g = f;
+    ///   #
+    ///   let _ = || {
+    ///       if cond { f } else { g }
+    ///       ()
+    ///   };
+    ///   ```
+    ///
+    /// 3.
+    ///   ```
+    ///   # let cond = true;
+    ///   # let f = || ();
+    ///   # let g = f;
+    ///   #
+    ///   let _ = [if cond { f } else { g } ()];
+    ///   ```
+    ///
+    /// The same sequence of tokens `if cond { f } else { g } ()` appears in
+    /// expression position 3 times. The first two syntactic positions use eager
+    /// placement of expression boundaries, and parse as `Expr::If`, with the
+    /// adjacent `()` becoming `Pat::Tuple` or `Expr::Tuple`. In contrast, the
+    /// third case uses standard expression boundaries and parses as
+    /// `Expr::Call`.
+    ///
+    /// As with [`parse_without_eager_brace`], this ambiguity in the Rust
+    /// grammar is independent of precedence.
+    ///
+    /// [`parse_without_eager_brace`]: Self::parse_without_eager_brace
+    #[cfg(all(feature = "full", feature = "parsing"))]
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "full", feature = "parsing"))))]
+    pub fn parse_with_earlier_boundary_rule(input: ParseStream) -> Result<Expr> {
+        parsing::parse_with_earlier_boundary_rule(input)
+    }
+
+    #[cfg(all(feature = "parsing", feature = "full"))]
+    pub(crate) fn replace_attrs(&mut self, new: Vec<Attribute>) -> Vec<Attribute> {
+        match self {
+            Expr::Array(ExprArray { attrs, .. })
+            | Expr::Assign(ExprAssign { attrs, .. })
+            | Expr::Async(ExprAsync { attrs, .. })
+            | Expr::Await(ExprAwait { attrs, .. })
+            | Expr::Binary(ExprBinary { attrs, .. })
+            | Expr::Block(ExprBlock { attrs, .. })
+            | Expr::Break(ExprBreak { attrs, .. })
+            | Expr::Call(ExprCall { attrs, .. })
+            | Expr::Cast(ExprCast { attrs, .. })
+            | Expr::Closure(ExprClosure { attrs, .. })
+            | Expr::Const(ExprConst { attrs, .. })
+            | Expr::Continue(ExprContinue { attrs, .. })
+            | Expr::Field(ExprField { attrs, .. })
+            | Expr::ForLoop(ExprForLoop { attrs, .. })
+            | Expr::Group(ExprGroup { attrs, .. })
+            | Expr::If(ExprIf { attrs, .. })
+            | Expr::Index(ExprIndex { attrs, .. })
+            | Expr::Infer(ExprInfer { attrs, .. })
+            | Expr::Let(ExprLet { attrs, .. })
+            | Expr::Lit(ExprLit { attrs, .. })
+            | Expr::Loop(ExprLoop { attrs, .. })
+            | Expr::Macro(ExprMacro { attrs, .. })
+            | Expr::Match(ExprMatch { attrs, .. })
+            | Expr::MethodCall(ExprMethodCall { attrs, .. })
+            | Expr::Paren(ExprParen { attrs, .. })
+            | Expr::Path(ExprPath { attrs, .. })
+            | Expr::Range(ExprRange { attrs, .. })
+            | Expr::Reference(ExprReference { attrs, .. })
+            | Expr::Repeat(ExprRepeat { attrs, .. })
+            | Expr::Return(ExprReturn { attrs, .. })
+            | Expr::Struct(ExprStruct { attrs, .. })
+            | Expr::Try(ExprTry { attrs, .. })
+            | Expr::TryBlock(ExprTryBlock { attrs, .. })
+            | Expr::Tuple(ExprTuple { attrs, .. })
+            | Expr::Unary(ExprUnary { attrs, .. })
+            | Expr::Unsafe(ExprUnsafe { attrs, .. })
+            | Expr::While(ExprWhile { attrs, .. })
+            | Expr::Yield(ExprYield { attrs, .. }) => mem::replace(attrs, new),
+            Expr::Verbatim(_) => Vec::new(),
+        }
+    }
+}
+
+ast_enum! {
+    /// A struct or tuple struct field accessed in a struct literal or field
+    /// expression.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub enum Member {
+        /// A named field like `self.x`.
+        Named(Ident),
+        /// An unnamed field like `self.0`.
+        Unnamed(Index),
+    }
+}
+
+impl From<Ident> for Member {
+    fn from(ident: Ident) -> Member {
+        Member::Named(ident)
+    }
+}
+
+impl From<Index> for Member {
+    fn from(index: Index) -> Member {
+        Member::Unnamed(index)
+    }
+}
+
+impl From<usize> for Member {
+    fn from(index: usize) -> Member {
+        Member::Unnamed(Index::from(index))
+    }
+}
+
+impl Eq for Member {}
+
+impl PartialEq for Member {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (Member::Named(this), Member::Named(other)) => this == other,
+            (Member::Unnamed(this), Member::Unnamed(other)) => this == other,
+            _ => false,
+        }
+    }
+}
+
+impl Hash for Member {
+    fn hash<H: Hasher>(&self, state: &mut H) {
+        match self {
+            Member::Named(m) => m.hash(state),
+            Member::Unnamed(m) => m.hash(state),
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+impl IdentFragment for Member {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Member::Named(m) => Display::fmt(m, formatter),
+            Member::Unnamed(m) => Display::fmt(&m.index, formatter),
+        }
+    }
+
+    fn span(&self) -> Option<Span> {
+        match self {
+            Member::Named(m) => Some(m.span()),
+            Member::Unnamed(m) => Some(m.span),
+        }
+    }
+}
+
+ast_struct! {
+    /// The index of an unnamed tuple struct field.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct Index {
+        pub index: u32,
+        pub span: Span,
+    }
+}
+
+impl From<usize> for Index {
+    fn from(index: usize) -> Index {
+        assert!(index < u32::MAX as usize);
+        Index {
+            index: index as u32,
+            span: Span::call_site(),
+        }
+    }
+}
+
+impl Eq for Index {}
+
+impl PartialEq for Index {
+    fn eq(&self, other: &Self) -> bool {
+        self.index == other.index
+    }
+}
+
+impl Hash for Index {
+    fn hash<H: Hasher>(&self, state: &mut H) {
+        self.index.hash(state);
+    }
+}
+
+#[cfg(feature = "printing")]
+impl IdentFragment for Index {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.index, formatter)
+    }
+
+    fn span(&self) -> Option<Span> {
+        Some(self.span)
+    }
+}
+
+ast_struct! {
+    /// A field-value pair in a struct literal.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct FieldValue {
+        pub attrs: Vec<Attribute>,
+        pub member: Member,
+
+        /// The colon in `Struct { x: x }`. If written in shorthand like
+        /// `Struct { x }`, there is no colon.
+        pub colon_token: Option<Token![:]>,
+
+        pub expr: Expr,
+    }
+}
+
+#[cfg(feature = "full")]
+ast_struct! {
+    /// A lifetime labeling a `for`, `while`, or `loop`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct Label {
+        pub name: Lifetime,
+        pub colon_token: Token![:],
+    }
+}
+
+#[cfg(feature = "full")]
+ast_struct! {
+    /// One arm of a `match` expression: `0..=10 => { return true; }`.
+    ///
+    /// As in:
+    ///
+    /// ```
+    /// # fn f() -> bool {
+    /// #     let n = 0;
+    /// match n {
+    ///     0..=10 => {
+    ///         return true;
+    ///     }
+    ///     // ...
+    ///     # _ => {}
+    /// }
+    /// #   false
+    /// # }
+    /// ```
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct Arm {
+        pub attrs: Vec<Attribute>,
+        pub pat: Pat,
+        pub guard: Option<(Token![if], Box<Expr>)>,
+        pub fat_arrow_token: Token![=>],
+        pub body: Box<Expr>,
+        pub comma: Option<Token![,]>,
+    }
+}
+
+#[cfg(feature = "full")]
+ast_enum! {
+    /// Limit types of a range, inclusive or exclusive.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub enum RangeLimits {
+        /// Inclusive at the beginning, exclusive at the end.
+        HalfOpen(Token![..]),
+        /// Inclusive at the beginning and end.
+        Closed(Token![..=]),
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    #[cfg(feature = "full")]
+    use crate::attr;
+    use crate::attr::Attribute;
+    #[cfg(feature = "full")]
+    use crate::classify;
+    use crate::error::{Error, Result};
+    #[cfg(feature = "full")]
+    use crate::expr::{
+        Arm, ExprArray, ExprAssign, ExprAsync, ExprAwait, ExprBlock, ExprBreak, ExprClosure,
+        ExprConst, ExprContinue, ExprForLoop, ExprIf, ExprInfer, ExprLet, ExprLoop, ExprMatch,
+        ExprRange, ExprRepeat, ExprReturn, ExprTry, ExprTryBlock, ExprTuple, ExprUnsafe, ExprWhile,
+        ExprYield, Label, RangeLimits,
+    };
+    use crate::expr::{
+        Expr, ExprBinary, ExprCall, ExprCast, ExprField, ExprGroup, ExprIndex, ExprLit, ExprMacro,
+        ExprMethodCall, ExprParen, ExprPath, ExprReference, ExprStruct, ExprUnary, FieldValue,
+        Index, Member,
+    };
+    #[cfg(feature = "full")]
+    use crate::ext::IdentExt as _;
+    #[cfg(feature = "full")]
+    use crate::generics::BoundLifetimes;
+    use crate::ident::Ident;
+    #[cfg(feature = "full")]
+    use crate::lifetime::Lifetime;
+    use crate::lit::{Lit, LitFloat, LitInt};
+    use crate::mac::{self, Macro};
+    use crate::op::BinOp;
+    use crate::parse::discouraged::Speculative as _;
+    #[cfg(feature = "full")]
+    use crate::parse::ParseBuffer;
+    use crate::parse::{Parse, ParseStream};
+    #[cfg(feature = "full")]
+    use crate::pat::{Pat, PatType};
+    use crate::path::{self, AngleBracketedGenericArguments, Path, QSelf};
+    use crate::precedence::Precedence;
+    use crate::punctuated::Punctuated;
+    #[cfg(feature = "full")]
+    use crate::stmt::Block;
+    use crate::token;
+    use crate::ty;
+    #[cfg(feature = "full")]
+    use crate::ty::{ReturnType, Type};
+    use crate::verbatim;
+    #[cfg(feature = "full")]
+    use proc_macro2::TokenStream;
+    use std::mem;
+
+    mod kw {
+        crate::custom_keyword!(builtin);
+        crate::custom_keyword!(raw);
+    }
+
+    // When we're parsing expressions which occur before blocks, like in an if
+    // statement's condition, we cannot parse a struct literal.
+    //
+    // Struct literals are ambiguous in certain positions
+    // https://github.com/rust-lang/rfcs/pull/92
+    #[cfg(feature = "full")]
+    pub(super) struct AllowStruct(pub bool);
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Expr {
+        fn parse(input: ParseStream) -> Result<Self> {
+            ambiguous_expr(
+                input,
+                #[cfg(feature = "full")]
+                AllowStruct(true),
+            )
+        }
+    }
+
+    #[cfg(feature = "full")]
+    pub(super) fn parse_with_earlier_boundary_rule(input: ParseStream) -> Result<Expr> {
+        let mut attrs = input.call(expr_attrs)?;
+        let mut expr = if input.peek(token::Group) {
+            let allow_struct = AllowStruct(true);
+            let atom = expr_group(input, allow_struct)?;
+            if continue_parsing_early(&atom) {
+                trailer_helper(input, atom)?
+            } else {
+                atom
+            }
+        } else if input.peek(Token![if]) {
+            Expr::If(input.parse()?)
+        } else if input.peek(Token![while]) {
+            Expr::While(input.parse()?)
+        } else if input.peek(Token![for])
+            && !(input.peek2(Token![<]) && (input.peek3(Lifetime) || input.peek3(Token![>])))
+        {
+            Expr::ForLoop(input.parse()?)
+        } else if input.peek(Token![loop]) {
+            Expr::Loop(input.parse()?)
+        } else if input.peek(Token![match]) {
+            Expr::Match(input.parse()?)
+        } else if input.peek(Token![try]) && input.peek2(token::Brace) {
+            Expr::TryBlock(input.parse()?)
+        } else if input.peek(Token![unsafe]) {
+            Expr::Unsafe(input.parse()?)
+        } else if input.peek(Token![const]) && input.peek2(token::Brace) {
+            Expr::Const(input.parse()?)
+        } else if input.peek(token::Brace) {
+            Expr::Block(input.parse()?)
+        } else if input.peek(Lifetime) {
+            atom_labeled(input)?
+        } else {
+            let allow_struct = AllowStruct(true);
+            unary_expr(input, allow_struct)?
+        };
+
+        if continue_parsing_early(&expr) {
+            attrs.extend(expr.replace_attrs(Vec::new()));
+            expr.replace_attrs(attrs);
+
+            let allow_struct = AllowStruct(true);
+            return parse_expr(input, expr, allow_struct, Precedence::MIN);
+        }
+
+        if input.peek(Token![.]) && !input.peek(Token![..]) || input.peek(Token![?]) {
+            expr = trailer_helper(input, expr)?;
+
+            attrs.extend(expr.replace_attrs(Vec::new()));
+            expr.replace_attrs(attrs);
+
+            let allow_struct = AllowStruct(true);
+            return parse_expr(input, expr, allow_struct, Precedence::MIN);
+        }
+
+        attrs.extend(expr.replace_attrs(Vec::new()));
+        expr.replace_attrs(attrs);
+        Ok(expr)
+    }
+
+    #[cfg(feature = "full")]
+    impl Copy for AllowStruct {}
+
+    #[cfg(feature = "full")]
+    impl Clone for AllowStruct {
+        fn clone(&self) -> Self {
+            *self
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn can_begin_expr(input: ParseStream) -> bool {
+        input.peek(Ident::peek_any) // value name or keyword
+            || input.peek(token::Paren) // tuple
+            || input.peek(token::Bracket) // array
+            || input.peek(token::Brace) // block
+            || input.peek(Lit) // literal
+            || input.peek(Token![!]) && !input.peek(Token![!=]) // operator not
+            || input.peek(Token![-]) && !input.peek(Token![-=]) && !input.peek(Token![->]) // unary minus
+            || input.peek(Token![*]) && !input.peek(Token![*=]) // dereference
+            || input.peek(Token![|]) && !input.peek(Token![|=]) // closure
+            || input.peek(Token![&]) && !input.peek(Token![&=]) // reference
+            || input.peek(Token![..]) // range notation
+            || input.peek(Token![<]) && !input.peek(Token![<=]) && !input.peek(Token![<<=]) // associated path
+            || input.peek(Token![::]) // global path
+            || input.peek(Lifetime) // labeled loop
+            || input.peek(Token![#]) // expression attributes
+    }
+
+    #[cfg(feature = "full")]
+    fn parse_expr(
+        input: ParseStream,
+        mut lhs: Expr,
+        allow_struct: AllowStruct,
+        base: Precedence,
+    ) -> Result<Expr> {
+        loop {
+            let ahead = input.fork();
+            if let Expr::Range(ExprRange { end: Some(_), .. }) = lhs {
+                // A range with an upper bound cannot be the left-hand side of
+                // another binary operator.
+                break;
+            } else if let Ok(op) = ahead.parse::<BinOp>() {
+                let precedence = Precedence::of_binop(&op);
+                if precedence < base {
+                    break;
+                }
+                if precedence == Precedence::Compare {
+                    if let Expr::Binary(lhs) = &lhs {
+                        if Precedence::of_binop(&lhs.op) == Precedence::Compare {
+                            break;
+                        }
+                    }
+                }
+                input.advance_to(&ahead);
+                let right = parse_binop_rhs(input, allow_struct, precedence)?;
+                lhs = Expr::Binary(ExprBinary {
+                    attrs: Vec::new(),
+                    left: Box::new(lhs),
+                    op,
+                    right,
+                });
+            } else if Precedence::Assign >= base && input.peek(Token![=]) && !input.peek(Token![=>])
+            {
+                let eq_token: Token![=] = input.parse()?;
+                let right = parse_binop_rhs(input, allow_struct, Precedence::Assign)?;
+                lhs = Expr::Assign(ExprAssign {
+                    attrs: Vec::new(),
+                    left: Box::new(lhs),
+                    eq_token,
+                    right,
+                });
+            } else if Precedence::Range >= base && input.peek(Token![..]) {
+                let limits: RangeLimits = input.parse()?;
+                let end = parse_range_end(input, &limits, allow_struct)?;
+                lhs = Expr::Range(ExprRange {
+                    attrs: Vec::new(),
+                    start: Some(Box::new(lhs)),
+                    limits,
+                    end,
+                });
+            } else if Precedence::Cast >= base && input.peek(Token![as]) {
+                let as_token: Token![as] = input.parse()?;
+                let allow_plus = false;
+                let allow_group_generic = false;
+                let ty = ty::parsing::ambig_ty(input, allow_plus, allow_group_generic)?;
+                check_cast(input)?;
+                lhs = Expr::Cast(ExprCast {
+                    attrs: Vec::new(),
+                    expr: Box::new(lhs),
+                    as_token,
+                    ty: Box::new(ty),
+                });
+            } else {
+                break;
+            }
+        }
+        Ok(lhs)
+    }
+
+    #[cfg(not(feature = "full"))]
+    fn parse_expr(input: ParseStream, mut lhs: Expr, base: Precedence) -> Result<Expr> {
+        loop {
+            let ahead = input.fork();
+            if let Ok(op) = ahead.parse::<BinOp>() {
+                let precedence = Precedence::of_binop(&op);
+                if precedence < base {
+                    break;
+                }
+                if precedence == Precedence::Compare {
+                    if let Expr::Binary(lhs) = &lhs {
+                        if Precedence::of_binop(&lhs.op) == Precedence::Compare {
+                            break;
+                        }
+                    }
+                }
+                input.advance_to(&ahead);
+                let right = parse_binop_rhs(input, precedence)?;
+                lhs = Expr::Binary(ExprBinary {
+                    attrs: Vec::new(),
+                    left: Box::new(lhs),
+                    op,
+                    right,
+                });
+            } else if Precedence::Cast >= base && input.peek(Token![as]) {
+                let as_token: Token![as] = input.parse()?;
+                let allow_plus = false;
+                let allow_group_generic = false;
+                let ty = ty::parsing::ambig_ty(input, allow_plus, allow_group_generic)?;
+                check_cast(input)?;
+                lhs = Expr::Cast(ExprCast {
+                    attrs: Vec::new(),
+                    expr: Box::new(lhs),
+                    as_token,
+                    ty: Box::new(ty),
+                });
+            } else {
+                break;
+            }
+        }
+        Ok(lhs)
+    }
+
+    fn parse_binop_rhs(
+        input: ParseStream,
+        #[cfg(feature = "full")] allow_struct: AllowStruct,
+        precedence: Precedence,
+    ) -> Result<Box<Expr>> {
+        let mut rhs = unary_expr(
+            input,
+            #[cfg(feature = "full")]
+            allow_struct,
+        )?;
+        loop {
+            let next = peek_precedence(input);
+            if next > precedence || next == precedence && precedence == Precedence::Assign {
+                rhs = parse_expr(
+                    input,
+                    rhs,
+                    #[cfg(feature = "full")]
+                    allow_struct,
+                    next,
+                )?;
+            } else {
+                return Ok(Box::new(rhs));
+            }
+        }
+    }
+
+    fn peek_precedence(input: ParseStream) -> Precedence {
+        if let Ok(op) = input.fork().parse() {
+            Precedence::of_binop(&op)
+        } else if input.peek(Token![=]) && !input.peek(Token![=>]) {
+            Precedence::Assign
+        } else if input.peek(Token![..]) {
+            Precedence::Range
+        } else if input.peek(Token![as]) {
+            Precedence::Cast
+        } else {
+            Precedence::MIN
+        }
+    }
+
+    // Parse an arbitrary expression.
+    pub(super) fn ambiguous_expr(
+        input: ParseStream,
+        #[cfg(feature = "full")] allow_struct: AllowStruct,
+    ) -> Result<Expr> {
+        let lhs = unary_expr(
+            input,
+            #[cfg(feature = "full")]
+            allow_struct,
+        )?;
+        parse_expr(
+            input,
+            lhs,
+            #[cfg(feature = "full")]
+            allow_struct,
+            Precedence::MIN,
+        )
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_attrs(input: ParseStream) -> Result<Vec<Attribute>> {
+        let mut attrs = Vec::new();
+        while !input.peek(token::Group) && input.peek(Token![#]) {
+            attrs.push(input.call(attr::parsing::single_parse_outer)?);
+        }
+        Ok(attrs)
+    }
+
+    // <UnOp> <trailer>
+    // & <trailer>
+    // &mut <trailer>
+    // box <trailer>
+    #[cfg(feature = "full")]
+    fn unary_expr(input: ParseStream, allow_struct: AllowStruct) -> Result<Expr> {
+        let begin = input.fork();
+        let attrs = input.call(expr_attrs)?;
+        if input.peek(token::Group) {
+            return trailer_expr(begin, attrs, input, allow_struct);
+        }
+
+        if input.peek(Token![&]) {
+            let and_token: Token![&] = input.parse()?;
+            let raw: Option<kw::raw> = if input.peek(kw::raw)
+                && (input.peek2(Token![mut]) || input.peek2(Token![const]))
+            {
+                Some(input.parse()?)
+            } else {
+                None
+            };
+            let mutability: Option<Token![mut]> = input.parse()?;
+            if raw.is_some() && mutability.is_none() {
+                input.parse::<Token![const]>()?;
+            }
+            let expr = Box::new(unary_expr(input, allow_struct)?);
+            if raw.is_some() {
+                Ok(Expr::Verbatim(verbatim::between(&begin, input)))
+            } else {
+                Ok(Expr::Reference(ExprReference {
+                    attrs,
+                    and_token,
+                    mutability,
+                    expr,
+                }))
+            }
+        } else if input.peek(Token![*]) || input.peek(Token![!]) || input.peek(Token![-]) {
+            expr_unary(input, attrs, allow_struct).map(Expr::Unary)
+        } else {
+            trailer_expr(begin, attrs, input, allow_struct)
+        }
+    }
+
+    #[cfg(not(feature = "full"))]
+    fn unary_expr(input: ParseStream) -> Result<Expr> {
+        if input.peek(Token![&]) {
+            Ok(Expr::Reference(ExprReference {
+                attrs: Vec::new(),
+                and_token: input.parse()?,
+                mutability: input.parse()?,
+                expr: Box::new(unary_expr(input)?),
+            }))
+        } else if input.peek(Token![*]) || input.peek(Token![!]) || input.peek(Token![-]) {
+            Ok(Expr::Unary(ExprUnary {
+                attrs: Vec::new(),
+                op: input.parse()?,
+                expr: Box::new(unary_expr(input)?),
+            }))
+        } else {
+            trailer_expr(input)
+        }
+    }
+
+    // <atom> (..<args>) ...
+    // <atom> . <ident> (..<args>) ...
+    // <atom> . <ident> ...
+    // <atom> . <lit> ...
+    // <atom> [ <expr> ] ...
+    // <atom> ? ...
+    #[cfg(feature = "full")]
+    fn trailer_expr(
+        begin: ParseBuffer,
+        mut attrs: Vec<Attribute>,
+        input: ParseStream,
+        allow_struct: AllowStruct,
+    ) -> Result<Expr> {
+        let atom = atom_expr(input, allow_struct)?;
+        let mut e = trailer_helper(input, atom)?;
+
+        if let Expr::Verbatim(tokens) = &mut e {
+            *tokens = verbatim::between(&begin, input);
+        } else {
+            let inner_attrs = e.replace_attrs(Vec::new());
+            attrs.extend(inner_attrs);
+            e.replace_attrs(attrs);
+        }
+
+        Ok(e)
+    }
+
+    #[cfg(feature = "full")]
+    fn trailer_helper(input: ParseStream, mut e: Expr) -> Result<Expr> {
+        loop {
+            if input.peek(token::Paren) {
+                let content;
+                e = Expr::Call(ExprCall {
+                    attrs: Vec::new(),
+                    func: Box::new(e),
+                    paren_token: parenthesized!(content in input),
+                    args: content.parse_terminated(Expr::parse, Token![,])?,
+                });
+            } else if input.peek(Token![.])
+                && !input.peek(Token![..])
+                && match e {
+                    Expr::Range(_) => false,
+                    _ => true,
+                }
+            {
+                let mut dot_token: Token![.] = input.parse()?;
+
+                let float_token: Option<LitFloat> = input.parse()?;
+                if let Some(float_token) = float_token {
+                    if multi_index(&mut e, &mut dot_token, float_token)? {
+                        continue;
+                    }
+                }
+
+                let await_token: Option<Token![await]> = input.parse()?;
+                if let Some(await_token) = await_token {
+                    e = Expr::Await(ExprAwait {
+                        attrs: Vec::new(),
+                        base: Box::new(e),
+                        dot_token,
+                        await_token,
+                    });
+                    continue;
+                }
+
+                let member: Member = input.parse()?;
+                let turbofish = if member.is_named() && input.peek(Token![::]) {
+                    Some(AngleBracketedGenericArguments::parse_turbofish(input)?)
+                } else {
+                    None
+                };
+
+                if turbofish.is_some() || input.peek(token::Paren) {
+                    if let Member::Named(method) = member {
+                        let content;
+                        e = Expr::MethodCall(ExprMethodCall {
+                            attrs: Vec::new(),
+                            receiver: Box::new(e),
+                            dot_token,
+                            method,
+                            turbofish,
+                            paren_token: parenthesized!(content in input),
+                            args: content.parse_terminated(Expr::parse, Token![,])?,
+                        });
+                        continue;
+                    }
+                }
+
+                e = Expr::Field(ExprField {
+                    attrs: Vec::new(),
+                    base: Box::new(e),
+                    dot_token,
+                    member,
+                });
+            } else if input.peek(token::Bracket) {
+                let content;
+                e = Expr::Index(ExprIndex {
+                    attrs: Vec::new(),
+                    expr: Box::new(e),
+                    bracket_token: bracketed!(content in input),
+                    index: content.parse()?,
+                });
+            } else if input.peek(Token![?]) {
+                e = Expr::Try(ExprTry {
+                    attrs: Vec::new(),
+                    expr: Box::new(e),
+                    question_token: input.parse()?,
+                });
+            } else {
+                break;
+            }
+        }
+        Ok(e)
+    }
+
+    #[cfg(not(feature = "full"))]
+    fn trailer_expr(input: ParseStream) -> Result<Expr> {
+        let mut e = atom_expr(input)?;
+
+        loop {
+            if input.peek(token::Paren) {
+                let content;
+                e = Expr::Call(ExprCall {
+                    attrs: Vec::new(),
+                    func: Box::new(e),
+                    paren_token: parenthesized!(content in input),
+                    args: content.parse_terminated(Expr::parse, Token![,])?,
+                });
+            } else if input.peek(Token![.])
+                && !input.peek(Token![..])
+                && !input.peek2(Token![await])
+            {
+                let mut dot_token: Token![.] = input.parse()?;
+
+                let float_token: Option<LitFloat> = input.parse()?;
+                if let Some(float_token) = float_token {
+                    if multi_index(&mut e, &mut dot_token, float_token)? {
+                        continue;
+                    }
+                }
+
+                let member: Member = input.parse()?;
+                let turbofish = if member.is_named() && input.peek(Token![::]) {
+                    let colon2_token: Token![::] = input.parse()?;
+                    let turbofish =
+                        AngleBracketedGenericArguments::do_parse(Some(colon2_token), input)?;
+                    Some(turbofish)
+                } else {
+                    None
+                };
+
+                if turbofish.is_some() || input.peek(token::Paren) {
+                    if let Member::Named(method) = member {
+                        let content;
+                        e = Expr::MethodCall(ExprMethodCall {
+                            attrs: Vec::new(),
+                            receiver: Box::new(e),
+                            dot_token,
+                            method,
+                            turbofish,
+                            paren_token: parenthesized!(content in input),
+                            args: content.parse_terminated(Expr::parse, Token![,])?,
+                        });
+                        continue;
+                    }
+                }
+
+                e = Expr::Field(ExprField {
+                    attrs: Vec::new(),
+                    base: Box::new(e),
+                    dot_token,
+                    member,
+                });
+            } else if input.peek(token::Bracket) {
+                let content;
+                e = Expr::Index(ExprIndex {
+                    attrs: Vec::new(),
+                    expr: Box::new(e),
+                    bracket_token: bracketed!(content in input),
+                    index: content.parse()?,
+                });
+            } else {
+                break;
+            }
+        }
+
+        Ok(e)
+    }
+
+    // Parse all atomic expressions which don't have to worry about precedence
+    // interactions, as they are fully contained.
+    #[cfg(feature = "full")]
+    fn atom_expr(input: ParseStream, allow_struct: AllowStruct) -> Result<Expr> {
+        if input.peek(token::Group) {
+            expr_group(input, allow_struct)
+        } else if input.peek(Lit) {
+            input.parse().map(Expr::Lit)
+        } else if input.peek(Token![async])
+            && (input.peek2(token::Brace) || input.peek2(Token![move]) && input.peek3(token::Brace))
+        {
+            input.parse().map(Expr::Async)
+        } else if input.peek(Token![try]) && input.peek2(token::Brace) {
+            input.parse().map(Expr::TryBlock)
+        } else if input.peek(Token![|])
+            || input.peek(Token![move])
+            || input.peek(Token![for])
+                && input.peek2(Token![<])
+                && (input.peek3(Lifetime) || input.peek3(Token![>]))
+            || input.peek(Token![const]) && !input.peek2(token::Brace)
+            || input.peek(Token![static])
+            || input.peek(Token![async]) && (input.peek2(Token![|]) || input.peek2(Token![move]))
+        {
+            expr_closure(input, allow_struct).map(Expr::Closure)
+        } else if input.peek(kw::builtin) && input.peek2(Token![#]) {
+            expr_builtin(input)
+        } else if input.peek(Ident)
+            || input.peek(Token![::])
+            || input.peek(Token![<])
+            || input.peek(Token![self])
+            || input.peek(Token![Self])
+            || input.peek(Token![super])
+            || input.peek(Token![crate])
+            || input.peek(Token![try]) && (input.peek2(Token![!]) || input.peek2(Token![::]))
+        {
+            path_or_macro_or_struct(input, allow_struct)
+        } else if input.peek(token::Paren) {
+            paren_or_tuple(input)
+        } else if input.peek(Token![break]) {
+            expr_break(input, allow_struct).map(Expr::Break)
+        } else if input.peek(Token![continue]) {
+            input.parse().map(Expr::Continue)
+        } else if input.peek(Token![return]) {
+            input.parse().map(Expr::Return)
+        } else if input.peek(token::Bracket) {
+            array_or_repeat(input)
+        } else if input.peek(Token![let]) {
+            expr_let(input, allow_struct).map(Expr::Let)
+        } else if input.peek(Token![if]) {
+            input.parse().map(Expr::If)
+        } else if input.peek(Token![while]) {
+            input.parse().map(Expr::While)
+        } else if input.peek(Token![for]) {
+            input.parse().map(Expr::ForLoop)
+        } else if input.peek(Token![loop]) {
+            input.parse().map(Expr::Loop)
+        } else if input.peek(Token![match]) {
+            input.parse().map(Expr::Match)
+        } else if input.peek(Token![yield]) {
+            input.parse().map(Expr::Yield)
+        } else if input.peek(Token![unsafe]) {
+            input.parse().map(Expr::Unsafe)
+        } else if input.peek(Token![const]) {
+            input.parse().map(Expr::Const)
+        } else if input.peek(token::Brace) {
+            input.parse().map(Expr::Block)
+        } else if input.peek(Token![..]) {
+            expr_range(input, allow_struct).map(Expr::Range)
+        } else if input.peek(Token![_]) {
+            input.parse().map(Expr::Infer)
+        } else if input.peek(Lifetime) {
+            atom_labeled(input)
+        } else {
+            Err(input.error("expected an expression"))
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn atom_labeled(input: ParseStream) -> Result<Expr> {
+        let the_label: Label = input.parse()?;
+        let mut expr = if input.peek(Token![while]) {
+            Expr::While(input.parse()?)
+        } else if input.peek(Token![for]) {
+            Expr::ForLoop(input.parse()?)
+        } else if input.peek(Token![loop]) {
+            Expr::Loop(input.parse()?)
+        } else if input.peek(token::Brace) {
+            Expr::Block(input.parse()?)
+        } else {
+            return Err(input.error("expected loop or block expression"));
+        };
+        match &mut expr {
+            Expr::While(ExprWhile { label, .. })
+            | Expr::ForLoop(ExprForLoop { label, .. })
+            | Expr::Loop(ExprLoop { label, .. })
+            | Expr::Block(ExprBlock { label, .. }) => *label = Some(the_label),
+            _ => unreachable!(),
+        }
+        Ok(expr)
+    }
+
+    #[cfg(not(feature = "full"))]
+    fn atom_expr(input: ParseStream) -> Result<Expr> {
+        if input.peek(token::Group) {
+            expr_group(input)
+        } else if input.peek(Lit) {
+            input.parse().map(Expr::Lit)
+        } else if input.peek(token::Paren) {
+            input.call(expr_paren).map(Expr::Paren)
+        } else if input.peek(Ident)
+            || input.peek(Token![::])
+            || input.peek(Token![<])
+            || input.peek(Token![self])
+            || input.peek(Token![Self])
+            || input.peek(Token![super])
+            || input.peek(Token![crate])
+        {
+            path_or_macro_or_struct(input)
+        } else if input.is_empty() {
+            Err(input.error("expected an expression"))
+        } else {
+            if input.peek(token::Brace) {
+                let scan = input.fork();
+                let content;
+                braced!(content in scan);
+                if content.parse::<Expr>().is_ok() && content.is_empty() {
+                    let expr_block = verbatim::between(input, &scan);
+                    input.advance_to(&scan);
+                    return Ok(Expr::Verbatim(expr_block));
+                }
+            }
+            Err(input.error("unsupported expression; enable syn's features=[\"full\"]"))
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_builtin(input: ParseStream) -> Result<Expr> {
+        let begin = input.fork();
+
+        input.parse::<kw::builtin>()?;
+        input.parse::<Token![#]>()?;
+        input.parse::<Ident>()?;
+
+        let args;
+        parenthesized!(args in input);
+        args.parse::<TokenStream>()?;
+
+        Ok(Expr::Verbatim(verbatim::between(&begin, input)))
+    }
+
+    fn path_or_macro_or_struct(
+        input: ParseStream,
+        #[cfg(feature = "full")] allow_struct: AllowStruct,
+    ) -> Result<Expr> {
+        let (qself, path) = path::parsing::qpath(input, true)?;
+        rest_of_path_or_macro_or_struct(
+            qself,
+            path,
+            input,
+            #[cfg(feature = "full")]
+            allow_struct,
+        )
+    }
+
+    fn rest_of_path_or_macro_or_struct(
+        qself: Option<QSelf>,
+        path: Path,
+        input: ParseStream,
+        #[cfg(feature = "full")] allow_struct: AllowStruct,
+    ) -> Result<Expr> {
+        if qself.is_none()
+            && input.peek(Token![!])
+            && !input.peek(Token![!=])
+            && path.is_mod_style()
+        {
+            let bang_token: Token![!] = input.parse()?;
+            let (delimiter, tokens) = mac::parse_delimiter(input)?;
+            return Ok(Expr::Macro(ExprMacro {
+                attrs: Vec::new(),
+                mac: Macro {
+                    path,
+                    bang_token,
+                    delimiter,
+                    tokens,
+                },
+            }));
+        }
+
+        #[cfg(not(feature = "full"))]
+        let allow_struct = (true,);
+        if allow_struct.0 && input.peek(token::Brace) {
+            return expr_struct_helper(input, qself, path).map(Expr::Struct);
+        }
+
+        Ok(Expr::Path(ExprPath {
+            attrs: Vec::new(),
+            qself,
+            path,
+        }))
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprMacro {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ExprMacro {
+                attrs: Vec::new(),
+                mac: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn paren_or_tuple(input: ParseStream) -> Result<Expr> {
+        let content;
+        let paren_token = parenthesized!(content in input);
+        if content.is_empty() {
+            return Ok(Expr::Tuple(ExprTuple {
+                attrs: Vec::new(),
+                paren_token,
+                elems: Punctuated::new(),
+            }));
+        }
+
+        let first: Expr = content.parse()?;
+        if content.is_empty() {
+            return Ok(Expr::Paren(ExprParen {
+                attrs: Vec::new(),
+                paren_token,
+                expr: Box::new(first),
+            }));
+        }
+
+        let mut elems = Punctuated::new();
+        elems.push_value(first);
+        while !content.is_empty() {
+            let punct = content.parse()?;
+            elems.push_punct(punct);
+            if content.is_empty() {
+                break;
+            }
+            let value = content.parse()?;
+            elems.push_value(value);
+        }
+        Ok(Expr::Tuple(ExprTuple {
+            attrs: Vec::new(),
+            paren_token,
+            elems,
+        }))
+    }
+
+    #[cfg(feature = "full")]
+    fn array_or_repeat(input: ParseStream) -> Result<Expr> {
+        let content;
+        let bracket_token = bracketed!(content in input);
+        if content.is_empty() {
+            return Ok(Expr::Array(ExprArray {
+                attrs: Vec::new(),
+                bracket_token,
+                elems: Punctuated::new(),
+            }));
+        }
+
+        let first: Expr = content.parse()?;
+        if content.is_empty() || content.peek(Token![,]) {
+            let mut elems = Punctuated::new();
+            elems.push_value(first);
+            while !content.is_empty() {
+                let punct = content.parse()?;
+                elems.push_punct(punct);
+                if content.is_empty() {
+                    break;
+                }
+                let value = content.parse()?;
+                elems.push_value(value);
+            }
+            Ok(Expr::Array(ExprArray {
+                attrs: Vec::new(),
+                bracket_token,
+                elems,
+            }))
+        } else if content.peek(Token![;]) {
+            let semi_token: Token![;] = content.parse()?;
+            let len: Expr = content.parse()?;
+            Ok(Expr::Repeat(ExprRepeat {
+                attrs: Vec::new(),
+                bracket_token,
+                expr: Box::new(first),
+                semi_token,
+                len: Box::new(len),
+            }))
+        } else {
+            Err(content.error("expected `,` or `;`"))
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprArray {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            let bracket_token = bracketed!(content in input);
+            let mut elems = Punctuated::new();
+
+            while !content.is_empty() {
+                let first: Expr = content.parse()?;
+                elems.push_value(first);
+                if content.is_empty() {
+                    break;
+                }
+                let punct = content.parse()?;
+                elems.push_punct(punct);
+            }
+
+            Ok(ExprArray {
+                attrs: Vec::new(),
+                bracket_token,
+                elems,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprRepeat {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            Ok(ExprRepeat {
+                bracket_token: bracketed!(content in input),
+                attrs: Vec::new(),
+                expr: content.parse()?,
+                semi_token: content.parse()?,
+                len: content.parse()?,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn continue_parsing_early(mut expr: &Expr) -> bool {
+        while let Expr::Group(group) = expr {
+            expr = &group.expr;
+        }
+        match expr {
+            Expr::If(_)
+            | Expr::While(_)
+            | Expr::ForLoop(_)
+            | Expr::Loop(_)
+            | Expr::Match(_)
+            | Expr::TryBlock(_)
+            | Expr::Unsafe(_)
+            | Expr::Const(_)
+            | Expr::Block(_) => false,
+            _ => true,
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprLit {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ExprLit {
+                attrs: Vec::new(),
+                lit: input.parse()?,
+            })
+        }
+    }
+
+    fn expr_group(
+        input: ParseStream,
+        #[cfg(feature = "full")] allow_struct: AllowStruct,
+    ) -> Result<Expr> {
+        let group = crate::group::parse_group(input)?;
+        let mut inner: Expr = group.content.parse()?;
+
+        match inner {
+            Expr::Path(mut expr) if expr.attrs.is_empty() => {
+                let grouped_len = expr.path.segments.len();
+                Path::parse_rest(input, &mut expr.path, true)?;
+                match rest_of_path_or_macro_or_struct(
+                    expr.qself,
+                    expr.path,
+                    input,
+                    #[cfg(feature = "full")]
+                    allow_struct,
+                )? {
+                    Expr::Path(expr) if expr.path.segments.len() == grouped_len => {
+                        inner = Expr::Path(expr);
+                    }
+                    extended => return Ok(extended),
+                }
+            }
+            _ => {}
+        }
+
+        Ok(Expr::Group(ExprGroup {
+            attrs: Vec::new(),
+            group_token: group.token,
+            expr: Box::new(inner),
+        }))
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprParen {
+        fn parse(input: ParseStream) -> Result<Self> {
+            expr_paren(input)
+        }
+    }
+
+    fn expr_paren(input: ParseStream) -> Result<ExprParen> {
+        let content;
+        Ok(ExprParen {
+            attrs: Vec::new(),
+            paren_token: parenthesized!(content in input),
+            expr: content.parse()?,
+        })
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprLet {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_struct = AllowStruct(true);
+            expr_let(input, allow_struct)
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_let(input: ParseStream, allow_struct: AllowStruct) -> Result<ExprLet> {
+        Ok(ExprLet {
+            attrs: Vec::new(),
+            let_token: input.parse()?,
+            pat: Box::new(Pat::parse_multi_with_leading_vert(input)?),
+            eq_token: input.parse()?,
+            expr: Box::new({
+                let lhs = unary_expr(input, allow_struct)?;
+                parse_expr(input, lhs, allow_struct, Precedence::Compare)?
+            }),
+        })
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprIf {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+
+            let mut clauses = Vec::new();
+            let mut expr;
+            loop {
+                let if_token: Token![if] = input.parse()?;
+                let cond = input.call(Expr::parse_without_eager_brace)?;
+                let then_branch: Block = input.parse()?;
+
+                expr = ExprIf {
+                    attrs: Vec::new(),
+                    if_token,
+                    cond: Box::new(cond),
+                    then_branch,
+                    else_branch: None,
+                };
+
+                if !input.peek(Token![else]) {
+                    break;
+                }
+
+                let else_token: Token![else] = input.parse()?;
+                let lookahead = input.lookahead1();
+                if lookahead.peek(Token![if]) {
+                    expr.else_branch = Some((else_token, Box::new(Expr::PLACEHOLDER)));
+                    clauses.push(expr);
+                    continue;
+                } else if lookahead.peek(token::Brace) {
+                    expr.else_branch = Some((
+                        else_token,
+                        Box::new(Expr::Block(ExprBlock {
+                            attrs: Vec::new(),
+                            label: None,
+                            block: input.parse()?,
+                        })),
+                    ));
+                    break;
+                } else {
+                    return Err(lookahead.error());
+                }
+            }
+
+            while let Some(mut prev) = clauses.pop() {
+                *prev.else_branch.as_mut().unwrap().1 = Expr::If(expr);
+                expr = prev;
+            }
+            expr.attrs = attrs;
+            Ok(expr)
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprInfer {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ExprInfer {
+                attrs: input.call(Attribute::parse_outer)?,
+                underscore_token: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprForLoop {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let label: Option<Label> = input.parse()?;
+            let for_token: Token![for] = input.parse()?;
+
+            let pat = Pat::parse_multi_with_leading_vert(input)?;
+
+            let in_token: Token![in] = input.parse()?;
+            let expr: Expr = input.call(Expr::parse_without_eager_brace)?;
+
+            let content;
+            let brace_token = braced!(content in input);
+            attr::parsing::parse_inner(&content, &mut attrs)?;
+            let stmts = content.call(Block::parse_within)?;
+
+            Ok(ExprForLoop {
+                attrs,
+                label,
+                for_token,
+                pat: Box::new(pat),
+                in_token,
+                expr: Box::new(expr),
+                body: Block { brace_token, stmts },
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprLoop {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let label: Option<Label> = input.parse()?;
+            let loop_token: Token![loop] = input.parse()?;
+
+            let content;
+            let brace_token = braced!(content in input);
+            attr::parsing::parse_inner(&content, &mut attrs)?;
+            let stmts = content.call(Block::parse_within)?;
+
+            Ok(ExprLoop {
+                attrs,
+                label,
+                loop_token,
+                body: Block { brace_token, stmts },
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprMatch {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let match_token: Token![match] = input.parse()?;
+            let expr = Expr::parse_without_eager_brace(input)?;
+
+            let content;
+            let brace_token = braced!(content in input);
+            attr::parsing::parse_inner(&content, &mut attrs)?;
+
+            let mut arms = Vec::new();
+            while !content.is_empty() {
+                arms.push(content.call(Arm::parse)?);
+            }
+
+            Ok(ExprMatch {
+                attrs,
+                match_token,
+                expr: Box::new(expr),
+                brace_token,
+                arms,
+            })
+        }
+    }
+
+    macro_rules! impl_by_parsing_expr {
+        (
+            $(
+                $expr_type:ty, $variant:ident, $msg:expr,
+            )*
+        ) => {
+            $(
+                #[cfg(all(feature = "full", feature = "printing"))]
+                #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+                impl Parse for $expr_type {
+                    fn parse(input: ParseStream) -> Result<Self> {
+                        let mut expr: Expr = input.parse()?;
+                        loop {
+                            match expr {
+                                Expr::$variant(inner) => return Ok(inner),
+                                Expr::Group(next) => expr = *next.expr,
+                                _ => return Err(Error::new_spanned(expr, $msg)),
+                            }
+                        }
+                    }
+                }
+            )*
+        };
+    }
+
+    impl_by_parsing_expr! {
+        ExprAssign, Assign, "expected assignment expression",
+        ExprAwait, Await, "expected await expression",
+        ExprBinary, Binary, "expected binary operation",
+        ExprCall, Call, "expected function call expression",
+        ExprCast, Cast, "expected cast expression",
+        ExprField, Field, "expected struct field access",
+        ExprIndex, Index, "expected indexing expression",
+        ExprMethodCall, MethodCall, "expected method call expression",
+        ExprRange, Range, "expected range expression",
+        ExprTry, Try, "expected try expression",
+        ExprTuple, Tuple, "expected tuple expression",
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprUnary {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = Vec::new();
+            let allow_struct = AllowStruct(true);
+            expr_unary(input, attrs, allow_struct)
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_unary(
+        input: ParseStream,
+        attrs: Vec<Attribute>,
+        allow_struct: AllowStruct,
+    ) -> Result<ExprUnary> {
+        Ok(ExprUnary {
+            attrs,
+            op: input.parse()?,
+            expr: Box::new(unary_expr(input, allow_struct)?),
+        })
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprClosure {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_struct = AllowStruct(true);
+            expr_closure(input, allow_struct)
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprReference {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_struct = AllowStruct(true);
+            Ok(ExprReference {
+                attrs: Vec::new(),
+                and_token: input.parse()?,
+                mutability: input.parse()?,
+                expr: Box::new(unary_expr(input, allow_struct)?),
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprBreak {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_struct = AllowStruct(true);
+            expr_break(input, allow_struct)
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprReturn {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ExprReturn {
+                attrs: Vec::new(),
+                return_token: input.parse()?,
+                expr: {
+                    if can_begin_expr(input) {
+                        Some(input.parse()?)
+                    } else {
+                        None
+                    }
+                },
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprTryBlock {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ExprTryBlock {
+                attrs: Vec::new(),
+                try_token: input.parse()?,
+                block: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprYield {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ExprYield {
+                attrs: Vec::new(),
+                yield_token: input.parse()?,
+                expr: {
+                    if can_begin_expr(input) {
+                        Some(input.parse()?)
+                    } else {
+                        None
+                    }
+                },
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_closure(input: ParseStream, allow_struct: AllowStruct) -> Result<ExprClosure> {
+        let lifetimes: Option<BoundLifetimes> = input.parse()?;
+        let constness: Option<Token![const]> = input.parse()?;
+        let movability: Option<Token![static]> = input.parse()?;
+        let asyncness: Option<Token![async]> = input.parse()?;
+        let capture: Option<Token![move]> = input.parse()?;
+        let or1_token: Token![|] = input.parse()?;
+
+        let mut inputs = Punctuated::new();
+        loop {
+            if input.peek(Token![|]) {
+                break;
+            }
+            let value = closure_arg(input)?;
+            inputs.push_value(value);
+            if input.peek(Token![|]) {
+                break;
+            }
+            let punct: Token![,] = input.parse()?;
+            inputs.push_punct(punct);
+        }
+
+        let or2_token: Token![|] = input.parse()?;
+
+        let (output, body) = if input.peek(Token![->]) {
+            let arrow_token: Token![->] = input.parse()?;
+            let ty: Type = input.parse()?;
+            let body: Block = input.parse()?;
+            let output = ReturnType::Type(arrow_token, Box::new(ty));
+            let block = Expr::Block(ExprBlock {
+                attrs: Vec::new(),
+                label: None,
+                block: body,
+            });
+            (output, block)
+        } else {
+            let body = ambiguous_expr(input, allow_struct)?;
+            (ReturnType::Default, body)
+        };
+
+        Ok(ExprClosure {
+            attrs: Vec::new(),
+            lifetimes,
+            constness,
+            movability,
+            asyncness,
+            capture,
+            or1_token,
+            inputs,
+            or2_token,
+            output,
+            body: Box::new(body),
+        })
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprAsync {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ExprAsync {
+                attrs: Vec::new(),
+                async_token: input.parse()?,
+                capture: input.parse()?,
+                block: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn closure_arg(input: ParseStream) -> Result<Pat> {
+        let attrs = input.call(Attribute::parse_outer)?;
+        let mut pat = Pat::parse_single(input)?;
+
+        if input.peek(Token![:]) {
+            Ok(Pat::Type(PatType {
+                attrs,
+                pat: Box::new(pat),
+                colon_token: input.parse()?,
+                ty: input.parse()?,
+            }))
+        } else {
+            match &mut pat {
+                Pat::Const(pat) => pat.attrs = attrs,
+                Pat::Ident(pat) => pat.attrs = attrs,
+                Pat::Lit(pat) => pat.attrs = attrs,
+                Pat::Macro(pat) => pat.attrs = attrs,
+                Pat::Or(pat) => pat.attrs = attrs,
+                Pat::Paren(pat) => pat.attrs = attrs,
+                Pat::Path(pat) => pat.attrs = attrs,
+                Pat::Range(pat) => pat.attrs = attrs,
+                Pat::Reference(pat) => pat.attrs = attrs,
+                Pat::Rest(pat) => pat.attrs = attrs,
+                Pat::Slice(pat) => pat.attrs = attrs,
+                Pat::Struct(pat) => pat.attrs = attrs,
+                Pat::Tuple(pat) => pat.attrs = attrs,
+                Pat::TupleStruct(pat) => pat.attrs = attrs,
+                Pat::Type(_) => unreachable!(),
+                Pat::Verbatim(_) => {}
+                Pat::Wild(pat) => pat.attrs = attrs,
+            }
+            Ok(pat)
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprWhile {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let label: Option<Label> = input.parse()?;
+            let while_token: Token![while] = input.parse()?;
+            let cond = Expr::parse_without_eager_brace(input)?;
+
+            let content;
+            let brace_token = braced!(content in input);
+            attr::parsing::parse_inner(&content, &mut attrs)?;
+            let stmts = content.call(Block::parse_within)?;
+
+            Ok(ExprWhile {
+                attrs,
+                label,
+                while_token,
+                cond: Box::new(cond),
+                body: Block { brace_token, stmts },
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprConst {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let const_token: Token![const] = input.parse()?;
+
+            let content;
+            let brace_token = braced!(content in input);
+            let inner_attrs = content.call(Attribute::parse_inner)?;
+            let stmts = content.call(Block::parse_within)?;
+
+            Ok(ExprConst {
+                attrs: inner_attrs,
+                const_token,
+                block: Block { brace_token, stmts },
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Label {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(Label {
+                name: input.parse()?,
+                colon_token: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Option<Label> {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Lifetime) {
+                input.parse().map(Some)
+            } else {
+                Ok(None)
+            }
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprContinue {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ExprContinue {
+                attrs: Vec::new(),
+                continue_token: input.parse()?,
+                label: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_break(input: ParseStream, allow_struct: AllowStruct) -> Result<ExprBreak> {
+        let break_token: Token![break] = input.parse()?;
+
+        let ahead = input.fork();
+        let label: Option<Lifetime> = ahead.parse()?;
+        if label.is_some() && ahead.peek(Token![:]) {
+            // Not allowed: `break 'label: loop {...}`
+            // Parentheses are required. `break ('label: loop {...})`
+            let _: Expr = input.parse()?;
+            let start_span = label.unwrap().apostrophe;
+            let end_span = input.cursor().prev_span();
+            return Err(crate::error::new2(
+                start_span,
+                end_span,
+                "parentheses required",
+            ));
+        }
+
+        input.advance_to(&ahead);
+        let expr = if can_begin_expr(input) && (allow_struct.0 || !input.peek(token::Brace)) {
+            Some(input.parse()?)
+        } else {
+            None
+        };
+
+        Ok(ExprBreak {
+            attrs: Vec::new(),
+            break_token,
+            label,
+            expr,
+        })
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for FieldValue {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let member: Member = input.parse()?;
+            let (colon_token, value) = if input.peek(Token![:]) || !member.is_named() {
+                let colon_token: Token![:] = input.parse()?;
+                let value: Expr = input.parse()?;
+                (Some(colon_token), value)
+            } else if let Member::Named(ident) = &member {
+                let value = Expr::Path(ExprPath {
+                    attrs: Vec::new(),
+                    qself: None,
+                    path: Path::from(ident.clone()),
+                });
+                (None, value)
+            } else {
+                unreachable!()
+            };
+
+            Ok(FieldValue {
+                attrs,
+                member,
+                colon_token,
+                expr: value,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprStruct {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let (qself, path) = path::parsing::qpath(input, true)?;
+            expr_struct_helper(input, qself, path)
+        }
+    }
+
+    fn expr_struct_helper(
+        input: ParseStream,
+        qself: Option<QSelf>,
+        path: Path,
+    ) -> Result<ExprStruct> {
+        let content;
+        let brace_token = braced!(content in input);
+
+        let mut fields = Punctuated::new();
+        while !content.is_empty() {
+            if content.peek(Token![..]) {
+                return Ok(ExprStruct {
+                    attrs: Vec::new(),
+                    qself,
+                    path,
+                    brace_token,
+                    fields,
+                    dot2_token: Some(content.parse()?),
+                    rest: if content.is_empty() {
+                        None
+                    } else {
+                        Some(Box::new(content.parse()?))
+                    },
+                });
+            }
+
+            fields.push(content.parse()?);
+            if content.is_empty() {
+                break;
+            }
+            let punct: Token![,] = content.parse()?;
+            fields.push_punct(punct);
+        }
+
+        Ok(ExprStruct {
+            attrs: Vec::new(),
+            qself,
+            path,
+            brace_token,
+            fields,
+            dot2_token: None,
+            rest: None,
+        })
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprUnsafe {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let unsafe_token: Token![unsafe] = input.parse()?;
+
+            let content;
+            let brace_token = braced!(content in input);
+            let inner_attrs = content.call(Attribute::parse_inner)?;
+            let stmts = content.call(Block::parse_within)?;
+
+            Ok(ExprUnsafe {
+                attrs: inner_attrs,
+                unsafe_token,
+                block: Block { brace_token, stmts },
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprBlock {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let label: Option<Label> = input.parse()?;
+
+            let content;
+            let brace_token = braced!(content in input);
+            attr::parsing::parse_inner(&content, &mut attrs)?;
+            let stmts = content.call(Block::parse_within)?;
+
+            Ok(ExprBlock {
+                attrs,
+                label,
+                block: Block { brace_token, stmts },
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_range(input: ParseStream, allow_struct: AllowStruct) -> Result<ExprRange> {
+        let limits: RangeLimits = input.parse()?;
+        let end = parse_range_end(input, &limits, allow_struct)?;
+        Ok(ExprRange {
+            attrs: Vec::new(),
+            start: None,
+            limits,
+            end,
+        })
+    }
+
+    #[cfg(feature = "full")]
+    fn parse_range_end(
+        input: ParseStream,
+        limits: &RangeLimits,
+        allow_struct: AllowStruct,
+    ) -> Result<Option<Box<Expr>>> {
+        if matches!(limits, RangeLimits::HalfOpen(_))
+            && (input.is_empty()
+                || input.peek(Token![,])
+                || input.peek(Token![;])
+                || input.peek(Token![.]) && !input.peek(Token![..])
+                || !allow_struct.0 && input.peek(token::Brace))
+        {
+            Ok(None)
+        } else {
+            let end = parse_binop_rhs(input, allow_struct, Precedence::Range)?;
+            Ok(Some(end))
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for RangeLimits {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let lookahead = input.lookahead1();
+            let dot_dot = lookahead.peek(Token![..]);
+            let dot_dot_eq = dot_dot && lookahead.peek(Token![..=]);
+            let dot_dot_dot = dot_dot && input.peek(Token![...]);
+            if dot_dot_eq {
+                input.parse().map(RangeLimits::Closed)
+            } else if dot_dot && !dot_dot_dot {
+                input.parse().map(RangeLimits::HalfOpen)
+            } else {
+                Err(lookahead.error())
+            }
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl RangeLimits {
+        pub(crate) fn parse_obsolete(input: ParseStream) -> Result<Self> {
+            let lookahead = input.lookahead1();
+            let dot_dot = lookahead.peek(Token![..]);
+            let dot_dot_eq = dot_dot && lookahead.peek(Token![..=]);
+            let dot_dot_dot = dot_dot && input.peek(Token![...]);
+            if dot_dot_eq {
+                input.parse().map(RangeLimits::Closed)
+            } else if dot_dot_dot {
+                let dot3: Token![...] = input.parse()?;
+                Ok(RangeLimits::Closed(Token![..=](dot3.spans)))
+            } else if dot_dot {
+                input.parse().map(RangeLimits::HalfOpen)
+            } else {
+                Err(lookahead.error())
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprPath {
+        fn parse(input: ParseStream) -> Result<Self> {
+            #[cfg(not(feature = "full"))]
+            let attrs = Vec::new();
+            #[cfg(feature = "full")]
+            let attrs = input.call(Attribute::parse_outer)?;
+
+            let (qself, path) = path::parsing::qpath(input, true)?;
+
+            Ok(ExprPath { attrs, qself, path })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Member {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Ident) {
+                input.parse().map(Member::Named)
+            } else if input.peek(LitInt) {
+                input.parse().map(Member::Unnamed)
+            } else {
+                Err(input.error("expected identifier or integer"))
+            }
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Arm {
+        fn parse(input: ParseStream) -> Result<Arm> {
+            let requires_comma;
+            Ok(Arm {
+                attrs: input.call(Attribute::parse_outer)?,
+                pat: Pat::parse_multi_with_leading_vert(input)?,
+                guard: {
+                    if input.peek(Token![if]) {
+                        let if_token: Token![if] = input.parse()?;
+                        let guard: Expr = input.parse()?;
+                        Some((if_token, Box::new(guard)))
+                    } else {
+                        None
+                    }
+                },
+                fat_arrow_token: input.parse()?,
+                body: {
+                    let body = Expr::parse_with_earlier_boundary_rule(input)?;
+                    requires_comma = classify::requires_comma_to_be_match_arm(&body);
+                    Box::new(body)
+                },
+                comma: {
+                    if requires_comma && !input.is_empty() {
+                        Some(input.parse()?)
+                    } else {
+                        input.parse()?
+                    }
+                },
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Index {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let lit: LitInt = input.parse()?;
+            if lit.suffix().is_empty() {
+                Ok(Index {
+                    index: lit
+                        .base10_digits()
+                        .parse()
+                        .map_err(|err| Error::new(lit.span(), err))?,
+                    span: lit.span(),
+                })
+            } else {
+                Err(Error::new(lit.span(), "expected unsuffixed integer"))
+            }
+        }
+    }
+
+    fn multi_index(e: &mut Expr, dot_token: &mut Token![.], float: LitFloat) -> Result<bool> {
+        let float_token = float.token();
+        let float_span = float_token.span();
+        let mut float_repr = float_token.to_string();
+        let trailing_dot = float_repr.ends_with('.');
+        if trailing_dot {
+            float_repr.truncate(float_repr.len() - 1);
+        }
+
+        let mut offset = 0;
+        for part in float_repr.split('.') {
+            let mut index: Index =
+                crate::parse_str(part).map_err(|err| Error::new(float_span, err))?;
+            let part_end = offset + part.len();
+            index.span = float_token.subspan(offset..part_end).unwrap_or(float_span);
+
+            let base = mem::replace(e, Expr::PLACEHOLDER);
+            *e = Expr::Field(ExprField {
+                attrs: Vec::new(),
+                base: Box::new(base),
+                dot_token: Token![.](dot_token.span),
+                member: Member::Unnamed(index),
+            });
+
+            let dot_span = float_token
+                .subspan(part_end..part_end + 1)
+                .unwrap_or(float_span);
+            *dot_token = Token![.](dot_span);
+            offset = part_end + 1;
+        }
+
+        Ok(!trailing_dot)
+    }
+
+    impl Member {
+        pub(crate) fn is_named(&self) -> bool {
+            match self {
+                Member::Named(_) => true,
+                Member::Unnamed(_) => false,
+            }
+        }
+    }
+
+    fn check_cast(input: ParseStream) -> Result<()> {
+        let kind = if input.peek(Token![.]) && !input.peek(Token![..]) {
+            if input.peek2(Token![await]) {
+                "`.await`"
+            } else if input.peek2(Ident) && (input.peek3(token::Paren) || input.peek3(Token![::])) {
+                "a method call"
+            } else {
+                "a field access"
+            }
+        } else if input.peek(Token![?]) {
+            "`?`"
+        } else if input.peek(token::Bracket) {
+            "indexing"
+        } else if input.peek(token::Paren) {
+            "a function call"
+        } else {
+            return Ok(());
+        };
+        let msg = format!("casts cannot be followed by {}", kind);
+        Err(input.error(msg))
+    }
+}
+
+#[cfg(feature = "printing")]
+pub(crate) mod printing {
+    use crate::attr::Attribute;
+    #[cfg(feature = "full")]
+    use crate::attr::FilterAttrs;
+    #[cfg(feature = "full")]
+    use crate::classify;
+    #[cfg(feature = "full")]
+    use crate::expr::{
+        Arm, ExprArray, ExprAssign, ExprAsync, ExprAwait, ExprBlock, ExprBreak, ExprClosure,
+        ExprConst, ExprContinue, ExprForLoop, ExprIf, ExprInfer, ExprLet, ExprLoop, ExprMatch,
+        ExprRange, ExprRepeat, ExprReturn, ExprTry, ExprTryBlock, ExprTuple, ExprUnsafe, ExprWhile,
+        ExprYield, Label, RangeLimits,
+    };
+    use crate::expr::{
+        Expr, ExprBinary, ExprCall, ExprCast, ExprField, ExprGroup, ExprIndex, ExprLit, ExprMacro,
+        ExprMethodCall, ExprParen, ExprPath, ExprReference, ExprStruct, ExprUnary, FieldValue,
+        Index, Member,
+    };
+    use crate::fixup::FixupContext;
+    use crate::op::BinOp;
+    use crate::path;
+    use crate::precedence::Precedence;
+    use crate::token;
+    #[cfg(feature = "full")]
+    use crate::ty::ReturnType;
+    use proc_macro2::{Literal, Span, TokenStream};
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg(feature = "full")]
+    pub(crate) fn outer_attrs_to_tokens(attrs: &[Attribute], tokens: &mut TokenStream) {
+        tokens.append_all(attrs.outer());
+    }
+
+    #[cfg(feature = "full")]
+    fn inner_attrs_to_tokens(attrs: &[Attribute], tokens: &mut TokenStream) {
+        tokens.append_all(attrs.inner());
+    }
+
+    #[cfg(not(feature = "full"))]
+    pub(crate) fn outer_attrs_to_tokens(_attrs: &[Attribute], _tokens: &mut TokenStream) {}
+
+    #[cfg(feature = "full")]
+    fn print_condition(expr: &Expr, tokens: &mut TokenStream) {
+        print_subexpression(
+            expr,
+            classify::confusable_with_adjacent_block(expr),
+            tokens,
+            FixupContext::new_condition(),
+        );
+    }
+
+    fn print_subexpression(
+        expr: &Expr,
+        needs_group: bool,
+        tokens: &mut TokenStream,
+        mut fixup: FixupContext,
+    ) {
+        if needs_group {
+            // If we are surrounding the whole cond in parentheses, such as:
+            //
+            //     if (return Struct {}) {}
+            //
+            // then there is no need for parenthesizing the individual struct
+            // expressions within. On the other hand if the whole cond is not
+            // parenthesized, then print_expr must parenthesize exterior struct
+            // literals.
+            //
+            //     if x == (Struct {}) {}
+            //
+            fixup = FixupContext::NONE;
+        }
+
+        let do_print_expr = |tokens: &mut TokenStream| print_expr(expr, tokens, fixup);
+
+        if needs_group {
+            token::Paren::default().surround(tokens, do_print_expr);
+        } else {
+            do_print_expr(tokens);
+        }
+    }
+
+    pub(crate) fn print_expr(expr: &Expr, tokens: &mut TokenStream, mut fixup: FixupContext) {
+        #[cfg(feature = "full")]
+        let needs_group = fixup.would_cause_statement_boundary(expr);
+        #[cfg(not(feature = "full"))]
+        let needs_group = false;
+
+        if needs_group {
+            fixup = FixupContext::NONE;
+        }
+
+        let do_print_expr = |tokens: &mut TokenStream| match expr {
+            #[cfg(feature = "full")]
+            Expr::Array(e) => e.to_tokens(tokens),
+            #[cfg(feature = "full")]
+            Expr::Assign(e) => print_expr_assign(e, tokens, fixup),
+            #[cfg(feature = "full")]
+            Expr::Async(e) => e.to_tokens(tokens),
+            #[cfg(feature = "full")]
+            Expr::Await(e) => print_expr_await(e, tokens, fixup),
+            Expr::Binary(e) => print_expr_binary(e, tokens, fixup),
+            #[cfg(feature = "full")]
+            Expr::Block(e) => e.to_tokens(tokens),
+            #[cfg(feature = "full")]
+            Expr::Break(e) => print_expr_break(e, tokens, fixup),
+            Expr::Call(e) => print_expr_call(e, tokens, fixup),
+            Expr::Cast(e) => print_expr_cast(e, tokens, fixup),
+            #[cfg(feature = "full")]
+            Expr::Closure(e) => e.to_tokens(tokens),
+            #[cfg(feature = "full")]
+            Expr::Const(e) => e.to_tokens(tokens),
+            #[cfg(feature = "full")]
+            Expr::Continue(e) => e.to_tokens(tokens),
+            Expr::Field(e) => print_expr_field(e, tokens, fixup),
+            #[cfg(feature = "full")]
+            Expr::ForLoop(e) => e.to_tokens(tokens),
+            Expr::Group(e) => e.to_tokens(tokens),
+            #[cfg(feature = "full")]
+            Expr::If(e) => e.to_tokens(tokens),
+            #[cfg(feature = "full")]
+            Expr::Index(e) => print_expr_index(e, tokens, fixup),
+            #[cfg(feature = "full")]
+            Expr::Infer(e) => e.to_tokens(tokens),
+            #[cfg(feature = "full")]
+            Expr::Let(e) => print_expr_let(e, tokens, fixup),
+            Expr::Lit(e) => e.to_tokens(tokens),
+            #[cfg(feature = "full")]
+            Expr::Loop(e) => e.to_tokens(tokens),
+            Expr::Macro(e) => e.to_tokens(tokens),
+            #[cfg(feature = "full")]
+            Expr::Match(e) => e.to_tokens(tokens),
+            Expr::MethodCall(e) => print_expr_method_call(e, tokens, fixup),
+            Expr::Paren(e) => e.to_tokens(tokens),
+            Expr::Path(e) => e.to_tokens(tokens),
+            #[cfg(feature = "full")]
+            Expr::Range(e) => print_expr_range(e, tokens, fixup),
+            Expr::Reference(e) => print_expr_reference(e, tokens, fixup),
+            #[cfg(feature = "full")]
+            Expr::Repeat(e) => e.to_tokens(tokens),
+            #[cfg(feature = "full")]
+            Expr::Return(e) => print_expr_return(e, tokens, fixup),
+            Expr::Struct(e) => e.to_tokens(tokens),
+            #[cfg(feature = "full")]
+            Expr::Try(e) => print_expr_try(e, tokens, fixup),
+            #[cfg(feature = "full")]
+            Expr::TryBlock(e) => e.to_tokens(tokens),
+            #[cfg(feature = "full")]
+            Expr::Tuple(e) => e.to_tokens(tokens),
+            Expr::Unary(e) => print_expr_unary(e, tokens, fixup),
+            #[cfg(feature = "full")]
+            Expr::Unsafe(e) => e.to_tokens(tokens),
+            Expr::Verbatim(e) => e.to_tokens(tokens),
+            #[cfg(feature = "full")]
+            Expr::While(e) => e.to_tokens(tokens),
+            #[cfg(feature = "full")]
+            Expr::Yield(e) => print_expr_yield(e, tokens, fixup),
+
+            #[cfg(not(feature = "full"))]
+            _ => unreachable!(),
+        };
+
+        if needs_group {
+            token::Paren::default().surround(tokens, do_print_expr);
+        } else {
+            do_print_expr(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprArray {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.bracket_token.surround(tokens, |tokens| {
+                self.elems.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprAssign {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            print_expr_assign(self, tokens, FixupContext::NONE);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn print_expr_assign(e: &ExprAssign, tokens: &mut TokenStream, fixup: FixupContext) {
+        outer_attrs_to_tokens(&e.attrs, tokens);
+        print_subexpression(
+            &e.left,
+            Precedence::of(&e.left) <= Precedence::Range,
+            tokens,
+            fixup.leftmost_subexpression(),
+        );
+        e.eq_token.to_tokens(tokens);
+        print_subexpression(
+            &e.right,
+            fixup.trailing_precedence(&e.right) < Precedence::Assign,
+            tokens,
+            fixup.subsequent_subexpression(),
+        );
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprAsync {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.async_token.to_tokens(tokens);
+            self.capture.to_tokens(tokens);
+            self.block.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprAwait {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            print_expr_await(self, tokens, FixupContext::NONE);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn print_expr_await(e: &ExprAwait, tokens: &mut TokenStream, fixup: FixupContext) {
+        outer_attrs_to_tokens(&e.attrs, tokens);
+        print_subexpression(
+            &e.base,
+            Precedence::of(&e.base) < Precedence::Unambiguous,
+            tokens,
+            fixup.leftmost_subexpression_with_dot(),
+        );
+        e.dot_token.to_tokens(tokens);
+        e.await_token.to_tokens(tokens);
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprBinary {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            print_expr_binary(self, tokens, FixupContext::NONE);
+        }
+    }
+
+    fn print_expr_binary(e: &ExprBinary, tokens: &mut TokenStream, fixup: FixupContext) {
+        outer_attrs_to_tokens(&e.attrs, tokens);
+
+        let left_fixup = fixup.leftmost_subexpression_with_begin_operator(
+            #[cfg(feature = "full")]
+            match &e.op {
+                BinOp::Sub(_)
+                | BinOp::Mul(_)
+                | BinOp::And(_)
+                | BinOp::Or(_)
+                | BinOp::BitAnd(_)
+                | BinOp::BitOr(_)
+                | BinOp::Shl(_)
+                | BinOp::Lt(_) => true,
+                _ => false,
+            },
+            match &e.op {
+                BinOp::Shl(_) | BinOp::Lt(_) => true,
+                _ => false,
+            },
+        );
+
+        let binop_prec = Precedence::of_binop(&e.op);
+        let left_prec = left_fixup.leading_precedence(&e.left);
+        let right_prec = fixup.trailing_precedence(&e.right);
+        let (left_needs_group, right_needs_group) = match binop_prec {
+            Precedence::Assign => (left_prec <= Precedence::Range, right_prec < binop_prec),
+            Precedence::Compare => (left_prec <= binop_prec, right_prec <= binop_prec),
+            _ => (left_prec < binop_prec, right_prec <= binop_prec),
+        };
+
+        print_subexpression(&e.left, left_needs_group, tokens, left_fixup);
+        e.op.to_tokens(tokens);
+        print_subexpression(
+            &e.right,
+            right_needs_group,
+            tokens,
+            fixup.subsequent_subexpression(),
+        );
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprBlock {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.label.to_tokens(tokens);
+            self.block.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                tokens.append_all(&self.block.stmts);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprBreak {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            print_expr_break(self, tokens, FixupContext::NONE);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn print_expr_break(e: &ExprBreak, tokens: &mut TokenStream, fixup: FixupContext) {
+        outer_attrs_to_tokens(&e.attrs, tokens);
+        e.break_token.to_tokens(tokens);
+        e.label.to_tokens(tokens);
+        if let Some(value) = &e.expr {
+            print_subexpression(
+                value,
+                // Parenthesize `break 'inner: loop { break 'inner 1 } + 1`
+                //                     ^---------------------------------^
+                e.label.is_none() && classify::expr_leading_label(value),
+                tokens,
+                fixup.subsequent_subexpression(),
+            );
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprCall {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            print_expr_call(self, tokens, FixupContext::NONE);
+        }
+    }
+
+    fn print_expr_call(e: &ExprCall, tokens: &mut TokenStream, fixup: FixupContext) {
+        outer_attrs_to_tokens(&e.attrs, tokens);
+
+        let call_precedence = if let Expr::Field(_) = &*e.func {
+            Precedence::MIN
+        } else {
+            Precedence::Unambiguous
+        };
+        let func_fixup = fixup.leftmost_subexpression_with_begin_operator(
+            #[cfg(feature = "full")]
+            true,
+            false,
+        );
+        print_subexpression(
+            &e.func,
+            func_fixup.leading_precedence(&e.func) < call_precedence,
+            tokens,
+            func_fixup,
+        );
+
+        e.paren_token.surround(tokens, |tokens| {
+            e.args.to_tokens(tokens);
+        });
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprCast {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            print_expr_cast(self, tokens, FixupContext::NONE);
+        }
+    }
+
+    fn print_expr_cast(e: &ExprCast, tokens: &mut TokenStream, fixup: FixupContext) {
+        outer_attrs_to_tokens(&e.attrs, tokens);
+        print_subexpression(
+            &e.expr,
+            Precedence::of(&e.expr) < Precedence::Cast,
+            tokens,
+            fixup.leftmost_subexpression(),
+        );
+        e.as_token.to_tokens(tokens);
+        e.ty.to_tokens(tokens);
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprClosure {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.lifetimes.to_tokens(tokens);
+            self.constness.to_tokens(tokens);
+            self.movability.to_tokens(tokens);
+            self.asyncness.to_tokens(tokens);
+            self.capture.to_tokens(tokens);
+            self.or1_token.to_tokens(tokens);
+            self.inputs.to_tokens(tokens);
+            self.or2_token.to_tokens(tokens);
+            self.output.to_tokens(tokens);
+            if matches!(self.output, ReturnType::Default) || matches!(*self.body, Expr::Block(_)) {
+                self.body.to_tokens(tokens);
+            } else {
+                token::Brace::default().surround(tokens, |tokens| {
+                    print_expr(&self.body, tokens, FixupContext::new_stmt());
+                });
+            }
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprConst {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.const_token.to_tokens(tokens);
+            self.block.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                tokens.append_all(&self.block.stmts);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprContinue {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.continue_token.to_tokens(tokens);
+            self.label.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprField {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            print_expr_field(self, tokens, FixupContext::NONE);
+        }
+    }
+
+    fn print_expr_field(e: &ExprField, tokens: &mut TokenStream, fixup: FixupContext) {
+        outer_attrs_to_tokens(&e.attrs, tokens);
+        print_subexpression(
+            &e.base,
+            Precedence::of(&e.base) < Precedence::Unambiguous,
+            tokens,
+            fixup.leftmost_subexpression_with_dot(),
+        );
+        e.dot_token.to_tokens(tokens);
+        e.member.to_tokens(tokens);
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprForLoop {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.label.to_tokens(tokens);
+            self.for_token.to_tokens(tokens);
+            self.pat.to_tokens(tokens);
+            self.in_token.to_tokens(tokens);
+            print_condition(&self.expr, tokens);
+            self.body.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                tokens.append_all(&self.body.stmts);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprGroup {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.group_token.surround(tokens, |tokens| {
+                self.expr.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprIf {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+
+            let mut expr = self;
+            loop {
+                expr.if_token.to_tokens(tokens);
+                print_condition(&expr.cond, tokens);
+                expr.then_branch.to_tokens(tokens);
+
+                let (else_token, else_) = match &expr.else_branch {
+                    Some(else_branch) => else_branch,
+                    None => break,
+                };
+
+                else_token.to_tokens(tokens);
+                match &**else_ {
+                    Expr::If(next) => {
+                        expr = next;
+                    }
+                    Expr::Block(last) => {
+                        last.to_tokens(tokens);
+                        break;
+                    }
+                    // If this is not one of the valid expressions to exist in
+                    // an else clause, wrap it in a block.
+                    other => {
+                        token::Brace::default().surround(tokens, |tokens| {
+                            print_expr(other, tokens, FixupContext::new_stmt());
+                        });
+                        break;
+                    }
+                }
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprIndex {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            print_expr_index(self, tokens, FixupContext::NONE);
+        }
+    }
+
+    fn print_expr_index(e: &ExprIndex, tokens: &mut TokenStream, fixup: FixupContext) {
+        outer_attrs_to_tokens(&e.attrs, tokens);
+        let obj_fixup = fixup.leftmost_subexpression_with_begin_operator(
+            #[cfg(feature = "full")]
+            true,
+            false,
+        );
+        print_subexpression(
+            &e.expr,
+            obj_fixup.leading_precedence(&e.expr) < Precedence::Unambiguous,
+            tokens,
+            obj_fixup,
+        );
+        e.bracket_token.surround(tokens, |tokens| {
+            e.index.to_tokens(tokens);
+        });
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprInfer {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.underscore_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprLet {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            print_expr_let(self, tokens, FixupContext::NONE);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn print_expr_let(e: &ExprLet, tokens: &mut TokenStream, fixup: FixupContext) {
+        outer_attrs_to_tokens(&e.attrs, tokens);
+        e.let_token.to_tokens(tokens);
+        e.pat.to_tokens(tokens);
+        e.eq_token.to_tokens(tokens);
+        print_subexpression(
+            &e.expr,
+            fixup.needs_group_as_let_scrutinee(&e.expr),
+            tokens,
+            FixupContext::NONE,
+        );
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprLit {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.lit.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprLoop {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.label.to_tokens(tokens);
+            self.loop_token.to_tokens(tokens);
+            self.body.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                tokens.append_all(&self.body.stmts);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprMacro {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.mac.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprMatch {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.match_token.to_tokens(tokens);
+            print_condition(&self.expr, tokens);
+            self.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                for (i, arm) in self.arms.iter().enumerate() {
+                    arm.to_tokens(tokens);
+                    // Ensure that we have a comma after a non-block arm, except
+                    // for the last one.
+                    let is_last = i == self.arms.len() - 1;
+                    if !is_last
+                        && classify::requires_comma_to_be_match_arm(&arm.body)
+                        && arm.comma.is_none()
+                    {
+                        <Token![,]>::default().to_tokens(tokens);
+                    }
+                }
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprMethodCall {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            print_expr_method_call(self, tokens, FixupContext::NONE);
+        }
+    }
+
+    fn print_expr_method_call(e: &ExprMethodCall, tokens: &mut TokenStream, fixup: FixupContext) {
+        outer_attrs_to_tokens(&e.attrs, tokens);
+        print_subexpression(
+            &e.receiver,
+            Precedence::of(&e.receiver) < Precedence::Unambiguous,
+            tokens,
+            fixup.leftmost_subexpression_with_dot(),
+        );
+        e.dot_token.to_tokens(tokens);
+        e.method.to_tokens(tokens);
+        e.turbofish.to_tokens(tokens);
+        e.paren_token.surround(tokens, |tokens| {
+            e.args.to_tokens(tokens);
+        });
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprParen {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.paren_token.surround(tokens, |tokens| {
+                self.expr.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprPath {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            path::printing::print_path(tokens, &self.qself, &self.path);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprRange {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            print_expr_range(self, tokens, FixupContext::NONE);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn print_expr_range(e: &ExprRange, tokens: &mut TokenStream, fixup: FixupContext) {
+        outer_attrs_to_tokens(&e.attrs, tokens);
+        if let Some(start) = &e.start {
+            print_subexpression(
+                start,
+                Precedence::of(start) <= Precedence::Range,
+                tokens,
+                fixup.leftmost_subexpression(),
+            );
+        }
+        e.limits.to_tokens(tokens);
+        if let Some(end) = &e.end {
+            print_subexpression(
+                end,
+                fixup.trailing_precedence(end) <= Precedence::Range,
+                tokens,
+                fixup.subsequent_subexpression(),
+            );
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprReference {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            print_expr_reference(self, tokens, FixupContext::NONE);
+        }
+    }
+
+    fn print_expr_reference(e: &ExprReference, tokens: &mut TokenStream, fixup: FixupContext) {
+        outer_attrs_to_tokens(&e.attrs, tokens);
+        e.and_token.to_tokens(tokens);
+        e.mutability.to_tokens(tokens);
+        print_subexpression(
+            &e.expr,
+            fixup.trailing_precedence(&e.expr) < Precedence::Prefix,
+            tokens,
+            fixup.subsequent_subexpression(),
+        );
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprRepeat {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.bracket_token.surround(tokens, |tokens| {
+                self.expr.to_tokens(tokens);
+                self.semi_token.to_tokens(tokens);
+                self.len.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprReturn {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            print_expr_return(self, tokens, FixupContext::NONE);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn print_expr_return(e: &ExprReturn, tokens: &mut TokenStream, fixup: FixupContext) {
+        outer_attrs_to_tokens(&e.attrs, tokens);
+        e.return_token.to_tokens(tokens);
+        if let Some(expr) = &e.expr {
+            print_expr(expr, tokens, fixup.subsequent_subexpression());
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprStruct {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            path::printing::print_path(tokens, &self.qself, &self.path);
+            self.brace_token.surround(tokens, |tokens| {
+                self.fields.to_tokens(tokens);
+                if let Some(dot2_token) = &self.dot2_token {
+                    dot2_token.to_tokens(tokens);
+                } else if self.rest.is_some() {
+                    Token![..](Span::call_site()).to_tokens(tokens);
+                }
+                self.rest.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprTry {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            print_expr_try(self, tokens, FixupContext::NONE);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn print_expr_try(e: &ExprTry, tokens: &mut TokenStream, fixup: FixupContext) {
+        outer_attrs_to_tokens(&e.attrs, tokens);
+        print_subexpression(
+            &e.expr,
+            Precedence::of(&e.expr) < Precedence::Unambiguous,
+            tokens,
+            fixup.leftmost_subexpression_with_dot(),
+        );
+        e.question_token.to_tokens(tokens);
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprTryBlock {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.try_token.to_tokens(tokens);
+            self.block.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprTuple {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.paren_token.surround(tokens, |tokens| {
+                self.elems.to_tokens(tokens);
+                // If we only have one argument, we need a trailing comma to
+                // distinguish ExprTuple from ExprParen.
+                if self.elems.len() == 1 && !self.elems.trailing_punct() {
+                    <Token![,]>::default().to_tokens(tokens);
+                }
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprUnary {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            print_expr_unary(self, tokens, FixupContext::NONE);
+        }
+    }
+
+    fn print_expr_unary(e: &ExprUnary, tokens: &mut TokenStream, fixup: FixupContext) {
+        outer_attrs_to_tokens(&e.attrs, tokens);
+        e.op.to_tokens(tokens);
+        print_subexpression(
+            &e.expr,
+            fixup.trailing_precedence(&e.expr) < Precedence::Prefix,
+            tokens,
+            fixup.subsequent_subexpression(),
+        );
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprUnsafe {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.unsafe_token.to_tokens(tokens);
+            self.block.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                tokens.append_all(&self.block.stmts);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprWhile {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.label.to_tokens(tokens);
+            self.while_token.to_tokens(tokens);
+            print_condition(&self.cond, tokens);
+            self.body.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                tokens.append_all(&self.body.stmts);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprYield {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            print_expr_yield(self, tokens, FixupContext::NONE);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn print_expr_yield(e: &ExprYield, tokens: &mut TokenStream, fixup: FixupContext) {
+        outer_attrs_to_tokens(&e.attrs, tokens);
+        e.yield_token.to_tokens(tokens);
+        if let Some(expr) = &e.expr {
+            print_expr(expr, tokens, fixup.subsequent_subexpression());
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for Arm {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(&self.attrs);
+            self.pat.to_tokens(tokens);
+            if let Some((if_token, guard)) = &self.guard {
+                if_token.to_tokens(tokens);
+                guard.to_tokens(tokens);
+            }
+            self.fat_arrow_token.to_tokens(tokens);
+            print_expr(&self.body, tokens, FixupContext::new_match_arm());
+            self.comma.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for FieldValue {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.member.to_tokens(tokens);
+            if let Some(colon_token) = &self.colon_token {
+                colon_token.to_tokens(tokens);
+                self.expr.to_tokens(tokens);
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for Index {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            let mut lit = Literal::i64_unsuffixed(i64::from(self.index));
+            lit.set_span(self.span);
+            tokens.append(lit);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for Label {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.name.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for Member {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                Member::Named(ident) => ident.to_tokens(tokens),
+                Member::Unnamed(index) => index.to_tokens(tokens),
+            }
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for RangeLimits {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                RangeLimits::HalfOpen(t) => t.to_tokens(tokens),
+                RangeLimits::Closed(t) => t.to_tokens(tokens),
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/ext.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/ext.rs
--- 43.0.0-1/rust-vendor/syn/src/ext.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/ext.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,136 @@
+//! Extension traits to provide parsing methods on foreign types.
+
+use crate::buffer::Cursor;
+use crate::error::Result;
+use crate::parse::ParseStream;
+use crate::parse::Peek;
+use crate::sealed::lookahead;
+use crate::token::CustomToken;
+use proc_macro2::Ident;
+
+/// Additional methods for `Ident` not provided by proc-macro2 or libproc_macro.
+///
+/// This trait is sealed and cannot be implemented for types outside of Syn. It
+/// is implemented only for `proc_macro2::Ident`.
+pub trait IdentExt: Sized + private::Sealed {
+    /// Parses any identifier including keywords.
+    ///
+    /// This is useful when parsing macro input which allows Rust keywords as
+    /// identifiers.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{Error, Ident, Result, Token};
+    /// use syn::ext::IdentExt;
+    /// use syn::parse::ParseStream;
+    ///
+    /// mod kw {
+    ///     syn::custom_keyword!(name);
+    /// }
+    ///
+    /// // Parses input that looks like `name = NAME` where `NAME` can be
+    /// // any identifier.
+    /// //
+    /// // Examples:
+    /// //
+    /// //     name = anything
+    /// //     name = impl
+    /// fn parse_dsl(input: ParseStream) -> Result<Ident> {
+    ///     input.parse::<kw::name>()?;
+    ///     input.parse::<Token![=]>()?;
+    ///     let name = input.call(Ident::parse_any)?;
+    ///     Ok(name)
+    /// }
+    /// ```
+    fn parse_any(input: ParseStream) -> Result<Self>;
+
+    /// Peeks any identifier including keywords. Usage:
+    /// `input.peek(Ident::peek_any)`
+    ///
+    /// This is different from `input.peek(Ident)` which only returns true in
+    /// the case of an ident which is not a Rust keyword.
+    #[allow(non_upper_case_globals)]
+    const peek_any: private::PeekFn = private::PeekFn;
+
+    /// Strips the raw marker `r#`, if any, from the beginning of an ident.
+    ///
+    ///   - unraw(`x`) = `x`
+    ///   - unraw(`move`) = `move`
+    ///   - unraw(`r#move`) = `move`
+    ///
+    /// # Example
+    ///
+    /// In the case of interop with other languages like Python that have a
+    /// different set of keywords than Rust, we might come across macro input
+    /// that involves raw identifiers to refer to ordinary variables in the
+    /// other language with a name that happens to be a Rust keyword.
+    ///
+    /// The function below appends an identifier from the caller's input onto a
+    /// fixed prefix. Without using `unraw()`, this would tend to produce
+    /// invalid identifiers like `__pyo3_get_r#move`.
+    ///
+    /// ```
+    /// use proc_macro2::Span;
+    /// use syn::Ident;
+    /// use syn::ext::IdentExt;
+    ///
+    /// fn ident_for_getter(variable: &Ident) -> Ident {
+    ///     let getter = format!("__pyo3_get_{}", variable.unraw());
+    ///     Ident::new(&getter, Span::call_site())
+    /// }
+    /// ```
+    fn unraw(&self) -> Ident;
+}
+
+impl IdentExt for Ident {
+    fn parse_any(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| match cursor.ident() {
+            Some((ident, rest)) => Ok((ident, rest)),
+            None => Err(cursor.error("expected ident")),
+        })
+    }
+
+    fn unraw(&self) -> Ident {
+        let string = self.to_string();
+        if let Some(string) = string.strip_prefix("r#") {
+            Ident::new(string, self.span())
+        } else {
+            self.clone()
+        }
+    }
+}
+
+impl Peek for private::PeekFn {
+    type Token = private::IdentAny;
+}
+
+impl CustomToken for private::IdentAny {
+    fn peek(cursor: Cursor) -> bool {
+        cursor.ident().is_some()
+    }
+
+    fn display() -> &'static str {
+        "identifier"
+    }
+}
+
+impl lookahead::Sealed for private::PeekFn {}
+
+mod private {
+    use proc_macro2::Ident;
+
+    pub trait Sealed {}
+
+    impl Sealed for Ident {}
+
+    pub struct PeekFn;
+    pub struct IdentAny;
+
+    impl Copy for PeekFn {}
+    impl Clone for PeekFn {
+        fn clone(&self) -> Self {
+            *self
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/file.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/file.rs
--- 43.0.0-1/rust-vendor/syn/src/file.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/file.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,130 @@
+use crate::attr::Attribute;
+use crate::item::Item;
+
+ast_struct! {
+    /// A complete file of Rust source code.
+    ///
+    /// Typically `File` objects are created with [`parse_file`].
+    ///
+    /// [`parse_file`]: crate::parse_file
+    ///
+    /// # Example
+    ///
+    /// Parse a Rust source file into a `syn::File` and print out a debug
+    /// representation of the syntax tree.
+    ///
+    /// ```
+    /// use std::env;
+    /// use std::fs::File;
+    /// use std::io::Read;
+    /// use std::process;
+    ///
+    /// fn main() {
+    /// # }
+    /// #
+    /// # fn fake_main() {
+    ///     let mut args = env::args();
+    ///     let _ = args.next(); // executable name
+    ///
+    ///     let filename = match (args.next(), args.next()) {
+    ///         (Some(filename), None) => filename,
+    ///         _ => {
+    ///             eprintln!("Usage: dump-syntax path/to/filename.rs");
+    ///             process::exit(1);
+    ///         }
+    ///     };
+    ///
+    ///     let mut file = File::open(&filename).expect("unable to open file");
+    ///
+    ///     let mut src = String::new();
+    ///     file.read_to_string(&mut src).expect("unable to read file");
+    ///
+    ///     let syntax = syn::parse_file(&src).expect("unable to parse file");
+    ///
+    ///     // Debug impl is available if Syn is built with "extra-traits" feature.
+    ///     println!("{:#?}", syntax);
+    /// }
+    /// ```
+    ///
+    /// Running with its own source code as input, this program prints output
+    /// that begins with:
+    ///
+    /// ```text
+    /// File {
+    ///     shebang: None,
+    ///     attrs: [],
+    ///     items: [
+    ///         Use(
+    ///             ItemUse {
+    ///                 attrs: [],
+    ///                 vis: Inherited,
+    ///                 use_token: Use,
+    ///                 leading_colon: None,
+    ///                 tree: Path(
+    ///                     UsePath {
+    ///                         ident: Ident(
+    ///                             std,
+    ///                         ),
+    ///                         colon2_token: Colon2,
+    ///                         tree: Name(
+    ///                             UseName {
+    ///                                 ident: Ident(
+    ///                                     env,
+    ///                                 ),
+    ///                             },
+    ///                         ),
+    ///                     },
+    ///                 ),
+    ///                 semi_token: Semi,
+    ///             },
+    ///         ),
+    /// ...
+    /// ```
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct File {
+        pub shebang: Option<String>,
+        pub attrs: Vec<Attribute>,
+        pub items: Vec<Item>,
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::attr::Attribute;
+    use crate::error::Result;
+    use crate::file::File;
+    use crate::parse::{Parse, ParseStream};
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for File {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(File {
+                shebang: None,
+                attrs: input.call(Attribute::parse_inner)?,
+                items: {
+                    let mut items = Vec::new();
+                    while !input.is_empty() {
+                        items.push(input.parse()?);
+                    }
+                    items
+                },
+            })
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::attr::FilterAttrs;
+    use crate::file::File;
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for File {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.inner());
+            tokens.append_all(&self.items);
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/fixup.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/fixup.rs
--- 43.0.0-1/rust-vendor/syn/src/fixup.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/fixup.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,347 @@
+use crate::classify;
+use crate::expr::Expr;
+use crate::precedence::Precedence;
+
+pub(crate) struct FixupContext {
+    // Print expression such that it can be parsed back as a statement
+    // consisting of the original expression.
+    //
+    // The effect of this is for binary operators in statement position to set
+    // `leftmost_subexpression_in_stmt` when printing their left-hand operand.
+    //
+    //     (match x {}) - 1;  // match needs parens when LHS of binary operator
+    //
+    //     match x {};  // not when its own statement
+    //
+    #[cfg(feature = "full")]
+    stmt: bool,
+
+    // This is the difference between:
+    //
+    //     (match x {}) - 1;  // subexpression needs parens
+    //
+    //     let _ = match x {} - 1;  // no parens
+    //
+    // There are 3 distinguishable contexts in which `print_expr` might be
+    // called with the expression `$match` as its argument, where `$match`
+    // represents an expression of kind `ExprKind::Match`:
+    //
+    //   - stmt=false leftmost_subexpression_in_stmt=false
+    //
+    //     Example: `let _ = $match - 1;`
+    //
+    //     No parentheses required.
+    //
+    //   - stmt=false leftmost_subexpression_in_stmt=true
+    //
+    //     Example: `$match - 1;`
+    //
+    //     Must parenthesize `($match)`, otherwise parsing back the output as a
+    //     statement would terminate the statement after the closing brace of
+    //     the match, parsing `-1;` as a separate statement.
+    //
+    //   - stmt=true leftmost_subexpression_in_stmt=false
+    //
+    //     Example: `$match;`
+    //
+    //     No parentheses required.
+    #[cfg(feature = "full")]
+    leftmost_subexpression_in_stmt: bool,
+
+    // Print expression such that it can be parsed as a match arm.
+    //
+    // This is almost equivalent to `stmt`, but the grammar diverges a tiny bit
+    // between statements and match arms when it comes to braced macro calls.
+    // Macro calls with brace delimiter terminate a statement without a
+    // semicolon, but do not terminate a match-arm without comma.
+    //
+    //     m! {} - 1;  // two statements: a macro call followed by -1 literal
+    //
+    //     match () {
+    //         _ => m! {} - 1,  // binary subtraction operator
+    //     }
+    //
+    #[cfg(feature = "full")]
+    match_arm: bool,
+
+    // This is almost equivalent to `leftmost_subexpression_in_stmt`, other than
+    // for braced macro calls.
+    //
+    // If we have `m! {} - 1` as an expression, the leftmost subexpression
+    // `m! {}` will need to be parenthesized in the statement case but not the
+    // match-arm case.
+    //
+    //     (m! {}) - 1;  // subexpression needs parens
+    //
+    //     match () {
+    //         _ => m! {} - 1,  // no parens
+    //     }
+    //
+    #[cfg(feature = "full")]
+    leftmost_subexpression_in_match_arm: bool,
+
+    // This is the difference between:
+    //
+    //     if let _ = (Struct {}) {}  // needs parens
+    //
+    //     match () {
+    //         () if let _ = Struct {} => {}  // no parens
+    //     }
+    //
+    #[cfg(feature = "full")]
+    parenthesize_exterior_struct_lit: bool,
+
+    // This is the difference between:
+    //
+    //     let _ = 1 + return 1;  // no parens if rightmost subexpression
+    //
+    //     let _ = 1 + (return 1) + 1;  // needs parens
+    //
+    #[cfg(feature = "full")]
+    parenthesize_exterior_jump: bool,
+
+    // This is the difference between:
+    //
+    //     let _ = (return) - 1;  // without paren, this would return -1
+    //
+    //     let _ = return + 1;  // no paren because '+' cannot begin expr
+    //
+    #[cfg(feature = "full")]
+    next_operator_can_begin_expr: bool,
+
+    // This is the difference between:
+    //
+    //     let _ = x as u8 + T;
+    //
+    //     let _ = (x as u8) < T;
+    //
+    // Without parens, the latter would want to parse `u8<T...` as a type.
+    next_operator_can_begin_generics: bool,
+}
+
+impl FixupContext {
+    /// The default amount of fixing is minimal fixing. Fixups should be turned
+    /// on in a targeted fashion where needed.
+    pub const NONE: Self = FixupContext {
+        #[cfg(feature = "full")]
+        stmt: false,
+        #[cfg(feature = "full")]
+        leftmost_subexpression_in_stmt: false,
+        #[cfg(feature = "full")]
+        match_arm: false,
+        #[cfg(feature = "full")]
+        leftmost_subexpression_in_match_arm: false,
+        #[cfg(feature = "full")]
+        parenthesize_exterior_struct_lit: false,
+        #[cfg(feature = "full")]
+        parenthesize_exterior_jump: false,
+        #[cfg(feature = "full")]
+        next_operator_can_begin_expr: false,
+        next_operator_can_begin_generics: false,
+    };
+
+    /// Create the initial fixup for printing an expression in statement
+    /// position.
+    #[cfg(feature = "full")]
+    pub fn new_stmt() -> Self {
+        FixupContext {
+            stmt: true,
+            ..FixupContext::NONE
+        }
+    }
+
+    /// Create the initial fixup for printing an expression as the right-hand
+    /// side of a match arm.
+    #[cfg(feature = "full")]
+    pub fn new_match_arm() -> Self {
+        FixupContext {
+            match_arm: true,
+            ..FixupContext::NONE
+        }
+    }
+
+    /// Create the initial fixup for printing an expression as the "condition"
+    /// of an `if` or `while`. There are a few other positions which are
+    /// grammatically equivalent and also use this, such as the iterator
+    /// expression in `for` and the scrutinee in `match`.
+    #[cfg(feature = "full")]
+    pub fn new_condition() -> Self {
+        FixupContext {
+            parenthesize_exterior_struct_lit: true,
+            ..FixupContext::NONE
+        }
+    }
+
+    /// Transform this fixup into the one that should apply when printing the
+    /// leftmost subexpression of the current expression.
+    ///
+    /// The leftmost subexpression is any subexpression that has the same first
+    /// token as the current expression, but has a different last token.
+    ///
+    /// For example in `$a + $b` and `$a.method()`, the subexpression `$a` is a
+    /// leftmost subexpression.
+    ///
+    /// Not every expression has a leftmost subexpression. For example neither
+    /// `-$a` nor `[$a]` have one.
+    pub fn leftmost_subexpression(self) -> Self {
+        FixupContext {
+            #[cfg(feature = "full")]
+            stmt: false,
+            #[cfg(feature = "full")]
+            leftmost_subexpression_in_stmt: self.stmt || self.leftmost_subexpression_in_stmt,
+            #[cfg(feature = "full")]
+            match_arm: false,
+            #[cfg(feature = "full")]
+            leftmost_subexpression_in_match_arm: self.match_arm
+                || self.leftmost_subexpression_in_match_arm,
+            #[cfg(feature = "full")]
+            parenthesize_exterior_jump: true,
+            ..self
+        }
+    }
+
+    /// Transform this fixup into the one that should apply when printing a
+    /// leftmost subexpression followed by a `.` or `?` token, which confer
+    /// different statement boundary rules compared to other leftmost
+    /// subexpressions.
+    pub fn leftmost_subexpression_with_dot(self) -> Self {
+        FixupContext {
+            #[cfg(feature = "full")]
+            stmt: self.stmt || self.leftmost_subexpression_in_stmt,
+            #[cfg(feature = "full")]
+            leftmost_subexpression_in_stmt: false,
+            #[cfg(feature = "full")]
+            match_arm: self.match_arm || self.leftmost_subexpression_in_match_arm,
+            #[cfg(feature = "full")]
+            leftmost_subexpression_in_match_arm: false,
+            #[cfg(feature = "full")]
+            parenthesize_exterior_jump: true,
+            ..self
+        }
+    }
+
+    /// Transform this fixup into the one that should apply when printing a
+    /// leftmost subexpression followed by punctuation that is legal as the
+    /// first token of an expression.
+    pub fn leftmost_subexpression_with_begin_operator(
+        self,
+        #[cfg(feature = "full")] next_operator_can_begin_expr: bool,
+        next_operator_can_begin_generics: bool,
+    ) -> Self {
+        FixupContext {
+            #[cfg(feature = "full")]
+            next_operator_can_begin_expr,
+            next_operator_can_begin_generics,
+            ..self.leftmost_subexpression()
+        }
+    }
+
+    /// Transform this fixup into the one that should apply when printing any
+    /// subexpression that is neither a leftmost subexpression nor surrounded in
+    /// delimiters.
+    ///
+    /// This is for any subexpression that has a different first token than the
+    /// current expression, and is not surrounded by a paren/bracket/brace. For
+    /// example the `$b` in `$a + $b` and `-$b`, but not the one in `[$b]` or
+    /// `$a.f($b)`.
+    pub fn subsequent_subexpression(self) -> Self {
+        FixupContext {
+            #[cfg(feature = "full")]
+            stmt: false,
+            #[cfg(feature = "full")]
+            leftmost_subexpression_in_stmt: false,
+            #[cfg(feature = "full")]
+            match_arm: false,
+            #[cfg(feature = "full")]
+            leftmost_subexpression_in_match_arm: false,
+            ..self
+        }
+    }
+
+    /// Determine whether parentheses are needed around the given expression to
+    /// head off an unintended statement boundary.
+    ///
+    /// The documentation on `FixupContext::leftmost_subexpression_in_stmt` has
+    /// examples.
+    #[cfg(feature = "full")]
+    pub fn would_cause_statement_boundary(self, expr: &Expr) -> bool {
+        (self.leftmost_subexpression_in_stmt && !classify::requires_semi_to_be_stmt(expr))
+            || ((self.stmt || self.leftmost_subexpression_in_stmt) && matches!(expr, Expr::Let(_)))
+            || (self.leftmost_subexpression_in_match_arm
+                && !classify::requires_comma_to_be_match_arm(expr))
+    }
+
+    /// Determine whether parentheses are needed around the given `let`
+    /// scrutinee.
+    ///
+    /// In `if let _ = $e {}`, some examples of `$e` that would need parentheses
+    /// are:
+    ///
+    ///   - `Struct {}.f()`, because otherwise the `{` would be misinterpreted
+    ///     as the opening of the if's then-block.
+    ///
+    ///   - `true && false`, because otherwise this would be misinterpreted as a
+    ///     "let chain".
+    #[cfg(feature = "full")]
+    pub fn needs_group_as_let_scrutinee(self, expr: &Expr) -> bool {
+        self.parenthesize_exterior_struct_lit && classify::confusable_with_adjacent_block(expr)
+            || self.trailing_precedence(expr) < Precedence::Let
+    }
+
+    /// Determines the effective precedence of a left subexpression. Some
+    /// expressions have lower precedence when adjacent to particular operators.
+    pub fn leading_precedence(self, expr: &Expr) -> Precedence {
+        #[cfg(feature = "full")]
+        if self.next_operator_can_begin_expr {
+            // Decrease precedence of value-less jumps when followed by an
+            // operator that would otherwise get interpreted as beginning a
+            // value for the jump.
+            if let Expr::Break(_) | Expr::Return(_) | Expr::Yield(_) = expr {
+                return Precedence::Jump;
+            }
+        }
+        self.precedence(expr)
+    }
+
+    /// Determines the effective precedence of a right subexpression. Some
+    /// expressions have higher precedence on the right side of a binary
+    /// operator than on the left.
+    pub fn trailing_precedence(self, expr: &Expr) -> Precedence {
+        #[cfg(feature = "full")]
+        if !self.parenthesize_exterior_jump {
+            match expr {
+                // Increase precedence of expressions that extend to the end of
+                // current statement or group.
+                Expr::Break(_)
+                | Expr::Closure(_)
+                | Expr::Let(_)
+                | Expr::Return(_)
+                | Expr::Yield(_) => {
+                    return Precedence::Prefix;
+                }
+                Expr::Range(e) if e.start.is_none() => return Precedence::Prefix,
+                _ => {}
+            }
+        }
+        self.precedence(expr)
+    }
+
+    fn precedence(self, expr: &Expr) -> Precedence {
+        if self.next_operator_can_begin_generics {
+            if let Expr::Cast(cast) = expr {
+                if classify::trailing_unparameterized_path(&cast.ty) {
+                    return Precedence::MIN;
+                }
+            }
+        }
+        Precedence::of(expr)
+    }
+}
+
+impl Copy for FixupContext {}
+
+impl Clone for FixupContext {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/gen/clone.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/gen/clone.rs
--- 43.0.0-1/rust-vendor/syn/src/gen/clone.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/gen/clone.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,2209 @@
+// This file is @generated by syn-internal-codegen.
+// It is not intended for manual editing.
+
+#![allow(clippy::clone_on_copy, clippy::expl_impl_clone_on_copy)]
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Abi {
+    fn clone(&self) -> Self {
+        crate::Abi {
+            extern_token: self.extern_token.clone(),
+            name: self.name.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::AngleBracketedGenericArguments {
+    fn clone(&self) -> Self {
+        crate::AngleBracketedGenericArguments {
+            colon2_token: self.colon2_token.clone(),
+            lt_token: self.lt_token.clone(),
+            args: self.args.clone(),
+            gt_token: self.gt_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Arm {
+    fn clone(&self) -> Self {
+        crate::Arm {
+            attrs: self.attrs.clone(),
+            pat: self.pat.clone(),
+            guard: self.guard.clone(),
+            fat_arrow_token: self.fat_arrow_token.clone(),
+            body: self.body.clone(),
+            comma: self.comma.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::AssocConst {
+    fn clone(&self) -> Self {
+        crate::AssocConst {
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            eq_token: self.eq_token.clone(),
+            value: self.value.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::AssocType {
+    fn clone(&self) -> Self {
+        crate::AssocType {
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            eq_token: self.eq_token.clone(),
+            ty: self.ty.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Copy for crate::AttrStyle {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::AttrStyle {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Attribute {
+    fn clone(&self) -> Self {
+        crate::Attribute {
+            pound_token: self.pound_token.clone(),
+            style: self.style.clone(),
+            bracket_token: self.bracket_token.clone(),
+            meta: self.meta.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::BareFnArg {
+    fn clone(&self) -> Self {
+        crate::BareFnArg {
+            attrs: self.attrs.clone(),
+            name: self.name.clone(),
+            ty: self.ty.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::BareVariadic {
+    fn clone(&self) -> Self {
+        crate::BareVariadic {
+            attrs: self.attrs.clone(),
+            name: self.name.clone(),
+            dots: self.dots.clone(),
+            comma: self.comma.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Copy for crate::BinOp {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::BinOp {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Block {
+    fn clone(&self) -> Self {
+        crate::Block {
+            brace_token: self.brace_token.clone(),
+            stmts: self.stmts.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::BoundLifetimes {
+    fn clone(&self) -> Self {
+        crate::BoundLifetimes {
+            for_token: self.for_token.clone(),
+            lt_token: self.lt_token.clone(),
+            lifetimes: self.lifetimes.clone(),
+            gt_token: self.gt_token.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ConstParam {
+    fn clone(&self) -> Self {
+        crate::ConstParam {
+            attrs: self.attrs.clone(),
+            const_token: self.const_token.clone(),
+            ident: self.ident.clone(),
+            colon_token: self.colon_token.clone(),
+            ty: self.ty.clone(),
+            eq_token: self.eq_token.clone(),
+            default: self.default.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Constraint {
+    fn clone(&self) -> Self {
+        crate::Constraint {
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            colon_token: self.colon_token.clone(),
+            bounds: self.bounds.clone(),
+        }
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Data {
+    fn clone(&self) -> Self {
+        match self {
+            crate::Data::Struct(v0) => crate::Data::Struct(v0.clone()),
+            crate::Data::Enum(v0) => crate::Data::Enum(v0.clone()),
+            crate::Data::Union(v0) => crate::Data::Union(v0.clone()),
+        }
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::DataEnum {
+    fn clone(&self) -> Self {
+        crate::DataEnum {
+            enum_token: self.enum_token.clone(),
+            brace_token: self.brace_token.clone(),
+            variants: self.variants.clone(),
+        }
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::DataStruct {
+    fn clone(&self) -> Self {
+        crate::DataStruct {
+            struct_token: self.struct_token.clone(),
+            fields: self.fields.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::DataUnion {
+    fn clone(&self) -> Self {
+        crate::DataUnion {
+            union_token: self.union_token.clone(),
+            fields: self.fields.clone(),
+        }
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::DeriveInput {
+    fn clone(&self) -> Self {
+        crate::DeriveInput {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            data: self.data.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Expr {
+    fn clone(&self) -> Self {
+        match self {
+            #[cfg(feature = "full")]
+            crate::Expr::Array(v0) => crate::Expr::Array(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Assign(v0) => crate::Expr::Assign(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Async(v0) => crate::Expr::Async(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Await(v0) => crate::Expr::Await(v0.clone()),
+            crate::Expr::Binary(v0) => crate::Expr::Binary(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Block(v0) => crate::Expr::Block(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Break(v0) => crate::Expr::Break(v0.clone()),
+            crate::Expr::Call(v0) => crate::Expr::Call(v0.clone()),
+            crate::Expr::Cast(v0) => crate::Expr::Cast(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Closure(v0) => crate::Expr::Closure(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Const(v0) => crate::Expr::Const(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Continue(v0) => crate::Expr::Continue(v0.clone()),
+            crate::Expr::Field(v0) => crate::Expr::Field(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::ForLoop(v0) => crate::Expr::ForLoop(v0.clone()),
+            crate::Expr::Group(v0) => crate::Expr::Group(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::If(v0) => crate::Expr::If(v0.clone()),
+            crate::Expr::Index(v0) => crate::Expr::Index(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Infer(v0) => crate::Expr::Infer(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Let(v0) => crate::Expr::Let(v0.clone()),
+            crate::Expr::Lit(v0) => crate::Expr::Lit(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Loop(v0) => crate::Expr::Loop(v0.clone()),
+            crate::Expr::Macro(v0) => crate::Expr::Macro(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Match(v0) => crate::Expr::Match(v0.clone()),
+            crate::Expr::MethodCall(v0) => crate::Expr::MethodCall(v0.clone()),
+            crate::Expr::Paren(v0) => crate::Expr::Paren(v0.clone()),
+            crate::Expr::Path(v0) => crate::Expr::Path(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Range(v0) => crate::Expr::Range(v0.clone()),
+            crate::Expr::Reference(v0) => crate::Expr::Reference(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Repeat(v0) => crate::Expr::Repeat(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Return(v0) => crate::Expr::Return(v0.clone()),
+            crate::Expr::Struct(v0) => crate::Expr::Struct(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Try(v0) => crate::Expr::Try(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::TryBlock(v0) => crate::Expr::TryBlock(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Tuple(v0) => crate::Expr::Tuple(v0.clone()),
+            crate::Expr::Unary(v0) => crate::Expr::Unary(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Unsafe(v0) => crate::Expr::Unsafe(v0.clone()),
+            crate::Expr::Verbatim(v0) => crate::Expr::Verbatim(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::While(v0) => crate::Expr::While(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Yield(v0) => crate::Expr::Yield(v0.clone()),
+            #[cfg(not(feature = "full"))]
+            _ => unreachable!(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprArray {
+    fn clone(&self) -> Self {
+        crate::ExprArray {
+            attrs: self.attrs.clone(),
+            bracket_token: self.bracket_token.clone(),
+            elems: self.elems.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprAssign {
+    fn clone(&self) -> Self {
+        crate::ExprAssign {
+            attrs: self.attrs.clone(),
+            left: self.left.clone(),
+            eq_token: self.eq_token.clone(),
+            right: self.right.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprAsync {
+    fn clone(&self) -> Self {
+        crate::ExprAsync {
+            attrs: self.attrs.clone(),
+            async_token: self.async_token.clone(),
+            capture: self.capture.clone(),
+            block: self.block.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprAwait {
+    fn clone(&self) -> Self {
+        crate::ExprAwait {
+            attrs: self.attrs.clone(),
+            base: self.base.clone(),
+            dot_token: self.dot_token.clone(),
+            await_token: self.await_token.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprBinary {
+    fn clone(&self) -> Self {
+        crate::ExprBinary {
+            attrs: self.attrs.clone(),
+            left: self.left.clone(),
+            op: self.op.clone(),
+            right: self.right.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprBlock {
+    fn clone(&self) -> Self {
+        crate::ExprBlock {
+            attrs: self.attrs.clone(),
+            label: self.label.clone(),
+            block: self.block.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprBreak {
+    fn clone(&self) -> Self {
+        crate::ExprBreak {
+            attrs: self.attrs.clone(),
+            break_token: self.break_token.clone(),
+            label: self.label.clone(),
+            expr: self.expr.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprCall {
+    fn clone(&self) -> Self {
+        crate::ExprCall {
+            attrs: self.attrs.clone(),
+            func: self.func.clone(),
+            paren_token: self.paren_token.clone(),
+            args: self.args.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprCast {
+    fn clone(&self) -> Self {
+        crate::ExprCast {
+            attrs: self.attrs.clone(),
+            expr: self.expr.clone(),
+            as_token: self.as_token.clone(),
+            ty: self.ty.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprClosure {
+    fn clone(&self) -> Self {
+        crate::ExprClosure {
+            attrs: self.attrs.clone(),
+            lifetimes: self.lifetimes.clone(),
+            constness: self.constness.clone(),
+            movability: self.movability.clone(),
+            asyncness: self.asyncness.clone(),
+            capture: self.capture.clone(),
+            or1_token: self.or1_token.clone(),
+            inputs: self.inputs.clone(),
+            or2_token: self.or2_token.clone(),
+            output: self.output.clone(),
+            body: self.body.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprConst {
+    fn clone(&self) -> Self {
+        crate::ExprConst {
+            attrs: self.attrs.clone(),
+            const_token: self.const_token.clone(),
+            block: self.block.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprContinue {
+    fn clone(&self) -> Self {
+        crate::ExprContinue {
+            attrs: self.attrs.clone(),
+            continue_token: self.continue_token.clone(),
+            label: self.label.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprField {
+    fn clone(&self) -> Self {
+        crate::ExprField {
+            attrs: self.attrs.clone(),
+            base: self.base.clone(),
+            dot_token: self.dot_token.clone(),
+            member: self.member.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprForLoop {
+    fn clone(&self) -> Self {
+        crate::ExprForLoop {
+            attrs: self.attrs.clone(),
+            label: self.label.clone(),
+            for_token: self.for_token.clone(),
+            pat: self.pat.clone(),
+            in_token: self.in_token.clone(),
+            expr: self.expr.clone(),
+            body: self.body.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprGroup {
+    fn clone(&self) -> Self {
+        crate::ExprGroup {
+            attrs: self.attrs.clone(),
+            group_token: self.group_token.clone(),
+            expr: self.expr.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprIf {
+    fn clone(&self) -> Self {
+        crate::ExprIf {
+            attrs: self.attrs.clone(),
+            if_token: self.if_token.clone(),
+            cond: self.cond.clone(),
+            then_branch: self.then_branch.clone(),
+            else_branch: self.else_branch.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprIndex {
+    fn clone(&self) -> Self {
+        crate::ExprIndex {
+            attrs: self.attrs.clone(),
+            expr: self.expr.clone(),
+            bracket_token: self.bracket_token.clone(),
+            index: self.index.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprInfer {
+    fn clone(&self) -> Self {
+        crate::ExprInfer {
+            attrs: self.attrs.clone(),
+            underscore_token: self.underscore_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprLet {
+    fn clone(&self) -> Self {
+        crate::ExprLet {
+            attrs: self.attrs.clone(),
+            let_token: self.let_token.clone(),
+            pat: self.pat.clone(),
+            eq_token: self.eq_token.clone(),
+            expr: self.expr.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprLit {
+    fn clone(&self) -> Self {
+        crate::ExprLit {
+            attrs: self.attrs.clone(),
+            lit: self.lit.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprLoop {
+    fn clone(&self) -> Self {
+        crate::ExprLoop {
+            attrs: self.attrs.clone(),
+            label: self.label.clone(),
+            loop_token: self.loop_token.clone(),
+            body: self.body.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprMacro {
+    fn clone(&self) -> Self {
+        crate::ExprMacro {
+            attrs: self.attrs.clone(),
+            mac: self.mac.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprMatch {
+    fn clone(&self) -> Self {
+        crate::ExprMatch {
+            attrs: self.attrs.clone(),
+            match_token: self.match_token.clone(),
+            expr: self.expr.clone(),
+            brace_token: self.brace_token.clone(),
+            arms: self.arms.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprMethodCall {
+    fn clone(&self) -> Self {
+        crate::ExprMethodCall {
+            attrs: self.attrs.clone(),
+            receiver: self.receiver.clone(),
+            dot_token: self.dot_token.clone(),
+            method: self.method.clone(),
+            turbofish: self.turbofish.clone(),
+            paren_token: self.paren_token.clone(),
+            args: self.args.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprParen {
+    fn clone(&self) -> Self {
+        crate::ExprParen {
+            attrs: self.attrs.clone(),
+            paren_token: self.paren_token.clone(),
+            expr: self.expr.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprPath {
+    fn clone(&self) -> Self {
+        crate::ExprPath {
+            attrs: self.attrs.clone(),
+            qself: self.qself.clone(),
+            path: self.path.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprRange {
+    fn clone(&self) -> Self {
+        crate::ExprRange {
+            attrs: self.attrs.clone(),
+            start: self.start.clone(),
+            limits: self.limits.clone(),
+            end: self.end.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprReference {
+    fn clone(&self) -> Self {
+        crate::ExprReference {
+            attrs: self.attrs.clone(),
+            and_token: self.and_token.clone(),
+            mutability: self.mutability.clone(),
+            expr: self.expr.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprRepeat {
+    fn clone(&self) -> Self {
+        crate::ExprRepeat {
+            attrs: self.attrs.clone(),
+            bracket_token: self.bracket_token.clone(),
+            expr: self.expr.clone(),
+            semi_token: self.semi_token.clone(),
+            len: self.len.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprReturn {
+    fn clone(&self) -> Self {
+        crate::ExprReturn {
+            attrs: self.attrs.clone(),
+            return_token: self.return_token.clone(),
+            expr: self.expr.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprStruct {
+    fn clone(&self) -> Self {
+        crate::ExprStruct {
+            attrs: self.attrs.clone(),
+            qself: self.qself.clone(),
+            path: self.path.clone(),
+            brace_token: self.brace_token.clone(),
+            fields: self.fields.clone(),
+            dot2_token: self.dot2_token.clone(),
+            rest: self.rest.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprTry {
+    fn clone(&self) -> Self {
+        crate::ExprTry {
+            attrs: self.attrs.clone(),
+            expr: self.expr.clone(),
+            question_token: self.question_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprTryBlock {
+    fn clone(&self) -> Self {
+        crate::ExprTryBlock {
+            attrs: self.attrs.clone(),
+            try_token: self.try_token.clone(),
+            block: self.block.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprTuple {
+    fn clone(&self) -> Self {
+        crate::ExprTuple {
+            attrs: self.attrs.clone(),
+            paren_token: self.paren_token.clone(),
+            elems: self.elems.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprUnary {
+    fn clone(&self) -> Self {
+        crate::ExprUnary {
+            attrs: self.attrs.clone(),
+            op: self.op.clone(),
+            expr: self.expr.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprUnsafe {
+    fn clone(&self) -> Self {
+        crate::ExprUnsafe {
+            attrs: self.attrs.clone(),
+            unsafe_token: self.unsafe_token.clone(),
+            block: self.block.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprWhile {
+    fn clone(&self) -> Self {
+        crate::ExprWhile {
+            attrs: self.attrs.clone(),
+            label: self.label.clone(),
+            while_token: self.while_token.clone(),
+            cond: self.cond.clone(),
+            body: self.body.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprYield {
+    fn clone(&self) -> Self {
+        crate::ExprYield {
+            attrs: self.attrs.clone(),
+            yield_token: self.yield_token.clone(),
+            expr: self.expr.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Field {
+    fn clone(&self) -> Self {
+        crate::Field {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            mutability: self.mutability.clone(),
+            ident: self.ident.clone(),
+            colon_token: self.colon_token.clone(),
+            ty: self.ty.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::FieldMutability {
+    fn clone(&self) -> Self {
+        match self {
+            crate::FieldMutability::None => crate::FieldMutability::None,
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::FieldPat {
+    fn clone(&self) -> Self {
+        crate::FieldPat {
+            attrs: self.attrs.clone(),
+            member: self.member.clone(),
+            colon_token: self.colon_token.clone(),
+            pat: self.pat.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::FieldValue {
+    fn clone(&self) -> Self {
+        crate::FieldValue {
+            attrs: self.attrs.clone(),
+            member: self.member.clone(),
+            colon_token: self.colon_token.clone(),
+            expr: self.expr.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Fields {
+    fn clone(&self) -> Self {
+        match self {
+            crate::Fields::Named(v0) => crate::Fields::Named(v0.clone()),
+            crate::Fields::Unnamed(v0) => crate::Fields::Unnamed(v0.clone()),
+            crate::Fields::Unit => crate::Fields::Unit,
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::FieldsNamed {
+    fn clone(&self) -> Self {
+        crate::FieldsNamed {
+            brace_token: self.brace_token.clone(),
+            named: self.named.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::FieldsUnnamed {
+    fn clone(&self) -> Self {
+        crate::FieldsUnnamed {
+            paren_token: self.paren_token.clone(),
+            unnamed: self.unnamed.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::File {
+    fn clone(&self) -> Self {
+        crate::File {
+            shebang: self.shebang.clone(),
+            attrs: self.attrs.clone(),
+            items: self.items.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::FnArg {
+    fn clone(&self) -> Self {
+        match self {
+            crate::FnArg::Receiver(v0) => crate::FnArg::Receiver(v0.clone()),
+            crate::FnArg::Typed(v0) => crate::FnArg::Typed(v0.clone()),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ForeignItem {
+    fn clone(&self) -> Self {
+        match self {
+            crate::ForeignItem::Fn(v0) => crate::ForeignItem::Fn(v0.clone()),
+            crate::ForeignItem::Static(v0) => crate::ForeignItem::Static(v0.clone()),
+            crate::ForeignItem::Type(v0) => crate::ForeignItem::Type(v0.clone()),
+            crate::ForeignItem::Macro(v0) => crate::ForeignItem::Macro(v0.clone()),
+            crate::ForeignItem::Verbatim(v0) => crate::ForeignItem::Verbatim(v0.clone()),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ForeignItemFn {
+    fn clone(&self) -> Self {
+        crate::ForeignItemFn {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            sig: self.sig.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ForeignItemMacro {
+    fn clone(&self) -> Self {
+        crate::ForeignItemMacro {
+            attrs: self.attrs.clone(),
+            mac: self.mac.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ForeignItemStatic {
+    fn clone(&self) -> Self {
+        crate::ForeignItemStatic {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            static_token: self.static_token.clone(),
+            mutability: self.mutability.clone(),
+            ident: self.ident.clone(),
+            colon_token: self.colon_token.clone(),
+            ty: self.ty.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ForeignItemType {
+    fn clone(&self) -> Self {
+        crate::ForeignItemType {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            type_token: self.type_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::GenericArgument {
+    fn clone(&self) -> Self {
+        match self {
+            crate::GenericArgument::Lifetime(v0) => {
+                crate::GenericArgument::Lifetime(v0.clone())
+            }
+            crate::GenericArgument::Type(v0) => crate::GenericArgument::Type(v0.clone()),
+            crate::GenericArgument::Const(v0) => {
+                crate::GenericArgument::Const(v0.clone())
+            }
+            crate::GenericArgument::AssocType(v0) => {
+                crate::GenericArgument::AssocType(v0.clone())
+            }
+            crate::GenericArgument::AssocConst(v0) => {
+                crate::GenericArgument::AssocConst(v0.clone())
+            }
+            crate::GenericArgument::Constraint(v0) => {
+                crate::GenericArgument::Constraint(v0.clone())
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::GenericParam {
+    fn clone(&self) -> Self {
+        match self {
+            crate::GenericParam::Lifetime(v0) => {
+                crate::GenericParam::Lifetime(v0.clone())
+            }
+            crate::GenericParam::Type(v0) => crate::GenericParam::Type(v0.clone()),
+            crate::GenericParam::Const(v0) => crate::GenericParam::Const(v0.clone()),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Generics {
+    fn clone(&self) -> Self {
+        crate::Generics {
+            lt_token: self.lt_token.clone(),
+            params: self.params.clone(),
+            gt_token: self.gt_token.clone(),
+            where_clause: self.where_clause.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ImplItem {
+    fn clone(&self) -> Self {
+        match self {
+            crate::ImplItem::Const(v0) => crate::ImplItem::Const(v0.clone()),
+            crate::ImplItem::Fn(v0) => crate::ImplItem::Fn(v0.clone()),
+            crate::ImplItem::Type(v0) => crate::ImplItem::Type(v0.clone()),
+            crate::ImplItem::Macro(v0) => crate::ImplItem::Macro(v0.clone()),
+            crate::ImplItem::Verbatim(v0) => crate::ImplItem::Verbatim(v0.clone()),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ImplItemConst {
+    fn clone(&self) -> Self {
+        crate::ImplItemConst {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            defaultness: self.defaultness.clone(),
+            const_token: self.const_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            colon_token: self.colon_token.clone(),
+            ty: self.ty.clone(),
+            eq_token: self.eq_token.clone(),
+            expr: self.expr.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ImplItemFn {
+    fn clone(&self) -> Self {
+        crate::ImplItemFn {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            defaultness: self.defaultness.clone(),
+            sig: self.sig.clone(),
+            block: self.block.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ImplItemMacro {
+    fn clone(&self) -> Self {
+        crate::ImplItemMacro {
+            attrs: self.attrs.clone(),
+            mac: self.mac.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ImplItemType {
+    fn clone(&self) -> Self {
+        crate::ImplItemType {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            defaultness: self.defaultness.clone(),
+            type_token: self.type_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            eq_token: self.eq_token.clone(),
+            ty: self.ty.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ImplRestriction {
+    fn clone(&self) -> Self {
+        match *self {}
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Index {
+    fn clone(&self) -> Self {
+        crate::Index {
+            index: self.index.clone(),
+            span: self.span.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Item {
+    fn clone(&self) -> Self {
+        match self {
+            crate::Item::Const(v0) => crate::Item::Const(v0.clone()),
+            crate::Item::Enum(v0) => crate::Item::Enum(v0.clone()),
+            crate::Item::ExternCrate(v0) => crate::Item::ExternCrate(v0.clone()),
+            crate::Item::Fn(v0) => crate::Item::Fn(v0.clone()),
+            crate::Item::ForeignMod(v0) => crate::Item::ForeignMod(v0.clone()),
+            crate::Item::Impl(v0) => crate::Item::Impl(v0.clone()),
+            crate::Item::Macro(v0) => crate::Item::Macro(v0.clone()),
+            crate::Item::Mod(v0) => crate::Item::Mod(v0.clone()),
+            crate::Item::Static(v0) => crate::Item::Static(v0.clone()),
+            crate::Item::Struct(v0) => crate::Item::Struct(v0.clone()),
+            crate::Item::Trait(v0) => crate::Item::Trait(v0.clone()),
+            crate::Item::TraitAlias(v0) => crate::Item::TraitAlias(v0.clone()),
+            crate::Item::Type(v0) => crate::Item::Type(v0.clone()),
+            crate::Item::Union(v0) => crate::Item::Union(v0.clone()),
+            crate::Item::Use(v0) => crate::Item::Use(v0.clone()),
+            crate::Item::Verbatim(v0) => crate::Item::Verbatim(v0.clone()),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemConst {
+    fn clone(&self) -> Self {
+        crate::ItemConst {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            const_token: self.const_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            colon_token: self.colon_token.clone(),
+            ty: self.ty.clone(),
+            eq_token: self.eq_token.clone(),
+            expr: self.expr.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemEnum {
+    fn clone(&self) -> Self {
+        crate::ItemEnum {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            enum_token: self.enum_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            brace_token: self.brace_token.clone(),
+            variants: self.variants.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemExternCrate {
+    fn clone(&self) -> Self {
+        crate::ItemExternCrate {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            extern_token: self.extern_token.clone(),
+            crate_token: self.crate_token.clone(),
+            ident: self.ident.clone(),
+            rename: self.rename.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemFn {
+    fn clone(&self) -> Self {
+        crate::ItemFn {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            sig: self.sig.clone(),
+            block: self.block.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemForeignMod {
+    fn clone(&self) -> Self {
+        crate::ItemForeignMod {
+            attrs: self.attrs.clone(),
+            unsafety: self.unsafety.clone(),
+            abi: self.abi.clone(),
+            brace_token: self.brace_token.clone(),
+            items: self.items.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemImpl {
+    fn clone(&self) -> Self {
+        crate::ItemImpl {
+            attrs: self.attrs.clone(),
+            defaultness: self.defaultness.clone(),
+            unsafety: self.unsafety.clone(),
+            impl_token: self.impl_token.clone(),
+            generics: self.generics.clone(),
+            trait_: self.trait_.clone(),
+            self_ty: self.self_ty.clone(),
+            brace_token: self.brace_token.clone(),
+            items: self.items.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemMacro {
+    fn clone(&self) -> Self {
+        crate::ItemMacro {
+            attrs: self.attrs.clone(),
+            ident: self.ident.clone(),
+            mac: self.mac.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemMod {
+    fn clone(&self) -> Self {
+        crate::ItemMod {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            unsafety: self.unsafety.clone(),
+            mod_token: self.mod_token.clone(),
+            ident: self.ident.clone(),
+            content: self.content.clone(),
+            semi: self.semi.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemStatic {
+    fn clone(&self) -> Self {
+        crate::ItemStatic {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            static_token: self.static_token.clone(),
+            mutability: self.mutability.clone(),
+            ident: self.ident.clone(),
+            colon_token: self.colon_token.clone(),
+            ty: self.ty.clone(),
+            eq_token: self.eq_token.clone(),
+            expr: self.expr.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemStruct {
+    fn clone(&self) -> Self {
+        crate::ItemStruct {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            struct_token: self.struct_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            fields: self.fields.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemTrait {
+    fn clone(&self) -> Self {
+        crate::ItemTrait {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            unsafety: self.unsafety.clone(),
+            auto_token: self.auto_token.clone(),
+            restriction: self.restriction.clone(),
+            trait_token: self.trait_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            colon_token: self.colon_token.clone(),
+            supertraits: self.supertraits.clone(),
+            brace_token: self.brace_token.clone(),
+            items: self.items.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemTraitAlias {
+    fn clone(&self) -> Self {
+        crate::ItemTraitAlias {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            trait_token: self.trait_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            eq_token: self.eq_token.clone(),
+            bounds: self.bounds.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemType {
+    fn clone(&self) -> Self {
+        crate::ItemType {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            type_token: self.type_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            eq_token: self.eq_token.clone(),
+            ty: self.ty.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemUnion {
+    fn clone(&self) -> Self {
+        crate::ItemUnion {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            union_token: self.union_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            fields: self.fields.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemUse {
+    fn clone(&self) -> Self {
+        crate::ItemUse {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            use_token: self.use_token.clone(),
+            leading_colon: self.leading_colon.clone(),
+            tree: self.tree.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Label {
+    fn clone(&self) -> Self {
+        crate::Label {
+            name: self.name.clone(),
+            colon_token: self.colon_token.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::LifetimeParam {
+    fn clone(&self) -> Self {
+        crate::LifetimeParam {
+            attrs: self.attrs.clone(),
+            lifetime: self.lifetime.clone(),
+            colon_token: self.colon_token.clone(),
+            bounds: self.bounds.clone(),
+        }
+    }
+}
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Lit {
+    fn clone(&self) -> Self {
+        match self {
+            crate::Lit::Str(v0) => crate::Lit::Str(v0.clone()),
+            crate::Lit::ByteStr(v0) => crate::Lit::ByteStr(v0.clone()),
+            crate::Lit::CStr(v0) => crate::Lit::CStr(v0.clone()),
+            crate::Lit::Byte(v0) => crate::Lit::Byte(v0.clone()),
+            crate::Lit::Char(v0) => crate::Lit::Char(v0.clone()),
+            crate::Lit::Int(v0) => crate::Lit::Int(v0.clone()),
+            crate::Lit::Float(v0) => crate::Lit::Float(v0.clone()),
+            crate::Lit::Bool(v0) => crate::Lit::Bool(v0.clone()),
+            crate::Lit::Verbatim(v0) => crate::Lit::Verbatim(v0.clone()),
+        }
+    }
+}
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::LitBool {
+    fn clone(&self) -> Self {
+        crate::LitBool {
+            value: self.value.clone(),
+            span: self.span.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Local {
+    fn clone(&self) -> Self {
+        crate::Local {
+            attrs: self.attrs.clone(),
+            let_token: self.let_token.clone(),
+            pat: self.pat.clone(),
+            init: self.init.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::LocalInit {
+    fn clone(&self) -> Self {
+        crate::LocalInit {
+            eq_token: self.eq_token.clone(),
+            expr: self.expr.clone(),
+            diverge: self.diverge.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Macro {
+    fn clone(&self) -> Self {
+        crate::Macro {
+            path: self.path.clone(),
+            bang_token: self.bang_token.clone(),
+            delimiter: self.delimiter.clone(),
+            tokens: self.tokens.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::MacroDelimiter {
+    fn clone(&self) -> Self {
+        match self {
+            crate::MacroDelimiter::Paren(v0) => crate::MacroDelimiter::Paren(v0.clone()),
+            crate::MacroDelimiter::Brace(v0) => crate::MacroDelimiter::Brace(v0.clone()),
+            crate::MacroDelimiter::Bracket(v0) => {
+                crate::MacroDelimiter::Bracket(v0.clone())
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Member {
+    fn clone(&self) -> Self {
+        match self {
+            crate::Member::Named(v0) => crate::Member::Named(v0.clone()),
+            crate::Member::Unnamed(v0) => crate::Member::Unnamed(v0.clone()),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Meta {
+    fn clone(&self) -> Self {
+        match self {
+            crate::Meta::Path(v0) => crate::Meta::Path(v0.clone()),
+            crate::Meta::List(v0) => crate::Meta::List(v0.clone()),
+            crate::Meta::NameValue(v0) => crate::Meta::NameValue(v0.clone()),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::MetaList {
+    fn clone(&self) -> Self {
+        crate::MetaList {
+            path: self.path.clone(),
+            delimiter: self.delimiter.clone(),
+            tokens: self.tokens.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::MetaNameValue {
+    fn clone(&self) -> Self {
+        crate::MetaNameValue {
+            path: self.path.clone(),
+            eq_token: self.eq_token.clone(),
+            value: self.value.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ParenthesizedGenericArguments {
+    fn clone(&self) -> Self {
+        crate::ParenthesizedGenericArguments {
+            paren_token: self.paren_token.clone(),
+            inputs: self.inputs.clone(),
+            output: self.output.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Pat {
+    fn clone(&self) -> Self {
+        match self {
+            crate::Pat::Const(v0) => crate::Pat::Const(v0.clone()),
+            crate::Pat::Ident(v0) => crate::Pat::Ident(v0.clone()),
+            crate::Pat::Lit(v0) => crate::Pat::Lit(v0.clone()),
+            crate::Pat::Macro(v0) => crate::Pat::Macro(v0.clone()),
+            crate::Pat::Or(v0) => crate::Pat::Or(v0.clone()),
+            crate::Pat::Paren(v0) => crate::Pat::Paren(v0.clone()),
+            crate::Pat::Path(v0) => crate::Pat::Path(v0.clone()),
+            crate::Pat::Range(v0) => crate::Pat::Range(v0.clone()),
+            crate::Pat::Reference(v0) => crate::Pat::Reference(v0.clone()),
+            crate::Pat::Rest(v0) => crate::Pat::Rest(v0.clone()),
+            crate::Pat::Slice(v0) => crate::Pat::Slice(v0.clone()),
+            crate::Pat::Struct(v0) => crate::Pat::Struct(v0.clone()),
+            crate::Pat::Tuple(v0) => crate::Pat::Tuple(v0.clone()),
+            crate::Pat::TupleStruct(v0) => crate::Pat::TupleStruct(v0.clone()),
+            crate::Pat::Type(v0) => crate::Pat::Type(v0.clone()),
+            crate::Pat::Verbatim(v0) => crate::Pat::Verbatim(v0.clone()),
+            crate::Pat::Wild(v0) => crate::Pat::Wild(v0.clone()),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatIdent {
+    fn clone(&self) -> Self {
+        crate::PatIdent {
+            attrs: self.attrs.clone(),
+            by_ref: self.by_ref.clone(),
+            mutability: self.mutability.clone(),
+            ident: self.ident.clone(),
+            subpat: self.subpat.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatOr {
+    fn clone(&self) -> Self {
+        crate::PatOr {
+            attrs: self.attrs.clone(),
+            leading_vert: self.leading_vert.clone(),
+            cases: self.cases.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatParen {
+    fn clone(&self) -> Self {
+        crate::PatParen {
+            attrs: self.attrs.clone(),
+            paren_token: self.paren_token.clone(),
+            pat: self.pat.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatReference {
+    fn clone(&self) -> Self {
+        crate::PatReference {
+            attrs: self.attrs.clone(),
+            and_token: self.and_token.clone(),
+            mutability: self.mutability.clone(),
+            pat: self.pat.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatRest {
+    fn clone(&self) -> Self {
+        crate::PatRest {
+            attrs: self.attrs.clone(),
+            dot2_token: self.dot2_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatSlice {
+    fn clone(&self) -> Self {
+        crate::PatSlice {
+            attrs: self.attrs.clone(),
+            bracket_token: self.bracket_token.clone(),
+            elems: self.elems.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatStruct {
+    fn clone(&self) -> Self {
+        crate::PatStruct {
+            attrs: self.attrs.clone(),
+            qself: self.qself.clone(),
+            path: self.path.clone(),
+            brace_token: self.brace_token.clone(),
+            fields: self.fields.clone(),
+            rest: self.rest.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatTuple {
+    fn clone(&self) -> Self {
+        crate::PatTuple {
+            attrs: self.attrs.clone(),
+            paren_token: self.paren_token.clone(),
+            elems: self.elems.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatTupleStruct {
+    fn clone(&self) -> Self {
+        crate::PatTupleStruct {
+            attrs: self.attrs.clone(),
+            qself: self.qself.clone(),
+            path: self.path.clone(),
+            paren_token: self.paren_token.clone(),
+            elems: self.elems.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatType {
+    fn clone(&self) -> Self {
+        crate::PatType {
+            attrs: self.attrs.clone(),
+            pat: self.pat.clone(),
+            colon_token: self.colon_token.clone(),
+            ty: self.ty.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatWild {
+    fn clone(&self) -> Self {
+        crate::PatWild {
+            attrs: self.attrs.clone(),
+            underscore_token: self.underscore_token.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Path {
+    fn clone(&self) -> Self {
+        crate::Path {
+            leading_colon: self.leading_colon.clone(),
+            segments: self.segments.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PathArguments {
+    fn clone(&self) -> Self {
+        match self {
+            crate::PathArguments::None => crate::PathArguments::None,
+            crate::PathArguments::AngleBracketed(v0) => {
+                crate::PathArguments::AngleBracketed(v0.clone())
+            }
+            crate::PathArguments::Parenthesized(v0) => {
+                crate::PathArguments::Parenthesized(v0.clone())
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PathSegment {
+    fn clone(&self) -> Self {
+        crate::PathSegment {
+            ident: self.ident.clone(),
+            arguments: self.arguments.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PredicateLifetime {
+    fn clone(&self) -> Self {
+        crate::PredicateLifetime {
+            lifetime: self.lifetime.clone(),
+            colon_token: self.colon_token.clone(),
+            bounds: self.bounds.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PredicateType {
+    fn clone(&self) -> Self {
+        crate::PredicateType {
+            lifetimes: self.lifetimes.clone(),
+            bounded_ty: self.bounded_ty.clone(),
+            colon_token: self.colon_token.clone(),
+            bounds: self.bounds.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::QSelf {
+    fn clone(&self) -> Self {
+        crate::QSelf {
+            lt_token: self.lt_token.clone(),
+            ty: self.ty.clone(),
+            position: self.position.clone(),
+            as_token: self.as_token.clone(),
+            gt_token: self.gt_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Copy for crate::RangeLimits {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::RangeLimits {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Receiver {
+    fn clone(&self) -> Self {
+        crate::Receiver {
+            attrs: self.attrs.clone(),
+            reference: self.reference.clone(),
+            mutability: self.mutability.clone(),
+            self_token: self.self_token.clone(),
+            colon_token: self.colon_token.clone(),
+            ty: self.ty.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ReturnType {
+    fn clone(&self) -> Self {
+        match self {
+            crate::ReturnType::Default => crate::ReturnType::Default,
+            crate::ReturnType::Type(v0, v1) => {
+                crate::ReturnType::Type(v0.clone(), v1.clone())
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Signature {
+    fn clone(&self) -> Self {
+        crate::Signature {
+            constness: self.constness.clone(),
+            asyncness: self.asyncness.clone(),
+            unsafety: self.unsafety.clone(),
+            abi: self.abi.clone(),
+            fn_token: self.fn_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            paren_token: self.paren_token.clone(),
+            inputs: self.inputs.clone(),
+            variadic: self.variadic.clone(),
+            output: self.output.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::StaticMutability {
+    fn clone(&self) -> Self {
+        match self {
+            crate::StaticMutability::Mut(v0) => crate::StaticMutability::Mut(v0.clone()),
+            crate::StaticMutability::None => crate::StaticMutability::None,
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Stmt {
+    fn clone(&self) -> Self {
+        match self {
+            crate::Stmt::Local(v0) => crate::Stmt::Local(v0.clone()),
+            crate::Stmt::Item(v0) => crate::Stmt::Item(v0.clone()),
+            crate::Stmt::Expr(v0, v1) => crate::Stmt::Expr(v0.clone(), v1.clone()),
+            crate::Stmt::Macro(v0) => crate::Stmt::Macro(v0.clone()),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::StmtMacro {
+    fn clone(&self) -> Self {
+        crate::StmtMacro {
+            attrs: self.attrs.clone(),
+            mac: self.mac.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TraitBound {
+    fn clone(&self) -> Self {
+        crate::TraitBound {
+            paren_token: self.paren_token.clone(),
+            modifier: self.modifier.clone(),
+            lifetimes: self.lifetimes.clone(),
+            path: self.path.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Copy for crate::TraitBoundModifier {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TraitBoundModifier {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TraitItem {
+    fn clone(&self) -> Self {
+        match self {
+            crate::TraitItem::Const(v0) => crate::TraitItem::Const(v0.clone()),
+            crate::TraitItem::Fn(v0) => crate::TraitItem::Fn(v0.clone()),
+            crate::TraitItem::Type(v0) => crate::TraitItem::Type(v0.clone()),
+            crate::TraitItem::Macro(v0) => crate::TraitItem::Macro(v0.clone()),
+            crate::TraitItem::Verbatim(v0) => crate::TraitItem::Verbatim(v0.clone()),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TraitItemConst {
+    fn clone(&self) -> Self {
+        crate::TraitItemConst {
+            attrs: self.attrs.clone(),
+            const_token: self.const_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            colon_token: self.colon_token.clone(),
+            ty: self.ty.clone(),
+            default: self.default.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TraitItemFn {
+    fn clone(&self) -> Self {
+        crate::TraitItemFn {
+            attrs: self.attrs.clone(),
+            sig: self.sig.clone(),
+            default: self.default.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TraitItemMacro {
+    fn clone(&self) -> Self {
+        crate::TraitItemMacro {
+            attrs: self.attrs.clone(),
+            mac: self.mac.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TraitItemType {
+    fn clone(&self) -> Self {
+        crate::TraitItemType {
+            attrs: self.attrs.clone(),
+            type_token: self.type_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            colon_token: self.colon_token.clone(),
+            bounds: self.bounds.clone(),
+            default: self.default.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Type {
+    fn clone(&self) -> Self {
+        match self {
+            crate::Type::Array(v0) => crate::Type::Array(v0.clone()),
+            crate::Type::BareFn(v0) => crate::Type::BareFn(v0.clone()),
+            crate::Type::Group(v0) => crate::Type::Group(v0.clone()),
+            crate::Type::ImplTrait(v0) => crate::Type::ImplTrait(v0.clone()),
+            crate::Type::Infer(v0) => crate::Type::Infer(v0.clone()),
+            crate::Type::Macro(v0) => crate::Type::Macro(v0.clone()),
+            crate::Type::Never(v0) => crate::Type::Never(v0.clone()),
+            crate::Type::Paren(v0) => crate::Type::Paren(v0.clone()),
+            crate::Type::Path(v0) => crate::Type::Path(v0.clone()),
+            crate::Type::Ptr(v0) => crate::Type::Ptr(v0.clone()),
+            crate::Type::Reference(v0) => crate::Type::Reference(v0.clone()),
+            crate::Type::Slice(v0) => crate::Type::Slice(v0.clone()),
+            crate::Type::TraitObject(v0) => crate::Type::TraitObject(v0.clone()),
+            crate::Type::Tuple(v0) => crate::Type::Tuple(v0.clone()),
+            crate::Type::Verbatim(v0) => crate::Type::Verbatim(v0.clone()),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeArray {
+    fn clone(&self) -> Self {
+        crate::TypeArray {
+            bracket_token: self.bracket_token.clone(),
+            elem: self.elem.clone(),
+            semi_token: self.semi_token.clone(),
+            len: self.len.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeBareFn {
+    fn clone(&self) -> Self {
+        crate::TypeBareFn {
+            lifetimes: self.lifetimes.clone(),
+            unsafety: self.unsafety.clone(),
+            abi: self.abi.clone(),
+            fn_token: self.fn_token.clone(),
+            paren_token: self.paren_token.clone(),
+            inputs: self.inputs.clone(),
+            variadic: self.variadic.clone(),
+            output: self.output.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeGroup {
+    fn clone(&self) -> Self {
+        crate::TypeGroup {
+            group_token: self.group_token.clone(),
+            elem: self.elem.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeImplTrait {
+    fn clone(&self) -> Self {
+        crate::TypeImplTrait {
+            impl_token: self.impl_token.clone(),
+            bounds: self.bounds.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeInfer {
+    fn clone(&self) -> Self {
+        crate::TypeInfer {
+            underscore_token: self.underscore_token.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeMacro {
+    fn clone(&self) -> Self {
+        crate::TypeMacro {
+            mac: self.mac.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeNever {
+    fn clone(&self) -> Self {
+        crate::TypeNever {
+            bang_token: self.bang_token.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeParam {
+    fn clone(&self) -> Self {
+        crate::TypeParam {
+            attrs: self.attrs.clone(),
+            ident: self.ident.clone(),
+            colon_token: self.colon_token.clone(),
+            bounds: self.bounds.clone(),
+            eq_token: self.eq_token.clone(),
+            default: self.default.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeParamBound {
+    fn clone(&self) -> Self {
+        match self {
+            crate::TypeParamBound::Trait(v0) => crate::TypeParamBound::Trait(v0.clone()),
+            crate::TypeParamBound::Lifetime(v0) => {
+                crate::TypeParamBound::Lifetime(v0.clone())
+            }
+            crate::TypeParamBound::Verbatim(v0) => {
+                crate::TypeParamBound::Verbatim(v0.clone())
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeParen {
+    fn clone(&self) -> Self {
+        crate::TypeParen {
+            paren_token: self.paren_token.clone(),
+            elem: self.elem.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypePath {
+    fn clone(&self) -> Self {
+        crate::TypePath {
+            qself: self.qself.clone(),
+            path: self.path.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypePtr {
+    fn clone(&self) -> Self {
+        crate::TypePtr {
+            star_token: self.star_token.clone(),
+            const_token: self.const_token.clone(),
+            mutability: self.mutability.clone(),
+            elem: self.elem.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeReference {
+    fn clone(&self) -> Self {
+        crate::TypeReference {
+            and_token: self.and_token.clone(),
+            lifetime: self.lifetime.clone(),
+            mutability: self.mutability.clone(),
+            elem: self.elem.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeSlice {
+    fn clone(&self) -> Self {
+        crate::TypeSlice {
+            bracket_token: self.bracket_token.clone(),
+            elem: self.elem.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeTraitObject {
+    fn clone(&self) -> Self {
+        crate::TypeTraitObject {
+            dyn_token: self.dyn_token.clone(),
+            bounds: self.bounds.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeTuple {
+    fn clone(&self) -> Self {
+        crate::TypeTuple {
+            paren_token: self.paren_token.clone(),
+            elems: self.elems.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Copy for crate::UnOp {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::UnOp {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::UseGlob {
+    fn clone(&self) -> Self {
+        crate::UseGlob {
+            star_token: self.star_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::UseGroup {
+    fn clone(&self) -> Self {
+        crate::UseGroup {
+            brace_token: self.brace_token.clone(),
+            items: self.items.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::UseName {
+    fn clone(&self) -> Self {
+        crate::UseName {
+            ident: self.ident.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::UsePath {
+    fn clone(&self) -> Self {
+        crate::UsePath {
+            ident: self.ident.clone(),
+            colon2_token: self.colon2_token.clone(),
+            tree: self.tree.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::UseRename {
+    fn clone(&self) -> Self {
+        crate::UseRename {
+            ident: self.ident.clone(),
+            as_token: self.as_token.clone(),
+            rename: self.rename.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::UseTree {
+    fn clone(&self) -> Self {
+        match self {
+            crate::UseTree::Path(v0) => crate::UseTree::Path(v0.clone()),
+            crate::UseTree::Name(v0) => crate::UseTree::Name(v0.clone()),
+            crate::UseTree::Rename(v0) => crate::UseTree::Rename(v0.clone()),
+            crate::UseTree::Glob(v0) => crate::UseTree::Glob(v0.clone()),
+            crate::UseTree::Group(v0) => crate::UseTree::Group(v0.clone()),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Variadic {
+    fn clone(&self) -> Self {
+        crate::Variadic {
+            attrs: self.attrs.clone(),
+            pat: self.pat.clone(),
+            dots: self.dots.clone(),
+            comma: self.comma.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Variant {
+    fn clone(&self) -> Self {
+        crate::Variant {
+            attrs: self.attrs.clone(),
+            ident: self.ident.clone(),
+            fields: self.fields.clone(),
+            discriminant: self.discriminant.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::VisRestricted {
+    fn clone(&self) -> Self {
+        crate::VisRestricted {
+            pub_token: self.pub_token.clone(),
+            paren_token: self.paren_token.clone(),
+            in_token: self.in_token.clone(),
+            path: self.path.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Visibility {
+    fn clone(&self) -> Self {
+        match self {
+            crate::Visibility::Public(v0) => crate::Visibility::Public(v0.clone()),
+            crate::Visibility::Restricted(v0) => {
+                crate::Visibility::Restricted(v0.clone())
+            }
+            crate::Visibility::Inherited => crate::Visibility::Inherited,
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::WhereClause {
+    fn clone(&self) -> Self {
+        crate::WhereClause {
+            where_token: self.where_token.clone(),
+            predicates: self.predicates.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::WherePredicate {
+    fn clone(&self) -> Self {
+        match self {
+            crate::WherePredicate::Lifetime(v0) => {
+                crate::WherePredicate::Lifetime(v0.clone())
+            }
+            crate::WherePredicate::Type(v0) => crate::WherePredicate::Type(v0.clone()),
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/gen/debug.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/gen/debug.rs
--- 43.0.0-1/rust-vendor/syn/src/gen/debug.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/gen/debug.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,3160 @@
+// This file is @generated by syn-internal-codegen.
+// It is not intended for manual editing.
+
+#![allow(unknown_lints, non_local_definitions)]
+use std::fmt::{self, Debug};
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Abi {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Abi");
+        formatter.field("extern_token", &self.extern_token);
+        formatter.field("name", &self.name);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::AngleBracketedGenericArguments {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "AngleBracketedGenericArguments")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::AngleBracketedGenericArguments {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("colon2_token", &self.colon2_token);
+        formatter.field("lt_token", &self.lt_token);
+        formatter.field("args", &self.args);
+        formatter.field("gt_token", &self.gt_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Arm {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Arm");
+        formatter.field("attrs", &self.attrs);
+        formatter.field("pat", &self.pat);
+        formatter.field("guard", &self.guard);
+        formatter.field("fat_arrow_token", &self.fat_arrow_token);
+        formatter.field("body", &self.body);
+        formatter.field("comma", &self.comma);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::AssocConst {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("AssocConst");
+        formatter.field("ident", &self.ident);
+        formatter.field("generics", &self.generics);
+        formatter.field("eq_token", &self.eq_token);
+        formatter.field("value", &self.value);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::AssocType {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("AssocType");
+        formatter.field("ident", &self.ident);
+        formatter.field("generics", &self.generics);
+        formatter.field("eq_token", &self.eq_token);
+        formatter.field("ty", &self.ty);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::AttrStyle {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("AttrStyle::")?;
+        match self {
+            crate::AttrStyle::Outer => formatter.write_str("Outer"),
+            crate::AttrStyle::Inner(v0) => {
+                let mut formatter = formatter.debug_tuple("Inner");
+                formatter.field(v0);
+                formatter.finish()
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Attribute {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Attribute");
+        formatter.field("pound_token", &self.pound_token);
+        formatter.field("style", &self.style);
+        formatter.field("bracket_token", &self.bracket_token);
+        formatter.field("meta", &self.meta);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::BareFnArg {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("BareFnArg");
+        formatter.field("attrs", &self.attrs);
+        formatter.field("name", &self.name);
+        formatter.field("ty", &self.ty);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::BareVariadic {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("BareVariadic");
+        formatter.field("attrs", &self.attrs);
+        formatter.field("name", &self.name);
+        formatter.field("dots", &self.dots);
+        formatter.field("comma", &self.comma);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::BinOp {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("BinOp::")?;
+        match self {
+            crate::BinOp::Add(v0) => {
+                let mut formatter = formatter.debug_tuple("Add");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::Sub(v0) => {
+                let mut formatter = formatter.debug_tuple("Sub");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::Mul(v0) => {
+                let mut formatter = formatter.debug_tuple("Mul");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::Div(v0) => {
+                let mut formatter = formatter.debug_tuple("Div");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::Rem(v0) => {
+                let mut formatter = formatter.debug_tuple("Rem");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::And(v0) => {
+                let mut formatter = formatter.debug_tuple("And");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::Or(v0) => {
+                let mut formatter = formatter.debug_tuple("Or");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::BitXor(v0) => {
+                let mut formatter = formatter.debug_tuple("BitXor");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::BitAnd(v0) => {
+                let mut formatter = formatter.debug_tuple("BitAnd");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::BitOr(v0) => {
+                let mut formatter = formatter.debug_tuple("BitOr");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::Shl(v0) => {
+                let mut formatter = formatter.debug_tuple("Shl");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::Shr(v0) => {
+                let mut formatter = formatter.debug_tuple("Shr");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::Eq(v0) => {
+                let mut formatter = formatter.debug_tuple("Eq");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::Lt(v0) => {
+                let mut formatter = formatter.debug_tuple("Lt");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::Le(v0) => {
+                let mut formatter = formatter.debug_tuple("Le");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::Ne(v0) => {
+                let mut formatter = formatter.debug_tuple("Ne");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::Ge(v0) => {
+                let mut formatter = formatter.debug_tuple("Ge");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::Gt(v0) => {
+                let mut formatter = formatter.debug_tuple("Gt");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::AddAssign(v0) => {
+                let mut formatter = formatter.debug_tuple("AddAssign");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::SubAssign(v0) => {
+                let mut formatter = formatter.debug_tuple("SubAssign");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::MulAssign(v0) => {
+                let mut formatter = formatter.debug_tuple("MulAssign");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::DivAssign(v0) => {
+                let mut formatter = formatter.debug_tuple("DivAssign");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::RemAssign(v0) => {
+                let mut formatter = formatter.debug_tuple("RemAssign");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::BitXorAssign(v0) => {
+                let mut formatter = formatter.debug_tuple("BitXorAssign");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::BitAndAssign(v0) => {
+                let mut formatter = formatter.debug_tuple("BitAndAssign");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::BitOrAssign(v0) => {
+                let mut formatter = formatter.debug_tuple("BitOrAssign");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::ShlAssign(v0) => {
+                let mut formatter = formatter.debug_tuple("ShlAssign");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::BinOp::ShrAssign(v0) => {
+                let mut formatter = formatter.debug_tuple("ShrAssign");
+                formatter.field(v0);
+                formatter.finish()
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Block {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Block");
+        formatter.field("brace_token", &self.brace_token);
+        formatter.field("stmts", &self.stmts);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::BoundLifetimes {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("BoundLifetimes");
+        formatter.field("for_token", &self.for_token);
+        formatter.field("lt_token", &self.lt_token);
+        formatter.field("lifetimes", &self.lifetimes);
+        formatter.field("gt_token", &self.gt_token);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ConstParam {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ConstParam");
+        formatter.field("attrs", &self.attrs);
+        formatter.field("const_token", &self.const_token);
+        formatter.field("ident", &self.ident);
+        formatter.field("colon_token", &self.colon_token);
+        formatter.field("ty", &self.ty);
+        formatter.field("eq_token", &self.eq_token);
+        formatter.field("default", &self.default);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Constraint {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Constraint");
+        formatter.field("ident", &self.ident);
+        formatter.field("generics", &self.generics);
+        formatter.field("colon_token", &self.colon_token);
+        formatter.field("bounds", &self.bounds);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Data {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Data::")?;
+        match self {
+            crate::Data::Struct(v0) => v0.debug(formatter, "Struct"),
+            crate::Data::Enum(v0) => v0.debug(formatter, "Enum"),
+            crate::Data::Union(v0) => v0.debug(formatter, "Union"),
+        }
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::DataEnum {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "DataEnum")
+    }
+}
+#[cfg(feature = "derive")]
+impl crate::DataEnum {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("enum_token", &self.enum_token);
+        formatter.field("brace_token", &self.brace_token);
+        formatter.field("variants", &self.variants);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::DataStruct {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "DataStruct")
+    }
+}
+#[cfg(feature = "derive")]
+impl crate::DataStruct {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("struct_token", &self.struct_token);
+        formatter.field("fields", &self.fields);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::DataUnion {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "DataUnion")
+    }
+}
+#[cfg(feature = "derive")]
+impl crate::DataUnion {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("union_token", &self.union_token);
+        formatter.field("fields", &self.fields);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::DeriveInput {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("DeriveInput");
+        formatter.field("attrs", &self.attrs);
+        formatter.field("vis", &self.vis);
+        formatter.field("ident", &self.ident);
+        formatter.field("generics", &self.generics);
+        formatter.field("data", &self.data);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Expr {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Expr::")?;
+        match self {
+            #[cfg(feature = "full")]
+            crate::Expr::Array(v0) => v0.debug(formatter, "Array"),
+            #[cfg(feature = "full")]
+            crate::Expr::Assign(v0) => v0.debug(formatter, "Assign"),
+            #[cfg(feature = "full")]
+            crate::Expr::Async(v0) => v0.debug(formatter, "Async"),
+            #[cfg(feature = "full")]
+            crate::Expr::Await(v0) => v0.debug(formatter, "Await"),
+            crate::Expr::Binary(v0) => v0.debug(formatter, "Binary"),
+            #[cfg(feature = "full")]
+            crate::Expr::Block(v0) => v0.debug(formatter, "Block"),
+            #[cfg(feature = "full")]
+            crate::Expr::Break(v0) => v0.debug(formatter, "Break"),
+            crate::Expr::Call(v0) => v0.debug(formatter, "Call"),
+            crate::Expr::Cast(v0) => v0.debug(formatter, "Cast"),
+            #[cfg(feature = "full")]
+            crate::Expr::Closure(v0) => v0.debug(formatter, "Closure"),
+            #[cfg(feature = "full")]
+            crate::Expr::Const(v0) => v0.debug(formatter, "Const"),
+            #[cfg(feature = "full")]
+            crate::Expr::Continue(v0) => v0.debug(formatter, "Continue"),
+            crate::Expr::Field(v0) => v0.debug(formatter, "Field"),
+            #[cfg(feature = "full")]
+            crate::Expr::ForLoop(v0) => v0.debug(formatter, "ForLoop"),
+            crate::Expr::Group(v0) => v0.debug(formatter, "Group"),
+            #[cfg(feature = "full")]
+            crate::Expr::If(v0) => v0.debug(formatter, "If"),
+            crate::Expr::Index(v0) => v0.debug(formatter, "Index"),
+            #[cfg(feature = "full")]
+            crate::Expr::Infer(v0) => v0.debug(formatter, "Infer"),
+            #[cfg(feature = "full")]
+            crate::Expr::Let(v0) => v0.debug(formatter, "Let"),
+            crate::Expr::Lit(v0) => v0.debug(formatter, "Lit"),
+            #[cfg(feature = "full")]
+            crate::Expr::Loop(v0) => v0.debug(formatter, "Loop"),
+            crate::Expr::Macro(v0) => v0.debug(formatter, "Macro"),
+            #[cfg(feature = "full")]
+            crate::Expr::Match(v0) => v0.debug(formatter, "Match"),
+            crate::Expr::MethodCall(v0) => v0.debug(formatter, "MethodCall"),
+            crate::Expr::Paren(v0) => v0.debug(formatter, "Paren"),
+            crate::Expr::Path(v0) => v0.debug(formatter, "Path"),
+            #[cfg(feature = "full")]
+            crate::Expr::Range(v0) => v0.debug(formatter, "Range"),
+            crate::Expr::Reference(v0) => v0.debug(formatter, "Reference"),
+            #[cfg(feature = "full")]
+            crate::Expr::Repeat(v0) => v0.debug(formatter, "Repeat"),
+            #[cfg(feature = "full")]
+            crate::Expr::Return(v0) => v0.debug(formatter, "Return"),
+            crate::Expr::Struct(v0) => v0.debug(formatter, "Struct"),
+            #[cfg(feature = "full")]
+            crate::Expr::Try(v0) => v0.debug(formatter, "Try"),
+            #[cfg(feature = "full")]
+            crate::Expr::TryBlock(v0) => v0.debug(formatter, "TryBlock"),
+            #[cfg(feature = "full")]
+            crate::Expr::Tuple(v0) => v0.debug(formatter, "Tuple"),
+            crate::Expr::Unary(v0) => v0.debug(formatter, "Unary"),
+            #[cfg(feature = "full")]
+            crate::Expr::Unsafe(v0) => v0.debug(formatter, "Unsafe"),
+            crate::Expr::Verbatim(v0) => {
+                let mut formatter = formatter.debug_tuple("Verbatim");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::While(v0) => v0.debug(formatter, "While"),
+            #[cfg(feature = "full")]
+            crate::Expr::Yield(v0) => v0.debug(formatter, "Yield"),
+            #[cfg(not(feature = "full"))]
+            _ => unreachable!(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprArray {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprArray")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprArray {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("bracket_token", &self.bracket_token);
+        formatter.field("elems", &self.elems);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprAssign {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprAssign")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprAssign {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("left", &self.left);
+        formatter.field("eq_token", &self.eq_token);
+        formatter.field("right", &self.right);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprAsync {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprAsync")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprAsync {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("async_token", &self.async_token);
+        formatter.field("capture", &self.capture);
+        formatter.field("block", &self.block);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprAwait {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprAwait")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprAwait {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("base", &self.base);
+        formatter.field("dot_token", &self.dot_token);
+        formatter.field("await_token", &self.await_token);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprBinary {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprBinary")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::ExprBinary {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("left", &self.left);
+        formatter.field("op", &self.op);
+        formatter.field("right", &self.right);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprBlock {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprBlock")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprBlock {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("label", &self.label);
+        formatter.field("block", &self.block);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprBreak {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprBreak")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprBreak {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("break_token", &self.break_token);
+        formatter.field("label", &self.label);
+        formatter.field("expr", &self.expr);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprCall {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprCall")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::ExprCall {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("func", &self.func);
+        formatter.field("paren_token", &self.paren_token);
+        formatter.field("args", &self.args);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprCast {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprCast")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::ExprCast {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("expr", &self.expr);
+        formatter.field("as_token", &self.as_token);
+        formatter.field("ty", &self.ty);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprClosure {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprClosure")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprClosure {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("lifetimes", &self.lifetimes);
+        formatter.field("constness", &self.constness);
+        formatter.field("movability", &self.movability);
+        formatter.field("asyncness", &self.asyncness);
+        formatter.field("capture", &self.capture);
+        formatter.field("or1_token", &self.or1_token);
+        formatter.field("inputs", &self.inputs);
+        formatter.field("or2_token", &self.or2_token);
+        formatter.field("output", &self.output);
+        formatter.field("body", &self.body);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprConst {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprConst")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprConst {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("const_token", &self.const_token);
+        formatter.field("block", &self.block);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprContinue {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprContinue")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprContinue {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("continue_token", &self.continue_token);
+        formatter.field("label", &self.label);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprField {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprField")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::ExprField {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("base", &self.base);
+        formatter.field("dot_token", &self.dot_token);
+        formatter.field("member", &self.member);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprForLoop {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprForLoop")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprForLoop {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("label", &self.label);
+        formatter.field("for_token", &self.for_token);
+        formatter.field("pat", &self.pat);
+        formatter.field("in_token", &self.in_token);
+        formatter.field("expr", &self.expr);
+        formatter.field("body", &self.body);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprGroup {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprGroup")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::ExprGroup {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("group_token", &self.group_token);
+        formatter.field("expr", &self.expr);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprIf {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprIf")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprIf {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("if_token", &self.if_token);
+        formatter.field("cond", &self.cond);
+        formatter.field("then_branch", &self.then_branch);
+        formatter.field("else_branch", &self.else_branch);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprIndex {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprIndex")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::ExprIndex {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("expr", &self.expr);
+        formatter.field("bracket_token", &self.bracket_token);
+        formatter.field("index", &self.index);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprInfer {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprInfer")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprInfer {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("underscore_token", &self.underscore_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprLet {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprLet")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprLet {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("let_token", &self.let_token);
+        formatter.field("pat", &self.pat);
+        formatter.field("eq_token", &self.eq_token);
+        formatter.field("expr", &self.expr);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprLit {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprLit")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::ExprLit {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("lit", &self.lit);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprLoop {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprLoop")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprLoop {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("label", &self.label);
+        formatter.field("loop_token", &self.loop_token);
+        formatter.field("body", &self.body);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprMacro {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprMacro")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::ExprMacro {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("mac", &self.mac);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprMatch {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprMatch")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprMatch {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("match_token", &self.match_token);
+        formatter.field("expr", &self.expr);
+        formatter.field("brace_token", &self.brace_token);
+        formatter.field("arms", &self.arms);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprMethodCall {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprMethodCall")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::ExprMethodCall {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("receiver", &self.receiver);
+        formatter.field("dot_token", &self.dot_token);
+        formatter.field("method", &self.method);
+        formatter.field("turbofish", &self.turbofish);
+        formatter.field("paren_token", &self.paren_token);
+        formatter.field("args", &self.args);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprParen {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprParen")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::ExprParen {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("paren_token", &self.paren_token);
+        formatter.field("expr", &self.expr);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprPath {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprPath")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::ExprPath {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("qself", &self.qself);
+        formatter.field("path", &self.path);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprRange {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprRange")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprRange {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("start", &self.start);
+        formatter.field("limits", &self.limits);
+        formatter.field("end", &self.end);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprReference {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprReference")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::ExprReference {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("and_token", &self.and_token);
+        formatter.field("mutability", &self.mutability);
+        formatter.field("expr", &self.expr);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprRepeat {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprRepeat")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprRepeat {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("bracket_token", &self.bracket_token);
+        formatter.field("expr", &self.expr);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.field("len", &self.len);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprReturn {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprReturn")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprReturn {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("return_token", &self.return_token);
+        formatter.field("expr", &self.expr);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprStruct {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprStruct")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::ExprStruct {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("qself", &self.qself);
+        formatter.field("path", &self.path);
+        formatter.field("brace_token", &self.brace_token);
+        formatter.field("fields", &self.fields);
+        formatter.field("dot2_token", &self.dot2_token);
+        formatter.field("rest", &self.rest);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprTry {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprTry")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprTry {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("expr", &self.expr);
+        formatter.field("question_token", &self.question_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprTryBlock {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprTryBlock")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprTryBlock {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("try_token", &self.try_token);
+        formatter.field("block", &self.block);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprTuple {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprTuple")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprTuple {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("paren_token", &self.paren_token);
+        formatter.field("elems", &self.elems);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprUnary {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprUnary")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::ExprUnary {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("op", &self.op);
+        formatter.field("expr", &self.expr);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprUnsafe {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprUnsafe")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprUnsafe {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("unsafe_token", &self.unsafe_token);
+        formatter.field("block", &self.block);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprWhile {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprWhile")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprWhile {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("label", &self.label);
+        formatter.field("while_token", &self.while_token);
+        formatter.field("cond", &self.cond);
+        formatter.field("body", &self.body);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ExprYield {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ExprYield")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ExprYield {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("yield_token", &self.yield_token);
+        formatter.field("expr", &self.expr);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Field {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Field");
+        formatter.field("attrs", &self.attrs);
+        formatter.field("vis", &self.vis);
+        formatter.field("mutability", &self.mutability);
+        formatter.field("ident", &self.ident);
+        formatter.field("colon_token", &self.colon_token);
+        formatter.field("ty", &self.ty);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::FieldMutability {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("FieldMutability::")?;
+        match self {
+            crate::FieldMutability::None => formatter.write_str("None"),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::FieldPat {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("FieldPat");
+        formatter.field("attrs", &self.attrs);
+        formatter.field("member", &self.member);
+        formatter.field("colon_token", &self.colon_token);
+        formatter.field("pat", &self.pat);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::FieldValue {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("FieldValue");
+        formatter.field("attrs", &self.attrs);
+        formatter.field("member", &self.member);
+        formatter.field("colon_token", &self.colon_token);
+        formatter.field("expr", &self.expr);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Fields {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Fields::")?;
+        match self {
+            crate::Fields::Named(v0) => v0.debug(formatter, "Named"),
+            crate::Fields::Unnamed(v0) => v0.debug(formatter, "Unnamed"),
+            crate::Fields::Unit => formatter.write_str("Unit"),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::FieldsNamed {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "FieldsNamed")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::FieldsNamed {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("brace_token", &self.brace_token);
+        formatter.field("named", &self.named);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::FieldsUnnamed {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "FieldsUnnamed")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::FieldsUnnamed {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("paren_token", &self.paren_token);
+        formatter.field("unnamed", &self.unnamed);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::File {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("File");
+        formatter.field("shebang", &self.shebang);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("items", &self.items);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::FnArg {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("FnArg::")?;
+        match self {
+            crate::FnArg::Receiver(v0) => {
+                let mut formatter = formatter.debug_tuple("Receiver");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::FnArg::Typed(v0) => {
+                let mut formatter = formatter.debug_tuple("Typed");
+                formatter.field(v0);
+                formatter.finish()
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ForeignItem {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("ForeignItem::")?;
+        match self {
+            crate::ForeignItem::Fn(v0) => v0.debug(formatter, "Fn"),
+            crate::ForeignItem::Static(v0) => v0.debug(formatter, "Static"),
+            crate::ForeignItem::Type(v0) => v0.debug(formatter, "Type"),
+            crate::ForeignItem::Macro(v0) => v0.debug(formatter, "Macro"),
+            crate::ForeignItem::Verbatim(v0) => {
+                let mut formatter = formatter.debug_tuple("Verbatim");
+                formatter.field(v0);
+                formatter.finish()
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ForeignItemFn {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ForeignItemFn")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ForeignItemFn {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("vis", &self.vis);
+        formatter.field("sig", &self.sig);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ForeignItemMacro {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ForeignItemMacro")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ForeignItemMacro {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("mac", &self.mac);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ForeignItemStatic {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ForeignItemStatic")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ForeignItemStatic {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("vis", &self.vis);
+        formatter.field("static_token", &self.static_token);
+        formatter.field("mutability", &self.mutability);
+        formatter.field("ident", &self.ident);
+        formatter.field("colon_token", &self.colon_token);
+        formatter.field("ty", &self.ty);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ForeignItemType {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ForeignItemType")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ForeignItemType {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("vis", &self.vis);
+        formatter.field("type_token", &self.type_token);
+        formatter.field("ident", &self.ident);
+        formatter.field("generics", &self.generics);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::GenericArgument {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("GenericArgument::")?;
+        match self {
+            crate::GenericArgument::Lifetime(v0) => {
+                let mut formatter = formatter.debug_tuple("Lifetime");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::GenericArgument::Type(v0) => {
+                let mut formatter = formatter.debug_tuple("Type");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::GenericArgument::Const(v0) => {
+                let mut formatter = formatter.debug_tuple("Const");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::GenericArgument::AssocType(v0) => {
+                let mut formatter = formatter.debug_tuple("AssocType");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::GenericArgument::AssocConst(v0) => {
+                let mut formatter = formatter.debug_tuple("AssocConst");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::GenericArgument::Constraint(v0) => {
+                let mut formatter = formatter.debug_tuple("Constraint");
+                formatter.field(v0);
+                formatter.finish()
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::GenericParam {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("GenericParam::")?;
+        match self {
+            crate::GenericParam::Lifetime(v0) => {
+                let mut formatter = formatter.debug_tuple("Lifetime");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::GenericParam::Type(v0) => {
+                let mut formatter = formatter.debug_tuple("Type");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::GenericParam::Const(v0) => {
+                let mut formatter = formatter.debug_tuple("Const");
+                formatter.field(v0);
+                formatter.finish()
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Generics {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Generics");
+        formatter.field("lt_token", &self.lt_token);
+        formatter.field("params", &self.params);
+        formatter.field("gt_token", &self.gt_token);
+        formatter.field("where_clause", &self.where_clause);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ImplItem {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("ImplItem::")?;
+        match self {
+            crate::ImplItem::Const(v0) => v0.debug(formatter, "Const"),
+            crate::ImplItem::Fn(v0) => v0.debug(formatter, "Fn"),
+            crate::ImplItem::Type(v0) => v0.debug(formatter, "Type"),
+            crate::ImplItem::Macro(v0) => v0.debug(formatter, "Macro"),
+            crate::ImplItem::Verbatim(v0) => {
+                let mut formatter = formatter.debug_tuple("Verbatim");
+                formatter.field(v0);
+                formatter.finish()
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ImplItemConst {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ImplItemConst")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ImplItemConst {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("vis", &self.vis);
+        formatter.field("defaultness", &self.defaultness);
+        formatter.field("const_token", &self.const_token);
+        formatter.field("ident", &self.ident);
+        formatter.field("generics", &self.generics);
+        formatter.field("colon_token", &self.colon_token);
+        formatter.field("ty", &self.ty);
+        formatter.field("eq_token", &self.eq_token);
+        formatter.field("expr", &self.expr);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ImplItemFn {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ImplItemFn")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ImplItemFn {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("vis", &self.vis);
+        formatter.field("defaultness", &self.defaultness);
+        formatter.field("sig", &self.sig);
+        formatter.field("block", &self.block);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ImplItemMacro {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ImplItemMacro")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ImplItemMacro {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("mac", &self.mac);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ImplItemType {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ImplItemType")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ImplItemType {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("vis", &self.vis);
+        formatter.field("defaultness", &self.defaultness);
+        formatter.field("type_token", &self.type_token);
+        formatter.field("ident", &self.ident);
+        formatter.field("generics", &self.generics);
+        formatter.field("eq_token", &self.eq_token);
+        formatter.field("ty", &self.ty);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ImplRestriction {
+    fn fmt(&self, _formatter: &mut fmt::Formatter) -> fmt::Result {
+        match *self {}
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Index {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Index");
+        formatter.field("index", &self.index);
+        formatter.field("span", &self.span);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Item {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Item::")?;
+        match self {
+            crate::Item::Const(v0) => v0.debug(formatter, "Const"),
+            crate::Item::Enum(v0) => v0.debug(formatter, "Enum"),
+            crate::Item::ExternCrate(v0) => v0.debug(formatter, "ExternCrate"),
+            crate::Item::Fn(v0) => v0.debug(formatter, "Fn"),
+            crate::Item::ForeignMod(v0) => v0.debug(formatter, "ForeignMod"),
+            crate::Item::Impl(v0) => v0.debug(formatter, "Impl"),
+            crate::Item::Macro(v0) => v0.debug(formatter, "Macro"),
+            crate::Item::Mod(v0) => v0.debug(formatter, "Mod"),
+            crate::Item::Static(v0) => v0.debug(formatter, "Static"),
+            crate::Item::Struct(v0) => v0.debug(formatter, "Struct"),
+            crate::Item::Trait(v0) => v0.debug(formatter, "Trait"),
+            crate::Item::TraitAlias(v0) => v0.debug(formatter, "TraitAlias"),
+            crate::Item::Type(v0) => v0.debug(formatter, "Type"),
+            crate::Item::Union(v0) => v0.debug(formatter, "Union"),
+            crate::Item::Use(v0) => v0.debug(formatter, "Use"),
+            crate::Item::Verbatim(v0) => {
+                let mut formatter = formatter.debug_tuple("Verbatim");
+                formatter.field(v0);
+                formatter.finish()
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ItemConst {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ItemConst")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ItemConst {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("vis", &self.vis);
+        formatter.field("const_token", &self.const_token);
+        formatter.field("ident", &self.ident);
+        formatter.field("generics", &self.generics);
+        formatter.field("colon_token", &self.colon_token);
+        formatter.field("ty", &self.ty);
+        formatter.field("eq_token", &self.eq_token);
+        formatter.field("expr", &self.expr);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ItemEnum {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ItemEnum")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ItemEnum {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("vis", &self.vis);
+        formatter.field("enum_token", &self.enum_token);
+        formatter.field("ident", &self.ident);
+        formatter.field("generics", &self.generics);
+        formatter.field("brace_token", &self.brace_token);
+        formatter.field("variants", &self.variants);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ItemExternCrate {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ItemExternCrate")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ItemExternCrate {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("vis", &self.vis);
+        formatter.field("extern_token", &self.extern_token);
+        formatter.field("crate_token", &self.crate_token);
+        formatter.field("ident", &self.ident);
+        formatter.field("rename", &self.rename);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ItemFn {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ItemFn")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ItemFn {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("vis", &self.vis);
+        formatter.field("sig", &self.sig);
+        formatter.field("block", &self.block);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ItemForeignMod {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ItemForeignMod")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ItemForeignMod {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("unsafety", &self.unsafety);
+        formatter.field("abi", &self.abi);
+        formatter.field("brace_token", &self.brace_token);
+        formatter.field("items", &self.items);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ItemImpl {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ItemImpl")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ItemImpl {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("defaultness", &self.defaultness);
+        formatter.field("unsafety", &self.unsafety);
+        formatter.field("impl_token", &self.impl_token);
+        formatter.field("generics", &self.generics);
+        formatter.field("trait_", &self.trait_);
+        formatter.field("self_ty", &self.self_ty);
+        formatter.field("brace_token", &self.brace_token);
+        formatter.field("items", &self.items);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ItemMacro {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ItemMacro")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ItemMacro {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("ident", &self.ident);
+        formatter.field("mac", &self.mac);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ItemMod {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ItemMod")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ItemMod {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("vis", &self.vis);
+        formatter.field("unsafety", &self.unsafety);
+        formatter.field("mod_token", &self.mod_token);
+        formatter.field("ident", &self.ident);
+        formatter.field("content", &self.content);
+        formatter.field("semi", &self.semi);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ItemStatic {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ItemStatic")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ItemStatic {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("vis", &self.vis);
+        formatter.field("static_token", &self.static_token);
+        formatter.field("mutability", &self.mutability);
+        formatter.field("ident", &self.ident);
+        formatter.field("colon_token", &self.colon_token);
+        formatter.field("ty", &self.ty);
+        formatter.field("eq_token", &self.eq_token);
+        formatter.field("expr", &self.expr);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ItemStruct {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ItemStruct")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ItemStruct {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("vis", &self.vis);
+        formatter.field("struct_token", &self.struct_token);
+        formatter.field("ident", &self.ident);
+        formatter.field("generics", &self.generics);
+        formatter.field("fields", &self.fields);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ItemTrait {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ItemTrait")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ItemTrait {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("vis", &self.vis);
+        formatter.field("unsafety", &self.unsafety);
+        formatter.field("auto_token", &self.auto_token);
+        formatter.field("restriction", &self.restriction);
+        formatter.field("trait_token", &self.trait_token);
+        formatter.field("ident", &self.ident);
+        formatter.field("generics", &self.generics);
+        formatter.field("colon_token", &self.colon_token);
+        formatter.field("supertraits", &self.supertraits);
+        formatter.field("brace_token", &self.brace_token);
+        formatter.field("items", &self.items);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ItemTraitAlias {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ItemTraitAlias")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ItemTraitAlias {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("vis", &self.vis);
+        formatter.field("trait_token", &self.trait_token);
+        formatter.field("ident", &self.ident);
+        formatter.field("generics", &self.generics);
+        formatter.field("eq_token", &self.eq_token);
+        formatter.field("bounds", &self.bounds);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ItemType {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ItemType")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ItemType {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("vis", &self.vis);
+        formatter.field("type_token", &self.type_token);
+        formatter.field("ident", &self.ident);
+        formatter.field("generics", &self.generics);
+        formatter.field("eq_token", &self.eq_token);
+        formatter.field("ty", &self.ty);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ItemUnion {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ItemUnion")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ItemUnion {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("vis", &self.vis);
+        formatter.field("union_token", &self.union_token);
+        formatter.field("ident", &self.ident);
+        formatter.field("generics", &self.generics);
+        formatter.field("fields", &self.fields);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ItemUse {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ItemUse")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::ItemUse {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("vis", &self.vis);
+        formatter.field("use_token", &self.use_token);
+        formatter.field("leading_colon", &self.leading_colon);
+        formatter.field("tree", &self.tree);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Label {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Label");
+        formatter.field("name", &self.name);
+        formatter.field("colon_token", &self.colon_token);
+        formatter.finish()
+    }
+}
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Lifetime {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "Lifetime")
+    }
+}
+impl crate::Lifetime {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("apostrophe", &self.apostrophe);
+        formatter.field("ident", &self.ident);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::LifetimeParam {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("LifetimeParam");
+        formatter.field("attrs", &self.attrs);
+        formatter.field("lifetime", &self.lifetime);
+        formatter.field("colon_token", &self.colon_token);
+        formatter.field("bounds", &self.bounds);
+        formatter.finish()
+    }
+}
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Lit {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Lit::")?;
+        match self {
+            crate::Lit::Str(v0) => v0.debug(formatter, "Str"),
+            crate::Lit::ByteStr(v0) => v0.debug(formatter, "ByteStr"),
+            crate::Lit::CStr(v0) => v0.debug(formatter, "CStr"),
+            crate::Lit::Byte(v0) => v0.debug(formatter, "Byte"),
+            crate::Lit::Char(v0) => v0.debug(formatter, "Char"),
+            crate::Lit::Int(v0) => v0.debug(formatter, "Int"),
+            crate::Lit::Float(v0) => v0.debug(formatter, "Float"),
+            crate::Lit::Bool(v0) => v0.debug(formatter, "Bool"),
+            crate::Lit::Verbatim(v0) => {
+                let mut formatter = formatter.debug_tuple("Verbatim");
+                formatter.field(v0);
+                formatter.finish()
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Local {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "Local")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::Local {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("let_token", &self.let_token);
+        formatter.field("pat", &self.pat);
+        formatter.field("init", &self.init);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::LocalInit {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("LocalInit");
+        formatter.field("eq_token", &self.eq_token);
+        formatter.field("expr", &self.expr);
+        formatter.field("diverge", &self.diverge);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Macro {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Macro");
+        formatter.field("path", &self.path);
+        formatter.field("bang_token", &self.bang_token);
+        formatter.field("delimiter", &self.delimiter);
+        formatter.field("tokens", &self.tokens);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::MacroDelimiter {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("MacroDelimiter::")?;
+        match self {
+            crate::MacroDelimiter::Paren(v0) => {
+                let mut formatter = formatter.debug_tuple("Paren");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::MacroDelimiter::Brace(v0) => {
+                let mut formatter = formatter.debug_tuple("Brace");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::MacroDelimiter::Bracket(v0) => {
+                let mut formatter = formatter.debug_tuple("Bracket");
+                formatter.field(v0);
+                formatter.finish()
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Member {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Member::")?;
+        match self {
+            crate::Member::Named(v0) => {
+                let mut formatter = formatter.debug_tuple("Named");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::Member::Unnamed(v0) => {
+                let mut formatter = formatter.debug_tuple("Unnamed");
+                formatter.field(v0);
+                formatter.finish()
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Meta {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Meta::")?;
+        match self {
+            crate::Meta::Path(v0) => v0.debug(formatter, "Path"),
+            crate::Meta::List(v0) => v0.debug(formatter, "List"),
+            crate::Meta::NameValue(v0) => v0.debug(formatter, "NameValue"),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::MetaList {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "MetaList")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::MetaList {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("path", &self.path);
+        formatter.field("delimiter", &self.delimiter);
+        formatter.field("tokens", &self.tokens);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::MetaNameValue {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "MetaNameValue")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::MetaNameValue {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("path", &self.path);
+        formatter.field("eq_token", &self.eq_token);
+        formatter.field("value", &self.value);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ParenthesizedGenericArguments {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "ParenthesizedGenericArguments")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::ParenthesizedGenericArguments {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("paren_token", &self.paren_token);
+        formatter.field("inputs", &self.inputs);
+        formatter.field("output", &self.output);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Pat {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Pat::")?;
+        match self {
+            crate::Pat::Const(v0) => v0.debug(formatter, "Const"),
+            crate::Pat::Ident(v0) => v0.debug(formatter, "Ident"),
+            crate::Pat::Lit(v0) => v0.debug(formatter, "Lit"),
+            crate::Pat::Macro(v0) => v0.debug(formatter, "Macro"),
+            crate::Pat::Or(v0) => v0.debug(formatter, "Or"),
+            crate::Pat::Paren(v0) => v0.debug(formatter, "Paren"),
+            crate::Pat::Path(v0) => v0.debug(formatter, "Path"),
+            crate::Pat::Range(v0) => v0.debug(formatter, "Range"),
+            crate::Pat::Reference(v0) => v0.debug(formatter, "Reference"),
+            crate::Pat::Rest(v0) => v0.debug(formatter, "Rest"),
+            crate::Pat::Slice(v0) => v0.debug(formatter, "Slice"),
+            crate::Pat::Struct(v0) => v0.debug(formatter, "Struct"),
+            crate::Pat::Tuple(v0) => v0.debug(formatter, "Tuple"),
+            crate::Pat::TupleStruct(v0) => v0.debug(formatter, "TupleStruct"),
+            crate::Pat::Type(v0) => v0.debug(formatter, "Type"),
+            crate::Pat::Verbatim(v0) => {
+                let mut formatter = formatter.debug_tuple("Verbatim");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::Pat::Wild(v0) => v0.debug(formatter, "Wild"),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::PatIdent {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "PatIdent")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::PatIdent {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("by_ref", &self.by_ref);
+        formatter.field("mutability", &self.mutability);
+        formatter.field("ident", &self.ident);
+        formatter.field("subpat", &self.subpat);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::PatOr {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "PatOr")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::PatOr {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("leading_vert", &self.leading_vert);
+        formatter.field("cases", &self.cases);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::PatParen {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "PatParen")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::PatParen {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("paren_token", &self.paren_token);
+        formatter.field("pat", &self.pat);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::PatReference {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "PatReference")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::PatReference {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("and_token", &self.and_token);
+        formatter.field("mutability", &self.mutability);
+        formatter.field("pat", &self.pat);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::PatRest {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "PatRest")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::PatRest {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("dot2_token", &self.dot2_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::PatSlice {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "PatSlice")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::PatSlice {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("bracket_token", &self.bracket_token);
+        formatter.field("elems", &self.elems);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::PatStruct {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "PatStruct")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::PatStruct {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("qself", &self.qself);
+        formatter.field("path", &self.path);
+        formatter.field("brace_token", &self.brace_token);
+        formatter.field("fields", &self.fields);
+        formatter.field("rest", &self.rest);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::PatTuple {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "PatTuple")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::PatTuple {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("paren_token", &self.paren_token);
+        formatter.field("elems", &self.elems);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::PatTupleStruct {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "PatTupleStruct")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::PatTupleStruct {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("qself", &self.qself);
+        formatter.field("path", &self.path);
+        formatter.field("paren_token", &self.paren_token);
+        formatter.field("elems", &self.elems);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::PatType {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "PatType")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::PatType {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("pat", &self.pat);
+        formatter.field("colon_token", &self.colon_token);
+        formatter.field("ty", &self.ty);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::PatWild {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "PatWild")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::PatWild {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("underscore_token", &self.underscore_token);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Path {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "Path")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::Path {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("leading_colon", &self.leading_colon);
+        formatter.field("segments", &self.segments);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::PathArguments {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("PathArguments::")?;
+        match self {
+            crate::PathArguments::None => formatter.write_str("None"),
+            crate::PathArguments::AngleBracketed(v0) => {
+                v0.debug(formatter, "AngleBracketed")
+            }
+            crate::PathArguments::Parenthesized(v0) => {
+                v0.debug(formatter, "Parenthesized")
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::PathSegment {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("PathSegment");
+        formatter.field("ident", &self.ident);
+        formatter.field("arguments", &self.arguments);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::PredicateLifetime {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("PredicateLifetime");
+        formatter.field("lifetime", &self.lifetime);
+        formatter.field("colon_token", &self.colon_token);
+        formatter.field("bounds", &self.bounds);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::PredicateType {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("PredicateType");
+        formatter.field("lifetimes", &self.lifetimes);
+        formatter.field("bounded_ty", &self.bounded_ty);
+        formatter.field("colon_token", &self.colon_token);
+        formatter.field("bounds", &self.bounds);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::QSelf {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("QSelf");
+        formatter.field("lt_token", &self.lt_token);
+        formatter.field("ty", &self.ty);
+        formatter.field("position", &self.position);
+        formatter.field("as_token", &self.as_token);
+        formatter.field("gt_token", &self.gt_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::RangeLimits {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("RangeLimits::")?;
+        match self {
+            crate::RangeLimits::HalfOpen(v0) => {
+                let mut formatter = formatter.debug_tuple("HalfOpen");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::RangeLimits::Closed(v0) => {
+                let mut formatter = formatter.debug_tuple("Closed");
+                formatter.field(v0);
+                formatter.finish()
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Receiver {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Receiver");
+        formatter.field("attrs", &self.attrs);
+        formatter.field("reference", &self.reference);
+        formatter.field("mutability", &self.mutability);
+        formatter.field("self_token", &self.self_token);
+        formatter.field("colon_token", &self.colon_token);
+        formatter.field("ty", &self.ty);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::ReturnType {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("ReturnType::")?;
+        match self {
+            crate::ReturnType::Default => formatter.write_str("Default"),
+            crate::ReturnType::Type(v0, v1) => {
+                let mut formatter = formatter.debug_tuple("Type");
+                formatter.field(v0);
+                formatter.field(v1);
+                formatter.finish()
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Signature {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Signature");
+        formatter.field("constness", &self.constness);
+        formatter.field("asyncness", &self.asyncness);
+        formatter.field("unsafety", &self.unsafety);
+        formatter.field("abi", &self.abi);
+        formatter.field("fn_token", &self.fn_token);
+        formatter.field("ident", &self.ident);
+        formatter.field("generics", &self.generics);
+        formatter.field("paren_token", &self.paren_token);
+        formatter.field("inputs", &self.inputs);
+        formatter.field("variadic", &self.variadic);
+        formatter.field("output", &self.output);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::StaticMutability {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("StaticMutability::")?;
+        match self {
+            crate::StaticMutability::Mut(v0) => {
+                let mut formatter = formatter.debug_tuple("Mut");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::StaticMutability::None => formatter.write_str("None"),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Stmt {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Stmt::")?;
+        match self {
+            crate::Stmt::Local(v0) => v0.debug(formatter, "Local"),
+            crate::Stmt::Item(v0) => {
+                let mut formatter = formatter.debug_tuple("Item");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::Stmt::Expr(v0, v1) => {
+                let mut formatter = formatter.debug_tuple("Expr");
+                formatter.field(v0);
+                formatter.field(v1);
+                formatter.finish()
+            }
+            crate::Stmt::Macro(v0) => v0.debug(formatter, "Macro"),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::StmtMacro {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "StmtMacro")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::StmtMacro {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("mac", &self.mac);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TraitBound {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TraitBound");
+        formatter.field("paren_token", &self.paren_token);
+        formatter.field("modifier", &self.modifier);
+        formatter.field("lifetimes", &self.lifetimes);
+        formatter.field("path", &self.path);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TraitBoundModifier {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("TraitBoundModifier::")?;
+        match self {
+            crate::TraitBoundModifier::None => formatter.write_str("None"),
+            crate::TraitBoundModifier::Maybe(v0) => {
+                let mut formatter = formatter.debug_tuple("Maybe");
+                formatter.field(v0);
+                formatter.finish()
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TraitItem {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("TraitItem::")?;
+        match self {
+            crate::TraitItem::Const(v0) => v0.debug(formatter, "Const"),
+            crate::TraitItem::Fn(v0) => v0.debug(formatter, "Fn"),
+            crate::TraitItem::Type(v0) => v0.debug(formatter, "Type"),
+            crate::TraitItem::Macro(v0) => v0.debug(formatter, "Macro"),
+            crate::TraitItem::Verbatim(v0) => {
+                let mut formatter = formatter.debug_tuple("Verbatim");
+                formatter.field(v0);
+                formatter.finish()
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TraitItemConst {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "TraitItemConst")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::TraitItemConst {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("const_token", &self.const_token);
+        formatter.field("ident", &self.ident);
+        formatter.field("generics", &self.generics);
+        formatter.field("colon_token", &self.colon_token);
+        formatter.field("ty", &self.ty);
+        formatter.field("default", &self.default);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TraitItemFn {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "TraitItemFn")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::TraitItemFn {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("sig", &self.sig);
+        formatter.field("default", &self.default);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TraitItemMacro {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "TraitItemMacro")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::TraitItemMacro {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("mac", &self.mac);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TraitItemType {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "TraitItemType")
+    }
+}
+#[cfg(feature = "full")]
+impl crate::TraitItemType {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("attrs", &self.attrs);
+        formatter.field("type_token", &self.type_token);
+        formatter.field("ident", &self.ident);
+        formatter.field("generics", &self.generics);
+        formatter.field("colon_token", &self.colon_token);
+        formatter.field("bounds", &self.bounds);
+        formatter.field("default", &self.default);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Type {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Type::")?;
+        match self {
+            crate::Type::Array(v0) => v0.debug(formatter, "Array"),
+            crate::Type::BareFn(v0) => v0.debug(formatter, "BareFn"),
+            crate::Type::Group(v0) => v0.debug(formatter, "Group"),
+            crate::Type::ImplTrait(v0) => v0.debug(formatter, "ImplTrait"),
+            crate::Type::Infer(v0) => v0.debug(formatter, "Infer"),
+            crate::Type::Macro(v0) => v0.debug(formatter, "Macro"),
+            crate::Type::Never(v0) => v0.debug(formatter, "Never"),
+            crate::Type::Paren(v0) => v0.debug(formatter, "Paren"),
+            crate::Type::Path(v0) => v0.debug(formatter, "Path"),
+            crate::Type::Ptr(v0) => v0.debug(formatter, "Ptr"),
+            crate::Type::Reference(v0) => v0.debug(formatter, "Reference"),
+            crate::Type::Slice(v0) => v0.debug(formatter, "Slice"),
+            crate::Type::TraitObject(v0) => v0.debug(formatter, "TraitObject"),
+            crate::Type::Tuple(v0) => v0.debug(formatter, "Tuple"),
+            crate::Type::Verbatim(v0) => {
+                let mut formatter = formatter.debug_tuple("Verbatim");
+                formatter.field(v0);
+                formatter.finish()
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TypeArray {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "TypeArray")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::TypeArray {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("bracket_token", &self.bracket_token);
+        formatter.field("elem", &self.elem);
+        formatter.field("semi_token", &self.semi_token);
+        formatter.field("len", &self.len);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TypeBareFn {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "TypeBareFn")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::TypeBareFn {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("lifetimes", &self.lifetimes);
+        formatter.field("unsafety", &self.unsafety);
+        formatter.field("abi", &self.abi);
+        formatter.field("fn_token", &self.fn_token);
+        formatter.field("paren_token", &self.paren_token);
+        formatter.field("inputs", &self.inputs);
+        formatter.field("variadic", &self.variadic);
+        formatter.field("output", &self.output);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TypeGroup {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "TypeGroup")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::TypeGroup {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("group_token", &self.group_token);
+        formatter.field("elem", &self.elem);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TypeImplTrait {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "TypeImplTrait")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::TypeImplTrait {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("impl_token", &self.impl_token);
+        formatter.field("bounds", &self.bounds);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TypeInfer {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "TypeInfer")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::TypeInfer {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("underscore_token", &self.underscore_token);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TypeMacro {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "TypeMacro")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::TypeMacro {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("mac", &self.mac);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TypeNever {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "TypeNever")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::TypeNever {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("bang_token", &self.bang_token);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TypeParam {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TypeParam");
+        formatter.field("attrs", &self.attrs);
+        formatter.field("ident", &self.ident);
+        formatter.field("colon_token", &self.colon_token);
+        formatter.field("bounds", &self.bounds);
+        formatter.field("eq_token", &self.eq_token);
+        formatter.field("default", &self.default);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TypeParamBound {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("TypeParamBound::")?;
+        match self {
+            crate::TypeParamBound::Trait(v0) => {
+                let mut formatter = formatter.debug_tuple("Trait");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::TypeParamBound::Lifetime(v0) => v0.debug(formatter, "Lifetime"),
+            crate::TypeParamBound::Verbatim(v0) => {
+                let mut formatter = formatter.debug_tuple("Verbatim");
+                formatter.field(v0);
+                formatter.finish()
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TypeParen {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "TypeParen")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::TypeParen {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("paren_token", &self.paren_token);
+        formatter.field("elem", &self.elem);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TypePath {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "TypePath")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::TypePath {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("qself", &self.qself);
+        formatter.field("path", &self.path);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TypePtr {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "TypePtr")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::TypePtr {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("star_token", &self.star_token);
+        formatter.field("const_token", &self.const_token);
+        formatter.field("mutability", &self.mutability);
+        formatter.field("elem", &self.elem);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TypeReference {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "TypeReference")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::TypeReference {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("and_token", &self.and_token);
+        formatter.field("lifetime", &self.lifetime);
+        formatter.field("mutability", &self.mutability);
+        formatter.field("elem", &self.elem);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TypeSlice {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "TypeSlice")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::TypeSlice {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("bracket_token", &self.bracket_token);
+        formatter.field("elem", &self.elem);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TypeTraitObject {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "TypeTraitObject")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::TypeTraitObject {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("dyn_token", &self.dyn_token);
+        formatter.field("bounds", &self.bounds);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::TypeTuple {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "TypeTuple")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::TypeTuple {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("paren_token", &self.paren_token);
+        formatter.field("elems", &self.elems);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::UnOp {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("UnOp::")?;
+        match self {
+            crate::UnOp::Deref(v0) => {
+                let mut formatter = formatter.debug_tuple("Deref");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::UnOp::Not(v0) => {
+                let mut formatter = formatter.debug_tuple("Not");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::UnOp::Neg(v0) => {
+                let mut formatter = formatter.debug_tuple("Neg");
+                formatter.field(v0);
+                formatter.finish()
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::UseGlob {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("UseGlob");
+        formatter.field("star_token", &self.star_token);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::UseGroup {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("UseGroup");
+        formatter.field("brace_token", &self.brace_token);
+        formatter.field("items", &self.items);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::UseName {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("UseName");
+        formatter.field("ident", &self.ident);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::UsePath {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("UsePath");
+        formatter.field("ident", &self.ident);
+        formatter.field("colon2_token", &self.colon2_token);
+        formatter.field("tree", &self.tree);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::UseRename {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("UseRename");
+        formatter.field("ident", &self.ident);
+        formatter.field("as_token", &self.as_token);
+        formatter.field("rename", &self.rename);
+        formatter.finish()
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::UseTree {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("UseTree::")?;
+        match self {
+            crate::UseTree::Path(v0) => {
+                let mut formatter = formatter.debug_tuple("Path");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::UseTree::Name(v0) => {
+                let mut formatter = formatter.debug_tuple("Name");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::UseTree::Rename(v0) => {
+                let mut formatter = formatter.debug_tuple("Rename");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::UseTree::Glob(v0) => {
+                let mut formatter = formatter.debug_tuple("Glob");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::UseTree::Group(v0) => {
+                let mut formatter = formatter.debug_tuple("Group");
+                formatter.field(v0);
+                formatter.finish()
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Variadic {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Variadic");
+        formatter.field("attrs", &self.attrs);
+        formatter.field("pat", &self.pat);
+        formatter.field("dots", &self.dots);
+        formatter.field("comma", &self.comma);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Variant {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Variant");
+        formatter.field("attrs", &self.attrs);
+        formatter.field("ident", &self.ident);
+        formatter.field("fields", &self.fields);
+        formatter.field("discriminant", &self.discriminant);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::VisRestricted {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.debug(formatter, "VisRestricted")
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+impl crate::VisRestricted {
+    fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+        let mut formatter = formatter.debug_struct(name);
+        formatter.field("pub_token", &self.pub_token);
+        formatter.field("paren_token", &self.paren_token);
+        formatter.field("in_token", &self.in_token);
+        formatter.field("path", &self.path);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::Visibility {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Visibility::")?;
+        match self {
+            crate::Visibility::Public(v0) => {
+                let mut formatter = formatter.debug_tuple("Public");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::Visibility::Restricted(v0) => v0.debug(formatter, "Restricted"),
+            crate::Visibility::Inherited => formatter.write_str("Inherited"),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::WhereClause {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("WhereClause");
+        formatter.field("where_token", &self.where_token);
+        formatter.field("predicates", &self.predicates);
+        formatter.finish()
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for crate::WherePredicate {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("WherePredicate::")?;
+        match self {
+            crate::WherePredicate::Lifetime(v0) => {
+                let mut formatter = formatter.debug_tuple("Lifetime");
+                formatter.field(v0);
+                formatter.finish()
+            }
+            crate::WherePredicate::Type(v0) => {
+                let mut formatter = formatter.debug_tuple("Type");
+                formatter.field(v0);
+                formatter.finish()
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/gen/eq.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/gen/eq.rs
--- 43.0.0-1/rust-vendor/syn/src/gen/eq.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/gen/eq.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,2242 @@
+// This file is @generated by syn-internal-codegen.
+// It is not intended for manual editing.
+
+#[cfg(any(feature = "derive", feature = "full"))]
+use crate::tt::TokenStreamHelper;
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Abi {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Abi {
+    fn eq(&self, other: &Self) -> bool {
+        self.name == other.name
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::AngleBracketedGenericArguments {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::AngleBracketedGenericArguments {
+    fn eq(&self, other: &Self) -> bool {
+        self.colon2_token == other.colon2_token && self.args == other.args
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Arm {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Arm {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.pat == other.pat && self.guard == other.guard
+            && self.body == other.body && self.comma == other.comma
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::AssocConst {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::AssocConst {
+    fn eq(&self, other: &Self) -> bool {
+        self.ident == other.ident && self.generics == other.generics
+            && self.value == other.value
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::AssocType {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::AssocType {
+    fn eq(&self, other: &Self) -> bool {
+        self.ident == other.ident && self.generics == other.generics
+            && self.ty == other.ty
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::AttrStyle {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::AttrStyle {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::AttrStyle::Outer, crate::AttrStyle::Outer) => true,
+            (crate::AttrStyle::Inner(_), crate::AttrStyle::Inner(_)) => true,
+            _ => false,
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Attribute {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Attribute {
+    fn eq(&self, other: &Self) -> bool {
+        self.style == other.style && self.meta == other.meta
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::BareFnArg {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::BareFnArg {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.name == other.name && self.ty == other.ty
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::BareVariadic {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::BareVariadic {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.name == other.name && self.comma == other.comma
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::BinOp {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::BinOp {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::BinOp::Add(_), crate::BinOp::Add(_)) => true,
+            (crate::BinOp::Sub(_), crate::BinOp::Sub(_)) => true,
+            (crate::BinOp::Mul(_), crate::BinOp::Mul(_)) => true,
+            (crate::BinOp::Div(_), crate::BinOp::Div(_)) => true,
+            (crate::BinOp::Rem(_), crate::BinOp::Rem(_)) => true,
+            (crate::BinOp::And(_), crate::BinOp::And(_)) => true,
+            (crate::BinOp::Or(_), crate::BinOp::Or(_)) => true,
+            (crate::BinOp::BitXor(_), crate::BinOp::BitXor(_)) => true,
+            (crate::BinOp::BitAnd(_), crate::BinOp::BitAnd(_)) => true,
+            (crate::BinOp::BitOr(_), crate::BinOp::BitOr(_)) => true,
+            (crate::BinOp::Shl(_), crate::BinOp::Shl(_)) => true,
+            (crate::BinOp::Shr(_), crate::BinOp::Shr(_)) => true,
+            (crate::BinOp::Eq(_), crate::BinOp::Eq(_)) => true,
+            (crate::BinOp::Lt(_), crate::BinOp::Lt(_)) => true,
+            (crate::BinOp::Le(_), crate::BinOp::Le(_)) => true,
+            (crate::BinOp::Ne(_), crate::BinOp::Ne(_)) => true,
+            (crate::BinOp::Ge(_), crate::BinOp::Ge(_)) => true,
+            (crate::BinOp::Gt(_), crate::BinOp::Gt(_)) => true,
+            (crate::BinOp::AddAssign(_), crate::BinOp::AddAssign(_)) => true,
+            (crate::BinOp::SubAssign(_), crate::BinOp::SubAssign(_)) => true,
+            (crate::BinOp::MulAssign(_), crate::BinOp::MulAssign(_)) => true,
+            (crate::BinOp::DivAssign(_), crate::BinOp::DivAssign(_)) => true,
+            (crate::BinOp::RemAssign(_), crate::BinOp::RemAssign(_)) => true,
+            (crate::BinOp::BitXorAssign(_), crate::BinOp::BitXorAssign(_)) => true,
+            (crate::BinOp::BitAndAssign(_), crate::BinOp::BitAndAssign(_)) => true,
+            (crate::BinOp::BitOrAssign(_), crate::BinOp::BitOrAssign(_)) => true,
+            (crate::BinOp::ShlAssign(_), crate::BinOp::ShlAssign(_)) => true,
+            (crate::BinOp::ShrAssign(_), crate::BinOp::ShrAssign(_)) => true,
+            _ => false,
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Block {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Block {
+    fn eq(&self, other: &Self) -> bool {
+        self.stmts == other.stmts
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::BoundLifetimes {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::BoundLifetimes {
+    fn eq(&self, other: &Self) -> bool {
+        self.lifetimes == other.lifetimes
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ConstParam {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ConstParam {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.ident == other.ident && self.ty == other.ty
+            && self.eq_token == other.eq_token && self.default == other.default
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Constraint {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Constraint {
+    fn eq(&self, other: &Self) -> bool {
+        self.ident == other.ident && self.generics == other.generics
+            && self.bounds == other.bounds
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Data {}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Data {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::Data::Struct(self0), crate::Data::Struct(other0)) => self0 == other0,
+            (crate::Data::Enum(self0), crate::Data::Enum(other0)) => self0 == other0,
+            (crate::Data::Union(self0), crate::Data::Union(other0)) => self0 == other0,
+            _ => false,
+        }
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::DataEnum {}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::DataEnum {
+    fn eq(&self, other: &Self) -> bool {
+        self.variants == other.variants
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::DataStruct {}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::DataStruct {
+    fn eq(&self, other: &Self) -> bool {
+        self.fields == other.fields && self.semi_token == other.semi_token
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::DataUnion {}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::DataUnion {
+    fn eq(&self, other: &Self) -> bool {
+        self.fields == other.fields
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::DeriveInput {}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::DeriveInput {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.vis == other.vis && self.ident == other.ident
+            && self.generics == other.generics && self.data == other.data
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Expr {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Expr {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            #[cfg(feature = "full")]
+            (crate::Expr::Array(self0), crate::Expr::Array(other0)) => self0 == other0,
+            #[cfg(feature = "full")]
+            (crate::Expr::Assign(self0), crate::Expr::Assign(other0)) => self0 == other0,
+            #[cfg(feature = "full")]
+            (crate::Expr::Async(self0), crate::Expr::Async(other0)) => self0 == other0,
+            #[cfg(feature = "full")]
+            (crate::Expr::Await(self0), crate::Expr::Await(other0)) => self0 == other0,
+            (crate::Expr::Binary(self0), crate::Expr::Binary(other0)) => self0 == other0,
+            #[cfg(feature = "full")]
+            (crate::Expr::Block(self0), crate::Expr::Block(other0)) => self0 == other0,
+            #[cfg(feature = "full")]
+            (crate::Expr::Break(self0), crate::Expr::Break(other0)) => self0 == other0,
+            (crate::Expr::Call(self0), crate::Expr::Call(other0)) => self0 == other0,
+            (crate::Expr::Cast(self0), crate::Expr::Cast(other0)) => self0 == other0,
+            #[cfg(feature = "full")]
+            (crate::Expr::Closure(self0), crate::Expr::Closure(other0)) => {
+                self0 == other0
+            }
+            #[cfg(feature = "full")]
+            (crate::Expr::Const(self0), crate::Expr::Const(other0)) => self0 == other0,
+            #[cfg(feature = "full")]
+            (crate::Expr::Continue(self0), crate::Expr::Continue(other0)) => {
+                self0 == other0
+            }
+            (crate::Expr::Field(self0), crate::Expr::Field(other0)) => self0 == other0,
+            #[cfg(feature = "full")]
+            (crate::Expr::ForLoop(self0), crate::Expr::ForLoop(other0)) => {
+                self0 == other0
+            }
+            (crate::Expr::Group(self0), crate::Expr::Group(other0)) => self0 == other0,
+            #[cfg(feature = "full")]
+            (crate::Expr::If(self0), crate::Expr::If(other0)) => self0 == other0,
+            (crate::Expr::Index(self0), crate::Expr::Index(other0)) => self0 == other0,
+            #[cfg(feature = "full")]
+            (crate::Expr::Infer(self0), crate::Expr::Infer(other0)) => self0 == other0,
+            #[cfg(feature = "full")]
+            (crate::Expr::Let(self0), crate::Expr::Let(other0)) => self0 == other0,
+            (crate::Expr::Lit(self0), crate::Expr::Lit(other0)) => self0 == other0,
+            #[cfg(feature = "full")]
+            (crate::Expr::Loop(self0), crate::Expr::Loop(other0)) => self0 == other0,
+            (crate::Expr::Macro(self0), crate::Expr::Macro(other0)) => self0 == other0,
+            #[cfg(feature = "full")]
+            (crate::Expr::Match(self0), crate::Expr::Match(other0)) => self0 == other0,
+            (crate::Expr::MethodCall(self0), crate::Expr::MethodCall(other0)) => {
+                self0 == other0
+            }
+            (crate::Expr::Paren(self0), crate::Expr::Paren(other0)) => self0 == other0,
+            (crate::Expr::Path(self0), crate::Expr::Path(other0)) => self0 == other0,
+            #[cfg(feature = "full")]
+            (crate::Expr::Range(self0), crate::Expr::Range(other0)) => self0 == other0,
+            (crate::Expr::Reference(self0), crate::Expr::Reference(other0)) => {
+                self0 == other0
+            }
+            #[cfg(feature = "full")]
+            (crate::Expr::Repeat(self0), crate::Expr::Repeat(other0)) => self0 == other0,
+            #[cfg(feature = "full")]
+            (crate::Expr::Return(self0), crate::Expr::Return(other0)) => self0 == other0,
+            (crate::Expr::Struct(self0), crate::Expr::Struct(other0)) => self0 == other0,
+            #[cfg(feature = "full")]
+            (crate::Expr::Try(self0), crate::Expr::Try(other0)) => self0 == other0,
+            #[cfg(feature = "full")]
+            (crate::Expr::TryBlock(self0), crate::Expr::TryBlock(other0)) => {
+                self0 == other0
+            }
+            #[cfg(feature = "full")]
+            (crate::Expr::Tuple(self0), crate::Expr::Tuple(other0)) => self0 == other0,
+            (crate::Expr::Unary(self0), crate::Expr::Unary(other0)) => self0 == other0,
+            #[cfg(feature = "full")]
+            (crate::Expr::Unsafe(self0), crate::Expr::Unsafe(other0)) => self0 == other0,
+            (crate::Expr::Verbatim(self0), crate::Expr::Verbatim(other0)) => {
+                TokenStreamHelper(self0) == TokenStreamHelper(other0)
+            }
+            #[cfg(feature = "full")]
+            (crate::Expr::While(self0), crate::Expr::While(other0)) => self0 == other0,
+            #[cfg(feature = "full")]
+            (crate::Expr::Yield(self0), crate::Expr::Yield(other0)) => self0 == other0,
+            _ => false,
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprArray {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprArray {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.elems == other.elems
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprAssign {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprAssign {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.left == other.left && self.right == other.right
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprAsync {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprAsync {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.capture == other.capture
+            && self.block == other.block
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprAwait {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprAwait {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.base == other.base
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprBinary {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprBinary {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.left == other.left && self.op == other.op
+            && self.right == other.right
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprBlock {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprBlock {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.label == other.label
+            && self.block == other.block
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprBreak {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprBreak {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.label == other.label && self.expr == other.expr
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprCall {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprCall {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.func == other.func && self.args == other.args
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprCast {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprCast {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.expr == other.expr && self.ty == other.ty
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprClosure {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprClosure {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.lifetimes == other.lifetimes
+            && self.constness == other.constness && self.movability == other.movability
+            && self.asyncness == other.asyncness && self.capture == other.capture
+            && self.inputs == other.inputs && self.output == other.output
+            && self.body == other.body
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprConst {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprConst {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.block == other.block
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprContinue {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprContinue {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.label == other.label
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprField {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprField {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.base == other.base
+            && self.member == other.member
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprForLoop {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprForLoop {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.label == other.label && self.pat == other.pat
+            && self.expr == other.expr && self.body == other.body
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprGroup {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprGroup {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.expr == other.expr
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprIf {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprIf {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.cond == other.cond
+            && self.then_branch == other.then_branch
+            && self.else_branch == other.else_branch
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprIndex {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprIndex {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.expr == other.expr && self.index == other.index
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprInfer {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprInfer {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprLet {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprLet {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.pat == other.pat && self.expr == other.expr
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprLit {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprLit {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.lit == other.lit
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprLoop {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprLoop {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.label == other.label && self.body == other.body
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprMacro {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprMacro {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.mac == other.mac
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprMatch {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprMatch {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.expr == other.expr && self.arms == other.arms
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprMethodCall {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprMethodCall {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.receiver == other.receiver
+            && self.method == other.method && self.turbofish == other.turbofish
+            && self.args == other.args
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprParen {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprParen {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.expr == other.expr
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprPath {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprPath {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.qself == other.qself && self.path == other.path
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprRange {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprRange {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.start == other.start
+            && self.limits == other.limits && self.end == other.end
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprReference {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprReference {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.mutability == other.mutability
+            && self.expr == other.expr
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprRepeat {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprRepeat {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.expr == other.expr && self.len == other.len
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprReturn {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprReturn {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.expr == other.expr
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprStruct {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprStruct {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.qself == other.qself && self.path == other.path
+            && self.fields == other.fields && self.dot2_token == other.dot2_token
+            && self.rest == other.rest
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprTry {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprTry {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.expr == other.expr
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprTryBlock {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprTryBlock {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.block == other.block
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprTuple {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprTuple {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.elems == other.elems
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprUnary {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprUnary {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.op == other.op && self.expr == other.expr
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprUnsafe {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprUnsafe {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.block == other.block
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprWhile {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprWhile {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.label == other.label && self.cond == other.cond
+            && self.body == other.body
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ExprYield {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ExprYield {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.expr == other.expr
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Field {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Field {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.vis == other.vis
+            && self.mutability == other.mutability && self.ident == other.ident
+            && self.colon_token == other.colon_token && self.ty == other.ty
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::FieldMutability {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::FieldMutability {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::FieldMutability::None, crate::FieldMutability::None) => true,
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::FieldPat {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::FieldPat {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.member == other.member
+            && self.colon_token == other.colon_token && self.pat == other.pat
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::FieldValue {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::FieldValue {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.member == other.member
+            && self.colon_token == other.colon_token && self.expr == other.expr
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Fields {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Fields {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::Fields::Named(self0), crate::Fields::Named(other0)) => {
+                self0 == other0
+            }
+            (crate::Fields::Unnamed(self0), crate::Fields::Unnamed(other0)) => {
+                self0 == other0
+            }
+            (crate::Fields::Unit, crate::Fields::Unit) => true,
+            _ => false,
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::FieldsNamed {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::FieldsNamed {
+    fn eq(&self, other: &Self) -> bool {
+        self.named == other.named
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::FieldsUnnamed {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::FieldsUnnamed {
+    fn eq(&self, other: &Self) -> bool {
+        self.unnamed == other.unnamed
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::File {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::File {
+    fn eq(&self, other: &Self) -> bool {
+        self.shebang == other.shebang && self.attrs == other.attrs
+            && self.items == other.items
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::FnArg {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::FnArg {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::FnArg::Receiver(self0), crate::FnArg::Receiver(other0)) => {
+                self0 == other0
+            }
+            (crate::FnArg::Typed(self0), crate::FnArg::Typed(other0)) => self0 == other0,
+            _ => false,
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ForeignItem {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ForeignItem {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::ForeignItem::Fn(self0), crate::ForeignItem::Fn(other0)) => {
+                self0 == other0
+            }
+            (crate::ForeignItem::Static(self0), crate::ForeignItem::Static(other0)) => {
+                self0 == other0
+            }
+            (crate::ForeignItem::Type(self0), crate::ForeignItem::Type(other0)) => {
+                self0 == other0
+            }
+            (crate::ForeignItem::Macro(self0), crate::ForeignItem::Macro(other0)) => {
+                self0 == other0
+            }
+            (
+                crate::ForeignItem::Verbatim(self0),
+                crate::ForeignItem::Verbatim(other0),
+            ) => TokenStreamHelper(self0) == TokenStreamHelper(other0),
+            _ => false,
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ForeignItemFn {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ForeignItemFn {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.vis == other.vis && self.sig == other.sig
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ForeignItemMacro {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ForeignItemMacro {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.mac == other.mac
+            && self.semi_token == other.semi_token
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ForeignItemStatic {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ForeignItemStatic {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.vis == other.vis
+            && self.mutability == other.mutability && self.ident == other.ident
+            && self.ty == other.ty
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ForeignItemType {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ForeignItemType {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.vis == other.vis && self.ident == other.ident
+            && self.generics == other.generics
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::GenericArgument {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::GenericArgument {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (
+                crate::GenericArgument::Lifetime(self0),
+                crate::GenericArgument::Lifetime(other0),
+            ) => self0 == other0,
+            (
+                crate::GenericArgument::Type(self0),
+                crate::GenericArgument::Type(other0),
+            ) => self0 == other0,
+            (
+                crate::GenericArgument::Const(self0),
+                crate::GenericArgument::Const(other0),
+            ) => self0 == other0,
+            (
+                crate::GenericArgument::AssocType(self0),
+                crate::GenericArgument::AssocType(other0),
+            ) => self0 == other0,
+            (
+                crate::GenericArgument::AssocConst(self0),
+                crate::GenericArgument::AssocConst(other0),
+            ) => self0 == other0,
+            (
+                crate::GenericArgument::Constraint(self0),
+                crate::GenericArgument::Constraint(other0),
+            ) => self0 == other0,
+            _ => false,
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::GenericParam {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::GenericParam {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (
+                crate::GenericParam::Lifetime(self0),
+                crate::GenericParam::Lifetime(other0),
+            ) => self0 == other0,
+            (crate::GenericParam::Type(self0), crate::GenericParam::Type(other0)) => {
+                self0 == other0
+            }
+            (crate::GenericParam::Const(self0), crate::GenericParam::Const(other0)) => {
+                self0 == other0
+            }
+            _ => false,
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Generics {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Generics {
+    fn eq(&self, other: &Self) -> bool {
+        self.lt_token == other.lt_token && self.params == other.params
+            && self.gt_token == other.gt_token && self.where_clause == other.where_clause
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ImplItem {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ImplItem {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::ImplItem::Const(self0), crate::ImplItem::Const(other0)) => {
+                self0 == other0
+            }
+            (crate::ImplItem::Fn(self0), crate::ImplItem::Fn(other0)) => self0 == other0,
+            (crate::ImplItem::Type(self0), crate::ImplItem::Type(other0)) => {
+                self0 == other0
+            }
+            (crate::ImplItem::Macro(self0), crate::ImplItem::Macro(other0)) => {
+                self0 == other0
+            }
+            (crate::ImplItem::Verbatim(self0), crate::ImplItem::Verbatim(other0)) => {
+                TokenStreamHelper(self0) == TokenStreamHelper(other0)
+            }
+            _ => false,
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ImplItemConst {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ImplItemConst {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.vis == other.vis
+            && self.defaultness == other.defaultness && self.ident == other.ident
+            && self.generics == other.generics && self.ty == other.ty
+            && self.expr == other.expr
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ImplItemFn {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ImplItemFn {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.vis == other.vis
+            && self.defaultness == other.defaultness && self.sig == other.sig
+            && self.block == other.block
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ImplItemMacro {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ImplItemMacro {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.mac == other.mac
+            && self.semi_token == other.semi_token
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ImplItemType {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ImplItemType {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.vis == other.vis
+            && self.defaultness == other.defaultness && self.ident == other.ident
+            && self.generics == other.generics && self.ty == other.ty
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ImplRestriction {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ImplRestriction {
+    fn eq(&self, _other: &Self) -> bool {
+        match *self {}
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Item {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Item {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::Item::Const(self0), crate::Item::Const(other0)) => self0 == other0,
+            (crate::Item::Enum(self0), crate::Item::Enum(other0)) => self0 == other0,
+            (crate::Item::ExternCrate(self0), crate::Item::ExternCrate(other0)) => {
+                self0 == other0
+            }
+            (crate::Item::Fn(self0), crate::Item::Fn(other0)) => self0 == other0,
+            (crate::Item::ForeignMod(self0), crate::Item::ForeignMod(other0)) => {
+                self0 == other0
+            }
+            (crate::Item::Impl(self0), crate::Item::Impl(other0)) => self0 == other0,
+            (crate::Item::Macro(self0), crate::Item::Macro(other0)) => self0 == other0,
+            (crate::Item::Mod(self0), crate::Item::Mod(other0)) => self0 == other0,
+            (crate::Item::Static(self0), crate::Item::Static(other0)) => self0 == other0,
+            (crate::Item::Struct(self0), crate::Item::Struct(other0)) => self0 == other0,
+            (crate::Item::Trait(self0), crate::Item::Trait(other0)) => self0 == other0,
+            (crate::Item::TraitAlias(self0), crate::Item::TraitAlias(other0)) => {
+                self0 == other0
+            }
+            (crate::Item::Type(self0), crate::Item::Type(other0)) => self0 == other0,
+            (crate::Item::Union(self0), crate::Item::Union(other0)) => self0 == other0,
+            (crate::Item::Use(self0), crate::Item::Use(other0)) => self0 == other0,
+            (crate::Item::Verbatim(self0), crate::Item::Verbatim(other0)) => {
+                TokenStreamHelper(self0) == TokenStreamHelper(other0)
+            }
+            _ => false,
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ItemConst {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ItemConst {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.vis == other.vis && self.ident == other.ident
+            && self.generics == other.generics && self.ty == other.ty
+            && self.expr == other.expr
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ItemEnum {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ItemEnum {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.vis == other.vis && self.ident == other.ident
+            && self.generics == other.generics && self.variants == other.variants
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ItemExternCrate {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ItemExternCrate {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.vis == other.vis && self.ident == other.ident
+            && self.rename == other.rename
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ItemFn {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ItemFn {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.vis == other.vis && self.sig == other.sig
+            && self.block == other.block
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ItemForeignMod {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ItemForeignMod {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.unsafety == other.unsafety
+            && self.abi == other.abi && self.items == other.items
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ItemImpl {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ItemImpl {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.defaultness == other.defaultness
+            && self.unsafety == other.unsafety && self.generics == other.generics
+            && self.trait_ == other.trait_ && self.self_ty == other.self_ty
+            && self.items == other.items
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ItemMacro {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ItemMacro {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.ident == other.ident && self.mac == other.mac
+            && self.semi_token == other.semi_token
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ItemMod {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ItemMod {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.vis == other.vis
+            && self.unsafety == other.unsafety && self.ident == other.ident
+            && self.content == other.content && self.semi == other.semi
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ItemStatic {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ItemStatic {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.vis == other.vis
+            && self.mutability == other.mutability && self.ident == other.ident
+            && self.ty == other.ty && self.expr == other.expr
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ItemStruct {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ItemStruct {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.vis == other.vis && self.ident == other.ident
+            && self.generics == other.generics && self.fields == other.fields
+            && self.semi_token == other.semi_token
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ItemTrait {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ItemTrait {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.vis == other.vis
+            && self.unsafety == other.unsafety && self.auto_token == other.auto_token
+            && self.restriction == other.restriction && self.ident == other.ident
+            && self.generics == other.generics && self.colon_token == other.colon_token
+            && self.supertraits == other.supertraits && self.items == other.items
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ItemTraitAlias {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ItemTraitAlias {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.vis == other.vis && self.ident == other.ident
+            && self.generics == other.generics && self.bounds == other.bounds
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ItemType {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ItemType {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.vis == other.vis && self.ident == other.ident
+            && self.generics == other.generics && self.ty == other.ty
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ItemUnion {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ItemUnion {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.vis == other.vis && self.ident == other.ident
+            && self.generics == other.generics && self.fields == other.fields
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ItemUse {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ItemUse {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.vis == other.vis
+            && self.leading_colon == other.leading_colon && self.tree == other.tree
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Label {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Label {
+    fn eq(&self, other: &Self) -> bool {
+        self.name == other.name
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::LifetimeParam {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::LifetimeParam {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.lifetime == other.lifetime
+            && self.colon_token == other.colon_token && self.bounds == other.bounds
+    }
+}
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Lit {}
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Lit {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::Lit::Str(self0), crate::Lit::Str(other0)) => self0 == other0,
+            (crate::Lit::ByteStr(self0), crate::Lit::ByteStr(other0)) => self0 == other0,
+            (crate::Lit::CStr(self0), crate::Lit::CStr(other0)) => self0 == other0,
+            (crate::Lit::Byte(self0), crate::Lit::Byte(other0)) => self0 == other0,
+            (crate::Lit::Char(self0), crate::Lit::Char(other0)) => self0 == other0,
+            (crate::Lit::Int(self0), crate::Lit::Int(other0)) => self0 == other0,
+            (crate::Lit::Float(self0), crate::Lit::Float(other0)) => self0 == other0,
+            (crate::Lit::Bool(self0), crate::Lit::Bool(other0)) => self0 == other0,
+            (crate::Lit::Verbatim(self0), crate::Lit::Verbatim(other0)) => {
+                self0.to_string() == other0.to_string()
+            }
+            _ => false,
+        }
+    }
+}
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::LitBool {}
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::LitBool {
+    fn eq(&self, other: &Self) -> bool {
+        self.value == other.value
+    }
+}
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::LitByte {}
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::LitByteStr {}
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::LitCStr {}
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::LitChar {}
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::LitFloat {}
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::LitInt {}
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::LitStr {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Local {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Local {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.pat == other.pat && self.init == other.init
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::LocalInit {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::LocalInit {
+    fn eq(&self, other: &Self) -> bool {
+        self.expr == other.expr && self.diverge == other.diverge
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Macro {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Macro {
+    fn eq(&self, other: &Self) -> bool {
+        self.path == other.path && self.delimiter == other.delimiter
+            && TokenStreamHelper(&self.tokens) == TokenStreamHelper(&other.tokens)
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::MacroDelimiter {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::MacroDelimiter {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::MacroDelimiter::Paren(_), crate::MacroDelimiter::Paren(_)) => true,
+            (crate::MacroDelimiter::Brace(_), crate::MacroDelimiter::Brace(_)) => true,
+            (crate::MacroDelimiter::Bracket(_), crate::MacroDelimiter::Bracket(_)) => {
+                true
+            }
+            _ => false,
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Meta {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Meta {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::Meta::Path(self0), crate::Meta::Path(other0)) => self0 == other0,
+            (crate::Meta::List(self0), crate::Meta::List(other0)) => self0 == other0,
+            (crate::Meta::NameValue(self0), crate::Meta::NameValue(other0)) => {
+                self0 == other0
+            }
+            _ => false,
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::MetaList {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::MetaList {
+    fn eq(&self, other: &Self) -> bool {
+        self.path == other.path && self.delimiter == other.delimiter
+            && TokenStreamHelper(&self.tokens) == TokenStreamHelper(&other.tokens)
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::MetaNameValue {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::MetaNameValue {
+    fn eq(&self, other: &Self) -> bool {
+        self.path == other.path && self.value == other.value
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ParenthesizedGenericArguments {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ParenthesizedGenericArguments {
+    fn eq(&self, other: &Self) -> bool {
+        self.inputs == other.inputs && self.output == other.output
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Pat {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Pat {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::Pat::Const(self0), crate::Pat::Const(other0)) => self0 == other0,
+            (crate::Pat::Ident(self0), crate::Pat::Ident(other0)) => self0 == other0,
+            (crate::Pat::Lit(self0), crate::Pat::Lit(other0)) => self0 == other0,
+            (crate::Pat::Macro(self0), crate::Pat::Macro(other0)) => self0 == other0,
+            (crate::Pat::Or(self0), crate::Pat::Or(other0)) => self0 == other0,
+            (crate::Pat::Paren(self0), crate::Pat::Paren(other0)) => self0 == other0,
+            (crate::Pat::Path(self0), crate::Pat::Path(other0)) => self0 == other0,
+            (crate::Pat::Range(self0), crate::Pat::Range(other0)) => self0 == other0,
+            (crate::Pat::Reference(self0), crate::Pat::Reference(other0)) => {
+                self0 == other0
+            }
+            (crate::Pat::Rest(self0), crate::Pat::Rest(other0)) => self0 == other0,
+            (crate::Pat::Slice(self0), crate::Pat::Slice(other0)) => self0 == other0,
+            (crate::Pat::Struct(self0), crate::Pat::Struct(other0)) => self0 == other0,
+            (crate::Pat::Tuple(self0), crate::Pat::Tuple(other0)) => self0 == other0,
+            (crate::Pat::TupleStruct(self0), crate::Pat::TupleStruct(other0)) => {
+                self0 == other0
+            }
+            (crate::Pat::Type(self0), crate::Pat::Type(other0)) => self0 == other0,
+            (crate::Pat::Verbatim(self0), crate::Pat::Verbatim(other0)) => {
+                TokenStreamHelper(self0) == TokenStreamHelper(other0)
+            }
+            (crate::Pat::Wild(self0), crate::Pat::Wild(other0)) => self0 == other0,
+            _ => false,
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::PatIdent {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::PatIdent {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.by_ref == other.by_ref
+            && self.mutability == other.mutability && self.ident == other.ident
+            && self.subpat == other.subpat
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::PatOr {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::PatOr {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.leading_vert == other.leading_vert
+            && self.cases == other.cases
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::PatParen {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::PatParen {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.pat == other.pat
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::PatReference {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::PatReference {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.mutability == other.mutability
+            && self.pat == other.pat
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::PatRest {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::PatRest {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::PatSlice {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::PatSlice {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.elems == other.elems
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::PatStruct {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::PatStruct {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.qself == other.qself && self.path == other.path
+            && self.fields == other.fields && self.rest == other.rest
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::PatTuple {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::PatTuple {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.elems == other.elems
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::PatTupleStruct {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::PatTupleStruct {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.qself == other.qself && self.path == other.path
+            && self.elems == other.elems
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::PatType {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::PatType {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.pat == other.pat && self.ty == other.ty
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::PatWild {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::PatWild {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Path {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Path {
+    fn eq(&self, other: &Self) -> bool {
+        self.leading_colon == other.leading_colon && self.segments == other.segments
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::PathArguments {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::PathArguments {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::PathArguments::None, crate::PathArguments::None) => true,
+            (
+                crate::PathArguments::AngleBracketed(self0),
+                crate::PathArguments::AngleBracketed(other0),
+            ) => self0 == other0,
+            (
+                crate::PathArguments::Parenthesized(self0),
+                crate::PathArguments::Parenthesized(other0),
+            ) => self0 == other0,
+            _ => false,
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::PathSegment {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::PathSegment {
+    fn eq(&self, other: &Self) -> bool {
+        self.ident == other.ident && self.arguments == other.arguments
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::PredicateLifetime {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::PredicateLifetime {
+    fn eq(&self, other: &Self) -> bool {
+        self.lifetime == other.lifetime && self.bounds == other.bounds
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::PredicateType {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::PredicateType {
+    fn eq(&self, other: &Self) -> bool {
+        self.lifetimes == other.lifetimes && self.bounded_ty == other.bounded_ty
+            && self.bounds == other.bounds
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::QSelf {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::QSelf {
+    fn eq(&self, other: &Self) -> bool {
+        self.ty == other.ty && self.position == other.position
+            && self.as_token == other.as_token
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::RangeLimits {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::RangeLimits {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::RangeLimits::HalfOpen(_), crate::RangeLimits::HalfOpen(_)) => true,
+            (crate::RangeLimits::Closed(_), crate::RangeLimits::Closed(_)) => true,
+            _ => false,
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Receiver {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Receiver {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.reference == other.reference
+            && self.mutability == other.mutability
+            && self.colon_token == other.colon_token && self.ty == other.ty
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::ReturnType {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::ReturnType {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::ReturnType::Default, crate::ReturnType::Default) => true,
+            (crate::ReturnType::Type(_, self1), crate::ReturnType::Type(_, other1)) => {
+                self1 == other1
+            }
+            _ => false,
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Signature {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Signature {
+    fn eq(&self, other: &Self) -> bool {
+        self.constness == other.constness && self.asyncness == other.asyncness
+            && self.unsafety == other.unsafety && self.abi == other.abi
+            && self.ident == other.ident && self.generics == other.generics
+            && self.inputs == other.inputs && self.variadic == other.variadic
+            && self.output == other.output
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::StaticMutability {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::StaticMutability {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::StaticMutability::Mut(_), crate::StaticMutability::Mut(_)) => true,
+            (crate::StaticMutability::None, crate::StaticMutability::None) => true,
+            _ => false,
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Stmt {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Stmt {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::Stmt::Local(self0), crate::Stmt::Local(other0)) => self0 == other0,
+            (crate::Stmt::Item(self0), crate::Stmt::Item(other0)) => self0 == other0,
+            (crate::Stmt::Expr(self0, self1), crate::Stmt::Expr(other0, other1)) => {
+                self0 == other0 && self1 == other1
+            }
+            (crate::Stmt::Macro(self0), crate::Stmt::Macro(other0)) => self0 == other0,
+            _ => false,
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::StmtMacro {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::StmtMacro {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.mac == other.mac
+            && self.semi_token == other.semi_token
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TraitBound {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TraitBound {
+    fn eq(&self, other: &Self) -> bool {
+        self.paren_token == other.paren_token && self.modifier == other.modifier
+            && self.lifetimes == other.lifetimes && self.path == other.path
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TraitBoundModifier {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TraitBoundModifier {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::TraitBoundModifier::None, crate::TraitBoundModifier::None) => true,
+            (
+                crate::TraitBoundModifier::Maybe(_),
+                crate::TraitBoundModifier::Maybe(_),
+            ) => true,
+            _ => false,
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TraitItem {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TraitItem {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::TraitItem::Const(self0), crate::TraitItem::Const(other0)) => {
+                self0 == other0
+            }
+            (crate::TraitItem::Fn(self0), crate::TraitItem::Fn(other0)) => {
+                self0 == other0
+            }
+            (crate::TraitItem::Type(self0), crate::TraitItem::Type(other0)) => {
+                self0 == other0
+            }
+            (crate::TraitItem::Macro(self0), crate::TraitItem::Macro(other0)) => {
+                self0 == other0
+            }
+            (crate::TraitItem::Verbatim(self0), crate::TraitItem::Verbatim(other0)) => {
+                TokenStreamHelper(self0) == TokenStreamHelper(other0)
+            }
+            _ => false,
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TraitItemConst {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TraitItemConst {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.ident == other.ident
+            && self.generics == other.generics && self.ty == other.ty
+            && self.default == other.default
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TraitItemFn {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TraitItemFn {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.sig == other.sig
+            && self.default == other.default && self.semi_token == other.semi_token
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TraitItemMacro {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TraitItemMacro {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.mac == other.mac
+            && self.semi_token == other.semi_token
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TraitItemType {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TraitItemType {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.ident == other.ident
+            && self.generics == other.generics && self.colon_token == other.colon_token
+            && self.bounds == other.bounds && self.default == other.default
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Type {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Type {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::Type::Array(self0), crate::Type::Array(other0)) => self0 == other0,
+            (crate::Type::BareFn(self0), crate::Type::BareFn(other0)) => self0 == other0,
+            (crate::Type::Group(self0), crate::Type::Group(other0)) => self0 == other0,
+            (crate::Type::ImplTrait(self0), crate::Type::ImplTrait(other0)) => {
+                self0 == other0
+            }
+            (crate::Type::Infer(self0), crate::Type::Infer(other0)) => self0 == other0,
+            (crate::Type::Macro(self0), crate::Type::Macro(other0)) => self0 == other0,
+            (crate::Type::Never(self0), crate::Type::Never(other0)) => self0 == other0,
+            (crate::Type::Paren(self0), crate::Type::Paren(other0)) => self0 == other0,
+            (crate::Type::Path(self0), crate::Type::Path(other0)) => self0 == other0,
+            (crate::Type::Ptr(self0), crate::Type::Ptr(other0)) => self0 == other0,
+            (crate::Type::Reference(self0), crate::Type::Reference(other0)) => {
+                self0 == other0
+            }
+            (crate::Type::Slice(self0), crate::Type::Slice(other0)) => self0 == other0,
+            (crate::Type::TraitObject(self0), crate::Type::TraitObject(other0)) => {
+                self0 == other0
+            }
+            (crate::Type::Tuple(self0), crate::Type::Tuple(other0)) => self0 == other0,
+            (crate::Type::Verbatim(self0), crate::Type::Verbatim(other0)) => {
+                TokenStreamHelper(self0) == TokenStreamHelper(other0)
+            }
+            _ => false,
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TypeArray {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TypeArray {
+    fn eq(&self, other: &Self) -> bool {
+        self.elem == other.elem && self.len == other.len
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TypeBareFn {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TypeBareFn {
+    fn eq(&self, other: &Self) -> bool {
+        self.lifetimes == other.lifetimes && self.unsafety == other.unsafety
+            && self.abi == other.abi && self.inputs == other.inputs
+            && self.variadic == other.variadic && self.output == other.output
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TypeGroup {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TypeGroup {
+    fn eq(&self, other: &Self) -> bool {
+        self.elem == other.elem
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TypeImplTrait {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TypeImplTrait {
+    fn eq(&self, other: &Self) -> bool {
+        self.bounds == other.bounds
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TypeInfer {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TypeInfer {
+    fn eq(&self, _other: &Self) -> bool {
+        true
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TypeMacro {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TypeMacro {
+    fn eq(&self, other: &Self) -> bool {
+        self.mac == other.mac
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TypeNever {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TypeNever {
+    fn eq(&self, _other: &Self) -> bool {
+        true
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TypeParam {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TypeParam {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.ident == other.ident
+            && self.colon_token == other.colon_token && self.bounds == other.bounds
+            && self.eq_token == other.eq_token && self.default == other.default
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TypeParamBound {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TypeParamBound {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (
+                crate::TypeParamBound::Trait(self0),
+                crate::TypeParamBound::Trait(other0),
+            ) => self0 == other0,
+            (
+                crate::TypeParamBound::Lifetime(self0),
+                crate::TypeParamBound::Lifetime(other0),
+            ) => self0 == other0,
+            (
+                crate::TypeParamBound::Verbatim(self0),
+                crate::TypeParamBound::Verbatim(other0),
+            ) => TokenStreamHelper(self0) == TokenStreamHelper(other0),
+            _ => false,
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TypeParen {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TypeParen {
+    fn eq(&self, other: &Self) -> bool {
+        self.elem == other.elem
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TypePath {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TypePath {
+    fn eq(&self, other: &Self) -> bool {
+        self.qself == other.qself && self.path == other.path
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TypePtr {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TypePtr {
+    fn eq(&self, other: &Self) -> bool {
+        self.const_token == other.const_token && self.mutability == other.mutability
+            && self.elem == other.elem
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TypeReference {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TypeReference {
+    fn eq(&self, other: &Self) -> bool {
+        self.lifetime == other.lifetime && self.mutability == other.mutability
+            && self.elem == other.elem
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TypeSlice {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TypeSlice {
+    fn eq(&self, other: &Self) -> bool {
+        self.elem == other.elem
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TypeTraitObject {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TypeTraitObject {
+    fn eq(&self, other: &Self) -> bool {
+        self.dyn_token == other.dyn_token && self.bounds == other.bounds
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::TypeTuple {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::TypeTuple {
+    fn eq(&self, other: &Self) -> bool {
+        self.elems == other.elems
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::UnOp {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::UnOp {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::UnOp::Deref(_), crate::UnOp::Deref(_)) => true,
+            (crate::UnOp::Not(_), crate::UnOp::Not(_)) => true,
+            (crate::UnOp::Neg(_), crate::UnOp::Neg(_)) => true,
+            _ => false,
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::UseGlob {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::UseGlob {
+    fn eq(&self, _other: &Self) -> bool {
+        true
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::UseGroup {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::UseGroup {
+    fn eq(&self, other: &Self) -> bool {
+        self.items == other.items
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::UseName {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::UseName {
+    fn eq(&self, other: &Self) -> bool {
+        self.ident == other.ident
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::UsePath {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::UsePath {
+    fn eq(&self, other: &Self) -> bool {
+        self.ident == other.ident && self.tree == other.tree
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::UseRename {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::UseRename {
+    fn eq(&self, other: &Self) -> bool {
+        self.ident == other.ident && self.rename == other.rename
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::UseTree {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::UseTree {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::UseTree::Path(self0), crate::UseTree::Path(other0)) => {
+                self0 == other0
+            }
+            (crate::UseTree::Name(self0), crate::UseTree::Name(other0)) => {
+                self0 == other0
+            }
+            (crate::UseTree::Rename(self0), crate::UseTree::Rename(other0)) => {
+                self0 == other0
+            }
+            (crate::UseTree::Glob(self0), crate::UseTree::Glob(other0)) => {
+                self0 == other0
+            }
+            (crate::UseTree::Group(self0), crate::UseTree::Group(other0)) => {
+                self0 == other0
+            }
+            _ => false,
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Variadic {}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Variadic {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.pat == other.pat && self.comma == other.comma
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Variant {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Variant {
+    fn eq(&self, other: &Self) -> bool {
+        self.attrs == other.attrs && self.ident == other.ident
+            && self.fields == other.fields && self.discriminant == other.discriminant
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::VisRestricted {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::VisRestricted {
+    fn eq(&self, other: &Self) -> bool {
+        self.in_token == other.in_token && self.path == other.path
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::Visibility {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::Visibility {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (crate::Visibility::Public(_), crate::Visibility::Public(_)) => true,
+            (
+                crate::Visibility::Restricted(self0),
+                crate::Visibility::Restricted(other0),
+            ) => self0 == other0,
+            (crate::Visibility::Inherited, crate::Visibility::Inherited) => true,
+            _ => false,
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::WhereClause {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::WhereClause {
+    fn eq(&self, other: &Self) -> bool {
+        self.predicates == other.predicates
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for crate::WherePredicate {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for crate::WherePredicate {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (
+                crate::WherePredicate::Lifetime(self0),
+                crate::WherePredicate::Lifetime(other0),
+            ) => self0 == other0,
+            (crate::WherePredicate::Type(self0), crate::WherePredicate::Type(other0)) => {
+                self0 == other0
+            }
+            _ => false,
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/gen/fold.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/gen/fold.rs
--- 43.0.0-1/rust-vendor/syn/src/gen/fold.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/gen/fold.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,3779 @@
+// This file is @generated by syn-internal-codegen.
+// It is not intended for manual editing.
+
+#![allow(unreachable_code, unused_variables)]
+#![allow(
+    clippy::match_wildcard_for_single_variants,
+    clippy::needless_match,
+    clippy::needless_pass_by_ref_mut,
+)]
+#[cfg(feature = "full")]
+macro_rules! full {
+    ($e:expr) => {
+        $e
+    };
+}
+#[cfg(all(feature = "derive", not(feature = "full")))]
+macro_rules! full {
+    ($e:expr) => {
+        unreachable!()
+    };
+}
+/// Syntax tree traversal to transform the nodes of an owned syntax tree.
+///
+/// See the [module documentation] for details.
+///
+/// [module documentation]: self
+pub trait Fold {
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_abi(&mut self, i: crate::Abi) -> crate::Abi {
+        fold_abi(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_angle_bracketed_generic_arguments(
+        &mut self,
+        i: crate::AngleBracketedGenericArguments,
+    ) -> crate::AngleBracketedGenericArguments {
+        fold_angle_bracketed_generic_arguments(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_arm(&mut self, i: crate::Arm) -> crate::Arm {
+        fold_arm(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_assoc_const(&mut self, i: crate::AssocConst) -> crate::AssocConst {
+        fold_assoc_const(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_assoc_type(&mut self, i: crate::AssocType) -> crate::AssocType {
+        fold_assoc_type(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_attr_style(&mut self, i: crate::AttrStyle) -> crate::AttrStyle {
+        fold_attr_style(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_attribute(&mut self, i: crate::Attribute) -> crate::Attribute {
+        fold_attribute(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_bare_fn_arg(&mut self, i: crate::BareFnArg) -> crate::BareFnArg {
+        fold_bare_fn_arg(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_bare_variadic(&mut self, i: crate::BareVariadic) -> crate::BareVariadic {
+        fold_bare_variadic(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_bin_op(&mut self, i: crate::BinOp) -> crate::BinOp {
+        fold_bin_op(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_block(&mut self, i: crate::Block) -> crate::Block {
+        fold_block(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_bound_lifetimes(
+        &mut self,
+        i: crate::BoundLifetimes,
+    ) -> crate::BoundLifetimes {
+        fold_bound_lifetimes(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_const_param(&mut self, i: crate::ConstParam) -> crate::ConstParam {
+        fold_const_param(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_constraint(&mut self, i: crate::Constraint) -> crate::Constraint {
+        fold_constraint(self, i)
+    }
+    #[cfg(feature = "derive")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+    fn fold_data(&mut self, i: crate::Data) -> crate::Data {
+        fold_data(self, i)
+    }
+    #[cfg(feature = "derive")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+    fn fold_data_enum(&mut self, i: crate::DataEnum) -> crate::DataEnum {
+        fold_data_enum(self, i)
+    }
+    #[cfg(feature = "derive")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+    fn fold_data_struct(&mut self, i: crate::DataStruct) -> crate::DataStruct {
+        fold_data_struct(self, i)
+    }
+    #[cfg(feature = "derive")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+    fn fold_data_union(&mut self, i: crate::DataUnion) -> crate::DataUnion {
+        fold_data_union(self, i)
+    }
+    #[cfg(feature = "derive")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+    fn fold_derive_input(&mut self, i: crate::DeriveInput) -> crate::DeriveInput {
+        fold_derive_input(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_expr(&mut self, i: crate::Expr) -> crate::Expr {
+        fold_expr(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_array(&mut self, i: crate::ExprArray) -> crate::ExprArray {
+        fold_expr_array(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_assign(&mut self, i: crate::ExprAssign) -> crate::ExprAssign {
+        fold_expr_assign(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_async(&mut self, i: crate::ExprAsync) -> crate::ExprAsync {
+        fold_expr_async(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_await(&mut self, i: crate::ExprAwait) -> crate::ExprAwait {
+        fold_expr_await(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_expr_binary(&mut self, i: crate::ExprBinary) -> crate::ExprBinary {
+        fold_expr_binary(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_block(&mut self, i: crate::ExprBlock) -> crate::ExprBlock {
+        fold_expr_block(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_break(&mut self, i: crate::ExprBreak) -> crate::ExprBreak {
+        fold_expr_break(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_expr_call(&mut self, i: crate::ExprCall) -> crate::ExprCall {
+        fold_expr_call(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_expr_cast(&mut self, i: crate::ExprCast) -> crate::ExprCast {
+        fold_expr_cast(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_closure(&mut self, i: crate::ExprClosure) -> crate::ExprClosure {
+        fold_expr_closure(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_const(&mut self, i: crate::ExprConst) -> crate::ExprConst {
+        fold_expr_const(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_continue(&mut self, i: crate::ExprContinue) -> crate::ExprContinue {
+        fold_expr_continue(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_expr_field(&mut self, i: crate::ExprField) -> crate::ExprField {
+        fold_expr_field(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_for_loop(&mut self, i: crate::ExprForLoop) -> crate::ExprForLoop {
+        fold_expr_for_loop(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_expr_group(&mut self, i: crate::ExprGroup) -> crate::ExprGroup {
+        fold_expr_group(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_if(&mut self, i: crate::ExprIf) -> crate::ExprIf {
+        fold_expr_if(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_expr_index(&mut self, i: crate::ExprIndex) -> crate::ExprIndex {
+        fold_expr_index(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_infer(&mut self, i: crate::ExprInfer) -> crate::ExprInfer {
+        fold_expr_infer(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_let(&mut self, i: crate::ExprLet) -> crate::ExprLet {
+        fold_expr_let(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_expr_lit(&mut self, i: crate::ExprLit) -> crate::ExprLit {
+        fold_expr_lit(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_loop(&mut self, i: crate::ExprLoop) -> crate::ExprLoop {
+        fold_expr_loop(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_expr_macro(&mut self, i: crate::ExprMacro) -> crate::ExprMacro {
+        fold_expr_macro(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_match(&mut self, i: crate::ExprMatch) -> crate::ExprMatch {
+        fold_expr_match(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_expr_method_call(
+        &mut self,
+        i: crate::ExprMethodCall,
+    ) -> crate::ExprMethodCall {
+        fold_expr_method_call(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_expr_paren(&mut self, i: crate::ExprParen) -> crate::ExprParen {
+        fold_expr_paren(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_expr_path(&mut self, i: crate::ExprPath) -> crate::ExprPath {
+        fold_expr_path(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_range(&mut self, i: crate::ExprRange) -> crate::ExprRange {
+        fold_expr_range(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_expr_reference(&mut self, i: crate::ExprReference) -> crate::ExprReference {
+        fold_expr_reference(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_repeat(&mut self, i: crate::ExprRepeat) -> crate::ExprRepeat {
+        fold_expr_repeat(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_return(&mut self, i: crate::ExprReturn) -> crate::ExprReturn {
+        fold_expr_return(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_expr_struct(&mut self, i: crate::ExprStruct) -> crate::ExprStruct {
+        fold_expr_struct(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_try(&mut self, i: crate::ExprTry) -> crate::ExprTry {
+        fold_expr_try(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_try_block(&mut self, i: crate::ExprTryBlock) -> crate::ExprTryBlock {
+        fold_expr_try_block(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_tuple(&mut self, i: crate::ExprTuple) -> crate::ExprTuple {
+        fold_expr_tuple(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_expr_unary(&mut self, i: crate::ExprUnary) -> crate::ExprUnary {
+        fold_expr_unary(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_unsafe(&mut self, i: crate::ExprUnsafe) -> crate::ExprUnsafe {
+        fold_expr_unsafe(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_while(&mut self, i: crate::ExprWhile) -> crate::ExprWhile {
+        fold_expr_while(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_expr_yield(&mut self, i: crate::ExprYield) -> crate::ExprYield {
+        fold_expr_yield(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_field(&mut self, i: crate::Field) -> crate::Field {
+        fold_field(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_field_mutability(
+        &mut self,
+        i: crate::FieldMutability,
+    ) -> crate::FieldMutability {
+        fold_field_mutability(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_field_pat(&mut self, i: crate::FieldPat) -> crate::FieldPat {
+        fold_field_pat(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_field_value(&mut self, i: crate::FieldValue) -> crate::FieldValue {
+        fold_field_value(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_fields(&mut self, i: crate::Fields) -> crate::Fields {
+        fold_fields(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_fields_named(&mut self, i: crate::FieldsNamed) -> crate::FieldsNamed {
+        fold_fields_named(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_fields_unnamed(&mut self, i: crate::FieldsUnnamed) -> crate::FieldsUnnamed {
+        fold_fields_unnamed(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_file(&mut self, i: crate::File) -> crate::File {
+        fold_file(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_fn_arg(&mut self, i: crate::FnArg) -> crate::FnArg {
+        fold_fn_arg(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_foreign_item(&mut self, i: crate::ForeignItem) -> crate::ForeignItem {
+        fold_foreign_item(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_foreign_item_fn(&mut self, i: crate::ForeignItemFn) -> crate::ForeignItemFn {
+        fold_foreign_item_fn(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_foreign_item_macro(
+        &mut self,
+        i: crate::ForeignItemMacro,
+    ) -> crate::ForeignItemMacro {
+        fold_foreign_item_macro(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_foreign_item_static(
+        &mut self,
+        i: crate::ForeignItemStatic,
+    ) -> crate::ForeignItemStatic {
+        fold_foreign_item_static(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_foreign_item_type(
+        &mut self,
+        i: crate::ForeignItemType,
+    ) -> crate::ForeignItemType {
+        fold_foreign_item_type(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_generic_argument(
+        &mut self,
+        i: crate::GenericArgument,
+    ) -> crate::GenericArgument {
+        fold_generic_argument(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_generic_param(&mut self, i: crate::GenericParam) -> crate::GenericParam {
+        fold_generic_param(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_generics(&mut self, i: crate::Generics) -> crate::Generics {
+        fold_generics(self, i)
+    }
+    fn fold_ident(&mut self, i: proc_macro2::Ident) -> proc_macro2::Ident {
+        fold_ident(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_impl_item(&mut self, i: crate::ImplItem) -> crate::ImplItem {
+        fold_impl_item(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_impl_item_const(&mut self, i: crate::ImplItemConst) -> crate::ImplItemConst {
+        fold_impl_item_const(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_impl_item_fn(&mut self, i: crate::ImplItemFn) -> crate::ImplItemFn {
+        fold_impl_item_fn(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_impl_item_macro(&mut self, i: crate::ImplItemMacro) -> crate::ImplItemMacro {
+        fold_impl_item_macro(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_impl_item_type(&mut self, i: crate::ImplItemType) -> crate::ImplItemType {
+        fold_impl_item_type(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_impl_restriction(
+        &mut self,
+        i: crate::ImplRestriction,
+    ) -> crate::ImplRestriction {
+        fold_impl_restriction(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_index(&mut self, i: crate::Index) -> crate::Index {
+        fold_index(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_item(&mut self, i: crate::Item) -> crate::Item {
+        fold_item(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_item_const(&mut self, i: crate::ItemConst) -> crate::ItemConst {
+        fold_item_const(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_item_enum(&mut self, i: crate::ItemEnum) -> crate::ItemEnum {
+        fold_item_enum(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_item_extern_crate(
+        &mut self,
+        i: crate::ItemExternCrate,
+    ) -> crate::ItemExternCrate {
+        fold_item_extern_crate(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_item_fn(&mut self, i: crate::ItemFn) -> crate::ItemFn {
+        fold_item_fn(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_item_foreign_mod(
+        &mut self,
+        i: crate::ItemForeignMod,
+    ) -> crate::ItemForeignMod {
+        fold_item_foreign_mod(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_item_impl(&mut self, i: crate::ItemImpl) -> crate::ItemImpl {
+        fold_item_impl(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_item_macro(&mut self, i: crate::ItemMacro) -> crate::ItemMacro {
+        fold_item_macro(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_item_mod(&mut self, i: crate::ItemMod) -> crate::ItemMod {
+        fold_item_mod(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_item_static(&mut self, i: crate::ItemStatic) -> crate::ItemStatic {
+        fold_item_static(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_item_struct(&mut self, i: crate::ItemStruct) -> crate::ItemStruct {
+        fold_item_struct(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_item_trait(&mut self, i: crate::ItemTrait) -> crate::ItemTrait {
+        fold_item_trait(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_item_trait_alias(
+        &mut self,
+        i: crate::ItemTraitAlias,
+    ) -> crate::ItemTraitAlias {
+        fold_item_trait_alias(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_item_type(&mut self, i: crate::ItemType) -> crate::ItemType {
+        fold_item_type(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_item_union(&mut self, i: crate::ItemUnion) -> crate::ItemUnion {
+        fold_item_union(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_item_use(&mut self, i: crate::ItemUse) -> crate::ItemUse {
+        fold_item_use(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_label(&mut self, i: crate::Label) -> crate::Label {
+        fold_label(self, i)
+    }
+    fn fold_lifetime(&mut self, i: crate::Lifetime) -> crate::Lifetime {
+        fold_lifetime(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_lifetime_param(&mut self, i: crate::LifetimeParam) -> crate::LifetimeParam {
+        fold_lifetime_param(self, i)
+    }
+    fn fold_lit(&mut self, i: crate::Lit) -> crate::Lit {
+        fold_lit(self, i)
+    }
+    fn fold_lit_bool(&mut self, i: crate::LitBool) -> crate::LitBool {
+        fold_lit_bool(self, i)
+    }
+    fn fold_lit_byte(&mut self, i: crate::LitByte) -> crate::LitByte {
+        fold_lit_byte(self, i)
+    }
+    fn fold_lit_byte_str(&mut self, i: crate::LitByteStr) -> crate::LitByteStr {
+        fold_lit_byte_str(self, i)
+    }
+    fn fold_lit_cstr(&mut self, i: crate::LitCStr) -> crate::LitCStr {
+        fold_lit_cstr(self, i)
+    }
+    fn fold_lit_char(&mut self, i: crate::LitChar) -> crate::LitChar {
+        fold_lit_char(self, i)
+    }
+    fn fold_lit_float(&mut self, i: crate::LitFloat) -> crate::LitFloat {
+        fold_lit_float(self, i)
+    }
+    fn fold_lit_int(&mut self, i: crate::LitInt) -> crate::LitInt {
+        fold_lit_int(self, i)
+    }
+    fn fold_lit_str(&mut self, i: crate::LitStr) -> crate::LitStr {
+        fold_lit_str(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_local(&mut self, i: crate::Local) -> crate::Local {
+        fold_local(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_local_init(&mut self, i: crate::LocalInit) -> crate::LocalInit {
+        fold_local_init(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_macro(&mut self, i: crate::Macro) -> crate::Macro {
+        fold_macro(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_macro_delimiter(
+        &mut self,
+        i: crate::MacroDelimiter,
+    ) -> crate::MacroDelimiter {
+        fold_macro_delimiter(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_member(&mut self, i: crate::Member) -> crate::Member {
+        fold_member(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_meta(&mut self, i: crate::Meta) -> crate::Meta {
+        fold_meta(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_meta_list(&mut self, i: crate::MetaList) -> crate::MetaList {
+        fold_meta_list(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_meta_name_value(&mut self, i: crate::MetaNameValue) -> crate::MetaNameValue {
+        fold_meta_name_value(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_parenthesized_generic_arguments(
+        &mut self,
+        i: crate::ParenthesizedGenericArguments,
+    ) -> crate::ParenthesizedGenericArguments {
+        fold_parenthesized_generic_arguments(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_pat(&mut self, i: crate::Pat) -> crate::Pat {
+        fold_pat(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_pat_ident(&mut self, i: crate::PatIdent) -> crate::PatIdent {
+        fold_pat_ident(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_pat_or(&mut self, i: crate::PatOr) -> crate::PatOr {
+        fold_pat_or(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_pat_paren(&mut self, i: crate::PatParen) -> crate::PatParen {
+        fold_pat_paren(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_pat_reference(&mut self, i: crate::PatReference) -> crate::PatReference {
+        fold_pat_reference(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_pat_rest(&mut self, i: crate::PatRest) -> crate::PatRest {
+        fold_pat_rest(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_pat_slice(&mut self, i: crate::PatSlice) -> crate::PatSlice {
+        fold_pat_slice(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_pat_struct(&mut self, i: crate::PatStruct) -> crate::PatStruct {
+        fold_pat_struct(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_pat_tuple(&mut self, i: crate::PatTuple) -> crate::PatTuple {
+        fold_pat_tuple(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_pat_tuple_struct(
+        &mut self,
+        i: crate::PatTupleStruct,
+    ) -> crate::PatTupleStruct {
+        fold_pat_tuple_struct(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_pat_type(&mut self, i: crate::PatType) -> crate::PatType {
+        fold_pat_type(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_pat_wild(&mut self, i: crate::PatWild) -> crate::PatWild {
+        fold_pat_wild(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_path(&mut self, i: crate::Path) -> crate::Path {
+        fold_path(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_path_arguments(&mut self, i: crate::PathArguments) -> crate::PathArguments {
+        fold_path_arguments(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_path_segment(&mut self, i: crate::PathSegment) -> crate::PathSegment {
+        fold_path_segment(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_predicate_lifetime(
+        &mut self,
+        i: crate::PredicateLifetime,
+    ) -> crate::PredicateLifetime {
+        fold_predicate_lifetime(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_predicate_type(&mut self, i: crate::PredicateType) -> crate::PredicateType {
+        fold_predicate_type(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_qself(&mut self, i: crate::QSelf) -> crate::QSelf {
+        fold_qself(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_range_limits(&mut self, i: crate::RangeLimits) -> crate::RangeLimits {
+        fold_range_limits(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_receiver(&mut self, i: crate::Receiver) -> crate::Receiver {
+        fold_receiver(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_return_type(&mut self, i: crate::ReturnType) -> crate::ReturnType {
+        fold_return_type(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_signature(&mut self, i: crate::Signature) -> crate::Signature {
+        fold_signature(self, i)
+    }
+    fn fold_span(&mut self, i: proc_macro2::Span) -> proc_macro2::Span {
+        fold_span(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_static_mutability(
+        &mut self,
+        i: crate::StaticMutability,
+    ) -> crate::StaticMutability {
+        fold_static_mutability(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_stmt(&mut self, i: crate::Stmt) -> crate::Stmt {
+        fold_stmt(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_stmt_macro(&mut self, i: crate::StmtMacro) -> crate::StmtMacro {
+        fold_stmt_macro(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_trait_bound(&mut self, i: crate::TraitBound) -> crate::TraitBound {
+        fold_trait_bound(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_trait_bound_modifier(
+        &mut self,
+        i: crate::TraitBoundModifier,
+    ) -> crate::TraitBoundModifier {
+        fold_trait_bound_modifier(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_trait_item(&mut self, i: crate::TraitItem) -> crate::TraitItem {
+        fold_trait_item(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_trait_item_const(
+        &mut self,
+        i: crate::TraitItemConst,
+    ) -> crate::TraitItemConst {
+        fold_trait_item_const(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_trait_item_fn(&mut self, i: crate::TraitItemFn) -> crate::TraitItemFn {
+        fold_trait_item_fn(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_trait_item_macro(
+        &mut self,
+        i: crate::TraitItemMacro,
+    ) -> crate::TraitItemMacro {
+        fold_trait_item_macro(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_trait_item_type(&mut self, i: crate::TraitItemType) -> crate::TraitItemType {
+        fold_trait_item_type(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_type(&mut self, i: crate::Type) -> crate::Type {
+        fold_type(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_type_array(&mut self, i: crate::TypeArray) -> crate::TypeArray {
+        fold_type_array(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_type_bare_fn(&mut self, i: crate::TypeBareFn) -> crate::TypeBareFn {
+        fold_type_bare_fn(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_type_group(&mut self, i: crate::TypeGroup) -> crate::TypeGroup {
+        fold_type_group(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_type_impl_trait(&mut self, i: crate::TypeImplTrait) -> crate::TypeImplTrait {
+        fold_type_impl_trait(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_type_infer(&mut self, i: crate::TypeInfer) -> crate::TypeInfer {
+        fold_type_infer(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_type_macro(&mut self, i: crate::TypeMacro) -> crate::TypeMacro {
+        fold_type_macro(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_type_never(&mut self, i: crate::TypeNever) -> crate::TypeNever {
+        fold_type_never(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_type_param(&mut self, i: crate::TypeParam) -> crate::TypeParam {
+        fold_type_param(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_type_param_bound(
+        &mut self,
+        i: crate::TypeParamBound,
+    ) -> crate::TypeParamBound {
+        fold_type_param_bound(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_type_paren(&mut self, i: crate::TypeParen) -> crate::TypeParen {
+        fold_type_paren(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_type_path(&mut self, i: crate::TypePath) -> crate::TypePath {
+        fold_type_path(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_type_ptr(&mut self, i: crate::TypePtr) -> crate::TypePtr {
+        fold_type_ptr(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_type_reference(&mut self, i: crate::TypeReference) -> crate::TypeReference {
+        fold_type_reference(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_type_slice(&mut self, i: crate::TypeSlice) -> crate::TypeSlice {
+        fold_type_slice(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_type_trait_object(
+        &mut self,
+        i: crate::TypeTraitObject,
+    ) -> crate::TypeTraitObject {
+        fold_type_trait_object(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_type_tuple(&mut self, i: crate::TypeTuple) -> crate::TypeTuple {
+        fold_type_tuple(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_un_op(&mut self, i: crate::UnOp) -> crate::UnOp {
+        fold_un_op(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_use_glob(&mut self, i: crate::UseGlob) -> crate::UseGlob {
+        fold_use_glob(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_use_group(&mut self, i: crate::UseGroup) -> crate::UseGroup {
+        fold_use_group(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_use_name(&mut self, i: crate::UseName) -> crate::UseName {
+        fold_use_name(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_use_path(&mut self, i: crate::UsePath) -> crate::UsePath {
+        fold_use_path(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_use_rename(&mut self, i: crate::UseRename) -> crate::UseRename {
+        fold_use_rename(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_use_tree(&mut self, i: crate::UseTree) -> crate::UseTree {
+        fold_use_tree(self, i)
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn fold_variadic(&mut self, i: crate::Variadic) -> crate::Variadic {
+        fold_variadic(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_variant(&mut self, i: crate::Variant) -> crate::Variant {
+        fold_variant(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_vis_restricted(&mut self, i: crate::VisRestricted) -> crate::VisRestricted {
+        fold_vis_restricted(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_visibility(&mut self, i: crate::Visibility) -> crate::Visibility {
+        fold_visibility(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_where_clause(&mut self, i: crate::WhereClause) -> crate::WhereClause {
+        fold_where_clause(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn fold_where_predicate(
+        &mut self,
+        i: crate::WherePredicate,
+    ) -> crate::WherePredicate {
+        fold_where_predicate(self, i)
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_abi<F>(f: &mut F, node: crate::Abi) -> crate::Abi
+where
+    F: Fold + ?Sized,
+{
+    crate::Abi {
+        extern_token: node.extern_token,
+        name: (node.name).map(|it| f.fold_lit_str(it)),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_angle_bracketed_generic_arguments<F>(
+    f: &mut F,
+    node: crate::AngleBracketedGenericArguments,
+) -> crate::AngleBracketedGenericArguments
+where
+    F: Fold + ?Sized,
+{
+    crate::AngleBracketedGenericArguments {
+        colon2_token: node.colon2_token,
+        lt_token: node.lt_token,
+        args: crate::punctuated::fold(node.args, f, F::fold_generic_argument),
+        gt_token: node.gt_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_arm<F>(f: &mut F, node: crate::Arm) -> crate::Arm
+where
+    F: Fold + ?Sized,
+{
+    crate::Arm {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        pat: f.fold_pat(node.pat),
+        guard: (node.guard).map(|it| ((it).0, Box::new(f.fold_expr(*(it).1)))),
+        fat_arrow_token: node.fat_arrow_token,
+        body: Box::new(f.fold_expr(*node.body)),
+        comma: node.comma,
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_assoc_const<F>(f: &mut F, node: crate::AssocConst) -> crate::AssocConst
+where
+    F: Fold + ?Sized,
+{
+    crate::AssocConst {
+        ident: f.fold_ident(node.ident),
+        generics: (node.generics).map(|it| f.fold_angle_bracketed_generic_arguments(it)),
+        eq_token: node.eq_token,
+        value: f.fold_expr(node.value),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_assoc_type<F>(f: &mut F, node: crate::AssocType) -> crate::AssocType
+where
+    F: Fold + ?Sized,
+{
+    crate::AssocType {
+        ident: f.fold_ident(node.ident),
+        generics: (node.generics).map(|it| f.fold_angle_bracketed_generic_arguments(it)),
+        eq_token: node.eq_token,
+        ty: f.fold_type(node.ty),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_attr_style<F>(f: &mut F, node: crate::AttrStyle) -> crate::AttrStyle
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::AttrStyle::Outer => crate::AttrStyle::Outer,
+        crate::AttrStyle::Inner(_binding_0) => crate::AttrStyle::Inner(_binding_0),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_attribute<F>(f: &mut F, node: crate::Attribute) -> crate::Attribute
+where
+    F: Fold + ?Sized,
+{
+    crate::Attribute {
+        pound_token: node.pound_token,
+        style: f.fold_attr_style(node.style),
+        bracket_token: node.bracket_token,
+        meta: f.fold_meta(node.meta),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_bare_fn_arg<F>(f: &mut F, node: crate::BareFnArg) -> crate::BareFnArg
+where
+    F: Fold + ?Sized,
+{
+    crate::BareFnArg {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        name: (node.name).map(|it| (f.fold_ident((it).0), (it).1)),
+        ty: f.fold_type(node.ty),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_bare_variadic<F>(f: &mut F, node: crate::BareVariadic) -> crate::BareVariadic
+where
+    F: Fold + ?Sized,
+{
+    crate::BareVariadic {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        name: (node.name).map(|it| (f.fold_ident((it).0), (it).1)),
+        dots: node.dots,
+        comma: node.comma,
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_bin_op<F>(f: &mut F, node: crate::BinOp) -> crate::BinOp
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::BinOp::Add(_binding_0) => crate::BinOp::Add(_binding_0),
+        crate::BinOp::Sub(_binding_0) => crate::BinOp::Sub(_binding_0),
+        crate::BinOp::Mul(_binding_0) => crate::BinOp::Mul(_binding_0),
+        crate::BinOp::Div(_binding_0) => crate::BinOp::Div(_binding_0),
+        crate::BinOp::Rem(_binding_0) => crate::BinOp::Rem(_binding_0),
+        crate::BinOp::And(_binding_0) => crate::BinOp::And(_binding_0),
+        crate::BinOp::Or(_binding_0) => crate::BinOp::Or(_binding_0),
+        crate::BinOp::BitXor(_binding_0) => crate::BinOp::BitXor(_binding_0),
+        crate::BinOp::BitAnd(_binding_0) => crate::BinOp::BitAnd(_binding_0),
+        crate::BinOp::BitOr(_binding_0) => crate::BinOp::BitOr(_binding_0),
+        crate::BinOp::Shl(_binding_0) => crate::BinOp::Shl(_binding_0),
+        crate::BinOp::Shr(_binding_0) => crate::BinOp::Shr(_binding_0),
+        crate::BinOp::Eq(_binding_0) => crate::BinOp::Eq(_binding_0),
+        crate::BinOp::Lt(_binding_0) => crate::BinOp::Lt(_binding_0),
+        crate::BinOp::Le(_binding_0) => crate::BinOp::Le(_binding_0),
+        crate::BinOp::Ne(_binding_0) => crate::BinOp::Ne(_binding_0),
+        crate::BinOp::Ge(_binding_0) => crate::BinOp::Ge(_binding_0),
+        crate::BinOp::Gt(_binding_0) => crate::BinOp::Gt(_binding_0),
+        crate::BinOp::AddAssign(_binding_0) => crate::BinOp::AddAssign(_binding_0),
+        crate::BinOp::SubAssign(_binding_0) => crate::BinOp::SubAssign(_binding_0),
+        crate::BinOp::MulAssign(_binding_0) => crate::BinOp::MulAssign(_binding_0),
+        crate::BinOp::DivAssign(_binding_0) => crate::BinOp::DivAssign(_binding_0),
+        crate::BinOp::RemAssign(_binding_0) => crate::BinOp::RemAssign(_binding_0),
+        crate::BinOp::BitXorAssign(_binding_0) => crate::BinOp::BitXorAssign(_binding_0),
+        crate::BinOp::BitAndAssign(_binding_0) => crate::BinOp::BitAndAssign(_binding_0),
+        crate::BinOp::BitOrAssign(_binding_0) => crate::BinOp::BitOrAssign(_binding_0),
+        crate::BinOp::ShlAssign(_binding_0) => crate::BinOp::ShlAssign(_binding_0),
+        crate::BinOp::ShrAssign(_binding_0) => crate::BinOp::ShrAssign(_binding_0),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_block<F>(f: &mut F, node: crate::Block) -> crate::Block
+where
+    F: Fold + ?Sized,
+{
+    crate::Block {
+        brace_token: node.brace_token,
+        stmts: fold_vec(node.stmts, f, F::fold_stmt),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_bound_lifetimes<F>(
+    f: &mut F,
+    node: crate::BoundLifetimes,
+) -> crate::BoundLifetimes
+where
+    F: Fold + ?Sized,
+{
+    crate::BoundLifetimes {
+        for_token: node.for_token,
+        lt_token: node.lt_token,
+        lifetimes: crate::punctuated::fold(node.lifetimes, f, F::fold_generic_param),
+        gt_token: node.gt_token,
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_const_param<F>(f: &mut F, node: crate::ConstParam) -> crate::ConstParam
+where
+    F: Fold + ?Sized,
+{
+    crate::ConstParam {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        const_token: node.const_token,
+        ident: f.fold_ident(node.ident),
+        colon_token: node.colon_token,
+        ty: f.fold_type(node.ty),
+        eq_token: node.eq_token,
+        default: (node.default).map(|it| f.fold_expr(it)),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_constraint<F>(f: &mut F, node: crate::Constraint) -> crate::Constraint
+where
+    F: Fold + ?Sized,
+{
+    crate::Constraint {
+        ident: f.fold_ident(node.ident),
+        generics: (node.generics).map(|it| f.fold_angle_bracketed_generic_arguments(it)),
+        colon_token: node.colon_token,
+        bounds: crate::punctuated::fold(node.bounds, f, F::fold_type_param_bound),
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+pub fn fold_data<F>(f: &mut F, node: crate::Data) -> crate::Data
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::Data::Struct(_binding_0) => {
+            crate::Data::Struct(f.fold_data_struct(_binding_0))
+        }
+        crate::Data::Enum(_binding_0) => crate::Data::Enum(f.fold_data_enum(_binding_0)),
+        crate::Data::Union(_binding_0) => {
+            crate::Data::Union(f.fold_data_union(_binding_0))
+        }
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+pub fn fold_data_enum<F>(f: &mut F, node: crate::DataEnum) -> crate::DataEnum
+where
+    F: Fold + ?Sized,
+{
+    crate::DataEnum {
+        enum_token: node.enum_token,
+        brace_token: node.brace_token,
+        variants: crate::punctuated::fold(node.variants, f, F::fold_variant),
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+pub fn fold_data_struct<F>(f: &mut F, node: crate::DataStruct) -> crate::DataStruct
+where
+    F: Fold + ?Sized,
+{
+    crate::DataStruct {
+        struct_token: node.struct_token,
+        fields: f.fold_fields(node.fields),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+pub fn fold_data_union<F>(f: &mut F, node: crate::DataUnion) -> crate::DataUnion
+where
+    F: Fold + ?Sized,
+{
+    crate::DataUnion {
+        union_token: node.union_token,
+        fields: f.fold_fields_named(node.fields),
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+pub fn fold_derive_input<F>(f: &mut F, node: crate::DeriveInput) -> crate::DeriveInput
+where
+    F: Fold + ?Sized,
+{
+    crate::DeriveInput {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        vis: f.fold_visibility(node.vis),
+        ident: f.fold_ident(node.ident),
+        generics: f.fold_generics(node.generics),
+        data: f.fold_data(node.data),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_expr<F>(f: &mut F, node: crate::Expr) -> crate::Expr
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::Expr::Array(_binding_0) => {
+            crate::Expr::Array(full!(f.fold_expr_array(_binding_0)))
+        }
+        crate::Expr::Assign(_binding_0) => {
+            crate::Expr::Assign(full!(f.fold_expr_assign(_binding_0)))
+        }
+        crate::Expr::Async(_binding_0) => {
+            crate::Expr::Async(full!(f.fold_expr_async(_binding_0)))
+        }
+        crate::Expr::Await(_binding_0) => {
+            crate::Expr::Await(full!(f.fold_expr_await(_binding_0)))
+        }
+        crate::Expr::Binary(_binding_0) => {
+            crate::Expr::Binary(f.fold_expr_binary(_binding_0))
+        }
+        crate::Expr::Block(_binding_0) => {
+            crate::Expr::Block(full!(f.fold_expr_block(_binding_0)))
+        }
+        crate::Expr::Break(_binding_0) => {
+            crate::Expr::Break(full!(f.fold_expr_break(_binding_0)))
+        }
+        crate::Expr::Call(_binding_0) => crate::Expr::Call(f.fold_expr_call(_binding_0)),
+        crate::Expr::Cast(_binding_0) => crate::Expr::Cast(f.fold_expr_cast(_binding_0)),
+        crate::Expr::Closure(_binding_0) => {
+            crate::Expr::Closure(full!(f.fold_expr_closure(_binding_0)))
+        }
+        crate::Expr::Const(_binding_0) => {
+            crate::Expr::Const(full!(f.fold_expr_const(_binding_0)))
+        }
+        crate::Expr::Continue(_binding_0) => {
+            crate::Expr::Continue(full!(f.fold_expr_continue(_binding_0)))
+        }
+        crate::Expr::Field(_binding_0) => {
+            crate::Expr::Field(f.fold_expr_field(_binding_0))
+        }
+        crate::Expr::ForLoop(_binding_0) => {
+            crate::Expr::ForLoop(full!(f.fold_expr_for_loop(_binding_0)))
+        }
+        crate::Expr::Group(_binding_0) => {
+            crate::Expr::Group(f.fold_expr_group(_binding_0))
+        }
+        crate::Expr::If(_binding_0) => crate::Expr::If(full!(f.fold_expr_if(_binding_0))),
+        crate::Expr::Index(_binding_0) => {
+            crate::Expr::Index(f.fold_expr_index(_binding_0))
+        }
+        crate::Expr::Infer(_binding_0) => {
+            crate::Expr::Infer(full!(f.fold_expr_infer(_binding_0)))
+        }
+        crate::Expr::Let(_binding_0) => {
+            crate::Expr::Let(full!(f.fold_expr_let(_binding_0)))
+        }
+        crate::Expr::Lit(_binding_0) => crate::Expr::Lit(f.fold_expr_lit(_binding_0)),
+        crate::Expr::Loop(_binding_0) => {
+            crate::Expr::Loop(full!(f.fold_expr_loop(_binding_0)))
+        }
+        crate::Expr::Macro(_binding_0) => {
+            crate::Expr::Macro(f.fold_expr_macro(_binding_0))
+        }
+        crate::Expr::Match(_binding_0) => {
+            crate::Expr::Match(full!(f.fold_expr_match(_binding_0)))
+        }
+        crate::Expr::MethodCall(_binding_0) => {
+            crate::Expr::MethodCall(f.fold_expr_method_call(_binding_0))
+        }
+        crate::Expr::Paren(_binding_0) => {
+            crate::Expr::Paren(f.fold_expr_paren(_binding_0))
+        }
+        crate::Expr::Path(_binding_0) => crate::Expr::Path(f.fold_expr_path(_binding_0)),
+        crate::Expr::Range(_binding_0) => {
+            crate::Expr::Range(full!(f.fold_expr_range(_binding_0)))
+        }
+        crate::Expr::Reference(_binding_0) => {
+            crate::Expr::Reference(f.fold_expr_reference(_binding_0))
+        }
+        crate::Expr::Repeat(_binding_0) => {
+            crate::Expr::Repeat(full!(f.fold_expr_repeat(_binding_0)))
+        }
+        crate::Expr::Return(_binding_0) => {
+            crate::Expr::Return(full!(f.fold_expr_return(_binding_0)))
+        }
+        crate::Expr::Struct(_binding_0) => {
+            crate::Expr::Struct(f.fold_expr_struct(_binding_0))
+        }
+        crate::Expr::Try(_binding_0) => {
+            crate::Expr::Try(full!(f.fold_expr_try(_binding_0)))
+        }
+        crate::Expr::TryBlock(_binding_0) => {
+            crate::Expr::TryBlock(full!(f.fold_expr_try_block(_binding_0)))
+        }
+        crate::Expr::Tuple(_binding_0) => {
+            crate::Expr::Tuple(full!(f.fold_expr_tuple(_binding_0)))
+        }
+        crate::Expr::Unary(_binding_0) => {
+            crate::Expr::Unary(f.fold_expr_unary(_binding_0))
+        }
+        crate::Expr::Unsafe(_binding_0) => {
+            crate::Expr::Unsafe(full!(f.fold_expr_unsafe(_binding_0)))
+        }
+        crate::Expr::Verbatim(_binding_0) => crate::Expr::Verbatim(_binding_0),
+        crate::Expr::While(_binding_0) => {
+            crate::Expr::While(full!(f.fold_expr_while(_binding_0)))
+        }
+        crate::Expr::Yield(_binding_0) => {
+            crate::Expr::Yield(full!(f.fold_expr_yield(_binding_0)))
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_array<F>(f: &mut F, node: crate::ExprArray) -> crate::ExprArray
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprArray {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        bracket_token: node.bracket_token,
+        elems: crate::punctuated::fold(node.elems, f, F::fold_expr),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_assign<F>(f: &mut F, node: crate::ExprAssign) -> crate::ExprAssign
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprAssign {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        left: Box::new(f.fold_expr(*node.left)),
+        eq_token: node.eq_token,
+        right: Box::new(f.fold_expr(*node.right)),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_async<F>(f: &mut F, node: crate::ExprAsync) -> crate::ExprAsync
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprAsync {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        async_token: node.async_token,
+        capture: node.capture,
+        block: f.fold_block(node.block),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_await<F>(f: &mut F, node: crate::ExprAwait) -> crate::ExprAwait
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprAwait {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        base: Box::new(f.fold_expr(*node.base)),
+        dot_token: node.dot_token,
+        await_token: node.await_token,
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_expr_binary<F>(f: &mut F, node: crate::ExprBinary) -> crate::ExprBinary
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprBinary {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        left: Box::new(f.fold_expr(*node.left)),
+        op: f.fold_bin_op(node.op),
+        right: Box::new(f.fold_expr(*node.right)),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_block<F>(f: &mut F, node: crate::ExprBlock) -> crate::ExprBlock
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprBlock {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        label: (node.label).map(|it| f.fold_label(it)),
+        block: f.fold_block(node.block),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_break<F>(f: &mut F, node: crate::ExprBreak) -> crate::ExprBreak
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprBreak {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        break_token: node.break_token,
+        label: (node.label).map(|it| f.fold_lifetime(it)),
+        expr: (node.expr).map(|it| Box::new(f.fold_expr(*it))),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_expr_call<F>(f: &mut F, node: crate::ExprCall) -> crate::ExprCall
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprCall {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        func: Box::new(f.fold_expr(*node.func)),
+        paren_token: node.paren_token,
+        args: crate::punctuated::fold(node.args, f, F::fold_expr),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_expr_cast<F>(f: &mut F, node: crate::ExprCast) -> crate::ExprCast
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprCast {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        expr: Box::new(f.fold_expr(*node.expr)),
+        as_token: node.as_token,
+        ty: Box::new(f.fold_type(*node.ty)),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_closure<F>(f: &mut F, node: crate::ExprClosure) -> crate::ExprClosure
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprClosure {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        lifetimes: (node.lifetimes).map(|it| f.fold_bound_lifetimes(it)),
+        constness: node.constness,
+        movability: node.movability,
+        asyncness: node.asyncness,
+        capture: node.capture,
+        or1_token: node.or1_token,
+        inputs: crate::punctuated::fold(node.inputs, f, F::fold_pat),
+        or2_token: node.or2_token,
+        output: f.fold_return_type(node.output),
+        body: Box::new(f.fold_expr(*node.body)),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_const<F>(f: &mut F, node: crate::ExprConst) -> crate::ExprConst
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprConst {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        const_token: node.const_token,
+        block: f.fold_block(node.block),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_continue<F>(f: &mut F, node: crate::ExprContinue) -> crate::ExprContinue
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprContinue {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        continue_token: node.continue_token,
+        label: (node.label).map(|it| f.fold_lifetime(it)),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_expr_field<F>(f: &mut F, node: crate::ExprField) -> crate::ExprField
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprField {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        base: Box::new(f.fold_expr(*node.base)),
+        dot_token: node.dot_token,
+        member: f.fold_member(node.member),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_for_loop<F>(f: &mut F, node: crate::ExprForLoop) -> crate::ExprForLoop
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprForLoop {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        label: (node.label).map(|it| f.fold_label(it)),
+        for_token: node.for_token,
+        pat: Box::new(f.fold_pat(*node.pat)),
+        in_token: node.in_token,
+        expr: Box::new(f.fold_expr(*node.expr)),
+        body: f.fold_block(node.body),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_expr_group<F>(f: &mut F, node: crate::ExprGroup) -> crate::ExprGroup
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprGroup {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        group_token: node.group_token,
+        expr: Box::new(f.fold_expr(*node.expr)),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_if<F>(f: &mut F, node: crate::ExprIf) -> crate::ExprIf
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprIf {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        if_token: node.if_token,
+        cond: Box::new(f.fold_expr(*node.cond)),
+        then_branch: f.fold_block(node.then_branch),
+        else_branch: (node.else_branch)
+            .map(|it| ((it).0, Box::new(f.fold_expr(*(it).1)))),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_expr_index<F>(f: &mut F, node: crate::ExprIndex) -> crate::ExprIndex
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprIndex {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        expr: Box::new(f.fold_expr(*node.expr)),
+        bracket_token: node.bracket_token,
+        index: Box::new(f.fold_expr(*node.index)),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_infer<F>(f: &mut F, node: crate::ExprInfer) -> crate::ExprInfer
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprInfer {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        underscore_token: node.underscore_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_let<F>(f: &mut F, node: crate::ExprLet) -> crate::ExprLet
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprLet {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        let_token: node.let_token,
+        pat: Box::new(f.fold_pat(*node.pat)),
+        eq_token: node.eq_token,
+        expr: Box::new(f.fold_expr(*node.expr)),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_expr_lit<F>(f: &mut F, node: crate::ExprLit) -> crate::ExprLit
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprLit {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        lit: f.fold_lit(node.lit),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_loop<F>(f: &mut F, node: crate::ExprLoop) -> crate::ExprLoop
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprLoop {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        label: (node.label).map(|it| f.fold_label(it)),
+        loop_token: node.loop_token,
+        body: f.fold_block(node.body),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_expr_macro<F>(f: &mut F, node: crate::ExprMacro) -> crate::ExprMacro
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprMacro {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        mac: f.fold_macro(node.mac),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_match<F>(f: &mut F, node: crate::ExprMatch) -> crate::ExprMatch
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprMatch {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        match_token: node.match_token,
+        expr: Box::new(f.fold_expr(*node.expr)),
+        brace_token: node.brace_token,
+        arms: fold_vec(node.arms, f, F::fold_arm),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_expr_method_call<F>(
+    f: &mut F,
+    node: crate::ExprMethodCall,
+) -> crate::ExprMethodCall
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprMethodCall {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        receiver: Box::new(f.fold_expr(*node.receiver)),
+        dot_token: node.dot_token,
+        method: f.fold_ident(node.method),
+        turbofish: (node.turbofish)
+            .map(|it| f.fold_angle_bracketed_generic_arguments(it)),
+        paren_token: node.paren_token,
+        args: crate::punctuated::fold(node.args, f, F::fold_expr),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_expr_paren<F>(f: &mut F, node: crate::ExprParen) -> crate::ExprParen
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprParen {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        paren_token: node.paren_token,
+        expr: Box::new(f.fold_expr(*node.expr)),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_expr_path<F>(f: &mut F, node: crate::ExprPath) -> crate::ExprPath
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprPath {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        qself: (node.qself).map(|it| f.fold_qself(it)),
+        path: f.fold_path(node.path),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_range<F>(f: &mut F, node: crate::ExprRange) -> crate::ExprRange
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprRange {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        start: (node.start).map(|it| Box::new(f.fold_expr(*it))),
+        limits: f.fold_range_limits(node.limits),
+        end: (node.end).map(|it| Box::new(f.fold_expr(*it))),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_expr_reference<F>(
+    f: &mut F,
+    node: crate::ExprReference,
+) -> crate::ExprReference
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprReference {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        and_token: node.and_token,
+        mutability: node.mutability,
+        expr: Box::new(f.fold_expr(*node.expr)),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_repeat<F>(f: &mut F, node: crate::ExprRepeat) -> crate::ExprRepeat
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprRepeat {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        bracket_token: node.bracket_token,
+        expr: Box::new(f.fold_expr(*node.expr)),
+        semi_token: node.semi_token,
+        len: Box::new(f.fold_expr(*node.len)),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_return<F>(f: &mut F, node: crate::ExprReturn) -> crate::ExprReturn
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprReturn {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        return_token: node.return_token,
+        expr: (node.expr).map(|it| Box::new(f.fold_expr(*it))),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_expr_struct<F>(f: &mut F, node: crate::ExprStruct) -> crate::ExprStruct
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprStruct {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        qself: (node.qself).map(|it| f.fold_qself(it)),
+        path: f.fold_path(node.path),
+        brace_token: node.brace_token,
+        fields: crate::punctuated::fold(node.fields, f, F::fold_field_value),
+        dot2_token: node.dot2_token,
+        rest: (node.rest).map(|it| Box::new(f.fold_expr(*it))),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_try<F>(f: &mut F, node: crate::ExprTry) -> crate::ExprTry
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprTry {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        expr: Box::new(f.fold_expr(*node.expr)),
+        question_token: node.question_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_try_block<F>(
+    f: &mut F,
+    node: crate::ExprTryBlock,
+) -> crate::ExprTryBlock
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprTryBlock {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        try_token: node.try_token,
+        block: f.fold_block(node.block),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_tuple<F>(f: &mut F, node: crate::ExprTuple) -> crate::ExprTuple
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprTuple {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        paren_token: node.paren_token,
+        elems: crate::punctuated::fold(node.elems, f, F::fold_expr),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_expr_unary<F>(f: &mut F, node: crate::ExprUnary) -> crate::ExprUnary
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprUnary {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        op: f.fold_un_op(node.op),
+        expr: Box::new(f.fold_expr(*node.expr)),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_unsafe<F>(f: &mut F, node: crate::ExprUnsafe) -> crate::ExprUnsafe
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprUnsafe {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        unsafe_token: node.unsafe_token,
+        block: f.fold_block(node.block),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_while<F>(f: &mut F, node: crate::ExprWhile) -> crate::ExprWhile
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprWhile {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        label: (node.label).map(|it| f.fold_label(it)),
+        while_token: node.while_token,
+        cond: Box::new(f.fold_expr(*node.cond)),
+        body: f.fold_block(node.body),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_expr_yield<F>(f: &mut F, node: crate::ExprYield) -> crate::ExprYield
+where
+    F: Fold + ?Sized,
+{
+    crate::ExprYield {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        yield_token: node.yield_token,
+        expr: (node.expr).map(|it| Box::new(f.fold_expr(*it))),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_field<F>(f: &mut F, node: crate::Field) -> crate::Field
+where
+    F: Fold + ?Sized,
+{
+    crate::Field {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        vis: f.fold_visibility(node.vis),
+        mutability: f.fold_field_mutability(node.mutability),
+        ident: (node.ident).map(|it| f.fold_ident(it)),
+        colon_token: node.colon_token,
+        ty: f.fold_type(node.ty),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_field_mutability<F>(
+    f: &mut F,
+    node: crate::FieldMutability,
+) -> crate::FieldMutability
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::FieldMutability::None => crate::FieldMutability::None,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_field_pat<F>(f: &mut F, node: crate::FieldPat) -> crate::FieldPat
+where
+    F: Fold + ?Sized,
+{
+    crate::FieldPat {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        member: f.fold_member(node.member),
+        colon_token: node.colon_token,
+        pat: Box::new(f.fold_pat(*node.pat)),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_field_value<F>(f: &mut F, node: crate::FieldValue) -> crate::FieldValue
+where
+    F: Fold + ?Sized,
+{
+    crate::FieldValue {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        member: f.fold_member(node.member),
+        colon_token: node.colon_token,
+        expr: f.fold_expr(node.expr),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_fields<F>(f: &mut F, node: crate::Fields) -> crate::Fields
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::Fields::Named(_binding_0) => {
+            crate::Fields::Named(f.fold_fields_named(_binding_0))
+        }
+        crate::Fields::Unnamed(_binding_0) => {
+            crate::Fields::Unnamed(f.fold_fields_unnamed(_binding_0))
+        }
+        crate::Fields::Unit => crate::Fields::Unit,
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_fields_named<F>(f: &mut F, node: crate::FieldsNamed) -> crate::FieldsNamed
+where
+    F: Fold + ?Sized,
+{
+    crate::FieldsNamed {
+        brace_token: node.brace_token,
+        named: crate::punctuated::fold(node.named, f, F::fold_field),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_fields_unnamed<F>(
+    f: &mut F,
+    node: crate::FieldsUnnamed,
+) -> crate::FieldsUnnamed
+where
+    F: Fold + ?Sized,
+{
+    crate::FieldsUnnamed {
+        paren_token: node.paren_token,
+        unnamed: crate::punctuated::fold(node.unnamed, f, F::fold_field),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_file<F>(f: &mut F, node: crate::File) -> crate::File
+where
+    F: Fold + ?Sized,
+{
+    crate::File {
+        shebang: node.shebang,
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        items: fold_vec(node.items, f, F::fold_item),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_fn_arg<F>(f: &mut F, node: crate::FnArg) -> crate::FnArg
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::FnArg::Receiver(_binding_0) => {
+            crate::FnArg::Receiver(f.fold_receiver(_binding_0))
+        }
+        crate::FnArg::Typed(_binding_0) => {
+            crate::FnArg::Typed(f.fold_pat_type(_binding_0))
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_foreign_item<F>(f: &mut F, node: crate::ForeignItem) -> crate::ForeignItem
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::ForeignItem::Fn(_binding_0) => {
+            crate::ForeignItem::Fn(f.fold_foreign_item_fn(_binding_0))
+        }
+        crate::ForeignItem::Static(_binding_0) => {
+            crate::ForeignItem::Static(f.fold_foreign_item_static(_binding_0))
+        }
+        crate::ForeignItem::Type(_binding_0) => {
+            crate::ForeignItem::Type(f.fold_foreign_item_type(_binding_0))
+        }
+        crate::ForeignItem::Macro(_binding_0) => {
+            crate::ForeignItem::Macro(f.fold_foreign_item_macro(_binding_0))
+        }
+        crate::ForeignItem::Verbatim(_binding_0) => {
+            crate::ForeignItem::Verbatim(_binding_0)
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_foreign_item_fn<F>(
+    f: &mut F,
+    node: crate::ForeignItemFn,
+) -> crate::ForeignItemFn
+where
+    F: Fold + ?Sized,
+{
+    crate::ForeignItemFn {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        vis: f.fold_visibility(node.vis),
+        sig: f.fold_signature(node.sig),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_foreign_item_macro<F>(
+    f: &mut F,
+    node: crate::ForeignItemMacro,
+) -> crate::ForeignItemMacro
+where
+    F: Fold + ?Sized,
+{
+    crate::ForeignItemMacro {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        mac: f.fold_macro(node.mac),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_foreign_item_static<F>(
+    f: &mut F,
+    node: crate::ForeignItemStatic,
+) -> crate::ForeignItemStatic
+where
+    F: Fold + ?Sized,
+{
+    crate::ForeignItemStatic {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        vis: f.fold_visibility(node.vis),
+        static_token: node.static_token,
+        mutability: f.fold_static_mutability(node.mutability),
+        ident: f.fold_ident(node.ident),
+        colon_token: node.colon_token,
+        ty: Box::new(f.fold_type(*node.ty)),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_foreign_item_type<F>(
+    f: &mut F,
+    node: crate::ForeignItemType,
+) -> crate::ForeignItemType
+where
+    F: Fold + ?Sized,
+{
+    crate::ForeignItemType {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        vis: f.fold_visibility(node.vis),
+        type_token: node.type_token,
+        ident: f.fold_ident(node.ident),
+        generics: f.fold_generics(node.generics),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_generic_argument<F>(
+    f: &mut F,
+    node: crate::GenericArgument,
+) -> crate::GenericArgument
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::GenericArgument::Lifetime(_binding_0) => {
+            crate::GenericArgument::Lifetime(f.fold_lifetime(_binding_0))
+        }
+        crate::GenericArgument::Type(_binding_0) => {
+            crate::GenericArgument::Type(f.fold_type(_binding_0))
+        }
+        crate::GenericArgument::Const(_binding_0) => {
+            crate::GenericArgument::Const(f.fold_expr(_binding_0))
+        }
+        crate::GenericArgument::AssocType(_binding_0) => {
+            crate::GenericArgument::AssocType(f.fold_assoc_type(_binding_0))
+        }
+        crate::GenericArgument::AssocConst(_binding_0) => {
+            crate::GenericArgument::AssocConst(f.fold_assoc_const(_binding_0))
+        }
+        crate::GenericArgument::Constraint(_binding_0) => {
+            crate::GenericArgument::Constraint(f.fold_constraint(_binding_0))
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_generic_param<F>(f: &mut F, node: crate::GenericParam) -> crate::GenericParam
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::GenericParam::Lifetime(_binding_0) => {
+            crate::GenericParam::Lifetime(f.fold_lifetime_param(_binding_0))
+        }
+        crate::GenericParam::Type(_binding_0) => {
+            crate::GenericParam::Type(f.fold_type_param(_binding_0))
+        }
+        crate::GenericParam::Const(_binding_0) => {
+            crate::GenericParam::Const(f.fold_const_param(_binding_0))
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_generics<F>(f: &mut F, node: crate::Generics) -> crate::Generics
+where
+    F: Fold + ?Sized,
+{
+    crate::Generics {
+        lt_token: node.lt_token,
+        params: crate::punctuated::fold(node.params, f, F::fold_generic_param),
+        gt_token: node.gt_token,
+        where_clause: (node.where_clause).map(|it| f.fold_where_clause(it)),
+    }
+}
+pub fn fold_ident<F>(f: &mut F, node: proc_macro2::Ident) -> proc_macro2::Ident
+where
+    F: Fold + ?Sized,
+{
+    let mut node = node;
+    let span = f.fold_span(node.span());
+    node.set_span(span);
+    node
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_impl_item<F>(f: &mut F, node: crate::ImplItem) -> crate::ImplItem
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::ImplItem::Const(_binding_0) => {
+            crate::ImplItem::Const(f.fold_impl_item_const(_binding_0))
+        }
+        crate::ImplItem::Fn(_binding_0) => {
+            crate::ImplItem::Fn(f.fold_impl_item_fn(_binding_0))
+        }
+        crate::ImplItem::Type(_binding_0) => {
+            crate::ImplItem::Type(f.fold_impl_item_type(_binding_0))
+        }
+        crate::ImplItem::Macro(_binding_0) => {
+            crate::ImplItem::Macro(f.fold_impl_item_macro(_binding_0))
+        }
+        crate::ImplItem::Verbatim(_binding_0) => crate::ImplItem::Verbatim(_binding_0),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_impl_item_const<F>(
+    f: &mut F,
+    node: crate::ImplItemConst,
+) -> crate::ImplItemConst
+where
+    F: Fold + ?Sized,
+{
+    crate::ImplItemConst {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        vis: f.fold_visibility(node.vis),
+        defaultness: node.defaultness,
+        const_token: node.const_token,
+        ident: f.fold_ident(node.ident),
+        generics: f.fold_generics(node.generics),
+        colon_token: node.colon_token,
+        ty: f.fold_type(node.ty),
+        eq_token: node.eq_token,
+        expr: f.fold_expr(node.expr),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_impl_item_fn<F>(f: &mut F, node: crate::ImplItemFn) -> crate::ImplItemFn
+where
+    F: Fold + ?Sized,
+{
+    crate::ImplItemFn {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        vis: f.fold_visibility(node.vis),
+        defaultness: node.defaultness,
+        sig: f.fold_signature(node.sig),
+        block: f.fold_block(node.block),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_impl_item_macro<F>(
+    f: &mut F,
+    node: crate::ImplItemMacro,
+) -> crate::ImplItemMacro
+where
+    F: Fold + ?Sized,
+{
+    crate::ImplItemMacro {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        mac: f.fold_macro(node.mac),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_impl_item_type<F>(
+    f: &mut F,
+    node: crate::ImplItemType,
+) -> crate::ImplItemType
+where
+    F: Fold + ?Sized,
+{
+    crate::ImplItemType {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        vis: f.fold_visibility(node.vis),
+        defaultness: node.defaultness,
+        type_token: node.type_token,
+        ident: f.fold_ident(node.ident),
+        generics: f.fold_generics(node.generics),
+        eq_token: node.eq_token,
+        ty: f.fold_type(node.ty),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_impl_restriction<F>(
+    f: &mut F,
+    node: crate::ImplRestriction,
+) -> crate::ImplRestriction
+where
+    F: Fold + ?Sized,
+{
+    match node {}
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_index<F>(f: &mut F, node: crate::Index) -> crate::Index
+where
+    F: Fold + ?Sized,
+{
+    crate::Index {
+        index: node.index,
+        span: f.fold_span(node.span),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_item<F>(f: &mut F, node: crate::Item) -> crate::Item
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::Item::Const(_binding_0) => {
+            crate::Item::Const(f.fold_item_const(_binding_0))
+        }
+        crate::Item::Enum(_binding_0) => crate::Item::Enum(f.fold_item_enum(_binding_0)),
+        crate::Item::ExternCrate(_binding_0) => {
+            crate::Item::ExternCrate(f.fold_item_extern_crate(_binding_0))
+        }
+        crate::Item::Fn(_binding_0) => crate::Item::Fn(f.fold_item_fn(_binding_0)),
+        crate::Item::ForeignMod(_binding_0) => {
+            crate::Item::ForeignMod(f.fold_item_foreign_mod(_binding_0))
+        }
+        crate::Item::Impl(_binding_0) => crate::Item::Impl(f.fold_item_impl(_binding_0)),
+        crate::Item::Macro(_binding_0) => {
+            crate::Item::Macro(f.fold_item_macro(_binding_0))
+        }
+        crate::Item::Mod(_binding_0) => crate::Item::Mod(f.fold_item_mod(_binding_0)),
+        crate::Item::Static(_binding_0) => {
+            crate::Item::Static(f.fold_item_static(_binding_0))
+        }
+        crate::Item::Struct(_binding_0) => {
+            crate::Item::Struct(f.fold_item_struct(_binding_0))
+        }
+        crate::Item::Trait(_binding_0) => {
+            crate::Item::Trait(f.fold_item_trait(_binding_0))
+        }
+        crate::Item::TraitAlias(_binding_0) => {
+            crate::Item::TraitAlias(f.fold_item_trait_alias(_binding_0))
+        }
+        crate::Item::Type(_binding_0) => crate::Item::Type(f.fold_item_type(_binding_0)),
+        crate::Item::Union(_binding_0) => {
+            crate::Item::Union(f.fold_item_union(_binding_0))
+        }
+        crate::Item::Use(_binding_0) => crate::Item::Use(f.fold_item_use(_binding_0)),
+        crate::Item::Verbatim(_binding_0) => crate::Item::Verbatim(_binding_0),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_item_const<F>(f: &mut F, node: crate::ItemConst) -> crate::ItemConst
+where
+    F: Fold + ?Sized,
+{
+    crate::ItemConst {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        vis: f.fold_visibility(node.vis),
+        const_token: node.const_token,
+        ident: f.fold_ident(node.ident),
+        generics: f.fold_generics(node.generics),
+        colon_token: node.colon_token,
+        ty: Box::new(f.fold_type(*node.ty)),
+        eq_token: node.eq_token,
+        expr: Box::new(f.fold_expr(*node.expr)),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_item_enum<F>(f: &mut F, node: crate::ItemEnum) -> crate::ItemEnum
+where
+    F: Fold + ?Sized,
+{
+    crate::ItemEnum {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        vis: f.fold_visibility(node.vis),
+        enum_token: node.enum_token,
+        ident: f.fold_ident(node.ident),
+        generics: f.fold_generics(node.generics),
+        brace_token: node.brace_token,
+        variants: crate::punctuated::fold(node.variants, f, F::fold_variant),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_item_extern_crate<F>(
+    f: &mut F,
+    node: crate::ItemExternCrate,
+) -> crate::ItemExternCrate
+where
+    F: Fold + ?Sized,
+{
+    crate::ItemExternCrate {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        vis: f.fold_visibility(node.vis),
+        extern_token: node.extern_token,
+        crate_token: node.crate_token,
+        ident: f.fold_ident(node.ident),
+        rename: (node.rename).map(|it| ((it).0, f.fold_ident((it).1))),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_item_fn<F>(f: &mut F, node: crate::ItemFn) -> crate::ItemFn
+where
+    F: Fold + ?Sized,
+{
+    crate::ItemFn {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        vis: f.fold_visibility(node.vis),
+        sig: f.fold_signature(node.sig),
+        block: Box::new(f.fold_block(*node.block)),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_item_foreign_mod<F>(
+    f: &mut F,
+    node: crate::ItemForeignMod,
+) -> crate::ItemForeignMod
+where
+    F: Fold + ?Sized,
+{
+    crate::ItemForeignMod {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        unsafety: node.unsafety,
+        abi: f.fold_abi(node.abi),
+        brace_token: node.brace_token,
+        items: fold_vec(node.items, f, F::fold_foreign_item),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_item_impl<F>(f: &mut F, node: crate::ItemImpl) -> crate::ItemImpl
+where
+    F: Fold + ?Sized,
+{
+    crate::ItemImpl {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        defaultness: node.defaultness,
+        unsafety: node.unsafety,
+        impl_token: node.impl_token,
+        generics: f.fold_generics(node.generics),
+        trait_: (node.trait_).map(|it| ((it).0, f.fold_path((it).1), (it).2)),
+        self_ty: Box::new(f.fold_type(*node.self_ty)),
+        brace_token: node.brace_token,
+        items: fold_vec(node.items, f, F::fold_impl_item),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_item_macro<F>(f: &mut F, node: crate::ItemMacro) -> crate::ItemMacro
+where
+    F: Fold + ?Sized,
+{
+    crate::ItemMacro {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        ident: (node.ident).map(|it| f.fold_ident(it)),
+        mac: f.fold_macro(node.mac),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_item_mod<F>(f: &mut F, node: crate::ItemMod) -> crate::ItemMod
+where
+    F: Fold + ?Sized,
+{
+    crate::ItemMod {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        vis: f.fold_visibility(node.vis),
+        unsafety: node.unsafety,
+        mod_token: node.mod_token,
+        ident: f.fold_ident(node.ident),
+        content: (node.content).map(|it| ((it).0, fold_vec((it).1, f, F::fold_item))),
+        semi: node.semi,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_item_static<F>(f: &mut F, node: crate::ItemStatic) -> crate::ItemStatic
+where
+    F: Fold + ?Sized,
+{
+    crate::ItemStatic {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        vis: f.fold_visibility(node.vis),
+        static_token: node.static_token,
+        mutability: f.fold_static_mutability(node.mutability),
+        ident: f.fold_ident(node.ident),
+        colon_token: node.colon_token,
+        ty: Box::new(f.fold_type(*node.ty)),
+        eq_token: node.eq_token,
+        expr: Box::new(f.fold_expr(*node.expr)),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_item_struct<F>(f: &mut F, node: crate::ItemStruct) -> crate::ItemStruct
+where
+    F: Fold + ?Sized,
+{
+    crate::ItemStruct {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        vis: f.fold_visibility(node.vis),
+        struct_token: node.struct_token,
+        ident: f.fold_ident(node.ident),
+        generics: f.fold_generics(node.generics),
+        fields: f.fold_fields(node.fields),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_item_trait<F>(f: &mut F, node: crate::ItemTrait) -> crate::ItemTrait
+where
+    F: Fold + ?Sized,
+{
+    crate::ItemTrait {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        vis: f.fold_visibility(node.vis),
+        unsafety: node.unsafety,
+        auto_token: node.auto_token,
+        restriction: (node.restriction).map(|it| f.fold_impl_restriction(it)),
+        trait_token: node.trait_token,
+        ident: f.fold_ident(node.ident),
+        generics: f.fold_generics(node.generics),
+        colon_token: node.colon_token,
+        supertraits: crate::punctuated::fold(
+            node.supertraits,
+            f,
+            F::fold_type_param_bound,
+        ),
+        brace_token: node.brace_token,
+        items: fold_vec(node.items, f, F::fold_trait_item),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_item_trait_alias<F>(
+    f: &mut F,
+    node: crate::ItemTraitAlias,
+) -> crate::ItemTraitAlias
+where
+    F: Fold + ?Sized,
+{
+    crate::ItemTraitAlias {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        vis: f.fold_visibility(node.vis),
+        trait_token: node.trait_token,
+        ident: f.fold_ident(node.ident),
+        generics: f.fold_generics(node.generics),
+        eq_token: node.eq_token,
+        bounds: crate::punctuated::fold(node.bounds, f, F::fold_type_param_bound),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_item_type<F>(f: &mut F, node: crate::ItemType) -> crate::ItemType
+where
+    F: Fold + ?Sized,
+{
+    crate::ItemType {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        vis: f.fold_visibility(node.vis),
+        type_token: node.type_token,
+        ident: f.fold_ident(node.ident),
+        generics: f.fold_generics(node.generics),
+        eq_token: node.eq_token,
+        ty: Box::new(f.fold_type(*node.ty)),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_item_union<F>(f: &mut F, node: crate::ItemUnion) -> crate::ItemUnion
+where
+    F: Fold + ?Sized,
+{
+    crate::ItemUnion {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        vis: f.fold_visibility(node.vis),
+        union_token: node.union_token,
+        ident: f.fold_ident(node.ident),
+        generics: f.fold_generics(node.generics),
+        fields: f.fold_fields_named(node.fields),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_item_use<F>(f: &mut F, node: crate::ItemUse) -> crate::ItemUse
+where
+    F: Fold + ?Sized,
+{
+    crate::ItemUse {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        vis: f.fold_visibility(node.vis),
+        use_token: node.use_token,
+        leading_colon: node.leading_colon,
+        tree: f.fold_use_tree(node.tree),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_label<F>(f: &mut F, node: crate::Label) -> crate::Label
+where
+    F: Fold + ?Sized,
+{
+    crate::Label {
+        name: f.fold_lifetime(node.name),
+        colon_token: node.colon_token,
+    }
+}
+pub fn fold_lifetime<F>(f: &mut F, node: crate::Lifetime) -> crate::Lifetime
+where
+    F: Fold + ?Sized,
+{
+    crate::Lifetime {
+        apostrophe: f.fold_span(node.apostrophe),
+        ident: f.fold_ident(node.ident),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_lifetime_param<F>(
+    f: &mut F,
+    node: crate::LifetimeParam,
+) -> crate::LifetimeParam
+where
+    F: Fold + ?Sized,
+{
+    crate::LifetimeParam {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        lifetime: f.fold_lifetime(node.lifetime),
+        colon_token: node.colon_token,
+        bounds: crate::punctuated::fold(node.bounds, f, F::fold_lifetime),
+    }
+}
+pub fn fold_lit<F>(f: &mut F, node: crate::Lit) -> crate::Lit
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::Lit::Str(_binding_0) => crate::Lit::Str(f.fold_lit_str(_binding_0)),
+        crate::Lit::ByteStr(_binding_0) => {
+            crate::Lit::ByteStr(f.fold_lit_byte_str(_binding_0))
+        }
+        crate::Lit::CStr(_binding_0) => crate::Lit::CStr(f.fold_lit_cstr(_binding_0)),
+        crate::Lit::Byte(_binding_0) => crate::Lit::Byte(f.fold_lit_byte(_binding_0)),
+        crate::Lit::Char(_binding_0) => crate::Lit::Char(f.fold_lit_char(_binding_0)),
+        crate::Lit::Int(_binding_0) => crate::Lit::Int(f.fold_lit_int(_binding_0)),
+        crate::Lit::Float(_binding_0) => crate::Lit::Float(f.fold_lit_float(_binding_0)),
+        crate::Lit::Bool(_binding_0) => crate::Lit::Bool(f.fold_lit_bool(_binding_0)),
+        crate::Lit::Verbatim(_binding_0) => crate::Lit::Verbatim(_binding_0),
+    }
+}
+pub fn fold_lit_bool<F>(f: &mut F, node: crate::LitBool) -> crate::LitBool
+where
+    F: Fold + ?Sized,
+{
+    crate::LitBool {
+        value: node.value,
+        span: f.fold_span(node.span),
+    }
+}
+pub fn fold_lit_byte<F>(f: &mut F, node: crate::LitByte) -> crate::LitByte
+where
+    F: Fold + ?Sized,
+{
+    let span = f.fold_span(node.span());
+    let mut node = node;
+    node.set_span(span);
+    node
+}
+pub fn fold_lit_byte_str<F>(f: &mut F, node: crate::LitByteStr) -> crate::LitByteStr
+where
+    F: Fold + ?Sized,
+{
+    let span = f.fold_span(node.span());
+    let mut node = node;
+    node.set_span(span);
+    node
+}
+pub fn fold_lit_cstr<F>(f: &mut F, node: crate::LitCStr) -> crate::LitCStr
+where
+    F: Fold + ?Sized,
+{
+    let span = f.fold_span(node.span());
+    let mut node = node;
+    node.set_span(span);
+    node
+}
+pub fn fold_lit_char<F>(f: &mut F, node: crate::LitChar) -> crate::LitChar
+where
+    F: Fold + ?Sized,
+{
+    let span = f.fold_span(node.span());
+    let mut node = node;
+    node.set_span(span);
+    node
+}
+pub fn fold_lit_float<F>(f: &mut F, node: crate::LitFloat) -> crate::LitFloat
+where
+    F: Fold + ?Sized,
+{
+    let span = f.fold_span(node.span());
+    let mut node = node;
+    node.set_span(span);
+    node
+}
+pub fn fold_lit_int<F>(f: &mut F, node: crate::LitInt) -> crate::LitInt
+where
+    F: Fold + ?Sized,
+{
+    let span = f.fold_span(node.span());
+    let mut node = node;
+    node.set_span(span);
+    node
+}
+pub fn fold_lit_str<F>(f: &mut F, node: crate::LitStr) -> crate::LitStr
+where
+    F: Fold + ?Sized,
+{
+    let span = f.fold_span(node.span());
+    let mut node = node;
+    node.set_span(span);
+    node
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_local<F>(f: &mut F, node: crate::Local) -> crate::Local
+where
+    F: Fold + ?Sized,
+{
+    crate::Local {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        let_token: node.let_token,
+        pat: f.fold_pat(node.pat),
+        init: (node.init).map(|it| f.fold_local_init(it)),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_local_init<F>(f: &mut F, node: crate::LocalInit) -> crate::LocalInit
+where
+    F: Fold + ?Sized,
+{
+    crate::LocalInit {
+        eq_token: node.eq_token,
+        expr: Box::new(f.fold_expr(*node.expr)),
+        diverge: (node.diverge).map(|it| ((it).0, Box::new(f.fold_expr(*(it).1)))),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_macro<F>(f: &mut F, node: crate::Macro) -> crate::Macro
+where
+    F: Fold + ?Sized,
+{
+    crate::Macro {
+        path: f.fold_path(node.path),
+        bang_token: node.bang_token,
+        delimiter: f.fold_macro_delimiter(node.delimiter),
+        tokens: node.tokens,
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_macro_delimiter<F>(
+    f: &mut F,
+    node: crate::MacroDelimiter,
+) -> crate::MacroDelimiter
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::MacroDelimiter::Paren(_binding_0) => {
+            crate::MacroDelimiter::Paren(_binding_0)
+        }
+        crate::MacroDelimiter::Brace(_binding_0) => {
+            crate::MacroDelimiter::Brace(_binding_0)
+        }
+        crate::MacroDelimiter::Bracket(_binding_0) => {
+            crate::MacroDelimiter::Bracket(_binding_0)
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_member<F>(f: &mut F, node: crate::Member) -> crate::Member
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::Member::Named(_binding_0) => {
+            crate::Member::Named(f.fold_ident(_binding_0))
+        }
+        crate::Member::Unnamed(_binding_0) => {
+            crate::Member::Unnamed(f.fold_index(_binding_0))
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_meta<F>(f: &mut F, node: crate::Meta) -> crate::Meta
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::Meta::Path(_binding_0) => crate::Meta::Path(f.fold_path(_binding_0)),
+        crate::Meta::List(_binding_0) => crate::Meta::List(f.fold_meta_list(_binding_0)),
+        crate::Meta::NameValue(_binding_0) => {
+            crate::Meta::NameValue(f.fold_meta_name_value(_binding_0))
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_meta_list<F>(f: &mut F, node: crate::MetaList) -> crate::MetaList
+where
+    F: Fold + ?Sized,
+{
+    crate::MetaList {
+        path: f.fold_path(node.path),
+        delimiter: f.fold_macro_delimiter(node.delimiter),
+        tokens: node.tokens,
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_meta_name_value<F>(
+    f: &mut F,
+    node: crate::MetaNameValue,
+) -> crate::MetaNameValue
+where
+    F: Fold + ?Sized,
+{
+    crate::MetaNameValue {
+        path: f.fold_path(node.path),
+        eq_token: node.eq_token,
+        value: f.fold_expr(node.value),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_parenthesized_generic_arguments<F>(
+    f: &mut F,
+    node: crate::ParenthesizedGenericArguments,
+) -> crate::ParenthesizedGenericArguments
+where
+    F: Fold + ?Sized,
+{
+    crate::ParenthesizedGenericArguments {
+        paren_token: node.paren_token,
+        inputs: crate::punctuated::fold(node.inputs, f, F::fold_type),
+        output: f.fold_return_type(node.output),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_pat<F>(f: &mut F, node: crate::Pat) -> crate::Pat
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::Pat::Const(_binding_0) => crate::Pat::Const(f.fold_expr_const(_binding_0)),
+        crate::Pat::Ident(_binding_0) => crate::Pat::Ident(f.fold_pat_ident(_binding_0)),
+        crate::Pat::Lit(_binding_0) => crate::Pat::Lit(f.fold_expr_lit(_binding_0)),
+        crate::Pat::Macro(_binding_0) => crate::Pat::Macro(f.fold_expr_macro(_binding_0)),
+        crate::Pat::Or(_binding_0) => crate::Pat::Or(f.fold_pat_or(_binding_0)),
+        crate::Pat::Paren(_binding_0) => crate::Pat::Paren(f.fold_pat_paren(_binding_0)),
+        crate::Pat::Path(_binding_0) => crate::Pat::Path(f.fold_expr_path(_binding_0)),
+        crate::Pat::Range(_binding_0) => crate::Pat::Range(f.fold_expr_range(_binding_0)),
+        crate::Pat::Reference(_binding_0) => {
+            crate::Pat::Reference(f.fold_pat_reference(_binding_0))
+        }
+        crate::Pat::Rest(_binding_0) => crate::Pat::Rest(f.fold_pat_rest(_binding_0)),
+        crate::Pat::Slice(_binding_0) => crate::Pat::Slice(f.fold_pat_slice(_binding_0)),
+        crate::Pat::Struct(_binding_0) => {
+            crate::Pat::Struct(f.fold_pat_struct(_binding_0))
+        }
+        crate::Pat::Tuple(_binding_0) => crate::Pat::Tuple(f.fold_pat_tuple(_binding_0)),
+        crate::Pat::TupleStruct(_binding_0) => {
+            crate::Pat::TupleStruct(f.fold_pat_tuple_struct(_binding_0))
+        }
+        crate::Pat::Type(_binding_0) => crate::Pat::Type(f.fold_pat_type(_binding_0)),
+        crate::Pat::Verbatim(_binding_0) => crate::Pat::Verbatim(_binding_0),
+        crate::Pat::Wild(_binding_0) => crate::Pat::Wild(f.fold_pat_wild(_binding_0)),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_pat_ident<F>(f: &mut F, node: crate::PatIdent) -> crate::PatIdent
+where
+    F: Fold + ?Sized,
+{
+    crate::PatIdent {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        by_ref: node.by_ref,
+        mutability: node.mutability,
+        ident: f.fold_ident(node.ident),
+        subpat: (node.subpat).map(|it| ((it).0, Box::new(f.fold_pat(*(it).1)))),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_pat_or<F>(f: &mut F, node: crate::PatOr) -> crate::PatOr
+where
+    F: Fold + ?Sized,
+{
+    crate::PatOr {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        leading_vert: node.leading_vert,
+        cases: crate::punctuated::fold(node.cases, f, F::fold_pat),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_pat_paren<F>(f: &mut F, node: crate::PatParen) -> crate::PatParen
+where
+    F: Fold + ?Sized,
+{
+    crate::PatParen {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        paren_token: node.paren_token,
+        pat: Box::new(f.fold_pat(*node.pat)),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_pat_reference<F>(f: &mut F, node: crate::PatReference) -> crate::PatReference
+where
+    F: Fold + ?Sized,
+{
+    crate::PatReference {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        and_token: node.and_token,
+        mutability: node.mutability,
+        pat: Box::new(f.fold_pat(*node.pat)),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_pat_rest<F>(f: &mut F, node: crate::PatRest) -> crate::PatRest
+where
+    F: Fold + ?Sized,
+{
+    crate::PatRest {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        dot2_token: node.dot2_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_pat_slice<F>(f: &mut F, node: crate::PatSlice) -> crate::PatSlice
+where
+    F: Fold + ?Sized,
+{
+    crate::PatSlice {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        bracket_token: node.bracket_token,
+        elems: crate::punctuated::fold(node.elems, f, F::fold_pat),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_pat_struct<F>(f: &mut F, node: crate::PatStruct) -> crate::PatStruct
+where
+    F: Fold + ?Sized,
+{
+    crate::PatStruct {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        qself: (node.qself).map(|it| f.fold_qself(it)),
+        path: f.fold_path(node.path),
+        brace_token: node.brace_token,
+        fields: crate::punctuated::fold(node.fields, f, F::fold_field_pat),
+        rest: (node.rest).map(|it| f.fold_pat_rest(it)),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_pat_tuple<F>(f: &mut F, node: crate::PatTuple) -> crate::PatTuple
+where
+    F: Fold + ?Sized,
+{
+    crate::PatTuple {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        paren_token: node.paren_token,
+        elems: crate::punctuated::fold(node.elems, f, F::fold_pat),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_pat_tuple_struct<F>(
+    f: &mut F,
+    node: crate::PatTupleStruct,
+) -> crate::PatTupleStruct
+where
+    F: Fold + ?Sized,
+{
+    crate::PatTupleStruct {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        qself: (node.qself).map(|it| f.fold_qself(it)),
+        path: f.fold_path(node.path),
+        paren_token: node.paren_token,
+        elems: crate::punctuated::fold(node.elems, f, F::fold_pat),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_pat_type<F>(f: &mut F, node: crate::PatType) -> crate::PatType
+where
+    F: Fold + ?Sized,
+{
+    crate::PatType {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        pat: Box::new(f.fold_pat(*node.pat)),
+        colon_token: node.colon_token,
+        ty: Box::new(f.fold_type(*node.ty)),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_pat_wild<F>(f: &mut F, node: crate::PatWild) -> crate::PatWild
+where
+    F: Fold + ?Sized,
+{
+    crate::PatWild {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        underscore_token: node.underscore_token,
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_path<F>(f: &mut F, node: crate::Path) -> crate::Path
+where
+    F: Fold + ?Sized,
+{
+    crate::Path {
+        leading_colon: node.leading_colon,
+        segments: crate::punctuated::fold(node.segments, f, F::fold_path_segment),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_path_arguments<F>(
+    f: &mut F,
+    node: crate::PathArguments,
+) -> crate::PathArguments
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::PathArguments::None => crate::PathArguments::None,
+        crate::PathArguments::AngleBracketed(_binding_0) => {
+            crate::PathArguments::AngleBracketed(
+                f.fold_angle_bracketed_generic_arguments(_binding_0),
+            )
+        }
+        crate::PathArguments::Parenthesized(_binding_0) => {
+            crate::PathArguments::Parenthesized(
+                f.fold_parenthesized_generic_arguments(_binding_0),
+            )
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_path_segment<F>(f: &mut F, node: crate::PathSegment) -> crate::PathSegment
+where
+    F: Fold + ?Sized,
+{
+    crate::PathSegment {
+        ident: f.fold_ident(node.ident),
+        arguments: f.fold_path_arguments(node.arguments),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_predicate_lifetime<F>(
+    f: &mut F,
+    node: crate::PredicateLifetime,
+) -> crate::PredicateLifetime
+where
+    F: Fold + ?Sized,
+{
+    crate::PredicateLifetime {
+        lifetime: f.fold_lifetime(node.lifetime),
+        colon_token: node.colon_token,
+        bounds: crate::punctuated::fold(node.bounds, f, F::fold_lifetime),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_predicate_type<F>(
+    f: &mut F,
+    node: crate::PredicateType,
+) -> crate::PredicateType
+where
+    F: Fold + ?Sized,
+{
+    crate::PredicateType {
+        lifetimes: (node.lifetimes).map(|it| f.fold_bound_lifetimes(it)),
+        bounded_ty: f.fold_type(node.bounded_ty),
+        colon_token: node.colon_token,
+        bounds: crate::punctuated::fold(node.bounds, f, F::fold_type_param_bound),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_qself<F>(f: &mut F, node: crate::QSelf) -> crate::QSelf
+where
+    F: Fold + ?Sized,
+{
+    crate::QSelf {
+        lt_token: node.lt_token,
+        ty: Box::new(f.fold_type(*node.ty)),
+        position: node.position,
+        as_token: node.as_token,
+        gt_token: node.gt_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_range_limits<F>(f: &mut F, node: crate::RangeLimits) -> crate::RangeLimits
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::RangeLimits::HalfOpen(_binding_0) => {
+            crate::RangeLimits::HalfOpen(_binding_0)
+        }
+        crate::RangeLimits::Closed(_binding_0) => crate::RangeLimits::Closed(_binding_0),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_receiver<F>(f: &mut F, node: crate::Receiver) -> crate::Receiver
+where
+    F: Fold + ?Sized,
+{
+    crate::Receiver {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        reference: (node.reference)
+            .map(|it| ((it).0, ((it).1).map(|it| f.fold_lifetime(it)))),
+        mutability: node.mutability,
+        self_token: node.self_token,
+        colon_token: node.colon_token,
+        ty: Box::new(f.fold_type(*node.ty)),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_return_type<F>(f: &mut F, node: crate::ReturnType) -> crate::ReturnType
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::ReturnType::Default => crate::ReturnType::Default,
+        crate::ReturnType::Type(_binding_0, _binding_1) => {
+            crate::ReturnType::Type(_binding_0, Box::new(f.fold_type(*_binding_1)))
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_signature<F>(f: &mut F, node: crate::Signature) -> crate::Signature
+where
+    F: Fold + ?Sized,
+{
+    crate::Signature {
+        constness: node.constness,
+        asyncness: node.asyncness,
+        unsafety: node.unsafety,
+        abi: (node.abi).map(|it| f.fold_abi(it)),
+        fn_token: node.fn_token,
+        ident: f.fold_ident(node.ident),
+        generics: f.fold_generics(node.generics),
+        paren_token: node.paren_token,
+        inputs: crate::punctuated::fold(node.inputs, f, F::fold_fn_arg),
+        variadic: (node.variadic).map(|it| f.fold_variadic(it)),
+        output: f.fold_return_type(node.output),
+    }
+}
+pub fn fold_span<F>(f: &mut F, node: proc_macro2::Span) -> proc_macro2::Span
+where
+    F: Fold + ?Sized,
+{
+    node
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_static_mutability<F>(
+    f: &mut F,
+    node: crate::StaticMutability,
+) -> crate::StaticMutability
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::StaticMutability::Mut(_binding_0) => {
+            crate::StaticMutability::Mut(_binding_0)
+        }
+        crate::StaticMutability::None => crate::StaticMutability::None,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_stmt<F>(f: &mut F, node: crate::Stmt) -> crate::Stmt
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::Stmt::Local(_binding_0) => crate::Stmt::Local(f.fold_local(_binding_0)),
+        crate::Stmt::Item(_binding_0) => crate::Stmt::Item(f.fold_item(_binding_0)),
+        crate::Stmt::Expr(_binding_0, _binding_1) => {
+            crate::Stmt::Expr(f.fold_expr(_binding_0), _binding_1)
+        }
+        crate::Stmt::Macro(_binding_0) => {
+            crate::Stmt::Macro(f.fold_stmt_macro(_binding_0))
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_stmt_macro<F>(f: &mut F, node: crate::StmtMacro) -> crate::StmtMacro
+where
+    F: Fold + ?Sized,
+{
+    crate::StmtMacro {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        mac: f.fold_macro(node.mac),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_trait_bound<F>(f: &mut F, node: crate::TraitBound) -> crate::TraitBound
+where
+    F: Fold + ?Sized,
+{
+    crate::TraitBound {
+        paren_token: node.paren_token,
+        modifier: f.fold_trait_bound_modifier(node.modifier),
+        lifetimes: (node.lifetimes).map(|it| f.fold_bound_lifetimes(it)),
+        path: f.fold_path(node.path),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_trait_bound_modifier<F>(
+    f: &mut F,
+    node: crate::TraitBoundModifier,
+) -> crate::TraitBoundModifier
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::TraitBoundModifier::None => crate::TraitBoundModifier::None,
+        crate::TraitBoundModifier::Maybe(_binding_0) => {
+            crate::TraitBoundModifier::Maybe(_binding_0)
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_trait_item<F>(f: &mut F, node: crate::TraitItem) -> crate::TraitItem
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::TraitItem::Const(_binding_0) => {
+            crate::TraitItem::Const(f.fold_trait_item_const(_binding_0))
+        }
+        crate::TraitItem::Fn(_binding_0) => {
+            crate::TraitItem::Fn(f.fold_trait_item_fn(_binding_0))
+        }
+        crate::TraitItem::Type(_binding_0) => {
+            crate::TraitItem::Type(f.fold_trait_item_type(_binding_0))
+        }
+        crate::TraitItem::Macro(_binding_0) => {
+            crate::TraitItem::Macro(f.fold_trait_item_macro(_binding_0))
+        }
+        crate::TraitItem::Verbatim(_binding_0) => crate::TraitItem::Verbatim(_binding_0),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_trait_item_const<F>(
+    f: &mut F,
+    node: crate::TraitItemConst,
+) -> crate::TraitItemConst
+where
+    F: Fold + ?Sized,
+{
+    crate::TraitItemConst {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        const_token: node.const_token,
+        ident: f.fold_ident(node.ident),
+        generics: f.fold_generics(node.generics),
+        colon_token: node.colon_token,
+        ty: f.fold_type(node.ty),
+        default: (node.default).map(|it| ((it).0, f.fold_expr((it).1))),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_trait_item_fn<F>(f: &mut F, node: crate::TraitItemFn) -> crate::TraitItemFn
+where
+    F: Fold + ?Sized,
+{
+    crate::TraitItemFn {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        sig: f.fold_signature(node.sig),
+        default: (node.default).map(|it| f.fold_block(it)),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_trait_item_macro<F>(
+    f: &mut F,
+    node: crate::TraitItemMacro,
+) -> crate::TraitItemMacro
+where
+    F: Fold + ?Sized,
+{
+    crate::TraitItemMacro {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        mac: f.fold_macro(node.mac),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_trait_item_type<F>(
+    f: &mut F,
+    node: crate::TraitItemType,
+) -> crate::TraitItemType
+where
+    F: Fold + ?Sized,
+{
+    crate::TraitItemType {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        type_token: node.type_token,
+        ident: f.fold_ident(node.ident),
+        generics: f.fold_generics(node.generics),
+        colon_token: node.colon_token,
+        bounds: crate::punctuated::fold(node.bounds, f, F::fold_type_param_bound),
+        default: (node.default).map(|it| ((it).0, f.fold_type((it).1))),
+        semi_token: node.semi_token,
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_type<F>(f: &mut F, node: crate::Type) -> crate::Type
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::Type::Array(_binding_0) => {
+            crate::Type::Array(f.fold_type_array(_binding_0))
+        }
+        crate::Type::BareFn(_binding_0) => {
+            crate::Type::BareFn(f.fold_type_bare_fn(_binding_0))
+        }
+        crate::Type::Group(_binding_0) => {
+            crate::Type::Group(f.fold_type_group(_binding_0))
+        }
+        crate::Type::ImplTrait(_binding_0) => {
+            crate::Type::ImplTrait(f.fold_type_impl_trait(_binding_0))
+        }
+        crate::Type::Infer(_binding_0) => {
+            crate::Type::Infer(f.fold_type_infer(_binding_0))
+        }
+        crate::Type::Macro(_binding_0) => {
+            crate::Type::Macro(f.fold_type_macro(_binding_0))
+        }
+        crate::Type::Never(_binding_0) => {
+            crate::Type::Never(f.fold_type_never(_binding_0))
+        }
+        crate::Type::Paren(_binding_0) => {
+            crate::Type::Paren(f.fold_type_paren(_binding_0))
+        }
+        crate::Type::Path(_binding_0) => crate::Type::Path(f.fold_type_path(_binding_0)),
+        crate::Type::Ptr(_binding_0) => crate::Type::Ptr(f.fold_type_ptr(_binding_0)),
+        crate::Type::Reference(_binding_0) => {
+            crate::Type::Reference(f.fold_type_reference(_binding_0))
+        }
+        crate::Type::Slice(_binding_0) => {
+            crate::Type::Slice(f.fold_type_slice(_binding_0))
+        }
+        crate::Type::TraitObject(_binding_0) => {
+            crate::Type::TraitObject(f.fold_type_trait_object(_binding_0))
+        }
+        crate::Type::Tuple(_binding_0) => {
+            crate::Type::Tuple(f.fold_type_tuple(_binding_0))
+        }
+        crate::Type::Verbatim(_binding_0) => crate::Type::Verbatim(_binding_0),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_type_array<F>(f: &mut F, node: crate::TypeArray) -> crate::TypeArray
+where
+    F: Fold + ?Sized,
+{
+    crate::TypeArray {
+        bracket_token: node.bracket_token,
+        elem: Box::new(f.fold_type(*node.elem)),
+        semi_token: node.semi_token,
+        len: f.fold_expr(node.len),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_type_bare_fn<F>(f: &mut F, node: crate::TypeBareFn) -> crate::TypeBareFn
+where
+    F: Fold + ?Sized,
+{
+    crate::TypeBareFn {
+        lifetimes: (node.lifetimes).map(|it| f.fold_bound_lifetimes(it)),
+        unsafety: node.unsafety,
+        abi: (node.abi).map(|it| f.fold_abi(it)),
+        fn_token: node.fn_token,
+        paren_token: node.paren_token,
+        inputs: crate::punctuated::fold(node.inputs, f, F::fold_bare_fn_arg),
+        variadic: (node.variadic).map(|it| f.fold_bare_variadic(it)),
+        output: f.fold_return_type(node.output),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_type_group<F>(f: &mut F, node: crate::TypeGroup) -> crate::TypeGroup
+where
+    F: Fold + ?Sized,
+{
+    crate::TypeGroup {
+        group_token: node.group_token,
+        elem: Box::new(f.fold_type(*node.elem)),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_type_impl_trait<F>(
+    f: &mut F,
+    node: crate::TypeImplTrait,
+) -> crate::TypeImplTrait
+where
+    F: Fold + ?Sized,
+{
+    crate::TypeImplTrait {
+        impl_token: node.impl_token,
+        bounds: crate::punctuated::fold(node.bounds, f, F::fold_type_param_bound),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_type_infer<F>(f: &mut F, node: crate::TypeInfer) -> crate::TypeInfer
+where
+    F: Fold + ?Sized,
+{
+    crate::TypeInfer {
+        underscore_token: node.underscore_token,
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_type_macro<F>(f: &mut F, node: crate::TypeMacro) -> crate::TypeMacro
+where
+    F: Fold + ?Sized,
+{
+    crate::TypeMacro {
+        mac: f.fold_macro(node.mac),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_type_never<F>(f: &mut F, node: crate::TypeNever) -> crate::TypeNever
+where
+    F: Fold + ?Sized,
+{
+    crate::TypeNever {
+        bang_token: node.bang_token,
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_type_param<F>(f: &mut F, node: crate::TypeParam) -> crate::TypeParam
+where
+    F: Fold + ?Sized,
+{
+    crate::TypeParam {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        ident: f.fold_ident(node.ident),
+        colon_token: node.colon_token,
+        bounds: crate::punctuated::fold(node.bounds, f, F::fold_type_param_bound),
+        eq_token: node.eq_token,
+        default: (node.default).map(|it| f.fold_type(it)),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_type_param_bound<F>(
+    f: &mut F,
+    node: crate::TypeParamBound,
+) -> crate::TypeParamBound
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::TypeParamBound::Trait(_binding_0) => {
+            crate::TypeParamBound::Trait(f.fold_trait_bound(_binding_0))
+        }
+        crate::TypeParamBound::Lifetime(_binding_0) => {
+            crate::TypeParamBound::Lifetime(f.fold_lifetime(_binding_0))
+        }
+        crate::TypeParamBound::Verbatim(_binding_0) => {
+            crate::TypeParamBound::Verbatim(_binding_0)
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_type_paren<F>(f: &mut F, node: crate::TypeParen) -> crate::TypeParen
+where
+    F: Fold + ?Sized,
+{
+    crate::TypeParen {
+        paren_token: node.paren_token,
+        elem: Box::new(f.fold_type(*node.elem)),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_type_path<F>(f: &mut F, node: crate::TypePath) -> crate::TypePath
+where
+    F: Fold + ?Sized,
+{
+    crate::TypePath {
+        qself: (node.qself).map(|it| f.fold_qself(it)),
+        path: f.fold_path(node.path),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_type_ptr<F>(f: &mut F, node: crate::TypePtr) -> crate::TypePtr
+where
+    F: Fold + ?Sized,
+{
+    crate::TypePtr {
+        star_token: node.star_token,
+        const_token: node.const_token,
+        mutability: node.mutability,
+        elem: Box::new(f.fold_type(*node.elem)),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_type_reference<F>(
+    f: &mut F,
+    node: crate::TypeReference,
+) -> crate::TypeReference
+where
+    F: Fold + ?Sized,
+{
+    crate::TypeReference {
+        and_token: node.and_token,
+        lifetime: (node.lifetime).map(|it| f.fold_lifetime(it)),
+        mutability: node.mutability,
+        elem: Box::new(f.fold_type(*node.elem)),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_type_slice<F>(f: &mut F, node: crate::TypeSlice) -> crate::TypeSlice
+where
+    F: Fold + ?Sized,
+{
+    crate::TypeSlice {
+        bracket_token: node.bracket_token,
+        elem: Box::new(f.fold_type(*node.elem)),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_type_trait_object<F>(
+    f: &mut F,
+    node: crate::TypeTraitObject,
+) -> crate::TypeTraitObject
+where
+    F: Fold + ?Sized,
+{
+    crate::TypeTraitObject {
+        dyn_token: node.dyn_token,
+        bounds: crate::punctuated::fold(node.bounds, f, F::fold_type_param_bound),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_type_tuple<F>(f: &mut F, node: crate::TypeTuple) -> crate::TypeTuple
+where
+    F: Fold + ?Sized,
+{
+    crate::TypeTuple {
+        paren_token: node.paren_token,
+        elems: crate::punctuated::fold(node.elems, f, F::fold_type),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_un_op<F>(f: &mut F, node: crate::UnOp) -> crate::UnOp
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::UnOp::Deref(_binding_0) => crate::UnOp::Deref(_binding_0),
+        crate::UnOp::Not(_binding_0) => crate::UnOp::Not(_binding_0),
+        crate::UnOp::Neg(_binding_0) => crate::UnOp::Neg(_binding_0),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_use_glob<F>(f: &mut F, node: crate::UseGlob) -> crate::UseGlob
+where
+    F: Fold + ?Sized,
+{
+    crate::UseGlob {
+        star_token: node.star_token,
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_use_group<F>(f: &mut F, node: crate::UseGroup) -> crate::UseGroup
+where
+    F: Fold + ?Sized,
+{
+    crate::UseGroup {
+        brace_token: node.brace_token,
+        items: crate::punctuated::fold(node.items, f, F::fold_use_tree),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_use_name<F>(f: &mut F, node: crate::UseName) -> crate::UseName
+where
+    F: Fold + ?Sized,
+{
+    crate::UseName {
+        ident: f.fold_ident(node.ident),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_use_path<F>(f: &mut F, node: crate::UsePath) -> crate::UsePath
+where
+    F: Fold + ?Sized,
+{
+    crate::UsePath {
+        ident: f.fold_ident(node.ident),
+        colon2_token: node.colon2_token,
+        tree: Box::new(f.fold_use_tree(*node.tree)),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_use_rename<F>(f: &mut F, node: crate::UseRename) -> crate::UseRename
+where
+    F: Fold + ?Sized,
+{
+    crate::UseRename {
+        ident: f.fold_ident(node.ident),
+        as_token: node.as_token,
+        rename: f.fold_ident(node.rename),
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_use_tree<F>(f: &mut F, node: crate::UseTree) -> crate::UseTree
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::UseTree::Path(_binding_0) => {
+            crate::UseTree::Path(f.fold_use_path(_binding_0))
+        }
+        crate::UseTree::Name(_binding_0) => {
+            crate::UseTree::Name(f.fold_use_name(_binding_0))
+        }
+        crate::UseTree::Rename(_binding_0) => {
+            crate::UseTree::Rename(f.fold_use_rename(_binding_0))
+        }
+        crate::UseTree::Glob(_binding_0) => {
+            crate::UseTree::Glob(f.fold_use_glob(_binding_0))
+        }
+        crate::UseTree::Group(_binding_0) => {
+            crate::UseTree::Group(f.fold_use_group(_binding_0))
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn fold_variadic<F>(f: &mut F, node: crate::Variadic) -> crate::Variadic
+where
+    F: Fold + ?Sized,
+{
+    crate::Variadic {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        pat: (node.pat).map(|it| (Box::new(f.fold_pat(*(it).0)), (it).1)),
+        dots: node.dots,
+        comma: node.comma,
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_variant<F>(f: &mut F, node: crate::Variant) -> crate::Variant
+where
+    F: Fold + ?Sized,
+{
+    crate::Variant {
+        attrs: fold_vec(node.attrs, f, F::fold_attribute),
+        ident: f.fold_ident(node.ident),
+        fields: f.fold_fields(node.fields),
+        discriminant: (node.discriminant).map(|it| ((it).0, f.fold_expr((it).1))),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_vis_restricted<F>(
+    f: &mut F,
+    node: crate::VisRestricted,
+) -> crate::VisRestricted
+where
+    F: Fold + ?Sized,
+{
+    crate::VisRestricted {
+        pub_token: node.pub_token,
+        paren_token: node.paren_token,
+        in_token: node.in_token,
+        path: Box::new(f.fold_path(*node.path)),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_visibility<F>(f: &mut F, node: crate::Visibility) -> crate::Visibility
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::Visibility::Public(_binding_0) => crate::Visibility::Public(_binding_0),
+        crate::Visibility::Restricted(_binding_0) => {
+            crate::Visibility::Restricted(f.fold_vis_restricted(_binding_0))
+        }
+        crate::Visibility::Inherited => crate::Visibility::Inherited,
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_where_clause<F>(f: &mut F, node: crate::WhereClause) -> crate::WhereClause
+where
+    F: Fold + ?Sized,
+{
+    crate::WhereClause {
+        where_token: node.where_token,
+        predicates: crate::punctuated::fold(node.predicates, f, F::fold_where_predicate),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn fold_where_predicate<F>(
+    f: &mut F,
+    node: crate::WherePredicate,
+) -> crate::WherePredicate
+where
+    F: Fold + ?Sized,
+{
+    match node {
+        crate::WherePredicate::Lifetime(_binding_0) => {
+            crate::WherePredicate::Lifetime(f.fold_predicate_lifetime(_binding_0))
+        }
+        crate::WherePredicate::Type(_binding_0) => {
+            crate::WherePredicate::Type(f.fold_predicate_type(_binding_0))
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+fn fold_vec<T, V, F>(vec: Vec<T>, fold: &mut V, mut f: F) -> Vec<T>
+where
+    V: ?Sized,
+    F: FnMut(&mut V, T) -> T,
+{
+    vec.into_iter().map(|it| f(fold, it)).collect()
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/gen/hash.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/gen/hash.rs
--- 43.0.0-1/rust-vendor/syn/src/gen/hash.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/gen/hash.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,2807 @@
+// This file is @generated by syn-internal-codegen.
+// It is not intended for manual editing.
+
+#[cfg(any(feature = "derive", feature = "full"))]
+use crate::tt::TokenStreamHelper;
+use std::hash::{Hash, Hasher};
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Abi {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.name.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::AngleBracketedGenericArguments {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.colon2_token.hash(state);
+        self.args.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Arm {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.pat.hash(state);
+        self.guard.hash(state);
+        self.body.hash(state);
+        self.comma.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::AssocConst {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.ident.hash(state);
+        self.generics.hash(state);
+        self.value.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::AssocType {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.ident.hash(state);
+        self.generics.hash(state);
+        self.ty.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::AttrStyle {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::AttrStyle::Outer => {
+                state.write_u8(0u8);
+            }
+            crate::AttrStyle::Inner(_) => {
+                state.write_u8(1u8);
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Attribute {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.style.hash(state);
+        self.meta.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::BareFnArg {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.name.hash(state);
+        self.ty.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::BareVariadic {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.name.hash(state);
+        self.comma.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::BinOp {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::BinOp::Add(_) => {
+                state.write_u8(0u8);
+            }
+            crate::BinOp::Sub(_) => {
+                state.write_u8(1u8);
+            }
+            crate::BinOp::Mul(_) => {
+                state.write_u8(2u8);
+            }
+            crate::BinOp::Div(_) => {
+                state.write_u8(3u8);
+            }
+            crate::BinOp::Rem(_) => {
+                state.write_u8(4u8);
+            }
+            crate::BinOp::And(_) => {
+                state.write_u8(5u8);
+            }
+            crate::BinOp::Or(_) => {
+                state.write_u8(6u8);
+            }
+            crate::BinOp::BitXor(_) => {
+                state.write_u8(7u8);
+            }
+            crate::BinOp::BitAnd(_) => {
+                state.write_u8(8u8);
+            }
+            crate::BinOp::BitOr(_) => {
+                state.write_u8(9u8);
+            }
+            crate::BinOp::Shl(_) => {
+                state.write_u8(10u8);
+            }
+            crate::BinOp::Shr(_) => {
+                state.write_u8(11u8);
+            }
+            crate::BinOp::Eq(_) => {
+                state.write_u8(12u8);
+            }
+            crate::BinOp::Lt(_) => {
+                state.write_u8(13u8);
+            }
+            crate::BinOp::Le(_) => {
+                state.write_u8(14u8);
+            }
+            crate::BinOp::Ne(_) => {
+                state.write_u8(15u8);
+            }
+            crate::BinOp::Ge(_) => {
+                state.write_u8(16u8);
+            }
+            crate::BinOp::Gt(_) => {
+                state.write_u8(17u8);
+            }
+            crate::BinOp::AddAssign(_) => {
+                state.write_u8(18u8);
+            }
+            crate::BinOp::SubAssign(_) => {
+                state.write_u8(19u8);
+            }
+            crate::BinOp::MulAssign(_) => {
+                state.write_u8(20u8);
+            }
+            crate::BinOp::DivAssign(_) => {
+                state.write_u8(21u8);
+            }
+            crate::BinOp::RemAssign(_) => {
+                state.write_u8(22u8);
+            }
+            crate::BinOp::BitXorAssign(_) => {
+                state.write_u8(23u8);
+            }
+            crate::BinOp::BitAndAssign(_) => {
+                state.write_u8(24u8);
+            }
+            crate::BinOp::BitOrAssign(_) => {
+                state.write_u8(25u8);
+            }
+            crate::BinOp::ShlAssign(_) => {
+                state.write_u8(26u8);
+            }
+            crate::BinOp::ShrAssign(_) => {
+                state.write_u8(27u8);
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Block {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.stmts.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::BoundLifetimes {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.lifetimes.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ConstParam {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.ident.hash(state);
+        self.ty.hash(state);
+        self.eq_token.hash(state);
+        self.default.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Constraint {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.ident.hash(state);
+        self.generics.hash(state);
+        self.bounds.hash(state);
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Data {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::Data::Struct(v0) => {
+                state.write_u8(0u8);
+                v0.hash(state);
+            }
+            crate::Data::Enum(v0) => {
+                state.write_u8(1u8);
+                v0.hash(state);
+            }
+            crate::Data::Union(v0) => {
+                state.write_u8(2u8);
+                v0.hash(state);
+            }
+        }
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::DataEnum {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.variants.hash(state);
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::DataStruct {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.fields.hash(state);
+        self.semi_token.hash(state);
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::DataUnion {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.fields.hash(state);
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::DeriveInput {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.vis.hash(state);
+        self.ident.hash(state);
+        self.generics.hash(state);
+        self.data.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Expr {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            #[cfg(feature = "full")]
+            crate::Expr::Array(v0) => {
+                state.write_u8(0u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::Assign(v0) => {
+                state.write_u8(1u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::Async(v0) => {
+                state.write_u8(2u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::Await(v0) => {
+                state.write_u8(3u8);
+                v0.hash(state);
+            }
+            crate::Expr::Binary(v0) => {
+                state.write_u8(4u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::Block(v0) => {
+                state.write_u8(5u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::Break(v0) => {
+                state.write_u8(6u8);
+                v0.hash(state);
+            }
+            crate::Expr::Call(v0) => {
+                state.write_u8(7u8);
+                v0.hash(state);
+            }
+            crate::Expr::Cast(v0) => {
+                state.write_u8(8u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::Closure(v0) => {
+                state.write_u8(9u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::Const(v0) => {
+                state.write_u8(10u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::Continue(v0) => {
+                state.write_u8(11u8);
+                v0.hash(state);
+            }
+            crate::Expr::Field(v0) => {
+                state.write_u8(12u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::ForLoop(v0) => {
+                state.write_u8(13u8);
+                v0.hash(state);
+            }
+            crate::Expr::Group(v0) => {
+                state.write_u8(14u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::If(v0) => {
+                state.write_u8(15u8);
+                v0.hash(state);
+            }
+            crate::Expr::Index(v0) => {
+                state.write_u8(16u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::Infer(v0) => {
+                state.write_u8(17u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::Let(v0) => {
+                state.write_u8(18u8);
+                v0.hash(state);
+            }
+            crate::Expr::Lit(v0) => {
+                state.write_u8(19u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::Loop(v0) => {
+                state.write_u8(20u8);
+                v0.hash(state);
+            }
+            crate::Expr::Macro(v0) => {
+                state.write_u8(21u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::Match(v0) => {
+                state.write_u8(22u8);
+                v0.hash(state);
+            }
+            crate::Expr::MethodCall(v0) => {
+                state.write_u8(23u8);
+                v0.hash(state);
+            }
+            crate::Expr::Paren(v0) => {
+                state.write_u8(24u8);
+                v0.hash(state);
+            }
+            crate::Expr::Path(v0) => {
+                state.write_u8(25u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::Range(v0) => {
+                state.write_u8(26u8);
+                v0.hash(state);
+            }
+            crate::Expr::Reference(v0) => {
+                state.write_u8(27u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::Repeat(v0) => {
+                state.write_u8(28u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::Return(v0) => {
+                state.write_u8(29u8);
+                v0.hash(state);
+            }
+            crate::Expr::Struct(v0) => {
+                state.write_u8(30u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::Try(v0) => {
+                state.write_u8(31u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::TryBlock(v0) => {
+                state.write_u8(32u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::Tuple(v0) => {
+                state.write_u8(33u8);
+                v0.hash(state);
+            }
+            crate::Expr::Unary(v0) => {
+                state.write_u8(34u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::Unsafe(v0) => {
+                state.write_u8(35u8);
+                v0.hash(state);
+            }
+            crate::Expr::Verbatim(v0) => {
+                state.write_u8(36u8);
+                TokenStreamHelper(v0).hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::While(v0) => {
+                state.write_u8(37u8);
+                v0.hash(state);
+            }
+            #[cfg(feature = "full")]
+            crate::Expr::Yield(v0) => {
+                state.write_u8(38u8);
+                v0.hash(state);
+            }
+            #[cfg(not(feature = "full"))]
+            _ => unreachable!(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprArray {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.elems.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprAssign {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.left.hash(state);
+        self.right.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprAsync {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.capture.hash(state);
+        self.block.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprAwait {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.base.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprBinary {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.left.hash(state);
+        self.op.hash(state);
+        self.right.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprBlock {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.label.hash(state);
+        self.block.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprBreak {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.label.hash(state);
+        self.expr.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprCall {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.func.hash(state);
+        self.args.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprCast {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.expr.hash(state);
+        self.ty.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprClosure {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.lifetimes.hash(state);
+        self.constness.hash(state);
+        self.movability.hash(state);
+        self.asyncness.hash(state);
+        self.capture.hash(state);
+        self.inputs.hash(state);
+        self.output.hash(state);
+        self.body.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprConst {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.block.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprContinue {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.label.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprField {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.base.hash(state);
+        self.member.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprForLoop {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.label.hash(state);
+        self.pat.hash(state);
+        self.expr.hash(state);
+        self.body.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprGroup {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.expr.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprIf {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.cond.hash(state);
+        self.then_branch.hash(state);
+        self.else_branch.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprIndex {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.expr.hash(state);
+        self.index.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprInfer {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprLet {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.pat.hash(state);
+        self.expr.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprLit {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.lit.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprLoop {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.label.hash(state);
+        self.body.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprMacro {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.mac.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprMatch {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.expr.hash(state);
+        self.arms.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprMethodCall {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.receiver.hash(state);
+        self.method.hash(state);
+        self.turbofish.hash(state);
+        self.args.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprParen {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.expr.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprPath {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.qself.hash(state);
+        self.path.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprRange {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.start.hash(state);
+        self.limits.hash(state);
+        self.end.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprReference {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.mutability.hash(state);
+        self.expr.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprRepeat {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.expr.hash(state);
+        self.len.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprReturn {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.expr.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprStruct {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.qself.hash(state);
+        self.path.hash(state);
+        self.fields.hash(state);
+        self.dot2_token.hash(state);
+        self.rest.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprTry {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.expr.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprTryBlock {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.block.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprTuple {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.elems.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprUnary {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.op.hash(state);
+        self.expr.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprUnsafe {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.block.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprWhile {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.label.hash(state);
+        self.cond.hash(state);
+        self.body.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ExprYield {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.expr.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Field {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.vis.hash(state);
+        self.mutability.hash(state);
+        self.ident.hash(state);
+        self.colon_token.hash(state);
+        self.ty.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::FieldMutability {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::FieldMutability::None => {
+                state.write_u8(0u8);
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::FieldPat {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.member.hash(state);
+        self.colon_token.hash(state);
+        self.pat.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::FieldValue {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.member.hash(state);
+        self.colon_token.hash(state);
+        self.expr.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Fields {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::Fields::Named(v0) => {
+                state.write_u8(0u8);
+                v0.hash(state);
+            }
+            crate::Fields::Unnamed(v0) => {
+                state.write_u8(1u8);
+                v0.hash(state);
+            }
+            crate::Fields::Unit => {
+                state.write_u8(2u8);
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::FieldsNamed {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.named.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::FieldsUnnamed {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.unnamed.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::File {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.shebang.hash(state);
+        self.attrs.hash(state);
+        self.items.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::FnArg {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::FnArg::Receiver(v0) => {
+                state.write_u8(0u8);
+                v0.hash(state);
+            }
+            crate::FnArg::Typed(v0) => {
+                state.write_u8(1u8);
+                v0.hash(state);
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ForeignItem {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::ForeignItem::Fn(v0) => {
+                state.write_u8(0u8);
+                v0.hash(state);
+            }
+            crate::ForeignItem::Static(v0) => {
+                state.write_u8(1u8);
+                v0.hash(state);
+            }
+            crate::ForeignItem::Type(v0) => {
+                state.write_u8(2u8);
+                v0.hash(state);
+            }
+            crate::ForeignItem::Macro(v0) => {
+                state.write_u8(3u8);
+                v0.hash(state);
+            }
+            crate::ForeignItem::Verbatim(v0) => {
+                state.write_u8(4u8);
+                TokenStreamHelper(v0).hash(state);
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ForeignItemFn {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.vis.hash(state);
+        self.sig.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ForeignItemMacro {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.mac.hash(state);
+        self.semi_token.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ForeignItemStatic {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.vis.hash(state);
+        self.mutability.hash(state);
+        self.ident.hash(state);
+        self.ty.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ForeignItemType {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.vis.hash(state);
+        self.ident.hash(state);
+        self.generics.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::GenericArgument {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::GenericArgument::Lifetime(v0) => {
+                state.write_u8(0u8);
+                v0.hash(state);
+            }
+            crate::GenericArgument::Type(v0) => {
+                state.write_u8(1u8);
+                v0.hash(state);
+            }
+            crate::GenericArgument::Const(v0) => {
+                state.write_u8(2u8);
+                v0.hash(state);
+            }
+            crate::GenericArgument::AssocType(v0) => {
+                state.write_u8(3u8);
+                v0.hash(state);
+            }
+            crate::GenericArgument::AssocConst(v0) => {
+                state.write_u8(4u8);
+                v0.hash(state);
+            }
+            crate::GenericArgument::Constraint(v0) => {
+                state.write_u8(5u8);
+                v0.hash(state);
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::GenericParam {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::GenericParam::Lifetime(v0) => {
+                state.write_u8(0u8);
+                v0.hash(state);
+            }
+            crate::GenericParam::Type(v0) => {
+                state.write_u8(1u8);
+                v0.hash(state);
+            }
+            crate::GenericParam::Const(v0) => {
+                state.write_u8(2u8);
+                v0.hash(state);
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Generics {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.lt_token.hash(state);
+        self.params.hash(state);
+        self.gt_token.hash(state);
+        self.where_clause.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ImplItem {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::ImplItem::Const(v0) => {
+                state.write_u8(0u8);
+                v0.hash(state);
+            }
+            crate::ImplItem::Fn(v0) => {
+                state.write_u8(1u8);
+                v0.hash(state);
+            }
+            crate::ImplItem::Type(v0) => {
+                state.write_u8(2u8);
+                v0.hash(state);
+            }
+            crate::ImplItem::Macro(v0) => {
+                state.write_u8(3u8);
+                v0.hash(state);
+            }
+            crate::ImplItem::Verbatim(v0) => {
+                state.write_u8(4u8);
+                TokenStreamHelper(v0).hash(state);
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ImplItemConst {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.vis.hash(state);
+        self.defaultness.hash(state);
+        self.ident.hash(state);
+        self.generics.hash(state);
+        self.ty.hash(state);
+        self.expr.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ImplItemFn {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.vis.hash(state);
+        self.defaultness.hash(state);
+        self.sig.hash(state);
+        self.block.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ImplItemMacro {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.mac.hash(state);
+        self.semi_token.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ImplItemType {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.vis.hash(state);
+        self.defaultness.hash(state);
+        self.ident.hash(state);
+        self.generics.hash(state);
+        self.ty.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ImplRestriction {
+    fn hash<H>(&self, _state: &mut H)
+    where
+        H: Hasher,
+    {
+        match *self {}
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Item {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::Item::Const(v0) => {
+                state.write_u8(0u8);
+                v0.hash(state);
+            }
+            crate::Item::Enum(v0) => {
+                state.write_u8(1u8);
+                v0.hash(state);
+            }
+            crate::Item::ExternCrate(v0) => {
+                state.write_u8(2u8);
+                v0.hash(state);
+            }
+            crate::Item::Fn(v0) => {
+                state.write_u8(3u8);
+                v0.hash(state);
+            }
+            crate::Item::ForeignMod(v0) => {
+                state.write_u8(4u8);
+                v0.hash(state);
+            }
+            crate::Item::Impl(v0) => {
+                state.write_u8(5u8);
+                v0.hash(state);
+            }
+            crate::Item::Macro(v0) => {
+                state.write_u8(6u8);
+                v0.hash(state);
+            }
+            crate::Item::Mod(v0) => {
+                state.write_u8(7u8);
+                v0.hash(state);
+            }
+            crate::Item::Static(v0) => {
+                state.write_u8(8u8);
+                v0.hash(state);
+            }
+            crate::Item::Struct(v0) => {
+                state.write_u8(9u8);
+                v0.hash(state);
+            }
+            crate::Item::Trait(v0) => {
+                state.write_u8(10u8);
+                v0.hash(state);
+            }
+            crate::Item::TraitAlias(v0) => {
+                state.write_u8(11u8);
+                v0.hash(state);
+            }
+            crate::Item::Type(v0) => {
+                state.write_u8(12u8);
+                v0.hash(state);
+            }
+            crate::Item::Union(v0) => {
+                state.write_u8(13u8);
+                v0.hash(state);
+            }
+            crate::Item::Use(v0) => {
+                state.write_u8(14u8);
+                v0.hash(state);
+            }
+            crate::Item::Verbatim(v0) => {
+                state.write_u8(15u8);
+                TokenStreamHelper(v0).hash(state);
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ItemConst {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.vis.hash(state);
+        self.ident.hash(state);
+        self.generics.hash(state);
+        self.ty.hash(state);
+        self.expr.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ItemEnum {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.vis.hash(state);
+        self.ident.hash(state);
+        self.generics.hash(state);
+        self.variants.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ItemExternCrate {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.vis.hash(state);
+        self.ident.hash(state);
+        self.rename.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ItemFn {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.vis.hash(state);
+        self.sig.hash(state);
+        self.block.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ItemForeignMod {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.unsafety.hash(state);
+        self.abi.hash(state);
+        self.items.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ItemImpl {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.defaultness.hash(state);
+        self.unsafety.hash(state);
+        self.generics.hash(state);
+        self.trait_.hash(state);
+        self.self_ty.hash(state);
+        self.items.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ItemMacro {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.ident.hash(state);
+        self.mac.hash(state);
+        self.semi_token.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ItemMod {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.vis.hash(state);
+        self.unsafety.hash(state);
+        self.ident.hash(state);
+        self.content.hash(state);
+        self.semi.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ItemStatic {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.vis.hash(state);
+        self.mutability.hash(state);
+        self.ident.hash(state);
+        self.ty.hash(state);
+        self.expr.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ItemStruct {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.vis.hash(state);
+        self.ident.hash(state);
+        self.generics.hash(state);
+        self.fields.hash(state);
+        self.semi_token.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ItemTrait {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.vis.hash(state);
+        self.unsafety.hash(state);
+        self.auto_token.hash(state);
+        self.restriction.hash(state);
+        self.ident.hash(state);
+        self.generics.hash(state);
+        self.colon_token.hash(state);
+        self.supertraits.hash(state);
+        self.items.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ItemTraitAlias {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.vis.hash(state);
+        self.ident.hash(state);
+        self.generics.hash(state);
+        self.bounds.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ItemType {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.vis.hash(state);
+        self.ident.hash(state);
+        self.generics.hash(state);
+        self.ty.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ItemUnion {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.vis.hash(state);
+        self.ident.hash(state);
+        self.generics.hash(state);
+        self.fields.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ItemUse {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.vis.hash(state);
+        self.leading_colon.hash(state);
+        self.tree.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Label {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.name.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::LifetimeParam {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.lifetime.hash(state);
+        self.colon_token.hash(state);
+        self.bounds.hash(state);
+    }
+}
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Lit {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::Lit::Str(v0) => {
+                state.write_u8(0u8);
+                v0.hash(state);
+            }
+            crate::Lit::ByteStr(v0) => {
+                state.write_u8(1u8);
+                v0.hash(state);
+            }
+            crate::Lit::CStr(v0) => {
+                state.write_u8(2u8);
+                v0.hash(state);
+            }
+            crate::Lit::Byte(v0) => {
+                state.write_u8(3u8);
+                v0.hash(state);
+            }
+            crate::Lit::Char(v0) => {
+                state.write_u8(4u8);
+                v0.hash(state);
+            }
+            crate::Lit::Int(v0) => {
+                state.write_u8(5u8);
+                v0.hash(state);
+            }
+            crate::Lit::Float(v0) => {
+                state.write_u8(6u8);
+                v0.hash(state);
+            }
+            crate::Lit::Bool(v0) => {
+                state.write_u8(7u8);
+                v0.hash(state);
+            }
+            crate::Lit::Verbatim(v0) => {
+                state.write_u8(8u8);
+                v0.to_string().hash(state);
+            }
+        }
+    }
+}
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::LitBool {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.value.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Local {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.pat.hash(state);
+        self.init.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::LocalInit {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.expr.hash(state);
+        self.diverge.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Macro {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.path.hash(state);
+        self.delimiter.hash(state);
+        TokenStreamHelper(&self.tokens).hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::MacroDelimiter {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::MacroDelimiter::Paren(_) => {
+                state.write_u8(0u8);
+            }
+            crate::MacroDelimiter::Brace(_) => {
+                state.write_u8(1u8);
+            }
+            crate::MacroDelimiter::Bracket(_) => {
+                state.write_u8(2u8);
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Meta {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::Meta::Path(v0) => {
+                state.write_u8(0u8);
+                v0.hash(state);
+            }
+            crate::Meta::List(v0) => {
+                state.write_u8(1u8);
+                v0.hash(state);
+            }
+            crate::Meta::NameValue(v0) => {
+                state.write_u8(2u8);
+                v0.hash(state);
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::MetaList {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.path.hash(state);
+        self.delimiter.hash(state);
+        TokenStreamHelper(&self.tokens).hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::MetaNameValue {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.path.hash(state);
+        self.value.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ParenthesizedGenericArguments {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.inputs.hash(state);
+        self.output.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Pat {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::Pat::Const(v0) => {
+                state.write_u8(0u8);
+                v0.hash(state);
+            }
+            crate::Pat::Ident(v0) => {
+                state.write_u8(1u8);
+                v0.hash(state);
+            }
+            crate::Pat::Lit(v0) => {
+                state.write_u8(2u8);
+                v0.hash(state);
+            }
+            crate::Pat::Macro(v0) => {
+                state.write_u8(3u8);
+                v0.hash(state);
+            }
+            crate::Pat::Or(v0) => {
+                state.write_u8(4u8);
+                v0.hash(state);
+            }
+            crate::Pat::Paren(v0) => {
+                state.write_u8(5u8);
+                v0.hash(state);
+            }
+            crate::Pat::Path(v0) => {
+                state.write_u8(6u8);
+                v0.hash(state);
+            }
+            crate::Pat::Range(v0) => {
+                state.write_u8(7u8);
+                v0.hash(state);
+            }
+            crate::Pat::Reference(v0) => {
+                state.write_u8(8u8);
+                v0.hash(state);
+            }
+            crate::Pat::Rest(v0) => {
+                state.write_u8(9u8);
+                v0.hash(state);
+            }
+            crate::Pat::Slice(v0) => {
+                state.write_u8(10u8);
+                v0.hash(state);
+            }
+            crate::Pat::Struct(v0) => {
+                state.write_u8(11u8);
+                v0.hash(state);
+            }
+            crate::Pat::Tuple(v0) => {
+                state.write_u8(12u8);
+                v0.hash(state);
+            }
+            crate::Pat::TupleStruct(v0) => {
+                state.write_u8(13u8);
+                v0.hash(state);
+            }
+            crate::Pat::Type(v0) => {
+                state.write_u8(14u8);
+                v0.hash(state);
+            }
+            crate::Pat::Verbatim(v0) => {
+                state.write_u8(15u8);
+                TokenStreamHelper(v0).hash(state);
+            }
+            crate::Pat::Wild(v0) => {
+                state.write_u8(16u8);
+                v0.hash(state);
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::PatIdent {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.by_ref.hash(state);
+        self.mutability.hash(state);
+        self.ident.hash(state);
+        self.subpat.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::PatOr {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.leading_vert.hash(state);
+        self.cases.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::PatParen {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.pat.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::PatReference {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.mutability.hash(state);
+        self.pat.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::PatRest {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::PatSlice {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.elems.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::PatStruct {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.qself.hash(state);
+        self.path.hash(state);
+        self.fields.hash(state);
+        self.rest.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::PatTuple {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.elems.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::PatTupleStruct {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.qself.hash(state);
+        self.path.hash(state);
+        self.elems.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::PatType {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.pat.hash(state);
+        self.ty.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::PatWild {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Path {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.leading_colon.hash(state);
+        self.segments.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::PathArguments {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::PathArguments::None => {
+                state.write_u8(0u8);
+            }
+            crate::PathArguments::AngleBracketed(v0) => {
+                state.write_u8(1u8);
+                v0.hash(state);
+            }
+            crate::PathArguments::Parenthesized(v0) => {
+                state.write_u8(2u8);
+                v0.hash(state);
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::PathSegment {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.ident.hash(state);
+        self.arguments.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::PredicateLifetime {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.lifetime.hash(state);
+        self.bounds.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::PredicateType {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.lifetimes.hash(state);
+        self.bounded_ty.hash(state);
+        self.bounds.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::QSelf {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.ty.hash(state);
+        self.position.hash(state);
+        self.as_token.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::RangeLimits {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::RangeLimits::HalfOpen(_) => {
+                state.write_u8(0u8);
+            }
+            crate::RangeLimits::Closed(_) => {
+                state.write_u8(1u8);
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Receiver {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.reference.hash(state);
+        self.mutability.hash(state);
+        self.colon_token.hash(state);
+        self.ty.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::ReturnType {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::ReturnType::Default => {
+                state.write_u8(0u8);
+            }
+            crate::ReturnType::Type(_, v1) => {
+                state.write_u8(1u8);
+                v1.hash(state);
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Signature {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.constness.hash(state);
+        self.asyncness.hash(state);
+        self.unsafety.hash(state);
+        self.abi.hash(state);
+        self.ident.hash(state);
+        self.generics.hash(state);
+        self.inputs.hash(state);
+        self.variadic.hash(state);
+        self.output.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::StaticMutability {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::StaticMutability::Mut(_) => {
+                state.write_u8(0u8);
+            }
+            crate::StaticMutability::None => {
+                state.write_u8(1u8);
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Stmt {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::Stmt::Local(v0) => {
+                state.write_u8(0u8);
+                v0.hash(state);
+            }
+            crate::Stmt::Item(v0) => {
+                state.write_u8(1u8);
+                v0.hash(state);
+            }
+            crate::Stmt::Expr(v0, v1) => {
+                state.write_u8(2u8);
+                v0.hash(state);
+                v1.hash(state);
+            }
+            crate::Stmt::Macro(v0) => {
+                state.write_u8(3u8);
+                v0.hash(state);
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::StmtMacro {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.mac.hash(state);
+        self.semi_token.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TraitBound {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.paren_token.hash(state);
+        self.modifier.hash(state);
+        self.lifetimes.hash(state);
+        self.path.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TraitBoundModifier {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::TraitBoundModifier::None => {
+                state.write_u8(0u8);
+            }
+            crate::TraitBoundModifier::Maybe(_) => {
+                state.write_u8(1u8);
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TraitItem {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::TraitItem::Const(v0) => {
+                state.write_u8(0u8);
+                v0.hash(state);
+            }
+            crate::TraitItem::Fn(v0) => {
+                state.write_u8(1u8);
+                v0.hash(state);
+            }
+            crate::TraitItem::Type(v0) => {
+                state.write_u8(2u8);
+                v0.hash(state);
+            }
+            crate::TraitItem::Macro(v0) => {
+                state.write_u8(3u8);
+                v0.hash(state);
+            }
+            crate::TraitItem::Verbatim(v0) => {
+                state.write_u8(4u8);
+                TokenStreamHelper(v0).hash(state);
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TraitItemConst {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.ident.hash(state);
+        self.generics.hash(state);
+        self.ty.hash(state);
+        self.default.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TraitItemFn {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.sig.hash(state);
+        self.default.hash(state);
+        self.semi_token.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TraitItemMacro {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.mac.hash(state);
+        self.semi_token.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TraitItemType {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.ident.hash(state);
+        self.generics.hash(state);
+        self.colon_token.hash(state);
+        self.bounds.hash(state);
+        self.default.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Type {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::Type::Array(v0) => {
+                state.write_u8(0u8);
+                v0.hash(state);
+            }
+            crate::Type::BareFn(v0) => {
+                state.write_u8(1u8);
+                v0.hash(state);
+            }
+            crate::Type::Group(v0) => {
+                state.write_u8(2u8);
+                v0.hash(state);
+            }
+            crate::Type::ImplTrait(v0) => {
+                state.write_u8(3u8);
+                v0.hash(state);
+            }
+            crate::Type::Infer(v0) => {
+                state.write_u8(4u8);
+                v0.hash(state);
+            }
+            crate::Type::Macro(v0) => {
+                state.write_u8(5u8);
+                v0.hash(state);
+            }
+            crate::Type::Never(v0) => {
+                state.write_u8(6u8);
+                v0.hash(state);
+            }
+            crate::Type::Paren(v0) => {
+                state.write_u8(7u8);
+                v0.hash(state);
+            }
+            crate::Type::Path(v0) => {
+                state.write_u8(8u8);
+                v0.hash(state);
+            }
+            crate::Type::Ptr(v0) => {
+                state.write_u8(9u8);
+                v0.hash(state);
+            }
+            crate::Type::Reference(v0) => {
+                state.write_u8(10u8);
+                v0.hash(state);
+            }
+            crate::Type::Slice(v0) => {
+                state.write_u8(11u8);
+                v0.hash(state);
+            }
+            crate::Type::TraitObject(v0) => {
+                state.write_u8(12u8);
+                v0.hash(state);
+            }
+            crate::Type::Tuple(v0) => {
+                state.write_u8(13u8);
+                v0.hash(state);
+            }
+            crate::Type::Verbatim(v0) => {
+                state.write_u8(14u8);
+                TokenStreamHelper(v0).hash(state);
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TypeArray {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.elem.hash(state);
+        self.len.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TypeBareFn {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.lifetimes.hash(state);
+        self.unsafety.hash(state);
+        self.abi.hash(state);
+        self.inputs.hash(state);
+        self.variadic.hash(state);
+        self.output.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TypeGroup {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.elem.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TypeImplTrait {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.bounds.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TypeInfer {
+    fn hash<H>(&self, _state: &mut H)
+    where
+        H: Hasher,
+    {}
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TypeMacro {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.mac.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TypeNever {
+    fn hash<H>(&self, _state: &mut H)
+    where
+        H: Hasher,
+    {}
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TypeParam {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.ident.hash(state);
+        self.colon_token.hash(state);
+        self.bounds.hash(state);
+        self.eq_token.hash(state);
+        self.default.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TypeParamBound {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::TypeParamBound::Trait(v0) => {
+                state.write_u8(0u8);
+                v0.hash(state);
+            }
+            crate::TypeParamBound::Lifetime(v0) => {
+                state.write_u8(1u8);
+                v0.hash(state);
+            }
+            crate::TypeParamBound::Verbatim(v0) => {
+                state.write_u8(2u8);
+                TokenStreamHelper(v0).hash(state);
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TypeParen {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.elem.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TypePath {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.qself.hash(state);
+        self.path.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TypePtr {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.const_token.hash(state);
+        self.mutability.hash(state);
+        self.elem.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TypeReference {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.lifetime.hash(state);
+        self.mutability.hash(state);
+        self.elem.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TypeSlice {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.elem.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TypeTraitObject {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.dyn_token.hash(state);
+        self.bounds.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::TypeTuple {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.elems.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::UnOp {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::UnOp::Deref(_) => {
+                state.write_u8(0u8);
+            }
+            crate::UnOp::Not(_) => {
+                state.write_u8(1u8);
+            }
+            crate::UnOp::Neg(_) => {
+                state.write_u8(2u8);
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::UseGlob {
+    fn hash<H>(&self, _state: &mut H)
+    where
+        H: Hasher,
+    {}
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::UseGroup {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.items.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::UseName {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.ident.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::UsePath {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.ident.hash(state);
+        self.tree.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::UseRename {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.ident.hash(state);
+        self.rename.hash(state);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::UseTree {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::UseTree::Path(v0) => {
+                state.write_u8(0u8);
+                v0.hash(state);
+            }
+            crate::UseTree::Name(v0) => {
+                state.write_u8(1u8);
+                v0.hash(state);
+            }
+            crate::UseTree::Rename(v0) => {
+                state.write_u8(2u8);
+                v0.hash(state);
+            }
+            crate::UseTree::Glob(v0) => {
+                state.write_u8(3u8);
+                v0.hash(state);
+            }
+            crate::UseTree::Group(v0) => {
+                state.write_u8(4u8);
+                v0.hash(state);
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Variadic {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.pat.hash(state);
+        self.comma.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Variant {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.attrs.hash(state);
+        self.ident.hash(state);
+        self.fields.hash(state);
+        self.discriminant.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::VisRestricted {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.in_token.hash(state);
+        self.path.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::Visibility {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::Visibility::Public(_) => {
+                state.write_u8(0u8);
+            }
+            crate::Visibility::Restricted(v0) => {
+                state.write_u8(1u8);
+                v0.hash(state);
+            }
+            crate::Visibility::Inherited => {
+                state.write_u8(2u8);
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::WhereClause {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.predicates.hash(state);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for crate::WherePredicate {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            crate::WherePredicate::Lifetime(v0) => {
+                state.write_u8(0u8);
+                v0.hash(state);
+            }
+            crate::WherePredicate::Type(v0) => {
+                state.write_u8(1u8);
+                v0.hash(state);
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/gen/visit.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/gen/visit.rs
--- 43.0.0-1/rust-vendor/syn/src/gen/visit.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/gen/visit.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,3858 @@
+// This file is @generated by syn-internal-codegen.
+// It is not intended for manual editing.
+
+#![allow(unused_variables)]
+#![allow(clippy::needless_pass_by_ref_mut)]
+#[cfg(any(feature = "full", feature = "derive"))]
+use crate::punctuated::Punctuated;
+#[cfg(feature = "full")]
+macro_rules! full {
+    ($e:expr) => {
+        $e
+    };
+}
+#[cfg(all(feature = "derive", not(feature = "full")))]
+macro_rules! full {
+    ($e:expr) => {
+        unreachable!()
+    };
+}
+macro_rules! skip {
+    ($($tt:tt)*) => {};
+}
+/// Syntax tree traversal to walk a shared borrow of a syntax tree.
+///
+/// See the [module documentation] for details.
+///
+/// [module documentation]: self
+pub trait Visit<'ast> {
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_abi(&mut self, i: &'ast crate::Abi) {
+        visit_abi(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_angle_bracketed_generic_arguments(
+        &mut self,
+        i: &'ast crate::AngleBracketedGenericArguments,
+    ) {
+        visit_angle_bracketed_generic_arguments(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_arm(&mut self, i: &'ast crate::Arm) {
+        visit_arm(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_assoc_const(&mut self, i: &'ast crate::AssocConst) {
+        visit_assoc_const(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_assoc_type(&mut self, i: &'ast crate::AssocType) {
+        visit_assoc_type(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_attr_style(&mut self, i: &'ast crate::AttrStyle) {
+        visit_attr_style(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_attribute(&mut self, i: &'ast crate::Attribute) {
+        visit_attribute(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_bare_fn_arg(&mut self, i: &'ast crate::BareFnArg) {
+        visit_bare_fn_arg(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_bare_variadic(&mut self, i: &'ast crate::BareVariadic) {
+        visit_bare_variadic(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_bin_op(&mut self, i: &'ast crate::BinOp) {
+        visit_bin_op(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_block(&mut self, i: &'ast crate::Block) {
+        visit_block(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_bound_lifetimes(&mut self, i: &'ast crate::BoundLifetimes) {
+        visit_bound_lifetimes(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_const_param(&mut self, i: &'ast crate::ConstParam) {
+        visit_const_param(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_constraint(&mut self, i: &'ast crate::Constraint) {
+        visit_constraint(self, i);
+    }
+    #[cfg(feature = "derive")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+    fn visit_data(&mut self, i: &'ast crate::Data) {
+        visit_data(self, i);
+    }
+    #[cfg(feature = "derive")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+    fn visit_data_enum(&mut self, i: &'ast crate::DataEnum) {
+        visit_data_enum(self, i);
+    }
+    #[cfg(feature = "derive")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+    fn visit_data_struct(&mut self, i: &'ast crate::DataStruct) {
+        visit_data_struct(self, i);
+    }
+    #[cfg(feature = "derive")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+    fn visit_data_union(&mut self, i: &'ast crate::DataUnion) {
+        visit_data_union(self, i);
+    }
+    #[cfg(feature = "derive")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+    fn visit_derive_input(&mut self, i: &'ast crate::DeriveInput) {
+        visit_derive_input(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr(&mut self, i: &'ast crate::Expr) {
+        visit_expr(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_array(&mut self, i: &'ast crate::ExprArray) {
+        visit_expr_array(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_assign(&mut self, i: &'ast crate::ExprAssign) {
+        visit_expr_assign(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_async(&mut self, i: &'ast crate::ExprAsync) {
+        visit_expr_async(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_await(&mut self, i: &'ast crate::ExprAwait) {
+        visit_expr_await(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_binary(&mut self, i: &'ast crate::ExprBinary) {
+        visit_expr_binary(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_block(&mut self, i: &'ast crate::ExprBlock) {
+        visit_expr_block(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_break(&mut self, i: &'ast crate::ExprBreak) {
+        visit_expr_break(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_call(&mut self, i: &'ast crate::ExprCall) {
+        visit_expr_call(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_cast(&mut self, i: &'ast crate::ExprCast) {
+        visit_expr_cast(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_closure(&mut self, i: &'ast crate::ExprClosure) {
+        visit_expr_closure(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_const(&mut self, i: &'ast crate::ExprConst) {
+        visit_expr_const(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_continue(&mut self, i: &'ast crate::ExprContinue) {
+        visit_expr_continue(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_field(&mut self, i: &'ast crate::ExprField) {
+        visit_expr_field(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_for_loop(&mut self, i: &'ast crate::ExprForLoop) {
+        visit_expr_for_loop(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_group(&mut self, i: &'ast crate::ExprGroup) {
+        visit_expr_group(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_if(&mut self, i: &'ast crate::ExprIf) {
+        visit_expr_if(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_index(&mut self, i: &'ast crate::ExprIndex) {
+        visit_expr_index(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_infer(&mut self, i: &'ast crate::ExprInfer) {
+        visit_expr_infer(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_let(&mut self, i: &'ast crate::ExprLet) {
+        visit_expr_let(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_lit(&mut self, i: &'ast crate::ExprLit) {
+        visit_expr_lit(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_loop(&mut self, i: &'ast crate::ExprLoop) {
+        visit_expr_loop(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_macro(&mut self, i: &'ast crate::ExprMacro) {
+        visit_expr_macro(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_match(&mut self, i: &'ast crate::ExprMatch) {
+        visit_expr_match(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_method_call(&mut self, i: &'ast crate::ExprMethodCall) {
+        visit_expr_method_call(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_paren(&mut self, i: &'ast crate::ExprParen) {
+        visit_expr_paren(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_path(&mut self, i: &'ast crate::ExprPath) {
+        visit_expr_path(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_range(&mut self, i: &'ast crate::ExprRange) {
+        visit_expr_range(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_reference(&mut self, i: &'ast crate::ExprReference) {
+        visit_expr_reference(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_repeat(&mut self, i: &'ast crate::ExprRepeat) {
+        visit_expr_repeat(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_return(&mut self, i: &'ast crate::ExprReturn) {
+        visit_expr_return(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_struct(&mut self, i: &'ast crate::ExprStruct) {
+        visit_expr_struct(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_try(&mut self, i: &'ast crate::ExprTry) {
+        visit_expr_try(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_try_block(&mut self, i: &'ast crate::ExprTryBlock) {
+        visit_expr_try_block(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_tuple(&mut self, i: &'ast crate::ExprTuple) {
+        visit_expr_tuple(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_unary(&mut self, i: &'ast crate::ExprUnary) {
+        visit_expr_unary(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_unsafe(&mut self, i: &'ast crate::ExprUnsafe) {
+        visit_expr_unsafe(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_while(&mut self, i: &'ast crate::ExprWhile) {
+        visit_expr_while(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_yield(&mut self, i: &'ast crate::ExprYield) {
+        visit_expr_yield(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_field(&mut self, i: &'ast crate::Field) {
+        visit_field(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_field_mutability(&mut self, i: &'ast crate::FieldMutability) {
+        visit_field_mutability(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_field_pat(&mut self, i: &'ast crate::FieldPat) {
+        visit_field_pat(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_field_value(&mut self, i: &'ast crate::FieldValue) {
+        visit_field_value(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_fields(&mut self, i: &'ast crate::Fields) {
+        visit_fields(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_fields_named(&mut self, i: &'ast crate::FieldsNamed) {
+        visit_fields_named(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_fields_unnamed(&mut self, i: &'ast crate::FieldsUnnamed) {
+        visit_fields_unnamed(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_file(&mut self, i: &'ast crate::File) {
+        visit_file(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_fn_arg(&mut self, i: &'ast crate::FnArg) {
+        visit_fn_arg(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_foreign_item(&mut self, i: &'ast crate::ForeignItem) {
+        visit_foreign_item(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_foreign_item_fn(&mut self, i: &'ast crate::ForeignItemFn) {
+        visit_foreign_item_fn(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_foreign_item_macro(&mut self, i: &'ast crate::ForeignItemMacro) {
+        visit_foreign_item_macro(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_foreign_item_static(&mut self, i: &'ast crate::ForeignItemStatic) {
+        visit_foreign_item_static(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_foreign_item_type(&mut self, i: &'ast crate::ForeignItemType) {
+        visit_foreign_item_type(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_generic_argument(&mut self, i: &'ast crate::GenericArgument) {
+        visit_generic_argument(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_generic_param(&mut self, i: &'ast crate::GenericParam) {
+        visit_generic_param(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_generics(&mut self, i: &'ast crate::Generics) {
+        visit_generics(self, i);
+    }
+    fn visit_ident(&mut self, i: &'ast proc_macro2::Ident) {
+        visit_ident(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_impl_item(&mut self, i: &'ast crate::ImplItem) {
+        visit_impl_item(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_impl_item_const(&mut self, i: &'ast crate::ImplItemConst) {
+        visit_impl_item_const(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_impl_item_fn(&mut self, i: &'ast crate::ImplItemFn) {
+        visit_impl_item_fn(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_impl_item_macro(&mut self, i: &'ast crate::ImplItemMacro) {
+        visit_impl_item_macro(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_impl_item_type(&mut self, i: &'ast crate::ImplItemType) {
+        visit_impl_item_type(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_impl_restriction(&mut self, i: &'ast crate::ImplRestriction) {
+        visit_impl_restriction(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_index(&mut self, i: &'ast crate::Index) {
+        visit_index(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item(&mut self, i: &'ast crate::Item) {
+        visit_item(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_const(&mut self, i: &'ast crate::ItemConst) {
+        visit_item_const(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_enum(&mut self, i: &'ast crate::ItemEnum) {
+        visit_item_enum(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_extern_crate(&mut self, i: &'ast crate::ItemExternCrate) {
+        visit_item_extern_crate(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_fn(&mut self, i: &'ast crate::ItemFn) {
+        visit_item_fn(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_foreign_mod(&mut self, i: &'ast crate::ItemForeignMod) {
+        visit_item_foreign_mod(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_impl(&mut self, i: &'ast crate::ItemImpl) {
+        visit_item_impl(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_macro(&mut self, i: &'ast crate::ItemMacro) {
+        visit_item_macro(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_mod(&mut self, i: &'ast crate::ItemMod) {
+        visit_item_mod(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_static(&mut self, i: &'ast crate::ItemStatic) {
+        visit_item_static(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_struct(&mut self, i: &'ast crate::ItemStruct) {
+        visit_item_struct(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_trait(&mut self, i: &'ast crate::ItemTrait) {
+        visit_item_trait(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_trait_alias(&mut self, i: &'ast crate::ItemTraitAlias) {
+        visit_item_trait_alias(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_type(&mut self, i: &'ast crate::ItemType) {
+        visit_item_type(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_union(&mut self, i: &'ast crate::ItemUnion) {
+        visit_item_union(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_use(&mut self, i: &'ast crate::ItemUse) {
+        visit_item_use(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_label(&mut self, i: &'ast crate::Label) {
+        visit_label(self, i);
+    }
+    fn visit_lifetime(&mut self, i: &'ast crate::Lifetime) {
+        visit_lifetime(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_lifetime_param(&mut self, i: &'ast crate::LifetimeParam) {
+        visit_lifetime_param(self, i);
+    }
+    fn visit_lit(&mut self, i: &'ast crate::Lit) {
+        visit_lit(self, i);
+    }
+    fn visit_lit_bool(&mut self, i: &'ast crate::LitBool) {
+        visit_lit_bool(self, i);
+    }
+    fn visit_lit_byte(&mut self, i: &'ast crate::LitByte) {
+        visit_lit_byte(self, i);
+    }
+    fn visit_lit_byte_str(&mut self, i: &'ast crate::LitByteStr) {
+        visit_lit_byte_str(self, i);
+    }
+    fn visit_lit_cstr(&mut self, i: &'ast crate::LitCStr) {
+        visit_lit_cstr(self, i);
+    }
+    fn visit_lit_char(&mut self, i: &'ast crate::LitChar) {
+        visit_lit_char(self, i);
+    }
+    fn visit_lit_float(&mut self, i: &'ast crate::LitFloat) {
+        visit_lit_float(self, i);
+    }
+    fn visit_lit_int(&mut self, i: &'ast crate::LitInt) {
+        visit_lit_int(self, i);
+    }
+    fn visit_lit_str(&mut self, i: &'ast crate::LitStr) {
+        visit_lit_str(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_local(&mut self, i: &'ast crate::Local) {
+        visit_local(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_local_init(&mut self, i: &'ast crate::LocalInit) {
+        visit_local_init(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_macro(&mut self, i: &'ast crate::Macro) {
+        visit_macro(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_macro_delimiter(&mut self, i: &'ast crate::MacroDelimiter) {
+        visit_macro_delimiter(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_member(&mut self, i: &'ast crate::Member) {
+        visit_member(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_meta(&mut self, i: &'ast crate::Meta) {
+        visit_meta(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_meta_list(&mut self, i: &'ast crate::MetaList) {
+        visit_meta_list(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_meta_name_value(&mut self, i: &'ast crate::MetaNameValue) {
+        visit_meta_name_value(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_parenthesized_generic_arguments(
+        &mut self,
+        i: &'ast crate::ParenthesizedGenericArguments,
+    ) {
+        visit_parenthesized_generic_arguments(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat(&mut self, i: &'ast crate::Pat) {
+        visit_pat(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_ident(&mut self, i: &'ast crate::PatIdent) {
+        visit_pat_ident(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_or(&mut self, i: &'ast crate::PatOr) {
+        visit_pat_or(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_paren(&mut self, i: &'ast crate::PatParen) {
+        visit_pat_paren(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_reference(&mut self, i: &'ast crate::PatReference) {
+        visit_pat_reference(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_rest(&mut self, i: &'ast crate::PatRest) {
+        visit_pat_rest(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_slice(&mut self, i: &'ast crate::PatSlice) {
+        visit_pat_slice(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_struct(&mut self, i: &'ast crate::PatStruct) {
+        visit_pat_struct(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_tuple(&mut self, i: &'ast crate::PatTuple) {
+        visit_pat_tuple(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_tuple_struct(&mut self, i: &'ast crate::PatTupleStruct) {
+        visit_pat_tuple_struct(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_type(&mut self, i: &'ast crate::PatType) {
+        visit_pat_type(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_wild(&mut self, i: &'ast crate::PatWild) {
+        visit_pat_wild(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_path(&mut self, i: &'ast crate::Path) {
+        visit_path(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_path_arguments(&mut self, i: &'ast crate::PathArguments) {
+        visit_path_arguments(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_path_segment(&mut self, i: &'ast crate::PathSegment) {
+        visit_path_segment(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_predicate_lifetime(&mut self, i: &'ast crate::PredicateLifetime) {
+        visit_predicate_lifetime(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_predicate_type(&mut self, i: &'ast crate::PredicateType) {
+        visit_predicate_type(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_qself(&mut self, i: &'ast crate::QSelf) {
+        visit_qself(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_range_limits(&mut self, i: &'ast crate::RangeLimits) {
+        visit_range_limits(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_receiver(&mut self, i: &'ast crate::Receiver) {
+        visit_receiver(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_return_type(&mut self, i: &'ast crate::ReturnType) {
+        visit_return_type(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_signature(&mut self, i: &'ast crate::Signature) {
+        visit_signature(self, i);
+    }
+    fn visit_span(&mut self, i: &proc_macro2::Span) {
+        visit_span(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_static_mutability(&mut self, i: &'ast crate::StaticMutability) {
+        visit_static_mutability(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_stmt(&mut self, i: &'ast crate::Stmt) {
+        visit_stmt(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_stmt_macro(&mut self, i: &'ast crate::StmtMacro) {
+        visit_stmt_macro(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_trait_bound(&mut self, i: &'ast crate::TraitBound) {
+        visit_trait_bound(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_trait_bound_modifier(&mut self, i: &'ast crate::TraitBoundModifier) {
+        visit_trait_bound_modifier(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_trait_item(&mut self, i: &'ast crate::TraitItem) {
+        visit_trait_item(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_trait_item_const(&mut self, i: &'ast crate::TraitItemConst) {
+        visit_trait_item_const(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_trait_item_fn(&mut self, i: &'ast crate::TraitItemFn) {
+        visit_trait_item_fn(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_trait_item_macro(&mut self, i: &'ast crate::TraitItemMacro) {
+        visit_trait_item_macro(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_trait_item_type(&mut self, i: &'ast crate::TraitItemType) {
+        visit_trait_item_type(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type(&mut self, i: &'ast crate::Type) {
+        visit_type(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_array(&mut self, i: &'ast crate::TypeArray) {
+        visit_type_array(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_bare_fn(&mut self, i: &'ast crate::TypeBareFn) {
+        visit_type_bare_fn(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_group(&mut self, i: &'ast crate::TypeGroup) {
+        visit_type_group(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_impl_trait(&mut self, i: &'ast crate::TypeImplTrait) {
+        visit_type_impl_trait(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_infer(&mut self, i: &'ast crate::TypeInfer) {
+        visit_type_infer(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_macro(&mut self, i: &'ast crate::TypeMacro) {
+        visit_type_macro(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_never(&mut self, i: &'ast crate::TypeNever) {
+        visit_type_never(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_param(&mut self, i: &'ast crate::TypeParam) {
+        visit_type_param(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_param_bound(&mut self, i: &'ast crate::TypeParamBound) {
+        visit_type_param_bound(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_paren(&mut self, i: &'ast crate::TypeParen) {
+        visit_type_paren(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_path(&mut self, i: &'ast crate::TypePath) {
+        visit_type_path(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_ptr(&mut self, i: &'ast crate::TypePtr) {
+        visit_type_ptr(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_reference(&mut self, i: &'ast crate::TypeReference) {
+        visit_type_reference(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_slice(&mut self, i: &'ast crate::TypeSlice) {
+        visit_type_slice(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_trait_object(&mut self, i: &'ast crate::TypeTraitObject) {
+        visit_type_trait_object(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_tuple(&mut self, i: &'ast crate::TypeTuple) {
+        visit_type_tuple(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_un_op(&mut self, i: &'ast crate::UnOp) {
+        visit_un_op(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_use_glob(&mut self, i: &'ast crate::UseGlob) {
+        visit_use_glob(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_use_group(&mut self, i: &'ast crate::UseGroup) {
+        visit_use_group(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_use_name(&mut self, i: &'ast crate::UseName) {
+        visit_use_name(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_use_path(&mut self, i: &'ast crate::UsePath) {
+        visit_use_path(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_use_rename(&mut self, i: &'ast crate::UseRename) {
+        visit_use_rename(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_use_tree(&mut self, i: &'ast crate::UseTree) {
+        visit_use_tree(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_variadic(&mut self, i: &'ast crate::Variadic) {
+        visit_variadic(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_variant(&mut self, i: &'ast crate::Variant) {
+        visit_variant(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_vis_restricted(&mut self, i: &'ast crate::VisRestricted) {
+        visit_vis_restricted(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_visibility(&mut self, i: &'ast crate::Visibility) {
+        visit_visibility(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_where_clause(&mut self, i: &'ast crate::WhereClause) {
+        visit_where_clause(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_where_predicate(&mut self, i: &'ast crate::WherePredicate) {
+        visit_where_predicate(self, i);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_abi<'ast, V>(v: &mut V, node: &'ast crate::Abi)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.extern_token);
+    if let Some(it) = &node.name {
+        v.visit_lit_str(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_angle_bracketed_generic_arguments<'ast, V>(
+    v: &mut V,
+    node: &'ast crate::AngleBracketedGenericArguments,
+)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.colon2_token);
+    skip!(node.lt_token);
+    for el in Punctuated::pairs(&node.args) {
+        let it = el.value();
+        v.visit_generic_argument(it);
+    }
+    skip!(node.gt_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_arm<'ast, V>(v: &mut V, node: &'ast crate::Arm)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_pat(&node.pat);
+    if let Some(it) = &node.guard {
+        skip!((it).0);
+        v.visit_expr(&*(it).1);
+    }
+    skip!(node.fat_arrow_token);
+    v.visit_expr(&*node.body);
+    skip!(node.comma);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_assoc_const<'ast, V>(v: &mut V, node: &'ast crate::AssocConst)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_ident(&node.ident);
+    if let Some(it) = &node.generics {
+        v.visit_angle_bracketed_generic_arguments(it);
+    }
+    skip!(node.eq_token);
+    v.visit_expr(&node.value);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_assoc_type<'ast, V>(v: &mut V, node: &'ast crate::AssocType)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_ident(&node.ident);
+    if let Some(it) = &node.generics {
+        v.visit_angle_bracketed_generic_arguments(it);
+    }
+    skip!(node.eq_token);
+    v.visit_type(&node.ty);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_attr_style<'ast, V>(v: &mut V, node: &'ast crate::AttrStyle)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::AttrStyle::Outer => {}
+        crate::AttrStyle::Inner(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_attribute<'ast, V>(v: &mut V, node: &'ast crate::Attribute)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.pound_token);
+    v.visit_attr_style(&node.style);
+    skip!(node.bracket_token);
+    v.visit_meta(&node.meta);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_bare_fn_arg<'ast, V>(v: &mut V, node: &'ast crate::BareFnArg)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    if let Some(it) = &node.name {
+        v.visit_ident(&(it).0);
+        skip!((it).1);
+    }
+    v.visit_type(&node.ty);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_bare_variadic<'ast, V>(v: &mut V, node: &'ast crate::BareVariadic)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    if let Some(it) = &node.name {
+        v.visit_ident(&(it).0);
+        skip!((it).1);
+    }
+    skip!(node.dots);
+    skip!(node.comma);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_bin_op<'ast, V>(v: &mut V, node: &'ast crate::BinOp)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::BinOp::Add(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Sub(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Mul(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Div(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Rem(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::And(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Or(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::BitXor(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::BitAnd(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::BitOr(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Shl(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Shr(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Eq(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Lt(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Le(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Ne(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Ge(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Gt(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::AddAssign(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::SubAssign(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::MulAssign(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::DivAssign(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::RemAssign(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::BitXorAssign(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::BitAndAssign(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::BitOrAssign(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::ShlAssign(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::ShrAssign(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_block<'ast, V>(v: &mut V, node: &'ast crate::Block)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.brace_token);
+    for it in &node.stmts {
+        v.visit_stmt(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_bound_lifetimes<'ast, V>(v: &mut V, node: &'ast crate::BoundLifetimes)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.for_token);
+    skip!(node.lt_token);
+    for el in Punctuated::pairs(&node.lifetimes) {
+        let it = el.value();
+        v.visit_generic_param(it);
+    }
+    skip!(node.gt_token);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_const_param<'ast, V>(v: &mut V, node: &'ast crate::ConstParam)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.const_token);
+    v.visit_ident(&node.ident);
+    skip!(node.colon_token);
+    v.visit_type(&node.ty);
+    skip!(node.eq_token);
+    if let Some(it) = &node.default {
+        v.visit_expr(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_constraint<'ast, V>(v: &mut V, node: &'ast crate::Constraint)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_ident(&node.ident);
+    if let Some(it) = &node.generics {
+        v.visit_angle_bracketed_generic_arguments(it);
+    }
+    skip!(node.colon_token);
+    for el in Punctuated::pairs(&node.bounds) {
+        let it = el.value();
+        v.visit_type_param_bound(it);
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+pub fn visit_data<'ast, V>(v: &mut V, node: &'ast crate::Data)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::Data::Struct(_binding_0) => {
+            v.visit_data_struct(_binding_0);
+        }
+        crate::Data::Enum(_binding_0) => {
+            v.visit_data_enum(_binding_0);
+        }
+        crate::Data::Union(_binding_0) => {
+            v.visit_data_union(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+pub fn visit_data_enum<'ast, V>(v: &mut V, node: &'ast crate::DataEnum)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.enum_token);
+    skip!(node.brace_token);
+    for el in Punctuated::pairs(&node.variants) {
+        let it = el.value();
+        v.visit_variant(it);
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+pub fn visit_data_struct<'ast, V>(v: &mut V, node: &'ast crate::DataStruct)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.struct_token);
+    v.visit_fields(&node.fields);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+pub fn visit_data_union<'ast, V>(v: &mut V, node: &'ast crate::DataUnion)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.union_token);
+    v.visit_fields_named(&node.fields);
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+pub fn visit_derive_input<'ast, V>(v: &mut V, node: &'ast crate::DeriveInput)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_visibility(&node.vis);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    v.visit_data(&node.data);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr<'ast, V>(v: &mut V, node: &'ast crate::Expr)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::Expr::Array(_binding_0) => {
+            full!(v.visit_expr_array(_binding_0));
+        }
+        crate::Expr::Assign(_binding_0) => {
+            full!(v.visit_expr_assign(_binding_0));
+        }
+        crate::Expr::Async(_binding_0) => {
+            full!(v.visit_expr_async(_binding_0));
+        }
+        crate::Expr::Await(_binding_0) => {
+            full!(v.visit_expr_await(_binding_0));
+        }
+        crate::Expr::Binary(_binding_0) => {
+            v.visit_expr_binary(_binding_0);
+        }
+        crate::Expr::Block(_binding_0) => {
+            full!(v.visit_expr_block(_binding_0));
+        }
+        crate::Expr::Break(_binding_0) => {
+            full!(v.visit_expr_break(_binding_0));
+        }
+        crate::Expr::Call(_binding_0) => {
+            v.visit_expr_call(_binding_0);
+        }
+        crate::Expr::Cast(_binding_0) => {
+            v.visit_expr_cast(_binding_0);
+        }
+        crate::Expr::Closure(_binding_0) => {
+            full!(v.visit_expr_closure(_binding_0));
+        }
+        crate::Expr::Const(_binding_0) => {
+            full!(v.visit_expr_const(_binding_0));
+        }
+        crate::Expr::Continue(_binding_0) => {
+            full!(v.visit_expr_continue(_binding_0));
+        }
+        crate::Expr::Field(_binding_0) => {
+            v.visit_expr_field(_binding_0);
+        }
+        crate::Expr::ForLoop(_binding_0) => {
+            full!(v.visit_expr_for_loop(_binding_0));
+        }
+        crate::Expr::Group(_binding_0) => {
+            v.visit_expr_group(_binding_0);
+        }
+        crate::Expr::If(_binding_0) => {
+            full!(v.visit_expr_if(_binding_0));
+        }
+        crate::Expr::Index(_binding_0) => {
+            v.visit_expr_index(_binding_0);
+        }
+        crate::Expr::Infer(_binding_0) => {
+            full!(v.visit_expr_infer(_binding_0));
+        }
+        crate::Expr::Let(_binding_0) => {
+            full!(v.visit_expr_let(_binding_0));
+        }
+        crate::Expr::Lit(_binding_0) => {
+            v.visit_expr_lit(_binding_0);
+        }
+        crate::Expr::Loop(_binding_0) => {
+            full!(v.visit_expr_loop(_binding_0));
+        }
+        crate::Expr::Macro(_binding_0) => {
+            v.visit_expr_macro(_binding_0);
+        }
+        crate::Expr::Match(_binding_0) => {
+            full!(v.visit_expr_match(_binding_0));
+        }
+        crate::Expr::MethodCall(_binding_0) => {
+            v.visit_expr_method_call(_binding_0);
+        }
+        crate::Expr::Paren(_binding_0) => {
+            v.visit_expr_paren(_binding_0);
+        }
+        crate::Expr::Path(_binding_0) => {
+            v.visit_expr_path(_binding_0);
+        }
+        crate::Expr::Range(_binding_0) => {
+            full!(v.visit_expr_range(_binding_0));
+        }
+        crate::Expr::Reference(_binding_0) => {
+            v.visit_expr_reference(_binding_0);
+        }
+        crate::Expr::Repeat(_binding_0) => {
+            full!(v.visit_expr_repeat(_binding_0));
+        }
+        crate::Expr::Return(_binding_0) => {
+            full!(v.visit_expr_return(_binding_0));
+        }
+        crate::Expr::Struct(_binding_0) => {
+            v.visit_expr_struct(_binding_0);
+        }
+        crate::Expr::Try(_binding_0) => {
+            full!(v.visit_expr_try(_binding_0));
+        }
+        crate::Expr::TryBlock(_binding_0) => {
+            full!(v.visit_expr_try_block(_binding_0));
+        }
+        crate::Expr::Tuple(_binding_0) => {
+            full!(v.visit_expr_tuple(_binding_0));
+        }
+        crate::Expr::Unary(_binding_0) => {
+            v.visit_expr_unary(_binding_0);
+        }
+        crate::Expr::Unsafe(_binding_0) => {
+            full!(v.visit_expr_unsafe(_binding_0));
+        }
+        crate::Expr::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::Expr::While(_binding_0) => {
+            full!(v.visit_expr_while(_binding_0));
+        }
+        crate::Expr::Yield(_binding_0) => {
+            full!(v.visit_expr_yield(_binding_0));
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_array<'ast, V>(v: &mut V, node: &'ast crate::ExprArray)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.bracket_token);
+    for el in Punctuated::pairs(&node.elems) {
+        let it = el.value();
+        v.visit_expr(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_assign<'ast, V>(v: &mut V, node: &'ast crate::ExprAssign)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_expr(&*node.left);
+    skip!(node.eq_token);
+    v.visit_expr(&*node.right);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_async<'ast, V>(v: &mut V, node: &'ast crate::ExprAsync)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.async_token);
+    skip!(node.capture);
+    v.visit_block(&node.block);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_await<'ast, V>(v: &mut V, node: &'ast crate::ExprAwait)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_expr(&*node.base);
+    skip!(node.dot_token);
+    skip!(node.await_token);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_binary<'ast, V>(v: &mut V, node: &'ast crate::ExprBinary)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_expr(&*node.left);
+    v.visit_bin_op(&node.op);
+    v.visit_expr(&*node.right);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_block<'ast, V>(v: &mut V, node: &'ast crate::ExprBlock)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    if let Some(it) = &node.label {
+        v.visit_label(it);
+    }
+    v.visit_block(&node.block);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_break<'ast, V>(v: &mut V, node: &'ast crate::ExprBreak)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.break_token);
+    if let Some(it) = &node.label {
+        v.visit_lifetime(it);
+    }
+    if let Some(it) = &node.expr {
+        v.visit_expr(&**it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_call<'ast, V>(v: &mut V, node: &'ast crate::ExprCall)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_expr(&*node.func);
+    skip!(node.paren_token);
+    for el in Punctuated::pairs(&node.args) {
+        let it = el.value();
+        v.visit_expr(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_cast<'ast, V>(v: &mut V, node: &'ast crate::ExprCast)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_expr(&*node.expr);
+    skip!(node.as_token);
+    v.visit_type(&*node.ty);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_closure<'ast, V>(v: &mut V, node: &'ast crate::ExprClosure)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    if let Some(it) = &node.lifetimes {
+        v.visit_bound_lifetimes(it);
+    }
+    skip!(node.constness);
+    skip!(node.movability);
+    skip!(node.asyncness);
+    skip!(node.capture);
+    skip!(node.or1_token);
+    for el in Punctuated::pairs(&node.inputs) {
+        let it = el.value();
+        v.visit_pat(it);
+    }
+    skip!(node.or2_token);
+    v.visit_return_type(&node.output);
+    v.visit_expr(&*node.body);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_const<'ast, V>(v: &mut V, node: &'ast crate::ExprConst)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.const_token);
+    v.visit_block(&node.block);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_continue<'ast, V>(v: &mut V, node: &'ast crate::ExprContinue)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.continue_token);
+    if let Some(it) = &node.label {
+        v.visit_lifetime(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_field<'ast, V>(v: &mut V, node: &'ast crate::ExprField)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_expr(&*node.base);
+    skip!(node.dot_token);
+    v.visit_member(&node.member);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_for_loop<'ast, V>(v: &mut V, node: &'ast crate::ExprForLoop)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    if let Some(it) = &node.label {
+        v.visit_label(it);
+    }
+    skip!(node.for_token);
+    v.visit_pat(&*node.pat);
+    skip!(node.in_token);
+    v.visit_expr(&*node.expr);
+    v.visit_block(&node.body);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_group<'ast, V>(v: &mut V, node: &'ast crate::ExprGroup)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.group_token);
+    v.visit_expr(&*node.expr);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_if<'ast, V>(v: &mut V, node: &'ast crate::ExprIf)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.if_token);
+    v.visit_expr(&*node.cond);
+    v.visit_block(&node.then_branch);
+    if let Some(it) = &node.else_branch {
+        skip!((it).0);
+        v.visit_expr(&*(it).1);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_index<'ast, V>(v: &mut V, node: &'ast crate::ExprIndex)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_expr(&*node.expr);
+    skip!(node.bracket_token);
+    v.visit_expr(&*node.index);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_infer<'ast, V>(v: &mut V, node: &'ast crate::ExprInfer)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.underscore_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_let<'ast, V>(v: &mut V, node: &'ast crate::ExprLet)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.let_token);
+    v.visit_pat(&*node.pat);
+    skip!(node.eq_token);
+    v.visit_expr(&*node.expr);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_lit<'ast, V>(v: &mut V, node: &'ast crate::ExprLit)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_lit(&node.lit);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_loop<'ast, V>(v: &mut V, node: &'ast crate::ExprLoop)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    if let Some(it) = &node.label {
+        v.visit_label(it);
+    }
+    skip!(node.loop_token);
+    v.visit_block(&node.body);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_macro<'ast, V>(v: &mut V, node: &'ast crate::ExprMacro)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_macro(&node.mac);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_match<'ast, V>(v: &mut V, node: &'ast crate::ExprMatch)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.match_token);
+    v.visit_expr(&*node.expr);
+    skip!(node.brace_token);
+    for it in &node.arms {
+        v.visit_arm(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_method_call<'ast, V>(v: &mut V, node: &'ast crate::ExprMethodCall)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_expr(&*node.receiver);
+    skip!(node.dot_token);
+    v.visit_ident(&node.method);
+    if let Some(it) = &node.turbofish {
+        v.visit_angle_bracketed_generic_arguments(it);
+    }
+    skip!(node.paren_token);
+    for el in Punctuated::pairs(&node.args) {
+        let it = el.value();
+        v.visit_expr(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_paren<'ast, V>(v: &mut V, node: &'ast crate::ExprParen)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.paren_token);
+    v.visit_expr(&*node.expr);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_path<'ast, V>(v: &mut V, node: &'ast crate::ExprPath)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    if let Some(it) = &node.qself {
+        v.visit_qself(it);
+    }
+    v.visit_path(&node.path);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_range<'ast, V>(v: &mut V, node: &'ast crate::ExprRange)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    if let Some(it) = &node.start {
+        v.visit_expr(&**it);
+    }
+    v.visit_range_limits(&node.limits);
+    if let Some(it) = &node.end {
+        v.visit_expr(&**it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_reference<'ast, V>(v: &mut V, node: &'ast crate::ExprReference)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.and_token);
+    skip!(node.mutability);
+    v.visit_expr(&*node.expr);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_repeat<'ast, V>(v: &mut V, node: &'ast crate::ExprRepeat)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.bracket_token);
+    v.visit_expr(&*node.expr);
+    skip!(node.semi_token);
+    v.visit_expr(&*node.len);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_return<'ast, V>(v: &mut V, node: &'ast crate::ExprReturn)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.return_token);
+    if let Some(it) = &node.expr {
+        v.visit_expr(&**it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_struct<'ast, V>(v: &mut V, node: &'ast crate::ExprStruct)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    if let Some(it) = &node.qself {
+        v.visit_qself(it);
+    }
+    v.visit_path(&node.path);
+    skip!(node.brace_token);
+    for el in Punctuated::pairs(&node.fields) {
+        let it = el.value();
+        v.visit_field_value(it);
+    }
+    skip!(node.dot2_token);
+    if let Some(it) = &node.rest {
+        v.visit_expr(&**it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_try<'ast, V>(v: &mut V, node: &'ast crate::ExprTry)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_expr(&*node.expr);
+    skip!(node.question_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_try_block<'ast, V>(v: &mut V, node: &'ast crate::ExprTryBlock)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.try_token);
+    v.visit_block(&node.block);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_tuple<'ast, V>(v: &mut V, node: &'ast crate::ExprTuple)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.paren_token);
+    for el in Punctuated::pairs(&node.elems) {
+        let it = el.value();
+        v.visit_expr(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_unary<'ast, V>(v: &mut V, node: &'ast crate::ExprUnary)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_un_op(&node.op);
+    v.visit_expr(&*node.expr);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_unsafe<'ast, V>(v: &mut V, node: &'ast crate::ExprUnsafe)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.unsafe_token);
+    v.visit_block(&node.block);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_while<'ast, V>(v: &mut V, node: &'ast crate::ExprWhile)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    if let Some(it) = &node.label {
+        v.visit_label(it);
+    }
+    skip!(node.while_token);
+    v.visit_expr(&*node.cond);
+    v.visit_block(&node.body);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_yield<'ast, V>(v: &mut V, node: &'ast crate::ExprYield)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.yield_token);
+    if let Some(it) = &node.expr {
+        v.visit_expr(&**it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_field<'ast, V>(v: &mut V, node: &'ast crate::Field)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_visibility(&node.vis);
+    v.visit_field_mutability(&node.mutability);
+    if let Some(it) = &node.ident {
+        v.visit_ident(it);
+    }
+    skip!(node.colon_token);
+    v.visit_type(&node.ty);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_field_mutability<'ast, V>(v: &mut V, node: &'ast crate::FieldMutability)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::FieldMutability::None => {}
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_field_pat<'ast, V>(v: &mut V, node: &'ast crate::FieldPat)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_member(&node.member);
+    skip!(node.colon_token);
+    v.visit_pat(&*node.pat);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_field_value<'ast, V>(v: &mut V, node: &'ast crate::FieldValue)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_member(&node.member);
+    skip!(node.colon_token);
+    v.visit_expr(&node.expr);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_fields<'ast, V>(v: &mut V, node: &'ast crate::Fields)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::Fields::Named(_binding_0) => {
+            v.visit_fields_named(_binding_0);
+        }
+        crate::Fields::Unnamed(_binding_0) => {
+            v.visit_fields_unnamed(_binding_0);
+        }
+        crate::Fields::Unit => {}
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_fields_named<'ast, V>(v: &mut V, node: &'ast crate::FieldsNamed)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.brace_token);
+    for el in Punctuated::pairs(&node.named) {
+        let it = el.value();
+        v.visit_field(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_fields_unnamed<'ast, V>(v: &mut V, node: &'ast crate::FieldsUnnamed)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.paren_token);
+    for el in Punctuated::pairs(&node.unnamed) {
+        let it = el.value();
+        v.visit_field(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_file<'ast, V>(v: &mut V, node: &'ast crate::File)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.shebang);
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    for it in &node.items {
+        v.visit_item(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_fn_arg<'ast, V>(v: &mut V, node: &'ast crate::FnArg)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::FnArg::Receiver(_binding_0) => {
+            v.visit_receiver(_binding_0);
+        }
+        crate::FnArg::Typed(_binding_0) => {
+            v.visit_pat_type(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_foreign_item<'ast, V>(v: &mut V, node: &'ast crate::ForeignItem)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::ForeignItem::Fn(_binding_0) => {
+            v.visit_foreign_item_fn(_binding_0);
+        }
+        crate::ForeignItem::Static(_binding_0) => {
+            v.visit_foreign_item_static(_binding_0);
+        }
+        crate::ForeignItem::Type(_binding_0) => {
+            v.visit_foreign_item_type(_binding_0);
+        }
+        crate::ForeignItem::Macro(_binding_0) => {
+            v.visit_foreign_item_macro(_binding_0);
+        }
+        crate::ForeignItem::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_foreign_item_fn<'ast, V>(v: &mut V, node: &'ast crate::ForeignItemFn)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_visibility(&node.vis);
+    v.visit_signature(&node.sig);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_foreign_item_macro<'ast, V>(v: &mut V, node: &'ast crate::ForeignItemMacro)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_macro(&node.mac);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_foreign_item_static<'ast, V>(
+    v: &mut V,
+    node: &'ast crate::ForeignItemStatic,
+)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_visibility(&node.vis);
+    skip!(node.static_token);
+    v.visit_static_mutability(&node.mutability);
+    v.visit_ident(&node.ident);
+    skip!(node.colon_token);
+    v.visit_type(&*node.ty);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_foreign_item_type<'ast, V>(v: &mut V, node: &'ast crate::ForeignItemType)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_visibility(&node.vis);
+    skip!(node.type_token);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    skip!(node.semi_token);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_generic_argument<'ast, V>(v: &mut V, node: &'ast crate::GenericArgument)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::GenericArgument::Lifetime(_binding_0) => {
+            v.visit_lifetime(_binding_0);
+        }
+        crate::GenericArgument::Type(_binding_0) => {
+            v.visit_type(_binding_0);
+        }
+        crate::GenericArgument::Const(_binding_0) => {
+            v.visit_expr(_binding_0);
+        }
+        crate::GenericArgument::AssocType(_binding_0) => {
+            v.visit_assoc_type(_binding_0);
+        }
+        crate::GenericArgument::AssocConst(_binding_0) => {
+            v.visit_assoc_const(_binding_0);
+        }
+        crate::GenericArgument::Constraint(_binding_0) => {
+            v.visit_constraint(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_generic_param<'ast, V>(v: &mut V, node: &'ast crate::GenericParam)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::GenericParam::Lifetime(_binding_0) => {
+            v.visit_lifetime_param(_binding_0);
+        }
+        crate::GenericParam::Type(_binding_0) => {
+            v.visit_type_param(_binding_0);
+        }
+        crate::GenericParam::Const(_binding_0) => {
+            v.visit_const_param(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_generics<'ast, V>(v: &mut V, node: &'ast crate::Generics)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.lt_token);
+    for el in Punctuated::pairs(&node.params) {
+        let it = el.value();
+        v.visit_generic_param(it);
+    }
+    skip!(node.gt_token);
+    if let Some(it) = &node.where_clause {
+        v.visit_where_clause(it);
+    }
+}
+pub fn visit_ident<'ast, V>(v: &mut V, node: &'ast proc_macro2::Ident)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_span(&node.span());
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_impl_item<'ast, V>(v: &mut V, node: &'ast crate::ImplItem)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::ImplItem::Const(_binding_0) => {
+            v.visit_impl_item_const(_binding_0);
+        }
+        crate::ImplItem::Fn(_binding_0) => {
+            v.visit_impl_item_fn(_binding_0);
+        }
+        crate::ImplItem::Type(_binding_0) => {
+            v.visit_impl_item_type(_binding_0);
+        }
+        crate::ImplItem::Macro(_binding_0) => {
+            v.visit_impl_item_macro(_binding_0);
+        }
+        crate::ImplItem::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_impl_item_const<'ast, V>(v: &mut V, node: &'ast crate::ImplItemConst)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_visibility(&node.vis);
+    skip!(node.defaultness);
+    skip!(node.const_token);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    skip!(node.colon_token);
+    v.visit_type(&node.ty);
+    skip!(node.eq_token);
+    v.visit_expr(&node.expr);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_impl_item_fn<'ast, V>(v: &mut V, node: &'ast crate::ImplItemFn)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_visibility(&node.vis);
+    skip!(node.defaultness);
+    v.visit_signature(&node.sig);
+    v.visit_block(&node.block);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_impl_item_macro<'ast, V>(v: &mut V, node: &'ast crate::ImplItemMacro)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_macro(&node.mac);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_impl_item_type<'ast, V>(v: &mut V, node: &'ast crate::ImplItemType)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_visibility(&node.vis);
+    skip!(node.defaultness);
+    skip!(node.type_token);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    skip!(node.eq_token);
+    v.visit_type(&node.ty);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_impl_restriction<'ast, V>(v: &mut V, node: &'ast crate::ImplRestriction)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match *node {}
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_index<'ast, V>(v: &mut V, node: &'ast crate::Index)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.index);
+    v.visit_span(&node.span);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item<'ast, V>(v: &mut V, node: &'ast crate::Item)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::Item::Const(_binding_0) => {
+            v.visit_item_const(_binding_0);
+        }
+        crate::Item::Enum(_binding_0) => {
+            v.visit_item_enum(_binding_0);
+        }
+        crate::Item::ExternCrate(_binding_0) => {
+            v.visit_item_extern_crate(_binding_0);
+        }
+        crate::Item::Fn(_binding_0) => {
+            v.visit_item_fn(_binding_0);
+        }
+        crate::Item::ForeignMod(_binding_0) => {
+            v.visit_item_foreign_mod(_binding_0);
+        }
+        crate::Item::Impl(_binding_0) => {
+            v.visit_item_impl(_binding_0);
+        }
+        crate::Item::Macro(_binding_0) => {
+            v.visit_item_macro(_binding_0);
+        }
+        crate::Item::Mod(_binding_0) => {
+            v.visit_item_mod(_binding_0);
+        }
+        crate::Item::Static(_binding_0) => {
+            v.visit_item_static(_binding_0);
+        }
+        crate::Item::Struct(_binding_0) => {
+            v.visit_item_struct(_binding_0);
+        }
+        crate::Item::Trait(_binding_0) => {
+            v.visit_item_trait(_binding_0);
+        }
+        crate::Item::TraitAlias(_binding_0) => {
+            v.visit_item_trait_alias(_binding_0);
+        }
+        crate::Item::Type(_binding_0) => {
+            v.visit_item_type(_binding_0);
+        }
+        crate::Item::Union(_binding_0) => {
+            v.visit_item_union(_binding_0);
+        }
+        crate::Item::Use(_binding_0) => {
+            v.visit_item_use(_binding_0);
+        }
+        crate::Item::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_const<'ast, V>(v: &mut V, node: &'ast crate::ItemConst)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_visibility(&node.vis);
+    skip!(node.const_token);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    skip!(node.colon_token);
+    v.visit_type(&*node.ty);
+    skip!(node.eq_token);
+    v.visit_expr(&*node.expr);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_enum<'ast, V>(v: &mut V, node: &'ast crate::ItemEnum)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_visibility(&node.vis);
+    skip!(node.enum_token);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    skip!(node.brace_token);
+    for el in Punctuated::pairs(&node.variants) {
+        let it = el.value();
+        v.visit_variant(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_extern_crate<'ast, V>(v: &mut V, node: &'ast crate::ItemExternCrate)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_visibility(&node.vis);
+    skip!(node.extern_token);
+    skip!(node.crate_token);
+    v.visit_ident(&node.ident);
+    if let Some(it) = &node.rename {
+        skip!((it).0);
+        v.visit_ident(&(it).1);
+    }
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_fn<'ast, V>(v: &mut V, node: &'ast crate::ItemFn)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_visibility(&node.vis);
+    v.visit_signature(&node.sig);
+    v.visit_block(&*node.block);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_foreign_mod<'ast, V>(v: &mut V, node: &'ast crate::ItemForeignMod)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.unsafety);
+    v.visit_abi(&node.abi);
+    skip!(node.brace_token);
+    for it in &node.items {
+        v.visit_foreign_item(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_impl<'ast, V>(v: &mut V, node: &'ast crate::ItemImpl)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.defaultness);
+    skip!(node.unsafety);
+    skip!(node.impl_token);
+    v.visit_generics(&node.generics);
+    if let Some(it) = &node.trait_ {
+        skip!((it).0);
+        v.visit_path(&(it).1);
+        skip!((it).2);
+    }
+    v.visit_type(&*node.self_ty);
+    skip!(node.brace_token);
+    for it in &node.items {
+        v.visit_impl_item(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_macro<'ast, V>(v: &mut V, node: &'ast crate::ItemMacro)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    if let Some(it) = &node.ident {
+        v.visit_ident(it);
+    }
+    v.visit_macro(&node.mac);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_mod<'ast, V>(v: &mut V, node: &'ast crate::ItemMod)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_visibility(&node.vis);
+    skip!(node.unsafety);
+    skip!(node.mod_token);
+    v.visit_ident(&node.ident);
+    if let Some(it) = &node.content {
+        skip!((it).0);
+        for it in &(it).1 {
+            v.visit_item(it);
+        }
+    }
+    skip!(node.semi);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_static<'ast, V>(v: &mut V, node: &'ast crate::ItemStatic)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_visibility(&node.vis);
+    skip!(node.static_token);
+    v.visit_static_mutability(&node.mutability);
+    v.visit_ident(&node.ident);
+    skip!(node.colon_token);
+    v.visit_type(&*node.ty);
+    skip!(node.eq_token);
+    v.visit_expr(&*node.expr);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_struct<'ast, V>(v: &mut V, node: &'ast crate::ItemStruct)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_visibility(&node.vis);
+    skip!(node.struct_token);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    v.visit_fields(&node.fields);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_trait<'ast, V>(v: &mut V, node: &'ast crate::ItemTrait)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_visibility(&node.vis);
+    skip!(node.unsafety);
+    skip!(node.auto_token);
+    if let Some(it) = &node.restriction {
+        v.visit_impl_restriction(it);
+    }
+    skip!(node.trait_token);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    skip!(node.colon_token);
+    for el in Punctuated::pairs(&node.supertraits) {
+        let it = el.value();
+        v.visit_type_param_bound(it);
+    }
+    skip!(node.brace_token);
+    for it in &node.items {
+        v.visit_trait_item(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_trait_alias<'ast, V>(v: &mut V, node: &'ast crate::ItemTraitAlias)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_visibility(&node.vis);
+    skip!(node.trait_token);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    skip!(node.eq_token);
+    for el in Punctuated::pairs(&node.bounds) {
+        let it = el.value();
+        v.visit_type_param_bound(it);
+    }
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_type<'ast, V>(v: &mut V, node: &'ast crate::ItemType)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_visibility(&node.vis);
+    skip!(node.type_token);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    skip!(node.eq_token);
+    v.visit_type(&*node.ty);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_union<'ast, V>(v: &mut V, node: &'ast crate::ItemUnion)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_visibility(&node.vis);
+    skip!(node.union_token);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    v.visit_fields_named(&node.fields);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_use<'ast, V>(v: &mut V, node: &'ast crate::ItemUse)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_visibility(&node.vis);
+    skip!(node.use_token);
+    skip!(node.leading_colon);
+    v.visit_use_tree(&node.tree);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_label<'ast, V>(v: &mut V, node: &'ast crate::Label)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_lifetime(&node.name);
+    skip!(node.colon_token);
+}
+pub fn visit_lifetime<'ast, V>(v: &mut V, node: &'ast crate::Lifetime)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_span(&node.apostrophe);
+    v.visit_ident(&node.ident);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_lifetime_param<'ast, V>(v: &mut V, node: &'ast crate::LifetimeParam)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_lifetime(&node.lifetime);
+    skip!(node.colon_token);
+    for el in Punctuated::pairs(&node.bounds) {
+        let it = el.value();
+        v.visit_lifetime(it);
+    }
+}
+pub fn visit_lit<'ast, V>(v: &mut V, node: &'ast crate::Lit)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::Lit::Str(_binding_0) => {
+            v.visit_lit_str(_binding_0);
+        }
+        crate::Lit::ByteStr(_binding_0) => {
+            v.visit_lit_byte_str(_binding_0);
+        }
+        crate::Lit::CStr(_binding_0) => {
+            v.visit_lit_cstr(_binding_0);
+        }
+        crate::Lit::Byte(_binding_0) => {
+            v.visit_lit_byte(_binding_0);
+        }
+        crate::Lit::Char(_binding_0) => {
+            v.visit_lit_char(_binding_0);
+        }
+        crate::Lit::Int(_binding_0) => {
+            v.visit_lit_int(_binding_0);
+        }
+        crate::Lit::Float(_binding_0) => {
+            v.visit_lit_float(_binding_0);
+        }
+        crate::Lit::Bool(_binding_0) => {
+            v.visit_lit_bool(_binding_0);
+        }
+        crate::Lit::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+pub fn visit_lit_bool<'ast, V>(v: &mut V, node: &'ast crate::LitBool)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.value);
+    v.visit_span(&node.span);
+}
+pub fn visit_lit_byte<'ast, V>(v: &mut V, node: &'ast crate::LitByte)
+where
+    V: Visit<'ast> + ?Sized,
+{}
+pub fn visit_lit_byte_str<'ast, V>(v: &mut V, node: &'ast crate::LitByteStr)
+where
+    V: Visit<'ast> + ?Sized,
+{}
+pub fn visit_lit_cstr<'ast, V>(v: &mut V, node: &'ast crate::LitCStr)
+where
+    V: Visit<'ast> + ?Sized,
+{}
+pub fn visit_lit_char<'ast, V>(v: &mut V, node: &'ast crate::LitChar)
+where
+    V: Visit<'ast> + ?Sized,
+{}
+pub fn visit_lit_float<'ast, V>(v: &mut V, node: &'ast crate::LitFloat)
+where
+    V: Visit<'ast> + ?Sized,
+{}
+pub fn visit_lit_int<'ast, V>(v: &mut V, node: &'ast crate::LitInt)
+where
+    V: Visit<'ast> + ?Sized,
+{}
+pub fn visit_lit_str<'ast, V>(v: &mut V, node: &'ast crate::LitStr)
+where
+    V: Visit<'ast> + ?Sized,
+{}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_local<'ast, V>(v: &mut V, node: &'ast crate::Local)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.let_token);
+    v.visit_pat(&node.pat);
+    if let Some(it) = &node.init {
+        v.visit_local_init(it);
+    }
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_local_init<'ast, V>(v: &mut V, node: &'ast crate::LocalInit)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.eq_token);
+    v.visit_expr(&*node.expr);
+    if let Some(it) = &node.diverge {
+        skip!((it).0);
+        v.visit_expr(&*(it).1);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_macro<'ast, V>(v: &mut V, node: &'ast crate::Macro)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_path(&node.path);
+    skip!(node.bang_token);
+    v.visit_macro_delimiter(&node.delimiter);
+    skip!(node.tokens);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_macro_delimiter<'ast, V>(v: &mut V, node: &'ast crate::MacroDelimiter)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::MacroDelimiter::Paren(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::MacroDelimiter::Brace(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::MacroDelimiter::Bracket(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_member<'ast, V>(v: &mut V, node: &'ast crate::Member)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::Member::Named(_binding_0) => {
+            v.visit_ident(_binding_0);
+        }
+        crate::Member::Unnamed(_binding_0) => {
+            v.visit_index(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_meta<'ast, V>(v: &mut V, node: &'ast crate::Meta)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::Meta::Path(_binding_0) => {
+            v.visit_path(_binding_0);
+        }
+        crate::Meta::List(_binding_0) => {
+            v.visit_meta_list(_binding_0);
+        }
+        crate::Meta::NameValue(_binding_0) => {
+            v.visit_meta_name_value(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_meta_list<'ast, V>(v: &mut V, node: &'ast crate::MetaList)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_path(&node.path);
+    v.visit_macro_delimiter(&node.delimiter);
+    skip!(node.tokens);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_meta_name_value<'ast, V>(v: &mut V, node: &'ast crate::MetaNameValue)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_path(&node.path);
+    skip!(node.eq_token);
+    v.visit_expr(&node.value);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_parenthesized_generic_arguments<'ast, V>(
+    v: &mut V,
+    node: &'ast crate::ParenthesizedGenericArguments,
+)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.paren_token);
+    for el in Punctuated::pairs(&node.inputs) {
+        let it = el.value();
+        v.visit_type(it);
+    }
+    v.visit_return_type(&node.output);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat<'ast, V>(v: &mut V, node: &'ast crate::Pat)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::Pat::Const(_binding_0) => {
+            v.visit_expr_const(_binding_0);
+        }
+        crate::Pat::Ident(_binding_0) => {
+            v.visit_pat_ident(_binding_0);
+        }
+        crate::Pat::Lit(_binding_0) => {
+            v.visit_expr_lit(_binding_0);
+        }
+        crate::Pat::Macro(_binding_0) => {
+            v.visit_expr_macro(_binding_0);
+        }
+        crate::Pat::Or(_binding_0) => {
+            v.visit_pat_or(_binding_0);
+        }
+        crate::Pat::Paren(_binding_0) => {
+            v.visit_pat_paren(_binding_0);
+        }
+        crate::Pat::Path(_binding_0) => {
+            v.visit_expr_path(_binding_0);
+        }
+        crate::Pat::Range(_binding_0) => {
+            v.visit_expr_range(_binding_0);
+        }
+        crate::Pat::Reference(_binding_0) => {
+            v.visit_pat_reference(_binding_0);
+        }
+        crate::Pat::Rest(_binding_0) => {
+            v.visit_pat_rest(_binding_0);
+        }
+        crate::Pat::Slice(_binding_0) => {
+            v.visit_pat_slice(_binding_0);
+        }
+        crate::Pat::Struct(_binding_0) => {
+            v.visit_pat_struct(_binding_0);
+        }
+        crate::Pat::Tuple(_binding_0) => {
+            v.visit_pat_tuple(_binding_0);
+        }
+        crate::Pat::TupleStruct(_binding_0) => {
+            v.visit_pat_tuple_struct(_binding_0);
+        }
+        crate::Pat::Type(_binding_0) => {
+            v.visit_pat_type(_binding_0);
+        }
+        crate::Pat::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::Pat::Wild(_binding_0) => {
+            v.visit_pat_wild(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_ident<'ast, V>(v: &mut V, node: &'ast crate::PatIdent)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.by_ref);
+    skip!(node.mutability);
+    v.visit_ident(&node.ident);
+    if let Some(it) = &node.subpat {
+        skip!((it).0);
+        v.visit_pat(&*(it).1);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_or<'ast, V>(v: &mut V, node: &'ast crate::PatOr)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.leading_vert);
+    for el in Punctuated::pairs(&node.cases) {
+        let it = el.value();
+        v.visit_pat(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_paren<'ast, V>(v: &mut V, node: &'ast crate::PatParen)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.paren_token);
+    v.visit_pat(&*node.pat);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_reference<'ast, V>(v: &mut V, node: &'ast crate::PatReference)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.and_token);
+    skip!(node.mutability);
+    v.visit_pat(&*node.pat);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_rest<'ast, V>(v: &mut V, node: &'ast crate::PatRest)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.dot2_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_slice<'ast, V>(v: &mut V, node: &'ast crate::PatSlice)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.bracket_token);
+    for el in Punctuated::pairs(&node.elems) {
+        let it = el.value();
+        v.visit_pat(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_struct<'ast, V>(v: &mut V, node: &'ast crate::PatStruct)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    if let Some(it) = &node.qself {
+        v.visit_qself(it);
+    }
+    v.visit_path(&node.path);
+    skip!(node.brace_token);
+    for el in Punctuated::pairs(&node.fields) {
+        let it = el.value();
+        v.visit_field_pat(it);
+    }
+    if let Some(it) = &node.rest {
+        v.visit_pat_rest(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_tuple<'ast, V>(v: &mut V, node: &'ast crate::PatTuple)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.paren_token);
+    for el in Punctuated::pairs(&node.elems) {
+        let it = el.value();
+        v.visit_pat(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_tuple_struct<'ast, V>(v: &mut V, node: &'ast crate::PatTupleStruct)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    if let Some(it) = &node.qself {
+        v.visit_qself(it);
+    }
+    v.visit_path(&node.path);
+    skip!(node.paren_token);
+    for el in Punctuated::pairs(&node.elems) {
+        let it = el.value();
+        v.visit_pat(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_type<'ast, V>(v: &mut V, node: &'ast crate::PatType)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_pat(&*node.pat);
+    skip!(node.colon_token);
+    v.visit_type(&*node.ty);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_wild<'ast, V>(v: &mut V, node: &'ast crate::PatWild)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.underscore_token);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_path<'ast, V>(v: &mut V, node: &'ast crate::Path)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.leading_colon);
+    for el in Punctuated::pairs(&node.segments) {
+        let it = el.value();
+        v.visit_path_segment(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_path_arguments<'ast, V>(v: &mut V, node: &'ast crate::PathArguments)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::PathArguments::None => {}
+        crate::PathArguments::AngleBracketed(_binding_0) => {
+            v.visit_angle_bracketed_generic_arguments(_binding_0);
+        }
+        crate::PathArguments::Parenthesized(_binding_0) => {
+            v.visit_parenthesized_generic_arguments(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_path_segment<'ast, V>(v: &mut V, node: &'ast crate::PathSegment)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_ident(&node.ident);
+    v.visit_path_arguments(&node.arguments);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_predicate_lifetime<'ast, V>(v: &mut V, node: &'ast crate::PredicateLifetime)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_lifetime(&node.lifetime);
+    skip!(node.colon_token);
+    for el in Punctuated::pairs(&node.bounds) {
+        let it = el.value();
+        v.visit_lifetime(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_predicate_type<'ast, V>(v: &mut V, node: &'ast crate::PredicateType)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    if let Some(it) = &node.lifetimes {
+        v.visit_bound_lifetimes(it);
+    }
+    v.visit_type(&node.bounded_ty);
+    skip!(node.colon_token);
+    for el in Punctuated::pairs(&node.bounds) {
+        let it = el.value();
+        v.visit_type_param_bound(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_qself<'ast, V>(v: &mut V, node: &'ast crate::QSelf)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.lt_token);
+    v.visit_type(&*node.ty);
+    skip!(node.position);
+    skip!(node.as_token);
+    skip!(node.gt_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_range_limits<'ast, V>(v: &mut V, node: &'ast crate::RangeLimits)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::RangeLimits::HalfOpen(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::RangeLimits::Closed(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_receiver<'ast, V>(v: &mut V, node: &'ast crate::Receiver)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    if let Some(it) = &node.reference {
+        skip!((it).0);
+        if let Some(it) = &(it).1 {
+            v.visit_lifetime(it);
+        }
+    }
+    skip!(node.mutability);
+    skip!(node.self_token);
+    skip!(node.colon_token);
+    v.visit_type(&*node.ty);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_return_type<'ast, V>(v: &mut V, node: &'ast crate::ReturnType)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::ReturnType::Default => {}
+        crate::ReturnType::Type(_binding_0, _binding_1) => {
+            skip!(_binding_0);
+            v.visit_type(&**_binding_1);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_signature<'ast, V>(v: &mut V, node: &'ast crate::Signature)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.constness);
+    skip!(node.asyncness);
+    skip!(node.unsafety);
+    if let Some(it) = &node.abi {
+        v.visit_abi(it);
+    }
+    skip!(node.fn_token);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    skip!(node.paren_token);
+    for el in Punctuated::pairs(&node.inputs) {
+        let it = el.value();
+        v.visit_fn_arg(it);
+    }
+    if let Some(it) = &node.variadic {
+        v.visit_variadic(it);
+    }
+    v.visit_return_type(&node.output);
+}
+pub fn visit_span<'ast, V>(v: &mut V, node: &proc_macro2::Span)
+where
+    V: Visit<'ast> + ?Sized,
+{}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_static_mutability<'ast, V>(v: &mut V, node: &'ast crate::StaticMutability)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::StaticMutability::Mut(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::StaticMutability::None => {}
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_stmt<'ast, V>(v: &mut V, node: &'ast crate::Stmt)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::Stmt::Local(_binding_0) => {
+            v.visit_local(_binding_0);
+        }
+        crate::Stmt::Item(_binding_0) => {
+            v.visit_item(_binding_0);
+        }
+        crate::Stmt::Expr(_binding_0, _binding_1) => {
+            v.visit_expr(_binding_0);
+            skip!(_binding_1);
+        }
+        crate::Stmt::Macro(_binding_0) => {
+            v.visit_stmt_macro(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_stmt_macro<'ast, V>(v: &mut V, node: &'ast crate::StmtMacro)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_macro(&node.mac);
+    skip!(node.semi_token);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_trait_bound<'ast, V>(v: &mut V, node: &'ast crate::TraitBound)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.paren_token);
+    v.visit_trait_bound_modifier(&node.modifier);
+    if let Some(it) = &node.lifetimes {
+        v.visit_bound_lifetimes(it);
+    }
+    v.visit_path(&node.path);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_trait_bound_modifier<'ast, V>(
+    v: &mut V,
+    node: &'ast crate::TraitBoundModifier,
+)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::TraitBoundModifier::None => {}
+        crate::TraitBoundModifier::Maybe(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_trait_item<'ast, V>(v: &mut V, node: &'ast crate::TraitItem)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::TraitItem::Const(_binding_0) => {
+            v.visit_trait_item_const(_binding_0);
+        }
+        crate::TraitItem::Fn(_binding_0) => {
+            v.visit_trait_item_fn(_binding_0);
+        }
+        crate::TraitItem::Type(_binding_0) => {
+            v.visit_trait_item_type(_binding_0);
+        }
+        crate::TraitItem::Macro(_binding_0) => {
+            v.visit_trait_item_macro(_binding_0);
+        }
+        crate::TraitItem::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_trait_item_const<'ast, V>(v: &mut V, node: &'ast crate::TraitItemConst)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.const_token);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    skip!(node.colon_token);
+    v.visit_type(&node.ty);
+    if let Some(it) = &node.default {
+        skip!((it).0);
+        v.visit_expr(&(it).1);
+    }
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_trait_item_fn<'ast, V>(v: &mut V, node: &'ast crate::TraitItemFn)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_signature(&node.sig);
+    if let Some(it) = &node.default {
+        v.visit_block(it);
+    }
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_trait_item_macro<'ast, V>(v: &mut V, node: &'ast crate::TraitItemMacro)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_macro(&node.mac);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_trait_item_type<'ast, V>(v: &mut V, node: &'ast crate::TraitItemType)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    skip!(node.type_token);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    skip!(node.colon_token);
+    for el in Punctuated::pairs(&node.bounds) {
+        let it = el.value();
+        v.visit_type_param_bound(it);
+    }
+    if let Some(it) = &node.default {
+        skip!((it).0);
+        v.visit_type(&(it).1);
+    }
+    skip!(node.semi_token);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type<'ast, V>(v: &mut V, node: &'ast crate::Type)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::Type::Array(_binding_0) => {
+            v.visit_type_array(_binding_0);
+        }
+        crate::Type::BareFn(_binding_0) => {
+            v.visit_type_bare_fn(_binding_0);
+        }
+        crate::Type::Group(_binding_0) => {
+            v.visit_type_group(_binding_0);
+        }
+        crate::Type::ImplTrait(_binding_0) => {
+            v.visit_type_impl_trait(_binding_0);
+        }
+        crate::Type::Infer(_binding_0) => {
+            v.visit_type_infer(_binding_0);
+        }
+        crate::Type::Macro(_binding_0) => {
+            v.visit_type_macro(_binding_0);
+        }
+        crate::Type::Never(_binding_0) => {
+            v.visit_type_never(_binding_0);
+        }
+        crate::Type::Paren(_binding_0) => {
+            v.visit_type_paren(_binding_0);
+        }
+        crate::Type::Path(_binding_0) => {
+            v.visit_type_path(_binding_0);
+        }
+        crate::Type::Ptr(_binding_0) => {
+            v.visit_type_ptr(_binding_0);
+        }
+        crate::Type::Reference(_binding_0) => {
+            v.visit_type_reference(_binding_0);
+        }
+        crate::Type::Slice(_binding_0) => {
+            v.visit_type_slice(_binding_0);
+        }
+        crate::Type::TraitObject(_binding_0) => {
+            v.visit_type_trait_object(_binding_0);
+        }
+        crate::Type::Tuple(_binding_0) => {
+            v.visit_type_tuple(_binding_0);
+        }
+        crate::Type::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_array<'ast, V>(v: &mut V, node: &'ast crate::TypeArray)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.bracket_token);
+    v.visit_type(&*node.elem);
+    skip!(node.semi_token);
+    v.visit_expr(&node.len);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_bare_fn<'ast, V>(v: &mut V, node: &'ast crate::TypeBareFn)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    if let Some(it) = &node.lifetimes {
+        v.visit_bound_lifetimes(it);
+    }
+    skip!(node.unsafety);
+    if let Some(it) = &node.abi {
+        v.visit_abi(it);
+    }
+    skip!(node.fn_token);
+    skip!(node.paren_token);
+    for el in Punctuated::pairs(&node.inputs) {
+        let it = el.value();
+        v.visit_bare_fn_arg(it);
+    }
+    if let Some(it) = &node.variadic {
+        v.visit_bare_variadic(it);
+    }
+    v.visit_return_type(&node.output);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_group<'ast, V>(v: &mut V, node: &'ast crate::TypeGroup)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.group_token);
+    v.visit_type(&*node.elem);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_impl_trait<'ast, V>(v: &mut V, node: &'ast crate::TypeImplTrait)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.impl_token);
+    for el in Punctuated::pairs(&node.bounds) {
+        let it = el.value();
+        v.visit_type_param_bound(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_infer<'ast, V>(v: &mut V, node: &'ast crate::TypeInfer)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.underscore_token);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_macro<'ast, V>(v: &mut V, node: &'ast crate::TypeMacro)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_macro(&node.mac);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_never<'ast, V>(v: &mut V, node: &'ast crate::TypeNever)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.bang_token);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_param<'ast, V>(v: &mut V, node: &'ast crate::TypeParam)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_ident(&node.ident);
+    skip!(node.colon_token);
+    for el in Punctuated::pairs(&node.bounds) {
+        let it = el.value();
+        v.visit_type_param_bound(it);
+    }
+    skip!(node.eq_token);
+    if let Some(it) = &node.default {
+        v.visit_type(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_param_bound<'ast, V>(v: &mut V, node: &'ast crate::TypeParamBound)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::TypeParamBound::Trait(_binding_0) => {
+            v.visit_trait_bound(_binding_0);
+        }
+        crate::TypeParamBound::Lifetime(_binding_0) => {
+            v.visit_lifetime(_binding_0);
+        }
+        crate::TypeParamBound::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_paren<'ast, V>(v: &mut V, node: &'ast crate::TypeParen)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.paren_token);
+    v.visit_type(&*node.elem);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_path<'ast, V>(v: &mut V, node: &'ast crate::TypePath)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    if let Some(it) = &node.qself {
+        v.visit_qself(it);
+    }
+    v.visit_path(&node.path);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_ptr<'ast, V>(v: &mut V, node: &'ast crate::TypePtr)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.star_token);
+    skip!(node.const_token);
+    skip!(node.mutability);
+    v.visit_type(&*node.elem);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_reference<'ast, V>(v: &mut V, node: &'ast crate::TypeReference)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.and_token);
+    if let Some(it) = &node.lifetime {
+        v.visit_lifetime(it);
+    }
+    skip!(node.mutability);
+    v.visit_type(&*node.elem);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_slice<'ast, V>(v: &mut V, node: &'ast crate::TypeSlice)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.bracket_token);
+    v.visit_type(&*node.elem);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_trait_object<'ast, V>(v: &mut V, node: &'ast crate::TypeTraitObject)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.dyn_token);
+    for el in Punctuated::pairs(&node.bounds) {
+        let it = el.value();
+        v.visit_type_param_bound(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_tuple<'ast, V>(v: &mut V, node: &'ast crate::TypeTuple)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.paren_token);
+    for el in Punctuated::pairs(&node.elems) {
+        let it = el.value();
+        v.visit_type(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_un_op<'ast, V>(v: &mut V, node: &'ast crate::UnOp)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::UnOp::Deref(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::UnOp::Not(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::UnOp::Neg(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_use_glob<'ast, V>(v: &mut V, node: &'ast crate::UseGlob)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.star_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_use_group<'ast, V>(v: &mut V, node: &'ast crate::UseGroup)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.brace_token);
+    for el in Punctuated::pairs(&node.items) {
+        let it = el.value();
+        v.visit_use_tree(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_use_name<'ast, V>(v: &mut V, node: &'ast crate::UseName)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_ident(&node.ident);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_use_path<'ast, V>(v: &mut V, node: &'ast crate::UsePath)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_ident(&node.ident);
+    skip!(node.colon2_token);
+    v.visit_use_tree(&*node.tree);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_use_rename<'ast, V>(v: &mut V, node: &'ast crate::UseRename)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_ident(&node.ident);
+    skip!(node.as_token);
+    v.visit_ident(&node.rename);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_use_tree<'ast, V>(v: &mut V, node: &'ast crate::UseTree)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::UseTree::Path(_binding_0) => {
+            v.visit_use_path(_binding_0);
+        }
+        crate::UseTree::Name(_binding_0) => {
+            v.visit_use_name(_binding_0);
+        }
+        crate::UseTree::Rename(_binding_0) => {
+            v.visit_use_rename(_binding_0);
+        }
+        crate::UseTree::Glob(_binding_0) => {
+            v.visit_use_glob(_binding_0);
+        }
+        crate::UseTree::Group(_binding_0) => {
+            v.visit_use_group(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_variadic<'ast, V>(v: &mut V, node: &'ast crate::Variadic)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    if let Some(it) = &node.pat {
+        v.visit_pat(&*(it).0);
+        skip!((it).1);
+    }
+    skip!(node.dots);
+    skip!(node.comma);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_variant<'ast, V>(v: &mut V, node: &'ast crate::Variant)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it);
+    }
+    v.visit_ident(&node.ident);
+    v.visit_fields(&node.fields);
+    if let Some(it) = &node.discriminant {
+        skip!((it).0);
+        v.visit_expr(&(it).1);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_vis_restricted<'ast, V>(v: &mut V, node: &'ast crate::VisRestricted)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.pub_token);
+    skip!(node.paren_token);
+    skip!(node.in_token);
+    v.visit_path(&*node.path);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_visibility<'ast, V>(v: &mut V, node: &'ast crate::Visibility)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::Visibility::Public(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::Visibility::Restricted(_binding_0) => {
+            v.visit_vis_restricted(_binding_0);
+        }
+        crate::Visibility::Inherited => {}
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_where_clause<'ast, V>(v: &mut V, node: &'ast crate::WhereClause)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.where_token);
+    for el in Punctuated::pairs(&node.predicates) {
+        let it = el.value();
+        v.visit_where_predicate(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_where_predicate<'ast, V>(v: &mut V, node: &'ast crate::WherePredicate)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        crate::WherePredicate::Lifetime(_binding_0) => {
+            v.visit_predicate_lifetime(_binding_0);
+        }
+        crate::WherePredicate::Type(_binding_0) => {
+            v.visit_predicate_type(_binding_0);
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/gen/visit_mut.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/gen/visit_mut.rs
--- 43.0.0-1/rust-vendor/syn/src/gen/visit_mut.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/gen/visit_mut.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,3855 @@
+// This file is @generated by syn-internal-codegen.
+// It is not intended for manual editing.
+
+#![allow(unused_variables)]
+#![allow(clippy::needless_pass_by_ref_mut)]
+#[cfg(any(feature = "full", feature = "derive"))]
+use crate::punctuated::Punctuated;
+#[cfg(feature = "full")]
+macro_rules! full {
+    ($e:expr) => {
+        $e
+    };
+}
+#[cfg(all(feature = "derive", not(feature = "full")))]
+macro_rules! full {
+    ($e:expr) => {
+        unreachable!()
+    };
+}
+macro_rules! skip {
+    ($($tt:tt)*) => {};
+}
+/// Syntax tree traversal to mutate an exclusive borrow of a syntax tree in
+/// place.
+///
+/// See the [module documentation] for details.
+///
+/// [module documentation]: self
+pub trait VisitMut {
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_abi_mut(&mut self, i: &mut crate::Abi) {
+        visit_abi_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_angle_bracketed_generic_arguments_mut(
+        &mut self,
+        i: &mut crate::AngleBracketedGenericArguments,
+    ) {
+        visit_angle_bracketed_generic_arguments_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_arm_mut(&mut self, i: &mut crate::Arm) {
+        visit_arm_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_assoc_const_mut(&mut self, i: &mut crate::AssocConst) {
+        visit_assoc_const_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_assoc_type_mut(&mut self, i: &mut crate::AssocType) {
+        visit_assoc_type_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_attr_style_mut(&mut self, i: &mut crate::AttrStyle) {
+        visit_attr_style_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_attribute_mut(&mut self, i: &mut crate::Attribute) {
+        visit_attribute_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_bare_fn_arg_mut(&mut self, i: &mut crate::BareFnArg) {
+        visit_bare_fn_arg_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_bare_variadic_mut(&mut self, i: &mut crate::BareVariadic) {
+        visit_bare_variadic_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_bin_op_mut(&mut self, i: &mut crate::BinOp) {
+        visit_bin_op_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_block_mut(&mut self, i: &mut crate::Block) {
+        visit_block_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_bound_lifetimes_mut(&mut self, i: &mut crate::BoundLifetimes) {
+        visit_bound_lifetimes_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_const_param_mut(&mut self, i: &mut crate::ConstParam) {
+        visit_const_param_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_constraint_mut(&mut self, i: &mut crate::Constraint) {
+        visit_constraint_mut(self, i);
+    }
+    #[cfg(feature = "derive")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+    fn visit_data_mut(&mut self, i: &mut crate::Data) {
+        visit_data_mut(self, i);
+    }
+    #[cfg(feature = "derive")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+    fn visit_data_enum_mut(&mut self, i: &mut crate::DataEnum) {
+        visit_data_enum_mut(self, i);
+    }
+    #[cfg(feature = "derive")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+    fn visit_data_struct_mut(&mut self, i: &mut crate::DataStruct) {
+        visit_data_struct_mut(self, i);
+    }
+    #[cfg(feature = "derive")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+    fn visit_data_union_mut(&mut self, i: &mut crate::DataUnion) {
+        visit_data_union_mut(self, i);
+    }
+    #[cfg(feature = "derive")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+    fn visit_derive_input_mut(&mut self, i: &mut crate::DeriveInput) {
+        visit_derive_input_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_mut(&mut self, i: &mut crate::Expr) {
+        visit_expr_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_array_mut(&mut self, i: &mut crate::ExprArray) {
+        visit_expr_array_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_assign_mut(&mut self, i: &mut crate::ExprAssign) {
+        visit_expr_assign_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_async_mut(&mut self, i: &mut crate::ExprAsync) {
+        visit_expr_async_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_await_mut(&mut self, i: &mut crate::ExprAwait) {
+        visit_expr_await_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_binary_mut(&mut self, i: &mut crate::ExprBinary) {
+        visit_expr_binary_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_block_mut(&mut self, i: &mut crate::ExprBlock) {
+        visit_expr_block_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_break_mut(&mut self, i: &mut crate::ExprBreak) {
+        visit_expr_break_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_call_mut(&mut self, i: &mut crate::ExprCall) {
+        visit_expr_call_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_cast_mut(&mut self, i: &mut crate::ExprCast) {
+        visit_expr_cast_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_closure_mut(&mut self, i: &mut crate::ExprClosure) {
+        visit_expr_closure_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_const_mut(&mut self, i: &mut crate::ExprConst) {
+        visit_expr_const_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_continue_mut(&mut self, i: &mut crate::ExprContinue) {
+        visit_expr_continue_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_field_mut(&mut self, i: &mut crate::ExprField) {
+        visit_expr_field_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_for_loop_mut(&mut self, i: &mut crate::ExprForLoop) {
+        visit_expr_for_loop_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_group_mut(&mut self, i: &mut crate::ExprGroup) {
+        visit_expr_group_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_if_mut(&mut self, i: &mut crate::ExprIf) {
+        visit_expr_if_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_index_mut(&mut self, i: &mut crate::ExprIndex) {
+        visit_expr_index_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_infer_mut(&mut self, i: &mut crate::ExprInfer) {
+        visit_expr_infer_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_let_mut(&mut self, i: &mut crate::ExprLet) {
+        visit_expr_let_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_lit_mut(&mut self, i: &mut crate::ExprLit) {
+        visit_expr_lit_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_loop_mut(&mut self, i: &mut crate::ExprLoop) {
+        visit_expr_loop_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_macro_mut(&mut self, i: &mut crate::ExprMacro) {
+        visit_expr_macro_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_match_mut(&mut self, i: &mut crate::ExprMatch) {
+        visit_expr_match_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_method_call_mut(&mut self, i: &mut crate::ExprMethodCall) {
+        visit_expr_method_call_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_paren_mut(&mut self, i: &mut crate::ExprParen) {
+        visit_expr_paren_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_path_mut(&mut self, i: &mut crate::ExprPath) {
+        visit_expr_path_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_range_mut(&mut self, i: &mut crate::ExprRange) {
+        visit_expr_range_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_reference_mut(&mut self, i: &mut crate::ExprReference) {
+        visit_expr_reference_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_repeat_mut(&mut self, i: &mut crate::ExprRepeat) {
+        visit_expr_repeat_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_return_mut(&mut self, i: &mut crate::ExprReturn) {
+        visit_expr_return_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_struct_mut(&mut self, i: &mut crate::ExprStruct) {
+        visit_expr_struct_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_try_mut(&mut self, i: &mut crate::ExprTry) {
+        visit_expr_try_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_try_block_mut(&mut self, i: &mut crate::ExprTryBlock) {
+        visit_expr_try_block_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_tuple_mut(&mut self, i: &mut crate::ExprTuple) {
+        visit_expr_tuple_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_expr_unary_mut(&mut self, i: &mut crate::ExprUnary) {
+        visit_expr_unary_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_unsafe_mut(&mut self, i: &mut crate::ExprUnsafe) {
+        visit_expr_unsafe_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_while_mut(&mut self, i: &mut crate::ExprWhile) {
+        visit_expr_while_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_expr_yield_mut(&mut self, i: &mut crate::ExprYield) {
+        visit_expr_yield_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_field_mut(&mut self, i: &mut crate::Field) {
+        visit_field_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_field_mutability_mut(&mut self, i: &mut crate::FieldMutability) {
+        visit_field_mutability_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_field_pat_mut(&mut self, i: &mut crate::FieldPat) {
+        visit_field_pat_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_field_value_mut(&mut self, i: &mut crate::FieldValue) {
+        visit_field_value_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_fields_mut(&mut self, i: &mut crate::Fields) {
+        visit_fields_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_fields_named_mut(&mut self, i: &mut crate::FieldsNamed) {
+        visit_fields_named_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_fields_unnamed_mut(&mut self, i: &mut crate::FieldsUnnamed) {
+        visit_fields_unnamed_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_file_mut(&mut self, i: &mut crate::File) {
+        visit_file_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_fn_arg_mut(&mut self, i: &mut crate::FnArg) {
+        visit_fn_arg_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_foreign_item_mut(&mut self, i: &mut crate::ForeignItem) {
+        visit_foreign_item_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_foreign_item_fn_mut(&mut self, i: &mut crate::ForeignItemFn) {
+        visit_foreign_item_fn_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_foreign_item_macro_mut(&mut self, i: &mut crate::ForeignItemMacro) {
+        visit_foreign_item_macro_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_foreign_item_static_mut(&mut self, i: &mut crate::ForeignItemStatic) {
+        visit_foreign_item_static_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_foreign_item_type_mut(&mut self, i: &mut crate::ForeignItemType) {
+        visit_foreign_item_type_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_generic_argument_mut(&mut self, i: &mut crate::GenericArgument) {
+        visit_generic_argument_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_generic_param_mut(&mut self, i: &mut crate::GenericParam) {
+        visit_generic_param_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_generics_mut(&mut self, i: &mut crate::Generics) {
+        visit_generics_mut(self, i);
+    }
+    fn visit_ident_mut(&mut self, i: &mut proc_macro2::Ident) {
+        visit_ident_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_impl_item_mut(&mut self, i: &mut crate::ImplItem) {
+        visit_impl_item_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_impl_item_const_mut(&mut self, i: &mut crate::ImplItemConst) {
+        visit_impl_item_const_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_impl_item_fn_mut(&mut self, i: &mut crate::ImplItemFn) {
+        visit_impl_item_fn_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_impl_item_macro_mut(&mut self, i: &mut crate::ImplItemMacro) {
+        visit_impl_item_macro_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_impl_item_type_mut(&mut self, i: &mut crate::ImplItemType) {
+        visit_impl_item_type_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_impl_restriction_mut(&mut self, i: &mut crate::ImplRestriction) {
+        visit_impl_restriction_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_index_mut(&mut self, i: &mut crate::Index) {
+        visit_index_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_mut(&mut self, i: &mut crate::Item) {
+        visit_item_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_const_mut(&mut self, i: &mut crate::ItemConst) {
+        visit_item_const_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_enum_mut(&mut self, i: &mut crate::ItemEnum) {
+        visit_item_enum_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_extern_crate_mut(&mut self, i: &mut crate::ItemExternCrate) {
+        visit_item_extern_crate_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_fn_mut(&mut self, i: &mut crate::ItemFn) {
+        visit_item_fn_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_foreign_mod_mut(&mut self, i: &mut crate::ItemForeignMod) {
+        visit_item_foreign_mod_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_impl_mut(&mut self, i: &mut crate::ItemImpl) {
+        visit_item_impl_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_macro_mut(&mut self, i: &mut crate::ItemMacro) {
+        visit_item_macro_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_mod_mut(&mut self, i: &mut crate::ItemMod) {
+        visit_item_mod_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_static_mut(&mut self, i: &mut crate::ItemStatic) {
+        visit_item_static_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_struct_mut(&mut self, i: &mut crate::ItemStruct) {
+        visit_item_struct_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_trait_mut(&mut self, i: &mut crate::ItemTrait) {
+        visit_item_trait_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_trait_alias_mut(&mut self, i: &mut crate::ItemTraitAlias) {
+        visit_item_trait_alias_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_type_mut(&mut self, i: &mut crate::ItemType) {
+        visit_item_type_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_union_mut(&mut self, i: &mut crate::ItemUnion) {
+        visit_item_union_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_item_use_mut(&mut self, i: &mut crate::ItemUse) {
+        visit_item_use_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_label_mut(&mut self, i: &mut crate::Label) {
+        visit_label_mut(self, i);
+    }
+    fn visit_lifetime_mut(&mut self, i: &mut crate::Lifetime) {
+        visit_lifetime_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_lifetime_param_mut(&mut self, i: &mut crate::LifetimeParam) {
+        visit_lifetime_param_mut(self, i);
+    }
+    fn visit_lit_mut(&mut self, i: &mut crate::Lit) {
+        visit_lit_mut(self, i);
+    }
+    fn visit_lit_bool_mut(&mut self, i: &mut crate::LitBool) {
+        visit_lit_bool_mut(self, i);
+    }
+    fn visit_lit_byte_mut(&mut self, i: &mut crate::LitByte) {
+        visit_lit_byte_mut(self, i);
+    }
+    fn visit_lit_byte_str_mut(&mut self, i: &mut crate::LitByteStr) {
+        visit_lit_byte_str_mut(self, i);
+    }
+    fn visit_lit_cstr_mut(&mut self, i: &mut crate::LitCStr) {
+        visit_lit_cstr_mut(self, i);
+    }
+    fn visit_lit_char_mut(&mut self, i: &mut crate::LitChar) {
+        visit_lit_char_mut(self, i);
+    }
+    fn visit_lit_float_mut(&mut self, i: &mut crate::LitFloat) {
+        visit_lit_float_mut(self, i);
+    }
+    fn visit_lit_int_mut(&mut self, i: &mut crate::LitInt) {
+        visit_lit_int_mut(self, i);
+    }
+    fn visit_lit_str_mut(&mut self, i: &mut crate::LitStr) {
+        visit_lit_str_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_local_mut(&mut self, i: &mut crate::Local) {
+        visit_local_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_local_init_mut(&mut self, i: &mut crate::LocalInit) {
+        visit_local_init_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_macro_mut(&mut self, i: &mut crate::Macro) {
+        visit_macro_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_macro_delimiter_mut(&mut self, i: &mut crate::MacroDelimiter) {
+        visit_macro_delimiter_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_member_mut(&mut self, i: &mut crate::Member) {
+        visit_member_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_meta_mut(&mut self, i: &mut crate::Meta) {
+        visit_meta_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_meta_list_mut(&mut self, i: &mut crate::MetaList) {
+        visit_meta_list_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_meta_name_value_mut(&mut self, i: &mut crate::MetaNameValue) {
+        visit_meta_name_value_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_parenthesized_generic_arguments_mut(
+        &mut self,
+        i: &mut crate::ParenthesizedGenericArguments,
+    ) {
+        visit_parenthesized_generic_arguments_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_mut(&mut self, i: &mut crate::Pat) {
+        visit_pat_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_ident_mut(&mut self, i: &mut crate::PatIdent) {
+        visit_pat_ident_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_or_mut(&mut self, i: &mut crate::PatOr) {
+        visit_pat_or_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_paren_mut(&mut self, i: &mut crate::PatParen) {
+        visit_pat_paren_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_reference_mut(&mut self, i: &mut crate::PatReference) {
+        visit_pat_reference_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_rest_mut(&mut self, i: &mut crate::PatRest) {
+        visit_pat_rest_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_slice_mut(&mut self, i: &mut crate::PatSlice) {
+        visit_pat_slice_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_struct_mut(&mut self, i: &mut crate::PatStruct) {
+        visit_pat_struct_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_tuple_mut(&mut self, i: &mut crate::PatTuple) {
+        visit_pat_tuple_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_tuple_struct_mut(&mut self, i: &mut crate::PatTupleStruct) {
+        visit_pat_tuple_struct_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_type_mut(&mut self, i: &mut crate::PatType) {
+        visit_pat_type_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_pat_wild_mut(&mut self, i: &mut crate::PatWild) {
+        visit_pat_wild_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_path_mut(&mut self, i: &mut crate::Path) {
+        visit_path_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_path_arguments_mut(&mut self, i: &mut crate::PathArguments) {
+        visit_path_arguments_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_path_segment_mut(&mut self, i: &mut crate::PathSegment) {
+        visit_path_segment_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_predicate_lifetime_mut(&mut self, i: &mut crate::PredicateLifetime) {
+        visit_predicate_lifetime_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_predicate_type_mut(&mut self, i: &mut crate::PredicateType) {
+        visit_predicate_type_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_qself_mut(&mut self, i: &mut crate::QSelf) {
+        visit_qself_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_range_limits_mut(&mut self, i: &mut crate::RangeLimits) {
+        visit_range_limits_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_receiver_mut(&mut self, i: &mut crate::Receiver) {
+        visit_receiver_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_return_type_mut(&mut self, i: &mut crate::ReturnType) {
+        visit_return_type_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_signature_mut(&mut self, i: &mut crate::Signature) {
+        visit_signature_mut(self, i);
+    }
+    fn visit_span_mut(&mut self, i: &mut proc_macro2::Span) {
+        visit_span_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_static_mutability_mut(&mut self, i: &mut crate::StaticMutability) {
+        visit_static_mutability_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_stmt_mut(&mut self, i: &mut crate::Stmt) {
+        visit_stmt_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_stmt_macro_mut(&mut self, i: &mut crate::StmtMacro) {
+        visit_stmt_macro_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_trait_bound_mut(&mut self, i: &mut crate::TraitBound) {
+        visit_trait_bound_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_trait_bound_modifier_mut(&mut self, i: &mut crate::TraitBoundModifier) {
+        visit_trait_bound_modifier_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_trait_item_mut(&mut self, i: &mut crate::TraitItem) {
+        visit_trait_item_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_trait_item_const_mut(&mut self, i: &mut crate::TraitItemConst) {
+        visit_trait_item_const_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_trait_item_fn_mut(&mut self, i: &mut crate::TraitItemFn) {
+        visit_trait_item_fn_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_trait_item_macro_mut(&mut self, i: &mut crate::TraitItemMacro) {
+        visit_trait_item_macro_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_trait_item_type_mut(&mut self, i: &mut crate::TraitItemType) {
+        visit_trait_item_type_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_mut(&mut self, i: &mut crate::Type) {
+        visit_type_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_array_mut(&mut self, i: &mut crate::TypeArray) {
+        visit_type_array_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_bare_fn_mut(&mut self, i: &mut crate::TypeBareFn) {
+        visit_type_bare_fn_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_group_mut(&mut self, i: &mut crate::TypeGroup) {
+        visit_type_group_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_impl_trait_mut(&mut self, i: &mut crate::TypeImplTrait) {
+        visit_type_impl_trait_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_infer_mut(&mut self, i: &mut crate::TypeInfer) {
+        visit_type_infer_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_macro_mut(&mut self, i: &mut crate::TypeMacro) {
+        visit_type_macro_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_never_mut(&mut self, i: &mut crate::TypeNever) {
+        visit_type_never_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_param_mut(&mut self, i: &mut crate::TypeParam) {
+        visit_type_param_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_param_bound_mut(&mut self, i: &mut crate::TypeParamBound) {
+        visit_type_param_bound_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_paren_mut(&mut self, i: &mut crate::TypeParen) {
+        visit_type_paren_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_path_mut(&mut self, i: &mut crate::TypePath) {
+        visit_type_path_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_ptr_mut(&mut self, i: &mut crate::TypePtr) {
+        visit_type_ptr_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_reference_mut(&mut self, i: &mut crate::TypeReference) {
+        visit_type_reference_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_slice_mut(&mut self, i: &mut crate::TypeSlice) {
+        visit_type_slice_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_trait_object_mut(&mut self, i: &mut crate::TypeTraitObject) {
+        visit_type_trait_object_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_type_tuple_mut(&mut self, i: &mut crate::TypeTuple) {
+        visit_type_tuple_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_un_op_mut(&mut self, i: &mut crate::UnOp) {
+        visit_un_op_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_use_glob_mut(&mut self, i: &mut crate::UseGlob) {
+        visit_use_glob_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_use_group_mut(&mut self, i: &mut crate::UseGroup) {
+        visit_use_group_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_use_name_mut(&mut self, i: &mut crate::UseName) {
+        visit_use_name_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_use_path_mut(&mut self, i: &mut crate::UsePath) {
+        visit_use_path_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_use_rename_mut(&mut self, i: &mut crate::UseRename) {
+        visit_use_rename_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_use_tree_mut(&mut self, i: &mut crate::UseTree) {
+        visit_use_tree_mut(self, i);
+    }
+    #[cfg(feature = "full")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    fn visit_variadic_mut(&mut self, i: &mut crate::Variadic) {
+        visit_variadic_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_variant_mut(&mut self, i: &mut crate::Variant) {
+        visit_variant_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_vis_restricted_mut(&mut self, i: &mut crate::VisRestricted) {
+        visit_vis_restricted_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_visibility_mut(&mut self, i: &mut crate::Visibility) {
+        visit_visibility_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_where_clause_mut(&mut self, i: &mut crate::WhereClause) {
+        visit_where_clause_mut(self, i);
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+    fn visit_where_predicate_mut(&mut self, i: &mut crate::WherePredicate) {
+        visit_where_predicate_mut(self, i);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_abi_mut<V>(v: &mut V, node: &mut crate::Abi)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.extern_token);
+    if let Some(it) = &mut node.name {
+        v.visit_lit_str_mut(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_angle_bracketed_generic_arguments_mut<V>(
+    v: &mut V,
+    node: &mut crate::AngleBracketedGenericArguments,
+)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.colon2_token);
+    skip!(node.lt_token);
+    for mut el in Punctuated::pairs_mut(&mut node.args) {
+        let it = el.value_mut();
+        v.visit_generic_argument_mut(it);
+    }
+    skip!(node.gt_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_arm_mut<V>(v: &mut V, node: &mut crate::Arm)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_pat_mut(&mut node.pat);
+    if let Some(it) = &mut node.guard {
+        skip!((it).0);
+        v.visit_expr_mut(&mut *(it).1);
+    }
+    skip!(node.fat_arrow_token);
+    v.visit_expr_mut(&mut *node.body);
+    skip!(node.comma);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_assoc_const_mut<V>(v: &mut V, node: &mut crate::AssocConst)
+where
+    V: VisitMut + ?Sized,
+{
+    v.visit_ident_mut(&mut node.ident);
+    if let Some(it) = &mut node.generics {
+        v.visit_angle_bracketed_generic_arguments_mut(it);
+    }
+    skip!(node.eq_token);
+    v.visit_expr_mut(&mut node.value);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_assoc_type_mut<V>(v: &mut V, node: &mut crate::AssocType)
+where
+    V: VisitMut + ?Sized,
+{
+    v.visit_ident_mut(&mut node.ident);
+    if let Some(it) = &mut node.generics {
+        v.visit_angle_bracketed_generic_arguments_mut(it);
+    }
+    skip!(node.eq_token);
+    v.visit_type_mut(&mut node.ty);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_attr_style_mut<V>(v: &mut V, node: &mut crate::AttrStyle)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::AttrStyle::Outer => {}
+        crate::AttrStyle::Inner(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_attribute_mut<V>(v: &mut V, node: &mut crate::Attribute)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.pound_token);
+    v.visit_attr_style_mut(&mut node.style);
+    skip!(node.bracket_token);
+    v.visit_meta_mut(&mut node.meta);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_bare_fn_arg_mut<V>(v: &mut V, node: &mut crate::BareFnArg)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    if let Some(it) = &mut node.name {
+        v.visit_ident_mut(&mut (it).0);
+        skip!((it).1);
+    }
+    v.visit_type_mut(&mut node.ty);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_bare_variadic_mut<V>(v: &mut V, node: &mut crate::BareVariadic)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    if let Some(it) = &mut node.name {
+        v.visit_ident_mut(&mut (it).0);
+        skip!((it).1);
+    }
+    skip!(node.dots);
+    skip!(node.comma);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_bin_op_mut<V>(v: &mut V, node: &mut crate::BinOp)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::BinOp::Add(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Sub(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Mul(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Div(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Rem(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::And(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Or(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::BitXor(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::BitAnd(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::BitOr(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Shl(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Shr(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Eq(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Lt(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Le(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Ne(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Ge(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::Gt(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::AddAssign(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::SubAssign(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::MulAssign(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::DivAssign(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::RemAssign(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::BitXorAssign(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::BitAndAssign(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::BitOrAssign(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::ShlAssign(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::BinOp::ShrAssign(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_block_mut<V>(v: &mut V, node: &mut crate::Block)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.brace_token);
+    for it in &mut node.stmts {
+        v.visit_stmt_mut(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_bound_lifetimes_mut<V>(v: &mut V, node: &mut crate::BoundLifetimes)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.for_token);
+    skip!(node.lt_token);
+    for mut el in Punctuated::pairs_mut(&mut node.lifetimes) {
+        let it = el.value_mut();
+        v.visit_generic_param_mut(it);
+    }
+    skip!(node.gt_token);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_const_param_mut<V>(v: &mut V, node: &mut crate::ConstParam)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.const_token);
+    v.visit_ident_mut(&mut node.ident);
+    skip!(node.colon_token);
+    v.visit_type_mut(&mut node.ty);
+    skip!(node.eq_token);
+    if let Some(it) = &mut node.default {
+        v.visit_expr_mut(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_constraint_mut<V>(v: &mut V, node: &mut crate::Constraint)
+where
+    V: VisitMut + ?Sized,
+{
+    v.visit_ident_mut(&mut node.ident);
+    if let Some(it) = &mut node.generics {
+        v.visit_angle_bracketed_generic_arguments_mut(it);
+    }
+    skip!(node.colon_token);
+    for mut el in Punctuated::pairs_mut(&mut node.bounds) {
+        let it = el.value_mut();
+        v.visit_type_param_bound_mut(it);
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+pub fn visit_data_mut<V>(v: &mut V, node: &mut crate::Data)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::Data::Struct(_binding_0) => {
+            v.visit_data_struct_mut(_binding_0);
+        }
+        crate::Data::Enum(_binding_0) => {
+            v.visit_data_enum_mut(_binding_0);
+        }
+        crate::Data::Union(_binding_0) => {
+            v.visit_data_union_mut(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+pub fn visit_data_enum_mut<V>(v: &mut V, node: &mut crate::DataEnum)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.enum_token);
+    skip!(node.brace_token);
+    for mut el in Punctuated::pairs_mut(&mut node.variants) {
+        let it = el.value_mut();
+        v.visit_variant_mut(it);
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+pub fn visit_data_struct_mut<V>(v: &mut V, node: &mut crate::DataStruct)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.struct_token);
+    v.visit_fields_mut(&mut node.fields);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+pub fn visit_data_union_mut<V>(v: &mut V, node: &mut crate::DataUnion)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.union_token);
+    v.visit_fields_named_mut(&mut node.fields);
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+pub fn visit_derive_input_mut<V>(v: &mut V, node: &mut crate::DeriveInput)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_visibility_mut(&mut node.vis);
+    v.visit_ident_mut(&mut node.ident);
+    v.visit_generics_mut(&mut node.generics);
+    v.visit_data_mut(&mut node.data);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_mut<V>(v: &mut V, node: &mut crate::Expr)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::Expr::Array(_binding_0) => {
+            full!(v.visit_expr_array_mut(_binding_0));
+        }
+        crate::Expr::Assign(_binding_0) => {
+            full!(v.visit_expr_assign_mut(_binding_0));
+        }
+        crate::Expr::Async(_binding_0) => {
+            full!(v.visit_expr_async_mut(_binding_0));
+        }
+        crate::Expr::Await(_binding_0) => {
+            full!(v.visit_expr_await_mut(_binding_0));
+        }
+        crate::Expr::Binary(_binding_0) => {
+            v.visit_expr_binary_mut(_binding_0);
+        }
+        crate::Expr::Block(_binding_0) => {
+            full!(v.visit_expr_block_mut(_binding_0));
+        }
+        crate::Expr::Break(_binding_0) => {
+            full!(v.visit_expr_break_mut(_binding_0));
+        }
+        crate::Expr::Call(_binding_0) => {
+            v.visit_expr_call_mut(_binding_0);
+        }
+        crate::Expr::Cast(_binding_0) => {
+            v.visit_expr_cast_mut(_binding_0);
+        }
+        crate::Expr::Closure(_binding_0) => {
+            full!(v.visit_expr_closure_mut(_binding_0));
+        }
+        crate::Expr::Const(_binding_0) => {
+            full!(v.visit_expr_const_mut(_binding_0));
+        }
+        crate::Expr::Continue(_binding_0) => {
+            full!(v.visit_expr_continue_mut(_binding_0));
+        }
+        crate::Expr::Field(_binding_0) => {
+            v.visit_expr_field_mut(_binding_0);
+        }
+        crate::Expr::ForLoop(_binding_0) => {
+            full!(v.visit_expr_for_loop_mut(_binding_0));
+        }
+        crate::Expr::Group(_binding_0) => {
+            v.visit_expr_group_mut(_binding_0);
+        }
+        crate::Expr::If(_binding_0) => {
+            full!(v.visit_expr_if_mut(_binding_0));
+        }
+        crate::Expr::Index(_binding_0) => {
+            v.visit_expr_index_mut(_binding_0);
+        }
+        crate::Expr::Infer(_binding_0) => {
+            full!(v.visit_expr_infer_mut(_binding_0));
+        }
+        crate::Expr::Let(_binding_0) => {
+            full!(v.visit_expr_let_mut(_binding_0));
+        }
+        crate::Expr::Lit(_binding_0) => {
+            v.visit_expr_lit_mut(_binding_0);
+        }
+        crate::Expr::Loop(_binding_0) => {
+            full!(v.visit_expr_loop_mut(_binding_0));
+        }
+        crate::Expr::Macro(_binding_0) => {
+            v.visit_expr_macro_mut(_binding_0);
+        }
+        crate::Expr::Match(_binding_0) => {
+            full!(v.visit_expr_match_mut(_binding_0));
+        }
+        crate::Expr::MethodCall(_binding_0) => {
+            v.visit_expr_method_call_mut(_binding_0);
+        }
+        crate::Expr::Paren(_binding_0) => {
+            v.visit_expr_paren_mut(_binding_0);
+        }
+        crate::Expr::Path(_binding_0) => {
+            v.visit_expr_path_mut(_binding_0);
+        }
+        crate::Expr::Range(_binding_0) => {
+            full!(v.visit_expr_range_mut(_binding_0));
+        }
+        crate::Expr::Reference(_binding_0) => {
+            v.visit_expr_reference_mut(_binding_0);
+        }
+        crate::Expr::Repeat(_binding_0) => {
+            full!(v.visit_expr_repeat_mut(_binding_0));
+        }
+        crate::Expr::Return(_binding_0) => {
+            full!(v.visit_expr_return_mut(_binding_0));
+        }
+        crate::Expr::Struct(_binding_0) => {
+            v.visit_expr_struct_mut(_binding_0);
+        }
+        crate::Expr::Try(_binding_0) => {
+            full!(v.visit_expr_try_mut(_binding_0));
+        }
+        crate::Expr::TryBlock(_binding_0) => {
+            full!(v.visit_expr_try_block_mut(_binding_0));
+        }
+        crate::Expr::Tuple(_binding_0) => {
+            full!(v.visit_expr_tuple_mut(_binding_0));
+        }
+        crate::Expr::Unary(_binding_0) => {
+            v.visit_expr_unary_mut(_binding_0);
+        }
+        crate::Expr::Unsafe(_binding_0) => {
+            full!(v.visit_expr_unsafe_mut(_binding_0));
+        }
+        crate::Expr::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::Expr::While(_binding_0) => {
+            full!(v.visit_expr_while_mut(_binding_0));
+        }
+        crate::Expr::Yield(_binding_0) => {
+            full!(v.visit_expr_yield_mut(_binding_0));
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_array_mut<V>(v: &mut V, node: &mut crate::ExprArray)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.bracket_token);
+    for mut el in Punctuated::pairs_mut(&mut node.elems) {
+        let it = el.value_mut();
+        v.visit_expr_mut(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_assign_mut<V>(v: &mut V, node: &mut crate::ExprAssign)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_expr_mut(&mut *node.left);
+    skip!(node.eq_token);
+    v.visit_expr_mut(&mut *node.right);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_async_mut<V>(v: &mut V, node: &mut crate::ExprAsync)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.async_token);
+    skip!(node.capture);
+    v.visit_block_mut(&mut node.block);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_await_mut<V>(v: &mut V, node: &mut crate::ExprAwait)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_expr_mut(&mut *node.base);
+    skip!(node.dot_token);
+    skip!(node.await_token);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_binary_mut<V>(v: &mut V, node: &mut crate::ExprBinary)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_expr_mut(&mut *node.left);
+    v.visit_bin_op_mut(&mut node.op);
+    v.visit_expr_mut(&mut *node.right);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_block_mut<V>(v: &mut V, node: &mut crate::ExprBlock)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    if let Some(it) = &mut node.label {
+        v.visit_label_mut(it);
+    }
+    v.visit_block_mut(&mut node.block);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_break_mut<V>(v: &mut V, node: &mut crate::ExprBreak)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.break_token);
+    if let Some(it) = &mut node.label {
+        v.visit_lifetime_mut(it);
+    }
+    if let Some(it) = &mut node.expr {
+        v.visit_expr_mut(&mut **it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_call_mut<V>(v: &mut V, node: &mut crate::ExprCall)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_expr_mut(&mut *node.func);
+    skip!(node.paren_token);
+    for mut el in Punctuated::pairs_mut(&mut node.args) {
+        let it = el.value_mut();
+        v.visit_expr_mut(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_cast_mut<V>(v: &mut V, node: &mut crate::ExprCast)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_expr_mut(&mut *node.expr);
+    skip!(node.as_token);
+    v.visit_type_mut(&mut *node.ty);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_closure_mut<V>(v: &mut V, node: &mut crate::ExprClosure)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    if let Some(it) = &mut node.lifetimes {
+        v.visit_bound_lifetimes_mut(it);
+    }
+    skip!(node.constness);
+    skip!(node.movability);
+    skip!(node.asyncness);
+    skip!(node.capture);
+    skip!(node.or1_token);
+    for mut el in Punctuated::pairs_mut(&mut node.inputs) {
+        let it = el.value_mut();
+        v.visit_pat_mut(it);
+    }
+    skip!(node.or2_token);
+    v.visit_return_type_mut(&mut node.output);
+    v.visit_expr_mut(&mut *node.body);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_const_mut<V>(v: &mut V, node: &mut crate::ExprConst)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.const_token);
+    v.visit_block_mut(&mut node.block);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_continue_mut<V>(v: &mut V, node: &mut crate::ExprContinue)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.continue_token);
+    if let Some(it) = &mut node.label {
+        v.visit_lifetime_mut(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_field_mut<V>(v: &mut V, node: &mut crate::ExprField)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_expr_mut(&mut *node.base);
+    skip!(node.dot_token);
+    v.visit_member_mut(&mut node.member);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_for_loop_mut<V>(v: &mut V, node: &mut crate::ExprForLoop)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    if let Some(it) = &mut node.label {
+        v.visit_label_mut(it);
+    }
+    skip!(node.for_token);
+    v.visit_pat_mut(&mut *node.pat);
+    skip!(node.in_token);
+    v.visit_expr_mut(&mut *node.expr);
+    v.visit_block_mut(&mut node.body);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_group_mut<V>(v: &mut V, node: &mut crate::ExprGroup)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.group_token);
+    v.visit_expr_mut(&mut *node.expr);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_if_mut<V>(v: &mut V, node: &mut crate::ExprIf)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.if_token);
+    v.visit_expr_mut(&mut *node.cond);
+    v.visit_block_mut(&mut node.then_branch);
+    if let Some(it) = &mut node.else_branch {
+        skip!((it).0);
+        v.visit_expr_mut(&mut *(it).1);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_index_mut<V>(v: &mut V, node: &mut crate::ExprIndex)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_expr_mut(&mut *node.expr);
+    skip!(node.bracket_token);
+    v.visit_expr_mut(&mut *node.index);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_infer_mut<V>(v: &mut V, node: &mut crate::ExprInfer)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.underscore_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_let_mut<V>(v: &mut V, node: &mut crate::ExprLet)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.let_token);
+    v.visit_pat_mut(&mut *node.pat);
+    skip!(node.eq_token);
+    v.visit_expr_mut(&mut *node.expr);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_lit_mut<V>(v: &mut V, node: &mut crate::ExprLit)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_lit_mut(&mut node.lit);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_loop_mut<V>(v: &mut V, node: &mut crate::ExprLoop)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    if let Some(it) = &mut node.label {
+        v.visit_label_mut(it);
+    }
+    skip!(node.loop_token);
+    v.visit_block_mut(&mut node.body);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_macro_mut<V>(v: &mut V, node: &mut crate::ExprMacro)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_macro_mut(&mut node.mac);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_match_mut<V>(v: &mut V, node: &mut crate::ExprMatch)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.match_token);
+    v.visit_expr_mut(&mut *node.expr);
+    skip!(node.brace_token);
+    for it in &mut node.arms {
+        v.visit_arm_mut(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_method_call_mut<V>(v: &mut V, node: &mut crate::ExprMethodCall)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_expr_mut(&mut *node.receiver);
+    skip!(node.dot_token);
+    v.visit_ident_mut(&mut node.method);
+    if let Some(it) = &mut node.turbofish {
+        v.visit_angle_bracketed_generic_arguments_mut(it);
+    }
+    skip!(node.paren_token);
+    for mut el in Punctuated::pairs_mut(&mut node.args) {
+        let it = el.value_mut();
+        v.visit_expr_mut(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_paren_mut<V>(v: &mut V, node: &mut crate::ExprParen)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.paren_token);
+    v.visit_expr_mut(&mut *node.expr);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_path_mut<V>(v: &mut V, node: &mut crate::ExprPath)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    if let Some(it) = &mut node.qself {
+        v.visit_qself_mut(it);
+    }
+    v.visit_path_mut(&mut node.path);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_range_mut<V>(v: &mut V, node: &mut crate::ExprRange)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    if let Some(it) = &mut node.start {
+        v.visit_expr_mut(&mut **it);
+    }
+    v.visit_range_limits_mut(&mut node.limits);
+    if let Some(it) = &mut node.end {
+        v.visit_expr_mut(&mut **it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_reference_mut<V>(v: &mut V, node: &mut crate::ExprReference)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.and_token);
+    skip!(node.mutability);
+    v.visit_expr_mut(&mut *node.expr);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_repeat_mut<V>(v: &mut V, node: &mut crate::ExprRepeat)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.bracket_token);
+    v.visit_expr_mut(&mut *node.expr);
+    skip!(node.semi_token);
+    v.visit_expr_mut(&mut *node.len);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_return_mut<V>(v: &mut V, node: &mut crate::ExprReturn)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.return_token);
+    if let Some(it) = &mut node.expr {
+        v.visit_expr_mut(&mut **it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_struct_mut<V>(v: &mut V, node: &mut crate::ExprStruct)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    if let Some(it) = &mut node.qself {
+        v.visit_qself_mut(it);
+    }
+    v.visit_path_mut(&mut node.path);
+    skip!(node.brace_token);
+    for mut el in Punctuated::pairs_mut(&mut node.fields) {
+        let it = el.value_mut();
+        v.visit_field_value_mut(it);
+    }
+    skip!(node.dot2_token);
+    if let Some(it) = &mut node.rest {
+        v.visit_expr_mut(&mut **it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_try_mut<V>(v: &mut V, node: &mut crate::ExprTry)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_expr_mut(&mut *node.expr);
+    skip!(node.question_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_try_block_mut<V>(v: &mut V, node: &mut crate::ExprTryBlock)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.try_token);
+    v.visit_block_mut(&mut node.block);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_tuple_mut<V>(v: &mut V, node: &mut crate::ExprTuple)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.paren_token);
+    for mut el in Punctuated::pairs_mut(&mut node.elems) {
+        let it = el.value_mut();
+        v.visit_expr_mut(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_expr_unary_mut<V>(v: &mut V, node: &mut crate::ExprUnary)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_un_op_mut(&mut node.op);
+    v.visit_expr_mut(&mut *node.expr);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_unsafe_mut<V>(v: &mut V, node: &mut crate::ExprUnsafe)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.unsafe_token);
+    v.visit_block_mut(&mut node.block);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_while_mut<V>(v: &mut V, node: &mut crate::ExprWhile)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    if let Some(it) = &mut node.label {
+        v.visit_label_mut(it);
+    }
+    skip!(node.while_token);
+    v.visit_expr_mut(&mut *node.cond);
+    v.visit_block_mut(&mut node.body);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_expr_yield_mut<V>(v: &mut V, node: &mut crate::ExprYield)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.yield_token);
+    if let Some(it) = &mut node.expr {
+        v.visit_expr_mut(&mut **it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_field_mut<V>(v: &mut V, node: &mut crate::Field)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_visibility_mut(&mut node.vis);
+    v.visit_field_mutability_mut(&mut node.mutability);
+    if let Some(it) = &mut node.ident {
+        v.visit_ident_mut(it);
+    }
+    skip!(node.colon_token);
+    v.visit_type_mut(&mut node.ty);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_field_mutability_mut<V>(v: &mut V, node: &mut crate::FieldMutability)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::FieldMutability::None => {}
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_field_pat_mut<V>(v: &mut V, node: &mut crate::FieldPat)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_member_mut(&mut node.member);
+    skip!(node.colon_token);
+    v.visit_pat_mut(&mut *node.pat);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_field_value_mut<V>(v: &mut V, node: &mut crate::FieldValue)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_member_mut(&mut node.member);
+    skip!(node.colon_token);
+    v.visit_expr_mut(&mut node.expr);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_fields_mut<V>(v: &mut V, node: &mut crate::Fields)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::Fields::Named(_binding_0) => {
+            v.visit_fields_named_mut(_binding_0);
+        }
+        crate::Fields::Unnamed(_binding_0) => {
+            v.visit_fields_unnamed_mut(_binding_0);
+        }
+        crate::Fields::Unit => {}
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_fields_named_mut<V>(v: &mut V, node: &mut crate::FieldsNamed)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.brace_token);
+    for mut el in Punctuated::pairs_mut(&mut node.named) {
+        let it = el.value_mut();
+        v.visit_field_mut(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_fields_unnamed_mut<V>(v: &mut V, node: &mut crate::FieldsUnnamed)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.paren_token);
+    for mut el in Punctuated::pairs_mut(&mut node.unnamed) {
+        let it = el.value_mut();
+        v.visit_field_mut(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_file_mut<V>(v: &mut V, node: &mut crate::File)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.shebang);
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    for it in &mut node.items {
+        v.visit_item_mut(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_fn_arg_mut<V>(v: &mut V, node: &mut crate::FnArg)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::FnArg::Receiver(_binding_0) => {
+            v.visit_receiver_mut(_binding_0);
+        }
+        crate::FnArg::Typed(_binding_0) => {
+            v.visit_pat_type_mut(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_foreign_item_mut<V>(v: &mut V, node: &mut crate::ForeignItem)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::ForeignItem::Fn(_binding_0) => {
+            v.visit_foreign_item_fn_mut(_binding_0);
+        }
+        crate::ForeignItem::Static(_binding_0) => {
+            v.visit_foreign_item_static_mut(_binding_0);
+        }
+        crate::ForeignItem::Type(_binding_0) => {
+            v.visit_foreign_item_type_mut(_binding_0);
+        }
+        crate::ForeignItem::Macro(_binding_0) => {
+            v.visit_foreign_item_macro_mut(_binding_0);
+        }
+        crate::ForeignItem::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_foreign_item_fn_mut<V>(v: &mut V, node: &mut crate::ForeignItemFn)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_visibility_mut(&mut node.vis);
+    v.visit_signature_mut(&mut node.sig);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_foreign_item_macro_mut<V>(v: &mut V, node: &mut crate::ForeignItemMacro)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_macro_mut(&mut node.mac);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_foreign_item_static_mut<V>(v: &mut V, node: &mut crate::ForeignItemStatic)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_visibility_mut(&mut node.vis);
+    skip!(node.static_token);
+    v.visit_static_mutability_mut(&mut node.mutability);
+    v.visit_ident_mut(&mut node.ident);
+    skip!(node.colon_token);
+    v.visit_type_mut(&mut *node.ty);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_foreign_item_type_mut<V>(v: &mut V, node: &mut crate::ForeignItemType)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_visibility_mut(&mut node.vis);
+    skip!(node.type_token);
+    v.visit_ident_mut(&mut node.ident);
+    v.visit_generics_mut(&mut node.generics);
+    skip!(node.semi_token);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_generic_argument_mut<V>(v: &mut V, node: &mut crate::GenericArgument)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::GenericArgument::Lifetime(_binding_0) => {
+            v.visit_lifetime_mut(_binding_0);
+        }
+        crate::GenericArgument::Type(_binding_0) => {
+            v.visit_type_mut(_binding_0);
+        }
+        crate::GenericArgument::Const(_binding_0) => {
+            v.visit_expr_mut(_binding_0);
+        }
+        crate::GenericArgument::AssocType(_binding_0) => {
+            v.visit_assoc_type_mut(_binding_0);
+        }
+        crate::GenericArgument::AssocConst(_binding_0) => {
+            v.visit_assoc_const_mut(_binding_0);
+        }
+        crate::GenericArgument::Constraint(_binding_0) => {
+            v.visit_constraint_mut(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_generic_param_mut<V>(v: &mut V, node: &mut crate::GenericParam)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::GenericParam::Lifetime(_binding_0) => {
+            v.visit_lifetime_param_mut(_binding_0);
+        }
+        crate::GenericParam::Type(_binding_0) => {
+            v.visit_type_param_mut(_binding_0);
+        }
+        crate::GenericParam::Const(_binding_0) => {
+            v.visit_const_param_mut(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_generics_mut<V>(v: &mut V, node: &mut crate::Generics)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.lt_token);
+    for mut el in Punctuated::pairs_mut(&mut node.params) {
+        let it = el.value_mut();
+        v.visit_generic_param_mut(it);
+    }
+    skip!(node.gt_token);
+    if let Some(it) = &mut node.where_clause {
+        v.visit_where_clause_mut(it);
+    }
+}
+pub fn visit_ident_mut<V>(v: &mut V, node: &mut proc_macro2::Ident)
+where
+    V: VisitMut + ?Sized,
+{
+    let mut span = node.span();
+    v.visit_span_mut(&mut span);
+    node.set_span(span);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_impl_item_mut<V>(v: &mut V, node: &mut crate::ImplItem)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::ImplItem::Const(_binding_0) => {
+            v.visit_impl_item_const_mut(_binding_0);
+        }
+        crate::ImplItem::Fn(_binding_0) => {
+            v.visit_impl_item_fn_mut(_binding_0);
+        }
+        crate::ImplItem::Type(_binding_0) => {
+            v.visit_impl_item_type_mut(_binding_0);
+        }
+        crate::ImplItem::Macro(_binding_0) => {
+            v.visit_impl_item_macro_mut(_binding_0);
+        }
+        crate::ImplItem::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_impl_item_const_mut<V>(v: &mut V, node: &mut crate::ImplItemConst)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_visibility_mut(&mut node.vis);
+    skip!(node.defaultness);
+    skip!(node.const_token);
+    v.visit_ident_mut(&mut node.ident);
+    v.visit_generics_mut(&mut node.generics);
+    skip!(node.colon_token);
+    v.visit_type_mut(&mut node.ty);
+    skip!(node.eq_token);
+    v.visit_expr_mut(&mut node.expr);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_impl_item_fn_mut<V>(v: &mut V, node: &mut crate::ImplItemFn)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_visibility_mut(&mut node.vis);
+    skip!(node.defaultness);
+    v.visit_signature_mut(&mut node.sig);
+    v.visit_block_mut(&mut node.block);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_impl_item_macro_mut<V>(v: &mut V, node: &mut crate::ImplItemMacro)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_macro_mut(&mut node.mac);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_impl_item_type_mut<V>(v: &mut V, node: &mut crate::ImplItemType)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_visibility_mut(&mut node.vis);
+    skip!(node.defaultness);
+    skip!(node.type_token);
+    v.visit_ident_mut(&mut node.ident);
+    v.visit_generics_mut(&mut node.generics);
+    skip!(node.eq_token);
+    v.visit_type_mut(&mut node.ty);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_impl_restriction_mut<V>(v: &mut V, node: &mut crate::ImplRestriction)
+where
+    V: VisitMut + ?Sized,
+{
+    match *node {}
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_index_mut<V>(v: &mut V, node: &mut crate::Index)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.index);
+    v.visit_span_mut(&mut node.span);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_mut<V>(v: &mut V, node: &mut crate::Item)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::Item::Const(_binding_0) => {
+            v.visit_item_const_mut(_binding_0);
+        }
+        crate::Item::Enum(_binding_0) => {
+            v.visit_item_enum_mut(_binding_0);
+        }
+        crate::Item::ExternCrate(_binding_0) => {
+            v.visit_item_extern_crate_mut(_binding_0);
+        }
+        crate::Item::Fn(_binding_0) => {
+            v.visit_item_fn_mut(_binding_0);
+        }
+        crate::Item::ForeignMod(_binding_0) => {
+            v.visit_item_foreign_mod_mut(_binding_0);
+        }
+        crate::Item::Impl(_binding_0) => {
+            v.visit_item_impl_mut(_binding_0);
+        }
+        crate::Item::Macro(_binding_0) => {
+            v.visit_item_macro_mut(_binding_0);
+        }
+        crate::Item::Mod(_binding_0) => {
+            v.visit_item_mod_mut(_binding_0);
+        }
+        crate::Item::Static(_binding_0) => {
+            v.visit_item_static_mut(_binding_0);
+        }
+        crate::Item::Struct(_binding_0) => {
+            v.visit_item_struct_mut(_binding_0);
+        }
+        crate::Item::Trait(_binding_0) => {
+            v.visit_item_trait_mut(_binding_0);
+        }
+        crate::Item::TraitAlias(_binding_0) => {
+            v.visit_item_trait_alias_mut(_binding_0);
+        }
+        crate::Item::Type(_binding_0) => {
+            v.visit_item_type_mut(_binding_0);
+        }
+        crate::Item::Union(_binding_0) => {
+            v.visit_item_union_mut(_binding_0);
+        }
+        crate::Item::Use(_binding_0) => {
+            v.visit_item_use_mut(_binding_0);
+        }
+        crate::Item::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_const_mut<V>(v: &mut V, node: &mut crate::ItemConst)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_visibility_mut(&mut node.vis);
+    skip!(node.const_token);
+    v.visit_ident_mut(&mut node.ident);
+    v.visit_generics_mut(&mut node.generics);
+    skip!(node.colon_token);
+    v.visit_type_mut(&mut *node.ty);
+    skip!(node.eq_token);
+    v.visit_expr_mut(&mut *node.expr);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_enum_mut<V>(v: &mut V, node: &mut crate::ItemEnum)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_visibility_mut(&mut node.vis);
+    skip!(node.enum_token);
+    v.visit_ident_mut(&mut node.ident);
+    v.visit_generics_mut(&mut node.generics);
+    skip!(node.brace_token);
+    for mut el in Punctuated::pairs_mut(&mut node.variants) {
+        let it = el.value_mut();
+        v.visit_variant_mut(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_extern_crate_mut<V>(v: &mut V, node: &mut crate::ItemExternCrate)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_visibility_mut(&mut node.vis);
+    skip!(node.extern_token);
+    skip!(node.crate_token);
+    v.visit_ident_mut(&mut node.ident);
+    if let Some(it) = &mut node.rename {
+        skip!((it).0);
+        v.visit_ident_mut(&mut (it).1);
+    }
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_fn_mut<V>(v: &mut V, node: &mut crate::ItemFn)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_visibility_mut(&mut node.vis);
+    v.visit_signature_mut(&mut node.sig);
+    v.visit_block_mut(&mut *node.block);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_foreign_mod_mut<V>(v: &mut V, node: &mut crate::ItemForeignMod)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.unsafety);
+    v.visit_abi_mut(&mut node.abi);
+    skip!(node.brace_token);
+    for it in &mut node.items {
+        v.visit_foreign_item_mut(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_impl_mut<V>(v: &mut V, node: &mut crate::ItemImpl)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.defaultness);
+    skip!(node.unsafety);
+    skip!(node.impl_token);
+    v.visit_generics_mut(&mut node.generics);
+    if let Some(it) = &mut node.trait_ {
+        skip!((it).0);
+        v.visit_path_mut(&mut (it).1);
+        skip!((it).2);
+    }
+    v.visit_type_mut(&mut *node.self_ty);
+    skip!(node.brace_token);
+    for it in &mut node.items {
+        v.visit_impl_item_mut(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_macro_mut<V>(v: &mut V, node: &mut crate::ItemMacro)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    if let Some(it) = &mut node.ident {
+        v.visit_ident_mut(it);
+    }
+    v.visit_macro_mut(&mut node.mac);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_mod_mut<V>(v: &mut V, node: &mut crate::ItemMod)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_visibility_mut(&mut node.vis);
+    skip!(node.unsafety);
+    skip!(node.mod_token);
+    v.visit_ident_mut(&mut node.ident);
+    if let Some(it) = &mut node.content {
+        skip!((it).0);
+        for it in &mut (it).1 {
+            v.visit_item_mut(it);
+        }
+    }
+    skip!(node.semi);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_static_mut<V>(v: &mut V, node: &mut crate::ItemStatic)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_visibility_mut(&mut node.vis);
+    skip!(node.static_token);
+    v.visit_static_mutability_mut(&mut node.mutability);
+    v.visit_ident_mut(&mut node.ident);
+    skip!(node.colon_token);
+    v.visit_type_mut(&mut *node.ty);
+    skip!(node.eq_token);
+    v.visit_expr_mut(&mut *node.expr);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_struct_mut<V>(v: &mut V, node: &mut crate::ItemStruct)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_visibility_mut(&mut node.vis);
+    skip!(node.struct_token);
+    v.visit_ident_mut(&mut node.ident);
+    v.visit_generics_mut(&mut node.generics);
+    v.visit_fields_mut(&mut node.fields);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_trait_mut<V>(v: &mut V, node: &mut crate::ItemTrait)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_visibility_mut(&mut node.vis);
+    skip!(node.unsafety);
+    skip!(node.auto_token);
+    if let Some(it) = &mut node.restriction {
+        v.visit_impl_restriction_mut(it);
+    }
+    skip!(node.trait_token);
+    v.visit_ident_mut(&mut node.ident);
+    v.visit_generics_mut(&mut node.generics);
+    skip!(node.colon_token);
+    for mut el in Punctuated::pairs_mut(&mut node.supertraits) {
+        let it = el.value_mut();
+        v.visit_type_param_bound_mut(it);
+    }
+    skip!(node.brace_token);
+    for it in &mut node.items {
+        v.visit_trait_item_mut(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_trait_alias_mut<V>(v: &mut V, node: &mut crate::ItemTraitAlias)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_visibility_mut(&mut node.vis);
+    skip!(node.trait_token);
+    v.visit_ident_mut(&mut node.ident);
+    v.visit_generics_mut(&mut node.generics);
+    skip!(node.eq_token);
+    for mut el in Punctuated::pairs_mut(&mut node.bounds) {
+        let it = el.value_mut();
+        v.visit_type_param_bound_mut(it);
+    }
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_type_mut<V>(v: &mut V, node: &mut crate::ItemType)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_visibility_mut(&mut node.vis);
+    skip!(node.type_token);
+    v.visit_ident_mut(&mut node.ident);
+    v.visit_generics_mut(&mut node.generics);
+    skip!(node.eq_token);
+    v.visit_type_mut(&mut *node.ty);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_union_mut<V>(v: &mut V, node: &mut crate::ItemUnion)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_visibility_mut(&mut node.vis);
+    skip!(node.union_token);
+    v.visit_ident_mut(&mut node.ident);
+    v.visit_generics_mut(&mut node.generics);
+    v.visit_fields_named_mut(&mut node.fields);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_item_use_mut<V>(v: &mut V, node: &mut crate::ItemUse)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_visibility_mut(&mut node.vis);
+    skip!(node.use_token);
+    skip!(node.leading_colon);
+    v.visit_use_tree_mut(&mut node.tree);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_label_mut<V>(v: &mut V, node: &mut crate::Label)
+where
+    V: VisitMut + ?Sized,
+{
+    v.visit_lifetime_mut(&mut node.name);
+    skip!(node.colon_token);
+}
+pub fn visit_lifetime_mut<V>(v: &mut V, node: &mut crate::Lifetime)
+where
+    V: VisitMut + ?Sized,
+{
+    v.visit_span_mut(&mut node.apostrophe);
+    v.visit_ident_mut(&mut node.ident);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_lifetime_param_mut<V>(v: &mut V, node: &mut crate::LifetimeParam)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_lifetime_mut(&mut node.lifetime);
+    skip!(node.colon_token);
+    for mut el in Punctuated::pairs_mut(&mut node.bounds) {
+        let it = el.value_mut();
+        v.visit_lifetime_mut(it);
+    }
+}
+pub fn visit_lit_mut<V>(v: &mut V, node: &mut crate::Lit)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::Lit::Str(_binding_0) => {
+            v.visit_lit_str_mut(_binding_0);
+        }
+        crate::Lit::ByteStr(_binding_0) => {
+            v.visit_lit_byte_str_mut(_binding_0);
+        }
+        crate::Lit::CStr(_binding_0) => {
+            v.visit_lit_cstr_mut(_binding_0);
+        }
+        crate::Lit::Byte(_binding_0) => {
+            v.visit_lit_byte_mut(_binding_0);
+        }
+        crate::Lit::Char(_binding_0) => {
+            v.visit_lit_char_mut(_binding_0);
+        }
+        crate::Lit::Int(_binding_0) => {
+            v.visit_lit_int_mut(_binding_0);
+        }
+        crate::Lit::Float(_binding_0) => {
+            v.visit_lit_float_mut(_binding_0);
+        }
+        crate::Lit::Bool(_binding_0) => {
+            v.visit_lit_bool_mut(_binding_0);
+        }
+        crate::Lit::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+pub fn visit_lit_bool_mut<V>(v: &mut V, node: &mut crate::LitBool)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.value);
+    v.visit_span_mut(&mut node.span);
+}
+pub fn visit_lit_byte_mut<V>(v: &mut V, node: &mut crate::LitByte)
+where
+    V: VisitMut + ?Sized,
+{}
+pub fn visit_lit_byte_str_mut<V>(v: &mut V, node: &mut crate::LitByteStr)
+where
+    V: VisitMut + ?Sized,
+{}
+pub fn visit_lit_cstr_mut<V>(v: &mut V, node: &mut crate::LitCStr)
+where
+    V: VisitMut + ?Sized,
+{}
+pub fn visit_lit_char_mut<V>(v: &mut V, node: &mut crate::LitChar)
+where
+    V: VisitMut + ?Sized,
+{}
+pub fn visit_lit_float_mut<V>(v: &mut V, node: &mut crate::LitFloat)
+where
+    V: VisitMut + ?Sized,
+{}
+pub fn visit_lit_int_mut<V>(v: &mut V, node: &mut crate::LitInt)
+where
+    V: VisitMut + ?Sized,
+{}
+pub fn visit_lit_str_mut<V>(v: &mut V, node: &mut crate::LitStr)
+where
+    V: VisitMut + ?Sized,
+{}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_local_mut<V>(v: &mut V, node: &mut crate::Local)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.let_token);
+    v.visit_pat_mut(&mut node.pat);
+    if let Some(it) = &mut node.init {
+        v.visit_local_init_mut(it);
+    }
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_local_init_mut<V>(v: &mut V, node: &mut crate::LocalInit)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.eq_token);
+    v.visit_expr_mut(&mut *node.expr);
+    if let Some(it) = &mut node.diverge {
+        skip!((it).0);
+        v.visit_expr_mut(&mut *(it).1);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_macro_mut<V>(v: &mut V, node: &mut crate::Macro)
+where
+    V: VisitMut + ?Sized,
+{
+    v.visit_path_mut(&mut node.path);
+    skip!(node.bang_token);
+    v.visit_macro_delimiter_mut(&mut node.delimiter);
+    skip!(node.tokens);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_macro_delimiter_mut<V>(v: &mut V, node: &mut crate::MacroDelimiter)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::MacroDelimiter::Paren(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::MacroDelimiter::Brace(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::MacroDelimiter::Bracket(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_member_mut<V>(v: &mut V, node: &mut crate::Member)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::Member::Named(_binding_0) => {
+            v.visit_ident_mut(_binding_0);
+        }
+        crate::Member::Unnamed(_binding_0) => {
+            v.visit_index_mut(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_meta_mut<V>(v: &mut V, node: &mut crate::Meta)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::Meta::Path(_binding_0) => {
+            v.visit_path_mut(_binding_0);
+        }
+        crate::Meta::List(_binding_0) => {
+            v.visit_meta_list_mut(_binding_0);
+        }
+        crate::Meta::NameValue(_binding_0) => {
+            v.visit_meta_name_value_mut(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_meta_list_mut<V>(v: &mut V, node: &mut crate::MetaList)
+where
+    V: VisitMut + ?Sized,
+{
+    v.visit_path_mut(&mut node.path);
+    v.visit_macro_delimiter_mut(&mut node.delimiter);
+    skip!(node.tokens);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_meta_name_value_mut<V>(v: &mut V, node: &mut crate::MetaNameValue)
+where
+    V: VisitMut + ?Sized,
+{
+    v.visit_path_mut(&mut node.path);
+    skip!(node.eq_token);
+    v.visit_expr_mut(&mut node.value);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_parenthesized_generic_arguments_mut<V>(
+    v: &mut V,
+    node: &mut crate::ParenthesizedGenericArguments,
+)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.paren_token);
+    for mut el in Punctuated::pairs_mut(&mut node.inputs) {
+        let it = el.value_mut();
+        v.visit_type_mut(it);
+    }
+    v.visit_return_type_mut(&mut node.output);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_mut<V>(v: &mut V, node: &mut crate::Pat)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::Pat::Const(_binding_0) => {
+            v.visit_expr_const_mut(_binding_0);
+        }
+        crate::Pat::Ident(_binding_0) => {
+            v.visit_pat_ident_mut(_binding_0);
+        }
+        crate::Pat::Lit(_binding_0) => {
+            v.visit_expr_lit_mut(_binding_0);
+        }
+        crate::Pat::Macro(_binding_0) => {
+            v.visit_expr_macro_mut(_binding_0);
+        }
+        crate::Pat::Or(_binding_0) => {
+            v.visit_pat_or_mut(_binding_0);
+        }
+        crate::Pat::Paren(_binding_0) => {
+            v.visit_pat_paren_mut(_binding_0);
+        }
+        crate::Pat::Path(_binding_0) => {
+            v.visit_expr_path_mut(_binding_0);
+        }
+        crate::Pat::Range(_binding_0) => {
+            v.visit_expr_range_mut(_binding_0);
+        }
+        crate::Pat::Reference(_binding_0) => {
+            v.visit_pat_reference_mut(_binding_0);
+        }
+        crate::Pat::Rest(_binding_0) => {
+            v.visit_pat_rest_mut(_binding_0);
+        }
+        crate::Pat::Slice(_binding_0) => {
+            v.visit_pat_slice_mut(_binding_0);
+        }
+        crate::Pat::Struct(_binding_0) => {
+            v.visit_pat_struct_mut(_binding_0);
+        }
+        crate::Pat::Tuple(_binding_0) => {
+            v.visit_pat_tuple_mut(_binding_0);
+        }
+        crate::Pat::TupleStruct(_binding_0) => {
+            v.visit_pat_tuple_struct_mut(_binding_0);
+        }
+        crate::Pat::Type(_binding_0) => {
+            v.visit_pat_type_mut(_binding_0);
+        }
+        crate::Pat::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::Pat::Wild(_binding_0) => {
+            v.visit_pat_wild_mut(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_ident_mut<V>(v: &mut V, node: &mut crate::PatIdent)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.by_ref);
+    skip!(node.mutability);
+    v.visit_ident_mut(&mut node.ident);
+    if let Some(it) = &mut node.subpat {
+        skip!((it).0);
+        v.visit_pat_mut(&mut *(it).1);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_or_mut<V>(v: &mut V, node: &mut crate::PatOr)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.leading_vert);
+    for mut el in Punctuated::pairs_mut(&mut node.cases) {
+        let it = el.value_mut();
+        v.visit_pat_mut(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_paren_mut<V>(v: &mut V, node: &mut crate::PatParen)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.paren_token);
+    v.visit_pat_mut(&mut *node.pat);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_reference_mut<V>(v: &mut V, node: &mut crate::PatReference)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.and_token);
+    skip!(node.mutability);
+    v.visit_pat_mut(&mut *node.pat);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_rest_mut<V>(v: &mut V, node: &mut crate::PatRest)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.dot2_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_slice_mut<V>(v: &mut V, node: &mut crate::PatSlice)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.bracket_token);
+    for mut el in Punctuated::pairs_mut(&mut node.elems) {
+        let it = el.value_mut();
+        v.visit_pat_mut(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_struct_mut<V>(v: &mut V, node: &mut crate::PatStruct)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    if let Some(it) = &mut node.qself {
+        v.visit_qself_mut(it);
+    }
+    v.visit_path_mut(&mut node.path);
+    skip!(node.brace_token);
+    for mut el in Punctuated::pairs_mut(&mut node.fields) {
+        let it = el.value_mut();
+        v.visit_field_pat_mut(it);
+    }
+    if let Some(it) = &mut node.rest {
+        v.visit_pat_rest_mut(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_tuple_mut<V>(v: &mut V, node: &mut crate::PatTuple)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.paren_token);
+    for mut el in Punctuated::pairs_mut(&mut node.elems) {
+        let it = el.value_mut();
+        v.visit_pat_mut(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_tuple_struct_mut<V>(v: &mut V, node: &mut crate::PatTupleStruct)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    if let Some(it) = &mut node.qself {
+        v.visit_qself_mut(it);
+    }
+    v.visit_path_mut(&mut node.path);
+    skip!(node.paren_token);
+    for mut el in Punctuated::pairs_mut(&mut node.elems) {
+        let it = el.value_mut();
+        v.visit_pat_mut(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_type_mut<V>(v: &mut V, node: &mut crate::PatType)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_pat_mut(&mut *node.pat);
+    skip!(node.colon_token);
+    v.visit_type_mut(&mut *node.ty);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_pat_wild_mut<V>(v: &mut V, node: &mut crate::PatWild)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.underscore_token);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_path_mut<V>(v: &mut V, node: &mut crate::Path)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.leading_colon);
+    for mut el in Punctuated::pairs_mut(&mut node.segments) {
+        let it = el.value_mut();
+        v.visit_path_segment_mut(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_path_arguments_mut<V>(v: &mut V, node: &mut crate::PathArguments)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::PathArguments::None => {}
+        crate::PathArguments::AngleBracketed(_binding_0) => {
+            v.visit_angle_bracketed_generic_arguments_mut(_binding_0);
+        }
+        crate::PathArguments::Parenthesized(_binding_0) => {
+            v.visit_parenthesized_generic_arguments_mut(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_path_segment_mut<V>(v: &mut V, node: &mut crate::PathSegment)
+where
+    V: VisitMut + ?Sized,
+{
+    v.visit_ident_mut(&mut node.ident);
+    v.visit_path_arguments_mut(&mut node.arguments);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_predicate_lifetime_mut<V>(v: &mut V, node: &mut crate::PredicateLifetime)
+where
+    V: VisitMut + ?Sized,
+{
+    v.visit_lifetime_mut(&mut node.lifetime);
+    skip!(node.colon_token);
+    for mut el in Punctuated::pairs_mut(&mut node.bounds) {
+        let it = el.value_mut();
+        v.visit_lifetime_mut(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_predicate_type_mut<V>(v: &mut V, node: &mut crate::PredicateType)
+where
+    V: VisitMut + ?Sized,
+{
+    if let Some(it) = &mut node.lifetimes {
+        v.visit_bound_lifetimes_mut(it);
+    }
+    v.visit_type_mut(&mut node.bounded_ty);
+    skip!(node.colon_token);
+    for mut el in Punctuated::pairs_mut(&mut node.bounds) {
+        let it = el.value_mut();
+        v.visit_type_param_bound_mut(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_qself_mut<V>(v: &mut V, node: &mut crate::QSelf)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.lt_token);
+    v.visit_type_mut(&mut *node.ty);
+    skip!(node.position);
+    skip!(node.as_token);
+    skip!(node.gt_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_range_limits_mut<V>(v: &mut V, node: &mut crate::RangeLimits)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::RangeLimits::HalfOpen(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::RangeLimits::Closed(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_receiver_mut<V>(v: &mut V, node: &mut crate::Receiver)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    if let Some(it) = &mut node.reference {
+        skip!((it).0);
+        if let Some(it) = &mut (it).1 {
+            v.visit_lifetime_mut(it);
+        }
+    }
+    skip!(node.mutability);
+    skip!(node.self_token);
+    skip!(node.colon_token);
+    v.visit_type_mut(&mut *node.ty);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_return_type_mut<V>(v: &mut V, node: &mut crate::ReturnType)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::ReturnType::Default => {}
+        crate::ReturnType::Type(_binding_0, _binding_1) => {
+            skip!(_binding_0);
+            v.visit_type_mut(&mut **_binding_1);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_signature_mut<V>(v: &mut V, node: &mut crate::Signature)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.constness);
+    skip!(node.asyncness);
+    skip!(node.unsafety);
+    if let Some(it) = &mut node.abi {
+        v.visit_abi_mut(it);
+    }
+    skip!(node.fn_token);
+    v.visit_ident_mut(&mut node.ident);
+    v.visit_generics_mut(&mut node.generics);
+    skip!(node.paren_token);
+    for mut el in Punctuated::pairs_mut(&mut node.inputs) {
+        let it = el.value_mut();
+        v.visit_fn_arg_mut(it);
+    }
+    if let Some(it) = &mut node.variadic {
+        v.visit_variadic_mut(it);
+    }
+    v.visit_return_type_mut(&mut node.output);
+}
+pub fn visit_span_mut<V>(v: &mut V, node: &mut proc_macro2::Span)
+where
+    V: VisitMut + ?Sized,
+{}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_static_mutability_mut<V>(v: &mut V, node: &mut crate::StaticMutability)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::StaticMutability::Mut(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::StaticMutability::None => {}
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_stmt_mut<V>(v: &mut V, node: &mut crate::Stmt)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::Stmt::Local(_binding_0) => {
+            v.visit_local_mut(_binding_0);
+        }
+        crate::Stmt::Item(_binding_0) => {
+            v.visit_item_mut(_binding_0);
+        }
+        crate::Stmt::Expr(_binding_0, _binding_1) => {
+            v.visit_expr_mut(_binding_0);
+            skip!(_binding_1);
+        }
+        crate::Stmt::Macro(_binding_0) => {
+            v.visit_stmt_macro_mut(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_stmt_macro_mut<V>(v: &mut V, node: &mut crate::StmtMacro)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_macro_mut(&mut node.mac);
+    skip!(node.semi_token);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_trait_bound_mut<V>(v: &mut V, node: &mut crate::TraitBound)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.paren_token);
+    v.visit_trait_bound_modifier_mut(&mut node.modifier);
+    if let Some(it) = &mut node.lifetimes {
+        v.visit_bound_lifetimes_mut(it);
+    }
+    v.visit_path_mut(&mut node.path);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_trait_bound_modifier_mut<V>(v: &mut V, node: &mut crate::TraitBoundModifier)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::TraitBoundModifier::None => {}
+        crate::TraitBoundModifier::Maybe(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_trait_item_mut<V>(v: &mut V, node: &mut crate::TraitItem)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::TraitItem::Const(_binding_0) => {
+            v.visit_trait_item_const_mut(_binding_0);
+        }
+        crate::TraitItem::Fn(_binding_0) => {
+            v.visit_trait_item_fn_mut(_binding_0);
+        }
+        crate::TraitItem::Type(_binding_0) => {
+            v.visit_trait_item_type_mut(_binding_0);
+        }
+        crate::TraitItem::Macro(_binding_0) => {
+            v.visit_trait_item_macro_mut(_binding_0);
+        }
+        crate::TraitItem::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_trait_item_const_mut<V>(v: &mut V, node: &mut crate::TraitItemConst)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.const_token);
+    v.visit_ident_mut(&mut node.ident);
+    v.visit_generics_mut(&mut node.generics);
+    skip!(node.colon_token);
+    v.visit_type_mut(&mut node.ty);
+    if let Some(it) = &mut node.default {
+        skip!((it).0);
+        v.visit_expr_mut(&mut (it).1);
+    }
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_trait_item_fn_mut<V>(v: &mut V, node: &mut crate::TraitItemFn)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_signature_mut(&mut node.sig);
+    if let Some(it) = &mut node.default {
+        v.visit_block_mut(it);
+    }
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_trait_item_macro_mut<V>(v: &mut V, node: &mut crate::TraitItemMacro)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_macro_mut(&mut node.mac);
+    skip!(node.semi_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_trait_item_type_mut<V>(v: &mut V, node: &mut crate::TraitItemType)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    skip!(node.type_token);
+    v.visit_ident_mut(&mut node.ident);
+    v.visit_generics_mut(&mut node.generics);
+    skip!(node.colon_token);
+    for mut el in Punctuated::pairs_mut(&mut node.bounds) {
+        let it = el.value_mut();
+        v.visit_type_param_bound_mut(it);
+    }
+    if let Some(it) = &mut node.default {
+        skip!((it).0);
+        v.visit_type_mut(&mut (it).1);
+    }
+    skip!(node.semi_token);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_mut<V>(v: &mut V, node: &mut crate::Type)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::Type::Array(_binding_0) => {
+            v.visit_type_array_mut(_binding_0);
+        }
+        crate::Type::BareFn(_binding_0) => {
+            v.visit_type_bare_fn_mut(_binding_0);
+        }
+        crate::Type::Group(_binding_0) => {
+            v.visit_type_group_mut(_binding_0);
+        }
+        crate::Type::ImplTrait(_binding_0) => {
+            v.visit_type_impl_trait_mut(_binding_0);
+        }
+        crate::Type::Infer(_binding_0) => {
+            v.visit_type_infer_mut(_binding_0);
+        }
+        crate::Type::Macro(_binding_0) => {
+            v.visit_type_macro_mut(_binding_0);
+        }
+        crate::Type::Never(_binding_0) => {
+            v.visit_type_never_mut(_binding_0);
+        }
+        crate::Type::Paren(_binding_0) => {
+            v.visit_type_paren_mut(_binding_0);
+        }
+        crate::Type::Path(_binding_0) => {
+            v.visit_type_path_mut(_binding_0);
+        }
+        crate::Type::Ptr(_binding_0) => {
+            v.visit_type_ptr_mut(_binding_0);
+        }
+        crate::Type::Reference(_binding_0) => {
+            v.visit_type_reference_mut(_binding_0);
+        }
+        crate::Type::Slice(_binding_0) => {
+            v.visit_type_slice_mut(_binding_0);
+        }
+        crate::Type::TraitObject(_binding_0) => {
+            v.visit_type_trait_object_mut(_binding_0);
+        }
+        crate::Type::Tuple(_binding_0) => {
+            v.visit_type_tuple_mut(_binding_0);
+        }
+        crate::Type::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_array_mut<V>(v: &mut V, node: &mut crate::TypeArray)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.bracket_token);
+    v.visit_type_mut(&mut *node.elem);
+    skip!(node.semi_token);
+    v.visit_expr_mut(&mut node.len);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_bare_fn_mut<V>(v: &mut V, node: &mut crate::TypeBareFn)
+where
+    V: VisitMut + ?Sized,
+{
+    if let Some(it) = &mut node.lifetimes {
+        v.visit_bound_lifetimes_mut(it);
+    }
+    skip!(node.unsafety);
+    if let Some(it) = &mut node.abi {
+        v.visit_abi_mut(it);
+    }
+    skip!(node.fn_token);
+    skip!(node.paren_token);
+    for mut el in Punctuated::pairs_mut(&mut node.inputs) {
+        let it = el.value_mut();
+        v.visit_bare_fn_arg_mut(it);
+    }
+    if let Some(it) = &mut node.variadic {
+        v.visit_bare_variadic_mut(it);
+    }
+    v.visit_return_type_mut(&mut node.output);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_group_mut<V>(v: &mut V, node: &mut crate::TypeGroup)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.group_token);
+    v.visit_type_mut(&mut *node.elem);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_impl_trait_mut<V>(v: &mut V, node: &mut crate::TypeImplTrait)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.impl_token);
+    for mut el in Punctuated::pairs_mut(&mut node.bounds) {
+        let it = el.value_mut();
+        v.visit_type_param_bound_mut(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_infer_mut<V>(v: &mut V, node: &mut crate::TypeInfer)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.underscore_token);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_macro_mut<V>(v: &mut V, node: &mut crate::TypeMacro)
+where
+    V: VisitMut + ?Sized,
+{
+    v.visit_macro_mut(&mut node.mac);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_never_mut<V>(v: &mut V, node: &mut crate::TypeNever)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.bang_token);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_param_mut<V>(v: &mut V, node: &mut crate::TypeParam)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_ident_mut(&mut node.ident);
+    skip!(node.colon_token);
+    for mut el in Punctuated::pairs_mut(&mut node.bounds) {
+        let it = el.value_mut();
+        v.visit_type_param_bound_mut(it);
+    }
+    skip!(node.eq_token);
+    if let Some(it) = &mut node.default {
+        v.visit_type_mut(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_param_bound_mut<V>(v: &mut V, node: &mut crate::TypeParamBound)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::TypeParamBound::Trait(_binding_0) => {
+            v.visit_trait_bound_mut(_binding_0);
+        }
+        crate::TypeParamBound::Lifetime(_binding_0) => {
+            v.visit_lifetime_mut(_binding_0);
+        }
+        crate::TypeParamBound::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_paren_mut<V>(v: &mut V, node: &mut crate::TypeParen)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.paren_token);
+    v.visit_type_mut(&mut *node.elem);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_path_mut<V>(v: &mut V, node: &mut crate::TypePath)
+where
+    V: VisitMut + ?Sized,
+{
+    if let Some(it) = &mut node.qself {
+        v.visit_qself_mut(it);
+    }
+    v.visit_path_mut(&mut node.path);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_ptr_mut<V>(v: &mut V, node: &mut crate::TypePtr)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.star_token);
+    skip!(node.const_token);
+    skip!(node.mutability);
+    v.visit_type_mut(&mut *node.elem);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_reference_mut<V>(v: &mut V, node: &mut crate::TypeReference)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.and_token);
+    if let Some(it) = &mut node.lifetime {
+        v.visit_lifetime_mut(it);
+    }
+    skip!(node.mutability);
+    v.visit_type_mut(&mut *node.elem);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_slice_mut<V>(v: &mut V, node: &mut crate::TypeSlice)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.bracket_token);
+    v.visit_type_mut(&mut *node.elem);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_trait_object_mut<V>(v: &mut V, node: &mut crate::TypeTraitObject)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.dyn_token);
+    for mut el in Punctuated::pairs_mut(&mut node.bounds) {
+        let it = el.value_mut();
+        v.visit_type_param_bound_mut(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_type_tuple_mut<V>(v: &mut V, node: &mut crate::TypeTuple)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.paren_token);
+    for mut el in Punctuated::pairs_mut(&mut node.elems) {
+        let it = el.value_mut();
+        v.visit_type_mut(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_un_op_mut<V>(v: &mut V, node: &mut crate::UnOp)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::UnOp::Deref(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::UnOp::Not(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::UnOp::Neg(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_use_glob_mut<V>(v: &mut V, node: &mut crate::UseGlob)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.star_token);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_use_group_mut<V>(v: &mut V, node: &mut crate::UseGroup)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.brace_token);
+    for mut el in Punctuated::pairs_mut(&mut node.items) {
+        let it = el.value_mut();
+        v.visit_use_tree_mut(it);
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_use_name_mut<V>(v: &mut V, node: &mut crate::UseName)
+where
+    V: VisitMut + ?Sized,
+{
+    v.visit_ident_mut(&mut node.ident);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_use_path_mut<V>(v: &mut V, node: &mut crate::UsePath)
+where
+    V: VisitMut + ?Sized,
+{
+    v.visit_ident_mut(&mut node.ident);
+    skip!(node.colon2_token);
+    v.visit_use_tree_mut(&mut *node.tree);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_use_rename_mut<V>(v: &mut V, node: &mut crate::UseRename)
+where
+    V: VisitMut + ?Sized,
+{
+    v.visit_ident_mut(&mut node.ident);
+    skip!(node.as_token);
+    v.visit_ident_mut(&mut node.rename);
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_use_tree_mut<V>(v: &mut V, node: &mut crate::UseTree)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::UseTree::Path(_binding_0) => {
+            v.visit_use_path_mut(_binding_0);
+        }
+        crate::UseTree::Name(_binding_0) => {
+            v.visit_use_name_mut(_binding_0);
+        }
+        crate::UseTree::Rename(_binding_0) => {
+            v.visit_use_rename_mut(_binding_0);
+        }
+        crate::UseTree::Glob(_binding_0) => {
+            v.visit_use_glob_mut(_binding_0);
+        }
+        crate::UseTree::Group(_binding_0) => {
+            v.visit_use_group_mut(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub fn visit_variadic_mut<V>(v: &mut V, node: &mut crate::Variadic)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    if let Some(it) = &mut node.pat {
+        v.visit_pat_mut(&mut *(it).0);
+        skip!((it).1);
+    }
+    skip!(node.dots);
+    skip!(node.comma);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_variant_mut<V>(v: &mut V, node: &mut crate::Variant)
+where
+    V: VisitMut + ?Sized,
+{
+    for it in &mut node.attrs {
+        v.visit_attribute_mut(it);
+    }
+    v.visit_ident_mut(&mut node.ident);
+    v.visit_fields_mut(&mut node.fields);
+    if let Some(it) = &mut node.discriminant {
+        skip!((it).0);
+        v.visit_expr_mut(&mut (it).1);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_vis_restricted_mut<V>(v: &mut V, node: &mut crate::VisRestricted)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.pub_token);
+    skip!(node.paren_token);
+    skip!(node.in_token);
+    v.visit_path_mut(&mut *node.path);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_visibility_mut<V>(v: &mut V, node: &mut crate::Visibility)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::Visibility::Public(_binding_0) => {
+            skip!(_binding_0);
+        }
+        crate::Visibility::Restricted(_binding_0) => {
+            v.visit_vis_restricted_mut(_binding_0);
+        }
+        crate::Visibility::Inherited => {}
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_where_clause_mut<V>(v: &mut V, node: &mut crate::WhereClause)
+where
+    V: VisitMut + ?Sized,
+{
+    skip!(node.where_token);
+    for mut el in Punctuated::pairs_mut(&mut node.predicates) {
+        let it = el.value_mut();
+        v.visit_where_predicate_mut(it);
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "derive", feature = "full"))))]
+pub fn visit_where_predicate_mut<V>(v: &mut V, node: &mut crate::WherePredicate)
+where
+    V: VisitMut + ?Sized,
+{
+    match node {
+        crate::WherePredicate::Lifetime(_binding_0) => {
+            v.visit_predicate_lifetime_mut(_binding_0);
+        }
+        crate::WherePredicate::Type(_binding_0) => {
+            v.visit_predicate_type_mut(_binding_0);
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/generics.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/generics.rs
--- 43.0.0-1/rust-vendor/syn/src/generics.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/generics.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1286 @@
+use crate::attr::Attribute;
+use crate::expr::Expr;
+use crate::ident::Ident;
+use crate::lifetime::Lifetime;
+use crate::path::Path;
+use crate::punctuated::{Iter, IterMut, Punctuated};
+use crate::token;
+use crate::ty::Type;
+use proc_macro2::TokenStream;
+#[cfg(all(feature = "printing", feature = "extra-traits"))]
+use std::fmt::{self, Debug};
+#[cfg(all(feature = "printing", feature = "extra-traits"))]
+use std::hash::{Hash, Hasher};
+
+ast_struct! {
+    /// Lifetimes and type parameters attached to a declaration of a function,
+    /// enum, trait, etc.
+    ///
+    /// This struct represents two distinct optional syntactic elements,
+    /// [generic parameters] and [where clause]. In some locations of the
+    /// grammar, there may be other tokens in between these two things.
+    ///
+    /// [generic parameters]: https://doc.rust-lang.org/stable/reference/items/generics.html#generic-parameters
+    /// [where clause]: https://doc.rust-lang.org/stable/reference/items/generics.html#where-clauses
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct Generics {
+        pub lt_token: Option<Token![<]>,
+        pub params: Punctuated<GenericParam, Token![,]>,
+        pub gt_token: Option<Token![>]>,
+        pub where_clause: Option<WhereClause>,
+    }
+}
+
+ast_enum_of_structs! {
+    /// A generic type parameter, lifetime, or const generic: `T: Into<String>`,
+    /// `'a: 'b`, `const LEN: usize`.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub enum GenericParam {
+        /// A lifetime parameter: `'a: 'b + 'c + 'd`.
+        Lifetime(LifetimeParam),
+
+        /// A generic type parameter: `T: Into<String>`.
+        Type(TypeParam),
+
+        /// A const generic parameter: `const LENGTH: usize`.
+        Const(ConstParam),
+    }
+}
+
+ast_struct! {
+    /// A lifetime definition: `'a: 'b + 'c + 'd`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct LifetimeParam {
+        pub attrs: Vec<Attribute>,
+        pub lifetime: Lifetime,
+        pub colon_token: Option<Token![:]>,
+        pub bounds: Punctuated<Lifetime, Token![+]>,
+    }
+}
+
+ast_struct! {
+    /// A generic type parameter: `T: Into<String>`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeParam {
+        pub attrs: Vec<Attribute>,
+        pub ident: Ident,
+        pub colon_token: Option<Token![:]>,
+        pub bounds: Punctuated<TypeParamBound, Token![+]>,
+        pub eq_token: Option<Token![=]>,
+        pub default: Option<Type>,
+    }
+}
+
+ast_struct! {
+    /// A const generic parameter: `const LENGTH: usize`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ConstParam {
+        pub attrs: Vec<Attribute>,
+        pub const_token: Token![const],
+        pub ident: Ident,
+        pub colon_token: Token![:],
+        pub ty: Type,
+        pub eq_token: Option<Token![=]>,
+        pub default: Option<Expr>,
+    }
+}
+
+impl Default for Generics {
+    fn default() -> Self {
+        Generics {
+            lt_token: None,
+            params: Punctuated::new(),
+            gt_token: None,
+            where_clause: None,
+        }
+    }
+}
+
+impl Generics {
+    /// Returns an
+    /// <code
+    ///   style="padding-right:0;">Iterator&lt;Item = &amp;</code><a
+    ///   href="struct.LifetimeParam.html"><code
+    ///   style="padding-left:0;padding-right:0;">LifetimeParam</code></a><code
+    ///   style="padding-left:0;">&gt;</code>
+    /// over the lifetime parameters in `self.params`.
+    pub fn lifetimes(&self) -> Lifetimes {
+        Lifetimes(self.params.iter())
+    }
+
+    /// Returns an
+    /// <code
+    ///   style="padding-right:0;">Iterator&lt;Item = &amp;mut </code><a
+    ///   href="struct.LifetimeParam.html"><code
+    ///   style="padding-left:0;padding-right:0;">LifetimeParam</code></a><code
+    ///   style="padding-left:0;">&gt;</code>
+    /// over the lifetime parameters in `self.params`.
+    pub fn lifetimes_mut(&mut self) -> LifetimesMut {
+        LifetimesMut(self.params.iter_mut())
+    }
+
+    /// Returns an
+    /// <code
+    ///   style="padding-right:0;">Iterator&lt;Item = &amp;</code><a
+    ///   href="struct.TypeParam.html"><code
+    ///   style="padding-left:0;padding-right:0;">TypeParam</code></a><code
+    ///   style="padding-left:0;">&gt;</code>
+    /// over the type parameters in `self.params`.
+    pub fn type_params(&self) -> TypeParams {
+        TypeParams(self.params.iter())
+    }
+
+    /// Returns an
+    /// <code
+    ///   style="padding-right:0;">Iterator&lt;Item = &amp;mut </code><a
+    ///   href="struct.TypeParam.html"><code
+    ///   style="padding-left:0;padding-right:0;">TypeParam</code></a><code
+    ///   style="padding-left:0;">&gt;</code>
+    /// over the type parameters in `self.params`.
+    pub fn type_params_mut(&mut self) -> TypeParamsMut {
+        TypeParamsMut(self.params.iter_mut())
+    }
+
+    /// Returns an
+    /// <code
+    ///   style="padding-right:0;">Iterator&lt;Item = &amp;</code><a
+    ///   href="struct.ConstParam.html"><code
+    ///   style="padding-left:0;padding-right:0;">ConstParam</code></a><code
+    ///   style="padding-left:0;">&gt;</code>
+    /// over the constant parameters in `self.params`.
+    pub fn const_params(&self) -> ConstParams {
+        ConstParams(self.params.iter())
+    }
+
+    /// Returns an
+    /// <code
+    ///   style="padding-right:0;">Iterator&lt;Item = &amp;mut </code><a
+    ///   href="struct.ConstParam.html"><code
+    ///   style="padding-left:0;padding-right:0;">ConstParam</code></a><code
+    ///   style="padding-left:0;">&gt;</code>
+    /// over the constant parameters in `self.params`.
+    pub fn const_params_mut(&mut self) -> ConstParamsMut {
+        ConstParamsMut(self.params.iter_mut())
+    }
+
+    /// Initializes an empty `where`-clause if there is not one present already.
+    pub fn make_where_clause(&mut self) -> &mut WhereClause {
+        self.where_clause.get_or_insert_with(|| WhereClause {
+            where_token: <Token![where]>::default(),
+            predicates: Punctuated::new(),
+        })
+    }
+}
+
+pub struct Lifetimes<'a>(Iter<'a, GenericParam>);
+
+impl<'a> Iterator for Lifetimes<'a> {
+    type Item = &'a LifetimeParam;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        let next = match self.0.next() {
+            Some(item) => item,
+            None => return None,
+        };
+        if let GenericParam::Lifetime(lifetime) = next {
+            Some(lifetime)
+        } else {
+            self.next()
+        }
+    }
+}
+
+pub struct LifetimesMut<'a>(IterMut<'a, GenericParam>);
+
+impl<'a> Iterator for LifetimesMut<'a> {
+    type Item = &'a mut LifetimeParam;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        let next = match self.0.next() {
+            Some(item) => item,
+            None => return None,
+        };
+        if let GenericParam::Lifetime(lifetime) = next {
+            Some(lifetime)
+        } else {
+            self.next()
+        }
+    }
+}
+
+pub struct TypeParams<'a>(Iter<'a, GenericParam>);
+
+impl<'a> Iterator for TypeParams<'a> {
+    type Item = &'a TypeParam;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        let next = match self.0.next() {
+            Some(item) => item,
+            None => return None,
+        };
+        if let GenericParam::Type(type_param) = next {
+            Some(type_param)
+        } else {
+            self.next()
+        }
+    }
+}
+
+pub struct TypeParamsMut<'a>(IterMut<'a, GenericParam>);
+
+impl<'a> Iterator for TypeParamsMut<'a> {
+    type Item = &'a mut TypeParam;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        let next = match self.0.next() {
+            Some(item) => item,
+            None => return None,
+        };
+        if let GenericParam::Type(type_param) = next {
+            Some(type_param)
+        } else {
+            self.next()
+        }
+    }
+}
+
+pub struct ConstParams<'a>(Iter<'a, GenericParam>);
+
+impl<'a> Iterator for ConstParams<'a> {
+    type Item = &'a ConstParam;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        let next = match self.0.next() {
+            Some(item) => item,
+            None => return None,
+        };
+        if let GenericParam::Const(const_param) = next {
+            Some(const_param)
+        } else {
+            self.next()
+        }
+    }
+}
+
+pub struct ConstParamsMut<'a>(IterMut<'a, GenericParam>);
+
+impl<'a> Iterator for ConstParamsMut<'a> {
+    type Item = &'a mut ConstParam;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        let next = match self.0.next() {
+            Some(item) => item,
+            None => return None,
+        };
+        if let GenericParam::Const(const_param) = next {
+            Some(const_param)
+        } else {
+            self.next()
+        }
+    }
+}
+
+/// Returned by `Generics::split_for_impl`.
+#[cfg(feature = "printing")]
+#[cfg_attr(
+    docsrs,
+    doc(cfg(all(any(feature = "full", feature = "derive"), feature = "printing")))
+)]
+pub struct ImplGenerics<'a>(&'a Generics);
+
+/// Returned by `Generics::split_for_impl`.
+#[cfg(feature = "printing")]
+#[cfg_attr(
+    docsrs,
+    doc(cfg(all(any(feature = "full", feature = "derive"), feature = "printing")))
+)]
+pub struct TypeGenerics<'a>(&'a Generics);
+
+/// Returned by `TypeGenerics::as_turbofish`.
+#[cfg(feature = "printing")]
+#[cfg_attr(
+    docsrs,
+    doc(cfg(all(any(feature = "full", feature = "derive"), feature = "printing")))
+)]
+pub struct Turbofish<'a>(&'a Generics);
+
+#[cfg(feature = "printing")]
+impl Generics {
+    /// Split a type's generics into the pieces required for impl'ing a trait
+    /// for that type.
+    ///
+    /// ```
+    /// # use proc_macro2::{Span, Ident};
+    /// # use quote::quote;
+    /// #
+    /// # let generics: syn::Generics = Default::default();
+    /// # let name = Ident::new("MyType", Span::call_site());
+    /// #
+    /// let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
+    /// quote! {
+    ///     impl #impl_generics MyTrait for #name #ty_generics #where_clause {
+    ///         // ...
+    ///     }
+    /// }
+    /// # ;
+    /// ```
+    #[cfg_attr(
+        docsrs,
+        doc(cfg(all(any(feature = "full", feature = "derive"), feature = "printing")))
+    )]
+    pub fn split_for_impl(&self) -> (ImplGenerics, TypeGenerics, Option<&WhereClause>) {
+        (
+            ImplGenerics(self),
+            TypeGenerics(self),
+            self.where_clause.as_ref(),
+        )
+    }
+}
+
+#[cfg(feature = "printing")]
+macro_rules! generics_wrapper_impls {
+    ($ty:ident) => {
+        #[cfg(feature = "clone-impls")]
+        #[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+        impl<'a> Clone for $ty<'a> {
+            fn clone(&self) -> Self {
+                $ty(self.0)
+            }
+        }
+
+        #[cfg(feature = "extra-traits")]
+        #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+        impl<'a> Debug for $ty<'a> {
+            fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                formatter
+                    .debug_tuple(stringify!($ty))
+                    .field(self.0)
+                    .finish()
+            }
+        }
+
+        #[cfg(feature = "extra-traits")]
+        #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+        impl<'a> Eq for $ty<'a> {}
+
+        #[cfg(feature = "extra-traits")]
+        #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+        impl<'a> PartialEq for $ty<'a> {
+            fn eq(&self, other: &Self) -> bool {
+                self.0 == other.0
+            }
+        }
+
+        #[cfg(feature = "extra-traits")]
+        #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+        impl<'a> Hash for $ty<'a> {
+            fn hash<H: Hasher>(&self, state: &mut H) {
+                self.0.hash(state);
+            }
+        }
+    };
+}
+
+#[cfg(feature = "printing")]
+generics_wrapper_impls!(ImplGenerics);
+#[cfg(feature = "printing")]
+generics_wrapper_impls!(TypeGenerics);
+#[cfg(feature = "printing")]
+generics_wrapper_impls!(Turbofish);
+
+#[cfg(feature = "printing")]
+impl<'a> TypeGenerics<'a> {
+    /// Turn a type's generics like `<X, Y>` into a turbofish like `::<X, Y>`.
+    pub fn as_turbofish(&self) -> Turbofish {
+        Turbofish(self.0)
+    }
+}
+
+ast_struct! {
+    /// A set of bound lifetimes: `for<'a, 'b, 'c>`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct BoundLifetimes {
+        pub for_token: Token![for],
+        pub lt_token: Token![<],
+        pub lifetimes: Punctuated<GenericParam, Token![,]>,
+        pub gt_token: Token![>],
+    }
+}
+
+impl Default for BoundLifetimes {
+    fn default() -> Self {
+        BoundLifetimes {
+            for_token: Default::default(),
+            lt_token: Default::default(),
+            lifetimes: Punctuated::new(),
+            gt_token: Default::default(),
+        }
+    }
+}
+
+impl LifetimeParam {
+    pub fn new(lifetime: Lifetime) -> Self {
+        LifetimeParam {
+            attrs: Vec::new(),
+            lifetime,
+            colon_token: None,
+            bounds: Punctuated::new(),
+        }
+    }
+}
+
+impl From<Ident> for TypeParam {
+    fn from(ident: Ident) -> Self {
+        TypeParam {
+            attrs: vec![],
+            ident,
+            colon_token: None,
+            bounds: Punctuated::new(),
+            eq_token: None,
+            default: None,
+        }
+    }
+}
+
+ast_enum_of_structs! {
+    /// A trait or lifetime used as a bound on a type parameter.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    #[non_exhaustive]
+    pub enum TypeParamBound {
+        Trait(TraitBound),
+        Lifetime(Lifetime),
+        Verbatim(TokenStream),
+    }
+}
+
+ast_struct! {
+    /// A trait used as a bound on a type parameter.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TraitBound {
+        pub paren_token: Option<token::Paren>,
+        pub modifier: TraitBoundModifier,
+        /// The `for<'a>` in `for<'a> Foo<&'a T>`
+        pub lifetimes: Option<BoundLifetimes>,
+        /// The `Foo<&'a T>` in `for<'a> Foo<&'a T>`
+        pub path: Path,
+    }
+}
+
+ast_enum! {
+    /// A modifier on a trait bound, currently only used for the `?` in
+    /// `?Sized`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub enum TraitBoundModifier {
+        None,
+        Maybe(Token![?]),
+    }
+}
+
+ast_struct! {
+    /// A `where` clause in a definition: `where T: Deserialize<'de>, D:
+    /// 'static`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct WhereClause {
+        pub where_token: Token![where],
+        pub predicates: Punctuated<WherePredicate, Token![,]>,
+    }
+}
+
+ast_enum_of_structs! {
+    /// A single predicate in a `where` clause: `T: Deserialize<'de>`.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    #[non_exhaustive]
+    pub enum WherePredicate {
+        /// A lifetime predicate in a `where` clause: `'a: 'b + 'c`.
+        Lifetime(PredicateLifetime),
+
+        /// A type predicate in a `where` clause: `for<'c> Foo<'c>: Trait<'c>`.
+        Type(PredicateType),
+    }
+}
+
+ast_struct! {
+    /// A lifetime predicate in a `where` clause: `'a: 'b + 'c`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct PredicateLifetime {
+        pub lifetime: Lifetime,
+        pub colon_token: Token![:],
+        pub bounds: Punctuated<Lifetime, Token![+]>,
+    }
+}
+
+ast_struct! {
+    /// A type predicate in a `where` clause: `for<'c> Foo<'c>: Trait<'c>`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct PredicateType {
+        /// Any lifetimes from a `for` binding
+        pub lifetimes: Option<BoundLifetimes>,
+        /// The type being bounded
+        pub bounded_ty: Type,
+        pub colon_token: Token![:],
+        /// Trait and lifetime bounds (`Clone+Send+'static`)
+        pub bounds: Punctuated<TypeParamBound, Token![+]>,
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::attr::Attribute;
+    use crate::error::Result;
+    use crate::ext::IdentExt as _;
+    use crate::generics::{
+        BoundLifetimes, ConstParam, GenericParam, Generics, LifetimeParam, PredicateLifetime,
+        PredicateType, TraitBound, TraitBoundModifier, TypeParam, TypeParamBound, WhereClause,
+        WherePredicate,
+    };
+    use crate::ident::Ident;
+    use crate::lifetime::Lifetime;
+    use crate::parse::{Parse, ParseStream};
+    use crate::path::{self, ParenthesizedGenericArguments, Path, PathArguments};
+    use crate::punctuated::Punctuated;
+    use crate::token;
+    use crate::ty::Type;
+    use crate::verbatim;
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Generics {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if !input.peek(Token![<]) {
+                return Ok(Generics::default());
+            }
+
+            let lt_token: Token![<] = input.parse()?;
+
+            let mut params = Punctuated::new();
+            loop {
+                if input.peek(Token![>]) {
+                    break;
+                }
+
+                let attrs = input.call(Attribute::parse_outer)?;
+                let lookahead = input.lookahead1();
+                if lookahead.peek(Lifetime) {
+                    params.push_value(GenericParam::Lifetime(LifetimeParam {
+                        attrs,
+                        ..input.parse()?
+                    }));
+                } else if lookahead.peek(Ident) {
+                    params.push_value(GenericParam::Type(TypeParam {
+                        attrs,
+                        ..input.parse()?
+                    }));
+                } else if lookahead.peek(Token![const]) {
+                    params.push_value(GenericParam::Const(ConstParam {
+                        attrs,
+                        ..input.parse()?
+                    }));
+                } else if input.peek(Token![_]) {
+                    params.push_value(GenericParam::Type(TypeParam {
+                        attrs,
+                        ident: input.call(Ident::parse_any)?,
+                        colon_token: None,
+                        bounds: Punctuated::new(),
+                        eq_token: None,
+                        default: None,
+                    }));
+                } else {
+                    return Err(lookahead.error());
+                }
+
+                if input.peek(Token![>]) {
+                    break;
+                }
+                let punct = input.parse()?;
+                params.push_punct(punct);
+            }
+
+            let gt_token: Token![>] = input.parse()?;
+
+            Ok(Generics {
+                lt_token: Some(lt_token),
+                params,
+                gt_token: Some(gt_token),
+                where_clause: None,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for GenericParam {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+
+            let lookahead = input.lookahead1();
+            if lookahead.peek(Ident) {
+                Ok(GenericParam::Type(TypeParam {
+                    attrs,
+                    ..input.parse()?
+                }))
+            } else if lookahead.peek(Lifetime) {
+                Ok(GenericParam::Lifetime(LifetimeParam {
+                    attrs,
+                    ..input.parse()?
+                }))
+            } else if lookahead.peek(Token![const]) {
+                Ok(GenericParam::Const(ConstParam {
+                    attrs,
+                    ..input.parse()?
+                }))
+            } else {
+                Err(lookahead.error())
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for LifetimeParam {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let has_colon;
+            Ok(LifetimeParam {
+                attrs: input.call(Attribute::parse_outer)?,
+                lifetime: input.parse()?,
+                colon_token: {
+                    if input.peek(Token![:]) {
+                        has_colon = true;
+                        Some(input.parse()?)
+                    } else {
+                        has_colon = false;
+                        None
+                    }
+                },
+                bounds: {
+                    let mut bounds = Punctuated::new();
+                    if has_colon {
+                        loop {
+                            if input.peek(Token![,]) || input.peek(Token![>]) {
+                                break;
+                            }
+                            let value = input.parse()?;
+                            bounds.push_value(value);
+                            if !input.peek(Token![+]) {
+                                break;
+                            }
+                            let punct = input.parse()?;
+                            bounds.push_punct(punct);
+                        }
+                    }
+                    bounds
+                },
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for BoundLifetimes {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(BoundLifetimes {
+                for_token: input.parse()?,
+                lt_token: input.parse()?,
+                lifetimes: {
+                    let mut lifetimes = Punctuated::new();
+                    while !input.peek(Token![>]) {
+                        let attrs = input.call(Attribute::parse_outer)?;
+                        let lifetime: Lifetime = input.parse()?;
+                        lifetimes.push_value(GenericParam::Lifetime(LifetimeParam {
+                            attrs,
+                            lifetime,
+                            colon_token: None,
+                            bounds: Punctuated::new(),
+                        }));
+                        if input.peek(Token![>]) {
+                            break;
+                        }
+                        lifetimes.push_punct(input.parse()?);
+                    }
+                    lifetimes
+                },
+                gt_token: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Option<BoundLifetimes> {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Token![for]) {
+                input.parse().map(Some)
+            } else {
+                Ok(None)
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeParam {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let ident: Ident = input.parse()?;
+            let colon_token: Option<Token![:]> = input.parse()?;
+
+            let mut bounds = Punctuated::new();
+            if colon_token.is_some() {
+                loop {
+                    if input.peek(Token![,]) || input.peek(Token![>]) || input.peek(Token![=]) {
+                        break;
+                    }
+                    let value: TypeParamBound = input.parse()?;
+                    bounds.push_value(value);
+                    if !input.peek(Token![+]) {
+                        break;
+                    }
+                    let punct: Token![+] = input.parse()?;
+                    bounds.push_punct(punct);
+                }
+            }
+
+            let eq_token: Option<Token![=]> = input.parse()?;
+            let default = if eq_token.is_some() {
+                Some(input.parse::<Type>()?)
+            } else {
+                None
+            };
+
+            Ok(TypeParam {
+                attrs,
+                ident,
+                colon_token,
+                bounds,
+                eq_token,
+                default,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeParamBound {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Lifetime) {
+                return input.parse().map(TypeParamBound::Lifetime);
+            }
+
+            let begin = input.fork();
+
+            let content;
+            let (paren_token, content) = if input.peek(token::Paren) {
+                (Some(parenthesized!(content in input)), &content)
+            } else {
+                (None, input)
+            };
+
+            let is_tilde_const =
+                cfg!(feature = "full") && content.peek(Token![~]) && content.peek2(Token![const]);
+            if is_tilde_const {
+                content.parse::<Token![~]>()?;
+                content.parse::<Token![const]>()?;
+            }
+
+            let mut bound: TraitBound = content.parse()?;
+            bound.paren_token = paren_token;
+
+            if is_tilde_const {
+                Ok(TypeParamBound::Verbatim(verbatim::between(&begin, input)))
+            } else {
+                Ok(TypeParamBound::Trait(bound))
+            }
+        }
+    }
+
+    impl TypeParamBound {
+        pub(crate) fn parse_multiple(
+            input: ParseStream,
+            allow_plus: bool,
+        ) -> Result<Punctuated<Self, Token![+]>> {
+            let mut bounds = Punctuated::new();
+            loop {
+                bounds.push_value(input.parse()?);
+                if !(allow_plus && input.peek(Token![+])) {
+                    break;
+                }
+                bounds.push_punct(input.parse()?);
+                if !(input.peek(Ident::peek_any)
+                    || input.peek(Token![::])
+                    || input.peek(Token![?])
+                    || input.peek(Lifetime)
+                    || input.peek(token::Paren)
+                    || input.peek(Token![~]))
+                {
+                    break;
+                }
+            }
+            Ok(bounds)
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TraitBound {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let modifier: TraitBoundModifier = input.parse()?;
+            let lifetimes: Option<BoundLifetimes> = input.parse()?;
+
+            let mut path: Path = input.parse()?;
+            if path.segments.last().unwrap().arguments.is_empty()
+                && (input.peek(token::Paren) || input.peek(Token![::]) && input.peek3(token::Paren))
+            {
+                input.parse::<Option<Token![::]>>()?;
+                let args: ParenthesizedGenericArguments = input.parse()?;
+                let parenthesized = PathArguments::Parenthesized(args);
+                path.segments.last_mut().unwrap().arguments = parenthesized;
+            }
+
+            Ok(TraitBound {
+                paren_token: None,
+                modifier,
+                lifetimes,
+                path,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TraitBoundModifier {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Token![?]) {
+                input.parse().map(TraitBoundModifier::Maybe)
+            } else {
+                Ok(TraitBoundModifier::None)
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ConstParam {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut default = None;
+            Ok(ConstParam {
+                attrs: input.call(Attribute::parse_outer)?,
+                const_token: input.parse()?,
+                ident: input.parse()?,
+                colon_token: input.parse()?,
+                ty: input.parse()?,
+                eq_token: {
+                    if input.peek(Token![=]) {
+                        let eq_token = input.parse()?;
+                        default = Some(path::parsing::const_argument(input)?);
+                        Some(eq_token)
+                    } else {
+                        None
+                    }
+                },
+                default,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for WhereClause {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(WhereClause {
+                where_token: input.parse()?,
+                predicates: {
+                    let mut predicates = Punctuated::new();
+                    loop {
+                        if input.is_empty()
+                            || input.peek(token::Brace)
+                            || input.peek(Token![,])
+                            || input.peek(Token![;])
+                            || input.peek(Token![:]) && !input.peek(Token![::])
+                            || input.peek(Token![=])
+                        {
+                            break;
+                        }
+                        let value = input.parse()?;
+                        predicates.push_value(value);
+                        if !input.peek(Token![,]) {
+                            break;
+                        }
+                        let punct = input.parse()?;
+                        predicates.push_punct(punct);
+                    }
+                    predicates
+                },
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Option<WhereClause> {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Token![where]) {
+                input.parse().map(Some)
+            } else {
+                Ok(None)
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for WherePredicate {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Lifetime) && input.peek2(Token![:]) {
+                Ok(WherePredicate::Lifetime(PredicateLifetime {
+                    lifetime: input.parse()?,
+                    colon_token: input.parse()?,
+                    bounds: {
+                        let mut bounds = Punctuated::new();
+                        loop {
+                            if input.is_empty()
+                                || input.peek(token::Brace)
+                                || input.peek(Token![,])
+                                || input.peek(Token![;])
+                                || input.peek(Token![:])
+                                || input.peek(Token![=])
+                            {
+                                break;
+                            }
+                            let value = input.parse()?;
+                            bounds.push_value(value);
+                            if !input.peek(Token![+]) {
+                                break;
+                            }
+                            let punct = input.parse()?;
+                            bounds.push_punct(punct);
+                        }
+                        bounds
+                    },
+                }))
+            } else {
+                Ok(WherePredicate::Type(PredicateType {
+                    lifetimes: input.parse()?,
+                    bounded_ty: input.parse()?,
+                    colon_token: input.parse()?,
+                    bounds: {
+                        let mut bounds = Punctuated::new();
+                        loop {
+                            if input.is_empty()
+                                || input.peek(token::Brace)
+                                || input.peek(Token![,])
+                                || input.peek(Token![;])
+                                || input.peek(Token![:]) && !input.peek(Token![::])
+                                || input.peek(Token![=])
+                            {
+                                break;
+                            }
+                            let value = input.parse()?;
+                            bounds.push_value(value);
+                            if !input.peek(Token![+]) {
+                                break;
+                            }
+                            let punct = input.parse()?;
+                            bounds.push_punct(punct);
+                        }
+                        bounds
+                    },
+                }))
+            }
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+pub(crate) mod printing {
+    use crate::attr::FilterAttrs;
+    #[cfg(feature = "full")]
+    use crate::expr;
+    use crate::expr::Expr;
+    #[cfg(feature = "full")]
+    use crate::fixup::FixupContext;
+    use crate::generics::{
+        BoundLifetimes, ConstParam, GenericParam, Generics, ImplGenerics, LifetimeParam,
+        PredicateLifetime, PredicateType, TraitBound, TraitBoundModifier, Turbofish, TypeGenerics,
+        TypeParam, WhereClause,
+    };
+    use crate::print::TokensOrDefault;
+    use crate::token;
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for Generics {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            if self.params.is_empty() {
+                return;
+            }
+
+            TokensOrDefault(&self.lt_token).to_tokens(tokens);
+
+            // Print lifetimes before types and consts, regardless of their
+            // order in self.params.
+            let mut trailing_or_empty = true;
+            for param in self.params.pairs() {
+                if let GenericParam::Lifetime(_) = **param.value() {
+                    param.to_tokens(tokens);
+                    trailing_or_empty = param.punct().is_some();
+                }
+            }
+            for param in self.params.pairs() {
+                match param.value() {
+                    GenericParam::Type(_) | GenericParam::Const(_) => {
+                        if !trailing_or_empty {
+                            <Token![,]>::default().to_tokens(tokens);
+                            trailing_or_empty = true;
+                        }
+                        param.to_tokens(tokens);
+                    }
+                    GenericParam::Lifetime(_) => {}
+                }
+            }
+
+            TokensOrDefault(&self.gt_token).to_tokens(tokens);
+        }
+    }
+
+    impl<'a> ToTokens for ImplGenerics<'a> {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            if self.0.params.is_empty() {
+                return;
+            }
+
+            TokensOrDefault(&self.0.lt_token).to_tokens(tokens);
+
+            // Print lifetimes before types and consts, regardless of their
+            // order in self.params.
+            let mut trailing_or_empty = true;
+            for param in self.0.params.pairs() {
+                if let GenericParam::Lifetime(_) = **param.value() {
+                    param.to_tokens(tokens);
+                    trailing_or_empty = param.punct().is_some();
+                }
+            }
+            for param in self.0.params.pairs() {
+                if let GenericParam::Lifetime(_) = **param.value() {
+                    continue;
+                }
+                if !trailing_or_empty {
+                    <Token![,]>::default().to_tokens(tokens);
+                    trailing_or_empty = true;
+                }
+                match param.value() {
+                    GenericParam::Lifetime(_) => unreachable!(),
+                    GenericParam::Type(param) => {
+                        // Leave off the type parameter defaults
+                        tokens.append_all(param.attrs.outer());
+                        param.ident.to_tokens(tokens);
+                        if !param.bounds.is_empty() {
+                            TokensOrDefault(&param.colon_token).to_tokens(tokens);
+                            param.bounds.to_tokens(tokens);
+                        }
+                    }
+                    GenericParam::Const(param) => {
+                        // Leave off the const parameter defaults
+                        tokens.append_all(param.attrs.outer());
+                        param.const_token.to_tokens(tokens);
+                        param.ident.to_tokens(tokens);
+                        param.colon_token.to_tokens(tokens);
+                        param.ty.to_tokens(tokens);
+                    }
+                }
+                param.punct().to_tokens(tokens);
+            }
+
+            TokensOrDefault(&self.0.gt_token).to_tokens(tokens);
+        }
+    }
+
+    impl<'a> ToTokens for TypeGenerics<'a> {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            if self.0.params.is_empty() {
+                return;
+            }
+
+            TokensOrDefault(&self.0.lt_token).to_tokens(tokens);
+
+            // Print lifetimes before types and consts, regardless of their
+            // order in self.params.
+            let mut trailing_or_empty = true;
+            for param in self.0.params.pairs() {
+                if let GenericParam::Lifetime(def) = *param.value() {
+                    // Leave off the lifetime bounds and attributes
+                    def.lifetime.to_tokens(tokens);
+                    param.punct().to_tokens(tokens);
+                    trailing_or_empty = param.punct().is_some();
+                }
+            }
+            for param in self.0.params.pairs() {
+                if let GenericParam::Lifetime(_) = **param.value() {
+                    continue;
+                }
+                if !trailing_or_empty {
+                    <Token![,]>::default().to_tokens(tokens);
+                    trailing_or_empty = true;
+                }
+                match param.value() {
+                    GenericParam::Lifetime(_) => unreachable!(),
+                    GenericParam::Type(param) => {
+                        // Leave off the type parameter defaults
+                        param.ident.to_tokens(tokens);
+                    }
+                    GenericParam::Const(param) => {
+                        // Leave off the const parameter defaults
+                        param.ident.to_tokens(tokens);
+                    }
+                }
+                param.punct().to_tokens(tokens);
+            }
+
+            TokensOrDefault(&self.0.gt_token).to_tokens(tokens);
+        }
+    }
+
+    impl<'a> ToTokens for Turbofish<'a> {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            if !self.0.params.is_empty() {
+                <Token![::]>::default().to_tokens(tokens);
+                TypeGenerics(self.0).to_tokens(tokens);
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for BoundLifetimes {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.for_token.to_tokens(tokens);
+            self.lt_token.to_tokens(tokens);
+            self.lifetimes.to_tokens(tokens);
+            self.gt_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for LifetimeParam {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.lifetime.to_tokens(tokens);
+            if !self.bounds.is_empty() {
+                TokensOrDefault(&self.colon_token).to_tokens(tokens);
+                self.bounds.to_tokens(tokens);
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeParam {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.ident.to_tokens(tokens);
+            if !self.bounds.is_empty() {
+                TokensOrDefault(&self.colon_token).to_tokens(tokens);
+                self.bounds.to_tokens(tokens);
+            }
+            if let Some(default) = &self.default {
+                TokensOrDefault(&self.eq_token).to_tokens(tokens);
+                default.to_tokens(tokens);
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TraitBound {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            let to_tokens = |tokens: &mut TokenStream| {
+                self.modifier.to_tokens(tokens);
+                self.lifetimes.to_tokens(tokens);
+                self.path.to_tokens(tokens);
+            };
+            match &self.paren_token {
+                Some(paren) => paren.surround(tokens, to_tokens),
+                None => to_tokens(tokens),
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TraitBoundModifier {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                TraitBoundModifier::None => {}
+                TraitBoundModifier::Maybe(t) => t.to_tokens(tokens),
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ConstParam {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.const_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+            if let Some(default) = &self.default {
+                TokensOrDefault(&self.eq_token).to_tokens(tokens);
+                print_const_argument(default, tokens);
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for WhereClause {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            if !self.predicates.is_empty() {
+                self.where_token.to_tokens(tokens);
+                self.predicates.to_tokens(tokens);
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for PredicateLifetime {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.lifetime.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.bounds.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for PredicateType {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.lifetimes.to_tokens(tokens);
+            self.bounded_ty.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.bounds.to_tokens(tokens);
+        }
+    }
+
+    pub(crate) fn print_const_argument(expr: &Expr, tokens: &mut TokenStream) {
+        match expr {
+            Expr::Lit(expr) => expr.to_tokens(tokens),
+
+            Expr::Path(expr)
+                if expr.attrs.is_empty()
+                    && expr.qself.is_none()
+                    && expr.path.get_ident().is_some() =>
+            {
+                expr.to_tokens(tokens);
+            }
+
+            #[cfg(feature = "full")]
+            Expr::Block(expr) => expr.to_tokens(tokens),
+
+            #[cfg(not(feature = "full"))]
+            Expr::Verbatim(expr) => expr.to_tokens(tokens),
+
+            // ERROR CORRECTION: Add braces to make sure that the
+            // generated code is valid.
+            _ => token::Brace::default().surround(tokens, |tokens| {
+                #[cfg(feature = "full")]
+                expr::printing::print_expr(expr, tokens, FixupContext::new_stmt());
+
+                #[cfg(not(feature = "full"))]
+                expr.to_tokens(tokens);
+            }),
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/group.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/group.rs
--- 43.0.0-1/rust-vendor/syn/src/group.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/group.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,291 @@
+use crate::error::Result;
+use crate::parse::ParseBuffer;
+use crate::token;
+use proc_macro2::extra::DelimSpan;
+use proc_macro2::Delimiter;
+
+// Not public API.
+#[doc(hidden)]
+pub struct Parens<'a> {
+    #[doc(hidden)]
+    pub token: token::Paren,
+    #[doc(hidden)]
+    pub content: ParseBuffer<'a>,
+}
+
+// Not public API.
+#[doc(hidden)]
+pub struct Braces<'a> {
+    #[doc(hidden)]
+    pub token: token::Brace,
+    #[doc(hidden)]
+    pub content: ParseBuffer<'a>,
+}
+
+// Not public API.
+#[doc(hidden)]
+pub struct Brackets<'a> {
+    #[doc(hidden)]
+    pub token: token::Bracket,
+    #[doc(hidden)]
+    pub content: ParseBuffer<'a>,
+}
+
+// Not public API.
+#[cfg(any(feature = "full", feature = "derive"))]
+#[doc(hidden)]
+pub struct Group<'a> {
+    #[doc(hidden)]
+    pub token: token::Group,
+    #[doc(hidden)]
+    pub content: ParseBuffer<'a>,
+}
+
+// Not public API.
+#[doc(hidden)]
+pub fn parse_parens<'a>(input: &ParseBuffer<'a>) -> Result<Parens<'a>> {
+    parse_delimited(input, Delimiter::Parenthesis).map(|(span, content)| Parens {
+        token: token::Paren(span),
+        content,
+    })
+}
+
+// Not public API.
+#[doc(hidden)]
+pub fn parse_braces<'a>(input: &ParseBuffer<'a>) -> Result<Braces<'a>> {
+    parse_delimited(input, Delimiter::Brace).map(|(span, content)| Braces {
+        token: token::Brace(span),
+        content,
+    })
+}
+
+// Not public API.
+#[doc(hidden)]
+pub fn parse_brackets<'a>(input: &ParseBuffer<'a>) -> Result<Brackets<'a>> {
+    parse_delimited(input, Delimiter::Bracket).map(|(span, content)| Brackets {
+        token: token::Bracket(span),
+        content,
+    })
+}
+
+#[cfg(any(feature = "full", feature = "derive"))]
+pub(crate) fn parse_group<'a>(input: &ParseBuffer<'a>) -> Result<Group<'a>> {
+    parse_delimited(input, Delimiter::None).map(|(span, content)| Group {
+        token: token::Group(span.join()),
+        content,
+    })
+}
+
+fn parse_delimited<'a>(
+    input: &ParseBuffer<'a>,
+    delimiter: Delimiter,
+) -> Result<(DelimSpan, ParseBuffer<'a>)> {
+    input.step(|cursor| {
+        if let Some((content, span, rest)) = cursor.group(delimiter) {
+            let scope = span.close();
+            let nested = crate::parse::advance_step_cursor(cursor, content);
+            let unexpected = crate::parse::get_unexpected(input);
+            let content = crate::parse::new_parse_buffer(scope, nested, unexpected);
+            Ok(((span, content), rest))
+        } else {
+            let message = match delimiter {
+                Delimiter::Parenthesis => "expected parentheses",
+                Delimiter::Brace => "expected curly braces",
+                Delimiter::Bracket => "expected square brackets",
+                Delimiter::None => "expected invisible group",
+            };
+            Err(cursor.error(message))
+        }
+    })
+}
+
+/// Parse a set of parentheses and expose their content to subsequent parsers.
+///
+/// # Example
+///
+/// ```
+/// # use quote::quote;
+/// #
+/// use syn::{parenthesized, token, Ident, Result, Token, Type};
+/// use syn::parse::{Parse, ParseStream};
+/// use syn::punctuated::Punctuated;
+///
+/// // Parse a simplified tuple struct syntax like:
+/// //
+/// //     struct S(A, B);
+/// struct TupleStruct {
+///     struct_token: Token![struct],
+///     ident: Ident,
+///     paren_token: token::Paren,
+///     fields: Punctuated<Type, Token![,]>,
+///     semi_token: Token![;],
+/// }
+///
+/// impl Parse for TupleStruct {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         let content;
+///         Ok(TupleStruct {
+///             struct_token: input.parse()?,
+///             ident: input.parse()?,
+///             paren_token: parenthesized!(content in input),
+///             fields: content.parse_terminated(Type::parse, Token![,])?,
+///             semi_token: input.parse()?,
+///         })
+///     }
+/// }
+/// #
+/// # fn main() {
+/// #     let input = quote! {
+/// #         struct S(A, B);
+/// #     };
+/// #     syn::parse2::<TupleStruct>(input).unwrap();
+/// # }
+/// ```
+#[macro_export]
+#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+macro_rules! parenthesized {
+    ($content:ident in $cursor:expr) => {
+        match $crate::__private::parse_parens(&$cursor) {
+            $crate::__private::Ok(parens) => {
+                $content = parens.content;
+                parens.token
+            }
+            $crate::__private::Err(error) => {
+                return $crate::__private::Err(error);
+            }
+        }
+    };
+}
+
+/// Parse a set of curly braces and expose their content to subsequent parsers.
+///
+/// # Example
+///
+/// ```
+/// # use quote::quote;
+/// #
+/// use syn::{braced, token, Ident, Result, Token, Type};
+/// use syn::parse::{Parse, ParseStream};
+/// use syn::punctuated::Punctuated;
+///
+/// // Parse a simplified struct syntax like:
+/// //
+/// //     struct S {
+/// //         a: A,
+/// //         b: B,
+/// //     }
+/// struct Struct {
+///     struct_token: Token![struct],
+///     ident: Ident,
+///     brace_token: token::Brace,
+///     fields: Punctuated<Field, Token![,]>,
+/// }
+///
+/// struct Field {
+///     name: Ident,
+///     colon_token: Token![:],
+///     ty: Type,
+/// }
+///
+/// impl Parse for Struct {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         let content;
+///         Ok(Struct {
+///             struct_token: input.parse()?,
+///             ident: input.parse()?,
+///             brace_token: braced!(content in input),
+///             fields: content.parse_terminated(Field::parse, Token![,])?,
+///         })
+///     }
+/// }
+///
+/// impl Parse for Field {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         Ok(Field {
+///             name: input.parse()?,
+///             colon_token: input.parse()?,
+///             ty: input.parse()?,
+///         })
+///     }
+/// }
+/// #
+/// # fn main() {
+/// #     let input = quote! {
+/// #         struct S {
+/// #             a: A,
+/// #             b: B,
+/// #         }
+/// #     };
+/// #     syn::parse2::<Struct>(input).unwrap();
+/// # }
+/// ```
+#[macro_export]
+#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+macro_rules! braced {
+    ($content:ident in $cursor:expr) => {
+        match $crate::__private::parse_braces(&$cursor) {
+            $crate::__private::Ok(braces) => {
+                $content = braces.content;
+                braces.token
+            }
+            $crate::__private::Err(error) => {
+                return $crate::__private::Err(error);
+            }
+        }
+    };
+}
+
+/// Parse a set of square brackets and expose their content to subsequent
+/// parsers.
+///
+/// # Example
+///
+/// ```
+/// # use quote::quote;
+/// #
+/// use proc_macro2::TokenStream;
+/// use syn::{bracketed, token, Result, Token};
+/// use syn::parse::{Parse, ParseStream};
+///
+/// // Parse an outer attribute like:
+/// //
+/// //     #[repr(C, packed)]
+/// struct OuterAttribute {
+///     pound_token: Token![#],
+///     bracket_token: token::Bracket,
+///     content: TokenStream,
+/// }
+///
+/// impl Parse for OuterAttribute {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         let content;
+///         Ok(OuterAttribute {
+///             pound_token: input.parse()?,
+///             bracket_token: bracketed!(content in input),
+///             content: content.parse()?,
+///         })
+///     }
+/// }
+/// #
+/// # fn main() {
+/// #     let input = quote! {
+/// #         #[repr(C, packed)]
+/// #     };
+/// #     syn::parse2::<OuterAttribute>(input).unwrap();
+/// # }
+/// ```
+#[macro_export]
+#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+macro_rules! bracketed {
+    ($content:ident in $cursor:expr) => {
+        match $crate::__private::parse_brackets(&$cursor) {
+            $crate::__private::Ok(brackets) => {
+                $content = brackets.content;
+                brackets.token
+            }
+            $crate::__private::Err(error) => {
+                return $crate::__private::Err(error);
+            }
+        }
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/ident.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/ident.rs
--- 43.0.0-1/rust-vendor/syn/src/ident.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/ident.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,108 @@
+#[cfg(feature = "parsing")]
+use crate::lookahead;
+
+pub use proc_macro2::Ident;
+
+#[cfg(feature = "parsing")]
+pub_if_not_doc! {
+    #[doc(hidden)]
+    #[allow(non_snake_case)]
+    pub fn Ident(marker: lookahead::TokenMarker) -> Ident {
+        match marker {}
+    }
+}
+
+macro_rules! ident_from_token {
+    ($token:ident) => {
+        impl From<Token![$token]> for Ident {
+            fn from(token: Token![$token]) -> Ident {
+                Ident::new(stringify!($token), token.span)
+            }
+        }
+    };
+}
+
+ident_from_token!(self);
+ident_from_token!(Self);
+ident_from_token!(super);
+ident_from_token!(crate);
+ident_from_token!(extern);
+
+impl From<Token![_]> for Ident {
+    fn from(token: Token![_]) -> Ident {
+        Ident::new("_", token.span)
+    }
+}
+
+pub(crate) fn xid_ok(symbol: &str) -> bool {
+    let mut chars = symbol.chars();
+    let first = chars.next().unwrap();
+    if !(first == '_' || unicode_ident::is_xid_start(first)) {
+        return false;
+    }
+    for ch in chars {
+        if !unicode_ident::is_xid_continue(ch) {
+            return false;
+        }
+    }
+    true
+}
+
+#[cfg(feature = "parsing")]
+mod parsing {
+    use crate::buffer::Cursor;
+    use crate::error::Result;
+    use crate::parse::{Parse, ParseStream};
+    use crate::token::Token;
+    use proc_macro2::Ident;
+
+    fn accept_as_ident(ident: &Ident) -> bool {
+        match ident.to_string().as_str() {
+            "_" |
+            // Based on https://doc.rust-lang.org/1.65.0/reference/keywords.html
+            "abstract" | "as" | "async" | "await" | "become" | "box" | "break" |
+            "const" | "continue" | "crate" | "do" | "dyn" | "else" | "enum" |
+            "extern" | "false" | "final" | "fn" | "for" | "if" | "impl" | "in" |
+            "let" | "loop" | "macro" | "match" | "mod" | "move" | "mut" |
+            "override" | "priv" | "pub" | "ref" | "return" | "Self" | "self" |
+            "static" | "struct" | "super" | "trait" | "true" | "try" | "type" |
+            "typeof" | "unsafe" | "unsized" | "use" | "virtual" | "where" |
+            "while" | "yield" => false,
+            _ => true,
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Ident {
+        fn parse(input: ParseStream) -> Result<Self> {
+            input.step(|cursor| {
+                if let Some((ident, rest)) = cursor.ident() {
+                    if accept_as_ident(&ident) {
+                        Ok((ident, rest))
+                    } else {
+                        Err(cursor.error(format_args!(
+                            "expected identifier, found keyword `{}`",
+                            ident,
+                        )))
+                    }
+                } else {
+                    Err(cursor.error("expected identifier"))
+                }
+            })
+        }
+    }
+
+    impl Token for Ident {
+        fn peek(cursor: Cursor) -> bool {
+            if let Some((ident, _rest)) = cursor.ident() {
+                accept_as_ident(&ident)
+            } else {
+                false
+            }
+        }
+
+        fn display() -> &'static str {
+            "identifier"
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/item.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/item.rs
--- 43.0.0-1/rust-vendor/syn/src/item.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/item.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,3441 @@
+use crate::attr::Attribute;
+use crate::data::{Fields, FieldsNamed, Variant};
+use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
+use crate::expr::Expr;
+use crate::generics::{Generics, TypeParamBound};
+use crate::ident::Ident;
+use crate::lifetime::Lifetime;
+use crate::mac::Macro;
+use crate::pat::{Pat, PatType};
+use crate::path::Path;
+use crate::punctuated::Punctuated;
+use crate::restriction::Visibility;
+use crate::stmt::Block;
+use crate::token;
+use crate::ty::{Abi, ReturnType, Type};
+use proc_macro2::TokenStream;
+#[cfg(feature = "parsing")]
+use std::mem;
+
+ast_enum_of_structs! {
+    /// Things that can appear directly inside of a module or scope.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    #[non_exhaustive]
+    pub enum Item {
+        /// A constant item: `const MAX: u16 = 65535`.
+        Const(ItemConst),
+
+        /// An enum definition: `enum Foo<A, B> { A(A), B(B) }`.
+        Enum(ItemEnum),
+
+        /// An `extern crate` item: `extern crate serde`.
+        ExternCrate(ItemExternCrate),
+
+        /// A free-standing function: `fn process(n: usize) -> Result<()> { ...
+        /// }`.
+        Fn(ItemFn),
+
+        /// A block of foreign items: `extern "C" { ... }`.
+        ForeignMod(ItemForeignMod),
+
+        /// An impl block providing trait or associated items: `impl<A> Trait
+        /// for Data<A> { ... }`.
+        Impl(ItemImpl),
+
+        /// A macro invocation, which includes `macro_rules!` definitions.
+        Macro(ItemMacro),
+
+        /// A module or module declaration: `mod m` or `mod m { ... }`.
+        Mod(ItemMod),
+
+        /// A static item: `static BIKE: Shed = Shed(42)`.
+        Static(ItemStatic),
+
+        /// A struct definition: `struct Foo<A> { x: A }`.
+        Struct(ItemStruct),
+
+        /// A trait definition: `pub trait Iterator { ... }`.
+        Trait(ItemTrait),
+
+        /// A trait alias: `pub trait SharableIterator = Iterator + Sync`.
+        TraitAlias(ItemTraitAlias),
+
+        /// A type alias: `type Result<T> = std::result::Result<T, MyError>`.
+        Type(ItemType),
+
+        /// A union definition: `union Foo<A, B> { x: A, y: B }`.
+        Union(ItemUnion),
+
+        /// A use declaration: `use std::collections::HashMap`.
+        Use(ItemUse),
+
+        /// Tokens forming an item not interpreted by Syn.
+        Verbatim(TokenStream),
+
+        // For testing exhaustiveness in downstream code, use the following idiom:
+        //
+        //     match item {
+        //         #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
+        //
+        //         Item::Const(item) => {...}
+        //         Item::Enum(item) => {...}
+        //         ...
+        //         Item::Verbatim(item) => {...}
+        //
+        //         _ => { /* some sane fallback */ }
+        //     }
+        //
+        // This way we fail your tests but don't break your library when adding
+        // a variant. You will be notified by a test failure when a variant is
+        // added, so that you can add code to handle it, but your library will
+        // continue to compile and work for downstream users in the interim.
+    }
+}
+
+ast_struct! {
+    /// A constant item: `const MAX: u16 = 65535`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ItemConst {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub const_token: Token![const],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub colon_token: Token![:],
+        pub ty: Box<Type>,
+        pub eq_token: Token![=],
+        pub expr: Box<Expr>,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// An enum definition: `enum Foo<A, B> { A(A), B(B) }`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ItemEnum {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub enum_token: Token![enum],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub brace_token: token::Brace,
+        pub variants: Punctuated<Variant, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// An `extern crate` item: `extern crate serde`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ItemExternCrate {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub extern_token: Token![extern],
+        pub crate_token: Token![crate],
+        pub ident: Ident,
+        pub rename: Option<(Token![as], Ident)>,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// A free-standing function: `fn process(n: usize) -> Result<()> { ... }`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ItemFn {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub sig: Signature,
+        pub block: Box<Block>,
+    }
+}
+
+ast_struct! {
+    /// A block of foreign items: `extern "C" { ... }`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ItemForeignMod {
+        pub attrs: Vec<Attribute>,
+        pub unsafety: Option<Token![unsafe]>,
+        pub abi: Abi,
+        pub brace_token: token::Brace,
+        pub items: Vec<ForeignItem>,
+    }
+}
+
+ast_struct! {
+    /// An impl block providing trait or associated items: `impl<A> Trait
+    /// for Data<A> { ... }`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ItemImpl {
+        pub attrs: Vec<Attribute>,
+        pub defaultness: Option<Token![default]>,
+        pub unsafety: Option<Token![unsafe]>,
+        pub impl_token: Token![impl],
+        pub generics: Generics,
+        /// Trait this impl implements.
+        pub trait_: Option<(Option<Token![!]>, Path, Token![for])>,
+        /// The Self type of the impl.
+        pub self_ty: Box<Type>,
+        pub brace_token: token::Brace,
+        pub items: Vec<ImplItem>,
+    }
+}
+
+ast_struct! {
+    /// A macro invocation, which includes `macro_rules!` definitions.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ItemMacro {
+        pub attrs: Vec<Attribute>,
+        /// The `example` in `macro_rules! example { ... }`.
+        pub ident: Option<Ident>,
+        pub mac: Macro,
+        pub semi_token: Option<Token![;]>,
+    }
+}
+
+ast_struct! {
+    /// A module or module declaration: `mod m` or `mod m { ... }`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ItemMod {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub unsafety: Option<Token![unsafe]>,
+        pub mod_token: Token![mod],
+        pub ident: Ident,
+        pub content: Option<(token::Brace, Vec<Item>)>,
+        pub semi: Option<Token![;]>,
+    }
+}
+
+ast_struct! {
+    /// A static item: `static BIKE: Shed = Shed(42)`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ItemStatic {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub static_token: Token![static],
+        pub mutability: StaticMutability,
+        pub ident: Ident,
+        pub colon_token: Token![:],
+        pub ty: Box<Type>,
+        pub eq_token: Token![=],
+        pub expr: Box<Expr>,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// A struct definition: `struct Foo<A> { x: A }`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ItemStruct {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub struct_token: Token![struct],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub fields: Fields,
+        pub semi_token: Option<Token![;]>,
+    }
+}
+
+ast_struct! {
+    /// A trait definition: `pub trait Iterator { ... }`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ItemTrait {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub unsafety: Option<Token![unsafe]>,
+        pub auto_token: Option<Token![auto]>,
+        pub restriction: Option<ImplRestriction>,
+        pub trait_token: Token![trait],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub colon_token: Option<Token![:]>,
+        pub supertraits: Punctuated<TypeParamBound, Token![+]>,
+        pub brace_token: token::Brace,
+        pub items: Vec<TraitItem>,
+    }
+}
+
+ast_struct! {
+    /// A trait alias: `pub trait SharableIterator = Iterator + Sync`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ItemTraitAlias {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub trait_token: Token![trait],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub eq_token: Token![=],
+        pub bounds: Punctuated<TypeParamBound, Token![+]>,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// A type alias: `type Result<T> = std::result::Result<T, MyError>`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ItemType {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub type_token: Token![type],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub eq_token: Token![=],
+        pub ty: Box<Type>,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// A union definition: `union Foo<A, B> { x: A, y: B }`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ItemUnion {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub union_token: Token![union],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub fields: FieldsNamed,
+    }
+}
+
+ast_struct! {
+    /// A use declaration: `use std::collections::HashMap`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ItemUse {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub use_token: Token![use],
+        pub leading_colon: Option<Token![::]>,
+        pub tree: UseTree,
+        pub semi_token: Token![;],
+    }
+}
+
+impl Item {
+    #[cfg(feature = "parsing")]
+    pub(crate) fn replace_attrs(&mut self, new: Vec<Attribute>) -> Vec<Attribute> {
+        match self {
+            Item::Const(ItemConst { attrs, .. })
+            | Item::Enum(ItemEnum { attrs, .. })
+            | Item::ExternCrate(ItemExternCrate { attrs, .. })
+            | Item::Fn(ItemFn { attrs, .. })
+            | Item::ForeignMod(ItemForeignMod { attrs, .. })
+            | Item::Impl(ItemImpl { attrs, .. })
+            | Item::Macro(ItemMacro { attrs, .. })
+            | Item::Mod(ItemMod { attrs, .. })
+            | Item::Static(ItemStatic { attrs, .. })
+            | Item::Struct(ItemStruct { attrs, .. })
+            | Item::Trait(ItemTrait { attrs, .. })
+            | Item::TraitAlias(ItemTraitAlias { attrs, .. })
+            | Item::Type(ItemType { attrs, .. })
+            | Item::Union(ItemUnion { attrs, .. })
+            | Item::Use(ItemUse { attrs, .. }) => mem::replace(attrs, new),
+            Item::Verbatim(_) => Vec::new(),
+        }
+    }
+}
+
+impl From<DeriveInput> for Item {
+    fn from(input: DeriveInput) -> Item {
+        match input.data {
+            Data::Struct(data) => Item::Struct(ItemStruct {
+                attrs: input.attrs,
+                vis: input.vis,
+                struct_token: data.struct_token,
+                ident: input.ident,
+                generics: input.generics,
+                fields: data.fields,
+                semi_token: data.semi_token,
+            }),
+            Data::Enum(data) => Item::Enum(ItemEnum {
+                attrs: input.attrs,
+                vis: input.vis,
+                enum_token: data.enum_token,
+                ident: input.ident,
+                generics: input.generics,
+                brace_token: data.brace_token,
+                variants: data.variants,
+            }),
+            Data::Union(data) => Item::Union(ItemUnion {
+                attrs: input.attrs,
+                vis: input.vis,
+                union_token: data.union_token,
+                ident: input.ident,
+                generics: input.generics,
+                fields: data.fields,
+            }),
+        }
+    }
+}
+
+impl From<ItemStruct> for DeriveInput {
+    fn from(input: ItemStruct) -> DeriveInput {
+        DeriveInput {
+            attrs: input.attrs,
+            vis: input.vis,
+            ident: input.ident,
+            generics: input.generics,
+            data: Data::Struct(DataStruct {
+                struct_token: input.struct_token,
+                fields: input.fields,
+                semi_token: input.semi_token,
+            }),
+        }
+    }
+}
+
+impl From<ItemEnum> for DeriveInput {
+    fn from(input: ItemEnum) -> DeriveInput {
+        DeriveInput {
+            attrs: input.attrs,
+            vis: input.vis,
+            ident: input.ident,
+            generics: input.generics,
+            data: Data::Enum(DataEnum {
+                enum_token: input.enum_token,
+                brace_token: input.brace_token,
+                variants: input.variants,
+            }),
+        }
+    }
+}
+
+impl From<ItemUnion> for DeriveInput {
+    fn from(input: ItemUnion) -> DeriveInput {
+        DeriveInput {
+            attrs: input.attrs,
+            vis: input.vis,
+            ident: input.ident,
+            generics: input.generics,
+            data: Data::Union(DataUnion {
+                union_token: input.union_token,
+                fields: input.fields,
+            }),
+        }
+    }
+}
+
+ast_enum_of_structs! {
+    /// A suffix of an import tree in a `use` item: `Type as Renamed` or `*`.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub enum UseTree {
+        /// A path prefix of imports in a `use` item: `std::...`.
+        Path(UsePath),
+
+        /// An identifier imported by a `use` item: `HashMap`.
+        Name(UseName),
+
+        /// An renamed identifier imported by a `use` item: `HashMap as Map`.
+        Rename(UseRename),
+
+        /// A glob import in a `use` item: `*`.
+        Glob(UseGlob),
+
+        /// A braced group of imports in a `use` item: `{A, B, C}`.
+        Group(UseGroup),
+    }
+}
+
+ast_struct! {
+    /// A path prefix of imports in a `use` item: `std::...`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct UsePath {
+        pub ident: Ident,
+        pub colon2_token: Token![::],
+        pub tree: Box<UseTree>,
+    }
+}
+
+ast_struct! {
+    /// An identifier imported by a `use` item: `HashMap`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct UseName {
+        pub ident: Ident,
+    }
+}
+
+ast_struct! {
+    /// An renamed identifier imported by a `use` item: `HashMap as Map`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct UseRename {
+        pub ident: Ident,
+        pub as_token: Token![as],
+        pub rename: Ident,
+    }
+}
+
+ast_struct! {
+    /// A glob import in a `use` item: `*`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct UseGlob {
+        pub star_token: Token![*],
+    }
+}
+
+ast_struct! {
+    /// A braced group of imports in a `use` item: `{A, B, C}`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct UseGroup {
+        pub brace_token: token::Brace,
+        pub items: Punctuated<UseTree, Token![,]>,
+    }
+}
+
+ast_enum_of_structs! {
+    /// An item within an `extern` block.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    #[non_exhaustive]
+    pub enum ForeignItem {
+        /// A foreign function in an `extern` block.
+        Fn(ForeignItemFn),
+
+        /// A foreign static item in an `extern` block: `static ext: u8`.
+        Static(ForeignItemStatic),
+
+        /// A foreign type in an `extern` block: `type void`.
+        Type(ForeignItemType),
+
+        /// A macro invocation within an extern block.
+        Macro(ForeignItemMacro),
+
+        /// Tokens in an `extern` block not interpreted by Syn.
+        Verbatim(TokenStream),
+
+        // For testing exhaustiveness in downstream code, use the following idiom:
+        //
+        //     match item {
+        //         #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
+        //
+        //         ForeignItem::Fn(item) => {...}
+        //         ForeignItem::Static(item) => {...}
+        //         ...
+        //         ForeignItem::Verbatim(item) => {...}
+        //
+        //         _ => { /* some sane fallback */ }
+        //     }
+        //
+        // This way we fail your tests but don't break your library when adding
+        // a variant. You will be notified by a test failure when a variant is
+        // added, so that you can add code to handle it, but your library will
+        // continue to compile and work for downstream users in the interim.
+    }
+}
+
+ast_struct! {
+    /// A foreign function in an `extern` block.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ForeignItemFn {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub sig: Signature,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// A foreign static item in an `extern` block: `static ext: u8`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ForeignItemStatic {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub static_token: Token![static],
+        pub mutability: StaticMutability,
+        pub ident: Ident,
+        pub colon_token: Token![:],
+        pub ty: Box<Type>,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// A foreign type in an `extern` block: `type void`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ForeignItemType {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub type_token: Token![type],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// A macro invocation within an extern block.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ForeignItemMacro {
+        pub attrs: Vec<Attribute>,
+        pub mac: Macro,
+        pub semi_token: Option<Token![;]>,
+    }
+}
+
+ast_enum_of_structs! {
+    /// An item declaration within the definition of a trait.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    #[non_exhaustive]
+    pub enum TraitItem {
+        /// An associated constant within the definition of a trait.
+        Const(TraitItemConst),
+
+        /// An associated function within the definition of a trait.
+        Fn(TraitItemFn),
+
+        /// An associated type within the definition of a trait.
+        Type(TraitItemType),
+
+        /// A macro invocation within the definition of a trait.
+        Macro(TraitItemMacro),
+
+        /// Tokens within the definition of a trait not interpreted by Syn.
+        Verbatim(TokenStream),
+
+        // For testing exhaustiveness in downstream code, use the following idiom:
+        //
+        //     match item {
+        //         #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
+        //
+        //         TraitItem::Const(item) => {...}
+        //         TraitItem::Fn(item) => {...}
+        //         ...
+        //         TraitItem::Verbatim(item) => {...}
+        //
+        //         _ => { /* some sane fallback */ }
+        //     }
+        //
+        // This way we fail your tests but don't break your library when adding
+        // a variant. You will be notified by a test failure when a variant is
+        // added, so that you can add code to handle it, but your library will
+        // continue to compile and work for downstream users in the interim.
+    }
+}
+
+ast_struct! {
+    /// An associated constant within the definition of a trait.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct TraitItemConst {
+        pub attrs: Vec<Attribute>,
+        pub const_token: Token![const],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub colon_token: Token![:],
+        pub ty: Type,
+        pub default: Option<(Token![=], Expr)>,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// An associated function within the definition of a trait.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct TraitItemFn {
+        pub attrs: Vec<Attribute>,
+        pub sig: Signature,
+        pub default: Option<Block>,
+        pub semi_token: Option<Token![;]>,
+    }
+}
+
+ast_struct! {
+    /// An associated type within the definition of a trait.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct TraitItemType {
+        pub attrs: Vec<Attribute>,
+        pub type_token: Token![type],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub colon_token: Option<Token![:]>,
+        pub bounds: Punctuated<TypeParamBound, Token![+]>,
+        pub default: Option<(Token![=], Type)>,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// A macro invocation within the definition of a trait.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct TraitItemMacro {
+        pub attrs: Vec<Attribute>,
+        pub mac: Macro,
+        pub semi_token: Option<Token![;]>,
+    }
+}
+
+ast_enum_of_structs! {
+    /// An item within an impl block.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    #[non_exhaustive]
+    pub enum ImplItem {
+        /// An associated constant within an impl block.
+        Const(ImplItemConst),
+
+        /// An associated function within an impl block.
+        Fn(ImplItemFn),
+
+        /// An associated type within an impl block.
+        Type(ImplItemType),
+
+        /// A macro invocation within an impl block.
+        Macro(ImplItemMacro),
+
+        /// Tokens within an impl block not interpreted by Syn.
+        Verbatim(TokenStream),
+
+        // For testing exhaustiveness in downstream code, use the following idiom:
+        //
+        //     match item {
+        //         #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
+        //
+        //         ImplItem::Const(item) => {...}
+        //         ImplItem::Fn(item) => {...}
+        //         ...
+        //         ImplItem::Verbatim(item) => {...}
+        //
+        //         _ => { /* some sane fallback */ }
+        //     }
+        //
+        // This way we fail your tests but don't break your library when adding
+        // a variant. You will be notified by a test failure when a variant is
+        // added, so that you can add code to handle it, but your library will
+        // continue to compile and work for downstream users in the interim.
+    }
+}
+
+ast_struct! {
+    /// An associated constant within an impl block.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ImplItemConst {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub defaultness: Option<Token![default]>,
+        pub const_token: Token![const],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub colon_token: Token![:],
+        pub ty: Type,
+        pub eq_token: Token![=],
+        pub expr: Expr,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// An associated function within an impl block.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ImplItemFn {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub defaultness: Option<Token![default]>,
+        pub sig: Signature,
+        pub block: Block,
+    }
+}
+
+ast_struct! {
+    /// An associated type within an impl block.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ImplItemType {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub defaultness: Option<Token![default]>,
+        pub type_token: Token![type],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub eq_token: Token![=],
+        pub ty: Type,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// A macro invocation within an impl block.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct ImplItemMacro {
+        pub attrs: Vec<Attribute>,
+        pub mac: Macro,
+        pub semi_token: Option<Token![;]>,
+    }
+}
+
+ast_struct! {
+    /// A function signature in a trait or implementation: `unsafe fn
+    /// initialize(&self)`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct Signature {
+        pub constness: Option<Token![const]>,
+        pub asyncness: Option<Token![async]>,
+        pub unsafety: Option<Token![unsafe]>,
+        pub abi: Option<Abi>,
+        pub fn_token: Token![fn],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub paren_token: token::Paren,
+        pub inputs: Punctuated<FnArg, Token![,]>,
+        pub variadic: Option<Variadic>,
+        pub output: ReturnType,
+    }
+}
+
+impl Signature {
+    /// A method's `self` receiver, such as `&self` or `self: Box<Self>`.
+    pub fn receiver(&self) -> Option<&Receiver> {
+        let arg = self.inputs.first()?;
+        match arg {
+            FnArg::Receiver(receiver) => Some(receiver),
+            FnArg::Typed(_) => None,
+        }
+    }
+}
+
+ast_enum_of_structs! {
+    /// An argument in a function signature: the `n: usize` in `fn f(n: usize)`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub enum FnArg {
+        /// The `self` argument of an associated method.
+        Receiver(Receiver),
+
+        /// A function argument accepted by pattern and type.
+        Typed(PatType),
+    }
+}
+
+ast_struct! {
+    /// The `self` argument of an associated method.
+    ///
+    /// If `colon_token` is present, the receiver is written with an explicit
+    /// type such as `self: Box<Self>`. If `colon_token` is absent, the receiver
+    /// is written in shorthand such as `self` or `&self` or `&mut self`. In the
+    /// shorthand case, the type in `ty` is reconstructed as one of `Self`,
+    /// `&Self`, or `&mut Self`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct Receiver {
+        pub attrs: Vec<Attribute>,
+        pub reference: Option<(Token![&], Option<Lifetime>)>,
+        pub mutability: Option<Token![mut]>,
+        pub self_token: Token![self],
+        pub colon_token: Option<Token![:]>,
+        pub ty: Box<Type>,
+    }
+}
+
+impl Receiver {
+    pub fn lifetime(&self) -> Option<&Lifetime> {
+        self.reference.as_ref()?.1.as_ref()
+    }
+}
+
+ast_struct! {
+    /// The variadic argument of a foreign function.
+    ///
+    /// ```rust
+    /// # struct c_char;
+    /// # struct c_int;
+    /// #
+    /// extern "C" {
+    ///     fn printf(format: *const c_char, ...) -> c_int;
+    ///     //                               ^^^
+    /// }
+    /// ```
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct Variadic {
+        pub attrs: Vec<Attribute>,
+        pub pat: Option<(Box<Pat>, Token![:])>,
+        pub dots: Token![...],
+        pub comma: Option<Token![,]>,
+    }
+}
+
+ast_enum! {
+    /// The mutability of an `Item::Static` or `ForeignItem::Static`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    #[non_exhaustive]
+    pub enum StaticMutability {
+        Mut(Token![mut]),
+        None,
+    }
+}
+
+ast_enum! {
+    /// Unused, but reserved for RFC 3323 restrictions.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    #[non_exhaustive]
+    pub enum ImplRestriction {}
+
+
+    // TODO: https://rust-lang.github.io/rfcs/3323-restrictions.html
+    //
+    // pub struct ImplRestriction {
+    //     pub impl_token: Token![impl],
+    //     pub paren_token: token::Paren,
+    //     pub in_token: Option<Token![in]>,
+    //     pub path: Box<Path>,
+    // }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::attr::{self, Attribute};
+    use crate::derive;
+    use crate::error::{Error, Result};
+    use crate::expr::Expr;
+    use crate::ext::IdentExt as _;
+    use crate::generics::{Generics, TypeParamBound};
+    use crate::ident::Ident;
+    use crate::item::{
+        FnArg, ForeignItem, ForeignItemFn, ForeignItemMacro, ForeignItemStatic, ForeignItemType,
+        ImplItem, ImplItemConst, ImplItemFn, ImplItemMacro, ImplItemType, Item, ItemConst,
+        ItemEnum, ItemExternCrate, ItemFn, ItemForeignMod, ItemImpl, ItemMacro, ItemMod,
+        ItemStatic, ItemStruct, ItemTrait, ItemTraitAlias, ItemType, ItemUnion, ItemUse, Receiver,
+        Signature, StaticMutability, TraitItem, TraitItemConst, TraitItemFn, TraitItemMacro,
+        TraitItemType, UseGlob, UseGroup, UseName, UsePath, UseRename, UseTree, Variadic,
+    };
+    use crate::lifetime::Lifetime;
+    use crate::lit::LitStr;
+    use crate::mac::{self, Macro};
+    use crate::parse::discouraged::Speculative as _;
+    use crate::parse::{Parse, ParseBuffer, ParseStream};
+    use crate::pat::{Pat, PatType, PatWild};
+    use crate::path::Path;
+    use crate::punctuated::Punctuated;
+    use crate::restriction::Visibility;
+    use crate::stmt::Block;
+    use crate::token;
+    use crate::ty::{Abi, ReturnType, Type, TypePath, TypeReference};
+    use crate::verbatim;
+    use proc_macro2::TokenStream;
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Item {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let begin = input.fork();
+            let attrs = input.call(Attribute::parse_outer)?;
+            parse_rest_of_item(begin, attrs, input)
+        }
+    }
+
+    pub(crate) fn parse_rest_of_item(
+        begin: ParseBuffer,
+        mut attrs: Vec<Attribute>,
+        input: ParseStream,
+    ) -> Result<Item> {
+        let ahead = input.fork();
+        let vis: Visibility = ahead.parse()?;
+
+        let lookahead = ahead.lookahead1();
+        let mut item = if lookahead.peek(Token![fn]) || peek_signature(&ahead) {
+            let vis: Visibility = input.parse()?;
+            let sig: Signature = input.parse()?;
+            if input.peek(Token![;]) {
+                input.parse::<Token![;]>()?;
+                Ok(Item::Verbatim(verbatim::between(&begin, input)))
+            } else {
+                parse_rest_of_fn(input, Vec::new(), vis, sig).map(Item::Fn)
+            }
+        } else if lookahead.peek(Token![extern]) {
+            ahead.parse::<Token![extern]>()?;
+            let lookahead = ahead.lookahead1();
+            if lookahead.peek(Token![crate]) {
+                input.parse().map(Item::ExternCrate)
+            } else if lookahead.peek(token::Brace) {
+                input.parse().map(Item::ForeignMod)
+            } else if lookahead.peek(LitStr) {
+                ahead.parse::<LitStr>()?;
+                let lookahead = ahead.lookahead1();
+                if lookahead.peek(token::Brace) {
+                    input.parse().map(Item::ForeignMod)
+                } else {
+                    Err(lookahead.error())
+                }
+            } else {
+                Err(lookahead.error())
+            }
+        } else if lookahead.peek(Token![use]) {
+            let allow_crate_root_in_path = true;
+            match parse_item_use(input, allow_crate_root_in_path)? {
+                Some(item_use) => Ok(Item::Use(item_use)),
+                None => Ok(Item::Verbatim(verbatim::between(&begin, input))),
+            }
+        } else if lookahead.peek(Token![static]) {
+            let vis = input.parse()?;
+            let static_token = input.parse()?;
+            let mutability = input.parse()?;
+            let ident = input.parse()?;
+            if input.peek(Token![=]) {
+                input.parse::<Token![=]>()?;
+                input.parse::<Expr>()?;
+                input.parse::<Token![;]>()?;
+                Ok(Item::Verbatim(verbatim::between(&begin, input)))
+            } else {
+                let colon_token = input.parse()?;
+                let ty = input.parse()?;
+                if input.peek(Token![;]) {
+                    input.parse::<Token![;]>()?;
+                    Ok(Item::Verbatim(verbatim::between(&begin, input)))
+                } else {
+                    Ok(Item::Static(ItemStatic {
+                        attrs: Vec::new(),
+                        vis,
+                        static_token,
+                        mutability,
+                        ident,
+                        colon_token,
+                        ty,
+                        eq_token: input.parse()?,
+                        expr: input.parse()?,
+                        semi_token: input.parse()?,
+                    }))
+                }
+            }
+        } else if lookahead.peek(Token![const]) {
+            let vis = input.parse()?;
+            let const_token: Token![const] = input.parse()?;
+            let lookahead = input.lookahead1();
+            let ident = if lookahead.peek(Ident) || lookahead.peek(Token![_]) {
+                input.call(Ident::parse_any)?
+            } else {
+                return Err(lookahead.error());
+            };
+            let mut generics: Generics = input.parse()?;
+            let colon_token = input.parse()?;
+            let ty = input.parse()?;
+            let value = if let Some(eq_token) = input.parse::<Option<Token![=]>>()? {
+                let expr: Expr = input.parse()?;
+                Some((eq_token, expr))
+            } else {
+                None
+            };
+            generics.where_clause = input.parse()?;
+            let semi_token: Token![;] = input.parse()?;
+            match value {
+                Some((eq_token, expr))
+                    if generics.lt_token.is_none() && generics.where_clause.is_none() =>
+                {
+                    Ok(Item::Const(ItemConst {
+                        attrs: Vec::new(),
+                        vis,
+                        const_token,
+                        ident,
+                        generics,
+                        colon_token,
+                        ty,
+                        eq_token,
+                        expr: Box::new(expr),
+                        semi_token,
+                    }))
+                }
+                _ => Ok(Item::Verbatim(verbatim::between(&begin, input))),
+            }
+        } else if lookahead.peek(Token![unsafe]) {
+            ahead.parse::<Token![unsafe]>()?;
+            let lookahead = ahead.lookahead1();
+            if lookahead.peek(Token![trait])
+                || lookahead.peek(Token![auto]) && ahead.peek2(Token![trait])
+            {
+                input.parse().map(Item::Trait)
+            } else if lookahead.peek(Token![impl]) {
+                let allow_verbatim_impl = true;
+                if let Some(item) = parse_impl(input, allow_verbatim_impl)? {
+                    Ok(Item::Impl(item))
+                } else {
+                    Ok(Item::Verbatim(verbatim::between(&begin, input)))
+                }
+            } else if lookahead.peek(Token![extern]) {
+                input.parse().map(Item::ForeignMod)
+            } else if lookahead.peek(Token![mod]) {
+                input.parse().map(Item::Mod)
+            } else {
+                Err(lookahead.error())
+            }
+        } else if lookahead.peek(Token![mod]) {
+            input.parse().map(Item::Mod)
+        } else if lookahead.peek(Token![type]) {
+            parse_item_type(begin, input)
+        } else if lookahead.peek(Token![struct]) {
+            input.parse().map(Item::Struct)
+        } else if lookahead.peek(Token![enum]) {
+            input.parse().map(Item::Enum)
+        } else if lookahead.peek(Token![union]) && ahead.peek2(Ident) {
+            input.parse().map(Item::Union)
+        } else if lookahead.peek(Token![trait]) {
+            input.call(parse_trait_or_trait_alias)
+        } else if lookahead.peek(Token![auto]) && ahead.peek2(Token![trait]) {
+            input.parse().map(Item::Trait)
+        } else if lookahead.peek(Token![impl])
+            || lookahead.peek(Token![default]) && !ahead.peek2(Token![!])
+        {
+            let allow_verbatim_impl = true;
+            if let Some(item) = parse_impl(input, allow_verbatim_impl)? {
+                Ok(Item::Impl(item))
+            } else {
+                Ok(Item::Verbatim(verbatim::between(&begin, input)))
+            }
+        } else if lookahead.peek(Token![macro]) {
+            input.advance_to(&ahead);
+            parse_macro2(begin, vis, input)
+        } else if vis.is_inherited()
+            && (lookahead.peek(Ident)
+                || lookahead.peek(Token![self])
+                || lookahead.peek(Token![super])
+                || lookahead.peek(Token![crate])
+                || lookahead.peek(Token![::]))
+        {
+            input.parse().map(Item::Macro)
+        } else {
+            Err(lookahead.error())
+        }?;
+
+        attrs.extend(item.replace_attrs(Vec::new()));
+        item.replace_attrs(attrs);
+        Ok(item)
+    }
+
+    struct FlexibleItemType {
+        vis: Visibility,
+        defaultness: Option<Token![default]>,
+        type_token: Token![type],
+        ident: Ident,
+        generics: Generics,
+        colon_token: Option<Token![:]>,
+        bounds: Punctuated<TypeParamBound, Token![+]>,
+        ty: Option<(Token![=], Type)>,
+        semi_token: Token![;],
+    }
+
+    enum TypeDefaultness {
+        Optional,
+        Disallowed,
+    }
+
+    enum WhereClauseLocation {
+        // type Ty<T> where T: 'static = T;
+        BeforeEq,
+        // type Ty<T> = T where T: 'static;
+        AfterEq,
+        // TODO: goes away once the migration period on rust-lang/rust#89122 is over
+        Both,
+    }
+
+    impl FlexibleItemType {
+        fn parse(
+            input: ParseStream,
+            allow_defaultness: TypeDefaultness,
+            where_clause_location: WhereClauseLocation,
+        ) -> Result<Self> {
+            let vis: Visibility = input.parse()?;
+            let defaultness: Option<Token![default]> = match allow_defaultness {
+                TypeDefaultness::Optional => input.parse()?,
+                TypeDefaultness::Disallowed => None,
+            };
+            let type_token: Token![type] = input.parse()?;
+            let ident: Ident = input.parse()?;
+            let mut generics: Generics = input.parse()?;
+            let (colon_token, bounds) = Self::parse_optional_bounds(input)?;
+
+            match where_clause_location {
+                WhereClauseLocation::BeforeEq | WhereClauseLocation::Both => {
+                    generics.where_clause = input.parse()?;
+                }
+                WhereClauseLocation::AfterEq => {}
+            }
+
+            let ty = Self::parse_optional_definition(input)?;
+
+            match where_clause_location {
+                WhereClauseLocation::AfterEq | WhereClauseLocation::Both
+                    if generics.where_clause.is_none() =>
+                {
+                    generics.where_clause = input.parse()?;
+                }
+                _ => {}
+            }
+
+            let semi_token: Token![;] = input.parse()?;
+
+            Ok(FlexibleItemType {
+                vis,
+                defaultness,
+                type_token,
+                ident,
+                generics,
+                colon_token,
+                bounds,
+                ty,
+                semi_token,
+            })
+        }
+
+        fn parse_optional_bounds(
+            input: ParseStream,
+        ) -> Result<(Option<Token![:]>, Punctuated<TypeParamBound, Token![+]>)> {
+            let colon_token: Option<Token![:]> = input.parse()?;
+
+            let mut bounds = Punctuated::new();
+            if colon_token.is_some() {
+                loop {
+                    if input.peek(Token![where]) || input.peek(Token![=]) || input.peek(Token![;]) {
+                        break;
+                    }
+                    bounds.push_value(input.parse::<TypeParamBound>()?);
+                    if input.peek(Token![where]) || input.peek(Token![=]) || input.peek(Token![;]) {
+                        break;
+                    }
+                    bounds.push_punct(input.parse::<Token![+]>()?);
+                }
+            }
+
+            Ok((colon_token, bounds))
+        }
+
+        fn parse_optional_definition(input: ParseStream) -> Result<Option<(Token![=], Type)>> {
+            let eq_token: Option<Token![=]> = input.parse()?;
+            if let Some(eq_token) = eq_token {
+                let definition: Type = input.parse()?;
+                Ok(Some((eq_token, definition)))
+            } else {
+                Ok(None)
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemMacro {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let path = input.call(Path::parse_mod_style)?;
+            let bang_token: Token![!] = input.parse()?;
+            let ident: Option<Ident> = if input.peek(Token![try]) {
+                input.call(Ident::parse_any).map(Some)
+            } else {
+                input.parse()
+            }?;
+            let (delimiter, tokens) = input.call(mac::parse_delimiter)?;
+            let semi_token: Option<Token![;]> = if !delimiter.is_brace() {
+                Some(input.parse()?)
+            } else {
+                None
+            };
+            Ok(ItemMacro {
+                attrs,
+                ident,
+                mac: Macro {
+                    path,
+                    bang_token,
+                    delimiter,
+                    tokens,
+                },
+                semi_token,
+            })
+        }
+    }
+
+    fn parse_macro2(begin: ParseBuffer, _vis: Visibility, input: ParseStream) -> Result<Item> {
+        input.parse::<Token![macro]>()?;
+        input.parse::<Ident>()?;
+
+        let mut lookahead = input.lookahead1();
+        if lookahead.peek(token::Paren) {
+            let paren_content;
+            parenthesized!(paren_content in input);
+            paren_content.parse::<TokenStream>()?;
+            lookahead = input.lookahead1();
+        }
+
+        if lookahead.peek(token::Brace) {
+            let brace_content;
+            braced!(brace_content in input);
+            brace_content.parse::<TokenStream>()?;
+        } else {
+            return Err(lookahead.error());
+        }
+
+        Ok(Item::Verbatim(verbatim::between(&begin, input)))
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemExternCrate {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ItemExternCrate {
+                attrs: input.call(Attribute::parse_outer)?,
+                vis: input.parse()?,
+                extern_token: input.parse()?,
+                crate_token: input.parse()?,
+                ident: {
+                    if input.peek(Token![self]) {
+                        input.call(Ident::parse_any)?
+                    } else {
+                        input.parse()?
+                    }
+                },
+                rename: {
+                    if input.peek(Token![as]) {
+                        let as_token: Token![as] = input.parse()?;
+                        let rename: Ident = if input.peek(Token![_]) {
+                            Ident::from(input.parse::<Token![_]>()?)
+                        } else {
+                            input.parse()?
+                        };
+                        Some((as_token, rename))
+                    } else {
+                        None
+                    }
+                },
+                semi_token: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemUse {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_crate_root_in_path = false;
+            parse_item_use(input, allow_crate_root_in_path).map(Option::unwrap)
+        }
+    }
+
+    fn parse_item_use(
+        input: ParseStream,
+        allow_crate_root_in_path: bool,
+    ) -> Result<Option<ItemUse>> {
+        let attrs = input.call(Attribute::parse_outer)?;
+        let vis: Visibility = input.parse()?;
+        let use_token: Token![use] = input.parse()?;
+        let leading_colon: Option<Token![::]> = input.parse()?;
+        let tree = parse_use_tree(input, allow_crate_root_in_path && leading_colon.is_none())?;
+        let semi_token: Token![;] = input.parse()?;
+
+        let tree = match tree {
+            Some(tree) => tree,
+            None => return Ok(None),
+        };
+
+        Ok(Some(ItemUse {
+            attrs,
+            vis,
+            use_token,
+            leading_colon,
+            tree,
+            semi_token,
+        }))
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for UseTree {
+        fn parse(input: ParseStream) -> Result<UseTree> {
+            let allow_crate_root_in_path = false;
+            parse_use_tree(input, allow_crate_root_in_path).map(Option::unwrap)
+        }
+    }
+
+    fn parse_use_tree(
+        input: ParseStream,
+        allow_crate_root_in_path: bool,
+    ) -> Result<Option<UseTree>> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(Ident)
+            || lookahead.peek(Token![self])
+            || lookahead.peek(Token![super])
+            || lookahead.peek(Token![crate])
+            || lookahead.peek(Token![try])
+        {
+            let ident = input.call(Ident::parse_any)?;
+            if input.peek(Token![::]) {
+                Ok(Some(UseTree::Path(UsePath {
+                    ident,
+                    colon2_token: input.parse()?,
+                    tree: Box::new(input.parse()?),
+                })))
+            } else if input.peek(Token![as]) {
+                Ok(Some(UseTree::Rename(UseRename {
+                    ident,
+                    as_token: input.parse()?,
+                    rename: {
+                        if input.peek(Ident) {
+                            input.parse()?
+                        } else if input.peek(Token![_]) {
+                            Ident::from(input.parse::<Token![_]>()?)
+                        } else {
+                            return Err(input.error("expected identifier or underscore"));
+                        }
+                    },
+                })))
+            } else {
+                Ok(Some(UseTree::Name(UseName { ident })))
+            }
+        } else if lookahead.peek(Token![*]) {
+            Ok(Some(UseTree::Glob(UseGlob {
+                star_token: input.parse()?,
+            })))
+        } else if lookahead.peek(token::Brace) {
+            let content;
+            let brace_token = braced!(content in input);
+            let mut items = Punctuated::new();
+            let mut has_any_crate_root_in_path = false;
+            loop {
+                if content.is_empty() {
+                    break;
+                }
+                let this_tree_starts_with_crate_root =
+                    allow_crate_root_in_path && content.parse::<Option<Token![::]>>()?.is_some();
+                has_any_crate_root_in_path |= this_tree_starts_with_crate_root;
+                match parse_use_tree(
+                    &content,
+                    allow_crate_root_in_path && !this_tree_starts_with_crate_root,
+                )? {
+                    Some(tree) => items.push_value(tree),
+                    None => has_any_crate_root_in_path = true,
+                }
+                if content.is_empty() {
+                    break;
+                }
+                let comma: Token![,] = content.parse()?;
+                items.push_punct(comma);
+            }
+            if has_any_crate_root_in_path {
+                Ok(None)
+            } else {
+                Ok(Some(UseTree::Group(UseGroup { brace_token, items })))
+            }
+        } else {
+            Err(lookahead.error())
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemStatic {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ItemStatic {
+                attrs: input.call(Attribute::parse_outer)?,
+                vis: input.parse()?,
+                static_token: input.parse()?,
+                mutability: input.parse()?,
+                ident: input.parse()?,
+                colon_token: input.parse()?,
+                ty: input.parse()?,
+                eq_token: input.parse()?,
+                expr: input.parse()?,
+                semi_token: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemConst {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let vis: Visibility = input.parse()?;
+            let const_token: Token![const] = input.parse()?;
+
+            let lookahead = input.lookahead1();
+            let ident = if lookahead.peek(Ident) || lookahead.peek(Token![_]) {
+                input.call(Ident::parse_any)?
+            } else {
+                return Err(lookahead.error());
+            };
+
+            let colon_token: Token![:] = input.parse()?;
+            let ty: Type = input.parse()?;
+            let eq_token: Token![=] = input.parse()?;
+            let expr: Expr = input.parse()?;
+            let semi_token: Token![;] = input.parse()?;
+
+            Ok(ItemConst {
+                attrs,
+                vis,
+                const_token,
+                ident,
+                generics: Generics::default(),
+                colon_token,
+                ty: Box::new(ty),
+                eq_token,
+                expr: Box::new(expr),
+                semi_token,
+            })
+        }
+    }
+
+    fn peek_signature(input: ParseStream) -> bool {
+        let fork = input.fork();
+        fork.parse::<Option<Token![const]>>().is_ok()
+            && fork.parse::<Option<Token![async]>>().is_ok()
+            && fork.parse::<Option<Token![unsafe]>>().is_ok()
+            && fork.parse::<Option<Abi>>().is_ok()
+            && fork.peek(Token![fn])
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Signature {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let constness: Option<Token![const]> = input.parse()?;
+            let asyncness: Option<Token![async]> = input.parse()?;
+            let unsafety: Option<Token![unsafe]> = input.parse()?;
+            let abi: Option<Abi> = input.parse()?;
+            let fn_token: Token![fn] = input.parse()?;
+            let ident: Ident = input.parse()?;
+            let mut generics: Generics = input.parse()?;
+
+            let content;
+            let paren_token = parenthesized!(content in input);
+            let (inputs, variadic) = parse_fn_args(&content)?;
+
+            let output: ReturnType = input.parse()?;
+            generics.where_clause = input.parse()?;
+
+            Ok(Signature {
+                constness,
+                asyncness,
+                unsafety,
+                abi,
+                fn_token,
+                ident,
+                generics,
+                paren_token,
+                inputs,
+                variadic,
+                output,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemFn {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let outer_attrs = input.call(Attribute::parse_outer)?;
+            let vis: Visibility = input.parse()?;
+            let sig: Signature = input.parse()?;
+            parse_rest_of_fn(input, outer_attrs, vis, sig)
+        }
+    }
+
+    fn parse_rest_of_fn(
+        input: ParseStream,
+        mut attrs: Vec<Attribute>,
+        vis: Visibility,
+        sig: Signature,
+    ) -> Result<ItemFn> {
+        let content;
+        let brace_token = braced!(content in input);
+        attr::parsing::parse_inner(&content, &mut attrs)?;
+        let stmts = content.call(Block::parse_within)?;
+
+        Ok(ItemFn {
+            attrs,
+            vis,
+            sig,
+            block: Box::new(Block { brace_token, stmts }),
+        })
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for FnArg {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_variadic = false;
+            let attrs = input.call(Attribute::parse_outer)?;
+            match parse_fn_arg_or_variadic(input, attrs, allow_variadic)? {
+                FnArgOrVariadic::FnArg(arg) => Ok(arg),
+                FnArgOrVariadic::Variadic(_) => unreachable!(),
+            }
+        }
+    }
+
+    enum FnArgOrVariadic {
+        FnArg(FnArg),
+        Variadic(Variadic),
+    }
+
+    fn parse_fn_arg_or_variadic(
+        input: ParseStream,
+        attrs: Vec<Attribute>,
+        allow_variadic: bool,
+    ) -> Result<FnArgOrVariadic> {
+        let ahead = input.fork();
+        if let Ok(mut receiver) = ahead.parse::<Receiver>() {
+            input.advance_to(&ahead);
+            receiver.attrs = attrs;
+            return Ok(FnArgOrVariadic::FnArg(FnArg::Receiver(receiver)));
+        }
+
+        // Hack to parse pre-2018 syntax in
+        // test/ui/rfc-2565-param-attrs/param-attrs-pretty.rs
+        // because the rest of the test case is valuable.
+        if input.peek(Ident) && input.peek2(Token![<]) {
+            let span = input.fork().parse::<Ident>()?.span();
+            return Ok(FnArgOrVariadic::FnArg(FnArg::Typed(PatType {
+                attrs,
+                pat: Box::new(Pat::Wild(PatWild {
+                    attrs: Vec::new(),
+                    underscore_token: Token![_](span),
+                })),
+                colon_token: Token![:](span),
+                ty: input.parse()?,
+            })));
+        }
+
+        let pat = Box::new(Pat::parse_single(input)?);
+        let colon_token: Token![:] = input.parse()?;
+
+        if allow_variadic {
+            if let Some(dots) = input.parse::<Option<Token![...]>>()? {
+                return Ok(FnArgOrVariadic::Variadic(Variadic {
+                    attrs,
+                    pat: Some((pat, colon_token)),
+                    dots,
+                    comma: None,
+                }));
+            }
+        }
+
+        Ok(FnArgOrVariadic::FnArg(FnArg::Typed(PatType {
+            attrs,
+            pat,
+            colon_token,
+            ty: input.parse()?,
+        })))
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Receiver {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let reference = if input.peek(Token![&]) {
+                let ampersand: Token![&] = input.parse()?;
+                let lifetime: Option<Lifetime> = input.parse()?;
+                Some((ampersand, lifetime))
+            } else {
+                None
+            };
+            let mutability: Option<Token![mut]> = input.parse()?;
+            let self_token: Token![self] = input.parse()?;
+            let colon_token: Option<Token![:]> = if reference.is_some() {
+                None
+            } else {
+                input.parse()?
+            };
+            let ty: Type = if colon_token.is_some() {
+                input.parse()?
+            } else {
+                let mut ty = Type::Path(TypePath {
+                    qself: None,
+                    path: Path::from(Ident::new("Self", self_token.span)),
+                });
+                if let Some((ampersand, lifetime)) = reference.as_ref() {
+                    ty = Type::Reference(TypeReference {
+                        and_token: Token![&](ampersand.span),
+                        lifetime: lifetime.clone(),
+                        mutability: mutability.as_ref().map(|m| Token![mut](m.span)),
+                        elem: Box::new(ty),
+                    });
+                }
+                ty
+            };
+            Ok(Receiver {
+                attrs: Vec::new(),
+                reference,
+                mutability,
+                self_token,
+                colon_token,
+                ty: Box::new(ty),
+            })
+        }
+    }
+
+    fn parse_fn_args(
+        input: ParseStream,
+    ) -> Result<(Punctuated<FnArg, Token![,]>, Option<Variadic>)> {
+        let mut args = Punctuated::new();
+        let mut variadic = None;
+        let mut has_receiver = false;
+
+        while !input.is_empty() {
+            let attrs = input.call(Attribute::parse_outer)?;
+
+            if let Some(dots) = input.parse::<Option<Token![...]>>()? {
+                variadic = Some(Variadic {
+                    attrs,
+                    pat: None,
+                    dots,
+                    comma: if input.is_empty() {
+                        None
+                    } else {
+                        Some(input.parse()?)
+                    },
+                });
+                break;
+            }
+
+            let allow_variadic = true;
+            let arg = match parse_fn_arg_or_variadic(input, attrs, allow_variadic)? {
+                FnArgOrVariadic::FnArg(arg) => arg,
+                FnArgOrVariadic::Variadic(arg) => {
+                    variadic = Some(Variadic {
+                        comma: if input.is_empty() {
+                            None
+                        } else {
+                            Some(input.parse()?)
+                        },
+                        ..arg
+                    });
+                    break;
+                }
+            };
+
+            match &arg {
+                FnArg::Receiver(receiver) if has_receiver => {
+                    return Err(Error::new(
+                        receiver.self_token.span,
+                        "unexpected second method receiver",
+                    ));
+                }
+                FnArg::Receiver(receiver) if !args.is_empty() => {
+                    return Err(Error::new(
+                        receiver.self_token.span,
+                        "unexpected method receiver",
+                    ));
+                }
+                FnArg::Receiver(_) => has_receiver = true,
+                FnArg::Typed(_) => {}
+            }
+            args.push_value(arg);
+
+            if input.is_empty() {
+                break;
+            }
+
+            let comma: Token![,] = input.parse()?;
+            args.push_punct(comma);
+        }
+
+        Ok((args, variadic))
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemMod {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let vis: Visibility = input.parse()?;
+            let unsafety: Option<Token![unsafe]> = input.parse()?;
+            let mod_token: Token![mod] = input.parse()?;
+            let ident: Ident = if input.peek(Token![try]) {
+                input.call(Ident::parse_any)
+            } else {
+                input.parse()
+            }?;
+
+            let lookahead = input.lookahead1();
+            if lookahead.peek(Token![;]) {
+                Ok(ItemMod {
+                    attrs,
+                    vis,
+                    unsafety,
+                    mod_token,
+                    ident,
+                    content: None,
+                    semi: Some(input.parse()?),
+                })
+            } else if lookahead.peek(token::Brace) {
+                let content;
+                let brace_token = braced!(content in input);
+                attr::parsing::parse_inner(&content, &mut attrs)?;
+
+                let mut items = Vec::new();
+                while !content.is_empty() {
+                    items.push(content.parse()?);
+                }
+
+                Ok(ItemMod {
+                    attrs,
+                    vis,
+                    unsafety,
+                    mod_token,
+                    ident,
+                    content: Some((brace_token, items)),
+                    semi: None,
+                })
+            } else {
+                Err(lookahead.error())
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemForeignMod {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let unsafety: Option<Token![unsafe]> = input.parse()?;
+            let abi: Abi = input.parse()?;
+
+            let content;
+            let brace_token = braced!(content in input);
+            attr::parsing::parse_inner(&content, &mut attrs)?;
+            let mut items = Vec::new();
+            while !content.is_empty() {
+                items.push(content.parse()?);
+            }
+
+            Ok(ItemForeignMod {
+                attrs,
+                unsafety,
+                abi,
+                brace_token,
+                items,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ForeignItem {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let begin = input.fork();
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let ahead = input.fork();
+            let vis: Visibility = ahead.parse()?;
+
+            let lookahead = ahead.lookahead1();
+            let mut item = if lookahead.peek(Token![fn]) || peek_signature(&ahead) {
+                let vis: Visibility = input.parse()?;
+                let sig: Signature = input.parse()?;
+                if input.peek(token::Brace) {
+                    let content;
+                    braced!(content in input);
+                    content.call(Attribute::parse_inner)?;
+                    content.call(Block::parse_within)?;
+
+                    Ok(ForeignItem::Verbatim(verbatim::between(&begin, input)))
+                } else {
+                    Ok(ForeignItem::Fn(ForeignItemFn {
+                        attrs: Vec::new(),
+                        vis,
+                        sig,
+                        semi_token: input.parse()?,
+                    }))
+                }
+            } else if lookahead.peek(Token![static]) {
+                let vis = input.parse()?;
+                let static_token = input.parse()?;
+                let mutability = input.parse()?;
+                let ident = input.parse()?;
+                let colon_token = input.parse()?;
+                let ty = input.parse()?;
+                if input.peek(Token![=]) {
+                    input.parse::<Token![=]>()?;
+                    input.parse::<Expr>()?;
+                    input.parse::<Token![;]>()?;
+                    Ok(ForeignItem::Verbatim(verbatim::between(&begin, input)))
+                } else {
+                    Ok(ForeignItem::Static(ForeignItemStatic {
+                        attrs: Vec::new(),
+                        vis,
+                        static_token,
+                        mutability,
+                        ident,
+                        colon_token,
+                        ty,
+                        semi_token: input.parse()?,
+                    }))
+                }
+            } else if lookahead.peek(Token![type]) {
+                parse_foreign_item_type(begin, input)
+            } else if vis.is_inherited()
+                && (lookahead.peek(Ident)
+                    || lookahead.peek(Token![self])
+                    || lookahead.peek(Token![super])
+                    || lookahead.peek(Token![crate])
+                    || lookahead.peek(Token![::]))
+            {
+                input.parse().map(ForeignItem::Macro)
+            } else {
+                Err(lookahead.error())
+            }?;
+
+            let item_attrs = match &mut item {
+                ForeignItem::Fn(item) => &mut item.attrs,
+                ForeignItem::Static(item) => &mut item.attrs,
+                ForeignItem::Type(item) => &mut item.attrs,
+                ForeignItem::Macro(item) => &mut item.attrs,
+                ForeignItem::Verbatim(_) => return Ok(item),
+            };
+            attrs.append(item_attrs);
+            *item_attrs = attrs;
+
+            Ok(item)
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ForeignItemFn {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let vis: Visibility = input.parse()?;
+            let sig: Signature = input.parse()?;
+            let semi_token: Token![;] = input.parse()?;
+            Ok(ForeignItemFn {
+                attrs,
+                vis,
+                sig,
+                semi_token,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ForeignItemStatic {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ForeignItemStatic {
+                attrs: input.call(Attribute::parse_outer)?,
+                vis: input.parse()?,
+                static_token: input.parse()?,
+                mutability: input.parse()?,
+                ident: input.parse()?,
+                colon_token: input.parse()?,
+                ty: input.parse()?,
+                semi_token: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ForeignItemType {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ForeignItemType {
+                attrs: input.call(Attribute::parse_outer)?,
+                vis: input.parse()?,
+                type_token: input.parse()?,
+                ident: input.parse()?,
+                generics: {
+                    let mut generics: Generics = input.parse()?;
+                    generics.where_clause = input.parse()?;
+                    generics
+                },
+                semi_token: input.parse()?,
+            })
+        }
+    }
+
+    fn parse_foreign_item_type(begin: ParseBuffer, input: ParseStream) -> Result<ForeignItem> {
+        let FlexibleItemType {
+            vis,
+            defaultness: _,
+            type_token,
+            ident,
+            generics,
+            colon_token,
+            bounds: _,
+            ty,
+            semi_token,
+        } = FlexibleItemType::parse(
+            input,
+            TypeDefaultness::Disallowed,
+            WhereClauseLocation::Both,
+        )?;
+
+        if colon_token.is_some() || ty.is_some() {
+            Ok(ForeignItem::Verbatim(verbatim::between(&begin, input)))
+        } else {
+            Ok(ForeignItem::Type(ForeignItemType {
+                attrs: Vec::new(),
+                vis,
+                type_token,
+                ident,
+                generics,
+                semi_token,
+            }))
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ForeignItemMacro {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let mac: Macro = input.parse()?;
+            let semi_token: Option<Token![;]> = if mac.delimiter.is_brace() {
+                None
+            } else {
+                Some(input.parse()?)
+            };
+            Ok(ForeignItemMacro {
+                attrs,
+                mac,
+                semi_token,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemType {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ItemType {
+                attrs: input.call(Attribute::parse_outer)?,
+                vis: input.parse()?,
+                type_token: input.parse()?,
+                ident: input.parse()?,
+                generics: {
+                    let mut generics: Generics = input.parse()?;
+                    generics.where_clause = input.parse()?;
+                    generics
+                },
+                eq_token: input.parse()?,
+                ty: input.parse()?,
+                semi_token: input.parse()?,
+            })
+        }
+    }
+
+    fn parse_item_type(begin: ParseBuffer, input: ParseStream) -> Result<Item> {
+        let FlexibleItemType {
+            vis,
+            defaultness: _,
+            type_token,
+            ident,
+            generics,
+            colon_token,
+            bounds: _,
+            ty,
+            semi_token,
+        } = FlexibleItemType::parse(
+            input,
+            TypeDefaultness::Disallowed,
+            WhereClauseLocation::BeforeEq,
+        )?;
+
+        let (eq_token, ty) = match ty {
+            Some(ty) if colon_token.is_none() => ty,
+            _ => return Ok(Item::Verbatim(verbatim::between(&begin, input))),
+        };
+
+        Ok(Item::Type(ItemType {
+            attrs: Vec::new(),
+            vis,
+            type_token,
+            ident,
+            generics,
+            eq_token,
+            ty: Box::new(ty),
+            semi_token,
+        }))
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemStruct {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let vis = input.parse::<Visibility>()?;
+            let struct_token = input.parse::<Token![struct]>()?;
+            let ident = input.parse::<Ident>()?;
+            let generics = input.parse::<Generics>()?;
+            let (where_clause, fields, semi_token) = derive::parsing::data_struct(input)?;
+            Ok(ItemStruct {
+                attrs,
+                vis,
+                struct_token,
+                ident,
+                generics: Generics {
+                    where_clause,
+                    ..generics
+                },
+                fields,
+                semi_token,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemEnum {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let vis = input.parse::<Visibility>()?;
+            let enum_token = input.parse::<Token![enum]>()?;
+            let ident = input.parse::<Ident>()?;
+            let generics = input.parse::<Generics>()?;
+            let (where_clause, brace_token, variants) = derive::parsing::data_enum(input)?;
+            Ok(ItemEnum {
+                attrs,
+                vis,
+                enum_token,
+                ident,
+                generics: Generics {
+                    where_clause,
+                    ..generics
+                },
+                brace_token,
+                variants,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemUnion {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let vis = input.parse::<Visibility>()?;
+            let union_token = input.parse::<Token![union]>()?;
+            let ident = input.parse::<Ident>()?;
+            let generics = input.parse::<Generics>()?;
+            let (where_clause, fields) = derive::parsing::data_union(input)?;
+            Ok(ItemUnion {
+                attrs,
+                vis,
+                union_token,
+                ident,
+                generics: Generics {
+                    where_clause,
+                    ..generics
+                },
+                fields,
+            })
+        }
+    }
+
+    fn parse_trait_or_trait_alias(input: ParseStream) -> Result<Item> {
+        let (attrs, vis, trait_token, ident, generics) = parse_start_of_trait_alias(input)?;
+        let lookahead = input.lookahead1();
+        if lookahead.peek(token::Brace)
+            || lookahead.peek(Token![:])
+            || lookahead.peek(Token![where])
+        {
+            let unsafety = None;
+            let auto_token = None;
+            parse_rest_of_trait(
+                input,
+                attrs,
+                vis,
+                unsafety,
+                auto_token,
+                trait_token,
+                ident,
+                generics,
+            )
+            .map(Item::Trait)
+        } else if lookahead.peek(Token![=]) {
+            parse_rest_of_trait_alias(input, attrs, vis, trait_token, ident, generics)
+                .map(Item::TraitAlias)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemTrait {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let outer_attrs = input.call(Attribute::parse_outer)?;
+            let vis: Visibility = input.parse()?;
+            let unsafety: Option<Token![unsafe]> = input.parse()?;
+            let auto_token: Option<Token![auto]> = input.parse()?;
+            let trait_token: Token![trait] = input.parse()?;
+            let ident: Ident = input.parse()?;
+            let generics: Generics = input.parse()?;
+            parse_rest_of_trait(
+                input,
+                outer_attrs,
+                vis,
+                unsafety,
+                auto_token,
+                trait_token,
+                ident,
+                generics,
+            )
+        }
+    }
+
+    fn parse_rest_of_trait(
+        input: ParseStream,
+        mut attrs: Vec<Attribute>,
+        vis: Visibility,
+        unsafety: Option<Token![unsafe]>,
+        auto_token: Option<Token![auto]>,
+        trait_token: Token![trait],
+        ident: Ident,
+        mut generics: Generics,
+    ) -> Result<ItemTrait> {
+        let colon_token: Option<Token![:]> = input.parse()?;
+
+        let mut supertraits = Punctuated::new();
+        if colon_token.is_some() {
+            loop {
+                if input.peek(Token![where]) || input.peek(token::Brace) {
+                    break;
+                }
+                supertraits.push_value(input.parse()?);
+                if input.peek(Token![where]) || input.peek(token::Brace) {
+                    break;
+                }
+                supertraits.push_punct(input.parse()?);
+            }
+        }
+
+        generics.where_clause = input.parse()?;
+
+        let content;
+        let brace_token = braced!(content in input);
+        attr::parsing::parse_inner(&content, &mut attrs)?;
+        let mut items = Vec::new();
+        while !content.is_empty() {
+            items.push(content.parse()?);
+        }
+
+        Ok(ItemTrait {
+            attrs,
+            vis,
+            unsafety,
+            auto_token,
+            restriction: None,
+            trait_token,
+            ident,
+            generics,
+            colon_token,
+            supertraits,
+            brace_token,
+            items,
+        })
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemTraitAlias {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let (attrs, vis, trait_token, ident, generics) = parse_start_of_trait_alias(input)?;
+            parse_rest_of_trait_alias(input, attrs, vis, trait_token, ident, generics)
+        }
+    }
+
+    fn parse_start_of_trait_alias(
+        input: ParseStream,
+    ) -> Result<(Vec<Attribute>, Visibility, Token![trait], Ident, Generics)> {
+        let attrs = input.call(Attribute::parse_outer)?;
+        let vis: Visibility = input.parse()?;
+        let trait_token: Token![trait] = input.parse()?;
+        let ident: Ident = input.parse()?;
+        let generics: Generics = input.parse()?;
+        Ok((attrs, vis, trait_token, ident, generics))
+    }
+
+    fn parse_rest_of_trait_alias(
+        input: ParseStream,
+        attrs: Vec<Attribute>,
+        vis: Visibility,
+        trait_token: Token![trait],
+        ident: Ident,
+        mut generics: Generics,
+    ) -> Result<ItemTraitAlias> {
+        let eq_token: Token![=] = input.parse()?;
+
+        let mut bounds = Punctuated::new();
+        loop {
+            if input.peek(Token![where]) || input.peek(Token![;]) {
+                break;
+            }
+            bounds.push_value(input.parse()?);
+            if input.peek(Token![where]) || input.peek(Token![;]) {
+                break;
+            }
+            bounds.push_punct(input.parse()?);
+        }
+
+        generics.where_clause = input.parse()?;
+        let semi_token: Token![;] = input.parse()?;
+
+        Ok(ItemTraitAlias {
+            attrs,
+            vis,
+            trait_token,
+            ident,
+            generics,
+            eq_token,
+            bounds,
+            semi_token,
+        })
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TraitItem {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let begin = input.fork();
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let vis: Visibility = input.parse()?;
+            let defaultness: Option<Token![default]> = input.parse()?;
+            let ahead = input.fork();
+
+            let lookahead = ahead.lookahead1();
+            let mut item = if lookahead.peek(Token![fn]) || peek_signature(&ahead) {
+                input.parse().map(TraitItem::Fn)
+            } else if lookahead.peek(Token![const]) {
+                let const_token: Token![const] = ahead.parse()?;
+                let lookahead = ahead.lookahead1();
+                if lookahead.peek(Ident) || lookahead.peek(Token![_]) {
+                    input.advance_to(&ahead);
+                    let ident = input.call(Ident::parse_any)?;
+                    let mut generics: Generics = input.parse()?;
+                    let colon_token: Token![:] = input.parse()?;
+                    let ty: Type = input.parse()?;
+                    let default = if let Some(eq_token) = input.parse::<Option<Token![=]>>()? {
+                        let expr: Expr = input.parse()?;
+                        Some((eq_token, expr))
+                    } else {
+                        None
+                    };
+                    generics.where_clause = input.parse()?;
+                    let semi_token: Token![;] = input.parse()?;
+                    if generics.lt_token.is_none() && generics.where_clause.is_none() {
+                        Ok(TraitItem::Const(TraitItemConst {
+                            attrs: Vec::new(),
+                            const_token,
+                            ident,
+                            generics,
+                            colon_token,
+                            ty,
+                            default,
+                            semi_token,
+                        }))
+                    } else {
+                        return Ok(TraitItem::Verbatim(verbatim::between(&begin, input)));
+                    }
+                } else if lookahead.peek(Token![async])
+                    || lookahead.peek(Token![unsafe])
+                    || lookahead.peek(Token![extern])
+                    || lookahead.peek(Token![fn])
+                {
+                    input.parse().map(TraitItem::Fn)
+                } else {
+                    Err(lookahead.error())
+                }
+            } else if lookahead.peek(Token![type]) {
+                parse_trait_item_type(begin.fork(), input)
+            } else if vis.is_inherited()
+                && defaultness.is_none()
+                && (lookahead.peek(Ident)
+                    || lookahead.peek(Token![self])
+                    || lookahead.peek(Token![super])
+                    || lookahead.peek(Token![crate])
+                    || lookahead.peek(Token![::]))
+            {
+                input.parse().map(TraitItem::Macro)
+            } else {
+                Err(lookahead.error())
+            }?;
+
+            match (vis, defaultness) {
+                (Visibility::Inherited, None) => {}
+                _ => return Ok(TraitItem::Verbatim(verbatim::between(&begin, input))),
+            }
+
+            let item_attrs = match &mut item {
+                TraitItem::Const(item) => &mut item.attrs,
+                TraitItem::Fn(item) => &mut item.attrs,
+                TraitItem::Type(item) => &mut item.attrs,
+                TraitItem::Macro(item) => &mut item.attrs,
+                TraitItem::Verbatim(_) => unreachable!(),
+            };
+            attrs.append(item_attrs);
+            *item_attrs = attrs;
+            Ok(item)
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TraitItemConst {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let const_token: Token![const] = input.parse()?;
+
+            let lookahead = input.lookahead1();
+            let ident = if lookahead.peek(Ident) || lookahead.peek(Token![_]) {
+                input.call(Ident::parse_any)?
+            } else {
+                return Err(lookahead.error());
+            };
+
+            let colon_token: Token![:] = input.parse()?;
+            let ty: Type = input.parse()?;
+            let default = if input.peek(Token![=]) {
+                let eq_token: Token![=] = input.parse()?;
+                let default: Expr = input.parse()?;
+                Some((eq_token, default))
+            } else {
+                None
+            };
+            let semi_token: Token![;] = input.parse()?;
+
+            Ok(TraitItemConst {
+                attrs,
+                const_token,
+                ident,
+                generics: Generics::default(),
+                colon_token,
+                ty,
+                default,
+                semi_token,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TraitItemFn {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let sig: Signature = input.parse()?;
+
+            let lookahead = input.lookahead1();
+            let (brace_token, stmts, semi_token) = if lookahead.peek(token::Brace) {
+                let content;
+                let brace_token = braced!(content in input);
+                attr::parsing::parse_inner(&content, &mut attrs)?;
+                let stmts = content.call(Block::parse_within)?;
+                (Some(brace_token), stmts, None)
+            } else if lookahead.peek(Token![;]) {
+                let semi_token: Token![;] = input.parse()?;
+                (None, Vec::new(), Some(semi_token))
+            } else {
+                return Err(lookahead.error());
+            };
+
+            Ok(TraitItemFn {
+                attrs,
+                sig,
+                default: brace_token.map(|brace_token| Block { brace_token, stmts }),
+                semi_token,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TraitItemType {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let type_token: Token![type] = input.parse()?;
+            let ident: Ident = input.parse()?;
+            let mut generics: Generics = input.parse()?;
+            let (colon_token, bounds) = FlexibleItemType::parse_optional_bounds(input)?;
+            let default = FlexibleItemType::parse_optional_definition(input)?;
+            generics.where_clause = input.parse()?;
+            let semi_token: Token![;] = input.parse()?;
+            Ok(TraitItemType {
+                attrs,
+                type_token,
+                ident,
+                generics,
+                colon_token,
+                bounds,
+                default,
+                semi_token,
+            })
+        }
+    }
+
+    fn parse_trait_item_type(begin: ParseBuffer, input: ParseStream) -> Result<TraitItem> {
+        let FlexibleItemType {
+            vis,
+            defaultness: _,
+            type_token,
+            ident,
+            generics,
+            colon_token,
+            bounds,
+            ty,
+            semi_token,
+        } = FlexibleItemType::parse(
+            input,
+            TypeDefaultness::Disallowed,
+            WhereClauseLocation::AfterEq,
+        )?;
+
+        if vis.is_some() {
+            Ok(TraitItem::Verbatim(verbatim::between(&begin, input)))
+        } else {
+            Ok(TraitItem::Type(TraitItemType {
+                attrs: Vec::new(),
+                type_token,
+                ident,
+                generics,
+                colon_token,
+                bounds,
+                default: ty,
+                semi_token,
+            }))
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TraitItemMacro {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let mac: Macro = input.parse()?;
+            let semi_token: Option<Token![;]> = if mac.delimiter.is_brace() {
+                None
+            } else {
+                Some(input.parse()?)
+            };
+            Ok(TraitItemMacro {
+                attrs,
+                mac,
+                semi_token,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemImpl {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_verbatim_impl = false;
+            parse_impl(input, allow_verbatim_impl).map(Option::unwrap)
+        }
+    }
+
+    fn parse_impl(input: ParseStream, allow_verbatim_impl: bool) -> Result<Option<ItemImpl>> {
+        let mut attrs = input.call(Attribute::parse_outer)?;
+        let has_visibility = allow_verbatim_impl && input.parse::<Visibility>()?.is_some();
+        let defaultness: Option<Token![default]> = input.parse()?;
+        let unsafety: Option<Token![unsafe]> = input.parse()?;
+        let impl_token: Token![impl] = input.parse()?;
+
+        let has_generics = input.peek(Token![<])
+            && (input.peek2(Token![>])
+                || input.peek2(Token![#])
+                || (input.peek2(Ident) || input.peek2(Lifetime))
+                    && (input.peek3(Token![:])
+                        || input.peek3(Token![,])
+                        || input.peek3(Token![>])
+                        || input.peek3(Token![=]))
+                || input.peek2(Token![const]));
+        let mut generics: Generics = if has_generics {
+            input.parse()?
+        } else {
+            Generics::default()
+        };
+
+        let is_const_impl = allow_verbatim_impl
+            && (input.peek(Token![const]) || input.peek(Token![?]) && input.peek2(Token![const]));
+        if is_const_impl {
+            input.parse::<Option<Token![?]>>()?;
+            input.parse::<Token![const]>()?;
+        }
+
+        let begin = input.fork();
+        let polarity = if input.peek(Token![!]) && !input.peek2(token::Brace) {
+            Some(input.parse::<Token![!]>()?)
+        } else {
+            None
+        };
+
+        #[cfg(not(feature = "printing"))]
+        let first_ty_span = input.span();
+        let mut first_ty: Type = input.parse()?;
+        let self_ty: Type;
+        let trait_;
+
+        let is_impl_for = input.peek(Token![for]);
+        if is_impl_for {
+            let for_token: Token![for] = input.parse()?;
+            let mut first_ty_ref = &first_ty;
+            while let Type::Group(ty) = first_ty_ref {
+                first_ty_ref = &ty.elem;
+            }
+            if let Type::Path(TypePath { qself: None, .. }) = first_ty_ref {
+                while let Type::Group(ty) = first_ty {
+                    first_ty = *ty.elem;
+                }
+                if let Type::Path(TypePath { qself: None, path }) = first_ty {
+                    trait_ = Some((polarity, path, for_token));
+                } else {
+                    unreachable!();
+                }
+            } else if !allow_verbatim_impl {
+                #[cfg(feature = "printing")]
+                return Err(Error::new_spanned(first_ty_ref, "expected trait path"));
+                #[cfg(not(feature = "printing"))]
+                return Err(Error::new(first_ty_span, "expected trait path"));
+            } else {
+                trait_ = None;
+            }
+            self_ty = input.parse()?;
+        } else {
+            trait_ = None;
+            self_ty = if polarity.is_none() {
+                first_ty
+            } else {
+                Type::Verbatim(verbatim::between(&begin, input))
+            };
+        }
+
+        generics.where_clause = input.parse()?;
+
+        let content;
+        let brace_token = braced!(content in input);
+        attr::parsing::parse_inner(&content, &mut attrs)?;
+
+        let mut items = Vec::new();
+        while !content.is_empty() {
+            items.push(content.parse()?);
+        }
+
+        if has_visibility || is_const_impl || is_impl_for && trait_.is_none() {
+            Ok(None)
+        } else {
+            Ok(Some(ItemImpl {
+                attrs,
+                defaultness,
+                unsafety,
+                impl_token,
+                generics,
+                trait_,
+                self_ty: Box::new(self_ty),
+                brace_token,
+                items,
+            }))
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ImplItem {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let begin = input.fork();
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let ahead = input.fork();
+            let vis: Visibility = ahead.parse()?;
+
+            let mut lookahead = ahead.lookahead1();
+            let defaultness = if lookahead.peek(Token![default]) && !ahead.peek2(Token![!]) {
+                let defaultness: Token![default] = ahead.parse()?;
+                lookahead = ahead.lookahead1();
+                Some(defaultness)
+            } else {
+                None
+            };
+
+            let mut item = if lookahead.peek(Token![fn]) || peek_signature(&ahead) {
+                let allow_omitted_body = true;
+                if let Some(item) = parse_impl_item_fn(input, allow_omitted_body)? {
+                    Ok(ImplItem::Fn(item))
+                } else {
+                    Ok(ImplItem::Verbatim(verbatim::between(&begin, input)))
+                }
+            } else if lookahead.peek(Token![const]) {
+                input.advance_to(&ahead);
+                let const_token: Token![const] = input.parse()?;
+                let lookahead = input.lookahead1();
+                let ident = if lookahead.peek(Ident) || lookahead.peek(Token![_]) {
+                    input.call(Ident::parse_any)?
+                } else {
+                    return Err(lookahead.error());
+                };
+                let mut generics: Generics = input.parse()?;
+                let colon_token: Token![:] = input.parse()?;
+                let ty: Type = input.parse()?;
+                let value = if let Some(eq_token) = input.parse::<Option<Token![=]>>()? {
+                    let expr: Expr = input.parse()?;
+                    Some((eq_token, expr))
+                } else {
+                    None
+                };
+                generics.where_clause = input.parse()?;
+                let semi_token: Token![;] = input.parse()?;
+                return match value {
+                    Some((eq_token, expr))
+                        if generics.lt_token.is_none() && generics.where_clause.is_none() =>
+                    {
+                        Ok(ImplItem::Const(ImplItemConst {
+                            attrs,
+                            vis,
+                            defaultness,
+                            const_token,
+                            ident,
+                            generics,
+                            colon_token,
+                            ty,
+                            eq_token,
+                            expr,
+                            semi_token,
+                        }))
+                    }
+                    _ => Ok(ImplItem::Verbatim(verbatim::between(&begin, input))),
+                };
+            } else if lookahead.peek(Token![type]) {
+                parse_impl_item_type(begin, input)
+            } else if vis.is_inherited()
+                && defaultness.is_none()
+                && (lookahead.peek(Ident)
+                    || lookahead.peek(Token![self])
+                    || lookahead.peek(Token![super])
+                    || lookahead.peek(Token![crate])
+                    || lookahead.peek(Token![::]))
+            {
+                input.parse().map(ImplItem::Macro)
+            } else {
+                Err(lookahead.error())
+            }?;
+
+            {
+                let item_attrs = match &mut item {
+                    ImplItem::Const(item) => &mut item.attrs,
+                    ImplItem::Fn(item) => &mut item.attrs,
+                    ImplItem::Type(item) => &mut item.attrs,
+                    ImplItem::Macro(item) => &mut item.attrs,
+                    ImplItem::Verbatim(_) => return Ok(item),
+                };
+                attrs.append(item_attrs);
+                *item_attrs = attrs;
+            }
+
+            Ok(item)
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ImplItemConst {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let vis: Visibility = input.parse()?;
+            let defaultness: Option<Token![default]> = input.parse()?;
+            let const_token: Token![const] = input.parse()?;
+
+            let lookahead = input.lookahead1();
+            let ident = if lookahead.peek(Ident) || lookahead.peek(Token![_]) {
+                input.call(Ident::parse_any)?
+            } else {
+                return Err(lookahead.error());
+            };
+
+            let colon_token: Token![:] = input.parse()?;
+            let ty: Type = input.parse()?;
+            let eq_token: Token![=] = input.parse()?;
+            let expr: Expr = input.parse()?;
+            let semi_token: Token![;] = input.parse()?;
+
+            Ok(ImplItemConst {
+                attrs,
+                vis,
+                defaultness,
+                const_token,
+                ident,
+                generics: Generics::default(),
+                colon_token,
+                ty,
+                eq_token,
+                expr,
+                semi_token,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ImplItemFn {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_omitted_body = false;
+            parse_impl_item_fn(input, allow_omitted_body).map(Option::unwrap)
+        }
+    }
+
+    fn parse_impl_item_fn(
+        input: ParseStream,
+        allow_omitted_body: bool,
+    ) -> Result<Option<ImplItemFn>> {
+        let mut attrs = input.call(Attribute::parse_outer)?;
+        let vis: Visibility = input.parse()?;
+        let defaultness: Option<Token![default]> = input.parse()?;
+        let sig: Signature = input.parse()?;
+
+        // Accept functions without a body in an impl block because rustc's
+        // *parser* does not reject them (the compilation error is emitted later
+        // than parsing) and it can be useful for macro DSLs.
+        if allow_omitted_body && input.parse::<Option<Token![;]>>()?.is_some() {
+            return Ok(None);
+        }
+
+        let content;
+        let brace_token = braced!(content in input);
+        attrs.extend(content.call(Attribute::parse_inner)?);
+        let block = Block {
+            brace_token,
+            stmts: content.call(Block::parse_within)?,
+        };
+
+        Ok(Some(ImplItemFn {
+            attrs,
+            vis,
+            defaultness,
+            sig,
+            block,
+        }))
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ImplItemType {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let vis: Visibility = input.parse()?;
+            let defaultness: Option<Token![default]> = input.parse()?;
+            let type_token: Token![type] = input.parse()?;
+            let ident: Ident = input.parse()?;
+            let mut generics: Generics = input.parse()?;
+            let eq_token: Token![=] = input.parse()?;
+            let ty: Type = input.parse()?;
+            generics.where_clause = input.parse()?;
+            let semi_token: Token![;] = input.parse()?;
+            Ok(ImplItemType {
+                attrs,
+                vis,
+                defaultness,
+                type_token,
+                ident,
+                generics,
+                eq_token,
+                ty,
+                semi_token,
+            })
+        }
+    }
+
+    fn parse_impl_item_type(begin: ParseBuffer, input: ParseStream) -> Result<ImplItem> {
+        let FlexibleItemType {
+            vis,
+            defaultness,
+            type_token,
+            ident,
+            generics,
+            colon_token,
+            bounds: _,
+            ty,
+            semi_token,
+        } = FlexibleItemType::parse(
+            input,
+            TypeDefaultness::Optional,
+            WhereClauseLocation::AfterEq,
+        )?;
+
+        let (eq_token, ty) = match ty {
+            Some(ty) if colon_token.is_none() => ty,
+            _ => return Ok(ImplItem::Verbatim(verbatim::between(&begin, input))),
+        };
+
+        Ok(ImplItem::Type(ImplItemType {
+            attrs: Vec::new(),
+            vis,
+            defaultness,
+            type_token,
+            ident,
+            generics,
+            eq_token,
+            ty,
+            semi_token,
+        }))
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ImplItemMacro {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let mac: Macro = input.parse()?;
+            let semi_token: Option<Token![;]> = if mac.delimiter.is_brace() {
+                None
+            } else {
+                Some(input.parse()?)
+            };
+            Ok(ImplItemMacro {
+                attrs,
+                mac,
+                semi_token,
+            })
+        }
+    }
+
+    impl Visibility {
+        fn is_inherited(&self) -> bool {
+            match self {
+                Visibility::Inherited => true,
+                _ => false,
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for StaticMutability {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut_token: Option<Token![mut]> = input.parse()?;
+            Ok(mut_token.map_or(StaticMutability::None, StaticMutability::Mut))
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::attr::FilterAttrs;
+    use crate::data::Fields;
+    use crate::item::{
+        ForeignItemFn, ForeignItemMacro, ForeignItemStatic, ForeignItemType, ImplItemConst,
+        ImplItemFn, ImplItemMacro, ImplItemType, ItemConst, ItemEnum, ItemExternCrate, ItemFn,
+        ItemForeignMod, ItemImpl, ItemMacro, ItemMod, ItemStatic, ItemStruct, ItemTrait,
+        ItemTraitAlias, ItemType, ItemUnion, ItemUse, Receiver, Signature, StaticMutability,
+        TraitItemConst, TraitItemFn, TraitItemMacro, TraitItemType, UseGlob, UseGroup, UseName,
+        UsePath, UseRename, Variadic,
+    };
+    use crate::mac::MacroDelimiter;
+    use crate::print::TokensOrDefault;
+    use crate::ty::Type;
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemExternCrate {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.extern_token.to_tokens(tokens);
+            self.crate_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            if let Some((as_token, rename)) = &self.rename {
+                as_token.to_tokens(tokens);
+                rename.to_tokens(tokens);
+            }
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemUse {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.use_token.to_tokens(tokens);
+            self.leading_colon.to_tokens(tokens);
+            self.tree.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemStatic {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.static_token.to_tokens(tokens);
+            self.mutability.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.expr.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemConst {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.const_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.expr.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemFn {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.sig.to_tokens(tokens);
+            self.block.brace_token.surround(tokens, |tokens| {
+                tokens.append_all(self.attrs.inner());
+                tokens.append_all(&self.block.stmts);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemMod {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.unsafety.to_tokens(tokens);
+            self.mod_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            if let Some((brace, items)) = &self.content {
+                brace.surround(tokens, |tokens| {
+                    tokens.append_all(self.attrs.inner());
+                    tokens.append_all(items);
+                });
+            } else {
+                TokensOrDefault(&self.semi).to_tokens(tokens);
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemForeignMod {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.unsafety.to_tokens(tokens);
+            self.abi.to_tokens(tokens);
+            self.brace_token.surround(tokens, |tokens| {
+                tokens.append_all(self.attrs.inner());
+                tokens.append_all(&self.items);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemType {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.type_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            self.generics.where_clause.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemEnum {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.enum_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            self.generics.where_clause.to_tokens(tokens);
+            self.brace_token.surround(tokens, |tokens| {
+                self.variants.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemStruct {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.struct_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            match &self.fields {
+                Fields::Named(fields) => {
+                    self.generics.where_clause.to_tokens(tokens);
+                    fields.to_tokens(tokens);
+                }
+                Fields::Unnamed(fields) => {
+                    fields.to_tokens(tokens);
+                    self.generics.where_clause.to_tokens(tokens);
+                    TokensOrDefault(&self.semi_token).to_tokens(tokens);
+                }
+                Fields::Unit => {
+                    self.generics.where_clause.to_tokens(tokens);
+                    TokensOrDefault(&self.semi_token).to_tokens(tokens);
+                }
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemUnion {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.union_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            self.generics.where_clause.to_tokens(tokens);
+            self.fields.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemTrait {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.unsafety.to_tokens(tokens);
+            self.auto_token.to_tokens(tokens);
+            self.trait_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            if !self.supertraits.is_empty() {
+                TokensOrDefault(&self.colon_token).to_tokens(tokens);
+                self.supertraits.to_tokens(tokens);
+            }
+            self.generics.where_clause.to_tokens(tokens);
+            self.brace_token.surround(tokens, |tokens| {
+                tokens.append_all(self.attrs.inner());
+                tokens.append_all(&self.items);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemTraitAlias {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.trait_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.bounds.to_tokens(tokens);
+            self.generics.where_clause.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemImpl {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.defaultness.to_tokens(tokens);
+            self.unsafety.to_tokens(tokens);
+            self.impl_token.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            if let Some((polarity, path, for_token)) = &self.trait_ {
+                polarity.to_tokens(tokens);
+                path.to_tokens(tokens);
+                for_token.to_tokens(tokens);
+            }
+            self.self_ty.to_tokens(tokens);
+            self.generics.where_clause.to_tokens(tokens);
+            self.brace_token.surround(tokens, |tokens| {
+                tokens.append_all(self.attrs.inner());
+                tokens.append_all(&self.items);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemMacro {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.mac.path.to_tokens(tokens);
+            self.mac.bang_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            match &self.mac.delimiter {
+                MacroDelimiter::Paren(paren) => {
+                    paren.surround(tokens, |tokens| self.mac.tokens.to_tokens(tokens));
+                }
+                MacroDelimiter::Brace(brace) => {
+                    brace.surround(tokens, |tokens| self.mac.tokens.to_tokens(tokens));
+                }
+                MacroDelimiter::Bracket(bracket) => {
+                    bracket.surround(tokens, |tokens| self.mac.tokens.to_tokens(tokens));
+                }
+            }
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for UsePath {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.ident.to_tokens(tokens);
+            self.colon2_token.to_tokens(tokens);
+            self.tree.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for UseName {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.ident.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for UseRename {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.ident.to_tokens(tokens);
+            self.as_token.to_tokens(tokens);
+            self.rename.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for UseGlob {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.star_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for UseGroup {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.brace_token.surround(tokens, |tokens| {
+                self.items.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TraitItemConst {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.const_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+            if let Some((eq_token, default)) = &self.default {
+                eq_token.to_tokens(tokens);
+                default.to_tokens(tokens);
+            }
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TraitItemFn {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.sig.to_tokens(tokens);
+            match &self.default {
+                Some(block) => {
+                    block.brace_token.surround(tokens, |tokens| {
+                        tokens.append_all(self.attrs.inner());
+                        tokens.append_all(&block.stmts);
+                    });
+                }
+                None => {
+                    TokensOrDefault(&self.semi_token).to_tokens(tokens);
+                }
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TraitItemType {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.type_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            if !self.bounds.is_empty() {
+                TokensOrDefault(&self.colon_token).to_tokens(tokens);
+                self.bounds.to_tokens(tokens);
+            }
+            if let Some((eq_token, default)) = &self.default {
+                eq_token.to_tokens(tokens);
+                default.to_tokens(tokens);
+            }
+            self.generics.where_clause.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TraitItemMacro {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.mac.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ImplItemConst {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.defaultness.to_tokens(tokens);
+            self.const_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.expr.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ImplItemFn {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.defaultness.to_tokens(tokens);
+            self.sig.to_tokens(tokens);
+            self.block.brace_token.surround(tokens, |tokens| {
+                tokens.append_all(self.attrs.inner());
+                tokens.append_all(&self.block.stmts);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ImplItemType {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.defaultness.to_tokens(tokens);
+            self.type_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+            self.generics.where_clause.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ImplItemMacro {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.mac.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ForeignItemFn {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.sig.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ForeignItemStatic {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.static_token.to_tokens(tokens);
+            self.mutability.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ForeignItemType {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.type_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            self.generics.where_clause.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ForeignItemMacro {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.mac.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for Signature {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.constness.to_tokens(tokens);
+            self.asyncness.to_tokens(tokens);
+            self.unsafety.to_tokens(tokens);
+            self.abi.to_tokens(tokens);
+            self.fn_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            self.paren_token.surround(tokens, |tokens| {
+                self.inputs.to_tokens(tokens);
+                if let Some(variadic) = &self.variadic {
+                    if !self.inputs.empty_or_trailing() {
+                        <Token![,]>::default().to_tokens(tokens);
+                    }
+                    variadic.to_tokens(tokens);
+                }
+            });
+            self.output.to_tokens(tokens);
+            self.generics.where_clause.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for Receiver {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            if let Some((ampersand, lifetime)) = &self.reference {
+                ampersand.to_tokens(tokens);
+                lifetime.to_tokens(tokens);
+            }
+            self.mutability.to_tokens(tokens);
+            self.self_token.to_tokens(tokens);
+            if let Some(colon_token) = &self.colon_token {
+                colon_token.to_tokens(tokens);
+                self.ty.to_tokens(tokens);
+            } else {
+                let consistent = match (&self.reference, &self.mutability, &*self.ty) {
+                    (Some(_), mutability, Type::Reference(ty)) => {
+                        mutability.is_some() == ty.mutability.is_some()
+                            && match &*ty.elem {
+                                Type::Path(ty) => ty.qself.is_none() && ty.path.is_ident("Self"),
+                                _ => false,
+                            }
+                    }
+                    (None, _, Type::Path(ty)) => ty.qself.is_none() && ty.path.is_ident("Self"),
+                    _ => false,
+                };
+                if !consistent {
+                    <Token![:]>::default().to_tokens(tokens);
+                    self.ty.to_tokens(tokens);
+                }
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for Variadic {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            if let Some((pat, colon)) = &self.pat {
+                pat.to_tokens(tokens);
+                colon.to_tokens(tokens);
+            }
+            self.dots.to_tokens(tokens);
+            self.comma.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for StaticMutability {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                StaticMutability::None => {}
+                StaticMutability::Mut(mut_token) => mut_token.to_tokens(tokens),
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/lib.rs
--- 43.0.0-1/rust-vendor/syn/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1021 @@
+//! [![github]](https://github.com/dtolnay/syn)&ensp;[![crates-io]](https://crates.io/crates/syn)&ensp;[![docs-rs]](crate)
+//!
+//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
+//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust
+//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs
+//!
+//! <br>
+//!
+//! Syn is a parsing library for parsing a stream of Rust tokens into a syntax
+//! tree of Rust source code.
+//!
+//! Currently this library is geared toward use in Rust procedural macros, but
+//! contains some APIs that may be useful more generally.
+//!
+//! - **Data structures** — Syn provides a complete syntax tree that can
+//!   represent any valid Rust source code. The syntax tree is rooted at
+//!   [`syn::File`] which represents a full source file, but there are other
+//!   entry points that may be useful to procedural macros including
+//!   [`syn::Item`], [`syn::Expr`] and [`syn::Type`].
+//!
+//! - **Derives** — Of particular interest to derive macros is
+//!   [`syn::DeriveInput`] which is any of the three legal input items to a
+//!   derive macro. An example below shows using this type in a library that can
+//!   derive implementations of a user-defined trait.
+//!
+//! - **Parsing** — Parsing in Syn is built around [parser functions] with the
+//!   signature `fn(ParseStream) -> Result<T>`. Every syntax tree node defined
+//!   by Syn is individually parsable and may be used as a building block for
+//!   custom syntaxes, or you may dream up your own brand new syntax without
+//!   involving any of our syntax tree types.
+//!
+//! - **Location information** — Every token parsed by Syn is associated with a
+//!   `Span` that tracks line and column information back to the source of that
+//!   token. These spans allow a procedural macro to display detailed error
+//!   messages pointing to all the right places in the user's code. There is an
+//!   example of this below.
+//!
+//! - **Feature flags** — Functionality is aggressively feature gated so your
+//!   procedural macros enable only what they need, and do not pay in compile
+//!   time for all the rest.
+//!
+//! [`syn::File`]: File
+//! [`syn::Item`]: Item
+//! [`syn::Expr`]: Expr
+//! [`syn::Type`]: Type
+//! [`syn::DeriveInput`]: DeriveInput
+//! [parser functions]: mod@parse
+//!
+//! <br>
+//!
+//! # Example of a derive macro
+//!
+//! The canonical derive macro using Syn looks like this. We write an ordinary
+//! Rust function tagged with a `proc_macro_derive` attribute and the name of
+//! the trait we are deriving. Any time that derive appears in the user's code,
+//! the Rust compiler passes their data structure as tokens into our macro. We
+//! get to execute arbitrary Rust code to figure out what to do with those
+//! tokens, then hand some tokens back to the compiler to compile into the
+//! user's crate.
+//!
+//! [`TokenStream`]: proc_macro::TokenStream
+//!
+//! ```toml
+//! [dependencies]
+//! syn = "2.0"
+//! quote = "1.0"
+//!
+//! [lib]
+//! proc-macro = true
+//! ```
+//!
+//! ```
+//! # extern crate proc_macro;
+//! #
+//! use proc_macro::TokenStream;
+//! use quote::quote;
+//! use syn::{parse_macro_input, DeriveInput};
+//!
+//! # const IGNORE_TOKENS: &str = stringify! {
+//! #[proc_macro_derive(MyMacro)]
+//! # };
+//! pub fn my_macro(input: TokenStream) -> TokenStream {
+//!     // Parse the input tokens into a syntax tree
+//!     let input = parse_macro_input!(input as DeriveInput);
+//!
+//!     // Build the output, possibly using quasi-quotation
+//!     let expanded = quote! {
+//!         // ...
+//!     };
+//!
+//!     // Hand the output tokens back to the compiler
+//!     TokenStream::from(expanded)
+//! }
+//! ```
+//!
+//! The [`heapsize`] example directory shows a complete working implementation
+//! of a derive macro. The example derives a `HeapSize` trait which computes an
+//! estimate of the amount of heap memory owned by a value.
+//!
+//! [`heapsize`]: https://github.com/dtolnay/syn/tree/master/examples/heapsize
+//!
+//! ```
+//! pub trait HeapSize {
+//!     /// Total number of bytes of heap memory owned by `self`.
+//!     fn heap_size_of_children(&self) -> usize;
+//! }
+//! ```
+//!
+//! The derive macro allows users to write `#[derive(HeapSize)]` on data
+//! structures in their program.
+//!
+//! ```
+//! # const IGNORE_TOKENS: &str = stringify! {
+//! #[derive(HeapSize)]
+//! # };
+//! struct Demo<'a, T: ?Sized> {
+//!     a: Box<T>,
+//!     b: u8,
+//!     c: &'a str,
+//!     d: String,
+//! }
+//! ```
+//!
+//! <p><br></p>
+//!
+//! # Spans and error reporting
+//!
+//! The token-based procedural macro API provides great control over where the
+//! compiler's error messages are displayed in user code. Consider the error the
+//! user sees if one of their field types does not implement `HeapSize`.
+//!
+//! ```
+//! # const IGNORE_TOKENS: &str = stringify! {
+//! #[derive(HeapSize)]
+//! # };
+//! struct Broken {
+//!     ok: String,
+//!     bad: std::thread::Thread,
+//! }
+//! ```
+//!
+//! By tracking span information all the way through the expansion of a
+//! procedural macro as shown in the `heapsize` example, token-based macros in
+//! Syn are able to trigger errors that directly pinpoint the source of the
+//! problem.
+//!
+//! ```text
+//! error[E0277]: the trait bound `std::thread::Thread: HeapSize` is not satisfied
+//!  --> src/main.rs:7:5
+//!   |
+//! 7 |     bad: std::thread::Thread,
+//!   |     ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HeapSize` is not implemented for `Thread`
+//! ```
+//!
+//! <br>
+//!
+//! # Parsing a custom syntax
+//!
+//! The [`lazy-static`] example directory shows the implementation of a
+//! `functionlike!(...)` procedural macro in which the input tokens are parsed
+//! using Syn's parsing API.
+//!
+//! [`lazy-static`]: https://github.com/dtolnay/syn/tree/master/examples/lazy-static
+//!
+//! The example reimplements the popular `lazy_static` crate from crates.io as a
+//! procedural macro.
+//!
+//! ```
+//! # macro_rules! lazy_static {
+//! #     ($($tt:tt)*) => {}
+//! # }
+//! #
+//! lazy_static! {
+//!     static ref USERNAME: Regex = Regex::new("^[a-z0-9_-]{3,16}$").unwrap();
+//! }
+//! ```
+//!
+//! The implementation shows how to trigger custom warnings and error messages
+//! on the macro input.
+//!
+//! ```text
+//! warning: come on, pick a more creative name
+//!   --> src/main.rs:10:16
+//!    |
+//! 10 |     static ref FOO: String = "lazy_static".to_owned();
+//!    |                ^^^
+//! ```
+//!
+//! <br>
+//!
+//! # Testing
+//!
+//! When testing macros, we often care not just that the macro can be used
+//! successfully but also that when the macro is provided with invalid input it
+//! produces maximally helpful error messages. Consider using the [`trybuild`]
+//! crate to write tests for errors that are emitted by your macro or errors
+//! detected by the Rust compiler in the expanded code following misuse of the
+//! macro. Such tests help avoid regressions from later refactors that
+//! mistakenly make an error no longer trigger or be less helpful than it used
+//! to be.
+//!
+//! [`trybuild`]: https://github.com/dtolnay/trybuild
+//!
+//! <br>
+//!
+//! # Debugging
+//!
+//! When developing a procedural macro it can be helpful to look at what the
+//! generated code looks like. Use `cargo rustc -- -Zunstable-options
+//! --pretty=expanded` or the [`cargo expand`] subcommand.
+//!
+//! [`cargo expand`]: https://github.com/dtolnay/cargo-expand
+//!
+//! To show the expanded code for some crate that uses your procedural macro,
+//! run `cargo expand` from that crate. To show the expanded code for one of
+//! your own test cases, run `cargo expand --test the_test_case` where the last
+//! argument is the name of the test file without the `.rs` extension.
+//!
+//! This write-up by Brandon W Maister discusses debugging in more detail:
+//! [Debugging Rust's new Custom Derive system][debugging].
+//!
+//! [debugging]: https://quodlibetor.github.io/posts/debugging-rusts-new-custom-derive-system/
+//!
+//! <br>
+//!
+//! # Optional features
+//!
+//! Syn puts a lot of functionality behind optional features in order to
+//! optimize compile time for the most common use cases. The following features
+//! are available.
+//!
+//! - **`derive`** *(enabled by default)* — Data structures for representing the
+//!   possible input to a derive macro, including structs and enums and types.
+//! - **`full`** — Data structures for representing the syntax tree of all valid
+//!   Rust source code, including items and expressions.
+//! - **`parsing`** *(enabled by default)* — Ability to parse input tokens into
+//!   a syntax tree node of a chosen type.
+//! - **`printing`** *(enabled by default)* — Ability to print a syntax tree
+//!   node as tokens of Rust source code.
+//! - **`visit`** — Trait for traversing a syntax tree.
+//! - **`visit-mut`** — Trait for traversing and mutating in place a syntax
+//!   tree.
+//! - **`fold`** — Trait for transforming an owned syntax tree.
+//! - **`clone-impls`** *(enabled by default)* — Clone impls for all syntax tree
+//!   types.
+//! - **`extra-traits`** — Debug, Eq, PartialEq, Hash impls for all syntax tree
+//!   types.
+//! - **`proc-macro`** *(enabled by default)* — Runtime dependency on the
+//!   dynamic library libproc_macro from rustc toolchain.
+
+// Syn types in rustdoc of other crates get linked to here.
+#![doc(html_root_url = "https://docs.rs/syn/2.0.71")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![deny(unsafe_op_in_unsafe_fn)]
+#![allow(non_camel_case_types)]
+#![cfg_attr(not(check_cfg), allow(unexpected_cfgs))]
+#![allow(
+    clippy::bool_to_int_with_if,
+    clippy::cast_lossless,
+    clippy::cast_possible_truncation,
+    clippy::cast_possible_wrap,
+    clippy::cast_ptr_alignment,
+    clippy::default_trait_access,
+    clippy::derivable_impls,
+    clippy::diverging_sub_expression,
+    clippy::doc_markdown,
+    clippy::expl_impl_clone_on_copy,
+    clippy::explicit_auto_deref,
+    clippy::if_not_else,
+    clippy::inherent_to_string,
+    clippy::into_iter_without_iter,
+    clippy::items_after_statements,
+    clippy::large_enum_variant,
+    clippy::let_underscore_untyped, // https://github.com/rust-lang/rust-clippy/issues/10410
+    clippy::manual_assert,
+    clippy::manual_let_else,
+    clippy::manual_map,
+    clippy::match_like_matches_macro,
+    clippy::match_on_vec_items,
+    clippy::match_same_arms,
+    clippy::match_wildcard_for_single_variants, // clippy bug: https://github.com/rust-lang/rust-clippy/issues/6984
+    clippy::missing_errors_doc,
+    clippy::missing_panics_doc,
+    clippy::module_name_repetitions,
+    clippy::must_use_candidate,
+    clippy::needless_doctest_main,
+    clippy::needless_pass_by_value,
+    clippy::needless_update,
+    clippy::never_loop,
+    clippy::range_plus_one,
+    clippy::redundant_else,
+    clippy::return_self_not_must_use,
+    clippy::similar_names,
+    clippy::single_match_else,
+    clippy::struct_excessive_bools,
+    clippy::too_many_arguments,
+    clippy::too_many_lines,
+    clippy::trivially_copy_pass_by_ref,
+    clippy::unconditional_recursion, // https://github.com/rust-lang/rust-clippy/issues/12133
+    clippy::uninhabited_references,
+    clippy::uninlined_format_args,
+    clippy::unnecessary_box_returns,
+    clippy::unnecessary_unwrap,
+    clippy::used_underscore_binding,
+    clippy::wildcard_imports,
+)]
+
+#[cfg(feature = "proc-macro")]
+extern crate proc_macro;
+
+#[macro_use]
+mod macros;
+
+#[cfg(feature = "parsing")]
+#[macro_use]
+mod group;
+
+#[macro_use]
+pub mod token;
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod attr;
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+pub use crate::attr::{AttrStyle, Attribute, Meta, MetaList, MetaNameValue};
+
+mod bigint;
+
+#[cfg(feature = "parsing")]
+#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+pub mod buffer;
+
+#[cfg(any(
+    all(feature = "parsing", feature = "full"),
+    all(feature = "printing", any(feature = "full", feature = "derive")),
+))]
+mod classify;
+
+mod custom_keyword;
+
+mod custom_punctuation;
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod data;
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+pub use crate::data::{Field, Fields, FieldsNamed, FieldsUnnamed, Variant};
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod derive;
+#[cfg(feature = "derive")]
+#[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
+pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
+
+mod drops;
+
+mod error;
+pub use crate::error::{Error, Result};
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod expr;
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub use crate::expr::{Arm, Label, RangeLimits};
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+pub use crate::expr::{
+    Expr, ExprBinary, ExprCall, ExprCast, ExprField, ExprIndex, ExprLit, ExprMacro, ExprMethodCall,
+    ExprParen, ExprPath, ExprReference, ExprStruct, ExprUnary, FieldValue, Index, Member,
+};
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub use crate::expr::{
+    ExprArray, ExprAssign, ExprAsync, ExprAwait, ExprBlock, ExprBreak, ExprClosure, ExprConst,
+    ExprContinue, ExprForLoop, ExprGroup, ExprIf, ExprInfer, ExprLet, ExprLoop, ExprMatch,
+    ExprRange, ExprRepeat, ExprReturn, ExprTry, ExprTryBlock, ExprTuple, ExprUnsafe, ExprWhile,
+    ExprYield,
+};
+
+#[cfg(feature = "parsing")]
+#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+pub mod ext;
+
+#[cfg(feature = "full")]
+mod file;
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub use crate::file::File;
+
+#[cfg(all(any(feature = "full", feature = "derive"), feature = "printing"))]
+mod fixup;
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod generics;
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+pub use crate::generics::{
+    BoundLifetimes, ConstParam, GenericParam, Generics, LifetimeParam, PredicateLifetime,
+    PredicateType, TraitBound, TraitBoundModifier, TypeParam, TypeParamBound, WhereClause,
+    WherePredicate,
+};
+#[cfg(all(any(feature = "full", feature = "derive"), feature = "printing"))]
+#[cfg_attr(
+    docsrs,
+    doc(cfg(all(any(feature = "full", feature = "derive"), feature = "printing")))
+)]
+pub use crate::generics::{ImplGenerics, Turbofish, TypeGenerics};
+
+mod ident;
+#[doc(inline)]
+pub use crate::ident::Ident;
+
+#[cfg(feature = "full")]
+mod item;
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub use crate::item::{
+    FnArg, ForeignItem, ForeignItemFn, ForeignItemMacro, ForeignItemStatic, ForeignItemType,
+    ImplItem, ImplItemConst, ImplItemFn, ImplItemMacro, ImplItemType, ImplRestriction, Item,
+    ItemConst, ItemEnum, ItemExternCrate, ItemFn, ItemForeignMod, ItemImpl, ItemMacro, ItemMod,
+    ItemStatic, ItemStruct, ItemTrait, ItemTraitAlias, ItemType, ItemUnion, ItemUse, Receiver,
+    Signature, StaticMutability, TraitItem, TraitItemConst, TraitItemFn, TraitItemMacro,
+    TraitItemType, UseGlob, UseGroup, UseName, UsePath, UseRename, UseTree, Variadic,
+};
+
+mod lifetime;
+#[doc(inline)]
+pub use crate::lifetime::Lifetime;
+
+mod lit;
+#[doc(hidden)] // https://github.com/dtolnay/syn/issues/1566
+pub use crate::lit::StrStyle;
+#[doc(inline)]
+pub use crate::lit::{
+    Lit, LitBool, LitByte, LitByteStr, LitCStr, LitChar, LitFloat, LitInt, LitStr,
+};
+
+#[cfg(feature = "parsing")]
+mod lookahead;
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod mac;
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+pub use crate::mac::{Macro, MacroDelimiter};
+
+#[cfg(all(feature = "parsing", any(feature = "full", feature = "derive")))]
+#[cfg_attr(
+    docsrs,
+    doc(cfg(all(feature = "parsing", any(feature = "full", feature = "derive"))))
+)]
+pub mod meta;
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod op;
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+pub use crate::op::{BinOp, UnOp};
+
+#[cfg(feature = "parsing")]
+#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+pub mod parse;
+
+#[cfg(all(feature = "parsing", feature = "proc-macro"))]
+mod parse_macro_input;
+
+#[cfg(all(feature = "parsing", feature = "printing"))]
+mod parse_quote;
+
+#[cfg(feature = "full")]
+mod pat;
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub use crate::pat::{
+    FieldPat, Pat, PatConst, PatIdent, PatLit, PatMacro, PatOr, PatParen, PatPath, PatRange,
+    PatReference, PatRest, PatSlice, PatStruct, PatTuple, PatTupleStruct, PatType, PatWild,
+};
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod path;
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+pub use crate::path::{
+    AngleBracketedGenericArguments, AssocConst, AssocType, Constraint, GenericArgument,
+    ParenthesizedGenericArguments, Path, PathArguments, PathSegment, QSelf,
+};
+
+#[cfg(all(
+    any(feature = "full", feature = "derive"),
+    any(feature = "parsing", feature = "printing")
+))]
+mod precedence;
+
+#[cfg(all(any(feature = "full", feature = "derive"), feature = "printing"))]
+mod print;
+
+pub mod punctuated;
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod restriction;
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+pub use crate::restriction::{FieldMutability, VisRestricted, Visibility};
+
+mod sealed;
+
+mod span;
+
+#[cfg(all(feature = "parsing", feature = "printing"))]
+#[cfg_attr(docsrs, doc(cfg(all(feature = "parsing", feature = "printing"))))]
+pub mod spanned;
+
+#[cfg(feature = "full")]
+mod stmt;
+#[cfg(feature = "full")]
+#[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+pub use crate::stmt::{Block, Local, LocalInit, Stmt, StmtMacro};
+
+mod thread;
+
+#[cfg(all(any(feature = "full", feature = "derive"), feature = "extra-traits"))]
+mod tt;
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod ty;
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+pub use crate::ty::{
+    Abi, BareFnArg, BareVariadic, ReturnType, Type, TypeArray, TypeBareFn, TypeGroup,
+    TypeImplTrait, TypeInfer, TypeMacro, TypeNever, TypeParen, TypePath, TypePtr, TypeReference,
+    TypeSlice, TypeTraitObject, TypeTuple,
+};
+
+#[cfg(all(any(feature = "full", feature = "derive"), feature = "parsing"))]
+mod verbatim;
+
+#[cfg(all(feature = "parsing", feature = "full"))]
+mod whitespace;
+
+#[rustfmt::skip] // https://github.com/rust-lang/rustfmt/issues/6176
+mod gen {
+    /// Syntax tree traversal to transform the nodes of an owned syntax tree.
+    ///
+    /// Each method of the [`Fold`] trait is a hook that can be overridden to
+    /// customize the behavior when transforming the corresponding type of node.
+    /// By default, every method recursively visits the substructure of the
+    /// input by invoking the right visitor method of each of its fields.
+    ///
+    /// [`Fold`]: fold::Fold
+    ///
+    /// ```
+    /// # use syn::{Attribute, BinOp, Expr, ExprBinary};
+    /// #
+    /// pub trait Fold {
+    ///     /* ... */
+    ///
+    ///     fn fold_expr_binary(&mut self, node: ExprBinary) -> ExprBinary {
+    ///         fold_expr_binary(self, node)
+    ///     }
+    ///
+    ///     /* ... */
+    ///     # fn fold_attribute(&mut self, node: Attribute) -> Attribute;
+    ///     # fn fold_expr(&mut self, node: Expr) -> Expr;
+    ///     # fn fold_bin_op(&mut self, node: BinOp) -> BinOp;
+    /// }
+    ///
+    /// pub fn fold_expr_binary<V>(v: &mut V, node: ExprBinary) -> ExprBinary
+    /// where
+    ///     V: Fold + ?Sized,
+    /// {
+    ///     ExprBinary {
+    ///         attrs: node
+    ///             .attrs
+    ///             .into_iter()
+    ///             .map(|attr| v.fold_attribute(attr))
+    ///             .collect(),
+    ///         left: Box::new(v.fold_expr(*node.left)),
+    ///         op: v.fold_bin_op(node.op),
+    ///         right: Box::new(v.fold_expr(*node.right)),
+    ///     }
+    /// }
+    ///
+    /// /* ... */
+    /// ```
+    ///
+    /// <br>
+    ///
+    /// # Example
+    ///
+    /// This fold inserts parentheses to fully parenthesizes any expression.
+    ///
+    /// ```
+    /// // [dependencies]
+    /// // quote = "1.0"
+    /// // syn = { version = "2.0", features = ["fold", "full"] }
+    ///
+    /// use quote::quote;
+    /// use syn::fold::{fold_expr, Fold};
+    /// use syn::{token, Expr, ExprParen};
+    ///
+    /// struct ParenthesizeEveryExpr;
+    ///
+    /// impl Fold for ParenthesizeEveryExpr {
+    ///     fn fold_expr(&mut self, expr: Expr) -> Expr {
+    ///         Expr::Paren(ExprParen {
+    ///             attrs: Vec::new(),
+    ///             expr: Box::new(fold_expr(self, expr)),
+    ///             paren_token: token::Paren::default(),
+    ///         })
+    ///     }
+    /// }
+    ///
+    /// fn main() {
+    ///     let code = quote! { a() + b(1) * c.d };
+    ///     let expr: Expr = syn::parse2(code).unwrap();
+    ///     let parenthesized = ParenthesizeEveryExpr.fold_expr(expr);
+    ///     println!("{}", quote!(#parenthesized));
+    ///
+    ///     // Output: (((a)()) + (((b)((1))) * ((c).d)))
+    /// }
+    /// ```
+    #[cfg(feature = "fold")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "fold")))]
+    #[rustfmt::skip]
+    pub mod fold;
+
+    /// Syntax tree traversal to walk a shared borrow of a syntax tree.
+    ///
+    /// Each method of the [`Visit`] trait is a hook that can be overridden to
+    /// customize the behavior when visiting the corresponding type of node. By
+    /// default, every method recursively visits the substructure of the input
+    /// by invoking the right visitor method of each of its fields.
+    ///
+    /// [`Visit`]: visit::Visit
+    ///
+    /// ```
+    /// # use syn::{Attribute, BinOp, Expr, ExprBinary};
+    /// #
+    /// pub trait Visit<'ast> {
+    ///     /* ... */
+    ///
+    ///     fn visit_expr_binary(&mut self, node: &'ast ExprBinary) {
+    ///         visit_expr_binary(self, node);
+    ///     }
+    ///
+    ///     /* ... */
+    ///     # fn visit_attribute(&mut self, node: &'ast Attribute);
+    ///     # fn visit_expr(&mut self, node: &'ast Expr);
+    ///     # fn visit_bin_op(&mut self, node: &'ast BinOp);
+    /// }
+    ///
+    /// pub fn visit_expr_binary<'ast, V>(v: &mut V, node: &'ast ExprBinary)
+    /// where
+    ///     V: Visit<'ast> + ?Sized,
+    /// {
+    ///     for attr in &node.attrs {
+    ///         v.visit_attribute(attr);
+    ///     }
+    ///     v.visit_expr(&*node.left);
+    ///     v.visit_bin_op(&node.op);
+    ///     v.visit_expr(&*node.right);
+    /// }
+    ///
+    /// /* ... */
+    /// ```
+    ///
+    /// <br>
+    ///
+    /// # Example
+    ///
+    /// This visitor will print the name of every freestanding function in the
+    /// syntax tree, including nested functions.
+    ///
+    /// ```
+    /// // [dependencies]
+    /// // quote = "1.0"
+    /// // syn = { version = "2.0", features = ["full", "visit"] }
+    ///
+    /// use quote::quote;
+    /// use syn::visit::{self, Visit};
+    /// use syn::{File, ItemFn};
+    ///
+    /// struct FnVisitor;
+    ///
+    /// impl<'ast> Visit<'ast> for FnVisitor {
+    ///     fn visit_item_fn(&mut self, node: &'ast ItemFn) {
+    ///         println!("Function with name={}", node.sig.ident);
+    ///
+    ///         // Delegate to the default impl to visit any nested functions.
+    ///         visit::visit_item_fn(self, node);
+    ///     }
+    /// }
+    ///
+    /// fn main() {
+    ///     let code = quote! {
+    ///         pub fn f() {
+    ///             fn g() {}
+    ///         }
+    ///     };
+    ///
+    ///     let syntax_tree: File = syn::parse2(code).unwrap();
+    ///     FnVisitor.visit_file(&syntax_tree);
+    /// }
+    /// ```
+    ///
+    /// The `'ast` lifetime on the input references means that the syntax tree
+    /// outlives the complete recursive visit call, so the visitor is allowed to
+    /// hold on to references into the syntax tree.
+    ///
+    /// ```
+    /// use quote::quote;
+    /// use syn::visit::{self, Visit};
+    /// use syn::{File, ItemFn};
+    ///
+    /// struct FnVisitor<'ast> {
+    ///     functions: Vec<&'ast ItemFn>,
+    /// }
+    ///
+    /// impl<'ast> Visit<'ast> for FnVisitor<'ast> {
+    ///     fn visit_item_fn(&mut self, node: &'ast ItemFn) {
+    ///         self.functions.push(node);
+    ///         visit::visit_item_fn(self, node);
+    ///     }
+    /// }
+    ///
+    /// fn main() {
+    ///     let code = quote! {
+    ///         pub fn f() {
+    ///             fn g() {}
+    ///         }
+    ///     };
+    ///
+    ///     let syntax_tree: File = syn::parse2(code).unwrap();
+    ///     let mut visitor = FnVisitor { functions: Vec::new() };
+    ///     visitor.visit_file(&syntax_tree);
+    ///     for f in visitor.functions {
+    ///         println!("Function with name={}", f.sig.ident);
+    ///     }
+    /// }
+    /// ```
+    #[cfg(feature = "visit")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "visit")))]
+    #[rustfmt::skip]
+    pub mod visit;
+
+    /// Syntax tree traversal to mutate an exclusive borrow of a syntax tree in
+    /// place.
+    ///
+    /// Each method of the [`VisitMut`] trait is a hook that can be overridden
+    /// to customize the behavior when mutating the corresponding type of node.
+    /// By default, every method recursively visits the substructure of the
+    /// input by invoking the right visitor method of each of its fields.
+    ///
+    /// [`VisitMut`]: visit_mut::VisitMut
+    ///
+    /// ```
+    /// # use syn::{Attribute, BinOp, Expr, ExprBinary};
+    /// #
+    /// pub trait VisitMut {
+    ///     /* ... */
+    ///
+    ///     fn visit_expr_binary_mut(&mut self, node: &mut ExprBinary) {
+    ///         visit_expr_binary_mut(self, node);
+    ///     }
+    ///
+    ///     /* ... */
+    ///     # fn visit_attribute_mut(&mut self, node: &mut Attribute);
+    ///     # fn visit_expr_mut(&mut self, node: &mut Expr);
+    ///     # fn visit_bin_op_mut(&mut self, node: &mut BinOp);
+    /// }
+    ///
+    /// pub fn visit_expr_binary_mut<V>(v: &mut V, node: &mut ExprBinary)
+    /// where
+    ///     V: VisitMut + ?Sized,
+    /// {
+    ///     for attr in &mut node.attrs {
+    ///         v.visit_attribute_mut(attr);
+    ///     }
+    ///     v.visit_expr_mut(&mut *node.left);
+    ///     v.visit_bin_op_mut(&mut node.op);
+    ///     v.visit_expr_mut(&mut *node.right);
+    /// }
+    ///
+    /// /* ... */
+    /// ```
+    ///
+    /// <br>
+    ///
+    /// # Example
+    ///
+    /// This mut visitor replace occurrences of u256 suffixed integer literals
+    /// like `999u256` with a macro invocation `bigint::u256!(999)`.
+    ///
+    /// ```
+    /// // [dependencies]
+    /// // quote = "1.0"
+    /// // syn = { version = "2.0", features = ["full", "visit-mut"] }
+    ///
+    /// use quote::quote;
+    /// use syn::visit_mut::{self, VisitMut};
+    /// use syn::{parse_quote, Expr, File, Lit, LitInt};
+    ///
+    /// struct BigintReplace;
+    ///
+    /// impl VisitMut for BigintReplace {
+    ///     fn visit_expr_mut(&mut self, node: &mut Expr) {
+    ///         if let Expr::Lit(expr) = &node {
+    ///             if let Lit::Int(int) = &expr.lit {
+    ///                 if int.suffix() == "u256" {
+    ///                     let digits = int.base10_digits();
+    ///                     let unsuffixed: LitInt = syn::parse_str(digits).unwrap();
+    ///                     *node = parse_quote!(bigint::u256!(#unsuffixed));
+    ///                     return;
+    ///                 }
+    ///             }
+    ///         }
+    ///
+    ///         // Delegate to the default impl to visit nested expressions.
+    ///         visit_mut::visit_expr_mut(self, node);
+    ///     }
+    /// }
+    ///
+    /// fn main() {
+    ///     let code = quote! {
+    ///         fn main() {
+    ///             let _ = 999u256;
+    ///         }
+    ///     };
+    ///
+    ///     let mut syntax_tree: File = syn::parse2(code).unwrap();
+    ///     BigintReplace.visit_file_mut(&mut syntax_tree);
+    ///     println!("{}", quote!(#syntax_tree));
+    /// }
+    /// ```
+    #[cfg(feature = "visit-mut")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "visit-mut")))]
+    #[rustfmt::skip]
+    pub mod visit_mut;
+
+    #[cfg(feature = "clone-impls")]
+    #[rustfmt::skip]
+    mod clone;
+
+    #[cfg(feature = "extra-traits")]
+    #[rustfmt::skip]
+    mod debug;
+
+    #[cfg(feature = "extra-traits")]
+    #[rustfmt::skip]
+    mod eq;
+
+    #[cfg(feature = "extra-traits")]
+    #[rustfmt::skip]
+    mod hash;
+}
+
+#[cfg(feature = "fold")]
+#[cfg_attr(docsrs, doc(cfg(feature = "fold")))]
+pub use crate::gen::fold;
+
+#[cfg(feature = "visit")]
+#[cfg_attr(docsrs, doc(cfg(feature = "visit")))]
+pub use crate::gen::visit;
+
+#[cfg(feature = "visit-mut")]
+#[cfg_attr(docsrs, doc(cfg(feature = "visit-mut")))]
+pub use crate::gen::visit_mut;
+
+// Not public API.
+#[doc(hidden)]
+#[path = "export.rs"]
+pub mod __private;
+
+/// Parse tokens of source code into the chosen syntax tree node.
+///
+/// This is preferred over parsing a string because tokens are able to preserve
+/// information about where in the user's code they were originally written (the
+/// "span" of the token), possibly allowing the compiler to produce better error
+/// messages.
+///
+/// This function parses a `proc_macro::TokenStream` which is the type used for
+/// interop with the compiler in a procedural macro. To parse a
+/// `proc_macro2::TokenStream`, use [`syn::parse2`] instead.
+///
+/// [`syn::parse2`]: parse2
+///
+/// # Examples
+///
+/// ```
+/// # extern crate proc_macro;
+/// #
+/// use proc_macro::TokenStream;
+/// use quote::quote;
+/// use syn::DeriveInput;
+///
+/// # const IGNORE_TOKENS: &str = stringify! {
+/// #[proc_macro_derive(MyMacro)]
+/// # };
+/// pub fn my_macro(input: TokenStream) -> TokenStream {
+///     // Parse the tokens into a syntax tree
+///     let ast: DeriveInput = syn::parse(input).unwrap();
+///
+///     // Build the output, possibly using quasi-quotation
+///     let expanded = quote! {
+///         /* ... */
+///     };
+///
+///     // Convert into a token stream and return it
+///     expanded.into()
+/// }
+/// ```
+#[cfg(all(feature = "parsing", feature = "proc-macro"))]
+#[cfg_attr(docsrs, doc(cfg(all(feature = "parsing", feature = "proc-macro"))))]
+pub fn parse<T: parse::Parse>(tokens: proc_macro::TokenStream) -> Result<T> {
+    parse::Parser::parse(T::parse, tokens)
+}
+
+/// Parse a proc-macro2 token stream into the chosen syntax tree node.
+///
+/// This function will check that the input is fully parsed. If there are
+/// any unparsed tokens at the end of the stream, an error is returned.
+///
+/// This function parses a `proc_macro2::TokenStream` which is commonly useful
+/// when the input comes from a node of the Syn syntax tree, for example the
+/// body tokens of a [`Macro`] node. When in a procedural macro parsing the
+/// `proc_macro::TokenStream` provided by the compiler, use [`syn::parse`]
+/// instead.
+///
+/// [`syn::parse`]: parse()
+#[cfg(feature = "parsing")]
+#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+pub fn parse2<T: parse::Parse>(tokens: proc_macro2::TokenStream) -> Result<T> {
+    parse::Parser::parse2(T::parse, tokens)
+}
+
+/// Parse a string of Rust code into the chosen syntax tree node.
+///
+/// # Hygiene
+///
+/// Every span in the resulting syntax tree will be set to resolve at the macro
+/// call site.
+///
+/// # Examples
+///
+/// ```
+/// use syn::{Expr, Result};
+///
+/// fn run() -> Result<()> {
+///     let code = "assert_eq!(u8::max_value(), 255)";
+///     let expr = syn::parse_str::<Expr>(code)?;
+///     println!("{:#?}", expr);
+///     Ok(())
+/// }
+/// #
+/// # run().unwrap();
+/// ```
+#[cfg(feature = "parsing")]
+#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+pub fn parse_str<T: parse::Parse>(s: &str) -> Result<T> {
+    parse::Parser::parse_str(T::parse, s)
+}
+
+/// Parse the content of a file of Rust code.
+///
+/// This is different from `syn::parse_str::<File>(content)` in two ways:
+///
+/// - It discards a leading byte order mark `\u{FEFF}` if the file has one.
+/// - It preserves the shebang line of the file, such as `#!/usr/bin/env rustx`.
+///
+/// If present, either of these would be an error using `from_str`.
+///
+/// # Examples
+///
+/// ```no_run
+/// use std::error::Error;
+/// use std::fs::File;
+/// use std::io::Read;
+///
+/// fn run() -> Result<(), Box<dyn Error>> {
+///     let mut file = File::open("path/to/code.rs")?;
+///     let mut content = String::new();
+///     file.read_to_string(&mut content)?;
+///
+///     let ast = syn::parse_file(&content)?;
+///     if let Some(shebang) = ast.shebang {
+///         println!("{}", shebang);
+///     }
+///     println!("{} items", ast.items.len());
+///
+///     Ok(())
+/// }
+/// #
+/// # run().unwrap();
+/// ```
+#[cfg(all(feature = "parsing", feature = "full"))]
+#[cfg_attr(docsrs, doc(cfg(all(feature = "parsing", feature = "full"))))]
+pub fn parse_file(mut content: &str) -> Result<File> {
+    // Strip the BOM if it is present
+    const BOM: &str = "\u{feff}";
+    if content.starts_with(BOM) {
+        content = &content[BOM.len()..];
+    }
+
+    let mut shebang = None;
+    if content.starts_with("#!") {
+        let rest = whitespace::skip(&content[2..]);
+        if !rest.starts_with('[') {
+            if let Some(idx) = content.find('\n') {
+                shebang = Some(content[..idx].to_string());
+                content = &content[idx..];
+            } else {
+                shebang = Some(content.to_string());
+                content = "";
+            }
+        }
+    }
+
+    let mut file: File = parse_str(content)?;
+    file.shebang = shebang;
+    Ok(file)
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/lifetime.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/lifetime.rs
--- 43.0.0-1/rust-vendor/syn/src/lifetime.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/lifetime.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,156 @@
+#[cfg(feature = "parsing")]
+use crate::lookahead;
+use proc_macro2::{Ident, Span};
+use std::cmp::Ordering;
+use std::fmt::{self, Display};
+use std::hash::{Hash, Hasher};
+
+/// A Rust lifetime: `'a`.
+///
+/// Lifetime names must conform to the following rules:
+///
+/// - Must start with an apostrophe.
+/// - Must not consist of just an apostrophe: `'`.
+/// - Character after the apostrophe must be `_` or a Unicode code point with
+///   the XID_Start property.
+/// - All following characters must be Unicode code points with the XID_Continue
+///   property.
+pub struct Lifetime {
+    pub apostrophe: Span,
+    pub ident: Ident,
+}
+
+impl Lifetime {
+    /// # Panics
+    ///
+    /// Panics if the lifetime does not conform to the bulleted rules above.
+    ///
+    /// # Invocation
+    ///
+    /// ```
+    /// # use proc_macro2::Span;
+    /// # use syn::Lifetime;
+    /// #
+    /// # fn f() -> Lifetime {
+    /// Lifetime::new("'a", Span::call_site())
+    /// # }
+    /// ```
+    pub fn new(symbol: &str, span: Span) -> Self {
+        if !symbol.starts_with('\'') {
+            panic!(
+                "lifetime name must start with apostrophe as in \"'a\", got {:?}",
+                symbol
+            );
+        }
+
+        if symbol == "'" {
+            panic!("lifetime name must not be empty");
+        }
+
+        if !crate::ident::xid_ok(&symbol[1..]) {
+            panic!("{:?} is not a valid lifetime name", symbol);
+        }
+
+        Lifetime {
+            apostrophe: span,
+            ident: Ident::new(&symbol[1..], span),
+        }
+    }
+
+    pub fn span(&self) -> Span {
+        self.apostrophe
+            .join(self.ident.span())
+            .unwrap_or(self.apostrophe)
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.apostrophe = span;
+        self.ident.set_span(span);
+    }
+}
+
+impl Display for Lifetime {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        "'".fmt(formatter)?;
+        self.ident.fmt(formatter)
+    }
+}
+
+impl Clone for Lifetime {
+    fn clone(&self) -> Self {
+        Lifetime {
+            apostrophe: self.apostrophe,
+            ident: self.ident.clone(),
+        }
+    }
+}
+
+impl PartialEq for Lifetime {
+    fn eq(&self, other: &Lifetime) -> bool {
+        self.ident.eq(&other.ident)
+    }
+}
+
+impl Eq for Lifetime {}
+
+impl PartialOrd for Lifetime {
+    fn partial_cmp(&self, other: &Lifetime) -> Option<Ordering> {
+        Some(self.cmp(other))
+    }
+}
+
+impl Ord for Lifetime {
+    fn cmp(&self, other: &Lifetime) -> Ordering {
+        self.ident.cmp(&other.ident)
+    }
+}
+
+impl Hash for Lifetime {
+    fn hash<H: Hasher>(&self, h: &mut H) {
+        self.ident.hash(h);
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub_if_not_doc! {
+    #[doc(hidden)]
+    #[allow(non_snake_case)]
+    pub fn Lifetime(marker: lookahead::TokenMarker) -> Lifetime {
+        match marker {}
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::error::Result;
+    use crate::lifetime::Lifetime;
+    use crate::parse::{Parse, ParseStream};
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Lifetime {
+        fn parse(input: ParseStream) -> Result<Self> {
+            input.step(|cursor| {
+                cursor
+                    .lifetime()
+                    .ok_or_else(|| cursor.error("expected lifetime"))
+            })
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::lifetime::Lifetime;
+    use proc_macro2::{Punct, Spacing, TokenStream};
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for Lifetime {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            let mut apostrophe = Punct::new('\'', Spacing::Joint);
+            apostrophe.set_span(self.apostrophe);
+            tokens.append(apostrophe);
+            self.ident.to_tokens(tokens);
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/lit.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/lit.rs
--- 43.0.0-1/rust-vendor/syn/src/lit.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/lit.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1869 @@
+#[cfg(feature = "parsing")]
+use crate::lookahead;
+#[cfg(feature = "parsing")]
+use crate::parse::{Parse, Parser};
+use crate::{Error, Result};
+use proc_macro2::{Ident, Literal, Span};
+#[cfg(feature = "parsing")]
+use proc_macro2::{TokenStream, TokenTree};
+use std::ffi::{CStr, CString};
+use std::fmt::{self, Display};
+#[cfg(feature = "extra-traits")]
+use std::hash::{Hash, Hasher};
+use std::str::{self, FromStr};
+
+ast_enum_of_structs! {
+    /// A Rust literal such as a string or integer or boolean.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[non_exhaustive]
+    pub enum Lit {
+        /// A UTF-8 string literal: `"foo"`.
+        Str(LitStr),
+
+        /// A byte string literal: `b"foo"`.
+        ByteStr(LitByteStr),
+
+        /// A nul-terminated C-string literal: `c"foo"`.
+        CStr(LitCStr),
+
+        /// A byte literal: `b'f'`.
+        Byte(LitByte),
+
+        /// A character literal: `'a'`.
+        Char(LitChar),
+
+        /// An integer literal: `1` or `1u16`.
+        Int(LitInt),
+
+        /// A floating point literal: `1f64` or `1.0e10f64`.
+        ///
+        /// Must be finite. May not be infinite or NaN.
+        Float(LitFloat),
+
+        /// A boolean literal: `true` or `false`.
+        Bool(LitBool),
+
+        /// A raw token literal not interpreted by Syn.
+        Verbatim(Literal),
+    }
+}
+
+ast_struct! {
+    /// A UTF-8 string literal: `"foo"`.
+    pub struct LitStr {
+        repr: Box<LitRepr>,
+    }
+}
+
+ast_struct! {
+    /// A byte string literal: `b"foo"`.
+    pub struct LitByteStr {
+        repr: Box<LitRepr>,
+    }
+}
+
+ast_struct! {
+    /// A nul-terminated C-string literal: `c"foo"`.
+    pub struct LitCStr {
+        repr: Box<LitRepr>,
+    }
+}
+
+ast_struct! {
+    /// A byte literal: `b'f'`.
+    pub struct LitByte {
+        repr: Box<LitRepr>,
+    }
+}
+
+ast_struct! {
+    /// A character literal: `'a'`.
+    pub struct LitChar {
+        repr: Box<LitRepr>,
+    }
+}
+
+struct LitRepr {
+    token: Literal,
+    suffix: Box<str>,
+}
+
+ast_struct! {
+    /// An integer literal: `1` or `1u16`.
+    pub struct LitInt {
+        repr: Box<LitIntRepr>,
+    }
+}
+
+struct LitIntRepr {
+    token: Literal,
+    digits: Box<str>,
+    suffix: Box<str>,
+}
+
+ast_struct! {
+    /// A floating point literal: `1f64` or `1.0e10f64`.
+    ///
+    /// Must be finite. May not be infinite or NaN.
+    pub struct LitFloat {
+        repr: Box<LitFloatRepr>,
+    }
+}
+
+struct LitFloatRepr {
+    token: Literal,
+    digits: Box<str>,
+    suffix: Box<str>,
+}
+
+ast_struct! {
+    /// A boolean literal: `true` or `false`.
+    pub struct LitBool {
+        pub value: bool,
+        pub span: Span,
+    }
+}
+
+impl LitStr {
+    pub fn new(value: &str, span: Span) -> Self {
+        let mut token = Literal::string(value);
+        token.set_span(span);
+        LitStr {
+            repr: Box::new(LitRepr {
+                token,
+                suffix: Box::<str>::default(),
+            }),
+        }
+    }
+
+    pub fn value(&self) -> String {
+        let repr = self.repr.token.to_string();
+        let (value, _suffix) = value::parse_lit_str(&repr);
+        String::from(value)
+    }
+
+    /// Parse a syntax tree node from the content of this string literal.
+    ///
+    /// All spans in the syntax tree will point to the span of this `LitStr`.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{Attribute, Error, Expr, Lit, Meta, Path, Result};
+    ///
+    /// // Parses the path from an attribute that looks like:
+    /// //
+    /// //     #[path = "a::b::c"]
+    /// //
+    /// // or returns `None` if the input is some other attribute.
+    /// fn get_path(attr: &Attribute) -> Result<Option<Path>> {
+    ///     if !attr.path().is_ident("path") {
+    ///         return Ok(None);
+    ///     }
+    ///
+    ///     if let Meta::NameValue(meta) = &attr.meta {
+    ///         if let Expr::Lit(expr) = &meta.value {
+    ///             if let Lit::Str(lit_str) = &expr.lit {
+    ///                 return lit_str.parse().map(Some);
+    ///             }
+    ///         }
+    ///     }
+    ///
+    ///     let message = "expected #[path = \"...\"]";
+    ///     Err(Error::new_spanned(attr, message))
+    /// }
+    /// ```
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    pub fn parse<T: Parse>(&self) -> Result<T> {
+        self.parse_with(T::parse)
+    }
+
+    /// Invoke parser on the content of this string literal.
+    ///
+    /// All spans in the syntax tree will point to the span of this `LitStr`.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// # use proc_macro2::Span;
+    /// # use syn::{LitStr, Result};
+    /// #
+    /// # fn main() -> Result<()> {
+    /// #     let lit_str = LitStr::new("a::b::c", Span::call_site());
+    /// #
+    /// #     const IGNORE: &str = stringify! {
+    /// let lit_str: LitStr = /* ... */;
+    /// #     };
+    ///
+    /// // Parse a string literal like "a::b::c" into a Path, not allowing
+    /// // generic arguments on any of the path segments.
+    /// let basic_path = lit_str.parse_with(syn::Path::parse_mod_style)?;
+    /// #
+    /// #     Ok(())
+    /// # }
+    /// ```
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    pub fn parse_with<F: Parser>(&self, parser: F) -> Result<F::Output> {
+        use proc_macro2::Group;
+
+        // Token stream with every span replaced by the given one.
+        fn respan_token_stream(stream: TokenStream, span: Span) -> TokenStream {
+            stream
+                .into_iter()
+                .map(|token| respan_token_tree(token, span))
+                .collect()
+        }
+
+        // Token tree with every span replaced by the given one.
+        fn respan_token_tree(mut token: TokenTree, span: Span) -> TokenTree {
+            match &mut token {
+                TokenTree::Group(g) => {
+                    let stream = respan_token_stream(g.stream(), span);
+                    *g = Group::new(g.delimiter(), stream);
+                    g.set_span(span);
+                }
+                other => other.set_span(span),
+            }
+            token
+        }
+
+        // Parse string literal into a token stream with every span equal to the
+        // original literal's span.
+        let span = self.span();
+        let mut tokens = TokenStream::from_str(&self.value())?;
+        tokens = respan_token_stream(tokens, span);
+
+        let result = crate::parse::parse_scoped(parser, span, tokens)?;
+
+        let suffix = self.suffix();
+        if !suffix.is_empty() {
+            return Err(Error::new(
+                self.span(),
+                format!("unexpected suffix `{}` on string literal", suffix),
+            ));
+        }
+
+        Ok(result)
+    }
+
+    pub fn span(&self) -> Span {
+        self.repr.token.span()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.repr.token.set_span(span);
+    }
+
+    pub fn suffix(&self) -> &str {
+        &self.repr.suffix
+    }
+
+    pub fn token(&self) -> Literal {
+        self.repr.token.clone()
+    }
+}
+
+impl LitByteStr {
+    pub fn new(value: &[u8], span: Span) -> Self {
+        let mut token = Literal::byte_string(value);
+        token.set_span(span);
+        LitByteStr {
+            repr: Box::new(LitRepr {
+                token,
+                suffix: Box::<str>::default(),
+            }),
+        }
+    }
+
+    pub fn value(&self) -> Vec<u8> {
+        let repr = self.repr.token.to_string();
+        let (value, _suffix) = value::parse_lit_byte_str(&repr);
+        value
+    }
+
+    pub fn span(&self) -> Span {
+        self.repr.token.span()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.repr.token.set_span(span);
+    }
+
+    pub fn suffix(&self) -> &str {
+        &self.repr.suffix
+    }
+
+    pub fn token(&self) -> Literal {
+        self.repr.token.clone()
+    }
+}
+
+impl LitCStr {
+    pub fn new(value: &CStr, span: Span) -> Self {
+        let mut token = Literal::c_string(value);
+        token.set_span(span);
+        LitCStr {
+            repr: Box::new(LitRepr {
+                token,
+                suffix: Box::<str>::default(),
+            }),
+        }
+    }
+
+    pub fn value(&self) -> CString {
+        let repr = self.repr.token.to_string();
+        let (value, _suffix) = value::parse_lit_c_str(&repr);
+        value
+    }
+
+    pub fn span(&self) -> Span {
+        self.repr.token.span()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.repr.token.set_span(span);
+    }
+
+    pub fn suffix(&self) -> &str {
+        &self.repr.suffix
+    }
+
+    pub fn token(&self) -> Literal {
+        self.repr.token.clone()
+    }
+}
+
+impl LitByte {
+    pub fn new(value: u8, span: Span) -> Self {
+        let mut token = Literal::u8_suffixed(value);
+        token.set_span(span);
+        LitByte {
+            repr: Box::new(LitRepr {
+                token,
+                suffix: Box::<str>::default(),
+            }),
+        }
+    }
+
+    pub fn value(&self) -> u8 {
+        let repr = self.repr.token.to_string();
+        let (value, _suffix) = value::parse_lit_byte(&repr);
+        value
+    }
+
+    pub fn span(&self) -> Span {
+        self.repr.token.span()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.repr.token.set_span(span);
+    }
+
+    pub fn suffix(&self) -> &str {
+        &self.repr.suffix
+    }
+
+    pub fn token(&self) -> Literal {
+        self.repr.token.clone()
+    }
+}
+
+impl LitChar {
+    pub fn new(value: char, span: Span) -> Self {
+        let mut token = Literal::character(value);
+        token.set_span(span);
+        LitChar {
+            repr: Box::new(LitRepr {
+                token,
+                suffix: Box::<str>::default(),
+            }),
+        }
+    }
+
+    pub fn value(&self) -> char {
+        let repr = self.repr.token.to_string();
+        let (value, _suffix) = value::parse_lit_char(&repr);
+        value
+    }
+
+    pub fn span(&self) -> Span {
+        self.repr.token.span()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.repr.token.set_span(span);
+    }
+
+    pub fn suffix(&self) -> &str {
+        &self.repr.suffix
+    }
+
+    pub fn token(&self) -> Literal {
+        self.repr.token.clone()
+    }
+}
+
+impl LitInt {
+    pub fn new(repr: &str, span: Span) -> Self {
+        let (digits, suffix) = match value::parse_lit_int(repr) {
+            Some(parse) => parse,
+            None => panic!("not an integer literal: `{}`", repr),
+        };
+
+        let mut token: Literal = repr.parse().unwrap();
+        token.set_span(span);
+        LitInt {
+            repr: Box::new(LitIntRepr {
+                token,
+                digits,
+                suffix,
+            }),
+        }
+    }
+
+    pub fn base10_digits(&self) -> &str {
+        &self.repr.digits
+    }
+
+    /// Parses the literal into a selected number type.
+    ///
+    /// This is equivalent to `lit.base10_digits().parse()` except that the
+    /// resulting errors will be correctly spanned to point to the literal token
+    /// in the macro input.
+    ///
+    /// ```
+    /// use syn::LitInt;
+    /// use syn::parse::{Parse, ParseStream, Result};
+    ///
+    /// struct Port {
+    ///     value: u16,
+    /// }
+    ///
+    /// impl Parse for Port {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let lit: LitInt = input.parse()?;
+    ///         let value = lit.base10_parse::<u16>()?;
+    ///         Ok(Port { value })
+    ///     }
+    /// }
+    /// ```
+    pub fn base10_parse<N>(&self) -> Result<N>
+    where
+        N: FromStr,
+        N::Err: Display,
+    {
+        self.base10_digits()
+            .parse()
+            .map_err(|err| Error::new(self.span(), err))
+    }
+
+    pub fn suffix(&self) -> &str {
+        &self.repr.suffix
+    }
+
+    pub fn span(&self) -> Span {
+        self.repr.token.span()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.repr.token.set_span(span);
+    }
+
+    pub fn token(&self) -> Literal {
+        self.repr.token.clone()
+    }
+}
+
+impl From<Literal> for LitInt {
+    fn from(token: Literal) -> Self {
+        let repr = token.to_string();
+        if let Some((digits, suffix)) = value::parse_lit_int(&repr) {
+            LitInt {
+                repr: Box::new(LitIntRepr {
+                    token,
+                    digits,
+                    suffix,
+                }),
+            }
+        } else {
+            panic!("not an integer literal: `{}`", repr);
+        }
+    }
+}
+
+impl Display for LitInt {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.repr.token.fmt(formatter)
+    }
+}
+
+impl LitFloat {
+    pub fn new(repr: &str, span: Span) -> Self {
+        let (digits, suffix) = match value::parse_lit_float(repr) {
+            Some(parse) => parse,
+            None => panic!("not a float literal: `{}`", repr),
+        };
+
+        let mut token: Literal = repr.parse().unwrap();
+        token.set_span(span);
+        LitFloat {
+            repr: Box::new(LitFloatRepr {
+                token,
+                digits,
+                suffix,
+            }),
+        }
+    }
+
+    pub fn base10_digits(&self) -> &str {
+        &self.repr.digits
+    }
+
+    pub fn base10_parse<N>(&self) -> Result<N>
+    where
+        N: FromStr,
+        N::Err: Display,
+    {
+        self.base10_digits()
+            .parse()
+            .map_err(|err| Error::new(self.span(), err))
+    }
+
+    pub fn suffix(&self) -> &str {
+        &self.repr.suffix
+    }
+
+    pub fn span(&self) -> Span {
+        self.repr.token.span()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.repr.token.set_span(span);
+    }
+
+    pub fn token(&self) -> Literal {
+        self.repr.token.clone()
+    }
+}
+
+impl From<Literal> for LitFloat {
+    fn from(token: Literal) -> Self {
+        let repr = token.to_string();
+        if let Some((digits, suffix)) = value::parse_lit_float(&repr) {
+            LitFloat {
+                repr: Box::new(LitFloatRepr {
+                    token,
+                    digits,
+                    suffix,
+                }),
+            }
+        } else {
+            panic!("not a float literal: `{}`", repr);
+        }
+    }
+}
+
+impl Display for LitFloat {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.repr.token.fmt(formatter)
+    }
+}
+
+impl LitBool {
+    pub fn new(value: bool, span: Span) -> Self {
+        LitBool { value, span }
+    }
+
+    pub fn value(&self) -> bool {
+        self.value
+    }
+
+    pub fn span(&self) -> Span {
+        self.span
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.span = span;
+    }
+
+    pub fn token(&self) -> Ident {
+        let s = if self.value { "true" } else { "false" };
+        Ident::new(s, self.span)
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+mod debug_impls {
+    use crate::lit::{LitBool, LitByte, LitByteStr, LitCStr, LitChar, LitFloat, LitInt, LitStr};
+    use std::fmt::{self, Debug};
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+    impl Debug for LitStr {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            self.debug(formatter, "LitStr")
+        }
+    }
+
+    impl LitStr {
+        pub(crate) fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+            formatter
+                .debug_struct(name)
+                .field("token", &format_args!("{}", self.repr.token))
+                .finish()
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+    impl Debug for LitByteStr {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            self.debug(formatter, "LitByteStr")
+        }
+    }
+
+    impl LitByteStr {
+        pub(crate) fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+            formatter
+                .debug_struct(name)
+                .field("token", &format_args!("{}", self.repr.token))
+                .finish()
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+    impl Debug for LitCStr {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            self.debug(formatter, "LitCStr")
+        }
+    }
+
+    impl LitCStr {
+        pub(crate) fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+            formatter
+                .debug_struct(name)
+                .field("token", &format_args!("{}", self.repr.token))
+                .finish()
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+    impl Debug for LitByte {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            self.debug(formatter, "LitByte")
+        }
+    }
+
+    impl LitByte {
+        pub(crate) fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+            formatter
+                .debug_struct(name)
+                .field("token", &format_args!("{}", self.repr.token))
+                .finish()
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+    impl Debug for LitChar {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            self.debug(formatter, "LitChar")
+        }
+    }
+
+    impl LitChar {
+        pub(crate) fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+            formatter
+                .debug_struct(name)
+                .field("token", &format_args!("{}", self.repr.token))
+                .finish()
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+    impl Debug for LitInt {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            self.debug(formatter, "LitInt")
+        }
+    }
+
+    impl LitInt {
+        pub(crate) fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+            formatter
+                .debug_struct(name)
+                .field("token", &format_args!("{}", self.repr.token))
+                .finish()
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+    impl Debug for LitFloat {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            self.debug(formatter, "LitFloat")
+        }
+    }
+
+    impl LitFloat {
+        pub(crate) fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+            formatter
+                .debug_struct(name)
+                .field("token", &format_args!("{}", self.repr.token))
+                .finish()
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+    impl Debug for LitBool {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            self.debug(formatter, "LitBool")
+        }
+    }
+
+    impl LitBool {
+        pub(crate) fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+            formatter
+                .debug_struct(name)
+                .field("value", &self.value)
+                .finish()
+        }
+    }
+}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for LitRepr {
+    fn clone(&self) -> Self {
+        LitRepr {
+            token: self.token.clone(),
+            suffix: self.suffix.clone(),
+        }
+    }
+}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for LitIntRepr {
+    fn clone(&self) -> Self {
+        LitIntRepr {
+            token: self.token.clone(),
+            digits: self.digits.clone(),
+            suffix: self.suffix.clone(),
+        }
+    }
+}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for LitFloatRepr {
+    fn clone(&self) -> Self {
+        LitFloatRepr {
+            token: self.token.clone(),
+            digits: self.digits.clone(),
+            suffix: self.suffix.clone(),
+        }
+    }
+}
+
+macro_rules! lit_extra_traits {
+    ($ty:ident) => {
+        #[cfg(feature = "clone-impls")]
+        #[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+        impl Clone for $ty {
+            fn clone(&self) -> Self {
+                $ty {
+                    repr: self.repr.clone(),
+                }
+            }
+        }
+
+        #[cfg(feature = "extra-traits")]
+        #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+        impl PartialEq for $ty {
+            fn eq(&self, other: &Self) -> bool {
+                self.repr.token.to_string() == other.repr.token.to_string()
+            }
+        }
+
+        #[cfg(feature = "extra-traits")]
+        #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+        impl Hash for $ty {
+            fn hash<H>(&self, state: &mut H)
+            where
+                H: Hasher,
+            {
+                self.repr.token.to_string().hash(state);
+            }
+        }
+
+        #[cfg(feature = "parsing")]
+        pub_if_not_doc! {
+            #[doc(hidden)]
+            #[allow(non_snake_case)]
+            pub fn $ty(marker: lookahead::TokenMarker) -> $ty {
+                match marker {}
+            }
+        }
+    };
+}
+
+lit_extra_traits!(LitStr);
+lit_extra_traits!(LitByteStr);
+lit_extra_traits!(LitCStr);
+lit_extra_traits!(LitByte);
+lit_extra_traits!(LitChar);
+lit_extra_traits!(LitInt);
+lit_extra_traits!(LitFloat);
+
+#[cfg(feature = "parsing")]
+pub_if_not_doc! {
+    #[doc(hidden)]
+    #[allow(non_snake_case)]
+    pub fn LitBool(marker: lookahead::TokenMarker) -> LitBool {
+        match marker {}
+    }
+}
+
+/// The style of a string literal, either plain quoted or a raw string like
+/// `r##"data"##`.
+#[doc(hidden)] // https://github.com/dtolnay/syn/issues/1566
+pub enum StrStyle {
+    /// An ordinary string like `"data"`.
+    Cooked,
+    /// A raw string like `r##"data"##`.
+    ///
+    /// The unsigned integer is the number of `#` symbols used.
+    Raw(usize),
+}
+
+#[cfg(feature = "parsing")]
+pub_if_not_doc! {
+    #[doc(hidden)]
+    #[allow(non_snake_case)]
+    pub fn Lit(marker: lookahead::TokenMarker) -> Lit {
+        match marker {}
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::buffer::Cursor;
+    use crate::error::Result;
+    use crate::lit::{
+        value, Lit, LitBool, LitByte, LitByteStr, LitCStr, LitChar, LitFloat, LitFloatRepr, LitInt,
+        LitIntRepr, LitStr,
+    };
+    use crate::parse::{Parse, ParseStream, Unexpected};
+    use crate::token::{self, Token};
+    use proc_macro2::{Literal, Punct, Span};
+    use std::cell::Cell;
+    use std::rc::Rc;
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Lit {
+        fn parse(input: ParseStream) -> Result<Self> {
+            input.step(|cursor| {
+                if let Some((lit, rest)) = cursor.literal() {
+                    return Ok((Lit::new(lit), rest));
+                }
+
+                if let Some((ident, rest)) = cursor.ident() {
+                    let value = ident == "true";
+                    if value || ident == "false" {
+                        let lit_bool = LitBool {
+                            value,
+                            span: ident.span(),
+                        };
+                        return Ok((Lit::Bool(lit_bool), rest));
+                    }
+                }
+
+                if let Some((punct, rest)) = cursor.punct() {
+                    if punct.as_char() == '-' {
+                        if let Some((lit, rest)) = parse_negative_lit(punct, rest) {
+                            return Ok((lit, rest));
+                        }
+                    }
+                }
+
+                Err(cursor.error("expected literal"))
+            })
+        }
+    }
+
+    fn parse_negative_lit(neg: Punct, cursor: Cursor) -> Option<(Lit, Cursor)> {
+        let (lit, rest) = cursor.literal()?;
+
+        let mut span = neg.span();
+        span = span.join(lit.span()).unwrap_or(span);
+
+        let mut repr = lit.to_string();
+        repr.insert(0, '-');
+
+        if let Some((digits, suffix)) = value::parse_lit_int(&repr) {
+            let mut token: Literal = repr.parse().unwrap();
+            token.set_span(span);
+            return Some((
+                Lit::Int(LitInt {
+                    repr: Box::new(LitIntRepr {
+                        token,
+                        digits,
+                        suffix,
+                    }),
+                }),
+                rest,
+            ));
+        }
+
+        let (digits, suffix) = value::parse_lit_float(&repr)?;
+        let mut token: Literal = repr.parse().unwrap();
+        token.set_span(span);
+        Some((
+            Lit::Float(LitFloat {
+                repr: Box::new(LitFloatRepr {
+                    token,
+                    digits,
+                    suffix,
+                }),
+            }),
+            rest,
+        ))
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for LitStr {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse() {
+                Ok(Lit::Str(lit)) => Ok(lit),
+                _ => Err(head.error("expected string literal")),
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for LitByteStr {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse() {
+                Ok(Lit::ByteStr(lit)) => Ok(lit),
+                _ => Err(head.error("expected byte string literal")),
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for LitCStr {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse() {
+                Ok(Lit::CStr(lit)) => Ok(lit),
+                _ => Err(head.error("expected C string literal")),
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for LitByte {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse() {
+                Ok(Lit::Byte(lit)) => Ok(lit),
+                _ => Err(head.error("expected byte literal")),
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for LitChar {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse() {
+                Ok(Lit::Char(lit)) => Ok(lit),
+                _ => Err(head.error("expected character literal")),
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for LitInt {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse() {
+                Ok(Lit::Int(lit)) => Ok(lit),
+                _ => Err(head.error("expected integer literal")),
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for LitFloat {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse() {
+                Ok(Lit::Float(lit)) => Ok(lit),
+                _ => Err(head.error("expected floating point literal")),
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for LitBool {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse() {
+                Ok(Lit::Bool(lit)) => Ok(lit),
+                _ => Err(head.error("expected boolean literal")),
+            }
+        }
+    }
+
+    fn peek_impl(cursor: Cursor, peek: fn(ParseStream) -> bool) -> bool {
+        let scope = Span::call_site();
+        let unexpected = Rc::new(Cell::new(Unexpected::None));
+        let buffer = crate::parse::new_parse_buffer(scope, cursor, unexpected);
+        peek(&buffer)
+    }
+
+    macro_rules! impl_token {
+        ($display:literal $name:ty) => {
+            impl Token for $name {
+                fn peek(cursor: Cursor) -> bool {
+                    fn peek(input: ParseStream) -> bool {
+                        <$name as Parse>::parse(input).is_ok()
+                    }
+                    peek_impl(cursor, peek)
+                }
+
+                fn display() -> &'static str {
+                    $display
+                }
+            }
+
+            impl token::private::Sealed for $name {}
+        };
+    }
+
+    impl_token!("literal" Lit);
+    impl_token!("string literal" LitStr);
+    impl_token!("byte string literal" LitByteStr);
+    impl_token!("C-string literal" LitCStr);
+    impl_token!("byte literal" LitByte);
+    impl_token!("character literal" LitChar);
+    impl_token!("integer literal" LitInt);
+    impl_token!("floating point literal" LitFloat);
+    impl_token!("boolean literal" LitBool);
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::lit::{LitBool, LitByte, LitByteStr, LitCStr, LitChar, LitFloat, LitInt, LitStr};
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for LitStr {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.repr.token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for LitByteStr {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.repr.token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for LitCStr {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.repr.token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for LitByte {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.repr.token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for LitChar {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.repr.token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for LitInt {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.repr.token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for LitFloat {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.repr.token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for LitBool {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append(self.token());
+        }
+    }
+}
+
+mod value {
+    use crate::bigint::BigInt;
+    use crate::lit::{
+        Lit, LitBool, LitByte, LitByteStr, LitCStr, LitChar, LitFloat, LitFloatRepr, LitInt,
+        LitIntRepr, LitRepr, LitStr,
+    };
+    use proc_macro2::{Literal, Span};
+    use std::ascii;
+    use std::char;
+    use std::ffi::CString;
+    use std::ops::{Index, RangeFrom};
+
+    impl Lit {
+        /// Interpret a Syn literal from a proc-macro2 literal.
+        pub fn new(token: Literal) -> Self {
+            let repr = token.to_string();
+
+            match byte(&repr, 0) {
+                // "...", r"...", r#"..."#
+                b'"' | b'r' => {
+                    let (_, suffix) = parse_lit_str(&repr);
+                    return Lit::Str(LitStr {
+                        repr: Box::new(LitRepr { token, suffix }),
+                    });
+                }
+                b'b' => match byte(&repr, 1) {
+                    // b"...", br"...", br#"...#"
+                    b'"' | b'r' => {
+                        let (_, suffix) = parse_lit_byte_str(&repr);
+                        return Lit::ByteStr(LitByteStr {
+                            repr: Box::new(LitRepr { token, suffix }),
+                        });
+                    }
+                    // b'...'
+                    b'\'' => {
+                        let (_, suffix) = parse_lit_byte(&repr);
+                        return Lit::Byte(LitByte {
+                            repr: Box::new(LitRepr { token, suffix }),
+                        });
+                    }
+                    _ => {}
+                },
+                // c"...", cr"...", cr#"..."#
+                b'c' => {
+                    let (_, suffix) = parse_lit_c_str(&repr);
+                    return Lit::CStr(LitCStr {
+                        repr: Box::new(LitRepr { token, suffix }),
+                    });
+                }
+                // '...'
+                b'\'' => {
+                    let (_, suffix) = parse_lit_char(&repr);
+                    return Lit::Char(LitChar {
+                        repr: Box::new(LitRepr { token, suffix }),
+                    });
+                }
+                b'0'..=b'9' | b'-' => {
+                    // 0, 123, 0xFF, 0o77, 0b11
+                    if let Some((digits, suffix)) = parse_lit_int(&repr) {
+                        return Lit::Int(LitInt {
+                            repr: Box::new(LitIntRepr {
+                                token,
+                                digits,
+                                suffix,
+                            }),
+                        });
+                    }
+                    // 1.0, 1e-1, 1e+1
+                    if let Some((digits, suffix)) = parse_lit_float(&repr) {
+                        return Lit::Float(LitFloat {
+                            repr: Box::new(LitFloatRepr {
+                                token,
+                                digits,
+                                suffix,
+                            }),
+                        });
+                    }
+                }
+                // true, false
+                b't' | b'f' => {
+                    if repr == "true" || repr == "false" {
+                        return Lit::Bool(LitBool {
+                            value: repr == "true",
+                            span: token.span(),
+                        });
+                    }
+                }
+                b'(' if repr == "(/*ERROR*/)" => return Lit::Verbatim(token),
+                _ => {}
+            }
+
+            panic!("unrecognized literal: `{}`", repr);
+        }
+
+        pub fn suffix(&self) -> &str {
+            match self {
+                Lit::Str(lit) => lit.suffix(),
+                Lit::ByteStr(lit) => lit.suffix(),
+                Lit::CStr(lit) => lit.suffix(),
+                Lit::Byte(lit) => lit.suffix(),
+                Lit::Char(lit) => lit.suffix(),
+                Lit::Int(lit) => lit.suffix(),
+                Lit::Float(lit) => lit.suffix(),
+                Lit::Bool(_) | Lit::Verbatim(_) => "",
+            }
+        }
+
+        pub fn span(&self) -> Span {
+            match self {
+                Lit::Str(lit) => lit.span(),
+                Lit::ByteStr(lit) => lit.span(),
+                Lit::CStr(lit) => lit.span(),
+                Lit::Byte(lit) => lit.span(),
+                Lit::Char(lit) => lit.span(),
+                Lit::Int(lit) => lit.span(),
+                Lit::Float(lit) => lit.span(),
+                Lit::Bool(lit) => lit.span,
+                Lit::Verbatim(lit) => lit.span(),
+            }
+        }
+
+        pub fn set_span(&mut self, span: Span) {
+            match self {
+                Lit::Str(lit) => lit.set_span(span),
+                Lit::ByteStr(lit) => lit.set_span(span),
+                Lit::CStr(lit) => lit.set_span(span),
+                Lit::Byte(lit) => lit.set_span(span),
+                Lit::Char(lit) => lit.set_span(span),
+                Lit::Int(lit) => lit.set_span(span),
+                Lit::Float(lit) => lit.set_span(span),
+                Lit::Bool(lit) => lit.span = span,
+                Lit::Verbatim(lit) => lit.set_span(span),
+            }
+        }
+    }
+
+    /// Get the byte at offset idx, or a default of `b'\0'` if we're looking
+    /// past the end of the input buffer.
+    pub(crate) fn byte<S: AsRef<[u8]> + ?Sized>(s: &S, idx: usize) -> u8 {
+        let s = s.as_ref();
+        if idx < s.len() {
+            s[idx]
+        } else {
+            0
+        }
+    }
+
+    fn next_chr(s: &str) -> char {
+        s.chars().next().unwrap_or('\0')
+    }
+
+    // Returns (content, suffix).
+    pub(crate) fn parse_lit_str(s: &str) -> (Box<str>, Box<str>) {
+        match byte(s, 0) {
+            b'"' => parse_lit_str_cooked(s),
+            b'r' => parse_lit_str_raw(s),
+            _ => unreachable!(),
+        }
+    }
+
+    // Clippy false positive
+    // https://github.com/rust-lang-nursery/rust-clippy/issues/2329
+    #[allow(clippy::needless_continue)]
+    fn parse_lit_str_cooked(mut s: &str) -> (Box<str>, Box<str>) {
+        assert_eq!(byte(s, 0), b'"');
+        s = &s[1..];
+
+        let mut content = String::new();
+        'outer: loop {
+            let ch = match byte(s, 0) {
+                b'"' => break,
+                b'\\' => {
+                    let b = byte(s, 1);
+                    s = &s[2..];
+                    match b {
+                        b'x' => {
+                            let (byte, rest) = backslash_x(s);
+                            s = rest;
+                            assert!(byte <= 0x7F, "invalid \\x byte in string literal");
+                            char::from_u32(u32::from(byte)).unwrap()
+                        }
+                        b'u' => {
+                            let (ch, rest) = backslash_u(s);
+                            s = rest;
+                            ch
+                        }
+                        b'n' => '\n',
+                        b'r' => '\r',
+                        b't' => '\t',
+                        b'\\' => '\\',
+                        b'0' => '\0',
+                        b'\'' => '\'',
+                        b'"' => '"',
+                        b'\r' | b'\n' => loop {
+                            let b = byte(s, 0);
+                            match b {
+                                b' ' | b'\t' | b'\n' | b'\r' => s = &s[1..],
+                                _ => continue 'outer,
+                            }
+                        },
+                        b => panic!(
+                            "unexpected byte '{}' after \\ character in string literal",
+                            ascii::escape_default(b),
+                        ),
+                    }
+                }
+                b'\r' => {
+                    assert_eq!(byte(s, 1), b'\n', "bare CR not allowed in string");
+                    s = &s[2..];
+                    '\n'
+                }
+                _ => {
+                    let ch = next_chr(s);
+                    s = &s[ch.len_utf8()..];
+                    ch
+                }
+            };
+            content.push(ch);
+        }
+
+        assert!(s.starts_with('"'));
+        let content = content.into_boxed_str();
+        let suffix = s[1..].to_owned().into_boxed_str();
+        (content, suffix)
+    }
+
+    fn parse_lit_str_raw(mut s: &str) -> (Box<str>, Box<str>) {
+        assert_eq!(byte(s, 0), b'r');
+        s = &s[1..];
+
+        let mut pounds = 0;
+        while byte(s, pounds) == b'#' {
+            pounds += 1;
+        }
+        assert_eq!(byte(s, pounds), b'"');
+        let close = s.rfind('"').unwrap();
+        for end in s[close + 1..close + 1 + pounds].bytes() {
+            assert_eq!(end, b'#');
+        }
+
+        let content = s[pounds + 1..close].to_owned().into_boxed_str();
+        let suffix = s[close + 1 + pounds..].to_owned().into_boxed_str();
+        (content, suffix)
+    }
+
+    // Returns (content, suffix).
+    pub(crate) fn parse_lit_byte_str(s: &str) -> (Vec<u8>, Box<str>) {
+        assert_eq!(byte(s, 0), b'b');
+        match byte(s, 1) {
+            b'"' => parse_lit_byte_str_cooked(s),
+            b'r' => parse_lit_byte_str_raw(s),
+            _ => unreachable!(),
+        }
+    }
+
+    // Clippy false positive
+    // https://github.com/rust-lang-nursery/rust-clippy/issues/2329
+    #[allow(clippy::needless_continue)]
+    fn parse_lit_byte_str_cooked(mut s: &str) -> (Vec<u8>, Box<str>) {
+        assert_eq!(byte(s, 0), b'b');
+        assert_eq!(byte(s, 1), b'"');
+        s = &s[2..];
+
+        // We're going to want to have slices which don't respect codepoint boundaries.
+        let mut v = s.as_bytes();
+
+        let mut out = Vec::new();
+        'outer: loop {
+            let byte = match byte(v, 0) {
+                b'"' => break,
+                b'\\' => {
+                    let b = byte(v, 1);
+                    v = &v[2..];
+                    match b {
+                        b'x' => {
+                            let (b, rest) = backslash_x(v);
+                            v = rest;
+                            b
+                        }
+                        b'n' => b'\n',
+                        b'r' => b'\r',
+                        b't' => b'\t',
+                        b'\\' => b'\\',
+                        b'0' => b'\0',
+                        b'\'' => b'\'',
+                        b'"' => b'"',
+                        b'\r' | b'\n' => loop {
+                            let byte = byte(v, 0);
+                            if matches!(byte, b' ' | b'\t' | b'\n' | b'\r') {
+                                v = &v[1..];
+                            } else {
+                                continue 'outer;
+                            }
+                        },
+                        b => panic!(
+                            "unexpected byte '{}' after \\ character in byte-string literal",
+                            ascii::escape_default(b),
+                        ),
+                    }
+                }
+                b'\r' => {
+                    assert_eq!(byte(v, 1), b'\n', "bare CR not allowed in string");
+                    v = &v[2..];
+                    b'\n'
+                }
+                b => {
+                    v = &v[1..];
+                    b
+                }
+            };
+            out.push(byte);
+        }
+
+        assert_eq!(byte(v, 0), b'"');
+        let suffix = s[s.len() - v.len() + 1..].to_owned().into_boxed_str();
+        (out, suffix)
+    }
+
+    fn parse_lit_byte_str_raw(s: &str) -> (Vec<u8>, Box<str>) {
+        assert_eq!(byte(s, 0), b'b');
+        let (value, suffix) = parse_lit_str_raw(&s[1..]);
+        (String::from(value).into_bytes(), suffix)
+    }
+
+    // Returns (content, suffix).
+    pub(crate) fn parse_lit_c_str(s: &str) -> (CString, Box<str>) {
+        assert_eq!(byte(s, 0), b'c');
+        match byte(s, 1) {
+            b'"' => parse_lit_c_str_cooked(s),
+            b'r' => parse_lit_c_str_raw(s),
+            _ => unreachable!(),
+        }
+    }
+
+    // Clippy false positive
+    // https://github.com/rust-lang-nursery/rust-clippy/issues/2329
+    #[allow(clippy::needless_continue)]
+    fn parse_lit_c_str_cooked(mut s: &str) -> (CString, Box<str>) {
+        assert_eq!(byte(s, 0), b'c');
+        assert_eq!(byte(s, 1), b'"');
+        s = &s[2..];
+
+        // We're going to want to have slices which don't respect codepoint boundaries.
+        let mut v = s.as_bytes();
+
+        let mut out = Vec::new();
+        'outer: loop {
+            let byte = match byte(v, 0) {
+                b'"' => break,
+                b'\\' => {
+                    let b = byte(v, 1);
+                    v = &v[2..];
+                    match b {
+                        b'x' => {
+                            let (b, rest) = backslash_x(v);
+                            assert!(b != 0, "\\x00 is not allowed in C-string literal");
+                            v = rest;
+                            b
+                        }
+                        b'u' => {
+                            let (ch, rest) = backslash_u(v);
+                            assert!(ch != '\0', "\\u{{0}} is not allowed in C-string literal");
+                            v = rest;
+                            out.extend_from_slice(ch.encode_utf8(&mut [0u8; 4]).as_bytes());
+                            continue 'outer;
+                        }
+                        b'n' => b'\n',
+                        b'r' => b'\r',
+                        b't' => b'\t',
+                        b'\\' => b'\\',
+                        b'\'' => b'\'',
+                        b'"' => b'"',
+                        b'\r' | b'\n' => loop {
+                            let byte = byte(v, 0);
+                            if matches!(byte, b' ' | b'\t' | b'\n' | b'\r') {
+                                v = &v[1..];
+                            } else {
+                                continue 'outer;
+                            }
+                        },
+                        b => panic!(
+                            "unexpected byte '{}' after \\ character in byte literal",
+                            ascii::escape_default(b),
+                        ),
+                    }
+                }
+                b'\r' => {
+                    assert_eq!(byte(v, 1), b'\n', "bare CR not allowed in string");
+                    v = &v[2..];
+                    b'\n'
+                }
+                b => {
+                    v = &v[1..];
+                    b
+                }
+            };
+            out.push(byte);
+        }
+
+        assert_eq!(byte(v, 0), b'"');
+        let suffix = s[s.len() - v.len() + 1..].to_owned().into_boxed_str();
+        (CString::new(out).unwrap(), suffix)
+    }
+
+    fn parse_lit_c_str_raw(s: &str) -> (CString, Box<str>) {
+        assert_eq!(byte(s, 0), b'c');
+        let (value, suffix) = parse_lit_str_raw(&s[1..]);
+        (CString::new(String::from(value)).unwrap(), suffix)
+    }
+
+    // Returns (value, suffix).
+    pub(crate) fn parse_lit_byte(s: &str) -> (u8, Box<str>) {
+        assert_eq!(byte(s, 0), b'b');
+        assert_eq!(byte(s, 1), b'\'');
+
+        // We're going to want to have slices which don't respect codepoint boundaries.
+        let mut v = s[2..].as_bytes();
+
+        let b = match byte(v, 0) {
+            b'\\' => {
+                let b = byte(v, 1);
+                v = &v[2..];
+                match b {
+                    b'x' => {
+                        let (b, rest) = backslash_x(v);
+                        v = rest;
+                        b
+                    }
+                    b'n' => b'\n',
+                    b'r' => b'\r',
+                    b't' => b'\t',
+                    b'\\' => b'\\',
+                    b'0' => b'\0',
+                    b'\'' => b'\'',
+                    b'"' => b'"',
+                    b => panic!(
+                        "unexpected byte '{}' after \\ character in byte literal",
+                        ascii::escape_default(b),
+                    ),
+                }
+            }
+            b => {
+                v = &v[1..];
+                b
+            }
+        };
+
+        assert_eq!(byte(v, 0), b'\'');
+        let suffix = s[s.len() - v.len() + 1..].to_owned().into_boxed_str();
+        (b, suffix)
+    }
+
+    // Returns (value, suffix).
+    pub(crate) fn parse_lit_char(mut s: &str) -> (char, Box<str>) {
+        assert_eq!(byte(s, 0), b'\'');
+        s = &s[1..];
+
+        let ch = match byte(s, 0) {
+            b'\\' => {
+                let b = byte(s, 1);
+                s = &s[2..];
+                match b {
+                    b'x' => {
+                        let (byte, rest) = backslash_x(s);
+                        s = rest;
+                        assert!(byte <= 0x7F, "invalid \\x byte in character literal");
+                        char::from_u32(u32::from(byte)).unwrap()
+                    }
+                    b'u' => {
+                        let (ch, rest) = backslash_u(s);
+                        s = rest;
+                        ch
+                    }
+                    b'n' => '\n',
+                    b'r' => '\r',
+                    b't' => '\t',
+                    b'\\' => '\\',
+                    b'0' => '\0',
+                    b'\'' => '\'',
+                    b'"' => '"',
+                    b => panic!(
+                        "unexpected byte '{}' after \\ character in character literal",
+                        ascii::escape_default(b),
+                    ),
+                }
+            }
+            _ => {
+                let ch = next_chr(s);
+                s = &s[ch.len_utf8()..];
+                ch
+            }
+        };
+        assert_eq!(byte(s, 0), b'\'');
+        let suffix = s[1..].to_owned().into_boxed_str();
+        (ch, suffix)
+    }
+
+    fn backslash_x<S>(s: &S) -> (u8, &S)
+    where
+        S: Index<RangeFrom<usize>, Output = S> + AsRef<[u8]> + ?Sized,
+    {
+        let mut ch = 0;
+        let b0 = byte(s, 0);
+        let b1 = byte(s, 1);
+        ch += 0x10
+            * match b0 {
+                b'0'..=b'9' => b0 - b'0',
+                b'a'..=b'f' => 10 + (b0 - b'a'),
+                b'A'..=b'F' => 10 + (b0 - b'A'),
+                _ => panic!("unexpected non-hex character after \\x"),
+            };
+        ch += match b1 {
+            b'0'..=b'9' => b1 - b'0',
+            b'a'..=b'f' => 10 + (b1 - b'a'),
+            b'A'..=b'F' => 10 + (b1 - b'A'),
+            _ => panic!("unexpected non-hex character after \\x"),
+        };
+        (ch, &s[2..])
+    }
+
+    fn backslash_u<S>(mut s: &S) -> (char, &S)
+    where
+        S: Index<RangeFrom<usize>, Output = S> + AsRef<[u8]> + ?Sized,
+    {
+        if byte(s, 0) != b'{' {
+            panic!("{}", "expected { after \\u");
+        }
+        s = &s[1..];
+
+        let mut ch = 0;
+        let mut digits = 0;
+        loop {
+            let b = byte(s, 0);
+            let digit = match b {
+                b'0'..=b'9' => b - b'0',
+                b'a'..=b'f' => 10 + b - b'a',
+                b'A'..=b'F' => 10 + b - b'A',
+                b'_' if digits > 0 => {
+                    s = &s[1..];
+                    continue;
+                }
+                b'}' if digits == 0 => panic!("invalid empty unicode escape"),
+                b'}' => break,
+                _ => panic!("unexpected non-hex character after \\u"),
+            };
+            if digits == 6 {
+                panic!("overlong unicode escape (must have at most 6 hex digits)");
+            }
+            ch *= 0x10;
+            ch += u32::from(digit);
+            digits += 1;
+            s = &s[1..];
+        }
+        assert!(byte(s, 0) == b'}');
+        s = &s[1..];
+
+        if let Some(ch) = char::from_u32(ch) {
+            (ch, s)
+        } else {
+            panic!("character code {:x} is not a valid unicode character", ch);
+        }
+    }
+
+    // Returns base 10 digits and suffix.
+    pub(crate) fn parse_lit_int(mut s: &str) -> Option<(Box<str>, Box<str>)> {
+        let negative = byte(s, 0) == b'-';
+        if negative {
+            s = &s[1..];
+        }
+
+        let base = match (byte(s, 0), byte(s, 1)) {
+            (b'0', b'x') => {
+                s = &s[2..];
+                16
+            }
+            (b'0', b'o') => {
+                s = &s[2..];
+                8
+            }
+            (b'0', b'b') => {
+                s = &s[2..];
+                2
+            }
+            (b'0'..=b'9', _) => 10,
+            _ => return None,
+        };
+
+        let mut value = BigInt::new();
+        let mut has_digit = false;
+        'outer: loop {
+            let b = byte(s, 0);
+            let digit = match b {
+                b'0'..=b'9' => b - b'0',
+                b'a'..=b'f' if base > 10 => b - b'a' + 10,
+                b'A'..=b'F' if base > 10 => b - b'A' + 10,
+                b'_' => {
+                    s = &s[1..];
+                    continue;
+                }
+                // If looking at a floating point literal, we don't want to
+                // consider it an integer.
+                b'.' if base == 10 => return None,
+                b'e' | b'E' if base == 10 => {
+                    let mut has_exp = false;
+                    for (i, b) in s[1..].bytes().enumerate() {
+                        match b {
+                            b'_' => {}
+                            b'-' | b'+' => return None,
+                            b'0'..=b'9' => has_exp = true,
+                            _ => {
+                                let suffix = &s[1 + i..];
+                                if has_exp && crate::ident::xid_ok(suffix) {
+                                    return None;
+                                } else {
+                                    break 'outer;
+                                }
+                            }
+                        }
+                    }
+                    if has_exp {
+                        return None;
+                    } else {
+                        break;
+                    }
+                }
+                _ => break,
+            };
+
+            if digit >= base {
+                return None;
+            }
+
+            has_digit = true;
+            value *= base;
+            value += digit;
+            s = &s[1..];
+        }
+
+        if !has_digit {
+            return None;
+        }
+
+        let suffix = s;
+        if suffix.is_empty() || crate::ident::xid_ok(suffix) {
+            let mut repr = value.to_string();
+            if negative {
+                repr.insert(0, '-');
+            }
+            Some((repr.into_boxed_str(), suffix.to_owned().into_boxed_str()))
+        } else {
+            None
+        }
+    }
+
+    // Returns base 10 digits and suffix.
+    pub(crate) fn parse_lit_float(input: &str) -> Option<(Box<str>, Box<str>)> {
+        // Rust's floating point literals are very similar to the ones parsed by
+        // the standard library, except that rust's literals can contain
+        // ignorable underscores. Let's remove those underscores.
+
+        let mut bytes = input.to_owned().into_bytes();
+
+        let start = (*bytes.first()? == b'-') as usize;
+        match bytes.get(start)? {
+            b'0'..=b'9' => {}
+            _ => return None,
+        }
+
+        let mut read = start;
+        let mut write = start;
+        let mut has_dot = false;
+        let mut has_e = false;
+        let mut has_sign = false;
+        let mut has_exponent = false;
+        while read < bytes.len() {
+            match bytes[read] {
+                b'_' => {
+                    // Don't increase write
+                    read += 1;
+                    continue;
+                }
+                b'0'..=b'9' => {
+                    if has_e {
+                        has_exponent = true;
+                    }
+                    bytes[write] = bytes[read];
+                }
+                b'.' => {
+                    if has_e || has_dot {
+                        return None;
+                    }
+                    has_dot = true;
+                    bytes[write] = b'.';
+                }
+                b'e' | b'E' => {
+                    match bytes[read + 1..]
+                        .iter()
+                        .find(|b| **b != b'_')
+                        .unwrap_or(&b'\0')
+                    {
+                        b'-' | b'+' | b'0'..=b'9' => {}
+                        _ => break,
+                    }
+                    if has_e {
+                        if has_exponent {
+                            break;
+                        } else {
+                            return None;
+                        }
+                    }
+                    has_e = true;
+                    bytes[write] = b'e';
+                }
+                b'-' | b'+' => {
+                    if has_sign || has_exponent || !has_e {
+                        return None;
+                    }
+                    has_sign = true;
+                    if bytes[read] == b'-' {
+                        bytes[write] = bytes[read];
+                    } else {
+                        // Omit '+'
+                        read += 1;
+                        continue;
+                    }
+                }
+                _ => break,
+            }
+            read += 1;
+            write += 1;
+        }
+
+        if has_e && !has_exponent {
+            return None;
+        }
+
+        let mut digits = String::from_utf8(bytes).unwrap();
+        let suffix = digits.split_off(read);
+        digits.truncate(write);
+        if suffix.is_empty() || crate::ident::xid_ok(&suffix) {
+            Some((digits.into_boxed_str(), suffix.into_boxed_str()))
+        } else {
+            None
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/lookahead.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/lookahead.rs
--- 43.0.0-1/rust-vendor/syn/src/lookahead.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/lookahead.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,165 @@
+use crate::buffer::Cursor;
+use crate::error::{self, Error};
+use crate::sealed::lookahead::Sealed;
+use crate::span::IntoSpans;
+use crate::token::Token;
+use proc_macro2::Span;
+use std::cell::RefCell;
+
+/// Support for checking the next token in a stream to decide how to parse.
+///
+/// An important advantage over [`ParseStream::peek`] is that here we
+/// automatically construct an appropriate error message based on the token
+/// alternatives that get peeked. If you are producing your own error message,
+/// go ahead and use `ParseStream::peek` instead.
+///
+/// Use [`ParseStream::lookahead1`] to construct this object.
+///
+/// [`ParseStream::peek`]: crate::parse::ParseBuffer::peek
+/// [`ParseStream::lookahead1`]: crate::parse::ParseBuffer::lookahead1
+///
+/// Consuming tokens from the source stream after constructing a lookahead
+/// object does not also advance the lookahead object.
+///
+/// # Example
+///
+/// ```
+/// use syn::{ConstParam, Ident, Lifetime, LifetimeParam, Result, Token, TypeParam};
+/// use syn::parse::{Parse, ParseStream};
+///
+/// // A generic parameter, a single one of the comma-separated elements inside
+/// // angle brackets in:
+/// //
+/// //     fn f<T: Clone, 'a, 'b: 'a, const N: usize>() { ... }
+/// //
+/// // On invalid input, lookahead gives us a reasonable error message.
+/// //
+/// //     error: expected one of: identifier, lifetime, `const`
+/// //       |
+/// //     5 |     fn f<!Sized>() {}
+/// //       |          ^
+/// enum GenericParam {
+///     Type(TypeParam),
+///     Lifetime(LifetimeParam),
+///     Const(ConstParam),
+/// }
+///
+/// impl Parse for GenericParam {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         let lookahead = input.lookahead1();
+///         if lookahead.peek(Ident) {
+///             input.parse().map(GenericParam::Type)
+///         } else if lookahead.peek(Lifetime) {
+///             input.parse().map(GenericParam::Lifetime)
+///         } else if lookahead.peek(Token![const]) {
+///             input.parse().map(GenericParam::Const)
+///         } else {
+///             Err(lookahead.error())
+///         }
+///     }
+/// }
+/// ```
+pub struct Lookahead1<'a> {
+    scope: Span,
+    cursor: Cursor<'a>,
+    comparisons: RefCell<Vec<&'static str>>,
+}
+
+pub(crate) fn new(scope: Span, cursor: Cursor) -> Lookahead1 {
+    Lookahead1 {
+        scope,
+        cursor,
+        comparisons: RefCell::new(Vec::new()),
+    }
+}
+
+fn peek_impl(
+    lookahead: &Lookahead1,
+    peek: fn(Cursor) -> bool,
+    display: fn() -> &'static str,
+) -> bool {
+    if peek(lookahead.cursor) {
+        return true;
+    }
+    lookahead.comparisons.borrow_mut().push(display());
+    false
+}
+
+impl<'a> Lookahead1<'a> {
+    /// Looks at the next token in the parse stream to determine whether it
+    /// matches the requested type of token.
+    ///
+    /// # Syntax
+    ///
+    /// Note that this method does not use turbofish syntax. Pass the peek type
+    /// inside of parentheses.
+    ///
+    /// - `input.peek(Token![struct])`
+    /// - `input.peek(Token![==])`
+    /// - `input.peek(Ident)`&emsp;*(does not accept keywords)*
+    /// - `input.peek(Ident::peek_any)`
+    /// - `input.peek(Lifetime)`
+    /// - `input.peek(token::Brace)`
+    pub fn peek<T: Peek>(&self, token: T) -> bool {
+        let _ = token;
+        peek_impl(self, T::Token::peek, T::Token::display)
+    }
+
+    /// Triggers an error at the current position of the parse stream.
+    ///
+    /// The error message will identify all of the expected token types that
+    /// have been peeked against this lookahead instance.
+    pub fn error(self) -> Error {
+        let comparisons = self.comparisons.into_inner();
+        match comparisons.len() {
+            0 => {
+                if self.cursor.eof() {
+                    Error::new(self.scope, "unexpected end of input")
+                } else {
+                    Error::new(self.cursor.span(), "unexpected token")
+                }
+            }
+            1 => {
+                let message = format!("expected {}", comparisons[0]);
+                error::new_at(self.scope, self.cursor, message)
+            }
+            2 => {
+                let message = format!("expected {} or {}", comparisons[0], comparisons[1]);
+                error::new_at(self.scope, self.cursor, message)
+            }
+            _ => {
+                let join = comparisons.join(", ");
+                let message = format!("expected one of: {}", join);
+                error::new_at(self.scope, self.cursor, message)
+            }
+        }
+    }
+}
+
+/// Types that can be parsed by looking at just one token.
+///
+/// Use [`ParseStream::peek`] to peek one of these types in a parse stream
+/// without consuming it from the stream.
+///
+/// This trait is sealed and cannot be implemented for types outside of Syn.
+///
+/// [`ParseStream::peek`]: crate::parse::ParseBuffer::peek
+pub trait Peek: Sealed {
+    // Not public API.
+    #[doc(hidden)]
+    type Token: Token;
+}
+
+impl<F: Copy + FnOnce(TokenMarker) -> T, T: Token> Peek for F {
+    type Token = T;
+}
+
+pub enum TokenMarker {}
+
+impl<S> IntoSpans<S> for TokenMarker {
+    fn into_spans(self) -> S {
+        match self {}
+    }
+}
+
+impl<F: Copy + FnOnce(TokenMarker) -> T, T: Token> Sealed for F {}
diff -pruN 43.0.0-1/rust-vendor/syn/src/mac.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/mac.rs
--- 43.0.0-1/rust-vendor/syn/src/mac.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/mac.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,223 @@
+#[cfg(feature = "parsing")]
+use crate::error::Result;
+#[cfg(feature = "parsing")]
+use crate::parse::{Parse, ParseStream, Parser};
+use crate::path::Path;
+use crate::token::{Brace, Bracket, Paren};
+use proc_macro2::extra::DelimSpan;
+#[cfg(feature = "parsing")]
+use proc_macro2::Delimiter;
+use proc_macro2::TokenStream;
+#[cfg(feature = "parsing")]
+use proc_macro2::TokenTree;
+
+ast_struct! {
+    /// A macro invocation: `println!("{}", mac)`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct Macro {
+        pub path: Path,
+        pub bang_token: Token![!],
+        pub delimiter: MacroDelimiter,
+        pub tokens: TokenStream,
+    }
+}
+
+ast_enum! {
+    /// A grouping token that surrounds a macro body: `m!(...)` or `m!{...}` or `m![...]`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub enum MacroDelimiter {
+        Paren(Paren),
+        Brace(Brace),
+        Bracket(Bracket),
+    }
+}
+
+impl MacroDelimiter {
+    pub fn span(&self) -> &DelimSpan {
+        match self {
+            MacroDelimiter::Paren(token) => &token.span,
+            MacroDelimiter::Brace(token) => &token.span,
+            MacroDelimiter::Bracket(token) => &token.span,
+        }
+    }
+
+    #[cfg(all(feature = "full", any(feature = "parsing", feature = "printing")))]
+    pub(crate) fn is_brace(&self) -> bool {
+        match self {
+            MacroDelimiter::Brace(_) => true,
+            MacroDelimiter::Paren(_) | MacroDelimiter::Bracket(_) => false,
+        }
+    }
+}
+
+impl Macro {
+    /// Parse the tokens within the macro invocation's delimiters into a syntax
+    /// tree.
+    ///
+    /// This is equivalent to `syn::parse2::<T>(mac.tokens)` except that it
+    /// produces a more useful span when `tokens` is empty.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{parse_quote, Expr, ExprLit, Ident, Lit, LitStr, Macro, Token};
+    /// use syn::ext::IdentExt;
+    /// use syn::parse::{Error, Parse, ParseStream, Result};
+    /// use syn::punctuated::Punctuated;
+    ///
+    /// // The arguments expected by libcore's format_args macro, and as a
+    /// // result most other formatting and printing macros like println.
+    /// //
+    /// //     println!("{} is {number:.prec$}", "x", prec=5, number=0.01)
+    /// struct FormatArgs {
+    ///     format_string: Expr,
+    ///     positional_args: Vec<Expr>,
+    ///     named_args: Vec<(Ident, Expr)>,
+    /// }
+    ///
+    /// impl Parse for FormatArgs {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let format_string: Expr;
+    ///         let mut positional_args = Vec::new();
+    ///         let mut named_args = Vec::new();
+    ///
+    ///         format_string = input.parse()?;
+    ///         while !input.is_empty() {
+    ///             input.parse::<Token![,]>()?;
+    ///             if input.is_empty() {
+    ///                 break;
+    ///             }
+    ///             if input.peek(Ident::peek_any) && input.peek2(Token![=]) {
+    ///                 while !input.is_empty() {
+    ///                     let name: Ident = input.call(Ident::parse_any)?;
+    ///                     input.parse::<Token![=]>()?;
+    ///                     let value: Expr = input.parse()?;
+    ///                     named_args.push((name, value));
+    ///                     if input.is_empty() {
+    ///                         break;
+    ///                     }
+    ///                     input.parse::<Token![,]>()?;
+    ///                 }
+    ///                 break;
+    ///             }
+    ///             positional_args.push(input.parse()?);
+    ///         }
+    ///
+    ///         Ok(FormatArgs {
+    ///             format_string,
+    ///             positional_args,
+    ///             named_args,
+    ///         })
+    ///     }
+    /// }
+    ///
+    /// // Extract the first argument, the format string literal, from an
+    /// // invocation of a formatting or printing macro.
+    /// fn get_format_string(m: &Macro) -> Result<LitStr> {
+    ///     let args: FormatArgs = m.parse_body()?;
+    ///     match args.format_string {
+    ///         Expr::Lit(ExprLit { lit: Lit::Str(lit), .. }) => Ok(lit),
+    ///         other => {
+    ///             // First argument was not a string literal expression.
+    ///             // Maybe something like: println!(concat!(...), ...)
+    ///             Err(Error::new_spanned(other, "format string must be a string literal"))
+    ///         }
+    ///     }
+    /// }
+    ///
+    /// fn main() {
+    ///     let invocation = parse_quote! {
+    ///         println!("{:?}", Instant::now())
+    ///     };
+    ///     let lit = get_format_string(&invocation).unwrap();
+    ///     assert_eq!(lit.value(), "{:?}");
+    /// }
+    /// ```
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    pub fn parse_body<T: Parse>(&self) -> Result<T> {
+        self.parse_body_with(T::parse)
+    }
+
+    /// Parse the tokens within the macro invocation's delimiters using the
+    /// given parser.
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    pub fn parse_body_with<F: Parser>(&self, parser: F) -> Result<F::Output> {
+        let scope = self.delimiter.span().close();
+        crate::parse::parse_scoped(parser, scope, self.tokens.clone())
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) fn parse_delimiter(input: ParseStream) -> Result<(MacroDelimiter, TokenStream)> {
+    input.step(|cursor| {
+        if let Some((TokenTree::Group(g), rest)) = cursor.token_tree() {
+            let span = g.delim_span();
+            let delimiter = match g.delimiter() {
+                Delimiter::Parenthesis => MacroDelimiter::Paren(Paren(span)),
+                Delimiter::Brace => MacroDelimiter::Brace(Brace(span)),
+                Delimiter::Bracket => MacroDelimiter::Bracket(Bracket(span)),
+                Delimiter::None => {
+                    return Err(cursor.error("expected delimiter"));
+                }
+            };
+            Ok(((delimiter, g.stream()), rest))
+        } else {
+            Err(cursor.error("expected delimiter"))
+        }
+    })
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::error::Result;
+    use crate::mac::{parse_delimiter, Macro};
+    use crate::parse::{Parse, ParseStream};
+    use crate::path::Path;
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Macro {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let tokens;
+            Ok(Macro {
+                path: input.call(Path::parse_mod_style)?,
+                bang_token: input.parse()?,
+                delimiter: {
+                    let (delimiter, content) = parse_delimiter(input)?;
+                    tokens = content;
+                    delimiter
+                },
+                tokens,
+            })
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::mac::{Macro, MacroDelimiter};
+    use crate::token;
+    use proc_macro2::{Delimiter, TokenStream};
+    use quote::ToTokens;
+
+    impl MacroDelimiter {
+        pub(crate) fn surround(&self, tokens: &mut TokenStream, inner: TokenStream) {
+            let (delim, span) = match self {
+                MacroDelimiter::Paren(paren) => (Delimiter::Parenthesis, paren.span),
+                MacroDelimiter::Brace(brace) => (Delimiter::Brace, brace.span),
+                MacroDelimiter::Bracket(bracket) => (Delimiter::Bracket, bracket.span),
+            };
+            token::printing::delim(delim, span.join(), tokens, inner);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for Macro {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.path.to_tokens(tokens);
+            self.bang_token.to_tokens(tokens);
+            self.delimiter.surround(tokens, self.tokens.clone());
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/macros.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/macros.rs
--- 43.0.0-1/rust-vendor/syn/src/macros.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/macros.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,166 @@
+#[cfg_attr(
+    not(any(feature = "full", feature = "derive")),
+    allow(unknown_lints, unused_macro_rules)
+)]
+macro_rules! ast_struct {
+    (
+        $(#[$attr:meta])*
+        $pub:ident $struct:ident $name:ident #full $body:tt
+    ) => {
+        check_keyword_matches!(pub $pub);
+        check_keyword_matches!(struct $struct);
+
+        #[cfg(feature = "full")]
+        $(#[$attr])* $pub $struct $name $body
+
+        #[cfg(not(feature = "full"))]
+        $(#[$attr])* $pub $struct $name {
+            _noconstruct: ::std::marker::PhantomData<::proc_macro2::Span>,
+        }
+
+        #[cfg(all(not(feature = "full"), feature = "printing"))]
+        impl ::quote::ToTokens for $name {
+            fn to_tokens(&self, _: &mut ::proc_macro2::TokenStream) {
+                unreachable!()
+            }
+        }
+    };
+
+    (
+        $(#[$attr:meta])*
+        $pub:ident $struct:ident $name:ident $body:tt
+    ) => {
+        check_keyword_matches!(pub $pub);
+        check_keyword_matches!(struct $struct);
+
+        $(#[$attr])* $pub $struct $name $body
+    };
+}
+
+#[cfg(any(feature = "full", feature = "derive"))]
+macro_rules! ast_enum {
+    (
+        $(#[$enum_attr:meta])*
+        $pub:ident $enum:ident $name:ident $body:tt
+    ) => {
+        check_keyword_matches!(pub $pub);
+        check_keyword_matches!(enum $enum);
+
+        $(#[$enum_attr])* $pub $enum $name $body
+    };
+}
+
+macro_rules! ast_enum_of_structs {
+    (
+        $(#[$enum_attr:meta])*
+        $pub:ident $enum:ident $name:ident $body:tt
+    ) => {
+        check_keyword_matches!(pub $pub);
+        check_keyword_matches!(enum $enum);
+
+        $(#[$enum_attr])* $pub $enum $name $body
+
+        ast_enum_of_structs_impl!($name $body);
+
+        #[cfg(feature = "printing")]
+        generate_to_tokens!(() tokens $name $body);
+    };
+}
+
+macro_rules! ast_enum_of_structs_impl {
+    (
+        $name:ident {
+            $(
+                $(#[cfg $cfg_attr:tt])*
+                $(#[doc $($doc_attr:tt)*])*
+                $variant:ident $( ($member:ident) )*,
+            )*
+        }
+    ) => {
+        $($(
+            ast_enum_from_struct!($name::$variant, $member);
+        )*)*
+    };
+}
+
+macro_rules! ast_enum_from_struct {
+    // No From<TokenStream> for verbatim variants.
+    ($name:ident::Verbatim, $member:ident) => {};
+
+    ($name:ident::$variant:ident, $member:ident) => {
+        impl From<$member> for $name {
+            fn from(e: $member) -> $name {
+                $name::$variant(e)
+            }
+        }
+    };
+}
+
+#[cfg(feature = "printing")]
+macro_rules! generate_to_tokens {
+    (
+        ($($arms:tt)*) $tokens:ident $name:ident {
+            $(#[cfg $cfg_attr:tt])*
+            $(#[doc $($doc_attr:tt)*])*
+            $variant:ident,
+            $($next:tt)*
+        }
+    ) => {
+        generate_to_tokens!(
+            ($($arms)* $(#[cfg $cfg_attr])* $name::$variant => {})
+            $tokens $name { $($next)* }
+        );
+    };
+
+    (
+        ($($arms:tt)*) $tokens:ident $name:ident {
+            $(#[cfg $cfg_attr:tt])*
+            $(#[doc $($doc_attr:tt)*])*
+            $variant:ident($member:ident),
+            $($next:tt)*
+        }
+    ) => {
+        generate_to_tokens!(
+            ($($arms)* $(#[cfg $cfg_attr])* $name::$variant(_e) => _e.to_tokens($tokens),)
+            $tokens $name { $($next)* }
+        );
+    };
+
+    (($($arms:tt)*) $tokens:ident $name:ident {}) => {
+        #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+        impl ::quote::ToTokens for $name {
+            fn to_tokens(&self, $tokens: &mut ::proc_macro2::TokenStream) {
+                match self {
+                    $($arms)*
+                }
+            }
+        }
+    };
+}
+
+// Rustdoc bug: does not respect the doc(hidden) on some items.
+#[cfg(all(doc, feature = "parsing"))]
+macro_rules! pub_if_not_doc {
+    ($(#[$m:meta])* $pub:ident $($item:tt)*) => {
+        check_keyword_matches!(pub $pub);
+
+        $(#[$m])*
+        $pub(crate) $($item)*
+    };
+}
+
+#[cfg(all(not(doc), feature = "parsing"))]
+macro_rules! pub_if_not_doc {
+    ($(#[$m:meta])* $pub:ident $($item:tt)*) => {
+        check_keyword_matches!(pub $pub);
+
+        $(#[$m])*
+        $pub $($item)*
+    };
+}
+
+macro_rules! check_keyword_matches {
+    (enum enum) => {};
+    (pub pub) => {};
+    (struct struct) => {};
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/meta.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/meta.rs
--- 43.0.0-1/rust-vendor/syn/src/meta.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/meta.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,427 @@
+//! Facility for interpreting structured content inside of an `Attribute`.
+
+use crate::error::{Error, Result};
+use crate::ext::IdentExt as _;
+use crate::lit::Lit;
+use crate::parse::{ParseStream, Parser};
+use crate::path::{Path, PathSegment};
+use crate::punctuated::Punctuated;
+use proc_macro2::Ident;
+use std::fmt::Display;
+
+/// Make a parser that is usable with `parse_macro_input!` in a
+/// `#[proc_macro_attribute]` macro.
+///
+/// *Warning:* When parsing attribute args **other than** the
+/// `proc_macro::TokenStream` input of a `proc_macro_attribute`, you do **not**
+/// need this function. In several cases your callers will get worse error
+/// messages if you use this function, because the surrounding delimiter's span
+/// is concealed from attribute macros by rustc. Use
+/// [`Attribute::parse_nested_meta`] instead.
+///
+/// [`Attribute::parse_nested_meta`]: crate::Attribute::parse_nested_meta
+///
+/// # Example
+///
+/// This example implements an attribute macro whose invocations look like this:
+///
+/// ```
+/// # const IGNORE: &str = stringify! {
+/// #[tea(kind = "EarlGrey", hot)]
+/// struct Picard {...}
+/// # };
+/// ```
+///
+/// The "parameters" supported by the attribute are:
+///
+/// - `kind = "..."`
+/// - `hot`
+/// - `with(sugar, milk, ...)`, a comma-separated list of ingredients
+///
+/// ```
+/// # extern crate proc_macro;
+/// #
+/// use proc_macro::TokenStream;
+/// use syn::{parse_macro_input, LitStr, Path};
+///
+/// # const IGNORE: &str = stringify! {
+/// #[proc_macro_attribute]
+/// # };
+/// pub fn tea(args: TokenStream, input: TokenStream) -> TokenStream {
+///     let mut kind: Option<LitStr> = None;
+///     let mut hot: bool = false;
+///     let mut with: Vec<Path> = Vec::new();
+///     let tea_parser = syn::meta::parser(|meta| {
+///         if meta.path.is_ident("kind") {
+///             kind = Some(meta.value()?.parse()?);
+///             Ok(())
+///         } else if meta.path.is_ident("hot") {
+///             hot = true;
+///             Ok(())
+///         } else if meta.path.is_ident("with") {
+///             meta.parse_nested_meta(|meta| {
+///                 with.push(meta.path);
+///                 Ok(())
+///             })
+///         } else {
+///             Err(meta.error("unsupported tea property"))
+///         }
+///     });
+///
+///     parse_macro_input!(args with tea_parser);
+///     eprintln!("kind={kind:?} hot={hot} with={with:?}");
+///
+///     /* ... */
+/// #   TokenStream::new()
+/// }
+/// ```
+///
+/// The `syn::meta` library will take care of dealing with the commas including
+/// trailing commas, and producing sensible error messages on unexpected input.
+///
+/// ```console
+/// error: expected `,`
+///  --> src/main.rs:3:37
+///   |
+/// 3 | #[tea(kind = "EarlGrey", with(sugar = "lol", milk))]
+///   |                                     ^
+/// ```
+///
+/// # Example
+///
+/// Same as above but we factor out most of the logic into a separate function.
+///
+/// ```
+/// # extern crate proc_macro;
+/// #
+/// use proc_macro::TokenStream;
+/// use syn::meta::ParseNestedMeta;
+/// use syn::parse::{Parser, Result};
+/// use syn::{parse_macro_input, LitStr, Path};
+///
+/// # const IGNORE: &str = stringify! {
+/// #[proc_macro_attribute]
+/// # };
+/// pub fn tea(args: TokenStream, input: TokenStream) -> TokenStream {
+///     let mut attrs = TeaAttributes::default();
+///     let tea_parser = syn::meta::parser(|meta| attrs.parse(meta));
+///     parse_macro_input!(args with tea_parser);
+///
+///     /* ... */
+/// #   TokenStream::new()
+/// }
+///
+/// #[derive(Default)]
+/// struct TeaAttributes {
+///     kind: Option<LitStr>,
+///     hot: bool,
+///     with: Vec<Path>,
+/// }
+///
+/// impl TeaAttributes {
+///     fn parse(&mut self, meta: ParseNestedMeta) -> Result<()> {
+///         if meta.path.is_ident("kind") {
+///             self.kind = Some(meta.value()?.parse()?);
+///             Ok(())
+///         } else /* just like in last example */
+/// #           { unimplemented!() }
+///
+///     }
+/// }
+/// ```
+pub fn parser(logic: impl FnMut(ParseNestedMeta) -> Result<()>) -> impl Parser<Output = ()> {
+    |input: ParseStream| {
+        if input.is_empty() {
+            Ok(())
+        } else {
+            parse_nested_meta(input, logic)
+        }
+    }
+}
+
+/// Context for parsing a single property in the conventional syntax for
+/// structured attributes.
+///
+/// # Examples
+///
+/// Refer to usage examples on the following two entry-points:
+///
+/// - [`Attribute::parse_nested_meta`] if you have an entire `Attribute` to
+///   parse. Always use this if possible. Generally this is able to produce
+///   better error messages because `Attribute` holds span information for all
+///   of the delimiters therein.
+///
+/// - [`syn::meta::parser`] if you are implementing a `proc_macro_attribute`
+///   macro and parsing the arguments to the attribute macro, i.e. the ones
+///   written in the same attribute that dispatched the macro invocation. Rustc
+///   does not pass span information for the surrounding delimiters into the
+///   attribute macro invocation in this situation, so error messages might be
+///   less precise.
+///
+/// [`Attribute::parse_nested_meta`]: crate::Attribute::parse_nested_meta
+/// [`syn::meta::parser`]: crate::meta::parser
+#[non_exhaustive]
+pub struct ParseNestedMeta<'a> {
+    pub path: Path,
+    pub input: ParseStream<'a>,
+}
+
+impl<'a> ParseNestedMeta<'a> {
+    /// Used when parsing `key = "value"` syntax.
+    ///
+    /// All it does is advance `meta.input` past the `=` sign in the input. You
+    /// could accomplish the same effect by writing
+    /// `meta.parse::<Token![=]>()?`, so at most it is a minor convenience to
+    /// use `meta.value()?`.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{parse_quote, Attribute, LitStr};
+    ///
+    /// let attr: Attribute = parse_quote! {
+    ///     #[tea(kind = "EarlGrey")]
+    /// };
+    ///                                          // conceptually:
+    /// if attr.path().is_ident("tea") {         // this parses the `tea`
+    ///     attr.parse_nested_meta(|meta| {      // this parses the `(`
+    ///         if meta.path.is_ident("kind") {  // this parses the `kind`
+    ///             let value = meta.value()?;   // this parses the `=`
+    ///             let s: LitStr = value.parse()?;  // this parses `"EarlGrey"`
+    ///             if s.value() == "EarlGrey" {
+    ///                 // ...
+    ///             }
+    ///             Ok(())
+    ///         } else {
+    ///             Err(meta.error("unsupported attribute"))
+    ///         }
+    ///     })?;
+    /// }
+    /// # anyhow::Ok(())
+    /// ```
+    pub fn value(&self) -> Result<ParseStream<'a>> {
+        self.input.parse::<Token![=]>()?;
+        Ok(self.input)
+    }
+
+    /// Used when parsing `list(...)` syntax **if** the content inside the
+    /// nested parentheses is also expected to conform to Rust's structured
+    /// attribute convention.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{parse_quote, Attribute};
+    ///
+    /// let attr: Attribute = parse_quote! {
+    ///     #[tea(with(sugar, milk))]
+    /// };
+    ///
+    /// if attr.path().is_ident("tea") {
+    ///     attr.parse_nested_meta(|meta| {
+    ///         if meta.path.is_ident("with") {
+    ///             meta.parse_nested_meta(|meta| {  // <---
+    ///                 if meta.path.is_ident("sugar") {
+    ///                     // Here we can go even deeper if needed.
+    ///                     Ok(())
+    ///                 } else if meta.path.is_ident("milk") {
+    ///                     Ok(())
+    ///                 } else {
+    ///                     Err(meta.error("unsupported ingredient"))
+    ///                 }
+    ///             })
+    ///         } else {
+    ///             Err(meta.error("unsupported tea property"))
+    ///         }
+    ///     })?;
+    /// }
+    /// # anyhow::Ok(())
+    /// ```
+    ///
+    /// # Counterexample
+    ///
+    /// If you don't need `parse_nested_meta`'s help in parsing the content
+    /// written within the nested parentheses, keep in mind that you can always
+    /// just parse it yourself from the exposed ParseStream. Rust syntax permits
+    /// arbitrary tokens within those parentheses so for the crazier stuff,
+    /// `parse_nested_meta` is not what you want.
+    ///
+    /// ```
+    /// use syn::{parenthesized, parse_quote, Attribute, LitInt};
+    ///
+    /// let attr: Attribute = parse_quote! {
+    ///     #[repr(align(32))]
+    /// };
+    ///
+    /// let mut align: Option<LitInt> = None;
+    /// if attr.path().is_ident("repr") {
+    ///     attr.parse_nested_meta(|meta| {
+    ///         if meta.path.is_ident("align") {
+    ///             let content;
+    ///             parenthesized!(content in meta.input);
+    ///             align = Some(content.parse()?);
+    ///             Ok(())
+    ///         } else {
+    ///             Err(meta.error("unsupported repr"))
+    ///         }
+    ///     })?;
+    /// }
+    /// # anyhow::Ok(())
+    /// ```
+    pub fn parse_nested_meta(
+        &self,
+        logic: impl FnMut(ParseNestedMeta) -> Result<()>,
+    ) -> Result<()> {
+        let content;
+        parenthesized!(content in self.input);
+        parse_nested_meta(&content, logic)
+    }
+
+    /// Report that the attribute's content did not conform to expectations.
+    ///
+    /// The span of the resulting error will cover `meta.path` *and* everything
+    /// that has been parsed so far since it.
+    ///
+    /// There are 2 ways you might call this. First, if `meta.path` is not
+    /// something you recognize:
+    ///
+    /// ```
+    /// # use syn::Attribute;
+    /// #
+    /// # fn example(attr: &Attribute) -> syn::Result<()> {
+    /// attr.parse_nested_meta(|meta| {
+    ///     if meta.path.is_ident("kind") {
+    ///         // ...
+    ///         Ok(())
+    ///     } else {
+    ///         Err(meta.error("unsupported tea property"))
+    ///     }
+    /// })?;
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// In this case, it behaves exactly like
+    /// `syn::Error::new_spanned(&meta.path, "message...")`.
+    ///
+    /// ```console
+    /// error: unsupported tea property
+    ///  --> src/main.rs:3:26
+    ///   |
+    /// 3 | #[tea(kind = "EarlGrey", wat = "foo")]
+    ///   |                          ^^^
+    /// ```
+    ///
+    /// More usefully, the second place is if you've already parsed a value but
+    /// have decided not to accept the value:
+    ///
+    /// ```
+    /// # use syn::Attribute;
+    /// #
+    /// # fn example(attr: &Attribute) -> syn::Result<()> {
+    /// use syn::Expr;
+    ///
+    /// attr.parse_nested_meta(|meta| {
+    ///     if meta.path.is_ident("kind") {
+    ///         let expr: Expr = meta.value()?.parse()?;
+    ///         match expr {
+    ///             Expr::Lit(expr) => /* ... */
+    /// #               unimplemented!(),
+    ///             Expr::Path(expr) => /* ... */
+    /// #               unimplemented!(),
+    ///             Expr::Macro(expr) => /* ... */
+    /// #               unimplemented!(),
+    ///             _ => Err(meta.error("tea kind must be a string literal, path, or macro")),
+    ///         }
+    ///     } else /* as above */
+    /// #       { unimplemented!() }
+    ///
+    /// })?;
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// ```console
+    /// error: tea kind must be a string literal, path, or macro
+    ///  --> src/main.rs:3:7
+    ///   |
+    /// 3 | #[tea(kind = async { replicator.await })]
+    ///   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    /// ```
+    ///
+    /// Often you may want to use `syn::Error::new_spanned` even in this
+    /// situation. In the above code, that would be:
+    ///
+    /// ```
+    /// # use syn::{Error, Expr};
+    /// #
+    /// # fn example(expr: Expr) -> syn::Result<()> {
+    ///     match expr {
+    ///         Expr::Lit(expr) => /* ... */
+    /// #           unimplemented!(),
+    ///         Expr::Path(expr) => /* ... */
+    /// #           unimplemented!(),
+    ///         Expr::Macro(expr) => /* ... */
+    /// #           unimplemented!(),
+    ///         _ => Err(Error::new_spanned(expr, "unsupported expression type for `kind`")),
+    ///     }
+    /// # }
+    /// ```
+    ///
+    /// ```console
+    /// error: unsupported expression type for `kind`
+    ///  --> src/main.rs:3:14
+    ///   |
+    /// 3 | #[tea(kind = async { replicator.await })]
+    ///   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^
+    /// ```
+    pub fn error(&self, msg: impl Display) -> Error {
+        let start_span = self.path.segments[0].ident.span();
+        let end_span = self.input.cursor().prev_span();
+        crate::error::new2(start_span, end_span, msg)
+    }
+}
+
+pub(crate) fn parse_nested_meta(
+    input: ParseStream,
+    mut logic: impl FnMut(ParseNestedMeta) -> Result<()>,
+) -> Result<()> {
+    loop {
+        let path = input.call(parse_meta_path)?;
+        logic(ParseNestedMeta { path, input })?;
+        if input.is_empty() {
+            return Ok(());
+        }
+        input.parse::<Token![,]>()?;
+        if input.is_empty() {
+            return Ok(());
+        }
+    }
+}
+
+// Like Path::parse_mod_style, but accepts keywords in the path.
+fn parse_meta_path(input: ParseStream) -> Result<Path> {
+    Ok(Path {
+        leading_colon: input.parse()?,
+        segments: {
+            let mut segments = Punctuated::new();
+            if input.peek(Ident::peek_any) {
+                let ident = Ident::parse_any(input)?;
+                segments.push_value(PathSegment::from(ident));
+            } else if input.is_empty() {
+                return Err(input.error("expected nested attribute"));
+            } else if input.peek(Lit) {
+                return Err(input.error("unexpected literal in nested attribute, expected ident"));
+            } else {
+                return Err(input.error("unexpected token in nested attribute, expected ident"));
+            }
+            while input.peek(Token![::]) {
+                let punct = input.parse()?;
+                segments.push_punct(punct);
+                let ident = Ident::parse_any(input)?;
+                segments.push_value(PathSegment::from(ident));
+            }
+            segments
+        },
+    })
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/op.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/op.rs
--- 43.0.0-1/rust-vendor/syn/src/op.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/op.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,219 @@
+ast_enum! {
+    /// A binary operator: `+`, `+=`, `&`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    #[non_exhaustive]
+    pub enum BinOp {
+        /// The `+` operator (addition)
+        Add(Token![+]),
+        /// The `-` operator (subtraction)
+        Sub(Token![-]),
+        /// The `*` operator (multiplication)
+        Mul(Token![*]),
+        /// The `/` operator (division)
+        Div(Token![/]),
+        /// The `%` operator (modulus)
+        Rem(Token![%]),
+        /// The `&&` operator (logical and)
+        And(Token![&&]),
+        /// The `||` operator (logical or)
+        Or(Token![||]),
+        /// The `^` operator (bitwise xor)
+        BitXor(Token![^]),
+        /// The `&` operator (bitwise and)
+        BitAnd(Token![&]),
+        /// The `|` operator (bitwise or)
+        BitOr(Token![|]),
+        /// The `<<` operator (shift left)
+        Shl(Token![<<]),
+        /// The `>>` operator (shift right)
+        Shr(Token![>>]),
+        /// The `==` operator (equality)
+        Eq(Token![==]),
+        /// The `<` operator (less than)
+        Lt(Token![<]),
+        /// The `<=` operator (less than or equal to)
+        Le(Token![<=]),
+        /// The `!=` operator (not equal to)
+        Ne(Token![!=]),
+        /// The `>=` operator (greater than or equal to)
+        Ge(Token![>=]),
+        /// The `>` operator (greater than)
+        Gt(Token![>]),
+        /// The `+=` operator
+        AddAssign(Token![+=]),
+        /// The `-=` operator
+        SubAssign(Token![-=]),
+        /// The `*=` operator
+        MulAssign(Token![*=]),
+        /// The `/=` operator
+        DivAssign(Token![/=]),
+        /// The `%=` operator
+        RemAssign(Token![%=]),
+        /// The `^=` operator
+        BitXorAssign(Token![^=]),
+        /// The `&=` operator
+        BitAndAssign(Token![&=]),
+        /// The `|=` operator
+        BitOrAssign(Token![|=]),
+        /// The `<<=` operator
+        ShlAssign(Token![<<=]),
+        /// The `>>=` operator
+        ShrAssign(Token![>>=]),
+    }
+}
+
+ast_enum! {
+    /// A unary operator: `*`, `!`, `-`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    #[non_exhaustive]
+    pub enum UnOp {
+        /// The `*` operator for dereferencing
+        Deref(Token![*]),
+        /// The `!` operator for logical inversion
+        Not(Token![!]),
+        /// The `-` operator for negation
+        Neg(Token![-]),
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::error::Result;
+    use crate::op::{BinOp, UnOp};
+    use crate::parse::{Parse, ParseStream};
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for BinOp {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Token![+=]) {
+                input.parse().map(BinOp::AddAssign)
+            } else if input.peek(Token![-=]) {
+                input.parse().map(BinOp::SubAssign)
+            } else if input.peek(Token![*=]) {
+                input.parse().map(BinOp::MulAssign)
+            } else if input.peek(Token![/=]) {
+                input.parse().map(BinOp::DivAssign)
+            } else if input.peek(Token![%=]) {
+                input.parse().map(BinOp::RemAssign)
+            } else if input.peek(Token![^=]) {
+                input.parse().map(BinOp::BitXorAssign)
+            } else if input.peek(Token![&=]) {
+                input.parse().map(BinOp::BitAndAssign)
+            } else if input.peek(Token![|=]) {
+                input.parse().map(BinOp::BitOrAssign)
+            } else if input.peek(Token![<<=]) {
+                input.parse().map(BinOp::ShlAssign)
+            } else if input.peek(Token![>>=]) {
+                input.parse().map(BinOp::ShrAssign)
+            } else if input.peek(Token![&&]) {
+                input.parse().map(BinOp::And)
+            } else if input.peek(Token![||]) {
+                input.parse().map(BinOp::Or)
+            } else if input.peek(Token![<<]) {
+                input.parse().map(BinOp::Shl)
+            } else if input.peek(Token![>>]) {
+                input.parse().map(BinOp::Shr)
+            } else if input.peek(Token![==]) {
+                input.parse().map(BinOp::Eq)
+            } else if input.peek(Token![<=]) {
+                input.parse().map(BinOp::Le)
+            } else if input.peek(Token![!=]) {
+                input.parse().map(BinOp::Ne)
+            } else if input.peek(Token![>=]) {
+                input.parse().map(BinOp::Ge)
+            } else if input.peek(Token![+]) {
+                input.parse().map(BinOp::Add)
+            } else if input.peek(Token![-]) {
+                input.parse().map(BinOp::Sub)
+            } else if input.peek(Token![*]) {
+                input.parse().map(BinOp::Mul)
+            } else if input.peek(Token![/]) {
+                input.parse().map(BinOp::Div)
+            } else if input.peek(Token![%]) {
+                input.parse().map(BinOp::Rem)
+            } else if input.peek(Token![^]) {
+                input.parse().map(BinOp::BitXor)
+            } else if input.peek(Token![&]) {
+                input.parse().map(BinOp::BitAnd)
+            } else if input.peek(Token![|]) {
+                input.parse().map(BinOp::BitOr)
+            } else if input.peek(Token![<]) {
+                input.parse().map(BinOp::Lt)
+            } else if input.peek(Token![>]) {
+                input.parse().map(BinOp::Gt)
+            } else {
+                Err(input.error("expected binary operator"))
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for UnOp {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let lookahead = input.lookahead1();
+            if lookahead.peek(Token![*]) {
+                input.parse().map(UnOp::Deref)
+            } else if lookahead.peek(Token![!]) {
+                input.parse().map(UnOp::Not)
+            } else if lookahead.peek(Token![-]) {
+                input.parse().map(UnOp::Neg)
+            } else {
+                Err(lookahead.error())
+            }
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::op::{BinOp, UnOp};
+    use proc_macro2::TokenStream;
+    use quote::ToTokens;
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for BinOp {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                BinOp::Add(t) => t.to_tokens(tokens),
+                BinOp::Sub(t) => t.to_tokens(tokens),
+                BinOp::Mul(t) => t.to_tokens(tokens),
+                BinOp::Div(t) => t.to_tokens(tokens),
+                BinOp::Rem(t) => t.to_tokens(tokens),
+                BinOp::And(t) => t.to_tokens(tokens),
+                BinOp::Or(t) => t.to_tokens(tokens),
+                BinOp::BitXor(t) => t.to_tokens(tokens),
+                BinOp::BitAnd(t) => t.to_tokens(tokens),
+                BinOp::BitOr(t) => t.to_tokens(tokens),
+                BinOp::Shl(t) => t.to_tokens(tokens),
+                BinOp::Shr(t) => t.to_tokens(tokens),
+                BinOp::Eq(t) => t.to_tokens(tokens),
+                BinOp::Lt(t) => t.to_tokens(tokens),
+                BinOp::Le(t) => t.to_tokens(tokens),
+                BinOp::Ne(t) => t.to_tokens(tokens),
+                BinOp::Ge(t) => t.to_tokens(tokens),
+                BinOp::Gt(t) => t.to_tokens(tokens),
+                BinOp::AddAssign(t) => t.to_tokens(tokens),
+                BinOp::SubAssign(t) => t.to_tokens(tokens),
+                BinOp::MulAssign(t) => t.to_tokens(tokens),
+                BinOp::DivAssign(t) => t.to_tokens(tokens),
+                BinOp::RemAssign(t) => t.to_tokens(tokens),
+                BinOp::BitXorAssign(t) => t.to_tokens(tokens),
+                BinOp::BitAndAssign(t) => t.to_tokens(tokens),
+                BinOp::BitOrAssign(t) => t.to_tokens(tokens),
+                BinOp::ShlAssign(t) => t.to_tokens(tokens),
+                BinOp::ShrAssign(t) => t.to_tokens(tokens),
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for UnOp {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                UnOp::Deref(t) => t.to_tokens(tokens),
+                UnOp::Not(t) => t.to_tokens(tokens),
+                UnOp::Neg(t) => t.to_tokens(tokens),
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/parse.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/parse.rs
--- 43.0.0-1/rust-vendor/syn/src/parse.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/parse.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1399 @@
+//! Parsing interface for parsing a token stream into a syntax tree node.
+//!
+//! Parsing in Syn is built on parser functions that take in a [`ParseStream`]
+//! and produce a [`Result<T>`] where `T` is some syntax tree node. Underlying
+//! these parser functions is a lower level mechanism built around the
+//! [`Cursor`] type. `Cursor` is a cheaply copyable cursor over a range of
+//! tokens in a token stream.
+//!
+//! [`Result<T>`]: Result
+//! [`Cursor`]: crate::buffer::Cursor
+//!
+//! # Example
+//!
+//! Here is a snippet of parsing code to get a feel for the style of the
+//! library. We define data structures for a subset of Rust syntax including
+//! enums (not shown) and structs, then provide implementations of the [`Parse`]
+//! trait to parse these syntax tree data structures from a token stream.
+//!
+//! Once `Parse` impls have been defined, they can be called conveniently from a
+//! procedural macro through [`parse_macro_input!`] as shown at the bottom of
+//! the snippet. If the caller provides syntactically invalid input to the
+//! procedural macro, they will receive a helpful compiler error message
+//! pointing out the exact token that triggered the failure to parse.
+//!
+//! [`parse_macro_input!`]: crate::parse_macro_input!
+//!
+//! ```
+//! # extern crate proc_macro;
+//! #
+//! use proc_macro::TokenStream;
+//! use syn::{braced, parse_macro_input, token, Field, Ident, Result, Token};
+//! use syn::parse::{Parse, ParseStream};
+//! use syn::punctuated::Punctuated;
+//!
+//! enum Item {
+//!     Struct(ItemStruct),
+//!     Enum(ItemEnum),
+//! }
+//!
+//! struct ItemStruct {
+//!     struct_token: Token![struct],
+//!     ident: Ident,
+//!     brace_token: token::Brace,
+//!     fields: Punctuated<Field, Token![,]>,
+//! }
+//! #
+//! # enum ItemEnum {}
+//!
+//! impl Parse for Item {
+//!     fn parse(input: ParseStream) -> Result<Self> {
+//!         let lookahead = input.lookahead1();
+//!         if lookahead.peek(Token![struct]) {
+//!             input.parse().map(Item::Struct)
+//!         } else if lookahead.peek(Token![enum]) {
+//!             input.parse().map(Item::Enum)
+//!         } else {
+//!             Err(lookahead.error())
+//!         }
+//!     }
+//! }
+//!
+//! impl Parse for ItemStruct {
+//!     fn parse(input: ParseStream) -> Result<Self> {
+//!         let content;
+//!         Ok(ItemStruct {
+//!             struct_token: input.parse()?,
+//!             ident: input.parse()?,
+//!             brace_token: braced!(content in input),
+//!             fields: content.parse_terminated(Field::parse_named, Token![,])?,
+//!         })
+//!     }
+//! }
+//! #
+//! # impl Parse for ItemEnum {
+//! #     fn parse(input: ParseStream) -> Result<Self> {
+//! #         unimplemented!()
+//! #     }
+//! # }
+//!
+//! # const IGNORE: &str = stringify! {
+//! #[proc_macro]
+//! # };
+//! pub fn my_macro(tokens: TokenStream) -> TokenStream {
+//!     let input = parse_macro_input!(tokens as Item);
+//!
+//!     /* ... */
+//! #   TokenStream::new()
+//! }
+//! ```
+//!
+//! # The `syn::parse*` functions
+//!
+//! The [`syn::parse`], [`syn::parse2`], and [`syn::parse_str`] functions serve
+//! as an entry point for parsing syntax tree nodes that can be parsed in an
+//! obvious default way. These functions can return any syntax tree node that
+//! implements the [`Parse`] trait, which includes most types in Syn.
+//!
+//! [`syn::parse`]: crate::parse()
+//! [`syn::parse2`]: crate::parse2()
+//! [`syn::parse_str`]: crate::parse_str()
+//!
+//! ```
+//! use syn::Type;
+//!
+//! # fn run_parser() -> syn::Result<()> {
+//! let t: Type = syn::parse_str("std::collections::HashMap<String, Value>")?;
+//! #     Ok(())
+//! # }
+//! #
+//! # run_parser().unwrap();
+//! ```
+//!
+//! The [`parse_quote!`] macro also uses this approach.
+//!
+//! [`parse_quote!`]: crate::parse_quote!
+//!
+//! # The `Parser` trait
+//!
+//! Some types can be parsed in several ways depending on context. For example
+//! an [`Attribute`] can be either "outer" like `#[...]` or "inner" like
+//! `#![...]` and parsing the wrong one would be a bug. Similarly [`Punctuated`]
+//! may or may not allow trailing punctuation, and parsing it the wrong way
+//! would either reject valid input or accept invalid input.
+//!
+//! [`Attribute`]: crate::Attribute
+//! [`Punctuated`]: crate::punctuated
+//!
+//! The `Parse` trait is not implemented in these cases because there is no good
+//! behavior to consider the default.
+//!
+//! ```compile_fail
+//! # extern crate proc_macro;
+//! #
+//! # use syn::punctuated::Punctuated;
+//! # use syn::{PathSegment, Result, Token};
+//! #
+//! # fn f(tokens: proc_macro::TokenStream) -> Result<()> {
+//! #
+//! // Can't parse `Punctuated` without knowing whether trailing punctuation
+//! // should be allowed in this context.
+//! let path: Punctuated<PathSegment, Token![::]> = syn::parse(tokens)?;
+//! #
+//! #     Ok(())
+//! # }
+//! ```
+//!
+//! In these cases the types provide a choice of parser functions rather than a
+//! single `Parse` implementation, and those parser functions can be invoked
+//! through the [`Parser`] trait.
+//!
+//!
+//! ```
+//! # extern crate proc_macro;
+//! #
+//! use proc_macro::TokenStream;
+//! use syn::parse::Parser;
+//! use syn::punctuated::Punctuated;
+//! use syn::{Attribute, Expr, PathSegment, Result, Token};
+//!
+//! fn call_some_parser_methods(input: TokenStream) -> Result<()> {
+//!     // Parse a nonempty sequence of path segments separated by `::` punctuation
+//!     // with no trailing punctuation.
+//!     let tokens = input.clone();
+//!     let parser = Punctuated::<PathSegment, Token![::]>::parse_separated_nonempty;
+//!     let _path = parser.parse(tokens)?;
+//!
+//!     // Parse a possibly empty sequence of expressions terminated by commas with
+//!     // an optional trailing punctuation.
+//!     let tokens = input.clone();
+//!     let parser = Punctuated::<Expr, Token![,]>::parse_terminated;
+//!     let _args = parser.parse(tokens)?;
+//!
+//!     // Parse zero or more outer attributes but not inner attributes.
+//!     let tokens = input.clone();
+//!     let parser = Attribute::parse_outer;
+//!     let _attrs = parser.parse(tokens)?;
+//!
+//!     Ok(())
+//! }
+//! ```
+
+#[path = "discouraged.rs"]
+pub mod discouraged;
+
+use crate::buffer::{Cursor, TokenBuffer};
+use crate::error;
+use crate::lookahead;
+use crate::punctuated::Punctuated;
+use crate::token::Token;
+use proc_macro2::{Delimiter, Group, Literal, Punct, Span, TokenStream, TokenTree};
+#[cfg(feature = "printing")]
+use quote::ToTokens;
+use std::cell::Cell;
+use std::fmt::{self, Debug, Display};
+#[cfg(feature = "extra-traits")]
+use std::hash::{Hash, Hasher};
+use std::marker::PhantomData;
+use std::mem;
+use std::ops::Deref;
+use std::panic::{RefUnwindSafe, UnwindSafe};
+use std::rc::Rc;
+use std::str::FromStr;
+
+pub use crate::error::{Error, Result};
+pub use crate::lookahead::{Lookahead1, Peek};
+
+/// Parsing interface implemented by all types that can be parsed in a default
+/// way from a token stream.
+///
+/// Refer to the [module documentation] for details about implementing and using
+/// the `Parse` trait.
+///
+/// [module documentation]: self
+pub trait Parse: Sized {
+    fn parse(input: ParseStream) -> Result<Self>;
+}
+
+/// Input to a Syn parser function.
+///
+/// See the methods of this type under the documentation of [`ParseBuffer`]. For
+/// an overview of parsing in Syn, refer to the [module documentation].
+///
+/// [module documentation]: self
+pub type ParseStream<'a> = &'a ParseBuffer<'a>;
+
+/// Cursor position within a buffered token stream.
+///
+/// This type is more commonly used through the type alias [`ParseStream`] which
+/// is an alias for `&ParseBuffer`.
+///
+/// `ParseStream` is the input type for all parser functions in Syn. They have
+/// the signature `fn(ParseStream) -> Result<T>`.
+///
+/// ## Calling a parser function
+///
+/// There is no public way to construct a `ParseBuffer`. Instead, if you are
+/// looking to invoke a parser function that requires `ParseStream` as input,
+/// you will need to go through one of the public parsing entry points.
+///
+/// - The [`parse_macro_input!`] macro if parsing input of a procedural macro;
+/// - One of [the `syn::parse*` functions][syn-parse]; or
+/// - A method of the [`Parser`] trait.
+///
+/// [`parse_macro_input!`]: crate::parse_macro_input!
+/// [syn-parse]: self#the-synparse-functions
+pub struct ParseBuffer<'a> {
+    scope: Span,
+    // Instead of Cell<Cursor<'a>> so that ParseBuffer<'a> is covariant in 'a.
+    // The rest of the code in this module needs to be careful that only a
+    // cursor derived from this `cell` is ever assigned to this `cell`.
+    //
+    // Cell<Cursor<'a>> cannot be covariant in 'a because then we could take a
+    // ParseBuffer<'a>, upcast to ParseBuffer<'short> for some lifetime shorter
+    // than 'a, and then assign a Cursor<'short> into the Cell.
+    //
+    // By extension, it would not be safe to expose an API that accepts a
+    // Cursor<'a> and trusts that it lives as long as the cursor currently in
+    // the cell.
+    cell: Cell<Cursor<'static>>,
+    marker: PhantomData<Cursor<'a>>,
+    unexpected: Cell<Option<Rc<Cell<Unexpected>>>>,
+}
+
+impl<'a> Drop for ParseBuffer<'a> {
+    fn drop(&mut self) {
+        if let Some(unexpected_span) = span_of_unexpected_ignoring_nones(self.cursor()) {
+            let (inner, old_span) = inner_unexpected(self);
+            if old_span.is_none() {
+                inner.set(Unexpected::Some(unexpected_span));
+            }
+        }
+    }
+}
+
+impl<'a> Display for ParseBuffer<'a> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.cursor().token_stream(), f)
+    }
+}
+
+impl<'a> Debug for ParseBuffer<'a> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.cursor().token_stream(), f)
+    }
+}
+
+impl<'a> UnwindSafe for ParseBuffer<'a> {}
+impl<'a> RefUnwindSafe for ParseBuffer<'a> {}
+
+/// Cursor state associated with speculative parsing.
+///
+/// This type is the input of the closure provided to [`ParseStream::step`].
+///
+/// [`ParseStream::step`]: ParseBuffer::step
+///
+/// # Example
+///
+/// ```
+/// use proc_macro2::TokenTree;
+/// use syn::Result;
+/// use syn::parse::ParseStream;
+///
+/// // This function advances the stream past the next occurrence of `@`. If
+/// // no `@` is present in the stream, the stream position is unchanged and
+/// // an error is returned.
+/// fn skip_past_next_at(input: ParseStream) -> Result<()> {
+///     input.step(|cursor| {
+///         let mut rest = *cursor;
+///         while let Some((tt, next)) = rest.token_tree() {
+///             match &tt {
+///                 TokenTree::Punct(punct) if punct.as_char() == '@' => {
+///                     return Ok(((), next));
+///                 }
+///                 _ => rest = next,
+///             }
+///         }
+///         Err(cursor.error("no `@` was found after this point"))
+///     })
+/// }
+/// #
+/// # fn remainder_after_skipping_past_next_at(
+/// #     input: ParseStream,
+/// # ) -> Result<proc_macro2::TokenStream> {
+/// #     skip_past_next_at(input)?;
+/// #     input.parse()
+/// # }
+/// #
+/// # use syn::parse::Parser;
+/// # let remainder = remainder_after_skipping_past_next_at
+/// #     .parse_str("a @ b c")
+/// #     .unwrap();
+/// # assert_eq!(remainder.to_string(), "b c");
+/// ```
+pub struct StepCursor<'c, 'a> {
+    scope: Span,
+    // This field is covariant in 'c.
+    cursor: Cursor<'c>,
+    // This field is contravariant in 'c. Together these make StepCursor
+    // invariant in 'c. Also covariant in 'a. The user cannot cast 'c to a
+    // different lifetime but can upcast into a StepCursor with a shorter
+    // lifetime 'a.
+    //
+    // As long as we only ever construct a StepCursor for which 'c outlives 'a,
+    // this means if ever a StepCursor<'c, 'a> exists we are guaranteed that 'c
+    // outlives 'a.
+    marker: PhantomData<fn(Cursor<'c>) -> Cursor<'a>>,
+}
+
+impl<'c, 'a> Deref for StepCursor<'c, 'a> {
+    type Target = Cursor<'c>;
+
+    fn deref(&self) -> &Self::Target {
+        &self.cursor
+    }
+}
+
+impl<'c, 'a> Copy for StepCursor<'c, 'a> {}
+
+impl<'c, 'a> Clone for StepCursor<'c, 'a> {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+impl<'c, 'a> StepCursor<'c, 'a> {
+    /// Triggers an error at the current position of the parse stream.
+    ///
+    /// The `ParseStream::step` invocation will return this same error without
+    /// advancing the stream state.
+    pub fn error<T: Display>(self, message: T) -> Error {
+        error::new_at(self.scope, self.cursor, message)
+    }
+}
+
+pub(crate) fn advance_step_cursor<'c, 'a>(proof: StepCursor<'c, 'a>, to: Cursor<'c>) -> Cursor<'a> {
+    // Refer to the comments within the StepCursor definition. We use the
+    // fact that a StepCursor<'c, 'a> exists as proof that 'c outlives 'a.
+    // Cursor is covariant in its lifetime parameter so we can cast a
+    // Cursor<'c> to one with the shorter lifetime Cursor<'a>.
+    let _ = proof;
+    unsafe { mem::transmute::<Cursor<'c>, Cursor<'a>>(to) }
+}
+
+pub(crate) fn new_parse_buffer(
+    scope: Span,
+    cursor: Cursor,
+    unexpected: Rc<Cell<Unexpected>>,
+) -> ParseBuffer {
+    ParseBuffer {
+        scope,
+        // See comment on `cell` in the struct definition.
+        cell: Cell::new(unsafe { mem::transmute::<Cursor, Cursor<'static>>(cursor) }),
+        marker: PhantomData,
+        unexpected: Cell::new(Some(unexpected)),
+    }
+}
+
+pub(crate) enum Unexpected {
+    None,
+    Some(Span),
+    Chain(Rc<Cell<Unexpected>>),
+}
+
+impl Default for Unexpected {
+    fn default() -> Self {
+        Unexpected::None
+    }
+}
+
+impl Clone for Unexpected {
+    fn clone(&self) -> Self {
+        match self {
+            Unexpected::None => Unexpected::None,
+            Unexpected::Some(span) => Unexpected::Some(*span),
+            Unexpected::Chain(next) => Unexpected::Chain(next.clone()),
+        }
+    }
+}
+
+// We call this on Cell<Unexpected> and Cell<Option<T>> where temporarily
+// swapping in a None is cheap.
+fn cell_clone<T: Default + Clone>(cell: &Cell<T>) -> T {
+    let prev = cell.take();
+    let ret = prev.clone();
+    cell.set(prev);
+    ret
+}
+
+fn inner_unexpected(buffer: &ParseBuffer) -> (Rc<Cell<Unexpected>>, Option<Span>) {
+    let mut unexpected = get_unexpected(buffer);
+    loop {
+        match cell_clone(&unexpected) {
+            Unexpected::None => return (unexpected, None),
+            Unexpected::Some(span) => return (unexpected, Some(span)),
+            Unexpected::Chain(next) => unexpected = next,
+        }
+    }
+}
+
+pub(crate) fn get_unexpected(buffer: &ParseBuffer) -> Rc<Cell<Unexpected>> {
+    cell_clone(&buffer.unexpected).unwrap()
+}
+
+fn span_of_unexpected_ignoring_nones(mut cursor: Cursor) -> Option<Span> {
+    if cursor.eof() {
+        return None;
+    }
+    while let Some((inner, _span, rest)) = cursor.group(Delimiter::None) {
+        if let Some(unexpected) = span_of_unexpected_ignoring_nones(inner) {
+            return Some(unexpected);
+        }
+        cursor = rest;
+    }
+    if cursor.eof() {
+        None
+    } else {
+        Some(cursor.span())
+    }
+}
+
+impl<'a> ParseBuffer<'a> {
+    /// Parses a syntax tree node of type `T`, advancing the position of our
+    /// parse stream past it.
+    pub fn parse<T: Parse>(&self) -> Result<T> {
+        T::parse(self)
+    }
+
+    /// Calls the given parser function to parse a syntax tree node of type `T`
+    /// from this stream.
+    ///
+    /// # Example
+    ///
+    /// The parser below invokes [`Attribute::parse_outer`] to parse a vector of
+    /// zero or more outer attributes.
+    ///
+    /// [`Attribute::parse_outer`]: crate::Attribute::parse_outer
+    ///
+    /// ```
+    /// use syn::{Attribute, Ident, Result, Token};
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// // Parses a unit struct with attributes.
+    /// //
+    /// //     #[path = "s.tmpl"]
+    /// //     struct S;
+    /// struct UnitStruct {
+    ///     attrs: Vec<Attribute>,
+    ///     struct_token: Token![struct],
+    ///     name: Ident,
+    ///     semi_token: Token![;],
+    /// }
+    ///
+    /// impl Parse for UnitStruct {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         Ok(UnitStruct {
+    ///             attrs: input.call(Attribute::parse_outer)?,
+    ///             struct_token: input.parse()?,
+    ///             name: input.parse()?,
+    ///             semi_token: input.parse()?,
+    ///         })
+    ///     }
+    /// }
+    /// ```
+    pub fn call<T>(&self, function: fn(ParseStream) -> Result<T>) -> Result<T> {
+        function(self)
+    }
+
+    /// Looks at the next token in the parse stream to determine whether it
+    /// matches the requested type of token.
+    ///
+    /// Does not advance the position of the parse stream.
+    ///
+    /// # Syntax
+    ///
+    /// Note that this method does not use turbofish syntax. Pass the peek type
+    /// inside of parentheses.
+    ///
+    /// - `input.peek(Token![struct])`
+    /// - `input.peek(Token![==])`
+    /// - `input.peek(syn::Ident)`&emsp;*(does not accept keywords)*
+    /// - `input.peek(syn::Ident::peek_any)`
+    /// - `input.peek(Lifetime)`
+    /// - `input.peek(token::Brace)`
+    ///
+    /// # Example
+    ///
+    /// In this example we finish parsing the list of supertraits when the next
+    /// token in the input is either `where` or an opening curly brace.
+    ///
+    /// ```
+    /// use syn::{braced, token, Generics, Ident, Result, Token, TypeParamBound};
+    /// use syn::parse::{Parse, ParseStream};
+    /// use syn::punctuated::Punctuated;
+    ///
+    /// // Parses a trait definition containing no associated items.
+    /// //
+    /// //     trait Marker<'de, T>: A + B<'de> where Box<T>: Clone {}
+    /// struct MarkerTrait {
+    ///     trait_token: Token![trait],
+    ///     ident: Ident,
+    ///     generics: Generics,
+    ///     colon_token: Option<Token![:]>,
+    ///     supertraits: Punctuated<TypeParamBound, Token![+]>,
+    ///     brace_token: token::Brace,
+    /// }
+    ///
+    /// impl Parse for MarkerTrait {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let trait_token: Token![trait] = input.parse()?;
+    ///         let ident: Ident = input.parse()?;
+    ///         let mut generics: Generics = input.parse()?;
+    ///         let colon_token: Option<Token![:]> = input.parse()?;
+    ///
+    ///         let mut supertraits = Punctuated::new();
+    ///         if colon_token.is_some() {
+    ///             loop {
+    ///                 supertraits.push_value(input.parse()?);
+    ///                 if input.peek(Token![where]) || input.peek(token::Brace) {
+    ///                     break;
+    ///                 }
+    ///                 supertraits.push_punct(input.parse()?);
+    ///             }
+    ///         }
+    ///
+    ///         generics.where_clause = input.parse()?;
+    ///         let content;
+    ///         let empty_brace_token = braced!(content in input);
+    ///
+    ///         Ok(MarkerTrait {
+    ///             trait_token,
+    ///             ident,
+    ///             generics,
+    ///             colon_token,
+    ///             supertraits,
+    ///             brace_token: empty_brace_token,
+    ///         })
+    ///     }
+    /// }
+    /// ```
+    pub fn peek<T: Peek>(&self, token: T) -> bool {
+        let _ = token;
+        T::Token::peek(self.cursor())
+    }
+
+    /// Looks at the second-next token in the parse stream.
+    ///
+    /// This is commonly useful as a way to implement contextual keywords.
+    ///
+    /// # Example
+    ///
+    /// This example needs to use `peek2` because the symbol `union` is not a
+    /// keyword in Rust. We can't use just `peek` and decide to parse a union if
+    /// the very next token is `union`, because someone is free to write a `mod
+    /// union` and a macro invocation that looks like `union::some_macro! { ...
+    /// }`. In other words `union` is a contextual keyword.
+    ///
+    /// ```
+    /// use syn::{Ident, ItemUnion, Macro, Result, Token};
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// // Parses either a union or a macro invocation.
+    /// enum UnionOrMacro {
+    ///     // union MaybeUninit<T> { uninit: (), value: T }
+    ///     Union(ItemUnion),
+    ///     // lazy_static! { ... }
+    ///     Macro(Macro),
+    /// }
+    ///
+    /// impl Parse for UnionOrMacro {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         if input.peek(Token![union]) && input.peek2(Ident) {
+    ///             input.parse().map(UnionOrMacro::Union)
+    ///         } else {
+    ///             input.parse().map(UnionOrMacro::Macro)
+    ///         }
+    ///     }
+    /// }
+    /// ```
+    pub fn peek2<T: Peek>(&self, token: T) -> bool {
+        fn peek2(buffer: &ParseBuffer, peek: fn(Cursor) -> bool) -> bool {
+            buffer.cursor().skip().map_or(false, peek)
+        }
+
+        let _ = token;
+        peek2(self, T::Token::peek)
+    }
+
+    /// Looks at the third-next token in the parse stream.
+    pub fn peek3<T: Peek>(&self, token: T) -> bool {
+        fn peek3(buffer: &ParseBuffer, peek: fn(Cursor) -> bool) -> bool {
+            buffer
+                .cursor()
+                .skip()
+                .and_then(Cursor::skip)
+                .map_or(false, peek)
+        }
+
+        let _ = token;
+        peek3(self, T::Token::peek)
+    }
+
+    /// Parses zero or more occurrences of `T` separated by punctuation of type
+    /// `P`, with optional trailing punctuation.
+    ///
+    /// Parsing continues until the end of this parse stream. The entire content
+    /// of this parse stream must consist of `T` and `P`.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// # use quote::quote;
+    /// #
+    /// use syn::{parenthesized, token, Ident, Result, Token, Type};
+    /// use syn::parse::{Parse, ParseStream};
+    /// use syn::punctuated::Punctuated;
+    ///
+    /// // Parse a simplified tuple struct syntax like:
+    /// //
+    /// //     struct S(A, B);
+    /// struct TupleStruct {
+    ///     struct_token: Token![struct],
+    ///     ident: Ident,
+    ///     paren_token: token::Paren,
+    ///     fields: Punctuated<Type, Token![,]>,
+    ///     semi_token: Token![;],
+    /// }
+    ///
+    /// impl Parse for TupleStruct {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let content;
+    ///         Ok(TupleStruct {
+    ///             struct_token: input.parse()?,
+    ///             ident: input.parse()?,
+    ///             paren_token: parenthesized!(content in input),
+    ///             fields: content.parse_terminated(Type::parse, Token![,])?,
+    ///             semi_token: input.parse()?,
+    ///         })
+    ///     }
+    /// }
+    /// #
+    /// # let input = quote! {
+    /// #     struct S(A, B);
+    /// # };
+    /// # syn::parse2::<TupleStruct>(input).unwrap();
+    /// ```
+    ///
+    /// # See also
+    ///
+    /// If your separator is anything more complicated than an invocation of the
+    /// `Token!` macro, this method won't be applicable and you can instead
+    /// directly use `Punctuated`'s parser functions: [`parse_terminated`],
+    /// [`parse_separated_nonempty`] etc.
+    ///
+    /// [`parse_terminated`]: Punctuated::parse_terminated
+    /// [`parse_separated_nonempty`]: Punctuated::parse_separated_nonempty
+    ///
+    /// ```
+    /// use syn::{custom_keyword, Expr, Result, Token};
+    /// use syn::parse::{Parse, ParseStream};
+    /// use syn::punctuated::Punctuated;
+    ///
+    /// mod kw {
+    ///     syn::custom_keyword!(fin);
+    /// }
+    ///
+    /// struct Fin(kw::fin, Token![;]);
+    ///
+    /// impl Parse for Fin {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         Ok(Self(input.parse()?, input.parse()?))
+    ///     }
+    /// }
+    ///
+    /// struct Thing {
+    ///     steps: Punctuated<Expr, Fin>,
+    /// }
+    ///
+    /// impl Parse for Thing {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    /// # if true {
+    ///         Ok(Thing {
+    ///             steps: Punctuated::parse_terminated(input)?,
+    ///         })
+    /// # } else {
+    ///         // or equivalently, this means the same thing:
+    /// #       Ok(Thing {
+    ///             steps: input.call(Punctuated::parse_terminated)?,
+    /// #       })
+    /// # }
+    ///     }
+    /// }
+    /// ```
+    pub fn parse_terminated<T, P>(
+        &self,
+        parser: fn(ParseStream) -> Result<T>,
+        separator: P,
+    ) -> Result<Punctuated<T, P::Token>>
+    where
+        P: Peek,
+        P::Token: Parse,
+    {
+        let _ = separator;
+        Punctuated::parse_terminated_with(self, parser)
+    }
+
+    /// Returns whether there are no more tokens remaining to be parsed from
+    /// this stream.
+    ///
+    /// This method returns true upon reaching the end of the content within a
+    /// set of delimiters, as well as at the end of the tokens provided to the
+    /// outermost parsing entry point.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{braced, token, Ident, Item, Result, Token};
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// // Parses a Rust `mod m { ... }` containing zero or more items.
+    /// struct Mod {
+    ///     mod_token: Token![mod],
+    ///     name: Ident,
+    ///     brace_token: token::Brace,
+    ///     items: Vec<Item>,
+    /// }
+    ///
+    /// impl Parse for Mod {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let content;
+    ///         Ok(Mod {
+    ///             mod_token: input.parse()?,
+    ///             name: input.parse()?,
+    ///             brace_token: braced!(content in input),
+    ///             items: {
+    ///                 let mut items = Vec::new();
+    ///                 while !content.is_empty() {
+    ///                     items.push(content.parse()?);
+    ///                 }
+    ///                 items
+    ///             },
+    ///         })
+    ///     }
+    /// }
+    /// ```
+    pub fn is_empty(&self) -> bool {
+        self.cursor().eof()
+    }
+
+    /// Constructs a helper for peeking at the next token in this stream and
+    /// building an error message if it is not one of a set of expected tokens.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{ConstParam, Ident, Lifetime, LifetimeParam, Result, Token, TypeParam};
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// // A generic parameter, a single one of the comma-separated elements inside
+    /// // angle brackets in:
+    /// //
+    /// //     fn f<T: Clone, 'a, 'b: 'a, const N: usize>() { ... }
+    /// //
+    /// // On invalid input, lookahead gives us a reasonable error message.
+    /// //
+    /// //     error: expected one of: identifier, lifetime, `const`
+    /// //       |
+    /// //     5 |     fn f<!Sized>() {}
+    /// //       |          ^
+    /// enum GenericParam {
+    ///     Type(TypeParam),
+    ///     Lifetime(LifetimeParam),
+    ///     Const(ConstParam),
+    /// }
+    ///
+    /// impl Parse for GenericParam {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let lookahead = input.lookahead1();
+    ///         if lookahead.peek(Ident) {
+    ///             input.parse().map(GenericParam::Type)
+    ///         } else if lookahead.peek(Lifetime) {
+    ///             input.parse().map(GenericParam::Lifetime)
+    ///         } else if lookahead.peek(Token![const]) {
+    ///             input.parse().map(GenericParam::Const)
+    ///         } else {
+    ///             Err(lookahead.error())
+    ///         }
+    ///     }
+    /// }
+    /// ```
+    pub fn lookahead1(&self) -> Lookahead1<'a> {
+        lookahead::new(self.scope, self.cursor())
+    }
+
+    /// Forks a parse stream so that parsing tokens out of either the original
+    /// or the fork does not advance the position of the other.
+    ///
+    /// # Performance
+    ///
+    /// Forking a parse stream is a cheap fixed amount of work and does not
+    /// involve copying token buffers. Where you might hit performance problems
+    /// is if your macro ends up parsing a large amount of content more than
+    /// once.
+    ///
+    /// ```
+    /// # use syn::{Expr, Result};
+    /// # use syn::parse::ParseStream;
+    /// #
+    /// # fn bad(input: ParseStream) -> Result<Expr> {
+    /// // Do not do this.
+    /// if input.fork().parse::<Expr>().is_ok() {
+    ///     return input.parse::<Expr>();
+    /// }
+    /// # unimplemented!()
+    /// # }
+    /// ```
+    ///
+    /// As a rule, avoid parsing an unbounded amount of tokens out of a forked
+    /// parse stream. Only use a fork when the amount of work performed against
+    /// the fork is small and bounded.
+    ///
+    /// When complex speculative parsing against the forked stream is
+    /// unavoidable, use [`parse::discouraged::Speculative`] to advance the
+    /// original stream once the fork's parse is determined to have been
+    /// successful.
+    ///
+    /// For a lower level way to perform speculative parsing at the token level,
+    /// consider using [`ParseStream::step`] instead.
+    ///
+    /// [`parse::discouraged::Speculative`]: discouraged::Speculative
+    /// [`ParseStream::step`]: ParseBuffer::step
+    ///
+    /// # Example
+    ///
+    /// The parse implementation shown here parses possibly restricted `pub`
+    /// visibilities.
+    ///
+    /// - `pub`
+    /// - `pub(crate)`
+    /// - `pub(self)`
+    /// - `pub(super)`
+    /// - `pub(in some::path)`
+    ///
+    /// To handle the case of visibilities inside of tuple structs, the parser
+    /// needs to distinguish parentheses that specify visibility restrictions
+    /// from parentheses that form part of a tuple type.
+    ///
+    /// ```
+    /// # struct A;
+    /// # struct B;
+    /// # struct C;
+    /// #
+    /// struct S(pub(crate) A, pub (B, C));
+    /// ```
+    ///
+    /// In this example input the first tuple struct element of `S` has
+    /// `pub(crate)` visibility while the second tuple struct element has `pub`
+    /// visibility; the parentheses around `(B, C)` are part of the type rather
+    /// than part of a visibility restriction.
+    ///
+    /// The parser uses a forked parse stream to check the first token inside of
+    /// parentheses after the `pub` keyword. This is a small bounded amount of
+    /// work performed against the forked parse stream.
+    ///
+    /// ```
+    /// use syn::{parenthesized, token, Ident, Path, Result, Token};
+    /// use syn::ext::IdentExt;
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// struct PubVisibility {
+    ///     pub_token: Token![pub],
+    ///     restricted: Option<Restricted>,
+    /// }
+    ///
+    /// struct Restricted {
+    ///     paren_token: token::Paren,
+    ///     in_token: Option<Token![in]>,
+    ///     path: Path,
+    /// }
+    ///
+    /// impl Parse for PubVisibility {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let pub_token: Token![pub] = input.parse()?;
+    ///
+    ///         if input.peek(token::Paren) {
+    ///             let ahead = input.fork();
+    ///             let mut content;
+    ///             parenthesized!(content in ahead);
+    ///
+    ///             if content.peek(Token![crate])
+    ///                 || content.peek(Token![self])
+    ///                 || content.peek(Token![super])
+    ///             {
+    ///                 return Ok(PubVisibility {
+    ///                     pub_token,
+    ///                     restricted: Some(Restricted {
+    ///                         paren_token: parenthesized!(content in input),
+    ///                         in_token: None,
+    ///                         path: Path::from(content.call(Ident::parse_any)?),
+    ///                     }),
+    ///                 });
+    ///             } else if content.peek(Token![in]) {
+    ///                 return Ok(PubVisibility {
+    ///                     pub_token,
+    ///                     restricted: Some(Restricted {
+    ///                         paren_token: parenthesized!(content in input),
+    ///                         in_token: Some(content.parse()?),
+    ///                         path: content.call(Path::parse_mod_style)?,
+    ///                     }),
+    ///                 });
+    ///             }
+    ///         }
+    ///
+    ///         Ok(PubVisibility {
+    ///             pub_token,
+    ///             restricted: None,
+    ///         })
+    ///     }
+    /// }
+    /// ```
+    pub fn fork(&self) -> Self {
+        ParseBuffer {
+            scope: self.scope,
+            cell: self.cell.clone(),
+            marker: PhantomData,
+            // Not the parent's unexpected. Nothing cares whether the clone
+            // parses all the way unless we `advance_to`.
+            unexpected: Cell::new(Some(Rc::new(Cell::new(Unexpected::None)))),
+        }
+    }
+
+    /// Triggers an error at the current position of the parse stream.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{Expr, Result, Token};
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// // Some kind of loop: `while` or `for` or `loop`.
+    /// struct Loop {
+    ///     expr: Expr,
+    /// }
+    ///
+    /// impl Parse for Loop {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         if input.peek(Token![while])
+    ///             || input.peek(Token![for])
+    ///             || input.peek(Token![loop])
+    ///         {
+    ///             Ok(Loop {
+    ///                 expr: input.parse()?,
+    ///             })
+    ///         } else {
+    ///             Err(input.error("expected some kind of loop"))
+    ///         }
+    ///     }
+    /// }
+    /// ```
+    pub fn error<T: Display>(&self, message: T) -> Error {
+        error::new_at(self.scope, self.cursor(), message)
+    }
+
+    /// Speculatively parses tokens from this parse stream, advancing the
+    /// position of this stream only if parsing succeeds.
+    ///
+    /// This is a powerful low-level API used for defining the `Parse` impls of
+    /// the basic built-in token types. It is not something that will be used
+    /// widely outside of the Syn codebase.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use proc_macro2::TokenTree;
+    /// use syn::Result;
+    /// use syn::parse::ParseStream;
+    ///
+    /// // This function advances the stream past the next occurrence of `@`. If
+    /// // no `@` is present in the stream, the stream position is unchanged and
+    /// // an error is returned.
+    /// fn skip_past_next_at(input: ParseStream) -> Result<()> {
+    ///     input.step(|cursor| {
+    ///         let mut rest = *cursor;
+    ///         while let Some((tt, next)) = rest.token_tree() {
+    ///             match &tt {
+    ///                 TokenTree::Punct(punct) if punct.as_char() == '@' => {
+    ///                     return Ok(((), next));
+    ///                 }
+    ///                 _ => rest = next,
+    ///             }
+    ///         }
+    ///         Err(cursor.error("no `@` was found after this point"))
+    ///     })
+    /// }
+    /// #
+    /// # fn remainder_after_skipping_past_next_at(
+    /// #     input: ParseStream,
+    /// # ) -> Result<proc_macro2::TokenStream> {
+    /// #     skip_past_next_at(input)?;
+    /// #     input.parse()
+    /// # }
+    /// #
+    /// # use syn::parse::Parser;
+    /// # let remainder = remainder_after_skipping_past_next_at
+    /// #     .parse_str("a @ b c")
+    /// #     .unwrap();
+    /// # assert_eq!(remainder.to_string(), "b c");
+    /// ```
+    pub fn step<F, R>(&self, function: F) -> Result<R>
+    where
+        F: for<'c> FnOnce(StepCursor<'c, 'a>) -> Result<(R, Cursor<'c>)>,
+    {
+        // Since the user's function is required to work for any 'c, we know
+        // that the Cursor<'c> they return is either derived from the input
+        // StepCursor<'c, 'a> or from a Cursor<'static>.
+        //
+        // It would not be legal to write this function without the invariant
+        // lifetime 'c in StepCursor<'c, 'a>. If this function were written only
+        // in terms of 'a, the user could take our ParseBuffer<'a>, upcast it to
+        // a ParseBuffer<'short> which some shorter lifetime than 'a, invoke
+        // `step` on their ParseBuffer<'short> with a closure that returns
+        // Cursor<'short>, and we would wrongly write that Cursor<'short> into
+        // the Cell intended to hold Cursor<'a>.
+        //
+        // In some cases it may be necessary for R to contain a Cursor<'a>.
+        // Within Syn we solve this using `advance_step_cursor` which uses the
+        // existence of a StepCursor<'c, 'a> as proof that it is safe to cast
+        // from Cursor<'c> to Cursor<'a>. If needed outside of Syn, it would be
+        // safe to expose that API as a method on StepCursor.
+        let (node, rest) = function(StepCursor {
+            scope: self.scope,
+            cursor: self.cell.get(),
+            marker: PhantomData,
+        })?;
+        self.cell.set(rest);
+        Ok(node)
+    }
+
+    /// Returns the `Span` of the next token in the parse stream, or
+    /// `Span::call_site()` if this parse stream has completely exhausted its
+    /// input `TokenStream`.
+    pub fn span(&self) -> Span {
+        let cursor = self.cursor();
+        if cursor.eof() {
+            self.scope
+        } else {
+            crate::buffer::open_span_of_group(cursor)
+        }
+    }
+
+    /// Provides low-level access to the token representation underlying this
+    /// parse stream.
+    ///
+    /// Cursors are immutable so no operations you perform against the cursor
+    /// will affect the state of this parse stream.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use proc_macro2::TokenStream;
+    /// use syn::buffer::Cursor;
+    /// use syn::parse::{ParseStream, Result};
+    ///
+    /// // Run a parser that returns T, but get its output as TokenStream instead of T.
+    /// // This works without T needing to implement ToTokens.
+    /// fn recognize_token_stream<T>(
+    ///     recognizer: fn(ParseStream) -> Result<T>,
+    /// ) -> impl Fn(ParseStream) -> Result<TokenStream> {
+    ///     move |input| {
+    ///         let begin = input.cursor();
+    ///         recognizer(input)?;
+    ///         let end = input.cursor();
+    ///         Ok(tokens_between(begin, end))
+    ///     }
+    /// }
+    ///
+    /// // Collect tokens between two cursors as a TokenStream.
+    /// fn tokens_between(begin: Cursor, end: Cursor) -> TokenStream {
+    ///     assert!(begin <= end);
+    ///
+    ///     let mut cursor = begin;
+    ///     let mut tokens = TokenStream::new();
+    ///     while cursor < end {
+    ///         let (token, next) = cursor.token_tree().unwrap();
+    ///         tokens.extend(std::iter::once(token));
+    ///         cursor = next;
+    ///     }
+    ///     tokens
+    /// }
+    ///
+    /// fn main() {
+    ///     use quote::quote;
+    ///     use syn::parse::{Parse, Parser};
+    ///     use syn::Token;
+    ///
+    ///     // Parse syn::Type as a TokenStream, surrounded by angle brackets.
+    ///     fn example(input: ParseStream) -> Result<TokenStream> {
+    ///         let _langle: Token![<] = input.parse()?;
+    ///         let ty = recognize_token_stream(syn::Type::parse)(input)?;
+    ///         let _rangle: Token![>] = input.parse()?;
+    ///         Ok(ty)
+    ///     }
+    ///
+    ///     let tokens = quote! { <fn() -> u8> };
+    ///     println!("{}", example.parse2(tokens).unwrap());
+    /// }
+    /// ```
+    pub fn cursor(&self) -> Cursor<'a> {
+        self.cell.get()
+    }
+
+    fn check_unexpected(&self) -> Result<()> {
+        match inner_unexpected(self).1 {
+            Some(span) => Err(Error::new(span, "unexpected token")),
+            None => Ok(()),
+        }
+    }
+}
+
+#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+impl<T: Parse> Parse for Box<T> {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.parse().map(Box::new)
+    }
+}
+
+#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+impl<T: Parse + Token> Parse for Option<T> {
+    fn parse(input: ParseStream) -> Result<Self> {
+        if T::peek(input.cursor()) {
+            Ok(Some(input.parse()?))
+        } else {
+            Ok(None)
+        }
+    }
+}
+
+#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+impl Parse for TokenStream {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| Ok((cursor.token_stream(), Cursor::empty())))
+    }
+}
+
+#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+impl Parse for TokenTree {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| match cursor.token_tree() {
+            Some((tt, rest)) => Ok((tt, rest)),
+            None => Err(cursor.error("expected token tree")),
+        })
+    }
+}
+
+#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+impl Parse for Group {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| {
+            if let Some((group, rest)) = cursor.any_group_token() {
+                if group.delimiter() != Delimiter::None {
+                    return Ok((group, rest));
+                }
+            }
+            Err(cursor.error("expected group token"))
+        })
+    }
+}
+
+#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+impl Parse for Punct {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| match cursor.punct() {
+            Some((punct, rest)) => Ok((punct, rest)),
+            None => Err(cursor.error("expected punctuation token")),
+        })
+    }
+}
+
+#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+impl Parse for Literal {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| match cursor.literal() {
+            Some((literal, rest)) => Ok((literal, rest)),
+            None => Err(cursor.error("expected literal token")),
+        })
+    }
+}
+
+/// Parser that can parse Rust tokens into a particular syntax tree node.
+///
+/// Refer to the [module documentation] for details about parsing in Syn.
+///
+/// [module documentation]: self
+pub trait Parser: Sized {
+    type Output;
+
+    /// Parse a proc-macro2 token stream into the chosen syntax tree node.
+    ///
+    /// This function will check that the input is fully parsed. If there are
+    /// any unparsed tokens at the end of the stream, an error is returned.
+    fn parse2(self, tokens: TokenStream) -> Result<Self::Output>;
+
+    /// Parse tokens of source code into the chosen syntax tree node.
+    ///
+    /// This function will check that the input is fully parsed. If there are
+    /// any unparsed tokens at the end of the stream, an error is returned.
+    #[cfg(feature = "proc-macro")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "proc-macro")))]
+    fn parse(self, tokens: proc_macro::TokenStream) -> Result<Self::Output> {
+        self.parse2(proc_macro2::TokenStream::from(tokens))
+    }
+
+    /// Parse a string of Rust code into the chosen syntax tree node.
+    ///
+    /// This function will check that the input is fully parsed. If there are
+    /// any unparsed tokens at the end of the string, an error is returned.
+    ///
+    /// # Hygiene
+    ///
+    /// Every span in the resulting syntax tree will be set to resolve at the
+    /// macro call site.
+    fn parse_str(self, s: &str) -> Result<Self::Output> {
+        self.parse2(proc_macro2::TokenStream::from_str(s)?)
+    }
+
+    // Not public API.
+    #[doc(hidden)]
+    fn __parse_scoped(self, scope: Span, tokens: TokenStream) -> Result<Self::Output> {
+        let _ = scope;
+        self.parse2(tokens)
+    }
+}
+
+fn tokens_to_parse_buffer(tokens: &TokenBuffer) -> ParseBuffer {
+    let scope = Span::call_site();
+    let cursor = tokens.begin();
+    let unexpected = Rc::new(Cell::new(Unexpected::None));
+    new_parse_buffer(scope, cursor, unexpected)
+}
+
+impl<F, T> Parser for F
+where
+    F: FnOnce(ParseStream) -> Result<T>,
+{
+    type Output = T;
+
+    fn parse2(self, tokens: TokenStream) -> Result<T> {
+        let buf = TokenBuffer::new2(tokens);
+        let state = tokens_to_parse_buffer(&buf);
+        let node = self(&state)?;
+        state.check_unexpected()?;
+        if let Some(unexpected_span) = span_of_unexpected_ignoring_nones(state.cursor()) {
+            Err(Error::new(unexpected_span, "unexpected token"))
+        } else {
+            Ok(node)
+        }
+    }
+
+    fn __parse_scoped(self, scope: Span, tokens: TokenStream) -> Result<Self::Output> {
+        let buf = TokenBuffer::new2(tokens);
+        let cursor = buf.begin();
+        let unexpected = Rc::new(Cell::new(Unexpected::None));
+        let state = new_parse_buffer(scope, cursor, unexpected);
+        let node = self(&state)?;
+        state.check_unexpected()?;
+        if let Some(unexpected_span) = span_of_unexpected_ignoring_nones(state.cursor()) {
+            Err(Error::new(unexpected_span, "unexpected token"))
+        } else {
+            Ok(node)
+        }
+    }
+}
+
+pub(crate) fn parse_scoped<F: Parser>(f: F, scope: Span, tokens: TokenStream) -> Result<F::Output> {
+    f.__parse_scoped(scope, tokens)
+}
+
+/// An empty syntax tree node that consumes no tokens when parsed.
+///
+/// This is useful for attribute macros that want to ensure they are not
+/// provided any attribute args.
+///
+/// ```
+/// # extern crate proc_macro;
+/// #
+/// use proc_macro::TokenStream;
+/// use syn::parse_macro_input;
+/// use syn::parse::Nothing;
+///
+/// # const IGNORE: &str = stringify! {
+/// #[proc_macro_attribute]
+/// # };
+/// pub fn my_attr(args: TokenStream, input: TokenStream) -> TokenStream {
+///     parse_macro_input!(args as Nothing);
+///
+///     /* ... */
+/// #   TokenStream::new()
+/// }
+/// ```
+///
+/// ```text
+/// error: unexpected token
+///  --> src/main.rs:3:19
+///   |
+/// 3 | #[my_attr(asdf)]
+///   |           ^^^^
+/// ```
+pub struct Nothing;
+
+impl Parse for Nothing {
+    fn parse(_input: ParseStream) -> Result<Self> {
+        Ok(Nothing)
+    }
+}
+
+#[cfg(feature = "printing")]
+#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+impl ToTokens for Nothing {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        let _ = tokens;
+    }
+}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for Nothing {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Copy for Nothing {}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for Nothing {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str("Nothing")
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Eq for Nothing {}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for Nothing {
+    fn eq(&self, _other: &Self) -> bool {
+        true
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for Nothing {
+    fn hash<H: Hasher>(&self, _state: &mut H) {}
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/parse_macro_input.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/parse_macro_input.rs
--- 43.0.0-1/rust-vendor/syn/src/parse_macro_input.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/parse_macro_input.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,128 @@
+/// Parse the input TokenStream of a macro, triggering a compile error if the
+/// tokens fail to parse.
+///
+/// Refer to the [`parse` module] documentation for more details about parsing
+/// in Syn.
+///
+/// [`parse` module]: mod@crate::parse
+///
+/// <br>
+///
+/// # Intended usage
+///
+/// This macro must be called from a function that returns
+/// `proc_macro::TokenStream`. Usually this will be your proc macro entry point,
+/// the function that has the #\[proc_macro\] / #\[proc_macro_derive\] /
+/// #\[proc_macro_attribute\] attribute.
+///
+/// ```
+/// # extern crate proc_macro;
+/// #
+/// use proc_macro::TokenStream;
+/// use syn::{parse_macro_input, Result};
+/// use syn::parse::{Parse, ParseStream};
+///
+/// struct MyMacroInput {
+///     /* ... */
+/// }
+///
+/// impl Parse for MyMacroInput {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         /* ... */
+/// #       Ok(MyMacroInput {})
+///     }
+/// }
+///
+/// # const IGNORE: &str = stringify! {
+/// #[proc_macro]
+/// # };
+/// pub fn my_macro(tokens: TokenStream) -> TokenStream {
+///     let input = parse_macro_input!(tokens as MyMacroInput);
+///
+///     /* ... */
+/// #   TokenStream::new()
+/// }
+/// ```
+///
+/// <br>
+///
+/// # Usage with Parser
+///
+/// This macro can also be used with the [`Parser` trait] for types that have
+/// multiple ways that they can be parsed.
+///
+/// [`Parser` trait]: crate::parse::Parser
+///
+/// ```
+/// # extern crate proc_macro;
+/// #
+/// # use proc_macro::TokenStream;
+/// # use syn::{parse_macro_input, Result};
+/// # use syn::parse::ParseStream;
+/// #
+/// # struct MyMacroInput {}
+/// #
+/// impl MyMacroInput {
+///     fn parse_alternate(input: ParseStream) -> Result<Self> {
+///         /* ... */
+/// #       Ok(MyMacroInput {})
+///     }
+/// }
+///
+/// # const IGNORE: &str = stringify! {
+/// #[proc_macro]
+/// # };
+/// pub fn my_macro(tokens: TokenStream) -> TokenStream {
+///     let input = parse_macro_input!(tokens with MyMacroInput::parse_alternate);
+///
+///     /* ... */
+/// #   TokenStream::new()
+/// }
+/// ```
+///
+/// <br>
+///
+/// # Expansion
+///
+/// `parse_macro_input!($variable as $Type)` expands to something like:
+///
+/// ```no_run
+/// # extern crate proc_macro;
+/// #
+/// # macro_rules! doc_test {
+/// #     ($variable:ident as $Type:ty) => {
+/// match syn::parse::<$Type>($variable) {
+///     Ok(syntax_tree) => syntax_tree,
+///     Err(err) => return proc_macro::TokenStream::from(err.to_compile_error()),
+/// }
+/// #     };
+/// # }
+/// #
+/// # fn test(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
+/// #     let _ = doc_test!(input as syn::Ident);
+/// #     proc_macro::TokenStream::new()
+/// # }
+/// ```
+#[macro_export]
+#[cfg_attr(docsrs, doc(cfg(all(feature = "parsing", feature = "proc-macro"))))]
+macro_rules! parse_macro_input {
+    ($tokenstream:ident as $ty:ty) => {
+        match $crate::parse::<$ty>($tokenstream) {
+            $crate::__private::Ok(data) => data,
+            $crate::__private::Err(err) => {
+                return $crate::__private::TokenStream::from(err.to_compile_error());
+            }
+        }
+    };
+    ($tokenstream:ident with $parser:path) => {
+        match $crate::parse::Parser::parse($parser, $tokenstream) {
+            $crate::__private::Ok(data) => data,
+            $crate::__private::Err(err) => {
+                return $crate::__private::TokenStream::from(err.to_compile_error());
+            }
+        }
+    };
+    ($tokenstream:ident) => {
+        $crate::parse_macro_input!($tokenstream as _)
+    };
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/parse_quote.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/parse_quote.rs
--- 43.0.0-1/rust-vendor/syn/src/parse_quote.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/parse_quote.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,211 @@
+/// Quasi-quotation macro that accepts input like the [`quote!`] macro but uses
+/// type inference to figure out a return type for those tokens.
+///
+/// [`quote!`]: https://docs.rs/quote/1.0/quote/index.html
+///
+/// The return type can be any syntax tree node that implements the [`Parse`]
+/// trait.
+///
+/// [`Parse`]: crate::parse::Parse
+///
+/// ```
+/// use quote::quote;
+/// use syn::{parse_quote, Stmt};
+///
+/// fn main() {
+///     let name = quote!(v);
+///     let ty = quote!(u8);
+///
+///     let stmt: Stmt = parse_quote! {
+///         let #name: #ty = Default::default();
+///     };
+///
+///     println!("{:#?}", stmt);
+/// }
+/// ```
+///
+/// *This macro is available only if Syn is built with both the `"parsing"` and
+/// `"printing"` features.*
+///
+/// # Example
+///
+/// The following helper function adds a bound `T: HeapSize` to every type
+/// parameter `T` in the input generics.
+///
+/// ```
+/// use syn::{parse_quote, Generics, GenericParam};
+///
+/// // Add a bound `T: HeapSize` to every type parameter T.
+/// fn add_trait_bounds(mut generics: Generics) -> Generics {
+///     for param in &mut generics.params {
+///         if let GenericParam::Type(type_param) = param {
+///             type_param.bounds.push(parse_quote!(HeapSize));
+///         }
+///     }
+///     generics
+/// }
+/// ```
+///
+/// # Special cases
+///
+/// This macro can parse the following additional types as a special case even
+/// though they do not implement the `Parse` trait.
+///
+/// - [`Attribute`] — parses one attribute, allowing either outer like `#[...]`
+///   or inner like `#![...]`
+/// - [`Punctuated<T, P>`] — parses zero or more `T` separated by punctuation
+///   `P` with optional trailing punctuation
+/// - [`Vec<Stmt>`] — parses the same as `Block::parse_within`
+///
+/// [`Vec<Stmt>`]: Block::parse_within
+///
+/// # Panics
+///
+/// Panics if the tokens fail to parse as the expected syntax tree type. The
+/// caller is responsible for ensuring that the input tokens are syntactically
+/// valid.
+#[cfg_attr(docsrs, doc(cfg(all(feature = "parsing", feature = "printing"))))]
+#[macro_export]
+macro_rules! parse_quote {
+    ($($tt:tt)*) => {
+        $crate::__private::parse_quote($crate::__private::quote::quote!($($tt)*))
+    };
+}
+
+/// This macro is [`parse_quote!`] + [`quote_spanned!`][quote::quote_spanned].
+///
+/// Please refer to each of their documentation.
+///
+/// # Example
+///
+/// ```
+/// use quote::{quote, quote_spanned};
+/// use syn::spanned::Spanned;
+/// use syn::{parse_quote_spanned, ReturnType, Signature};
+///
+/// // Changes `fn()` to `fn() -> Pin<Box<dyn Future<Output = ()>>>`,
+/// // and `fn() -> T` to `fn() -> Pin<Box<dyn Future<Output = T>>>`,
+/// // without introducing any call_site() spans.
+/// fn make_ret_pinned_future(sig: &mut Signature) {
+///     let ret = match &sig.output {
+///         ReturnType::Default => quote_spanned!(sig.paren_token.span=> ()),
+///         ReturnType::Type(_, ret) => quote!(#ret),
+///     };
+///     sig.output = parse_quote_spanned! {ret.span()=>
+///         -> ::std::pin::Pin<::std::boxed::Box<dyn ::std::future::Future<Output = #ret>>>
+///     };
+/// }
+/// ```
+#[cfg_attr(docsrs, doc(cfg(all(feature = "parsing", feature = "printing"))))]
+#[macro_export]
+macro_rules! parse_quote_spanned {
+    ($span:expr=> $($tt:tt)*) => {
+        $crate::__private::parse_quote($crate::__private::quote::quote_spanned!($span=> $($tt)*))
+    };
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Can parse any type that implements Parse.
+
+use crate::error::Result;
+use crate::parse::{Parse, ParseStream, Parser};
+use proc_macro2::TokenStream;
+
+// Not public API.
+#[doc(hidden)]
+#[track_caller]
+pub fn parse<T: ParseQuote>(token_stream: TokenStream) -> T {
+    let parser = T::parse;
+    match parser.parse2(token_stream) {
+        Ok(t) => t,
+        Err(err) => panic!("{}", err),
+    }
+}
+
+#[doc(hidden)]
+pub trait ParseQuote: Sized {
+    fn parse(input: ParseStream) -> Result<Self>;
+}
+
+impl<T: Parse> ParseQuote for T {
+    fn parse(input: ParseStream) -> Result<Self> {
+        <T as Parse>::parse(input)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Any other types that we want `parse_quote!` to be able to parse.
+
+use crate::punctuated::Punctuated;
+#[cfg(any(feature = "full", feature = "derive"))]
+use crate::{attr, Attribute, Field, FieldMutability, Ident, Type, Visibility};
+#[cfg(feature = "full")]
+use crate::{Block, Pat, Stmt};
+
+#[cfg(any(feature = "full", feature = "derive"))]
+impl ParseQuote for Attribute {
+    fn parse(input: ParseStream) -> Result<Self> {
+        if input.peek(Token![#]) && input.peek2(Token![!]) {
+            attr::parsing::single_parse_inner(input)
+        } else {
+            attr::parsing::single_parse_outer(input)
+        }
+    }
+}
+
+#[cfg(any(feature = "full", feature = "derive"))]
+impl ParseQuote for Field {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let attrs = input.call(Attribute::parse_outer)?;
+        let vis: Visibility = input.parse()?;
+
+        let ident: Option<Ident>;
+        let colon_token: Option<Token![:]>;
+        let is_named = input.peek(Ident) && input.peek2(Token![:]) && !input.peek2(Token![::]);
+        if is_named {
+            ident = Some(input.parse()?);
+            colon_token = Some(input.parse()?);
+        } else {
+            ident = None;
+            colon_token = None;
+        }
+
+        let ty: Type = input.parse()?;
+
+        Ok(Field {
+            attrs,
+            vis,
+            mutability: FieldMutability::None,
+            ident,
+            colon_token,
+            ty,
+        })
+    }
+}
+
+#[cfg(feature = "full")]
+impl ParseQuote for Pat {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Pat::parse_multi_with_leading_vert(input)
+    }
+}
+
+#[cfg(feature = "full")]
+impl ParseQuote for Box<Pat> {
+    fn parse(input: ParseStream) -> Result<Self> {
+        <Pat as ParseQuote>::parse(input).map(Box::new)
+    }
+}
+
+impl<T: Parse, P: Parse> ParseQuote for Punctuated<T, P> {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Self::parse_terminated(input)
+    }
+}
+
+#[cfg(feature = "full")]
+impl ParseQuote for Vec<Stmt> {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Block::parse_within(input)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/pat.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/pat.rs
--- 43.0.0-1/rust-vendor/syn/src/pat.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/pat.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,953 @@
+use crate::attr::Attribute;
+use crate::expr::Member;
+use crate::ident::Ident;
+use crate::path::{Path, QSelf};
+use crate::punctuated::Punctuated;
+use crate::token;
+use crate::ty::Type;
+use proc_macro2::TokenStream;
+
+pub use crate::expr::{
+    ExprConst as PatConst, ExprLit as PatLit, ExprMacro as PatMacro, ExprPath as PatPath,
+    ExprRange as PatRange,
+};
+
+ast_enum_of_structs! {
+    /// A pattern in a local binding, function signature, match expression, or
+    /// various other places.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    #[non_exhaustive]
+    pub enum Pat {
+        /// A const block: `const { ... }`.
+        Const(PatConst),
+
+        /// A pattern that binds a new variable: `ref mut binding @ SUBPATTERN`.
+        Ident(PatIdent),
+
+        /// A literal pattern: `0`.
+        Lit(PatLit),
+
+        /// A macro in pattern position.
+        Macro(PatMacro),
+
+        /// A pattern that matches any one of a set of cases.
+        Or(PatOr),
+
+        /// A parenthesized pattern: `(A | B)`.
+        Paren(PatParen),
+
+        /// A path pattern like `Color::Red`, optionally qualified with a
+        /// self-type.
+        ///
+        /// Unqualified path patterns can legally refer to variants, structs,
+        /// constants or associated constants. Qualified path patterns like
+        /// `<A>::B::C` and `<A as Trait>::B::C` can only legally refer to
+        /// associated constants.
+        Path(PatPath),
+
+        /// A range pattern: `1..=2`.
+        Range(PatRange),
+
+        /// A reference pattern: `&mut var`.
+        Reference(PatReference),
+
+        /// The dots in a tuple or slice pattern: `[0, 1, ..]`.
+        Rest(PatRest),
+
+        /// A dynamically sized slice pattern: `[a, b, ref i @ .., y, z]`.
+        Slice(PatSlice),
+
+        /// A struct or struct variant pattern: `Variant { x, y, .. }`.
+        Struct(PatStruct),
+
+        /// A tuple pattern: `(a, b)`.
+        Tuple(PatTuple),
+
+        /// A tuple struct or tuple variant pattern: `Variant(x, y, .., z)`.
+        TupleStruct(PatTupleStruct),
+
+        /// A type ascription pattern: `foo: f64`.
+        Type(PatType),
+
+        /// Tokens in pattern position not interpreted by Syn.
+        Verbatim(TokenStream),
+
+        /// A pattern that matches any value: `_`.
+        Wild(PatWild),
+
+        // For testing exhaustiveness in downstream code, use the following idiom:
+        //
+        //     match pat {
+        //         #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
+        //
+        //         Pat::Box(pat) => {...}
+        //         Pat::Ident(pat) => {...}
+        //         ...
+        //         Pat::Wild(pat) => {...}
+        //
+        //         _ => { /* some sane fallback */ }
+        //     }
+        //
+        // This way we fail your tests but don't break your library when adding
+        // a variant. You will be notified by a test failure when a variant is
+        // added, so that you can add code to handle it, but your library will
+        // continue to compile and work for downstream users in the interim.
+    }
+}
+
+ast_struct! {
+    /// A pattern that binds a new variable: `ref mut binding @ SUBPATTERN`.
+    ///
+    /// It may also be a unit struct or struct variant (e.g. `None`), or a
+    /// constant; these cannot be distinguished syntactically.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct PatIdent {
+        pub attrs: Vec<Attribute>,
+        pub by_ref: Option<Token![ref]>,
+        pub mutability: Option<Token![mut]>,
+        pub ident: Ident,
+        pub subpat: Option<(Token![@], Box<Pat>)>,
+    }
+}
+
+ast_struct! {
+    /// A pattern that matches any one of a set of cases.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct PatOr {
+        pub attrs: Vec<Attribute>,
+        pub leading_vert: Option<Token![|]>,
+        pub cases: Punctuated<Pat, Token![|]>,
+    }
+}
+
+ast_struct! {
+    /// A parenthesized pattern: `(A | B)`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct PatParen {
+        pub attrs: Vec<Attribute>,
+        pub paren_token: token::Paren,
+        pub pat: Box<Pat>,
+    }
+}
+
+ast_struct! {
+    /// A reference pattern: `&mut var`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct PatReference {
+        pub attrs: Vec<Attribute>,
+        pub and_token: Token![&],
+        pub mutability: Option<Token![mut]>,
+        pub pat: Box<Pat>,
+    }
+}
+
+ast_struct! {
+    /// The dots in a tuple or slice pattern: `[0, 1, ..]`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct PatRest {
+        pub attrs: Vec<Attribute>,
+        pub dot2_token: Token![..],
+    }
+}
+
+ast_struct! {
+    /// A dynamically sized slice pattern: `[a, b, ref i @ .., y, z]`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct PatSlice {
+        pub attrs: Vec<Attribute>,
+        pub bracket_token: token::Bracket,
+        pub elems: Punctuated<Pat, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// A struct or struct variant pattern: `Variant { x, y, .. }`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct PatStruct {
+        pub attrs: Vec<Attribute>,
+        pub qself: Option<QSelf>,
+        pub path: Path,
+        pub brace_token: token::Brace,
+        pub fields: Punctuated<FieldPat, Token![,]>,
+        pub rest: Option<PatRest>,
+    }
+}
+
+ast_struct! {
+    /// A tuple pattern: `(a, b)`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct PatTuple {
+        pub attrs: Vec<Attribute>,
+        pub paren_token: token::Paren,
+        pub elems: Punctuated<Pat, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// A tuple struct or tuple variant pattern: `Variant(x, y, .., z)`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct PatTupleStruct {
+        pub attrs: Vec<Attribute>,
+        pub qself: Option<QSelf>,
+        pub path: Path,
+        pub paren_token: token::Paren,
+        pub elems: Punctuated<Pat, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// A type ascription pattern: `foo: f64`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct PatType {
+        pub attrs: Vec<Attribute>,
+        pub pat: Box<Pat>,
+        pub colon_token: Token![:],
+        pub ty: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// A pattern that matches any value: `_`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct PatWild {
+        pub attrs: Vec<Attribute>,
+        pub underscore_token: Token![_],
+    }
+}
+
+ast_struct! {
+    /// A single field in a struct pattern.
+    ///
+    /// Patterns like the fields of Foo `{ x, ref y, ref mut z }` are treated
+    /// the same as `x: x, y: ref y, z: ref mut z` but there is no colon token.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct FieldPat {
+        pub attrs: Vec<Attribute>,
+        pub member: Member,
+        pub colon_token: Option<Token![:]>,
+        pub pat: Box<Pat>,
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::attr::Attribute;
+    use crate::error::{self, Result};
+    use crate::expr::{
+        Expr, ExprConst, ExprLit, ExprMacro, ExprPath, ExprRange, Member, RangeLimits,
+    };
+    use crate::ext::IdentExt as _;
+    use crate::ident::Ident;
+    use crate::lit::Lit;
+    use crate::mac::{self, Macro};
+    use crate::parse::{Parse, ParseBuffer, ParseStream};
+    use crate::pat::{
+        FieldPat, Pat, PatIdent, PatOr, PatParen, PatReference, PatRest, PatSlice, PatStruct,
+        PatTuple, PatTupleStruct, PatType, PatWild,
+    };
+    use crate::path::{self, Path, QSelf};
+    use crate::punctuated::Punctuated;
+    use crate::stmt::Block;
+    use crate::token;
+    use crate::verbatim;
+    use proc_macro2::TokenStream;
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Pat {
+        /// Parse a pattern that does _not_ involve `|` at the top level.
+        ///
+        /// This parser matches the behavior of the `$:pat_param` macro_rules
+        /// matcher, and on editions prior to Rust 2021, the behavior of
+        /// `$:pat`.
+        ///
+        /// In Rust syntax, some examples of where this syntax would occur are
+        /// in the argument pattern of functions and closures. Patterns using
+        /// `|` are not allowed to occur in these positions.
+        ///
+        /// ```compile_fail
+        /// fn f(Some(_) | None: Option<T>) {
+        ///     let _ = |Some(_) | None: Option<T>| {};
+        ///     //       ^^^^^^^^^^^^^^^^^^^^^^^^^??? :(
+        /// }
+        /// ```
+        ///
+        /// ```console
+        /// error: top-level or-patterns are not allowed in function parameters
+        ///  --> src/main.rs:1:6
+        ///   |
+        /// 1 | fn f(Some(_) | None: Option<T>) {
+        ///   |      ^^^^^^^^^^^^^^ help: wrap the pattern in parentheses: `(Some(_) | None)`
+        /// ```
+        pub fn parse_single(input: ParseStream) -> Result<Self> {
+            let begin = input.fork();
+            let lookahead = input.lookahead1();
+            if lookahead.peek(Ident)
+                && (input.peek2(Token![::])
+                    || input.peek2(Token![!])
+                    || input.peek2(token::Brace)
+                    || input.peek2(token::Paren)
+                    || input.peek2(Token![..]))
+                || input.peek(Token![self]) && input.peek2(Token![::])
+                || lookahead.peek(Token![::])
+                || lookahead.peek(Token![<])
+                || input.peek(Token![Self])
+                || input.peek(Token![super])
+                || input.peek(Token![crate])
+            {
+                pat_path_or_macro_or_struct_or_range(input)
+            } else if lookahead.peek(Token![_]) {
+                input.call(pat_wild).map(Pat::Wild)
+            } else if input.peek(Token![box]) {
+                pat_box(begin, input)
+            } else if input.peek(Token![-]) || lookahead.peek(Lit) || lookahead.peek(Token![const])
+            {
+                pat_lit_or_range(input)
+            } else if lookahead.peek(Token![ref])
+                || lookahead.peek(Token![mut])
+                || input.peek(Token![self])
+                || input.peek(Ident)
+            {
+                input.call(pat_ident).map(Pat::Ident)
+            } else if lookahead.peek(Token![&]) {
+                input.call(pat_reference).map(Pat::Reference)
+            } else if lookahead.peek(token::Paren) {
+                input.call(pat_paren_or_tuple)
+            } else if lookahead.peek(token::Bracket) {
+                input.call(pat_slice).map(Pat::Slice)
+            } else if lookahead.peek(Token![..]) && !input.peek(Token![...]) {
+                pat_range_half_open(input)
+            } else if lookahead.peek(Token![const]) {
+                input.call(pat_const).map(Pat::Verbatim)
+            } else {
+                Err(lookahead.error())
+            }
+        }
+
+        /// Parse a pattern, possibly involving `|`, but not a leading `|`.
+        pub fn parse_multi(input: ParseStream) -> Result<Self> {
+            multi_pat_impl(input, None)
+        }
+
+        /// Parse a pattern, possibly involving `|`, possibly including a
+        /// leading `|`.
+        ///
+        /// This parser matches the behavior of the Rust 2021 edition's `$:pat`
+        /// macro_rules matcher.
+        ///
+        /// In Rust syntax, an example of where this syntax would occur is in
+        /// the pattern of a `match` arm, where the language permits an optional
+        /// leading `|`, although it is not idiomatic to write one there in
+        /// handwritten code.
+        ///
+        /// ```
+        /// # let wat = None;
+        /// match wat {
+        ///     | None | Some(false) => {}
+        ///     | Some(true) => {}
+        /// }
+        /// ```
+        ///
+        /// The compiler accepts it only to facilitate some situations in
+        /// macro-generated code where a macro author might need to write:
+        ///
+        /// ```
+        /// # macro_rules! doc {
+        /// #     ($value:expr, ($($conditions1:pat),*), ($($conditions2:pat),*), $then:expr) => {
+        /// match $value {
+        ///     $(| $conditions1)* $(| $conditions2)* => $then
+        /// }
+        /// #     };
+        /// # }
+        /// #
+        /// # doc!(true, (true), (false), {});
+        /// # doc!(true, (), (true, false), {});
+        /// # doc!(true, (true, false), (), {});
+        /// ```
+        ///
+        /// Expressing the same thing correctly in the case that either one (but
+        /// not both) of `$conditions1` and `$conditions2` might be empty,
+        /// without leading `|`, is complex.
+        ///
+        /// Use [`Pat::parse_multi`] instead if you are not intending to support
+        /// macro-generated macro input.
+        pub fn parse_multi_with_leading_vert(input: ParseStream) -> Result<Self> {
+            let leading_vert: Option<Token![|]> = input.parse()?;
+            multi_pat_impl(input, leading_vert)
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for PatType {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(PatType {
+                attrs: Vec::new(),
+                pat: Box::new(Pat::parse_single(input)?),
+                colon_token: input.parse()?,
+                ty: input.parse()?,
+            })
+        }
+    }
+
+    fn multi_pat_impl(input: ParseStream, leading_vert: Option<Token![|]>) -> Result<Pat> {
+        let mut pat = Pat::parse_single(input)?;
+        if leading_vert.is_some()
+            || input.peek(Token![|]) && !input.peek(Token![||]) && !input.peek(Token![|=])
+        {
+            let mut cases = Punctuated::new();
+            cases.push_value(pat);
+            while input.peek(Token![|]) && !input.peek(Token![||]) && !input.peek(Token![|=]) {
+                let punct = input.parse()?;
+                cases.push_punct(punct);
+                let pat = Pat::parse_single(input)?;
+                cases.push_value(pat);
+            }
+            pat = Pat::Or(PatOr {
+                attrs: Vec::new(),
+                leading_vert,
+                cases,
+            });
+        }
+        Ok(pat)
+    }
+
+    fn pat_path_or_macro_or_struct_or_range(input: ParseStream) -> Result<Pat> {
+        let (qself, path) = path::parsing::qpath(input, true)?;
+
+        if qself.is_none()
+            && input.peek(Token![!])
+            && !input.peek(Token![!=])
+            && path.is_mod_style()
+        {
+            let bang_token: Token![!] = input.parse()?;
+            let (delimiter, tokens) = mac::parse_delimiter(input)?;
+            return Ok(Pat::Macro(ExprMacro {
+                attrs: Vec::new(),
+                mac: Macro {
+                    path,
+                    bang_token,
+                    delimiter,
+                    tokens,
+                },
+            }));
+        }
+
+        if input.peek(token::Brace) {
+            pat_struct(input, qself, path).map(Pat::Struct)
+        } else if input.peek(token::Paren) {
+            pat_tuple_struct(input, qself, path).map(Pat::TupleStruct)
+        } else if input.peek(Token![..]) {
+            pat_range(input, qself, path)
+        } else {
+            Ok(Pat::Path(ExprPath {
+                attrs: Vec::new(),
+                qself,
+                path,
+            }))
+        }
+    }
+
+    fn pat_wild(input: ParseStream) -> Result<PatWild> {
+        Ok(PatWild {
+            attrs: Vec::new(),
+            underscore_token: input.parse()?,
+        })
+    }
+
+    fn pat_box(begin: ParseBuffer, input: ParseStream) -> Result<Pat> {
+        input.parse::<Token![box]>()?;
+        Pat::parse_single(input)?;
+        Ok(Pat::Verbatim(verbatim::between(&begin, input)))
+    }
+
+    fn pat_ident(input: ParseStream) -> Result<PatIdent> {
+        Ok(PatIdent {
+            attrs: Vec::new(),
+            by_ref: input.parse()?,
+            mutability: input.parse()?,
+            ident: {
+                if input.peek(Token![self]) {
+                    input.call(Ident::parse_any)?
+                } else {
+                    input.parse()?
+                }
+            },
+            subpat: {
+                if input.peek(Token![@]) {
+                    let at_token: Token![@] = input.parse()?;
+                    let subpat = Pat::parse_single(input)?;
+                    Some((at_token, Box::new(subpat)))
+                } else {
+                    None
+                }
+            },
+        })
+    }
+
+    fn pat_tuple_struct(
+        input: ParseStream,
+        qself: Option<QSelf>,
+        path: Path,
+    ) -> Result<PatTupleStruct> {
+        let content;
+        let paren_token = parenthesized!(content in input);
+
+        let mut elems = Punctuated::new();
+        while !content.is_empty() {
+            let value = Pat::parse_multi_with_leading_vert(&content)?;
+            elems.push_value(value);
+            if content.is_empty() {
+                break;
+            }
+            let punct = content.parse()?;
+            elems.push_punct(punct);
+        }
+
+        Ok(PatTupleStruct {
+            attrs: Vec::new(),
+            qself,
+            path,
+            paren_token,
+            elems,
+        })
+    }
+
+    fn pat_struct(input: ParseStream, qself: Option<QSelf>, path: Path) -> Result<PatStruct> {
+        let content;
+        let brace_token = braced!(content in input);
+
+        let mut fields = Punctuated::new();
+        let mut rest = None;
+        while !content.is_empty() {
+            let attrs = content.call(Attribute::parse_outer)?;
+            if content.peek(Token![..]) {
+                rest = Some(PatRest {
+                    attrs,
+                    dot2_token: content.parse()?,
+                });
+                break;
+            }
+            let mut value = content.call(field_pat)?;
+            value.attrs = attrs;
+            fields.push_value(value);
+            if content.is_empty() {
+                break;
+            }
+            let punct: Token![,] = content.parse()?;
+            fields.push_punct(punct);
+        }
+
+        Ok(PatStruct {
+            attrs: Vec::new(),
+            qself,
+            path,
+            brace_token,
+            fields,
+            rest,
+        })
+    }
+
+    fn field_pat(input: ParseStream) -> Result<FieldPat> {
+        let begin = input.fork();
+        let boxed: Option<Token![box]> = input.parse()?;
+        let by_ref: Option<Token![ref]> = input.parse()?;
+        let mutability: Option<Token![mut]> = input.parse()?;
+
+        let member = if boxed.is_some() || by_ref.is_some() || mutability.is_some() {
+            input.parse().map(Member::Named)
+        } else {
+            input.parse()
+        }?;
+
+        if boxed.is_none() && by_ref.is_none() && mutability.is_none() && input.peek(Token![:])
+            || !member.is_named()
+        {
+            return Ok(FieldPat {
+                attrs: Vec::new(),
+                member,
+                colon_token: Some(input.parse()?),
+                pat: Box::new(Pat::parse_multi_with_leading_vert(input)?),
+            });
+        }
+
+        let ident = match member {
+            Member::Named(ident) => ident,
+            Member::Unnamed(_) => unreachable!(),
+        };
+
+        let pat = if boxed.is_some() {
+            Pat::Verbatim(verbatim::between(&begin, input))
+        } else {
+            Pat::Ident(PatIdent {
+                attrs: Vec::new(),
+                by_ref,
+                mutability,
+                ident: ident.clone(),
+                subpat: None,
+            })
+        };
+
+        Ok(FieldPat {
+            attrs: Vec::new(),
+            member: Member::Named(ident),
+            colon_token: None,
+            pat: Box::new(pat),
+        })
+    }
+
+    fn pat_range(input: ParseStream, qself: Option<QSelf>, path: Path) -> Result<Pat> {
+        let limits = RangeLimits::parse_obsolete(input)?;
+        let end = input.call(pat_range_bound)?;
+        if let (RangeLimits::Closed(_), None) = (&limits, &end) {
+            return Err(input.error("expected range upper bound"));
+        }
+        Ok(Pat::Range(ExprRange {
+            attrs: Vec::new(),
+            start: Some(Box::new(Expr::Path(ExprPath {
+                attrs: Vec::new(),
+                qself,
+                path,
+            }))),
+            limits,
+            end: end.map(PatRangeBound::into_expr),
+        }))
+    }
+
+    fn pat_range_half_open(input: ParseStream) -> Result<Pat> {
+        let limits: RangeLimits = input.parse()?;
+        let end = input.call(pat_range_bound)?;
+        if end.is_some() {
+            Ok(Pat::Range(ExprRange {
+                attrs: Vec::new(),
+                start: None,
+                limits,
+                end: end.map(PatRangeBound::into_expr),
+            }))
+        } else {
+            match limits {
+                RangeLimits::HalfOpen(dot2_token) => Ok(Pat::Rest(PatRest {
+                    attrs: Vec::new(),
+                    dot2_token,
+                })),
+                RangeLimits::Closed(_) => Err(input.error("expected range upper bound")),
+            }
+        }
+    }
+
+    fn pat_paren_or_tuple(input: ParseStream) -> Result<Pat> {
+        let content;
+        let paren_token = parenthesized!(content in input);
+
+        let mut elems = Punctuated::new();
+        while !content.is_empty() {
+            let value = Pat::parse_multi_with_leading_vert(&content)?;
+            if content.is_empty() {
+                if elems.is_empty() && !matches!(value, Pat::Rest(_)) {
+                    return Ok(Pat::Paren(PatParen {
+                        attrs: Vec::new(),
+                        paren_token,
+                        pat: Box::new(value),
+                    }));
+                }
+                elems.push_value(value);
+                break;
+            }
+            elems.push_value(value);
+            let punct = content.parse()?;
+            elems.push_punct(punct);
+        }
+
+        Ok(Pat::Tuple(PatTuple {
+            attrs: Vec::new(),
+            paren_token,
+            elems,
+        }))
+    }
+
+    fn pat_reference(input: ParseStream) -> Result<PatReference> {
+        Ok(PatReference {
+            attrs: Vec::new(),
+            and_token: input.parse()?,
+            mutability: input.parse()?,
+            pat: Box::new(Pat::parse_single(input)?),
+        })
+    }
+
+    fn pat_lit_or_range(input: ParseStream) -> Result<Pat> {
+        let start = input.call(pat_range_bound)?.unwrap();
+        if input.peek(Token![..]) {
+            let limits = RangeLimits::parse_obsolete(input)?;
+            let end = input.call(pat_range_bound)?;
+            if let (RangeLimits::Closed(_), None) = (&limits, &end) {
+                return Err(input.error("expected range upper bound"));
+            }
+            Ok(Pat::Range(ExprRange {
+                attrs: Vec::new(),
+                start: Some(start.into_expr()),
+                limits,
+                end: end.map(PatRangeBound::into_expr),
+            }))
+        } else {
+            Ok(start.into_pat())
+        }
+    }
+
+    // Patterns that can appear on either side of a range pattern.
+    enum PatRangeBound {
+        Const(ExprConst),
+        Lit(ExprLit),
+        Path(ExprPath),
+    }
+
+    impl PatRangeBound {
+        fn into_expr(self) -> Box<Expr> {
+            Box::new(match self {
+                PatRangeBound::Const(pat) => Expr::Const(pat),
+                PatRangeBound::Lit(pat) => Expr::Lit(pat),
+                PatRangeBound::Path(pat) => Expr::Path(pat),
+            })
+        }
+
+        fn into_pat(self) -> Pat {
+            match self {
+                PatRangeBound::Const(pat) => Pat::Const(pat),
+                PatRangeBound::Lit(pat) => Pat::Lit(pat),
+                PatRangeBound::Path(pat) => Pat::Path(pat),
+            }
+        }
+    }
+
+    fn pat_range_bound(input: ParseStream) -> Result<Option<PatRangeBound>> {
+        if input.is_empty()
+            || input.peek(Token![|])
+            || input.peek(Token![=])
+            || input.peek(Token![:]) && !input.peek(Token![::])
+            || input.peek(Token![,])
+            || input.peek(Token![;])
+            || input.peek(Token![if])
+        {
+            return Ok(None);
+        }
+
+        let lookahead = input.lookahead1();
+        let expr = if lookahead.peek(Lit) {
+            PatRangeBound::Lit(input.parse()?)
+        } else if lookahead.peek(Ident)
+            || lookahead.peek(Token![::])
+            || lookahead.peek(Token![<])
+            || lookahead.peek(Token![self])
+            || lookahead.peek(Token![Self])
+            || lookahead.peek(Token![super])
+            || lookahead.peek(Token![crate])
+        {
+            PatRangeBound::Path(input.parse()?)
+        } else if lookahead.peek(Token![const]) {
+            PatRangeBound::Const(input.parse()?)
+        } else {
+            return Err(lookahead.error());
+        };
+
+        Ok(Some(expr))
+    }
+
+    fn pat_slice(input: ParseStream) -> Result<PatSlice> {
+        let content;
+        let bracket_token = bracketed!(content in input);
+
+        let mut elems = Punctuated::new();
+        while !content.is_empty() {
+            let value = Pat::parse_multi_with_leading_vert(&content)?;
+            match value {
+                Pat::Range(pat) if pat.start.is_none() || pat.end.is_none() => {
+                    let (start, end) = match pat.limits {
+                        RangeLimits::HalfOpen(dot_dot) => (dot_dot.spans[0], dot_dot.spans[1]),
+                        RangeLimits::Closed(dot_dot_eq) => {
+                            (dot_dot_eq.spans[0], dot_dot_eq.spans[2])
+                        }
+                    };
+                    let msg = "range pattern is not allowed unparenthesized inside slice pattern";
+                    return Err(error::new2(start, end, msg));
+                }
+                _ => {}
+            }
+            elems.push_value(value);
+            if content.is_empty() {
+                break;
+            }
+            let punct = content.parse()?;
+            elems.push_punct(punct);
+        }
+
+        Ok(PatSlice {
+            attrs: Vec::new(),
+            bracket_token,
+            elems,
+        })
+    }
+
+    fn pat_const(input: ParseStream) -> Result<TokenStream> {
+        let begin = input.fork();
+        input.parse::<Token![const]>()?;
+
+        let content;
+        braced!(content in input);
+        content.call(Attribute::parse_inner)?;
+        content.call(Block::parse_within)?;
+
+        Ok(verbatim::between(&begin, input))
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::attr::FilterAttrs;
+    use crate::pat::{
+        FieldPat, Pat, PatIdent, PatOr, PatParen, PatReference, PatRest, PatSlice, PatStruct,
+        PatTuple, PatTupleStruct, PatType, PatWild,
+    };
+    use crate::path;
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatIdent {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.by_ref.to_tokens(tokens);
+            self.mutability.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            if let Some((at_token, subpat)) = &self.subpat {
+                at_token.to_tokens(tokens);
+                subpat.to_tokens(tokens);
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatOr {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.leading_vert.to_tokens(tokens);
+            self.cases.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatParen {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.paren_token.surround(tokens, |tokens| {
+                self.pat.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatReference {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.and_token.to_tokens(tokens);
+            self.mutability.to_tokens(tokens);
+            self.pat.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatRest {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.dot2_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatSlice {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.bracket_token.surround(tokens, |tokens| {
+                self.elems.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatStruct {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            path::printing::print_path(tokens, &self.qself, &self.path);
+            self.brace_token.surround(tokens, |tokens| {
+                self.fields.to_tokens(tokens);
+                // NOTE: We need a comma before the dot2 token if it is present.
+                if !self.fields.empty_or_trailing() && self.rest.is_some() {
+                    <Token![,]>::default().to_tokens(tokens);
+                }
+                self.rest.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatTuple {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.paren_token.surround(tokens, |tokens| {
+                self.elems.to_tokens(tokens);
+                // If there is only one element, a trailing comma is needed to
+                // distinguish PatTuple from PatParen, unless this is `(..)`
+                // which is a tuple pattern even without comma.
+                if self.elems.len() == 1
+                    && !self.elems.trailing_punct()
+                    && !matches!(self.elems[0], Pat::Rest { .. })
+                {
+                    <Token![,]>::default().to_tokens(tokens);
+                }
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatTupleStruct {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            path::printing::print_path(tokens, &self.qself, &self.path);
+            self.paren_token.surround(tokens, |tokens| {
+                self.elems.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatType {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.pat.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatWild {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.underscore_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for FieldPat {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            if let Some(colon_token) = &self.colon_token {
+                self.member.to_tokens(tokens);
+                colon_token.to_tokens(tokens);
+            }
+            self.pat.to_tokens(tokens);
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/path.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/path.rs
--- 43.0.0-1/rust-vendor/syn/src/path.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/path.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,886 @@
+#[cfg(feature = "parsing")]
+use crate::error::Result;
+use crate::expr::Expr;
+use crate::generics::TypeParamBound;
+use crate::ident::Ident;
+use crate::lifetime::Lifetime;
+use crate::punctuated::Punctuated;
+use crate::token;
+use crate::ty::{ReturnType, Type};
+
+ast_struct! {
+    /// A path at which a named item is exported (e.g. `std::collections::HashMap`).
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct Path {
+        pub leading_colon: Option<Token![::]>,
+        pub segments: Punctuated<PathSegment, Token![::]>,
+    }
+}
+
+impl<T> From<T> for Path
+where
+    T: Into<PathSegment>,
+{
+    fn from(segment: T) -> Self {
+        let mut path = Path {
+            leading_colon: None,
+            segments: Punctuated::new(),
+        };
+        path.segments.push_value(segment.into());
+        path
+    }
+}
+
+impl Path {
+    /// Determines whether this is a path of length 1 equal to the given
+    /// ident.
+    ///
+    /// For them to compare equal, it must be the case that:
+    ///
+    /// - the path has no leading colon,
+    /// - the number of path segments is 1,
+    /// - the first path segment has no angle bracketed or parenthesized
+    ///   path arguments, and
+    /// - the ident of the first path segment is equal to the given one.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use proc_macro2::TokenStream;
+    /// use syn::{Attribute, Error, Meta, Result};
+    ///
+    /// fn get_serde_meta_item(attr: &Attribute) -> Result<Option<&TokenStream>> {
+    ///     if attr.path().is_ident("serde") {
+    ///         match &attr.meta {
+    ///             Meta::List(meta) => Ok(Some(&meta.tokens)),
+    ///             bad => Err(Error::new_spanned(bad, "unrecognized attribute")),
+    ///         }
+    ///     } else {
+    ///         Ok(None)
+    ///     }
+    /// }
+    /// ```
+    pub fn is_ident<I>(&self, ident: &I) -> bool
+    where
+        I: ?Sized,
+        Ident: PartialEq<I>,
+    {
+        match self.get_ident() {
+            Some(id) => id == ident,
+            None => false,
+        }
+    }
+
+    /// If this path consists of a single ident, returns the ident.
+    ///
+    /// A path is considered an ident if:
+    ///
+    /// - the path has no leading colon,
+    /// - the number of path segments is 1, and
+    /// - the first path segment has no angle bracketed or parenthesized
+    ///   path arguments.
+    pub fn get_ident(&self) -> Option<&Ident> {
+        if self.leading_colon.is_none()
+            && self.segments.len() == 1
+            && self.segments[0].arguments.is_none()
+        {
+            Some(&self.segments[0].ident)
+        } else {
+            None
+        }
+    }
+
+    /// An error if this path is not a single ident, as defined in `get_ident`.
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    pub fn require_ident(&self) -> Result<&Ident> {
+        self.get_ident().ok_or_else(|| {
+            crate::error::new2(
+                self.segments.first().unwrap().ident.span(),
+                self.segments.last().unwrap().ident.span(),
+                "expected this path to be an identifier",
+            )
+        })
+    }
+}
+
+ast_struct! {
+    /// A segment of a path together with any path arguments on that segment.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct PathSegment {
+        pub ident: Ident,
+        pub arguments: PathArguments,
+    }
+}
+
+impl<T> From<T> for PathSegment
+where
+    T: Into<Ident>,
+{
+    fn from(ident: T) -> Self {
+        PathSegment {
+            ident: ident.into(),
+            arguments: PathArguments::None,
+        }
+    }
+}
+
+ast_enum! {
+    /// Angle bracketed or parenthesized arguments of a path segment.
+    ///
+    /// ## Angle bracketed
+    ///
+    /// The `<'a, T>` in `std::slice::iter<'a, T>`.
+    ///
+    /// ## Parenthesized
+    ///
+    /// The `(A, B) -> C` in `Fn(A, B) -> C`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub enum PathArguments {
+        None,
+        /// The `<'a, T>` in `std::slice::iter<'a, T>`.
+        AngleBracketed(AngleBracketedGenericArguments),
+        /// The `(A, B) -> C` in `Fn(A, B) -> C`.
+        Parenthesized(ParenthesizedGenericArguments),
+    }
+}
+
+impl Default for PathArguments {
+    fn default() -> Self {
+        PathArguments::None
+    }
+}
+
+impl PathArguments {
+    pub fn is_empty(&self) -> bool {
+        match self {
+            PathArguments::None => true,
+            PathArguments::AngleBracketed(bracketed) => bracketed.args.is_empty(),
+            PathArguments::Parenthesized(_) => false,
+        }
+    }
+
+    pub fn is_none(&self) -> bool {
+        match self {
+            PathArguments::None => true,
+            PathArguments::AngleBracketed(_) | PathArguments::Parenthesized(_) => false,
+        }
+    }
+}
+
+ast_enum! {
+    /// An individual generic argument, like `'a`, `T`, or `Item = T`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    #[non_exhaustive]
+    pub enum GenericArgument {
+        /// A lifetime argument.
+        Lifetime(Lifetime),
+        /// A type argument.
+        Type(Type),
+        /// A const expression. Must be inside of a block.
+        ///
+        /// NOTE: Identity expressions are represented as Type arguments, as
+        /// they are indistinguishable syntactically.
+        Const(Expr),
+        /// A binding (equality constraint) on an associated type: the `Item =
+        /// u8` in `Iterator<Item = u8>`.
+        AssocType(AssocType),
+        /// An equality constraint on an associated constant: the `PANIC =
+        /// false` in `Trait<PANIC = false>`.
+        AssocConst(AssocConst),
+        /// An associated type bound: `Iterator<Item: Display>`.
+        Constraint(Constraint),
+    }
+}
+
+ast_struct! {
+    /// Angle bracketed arguments of a path segment: the `<K, V>` in `HashMap<K,
+    /// V>`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct AngleBracketedGenericArguments {
+        pub colon2_token: Option<Token![::]>,
+        pub lt_token: Token![<],
+        pub args: Punctuated<GenericArgument, Token![,]>,
+        pub gt_token: Token![>],
+    }
+}
+
+ast_struct! {
+    /// A binding (equality constraint) on an associated type: the `Item = u8`
+    /// in `Iterator<Item = u8>`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct AssocType {
+        pub ident: Ident,
+        pub generics: Option<AngleBracketedGenericArguments>,
+        pub eq_token: Token![=],
+        pub ty: Type,
+    }
+}
+
+ast_struct! {
+    /// An equality constraint on an associated constant: the `PANIC = false` in
+    /// `Trait<PANIC = false>`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct AssocConst {
+        pub ident: Ident,
+        pub generics: Option<AngleBracketedGenericArguments>,
+        pub eq_token: Token![=],
+        pub value: Expr,
+    }
+}
+
+ast_struct! {
+    /// An associated type bound: `Iterator<Item: Display>`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct Constraint {
+        pub ident: Ident,
+        pub generics: Option<AngleBracketedGenericArguments>,
+        pub colon_token: Token![:],
+        pub bounds: Punctuated<TypeParamBound, Token![+]>,
+    }
+}
+
+ast_struct! {
+    /// Arguments of a function path segment: the `(A, B) -> C` in `Fn(A,B) ->
+    /// C`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ParenthesizedGenericArguments {
+        pub paren_token: token::Paren,
+        /// `(A, B)`
+        pub inputs: Punctuated<Type, Token![,]>,
+        /// `C`
+        pub output: ReturnType,
+    }
+}
+
+ast_struct! {
+    /// The explicit Self type in a qualified path: the `T` in `<T as
+    /// Display>::fmt`.
+    ///
+    /// The actual path, including the trait and the associated item, is stored
+    /// separately. The `position` field represents the index of the associated
+    /// item qualified with this Self type.
+    ///
+    /// ```text
+    /// <Vec<T> as a::b::Trait>::AssociatedItem
+    ///  ^~~~~~    ~~~~~~~~~~~~~~^
+    ///  ty        position = 3
+    ///
+    /// <Vec<T>>::AssociatedItem
+    ///  ^~~~~~   ^
+    ///  ty       position = 0
+    /// ```
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct QSelf {
+        pub lt_token: Token![<],
+        pub ty: Box<Type>,
+        pub position: usize,
+        pub as_token: Option<Token![as]>,
+        pub gt_token: Token![>],
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::error::Result;
+    #[cfg(feature = "full")]
+    use crate::expr::ExprBlock;
+    use crate::expr::{Expr, ExprPath};
+    use crate::ext::IdentExt as _;
+    #[cfg(feature = "full")]
+    use crate::generics::TypeParamBound;
+    use crate::ident::Ident;
+    use crate::lifetime::Lifetime;
+    use crate::lit::Lit;
+    use crate::parse::{Parse, ParseStream};
+    #[cfg(feature = "full")]
+    use crate::path::Constraint;
+    use crate::path::{
+        AngleBracketedGenericArguments, AssocConst, AssocType, GenericArgument,
+        ParenthesizedGenericArguments, Path, PathArguments, PathSegment, QSelf,
+    };
+    use crate::punctuated::Punctuated;
+    use crate::token;
+    use crate::ty::{ReturnType, Type};
+    #[cfg(not(feature = "full"))]
+    use crate::verbatim;
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Path {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Self::parse_helper(input, false)
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for GenericArgument {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Lifetime) && !input.peek2(Token![+]) {
+                return Ok(GenericArgument::Lifetime(input.parse()?));
+            }
+
+            if input.peek(Lit) || input.peek(token::Brace) {
+                return const_argument(input).map(GenericArgument::Const);
+            }
+
+            let mut argument: Type = input.parse()?;
+
+            match argument {
+                Type::Path(mut ty)
+                    if ty.qself.is_none()
+                        && ty.path.leading_colon.is_none()
+                        && ty.path.segments.len() == 1
+                        && match &ty.path.segments[0].arguments {
+                            PathArguments::None | PathArguments::AngleBracketed(_) => true,
+                            PathArguments::Parenthesized(_) => false,
+                        } =>
+                {
+                    if let Some(eq_token) = input.parse::<Option<Token![=]>>()? {
+                        let segment = ty.path.segments.pop().unwrap().into_value();
+                        let ident = segment.ident;
+                        let generics = match segment.arguments {
+                            PathArguments::None => None,
+                            PathArguments::AngleBracketed(arguments) => Some(arguments),
+                            PathArguments::Parenthesized(_) => unreachable!(),
+                        };
+                        return if input.peek(Lit) || input.peek(token::Brace) {
+                            Ok(GenericArgument::AssocConst(AssocConst {
+                                ident,
+                                generics,
+                                eq_token,
+                                value: const_argument(input)?,
+                            }))
+                        } else {
+                            Ok(GenericArgument::AssocType(AssocType {
+                                ident,
+                                generics,
+                                eq_token,
+                                ty: input.parse()?,
+                            }))
+                        };
+                    }
+
+                    #[cfg(feature = "full")]
+                    if let Some(colon_token) = input.parse::<Option<Token![:]>>()? {
+                        let segment = ty.path.segments.pop().unwrap().into_value();
+                        return Ok(GenericArgument::Constraint(Constraint {
+                            ident: segment.ident,
+                            generics: match segment.arguments {
+                                PathArguments::None => None,
+                                PathArguments::AngleBracketed(arguments) => Some(arguments),
+                                PathArguments::Parenthesized(_) => unreachable!(),
+                            },
+                            colon_token,
+                            bounds: {
+                                let mut bounds = Punctuated::new();
+                                loop {
+                                    if input.peek(Token![,]) || input.peek(Token![>]) {
+                                        break;
+                                    }
+                                    let value: TypeParamBound = input.parse()?;
+                                    bounds.push_value(value);
+                                    if !input.peek(Token![+]) {
+                                        break;
+                                    }
+                                    let punct: Token![+] = input.parse()?;
+                                    bounds.push_punct(punct);
+                                }
+                                bounds
+                            },
+                        }));
+                    }
+
+                    argument = Type::Path(ty);
+                }
+                _ => {}
+            }
+
+            Ok(GenericArgument::Type(argument))
+        }
+    }
+
+    pub(crate) fn const_argument(input: ParseStream) -> Result<Expr> {
+        let lookahead = input.lookahead1();
+
+        if input.peek(Lit) {
+            let lit = input.parse()?;
+            return Ok(Expr::Lit(lit));
+        }
+
+        if input.peek(Ident) {
+            let ident: Ident = input.parse()?;
+            return Ok(Expr::Path(ExprPath {
+                attrs: Vec::new(),
+                qself: None,
+                path: Path::from(ident),
+            }));
+        }
+
+        if input.peek(token::Brace) {
+            #[cfg(feature = "full")]
+            {
+                let block: ExprBlock = input.parse()?;
+                return Ok(Expr::Block(block));
+            }
+
+            #[cfg(not(feature = "full"))]
+            {
+                let begin = input.fork();
+                let content;
+                braced!(content in input);
+                content.parse::<Expr>()?;
+                let verbatim = verbatim::between(&begin, input);
+                return Ok(Expr::Verbatim(verbatim));
+            }
+        }
+
+        Err(lookahead.error())
+    }
+
+    impl AngleBracketedGenericArguments {
+        /// Parse `::<…>` with mandatory leading `::`.
+        ///
+        /// The ordinary [`Parse`] impl for `AngleBracketedGenericArguments`
+        /// parses optional leading `::`.
+        #[cfg(feature = "full")]
+        #[cfg_attr(docsrs, doc(cfg(all(feature = "parsing", feature = "full"))))]
+        pub fn parse_turbofish(input: ParseStream) -> Result<Self> {
+            let colon2_token: Token![::] = input.parse()?;
+            Self::do_parse(Some(colon2_token), input)
+        }
+
+        pub(crate) fn do_parse(
+            colon2_token: Option<Token![::]>,
+            input: ParseStream,
+        ) -> Result<Self> {
+            Ok(AngleBracketedGenericArguments {
+                colon2_token,
+                lt_token: input.parse()?,
+                args: {
+                    let mut args = Punctuated::new();
+                    loop {
+                        if input.peek(Token![>]) {
+                            break;
+                        }
+                        let value: GenericArgument = input.parse()?;
+                        args.push_value(value);
+                        if input.peek(Token![>]) {
+                            break;
+                        }
+                        let punct: Token![,] = input.parse()?;
+                        args.push_punct(punct);
+                    }
+                    args
+                },
+                gt_token: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for AngleBracketedGenericArguments {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let colon2_token: Option<Token![::]> = input.parse()?;
+            Self::do_parse(colon2_token, input)
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ParenthesizedGenericArguments {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            Ok(ParenthesizedGenericArguments {
+                paren_token: parenthesized!(content in input),
+                inputs: content.parse_terminated(Type::parse, Token![,])?,
+                output: input.call(ReturnType::without_plus)?,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for PathSegment {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Self::parse_helper(input, false)
+        }
+    }
+
+    impl PathSegment {
+        fn parse_helper(input: ParseStream, expr_style: bool) -> Result<Self> {
+            if input.peek(Token![super])
+                || input.peek(Token![self])
+                || input.peek(Token![crate])
+                || cfg!(feature = "full") && input.peek(Token![try])
+            {
+                let ident = input.call(Ident::parse_any)?;
+                return Ok(PathSegment::from(ident));
+            }
+
+            let ident = if input.peek(Token![Self]) {
+                input.call(Ident::parse_any)?
+            } else {
+                input.parse()?
+            };
+
+            if !expr_style && input.peek(Token![<]) && !input.peek(Token![<=])
+                || input.peek(Token![::]) && input.peek3(Token![<])
+            {
+                Ok(PathSegment {
+                    ident,
+                    arguments: PathArguments::AngleBracketed(input.parse()?),
+                })
+            } else {
+                Ok(PathSegment::from(ident))
+            }
+        }
+    }
+
+    impl Path {
+        /// Parse a `Path` containing no path arguments on any of its segments.
+        ///
+        /// # Example
+        ///
+        /// ```
+        /// use syn::{Path, Result, Token};
+        /// use syn::parse::{Parse, ParseStream};
+        ///
+        /// // A simplified single `use` statement like:
+        /// //
+        /// //     use std::collections::HashMap;
+        /// //
+        /// // Note that generic parameters are not allowed in a `use` statement
+        /// // so the following must not be accepted.
+        /// //
+        /// //     use a::<b>::c;
+        /// struct SingleUse {
+        ///     use_token: Token![use],
+        ///     path: Path,
+        /// }
+        ///
+        /// impl Parse for SingleUse {
+        ///     fn parse(input: ParseStream) -> Result<Self> {
+        ///         Ok(SingleUse {
+        ///             use_token: input.parse()?,
+        ///             path: input.call(Path::parse_mod_style)?,
+        ///         })
+        ///     }
+        /// }
+        /// ```
+        #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+        pub fn parse_mod_style(input: ParseStream) -> Result<Self> {
+            Ok(Path {
+                leading_colon: input.parse()?,
+                segments: {
+                    let mut segments = Punctuated::new();
+                    loop {
+                        if !input.peek(Ident)
+                            && !input.peek(Token![super])
+                            && !input.peek(Token![self])
+                            && !input.peek(Token![Self])
+                            && !input.peek(Token![crate])
+                        {
+                            break;
+                        }
+                        let ident = Ident::parse_any(input)?;
+                        segments.push_value(PathSegment::from(ident));
+                        if !input.peek(Token![::]) {
+                            break;
+                        }
+                        let punct = input.parse()?;
+                        segments.push_punct(punct);
+                    }
+                    if segments.is_empty() {
+                        return Err(input.parse::<Ident>().unwrap_err());
+                    } else if segments.trailing_punct() {
+                        return Err(input.error("expected path segment after `::`"));
+                    }
+                    segments
+                },
+            })
+        }
+
+        pub(crate) fn parse_helper(input: ParseStream, expr_style: bool) -> Result<Self> {
+            let mut path = Path {
+                leading_colon: input.parse()?,
+                segments: {
+                    let mut segments = Punctuated::new();
+                    let value = PathSegment::parse_helper(input, expr_style)?;
+                    segments.push_value(value);
+                    segments
+                },
+            };
+            Path::parse_rest(input, &mut path, expr_style)?;
+            Ok(path)
+        }
+
+        pub(crate) fn parse_rest(
+            input: ParseStream,
+            path: &mut Self,
+            expr_style: bool,
+        ) -> Result<()> {
+            while input.peek(Token![::]) && !input.peek3(token::Paren) {
+                let punct: Token![::] = input.parse()?;
+                path.segments.push_punct(punct);
+                let value = PathSegment::parse_helper(input, expr_style)?;
+                path.segments.push_value(value);
+            }
+            Ok(())
+        }
+
+        pub(crate) fn is_mod_style(&self) -> bool {
+            self.segments
+                .iter()
+                .all(|segment| segment.arguments.is_none())
+        }
+    }
+
+    pub(crate) fn qpath(input: ParseStream, expr_style: bool) -> Result<(Option<QSelf>, Path)> {
+        if input.peek(Token![<]) {
+            let lt_token: Token![<] = input.parse()?;
+            let this: Type = input.parse()?;
+            let path = if input.peek(Token![as]) {
+                let as_token: Token![as] = input.parse()?;
+                let path: Path = input.parse()?;
+                Some((as_token, path))
+            } else {
+                None
+            };
+            let gt_token: Token![>] = input.parse()?;
+            let colon2_token: Token![::] = input.parse()?;
+            let mut rest = Punctuated::new();
+            loop {
+                let path = PathSegment::parse_helper(input, expr_style)?;
+                rest.push_value(path);
+                if !input.peek(Token![::]) {
+                    break;
+                }
+                let punct: Token![::] = input.parse()?;
+                rest.push_punct(punct);
+            }
+            let (position, as_token, path) = match path {
+                Some((as_token, mut path)) => {
+                    let pos = path.segments.len();
+                    path.segments.push_punct(colon2_token);
+                    path.segments.extend(rest.into_pairs());
+                    (pos, Some(as_token), path)
+                }
+                None => {
+                    let path = Path {
+                        leading_colon: Some(colon2_token),
+                        segments: rest,
+                    };
+                    (0, None, path)
+                }
+            };
+            let qself = QSelf {
+                lt_token,
+                ty: Box::new(this),
+                position,
+                as_token,
+                gt_token,
+            };
+            Ok((Some(qself), path))
+        } else {
+            let path = Path::parse_helper(input, expr_style)?;
+            Ok((None, path))
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+pub(crate) mod printing {
+    use crate::generics;
+    use crate::path::{
+        AngleBracketedGenericArguments, AssocConst, AssocType, Constraint, GenericArgument,
+        ParenthesizedGenericArguments, Path, PathArguments, PathSegment, QSelf,
+    };
+    use crate::print::TokensOrDefault;
+    #[cfg(feature = "parsing")]
+    use crate::spanned::Spanned;
+    #[cfg(feature = "parsing")]
+    use proc_macro2::Span;
+    use proc_macro2::TokenStream;
+    use quote::ToTokens;
+    use std::cmp;
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for Path {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.leading_colon.to_tokens(tokens);
+            self.segments.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for PathSegment {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.ident.to_tokens(tokens);
+            self.arguments.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for PathArguments {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                PathArguments::None => {}
+                PathArguments::AngleBracketed(arguments) => {
+                    arguments.to_tokens(tokens);
+                }
+                PathArguments::Parenthesized(arguments) => {
+                    arguments.to_tokens(tokens);
+                }
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for GenericArgument {
+        #[allow(clippy::match_same_arms)]
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                GenericArgument::Lifetime(lt) => lt.to_tokens(tokens),
+                GenericArgument::Type(ty) => ty.to_tokens(tokens),
+                GenericArgument::Const(expr) => {
+                    generics::printing::print_const_argument(expr, tokens);
+                }
+                GenericArgument::AssocType(assoc) => assoc.to_tokens(tokens),
+                GenericArgument::AssocConst(assoc) => assoc.to_tokens(tokens),
+                GenericArgument::Constraint(constraint) => constraint.to_tokens(tokens),
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for AngleBracketedGenericArguments {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.colon2_token.to_tokens(tokens);
+            self.lt_token.to_tokens(tokens);
+
+            // Print lifetimes before types/consts/bindings, regardless of their
+            // order in self.args.
+            let mut trailing_or_empty = true;
+            for param in self.args.pairs() {
+                match param.value() {
+                    GenericArgument::Lifetime(_) => {
+                        param.to_tokens(tokens);
+                        trailing_or_empty = param.punct().is_some();
+                    }
+                    GenericArgument::Type(_)
+                    | GenericArgument::Const(_)
+                    | GenericArgument::AssocType(_)
+                    | GenericArgument::AssocConst(_)
+                    | GenericArgument::Constraint(_) => {}
+                }
+            }
+            for param in self.args.pairs() {
+                match param.value() {
+                    GenericArgument::Type(_)
+                    | GenericArgument::Const(_)
+                    | GenericArgument::AssocType(_)
+                    | GenericArgument::AssocConst(_)
+                    | GenericArgument::Constraint(_) => {
+                        if !trailing_or_empty {
+                            <Token![,]>::default().to_tokens(tokens);
+                        }
+                        param.to_tokens(tokens);
+                        trailing_or_empty = param.punct().is_some();
+                    }
+                    GenericArgument::Lifetime(_) => {}
+                }
+            }
+
+            self.gt_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for AssocType {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for AssocConst {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            generics::printing::print_const_argument(&self.value, tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for Constraint {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.bounds.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ParenthesizedGenericArguments {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.paren_token.surround(tokens, |tokens| {
+                self.inputs.to_tokens(tokens);
+            });
+            self.output.to_tokens(tokens);
+        }
+    }
+
+    pub(crate) fn print_path(tokens: &mut TokenStream, qself: &Option<QSelf>, path: &Path) {
+        let qself = match qself {
+            Some(qself) => qself,
+            None => {
+                path.to_tokens(tokens);
+                return;
+            }
+        };
+        qself.lt_token.to_tokens(tokens);
+        qself.ty.to_tokens(tokens);
+
+        let pos = cmp::min(qself.position, path.segments.len());
+        let mut segments = path.segments.pairs();
+        if pos > 0 {
+            TokensOrDefault(&qself.as_token).to_tokens(tokens);
+            path.leading_colon.to_tokens(tokens);
+            for (i, segment) in segments.by_ref().take(pos).enumerate() {
+                if i + 1 == pos {
+                    segment.value().to_tokens(tokens);
+                    qself.gt_token.to_tokens(tokens);
+                    segment.punct().to_tokens(tokens);
+                } else {
+                    segment.to_tokens(tokens);
+                }
+            }
+        } else {
+            qself.gt_token.to_tokens(tokens);
+            path.leading_colon.to_tokens(tokens);
+        }
+        for segment in segments {
+            segment.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "parsing", feature = "printing"))))]
+    impl Spanned for QSelf {
+        fn span(&self) -> Span {
+            struct QSelfDelimiters<'a>(&'a QSelf);
+
+            impl<'a> ToTokens for QSelfDelimiters<'a> {
+                fn to_tokens(&self, tokens: &mut TokenStream) {
+                    self.0.lt_token.to_tokens(tokens);
+                    self.0.gt_token.to_tokens(tokens);
+                }
+            }
+
+            QSelfDelimiters(self).span()
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/precedence.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/precedence.rs
--- 43.0.0-1/rust-vendor/syn/src/precedence.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/precedence.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,162 @@
+#[cfg(feature = "printing")]
+use crate::expr::Expr;
+#[cfg(all(feature = "printing", feature = "full"))]
+use crate::expr::{ExprBreak, ExprReturn, ExprYield};
+use crate::op::BinOp;
+#[cfg(all(feature = "printing", feature = "full"))]
+use crate::ty::ReturnType;
+use std::cmp::Ordering;
+
+// Reference: https://doc.rust-lang.org/reference/expressions.html#expression-precedence
+pub(crate) enum Precedence {
+    // return, break, closures
+    Jump,
+    // = += -= *= /= %= &= |= ^= <<= >>=
+    Assign,
+    // .. ..=
+    Range,
+    // ||
+    Or,
+    // &&
+    And,
+    // let
+    #[cfg(feature = "printing")]
+    Let,
+    // == != < > <= >=
+    Compare,
+    // |
+    BitOr,
+    // ^
+    BitXor,
+    // &
+    BitAnd,
+    // << >>
+    Shift,
+    // + -
+    Sum,
+    // * / %
+    Product,
+    // as
+    Cast,
+    // unary - * ! & &mut
+    #[cfg(feature = "printing")]
+    Prefix,
+    // paths, loops, function calls, array indexing, field expressions, method calls
+    #[cfg(feature = "printing")]
+    Unambiguous,
+}
+
+impl Precedence {
+    pub(crate) const MIN: Self = Precedence::Jump;
+
+    pub(crate) fn of_binop(op: &BinOp) -> Self {
+        match op {
+            BinOp::Add(_) | BinOp::Sub(_) => Precedence::Sum,
+            BinOp::Mul(_) | BinOp::Div(_) | BinOp::Rem(_) => Precedence::Product,
+            BinOp::And(_) => Precedence::And,
+            BinOp::Or(_) => Precedence::Or,
+            BinOp::BitXor(_) => Precedence::BitXor,
+            BinOp::BitAnd(_) => Precedence::BitAnd,
+            BinOp::BitOr(_) => Precedence::BitOr,
+            BinOp::Shl(_) | BinOp::Shr(_) => Precedence::Shift,
+
+            BinOp::Eq(_)
+            | BinOp::Lt(_)
+            | BinOp::Le(_)
+            | BinOp::Ne(_)
+            | BinOp::Ge(_)
+            | BinOp::Gt(_) => Precedence::Compare,
+
+            BinOp::AddAssign(_)
+            | BinOp::SubAssign(_)
+            | BinOp::MulAssign(_)
+            | BinOp::DivAssign(_)
+            | BinOp::RemAssign(_)
+            | BinOp::BitXorAssign(_)
+            | BinOp::BitAndAssign(_)
+            | BinOp::BitOrAssign(_)
+            | BinOp::ShlAssign(_)
+            | BinOp::ShrAssign(_) => Precedence::Assign,
+        }
+    }
+
+    #[cfg(feature = "printing")]
+    pub(crate) fn of(e: &Expr) -> Self {
+        match e {
+            #[cfg(feature = "full")]
+            Expr::Closure(e) => match e.output {
+                ReturnType::Default => Precedence::Jump,
+                ReturnType::Type(..) => Precedence::Unambiguous,
+            },
+
+            #[cfg(feature = "full")]
+            Expr::Break(ExprBreak { expr, .. })
+            | Expr::Return(ExprReturn { expr, .. })
+            | Expr::Yield(ExprYield { expr, .. }) => match expr {
+                Some(_) => Precedence::Jump,
+                None => Precedence::Unambiguous,
+            },
+
+            Expr::Assign(_) => Precedence::Assign,
+            Expr::Range(_) => Precedence::Range,
+            Expr::Binary(e) => Precedence::of_binop(&e.op),
+            Expr::Let(_) => Precedence::Let,
+            Expr::Cast(_) => Precedence::Cast,
+            Expr::Reference(_) | Expr::Unary(_) => Precedence::Prefix,
+
+            Expr::Array(_)
+            | Expr::Async(_)
+            | Expr::Await(_)
+            | Expr::Block(_)
+            | Expr::Call(_)
+            | Expr::Const(_)
+            | Expr::Continue(_)
+            | Expr::Field(_)
+            | Expr::ForLoop(_)
+            | Expr::Group(_)
+            | Expr::If(_)
+            | Expr::Index(_)
+            | Expr::Infer(_)
+            | Expr::Lit(_)
+            | Expr::Loop(_)
+            | Expr::Macro(_)
+            | Expr::Match(_)
+            | Expr::MethodCall(_)
+            | Expr::Paren(_)
+            | Expr::Path(_)
+            | Expr::Repeat(_)
+            | Expr::Struct(_)
+            | Expr::Try(_)
+            | Expr::TryBlock(_)
+            | Expr::Tuple(_)
+            | Expr::Unsafe(_)
+            | Expr::Verbatim(_)
+            | Expr::While(_) => Precedence::Unambiguous,
+
+            #[cfg(not(feature = "full"))]
+            Expr::Break(_) | Expr::Closure(_) | Expr::Return(_) | Expr::Yield(_) => unreachable!(),
+        }
+    }
+}
+
+impl Copy for Precedence {}
+
+impl Clone for Precedence {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+impl PartialEq for Precedence {
+    fn eq(&self, other: &Self) -> bool {
+        *self as u8 == *other as u8
+    }
+}
+
+impl PartialOrd for Precedence {
+    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
+        let this = *self as u8;
+        let other = *other as u8;
+        Some(this.cmp(&other))
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/print.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/print.rs
--- 43.0.0-1/rust-vendor/syn/src/print.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/print.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,16 @@
+use proc_macro2::TokenStream;
+use quote::ToTokens;
+
+pub(crate) struct TokensOrDefault<'a, T: 'a>(pub &'a Option<T>);
+
+impl<'a, T> ToTokens for TokensOrDefault<'a, T>
+where
+    T: ToTokens + Default,
+{
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        match self.0 {
+            Some(t) => t.to_tokens(tokens),
+            None => T::default().to_tokens(tokens),
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/punctuated.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/punctuated.rs
--- 43.0.0-1/rust-vendor/syn/src/punctuated.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/punctuated.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1155 @@
+//! A punctuated sequence of syntax tree nodes separated by punctuation.
+//!
+//! Lots of things in Rust are punctuated sequences.
+//!
+//! - The fields of a struct are `Punctuated<Field, Token![,]>`.
+//! - The segments of a path are `Punctuated<PathSegment, Token![::]>`.
+//! - The bounds on a generic parameter are `Punctuated<TypeParamBound,
+//!   Token![+]>`.
+//! - The arguments to a function call are `Punctuated<Expr, Token![,]>`.
+//!
+//! This module provides a common representation for these punctuated sequences
+//! in the form of the [`Punctuated<T, P>`] type. We store a vector of pairs of
+//! syntax tree node + punctuation, where every node in the sequence is followed
+//! by punctuation except for possibly the final one.
+//!
+//! [`Punctuated<T, P>`]: Punctuated
+//!
+//! ```text
+//! a_function_call(arg1, arg2, arg3);
+//!                 ~~~~^ ~~~~^ ~~~~
+//! ```
+
+use crate::drops::{NoDrop, TrivialDrop};
+#[cfg(feature = "parsing")]
+use crate::error::Result;
+#[cfg(feature = "parsing")]
+use crate::parse::{Parse, ParseStream};
+#[cfg(feature = "parsing")]
+use crate::token::Token;
+#[cfg(feature = "extra-traits")]
+use std::fmt::{self, Debug};
+#[cfg(feature = "extra-traits")]
+use std::hash::{Hash, Hasher};
+#[cfg(any(feature = "full", feature = "derive"))]
+use std::iter;
+use std::ops::{Index, IndexMut};
+use std::option;
+use std::slice;
+use std::vec;
+
+/// **A punctuated sequence of syntax tree nodes of type `T` separated by
+/// punctuation of type `P`.**
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+pub struct Punctuated<T, P> {
+    inner: Vec<(T, P)>,
+    last: Option<Box<T>>,
+}
+
+impl<T, P> Punctuated<T, P> {
+    /// Creates an empty punctuated sequence.
+    pub const fn new() -> Self {
+        Punctuated {
+            inner: Vec::new(),
+            last: None,
+        }
+    }
+
+    /// Determines whether this punctuated sequence is empty, meaning it
+    /// contains no syntax tree nodes or punctuation.
+    pub fn is_empty(&self) -> bool {
+        self.inner.len() == 0 && self.last.is_none()
+    }
+
+    /// Returns the number of syntax tree nodes in this punctuated sequence.
+    ///
+    /// This is the number of nodes of type `T`, not counting the punctuation of
+    /// type `P`.
+    pub fn len(&self) -> usize {
+        self.inner.len() + if self.last.is_some() { 1 } else { 0 }
+    }
+
+    /// Borrows the first element in this sequence.
+    pub fn first(&self) -> Option<&T> {
+        self.iter().next()
+    }
+
+    /// Mutably borrows the first element in this sequence.
+    pub fn first_mut(&mut self) -> Option<&mut T> {
+        self.iter_mut().next()
+    }
+
+    /// Borrows the last element in this sequence.
+    pub fn last(&self) -> Option<&T> {
+        self.iter().next_back()
+    }
+
+    /// Mutably borrows the last element in this sequence.
+    pub fn last_mut(&mut self) -> Option<&mut T> {
+        self.iter_mut().next_back()
+    }
+
+    /// Borrows the element at the given index.
+    pub fn get(&self, index: usize) -> Option<&T> {
+        if let Some((value, _punct)) = self.inner.get(index) {
+            Some(value)
+        } else if index == self.inner.len() {
+            self.last.as_deref()
+        } else {
+            None
+        }
+    }
+
+    /// Mutably borrows the element at the given index.
+    pub fn get_mut(&mut self, index: usize) -> Option<&mut T> {
+        let inner_len = self.inner.len();
+        if let Some((value, _punct)) = self.inner.get_mut(index) {
+            Some(value)
+        } else if index == inner_len {
+            self.last.as_deref_mut()
+        } else {
+            None
+        }
+    }
+
+    /// Returns an iterator over borrowed syntax tree nodes of type `&T`.
+    pub fn iter(&self) -> Iter<T> {
+        Iter {
+            inner: Box::new(NoDrop::new(PrivateIter {
+                inner: self.inner.iter(),
+                last: self.last.as_ref().map(Box::as_ref).into_iter(),
+            })),
+        }
+    }
+
+    /// Returns an iterator over mutably borrowed syntax tree nodes of type
+    /// `&mut T`.
+    pub fn iter_mut(&mut self) -> IterMut<T> {
+        IterMut {
+            inner: Box::new(NoDrop::new(PrivateIterMut {
+                inner: self.inner.iter_mut(),
+                last: self.last.as_mut().map(Box::as_mut).into_iter(),
+            })),
+        }
+    }
+
+    /// Returns an iterator over the contents of this sequence as borrowed
+    /// punctuated pairs.
+    pub fn pairs(&self) -> Pairs<T, P> {
+        Pairs {
+            inner: self.inner.iter(),
+            last: self.last.as_ref().map(Box::as_ref).into_iter(),
+        }
+    }
+
+    /// Returns an iterator over the contents of this sequence as mutably
+    /// borrowed punctuated pairs.
+    pub fn pairs_mut(&mut self) -> PairsMut<T, P> {
+        PairsMut {
+            inner: self.inner.iter_mut(),
+            last: self.last.as_mut().map(Box::as_mut).into_iter(),
+        }
+    }
+
+    /// Returns an iterator over the contents of this sequence as owned
+    /// punctuated pairs.
+    pub fn into_pairs(self) -> IntoPairs<T, P> {
+        IntoPairs {
+            inner: self.inner.into_iter(),
+            last: self.last.map(|t| *t).into_iter(),
+        }
+    }
+
+    /// Appends a syntax tree node onto the end of this punctuated sequence. The
+    /// sequence must already have a trailing punctuation, or be empty.
+    ///
+    /// Use [`push`] instead if the punctuated sequence may or may not already
+    /// have trailing punctuation.
+    ///
+    /// [`push`]: Punctuated::push
+    ///
+    /// # Panics
+    ///
+    /// Panics if the sequence is nonempty and does not already have a trailing
+    /// punctuation.
+    pub fn push_value(&mut self, value: T) {
+        assert!(
+            self.empty_or_trailing(),
+            "Punctuated::push_value: cannot push value if Punctuated is missing trailing punctuation",
+        );
+
+        self.last = Some(Box::new(value));
+    }
+
+    /// Appends a trailing punctuation onto the end of this punctuated sequence.
+    /// The sequence must be non-empty and must not already have trailing
+    /// punctuation.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the sequence is empty or already has a trailing punctuation.
+    pub fn push_punct(&mut self, punctuation: P) {
+        assert!(
+            self.last.is_some(),
+            "Punctuated::push_punct: cannot push punctuation if Punctuated is empty or already has trailing punctuation",
+        );
+
+        let last = self.last.take().unwrap();
+        self.inner.push((*last, punctuation));
+    }
+
+    /// Removes the last punctuated pair from this sequence, or `None` if the
+    /// sequence is empty.
+    pub fn pop(&mut self) -> Option<Pair<T, P>> {
+        if self.last.is_some() {
+            self.last.take().map(|t| Pair::End(*t))
+        } else {
+            self.inner.pop().map(|(t, p)| Pair::Punctuated(t, p))
+        }
+    }
+
+    /// Removes the trailing punctuation from this punctuated sequence, or
+    /// `None` if there isn't any.
+    pub fn pop_punct(&mut self) -> Option<P> {
+        if self.last.is_some() {
+            None
+        } else {
+            let (t, p) = self.inner.pop()?;
+            self.last = Some(Box::new(t));
+            Some(p)
+        }
+    }
+
+    /// Determines whether this punctuated sequence ends with a trailing
+    /// punctuation.
+    pub fn trailing_punct(&self) -> bool {
+        self.last.is_none() && !self.is_empty()
+    }
+
+    /// Returns true if either this `Punctuated` is empty, or it has a trailing
+    /// punctuation.
+    ///
+    /// Equivalent to `punctuated.is_empty() || punctuated.trailing_punct()`.
+    pub fn empty_or_trailing(&self) -> bool {
+        self.last.is_none()
+    }
+
+    /// Appends a syntax tree node onto the end of this punctuated sequence.
+    ///
+    /// If there is not a trailing punctuation in this sequence when this method
+    /// is called, the default value of punctuation type `P` is inserted before
+    /// the given value of type `T`.
+    pub fn push(&mut self, value: T)
+    where
+        P: Default,
+    {
+        if !self.empty_or_trailing() {
+            self.push_punct(Default::default());
+        }
+        self.push_value(value);
+    }
+
+    /// Inserts an element at position `index`.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `index` is greater than the number of elements previously in
+    /// this punctuated sequence.
+    pub fn insert(&mut self, index: usize, value: T)
+    where
+        P: Default,
+    {
+        assert!(
+            index <= self.len(),
+            "Punctuated::insert: index out of range",
+        );
+
+        if index == self.len() {
+            self.push(value);
+        } else {
+            self.inner.insert(index, (value, Default::default()));
+        }
+    }
+
+    /// Clears the sequence of all values and punctuation, making it empty.
+    pub fn clear(&mut self) {
+        self.inner.clear();
+        self.last = None;
+    }
+
+    /// Parses zero or more occurrences of `T` separated by punctuation of type
+    /// `P`, with optional trailing punctuation.
+    ///
+    /// Parsing continues until the end of this parse stream. The entire content
+    /// of this parse stream must consist of `T` and `P`.
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    pub fn parse_terminated(input: ParseStream) -> Result<Self>
+    where
+        T: Parse,
+        P: Parse,
+    {
+        Self::parse_terminated_with(input, T::parse)
+    }
+
+    /// Parses zero or more occurrences of `T` using the given parse function,
+    /// separated by punctuation of type `P`, with optional trailing
+    /// punctuation.
+    ///
+    /// Like [`parse_terminated`], the entire content of this stream is expected
+    /// to be parsed.
+    ///
+    /// [`parse_terminated`]: Punctuated::parse_terminated
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    pub fn parse_terminated_with(
+        input: ParseStream,
+        parser: fn(ParseStream) -> Result<T>,
+    ) -> Result<Self>
+    where
+        P: Parse,
+    {
+        let mut punctuated = Punctuated::new();
+
+        loop {
+            if input.is_empty() {
+                break;
+            }
+            let value = parser(input)?;
+            punctuated.push_value(value);
+            if input.is_empty() {
+                break;
+            }
+            let punct = input.parse()?;
+            punctuated.push_punct(punct);
+        }
+
+        Ok(punctuated)
+    }
+
+    /// Parses one or more occurrences of `T` separated by punctuation of type
+    /// `P`, not accepting trailing punctuation.
+    ///
+    /// Parsing continues as long as punctuation `P` is present at the head of
+    /// the stream. This method returns upon parsing a `T` and observing that it
+    /// is not followed by a `P`, even if there are remaining tokens in the
+    /// stream.
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    pub fn parse_separated_nonempty(input: ParseStream) -> Result<Self>
+    where
+        T: Parse,
+        P: Token + Parse,
+    {
+        Self::parse_separated_nonempty_with(input, T::parse)
+    }
+
+    /// Parses one or more occurrences of `T` using the given parse function,
+    /// separated by punctuation of type `P`, not accepting trailing
+    /// punctuation.
+    ///
+    /// Like [`parse_separated_nonempty`], may complete early without parsing
+    /// the entire content of this stream.
+    ///
+    /// [`parse_separated_nonempty`]: Punctuated::parse_separated_nonempty
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    pub fn parse_separated_nonempty_with(
+        input: ParseStream,
+        parser: fn(ParseStream) -> Result<T>,
+    ) -> Result<Self>
+    where
+        P: Token + Parse,
+    {
+        let mut punctuated = Punctuated::new();
+
+        loop {
+            let value = parser(input)?;
+            punctuated.push_value(value);
+            if !P::peek(input.cursor()) {
+                break;
+            }
+            let punct = input.parse()?;
+            punctuated.push_punct(punct);
+        }
+
+        Ok(punctuated)
+    }
+}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl<T, P> Clone for Punctuated<T, P>
+where
+    T: Clone,
+    P: Clone,
+{
+    fn clone(&self) -> Self {
+        Punctuated {
+            inner: self.inner.clone(),
+            last: self.last.clone(),
+        }
+    }
+
+    fn clone_from(&mut self, other: &Self) {
+        self.inner.clone_from(&other.inner);
+        self.last.clone_from(&other.last);
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl<T, P> Eq for Punctuated<T, P>
+where
+    T: Eq,
+    P: Eq,
+{
+}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl<T, P> PartialEq for Punctuated<T, P>
+where
+    T: PartialEq,
+    P: PartialEq,
+{
+    fn eq(&self, other: &Self) -> bool {
+        let Punctuated { inner, last } = self;
+        *inner == other.inner && *last == other.last
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl<T, P> Hash for Punctuated<T, P>
+where
+    T: Hash,
+    P: Hash,
+{
+    fn hash<H: Hasher>(&self, state: &mut H) {
+        let Punctuated { inner, last } = self;
+        inner.hash(state);
+        last.hash(state);
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl<T: Debug, P: Debug> Debug for Punctuated<T, P> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let mut list = f.debug_list();
+        for (t, p) in &self.inner {
+            list.entry(t);
+            list.entry(p);
+        }
+        if let Some(last) = &self.last {
+            list.entry(last);
+        }
+        list.finish()
+    }
+}
+
+impl<T, P> FromIterator<T> for Punctuated<T, P>
+where
+    P: Default,
+{
+    fn from_iter<I: IntoIterator<Item = T>>(i: I) -> Self {
+        let mut ret = Punctuated::new();
+        ret.extend(i);
+        ret
+    }
+}
+
+impl<T, P> Extend<T> for Punctuated<T, P>
+where
+    P: Default,
+{
+    fn extend<I: IntoIterator<Item = T>>(&mut self, i: I) {
+        for value in i {
+            self.push(value);
+        }
+    }
+}
+
+impl<T, P> FromIterator<Pair<T, P>> for Punctuated<T, P> {
+    fn from_iter<I: IntoIterator<Item = Pair<T, P>>>(i: I) -> Self {
+        let mut ret = Punctuated::new();
+        do_extend(&mut ret, i.into_iter());
+        ret
+    }
+}
+
+impl<T, P> Extend<Pair<T, P>> for Punctuated<T, P>
+where
+    P: Default,
+{
+    fn extend<I: IntoIterator<Item = Pair<T, P>>>(&mut self, i: I) {
+        if !self.empty_or_trailing() {
+            self.push_punct(P::default());
+        }
+        do_extend(self, i.into_iter());
+    }
+}
+
+fn do_extend<T, P, I>(punctuated: &mut Punctuated<T, P>, i: I)
+where
+    I: Iterator<Item = Pair<T, P>>,
+{
+    let mut nomore = false;
+    for pair in i {
+        if nomore {
+            panic!("punctuated extended with items after a Pair::End");
+        }
+        match pair {
+            Pair::Punctuated(a, b) => punctuated.inner.push((a, b)),
+            Pair::End(a) => {
+                punctuated.last = Some(Box::new(a));
+                nomore = true;
+            }
+        }
+    }
+}
+
+impl<T, P> IntoIterator for Punctuated<T, P> {
+    type Item = T;
+    type IntoIter = IntoIter<T>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        let mut elements = Vec::with_capacity(self.len());
+        elements.extend(self.inner.into_iter().map(|pair| pair.0));
+        elements.extend(self.last.map(|t| *t));
+
+        IntoIter {
+            inner: elements.into_iter(),
+        }
+    }
+}
+
+impl<'a, T, P> IntoIterator for &'a Punctuated<T, P> {
+    type Item = &'a T;
+    type IntoIter = Iter<'a, T>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        Punctuated::iter(self)
+    }
+}
+
+impl<'a, T, P> IntoIterator for &'a mut Punctuated<T, P> {
+    type Item = &'a mut T;
+    type IntoIter = IterMut<'a, T>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        Punctuated::iter_mut(self)
+    }
+}
+
+impl<T, P> Default for Punctuated<T, P> {
+    fn default() -> Self {
+        Punctuated::new()
+    }
+}
+
+/// An iterator over borrowed pairs of type `Pair<&T, &P>`.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+pub struct Pairs<'a, T: 'a, P: 'a> {
+    inner: slice::Iter<'a, (T, P)>,
+    last: option::IntoIter<&'a T>,
+}
+
+impl<'a, T, P> Iterator for Pairs<'a, T, P> {
+    type Item = Pair<&'a T, &'a P>;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner
+            .next()
+            .map(|(t, p)| Pair::Punctuated(t, p))
+            .or_else(|| self.last.next().map(Pair::End))
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        (self.len(), Some(self.len()))
+    }
+}
+
+impl<'a, T, P> DoubleEndedIterator for Pairs<'a, T, P> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.last
+            .next()
+            .map(Pair::End)
+            .or_else(|| self.inner.next_back().map(|(t, p)| Pair::Punctuated(t, p)))
+    }
+}
+
+impl<'a, T, P> ExactSizeIterator for Pairs<'a, T, P> {
+    fn len(&self) -> usize {
+        self.inner.len() + self.last.len()
+    }
+}
+
+// No Clone bound on T or P.
+impl<'a, T, P> Clone for Pairs<'a, T, P> {
+    fn clone(&self) -> Self {
+        Pairs {
+            inner: self.inner.clone(),
+            last: self.last.clone(),
+        }
+    }
+}
+
+/// An iterator over mutably borrowed pairs of type `Pair<&mut T, &mut P>`.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+pub struct PairsMut<'a, T: 'a, P: 'a> {
+    inner: slice::IterMut<'a, (T, P)>,
+    last: option::IntoIter<&'a mut T>,
+}
+
+impl<'a, T, P> Iterator for PairsMut<'a, T, P> {
+    type Item = Pair<&'a mut T, &'a mut P>;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner
+            .next()
+            .map(|(t, p)| Pair::Punctuated(t, p))
+            .or_else(|| self.last.next().map(Pair::End))
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        (self.len(), Some(self.len()))
+    }
+}
+
+impl<'a, T, P> DoubleEndedIterator for PairsMut<'a, T, P> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.last
+            .next()
+            .map(Pair::End)
+            .or_else(|| self.inner.next_back().map(|(t, p)| Pair::Punctuated(t, p)))
+    }
+}
+
+impl<'a, T, P> ExactSizeIterator for PairsMut<'a, T, P> {
+    fn len(&self) -> usize {
+        self.inner.len() + self.last.len()
+    }
+}
+
+/// An iterator over owned pairs of type `Pair<T, P>`.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+pub struct IntoPairs<T, P> {
+    inner: vec::IntoIter<(T, P)>,
+    last: option::IntoIter<T>,
+}
+
+impl<T, P> Iterator for IntoPairs<T, P> {
+    type Item = Pair<T, P>;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner
+            .next()
+            .map(|(t, p)| Pair::Punctuated(t, p))
+            .or_else(|| self.last.next().map(Pair::End))
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        (self.len(), Some(self.len()))
+    }
+}
+
+impl<T, P> DoubleEndedIterator for IntoPairs<T, P> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.last
+            .next()
+            .map(Pair::End)
+            .or_else(|| self.inner.next_back().map(|(t, p)| Pair::Punctuated(t, p)))
+    }
+}
+
+impl<T, P> ExactSizeIterator for IntoPairs<T, P> {
+    fn len(&self) -> usize {
+        self.inner.len() + self.last.len()
+    }
+}
+
+impl<T, P> Clone for IntoPairs<T, P>
+where
+    T: Clone,
+    P: Clone,
+{
+    fn clone(&self) -> Self {
+        IntoPairs {
+            inner: self.inner.clone(),
+            last: self.last.clone(),
+        }
+    }
+}
+
+/// An iterator over owned values of type `T`.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+pub struct IntoIter<T> {
+    inner: vec::IntoIter<T>,
+}
+
+impl<T> Iterator for IntoIter<T> {
+    type Item = T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner.next()
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        (self.len(), Some(self.len()))
+    }
+}
+
+impl<T> DoubleEndedIterator for IntoIter<T> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.inner.next_back()
+    }
+}
+
+impl<T> ExactSizeIterator for IntoIter<T> {
+    fn len(&self) -> usize {
+        self.inner.len()
+    }
+}
+
+impl<T> Clone for IntoIter<T>
+where
+    T: Clone,
+{
+    fn clone(&self) -> Self {
+        IntoIter {
+            inner: self.inner.clone(),
+        }
+    }
+}
+
+/// An iterator over borrowed values of type `&T`.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+pub struct Iter<'a, T: 'a> {
+    inner: Box<NoDrop<dyn IterTrait<'a, T> + 'a>>,
+}
+
+trait IterTrait<'a, T: 'a>: Iterator<Item = &'a T> + DoubleEndedIterator + ExactSizeIterator {
+    fn clone_box(&self) -> Box<NoDrop<dyn IterTrait<'a, T> + 'a>>;
+}
+
+struct PrivateIter<'a, T: 'a, P: 'a> {
+    inner: slice::Iter<'a, (T, P)>,
+    last: option::IntoIter<&'a T>,
+}
+
+impl<'a, T, P> TrivialDrop for PrivateIter<'a, T, P>
+where
+    slice::Iter<'a, (T, P)>: TrivialDrop,
+    option::IntoIter<&'a T>: TrivialDrop,
+{
+}
+
+#[cfg(any(feature = "full", feature = "derive"))]
+pub(crate) fn empty_punctuated_iter<'a, T>() -> Iter<'a, T> {
+    Iter {
+        inner: Box::new(NoDrop::new(iter::empty())),
+    }
+}
+
+// No Clone bound on T.
+impl<'a, T> Clone for Iter<'a, T> {
+    fn clone(&self) -> Self {
+        Iter {
+            inner: self.inner.clone_box(),
+        }
+    }
+}
+
+impl<'a, T> Iterator for Iter<'a, T> {
+    type Item = &'a T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner.next()
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        (self.len(), Some(self.len()))
+    }
+}
+
+impl<'a, T> DoubleEndedIterator for Iter<'a, T> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.inner.next_back()
+    }
+}
+
+impl<'a, T> ExactSizeIterator for Iter<'a, T> {
+    fn len(&self) -> usize {
+        self.inner.len()
+    }
+}
+
+impl<'a, T, P> Iterator for PrivateIter<'a, T, P> {
+    type Item = &'a T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner
+            .next()
+            .map(|pair| &pair.0)
+            .or_else(|| self.last.next())
+    }
+}
+
+impl<'a, T, P> DoubleEndedIterator for PrivateIter<'a, T, P> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.last
+            .next()
+            .or_else(|| self.inner.next_back().map(|pair| &pair.0))
+    }
+}
+
+impl<'a, T, P> ExactSizeIterator for PrivateIter<'a, T, P> {
+    fn len(&self) -> usize {
+        self.inner.len() + self.last.len()
+    }
+}
+
+// No Clone bound on T or P.
+impl<'a, T, P> Clone for PrivateIter<'a, T, P> {
+    fn clone(&self) -> Self {
+        PrivateIter {
+            inner: self.inner.clone(),
+            last: self.last.clone(),
+        }
+    }
+}
+
+impl<'a, T, I> IterTrait<'a, T> for I
+where
+    T: 'a,
+    I: DoubleEndedIterator<Item = &'a T>
+        + ExactSizeIterator<Item = &'a T>
+        + Clone
+        + TrivialDrop
+        + 'a,
+{
+    fn clone_box(&self) -> Box<NoDrop<dyn IterTrait<'a, T> + 'a>> {
+        Box::new(NoDrop::new(self.clone()))
+    }
+}
+
+/// An iterator over mutably borrowed values of type `&mut T`.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+pub struct IterMut<'a, T: 'a> {
+    inner: Box<NoDrop<dyn IterMutTrait<'a, T, Item = &'a mut T> + 'a>>,
+}
+
+trait IterMutTrait<'a, T: 'a>:
+    DoubleEndedIterator<Item = &'a mut T> + ExactSizeIterator<Item = &'a mut T>
+{
+}
+
+struct PrivateIterMut<'a, T: 'a, P: 'a> {
+    inner: slice::IterMut<'a, (T, P)>,
+    last: option::IntoIter<&'a mut T>,
+}
+
+impl<'a, T, P> TrivialDrop for PrivateIterMut<'a, T, P>
+where
+    slice::IterMut<'a, (T, P)>: TrivialDrop,
+    option::IntoIter<&'a mut T>: TrivialDrop,
+{
+}
+
+#[cfg(any(feature = "full", feature = "derive"))]
+pub(crate) fn empty_punctuated_iter_mut<'a, T>() -> IterMut<'a, T> {
+    IterMut {
+        inner: Box::new(NoDrop::new(iter::empty())),
+    }
+}
+
+impl<'a, T> Iterator for IterMut<'a, T> {
+    type Item = &'a mut T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner.next()
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        (self.len(), Some(self.len()))
+    }
+}
+
+impl<'a, T> DoubleEndedIterator for IterMut<'a, T> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.inner.next_back()
+    }
+}
+
+impl<'a, T> ExactSizeIterator for IterMut<'a, T> {
+    fn len(&self) -> usize {
+        self.inner.len()
+    }
+}
+
+impl<'a, T, P> Iterator for PrivateIterMut<'a, T, P> {
+    type Item = &'a mut T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner
+            .next()
+            .map(|pair| &mut pair.0)
+            .or_else(|| self.last.next())
+    }
+}
+
+impl<'a, T, P> DoubleEndedIterator for PrivateIterMut<'a, T, P> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.last
+            .next()
+            .or_else(|| self.inner.next_back().map(|pair| &mut pair.0))
+    }
+}
+
+impl<'a, T, P> ExactSizeIterator for PrivateIterMut<'a, T, P> {
+    fn len(&self) -> usize {
+        self.inner.len() + self.last.len()
+    }
+}
+
+impl<'a, T, I> IterMutTrait<'a, T> for I
+where
+    T: 'a,
+    I: DoubleEndedIterator<Item = &'a mut T> + ExactSizeIterator<Item = &'a mut T> + 'a,
+{
+}
+
+/// A single syntax tree node of type `T` followed by its trailing punctuation
+/// of type `P` if any.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+pub enum Pair<T, P> {
+    Punctuated(T, P),
+    End(T),
+}
+
+impl<T, P> Pair<T, P> {
+    /// Extracts the syntax tree node from this punctuated pair, discarding the
+    /// following punctuation.
+    pub fn into_value(self) -> T {
+        match self {
+            Pair::Punctuated(t, _) | Pair::End(t) => t,
+        }
+    }
+
+    /// Borrows the syntax tree node from this punctuated pair.
+    pub fn value(&self) -> &T {
+        match self {
+            Pair::Punctuated(t, _) | Pair::End(t) => t,
+        }
+    }
+
+    /// Mutably borrows the syntax tree node from this punctuated pair.
+    pub fn value_mut(&mut self) -> &mut T {
+        match self {
+            Pair::Punctuated(t, _) | Pair::End(t) => t,
+        }
+    }
+
+    /// Borrows the punctuation from this punctuated pair, unless this pair is
+    /// the final one and there is no trailing punctuation.
+    pub fn punct(&self) -> Option<&P> {
+        match self {
+            Pair::Punctuated(_, p) => Some(p),
+            Pair::End(_) => None,
+        }
+    }
+
+    /// Mutably borrows the punctuation from this punctuated pair, unless the
+    /// pair is the final one and there is no trailing punctuation.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// # use proc_macro2::Span;
+    /// # use syn::punctuated::Punctuated;
+    /// # use syn::{parse_quote, Token, TypeParamBound};
+    /// #
+    /// # let mut punctuated = Punctuated::<TypeParamBound, Token![+]>::new();
+    /// # let span = Span::call_site();
+    /// #
+    /// punctuated.insert(0, parse_quote!('lifetime));
+    /// if let Some(punct) = punctuated.pairs_mut().next().unwrap().punct_mut() {
+    ///     punct.span = span;
+    /// }
+    /// ```
+    pub fn punct_mut(&mut self) -> Option<&mut P> {
+        match self {
+            Pair::Punctuated(_, p) => Some(p),
+            Pair::End(_) => None,
+        }
+    }
+
+    /// Creates a punctuated pair out of a syntax tree node and an optional
+    /// following punctuation.
+    pub fn new(t: T, p: Option<P>) -> Self {
+        match p {
+            Some(p) => Pair::Punctuated(t, p),
+            None => Pair::End(t),
+        }
+    }
+
+    /// Produces this punctuated pair as a tuple of syntax tree node and
+    /// optional following punctuation.
+    pub fn into_tuple(self) -> (T, Option<P>) {
+        match self {
+            Pair::Punctuated(t, p) => (t, Some(p)),
+            Pair::End(t) => (t, None),
+        }
+    }
+}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl<T, P> Pair<&T, &P> {
+    pub fn cloned(self) -> Pair<T, P>
+    where
+        T: Clone,
+        P: Clone,
+    {
+        match self {
+            Pair::Punctuated(t, p) => Pair::Punctuated(t.clone(), p.clone()),
+            Pair::End(t) => Pair::End(t.clone()),
+        }
+    }
+}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl<T, P> Clone for Pair<T, P>
+where
+    T: Clone,
+    P: Clone,
+{
+    fn clone(&self) -> Self {
+        match self {
+            Pair::Punctuated(t, p) => Pair::Punctuated(t.clone(), p.clone()),
+            Pair::End(t) => Pair::End(t.clone()),
+        }
+    }
+}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl<T, P> Copy for Pair<T, P>
+where
+    T: Copy,
+    P: Copy,
+{
+}
+
+impl<T, P> Index<usize> for Punctuated<T, P> {
+    type Output = T;
+
+    fn index(&self, index: usize) -> &Self::Output {
+        if index == self.len() - 1 {
+            match &self.last {
+                Some(t) => t,
+                None => &self.inner[index].0,
+            }
+        } else {
+            &self.inner[index].0
+        }
+    }
+}
+
+impl<T, P> IndexMut<usize> for Punctuated<T, P> {
+    fn index_mut(&mut self, index: usize) -> &mut Self::Output {
+        if index == self.len() - 1 {
+            match &mut self.last {
+                Some(t) => t,
+                None => &mut self.inner[index].0,
+            }
+        } else {
+            &mut self.inner[index].0
+        }
+    }
+}
+
+#[cfg(all(feature = "fold", any(feature = "full", feature = "derive")))]
+pub(crate) fn fold<T, P, V, F>(
+    punctuated: Punctuated<T, P>,
+    fold: &mut V,
+    mut f: F,
+) -> Punctuated<T, P>
+where
+    V: ?Sized,
+    F: FnMut(&mut V, T) -> T,
+{
+    Punctuated {
+        inner: punctuated
+            .inner
+            .into_iter()
+            .map(|(t, p)| (f(fold, t), p))
+            .collect(),
+        last: match punctuated.last {
+            Some(t) => Some(Box::new(f(fold, *t))),
+            None => None,
+        },
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::punctuated::{Pair, Punctuated};
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl<T, P> ToTokens for Punctuated<T, P>
+    where
+        T: ToTokens,
+        P: ToTokens,
+    {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.pairs());
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl<T, P> ToTokens for Pair<T, P>
+    where
+        T: ToTokens,
+        P: ToTokens,
+    {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                Pair::Punctuated(a, b) => {
+                    a.to_tokens(tokens);
+                    b.to_tokens(tokens);
+                }
+                Pair::End(a) => a.to_tokens(tokens),
+            }
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/restriction.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/restriction.rs
--- 43.0.0-1/rust-vendor/syn/src/restriction.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/restriction.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,176 @@
+use crate::path::Path;
+use crate::token;
+
+ast_enum! {
+    /// The visibility level of an item: inherited or `pub` or
+    /// `pub(restricted)`.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub enum Visibility {
+        /// A public visibility level: `pub`.
+        Public(Token![pub]),
+
+        /// A visibility level restricted to some path: `pub(self)` or
+        /// `pub(super)` or `pub(crate)` or `pub(in some::module)`.
+        Restricted(VisRestricted),
+
+        /// An inherited visibility, which usually means private.
+        Inherited,
+    }
+}
+
+ast_struct! {
+    /// A visibility level restricted to some path: `pub(self)` or
+    /// `pub(super)` or `pub(crate)` or `pub(in some::module)`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct VisRestricted {
+        pub pub_token: Token![pub],
+        pub paren_token: token::Paren,
+        pub in_token: Option<Token![in]>,
+        pub path: Box<Path>,
+    }
+}
+
+ast_enum! {
+    /// Unused, but reserved for RFC 3323 restrictions.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    #[non_exhaustive]
+    pub enum FieldMutability {
+        None,
+
+        // TODO: https://rust-lang.github.io/rfcs/3323-restrictions.html
+        //
+        // FieldMutability::Restricted(MutRestricted)
+        //
+        // pub struct MutRestricted {
+        //     pub mut_token: Token![mut],
+        //     pub paren_token: token::Paren,
+        //     pub in_token: Option<Token![in]>,
+        //     pub path: Box<Path>,
+        // }
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::error::Result;
+    use crate::ext::IdentExt as _;
+    use crate::ident::Ident;
+    use crate::parse::discouraged::Speculative as _;
+    use crate::parse::{Parse, ParseStream};
+    use crate::path::Path;
+    use crate::restriction::{VisRestricted, Visibility};
+    use crate::token;
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Visibility {
+        fn parse(input: ParseStream) -> Result<Self> {
+            // Recognize an empty None-delimited group, as produced by a $:vis
+            // matcher that matched no tokens.
+            if input.peek(token::Group) {
+                let ahead = input.fork();
+                let group = crate::group::parse_group(&ahead)?;
+                if group.content.is_empty() {
+                    input.advance_to(&ahead);
+                    return Ok(Visibility::Inherited);
+                }
+            }
+
+            if input.peek(Token![pub]) {
+                Self::parse_pub(input)
+            } else {
+                Ok(Visibility::Inherited)
+            }
+        }
+    }
+
+    impl Visibility {
+        fn parse_pub(input: ParseStream) -> Result<Self> {
+            let pub_token = input.parse::<Token![pub]>()?;
+
+            if input.peek(token::Paren) {
+                let ahead = input.fork();
+
+                let content;
+                let paren_token = parenthesized!(content in ahead);
+                if content.peek(Token![crate])
+                    || content.peek(Token![self])
+                    || content.peek(Token![super])
+                {
+                    let path = content.call(Ident::parse_any)?;
+
+                    // Ensure there are no additional tokens within `content`.
+                    // Without explicitly checking, we may misinterpret a tuple
+                    // field as a restricted visibility, causing a parse error.
+                    // e.g. `pub (crate::A, crate::B)` (Issue #720).
+                    if content.is_empty() {
+                        input.advance_to(&ahead);
+                        return Ok(Visibility::Restricted(VisRestricted {
+                            pub_token,
+                            paren_token,
+                            in_token: None,
+                            path: Box::new(Path::from(path)),
+                        }));
+                    }
+                } else if content.peek(Token![in]) {
+                    let in_token: Token![in] = content.parse()?;
+                    let path = content.call(Path::parse_mod_style)?;
+
+                    input.advance_to(&ahead);
+                    return Ok(Visibility::Restricted(VisRestricted {
+                        pub_token,
+                        paren_token,
+                        in_token: Some(in_token),
+                        path: Box::new(path),
+                    }));
+                }
+            }
+
+            Ok(Visibility::Public(pub_token))
+        }
+
+        #[cfg(feature = "full")]
+        pub(crate) fn is_some(&self) -> bool {
+            match self {
+                Visibility::Inherited => false,
+                _ => true,
+            }
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::restriction::{VisRestricted, Visibility};
+    use proc_macro2::TokenStream;
+    use quote::ToTokens;
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for Visibility {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                Visibility::Public(pub_token) => pub_token.to_tokens(tokens),
+                Visibility::Restricted(vis_restricted) => vis_restricted.to_tokens(tokens),
+                Visibility::Inherited => {}
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for VisRestricted {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.pub_token.to_tokens(tokens);
+            self.paren_token.surround(tokens, |tokens| {
+                // TODO: If we have a path which is not "self" or "super" or
+                // "crate", automatically add the "in" token.
+                self.in_token.to_tokens(tokens);
+                self.path.to_tokens(tokens);
+            });
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/sealed.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/sealed.rs
--- 43.0.0-1/rust-vendor/syn/src/sealed.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/sealed.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,4 @@
+#[cfg(feature = "parsing")]
+pub(crate) mod lookahead {
+    pub trait Sealed: Copy {}
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/span.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/span.rs
--- 43.0.0-1/rust-vendor/syn/src/span.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/span.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,63 @@
+use proc_macro2::extra::DelimSpan;
+use proc_macro2::{Delimiter, Group, Span, TokenStream};
+
+#[doc(hidden)]
+pub trait IntoSpans<S> {
+    fn into_spans(self) -> S;
+}
+
+impl IntoSpans<Span> for Span {
+    fn into_spans(self) -> Span {
+        self
+    }
+}
+
+impl IntoSpans<[Span; 1]> for Span {
+    fn into_spans(self) -> [Span; 1] {
+        [self]
+    }
+}
+
+impl IntoSpans<[Span; 2]> for Span {
+    fn into_spans(self) -> [Span; 2] {
+        [self, self]
+    }
+}
+
+impl IntoSpans<[Span; 3]> for Span {
+    fn into_spans(self) -> [Span; 3] {
+        [self, self, self]
+    }
+}
+
+impl IntoSpans<[Span; 1]> for [Span; 1] {
+    fn into_spans(self) -> [Span; 1] {
+        self
+    }
+}
+
+impl IntoSpans<[Span; 2]> for [Span; 2] {
+    fn into_spans(self) -> [Span; 2] {
+        self
+    }
+}
+
+impl IntoSpans<[Span; 3]> for [Span; 3] {
+    fn into_spans(self) -> [Span; 3] {
+        self
+    }
+}
+
+impl IntoSpans<DelimSpan> for Span {
+    fn into_spans(self) -> DelimSpan {
+        let mut group = Group::new(Delimiter::None, TokenStream::new());
+        group.set_span(self);
+        group.delim_span()
+    }
+}
+
+impl IntoSpans<DelimSpan> for DelimSpan {
+    fn into_spans(self) -> DelimSpan {
+        self
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/spanned.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/spanned.rs
--- 43.0.0-1/rust-vendor/syn/src/spanned.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/spanned.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,118 @@
+//! A trait that can provide the `Span` of the complete contents of a syntax
+//! tree node.
+//!
+//! <br>
+//!
+//! # Example
+//!
+//! Suppose in a procedural macro we have a [`Type`] that we want to assert
+//! implements the [`Sync`] trait. Maybe this is the type of one of the fields
+//! of a struct for which we are deriving a trait implementation, and we need to
+//! be able to pass a reference to one of those fields across threads.
+//!
+//! [`Type`]: crate::Type
+//! [`Sync`]: std::marker::Sync
+//!
+//! If the field type does *not* implement `Sync` as required, we want the
+//! compiler to report an error pointing out exactly which type it was.
+//!
+//! The following macro code takes a variable `ty` of type `Type` and produces a
+//! static assertion that `Sync` is implemented for that type.
+//!
+//! ```
+//! # extern crate proc_macro;
+//! #
+//! use proc_macro::TokenStream;
+//! use proc_macro2::Span;
+//! use quote::quote_spanned;
+//! use syn::Type;
+//! use syn::spanned::Spanned;
+//!
+//! # const IGNORE_TOKENS: &str = stringify! {
+//! #[proc_macro_derive(MyMacro)]
+//! # };
+//! pub fn my_macro(input: TokenStream) -> TokenStream {
+//!     # let ty = get_a_type();
+//!     /* ... */
+//!
+//!     let assert_sync = quote_spanned! {ty.span()=>
+//!         struct _AssertSync where #ty: Sync;
+//!     };
+//!
+//!     /* ... */
+//!     # input
+//! }
+//! #
+//! # fn get_a_type() -> Type {
+//! #     unimplemented!()
+//! # }
+//! ```
+//!
+//! By inserting this `assert_sync` fragment into the output code generated by
+//! our macro, the user's code will fail to compile if `ty` does not implement
+//! `Sync`. The errors they would see look like the following.
+//!
+//! ```text
+//! error[E0277]: the trait bound `*const i32: std::marker::Sync` is not satisfied
+//!   --> src/main.rs:10:21
+//!    |
+//! 10 |     bad_field: *const i32,
+//!    |                ^^^^^^^^^^ `*const i32` cannot be shared between threads safely
+//! ```
+//!
+//! In this technique, using the `Type`'s span for the error message makes the
+//! error appear in the correct place underlining the right type.
+//!
+//! <br>
+//!
+//! # Limitations
+//!
+//! The underlying [`proc_macro::Span::join`] method is nightly-only. When
+//! called from within a procedural macro in a nightly compiler, `Spanned` will
+//! use `join` to produce the intended span. When not using a nightly compiler,
+//! only the span of the *first token* of the syntax tree node is returned.
+//!
+//! In the common case of wanting to use the joined span as the span of a
+//! `syn::Error`, consider instead using [`syn::Error::new_spanned`] which is
+//! able to span the error correctly under the complete syntax tree node without
+//! needing the unstable `join`.
+//!
+//! [`syn::Error::new_spanned`]: crate::Error::new_spanned
+
+use proc_macro2::Span;
+use quote::spanned::Spanned as ToTokens;
+
+/// A trait that can provide the `Span` of the complete contents of a syntax
+/// tree node.
+///
+/// This trait is automatically implemented for all types that implement
+/// [`ToTokens`] from the `quote` crate, as well as for `Span` itself.
+///
+/// [`ToTokens`]: quote::ToTokens
+///
+/// See the [module documentation] for an example.
+///
+/// [module documentation]: self
+pub trait Spanned: private::Sealed {
+    /// Returns a `Span` covering the complete contents of this syntax tree
+    /// node, or [`Span::call_site()`] if this node is empty.
+    ///
+    /// [`Span::call_site()`]: proc_macro2::Span::call_site
+    fn span(&self) -> Span;
+}
+
+impl<T: ?Sized + ToTokens> Spanned for T {
+    fn span(&self) -> Span {
+        self.__span()
+    }
+}
+
+mod private {
+    use crate::spanned::ToTokens;
+
+    pub trait Sealed {}
+    impl<T: ?Sized + ToTokens> Sealed for T {}
+
+    #[cfg(any(feature = "full", feature = "derive"))]
+    impl Sealed for crate::QSelf {}
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/stmt.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/stmt.rs
--- 43.0.0-1/rust-vendor/syn/src/stmt.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/stmt.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,481 @@
+use crate::attr::Attribute;
+use crate::expr::Expr;
+use crate::item::Item;
+use crate::mac::Macro;
+use crate::pat::Pat;
+use crate::token;
+
+ast_struct! {
+    /// A braced block containing Rust statements.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct Block {
+        pub brace_token: token::Brace,
+        /// Statements in a block
+        pub stmts: Vec<Stmt>,
+    }
+}
+
+ast_enum! {
+    /// A statement, usually ending in a semicolon.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub enum Stmt {
+        /// A local (let) binding.
+        Local(Local),
+
+        /// An item definition.
+        Item(Item),
+
+        /// Expression, with or without trailing semicolon.
+        Expr(Expr, Option<Token![;]>),
+
+        /// A macro invocation in statement position.
+        ///
+        /// Syntactically it's ambiguous which other kind of statement this
+        /// macro would expand to. It can be any of local variable (`let`),
+        /// item, or expression.
+        Macro(StmtMacro),
+    }
+}
+
+ast_struct! {
+    /// A local `let` binding: `let x: u64 = s.parse()?`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct Local {
+        pub attrs: Vec<Attribute>,
+        pub let_token: Token![let],
+        pub pat: Pat,
+        pub init: Option<LocalInit>,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// The expression assigned in a local `let` binding, including optional
+    /// diverging `else` block.
+    ///
+    /// `LocalInit` represents `= s.parse()?` in `let x: u64 = s.parse()?` and
+    /// `= r else { return }` in `let Ok(x) = r else { return }`.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct LocalInit {
+        pub eq_token: Token![=],
+        pub expr: Box<Expr>,
+        pub diverge: Option<(Token![else], Box<Expr>)>,
+    }
+}
+
+ast_struct! {
+    /// A macro invocation in statement position.
+    ///
+    /// Syntactically it's ambiguous which other kind of statement this macro
+    /// would expand to. It can be any of local variable (`let`), item, or
+    /// expression.
+    #[cfg_attr(docsrs, doc(cfg(feature = "full")))]
+    pub struct StmtMacro {
+        pub attrs: Vec<Attribute>,
+        pub mac: Macro,
+        pub semi_token: Option<Token![;]>,
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::attr::Attribute;
+    use crate::classify;
+    use crate::error::Result;
+    use crate::expr::{Expr, ExprBlock, ExprMacro};
+    use crate::ident::Ident;
+    use crate::item;
+    use crate::mac::{self, Macro};
+    use crate::parse::discouraged::Speculative as _;
+    use crate::parse::{Parse, ParseStream};
+    use crate::pat::{Pat, PatType};
+    use crate::path::Path;
+    use crate::stmt::{Block, Local, LocalInit, Stmt, StmtMacro};
+    use crate::token;
+    use crate::ty::Type;
+    use proc_macro2::TokenStream;
+
+    struct AllowNoSemi(bool);
+
+    impl Block {
+        /// Parse the body of a block as zero or more statements, possibly
+        /// including one trailing expression.
+        ///
+        /// # Example
+        ///
+        /// ```
+        /// use syn::{braced, token, Attribute, Block, Ident, Result, Stmt, Token};
+        /// use syn::parse::{Parse, ParseStream};
+        ///
+        /// // Parse a function with no generics or parameter list.
+        /// //
+        /// //     fn playground {
+        /// //         let mut x = 1;
+        /// //         x += 1;
+        /// //         println!("{}", x);
+        /// //     }
+        /// struct MiniFunction {
+        ///     attrs: Vec<Attribute>,
+        ///     fn_token: Token![fn],
+        ///     name: Ident,
+        ///     brace_token: token::Brace,
+        ///     stmts: Vec<Stmt>,
+        /// }
+        ///
+        /// impl Parse for MiniFunction {
+        ///     fn parse(input: ParseStream) -> Result<Self> {
+        ///         let outer_attrs = input.call(Attribute::parse_outer)?;
+        ///         let fn_token: Token![fn] = input.parse()?;
+        ///         let name: Ident = input.parse()?;
+        ///
+        ///         let content;
+        ///         let brace_token = braced!(content in input);
+        ///         let inner_attrs = content.call(Attribute::parse_inner)?;
+        ///         let stmts = content.call(Block::parse_within)?;
+        ///
+        ///         Ok(MiniFunction {
+        ///             attrs: {
+        ///                 let mut attrs = outer_attrs;
+        ///                 attrs.extend(inner_attrs);
+        ///                 attrs
+        ///             },
+        ///             fn_token,
+        ///             name,
+        ///             brace_token,
+        ///             stmts,
+        ///         })
+        ///     }
+        /// }
+        /// ```
+        #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+        pub fn parse_within(input: ParseStream) -> Result<Vec<Stmt>> {
+            let mut stmts = Vec::new();
+            loop {
+                while let semi @ Some(_) = input.parse()? {
+                    stmts.push(Stmt::Expr(Expr::Verbatim(TokenStream::new()), semi));
+                }
+                if input.is_empty() {
+                    break;
+                }
+                let stmt = parse_stmt(input, AllowNoSemi(true))?;
+                let requires_semicolon = match &stmt {
+                    Stmt::Expr(stmt, None) => classify::requires_semi_to_be_stmt(stmt),
+                    Stmt::Macro(stmt) => {
+                        stmt.semi_token.is_none() && !stmt.mac.delimiter.is_brace()
+                    }
+                    Stmt::Local(_) | Stmt::Item(_) | Stmt::Expr(_, Some(_)) => false,
+                };
+                stmts.push(stmt);
+                if input.is_empty() {
+                    break;
+                } else if requires_semicolon {
+                    return Err(input.error("unexpected token, expected `;`"));
+                }
+            }
+            Ok(stmts)
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Block {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            Ok(Block {
+                brace_token: braced!(content in input),
+                stmts: content.call(Block::parse_within)?,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Stmt {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_nosemi = AllowNoSemi(false);
+            parse_stmt(input, allow_nosemi)
+        }
+    }
+
+    fn parse_stmt(input: ParseStream, allow_nosemi: AllowNoSemi) -> Result<Stmt> {
+        let begin = input.fork();
+        let attrs = input.call(Attribute::parse_outer)?;
+
+        // brace-style macros; paren and bracket macros get parsed as
+        // expression statements.
+        let ahead = input.fork();
+        let mut is_item_macro = false;
+        if let Ok(path) = ahead.call(Path::parse_mod_style) {
+            if ahead.peek(Token![!]) {
+                if ahead.peek2(Ident) || ahead.peek2(Token![try]) {
+                    is_item_macro = true;
+                } else if ahead.peek2(token::Brace)
+                    && !(ahead.peek3(Token![.]) || ahead.peek3(Token![?]))
+                {
+                    input.advance_to(&ahead);
+                    return stmt_mac(input, attrs, path).map(Stmt::Macro);
+                }
+            }
+        }
+
+        if input.peek(Token![let]) && !input.peek(token::Group) {
+            stmt_local(input, attrs).map(Stmt::Local)
+        } else if input.peek(Token![pub])
+            || input.peek(Token![crate]) && !input.peek2(Token![::])
+            || input.peek(Token![extern])
+            || input.peek(Token![use])
+            || input.peek(Token![static])
+                && (input.peek2(Token![mut])
+                    || input.peek2(Ident)
+                        && !(input.peek2(Token![async])
+                            && (input.peek3(Token![move]) || input.peek3(Token![|]))))
+            || input.peek(Token![const])
+                && !(input.peek2(token::Brace)
+                    || input.peek2(Token![static])
+                    || input.peek2(Token![async])
+                        && !(input.peek3(Token![unsafe])
+                            || input.peek3(Token![extern])
+                            || input.peek3(Token![fn]))
+                    || input.peek2(Token![move])
+                    || input.peek2(Token![|]))
+            || input.peek(Token![unsafe]) && !input.peek2(token::Brace)
+            || input.peek(Token![async])
+                && (input.peek2(Token![unsafe])
+                    || input.peek2(Token![extern])
+                    || input.peek2(Token![fn]))
+            || input.peek(Token![fn])
+            || input.peek(Token![mod])
+            || input.peek(Token![type])
+            || input.peek(Token![struct])
+            || input.peek(Token![enum])
+            || input.peek(Token![union]) && input.peek2(Ident)
+            || input.peek(Token![auto]) && input.peek2(Token![trait])
+            || input.peek(Token![trait])
+            || input.peek(Token![default])
+                && (input.peek2(Token![unsafe]) || input.peek2(Token![impl]))
+            || input.peek(Token![impl])
+            || input.peek(Token![macro])
+            || is_item_macro
+        {
+            let item = item::parsing::parse_rest_of_item(begin, attrs, input)?;
+            Ok(Stmt::Item(item))
+        } else {
+            stmt_expr(input, allow_nosemi, attrs)
+        }
+    }
+
+    fn stmt_mac(input: ParseStream, attrs: Vec<Attribute>, path: Path) -> Result<StmtMacro> {
+        let bang_token: Token![!] = input.parse()?;
+        let (delimiter, tokens) = mac::parse_delimiter(input)?;
+        let semi_token: Option<Token![;]> = input.parse()?;
+
+        Ok(StmtMacro {
+            attrs,
+            mac: Macro {
+                path,
+                bang_token,
+                delimiter,
+                tokens,
+            },
+            semi_token,
+        })
+    }
+
+    fn stmt_local(input: ParseStream, attrs: Vec<Attribute>) -> Result<Local> {
+        let let_token: Token![let] = input.parse()?;
+
+        let mut pat = Pat::parse_single(input)?;
+        if input.peek(Token![:]) {
+            let colon_token: Token![:] = input.parse()?;
+            let ty: Type = input.parse()?;
+            pat = Pat::Type(PatType {
+                attrs: Vec::new(),
+                pat: Box::new(pat),
+                colon_token,
+                ty: Box::new(ty),
+            });
+        }
+
+        let init = if let Some(eq_token) = input.parse()? {
+            let eq_token: Token![=] = eq_token;
+            let expr: Expr = input.parse()?;
+
+            let diverge = if !classify::expr_trailing_brace(&expr) && input.peek(Token![else]) {
+                let else_token: Token![else] = input.parse()?;
+                let diverge = ExprBlock {
+                    attrs: Vec::new(),
+                    label: None,
+                    block: input.parse()?,
+                };
+                Some((else_token, Box::new(Expr::Block(diverge))))
+            } else {
+                None
+            };
+
+            Some(LocalInit {
+                eq_token,
+                expr: Box::new(expr),
+                diverge,
+            })
+        } else {
+            None
+        };
+
+        let semi_token: Token![;] = input.parse()?;
+
+        Ok(Local {
+            attrs,
+            let_token,
+            pat,
+            init,
+            semi_token,
+        })
+    }
+
+    fn stmt_expr(
+        input: ParseStream,
+        allow_nosemi: AllowNoSemi,
+        mut attrs: Vec<Attribute>,
+    ) -> Result<Stmt> {
+        let mut e = Expr::parse_with_earlier_boundary_rule(input)?;
+
+        let mut attr_target = &mut e;
+        loop {
+            attr_target = match attr_target {
+                Expr::Assign(e) => &mut e.left,
+                Expr::Binary(e) => &mut e.left,
+                Expr::Cast(e) => &mut e.expr,
+                Expr::Array(_)
+                | Expr::Async(_)
+                | Expr::Await(_)
+                | Expr::Block(_)
+                | Expr::Break(_)
+                | Expr::Call(_)
+                | Expr::Closure(_)
+                | Expr::Const(_)
+                | Expr::Continue(_)
+                | Expr::Field(_)
+                | Expr::ForLoop(_)
+                | Expr::Group(_)
+                | Expr::If(_)
+                | Expr::Index(_)
+                | Expr::Infer(_)
+                | Expr::Let(_)
+                | Expr::Lit(_)
+                | Expr::Loop(_)
+                | Expr::Macro(_)
+                | Expr::Match(_)
+                | Expr::MethodCall(_)
+                | Expr::Paren(_)
+                | Expr::Path(_)
+                | Expr::Range(_)
+                | Expr::Reference(_)
+                | Expr::Repeat(_)
+                | Expr::Return(_)
+                | Expr::Struct(_)
+                | Expr::Try(_)
+                | Expr::TryBlock(_)
+                | Expr::Tuple(_)
+                | Expr::Unary(_)
+                | Expr::Unsafe(_)
+                | Expr::While(_)
+                | Expr::Yield(_)
+                | Expr::Verbatim(_) => break,
+            };
+        }
+        attrs.extend(attr_target.replace_attrs(Vec::new()));
+        attr_target.replace_attrs(attrs);
+
+        let semi_token: Option<Token![;]> = input.parse()?;
+
+        match e {
+            Expr::Macro(ExprMacro { attrs, mac })
+                if semi_token.is_some() || mac.delimiter.is_brace() =>
+            {
+                return Ok(Stmt::Macro(StmtMacro {
+                    attrs,
+                    mac,
+                    semi_token,
+                }));
+            }
+            _ => {}
+        }
+
+        if semi_token.is_some() {
+            Ok(Stmt::Expr(e, semi_token))
+        } else if allow_nosemi.0 || !classify::requires_semi_to_be_stmt(&e) {
+            Ok(Stmt::Expr(e, None))
+        } else {
+            Err(input.error("expected semicolon"))
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+pub(crate) mod printing {
+    use crate::classify;
+    use crate::expr::{self, Expr};
+    use crate::fixup::FixupContext;
+    use crate::stmt::{Block, Local, Stmt, StmtMacro};
+    use crate::token;
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for Block {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.brace_token.surround(tokens, |tokens| {
+                tokens.append_all(&self.stmts);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for Stmt {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                Stmt::Local(local) => local.to_tokens(tokens),
+                Stmt::Item(item) => item.to_tokens(tokens),
+                Stmt::Expr(expr, semi) => {
+                    expr::printing::print_expr(expr, tokens, FixupContext::new_stmt());
+                    semi.to_tokens(tokens);
+                }
+                Stmt::Macro(mac) => mac.to_tokens(tokens),
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for Local {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            expr::printing::outer_attrs_to_tokens(&self.attrs, tokens);
+            self.let_token.to_tokens(tokens);
+            self.pat.to_tokens(tokens);
+            if let Some(init) = &self.init {
+                init.eq_token.to_tokens(tokens);
+                if init.diverge.is_some() && classify::expr_trailing_brace(&init.expr) {
+                    token::Paren::default().surround(tokens, |tokens| init.expr.to_tokens(tokens));
+                } else {
+                    init.expr.to_tokens(tokens);
+                }
+                if let Some((else_token, diverge)) = &init.diverge {
+                    else_token.to_tokens(tokens);
+                    match &**diverge {
+                        Expr::Block(diverge) => diverge.to_tokens(tokens),
+                        _ => token::Brace::default().surround(tokens, |tokens| {
+                            expr::printing::print_expr(diverge, tokens, FixupContext::new_stmt());
+                        }),
+                    }
+                }
+            }
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for StmtMacro {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            expr::printing::outer_attrs_to_tokens(&self.attrs, tokens);
+            self.mac.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/thread.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/thread.rs
--- 43.0.0-1/rust-vendor/syn/src/thread.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/thread.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,60 @@
+use std::fmt::{self, Debug};
+use std::thread::{self, ThreadId};
+
+/// ThreadBound is a Sync-maker and Send-maker that allows accessing a value
+/// of type T only from the original thread on which the ThreadBound was
+/// constructed.
+pub(crate) struct ThreadBound<T> {
+    value: T,
+    thread_id: ThreadId,
+}
+
+unsafe impl<T> Sync for ThreadBound<T> {}
+
+// Send bound requires Copy, as otherwise Drop could run in the wrong place.
+//
+// Today Copy and Drop are mutually exclusive so `T: Copy` implies `T: !Drop`.
+// This impl needs to be revisited if that restriction is relaxed in the future.
+unsafe impl<T: Copy> Send for ThreadBound<T> {}
+
+impl<T> ThreadBound<T> {
+    pub(crate) fn new(value: T) -> Self {
+        ThreadBound {
+            value,
+            thread_id: thread::current().id(),
+        }
+    }
+
+    pub(crate) fn get(&self) -> Option<&T> {
+        if thread::current().id() == self.thread_id {
+            Some(&self.value)
+        } else {
+            None
+        }
+    }
+}
+
+impl<T: Debug> Debug for ThreadBound<T> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match self.get() {
+            Some(value) => Debug::fmt(value, formatter),
+            None => formatter.write_str("unknown"),
+        }
+    }
+}
+
+// Copy the bytes of T, even if the currently running thread is the "wrong"
+// thread. This is fine as long as the original thread is not simultaneously
+// mutating this value via interior mutability, which would be a data race.
+//
+// Currently `T: Copy` is sufficient to guarantee that T contains no interior
+// mutability, because _all_ interior mutability in Rust is built on
+// std::cell::UnsafeCell, which has no Copy impl. This impl needs to be
+// revisited if that restriction is relaxed in the future.
+impl<T: Copy> Copy for ThreadBound<T> {}
+
+impl<T: Copy> Clone for ThreadBound<T> {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/token.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/token.rs
--- 43.0.0-1/rust-vendor/syn/src/token.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/token.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1092 @@
+//! Tokens representing Rust punctuation, keywords, and delimiters.
+//!
+//! The type names in this module can be difficult to keep straight, so we
+//! prefer to use the [`Token!`] macro instead. This is a type-macro that
+//! expands to the token type of the given token.
+//!
+//! [`Token!`]: crate::Token
+//!
+//! # Example
+//!
+//! The [`ItemStatic`] syntax tree node is defined like this.
+//!
+//! [`ItemStatic`]: crate::ItemStatic
+//!
+//! ```
+//! # use syn::{Attribute, Expr, Ident, Token, Type, Visibility};
+//! #
+//! pub struct ItemStatic {
+//!     pub attrs: Vec<Attribute>,
+//!     pub vis: Visibility,
+//!     pub static_token: Token![static],
+//!     pub mutability: Option<Token![mut]>,
+//!     pub ident: Ident,
+//!     pub colon_token: Token![:],
+//!     pub ty: Box<Type>,
+//!     pub eq_token: Token![=],
+//!     pub expr: Box<Expr>,
+//!     pub semi_token: Token![;],
+//! }
+//! ```
+//!
+//! # Parsing
+//!
+//! Keywords and punctuation can be parsed through the [`ParseStream::parse`]
+//! method. Delimiter tokens are parsed using the [`parenthesized!`],
+//! [`bracketed!`] and [`braced!`] macros.
+//!
+//! [`ParseStream::parse`]: crate::parse::ParseBuffer::parse()
+//! [`parenthesized!`]: crate::parenthesized!
+//! [`bracketed!`]: crate::bracketed!
+//! [`braced!`]: crate::braced!
+//!
+//! ```
+//! use syn::{Attribute, Result};
+//! use syn::parse::{Parse, ParseStream};
+//! #
+//! # enum ItemStatic {}
+//!
+//! // Parse the ItemStatic struct shown above.
+//! impl Parse for ItemStatic {
+//!     fn parse(input: ParseStream) -> Result<Self> {
+//!         # use syn::ItemStatic;
+//!         # fn parse(input: ParseStream) -> Result<ItemStatic> {
+//!         Ok(ItemStatic {
+//!             attrs: input.call(Attribute::parse_outer)?,
+//!             vis: input.parse()?,
+//!             static_token: input.parse()?,
+//!             mutability: input.parse()?,
+//!             ident: input.parse()?,
+//!             colon_token: input.parse()?,
+//!             ty: input.parse()?,
+//!             eq_token: input.parse()?,
+//!             expr: input.parse()?,
+//!             semi_token: input.parse()?,
+//!         })
+//!         # }
+//!         # unimplemented!()
+//!     }
+//! }
+//! ```
+//!
+//! # Other operations
+//!
+//! Every keyword and punctuation token supports the following operations.
+//!
+//! - [Peeking] — `input.peek(Token![...])`
+//!
+//! - [Parsing] — `input.parse::<Token![...]>()?`
+//!
+//! - [Printing] — `quote!( ... #the_token ... )`
+//!
+//! - Construction from a [`Span`] — `let the_token = Token![...](sp)`
+//!
+//! - Field access to its span — `let sp = the_token.span`
+//!
+//! [Peeking]: crate::parse::ParseBuffer::peek()
+//! [Parsing]: crate::parse::ParseBuffer::parse()
+//! [Printing]: https://docs.rs/quote/1.0/quote/trait.ToTokens.html
+//! [`Span`]: https://docs.rs/proc-macro2/1.0/proc_macro2/struct.Span.html
+
+#[cfg(feature = "parsing")]
+pub(crate) use self::private::CustomToken;
+use self::private::WithSpan;
+#[cfg(feature = "parsing")]
+use crate::buffer::Cursor;
+#[cfg(feature = "parsing")]
+use crate::error::Result;
+#[cfg(feature = "parsing")]
+use crate::lifetime::Lifetime;
+#[cfg(feature = "parsing")]
+use crate::parse::{Parse, ParseStream};
+use crate::span::IntoSpans;
+use proc_macro2::extra::DelimSpan;
+use proc_macro2::Span;
+#[cfg(feature = "printing")]
+use proc_macro2::TokenStream;
+#[cfg(any(feature = "parsing", feature = "printing"))]
+use proc_macro2::{Delimiter, Ident};
+#[cfg(feature = "parsing")]
+use proc_macro2::{Literal, Punct, TokenTree};
+#[cfg(feature = "printing")]
+use quote::{ToTokens, TokenStreamExt};
+#[cfg(feature = "extra-traits")]
+use std::cmp;
+#[cfg(feature = "extra-traits")]
+use std::fmt::{self, Debug};
+#[cfg(feature = "extra-traits")]
+use std::hash::{Hash, Hasher};
+use std::ops::{Deref, DerefMut};
+
+/// Marker trait for types that represent single tokens.
+///
+/// This trait is sealed and cannot be implemented for types outside of Syn.
+#[cfg(feature = "parsing")]
+pub trait Token: private::Sealed {
+    // Not public API.
+    #[doc(hidden)]
+    fn peek(cursor: Cursor) -> bool;
+
+    // Not public API.
+    #[doc(hidden)]
+    fn display() -> &'static str;
+}
+
+pub(crate) mod private {
+    #[cfg(feature = "parsing")]
+    use crate::buffer::Cursor;
+    use proc_macro2::Span;
+
+    #[cfg(feature = "parsing")]
+    pub trait Sealed {}
+
+    /// Support writing `token.span` rather than `token.spans[0]` on tokens that
+    /// hold a single span.
+    #[repr(transparent)]
+    #[allow(unknown_lints, repr_transparent_external_private_fields)] // False positive: https://github.com/rust-lang/rust/issues/78586#issuecomment-1722680482
+    pub struct WithSpan {
+        pub span: Span,
+    }
+
+    // Not public API.
+    #[doc(hidden)]
+    #[cfg(feature = "parsing")]
+    pub trait CustomToken {
+        fn peek(cursor: Cursor) -> bool;
+        fn display() -> &'static str;
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl private::Sealed for Ident {}
+
+macro_rules! impl_low_level_token {
+    ($display:literal $($path:ident)::+ $get:ident) => {
+        #[cfg(feature = "parsing")]
+        impl Token for $($path)::+ {
+            fn peek(cursor: Cursor) -> bool {
+                cursor.$get().is_some()
+            }
+
+            fn display() -> &'static str {
+                $display
+            }
+        }
+
+        #[cfg(feature = "parsing")]
+        impl private::Sealed for $($path)::+ {}
+    };
+}
+
+impl_low_level_token!("punctuation token" Punct punct);
+impl_low_level_token!("literal" Literal literal);
+impl_low_level_token!("token" TokenTree token_tree);
+impl_low_level_token!("group token" proc_macro2::Group any_group);
+impl_low_level_token!("lifetime" Lifetime lifetime);
+
+#[cfg(feature = "parsing")]
+impl<T: CustomToken> private::Sealed for T {}
+
+#[cfg(feature = "parsing")]
+impl<T: CustomToken> Token for T {
+    fn peek(cursor: Cursor) -> bool {
+        <Self as CustomToken>::peek(cursor)
+    }
+
+    fn display() -> &'static str {
+        <Self as CustomToken>::display()
+    }
+}
+
+macro_rules! define_keywords {
+    ($($token:literal pub struct $name:ident)*) => {
+        $(
+            #[doc = concat!('`', $token, '`')]
+            ///
+            /// Don't try to remember the name of this type &mdash; use the
+            /// [`Token!`] macro instead.
+            ///
+            /// [`Token!`]: crate::token
+            pub struct $name {
+                pub span: Span,
+            }
+
+            #[doc(hidden)]
+            #[allow(non_snake_case)]
+            pub fn $name<S: IntoSpans<Span>>(span: S) -> $name {
+                $name {
+                    span: span.into_spans(),
+                }
+            }
+
+            impl std::default::Default for $name {
+                fn default() -> Self {
+                    $name {
+                        span: Span::call_site(),
+                    }
+                }
+            }
+
+            #[cfg(feature = "clone-impls")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+            impl Copy for $name {}
+
+            #[cfg(feature = "clone-impls")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+            impl Clone for $name {
+                fn clone(&self) -> Self {
+                    *self
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+            impl Debug for $name {
+                fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+                    f.write_str(stringify!($name))
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+            impl cmp::Eq for $name {}
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+            impl PartialEq for $name {
+                fn eq(&self, _other: &$name) -> bool {
+                    true
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+            impl Hash for $name {
+                fn hash<H: Hasher>(&self, _state: &mut H) {}
+            }
+
+            #[cfg(feature = "printing")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+            impl ToTokens for $name {
+                fn to_tokens(&self, tokens: &mut TokenStream) {
+                    printing::keyword($token, self.span, tokens);
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+            impl Parse for $name {
+                fn parse(input: ParseStream) -> Result<Self> {
+                    Ok($name {
+                        span: parsing::keyword(input, $token)?,
+                    })
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            impl Token for $name {
+                fn peek(cursor: Cursor) -> bool {
+                    parsing::peek_keyword(cursor, $token)
+                }
+
+                fn display() -> &'static str {
+                    concat!("`", $token, "`")
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            impl private::Sealed for $name {}
+        )*
+    };
+}
+
+macro_rules! impl_deref_if_len_is_1 {
+    ($name:ident/1) => {
+        impl Deref for $name {
+            type Target = WithSpan;
+
+            fn deref(&self) -> &Self::Target {
+                unsafe { &*(self as *const Self).cast::<WithSpan>() }
+            }
+        }
+
+        impl DerefMut for $name {
+            fn deref_mut(&mut self) -> &mut Self::Target {
+                unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
+            }
+        }
+    };
+
+    ($name:ident/$len:literal) => {};
+}
+
+macro_rules! define_punctuation_structs {
+    ($($token:literal pub struct $name:ident/$len:tt #[doc = $usage:literal])*) => {
+        $(
+            #[cfg_attr(not(doc), repr(transparent))]
+            #[allow(unknown_lints, repr_transparent_external_private_fields)] // False positive: https://github.com/rust-lang/rust/issues/78586#issuecomment-1722680482
+            #[doc = concat!('`', $token, '`')]
+            ///
+            /// Usage:
+            #[doc = concat!($usage, '.')]
+            ///
+            /// Don't try to remember the name of this type &mdash; use the
+            /// [`Token!`] macro instead.
+            ///
+            /// [`Token!`]: crate::token
+            pub struct $name {
+                pub spans: [Span; $len],
+            }
+
+            #[doc(hidden)]
+            #[allow(non_snake_case)]
+            pub fn $name<S: IntoSpans<[Span; $len]>>(spans: S) -> $name {
+                $name {
+                    spans: spans.into_spans(),
+                }
+            }
+
+            impl std::default::Default for $name {
+                fn default() -> Self {
+                    $name {
+                        spans: [Span::call_site(); $len],
+                    }
+                }
+            }
+
+            #[cfg(feature = "clone-impls")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+            impl Copy for $name {}
+
+            #[cfg(feature = "clone-impls")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+            impl Clone for $name {
+                fn clone(&self) -> Self {
+                    *self
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+            impl Debug for $name {
+                fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+                    f.write_str(stringify!($name))
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+            impl cmp::Eq for $name {}
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+            impl PartialEq for $name {
+                fn eq(&self, _other: &$name) -> bool {
+                    true
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+            impl Hash for $name {
+                fn hash<H: Hasher>(&self, _state: &mut H) {}
+            }
+
+            impl_deref_if_len_is_1!($name/$len);
+        )*
+    };
+}
+
+macro_rules! define_punctuation {
+    ($($token:literal pub struct $name:ident/$len:tt #[doc = $usage:literal])*) => {
+        $(
+            define_punctuation_structs! {
+                $token pub struct $name/$len #[doc = $usage]
+            }
+
+            #[cfg(feature = "printing")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+            impl ToTokens for $name {
+                fn to_tokens(&self, tokens: &mut TokenStream) {
+                    printing::punct($token, &self.spans, tokens);
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+            impl Parse for $name {
+                fn parse(input: ParseStream) -> Result<Self> {
+                    Ok($name {
+                        spans: parsing::punct(input, $token)?,
+                    })
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            impl Token for $name {
+                fn peek(cursor: Cursor) -> bool {
+                    parsing::peek_punct(cursor, $token)
+                }
+
+                fn display() -> &'static str {
+                    concat!("`", $token, "`")
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            impl private::Sealed for $name {}
+        )*
+    };
+}
+
+macro_rules! define_delimiters {
+    ($($delim:ident pub struct $name:ident #[$doc:meta])*) => {
+        $(
+            #[$doc]
+            pub struct $name {
+                pub span: DelimSpan,
+            }
+
+            #[doc(hidden)]
+            #[allow(non_snake_case)]
+            pub fn $name<S: IntoSpans<DelimSpan>>(span: S) -> $name {
+                $name {
+                    span: span.into_spans(),
+                }
+            }
+
+            impl std::default::Default for $name {
+                fn default() -> Self {
+                    $name(Span::call_site())
+                }
+            }
+
+            #[cfg(feature = "clone-impls")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+            impl Copy for $name {}
+
+            #[cfg(feature = "clone-impls")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+            impl Clone for $name {
+                fn clone(&self) -> Self {
+                    *self
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+            impl Debug for $name {
+                fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+                    f.write_str(stringify!($name))
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+            impl cmp::Eq for $name {}
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+            impl PartialEq for $name {
+                fn eq(&self, _other: &$name) -> bool {
+                    true
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+            impl Hash for $name {
+                fn hash<H: Hasher>(&self, _state: &mut H) {}
+            }
+
+            impl $name {
+                #[cfg(feature = "printing")]
+                pub fn surround<F>(&self, tokens: &mut TokenStream, f: F)
+                where
+                    F: FnOnce(&mut TokenStream),
+                {
+                    let mut inner = TokenStream::new();
+                    f(&mut inner);
+                    printing::delim(Delimiter::$delim, self.span.join(), tokens, inner);
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            impl private::Sealed for $name {}
+        )*
+    };
+}
+
+define_punctuation_structs! {
+    "_" pub struct Underscore/1 /// wildcard patterns, inferred types, unnamed items in constants, extern crates, use declarations, and destructuring assignment
+}
+
+#[cfg(feature = "printing")]
+#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+impl ToTokens for Underscore {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(Ident::new("_", self.span));
+    }
+}
+
+#[cfg(feature = "parsing")]
+#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+impl Parse for Underscore {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| {
+            if let Some((ident, rest)) = cursor.ident() {
+                if ident == "_" {
+                    return Ok((Underscore(ident.span()), rest));
+                }
+            }
+            if let Some((punct, rest)) = cursor.punct() {
+                if punct.as_char() == '_' {
+                    return Ok((Underscore(punct.span()), rest));
+                }
+            }
+            Err(cursor.error("expected `_`"))
+        })
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl Token for Underscore {
+    fn peek(cursor: Cursor) -> bool {
+        if let Some((ident, _rest)) = cursor.ident() {
+            return ident == "_";
+        }
+        if let Some((punct, _rest)) = cursor.punct() {
+            return punct.as_char() == '_';
+        }
+        false
+    }
+
+    fn display() -> &'static str {
+        "`_`"
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl private::Sealed for Underscore {}
+
+/// None-delimited group
+pub struct Group {
+    pub span: Span,
+}
+
+#[doc(hidden)]
+#[allow(non_snake_case)]
+pub fn Group<S: IntoSpans<Span>>(span: S) -> Group {
+    Group {
+        span: span.into_spans(),
+    }
+}
+
+impl std::default::Default for Group {
+    fn default() -> Self {
+        Group {
+            span: Span::call_site(),
+        }
+    }
+}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Copy for Group {}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
+impl Clone for Group {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Debug for Group {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str("Group")
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl cmp::Eq for Group {}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for Group {
+    fn eq(&self, _other: &Group) -> bool {
+        true
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
+impl Hash for Group {
+    fn hash<H: Hasher>(&self, _state: &mut H) {}
+}
+
+impl Group {
+    #[cfg(feature = "printing")]
+    pub fn surround<F>(&self, tokens: &mut TokenStream, f: F)
+    where
+        F: FnOnce(&mut TokenStream),
+    {
+        let mut inner = TokenStream::new();
+        f(&mut inner);
+        printing::delim(Delimiter::None, self.span, tokens, inner);
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl private::Sealed for Group {}
+
+#[cfg(feature = "parsing")]
+impl Token for Paren {
+    fn peek(cursor: Cursor) -> bool {
+        cursor.group(Delimiter::Parenthesis).is_some()
+    }
+
+    fn display() -> &'static str {
+        "parentheses"
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl Token for Brace {
+    fn peek(cursor: Cursor) -> bool {
+        cursor.group(Delimiter::Brace).is_some()
+    }
+
+    fn display() -> &'static str {
+        "curly braces"
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl Token for Bracket {
+    fn peek(cursor: Cursor) -> bool {
+        cursor.group(Delimiter::Bracket).is_some()
+    }
+
+    fn display() -> &'static str {
+        "square brackets"
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl Token for Group {
+    fn peek(cursor: Cursor) -> bool {
+        cursor.group(Delimiter::None).is_some()
+    }
+
+    fn display() -> &'static str {
+        "invisible group"
+    }
+}
+
+define_keywords! {
+    "abstract"    pub struct Abstract
+    "as"          pub struct As
+    "async"       pub struct Async
+    "auto"        pub struct Auto
+    "await"       pub struct Await
+    "become"      pub struct Become
+    "box"         pub struct Box
+    "break"       pub struct Break
+    "const"       pub struct Const
+    "continue"    pub struct Continue
+    "crate"       pub struct Crate
+    "default"     pub struct Default
+    "do"          pub struct Do
+    "dyn"         pub struct Dyn
+    "else"        pub struct Else
+    "enum"        pub struct Enum
+    "extern"      pub struct Extern
+    "final"       pub struct Final
+    "fn"          pub struct Fn
+    "for"         pub struct For
+    "if"          pub struct If
+    "impl"        pub struct Impl
+    "in"          pub struct In
+    "let"         pub struct Let
+    "loop"        pub struct Loop
+    "macro"       pub struct Macro
+    "match"       pub struct Match
+    "mod"         pub struct Mod
+    "move"        pub struct Move
+    "mut"         pub struct Mut
+    "override"    pub struct Override
+    "priv"        pub struct Priv
+    "pub"         pub struct Pub
+    "ref"         pub struct Ref
+    "return"      pub struct Return
+    "Self"        pub struct SelfType
+    "self"        pub struct SelfValue
+    "static"      pub struct Static
+    "struct"      pub struct Struct
+    "super"       pub struct Super
+    "trait"       pub struct Trait
+    "try"         pub struct Try
+    "type"        pub struct Type
+    "typeof"      pub struct Typeof
+    "union"       pub struct Union
+    "unsafe"      pub struct Unsafe
+    "unsized"     pub struct Unsized
+    "use"         pub struct Use
+    "virtual"     pub struct Virtual
+    "where"       pub struct Where
+    "while"       pub struct While
+    "yield"       pub struct Yield
+}
+
+define_punctuation! {
+    "&"           pub struct And/1        /// bitwise and logical AND, borrow, references, reference patterns
+    "&&"          pub struct AndAnd/2     /// lazy AND, borrow, references, reference patterns
+    "&="          pub struct AndEq/2      /// bitwise AND assignment
+    "@"           pub struct At/1         /// subpattern binding
+    "^"           pub struct Caret/1      /// bitwise and logical XOR
+    "^="          pub struct CaretEq/2    /// bitwise XOR assignment
+    ":"           pub struct Colon/1      /// various separators
+    ","           pub struct Comma/1      /// various separators
+    "$"           pub struct Dollar/1     /// macros
+    "."           pub struct Dot/1        /// field access, tuple index
+    ".."          pub struct DotDot/2     /// range, struct expressions, patterns, range patterns
+    "..."         pub struct DotDotDot/3  /// variadic functions, range patterns
+    "..="         pub struct DotDotEq/3   /// inclusive range, range patterns
+    "="           pub struct Eq/1         /// assignment, attributes, various type definitions
+    "=="          pub struct EqEq/2       /// equal
+    "=>"          pub struct FatArrow/2   /// match arms, macros
+    ">="          pub struct Ge/2         /// greater than or equal to, generics
+    ">"           pub struct Gt/1         /// greater than, generics, paths
+    "<-"          pub struct LArrow/2     /// unused
+    "<="          pub struct Le/2         /// less than or equal to
+    "<"           pub struct Lt/1         /// less than, generics, paths
+    "-"           pub struct Minus/1      /// subtraction, negation
+    "-="          pub struct MinusEq/2    /// subtraction assignment
+    "!="          pub struct Ne/2         /// not equal
+    "!"           pub struct Not/1        /// bitwise and logical NOT, macro calls, inner attributes, never type, negative impls
+    "|"           pub struct Or/1         /// bitwise and logical OR, closures, patterns in match, if let, and while let
+    "|="          pub struct OrEq/2       /// bitwise OR assignment
+    "||"          pub struct OrOr/2       /// lazy OR, closures
+    "::"          pub struct PathSep/2    /// path separator
+    "%"           pub struct Percent/1    /// remainder
+    "%="          pub struct PercentEq/2  /// remainder assignment
+    "+"           pub struct Plus/1       /// addition, trait bounds, macro Kleene matcher
+    "+="          pub struct PlusEq/2     /// addition assignment
+    "#"           pub struct Pound/1      /// attributes
+    "?"           pub struct Question/1   /// question mark operator, questionably sized, macro Kleene matcher
+    "->"          pub struct RArrow/2     /// function return type, closure return type, function pointer type
+    ";"           pub struct Semi/1       /// terminator for various items and statements, array types
+    "<<"          pub struct Shl/2        /// shift left, nested generics
+    "<<="         pub struct ShlEq/3      /// shift left assignment
+    ">>"          pub struct Shr/2        /// shift right, nested generics
+    ">>="         pub struct ShrEq/3      /// shift right assignment, nested generics
+    "/"           pub struct Slash/1      /// division
+    "/="          pub struct SlashEq/2    /// division assignment
+    "*"           pub struct Star/1       /// multiplication, dereference, raw pointers, macro Kleene matcher, use wildcards
+    "*="          pub struct StarEq/2     /// multiplication assignment
+    "~"           pub struct Tilde/1      /// unused since before Rust 1.0
+}
+
+define_delimiters! {
+    Brace         pub struct Brace        /// `{`&hellip;`}`
+    Bracket       pub struct Bracket      /// `[`&hellip;`]`
+    Parenthesis   pub struct Paren        /// `(`&hellip;`)`
+}
+
+/// A type-macro that expands to the name of the Rust type representation of a
+/// given token.
+///
+/// As a type, `Token!` is commonly used in the type of struct fields, the type
+/// of a `let` statement, or in turbofish for a `parse` function.
+///
+/// ```
+/// use syn::{Ident, Token};
+/// use syn::parse::{Parse, ParseStream, Result};
+///
+/// // `struct Foo;`
+/// pub struct UnitStruct {
+///     struct_token: Token![struct],
+///     ident: Ident,
+///     semi_token: Token![;],
+/// }
+///
+/// impl Parse for UnitStruct {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         let struct_token: Token![struct] = input.parse()?;
+///         let ident: Ident = input.parse()?;
+///         let semi_token = input.parse::<Token![;]>()?;
+///         Ok(UnitStruct { struct_token, ident, semi_token })
+///     }
+/// }
+/// ```
+///
+/// As an expression, `Token!` is used for peeking tokens or instantiating
+/// tokens from a span.
+///
+/// ```
+/// # use syn::{Ident, Token};
+/// # use syn::parse::{Parse, ParseStream, Result};
+/// #
+/// # struct UnitStruct {
+/// #     struct_token: Token![struct],
+/// #     ident: Ident,
+/// #     semi_token: Token![;],
+/// # }
+/// #
+/// # impl Parse for UnitStruct {
+/// #     fn parse(input: ParseStream) -> Result<Self> {
+/// #         unimplemented!()
+/// #     }
+/// # }
+/// #
+/// fn make_unit_struct(name: Ident) -> UnitStruct {
+///     let span = name.span();
+///     UnitStruct {
+///         struct_token: Token![struct](span),
+///         ident: name,
+///         semi_token: Token![;](span),
+///     }
+/// }
+///
+/// # fn parse(input: ParseStream) -> Result<()> {
+/// if input.peek(Token![struct]) {
+///     let unit_struct: UnitStruct = input.parse()?;
+///     /* ... */
+/// }
+/// # Ok(())
+/// # }
+/// ```
+///
+/// See the [token module] documentation for details and examples.
+///
+/// [token module]: crate::token
+#[macro_export]
+macro_rules! Token {
+    [abstract]    => { $crate::token::Abstract };
+    [as]          => { $crate::token::As };
+    [async]       => { $crate::token::Async };
+    [auto]        => { $crate::token::Auto };
+    [await]       => { $crate::token::Await };
+    [become]      => { $crate::token::Become };
+    [box]         => { $crate::token::Box };
+    [break]       => { $crate::token::Break };
+    [const]       => { $crate::token::Const };
+    [continue]    => { $crate::token::Continue };
+    [crate]       => { $crate::token::Crate };
+    [default]     => { $crate::token::Default };
+    [do]          => { $crate::token::Do };
+    [dyn]         => { $crate::token::Dyn };
+    [else]        => { $crate::token::Else };
+    [enum]        => { $crate::token::Enum };
+    [extern]      => { $crate::token::Extern };
+    [final]       => { $crate::token::Final };
+    [fn]          => { $crate::token::Fn };
+    [for]         => { $crate::token::For };
+    [if]          => { $crate::token::If };
+    [impl]        => { $crate::token::Impl };
+    [in]          => { $crate::token::In };
+    [let]         => { $crate::token::Let };
+    [loop]        => { $crate::token::Loop };
+    [macro]       => { $crate::token::Macro };
+    [match]       => { $crate::token::Match };
+    [mod]         => { $crate::token::Mod };
+    [move]        => { $crate::token::Move };
+    [mut]         => { $crate::token::Mut };
+    [override]    => { $crate::token::Override };
+    [priv]        => { $crate::token::Priv };
+    [pub]         => { $crate::token::Pub };
+    [ref]         => { $crate::token::Ref };
+    [return]      => { $crate::token::Return };
+    [Self]        => { $crate::token::SelfType };
+    [self]        => { $crate::token::SelfValue };
+    [static]      => { $crate::token::Static };
+    [struct]      => { $crate::token::Struct };
+    [super]       => { $crate::token::Super };
+    [trait]       => { $crate::token::Trait };
+    [try]         => { $crate::token::Try };
+    [type]        => { $crate::token::Type };
+    [typeof]      => { $crate::token::Typeof };
+    [union]       => { $crate::token::Union };
+    [unsafe]      => { $crate::token::Unsafe };
+    [unsized]     => { $crate::token::Unsized };
+    [use]         => { $crate::token::Use };
+    [virtual]     => { $crate::token::Virtual };
+    [where]       => { $crate::token::Where };
+    [while]       => { $crate::token::While };
+    [yield]       => { $crate::token::Yield };
+    [&]           => { $crate::token::And };
+    [&&]          => { $crate::token::AndAnd };
+    [&=]          => { $crate::token::AndEq };
+    [@]           => { $crate::token::At };
+    [^]           => { $crate::token::Caret };
+    [^=]          => { $crate::token::CaretEq };
+    [:]           => { $crate::token::Colon };
+    [,]           => { $crate::token::Comma };
+    [$]           => { $crate::token::Dollar };
+    [.]           => { $crate::token::Dot };
+    [..]          => { $crate::token::DotDot };
+    [...]         => { $crate::token::DotDotDot };
+    [..=]         => { $crate::token::DotDotEq };
+    [=]           => { $crate::token::Eq };
+    [==]          => { $crate::token::EqEq };
+    [=>]          => { $crate::token::FatArrow };
+    [>=]          => { $crate::token::Ge };
+    [>]           => { $crate::token::Gt };
+    [<-]          => { $crate::token::LArrow };
+    [<=]          => { $crate::token::Le };
+    [<]           => { $crate::token::Lt };
+    [-]           => { $crate::token::Minus };
+    [-=]          => { $crate::token::MinusEq };
+    [!=]          => { $crate::token::Ne };
+    [!]           => { $crate::token::Not };
+    [|]           => { $crate::token::Or };
+    [|=]          => { $crate::token::OrEq };
+    [||]          => { $crate::token::OrOr };
+    [::]          => { $crate::token::PathSep };
+    [%]           => { $crate::token::Percent };
+    [%=]          => { $crate::token::PercentEq };
+    [+]           => { $crate::token::Plus };
+    [+=]          => { $crate::token::PlusEq };
+    [#]           => { $crate::token::Pound };
+    [?]           => { $crate::token::Question };
+    [->]          => { $crate::token::RArrow };
+    [;]           => { $crate::token::Semi };
+    [<<]          => { $crate::token::Shl };
+    [<<=]         => { $crate::token::ShlEq };
+    [>>]          => { $crate::token::Shr };
+    [>>=]         => { $crate::token::ShrEq };
+    [/]           => { $crate::token::Slash };
+    [/=]          => { $crate::token::SlashEq };
+    [*]           => { $crate::token::Star };
+    [*=]          => { $crate::token::StarEq };
+    [~]           => { $crate::token::Tilde };
+    [_]           => { $crate::token::Underscore };
+}
+
+// Not public API.
+#[doc(hidden)]
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::buffer::Cursor;
+    use crate::error::{Error, Result};
+    use crate::parse::ParseStream;
+    use proc_macro2::{Spacing, Span};
+
+    pub(crate) fn keyword(input: ParseStream, token: &str) -> Result<Span> {
+        input.step(|cursor| {
+            if let Some((ident, rest)) = cursor.ident() {
+                if ident == token {
+                    return Ok((ident.span(), rest));
+                }
+            }
+            Err(cursor.error(format!("expected `{}`", token)))
+        })
+    }
+
+    pub(crate) fn peek_keyword(cursor: Cursor, token: &str) -> bool {
+        if let Some((ident, _rest)) = cursor.ident() {
+            ident == token
+        } else {
+            false
+        }
+    }
+
+    #[doc(hidden)]
+    pub fn punct<const N: usize>(input: ParseStream, token: &str) -> Result<[Span; N]> {
+        let mut spans = [input.span(); N];
+        punct_helper(input, token, &mut spans)?;
+        Ok(spans)
+    }
+
+    fn punct_helper(input: ParseStream, token: &str, spans: &mut [Span]) -> Result<()> {
+        input.step(|cursor| {
+            let mut cursor = *cursor;
+            assert_eq!(token.len(), spans.len());
+
+            for (i, ch) in token.chars().enumerate() {
+                match cursor.punct() {
+                    Some((punct, rest)) => {
+                        spans[i] = punct.span();
+                        if punct.as_char() != ch {
+                            break;
+                        } else if i == token.len() - 1 {
+                            return Ok(((), rest));
+                        } else if punct.spacing() != Spacing::Joint {
+                            break;
+                        }
+                        cursor = rest;
+                    }
+                    None => break,
+                }
+            }
+
+            Err(Error::new(spans[0], format!("expected `{}`", token)))
+        })
+    }
+
+    #[doc(hidden)]
+    pub fn peek_punct(mut cursor: Cursor, token: &str) -> bool {
+        for (i, ch) in token.chars().enumerate() {
+            match cursor.punct() {
+                Some((punct, rest)) => {
+                    if punct.as_char() != ch {
+                        break;
+                    } else if i == token.len() - 1 {
+                        return true;
+                    } else if punct.spacing() != Spacing::Joint {
+                        break;
+                    }
+                    cursor = rest;
+                }
+                None => break,
+            }
+        }
+        false
+    }
+}
+
+// Not public API.
+#[doc(hidden)]
+#[cfg(feature = "printing")]
+pub(crate) mod printing {
+    use proc_macro2::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream};
+    use quote::TokenStreamExt;
+
+    #[doc(hidden)]
+    pub fn punct(s: &str, spans: &[Span], tokens: &mut TokenStream) {
+        assert_eq!(s.len(), spans.len());
+
+        let mut chars = s.chars();
+        let mut spans = spans.iter();
+        let ch = chars.next_back().unwrap();
+        let span = spans.next_back().unwrap();
+        for (ch, span) in chars.zip(spans) {
+            let mut op = Punct::new(ch, Spacing::Joint);
+            op.set_span(*span);
+            tokens.append(op);
+        }
+
+        let mut op = Punct::new(ch, Spacing::Alone);
+        op.set_span(*span);
+        tokens.append(op);
+    }
+
+    pub(crate) fn keyword(s: &str, span: Span, tokens: &mut TokenStream) {
+        tokens.append(Ident::new(s, span));
+    }
+
+    pub(crate) fn delim(
+        delim: Delimiter,
+        span: Span,
+        tokens: &mut TokenStream,
+        inner: TokenStream,
+    ) {
+        let mut g = Group::new(delim, inner);
+        g.set_span(span);
+        tokens.append(g);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/tt.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/tt.rs
--- 43.0.0-1/rust-vendor/syn/src/tt.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/tt.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,107 @@
+use proc_macro2::{Delimiter, TokenStream, TokenTree};
+use std::hash::{Hash, Hasher};
+
+pub(crate) struct TokenTreeHelper<'a>(pub &'a TokenTree);
+
+impl<'a> PartialEq for TokenTreeHelper<'a> {
+    fn eq(&self, other: &Self) -> bool {
+        use proc_macro2::Spacing;
+
+        match (self.0, other.0) {
+            (TokenTree::Group(g1), TokenTree::Group(g2)) => {
+                match (g1.delimiter(), g2.delimiter()) {
+                    (Delimiter::Parenthesis, Delimiter::Parenthesis)
+                    | (Delimiter::Brace, Delimiter::Brace)
+                    | (Delimiter::Bracket, Delimiter::Bracket)
+                    | (Delimiter::None, Delimiter::None) => {}
+                    _ => return false,
+                }
+
+                let s1 = g1.stream().into_iter();
+                let mut s2 = g2.stream().into_iter();
+
+                for item1 in s1 {
+                    let item2 = match s2.next() {
+                        Some(item) => item,
+                        None => return false,
+                    };
+                    if TokenTreeHelper(&item1) != TokenTreeHelper(&item2) {
+                        return false;
+                    }
+                }
+                s2.next().is_none()
+            }
+            (TokenTree::Punct(o1), TokenTree::Punct(o2)) => {
+                o1.as_char() == o2.as_char()
+                    && match (o1.spacing(), o2.spacing()) {
+                        (Spacing::Alone, Spacing::Alone) | (Spacing::Joint, Spacing::Joint) => true,
+                        _ => false,
+                    }
+            }
+            (TokenTree::Literal(l1), TokenTree::Literal(l2)) => l1.to_string() == l2.to_string(),
+            (TokenTree::Ident(s1), TokenTree::Ident(s2)) => s1 == s2,
+            _ => false,
+        }
+    }
+}
+
+impl<'a> Hash for TokenTreeHelper<'a> {
+    fn hash<H: Hasher>(&self, h: &mut H) {
+        use proc_macro2::Spacing;
+
+        match self.0 {
+            TokenTree::Group(g) => {
+                0u8.hash(h);
+                match g.delimiter() {
+                    Delimiter::Parenthesis => 0u8.hash(h),
+                    Delimiter::Brace => 1u8.hash(h),
+                    Delimiter::Bracket => 2u8.hash(h),
+                    Delimiter::None => 3u8.hash(h),
+                }
+
+                for item in g.stream() {
+                    TokenTreeHelper(&item).hash(h);
+                }
+                0xFFu8.hash(h); // terminator w/ a variant we don't normally hash
+            }
+            TokenTree::Punct(op) => {
+                1u8.hash(h);
+                op.as_char().hash(h);
+                match op.spacing() {
+                    Spacing::Alone => 0u8.hash(h),
+                    Spacing::Joint => 1u8.hash(h),
+                }
+            }
+            TokenTree::Literal(lit) => (2u8, lit.to_string()).hash(h),
+            TokenTree::Ident(word) => (3u8, word).hash(h),
+        }
+    }
+}
+
+pub(crate) struct TokenStreamHelper<'a>(pub &'a TokenStream);
+
+impl<'a> PartialEq for TokenStreamHelper<'a> {
+    fn eq(&self, other: &Self) -> bool {
+        let left = self.0.clone().into_iter().collect::<Vec<_>>();
+        let right = other.0.clone().into_iter().collect::<Vec<_>>();
+        if left.len() != right.len() {
+            return false;
+        }
+        for (a, b) in left.into_iter().zip(right) {
+            if TokenTreeHelper(&a) != TokenTreeHelper(&b) {
+                return false;
+            }
+        }
+        true
+    }
+}
+
+impl<'a> Hash for TokenStreamHelper<'a> {
+    fn hash<H: Hasher>(&self, state: &mut H) {
+        let tts = self.0.clone().into_iter().collect::<Vec<_>>();
+        tts.len().hash(state);
+        for tt in tts {
+            TokenTreeHelper(&tt).hash(state);
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/ty.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/ty.rs
--- 43.0.0-1/rust-vendor/syn/src/ty.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/ty.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1216 @@
+use crate::attr::Attribute;
+use crate::expr::Expr;
+use crate::generics::{BoundLifetimes, TypeParamBound};
+use crate::ident::Ident;
+use crate::lifetime::Lifetime;
+use crate::lit::LitStr;
+use crate::mac::Macro;
+use crate::path::{Path, QSelf};
+use crate::punctuated::Punctuated;
+use crate::token;
+use proc_macro2::TokenStream;
+
+ast_enum_of_structs! {
+    /// The possible types that a Rust value could have.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    #[non_exhaustive]
+    pub enum Type {
+        /// A fixed size array type: `[T; n]`.
+        Array(TypeArray),
+
+        /// A bare function type: `fn(usize) -> bool`.
+        BareFn(TypeBareFn),
+
+        /// A type contained within invisible delimiters.
+        Group(TypeGroup),
+
+        /// An `impl Bound1 + Bound2 + Bound3` type where `Bound` is a trait or
+        /// a lifetime.
+        ImplTrait(TypeImplTrait),
+
+        /// Indication that a type should be inferred by the compiler: `_`.
+        Infer(TypeInfer),
+
+        /// A macro in the type position.
+        Macro(TypeMacro),
+
+        /// The never type: `!`.
+        Never(TypeNever),
+
+        /// A parenthesized type equivalent to the inner type.
+        Paren(TypeParen),
+
+        /// A path like `std::slice::Iter`, optionally qualified with a
+        /// self-type as in `<Vec<T> as SomeTrait>::Associated`.
+        Path(TypePath),
+
+        /// A raw pointer type: `*const T` or `*mut T`.
+        Ptr(TypePtr),
+
+        /// A reference type: `&'a T` or `&'a mut T`.
+        Reference(TypeReference),
+
+        /// A dynamically sized slice type: `[T]`.
+        Slice(TypeSlice),
+
+        /// A trait object type `dyn Bound1 + Bound2 + Bound3` where `Bound` is a
+        /// trait or a lifetime.
+        TraitObject(TypeTraitObject),
+
+        /// A tuple type: `(A, B, C, String)`.
+        Tuple(TypeTuple),
+
+        /// Tokens in type position not interpreted by Syn.
+        Verbatim(TokenStream),
+
+        // For testing exhaustiveness in downstream code, use the following idiom:
+        //
+        //     match ty {
+        //         #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
+        //
+        //         Type::Array(ty) => {...}
+        //         Type::BareFn(ty) => {...}
+        //         ...
+        //         Type::Verbatim(ty) => {...}
+        //
+        //         _ => { /* some sane fallback */ }
+        //     }
+        //
+        // This way we fail your tests but don't break your library when adding
+        // a variant. You will be notified by a test failure when a variant is
+        // added, so that you can add code to handle it, but your library will
+        // continue to compile and work for downstream users in the interim.
+    }
+}
+
+ast_struct! {
+    /// A fixed size array type: `[T; n]`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeArray {
+        pub bracket_token: token::Bracket,
+        pub elem: Box<Type>,
+        pub semi_token: Token![;],
+        pub len: Expr,
+    }
+}
+
+ast_struct! {
+    /// A bare function type: `fn(usize) -> bool`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeBareFn {
+        pub lifetimes: Option<BoundLifetimes>,
+        pub unsafety: Option<Token![unsafe]>,
+        pub abi: Option<Abi>,
+        pub fn_token: Token![fn],
+        pub paren_token: token::Paren,
+        pub inputs: Punctuated<BareFnArg, Token![,]>,
+        pub variadic: Option<BareVariadic>,
+        pub output: ReturnType,
+    }
+}
+
+ast_struct! {
+    /// A type contained within invisible delimiters.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeGroup {
+        pub group_token: token::Group,
+        pub elem: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// An `impl Bound1 + Bound2 + Bound3` type where `Bound` is a trait or
+    /// a lifetime.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeImplTrait {
+        pub impl_token: Token![impl],
+        pub bounds: Punctuated<TypeParamBound, Token![+]>,
+    }
+}
+
+ast_struct! {
+    /// Indication that a type should be inferred by the compiler: `_`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeInfer {
+        pub underscore_token: Token![_],
+    }
+}
+
+ast_struct! {
+    /// A macro in the type position.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeMacro {
+        pub mac: Macro,
+    }
+}
+
+ast_struct! {
+    /// The never type: `!`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeNever {
+        pub bang_token: Token![!],
+    }
+}
+
+ast_struct! {
+    /// A parenthesized type equivalent to the inner type.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeParen {
+        pub paren_token: token::Paren,
+        pub elem: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// A path like `std::slice::Iter`, optionally qualified with a
+    /// self-type as in `<Vec<T> as SomeTrait>::Associated`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypePath {
+        pub qself: Option<QSelf>,
+        pub path: Path,
+    }
+}
+
+ast_struct! {
+    /// A raw pointer type: `*const T` or `*mut T`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypePtr {
+        pub star_token: Token![*],
+        pub const_token: Option<Token![const]>,
+        pub mutability: Option<Token![mut]>,
+        pub elem: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// A reference type: `&'a T` or `&'a mut T`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeReference {
+        pub and_token: Token![&],
+        pub lifetime: Option<Lifetime>,
+        pub mutability: Option<Token![mut]>,
+        pub elem: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// A dynamically sized slice type: `[T]`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeSlice {
+        pub bracket_token: token::Bracket,
+        pub elem: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// A trait object type `dyn Bound1 + Bound2 + Bound3` where `Bound` is a
+    /// trait or a lifetime.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeTraitObject {
+        pub dyn_token: Option<Token![dyn]>,
+        pub bounds: Punctuated<TypeParamBound, Token![+]>,
+    }
+}
+
+ast_struct! {
+    /// A tuple type: `(A, B, C, String)`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeTuple {
+        pub paren_token: token::Paren,
+        pub elems: Punctuated<Type, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// The binary interface of a function: `extern "C"`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct Abi {
+        pub extern_token: Token![extern],
+        pub name: Option<LitStr>,
+    }
+}
+
+ast_struct! {
+    /// An argument in a function type: the `usize` in `fn(usize) -> bool`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct BareFnArg {
+        pub attrs: Vec<Attribute>,
+        pub name: Option<(Ident, Token![:])>,
+        pub ty: Type,
+    }
+}
+
+ast_struct! {
+    /// The variadic argument of a function pointer like `fn(usize, ...)`.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct BareVariadic {
+        pub attrs: Vec<Attribute>,
+        pub name: Option<(Ident, Token![:])>,
+        pub dots: Token![...],
+        pub comma: Option<Token![,]>,
+    }
+}
+
+ast_enum! {
+    /// Return type of a function signature.
+    #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub enum ReturnType {
+        /// Return type is not specified.
+        ///
+        /// Functions default to `()` and closures default to type inference.
+        Default,
+        /// A particular type is returned.
+        Type(Token![->], Box<Type>),
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::attr::Attribute;
+    use crate::error::{self, Result};
+    use crate::ext::IdentExt as _;
+    use crate::generics::{BoundLifetimes, TraitBound, TraitBoundModifier, TypeParamBound};
+    use crate::ident::Ident;
+    use crate::lifetime::Lifetime;
+    use crate::mac::{self, Macro};
+    use crate::parse::{Parse, ParseStream};
+    use crate::path;
+    use crate::path::{Path, PathArguments, QSelf};
+    use crate::punctuated::Punctuated;
+    use crate::token;
+    use crate::ty::{
+        Abi, BareFnArg, BareVariadic, ReturnType, Type, TypeArray, TypeBareFn, TypeGroup,
+        TypeImplTrait, TypeInfer, TypeMacro, TypeNever, TypeParen, TypePath, TypePtr,
+        TypeReference, TypeSlice, TypeTraitObject, TypeTuple,
+    };
+    use crate::verbatim;
+    use proc_macro2::Span;
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Type {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_plus = true;
+            let allow_group_generic = true;
+            ambig_ty(input, allow_plus, allow_group_generic)
+        }
+    }
+
+    impl Type {
+        /// In some positions, types may not contain the `+` character, to
+        /// disambiguate them. For example in the expression `1 as T`, T may not
+        /// contain a `+` character.
+        ///
+        /// This parser does not allow a `+`, while the default parser does.
+        #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+        pub fn without_plus(input: ParseStream) -> Result<Self> {
+            let allow_plus = false;
+            let allow_group_generic = true;
+            ambig_ty(input, allow_plus, allow_group_generic)
+        }
+    }
+
+    pub(crate) fn ambig_ty(
+        input: ParseStream,
+        allow_plus: bool,
+        allow_group_generic: bool,
+    ) -> Result<Type> {
+        let begin = input.fork();
+
+        if input.peek(token::Group) {
+            let mut group: TypeGroup = input.parse()?;
+            if input.peek(Token![::]) && input.peek3(Ident::peek_any) {
+                if let Type::Path(mut ty) = *group.elem {
+                    Path::parse_rest(input, &mut ty.path, false)?;
+                    return Ok(Type::Path(ty));
+                } else {
+                    return Ok(Type::Path(TypePath {
+                        qself: Some(QSelf {
+                            lt_token: Token![<](group.group_token.span),
+                            position: 0,
+                            as_token: None,
+                            gt_token: Token![>](group.group_token.span),
+                            ty: group.elem,
+                        }),
+                        path: Path::parse_helper(input, false)?,
+                    }));
+                }
+            } else if input.peek(Token![<]) && allow_group_generic
+                || input.peek(Token![::]) && input.peek3(Token![<])
+            {
+                if let Type::Path(mut ty) = *group.elem {
+                    let arguments = &mut ty.path.segments.last_mut().unwrap().arguments;
+                    if arguments.is_none() {
+                        *arguments = PathArguments::AngleBracketed(input.parse()?);
+                        Path::parse_rest(input, &mut ty.path, false)?;
+                        return Ok(Type::Path(ty));
+                    } else {
+                        group.elem = Box::new(Type::Path(ty));
+                    }
+                }
+            }
+            return Ok(Type::Group(group));
+        }
+
+        let mut lifetimes = None::<BoundLifetimes>;
+        let mut lookahead = input.lookahead1();
+        if lookahead.peek(Token![for]) {
+            lifetimes = input.parse()?;
+            lookahead = input.lookahead1();
+            if !lookahead.peek(Ident)
+                && !lookahead.peek(Token![fn])
+                && !lookahead.peek(Token![unsafe])
+                && !lookahead.peek(Token![extern])
+                && !lookahead.peek(Token![super])
+                && !lookahead.peek(Token![self])
+                && !lookahead.peek(Token![Self])
+                && !lookahead.peek(Token![crate])
+                || input.peek(Token![dyn])
+            {
+                return Err(lookahead.error());
+            }
+        }
+
+        if lookahead.peek(token::Paren) {
+            let content;
+            let paren_token = parenthesized!(content in input);
+            if content.is_empty() {
+                return Ok(Type::Tuple(TypeTuple {
+                    paren_token,
+                    elems: Punctuated::new(),
+                }));
+            }
+            if content.peek(Lifetime) {
+                return Ok(Type::Paren(TypeParen {
+                    paren_token,
+                    elem: Box::new(Type::TraitObject(content.parse()?)),
+                }));
+            }
+            if content.peek(Token![?]) {
+                return Ok(Type::TraitObject(TypeTraitObject {
+                    dyn_token: None,
+                    bounds: {
+                        let mut bounds = Punctuated::new();
+                        bounds.push_value(TypeParamBound::Trait(TraitBound {
+                            paren_token: Some(paren_token),
+                            ..content.parse()?
+                        }));
+                        while let Some(plus) = input.parse()? {
+                            bounds.push_punct(plus);
+                            bounds.push_value(input.parse()?);
+                        }
+                        bounds
+                    },
+                }));
+            }
+            let mut first: Type = content.parse()?;
+            if content.peek(Token![,]) {
+                return Ok(Type::Tuple(TypeTuple {
+                    paren_token,
+                    elems: {
+                        let mut elems = Punctuated::new();
+                        elems.push_value(first);
+                        elems.push_punct(content.parse()?);
+                        while !content.is_empty() {
+                            elems.push_value(content.parse()?);
+                            if content.is_empty() {
+                                break;
+                            }
+                            elems.push_punct(content.parse()?);
+                        }
+                        elems
+                    },
+                }));
+            }
+            if allow_plus && input.peek(Token![+]) {
+                loop {
+                    let first = match first {
+                        Type::Path(TypePath { qself: None, path }) => {
+                            TypeParamBound::Trait(TraitBound {
+                                paren_token: Some(paren_token),
+                                modifier: TraitBoundModifier::None,
+                                lifetimes: None,
+                                path,
+                            })
+                        }
+                        Type::TraitObject(TypeTraitObject {
+                            dyn_token: None,
+                            bounds,
+                        }) => {
+                            if bounds.len() > 1 || bounds.trailing_punct() {
+                                first = Type::TraitObject(TypeTraitObject {
+                                    dyn_token: None,
+                                    bounds,
+                                });
+                                break;
+                            }
+                            match bounds.into_iter().next().unwrap() {
+                                TypeParamBound::Trait(trait_bound) => {
+                                    TypeParamBound::Trait(TraitBound {
+                                        paren_token: Some(paren_token),
+                                        ..trait_bound
+                                    })
+                                }
+                                other @ (TypeParamBound::Lifetime(_)
+                                | TypeParamBound::Verbatim(_)) => other,
+                            }
+                        }
+                        _ => break,
+                    };
+                    return Ok(Type::TraitObject(TypeTraitObject {
+                        dyn_token: None,
+                        bounds: {
+                            let mut bounds = Punctuated::new();
+                            bounds.push_value(first);
+                            while let Some(plus) = input.parse()? {
+                                bounds.push_punct(plus);
+                                bounds.push_value(input.parse()?);
+                            }
+                            bounds
+                        },
+                    }));
+                }
+            }
+            Ok(Type::Paren(TypeParen {
+                paren_token,
+                elem: Box::new(first),
+            }))
+        } else if lookahead.peek(Token![fn])
+            || lookahead.peek(Token![unsafe])
+            || lookahead.peek(Token![extern])
+        {
+            let mut bare_fn: TypeBareFn = input.parse()?;
+            bare_fn.lifetimes = lifetimes;
+            Ok(Type::BareFn(bare_fn))
+        } else if lookahead.peek(Ident)
+            || input.peek(Token![super])
+            || input.peek(Token![self])
+            || input.peek(Token![Self])
+            || input.peek(Token![crate])
+            || lookahead.peek(Token![::])
+            || lookahead.peek(Token![<])
+        {
+            let ty: TypePath = input.parse()?;
+            if ty.qself.is_some() {
+                return Ok(Type::Path(ty));
+            }
+
+            if input.peek(Token![!]) && !input.peek(Token![!=]) && ty.path.is_mod_style() {
+                let bang_token: Token![!] = input.parse()?;
+                let (delimiter, tokens) = mac::parse_delimiter(input)?;
+                return Ok(Type::Macro(TypeMacro {
+                    mac: Macro {
+                        path: ty.path,
+                        bang_token,
+                        delimiter,
+                        tokens,
+                    },
+                }));
+            }
+
+            if lifetimes.is_some() || allow_plus && input.peek(Token![+]) {
+                let mut bounds = Punctuated::new();
+                bounds.push_value(TypeParamBound::Trait(TraitBound {
+                    paren_token: None,
+                    modifier: TraitBoundModifier::None,
+                    lifetimes,
+                    path: ty.path,
+                }));
+                if allow_plus {
+                    while input.peek(Token![+]) {
+                        bounds.push_punct(input.parse()?);
+                        if !(input.peek(Ident::peek_any)
+                            || input.peek(Token![::])
+                            || input.peek(Token![?])
+                            || input.peek(Lifetime)
+                            || input.peek(token::Paren))
+                        {
+                            break;
+                        }
+                        bounds.push_value(input.parse()?);
+                    }
+                }
+                return Ok(Type::TraitObject(TypeTraitObject {
+                    dyn_token: None,
+                    bounds,
+                }));
+            }
+
+            Ok(Type::Path(ty))
+        } else if lookahead.peek(Token![dyn]) {
+            let dyn_token: Token![dyn] = input.parse()?;
+            let dyn_span = dyn_token.span;
+            let star_token: Option<Token![*]> = input.parse()?;
+            let bounds = TypeTraitObject::parse_bounds(dyn_span, input, allow_plus)?;
+            return Ok(if star_token.is_some() {
+                Type::Verbatim(verbatim::between(&begin, input))
+            } else {
+                Type::TraitObject(TypeTraitObject {
+                    dyn_token: Some(dyn_token),
+                    bounds,
+                })
+            });
+        } else if lookahead.peek(token::Bracket) {
+            let content;
+            let bracket_token = bracketed!(content in input);
+            let elem: Type = content.parse()?;
+            if content.peek(Token![;]) {
+                Ok(Type::Array(TypeArray {
+                    bracket_token,
+                    elem: Box::new(elem),
+                    semi_token: content.parse()?,
+                    len: content.parse()?,
+                }))
+            } else {
+                Ok(Type::Slice(TypeSlice {
+                    bracket_token,
+                    elem: Box::new(elem),
+                }))
+            }
+        } else if lookahead.peek(Token![*]) {
+            input.parse().map(Type::Ptr)
+        } else if lookahead.peek(Token![&]) {
+            input.parse().map(Type::Reference)
+        } else if lookahead.peek(Token![!]) && !input.peek(Token![=]) {
+            input.parse().map(Type::Never)
+        } else if lookahead.peek(Token![impl]) {
+            TypeImplTrait::parse(input, allow_plus).map(Type::ImplTrait)
+        } else if lookahead.peek(Token![_]) {
+            input.parse().map(Type::Infer)
+        } else if lookahead.peek(Lifetime) {
+            input.parse().map(Type::TraitObject)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeSlice {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            Ok(TypeSlice {
+                bracket_token: bracketed!(content in input),
+                elem: content.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeArray {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            Ok(TypeArray {
+                bracket_token: bracketed!(content in input),
+                elem: content.parse()?,
+                semi_token: content.parse()?,
+                len: content.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TypePtr {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let star_token: Token![*] = input.parse()?;
+
+            let lookahead = input.lookahead1();
+            let (const_token, mutability) = if lookahead.peek(Token![const]) {
+                (Some(input.parse()?), None)
+            } else if lookahead.peek(Token![mut]) {
+                (None, Some(input.parse()?))
+            } else {
+                return Err(lookahead.error());
+            };
+
+            Ok(TypePtr {
+                star_token,
+                const_token,
+                mutability,
+                elem: Box::new(input.call(Type::without_plus)?),
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeReference {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(TypeReference {
+                and_token: input.parse()?,
+                lifetime: input.parse()?,
+                mutability: input.parse()?,
+                // & binds tighter than +, so we don't allow + here.
+                elem: Box::new(input.call(Type::without_plus)?),
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeBareFn {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let args;
+            let mut variadic = None;
+
+            Ok(TypeBareFn {
+                lifetimes: input.parse()?,
+                unsafety: input.parse()?,
+                abi: input.parse()?,
+                fn_token: input.parse()?,
+                paren_token: parenthesized!(args in input),
+                inputs: {
+                    let mut inputs = Punctuated::new();
+
+                    while !args.is_empty() {
+                        let attrs = args.call(Attribute::parse_outer)?;
+
+                        if inputs.empty_or_trailing()
+                            && (args.peek(Token![...])
+                                || args.peek(Ident)
+                                    && args.peek2(Token![:])
+                                    && args.peek3(Token![...]))
+                        {
+                            variadic = Some(parse_bare_variadic(&args, attrs)?);
+                            break;
+                        }
+
+                        let allow_self = inputs.is_empty();
+                        let arg = parse_bare_fn_arg(&args, allow_self)?;
+                        inputs.push_value(BareFnArg { attrs, ..arg });
+                        if args.is_empty() {
+                            break;
+                        }
+
+                        let comma = args.parse()?;
+                        inputs.push_punct(comma);
+                    }
+
+                    inputs
+                },
+                variadic,
+                output: input.call(ReturnType::without_plus)?,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeNever {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(TypeNever {
+                bang_token: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeInfer {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(TypeInfer {
+                underscore_token: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeTuple {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            let paren_token = parenthesized!(content in input);
+
+            if content.is_empty() {
+                return Ok(TypeTuple {
+                    paren_token,
+                    elems: Punctuated::new(),
+                });
+            }
+
+            let first: Type = content.parse()?;
+            Ok(TypeTuple {
+                paren_token,
+                elems: {
+                    let mut elems = Punctuated::new();
+                    elems.push_value(first);
+                    elems.push_punct(content.parse()?);
+                    while !content.is_empty() {
+                        elems.push_value(content.parse()?);
+                        if content.is_empty() {
+                            break;
+                        }
+                        elems.push_punct(content.parse()?);
+                    }
+                    elems
+                },
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeMacro {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(TypeMacro {
+                mac: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TypePath {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let expr_style = false;
+            let (qself, path) = path::parsing::qpath(input, expr_style)?;
+            Ok(TypePath { qself, path })
+        }
+    }
+
+    impl ReturnType {
+        #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+        pub fn without_plus(input: ParseStream) -> Result<Self> {
+            let allow_plus = false;
+            Self::parse(input, allow_plus)
+        }
+
+        pub(crate) fn parse(input: ParseStream, allow_plus: bool) -> Result<Self> {
+            if input.peek(Token![->]) {
+                let arrow = input.parse()?;
+                let allow_group_generic = true;
+                let ty = ambig_ty(input, allow_plus, allow_group_generic)?;
+                Ok(ReturnType::Type(arrow, Box::new(ty)))
+            } else {
+                Ok(ReturnType::Default)
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for ReturnType {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_plus = true;
+            Self::parse(input, allow_plus)
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeTraitObject {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_plus = true;
+            Self::parse(input, allow_plus)
+        }
+    }
+
+    impl TypeTraitObject {
+        #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+        pub fn without_plus(input: ParseStream) -> Result<Self> {
+            let allow_plus = false;
+            Self::parse(input, allow_plus)
+        }
+
+        // Only allow multiple trait references if allow_plus is true.
+        pub(crate) fn parse(input: ParseStream, allow_plus: bool) -> Result<Self> {
+            let dyn_token: Option<Token![dyn]> = input.parse()?;
+            let dyn_span = match &dyn_token {
+                Some(token) => token.span,
+                None => input.span(),
+            };
+            let bounds = Self::parse_bounds(dyn_span, input, allow_plus)?;
+            Ok(TypeTraitObject { dyn_token, bounds })
+        }
+
+        fn parse_bounds(
+            dyn_span: Span,
+            input: ParseStream,
+            allow_plus: bool,
+        ) -> Result<Punctuated<TypeParamBound, Token![+]>> {
+            let bounds = TypeParamBound::parse_multiple(input, allow_plus)?;
+            let mut last_lifetime_span = None;
+            let mut at_least_one_trait = false;
+            for bound in &bounds {
+                match bound {
+                    TypeParamBound::Trait(_) | TypeParamBound::Verbatim(_) => {
+                        at_least_one_trait = true;
+                        break;
+                    }
+                    TypeParamBound::Lifetime(lifetime) => {
+                        last_lifetime_span = Some(lifetime.ident.span());
+                    }
+                }
+            }
+            // Just lifetimes like `'a + 'b` is not a TraitObject.
+            if !at_least_one_trait {
+                let msg = "at least one trait is required for an object type";
+                return Err(error::new2(dyn_span, last_lifetime_span.unwrap(), msg));
+            }
+            Ok(bounds)
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeImplTrait {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_plus = true;
+            Self::parse(input, allow_plus)
+        }
+    }
+
+    impl TypeImplTrait {
+        #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+        pub fn without_plus(input: ParseStream) -> Result<Self> {
+            let allow_plus = false;
+            Self::parse(input, allow_plus)
+        }
+
+        pub(crate) fn parse(input: ParseStream, allow_plus: bool) -> Result<Self> {
+            let impl_token: Token![impl] = input.parse()?;
+            let bounds = TypeParamBound::parse_multiple(input, allow_plus)?;
+            let mut last_lifetime_span = None;
+            let mut at_least_one_trait = false;
+            for bound in &bounds {
+                match bound {
+                    TypeParamBound::Trait(_) | TypeParamBound::Verbatim(_) => {
+                        at_least_one_trait = true;
+                        break;
+                    }
+                    TypeParamBound::Lifetime(lifetime) => {
+                        last_lifetime_span = Some(lifetime.ident.span());
+                    }
+                }
+            }
+            if !at_least_one_trait {
+                let msg = "at least one trait must be specified";
+                return Err(error::new2(
+                    impl_token.span,
+                    last_lifetime_span.unwrap(),
+                    msg,
+                ));
+            }
+            Ok(TypeImplTrait { impl_token, bounds })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeGroup {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let group = crate::group::parse_group(input)?;
+            Ok(TypeGroup {
+                group_token: group.token,
+                elem: group.content.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeParen {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_plus = false;
+            Self::parse(input, allow_plus)
+        }
+    }
+
+    impl TypeParen {
+        fn parse(input: ParseStream, allow_plus: bool) -> Result<Self> {
+            let content;
+            Ok(TypeParen {
+                paren_token: parenthesized!(content in input),
+                elem: Box::new({
+                    let allow_group_generic = true;
+                    ambig_ty(&content, allow_plus, allow_group_generic)?
+                }),
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for BareFnArg {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_self = false;
+            parse_bare_fn_arg(input, allow_self)
+        }
+    }
+
+    fn parse_bare_fn_arg(input: ParseStream, allow_self: bool) -> Result<BareFnArg> {
+        let attrs = input.call(Attribute::parse_outer)?;
+
+        let begin = input.fork();
+
+        let has_mut_self = allow_self && input.peek(Token![mut]) && input.peek2(Token![self]);
+        if has_mut_self {
+            input.parse::<Token![mut]>()?;
+        }
+
+        let mut has_self = false;
+        let mut name = if (input.peek(Ident) || input.peek(Token![_]) || {
+            has_self = allow_self && input.peek(Token![self]);
+            has_self
+        }) && input.peek2(Token![:])
+            && !input.peek2(Token![::])
+        {
+            let name = input.call(Ident::parse_any)?;
+            let colon: Token![:] = input.parse()?;
+            Some((name, colon))
+        } else {
+            has_self = false;
+            None
+        };
+
+        let ty = if allow_self && !has_self && input.peek(Token![mut]) && input.peek2(Token![self])
+        {
+            input.parse::<Token![mut]>()?;
+            input.parse::<Token![self]>()?;
+            None
+        } else if has_mut_self && name.is_none() {
+            input.parse::<Token![self]>()?;
+            None
+        } else {
+            Some(input.parse()?)
+        };
+
+        let ty = match ty {
+            Some(ty) if !has_mut_self => ty,
+            _ => {
+                name = None;
+                Type::Verbatim(verbatim::between(&begin, input))
+            }
+        };
+
+        Ok(BareFnArg { attrs, name, ty })
+    }
+
+    fn parse_bare_variadic(input: ParseStream, attrs: Vec<Attribute>) -> Result<BareVariadic> {
+        Ok(BareVariadic {
+            attrs,
+            name: if input.peek(Ident) || input.peek(Token![_]) {
+                let name = input.call(Ident::parse_any)?;
+                let colon: Token![:] = input.parse()?;
+                Some((name, colon))
+            } else {
+                None
+            },
+            dots: input.parse()?,
+            comma: input.parse()?,
+        })
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Abi {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(Abi {
+                extern_token: input.parse()?,
+                name: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
+    impl Parse for Option<Abi> {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Token![extern]) {
+                input.parse().map(Some)
+            } else {
+                Ok(None)
+            }
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::attr::FilterAttrs;
+    use crate::path;
+    use crate::print::TokensOrDefault;
+    use crate::ty::{
+        Abi, BareFnArg, BareVariadic, ReturnType, TypeArray, TypeBareFn, TypeGroup, TypeImplTrait,
+        TypeInfer, TypeMacro, TypeNever, TypeParen, TypePath, TypePtr, TypeReference, TypeSlice,
+        TypeTraitObject, TypeTuple,
+    };
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeSlice {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.bracket_token.surround(tokens, |tokens| {
+                self.elem.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeArray {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.bracket_token.surround(tokens, |tokens| {
+                self.elem.to_tokens(tokens);
+                self.semi_token.to_tokens(tokens);
+                self.len.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypePtr {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.star_token.to_tokens(tokens);
+            match &self.mutability {
+                Some(tok) => tok.to_tokens(tokens),
+                None => {
+                    TokensOrDefault(&self.const_token).to_tokens(tokens);
+                }
+            }
+            self.elem.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeReference {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.and_token.to_tokens(tokens);
+            self.lifetime.to_tokens(tokens);
+            self.mutability.to_tokens(tokens);
+            self.elem.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeBareFn {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.lifetimes.to_tokens(tokens);
+            self.unsafety.to_tokens(tokens);
+            self.abi.to_tokens(tokens);
+            self.fn_token.to_tokens(tokens);
+            self.paren_token.surround(tokens, |tokens| {
+                self.inputs.to_tokens(tokens);
+                if let Some(variadic) = &self.variadic {
+                    if !self.inputs.empty_or_trailing() {
+                        let span = variadic.dots.spans[0];
+                        Token![,](span).to_tokens(tokens);
+                    }
+                    variadic.to_tokens(tokens);
+                }
+            });
+            self.output.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeNever {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.bang_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeTuple {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.paren_token.surround(tokens, |tokens| {
+                self.elems.to_tokens(tokens);
+                // If we only have one argument, we need a trailing comma to
+                // distinguish TypeTuple from TypeParen.
+                if self.elems.len() == 1 && !self.elems.trailing_punct() {
+                    <Token![,]>::default().to_tokens(tokens);
+                }
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypePath {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            path::printing::print_path(tokens, &self.qself, &self.path);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeTraitObject {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.dyn_token.to_tokens(tokens);
+            self.bounds.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeImplTrait {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.impl_token.to_tokens(tokens);
+            self.bounds.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeGroup {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.group_token.surround(tokens, |tokens| {
+                self.elem.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeParen {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.paren_token.surround(tokens, |tokens| {
+                self.elem.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeInfer {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.underscore_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeMacro {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.mac.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for ReturnType {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                ReturnType::Default => {}
+                ReturnType::Type(arrow, ty) => {
+                    arrow.to_tokens(tokens);
+                    ty.to_tokens(tokens);
+                }
+            }
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for BareFnArg {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            if let Some((name, colon)) = &self.name {
+                name.to_tokens(tokens);
+                colon.to_tokens(tokens);
+            }
+            self.ty.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for BareVariadic {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            if let Some((name, colon)) = &self.name {
+                name.to_tokens(tokens);
+                colon.to_tokens(tokens);
+            }
+            self.dots.to_tokens(tokens);
+            self.comma.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
+    impl ToTokens for Abi {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.extern_token.to_tokens(tokens);
+            self.name.to_tokens(tokens);
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/verbatim.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/verbatim.rs
--- 43.0.0-1/rust-vendor/syn/src/verbatim.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/verbatim.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,33 @@
+use crate::parse::ParseStream;
+use proc_macro2::{Delimiter, TokenStream};
+use std::cmp::Ordering;
+use std::iter;
+
+pub(crate) fn between<'a>(begin: ParseStream<'a>, end: ParseStream<'a>) -> TokenStream {
+    let end = end.cursor();
+    let mut cursor = begin.cursor();
+    assert!(crate::buffer::same_buffer(end, cursor));
+
+    let mut tokens = TokenStream::new();
+    while cursor != end {
+        let (tt, next) = cursor.token_tree().unwrap();
+
+        if crate::buffer::cmp_assuming_same_buffer(end, next) == Ordering::Less {
+            // A syntax node can cross the boundary of a None-delimited group
+            // due to such groups being transparent to the parser in most cases.
+            // Any time this occurs the group is known to be semantically
+            // irrelevant. https://github.com/dtolnay/syn/issues/1235
+            if let Some((inside, _span, after)) = cursor.group(Delimiter::None) {
+                assert!(next == after);
+                cursor = inside;
+                continue;
+            } else {
+                panic!("verbatim end must not be inside a delimited group");
+            }
+        }
+
+        tokens.extend(iter::once(tt));
+        cursor = next;
+    }
+    tokens
+}
diff -pruN 43.0.0-1/rust-vendor/syn/src/whitespace.rs 43.0.0-1ubuntu1/rust-vendor/syn/src/whitespace.rs
--- 43.0.0-1/rust-vendor/syn/src/whitespace.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/src/whitespace.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,65 @@
+pub(crate) fn skip(mut s: &str) -> &str {
+    'skip: while !s.is_empty() {
+        let byte = s.as_bytes()[0];
+        if byte == b'/' {
+            if s.starts_with("//")
+                && (!s.starts_with("///") || s.starts_with("////"))
+                && !s.starts_with("//!")
+            {
+                if let Some(i) = s.find('\n') {
+                    s = &s[i + 1..];
+                    continue;
+                } else {
+                    return "";
+                }
+            } else if s.starts_with("/**/") {
+                s = &s[4..];
+                continue;
+            } else if s.starts_with("/*")
+                && (!s.starts_with("/**") || s.starts_with("/***"))
+                && !s.starts_with("/*!")
+            {
+                let mut depth = 0;
+                let bytes = s.as_bytes();
+                let mut i = 0;
+                let upper = bytes.len() - 1;
+                while i < upper {
+                    if bytes[i] == b'/' && bytes[i + 1] == b'*' {
+                        depth += 1;
+                        i += 1; // eat '*'
+                    } else if bytes[i] == b'*' && bytes[i + 1] == b'/' {
+                        depth -= 1;
+                        if depth == 0 {
+                            s = &s[i + 2..];
+                            continue 'skip;
+                        }
+                        i += 1; // eat '/'
+                    }
+                    i += 1;
+                }
+                return s;
+            }
+        }
+        match byte {
+            b' ' | 0x09..=0x0D => {
+                s = &s[1..];
+                continue;
+            }
+            b if b <= 0x7F => {}
+            _ => {
+                let ch = s.chars().next().unwrap();
+                if is_whitespace(ch) {
+                    s = &s[ch.len_utf8()..];
+                    continue;
+                }
+            }
+        }
+        return s;
+    }
+    s
+}
+
+fn is_whitespace(ch: char) -> bool {
+    // Rust treats left-to-right mark and right-to-left mark as whitespace
+    ch.is_whitespace() || ch == '\u{200e}' || ch == '\u{200f}'
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/common/eq.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/common/eq.rs
--- 43.0.0-1/rust-vendor/syn/tests/common/eq.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/common/eq.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,904 @@
+#![allow(unused_macro_rules)]
+
+extern crate rustc_ast;
+extern crate rustc_data_structures;
+extern crate rustc_driver;
+extern crate rustc_span;
+extern crate thin_vec;
+
+use rustc_ast::ast::AngleBracketedArg;
+use rustc_ast::ast::AngleBracketedArgs;
+use rustc_ast::ast::AnonConst;
+use rustc_ast::ast::Arm;
+use rustc_ast::ast::AssocItemConstraint;
+use rustc_ast::ast::AssocItemConstraintKind;
+use rustc_ast::ast::AssocItemKind;
+use rustc_ast::ast::AttrArgs;
+use rustc_ast::ast::AttrArgsEq;
+use rustc_ast::ast::AttrId;
+use rustc_ast::ast::AttrItem;
+use rustc_ast::ast::AttrKind;
+use rustc_ast::ast::AttrStyle;
+use rustc_ast::ast::Attribute;
+use rustc_ast::ast::BareFnTy;
+use rustc_ast::ast::BinOpKind;
+use rustc_ast::ast::BindingMode;
+use rustc_ast::ast::Block;
+use rustc_ast::ast::BlockCheckMode;
+use rustc_ast::ast::BorrowKind;
+use rustc_ast::ast::BoundAsyncness;
+use rustc_ast::ast::BoundConstness;
+use rustc_ast::ast::BoundPolarity;
+use rustc_ast::ast::ByRef;
+use rustc_ast::ast::CaptureBy;
+use rustc_ast::ast::Closure;
+use rustc_ast::ast::ClosureBinder;
+use rustc_ast::ast::Const;
+use rustc_ast::ast::ConstItem;
+use rustc_ast::ast::CoroutineKind;
+use rustc_ast::ast::Crate;
+use rustc_ast::ast::Defaultness;
+use rustc_ast::ast::Delegation;
+use rustc_ast::ast::DelegationMac;
+use rustc_ast::ast::DelimArgs;
+use rustc_ast::ast::EnumDef;
+use rustc_ast::ast::Expr;
+use rustc_ast::ast::ExprField;
+use rustc_ast::ast::ExprKind;
+use rustc_ast::ast::Extern;
+use rustc_ast::ast::FieldDef;
+use rustc_ast::ast::FloatTy;
+use rustc_ast::ast::Fn;
+use rustc_ast::ast::FnDecl;
+use rustc_ast::ast::FnHeader;
+use rustc_ast::ast::FnRetTy;
+use rustc_ast::ast::FnSig;
+use rustc_ast::ast::ForLoopKind;
+use rustc_ast::ast::ForeignItemKind;
+use rustc_ast::ast::ForeignMod;
+use rustc_ast::ast::FormatAlignment;
+use rustc_ast::ast::FormatArgPosition;
+use rustc_ast::ast::FormatArgPositionKind;
+use rustc_ast::ast::FormatArgs;
+use rustc_ast::ast::FormatArgsPiece;
+use rustc_ast::ast::FormatArgument;
+use rustc_ast::ast::FormatArgumentKind;
+use rustc_ast::ast::FormatArguments;
+use rustc_ast::ast::FormatCount;
+use rustc_ast::ast::FormatDebugHex;
+use rustc_ast::ast::FormatOptions;
+use rustc_ast::ast::FormatPlaceholder;
+use rustc_ast::ast::FormatSign;
+use rustc_ast::ast::FormatTrait;
+use rustc_ast::ast::GenBlockKind;
+use rustc_ast::ast::GenericArg;
+use rustc_ast::ast::GenericArgs;
+use rustc_ast::ast::GenericBound;
+use rustc_ast::ast::GenericParam;
+use rustc_ast::ast::GenericParamKind;
+use rustc_ast::ast::Generics;
+use rustc_ast::ast::Impl;
+use rustc_ast::ast::ImplPolarity;
+use rustc_ast::ast::Inline;
+use rustc_ast::ast::InlineAsm;
+use rustc_ast::ast::InlineAsmOperand;
+use rustc_ast::ast::InlineAsmOptions;
+use rustc_ast::ast::InlineAsmRegOrRegClass;
+use rustc_ast::ast::InlineAsmSym;
+use rustc_ast::ast::InlineAsmTemplatePiece;
+use rustc_ast::ast::IntTy;
+use rustc_ast::ast::IsAuto;
+use rustc_ast::ast::Item;
+use rustc_ast::ast::ItemKind;
+use rustc_ast::ast::Label;
+use rustc_ast::ast::Lifetime;
+use rustc_ast::ast::LitFloatType;
+use rustc_ast::ast::LitIntType;
+use rustc_ast::ast::LitKind;
+use rustc_ast::ast::Local;
+use rustc_ast::ast::LocalKind;
+use rustc_ast::ast::MacCall;
+use rustc_ast::ast::MacCallStmt;
+use rustc_ast::ast::MacStmtStyle;
+use rustc_ast::ast::MacroDef;
+use rustc_ast::ast::MatchKind;
+use rustc_ast::ast::MetaItem;
+use rustc_ast::ast::MetaItemKind;
+use rustc_ast::ast::MetaItemLit;
+use rustc_ast::ast::MethodCall;
+use rustc_ast::ast::ModKind;
+use rustc_ast::ast::ModSpans;
+use rustc_ast::ast::Movability;
+use rustc_ast::ast::MutTy;
+use rustc_ast::ast::Mutability;
+use rustc_ast::ast::NestedMetaItem;
+use rustc_ast::ast::NodeId;
+use rustc_ast::ast::NormalAttr;
+use rustc_ast::ast::Param;
+use rustc_ast::ast::ParenthesizedArgs;
+use rustc_ast::ast::Pat;
+use rustc_ast::ast::PatField;
+use rustc_ast::ast::PatFieldsRest;
+use rustc_ast::ast::PatKind;
+use rustc_ast::ast::Path;
+use rustc_ast::ast::PathSegment;
+use rustc_ast::ast::PolyTraitRef;
+use rustc_ast::ast::PreciseCapturingArg;
+use rustc_ast::ast::QSelf;
+use rustc_ast::ast::RangeEnd;
+use rustc_ast::ast::RangeLimits;
+use rustc_ast::ast::RangeSyntax;
+use rustc_ast::ast::Recovered;
+use rustc_ast::ast::Safety;
+use rustc_ast::ast::StaticItem;
+use rustc_ast::ast::Stmt;
+use rustc_ast::ast::StmtKind;
+use rustc_ast::ast::StrLit;
+use rustc_ast::ast::StrStyle;
+use rustc_ast::ast::StructExpr;
+use rustc_ast::ast::StructRest;
+use rustc_ast::ast::Term;
+use rustc_ast::ast::Trait;
+use rustc_ast::ast::TraitBoundModifiers;
+use rustc_ast::ast::TraitObjectSyntax;
+use rustc_ast::ast::TraitRef;
+use rustc_ast::ast::Ty;
+use rustc_ast::ast::TyAlias;
+use rustc_ast::ast::TyAliasWhereClause;
+use rustc_ast::ast::TyAliasWhereClauses;
+use rustc_ast::ast::TyKind;
+use rustc_ast::ast::UintTy;
+use rustc_ast::ast::UnOp;
+use rustc_ast::ast::UnsafeSource;
+use rustc_ast::ast::UseTree;
+use rustc_ast::ast::UseTreeKind;
+use rustc_ast::ast::Variant;
+use rustc_ast::ast::VariantData;
+use rustc_ast::ast::Visibility;
+use rustc_ast::ast::VisibilityKind;
+use rustc_ast::ast::WhereBoundPredicate;
+use rustc_ast::ast::WhereClause;
+use rustc_ast::ast::WhereEqPredicate;
+use rustc_ast::ast::WherePredicate;
+use rustc_ast::ast::WhereRegionPredicate;
+use rustc_ast::ptr::P;
+use rustc_ast::token::{
+    self, CommentKind, Delimiter, IdentIsRaw, Lit, Nonterminal, Token, TokenKind,
+};
+use rustc_ast::tokenstream::{
+    AttrTokenStream, AttrTokenTree, AttrsTarget, DelimSpacing, DelimSpan, LazyAttrTokenStream,
+    Spacing, TokenStream, TokenTree,
+};
+use rustc_data_structures::packed::Pu128;
+use rustc_data_structures::sync::Lrc;
+use rustc_span::source_map::Spanned;
+use rustc_span::symbol::{sym, Ident};
+use rustc_span::{ErrorGuaranteed, Span, Symbol, SyntaxContext, DUMMY_SP};
+use std::collections::HashMap;
+use std::hash::{BuildHasher, Hash};
+use thin_vec::ThinVec;
+
+pub trait SpanlessEq {
+    fn eq(&self, other: &Self) -> bool;
+}
+
+impl<T: ?Sized + SpanlessEq> SpanlessEq for Box<T> {
+    fn eq(&self, other: &Self) -> bool {
+        SpanlessEq::eq(&**self, &**other)
+    }
+}
+
+impl<T: ?Sized + SpanlessEq> SpanlessEq for P<T> {
+    fn eq(&self, other: &Self) -> bool {
+        SpanlessEq::eq(&**self, &**other)
+    }
+}
+
+impl<T: ?Sized + SpanlessEq> SpanlessEq for Lrc<T> {
+    fn eq(&self, other: &Self) -> bool {
+        SpanlessEq::eq(&**self, &**other)
+    }
+}
+
+impl<T: SpanlessEq> SpanlessEq for Option<T> {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (None, None) => true,
+            (Some(this), Some(other)) => SpanlessEq::eq(this, other),
+            _ => false,
+        }
+    }
+}
+
+impl<T: SpanlessEq, E: SpanlessEq> SpanlessEq for Result<T, E> {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (Ok(this), Ok(other)) => SpanlessEq::eq(this, other),
+            (Err(this), Err(other)) => SpanlessEq::eq(this, other),
+            _ => false,
+        }
+    }
+}
+
+impl<T: SpanlessEq> SpanlessEq for [T] {
+    fn eq(&self, other: &Self) -> bool {
+        self.len() == other.len() && self.iter().zip(other).all(|(a, b)| SpanlessEq::eq(a, b))
+    }
+}
+
+impl<T: SpanlessEq> SpanlessEq for Vec<T> {
+    fn eq(&self, other: &Self) -> bool {
+        <[T] as SpanlessEq>::eq(self, other)
+    }
+}
+
+impl<T: SpanlessEq> SpanlessEq for ThinVec<T> {
+    fn eq(&self, other: &Self) -> bool {
+        self.len() == other.len()
+            && self
+                .iter()
+                .zip(other.iter())
+                .all(|(a, b)| SpanlessEq::eq(a, b))
+    }
+}
+
+impl<K: Eq + Hash, V: SpanlessEq, S: BuildHasher> SpanlessEq for HashMap<K, V, S> {
+    fn eq(&self, other: &Self) -> bool {
+        self.len() == other.len()
+            && self.iter().all(|(key, this_v)| {
+                other
+                    .get(key)
+                    .map_or(false, |other_v| SpanlessEq::eq(this_v, other_v))
+            })
+    }
+}
+
+impl<T: SpanlessEq> SpanlessEq for Spanned<T> {
+    fn eq(&self, other: &Self) -> bool {
+        SpanlessEq::eq(&self.node, &other.node)
+    }
+}
+
+impl<A: SpanlessEq, B: SpanlessEq> SpanlessEq for (A, B) {
+    fn eq(&self, other: &Self) -> bool {
+        SpanlessEq::eq(&self.0, &other.0) && SpanlessEq::eq(&self.1, &other.1)
+    }
+}
+
+impl<A: SpanlessEq, B: SpanlessEq, C: SpanlessEq> SpanlessEq for (A, B, C) {
+    fn eq(&self, other: &Self) -> bool {
+        SpanlessEq::eq(&self.0, &other.0)
+            && SpanlessEq::eq(&self.1, &other.1)
+            && SpanlessEq::eq(&self.2, &other.2)
+    }
+}
+
+macro_rules! spanless_eq_true {
+    ($name:ty) => {
+        impl SpanlessEq for $name {
+            fn eq(&self, _other: &Self) -> bool {
+                true
+            }
+        }
+    };
+}
+
+spanless_eq_true!(Span);
+spanless_eq_true!(DelimSpan);
+spanless_eq_true!(AttrId);
+spanless_eq_true!(NodeId);
+spanless_eq_true!(SyntaxContext);
+spanless_eq_true!(Spacing);
+
+macro_rules! spanless_eq_partial_eq {
+    ($name:ty) => {
+        impl SpanlessEq for $name {
+            fn eq(&self, other: &Self) -> bool {
+                PartialEq::eq(self, other)
+            }
+        }
+    };
+}
+
+spanless_eq_partial_eq!(bool);
+spanless_eq_partial_eq!(u8);
+spanless_eq_partial_eq!(u16);
+spanless_eq_partial_eq!(u32);
+spanless_eq_partial_eq!(u128);
+spanless_eq_partial_eq!(usize);
+spanless_eq_partial_eq!(char);
+spanless_eq_partial_eq!(String);
+spanless_eq_partial_eq!(Pu128);
+spanless_eq_partial_eq!(Symbol);
+spanless_eq_partial_eq!(CommentKind);
+spanless_eq_partial_eq!(Delimiter);
+spanless_eq_partial_eq!(InlineAsmOptions);
+spanless_eq_partial_eq!(token::LitKind);
+spanless_eq_partial_eq!(ErrorGuaranteed);
+
+macro_rules! spanless_eq_struct {
+    {
+        $($name:ident)::+ $(<$param:ident>)?
+        $([$field:tt $this:ident $other:ident])*
+        $(![$ignore:tt])*;
+    } => {
+        impl $(<$param: SpanlessEq>)* SpanlessEq for $($name)::+ $(<$param>)* {
+            fn eq(&self, other: &Self) -> bool {
+                let $($name)::+ { $($field: $this,)* $($ignore: _,)* } = self;
+                let $($name)::+ { $($field: $other,)* $($ignore: _,)* } = other;
+                true $(&& SpanlessEq::eq($this, $other))*
+            }
+        }
+    };
+
+    {
+        $($name:ident)::+ $(<$param:ident>)?
+        $([$field:tt $this:ident $other:ident])*
+        $(![$ignore:tt])*;
+        !$next:tt
+        $($rest:tt)*
+    } => {
+        spanless_eq_struct! {
+            $($name)::+ $(<$param>)*
+            $([$field $this $other])*
+            $(![$ignore])*
+            ![$next];
+            $($rest)*
+        }
+    };
+
+    {
+        $($name:ident)::+ $(<$param:ident>)?
+        $([$field:tt $this:ident $other:ident])*
+        $(![$ignore:tt])*;
+        $next:tt
+        $($rest:tt)*
+    } => {
+        spanless_eq_struct! {
+            $($name)::+ $(<$param>)*
+            $([$field $this $other])*
+            [$next this other]
+            $(![$ignore])*;
+            $($rest)*
+        }
+    };
+}
+
+macro_rules! spanless_eq_enum {
+    {
+        $($name:ident)::+;
+        $([$($variant:ident)::+; $([$field:tt $this:ident $other:ident])* $(![$ignore:tt])*])*
+    } => {
+        impl SpanlessEq for $($name)::+ {
+            fn eq(&self, other: &Self) -> bool {
+                match self {
+                    $(
+                        $($variant)::+ { .. } => {}
+                    )*
+                }
+                #[allow(unreachable_patterns)]
+                match (self, other) {
+                    $(
+                        (
+                            $($variant)::+ { $($field: $this,)* $($ignore: _,)* },
+                            $($variant)::+ { $($field: $other,)* $($ignore: _,)* },
+                        ) => {
+                            true $(&& SpanlessEq::eq($this, $other))*
+                        }
+                    )*
+                    _ => false,
+                }
+            }
+        }
+    };
+
+    {
+        $($name:ident)::+;
+        $([$($variant:ident)::+; $($fields:tt)*])*
+        $next:ident [$([$($named:tt)*])* $(![$ignore:tt])*] (!$i:tt $($field:tt)*)
+        $($rest:tt)*
+    } => {
+        spanless_eq_enum! {
+            $($name)::+;
+            $([$($variant)::+; $($fields)*])*
+            $next [$([$($named)*])* $(![$ignore])* ![$i]] ($($field)*)
+            $($rest)*
+        }
+    };
+
+    {
+        $($name:ident)::+;
+        $([$($variant:ident)::+; $($fields:tt)*])*
+        $next:ident [$([$($named:tt)*])* $(![$ignore:tt])*] ($i:tt $($field:tt)*)
+        $($rest:tt)*
+    } => {
+        spanless_eq_enum! {
+            $($name)::+;
+            $([$($variant)::+; $($fields)*])*
+            $next [$([$($named)*])* [$i this other] $(![$ignore])*] ($($field)*)
+            $($rest)*
+        }
+    };
+
+    {
+        $($name:ident)::+;
+        $([$($variant:ident)::+; $($fields:tt)*])*
+        $next:ident [$($named:tt)*] ()
+        $($rest:tt)*
+    } => {
+        spanless_eq_enum! {
+            $($name)::+;
+            $([$($variant)::+; $($fields)*])*
+            [$($name)::+::$next; $($named)*]
+            $($rest)*
+        }
+    };
+
+    {
+        $($name:ident)::+;
+        $([$($variant:ident)::+; $($fields:tt)*])*
+        $next:ident ($($field:tt)*)
+        $($rest:tt)*
+    } => {
+        spanless_eq_enum! {
+            $($name)::+;
+            $([$($variant)::+; $($fields)*])*
+            $next [] ($($field)*)
+            $($rest)*
+        }
+    };
+
+    {
+        $($name:ident)::+;
+        $([$($variant:ident)::+; $($fields:tt)*])*
+        $next:ident
+        $($rest:tt)*
+    } => {
+        spanless_eq_enum! {
+            $($name)::+;
+            $([$($variant)::+; $($fields)*])*
+            [$($name)::+::$next;]
+            $($rest)*
+        }
+    };
+}
+
+spanless_eq_struct!(AngleBracketedArgs; span args);
+spanless_eq_struct!(AnonConst; id value);
+spanless_eq_struct!(Arm; attrs pat guard body span id is_placeholder);
+spanless_eq_struct!(AssocItemConstraint; id ident gen_args kind span);
+spanless_eq_struct!(AttrItem; unsafety path args tokens);
+spanless_eq_struct!(AttrTokenStream; 0);
+spanless_eq_struct!(Attribute; kind id style span);
+spanless_eq_struct!(AttrsTarget; attrs tokens);
+spanless_eq_struct!(BareFnTy; safety ext generic_params decl decl_span);
+spanless_eq_struct!(BindingMode; 0 1);
+spanless_eq_struct!(Block; stmts id rules span tokens could_be_bare_literal);
+spanless_eq_struct!(Closure; binder capture_clause constness coroutine_kind movability fn_decl body !fn_decl_span !fn_arg_span);
+spanless_eq_struct!(ConstItem; defaultness generics ty expr);
+spanless_eq_struct!(Crate; attrs items spans id is_placeholder);
+spanless_eq_struct!(Delegation; id qself path rename body from_glob);
+spanless_eq_struct!(DelegationMac; qself prefix suffixes body);
+spanless_eq_struct!(DelimArgs; dspan delim tokens);
+spanless_eq_struct!(DelimSpacing; open close);
+spanless_eq_struct!(EnumDef; variants);
+spanless_eq_struct!(Expr; id kind span attrs !tokens);
+spanless_eq_struct!(ExprField; attrs id span ident expr is_shorthand is_placeholder);
+spanless_eq_struct!(FieldDef; attrs id span vis ident ty is_placeholder);
+spanless_eq_struct!(Fn; defaultness generics sig body);
+spanless_eq_struct!(FnDecl; inputs output);
+spanless_eq_struct!(FnHeader; constness coroutine_kind safety ext);
+spanless_eq_struct!(FnSig; header decl span);
+spanless_eq_struct!(ForeignMod; safety abi items);
+spanless_eq_struct!(FormatArgPosition; index kind span);
+spanless_eq_struct!(FormatArgs; span template arguments);
+spanless_eq_struct!(FormatArgument; kind expr);
+spanless_eq_struct!(FormatOptions; width precision alignment fill sign alternate zero_pad debug_hex);
+spanless_eq_struct!(FormatPlaceholder; argument span format_trait format_options);
+spanless_eq_struct!(GenericParam; id ident attrs bounds is_placeholder kind !colon_span);
+spanless_eq_struct!(Generics; params where_clause span);
+spanless_eq_struct!(Impl; defaultness safety generics constness polarity of_trait self_ty items);
+spanless_eq_struct!(InlineAsm; template template_strs operands clobber_abis options line_spans);
+spanless_eq_struct!(InlineAsmSym; id qself path);
+spanless_eq_struct!(Item<K>; attrs id span vis ident kind !tokens);
+spanless_eq_struct!(Label; ident);
+spanless_eq_struct!(Lifetime; id ident);
+spanless_eq_struct!(Lit; kind symbol suffix);
+spanless_eq_struct!(Local; id pat ty kind span colon_sp attrs !tokens);
+spanless_eq_struct!(MacCall; path args);
+spanless_eq_struct!(MacCallStmt; mac style attrs tokens);
+spanless_eq_struct!(MacroDef; body macro_rules);
+spanless_eq_struct!(MetaItem; unsafety path kind span);
+spanless_eq_struct!(MetaItemLit; symbol suffix kind span);
+spanless_eq_struct!(MethodCall; seg receiver args !span);
+spanless_eq_struct!(ModSpans; !inner_span !inject_use_span);
+spanless_eq_struct!(MutTy; ty mutbl);
+spanless_eq_struct!(NormalAttr; item tokens);
+spanless_eq_struct!(ParenthesizedArgs; span inputs inputs_span output);
+spanless_eq_struct!(Pat; id kind span tokens);
+spanless_eq_struct!(PatField; ident pat is_shorthand attrs id span is_placeholder);
+spanless_eq_struct!(Path; span segments tokens);
+spanless_eq_struct!(PathSegment; ident id args);
+spanless_eq_struct!(PolyTraitRef; bound_generic_params trait_ref span);
+spanless_eq_struct!(QSelf; ty path_span position);
+spanless_eq_struct!(StaticItem; ty safety mutability expr);
+spanless_eq_struct!(Stmt; id kind span);
+spanless_eq_struct!(StrLit; symbol suffix symbol_unescaped style span);
+spanless_eq_struct!(StructExpr; qself path fields rest);
+spanless_eq_struct!(Token; kind span);
+spanless_eq_struct!(Trait; safety is_auto generics bounds items);
+spanless_eq_struct!(TraitBoundModifiers; constness asyncness polarity);
+spanless_eq_struct!(TraitRef; path ref_id);
+spanless_eq_struct!(Ty; id kind span tokens);
+spanless_eq_struct!(TyAlias; defaultness generics where_clauses bounds ty);
+spanless_eq_struct!(TyAliasWhereClause; !has_where_token span);
+spanless_eq_struct!(TyAliasWhereClauses; before after !split);
+spanless_eq_struct!(UseTree; prefix kind span);
+spanless_eq_struct!(Variant; attrs id span !vis ident data disr_expr is_placeholder);
+spanless_eq_struct!(Visibility; kind span tokens);
+spanless_eq_struct!(WhereBoundPredicate; span bound_generic_params bounded_ty bounds);
+spanless_eq_struct!(WhereClause; has_where_token predicates span);
+spanless_eq_struct!(WhereEqPredicate; span lhs_ty rhs_ty);
+spanless_eq_struct!(WhereRegionPredicate; span lifetime bounds);
+spanless_eq_enum!(AngleBracketedArg; Arg(0) Constraint(0));
+spanless_eq_enum!(AssocItemConstraintKind; Equality(term) Bound(bounds));
+spanless_eq_enum!(AssocItemKind; Const(0) Fn(0) Type(0) MacCall(0) Delegation(0) DelegationMac(0));
+spanless_eq_enum!(AttrArgs; Empty Delimited(0) Eq(0 1));
+spanless_eq_enum!(AttrArgsEq; Ast(0) Hir(0));
+spanless_eq_enum!(AttrStyle; Outer Inner);
+spanless_eq_enum!(AttrTokenTree; Token(0 1) Delimited(0 1 2 3) AttrsTarget(0));
+spanless_eq_enum!(BinOpKind; Add Sub Mul Div Rem And Or BitXor BitAnd BitOr Shl Shr Eq Lt Le Ne Ge Gt);
+spanless_eq_enum!(BlockCheckMode; Default Unsafe(0));
+spanless_eq_enum!(BorrowKind; Ref Raw);
+spanless_eq_enum!(BoundAsyncness; Normal Async(0));
+spanless_eq_enum!(BoundConstness; Never Always(0) Maybe(0));
+spanless_eq_enum!(BoundPolarity; Positive Negative(0) Maybe(0));
+spanless_eq_enum!(ByRef; Yes(0) No);
+spanless_eq_enum!(CaptureBy; Value(move_kw) Ref);
+spanless_eq_enum!(ClosureBinder; NotPresent For(span generic_params));
+spanless_eq_enum!(Const; Yes(0) No);
+spanless_eq_enum!(Defaultness; Default(0) Final);
+spanless_eq_enum!(Extern; None Implicit(0) Explicit(0 1));
+spanless_eq_enum!(FloatTy; F16 F32 F64 F128);
+spanless_eq_enum!(FnRetTy; Default(0) Ty(0));
+spanless_eq_enum!(ForLoopKind; For ForAwait);
+spanless_eq_enum!(ForeignItemKind; Static(0) Fn(0) TyAlias(0) MacCall(0));
+spanless_eq_enum!(FormatAlignment; Left Right Center);
+spanless_eq_enum!(FormatArgPositionKind; Implicit Number Named);
+spanless_eq_enum!(FormatArgsPiece; Literal(0) Placeholder(0));
+spanless_eq_enum!(FormatArgumentKind; Normal Named(0) Captured(0));
+spanless_eq_enum!(FormatCount; Literal(0) Argument(0));
+spanless_eq_enum!(FormatDebugHex; Lower Upper);
+spanless_eq_enum!(FormatSign; Plus Minus);
+spanless_eq_enum!(FormatTrait; Display Debug LowerExp UpperExp Octal Pointer Binary LowerHex UpperHex);
+spanless_eq_enum!(GenBlockKind; Async Gen AsyncGen);
+spanless_eq_enum!(GenericArg; Lifetime(0) Type(0) Const(0));
+spanless_eq_enum!(GenericArgs; AngleBracketed(0) Parenthesized(0) ParenthesizedElided(0));
+spanless_eq_enum!(GenericBound; Trait(0 1) Outlives(0) Use(0 1));
+spanless_eq_enum!(GenericParamKind; Lifetime Type(default) Const(ty kw_span default));
+spanless_eq_enum!(ImplPolarity; Positive Negative(0));
+spanless_eq_enum!(Inline; Yes No);
+spanless_eq_enum!(InlineAsmRegOrRegClass; Reg(0) RegClass(0));
+spanless_eq_enum!(InlineAsmTemplatePiece; String(0) Placeholder(operand_idx modifier span));
+spanless_eq_enum!(IntTy; Isize I8 I16 I32 I64 I128);
+spanless_eq_enum!(IsAuto; Yes No);
+spanless_eq_enum!(LitFloatType; Suffixed(0) Unsuffixed);
+spanless_eq_enum!(LitIntType; Signed(0) Unsigned(0) Unsuffixed);
+spanless_eq_enum!(LocalKind; Decl Init(0) InitElse(0 1));
+spanless_eq_enum!(MacStmtStyle; Semicolon Braces NoBraces);
+spanless_eq_enum!(MatchKind; Prefix Postfix);
+spanless_eq_enum!(MetaItemKind; Word List(0) NameValue(0));
+spanless_eq_enum!(ModKind; Loaded(0 1 2) Unloaded);
+spanless_eq_enum!(Movability; Static Movable);
+spanless_eq_enum!(Mutability; Mut Not);
+spanless_eq_enum!(NestedMetaItem; MetaItem(0) Lit(0));
+spanless_eq_enum!(PatFieldsRest; Rest None);
+spanless_eq_enum!(PreciseCapturingArg; Lifetime(0) Arg(0 1));
+spanless_eq_enum!(RangeEnd; Included(0) Excluded);
+spanless_eq_enum!(RangeLimits; HalfOpen Closed);
+spanless_eq_enum!(Recovered; No Yes(0));
+spanless_eq_enum!(Safety; Unsafe(0) Safe(0) Default);
+spanless_eq_enum!(StmtKind; Let(0) Item(0) Expr(0) Semi(0) Empty MacCall(0));
+spanless_eq_enum!(StrStyle; Cooked Raw(0));
+spanless_eq_enum!(StructRest; Base(0) Rest(0) None);
+spanless_eq_enum!(Term; Ty(0) Const(0));
+spanless_eq_enum!(TokenTree; Token(0 1) Delimited(0 1 2 3));
+spanless_eq_enum!(TraitObjectSyntax; Dyn DynStar None);
+spanless_eq_enum!(UintTy; Usize U8 U16 U32 U64 U128);
+spanless_eq_enum!(UnOp; Deref Not Neg);
+spanless_eq_enum!(UnsafeSource; CompilerGenerated UserProvided);
+spanless_eq_enum!(UseTreeKind; Simple(0) Nested(items span) Glob);
+spanless_eq_enum!(VariantData; Struct(fields recovered) Tuple(0 1) Unit(0));
+spanless_eq_enum!(VisibilityKind; Public Restricted(path id shorthand) Inherited);
+spanless_eq_enum!(WherePredicate; BoundPredicate(0) RegionPredicate(0) EqPredicate(0));
+spanless_eq_enum!(CoroutineKind; Async(span closure_id return_impl_trait_id)
+    Gen(span closure_id return_impl_trait_id)
+    AsyncGen(span closure_id return_impl_trait_id));
+spanless_eq_enum!(ExprKind; Array(0) ConstBlock(0) Call(0 1) MethodCall(0)
+    Tup(0) Binary(0 1 2) Unary(0 1) Lit(0) Cast(0 1) Type(0 1) Let(0 1 2 3)
+    If(0 1 2) While(0 1 2) ForLoop(pat iter body label kind) Loop(0 1 2)
+    Match(0 1 2) Closure(0) Block(0 1) Gen(0 1 2 3) Await(0 1) TryBlock(0)
+    Assign(0 1 2) AssignOp(0 1 2) Field(0 1) Index(0 1 2) Underscore
+    Range(0 1 2) Path(0 1) AddrOf(0 1 2) Break(0 1) Continue(0) Ret(0)
+    InlineAsm(0) OffsetOf(0 1) MacCall(0) Struct(0) Repeat(0 1) Paren(0) Try(0)
+    Yield(0) Yeet(0) Become(0) IncludedBytes(0) FormatArgs(0) Err(0) Dummy);
+spanless_eq_enum!(InlineAsmOperand; In(reg expr) Out(reg late expr)
+    InOut(reg late expr) SplitInOut(reg late in_expr out_expr) Const(anon_const)
+    Sym(sym) Label(block));
+spanless_eq_enum!(ItemKind; ExternCrate(0) Use(0) Static(0) Const(0) Fn(0)
+    Mod(0 1) ForeignMod(0) GlobalAsm(0) TyAlias(0) Enum(0 1) Struct(0 1)
+    Union(0 1) Trait(0) TraitAlias(0 1) Impl(0) MacCall(0) MacroDef(0)
+    Delegation(0) DelegationMac(0));
+spanless_eq_enum!(LitKind; Str(0 1) ByteStr(0 1) CStr(0 1) Byte(0) Char(0)
+    Int(0 1) Float(0 1) Bool(0) Err(0));
+spanless_eq_enum!(PatKind; Wild Ident(0 1 2) Struct(0 1 2 3) TupleStruct(0 1 2)
+    Or(0) Path(0 1) Tuple(0) Box(0) Deref(0) Ref(0 1) Lit(0) Range(0 1 2)
+    Slice(0) Rest Never Paren(0) MacCall(0) Err(0));
+spanless_eq_enum!(TyKind; Slice(0) Array(0 1) Ptr(0) Ref(0 1) BareFn(0) Never
+    Tup(0) AnonStruct(0 1) AnonUnion(0 1) Path(0 1) TraitObject(0 1)
+    ImplTrait(0 1) Paren(0) Typeof(0) Infer ImplicitSelf MacCall(0) CVarArgs
+    Pat(0 1) Dummy Err(0));
+
+impl SpanlessEq for Ident {
+    fn eq(&self, other: &Self) -> bool {
+        self.as_str() == other.as_str()
+    }
+}
+
+impl SpanlessEq for RangeSyntax {
+    fn eq(&self, _other: &Self) -> bool {
+        match self {
+            RangeSyntax::DotDotDot | RangeSyntax::DotDotEq => true,
+        }
+    }
+}
+
+impl SpanlessEq for Param {
+    fn eq(&self, other: &Self) -> bool {
+        let Param {
+            attrs,
+            ty,
+            pat,
+            id,
+            span: _,
+            is_placeholder,
+        } = self;
+        let Param {
+            attrs: attrs2,
+            ty: ty2,
+            pat: pat2,
+            id: id2,
+            span: _,
+            is_placeholder: is_placeholder2,
+        } = other;
+        SpanlessEq::eq(id, id2)
+            && SpanlessEq::eq(is_placeholder, is_placeholder2)
+            && (matches!(ty.kind, TyKind::Err(_))
+                || matches!(ty2.kind, TyKind::Err(_))
+                || SpanlessEq::eq(attrs, attrs2)
+                    && SpanlessEq::eq(ty, ty2)
+                    && SpanlessEq::eq(pat, pat2))
+    }
+}
+
+impl SpanlessEq for TokenKind {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (TokenKind::Literal(this), TokenKind::Literal(other)) => SpanlessEq::eq(this, other),
+            (TokenKind::DotDotEq | TokenKind::DotDotDot, _) => match other {
+                TokenKind::DotDotEq | TokenKind::DotDotDot => true,
+                _ => false,
+            },
+            (TokenKind::Interpolated(this), TokenKind::Interpolated(other)) => {
+                let this = this.as_ref();
+                let other = other.as_ref();
+                match (this, other) {
+                    (Nonterminal::NtExpr(this), Nonterminal::NtExpr(other)) => {
+                        SpanlessEq::eq(this, other)
+                    }
+                    _ => this == other,
+                }
+            }
+            _ => self == other,
+        }
+    }
+}
+
+impl SpanlessEq for TokenStream {
+    fn eq(&self, other: &Self) -> bool {
+        let mut this_trees = self.trees();
+        let mut other_trees = other.trees();
+        loop {
+            let this = match this_trees.next() {
+                None => return other_trees.next().is_none(),
+                Some(tree) => tree,
+            };
+            let other = match other_trees.next() {
+                None => return false,
+                Some(tree) => tree,
+            };
+            if SpanlessEq::eq(this, other) {
+                continue;
+            }
+            if let (TokenTree::Token(this, _), TokenTree::Token(other, _)) = (this, other) {
+                if match (&this.kind, &other.kind) {
+                    (TokenKind::Literal(this), TokenKind::Literal(other)) => {
+                        SpanlessEq::eq(this, other)
+                    }
+                    (TokenKind::DocComment(_kind, style, symbol), TokenKind::Pound) => {
+                        doc_comment(*style, *symbol, &mut other_trees)
+                    }
+                    (TokenKind::Pound, TokenKind::DocComment(_kind, style, symbol)) => {
+                        doc_comment(*style, *symbol, &mut this_trees)
+                    }
+                    _ => false,
+                } {
+                    continue;
+                }
+            }
+            return false;
+        }
+    }
+}
+
+fn doc_comment<'a>(
+    style: AttrStyle,
+    unescaped: Symbol,
+    trees: &mut impl Iterator<Item = &'a TokenTree>,
+) -> bool {
+    if match style {
+        AttrStyle::Outer => false,
+        AttrStyle::Inner => true,
+    } {
+        match trees.next() {
+            Some(TokenTree::Token(
+                Token {
+                    kind: TokenKind::Not,
+                    span: _,
+                },
+                _spacing,
+            )) => {}
+            _ => return false,
+        }
+    }
+    let stream = match trees.next() {
+        Some(TokenTree::Delimited(_span, _spacing, Delimiter::Bracket, stream)) => stream,
+        _ => return false,
+    };
+    let mut trees = stream.trees();
+    match trees.next() {
+        Some(TokenTree::Token(
+            Token {
+                kind: TokenKind::Ident(symbol, IdentIsRaw::No),
+                span: _,
+            },
+            _spacing,
+        )) if *symbol == sym::doc => {}
+        _ => return false,
+    }
+    match trees.next() {
+        Some(TokenTree::Token(
+            Token {
+                kind: TokenKind::Eq,
+                span: _,
+            },
+            _spacing,
+        )) => {}
+        _ => return false,
+    }
+    match trees.next() {
+        Some(TokenTree::Token(token, _spacing)) => {
+            is_escaped_literal_token(token, unescaped) && trees.next().is_none()
+        }
+        _ => false,
+    }
+}
+
+fn is_escaped_literal_token(token: &Token, unescaped: Symbol) -> bool {
+    match token {
+        Token {
+            kind: TokenKind::Literal(lit),
+            span: _,
+        } => match MetaItemLit::from_token_lit(*lit, DUMMY_SP) {
+            Ok(lit) => is_escaped_literal_meta_item_lit(&lit, unescaped),
+            Err(_) => false,
+        },
+        Token {
+            kind: TokenKind::Interpolated(nonterminal),
+            span: _,
+        } => match nonterminal.as_ref() {
+            Nonterminal::NtExpr(expr) => match &expr.kind {
+                ExprKind::Lit(lit) => is_escaped_lit(lit, unescaped),
+                _ => false,
+            },
+            _ => false,
+        },
+        _ => false,
+    }
+}
+
+fn is_escaped_literal_attr_args(value: &AttrArgsEq, unescaped: Symbol) -> bool {
+    match value {
+        AttrArgsEq::Ast(expr) => match &expr.kind {
+            ExprKind::Lit(lit) => is_escaped_lit(lit, unescaped),
+            _ => false,
+        },
+        AttrArgsEq::Hir(lit) => is_escaped_literal_meta_item_lit(lit, unescaped),
+    }
+}
+
+fn is_escaped_literal_meta_item_lit(lit: &MetaItemLit, unescaped: Symbol) -> bool {
+    match lit {
+        MetaItemLit {
+            symbol: _,
+            suffix: None,
+            kind,
+            span: _,
+        } => is_escaped_lit_kind(kind, unescaped),
+        _ => false,
+    }
+}
+
+fn is_escaped_lit(lit: &Lit, unescaped: Symbol) -> bool {
+    match lit {
+        Lit {
+            kind: token::LitKind::Str,
+            symbol: _,
+            suffix: None,
+        } => match LitKind::from_token_lit(*lit) {
+            Ok(lit_kind) => is_escaped_lit_kind(&lit_kind, unescaped),
+            _ => false,
+        },
+        _ => false,
+    }
+}
+
+fn is_escaped_lit_kind(kind: &LitKind, unescaped: Symbol) -> bool {
+    match kind {
+        LitKind::Str(symbol, StrStyle::Cooked) => {
+            symbol.as_str().replace('\r', "") == unescaped.as_str().replace('\r', "")
+        }
+        _ => false,
+    }
+}
+
+impl SpanlessEq for LazyAttrTokenStream {
+    fn eq(&self, other: &Self) -> bool {
+        let this = self.to_attr_token_stream();
+        let other = other.to_attr_token_stream();
+        SpanlessEq::eq(&this, &other)
+    }
+}
+
+impl SpanlessEq for AttrKind {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (AttrKind::Normal(normal), AttrKind::Normal(normal2)) => {
+                SpanlessEq::eq(normal, normal2)
+            }
+            (AttrKind::DocComment(kind, symbol), AttrKind::DocComment(kind2, symbol2)) => {
+                SpanlessEq::eq(kind, kind2) && SpanlessEq::eq(symbol, symbol2)
+            }
+            (AttrKind::DocComment(kind, unescaped), AttrKind::Normal(normal2)) => {
+                match kind {
+                    CommentKind::Line | CommentKind::Block => {}
+                }
+                let path = Path::from_ident(Ident::with_dummy_span(sym::doc));
+                SpanlessEq::eq(&path, &normal2.item.path)
+                    && match &normal2.item.args {
+                        AttrArgs::Empty | AttrArgs::Delimited(_) => false,
+                        AttrArgs::Eq(_span, value) => {
+                            is_escaped_literal_attr_args(value, *unescaped)
+                        }
+                    }
+            }
+            (AttrKind::Normal(_), AttrKind::DocComment(..)) => SpanlessEq::eq(other, self),
+        }
+    }
+}
+
+impl SpanlessEq for FormatArguments {
+    fn eq(&self, other: &Self) -> bool {
+        SpanlessEq::eq(self.all_args(), other.all_args())
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/common/mod.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/common/mod.rs
--- 43.0.0-1/rust-vendor/syn/tests/common/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/common/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+#![allow(dead_code)]
+#![allow(clippy::module_name_repetitions, clippy::shadow_unrelated)]
+
+pub mod eq;
+pub mod parse;
diff -pruN 43.0.0-1/rust-vendor/syn/tests/common/parse.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/common/parse.rs
--- 43.0.0-1/rust-vendor/syn/tests/common/parse.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/common/parse.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,46 @@
+extern crate rustc_ast;
+extern crate rustc_driver;
+extern crate rustc_expand;
+extern crate rustc_parse as parse;
+extern crate rustc_session;
+extern crate rustc_span;
+
+use rustc_ast::ast;
+use rustc_ast::ptr::P;
+use rustc_session::parse::ParseSess;
+use rustc_span::FileName;
+use std::panic;
+
+pub fn librustc_expr(input: &str) -> Option<P<ast::Expr>> {
+    match panic::catch_unwind(|| {
+        let locale_resources = rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec();
+        let sess = ParseSess::new(locale_resources);
+        let name = FileName::Custom("test_precedence".to_string());
+        let mut parser = parse::new_parser_from_source_str(&sess, name, input.to_string()).unwrap();
+        let presult = parser.parse_expr();
+        match presult {
+            Ok(expr) => Some(expr),
+            Err(diagnostic) => {
+                diagnostic.emit();
+                None
+            }
+        }
+    }) {
+        Ok(Some(e)) => Some(e),
+        Ok(None) => None,
+        Err(_) => {
+            errorf!("librustc panicked\n");
+            None
+        }
+    }
+}
+
+pub fn syn_expr(input: &str) -> Option<syn::Expr> {
+    match syn::parse_str(input) {
+        Ok(e) => Some(e),
+        Err(msg) => {
+            errorf!("syn failed to parse\n{:?}\n", msg);
+            None
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/debug/gen.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/debug/gen.rs
--- 43.0.0-1/rust-vendor/syn/tests/debug/gen.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/debug/gen.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5163 @@
+// This file is @generated by syn-internal-codegen.
+// It is not intended for manual editing.
+
+#![allow(repr_transparent_external_private_fields)]
+#![allow(clippy::match_wildcard_for_single_variants)]
+use super::{Lite, Present};
+use ref_cast::RefCast;
+use std::fmt::{self, Debug, Display};
+impl Debug for Lite<syn::Abi> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Abi");
+        if let Some(val) = &self.value.name {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::LitStr);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("name", Print::ref_cast(val));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::AngleBracketedGenericArguments> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("AngleBracketedGenericArguments");
+        if self.value.colon2_token.is_some() {
+            formatter.field("colon2_token", &Present);
+        }
+        if !self.value.args.is_empty() {
+            formatter.field("args", Lite(&self.value.args));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::Arm> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Arm");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("pat", Lite(&self.value.pat));
+        if let Some(val) = &self.value.guard {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print((syn::token::If, Box<syn::Expr>));
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0.1), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("guard", Print::ref_cast(val));
+        }
+        formatter.field("body", Lite(&self.value.body));
+        if self.value.comma.is_some() {
+            formatter.field("comma", &Present);
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::AssocConst> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("AssocConst");
+        formatter.field("ident", Lite(&self.value.ident));
+        if let Some(val) = &self.value.generics {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::AngleBracketedGenericArguments);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("generics", Print::ref_cast(val));
+        }
+        formatter.field("value", Lite(&self.value.value));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::AssocType> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("AssocType");
+        formatter.field("ident", Lite(&self.value.ident));
+        if let Some(val) = &self.value.generics {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::AngleBracketedGenericArguments);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("generics", Print::ref_cast(val));
+        }
+        formatter.field("ty", Lite(&self.value.ty));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::AttrStyle> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::AttrStyle::Outer => formatter.write_str("AttrStyle::Outer"),
+            syn::AttrStyle::Inner(_val) => {
+                formatter.write_str("AttrStyle::Inner")?;
+                Ok(())
+            }
+        }
+    }
+}
+impl Debug for Lite<syn::Attribute> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Attribute");
+        formatter.field("style", Lite(&self.value.style));
+        formatter.field("meta", Lite(&self.value.meta));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::BareFnArg> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("BareFnArg");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if let Some(val) = &self.value.name {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print((proc_macro2::Ident, syn::token::Colon));
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("name", Print::ref_cast(val));
+        }
+        formatter.field("ty", Lite(&self.value.ty));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::BareVariadic> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("BareVariadic");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if let Some(val) = &self.value.name {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print((proc_macro2::Ident, syn::token::Colon));
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("name", Print::ref_cast(val));
+        }
+        if self.value.comma.is_some() {
+            formatter.field("comma", &Present);
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::BinOp> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::BinOp::Add(_val) => {
+                formatter.write_str("BinOp::Add")?;
+                Ok(())
+            }
+            syn::BinOp::Sub(_val) => {
+                formatter.write_str("BinOp::Sub")?;
+                Ok(())
+            }
+            syn::BinOp::Mul(_val) => {
+                formatter.write_str("BinOp::Mul")?;
+                Ok(())
+            }
+            syn::BinOp::Div(_val) => {
+                formatter.write_str("BinOp::Div")?;
+                Ok(())
+            }
+            syn::BinOp::Rem(_val) => {
+                formatter.write_str("BinOp::Rem")?;
+                Ok(())
+            }
+            syn::BinOp::And(_val) => {
+                formatter.write_str("BinOp::And")?;
+                Ok(())
+            }
+            syn::BinOp::Or(_val) => {
+                formatter.write_str("BinOp::Or")?;
+                Ok(())
+            }
+            syn::BinOp::BitXor(_val) => {
+                formatter.write_str("BinOp::BitXor")?;
+                Ok(())
+            }
+            syn::BinOp::BitAnd(_val) => {
+                formatter.write_str("BinOp::BitAnd")?;
+                Ok(())
+            }
+            syn::BinOp::BitOr(_val) => {
+                formatter.write_str("BinOp::BitOr")?;
+                Ok(())
+            }
+            syn::BinOp::Shl(_val) => {
+                formatter.write_str("BinOp::Shl")?;
+                Ok(())
+            }
+            syn::BinOp::Shr(_val) => {
+                formatter.write_str("BinOp::Shr")?;
+                Ok(())
+            }
+            syn::BinOp::Eq(_val) => {
+                formatter.write_str("BinOp::Eq")?;
+                Ok(())
+            }
+            syn::BinOp::Lt(_val) => {
+                formatter.write_str("BinOp::Lt")?;
+                Ok(())
+            }
+            syn::BinOp::Le(_val) => {
+                formatter.write_str("BinOp::Le")?;
+                Ok(())
+            }
+            syn::BinOp::Ne(_val) => {
+                formatter.write_str("BinOp::Ne")?;
+                Ok(())
+            }
+            syn::BinOp::Ge(_val) => {
+                formatter.write_str("BinOp::Ge")?;
+                Ok(())
+            }
+            syn::BinOp::Gt(_val) => {
+                formatter.write_str("BinOp::Gt")?;
+                Ok(())
+            }
+            syn::BinOp::AddAssign(_val) => {
+                formatter.write_str("BinOp::AddAssign")?;
+                Ok(())
+            }
+            syn::BinOp::SubAssign(_val) => {
+                formatter.write_str("BinOp::SubAssign")?;
+                Ok(())
+            }
+            syn::BinOp::MulAssign(_val) => {
+                formatter.write_str("BinOp::MulAssign")?;
+                Ok(())
+            }
+            syn::BinOp::DivAssign(_val) => {
+                formatter.write_str("BinOp::DivAssign")?;
+                Ok(())
+            }
+            syn::BinOp::RemAssign(_val) => {
+                formatter.write_str("BinOp::RemAssign")?;
+                Ok(())
+            }
+            syn::BinOp::BitXorAssign(_val) => {
+                formatter.write_str("BinOp::BitXorAssign")?;
+                Ok(())
+            }
+            syn::BinOp::BitAndAssign(_val) => {
+                formatter.write_str("BinOp::BitAndAssign")?;
+                Ok(())
+            }
+            syn::BinOp::BitOrAssign(_val) => {
+                formatter.write_str("BinOp::BitOrAssign")?;
+                Ok(())
+            }
+            syn::BinOp::ShlAssign(_val) => {
+                formatter.write_str("BinOp::ShlAssign")?;
+                Ok(())
+            }
+            syn::BinOp::ShrAssign(_val) => {
+                formatter.write_str("BinOp::ShrAssign")?;
+                Ok(())
+            }
+            _ => unreachable!(),
+        }
+    }
+}
+impl Debug for Lite<syn::Block> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Block");
+        formatter.field("stmts", Lite(&self.value.stmts));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::BoundLifetimes> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("BoundLifetimes");
+        if !self.value.lifetimes.is_empty() {
+            formatter.field("lifetimes", Lite(&self.value.lifetimes));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ConstParam> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ConstParam");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.field("ty", Lite(&self.value.ty));
+        if self.value.eq_token.is_some() {
+            formatter.field("eq_token", &Present);
+        }
+        if let Some(val) = &self.value.default {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::Expr);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("default", Print::ref_cast(val));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::Constraint> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Constraint");
+        formatter.field("ident", Lite(&self.value.ident));
+        if let Some(val) = &self.value.generics {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::AngleBracketedGenericArguments);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("generics", Print::ref_cast(val));
+        }
+        if !self.value.bounds.is_empty() {
+            formatter.field("bounds", Lite(&self.value.bounds));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::Data> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::Data::Struct(_val) => {
+                let mut formatter = formatter.debug_struct("Data::Struct");
+                formatter.field("fields", Lite(&_val.fields));
+                if _val.semi_token.is_some() {
+                    formatter.field("semi_token", &Present);
+                }
+                formatter.finish()
+            }
+            syn::Data::Enum(_val) => {
+                let mut formatter = formatter.debug_struct("Data::Enum");
+                if !_val.variants.is_empty() {
+                    formatter.field("variants", Lite(&_val.variants));
+                }
+                formatter.finish()
+            }
+            syn::Data::Union(_val) => {
+                let mut formatter = formatter.debug_struct("Data::Union");
+                formatter.field("fields", Lite(&_val.fields));
+                formatter.finish()
+            }
+        }
+    }
+}
+impl Debug for Lite<syn::DataEnum> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("DataEnum");
+        if !self.value.variants.is_empty() {
+            formatter.field("variants", Lite(&self.value.variants));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::DataStruct> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("DataStruct");
+        formatter.field("fields", Lite(&self.value.fields));
+        if self.value.semi_token.is_some() {
+            formatter.field("semi_token", &Present);
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::DataUnion> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("DataUnion");
+        formatter.field("fields", Lite(&self.value.fields));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::DeriveInput> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("DeriveInput");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("vis", Lite(&self.value.vis));
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.field("generics", Lite(&self.value.generics));
+        formatter.field("data", Lite(&self.value.data));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::Expr> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::Expr::Array(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Array");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if !_val.elems.is_empty() {
+                    formatter.field("elems", Lite(&_val.elems));
+                }
+                formatter.finish()
+            }
+            syn::Expr::Assign(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Assign");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("left", Lite(&_val.left));
+                formatter.field("right", Lite(&_val.right));
+                formatter.finish()
+            }
+            syn::Expr::Async(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Async");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if _val.capture.is_some() {
+                    formatter.field("capture", &Present);
+                }
+                formatter.field("block", Lite(&_val.block));
+                formatter.finish()
+            }
+            syn::Expr::Await(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Await");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("base", Lite(&_val.base));
+                formatter.finish()
+            }
+            syn::Expr::Binary(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Binary");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("left", Lite(&_val.left));
+                formatter.field("op", Lite(&_val.op));
+                formatter.field("right", Lite(&_val.right));
+                formatter.finish()
+            }
+            syn::Expr::Block(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Block");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if let Some(val) = &_val.label {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::Label);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("label", Print::ref_cast(val));
+                }
+                formatter.field("block", Lite(&_val.block));
+                formatter.finish()
+            }
+            syn::Expr::Break(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Break");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if let Some(val) = &_val.label {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::Lifetime);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("label", Print::ref_cast(val));
+                }
+                if let Some(val) = &_val.expr {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(Box<syn::Expr>);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("expr", Print::ref_cast(val));
+                }
+                formatter.finish()
+            }
+            syn::Expr::Call(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Call");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("func", Lite(&_val.func));
+                if !_val.args.is_empty() {
+                    formatter.field("args", Lite(&_val.args));
+                }
+                formatter.finish()
+            }
+            syn::Expr::Cast(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Cast");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("expr", Lite(&_val.expr));
+                formatter.field("ty", Lite(&_val.ty));
+                formatter.finish()
+            }
+            syn::Expr::Closure(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Closure");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if let Some(val) = &_val.lifetimes {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::BoundLifetimes);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("lifetimes", Print::ref_cast(val));
+                }
+                if _val.constness.is_some() {
+                    formatter.field("constness", &Present);
+                }
+                if _val.movability.is_some() {
+                    formatter.field("movability", &Present);
+                }
+                if _val.asyncness.is_some() {
+                    formatter.field("asyncness", &Present);
+                }
+                if _val.capture.is_some() {
+                    formatter.field("capture", &Present);
+                }
+                if !_val.inputs.is_empty() {
+                    formatter.field("inputs", Lite(&_val.inputs));
+                }
+                formatter.field("output", Lite(&_val.output));
+                formatter.field("body", Lite(&_val.body));
+                formatter.finish()
+            }
+            syn::Expr::Const(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Const");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("block", Lite(&_val.block));
+                formatter.finish()
+            }
+            syn::Expr::Continue(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Continue");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if let Some(val) = &_val.label {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::Lifetime);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("label", Print::ref_cast(val));
+                }
+                formatter.finish()
+            }
+            syn::Expr::Field(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Field");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("base", Lite(&_val.base));
+                formatter.field("member", Lite(&_val.member));
+                formatter.finish()
+            }
+            syn::Expr::ForLoop(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::ForLoop");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if let Some(val) = &_val.label {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::Label);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("label", Print::ref_cast(val));
+                }
+                formatter.field("pat", Lite(&_val.pat));
+                formatter.field("expr", Lite(&_val.expr));
+                formatter.field("body", Lite(&_val.body));
+                formatter.finish()
+            }
+            syn::Expr::Group(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Group");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("expr", Lite(&_val.expr));
+                formatter.finish()
+            }
+            syn::Expr::If(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::If");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("cond", Lite(&_val.cond));
+                formatter.field("then_branch", Lite(&_val.then_branch));
+                if let Some(val) = &_val.else_branch {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print((syn::token::Else, Box<syn::Expr>));
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0.1), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("else_branch", Print::ref_cast(val));
+                }
+                formatter.finish()
+            }
+            syn::Expr::Index(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Index");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("expr", Lite(&_val.expr));
+                formatter.field("index", Lite(&_val.index));
+                formatter.finish()
+            }
+            syn::Expr::Infer(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Infer");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.finish()
+            }
+            syn::Expr::Let(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Let");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("pat", Lite(&_val.pat));
+                formatter.field("expr", Lite(&_val.expr));
+                formatter.finish()
+            }
+            syn::Expr::Lit(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Lit");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("lit", Lite(&_val.lit));
+                formatter.finish()
+            }
+            syn::Expr::Loop(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Loop");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if let Some(val) = &_val.label {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::Label);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("label", Print::ref_cast(val));
+                }
+                formatter.field("body", Lite(&_val.body));
+                formatter.finish()
+            }
+            syn::Expr::Macro(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Macro");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("mac", Lite(&_val.mac));
+                formatter.finish()
+            }
+            syn::Expr::Match(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Match");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("expr", Lite(&_val.expr));
+                if !_val.arms.is_empty() {
+                    formatter.field("arms", Lite(&_val.arms));
+                }
+                formatter.finish()
+            }
+            syn::Expr::MethodCall(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::MethodCall");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("receiver", Lite(&_val.receiver));
+                formatter.field("method", Lite(&_val.method));
+                if let Some(val) = &_val.turbofish {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::AngleBracketedGenericArguments);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("turbofish", Print::ref_cast(val));
+                }
+                if !_val.args.is_empty() {
+                    formatter.field("args", Lite(&_val.args));
+                }
+                formatter.finish()
+            }
+            syn::Expr::Paren(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Paren");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("expr", Lite(&_val.expr));
+                formatter.finish()
+            }
+            syn::Expr::Path(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Path");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if let Some(val) = &_val.qself {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::QSelf);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("qself", Print::ref_cast(val));
+                }
+                formatter.field("path", Lite(&_val.path));
+                formatter.finish()
+            }
+            syn::Expr::Range(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Range");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if let Some(val) = &_val.start {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(Box<syn::Expr>);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("start", Print::ref_cast(val));
+                }
+                formatter.field("limits", Lite(&_val.limits));
+                if let Some(val) = &_val.end {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(Box<syn::Expr>);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("end", Print::ref_cast(val));
+                }
+                formatter.finish()
+            }
+            syn::Expr::Reference(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Reference");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if _val.mutability.is_some() {
+                    formatter.field("mutability", &Present);
+                }
+                formatter.field("expr", Lite(&_val.expr));
+                formatter.finish()
+            }
+            syn::Expr::Repeat(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Repeat");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("expr", Lite(&_val.expr));
+                formatter.field("len", Lite(&_val.len));
+                formatter.finish()
+            }
+            syn::Expr::Return(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Return");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if let Some(val) = &_val.expr {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(Box<syn::Expr>);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("expr", Print::ref_cast(val));
+                }
+                formatter.finish()
+            }
+            syn::Expr::Struct(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Struct");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if let Some(val) = &_val.qself {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::QSelf);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("qself", Print::ref_cast(val));
+                }
+                formatter.field("path", Lite(&_val.path));
+                if !_val.fields.is_empty() {
+                    formatter.field("fields", Lite(&_val.fields));
+                }
+                if _val.dot2_token.is_some() {
+                    formatter.field("dot2_token", &Present);
+                }
+                if let Some(val) = &_val.rest {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(Box<syn::Expr>);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("rest", Print::ref_cast(val));
+                }
+                formatter.finish()
+            }
+            syn::Expr::Try(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Try");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("expr", Lite(&_val.expr));
+                formatter.finish()
+            }
+            syn::Expr::TryBlock(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::TryBlock");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("block", Lite(&_val.block));
+                formatter.finish()
+            }
+            syn::Expr::Tuple(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Tuple");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if !_val.elems.is_empty() {
+                    formatter.field("elems", Lite(&_val.elems));
+                }
+                formatter.finish()
+            }
+            syn::Expr::Unary(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Unary");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("op", Lite(&_val.op));
+                formatter.field("expr", Lite(&_val.expr));
+                formatter.finish()
+            }
+            syn::Expr::Unsafe(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Unsafe");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("block", Lite(&_val.block));
+                formatter.finish()
+            }
+            syn::Expr::Verbatim(_val) => {
+                formatter.write_str("Expr::Verbatim")?;
+                formatter.write_str("(`")?;
+                Display::fmt(_val, formatter)?;
+                formatter.write_str("`)")?;
+                Ok(())
+            }
+            syn::Expr::While(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::While");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if let Some(val) = &_val.label {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::Label);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("label", Print::ref_cast(val));
+                }
+                formatter.field("cond", Lite(&_val.cond));
+                formatter.field("body", Lite(&_val.body));
+                formatter.finish()
+            }
+            syn::Expr::Yield(_val) => {
+                let mut formatter = formatter.debug_struct("Expr::Yield");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if let Some(val) = &_val.expr {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(Box<syn::Expr>);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("expr", Print::ref_cast(val));
+                }
+                formatter.finish()
+            }
+            _ => unreachable!(),
+        }
+    }
+}
+impl Debug for Lite<syn::ExprArray> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprArray");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if !self.value.elems.is_empty() {
+            formatter.field("elems", Lite(&self.value.elems));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprAssign> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprAssign");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("left", Lite(&self.value.left));
+        formatter.field("right", Lite(&self.value.right));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprAsync> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprAsync");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if self.value.capture.is_some() {
+            formatter.field("capture", &Present);
+        }
+        formatter.field("block", Lite(&self.value.block));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprAwait> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprAwait");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("base", Lite(&self.value.base));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprBinary> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprBinary");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("left", Lite(&self.value.left));
+        formatter.field("op", Lite(&self.value.op));
+        formatter.field("right", Lite(&self.value.right));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprBlock> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprBlock");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if let Some(val) = &self.value.label {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::Label);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("label", Print::ref_cast(val));
+        }
+        formatter.field("block", Lite(&self.value.block));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprBreak> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprBreak");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if let Some(val) = &self.value.label {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::Lifetime);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("label", Print::ref_cast(val));
+        }
+        if let Some(val) = &self.value.expr {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(Box<syn::Expr>);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("expr", Print::ref_cast(val));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprCall> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprCall");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("func", Lite(&self.value.func));
+        if !self.value.args.is_empty() {
+            formatter.field("args", Lite(&self.value.args));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprCast> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprCast");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("expr", Lite(&self.value.expr));
+        formatter.field("ty", Lite(&self.value.ty));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprClosure> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprClosure");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if let Some(val) = &self.value.lifetimes {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::BoundLifetimes);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("lifetimes", Print::ref_cast(val));
+        }
+        if self.value.constness.is_some() {
+            formatter.field("constness", &Present);
+        }
+        if self.value.movability.is_some() {
+            formatter.field("movability", &Present);
+        }
+        if self.value.asyncness.is_some() {
+            formatter.field("asyncness", &Present);
+        }
+        if self.value.capture.is_some() {
+            formatter.field("capture", &Present);
+        }
+        if !self.value.inputs.is_empty() {
+            formatter.field("inputs", Lite(&self.value.inputs));
+        }
+        formatter.field("output", Lite(&self.value.output));
+        formatter.field("body", Lite(&self.value.body));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprConst> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprConst");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("block", Lite(&self.value.block));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprContinue> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprContinue");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if let Some(val) = &self.value.label {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::Lifetime);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("label", Print::ref_cast(val));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprField> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprField");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("base", Lite(&self.value.base));
+        formatter.field("member", Lite(&self.value.member));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprForLoop> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprForLoop");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if let Some(val) = &self.value.label {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::Label);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("label", Print::ref_cast(val));
+        }
+        formatter.field("pat", Lite(&self.value.pat));
+        formatter.field("expr", Lite(&self.value.expr));
+        formatter.field("body", Lite(&self.value.body));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprGroup> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprGroup");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("expr", Lite(&self.value.expr));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprIf> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprIf");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("cond", Lite(&self.value.cond));
+        formatter.field("then_branch", Lite(&self.value.then_branch));
+        if let Some(val) = &self.value.else_branch {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print((syn::token::Else, Box<syn::Expr>));
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0.1), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("else_branch", Print::ref_cast(val));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprIndex> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprIndex");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("expr", Lite(&self.value.expr));
+        formatter.field("index", Lite(&self.value.index));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprInfer> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprInfer");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprLet> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprLet");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("pat", Lite(&self.value.pat));
+        formatter.field("expr", Lite(&self.value.expr));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprLit> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprLit");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("lit", Lite(&self.value.lit));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprLoop> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprLoop");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if let Some(val) = &self.value.label {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::Label);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("label", Print::ref_cast(val));
+        }
+        formatter.field("body", Lite(&self.value.body));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprMacro> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprMacro");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("mac", Lite(&self.value.mac));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprMatch> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprMatch");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("expr", Lite(&self.value.expr));
+        if !self.value.arms.is_empty() {
+            formatter.field("arms", Lite(&self.value.arms));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprMethodCall> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprMethodCall");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("receiver", Lite(&self.value.receiver));
+        formatter.field("method", Lite(&self.value.method));
+        if let Some(val) = &self.value.turbofish {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::AngleBracketedGenericArguments);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("turbofish", Print::ref_cast(val));
+        }
+        if !self.value.args.is_empty() {
+            formatter.field("args", Lite(&self.value.args));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprParen> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprParen");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("expr", Lite(&self.value.expr));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprPath> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprPath");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if let Some(val) = &self.value.qself {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::QSelf);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("qself", Print::ref_cast(val));
+        }
+        formatter.field("path", Lite(&self.value.path));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprRange> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprRange");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if let Some(val) = &self.value.start {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(Box<syn::Expr>);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("start", Print::ref_cast(val));
+        }
+        formatter.field("limits", Lite(&self.value.limits));
+        if let Some(val) = &self.value.end {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(Box<syn::Expr>);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("end", Print::ref_cast(val));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprReference> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprReference");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if self.value.mutability.is_some() {
+            formatter.field("mutability", &Present);
+        }
+        formatter.field("expr", Lite(&self.value.expr));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprRepeat> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprRepeat");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("expr", Lite(&self.value.expr));
+        formatter.field("len", Lite(&self.value.len));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprReturn> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprReturn");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if let Some(val) = &self.value.expr {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(Box<syn::Expr>);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("expr", Print::ref_cast(val));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprStruct> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprStruct");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if let Some(val) = &self.value.qself {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::QSelf);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("qself", Print::ref_cast(val));
+        }
+        formatter.field("path", Lite(&self.value.path));
+        if !self.value.fields.is_empty() {
+            formatter.field("fields", Lite(&self.value.fields));
+        }
+        if self.value.dot2_token.is_some() {
+            formatter.field("dot2_token", &Present);
+        }
+        if let Some(val) = &self.value.rest {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(Box<syn::Expr>);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("rest", Print::ref_cast(val));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprTry> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprTry");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("expr", Lite(&self.value.expr));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprTryBlock> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprTryBlock");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("block", Lite(&self.value.block));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprTuple> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprTuple");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if !self.value.elems.is_empty() {
+            formatter.field("elems", Lite(&self.value.elems));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprUnary> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprUnary");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("op", Lite(&self.value.op));
+        formatter.field("expr", Lite(&self.value.expr));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprUnsafe> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprUnsafe");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("block", Lite(&self.value.block));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprWhile> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprWhile");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if let Some(val) = &self.value.label {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::Label);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("label", Print::ref_cast(val));
+        }
+        formatter.field("cond", Lite(&self.value.cond));
+        formatter.field("body", Lite(&self.value.body));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ExprYield> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ExprYield");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if let Some(val) = &self.value.expr {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(Box<syn::Expr>);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("expr", Print::ref_cast(val));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::Field> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Field");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("vis", Lite(&self.value.vis));
+        match self.value.mutability {
+            syn::FieldMutability::None => {}
+            _ => {
+                formatter.field("mutability", Lite(&self.value.mutability));
+            }
+        }
+        if let Some(val) = &self.value.ident {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(proc_macro2::Ident);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("ident", Print::ref_cast(val));
+        }
+        if self.value.colon_token.is_some() {
+            formatter.field("colon_token", &Present);
+        }
+        formatter.field("ty", Lite(&self.value.ty));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::FieldMutability> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::FieldMutability::None => formatter.write_str("FieldMutability::None"),
+            _ => unreachable!(),
+        }
+    }
+}
+impl Debug for Lite<syn::FieldPat> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("FieldPat");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("member", Lite(&self.value.member));
+        if self.value.colon_token.is_some() {
+            formatter.field("colon_token", &Present);
+        }
+        formatter.field("pat", Lite(&self.value.pat));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::FieldValue> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("FieldValue");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("member", Lite(&self.value.member));
+        if self.value.colon_token.is_some() {
+            formatter.field("colon_token", &Present);
+        }
+        formatter.field("expr", Lite(&self.value.expr));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::Fields> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::Fields::Named(_val) => {
+                let mut formatter = formatter.debug_struct("Fields::Named");
+                if !_val.named.is_empty() {
+                    formatter.field("named", Lite(&_val.named));
+                }
+                formatter.finish()
+            }
+            syn::Fields::Unnamed(_val) => {
+                let mut formatter = formatter.debug_struct("Fields::Unnamed");
+                if !_val.unnamed.is_empty() {
+                    formatter.field("unnamed", Lite(&_val.unnamed));
+                }
+                formatter.finish()
+            }
+            syn::Fields::Unit => formatter.write_str("Fields::Unit"),
+        }
+    }
+}
+impl Debug for Lite<syn::FieldsNamed> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("FieldsNamed");
+        if !self.value.named.is_empty() {
+            formatter.field("named", Lite(&self.value.named));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::FieldsUnnamed> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("FieldsUnnamed");
+        if !self.value.unnamed.is_empty() {
+            formatter.field("unnamed", Lite(&self.value.unnamed));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::File> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("File");
+        if let Some(val) = &self.value.shebang {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(String);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("shebang", Print::ref_cast(val));
+        }
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if !self.value.items.is_empty() {
+            formatter.field("items", Lite(&self.value.items));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::FnArg> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::FnArg::Receiver(_val) => {
+                formatter.write_str("FnArg::Receiver")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::FnArg::Typed(_val) => {
+                formatter.write_str("FnArg::Typed")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+        }
+    }
+}
+impl Debug for Lite<syn::ForeignItem> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::ForeignItem::Fn(_val) => {
+                let mut formatter = formatter.debug_struct("ForeignItem::Fn");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("vis", Lite(&_val.vis));
+                formatter.field("sig", Lite(&_val.sig));
+                formatter.finish()
+            }
+            syn::ForeignItem::Static(_val) => {
+                let mut formatter = formatter.debug_struct("ForeignItem::Static");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("vis", Lite(&_val.vis));
+                match _val.mutability {
+                    syn::StaticMutability::None => {}
+                    _ => {
+                        formatter.field("mutability", Lite(&_val.mutability));
+                    }
+                }
+                formatter.field("ident", Lite(&_val.ident));
+                formatter.field("ty", Lite(&_val.ty));
+                formatter.finish()
+            }
+            syn::ForeignItem::Type(_val) => {
+                let mut formatter = formatter.debug_struct("ForeignItem::Type");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("vis", Lite(&_val.vis));
+                formatter.field("ident", Lite(&_val.ident));
+                formatter.field("generics", Lite(&_val.generics));
+                formatter.finish()
+            }
+            syn::ForeignItem::Macro(_val) => {
+                let mut formatter = formatter.debug_struct("ForeignItem::Macro");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("mac", Lite(&_val.mac));
+                if _val.semi_token.is_some() {
+                    formatter.field("semi_token", &Present);
+                }
+                formatter.finish()
+            }
+            syn::ForeignItem::Verbatim(_val) => {
+                formatter.write_str("ForeignItem::Verbatim")?;
+                formatter.write_str("(`")?;
+                Display::fmt(_val, formatter)?;
+                formatter.write_str("`)")?;
+                Ok(())
+            }
+            _ => unreachable!(),
+        }
+    }
+}
+impl Debug for Lite<syn::ForeignItemFn> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ForeignItemFn");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("vis", Lite(&self.value.vis));
+        formatter.field("sig", Lite(&self.value.sig));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ForeignItemMacro> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ForeignItemMacro");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("mac", Lite(&self.value.mac));
+        if self.value.semi_token.is_some() {
+            formatter.field("semi_token", &Present);
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ForeignItemStatic> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ForeignItemStatic");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("vis", Lite(&self.value.vis));
+        match self.value.mutability {
+            syn::StaticMutability::None => {}
+            _ => {
+                formatter.field("mutability", Lite(&self.value.mutability));
+            }
+        }
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.field("ty", Lite(&self.value.ty));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ForeignItemType> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ForeignItemType");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("vis", Lite(&self.value.vis));
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.field("generics", Lite(&self.value.generics));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::GenericArgument> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::GenericArgument::Lifetime(_val) => {
+                formatter.write_str("GenericArgument::Lifetime")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::GenericArgument::Type(_val) => {
+                formatter.write_str("GenericArgument::Type")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::GenericArgument::Const(_val) => {
+                formatter.write_str("GenericArgument::Const")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::GenericArgument::AssocType(_val) => {
+                formatter.write_str("GenericArgument::AssocType")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::GenericArgument::AssocConst(_val) => {
+                formatter.write_str("GenericArgument::AssocConst")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::GenericArgument::Constraint(_val) => {
+                formatter.write_str("GenericArgument::Constraint")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            _ => unreachable!(),
+        }
+    }
+}
+impl Debug for Lite<syn::GenericParam> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::GenericParam::Lifetime(_val) => {
+                formatter.write_str("GenericParam::Lifetime")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::GenericParam::Type(_val) => {
+                formatter.write_str("GenericParam::Type")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::GenericParam::Const(_val) => {
+                formatter.write_str("GenericParam::Const")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+        }
+    }
+}
+impl Debug for Lite<syn::Generics> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Generics");
+        if self.value.lt_token.is_some() {
+            formatter.field("lt_token", &Present);
+        }
+        if !self.value.params.is_empty() {
+            formatter.field("params", Lite(&self.value.params));
+        }
+        if self.value.gt_token.is_some() {
+            formatter.field("gt_token", &Present);
+        }
+        if let Some(val) = &self.value.where_clause {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::WhereClause);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("where_clause", Print::ref_cast(val));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ImplItem> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::ImplItem::Const(_val) => {
+                let mut formatter = formatter.debug_struct("ImplItem::Const");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("vis", Lite(&_val.vis));
+                if _val.defaultness.is_some() {
+                    formatter.field("defaultness", &Present);
+                }
+                formatter.field("ident", Lite(&_val.ident));
+                formatter.field("generics", Lite(&_val.generics));
+                formatter.field("ty", Lite(&_val.ty));
+                formatter.field("expr", Lite(&_val.expr));
+                formatter.finish()
+            }
+            syn::ImplItem::Fn(_val) => {
+                let mut formatter = formatter.debug_struct("ImplItem::Fn");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("vis", Lite(&_val.vis));
+                if _val.defaultness.is_some() {
+                    formatter.field("defaultness", &Present);
+                }
+                formatter.field("sig", Lite(&_val.sig));
+                formatter.field("block", Lite(&_val.block));
+                formatter.finish()
+            }
+            syn::ImplItem::Type(_val) => {
+                let mut formatter = formatter.debug_struct("ImplItem::Type");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("vis", Lite(&_val.vis));
+                if _val.defaultness.is_some() {
+                    formatter.field("defaultness", &Present);
+                }
+                formatter.field("ident", Lite(&_val.ident));
+                formatter.field("generics", Lite(&_val.generics));
+                formatter.field("ty", Lite(&_val.ty));
+                formatter.finish()
+            }
+            syn::ImplItem::Macro(_val) => {
+                let mut formatter = formatter.debug_struct("ImplItem::Macro");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("mac", Lite(&_val.mac));
+                if _val.semi_token.is_some() {
+                    formatter.field("semi_token", &Present);
+                }
+                formatter.finish()
+            }
+            syn::ImplItem::Verbatim(_val) => {
+                formatter.write_str("ImplItem::Verbatim")?;
+                formatter.write_str("(`")?;
+                Display::fmt(_val, formatter)?;
+                formatter.write_str("`)")?;
+                Ok(())
+            }
+            _ => unreachable!(),
+        }
+    }
+}
+impl Debug for Lite<syn::ImplItemConst> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ImplItemConst");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("vis", Lite(&self.value.vis));
+        if self.value.defaultness.is_some() {
+            formatter.field("defaultness", &Present);
+        }
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.field("generics", Lite(&self.value.generics));
+        formatter.field("ty", Lite(&self.value.ty));
+        formatter.field("expr", Lite(&self.value.expr));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ImplItemFn> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ImplItemFn");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("vis", Lite(&self.value.vis));
+        if self.value.defaultness.is_some() {
+            formatter.field("defaultness", &Present);
+        }
+        formatter.field("sig", Lite(&self.value.sig));
+        formatter.field("block", Lite(&self.value.block));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ImplItemMacro> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ImplItemMacro");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("mac", Lite(&self.value.mac));
+        if self.value.semi_token.is_some() {
+            formatter.field("semi_token", &Present);
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ImplItemType> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ImplItemType");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("vis", Lite(&self.value.vis));
+        if self.value.defaultness.is_some() {
+            formatter.field("defaultness", &Present);
+        }
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.field("generics", Lite(&self.value.generics));
+        formatter.field("ty", Lite(&self.value.ty));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ImplRestriction> {
+    fn fmt(&self, _formatter: &mut fmt::Formatter) -> fmt::Result {
+        unreachable!()
+    }
+}
+impl Debug for Lite<syn::Index> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Index");
+        formatter.field("index", Lite(&self.value.index));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::Item> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::Item::Const(_val) => {
+                let mut formatter = formatter.debug_struct("Item::Const");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("vis", Lite(&_val.vis));
+                formatter.field("ident", Lite(&_val.ident));
+                formatter.field("generics", Lite(&_val.generics));
+                formatter.field("ty", Lite(&_val.ty));
+                formatter.field("expr", Lite(&_val.expr));
+                formatter.finish()
+            }
+            syn::Item::Enum(_val) => {
+                let mut formatter = formatter.debug_struct("Item::Enum");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("vis", Lite(&_val.vis));
+                formatter.field("ident", Lite(&_val.ident));
+                formatter.field("generics", Lite(&_val.generics));
+                if !_val.variants.is_empty() {
+                    formatter.field("variants", Lite(&_val.variants));
+                }
+                formatter.finish()
+            }
+            syn::Item::ExternCrate(_val) => {
+                let mut formatter = formatter.debug_struct("Item::ExternCrate");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("vis", Lite(&_val.vis));
+                formatter.field("ident", Lite(&_val.ident));
+                if let Some(val) = &_val.rename {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print((syn::token::As, proc_macro2::Ident));
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0.1), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("rename", Print::ref_cast(val));
+                }
+                formatter.finish()
+            }
+            syn::Item::Fn(_val) => {
+                let mut formatter = formatter.debug_struct("Item::Fn");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("vis", Lite(&_val.vis));
+                formatter.field("sig", Lite(&_val.sig));
+                formatter.field("block", Lite(&_val.block));
+                formatter.finish()
+            }
+            syn::Item::ForeignMod(_val) => {
+                let mut formatter = formatter.debug_struct("Item::ForeignMod");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if _val.unsafety.is_some() {
+                    formatter.field("unsafety", &Present);
+                }
+                formatter.field("abi", Lite(&_val.abi));
+                if !_val.items.is_empty() {
+                    formatter.field("items", Lite(&_val.items));
+                }
+                formatter.finish()
+            }
+            syn::Item::Impl(_val) => {
+                let mut formatter = formatter.debug_struct("Item::Impl");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if _val.defaultness.is_some() {
+                    formatter.field("defaultness", &Present);
+                }
+                if _val.unsafety.is_some() {
+                    formatter.field("unsafety", &Present);
+                }
+                formatter.field("generics", Lite(&_val.generics));
+                if let Some(val) = &_val.trait_ {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print((Option<syn::token::Not>, syn::Path, syn::token::For));
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(
+                                &(
+                                    &super::Option {
+                                        present: self.0.0.is_some(),
+                                    },
+                                    Lite(&self.0.1),
+                                ),
+                                formatter,
+                            )?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("trait_", Print::ref_cast(val));
+                }
+                formatter.field("self_ty", Lite(&_val.self_ty));
+                if !_val.items.is_empty() {
+                    formatter.field("items", Lite(&_val.items));
+                }
+                formatter.finish()
+            }
+            syn::Item::Macro(_val) => {
+                let mut formatter = formatter.debug_struct("Item::Macro");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if let Some(val) = &_val.ident {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(proc_macro2::Ident);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("ident", Print::ref_cast(val));
+                }
+                formatter.field("mac", Lite(&_val.mac));
+                if _val.semi_token.is_some() {
+                    formatter.field("semi_token", &Present);
+                }
+                formatter.finish()
+            }
+            syn::Item::Mod(_val) => {
+                let mut formatter = formatter.debug_struct("Item::Mod");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("vis", Lite(&_val.vis));
+                if _val.unsafety.is_some() {
+                    formatter.field("unsafety", &Present);
+                }
+                formatter.field("ident", Lite(&_val.ident));
+                if let Some(val) = &_val.content {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print((syn::token::Brace, Vec<syn::Item>));
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0.1), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("content", Print::ref_cast(val));
+                }
+                if _val.semi.is_some() {
+                    formatter.field("semi", &Present);
+                }
+                formatter.finish()
+            }
+            syn::Item::Static(_val) => {
+                let mut formatter = formatter.debug_struct("Item::Static");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("vis", Lite(&_val.vis));
+                match _val.mutability {
+                    syn::StaticMutability::None => {}
+                    _ => {
+                        formatter.field("mutability", Lite(&_val.mutability));
+                    }
+                }
+                formatter.field("ident", Lite(&_val.ident));
+                formatter.field("ty", Lite(&_val.ty));
+                formatter.field("expr", Lite(&_val.expr));
+                formatter.finish()
+            }
+            syn::Item::Struct(_val) => {
+                let mut formatter = formatter.debug_struct("Item::Struct");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("vis", Lite(&_val.vis));
+                formatter.field("ident", Lite(&_val.ident));
+                formatter.field("generics", Lite(&_val.generics));
+                formatter.field("fields", Lite(&_val.fields));
+                if _val.semi_token.is_some() {
+                    formatter.field("semi_token", &Present);
+                }
+                formatter.finish()
+            }
+            syn::Item::Trait(_val) => {
+                let mut formatter = formatter.debug_struct("Item::Trait");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("vis", Lite(&_val.vis));
+                if _val.unsafety.is_some() {
+                    formatter.field("unsafety", &Present);
+                }
+                if _val.auto_token.is_some() {
+                    formatter.field("auto_token", &Present);
+                }
+                if let Some(val) = &_val.restriction {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::ImplRestriction);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("restriction", Print::ref_cast(val));
+                }
+                formatter.field("ident", Lite(&_val.ident));
+                formatter.field("generics", Lite(&_val.generics));
+                if _val.colon_token.is_some() {
+                    formatter.field("colon_token", &Present);
+                }
+                if !_val.supertraits.is_empty() {
+                    formatter.field("supertraits", Lite(&_val.supertraits));
+                }
+                if !_val.items.is_empty() {
+                    formatter.field("items", Lite(&_val.items));
+                }
+                formatter.finish()
+            }
+            syn::Item::TraitAlias(_val) => {
+                let mut formatter = formatter.debug_struct("Item::TraitAlias");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("vis", Lite(&_val.vis));
+                formatter.field("ident", Lite(&_val.ident));
+                formatter.field("generics", Lite(&_val.generics));
+                if !_val.bounds.is_empty() {
+                    formatter.field("bounds", Lite(&_val.bounds));
+                }
+                formatter.finish()
+            }
+            syn::Item::Type(_val) => {
+                let mut formatter = formatter.debug_struct("Item::Type");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("vis", Lite(&_val.vis));
+                formatter.field("ident", Lite(&_val.ident));
+                formatter.field("generics", Lite(&_val.generics));
+                formatter.field("ty", Lite(&_val.ty));
+                formatter.finish()
+            }
+            syn::Item::Union(_val) => {
+                let mut formatter = formatter.debug_struct("Item::Union");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("vis", Lite(&_val.vis));
+                formatter.field("ident", Lite(&_val.ident));
+                formatter.field("generics", Lite(&_val.generics));
+                formatter.field("fields", Lite(&_val.fields));
+                formatter.finish()
+            }
+            syn::Item::Use(_val) => {
+                let mut formatter = formatter.debug_struct("Item::Use");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("vis", Lite(&_val.vis));
+                if _val.leading_colon.is_some() {
+                    formatter.field("leading_colon", &Present);
+                }
+                formatter.field("tree", Lite(&_val.tree));
+                formatter.finish()
+            }
+            syn::Item::Verbatim(_val) => {
+                formatter.write_str("Item::Verbatim")?;
+                formatter.write_str("(`")?;
+                Display::fmt(_val, formatter)?;
+                formatter.write_str("`)")?;
+                Ok(())
+            }
+            _ => unreachable!(),
+        }
+    }
+}
+impl Debug for Lite<syn::ItemConst> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ItemConst");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("vis", Lite(&self.value.vis));
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.field("generics", Lite(&self.value.generics));
+        formatter.field("ty", Lite(&self.value.ty));
+        formatter.field("expr", Lite(&self.value.expr));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ItemEnum> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ItemEnum");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("vis", Lite(&self.value.vis));
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.field("generics", Lite(&self.value.generics));
+        if !self.value.variants.is_empty() {
+            formatter.field("variants", Lite(&self.value.variants));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ItemExternCrate> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ItemExternCrate");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("vis", Lite(&self.value.vis));
+        formatter.field("ident", Lite(&self.value.ident));
+        if let Some(val) = &self.value.rename {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print((syn::token::As, proc_macro2::Ident));
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0.1), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("rename", Print::ref_cast(val));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ItemFn> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ItemFn");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("vis", Lite(&self.value.vis));
+        formatter.field("sig", Lite(&self.value.sig));
+        formatter.field("block", Lite(&self.value.block));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ItemForeignMod> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ItemForeignMod");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if self.value.unsafety.is_some() {
+            formatter.field("unsafety", &Present);
+        }
+        formatter.field("abi", Lite(&self.value.abi));
+        if !self.value.items.is_empty() {
+            formatter.field("items", Lite(&self.value.items));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ItemImpl> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ItemImpl");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if self.value.defaultness.is_some() {
+            formatter.field("defaultness", &Present);
+        }
+        if self.value.unsafety.is_some() {
+            formatter.field("unsafety", &Present);
+        }
+        formatter.field("generics", Lite(&self.value.generics));
+        if let Some(val) = &self.value.trait_ {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print((Option<syn::token::Not>, syn::Path, syn::token::For));
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(
+                        &(
+                            &super::Option {
+                                present: self.0.0.is_some(),
+                            },
+                            Lite(&self.0.1),
+                        ),
+                        formatter,
+                    )?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("trait_", Print::ref_cast(val));
+        }
+        formatter.field("self_ty", Lite(&self.value.self_ty));
+        if !self.value.items.is_empty() {
+            formatter.field("items", Lite(&self.value.items));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ItemMacro> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ItemMacro");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if let Some(val) = &self.value.ident {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(proc_macro2::Ident);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("ident", Print::ref_cast(val));
+        }
+        formatter.field("mac", Lite(&self.value.mac));
+        if self.value.semi_token.is_some() {
+            formatter.field("semi_token", &Present);
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ItemMod> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ItemMod");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("vis", Lite(&self.value.vis));
+        if self.value.unsafety.is_some() {
+            formatter.field("unsafety", &Present);
+        }
+        formatter.field("ident", Lite(&self.value.ident));
+        if let Some(val) = &self.value.content {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print((syn::token::Brace, Vec<syn::Item>));
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0.1), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("content", Print::ref_cast(val));
+        }
+        if self.value.semi.is_some() {
+            formatter.field("semi", &Present);
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ItemStatic> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ItemStatic");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("vis", Lite(&self.value.vis));
+        match self.value.mutability {
+            syn::StaticMutability::None => {}
+            _ => {
+                formatter.field("mutability", Lite(&self.value.mutability));
+            }
+        }
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.field("ty", Lite(&self.value.ty));
+        formatter.field("expr", Lite(&self.value.expr));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ItemStruct> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ItemStruct");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("vis", Lite(&self.value.vis));
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.field("generics", Lite(&self.value.generics));
+        formatter.field("fields", Lite(&self.value.fields));
+        if self.value.semi_token.is_some() {
+            formatter.field("semi_token", &Present);
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ItemTrait> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ItemTrait");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("vis", Lite(&self.value.vis));
+        if self.value.unsafety.is_some() {
+            formatter.field("unsafety", &Present);
+        }
+        if self.value.auto_token.is_some() {
+            formatter.field("auto_token", &Present);
+        }
+        if let Some(val) = &self.value.restriction {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::ImplRestriction);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("restriction", Print::ref_cast(val));
+        }
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.field("generics", Lite(&self.value.generics));
+        if self.value.colon_token.is_some() {
+            formatter.field("colon_token", &Present);
+        }
+        if !self.value.supertraits.is_empty() {
+            formatter.field("supertraits", Lite(&self.value.supertraits));
+        }
+        if !self.value.items.is_empty() {
+            formatter.field("items", Lite(&self.value.items));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ItemTraitAlias> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ItemTraitAlias");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("vis", Lite(&self.value.vis));
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.field("generics", Lite(&self.value.generics));
+        if !self.value.bounds.is_empty() {
+            formatter.field("bounds", Lite(&self.value.bounds));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ItemType> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ItemType");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("vis", Lite(&self.value.vis));
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.field("generics", Lite(&self.value.generics));
+        formatter.field("ty", Lite(&self.value.ty));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ItemUnion> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ItemUnion");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("vis", Lite(&self.value.vis));
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.field("generics", Lite(&self.value.generics));
+        formatter.field("fields", Lite(&self.value.fields));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ItemUse> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ItemUse");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("vis", Lite(&self.value.vis));
+        if self.value.leading_colon.is_some() {
+            formatter.field("leading_colon", &Present);
+        }
+        formatter.field("tree", Lite(&self.value.tree));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::Label> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Label");
+        formatter.field("name", Lite(&self.value.name));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::Lifetime> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Lifetime");
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::LifetimeParam> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("LifetimeParam");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("lifetime", Lite(&self.value.lifetime));
+        if self.value.colon_token.is_some() {
+            formatter.field("colon_token", &Present);
+        }
+        if !self.value.bounds.is_empty() {
+            formatter.field("bounds", Lite(&self.value.bounds));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::Lit> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::Lit::Str(_val) => write!(formatter, "{:?}", _val.value()),
+            syn::Lit::ByteStr(_val) => write!(formatter, "{:?}", _val.value()),
+            syn::Lit::CStr(_val) => write!(formatter, "{:?}", _val.value()),
+            syn::Lit::Byte(_val) => write!(formatter, "{:?}", _val.value()),
+            syn::Lit::Char(_val) => write!(formatter, "{:?}", _val.value()),
+            syn::Lit::Int(_val) => write!(formatter, "{}", _val),
+            syn::Lit::Float(_val) => write!(formatter, "{}", _val),
+            syn::Lit::Bool(_val) => {
+                let mut formatter = formatter.debug_struct("Lit::Bool");
+                formatter.field("value", Lite(&_val.value));
+                formatter.finish()
+            }
+            syn::Lit::Verbatim(_val) => {
+                formatter.write_str("Lit::Verbatim")?;
+                formatter.write_str("(`")?;
+                Display::fmt(_val, formatter)?;
+                formatter.write_str("`)")?;
+                Ok(())
+            }
+            _ => unreachable!(),
+        }
+    }
+}
+impl Debug for Lite<syn::LitBool> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("LitBool");
+        formatter.field("value", Lite(&self.value.value));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::LitByte> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        write!(formatter, "{:?}", self.value.value())
+    }
+}
+impl Debug for Lite<syn::LitByteStr> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        write!(formatter, "{:?}", self.value.value())
+    }
+}
+impl Debug for Lite<syn::LitCStr> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        write!(formatter, "{:?}", self.value.value())
+    }
+}
+impl Debug for Lite<syn::LitChar> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        write!(formatter, "{:?}", self.value.value())
+    }
+}
+impl Debug for Lite<syn::LitFloat> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        write!(formatter, "{}", & self.value)
+    }
+}
+impl Debug for Lite<syn::LitInt> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        write!(formatter, "{}", & self.value)
+    }
+}
+impl Debug for Lite<syn::LitStr> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        write!(formatter, "{:?}", self.value.value())
+    }
+}
+impl Debug for Lite<syn::Local> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Local");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("pat", Lite(&self.value.pat));
+        if let Some(val) = &self.value.init {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::LocalInit);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("init", Print::ref_cast(val));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::LocalInit> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("LocalInit");
+        formatter.field("expr", Lite(&self.value.expr));
+        if let Some(val) = &self.value.diverge {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print((syn::token::Else, Box<syn::Expr>));
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0.1), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("diverge", Print::ref_cast(val));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::Macro> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Macro");
+        formatter.field("path", Lite(&self.value.path));
+        formatter.field("delimiter", Lite(&self.value.delimiter));
+        formatter.field("tokens", Lite(&self.value.tokens));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::MacroDelimiter> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::MacroDelimiter::Paren(_val) => {
+                formatter.write_str("MacroDelimiter::Paren")?;
+                Ok(())
+            }
+            syn::MacroDelimiter::Brace(_val) => {
+                formatter.write_str("MacroDelimiter::Brace")?;
+                Ok(())
+            }
+            syn::MacroDelimiter::Bracket(_val) => {
+                formatter.write_str("MacroDelimiter::Bracket")?;
+                Ok(())
+            }
+        }
+    }
+}
+impl Debug for Lite<syn::Member> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::Member::Named(_val) => {
+                formatter.write_str("Member::Named")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::Member::Unnamed(_val) => {
+                formatter.write_str("Member::Unnamed")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+        }
+    }
+}
+impl Debug for Lite<syn::Meta> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::Meta::Path(_val) => {
+                let mut formatter = formatter.debug_struct("Meta::Path");
+                if _val.leading_colon.is_some() {
+                    formatter.field("leading_colon", &Present);
+                }
+                if !_val.segments.is_empty() {
+                    formatter.field("segments", Lite(&_val.segments));
+                }
+                formatter.finish()
+            }
+            syn::Meta::List(_val) => {
+                let mut formatter = formatter.debug_struct("Meta::List");
+                formatter.field("path", Lite(&_val.path));
+                formatter.field("delimiter", Lite(&_val.delimiter));
+                formatter.field("tokens", Lite(&_val.tokens));
+                formatter.finish()
+            }
+            syn::Meta::NameValue(_val) => {
+                let mut formatter = formatter.debug_struct("Meta::NameValue");
+                formatter.field("path", Lite(&_val.path));
+                formatter.field("value", Lite(&_val.value));
+                formatter.finish()
+            }
+        }
+    }
+}
+impl Debug for Lite<syn::MetaList> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("MetaList");
+        formatter.field("path", Lite(&self.value.path));
+        formatter.field("delimiter", Lite(&self.value.delimiter));
+        formatter.field("tokens", Lite(&self.value.tokens));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::MetaNameValue> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("MetaNameValue");
+        formatter.field("path", Lite(&self.value.path));
+        formatter.field("value", Lite(&self.value.value));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ParenthesizedGenericArguments> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("ParenthesizedGenericArguments");
+        if !self.value.inputs.is_empty() {
+            formatter.field("inputs", Lite(&self.value.inputs));
+        }
+        formatter.field("output", Lite(&self.value.output));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::Pat> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::Pat::Const(_val) => {
+                formatter.write_str("Pat::Const")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::Pat::Ident(_val) => {
+                let mut formatter = formatter.debug_struct("Pat::Ident");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if _val.by_ref.is_some() {
+                    formatter.field("by_ref", &Present);
+                }
+                if _val.mutability.is_some() {
+                    formatter.field("mutability", &Present);
+                }
+                formatter.field("ident", Lite(&_val.ident));
+                if let Some(val) = &_val.subpat {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print((syn::token::At, Box<syn::Pat>));
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0.1), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("subpat", Print::ref_cast(val));
+                }
+                formatter.finish()
+            }
+            syn::Pat::Lit(_val) => {
+                formatter.write_str("Pat::Lit")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::Pat::Macro(_val) => {
+                formatter.write_str("Pat::Macro")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::Pat::Or(_val) => {
+                let mut formatter = formatter.debug_struct("Pat::Or");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if _val.leading_vert.is_some() {
+                    formatter.field("leading_vert", &Present);
+                }
+                if !_val.cases.is_empty() {
+                    formatter.field("cases", Lite(&_val.cases));
+                }
+                formatter.finish()
+            }
+            syn::Pat::Paren(_val) => {
+                let mut formatter = formatter.debug_struct("Pat::Paren");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("pat", Lite(&_val.pat));
+                formatter.finish()
+            }
+            syn::Pat::Path(_val) => {
+                formatter.write_str("Pat::Path")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::Pat::Range(_val) => {
+                formatter.write_str("Pat::Range")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::Pat::Reference(_val) => {
+                let mut formatter = formatter.debug_struct("Pat::Reference");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if _val.mutability.is_some() {
+                    formatter.field("mutability", &Present);
+                }
+                formatter.field("pat", Lite(&_val.pat));
+                formatter.finish()
+            }
+            syn::Pat::Rest(_val) => {
+                let mut formatter = formatter.debug_struct("Pat::Rest");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.finish()
+            }
+            syn::Pat::Slice(_val) => {
+                let mut formatter = formatter.debug_struct("Pat::Slice");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if !_val.elems.is_empty() {
+                    formatter.field("elems", Lite(&_val.elems));
+                }
+                formatter.finish()
+            }
+            syn::Pat::Struct(_val) => {
+                let mut formatter = formatter.debug_struct("Pat::Struct");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if let Some(val) = &_val.qself {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::QSelf);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("qself", Print::ref_cast(val));
+                }
+                formatter.field("path", Lite(&_val.path));
+                if !_val.fields.is_empty() {
+                    formatter.field("fields", Lite(&_val.fields));
+                }
+                if let Some(val) = &_val.rest {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::PatRest);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("rest", Print::ref_cast(val));
+                }
+                formatter.finish()
+            }
+            syn::Pat::Tuple(_val) => {
+                let mut formatter = formatter.debug_struct("Pat::Tuple");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if !_val.elems.is_empty() {
+                    formatter.field("elems", Lite(&_val.elems));
+                }
+                formatter.finish()
+            }
+            syn::Pat::TupleStruct(_val) => {
+                let mut formatter = formatter.debug_struct("Pat::TupleStruct");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                if let Some(val) = &_val.qself {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::QSelf);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("qself", Print::ref_cast(val));
+                }
+                formatter.field("path", Lite(&_val.path));
+                if !_val.elems.is_empty() {
+                    formatter.field("elems", Lite(&_val.elems));
+                }
+                formatter.finish()
+            }
+            syn::Pat::Type(_val) => {
+                let mut formatter = formatter.debug_struct("Pat::Type");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("pat", Lite(&_val.pat));
+                formatter.field("ty", Lite(&_val.ty));
+                formatter.finish()
+            }
+            syn::Pat::Verbatim(_val) => {
+                formatter.write_str("Pat::Verbatim")?;
+                formatter.write_str("(`")?;
+                Display::fmt(_val, formatter)?;
+                formatter.write_str("`)")?;
+                Ok(())
+            }
+            syn::Pat::Wild(_val) => {
+                let mut formatter = formatter.debug_struct("Pat::Wild");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.finish()
+            }
+            _ => unreachable!(),
+        }
+    }
+}
+impl Debug for Lite<syn::PatIdent> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("PatIdent");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if self.value.by_ref.is_some() {
+            formatter.field("by_ref", &Present);
+        }
+        if self.value.mutability.is_some() {
+            formatter.field("mutability", &Present);
+        }
+        formatter.field("ident", Lite(&self.value.ident));
+        if let Some(val) = &self.value.subpat {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print((syn::token::At, Box<syn::Pat>));
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0.1), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("subpat", Print::ref_cast(val));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::PatOr> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("PatOr");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if self.value.leading_vert.is_some() {
+            formatter.field("leading_vert", &Present);
+        }
+        if !self.value.cases.is_empty() {
+            formatter.field("cases", Lite(&self.value.cases));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::PatParen> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("PatParen");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("pat", Lite(&self.value.pat));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::PatReference> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("PatReference");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if self.value.mutability.is_some() {
+            formatter.field("mutability", &Present);
+        }
+        formatter.field("pat", Lite(&self.value.pat));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::PatRest> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("PatRest");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::PatSlice> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("PatSlice");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if !self.value.elems.is_empty() {
+            formatter.field("elems", Lite(&self.value.elems));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::PatStruct> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("PatStruct");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if let Some(val) = &self.value.qself {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::QSelf);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("qself", Print::ref_cast(val));
+        }
+        formatter.field("path", Lite(&self.value.path));
+        if !self.value.fields.is_empty() {
+            formatter.field("fields", Lite(&self.value.fields));
+        }
+        if let Some(val) = &self.value.rest {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::PatRest);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("rest", Print::ref_cast(val));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::PatTuple> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("PatTuple");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if !self.value.elems.is_empty() {
+            formatter.field("elems", Lite(&self.value.elems));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::PatTupleStruct> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("PatTupleStruct");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if let Some(val) = &self.value.qself {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::QSelf);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("qself", Print::ref_cast(val));
+        }
+        formatter.field("path", Lite(&self.value.path));
+        if !self.value.elems.is_empty() {
+            formatter.field("elems", Lite(&self.value.elems));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::PatType> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("PatType");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("pat", Lite(&self.value.pat));
+        formatter.field("ty", Lite(&self.value.ty));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::PatWild> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("PatWild");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::Path> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Path");
+        if self.value.leading_colon.is_some() {
+            formatter.field("leading_colon", &Present);
+        }
+        if !self.value.segments.is_empty() {
+            formatter.field("segments", Lite(&self.value.segments));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::PathArguments> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::PathArguments::None => formatter.write_str("PathArguments::None"),
+            syn::PathArguments::AngleBracketed(_val) => {
+                let mut formatter = formatter
+                    .debug_struct("PathArguments::AngleBracketed");
+                if _val.colon2_token.is_some() {
+                    formatter.field("colon2_token", &Present);
+                }
+                if !_val.args.is_empty() {
+                    formatter.field("args", Lite(&_val.args));
+                }
+                formatter.finish()
+            }
+            syn::PathArguments::Parenthesized(_val) => {
+                let mut formatter = formatter
+                    .debug_struct("PathArguments::Parenthesized");
+                if !_val.inputs.is_empty() {
+                    formatter.field("inputs", Lite(&_val.inputs));
+                }
+                formatter.field("output", Lite(&_val.output));
+                formatter.finish()
+            }
+        }
+    }
+}
+impl Debug for Lite<syn::PathSegment> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("PathSegment");
+        formatter.field("ident", Lite(&self.value.ident));
+        match self.value.arguments {
+            syn::PathArguments::None => {}
+            _ => {
+                formatter.field("arguments", Lite(&self.value.arguments));
+            }
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::PredicateLifetime> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("PredicateLifetime");
+        formatter.field("lifetime", Lite(&self.value.lifetime));
+        if !self.value.bounds.is_empty() {
+            formatter.field("bounds", Lite(&self.value.bounds));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::PredicateType> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("PredicateType");
+        if let Some(val) = &self.value.lifetimes {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::BoundLifetimes);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("lifetimes", Print::ref_cast(val));
+        }
+        formatter.field("bounded_ty", Lite(&self.value.bounded_ty));
+        if !self.value.bounds.is_empty() {
+            formatter.field("bounds", Lite(&self.value.bounds));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::QSelf> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("QSelf");
+        formatter.field("ty", Lite(&self.value.ty));
+        formatter.field("position", Lite(&self.value.position));
+        if self.value.as_token.is_some() {
+            formatter.field("as_token", &Present);
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::RangeLimits> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::RangeLimits::HalfOpen(_val) => {
+                formatter.write_str("RangeLimits::HalfOpen")?;
+                Ok(())
+            }
+            syn::RangeLimits::Closed(_val) => {
+                formatter.write_str("RangeLimits::Closed")?;
+                Ok(())
+            }
+        }
+    }
+}
+impl Debug for Lite<syn::Receiver> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Receiver");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if let Some(val) = &self.value.reference {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print((syn::token::And, Option<syn::Lifetime>));
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(
+                        {
+                            #[derive(RefCast)]
+                            #[repr(transparent)]
+                            struct Print(Option<syn::Lifetime>);
+                            impl Debug for Print {
+                                fn fmt(
+                                    &self,
+                                    formatter: &mut fmt::Formatter,
+                                ) -> fmt::Result {
+                                    match &self.0 {
+                                        Some(_val) => {
+                                            formatter.write_str("Some(")?;
+                                            Debug::fmt(Lite(_val), formatter)?;
+                                            formatter.write_str(")")?;
+                                            Ok(())
+                                        }
+                                        None => formatter.write_str("None"),
+                                    }
+                                }
+                            }
+                            Print::ref_cast(&self.0.1)
+                        },
+                        formatter,
+                    )?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("reference", Print::ref_cast(val));
+        }
+        if self.value.mutability.is_some() {
+            formatter.field("mutability", &Present);
+        }
+        if self.value.colon_token.is_some() {
+            formatter.field("colon_token", &Present);
+        }
+        formatter.field("ty", Lite(&self.value.ty));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::ReturnType> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::ReturnType::Default => formatter.write_str("ReturnType::Default"),
+            syn::ReturnType::Type(_v0, _v1) => {
+                let mut formatter = formatter.debug_tuple("ReturnType::Type");
+                formatter.field(Lite(_v1));
+                formatter.finish()
+            }
+        }
+    }
+}
+impl Debug for Lite<syn::Signature> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Signature");
+        if self.value.constness.is_some() {
+            formatter.field("constness", &Present);
+        }
+        if self.value.asyncness.is_some() {
+            formatter.field("asyncness", &Present);
+        }
+        if self.value.unsafety.is_some() {
+            formatter.field("unsafety", &Present);
+        }
+        if let Some(val) = &self.value.abi {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::Abi);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("abi", Print::ref_cast(val));
+        }
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.field("generics", Lite(&self.value.generics));
+        if !self.value.inputs.is_empty() {
+            formatter.field("inputs", Lite(&self.value.inputs));
+        }
+        if let Some(val) = &self.value.variadic {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::Variadic);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("variadic", Print::ref_cast(val));
+        }
+        formatter.field("output", Lite(&self.value.output));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::StaticMutability> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::StaticMutability::Mut(_val) => {
+                formatter.write_str("StaticMutability::Mut")?;
+                Ok(())
+            }
+            syn::StaticMutability::None => formatter.write_str("StaticMutability::None"),
+            _ => unreachable!(),
+        }
+    }
+}
+impl Debug for Lite<syn::Stmt> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::Stmt::Local(_val) => {
+                let mut formatter = formatter.debug_struct("Stmt::Local");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("pat", Lite(&_val.pat));
+                if let Some(val) = &_val.init {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::LocalInit);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("init", Print::ref_cast(val));
+                }
+                formatter.finish()
+            }
+            syn::Stmt::Item(_val) => {
+                formatter.write_str("Stmt::Item")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::Stmt::Expr(_v0, _v1) => {
+                let mut formatter = formatter.debug_tuple("Stmt::Expr");
+                formatter.field(Lite(_v0));
+                formatter
+                    .field(
+                        &super::Option {
+                            present: _v1.is_some(),
+                        },
+                    );
+                formatter.finish()
+            }
+            syn::Stmt::Macro(_val) => {
+                let mut formatter = formatter.debug_struct("Stmt::Macro");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("mac", Lite(&_val.mac));
+                if _val.semi_token.is_some() {
+                    formatter.field("semi_token", &Present);
+                }
+                formatter.finish()
+            }
+        }
+    }
+}
+impl Debug for Lite<syn::StmtMacro> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("StmtMacro");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("mac", Lite(&self.value.mac));
+        if self.value.semi_token.is_some() {
+            formatter.field("semi_token", &Present);
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::TraitBound> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TraitBound");
+        if self.value.paren_token.is_some() {
+            formatter.field("paren_token", &Present);
+        }
+        match self.value.modifier {
+            syn::TraitBoundModifier::None => {}
+            _ => {
+                formatter.field("modifier", Lite(&self.value.modifier));
+            }
+        }
+        if let Some(val) = &self.value.lifetimes {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::BoundLifetimes);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("lifetimes", Print::ref_cast(val));
+        }
+        formatter.field("path", Lite(&self.value.path));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::TraitBoundModifier> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::TraitBoundModifier::None => {
+                formatter.write_str("TraitBoundModifier::None")
+            }
+            syn::TraitBoundModifier::Maybe(_val) => {
+                formatter.write_str("TraitBoundModifier::Maybe")?;
+                Ok(())
+            }
+        }
+    }
+}
+impl Debug for Lite<syn::TraitItem> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::TraitItem::Const(_val) => {
+                let mut formatter = formatter.debug_struct("TraitItem::Const");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("ident", Lite(&_val.ident));
+                formatter.field("generics", Lite(&_val.generics));
+                formatter.field("ty", Lite(&_val.ty));
+                if let Some(val) = &_val.default {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print((syn::token::Eq, syn::Expr));
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0.1), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("default", Print::ref_cast(val));
+                }
+                formatter.finish()
+            }
+            syn::TraitItem::Fn(_val) => {
+                let mut formatter = formatter.debug_struct("TraitItem::Fn");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("sig", Lite(&_val.sig));
+                if let Some(val) = &_val.default {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::Block);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("default", Print::ref_cast(val));
+                }
+                if _val.semi_token.is_some() {
+                    formatter.field("semi_token", &Present);
+                }
+                formatter.finish()
+            }
+            syn::TraitItem::Type(_val) => {
+                let mut formatter = formatter.debug_struct("TraitItem::Type");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("ident", Lite(&_val.ident));
+                formatter.field("generics", Lite(&_val.generics));
+                if _val.colon_token.is_some() {
+                    formatter.field("colon_token", &Present);
+                }
+                if !_val.bounds.is_empty() {
+                    formatter.field("bounds", Lite(&_val.bounds));
+                }
+                if let Some(val) = &_val.default {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print((syn::token::Eq, syn::Type));
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0.1), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("default", Print::ref_cast(val));
+                }
+                formatter.finish()
+            }
+            syn::TraitItem::Macro(_val) => {
+                let mut formatter = formatter.debug_struct("TraitItem::Macro");
+                if !_val.attrs.is_empty() {
+                    formatter.field("attrs", Lite(&_val.attrs));
+                }
+                formatter.field("mac", Lite(&_val.mac));
+                if _val.semi_token.is_some() {
+                    formatter.field("semi_token", &Present);
+                }
+                formatter.finish()
+            }
+            syn::TraitItem::Verbatim(_val) => {
+                formatter.write_str("TraitItem::Verbatim")?;
+                formatter.write_str("(`")?;
+                Display::fmt(_val, formatter)?;
+                formatter.write_str("`)")?;
+                Ok(())
+            }
+            _ => unreachable!(),
+        }
+    }
+}
+impl Debug for Lite<syn::TraitItemConst> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TraitItemConst");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.field("generics", Lite(&self.value.generics));
+        formatter.field("ty", Lite(&self.value.ty));
+        if let Some(val) = &self.value.default {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print((syn::token::Eq, syn::Expr));
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0.1), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("default", Print::ref_cast(val));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::TraitItemFn> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TraitItemFn");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("sig", Lite(&self.value.sig));
+        if let Some(val) = &self.value.default {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::Block);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("default", Print::ref_cast(val));
+        }
+        if self.value.semi_token.is_some() {
+            formatter.field("semi_token", &Present);
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::TraitItemMacro> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TraitItemMacro");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("mac", Lite(&self.value.mac));
+        if self.value.semi_token.is_some() {
+            formatter.field("semi_token", &Present);
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::TraitItemType> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TraitItemType");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.field("generics", Lite(&self.value.generics));
+        if self.value.colon_token.is_some() {
+            formatter.field("colon_token", &Present);
+        }
+        if !self.value.bounds.is_empty() {
+            formatter.field("bounds", Lite(&self.value.bounds));
+        }
+        if let Some(val) = &self.value.default {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print((syn::token::Eq, syn::Type));
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0.1), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("default", Print::ref_cast(val));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::Type> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::Type::Array(_val) => {
+                let mut formatter = formatter.debug_struct("Type::Array");
+                formatter.field("elem", Lite(&_val.elem));
+                formatter.field("len", Lite(&_val.len));
+                formatter.finish()
+            }
+            syn::Type::BareFn(_val) => {
+                let mut formatter = formatter.debug_struct("Type::BareFn");
+                if let Some(val) = &_val.lifetimes {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::BoundLifetimes);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("lifetimes", Print::ref_cast(val));
+                }
+                if _val.unsafety.is_some() {
+                    formatter.field("unsafety", &Present);
+                }
+                if let Some(val) = &_val.abi {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::Abi);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("abi", Print::ref_cast(val));
+                }
+                if !_val.inputs.is_empty() {
+                    formatter.field("inputs", Lite(&_val.inputs));
+                }
+                if let Some(val) = &_val.variadic {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::BareVariadic);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("variadic", Print::ref_cast(val));
+                }
+                formatter.field("output", Lite(&_val.output));
+                formatter.finish()
+            }
+            syn::Type::Group(_val) => {
+                let mut formatter = formatter.debug_struct("Type::Group");
+                formatter.field("elem", Lite(&_val.elem));
+                formatter.finish()
+            }
+            syn::Type::ImplTrait(_val) => {
+                let mut formatter = formatter.debug_struct("Type::ImplTrait");
+                if !_val.bounds.is_empty() {
+                    formatter.field("bounds", Lite(&_val.bounds));
+                }
+                formatter.finish()
+            }
+            syn::Type::Infer(_val) => {
+                let mut formatter = formatter.debug_struct("Type::Infer");
+                formatter.finish()
+            }
+            syn::Type::Macro(_val) => {
+                let mut formatter = formatter.debug_struct("Type::Macro");
+                formatter.field("mac", Lite(&_val.mac));
+                formatter.finish()
+            }
+            syn::Type::Never(_val) => {
+                let mut formatter = formatter.debug_struct("Type::Never");
+                formatter.finish()
+            }
+            syn::Type::Paren(_val) => {
+                let mut formatter = formatter.debug_struct("Type::Paren");
+                formatter.field("elem", Lite(&_val.elem));
+                formatter.finish()
+            }
+            syn::Type::Path(_val) => {
+                let mut formatter = formatter.debug_struct("Type::Path");
+                if let Some(val) = &_val.qself {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::QSelf);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("qself", Print::ref_cast(val));
+                }
+                formatter.field("path", Lite(&_val.path));
+                formatter.finish()
+            }
+            syn::Type::Ptr(_val) => {
+                let mut formatter = formatter.debug_struct("Type::Ptr");
+                if _val.const_token.is_some() {
+                    formatter.field("const_token", &Present);
+                }
+                if _val.mutability.is_some() {
+                    formatter.field("mutability", &Present);
+                }
+                formatter.field("elem", Lite(&_val.elem));
+                formatter.finish()
+            }
+            syn::Type::Reference(_val) => {
+                let mut formatter = formatter.debug_struct("Type::Reference");
+                if let Some(val) = &_val.lifetime {
+                    #[derive(RefCast)]
+                    #[repr(transparent)]
+                    struct Print(syn::Lifetime);
+                    impl Debug for Print {
+                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str("Some(")?;
+                            Debug::fmt(Lite(&self.0), formatter)?;
+                            formatter.write_str(")")?;
+                            Ok(())
+                        }
+                    }
+                    formatter.field("lifetime", Print::ref_cast(val));
+                }
+                if _val.mutability.is_some() {
+                    formatter.field("mutability", &Present);
+                }
+                formatter.field("elem", Lite(&_val.elem));
+                formatter.finish()
+            }
+            syn::Type::Slice(_val) => {
+                let mut formatter = formatter.debug_struct("Type::Slice");
+                formatter.field("elem", Lite(&_val.elem));
+                formatter.finish()
+            }
+            syn::Type::TraitObject(_val) => {
+                let mut formatter = formatter.debug_struct("Type::TraitObject");
+                if _val.dyn_token.is_some() {
+                    formatter.field("dyn_token", &Present);
+                }
+                if !_val.bounds.is_empty() {
+                    formatter.field("bounds", Lite(&_val.bounds));
+                }
+                formatter.finish()
+            }
+            syn::Type::Tuple(_val) => {
+                let mut formatter = formatter.debug_struct("Type::Tuple");
+                if !_val.elems.is_empty() {
+                    formatter.field("elems", Lite(&_val.elems));
+                }
+                formatter.finish()
+            }
+            syn::Type::Verbatim(_val) => {
+                formatter.write_str("Type::Verbatim")?;
+                formatter.write_str("(`")?;
+                Display::fmt(_val, formatter)?;
+                formatter.write_str("`)")?;
+                Ok(())
+            }
+            _ => unreachable!(),
+        }
+    }
+}
+impl Debug for Lite<syn::TypeArray> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TypeArray");
+        formatter.field("elem", Lite(&self.value.elem));
+        formatter.field("len", Lite(&self.value.len));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::TypeBareFn> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TypeBareFn");
+        if let Some(val) = &self.value.lifetimes {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::BoundLifetimes);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("lifetimes", Print::ref_cast(val));
+        }
+        if self.value.unsafety.is_some() {
+            formatter.field("unsafety", &Present);
+        }
+        if let Some(val) = &self.value.abi {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::Abi);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("abi", Print::ref_cast(val));
+        }
+        if !self.value.inputs.is_empty() {
+            formatter.field("inputs", Lite(&self.value.inputs));
+        }
+        if let Some(val) = &self.value.variadic {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::BareVariadic);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("variadic", Print::ref_cast(val));
+        }
+        formatter.field("output", Lite(&self.value.output));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::TypeGroup> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TypeGroup");
+        formatter.field("elem", Lite(&self.value.elem));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::TypeImplTrait> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TypeImplTrait");
+        if !self.value.bounds.is_empty() {
+            formatter.field("bounds", Lite(&self.value.bounds));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::TypeInfer> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TypeInfer");
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::TypeMacro> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TypeMacro");
+        formatter.field("mac", Lite(&self.value.mac));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::TypeNever> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TypeNever");
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::TypeParam> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TypeParam");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("ident", Lite(&self.value.ident));
+        if self.value.colon_token.is_some() {
+            formatter.field("colon_token", &Present);
+        }
+        if !self.value.bounds.is_empty() {
+            formatter.field("bounds", Lite(&self.value.bounds));
+        }
+        if self.value.eq_token.is_some() {
+            formatter.field("eq_token", &Present);
+        }
+        if let Some(val) = &self.value.default {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::Type);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("default", Print::ref_cast(val));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::TypeParamBound> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::TypeParamBound::Trait(_val) => {
+                formatter.write_str("TypeParamBound::Trait")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::TypeParamBound::Lifetime(_val) => {
+                let mut formatter = formatter.debug_struct("TypeParamBound::Lifetime");
+                formatter.field("ident", Lite(&_val.ident));
+                formatter.finish()
+            }
+            syn::TypeParamBound::Verbatim(_val) => {
+                formatter.write_str("TypeParamBound::Verbatim")?;
+                formatter.write_str("(`")?;
+                Display::fmt(_val, formatter)?;
+                formatter.write_str("`)")?;
+                Ok(())
+            }
+            _ => unreachable!(),
+        }
+    }
+}
+impl Debug for Lite<syn::TypeParen> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TypeParen");
+        formatter.field("elem", Lite(&self.value.elem));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::TypePath> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TypePath");
+        if let Some(val) = &self.value.qself {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::QSelf);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("qself", Print::ref_cast(val));
+        }
+        formatter.field("path", Lite(&self.value.path));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::TypePtr> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TypePtr");
+        if self.value.const_token.is_some() {
+            formatter.field("const_token", &Present);
+        }
+        if self.value.mutability.is_some() {
+            formatter.field("mutability", &Present);
+        }
+        formatter.field("elem", Lite(&self.value.elem));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::TypeReference> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TypeReference");
+        if let Some(val) = &self.value.lifetime {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print(syn::Lifetime);
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("lifetime", Print::ref_cast(val));
+        }
+        if self.value.mutability.is_some() {
+            formatter.field("mutability", &Present);
+        }
+        formatter.field("elem", Lite(&self.value.elem));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::TypeSlice> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TypeSlice");
+        formatter.field("elem", Lite(&self.value.elem));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::TypeTraitObject> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TypeTraitObject");
+        if self.value.dyn_token.is_some() {
+            formatter.field("dyn_token", &Present);
+        }
+        if !self.value.bounds.is_empty() {
+            formatter.field("bounds", Lite(&self.value.bounds));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::TypeTuple> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("TypeTuple");
+        if !self.value.elems.is_empty() {
+            formatter.field("elems", Lite(&self.value.elems));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::UnOp> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::UnOp::Deref(_val) => {
+                formatter.write_str("UnOp::Deref")?;
+                Ok(())
+            }
+            syn::UnOp::Not(_val) => {
+                formatter.write_str("UnOp::Not")?;
+                Ok(())
+            }
+            syn::UnOp::Neg(_val) => {
+                formatter.write_str("UnOp::Neg")?;
+                Ok(())
+            }
+            _ => unreachable!(),
+        }
+    }
+}
+impl Debug for Lite<syn::UseGlob> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("UseGlob");
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::UseGroup> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("UseGroup");
+        if !self.value.items.is_empty() {
+            formatter.field("items", Lite(&self.value.items));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::UseName> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("UseName");
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::UsePath> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("UsePath");
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.field("tree", Lite(&self.value.tree));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::UseRename> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("UseRename");
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.field("rename", Lite(&self.value.rename));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::UseTree> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::UseTree::Path(_val) => {
+                formatter.write_str("UseTree::Path")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::UseTree::Name(_val) => {
+                formatter.write_str("UseTree::Name")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::UseTree::Rename(_val) => {
+                formatter.write_str("UseTree::Rename")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::UseTree::Glob(_val) => {
+                formatter.write_str("UseTree::Glob")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::UseTree::Group(_val) => {
+                formatter.write_str("UseTree::Group")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+        }
+    }
+}
+impl Debug for Lite<syn::Variadic> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Variadic");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        if let Some(val) = &self.value.pat {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print((Box<syn::Pat>, syn::token::Colon));
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0.0), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("pat", Print::ref_cast(val));
+        }
+        if self.value.comma.is_some() {
+            formatter.field("comma", &Present);
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::Variant> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("Variant");
+        if !self.value.attrs.is_empty() {
+            formatter.field("attrs", Lite(&self.value.attrs));
+        }
+        formatter.field("ident", Lite(&self.value.ident));
+        formatter.field("fields", Lite(&self.value.fields));
+        if let Some(val) = &self.value.discriminant {
+            #[derive(RefCast)]
+            #[repr(transparent)]
+            struct Print((syn::token::Eq, syn::Expr));
+            impl Debug for Print {
+                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("Some(")?;
+                    Debug::fmt(Lite(&self.0.1), formatter)?;
+                    formatter.write_str(")")?;
+                    Ok(())
+                }
+            }
+            formatter.field("discriminant", Print::ref_cast(val));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::VisRestricted> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("VisRestricted");
+        if self.value.in_token.is_some() {
+            formatter.field("in_token", &Present);
+        }
+        formatter.field("path", Lite(&self.value.path));
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::Visibility> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::Visibility::Public(_val) => {
+                formatter.write_str("Visibility::Public")?;
+                Ok(())
+            }
+            syn::Visibility::Restricted(_val) => {
+                let mut formatter = formatter.debug_struct("Visibility::Restricted");
+                if _val.in_token.is_some() {
+                    formatter.field("in_token", &Present);
+                }
+                formatter.field("path", Lite(&_val.path));
+                formatter.finish()
+            }
+            syn::Visibility::Inherited => formatter.write_str("Visibility::Inherited"),
+        }
+    }
+}
+impl Debug for Lite<syn::WhereClause> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut formatter = formatter.debug_struct("WhereClause");
+        if !self.value.predicates.is_empty() {
+            formatter.field("predicates", Lite(&self.value.predicates));
+        }
+        formatter.finish()
+    }
+}
+impl Debug for Lite<syn::WherePredicate> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match &self.value {
+            syn::WherePredicate::Lifetime(_val) => {
+                formatter.write_str("WherePredicate::Lifetime")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            syn::WherePredicate::Type(_val) => {
+                formatter.write_str("WherePredicate::Type")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
+            _ => unreachable!(),
+        }
+    }
+}
+impl Debug for Lite<syn::token::Abstract> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![abstract]")
+    }
+}
+impl Debug for Lite<syn::token::And> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![&]")
+    }
+}
+impl Debug for Lite<syn::token::AndAnd> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![&&]")
+    }
+}
+impl Debug for Lite<syn::token::AndEq> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![&=]")
+    }
+}
+impl Debug for Lite<syn::token::As> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![as]")
+    }
+}
+impl Debug for Lite<syn::token::Async> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![async]")
+    }
+}
+impl Debug for Lite<syn::token::At> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![@]")
+    }
+}
+impl Debug for Lite<syn::token::Auto> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![auto]")
+    }
+}
+impl Debug for Lite<syn::token::Await> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![await]")
+    }
+}
+impl Debug for Lite<syn::token::Become> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![become]")
+    }
+}
+impl Debug for Lite<syn::token::Box> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![box]")
+    }
+}
+impl Debug for Lite<syn::token::Break> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![break]")
+    }
+}
+impl Debug for Lite<syn::token::Caret> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![^]")
+    }
+}
+impl Debug for Lite<syn::token::CaretEq> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![^=]")
+    }
+}
+impl Debug for Lite<syn::token::Colon> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![:]")
+    }
+}
+impl Debug for Lite<syn::token::Comma> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![,]")
+    }
+}
+impl Debug for Lite<syn::token::Const> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![const]")
+    }
+}
+impl Debug for Lite<syn::token::Continue> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![continue]")
+    }
+}
+impl Debug for Lite<syn::token::Crate> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![crate]")
+    }
+}
+impl Debug for Lite<syn::token::Default> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![default]")
+    }
+}
+impl Debug for Lite<syn::token::Do> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![do]")
+    }
+}
+impl Debug for Lite<syn::token::Dollar> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![$]")
+    }
+}
+impl Debug for Lite<syn::token::Dot> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![.]")
+    }
+}
+impl Debug for Lite<syn::token::DotDot> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![..]")
+    }
+}
+impl Debug for Lite<syn::token::DotDotDot> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![...]")
+    }
+}
+impl Debug for Lite<syn::token::DotDotEq> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![..=]")
+    }
+}
+impl Debug for Lite<syn::token::Dyn> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![dyn]")
+    }
+}
+impl Debug for Lite<syn::token::Else> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![else]")
+    }
+}
+impl Debug for Lite<syn::token::Enum> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![enum]")
+    }
+}
+impl Debug for Lite<syn::token::Eq> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![=]")
+    }
+}
+impl Debug for Lite<syn::token::EqEq> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![==]")
+    }
+}
+impl Debug for Lite<syn::token::Extern> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![extern]")
+    }
+}
+impl Debug for Lite<syn::token::FatArrow> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![=>]")
+    }
+}
+impl Debug for Lite<syn::token::Final> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![final]")
+    }
+}
+impl Debug for Lite<syn::token::Fn> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![fn]")
+    }
+}
+impl Debug for Lite<syn::token::For> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![for]")
+    }
+}
+impl Debug for Lite<syn::token::Ge> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![>=]")
+    }
+}
+impl Debug for Lite<syn::token::Gt> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![>]")
+    }
+}
+impl Debug for Lite<syn::token::If> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![if]")
+    }
+}
+impl Debug for Lite<syn::token::Impl> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![impl]")
+    }
+}
+impl Debug for Lite<syn::token::In> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![in]")
+    }
+}
+impl Debug for Lite<syn::token::LArrow> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![<-]")
+    }
+}
+impl Debug for Lite<syn::token::Le> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![<=]")
+    }
+}
+impl Debug for Lite<syn::token::Let> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![let]")
+    }
+}
+impl Debug for Lite<syn::token::Loop> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![loop]")
+    }
+}
+impl Debug for Lite<syn::token::Lt> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![<]")
+    }
+}
+impl Debug for Lite<syn::token::Macro> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![macro]")
+    }
+}
+impl Debug for Lite<syn::token::Match> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![match]")
+    }
+}
+impl Debug for Lite<syn::token::Minus> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![-]")
+    }
+}
+impl Debug for Lite<syn::token::MinusEq> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![-=]")
+    }
+}
+impl Debug for Lite<syn::token::Mod> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![mod]")
+    }
+}
+impl Debug for Lite<syn::token::Move> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![move]")
+    }
+}
+impl Debug for Lite<syn::token::Mut> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![mut]")
+    }
+}
+impl Debug for Lite<syn::token::Ne> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![!=]")
+    }
+}
+impl Debug for Lite<syn::token::Not> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![!]")
+    }
+}
+impl Debug for Lite<syn::token::Or> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![|]")
+    }
+}
+impl Debug for Lite<syn::token::OrEq> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![|=]")
+    }
+}
+impl Debug for Lite<syn::token::OrOr> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![||]")
+    }
+}
+impl Debug for Lite<syn::token::Override> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![override]")
+    }
+}
+impl Debug for Lite<syn::token::PathSep> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![::]")
+    }
+}
+impl Debug for Lite<syn::token::Percent> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![%]")
+    }
+}
+impl Debug for Lite<syn::token::PercentEq> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![%=]")
+    }
+}
+impl Debug for Lite<syn::token::Plus> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![+]")
+    }
+}
+impl Debug for Lite<syn::token::PlusEq> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![+=]")
+    }
+}
+impl Debug for Lite<syn::token::Pound> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![#]")
+    }
+}
+impl Debug for Lite<syn::token::Priv> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![priv]")
+    }
+}
+impl Debug for Lite<syn::token::Pub> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![pub]")
+    }
+}
+impl Debug for Lite<syn::token::Question> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![?]")
+    }
+}
+impl Debug for Lite<syn::token::RArrow> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![->]")
+    }
+}
+impl Debug for Lite<syn::token::Ref> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![ref]")
+    }
+}
+impl Debug for Lite<syn::token::Return> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![return]")
+    }
+}
+impl Debug for Lite<syn::token::SelfType> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![Self]")
+    }
+}
+impl Debug for Lite<syn::token::SelfValue> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![self]")
+    }
+}
+impl Debug for Lite<syn::token::Semi> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![;]")
+    }
+}
+impl Debug for Lite<syn::token::Shl> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![<<]")
+    }
+}
+impl Debug for Lite<syn::token::ShlEq> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![<<=]")
+    }
+}
+impl Debug for Lite<syn::token::Shr> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![>>]")
+    }
+}
+impl Debug for Lite<syn::token::ShrEq> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![>>=]")
+    }
+}
+impl Debug for Lite<syn::token::Slash> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![/]")
+    }
+}
+impl Debug for Lite<syn::token::SlashEq> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![/=]")
+    }
+}
+impl Debug for Lite<syn::token::Star> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![*]")
+    }
+}
+impl Debug for Lite<syn::token::StarEq> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![*=]")
+    }
+}
+impl Debug for Lite<syn::token::Static> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![static]")
+    }
+}
+impl Debug for Lite<syn::token::Struct> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![struct]")
+    }
+}
+impl Debug for Lite<syn::token::Super> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![super]")
+    }
+}
+impl Debug for Lite<syn::token::Tilde> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![~]")
+    }
+}
+impl Debug for Lite<syn::token::Trait> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![trait]")
+    }
+}
+impl Debug for Lite<syn::token::Try> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![try]")
+    }
+}
+impl Debug for Lite<syn::token::Type> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![type]")
+    }
+}
+impl Debug for Lite<syn::token::Typeof> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![typeof]")
+    }
+}
+impl Debug for Lite<syn::token::Underscore> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![_]")
+    }
+}
+impl Debug for Lite<syn::token::Union> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![union]")
+    }
+}
+impl Debug for Lite<syn::token::Unsafe> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![unsafe]")
+    }
+}
+impl Debug for Lite<syn::token::Unsized> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![unsized]")
+    }
+}
+impl Debug for Lite<syn::token::Use> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![use]")
+    }
+}
+impl Debug for Lite<syn::token::Virtual> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![virtual]")
+    }
+}
+impl Debug for Lite<syn::token::Where> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![where]")
+    }
+}
+impl Debug for Lite<syn::token::While> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![while]")
+    }
+}
+impl Debug for Lite<syn::token::Yield> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Token![yield]")
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/debug/mod.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/debug/mod.rs
--- 43.0.0-1/rust-vendor/syn/tests/debug/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/debug/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,147 @@
+#![allow(
+    clippy::no_effect_underscore_binding,
+    clippy::too_many_lines,
+    clippy::used_underscore_binding
+)]
+
+#[rustfmt::skip]
+mod gen;
+
+use proc_macro2::{Ident, Literal, TokenStream};
+use ref_cast::RefCast;
+use std::fmt::{self, Debug};
+use std::ops::Deref;
+use syn::punctuated::Punctuated;
+
+#[derive(RefCast)]
+#[repr(transparent)]
+pub struct Lite<T: ?Sized> {
+    value: T,
+}
+
+#[allow(non_snake_case)]
+pub fn Lite<T: ?Sized>(value: &T) -> &Lite<T> {
+    Lite::ref_cast(value)
+}
+
+impl<T: ?Sized> Deref for Lite<T> {
+    type Target = T;
+
+    fn deref(&self) -> &Self::Target {
+        &self.value
+    }
+}
+
+impl Debug for Lite<bool> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        write!(formatter, "{}", self.value)
+    }
+}
+
+impl Debug for Lite<u32> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        write!(formatter, "{}", self.value)
+    }
+}
+
+impl Debug for Lite<usize> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        write!(formatter, "{}", self.value)
+    }
+}
+
+impl Debug for Lite<String> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        write!(formatter, "{:?}", self.value)
+    }
+}
+
+impl Debug for Lite<Ident> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        write!(formatter, "{:?}", self.value.to_string())
+    }
+}
+
+impl Debug for Lite<Literal> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        write!(formatter, "{}", self.value)
+    }
+}
+
+impl Debug for Lite<TokenStream> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let string = self.value.to_string();
+        if string.len() <= 80 {
+            write!(formatter, "TokenStream(`{}`)", self.value)
+        } else {
+            formatter
+                .debug_tuple("TokenStream")
+                .field(&format_args!("`{}`", string))
+                .finish()
+        }
+    }
+}
+
+impl<'a, T> Debug for Lite<&'a T>
+where
+    Lite<T>: Debug,
+{
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(Lite(self.value), formatter)
+    }
+}
+
+impl<T> Debug for Lite<Box<T>>
+where
+    Lite<T>: Debug,
+{
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(Lite(&*self.value), formatter)
+    }
+}
+
+impl<T> Debug for Lite<Vec<T>>
+where
+    Lite<T>: Debug,
+{
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter
+            .debug_list()
+            .entries(self.value.iter().map(Lite))
+            .finish()
+    }
+}
+
+impl<T, P> Debug for Lite<Punctuated<T, P>>
+where
+    Lite<T>: Debug,
+    Lite<P>: Debug,
+{
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut list = formatter.debug_list();
+        for pair in self.pairs() {
+            let (node, punct) = pair.into_tuple();
+            list.entry(Lite(node));
+            list.entries(punct.map(Lite));
+        }
+        list.finish()
+    }
+}
+
+struct Present;
+
+impl Debug for Present {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("Some")
+    }
+}
+
+struct Option {
+    present: bool,
+}
+
+impl Debug for Option {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str(if self.present { "Some" } else { "None" })
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/macros/mod.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/macros/mod.rs
--- 43.0.0-1/rust-vendor/syn/tests/macros/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/macros/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,93 @@
+#![allow(unused_macros, unused_macro_rules)]
+
+#[path = "../debug/mod.rs"]
+pub mod debug;
+
+use std::str::FromStr;
+use syn::parse::Result;
+
+macro_rules! errorf {
+    ($($tt:tt)*) => {{
+        use ::std::io::Write;
+        let stderr = ::std::io::stderr();
+        write!(stderr.lock(), $($tt)*).unwrap();
+    }};
+}
+
+macro_rules! punctuated {
+    ($($e:expr,)+) => {{
+        let mut seq = ::syn::punctuated::Punctuated::new();
+        $(
+            seq.push($e);
+        )+
+        seq
+    }};
+
+    ($($e:expr),+) => {
+        punctuated!($($e,)+)
+    };
+}
+
+macro_rules! snapshot {
+    ($($args:tt)*) => {
+        snapshot_impl!(() $($args)*)
+    };
+}
+
+macro_rules! snapshot_impl {
+    (($expr:ident) as $t:ty, @$snapshot:literal) => {
+        let tokens = crate::macros::TryIntoTokens::try_into_tokens($expr).unwrap();
+        let $expr: $t = syn::parse_quote!(#tokens);
+        let debug = crate::macros::debug::Lite(&$expr);
+        if !cfg!(miri) {
+            #[allow(clippy::needless_raw_string_hashes)] // https://github.com/mitsuhiko/insta/issues/389
+            {
+                insta::assert_debug_snapshot!(debug, @$snapshot);
+            }
+        }
+    };
+    (($($expr:tt)*) as $t:ty, @$snapshot:literal) => {{
+        let tokens = crate::macros::TryIntoTokens::try_into_tokens($($expr)*).unwrap();
+        let syntax_tree: $t = syn::parse_quote!(#tokens);
+        let debug = crate::macros::debug::Lite(&syntax_tree);
+        if !cfg!(miri) {
+            #[allow(clippy::needless_raw_string_hashes)]
+            {
+                insta::assert_debug_snapshot!(debug, @$snapshot);
+            }
+        }
+        syntax_tree
+    }};
+    (($($expr:tt)*) , @$snapshot:literal) => {{
+        let syntax_tree = $($expr)*;
+        let debug = crate::macros::debug::Lite(&syntax_tree);
+        if !cfg!(miri) {
+            #[allow(clippy::needless_raw_string_hashes)]
+            {
+                insta::assert_debug_snapshot!(debug, @$snapshot);
+            }
+        }
+        syntax_tree
+    }};
+    (($($expr:tt)*) $next:tt $($rest:tt)*) => {
+        snapshot_impl!(($($expr)* $next) $($rest)*)
+    };
+}
+
+pub trait TryIntoTokens {
+    #[allow(dead_code)]
+    fn try_into_tokens(self) -> Result<proc_macro2::TokenStream>;
+}
+
+impl<'a> TryIntoTokens for &'a str {
+    fn try_into_tokens(self) -> Result<proc_macro2::TokenStream> {
+        let tokens = proc_macro2::TokenStream::from_str(self)?;
+        Ok(tokens)
+    }
+}
+
+impl TryIntoTokens for proc_macro2::TokenStream {
+    fn try_into_tokens(self) -> Result<proc_macro2::TokenStream> {
+        Ok(self)
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/regression/issue1108.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/regression/issue1108.rs
--- 43.0.0-1/rust-vendor/syn/tests/regression/issue1108.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/regression/issue1108.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+#[test]
+fn issue1108() {
+    let data = "impl<x<>>::x for";
+    let _ = syn::parse_file(data);
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/regression/issue1235.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/regression/issue1235.rs
--- 43.0.0-1/rust-vendor/syn/tests/regression/issue1235.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/regression/issue1235.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,32 @@
+use proc_macro2::{Delimiter, Group};
+use quote::quote;
+
+#[test]
+fn main() {
+    // Okay. Rustc allows top-level `static` with no value syntactically, but
+    // not semantically. Syn parses as Item::Verbatim.
+    let tokens = quote! {
+        pub static FOO: usize;
+        pub static BAR: usize;
+    };
+    let file = syn::parse2::<syn::File>(tokens).unwrap();
+    println!("{:#?}", file);
+
+    // Okay.
+    let inner = Group::new(
+        Delimiter::None,
+        quote!(static FOO: usize = 0; pub static BAR: usize = 0),
+    );
+    let tokens = quote!(pub #inner;);
+    let file = syn::parse2::<syn::File>(tokens).unwrap();
+    println!("{:#?}", file);
+
+    // Formerly parser crash.
+    let inner = Group::new(
+        Delimiter::None,
+        quote!(static FOO: usize; pub static BAR: usize),
+    );
+    let tokens = quote!(pub #inner;);
+    let file = syn::parse2::<syn::File>(tokens).unwrap();
+    println!("{:#?}", file);
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/regression.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/regression.rs
--- 43.0.0-1/rust-vendor/syn/tests/regression.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/regression.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,5 @@
+#![allow(clippy::let_underscore_untyped, clippy::uninlined_format_args)]
+
+mod regression {
+    automod::dir!("tests/regression");
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/repo/mod.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/repo/mod.rs
--- 43.0.0-1/rust-vendor/syn/tests/repo/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/repo/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,482 @@
+#![allow(clippy::manual_assert)]
+
+mod progress;
+
+use self::progress::Progress;
+use anyhow::Result;
+use flate2::read::GzDecoder;
+use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
+use rayon::ThreadPoolBuilder;
+use std::collections::BTreeSet;
+use std::env;
+use std::ffi::OsStr;
+use std::fs;
+use std::path::{Path, PathBuf};
+use tar::Archive;
+use walkdir::{DirEntry, WalkDir};
+
+const REVISION: &str = "becebb3158149a115cad8a402612e25436a7e37b";
+
+#[rustfmt::skip]
+static EXCLUDE_FILES: &[&str] = &[
+    // TODO: explicit tail calls: `become _g()`
+    // https://github.com/dtolnay/syn/issues/1501
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0209_become_expr.rs",
+    "tests/ui/explicit-tail-calls/return-lifetime-sub.rs",
+
+    // TODO: non-lifetime binders: `where for<'a, T> &'a Struct<T>: Trait`
+    // https://github.com/dtolnay/syn/issues/1435
+    "src/tools/rustfmt/tests/source/issue_5721.rs",
+    "src/tools/rustfmt/tests/source/non-lifetime-binders.rs",
+    "src/tools/rustfmt/tests/target/issue_5721.rs",
+    "src/tools/rustfmt/tests/target/non-lifetime-binders.rs",
+    "tests/rustdoc-json/non_lifetime_binders.rs",
+    "tests/rustdoc/inline_cross/auxiliary/non_lifetime_binders.rs",
+    "tests/rustdoc/non_lifetime_binders.rs",
+
+    // TODO: return type notation: `where T: Trait<method(): Send>`
+    // https://github.com/dtolnay/syn/issues/1434
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0208_associated_return_type_bounds.rs",
+    "tests/ui/associated-type-bounds/return-type-notation/basic.rs",
+    "tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.rs",
+    "tests/ui/feature-gates/feature-gate-return_type_notation.rs",
+
+    // TODO: lazy type alias syntax with where-clause in trailing position
+    // https://github.com/dtolnay/syn/issues/1525
+    "tests/rustdoc/typedef-inner-variants-lazy_type_alias.rs",
+
+    // TODO: gen blocks and functions
+    // https://github.com/dtolnay/syn/issues/1526
+    "compiler/rustc_codegen_cranelift/example/gen_block_iterate.rs",
+    "tests/ui/coroutine/async-gen-deduce-yield.rs",
+    "tests/ui/coroutine/async-gen-yield-ty-is-unit.rs",
+    "tests/ui/coroutine/async_gen_fn_iter.rs",
+    "tests/ui/coroutine/gen_block_is_fused_iter.rs",
+    "tests/ui/coroutine/gen_block_is_iter.rs",
+    "tests/ui/coroutine/gen_block_iterate.rs",
+    "tests/ui/coroutine/gen_fn_iter.rs",
+    "tests/ui/coroutine/gen_fn_lifetime_capture.rs",
+    "tests/ui/coroutine/return-types-diverge.rs",
+    "tests/ui/higher-ranked/builtin-closure-like-bounds.rs",
+    "tests/ui/sanitizer/cfi-coroutine.rs",
+
+    // TODO: `!` as a pattern
+    // https://github.com/dtolnay/syn/issues/1546
+    "tests/ui/rfcs/rfc-0000-never_patterns/diverges.rs",
+
+    // TODO: async trait bounds: `impl async Fn()`
+    // https://github.com/dtolnay/syn/issues/1628
+    "src/tools/miri/tests/pass/async-closure-captures.rs",
+    "src/tools/miri/tests/pass/async-closure-drop.rs",
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0211_async_trait_bound.rs",
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0212_const_trait_bound.rs",
+    "src/tools/rustfmt/tests/target/asyncness.rs",
+    "tests/codegen/async-closure-debug.rs",
+    "tests/ui/async-await/async-closures/async-fn-mut-for-async-fn.rs",
+    "tests/ui/async-await/async-closures/async-fn-once-for-async-fn.rs",
+    "tests/ui/async-await/async-closures/auxiliary/foreign.rs",
+    "tests/ui/async-await/async-closures/brand.rs",
+    "tests/ui/async-await/async-closures/captures.rs",
+    "tests/ui/async-await/async-closures/constrained-but-no-upvars-yet.rs",
+    "tests/ui/async-await/async-closures/drop.rs",
+    "tests/ui/async-await/async-closures/mangle.rs",
+    "tests/ui/async-await/async-closures/moro-example.rs",
+    "tests/ui/async-await/async-closures/move-is-async-fn.rs",
+    "tests/ui/async-await/async-closures/mut-ref-reborrow.rs",
+    "tests/ui/async-await/async-closures/no-borrow-from-env.rs",
+    "tests/ui/async-await/async-closures/overlapping-projs.rs",
+    "tests/ui/async-await/async-closures/precise-captures.rs",
+    "tests/ui/async-await/async-closures/refd.rs",
+    "tests/ui/async-await/async-closures/signature-deduction.rs",
+    "tests/ui/async-await/async-fn/edition-2015-not-async-bound.rs",
+    "tests/ui/async-await/async-fn/higher-ranked-async-fn.rs",
+    "tests/ui/async-await/async-fn/impl-trait.rs",
+    "tests/ui/async-await/async-fn/project.rs",
+    "tests/ui/async-await/async-fn/sugar.rs",
+
+    // TODO: mutable by-reference bindings (mut ref)
+    // https://github.com/dtolnay/syn/issues/1629
+    "src/tools/rustfmt/tests/source/mut_ref.rs",
+    "src/tools/rustfmt/tests/target/mut_ref.rs",
+    "tests/ui/mut/mut-ref.rs",
+
+    // TODO: postfix match
+    // https://github.com/dtolnay/syn/issues/1630
+    "src/tools/rustfmt/tests/source/postfix-match/pf-match.rs",
+    "src/tools/rustfmt/tests/target/postfix-match/pf-match.rs",
+    "tests/pretty/postfix-match.rs",
+    "tests/ui/match/postfix-match/no-unused-parens.rs",
+    "tests/ui/match/postfix-match/pf-match-chain.rs",
+    "tests/ui/match/postfix-match/postfix-match.rs",
+
+    // TODO: delegation
+    // https://github.com/dtolnay/syn/issues/1580
+    "tests/pretty/delegation.rs",
+    "tests/ui/delegation/explicit-paths-in-traits-pass.rs",
+    "tests/ui/delegation/explicit-paths-pass.rs",
+    "tests/ui/delegation/explicit-paths-signature-pass.rs",
+    "tests/ui/delegation/parse.rs",
+
+    // TODO: for await
+    // https://github.com/dtolnay/syn/issues/1631
+    "tests/ui/async-await/for-await-2015.rs",
+    "tests/ui/async-await/for-await-passthrough.rs",
+    "tests/ui/async-await/for-await.rs",
+
+    // TODO: const trait bound: `T: const Trait`
+    // https://github.com/dtolnay/syn/issues/1632
+    "tests/ui/generic-const-items/const-trait-impl.rs",
+    "tests/ui/rfcs/rfc-2632-const-trait-impl/const-fns-are-early-bound.rs",
+    "tests/ui/rfcs/rfc-2632-const-trait-impl/const-trait-bounds.rs",
+    "tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.rs",
+
+    // TODO: `|| .. .method()`
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0208_closure_range_method_call.rs",
+    "src/tools/rustfmt/tests/source/issue-4808.rs",
+
+    // Compile-fail expr parameter in const generic position: f::<1 + 2>()
+    "tests/ui/const-generics/early/closing-args-token.rs",
+    "tests/ui/const-generics/early/const-expression-parameter.rs",
+
+    // Compile-fail variadics in not the last position of a function parameter list
+    "tests/ui/parser/variadic-ffi-syntactic-pass.rs",
+
+    // Need at least one trait in impl Trait, no such type as impl 'static
+    "tests/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs",
+
+    // Negative polarity trait bound: `where T: !Copy`
+    "src/tools/rustfmt/tests/target/negative-bounds.rs",
+    "tests/ui/traits/negative-bounds/supertrait.rs",
+
+    // Lifetime bound inside for<>: `T: ~const ?for<'a: 'b> Trait<'a>`
+    "tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-syntax.rs",
+
+    // Const impl that is not a trait impl: `impl ~const T {}`
+    "tests/ui/rfcs/rfc-2632-const-trait-impl/syntax.rs",
+
+    // Lifetimes and types out of order in angle bracketed path arguments
+    "tests/ui/parser/constraints-before-generic-args-syntactic-pass.rs",
+
+    // Deprecated anonymous parameter syntax in traits
+    "src/tools/rustfmt/tests/source/trait.rs",
+    "src/tools/rustfmt/tests/target/trait.rs",
+    "tests/ui/issues/issue-13105.rs",
+    "tests/ui/issues/issue-13775.rs",
+    "tests/ui/issues/issue-34074.rs",
+    "tests/ui/proc-macro/trait-fn-args-2015.rs",
+
+    // Deprecated where-clause location
+    "src/tools/rustfmt/tests/source/issue_4257.rs",
+    "src/tools/rustfmt/tests/source/issue_4911.rs",
+    "src/tools/rustfmt/tests/target/issue_4257.rs",
+    "src/tools/rustfmt/tests/target/issue_4911.rs",
+    "tests/pretty/gat-bounds.rs",
+    "tests/rustdoc/generic-associated-types/gats.rs",
+
+    // Deprecated trait object syntax with parenthesized generic arguments and no dyn keyword
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rs",
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0104_path_fn_trait_args.rs",
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0202_typepathfn_with_coloncolon.rs",
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0209_bare_dyn_types_with_paren_as_generic_args.rs",
+    "src/tools/rustfmt/tests/source/attrib.rs",
+    "src/tools/rustfmt/tests/source/closure.rs",
+    "src/tools/rustfmt/tests/source/existential_type.rs",
+    "src/tools/rustfmt/tests/source/fn-simple.rs",
+    "src/tools/rustfmt/tests/source/fn_args_layout-vertical.rs",
+    "src/tools/rustfmt/tests/source/issue-4689/one.rs",
+    "src/tools/rustfmt/tests/source/issue-4689/two.rs",
+    "src/tools/rustfmt/tests/source/paths.rs",
+    "src/tools/rustfmt/tests/source/structs.rs",
+    "src/tools/rustfmt/tests/target/attrib.rs",
+    "src/tools/rustfmt/tests/target/closure.rs",
+    "src/tools/rustfmt/tests/target/existential_type.rs",
+    "src/tools/rustfmt/tests/target/fn-simple.rs",
+    "src/tools/rustfmt/tests/target/fn.rs",
+    "src/tools/rustfmt/tests/target/fn_args_layout-vertical.rs",
+    "src/tools/rustfmt/tests/target/issue-4689/one.rs",
+    "src/tools/rustfmt/tests/target/issue-4689/two.rs",
+    "src/tools/rustfmt/tests/target/paths.rs",
+    "src/tools/rustfmt/tests/target/structs.rs",
+    "tests/codegen-units/item-collection/non-generic-closures.rs",
+    "tests/debuginfo/recursive-enum.rs",
+    "tests/pretty/closure-reform-pretty.rs",
+    "tests/run-make/reproducible-build-2/reproducible-build.rs",
+    "tests/run-make/reproducible-build/reproducible-build.rs",
+    "tests/ui/auxiliary/typeid-intrinsic-aux1.rs",
+    "tests/ui/auxiliary/typeid-intrinsic-aux2.rs",
+    "tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs",
+    "tests/ui/lifetimes/auxiliary/lifetime_bound_will_change_warning_lib.rs",
+    "tests/ui/lifetimes/bare-trait-object-borrowck.rs",
+    "tests/ui/lifetimes/bare-trait-object.rs",
+    "tests/ui/parser/bounds-obj-parens.rs",
+
+    // Invalid unparenthesized range pattern inside slice pattern: `[1..]`
+    "tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs",
+
+    // Various extensions to Rust syntax made up by rust-analyzer
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0012_type_item_where_clause.rs",
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0058_range_pat.rs",
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0123_param_list_vararg.rs",
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0131_existential_type.rs",
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0156_fn_def_param.rs",
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0179_use_tree_abs_star.rs",
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0188_const_param_default_path.rs",
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/ok/0015_use_tree.rs",
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/ok/0029_range_forms.rs",
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/ok/0051_parameter_attrs.rs",
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/ok/0055_dot_dot_dot.rs",
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/ok/0068_item_modifiers.rs",
+    "src/tools/rust-analyzer/crates/syntax/test_data/parser/validation/0031_block_inner_attrs.rs",
+    "src/tools/rust-analyzer/crates/syntax/test_data/parser/validation/0038_endless_inclusive_range.rs",
+    "src/tools/rust-analyzer/crates/syntax/test_data/parser/validation/0045_ambiguous_trait_object.rs",
+    "src/tools/rust-analyzer/crates/syntax/test_data/parser/validation/0046_mutable_const_item.rs",
+
+    // Placeholder syntax for "throw expressions"
+    "compiler/rustc_errors/src/translation.rs",
+    "compiler/rustc_expand/src/module.rs",
+    "compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs",
+    "src/tools/clippy/tests/ui/needless_return.rs",
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0204_yeet_expr.rs",
+    "tests/pretty/yeet-expr.rs",
+    "tests/ui/try-trait/yeet-for-option.rs",
+    "tests/ui/try-trait/yeet-for-result.rs",
+
+    // Edition 2015 code using identifiers that are now keywords
+    // TODO: some of these we should probably parse
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0159_try_macro_fallback.rs",
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0160_try_macro_rules.rs",
+    "src/tools/rustfmt/tests/source/configs/indent_style/block_call.rs",
+    "src/tools/rustfmt/tests/source/configs/use_try_shorthand/false.rs",
+    "src/tools/rustfmt/tests/source/configs/use_try_shorthand/true.rs",
+    "src/tools/rustfmt/tests/source/issue_1306.rs",
+    "src/tools/rustfmt/tests/source/try-conversion.rs",
+    "src/tools/rustfmt/tests/target/configs/indent_style/block_call.rs",
+    "src/tools/rustfmt/tests/target/configs/use_try_shorthand/false.rs",
+    "src/tools/rustfmt/tests/target/issue-1681.rs",
+    "src/tools/rustfmt/tests/target/issue_1306.rs",
+    "tests/ui/dyn-keyword/dyn-2015-no-warnings-without-lints.rs",
+    "tests/ui/editions/edition-keywords-2015-2015.rs",
+    "tests/ui/editions/edition-keywords-2015-2018.rs",
+    "tests/ui/lint/lint_pre_expansion_extern_module_aux.rs",
+    "tests/ui/macros/macro-comma-support-rpass.rs",
+    "tests/ui/macros/try-macro.rs",
+    "tests/ui/parser/extern-crate-async.rs",
+    "tests/ui/try-block/try-is-identifier-edition2015.rs",
+
+    // Excessive nesting
+    "tests/ui/issues/issue-74564-if-expr-stack-overflow.rs",
+
+    // Testing tools on invalid syntax
+    "src/tools/rustfmt/tests/coverage/target/comments.rs",
+    "src/tools/rustfmt/tests/parser/issue-4126/invalid.rs",
+    "src/tools/rustfmt/tests/parser/issue_4418.rs",
+    "src/tools/rustfmt/tests/parser/stashed-diag.rs",
+    "src/tools/rustfmt/tests/parser/stashed-diag2.rs",
+    "src/tools/rustfmt/tests/parser/unclosed-delims/issue_4466.rs",
+    "src/tools/rustfmt/tests/source/configs/disable_all_formatting/true.rs",
+    "src/tools/rustfmt/tests/source/configs/spaces_around_ranges/false.rs",
+    "src/tools/rustfmt/tests/source/configs/spaces_around_ranges/true.rs",
+    "src/tools/rustfmt/tests/source/type.rs",
+    "src/tools/rustfmt/tests/target/configs/spaces_around_ranges/false.rs",
+    "src/tools/rustfmt/tests/target/configs/spaces_around_ranges/true.rs",
+    "src/tools/rustfmt/tests/target/type.rs",
+    "tests/run-make/translation/test.rs",
+    "tests/ui/generics/issue-94432-garbage-ice.rs",
+
+    // Generated file containing a top-level expression, used with `include!`
+    "compiler/rustc_codegen_gcc/src/intrinsic/archs.rs",
+
+    // Clippy lint lists represented as expressions
+    "src/tools/clippy/clippy_lints/src/lib.deprecated.rs",
+
+    // Not actually test cases
+    "tests/ui/lint/expansion-time-include.rs",
+    "tests/ui/macros/auxiliary/macro-comma-support.rs",
+    "tests/ui/macros/auxiliary/macro-include-items-expr.rs",
+    "tests/ui/macros/include-single-expr-helper.rs",
+    "tests/ui/macros/include-single-expr-helper-1.rs",
+    "tests/ui/parser/issues/auxiliary/issue-21146-inc.rs",
+];
+
+#[rustfmt::skip]
+static EXCLUDE_DIRS: &[&str] = &[
+    // Inputs that intentionally do not parse
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/err",
+    "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err",
+
+    // Inputs that lex but do not necessarily parse
+    "src/tools/rust-analyzer/crates/parser/test_data/lexer",
+
+    // Inputs that used to crash rust-analyzer, but aren't necessarily supposed to parse
+    "src/tools/rust-analyzer/crates/syntax/test_data/parser/fuzz-failures",
+    "src/tools/rust-analyzer/crates/syntax/test_data/reparse/fuzz-failures",
+
+    // Inputs that crash rustc, making no claim about whether they are valid Rust
+    "tests/crashes",
+];
+
+// Directories in which a .stderr implies the corresponding .rs is not expected
+// to work.
+static UI_TEST_DIRS: &[&str] = &["tests/ui", "tests/rustdoc-ui"];
+
+pub fn for_each_rust_file(for_each: impl Fn(&Path) + Sync + Send) {
+    let mut rs_files = BTreeSet::new();
+
+    let repo_dir = Path::new("tests/rust");
+    for entry in WalkDir::new(repo_dir)
+        .into_iter()
+        .filter_entry(base_dir_filter)
+    {
+        let entry = entry.unwrap();
+        if !entry.file_type().is_dir() {
+            rs_files.insert(entry.into_path());
+        }
+    }
+
+    for ui_test_dir in UI_TEST_DIRS {
+        for entry in WalkDir::new(repo_dir.join(ui_test_dir)) {
+            let mut path = entry.unwrap().into_path();
+            if path.extension() == Some(OsStr::new("stderr")) {
+                loop {
+                    rs_files.remove(&path.with_extension("rs"));
+                    path = path.with_extension("");
+                    if path.extension().is_none() {
+                        break;
+                    }
+                }
+            }
+        }
+    }
+
+    rs_files.par_iter().map(PathBuf::as_path).for_each(for_each);
+}
+
+pub fn base_dir_filter(entry: &DirEntry) -> bool {
+    let path = entry.path();
+
+    let mut path_string = path.to_string_lossy();
+    if cfg!(windows) {
+        path_string = path_string.replace('\\', "/").into();
+    }
+    let path_string = if path_string == "tests/rust" {
+        return true;
+    } else if let Some(path) = path_string.strip_prefix("tests/rust/") {
+        path
+    } else {
+        panic!("unexpected path in Rust dist: {}", path_string);
+    };
+
+    if path.is_dir() {
+        return !EXCLUDE_DIRS.contains(&path_string);
+    }
+
+    if path.extension() != Some(OsStr::new("rs")) {
+        return false;
+    }
+
+    !EXCLUDE_FILES.contains(&path_string)
+}
+
+#[allow(dead_code)]
+pub fn edition(path: &Path) -> &'static str {
+    if path.ends_with("dyn-2015-no-warnings-without-lints.rs") {
+        "2015"
+    } else {
+        "2021"
+    }
+}
+
+#[allow(dead_code)]
+pub fn abort_after() -> usize {
+    match env::var("ABORT_AFTER_FAILURE") {
+        Ok(s) => s.parse().expect("failed to parse ABORT_AFTER_FAILURE"),
+        Err(_) => usize::MAX,
+    }
+}
+
+pub fn rayon_init() {
+    let stack_size = match env::var("RUST_MIN_STACK") {
+        Ok(s) => s.parse().expect("failed to parse RUST_MIN_STACK"),
+        Err(_) => 1024 * 1024 * if cfg!(debug_assertions) { 40 } else { 20 },
+    };
+    ThreadPoolBuilder::new()
+        .stack_size(stack_size)
+        .build_global()
+        .unwrap();
+}
+
+pub fn clone_rust() {
+    let needs_clone = match fs::read_to_string("tests/rust/COMMIT") {
+        Err(_) => true,
+        Ok(contents) => contents.trim() != REVISION,
+    };
+    if needs_clone {
+        download_and_unpack().unwrap();
+    }
+
+    let mut missing = String::new();
+    let test_src = Path::new("tests/rust");
+
+    let mut exclude_files_set = BTreeSet::new();
+    for exclude in EXCLUDE_FILES {
+        if !exclude_files_set.insert(exclude) {
+            panic!("duplicate path in EXCLUDE_FILES: {}", exclude);
+        }
+        for dir in EXCLUDE_DIRS {
+            if Path::new(exclude).starts_with(dir) {
+                panic!("excluded file {} is inside an excluded dir", exclude);
+            }
+        }
+        if !test_src.join(exclude).is_file() {
+            missing += "\ntests/rust/";
+            missing += exclude;
+        }
+    }
+
+    let mut exclude_dirs_set = BTreeSet::new();
+    for exclude in EXCLUDE_DIRS {
+        if !exclude_dirs_set.insert(exclude) {
+            panic!("duplicate path in EXCLUDE_DIRS: {}", exclude);
+        }
+        if !test_src.join(exclude).is_dir() {
+            missing += "\ntests/rust/";
+            missing += exclude;
+            missing += "/";
+        }
+    }
+
+    if !missing.is_empty() {
+        panic!("excluded test file does not exist:{}\n", missing);
+    }
+}
+
+fn download_and_unpack() -> Result<()> {
+    let url = format!(
+        "https://github.com/rust-lang/rust/archive/{}.tar.gz",
+        REVISION
+    );
+    let response = reqwest::blocking::get(url)?.error_for_status()?;
+    let progress = Progress::new(response);
+    let decoder = GzDecoder::new(progress);
+    let mut archive = Archive::new(decoder);
+    let prefix = format!("rust-{}", REVISION);
+
+    let tests_rust = Path::new("tests/rust");
+    if tests_rust.exists() {
+        fs::remove_dir_all(tests_rust)?;
+    }
+
+    for entry in archive.entries()? {
+        let mut entry = entry?;
+        let path = entry.path()?;
+        if path == Path::new("pax_global_header") {
+            continue;
+        }
+        let relative = path.strip_prefix(&prefix)?;
+        let out = tests_rust.join(relative);
+        entry.unpack(&out)?;
+    }
+
+    fs::write("tests/rust/COMMIT", REVISION)?;
+    Ok(())
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/repo/progress.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/repo/progress.rs
--- 43.0.0-1/rust-vendor/syn/tests/repo/progress.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/repo/progress.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,37 @@
+use std::io::{Read, Result};
+use std::time::{Duration, Instant};
+
+pub struct Progress<R> {
+    bytes: usize,
+    tick: Instant,
+    stream: R,
+}
+
+impl<R> Progress<R> {
+    pub fn new(stream: R) -> Self {
+        Progress {
+            bytes: 0,
+            tick: Instant::now() + Duration::from_millis(2000),
+            stream,
+        }
+    }
+}
+
+impl<R: Read> Read for Progress<R> {
+    fn read(&mut self, buf: &mut [u8]) -> Result<usize> {
+        let num = self.stream.read(buf)?;
+        self.bytes += num;
+        let now = Instant::now();
+        if now > self.tick {
+            self.tick = now + Duration::from_millis(500);
+            errorf!("downloading... {} bytes\n", self.bytes);
+        }
+        Ok(num)
+    }
+}
+
+impl<R> Drop for Progress<R> {
+    fn drop(&mut self) {
+        errorf!("done ({} bytes)\n", self.bytes);
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_asyncness.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_asyncness.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_asyncness.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_asyncness.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,43 @@
+#![allow(clippy::uninlined_format_args)]
+
+#[macro_use]
+mod macros;
+
+use syn::{Expr, Item};
+
+#[test]
+fn test_async_fn() {
+    let input = "async fn process() {}";
+
+    snapshot!(input as Item, @r###"
+    Item::Fn {
+        vis: Visibility::Inherited,
+        sig: Signature {
+            asyncness: Some,
+            ident: "process",
+            generics: Generics,
+            output: ReturnType::Default,
+        },
+        block: Block {
+            stmts: [],
+        },
+    }
+    "###);
+}
+
+#[test]
+fn test_async_closure() {
+    let input = "async || {}";
+
+    snapshot!(input as Expr, @r###"
+    Expr::Closure {
+        asyncness: Some,
+        output: ReturnType::Default,
+        body: Expr::Block {
+            block: Block {
+                stmts: [],
+            },
+        },
+    }
+    "###);
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_attribute.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_attribute.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_attribute.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_attribute.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,225 @@
+#![allow(clippy::uninlined_format_args)]
+
+#[macro_use]
+mod macros;
+
+use syn::parse::Parser;
+use syn::{Attribute, Meta};
+
+#[test]
+fn test_meta_item_word() {
+    let meta = test("#[foo]");
+
+    snapshot!(meta, @r###"
+    Meta::Path {
+        segments: [
+            PathSegment {
+                ident: "foo",
+            },
+        ],
+    }
+    "###);
+}
+
+#[test]
+fn test_meta_item_name_value() {
+    let meta = test("#[foo = 5]");
+
+    snapshot!(meta, @r###"
+    Meta::NameValue {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "foo",
+                },
+            ],
+        },
+        value: Expr::Lit {
+            lit: 5,
+        },
+    }
+    "###);
+}
+
+#[test]
+fn test_meta_item_bool_value() {
+    let meta = test("#[foo = true]");
+
+    snapshot!(meta, @r###"
+    Meta::NameValue {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "foo",
+                },
+            ],
+        },
+        value: Expr::Lit {
+            lit: Lit::Bool {
+                value: true,
+            },
+        },
+    }
+    "###);
+
+    let meta = test("#[foo = false]");
+
+    snapshot!(meta, @r###"
+    Meta::NameValue {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "foo",
+                },
+            ],
+        },
+        value: Expr::Lit {
+            lit: Lit::Bool {
+                value: false,
+            },
+        },
+    }
+    "###);
+}
+
+#[test]
+fn test_meta_item_list_lit() {
+    let meta = test("#[foo(5)]");
+
+    snapshot!(meta, @r###"
+    Meta::List {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "foo",
+                },
+            ],
+        },
+        delimiter: MacroDelimiter::Paren,
+        tokens: TokenStream(`5`),
+    }
+    "###);
+}
+
+#[test]
+fn test_meta_item_list_word() {
+    let meta = test("#[foo(bar)]");
+
+    snapshot!(meta, @r###"
+    Meta::List {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "foo",
+                },
+            ],
+        },
+        delimiter: MacroDelimiter::Paren,
+        tokens: TokenStream(`bar`),
+    }
+    "###);
+}
+
+#[test]
+fn test_meta_item_list_name_value() {
+    let meta = test("#[foo(bar = 5)]");
+
+    snapshot!(meta, @r###"
+    Meta::List {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "foo",
+                },
+            ],
+        },
+        delimiter: MacroDelimiter::Paren,
+        tokens: TokenStream(`bar = 5`),
+    }
+    "###);
+}
+
+#[test]
+fn test_meta_item_list_bool_value() {
+    let meta = test("#[foo(bar = true)]");
+
+    snapshot!(meta, @r###"
+    Meta::List {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "foo",
+                },
+            ],
+        },
+        delimiter: MacroDelimiter::Paren,
+        tokens: TokenStream(`bar = true`),
+    }
+    "###);
+}
+
+#[test]
+fn test_meta_item_multiple() {
+    let meta = test("#[foo(word, name = 5, list(name2 = 6), word2)]");
+
+    snapshot!(meta, @r###"
+    Meta::List {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "foo",
+                },
+            ],
+        },
+        delimiter: MacroDelimiter::Paren,
+        tokens: TokenStream(`word , name = 5 , list (name2 = 6) , word2`),
+    }
+    "###);
+}
+
+#[test]
+fn test_bool_lit() {
+    let meta = test("#[foo(true)]");
+
+    snapshot!(meta, @r###"
+    Meta::List {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "foo",
+                },
+            ],
+        },
+        delimiter: MacroDelimiter::Paren,
+        tokens: TokenStream(`true`),
+    }
+    "###);
+}
+
+#[test]
+fn test_negative_lit() {
+    let meta = test("#[form(min = -1, max = 200)]");
+
+    snapshot!(meta, @r###"
+    Meta::List {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "form",
+                },
+            ],
+        },
+        delimiter: MacroDelimiter::Paren,
+        tokens: TokenStream(`min = - 1 , max = 200`),
+    }
+    "###);
+}
+
+fn test(input: &str) -> Meta {
+    let attrs = Attribute::parse_outer.parse_str(input).unwrap();
+
+    assert_eq!(attrs.len(), 1);
+    let attr = attrs.into_iter().next().unwrap();
+
+    attr.meta
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_derive_input.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_derive_input.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_derive_input.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_derive_input.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,781 @@
+#![allow(
+    clippy::assertions_on_result_states,
+    clippy::manual_let_else,
+    clippy::too_many_lines,
+    clippy::uninlined_format_args
+)]
+
+#[macro_use]
+mod macros;
+
+use quote::quote;
+use syn::{Data, DeriveInput};
+
+#[test]
+fn test_unit() {
+    let input = quote! {
+        struct Unit;
+    };
+
+    snapshot!(input as DeriveInput, @r###"
+    DeriveInput {
+        vis: Visibility::Inherited,
+        ident: "Unit",
+        generics: Generics,
+        data: Data::Struct {
+            fields: Fields::Unit,
+            semi_token: Some,
+        },
+    }
+    "###);
+}
+
+#[test]
+fn test_struct() {
+    let input = quote! {
+        #[derive(Debug, Clone)]
+        pub struct Item {
+            pub ident: Ident,
+            pub attrs: Vec<Attribute>
+        }
+    };
+
+    snapshot!(input as DeriveInput, @r###"
+    DeriveInput {
+        attrs: [
+            Attribute {
+                style: AttrStyle::Outer,
+                meta: Meta::List {
+                    path: Path {
+                        segments: [
+                            PathSegment {
+                                ident: "derive",
+                            },
+                        ],
+                    },
+                    delimiter: MacroDelimiter::Paren,
+                    tokens: TokenStream(`Debug , Clone`),
+                },
+            },
+        ],
+        vis: Visibility::Public,
+        ident: "Item",
+        generics: Generics,
+        data: Data::Struct {
+            fields: Fields::Named {
+                named: [
+                    Field {
+                        vis: Visibility::Public,
+                        ident: Some("ident"),
+                        colon_token: Some,
+                        ty: Type::Path {
+                            path: Path {
+                                segments: [
+                                    PathSegment {
+                                        ident: "Ident",
+                                    },
+                                ],
+                            },
+                        },
+                    },
+                    Token![,],
+                    Field {
+                        vis: Visibility::Public,
+                        ident: Some("attrs"),
+                        colon_token: Some,
+                        ty: Type::Path {
+                            path: Path {
+                                segments: [
+                                    PathSegment {
+                                        ident: "Vec",
+                                        arguments: PathArguments::AngleBracketed {
+                                            args: [
+                                                GenericArgument::Type(Type::Path {
+                                                    path: Path {
+                                                        segments: [
+                                                            PathSegment {
+                                                                ident: "Attribute",
+                                                            },
+                                                        ],
+                                                    },
+                                                }),
+                                            ],
+                                        },
+                                    },
+                                ],
+                            },
+                        },
+                    },
+                ],
+            },
+        },
+    }
+    "###);
+
+    snapshot!(&input.attrs[0].meta, @r###"
+    Meta::List {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "derive",
+                },
+            ],
+        },
+        delimiter: MacroDelimiter::Paren,
+        tokens: TokenStream(`Debug , Clone`),
+    }
+    "###);
+}
+
+#[test]
+fn test_union() {
+    let input = quote! {
+        union MaybeUninit<T> {
+            uninit: (),
+            value: T
+        }
+    };
+
+    snapshot!(input as DeriveInput, @r###"
+    DeriveInput {
+        vis: Visibility::Inherited,
+        ident: "MaybeUninit",
+        generics: Generics {
+            lt_token: Some,
+            params: [
+                GenericParam::Type(TypeParam {
+                    ident: "T",
+                }),
+            ],
+            gt_token: Some,
+        },
+        data: Data::Union {
+            fields: FieldsNamed {
+                named: [
+                    Field {
+                        vis: Visibility::Inherited,
+                        ident: Some("uninit"),
+                        colon_token: Some,
+                        ty: Type::Tuple,
+                    },
+                    Token![,],
+                    Field {
+                        vis: Visibility::Inherited,
+                        ident: Some("value"),
+                        colon_token: Some,
+                        ty: Type::Path {
+                            path: Path {
+                                segments: [
+                                    PathSegment {
+                                        ident: "T",
+                                    },
+                                ],
+                            },
+                        },
+                    },
+                ],
+            },
+        },
+    }
+    "###);
+}
+
+#[test]
+#[cfg(feature = "full")]
+fn test_enum() {
+    let input = quote! {
+        /// See the std::result module documentation for details.
+        #[must_use]
+        pub enum Result<T, E> {
+            Ok(T),
+            Err(E),
+            Surprise = 0isize,
+
+            // Smuggling data into a proc_macro_derive,
+            // in the style of https://github.com/dtolnay/proc-macro-hack
+            ProcMacroHack = (0, "data").0
+        }
+    };
+
+    snapshot!(input as DeriveInput, @r###"
+    DeriveInput {
+        attrs: [
+            Attribute {
+                style: AttrStyle::Outer,
+                meta: Meta::NameValue {
+                    path: Path {
+                        segments: [
+                            PathSegment {
+                                ident: "doc",
+                            },
+                        ],
+                    },
+                    value: Expr::Lit {
+                        lit: " See the std::result module documentation for details.",
+                    },
+                },
+            },
+            Attribute {
+                style: AttrStyle::Outer,
+                meta: Meta::Path {
+                    segments: [
+                        PathSegment {
+                            ident: "must_use",
+                        },
+                    ],
+                },
+            },
+        ],
+        vis: Visibility::Public,
+        ident: "Result",
+        generics: Generics {
+            lt_token: Some,
+            params: [
+                GenericParam::Type(TypeParam {
+                    ident: "T",
+                }),
+                Token![,],
+                GenericParam::Type(TypeParam {
+                    ident: "E",
+                }),
+            ],
+            gt_token: Some,
+        },
+        data: Data::Enum {
+            variants: [
+                Variant {
+                    ident: "Ok",
+                    fields: Fields::Unnamed {
+                        unnamed: [
+                            Field {
+                                vis: Visibility::Inherited,
+                                ty: Type::Path {
+                                    path: Path {
+                                        segments: [
+                                            PathSegment {
+                                                ident: "T",
+                                            },
+                                        ],
+                                    },
+                                },
+                            },
+                        ],
+                    },
+                },
+                Token![,],
+                Variant {
+                    ident: "Err",
+                    fields: Fields::Unnamed {
+                        unnamed: [
+                            Field {
+                                vis: Visibility::Inherited,
+                                ty: Type::Path {
+                                    path: Path {
+                                        segments: [
+                                            PathSegment {
+                                                ident: "E",
+                                            },
+                                        ],
+                                    },
+                                },
+                            },
+                        ],
+                    },
+                },
+                Token![,],
+                Variant {
+                    ident: "Surprise",
+                    fields: Fields::Unit,
+                    discriminant: Some(Expr::Lit {
+                        lit: 0isize,
+                    }),
+                },
+                Token![,],
+                Variant {
+                    ident: "ProcMacroHack",
+                    fields: Fields::Unit,
+                    discriminant: Some(Expr::Field {
+                        base: Expr::Tuple {
+                            elems: [
+                                Expr::Lit {
+                                    lit: 0,
+                                },
+                                Token![,],
+                                Expr::Lit {
+                                    lit: "data",
+                                },
+                            ],
+                        },
+                        member: Member::Unnamed(Index {
+                            index: 0,
+                        }),
+                    }),
+                },
+            ],
+        },
+    }
+    "###);
+
+    let meta_items: Vec<_> = input.attrs.into_iter().map(|attr| attr.meta).collect();
+
+    snapshot!(meta_items, @r###"
+    [
+        Meta::NameValue {
+            path: Path {
+                segments: [
+                    PathSegment {
+                        ident: "doc",
+                    },
+                ],
+            },
+            value: Expr::Lit {
+                lit: " See the std::result module documentation for details.",
+            },
+        },
+        Meta::Path {
+            segments: [
+                PathSegment {
+                    ident: "must_use",
+                },
+            ],
+        },
+    ]
+    "###);
+}
+
+#[test]
+fn test_attr_with_non_mod_style_path() {
+    let input = quote! {
+        #[inert <T>]
+        struct S;
+    };
+
+    syn::parse2::<DeriveInput>(input).unwrap_err();
+}
+
+#[test]
+fn test_attr_with_mod_style_path_with_self() {
+    let input = quote! {
+        #[foo::self]
+        struct S;
+    };
+
+    snapshot!(input as DeriveInput, @r###"
+    DeriveInput {
+        attrs: [
+            Attribute {
+                style: AttrStyle::Outer,
+                meta: Meta::Path {
+                    segments: [
+                        PathSegment {
+                            ident: "foo",
+                        },
+                        Token![::],
+                        PathSegment {
+                            ident: "self",
+                        },
+                    ],
+                },
+            },
+        ],
+        vis: Visibility::Inherited,
+        ident: "S",
+        generics: Generics,
+        data: Data::Struct {
+            fields: Fields::Unit,
+            semi_token: Some,
+        },
+    }
+    "###);
+
+    snapshot!(&input.attrs[0].meta, @r###"
+    Meta::Path {
+        segments: [
+            PathSegment {
+                ident: "foo",
+            },
+            Token![::],
+            PathSegment {
+                ident: "self",
+            },
+        ],
+    }
+    "###);
+}
+
+#[test]
+fn test_pub_restricted() {
+    // Taken from tests/rust/src/test/ui/resolve/auxiliary/privacy-struct-ctor.rs
+    let input = quote! {
+        pub(in m) struct Z(pub(in m::n) u8);
+    };
+
+    snapshot!(input as DeriveInput, @r###"
+    DeriveInput {
+        vis: Visibility::Restricted {
+            in_token: Some,
+            path: Path {
+                segments: [
+                    PathSegment {
+                        ident: "m",
+                    },
+                ],
+            },
+        },
+        ident: "Z",
+        generics: Generics,
+        data: Data::Struct {
+            fields: Fields::Unnamed {
+                unnamed: [
+                    Field {
+                        vis: Visibility::Restricted {
+                            in_token: Some,
+                            path: Path {
+                                segments: [
+                                    PathSegment {
+                                        ident: "m",
+                                    },
+                                    Token![::],
+                                    PathSegment {
+                                        ident: "n",
+                                    },
+                                ],
+                            },
+                        },
+                        ty: Type::Path {
+                            path: Path {
+                                segments: [
+                                    PathSegment {
+                                        ident: "u8",
+                                    },
+                                ],
+                            },
+                        },
+                    },
+                ],
+            },
+            semi_token: Some,
+        },
+    }
+    "###);
+}
+
+#[test]
+fn test_pub_restricted_crate() {
+    let input = quote! {
+        pub(crate) struct S;
+    };
+
+    snapshot!(input as DeriveInput, @r###"
+    DeriveInput {
+        vis: Visibility::Restricted {
+            path: Path {
+                segments: [
+                    PathSegment {
+                        ident: "crate",
+                    },
+                ],
+            },
+        },
+        ident: "S",
+        generics: Generics,
+        data: Data::Struct {
+            fields: Fields::Unit,
+            semi_token: Some,
+        },
+    }
+    "###);
+}
+
+#[test]
+fn test_pub_restricted_super() {
+    let input = quote! {
+        pub(super) struct S;
+    };
+
+    snapshot!(input as DeriveInput, @r###"
+    DeriveInput {
+        vis: Visibility::Restricted {
+            path: Path {
+                segments: [
+                    PathSegment {
+                        ident: "super",
+                    },
+                ],
+            },
+        },
+        ident: "S",
+        generics: Generics,
+        data: Data::Struct {
+            fields: Fields::Unit,
+            semi_token: Some,
+        },
+    }
+    "###);
+}
+
+#[test]
+fn test_pub_restricted_in_super() {
+    let input = quote! {
+        pub(in super) struct S;
+    };
+
+    snapshot!(input as DeriveInput, @r###"
+    DeriveInput {
+        vis: Visibility::Restricted {
+            in_token: Some,
+            path: Path {
+                segments: [
+                    PathSegment {
+                        ident: "super",
+                    },
+                ],
+            },
+        },
+        ident: "S",
+        generics: Generics,
+        data: Data::Struct {
+            fields: Fields::Unit,
+            semi_token: Some,
+        },
+    }
+    "###);
+}
+
+#[test]
+fn test_fields_on_unit_struct() {
+    let input = quote! {
+        struct S;
+    };
+
+    snapshot!(input as DeriveInput, @r###"
+    DeriveInput {
+        vis: Visibility::Inherited,
+        ident: "S",
+        generics: Generics,
+        data: Data::Struct {
+            fields: Fields::Unit,
+            semi_token: Some,
+        },
+    }
+    "###);
+
+    let data = match input.data {
+        Data::Struct(data) => data,
+        _ => panic!("expected a struct"),
+    };
+
+    assert_eq!(0, data.fields.iter().count());
+}
+
+#[test]
+fn test_fields_on_named_struct() {
+    let input = quote! {
+        struct S {
+            foo: i32,
+            pub bar: String,
+        }
+    };
+
+    snapshot!(input as DeriveInput, @r###"
+    DeriveInput {
+        vis: Visibility::Inherited,
+        ident: "S",
+        generics: Generics,
+        data: Data::Struct {
+            fields: Fields::Named {
+                named: [
+                    Field {
+                        vis: Visibility::Inherited,
+                        ident: Some("foo"),
+                        colon_token: Some,
+                        ty: Type::Path {
+                            path: Path {
+                                segments: [
+                                    PathSegment {
+                                        ident: "i32",
+                                    },
+                                ],
+                            },
+                        },
+                    },
+                    Token![,],
+                    Field {
+                        vis: Visibility::Public,
+                        ident: Some("bar"),
+                        colon_token: Some,
+                        ty: Type::Path {
+                            path: Path {
+                                segments: [
+                                    PathSegment {
+                                        ident: "String",
+                                    },
+                                ],
+                            },
+                        },
+                    },
+                    Token![,],
+                ],
+            },
+        },
+    }
+    "###);
+
+    let data = match input.data {
+        Data::Struct(data) => data,
+        _ => panic!("expected a struct"),
+    };
+
+    snapshot!(data.fields.into_iter().collect::<Vec<_>>(), @r###"
+    [
+        Field {
+            vis: Visibility::Inherited,
+            ident: Some("foo"),
+            colon_token: Some,
+            ty: Type::Path {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "i32",
+                        },
+                    ],
+                },
+            },
+        },
+        Field {
+            vis: Visibility::Public,
+            ident: Some("bar"),
+            colon_token: Some,
+            ty: Type::Path {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "String",
+                        },
+                    ],
+                },
+            },
+        },
+    ]
+    "###);
+}
+
+#[test]
+fn test_fields_on_tuple_struct() {
+    let input = quote! {
+        struct S(i32, pub String);
+    };
+
+    snapshot!(input as DeriveInput, @r###"
+    DeriveInput {
+        vis: Visibility::Inherited,
+        ident: "S",
+        generics: Generics,
+        data: Data::Struct {
+            fields: Fields::Unnamed {
+                unnamed: [
+                    Field {
+                        vis: Visibility::Inherited,
+                        ty: Type::Path {
+                            path: Path {
+                                segments: [
+                                    PathSegment {
+                                        ident: "i32",
+                                    },
+                                ],
+                            },
+                        },
+                    },
+                    Token![,],
+                    Field {
+                        vis: Visibility::Public,
+                        ty: Type::Path {
+                            path: Path {
+                                segments: [
+                                    PathSegment {
+                                        ident: "String",
+                                    },
+                                ],
+                            },
+                        },
+                    },
+                ],
+            },
+            semi_token: Some,
+        },
+    }
+    "###);
+
+    let data = match input.data {
+        Data::Struct(data) => data,
+        _ => panic!("expected a struct"),
+    };
+
+    snapshot!(data.fields.iter().collect::<Vec<_>>(), @r###"
+    [
+        Field {
+            vis: Visibility::Inherited,
+            ty: Type::Path {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "i32",
+                        },
+                    ],
+                },
+            },
+        },
+        Field {
+            vis: Visibility::Public,
+            ty: Type::Path {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "String",
+                        },
+                    ],
+                },
+            },
+        },
+    ]
+    "###);
+}
+
+#[test]
+fn test_ambiguous_crate() {
+    let input = quote! {
+        // The field type is `(crate::X)` not `crate (::X)`.
+        struct S(crate::X);
+    };
+
+    snapshot!(input as DeriveInput, @r###"
+    DeriveInput {
+        vis: Visibility::Inherited,
+        ident: "S",
+        generics: Generics,
+        data: Data::Struct {
+            fields: Fields::Unnamed {
+                unnamed: [
+                    Field {
+                        vis: Visibility::Inherited,
+                        ty: Type::Path {
+                            path: Path {
+                                segments: [
+                                    PathSegment {
+                                        ident: "crate",
+                                    },
+                                    Token![::],
+                                    PathSegment {
+                                        ident: "X",
+                                    },
+                                ],
+                            },
+                        },
+                    },
+                ],
+            },
+            semi_token: Some,
+        },
+    }
+    "###);
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_expr.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_expr.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_expr.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_expr.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,701 @@
+#![allow(clippy::single_element_loop, clippy::uninlined_format_args)]
+
+#[macro_use]
+mod macros;
+
+use proc_macro2::{Delimiter, Group};
+use quote::{quote, ToTokens as _};
+use std::mem;
+use syn::punctuated::Punctuated;
+use syn::visit_mut::{self, VisitMut};
+use syn::{parse_quote, token, Expr, ExprRange, ExprTuple, Stmt, Token};
+
+#[test]
+fn test_expr_parse() {
+    let tokens = quote!(..100u32);
+    snapshot!(tokens as Expr, @r###"
+    Expr::Range {
+        limits: RangeLimits::HalfOpen,
+        end: Some(Expr::Lit {
+            lit: 100u32,
+        }),
+    }
+    "###);
+
+    let tokens = quote!(..100u32);
+    snapshot!(tokens as ExprRange, @r###"
+    ExprRange {
+        limits: RangeLimits::HalfOpen,
+        end: Some(Expr::Lit {
+            lit: 100u32,
+        }),
+    }
+    "###);
+}
+
+#[test]
+fn test_await() {
+    // Must not parse as Expr::Field.
+    let tokens = quote!(fut.await);
+
+    snapshot!(tokens as Expr, @r###"
+    Expr::Await {
+        base: Expr::Path {
+            path: Path {
+                segments: [
+                    PathSegment {
+                        ident: "fut",
+                    },
+                ],
+            },
+        },
+    }
+    "###);
+}
+
+#[rustfmt::skip]
+#[test]
+fn test_tuple_multi_index() {
+    let expected = snapshot!("tuple.0.0" as Expr, @r###"
+    Expr::Field {
+        base: Expr::Field {
+            base: Expr::Path {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "tuple",
+                        },
+                    ],
+                },
+            },
+            member: Member::Unnamed(Index {
+                index: 0,
+            }),
+        },
+        member: Member::Unnamed(Index {
+            index: 0,
+        }),
+    }
+    "###);
+
+    for &input in &[
+        "tuple .0.0",
+        "tuple. 0.0",
+        "tuple.0 .0",
+        "tuple.0. 0",
+        "tuple . 0 . 0",
+    ] {
+        assert_eq!(expected, syn::parse_str(input).unwrap());
+    }
+
+    for tokens in [
+        quote!(tuple.0.0),
+        quote!(tuple .0.0),
+        quote!(tuple. 0.0),
+        quote!(tuple.0 .0),
+        quote!(tuple.0. 0),
+        quote!(tuple . 0 . 0),
+    ] {
+        assert_eq!(expected, syn::parse2(tokens).unwrap());
+    }
+}
+
+#[test]
+fn test_macro_variable_func() {
+    // mimics the token stream corresponding to `$fn()`
+    let path = Group::new(Delimiter::None, quote!(f));
+    let tokens = quote!(#path());
+
+    snapshot!(tokens as Expr, @r###"
+    Expr::Call {
+        func: Expr::Group {
+            expr: Expr::Path {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "f",
+                        },
+                    ],
+                },
+            },
+        },
+    }
+    "###);
+
+    let path = Group::new(Delimiter::None, quote! { #[inside] f });
+    let tokens = quote!(#[outside] #path());
+
+    snapshot!(tokens as Expr, @r###"
+    Expr::Call {
+        attrs: [
+            Attribute {
+                style: AttrStyle::Outer,
+                meta: Meta::Path {
+                    segments: [
+                        PathSegment {
+                            ident: "outside",
+                        },
+                    ],
+                },
+            },
+        ],
+        func: Expr::Group {
+            expr: Expr::Path {
+                attrs: [
+                    Attribute {
+                        style: AttrStyle::Outer,
+                        meta: Meta::Path {
+                            segments: [
+                                PathSegment {
+                                    ident: "inside",
+                                },
+                            ],
+                        },
+                    },
+                ],
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "f",
+                        },
+                    ],
+                },
+            },
+        },
+    }
+    "###);
+}
+
+#[test]
+fn test_macro_variable_macro() {
+    // mimics the token stream corresponding to `$macro!()`
+    let mac = Group::new(Delimiter::None, quote!(m));
+    let tokens = quote!(#mac!());
+
+    snapshot!(tokens as Expr, @r###"
+    Expr::Macro {
+        mac: Macro {
+            path: Path {
+                segments: [
+                    PathSegment {
+                        ident: "m",
+                    },
+                ],
+            },
+            delimiter: MacroDelimiter::Paren,
+            tokens: TokenStream(``),
+        },
+    }
+    "###);
+}
+
+#[test]
+fn test_macro_variable_struct() {
+    // mimics the token stream corresponding to `$struct {}`
+    let s = Group::new(Delimiter::None, quote! { S });
+    let tokens = quote!(#s {});
+
+    snapshot!(tokens as Expr, @r###"
+    Expr::Struct {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "S",
+                },
+            ],
+        },
+    }
+    "###);
+}
+
+#[test]
+fn test_macro_variable_unary() {
+    // mimics the token stream corresponding to `$expr.method()` where expr is `&self`
+    let inner = Group::new(Delimiter::None, quote!(&self));
+    let tokens = quote!(#inner.method());
+    snapshot!(tokens as Expr, @r###"
+    Expr::MethodCall {
+        receiver: Expr::Group {
+            expr: Expr::Reference {
+                expr: Expr::Path {
+                    path: Path {
+                        segments: [
+                            PathSegment {
+                                ident: "self",
+                            },
+                        ],
+                    },
+                },
+            },
+        },
+        method: "method",
+    }
+    "###);
+}
+
+#[test]
+fn test_macro_variable_match_arm() {
+    // mimics the token stream corresponding to `match v { _ => $expr }`
+    let expr = Group::new(Delimiter::None, quote! { #[a] () });
+    let tokens = quote!(match v { _ => #expr });
+    snapshot!(tokens as Expr, @r###"
+    Expr::Match {
+        expr: Expr::Path {
+            path: Path {
+                segments: [
+                    PathSegment {
+                        ident: "v",
+                    },
+                ],
+            },
+        },
+        arms: [
+            Arm {
+                pat: Pat::Wild,
+                body: Expr::Group {
+                    expr: Expr::Tuple {
+                        attrs: [
+                            Attribute {
+                                style: AttrStyle::Outer,
+                                meta: Meta::Path {
+                                    segments: [
+                                        PathSegment {
+                                            ident: "a",
+                                        },
+                                    ],
+                                },
+                            },
+                        ],
+                    },
+                },
+            },
+        ],
+    }
+    "###);
+
+    let expr = Group::new(Delimiter::None, quote!(loop {} + 1));
+    let tokens = quote!(match v { _ => #expr });
+    snapshot!(tokens as Expr, @r###"
+    Expr::Match {
+        expr: Expr::Path {
+            path: Path {
+                segments: [
+                    PathSegment {
+                        ident: "v",
+                    },
+                ],
+            },
+        },
+        arms: [
+            Arm {
+                pat: Pat::Wild,
+                body: Expr::Group {
+                    expr: Expr::Binary {
+                        left: Expr::Loop {
+                            body: Block {
+                                stmts: [],
+                            },
+                        },
+                        op: BinOp::Add,
+                        right: Expr::Lit {
+                            lit: 1,
+                        },
+                    },
+                },
+            },
+        ],
+    }
+    "###);
+}
+
+// https://github.com/dtolnay/syn/issues/1019
+#[test]
+fn test_closure_vs_rangefull() {
+    #[rustfmt::skip] // rustfmt bug: https://github.com/rust-lang/rustfmt/issues/4808
+    let tokens = quote!(|| .. .method());
+    snapshot!(tokens as Expr, @r###"
+    Expr::MethodCall {
+        receiver: Expr::Closure {
+            output: ReturnType::Default,
+            body: Expr::Range {
+                limits: RangeLimits::HalfOpen,
+            },
+        },
+        method: "method",
+    }
+    "###);
+}
+
+#[test]
+fn test_postfix_operator_after_cast() {
+    syn::parse_str::<Expr>("|| &x as T[0]").unwrap_err();
+    syn::parse_str::<Expr>("|| () as ()()").unwrap_err();
+}
+
+#[test]
+fn test_range_kinds() {
+    syn::parse_str::<Expr>("..").unwrap();
+    syn::parse_str::<Expr>("..hi").unwrap();
+    syn::parse_str::<Expr>("lo..").unwrap();
+    syn::parse_str::<Expr>("lo..hi").unwrap();
+
+    syn::parse_str::<Expr>("..=").unwrap_err();
+    syn::parse_str::<Expr>("..=hi").unwrap();
+    syn::parse_str::<Expr>("lo..=").unwrap_err();
+    syn::parse_str::<Expr>("lo..=hi").unwrap();
+
+    syn::parse_str::<Expr>("...").unwrap_err();
+    syn::parse_str::<Expr>("...hi").unwrap_err();
+    syn::parse_str::<Expr>("lo...").unwrap_err();
+    syn::parse_str::<Expr>("lo...hi").unwrap_err();
+}
+
+#[test]
+fn test_range_precedence() {
+    snapshot!(".. .." as Expr, @r###"
+    Expr::Range {
+        limits: RangeLimits::HalfOpen,
+        end: Some(Expr::Range {
+            limits: RangeLimits::HalfOpen,
+        }),
+    }
+    "###);
+
+    snapshot!(".. .. ()" as Expr, @r###"
+    Expr::Range {
+        limits: RangeLimits::HalfOpen,
+        end: Some(Expr::Range {
+            limits: RangeLimits::HalfOpen,
+            end: Some(Expr::Tuple),
+        }),
+    }
+    "###);
+
+    snapshot!("() .. .." as Expr, @r###"
+    Expr::Range {
+        start: Some(Expr::Tuple),
+        limits: RangeLimits::HalfOpen,
+        end: Some(Expr::Range {
+            limits: RangeLimits::HalfOpen,
+        }),
+    }
+    "###);
+
+    // A range with a lower bound cannot be the upper bound of another range,
+    // and a range with an upper bound cannot be the lower bound of another
+    // range.
+    syn::parse_str::<Expr>(".. x ..").unwrap_err();
+    syn::parse_str::<Expr>("x .. x ..").unwrap_err();
+}
+
+#[test]
+fn test_ambiguous_label() {
+    for stmt in [
+        quote! {
+            return 'label: loop { break 'label 42; };
+        },
+        quote! {
+            break ('label: loop { break 'label 42; });
+        },
+        quote! {
+            break 1 + 'label: loop { break 'label 42; };
+        },
+        quote! {
+            break 'outer 'inner: loop { break 'inner 42; };
+        },
+    ] {
+        syn::parse2::<Stmt>(stmt).unwrap();
+    }
+
+    for stmt in [
+        // Parentheses required. See https://github.com/rust-lang/rust/pull/87026.
+        quote! {
+            break 'label: loop { break 'label 42; };
+        },
+    ] {
+        syn::parse2::<Stmt>(stmt).unwrap_err();
+    }
+}
+
+#[test]
+fn test_extended_interpolated_path() {
+    let path = Group::new(Delimiter::None, quote!(a::b));
+
+    let tokens = quote!(if #path {});
+    snapshot!(tokens as Expr, @r###"
+    Expr::If {
+        cond: Expr::Group {
+            expr: Expr::Path {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "a",
+                        },
+                        Token![::],
+                        PathSegment {
+                            ident: "b",
+                        },
+                    ],
+                },
+            },
+        },
+        then_branch: Block {
+            stmts: [],
+        },
+    }
+    "###);
+
+    let tokens = quote!(#path {});
+    snapshot!(tokens as Expr, @r###"
+    Expr::Struct {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "a",
+                },
+                Token![::],
+                PathSegment {
+                    ident: "b",
+                },
+            ],
+        },
+    }
+    "###);
+
+    let tokens = quote!(#path :: c);
+    snapshot!(tokens as Expr, @r###"
+    Expr::Path {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "a",
+                },
+                Token![::],
+                PathSegment {
+                    ident: "b",
+                },
+                Token![::],
+                PathSegment {
+                    ident: "c",
+                },
+            ],
+        },
+    }
+    "###);
+
+    let nested = Group::new(Delimiter::None, quote!(a::b || true));
+    let tokens = quote!(if #nested && false {});
+    snapshot!(tokens as Expr, @r###"
+    Expr::If {
+        cond: Expr::Binary {
+            left: Expr::Group {
+                expr: Expr::Binary {
+                    left: Expr::Path {
+                        path: Path {
+                            segments: [
+                                PathSegment {
+                                    ident: "a",
+                                },
+                                Token![::],
+                                PathSegment {
+                                    ident: "b",
+                                },
+                            ],
+                        },
+                    },
+                    op: BinOp::Or,
+                    right: Expr::Lit {
+                        lit: Lit::Bool {
+                            value: true,
+                        },
+                    },
+                },
+            },
+            op: BinOp::And,
+            right: Expr::Lit {
+                lit: Lit::Bool {
+                    value: false,
+                },
+            },
+        },
+        then_branch: Block {
+            stmts: [],
+        },
+    }
+    "###);
+}
+
+#[test]
+fn test_tuple_comma() {
+    let mut expr = ExprTuple {
+        attrs: Vec::new(),
+        paren_token: token::Paren::default(),
+        elems: Punctuated::new(),
+    };
+    snapshot!(expr.to_token_stream() as Expr, @"Expr::Tuple");
+
+    expr.elems.push_value(parse_quote!(continue));
+    // Must not parse to Expr::Paren
+    snapshot!(expr.to_token_stream() as Expr, @r###"
+    Expr::Tuple {
+        elems: [
+            Expr::Continue,
+            Token![,],
+        ],
+    }
+    "###);
+
+    expr.elems.push_punct(<Token![,]>::default());
+    snapshot!(expr.to_token_stream() as Expr, @r###"
+    Expr::Tuple {
+        elems: [
+            Expr::Continue,
+            Token![,],
+        ],
+    }
+    "###);
+
+    expr.elems.push_value(parse_quote!(continue));
+    snapshot!(expr.to_token_stream() as Expr, @r###"
+    Expr::Tuple {
+        elems: [
+            Expr::Continue,
+            Token![,],
+            Expr::Continue,
+        ],
+    }
+    "###);
+
+    expr.elems.push_punct(<Token![,]>::default());
+    snapshot!(expr.to_token_stream() as Expr, @r###"
+    Expr::Tuple {
+        elems: [
+            Expr::Continue,
+            Token![,],
+            Expr::Continue,
+            Token![,],
+        ],
+    }
+    "###);
+}
+
+#[test]
+fn test_binop_associativity() {
+    // Left to right.
+    snapshot!("() + () + ()" as Expr, @r###"
+    Expr::Binary {
+        left: Expr::Binary {
+            left: Expr::Tuple,
+            op: BinOp::Add,
+            right: Expr::Tuple,
+        },
+        op: BinOp::Add,
+        right: Expr::Tuple,
+    }
+    "###);
+
+    // Right to left.
+    snapshot!("() += () += ()" as Expr, @r###"
+    Expr::Binary {
+        left: Expr::Tuple,
+        op: BinOp::AddAssign,
+        right: Expr::Binary {
+            left: Expr::Tuple,
+            op: BinOp::AddAssign,
+            right: Expr::Tuple,
+        },
+    }
+    "###);
+
+    // Parenthesization is required.
+    syn::parse_str::<Expr>("() == () == ()").unwrap_err();
+}
+
+#[test]
+fn test_assign_range_precedence() {
+    // Range has higher precedence as the right-hand of an assignment, but
+    // ambiguous precedence as the left-hand of an assignment.
+    snapshot!("() = () .. ()" as Expr, @r###"
+    Expr::Assign {
+        left: Expr::Tuple,
+        right: Expr::Range {
+            start: Some(Expr::Tuple),
+            limits: RangeLimits::HalfOpen,
+            end: Some(Expr::Tuple),
+        },
+    }
+    "###);
+
+    snapshot!("() += () .. ()" as Expr, @r###"
+    Expr::Binary {
+        left: Expr::Tuple,
+        op: BinOp::AddAssign,
+        right: Expr::Range {
+            start: Some(Expr::Tuple),
+            limits: RangeLimits::HalfOpen,
+            end: Some(Expr::Tuple),
+        },
+    }
+    "###);
+
+    syn::parse_str::<Expr>("() .. () = ()").unwrap_err();
+    syn::parse_str::<Expr>("() .. () += ()").unwrap_err();
+}
+
+#[test]
+fn test_fixup() {
+    struct FlattenParens;
+
+    impl VisitMut for FlattenParens {
+        fn visit_expr_mut(&mut self, e: &mut Expr) {
+            while let Expr::Paren(paren) = e {
+                *e = mem::replace(&mut *paren.expr, Expr::PLACEHOLDER);
+            }
+            visit_mut::visit_expr_mut(self, e);
+        }
+    }
+
+    for tokens in [
+        quote! { 2 * (1 + 1) },
+        quote! { 0 + (0 + 0) },
+        quote! { (a = b) = c },
+        quote! { (x as i32) < 0 },
+        quote! { 1 + (x as i32) < 0 },
+        quote! { (1 + 1).abs() },
+        quote! { (lo..hi)[..] },
+        quote! { (a..b)..(c..d) },
+        quote! { (&mut fut).await },
+        quote! { &mut (x as i32) },
+        quote! { -(x as i32) },
+        quote! { if (S {} == 1) {} },
+        quote! { { (m! {}) - 1 } },
+        quote! { match m { _ => ({}) - 1 } },
+        quote! { if let _ = (a && b) && c {} },
+        quote! { if let _ = (S {}) {} },
+        quote! { break ('a: loop { break 'a 1 } + 1) },
+        quote! { a + (|| b) + c },
+        quote! { if let _ = ((break) - 1 || true) {} },
+        quote! { if let _ = (break + 1 || true) {} },
+        quote! { (break)() },
+        quote! { (..) = () },
+        quote! { (..) += () },
+        quote! { (1 < 2) == (3 < 4) },
+        quote! { { (let _ = ()) } },
+    ] {
+        let original: Expr = syn::parse2(tokens).unwrap();
+
+        let mut flat = original.clone();
+        FlattenParens.visit_expr_mut(&mut flat);
+        let reconstructed: Expr = match syn::parse2(flat.to_token_stream()) {
+            Ok(reconstructed) => reconstructed,
+            Err(err) => panic!("failed to parse `{}`: {}", flat.to_token_stream(), err),
+        };
+
+        assert!(
+            original == reconstructed,
+            "original: {}\nreconstructed: {}",
+            original.to_token_stream(),
+            reconstructed.to_token_stream(),
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_generics.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_generics.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_generics.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_generics.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,282 @@
+#![allow(
+    clippy::manual_let_else,
+    clippy::too_many_lines,
+    clippy::uninlined_format_args
+)]
+
+#[macro_use]
+mod macros;
+
+use quote::quote;
+use syn::{DeriveInput, ItemFn, TypeParamBound, WhereClause, WherePredicate};
+
+#[test]
+fn test_split_for_impl() {
+    let input = quote! {
+        struct S<'a, 'b: 'a, #[may_dangle] T: 'a = ()> where T: Debug;
+    };
+
+    snapshot!(input as DeriveInput, @r###"
+    DeriveInput {
+        vis: Visibility::Inherited,
+        ident: "S",
+        generics: Generics {
+            lt_token: Some,
+            params: [
+                GenericParam::Lifetime(LifetimeParam {
+                    lifetime: Lifetime {
+                        ident: "a",
+                    },
+                }),
+                Token![,],
+                GenericParam::Lifetime(LifetimeParam {
+                    lifetime: Lifetime {
+                        ident: "b",
+                    },
+                    colon_token: Some,
+                    bounds: [
+                        Lifetime {
+                            ident: "a",
+                        },
+                    ],
+                }),
+                Token![,],
+                GenericParam::Type(TypeParam {
+                    attrs: [
+                        Attribute {
+                            style: AttrStyle::Outer,
+                            meta: Meta::Path {
+                                segments: [
+                                    PathSegment {
+                                        ident: "may_dangle",
+                                    },
+                                ],
+                            },
+                        },
+                    ],
+                    ident: "T",
+                    colon_token: Some,
+                    bounds: [
+                        TypeParamBound::Lifetime {
+                            ident: "a",
+                        },
+                    ],
+                    eq_token: Some,
+                    default: Some(Type::Tuple),
+                }),
+            ],
+            gt_token: Some,
+            where_clause: Some(WhereClause {
+                predicates: [
+                    WherePredicate::Type(PredicateType {
+                        bounded_ty: Type::Path {
+                            path: Path {
+                                segments: [
+                                    PathSegment {
+                                        ident: "T",
+                                    },
+                                ],
+                            },
+                        },
+                        bounds: [
+                            TypeParamBound::Trait(TraitBound {
+                                path: Path {
+                                    segments: [
+                                        PathSegment {
+                                            ident: "Debug",
+                                        },
+                                    ],
+                                },
+                            }),
+                        ],
+                    }),
+                ],
+            }),
+        },
+        data: Data::Struct {
+            fields: Fields::Unit,
+            semi_token: Some,
+        },
+    }
+    "###);
+
+    let generics = input.generics;
+    let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
+
+    let generated = quote! {
+        impl #impl_generics MyTrait for Test #ty_generics #where_clause {}
+    };
+    let expected = quote! {
+        impl<'a, 'b: 'a, #[may_dangle] T: 'a> MyTrait
+        for Test<'a, 'b, T>
+        where
+            T: Debug
+        {}
+    };
+    assert_eq!(generated.to_string(), expected.to_string());
+
+    let turbofish = ty_generics.as_turbofish();
+    let generated = quote! {
+        Test #turbofish
+    };
+    let expected = quote! {
+        Test::<'a, 'b, T>
+    };
+    assert_eq!(generated.to_string(), expected.to_string());
+}
+
+#[test]
+fn test_ty_param_bound() {
+    let tokens = quote!('a);
+    snapshot!(tokens as TypeParamBound, @r###"
+    TypeParamBound::Lifetime {
+        ident: "a",
+    }
+    "###);
+
+    let tokens = quote!('_);
+    snapshot!(tokens as TypeParamBound, @r###"
+    TypeParamBound::Lifetime {
+        ident: "_",
+    }
+    "###);
+
+    let tokens = quote!(Debug);
+    snapshot!(tokens as TypeParamBound, @r###"
+    TypeParamBound::Trait(TraitBound {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "Debug",
+                },
+            ],
+        },
+    })
+    "###);
+
+    let tokens = quote!(?Sized);
+    snapshot!(tokens as TypeParamBound, @r###"
+    TypeParamBound::Trait(TraitBound {
+        modifier: TraitBoundModifier::Maybe,
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "Sized",
+                },
+            ],
+        },
+    })
+    "###);
+}
+
+#[test]
+fn test_fn_precedence_in_where_clause() {
+    // This should parse as two separate bounds, `FnOnce() -> i32` and `Send` - not
+    // `FnOnce() -> (i32 + Send)`.
+    let input = quote! {
+        fn f<G>()
+        where
+            G: FnOnce() -> i32 + Send,
+        {
+        }
+    };
+
+    snapshot!(input as ItemFn, @r###"
+    ItemFn {
+        vis: Visibility::Inherited,
+        sig: Signature {
+            ident: "f",
+            generics: Generics {
+                lt_token: Some,
+                params: [
+                    GenericParam::Type(TypeParam {
+                        ident: "G",
+                    }),
+                ],
+                gt_token: Some,
+                where_clause: Some(WhereClause {
+                    predicates: [
+                        WherePredicate::Type(PredicateType {
+                            bounded_ty: Type::Path {
+                                path: Path {
+                                    segments: [
+                                        PathSegment {
+                                            ident: "G",
+                                        },
+                                    ],
+                                },
+                            },
+                            bounds: [
+                                TypeParamBound::Trait(TraitBound {
+                                    path: Path {
+                                        segments: [
+                                            PathSegment {
+                                                ident: "FnOnce",
+                                                arguments: PathArguments::Parenthesized {
+                                                    output: ReturnType::Type(
+                                                        Type::Path {
+                                                            path: Path {
+                                                                segments: [
+                                                                    PathSegment {
+                                                                        ident: "i32",
+                                                                    },
+                                                                ],
+                                                            },
+                                                        },
+                                                    ),
+                                                },
+                                            },
+                                        ],
+                                    },
+                                }),
+                                Token![+],
+                                TypeParamBound::Trait(TraitBound {
+                                    path: Path {
+                                        segments: [
+                                            PathSegment {
+                                                ident: "Send",
+                                            },
+                                        ],
+                                    },
+                                }),
+                            ],
+                        }),
+                        Token![,],
+                    ],
+                }),
+            },
+            output: ReturnType::Default,
+        },
+        block: Block {
+            stmts: [],
+        },
+    }
+    "###);
+
+    let where_clause = input.sig.generics.where_clause.as_ref().unwrap();
+    assert_eq!(where_clause.predicates.len(), 1);
+
+    let predicate = match &where_clause.predicates[0] {
+        WherePredicate::Type(pred) => pred,
+        _ => panic!("wrong predicate kind"),
+    };
+
+    assert_eq!(predicate.bounds.len(), 2, "{:#?}", predicate.bounds);
+
+    let first_bound = &predicate.bounds[0];
+    assert_eq!(quote!(#first_bound).to_string(), "FnOnce () -> i32");
+
+    let second_bound = &predicate.bounds[1];
+    assert_eq!(quote!(#second_bound).to_string(), "Send");
+}
+
+#[test]
+fn test_where_clause_at_end_of_input() {
+    let input = quote! {
+        where
+    };
+
+    snapshot!(input as WhereClause, @"WhereClause");
+
+    assert_eq!(input.predicates.len(), 0);
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_grouping.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_grouping.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_grouping.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_grouping.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,53 @@
+#![allow(clippy::uninlined_format_args)]
+
+#[macro_use]
+mod macros;
+
+use proc_macro2::{Delimiter, Group, Literal, Punct, Spacing, TokenStream, TokenTree};
+use syn::Expr;
+
+#[test]
+fn test_grouping() {
+    let tokens: TokenStream = TokenStream::from_iter([
+        TokenTree::Literal(Literal::i32_suffixed(1)),
+        TokenTree::Punct(Punct::new('+', Spacing::Alone)),
+        TokenTree::Group(Group::new(
+            Delimiter::None,
+            TokenStream::from_iter([
+                TokenTree::Literal(Literal::i32_suffixed(2)),
+                TokenTree::Punct(Punct::new('+', Spacing::Alone)),
+                TokenTree::Literal(Literal::i32_suffixed(3)),
+            ]),
+        )),
+        TokenTree::Punct(Punct::new('*', Spacing::Alone)),
+        TokenTree::Literal(Literal::i32_suffixed(4)),
+    ]);
+
+    assert_eq!(tokens.to_string(), "1i32 + 2i32 + 3i32 * 4i32");
+
+    snapshot!(tokens as Expr, @r###"
+    Expr::Binary {
+        left: Expr::Lit {
+            lit: 1i32,
+        },
+        op: BinOp::Add,
+        right: Expr::Binary {
+            left: Expr::Group {
+                expr: Expr::Binary {
+                    left: Expr::Lit {
+                        lit: 2i32,
+                    },
+                    op: BinOp::Add,
+                    right: Expr::Lit {
+                        lit: 3i32,
+                    },
+                },
+            },
+            op: BinOp::Mul,
+            right: Expr::Lit {
+                lit: 4i32,
+            },
+        },
+    }
+    "###);
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_ident.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_ident.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_ident.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_ident.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,87 @@
+use proc_macro2::{Ident, Span, TokenStream};
+use std::str::FromStr;
+use syn::Result;
+
+#[track_caller]
+fn parse(s: &str) -> Result<Ident> {
+    syn::parse2(TokenStream::from_str(s).unwrap())
+}
+
+#[track_caller]
+fn new(s: &str) -> Ident {
+    Ident::new(s, Span::call_site())
+}
+
+#[test]
+fn ident_parse() {
+    parse("String").unwrap();
+}
+
+#[test]
+fn ident_parse_keyword() {
+    parse("abstract").unwrap_err();
+}
+
+#[test]
+fn ident_parse_empty() {
+    parse("").unwrap_err();
+}
+
+#[test]
+fn ident_parse_lifetime() {
+    parse("'static").unwrap_err();
+}
+
+#[test]
+fn ident_parse_underscore() {
+    parse("_").unwrap_err();
+}
+
+#[test]
+fn ident_parse_number() {
+    parse("255").unwrap_err();
+}
+
+#[test]
+fn ident_parse_invalid() {
+    parse("a#").unwrap_err();
+}
+
+#[test]
+fn ident_new() {
+    new("String");
+}
+
+#[test]
+fn ident_new_keyword() {
+    new("abstract");
+}
+
+#[test]
+#[should_panic(expected = "use Option<Ident>")]
+fn ident_new_empty() {
+    new("");
+}
+
+#[test]
+#[should_panic(expected = "not a valid Ident")]
+fn ident_new_lifetime() {
+    new("'static");
+}
+
+#[test]
+fn ident_new_underscore() {
+    new("_");
+}
+
+#[test]
+#[should_panic(expected = "use Literal instead")]
+fn ident_new_number() {
+    new("255");
+}
+
+#[test]
+#[should_panic(expected = "\"a#\" is not a valid Ident")]
+fn ident_new_invalid() {
+    new("a#");
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_item.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_item.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_item.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_item.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,332 @@
+#![allow(clippy::uninlined_format_args)]
+
+#[macro_use]
+mod macros;
+
+use proc_macro2::{Delimiter, Group, Ident, Span, TokenStream, TokenTree};
+use quote::quote;
+use syn::{Item, ItemTrait};
+
+#[test]
+fn test_macro_variable_attr() {
+    // mimics the token stream corresponding to `$attr fn f() {}`
+    let tokens = TokenStream::from_iter([
+        TokenTree::Group(Group::new(Delimiter::None, quote! { #[test] })),
+        TokenTree::Ident(Ident::new("fn", Span::call_site())),
+        TokenTree::Ident(Ident::new("f", Span::call_site())),
+        TokenTree::Group(Group::new(Delimiter::Parenthesis, TokenStream::new())),
+        TokenTree::Group(Group::new(Delimiter::Brace, TokenStream::new())),
+    ]);
+
+    snapshot!(tokens as Item, @r###"
+    Item::Fn {
+        attrs: [
+            Attribute {
+                style: AttrStyle::Outer,
+                meta: Meta::Path {
+                    segments: [
+                        PathSegment {
+                            ident: "test",
+                        },
+                    ],
+                },
+            },
+        ],
+        vis: Visibility::Inherited,
+        sig: Signature {
+            ident: "f",
+            generics: Generics,
+            output: ReturnType::Default,
+        },
+        block: Block {
+            stmts: [],
+        },
+    }
+    "###);
+}
+
+#[test]
+fn test_negative_impl() {
+    // Rustc parses all of the following.
+
+    #[cfg(any())]
+    impl ! {}
+    let tokens = quote! {
+        impl ! {}
+    };
+    snapshot!(tokens as Item, @r###"
+    Item::Impl {
+        generics: Generics,
+        self_ty: Type::Never,
+    }
+    "###);
+
+    #[cfg(any())]
+    #[rustfmt::skip]
+    impl !Trait {}
+    let tokens = quote! {
+        impl !Trait {}
+    };
+    snapshot!(tokens as Item, @r###"
+    Item::Impl {
+        generics: Generics,
+        self_ty: Type::Verbatim(`! Trait`),
+    }
+    "###);
+
+    #[cfg(any())]
+    impl !Trait for T {}
+    let tokens = quote! {
+        impl !Trait for T {}
+    };
+    snapshot!(tokens as Item, @r###"
+    Item::Impl {
+        generics: Generics,
+        trait_: Some((
+            Some,
+            Path {
+                segments: [
+                    PathSegment {
+                        ident: "Trait",
+                    },
+                ],
+            },
+        )),
+        self_ty: Type::Path {
+            path: Path {
+                segments: [
+                    PathSegment {
+                        ident: "T",
+                    },
+                ],
+            },
+        },
+    }
+    "###);
+
+    #[cfg(any())]
+    #[rustfmt::skip]
+    impl !! {}
+    let tokens = quote! {
+        impl !! {}
+    };
+    snapshot!(tokens as Item, @r###"
+    Item::Impl {
+        generics: Generics,
+        self_ty: Type::Verbatim(`! !`),
+    }
+    "###);
+}
+
+#[test]
+fn test_macro_variable_impl() {
+    // mimics the token stream corresponding to `impl $trait for $ty {}`
+    let tokens = TokenStream::from_iter([
+        TokenTree::Ident(Ident::new("impl", Span::call_site())),
+        TokenTree::Group(Group::new(Delimiter::None, quote!(Trait))),
+        TokenTree::Ident(Ident::new("for", Span::call_site())),
+        TokenTree::Group(Group::new(Delimiter::None, quote!(Type))),
+        TokenTree::Group(Group::new(Delimiter::Brace, TokenStream::new())),
+    ]);
+
+    snapshot!(tokens as Item, @r###"
+    Item::Impl {
+        generics: Generics,
+        trait_: Some((
+            None,
+            Path {
+                segments: [
+                    PathSegment {
+                        ident: "Trait",
+                    },
+                ],
+            },
+        )),
+        self_ty: Type::Group {
+            elem: Type::Path {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "Type",
+                        },
+                    ],
+                },
+            },
+        },
+    }
+    "###);
+}
+
+#[test]
+fn test_supertraits() {
+    // Rustc parses all of the following.
+
+    #[rustfmt::skip]
+    let tokens = quote!(trait Trait where {});
+    snapshot!(tokens as ItemTrait, @r###"
+    ItemTrait {
+        vis: Visibility::Inherited,
+        ident: "Trait",
+        generics: Generics {
+            where_clause: Some(WhereClause),
+        },
+    }
+    "###);
+
+    #[rustfmt::skip]
+    let tokens = quote!(trait Trait: where {});
+    snapshot!(tokens as ItemTrait, @r###"
+    ItemTrait {
+        vis: Visibility::Inherited,
+        ident: "Trait",
+        generics: Generics {
+            where_clause: Some(WhereClause),
+        },
+        colon_token: Some,
+    }
+    "###);
+
+    #[rustfmt::skip]
+    let tokens = quote!(trait Trait: Sized where {});
+    snapshot!(tokens as ItemTrait, @r###"
+    ItemTrait {
+        vis: Visibility::Inherited,
+        ident: "Trait",
+        generics: Generics {
+            where_clause: Some(WhereClause),
+        },
+        colon_token: Some,
+        supertraits: [
+            TypeParamBound::Trait(TraitBound {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "Sized",
+                        },
+                    ],
+                },
+            }),
+        ],
+    }
+    "###);
+
+    #[rustfmt::skip]
+    let tokens = quote!(trait Trait: Sized + where {});
+    snapshot!(tokens as ItemTrait, @r###"
+    ItemTrait {
+        vis: Visibility::Inherited,
+        ident: "Trait",
+        generics: Generics {
+            where_clause: Some(WhereClause),
+        },
+        colon_token: Some,
+        supertraits: [
+            TypeParamBound::Trait(TraitBound {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "Sized",
+                        },
+                    ],
+                },
+            }),
+            Token![+],
+        ],
+    }
+    "###);
+}
+
+#[test]
+fn test_type_empty_bounds() {
+    #[rustfmt::skip]
+    let tokens = quote! {
+        trait Foo {
+            type Bar: ;
+        }
+    };
+
+    snapshot!(tokens as ItemTrait, @r###"
+    ItemTrait {
+        vis: Visibility::Inherited,
+        ident: "Foo",
+        generics: Generics,
+        items: [
+            TraitItem::Type {
+                ident: "Bar",
+                generics: Generics,
+                colon_token: Some,
+            },
+        ],
+    }
+    "###);
+}
+
+#[test]
+fn test_impl_visibility() {
+    let tokens = quote! {
+        pub default unsafe impl union {}
+    };
+
+    snapshot!(tokens as Item, @"Item::Verbatim(`pub default unsafe impl union { }`)");
+}
+
+#[test]
+fn test_impl_type_parameter_defaults() {
+    #[cfg(any())]
+    impl<T = ()> () {}
+    let tokens = quote! {
+        impl<T = ()> () {}
+    };
+    snapshot!(tokens as Item, @r###"
+    Item::Impl {
+        generics: Generics {
+            lt_token: Some,
+            params: [
+                GenericParam::Type(TypeParam {
+                    ident: "T",
+                    eq_token: Some,
+                    default: Some(Type::Tuple),
+                }),
+            ],
+            gt_token: Some,
+        },
+        self_ty: Type::Tuple,
+    }
+    "###);
+}
+
+#[test]
+fn test_impl_trait_trailing_plus() {
+    let tokens = quote! {
+        fn f() -> impl Sized + {}
+    };
+
+    snapshot!(tokens as Item, @r###"
+    Item::Fn {
+        vis: Visibility::Inherited,
+        sig: Signature {
+            ident: "f",
+            generics: Generics,
+            output: ReturnType::Type(
+                Type::ImplTrait {
+                    bounds: [
+                        TypeParamBound::Trait(TraitBound {
+                            path: Path {
+                                segments: [
+                                    PathSegment {
+                                        ident: "Sized",
+                                    },
+                                ],
+                            },
+                        }),
+                        Token![+],
+                    ],
+                },
+            ),
+        },
+        block: Block {
+            stmts: [],
+        },
+    }
+    "###);
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_iterators.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_iterators.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_iterators.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_iterators.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,70 @@
+#![allow(clippy::uninlined_format_args)]
+
+use syn::punctuated::{Pair, Punctuated};
+use syn::Token;
+
+#[macro_use]
+mod macros;
+
+macro_rules! check_exact_size_iterator {
+    ($iter:expr) => {{
+        let iter = $iter;
+        let size_hint = iter.size_hint();
+        let len = iter.len();
+        let count = iter.count();
+        assert_eq!(len, count);
+        assert_eq!(size_hint, (count, Some(count)));
+    }};
+}
+
+#[test]
+fn pairs() {
+    let mut p: Punctuated<_, Token![,]> = punctuated!(2, 3, 4);
+
+    check_exact_size_iterator!(p.pairs());
+    check_exact_size_iterator!(p.pairs_mut());
+    check_exact_size_iterator!(p.into_pairs());
+
+    let mut p: Punctuated<_, Token![,]> = punctuated!(2, 3, 4);
+
+    assert_eq!(p.pairs().next_back().map(Pair::into_value), Some(&4));
+    assert_eq!(
+        p.pairs_mut().next_back().map(Pair::into_value),
+        Some(&mut 4)
+    );
+    assert_eq!(p.into_pairs().next_back().map(Pair::into_value), Some(4));
+}
+
+#[test]
+fn iter() {
+    let mut p: Punctuated<_, Token![,]> = punctuated!(2, 3, 4);
+
+    check_exact_size_iterator!(p.iter());
+    check_exact_size_iterator!(p.iter_mut());
+    check_exact_size_iterator!(p.into_iter());
+
+    let mut p: Punctuated<_, Token![,]> = punctuated!(2, 3, 4);
+
+    assert_eq!(p.iter().next_back(), Some(&4));
+    assert_eq!(p.iter_mut().next_back(), Some(&mut 4));
+    assert_eq!(p.into_iter().next_back(), Some(4));
+}
+
+#[test]
+fn may_dangle() {
+    let p: Punctuated<_, Token![,]> = punctuated!(2, 3, 4);
+    for element in &p {
+        if *element == 2 {
+            drop(p);
+            break;
+        }
+    }
+
+    let mut p: Punctuated<_, Token![,]> = punctuated!(2, 3, 4);
+    for element in &mut p {
+        if *element == 2 {
+            drop(p);
+            break;
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_lit.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_lit.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_lit.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_lit.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,331 @@
+#![allow(
+    clippy::float_cmp,
+    clippy::needless_raw_string_hashes,
+    clippy::non_ascii_literal,
+    clippy::single_match_else,
+    clippy::uninlined_format_args
+)]
+
+#[macro_use]
+mod macros;
+
+use proc_macro2::{Delimiter, Group, Literal, Span, TokenStream, TokenTree};
+use quote::ToTokens;
+use std::ffi::CStr;
+use std::str::FromStr;
+use syn::{Lit, LitFloat, LitInt, LitStr};
+
+#[track_caller]
+fn lit(s: &str) -> Lit {
+    let mut tokens = TokenStream::from_str(s).unwrap().into_iter();
+    match tokens.next().unwrap() {
+        TokenTree::Literal(lit) => {
+            assert!(tokens.next().is_none());
+            Lit::new(lit)
+        }
+        wrong => panic!("{:?}", wrong),
+    }
+}
+
+#[test]
+fn strings() {
+    #[track_caller]
+    fn test_string(s: &str, value: &str) {
+        let s = s.trim();
+        match lit(s) {
+            Lit::Str(lit) => {
+                assert_eq!(lit.value(), value);
+                let again = lit.into_token_stream().to_string();
+                if again != s {
+                    test_string(&again, value);
+                }
+            }
+            wrong => panic!("{:?}", wrong),
+        }
+    }
+
+    test_string(r#"  ""  "#, "");
+    test_string(r#"  "a"  "#, "a");
+    test_string(r#"  "\n"  "#, "\n");
+    test_string(r#"  "\r"  "#, "\r");
+    test_string(r#"  "\t"  "#, "\t");
+    test_string(r#"  "🐕"  "#, "🐕"); // NOTE: This is an emoji
+    test_string(r#"  "\""  "#, "\"");
+    test_string(r#"  "'"  "#, "'");
+    test_string(r#"  "\u{1F415}"  "#, "\u{1F415}");
+    test_string(r#"  "\u{1_2__3_}"  "#, "\u{123}");
+    test_string(
+        "\"contains\nnewlines\\\nescaped newlines\"",
+        "contains\nnewlinesescaped newlines",
+    );
+    test_string(
+        "\"escaped newline\\\n \x0C unsupported whitespace\"",
+        "escaped newline\x0C unsupported whitespace",
+    );
+    test_string("r\"raw\nstring\\\nhere\"", "raw\nstring\\\nhere");
+    test_string("\"...\"q", "...");
+    test_string("r\"...\"q", "...");
+    test_string("r##\"...\"##q", "...");
+}
+
+#[test]
+fn byte_strings() {
+    #[track_caller]
+    fn test_byte_string(s: &str, value: &[u8]) {
+        let s = s.trim();
+        match lit(s) {
+            Lit::ByteStr(lit) => {
+                assert_eq!(lit.value(), value);
+                let again = lit.into_token_stream().to_string();
+                if again != s {
+                    test_byte_string(&again, value);
+                }
+            }
+            wrong => panic!("{:?}", wrong),
+        }
+    }
+
+    test_byte_string(r#"  b""  "#, b"");
+    test_byte_string(r#"  b"a"  "#, b"a");
+    test_byte_string(r#"  b"\n"  "#, b"\n");
+    test_byte_string(r#"  b"\r"  "#, b"\r");
+    test_byte_string(r#"  b"\t"  "#, b"\t");
+    test_byte_string(r#"  b"\""  "#, b"\"");
+    test_byte_string(r#"  b"'"  "#, b"'");
+    test_byte_string(
+        "b\"contains\nnewlines\\\nescaped newlines\"",
+        b"contains\nnewlinesescaped newlines",
+    );
+    test_byte_string("br\"raw\nstring\\\nhere\"", b"raw\nstring\\\nhere");
+    test_byte_string("b\"...\"q", b"...");
+    test_byte_string("br\"...\"q", b"...");
+    test_byte_string("br##\"...\"##q", b"...");
+}
+
+#[test]
+fn c_strings() {
+    #[track_caller]
+    fn test_c_string(s: &str, value: &CStr) {
+        let s = s.trim();
+        match lit(s) {
+            Lit::CStr(lit) => {
+                assert_eq!(*lit.value(), *value);
+                let again = lit.into_token_stream().to_string();
+                if again != s {
+                    test_c_string(&again, value);
+                }
+            }
+            wrong => panic!("{:?}", wrong),
+        }
+    }
+
+    test_c_string(r#"  c""  "#, c"");
+    test_c_string(r#"  c"a"  "#, c"a");
+    test_c_string(r#"  c"\n"  "#, c"\n");
+    test_c_string(r#"  c"\r"  "#, c"\r");
+    test_c_string(r#"  c"\t"  "#, c"\t");
+    test_c_string(r#"  c"\\"  "#, c"\\");
+    test_c_string(r#"  c"\'"  "#, c"'");
+    test_c_string(r#"  c"\""  "#, c"\"");
+    test_c_string(
+        "c\"contains\nnewlines\\\nescaped newlines\"",
+        c"contains\nnewlinesescaped newlines",
+    );
+    test_c_string("cr\"raw\nstring\\\nhere\"", c"raw\nstring\\\nhere");
+    test_c_string("c\"...\"q", c"...");
+    test_c_string("cr\"...\"", c"...");
+    test_c_string("cr##\"...\"##", c"...");
+    test_c_string(
+        r#"  c"hello\x80我叫\u{1F980}"  "#, // from the RFC
+        c"hello\x80我叫\u{1F980}",
+    );
+}
+
+#[test]
+fn bytes() {
+    #[track_caller]
+    fn test_byte(s: &str, value: u8) {
+        let s = s.trim();
+        match lit(s) {
+            Lit::Byte(lit) => {
+                assert_eq!(lit.value(), value);
+                let again = lit.into_token_stream().to_string();
+                assert_eq!(again, s);
+            }
+            wrong => panic!("{:?}", wrong),
+        }
+    }
+
+    test_byte(r#"  b'a'  "#, b'a');
+    test_byte(r#"  b'\n'  "#, b'\n');
+    test_byte(r#"  b'\r'  "#, b'\r');
+    test_byte(r#"  b'\t'  "#, b'\t');
+    test_byte(r#"  b'\''  "#, b'\'');
+    test_byte(r#"  b'"'  "#, b'"');
+    test_byte(r#"  b'a'q  "#, b'a');
+}
+
+#[test]
+fn chars() {
+    #[track_caller]
+    fn test_char(s: &str, value: char) {
+        let s = s.trim();
+        match lit(s) {
+            Lit::Char(lit) => {
+                assert_eq!(lit.value(), value);
+                let again = lit.into_token_stream().to_string();
+                if again != s {
+                    test_char(&again, value);
+                }
+            }
+            wrong => panic!("{:?}", wrong),
+        }
+    }
+
+    test_char(r#"  'a'  "#, 'a');
+    test_char(r#"  '\n'  "#, '\n');
+    test_char(r#"  '\r'  "#, '\r');
+    test_char(r#"  '\t'  "#, '\t');
+    test_char(r#"  '🐕'  "#, '🐕'); // NOTE: This is an emoji
+    test_char(r#"  '\''  "#, '\'');
+    test_char(r#"  '"'  "#, '"');
+    test_char(r#"  '\u{1F415}'  "#, '\u{1F415}');
+    test_char(r#"  'a'q  "#, 'a');
+}
+
+#[test]
+fn ints() {
+    #[track_caller]
+    fn test_int(s: &str, value: u64, suffix: &str) {
+        match lit(s) {
+            Lit::Int(lit) => {
+                assert_eq!(lit.base10_digits().parse::<u64>().unwrap(), value);
+                assert_eq!(lit.suffix(), suffix);
+                let again = lit.into_token_stream().to_string();
+                if again != s {
+                    test_int(&again, value, suffix);
+                }
+            }
+            wrong => panic!("{:?}", wrong),
+        }
+    }
+
+    test_int("5", 5, "");
+    test_int("5u32", 5, "u32");
+    test_int("0E", 0, "E");
+    test_int("0ECMA", 0, "ECMA");
+    test_int("0o0A", 0, "A");
+    test_int("5_0", 50, "");
+    test_int("5_____0_____", 50, "");
+    test_int("0x7f", 127, "");
+    test_int("0x7F", 127, "");
+    test_int("0b1001", 9, "");
+    test_int("0o73", 59, "");
+    test_int("0x7Fu8", 127, "u8");
+    test_int("0b1001i8", 9, "i8");
+    test_int("0o73u32", 59, "u32");
+    test_int("0x__7___f_", 127, "");
+    test_int("0x__7___F_", 127, "");
+    test_int("0b_1_0__01", 9, "");
+    test_int("0o_7__3", 59, "");
+    test_int("0x_7F__u8", 127, "u8");
+    test_int("0b__10__0_1i8", 9, "i8");
+    test_int("0o__7__________________3u32", 59, "u32");
+    test_int("0e1\u{5c5}", 0, "e1\u{5c5}");
+}
+
+#[test]
+fn floats() {
+    #[track_caller]
+    fn test_float(s: &str, value: f64, suffix: &str) {
+        match lit(s) {
+            Lit::Float(lit) => {
+                assert_eq!(lit.base10_digits().parse::<f64>().unwrap(), value);
+                assert_eq!(lit.suffix(), suffix);
+                let again = lit.into_token_stream().to_string();
+                if again != s {
+                    test_float(&again, value, suffix);
+                }
+            }
+            wrong => panic!("{:?}", wrong),
+        }
+    }
+
+    test_float("5.5", 5.5, "");
+    test_float("5.5E12", 5.5e12, "");
+    test_float("5.5e12", 5.5e12, "");
+    test_float("1.0__3e-12", 1.03e-12, "");
+    test_float("1.03e+12", 1.03e12, "");
+    test_float("9e99e99", 9e99, "e99");
+    test_float("1e_0", 1.0, "");
+    test_float("0.0ECMA", 0.0, "ECMA");
+}
+
+#[test]
+fn negative() {
+    let span = Span::call_site();
+    assert_eq!("-1", LitInt::new("-1", span).to_string());
+    assert_eq!("-1i8", LitInt::new("-1i8", span).to_string());
+    assert_eq!("-1i16", LitInt::new("-1i16", span).to_string());
+    assert_eq!("-1i32", LitInt::new("-1i32", span).to_string());
+    assert_eq!("-1i64", LitInt::new("-1i64", span).to_string());
+    assert_eq!("-1.5", LitFloat::new("-1.5", span).to_string());
+    assert_eq!("-1.5f32", LitFloat::new("-1.5f32", span).to_string());
+    assert_eq!("-1.5f64", LitFloat::new("-1.5f64", span).to_string());
+}
+
+#[test]
+fn suffix() {
+    #[track_caller]
+    fn get_suffix(token: &str) -> String {
+        let lit = syn::parse_str::<Lit>(token).unwrap();
+        match lit {
+            Lit::Str(lit) => lit.suffix().to_owned(),
+            Lit::ByteStr(lit) => lit.suffix().to_owned(),
+            Lit::CStr(lit) => lit.suffix().to_owned(),
+            Lit::Byte(lit) => lit.suffix().to_owned(),
+            Lit::Char(lit) => lit.suffix().to_owned(),
+            Lit::Int(lit) => lit.suffix().to_owned(),
+            Lit::Float(lit) => lit.suffix().to_owned(),
+            _ => unimplemented!(),
+        }
+    }
+
+    assert_eq!(get_suffix("\"\"s"), "s");
+    assert_eq!(get_suffix("r\"\"r"), "r");
+    assert_eq!(get_suffix("r#\"\"#r"), "r");
+    assert_eq!(get_suffix("b\"\"b"), "b");
+    assert_eq!(get_suffix("br\"\"br"), "br");
+    assert_eq!(get_suffix("br#\"\"#br"), "br");
+    assert_eq!(get_suffix("c\"\"c"), "c");
+    assert_eq!(get_suffix("cr\"\"cr"), "cr");
+    assert_eq!(get_suffix("cr#\"\"#cr"), "cr");
+    assert_eq!(get_suffix("'c'c"), "c");
+    assert_eq!(get_suffix("b'b'b"), "b");
+    assert_eq!(get_suffix("1i32"), "i32");
+    assert_eq!(get_suffix("1_i32"), "i32");
+    assert_eq!(get_suffix("1.0f32"), "f32");
+    assert_eq!(get_suffix("1.0_f32"), "f32");
+}
+
+#[test]
+fn test_deep_group_empty() {
+    let tokens = TokenStream::from_iter([TokenTree::Group(Group::new(
+        Delimiter::None,
+        TokenStream::from_iter([TokenTree::Group(Group::new(
+            Delimiter::None,
+            TokenStream::from_iter([TokenTree::Literal(Literal::string("hi"))]),
+        ))]),
+    ))]);
+
+    snapshot!(tokens as Lit, @r#""hi""# );
+}
+
+#[test]
+fn test_error() {
+    let err = syn::parse_str::<LitStr>("...").unwrap_err();
+    assert_eq!("expected string literal", err.to_string());
+
+    let err = syn::parse_str::<LitStr>("5").unwrap_err();
+    assert_eq!("expected string literal", err.to_string());
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_meta.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_meta.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_meta.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_meta.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,154 @@
+#![allow(
+    clippy::shadow_unrelated,
+    clippy::too_many_lines,
+    clippy::uninlined_format_args
+)]
+
+#[macro_use]
+mod macros;
+
+use syn::{Meta, MetaList, MetaNameValue};
+
+#[test]
+fn test_parse_meta_item_word() {
+    let input = "hello";
+
+    snapshot!(input as Meta, @r###"
+    Meta::Path {
+        segments: [
+            PathSegment {
+                ident: "hello",
+            },
+        ],
+    }
+    "###);
+}
+
+#[test]
+fn test_parse_meta_name_value() {
+    let input = "foo = 5";
+    let (inner, meta) = (input, input);
+
+    snapshot!(inner as MetaNameValue, @r###"
+    MetaNameValue {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "foo",
+                },
+            ],
+        },
+        value: Expr::Lit {
+            lit: 5,
+        },
+    }
+    "###);
+
+    snapshot!(meta as Meta, @r###"
+    Meta::NameValue {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "foo",
+                },
+            ],
+        },
+        value: Expr::Lit {
+            lit: 5,
+        },
+    }
+    "###);
+
+    assert_eq!(meta, Meta::NameValue(inner));
+}
+
+#[test]
+fn test_parse_meta_item_list_lit() {
+    let input = "foo(5)";
+    let (inner, meta) = (input, input);
+
+    snapshot!(inner as MetaList, @r###"
+    MetaList {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "foo",
+                },
+            ],
+        },
+        delimiter: MacroDelimiter::Paren,
+        tokens: TokenStream(`5`),
+    }
+    "###);
+
+    snapshot!(meta as Meta, @r###"
+    Meta::List {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "foo",
+                },
+            ],
+        },
+        delimiter: MacroDelimiter::Paren,
+        tokens: TokenStream(`5`),
+    }
+    "###);
+
+    assert_eq!(meta, Meta::List(inner));
+}
+
+#[test]
+fn test_parse_meta_item_multiple() {
+    let input = "foo(word, name = 5, list(name2 = 6), word2)";
+    let (inner, meta) = (input, input);
+
+    snapshot!(inner as MetaList, @r###"
+    MetaList {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "foo",
+                },
+            ],
+        },
+        delimiter: MacroDelimiter::Paren,
+        tokens: TokenStream(`word , name = 5 , list (name2 = 6) , word2`),
+    }
+    "###);
+
+    snapshot!(meta as Meta, @r###"
+    Meta::List {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "foo",
+                },
+            ],
+        },
+        delimiter: MacroDelimiter::Paren,
+        tokens: TokenStream(`word , name = 5 , list (name2 = 6) , word2`),
+    }
+    "###);
+
+    assert_eq!(meta, Meta::List(inner));
+}
+
+#[test]
+fn test_parse_path() {
+    let input = "::serde::Serialize";
+    snapshot!(input as Meta, @r###"
+    Meta::Path {
+        leading_colon: Some,
+        segments: [
+            PathSegment {
+                ident: "serde",
+            },
+            Token![::],
+            PathSegment {
+                ident: "Serialize",
+            },
+        ],
+    }
+    "###);
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_parse_buffer.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_parse_buffer.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_parse_buffer.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_parse_buffer.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,103 @@
+#![allow(clippy::non_ascii_literal)]
+
+use proc_macro2::{Delimiter, Group, Ident, Punct, Spacing, TokenStream, TokenTree};
+use std::panic;
+use syn::parse::discouraged::Speculative as _;
+use syn::parse::{Parse, ParseStream, Parser, Result};
+use syn::{parenthesized, Token};
+
+#[test]
+#[should_panic(expected = "fork was not derived from the advancing parse stream")]
+fn smuggled_speculative_cursor_between_sources() {
+    struct BreakRules;
+    impl Parse for BreakRules {
+        fn parse(input1: ParseStream) -> Result<Self> {
+            let nested = |input2: ParseStream| {
+                input1.advance_to(input2);
+                Ok(Self)
+            };
+            nested.parse_str("")
+        }
+    }
+
+    syn::parse_str::<BreakRules>("").unwrap();
+}
+
+#[test]
+#[should_panic(expected = "fork was not derived from the advancing parse stream")]
+fn smuggled_speculative_cursor_between_brackets() {
+    struct BreakRules;
+    impl Parse for BreakRules {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let a;
+            let b;
+            parenthesized!(a in input);
+            parenthesized!(b in input);
+            a.advance_to(&b);
+            Ok(Self)
+        }
+    }
+
+    syn::parse_str::<BreakRules>("()()").unwrap();
+}
+
+#[test]
+#[should_panic(expected = "fork was not derived from the advancing parse stream")]
+fn smuggled_speculative_cursor_into_brackets() {
+    struct BreakRules;
+    impl Parse for BreakRules {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let a;
+            parenthesized!(a in input);
+            input.advance_to(&a);
+            Ok(Self)
+        }
+    }
+
+    syn::parse_str::<BreakRules>("()").unwrap();
+}
+
+#[test]
+fn trailing_empty_none_group() {
+    fn parse(input: ParseStream) -> Result<()> {
+        input.parse::<Token![+]>()?;
+
+        let content;
+        parenthesized!(content in input);
+        content.parse::<Token![+]>()?;
+
+        Ok(())
+    }
+
+    // `+ ( + «∅ ∅» ) «∅ «∅ ∅» ∅»`
+    let tokens = TokenStream::from_iter([
+        TokenTree::Punct(Punct::new('+', Spacing::Alone)),
+        TokenTree::Group(Group::new(
+            Delimiter::Parenthesis,
+            TokenStream::from_iter([
+                TokenTree::Punct(Punct::new('+', Spacing::Alone)),
+                TokenTree::Group(Group::new(Delimiter::None, TokenStream::new())),
+            ]),
+        )),
+        TokenTree::Group(Group::new(Delimiter::None, TokenStream::new())),
+        TokenTree::Group(Group::new(
+            Delimiter::None,
+            TokenStream::from_iter([TokenTree::Group(Group::new(
+                Delimiter::None,
+                TokenStream::new(),
+            ))]),
+        )),
+    ]);
+
+    parse.parse2(tokens).unwrap();
+}
+
+#[test]
+fn test_unwind_safe() {
+    fn parse(input: ParseStream) -> Result<Ident> {
+        let thread_result = panic::catch_unwind(|| input.parse());
+        thread_result.unwrap()
+    }
+
+    parse.parse_str("throw").unwrap();
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_parse_quote.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_parse_quote.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_parse_quote.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_parse_quote.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,166 @@
+#![allow(clippy::uninlined_format_args)]
+
+#[macro_use]
+mod macros;
+
+use syn::punctuated::Punctuated;
+use syn::{parse_quote, Attribute, Field, Lit, Pat, Stmt, Token};
+
+#[test]
+fn test_attribute() {
+    let attr: Attribute = parse_quote!(#[test]);
+    snapshot!(attr, @r###"
+    Attribute {
+        style: AttrStyle::Outer,
+        meta: Meta::Path {
+            segments: [
+                PathSegment {
+                    ident: "test",
+                },
+            ],
+        },
+    }
+    "###);
+
+    let attr: Attribute = parse_quote!(#![no_std]);
+    snapshot!(attr, @r###"
+    Attribute {
+        style: AttrStyle::Inner,
+        meta: Meta::Path {
+            segments: [
+                PathSegment {
+                    ident: "no_std",
+                },
+            ],
+        },
+    }
+    "###);
+}
+
+#[test]
+fn test_field() {
+    let field: Field = parse_quote!(pub enabled: bool);
+    snapshot!(field, @r###"
+    Field {
+        vis: Visibility::Public,
+        ident: Some("enabled"),
+        colon_token: Some,
+        ty: Type::Path {
+            path: Path {
+                segments: [
+                    PathSegment {
+                        ident: "bool",
+                    },
+                ],
+            },
+        },
+    }
+    "###);
+
+    let field: Field = parse_quote!(primitive::bool);
+    snapshot!(field, @r###"
+    Field {
+        vis: Visibility::Inherited,
+        ty: Type::Path {
+            path: Path {
+                segments: [
+                    PathSegment {
+                        ident: "primitive",
+                    },
+                    Token![::],
+                    PathSegment {
+                        ident: "bool",
+                    },
+                ],
+            },
+        },
+    }
+    "###);
+}
+
+#[test]
+fn test_pat() {
+    let pat: Pat = parse_quote!(Some(false) | None);
+    snapshot!(&pat, @r###"
+    Pat::Or {
+        cases: [
+            Pat::TupleStruct {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "Some",
+                        },
+                    ],
+                },
+                elems: [
+                    Pat::Lit(ExprLit {
+                        lit: Lit::Bool {
+                            value: false,
+                        },
+                    }),
+                ],
+            },
+            Token![|],
+            Pat::Ident {
+                ident: "None",
+            },
+        ],
+    }
+    "###);
+
+    let boxed_pat: Box<Pat> = parse_quote!(Some(false) | None);
+    assert_eq!(*boxed_pat, pat);
+}
+
+#[test]
+fn test_punctuated() {
+    let punctuated: Punctuated<Lit, Token![|]> = parse_quote!(true | true);
+    snapshot!(punctuated, @r###"
+    [
+        Lit::Bool {
+            value: true,
+        },
+        Token![|],
+        Lit::Bool {
+            value: true,
+        },
+    ]
+    "###);
+
+    let punctuated: Punctuated<Lit, Token![|]> = parse_quote!(true | true |);
+    snapshot!(punctuated, @r###"
+    [
+        Lit::Bool {
+            value: true,
+        },
+        Token![|],
+        Lit::Bool {
+            value: true,
+        },
+        Token![|],
+    ]
+    "###);
+}
+
+#[test]
+fn test_vec_stmt() {
+    let stmts: Vec<Stmt> = parse_quote! {
+        let _;
+        true
+    };
+    snapshot!(stmts, @r###"
+    [
+        Stmt::Local {
+            pat: Pat::Wild,
+        },
+        Stmt::Expr(
+            Expr::Lit {
+                lit: Lit::Bool {
+                    value: true,
+                },
+            },
+            None,
+        ),
+    ]
+    "###);
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_parse_stream.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_parse_stream.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_parse_stream.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_parse_stream.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,187 @@
+#![allow(clippy::items_after_statements, clippy::let_underscore_untyped)]
+
+use proc_macro2::{Delimiter, Group, Punct, Spacing, Span, TokenStream, TokenTree};
+use quote::quote;
+use syn::ext::IdentExt as _;
+use syn::parse::discouraged::AnyDelimiter;
+use syn::parse::{ParseStream, Parser as _, Result};
+use syn::{parenthesized, token, Ident, Lifetime, Token};
+
+#[test]
+fn test_peek_punct() {
+    let tokens = quote!(+= + =);
+
+    fn assert(input: ParseStream) -> Result<()> {
+        assert!(input.peek(Token![+]));
+        assert!(input.peek(Token![+=]));
+
+        let _: Token![+] = input.parse()?;
+
+        assert!(input.peek(Token![=]));
+        assert!(!input.peek(Token![==]));
+        assert!(!input.peek(Token![+]));
+
+        let _: Token![=] = input.parse()?;
+
+        assert!(input.peek(Token![+]));
+        assert!(!input.peek(Token![+=]));
+
+        let _: Token![+] = input.parse()?;
+        let _: Token![=] = input.parse()?;
+        Ok(())
+    }
+
+    assert.parse2(tokens).unwrap();
+}
+
+#[test]
+fn test_peek_lifetime() {
+    // 'static ;
+    let tokens = TokenStream::from_iter([
+        TokenTree::Punct(Punct::new('\'', Spacing::Joint)),
+        TokenTree::Ident(Ident::new("static", Span::call_site())),
+        TokenTree::Punct(Punct::new(';', Spacing::Alone)),
+    ]);
+
+    fn assert(input: ParseStream) -> Result<()> {
+        assert!(input.peek(Lifetime));
+        assert!(input.peek2(Token![;]));
+        assert!(!input.peek2(Token![static]));
+
+        let _: Lifetime = input.parse()?;
+
+        assert!(input.peek(Token![;]));
+
+        let _: Token![;] = input.parse()?;
+        Ok(())
+    }
+
+    assert.parse2(tokens).unwrap();
+}
+
+#[test]
+fn test_peek_not_lifetime() {
+    // ' static
+    let tokens = TokenStream::from_iter([
+        TokenTree::Punct(Punct::new('\'', Spacing::Alone)),
+        TokenTree::Ident(Ident::new("static", Span::call_site())),
+    ]);
+
+    fn assert(input: ParseStream) -> Result<()> {
+        assert!(!input.peek(Lifetime));
+        assert!(input.parse::<Option<Punct>>()?.is_none());
+
+        let _: TokenTree = input.parse()?;
+
+        assert!(input.peek(Token![static]));
+
+        let _: Token![static] = input.parse()?;
+        Ok(())
+    }
+
+    assert.parse2(tokens).unwrap();
+}
+
+#[test]
+fn test_peek_ident() {
+    let tokens = quote!(static var);
+
+    fn assert(input: ParseStream) -> Result<()> {
+        assert!(!input.peek(Ident));
+        assert!(input.peek(Ident::peek_any));
+        assert!(input.peek(Token![static]));
+
+        let _: Token![static] = input.parse()?;
+
+        assert!(input.peek(Ident));
+        assert!(input.peek(Ident::peek_any));
+
+        let _: Ident = input.parse()?;
+        Ok(())
+    }
+
+    assert.parse2(tokens).unwrap();
+}
+
+#[test]
+fn test_peek_groups() {
+    // pub ( :: ) «∅ ! = ∅» static
+    let tokens = TokenStream::from_iter([
+        TokenTree::Ident(Ident::new("pub", Span::call_site())),
+        TokenTree::Group(Group::new(
+            Delimiter::Parenthesis,
+            TokenStream::from_iter([
+                TokenTree::Punct(Punct::new(':', Spacing::Joint)),
+                TokenTree::Punct(Punct::new(':', Spacing::Alone)),
+            ]),
+        )),
+        TokenTree::Group(Group::new(
+            Delimiter::None,
+            TokenStream::from_iter([
+                TokenTree::Punct(Punct::new('!', Spacing::Alone)),
+                TokenTree::Punct(Punct::new('=', Spacing::Alone)),
+            ]),
+        )),
+        TokenTree::Ident(Ident::new("static", Span::call_site())),
+    ]);
+
+    fn assert(input: ParseStream) -> Result<()> {
+        assert!(input.peek2(token::Paren));
+        assert!(input.peek3(token::Group));
+        assert!(input.peek3(Token![!]));
+
+        let _: Token![pub] = input.parse()?;
+
+        assert!(input.peek(token::Paren));
+        assert!(!input.peek(Token![::]));
+        assert!(!input.peek2(Token![::]));
+        assert!(input.peek2(Token![!]));
+        assert!(input.peek2(token::Group));
+        assert!(input.peek3(Token![=]));
+        assert!(!input.peek3(Token![static]));
+
+        let content;
+        parenthesized!(content in input);
+
+        assert!(content.peek(Token![::]));
+        assert!(content.peek2(Token![:]));
+        assert!(!content.peek3(token::Group));
+        assert!(!content.peek3(Token![!]));
+
+        assert!(input.peek(token::Group));
+        assert!(input.peek(Token![!]));
+
+        let _: Token![::] = content.parse()?;
+
+        assert!(input.peek(token::Group));
+        assert!(input.peek(Token![!]));
+        assert!(input.peek2(Token![=]));
+        assert!(input.peek3(Token![static]));
+        assert!(!input.peek2(Token![static]));
+
+        let implicit = input.fork();
+        let explicit = input.fork();
+
+        let _: Token![!] = implicit.parse()?;
+        assert!(implicit.peek(Token![=]));
+        assert!(implicit.peek2(Token![static]));
+        let _: Token![=] = implicit.parse()?;
+        assert!(implicit.peek(Token![static]));
+
+        let (delimiter, _span, grouped) = explicit.parse_any_delimiter()?;
+        assert_eq!(delimiter, Delimiter::None);
+        assert!(grouped.peek(Token![!]));
+        assert!(grouped.peek2(Token![=]));
+        assert!(!grouped.peek3(Token![static]));
+        let _: Token![!] = grouped.parse()?;
+        assert!(grouped.peek(Token![=]));
+        assert!(!grouped.peek2(Token![static]));
+        let _: Token![=] = grouped.parse()?;
+        assert!(!grouped.peek(Token![static]));
+
+        let _: TokenStream = input.parse()?;
+        Ok(())
+    }
+
+    assert.parse2(tokens).unwrap();
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_pat.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_pat.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_pat.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_pat.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,152 @@
+#![allow(clippy::uninlined_format_args)]
+
+#[macro_use]
+mod macros;
+
+use proc_macro2::{Delimiter, Group, TokenStream, TokenTree};
+use quote::{quote, ToTokens as _};
+use syn::parse::Parser;
+use syn::punctuated::Punctuated;
+use syn::{parse_quote, token, Item, Pat, PatTuple, Stmt, Token};
+
+#[test]
+fn test_pat_ident() {
+    match Pat::parse_single.parse2(quote!(self)).unwrap() {
+        Pat::Ident(_) => (),
+        value => panic!("expected PatIdent, got {:?}", value),
+    }
+}
+
+#[test]
+fn test_pat_path() {
+    match Pat::parse_single.parse2(quote!(self::CONST)).unwrap() {
+        Pat::Path(_) => (),
+        value => panic!("expected PatPath, got {:?}", value),
+    }
+}
+
+#[test]
+fn test_leading_vert() {
+    // https://github.com/rust-lang/rust/blob/1.43.0/src/test/ui/or-patterns/remove-leading-vert.rs
+
+    syn::parse_str::<Item>("fn f() {}").unwrap();
+    syn::parse_str::<Item>("fn fun1(| A: E) {}").unwrap_err();
+    syn::parse_str::<Item>("fn fun2(|| A: E) {}").unwrap_err();
+
+    syn::parse_str::<Stmt>("let | () = ();").unwrap_err();
+    syn::parse_str::<Stmt>("let (| A): E;").unwrap();
+    syn::parse_str::<Stmt>("let (|| A): (E);").unwrap_err();
+    syn::parse_str::<Stmt>("let (| A,): (E,);").unwrap();
+    syn::parse_str::<Stmt>("let [| A]: [E; 1];").unwrap();
+    syn::parse_str::<Stmt>("let [|| A]: [E; 1];").unwrap_err();
+    syn::parse_str::<Stmt>("let TS(| A): TS;").unwrap();
+    syn::parse_str::<Stmt>("let TS(|| A): TS;").unwrap_err();
+    syn::parse_str::<Stmt>("let NS { f: | A }: NS;").unwrap();
+    syn::parse_str::<Stmt>("let NS { f: || A }: NS;").unwrap_err();
+}
+
+#[test]
+fn test_group() {
+    let group = Group::new(Delimiter::None, quote!(Some(_)));
+    let tokens = TokenStream::from_iter([TokenTree::Group(group)]);
+    let pat = Pat::parse_single.parse2(tokens).unwrap();
+
+    snapshot!(pat, @r###"
+    Pat::TupleStruct {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "Some",
+                },
+            ],
+        },
+        elems: [
+            Pat::Wild,
+        ],
+    }
+    "###);
+}
+
+#[test]
+fn test_ranges() {
+    Pat::parse_single.parse_str("..").unwrap();
+    Pat::parse_single.parse_str("..hi").unwrap();
+    Pat::parse_single.parse_str("lo..").unwrap();
+    Pat::parse_single.parse_str("lo..hi").unwrap();
+
+    Pat::parse_single.parse_str("..=").unwrap_err();
+    Pat::parse_single.parse_str("..=hi").unwrap();
+    Pat::parse_single.parse_str("lo..=").unwrap_err();
+    Pat::parse_single.parse_str("lo..=hi").unwrap();
+
+    Pat::parse_single.parse_str("...").unwrap_err();
+    Pat::parse_single.parse_str("...hi").unwrap_err();
+    Pat::parse_single.parse_str("lo...").unwrap_err();
+    Pat::parse_single.parse_str("lo...hi").unwrap();
+
+    Pat::parse_single.parse_str("[lo..]").unwrap_err();
+    Pat::parse_single.parse_str("[..=hi]").unwrap_err();
+    Pat::parse_single.parse_str("[(lo..)]").unwrap();
+    Pat::parse_single.parse_str("[(..=hi)]").unwrap();
+    Pat::parse_single.parse_str("[lo..=hi]").unwrap();
+
+    Pat::parse_single.parse_str("[_, lo.., _]").unwrap_err();
+    Pat::parse_single.parse_str("[_, ..=hi, _]").unwrap_err();
+    Pat::parse_single.parse_str("[_, (lo..), _]").unwrap();
+    Pat::parse_single.parse_str("[_, (..=hi), _]").unwrap();
+    Pat::parse_single.parse_str("[_, lo..=hi, _]").unwrap();
+}
+
+#[test]
+fn test_tuple_comma() {
+    let mut expr = PatTuple {
+        attrs: Vec::new(),
+        paren_token: token::Paren::default(),
+        elems: Punctuated::new(),
+    };
+    snapshot!(expr.to_token_stream() as Pat, @"Pat::Tuple");
+
+    expr.elems.push_value(parse_quote!(_));
+    // Must not parse to Pat::Paren
+    snapshot!(expr.to_token_stream() as Pat, @r###"
+    Pat::Tuple {
+        elems: [
+            Pat::Wild,
+            Token![,],
+        ],
+    }
+    "###);
+
+    expr.elems.push_punct(<Token![,]>::default());
+    snapshot!(expr.to_token_stream() as Pat, @r###"
+    Pat::Tuple {
+        elems: [
+            Pat::Wild,
+            Token![,],
+        ],
+    }
+    "###);
+
+    expr.elems.push_value(parse_quote!(_));
+    snapshot!(expr.to_token_stream() as Pat, @r###"
+    Pat::Tuple {
+        elems: [
+            Pat::Wild,
+            Token![,],
+            Pat::Wild,
+        ],
+    }
+    "###);
+
+    expr.elems.push_punct(<Token![,]>::default());
+    snapshot!(expr.to_token_stream() as Pat, @r###"
+    Pat::Tuple {
+        elems: [
+            Pat::Wild,
+            Token![,],
+            Pat::Wild,
+            Token![,],
+        ],
+    }
+    "###);
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_path.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_path.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_path.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_path.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,130 @@
+#![allow(clippy::uninlined_format_args)]
+
+#[macro_use]
+mod macros;
+
+use proc_macro2::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream, TokenTree};
+use quote::{quote, ToTokens};
+use syn::{parse_quote, Expr, Type, TypePath};
+
+#[test]
+fn parse_interpolated_leading_component() {
+    // mimics the token stream corresponding to `$mod::rest`
+    let tokens = TokenStream::from_iter([
+        TokenTree::Group(Group::new(Delimiter::None, quote! { first })),
+        TokenTree::Punct(Punct::new(':', Spacing::Joint)),
+        TokenTree::Punct(Punct::new(':', Spacing::Alone)),
+        TokenTree::Ident(Ident::new("rest", Span::call_site())),
+    ]);
+
+    snapshot!(tokens.clone() as Expr, @r###"
+    Expr::Path {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "first",
+                },
+                Token![::],
+                PathSegment {
+                    ident: "rest",
+                },
+            ],
+        },
+    }
+    "###);
+
+    snapshot!(tokens as Type, @r###"
+    Type::Path {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "first",
+                },
+                Token![::],
+                PathSegment {
+                    ident: "rest",
+                },
+            ],
+        },
+    }
+    "###);
+}
+
+#[test]
+fn print_incomplete_qpath() {
+    // qpath with `as` token
+    let mut ty: TypePath = parse_quote!(<Self as A>::Q);
+    snapshot!(ty.to_token_stream(), @r###"
+    TokenStream(`< Self as A > :: Q`)
+    "###);
+    assert!(ty.path.segments.pop().is_some());
+    snapshot!(ty.to_token_stream(), @r###"
+    TokenStream(`< Self as A > ::`)
+    "###);
+    assert!(ty.path.segments.pop().is_some());
+    snapshot!(ty.to_token_stream(), @r###"
+    TokenStream(`< Self >`)
+    "###);
+    assert!(ty.path.segments.pop().is_none());
+
+    // qpath without `as` token
+    let mut ty: TypePath = parse_quote!(<Self>::A::B);
+    snapshot!(ty.to_token_stream(), @r###"
+    TokenStream(`< Self > :: A :: B`)
+    "###);
+    assert!(ty.path.segments.pop().is_some());
+    snapshot!(ty.to_token_stream(), @r###"
+    TokenStream(`< Self > :: A ::`)
+    "###);
+    assert!(ty.path.segments.pop().is_some());
+    snapshot!(ty.to_token_stream(), @r###"
+    TokenStream(`< Self > ::`)
+    "###);
+    assert!(ty.path.segments.pop().is_none());
+
+    // normal path
+    let mut ty: TypePath = parse_quote!(Self::A::B);
+    snapshot!(ty.to_token_stream(), @r###"
+    TokenStream(`Self :: A :: B`)
+    "###);
+    assert!(ty.path.segments.pop().is_some());
+    snapshot!(ty.to_token_stream(), @r###"
+    TokenStream(`Self :: A ::`)
+    "###);
+    assert!(ty.path.segments.pop().is_some());
+    snapshot!(ty.to_token_stream(), @r###"
+    TokenStream(`Self ::`)
+    "###);
+    assert!(ty.path.segments.pop().is_some());
+    snapshot!(ty.to_token_stream(), @r###"
+    TokenStream(``)
+    "###);
+    assert!(ty.path.segments.pop().is_none());
+}
+
+#[test]
+fn parse_parenthesized_path_arguments_with_disambiguator() {
+    #[rustfmt::skip]
+    let tokens = quote!(dyn FnOnce::() -> !);
+    snapshot!(tokens as Type, @r###"
+    Type::TraitObject {
+        dyn_token: Some,
+        bounds: [
+            TypeParamBound::Trait(TraitBound {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "FnOnce",
+                            arguments: PathArguments::Parenthesized {
+                                output: ReturnType::Type(
+                                    Type::Never,
+                                ),
+                            },
+                        },
+                    ],
+                },
+            }),
+        ],
+    }
+    "###);
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_precedence.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_precedence.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_precedence.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_precedence.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,538 @@
+// This test does the following for every file in the rust-lang/rust repo:
+//
+// 1. Parse the file using syn into a syn::File.
+// 2. Extract every syn::Expr from the file.
+// 3. Print each expr to a string of source code.
+// 4. Parse the source code using librustc_parse into a rustc_ast::Expr.
+// 5. For both the syn::Expr and rustc_ast::Expr, crawl the syntax tree to
+//    insert parentheses surrounding every subexpression.
+// 6. Serialize the fully parenthesized syn::Expr to a string of source code.
+// 7. Parse the fully parenthesized source code using librustc_parse.
+// 8. Compare the rustc_ast::Expr resulting from parenthesizing using rustc data
+//    structures vs syn data structures, ignoring spans. If they agree, rustc's
+//    parser and syn's parser have identical handling of expression precedence.
+
+#![cfg(not(syn_disable_nightly_tests))]
+#![cfg(not(miri))]
+#![recursion_limit = "1024"]
+#![feature(rustc_private)]
+#![allow(
+    clippy::blocks_in_conditions,
+    clippy::doc_markdown,
+    clippy::explicit_deref_methods,
+    clippy::let_underscore_untyped,
+    clippy::manual_assert,
+    clippy::manual_let_else,
+    clippy::match_like_matches_macro,
+    clippy::match_wildcard_for_single_variants,
+    clippy::too_many_lines,
+    clippy::uninlined_format_args
+)]
+
+extern crate rustc_ast;
+extern crate rustc_ast_pretty;
+extern crate rustc_data_structures;
+extern crate rustc_driver;
+extern crate rustc_span;
+extern crate smallvec;
+extern crate thin_vec;
+
+use crate::common::eq::SpanlessEq;
+use crate::common::parse;
+use quote::ToTokens;
+use rustc_ast::ast;
+use rustc_ast::ptr::P;
+use rustc_ast_pretty::pprust;
+use rustc_span::edition::Edition;
+use std::fs;
+use std::path::Path;
+use std::process;
+use std::sync::atomic::{AtomicUsize, Ordering};
+
+#[macro_use]
+mod macros;
+
+mod common;
+mod repo;
+
+#[test]
+fn test_rustc_precedence() {
+    repo::rayon_init();
+    repo::clone_rust();
+    let abort_after = repo::abort_after();
+    if abort_after == 0 {
+        panic!("skipping all precedence tests");
+    }
+
+    let passed = AtomicUsize::new(0);
+    let failed = AtomicUsize::new(0);
+
+    repo::for_each_rust_file(|path| {
+        let content = fs::read_to_string(path).unwrap();
+
+        let (l_passed, l_failed) = match syn::parse_file(&content) {
+            Ok(file) => {
+                let edition = repo::edition(path).parse().unwrap();
+                let exprs = collect_exprs(file);
+                let (l_passed, l_failed) = test_expressions(path, edition, exprs);
+                errorf!(
+                    "=== {}: {} passed | {} failed\n",
+                    path.display(),
+                    l_passed,
+                    l_failed,
+                );
+                (l_passed, l_failed)
+            }
+            Err(msg) => {
+                errorf!("\nFAIL {} - syn failed to parse: {}\n", path.display(), msg);
+                (0, 1)
+            }
+        };
+
+        passed.fetch_add(l_passed, Ordering::Relaxed);
+        let prev_failed = failed.fetch_add(l_failed, Ordering::Relaxed);
+
+        if prev_failed + l_failed >= abort_after {
+            process::exit(1);
+        }
+    });
+
+    let passed = passed.into_inner();
+    let failed = failed.into_inner();
+
+    errorf!("\n===== Precedence Test Results =====\n");
+    errorf!("{} passed | {} failed\n", passed, failed);
+
+    if failed > 0 {
+        panic!("{} failures", failed);
+    }
+}
+
+fn test_expressions(path: &Path, edition: Edition, exprs: Vec<syn::Expr>) -> (usize, usize) {
+    let mut passed = 0;
+    let mut failed = 0;
+
+    rustc_span::create_session_if_not_set_then(edition, |_| {
+        for expr in exprs {
+            let source_code = expr.to_token_stream().to_string();
+            let librustc_ast = if let Some(e) = librustc_parse_and_rewrite(&source_code) {
+                e
+            } else {
+                failed += 1;
+                errorf!(
+                    "\nFAIL {} - librustc failed to parse original\n",
+                    path.display(),
+                );
+                continue;
+            };
+
+            let syn_parenthesized_code =
+                syn_parenthesize(expr.clone()).to_token_stream().to_string();
+            let syn_ast = if let Some(e) = parse::librustc_expr(&syn_parenthesized_code) {
+                e
+            } else {
+                failed += 1;
+                errorf!(
+                    "\nFAIL {} - librustc failed to parse parenthesized\n",
+                    path.display(),
+                );
+                continue;
+            };
+
+            if !SpanlessEq::eq(&syn_ast, &librustc_ast) {
+                failed += 1;
+                let syn_pretty = pprust::expr_to_string(&syn_ast);
+                let librustc_pretty = pprust::expr_to_string(&librustc_ast);
+                errorf!(
+                    "\nFAIL {}\n{}\nsyn != rustc\n{}\n",
+                    path.display(),
+                    syn_pretty,
+                    librustc_pretty,
+                );
+                continue;
+            }
+
+            let expr_invisible = make_parens_invisible(expr);
+            let Ok(reparsed_expr_invisible) = syn::parse2(expr_invisible.to_token_stream()) else {
+                failed += 1;
+                errorf!(
+                    "\nFAIL {} - syn failed to parse invisible delimiters\n{}\n",
+                    path.display(),
+                    source_code,
+                );
+                continue;
+            };
+            if expr_invisible != reparsed_expr_invisible {
+                failed += 1;
+                errorf!(
+                    "\nFAIL {} - mismatch after parsing invisible delimiters\n{}\n",
+                    path.display(),
+                    source_code,
+                );
+                continue;
+            }
+
+            passed += 1;
+        }
+    });
+
+    (passed, failed)
+}
+
+fn librustc_parse_and_rewrite(input: &str) -> Option<P<ast::Expr>> {
+    parse::librustc_expr(input).map(librustc_parenthesize)
+}
+
+fn librustc_parenthesize(mut librustc_expr: P<ast::Expr>) -> P<ast::Expr> {
+    use rustc_ast::ast::{
+        AssocItem, AssocItemKind, Attribute, BinOpKind, Block, BorrowKind, BoundConstness, Expr,
+        ExprField, ExprKind, GenericArg, GenericBound, Local, LocalKind, Pat, Stmt, StmtKind,
+        StructExpr, StructRest, TraitBoundModifiers, Ty,
+    };
+    use rustc_ast::mut_visit::{noop_flat_map_item, MutVisitor};
+    use rustc_data_structures::flat_map_in_place::FlatMapInPlace;
+    use rustc_span::DUMMY_SP;
+    use smallvec::SmallVec;
+    use std::mem;
+    use std::ops::DerefMut;
+    use thin_vec::ThinVec;
+
+    struct FullyParenthesize;
+
+    fn contains_let_chain(expr: &Expr) -> bool {
+        match &expr.kind {
+            ExprKind::Let(..) => true,
+            ExprKind::Binary(binop, left, right) => {
+                binop.node == BinOpKind::And
+                    && (contains_let_chain(left) || contains_let_chain(right))
+            }
+            _ => false,
+        }
+    }
+
+    fn flat_map_field<T: MutVisitor>(mut f: ExprField, vis: &mut T) -> Vec<ExprField> {
+        if f.is_shorthand {
+            noop_visit_expr(&mut f.expr, vis);
+        } else {
+            vis.visit_expr(&mut f.expr);
+        }
+        vec![f]
+    }
+
+    fn flat_map_stmt<T: MutVisitor>(stmt: Stmt, vis: &mut T) -> Vec<Stmt> {
+        let kind = match stmt.kind {
+            // Don't wrap toplevel expressions in statements.
+            StmtKind::Expr(mut e) => {
+                noop_visit_expr(&mut e, vis);
+                StmtKind::Expr(e)
+            }
+            StmtKind::Semi(mut e) => {
+                noop_visit_expr(&mut e, vis);
+                StmtKind::Semi(e)
+            }
+            s => s,
+        };
+
+        vec![Stmt { kind, ..stmt }]
+    }
+
+    fn noop_visit_expr<T: MutVisitor>(e: &mut Expr, vis: &mut T) {
+        match &mut e.kind {
+            ExprKind::AddrOf(BorrowKind::Raw, ..) => {}
+            ExprKind::Struct(expr) => {
+                let StructExpr {
+                    qself,
+                    path,
+                    fields,
+                    rest,
+                } = expr.deref_mut();
+                vis.visit_qself(qself);
+                vis.visit_path(path);
+                fields.flat_map_in_place(|field| flat_map_field(field, vis));
+                if let StructRest::Base(rest) = rest {
+                    vis.visit_expr(rest);
+                }
+            }
+            _ => rustc_ast::mut_visit::noop_visit_expr(e, vis),
+        }
+    }
+
+    impl MutVisitor for FullyParenthesize {
+        fn visit_expr(&mut self, e: &mut P<Expr>) {
+            noop_visit_expr(e, self);
+            match e.kind {
+                ExprKind::Block(..) | ExprKind::If(..) | ExprKind::Let(..) => {}
+                ExprKind::Binary(..) if contains_let_chain(e) => {}
+                _ => {
+                    let inner = mem::replace(
+                        e,
+                        P(Expr {
+                            id: ast::DUMMY_NODE_ID,
+                            kind: ExprKind::Dummy,
+                            span: DUMMY_SP,
+                            attrs: ThinVec::new(),
+                            tokens: None,
+                        }),
+                    );
+                    e.kind = ExprKind::Paren(inner);
+                }
+            }
+        }
+
+        fn visit_generic_arg(&mut self, arg: &mut GenericArg) {
+            match arg {
+                GenericArg::Lifetime(_lifetime) => {}
+                GenericArg::Type(arg) => self.visit_ty(arg),
+                // Don't wrap unbraced const generic arg as that's invalid syntax.
+                GenericArg::Const(anon_const) => {
+                    if let ExprKind::Block(..) = &mut anon_const.value.kind {
+                        noop_visit_expr(&mut anon_const.value, self);
+                    }
+                }
+            }
+        }
+
+        fn visit_param_bound(&mut self, bound: &mut GenericBound) {
+            match bound {
+                GenericBound::Trait(
+                    _,
+                    TraitBoundModifiers {
+                        constness: BoundConstness::Maybe(_),
+                        ..
+                    },
+                )
+                | GenericBound::Outlives(..)
+                | GenericBound::Use(..) => {}
+                GenericBound::Trait(ty, _modifier) => self.visit_poly_trait_ref(ty),
+            }
+        }
+
+        fn visit_block(&mut self, block: &mut P<Block>) {
+            self.visit_id(&mut block.id);
+            block
+                .stmts
+                .flat_map_in_place(|stmt| flat_map_stmt(stmt, self));
+            self.visit_span(&mut block.span);
+        }
+
+        fn visit_local(&mut self, local: &mut P<Local>) {
+            match &mut local.kind {
+                LocalKind::Decl => {}
+                LocalKind::Init(init) => {
+                    self.visit_expr(init);
+                }
+                LocalKind::InitElse(init, els) => {
+                    self.visit_expr(init);
+                    self.visit_block(els);
+                }
+            }
+        }
+
+        fn flat_map_trait_item(&mut self, item: P<AssocItem>) -> SmallVec<[P<AssocItem>; 1]> {
+            match &item.kind {
+                AssocItemKind::Const(const_item)
+                    if !const_item.generics.params.is_empty()
+                        || !const_item.generics.where_clause.predicates.is_empty() =>
+                {
+                    SmallVec::from([item])
+                }
+                _ => noop_flat_map_item(item, self),
+            }
+        }
+
+        fn flat_map_impl_item(&mut self, item: P<AssocItem>) -> SmallVec<[P<AssocItem>; 1]> {
+            match &item.kind {
+                AssocItemKind::Const(const_item)
+                    if !const_item.generics.params.is_empty()
+                        || !const_item.generics.where_clause.predicates.is_empty() =>
+                {
+                    SmallVec::from([item])
+                }
+                _ => noop_flat_map_item(item, self),
+            }
+        }
+
+        // We don't want to look at expressions that might appear in patterns or
+        // types yet. We'll look into comparing those in the future. For now
+        // focus on expressions appearing in other places.
+        fn visit_pat(&mut self, pat: &mut P<Pat>) {
+            let _ = pat;
+        }
+
+        fn visit_ty(&mut self, ty: &mut P<Ty>) {
+            let _ = ty;
+        }
+
+        fn visit_attribute(&mut self, attr: &mut Attribute) {
+            let _ = attr;
+        }
+    }
+
+    let mut folder = FullyParenthesize;
+    folder.visit_expr(&mut librustc_expr);
+    librustc_expr
+}
+
+fn syn_parenthesize(syn_expr: syn::Expr) -> syn::Expr {
+    use syn::fold::{fold_expr, fold_generic_argument, Fold};
+    use syn::{token, BinOp, Expr, ExprParen, GenericArgument, MetaNameValue, Pat, Stmt, Type};
+
+    struct FullyParenthesize;
+
+    fn parenthesize(expr: Expr) -> Expr {
+        Expr::Paren(ExprParen {
+            attrs: Vec::new(),
+            expr: Box::new(expr),
+            paren_token: token::Paren::default(),
+        })
+    }
+
+    fn needs_paren(expr: &Expr) -> bool {
+        match expr {
+            Expr::Group(_) => unreachable!(),
+            Expr::If(_) | Expr::Unsafe(_) | Expr::Block(_) | Expr::Let(_) => false,
+            Expr::Binary(_) => !contains_let_chain(expr),
+            _ => true,
+        }
+    }
+
+    fn contains_let_chain(expr: &Expr) -> bool {
+        match expr {
+            Expr::Let(_) => true,
+            Expr::Binary(expr) => {
+                matches!(expr.op, BinOp::And(_))
+                    && (contains_let_chain(&expr.left) || contains_let_chain(&expr.right))
+            }
+            _ => false,
+        }
+    }
+
+    impl Fold for FullyParenthesize {
+        fn fold_expr(&mut self, expr: Expr) -> Expr {
+            let needs_paren = needs_paren(&expr);
+            let folded = fold_expr(self, expr);
+            if needs_paren {
+                parenthesize(folded)
+            } else {
+                folded
+            }
+        }
+
+        fn fold_generic_argument(&mut self, arg: GenericArgument) -> GenericArgument {
+            match arg {
+                GenericArgument::Const(arg) => GenericArgument::Const(match arg {
+                    Expr::Block(_) => fold_expr(self, arg),
+                    // Don't wrap unbraced const generic arg as that's invalid syntax.
+                    _ => arg,
+                }),
+                _ => fold_generic_argument(self, arg),
+            }
+        }
+
+        fn fold_stmt(&mut self, stmt: Stmt) -> Stmt {
+            match stmt {
+                // Don't wrap toplevel expressions in statements.
+                Stmt::Expr(Expr::Verbatim(_), Some(_)) => stmt,
+                Stmt::Expr(e, semi) => Stmt::Expr(fold_expr(self, e), semi),
+                s => s,
+            }
+        }
+
+        fn fold_meta_name_value(&mut self, meta: MetaNameValue) -> MetaNameValue {
+            // Don't turn #[p = "..."] into #[p = ("...")].
+            meta
+        }
+
+        // We don't want to look at expressions that might appear in patterns or
+        // types yet. We'll look into comparing those in the future. For now
+        // focus on expressions appearing in other places.
+        fn fold_pat(&mut self, pat: Pat) -> Pat {
+            pat
+        }
+
+        fn fold_type(&mut self, ty: Type) -> Type {
+            ty
+        }
+    }
+
+    let mut folder = FullyParenthesize;
+    folder.fold_expr(syn_expr)
+}
+
+fn make_parens_invisible(expr: syn::Expr) -> syn::Expr {
+    use syn::fold::{fold_expr, fold_stmt, Fold};
+    use syn::{token, Expr, ExprGroup, ExprParen, Stmt};
+
+    struct MakeParensInvisible;
+
+    impl Fold for MakeParensInvisible {
+        fn fold_expr(&mut self, mut expr: Expr) -> Expr {
+            if let Expr::Paren(paren) = expr {
+                expr = Expr::Group(ExprGroup {
+                    attrs: paren.attrs,
+                    group_token: token::Group(paren.paren_token.span.join()),
+                    expr: paren.expr,
+                });
+            }
+            fold_expr(self, expr)
+        }
+
+        fn fold_stmt(&mut self, stmt: Stmt) -> Stmt {
+            if let Stmt::Expr(expr @ (Expr::Binary(_) | Expr::Cast(_)), None) = stmt {
+                Stmt::Expr(
+                    Expr::Paren(ExprParen {
+                        attrs: Vec::new(),
+                        paren_token: token::Paren::default(),
+                        expr: Box::new(fold_expr(self, expr)),
+                    }),
+                    None,
+                )
+            } else {
+                fold_stmt(self, stmt)
+            }
+        }
+    }
+
+    let mut folder = MakeParensInvisible;
+    folder.fold_expr(expr)
+}
+
+/// Walk through a crate collecting all expressions we can find in it.
+fn collect_exprs(file: syn::File) -> Vec<syn::Expr> {
+    use syn::fold::Fold;
+    use syn::punctuated::Punctuated;
+    use syn::{token, ConstParam, Expr, ExprTuple, Pat, Path};
+
+    struct CollectExprs(Vec<Expr>);
+    impl Fold for CollectExprs {
+        fn fold_expr(&mut self, expr: Expr) -> Expr {
+            match expr {
+                Expr::Verbatim(_) => {}
+                _ => self.0.push(expr),
+            }
+
+            Expr::Tuple(ExprTuple {
+                attrs: vec![],
+                elems: Punctuated::new(),
+                paren_token: token::Paren::default(),
+            })
+        }
+
+        fn fold_pat(&mut self, pat: Pat) -> Pat {
+            pat
+        }
+
+        fn fold_path(&mut self, path: Path) -> Path {
+            // Skip traversing into const generic path arguments
+            path
+        }
+
+        fn fold_const_param(&mut self, const_param: ConstParam) -> ConstParam {
+            const_param
+        }
+    }
+
+    let mut folder = CollectExprs(vec![]);
+    folder.fold_file(file);
+    folder.0
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_receiver.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_receiver.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_receiver.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_receiver.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,321 @@
+#![allow(clippy::uninlined_format_args)]
+
+#[macro_use]
+mod macros;
+
+use syn::{parse_quote, TraitItemFn};
+
+#[test]
+fn test_by_value() {
+    let TraitItemFn { sig, .. } = parse_quote! {
+        fn by_value(self: Self);
+    };
+    snapshot!(&sig.inputs[0], @r###"
+    FnArg::Receiver(Receiver {
+        colon_token: Some,
+        ty: Type::Path {
+            path: Path {
+                segments: [
+                    PathSegment {
+                        ident: "Self",
+                    },
+                ],
+            },
+        },
+    })
+    "###);
+}
+
+#[test]
+fn test_by_mut_value() {
+    let TraitItemFn { sig, .. } = parse_quote! {
+        fn by_mut(mut self: Self);
+    };
+    snapshot!(&sig.inputs[0], @r###"
+    FnArg::Receiver(Receiver {
+        mutability: Some,
+        colon_token: Some,
+        ty: Type::Path {
+            path: Path {
+                segments: [
+                    PathSegment {
+                        ident: "Self",
+                    },
+                ],
+            },
+        },
+    })
+    "###);
+}
+
+#[test]
+fn test_by_ref() {
+    let TraitItemFn { sig, .. } = parse_quote! {
+        fn by_ref(self: &Self);
+    };
+    snapshot!(&sig.inputs[0], @r###"
+    FnArg::Receiver(Receiver {
+        colon_token: Some,
+        ty: Type::Reference {
+            elem: Type::Path {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "Self",
+                        },
+                    ],
+                },
+            },
+        },
+    })
+    "###);
+}
+
+#[test]
+fn test_by_box() {
+    let TraitItemFn { sig, .. } = parse_quote! {
+        fn by_box(self: Box<Self>);
+    };
+    snapshot!(&sig.inputs[0], @r###"
+    FnArg::Receiver(Receiver {
+        colon_token: Some,
+        ty: Type::Path {
+            path: Path {
+                segments: [
+                    PathSegment {
+                        ident: "Box",
+                        arguments: PathArguments::AngleBracketed {
+                            args: [
+                                GenericArgument::Type(Type::Path {
+                                    path: Path {
+                                        segments: [
+                                            PathSegment {
+                                                ident: "Self",
+                                            },
+                                        ],
+                                    },
+                                }),
+                            ],
+                        },
+                    },
+                ],
+            },
+        },
+    })
+    "###);
+}
+
+#[test]
+fn test_by_pin() {
+    let TraitItemFn { sig, .. } = parse_quote! {
+        fn by_pin(self: Pin<Self>);
+    };
+    snapshot!(&sig.inputs[0], @r###"
+    FnArg::Receiver(Receiver {
+        colon_token: Some,
+        ty: Type::Path {
+            path: Path {
+                segments: [
+                    PathSegment {
+                        ident: "Pin",
+                        arguments: PathArguments::AngleBracketed {
+                            args: [
+                                GenericArgument::Type(Type::Path {
+                                    path: Path {
+                                        segments: [
+                                            PathSegment {
+                                                ident: "Self",
+                                            },
+                                        ],
+                                    },
+                                }),
+                            ],
+                        },
+                    },
+                ],
+            },
+        },
+    })
+    "###);
+}
+
+#[test]
+fn test_explicit_type() {
+    let TraitItemFn { sig, .. } = parse_quote! {
+        fn explicit_type(self: Pin<MyType>);
+    };
+    snapshot!(&sig.inputs[0], @r###"
+    FnArg::Receiver(Receiver {
+        colon_token: Some,
+        ty: Type::Path {
+            path: Path {
+                segments: [
+                    PathSegment {
+                        ident: "Pin",
+                        arguments: PathArguments::AngleBracketed {
+                            args: [
+                                GenericArgument::Type(Type::Path {
+                                    path: Path {
+                                        segments: [
+                                            PathSegment {
+                                                ident: "MyType",
+                                            },
+                                        ],
+                                    },
+                                }),
+                            ],
+                        },
+                    },
+                ],
+            },
+        },
+    })
+    "###);
+}
+
+#[test]
+fn test_value_shorthand() {
+    let TraitItemFn { sig, .. } = parse_quote! {
+        fn value_shorthand(self);
+    };
+    snapshot!(&sig.inputs[0], @r###"
+    FnArg::Receiver(Receiver {
+        ty: Type::Path {
+            path: Path {
+                segments: [
+                    PathSegment {
+                        ident: "Self",
+                    },
+                ],
+            },
+        },
+    })
+    "###);
+}
+
+#[test]
+fn test_mut_value_shorthand() {
+    let TraitItemFn { sig, .. } = parse_quote! {
+        fn mut_value_shorthand(mut self);
+    };
+    snapshot!(&sig.inputs[0], @r###"
+    FnArg::Receiver(Receiver {
+        mutability: Some,
+        ty: Type::Path {
+            path: Path {
+                segments: [
+                    PathSegment {
+                        ident: "Self",
+                    },
+                ],
+            },
+        },
+    })
+    "###);
+}
+
+#[test]
+fn test_ref_shorthand() {
+    let TraitItemFn { sig, .. } = parse_quote! {
+        fn ref_shorthand(&self);
+    };
+    snapshot!(&sig.inputs[0], @r###"
+    FnArg::Receiver(Receiver {
+        reference: Some(None),
+        ty: Type::Reference {
+            elem: Type::Path {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "Self",
+                        },
+                    ],
+                },
+            },
+        },
+    })
+    "###);
+}
+
+#[test]
+fn test_ref_shorthand_with_lifetime() {
+    let TraitItemFn { sig, .. } = parse_quote! {
+        fn ref_shorthand(&'a self);
+    };
+    snapshot!(&sig.inputs[0], @r###"
+    FnArg::Receiver(Receiver {
+        reference: Some(Some(Lifetime {
+            ident: "a",
+        })),
+        ty: Type::Reference {
+            lifetime: Some(Lifetime {
+                ident: "a",
+            }),
+            elem: Type::Path {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "Self",
+                        },
+                    ],
+                },
+            },
+        },
+    })
+    "###);
+}
+
+#[test]
+fn test_ref_mut_shorthand() {
+    let TraitItemFn { sig, .. } = parse_quote! {
+        fn ref_mut_shorthand(&mut self);
+    };
+    snapshot!(&sig.inputs[0], @r###"
+    FnArg::Receiver(Receiver {
+        reference: Some(None),
+        mutability: Some,
+        ty: Type::Reference {
+            mutability: Some,
+            elem: Type::Path {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "Self",
+                        },
+                    ],
+                },
+            },
+        },
+    })
+    "###);
+}
+
+#[test]
+fn test_ref_mut_shorthand_with_lifetime() {
+    let TraitItemFn { sig, .. } = parse_quote! {
+        fn ref_mut_shorthand(&'a mut self);
+    };
+    snapshot!(&sig.inputs[0], @r###"
+    FnArg::Receiver(Receiver {
+        reference: Some(Some(Lifetime {
+            ident: "a",
+        })),
+        mutability: Some,
+        ty: Type::Reference {
+            lifetime: Some(Lifetime {
+                ident: "a",
+            }),
+            mutability: Some,
+            elem: Type::Path {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "Self",
+                        },
+                    ],
+                },
+            },
+        },
+    })
+    "###);
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_round_trip.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_round_trip.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_round_trip.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_round_trip.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,256 @@
+#![cfg(not(syn_disable_nightly_tests))]
+#![cfg(not(miri))]
+#![recursion_limit = "1024"]
+#![feature(rustc_private)]
+#![allow(
+    clippy::blocks_in_conditions,
+    clippy::manual_assert,
+    clippy::manual_let_else,
+    clippy::match_like_matches_macro,
+    clippy::uninlined_format_args
+)]
+
+extern crate rustc_ast;
+extern crate rustc_ast_pretty;
+extern crate rustc_data_structures;
+extern crate rustc_driver;
+extern crate rustc_error_messages;
+extern crate rustc_errors;
+extern crate rustc_expand;
+extern crate rustc_parse as parse;
+extern crate rustc_session;
+extern crate rustc_span;
+
+use crate::common::eq::SpanlessEq;
+use quote::quote;
+use rustc_ast::ast::{
+    AngleBracketedArg, AngleBracketedArgs, Crate, GenericArg, GenericParamKind, Generics,
+    WhereClause,
+};
+use rustc_ast::mut_visit::MutVisitor;
+use rustc_ast_pretty::pprust;
+use rustc_data_structures::flat_map_in_place::FlatMapInPlace;
+use rustc_error_messages::{DiagMessage, LazyFallbackBundle};
+use rustc_errors::{translation, Diag, PResult};
+use rustc_session::parse::ParseSess;
+use rustc_span::FileName;
+use std::borrow::Cow;
+use std::fs;
+use std::panic;
+use std::path::Path;
+use std::process;
+use std::sync::atomic::{AtomicUsize, Ordering};
+use std::time::Instant;
+
+#[macro_use]
+mod macros;
+
+mod common;
+mod repo;
+
+#[test]
+fn test_round_trip() {
+    repo::rayon_init();
+    repo::clone_rust();
+    let abort_after = repo::abort_after();
+    if abort_after == 0 {
+        panic!("skipping all round_trip tests");
+    }
+
+    let failed = AtomicUsize::new(0);
+
+    repo::for_each_rust_file(|path| test(path, &failed, abort_after));
+
+    let failed = failed.into_inner();
+    if failed > 0 {
+        panic!("{} failures", failed);
+    }
+}
+
+fn test(path: &Path, failed: &AtomicUsize, abort_after: usize) {
+    let failed = || {
+        let prev_failed = failed.fetch_add(1, Ordering::Relaxed);
+        if prev_failed + 1 >= abort_after {
+            process::exit(1);
+        }
+    };
+
+    let content = fs::read_to_string(path).unwrap();
+
+    let (back, elapsed) = match panic::catch_unwind(|| {
+        let start = Instant::now();
+        let result = syn::parse_file(&content);
+        let elapsed = start.elapsed();
+        result.map(|krate| (quote!(#krate).to_string(), elapsed))
+    }) {
+        Err(_) => {
+            errorf!("=== {}: syn panic\n", path.display());
+            failed();
+            return;
+        }
+        Ok(Err(msg)) => {
+            errorf!("=== {}: syn failed to parse\n{:?}\n", path.display(), msg);
+            failed();
+            return;
+        }
+        Ok(Ok(result)) => result,
+    };
+
+    let edition = repo::edition(path).parse().unwrap();
+
+    rustc_span::create_session_if_not_set_then(edition, |_| {
+        let equal = match panic::catch_unwind(|| {
+            let locale_resources = rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec();
+            let sess = ParseSess::new(locale_resources);
+            let before = match librustc_parse(content, &sess) {
+                Ok(before) => before,
+                Err(diagnostic) => {
+                    errorf!(
+                        "=== {}: ignore - librustc failed to parse original content: {}\n",
+                        path.display(),
+                        translate_message(&diagnostic),
+                    );
+                    diagnostic.cancel();
+                    return Err(true);
+                }
+            };
+            let after = match librustc_parse(back, &sess) {
+                Ok(after) => after,
+                Err(diagnostic) => {
+                    errorf!("=== {}: librustc failed to parse", path.display());
+                    diagnostic.emit();
+                    return Err(false);
+                }
+            };
+            Ok((before, after))
+        }) {
+            Err(_) => {
+                errorf!("=== {}: ignoring librustc panic\n", path.display());
+                true
+            }
+            Ok(Err(equal)) => equal,
+            Ok(Ok((mut before, mut after))) => {
+                normalize(&mut before);
+                normalize(&mut after);
+                if SpanlessEq::eq(&before, &after) {
+                    errorf!(
+                        "=== {}: pass in {}ms\n",
+                        path.display(),
+                        elapsed.as_secs() * 1000 + u64::from(elapsed.subsec_nanos()) / 1_000_000
+                    );
+                    true
+                } else {
+                    errorf!(
+                        "=== {}: FAIL\n{}\n!=\n{}\n",
+                        path.display(),
+                        pprust::crate_to_string_for_macros(&before),
+                        pprust::crate_to_string_for_macros(&after),
+                    );
+                    false
+                }
+            }
+        };
+        if !equal {
+            failed();
+        }
+    });
+}
+
+fn librustc_parse(content: String, sess: &ParseSess) -> PResult<Crate> {
+    static COUNTER: AtomicUsize = AtomicUsize::new(0);
+    let counter = COUNTER.fetch_add(1, Ordering::Relaxed);
+    let name = FileName::Custom(format!("test_round_trip{}", counter));
+    let mut parser = parse::new_parser_from_source_str(sess, name, content).unwrap();
+    parser.parse_crate_mod()
+}
+
+fn translate_message(diagnostic: &Diag) -> Cow<'static, str> {
+    thread_local! {
+        static FLUENT_BUNDLE: LazyFallbackBundle = {
+            let locale_resources = rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec();
+            let with_directionality_markers = false;
+            rustc_error_messages::fallback_fluent_bundle(locale_resources, with_directionality_markers)
+        };
+    }
+
+    let message = &diagnostic.messages[0].0;
+    let args = translation::to_fluent_args(diagnostic.args.iter());
+
+    let (identifier, attr) = match message {
+        DiagMessage::Str(msg) | DiagMessage::Translated(msg) => return msg.clone(),
+        DiagMessage::FluentIdentifier(identifier, attr) => (identifier, attr),
+    };
+
+    FLUENT_BUNDLE.with(|fluent_bundle| {
+        let message = fluent_bundle
+            .get_message(identifier)
+            .expect("missing diagnostic in fluent bundle");
+        let value = match attr {
+            Some(attr) => message
+                .get_attribute(attr)
+                .expect("missing attribute in fluent message")
+                .value(),
+            None => message.value().expect("missing value in fluent message"),
+        };
+
+        let mut err = Vec::new();
+        let translated = fluent_bundle.format_pattern(value, Some(&args), &mut err);
+        assert!(err.is_empty());
+        Cow::Owned(translated.into_owned())
+    })
+}
+
+fn normalize(krate: &mut Crate) {
+    struct NormalizeVisitor;
+
+    impl MutVisitor for NormalizeVisitor {
+        fn visit_angle_bracketed_parameter_data(&mut self, e: &mut AngleBracketedArgs) {
+            #[derive(Ord, PartialOrd, Eq, PartialEq)]
+            enum Group {
+                Lifetimes,
+                TypesAndConsts,
+                Constraints,
+            }
+            e.args.sort_by_key(|arg| match arg {
+                AngleBracketedArg::Arg(arg) => match arg {
+                    GenericArg::Lifetime(_) => Group::Lifetimes,
+                    GenericArg::Type(_) | GenericArg::Const(_) => Group::TypesAndConsts,
+                },
+                AngleBracketedArg::Constraint(_) => Group::Constraints,
+            });
+            for arg in &mut e.args {
+                match arg {
+                    AngleBracketedArg::Arg(arg) => self.visit_generic_arg(arg),
+                    AngleBracketedArg::Constraint(constraint) => {
+                        self.visit_assoc_item_constraint(constraint);
+                    }
+                }
+            }
+        }
+
+        fn visit_generics(&mut self, e: &mut Generics) {
+            #[derive(Ord, PartialOrd, Eq, PartialEq)]
+            enum Group {
+                Lifetimes,
+                TypesAndConsts,
+            }
+            e.params.sort_by_key(|param| match param.kind {
+                GenericParamKind::Lifetime => Group::Lifetimes,
+                GenericParamKind::Type { .. } | GenericParamKind::Const { .. } => {
+                    Group::TypesAndConsts
+                }
+            });
+            e.params
+                .flat_map_in_place(|param| self.flat_map_generic_param(param));
+            self.visit_where_clause(&mut e.where_clause);
+        }
+
+        fn visit_where_clause(&mut self, e: &mut WhereClause) {
+            if e.predicates.is_empty() {
+                e.has_where_token = false;
+            }
+        }
+    }
+
+    NormalizeVisitor.visit_crate(krate);
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_shebang.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_shebang.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_shebang.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_shebang.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,67 @@
+#![allow(clippy::uninlined_format_args)]
+
+#[macro_use]
+mod macros;
+
+#[test]
+fn test_basic() {
+    let content = "#!/usr/bin/env rustx\nfn main() {}";
+    let file = syn::parse_file(content).unwrap();
+    snapshot!(file, @r###"
+    File {
+        shebang: Some("#!/usr/bin/env rustx"),
+        items: [
+            Item::Fn {
+                vis: Visibility::Inherited,
+                sig: Signature {
+                    ident: "main",
+                    generics: Generics,
+                    output: ReturnType::Default,
+                },
+                block: Block {
+                    stmts: [],
+                },
+            },
+        ],
+    }
+    "###);
+}
+
+#[test]
+fn test_comment() {
+    let content = "#!//am/i/a/comment\n[allow(dead_code)] fn main() {}";
+    let file = syn::parse_file(content).unwrap();
+    snapshot!(file, @r###"
+    File {
+        attrs: [
+            Attribute {
+                style: AttrStyle::Inner,
+                meta: Meta::List {
+                    path: Path {
+                        segments: [
+                            PathSegment {
+                                ident: "allow",
+                            },
+                        ],
+                    },
+                    delimiter: MacroDelimiter::Paren,
+                    tokens: TokenStream(`dead_code`),
+                },
+            },
+        ],
+        items: [
+            Item::Fn {
+                vis: Visibility::Inherited,
+                sig: Signature {
+                    ident: "main",
+                    generics: Generics,
+                    output: ReturnType::Default,
+                },
+                block: Block {
+                    stmts: [],
+                },
+            },
+        ],
+    }
+    "###);
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_size.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_size.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_size.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_size.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,54 @@
+// Assumes proc-macro2's "span-locations" feature is off.
+
+use std::mem;
+use syn::{Expr, Item, Lit, Pat, Type};
+
+#[rustversion::attr(before(2022-11-24), ignore = "requires nightly-2022-11-24 or newer")]
+#[rustversion::attr(
+    since(2022-11-24),
+    cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit")
+)]
+#[test]
+fn test_expr_size() {
+    assert_eq!(mem::size_of::<Expr>(), 176);
+}
+
+#[rustversion::attr(before(2022-09-09), ignore = "requires nightly-2022-09-09 or newer")]
+#[rustversion::attr(
+    since(2022-09-09),
+    cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit")
+)]
+#[test]
+fn test_item_size() {
+    assert_eq!(mem::size_of::<Item>(), 352);
+}
+
+#[rustversion::attr(before(2023-04-29), ignore = "requires nightly-2023-04-29 or newer")]
+#[rustversion::attr(
+    since(2023-04-29),
+    cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit")
+)]
+#[test]
+fn test_type_size() {
+    assert_eq!(mem::size_of::<Type>(), 224);
+}
+
+#[rustversion::attr(before(2023-04-29), ignore = "requires nightly-2023-04-29 or newer")]
+#[rustversion::attr(
+    since(2023-04-29),
+    cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit")
+)]
+#[test]
+fn test_pat_size() {
+    assert_eq!(mem::size_of::<Pat>(), 184);
+}
+
+#[rustversion::attr(before(2023-12-20), ignore = "requires nightly-2023-12-20 or newer")]
+#[rustversion::attr(
+    since(2023-12-20),
+    cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit")
+)]
+#[test]
+fn test_lit_size() {
+    assert_eq!(mem::size_of::<Lit>(), 24);
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_stmt.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_stmt.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_stmt.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_stmt.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,322 @@
+#![allow(
+    clippy::assertions_on_result_states,
+    clippy::non_ascii_literal,
+    clippy::uninlined_format_args
+)]
+
+#[macro_use]
+mod macros;
+
+use proc_macro2::{Delimiter, Group, Ident, Span, TokenStream, TokenTree};
+use quote::{quote, ToTokens as _};
+use syn::parse::Parser as _;
+use syn::{Block, Stmt};
+
+#[test]
+fn test_raw_operator() {
+    let stmt = syn::parse_str::<Stmt>("let _ = &raw const x;").unwrap();
+
+    snapshot!(stmt, @r###"
+    Stmt::Local {
+        pat: Pat::Wild,
+        init: Some(LocalInit {
+            expr: Expr::Verbatim(`& raw const x`),
+        }),
+    }
+    "###);
+}
+
+#[test]
+fn test_raw_variable() {
+    let stmt = syn::parse_str::<Stmt>("let _ = &raw;").unwrap();
+
+    snapshot!(stmt, @r###"
+    Stmt::Local {
+        pat: Pat::Wild,
+        init: Some(LocalInit {
+            expr: Expr::Reference {
+                expr: Expr::Path {
+                    path: Path {
+                        segments: [
+                            PathSegment {
+                                ident: "raw",
+                            },
+                        ],
+                    },
+                },
+            },
+        }),
+    }
+    "###);
+}
+
+#[test]
+fn test_raw_invalid() {
+    assert!(syn::parse_str::<Stmt>("let _ = &raw x;").is_err());
+}
+
+#[test]
+fn test_none_group() {
+    // «∅ async fn f() {} ∅»
+    let tokens = TokenStream::from_iter([TokenTree::Group(Group::new(
+        Delimiter::None,
+        TokenStream::from_iter([
+            TokenTree::Ident(Ident::new("async", Span::call_site())),
+            TokenTree::Ident(Ident::new("fn", Span::call_site())),
+            TokenTree::Ident(Ident::new("f", Span::call_site())),
+            TokenTree::Group(Group::new(Delimiter::Parenthesis, TokenStream::new())),
+            TokenTree::Group(Group::new(Delimiter::Brace, TokenStream::new())),
+        ]),
+    ))]);
+    snapshot!(tokens as Stmt, @r###"
+    Stmt::Item(Item::Fn {
+        vis: Visibility::Inherited,
+        sig: Signature {
+            asyncness: Some,
+            ident: "f",
+            generics: Generics,
+            output: ReturnType::Default,
+        },
+        block: Block {
+            stmts: [],
+        },
+    })
+    "###);
+
+    let tokens = Group::new(Delimiter::None, quote!(let None = None)).to_token_stream();
+    let stmts = Block::parse_within.parse2(tokens).unwrap();
+    snapshot!(stmts, @r###"
+    [
+        Stmt::Expr(
+            Expr::Group {
+                expr: Expr::Let {
+                    pat: Pat::Ident {
+                        ident: "None",
+                    },
+                    expr: Expr::Path {
+                        path: Path {
+                            segments: [
+                                PathSegment {
+                                    ident: "None",
+                                },
+                            ],
+                        },
+                    },
+                },
+            },
+            None,
+        ),
+    ]
+    "###);
+}
+
+#[test]
+fn test_let_dot_dot() {
+    let tokens = quote! {
+        let .. = 10;
+    };
+
+    snapshot!(tokens as Stmt, @r###"
+    Stmt::Local {
+        pat: Pat::Rest,
+        init: Some(LocalInit {
+            expr: Expr::Lit {
+                lit: 10,
+            },
+        }),
+    }
+    "###);
+}
+
+#[test]
+fn test_let_else() {
+    let tokens = quote! {
+        let Some(x) = None else { return 0; };
+    };
+
+    snapshot!(tokens as Stmt, @r###"
+    Stmt::Local {
+        pat: Pat::TupleStruct {
+            path: Path {
+                segments: [
+                    PathSegment {
+                        ident: "Some",
+                    },
+                ],
+            },
+            elems: [
+                Pat::Ident {
+                    ident: "x",
+                },
+            ],
+        },
+        init: Some(LocalInit {
+            expr: Expr::Path {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "None",
+                        },
+                    ],
+                },
+            },
+            diverge: Some(Expr::Block {
+                block: Block {
+                    stmts: [
+                        Stmt::Expr(
+                            Expr::Return {
+                                expr: Some(Expr::Lit {
+                                    lit: 0,
+                                }),
+                            },
+                            Some,
+                        ),
+                    ],
+                },
+            }),
+        }),
+    }
+    "###);
+}
+
+#[test]
+fn test_macros() {
+    let tokens = quote! {
+        fn main() {
+            macro_rules! mac {}
+            thread_local! { static FOO }
+            println!("");
+            vec![]
+        }
+    };
+
+    snapshot!(tokens as Stmt, @r###"
+    Stmt::Item(Item::Fn {
+        vis: Visibility::Inherited,
+        sig: Signature {
+            ident: "main",
+            generics: Generics,
+            output: ReturnType::Default,
+        },
+        block: Block {
+            stmts: [
+                Stmt::Item(Item::Macro {
+                    ident: Some("mac"),
+                    mac: Macro {
+                        path: Path {
+                            segments: [
+                                PathSegment {
+                                    ident: "macro_rules",
+                                },
+                            ],
+                        },
+                        delimiter: MacroDelimiter::Brace,
+                        tokens: TokenStream(``),
+                    },
+                }),
+                Stmt::Macro {
+                    mac: Macro {
+                        path: Path {
+                            segments: [
+                                PathSegment {
+                                    ident: "thread_local",
+                                },
+                            ],
+                        },
+                        delimiter: MacroDelimiter::Brace,
+                        tokens: TokenStream(`static FOO`),
+                    },
+                },
+                Stmt::Macro {
+                    mac: Macro {
+                        path: Path {
+                            segments: [
+                                PathSegment {
+                                    ident: "println",
+                                },
+                            ],
+                        },
+                        delimiter: MacroDelimiter::Paren,
+                        tokens: TokenStream(`""`),
+                    },
+                    semi_token: Some,
+                },
+                Stmt::Expr(
+                    Expr::Macro {
+                        mac: Macro {
+                            path: Path {
+                                segments: [
+                                    PathSegment {
+                                        ident: "vec",
+                                    },
+                                ],
+                            },
+                            delimiter: MacroDelimiter::Bracket,
+                            tokens: TokenStream(``),
+                        },
+                    },
+                    None,
+                ),
+            ],
+        },
+    })
+    "###);
+}
+
+#[test]
+fn test_early_parse_loop() {
+    // The following is an Expr::Loop followed by Expr::Tuple. It is not an
+    // Expr::Call.
+    let tokens = quote! {
+        loop {}
+        ()
+    };
+
+    let stmts = Block::parse_within.parse2(tokens).unwrap();
+
+    snapshot!(stmts, @r###"
+    [
+        Stmt::Expr(
+            Expr::Loop {
+                body: Block {
+                    stmts: [],
+                },
+            },
+            None,
+        ),
+        Stmt::Expr(
+            Expr::Tuple,
+            None,
+        ),
+    ]
+    "###);
+
+    let tokens = quote! {
+        'a: loop {}
+        ()
+    };
+
+    let stmts = Block::parse_within.parse2(tokens).unwrap();
+
+    snapshot!(stmts, @r###"
+    [
+        Stmt::Expr(
+            Expr::Loop {
+                label: Some(Label {
+                    name: Lifetime {
+                        ident: "a",
+                    },
+                }),
+                body: Block {
+                    stmts: [],
+                },
+            },
+            None,
+        ),
+        Stmt::Expr(
+            Expr::Tuple,
+            None,
+        ),
+    ]
+    "###);
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_token_trees.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_token_trees.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_token_trees.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_token_trees.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,32 @@
+#![allow(clippy::uninlined_format_args)]
+
+#[macro_use]
+mod macros;
+
+use proc_macro2::TokenStream;
+use quote::quote;
+use syn::Lit;
+
+#[test]
+fn test_struct() {
+    let input = "
+        #[derive(Debug, Clone)]
+        pub struct Item {
+            pub ident: Ident,
+            pub attrs: Vec<Attribute>,
+        }
+    ";
+
+    snapshot!(input as TokenStream, @r###"
+    TokenStream(
+        `# [derive (Debug , Clone)] pub struct Item { pub ident : Ident , pub attrs : Vec < Attribute >, }`,
+    )
+    "###);
+}
+
+#[test]
+fn test_literal_mangling() {
+    let code = "0_4";
+    let parsed: Lit = syn::parse_str(code).unwrap();
+    assert_eq!(code, quote!(#parsed).to_string());
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_ty.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_ty.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_ty.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_ty.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,397 @@
+#![allow(clippy::uninlined_format_args)]
+
+#[macro_use]
+mod macros;
+
+use proc_macro2::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream, TokenTree};
+use quote::{quote, ToTokens as _};
+use syn::punctuated::Punctuated;
+use syn::{parse_quote, token, Token, Type, TypeTuple};
+
+#[test]
+fn test_mut_self() {
+    syn::parse_str::<Type>("fn(mut self)").unwrap();
+    syn::parse_str::<Type>("fn(mut self,)").unwrap();
+    syn::parse_str::<Type>("fn(mut self: ())").unwrap();
+    syn::parse_str::<Type>("fn(mut self: ...)").unwrap_err();
+    syn::parse_str::<Type>("fn(mut self: mut self)").unwrap_err();
+    syn::parse_str::<Type>("fn(mut self::T)").unwrap_err();
+}
+
+#[test]
+fn test_macro_variable_type() {
+    // mimics the token stream corresponding to `$ty<T>`
+    let tokens = TokenStream::from_iter([
+        TokenTree::Group(Group::new(Delimiter::None, quote! { ty })),
+        TokenTree::Punct(Punct::new('<', Spacing::Alone)),
+        TokenTree::Ident(Ident::new("T", Span::call_site())),
+        TokenTree::Punct(Punct::new('>', Spacing::Alone)),
+    ]);
+
+    snapshot!(tokens as Type, @r###"
+    Type::Path {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "ty",
+                    arguments: PathArguments::AngleBracketed {
+                        args: [
+                            GenericArgument::Type(Type::Path {
+                                path: Path {
+                                    segments: [
+                                        PathSegment {
+                                            ident: "T",
+                                        },
+                                    ],
+                                },
+                            }),
+                        ],
+                    },
+                },
+            ],
+        },
+    }
+    "###);
+
+    // mimics the token stream corresponding to `$ty::<T>`
+    let tokens = TokenStream::from_iter([
+        TokenTree::Group(Group::new(Delimiter::None, quote! { ty })),
+        TokenTree::Punct(Punct::new(':', Spacing::Joint)),
+        TokenTree::Punct(Punct::new(':', Spacing::Alone)),
+        TokenTree::Punct(Punct::new('<', Spacing::Alone)),
+        TokenTree::Ident(Ident::new("T", Span::call_site())),
+        TokenTree::Punct(Punct::new('>', Spacing::Alone)),
+    ]);
+
+    snapshot!(tokens as Type, @r###"
+    Type::Path {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "ty",
+                    arguments: PathArguments::AngleBracketed {
+                        colon2_token: Some,
+                        args: [
+                            GenericArgument::Type(Type::Path {
+                                path: Path {
+                                    segments: [
+                                        PathSegment {
+                                            ident: "T",
+                                        },
+                                    ],
+                                },
+                            }),
+                        ],
+                    },
+                },
+            ],
+        },
+    }
+    "###);
+}
+
+#[test]
+fn test_group_angle_brackets() {
+    // mimics the token stream corresponding to `Option<$ty>`
+    let tokens = TokenStream::from_iter([
+        TokenTree::Ident(Ident::new("Option", Span::call_site())),
+        TokenTree::Punct(Punct::new('<', Spacing::Alone)),
+        TokenTree::Group(Group::new(Delimiter::None, quote! { Vec<u8> })),
+        TokenTree::Punct(Punct::new('>', Spacing::Alone)),
+    ]);
+
+    snapshot!(tokens as Type, @r###"
+    Type::Path {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "Option",
+                    arguments: PathArguments::AngleBracketed {
+                        args: [
+                            GenericArgument::Type(Type::Group {
+                                elem: Type::Path {
+                                    path: Path {
+                                        segments: [
+                                            PathSegment {
+                                                ident: "Vec",
+                                                arguments: PathArguments::AngleBracketed {
+                                                    args: [
+                                                        GenericArgument::Type(Type::Path {
+                                                            path: Path {
+                                                                segments: [
+                                                                    PathSegment {
+                                                                        ident: "u8",
+                                                                    },
+                                                                ],
+                                                            },
+                                                        }),
+                                                    ],
+                                                },
+                                            },
+                                        ],
+                                    },
+                                },
+                            }),
+                        ],
+                    },
+                },
+            ],
+        },
+    }
+    "###);
+}
+
+#[test]
+fn test_group_colons() {
+    // mimics the token stream corresponding to `$ty::Item`
+    let tokens = TokenStream::from_iter([
+        TokenTree::Group(Group::new(Delimiter::None, quote! { Vec<u8> })),
+        TokenTree::Punct(Punct::new(':', Spacing::Joint)),
+        TokenTree::Punct(Punct::new(':', Spacing::Alone)),
+        TokenTree::Ident(Ident::new("Item", Span::call_site())),
+    ]);
+
+    snapshot!(tokens as Type, @r###"
+    Type::Path {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "Vec",
+                    arguments: PathArguments::AngleBracketed {
+                        args: [
+                            GenericArgument::Type(Type::Path {
+                                path: Path {
+                                    segments: [
+                                        PathSegment {
+                                            ident: "u8",
+                                        },
+                                    ],
+                                },
+                            }),
+                        ],
+                    },
+                },
+                Token![::],
+                PathSegment {
+                    ident: "Item",
+                },
+            ],
+        },
+    }
+    "###);
+
+    let tokens = TokenStream::from_iter([
+        TokenTree::Group(Group::new(Delimiter::None, quote! { [T] })),
+        TokenTree::Punct(Punct::new(':', Spacing::Joint)),
+        TokenTree::Punct(Punct::new(':', Spacing::Alone)),
+        TokenTree::Ident(Ident::new("Element", Span::call_site())),
+    ]);
+
+    snapshot!(tokens as Type, @r###"
+    Type::Path {
+        qself: Some(QSelf {
+            ty: Type::Slice {
+                elem: Type::Path {
+                    path: Path {
+                        segments: [
+                            PathSegment {
+                                ident: "T",
+                            },
+                        ],
+                    },
+                },
+            },
+            position: 0,
+        }),
+        path: Path {
+            leading_colon: Some,
+            segments: [
+                PathSegment {
+                    ident: "Element",
+                },
+            ],
+        },
+    }
+    "###);
+}
+
+#[test]
+fn test_trait_object() {
+    let tokens = quote!(dyn for<'a> Trait<'a> + 'static);
+    snapshot!(tokens as Type, @r###"
+    Type::TraitObject {
+        dyn_token: Some,
+        bounds: [
+            TypeParamBound::Trait(TraitBound {
+                lifetimes: Some(BoundLifetimes {
+                    lifetimes: [
+                        GenericParam::Lifetime(LifetimeParam {
+                            lifetime: Lifetime {
+                                ident: "a",
+                            },
+                        }),
+                    ],
+                }),
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "Trait",
+                            arguments: PathArguments::AngleBracketed {
+                                args: [
+                                    GenericArgument::Lifetime(Lifetime {
+                                        ident: "a",
+                                    }),
+                                ],
+                            },
+                        },
+                    ],
+                },
+            }),
+            Token![+],
+            TypeParamBound::Lifetime {
+                ident: "static",
+            },
+        ],
+    }
+    "###);
+
+    let tokens = quote!(dyn 'a + Trait);
+    snapshot!(tokens as Type, @r###"
+    Type::TraitObject {
+        dyn_token: Some,
+        bounds: [
+            TypeParamBound::Lifetime {
+                ident: "a",
+            },
+            Token![+],
+            TypeParamBound::Trait(TraitBound {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "Trait",
+                        },
+                    ],
+                },
+            }),
+        ],
+    }
+    "###);
+
+    // None of the following are valid Rust types.
+    syn::parse_str::<Type>("for<'a> dyn Trait<'a>").unwrap_err();
+    syn::parse_str::<Type>("dyn for<'a> 'a + Trait").unwrap_err();
+}
+
+#[test]
+fn test_trailing_plus() {
+    #[rustfmt::skip]
+    let tokens = quote!(impl Trait +);
+    snapshot!(tokens as Type, @r###"
+    Type::ImplTrait {
+        bounds: [
+            TypeParamBound::Trait(TraitBound {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "Trait",
+                        },
+                    ],
+                },
+            }),
+            Token![+],
+        ],
+    }
+    "###);
+
+    #[rustfmt::skip]
+    let tokens = quote!(dyn Trait +);
+    snapshot!(tokens as Type, @r###"
+    Type::TraitObject {
+        dyn_token: Some,
+        bounds: [
+            TypeParamBound::Trait(TraitBound {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "Trait",
+                        },
+                    ],
+                },
+            }),
+            Token![+],
+        ],
+    }
+    "###);
+
+    #[rustfmt::skip]
+    let tokens = quote!(Trait +);
+    snapshot!(tokens as Type, @r###"
+    Type::TraitObject {
+        bounds: [
+            TypeParamBound::Trait(TraitBound {
+                path: Path {
+                    segments: [
+                        PathSegment {
+                            ident: "Trait",
+                        },
+                    ],
+                },
+            }),
+            Token![+],
+        ],
+    }
+    "###);
+}
+
+#[test]
+fn test_tuple_comma() {
+    let mut expr = TypeTuple {
+        paren_token: token::Paren::default(),
+        elems: Punctuated::new(),
+    };
+    snapshot!(expr.to_token_stream() as Type, @"Type::Tuple");
+
+    expr.elems.push_value(parse_quote!(_));
+    // Must not parse to Type::Paren
+    snapshot!(expr.to_token_stream() as Type, @r###"
+    Type::Tuple {
+        elems: [
+            Type::Infer,
+            Token![,],
+        ],
+    }
+    "###);
+
+    expr.elems.push_punct(<Token![,]>::default());
+    snapshot!(expr.to_token_stream() as Type, @r###"
+    Type::Tuple {
+        elems: [
+            Type::Infer,
+            Token![,],
+        ],
+    }
+    "###);
+
+    expr.elems.push_value(parse_quote!(_));
+    snapshot!(expr.to_token_stream() as Type, @r###"
+    Type::Tuple {
+        elems: [
+            Type::Infer,
+            Token![,],
+            Type::Infer,
+        ],
+    }
+    "###);
+
+    expr.elems.push_punct(<Token![,]>::default());
+    snapshot!(expr.to_token_stream() as Type, @r###"
+    Type::Tuple {
+        elems: [
+            Type::Infer,
+            Token![,],
+            Type::Infer,
+            Token![,],
+        ],
+    }
+    "###);
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_unparenthesize.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_unparenthesize.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_unparenthesize.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_unparenthesize.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,63 @@
+#![cfg(not(miri))]
+#![allow(clippy::manual_assert, clippy::uninlined_format_args)]
+
+use quote::ToTokens as _;
+use std::fs;
+use std::mem;
+use std::panic;
+use std::path::Path;
+use std::sync::atomic::{AtomicUsize, Ordering};
+use syn::visit_mut::{self, VisitMut};
+use syn::Expr;
+
+#[macro_use]
+mod macros;
+
+mod repo;
+
+#[test]
+fn test_unparenthesize() {
+    repo::rayon_init();
+    repo::clone_rust();
+
+    let failed = AtomicUsize::new(0);
+
+    repo::for_each_rust_file(|path| test(path, &failed));
+
+    let failed = failed.into_inner();
+    if failed > 0 {
+        panic!("{} failures", failed);
+    }
+}
+
+struct FlattenParens;
+
+impl VisitMut for FlattenParens {
+    fn visit_expr_mut(&mut self, e: &mut Expr) {
+        while let Expr::Paren(paren) = e {
+            *e = mem::replace(&mut *paren.expr, Expr::PLACEHOLDER);
+        }
+        visit_mut::visit_expr_mut(self, e);
+    }
+}
+
+fn test(path: &Path, failed: &AtomicUsize) {
+    let content = fs::read_to_string(path).unwrap();
+
+    match panic::catch_unwind(|| -> syn::Result<()> {
+        let mut syntax_tree = syn::parse_file(&content)?;
+        FlattenParens.visit_file_mut(&mut syntax_tree);
+        syn::parse2::<syn::File>(syntax_tree.to_token_stream())?;
+        Ok(())
+    }) {
+        Err(_) => {
+            errorf!("=== {}: syn panic\n", path.display());
+            failed.fetch_add(1, Ordering::Relaxed);
+        }
+        Ok(Err(msg)) => {
+            errorf!("=== {}: syn failed to parse\n{:?}\n", path.display(), msg);
+            failed.fetch_add(1, Ordering::Relaxed);
+        }
+        Ok(Ok(())) => {}
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/test_visibility.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_visibility.rs
--- 43.0.0-1/rust-vendor/syn/tests/test_visibility.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/test_visibility.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,185 @@
+#![allow(clippy::uninlined_format_args)]
+
+#[macro_use]
+mod macros;
+
+use proc_macro2::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream, TokenTree};
+use quote::quote;
+use syn::parse::{Parse, ParseStream};
+use syn::{DeriveInput, Result, Visibility};
+
+#[derive(Debug)]
+struct VisRest {
+    vis: Visibility,
+    rest: TokenStream,
+}
+
+impl Parse for VisRest {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Ok(VisRest {
+            vis: input.parse()?,
+            rest: input.parse()?,
+        })
+    }
+}
+
+macro_rules! assert_vis_parse {
+    ($input:expr, Ok($p:pat)) => {
+        assert_vis_parse!($input, Ok($p) + "");
+    };
+
+    ($input:expr, Ok($p:pat) + $rest:expr) => {
+        let expected = $rest.parse::<TokenStream>().unwrap();
+        let parse: VisRest = syn::parse_str($input).unwrap();
+
+        match parse.vis {
+            $p => {}
+            _ => panic!("expected {}, got {:?}", stringify!($p), parse.vis),
+        }
+
+        // NOTE: Round-trips through `to_string` to avoid potential whitespace
+        // diffs.
+        assert_eq!(parse.rest.to_string(), expected.to_string());
+    };
+
+    ($input:expr, Err) => {
+        syn::parse2::<VisRest>($input.parse().unwrap()).unwrap_err();
+    };
+}
+
+#[test]
+fn test_pub() {
+    assert_vis_parse!("pub", Ok(Visibility::Public(_)));
+}
+
+#[test]
+fn test_inherited() {
+    assert_vis_parse!("", Ok(Visibility::Inherited));
+}
+
+#[test]
+fn test_in() {
+    assert_vis_parse!("pub(in foo::bar)", Ok(Visibility::Restricted(_)));
+}
+
+#[test]
+fn test_pub_crate() {
+    assert_vis_parse!("pub(crate)", Ok(Visibility::Restricted(_)));
+}
+
+#[test]
+fn test_pub_self() {
+    assert_vis_parse!("pub(self)", Ok(Visibility::Restricted(_)));
+}
+
+#[test]
+fn test_pub_super() {
+    assert_vis_parse!("pub(super)", Ok(Visibility::Restricted(_)));
+}
+
+#[test]
+fn test_missing_in() {
+    assert_vis_parse!("pub(foo::bar)", Ok(Visibility::Public(_)) + "(foo::bar)");
+}
+
+#[test]
+fn test_missing_in_path() {
+    assert_vis_parse!("pub(in)", Err);
+}
+
+#[test]
+fn test_crate_path() {
+    assert_vis_parse!(
+        "pub(crate::A, crate::B)",
+        Ok(Visibility::Public(_)) + "(crate::A, crate::B)"
+    );
+}
+
+#[test]
+fn test_junk_after_in() {
+    assert_vis_parse!("pub(in some::path @@garbage)", Err);
+}
+
+#[test]
+fn test_inherited_vis_named_field() {
+    // mimics `struct S { $vis $field: () }` where $vis is empty
+    let tokens = TokenStream::from_iter([
+        TokenTree::Ident(Ident::new("struct", Span::call_site())),
+        TokenTree::Ident(Ident::new("S", Span::call_site())),
+        TokenTree::Group(Group::new(
+            Delimiter::Brace,
+            TokenStream::from_iter([
+                TokenTree::Group(Group::new(Delimiter::None, TokenStream::new())),
+                TokenTree::Group(Group::new(Delimiter::None, quote!(f))),
+                TokenTree::Punct(Punct::new(':', Spacing::Alone)),
+                TokenTree::Group(Group::new(Delimiter::Parenthesis, TokenStream::new())),
+            ]),
+        )),
+    ]);
+
+    snapshot!(tokens as DeriveInput, @r###"
+    DeriveInput {
+        vis: Visibility::Inherited,
+        ident: "S",
+        generics: Generics,
+        data: Data::Struct {
+            fields: Fields::Named {
+                named: [
+                    Field {
+                        vis: Visibility::Inherited,
+                        ident: Some("f"),
+                        colon_token: Some,
+                        ty: Type::Tuple,
+                    },
+                ],
+            },
+        },
+    }
+    "###);
+}
+
+#[test]
+fn test_inherited_vis_unnamed_field() {
+    // mimics `struct S($vis $ty);` where $vis is empty
+    let tokens = TokenStream::from_iter([
+        TokenTree::Ident(Ident::new("struct", Span::call_site())),
+        TokenTree::Ident(Ident::new("S", Span::call_site())),
+        TokenTree::Group(Group::new(
+            Delimiter::Parenthesis,
+            TokenStream::from_iter([
+                TokenTree::Group(Group::new(Delimiter::None, TokenStream::new())),
+                TokenTree::Group(Group::new(Delimiter::None, quote!(str))),
+            ]),
+        )),
+        TokenTree::Punct(Punct::new(';', Spacing::Alone)),
+    ]);
+
+    snapshot!(tokens as DeriveInput, @r###"
+    DeriveInput {
+        vis: Visibility::Inherited,
+        ident: "S",
+        generics: Generics,
+        data: Data::Struct {
+            fields: Fields::Unnamed {
+                unnamed: [
+                    Field {
+                        vis: Visibility::Inherited,
+                        ty: Type::Group {
+                            elem: Type::Path {
+                                path: Path {
+                                    segments: [
+                                        PathSegment {
+                                            ident: "str",
+                                        },
+                                    ],
+                                },
+                            },
+                        },
+                    },
+                ],
+            },
+            semi_token: Some,
+        },
+    }
+    "###);
+}
diff -pruN 43.0.0-1/rust-vendor/syn/tests/zzz_stable.rs 43.0.0-1ubuntu1/rust-vendor/syn/tests/zzz_stable.rs
--- 43.0.0-1/rust-vendor/syn/tests/zzz_stable.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/syn/tests/zzz_stable.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,33 @@
+#![cfg(syn_disable_nightly_tests)]
+
+use std::io::{self, Write};
+use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor};
+
+const MSG: &str = "\
+‖
+‖   WARNING:
+‖   This is not a nightly compiler so not all tests were able to
+‖   run. Syn includes tests that compare Syn's parser against the
+‖   compiler's parser, which requires access to unstable librustc
+‖   data structures and a nightly compiler.
+‖
+";
+
+#[test]
+fn notice() -> io::Result<()> {
+    let header = "WARNING";
+    let index_of_header = MSG.find(header).unwrap();
+    let before = &MSG[..index_of_header];
+    let after = &MSG[index_of_header + header.len()..];
+
+    let mut stderr = StandardStream::stderr(ColorChoice::Auto);
+    stderr.set_color(ColorSpec::new().set_fg(Some(Color::Yellow)))?;
+    write!(&mut stderr, "{}", before)?;
+    stderr.set_color(ColorSpec::new().set_bold(true).set_fg(Some(Color::Yellow)))?;
+    write!(&mut stderr, "{}", header)?;
+    stderr.set_color(ColorSpec::new().set_fg(Some(Color::Yellow)))?;
+    write!(&mut stderr, "{}", after)?;
+    stderr.reset()?;
+
+    Ok(())
+}
diff -pruN 43.0.0-1/rust-vendor/target-lexicon/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/target-lexicon/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/target-lexicon/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/target-lexicon/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"Cargo.lock":"71a6718dded4ba88e46e4b4d1b8d8f34bd0d75aad69a860d35e86d428bce982d","Cargo.toml":"a0344b690dfd9eee7993bd50c0b269fdd29be69f35ec5f7d2c76e86a14efaa4b","LICENSE":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","README.md":"c3467056d91be3f59562158ee9604c729b5b5f473efbefb036032803eb76809e","build.rs":"678ba872ef2254e8901d6a00536f64d74d375d919f845113bd3ded709b6edb4a","examples/host.rs":"503bafddfb372123fe4dc0e7b8037808beb5bfe6df60c00d3315922bd3792c6c","examples/misc.rs":"49a579845450b7b020ed5c97dca142fc548725893cbc82f6f750ee0caab2beca","scripts/rust-targets.sh":"89564342916321c5bc35e772d374a7f0af22cc9ae6dcc0027eca48d2269f18cb","src/data_model.rs":"38c0c184ee65b882872298127d9c6878292bd12c139792e82328a5facc2428ae","src/host.rs":"d742406eba58f35c4c9f1041e506bb63d6c0eb752c2e88f4a6646538ef1aba38","src/lib.rs":"3f6bd49e5d1e02581662dfe7edf5c80bf884c5f4c0bc32bee90e31305b379249","src/parse_error.rs":"b3735eabc0fd0a9dfdd6375662f20ec96a79852a00a05a98fb2e421545285e53","src/targets.rs":"6715b049a2cf6e0be9f97375c380823dce0ab2c370a82a2695bbd04c7b8c73c3","src/triple.rs":"58fe9d38791bf9dc897b49eec3438960a04b065fccac02ff42e8e01b0e74e8dd"},"package":"4873307b7c257eddcb50c9bedf158eb669578359fb28428bef438fec8e6ba7c2"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/target-lexicon/Cargo.lock 43.0.0-1ubuntu1/rust-vendor/target-lexicon/Cargo.lock
--- 43.0.0-1/rust-vendor/target-lexicon/Cargo.lock	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/target-lexicon/Cargo.lock	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,89 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "itoa"
+version = "1.0.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.86"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.36"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "ryu"
+version = "1.0.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
+
+[[package]]
+name = "serde"
+version = "1.0.204"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12"
+dependencies = [
+ "serde_derive",
+]
+
+[[package]]
+name = "serde_derive"
+version = "1.0.204"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "serde_json"
+version = "1.0.120"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5"
+dependencies = [
+ "itoa",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "syn"
+version = "2.0.69"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "201fcda3845c23e8212cd466bfebf0bd20694490fc0356ae8e428e0824a915a6"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "target-lexicon"
+version = "0.12.15"
+dependencies = [
+ "serde",
+ "serde_json",
+]
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
diff -pruN 43.0.0-1/rust-vendor/target-lexicon/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/target-lexicon/Cargo.toml
--- 43.0.0-1/rust-vendor/target-lexicon/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/target-lexicon/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,48 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2018"
+name = "target-lexicon"
+version = "0.12.15"
+authors = ["Dan Gohman <sunfish@mozilla.com>"]
+description = "Targeting utilities for compilers and related tools"
+documentation = "https://docs.rs/target-lexicon/"
+readme = "README.md"
+keywords = [
+    "target",
+    "host",
+    "triple",
+    "compiler",
+    "jit",
+]
+categories = ["no-std"]
+license = "Apache-2.0 WITH LLVM-exception"
+repository = "https://github.com/bytecodealliance/target-lexicon"
+
+[dependencies.serde]
+version = "1.0"
+optional = true
+
+[dev-dependencies.serde_json]
+version = "1.0"
+
+[features]
+arch_zkasm = []
+default = []
+serde_support = [
+    "serde",
+    "std",
+]
+std = []
+
+[badges.maintenance]
+status = "passively-maintained"
diff -pruN 43.0.0-1/rust-vendor/target-lexicon/LICENSE 43.0.0-1ubuntu1/rust-vendor/target-lexicon/LICENSE
--- 43.0.0-1/rust-vendor/target-lexicon/LICENSE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/target-lexicon/LICENSE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,220 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+--- LLVM Exceptions to the Apache 2.0 License ----
+
+As an exception, if, as a result of your compiling your source code, portions
+of this Software are embedded into an Object form of such source code, you
+may redistribute such embedded portions in such Object form without complying
+with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
+
+In addition, if you combine or link compiled forms of this Software with
+software that is licensed under the GPLv2 ("Combined Software") and if a
+court of competent jurisdiction determines that the patent provision (Section
+3), the indemnity provision (Section 9) or other Section of the License
+conflicts with the conditions of the GPLv2, you may retroactively and
+prospectively choose to deem waived or otherwise exclude such Section(s) of
+the License, but only in their entirety and only with respect to the Combined
+Software.
+
diff -pruN 43.0.0-1/rust-vendor/target-lexicon/README.md 43.0.0-1ubuntu1/rust-vendor/target-lexicon/README.md
--- 43.0.0-1/rust-vendor/target-lexicon/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/target-lexicon/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,20 @@
+This is a library for managing targets for compilers and related tools.
+
+Currently, the main feature is support for decoding "triples", which
+are strings that identify a particular target configuration. They're named
+"triples" because historically they contained three fields, though over time
+they've added additional fields. This library provides a `Triple` struct
+containing enums for each of fields of a triple. `Triple` implements
+`FromStr` and `fmt::Display` so it can be converted to and from the
+conventional string representation of a triple.
+
+`Triple` also has functions for querying a triple's endianness,
+pointer bit width, and binary format.
+
+And, `Triple` and the enum types have `host()` constructors, for targeting
+the host.
+
+It supports all triples currently used by rustc and rustup.
+
+It does not support reading JSON target files itself. To use it with a JSON
+target file, construct a `Triple` using the value of the "llvm-target" field.
diff -pruN 43.0.0-1/rust-vendor/target-lexicon/build.rs 43.0.0-1ubuntu1/rust-vendor/target-lexicon/build.rs
--- 43.0.0-1/rust-vendor/target-lexicon/build.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/target-lexicon/build.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,179 @@
+//! build.rs file to obtain the host information.
+
+// Allow dead code in triple.rs and targets.rs for our purposes here.
+#![allow(dead_code)]
+
+use std::env;
+use std::fs::File;
+use std::io::{self, Write};
+use std::path::PathBuf;
+use std::process::Command;
+use std::str::FromStr;
+
+#[cfg(not(feature = "std"))]
+extern crate alloc;
+#[cfg(feature = "std")]
+extern crate std as alloc;
+
+// Include triple.rs and targets.rs so we can parse the TARGET environment variable.
+// targets.rs depends on data_model
+mod data_model {
+    include!("src/data_model.rs");
+}
+mod triple {
+    include!("src/triple.rs");
+}
+mod targets {
+    include!("src/targets.rs");
+}
+
+// Stub out `ParseError` to minimally support triple.rs and targets.rs.
+mod parse_error {
+    #[derive(Debug)]
+    pub enum ParseError {
+        UnrecognizedArchitecture(String),
+        UnrecognizedVendor(String),
+        UnrecognizedOperatingSystem(String),
+        UnrecognizedEnvironment(String),
+        UnrecognizedBinaryFormat(String),
+        UnrecognizedField(String),
+    }
+}
+
+use self::targets::Vendor;
+use self::triple::Triple;
+
+fn main() {
+    let out_dir = PathBuf::from(
+        env::var_os("OUT_DIR").expect("The OUT_DIR environment variable must be set"),
+    );
+    let target = env::var("TARGET").expect("The TARGET environment variable must be set");
+    let triple =
+        Triple::from_str(&target).unwrap_or_else(|_| panic!("Invalid target name: '{}'", target));
+    let out = File::create(out_dir.join("host.rs")).expect("error creating host.rs");
+    write_host_rs(out, triple).expect("error writing host.rs");
+    if using_1_40() {
+        println!("cargo:rustc-cfg=feature=\"rust_1_40\"");
+    }
+}
+
+fn using_1_40() -> bool {
+    match (|| {
+        let rustc = env::var_os("RUSTC").unwrap();
+        let output = Command::new(rustc).arg("--version").output().ok()?;
+        let stdout = if output.status.success() {
+            output.stdout
+        } else {
+            return None;
+        };
+        std::str::from_utf8(&stdout)
+            .ok()?
+            .split(' ')
+            .nth(1)?
+            .split('.')
+            .nth(1)?
+            .parse::<i32>()
+            .ok()
+    })() {
+        Some(version) => version >= 40,
+        None => true, // assume we're using an up-to-date compiler
+    }
+}
+
+fn write_host_rs(mut out: File, triple: Triple) -> io::Result<()> {
+    // The generated Debug implementation for the inner architecture variants
+    // doesn't print the enum name qualifier, so import them here. There
+    // shouldn't be any conflicts because these enums all share a namespace
+    // in the triple string format.
+    writeln!(
+        out,
+        r#"
+#[allow(unused_imports)]
+use crate::Aarch64Architecture::*;
+#[allow(unused_imports)]
+use crate::ArmArchitecture::*;
+#[allow(unused_imports)]
+use crate::CustomVendor;
+#[allow(unused_imports)]
+use crate::Mips32Architecture::*;
+#[allow(unused_imports)]
+use crate::Mips64Architecture::*;
+#[allow(unused_imports)]
+use crate::Riscv32Architecture::*;
+#[allow(unused_imports)]
+use crate::Riscv64Architecture::*;
+#[allow(unused_imports)]
+use crate::X86_32Architecture::*;
+
+/// The `Triple` of the current host.
+pub const HOST: Triple = Triple {{
+    architecture: Architecture::{architecture:?},
+    vendor: Vendor::{vendor},
+    operating_system: OperatingSystem::{operating_system:?},
+    environment: Environment::{environment:?},
+    binary_format: BinaryFormat::{binary_format:?},
+}};
+
+impl Architecture {{
+    /// Return the architecture for the current host.
+    pub const fn host() -> Self {{
+        Architecture::{architecture:?}
+    }}
+}}
+
+impl Vendor {{
+    /// Return the vendor for the current host.
+    pub const fn host() -> Self {{
+        Vendor::{vendor}
+    }}
+}}
+
+impl OperatingSystem {{
+    /// Return the operating system for the current host.
+    pub const fn host() -> Self {{
+        OperatingSystem::{operating_system:?}
+    }}
+}}
+
+impl Environment {{
+    /// Return the environment for the current host.
+    pub const fn host() -> Self {{
+        Environment::{environment:?}
+    }}
+}}
+
+impl BinaryFormat {{
+    /// Return the binary format for the current host.
+    pub const fn host() -> Self {{
+        BinaryFormat::{binary_format:?}
+    }}
+}}
+
+impl Triple {{
+    /// Return the triple for the current host.
+    pub const fn host() -> Self {{
+        Self {{
+            architecture: Architecture::{architecture:?},
+            vendor: Vendor::{vendor},
+            operating_system: OperatingSystem::{operating_system:?},
+            environment: Environment::{environment:?},
+            binary_format: BinaryFormat::{binary_format:?},
+        }}
+    }}
+}}"#,
+        architecture = triple.architecture,
+        vendor = vendor_display(&triple.vendor),
+        operating_system = triple.operating_system,
+        environment = triple.environment,
+        binary_format = triple.binary_format,
+    )?;
+
+    Ok(())
+}
+
+fn vendor_display(vendor: &Vendor) -> String {
+    match vendor {
+        Vendor::Custom(custom) => format!("Custom(CustomVendor::Static({:?}))", custom.as_str()),
+        known => format!("{:?}", known),
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/target-lexicon/examples/host.rs 43.0.0-1ubuntu1/rust-vendor/target-lexicon/examples/host.rs
--- 43.0.0-1/rust-vendor/target-lexicon/examples/host.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/target-lexicon/examples/host.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,12 @@
+extern crate target_lexicon;
+
+use target_lexicon::HOST;
+
+fn main() {
+    println!(
+        "{}",
+        HOST.pointer_width()
+            .expect("architecture should be known")
+            .bytes()
+    );
+}
diff -pruN 43.0.0-1/rust-vendor/target-lexicon/examples/misc.rs 43.0.0-1ubuntu1/rust-vendor/target-lexicon/examples/misc.rs
--- 43.0.0-1/rust-vendor/target-lexicon/examples/misc.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/target-lexicon/examples/misc.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,14 @@
+extern crate target_lexicon;
+
+use core::str::FromStr;
+use target_lexicon::{Triple, HOST};
+
+fn main() {
+    println!("The host triple is {}.", HOST);
+
+    let e = Triple::from_str("riscv32-unknown-unknown")
+        .expect("expected to recognize the RISC-V target")
+        .endianness()
+        .expect("expected to know the endianness of RISC-V");
+    println!("The endianness of RISC-V is {:?}.", e);
+}
diff -pruN 43.0.0-1/rust-vendor/target-lexicon/scripts/rust-targets.sh 43.0.0-1ubuntu1/rust-vendor/target-lexicon/scripts/rust-targets.sh
--- 43.0.0-1/rust-vendor/target-lexicon/scripts/rust-targets.sh	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/target-lexicon/scripts/rust-targets.sh	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+#!/bin/bash
+set -euo pipefail
+
+rustup target list | sed 's/ (.*//' > list.txt
+rustc +nightly --print target-list >> list.txt
+cat list.txt | sort | uniq |sed 's/\(.*\)/            "\1",/' > sorted.txt
+rm list.txt
diff -pruN 43.0.0-1/rust-vendor/target-lexicon/src/data_model.rs 43.0.0-1ubuntu1/rust-vendor/target-lexicon/src/data_model.rs
--- 43.0.0-1/rust-vendor/target-lexicon/src/data_model.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/target-lexicon/src/data_model.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,119 @@
+/// The size of a type.
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+#[allow(missing_docs)]
+pub enum Size {
+    U8,
+    U16,
+    U32,
+    U64,
+}
+
+impl Size {
+    /// Return the number of bits this `Size` represents.
+    pub fn bits(self) -> u8 {
+        use Size::*;
+
+        match self {
+            U8 => 8,
+            U16 => 16,
+            U32 => 32,
+            U64 => 64,
+        }
+    }
+
+    /// Return the number of bytes in a size.
+    ///
+    /// A byte is assumed to be 8 bits.
+    pub fn bytes(self) -> u8 {
+        use Size::*;
+
+        match self {
+            U8 => 1,
+            U16 => 2,
+            U32 => 4,
+            U64 => 8,
+        }
+    }
+}
+
+/// The C data model used on a target.
+///
+/// See also https://en.cppreference.com/w/c/language/arithmetic_types
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+#[cfg_attr(feature = "rust_1_40", non_exhaustive)]
+pub enum CDataModel {
+    /// The data model used most commonly on Win16. `long` and `pointer` are 32 bits.
+    LP32,
+    /// The data model used most commonly on Win32 and 32-bit Unix systems.
+    ///
+    /// `int`, `long`, and `pointer` are all 32 bits.
+    ILP32,
+    /// The data model used most commonly on Win64
+    ///
+    /// `long long`, and `pointer` are 64 bits.
+    LLP64,
+    /// The data model used most commonly on 64-bit Unix systems
+    ///
+    /// `long`, and `pointer` are 64 bits.
+    LP64,
+    /// A rare data model used on early 64-bit Unix systems
+    ///
+    /// `int`, `long`, and `pointer` are all 64 bits.
+    ILP64,
+}
+
+impl CDataModel {
+    /// The width of a pointer (in the default address space).
+    pub fn pointer_width(self) -> Size {
+        use CDataModel::*;
+
+        match self {
+            LP32 | ILP32 => Size::U32,
+            LLP64 | LP64 | ILP64 => Size::U64,
+        }
+    }
+    /// The size of a C `short`. This is required to be at least 16 bits.
+    pub fn short_size(self) -> Size {
+        use CDataModel::*;
+
+        match self {
+            LP32 | ILP32 | LLP64 | LP64 | ILP64 => Size::U16,
+        }
+    }
+    /// The size of a C `int`. This is required to be at least 16 bits.
+    pub fn int_size(self) -> Size {
+        use CDataModel::*;
+
+        match self {
+            LP32 => Size::U16,
+            ILP32 | LLP64 | LP64 | ILP64 => Size::U32,
+        }
+    }
+    /// The size of a C `long`. This is required to be at least 32 bits.
+    pub fn long_size(self) -> Size {
+        use CDataModel::*;
+
+        match self {
+            LP32 | ILP32 | LLP64 | ILP64 => Size::U32,
+            LP64 => Size::U64,
+        }
+    }
+    /// The size of a C `long long`. This is required (in C99+) to be at least 64 bits.
+    pub fn long_long_size(self) -> Size {
+        use CDataModel::*;
+
+        match self {
+            LP32 | ILP32 | LLP64 | ILP64 | LP64 => Size::U64,
+        }
+    }
+    /// The size of a C `float`.
+    pub fn float_size(self) -> Size {
+        // TODO: this is probably wrong on at least one architecture
+        Size::U32
+    }
+    /// The size of a C `double`.
+    pub fn double_size(self) -> Size {
+        // TODO: this is probably wrong on at least one architecture
+        Size::U64
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/target-lexicon/src/host.rs 43.0.0-1ubuntu1/rust-vendor/target-lexicon/src/host.rs
--- 43.0.0-1/rust-vendor/target-lexicon/src/host.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/target-lexicon/src/host.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,63 @@
+use crate::{Architecture, BinaryFormat, Environment, OperatingSystem, Triple, Vendor};
+
+// Include the implementations of the `HOST` object containing information
+// about the current host.
+include!(concat!(env!("OUT_DIR"), "/host.rs"));
+
+#[cfg(test)]
+mod tests {
+    #[cfg(target_os = "aix")]
+    #[test]
+    fn test_aix() {
+        use super::*;
+        assert_eq!(OperatingSystem::host(), OperatingSystem::Aix);
+    }
+
+    #[cfg(target_os = "linux")]
+    #[test]
+    fn test_linux() {
+        use super::*;
+        assert_eq!(OperatingSystem::host(), OperatingSystem::Linux);
+    }
+
+    #[cfg(target_os = "macos")]
+    #[test]
+    fn test_macos() {
+        use super::*;
+        assert_eq!(OperatingSystem::host(), OperatingSystem::Darwin);
+    }
+
+    #[cfg(windows)]
+    #[test]
+    fn test_windows() {
+        use super::*;
+        assert_eq!(OperatingSystem::host(), OperatingSystem::Windows);
+    }
+
+    #[cfg(target_pointer_width = "16")]
+    #[test]
+    fn test_ptr16() {
+        use super::*;
+        assert_eq!(Architecture::host().pointer_width().unwrap().bits(), 16);
+    }
+
+    #[cfg(target_pointer_width = "32")]
+    #[test]
+    fn test_ptr32() {
+        use super::*;
+        assert_eq!(Architecture::host().pointer_width().unwrap().bits(), 32);
+    }
+
+    #[cfg(target_pointer_width = "64")]
+    #[test]
+    fn test_ptr64() {
+        use super::*;
+        assert_eq!(Architecture::host().pointer_width().unwrap().bits(), 64);
+    }
+
+    #[test]
+    fn host_object() {
+        use super::*;
+        assert_eq!(HOST, Triple::host());
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/target-lexicon/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/target-lexicon/src/lib.rs
--- 43.0.0-1/rust-vendor/target-lexicon/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/target-lexicon/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,109 @@
+//! Target triple support.
+
+#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)]
+#![warn(unused_import_braces)]
+#![cfg_attr(
+    feature = "cargo-clippy",
+    warn(
+        clippy::float_arithmetic,
+        clippy::mut_mut,
+        clippy::nonminimal_bool,
+        clippy::option_map_unwrap_or,
+        clippy::option_map_unwrap_or_else,
+        clippy::print_stdout,
+        clippy::unicode_not_nfc,
+        clippy::use_self,
+    )
+)]
+#![cfg_attr(not(feature = "std"), no_std)]
+
+#[cfg(not(feature = "std"))]
+extern crate alloc;
+#[cfg(feature = "std")]
+extern crate std as alloc;
+
+mod data_model;
+mod host;
+mod parse_error;
+mod targets;
+#[macro_use]
+mod triple;
+
+pub use self::data_model::{CDataModel, Size};
+pub use self::host::HOST;
+pub use self::parse_error::ParseError;
+pub use self::targets::{
+    Aarch64Architecture, Architecture, ArmArchitecture, BinaryFormat, CustomVendor, Environment,
+    Mips32Architecture, Mips64Architecture, OperatingSystem, Riscv32Architecture,
+    Riscv64Architecture, Vendor, X86_32Architecture,
+};
+pub use self::triple::{CallingConvention, Endianness, PointerWidth, Triple};
+
+/// A simple wrapper around `Triple` that provides an implementation of
+/// `Default` which defaults to `Triple::host()`.
+#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+pub struct DefaultToHost(pub Triple);
+
+impl Default for DefaultToHost {
+    fn default() -> Self {
+        Self(Triple::host())
+    }
+}
+
+/// A simple wrapper around `Triple` that provides an implementation of
+/// `Default` which defaults to `Triple::unknown()`.
+#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+pub struct DefaultToUnknown(pub Triple);
+
+impl Default for DefaultToUnknown {
+    fn default() -> Self {
+        Self(Triple::unknown())
+    }
+}
+
+// For some reason, the below `serde` impls don't work when they're in the
+// `triple` module.
+
+#[cfg(feature = "serde_support")]
+impl serde::Serialize for Triple {
+    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
+        serializer.serialize_str(&self.to_string())
+    }
+}
+
+#[cfg(feature = "serde_support")]
+impl<'de> serde::de::Deserialize<'de> for Triple {
+    fn deserialize<D: serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
+        let s = String::deserialize(deserializer)?;
+        s.parse().map_err(serde::de::Error::custom)
+    }
+}
+
+#[cfg(feature = "serde_support")]
+#[test]
+fn test_serialize() {
+    let triples: Vec<Triple> = vec![
+        "x86_64-unknown-linux-gnu".parse().unwrap(),
+        "i686-pc-windows-gnu".parse().unwrap(),
+    ];
+
+    let json = serde_json::to_string(&triples).unwrap();
+    assert_eq!(
+        json,
+        r#"["x86_64-unknown-linux-gnu","i686-pc-windows-gnu"]"#
+    );
+}
+
+#[cfg(feature = "serde_support")]
+#[test]
+fn test_deserialize() {
+    let triples: Vec<Triple> = vec![
+        "x86_64-unknown-linux-gnu".parse().unwrap(),
+        "i686-pc-windows-gnu".parse().unwrap(),
+    ];
+
+    let vals: Vec<Triple> =
+        serde_json::from_str(r#"["x86_64-unknown-linux-gnu","i686-pc-windows-gnu"]"#).unwrap();
+
+    assert_eq!(vals, triples);
+}
diff -pruN 43.0.0-1/rust-vendor/target-lexicon/src/parse_error.rs 43.0.0-1ubuntu1/rust-vendor/target-lexicon/src/parse_error.rs
--- 43.0.0-1/rust-vendor/target-lexicon/src/parse_error.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/target-lexicon/src/parse_error.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,34 @@
+use alloc::string::String;
+
+use core::fmt;
+
+/// An error returned from parsing a triple.
+#[derive(Clone, Debug, PartialEq, Eq)]
+#[allow(missing_docs)]
+pub enum ParseError {
+    UnrecognizedArchitecture(String),
+    UnrecognizedVendor(String),
+    UnrecognizedOperatingSystem(String),
+    UnrecognizedEnvironment(String),
+    UnrecognizedBinaryFormat(String),
+    UnrecognizedField(String),
+}
+
+impl fmt::Display for ParseError {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        use ParseError::*;
+        match self {
+            UnrecognizedArchitecture(msg) => write!(fmt, "Unrecognized architecture: {}", msg),
+            UnrecognizedVendor(msg) => write!(fmt, "Unrecognized vendor: {}", msg),
+            UnrecognizedOperatingSystem(msg) => {
+                write!(fmt, "Unrecognized operating system: {}", msg)
+            }
+            UnrecognizedEnvironment(msg) => write!(fmt, "Unrecognized environment: {}", msg),
+            UnrecognizedBinaryFormat(msg) => write!(fmt, "Unrecognized binary format: {}", msg),
+            UnrecognizedField(msg) => write!(fmt, "Unrecognized field: {}", msg),
+        }
+    }
+}
+
+#[cfg(feature = "std")]
+impl std::error::Error for ParseError {}
diff -pruN 43.0.0-1/rust-vendor/target-lexicon/src/targets.rs 43.0.0-1ubuntu1/rust-vendor/target-lexicon/src/targets.rs
--- 43.0.0-1/rust-vendor/target-lexicon/src/targets.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/target-lexicon/src/targets.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,1946 @@
+// This file defines all the identifier enums and target-aware logic.
+
+use crate::triple::{Endianness, PointerWidth, Triple};
+use alloc::borrow::Cow;
+use alloc::boxed::Box;
+use alloc::format;
+use alloc::string::String;
+use core::fmt;
+use core::hash::{Hash, Hasher};
+use core::str::FromStr;
+
+/// The "architecture" field, which in some cases also specifies a specific
+/// subarchitecture.
+#[cfg_attr(feature = "rust_1_40", non_exhaustive)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+#[allow(missing_docs)]
+pub enum Architecture {
+    Unknown,
+    Arm(ArmArchitecture),
+    AmdGcn,
+    Aarch64(Aarch64Architecture),
+    Asmjs,
+    Avr,
+    Bpfeb,
+    Bpfel,
+    Hexagon,
+    X86_32(X86_32Architecture),
+    M68k,
+    LoongArch64,
+    Mips32(Mips32Architecture),
+    Mips64(Mips64Architecture),
+    Msp430,
+    Nvptx64,
+    Powerpc,
+    Powerpc64,
+    Powerpc64le,
+    Riscv32(Riscv32Architecture),
+    Riscv64(Riscv64Architecture),
+    S390x,
+    Sparc,
+    Sparc64,
+    Sparcv9,
+    Wasm32,
+    Wasm64,
+    X86_64,
+    /// x86_64 target that only supports Haswell-compatible Intel chips.
+    X86_64h,
+    XTensa,
+    Clever(CleverArchitecture),
+    /// A software machine that produces zero-knowledge proofs of the execution.
+    ///
+    /// See https://wiki.polygon.technology/docs/category/zk-assembly/
+    #[cfg(feature = "arch_zkasm")]
+    ZkAsm,
+}
+
+#[cfg_attr(feature = "rust_1_40", non_exhaustive)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+#[allow(missing_docs)]
+pub enum ArmArchitecture {
+    Arm, // Generic arm
+    Armeb,
+    Armv4,
+    Armv4t,
+    Armv5t,
+    Armv5te,
+    Armv5tej,
+    Armv6,
+    Armv6j,
+    Armv6k,
+    Armv6z,
+    Armv6kz,
+    Armv6t2,
+    Armv6m,
+    Armv7,
+    Armv7a,
+    Armv7k,
+    Armv7ve,
+    Armv7m,
+    Armv7r,
+    Armv7s,
+    Armv8,
+    Armv8a,
+    Armv8_1a,
+    Armv8_2a,
+    Armv8_3a,
+    Armv8_4a,
+    Armv8_5a,
+    Armv8mBase,
+    Armv8mMain,
+    Armv8r,
+
+    Armebv7r,
+
+    Thumbeb,
+    Thumbv4t,
+    Thumbv5te,
+    Thumbv6m,
+    Thumbv7a,
+    Thumbv7em,
+    Thumbv7m,
+    Thumbv7neon,
+    Thumbv8mBase,
+    Thumbv8mMain,
+}
+
+#[cfg_attr(feature = "rust_1_40", non_exhaustive)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+#[allow(missing_docs)]
+pub enum Aarch64Architecture {
+    Aarch64,
+    Aarch64be,
+}
+
+// #[cfg_attr(feature = "rust_1_40", non_exhaustive)]
+// #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+// #[allow(missing_docs)]
+// pub enum ArmFpu {
+//     Vfp,
+//     Vfpv2,
+//     Vfpv3,
+//     Vfpv3Fp16,
+//     Vfpv3Xd,
+//     Vfpv3XdFp16,
+//     Neon,
+//     NeonVfpv3,
+//     NeonVfpv4,
+//     Vfpv4,
+//     Vfpv4D16,
+//     Fpv4SpD16,
+//     Fpv5SpD16,
+//     Fpv5D16,
+//     FpArmv8,
+//     NeonFpArmv8,
+//     CryptoNeonFpArmv8,
+// }
+
+impl ArmArchitecture {
+    /// Test if this architecture uses the Thumb instruction set.
+    #[rustfmt::skip]
+    pub fn is_thumb(self) -> bool {
+        use ArmArchitecture::*;
+
+        match self {
+            Arm
+            | Armeb
+            | Armv4
+            | Armv4t
+            | Armv5t
+            | Armv5te
+            | Armv5tej
+            | Armv6
+            | Armv6j
+            | Armv6k
+            | Armv6z
+            | Armv6kz
+            | Armv6t2
+            | Armv6m
+            | Armv7
+            | Armv7a
+            | Armv7k
+            | Armv7ve
+            | Armv7m
+            | Armv7r
+            | Armv7s
+            | Armv8
+            | Armv8a
+            | Armv8_1a
+            | Armv8_2a
+            | Armv8_3a
+            | Armv8_4a
+            | Armv8_5a
+            | Armv8mBase
+            | Armv8mMain
+            | Armv8r
+            | Armebv7r => false,
+            Thumbeb
+            | Thumbv4t
+            | Thumbv5te
+            | Thumbv6m
+            | Thumbv7a
+            | Thumbv7em
+            | Thumbv7m
+            | Thumbv7neon
+            | Thumbv8mBase
+            | Thumbv8mMain => true,
+        }
+    }
+
+    // pub fn has_fpu(self) -> Result<&'static [ArmFpu], ()> {
+
+    // }
+
+    /// Return the pointer bit width of this target's architecture.
+    #[rustfmt::skip]
+    pub fn pointer_width(self) -> PointerWidth {
+        use ArmArchitecture::*;
+
+        match self {
+            Arm
+            | Armeb
+            | Armv4
+            | Armv4t
+            | Armv5t
+            | Armv5te
+            | Armv5tej
+            | Armv6
+            | Armv6j
+            | Armv6k
+            | Armv6z
+            | Armv6kz
+            | Armv6t2
+            | Armv6m
+            | Armv7
+            | Armv7a
+            | Armv7k
+            | Armv7ve
+            | Armv7m
+            | Armv7r
+            | Armv7s
+            | Armv8
+            | Armv8a
+            | Armv8_1a
+            | Armv8_2a
+            | Armv8_3a
+            | Armv8_4a
+            | Armv8_5a
+            | Armv8mBase
+            | Armv8mMain
+            | Armv8r
+            | Armebv7r
+            | Thumbeb
+            | Thumbv4t
+            | Thumbv5te
+            | Thumbv6m
+            | Thumbv7a
+            | Thumbv7em
+            | Thumbv7m
+            | Thumbv7neon
+            | Thumbv8mBase
+            | Thumbv8mMain => PointerWidth::U32,
+        }
+    }
+
+    /// Return the endianness of this architecture.
+    #[rustfmt::skip]
+    pub fn endianness(self) -> Endianness {
+        use ArmArchitecture::*;
+
+        match self {
+            Arm
+            | Armv4
+            | Armv4t
+            | Armv5t
+            | Armv5te
+            | Armv5tej
+            | Armv6
+            | Armv6j
+            | Armv6k
+            | Armv6z
+            | Armv6kz
+            | Armv6t2
+            | Armv6m
+            | Armv7
+            | Armv7a
+            | Armv7k
+            | Armv7ve
+            | Armv7m
+            | Armv7r
+            | Armv7s
+            | Armv8
+            | Armv8a
+            | Armv8_1a
+            | Armv8_2a
+            | Armv8_3a
+            | Armv8_4a
+            | Armv8_5a
+            | Armv8mBase
+            | Armv8mMain
+            | Armv8r
+            | Thumbv4t
+            | Thumbv5te
+            | Thumbv6m
+            | Thumbv7a
+            | Thumbv7em
+            | Thumbv7m
+            | Thumbv7neon
+            | Thumbv8mBase
+            | Thumbv8mMain => Endianness::Little,
+            Armeb | Armebv7r | Thumbeb => Endianness::Big,
+        }
+    }
+
+    /// Convert into a string
+    pub fn into_str(self) -> Cow<'static, str> {
+        use ArmArchitecture::*;
+
+        match self {
+            Arm => Cow::Borrowed("arm"),
+            Armeb => Cow::Borrowed("armeb"),
+            Armv4 => Cow::Borrowed("armv4"),
+            Armv4t => Cow::Borrowed("armv4t"),
+            Armv5t => Cow::Borrowed("armv5t"),
+            Armv5te => Cow::Borrowed("armv5te"),
+            Armv5tej => Cow::Borrowed("armv5tej"),
+            Armv6 => Cow::Borrowed("armv6"),
+            Armv6j => Cow::Borrowed("armv6j"),
+            Armv6k => Cow::Borrowed("armv6k"),
+            Armv6z => Cow::Borrowed("armv6z"),
+            Armv6kz => Cow::Borrowed("armv6kz"),
+            Armv6t2 => Cow::Borrowed("armv6t2"),
+            Armv6m => Cow::Borrowed("armv6m"),
+            Armv7 => Cow::Borrowed("armv7"),
+            Armv7a => Cow::Borrowed("armv7a"),
+            Armv7k => Cow::Borrowed("armv7k"),
+            Armv7ve => Cow::Borrowed("armv7ve"),
+            Armv7m => Cow::Borrowed("armv7m"),
+            Armv7r => Cow::Borrowed("armv7r"),
+            Armv7s => Cow::Borrowed("armv7s"),
+            Armv8 => Cow::Borrowed("armv8"),
+            Armv8a => Cow::Borrowed("armv8a"),
+            Armv8_1a => Cow::Borrowed("armv8.1a"),
+            Armv8_2a => Cow::Borrowed("armv8.2a"),
+            Armv8_3a => Cow::Borrowed("armv8.3a"),
+            Armv8_4a => Cow::Borrowed("armv8.4a"),
+            Armv8_5a => Cow::Borrowed("armv8.5a"),
+            Armv8mBase => Cow::Borrowed("armv8m.base"),
+            Armv8mMain => Cow::Borrowed("armv8m.main"),
+            Armv8r => Cow::Borrowed("armv8r"),
+            Thumbeb => Cow::Borrowed("thumbeb"),
+            Thumbv4t => Cow::Borrowed("thumbv4t"),
+            Thumbv5te => Cow::Borrowed("thumbv5te"),
+            Thumbv6m => Cow::Borrowed("thumbv6m"),
+            Thumbv7a => Cow::Borrowed("thumbv7a"),
+            Thumbv7em => Cow::Borrowed("thumbv7em"),
+            Thumbv7m => Cow::Borrowed("thumbv7m"),
+            Thumbv7neon => Cow::Borrowed("thumbv7neon"),
+            Thumbv8mBase => Cow::Borrowed("thumbv8m.base"),
+            Thumbv8mMain => Cow::Borrowed("thumbv8m.main"),
+            Armebv7r => Cow::Borrowed("armebv7r"),
+        }
+    }
+}
+
+impl Aarch64Architecture {
+    /// Test if this architecture uses the Thumb instruction set.
+    pub fn is_thumb(self) -> bool {
+        match self {
+            Aarch64Architecture::Aarch64 | Aarch64Architecture::Aarch64be => false,
+        }
+    }
+
+    // pub fn has_fpu(self) -> Result<&'static [ArmFpu], ()> {
+
+    // }
+
+    /// Return the pointer bit width of this target's architecture.
+    ///
+    /// This function is only aware of the CPU architecture so it is not aware
+    /// of ilp32 ABIs.
+    pub fn pointer_width(self) -> PointerWidth {
+        match self {
+            Aarch64Architecture::Aarch64 | Aarch64Architecture::Aarch64be => PointerWidth::U64,
+        }
+    }
+
+    /// Return the endianness of this architecture.
+    pub fn endianness(self) -> Endianness {
+        match self {
+            Aarch64Architecture::Aarch64 => Endianness::Little,
+            Aarch64Architecture::Aarch64be => Endianness::Big,
+        }
+    }
+
+    /// Convert into a string
+    pub fn into_str(self) -> Cow<'static, str> {
+        use Aarch64Architecture::*;
+
+        match self {
+            Aarch64 => Cow::Borrowed("aarch64"),
+            Aarch64be => Cow::Borrowed("aarch64_be"),
+        }
+    }
+}
+
+#[cfg_attr(feature = "rust_1_40", non_exhaustive)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+#[allow(missing_docs)]
+pub enum CleverArchitecture {
+    Clever,
+    Clever1_0,
+}
+
+impl CleverArchitecture {
+    /// Convert into a string
+    pub fn into_str(self) -> Cow<'static, str> {
+        use CleverArchitecture::*;
+
+        match self {
+            Clever => Cow::Borrowed("clever"),
+            Clever1_0 => Cow::Borrowed("clever1.0"),
+        }
+    }
+}
+
+/// An enum for all 32-bit RISC-V architectures.
+#[cfg_attr(feature = "rust_1_40", non_exhaustive)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+#[allow(missing_docs)]
+pub enum Riscv32Architecture {
+    Riscv32,
+    Riscv32gc,
+    Riscv32i,
+    Riscv32im,
+    Riscv32ima,
+    Riscv32imac,
+    Riscv32imafc,
+    Riscv32imc,
+}
+
+impl Riscv32Architecture {
+    /// Convert into a string
+    pub fn into_str(self) -> Cow<'static, str> {
+        use Riscv32Architecture::*;
+
+        match self {
+            Riscv32 => Cow::Borrowed("riscv32"),
+            Riscv32gc => Cow::Borrowed("riscv32gc"),
+            Riscv32i => Cow::Borrowed("riscv32i"),
+            Riscv32im => Cow::Borrowed("riscv32im"),
+            Riscv32ima => Cow::Borrowed("riscv32ima"),
+            Riscv32imac => Cow::Borrowed("riscv32imac"),
+            Riscv32imafc => Cow::Borrowed("riscv32imafc"),
+            Riscv32imc => Cow::Borrowed("riscv32imc"),
+        }
+    }
+}
+
+/// An enum for all 64-bit RISC-V architectures.
+#[cfg_attr(feature = "rust_1_40", non_exhaustive)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+#[allow(missing_docs)]
+pub enum Riscv64Architecture {
+    Riscv64,
+    Riscv64gc,
+    Riscv64imac,
+}
+
+impl Riscv64Architecture {
+    /// Convert into a string
+    pub fn into_str(self) -> Cow<'static, str> {
+        use Riscv64Architecture::*;
+
+        match self {
+            Riscv64 => Cow::Borrowed("riscv64"),
+            Riscv64gc => Cow::Borrowed("riscv64gc"),
+            Riscv64imac => Cow::Borrowed("riscv64imac"),
+        }
+    }
+}
+
+/// An enum for all 32-bit x86 architectures.
+#[cfg_attr(feature = "rust_1_40", non_exhaustive)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+#[allow(missing_docs)]
+pub enum X86_32Architecture {
+    I386,
+    I586,
+    I686,
+}
+
+impl X86_32Architecture {
+    /// Convert into a string
+    pub fn into_str(self) -> Cow<'static, str> {
+        use X86_32Architecture::*;
+
+        match self {
+            I386 => Cow::Borrowed("i386"),
+            I586 => Cow::Borrowed("i586"),
+            I686 => Cow::Borrowed("i686"),
+        }
+    }
+}
+
+/// An enum for all 32-bit MIPS architectures (not just "MIPS32").
+#[cfg_attr(feature = "rust_1_40", non_exhaustive)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+#[allow(missing_docs)]
+pub enum Mips32Architecture {
+    Mips,
+    Mipsel,
+    Mipsisa32r6,
+    Mipsisa32r6el,
+}
+
+impl Mips32Architecture {
+    /// Convert into a string
+    pub fn into_str(self) -> Cow<'static, str> {
+        use Mips32Architecture::*;
+
+        match self {
+            Mips => Cow::Borrowed("mips"),
+            Mipsel => Cow::Borrowed("mipsel"),
+            Mipsisa32r6 => Cow::Borrowed("mipsisa32r6"),
+            Mipsisa32r6el => Cow::Borrowed("mipsisa32r6el"),
+        }
+    }
+}
+
+/// An enum for all 64-bit MIPS architectures (not just "MIPS64").
+#[cfg_attr(feature = "rust_1_40", non_exhaustive)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+#[allow(missing_docs)]
+pub enum Mips64Architecture {
+    Mips64,
+    Mips64el,
+    Mipsisa64r6,
+    Mipsisa64r6el,
+}
+
+impl Mips64Architecture {
+    /// Convert into a string
+    pub fn into_str(self) -> Cow<'static, str> {
+        use Mips64Architecture::*;
+
+        match self {
+            Mips64 => Cow::Borrowed("mips64"),
+            Mips64el => Cow::Borrowed("mips64el"),
+            Mipsisa64r6 => Cow::Borrowed("mipsisa64r6"),
+            Mipsisa64r6el => Cow::Borrowed("mipsisa64r6el"),
+        }
+    }
+}
+
+/// A string for a `Vendor::Custom` that can either be used in `const`
+/// contexts or hold dynamic strings.
+#[derive(Clone, Debug, Eq)]
+pub enum CustomVendor {
+    /// An owned `String`. This supports the general case.
+    Owned(Box<String>),
+    /// A static `str`, so that `CustomVendor` can be constructed in `const`
+    /// contexts.
+    Static(&'static str),
+}
+
+impl CustomVendor {
+    /// Extracts a string slice.
+    pub fn as_str(&self) -> &str {
+        match self {
+            CustomVendor::Owned(s) => s,
+            CustomVendor::Static(s) => s,
+        }
+    }
+}
+
+impl PartialEq for CustomVendor {
+    fn eq(&self, other: &Self) -> bool {
+        self.as_str() == other.as_str()
+    }
+}
+
+impl Hash for CustomVendor {
+    fn hash<H: Hasher>(&self, state: &mut H) {
+        self.as_str().hash(state)
+    }
+}
+
+/// The "vendor" field, which in practice is little more than an arbitrary
+/// modifier.
+#[cfg_attr(feature = "rust_1_40", non_exhaustive)]
+#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+#[allow(missing_docs)]
+pub enum Vendor {
+    Unknown,
+    Amd,
+    Apple,
+    Espressif,
+    Experimental,
+    Fortanix,
+    Ibm,
+    Kmc,
+    Nintendo,
+    Nvidia,
+    Pc,
+    Rumprun,
+    Sun,
+    Uwp,
+    Wrs,
+
+    /// A custom vendor. "Custom" in this context means that the vendor is
+    /// not specifically recognized by upstream Autotools, LLVM, Rust, or other
+    /// relevant authorities on triple naming. It's useful for people building
+    /// and using locally patched toolchains.
+    ///
+    /// Outside of such patched environments, users of `target-lexicon` should
+    /// treat `Custom` the same as `Unknown` and ignore the string.
+    Custom(CustomVendor),
+}
+
+impl Vendor {
+    /// Extracts a string slice.
+    pub fn as_str(&self) -> &str {
+        use Vendor::*;
+
+        match self {
+            Unknown => "unknown",
+            Amd => "amd",
+            Apple => "apple",
+            Espressif => "espressif",
+            Experimental => "experimental",
+            Fortanix => "fortanix",
+            Ibm => "ibm",
+            Kmc => "kmc",
+            Nintendo => "nintendo",
+            Nvidia => "nvidia",
+            Pc => "pc",
+            Rumprun => "rumprun",
+            Sun => "sun",
+            Uwp => "uwp",
+            Wrs => "wrs",
+            Custom(name) => name.as_str(),
+        }
+    }
+}
+
+/// The "operating system" field, which sometimes implies an environment, and
+/// sometimes isn't an actual operating system.
+#[cfg_attr(feature = "rust_1_40", non_exhaustive)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+#[allow(missing_docs)]
+pub enum OperatingSystem {
+    Unknown,
+    Aix,
+    AmdHsa,
+    Bitrig,
+    Cloudabi,
+    Cuda,
+    Darwin,
+    Dragonfly,
+    Emscripten,
+    Espidf,
+    Freebsd,
+    Fuchsia,
+    Haiku,
+    Hermit,
+    Horizon,
+    Hurd,
+    Illumos,
+    Ios,
+    L4re,
+    Linux,
+    MacOSX { major: u16, minor: u16, patch: u16 },
+    Nebulet,
+    Netbsd,
+    None_,
+    Openbsd,
+    Psp,
+    Redox,
+    Solaris,
+    SolidAsp3,
+    Tvos,
+    Uefi,
+    Visionos,
+    VxWorks,
+    Wasi,
+    WasiP1,
+    WasiP2,
+    Watchos,
+    Windows,
+}
+
+impl OperatingSystem {
+    /// Convert into a string
+    pub fn into_str(self) -> Cow<'static, str> {
+        use OperatingSystem::*;
+
+        match self {
+            Unknown => Cow::Borrowed("unknown"),
+            Aix => Cow::Borrowed("aix"),
+            AmdHsa => Cow::Borrowed("amdhsa"),
+            Bitrig => Cow::Borrowed("bitrig"),
+            Cloudabi => Cow::Borrowed("cloudabi"),
+            Cuda => Cow::Borrowed("cuda"),
+            Darwin => Cow::Borrowed("darwin"),
+            Dragonfly => Cow::Borrowed("dragonfly"),
+            Emscripten => Cow::Borrowed("emscripten"),
+            Espidf => Cow::Borrowed("espidf"),
+            Freebsd => Cow::Borrowed("freebsd"),
+            Fuchsia => Cow::Borrowed("fuchsia"),
+            Haiku => Cow::Borrowed("haiku"),
+            Hermit => Cow::Borrowed("hermit"),
+            Horizon => Cow::Borrowed("horizon"),
+            Hurd => Cow::Borrowed("hurd"),
+            Illumos => Cow::Borrowed("illumos"),
+            Ios => Cow::Borrowed("ios"),
+            L4re => Cow::Borrowed("l4re"),
+            Linux => Cow::Borrowed("linux"),
+            MacOSX {
+                major,
+                minor,
+                patch,
+            } => Cow::Owned(format!("macosx{}.{}.{}", major, minor, patch)),
+            Nebulet => Cow::Borrowed("nebulet"),
+            Netbsd => Cow::Borrowed("netbsd"),
+            None_ => Cow::Borrowed("none"),
+            Openbsd => Cow::Borrowed("openbsd"),
+            Psp => Cow::Borrowed("psp"),
+            Redox => Cow::Borrowed("redox"),
+            Solaris => Cow::Borrowed("solaris"),
+            SolidAsp3 => Cow::Borrowed("solid_asp3"),
+            Tvos => Cow::Borrowed("tvos"),
+            Uefi => Cow::Borrowed("uefi"),
+            VxWorks => Cow::Borrowed("vxworks"),
+            Visionos => Cow::Borrowed("visionos"),
+            Wasi => Cow::Borrowed("wasi"),
+            WasiP1 => Cow::Borrowed("wasip1"),
+            WasiP2 => Cow::Borrowed("wasip2"),
+            Watchos => Cow::Borrowed("watchos"),
+            Windows => Cow::Borrowed("windows"),
+        }
+    }
+}
+
+/// The "environment" field, which specifies an ABI environment on top of the
+/// operating system. In many configurations, this field is omitted, and the
+/// environment is implied by the operating system.
+#[cfg_attr(feature = "rust_1_40", non_exhaustive)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+#[allow(missing_docs)]
+pub enum Environment {
+    Unknown,
+    AmdGiz,
+    Android,
+    Androideabi,
+    Eabi,
+    Eabihf,
+    Gnu,
+    Gnuabi64,
+    Gnueabi,
+    Gnueabihf,
+    Gnuspe,
+    Gnux32,
+    GnuIlp32,
+    GnuLlvm,
+    HermitKernel,
+    HurdKernel,
+    LinuxKernel,
+    Macabi,
+    Musl,
+    Musleabi,
+    Musleabihf,
+    Muslabi64,
+    Msvc,
+    Newlib,
+    None,
+    Kernel,
+    Uclibc,
+    Uclibceabi,
+    Uclibceabihf,
+    Sgx,
+    Sim,
+    Softfloat,
+    Spe,
+    Threads,
+    Ohos,
+}
+
+impl Environment {
+    /// Convert into a string
+    pub fn into_str(self) -> Cow<'static, str> {
+        use Environment::*;
+
+        match self {
+            Unknown => Cow::Borrowed("unknown"),
+            AmdGiz => Cow::Borrowed("amdgiz"),
+            Android => Cow::Borrowed("android"),
+            Androideabi => Cow::Borrowed("androideabi"),
+            Eabi => Cow::Borrowed("eabi"),
+            Eabihf => Cow::Borrowed("eabihf"),
+            Gnu => Cow::Borrowed("gnu"),
+            Gnuabi64 => Cow::Borrowed("gnuabi64"),
+            Gnueabi => Cow::Borrowed("gnueabi"),
+            Gnueabihf => Cow::Borrowed("gnueabihf"),
+            Gnuspe => Cow::Borrowed("gnuspe"),
+            Gnux32 => Cow::Borrowed("gnux32"),
+            GnuIlp32 => Cow::Borrowed("gnu_ilp32"),
+            GnuLlvm => Cow::Borrowed("gnullvm"),
+            HermitKernel => Cow::Borrowed("hermitkernel"),
+            HurdKernel => Cow::Borrowed("hurdkernel"),
+            LinuxKernel => Cow::Borrowed("linuxkernel"),
+            Macabi => Cow::Borrowed("macabi"),
+            Musl => Cow::Borrowed("musl"),
+            Musleabi => Cow::Borrowed("musleabi"),
+            Musleabihf => Cow::Borrowed("musleabihf"),
+            Muslabi64 => Cow::Borrowed("muslabi64"),
+            Msvc => Cow::Borrowed("msvc"),
+            Newlib => Cow::Borrowed("newlib"),
+            None => Cow::Borrowed("none"),
+            Kernel => Cow::Borrowed("kernel"),
+            Uclibc => Cow::Borrowed("uclibc"),
+            Uclibceabi => Cow::Borrowed("uclibceabi"),
+            Uclibceabihf => Cow::Borrowed("uclibceabihf"),
+            Sgx => Cow::Borrowed("sgx"),
+            Sim => Cow::Borrowed("sim"),
+            Softfloat => Cow::Borrowed("softfloat"),
+            Spe => Cow::Borrowed("spe"),
+            Threads => Cow::Borrowed("threads"),
+            Ohos => Cow::Borrowed("ohos"),
+        }
+    }
+}
+
+/// The "binary format" field, which is usually omitted, and the binary format
+/// is implied by the other fields.
+#[cfg_attr(feature = "rust_1_40", non_exhaustive)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+#[allow(missing_docs)]
+pub enum BinaryFormat {
+    Unknown,
+    Elf,
+    Coff,
+    Macho,
+    Wasm,
+    Xcoff,
+}
+
+impl BinaryFormat {
+    /// Convert into a string
+    pub fn into_str(self) -> Cow<'static, str> {
+        use BinaryFormat::*;
+
+        match self {
+            Unknown => Cow::Borrowed("unknown"),
+            Elf => Cow::Borrowed("elf"),
+            Coff => Cow::Borrowed("coff"),
+            Macho => Cow::Borrowed("macho"),
+            Wasm => Cow::Borrowed("wasm"),
+            Xcoff => Cow::Borrowed("xcoff"),
+        }
+    }
+}
+
+impl Architecture {
+    /// Return the endianness of this architecture.
+    #[rustfmt::skip]
+    pub fn endianness(self) -> Result<Endianness, ()> {
+        use Architecture::*;
+
+        match self {
+            Unknown => Err(()),
+            Arm(arm) => Ok(arm.endianness()),
+            Aarch64(aarch) => Ok(aarch.endianness()),
+            AmdGcn
+            | Asmjs
+            | Avr
+            | Bpfel
+            | Hexagon
+            | X86_32(_)
+            | LoongArch64
+            | Mips64(Mips64Architecture::Mips64el)
+            | Mips32(Mips32Architecture::Mipsel)
+            | Mips32(Mips32Architecture::Mipsisa32r6el)
+            | Mips64(Mips64Architecture::Mipsisa64r6el)
+            | Msp430
+            | Nvptx64
+            | Powerpc64le
+            | Riscv32(_)
+            | Riscv64(_)
+            | Wasm32
+            | Wasm64
+            | X86_64
+            | X86_64h
+            | XTensa
+            | Clever(_) => Ok(Endianness::Little),
+            Bpfeb
+            | M68k
+            | Mips32(Mips32Architecture::Mips)
+            | Mips64(Mips64Architecture::Mips64)
+            | Mips32(Mips32Architecture::Mipsisa32r6)
+            | Mips64(Mips64Architecture::Mipsisa64r6)
+            | Powerpc
+            | Powerpc64
+            | S390x
+            | Sparc
+            | Sparc64
+            | Sparcv9 => Ok(Endianness::Big),
+            #[cfg(feature="arch_zkasm")]
+            ZkAsm => Ok(Endianness::Big),
+        }
+
+    }
+
+    /// Return the pointer bit width of this target's architecture.
+    ///
+    /// This function is only aware of the CPU architecture so it is not aware
+    /// of ilp32 and x32 ABIs.
+    #[rustfmt::skip]
+    pub fn pointer_width(self) -> Result<PointerWidth, ()> {
+        use Architecture::*;
+
+        match self {
+            Unknown => Err(()),
+            Avr | Msp430 => Ok(PointerWidth::U16),
+            Arm(arm) => Ok(arm.pointer_width()),
+            Aarch64(aarch) => Ok(aarch.pointer_width()),
+            Asmjs
+            | Hexagon
+            | X86_32(_)
+            | Riscv32(_)
+            | Sparc
+            | Wasm32
+            | M68k
+            | Mips32(_)
+            | Powerpc
+            | XTensa => Ok(PointerWidth::U32),
+            AmdGcn
+            | Bpfeb
+            | Bpfel
+            | Powerpc64le
+            | Riscv64(_)
+            | X86_64
+            | X86_64h
+            | Mips64(_)
+            | Nvptx64
+            | Powerpc64
+            | S390x
+            | Sparc64
+            | Sparcv9
+            | LoongArch64
+            | Wasm64
+            | Clever(_) => Ok(PointerWidth::U64),
+            #[cfg(feature="arch_zkasm")]
+            ZkAsm => Ok(PointerWidth::U64),
+        }
+    }
+
+    /// Checks if this Architecture is some variant of Clever-ISA
+    pub fn is_clever(&self) -> bool {
+        match self {
+            Architecture::Clever(_) => true,
+            _ => false,
+        }
+    }
+
+    /// Convert into a string
+    pub fn into_str(self) -> Cow<'static, str> {
+        use Architecture::*;
+
+        match self {
+            Arm(arm) => arm.into_str(),
+            Aarch64(aarch) => aarch.into_str(),
+            Unknown => Cow::Borrowed("unknown"),
+            AmdGcn => Cow::Borrowed("amdgcn"),
+            Asmjs => Cow::Borrowed("asmjs"),
+            Avr => Cow::Borrowed("avr"),
+            Bpfeb => Cow::Borrowed("bpfeb"),
+            Bpfel => Cow::Borrowed("bpfel"),
+            Hexagon => Cow::Borrowed("hexagon"),
+            X86_32(x86_32) => x86_32.into_str(),
+            LoongArch64 => Cow::Borrowed("loongarch64"),
+            M68k => Cow::Borrowed("m68k"),
+            Mips32(mips32) => mips32.into_str(),
+            Mips64(mips64) => mips64.into_str(),
+            Msp430 => Cow::Borrowed("msp430"),
+            Nvptx64 => Cow::Borrowed("nvptx64"),
+            Powerpc => Cow::Borrowed("powerpc"),
+            Powerpc64 => Cow::Borrowed("powerpc64"),
+            Powerpc64le => Cow::Borrowed("powerpc64le"),
+            Riscv32(riscv32) => riscv32.into_str(),
+            Riscv64(riscv64) => riscv64.into_str(),
+            S390x => Cow::Borrowed("s390x"),
+            Sparc => Cow::Borrowed("sparc"),
+            Sparc64 => Cow::Borrowed("sparc64"),
+            Sparcv9 => Cow::Borrowed("sparcv9"),
+            Wasm32 => Cow::Borrowed("wasm32"),
+            Wasm64 => Cow::Borrowed("wasm64"),
+            X86_64 => Cow::Borrowed("x86_64"),
+            X86_64h => Cow::Borrowed("x86_64h"),
+            XTensa => Cow::Borrowed("xtensa"),
+            Clever(ver) => ver.into_str(),
+            #[cfg(feature = "arch_zkasm")]
+            ZkAsm => Cow::Borrowed("zkasm"),
+        }
+    }
+}
+
+/// Return the binary format implied by this target triple, ignoring its
+/// `binary_format` field.
+pub(crate) fn default_binary_format(triple: &Triple) -> BinaryFormat {
+    match triple.operating_system {
+        OperatingSystem::None_ => match triple.environment {
+            Environment::Eabi | Environment::Eabihf => BinaryFormat::Elf,
+            _ => BinaryFormat::Unknown,
+        },
+        OperatingSystem::Aix => BinaryFormat::Xcoff,
+        OperatingSystem::Darwin
+        | OperatingSystem::Ios
+        | OperatingSystem::MacOSX { .. }
+        | OperatingSystem::Visionos
+        | OperatingSystem::Watchos
+        | OperatingSystem::Tvos => BinaryFormat::Macho,
+        OperatingSystem::Windows => BinaryFormat::Coff,
+        OperatingSystem::Nebulet
+        | OperatingSystem::Emscripten
+        | OperatingSystem::VxWorks
+        | OperatingSystem::Wasi
+        | OperatingSystem::Unknown => match triple.architecture {
+            Architecture::Wasm32 | Architecture::Wasm64 => BinaryFormat::Wasm,
+            Architecture::Unknown => BinaryFormat::Unknown,
+            // Default to ELF, following `getDefaultFormat` in LLVM.
+            _ => BinaryFormat::Elf,
+        },
+        _ => BinaryFormat::Elf,
+    }
+}
+
+impl fmt::Display for ArmArchitecture {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str(&self.into_str())
+    }
+}
+
+impl fmt::Display for Aarch64Architecture {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str(&self.into_str())
+    }
+}
+
+impl fmt::Display for CleverArchitecture {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str(&self.into_str())
+    }
+}
+
+impl fmt::Display for Riscv32Architecture {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str(&self.into_str())
+    }
+}
+
+impl fmt::Display for Riscv64Architecture {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str(&self.into_str())
+    }
+}
+
+impl fmt::Display for X86_32Architecture {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str(&self.into_str())
+    }
+}
+
+impl fmt::Display for Mips32Architecture {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str(&self.into_str())
+    }
+}
+
+impl fmt::Display for Mips64Architecture {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str(&self.into_str())
+    }
+}
+
+impl fmt::Display for Architecture {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str(&self.into_str())
+    }
+}
+
+impl FromStr for ArmArchitecture {
+    type Err = ();
+
+    fn from_str(s: &str) -> Result<Self, ()> {
+        use ArmArchitecture::*;
+
+        Ok(match s {
+            "arm" => Arm,
+            "armeb" => Armeb,
+            "armv4" => Armv4,
+            "armv4t" => Armv4t,
+            "armv5t" => Armv5t,
+            "armv5te" => Armv5te,
+            "armv5tej" => Armv5tej,
+            "armv6" => Armv6,
+            "armv6j" => Armv6j,
+            "armv6k" => Armv6k,
+            "armv6z" => Armv6z,
+            "armv6kz" => Armv6kz,
+            "armv6t2" => Armv6t2,
+            "armv6m" => Armv6m,
+            "armv7" => Armv7,
+            "armv7a" => Armv7a,
+            "armv7k" => Armv7k,
+            "armv7ve" => Armv7ve,
+            "armv7m" => Armv7m,
+            "armv7r" => Armv7r,
+            "armv7s" => Armv7s,
+            "armv8" => Armv8,
+            "armv8a" => Armv8a,
+            "armv8.1a" => Armv8_1a,
+            "armv8.2a" => Armv8_2a,
+            "armv8.3a" => Armv8_3a,
+            "armv8.4a" => Armv8_4a,
+            "armv8.5a" => Armv8_5a,
+            "armv8m.base" => Armv8mBase,
+            "armv8m.main" => Armv8mMain,
+            "armv8r" => Armv8r,
+            "thumbeb" => Thumbeb,
+            "thumbv4t" => Thumbv4t,
+            "thumbv5te" => Thumbv5te,
+            "thumbv6m" => Thumbv6m,
+            "thumbv7a" => Thumbv7a,
+            "thumbv7em" => Thumbv7em,
+            "thumbv7m" => Thumbv7m,
+            "thumbv7neon" => Thumbv7neon,
+            "thumbv8m.base" => Thumbv8mBase,
+            "thumbv8m.main" => Thumbv8mMain,
+            "armebv7r" => Armebv7r,
+            _ => return Err(()),
+        })
+    }
+}
+
+impl FromStr for Aarch64Architecture {
+    type Err = ();
+
+    fn from_str(s: &str) -> Result<Self, ()> {
+        use Aarch64Architecture::*;
+
+        Ok(match s {
+            "aarch64" => Aarch64,
+            "arm64" => Aarch64,
+            "aarch64_be" => Aarch64be,
+            _ => return Err(()),
+        })
+    }
+}
+
+impl FromStr for CleverArchitecture {
+    type Err = ();
+    fn from_str(s: &str) -> Result<Self, ()> {
+        match s {
+            "clever" => Ok(CleverArchitecture::Clever),
+            "clever1.0" => Ok(CleverArchitecture::Clever1_0),
+            _ => Err(()),
+        }
+    }
+}
+
+impl FromStr for Riscv32Architecture {
+    type Err = ();
+
+    fn from_str(s: &str) -> Result<Self, ()> {
+        use Riscv32Architecture::*;
+
+        Ok(match s {
+            "riscv32" => Riscv32,
+            "riscv32gc" => Riscv32gc,
+            "riscv32i" => Riscv32i,
+            "riscv32im" => Riscv32im,
+            "riscv32ima" => Riscv32ima,
+            "riscv32imac" => Riscv32imac,
+            "riscv32imafc" => Riscv32imafc,
+            "riscv32imc" => Riscv32imc,
+            _ => return Err(()),
+        })
+    }
+}
+
+impl FromStr for Riscv64Architecture {
+    type Err = ();
+
+    fn from_str(s: &str) -> Result<Self, ()> {
+        use Riscv64Architecture::*;
+
+        Ok(match s {
+            "riscv64" => Riscv64,
+            "riscv64gc" => Riscv64gc,
+            "riscv64imac" => Riscv64imac,
+            _ => return Err(()),
+        })
+    }
+}
+
+impl FromStr for X86_32Architecture {
+    type Err = ();
+
+    fn from_str(s: &str) -> Result<Self, ()> {
+        use X86_32Architecture::*;
+
+        Ok(match s {
+            "i386" => I386,
+            "i586" => I586,
+            "i686" => I686,
+            _ => return Err(()),
+        })
+    }
+}
+
+impl FromStr for Mips32Architecture {
+    type Err = ();
+
+    fn from_str(s: &str) -> Result<Self, ()> {
+        use Mips32Architecture::*;
+
+        Ok(match s {
+            "mips" => Mips,
+            "mipsel" => Mipsel,
+            "mipsisa32r6" => Mipsisa32r6,
+            "mipsisa32r6el" => Mipsisa32r6el,
+            _ => return Err(()),
+        })
+    }
+}
+
+impl FromStr for Mips64Architecture {
+    type Err = ();
+
+    fn from_str(s: &str) -> Result<Self, ()> {
+        use Mips64Architecture::*;
+
+        Ok(match s {
+            "mips64" => Mips64,
+            "mips64el" => Mips64el,
+            "mipsisa64r6" => Mipsisa64r6,
+            "mipsisa64r6el" => Mipsisa64r6el,
+            _ => return Err(()),
+        })
+    }
+}
+
+impl FromStr for Architecture {
+    type Err = ();
+
+    fn from_str(s: &str) -> Result<Self, ()> {
+        use Architecture::*;
+
+        Ok(match s {
+            "unknown" => Unknown,
+            "amdgcn" => AmdGcn,
+            "asmjs" => Asmjs,
+            "avr" => Avr,
+            "bpfeb" => Bpfeb,
+            "bpfel" => Bpfel,
+            "hexagon" => Hexagon,
+            "loongarch64" => LoongArch64,
+            "m68k" => M68k,
+            "msp430" => Msp430,
+            "nvptx64" => Nvptx64,
+            "powerpc" => Powerpc,
+            "powerpc64" => Powerpc64,
+            "powerpc64le" => Powerpc64le,
+            "s390x" => S390x,
+            "sparc" => Sparc,
+            "sparc64" => Sparc64,
+            "sparcv9" => Sparcv9,
+            "wasm32" => Wasm32,
+            "wasm64" => Wasm64,
+            "x86_64" => X86_64,
+            "x86_64h" => X86_64h,
+            "xtensa" => XTensa,
+            #[cfg(feature = "arch_zkasm")]
+            "zkasm" => ZkAsm,
+            _ => {
+                if let Ok(arm) = ArmArchitecture::from_str(s) {
+                    Arm(arm)
+                } else if let Ok(aarch64) = Aarch64Architecture::from_str(s) {
+                    Aarch64(aarch64)
+                } else if let Ok(riscv32) = Riscv32Architecture::from_str(s) {
+                    Riscv32(riscv32)
+                } else if let Ok(riscv64) = Riscv64Architecture::from_str(s) {
+                    Riscv64(riscv64)
+                } else if let Ok(x86_32) = X86_32Architecture::from_str(s) {
+                    X86_32(x86_32)
+                } else if let Ok(mips32) = Mips32Architecture::from_str(s) {
+                    Mips32(mips32)
+                } else if let Ok(mips64) = Mips64Architecture::from_str(s) {
+                    Mips64(mips64)
+                } else if let Ok(clever) = CleverArchitecture::from_str(s) {
+                    Clever(clever)
+                } else {
+                    return Err(());
+                }
+            }
+        })
+    }
+}
+
+impl fmt::Display for Vendor {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str(self.as_str())
+    }
+}
+
+impl FromStr for Vendor {
+    type Err = ();
+
+    fn from_str(s: &str) -> Result<Self, ()> {
+        use Vendor::*;
+
+        Ok(match s {
+            "unknown" => Unknown,
+            "amd" => Amd,
+            "apple" => Apple,
+            "espressif" => Espressif,
+            "experimental" => Experimental,
+            "fortanix" => Fortanix,
+            "ibm" => Ibm,
+            "kmc" => Kmc,
+            "nintendo" => Nintendo,
+            "nvidia" => Nvidia,
+            "pc" => Pc,
+            "rumprun" => Rumprun,
+            "sun" => Sun,
+            "uwp" => Uwp,
+            "wrs" => Wrs,
+            custom => {
+                #[cfg(not(feature = "std"))]
+                use alloc::borrow::ToOwned;
+
+                // A custom vendor. Since triple syntax is so loosely defined,
+                // be as conservative as we can to avoid potential ambiguities.
+                // We err on the side of being too strict here, as we can
+                // always relax it if needed.
+
+                // Don't allow empty string names.
+                if custom.is_empty() {
+                    return Err(());
+                }
+
+                // Don't allow any other recognized name as a custom vendor,
+                // since vendors can be omitted in some contexts.
+                if Architecture::from_str(custom).is_ok()
+                    || OperatingSystem::from_str(custom).is_ok()
+                    || Environment::from_str(custom).is_ok()
+                    || BinaryFormat::from_str(custom).is_ok()
+                {
+                    return Err(());
+                }
+
+                // Require the first character to be an ascii lowercase.
+                if !custom.chars().next().unwrap().is_ascii_lowercase() {
+                    return Err(());
+                }
+
+                // Restrict the set of characters permitted in a custom vendor.
+                let has_restricted = custom.chars().any(|c: char| {
+                    !(c.is_ascii_lowercase() || c.is_ascii_digit() || c == '_' || c == '.')
+                });
+
+                if has_restricted {
+                    return Err(());
+                }
+
+                Custom(CustomVendor::Owned(Box::new(custom.to_owned())))
+            }
+        })
+    }
+}
+
+impl fmt::Display for OperatingSystem {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        use OperatingSystem::*;
+
+        match *self {
+            MacOSX {
+                major,
+                minor,
+                patch,
+            } => write!(f, "macosx{}.{}.{}", major, minor, patch),
+            os => f.write_str(&os.into_str()),
+        }
+    }
+}
+
+impl FromStr for OperatingSystem {
+    type Err = ();
+
+    fn from_str(s: &str) -> Result<Self, ()> {
+        use OperatingSystem::*;
+
+        // TODO also parse version number for darwin and ios OSes
+        if s.starts_with("macosx") {
+            // Parse operating system names like `macosx10.7.0`.
+            let s = &s["macosx".len()..];
+            let mut parts = s.split('.').map(|num| num.parse::<u16>());
+
+            macro_rules! get_part {
+                () => {
+                    if let Some(Ok(part)) = parts.next() {
+                        part
+                    } else {
+                        return Err(());
+                    }
+                };
+            }
+
+            let major = get_part!();
+            let minor = get_part!();
+            let patch = get_part!();
+
+            if parts.next().is_some() {
+                return Err(());
+            }
+
+            return Ok(MacOSX {
+                major,
+                minor,
+                patch,
+            });
+        }
+
+        Ok(match s {
+            "unknown" => Unknown,
+            "aix" => Aix,
+            "amdhsa" => AmdHsa,
+            "bitrig" => Bitrig,
+            "cloudabi" => Cloudabi,
+            "cuda" => Cuda,
+            "darwin" => Darwin,
+            "dragonfly" => Dragonfly,
+            "emscripten" => Emscripten,
+            "freebsd" => Freebsd,
+            "fuchsia" => Fuchsia,
+            "haiku" => Haiku,
+            "hermit" => Hermit,
+            "horizon" => Horizon,
+            "hurd" => Hurd,
+            "illumos" => Illumos,
+            "ios" => Ios,
+            "l4re" => L4re,
+            "linux" => Linux,
+            "nebulet" => Nebulet,
+            "netbsd" => Netbsd,
+            "none" => None_,
+            "openbsd" => Openbsd,
+            "psp" => Psp,
+            "redox" => Redox,
+            "solaris" => Solaris,
+            "solid_asp3" => SolidAsp3,
+            "tvos" => Tvos,
+            "uefi" => Uefi,
+            "visionos" => Visionos,
+            "vxworks" => VxWorks,
+            "wasi" => Wasi,
+            "wasip1" => WasiP1,
+            "wasip2" => WasiP2,
+            "watchos" => Watchos,
+            "windows" => Windows,
+            "espidf" => Espidf,
+            _ => return Err(()),
+        })
+    }
+}
+
+impl fmt::Display for Environment {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str(&self.into_str())
+    }
+}
+
+impl FromStr for Environment {
+    type Err = ();
+
+    fn from_str(s: &str) -> Result<Self, ()> {
+        use Environment::*;
+
+        Ok(match s {
+            "unknown" => Unknown,
+            "amdgiz" => AmdGiz,
+            "android" => Android,
+            "androideabi" => Androideabi,
+            "eabi" => Eabi,
+            "eabihf" => Eabihf,
+            "gnu" => Gnu,
+            "gnuabi64" => Gnuabi64,
+            "gnueabi" => Gnueabi,
+            "gnueabihf" => Gnueabihf,
+            "gnuspe" => Gnuspe,
+            "gnux32" => Gnux32,
+            "gnu_ilp32" => GnuIlp32,
+            "gnullvm" => GnuLlvm,
+            "hermitkernel" => HermitKernel,
+            "hurdkernel" => HurdKernel,
+            "linuxkernel" => LinuxKernel,
+            "macabi" => Macabi,
+            "musl" => Musl,
+            "musleabi" => Musleabi,
+            "musleabihf" => Musleabihf,
+            "muslabi64" => Muslabi64,
+            "msvc" => Msvc,
+            "newlib" => Newlib,
+            "none" => None,
+            "kernel" => Kernel,
+            "uclibc" => Uclibc,
+            "uclibceabi" => Uclibceabi,
+            "uclibceabihf" => Uclibceabihf,
+            "sgx" => Sgx,
+            "sim" => Sim,
+            "softfloat" => Softfloat,
+            "spe" => Spe,
+            "threads" => Threads,
+            "ohos" => Ohos,
+            _ => return Err(()),
+        })
+    }
+}
+
+impl fmt::Display for BinaryFormat {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str(&self.into_str())
+    }
+}
+
+impl FromStr for BinaryFormat {
+    type Err = ();
+
+    fn from_str(s: &str) -> Result<Self, ()> {
+        use BinaryFormat::*;
+
+        Ok(match s {
+            "unknown" => Unknown,
+            "elf" => Elf,
+            "coff" => Coff,
+            "macho" => Macho,
+            "wasm" => Wasm,
+            "xcoff" => Xcoff,
+            _ => return Err(()),
+        })
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use alloc::string::ToString;
+
+    #[test]
+    fn roundtrip_known_triples() {
+        // This list is constructed from:
+        //  - targets emitted by "rustup target list"
+        //  - targets emitted by "rustc +nightly --print target-list"
+        //  - targets contributors have added
+        let targets = [
+            "aarch64-apple-darwin",
+            "aarch64-apple-ios",
+            "aarch64-apple-ios-macabi",
+            "aarch64-apple-ios-sim",
+            "aarch64-apple-tvos",
+            "aarch64-apple-tvos-sim",
+            "aarch64-apple-visionos",
+            "aarch64-apple-visionos-sim",
+            "aarch64-apple-watchos",
+            "aarch64-apple-watchos-sim",
+            "aarch64_be-unknown-linux-gnu",
+            "aarch64_be-unknown-linux-gnu_ilp32",
+            "aarch64_be-unknown-netbsd",
+            "aarch64-kmc-solid_asp3",
+            "aarch64-linux-android",
+            //"aarch64-nintendo-switch-freestanding", // TODO
+            "aarch64-pc-windows-gnullvm",
+            "aarch64-pc-windows-msvc",
+            "aarch64-unknown-cloudabi",
+            "aarch64-unknown-freebsd",
+            "aarch64-unknown-fuchsia",
+            "aarch64-unknown-hermit",
+            "aarch64-unknown-illumos",
+            "aarch64-unknown-linux-gnu",
+            "aarch64-unknown-linux-gnu_ilp32",
+            "aarch64-unknown-linux-musl",
+            "aarch64-unknown-linux-ohos",
+            "aarch64-unknown-netbsd",
+            "aarch64-unknown-none",
+            "aarch64-unknown-none-softfloat",
+            //"aarch64-unknown-nto-qnx710", // TODO
+            "aarch64-unknown-openbsd",
+            "aarch64-unknown-redox",
+            //"aarch64-unknown-teeos", // TODO
+            "aarch64-unknown-uefi",
+            "aarch64-uwp-windows-msvc",
+            "aarch64-wrs-vxworks",
+            //"arm64_32-apple-watchos", // TODO
+            //"arm64e-apple-darwin", // TODO
+            "amdgcn-amd-amdhsa",
+            "amdgcn-amd-amdhsa-amdgiz",
+            //"arm64e-apple-ios", // TODO
+            //"arm64ec-pc-windows-msvc", // TODO
+            "armeb-unknown-linux-gnueabi",
+            "armebv7r-none-eabi",
+            "armebv7r-none-eabihf",
+            "arm-linux-androideabi",
+            "arm-unknown-linux-gnueabi",
+            "arm-unknown-linux-gnueabihf",
+            "arm-unknown-linux-musleabi",
+            "arm-unknown-linux-musleabihf",
+            "armv4t-none-eabi",
+            "armv4t-unknown-linux-gnueabi",
+            "armv5te-none-eabi",
+            "armv5te-unknown-linux-gnueabi",
+            "armv5te-unknown-linux-musleabi",
+            "armv5te-unknown-linux-uclibceabi",
+            "armv6k-nintendo-3ds",
+            "armv6-unknown-freebsd",
+            "armv6-unknown-netbsd-eabihf",
+            "armv7a-kmc-solid_asp3-eabi",
+            "armv7a-kmc-solid_asp3-eabihf",
+            "armv7a-none-eabi",
+            "armv7a-none-eabihf",
+            "armv7-apple-ios",
+            "armv7k-apple-watchos",
+            "armv7-linux-androideabi",
+            "armv7r-none-eabi",
+            "armv7r-none-eabihf",
+            "armv7s-apple-ios",
+            "armv7-unknown-cloudabi-eabihf",
+            //"armv7-sony-vita-newlibeabihf", // TODO
+            "armv7-unknown-freebsd",
+            "armv7-unknown-linux-gnueabi",
+            "armv7-unknown-linux-gnueabihf",
+            "armv7-unknown-linux-musleabi",
+            "armv7-unknown-linux-musleabihf",
+            "armv7-unknown-linux-ohos",
+            "armv7-unknown-linux-uclibceabi",
+            "armv7-unknown-linux-uclibceabihf",
+            "armv7-unknown-netbsd-eabihf",
+            "armv7-wrs-vxworks-eabihf",
+            "asmjs-unknown-emscripten",
+            "armv8r-none-eabihf",
+            //"avr-unknown-gnu-atmega328", // TODO
+            "avr-unknown-unknown",
+            "bpfeb-unknown-none",
+            "bpfel-unknown-none",
+            //"csky-unknown-linux-gnuabiv2", // TODO
+            //"csky-unknown-linux-gnuabiv2hf", // TODO
+            "hexagon-unknown-linux-musl",
+            "hexagon-unknown-none-elf",
+            "i386-apple-ios",
+            //"i586-pc-nto-qnx700", // TODO
+            "i586-pc-windows-msvc",
+            "i586-unknown-linux-gnu",
+            "i586-unknown-linux-musl",
+            "i586-unknown-netbsd",
+            "i686-apple-darwin",
+            "i686-linux-android",
+            "i686-apple-macosx10.7.0",
+            "i686-pc-windows-gnu",
+            "i686-pc-windows-gnullvm",
+            "i686-pc-windows-msvc",
+            "i686-unknown-cloudabi",
+            "i686-unknown-dragonfly",
+            "i686-unknown-freebsd",
+            "i686-unknown-haiku",
+            "i686-unknown-hurd-gnu",
+            "i686-unknown-linux-gnu",
+            "i686-unknown-linux-musl",
+            "i686-unknown-netbsd",
+            "i686-unknown-openbsd",
+            "i686-unknown-redox",
+            "i686-unknown-uefi",
+            "i686-uwp-windows-gnu",
+            "i686-uwp-windows-msvc",
+            "i686-win7-windows-msvc",
+            "i686-wrs-vxworks",
+            "loongarch64-unknown-linux-gnu",
+            "loongarch64-unknown-linux-musl",
+            "loongarch64-unknown-none",
+            "loongarch64-unknown-none-softfloat",
+            "m68k-unknown-linux-gnu",
+            "mips64el-unknown-linux-gnuabi64",
+            "mips64el-unknown-linux-muslabi64",
+            "mips64-openwrt-linux-musl",
+            "mips64-unknown-linux-gnuabi64",
+            "mips64-unknown-linux-muslabi64",
+            "mipsel-sony-psp",
+            //"mipsel-sony-psx", // TODO
+            "mipsel-unknown-linux-gnu",
+            "mipsel-unknown-linux-musl",
+            "mipsel-unknown-linux-uclibc",
+            "mipsel-unknown-netbsd",
+            "mipsel-unknown-none",
+            "mipsisa32r6el-unknown-linux-gnu",
+            "mipsisa32r6-unknown-linux-gnu",
+            "mipsisa64r6el-unknown-linux-gnuabi64",
+            "mipsisa64r6-unknown-linux-gnuabi64",
+            "mips-unknown-linux-gnu",
+            "mips-unknown-linux-musl",
+            "mips-unknown-linux-uclibc",
+            "msp430-none-elf",
+            "nvptx64-nvidia-cuda",
+            "powerpc64-ibm-aix",
+            "powerpc64le-unknown-freebsd",
+            "powerpc64le-unknown-linux-gnu",
+            "powerpc64le-unknown-linux-musl",
+            "powerpc64-unknown-freebsd",
+            "powerpc64-unknown-linux-gnu",
+            "powerpc64-unknown-linux-musl",
+            "powerpc64-unknown-openbsd",
+            "powerpc64-wrs-vxworks",
+            "powerpc-ibm-aix",
+            "powerpc-unknown-freebsd",
+            "powerpc-unknown-linux-gnu",
+            "powerpc-unknown-linux-gnuspe",
+            "powerpc-unknown-linux-musl",
+            "powerpc-unknown-netbsd",
+            "powerpc-unknown-openbsd",
+            "powerpc-wrs-vxworks",
+            "powerpc-wrs-vxworks-spe",
+            "riscv32gc-unknown-linux-gnu",
+            "riscv32gc-unknown-linux-musl",
+            "riscv32imac-esp-espidf",
+            "riscv32imac-unknown-none-elf",
+            //"riscv32imac-unknown-xous-elf", // TODO
+            "riscv32imafc-esp-espidf",
+            "riscv32imafc-unknown-none-elf",
+            "riscv32ima-unknown-none-elf",
+            "riscv32imc-esp-espidf",
+            "riscv32imc-unknown-none-elf",
+            //"riscv32im-risc0-zkvm-elf", // TODO
+            "riscv32im-unknown-none-elf",
+            "riscv32i-unknown-none-elf",
+            "riscv64gc-unknown-freebsd",
+            "riscv64gc-unknown-fuchsia",
+            "riscv64gc-unknown-hermit",
+            "riscv64gc-unknown-linux-gnu",
+            "riscv64gc-unknown-linux-musl",
+            "riscv64gc-unknown-netbsd",
+            "riscv64gc-unknown-none-elf",
+            "riscv64gc-unknown-openbsd",
+            "riscv64imac-unknown-none-elf",
+            "riscv64-linux-android",
+            "s390x-unknown-linux-gnu",
+            "s390x-unknown-linux-musl",
+            "sparc64-unknown-linux-gnu",
+            "sparc64-unknown-netbsd",
+            "sparc64-unknown-openbsd",
+            "sparc-unknown-linux-gnu",
+            "sparc-unknown-none-elf",
+            "sparcv9-sun-solaris",
+            "thumbv4t-none-eabi",
+            "thumbv5te-none-eabi",
+            "thumbv6m-none-eabi",
+            "thumbv7a-pc-windows-msvc",
+            "thumbv7a-uwp-windows-msvc",
+            "thumbv7em-none-eabi",
+            "thumbv7em-none-eabihf",
+            "thumbv7m-none-eabi",
+            "thumbv7neon-linux-androideabi",
+            "thumbv7neon-unknown-linux-gnueabihf",
+            "thumbv7neon-unknown-linux-musleabihf",
+            "thumbv8m.base-none-eabi",
+            "thumbv8m.main-none-eabi",
+            "thumbv8m.main-none-eabihf",
+            "wasm32-experimental-emscripten",
+            "wasm32-unknown-emscripten",
+            "wasm32-unknown-unknown",
+            "wasm32-wasi",
+            "wasm32-wasip1",
+            "wasm32-wasip1-threads",
+            "wasm32-wasip2",
+            "wasm64-unknown-unknown",
+            "wasm64-wasi",
+            "x86_64-apple-darwin",
+            "x86_64-apple-ios",
+            "x86_64-apple-ios-macabi",
+            "x86_64-apple-tvos",
+            "x86_64-apple-watchos-sim",
+            "x86_64-fortanix-unknown-sgx",
+            "x86_64h-apple-darwin",
+            "x86_64-linux-android",
+            //"x86_64-pc-nto-qnx710", // TODO
+            "x86_64-linux-kernel", // Changed to x86_64-unknown-none-linuxkernel in 1.53.0
+            "x86_64-apple-macosx10.7.0",
+            "x86_64-pc-solaris",
+            "x86_64-pc-windows-gnu",
+            "x86_64-pc-windows-gnullvm",
+            "x86_64-pc-windows-msvc",
+            "x86_64-rumprun-netbsd", // Removed in 1.53.0
+            "x86_64-sun-solaris",
+            "x86_64-unknown-bitrig",
+            "x86_64-unknown-cloudabi",
+            "x86_64-unikraft-linux-musl",
+            "x86_64-unknown-dragonfly",
+            "x86_64-unknown-freebsd",
+            "x86_64-unknown-fuchsia",
+            "x86_64-unknown-haiku",
+            "x86_64-unknown-hermit-kernel", // Changed to x86_64-unknown-none-hermitkernel in 1.53.0
+            "x86_64-unknown-hermit",
+            "x86_64-unknown-illumos",
+            "x86_64-unknown-l4re-uclibc",
+            "x86_64-unknown-linux-gnu",
+            "x86_64-unknown-linux-gnux32",
+            "x86_64-unknown-linux-musl",
+            "x86_64-unknown-linux-none",
+            "x86_64-unknown-linux-ohos",
+            "x86_64-unknown-netbsd",
+            "x86_64-unknown-none",
+            "x86_64-unknown-none-hermitkernel",
+            "x86_64-unknown-none-linuxkernel",
+            "x86_64-unknown-openbsd",
+            "x86_64-unknown-redox",
+            "x86_64-unknown-uefi",
+            "x86_64-uwp-windows-gnu",
+            "x86_64-uwp-windows-msvc",
+            "x86_64-win7-windows-msvc",
+            "x86_64-wrs-vxworks",
+            "xtensa-esp32-espidf",
+            "clever-unknown-elf",
+            "xtensa-esp32-none-elf",
+            "xtensa-esp32s2-espidf",
+            "xtensa-esp32s2-none-elf",
+            "xtensa-esp32s3-espidf",
+            "xtensa-esp32s3-none-elf",
+            #[cfg(feature = "arch_zkasm")]
+            "zkasm-unknown-unknown",
+        ];
+
+        for target in targets.iter() {
+            let t = Triple::from_str(target).expect("can't parse target");
+            assert_ne!(t.architecture, Architecture::Unknown);
+            assert_eq!(t.to_string(), *target, "{:#?}", t);
+        }
+    }
+
+    #[test]
+    fn default_format_to_elf() {
+        let t = Triple::from_str("riscv64").expect("can't parse target");
+        assert_eq!(
+            t.architecture,
+            Architecture::Riscv64(Riscv64Architecture::Riscv64),
+        );
+        assert_eq!(t.vendor, Vendor::Unknown);
+        assert_eq!(t.operating_system, OperatingSystem::Unknown);
+        assert_eq!(t.environment, Environment::Unknown);
+        assert_eq!(t.binary_format, BinaryFormat::Elf);
+    }
+
+    #[test]
+    fn thumbv7em_none_eabihf() {
+        let t = Triple::from_str("thumbv7em-none-eabihf").expect("can't parse target");
+        assert_eq!(
+            t.architecture,
+            Architecture::Arm(ArmArchitecture::Thumbv7em)
+        );
+        assert_eq!(t.vendor, Vendor::Unknown);
+        assert_eq!(t.operating_system, OperatingSystem::None_);
+        assert_eq!(t.environment, Environment::Eabihf);
+        assert_eq!(t.binary_format, BinaryFormat::Elf);
+    }
+
+    #[test]
+    fn fuchsia_rename() {
+        // Fuchsia targets were renamed to add the `unknown`.
+        assert_eq!(
+            Triple::from_str("aarch64-fuchsia"),
+            Triple::from_str("aarch64-unknown-fuchsia")
+        );
+        assert_eq!(
+            Triple::from_str("x86_64-fuchsia"),
+            Triple::from_str("x86_64-unknown-fuchsia")
+        );
+    }
+
+    #[test]
+    fn custom_vendors() {
+        // Test various invalid cases.
+        assert!(Triple::from_str("x86_64--linux").is_err());
+        assert!(Triple::from_str("x86_64-42-linux").is_err());
+        assert!(Triple::from_str("x86_64-__customvendor__-linux").is_err());
+        assert!(Triple::from_str("x86_64-^-linux").is_err());
+        assert!(Triple::from_str("x86_64- -linux").is_err());
+        assert!(Triple::from_str("x86_64-CustomVendor-linux").is_err());
+        assert!(Triple::from_str("x86_64-linux-linux").is_err());
+        assert!(Triple::from_str("x86_64-x86_64-linux").is_err());
+        assert!(Triple::from_str("x86_64-elf-linux").is_err());
+        assert!(Triple::from_str("x86_64-gnu-linux").is_err());
+        assert!(Triple::from_str("x86_64-linux-customvendor").is_err());
+        assert!(Triple::from_str("customvendor").is_err());
+        assert!(Triple::from_str("customvendor-x86_64").is_err());
+        assert!(Triple::from_str("x86_64-").is_err());
+        assert!(Triple::from_str("x86_64--").is_err());
+
+        // Test various Unicode things.
+        assert!(
+            Triple::from_str("x86_64-𝓬𝓾𝓼𝓽𝓸𝓶𝓿𝓮𝓷𝓭𝓸𝓻-linux").is_err(),
+            "unicode font hazard"
+        );
+        assert!(
+            Triple::from_str("x86_64-ćúśtőḿvéńdőŕ-linux").is_err(),
+            "diacritical mark stripping hazard"
+        );
+        assert!(
+            Triple::from_str("x86_64-customvendοr-linux").is_err(),
+            "homoglyph hazard"
+        );
+        assert!(Triple::from_str("x86_64-customvendor-linux").is_ok());
+        assert!(
+            Triple::from_str("x86_64-ﬃ-linux").is_err(),
+            "normalization hazard"
+        );
+        assert!(Triple::from_str("x86_64-ffi-linux").is_ok());
+        assert!(
+            Triple::from_str("x86_64-custom‍vendor-linux").is_err(),
+            "zero-width character hazard"
+        );
+        assert!(
+            Triple::from_str("x86_64-﻿customvendor-linux").is_err(),
+            "BOM hazard"
+        );
+
+        // Test some valid cases.
+        let t = Triple::from_str("x86_64-customvendor-linux")
+            .expect("can't parse target with custom vendor");
+        assert_eq!(t.architecture, Architecture::X86_64);
+        assert_eq!(
+            t.vendor,
+            Vendor::Custom(CustomVendor::Static("customvendor"))
+        );
+        assert_eq!(t.operating_system, OperatingSystem::Linux);
+        assert_eq!(t.environment, Environment::Unknown);
+        assert_eq!(t.binary_format, BinaryFormat::Elf);
+        assert_eq!(t.to_string(), "x86_64-customvendor-linux");
+
+        let t =
+            Triple::from_str("x86_64-customvendor").expect("can't parse target with custom vendor");
+        assert_eq!(t.architecture, Architecture::X86_64);
+        assert_eq!(
+            t.vendor,
+            Vendor::Custom(CustomVendor::Static("customvendor"))
+        );
+        assert_eq!(t.operating_system, OperatingSystem::Unknown);
+        assert_eq!(t.environment, Environment::Unknown);
+        assert_eq!(t.binary_format, BinaryFormat::Elf);
+
+        assert_eq!(
+            Triple::from_str("unknown-foo"),
+            Ok(Triple {
+                architecture: Architecture::Unknown,
+                vendor: Vendor::Custom(CustomVendor::Static("foo")),
+                operating_system: OperatingSystem::Unknown,
+                environment: Environment::Unknown,
+                binary_format: BinaryFormat::Unknown,
+            })
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/target-lexicon/src/triple.rs 43.0.0-1ubuntu1/rust-vendor/target-lexicon/src/triple.rs
--- 43.0.0-1/rust-vendor/target-lexicon/src/triple.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/target-lexicon/src/triple.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,554 @@
+// This file defines the `Triple` type and support code shared by all targets.
+
+use crate::data_model::CDataModel;
+use crate::parse_error::ParseError;
+use crate::targets::{
+    default_binary_format, Architecture, ArmArchitecture, BinaryFormat, Environment,
+    OperatingSystem, Riscv32Architecture, Vendor,
+};
+#[cfg(not(feature = "std"))]
+use alloc::borrow::ToOwned;
+use core::fmt;
+use core::str::FromStr;
+
+/// The target memory endianness.
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+#[allow(missing_docs)]
+pub enum Endianness {
+    Little,
+    Big,
+}
+
+/// The width of a pointer (in the default address space).
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+#[allow(missing_docs)]
+pub enum PointerWidth {
+    U16,
+    U32,
+    U64,
+}
+
+impl PointerWidth {
+    /// Return the number of bits in a pointer.
+    pub fn bits(self) -> u8 {
+        match self {
+            PointerWidth::U16 => 16,
+            PointerWidth::U32 => 32,
+            PointerWidth::U64 => 64,
+        }
+    }
+
+    /// Return the number of bytes in a pointer.
+    ///
+    /// For these purposes, there are 8 bits in a byte.
+    pub fn bytes(self) -> u8 {
+        match self {
+            PointerWidth::U16 => 2,
+            PointerWidth::U32 => 4,
+            PointerWidth::U64 => 8,
+        }
+    }
+}
+
+/// The calling convention, which specifies things like which registers are
+/// used for passing arguments, which registers are callee-saved, and so on.
+#[cfg_attr(feature = "rust_1_40", non_exhaustive)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+pub enum CallingConvention {
+    /// "System V", which is used on most Unix-like platfoms. Note that the
+    /// specific conventions vary between hardware architectures; for example,
+    /// x86-32's "System V" is entirely different from x86-64's "System V".
+    SystemV,
+
+    /// The WebAssembly C ABI.
+    /// https://github.com/WebAssembly/tool-conventions/blob/master/BasicCABI.md
+    WasmBasicCAbi,
+
+    /// "Windows Fastcall", which is used on Windows. Note that like "System V",
+    /// this varies between hardware architectures. On x86-32 it describes what
+    /// Windows documentation calls "fastcall", and on x86-64 it describes what
+    /// Windows documentation often just calls the Windows x64 calling convention
+    /// (though the compiler still recognizes "fastcall" as an alias for it).
+    WindowsFastcall,
+
+    /// Apple Aarch64 platforms use their own variant of the common Aarch64
+    /// calling convention.
+    ///
+    /// <https://developer.apple.com/documentation/xcode/writing_arm64_code_for_apple_platforms>
+    AppleAarch64,
+}
+
+/// A target "triple". Historically such things had three fields, though they've
+/// added additional fields over time.
+///
+/// Note that `Triple` doesn't implement `Default` itself. If you want a type
+/// which defaults to the host triple, or defaults to unknown-unknown-unknown,
+/// use `DefaultToHost` or `DefaultToUnknown`, respectively.
+#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+pub struct Triple {
+    /// The "architecture" (and sometimes the subarchitecture).
+    pub architecture: Architecture,
+    /// The "vendor" (whatever that means).
+    pub vendor: Vendor,
+    /// The "operating system" (sometimes also the environment).
+    pub operating_system: OperatingSystem,
+    /// The "environment" on top of the operating system (often omitted for
+    /// operating systems with a single predominant environment).
+    pub environment: Environment,
+    /// The "binary format" (rarely used).
+    pub binary_format: BinaryFormat,
+}
+
+impl Triple {
+    /// Return the endianness of this target's architecture.
+    pub fn endianness(&self) -> Result<Endianness, ()> {
+        self.architecture.endianness()
+    }
+
+    /// Return the pointer width of this target's architecture.
+    ///
+    /// This function is aware of x32 and ilp32 ABIs on 64-bit architectures.
+    pub fn pointer_width(&self) -> Result<PointerWidth, ()> {
+        // Some ABIs have a different pointer width than the CPU architecture.
+        match self.environment {
+            Environment::Gnux32 | Environment::GnuIlp32 => return Ok(PointerWidth::U32),
+            _ => {}
+        }
+
+        self.architecture.pointer_width()
+    }
+
+    /// Return the default calling convention for the given target triple.
+    pub fn default_calling_convention(&self) -> Result<CallingConvention, ()> {
+        Ok(match self.operating_system {
+            OperatingSystem::Darwin
+            | OperatingSystem::Ios
+            | OperatingSystem::Tvos
+            | OperatingSystem::MacOSX { .. }
+            | OperatingSystem::Watchos => match self.architecture {
+                Architecture::Aarch64(_) => CallingConvention::AppleAarch64,
+                _ => CallingConvention::SystemV,
+            },
+            OperatingSystem::Aix
+            | OperatingSystem::Bitrig
+            | OperatingSystem::Cloudabi
+            | OperatingSystem::Dragonfly
+            | OperatingSystem::Freebsd
+            | OperatingSystem::Fuchsia
+            | OperatingSystem::Haiku
+            | OperatingSystem::Hermit
+            | OperatingSystem::Hurd
+            | OperatingSystem::L4re
+            | OperatingSystem::Linux
+            | OperatingSystem::Netbsd
+            | OperatingSystem::Openbsd
+            | OperatingSystem::Redox
+            | OperatingSystem::Solaris => CallingConvention::SystemV,
+            OperatingSystem::Windows => CallingConvention::WindowsFastcall,
+            OperatingSystem::Nebulet
+            | OperatingSystem::Emscripten
+            | OperatingSystem::Wasi
+            | OperatingSystem::Unknown => match self.architecture {
+                Architecture::Wasm32 => CallingConvention::WasmBasicCAbi,
+                _ => return Err(()),
+            },
+            _ => return Err(()),
+        })
+    }
+
+    /// The C data model for a given target. If the model is not known, returns `Err(())`.
+    pub fn data_model(&self) -> Result<CDataModel, ()> {
+        match self.pointer_width()? {
+            PointerWidth::U64 => {
+                if self.operating_system == OperatingSystem::Windows {
+                    Ok(CDataModel::LLP64)
+                } else if self.default_calling_convention() == Ok(CallingConvention::SystemV)
+                    || self.architecture == Architecture::Wasm64
+                    || self.default_calling_convention() == Ok(CallingConvention::AppleAarch64)
+                {
+                    Ok(CDataModel::LP64)
+                } else {
+                    Err(())
+                }
+            }
+            PointerWidth::U32 => {
+                if self.operating_system == OperatingSystem::Windows
+                    || self.default_calling_convention() == Ok(CallingConvention::SystemV)
+                    || self.architecture == Architecture::Wasm32
+                {
+                    Ok(CDataModel::ILP32)
+                } else {
+                    Err(())
+                }
+            }
+            // TODO: on 16-bit machines there is usually a distinction
+            // between near-pointers and far-pointers.
+            // Additionally, code pointers sometimes have a different size than data pointers.
+            // We don't handle this case.
+            PointerWidth::U16 => Err(()),
+        }
+    }
+
+    /// Return a `Triple` with all unknown fields.
+    pub fn unknown() -> Self {
+        Self {
+            architecture: Architecture::Unknown,
+            vendor: Vendor::Unknown,
+            operating_system: OperatingSystem::Unknown,
+            environment: Environment::Unknown,
+            binary_format: BinaryFormat::Unknown,
+        }
+    }
+}
+
+impl fmt::Display for Triple {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        if let Some(res) = self.special_case_display(f) {
+            return res;
+        }
+
+        let implied_binary_format = default_binary_format(&self);
+
+        write!(f, "{}", self.architecture)?;
+        if self.vendor == Vendor::Unknown
+            && (self.environment != Environment::HermitKernel
+                && self.environment != Environment::LinuxKernel)
+            && ((self.operating_system == OperatingSystem::Linux
+                && (self.environment == Environment::Android
+                    || self.environment == Environment::Androideabi
+                    || self.environment == Environment::Kernel))
+                || self.operating_system == OperatingSystem::Wasi
+                || self.operating_system == OperatingSystem::WasiP1
+                || self.operating_system == OperatingSystem::WasiP2
+                || (self.operating_system == OperatingSystem::None_
+                    && (self.architecture == Architecture::Arm(ArmArchitecture::Armv4t)
+                        || self.architecture == Architecture::Arm(ArmArchitecture::Armv5te)
+                        || self.architecture == Architecture::Arm(ArmArchitecture::Armebv7r)
+                        || self.architecture == Architecture::Arm(ArmArchitecture::Armv7a)
+                        || self.architecture == Architecture::Arm(ArmArchitecture::Armv7r)
+                        || self.architecture == Architecture::Arm(ArmArchitecture::Armv8r)
+                        || self.architecture == Architecture::Arm(ArmArchitecture::Thumbv4t)
+                        || self.architecture == Architecture::Arm(ArmArchitecture::Thumbv5te)
+                        || self.architecture == Architecture::Arm(ArmArchitecture::Thumbv6m)
+                        || self.architecture == Architecture::Arm(ArmArchitecture::Thumbv7em)
+                        || self.architecture == Architecture::Arm(ArmArchitecture::Thumbv7m)
+                        || self.architecture == Architecture::Arm(ArmArchitecture::Thumbv8mBase)
+                        || self.architecture == Architecture::Arm(ArmArchitecture::Thumbv8mMain)
+                        || self.architecture == Architecture::Msp430)))
+        {
+            // As a special case, omit the vendor for Android, Wasi, and sometimes
+            // None_, depending on the hardware architecture. This logic is entirely
+            // ad-hoc, and is just sufficient to handle the current set of recognized
+            // triples.
+            write!(f, "-{}", self.operating_system)?;
+        } else if self.architecture.is_clever() && self.operating_system == OperatingSystem::Unknown
+        {
+            write!(f, "-{}", self.vendor)?;
+        } else {
+            write!(f, "-{}-{}", self.vendor, self.operating_system)?;
+        }
+
+        match (&self.vendor, self.operating_system, self.environment) {
+            (Vendor::Nintendo, OperatingSystem::Horizon, Environment::Newlib)
+            | (Vendor::Espressif, OperatingSystem::Espidf, Environment::Newlib) => {
+                // The triple representations of these platforms don't have an environment field.
+            }
+            (_, _, Environment::Unknown) => {
+                // Don't print out the environment if it is unknown.
+            }
+            _ => {
+                write!(f, "-{}", self.environment)?;
+            }
+        }
+
+        if self.binary_format != implied_binary_format || show_binary_format_with_no_os(self) {
+            // As a special case, omit a non-default binary format for some
+            // targets which happen to exclude it.
+            write!(f, "-{}", self.binary_format)?;
+        }
+        Ok(())
+    }
+}
+
+fn show_binary_format_with_no_os(triple: &Triple) -> bool {
+    if triple.binary_format == BinaryFormat::Unknown {
+        return false;
+    }
+
+    #[cfg(feature = "arch_zkasm")]
+    {
+        if triple.architecture == Architecture::ZkAsm {
+            return false;
+        }
+    }
+
+    triple.environment != Environment::Eabi
+        && triple.environment != Environment::Eabihf
+        && triple.environment != Environment::Sgx
+        && triple.architecture != Architecture::Avr
+        && triple.architecture != Architecture::Wasm32
+        && triple.architecture != Architecture::Wasm64
+        && (triple.operating_system == OperatingSystem::None_
+            || triple.operating_system == OperatingSystem::Unknown)
+}
+
+impl FromStr for Triple {
+    type Err = ParseError;
+
+    fn from_str(s: &str) -> Result<Self, Self::Err> {
+        if let Some(triple) = Triple::special_case_from_str(s) {
+            return Ok(triple);
+        }
+
+        let mut parts = s.split('-');
+        let mut result = Self::unknown();
+        let mut current_part;
+
+        current_part = parts.next();
+        if let Some(s) = current_part {
+            if let Ok(architecture) = Architecture::from_str(s) {
+                result.architecture = architecture;
+                current_part = parts.next();
+            } else {
+                // Insist that the triple start with a valid architecture.
+                return Err(ParseError::UnrecognizedArchitecture(s.to_owned()));
+            }
+        }
+
+        let mut has_vendor = false;
+        let mut has_operating_system = false;
+        if let Some(s) = current_part {
+            if let Ok(vendor) = Vendor::from_str(s) {
+                has_vendor = true;
+                result.vendor = vendor;
+                current_part = parts.next();
+            }
+        }
+
+        if !has_operating_system {
+            if let Some(s) = current_part {
+                if let Ok(operating_system) = OperatingSystem::from_str(s) {
+                    has_operating_system = true;
+                    result.operating_system = operating_system;
+                    current_part = parts.next();
+                }
+            }
+        }
+
+        let mut has_environment = false;
+
+        if !has_environment {
+            if let Some(s) = current_part {
+                if let Ok(environment) = Environment::from_str(s) {
+                    has_environment = true;
+                    result.environment = environment;
+                    current_part = parts.next();
+                }
+            }
+        }
+
+        let mut has_binary_format = false;
+        if let Some(s) = current_part {
+            if let Ok(binary_format) = BinaryFormat::from_str(s) {
+                has_binary_format = true;
+                result.binary_format = binary_format;
+                current_part = parts.next();
+            }
+        }
+
+        // The binary format is frequently omitted; if that's the case here,
+        // infer it from the other fields.
+        if !has_binary_format {
+            result.binary_format = default_binary_format(&result);
+        }
+
+        if let Some(s) = current_part {
+            Err(
+                if !has_vendor && !has_operating_system && !has_environment && !has_binary_format {
+                    ParseError::UnrecognizedVendor(s.to_owned())
+                } else if !has_operating_system && !has_environment && !has_binary_format {
+                    ParseError::UnrecognizedOperatingSystem(s.to_owned())
+                } else if !has_environment && !has_binary_format {
+                    ParseError::UnrecognizedEnvironment(s.to_owned())
+                } else if !has_binary_format {
+                    ParseError::UnrecognizedBinaryFormat(s.to_owned())
+                } else {
+                    ParseError::UnrecognizedField(s.to_owned())
+                },
+            )
+        } else {
+            Ok(result)
+        }
+    }
+}
+
+impl Triple {
+    /// Handle special cases in the `Display` implementation.
+    fn special_case_display(&self, f: &mut fmt::Formatter) -> Option<fmt::Result> {
+        let res = match self {
+            Triple {
+                architecture: Architecture::Arm(ArmArchitecture::Armv6k),
+                vendor: Vendor::Nintendo,
+                operating_system: OperatingSystem::Horizon,
+                ..
+            } => write!(f, "{}-{}-3ds", self.architecture, self.vendor),
+            Triple {
+                architecture: Architecture::Riscv32(Riscv32Architecture::Riscv32imc),
+                vendor: Vendor::Espressif,
+                operating_system: OperatingSystem::Espidf,
+                ..
+            } => write!(f, "{}-esp-{}", self.architecture, self.operating_system),
+            _ => return None,
+        };
+        Some(res)
+    }
+
+    /// Handle special cases in the `FromStr` implementation.
+    fn special_case_from_str(s: &str) -> Option<Self> {
+        let mut triple = Triple::unknown();
+
+        match s {
+            "armv6k-nintendo-3ds" => {
+                triple.architecture = Architecture::Arm(ArmArchitecture::Armv6k);
+                triple.vendor = Vendor::Nintendo;
+                triple.operating_system = OperatingSystem::Horizon;
+                triple.environment = Environment::Newlib;
+                triple.binary_format = default_binary_format(&triple);
+            }
+            "riscv32imc-esp-espidf" => {
+                triple.architecture = Architecture::Riscv32(Riscv32Architecture::Riscv32imc);
+                triple.vendor = Vendor::Espressif;
+                triple.operating_system = OperatingSystem::Espidf;
+                triple.environment = Environment::Newlib;
+                triple.binary_format = default_binary_format(&triple);
+            }
+            _ => return None,
+        }
+
+        Some(triple)
+    }
+}
+
+/// A convenient syntax for triple literals.
+///
+/// This currently expands to code that just calls `Triple::from_str` and does
+/// an `expect`, though in the future it would be cool to use procedural macros
+/// or so to report errors at compile time instead.
+#[macro_export]
+macro_rules! triple {
+    ($str:tt) => {
+        <$crate::Triple as core::str::FromStr>::from_str($str).expect("invalid triple literal")
+    };
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn parse_errors() {
+        assert_eq!(
+            Triple::from_str(""),
+            Err(ParseError::UnrecognizedArchitecture("".to_owned()))
+        );
+        assert_eq!(
+            Triple::from_str("foo"),
+            Err(ParseError::UnrecognizedArchitecture("foo".to_owned()))
+        );
+        assert_eq!(
+            Triple::from_str("unknown-unknown-foo"),
+            Err(ParseError::UnrecognizedOperatingSystem("foo".to_owned()))
+        );
+        assert_eq!(
+            Triple::from_str("unknown-unknown-unknown-foo"),
+            Err(ParseError::UnrecognizedEnvironment("foo".to_owned()))
+        );
+        assert_eq!(
+            Triple::from_str("unknown-unknown-unknown-unknown-foo"),
+            Err(ParseError::UnrecognizedBinaryFormat("foo".to_owned()))
+        );
+        assert_eq!(
+            Triple::from_str("unknown-unknown-unknown-unknown-unknown-foo"),
+            Err(ParseError::UnrecognizedField("foo".to_owned()))
+        );
+    }
+
+    #[test]
+    fn defaults() {
+        assert_eq!(
+            Triple::from_str("unknown-unknown-unknown"),
+            Ok(Triple::unknown())
+        );
+        assert_eq!(
+            Triple::from_str("unknown-unknown-unknown-unknown"),
+            Ok(Triple::unknown())
+        );
+        assert_eq!(
+            Triple::from_str("unknown-unknown-unknown-unknown-unknown"),
+            Ok(Triple::unknown())
+        );
+    }
+
+    #[test]
+    fn unknown_properties() {
+        assert_eq!(Triple::unknown().endianness(), Err(()));
+        assert_eq!(Triple::unknown().pointer_width(), Err(()));
+        assert_eq!(Triple::unknown().default_calling_convention(), Err(()));
+    }
+
+    #[test]
+    fn apple_calling_convention() {
+        for triple in &[
+            "aarch64-apple-darwin",
+            "aarch64-apple-ios",
+            "aarch64-apple-ios-macabi",
+            "aarch64-apple-tvos",
+            "aarch64-apple-watchos",
+        ] {
+            let triple = Triple::from_str(triple).unwrap();
+            assert_eq!(
+                triple.default_calling_convention().unwrap(),
+                CallingConvention::AppleAarch64
+            );
+            assert_eq!(triple.data_model().unwrap(), CDataModel::LP64);
+        }
+
+        for triple in &["aarch64-linux-android", "x86_64-apple-ios"] {
+            assert_eq!(
+                Triple::from_str(triple)
+                    .unwrap()
+                    .default_calling_convention()
+                    .unwrap(),
+                CallingConvention::SystemV
+            );
+        }
+    }
+
+    #[test]
+    fn p32_abi() {
+        // Test that special 32-bit pointer ABIs on 64-bit architectures are
+        // reported as having 32-bit pointers.
+        for triple in &[
+            "x86_64-unknown-linux-gnux32",
+            "aarch64_be-unknown-linux-gnu_ilp32",
+            "aarch64-unknown-linux-gnu_ilp32",
+        ] {
+            assert_eq!(
+                Triple::from_str(triple).unwrap().pointer_width().unwrap(),
+                PointerWidth::U32
+            );
+        }
+
+        // Test that the corresponding ABIs have 64-bit pointers.
+        for triple in &[
+            "x86_64-unknown-linux-gnu",
+            "aarch64_be-unknown-linux-gnu",
+            "aarch64-unknown-linux-gnu",
+        ] {
+            assert_eq!(
+                Triple::from_str(triple).unwrap().pointer_width().unwrap(),
+                PointerWidth::U64
+            );
+        }
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/unicode-ident/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/unicode-ident/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/unicode-ident/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unicode-ident/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"Cargo.toml":"7b10355305359d5feefb120329396a8823ce903cd66612d7d27612d51e6ceced","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","LICENSE-UNICODE":"68f5b9f5ea36881a0942ba02f558e9e1faf76cc09cb165ad801744c61b738844","README.md":"eff1f30712e93cc160101c25bf31738448c284b90636deb3e3a651cb9ad20dd1","benches/xid.rs":"a61f61ecc7d5124c759cdeb55ab74470ab69f2f3ca37613da65f16e0e5e33487","src/lib.rs":"2673969775cff349816e3fb30f62476a802523fe4940482288b75bd747cbe748","src/tables.rs":"ffe8e252eabccf261385865cb781b3d76c9f32f6f9503d00196a30fb92d80b29","tests/compare.rs":"62471ffb157744cac6faae1adafdbdf785349d7eb6dc2ff4b4941c9d618397f9","tests/fst/mod.rs":"69a3aaf59acd8bca962ecc6234be56be8c0934ab79b253162f10eb881523901f","tests/fst/xid_continue.fst":"41fc751514b8bde658544d5fe7e100115d299d41897af855934b9f4ebda9d3a2","tests/fst/xid_start.fst":"ffa5e2bfe7dd5f6738fbe4b7a3e6e2083c9777191c54f8291a80d558ec4e2dd2","tests/roaring/mod.rs":"784f65a48477fab7549620c7843c7ad6da533f69a18abca1172f6acb95045e53","tests/static_size.rs":"4524332c1e424cb987d7cee1f47a98aea9ed7b256303a3828eda5aa1d06da240","tests/tables/mod.rs":"e6949172d10fc4b2431ce7546269bfd4f9146454c8c3e31faf5e5d80c16a8ab6","tests/tables/tables.rs":"011404dab8a3958da6e18a1fe9406c191675e6f49bf30ce813e3d05f582e750b","tests/trie/mod.rs":"d4acbb716bcbaf80660039797f45e138ed8bbd66749fa3b19b1a971574679cc9","tests/trie/trie.rs":"3c1ca56062f1b3ffdf2ae2063d3fee8d362b90082778056181b5c95e2e242ad8"},"package":"3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/unicode-ident/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/unicode-ident/Cargo.toml
--- 43.0.0-1/rust-vendor/unicode-ident/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unicode-ident/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,63 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2018"
+rust-version = "1.31"
+name = "unicode-ident"
+version = "1.0.12"
+authors = ["David Tolnay <dtolnay@gmail.com>"]
+description = "Determine whether characters have the XID_Start or XID_Continue properties according to Unicode Standard Annex #31"
+documentation = "https://docs.rs/unicode-ident"
+readme = "README.md"
+keywords = [
+    "unicode",
+    "xid",
+]
+categories = [
+    "development-tools::procedural-macro-helpers",
+    "no-std",
+    "no-std::no-alloc",
+]
+license = "(MIT OR Apache-2.0) AND Unicode-DFS-2016"
+repository = "https://github.com/dtolnay/unicode-ident"
+
+[package.metadata.docs.rs]
+rustdoc-args = ["--generate-link-to-definition"]
+targets = ["x86_64-unknown-linux-gnu"]
+
+[lib]
+doc-scrape-examples = false
+
+[[bench]]
+name = "xid"
+harness = false
+
+[dev-dependencies.criterion]
+version = "0.5"
+default-features = false
+
+[dev-dependencies.fst]
+version = "0.4"
+
+[dev-dependencies.rand]
+version = "0.8"
+features = ["small_rng"]
+
+[dev-dependencies.roaring]
+version = "0.10"
+
+[dev-dependencies.ucd-trie]
+version = "0.1"
+default-features = false
+
+[dev-dependencies.unicode-xid]
+version = "0.2.4"
diff -pruN 43.0.0-1/rust-vendor/unicode-ident/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/unicode-ident/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/unicode-ident/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unicode-ident/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,176 @@
+                              Apache License
+                        Version 2.0, January 2004
+                     http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+   "License" shall mean the terms and conditions for use, reproduction,
+   and distribution as defined by Sections 1 through 9 of this document.
+
+   "Licensor" shall mean the copyright owner or entity authorized by
+   the copyright owner that is granting the License.
+
+   "Legal Entity" shall mean the union of the acting entity and all
+   other entities that control, are controlled by, or are under common
+   control with that entity. For the purposes of this definition,
+   "control" means (i) the power, direct or indirect, to cause the
+   direction or management of such entity, whether by contract or
+   otherwise, or (ii) ownership of fifty percent (50%) or more of the
+   outstanding shares, or (iii) beneficial ownership of such entity.
+
+   "You" (or "Your") shall mean an individual or Legal Entity
+   exercising permissions granted by this License.
+
+   "Source" form shall mean the preferred form for making modifications,
+   including but not limited to software source code, documentation
+   source, and configuration files.
+
+   "Object" form shall mean any form resulting from mechanical
+   transformation or translation of a Source form, including but
+   not limited to compiled object code, generated documentation,
+   and conversions to other media types.
+
+   "Work" shall mean the work of authorship, whether in Source or
+   Object form, made available under the License, as indicated by a
+   copyright notice that is included in or attached to the work
+   (an example is provided in the Appendix below).
+
+   "Derivative Works" shall mean any work, whether in Source or Object
+   form, that is based on (or derived from) the Work and for which the
+   editorial revisions, annotations, elaborations, or other modifications
+   represent, as a whole, an original work of authorship. For the purposes
+   of this License, Derivative Works shall not include works that remain
+   separable from, or merely link (or bind by name) to the interfaces of,
+   the Work and Derivative Works thereof.
+
+   "Contribution" shall mean any work of authorship, including
+   the original version of the Work and any modifications or additions
+   to that Work or Derivative Works thereof, that is intentionally
+   submitted to Licensor for inclusion in the Work by the copyright owner
+   or by an individual or Legal Entity authorized to submit on behalf of
+   the copyright owner. For the purposes of this definition, "submitted"
+   means any form of electronic, verbal, or written communication sent
+   to the Licensor or its representatives, including but not limited to
+   communication on electronic mailing lists, source code control systems,
+   and issue tracking systems that are managed by, or on behalf of, the
+   Licensor for the purpose of discussing and improving the Work, but
+   excluding communication that is conspicuously marked or otherwise
+   designated in writing by the copyright owner as "Not a Contribution."
+
+   "Contributor" shall mean Licensor and any individual or Legal Entity
+   on behalf of whom a Contribution has been received by Licensor and
+   subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   copyright license to reproduce, prepare Derivative Works of,
+   publicly display, publicly perform, sublicense, and distribute the
+   Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   (except as stated in this section) patent license to make, have made,
+   use, offer to sell, sell, import, and otherwise transfer the Work,
+   where such license applies only to those patent claims licensable
+   by such Contributor that are necessarily infringed by their
+   Contribution(s) alone or by combination of their Contribution(s)
+   with the Work to which such Contribution(s) was submitted. If You
+   institute patent litigation against any entity (including a
+   cross-claim or counterclaim in a lawsuit) alleging that the Work
+   or a Contribution incorporated within the Work constitutes direct
+   or contributory patent infringement, then any patent licenses
+   granted to You under this License for that Work shall terminate
+   as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+   Work or Derivative Works thereof in any medium, with or without
+   modifications, and in Source or Object form, provided that You
+   meet the following conditions:
+
+   (a) You must give any other recipients of the Work or
+       Derivative Works a copy of this License; and
+
+   (b) You must cause any modified files to carry prominent notices
+       stating that You changed the files; and
+
+   (c) You must retain, in the Source form of any Derivative Works
+       that You distribute, all copyright, patent, trademark, and
+       attribution notices from the Source form of the Work,
+       excluding those notices that do not pertain to any part of
+       the Derivative Works; and
+
+   (d) If the Work includes a "NOTICE" text file as part of its
+       distribution, then any Derivative Works that You distribute must
+       include a readable copy of the attribution notices contained
+       within such NOTICE file, excluding those notices that do not
+       pertain to any part of the Derivative Works, in at least one
+       of the following places: within a NOTICE text file distributed
+       as part of the Derivative Works; within the Source form or
+       documentation, if provided along with the Derivative Works; or,
+       within a display generated by the Derivative Works, if and
+       wherever such third-party notices normally appear. The contents
+       of the NOTICE file are for informational purposes only and
+       do not modify the License. You may add Your own attribution
+       notices within Derivative Works that You distribute, alongside
+       or as an addendum to the NOTICE text from the Work, provided
+       that such additional attribution notices cannot be construed
+       as modifying the License.
+
+   You may add Your own copyright statement to Your modifications and
+   may provide additional or different license terms and conditions
+   for use, reproduction, or distribution of Your modifications, or
+   for any such Derivative Works as a whole, provided Your use,
+   reproduction, and distribution of the Work otherwise complies with
+   the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+   any Contribution intentionally submitted for inclusion in the Work
+   by You to the Licensor shall be under the terms and conditions of
+   this License, without any additional terms or conditions.
+   Notwithstanding the above, nothing herein shall supersede or modify
+   the terms of any separate license agreement you may have executed
+   with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+   names, trademarks, service marks, or product names of the Licensor,
+   except as required for reasonable and customary use in describing the
+   origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+   agreed to in writing, Licensor provides the Work (and each
+   Contributor provides its Contributions) on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+   implied, including, without limitation, any warranties or conditions
+   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+   PARTICULAR PURPOSE. You are solely responsible for determining the
+   appropriateness of using or redistributing the Work and assume any
+   risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+   whether in tort (including negligence), contract, or otherwise,
+   unless required by applicable law (such as deliberate and grossly
+   negligent acts) or agreed to in writing, shall any Contributor be
+   liable to You for damages, including any direct, indirect, special,
+   incidental, or consequential damages of any character arising as a
+   result of this License or out of the use or inability to use the
+   Work (including but not limited to damages for loss of goodwill,
+   work stoppage, computer failure or malfunction, or any and all
+   other commercial damages or losses), even if such Contributor
+   has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+   the Work or Derivative Works thereof, You may choose to offer,
+   and charge a fee for, acceptance of support, warranty, indemnity,
+   or other liability obligations and/or rights consistent with this
+   License. However, in accepting such obligations, You may act only
+   on Your own behalf and on Your sole responsibility, not on behalf
+   of any other Contributor, and only if You agree to indemnify,
+   defend, and hold each Contributor harmless for any liability
+   incurred by, or claims asserted against, such Contributor by reason
+   of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
diff -pruN 43.0.0-1/rust-vendor/unicode-ident/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/unicode-ident/LICENSE-MIT
--- 43.0.0-1/rust-vendor/unicode-ident/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unicode-ident/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,23 @@
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/unicode-ident/LICENSE-UNICODE 43.0.0-1ubuntu1/rust-vendor/unicode-ident/LICENSE-UNICODE
--- 43.0.0-1/rust-vendor/unicode-ident/LICENSE-UNICODE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unicode-ident/LICENSE-UNICODE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,46 @@
+UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
+
+See Terms of Use <https://www.unicode.org/copyright.html>
+for definitions of Unicode Inc.’s Data Files and Software.
+
+NOTICE TO USER: Carefully read the following legal agreement.
+BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
+DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
+YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
+TERMS AND CONDITIONS OF THIS AGREEMENT.
+IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
+THE DATA FILES OR SOFTWARE.
+
+COPYRIGHT AND PERMISSION NOTICE
+
+Copyright © 1991-2022 Unicode, Inc. All rights reserved.
+Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Unicode data files and any associated documentation
+(the "Data Files") or Unicode software and any associated documentation
+(the "Software") to deal in the Data Files or Software
+without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, and/or sell copies of
+the Data Files or Software, and to permit persons to whom the Data Files
+or Software are furnished to do so, provided that either
+(a) this copyright and permission notice appear with all copies
+of the Data Files or Software, or
+(b) this copyright and permission notice appear in associated
+Documentation.
+
+THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
+NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
+DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THE DATA FILES OR SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale,
+use or other dealings in these Data Files or Software without prior
+written authorization of the copyright holder.
diff -pruN 43.0.0-1/rust-vendor/unicode-ident/README.md 43.0.0-1ubuntu1/rust-vendor/unicode-ident/README.md
--- 43.0.0-1/rust-vendor/unicode-ident/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unicode-ident/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,283 @@
+Unicode ident
+=============
+
+[<img alt="github" src="https://img.shields.io/badge/github-dtolnay/unicode--ident-8da0cb?style=for-the-badge&labelColor=555555&logo=github" height="20">](https://github.com/dtolnay/unicode-ident)
+[<img alt="crates.io" src="https://img.shields.io/crates/v/unicode-ident.svg?style=for-the-badge&color=fc8d62&logo=rust" height="20">](https://crates.io/crates/unicode-ident)
+[<img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-unicode--ident-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs" height="20">](https://docs.rs/unicode-ident)
+[<img alt="build status" src="https://img.shields.io/github/actions/workflow/status/dtolnay/unicode-ident/ci.yml?branch=master&style=for-the-badge" height="20">](https://github.com/dtolnay/unicode-ident/actions?query=branch%3Amaster)
+
+Implementation of [Unicode Standard Annex #31][tr31] for determining which
+`char` values are valid in programming language identifiers.
+
+[tr31]: https://www.unicode.org/reports/tr31/
+
+This crate is a better optimized implementation of the older `unicode-xid`
+crate. This crate uses less static storage, and is able to classify both ASCII
+and non-ASCII codepoints with better performance, 2&ndash;10&times; faster than
+`unicode-xid`.
+
+<br>
+
+## Comparison of performance
+
+The following table shows a comparison between five Unicode identifier
+implementations.
+
+- `unicode-ident` is this crate;
+- [`unicode-xid`] is a widely used crate run by the "unicode-rs" org;
+- `ucd-trie` and `fst` are two data structures supported by the [`ucd-generate`] tool;
+- [`roaring`] is a Rust implementation of Roaring bitmap.
+
+The *static storage* column shows the total size of `static` tables that the
+crate bakes into your binary, measured in 1000s of bytes.
+
+The remaining columns show the **cost per call** to evaluate whether a single
+`char` has the XID\_Start or XID\_Continue Unicode property, comparing across
+different ratios of ASCII to non-ASCII codepoints in the input data.
+
+[`unicode-xid`]: https://github.com/unicode-rs/unicode-xid
+[`ucd-generate`]: https://github.com/BurntSushi/ucd-generate
+[`roaring`]: https://github.com/RoaringBitmap/roaring-rs
+
+| | static storage | 0% nonascii | 1% | 10% | 100% nonascii |
+|---|---|---|---|---|---|
+| **`unicode-ident`** | 10.1 K | 0.96 ns | 0.95 ns | 1.09 ns | 1.55 ns |
+| **`unicode-xid`** | 11.5 K | 1.88 ns | 2.14 ns | 3.48 ns | 15.63 ns |
+| **`ucd-trie`** | 10.2 K | 1.29 ns | 1.28 ns | 1.36 ns | 2.15 ns |
+| **`fst`** | 139 K | 55.1 ns | 54.9 ns | 53.2 ns | 28.5 ns |
+| **`roaring`** | 66.1 K | 2.78 ns | 3.09 ns | 3.37 ns | 4.70 ns |
+
+Source code for the benchmark is provided in the *bench* directory of this repo
+and may be repeated by running `cargo criterion`.
+
+<br>
+
+## Comparison of data structures
+
+#### unicode-xid
+
+They use a sorted array of character ranges, and do a binary search to look up
+whether a given character lands inside one of those ranges.
+
+```rust
+static XID_Continue_table: [(char, char); 763] = [
+    ('\u{30}', '\u{39}'),  // 0-9
+    ('\u{41}', '\u{5a}'),  // A-Z
+    …
+    ('\u{e0100}', '\u{e01ef}'),
+];
+```
+
+The static storage used by this data structure scales with the number of
+contiguous ranges of identifier codepoints in Unicode. Every table entry
+consumes 8 bytes, because it consists of a pair of 32-bit `char` values.
+
+In some ranges of the Unicode codepoint space, this is quite a sparse
+representation &ndash; there are some ranges where tens of thousands of adjacent
+codepoints are all valid identifier characters. In other places, the
+representation is quite inefficient. A characater like `µ` (U+00B5) which is
+surrounded by non-identifier codepoints consumes 64 bits in the table, while it
+would be just 1 bit in a dense bitmap.
+
+On a system with 64-byte cache lines, binary searching the table touches 7 cache
+lines on average. Each cache line fits only 8 table entries. Additionally, the
+branching performed during the binary search is probably mostly unpredictable to
+the branch predictor.
+
+Overall, the crate ends up being about 10&times; slower on non-ASCII input
+compared to the fastest crate.
+
+A potential improvement would be to pack the table entries more compactly.
+Rust's `char` type is a 21-bit integer padded to 32 bits, which means every
+table entry is holding 22 bits of wasted space, adding up to 3.9 K. They could
+instead fit every table entry into 6 bytes, leaving out some of the padding, for
+a 25% improvement in space used. With some cleverness it may be possible to fit
+in 5 bytes or even 4 bytes by storing a low char and an extent, instead of low
+char and high char. I don't expect that performance would improve much but this
+could be the most efficient for space across all the libraries, needing only
+about 7 K to store.
+
+#### ucd-trie
+
+Their data structure is a compressed trie set specifically tailored for Unicode
+codepoints. The design is credited to Raph Levien in [rust-lang/rust#33098].
+
+[rust-lang/rust#33098]: https://github.com/rust-lang/rust/pull/33098
+
+```rust
+pub struct TrieSet {
+    tree1_level1: &'static [u64; 32],
+    tree2_level1: &'static [u8; 992],
+    tree2_level2: &'static [u64],
+    tree3_level1: &'static [u8; 256],
+    tree3_level2: &'static [u8],
+    tree3_level3: &'static [u64],
+}
+```
+
+It represents codepoint sets using a trie to achieve prefix compression. The
+final states of the trie are embedded in leaves or "chunks", where each chunk is
+a 64-bit integer. Each bit position of the integer corresponds to whether a
+particular codepoint is in the set or not. These chunks are not just a compact
+representation of the final states of the trie, but are also a form of suffix
+compression. In particular, if multiple ranges of 64 contiguous codepoints have
+the same Unicode properties, then they all map to the same chunk in the final
+level of the trie.
+
+Being tailored for Unicode codepoints, this trie is partitioned into three
+disjoint sets: tree1, tree2, tree3. The first set corresponds to codepoints \[0,
+0x800), the second \[0x800, 0x10000) and the third \[0x10000, 0x110000). These
+partitions conveniently correspond to the space of 1 or 2 byte UTF-8 encoded
+codepoints, 3 byte UTF-8 encoded codepoints and 4 byte UTF-8 encoded codepoints,
+respectively.
+
+Lookups in this data structure are significantly more efficient than binary
+search. A lookup touches either 1, 2, or 3 cache lines based on which of the
+trie partitions is being accessed.
+
+One possible performance improvement would be for this crate to expose a way to
+query based on a UTF-8 encoded string, returning the Unicode property
+corresponding to the first character in the string. Without such an API, the
+caller is required to tokenize their UTF-8 encoded input data into `char`, hand
+the `char` into `ucd-trie`, only for `ucd-trie` to undo that work by converting
+back into the variable-length representation for trie traversal.
+
+#### fst
+
+Uses a [finite state transducer][fst]. This representation is built into
+[ucd-generate] but I am not aware of any advantage over the `ucd-trie`
+representation. In particular `ucd-trie` is optimized for storing Unicode
+properties while `fst` is not.
+
+[fst]: https://github.com/BurntSushi/fst
+[ucd-generate]: https://github.com/BurntSushi/ucd-generate
+
+As far as I can tell, the main thing that causes `fst` to have large size and
+slow lookups for this use case relative to `ucd-trie` is that it does not
+specialize for the fact that only 21 of the 32 bits in a `char` are meaningful.
+There are some dense arrays in the structure with large ranges that could never
+possibly be used.
+
+#### roaring
+
+This crate is a pure-Rust implementation of [Roaring Bitmap], a data structure
+designed for storing sets of 32-bit unsigned integers.
+
+[Roaring Bitmap]: https://roaringbitmap.org/about/
+
+Roaring bitmaps are compressed bitmaps which tend to outperform conventional
+compressed bitmaps such as WAH, EWAH or Concise. In some instances, they can be
+hundreds of times faster and they often offer significantly better compression.
+
+In this use case the performance was reasonably competitive but still
+substantially slower than the Unicode-optimized crates. Meanwhile the
+compression was significantly worse, requiring 6&times; as much storage for the
+data structure.
+
+I also benchmarked the [`croaring`] crate which is an FFI wrapper around the C
+reference implementation of Roaring Bitmap. This crate was consistently about
+15% slower than pure-Rust `roaring`, which could just be FFI overhead. I did not
+investigate further.
+
+[`croaring`]: https://crates.io/crates/croaring
+
+#### unicode-ident
+
+This crate is most similar to the `ucd-trie` library, in that it's based on
+bitmaps stored in the leafs of a trie representation, achieving both prefix
+compression and suffix compression.
+
+The key differences are:
+
+- Uses a single 2-level trie, rather than 3 disjoint partitions of different
+  depth each.
+- Uses significantly larger chunks: 512 bits rather than 64 bits.
+- Compresses the XID\_Start and XID\_Continue properties together
+  simultaneously, rather than duplicating identical trie leaf chunks across the
+  two.
+
+The following diagram show the XID\_Start and XID\_Continue Unicode boolean
+properties in uncompressed form, in row-major order:
+
+<table>
+<tr><th>XID_Start</th><th>XID_Continue</th></tr>
+<tr>
+<td><img alt="XID_Start bitmap" width="256" src="https://user-images.githubusercontent.com/1940490/168647353-c6eeb922-afec-49b2-9ef5-c03e9d1e0760.png"></td>
+<td><img alt="XID_Continue bitmap" width="256" src="https://user-images.githubusercontent.com/1940490/168647367-f447cca7-2362-4d7d-8cd7-d21c011d329b.png"></td>
+</tr>
+</table>
+
+Uncompressed, these would take 140 K to store, which is beyond what would be
+reasonable. However, as you can see there is a large degree of similarity
+between the two bitmaps and across the rows, which lends well to compression.
+
+This crate stores one 512-bit "row" of the above bitmaps in the leaf level of a
+trie, and a single additional level to index into the leafs. It turns out there
+are 124 unique 512-bit chunks across the two bitmaps so 7 bits are sufficient to
+index them.
+
+The chunk size of 512 bits is selected as the size that minimizes the total size
+of the data structure. A smaller chunk, like 256 or 128 bits, would achieve
+better deduplication but require a larger index. A larger chunk would increase
+redundancy in the leaf bitmaps. 512 bit chunks are the optimum for total size of
+the index plus leaf bitmaps.
+
+In fact since there are only 124 unique chunks, we can use an 8-bit index with a
+spare bit to index at the half-chunk level. This achieves an additional 8.5%
+compression by eliminating redundancies between the second half of any chunk and
+the first half of any other chunk. Note that this is not the same as using
+chunks which are half the size, because it does not necessitate raising the size
+of the trie's first level.
+
+In contrast to binary search or the `ucd-trie` crate, performing lookups in this
+data structure is straight-line code with no need for branching.
+
+```asm
+is_xid_start:
+	mov eax, edi
+	shr eax, 9
+	lea rcx, [rip + unicode_ident::tables::TRIE_START]
+	add rcx, rax
+	xor eax, eax
+	cmp edi, 201728
+	cmovb rax, rcx
+	test rax, rax
+	lea rcx, [rip + .L__unnamed_1]
+	cmovne rcx, rax
+	movzx eax, byte ptr [rcx]
+	shl rax, 5
+	mov ecx, edi
+	shr ecx, 3
+	and ecx, 63
+	add rcx, rax
+	lea rax, [rip + unicode_ident::tables::LEAF]
+	mov al, byte ptr [rax + rcx]
+	and dil, 7
+	mov ecx, edi
+	shr al, cl
+	and al, 1
+	ret
+```
+
+<br>
+
+## License
+
+Use of the Unicode Character Database, as this crate does, is governed by the <a
+href="LICENSE-UNICODE">Unicode License Agreement &ndash; Data Files and Software
+(2016)</a>.
+
+All intellectual property within this crate that is **not generated** using the
+Unicode Character Database as input is licensed under either of <a
+href="LICENSE-APACHE">Apache License, Version 2.0</a> or <a
+href="LICENSE-MIT">MIT license</a> at your option.
+
+The **generated** files incorporate tabular data derived from the Unicode
+Character Database, together with intellectual property from the original source
+code content of the crate. One must comply with the terms of both the Unicode
+License Agreement and either of the Apache license or MIT license when those
+generated files are involved.
+
+Unless you explicitly state otherwise, any contribution intentionally submitted
+for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
+be licensed as just described, without any additional terms or conditions.
diff -pruN 43.0.0-1/rust-vendor/unicode-ident/benches/xid.rs 43.0.0-1ubuntu1/rust-vendor/unicode-ident/benches/xid.rs
--- 43.0.0-1/rust-vendor/unicode-ident/benches/xid.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unicode-ident/benches/xid.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,124 @@
+// To run:
+//
+//     cargo criterion --features criterion/real_blackbox
+//
+// This benchmarks each of the different libraries at several ratios of ASCII to
+// non-ASCII content. There is one additional benchmark labeled "baseline" which
+// just iterates over characters in a string, converting UTF-8 to 32-bit chars.
+//
+// Criterion will show a time in milliseconds. The non-baseline bench functions
+// each make one million function calls (2 calls per character, 500K characters
+// in the strings created by gen_string). The "time per call" listed in our
+// readme is computed by subtracting this baseline from the other bench
+// functions' time, then dividing by one million (ms -> ns).
+
+#![allow(clippy::needless_pass_by_value)]
+
+#[path = "../tests/fst/mod.rs"]
+mod fst;
+#[path = "../tests/roaring/mod.rs"]
+mod roaring;
+#[path = "../tests/trie/mod.rs"]
+mod trie;
+
+use criterion::{black_box, criterion_group, criterion_main, Criterion};
+use rand::distributions::{Bernoulli, Distribution, Uniform};
+use rand::rngs::SmallRng;
+use rand::SeedableRng;
+use std::time::Duration;
+
+fn gen_string(p_nonascii: u32) -> String {
+    let mut rng = SmallRng::from_seed([b'!'; 32]);
+    let pick_nonascii = Bernoulli::from_ratio(p_nonascii, 100).unwrap();
+    let ascii = Uniform::new_inclusive('\0', '\x7f');
+    let nonascii = Uniform::new_inclusive(0x80 as char, char::MAX);
+
+    let mut string = String::new();
+    for _ in 0..500_000 {
+        let distribution = if pick_nonascii.sample(&mut rng) {
+            nonascii
+        } else {
+            ascii
+        };
+        string.push(distribution.sample(&mut rng));
+    }
+
+    string
+}
+
+fn bench(c: &mut Criterion, group_name: &str, string: String) {
+    let mut group = c.benchmark_group(group_name);
+    group.measurement_time(Duration::from_secs(10));
+    group.bench_function("baseline", |b| {
+        b.iter(|| {
+            for ch in string.chars() {
+                black_box(ch);
+            }
+        });
+    });
+    group.bench_function("unicode-ident", |b| {
+        b.iter(|| {
+            for ch in string.chars() {
+                black_box(unicode_ident::is_xid_start(ch));
+                black_box(unicode_ident::is_xid_continue(ch));
+            }
+        });
+    });
+    group.bench_function("unicode-xid", |b| {
+        b.iter(|| {
+            for ch in string.chars() {
+                black_box(unicode_xid::UnicodeXID::is_xid_start(ch));
+                black_box(unicode_xid::UnicodeXID::is_xid_continue(ch));
+            }
+        });
+    });
+    group.bench_function("ucd-trie", |b| {
+        b.iter(|| {
+            for ch in string.chars() {
+                black_box(trie::XID_START.contains_char(ch));
+                black_box(trie::XID_CONTINUE.contains_char(ch));
+            }
+        });
+    });
+    group.bench_function("fst", |b| {
+        let xid_start_fst = fst::xid_start_fst();
+        let xid_continue_fst = fst::xid_continue_fst();
+        b.iter(|| {
+            for ch in string.chars() {
+                let ch_bytes = (ch as u32).to_be_bytes();
+                black_box(xid_start_fst.contains(ch_bytes));
+                black_box(xid_continue_fst.contains(ch_bytes));
+            }
+        });
+    });
+    group.bench_function("roaring", |b| {
+        let xid_start_bitmap = roaring::xid_start_bitmap();
+        let xid_continue_bitmap = roaring::xid_continue_bitmap();
+        b.iter(|| {
+            for ch in string.chars() {
+                black_box(xid_start_bitmap.contains(ch as u32));
+                black_box(xid_continue_bitmap.contains(ch as u32));
+            }
+        });
+    });
+    group.finish();
+}
+
+fn bench0(c: &mut Criterion) {
+    bench(c, "0%-nonascii", gen_string(0));
+}
+
+fn bench1(c: &mut Criterion) {
+    bench(c, "1%-nonascii", gen_string(1));
+}
+
+fn bench10(c: &mut Criterion) {
+    bench(c, "10%-nonascii", gen_string(10));
+}
+
+fn bench100(c: &mut Criterion) {
+    bench(c, "100%-nonascii", gen_string(100));
+}
+
+criterion_group!(benches, bench0, bench1, bench10, bench100);
+criterion_main!(benches);
diff -pruN 43.0.0-1/rust-vendor/unicode-ident/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/unicode-ident/src/lib.rs
--- 43.0.0-1/rust-vendor/unicode-ident/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unicode-ident/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,269 @@
+//! [![github]](https://github.com/dtolnay/unicode-ident)&ensp;[![crates-io]](https://crates.io/crates/unicode-ident)&ensp;[![docs-rs]](https://docs.rs/unicode-ident)
+//!
+//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
+//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust
+//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs
+//!
+//! <br>
+//!
+//! Implementation of [Unicode Standard Annex #31][tr31] for determining which
+//! `char` values are valid in programming language identifiers.
+//!
+//! [tr31]: https://www.unicode.org/reports/tr31/
+//!
+//! This crate is a better optimized implementation of the older `unicode-xid`
+//! crate. This crate uses less static storage, and is able to classify both
+//! ASCII and non-ASCII codepoints with better performance, 2&ndash;10&times;
+//! faster than `unicode-xid`.
+//!
+//! <br>
+//!
+//! ## Comparison of performance
+//!
+//! The following table shows a comparison between five Unicode identifier
+//! implementations.
+//!
+//! - `unicode-ident` is this crate;
+//! - [`unicode-xid`] is a widely used crate run by the "unicode-rs" org;
+//! - `ucd-trie` and `fst` are two data structures supported by the
+//!   [`ucd-generate`] tool;
+//! - [`roaring`] is a Rust implementation of Roaring bitmap.
+//!
+//! The *static storage* column shows the total size of `static` tables that the
+//! crate bakes into your binary, measured in 1000s of bytes.
+//!
+//! The remaining columns show the **cost per call** to evaluate whether a
+//! single `char` has the XID\_Start or XID\_Continue Unicode property,
+//! comparing across different ratios of ASCII to non-ASCII codepoints in the
+//! input data.
+//!
+//! [`unicode-xid`]: https://github.com/unicode-rs/unicode-xid
+//! [`ucd-generate`]: https://github.com/BurntSushi/ucd-generate
+//! [`roaring`]: https://github.com/RoaringBitmap/roaring-rs
+//!
+//! | | static storage | 0% nonascii | 1% | 10% | 100% nonascii |
+//! |---|---|---|---|---|---|
+//! | **`unicode-ident`** | 10.1 K | 0.96 ns | 0.95 ns | 1.09 ns | 1.55 ns |
+//! | **`unicode-xid`** | 11.5 K | 1.88 ns | 2.14 ns | 3.48 ns | 15.63 ns |
+//! | **`ucd-trie`** | 10.2 K | 1.29 ns | 1.28 ns | 1.36 ns | 2.15 ns |
+//! | **`fst`** | 139 K | 55.1 ns | 54.9 ns | 53.2 ns | 28.5 ns |
+//! | **`roaring`** | 66.1 K | 2.78 ns | 3.09 ns | 3.37 ns | 4.70 ns |
+//!
+//! Source code for the benchmark is provided in the *bench* directory of this
+//! repo and may be repeated by running `cargo criterion`.
+//!
+//! <br>
+//!
+//! ## Comparison of data structures
+//!
+//! #### unicode-xid
+//!
+//! They use a sorted array of character ranges, and do a binary search to look
+//! up whether a given character lands inside one of those ranges.
+//!
+//! ```rust
+//! # const _: &str = stringify! {
+//! static XID_Continue_table: [(char, char); 763] = [
+//!     ('\u{30}', '\u{39}'),  // 0-9
+//!     ('\u{41}', '\u{5a}'),  // A-Z
+//! # "
+//!     …
+//! # "
+//!     ('\u{e0100}', '\u{e01ef}'),
+//! ];
+//! # };
+//! ```
+//!
+//! The static storage used by this data structure scales with the number of
+//! contiguous ranges of identifier codepoints in Unicode. Every table entry
+//! consumes 8 bytes, because it consists of a pair of 32-bit `char` values.
+//!
+//! In some ranges of the Unicode codepoint space, this is quite a sparse
+//! representation &ndash; there are some ranges where tens of thousands of
+//! adjacent codepoints are all valid identifier characters. In other places,
+//! the representation is quite inefficient. A characater like `µ` (U+00B5)
+//! which is surrounded by non-identifier codepoints consumes 64 bits in the
+//! table, while it would be just 1 bit in a dense bitmap.
+//!
+//! On a system with 64-byte cache lines, binary searching the table touches 7
+//! cache lines on average. Each cache line fits only 8 table entries.
+//! Additionally, the branching performed during the binary search is probably
+//! mostly unpredictable to the branch predictor.
+//!
+//! Overall, the crate ends up being about 10&times; slower on non-ASCII input
+//! compared to the fastest crate.
+//!
+//! A potential improvement would be to pack the table entries more compactly.
+//! Rust's `char` type is a 21-bit integer padded to 32 bits, which means every
+//! table entry is holding 22 bits of wasted space, adding up to 3.9 K. They
+//! could instead fit every table entry into 6 bytes, leaving out some of the
+//! padding, for a 25% improvement in space used. With some cleverness it may be
+//! possible to fit in 5 bytes or even 4 bytes by storing a low char and an
+//! extent, instead of low char and high char. I don't expect that performance
+//! would improve much but this could be the most efficient for space across all
+//! the libraries, needing only about 7 K to store.
+//!
+//! #### ucd-trie
+//!
+//! Their data structure is a compressed trie set specifically tailored for
+//! Unicode codepoints. The design is credited to Raph Levien in
+//! [rust-lang/rust#33098].
+//!
+//! [rust-lang/rust#33098]: https://github.com/rust-lang/rust/pull/33098
+//!
+//! ```rust
+//! pub struct TrieSet {
+//!     tree1_level1: &'static [u64; 32],
+//!     tree2_level1: &'static [u8; 992],
+//!     tree2_level2: &'static [u64],
+//!     tree3_level1: &'static [u8; 256],
+//!     tree3_level2: &'static [u8],
+//!     tree3_level3: &'static [u64],
+//! }
+//! ```
+//!
+//! It represents codepoint sets using a trie to achieve prefix compression. The
+//! final states of the trie are embedded in leaves or "chunks", where each
+//! chunk is a 64-bit integer. Each bit position of the integer corresponds to
+//! whether a particular codepoint is in the set or not. These chunks are not
+//! just a compact representation of the final states of the trie, but are also
+//! a form of suffix compression. In particular, if multiple ranges of 64
+//! contiguous codepoints have the same Unicode properties, then they all map to
+//! the same chunk in the final level of the trie.
+//!
+//! Being tailored for Unicode codepoints, this trie is partitioned into three
+//! disjoint sets: tree1, tree2, tree3. The first set corresponds to codepoints
+//! \[0, 0x800), the second \[0x800, 0x10000) and the third \[0x10000,
+//! 0x110000). These partitions conveniently correspond to the space of 1 or 2
+//! byte UTF-8 encoded codepoints, 3 byte UTF-8 encoded codepoints and 4 byte
+//! UTF-8 encoded codepoints, respectively.
+//!
+//! Lookups in this data structure are significantly more efficient than binary
+//! search. A lookup touches either 1, 2, or 3 cache lines based on which of the
+//! trie partitions is being accessed.
+//!
+//! One possible performance improvement would be for this crate to expose a way
+//! to query based on a UTF-8 encoded string, returning the Unicode property
+//! corresponding to the first character in the string. Without such an API, the
+//! caller is required to tokenize their UTF-8 encoded input data into `char`,
+//! hand the `char` into `ucd-trie`, only for `ucd-trie` to undo that work by
+//! converting back into the variable-length representation for trie traversal.
+//!
+//! #### fst
+//!
+//! Uses a [finite state transducer][fst]. This representation is built into
+//! [ucd-generate] but I am not aware of any advantage over the `ucd-trie`
+//! representation. In particular `ucd-trie` is optimized for storing Unicode
+//! properties while `fst` is not.
+//!
+//! [fst]: https://github.com/BurntSushi/fst
+//! [ucd-generate]: https://github.com/BurntSushi/ucd-generate
+//!
+//! As far as I can tell, the main thing that causes `fst` to have large size
+//! and slow lookups for this use case relative to `ucd-trie` is that it does
+//! not specialize for the fact that only 21 of the 32 bits in a `char` are
+//! meaningful. There are some dense arrays in the structure with large ranges
+//! that could never possibly be used.
+//!
+//! #### roaring
+//!
+//! This crate is a pure-Rust implementation of [Roaring Bitmap], a data
+//! structure designed for storing sets of 32-bit unsigned integers.
+//!
+//! [Roaring Bitmap]: https://roaringbitmap.org/about/
+//!
+//! Roaring bitmaps are compressed bitmaps which tend to outperform conventional
+//! compressed bitmaps such as WAH, EWAH or Concise. In some instances, they can
+//! be hundreds of times faster and they often offer significantly better
+//! compression.
+//!
+//! In this use case the performance was reasonably competitive but still
+//! substantially slower than the Unicode-optimized crates. Meanwhile the
+//! compression was significantly worse, requiring 6&times; as much storage for
+//! the data structure.
+//!
+//! I also benchmarked the [`croaring`] crate which is an FFI wrapper around the
+//! C reference implementation of Roaring Bitmap. This crate was consistently
+//! about 15% slower than pure-Rust `roaring`, which could just be FFI overhead.
+//! I did not investigate further.
+//!
+//! [`croaring`]: https://crates.io/crates/croaring
+//!
+//! #### unicode-ident
+//!
+//! This crate is most similar to the `ucd-trie` library, in that it's based on
+//! bitmaps stored in the leafs of a trie representation, achieving both prefix
+//! compression and suffix compression.
+//!
+//! The key differences are:
+//!
+//! - Uses a single 2-level trie, rather than 3 disjoint partitions of different
+//!   depth each.
+//! - Uses significantly larger chunks: 512 bits rather than 64 bits.
+//! - Compresses the XID\_Start and XID\_Continue properties together
+//!   simultaneously, rather than duplicating identical trie leaf chunks across
+//!   the two.
+//!
+//! The following diagram show the XID\_Start and XID\_Continue Unicode boolean
+//! properties in uncompressed form, in row-major order:
+//!
+//! <table>
+//! <tr><th>XID_Start</th><th>XID_Continue</th></tr>
+//! <tr>
+//! <td><img alt="XID_Start bitmap" width="256" src="https://user-images.githubusercontent.com/1940490/168647353-c6eeb922-afec-49b2-9ef5-c03e9d1e0760.png"></td>
+//! <td><img alt="XID_Continue bitmap" width="256" src="https://user-images.githubusercontent.com/1940490/168647367-f447cca7-2362-4d7d-8cd7-d21c011d329b.png"></td>
+//! </tr>
+//! </table>
+//!
+//! Uncompressed, these would take 140 K to store, which is beyond what would be
+//! reasonable. However, as you can see there is a large degree of similarity
+//! between the two bitmaps and across the rows, which lends well to
+//! compression.
+//!
+//! This crate stores one 512-bit "row" of the above bitmaps in the leaf level
+//! of a trie, and a single additional level to index into the leafs. It turns
+//! out there are 124 unique 512-bit chunks across the two bitmaps so 7 bits are
+//! sufficient to index them.
+//!
+//! The chunk size of 512 bits is selected as the size that minimizes the total
+//! size of the data structure. A smaller chunk, like 256 or 128 bits, would
+//! achieve better deduplication but require a larger index. A larger chunk
+//! would increase redundancy in the leaf bitmaps. 512 bit chunks are the
+//! optimum for total size of the index plus leaf bitmaps.
+//!
+//! In fact since there are only 124 unique chunks, we can use an 8-bit index
+//! with a spare bit to index at the half-chunk level. This achieves an
+//! additional 8.5% compression by eliminating redundancies between the second
+//! half of any chunk and the first half of any other chunk. Note that this is
+//! not the same as using chunks which are half the size, because it does not
+//! necessitate raising the size of the trie's first level.
+//!
+//! In contrast to binary search or the `ucd-trie` crate, performing lookups in
+//! this data structure is straight-line code with no need for branching.
+
+#![no_std]
+#![doc(html_root_url = "https://docs.rs/unicode-ident/1.0.12")]
+#![allow(clippy::doc_markdown, clippy::must_use_candidate)]
+
+#[rustfmt::skip]
+mod tables;
+
+use crate::tables::{ASCII_CONTINUE, ASCII_START, CHUNK, LEAF, TRIE_CONTINUE, TRIE_START};
+
+pub fn is_xid_start(ch: char) -> bool {
+    if ch.is_ascii() {
+        return ASCII_START.0[ch as usize];
+    }
+    let chunk = *TRIE_START.0.get(ch as usize / 8 / CHUNK).unwrap_or(&0);
+    let offset = chunk as usize * CHUNK / 2 + ch as usize / 8 % CHUNK;
+    unsafe { LEAF.0.get_unchecked(offset) }.wrapping_shr(ch as u32 % 8) & 1 != 0
+}
+
+pub fn is_xid_continue(ch: char) -> bool {
+    if ch.is_ascii() {
+        return ASCII_CONTINUE.0[ch as usize];
+    }
+    let chunk = *TRIE_CONTINUE.0.get(ch as usize / 8 / CHUNK).unwrap_or(&0);
+    let offset = chunk as usize * CHUNK / 2 + ch as usize / 8 % CHUNK;
+    unsafe { LEAF.0.get_unchecked(offset) }.wrapping_shr(ch as u32 % 8) & 1 != 0
+}
diff -pruN 43.0.0-1/rust-vendor/unicode-ident/src/tables.rs 43.0.0-1ubuntu1/rust-vendor/unicode-ident/src/tables.rs
--- 43.0.0-1/rust-vendor/unicode-ident/src/tables.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unicode-ident/src/tables.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,651 @@
+// @generated by ../generate. To regenerate, run the following in the repo root:
+//
+// $ curl -LO https://www.unicode.org/Public/zipped/15.0.0/UCD.zip
+// $ unzip UCD.zip -d UCD
+// $ cargo run --manifest-path generate/Cargo.toml
+
+const T: bool = true;
+const F: bool = false;
+
+#[repr(C, align(8))]
+pub(crate) struct Align8<T>(pub(crate) T);
+#[repr(C, align(64))]
+pub(crate) struct Align64<T>(pub(crate) T);
+
+pub(crate) static ASCII_START: Align64<[bool; 128]> = Align64([
+    F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+    F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+    F, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, F, F, F, F, F,
+    F, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, F, F, F, F, F,
+]);
+
+pub(crate) static ASCII_CONTINUE: Align64<[bool; 128]> = Align64([
+    F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+    F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, T, T, T, T, T, T, T, T, T, T, F, F, F, F, F, F,
+    F, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, F, F, F, F, T,
+    F, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, F, F, F, F, F,
+]);
+
+pub(crate) const CHUNK: usize = 64;
+
+pub(crate) static TRIE_START: Align8<[u8; 402]> = Align8([
+    0x04, 0x0B, 0x0F, 0x13, 0x17, 0x1B, 0x1F, 0x23, 0x27, 0x2D, 0x31, 0x34, 0x38, 0x3C, 0x40, 0x02,
+    0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x00, 0x4D, 0x00, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x51, 0x54, 0x58, 0x5C, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x09, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x60, 0x64, 0x66,
+    0x6A, 0x6E, 0x72, 0x28, 0x76, 0x78, 0x7C, 0x80, 0x84, 0x88, 0x8C, 0x90, 0x94, 0x98, 0x9E, 0xA2,
+    0x05, 0x2B, 0xA6, 0x00, 0x00, 0x00, 0x00, 0x99, 0x05, 0x05, 0xA8, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x05, 0xAE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x05, 0xB1, 0x00, 0xB5, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x32, 0x05, 0x05, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9C, 0x43, 0xBB, 0x00, 0x00, 0x00, 0x00, 0xBE, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC8, 0x00, 0x00, 0x00, 0xAF,
+    0xCE, 0xD2, 0xD6, 0xBC, 0xDA, 0x00, 0x00, 0xDE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0xE0, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x52, 0xE3, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0xE6, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0xE1, 0x05, 0xE9, 0x00, 0x00, 0x00, 0x00, 0x05, 0xEB, 0x00, 0x00,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0xE4, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0xE7,
+]);
+
+pub(crate) static TRIE_CONTINUE: Align8<[u8; 1793]> = Align8([
+    0x08, 0x0D, 0x11, 0x15, 0x19, 0x1D, 0x21, 0x25, 0x2A, 0x2F, 0x31, 0x36, 0x3A, 0x3E, 0x42, 0x02,
+    0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x4F, 0x00, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x51, 0x56, 0x5A, 0x5E, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x09, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x62, 0x64, 0x68,
+    0x6C, 0x70, 0x74, 0x28, 0x76, 0x7A, 0x7E, 0x82, 0x86, 0x8A, 0x8E, 0x92, 0x96, 0x9B, 0xA0, 0xA4,
+    0x05, 0x2B, 0xA6, 0x00, 0x00, 0x00, 0x00, 0x99, 0x05, 0x05, 0xAB, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x05, 0xAE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x05, 0xB3, 0x00, 0xB7, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x32, 0x05, 0x05, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9C, 0x43, 0xBB, 0x00, 0x00, 0x00, 0x00, 0xC1, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA9, 0xAC, 0xC4, 0xC6, 0xCA, 0x00, 0xCC, 0x00, 0xAF,
+    0xD0, 0xD4, 0xD8, 0xBC, 0xDC, 0x00, 0x00, 0xDE, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBF, 0x00, 0x00,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0xE0, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x52, 0xE3, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0xE6, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0xE1, 0x05, 0xE9, 0x00, 0x00, 0x00, 0x00, 0x05, 0xEB, 0x00, 0x00,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0xE4, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0xE7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xC2,
+]);
+
+pub(crate) static LEAF: Align64<[u8; 7584]> = Align64([
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0x3F, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x3F, 0xFF, 0xAA, 0xFF, 0xFF, 0xFF, 0x3F,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0x5F, 0xDC, 0x1F, 0xCF, 0x0F, 0xFF, 0x1F, 0xDC, 0x1F,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x20, 0x04, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xA0, 0x04, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0xFF, 0xFF, 0x7F, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC3, 0xFF, 0x03, 0x00, 0x1F, 0x50, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDF, 0xB8,
+    0x40, 0xD7, 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC3, 0xFF, 0x03, 0x00, 0x1F, 0x50, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xB8,
+    0xC0, 0xD7, 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0x03, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0x7F, 0x02, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x87, 0x07, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFB, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0x7F, 0x02, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x01, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xB6, 0x00, 0xFF, 0xFF, 0xFF, 0x87, 0x07, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0xC0, 0xFE, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2F, 0x00, 0x60, 0xC0, 0x00, 0x9C,
+    0x00, 0x00, 0xFD, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x02, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0x07, 0x30, 0x04,
+    0x00, 0x00, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC3, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0x9F, 0xFF, 0xFD, 0xFF, 0x9F,
+    0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x24,
+    0xFF, 0xFF, 0x3F, 0x04, 0x10, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x01, 0xFF, 0x07, 0xFF, 0xFF,
+    0xFF, 0x7E, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x23, 0x00, 0x00, 0x01, 0xFF, 0x03, 0x00, 0xFE, 0xFF,
+    0xE1, 0x9F, 0xF9, 0xFF, 0xFF, 0xFD, 0xC5, 0x23, 0x00, 0x40, 0x00, 0xB0, 0x03, 0x00, 0x03, 0x10,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0x07, 0xFF, 0xFF,
+    0xFF, 0x7E, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFE, 0xFF,
+    0xEF, 0x9F, 0xF9, 0xFF, 0xFF, 0xFD, 0xC5, 0xF3, 0x9F, 0x79, 0x80, 0xB0, 0xCF, 0xFF, 0x03, 0x50,
+    0xE0, 0x87, 0xF9, 0xFF, 0xFF, 0xFD, 0x6D, 0x03, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x1C, 0x00,
+    0xE0, 0xBF, 0xFB, 0xFF, 0xFF, 0xFD, 0xED, 0x23, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00, 0x02,
+    0xE0, 0x9F, 0xF9, 0xFF, 0xFF, 0xFD, 0xED, 0x23, 0x00, 0x00, 0x00, 0xB0, 0x03, 0x00, 0x02, 0x00,
+    0xE8, 0xC7, 0x3D, 0xD6, 0x18, 0xC7, 0xFF, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xEE, 0x87, 0xF9, 0xFF, 0xFF, 0xFD, 0x6D, 0xD3, 0x87, 0x39, 0x02, 0x5E, 0xC0, 0xFF, 0x3F, 0x00,
+    0xEE, 0xBF, 0xFB, 0xFF, 0xFF, 0xFD, 0xED, 0xF3, 0xBF, 0x3B, 0x01, 0x00, 0xCF, 0xFF, 0x00, 0xFE,
+    0xEE, 0x9F, 0xF9, 0xFF, 0xFF, 0xFD, 0xED, 0xF3, 0x9F, 0x39, 0xE0, 0xB0, 0xCF, 0xFF, 0x02, 0x00,
+    0xEC, 0xC7, 0x3D, 0xD6, 0x18, 0xC7, 0xFF, 0xC3, 0xC7, 0x3D, 0x81, 0x00, 0xC0, 0xFF, 0x00, 0x00,
+    0xE0, 0xDF, 0xFD, 0xFF, 0xFF, 0xFD, 0xFF, 0x23, 0x00, 0x00, 0x00, 0x27, 0x03, 0x00, 0x00, 0x00,
+    0xE1, 0xDF, 0xFD, 0xFF, 0xFF, 0xFD, 0xEF, 0x23, 0x00, 0x00, 0x00, 0x60, 0x03, 0x00, 0x06, 0x00,
+    0xF0, 0xDF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0x27, 0x00, 0x40, 0x70, 0x80, 0x03, 0x00, 0x00, 0xFC,
+    0xE0, 0xFF, 0x7F, 0xFC, 0xFF, 0xFF, 0xFB, 0x2F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xDF, 0xFD, 0xFF, 0xFF, 0xFD, 0xFF, 0xF3, 0xDF, 0x3D, 0x60, 0x27, 0xCF, 0xFF, 0x00, 0x00,
+    0xEF, 0xDF, 0xFD, 0xFF, 0xFF, 0xFD, 0xEF, 0xF3, 0xDF, 0x3D, 0x60, 0x60, 0xCF, 0xFF, 0x0E, 0x00,
+    0xFF, 0xDF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0x7D, 0xF0, 0x80, 0xCF, 0xFF, 0x00, 0xFC,
+    0xEE, 0xFF, 0x7F, 0xFC, 0xFF, 0xFF, 0xFB, 0x2F, 0x7F, 0x84, 0x5F, 0xFF, 0xC0, 0xFF, 0x0C, 0x00,
+    0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x05, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xD6, 0xF7, 0xFF, 0xFF, 0xAF, 0xFF, 0x05, 0x20, 0x5F, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00,
+    0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00,
+    0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0x7F, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
+    0xD6, 0xF7, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0x3F, 0x5F, 0x7F, 0xFF, 0xF3, 0x00, 0x00, 0x00, 0x00,
+    0x01, 0x00, 0x00, 0x03, 0xFF, 0x03, 0xA0, 0xC2, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0x1F, 0xFE, 0xFF,
+    0xDF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0x1F, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x80, 0x00, 0x00, 0x3F, 0x3C, 0x62, 0xC0, 0xE1, 0xFF,
+    0x03, 0x40, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0x20, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0xFF, 0xFF, 0x3F, 0x00, 0xFF, 0x00, 0x00, 0x00,
+    0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0x20, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3D, 0x7F, 0x3D, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x3D, 0xFF, 0xFF, 0xFF, 0xFF, 0x3D, 0x7F, 0x3D, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0x3D, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x3F,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3D, 0x7F, 0x3D, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x3D, 0xFF, 0xFF, 0xFF, 0xFF, 0x3D, 0x7F, 0x3D, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0x3D, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0x00, 0xFE, 0x03, 0x00,
+    0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x3F,
+    0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF,
+    0xFE, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC7, 0xFF, 0x01,
+    0xFF, 0xFF, 0x03, 0x80, 0xFF, 0xFF, 0x03, 0x00, 0xFF, 0xFF, 0x03, 0x00, 0xFF, 0xDF, 0x01, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x80, 0x10, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF,
+    0xFE, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC7, 0xFF, 0x01,
+    0xFF, 0xFF, 0x3F, 0x80, 0xFF, 0xFF, 0x1F, 0x00, 0xFF, 0xFF, 0x0F, 0x00, 0xFF, 0xDF, 0x0D, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F, 0x30, 0xFF, 0x03, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x05, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00,
+    0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x3F, 0x1F, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0xB8, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00,
+    0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0x0F, 0xFF, 0x0F, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x1F, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF, 0x03, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0x7F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xF8, 0xFF, 0xFF, 0xFF, 0x01, 0xC0, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x9F,
+    0xFF, 0x03, 0xFF, 0x03, 0x80, 0x00, 0xFF, 0xBF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0xFF, 0x03, 0x00, 0xF8, 0x0F, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0x3F,
+    0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0x6F, 0x04,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xE3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F,
+    0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0x00, 0x00, 0xF7, 0xFF, 0xFF, 0xFF, 0xFF, 0x07,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x27, 0x00, 0xF0, 0x00, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80,
+    0x00, 0x00, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x84, 0xFC, 0x2F, 0x3F, 0x50, 0xFD, 0xFF, 0xF3, 0xE0, 0x43, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x02, 0x80,
+    0x00, 0x00, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x1F, 0xE2, 0xFF, 0x01, 0x00,
+    0x84, 0xFC, 0x2F, 0x3F, 0x50, 0xFD, 0xFF, 0xF3, 0xE0, 0x43, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x78, 0x0C, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0x20, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00,
+    0xFF, 0xFF, 0x7F, 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0xF8, 0x0F, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0x20, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x80,
+    0xFF, 0xFF, 0x7F, 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xE0, 0x00, 0x00, 0x00, 0xFE, 0x03, 0x3E, 0x1F, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0x7F, 0xE0, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7,
+    0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x7F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
+    0xE0, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0x3E, 0x1F, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0x7F, 0xE6, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x7F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x1F, 0xFF, 0xFF, 0x00, 0x0C, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x80,
+    0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
+    0x00, 0x00, 0x80, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xEB, 0x03, 0x00, 0x00, 0xFC, 0xFF,
+    0xFF, 0x1F, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xBF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00,
+    0x00, 0x00, 0x80, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xEB, 0x03, 0x00, 0x00, 0xFC, 0xFF,
+    0xBB, 0xF7, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00,
+    0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x68,
+    0x00, 0xFC, 0xFF, 0xFF, 0x3F, 0x00, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x1F,
+    0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x80, 0x00, 0x00, 0xDF, 0xFF, 0x00, 0x7C,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x10, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0xE8,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0xFF, 0xFF, 0xFF, 0x1F,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x80, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0x7F,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0xF7, 0x0F, 0x00, 0x00, 0xFF, 0xFF, 0x7F, 0xC4,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x3E, 0x05, 0x00, 0x00, 0x38, 0xFF, 0x07, 0x1C, 0x00,
+    0x7E, 0x7E, 0x7E, 0x00, 0x7F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0xFF, 0x03, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0xFF, 0x3F, 0xFF, 0x03, 0xFF, 0xFF, 0x7F, 0xFC,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x38, 0xFF, 0xFF, 0x7C, 0x00,
+    0x7E, 0x7E, 0x7E, 0x00, 0x7F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0xFF, 0x03, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x37, 0xFF, 0x03,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
+    0x7F, 0x00, 0xF8, 0xA0, 0xFF, 0xFD, 0x7F, 0x5F, 0xDB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
+    0x7F, 0x00, 0xF8, 0xE0, 0xFF, 0xFD, 0x7F, 0x5F, 0xDB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xF0, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x03,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8A, 0xAA,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F,
+    0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0x07, 0xC0, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFC, 0xFC, 0xFC, 0x1C, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x18, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x8A, 0xAA,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F,
+    0x00, 0x00, 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0x87, 0xFE, 0xFF, 0xFF, 0x07, 0xE0, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFC, 0xFC, 0xFC, 0x1C, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xEF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xB7, 0xFF, 0x3F, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xEF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xB7, 0xFF, 0x3F, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00,
+    0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07,
+    0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0xFF, 0xF7,
+    0xFF, 0xF7, 0xB7, 0xFF, 0xFB, 0xFF, 0xFB, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0xFF, 0xF7,
+    0xFF, 0xF7, 0xB7, 0xFF, 0xFB, 0xFF, 0xFB, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x3F, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0x91, 0xFF, 0xFF, 0x3F, 0x00, 0xFF, 0xFF, 0x7F, 0x00,
+    0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x37, 0x00,
+    0xFF, 0xFF, 0x3F, 0x00, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x01, 0x00, 0xEF, 0xFE, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x1F,
+    0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFE, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0xFF, 0xFF, 0x3F, 0x00, 0xFF, 0xFF, 0x07, 0x00,
+    0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x6F, 0xF0, 0xEF, 0xFE, 0xFF, 0xFF, 0x3F, 0x87, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x1F,
+    0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFE, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0xFF, 0xFF, 0x3F, 0x00, 0xFF, 0xFF, 0x07, 0x00,
+    0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0x1F, 0x80, 0x00, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
+    0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7F, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1B, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0,
+    0xFF, 0xFF, 0xFF, 0x1F, 0x80, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0xFF, 0xFF,
+    0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7F, 0x00,
+    0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x00,
+    0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00,
+    0xF8, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x90, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x47, 0x00,
+    0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x1E, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0xC0, 0xFF, 0x3F, 0x80,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x04, 0x00, 0xFF, 0xFF, 0xFF, 0x01, 0xFF, 0x03,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x4F, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0xDE, 0xFF, 0x17, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0x0F, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x7F, 0xBD, 0xFF, 0xBF, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
+    0xE0, 0x9F, 0xF9, 0xFF, 0xFF, 0xFD, 0xED, 0x23, 0x00, 0x00, 0x01, 0xE0, 0x03, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x7F, 0xBD, 0xFF, 0xBF, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0x03,
+    0xEF, 0x9F, 0xF9, 0xFF, 0xFF, 0xFD, 0xED, 0xFB, 0x9F, 0x39, 0x81, 0xE0, 0xCF, 0x1F, 0x1F, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x80, 0x07, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xC3, 0x03, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0x01, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x11, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xE7, 0xFF, 0x0F, 0xFF, 0x03, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x80,
+    0x7F, 0xF2, 0x6F, 0xFF, 0xFF, 0xFF, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x0A, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x80,
+    0x7F, 0xF2, 0x6F, 0xFF, 0xFF, 0xFF, 0xBF, 0xF9, 0x0F, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x1B, 0x00, 0x00, 0x00,
+    0x01, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x04, 0x00, 0x00, 0x01, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x03, 0x00, 0x20, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x80, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0x23, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEF, 0x6F,
+    0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF,
+    0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x7F, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x40, 0x00, 0x00, 0x00, 0xBF, 0xFD, 0xFF, 0xFF,
+    0xFF, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0x01, 0x00, 0xFF, 0x03, 0x00, 0x00, 0xFC, 0xFF,
+    0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFE, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x7F, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xB4, 0xFF, 0x00, 0xFF, 0x03, 0xBF, 0xFD, 0xFF, 0xFF,
+    0xFF, 0x7F, 0xFB, 0x01, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x07, 0x00,
+    0xF4, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7F, 0x00,
+    0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xC7, 0x07, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xE3, 0x07, 0xF8,
+    0xE7, 0x0F, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0x7F, 0xE0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xE0,
+    0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0x03, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0x3F, 0x1F, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0xF8, 0xFF, 0xFF, 0xE0,
+    0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0xF8, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x87, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x80, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x03, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x6F, 0xFF, 0x7F,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0x1F,
+    0xFF, 0x01, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x03,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0x1F,
+    0xFF, 0x01, 0xFF, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xDF, 0x64, 0xDE, 0xFF, 0xEB, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xBF, 0xE7, 0xDF, 0xDF, 0xFF, 0xFF, 0xFF, 0x7B, 0x5F, 0xFC, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, 0xFF, 0xF7,
+    0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF,
+    0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xF7, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, 0xFF, 0xF7,
+    0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF,
+    0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xF7, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x20, 0x00,
+    0x10, 0x00, 0x00, 0xF8, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x80, 0x3F, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x7F, 0xFF, 0xFF, 0xF9, 0xDB, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00,
+    0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0xFF, 0x3F, 0xFF, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xEF, 0xFF, 0xFF, 0xFF, 0x96, 0xFE, 0xF7, 0x0A, 0x84, 0xEA, 0x96, 0xAA, 0x96, 0xF7, 0xF7, 0x5E,
+    0xFF, 0xFB, 0xFF, 0x0F, 0xEE, 0xFB, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+]);
diff -pruN 43.0.0-1/rust-vendor/unicode-ident/tests/compare.rs 43.0.0-1ubuntu1/rust-vendor/unicode-ident/tests/compare.rs
--- 43.0.0-1/rust-vendor/unicode-ident/tests/compare.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unicode-ident/tests/compare.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,67 @@
+mod fst;
+mod roaring;
+mod trie;
+
+#[test]
+fn compare_all_implementations() {
+    let xid_start_fst = fst::xid_start_fst();
+    let xid_continue_fst = fst::xid_continue_fst();
+    let xid_start_roaring = roaring::xid_start_bitmap();
+    let xid_continue_roaring = roaring::xid_continue_bitmap();
+
+    for ch in '\0'..=char::MAX {
+        let thought_to_be_start = unicode_ident::is_xid_start(ch);
+        let thought_to_be_continue = unicode_ident::is_xid_continue(ch);
+
+        // unicode-xid
+        // FIXME: unicode-xid does not support Unicode 15.1.0 yet.
+        /*
+        assert_eq!(
+            thought_to_be_start,
+            unicode_xid::UnicodeXID::is_xid_start(ch),
+            "{ch:?}",
+        );
+        assert_eq!(
+            thought_to_be_continue,
+            unicode_xid::UnicodeXID::is_xid_continue(ch),
+            "{ch:?}",
+        );
+        */
+
+        // ucd-trie
+        assert_eq!(
+            thought_to_be_start,
+            trie::XID_START.contains_char(ch),
+            "{ch:?}",
+        );
+        assert_eq!(
+            thought_to_be_continue,
+            trie::XID_CONTINUE.contains_char(ch),
+            "{ch:?}",
+        );
+
+        // fst
+        assert_eq!(
+            thought_to_be_start,
+            xid_start_fst.contains((ch as u32).to_be_bytes()),
+            "{ch:?}",
+        );
+        assert_eq!(
+            thought_to_be_continue,
+            xid_continue_fst.contains((ch as u32).to_be_bytes()),
+            "{ch:?}",
+        );
+
+        // roaring
+        assert_eq!(
+            thought_to_be_start,
+            xid_start_roaring.contains(ch as u32),
+            "{ch:?}",
+        );
+        assert_eq!(
+            thought_to_be_continue,
+            xid_continue_roaring.contains(ch as u32),
+            "{ch:?}",
+        );
+    }
+}
diff -pruN 43.0.0-1/rust-vendor/unicode-ident/tests/fst/mod.rs 43.0.0-1ubuntu1/rust-vendor/unicode-ident/tests/fst/mod.rs
--- 43.0.0-1/rust-vendor/unicode-ident/tests/fst/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unicode-ident/tests/fst/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,11 @@
+#![allow(clippy::module_name_repetitions)]
+
+pub fn xid_start_fst() -> fst::Set<&'static [u8]> {
+    let data = include_bytes!("xid_start.fst");
+    fst::Set::from(fst::raw::Fst::new(data.as_slice()).unwrap())
+}
+
+pub fn xid_continue_fst() -> fst::Set<&'static [u8]> {
+    let data = include_bytes!("xid_continue.fst");
+    fst::Set::from(fst::raw::Fst::new(data.as_slice()).unwrap())
+}
Binary files 43.0.0-1/rust-vendor/unicode-ident/tests/fst/xid_continue.fst and 43.0.0-1ubuntu1/rust-vendor/unicode-ident/tests/fst/xid_continue.fst differ
Binary files 43.0.0-1/rust-vendor/unicode-ident/tests/fst/xid_start.fst and 43.0.0-1ubuntu1/rust-vendor/unicode-ident/tests/fst/xid_start.fst differ
diff -pruN 43.0.0-1/rust-vendor/unicode-ident/tests/roaring/mod.rs 43.0.0-1ubuntu1/rust-vendor/unicode-ident/tests/roaring/mod.rs
--- 43.0.0-1/rust-vendor/unicode-ident/tests/roaring/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unicode-ident/tests/roaring/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,21 @@
+use roaring::RoaringBitmap;
+
+pub fn xid_start_bitmap() -> RoaringBitmap {
+    let mut bitmap = RoaringBitmap::new();
+    for ch in '\0'..=char::MAX {
+        if unicode_ident::is_xid_start(ch) {
+            bitmap.insert(ch as u32);
+        }
+    }
+    bitmap
+}
+
+pub fn xid_continue_bitmap() -> RoaringBitmap {
+    let mut bitmap = RoaringBitmap::new();
+    for ch in '\0'..=char::MAX {
+        if unicode_ident::is_xid_continue(ch) {
+            bitmap.insert(ch as u32);
+        }
+    }
+    bitmap
+}
diff -pruN 43.0.0-1/rust-vendor/unicode-ident/tests/static_size.rs 43.0.0-1ubuntu1/rust-vendor/unicode-ident/tests/static_size.rs
--- 43.0.0-1/rust-vendor/unicode-ident/tests/static_size.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unicode-ident/tests/static_size.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,95 @@
+#![allow(clippy::let_underscore_untyped, clippy::unreadable_literal)]
+
+use std::mem::size_of_val;
+
+#[test]
+fn test_size() {
+    #[allow(dead_code)]
+    #[path = "../src/tables.rs"]
+    mod tables;
+
+    let size = size_of_val(&tables::ASCII_START)
+        + size_of_val(&tables::ASCII_CONTINUE)
+        + size_of_val(&tables::TRIE_START)
+        + size_of_val(&tables::TRIE_CONTINUE)
+        + size_of_val(&tables::LEAF);
+    assert_eq!(10080, size);
+}
+
+#[test]
+fn test_xid_size() {
+    #[deny(dead_code)]
+    #[path = "tables/mod.rs"]
+    mod tables;
+
+    let size = size_of_val(tables::XID_START) + size_of_val(tables::XID_CONTINUE);
+    assert_eq!(11544, size);
+
+    let _ = tables::BY_NAME;
+}
+
+#[cfg(target_pointer_width = "64")]
+#[test]
+fn test_trieset_size() {
+    #[deny(dead_code)]
+    #[allow(clippy::redundant_static_lifetimes)]
+    #[path = "trie/trie.rs"]
+    mod trie;
+
+    let ucd_trie::TrieSet {
+        tree1_level1,
+        tree2_level1,
+        tree2_level2,
+        tree3_level1,
+        tree3_level2,
+        tree3_level3,
+    } = *trie::XID_START;
+
+    let start_size = size_of_val(trie::XID_START)
+        + size_of_val(tree1_level1)
+        + size_of_val(tree2_level1)
+        + size_of_val(tree2_level2)
+        + size_of_val(tree3_level1)
+        + size_of_val(tree3_level2)
+        + size_of_val(tree3_level3);
+
+    let ucd_trie::TrieSet {
+        tree1_level1,
+        tree2_level1,
+        tree2_level2,
+        tree3_level1,
+        tree3_level2,
+        tree3_level3,
+    } = *trie::XID_CONTINUE;
+
+    let continue_size = size_of_val(trie::XID_CONTINUE)
+        + size_of_val(tree1_level1)
+        + size_of_val(tree2_level1)
+        + size_of_val(tree2_level2)
+        + size_of_val(tree3_level1)
+        + size_of_val(tree3_level2)
+        + size_of_val(tree3_level3);
+
+    assert_eq!(10200, start_size + continue_size);
+
+    let _ = trie::BY_NAME;
+}
+
+#[test]
+fn test_fst_size() {
+    let xid_start_fst = include_bytes!("fst/xid_start.fst");
+    let xid_continue_fst = include_bytes!("fst/xid_continue.fst");
+    let size = xid_start_fst.len() + xid_continue_fst.len();
+    assert_eq!(138736, size);
+}
+
+#[test]
+fn test_roaring_size() {
+    #[path = "roaring/mod.rs"]
+    mod roaring;
+
+    let xid_start_bitmap = roaring::xid_start_bitmap();
+    let xid_continue_bitmap = roaring::xid_continue_bitmap();
+    let size = xid_start_bitmap.serialized_size() + xid_continue_bitmap.serialized_size();
+    assert_eq!(66104, size);
+}
diff -pruN 43.0.0-1/rust-vendor/unicode-ident/tests/tables/mod.rs 43.0.0-1ubuntu1/rust-vendor/unicode-ident/tests/tables/mod.rs
--- 43.0.0-1/rust-vendor/unicode-ident/tests/tables/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unicode-ident/tests/tables/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+#![allow(clippy::module_inception)]
+
+#[allow(clippy::redundant_static_lifetimes)]
+#[rustfmt::skip]
+mod tables;
+
+pub(crate) use self::tables::*;
diff -pruN 43.0.0-1/rust-vendor/unicode-ident/tests/tables/tables.rs 43.0.0-1ubuntu1/rust-vendor/unicode-ident/tests/tables/tables.rs
--- 43.0.0-1/rust-vendor/unicode-ident/tests/tables/tables.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unicode-ident/tests/tables/tables.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,347 @@
+// DO NOT EDIT THIS FILE. IT WAS AUTOMATICALLY GENERATED BY:
+//
+//   ucd-generate property-bool UCD --include XID_Start,XID_Continue
+//
+// Unicode version: 15.1.0.
+//
+// ucd-generate 0.3.0 is available on crates.io.
+
+pub const BY_NAME: &'static [(&'static str, &'static [(u32, u32)])] = &[
+  ("XID_Continue", XID_CONTINUE), ("XID_Start", XID_START),
+];
+
+pub const XID_CONTINUE: &'static [(u32, u32)] = &[
+  (48, 57), (65, 90), (95, 95), (97, 122), (170, 170), (181, 181), (183, 183),
+  (186, 186), (192, 214), (216, 246), (248, 705), (710, 721), (736, 740),
+  (748, 748), (750, 750), (768, 884), (886, 887), (891, 893), (895, 895),
+  (902, 906), (908, 908), (910, 929), (931, 1013), (1015, 1153), (1155, 1159),
+  (1162, 1327), (1329, 1366), (1369, 1369), (1376, 1416), (1425, 1469),
+  (1471, 1471), (1473, 1474), (1476, 1477), (1479, 1479), (1488, 1514),
+  (1519, 1522), (1552, 1562), (1568, 1641), (1646, 1747), (1749, 1756),
+  (1759, 1768), (1770, 1788), (1791, 1791), (1808, 1866), (1869, 1969),
+  (1984, 2037), (2042, 2042), (2045, 2045), (2048, 2093), (2112, 2139),
+  (2144, 2154), (2160, 2183), (2185, 2190), (2200, 2273), (2275, 2403),
+  (2406, 2415), (2417, 2435), (2437, 2444), (2447, 2448), (2451, 2472),
+  (2474, 2480), (2482, 2482), (2486, 2489), (2492, 2500), (2503, 2504),
+  (2507, 2510), (2519, 2519), (2524, 2525), (2527, 2531), (2534, 2545),
+  (2556, 2556), (2558, 2558), (2561, 2563), (2565, 2570), (2575, 2576),
+  (2579, 2600), (2602, 2608), (2610, 2611), (2613, 2614), (2616, 2617),
+  (2620, 2620), (2622, 2626), (2631, 2632), (2635, 2637), (2641, 2641),
+  (2649, 2652), (2654, 2654), (2662, 2677), (2689, 2691), (2693, 2701),
+  (2703, 2705), (2707, 2728), (2730, 2736), (2738, 2739), (2741, 2745),
+  (2748, 2757), (2759, 2761), (2763, 2765), (2768, 2768), (2784, 2787),
+  (2790, 2799), (2809, 2815), (2817, 2819), (2821, 2828), (2831, 2832),
+  (2835, 2856), (2858, 2864), (2866, 2867), (2869, 2873), (2876, 2884),
+  (2887, 2888), (2891, 2893), (2901, 2903), (2908, 2909), (2911, 2915),
+  (2918, 2927), (2929, 2929), (2946, 2947), (2949, 2954), (2958, 2960),
+  (2962, 2965), (2969, 2970), (2972, 2972), (2974, 2975), (2979, 2980),
+  (2984, 2986), (2990, 3001), (3006, 3010), (3014, 3016), (3018, 3021),
+  (3024, 3024), (3031, 3031), (3046, 3055), (3072, 3084), (3086, 3088),
+  (3090, 3112), (3114, 3129), (3132, 3140), (3142, 3144), (3146, 3149),
+  (3157, 3158), (3160, 3162), (3165, 3165), (3168, 3171), (3174, 3183),
+  (3200, 3203), (3205, 3212), (3214, 3216), (3218, 3240), (3242, 3251),
+  (3253, 3257), (3260, 3268), (3270, 3272), (3274, 3277), (3285, 3286),
+  (3293, 3294), (3296, 3299), (3302, 3311), (3313, 3315), (3328, 3340),
+  (3342, 3344), (3346, 3396), (3398, 3400), (3402, 3406), (3412, 3415),
+  (3423, 3427), (3430, 3439), (3450, 3455), (3457, 3459), (3461, 3478),
+  (3482, 3505), (3507, 3515), (3517, 3517), (3520, 3526), (3530, 3530),
+  (3535, 3540), (3542, 3542), (3544, 3551), (3558, 3567), (3570, 3571),
+  (3585, 3642), (3648, 3662), (3664, 3673), (3713, 3714), (3716, 3716),
+  (3718, 3722), (3724, 3747), (3749, 3749), (3751, 3773), (3776, 3780),
+  (3782, 3782), (3784, 3790), (3792, 3801), (3804, 3807), (3840, 3840),
+  (3864, 3865), (3872, 3881), (3893, 3893), (3895, 3895), (3897, 3897),
+  (3902, 3911), (3913, 3948), (3953, 3972), (3974, 3991), (3993, 4028),
+  (4038, 4038), (4096, 4169), (4176, 4253), (4256, 4293), (4295, 4295),
+  (4301, 4301), (4304, 4346), (4348, 4680), (4682, 4685), (4688, 4694),
+  (4696, 4696), (4698, 4701), (4704, 4744), (4746, 4749), (4752, 4784),
+  (4786, 4789), (4792, 4798), (4800, 4800), (4802, 4805), (4808, 4822),
+  (4824, 4880), (4882, 4885), (4888, 4954), (4957, 4959), (4969, 4977),
+  (4992, 5007), (5024, 5109), (5112, 5117), (5121, 5740), (5743, 5759),
+  (5761, 5786), (5792, 5866), (5870, 5880), (5888, 5909), (5919, 5940),
+  (5952, 5971), (5984, 5996), (5998, 6000), (6002, 6003), (6016, 6099),
+  (6103, 6103), (6108, 6109), (6112, 6121), (6155, 6157), (6159, 6169),
+  (6176, 6264), (6272, 6314), (6320, 6389), (6400, 6430), (6432, 6443),
+  (6448, 6459), (6470, 6509), (6512, 6516), (6528, 6571), (6576, 6601),
+  (6608, 6618), (6656, 6683), (6688, 6750), (6752, 6780), (6783, 6793),
+  (6800, 6809), (6823, 6823), (6832, 6845), (6847, 6862), (6912, 6988),
+  (6992, 7001), (7019, 7027), (7040, 7155), (7168, 7223), (7232, 7241),
+  (7245, 7293), (7296, 7304), (7312, 7354), (7357, 7359), (7376, 7378),
+  (7380, 7418), (7424, 7957), (7960, 7965), (7968, 8005), (8008, 8013),
+  (8016, 8023), (8025, 8025), (8027, 8027), (8029, 8029), (8031, 8061),
+  (8064, 8116), (8118, 8124), (8126, 8126), (8130, 8132), (8134, 8140),
+  (8144, 8147), (8150, 8155), (8160, 8172), (8178, 8180), (8182, 8188),
+  (8204, 8205), (8255, 8256), (8276, 8276), (8305, 8305), (8319, 8319),
+  (8336, 8348), (8400, 8412), (8417, 8417), (8421, 8432), (8450, 8450),
+  (8455, 8455), (8458, 8467), (8469, 8469), (8472, 8477), (8484, 8484),
+  (8486, 8486), (8488, 8488), (8490, 8505), (8508, 8511), (8517, 8521),
+  (8526, 8526), (8544, 8584), (11264, 11492), (11499, 11507), (11520, 11557),
+  (11559, 11559), (11565, 11565), (11568, 11623), (11631, 11631),
+  (11647, 11670), (11680, 11686), (11688, 11694), (11696, 11702),
+  (11704, 11710), (11712, 11718), (11720, 11726), (11728, 11734),
+  (11736, 11742), (11744, 11775), (12293, 12295), (12321, 12335),
+  (12337, 12341), (12344, 12348), (12353, 12438), (12441, 12442),
+  (12445, 12447), (12449, 12543), (12549, 12591), (12593, 12686),
+  (12704, 12735), (12784, 12799), (13312, 19903), (19968, 42124),
+  (42192, 42237), (42240, 42508), (42512, 42539), (42560, 42607),
+  (42612, 42621), (42623, 42737), (42775, 42783), (42786, 42888),
+  (42891, 42954), (42960, 42961), (42963, 42963), (42965, 42969),
+  (42994, 43047), (43052, 43052), (43072, 43123), (43136, 43205),
+  (43216, 43225), (43232, 43255), (43259, 43259), (43261, 43309),
+  (43312, 43347), (43360, 43388), (43392, 43456), (43471, 43481),
+  (43488, 43518), (43520, 43574), (43584, 43597), (43600, 43609),
+  (43616, 43638), (43642, 43714), (43739, 43741), (43744, 43759),
+  (43762, 43766), (43777, 43782), (43785, 43790), (43793, 43798),
+  (43808, 43814), (43816, 43822), (43824, 43866), (43868, 43881),
+  (43888, 44010), (44012, 44013), (44016, 44025), (44032, 55203),
+  (55216, 55238), (55243, 55291), (63744, 64109), (64112, 64217),
+  (64256, 64262), (64275, 64279), (64285, 64296), (64298, 64310),
+  (64312, 64316), (64318, 64318), (64320, 64321), (64323, 64324),
+  (64326, 64433), (64467, 64605), (64612, 64829), (64848, 64911),
+  (64914, 64967), (65008, 65017), (65024, 65039), (65056, 65071),
+  (65075, 65076), (65101, 65103), (65137, 65137), (65139, 65139),
+  (65143, 65143), (65145, 65145), (65147, 65147), (65149, 65149),
+  (65151, 65276), (65296, 65305), (65313, 65338), (65343, 65343),
+  (65345, 65370), (65381, 65470), (65474, 65479), (65482, 65487),
+  (65490, 65495), (65498, 65500), (65536, 65547), (65549, 65574),
+  (65576, 65594), (65596, 65597), (65599, 65613), (65616, 65629),
+  (65664, 65786), (65856, 65908), (66045, 66045), (66176, 66204),
+  (66208, 66256), (66272, 66272), (66304, 66335), (66349, 66378),
+  (66384, 66426), (66432, 66461), (66464, 66499), (66504, 66511),
+  (66513, 66517), (66560, 66717), (66720, 66729), (66736, 66771),
+  (66776, 66811), (66816, 66855), (66864, 66915), (66928, 66938),
+  (66940, 66954), (66956, 66962), (66964, 66965), (66967, 66977),
+  (66979, 66993), (66995, 67001), (67003, 67004), (67072, 67382),
+  (67392, 67413), (67424, 67431), (67456, 67461), (67463, 67504),
+  (67506, 67514), (67584, 67589), (67592, 67592), (67594, 67637),
+  (67639, 67640), (67644, 67644), (67647, 67669), (67680, 67702),
+  (67712, 67742), (67808, 67826), (67828, 67829), (67840, 67861),
+  (67872, 67897), (67968, 68023), (68030, 68031), (68096, 68099),
+  (68101, 68102), (68108, 68115), (68117, 68119), (68121, 68149),
+  (68152, 68154), (68159, 68159), (68192, 68220), (68224, 68252),
+  (68288, 68295), (68297, 68326), (68352, 68405), (68416, 68437),
+  (68448, 68466), (68480, 68497), (68608, 68680), (68736, 68786),
+  (68800, 68850), (68864, 68903), (68912, 68921), (69248, 69289),
+  (69291, 69292), (69296, 69297), (69373, 69404), (69415, 69415),
+  (69424, 69456), (69488, 69509), (69552, 69572), (69600, 69622),
+  (69632, 69702), (69734, 69749), (69759, 69818), (69826, 69826),
+  (69840, 69864), (69872, 69881), (69888, 69940), (69942, 69951),
+  (69956, 69959), (69968, 70003), (70006, 70006), (70016, 70084),
+  (70089, 70092), (70094, 70106), (70108, 70108), (70144, 70161),
+  (70163, 70199), (70206, 70209), (70272, 70278), (70280, 70280),
+  (70282, 70285), (70287, 70301), (70303, 70312), (70320, 70378),
+  (70384, 70393), (70400, 70403), (70405, 70412), (70415, 70416),
+  (70419, 70440), (70442, 70448), (70450, 70451), (70453, 70457),
+  (70459, 70468), (70471, 70472), (70475, 70477), (70480, 70480),
+  (70487, 70487), (70493, 70499), (70502, 70508), (70512, 70516),
+  (70656, 70730), (70736, 70745), (70750, 70753), (70784, 70853),
+  (70855, 70855), (70864, 70873), (71040, 71093), (71096, 71104),
+  (71128, 71133), (71168, 71232), (71236, 71236), (71248, 71257),
+  (71296, 71352), (71360, 71369), (71424, 71450), (71453, 71467),
+  (71472, 71481), (71488, 71494), (71680, 71738), (71840, 71913),
+  (71935, 71942), (71945, 71945), (71948, 71955), (71957, 71958),
+  (71960, 71989), (71991, 71992), (71995, 72003), (72016, 72025),
+  (72096, 72103), (72106, 72151), (72154, 72161), (72163, 72164),
+  (72192, 72254), (72263, 72263), (72272, 72345), (72349, 72349),
+  (72368, 72440), (72704, 72712), (72714, 72758), (72760, 72768),
+  (72784, 72793), (72818, 72847), (72850, 72871), (72873, 72886),
+  (72960, 72966), (72968, 72969), (72971, 73014), (73018, 73018),
+  (73020, 73021), (73023, 73031), (73040, 73049), (73056, 73061),
+  (73063, 73064), (73066, 73102), (73104, 73105), (73107, 73112),
+  (73120, 73129), (73440, 73462), (73472, 73488), (73490, 73530),
+  (73534, 73538), (73552, 73561), (73648, 73648), (73728, 74649),
+  (74752, 74862), (74880, 75075), (77712, 77808), (77824, 78895),
+  (78912, 78933), (82944, 83526), (92160, 92728), (92736, 92766),
+  (92768, 92777), (92784, 92862), (92864, 92873), (92880, 92909),
+  (92912, 92916), (92928, 92982), (92992, 92995), (93008, 93017),
+  (93027, 93047), (93053, 93071), (93760, 93823), (93952, 94026),
+  (94031, 94087), (94095, 94111), (94176, 94177), (94179, 94180),
+  (94192, 94193), (94208, 100343), (100352, 101589), (101632, 101640),
+  (110576, 110579), (110581, 110587), (110589, 110590), (110592, 110882),
+  (110898, 110898), (110928, 110930), (110933, 110933), (110948, 110951),
+  (110960, 111355), (113664, 113770), (113776, 113788), (113792, 113800),
+  (113808, 113817), (113821, 113822), (118528, 118573), (118576, 118598),
+  (119141, 119145), (119149, 119154), (119163, 119170), (119173, 119179),
+  (119210, 119213), (119362, 119364), (119808, 119892), (119894, 119964),
+  (119966, 119967), (119970, 119970), (119973, 119974), (119977, 119980),
+  (119982, 119993), (119995, 119995), (119997, 120003), (120005, 120069),
+  (120071, 120074), (120077, 120084), (120086, 120092), (120094, 120121),
+  (120123, 120126), (120128, 120132), (120134, 120134), (120138, 120144),
+  (120146, 120485), (120488, 120512), (120514, 120538), (120540, 120570),
+  (120572, 120596), (120598, 120628), (120630, 120654), (120656, 120686),
+  (120688, 120712), (120714, 120744), (120746, 120770), (120772, 120779),
+  (120782, 120831), (121344, 121398), (121403, 121452), (121461, 121461),
+  (121476, 121476), (121499, 121503), (121505, 121519), (122624, 122654),
+  (122661, 122666), (122880, 122886), (122888, 122904), (122907, 122913),
+  (122915, 122916), (122918, 122922), (122928, 122989), (123023, 123023),
+  (123136, 123180), (123184, 123197), (123200, 123209), (123214, 123214),
+  (123536, 123566), (123584, 123641), (124112, 124153), (124896, 124902),
+  (124904, 124907), (124909, 124910), (124912, 124926), (124928, 125124),
+  (125136, 125142), (125184, 125259), (125264, 125273), (126464, 126467),
+  (126469, 126495), (126497, 126498), (126500, 126500), (126503, 126503),
+  (126505, 126514), (126516, 126519), (126521, 126521), (126523, 126523),
+  (126530, 126530), (126535, 126535), (126537, 126537), (126539, 126539),
+  (126541, 126543), (126545, 126546), (126548, 126548), (126551, 126551),
+  (126553, 126553), (126555, 126555), (126557, 126557), (126559, 126559),
+  (126561, 126562), (126564, 126564), (126567, 126570), (126572, 126578),
+  (126580, 126583), (126585, 126588), (126590, 126590), (126592, 126601),
+  (126603, 126619), (126625, 126627), (126629, 126633), (126635, 126651),
+  (130032, 130041), (131072, 173791), (173824, 177977), (177984, 178205),
+  (178208, 183969), (183984, 191456), (191472, 192093), (194560, 195101),
+  (196608, 201546), (201552, 205743), (917760, 917999),
+];
+
+pub const XID_START: &'static [(u32, u32)] = &[
+  (65, 90), (97, 122), (170, 170), (181, 181), (186, 186), (192, 214),
+  (216, 246), (248, 705), (710, 721), (736, 740), (748, 748), (750, 750),
+  (880, 884), (886, 887), (891, 893), (895, 895), (902, 902), (904, 906),
+  (908, 908), (910, 929), (931, 1013), (1015, 1153), (1162, 1327),
+  (1329, 1366), (1369, 1369), (1376, 1416), (1488, 1514), (1519, 1522),
+  (1568, 1610), (1646, 1647), (1649, 1747), (1749, 1749), (1765, 1766),
+  (1774, 1775), (1786, 1788), (1791, 1791), (1808, 1808), (1810, 1839),
+  (1869, 1957), (1969, 1969), (1994, 2026), (2036, 2037), (2042, 2042),
+  (2048, 2069), (2074, 2074), (2084, 2084), (2088, 2088), (2112, 2136),
+  (2144, 2154), (2160, 2183), (2185, 2190), (2208, 2249), (2308, 2361),
+  (2365, 2365), (2384, 2384), (2392, 2401), (2417, 2432), (2437, 2444),
+  (2447, 2448), (2451, 2472), (2474, 2480), (2482, 2482), (2486, 2489),
+  (2493, 2493), (2510, 2510), (2524, 2525), (2527, 2529), (2544, 2545),
+  (2556, 2556), (2565, 2570), (2575, 2576), (2579, 2600), (2602, 2608),
+  (2610, 2611), (2613, 2614), (2616, 2617), (2649, 2652), (2654, 2654),
+  (2674, 2676), (2693, 2701), (2703, 2705), (2707, 2728), (2730, 2736),
+  (2738, 2739), (2741, 2745), (2749, 2749), (2768, 2768), (2784, 2785),
+  (2809, 2809), (2821, 2828), (2831, 2832), (2835, 2856), (2858, 2864),
+  (2866, 2867), (2869, 2873), (2877, 2877), (2908, 2909), (2911, 2913),
+  (2929, 2929), (2947, 2947), (2949, 2954), (2958, 2960), (2962, 2965),
+  (2969, 2970), (2972, 2972), (2974, 2975), (2979, 2980), (2984, 2986),
+  (2990, 3001), (3024, 3024), (3077, 3084), (3086, 3088), (3090, 3112),
+  (3114, 3129), (3133, 3133), (3160, 3162), (3165, 3165), (3168, 3169),
+  (3200, 3200), (3205, 3212), (3214, 3216), (3218, 3240), (3242, 3251),
+  (3253, 3257), (3261, 3261), (3293, 3294), (3296, 3297), (3313, 3314),
+  (3332, 3340), (3342, 3344), (3346, 3386), (3389, 3389), (3406, 3406),
+  (3412, 3414), (3423, 3425), (3450, 3455), (3461, 3478), (3482, 3505),
+  (3507, 3515), (3517, 3517), (3520, 3526), (3585, 3632), (3634, 3634),
+  (3648, 3654), (3713, 3714), (3716, 3716), (3718, 3722), (3724, 3747),
+  (3749, 3749), (3751, 3760), (3762, 3762), (3773, 3773), (3776, 3780),
+  (3782, 3782), (3804, 3807), (3840, 3840), (3904, 3911), (3913, 3948),
+  (3976, 3980), (4096, 4138), (4159, 4159), (4176, 4181), (4186, 4189),
+  (4193, 4193), (4197, 4198), (4206, 4208), (4213, 4225), (4238, 4238),
+  (4256, 4293), (4295, 4295), (4301, 4301), (4304, 4346), (4348, 4680),
+  (4682, 4685), (4688, 4694), (4696, 4696), (4698, 4701), (4704, 4744),
+  (4746, 4749), (4752, 4784), (4786, 4789), (4792, 4798), (4800, 4800),
+  (4802, 4805), (4808, 4822), (4824, 4880), (4882, 4885), (4888, 4954),
+  (4992, 5007), (5024, 5109), (5112, 5117), (5121, 5740), (5743, 5759),
+  (5761, 5786), (5792, 5866), (5870, 5880), (5888, 5905), (5919, 5937),
+  (5952, 5969), (5984, 5996), (5998, 6000), (6016, 6067), (6103, 6103),
+  (6108, 6108), (6176, 6264), (6272, 6312), (6314, 6314), (6320, 6389),
+  (6400, 6430), (6480, 6509), (6512, 6516), (6528, 6571), (6576, 6601),
+  (6656, 6678), (6688, 6740), (6823, 6823), (6917, 6963), (6981, 6988),
+  (7043, 7072), (7086, 7087), (7098, 7141), (7168, 7203), (7245, 7247),
+  (7258, 7293), (7296, 7304), (7312, 7354), (7357, 7359), (7401, 7404),
+  (7406, 7411), (7413, 7414), (7418, 7418), (7424, 7615), (7680, 7957),
+  (7960, 7965), (7968, 8005), (8008, 8013), (8016, 8023), (8025, 8025),
+  (8027, 8027), (8029, 8029), (8031, 8061), (8064, 8116), (8118, 8124),
+  (8126, 8126), (8130, 8132), (8134, 8140), (8144, 8147), (8150, 8155),
+  (8160, 8172), (8178, 8180), (8182, 8188), (8305, 8305), (8319, 8319),
+  (8336, 8348), (8450, 8450), (8455, 8455), (8458, 8467), (8469, 8469),
+  (8472, 8477), (8484, 8484), (8486, 8486), (8488, 8488), (8490, 8505),
+  (8508, 8511), (8517, 8521), (8526, 8526), (8544, 8584), (11264, 11492),
+  (11499, 11502), (11506, 11507), (11520, 11557), (11559, 11559),
+  (11565, 11565), (11568, 11623), (11631, 11631), (11648, 11670),
+  (11680, 11686), (11688, 11694), (11696, 11702), (11704, 11710),
+  (11712, 11718), (11720, 11726), (11728, 11734), (11736, 11742),
+  (12293, 12295), (12321, 12329), (12337, 12341), (12344, 12348),
+  (12353, 12438), (12445, 12447), (12449, 12538), (12540, 12543),
+  (12549, 12591), (12593, 12686), (12704, 12735), (12784, 12799),
+  (13312, 19903), (19968, 42124), (42192, 42237), (42240, 42508),
+  (42512, 42527), (42538, 42539), (42560, 42606), (42623, 42653),
+  (42656, 42735), (42775, 42783), (42786, 42888), (42891, 42954),
+  (42960, 42961), (42963, 42963), (42965, 42969), (42994, 43009),
+  (43011, 43013), (43015, 43018), (43020, 43042), (43072, 43123),
+  (43138, 43187), (43250, 43255), (43259, 43259), (43261, 43262),
+  (43274, 43301), (43312, 43334), (43360, 43388), (43396, 43442),
+  (43471, 43471), (43488, 43492), (43494, 43503), (43514, 43518),
+  (43520, 43560), (43584, 43586), (43588, 43595), (43616, 43638),
+  (43642, 43642), (43646, 43695), (43697, 43697), (43701, 43702),
+  (43705, 43709), (43712, 43712), (43714, 43714), (43739, 43741),
+  (43744, 43754), (43762, 43764), (43777, 43782), (43785, 43790),
+  (43793, 43798), (43808, 43814), (43816, 43822), (43824, 43866),
+  (43868, 43881), (43888, 44002), (44032, 55203), (55216, 55238),
+  (55243, 55291), (63744, 64109), (64112, 64217), (64256, 64262),
+  (64275, 64279), (64285, 64285), (64287, 64296), (64298, 64310),
+  (64312, 64316), (64318, 64318), (64320, 64321), (64323, 64324),
+  (64326, 64433), (64467, 64605), (64612, 64829), (64848, 64911),
+  (64914, 64967), (65008, 65017), (65137, 65137), (65139, 65139),
+  (65143, 65143), (65145, 65145), (65147, 65147), (65149, 65149),
+  (65151, 65276), (65313, 65338), (65345, 65370), (65382, 65437),
+  (65440, 65470), (65474, 65479), (65482, 65487), (65490, 65495),
+  (65498, 65500), (65536, 65547), (65549, 65574), (65576, 65594),
+  (65596, 65597), (65599, 65613), (65616, 65629), (65664, 65786),
+  (65856, 65908), (66176, 66204), (66208, 66256), (66304, 66335),
+  (66349, 66378), (66384, 66421), (66432, 66461), (66464, 66499),
+  (66504, 66511), (66513, 66517), (66560, 66717), (66736, 66771),
+  (66776, 66811), (66816, 66855), (66864, 66915), (66928, 66938),
+  (66940, 66954), (66956, 66962), (66964, 66965), (66967, 66977),
+  (66979, 66993), (66995, 67001), (67003, 67004), (67072, 67382),
+  (67392, 67413), (67424, 67431), (67456, 67461), (67463, 67504),
+  (67506, 67514), (67584, 67589), (67592, 67592), (67594, 67637),
+  (67639, 67640), (67644, 67644), (67647, 67669), (67680, 67702),
+  (67712, 67742), (67808, 67826), (67828, 67829), (67840, 67861),
+  (67872, 67897), (67968, 68023), (68030, 68031), (68096, 68096),
+  (68112, 68115), (68117, 68119), (68121, 68149), (68192, 68220),
+  (68224, 68252), (68288, 68295), (68297, 68324), (68352, 68405),
+  (68416, 68437), (68448, 68466), (68480, 68497), (68608, 68680),
+  (68736, 68786), (68800, 68850), (68864, 68899), (69248, 69289),
+  (69296, 69297), (69376, 69404), (69415, 69415), (69424, 69445),
+  (69488, 69505), (69552, 69572), (69600, 69622), (69635, 69687),
+  (69745, 69746), (69749, 69749), (69763, 69807), (69840, 69864),
+  (69891, 69926), (69956, 69956), (69959, 69959), (69968, 70002),
+  (70006, 70006), (70019, 70066), (70081, 70084), (70106, 70106),
+  (70108, 70108), (70144, 70161), (70163, 70187), (70207, 70208),
+  (70272, 70278), (70280, 70280), (70282, 70285), (70287, 70301),
+  (70303, 70312), (70320, 70366), (70405, 70412), (70415, 70416),
+  (70419, 70440), (70442, 70448), (70450, 70451), (70453, 70457),
+  (70461, 70461), (70480, 70480), (70493, 70497), (70656, 70708),
+  (70727, 70730), (70751, 70753), (70784, 70831), (70852, 70853),
+  (70855, 70855), (71040, 71086), (71128, 71131), (71168, 71215),
+  (71236, 71236), (71296, 71338), (71352, 71352), (71424, 71450),
+  (71488, 71494), (71680, 71723), (71840, 71903), (71935, 71942),
+  (71945, 71945), (71948, 71955), (71957, 71958), (71960, 71983),
+  (71999, 71999), (72001, 72001), (72096, 72103), (72106, 72144),
+  (72161, 72161), (72163, 72163), (72192, 72192), (72203, 72242),
+  (72250, 72250), (72272, 72272), (72284, 72329), (72349, 72349),
+  (72368, 72440), (72704, 72712), (72714, 72750), (72768, 72768),
+  (72818, 72847), (72960, 72966), (72968, 72969), (72971, 73008),
+  (73030, 73030), (73056, 73061), (73063, 73064), (73066, 73097),
+  (73112, 73112), (73440, 73458), (73474, 73474), (73476, 73488),
+  (73490, 73523), (73648, 73648), (73728, 74649), (74752, 74862),
+  (74880, 75075), (77712, 77808), (77824, 78895), (78913, 78918),
+  (82944, 83526), (92160, 92728), (92736, 92766), (92784, 92862),
+  (92880, 92909), (92928, 92975), (92992, 92995), (93027, 93047),
+  (93053, 93071), (93760, 93823), (93952, 94026), (94032, 94032),
+  (94099, 94111), (94176, 94177), (94179, 94179), (94208, 100343),
+  (100352, 101589), (101632, 101640), (110576, 110579), (110581, 110587),
+  (110589, 110590), (110592, 110882), (110898, 110898), (110928, 110930),
+  (110933, 110933), (110948, 110951), (110960, 111355), (113664, 113770),
+  (113776, 113788), (113792, 113800), (113808, 113817), (119808, 119892),
+  (119894, 119964), (119966, 119967), (119970, 119970), (119973, 119974),
+  (119977, 119980), (119982, 119993), (119995, 119995), (119997, 120003),
+  (120005, 120069), (120071, 120074), (120077, 120084), (120086, 120092),
+  (120094, 120121), (120123, 120126), (120128, 120132), (120134, 120134),
+  (120138, 120144), (120146, 120485), (120488, 120512), (120514, 120538),
+  (120540, 120570), (120572, 120596), (120598, 120628), (120630, 120654),
+  (120656, 120686), (120688, 120712), (120714, 120744), (120746, 120770),
+  (120772, 120779), (122624, 122654), (122661, 122666), (122928, 122989),
+  (123136, 123180), (123191, 123197), (123214, 123214), (123536, 123565),
+  (123584, 123627), (124112, 124139), (124896, 124902), (124904, 124907),
+  (124909, 124910), (124912, 124926), (124928, 125124), (125184, 125251),
+  (125259, 125259), (126464, 126467), (126469, 126495), (126497, 126498),
+  (126500, 126500), (126503, 126503), (126505, 126514), (126516, 126519),
+  (126521, 126521), (126523, 126523), (126530, 126530), (126535, 126535),
+  (126537, 126537), (126539, 126539), (126541, 126543), (126545, 126546),
+  (126548, 126548), (126551, 126551), (126553, 126553), (126555, 126555),
+  (126557, 126557), (126559, 126559), (126561, 126562), (126564, 126564),
+  (126567, 126570), (126572, 126578), (126580, 126583), (126585, 126588),
+  (126590, 126590), (126592, 126601), (126603, 126619), (126625, 126627),
+  (126629, 126633), (126635, 126651), (131072, 173791), (173824, 177977),
+  (177984, 178205), (178208, 183969), (183984, 191456), (191472, 192093),
+  (194560, 195101), (196608, 201546), (201552, 205743),
+];
diff -pruN 43.0.0-1/rust-vendor/unicode-ident/tests/trie/mod.rs 43.0.0-1ubuntu1/rust-vendor/unicode-ident/tests/trie/mod.rs
--- 43.0.0-1/rust-vendor/unicode-ident/tests/trie/mod.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unicode-ident/tests/trie/mod.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,7 @@
+#![allow(clippy::module_inception)]
+
+#[allow(dead_code, clippy::redundant_static_lifetimes, clippy::unreadable_literal)]
+#[rustfmt::skip]
+mod trie;
+
+pub(crate) use self::trie::*;
diff -pruN 43.0.0-1/rust-vendor/unicode-ident/tests/trie/trie.rs 43.0.0-1ubuntu1/rust-vendor/unicode-ident/tests/trie/trie.rs
--- 43.0.0-1/rust-vendor/unicode-ident/tests/trie/trie.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unicode-ident/tests/trie/trie.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,445 @@
+// DO NOT EDIT THIS FILE. IT WAS AUTOMATICALLY GENERATED BY:
+//
+//   ucd-generate property-bool UCD --include XID_Start,XID_Continue --trie-set
+//
+// Unicode version: 15.1.0.
+//
+// ucd-generate 0.3.0 is available on crates.io.
+
+pub const BY_NAME: &'static [(&'static str, &'static ::ucd_trie::TrieSet)] = &[
+  ("XID_Continue", XID_CONTINUE), ("XID_Start", XID_START),
+];
+
+pub const XID_CONTINUE: &'static ::ucd_trie::TrieSet = &::ucd_trie::TrieSet {
+  tree1_level1: &[
+    0x3FF000000000000, 0x7FFFFFE87FFFFFE, 0x4A0040000000000,
+    0xFF7FFFFFFF7FFFFF, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF,
+    0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF,
+    0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0x501F0003FFC3,
+    0xFFFFFFFFFFFFFFFF, 0xB8DFFFFFFFFFFFFF, 0xFFFFFFFBFFFFD7C0,
+    0xFFBFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF,
+    0xFFFFFFFFFFFFFCFB, 0xFFFFFFFFFFFFFFFF, 0xFFFEFFFFFFFFFFFF,
+    0xFFFFFFFF027FFFFF, 0xBFFFFFFFFFFE01FF, 0x787FFFFFF00B6,
+    0xFFFFFFFF07FF0000, 0xFFFFC3FFFFFFFFFF, 0xFFFFFFFFFFFFFFFF,
+    0x9FFFFDFF9FEFFFFF, 0xFFFFFFFFFFFF0000, 0xFFFFFFFFFFFFE7FF,
+    0x3FFFFFFFFFFFF, 0x243FFFFFFFFFFFFF,
+  ],
+  tree2_level1: &[
+    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+    21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 4, 32, 33, 34, 4, 4, 4, 4, 4,
+    35, 36, 37, 38, 39, 40, 41, 42, 4, 4, 4, 4, 4, 4, 4, 4, 43, 44, 45, 46,
+    47, 4, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 4, 61, 4, 62,
+    63, 64, 65, 66, 4, 4, 4, 4, 4, 4, 4, 4, 67, 68, 69, 70, 71, 72, 73, 74,
+    75, 76, 77, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+    78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+    78, 78, 78, 78, 78, 78, 78, 78, 4, 4, 4, 79, 80, 81, 82, 83, 78, 78, 78,
+    78, 78, 78, 78, 78, 84, 42, 85, 4, 86, 4, 87, 88, 78, 78, 78, 78, 78, 78,
+    78, 78, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 78, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 89, 90, 4, 4, 4, 4, 91, 92, 4, 93, 94, 4, 95, 96, 97, 62, 4,
+    98, 99, 100, 4, 101, 102, 103, 4, 104, 105, 106, 4, 107, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 108, 109, 78, 78,
+    78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+    78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+    78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+    78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+    78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+    78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+    78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+    78, 78, 78, 78, 4, 4, 4, 4, 4, 99, 4, 110, 111, 112, 93, 113, 4, 114, 4,
+    4, 115, 116, 117, 118, 119, 120, 4, 121, 122, 123, 124, 125,
+  ],
+  tree2_level2: &[
+    0x3FFFFFFFFFFF, 0xFFFF07FF0FFFFFFF, 0xFFFFFFFFFF007EFF,
+    0xFFFFFFFBFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xFFFEFFCFFFFFFFFF,
+    0xF3C5FDFFFFF99FEF, 0x5003FFCFB080799F, 0xD36DFDFFFFF987EE,
+    0x3FFFC05E023987, 0xF3EDFDFFFFFBBFEE, 0xFE00FFCF00013BBF,
+    0xF3EDFDFFFFF99FEE, 0x2FFCFB0E0399F, 0xC3FFC718D63DC7EC, 0xFFC000813DC7,
+    0xF3FFFDFFFFFDDFFF, 0xFFCF27603DDF, 0xF3EFFDFFFFFDDFEF, 0xEFFCF60603DDF,
+    0xFFFFFFFFFFFDDFFF, 0xFC00FFCF80F07DDF, 0x2FFBFFFFFC7FFFEE,
+    0xCFFC0FF5F847F, 0x7FFFFFFFFFFFFFE, 0x3FF7FFF, 0x3FFFFFAFFFFFF7D6,
+    0xF3FF7F5F, 0xC2A003FF03000001, 0xFFFE1FFFFFFFFEFF, 0x1FFFFFFFFEFFFFDF,
+    0x40, 0xFFFFFFFFFFFF03FF, 0xFFFFFFFF3FFFFFFF, 0xF7FFFFFFFFFF20BF,
+    0xFFFFFFFF3D7F3DFF, 0x7F3DFFFFFFFF3DFF, 0xFFFFFFFFFF7FFF3D,
+    0xFFFFFFFFFF3DFFFF, 0x3FE00E7FFFFFF, 0xFFFFFFFF0000FFFF,
+    0x3F3FFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFE, 0xFFFF9FFFFFFFFFFF,
+    0xFFFFFFFF07FFFFFE, 0x1FFC7FFFFFFFFFF, 0x1FFFFF803FFFFF, 0xDDFFF000FFFFF,
+    0x3FF308FFFFF, 0xFFFFFFFF03FFB800, 0x1FFFFFFFFFFFFFF, 0xFFFF07FFFFFFFFFF,
+    0x3FFFFFFFFFFFFF, 0xFFF0FFF7FFFFFFF, 0x1F3FFFFFFFFFC0, 0xFFFF0FFFFFFFFFFF,
+    0x7FF03FF, 0xFFFFFFFF0FFFFFFF, 0x9FFFFFFF7FFFFFFF, 0xBFFF008003FF03FF,
+    0x7FFF, 0xFF80003FF1FFF, 0xFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFF,
+    0x3FFFFFFFFFFFE3FF, 0xE7FFFFFFFFFF01FF, 0x7FFFFFFFFF70000,
+    0xFFFFFFFF3F3FFFFF, 0x3FFFFFFFAAFF3F3F, 0x5FDFFFFFFFFFFFFF,
+    0x1FDC1FFF0FCF1FDC, 0x8000000000003000, 0x8002000000100001, 0x1FFF0000,
+    0x1FFE21FFF0000, 0xF3FFFD503F2FFC84, 0xFFFFFFFF000043E0, 0x1FF, 0,
+    0xFF81FFFFFFFFF, 0xFFFF20BFFFFFFFFF, 0x800080FFFFFFFFFF,
+    0x7F7F7F7F007FFFFF, 0xFFFFFFFF7F7F7F7F, 0x1F3EFFFE000000E0,
+    0xFFFFFFFEE67FFFFF, 0xFFFEFFFFFFFFFFE0, 0xFFFFFFFF00007FFF,
+    0xFFFF000000000000, 0x1FFF, 0x3FFFFFFFFFFF0000, 0xFFFFFFF1FFF,
+    0xBFF0FFFFFFFFFFFF, 0x3FFFFFFFFFFFF, 0xFFFFFFFCFF800000,
+    0xFFFFFFFFFFFFF9FF, 0xFFFC000003EB07FF, 0x10FFFFFFFFFF,
+    0xE8FFFFFF03FF003F, 0xFFFF3FFFFFFFFFFF, 0x1FFFFFFF000FFFFF,
+    0x7FFFFFFF03FF8001, 0x7FFFFFFFFFFFFF, 0xFC7FFFFF03FF3FFF,
+    0x7CFFFF38000007, 0xFFFF7F7F007E7E7E, 0xFFFF03FFF7FFFFFF,
+    0x3FF37FFFFFFFFFF, 0xFFFF000FFFFFFFFF, 0xFFFFFFFFFFFF87F, 0x3FFFFFF,
+    0x5F7FFDFFE0F8007F, 0xFFFFFFFFFFFFFFDB, 0xFFFFFFFFFFF80000,
+    0xFFFFFFF03FFFFFFF, 0x3FFFFFFFFFFFFFFF, 0xFFFFFFFFFFFF0000,
+    0xFFFFFFFFFFFCFFFF, 0x3FF0000000000FF, 0x18FFFF0000FFFF,
+    0xAA8A00000000E000, 0x1FFFFFFFFFFFFFFF, 0x87FFFFFE03FF0000,
+    0xFFFFFFE007FFFFFE, 0x7FFFFFFFFFFFFFFF, 0x1CFCFCFC,
+  ],
+  tree3_level1: &[
+    0, 1, 2, 3, 4, 5, 6, 7, 8, 5, 9, 10, 11, 12, 13, 14, 7, 7, 7, 7, 7, 7, 7,
+    7, 7, 7, 15, 16, 17, 7, 18, 19, 7, 20, 21, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 22, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+  ],
+  tree3_level2: &[
+    0, 1, 2, 3, 4, 5, 4, 6, 4, 4, 7, 8, 9, 10, 11, 12, 2, 2, 13, 14, 15, 16,
+    17, 4, 2, 2, 2, 2, 18, 19, 20, 4, 21, 22, 23, 24, 25, 4, 26, 4, 27, 28,
+    29, 30, 31, 32, 33, 4, 2, 34, 35, 35, 36, 4, 4, 4, 4, 4, 37, 38, 39, 40,
+    41, 42, 2, 43, 3, 44, 45, 46, 2, 47, 48, 49, 50, 51, 52, 53, 4, 4, 2, 54,
+    2, 55, 4, 4, 56, 57, 2, 58, 59, 60, 61, 62, 4, 4, 3, 4, 63, 64, 65, 66,
+    67, 68, 69, 70, 71, 59, 4, 4, 4, 4, 72, 73, 74, 4, 75, 76, 77, 4, 4, 4, 4,
+    78, 79, 80, 81, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 82, 4, 2, 83,
+    2, 2, 2, 84, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 85, 86, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 87, 88, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 62, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2,
+    2, 2, 2, 2, 2, 2, 2, 59, 89, 69, 90, 18, 91, 92, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 2, 4, 4, 2, 93, 94, 95, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 96, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 88, 34, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 97, 2, 2, 2, 2, 98, 99, 2, 2, 2, 2, 2, 100, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 2, 101, 102, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 103, 62, 4, 4, 4, 4, 4, 4, 4, 104, 105, 4, 4, 106, 4,
+    4, 4, 4, 4, 4, 2, 107, 108, 109, 110, 111, 2, 2, 2, 2, 112, 113, 114, 115,
+    116, 117, 4, 4, 4, 4, 4, 4, 4, 4, 118, 119, 120, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 121, 4, 4, 4, 122, 123, 124, 4, 125, 126, 4, 4,
+    4, 4, 127, 128, 4, 4, 4, 4, 4, 4, 4, 129, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    130, 2, 2, 2, 131, 2, 132, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 133, 134, 135, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 136, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 137, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 128, 2, 2, 2,
+    11, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 138, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 139, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 140, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2,
+    2, 2, 2, 2, 140, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 141, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 87, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 87, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+  ],
+  tree3_level3: &[
+    0xB7FFFF7FFFFFEFFF, 0x3FFF3FFF, 0xFFFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFF, 0,
+    0x1FFFFFFFFFFFFF, 0x2000000000000000, 0xFFFFFFFF1FFFFFFF, 0x10001FFFF,
+    0xFFFFE000FFFFFFFF, 0x7FFFFFFFFFF07FF, 0xFFFFFFFF3FFFFFFF, 0x3EFF0F,
+    0xFFFF03FF3FFFFFFF, 0xFFFFFFFFF0FFFFF, 0xFFFF00FFFFFFFFFF,
+    0xF7FF000FFFFFFFFF, 0x1BFBFFFBFFB7F7FF, 0x7FFFFFFFFFFFFF, 0xFF003FFFFF,
+    0x7FDFFFFFFFFFFBF, 0x91BFFFFFFFFFFD3F, 0x7FFFFF003FFFFF, 0x7FFFFFFF,
+    0x37FFFF00000000, 0x3FFFFFF003FFFFF, 0xC0FFFFFFFFFFFFFF,
+    0x873FFFFFFEEFF06F, 0x1FFFFFFF00000000, 0x1FFFFFFF, 0x7FFFFFFEFF,
+    0x3FFFFFFFFFFFFF, 0x7FFFF003FFFFF, 0x3FFFF, 0x1FF, 0x7FFFFFFFFFFFF,
+    0x3FF00FFFFFFFFFF, 0x31BFFFFFFFFFF, 0xE000000000000000,
+    0xFFFF00801FFFFFFF, 0xFFFF00000001FFFF, 0xFFFF00000000003F,
+    0x7FFFFF0000001F, 0x803FFFC00000007F, 0x3FF01FFFFFF0004,
+    0xFFDFFFFFFFFFFFFF, 0x4FFFFFFFFF00F0, 0x17FFDE1F, 0xC0FFFFFFFFFBFFFF, 0x3,
+    0xFFFF01FFBFFFBD7F, 0x3FF07FFFFFFFFFF, 0xFBEDFDFFFFF99FEF,
+    0x1F1FCFE081399F, 0x3C3FF07FF, 0x3FF00BF, 0xFF3FFFFFFFFFFFFF, 0x3F000001,
+    0x3FF0011, 0x1FFFFFFFFFFFFFF, 0x3FF, 0x3FF0FFFE7FFFFFF, 0x7F,
+    0xFFFFFFFF00000000, 0x800003FFFFFFFFFF, 0xF9BFFFFFFF6FF27F, 0x3FF000F,
+    0xFFFFFCFF00000000, 0x1BFCFFFFFF, 0x7FFFFFFFFFFFFFFF, 0xFFFFFFFFFFFF0080,
+    0xFFFF000023FFFFFF, 0xFF7FFFFFFFFFFDFF, 0xFFFC000003FF0001,
+    0x7FFEFFFFFCFFFF, 0xB47FFFFFFFFFFB7F, 0xFFFFFDBF03FF00FF, 0x3FF01FB7FFF,
+    0x7FFFFF00000000, 0xC7FFFFFFFFFDFFFF, 0x3FF0007, 0x1000000000000,
+    0x3FFFFFF, 0x7FFFFFFFFFFF, 0xF, 0xFFFFFFFFFFFF0000, 0x1FFFFFFFFFFFF,
+    0xFFFFFFFFFFFF, 0x3FFFFF, 0xFFFF03FF7FFFFFFF, 0x1F3FFFFFFF03FF,
+    0xE0FFFFF803FF000F, 0xFFFF, 0xFFFFFFFFFFFF87FF, 0xFFFF80FF,
+    0x3001B00000000, 0xFFFFFFFFFFFFFF, 0x6FEF000000000000, 0x40007FFFFFFFF,
+    0xFFFF00F000270000, 0xFFFFFFFFFFFFFFF, 0x1FFF07FFFFFFFFFF, 0x63FF01FF,
+    0xFFFF3FFFFFFFFFFF, 0xF807E3E000000000, 0x3C0000000FE7, 0x1C,
+    0xFFFFFFFFFFDFFFFF, 0xEBFFDE64DFFFFFFF, 0xFFFFFFFFFFFFFFEF,
+    0x7BFFFFFFDFDFE7BF, 0xFFFFFFFFFFFDFC5F, 0xFFFFFF3FFFFFFFFF,
+    0xF7FFFFFFF7FFFFFD, 0xFFDFFFFFFFDFFFFF, 0xFFFF7FFFFFFF7FFF,
+    0xFFFFFDFFFFFFFDFF, 0xFFFFFFFFFFFFCFF7, 0xF87FFFFFFFFFFFFF,
+    0x201FFFFFFFFFFF, 0xFFFEF8000010, 0x7E07FFFFFFF, 0xFFFF07DBF9FFFF7F,
+    0x3FFFFFFFFFFF, 0x8000, 0x3FFF1FFFFFFFFFFF, 0x43FF, 0x7FFFFFFF0000,
+    0x3FFFFFFFFFFFFFF, 0x3FFFFFFFFFF0000, 0x7FFF6F7F00000000, 0x7F001F,
+    0x3FF0FFF, 0xAF7FE96FFFFFFEF, 0x5EF7F796AA96EA84, 0xFFFFBEE0FFFFBFF,
+    0x3FF000000000000, 0xFFFFFFFF, 0xFFFF0003FFFFFFFF, 0xFFFF0001FFFFFFFF,
+    0x3FFFFFFF, 0xFFFFFFFFFFFF07FF,
+  ],
+};
+
+pub const XID_START: &'static ::ucd_trie::TrieSet = &::ucd_trie::TrieSet {
+  tree1_level1: &[
+    0, 0x7FFFFFE07FFFFFE, 0x420040000000000, 0xFF7FFFFFFF7FFFFF,
+    0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF,
+    0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF,
+    0xFFFFFFFFFFFFFFFF, 0x501F0003FFC3, 0, 0xB8DF000000000000,
+    0xFFFFFFFBFFFFD740, 0xFFBFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF,
+    0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFC03, 0xFFFFFFFFFFFFFFFF,
+    0xFFFEFFFFFFFFFFFF, 0xFFFFFFFF027FFFFF, 0x1FF, 0x787FFFFFF0000,
+    0xFFFFFFFF00000000, 0xFFFEC000000007FF, 0xFFFFFFFFFFFFFFFF,
+    0x9C00C060002FFFFF, 0xFFFFFFFD0000, 0xFFFFFFFFFFFFE000, 0x2003FFFFFFFFF,
+    0x43007FFFFFFFC00,
+  ],
+  tree2_level1: &[
+    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+    21, 22, 23, 24, 23, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 35, 35,
+    35, 35, 36, 37, 38, 39, 40, 41, 42, 43, 35, 35, 35, 35, 35, 35, 35, 35,
+    44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 3, 58, 59, 60, 30,
+    61, 62, 63, 64, 65, 66, 67, 68, 35, 35, 35, 30, 35, 35, 35, 35, 69, 70,
+    71, 72, 30, 73, 74, 30, 75, 76, 77, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+    30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+    30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 35, 35, 35, 78,
+    79, 80, 81, 82, 30, 30, 30, 30, 30, 30, 30, 30, 83, 43, 84, 85, 86, 35,
+    87, 88, 30, 30, 30, 30, 30, 30, 30, 30, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 30, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 89, 90, 35, 35, 35, 35, 91, 92,
+    93, 94, 95, 35, 96, 97, 98, 49, 99, 100, 101, 102, 103, 104, 105, 106,
+    107, 108, 109, 110, 35, 111, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+    35, 112, 113, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+    30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+    30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+    30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+    30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+    30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+    30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+    30, 30, 30, 30, 30, 30, 30, 30, 30, 35, 35, 35, 35, 35, 114, 35, 115, 116,
+    117, 118, 119, 35, 120, 35, 35, 121, 122, 123, 124, 30, 125, 35, 126, 127,
+    128, 129, 130,
+  ],
+  tree2_level2: &[
+    0x110043FFFFF, 0xFFFF07FF01FFFFFF, 0xFFFFFFFF00007EFF, 0x3FF,
+    0x23FFFFFFFFFFFFF0, 0xFFFE0003FF010000, 0x23C5FDFFFFF99FE1,
+    0x10030003B0004000, 0x36DFDFFFFF987E0, 0x1C00005E000000,
+    0x23EDFDFFFFFBBFE0, 0x200000300010000, 0x23EDFDFFFFF99FE0,
+    0x20003B0000000, 0x3FFC718D63DC7E8, 0x10000, 0x23FFFDFFFFFDDFE0,
+    0x327000000, 0x23EFFDFFFFFDDFE1, 0x6000360000000, 0x27FFFFFFFFFDDFF0,
+    0xFC00000380704000, 0x2FFBFFFFFC7FFFE0, 0x7F, 0x5FFFFFFFFFFFE,
+    0x2005FFAFFFFFF7D6, 0xF000005F, 0x1, 0x1FFFFFFFFEFF, 0x1F00, 0,
+    0x800007FFFFFFFFFF, 0xFFE1C0623C3F0000, 0xFFFFFFFF00004003,
+    0xF7FFFFFFFFFF20BF, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFF3D7F3DFF,
+    0x7F3DFFFFFFFF3DFF, 0xFFFFFFFFFF7FFF3D, 0xFFFFFFFFFF3DFFFF, 0x7FFFFFF,
+    0xFFFFFFFF0000FFFF, 0x3F3FFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFE,
+    0xFFFF9FFFFFFFFFFF, 0xFFFFFFFF07FFFFFE, 0x1FFC7FFFFFFFFFF,
+    0x3FFFF8003FFFF, 0x1DFFF0003FFFF, 0xFFFFFFFFFFFFF, 0x10800000,
+    0xFFFFFFFF00000000, 0x1FFFFFFFFFFFFFF, 0xFFFF05FFFFFFFFFF,
+    0x3FFFFFFFFFFFFF, 0x7FFFFFFF, 0x1F3FFFFFFF0000, 0xFFFF0FFFFFFFFFFF,
+    0xFFFFFFFF007FFFFF, 0x1FFFFF, 0x8000000000, 0xFFFFFFFFFFFE0, 0x1FE0,
+    0xFC00C001FFFFFFF8, 0x3FFFFFFFFF, 0xFFFFFFFFF, 0x3FFFFFFFFC00E000,
+    0xE7FFFFFFFFFF01FF, 0x46FDE0000000000, 0xFFFFFFFF3F3FFFFF,
+    0x3FFFFFFFAAFF3F3F, 0x5FDFFFFFFFFFFFFF, 0x1FDC1FFF0FCF1FDC,
+    0x8002000000000000, 0x1FFF0000, 0xF3FFFD503F2FFC84, 0xFFFFFFFF000043E0,
+    0x1FF, 0xC781FFFFFFFFF, 0xFFFF20BFFFFFFFFF, 0x80FFFFFFFFFF,
+    0x7F7F7F7F007FFFFF, 0x7F7F7F7F, 0x1F3E03FE000000E0, 0xFFFFFFFEE07FFFFF,
+    0xF7FFFFFFFFFFFFFF, 0xFFFEFFFFFFFFFFE0, 0xFFFFFFFF00007FFF,
+    0xFFFF000000000000, 0x1FFF, 0x3FFFFFFFFFFF0000, 0xC00FFFF1FFF,
+    0x80007FFFFFFFFFFF, 0xFFFFFFFF3FFFFFFF, 0xFFFFFFFFFFFF,
+    0xFFFFFFFCFF800000, 0xFFFFFFFFFFFFF9FF, 0xFFFC000003EB07FF, 0x7FFFFF7BB,
+    0xFFFFFFFFFFFFC, 0x68FC000000000000, 0xFFFF003FFFFFFC00,
+    0x1FFFFFFF0000007F, 0x7FFFFFFFFFFF0, 0x7C00FFDF00008000, 0x1FFFFFFFFFF,
+    0xC47FFFFF00000FF7, 0x3E62FFFFFFFFFFFF, 0x1C07FF38000005,
+    0xFFFF7F7F007E7E7E, 0xFFFF03FFF7FFFFFF, 0x7FFFFFFFF, 0xFFFF000FFFFFFFFF,
+    0xFFFFFFFFFFFF87F, 0xFFFF3FFFFFFFFFFF, 0x3FFFFFF, 0x5F7FFDFFA0F8007F,
+    0xFFFFFFFFFFFFFFDB, 0x3FFFFFFFFFFFF, 0xFFFFFFFFFFF80000,
+    0xFFFFFFF03FFFFFFF, 0x3FFFFFFFFFFFFFFF, 0xFFFFFFFFFFFF0000,
+    0xFFFFFFFFFFFCFFFF, 0x3FF0000000000FF, 0xAA8A000000000000,
+    0x1FFFFFFFFFFFFFFF, 0x7FFFFFE00000000, 0xFFFFFFC007FFFFFE,
+    0x7FFFFFFF3FFFFFFF, 0x1CFCFCFC,
+  ],
+  tree3_level1: &[
+    0, 1, 2, 3, 4, 5, 6, 7, 8, 5, 9, 10, 5, 11, 12, 5, 7, 7, 7, 7, 7, 7, 7, 7,
+    7, 7, 13, 14, 15, 7, 16, 17, 7, 18, 19, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+  ],
+  tree3_level2: &[
+    0, 1, 2, 3, 4, 5, 4, 4, 4, 4, 6, 7, 8, 9, 10, 11, 2, 2, 12, 13, 14, 15,
+    16, 4, 2, 2, 2, 2, 17, 18, 19, 4, 20, 21, 22, 23, 24, 4, 25, 4, 26, 27,
+    28, 29, 30, 31, 32, 4, 2, 33, 34, 34, 35, 4, 4, 4, 4, 4, 36, 4, 37, 38,
+    39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 22, 52, 53, 4, 4, 5,
+    54, 55, 56, 4, 4, 57, 58, 55, 59, 60, 4, 61, 62, 4, 4, 63, 4, 64, 65, 66,
+    67, 68, 69, 70, 71, 72, 73, 4, 4, 4, 4, 74, 75, 76, 4, 77, 78, 79, 4, 4,
+    4, 4, 80, 81, 4, 82, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 83, 4,
+    2, 57, 2, 2, 2, 84, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 85, 86,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 55, 87, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 62, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 2, 2, 2, 2, 2, 2, 2, 2, 73, 88, 89, 90, 55, 91, 76, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 2, 4, 4, 2, 92, 93, 94, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 95, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 96, 33, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 97, 2, 2, 2, 2, 98, 99, 2, 2, 2, 2, 2, 100, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 2, 101, 102, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 103, 104, 105, 106, 107,
+    2, 2, 2, 2, 108, 109, 110, 111, 112, 113, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 114, 4, 4, 4, 115, 116,
+    4, 4, 117, 118, 4, 4, 4, 4, 90, 63, 4, 4, 4, 4, 4, 4, 4, 119, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 120, 2, 2, 2, 121, 2, 122, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 123, 124, 125, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 126, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 127, 2, 2, 2, 10, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 128, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 129, 2, 2, 2, 2, 2, 2, 2, 2, 2, 130, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 130, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 131, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    55, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4,
+  ],
+  tree3_level3: &[
+    0xB7FFFF7FFFFFEFFF, 0x3FFF3FFF, 0xFFFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFF, 0,
+    0x1FFFFFFFFFFFFF, 0xFFFFFFFF1FFFFFFF, 0x1FFFF, 0xFFFFE000FFFFFFFF,
+    0x3FFFFFFFFF07FF, 0xFFFFFFFF3FFFFFFF, 0x3EFF0F, 0xFFFF00003FFFFFFF,
+    0xFFFFFFFFF0FFFFF, 0xFFFF00FFFFFFFFFF, 0xF7FF000FFFFFFFFF,
+    0x1BFBFFFBFFB7F7FF, 0x7FFFFFFFFFFFFF, 0xFF003FFFFF, 0x7FDFFFFFFFFFFBF,
+    0x91BFFFFFFFFFFD3F, 0x7FFFFF003FFFFF, 0x7FFFFFFF, 0x37FFFF00000000,
+    0x3FFFFFF003FFFFF, 0xC0FFFFFFFFFFFFFF, 0x3FFFFFFEEF0001,
+    0x1FFFFFFF00000000, 0x1FFFFFFF, 0x1FFFFFFEFF, 0x3FFFFFFFFFFFFF,
+    0x7FFFF003FFFFF, 0x3FFFF, 0x1FF, 0x7FFFFFFFFFFFF, 0xFFFFFFFFF,
+    0x303FFFFFFFFFF, 0xFFFF00801FFFFFFF, 0xFFFF00000000003F,
+    0xFFFF000000000003, 0x7FFFFF0000001F, 0xFFFFFFFFFFFFF8, 0x26000000000000,
+    0xFFFFFFFFFFF8, 0x1FFFFFF0000, 0x7FFFFFFFF8, 0x47FFFFFFFF0090,
+    0x7FFFFFFFFFFF8, 0x1400001E, 0x80000FFFFFFBFFFF, 0x1, 0xFFFF01FFBFFFBD7F,
+    0x23EDFDFFFFF99FE0, 0x3E0010000, 0x380000780, 0xFFFFFFFFFFFF, 0xB0,
+    0x7FFFFFFFFFFF, 0xF000000, 0x10, 0x10007FFFFFFFFFF, 0x7FFFFFF, 0x7F,
+    0xFFFFFFFFFFF, 0xFFFFFFFF00000000, 0x80000000FFFFFFFF, 0x8000FFFFFF6FF27F,
+    0x2, 0xFFFFFCFF00000000, 0xA0001FFFF, 0x407FFFFFFFFF801,
+    0xFFFFFFFFF0010000, 0xFFFF0000200003FF, 0x1FFFFFFFFFFFFFF, 0x7FFFFFFFFDFF,
+    0xFFFC000000000001, 0xFFFF, 0x1FFFFFFFFFB7F, 0xFFFFFDBF00000040,
+    0x10003FF, 0x7FFFF00000000, 0xFFFFFFFFDFFF4, 0x1000000000000, 0x3FFFFFF,
+    0xF, 0xFFFFFFFFFFFF0000, 0x1FFFFFFFFFFFF, 0x7E, 0xFFFF00007FFFFFFF,
+    0x7FFFFFFFFFFFFFFF, 0x3FFFFFFF0000, 0xE0FFFFF80000000F, 0x107FF,
+    0xFFF80000, 0xB00000000, 0xFFFFFFFFFFFFFF, 0x3FFFFF, 0x6FEF000000000000,
+    0x40007FFFFFFFF, 0xFFFF00F000270000, 0xFFFFFFFFFFFFFFF,
+    0x1FFF07FFFFFFFFFF, 0x3FF01FF, 0xFFFFFFFFFFDFFFFF, 0xEBFFDE64DFFFFFFF,
+    0xFFFFFFFFFFFFFFEF, 0x7BFFFFFFDFDFE7BF, 0xFFFFFFFFFFFDFC5F,
+    0xFFFFFF3FFFFFFFFF, 0xF7FFFFFFF7FFFFFD, 0xFFDFFFFFFFDFFFFF,
+    0xFFFF7FFFFFFF7FFF, 0xFFFFFDFFFFFFFDFF, 0xFF7, 0x7E07FFFFFFF,
+    0xFFFF000000000000, 0x3FFFFFFFFFFF, 0x3F801FFFFFFFFFFF, 0x4000,
+    0xFFFFFFF0000, 0x7FFF6F7F00000000, 0x1F, 0x80F, 0xAF7FE96FFFFFFEF,
+    0x5EF7F796AA96EA84, 0xFFFFBEE0FFFFBFF, 0xFFFFFFFF, 0x3FFFFFFFFFFFFFF,
+    0xFFFF0003FFFFFFFF, 0xFFFF0001FFFFFFFF, 0x3FFFFFFF, 0xFFFFFFFFFFFF07FF,
+  ],
+};
diff -pruN 43.0.0-1/rust-vendor/unindent/.cargo-checksum.json 43.0.0-1ubuntu1/rust-vendor/unindent/.cargo-checksum.json
--- 43.0.0-1/rust-vendor/unindent/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unindent/.cargo-checksum.json	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1 @@
+{"files":{"Cargo.toml":"778373d89103f2c18c12558407a94e2bc382d82ad52747502f405c154d9919f4","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"13fe850f35f99ad1701eb640baada22f5cce3072a9e99006d1e4f7d3e847455d","src/lib.rs":"b335afdaf098418d54687e5ba19eb5465976f14df54e4dffd2eb00eb1558007e","src/unindent.rs":"988a92e473e8f033882e7236bab6d38ece304116f6ac9f6aaf6f25b4bb9f6d27"},"package":"c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce"}
\ No newline at end of file
diff -pruN 43.0.0-1/rust-vendor/unindent/Cargo.toml 43.0.0-1ubuntu1/rust-vendor/unindent/Cargo.toml
--- 43.0.0-1/rust-vendor/unindent/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unindent/Cargo.toml	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,36 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2021"
+name = "unindent"
+version = "0.2.3"
+authors = ["David Tolnay <dtolnay@gmail.com>"]
+description = "Remove a column of leading whitespace from a string"
+documentation = "https://docs.rs/unindent"
+readme = "README.md"
+keywords = [
+    "heredoc",
+    "nowdoc",
+    "multiline",
+    "string",
+    "literal",
+]
+categories = ["text-processing"]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/dtolnay/indoc"
+
+[package.metadata.docs.rs]
+rustdoc-args = ["--generate-link-to-definition"]
+targets = ["x86_64-unknown-linux-gnu"]
+
+[lib]
+doc-scrape-examples = false
diff -pruN 43.0.0-1/rust-vendor/unindent/LICENSE-APACHE 43.0.0-1ubuntu1/rust-vendor/unindent/LICENSE-APACHE
--- 43.0.0-1/rust-vendor/unindent/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unindent/LICENSE-APACHE	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,176 @@
+                              Apache License
+                        Version 2.0, January 2004
+                     http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+   "License" shall mean the terms and conditions for use, reproduction,
+   and distribution as defined by Sections 1 through 9 of this document.
+
+   "Licensor" shall mean the copyright owner or entity authorized by
+   the copyright owner that is granting the License.
+
+   "Legal Entity" shall mean the union of the acting entity and all
+   other entities that control, are controlled by, or are under common
+   control with that entity. For the purposes of this definition,
+   "control" means (i) the power, direct or indirect, to cause the
+   direction or management of such entity, whether by contract or
+   otherwise, or (ii) ownership of fifty percent (50%) or more of the
+   outstanding shares, or (iii) beneficial ownership of such entity.
+
+   "You" (or "Your") shall mean an individual or Legal Entity
+   exercising permissions granted by this License.
+
+   "Source" form shall mean the preferred form for making modifications,
+   including but not limited to software source code, documentation
+   source, and configuration files.
+
+   "Object" form shall mean any form resulting from mechanical
+   transformation or translation of a Source form, including but
+   not limited to compiled object code, generated documentation,
+   and conversions to other media types.
+
+   "Work" shall mean the work of authorship, whether in Source or
+   Object form, made available under the License, as indicated by a
+   copyright notice that is included in or attached to the work
+   (an example is provided in the Appendix below).
+
+   "Derivative Works" shall mean any work, whether in Source or Object
+   form, that is based on (or derived from) the Work and for which the
+   editorial revisions, annotations, elaborations, or other modifications
+   represent, as a whole, an original work of authorship. For the purposes
+   of this License, Derivative Works shall not include works that remain
+   separable from, or merely link (or bind by name) to the interfaces of,
+   the Work and Derivative Works thereof.
+
+   "Contribution" shall mean any work of authorship, including
+   the original version of the Work and any modifications or additions
+   to that Work or Derivative Works thereof, that is intentionally
+   submitted to Licensor for inclusion in the Work by the copyright owner
+   or by an individual or Legal Entity authorized to submit on behalf of
+   the copyright owner. For the purposes of this definition, "submitted"
+   means any form of electronic, verbal, or written communication sent
+   to the Licensor or its representatives, including but not limited to
+   communication on electronic mailing lists, source code control systems,
+   and issue tracking systems that are managed by, or on behalf of, the
+   Licensor for the purpose of discussing and improving the Work, but
+   excluding communication that is conspicuously marked or otherwise
+   designated in writing by the copyright owner as "Not a Contribution."
+
+   "Contributor" shall mean Licensor and any individual or Legal Entity
+   on behalf of whom a Contribution has been received by Licensor and
+   subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   copyright license to reproduce, prepare Derivative Works of,
+   publicly display, publicly perform, sublicense, and distribute the
+   Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   (except as stated in this section) patent license to make, have made,
+   use, offer to sell, sell, import, and otherwise transfer the Work,
+   where such license applies only to those patent claims licensable
+   by such Contributor that are necessarily infringed by their
+   Contribution(s) alone or by combination of their Contribution(s)
+   with the Work to which such Contribution(s) was submitted. If You
+   institute patent litigation against any entity (including a
+   cross-claim or counterclaim in a lawsuit) alleging that the Work
+   or a Contribution incorporated within the Work constitutes direct
+   or contributory patent infringement, then any patent licenses
+   granted to You under this License for that Work shall terminate
+   as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+   Work or Derivative Works thereof in any medium, with or without
+   modifications, and in Source or Object form, provided that You
+   meet the following conditions:
+
+   (a) You must give any other recipients of the Work or
+       Derivative Works a copy of this License; and
+
+   (b) You must cause any modified files to carry prominent notices
+       stating that You changed the files; and
+
+   (c) You must retain, in the Source form of any Derivative Works
+       that You distribute, all copyright, patent, trademark, and
+       attribution notices from the Source form of the Work,
+       excluding those notices that do not pertain to any part of
+       the Derivative Works; and
+
+   (d) If the Work includes a "NOTICE" text file as part of its
+       distribution, then any Derivative Works that You distribute must
+       include a readable copy of the attribution notices contained
+       within such NOTICE file, excluding those notices that do not
+       pertain to any part of the Derivative Works, in at least one
+       of the following places: within a NOTICE text file distributed
+       as part of the Derivative Works; within the Source form or
+       documentation, if provided along with the Derivative Works; or,
+       within a display generated by the Derivative Works, if and
+       wherever such third-party notices normally appear. The contents
+       of the NOTICE file are for informational purposes only and
+       do not modify the License. You may add Your own attribution
+       notices within Derivative Works that You distribute, alongside
+       or as an addendum to the NOTICE text from the Work, provided
+       that such additional attribution notices cannot be construed
+       as modifying the License.
+
+   You may add Your own copyright statement to Your modifications and
+   may provide additional or different license terms and conditions
+   for use, reproduction, or distribution of Your modifications, or
+   for any such Derivative Works as a whole, provided Your use,
+   reproduction, and distribution of the Work otherwise complies with
+   the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+   any Contribution intentionally submitted for inclusion in the Work
+   by You to the Licensor shall be under the terms and conditions of
+   this License, without any additional terms or conditions.
+   Notwithstanding the above, nothing herein shall supersede or modify
+   the terms of any separate license agreement you may have executed
+   with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+   names, trademarks, service marks, or product names of the Licensor,
+   except as required for reasonable and customary use in describing the
+   origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+   agreed to in writing, Licensor provides the Work (and each
+   Contributor provides its Contributions) on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+   implied, including, without limitation, any warranties or conditions
+   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+   PARTICULAR PURPOSE. You are solely responsible for determining the
+   appropriateness of using or redistributing the Work and assume any
+   risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+   whether in tort (including negligence), contract, or otherwise,
+   unless required by applicable law (such as deliberate and grossly
+   negligent acts) or agreed to in writing, shall any Contributor be
+   liable to You for damages, including any direct, indirect, special,
+   incidental, or consequential damages of any character arising as a
+   result of this License or out of the use or inability to use the
+   Work (including but not limited to damages for loss of goodwill,
+   work stoppage, computer failure or malfunction, or any and all
+   other commercial damages or losses), even if such Contributor
+   has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+   the Work or Derivative Works thereof, You may choose to offer,
+   and charge a fee for, acceptance of support, warranty, indemnity,
+   or other liability obligations and/or rights consistent with this
+   License. However, in accepting such obligations, You may act only
+   on Your own behalf and on Your sole responsibility, not on behalf
+   of any other Contributor, and only if You agree to indemnify,
+   defend, and hold each Contributor harmless for any liability
+   incurred by, or claims asserted against, such Contributor by reason
+   of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
diff -pruN 43.0.0-1/rust-vendor/unindent/LICENSE-MIT 43.0.0-1ubuntu1/rust-vendor/unindent/LICENSE-MIT
--- 43.0.0-1/rust-vendor/unindent/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unindent/LICENSE-MIT	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,23 @@
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -pruN 43.0.0-1/rust-vendor/unindent/README.md 43.0.0-1ubuntu1/rust-vendor/unindent/README.md
--- 43.0.0-1/rust-vendor/unindent/README.md	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unindent/README.md	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,65 @@
+# Unindent
+
+[<img alt="github" src="https://img.shields.io/badge/github-dtolnay/indoc-8da0cb?style=for-the-badge&labelColor=555555&logo=github" height="20">](https://github.com/dtolnay/indoc)
+[<img alt="crates.io" src="https://img.shields.io/crates/v/unindent.svg?style=for-the-badge&color=fc8d62&logo=rust" height="20">](https://crates.io/crates/unindent)
+[<img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-unindent-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs" height="20">](https://docs.rs/unindent)
+[<img alt="build status" src="https://img.shields.io/github/actions/workflow/status/dtolnay/indoc/ci.yml?branch=master&style=for-the-badge" height="20">](https://github.com/dtolnay/indoc/actions?query=branch%3Amaster)
+
+This crate provides [`indoc`]'s indentation logic for use with strings that are
+not statically known at compile time. For unindenting string literals, use
+`indoc` instead.
+
+[`indoc`]: https://github.com/dtolnay/indoc
+
+This crate exposes two functions:
+
+- `unindent(&str) -> String`
+- `unindent_bytes(&[u8]) -> Vec<u8>`
+
+```rust
+use unindent::unindent;
+
+fn main() {
+    let indented = "
+            line one
+            line two";
+    assert_eq!("line one\nline two", unindent(indented));
+}
+```
+
+## Explanation
+
+The following rules characterize the behavior of unindent:
+
+1. Count the leading spaces of each line, ignoring the first line and any lines
+   that are empty or contain spaces only.
+2. Take the minimum.
+3. If the first line is empty i.e. the string begins with a newline, remove the
+   first line.
+4. Remove the computed number of spaces from the beginning of each line.
+
+This means there are a few equivalent ways to format the same string, so choose
+one you like. All of the following result in the string `"line one\nline
+two\n"`:
+
+```
+unindent("          /      unindent(           /      unindent("line one
+   line one        /         "line one        /                 line two
+   line two       /           line two       /                  ")
+   ")            /            ")            /
+```
+
+## License
+
+Licensed under either of
+
+ * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
+ * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
+
+at your option.
+
+### Contribution
+
+Unless you explicitly state otherwise, any contribution intentionally submitted
+for inclusion in Indoc by you, as defined in the Apache-2.0 license, shall be
+dual licensed as above, without any additional terms or conditions.
diff -pruN 43.0.0-1/rust-vendor/unindent/src/lib.rs 43.0.0-1ubuntu1/rust-vendor/unindent/src/lib.rs
--- 43.0.0-1/rust-vendor/unindent/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unindent/src/lib.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,60 @@
+//! [![github]](https://github.com/dtolnay/indoc)&ensp;[![crates-io]](https://crates.io/crates/unindent)&ensp;[![docs-rs]](https://docs.rs/unindent)
+//!
+//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
+//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust
+//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs
+//!
+//! <br>
+//!
+//! ## Unindent
+//!
+//! This crate provides [`indoc`]'s indentation logic for use with strings that
+//! are not statically known at compile time. For unindenting string literals,
+//! use `indoc` instead.
+//!
+//! [`indoc`]: https://github.com/dtolnay/indoc
+//!
+//! This crate exposes two unindent functions and an extension trait:
+//!
+//! - `fn unindent(&str) -> String`
+//! - `fn unindent_bytes(&[u8]) -> Vec<u8>`
+//! - `trait Unindent`
+//!
+//! ```
+//! use unindent::unindent;
+//!
+//! fn main() {
+//!     let indented = "
+//!             line one
+//!             line two";
+//!     assert_eq!("line one\nline two", unindent(indented));
+//! }
+//! ```
+//!
+//! The `Unindent` extension trait expose the same functionality under an
+//! extension method.
+//!
+//! ```
+//! use unindent::Unindent;
+//!
+//! fn main() {
+//!     let indented = format!("
+//!             line {}
+//!             line {}", "one", "two");
+//!     assert_eq!("line one\nline two", indented.unindent());
+//! }
+//! ```
+
+#![doc(html_root_url = "https://docs.rs/unindent/0.2.3")]
+#![allow(
+    clippy::missing_panics_doc,
+    clippy::module_name_repetitions,
+    clippy::must_use_candidate,
+    clippy::needless_doctest_main,
+    clippy::trivially_copy_pass_by_ref,
+    clippy::type_complexity
+)]
+
+mod unindent;
+
+pub use crate::unindent::*;
diff -pruN 43.0.0-1/rust-vendor/unindent/src/unindent.rs 43.0.0-1ubuntu1/rust-vendor/unindent/src/unindent.rs
--- 43.0.0-1/rust-vendor/unindent/src/unindent.rs	1970-01-01 00:00:00.000000000 +0000
+++ 43.0.0-1ubuntu1/rust-vendor/unindent/src/unindent.rs	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,118 @@
+use std::slice::Split;
+
+pub fn unindent(s: &str) -> String {
+    let preserve_empty_first_line = false;
+    do_unindent(s, preserve_empty_first_line)
+}
+
+// Compute the maximal number of spaces that can be removed from every line, and
+// remove them.
+pub fn unindent_bytes(s: &[u8]) -> Vec<u8> {
+    let preserve_empty_first_line = false;
+    do_unindent_bytes(s, preserve_empty_first_line)
+}
+
+pub(crate) fn do_unindent(s: &str, preserve_empty_first_line: bool) -> String {
+    let bytes = s.as_bytes();
+    let unindented = do_unindent_bytes(bytes, preserve_empty_first_line);
+    String::from_utf8(unindented).unwrap()
+}
+
+fn do_unindent_bytes(s: &[u8], preserve_empty_first_line: bool) -> Vec<u8> {
+    // Document may start either on the same line as opening quote or
+    // on the next line
+    let ignore_first_line =
+        !preserve_empty_first_line && (s.starts_with(b"\n") || s.starts_with(b"\r\n"));
+
+    // Largest number of spaces that can be removed from every
+    // non-whitespace-only line after the first
+    let spaces = s
+        .lines()
+        .skip(1)
+        .filter_map(count_spaces)
+        .min()
+        .unwrap_or(0);
+
+    let mut result = Vec::with_capacity(s.len());
+    for (i, line) in s.lines().enumerate() {
+        if i > 1 || (i == 1 && !ignore_first_line) {
+            result.push(b'\n');
+        }
+        if i == 0 {
+            // Do not un-indent anything on same line as opening quote
+            result.extend_from_slice(line);
+        } else if line.len() > spaces {
+            // Whitespace-only lines may have fewer than the number of spaces
+            // being removed
+            result.extend_from_slice(&line[spaces..]);
+        }
+    }
+    result
+}
+
+pub trait Unindent {
+    type Output;
+
+    fn unindent(&self) -> Self::Output;
+}
+
+impl Unindent for str {
+    type Output = String;
+
+    fn unindent(&self) -> Self::Output {
+        unindent(self)
+    }
+}
+
+impl Unindent for String {
+    type Output = String;
+
+    fn unindent(&self) -> Self::Output {
+        unindent(self)
+    }
+}
+
+impl Unindent for [u8] {
+    type Output = Vec<u8>;
+
+    fn unindent(&self) -> Self::Output {
+        unindent_bytes(self)
+    }
+}
+
+impl<'a, T: ?Sized + Unindent> Unindent for &'a T {
+    type Output = T::Output;
+
+    fn unindent(&self) -> Self::Output {
+        (**self).unindent()
+    }
+}
+
+// Number of leading spaces in the line, or None if the line is entirely spaces.
+fn count_spaces(line: &[u8]) -> Option<usize> {
+    for (i, ch) in line.iter().enumerate() {
+        if *ch != b' ' && *ch != b'\t' {
+            return Some(i);
+        }
+    }
+    None
+}
+
+// Based on core::str::StrExt.
+trait BytesExt {
+    fn lines(&self) -> Split<u8, fn(&u8) -> bool>;
+}
+
+impl BytesExt for [u8] {
+    fn lines(&self) -> Split<u8, fn(&u8) -> bool> {
+        fn is_newline(b: &u8) -> bool {
+            *b == b'\n'
+        }
+        let bytestring = if self.starts_with(b"\r\n") {
+            &self[1..]
+        } else {
+            self
+        };
+        bytestring.split(is_newline as fn(&u8) -> bool)
+    }
+}
